@p4code/cli 0.8.34 → 0.8.37

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 (308) hide show
  1. package/dist/bin.mjs +1 -1
  2. package/dist/{binCli-CvWinVsO.mjs → binCli-mInzhqSL.mjs} +2242 -1476
  3. package/dist/client/.vite/manifest.json +2034 -2019
  4. package/dist/client/assets/{2NI2N5EU-Dlr3FZf7.js → 2NI2N5EU-DVsZziQ3.js} +2 -2
  5. package/dist/client/assets/{4UO7MD6I-Cy2sjs8O.js → 4UO7MD6I-Cs3yBe-m.js} +2 -2
  6. package/dist/client/assets/{5B3SVYGG-DaCwFaTp.js → 5B3SVYGG-CxW0L1iX.js} +2 -2
  7. package/dist/client/assets/{5GK6JWQ2-BVM9871F.js → 5GK6JWQ2-Cb25PEnx.js} +2 -2
  8. package/dist/client/assets/{5N7A7DKN-BVMU2dmG.js → 5N7A7DKN-udLyT643.js} +2 -2
  9. package/dist/client/assets/{5OC2THR4-2tkjJ38q.js → 5OC2THR4-DqD-reis.js} +2 -2
  10. package/dist/client/assets/{5S6HY5KT-BGTQzE2T.js → 5S6HY5KT-Cy7mIKKq.js} +2 -2
  11. package/dist/client/assets/{6IMQ5BUJ-DMdx9ktL.js → 6IMQ5BUJ-Qu9PVsT7.js} +2 -2
  12. package/dist/client/assets/{6OLKWJ4F-B0TXT19U.js → 6OLKWJ4F-BYzZS9mf.js} +2 -2
  13. package/dist/client/assets/{74OO7NKP-Cukz2OUS.js → 74OO7NKP-h3ga2-vb.js} +2 -2
  14. package/dist/client/assets/{75O6YZUN-D3k2sZNm.js → 75O6YZUN-ByAK3P56.js} +2 -2
  15. package/dist/client/assets/{77XECAW3-CjIq7P_x.js → 77XECAW3-D_lZqaZv.js} +2 -2
  16. package/dist/client/assets/{ABYRPUBD-hf0OeD7n.js → ABYRPUBD-BPWfXZyu.js} +2 -2
  17. package/dist/client/assets/AlertDialogRoot-BSP6M0Mu.js +2 -0
  18. package/dist/client/assets/{AnimatedHeight-CHpFDL1r.js → AnimatedHeight-D0-6CAPr.js} +2 -2
  19. package/dist/client/assets/{AuthSurfaceShell-whDvSlDA.js → AuthSurfaceShell-30QvY1bI.js} +2 -2
  20. package/dist/client/assets/{BB2UYUI2-RUQPN7sp.js → BB2UYUI2-CGgafKC2.js} +2 -2
  21. package/dist/client/assets/{BUM34MOA-f5Ez9vSp.js → BUM34MOA-Cn4iaSBT.js} +2 -2
  22. package/dist/client/assets/{CEQABKGZ-C2ZheKpY.js → CEQABKGZ-CmBEfzh3.js} +2 -2
  23. package/dist/client/assets/{CXAC5362-B0KvwGJk.js → CXAC5362-xibpmz3Y.js} +2 -2
  24. package/dist/client/assets/ChatGptUsageButton-DU3PVHJW.js +2 -0
  25. package/dist/client/assets/{ChatMarkdown-C2KOLN1s.js → ChatMarkdown-D-cNSjFn.js} +9 -9
  26. package/dist/client/assets/{CheckboxIndicator-zwVHomgm.js → CheckboxIndicator-CZCy38xt.js} +2 -2
  27. package/dist/client/assets/{ClippedText-Cx9jjhQp.js → ClippedText-D_rM_XDj.js} +2 -2
  28. package/dist/client/assets/{CodexSetupSection.logic-150217tr.js → CodexSetupSection.logic-g6_GE4bw.js} +2 -2
  29. package/dist/client/assets/{ComboboxClear-tzFhNwrk.js → ComboboxClear-tOmMpuVi.js} +2 -2
  30. package/dist/client/assets/{ComboboxGroupLabel-C1Icd2UF.js → ComboboxGroupLabel-CgZZIHwV.js} +2 -2
  31. package/dist/client/assets/{CommandBlock-D9QqOlDX.js → CommandBlock-6rjypfVF.js} +2 -2
  32. package/dist/client/assets/ComposerPromptEditor-Dxfhec2W.js +204 -0
  33. package/dist/client/assets/{CompositeRoot-BD0GlRg8.js → CompositeRoot-Bsb8efI6.js} +2 -2
  34. package/dist/client/assets/{ConnectionDiagnosisDetails-BQ3BFqRL.js → ConnectionDiagnosisDetails-Q0M5gCCf.js} +2 -2
  35. package/dist/client/assets/{ConnectionStatusDot-DLQm_zZ7.js → ConnectionStatusDot-DAuD0jkU.js} +2 -2
  36. package/dist/client/assets/{DRLTVNUE-vgHnaBR1.js → DRLTVNUE-BVseXOzv.js} +2 -2
  37. package/dist/client/assets/{DYY6UVD2-BQAAF_8A.js → DYY6UVD2-Bz33D3dq.js} +2 -2
  38. package/dist/client/assets/{DevicePanel-Yd3YuPQd.js → DevicePanel-CsSQr7vQ.js} +2 -2
  39. package/dist/client/assets/{DeviceSetup-DW4g9NNK.js → DeviceSetup-Cl7L9wsi.js} +2 -2
  40. package/dist/client/assets/{DialogTitle-DCMYEIWZ.js → DialogTitle-bcvBtKP-.js} +2 -2
  41. package/dist/client/assets/{DiffCommentAnnotation-BLItJ7Ia.js → DiffCommentAnnotation-bhzNqujM.js} +2 -2
  42. package/dist/client/assets/{DiffFileTree-B1-D1WV6.js → DiffFileTree-BySeJqhq.js} +2 -2
  43. package/dist/client/assets/DiffPanel-CCFas4eA.js +2 -0
  44. package/dist/client/assets/{DiffWorkerPoolProvider-BzkGX7xm.js → DiffWorkerPoolProvider-CkkqWbz-.js} +2 -2
  45. package/dist/client/assets/EmbeddedDesign-B4RMmwTG.css +1 -0
  46. package/dist/client/assets/EmbeddedDesign-iuThcPT3.js +21 -0
  47. package/dist/client/assets/{EnvironmentMachineIcon-5-erc8l_.js → EnvironmentMachineIcon-iUmoTUYt.js} +2 -2
  48. package/dist/client/assets/{ExpandableText-D2jzDgm7.js → ExpandableText-ByCx68yv.js} +2 -2
  49. package/dist/client/assets/{FNOVOB4O-CE98DPML.js → FNOVOB4O-DK3iet1g.js} +2 -2
  50. package/dist/client/assets/{FieldControl-CBMzQqd5.js → FieldControl-DtsEariK.js} +2 -2
  51. package/dist/client/assets/{FileDiff-2qSm00aV.js → FileDiff-Bu2BSqBV.js} +2 -2
  52. package/dist/client/assets/{FilePreviewPanel-Drpn6NuE.js → FilePreviewPanel-8cI8gciT.js} +4 -4
  53. package/dist/client/assets/{FoldedSettingsSection-Db7e_9rd.js → FoldedSettingsSection-RYq8GTvV.js} +2 -2
  54. package/dist/client/assets/{FormContext-BGRz6hhb.js → FormContext-CIK8MKa2.js} +2 -2
  55. package/dist/client/assets/{HDGCDEEZ-C0-Zci_l.js → HDGCDEEZ-B_J1N6RY.js} +2 -2
  56. package/dist/client/assets/{HSJLKHB7-4e5L-KC4.js → HSJLKHB7-B2SbZQUf.js} +2 -2
  57. package/dist/client/assets/{Icons-DwLGuyWf.js → Icons-xsXA_L6w.js} +2 -2
  58. package/dist/client/assets/Input-D3Qi4jCN.js +2 -0
  59. package/dist/client/assets/JZOYTAAL-BlxFvoz4.js +1 -0
  60. package/dist/client/assets/{K3MD6TGW-Gi4s7ooz.js → K3MD6TGW-VU68yYxr.js} +2 -2
  61. package/dist/client/assets/{K7RP3OMA-BVc6P2bZ.js → K7RP3OMA-zaD_NBVC.js} +2 -2
  62. package/dist/client/assets/{KeybindingsSettings.logic-CU23l8mP.js → KeybindingsSettings.logic-BJe27xmi.js} +2 -2
  63. package/dist/client/assets/{LHDIQX7Q-DbBCFdJr.js → LHDIQX7Q-DCLqoRGy.js} +2 -2
  64. package/dist/client/assets/{LUXOKEGN-C4n0-A1h.js → LUXOKEGN-CmxZpSzC.js} +2 -2
  65. package/dist/client/assets/{MathTypeset--azkeKic.js → MathTypeset-Hhqwg4PF.js} +2 -2
  66. package/dist/client/assets/{N3JZAHOW-2wC96xvZ.js → N3JZAHOW-Cev8Cn9M.js} +2 -2
  67. package/dist/client/assets/{NUIALGQ3-Di1L_kRJ.js → NUIALGQ3-CV92Kt25.js} +2 -2
  68. package/dist/client/assets/{NoProjectsHero-CC3oMKUV.js → NoProjectsHero-CMqIlSNl.js} +2 -2
  69. package/dist/client/assets/{O65XPQGZ-BeKB0m-p.js → O65XPQGZ-bGyTGMsB.js} +2 -2
  70. package/dist/client/assets/{O7XIQ6OM-1wrcdCMc.js → O7XIQ6OM-DVdEfB1N.js} +2 -2
  71. package/dist/client/assets/{OFQON5FD-CsMmmhLT.js → OFQON5FD-Ca_CNS26.js} +2 -2
  72. package/dist/client/assets/{P4ConnectAccountPages-BDxb29bY.js → P4ConnectAccountPages-Buss2oTL.js} +2 -2
  73. package/dist/client/assets/{P4ConnectSidebarSignIn-Dp5OsZBa.js → P4ConnectSidebarSignIn-D1n4y6Gq.js} +2 -2
  74. package/dist/client/assets/{PJQHF43J-CY_GpbqJ.js → PJQHF43J-B__IdKwP.js} +2 -2
  75. package/dist/client/assets/PanelLayoutControls-EIunk_2Q.js +216 -0
  76. package/dist/client/assets/{PierreEntryIcon-B5tjtDkE.js → PierreEntryIcon-GQImyog1.js} +2 -2
  77. package/dist/client/assets/{PopoverHandle-CZh3pqXt.js → PopoverHandle-Cj5egwXv.js} +2 -2
  78. package/dist/client/assets/PreviewPanel-BkFeksTl.js +2 -0
  79. package/dist/client/assets/ProjectDefaultsSettings-DX2Kf-tx.js +2 -0
  80. package/dist/client/assets/{ProjectFavicon-CkSteHLT.js → ProjectFavicon-OMOnEzVu.js} +3 -3
  81. package/dist/client/assets/{ProjectIconPickerDialog-9heAZbVC.js → ProjectIconPickerDialog-Q4GkqwDs.js} +2 -2
  82. package/dist/client/assets/{ProjectMonogram-DIqp1OmB.js → ProjectMonogram-Br5sgd24.js} +2 -2
  83. package/dist/client/assets/{ProviderAuthTerminal-BSsraub7.js → ProviderAuthTerminal-Q584HoOn.js} +2 -2
  84. package/dist/client/assets/ProviderModelPicker-JNM9nJs_.js +2 -0
  85. package/dist/client/assets/{ProviderSettingsForm-CAFBbrfr.js → ProviderSettingsForm-CdiKhrJE.js} +2 -2
  86. package/dist/client/assets/PullRequestCodeTab-Co76Qf6Z.js +6 -0
  87. package/dist/client/assets/{RHNBAITX-BdiF8iR_.js → RHNBAITX-Oryl0UiR.js} +2 -2
  88. package/dist/client/assets/{ReadOnlySourcePreview-BXDLfPcr.js → ReadOnlySourcePreview-aUjexBVb.js} +2 -2
  89. package/dist/client/assets/{RenderErrorBoundary-CR2cHAQ5.js → RenderErrorBoundary-Oe5BzG3n.js} +3 -3
  90. package/dist/client/assets/{SLD4V6NK-Bo1z-c9S.js → SLD4V6NK-DbsINoTD.js} +2 -2
  91. package/dist/client/assets/ScheduledTasksSettings-1uXNtcPA.js +4 -0
  92. package/dist/client/assets/{ScopedSwitch-CX4FTGjy.js → ScopedSwitch-D8-FelRH.js} +2 -2
  93. package/dist/client/assets/{ScrollAreaCorner-BCdJHqsj.js → ScrollAreaCorner-nnFi-Ecx.js} +2 -2
  94. package/dist/client/assets/{SecretInput-BPPzPNI1.js → SecretInput-CqAhFuNO.js} +2 -2
  95. package/dist/client/assets/{SelectScrollUpArrow-CR3Z6_pf.js → SelectScrollUpArrow-BQJrvk31.js} +2 -2
  96. package/dist/client/assets/{SettingsPanels-DoJnxtp0.js → SettingsPanels-CNgY_ZPe.js} +6 -6
  97. package/dist/client/assets/{SettingsPanels.logic-t7cG-B6z.js → SettingsPanels.logic-Dr_NyHjE.js} +2 -2
  98. package/dist/client/assets/{SettingsScopeNotice-DD4QFo3v.js → SettingsScopeNotice-BFxCBOnl.js} +2 -2
  99. package/dist/client/assets/{T3PCR2KE-Cg6A465M.js → T3PCR2KE-2R1FY5zG.js} +2 -2
  100. package/dist/client/assets/{TKWO2OVW-CWeCEb5C.js → TKWO2OVW-BjhIZzCe.js} +2 -2
  101. package/dist/client/assets/{TSHNXIZL-DTjzxHgA.js → TSHNXIZL-B_cvoUct.js} +2 -2
  102. package/dist/client/assets/{ThemeEditorPanel-BwydY72w.js → ThemeEditorPanel-B7MiqZ90.js} +3 -3
  103. package/dist/client/assets/{ThreadTerminalDrawer-QTFG89J_.js → ThreadTerminalDrawer-DHoyxd6-.js} +4 -4
  104. package/dist/client/assets/TooltipViewport-ThbbZQDo.js +2 -0
  105. package/dist/client/assets/{UQJE5E4I-DS4MjKhw.js → UQJE5E4I-2r98lr05.js} +2 -2
  106. package/dist/client/assets/{USNYFO5S-Be1OZGok.js → USNYFO5S-CvTI5t_o.js} +2 -2
  107. package/dist/client/assets/{Virtualizer-BpizRoFL.js → Virtualizer-BgcEI5KE.js} +2 -2
  108. package/dist/client/assets/{WEVWDWVA-oFS2VG1Y.js → WEVWDWVA-U7ygIdf3.js} +2 -2
  109. package/dist/client/assets/{WorkspaceBreadcrumb-ckARUoj9.js → WorkspaceBreadcrumb-_zND61qF.js} +2 -2
  110. package/dist/client/assets/{WorkspacePageContainer-D5yW7_av.js → WorkspacePageContainer-LYv_7Qc0.js} +2 -2
  111. package/dist/client/assets/{WorkspacePageHeader-CTWcEH7d.js → WorkspacePageHeader-B_0ute56.js} +2 -2
  112. package/dist/client/assets/{X5RFHQXM-Bjw0rDxX.js → X5RFHQXM-D4S0_b0W.js} +2 -2
  113. package/dist/client/assets/{X62E3GBT-BPHYY59t.js → X62E3GBT-CrIC4h9P.js} +2 -2
  114. package/dist/client/assets/{XBNEOJTC-W72qCYdc.js → XBNEOJTC-D2_RQZjM.js} +2 -2
  115. package/dist/client/assets/{YHV2MVVZ-DA_drdwk.js → YHV2MVVZ-BmAcJLBt.js} +2 -2
  116. package/dist/client/assets/{YURCZMG2-CsfrwNLG.js → YURCZMG2-RCCTu3bv.js} +2 -2
  117. package/dist/client/assets/{YVG2LODB-dXCBipzg.js → YVG2LODB-Cvp0Ei-1.js} +2 -2
  118. package/dist/client/assets/_chat-CwO3_WVM.js +45 -0
  119. package/dist/client/assets/{_chat.design-KVMajkdX.js → _chat.design-DX1VqYkX.js} +2 -2
  120. package/dist/client/assets/{_chat.index-BknTP6QZ.js → _chat.index-Dzh3d42S.js} +2 -2
  121. package/dist/client/assets/{_chat.new-DLFV1XOJ.js → _chat.new-BHRvXFPr.js} +3 -3
  122. package/dist/client/assets/_chat.pull-requests-BZilN1TK.js +2 -0
  123. package/dist/client/assets/{alert-Dh8AVuLe.js → alert-BN-r9V4f.js} +2 -2
  124. package/dist/client/assets/{assetUrls-C6W2_00u.js → assetUrls-B6vsSVWR.js} +2 -2
  125. package/dist/client/assets/assets-CID0y4Uv.js +2 -0
  126. package/dist/client/assets/{browserHistoryStore-CeBJcpoN.js → browserHistoryStore-CK4YsfkQ.js} +2 -2
  127. package/dist/client/assets/{browserLinkTarget-D5ew8rLG.js → browserLinkTarget-BJ30b4-s.js} +2 -2
  128. package/dist/client/assets/{checkbox-Y4v7A1IZ.js → checkbox-BJhN1L_L.js} +2 -2
  129. package/dist/client/assets/{color-picker-DEWeNc5K.js → color-picker-D2LwMwlZ.js} +2 -2
  130. package/dist/client/assets/{combobox-DGrx2JGy.js → combobox-Cw2-7qyI.js} +2 -2
  131. package/dist/client/assets/{command-DR1GjC1a.js → command-BIELTYJu.js} +2 -2
  132. package/dist/client/assets/composer-logic-P-jVPXi4.js +6 -0
  133. package/dist/client/assets/{composerDraftUploads-DK6jH0cB.js → composerDraftUploads-S66xDlS0.js} +2 -2
  134. package/dist/client/assets/{connect-B1NcR-kN.js → connect-D4llmZsa.js} +2 -2
  135. package/dist/client/assets/{connect-agent-BNrm24qs.js → connect-agent-BlR0FAbF.js} +2 -2
  136. package/dist/client/assets/{design-CbG6XJYX.js → design-Cdl1XCBU.js} +2 -2
  137. package/dist/client/assets/{device-6R-yC55P.js → device-Bc5H3PTz.js} +2 -2
  138. package/dist/client/assets/{dialog-BwjzOzO6.js → dialog-BRtKKGzk.js} +2 -2
  139. package/dist/client/assets/{diffRendering-CG_sb5me.js → diffRendering-DtBTalAD.js} +2 -2
  140. package/dist/client/assets/{dist-CFar2AY1.js → dist-oE_MNxpZ.js} +3 -3
  141. package/dist/client/assets/{draft-input-CpqOZR5i.js → draft-input-vviXwx5Q.js} +2 -2
  142. package/dist/client/assets/{duoViewer-BhE8QUaC.js → duoViewer-kcp00m8a.js} +2 -2
  143. package/dist/client/assets/{dynamic-CIBySV57.js → dynamic-C8_ODyue.js} +2 -2
  144. package/dist/client/assets/{embeddedScripts-B0vXhhvs.js → embeddedScripts-skldQmE1.js} +2 -2
  145. package/dist/client/assets/{empty-C0oiFHy_.js → empty-rC3eYvxq.js} +2 -2
  146. package/dist/client/assets/entities-B8Vupv5g.js +2 -0
  147. package/dist/client/assets/{fileLinks-CP5NWXaI.js → fileLinks-BoyzENAX.js} +2 -2
  148. package/dist/client/assets/{fileTreeExpansion-BKVd4HrC.js → fileTreeExpansion-DndrZZAD.js} +2 -2
  149. package/dist/client/assets/{getDiffFileInput-CIK5OMl_.js → getDiffFileInput-C1QBFdFu.js} +2 -2
  150. package/dist/client/assets/{guideRunStore-CegZr43-.js → guideRunStore-BgFFILxA.js} +2 -2
  151. package/dist/client/assets/{htmlRender-NqJI2UJ2.js → htmlRender-ddkOIEbT.js} +2 -2
  152. package/dist/client/assets/{index-Czsz7nXH.js → index-BwdieRvq.js} +3 -3
  153. package/dist/client/assets/{input-BCWES8Y7.js → input-BYd74ook.js} +2 -2
  154. package/dist/client/assets/{input-group-CfPOCEuC.js → input-group-DMFlSk_7.js} +2 -2
  155. package/dist/client/assets/{kbd-EDrgCOls.js → kbd-rp5mX21h.js} +2 -2
  156. package/dist/client/assets/{keybindings-BG7j7M7S.js → keybindings-B_kRk5Fi.js} +2 -2
  157. package/dist/client/assets/{lazy-D6W01WxZ.js → lazy-CeaQ3-Fj.js} +4 -4
  158. package/dist/client/assets/{lazyRouteComponent-B8CSLurY.js → lazyRouteComponent-COYyJY2H.js} +2 -2
  159. package/dist/client/assets/{link-COzhJ6br.js → link-CsXnX9WM.js} +2 -2
  160. package/dist/client/assets/{linkedPrompt-X4NBlFef.js → linkedPrompt-B5iI7U8H.js} +2 -2
  161. package/dist/client/assets/main-DdVSHl80.css +2 -0
  162. package/dist/client/assets/main-VfCRP294.js +29 -0
  163. package/dist/client/assets/{mediaReference-CKap6oNP.js → mediaReference-ZW7gfO5X.js} +2 -2
  164. package/dist/client/assets/{mediaSource-DG5l5-5f.js → mediaSource-DsT6G6Wm.js} +2 -2
  165. package/dist/client/assets/number-field-CEA6qXbs.js +2 -0
  166. package/dist/client/assets/{observeResize-BUAH1dvA.js → observeResize-DSyLC8QK.js} +2 -2
  167. package/dist/client/assets/{onboarding-CnVH7A6c.js → onboarding-BPkAEHBV.js} +2 -2
  168. package/dist/client/assets/{openFileInPreview-B0i3eZpu.js → openFileInPreview-CGM83ICx.js} +2 -2
  169. package/dist/client/assets/{p4ProjectFile-0RRo3hX4.js → p4ProjectFile-CwpteA7b.js} +2 -2
  170. package/dist/client/assets/{pair-B4KNAPh5.js → pair-D9v8gc0o.js} +2 -2
  171. package/dist/client/assets/{pendingSendStore-Dzn7x7Cg.js → pendingSendStore-BuEVrrEM.js} +2 -2
  172. package/dist/client/assets/{phoneViewer-RhpfiwR2.js → phoneViewer-CNE0SVmy.js} +2 -2
  173. package/dist/client/assets/{pierre-icons-Cisj4-__.js → pierre-icons-ChDlOt-h.js} +2 -2
  174. package/dist/client/assets/{popover-BnqKHl4L.js → popover-BjUpdrKu.js} +2 -2
  175. package/dist/client/assets/{preview-CiojYkh4.js → preview-3EscFepc.js} +2 -2
  176. package/dist/client/assets/{preview-Dwq2O7nm.js → preview-DHLYKEKb.js} +2 -2
  177. package/dist/client/assets/{previewMiniPlayerStore-ByZNhmNc.js → previewMiniPlayerStore-DHjQeV1U.js} +2 -2
  178. package/dist/client/assets/primary-NcsmRI6j.js +2 -0
  179. package/dist/client/assets/primaryCloudLinkState-DkXIVBHW.js +2 -0
  180. package/dist/client/assets/projectFilesQueryState-0jxJ50Qq.js +2 -0
  181. package/dist/client/assets/{projectScriptEditor-B4iSq27p.js → projectScriptEditor-CMGXoIEJ.js} +2 -2
  182. package/dist/client/assets/{providerSkills-C4Fu_qyq.js → providerSkills-4hnESoi_.js} +2 -2
  183. package/dist/client/assets/{pullRequestDetail.logic-BmYDDw_8.js → pullRequestDetail.logic-sbOM8yDW.js} +4 -4
  184. package/dist/client/assets/{pullRequestIcons-DFcQ9rtl.js → pullRequestIcons-B7Om_B_D.js} +2 -2
  185. package/dist/client/assets/{pullRequestReviewStore-BGzKslrq.js → pullRequestReviewStore-CIL8WfOG.js} +2 -2
  186. package/dist/client/assets/pullRequests-CMTRCOu7.js +2 -0
  187. package/dist/client/assets/queries-hhl_J8u9.js +2 -0
  188. package/dist/client/assets/query-CfGzD8v6.js +2 -0
  189. package/dist/client/assets/{radio-group-DOHTpBxX.js → radio-group-up2QNXjf.js} +2 -2
  190. package/dist/client/assets/{renderScheduler-Df4T8RWh.js → renderScheduler-Dgqqs-EX.js} +2 -2
  191. package/dist/client/assets/rightPanelStore-CGF0-d-1.js +2 -0
  192. package/dist/client/assets/runtime-Ca_Z-vg5.js +3 -0
  193. package/dist/client/assets/runtime-OeWFs5Hf.js +6 -0
  194. package/dist/client/assets/runtimeModeConfig-BTG9FTYe.js +2 -0
  195. package/dist/client/assets/{scheduledTasksSettings.logic-7E0KSnA7.js → scheduledTasksSettings.logic-BeuOnCov.js} +3 -3
  196. package/dist/client/assets/{scroll-area-B9LorBFb.js → scroll-area-BNQKEZbp.js} +2 -2
  197. package/dist/client/assets/{select-Ctq0UILH.js → select-D_zHR42Y.js} +2 -2
  198. package/dist/client/assets/selfImproveFindings-CAZ0j1GD.js +2 -0
  199. package/dist/client/assets/server-6nKYyc8r.js +2 -0
  200. package/dist/client/assets/{session-C7ckxjAM.js → session-BxUdP61p.js} +2 -2
  201. package/dist/client/assets/session-logic-Dr1plzXe.js +26 -0
  202. package/dist/client/assets/{settings-BqhxEPKC.js → settings-DE_hSu0q.js} +2 -2
  203. package/dist/client/assets/{settings.appearance-DljtCz6-.js → settings.appearance-C--uy4It.js} +2 -2
  204. package/dist/client/assets/settings.archived-D-55XnxQ.js +2 -0
  205. package/dist/client/assets/settings.computer-use-DhnqPqMm.js +2 -0
  206. package/dist/client/assets/settings.connections-BPVLazeK.js +2 -0
  207. package/dist/client/assets/{settings.data-controls-Cdccmn63.js → settings.data-controls-CIzGvqCI.js} +2 -2
  208. package/dist/client/assets/settings.decisions-CU-6rIpn.js +2 -0
  209. package/dist/client/assets/{settings.designs-TeCw-uLf.js → settings.designs-DHYhhG4k.js} +2 -2
  210. package/dist/client/assets/settings.diagnostics-csgW1_E8.js +2 -0
  211. package/dist/client/assets/{settings.general-uxwywmhh.js → settings.general-CeBkrL9-.js} +2 -2
  212. package/dist/client/assets/settings.integrations-DqSYBosl.js +2 -0
  213. package/dist/client/assets/{settings.keybindings-C0FBNk1_.js → settings.keybindings-C7D1i238.js} +2 -2
  214. package/dist/client/assets/{settings.open-source-licenses-wMwaYCss.js → settings.open-source-licenses-6oFDgAt7.js} +2 -2
  215. package/dist/client/assets/{settings.plugins-CFiDE3ms.js → settings.plugins-DfM65Xio.js} +4 -4
  216. package/dist/client/assets/{settings.projects-DN0n2td7.js → settings.projects-CeoZzdMW.js} +4 -4
  217. package/dist/client/assets/settings.providers-BBgppyE3.js +3 -0
  218. package/dist/client/assets/{settings.scheduled-tasks-uCL4Wgvt.js → settings.scheduled-tasks-Csi8wfij.js} +2 -2
  219. package/dist/client/assets/{settings.snap-shot-C4OHP0nR.js → settings.snap-shot-BdVdSIJy.js} +2 -2
  220. package/dist/client/assets/{settings.source-control-pMBspYC4.js → settings.source-control-Bme3qg7j.js} +2 -2
  221. package/dist/client/assets/{settings.storage-QCydiEyw.js → settings.storage-DTcg-0aj.js} +2 -2
  222. package/dist/client/assets/settingsLayout-4ySvFdXb.js +3 -0
  223. package/dist/client/assets/{sidebar-CRr8B41y.js → sidebar-CHDwV4Ca.js} +2 -2
  224. package/dist/client/assets/{sidebarProjectGrouping-miDXfjI3.js → sidebarProjectGrouping-BcOVY8p-.js} +2 -2
  225. package/dist/client/assets/{skeleton-C9J-Xl06.js → skeleton-BcLPbojY.js} +2 -2
  226. package/dist/client/assets/{sourceControl-C8nJMDiL.js → sourceControl-CPrl7cyO.js} +2 -2
  227. package/dist/client/assets/{sourceControlClients-DKONtKbZ.js → sourceControlClients-oNOd36Cq.js} +2 -2
  228. package/dist/client/assets/{spinner-CNva85zM.js → spinner-_ourbdVb.js} +2 -2
  229. package/dist/client/assets/{terminal-links-BJzLp7ix.js → terminal-links-DuZi4b83.js} +2 -2
  230. package/dist/client/assets/{terminalSessions-BPc8sBGR.js → terminalSessions-D0vbdqqx.js} +2 -2
  231. package/dist/client/assets/{textarea-DjRGRzMg.js → textarea-DlXXDHPJ.js} +2 -2
  232. package/dist/client/assets/{themePalette-fhKYLCuU.js → themePalette-VIM7Gehx.js} +3 -3
  233. package/dist/client/assets/toast-DXWclCrr.js +2 -0
  234. package/dist/client/assets/{toggle-Bbnow7xY.js → toggle-Dofc34s2.js} +2 -2
  235. package/dist/client/assets/{toggle-group-Cilo8czD.js → toggle-group-CYKsfBbD.js} +2 -2
  236. package/dist/client/assets/{tooltip-T5ePvxsH.js → tooltip-CY3W5y-f.js} +2 -2
  237. package/dist/client/assets/{uiStateStore-D9r3BNZ-.js → uiStateStore-CdkBStdp.js} +2 -2
  238. package/dist/client/assets/{usage-QBPLx2wr.js → usage-DQcgd75_.js} +2 -2
  239. package/dist/client/assets/{usageAccess-DUfVA8nU.js → usageAccess-CCSxXl9X.js} +2 -2
  240. package/dist/client/assets/{usageFormat-C-mTuUS7.js → usageFormat-ByjmRjTe.js} +2 -2
  241. package/dist/client/assets/{usageShortcuts-CB6TvooP.js → usageShortcuts-DOWm0Vo9.js} +2 -2
  242. package/dist/client/assets/{use-atom-command-BNkv9iyk.js → use-atom-command-vqjL7n-x.js} +2 -2
  243. package/dist/client/assets/{useAriaLabelledBy-D5HM2KLM.js → useAriaLabelledBy-B7FNFpmO.js} +2 -2
  244. package/dist/client/assets/{useHandleNewThread-DntRaFvm.js → useHandleNewThread-BYNZXzR_.js} +2 -2
  245. package/dist/client/assets/{useLocation-DbWity7H.js → useLocation-B_XV0lDx.js} +2 -2
  246. package/dist/client/assets/{useNavigate-Cxh24teV.js → useNavigate-BWqAWfiZ.js} +2 -2
  247. package/dist/client/assets/{useNavigateBack-B5mTfIHJ.js → useNavigateBack-C52nbvbb.js} +2 -2
  248. package/dist/client/assets/{useP4ConnectAuthPrompt-sjWWPvrn.js → useP4ConnectAuthPrompt-DKhdNYj8.js} +2 -2
  249. package/dist/client/assets/{useParams-D9PdK0IA.js → useParams-ekGanxxb.js} +2 -2
  250. package/dist/client/assets/{usePermissionStatus-D6i3IaCj.js → usePermissionStatus-CWV_yoZe.js} +2 -2
  251. package/dist/client/assets/{usePullRequestActions-9274Vp3W.js → usePullRequestActions-DxtkLQ5D.js} +3 -3
  252. package/dist/client/assets/{useRegisterFieldControl-DZyLTxKX.js → useRegisterFieldControl-BAJIcFiO.js} +2 -2
  253. package/dist/client/assets/{useScopedModelAvailability-CmlQi7Iz.js → useScopedModelAvailability-815e0x20.js} +2 -2
  254. package/dist/client/assets/useSettings-gPlpTIWi.js +3 -0
  255. package/dist/client/assets/utils-DhUt689t.js +37 -0
  256. package/dist/client/assets/vcsRefInvalidation-CW_MIqdt.js +2 -0
  257. package/dist/client/assets/{welcome-DVusCS_L.js → welcome-k7S47hyM.js} +2 -2
  258. package/dist/client/index.html +1 -1
  259. package/dist/{renderer-CJXpJ36b.mjs → renderer-Ay-1ojn7.mjs} +26 -3
  260. package/dist/{runtime-EqYv-lrV.mjs → runtime-bP6MSuMS.mjs} +150 -4
  261. package/package.json +2 -2
  262. package/dist/client/assets/AlertDialogRoot-BUODcEy9.js +0 -2
  263. package/dist/client/assets/ChatGptUsageButton-CMIjZ66V.js +0 -2
  264. package/dist/client/assets/ComposerPromptEditor-D2ObH3Py.js +0 -204
  265. package/dist/client/assets/DiffPanel-BGnRzWM8.js +0 -2
  266. package/dist/client/assets/EmbeddedDesign-BV_FcJ4l.js +0 -21
  267. package/dist/client/assets/EmbeddedDesign-Cud7UEy4.css +0 -1
  268. package/dist/client/assets/Input-DLaKk0qb.js +0 -2
  269. package/dist/client/assets/JZOYTAAL-SLYGD65P.js +0 -1
  270. package/dist/client/assets/PanelLayoutControls-CqeL3uQz.js +0 -216
  271. package/dist/client/assets/PreviewPanel-CvBQAq3I.js +0 -2
  272. package/dist/client/assets/ProjectDefaultsSettings-DLJfUN7i.js +0 -2
  273. package/dist/client/assets/ProviderModelPicker-AkULlCAn.js +0 -2
  274. package/dist/client/assets/PullRequestCodeTab-BamXVeZz.js +0 -6
  275. package/dist/client/assets/ScheduledTasksSettings-DF_KhqLx.js +0 -4
  276. package/dist/client/assets/TooltipViewport-C14m3uB7.js +0 -2
  277. package/dist/client/assets/_chat-BIqme2Hz.js +0 -46
  278. package/dist/client/assets/_chat.pull-requests-BDLRkW2A.js +0 -2
  279. package/dist/client/assets/assets-D-xsxvzf.js +0 -2
  280. package/dist/client/assets/composer-logic-BW4G8aDL.js +0 -6
  281. package/dist/client/assets/entities-Om5Klild.js +0 -2
  282. package/dist/client/assets/main-BGaSDXjP.js +0 -29
  283. package/dist/client/assets/main-BP1f3auf.css +0 -2
  284. package/dist/client/assets/number-field-DGdBjQD2.js +0 -2
  285. package/dist/client/assets/primary-CMwTDEi1.js +0 -2
  286. package/dist/client/assets/primaryCloudLinkState-2j4MjqVh.js +0 -2
  287. package/dist/client/assets/projectFilesQueryState-DXrTSOqg.js +0 -2
  288. package/dist/client/assets/pullRequests-DT0oG7tF.js +0 -2
  289. package/dist/client/assets/queries-CXgT6mki.js +0 -2
  290. package/dist/client/assets/query-DlK0I8Jc.js +0 -2
  291. package/dist/client/assets/rightPanelStore-DXw7-xK3.js +0 -2
  292. package/dist/client/assets/runtime-BL7IF4n-.js +0 -3
  293. package/dist/client/assets/runtime-Dm3Pi31_.js +0 -6
  294. package/dist/client/assets/runtimeModeConfig-_-kQoAWi.js +0 -2
  295. package/dist/client/assets/server-BvxyePeo.js +0 -2
  296. package/dist/client/assets/session-logic-P8gC-UQc.js +0 -26
  297. package/dist/client/assets/settings.archived-SsFK0IFf.js +0 -2
  298. package/dist/client/assets/settings.computer-use-CVmc70Ib.js +0 -2
  299. package/dist/client/assets/settings.connections-BrPlTKQ_.js +0 -2
  300. package/dist/client/assets/settings.decisions-pkwqjsKP.js +0 -2
  301. package/dist/client/assets/settings.diagnostics-BZD1uMGP.js +0 -2
  302. package/dist/client/assets/settings.integrations-Du282Gn7.js +0 -2
  303. package/dist/client/assets/settings.providers-DeUZZg7C.js +0 -3
  304. package/dist/client/assets/settingsLayout-DFYjWgKN.js +0 -3
  305. package/dist/client/assets/toast-BcjbmUtS.js +0 -2
  306. package/dist/client/assets/useSettings-BL4ZWGQV.js +0 -3
  307. package/dist/client/assets/utils-CrFJwxSd.js +0 -37
  308. package/dist/client/assets/vcsRefInvalidation-BPy1eoDi.js +0 -2
@@ -1,2 +1,2 @@
1
- import{a as e,t}from"./react-DH3P2YXY.js";import{n,t as r}from"./jsx-runtime-BnjsACtP.js";import{$n as i,Ic as a,Jn as o,Jp as s,K_ as c,Q_ as l,Ud as u,Yn as d,cm as f,df as p,dr as m,if as h,kd as g,nh as _,t as v,tr as y,ur as b,xp as x,zm as S}from"./utils-CrFJwxSd.js";import{R as C,W as w}from"./runtime-Dm3Pi31_.js";import{a as T,c as E,o as D,s as O,t as k}from"./select-Ctq0UILH.js";import{t as A}from"./useLocation-DbWity7H.js";import{i as j}from"./toast-BcjbmUtS.js";import{f as M}from"./server-BvxyePeo.js";import{i as ee,n as N,o as te}from"./session-C7ckxjAM.js";import{t as P}from"./use-atom-command-BNkv9iyk.js";import{t as ne}from"./env-wK1YYxA8.js";import{a as F,n as I,t as L}from"./tooltip-T5ePvxsH.js";import{t as R}from"./toggle-Bbnow7xY.js";import{t as re}from"./input-BCWES8Y7.js";import{i as ie}from"./keybindings-BG7j7M7S.js";import{i as ae,o as oe,t as z}from"./popover-BnqKHl4L.js";import{n as se,r as ce,t as B}from"./input-group-CfPOCEuC.js";import{n as le,t as ue}from"./kbd-EDrgCOls.js";import{V as de,W as fe,a as pe,i as me,s as he}from"./settingsLayout-DFYjWgKN.js";import{a as V,c as ge,f as _e,i as ve,l as ye,m as H,n as be,o as xe,p as U,r as Se,s as Ce,t as we,u as Te}from"./KeybindingsSettings.logic-CU23l8mP.js";import{Ta as Ee,ir as De,rr as Oe}from"./main-BGaSDXjP.js";var W=n(),G=e(t(),1),K=e(r(),1);function q(e){let t=(0,W.c)(6),{value:n}=e,r,i;if(t[0]!==n){let e=new Map,a=n.split(`+`).map(t=>{let n=e.get(t)??0;return e.set(t,n+1),{part:t,key:n===0?t:`${t}-${n}`}});r=le,i=a.map(ke),t[0]=n,t[1]=r,t[2]=i}else r=t[1],i=t[2];let a;return t[3]!==r||t[4]!==i?(a=(0,K.jsx)(r,{children:i}),t[3]=r,t[4]=i,t[5]=a):a=t[5],a}function ke(e){let{part:t,key:n}=e;return(0,K.jsx)(ue,{children:t===`mod`?navigator.platform.toLowerCase().includes(`mac`)?`⌘`:`Ctrl`:t===`shift`?`⇧`:t===`alt`?navigator.platform.toLowerCase().includes(`mac`)?`⌥`:`Alt`:t===`ctrl`?`⌃`:t.length===1?t.toUpperCase():t},n)}function Ae(e){let t=(0,W.c)(11),{query:n,onChange:r,inputRef:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,K.jsx)(se,{children:(0,K.jsx)(f,{"aria-hidden":!0,className:`size-3.5`})}),t[0]=a):a=t[0];let o;t[1]===r?o=t[2]:(o=e=>r(e.currentTarget.value),t[1]=r,t[2]=o);let s;t[3]!==r||t[4]!==n?(s=e=>{e.key===`Escape`&&(e.preventDefault(),n.length>0?r(``):e.currentTarget.blur())},t[3]=r,t[4]=n,t[5]=s):s=t[5];let c;return t[6]!==i||t[7]!==n||t[8]!==o||t[9]!==s?(c=(0,K.jsxs)(B,{className:`min-w-0 basis-full **:[input]:h-9 sm:basis-0 sm:flex-1 sm:**:[input]:h-8`,children:[a,(0,K.jsx)(ce,{ref:i,type:`search`,value:n,onChange:o,onKeyDown:s,placeholder:`Search keybindings`,"aria-label":`Search keybindings`,size:`sm`})]}),t[6]=i,t[7]=n,t[8]=o,t[9]=s,t[10]=c):c=t[10],c}function je(e,t){return e.type===t?[...je(e.left,t),...je(e.right,t)]:[e]}function J(e,t){let n=e[0];if(n)return e.slice(1).reduce((e,n)=>({type:t,left:e,right:n}),n)}function Me(e){return e.type===`identifier`?{identifier:e.name,negated:!1}:e.type===`not`&&e.node.type===`identifier`?{identifier:e.node.name,negated:!0}:null}function Ne(e,t){let n=Me(e);if(!n)return e;let r={type:`identifier`,name:t};return n.negated?{type:`not`,node:r}:r}function Pe(e,t){let n=Me(e);if(!n)return t?{type:`not`,node:e}:e;let r={type:`identifier`,name:n.identifier};return t?{type:`not`,node:r}:r}function Y(){return{type:`identifier`,name:we}}function Fe(e=`and`){return{type:e,left:Y(),right:{type:`not`,node:Y()}}}function Ie(e){let t=(0,W.c)(14),{label:n,focusable:r,className:i,children:a}=e,o=r===void 0||r?0:void 0,s;t[0]===i?s=t[1]:(s=v(`inline-flex size-5 shrink-0 items-center justify-center rounded-sm text-warning outline-none transition-colors hover:bg-warning/10 focus-visible:ring-3 focus-visible:ring-inset focus-visible:ring-warning/25`,i),t[0]=i,t[1]=s);let c;t[2]!==n||t[3]!==o||t[4]!==s?(c=(0,K.jsx)(`span`,{tabIndex:o,"aria-label":n,className:s}),t[2]=n,t[3]=o,t[4]=s,t[5]=c):c=t[5];let l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,K.jsx)(S,{className:`size-3.5`}),t[6]=l):l=t[6];let u;t[7]===c?u=t[8]:(u=(0,K.jsx)(F,{render:c,children:l}),t[7]=c,t[8]=u);let d;t[9]===a?d=t[10]:(d=(0,K.jsx)(I,{side:`top`,children:a}),t[9]=a,t[10]=d);let f;return t[11]!==u||t[12]!==d?(f=(0,K.jsxs)(L,{children:[u,d]}),t[11]=u,t[12]=d,t[13]=f):f=t[13],f}function Le(e){let t=(0,W.c)(5),{identifiers:n,focusable:r}=e,i=r===void 0||r;if(n.length===0)return null;let a;t[0]===n?a=t[1]:(a=n.length===1?`Unknown condition: ${n[0]}`:`Unknown conditions: ${n.join(`, `)}`,t[0]=n,t[1]=a);let o=a,s;return t[2]!==i||t[3]!==o?(s=(0,K.jsx)(Ie,{label:o,focusable:i,className:`size-4.5`,children:`P4 Code does not recognize this condition yet. It can still be saved, but it may not match unless the runtime provides it.`}),t[2]=i,t[3]=o,t[4]=s):s=t[4],s}function X(e){let t=(0,W.c)(4),{labels:n}=e;if(n.length===0)return null;let r;t[0]===n?r=t[1]:(r=n.length===1?`Conflicts with ${n[0]}.`:`Conflicts with ${n.slice(0,3).join(`, `)}${n.length>3?`, and more`:``}.`,t[0]=n,t[1]=r);let i=r,a;return t[2]===i?a=t[3]:(a=(0,K.jsxs)(Ie,{label:i,children:[i,` The most recent matching binding wins when both conditions can apply.`]}),t[2]=i,t[3]=a),a}function Re(e){let t=(0,W.c)(25),{value:n,variables:r,unknownIdentifiers:i,onChange:a}=e,o;if(t[0]!==n||t[1]!==r){let e;t[3]===n?e=t[4]:(e=e=>e===n,t[3]=n,t[4]=e),o=r.find(e),t[0]=n,t[1]=r,t[2]=o}else o=t[2];let s=o,c;t[5]!==s||t[6]!==n||t[7]!==r?(c=s||r.some(e=>e===n)?r:[n,...r],t[5]=s,t[6]=n,t[7]=r,t[8]=c):c=t[8];let l=c,u;t[9]===a?u=t[10]:(u=e=>e&&a(e),t[9]=a,t[10]=u);let d;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,K.jsx)(E,{placeholder:`Condition`}),t[11]=d):d=t[11];let f;t[12]===i?f=t[13]:(f=i&&i.length>0?(0,K.jsx)(Le,{identifiers:i,focusable:!1}):null,t[12]=i,t[13]=f);let p;t[14]===f?p=t[15]:(p=(0,K.jsxs)(O,{size:`compact`,className:`min-w-0 flex-1`,children:[d,f]}),t[14]=f,t[15]=p);let m;t[16]===l?m=t[17]:(m=l.map(ze),t[16]=l,t[17]=m);let h;t[18]===m?h=t[19]:(h=(0,K.jsx)(D,{alignItemWithTrigger:!1,matchTriggerWidth:!1,className:`max-h-72`,children:m}),t[18]=m,t[19]=h);let g;return t[20]!==u||t[21]!==p||t[22]!==h||t[23]!==n?(g=(0,K.jsxs)(k,{value:n,onValueChange:u,children:[p,h]}),t[20]=u,t[21]=p,t[22]=h,t[23]=n,t[24]=g):g=t[24],g}function ze(e){return(0,K.jsx)(T,{value:e,className:`w-full`,children:(0,K.jsx)(`span`,{className:`truncate`,children:e})},e)}function Be(e){let t=(0,W.c)(14),{label:n,className:r,onRemove:i}=e,a;t[0]===r?a=t[1]:(a=v(`size-7`,r),t[0]=r,t[1]=a);let o;t[2]!==n||t[3]!==i||t[4]!==a?(o=(0,K.jsx)(m,{type:`button`,variant:`ghost`,size:`icon-sm`,className:a,"aria-label":n,onClick:i}),t[2]=n,t[3]=i,t[4]=a,t[5]=o):o=t[5];let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,K.jsx)(x,{"aria-hidden":!0,className:`size-3.5`}),t[6]=s):s=t[6];let c;t[7]===o?c=t[8]:(c=(0,K.jsx)(F,{delay:200,render:o,children:s}),t[7]=o,t[8]=c);let l;t[9]===n?l=t[10]:(l=(0,K.jsx)(I,{side:`top`,children:n}),t[9]=n,t[10]=l);let u;return t[11]!==c||t[12]!==l?(u=(0,K.jsxs)(L,{children:[c,l]}),t[11]=c,t[12]=l,t[13]=u):u=t[13],u}function Z(e){let t=(0,W.c)(81),{node:n,variables:r,depth:i,onChange:a,onRemove:o}=e,c=i===void 0?0:i,l;if(t[0]!==c||t[1]!==n||t[2]!==a||t[3]!==o||t[4]!==r){l=Symbol.for(`react.early_return_sentinel`);bb0:{let e=Me(n);if(e){let i=Ce(e.identifier)?[]:[e.identifier],s;t[6]!==n||t[7]!==a?(s=e=>a(Pe(n,e)),t[6]=n,t[7]=a,t[8]=s):s=t[8];let u=`Negate ${e.identifier}`,d;t[9]!==e||t[10]!==s||t[11]!==u?(d=(0,K.jsx)(R,{pressed:e.negated,onPressedChange:s,"aria-label":u,variant:`outline`,size:`compact`,className:`min-w-10`,children:`Not`}),t[9]=e,t[10]=s,t[11]=u,t[12]=d):d=t[12];let f;t[13]!==n||t[14]!==a?(f=e=>a(Ne(n,e)),t[13]=n,t[14]=a,t[15]=f):f=t[15];let p;t[16]!==e||t[17]!==f||t[18]!==i||t[19]!==r?(p=(0,K.jsx)(Re,{value:e.identifier,variables:r,unknownIdentifiers:i,onChange:f}),t[16]=e,t[17]=f,t[18]=i,t[19]=r,t[20]=p):p=t[20];let m;t[21]!==c||t[22]!==n||t[23]!==o?(m=o?(0,K.jsx)(Be,{label:H(n,c),onRemove:o}):null,t[21]=c,t[22]=n,t[23]=o,t[24]=m):m=t[24];let h;t[25]!==d||t[26]!==p||t[27]!==m?(h=(0,K.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border border-border/70 bg-background/60 px-2 py-2`,children:[d,p,m]}),t[25]=d,t[26]=p,t[27]=m,t[28]=h):h=t[28],l=h;break bb0}}t[0]=c,t[1]=n,t[2]=a,t[3]=o,t[4]=r,t[5]=l}else l=t[5];if(l!==Symbol.for(`react.early_return_sentinel`))return l;if(n.type===`not`){let e=c>0&&`border-border/50 bg-background/50`,i;t[29]===e?i=t[30]:(i=v(`space-y-2 rounded-lg border border-border/70 bg-muted/20 p-2`,e),t[29]=e,t[30]=i);let s;t[31]!==n||t[32]!==a?(s=(0,K.jsx)(R,{pressed:!0,onPressedChange:e=>a(e?n:n.node),"aria-label":`Negate group`,variant:`outline`,size:`compact`,className:`min-w-10`,children:`Not`}),t[31]=n,t[32]=a,t[33]=s):s=t[33];let l;t[34]!==c||t[35]!==n||t[36]!==o?(l=o?(0,K.jsx)(Be,{label:H(n,c),className:`ml-auto`,onRemove:o}):null,t[34]=c,t[35]=n,t[36]=o,t[37]=l):l=t[37];let u;t[38]!==s||t[39]!==l?(u=(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[s,l]}),t[38]=s,t[39]=l,t[40]=u):u=t[40];let d,f;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,K.jsx)(`span`,{className:`absolute top-0 bottom-0 left-1.5 w-px bg-border/70`,"aria-hidden":!0}),f=(0,K.jsx)(`span`,{className:`absolute top-4 left-1.5 h-px w-2.5 bg-border/70`,"aria-hidden":!0}),t[41]=d,t[42]=f):(d=t[41],f=t[42]);let p=c+1,m;t[43]===a?m=t[44]:(m=e=>a({type:`not`,node:e}),t[43]=a,t[44]=m);let h;t[45]!==n.node||t[46]!==p||t[47]!==m||t[48]!==r?(h=(0,K.jsxs)(`div`,{className:`relative pl-4`,children:[d,f,(0,K.jsx)(Z,{node:n.node,variables:r,depth:p,onChange:m})]}),t[45]=n.node,t[46]=p,t[47]=m,t[48]=r,t[49]=h):h=t[49];let g;return t[50]!==h||t[51]!==i||t[52]!==u?(g=(0,K.jsxs)(`div`,{className:i,children:[u,h]}),t[50]=h,t[51]=i,t[52]=u,t[53]=g):g=t[53],g}let u=n.type===`or`?`or`:`and`,d,f,p,h;if(t[54]!==c||t[55]!==n||t[56]!==a||t[57]!==o||t[58]!==u||t[59]!==r){let e=je(n,u),i=new Map,l=e.map(e=>{let t=`${e.type}-${U(e)}`,n=i.get(t)??0;return i.set(t,n+1),{child:e,key:n===0?t:`${t}-${n}`}}),g=(t,n)=>{let r=!1,i=J(e.map(e=>!r&&e===t?(r=!0,n):e),u);i&&a(i)},_=t=>{let n=!1,r=J(e.filter(e=>!n&&e===t?(n=!0,!1):!0),u);a(r||Y())},y=t=>{if(t===u)return;let n=J(e,t);n&&a(n)},b=()=>{let t=J([...e,Y()],u);t&&a(t)},x=()=>{let t={type:u===`and`?`or`:`and`,left:Y(),right:{type:`not`,node:Y()}},n=J([...e,t],u);n&&a(n)},S=c>0&&`border-border/70 bg-background/55`;t[64]===S?p=t[65]:(p=v(`space-y-2 rounded-lg border border-border/60 bg-muted/10 p-2`,S),t[64]=S,t[65]=p);let C;t[66]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,K.jsx)(O,{size:`compact`,className:`w-24`,children:(0,K.jsx)(E,{})}),t[66]=C):C=t[66];let w;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,K.jsxs)(D,{alignItemWithTrigger:!1,matchTriggerWidth:!1,children:[(0,K.jsx)(T,{value:`and`,children:`and`}),(0,K.jsx)(T,{value:`or`,children:`or`})]}),t[67]=w):w=t[67];let A;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,K.jsx)(s,{className:`size-3.5`}),t[68]=A):A=t[68];let j;t[69]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,K.jsx)(s,{className:`size-3.5`}),t[69]=j):j=t[69];let M;t[70]!==c||t[71]!==n||t[72]!==o?(M=o?(0,K.jsx)(Be,{label:H(n,c),className:`ml-auto`,onRemove:o}):null,t[70]=c,t[71]=n,t[72]=o,t[73]=M):M=t[73],h=(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsxs)(k,{value:u,onValueChange:e=>y(e),children:[C,w]}),(0,K.jsxs)(m,{type:`button`,variant:`outline`,size:`compact`,onClick:b,children:[A,`Condition`]}),(0,K.jsxs)(m,{type:`button`,variant:`outline`,size:`compact`,onClick:x,children:[j,`Group`]}),M]}),d=`space-y-2`,f=l.map(e=>{let{child:t,key:n}=e;return(0,K.jsxs)(`div`,{className:`relative pl-4`,children:[(0,K.jsx)(`span`,{className:v(`absolute top-0 bottom-0 left-1.5 w-px`,c===0?`bg-border`:`bg-border/70`),"aria-hidden":!0}),(0,K.jsx)(`span`,{className:v(`absolute top-4 left-1.5 h-px w-2.5`,c===0?`bg-border`:`bg-border/70`),"aria-hidden":!0}),(0,K.jsx)(Z,{node:t,variables:r,depth:c+1,onChange:e=>g(t,e),onRemove:()=>_(t)})]},n)}),t[54]=c,t[55]=n,t[56]=a,t[57]=o,t[58]=u,t[59]=r,t[60]=d,t[61]=f,t[62]=p,t[63]=h}else d=t[60],f=t[61],p=t[62],h=t[63];let g;t[74]!==d||t[75]!==f?(g=(0,K.jsx)(`div`,{className:d,children:f}),t[74]=d,t[75]=f,t[76]=g):g=t[76];let _;return t[77]!==p||t[78]!==h||t[79]!==g?(_=(0,K.jsxs)(`div`,{className:p,children:[h,g]}),t[77]=p,t[78]=h,t[79]=g,t[80]=_):_=t[80],_}function Ve(e){let t=(0,W.c)(60),{value:n,variables:r,onChange:i,onValidityChange:a}=e,o;t[0]===n?o=t[1]:(o=U(n),t[0]=n,t[1]=o);let[c,l]=(0,G.useState)(o),d;t[2]===c?d=t[3]:(d=Te(c),t[2]=c,t[3]=d);let f=d,p=f.ok?null:f.message,h;t[4]!==f.ok||t[5]!==f.value?(h=f.ok?_e(f.value):[],t[4]=f.ok,t[5]=f.value,t[6]=h):h=t[6];let g=h,_;t[7]!==i||t[8]!==a?(_=e=>{l(e);let t=Te(e);a?.(t.ok),t.ok&&i(t.value)},t[7]=i,t[8]=a,t[9]=_):_=t[9];let v=_,y;t[10]!==i||t[11]!==a?(y=e=>{l(U(e)),a?.(!0),i(e)},t[10]=i,t[11]=a,t[12]=y):y=t[12];let b=y,x;t[13]!==b||t[14]!==n?(x=()=>{if(!n){b(Y());return}b({type:`and`,left:n,right:Y()})},t[13]=b,t[14]=n,t[15]=x):x=t[15];let S=x,C;t[16]!==b||t[17]!==n?(C=()=>{let e=Fe(`or`);if(!n){b(e);return}b({type:`and`,left:n,right:e})},t[16]=b,t[17]=n,t[18]=C):C=t[18];let w=C,T;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,K.jsx)(`div`,{className:`min-w-0`,children:(0,K.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:`When`})}),t[19]=T):T=t[19];let E;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,K.jsx)(s,{className:`size-3.5`}),t[20]=E):E=t[20];let D;t[21]===S?D=t[22]:(D=(0,K.jsxs)(m,{type:`button`,variant:`outline`,size:`compact`,onClick:S,children:[E,`Condition`]}),t[21]=S,t[22]=D);let O;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,K.jsx)(s,{className:`size-3.5`}),t[23]=O):O=t[23];let k;t[24]===w?k=t[25]:(k=(0,K.jsxs)(m,{type:`button`,variant:`outline`,size:`compact`,onClick:w,children:[O,`Group`]}),t[24]=w,t[25]=k);let A;t[26]!==D||t[27]!==k?(A=(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[T,(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[D,k]})]}),t[26]=D,t[27]=k,t[28]=A):A=t[28];let j;t[29]===v?j=t[30]:(j=e=>v(e.currentTarget.value),t[29]=v,t[30]=j);let M=!!p,ee;t[31]!==c||t[32]!==j||t[33]!==M?(ee=(0,K.jsx)(ce,{value:c,onChange:j,placeholder:`Always`,"aria-invalid":M,"aria-label":`When expression`,size:`compact`,font:`mono`}),t[31]=c,t[32]=j,t[33]=M,t[34]=ee):ee=t[34];let N;t[35]===g?N=t[36]:(N=g.length>0?(0,K.jsx)(se,{align:`inline-end`,children:(0,K.jsx)(Le,{identifiers:g})}):null,t[35]=g,t[36]=N);let te;t[37]!==ee||t[38]!==N?(te=(0,K.jsxs)(B,{children:[ee,N]}),t[37]=ee,t[38]=N,t[39]=te):te=t[39];let P;t[40]===p?P=t[41]:(P=p?(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5 text-2xs text-destructive`,children:[(0,K.jsx)(u,{className:`size-3.5`}),p]}):null,t[40]=p,t[41]=P);let ne;t[42]!==te||t[43]!==P?(ne=(0,K.jsxs)(`div`,{className:`space-y-1.5`,children:[te,P]}),t[42]=te,t[43]=P,t[44]=ne):ne=t[44];let F;t[45]!==S||t[46]!==w||t[47]!==b||t[48]!==n||t[49]!==r?(F=n?(0,K.jsx)(Z,{node:n,variables:r,onChange:b,onRemove:()=>b(void 0)}):(0,K.jsx)(`div`,{className:`rounded-md border border-dashed border-border/80 bg-muted/15 p-3`,children:(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,K.jsxs)(m,{type:`button`,size:`compact`,onClick:S,children:[(0,K.jsx)(s,{className:`size-3.5`}),`Condition`]}),(0,K.jsxs)(m,{type:`button`,variant:`outline`,size:`compact`,onClick:w,children:[(0,K.jsx)(s,{className:`size-3.5`}),`Group`]})]})}),t[45]=S,t[46]=w,t[47]=b,t[48]=n,t[49]=r,t[50]=F):F=t[50];let I;t[51]===p?I=t[52]:(I=p?(0,K.jsx)(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center rounded-lg border border-destructive/30 bg-background/75 p-4 text-center text-xs text-destructive backdrop-blur-xs`,children:`Fix the expression above to continue editing visually.`}):null,t[51]=p,t[52]=I);let L;t[53]!==F||t[54]!==I?(L=(0,K.jsxs)(`div`,{className:`relative`,children:[F,I]}),t[53]=F,t[54]=I,t[55]=L):L=t[55];let R;return t[56]!==A||t[57]!==ne||t[58]!==L?(R=(0,K.jsxs)(`div`,{className:`w-[min(34rem,calc(100vw-2rem))] space-y-3`,children:[A,ne,L]}),t[56]=A,t[57]=ne,t[58]=L,t[59]=R):R=t[59],R}function He(e){return{keyDraft:e.key,whenDraft:e.binding.whenAst,isRecording:!1,isWhenDraftValid:!0}}function Q(e,t){return{...e,...t}}function Ue(e){return{command:e.command,key:e.key,...e.when.trim().length>0?{when:e.when}:{}}}function We(e){let t=(0,W.c)(27),{row:n,allRows:r,onSave:i}=e,[a,o]=(0,G.useReducer)(Q,n,He),{keyDraft:s,whenDraft:c,isRecording:l,isWhenDraftValid:u}=a,d,f,p;t[0]!==r||t[1]!==s||t[2]!==n.id||t[3]!==n.key||t[4]!==n.when||t[5]!==c?(p=U(c),d=s!==n.key||p!==n.when,f=ge(r,{rowId:n.id,key:s,when:p}),t[0]=r,t[1]=s,t[2]=n.id,t[3]=n.key,t[4]=n.when,t[5]=c,t[6]=d,t[7]=f,t[8]=p):(d=t[6],f=t[7],p=t[8]);let m=f,h;t[9]!==s||t[10]!==i||t[11]!==n||t[12]!==p?(h=()=>{i({command:n.command,key:s,when:p.trim().length>0?p:void 0,replace:Ue(n)})},t[9]=s,t[10]=i,t[11]=n,t[12]=p,t[13]=h):h=t[13];let g=h,_;t[14]!==l||t[15]!==n.key?(_=e=>{if(e.key===`Tab`&&!l)return;if(e.preventDefault(),e.key===`Escape`){o({keyDraft:n.key,isRecording:!1});return}let t=ye(e.nativeEvent,navigator.platform);t&&o({keyDraft:t,isRecording:!1})},t[14]=l,t[15]=n.key,t[16]=_):_=t[16];let v=_,y;return t[17]!==v||t[18]!==m||t[19]!==d||t[20]!==l||t[21]!==u||t[22]!==s||t[23]!==g||t[24]!==c||t[25]!==p?(y={keyDraft:s,whenDraft:c,isRecording:l,isWhenDraftValid:u,whenDraftExpression:p,isDirty:d,conflictLabels:m,setDraft:o,save:g,captureKeybinding:v},t[17]=v,t[18]=m,t[19]=d,t[20]=l,t[21]=u,t[22]=s,t[23]=g,t[24]=c,t[25]=p,t[26]=y):y=t[26],y}function Ge(e){let t=(0,W.c)(19),{row:n,editor:r,isSaving:i,pillClassName:a}=e,{keyDraft:o,isRecording:s,isDirty:c,isWhenDraftValid:l,setDraft:u,save:d,captureKeybinding:f}=r,p=!s&&o===n.key&&n.key.length>0&&!c,h;t[0]!==c||t[1]!==i||t[2]!==l||t[3]!==o||t[4]!==d?(h=c?(0,K.jsx)(m,{size:`sm`,disabled:i||o.trim().length===0||!l,onClick:d,children:i?`Saving`:`Save`}):null,t[0]=c,t[1]=i,t[2]=l,t[3]=o,t[4]=d,t[5]=h):h=t[5];let g;t[6]!==f||t[7]!==s||t[8]!==o||t[9]!==a||t[10]!==n.binding||t[11]!==n.command||t[12]!==n.key||t[13]!==u||t[14]!==p?(g=p?(0,K.jsx)(`button`,{type:`button`,onClick:()=>u({isRecording:!0}),"aria-label":`Edit shortcut for ${V(n.command)}: ${ie(n.binding.shortcut)}`,className:v(`inline-flex h-8 cursor-pointer items-center rounded-md border border-transparent px-1.5 sm:h-7 outline-none transition-colors hover:border-border/70 hover:bg-accent focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-inset focus-visible:ring-ring/24`,a),children:(0,K.jsx)(q,{value:n.key})}):(0,K.jsx)(re,{"data-keybinding-capture":``,autoFocus:s,"aria-label":`Keybinding for ${V(n.command)}`,value:s?``:o,placeholder:s?`Press shortcut`:`Unassigned`,size:`sm`,font:`mono`,className:`w-44`,onFocus:()=>u({isRecording:!0}),onBlur:()=>u({isRecording:!1}),onChange:e=>u({keyDraft:e.currentTarget.value}),onKeyDown:f}),t[6]=f,t[7]=s,t[8]=o,t[9]=a,t[10]=n.binding,t[11]=n.command,t[12]=n.key,t[13]=u,t[14]=p,t[15]=g):g=t[15];let _;return t[16]!==h||t[17]!==g?(_=(0,K.jsxs)(K.Fragment,{children:[h,g]}),t[16]=h,t[17]=g,t[18]=_):_=t[18],_}function $(e){let t=(0,W.c)(17),{label:n,expression:r,value:i,variables:a,onChange:o,onValidityChange:s}=e,c=r?`ghost`:`ghost-muted`,l;t[0]===c?l=t[1]:(l=(0,K.jsx)(m,{variant:c,size:`micro`,className:`min-w-0 shrink`}),t[0]=c,t[1]=l);let u=`Edit when clause for ${n}`,d=r||`Always`,f;t[2]===d?f=t[3]:(f=(0,K.jsx)(`span`,{className:`truncate font-mono`,children:d}),t[2]=d,t[3]=f);let p;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,K.jsx)(g,{className:`size-3.5 shrink-0 opacity-60`}),t[4]=p):p=t[4];let h;t[5]!==l||t[6]!==u||t[7]!==f?(h=(0,K.jsxs)(oe,{render:l,"aria-label":u,children:[f,p]}),t[5]=l,t[6]=u,t[7]=f,t[8]=h):h=t[8];let _;t[9]!==o||t[10]!==s||t[11]!==i||t[12]!==a?(_=(0,K.jsx)(ae,{align:`start`,sideOffset:6,children:(0,K.jsx)(Ve,{value:i,variables:a,onChange:o,onValidityChange:s})}),t[9]=o,t[10]=s,t[11]=i,t[12]=a,t[13]=_):_=t[13];let v;return t[14]!==h||t[15]!==_?(v=(0,K.jsxs)(z,{children:[h,_]}),t[14]=h,t[15]=_,t[16]=v):v=t[16],v}function Ke(e){let t=(0,W.c)(24),{row:n,isSaving:r,onReset:a,onRemove:o}=e,s=n.source===`Custom`&&n.defaultKey!==null,c=n.source!==`Default`;if(!s&&!c)return null;let l;t[0]===n.command?l=t[1]:(l=V(n.command),t[0]=n.command,t[1]=l);let u=`Actions for ${l}`,f;t[2]!==r||t[3]!==u?(f=(0,K.jsx)(m,{type:`button`,variant:`ghost-muted`,size:`icon-sm`,disabled:r,"aria-label":u}),t[2]=r,t[3]=u,t[4]=f):f=t[4];let p;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,K.jsx)(h,{className:`size-3.5`}),t[5]=p):p=t[5];let g;t[6]===f?g=t[7]:(g=(0,K.jsx)(b,{render:f,children:p}),t[6]=f,t[7]=g);let _;t[8]!==s||t[9]!==r||t[10]!==a||t[11]!==n?(_=s?(0,K.jsx)(i,{disabled:r,onClick:()=>a(n),children:`Reset to default`}):null,t[8]=s,t[9]=r,t[10]=a,t[11]=n,t[12]=_):_=t[12];let v;t[13]!==c||t[14]!==r||t[15]!==o||t[16]!==n?(v=c?(0,K.jsx)(i,{variant:`destructive`,disabled:r,onClick:()=>o(n),children:`Remove`}):null,t[13]=c,t[14]=r,t[15]=o,t[16]=n,t[17]=v):v=t[17];let x;t[18]!==_||t[19]!==v?(x=(0,K.jsxs)(y,{align:`end`,children:[_,v]}),t[18]=_,t[19]=v,t[20]=x):x=t[20];let S;return t[21]!==g||t[22]!==x?(S=(0,K.jsxs)(d,{children:[g,x]}),t[21]=g,t[22]=x,t[23]=S):S=t[23],S}function qe(e){let t=(0,W.c)(2),{source:n}=e;if(n===`Default`)return null;let r;return t[0]===n?r=t[1]:(r=(0,K.jsx)(o,{variant:`outline`,size:`sm`,children:n}),t[0]=n,t[1]=r),r}function Je(e){let t=(0,W.c)(13),{row:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,K.jsx)(`span`,{className:`flex items-center gap-2`}),t[0]=r):r=t[0];let i;t[1]===n.command?i=t[2]:(i=V(n.command),t[1]=n.command,t[2]=i);let a;t[3]===n.source?a=t[4]:(a=(0,K.jsx)(qe,{source:n.source}),t[3]=n.source,t[4]=a);let o;t[5]!==i||t[6]!==a?(o=(0,K.jsxs)(F,{render:r,children:[i,a]}),t[5]=i,t[6]=a,t[7]=o):o=t[7];let s;t[8]===n.command?s=t[9]:(s=(0,K.jsx)(I,{side:`top`,children:n.command}),t[8]=n.command,t[9]=s);let c;return t[10]!==o||t[11]!==s?(c=(0,K.jsxs)(L,{children:[o,s]}),t[10]=o,t[11]=s,t[12]=c):c=t[12],c}function Ye(e){let t=(0,W.c)(13),{row:n,editor:r,variables:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,K.jsx)(`span`,{className:`text-xs leading-none text-muted-foreground/70`,children:`When`}),t[0]=a):a=t[0];let o;t[1]===n.command?o=t[2]:(o=V(n.command),t[1]=n.command,t[2]=o);let s,c;t[3]===r?(s=t[4],c=t[5]):(s=e=>r.setDraft({whenDraft:e}),c=e=>r.setDraft({isWhenDraftValid:e}),t[3]=r,t[4]=s,t[5]=c);let l;return t[6]!==r.whenDraft||t[7]!==r.whenDraftExpression||t[8]!==o||t[9]!==s||t[10]!==c||t[11]!==i?(l=(0,K.jsxs)(`span`,{className:`flex h-6 items-center gap-1.5`,children:[a,(0,K.jsx)($,{label:o,expression:r.whenDraftExpression,value:r.whenDraft,variables:i,onChange:s,onValidityChange:c})]}),t[6]=r.whenDraft,t[7]=r.whenDraftExpression,t[8]=o,t[9]=s,t[10]=c,t[11]=i,t[12]=l):l=t[12],l}function Xe(e){let t=(0,W.c)(2),n;return t[0]===e?n=t[1]:(n=(0,K.jsx)(`span`,{className:`flex items-center opacity-0 transition-opacity group-focus-within/row:opacity-100 group-hover/row:opacity-100 has-data-popup-open:opacity-100 pointer-coarse:opacity-100`,children:(0,K.jsx)(Ke,{...e})}),t[0]=e,t[1]=n),n}function Ze(e){let t=(0,W.c)(30),{row:n,isSaving:r,anchorId:i,allRows:a,variables:o,onSave:s,onReset:c,onRemove:l}=e,u;t[0]!==a||t[1]!==s||t[2]!==n?(u={row:n,allRows:a,onSave:s},t[0]=a,t[1]=s,t[2]=n,t[3]=u):u=t[3];let d=We(u),f;t[4]===n?f=t[5]:(f=(0,K.jsx)(Je,{row:n}),t[4]=n,t[5]=f);let p;t[6]!==d||t[7]!==n||t[8]!==o?(p=(0,K.jsx)(Ye,{row:n,editor:d,variables:o}),t[6]=d,t[7]=n,t[8]=o,t[9]=p):p=t[9];let m;t[10]===d.conflictLabels?m=t[11]:(m=(0,K.jsx)(X,{labels:d.conflictLabels}),t[10]=d.conflictLabels,t[11]=m);let h;t[12]!==r||t[13]!==l||t[14]!==c||t[15]!==n?(h=(0,K.jsx)(Xe,{row:n,isSaving:r,onReset:c,onRemove:l}),t[12]=r,t[13]=l,t[14]=c,t[15]=n,t[16]=h):h=t[16];let g;t[17]!==d||t[18]!==r||t[19]!==n?(g=(0,K.jsx)(Ge,{row:n,editor:d,isSaving:r,pillClassName:`-mr-1.5`}),t[17]=d,t[18]=r,t[19]=n,t[20]=g):g=t[20];let _;t[21]!==m||t[22]!==h||t[23]!==g?(_=(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-1.5`,children:[m,h,g]}),t[21]=m,t[22]=h,t[23]=g,t[24]=_):_=t[24];let v;return t[25]!==i||t[26]!==f||t[27]!==p||t[28]!==_?(v=(0,K.jsx)(pe,{id:i,className:`group/row rounded-none`,title:f,description:p,control:_}),t[25]=i,t[26]=f,t[27]=p,t[28]=_,t[29]=v):v=t[29],v}function Qe(e){let t=(0,W.c)(30),{allRows:n,onSave:r}=e,[i,a]=(0,G.useState)(``),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o={keyDraft:``,whenDraft:void 0,isRecording:!1,isWhenDraftValid:!0},t[0]=o):o=t[0];let[s,c]=(0,G.useReducer)(Q,o),{keyDraft:l,whenDraft:u,isRecording:d,isWhenDraftValid:f}=s,p,m;t[1]!==n||t[2]!==l||t[3]!==u?(m=U(u),p=ge(n,{rowId:`new`,key:l,when:m}),t[1]=n,t[2]=l,t[3]=u,t[4]=p,t[5]=m):(p=t[4],m=t[5]);let h=p,g;t[6]===i?g=t[7]:(g=i?V(i):`new keybinding`,t[6]=i,t[7]=g);let _=g,v;t[8]!==i||t[9]!==f||t[10]!==l?(v=!!i&&l.trim().length>0&&f,t[8]=i,t[9]=f,t[10]=l,t[11]=v):v=t[11];let y=v,b;t[12]!==i||t[13]!==l||t[14]!==r||t[15]!==m?(b=()=>{i&&r({command:i,key:l,...m.trim().length>0?{when:m}:{}})},t[12]=i,t[13]=l,t[14]=r,t[15]=m,t[16]=b):b=t[16];let x=b,S;t[17]===d?S=t[18]:(S=e=>{if(e.key===`Tab`&&!d)return;if(e.preventDefault(),e.key===`Escape`){c({keyDraft:``,isRecording:!1});return}let t=ye(e.nativeEvent,navigator.platform);t&&c({keyDraft:t,isRecording:!1})},t[17]=d,t[18]=S);let C=S,w;return t[19]!==y||t[20]!==C||t[21]!==i||t[22]!==_||t[23]!==h||t[24]!==d||t[25]!==l||t[26]!==x||t[27]!==u||t[28]!==m?(w={commandDraft:i,setCommandDraft:a,keyDraft:l,whenDraft:u,whenDraftExpression:m,isRecording:d,conflictLabels:h,commandLabelText:_,canSave:y,setDraft:c,save:x,captureKeybinding:C},t[19]=y,t[20]=C,t[21]=i,t[22]=_,t[23]=h,t[24]=d,t[25]=l,t[26]=x,t[27]=u,t[28]=m,t[29]=w):w=t[29],w}function $e(e){let t=(0,W.c)(14),{draft:n,commandOptions:r,className:i}=e,a=n.commandDraft,o;t[0]===n?o=t[1]:(o=e=>n.setCommandDraft(e),t[0]=n,t[1]=o);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,K.jsx)(E,{placeholder:`Command`}),t[2]=s):s=t[2];let c;t[3]===i?c=t[4]:(c=(0,K.jsx)(O,{size:`sm`,className:i,children:s}),t[3]=i,t[4]=c);let l;t[5]===r?l=t[6]:(l=r.map(et),t[5]=r,t[6]=l);let u;t[7]===l?u=t[8]:(u=(0,K.jsx)(D,{alignItemWithTrigger:!1,matchTriggerWidth:!1,className:`max-h-72`,children:l}),t[7]=l,t[8]=u);let d;return t[9]!==n.commandDraft||t[10]!==o||t[11]!==c||t[12]!==u?(d=(0,K.jsxs)(k,{value:a,onValueChange:o,children:[c,u]}),t[9]=n.commandDraft,t[10]=o,t[11]=c,t[12]=u,t[13]=d):d=t[13],d}function et(e){return(0,K.jsx)(T,{value:e,className:`w-full`,children:(0,K.jsx)(`span`,{className:`truncate`,children:V(e)})},e)}function tt(e){let t=(0,W.c)(14),{draft:n,autoFocus:r,className:i}=e,a=r!==void 0&&r,o=`Keybinding for ${n.commandLabelText}`,s=n.isRecording?``:n.keyDraft,c=n.isRecording?`Press shortcut`:`Unassigned`,l,u,d;t[0]===n?(l=t[1],u=t[2],d=t[3]):(l=()=>n.setDraft({isRecording:!0}),u=()=>n.setDraft({isRecording:!1}),d=e=>n.setDraft({keyDraft:e.currentTarget.value}),t[0]=n,t[1]=l,t[2]=u,t[3]=d);let f;return t[4]!==a||t[5]!==i||t[6]!==n.captureKeybinding||t[7]!==o||t[8]!==s||t[9]!==c||t[10]!==l||t[11]!==u||t[12]!==d?(f=(0,K.jsx)(re,{"data-keybinding-capture":``,autoFocus:a,"aria-label":o,value:s,placeholder:c,size:`sm`,font:`mono`,className:i,onFocus:l,onBlur:u,onChange:d,onKeyDown:n.captureKeybinding}),t[4]=a,t[5]=i,t[6]=n.captureKeybinding,t[7]=o,t[8]=s,t[9]=c,t[10]=l,t[11]=u,t[12]=d,t[13]=f):f=t[13],f}function nt(e){let t=(0,W.c)(10),{draft:n,variables:r}=e,i,a;t[0]===n?(i=t[1],a=t[2]):(i=e=>n.setDraft({whenDraft:e}),a=e=>n.setDraft({isWhenDraftValid:e}),t[0]=n,t[1]=i,t[2]=a);let o;return t[3]!==n.commandLabelText||t[4]!==n.whenDraft||t[5]!==n.whenDraftExpression||t[6]!==i||t[7]!==a||t[8]!==r?(o=(0,K.jsx)($,{label:n.commandLabelText,expression:n.whenDraftExpression,value:n.whenDraft,variables:r,onChange:i,onValidityChange:a}),t[3]=n.commandLabelText,t[4]=n.whenDraft,t[5]=n.whenDraftExpression,t[6]=i,t[7]=a,t[8]=r,t[9]=o):o=t[9],o}function rt(e){let t=(0,W.c)(9),{isSaving:n,onCancel:r}=e,i;t[0]!==n||t[1]!==r?(i=(0,K.jsx)(m,{type:`button`,variant:`ghost-muted`,size:`icon-sm`,disabled:n,"aria-label":`Cancel new keybinding`,onClick:r}),t[0]=n,t[1]=r,t[2]=i):i=t[2];let a;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,K.jsx)(_,{className:`size-3.5`}),t[3]=a):a=t[3];let o;t[4]===i?o=t[5]:(o=(0,K.jsx)(F,{render:i,children:a}),t[4]=i,t[5]=o);let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,K.jsx)(I,{side:`top`,children:`Cancel`}),t[6]=s):s=t[6];let c;return t[7]===o?c=t[8]:(c=(0,K.jsxs)(L,{children:[o,s]}),t[7]=o,t[8]=c),c}function it(e){let t=(0,W.c)(30),{commandOptions:n,allRows:r,variables:i,isSaving:a,onSave:o,onCancel:s}=e,c;t[0]!==r||t[1]!==o?(c={allRows:r,onSave:o},t[0]=r,t[1]=o,t[2]=c):c=t[2];let l=Qe(c),u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,K.jsx)(`span`,{className:`text-xs leading-none text-muted-foreground/70`,children:`When`}),t[3]=u):u=t[3];let d;t[4]!==l||t[5]!==i?(d=(0,K.jsxs)(`span`,{className:`flex h-6 items-center gap-1.5`,children:[u,(0,K.jsx)(nt,{draft:l,variables:i})]}),t[4]=l,t[5]=i,t[6]=d):d=t[6];let f;t[7]!==n||t[8]!==l?(f=(0,K.jsx)($e,{draft:l,commandOptions:n,className:`w-56`}),t[7]=n,t[8]=l,t[9]=f):f=t[9];let p;t[10]===l.conflictLabels?p=t[11]:(p=(0,K.jsx)(X,{labels:l.conflictLabels}),t[10]=l.conflictLabels,t[11]=p);let h;t[12]===l?h=t[13]:(h=(0,K.jsx)(tt,{draft:l,className:`w-44`}),t[12]=l,t[13]=h);let g=a||!l.canSave,_=a?`Saving`:`Save`,v;t[14]!==l.save||t[15]!==g||t[16]!==_?(v=(0,K.jsx)(m,{size:`sm`,disabled:g,onClick:l.save,children:_}),t[14]=l.save,t[15]=g,t[16]=_,t[17]=v):v=t[17];let y;t[18]!==a||t[19]!==s?(y=(0,K.jsx)(rt,{isSaving:a,onCancel:s}),t[18]=a,t[19]=s,t[20]=y):y=t[20];let b;t[21]!==f||t[22]!==p||t[23]!==h||t[24]!==v||t[25]!==y?(b=(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[f,p,h,v,y]}),t[21]=f,t[22]=p,t[23]=h,t[24]=v,t[25]=y,t[26]=b):b=t[26];let x;return t[27]!==b||t[28]!==d?(x=(0,K.jsx)(pe,{className:`bg-muted/15`,title:`New keybinding`,description:d,control:b}),t[27]=b,t[28]=d,t[29]=x):x=t[29],x}function at(e){let{groups:t,anchorIds:n,savingCommand:r,...i}=e;return t.map(e=>(0,K.jsx)(he,{id:`keybindings-${e.id}`,title:e.title,children:e.rows.map(e=>(0,K.jsx)(Ze,{row:e,anchorId:n.get(e.id),isSaving:r===e.command,...i},e.id))},e.id))}function ot(){let e=(0,W.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,K.jsxs)(L,{children:[(0,K.jsx)(F,{delay:200,render:(0,K.jsx)(m,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":`The browser may claim some shortcuts first. The desktop app receives them all.`,children:(0,K.jsx)(S,{className:`size-3.5 text-warning`})})}),(0,K.jsx)(I,{side:`top`,className:`max-w-72`,children:`The browser may claim some shortcuts first. The desktop app receives them all.`})]}),e[0]=t):t=e[0],t}function st(){let e=(0,W.c)(83),{environment:t,connectedEnvironments:n}=de(),r=ee(t?.environmentId??null,c),i=te(n,l),o;e[0]!==n||e[1]!==i?(o=n.length>0&&n.every(e=>i.has(e.environmentId)),e[0]=n,e[1]=i,e[2]=o):o=e[2];let u=o,d=t?.serverConfig?.keybindings,f;e[3]===d?f=e[4]:(f=d??[],e[3]=d,e[4]=f);let h;e[5]===f?h=e[6]:(h=a(f),e[5]=f,e[6]=h);let g=h,_=t?.serverConfig?.keybindingsConfigPath??null,v;e[7]===t?.serverConfig?.availableEditors?v=e[8]:(v=t?.serverConfig?.availableEditors??[],e[7]=t?.serverConfig?.availableEditors,e[8]=v);let y=v,b;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(b={reportFailure:!1},e[9]=b):b=e[9];let x=P(M.upsertKeybinding,b),S;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(S={reportFailure:!1},e[10]=S):S=e[10];let T=P(M.removeKeybinding,S),E=Ee(t?.environmentId??null,y),[D,O]=(0,G.useState)(``),k=(0,G.useRef)(null),[R,re]=(0,G.useState)(null),[ie,ae]=(0,G.useState)(!1),oe;e[11]!==g||e[12]!==D?(oe=Se(g,D),e[11]=g,e[12]=D,e[13]=oe):oe=e[13];let z=oe,se;e[14]===z?se=e[15]:(se=xe(z),e[14]=z,e[15]=se);let ce=se,B;if(e[16]!==z){B=new Map;let t=new Set;for(let e of z)t.has(e.command)||(t.add(e.command),B.set(e.id,Oe(e.command)));e[16]=z,e[17]=B}else B=e[17];let le=B,ue;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(ue={select:ft},e[18]=ue):ue=e[18];let pe=A(ue),[V,ge]=(0,G.useState)(pe);pe!==V&&(ge(pe),pe.startsWith(`keybinding-`)&&O(``));let _e;e[19]===g?_e=e[20]:(_e=be(g),e[19]=g,e[20]=_e);let ye=_e,H;e[21]===Symbol.for(`react.memo_cache_sentinel`)?(H=ve(),e[21]=H):H=e[21];let U=H,Ce;e[22]!==_||e[23]!==E||e[24]!==t?(Ce=()=>{_&&t&&N(t.environmentId,`orchestration:operate`)&&(async()=>{let e=await E(_);if(e._tag===`Success`||C(e))return;let t=w(e);j.add({title:`Unable to open keybindings file`,description:t instanceof Error?t.message:`The keybindings file was not opened.`,type:`error`})})()},e[22]=_,e[23]=E,e[24]=t,e[25]=Ce):Ce=e[25];let we=Ce,Te;e[26]!==n||e[27]!==t||e[28]!==x?(Te=e=>{if(!t||!n.every(dt))return;re(e.command);let r={command:e.command,key:e.key.trim(),...e.when?.trim()?{when:e.when.trim()}:{},...e.replace?{replace:e.replace}:{}};(async()=>{let e=await Promise.all(n.map(e=>x({environmentId:e.environmentId,input:r})));re(null);let t=e.find(ut);if(!t){ae(!1);return}if(!C(t)){let e=w(t);j.add({title:`Unable to save keybinding`,description:e instanceof Error?e.message:`The keybinding was not saved.`,type:`error`})}})()},e[26]=n,e[27]=t,e[28]=x,e[29]=Te):Te=e[29];let q=Te,ke;e[30]!==n||e[31]!==t||e[32]!==T?(ke=e=>{t&&n.every(lt)&&(re(e.command),(async()=>{let t=await Promise.all(n.map(t=>T({environmentId:t.environmentId,input:Ue(e)})));re(null);let r=t.find(ct)??t[0];if(r?._tag===`Failure`&&!C(r)){let e=w(r);j.add({title:`Unable to remove keybinding`,description:e instanceof Error?e.message:`The keybinding was not removed.`,type:`error`})}})())},e[30]=n,e[31]=t,e[32]=T,e[33]=ke):ke=e[33];let je=ke,J;e[34]===q?J=e[35]:(J=e=>{e.defaultKey&&q({command:e.command,key:e.defaultKey,when:e.defaultWhen.trim().length>0?e.defaultWhen:void 0,replace:{command:e.command,key:e.key,...e.when.trim().length>0?{when:e.when}:{}}})},e[34]=q,e[35]=J);let Me=J,Ne;e[36]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=()=>ae(!1),e[36]=Ne):Ne=e[36];let Pe=Ne,Y;e[37]!==je||e[38]!==Me||e[39]!==z||e[40]!==q?(Y={allRows:z,variables:U,onSave:q,onReset:Me,onRemove:je},e[37]=je,e[38]=Me,e[39]=z,e[40]=q,e[41]=Y):Y=e[41];let Fe=Y,Ie,Le;e[42]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=De(`keybindings`),Le=ne?null:(0,K.jsx)(ot,{}),e[42]=Ie,e[43]=Le):(Ie=e[42],Le=e[43]);let X;e[44]===D?X=e[45]:(X=(0,K.jsx)(Ae,{query:D,onChange:O,inputRef:k}),e[44]=D,e[45]=X);let Re=ie||!u,ze,Be;e[46]===Symbol.for(`react.memo_cache_sentinel`)?(ze=()=>ae(!0),Be=(0,K.jsx)(s,{"aria-hidden":!0,className:`size-4`}),e[46]=ze,e[47]=Be):(ze=e[46],Be=e[47]);let Z;e[48]===Re?Z=e[49]:(Z=(0,K.jsxs)(m,{type:`button`,variant:`outline`,disabled:Re,onClick:ze,children:[Be,`Add keybinding`]}),e[48]=Re,e[49]=Z);let Ve=!_||!r,He;e[50]===Symbol.for(`react.memo_cache_sentinel`)?(He=(0,K.jsx)(p,{"aria-hidden":!0,className:`size-4`}),e[50]=He):He=e[50];let Q;e[51]!==we||e[52]!==Ve?(Q=(0,K.jsx)(F,{render:(0,K.jsx)(m,{type:`button`,variant:`outline`,size:`icon`,disabled:Ve,onClick:we,"aria-label":`Open keybindings.json`,children:He})}),e[51]=we,e[52]=Ve,e[53]=Q):Q=e[53];let We;e[54]===Symbol.for(`react.memo_cache_sentinel`)?(We=(0,K.jsx)(I,{side:`top`,children:`Open keybindings.json`}),e[54]=We):We=e[54];let Ge;e[55]===Q?Ge=e[56]:(Ge=(0,K.jsxs)(L,{children:[Q,We]}),e[55]=Q,e[56]=Ge);let $;e[57]!==X||e[58]!==Z||e[59]!==Ge?($=(0,K.jsx)(he,{...Ie,headerAction:Le,children:(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 px-3 py-3 sm:px-4`,children:[X,Z,Ge]})}),e[57]=X,e[58]=Z,e[59]=Ge,e[60]=$):$=e[60];let Ke;e[61]!==u||e[62]!==n?(Ke=u?null:(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n.length===0?`Connect an environment to change keybindings.`:`This connection can view keybindings but cannot change them.`}),e[61]=u,e[62]=n,e[63]=Ke):Ke=e[63];let qe=!u,Je;e[64]!==ye||e[65]!==ie||e[66]!==z||e[67]!==q||e[68]!==R?(Je=ie?(0,K.jsx)(fe,{children:(0,K.jsx)(it,{commandOptions:ye,allRows:z,variables:U,isSaving:R!==null,onSave:q,onCancel:Pe})}):null,e[64]=ye,e[65]=ie,e[66]=z,e[67]=q,e[68]=R,e[69]=Je):Je=e[69];let Ye;e[70]!==le||e[71]!==ce||e[72]!==Fe||e[73]!==R?(Ye=ce.length>0?(0,K.jsx)(at,{groups:ce,anchorIds:le,savingCommand:R,...Fe}):(0,K.jsx)(fe,{children:(0,K.jsx)(`div`,{className:`px-4 py-12 text-center text-sm text-muted-foreground`,children:`No keybindings match your search.`})}),e[70]=le,e[71]=ce,e[72]=Fe,e[73]=R,e[74]=Ye):Ye=e[74];let Xe;e[75]!==qe||e[76]!==Je||e[77]!==Ye?(Xe=(0,K.jsxs)(`div`,{inert:qe,className:`flex flex-col gap-8`,children:[Je,Ye]}),e[75]=qe,e[76]=Je,e[77]=Ye,e[78]=Xe):Xe=e[78];let Ze;return e[79]!==$||e[80]!==Ke||e[81]!==Xe?(Ze=(0,K.jsxs)(me,{children:[$,Ke,Xe]}),e[79]=$,e[80]=Ke,e[81]=Xe,e[82]=Ze):Ze=e[82],Ze}function ct(e){return e._tag===`Failure`}function lt(e){return N(e.environmentId,l)}function ut(e){return e._tag===`Failure`}function dt(e){return N(e.environmentId,l)}function ft(e){return e.hash.replace(/^#/,``)}var pt=st;export{pt as component};
2
- //# sourceMappingURL=settings.keybindings-C0FBNk1_.js.map
1
+ import{a as e,t}from"./react-DH3P2YXY.js";import{n,t as r}from"./jsx-runtime-BnjsACtP.js";import{$_ as i,$n as a,Ad as o,Bm as s,Ic as c,Jn as l,Sp as u,Wd as d,Yn as f,Yp as p,af as m,dr as h,ff as g,lm as _,q_ as v,rh as y,t as b,tr as x,ur as S}from"./utils-DhUt689t.js";import{R as C,W as w}from"./runtime-OeWFs5Hf.js";import{a as T,c as E,o as D,s as O,t as k}from"./select-D_zHR42Y.js";import{t as A}from"./useLocation-B_XV0lDx.js";import{i as j}from"./toast-DXWclCrr.js";import{f as M}from"./server-6nKYyc8r.js";import{i as ee,n as N,o as te}from"./session-BxUdP61p.js";import{t as P}from"./use-atom-command-vqjL7n-x.js";import{t as ne}from"./env-wK1YYxA8.js";import{a as F,n as I,t as L}from"./tooltip-CY3W5y-f.js";import{t as R}from"./toggle-Dofc34s2.js";import{t as re}from"./input-BYd74ook.js";import{i as ie}from"./keybindings-B_kRk5Fi.js";import{i as ae,o as oe,t as z}from"./popover-BjUpdrKu.js";import{n as se,r as ce,t as B}from"./input-group-DMFlSk_7.js";import{n as le,t as ue}from"./kbd-rp5mX21h.js";import{V as de,W as fe,a as pe,i as me,s as he}from"./settingsLayout-4ySvFdXb.js";import{a as V,c as ge,f as _e,i as ve,l as ye,m as H,n as be,o as xe,p as U,r as Se,s as Ce,t as we,u as Te}from"./KeybindingsSettings.logic-BJe27xmi.js";import{Ta as Ee,ir as De,rr as Oe}from"./main-VfCRP294.js";var W=n(),G=e(t(),1),K=e(r(),1);function q(e){let t=(0,W.c)(6),{value:n}=e,r,i;if(t[0]!==n){let e=new Map,a=n.split(`+`).map(t=>{let n=e.get(t)??0;return e.set(t,n+1),{part:t,key:n===0?t:`${t}-${n}`}});r=le,i=a.map(ke),t[0]=n,t[1]=r,t[2]=i}else r=t[1],i=t[2];let a;return t[3]!==r||t[4]!==i?(a=(0,K.jsx)(r,{children:i}),t[3]=r,t[4]=i,t[5]=a):a=t[5],a}function ke(e){let{part:t,key:n}=e;return(0,K.jsx)(ue,{children:t===`mod`?navigator.platform.toLowerCase().includes(`mac`)?`⌘`:`Ctrl`:t===`shift`?`⇧`:t===`alt`?navigator.platform.toLowerCase().includes(`mac`)?`⌥`:`Alt`:t===`ctrl`?`⌃`:t.length===1?t.toUpperCase():t},n)}function Ae(e){let t=(0,W.c)(11),{query:n,onChange:r,inputRef:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,K.jsx)(se,{children:(0,K.jsx)(_,{"aria-hidden":!0,className:`size-3.5`})}),t[0]=a):a=t[0];let o;t[1]===r?o=t[2]:(o=e=>r(e.currentTarget.value),t[1]=r,t[2]=o);let s;t[3]!==r||t[4]!==n?(s=e=>{e.key===`Escape`&&(e.preventDefault(),n.length>0?r(``):e.currentTarget.blur())},t[3]=r,t[4]=n,t[5]=s):s=t[5];let c;return t[6]!==i||t[7]!==n||t[8]!==o||t[9]!==s?(c=(0,K.jsxs)(B,{className:`min-w-0 basis-full **:[input]:h-9 sm:basis-0 sm:flex-1 sm:**:[input]:h-8`,children:[a,(0,K.jsx)(ce,{ref:i,type:`search`,value:n,onChange:o,onKeyDown:s,placeholder:`Search keybindings`,"aria-label":`Search keybindings`,size:`sm`})]}),t[6]=i,t[7]=n,t[8]=o,t[9]=s,t[10]=c):c=t[10],c}function je(e,t){return e.type===t?[...je(e.left,t),...je(e.right,t)]:[e]}function J(e,t){let n=e[0];if(n)return e.slice(1).reduce((e,n)=>({type:t,left:e,right:n}),n)}function Me(e){return e.type===`identifier`?{identifier:e.name,negated:!1}:e.type===`not`&&e.node.type===`identifier`?{identifier:e.node.name,negated:!0}:null}function Ne(e,t){let n=Me(e);if(!n)return e;let r={type:`identifier`,name:t};return n.negated?{type:`not`,node:r}:r}function Pe(e,t){let n=Me(e);if(!n)return t?{type:`not`,node:e}:e;let r={type:`identifier`,name:n.identifier};return t?{type:`not`,node:r}:r}function Y(){return{type:`identifier`,name:we}}function Fe(e=`and`){return{type:e,left:Y(),right:{type:`not`,node:Y()}}}function Ie(e){let t=(0,W.c)(14),{label:n,focusable:r,className:i,children:a}=e,o=r===void 0||r?0:void 0,c;t[0]===i?c=t[1]:(c=b(`inline-flex size-5 shrink-0 items-center justify-center rounded-sm text-warning outline-none transition-colors hover:bg-warning/10 focus-visible:ring-3 focus-visible:ring-inset focus-visible:ring-warning/25`,i),t[0]=i,t[1]=c);let l;t[2]!==n||t[3]!==o||t[4]!==c?(l=(0,K.jsx)(`span`,{tabIndex:o,"aria-label":n,className:c}),t[2]=n,t[3]=o,t[4]=c,t[5]=l):l=t[5];let u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,K.jsx)(s,{className:`size-3.5`}),t[6]=u):u=t[6];let d;t[7]===l?d=t[8]:(d=(0,K.jsx)(F,{render:l,children:u}),t[7]=l,t[8]=d);let f;t[9]===a?f=t[10]:(f=(0,K.jsx)(I,{side:`top`,children:a}),t[9]=a,t[10]=f);let p;return t[11]!==d||t[12]!==f?(p=(0,K.jsxs)(L,{children:[d,f]}),t[11]=d,t[12]=f,t[13]=p):p=t[13],p}function Le(e){let t=(0,W.c)(5),{identifiers:n,focusable:r}=e,i=r===void 0||r;if(n.length===0)return null;let a;t[0]===n?a=t[1]:(a=n.length===1?`Unknown condition: ${n[0]}`:`Unknown conditions: ${n.join(`, `)}`,t[0]=n,t[1]=a);let o=a,s;return t[2]!==i||t[3]!==o?(s=(0,K.jsx)(Ie,{label:o,focusable:i,className:`size-4.5`,children:`P4 Code does not recognize this condition yet. It can still be saved, but it may not match unless the runtime provides it.`}),t[2]=i,t[3]=o,t[4]=s):s=t[4],s}function X(e){let t=(0,W.c)(4),{labels:n}=e;if(n.length===0)return null;let r;t[0]===n?r=t[1]:(r=n.length===1?`Conflicts with ${n[0]}.`:`Conflicts with ${n.slice(0,3).join(`, `)}${n.length>3?`, and more`:``}.`,t[0]=n,t[1]=r);let i=r,a;return t[2]===i?a=t[3]:(a=(0,K.jsxs)(Ie,{label:i,children:[i,` The most recent matching binding wins when both conditions can apply.`]}),t[2]=i,t[3]=a),a}function Re(e){let t=(0,W.c)(25),{value:n,variables:r,unknownIdentifiers:i,onChange:a}=e,o;if(t[0]!==n||t[1]!==r){let e;t[3]===n?e=t[4]:(e=e=>e===n,t[3]=n,t[4]=e),o=r.find(e),t[0]=n,t[1]=r,t[2]=o}else o=t[2];let s=o,c;t[5]!==s||t[6]!==n||t[7]!==r?(c=s||r.some(e=>e===n)?r:[n,...r],t[5]=s,t[6]=n,t[7]=r,t[8]=c):c=t[8];let l=c,u;t[9]===a?u=t[10]:(u=e=>e&&a(e),t[9]=a,t[10]=u);let d;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,K.jsx)(E,{placeholder:`Condition`}),t[11]=d):d=t[11];let f;t[12]===i?f=t[13]:(f=i&&i.length>0?(0,K.jsx)(Le,{identifiers:i,focusable:!1}):null,t[12]=i,t[13]=f);let p;t[14]===f?p=t[15]:(p=(0,K.jsxs)(O,{size:`compact`,className:`min-w-0 flex-1`,children:[d,f]}),t[14]=f,t[15]=p);let m;t[16]===l?m=t[17]:(m=l.map(ze),t[16]=l,t[17]=m);let h;t[18]===m?h=t[19]:(h=(0,K.jsx)(D,{alignItemWithTrigger:!1,matchTriggerWidth:!1,className:`max-h-72`,children:m}),t[18]=m,t[19]=h);let g;return t[20]!==u||t[21]!==p||t[22]!==h||t[23]!==n?(g=(0,K.jsxs)(k,{value:n,onValueChange:u,children:[p,h]}),t[20]=u,t[21]=p,t[22]=h,t[23]=n,t[24]=g):g=t[24],g}function ze(e){return(0,K.jsx)(T,{value:e,className:`w-full`,children:(0,K.jsx)(`span`,{className:`truncate`,children:e})},e)}function Be(e){let t=(0,W.c)(14),{label:n,className:r,onRemove:i}=e,a;t[0]===r?a=t[1]:(a=b(`size-7`,r),t[0]=r,t[1]=a);let o;t[2]!==n||t[3]!==i||t[4]!==a?(o=(0,K.jsx)(h,{type:`button`,variant:`ghost`,size:`icon-sm`,className:a,"aria-label":n,onClick:i}),t[2]=n,t[3]=i,t[4]=a,t[5]=o):o=t[5];let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,K.jsx)(u,{"aria-hidden":!0,className:`size-3.5`}),t[6]=s):s=t[6];let c;t[7]===o?c=t[8]:(c=(0,K.jsx)(F,{delay:200,render:o,children:s}),t[7]=o,t[8]=c);let l;t[9]===n?l=t[10]:(l=(0,K.jsx)(I,{side:`top`,children:n}),t[9]=n,t[10]=l);let d;return t[11]!==c||t[12]!==l?(d=(0,K.jsxs)(L,{children:[c,l]}),t[11]=c,t[12]=l,t[13]=d):d=t[13],d}function Z(e){let t=(0,W.c)(81),{node:n,variables:r,depth:i,onChange:a,onRemove:o}=e,s=i===void 0?0:i,c;if(t[0]!==s||t[1]!==n||t[2]!==a||t[3]!==o||t[4]!==r){c=Symbol.for(`react.early_return_sentinel`);bb0:{let e=Me(n);if(e){let i=Ce(e.identifier)?[]:[e.identifier],l;t[6]!==n||t[7]!==a?(l=e=>a(Pe(n,e)),t[6]=n,t[7]=a,t[8]=l):l=t[8];let u=`Negate ${e.identifier}`,d;t[9]!==e||t[10]!==l||t[11]!==u?(d=(0,K.jsx)(R,{pressed:e.negated,onPressedChange:l,"aria-label":u,variant:`outline`,size:`compact`,className:`min-w-10`,children:`Not`}),t[9]=e,t[10]=l,t[11]=u,t[12]=d):d=t[12];let f;t[13]!==n||t[14]!==a?(f=e=>a(Ne(n,e)),t[13]=n,t[14]=a,t[15]=f):f=t[15];let p;t[16]!==e||t[17]!==f||t[18]!==i||t[19]!==r?(p=(0,K.jsx)(Re,{value:e.identifier,variables:r,unknownIdentifiers:i,onChange:f}),t[16]=e,t[17]=f,t[18]=i,t[19]=r,t[20]=p):p=t[20];let m;t[21]!==s||t[22]!==n||t[23]!==o?(m=o?(0,K.jsx)(Be,{label:H(n,s),onRemove:o}):null,t[21]=s,t[22]=n,t[23]=o,t[24]=m):m=t[24];let h;t[25]!==d||t[26]!==p||t[27]!==m?(h=(0,K.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border border-border/70 bg-background/60 px-2 py-2`,children:[d,p,m]}),t[25]=d,t[26]=p,t[27]=m,t[28]=h):h=t[28],c=h;break bb0}}t[0]=s,t[1]=n,t[2]=a,t[3]=o,t[4]=r,t[5]=c}else c=t[5];if(c!==Symbol.for(`react.early_return_sentinel`))return c;if(n.type===`not`){let e=s>0&&`border-border/50 bg-background/50`,i;t[29]===e?i=t[30]:(i=b(`space-y-2 rounded-lg border border-border/70 bg-muted/20 p-2`,e),t[29]=e,t[30]=i);let c;t[31]!==n||t[32]!==a?(c=(0,K.jsx)(R,{pressed:!0,onPressedChange:e=>a(e?n:n.node),"aria-label":`Negate group`,variant:`outline`,size:`compact`,className:`min-w-10`,children:`Not`}),t[31]=n,t[32]=a,t[33]=c):c=t[33];let l;t[34]!==s||t[35]!==n||t[36]!==o?(l=o?(0,K.jsx)(Be,{label:H(n,s),className:`ml-auto`,onRemove:o}):null,t[34]=s,t[35]=n,t[36]=o,t[37]=l):l=t[37];let u;t[38]!==c||t[39]!==l?(u=(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[c,l]}),t[38]=c,t[39]=l,t[40]=u):u=t[40];let d,f;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,K.jsx)(`span`,{className:`absolute top-0 bottom-0 left-1.5 w-px bg-border/70`,"aria-hidden":!0}),f=(0,K.jsx)(`span`,{className:`absolute top-4 left-1.5 h-px w-2.5 bg-border/70`,"aria-hidden":!0}),t[41]=d,t[42]=f):(d=t[41],f=t[42]);let p=s+1,m;t[43]===a?m=t[44]:(m=e=>a({type:`not`,node:e}),t[43]=a,t[44]=m);let h;t[45]!==n.node||t[46]!==p||t[47]!==m||t[48]!==r?(h=(0,K.jsxs)(`div`,{className:`relative pl-4`,children:[d,f,(0,K.jsx)(Z,{node:n.node,variables:r,depth:p,onChange:m})]}),t[45]=n.node,t[46]=p,t[47]=m,t[48]=r,t[49]=h):h=t[49];let g;return t[50]!==h||t[51]!==i||t[52]!==u?(g=(0,K.jsxs)(`div`,{className:i,children:[u,h]}),t[50]=h,t[51]=i,t[52]=u,t[53]=g):g=t[53],g}let l=n.type===`or`?`or`:`and`,u,d,f,m;if(t[54]!==s||t[55]!==n||t[56]!==a||t[57]!==o||t[58]!==l||t[59]!==r){let e=je(n,l),i=new Map,c=e.map(e=>{let t=`${e.type}-${U(e)}`,n=i.get(t)??0;return i.set(t,n+1),{child:e,key:n===0?t:`${t}-${n}`}}),g=(t,n)=>{let r=!1,i=J(e.map(e=>!r&&e===t?(r=!0,n):e),l);i&&a(i)},_=t=>{let n=!1,r=J(e.filter(e=>!n&&e===t?(n=!0,!1):!0),l);a(r||Y())},v=t=>{if(t===l)return;let n=J(e,t);n&&a(n)},y=()=>{let t=J([...e,Y()],l);t&&a(t)},x=()=>{let t={type:l===`and`?`or`:`and`,left:Y(),right:{type:`not`,node:Y()}},n=J([...e,t],l);n&&a(n)},S=s>0&&`border-border/70 bg-background/55`;t[64]===S?f=t[65]:(f=b(`space-y-2 rounded-lg border border-border/60 bg-muted/10 p-2`,S),t[64]=S,t[65]=f);let C;t[66]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,K.jsx)(O,{size:`compact`,className:`w-24`,children:(0,K.jsx)(E,{})}),t[66]=C):C=t[66];let w;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,K.jsxs)(D,{alignItemWithTrigger:!1,matchTriggerWidth:!1,children:[(0,K.jsx)(T,{value:`and`,children:`and`}),(0,K.jsx)(T,{value:`or`,children:`or`})]}),t[67]=w):w=t[67];let A;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,K.jsx)(p,{className:`size-3.5`}),t[68]=A):A=t[68];let j;t[69]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,K.jsx)(p,{className:`size-3.5`}),t[69]=j):j=t[69];let M;t[70]!==s||t[71]!==n||t[72]!==o?(M=o?(0,K.jsx)(Be,{label:H(n,s),className:`ml-auto`,onRemove:o}):null,t[70]=s,t[71]=n,t[72]=o,t[73]=M):M=t[73],m=(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsxs)(k,{value:l,onValueChange:e=>v(e),children:[C,w]}),(0,K.jsxs)(h,{type:`button`,variant:`outline`,size:`compact`,onClick:y,children:[A,`Condition`]}),(0,K.jsxs)(h,{type:`button`,variant:`outline`,size:`compact`,onClick:x,children:[j,`Group`]}),M]}),u=`space-y-2`,d=c.map(e=>{let{child:t,key:n}=e;return(0,K.jsxs)(`div`,{className:`relative pl-4`,children:[(0,K.jsx)(`span`,{className:b(`absolute top-0 bottom-0 left-1.5 w-px`,s===0?`bg-border`:`bg-border/70`),"aria-hidden":!0}),(0,K.jsx)(`span`,{className:b(`absolute top-4 left-1.5 h-px w-2.5`,s===0?`bg-border`:`bg-border/70`),"aria-hidden":!0}),(0,K.jsx)(Z,{node:t,variables:r,depth:s+1,onChange:e=>g(t,e),onRemove:()=>_(t)})]},n)}),t[54]=s,t[55]=n,t[56]=a,t[57]=o,t[58]=l,t[59]=r,t[60]=u,t[61]=d,t[62]=f,t[63]=m}else u=t[60],d=t[61],f=t[62],m=t[63];let g;t[74]!==u||t[75]!==d?(g=(0,K.jsx)(`div`,{className:u,children:d}),t[74]=u,t[75]=d,t[76]=g):g=t[76];let _;return t[77]!==f||t[78]!==m||t[79]!==g?(_=(0,K.jsxs)(`div`,{className:f,children:[m,g]}),t[77]=f,t[78]=m,t[79]=g,t[80]=_):_=t[80],_}function Ve(e){let t=(0,W.c)(60),{value:n,variables:r,onChange:i,onValidityChange:a}=e,o;t[0]===n?o=t[1]:(o=U(n),t[0]=n,t[1]=o);let[s,c]=(0,G.useState)(o),l;t[2]===s?l=t[3]:(l=Te(s),t[2]=s,t[3]=l);let u=l,f=u.ok?null:u.message,m;t[4]!==u.ok||t[5]!==u.value?(m=u.ok?_e(u.value):[],t[4]=u.ok,t[5]=u.value,t[6]=m):m=t[6];let g=m,_;t[7]!==i||t[8]!==a?(_=e=>{c(e);let t=Te(e);a?.(t.ok),t.ok&&i(t.value)},t[7]=i,t[8]=a,t[9]=_):_=t[9];let v=_,y;t[10]!==i||t[11]!==a?(y=e=>{c(U(e)),a?.(!0),i(e)},t[10]=i,t[11]=a,t[12]=y):y=t[12];let b=y,x;t[13]!==b||t[14]!==n?(x=()=>{if(!n){b(Y());return}b({type:`and`,left:n,right:Y()})},t[13]=b,t[14]=n,t[15]=x):x=t[15];let S=x,C;t[16]!==b||t[17]!==n?(C=()=>{let e=Fe(`or`);if(!n){b(e);return}b({type:`and`,left:n,right:e})},t[16]=b,t[17]=n,t[18]=C):C=t[18];let w=C,T;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,K.jsx)(`div`,{className:`min-w-0`,children:(0,K.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:`When`})}),t[19]=T):T=t[19];let E;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,K.jsx)(p,{className:`size-3.5`}),t[20]=E):E=t[20];let D;t[21]===S?D=t[22]:(D=(0,K.jsxs)(h,{type:`button`,variant:`outline`,size:`compact`,onClick:S,children:[E,`Condition`]}),t[21]=S,t[22]=D);let O;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,K.jsx)(p,{className:`size-3.5`}),t[23]=O):O=t[23];let k;t[24]===w?k=t[25]:(k=(0,K.jsxs)(h,{type:`button`,variant:`outline`,size:`compact`,onClick:w,children:[O,`Group`]}),t[24]=w,t[25]=k);let A;t[26]!==D||t[27]!==k?(A=(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[T,(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[D,k]})]}),t[26]=D,t[27]=k,t[28]=A):A=t[28];let j;t[29]===v?j=t[30]:(j=e=>v(e.currentTarget.value),t[29]=v,t[30]=j);let M=!!f,ee;t[31]!==s||t[32]!==j||t[33]!==M?(ee=(0,K.jsx)(ce,{value:s,onChange:j,placeholder:`Always`,"aria-invalid":M,"aria-label":`When expression`,size:`compact`,font:`mono`}),t[31]=s,t[32]=j,t[33]=M,t[34]=ee):ee=t[34];let N;t[35]===g?N=t[36]:(N=g.length>0?(0,K.jsx)(se,{align:`inline-end`,children:(0,K.jsx)(Le,{identifiers:g})}):null,t[35]=g,t[36]=N);let te;t[37]!==ee||t[38]!==N?(te=(0,K.jsxs)(B,{children:[ee,N]}),t[37]=ee,t[38]=N,t[39]=te):te=t[39];let P;t[40]===f?P=t[41]:(P=f?(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5 text-2xs text-destructive`,children:[(0,K.jsx)(d,{className:`size-3.5`}),f]}):null,t[40]=f,t[41]=P);let ne;t[42]!==te||t[43]!==P?(ne=(0,K.jsxs)(`div`,{className:`space-y-1.5`,children:[te,P]}),t[42]=te,t[43]=P,t[44]=ne):ne=t[44];let F;t[45]!==S||t[46]!==w||t[47]!==b||t[48]!==n||t[49]!==r?(F=n?(0,K.jsx)(Z,{node:n,variables:r,onChange:b,onRemove:()=>b(void 0)}):(0,K.jsx)(`div`,{className:`rounded-md border border-dashed border-border/80 bg-muted/15 p-3`,children:(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,K.jsxs)(h,{type:`button`,size:`compact`,onClick:S,children:[(0,K.jsx)(p,{className:`size-3.5`}),`Condition`]}),(0,K.jsxs)(h,{type:`button`,variant:`outline`,size:`compact`,onClick:w,children:[(0,K.jsx)(p,{className:`size-3.5`}),`Group`]})]})}),t[45]=S,t[46]=w,t[47]=b,t[48]=n,t[49]=r,t[50]=F):F=t[50];let I;t[51]===f?I=t[52]:(I=f?(0,K.jsx)(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center rounded-lg border border-destructive/30 bg-background/75 p-4 text-center text-xs text-destructive backdrop-blur-xs`,children:`Fix the expression above to continue editing visually.`}):null,t[51]=f,t[52]=I);let L;t[53]!==F||t[54]!==I?(L=(0,K.jsxs)(`div`,{className:`relative`,children:[F,I]}),t[53]=F,t[54]=I,t[55]=L):L=t[55];let R;return t[56]!==A||t[57]!==ne||t[58]!==L?(R=(0,K.jsxs)(`div`,{className:`w-[min(34rem,calc(100vw-2rem))] space-y-3`,children:[A,ne,L]}),t[56]=A,t[57]=ne,t[58]=L,t[59]=R):R=t[59],R}function He(e){return{keyDraft:e.key,whenDraft:e.binding.whenAst,isRecording:!1,isWhenDraftValid:!0}}function Q(e,t){return{...e,...t}}function Ue(e){return{command:e.command,key:e.key,...e.when.trim().length>0?{when:e.when}:{}}}function We(e){let t=(0,W.c)(27),{row:n,allRows:r,onSave:i}=e,[a,o]=(0,G.useReducer)(Q,n,He),{keyDraft:s,whenDraft:c,isRecording:l,isWhenDraftValid:u}=a,d,f,p;t[0]!==r||t[1]!==s||t[2]!==n.id||t[3]!==n.key||t[4]!==n.when||t[5]!==c?(p=U(c),d=s!==n.key||p!==n.when,f=ge(r,{rowId:n.id,key:s,when:p}),t[0]=r,t[1]=s,t[2]=n.id,t[3]=n.key,t[4]=n.when,t[5]=c,t[6]=d,t[7]=f,t[8]=p):(d=t[6],f=t[7],p=t[8]);let m=f,h;t[9]!==s||t[10]!==i||t[11]!==n||t[12]!==p?(h=()=>{i({command:n.command,key:s,when:p.trim().length>0?p:void 0,replace:Ue(n)})},t[9]=s,t[10]=i,t[11]=n,t[12]=p,t[13]=h):h=t[13];let g=h,_;t[14]!==l||t[15]!==n.key?(_=e=>{if(e.key===`Tab`&&!l)return;if(e.preventDefault(),e.key===`Escape`){o({keyDraft:n.key,isRecording:!1});return}let t=ye(e.nativeEvent,navigator.platform);t&&o({keyDraft:t,isRecording:!1})},t[14]=l,t[15]=n.key,t[16]=_):_=t[16];let v=_,y;return t[17]!==v||t[18]!==m||t[19]!==d||t[20]!==l||t[21]!==u||t[22]!==s||t[23]!==g||t[24]!==c||t[25]!==p?(y={keyDraft:s,whenDraft:c,isRecording:l,isWhenDraftValid:u,whenDraftExpression:p,isDirty:d,conflictLabels:m,setDraft:o,save:g,captureKeybinding:v},t[17]=v,t[18]=m,t[19]=d,t[20]=l,t[21]=u,t[22]=s,t[23]=g,t[24]=c,t[25]=p,t[26]=y):y=t[26],y}function Ge(e){let t=(0,W.c)(19),{row:n,editor:r,isSaving:i,pillClassName:a}=e,{keyDraft:o,isRecording:s,isDirty:c,isWhenDraftValid:l,setDraft:u,save:d,captureKeybinding:f}=r,p=!s&&o===n.key&&n.key.length>0&&!c,m;t[0]!==c||t[1]!==i||t[2]!==l||t[3]!==o||t[4]!==d?(m=c?(0,K.jsx)(h,{size:`sm`,disabled:i||o.trim().length===0||!l,onClick:d,children:i?`Saving`:`Save`}):null,t[0]=c,t[1]=i,t[2]=l,t[3]=o,t[4]=d,t[5]=m):m=t[5];let g;t[6]!==f||t[7]!==s||t[8]!==o||t[9]!==a||t[10]!==n.binding||t[11]!==n.command||t[12]!==n.key||t[13]!==u||t[14]!==p?(g=p?(0,K.jsx)(`button`,{type:`button`,onClick:()=>u({isRecording:!0}),"aria-label":`Edit shortcut for ${V(n.command)}: ${ie(n.binding.shortcut)}`,className:b(`inline-flex h-8 cursor-pointer items-center rounded-md border border-transparent px-1.5 sm:h-7 outline-none transition-colors hover:border-border/70 hover:bg-accent focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-inset focus-visible:ring-ring/24`,a),children:(0,K.jsx)(q,{value:n.key})}):(0,K.jsx)(re,{"data-keybinding-capture":``,autoFocus:s,"aria-label":`Keybinding for ${V(n.command)}`,value:s?``:o,placeholder:s?`Press shortcut`:`Unassigned`,size:`sm`,font:`mono`,className:`w-44`,onFocus:()=>u({isRecording:!0}),onBlur:()=>u({isRecording:!1}),onChange:e=>u({keyDraft:e.currentTarget.value}),onKeyDown:f}),t[6]=f,t[7]=s,t[8]=o,t[9]=a,t[10]=n.binding,t[11]=n.command,t[12]=n.key,t[13]=u,t[14]=p,t[15]=g):g=t[15];let _;return t[16]!==m||t[17]!==g?(_=(0,K.jsxs)(K.Fragment,{children:[m,g]}),t[16]=m,t[17]=g,t[18]=_):_=t[18],_}function $(e){let t=(0,W.c)(17),{label:n,expression:r,value:i,variables:a,onChange:s,onValidityChange:c}=e,l=r?`ghost`:`ghost-muted`,u;t[0]===l?u=t[1]:(u=(0,K.jsx)(h,{variant:l,size:`micro`,className:`min-w-0 shrink`}),t[0]=l,t[1]=u);let d=`Edit when clause for ${n}`,f=r||`Always`,p;t[2]===f?p=t[3]:(p=(0,K.jsx)(`span`,{className:`truncate font-mono`,children:f}),t[2]=f,t[3]=p);let m;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,K.jsx)(o,{className:`size-3.5 shrink-0 opacity-60`}),t[4]=m):m=t[4];let g;t[5]!==u||t[6]!==d||t[7]!==p?(g=(0,K.jsxs)(oe,{render:u,"aria-label":d,children:[p,m]}),t[5]=u,t[6]=d,t[7]=p,t[8]=g):g=t[8];let _;t[9]!==s||t[10]!==c||t[11]!==i||t[12]!==a?(_=(0,K.jsx)(ae,{align:`start`,sideOffset:6,children:(0,K.jsx)(Ve,{value:i,variables:a,onChange:s,onValidityChange:c})}),t[9]=s,t[10]=c,t[11]=i,t[12]=a,t[13]=_):_=t[13];let v;return t[14]!==g||t[15]!==_?(v=(0,K.jsxs)(z,{children:[g,_]}),t[14]=g,t[15]=_,t[16]=v):v=t[16],v}function Ke(e){let t=(0,W.c)(24),{row:n,isSaving:r,onReset:i,onRemove:o}=e,s=n.source===`Custom`&&n.defaultKey!==null,c=n.source!==`Default`;if(!s&&!c)return null;let l;t[0]===n.command?l=t[1]:(l=V(n.command),t[0]=n.command,t[1]=l);let u=`Actions for ${l}`,d;t[2]!==r||t[3]!==u?(d=(0,K.jsx)(h,{type:`button`,variant:`ghost-muted`,size:`icon-sm`,disabled:r,"aria-label":u}),t[2]=r,t[3]=u,t[4]=d):d=t[4];let p;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,K.jsx)(m,{className:`size-3.5`}),t[5]=p):p=t[5];let g;t[6]===d?g=t[7]:(g=(0,K.jsx)(S,{render:d,children:p}),t[6]=d,t[7]=g);let _;t[8]!==s||t[9]!==r||t[10]!==i||t[11]!==n?(_=s?(0,K.jsx)(a,{disabled:r,onClick:()=>i(n),children:`Reset to default`}):null,t[8]=s,t[9]=r,t[10]=i,t[11]=n,t[12]=_):_=t[12];let v;t[13]!==c||t[14]!==r||t[15]!==o||t[16]!==n?(v=c?(0,K.jsx)(a,{variant:`destructive`,disabled:r,onClick:()=>o(n),children:`Remove`}):null,t[13]=c,t[14]=r,t[15]=o,t[16]=n,t[17]=v):v=t[17];let y;t[18]!==_||t[19]!==v?(y=(0,K.jsxs)(x,{align:`end`,children:[_,v]}),t[18]=_,t[19]=v,t[20]=y):y=t[20];let b;return t[21]!==g||t[22]!==y?(b=(0,K.jsxs)(f,{children:[g,y]}),t[21]=g,t[22]=y,t[23]=b):b=t[23],b}function qe(e){let t=(0,W.c)(2),{source:n}=e;if(n===`Default`)return null;let r;return t[0]===n?r=t[1]:(r=(0,K.jsx)(l,{variant:`outline`,size:`sm`,children:n}),t[0]=n,t[1]=r),r}function Je(e){let t=(0,W.c)(13),{row:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,K.jsx)(`span`,{className:`flex items-center gap-2`}),t[0]=r):r=t[0];let i;t[1]===n.command?i=t[2]:(i=V(n.command),t[1]=n.command,t[2]=i);let a;t[3]===n.source?a=t[4]:(a=(0,K.jsx)(qe,{source:n.source}),t[3]=n.source,t[4]=a);let o;t[5]!==i||t[6]!==a?(o=(0,K.jsxs)(F,{render:r,children:[i,a]}),t[5]=i,t[6]=a,t[7]=o):o=t[7];let s;t[8]===n.command?s=t[9]:(s=(0,K.jsx)(I,{side:`top`,children:n.command}),t[8]=n.command,t[9]=s);let c;return t[10]!==o||t[11]!==s?(c=(0,K.jsxs)(L,{children:[o,s]}),t[10]=o,t[11]=s,t[12]=c):c=t[12],c}function Ye(e){let t=(0,W.c)(13),{row:n,editor:r,variables:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,K.jsx)(`span`,{className:`text-xs leading-none text-muted-foreground/70`,children:`When`}),t[0]=a):a=t[0];let o;t[1]===n.command?o=t[2]:(o=V(n.command),t[1]=n.command,t[2]=o);let s,c;t[3]===r?(s=t[4],c=t[5]):(s=e=>r.setDraft({whenDraft:e}),c=e=>r.setDraft({isWhenDraftValid:e}),t[3]=r,t[4]=s,t[5]=c);let l;return t[6]!==r.whenDraft||t[7]!==r.whenDraftExpression||t[8]!==o||t[9]!==s||t[10]!==c||t[11]!==i?(l=(0,K.jsxs)(`span`,{className:`flex h-6 items-center gap-1.5`,children:[a,(0,K.jsx)($,{label:o,expression:r.whenDraftExpression,value:r.whenDraft,variables:i,onChange:s,onValidityChange:c})]}),t[6]=r.whenDraft,t[7]=r.whenDraftExpression,t[8]=o,t[9]=s,t[10]=c,t[11]=i,t[12]=l):l=t[12],l}function Xe(e){let t=(0,W.c)(2),n;return t[0]===e?n=t[1]:(n=(0,K.jsx)(`span`,{className:`flex items-center opacity-0 transition-opacity group-focus-within/row:opacity-100 group-hover/row:opacity-100 has-data-popup-open:opacity-100 pointer-coarse:opacity-100`,children:(0,K.jsx)(Ke,{...e})}),t[0]=e,t[1]=n),n}function Ze(e){let t=(0,W.c)(30),{row:n,isSaving:r,anchorId:i,allRows:a,variables:o,onSave:s,onReset:c,onRemove:l}=e,u;t[0]!==a||t[1]!==s||t[2]!==n?(u={row:n,allRows:a,onSave:s},t[0]=a,t[1]=s,t[2]=n,t[3]=u):u=t[3];let d=We(u),f;t[4]===n?f=t[5]:(f=(0,K.jsx)(Je,{row:n}),t[4]=n,t[5]=f);let p;t[6]!==d||t[7]!==n||t[8]!==o?(p=(0,K.jsx)(Ye,{row:n,editor:d,variables:o}),t[6]=d,t[7]=n,t[8]=o,t[9]=p):p=t[9];let m;t[10]===d.conflictLabels?m=t[11]:(m=(0,K.jsx)(X,{labels:d.conflictLabels}),t[10]=d.conflictLabels,t[11]=m);let h;t[12]!==r||t[13]!==l||t[14]!==c||t[15]!==n?(h=(0,K.jsx)(Xe,{row:n,isSaving:r,onReset:c,onRemove:l}),t[12]=r,t[13]=l,t[14]=c,t[15]=n,t[16]=h):h=t[16];let g;t[17]!==d||t[18]!==r||t[19]!==n?(g=(0,K.jsx)(Ge,{row:n,editor:d,isSaving:r,pillClassName:`-mr-1.5`}),t[17]=d,t[18]=r,t[19]=n,t[20]=g):g=t[20];let _;t[21]!==m||t[22]!==h||t[23]!==g?(_=(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-1.5`,children:[m,h,g]}),t[21]=m,t[22]=h,t[23]=g,t[24]=_):_=t[24];let v;return t[25]!==i||t[26]!==f||t[27]!==p||t[28]!==_?(v=(0,K.jsx)(pe,{id:i,className:`group/row rounded-none`,title:f,description:p,control:_}),t[25]=i,t[26]=f,t[27]=p,t[28]=_,t[29]=v):v=t[29],v}function Qe(e){let t=(0,W.c)(30),{allRows:n,onSave:r}=e,[i,a]=(0,G.useState)(``),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o={keyDraft:``,whenDraft:void 0,isRecording:!1,isWhenDraftValid:!0},t[0]=o):o=t[0];let[s,c]=(0,G.useReducer)(Q,o),{keyDraft:l,whenDraft:u,isRecording:d,isWhenDraftValid:f}=s,p,m;t[1]!==n||t[2]!==l||t[3]!==u?(m=U(u),p=ge(n,{rowId:`new`,key:l,when:m}),t[1]=n,t[2]=l,t[3]=u,t[4]=p,t[5]=m):(p=t[4],m=t[5]);let h=p,g;t[6]===i?g=t[7]:(g=i?V(i):`new keybinding`,t[6]=i,t[7]=g);let _=g,v;t[8]!==i||t[9]!==f||t[10]!==l?(v=!!i&&l.trim().length>0&&f,t[8]=i,t[9]=f,t[10]=l,t[11]=v):v=t[11];let y=v,b;t[12]!==i||t[13]!==l||t[14]!==r||t[15]!==m?(b=()=>{i&&r({command:i,key:l,...m.trim().length>0?{when:m}:{}})},t[12]=i,t[13]=l,t[14]=r,t[15]=m,t[16]=b):b=t[16];let x=b,S;t[17]===d?S=t[18]:(S=e=>{if(e.key===`Tab`&&!d)return;if(e.preventDefault(),e.key===`Escape`){c({keyDraft:``,isRecording:!1});return}let t=ye(e.nativeEvent,navigator.platform);t&&c({keyDraft:t,isRecording:!1})},t[17]=d,t[18]=S);let C=S,w;return t[19]!==y||t[20]!==C||t[21]!==i||t[22]!==_||t[23]!==h||t[24]!==d||t[25]!==l||t[26]!==x||t[27]!==u||t[28]!==m?(w={commandDraft:i,setCommandDraft:a,keyDraft:l,whenDraft:u,whenDraftExpression:m,isRecording:d,conflictLabels:h,commandLabelText:_,canSave:y,setDraft:c,save:x,captureKeybinding:C},t[19]=y,t[20]=C,t[21]=i,t[22]=_,t[23]=h,t[24]=d,t[25]=l,t[26]=x,t[27]=u,t[28]=m,t[29]=w):w=t[29],w}function $e(e){let t=(0,W.c)(14),{draft:n,commandOptions:r,className:i}=e,a=n.commandDraft,o;t[0]===n?o=t[1]:(o=e=>n.setCommandDraft(e),t[0]=n,t[1]=o);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,K.jsx)(E,{placeholder:`Command`}),t[2]=s):s=t[2];let c;t[3]===i?c=t[4]:(c=(0,K.jsx)(O,{size:`sm`,className:i,children:s}),t[3]=i,t[4]=c);let l;t[5]===r?l=t[6]:(l=r.map(et),t[5]=r,t[6]=l);let u;t[7]===l?u=t[8]:(u=(0,K.jsx)(D,{alignItemWithTrigger:!1,matchTriggerWidth:!1,className:`max-h-72`,children:l}),t[7]=l,t[8]=u);let d;return t[9]!==n.commandDraft||t[10]!==o||t[11]!==c||t[12]!==u?(d=(0,K.jsxs)(k,{value:a,onValueChange:o,children:[c,u]}),t[9]=n.commandDraft,t[10]=o,t[11]=c,t[12]=u,t[13]=d):d=t[13],d}function et(e){return(0,K.jsx)(T,{value:e,className:`w-full`,children:(0,K.jsx)(`span`,{className:`truncate`,children:V(e)})},e)}function tt(e){let t=(0,W.c)(14),{draft:n,autoFocus:r,className:i}=e,a=r!==void 0&&r,o=`Keybinding for ${n.commandLabelText}`,s=n.isRecording?``:n.keyDraft,c=n.isRecording?`Press shortcut`:`Unassigned`,l,u,d;t[0]===n?(l=t[1],u=t[2],d=t[3]):(l=()=>n.setDraft({isRecording:!0}),u=()=>n.setDraft({isRecording:!1}),d=e=>n.setDraft({keyDraft:e.currentTarget.value}),t[0]=n,t[1]=l,t[2]=u,t[3]=d);let f;return t[4]!==a||t[5]!==i||t[6]!==n.captureKeybinding||t[7]!==o||t[8]!==s||t[9]!==c||t[10]!==l||t[11]!==u||t[12]!==d?(f=(0,K.jsx)(re,{"data-keybinding-capture":``,autoFocus:a,"aria-label":o,value:s,placeholder:c,size:`sm`,font:`mono`,className:i,onFocus:l,onBlur:u,onChange:d,onKeyDown:n.captureKeybinding}),t[4]=a,t[5]=i,t[6]=n.captureKeybinding,t[7]=o,t[8]=s,t[9]=c,t[10]=l,t[11]=u,t[12]=d,t[13]=f):f=t[13],f}function nt(e){let t=(0,W.c)(10),{draft:n,variables:r}=e,i,a;t[0]===n?(i=t[1],a=t[2]):(i=e=>n.setDraft({whenDraft:e}),a=e=>n.setDraft({isWhenDraftValid:e}),t[0]=n,t[1]=i,t[2]=a);let o;return t[3]!==n.commandLabelText||t[4]!==n.whenDraft||t[5]!==n.whenDraftExpression||t[6]!==i||t[7]!==a||t[8]!==r?(o=(0,K.jsx)($,{label:n.commandLabelText,expression:n.whenDraftExpression,value:n.whenDraft,variables:r,onChange:i,onValidityChange:a}),t[3]=n.commandLabelText,t[4]=n.whenDraft,t[5]=n.whenDraftExpression,t[6]=i,t[7]=a,t[8]=r,t[9]=o):o=t[9],o}function rt(e){let t=(0,W.c)(9),{isSaving:n,onCancel:r}=e,i;t[0]!==n||t[1]!==r?(i=(0,K.jsx)(h,{type:`button`,variant:`ghost-muted`,size:`icon-sm`,disabled:n,"aria-label":`Cancel new keybinding`,onClick:r}),t[0]=n,t[1]=r,t[2]=i):i=t[2];let a;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,K.jsx)(y,{className:`size-3.5`}),t[3]=a):a=t[3];let o;t[4]===i?o=t[5]:(o=(0,K.jsx)(F,{render:i,children:a}),t[4]=i,t[5]=o);let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,K.jsx)(I,{side:`top`,children:`Cancel`}),t[6]=s):s=t[6];let c;return t[7]===o?c=t[8]:(c=(0,K.jsxs)(L,{children:[o,s]}),t[7]=o,t[8]=c),c}function it(e){let t=(0,W.c)(30),{commandOptions:n,allRows:r,variables:i,isSaving:a,onSave:o,onCancel:s}=e,c;t[0]!==r||t[1]!==o?(c={allRows:r,onSave:o},t[0]=r,t[1]=o,t[2]=c):c=t[2];let l=Qe(c),u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,K.jsx)(`span`,{className:`text-xs leading-none text-muted-foreground/70`,children:`When`}),t[3]=u):u=t[3];let d;t[4]!==l||t[5]!==i?(d=(0,K.jsxs)(`span`,{className:`flex h-6 items-center gap-1.5`,children:[u,(0,K.jsx)(nt,{draft:l,variables:i})]}),t[4]=l,t[5]=i,t[6]=d):d=t[6];let f;t[7]!==n||t[8]!==l?(f=(0,K.jsx)($e,{draft:l,commandOptions:n,className:`w-56`}),t[7]=n,t[8]=l,t[9]=f):f=t[9];let p;t[10]===l.conflictLabels?p=t[11]:(p=(0,K.jsx)(X,{labels:l.conflictLabels}),t[10]=l.conflictLabels,t[11]=p);let m;t[12]===l?m=t[13]:(m=(0,K.jsx)(tt,{draft:l,className:`w-44`}),t[12]=l,t[13]=m);let g=a||!l.canSave,_=a?`Saving`:`Save`,v;t[14]!==l.save||t[15]!==g||t[16]!==_?(v=(0,K.jsx)(h,{size:`sm`,disabled:g,onClick:l.save,children:_}),t[14]=l.save,t[15]=g,t[16]=_,t[17]=v):v=t[17];let y;t[18]!==a||t[19]!==s?(y=(0,K.jsx)(rt,{isSaving:a,onCancel:s}),t[18]=a,t[19]=s,t[20]=y):y=t[20];let b;t[21]!==f||t[22]!==p||t[23]!==m||t[24]!==v||t[25]!==y?(b=(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[f,p,m,v,y]}),t[21]=f,t[22]=p,t[23]=m,t[24]=v,t[25]=y,t[26]=b):b=t[26];let x;return t[27]!==b||t[28]!==d?(x=(0,K.jsx)(pe,{className:`bg-muted/15`,title:`New keybinding`,description:d,control:b}),t[27]=b,t[28]=d,t[29]=x):x=t[29],x}function at(e){let{groups:t,anchorIds:n,savingCommand:r,...i}=e;return t.map(e=>(0,K.jsx)(he,{id:`keybindings-${e.id}`,title:e.title,children:e.rows.map(e=>(0,K.jsx)(Ze,{row:e,anchorId:n.get(e.id),isSaving:r===e.command,...i},e.id))},e.id))}function ot(){let e=(0,W.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,K.jsxs)(L,{children:[(0,K.jsx)(F,{delay:200,render:(0,K.jsx)(h,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":`The browser may claim some shortcuts first. The desktop app receives them all.`,children:(0,K.jsx)(s,{className:`size-3.5 text-warning`})})}),(0,K.jsx)(I,{side:`top`,className:`max-w-72`,children:`The browser may claim some shortcuts first. The desktop app receives them all.`})]}),e[0]=t):t=e[0],t}function st(){let e=(0,W.c)(83),{environment:t,connectedEnvironments:n}=de(),r=ee(t?.environmentId??null,v),a=te(n,i),o;e[0]!==n||e[1]!==a?(o=n.length>0&&n.every(e=>a.has(e.environmentId)),e[0]=n,e[1]=a,e[2]=o):o=e[2];let s=o,l=t?.serverConfig?.keybindings,u;e[3]===l?u=e[4]:(u=l??[],e[3]=l,e[4]=u);let d;e[5]===u?d=e[6]:(d=c(u),e[5]=u,e[6]=d);let f=d,m=t?.serverConfig?.keybindingsConfigPath??null,_;e[7]===t?.serverConfig?.availableEditors?_=e[8]:(_=t?.serverConfig?.availableEditors??[],e[7]=t?.serverConfig?.availableEditors,e[8]=_);let y=_,b;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(b={reportFailure:!1},e[9]=b):b=e[9];let x=P(M.upsertKeybinding,b),S;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(S={reportFailure:!1},e[10]=S):S=e[10];let T=P(M.removeKeybinding,S),E=Ee(t?.environmentId??null,y),[D,O]=(0,G.useState)(``),k=(0,G.useRef)(null),[R,re]=(0,G.useState)(null),[ie,ae]=(0,G.useState)(!1),oe;e[11]!==f||e[12]!==D?(oe=Se(f,D),e[11]=f,e[12]=D,e[13]=oe):oe=e[13];let z=oe,se;e[14]===z?se=e[15]:(se=xe(z),e[14]=z,e[15]=se);let ce=se,B;if(e[16]!==z){B=new Map;let t=new Set;for(let e of z)t.has(e.command)||(t.add(e.command),B.set(e.id,Oe(e.command)));e[16]=z,e[17]=B}else B=e[17];let le=B,ue;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(ue={select:ft},e[18]=ue):ue=e[18];let pe=A(ue),[V,ge]=(0,G.useState)(pe);pe!==V&&(ge(pe),pe.startsWith(`keybinding-`)&&O(``));let _e;e[19]===f?_e=e[20]:(_e=be(f),e[19]=f,e[20]=_e);let ye=_e,H;e[21]===Symbol.for(`react.memo_cache_sentinel`)?(H=ve(),e[21]=H):H=e[21];let U=H,Ce;e[22]!==m||e[23]!==E||e[24]!==t?(Ce=()=>{m&&t&&N(t.environmentId,`orchestration:operate`)&&(async()=>{let e=await E(m);if(e._tag===`Success`||C(e))return;let t=w(e);j.add({title:`Unable to open keybindings file`,description:t instanceof Error?t.message:`The keybindings file was not opened.`,type:`error`})})()},e[22]=m,e[23]=E,e[24]=t,e[25]=Ce):Ce=e[25];let we=Ce,Te;e[26]!==n||e[27]!==t||e[28]!==x?(Te=e=>{if(!t||!n.every(dt))return;re(e.command);let r={command:e.command,key:e.key.trim(),...e.when?.trim()?{when:e.when.trim()}:{},...e.replace?{replace:e.replace}:{}};(async()=>{let e=await Promise.all(n.map(e=>x({environmentId:e.environmentId,input:r})));re(null);let t=e.find(ut);if(!t){ae(!1);return}if(!C(t)){let e=w(t);j.add({title:`Unable to save keybinding`,description:e instanceof Error?e.message:`The keybinding was not saved.`,type:`error`})}})()},e[26]=n,e[27]=t,e[28]=x,e[29]=Te):Te=e[29];let q=Te,ke;e[30]!==n||e[31]!==t||e[32]!==T?(ke=e=>{t&&n.every(lt)&&(re(e.command),(async()=>{let t=await Promise.all(n.map(t=>T({environmentId:t.environmentId,input:Ue(e)})));re(null);let r=t.find(ct)??t[0];if(r?._tag===`Failure`&&!C(r)){let e=w(r);j.add({title:`Unable to remove keybinding`,description:e instanceof Error?e.message:`The keybinding was not removed.`,type:`error`})}})())},e[30]=n,e[31]=t,e[32]=T,e[33]=ke):ke=e[33];let je=ke,J;e[34]===q?J=e[35]:(J=e=>{e.defaultKey&&q({command:e.command,key:e.defaultKey,when:e.defaultWhen.trim().length>0?e.defaultWhen:void 0,replace:{command:e.command,key:e.key,...e.when.trim().length>0?{when:e.when}:{}}})},e[34]=q,e[35]=J);let Me=J,Ne;e[36]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=()=>ae(!1),e[36]=Ne):Ne=e[36];let Pe=Ne,Y;e[37]!==je||e[38]!==Me||e[39]!==z||e[40]!==q?(Y={allRows:z,variables:U,onSave:q,onReset:Me,onRemove:je},e[37]=je,e[38]=Me,e[39]=z,e[40]=q,e[41]=Y):Y=e[41];let Fe=Y,Ie,Le;e[42]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=De(`keybindings`),Le=ne?null:(0,K.jsx)(ot,{}),e[42]=Ie,e[43]=Le):(Ie=e[42],Le=e[43]);let X;e[44]===D?X=e[45]:(X=(0,K.jsx)(Ae,{query:D,onChange:O,inputRef:k}),e[44]=D,e[45]=X);let Re=ie||!s,ze,Be;e[46]===Symbol.for(`react.memo_cache_sentinel`)?(ze=()=>ae(!0),Be=(0,K.jsx)(p,{"aria-hidden":!0,className:`size-4`}),e[46]=ze,e[47]=Be):(ze=e[46],Be=e[47]);let Z;e[48]===Re?Z=e[49]:(Z=(0,K.jsxs)(h,{type:`button`,variant:`outline`,disabled:Re,onClick:ze,children:[Be,`Add keybinding`]}),e[48]=Re,e[49]=Z);let Ve=!m||!r,He;e[50]===Symbol.for(`react.memo_cache_sentinel`)?(He=(0,K.jsx)(g,{"aria-hidden":!0,className:`size-4`}),e[50]=He):He=e[50];let Q;e[51]!==we||e[52]!==Ve?(Q=(0,K.jsx)(F,{render:(0,K.jsx)(h,{type:`button`,variant:`outline`,size:`icon`,disabled:Ve,onClick:we,"aria-label":`Open keybindings.json`,children:He})}),e[51]=we,e[52]=Ve,e[53]=Q):Q=e[53];let We;e[54]===Symbol.for(`react.memo_cache_sentinel`)?(We=(0,K.jsx)(I,{side:`top`,children:`Open keybindings.json`}),e[54]=We):We=e[54];let Ge;e[55]===Q?Ge=e[56]:(Ge=(0,K.jsxs)(L,{children:[Q,We]}),e[55]=Q,e[56]=Ge);let $;e[57]!==X||e[58]!==Z||e[59]!==Ge?($=(0,K.jsx)(he,{...Ie,headerAction:Le,children:(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 px-3 py-3 sm:px-4`,children:[X,Z,Ge]})}),e[57]=X,e[58]=Z,e[59]=Ge,e[60]=$):$=e[60];let Ke;e[61]!==s||e[62]!==n?(Ke=s?null:(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n.length===0?`Connect an environment to change keybindings.`:`This connection can view keybindings but cannot change them.`}),e[61]=s,e[62]=n,e[63]=Ke):Ke=e[63];let qe=!s,Je;e[64]!==ye||e[65]!==ie||e[66]!==z||e[67]!==q||e[68]!==R?(Je=ie?(0,K.jsx)(fe,{children:(0,K.jsx)(it,{commandOptions:ye,allRows:z,variables:U,isSaving:R!==null,onSave:q,onCancel:Pe})}):null,e[64]=ye,e[65]=ie,e[66]=z,e[67]=q,e[68]=R,e[69]=Je):Je=e[69];let Ye;e[70]!==le||e[71]!==ce||e[72]!==Fe||e[73]!==R?(Ye=ce.length>0?(0,K.jsx)(at,{groups:ce,anchorIds:le,savingCommand:R,...Fe}):(0,K.jsx)(fe,{children:(0,K.jsx)(`div`,{className:`px-4 py-12 text-center text-sm text-muted-foreground`,children:`No keybindings match your search.`})}),e[70]=le,e[71]=ce,e[72]=Fe,e[73]=R,e[74]=Ye):Ye=e[74];let Xe;e[75]!==qe||e[76]!==Je||e[77]!==Ye?(Xe=(0,K.jsxs)(`div`,{inert:qe,className:`flex flex-col gap-8`,children:[Je,Ye]}),e[75]=qe,e[76]=Je,e[77]=Ye,e[78]=Xe):Xe=e[78];let Ze;return e[79]!==$||e[80]!==Ke||e[81]!==Xe?(Ze=(0,K.jsxs)(me,{children:[$,Ke,Xe]}),e[79]=$,e[80]=Ke,e[81]=Xe,e[82]=Ze):Ze=e[82],Ze}function ct(e){return e._tag===`Failure`}function lt(e){return N(e.environmentId,i)}function ut(e){return e._tag===`Failure`}function dt(e){return N(e.environmentId,i)}function ft(e){return e.hash.replace(/^#/,``)}var pt=st;export{pt as component};
2
+ //# sourceMappingURL=settings.keybindings-C7D1i238.js.map
@@ -1,2 +1,2 @@
1
- import{a as e,t}from"./react-DH3P2YXY.js";import{n,t as r}from"./jsx-runtime-BnjsACtP.js";import{af as i,cm as a,dr as o,jd as s}from"./utils-CrFJwxSd.js";import{a as c,n as l,t as u}from"./tooltip-T5ePvxsH.js";import{n as d,r as f,t as p}from"./input-group-CfPOCEuC.js";import{i as m,s as h}from"./settingsLayout-DFYjWgKN.js";import{_a as g,ga as _,ha as v}from"./main-BGaSDXjP.js";var y=e(t(),1),b=n();function x(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function S(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function C(e){if(typeof e!=`string`)return!1;try{let t=new URL(e).protocol;return t===`http:`||t===`https:`}catch{return!1}}function w(e,t){if(!x(e))throw Error(`License entry ${String(t+1)} is not an object.`);if(!S(e.bundles)||e.bundles.length===0||e.kind!==`custom`&&e.kind!==`package`||typeof e.license!=`string`||typeof e.name!=`string`||typeof e.noticeText!=`string`||e.sourceUrl!==null&&!C(e.sourceUrl)||e.version!==null&&typeof e.version!=`string`)throw Error(`License entry ${String(t+1)} has an invalid shape.`);return{bundles:e.bundles,kind:e.kind,license:e.license,name:e.name,noticeText:e.noticeText,sourceUrl:e.sourceUrl,version:e.version}}function T(e){if(!x(e)||e.schemaVersion!==1||!Array.isArray(e.entries))throw Error(`The open-source license manifest has an unsupported format.`);let t=e.entries.map(w),n=new Set;for(let e of t){let t=k(e);if(n.has(t))throw Error(`The open-source license manifest contains a duplicate entry: ${t}`);n.add(t)}return{schemaVersion:1,entries:t}}function E(e,t){let n=t.trim().toLowerCase().split(/\s+/).filter(e=>e.length>0);return n.length===0?e:e.filter(e=>{let t=[e.name,e.version,e.license,...e.bundles].filter(e=>e!==null).join(` `).toLowerCase();return n.every(e=>t.includes(e))})}var D={android:`Android`,assets:`Assets`,desktop:`Desktop`,"device-tools":`Device tools`,ios:`iOS`,mobile:`Mobile`,server:`Server`,web:`Web`};function O(e){return e.map(e=>Object.prototype.hasOwnProperty.call(D,e)?D[e]:e).join(`, `)}function k(e){return encodeURIComponent(JSON.stringify([e.kind,e.name,e.version]))}var A=e(r(),1),j;async function M(){let e=AbortSignal.timeout(3e4);try{let t=await fetch(`${`/`.replace(/\/$/,``)}/third-party-licenses.json`,{signal:e});if(!t.ok)throw Error(`The license manifest request failed with status ${String(t.status)}.`);return T(await t.json())}catch(t){throw e.aborted?Error(`The license manifest took too long to load.`,{cause:t}):t}}function N(){return j??=M().catch(e=>{throw j=void 0,e}),j}function P(e){let t=(0,b.c)(34),{entry:n,open:r,onOpenChange:a}=e,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,A.jsx)(s,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-muted-foreground transition-transform duration-200 group-data-panel-open:rotate-90`}),t[0]=c):c=t[0];let l;t[1]===n.name?l=t[2]:(l=(0,A.jsx)(`span`,{className:`truncate font-medium text-foreground`,children:n.name}),t[1]=n.name,t[2]=l);let u;t[3]===n.version?u=t[4]:(u=n.version?(0,A.jsx)(`code`,{className:`shrink-0 text-xs text-muted-foreground`,children:n.version}):null,t[3]=n.version,t[4]=u);let d;t[5]!==l||t[6]!==u?(d=(0,A.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-2`,children:[l,u]}),t[5]=l,t[6]=u,t[7]=d):d=t[7];let f=n.license,p;t[8]===n.bundles?p=t[9]:(p=O(n.bundles),t[8]=n.bundles,t[9]=p);let m;t[10]!==n.license||t[11]!==p?(m=(0,A.jsxs)(`span`,{className:`max-w-[42%] shrink-0 truncate text-xs text-muted-foreground`,children:[f,` · `,p]}),t[10]=n.license,t[11]=p,t[12]=m):m=t[12];let h;t[13]!==d||t[14]!==m?(h=(0,A.jsxs)(g,{className:`group flex min-h-10 min-w-0 flex-1 items-center gap-2.5 px-3 text-left sm:min-h-9 sm:px-4`,children:[c,d,m]}),t[13]=d,t[14]=m,t[15]=h):h=t[15];let y;t[16]!==n.name||t[17]!==n.sourceUrl?(y=n.sourceUrl?(0,A.jsx)(o,{"aria-label":`View project source for ${n.name}`,className:`me-3 shrink-0 sm:me-4`,render:(0,A.jsx)(`a`,{href:n.sourceUrl,rel:`noreferrer noopener`,target:`_blank`}),size:`icon-micro`,title:`Project source`,variant:`ghost-muted`,children:(0,A.jsx)(i,{"aria-hidden":!0,className:`size-3`})}):null,t[16]=n.name,t[17]=n.sourceUrl,t[18]=y):y=t[18];let x;t[19]!==h||t[20]!==y?(x=(0,A.jsxs)(`div`,{className:`flex min-h-10 items-center hover:bg-muted/35 sm:min-h-9`,children:[h,y]}),t[19]=h,t[20]=y,t[21]=x):x=t[21];let S;t[22]!==n.noticeText||t[23]!==r?(S=r?(0,A.jsx)(`div`,{className:`px-9 pt-1 pb-4 sm:px-10`,children:(0,A.jsx)(`pre`,{className:`max-w-[76ch] whitespace-pre-wrap break-words font-mono text-xs/5 text-foreground/80`,children:n.noticeText})}):null,t[22]=n.noticeText,t[23]=r,t[24]=S):S=t[24];let C;t[25]===S?C=t[26]:(C=(0,A.jsx)(_,{children:S}),t[25]=S,t[26]=C);let w;t[27]!==x||t[28]!==C?(w=(0,A.jsxs)(`article`,{children:[x,C]}),t[27]=x,t[28]=C,t[29]=w):w=t[29];let T;return t[30]!==a||t[31]!==r||t[32]!==w?(T=(0,A.jsx)(v,{open:r,onOpenChange:a,children:w}),t[30]=a,t[31]=r,t[32]=w,t[33]=T):T=t[33],T}function F(e){let t=(0,b.c)(2),{filteredCount:n,totalCount:r}=e,i=n===r?`${String(r)} notices`:`${String(n)} of ${String(r)}`,a;return t[0]===i?a=t[1]:(a=(0,A.jsx)(`p`,{className:`whitespace-nowrap text-xs font-normal text-muted-foreground tabular-nums`,children:i}),t[0]=i,t[1]=a),a}function I(e){let t=(0,b.c)(34),{query:n,onQueryChange:r,searchOpen:i,onSearchOpenChange:s,filteredCount:m,totalCount:h}=e;if(!i){let e;t[0]!==m||t[1]!==h?(e=(0,A.jsx)(F,{filteredCount:m,totalCount:h}),t[0]=m,t[1]=h,t[2]=e):e=t[2];let n;t[3]===s?n=t[4]:(n=()=>s(!0),t[3]=s,t[4]=n);let r;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,A.jsx)(a,{className:`size-3`}),t[5]=r):r=t[5];let i;t[6]===n?i=t[7]:(i=(0,A.jsx)(c,{render:(0,A.jsx)(o,{"aria-label":`Search open-source licenses`,onClick:n,size:`icon-micro`,type:`button`,variant:`ghost-muted`,children:r})}),t[6]=n,t[7]=i);let d;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,A.jsx)(l,{side:`top`,children:`Search licenses`}),t[8]=d):d=t[8];let f;t[9]===i?f=t[10]:(f=(0,A.jsxs)(u,{children:[i,d]}),t[9]=i,t[10]=f);let p;return t[11]!==e||t[12]!==f?(p=(0,A.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[e,f]}),t[11]=e,t[12]=f,t[13]=p):p=t[13],p}let g;t[14]!==m||t[15]!==h?(g=(0,A.jsx)(`div`,{className:`hidden sm:block`,children:(0,A.jsx)(F,{filteredCount:m,totalCount:h})}),t[14]=m,t[15]=h,t[16]=g):g=t[16];let _;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,A.jsx)(d,{children:(0,A.jsx)(a,{"aria-hidden":!0,className:`size-3`})}),t[17]=_):_=t[17];let v;t[18]!==s||t[19]!==n.length?(v=()=>{n.length===0&&s(!1)},t[18]=s,t[19]=n.length,t[20]=v):v=t[20];let y;t[21]===r?y=t[22]:(y=e=>r(e.currentTarget.value),t[21]=r,t[22]=y);let x;t[23]!==r||t[24]!==s?(x=e=>{e.key===`Escape`&&(e.preventDefault(),r(``),s(!1))},t[23]=r,t[24]=s,t[25]=x):x=t[25];let S;t[26]!==n||t[27]!==v||t[28]!==y||t[29]!==x?(S=(0,A.jsxs)(p,{className:`w-36 sm:w-44`,children:[_,(0,A.jsx)(f,{"aria-label":`Search open-source licenses`,autoFocus:!0,onBlur:v,onChange:y,onKeyDown:x,placeholder:`Search licenses`,size:`sm`,type:`search`,value:n})]}),t[26]=n,t[27]=v,t[28]=y,t[29]=x,t[30]=S):S=t[30];let C;return t[31]!==g||t[32]!==S?(C=(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[g,S]}),t[31]=g,t[32]=S,t[33]=C):C=t[33],C}function L(e){let t=(0,b.c)(8),{message:n,onRetry:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,A.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:`Open-source notices are unavailable`}),t[0]=i):i=t[0];let a;t[1]===n?a=t[2]:(a=(0,A.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[i,(0,A.jsx)(`p`,{className:`max-w-[70ch] text-pretty text-xs leading-normal text-muted-foreground/80`,children:n})]}),t[1]=n,t[2]=a);let s;t[3]===r?s=t[4]:(s=(0,A.jsx)(o,{type:`button`,size:`xs`,variant:`outline`,onClick:r,children:`Try again`}),t[3]=r,t[4]=s);let c;return t[5]!==a||t[6]!==s?(c=(0,A.jsxs)(`div`,{className:`flex flex-col items-start gap-3 px-3 py-5 sm:px-4`,children:[a,s]}),t[5]=a,t[6]=s,t[7]=c):c=t[7],c}function R(){let e=(0,b.c)(25),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={status:`loading`},e[0]=t):t=e[0];let[n,r]=(0,y.useState)(t),[i,a]=(0,y.useState)(``),[o,s]=(0,y.useState)(!1),[c,l]=(0,y.useState)(null),[u,d]=(0,y.useState)(0),f;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(f=()=>{let e=!1;return r({status:`loading`}),N().then(t=>{e||r({status:`ready`,manifest:t})},t=>{e||r({status:`error`,message:t instanceof Error?t.message:`The license manifest could not load.`})}),()=>{e=!0}},e[1]=f):f=e[1];let p;e[2]===u?p=e[3]:(p=[u],e[2]=u,e[3]=p),(0,y.useEffect)(f,p);let g;e[4]!==n.manifest||e[5]!==n.status?(g=n.status===`ready`?n.manifest.entries:[],e[4]=n.manifest,e[5]=n.status,e[6]=g):g=e[6];let _=g,v;e[7]!==_||e[8]!==i?(v=E(_,i),e[7]=_,e[8]=i,e[9]=v):v=e[9];let x=v,S;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(S=()=>d(z),e[10]=S):S=e[10];let C=S,w;e[11]!==_||e[12]!==x||e[13]!==i||e[14]!==o||e[15]!==n.status?(w=n.status===`ready`?(0,A.jsx)(I,{query:i,onQueryChange:a,searchOpen:o,onSearchOpenChange:s,filteredCount:x.length,totalCount:_.length}):null,e[11]=_,e[12]=x,e[13]=i,e[14]=o,e[15]=n.status,e[16]=w):w=e[16];let T;e[17]!==x||e[18]!==c||e[19]!==n.message||e[20]!==n.status?(T=n.status===`ready`?(0,A.jsx)(`div`,{className:`text-base sm:text-sm`,children:x.length>0?x.map(e=>{let t=k(e);return(0,A.jsx)(P,{entry:e,open:c===t,onOpenChange:e=>l(e?t:null)},t)}):(0,A.jsx)(`p`,{className:`px-3 py-8 text-center text-sm/6 text-muted-foreground sm:px-4`,children:`No licenses match that search.`})}):n.status===`error`?(0,A.jsx)(L,{message:n.message,onRetry:C}):(0,A.jsx)(`p`,{className:`px-3 py-5 text-sm/6 text-muted-foreground sm:px-4`,children:`Loading open-source notices…`}),e[17]=x,e[18]=c,e[19]=n.message,e[20]=n.status,e[21]=T):T=e[21];let D;return e[22]!==w||e[23]!==T?(D=(0,A.jsx)(m,{children:(0,A.jsx)(h,{title:`Third-party notices`,headerAction:w,children:T})}),e[22]=w,e[23]=T,e[24]=D):D=e[24],D}function z(e){return e+1}var B=R;export{B as component};
2
- //# sourceMappingURL=settings.open-source-licenses-wMwaYCss.js.map
1
+ import{a as e,t}from"./react-DH3P2YXY.js";import{n,t as r}from"./jsx-runtime-BnjsACtP.js";import{Md as i,dr as a,lm as o,of as s}from"./utils-DhUt689t.js";import{a as c,n as l,t as u}from"./tooltip-CY3W5y-f.js";import{n as d,r as f,t as p}from"./input-group-DMFlSk_7.js";import{i as m,s as h}from"./settingsLayout-4ySvFdXb.js";import{_a as g,ga as _,ha as v}from"./main-VfCRP294.js";var y=e(t(),1),b=n();function x(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function S(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function C(e){if(typeof e!=`string`)return!1;try{let t=new URL(e).protocol;return t===`http:`||t===`https:`}catch{return!1}}function w(e,t){if(!x(e))throw Error(`License entry ${String(t+1)} is not an object.`);if(!S(e.bundles)||e.bundles.length===0||e.kind!==`custom`&&e.kind!==`package`||typeof e.license!=`string`||typeof e.name!=`string`||typeof e.noticeText!=`string`||e.sourceUrl!==null&&!C(e.sourceUrl)||e.version!==null&&typeof e.version!=`string`)throw Error(`License entry ${String(t+1)} has an invalid shape.`);return{bundles:e.bundles,kind:e.kind,license:e.license,name:e.name,noticeText:e.noticeText,sourceUrl:e.sourceUrl,version:e.version}}function T(e){if(!x(e)||e.schemaVersion!==1||!Array.isArray(e.entries))throw Error(`The open-source license manifest has an unsupported format.`);let t=e.entries.map(w),n=new Set;for(let e of t){let t=k(e);if(n.has(t))throw Error(`The open-source license manifest contains a duplicate entry: ${t}`);n.add(t)}return{schemaVersion:1,entries:t}}function E(e,t){let n=t.trim().toLowerCase().split(/\s+/).filter(e=>e.length>0);return n.length===0?e:e.filter(e=>{let t=[e.name,e.version,e.license,...e.bundles].filter(e=>e!==null).join(` `).toLowerCase();return n.every(e=>t.includes(e))})}var D={android:`Android`,assets:`Assets`,desktop:`Desktop`,"device-tools":`Device tools`,ios:`iOS`,mobile:`Mobile`,server:`Server`,web:`Web`};function O(e){return e.map(e=>Object.prototype.hasOwnProperty.call(D,e)?D[e]:e).join(`, `)}function k(e){return encodeURIComponent(JSON.stringify([e.kind,e.name,e.version]))}var A=e(r(),1),j;async function M(){let e=AbortSignal.timeout(3e4);try{let t=await fetch(`${`/`.replace(/\/$/,``)}/third-party-licenses.json`,{signal:e});if(!t.ok)throw Error(`The license manifest request failed with status ${String(t.status)}.`);return T(await t.json())}catch(t){throw e.aborted?Error(`The license manifest took too long to load.`,{cause:t}):t}}function N(){return j??=M().catch(e=>{throw j=void 0,e}),j}function P(e){let t=(0,b.c)(34),{entry:n,open:r,onOpenChange:o}=e,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,A.jsx)(i,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-muted-foreground transition-transform duration-200 group-data-panel-open:rotate-90`}),t[0]=c):c=t[0];let l;t[1]===n.name?l=t[2]:(l=(0,A.jsx)(`span`,{className:`truncate font-medium text-foreground`,children:n.name}),t[1]=n.name,t[2]=l);let u;t[3]===n.version?u=t[4]:(u=n.version?(0,A.jsx)(`code`,{className:`shrink-0 text-xs text-muted-foreground`,children:n.version}):null,t[3]=n.version,t[4]=u);let d;t[5]!==l||t[6]!==u?(d=(0,A.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-2`,children:[l,u]}),t[5]=l,t[6]=u,t[7]=d):d=t[7];let f=n.license,p;t[8]===n.bundles?p=t[9]:(p=O(n.bundles),t[8]=n.bundles,t[9]=p);let m;t[10]!==n.license||t[11]!==p?(m=(0,A.jsxs)(`span`,{className:`max-w-[42%] shrink-0 truncate text-xs text-muted-foreground`,children:[f,` · `,p]}),t[10]=n.license,t[11]=p,t[12]=m):m=t[12];let h;t[13]!==d||t[14]!==m?(h=(0,A.jsxs)(g,{className:`group flex min-h-10 min-w-0 flex-1 items-center gap-2.5 px-3 text-left sm:min-h-9 sm:px-4`,children:[c,d,m]}),t[13]=d,t[14]=m,t[15]=h):h=t[15];let y;t[16]!==n.name||t[17]!==n.sourceUrl?(y=n.sourceUrl?(0,A.jsx)(a,{"aria-label":`View project source for ${n.name}`,className:`me-3 shrink-0 sm:me-4`,render:(0,A.jsx)(`a`,{href:n.sourceUrl,rel:`noreferrer noopener`,target:`_blank`}),size:`icon-micro`,title:`Project source`,variant:`ghost-muted`,children:(0,A.jsx)(s,{"aria-hidden":!0,className:`size-3`})}):null,t[16]=n.name,t[17]=n.sourceUrl,t[18]=y):y=t[18];let x;t[19]!==h||t[20]!==y?(x=(0,A.jsxs)(`div`,{className:`flex min-h-10 items-center hover:bg-muted/35 sm:min-h-9`,children:[h,y]}),t[19]=h,t[20]=y,t[21]=x):x=t[21];let S;t[22]!==n.noticeText||t[23]!==r?(S=r?(0,A.jsx)(`div`,{className:`px-9 pt-1 pb-4 sm:px-10`,children:(0,A.jsx)(`pre`,{className:`max-w-[76ch] whitespace-pre-wrap break-words font-mono text-xs/5 text-foreground/80`,children:n.noticeText})}):null,t[22]=n.noticeText,t[23]=r,t[24]=S):S=t[24];let C;t[25]===S?C=t[26]:(C=(0,A.jsx)(_,{children:S}),t[25]=S,t[26]=C);let w;t[27]!==x||t[28]!==C?(w=(0,A.jsxs)(`article`,{children:[x,C]}),t[27]=x,t[28]=C,t[29]=w):w=t[29];let T;return t[30]!==o||t[31]!==r||t[32]!==w?(T=(0,A.jsx)(v,{open:r,onOpenChange:o,children:w}),t[30]=o,t[31]=r,t[32]=w,t[33]=T):T=t[33],T}function F(e){let t=(0,b.c)(2),{filteredCount:n,totalCount:r}=e,i=n===r?`${String(r)} notices`:`${String(n)} of ${String(r)}`,a;return t[0]===i?a=t[1]:(a=(0,A.jsx)(`p`,{className:`whitespace-nowrap text-xs font-normal text-muted-foreground tabular-nums`,children:i}),t[0]=i,t[1]=a),a}function I(e){let t=(0,b.c)(34),{query:n,onQueryChange:r,searchOpen:i,onSearchOpenChange:s,filteredCount:m,totalCount:h}=e;if(!i){let e;t[0]!==m||t[1]!==h?(e=(0,A.jsx)(F,{filteredCount:m,totalCount:h}),t[0]=m,t[1]=h,t[2]=e):e=t[2];let n;t[3]===s?n=t[4]:(n=()=>s(!0),t[3]=s,t[4]=n);let r;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,A.jsx)(o,{className:`size-3`}),t[5]=r):r=t[5];let i;t[6]===n?i=t[7]:(i=(0,A.jsx)(c,{render:(0,A.jsx)(a,{"aria-label":`Search open-source licenses`,onClick:n,size:`icon-micro`,type:`button`,variant:`ghost-muted`,children:r})}),t[6]=n,t[7]=i);let d;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,A.jsx)(l,{side:`top`,children:`Search licenses`}),t[8]=d):d=t[8];let f;t[9]===i?f=t[10]:(f=(0,A.jsxs)(u,{children:[i,d]}),t[9]=i,t[10]=f);let p;return t[11]!==e||t[12]!==f?(p=(0,A.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[e,f]}),t[11]=e,t[12]=f,t[13]=p):p=t[13],p}let g;t[14]!==m||t[15]!==h?(g=(0,A.jsx)(`div`,{className:`hidden sm:block`,children:(0,A.jsx)(F,{filteredCount:m,totalCount:h})}),t[14]=m,t[15]=h,t[16]=g):g=t[16];let _;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,A.jsx)(d,{children:(0,A.jsx)(o,{"aria-hidden":!0,className:`size-3`})}),t[17]=_):_=t[17];let v;t[18]!==s||t[19]!==n.length?(v=()=>{n.length===0&&s(!1)},t[18]=s,t[19]=n.length,t[20]=v):v=t[20];let y;t[21]===r?y=t[22]:(y=e=>r(e.currentTarget.value),t[21]=r,t[22]=y);let x;t[23]!==r||t[24]!==s?(x=e=>{e.key===`Escape`&&(e.preventDefault(),r(``),s(!1))},t[23]=r,t[24]=s,t[25]=x):x=t[25];let S;t[26]!==n||t[27]!==v||t[28]!==y||t[29]!==x?(S=(0,A.jsxs)(p,{className:`w-36 sm:w-44`,children:[_,(0,A.jsx)(f,{"aria-label":`Search open-source licenses`,autoFocus:!0,onBlur:v,onChange:y,onKeyDown:x,placeholder:`Search licenses`,size:`sm`,type:`search`,value:n})]}),t[26]=n,t[27]=v,t[28]=y,t[29]=x,t[30]=S):S=t[30];let C;return t[31]!==g||t[32]!==S?(C=(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[g,S]}),t[31]=g,t[32]=S,t[33]=C):C=t[33],C}function L(e){let t=(0,b.c)(8),{message:n,onRetry:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,A.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:`Open-source notices are unavailable`}),t[0]=i):i=t[0];let o;t[1]===n?o=t[2]:(o=(0,A.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[i,(0,A.jsx)(`p`,{className:`max-w-[70ch] text-pretty text-xs leading-normal text-muted-foreground/80`,children:n})]}),t[1]=n,t[2]=o);let s;t[3]===r?s=t[4]:(s=(0,A.jsx)(a,{type:`button`,size:`xs`,variant:`outline`,onClick:r,children:`Try again`}),t[3]=r,t[4]=s);let c;return t[5]!==o||t[6]!==s?(c=(0,A.jsxs)(`div`,{className:`flex flex-col items-start gap-3 px-3 py-5 sm:px-4`,children:[o,s]}),t[5]=o,t[6]=s,t[7]=c):c=t[7],c}function R(){let e=(0,b.c)(25),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={status:`loading`},e[0]=t):t=e[0];let[n,r]=(0,y.useState)(t),[i,a]=(0,y.useState)(``),[o,s]=(0,y.useState)(!1),[c,l]=(0,y.useState)(null),[u,d]=(0,y.useState)(0),f;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(f=()=>{let e=!1;return r({status:`loading`}),N().then(t=>{e||r({status:`ready`,manifest:t})},t=>{e||r({status:`error`,message:t instanceof Error?t.message:`The license manifest could not load.`})}),()=>{e=!0}},e[1]=f):f=e[1];let p;e[2]===u?p=e[3]:(p=[u],e[2]=u,e[3]=p),(0,y.useEffect)(f,p);let g;e[4]!==n.manifest||e[5]!==n.status?(g=n.status===`ready`?n.manifest.entries:[],e[4]=n.manifest,e[5]=n.status,e[6]=g):g=e[6];let _=g,v;e[7]!==_||e[8]!==i?(v=E(_,i),e[7]=_,e[8]=i,e[9]=v):v=e[9];let x=v,S;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(S=()=>d(z),e[10]=S):S=e[10];let C=S,w;e[11]!==_||e[12]!==x||e[13]!==i||e[14]!==o||e[15]!==n.status?(w=n.status===`ready`?(0,A.jsx)(I,{query:i,onQueryChange:a,searchOpen:o,onSearchOpenChange:s,filteredCount:x.length,totalCount:_.length}):null,e[11]=_,e[12]=x,e[13]=i,e[14]=o,e[15]=n.status,e[16]=w):w=e[16];let T;e[17]!==x||e[18]!==c||e[19]!==n.message||e[20]!==n.status?(T=n.status===`ready`?(0,A.jsx)(`div`,{className:`text-base sm:text-sm`,children:x.length>0?x.map(e=>{let t=k(e);return(0,A.jsx)(P,{entry:e,open:c===t,onOpenChange:e=>l(e?t:null)},t)}):(0,A.jsx)(`p`,{className:`px-3 py-8 text-center text-sm/6 text-muted-foreground sm:px-4`,children:`No licenses match that search.`})}):n.status===`error`?(0,A.jsx)(L,{message:n.message,onRetry:C}):(0,A.jsx)(`p`,{className:`px-3 py-5 text-sm/6 text-muted-foreground sm:px-4`,children:`Loading open-source notices…`}),e[17]=x,e[18]=c,e[19]=n.message,e[20]=n.status,e[21]=T):T=e[21];let D;return e[22]!==w||e[23]!==T?(D=(0,A.jsx)(m,{children:(0,A.jsx)(h,{title:`Third-party notices`,headerAction:w,children:T})}),e[22]=w,e[23]=T,e[24]=D):D=e[24],D}function z(e){return e+1}var B=R;export{B as component};
2
+ //# sourceMappingURL=settings.open-source-licenses-6oFDgAt7.js.map
@@ -1,5 +1,5 @@
1
- import{a as e,t}from"./react-DH3P2YXY.js";import{n,t as r}from"./jsx-runtime-BnjsACtP.js";import{$n as i,A_ as a,D_ as o,E_ as s,Im as c,Jn as l,Jp as u,O_ as d,Os as f,T_ as p,Tb as m,Yn as h,Zp as g,Zw as _,ad as v,cm as y,dr as b,eE as x,fm as S,j_ as C,k_ as w,kd as T,l as E,nm as D,qp as O,t as k,tr as A,ts as j,ur as M,w_ as N,wp as P,yd as F}from"./utils-CrFJwxSd.js";import{n as I}from"./ChatMarkdown-C2KOLN1s.js";import{a as L,c as R,o as z,s as B,t as V}from"./select-Ctq0UILH.js";import{t as H}from"./useLocation-DbWity7H.js";import{p as U}from"./toast-BcjbmUtS.js";import{C as W}from"./useSettings-BL4ZWGQV.js";import{f as G}from"./server-BvxyePeo.js";import{t as K}from"./use-atom-command-BNkv9iyk.js";import{s as q,u as ee}from"./providerSkills-C4Fu_qyq.js";import{a as J,n as te,t as ne}from"./tooltip-T5ePvxsH.js";import{t as re}from"./skeleton-C9J-Xl06.js";import{t as ie}from"./textarea-DjRGRzMg.js";import{n as ae,t as oe}from"./toggle-group-Cilo8czD.js";import{t as se}from"./input-BCWES8Y7.js";import{c as ce,r as le,s as ue,t as de}from"./dialog-BwjzOzO6.js";import{i as fe,o as pe,r as me,t as he}from"./empty-C0oiFHy_.js";import{n as ge,r as _e,t as ve}from"./input-group-CfPOCEuC.js";import{a as ye}from"./projectFilesQueryState-DXrTSOqg.js";import{F as be,V as xe,W as Se,a as Ce,i as we,s as Te}from"./settingsLayout-DFYjWgKN.js";import{Ar as Ee,Fr as De,Ir as Oe,Mr as ke,Nr as Ae,Pr as je,ir as Me,jr as Ne,va as Pe,vi as Fe}from"./main-BGaSDXjP.js";import{t as Ie}from"./SecretInput-BPPzPNI1.js";var Y=n(),Le={spawn:`Failed to start`,timeout:`Timed out`,protocol:`Not an MCP server`,http:`Can't connect`,auth:`Credentials rejected`};function Re(e,t,n){if(!e.enabled)return{tone:`muted`,label:`Off`,needsSignIn:!1};if(n)return{tone:`muted`,label:`Checking…`,needsSignIn:!1};if(e.transport.type===`http`&&e.transport.auth===`oauth`&&t?.auth===`signed-out`)return{tone:`warning`,label:`Needs sign-in`,needsSignIn:!0};let r=t?.health;switch(r?.status){case`connected`:return{tone:`success`,label:`Connected · ${r.toolCount} ${r.toolCount===1?`tool`:`tools`}`,needsSignIn:!1};case`needs-auth`:return{tone:`warning`,label:`Needs sign-in`,needsSignIn:!0};case`error`:return{tone:`error`,label:Le[r.category],detail:r.message,needsSignIn:!1};default:return t?.auth===`signed-in`?{tone:`success`,label:`Signed in`,needsSignIn:!1}:{tone:`muted`,label:`Not checked`,needsSignIn:!1}}}function ze(e){let t=e.transport;if(t.type===`http`)try{let e=new URL(t.url);return`Remote · ${e.host}${e.pathname===`/`?``:e.pathname}`}catch{return`Remote`}return[t.command,...t.args].join(` `)}var X=e(t(),1),Z=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Be=e=>typeof e==`string`&&e.trim()?e:void 0,Ve=e=>{if(e!==null)try{let t=JSON.parse(e);return Z(t)?t:void 0}catch{return}},He=e=>{let t=Be(e)?.replace(/^\.\//,``);if(t!==void 0&&t.toLowerCase().endsWith(`.svg`)&&!(t.startsWith(`/`)||t.split(/[\\/]/).includes(`..`)))return t};function Ue(e,t){let n=Ve(e),r=Ve(t),i=Z(r?.interface)?r.interface:void 0,a=n?.author??r?.author,o={displayName:Be(n?.displayName)??Be(i?.displayName),description:Be(n?.description)??Be(r?.description),publisher:Be(a)??(Z(a)?Be(a.name):void 0),iconPath:He(n?.icon)??He(i?.logo)??He(i?.composerIcon)};return Object.fromEntries(Object.entries(o).filter(([,e])=>e!==void 0))}function We(e){let t=Ve(e)?.userConfig;return Z(t)?Object.entries(t).map(([e,t])=>{let n=Z(t)?t:{},r=Be(n.description);return{key:e,title:Be(n.title)??e,...r===void 0?{}:{description:r},required:n.required===!0}}):[]}var Q=e(r(),1),Ge=e=>{let t=x(f(e));return t&&!t.truncated?t.contents:null};function Ke(e){let t=(0,Y.c)(48),{environmentId:n,plugin:r,enabled:a,disabled:o,onDetails:s,onToggle:c}=e,l;t[0]!==n||t[1]!==r.path?(l=ye(n,r.path,`.claude-plugin/plugin.json`),t[0]=n,t[1]=r.path,t[2]=l):l=t[2];let u=j(l),d;t[3]!==n||t[4]!==r.path?(d=ye(n,r.path,`.codex-plugin/plugin.json`),t[3]=n,t[4]=r.path,t[5]=d):d=t[5];let f=j(d),{displayName:p,description:m,publisher:_,iconPath:v}=Ue(Ge(u),Ge(f)),y=Ge(j(ye(n,r.path,v??null))),x=v&&y?.trimStart().startsWith(`<`)?`data:image/svg+xml;charset=utf-8,${encodeURIComponent(y)}`:null,S=ee(n),C;t[6]===x?C=t[7]:(C=(0,Q.jsx)(`span`,{"aria-hidden":!0,className:`flex size-10 shrink-0 items-center justify-center rounded-xl border border-border/60 bg-muted`,children:x?(0,Q.jsx)(`img`,{src:x,alt:``,className:`size-6 object-contain`}):(0,Q.jsx)(g,{className:`size-5 text-muted-foreground`})}),t[6]=x,t[7]=C);let w=p??r.name,T;t[8]===w?T=t[9]:(T=(0,Q.jsx)(`span`,{className:`break-words text-sm font-medium`,children:w}),t[8]=w,t[9]=T);let E;t[10]===_?E=t[11]:(E=_?(0,Q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:_}):null,t[10]=_,t[11]=E);let D;t[12]!==T||t[13]!==E?(D=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-2`,children:[T,E]}),t[12]=T,t[13]=E,t[14]=D):D=t[14];let O=m??`Local plugin`,k;t[15]===O?k=t[16]:(k=(0,Q.jsx)(`p`,{className:`break-words text-xs text-muted-foreground`,children:O}),t[15]=O,t[16]=k);let N;t[17]!==D||t[18]!==k?(N=(0,Q.jsxs)(`div`,{className:`grid min-w-0 flex-1 gap-1`,children:[D,k]}),t[17]=D,t[18]=k,t[19]=N):N=t[19];let F=`More for ${r.name}`,I;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,Q.jsx)(P,{"aria-hidden":!0}),t[20]=I):I=t[20];let L;t[21]===F?L=t[22]:(L=(0,Q.jsx)(J,{render:(0,Q.jsx)(M,{render:(0,Q.jsx)(b,{variant:`ghost`,size:`icon-sm`,"aria-label":F,children:I})})}),t[21]=F,t[22]=L);let R;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,Q.jsx)(te,{children:`Plugin actions`}),t[23]=R):R=t[23];let z;t[24]===L?z=t[25]:(z=(0,Q.jsxs)(ne,{children:[L,R]}),t[24]=L,t[25]=z);let B;t[26]!==n||t[27]!==S||t[28]!==r.path?(B=S.capabilities.canOpenDefault?(0,Q.jsx)(i,{onClick:()=>void S.activate(`open`,{environmentId:n,filePath:r.path,workspaceRoot:void 0}),children:`Open`}):null,t[26]=n,t[27]=S,t[28]=r.path,t[29]=B):B=t[29];let V;t[30]===s?V=t[31]:(V=(0,Q.jsx)(i,{onClick:s,children:`Details`}),t[30]=s,t[31]=V);let H;t[32]!==B||t[33]!==V?(H=(0,Q.jsxs)(A,{align:`end`,children:[B,V]}),t[32]=B,t[33]=V,t[34]=H):H=t[34];let U;t[35]!==z||t[36]!==H?(U=(0,Q.jsxs)(h,{children:[z,H]}),t[35]=z,t[36]=H,t[37]=U):U=t[37];let W=`Load ${r.name}`,G;t[38]!==o||t[39]!==a||t[40]!==c||t[41]!==W?(G=(0,Q.jsx)(Pe,{"aria-label":W,checked:a,disabled:o,onCheckedChange:c}),t[38]=o,t[39]=a,t[40]=c,t[41]=W,t[42]=G):G=t[42];let K;return t[43]!==N||t[44]!==U||t[45]!==G||t[46]!==C?(K=(0,Q.jsxs)(`li`,{className:`flex items-center gap-4 py-4`,children:[C,N,U,G]}),t[43]=N,t[44]=U,t[45]=G,t[46]=C,t[47]=K):K=t[47],K}var qe=[`Personal`,`Built-in`,`Project`,`Plugins`,`Other`];function Je(e){switch(q(e)){case`personal`:return`Personal`;case`system`:return`Built-in`;case`repo`:case`project`:return`Project`;case`app`:return`Plugins`;default:return`Other`}}var Ye=[[`codex`,`Codex`],[`claudeAgent`,`Claude`],[`cursor`,`Cursor`],[`grok`,`Grok`],[`antigravity`,`Antigravity`],[`opencode`,`OpenCode`],[`muse`,`Muse`],[`pi`,`Pi`]],Xe={remote:`Remote servers aren't supported by this provider`,"working-directory":`Servers with a working directory aren't supported here`,provider:`Not supported by this provider yet`};function Ze(e){return Ye.find(([t])=>t===e)?.[1]??e}function Qe(e){switch(e){case`signed-in`:return`Signed in`;case`signed-out`:return`Not signed in`;case`unavailable`:return`Add this server to the provider's own MCP config to sign in.`;case`unknown`:return`Sign-in status unknown`}}function $e(e,t){if(!w(e))return`unavailable`;let n=t.filter(t=>t.driver===e);if(n.some(e=>e.status===`signed-in`))return`signed-in`;if(n.some(e=>e.status===`signed-out`))return`needs-sign-in`}function et(e){return Ye.map(([t,n])=>{let r=o(t,e.transport),i=C.make(t);return{driver:i,label:n,enabled:r.supported&&!e.disabledProviders.includes(i),...r.supported?{}:{unsupported:Xe[r.reason]}}})}var tt={name:``,type:`stdio`,command:``,args:``,cwd:``,url:``,auth:`none`,values:[]};function nt(e){let t=e.transport;return t.type===`stdio`?{...tt,name:e.name,type:`stdio`,command:t.command,args:t.args.join(`
1
+ import{a as e,t}from"./react-DH3P2YXY.js";import{n,t as r}from"./jsx-runtime-BnjsACtP.js";import{$n as i,A_ as a,Ad as o,D_ as s,E_ as c,Eb as l,Jn as u,Jp as d,Lm as f,M_ as p,O_ as m,Os as h,Qp as g,Qw as _,T_ as v,Tp as y,Yn as b,Yp as x,bd as S,dr as C,j_ as w,k_ as T,l as E,lm as D,od as O,pm as k,rm as A,t as j,tE as M,tr as N,ts as P,ur as F}from"./utils-DhUt689t.js";import{n as I}from"./ChatMarkdown-D-cNSjFn.js";import{a as L,c as R,o as z,s as B,t as V}from"./select-D_zHR42Y.js";import{t as H}from"./useLocation-B_XV0lDx.js";import{p as U}from"./toast-DXWclCrr.js";import{C as W}from"./useSettings-gPlpTIWi.js";import{f as G}from"./server-6nKYyc8r.js";import{t as K}from"./use-atom-command-vqjL7n-x.js";import{s as q,u as ee}from"./providerSkills-4hnESoi_.js";import{a as J,n as te,t as ne}from"./tooltip-CY3W5y-f.js";import{t as re}from"./skeleton-BcLPbojY.js";import{t as ie}from"./textarea-DlXXDHPJ.js";import{n as ae,t as oe}from"./toggle-group-CYKsfBbD.js";import{t as se}from"./input-BYd74ook.js";import{c as ce,r as le,s as ue,t as de}from"./dialog-BRtKKGzk.js";import{i as fe,o as pe,r as me,t as he}from"./empty-rC3eYvxq.js";import{n as ge,r as _e,t as ve}from"./input-group-DMFlSk_7.js";import{a as ye}from"./projectFilesQueryState-0jxJ50Qq.js";import{F as be,V as xe,W as Se,a as Ce,i as we,s as Te}from"./settingsLayout-4ySvFdXb.js";import{Ar as Ee,Fr as De,Ir as Oe,Mr as ke,Nr as Ae,Pr as je,ir as Me,jr as Ne,va as Pe,vi as Fe}from"./main-VfCRP294.js";import{t as Ie}from"./SecretInput-CqAhFuNO.js";var Y=n(),Le={spawn:`Failed to start`,timeout:`Timed out`,protocol:`Not an MCP server`,http:`Can't connect`,auth:`Credentials rejected`};function Re(e,t,n){if(!e.enabled)return{tone:`muted`,label:`Off`,needsSignIn:!1};if(n)return{tone:`muted`,label:`Checking…`,needsSignIn:!1};if(e.transport.type===`http`&&e.transport.auth===`oauth`&&t?.auth===`signed-out`)return{tone:`warning`,label:`Needs sign-in`,needsSignIn:!0};let r=t?.health;switch(r?.status){case`connected`:return{tone:`success`,label:`Connected · ${r.toolCount} ${r.toolCount===1?`tool`:`tools`}`,needsSignIn:!1};case`needs-auth`:return{tone:`warning`,label:`Needs sign-in`,needsSignIn:!0};case`error`:return{tone:`error`,label:Le[r.category],detail:r.message,needsSignIn:!1};default:return t?.auth===`signed-in`?{tone:`success`,label:`Signed in`,needsSignIn:!1}:{tone:`muted`,label:`Not checked`,needsSignIn:!1}}}function ze(e){let t=e.transport;if(t.type===`http`)try{let e=new URL(t.url);return`Remote · ${e.host}${e.pathname===`/`?``:e.pathname}`}catch{return`Remote`}return[t.command,...t.args].join(` `)}var X=e(t(),1),Z=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Be=e=>typeof e==`string`&&e.trim()?e:void 0,Ve=e=>{if(e!==null)try{let t=JSON.parse(e);return Z(t)?t:void 0}catch{return}},He=e=>{let t=Be(e)?.replace(/^\.\//,``);if(t!==void 0&&t.toLowerCase().endsWith(`.svg`)&&!(t.startsWith(`/`)||t.split(/[\\/]/).includes(`..`)))return t};function Ue(e,t){let n=Ve(e),r=Ve(t),i=Z(r?.interface)?r.interface:void 0,a=n?.author??r?.author,o={displayName:Be(n?.displayName)??Be(i?.displayName),description:Be(n?.description)??Be(r?.description),publisher:Be(a)??(Z(a)?Be(a.name):void 0),iconPath:He(n?.icon)??He(i?.logo)??He(i?.composerIcon)};return Object.fromEntries(Object.entries(o).filter(([,e])=>e!==void 0))}function We(e){let t=Ve(e)?.userConfig;return Z(t)?Object.entries(t).map(([e,t])=>{let n=Z(t)?t:{},r=Be(n.description);return{key:e,title:Be(n.title)??e,...r===void 0?{}:{description:r},required:n.required===!0}}):[]}var Q=e(r(),1),Ge=e=>{let t=M(h(e));return t&&!t.truncated?t.contents:null};function Ke(e){let t=(0,Y.c)(48),{environmentId:n,plugin:r,enabled:a,disabled:o,onDetails:s,onToggle:c}=e,l;t[0]!==n||t[1]!==r.path?(l=ye(n,r.path,`.claude-plugin/plugin.json`),t[0]=n,t[1]=r.path,t[2]=l):l=t[2];let u=P(l),d;t[3]!==n||t[4]!==r.path?(d=ye(n,r.path,`.codex-plugin/plugin.json`),t[3]=n,t[4]=r.path,t[5]=d):d=t[5];let f=P(d),{displayName:p,description:m,publisher:h,iconPath:_}=Ue(Ge(u),Ge(f)),v=Ge(P(ye(n,r.path,_??null))),x=_&&v?.trimStart().startsWith(`<`)?`data:image/svg+xml;charset=utf-8,${encodeURIComponent(v)}`:null,S=ee(n),w;t[6]===x?w=t[7]:(w=(0,Q.jsx)(`span`,{"aria-hidden":!0,className:`flex size-10 shrink-0 items-center justify-center rounded-xl border border-border/60 bg-muted`,children:x?(0,Q.jsx)(`img`,{src:x,alt:``,className:`size-6 object-contain`}):(0,Q.jsx)(g,{className:`size-5 text-muted-foreground`})}),t[6]=x,t[7]=w);let T=p??r.name,E;t[8]===T?E=t[9]:(E=(0,Q.jsx)(`span`,{className:`break-words text-sm font-medium`,children:T}),t[8]=T,t[9]=E);let D;t[10]===h?D=t[11]:(D=h?(0,Q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:h}):null,t[10]=h,t[11]=D);let O;t[12]!==E||t[13]!==D?(O=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-2`,children:[E,D]}),t[12]=E,t[13]=D,t[14]=O):O=t[14];let k=m??`Local plugin`,A;t[15]===k?A=t[16]:(A=(0,Q.jsx)(`p`,{className:`break-words text-xs text-muted-foreground`,children:k}),t[15]=k,t[16]=A);let j;t[17]!==O||t[18]!==A?(j=(0,Q.jsxs)(`div`,{className:`grid min-w-0 flex-1 gap-1`,children:[O,A]}),t[17]=O,t[18]=A,t[19]=j):j=t[19];let M=`More for ${r.name}`,I;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,Q.jsx)(y,{"aria-hidden":!0}),t[20]=I):I=t[20];let L;t[21]===M?L=t[22]:(L=(0,Q.jsx)(J,{render:(0,Q.jsx)(F,{render:(0,Q.jsx)(C,{variant:`ghost`,size:`icon-sm`,"aria-label":M,children:I})})}),t[21]=M,t[22]=L);let R;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,Q.jsx)(te,{children:`Plugin actions`}),t[23]=R):R=t[23];let z;t[24]===L?z=t[25]:(z=(0,Q.jsxs)(ne,{children:[L,R]}),t[24]=L,t[25]=z);let B;t[26]!==n||t[27]!==S||t[28]!==r.path?(B=S.capabilities.canOpenDefault?(0,Q.jsx)(i,{onClick:()=>void S.activate(`open`,{environmentId:n,filePath:r.path,workspaceRoot:void 0}),children:`Open`}):null,t[26]=n,t[27]=S,t[28]=r.path,t[29]=B):B=t[29];let V;t[30]===s?V=t[31]:(V=(0,Q.jsx)(i,{onClick:s,children:`Details`}),t[30]=s,t[31]=V);let H;t[32]!==B||t[33]!==V?(H=(0,Q.jsxs)(N,{align:`end`,children:[B,V]}),t[32]=B,t[33]=V,t[34]=H):H=t[34];let U;t[35]!==z||t[36]!==H?(U=(0,Q.jsxs)(b,{children:[z,H]}),t[35]=z,t[36]=H,t[37]=U):U=t[37];let W=`Load ${r.name}`,G;t[38]!==o||t[39]!==a||t[40]!==c||t[41]!==W?(G=(0,Q.jsx)(Pe,{"aria-label":W,checked:a,disabled:o,onCheckedChange:c}),t[38]=o,t[39]=a,t[40]=c,t[41]=W,t[42]=G):G=t[42];let K;return t[43]!==j||t[44]!==U||t[45]!==G||t[46]!==w?(K=(0,Q.jsxs)(`li`,{className:`flex items-center gap-4 py-4`,children:[w,j,U,G]}),t[43]=j,t[44]=U,t[45]=G,t[46]=w,t[47]=K):K=t[47],K}var qe=[`Personal`,`Built-in`,`Project`,`Plugins`,`Other`];function Je(e){switch(q(e)){case`personal`:return`Personal`;case`system`:return`Built-in`;case`repo`:case`project`:return`Project`;case`app`:return`Plugins`;default:return`Other`}}var Ye=[[`codex`,`Codex`],[`claudeAgent`,`Claude`],[`cursor`,`Cursor`],[`grok`,`Grok`],[`antigravity`,`Antigravity`],[`opencode`,`OpenCode`],[`muse`,`Muse`],[`pi`,`Pi`]],Xe={remote:`Remote servers aren't supported by this provider`,"working-directory":`Servers with a working directory aren't supported here`,provider:`Not supported by this provider yet`};function Ze(e){return Ye.find(([t])=>t===e)?.[1]??e}function Qe(e){switch(e){case`signed-in`:return`Signed in`;case`signed-out`:return`Not signed in`;case`unavailable`:return`Add this server to the provider's own MCP config to sign in.`;case`unknown`:return`Sign-in status unknown`}}function $e(e,t){if(!a(e))return`unavailable`;let n=t.filter(t=>t.driver===e);if(n.some(e=>e.status===`signed-in`))return`signed-in`;if(n.some(e=>e.status===`signed-out`))return`needs-sign-in`}function et(e){return Ye.map(([t,n])=>{let r=m(t,e.transport),i=p.make(t);return{driver:i,label:n,enabled:r.supported&&!e.disabledProviders.includes(i),...r.supported?{}:{unsupported:Xe[r.reason]}}})}var tt={name:``,type:`stdio`,command:``,args:``,cwd:``,url:``,auth:`none`,values:[]};function nt(e){let t=e.transport;return t.type===`stdio`?{...tt,name:e.name,type:`stdio`,command:t.command,args:t.args.join(`
2
2
  `),cwd:t.cwd??``,values:Object.entries(t.env).map(([e,t])=>({key:e,value:t}))}:{...tt,name:e.name,type:`http`,url:t.url,auth:t.auth,values:Object.entries(t.headers).map(([e,t])=>({key:e,value:t}))}}var rt=/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/;function it(e,t){let n=e.name.trim();if(!n)return`Enter a name.`;if(!rt.test(n)||n.length>64)return`Use letters, numbers, dashes, and underscores.`;if(n===`p4-code`)return`That name belongs to P4 Code's own server.`;if(t.has(n))return`Another server already uses that name.`;if(e.type===`stdio`&&!e.command.trim())return`Enter the command that starts it.`;if(e.type===`http`&&!/^https?:\/\/\S+$/i.test(e.url.trim()))return`Enter an http or https URL.`}function at(e,t){let n=Object.fromEntries(e.values.map(e=>[e.key.trim(),e.value]).filter(([e])=>e.length>0)),r=e.type===`stdio`?{type:`stdio`,command:e.command.trim(),args:e.args.split(`
3
- `).map(e=>e.trim()).filter(e=>e.length>0),env:n,...e.cwd.trim()?{cwd:e.cwd.trim()}:{}}:{type:`http`,url:e.url.trim(),headers:n,auth:e.auth};return{name:e.name.trim(),enabled:t?.enabled??!0,transport:r,disabledProviders:t?.disabledProviders??[],...t?.source===void 0?{}:{source:t.source}}}function ot(e){let t=new Map;for(let n of e){let e=n.displayName??n.driver;for(let r of n.skills){let n=`${r.scope??``}\u0000${r.name}`,i=t.get(n);i===void 0?t.set(n,{skill:r,providers:[e]}):i.providers.includes(e)||i.providers.push(e)}}return[...t.values()].toSorted((e,t)=>st(e.skill).localeCompare(st(t.skill)))}var st=e=>e.displayName??e.name.split(/[-_\s]+/).filter(e=>e.length>0).map(e=>e[0].toUpperCase()+e.slice(1)).join(` `);function ct(e){switch(e){case void 0:return;case`user`:return`Personal`;case`project`:case`repo`:return`Project`;case`system`:return`Built-in`;default:return e[0].toUpperCase()+e.slice(1)}}function lt(e){let t=/^---\r?\n[\s\S]*?\r?\n---\r?\n?/.exec(e);return(t===null?e:e.slice(t[0].length)).trimStart()}function ut(e){let t=(0,Y.c)(14),{title:n,onBack:r,onUninstall:i,children:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Q.jsx)(v,{"aria-hidden":!0}),t[0]=o):o=t[0];let s;t[1]===r?s=t[2]:(s=(0,Q.jsxs)(b,{size:`xs`,variant:`ghost`,className:`w-fit`,onClick:r,children:[o,`Back`]}),t[1]=r,t[2]=s);let l;t[3]===n?l=t[4]:(l=(0,Q.jsx)(`h2`,{className:`min-w-0 truncate text-xl font-semibold text-foreground`,children:n}),t[3]=n,t[4]=l);let u;t[5]===i?u=t[6]:(u=i?(0,Q.jsxs)(b,{size:`sm`,variant:`destructive-outline`,onClick:i,children:[(0,Q.jsx)(c,{"aria-hidden":!0}),`Uninstall`]}):null,t[5]=i,t[6]=u);let d;t[7]!==l||t[8]!==u?(d=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[l,u]}),t[7]=l,t[8]=u,t[9]=d):d=t[9];let f;return t[10]!==a||t[11]!==s||t[12]!==d?(f=(0,Q.jsxs)(`div`,{className:`grid gap-6`,children:[s,d,a]}),t[10]=a,t[11]=s,t[12]=d,t[13]=f):f=t[13],f}function $(e){let t=(0,Y.c)(6),{label:n,htmlFor:r,children:i}=e,a;t[0]!==r||t[1]!==n?(a=(0,Q.jsx)(Fe,{htmlFor:r,children:n}),t[0]=r,t[1]=n,t[2]=a):a=t[2];let o;return t[3]!==i||t[4]!==a?(o=(0,Q.jsxs)(`div`,{className:`grid gap-2 px-4 py-4`,children:[a,i]}),t[3]=i,t[4]=a,t[5]=o):o=t[5],o}function dt(e){let t=(0,Y.c)(69),{server:n,takenNames:r,onSave:i}=e,a;t[0]===n?a=t[1]:(a=n===void 0?tt:nt(n),t[0]=n,t[1]=a);let o=a,[s,l]=(0,X.useState)(o),d;t[2]===o?d=t[3]:(d=JSON.stringify(o),t[2]=o,t[3]=d);let f=d,[p,m]=(0,X.useState)(f);f!==p&&(m(f),l(o));let h;t[4]!==s||t[5]!==r?(h=it(s,r),t[4]=s,t[5]=r,t[6]=h):h=t[6];let g=h,_;t[7]===s?_=t[8]:(_=JSON.stringify(s),t[7]=s,t[8]=_);let v=_!==f,y;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>l(t=>({...t,...e})),t[9]=y):y=t[9];let x=y,S=s.type===`stdio`?`Environment variables`:`Headers`,C;t[10]===s.values?C=t[11]:(C=(e,t)=>x({values:s.values.map((n,r)=>r===e?{...n,...t}:n)}),t[10]=s.values,t[11]=C);let w=C,T;t[12]!==v||t[13]!==s||t[14]!==i||t[15]!==g||t[16]!==n?(T=e=>{e.preventDefault(),v&&g===void 0&&i(at(s,n))},t[12]=v,t[13]=s,t[14]=i,t[15]=g,t[16]=n,t[17]=T):T=t[17];let E;t[18]===n?E=t[19]:(E=n===void 0?null:(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`To switch between a command and a URL, uninstall the server and add it again.`}),t[18]=n,t[19]=E);let D;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(D=e=>x({name:e.target.value}),t[20]=D):D=t[20];let O;t[21]===s.name?O=t[22]:(O=(0,Q.jsx)($,{label:`Name`,htmlFor:`mcp-server-name`,children:(0,Q.jsx)(se,{id:`mcp-server-name`,placeholder:`github`,value:s.name,onChange:D})}),t[21]=s.name,t[22]=O);let k;t[23]!==s.type||t[24]!==n?(k=n===void 0?(0,Q.jsx)($,{label:`Type`,children:(0,Q.jsxs)(ae,{"aria-label":`How P4 Code reaches the server`,value:[s.type],onValueChange:e=>{let t=e[0];(t===`stdio`||t===`http`)&&x({type:t,values:[]})},children:[(0,Q.jsx)(oe,{value:`stdio`,children:`Command`}),(0,Q.jsx)(oe,{value:`http`,children:`URL`})]})}):null,t[23]=s.type,t[24]=n,t[25]=k):k=t[25];let A;t[26]!==s.args||t[27]!==s.auth||t[28]!==s.command||t[29]!==s.cwd||t[30]!==s.type||t[31]!==s.url?(A=s.type===`stdio`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)($,{label:`Command`,htmlFor:`mcp-server-command`,children:(0,Q.jsx)(se,{id:`mcp-server-command`,placeholder:`npx`,value:s.command,onChange:e=>x({command:e.target.value})})}),(0,Q.jsx)($,{label:`Arguments, one per line`,htmlFor:`mcp-server-args`,children:(0,Q.jsx)(ie,{id:`mcp-server-args`,placeholder:`-y
4
- @modelcontextprotocol/server-postgres`,value:s.args,onChange:e=>x({args:e.target.value})})}),(0,Q.jsx)($,{label:`Working directory (optional)`,htmlFor:`mcp-server-cwd`,children:(0,Q.jsx)(se,{id:`mcp-server-cwd`,placeholder:`The session's project folder`,value:s.cwd,onChange:e=>x({cwd:e.target.value})})})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)($,{label:`URL`,htmlFor:`mcp-server-url`,children:(0,Q.jsx)(se,{id:`mcp-server-url`,placeholder:`https://mcp.example.com/mcp`,value:s.url,onChange:e=>x({url:e.target.value})})}),(0,Q.jsx)($,{label:`Authentication`,children:(0,Q.jsxs)(V,{value:s.auth,onValueChange:e=>{(e===`none`||e===`oauth`)&&x({auth:e})},children:[(0,Q.jsx)(B,{"aria-label":`Authentication`,children:(0,Q.jsx)(R,{children:ft})}),(0,Q.jsxs)(z,{alignItemWithTrigger:!1,children:[(0,Q.jsx)(L,{value:`none`,children:`None or headers`}),(0,Q.jsx)(L,{value:`oauth`,children:`OAuth (sign in after saving)`})]})]})})]}),t[26]=s.args,t[27]=s.auth,t[28]=s.command,t[29]=s.cwd,t[30]=s.type,t[31]=s.url,t[32]=A):A=t[32];let j;t[33]!==s.type||t[34]!==s.values||t[35]!==w||t[36]!==S?(j=s.values.map((e,t)=>(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(se,{"aria-label":`${S} name`,placeholder:s.type===`stdio`?`API_TOKEN`:`Authorization`,value:e.key,onChange:e=>w(t,{key:e.target.value})}),(0,Q.jsx)(Ie,{"aria-label":`${S} value`,placeholder:`Value`,value:e.value,onChange:e=>w(t,{value:e.target.value})}),(0,Q.jsx)(b,{size:`icon-sm`,variant:`ghost`,"aria-label":`Remove ${e.key||`row`}`,onClick:()=>x({values:s.values.filter((e,n)=>n!==t)}),children:(0,Q.jsx)(c,{"aria-hidden":!0})})]},t)),t[33]=s.type,t[34]=s.values,t[35]=w,t[36]=S,t[37]=j):j=t[37];let M;t[38]===s.values?M=t[39]:(M=()=>x({values:[...s.values,{key:``,value:``}]}),t[38]=s.values,t[39]=M);let N;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Q.jsx)(u,{"aria-hidden":!0}),t[40]=N):N=t[40];let P=s.type===`stdio`?`variable`:`header`,F;t[41]!==M||t[42]!==P?(F=(0,Q.jsxs)(b,{variant:`soft`,onClick:M,children:[N,`Add `,P]}),t[41]=M,t[42]=P,t[43]=F):F=t[43];let I;t[44]!==j||t[45]!==F?(I=(0,Q.jsxs)(`div`,{className:`grid gap-2`,children:[j,F]}),t[44]=j,t[45]=F,t[46]=I):I=t[46];let H;t[47]!==I||t[48]!==S?(H=(0,Q.jsx)($,{label:S,children:I}),t[47]=I,t[48]=S,t[49]=H):H=t[49];let U;t[50]!==O||t[51]!==k||t[52]!==A||t[53]!==H?(U=(0,Q.jsxs)(Se,{children:[O,k,A,H]}),t[50]=O,t[51]=k,t[52]=A,t[53]=H,t[54]=U):U=t[54];let W;t[55]!==v||t[56]!==g?(W=v&&g!==void 0?(0,Q.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive-foreground`,children:g}):null,t[55]=v,t[56]=g,t[57]=W):W=t[57];let G=!v||g!==void 0,K=n===void 0?`Add server`:`Save`,q;t[58]!==G||t[59]!==K?(q=(0,Q.jsx)(b,{type:`submit`,disabled:G,children:K}),t[58]=G,t[59]=K,t[60]=q):q=t[60];let ee;t[61]!==W||t[62]!==q?(ee=(0,Q.jsxs)(`div`,{className:`flex items-center justify-end gap-3`,children:[W,q]}),t[61]=W,t[62]=q,t[63]=ee):ee=t[63];let J;return t[64]!==U||t[65]!==ee||t[66]!==T||t[67]!==E?(J=(0,Q.jsxs)(`form`,{className:`grid gap-3`,onSubmit:T,children:[E,U,ee]}),t[64]=U,t[65]=ee,t[66]=T,t[67]=E,t[68]=J):J=t[68],J}function ft(e){return e===`oauth`?`OAuth (sign in after saving)`:`None or headers`}function pt(e){let t=(0,Y.c)(55),{environmentId:n,plugin:r,environmentLabel:i,onSave:a}=e,o=r?.path??``,s=r===void 0?null:`.claude-plugin/plugin.json`,c;t[0]!==n||t[1]!==o||t[2]!==s?(c=ye(n,o,s),t[0]=n,t[1]=o,t[2]=s,t[3]=c):c=t[3];let l=x(f(j(c))),u=We(r!==void 0&&l!==null&&!l.truncated?l.contents:null),d;t[4]===r?.options?d=t[5]:(d=r?.options??{},t[4]=r?.options,t[5]=d);let p=d,m=[...u,...Object.keys(p).filter(e=>!u.some(t=>t.key===e)).map(ht)],[h,g]=(0,X.useState)(r?.name??``),[_,v]=(0,X.useState)(r?.path??``),[y,S]=(0,X.useState)(p),C;t[6]!==r?.name||t[7]!==r?.path||t[8]!==p?(C=JSON.stringify([r?.name??``,r?.path??``,p]),t[6]=r?.name,t[7]=r?.path,t[8]=p,t[9]=C):C=t[9];let w=C,[T,E]=(0,X.useState)(w);w!==T&&(E(w),g(r?.name??``),v(r?.path??``),S(p));let D,O;t[10]!==h||t[11]!==y||t[12]!==_||t[13]!==r?.name||t[14]!==r?.path||t[15]!==p?(D=Object.fromEntries(Object.entries(y).filter(mt)),O=h!==(r?.name??``)||_!==(r?.path??``)||JSON.stringify(D)!==JSON.stringify(p),t[10]=h,t[11]=y,t[12]=_,t[13]=r?.name,t[14]=r?.path,t[15]=p,t[16]=D,t[17]=O):(D=t[16],O=t[17]);let k=O,A;t[18]!==h||t[19]!==_?(A=h.trim().length>0&&_.trim().startsWith(`/`),t[18]=h,t[19]=_,t[20]=A):A=t[20];let M=A,N;t[21]!==k||t[22]!==h||t[23]!==D||t[24]!==a||t[25]!==_||t[26]!==r?.enabled||t[27]!==M?(N=e=>{e.preventDefault(),k&&M&&a({name:h.trim(),path:_.trim(),enabled:r?.enabled??!0,options:D})},t[21]=k,t[22]=h,t[23]=D,t[24]=a,t[25]=_,t[26]=r?.enabled,t[27]=M,t[28]=N):N=t[28];let P;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(P=e=>g(e.target.value),t[29]=P):P=t[29];let F;t[30]===h?F=t[31]:(F=(0,Q.jsx)($,{label:`Name`,htmlFor:`plugin-name`,children:(0,Q.jsx)(se,{id:`plugin-name`,value:h,onChange:P})}),t[30]=h,t[31]=F);let I=`Folder on ${i}`,L;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(L=e=>v(e.target.value),t[32]=L):L=t[32];let R;t[33]===_?R=t[34]:(R=(0,Q.jsx)(se,{id:`plugin-path`,placeholder:`/Users/me/plugins/my-plugin`,value:_,onChange:L}),t[33]=_,t[34]=R);let z;t[35]!==I||t[36]!==R?(z=(0,Q.jsx)($,{label:I,htmlFor:`plugin-path`,children:R}),t[35]=I,t[36]=R,t[37]=z):z=t[37];let B=m.map(e=>(0,Q.jsx)($,{label:e.required?e.title:`${e.title} (optional)`,htmlFor:`plugin-option-${e.key}`,children:(0,Q.jsx)(Ie,{id:`plugin-option-${e.key}`,placeholder:`description`in e?e.description:void 0,value:y[e.key]??``,onChange:t=>S(n=>({...n,[e.key]:t.target.value}))})},e.key)),V;t[38]!==F||t[39]!==z||t[40]!==B?(V=(0,Q.jsxs)(Se,{children:[F,z,B]}),t[38]=F,t[39]=z,t[40]=B,t[41]=V):V=t[41];let H;t[42]!==k||t[43]!==M?(H=k&&!M?(0,Q.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive-foreground`,children:`Enter a name and the plugin folder's full path.`}):null,t[42]=k,t[43]=M,t[44]=H):H=t[44];let U=!k||!M,W=r===void 0?`Add plugin`:`Save`,G;t[45]!==U||t[46]!==W?(G=(0,Q.jsx)(b,{type:`submit`,disabled:U,children:W}),t[45]=U,t[46]=W,t[47]=G):G=t[47];let K;t[48]!==H||t[49]!==G?(K=(0,Q.jsxs)(`div`,{className:`flex items-center justify-end gap-3`,children:[H,G]}),t[48]=H,t[49]=G,t[50]=K):K=t[50];let q;return t[51]!==V||t[52]!==K||t[53]!==N?(q=(0,Q.jsxs)(`form`,{className:`grid gap-3`,onSubmit:N,children:[V,K]}),t[51]=V,t[52]=K,t[53]=N,t[54]=q):q=t[54],q}function mt(e){let[,t]=e;return t}function ht(e){return{key:e,title:e,required:!1}}var gt=e=>e.replace(/[\\/][^\\/]*$/,``)||`/`;function _t(e){let t=(0,Y.c)(69),{entry:n,environmentId:r,onClose:a}=e,{skill:o,providers:s}=n,c,l,u;t[0]!==r||t[1]!==o.path?(c=gt(o.path),l=j,u=ye(r,c,o.path),t[0]=r,t[1]=o.path,t[2]=c,t[3]=l,t[4]=u):(c=t[2],l=t[3],u=t[4]);let d=l(u),p;t[5]===d?p=t[6]:(p=x(f(d)),t[5]=d,t[6]=p);let m=p,g=ee(r),{copyToClipboard:_}=U(),v;t[7]!==r||t[8]!==o.path?(v={environmentId:r,filePath:o.path,workspaceRoot:void 0},t[7]=r,t[8]=o.path,t[9]=v):v=t[9];let y=v,S=o.shortDescription??o.description,C;t[10]===o.scope?C=t[11]:(C=ct(o.scope),t[10]=o.scope,t[11]=C);let w=C,T;t[12]===a?T=t[13]:(T=e=>!e&&a(),t[12]=a,t[13]=T);let E;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,Q.jsx)(`span`,{"aria-hidden":!0,className:`flex size-12 shrink-0 items-center justify-center rounded-full border border-border/60 text-muted-foreground`,children:(0,Q.jsx)(F,{className:`size-5`})}),t[14]=E):E=t[14];let D;t[15]===o?D=t[16]:(D=st(o),t[15]=o,t[16]=D);let O=`More for ${D}`,k;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,Q.jsx)(P,{"aria-hidden":!0}),t[17]=k):k=t[17];let N;t[18]===O?N=t[19]:(N=(0,Q.jsx)(M,{render:(0,Q.jsx)(b,{size:`icon-sm`,variant:`ghost`,"aria-label":O,children:k})}),t[18]=O,t[19]=N);let L;t[20]!==g||t[21]!==y?(L=g.capabilities.canOpenDefault?(0,Q.jsx)(i,{onClick:()=>void g.activate(`open`,y),children:`Open`}):null,t[20]=g,t[21]=y,t[22]=L):L=t[22];let R;t[23]!==g||t[24]!==y?(R=g.capabilities.revealLabel?(0,Q.jsx)(i,{onClick:()=>void g.activate(`reveal-in-folder`,y),children:g.capabilities.revealLabel}):null,t[23]=g,t[24]=y,t[25]=R):R=t[25];let z=m===null,B;t[26]!==_||t[27]!==m?(B=()=>m&&_(m.contents,void 0),t[26]=_,t[27]=m,t[28]=B):B=t[28];let V;t[29]!==z||t[30]!==B?(V=(0,Q.jsx)(i,{disabled:z,onClick:B,children:`Copy Markdown`}),t[29]=z,t[30]=B,t[31]=V):V=t[31];let H;t[32]!==L||t[33]!==R||t[34]!==V?(H=(0,Q.jsxs)(A,{align:`end`,children:[L,R,V]}),t[32]=L,t[33]=R,t[34]=V,t[35]=H):H=t[35];let W;t[36]!==N||t[37]!==H?(W=(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-3 pe-8`,children:[E,(0,Q.jsxs)(h,{children:[N,H]})]}),t[36]=N,t[37]=H,t[38]=W):W=t[38];let G;t[39]===o?G=t[40]:(G=st(o),t[39]=o,t[40]=G);let K;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,Q.jsx)(`span`,{className:`font-normal text-muted-foreground`,children:`Skill`}),t[41]=K):K=t[41];let q;t[42]===G?q=t[43]:(q=(0,Q.jsxs)(ce,{children:[G,` `,K]}),t[42]=G,t[43]=q);let J;t[44]===S?J=t[45]:(J=S?(0,Q.jsx)(le,{children:S}):null,t[44]=S,t[45]=J);let te;t[46]!==q||t[47]!==J?(te=(0,Q.jsxs)(`div`,{className:`grid gap-1.5`,children:[q,J]}),t[46]=q,t[47]=J,t[48]=te):te=t[48];let ne;t[49]!==c||t[50]!==r||t[51]!==m||t[52]!==d?(ne=(0,Q.jsx)(`div`,{className:`max-h-[50vh] min-h-24 overflow-y-auto rounded-xl border border-border/60 bg-card/40 px-5 py-4`,children:m===null?d._tag===`Failure`?(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This skill's file could not be read. It may have moved since the provider last scanned it.`}):(0,Q.jsxs)(`div`,{className:`grid gap-2`,children:[(0,Q.jsx)(re,{className:`h-4 w-3/4`}),(0,Q.jsx)(re,{className:`h-4 w-full`}),(0,Q.jsx)(re,{className:`h-4 w-2/3`})]}):(0,Q.jsx)(I,{text:lt(m.contents),cwd:c,environmentId:r})}),t[49]=c,t[50]=r,t[51]=m,t[52]=d,t[53]=ne):ne=t[53];let ie;t[54]===s?ie=t[55]:(ie=s.join(`, `),t[54]=s,t[55]=ie);let ae=`Loaded by ${ie}`,oe;t[56]!==w||t[57]!==ae?(oe=[w,ae].filter(Boolean),t[56]=w,t[57]=ae,t[58]=oe):oe=t[58];let se=oe.join(` · `),fe;t[59]===se?fe=t[60]:(fe=(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:se}),t[59]=se,t[60]=fe);let pe;t[61]!==W||t[62]!==te||t[63]!==ne||t[64]!==fe?(pe=(0,Q.jsx)(ue,{className:`max-w-2xl`,children:(0,Q.jsxs)(`div`,{className:`grid min-h-0 gap-4 p-6`,children:[W,te,ne,fe]})}),t[61]=W,t[62]=te,t[63]=ne,t[64]=fe,t[65]=pe):pe=t[65];let me;return t[66]!==pe||t[67]!==T?(me=(0,Q.jsx)(de,{open:!0,onOpenChange:T,children:pe}),t[66]=pe,t[67]=T,t[68]=me):me=t[68],me}var vt={claude:`Claude`,codex:`Codex`,cursor:`Cursor`},yt={success:`bg-success`,warning:`bg-warning`,error:`bg-destructive`,muted:`bg-muted-foreground/40`},bt={success:`text-success-foreground`,warning:`text-warning-foreground`,error:`text-destructive-foreground`,muted:`text-muted-foreground`},xt=m(N);function St(e){let t=_(e);return xt(t)&&t.reason===`rejected`?`This server only lets apps it has approved sign in, and it refused P4 Code. Sign in with a provider below instead.`:`Sign-in could not start. Check the server URL, then try again.`}function Ct(e,t,n){return e.transport.type===`http`&&(e.transport.auth===`oauth`||n?.auth===`signed-in`||t.needsSignIn)}function wt(e){let t=(0,Y.c)(13),{status:n,className:r}=e,i=bt[n.tone],a;t[0]!==r||t[1]!==i?(a=k(`flex min-w-0 items-center gap-1.5 text-xs`,i,r),t[0]=r,t[1]=i,t[2]=a):a=t[2];let o=yt[n.tone],s;t[3]===o?s=t[4]:(s=k(`size-1.5 shrink-0 rounded-full`,o),t[3]=o,t[4]=s);let c;t[5]===s?c=t[6]:(c=(0,Q.jsx)(`span`,{"aria-hidden":!0,className:s}),t[5]=s,t[6]=c);let l;t[7]===n.label?l=t[8]:(l=(0,Q.jsx)(`span`,{className:`truncate`,children:n.label}),t[7]=n.label,t[8]=l);let u;return t[9]!==a||t[10]!==c||t[11]!==l?(u=(0,Q.jsxs)(`span`,{className:a,children:[c,l]}),t[9]=a,t[10]=c,t[11]=l,t[12]=u):u=t[12],u}function Tt(){let e=(0,Y.c)(6),{environment:t,scope:n}=xe(),r=t?.connection.phase===`connected`&&t.serverConfig!==null,i=r?t.environmentId:null,a=r&&t.serverConfig?.environment.capabilities.mcpRegistry===!0,o;return e[0]!==r||e[1]!==t||e[2]!==i||e[3]!==n||e[4]!==a?(o=(0,Q.jsx)(we,{width:`wide`,children:t===null||!r?(0,Q.jsx)(he,{children:(0,Q.jsxs)(fe,{children:[(0,Q.jsx)(pe,{children:`Connect to manage plugins and MCP servers`}),(0,Q.jsx)(me,{children:`They live on each environment. Choose a connected one above.`})]})}):!a||i===null?(0,Q.jsx)(he,{children:(0,Q.jsxs)(fe,{children:[(0,Q.jsxs)(pe,{children:[`Update `,t.label,` to manage plugins and MCP servers`]}),(0,Q.jsx)(me,{children:`This environment runs a version without them.`})]})}):(0,Q.jsx)(kt,{environmentId:i,environmentLabel:t.label,projectId:n.kind===`checkout`?n.checkout.id:n.kind===`project`?n.members.find(e=>e.environmentId===i)?.id:void 0,projectLabel:n.kind===`project`||n.kind===`checkout`?n.label:void 0},i)}),e[0]=r,e[1]=t,e[2]=i,e[3]=n,e[4]=a,e[5]=o):o=e[5],o}var Et={plugins:`Search plugins`,mcps:`Search MCP servers`,skills:`Search skills`},Dt=(e,...t)=>e===``||t.some(t=>t.toLowerCase().includes(e));function Ot(e){let t=(0,Y.c)(9),{text:n}=e,r=(0,X.useRef)(null),[i,a]=(0,X.useState)(!1),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=e=>{let t=r.current;a(e&&t!==null&&t.scrollWidth>t.clientWidth)},t[0]=o):o=t[0];let s;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Q.jsx)(`span`,{ref:r,tabIndex:0,className:`block truncate text-xs text-muted-foreground`}),t[1]=s):s=t[1];let c,l;t[2]===n?(c=t[3],l=t[4]):(c=(0,Q.jsx)(J,{render:s,children:n}),l=(0,Q.jsx)(te,{children:n}),t[2]=n,t[3]=c,t[4]=l);let u;return t[5]!==i||t[6]!==c||t[7]!==l?(u=(0,Q.jsxs)(ne,{open:i,onOpenChange:o,children:[c,l]}),t[5]=i,t[6]=c,t[7]=l,t[8]=u):u=t[8],u}function kt({environmentId:e,environmentLabel:t,projectId:n,projectLabel:r}){let o=H({select:e=>e.hash}),[c,l]=(0,X.useState)(()=>o.replace(/^#/,``)===`mcp-servers`?`mcps`:o.replace(/^#/,``)===`skills`?`skills`:`plugins`),[u,f]=(0,X.useState)(``),[m,_]=(0,X.useState)(`All categories`),v=j(G.configValueAtom(e))?.providers,x=(0,X.useMemo)(()=>ot(v??[]),[v]),[C,w]=(0,X.useState)(null),k=be(e=>e.mcpServers),N=be(e=>e.plugins),I=be(e=>e.projectSettingsOverrides),U=be(e=>e.skillOverrides),q=ee(e),re=j(G.updateSettings.permissionAtom(e)),[ie,se]=(0,X.useState)(null),ce=j(G.mcpRegistryTest.permissionAtom(e)),le=W(e),ue=K(G.updateSettings,{label:`update MCP registry`,reportFailure:!0}),de=K(G.mcpRegistryState,{reportFailure:!1}),fe=K(G.mcpRegistryTest,{label:`check MCP server`,reportFailure:!0}),pe=K(G.mcpRegistryOAuthStart,{label:`start MCP sign-in`,reportFailure:!0}),me=K(G.mcpRegistryOAuthSignOut,{label:`sign out of MCP server`,reportFailure:!0}),he=K(G.mcpRegistryDiscover,{reportFailure:!1}),ye=K(G.mcpRegistryImport,{label:`import MCP servers`,reportFailure:!0}),[xe,Se]=(0,X.useState)({}),[Ce,we]=(0,X.useState)(new Set),[Fe,Ie]=(0,X.useState)([]),[Y,Le]=(0,X.useState)({kind:`list`}),Z=Y.kind!==`list`&&Y.id!==null&&(Y.kind===`server`?k[Y.id]===void 0:N[Y.id]===void 0)?{kind:`list`}:Y,[Be,Ve]=(0,X.useState)(o);if(o!==Be){Ve(o);let e=o.replace(/^#/,``);(e===`mcp-servers`||e===`plugins`||e===`skills`)&&(l(e===`mcp-servers`?`mcps`:e),Le({kind:`list`}))}let[He,Ue]=(0,X.useState)(null),We=(0,X.useRef)(new Map),[Ge,Ye]=(0,X.useState)(null),[Xe,Ze]=(0,X.useState)({}),Qe=(0,X.useMemo)(()=>Object.entries(k).map(([e,t])=>[p.make(e),t]).toSorted(([,e],[,t])=>e.name.localeCompare(t.name)),[k]),$e=(0,X.useMemo)(()=>Object.entries(N).map(([e,t])=>[s.make(e),t]),[N]),et=(0,X.useCallback)(async()=>{let t=await de({environmentId:e,input:{}});t._tag===`Success`&&Se(t.value.servers)},[e,de]),tt=(0,X.useCallback)(async()=>{if(!ce)return;let t=await he({environmentId:e,input:n===void 0?{}:{projectId:n}});t._tag===`Success`&&Ie(t.value.servers)},[ce,he,e,n]);(0,X.useEffect)(()=>{et(),tt()},[et,tt]);let nt=e=>{l(`mcps`),Le({kind:`server`,id:e})},rt=e=>{l(`plugins`),Le({kind:`plugin`,id:e})},it=t=>ue({environmentId:e,input:{patch:t}}),at=async t=>{we(e=>new Set(e).add(t));let n=await fe({environmentId:e,input:{serverId:t}});if(we(e=>{let n=new Set(e);return n.delete(t),n}),n._tag===`Success`)return Se(e=>({...e,[t]:n.value})),n.value},ct=(0,X.useEffectEvent)(async e=>{(await at(e))?.health.status===`connected`&&Ye(null)});(0,X.useEffect)(()=>{if(Ge===null)return;let e=()=>void ct(Ge);return window.addEventListener(`focus`,e),()=>window.removeEventListener(`focus`,e)},[Ge]);let lt=async(e,t,n)=>{(await it({mcpServers:{[e]:t}}))._tag===`Success`&&(n&&Le({kind:`list`}),tt(),t.enabled&&await at(e))},$=async(t,n=!1)=>{let r=We.current.get(t);if(!n&&Ge===t&&r){window.open(r,`_blank`,`noopener,noreferrer`);return}let i=le??window.location.origin;Ze(e=>{let n={...e};return delete n[t],n});let a=await pe({environmentId:e,input:{serverId:t,origin:new URL(i,window.location.href).origin,...n?{reauthenticate:n}:{}}});if(a._tag!==`Success`){a._tag===`Failure`&&Ze(e=>({...e,[t]:St(a.cause)}));return}if(a.value.authorizationUrl===null){await at(t);return}We.current.set(t,a.value.authorizationUrl),Ye(t),window.open(a.value.authorizationUrl,`_blank`,`noopener,noreferrer`)},ft=async t=>{let n=await me({environmentId:e,input:{serverId:t}});n._tag===`Success`&&Se(e=>({...e,[t]:n.value}))},mt=(e,t,r)=>{if(n===void 0)return;let i=I[n]??{},a={...i[e]};r===void 0?delete a[t]:a[t]={enabled:r},it({projectSettingsOverrides:{[n]:{...i,[e]:a}}})},ht=async()=>{let t=He;if(Ue(null),t!==null){if(t.kind===`server`){let n=k[t.id];n?.transport.type===`http`&&n.transport.auth===`oauth`&&await me({environmentId:e,input:{serverId:t.id}}),await it({mcpServers:{[t.id]:null}})}else await it({plugins:{[t.id]:null}});Le({kind:`list`})}},gt=Fe.filter(e=>!e.alreadyAdded),yt=new Set(Qe.filter(([e])=>Z.kind!==`server`||e!==Z.id).map(([,e])=>e.name)),bt=u.trim().toLowerCase(),xt=Qe.filter(([,e])=>Dt(bt,e.name,ze(e))),Tt=$e.filter(([,e])=>Dt(bt,e.name,e.path)),kt=gt.filter(e=>Dt(bt,e.name,e.summary)),At=(e,t)=>d({mcpServers:k,plugins:N,projectSettingsOverrides:I},e,n??null,t),Mt=(e,t,r)=>{if(n!==void 0){mt(e,t,r);return}it(e===`mcpServers`?{mcpServers:{[t]:{...k[t],enabled:r}}}:{plugins:{[t]:{...N[t],enabled:r}}})},Nt=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,Q.jsxs)(`div`,{className:`grid gap-1`,children:[(0,Q.jsx)(`h1`,{className:`text-2xl font-semibold text-foreground`,children:`Plugins`}),(0,Q.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Manage plugins, skills, and MCP servers given to agents on `,t,`.`]})]}),ce?(0,Q.jsxs)(h,{children:[(0,Q.jsx)(M,{render:(0,Q.jsxs)(b,{children:[`Add`,(0,Q.jsx)(T,{"aria-hidden":!0})]})}),(0,Q.jsxs)(A,{align:`end`,children:[(0,Q.jsxs)(i,{onClick:()=>nt(null),children:[(0,Q.jsx)(O,{"aria-hidden":!0}),`Add MCP server`]}),(0,Q.jsxs)(i,{onClick:()=>rt(null),children:[(0,Q.jsx)(g,{"aria-hidden":!0}),`Add plugin`]})]})]}):null]}),Pt=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,Q.jsxs)(ae,{"aria-label":`Show`,variant:`default`,value:[c],onValueChange:e=>{let t=e[0];(t===`plugins`||t===`mcps`||t===`skills`)&&(l(t),Le({kind:`list`}))},children:[(0,Q.jsxs)(oe,{value:`plugins`,...Me(`plugins`),children:[`Plugins `,(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:$e.length})]}),(0,Q.jsxs)(oe,{value:`mcps`,...Me(`mcp-servers`),children:[`MCPs `,(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:Qe.length})]}),(0,Q.jsxs)(oe,{value:`skills`,...Me(`skills`),children:[`Skills `,(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:x.length})]})]}),(0,Q.jsxs)(`div`,{className:`flex w-full gap-2 sm:w-auto`,children:[c===`skills`?(0,Q.jsx)(`div`,{className:`w-fit shrink-0`,children:(0,Q.jsxs)(V,{value:m,onValueChange:e=>e&&_(e),children:[(0,Q.jsx)(B,{"aria-label":`Skill category`,children:(0,Q.jsx)(R,{})}),(0,Q.jsxs)(z,{children:[(0,Q.jsx)(L,{value:`All categories`,children:`All categories`}),qe.filter(e=>e===`Personal`||e===`Built-in`||x.some(({skill:t})=>Je(t)===e)).map(e=>(0,Q.jsx)(L,{value:e,children:e},e))]})]})}):null,(0,Q.jsxs)(ve,{className:`min-w-0 flex-1 sm:w-56`,children:[(0,Q.jsx)(ge,{children:(0,Q.jsx)(y,{"aria-hidden":!0})}),(0,Q.jsx)(_e,{"aria-label":Et[c],placeholder:Et[c],value:u,onChange:e=>f(e.currentTarget.value)})]})]})]}),Ft=(e,t)=>(0,Q.jsxs)(ne,{children:[(0,Q.jsx)(J,{render:(0,Q.jsx)(b,{size:`icon-sm`,variant:`ghost`,"aria-label":e,onClick:t,children:(0,Q.jsx)(S,{"aria-hidden":!0})})}),(0,Q.jsx)(te,{children:e})]}),It=Tt.length===0?(0,Q.jsx)(`p`,{className:`py-6 text-sm text-muted-foreground`,children:$e.length===0?`No plugins yet. Add a Claude Code or Codex plugin folder to give its tools to your agents.`:`No plugins match your search.`}):(0,Q.jsx)(`ul`,{className:`grid gap-1`,children:Tt.map(([t,n])=>(0,Q.jsx)(Ke,{environmentId:e,plugin:n,enabled:At(`plugins`,t),disabled:!re,onDetails:()=>rt(t),onToggle:e=>Mt(`plugins`,t,e)},t))}),Lt=x.filter(({skill:e})=>(m===`All categories`||Je(e)===m)&&Dt(bt,st(e),e.name,e.shortDescription??``,e.description??``)),Rt=Lt.length===0?(0,Q.jsx)(`p`,{className:`py-6 text-sm text-muted-foreground`,children:x.length===0?`No skills found. Providers report the skills they load when they start.`:`No skills match these filters.`}):(0,Q.jsxs)(`div`,{className:`grid gap-3`,children:[(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Switches apply to new Claude and OpenCode sessions.`}),(0,Q.jsx)(`ul`,{className:`grid gap-1`,children:Lt.map(t=>{let r=Je(t.skill),o=(v??[]).filter(e=>a(e.driver)&&e.skills.some(e=>e.name===t.skill.name)),s=o.length?o.map(e=>e.displayName??e.driver).join(`, `):`Native settings`;return(0,Q.jsxs)(`li`,{className:`flex items-center gap-3 py-3`,children:[(0,Q.jsx)(`span`,{"aria-hidden":!0,className:`flex size-10 shrink-0 items-center justify-center rounded-full border border-border/60 text-muted-foreground`,children:(0,Q.jsx)(F,{className:`size-4`})}),(0,Q.jsxs)(`div`,{className:`grid min-w-0 flex-1 gap-1`,children:[(0,Q.jsx)(`button`,{type:`button`,onClick:()=>w(t),className:`w-fit break-words text-left text-sm font-medium outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,children:st(t.skill)}),(0,Q.jsx)(Ot,{text:t.skill.shortDescription??t.skill.description??t.skill.path}),(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:[r,s].filter(Boolean).join(` · `)})]}),(0,Q.jsxs)(h,{children:[(0,Q.jsxs)(ne,{children:[(0,Q.jsx)(J,{render:(0,Q.jsx)(M,{render:(0,Q.jsx)(b,{variant:`ghost`,size:`icon-sm`,"aria-label":`More for ${st(t.skill)}`,children:(0,Q.jsx)(P,{"aria-hidden":!0})})})}),(0,Q.jsx)(te,{children:`Skill actions`})]}),(0,Q.jsxs)(A,{align:`end`,children:[q.capabilities.canOpenDefault?(0,Q.jsx)(i,{onClick:()=>void q.activate(`open`,{environmentId:e,filePath:t.skill.path,workspaceRoot:void 0}),children:`Open`}):null,(0,Q.jsx)(i,{onClick:()=>w(t),children:`Details`}),n!==void 0&&I[n]?.skillOverrides?.[t.skill.name]!==void 0?(0,Q.jsx)(i,{onClick:()=>{let e=I[n]??{},r={...e.skillOverrides};delete r[t.skill.name],it({projectSettingsOverrides:{[n]:{...e,skillOverrides:r}}})},children:`Use environment setting`}):null]})]}),(0,Q.jsx)(Pe,{"aria-label":`Enable ${st(t.skill)} for ${s}`,checked:(n===void 0?void 0:I[n]?.skillOverrides?.[t.skill.name])??U[t.skill.name]??t.skill.enabled,disabled:!re||ie!==null||o.length===0,onCheckedChange:e=>{se(t.skill.name),it(n===void 0?{skillOverrides:{[t.skill.name]:e}}:{projectSettingsOverrides:{[n]:{...I[n],skillOverrides:{...I[n]?.skillOverrides,[t.skill.name]:e}}}}).finally(()=>se(null))}})]},t.skill.path)})})]}),Bt=(0,Q.jsxs)(`div`,{className:`grid gap-6`,children:[Qe.length>0?(0,Q.jsx)(Te,{title:`Servers`,children:xt.length===0?(0,Q.jsx)(`p`,{className:`px-3 text-sm text-muted-foreground sm:px-4`,children:`No MCP servers match your search.`}):(0,Q.jsx)(Q.Fragment,{children:xt.map(([e,t])=>{let n=At(`mcpServers`,e),r=Re({...t,enabled:n},xe[e],Ce.has(e)),a=Xe[e],o=Ct(t,r,xe[e]);return(0,Q.jsxs)(`div`,{className:`flex min-h-14 items-center gap-3 px-4 py-3`,children:[(0,Q.jsxs)(`div`,{className:`grid min-w-0 flex-1 gap-0.5`,children:[(0,Q.jsx)(`span`,{className:`break-words text-sm font-medium text-foreground`,children:t.name}),r.tone===`error`||o?(0,Q.jsx)(wt,{status:r}):null,a?(0,Q.jsx)(`span`,{className:`text-xs text-destructive-foreground`,children:a}):null]}),r.needsSignIn&&ce?(0,Q.jsx)(b,{size:`xs`,variant:`outline`,onClick:()=>void $(e),children:`Authenticate`}):null,o&&!r.needsSignIn&&ce?(0,Q.jsxs)(h,{children:[(0,Q.jsxs)(ne,{children:[(0,Q.jsx)(J,{render:(0,Q.jsx)(M,{render:(0,Q.jsx)(b,{variant:`ghost`,size:`icon-sm`,"aria-label":`More for ${t.name}`,children:(0,Q.jsx)(P,{"aria-hidden":!0})})})}),(0,Q.jsx)(te,{children:`Sign-in actions`})]}),(0,Q.jsxs)(A,{align:`end`,children:[(0,Q.jsx)(i,{onClick:()=>void $(e,!0),children:`Re-authenticate`}),xe[e]?.auth===`signed-in`?(0,Q.jsx)(i,{onClick:()=>void ft(e),children:`Sign out`}):null]})]}):null,Ft(`Settings for ${t.name}`,()=>nt(e)),(0,Q.jsx)(Pe,{"aria-label":`Give ${t.name} to agents`,checked:n,disabled:!ce,onCheckedChange:t=>Mt(`mcpServers`,e,t)})]},e)})})}):null,ce&&kt.length>0?(0,Q.jsx)(Te,{title:`Found in provider configs`,headerAction:(0,Q.jsx)(b,{size:`icon-xs`,variant:`ghost`,"aria-label":`Look again`,onClick:()=>void tt(),children:(0,Q.jsx)(D,{"aria-hidden":!0})}),children:(0,Q.jsx)(Q.Fragment,{children:kt.map(t=>(0,Q.jsxs)(`div`,{className:`flex min-h-14 items-center gap-3 px-4 py-3`,children:[(0,Q.jsxs)(`div`,{className:`grid min-w-0 flex-1 gap-0.5`,children:[(0,Q.jsx)(`span`,{className:`break-words text-sm font-medium text-foreground`,children:t.name}),kt.filter(e=>e.name===t.name).length>1?(0,Q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:(t.providers??[t.provider]).map(e=>vt[e]).join(`, `)}):null]}),(0,Q.jsx)(b,{size:`xs`,variant:`outline`,onClick:async()=>{(await ye({environmentId:e,input:{...n===void 0?{}:{projectId:n},servers:[{provider:t.provider,path:t.path,name:t.name}]}}))._tag===`Success`&&(tt(),et())},children:`Import`})]},`${t.provider}:${t.path}:${t.name}`))})}):null]}),Vt=Z.kind===`server`?(0,Q.jsxs)(ut,{title:Z.id===null?`Add MCP server`:`Update ${k[Z.id]?.name??`server`} MCP`,onBack:()=>Le({kind:`list`}),onUninstall:Z.id!==null&&ce?()=>Ue({kind:`server`,id:Z.id}):void 0,children:[(0,Q.jsx)(dt,{server:Z.id===null?void 0:k[Z.id],takenNames:yt,onSave:e=>void lt(Z.id??p.make(E()),e,Z.id===null)},Z.id??`new`),Z.id!==null&&k[Z.id]!==void 0?(0,Q.jsx)(jt,{environmentId:e,id:Z.id,server:k[Z.id],runtime:xe[Z.id],checking:Ce.has(Z.id),canManage:ce,projectLabel:r,projectOverride:n===void 0?void 0:I[n]?.mcpServers?.[Z.id],awaitingSignIn:Ge===Z.id,onProviderToggle:(e,t)=>{let n=k[Z.id],r=t?n.disabledProviders.filter(t=>t!==e):[...n.disabledProviders,e];it({mcpServers:{[Z.id]:{...n,disabledProviders:r}}})},onProjectOverride:n===void 0?void 0:e=>mt(`mcpServers`,Z.id,e),signInError:Xe[Z.id],onTest:()=>void at(Z.id),onSignIn:()=>void $(Z.id),onReauthenticate:()=>void $(Z.id,!0),onSignOut:()=>void ft(Z.id)},`${e}:${Z.id}`):null]}):null,Ht=Z.kind===`plugin`?(0,Q.jsxs)(ut,{title:Z.id===null?`Add plugin`:`Update ${N[Z.id]?.name??`plugin`}`,onBack:()=>Le({kind:`list`}),onUninstall:Z.id!==null&&ce?()=>Ue({kind:`plugin`,id:Z.id}):void 0,children:[(0,Q.jsx)(pt,{environmentId:e,plugin:Z.id===null?void 0:N[Z.id],environmentLabel:t,onSave:async e=>{let t=Z.id??s.make(E());(await it({plugins:{[t]:e}}))._tag===`Success`&&Z.id===null&&Le({kind:`list`})}},Z.id??`new`),Z.id!==null&&N[Z.id]!==void 0?(0,Q.jsx)(zt,{plugin:N[Z.id],projectLabel:r,projectOverride:n===void 0?void 0:I[n]?.plugins?.[Z.id],onProjectOverride:n===void 0?void 0:e=>mt(`plugins`,Z.id,e)}):null]}):null;return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`grid gap-6`,children:[Nt,Pt,Vt??Ht??(c===`plugins`?It:c===`mcps`?Bt:Rt)]}),C===null?null:(0,Q.jsx)(_t,{entry:C,environmentId:e,onClose:()=>w(null)}),(0,Q.jsx)(Ee,{open:He!==null,onOpenChange:e=>!e&&Ue(null),children:(0,Q.jsxs)(De,{children:[(0,Q.jsxs)(je,{children:[(0,Q.jsxs)(Oe,{children:[`Remove`,` `,He?.kind===`server`?k[He.id]?.name??`server`:He?.kind===`plugin`?N[He.id]?.name??`plugin`:``,`?`]}),(0,Q.jsxs)(ke,{children:[`New sessions on `,t,` stop getting it. Its stored values and sign-in are deleted. Provider config files are not changed.`]})]}),(0,Q.jsxs)(Ae,{children:[(0,Q.jsx)(Ne,{render:(0,Q.jsx)(b,{variant:`outline`,children:`Cancel`})}),(0,Q.jsx)(b,{variant:`destructive`,onClick:()=>void ht(),children:`Remove`})]})]})})]})}function At(e){let t=(0,Y.c)(16),{projectLabel:n,override:r,inherited:i,onChange:a}=e,o=r?.enabled!==void 0,s=`In ${n}`,c=o?`Set for this project.`:`Follows the environment (${i?`on`:`off`}).`,l;t[0]!==a||t[1]!==o?(l=o?(0,Q.jsx)(b,{size:`xs`,variant:`ghost`,onClick:()=>a(void 0),children:`Reset`}):null,t[0]=a,t[1]=o,t[2]=l):l=t[2];let u=`Use in ${n}`,d=r?.enabled??i,f;t[3]===a?f=t[4]:(f=e=>a(e),t[3]=a,t[4]=f);let p;t[5]!==u||t[6]!==d||t[7]!==f?(p=(0,Q.jsx)(Pe,{"aria-label":u,checked:d,onCheckedChange:f}),t[5]=u,t[6]=d,t[7]=f,t[8]=p):p=t[8];let m;t[9]!==l||t[10]!==p?(m=(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[l,p]}),t[9]=l,t[10]=p,t[11]=m):m=t[11];let h;return t[12]!==s||t[13]!==c||t[14]!==m?(h=(0,Q.jsx)(Ce,{title:s,description:c,control:m}),t[12]=s,t[13]=c,t[14]=m,t[15]=h):h=t[15],h}function jt(e){let t=(0,Y.c)(108),{environmentId:n,id:r,server:i,runtime:a,checking:o,canManage:s,projectLabel:c,projectOverride:u,awaitingSignIn:d,signInError:f,onProviderToggle:p,onProjectOverride:m,onTest:h,onSignIn:g,onReauthenticate:_,onSignOut:v}=e,y=s&&i.transport.type===`http`&&i.transport.auth===`oauth`&&a?.auth===`signed-out`,x=Ft(n,r,y),S=x.entries,C;t[0]!==o||t[1]!==a||t[2]!==i?(C=Re(i,a,o),t[0]=o,t[1]=a,t[2]=i,t[3]=C):C=t[3];let w=C,T;t[4]===S?T=t[5]:(T=S?.filter(Nt).length??0,t[4]=S,t[5]=T);let E=T,D;t[6]!==w||t[7]!==E||t[8]!==S||t[9]!==y?(D=y?{...w,tone:`muted`,label:S===null?`Checking providers…`:E>0?`Available to ${E} ${E===1?`provider`:`providers`}`:`No providers connected`}:w,t[6]=w,t[7]=E,t[8]=S,t[9]=y,t[10]=D):D=t[10];let O=D,k,A,j,M,N,P,F;if(t[11]!==d||t[12]!==s||t[13]!==o||t[14]!==S||t[15]!==r||t[16]!==p||t[17]!==_||t[18]!==g||t[19]!==v||t[20]!==h||t[21]!==a?.auth||t[22]!==i||t[23]!==f||t[24]!==x||t[25]!==O||t[26]!==y){let e;t[34]===S?e=t[35]:(e=e=>({...e,badge:S===null||e.unsupported!==void 0?void 0:$e(e.driver,S)}),t[34]=S,t[35]=e);let n=et(i).map(e),c=i.transport.type===`http`&&a?.auth===`signed-in`,u=f??O.detail;N=`grid gap-6`,P=r;let m;t[36]===O?m=t[37]:(m=(0,Q.jsx)(wt,{status:O,className:`flex-1 text-sm`}),t[36]=O,t[37]=m);let C;t[38]!==d||t[39]!==s||t[40]!==g||t[41]!==O.needsSignIn||t[42]!==y?(C=O.needsSignIn&&s&&!y?(0,Q.jsx)(b,{size:`xs`,onClick:g,children:d?`Open sign-in again`:`Authenticate`}):null,t[38]=d,t[39]=s,t[40]=g,t[41]=O.needsSignIn,t[42]=y,t[43]=C):C=t[43];let w;t[44]!==s||t[45]!==_||t[46]!==c||t[47]!==O.needsSignIn?(w=c&&!O.needsSignIn&&s?(0,Q.jsx)(b,{size:`xs`,variant:`outline`,onClick:_,children:`Re-authenticate`}):null,t[44]=s,t[45]=_,t[46]=c,t[47]=O.needsSignIn,t[48]=w):w=t[48];let T;t[49]!==s||t[50]!==v||t[51]!==c?(T=c&&s?(0,Q.jsx)(b,{size:`xs`,variant:`ghost`,onClick:v,children:`Sign out`}):null,t[49]=s,t[50]=v,t[51]=c,t[52]=T):T=t[52];let E;t[53]!==s||t[54]!==o||t[55]!==h||t[56]!==i.enabled?(E=s&&i.enabled?(0,Q.jsx)(b,{size:`xs`,variant:`outline`,disabled:o,onClick:h,children:`Test connection`}):null,t[53]=s,t[54]=o,t[55]=h,t[56]=i.enabled,t[57]=E):E=t[57];let D;t[58]!==m||t[59]!==C||t[60]!==w||t[61]!==T||t[62]!==E?(D=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[m,C,w,T,E]}),t[58]=m,t[59]=C,t[60]=w,t[61]=T,t[62]=E,t[63]=D):D=t[63];let I;t[64]!==d||t[65]!==O.needsSignIn||t[66]!==y?(I=O.needsSignIn&&!y?(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:d?`Finish signing in in your browser, then come back here.`:y?`Sign in here to give it to every provider.`:`Agents can't reach this server until you sign in.`}):null,t[64]=d,t[65]=O.needsSignIn,t[66]=y,t[67]=I):I=t[67];let L;t[68]!==u||t[69]!==y?(L=u&&!y?(0,Q.jsx)(`p`,{className:`rounded-md bg-destructive/8 px-2.5 py-1.5 text-xs text-destructive-foreground`,children:u}):null,t[68]=u,t[69]=y,t[70]=L):L=t[70];let R;t[71]!==d||t[72]!==u||t[73]!==g||t[74]!==y?(R=y?(0,Q.jsxs)(`details`,{className:`text-xs text-muted-foreground`,children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer`,children:u?`Shared sign-in unavailable`:`Shared sign-in`}),(0,Q.jsxs)(`div`,{className:`grid gap-2 pt-2`,children:[(0,Q.jsx)(`p`,{children:u??`Sign in through P4 Code to share access with every enabled provider.`}),(0,Q.jsx)(`div`,{children:(0,Q.jsx)(b,{size:`xs`,variant:`outline`,onClick:g,children:d?`Open browser`:u?`Retry shared sign-in`:`Sign in through P4 Code`})})]})]}):null,t[71]=d,t[72]=u,t[73]=g,t[74]=y,t[75]=R):R=t[75];let z;t[76]===i.source?z=t[77]:(z=i.source?(0,Q.jsxs)(`details`,{className:`text-xs text-muted-foreground`,children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer`,children:`Import source`}),(0,Q.jsx)(`p`,{className:`break-all pt-2`,children:i.source.path})]}):null,t[76]=i.source,t[77]=z);let B=y?(0,Q.jsx)(Lt,{serverName:i.name,signIns:x,blocked:n.filter(Mt).length}):null;t[78]!==D||t[79]!==I||t[80]!==L||t[81]!==R||t[82]!==z||t[83]!==B?(F=(0,Q.jsx)(Te,{title:`Status`,children:(0,Q.jsx)(Se,{children:(0,Q.jsxs)(`div`,{className:`grid gap-2 px-4 py-3`,children:[D,I,L,R,z,B]})})}),t[78]=D,t[79]=I,t[80]=L,t[81]=R,t[82]=z,t[83]=B,t[84]=F):F=t[84],A=Te,M=`Providers`,k=Se;let V;t[85]!==s||t[86]!==p||t[87]!==i.name?(V=e=>(0,Q.jsx)(Ce,{title:e.label,...e.unsupported===void 0?{}:{description:e.unsupported},control:(0,Q.jsxs)(`div`,{className:`flex items-center gap-3`,children:[e.badge===void 0?null:(0,Q.jsx)(l,{variant:Rt[e.badge].variant,children:Rt[e.badge].label}),(0,Q.jsx)(Pe,{"aria-label":`Give ${i.name} to ${e.label}`,checked:e.enabled&&e.badge!==`unavailable`,disabled:!s||e.unsupported!==void 0||e.badge===`unavailable`,onCheckedChange:t=>p(e.driver,t)})]})},e.driver),t[85]=s,t[86]=p,t[87]=i.name,t[88]=V):V=t[88],j=n.map(V),t[11]=d,t[12]=s,t[13]=o,t[14]=S,t[15]=r,t[16]=p,t[17]=_,t[18]=g,t[19]=v,t[20]=h,t[21]=a?.auth,t[22]=i,t[23]=f,t[24]=x,t[25]=O,t[26]=y,t[27]=k,t[28]=A,t[29]=j,t[30]=M,t[31]=N,t[32]=P,t[33]=F}else k=t[27],A=t[28],j=t[29],M=t[30],N=t[31],P=t[32],F=t[33];let I;t[89]!==k||t[90]!==j?(I=(0,Q.jsx)(k,{children:j}),t[89]=k,t[90]=j,t[91]=I):I=t[91];let L;t[92]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Q.jsx)(`p`,{className:`px-3 text-xs text-muted-foreground sm:px-4`,children:`A change reaches a thread when its provider session next starts.`}),t[92]=L):L=t[92];let R;t[93]!==A||t[94]!==M||t[95]!==I?(R=(0,Q.jsxs)(A,{title:M,children:[I,L]}),t[93]=A,t[94]=M,t[95]=I,t[96]=R):R=t[96];let z;t[97]!==m||t[98]!==c||t[99]!==u||t[100]!==i.enabled?(z=c!==void 0&&m!==void 0?(0,Q.jsx)(Te,{title:`Project`,children:(0,Q.jsx)(Se,{children:(0,Q.jsx)(At,{projectLabel:c,override:u,inherited:i.enabled,onChange:m})})}):null,t[97]=m,t[98]=c,t[99]=u,t[100]=i.enabled,t[101]=z):z=t[101];let B;return t[102]!==R||t[103]!==z||t[104]!==N||t[105]!==P||t[106]!==F?(B=(0,Q.jsxs)(`div`,{className:N,"data-server-id":P,children:[F,R,z]}),t[102]=R,t[103]=z,t[104]=N,t[105]=P,t[106]=F,t[107]=B):B=t[107],B}function Mt(e){return e.enabled&&e.badge===`unavailable`}function Nt(e){return e.status===`signed-in`}function Pt(e){let t=_(e);return xt(t)&&t.detail!==void 0?t.detail:`Sign-in could not start. Try again.`}function Ft(e,t,n){let r=K(G.mcpRegistryProviderSignInState,{reportFailure:!1}),i=K(G.mcpRegistryProviderSignInStart,{reportFailure:!1}),a=K(G.mcpRegistryProviderSignInWait,{reportFailure:!1}),o=K(G.mcpRegistryProviderSignInComplete,{reportFailure:!1}),s=K(G.mcpRegistryProviderSignInCancel,{reportFailure:!1}),c=K(G.mcpRegistryProviderSignOut,{reportFailure:!1}),l=j(G.mcpRegistryProviderSignInComplete.permissionAtom(e)),u=j(G.mcpRegistryProviderSignInCancel.permissionAtom(e)),[d,f]=(0,X.useState)(null),[p,m]=(0,X.useState)({}),[h,g]=(0,X.useState)(new Set),_=(0,X.useRef)(new Set),v=e=>f(t=>t?.map(t=>t.instanceId===e.instanceId?e:t)??null),y=(e,t)=>m(n=>{let r={...n};return t===void 0?delete r[e]:r[e]=t,r});return(0,X.useEffect)(()=>{if(!n)return;let i=!1;return r({environmentId:e,input:{serverId:t}}).then(e=>{i||f(e._tag===`Success`?e.value.providers:[])}),()=>{i=!0}},[n,e,r,t]),(0,X.useEffect)(()=>{if(!n)return;let r=!1;for(let n of d??[]){let i=n.pending;i&&a({environmentId:e,input:{serverId:t,instanceId:n.instanceId,flowId:i.flowId}}).then(e=>{r||(f(t=>t?.map(t=>{if(t.instanceId!==n.instanceId||t.pending?.flowId!==i.flowId)return t;if(e._tag===`Success`)return e.value;let{pending:r,...a}=t;return a})??null),e._tag===`Failure`?y(n.instanceId,Pt(e.cause)):e._tag===`Success`&&e.value.status!==`signed-in`&&!_.current.has(n.instanceId)&&y(n.instanceId,`Sign-in ended without connecting. Try again.`))})}return()=>{r=!0}},[n,d,e,t,a]),{entries:n?d:null,errors:p,busy:h,run:async(n,r,a)=>{if(!_.current.has(n.instanceId)){_.current.add(n.instanceId),g(new Set(_.current)),y(n.instanceId,void 0);try{let l={serverId:t,instanceId:n.instanceId};if(r===`start`){let t=await i({environmentId:e,input:l});t._tag===`Success`?(v({...n,pending:t.value}),window.open(t.value.authorizationUrl,`_blank`,`noopener,noreferrer`)):t._tag===`Failure`&&y(n.instanceId,Pt(t.cause));return}let u={...l,flowId:n.pending?.flowId??``},d=r===`complete`?await o({environmentId:e,input:{...u,callbackUrl:a.trim()}}):r===`cancel`?await s({environmentId:e,input:u}):await c({environmentId:e,input:l});d._tag===`Success`?v(d.value):d._tag===`Failure`&&y(n.instanceId,Pt(d.cause))}finally{_.current.delete(n.instanceId),g(new Set(_.current))}}},canComplete:l,canCancel:u}}function It(e){let t=(0,Y.c)(39),{entry:n,signIns:r}=e,i;t[0]!==n.displayName||t[1]!==n.driver?(i=n.displayName??Ze(n.driver),t[0]=n.displayName,t[1]=n.driver,t[2]=i):i=t[2];let a=i,[o,s]=(0,X.useState)(``),c=n.pending,l;t[3]!==n.instanceId||t[4]!==r.busy?(l=r.busy.has(n.instanceId),t[3]=n.instanceId,t[4]=r.busy,t[5]=l):l=t[5];let u=l,d=r.errors[n.instanceId],f=`mcp-callback-${n.instanceId}`,p;t[6]===a?p=t[7]:(p=(0,Q.jsx)(`p`,{className:`text-sm font-medium`,children:a}),t[6]=a,t[7]=p);let m=c?`text-warning-foreground`:n.status===`signed-in`?`text-success-foreground`:`text-muted-foreground`,h;t[8]===m?h=t[9]:(h=k(`text-xs`,m),t[8]=m,t[9]=h);let g;t[10]!==n.status||t[11]!==c?(g=c?`Waiting for sign-in`:Qe(n.status),t[10]=n.status,t[11]=c,t[12]=g):g=t[12];let _;t[13]!==h||t[14]!==g?(_=(0,Q.jsx)(`p`,{className:h,role:`status`,children:g}),t[13]=h,t[14]=g,t[15]=_):_=t[15];let v;t[16]!==p||t[17]!==_?(v=(0,Q.jsxs)(`div`,{className:`grid gap-1`,children:[p,_]}),t[16]=p,t[17]=_,t[18]=v):v=t[18];let y;t[19]!==u||t[20]!==n||t[21]!==d||t[22]!==c||t[23]!==r?(y=!c&&n.status!==`unavailable`?(0,Q.jsx)(b,{size:`xs`,variant:n.status===`signed-in`?`outline`:`default`,disabled:u,onClick:()=>void r.run(n,n.status===`signed-in`?`signOut`:`start`),children:u?`Please wait…`:n.status===`signed-in`?`Sign out`:d?`Start over`:`Sign in`}):null,t[19]=u,t[20]=n,t[21]=d,t[22]=c,t[23]=r,t[24]=y):y=t[24];let x;t[25]!==v||t[26]!==y?(x=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[v,y]}),t[25]=v,t[26]=y,t[27]=x):x=t[27];let S;t[28]!==u||t[29]!==o||t[30]!==n||t[31]!==d||t[32]!==f||t[33]!==c||t[34]!==r?(S=c?(0,Q.jsxs)(`form`,{className:`grid gap-2`,onSubmit:e=>{e.preventDefault(),o.trim()&&!u&&r.canComplete&&r.run(n,`complete`,o)},children:[(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Approve in your browser. If it ends on a callback URL, paste that URL here.`}),(0,Q.jsx)(`label`,{htmlFor:f,className:`text-xs font-medium`,children:`Callback URL`}),(0,Q.jsx)(se,{id:f,value:o,onChange:e=>s(e.target.value),placeholder:`http://localhost:…/callback?code=…&state=…`,autoComplete:`off`,spellCheck:!1,disabled:u||!r.canComplete,"aria-invalid":!!d,"aria-describedby":d?`${f}-error`:void 0}),d?(0,Q.jsx)(`p`,{id:`${f}-error`,role:`alert`,className:`text-xs text-destructive-foreground`,children:d}):null,(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Q.jsx)(b,{type:`submit`,size:`xs`,disabled:u||!o.trim()||!r.canComplete,children:u?`Please wait…`:`Finish sign-in`}),(0,Q.jsx)(b,{type:`button`,size:`xs`,variant:`outline`,disabled:u,onClick:()=>window.open(c.authorizationUrl,`_blank`,`noopener,noreferrer`),children:`Open browser`}),(0,Q.jsx)(b,{type:`button`,size:`xs`,variant:`ghost`,disabled:u||!r.canCancel,onClick:()=>void r.run(n,`cancel`),children:`Cancel`})]})]}):d?(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive-foreground`,children:d}):null,t[28]=u,t[29]=o,t[30]=n,t[31]=d,t[32]=f,t[33]=c,t[34]=r,t[35]=S):S=t[35];let C;return t[36]!==x||t[37]!==S?(C=(0,Q.jsxs)(`div`,{className:`grid gap-2 border-t border-border pt-3`,children:[x,S]}),t[36]=x,t[37]=S,t[38]=C):C=t[38],C}function Lt(e){let t=(0,Y.c)(8),{serverName:n,signIns:r,blocked:i}=e,a;t[0]===r?a=t[1]:(a=r.entries===null?(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Checking providers…`}):r.entries.length===0?(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No enabled provider here can sign in to MCP servers itself.`}):r.entries.map(e=>(0,Q.jsx)(It,{entry:e,signIns:r},`${e.instanceId}:${e.pending?.flowId??`idle`}`)),t[0]=r,t[1]=a);let o;t[2]!==i||t[3]!==n?(o=i>0?(0,Q.jsxs)(`details`,{className:`text-xs text-muted-foreground`,children:[(0,Q.jsxs)(`summary`,{className:`cursor-pointer`,children:[i,` other `,i===1?`provider`:`providers`,` unavailable`]}),(0,Q.jsxs)(`p`,{className:`pt-2`,children:[`These providers need shared sign-in to use `,n,`.`]})]}):null,t[2]=i,t[3]=n,t[4]=o):o=t[4];let s;return t[5]!==a||t[6]!==o?(s=(0,Q.jsxs)(`div`,{className:`grid gap-3`,children:[a,o]}),t[5]=a,t[6]=o,t[7]=s):s=t[7],s}var Rt={"signed-in":{variant:`success`,label:`Signed in`},"needs-sign-in":{variant:`warning`,label:`Sign in needed`},unavailable:{variant:`secondary`,label:`Unavailable`}};function zt(e){let t=(0,Y.c)(7),{plugin:n,projectLabel:r,projectOverride:i,onProjectOverride:a}=e,o;t[0]!==a||t[1]!==n||t[2]!==r||t[3]!==i?(o=r!==void 0&&a!==void 0?(0,Q.jsx)(Te,{title:`Project`,children:(0,Q.jsx)(Se,{children:(0,Q.jsx)(At,{projectLabel:r,override:i,inherited:n.enabled,onChange:a})})}):null,t[0]=a,t[1]=n,t[2]=r,t[3]=i,t[4]=o):o=t[4];let s;return t[5]===o?s=t[6]:(s=(0,Q.jsx)(`div`,{className:`grid gap-6`,children:o}),t[5]=o,t[6]=s),s}var Bt=Tt;export{Bt as component};
5
- //# sourceMappingURL=settings.plugins-CFiDE3ms.js.map
3
+ `).map(e=>e.trim()).filter(e=>e.length>0),env:n,...e.cwd.trim()?{cwd:e.cwd.trim()}:{}}:{type:`http`,url:e.url.trim(),headers:n,auth:e.auth};return{name:e.name.trim(),enabled:t?.enabled??!0,transport:r,disabledProviders:t?.disabledProviders??[],...t?.source===void 0?{}:{source:t.source}}}function ot(e){let t=new Map;for(let n of e){let e=n.displayName??n.driver;for(let r of n.skills){let n=`${r.scope??``}\u0000${r.name}`,i=t.get(n);i===void 0?t.set(n,{skill:r,providers:[e]}):i.providers.includes(e)||i.providers.push(e)}}return[...t.values()].toSorted((e,t)=>st(e.skill).localeCompare(st(t.skill)))}var st=e=>e.displayName??e.name.split(/[-_\s]+/).filter(e=>e.length>0).map(e=>e[0].toUpperCase()+e.slice(1)).join(` `);function ct(e){switch(e){case void 0:return;case`user`:return`Personal`;case`project`:case`repo`:return`Project`;case`system`:return`Built-in`;default:return e[0].toUpperCase()+e.slice(1)}}function lt(e){let t=/^---\r?\n[\s\S]*?\r?\n---\r?\n?/.exec(e);return(t===null?e:e.slice(t[0].length)).trimStart()}function ut(e){let t=(0,Y.c)(14),{title:n,onBack:r,onUninstall:i,children:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Q.jsx)(O,{"aria-hidden":!0}),t[0]=o):o=t[0];let s;t[1]===r?s=t[2]:(s=(0,Q.jsxs)(C,{size:`xs`,variant:`ghost`,className:`w-fit`,onClick:r,children:[o,`Back`]}),t[1]=r,t[2]=s);let c;t[3]===n?c=t[4]:(c=(0,Q.jsx)(`h2`,{className:`min-w-0 truncate text-xl font-semibold text-foreground`,children:n}),t[3]=n,t[4]=c);let l;t[5]===i?l=t[6]:(l=i?(0,Q.jsxs)(C,{size:`sm`,variant:`destructive-outline`,onClick:i,children:[(0,Q.jsx)(f,{"aria-hidden":!0}),`Uninstall`]}):null,t[5]=i,t[6]=l);let u;t[7]!==c||t[8]!==l?(u=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[c,l]}),t[7]=c,t[8]=l,t[9]=u):u=t[9];let d;return t[10]!==a||t[11]!==s||t[12]!==u?(d=(0,Q.jsxs)(`div`,{className:`grid gap-6`,children:[s,u,a]}),t[10]=a,t[11]=s,t[12]=u,t[13]=d):d=t[13],d}function $(e){let t=(0,Y.c)(6),{label:n,htmlFor:r,children:i}=e,a;t[0]!==r||t[1]!==n?(a=(0,Q.jsx)(Fe,{htmlFor:r,children:n}),t[0]=r,t[1]=n,t[2]=a):a=t[2];let o;return t[3]!==i||t[4]!==a?(o=(0,Q.jsxs)(`div`,{className:`grid gap-2 px-4 py-4`,children:[a,i]}),t[3]=i,t[4]=a,t[5]=o):o=t[5],o}function dt(e){let t=(0,Y.c)(69),{server:n,takenNames:r,onSave:i}=e,a;t[0]===n?a=t[1]:(a=n===void 0?tt:nt(n),t[0]=n,t[1]=a);let o=a,[s,c]=(0,X.useState)(o),l;t[2]===o?l=t[3]:(l=JSON.stringify(o),t[2]=o,t[3]=l);let u=l,[d,p]=(0,X.useState)(u);u!==d&&(p(u),c(o));let m;t[4]!==s||t[5]!==r?(m=it(s,r),t[4]=s,t[5]=r,t[6]=m):m=t[6];let h=m,g;t[7]===s?g=t[8]:(g=JSON.stringify(s),t[7]=s,t[8]=g);let _=g!==u,v;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(v=e=>c(t=>({...t,...e})),t[9]=v):v=t[9];let y=v,b=s.type===`stdio`?`Environment variables`:`Headers`,S;t[10]===s.values?S=t[11]:(S=(e,t)=>y({values:s.values.map((n,r)=>r===e?{...n,...t}:n)}),t[10]=s.values,t[11]=S);let w=S,T;t[12]!==_||t[13]!==s||t[14]!==i||t[15]!==h||t[16]!==n?(T=e=>{e.preventDefault(),_&&h===void 0&&i(at(s,n))},t[12]=_,t[13]=s,t[14]=i,t[15]=h,t[16]=n,t[17]=T):T=t[17];let E;t[18]===n?E=t[19]:(E=n===void 0?null:(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`To switch between a command and a URL, uninstall the server and add it again.`}),t[18]=n,t[19]=E);let D;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(D=e=>y({name:e.target.value}),t[20]=D):D=t[20];let O;t[21]===s.name?O=t[22]:(O=(0,Q.jsx)($,{label:`Name`,htmlFor:`mcp-server-name`,children:(0,Q.jsx)(se,{id:`mcp-server-name`,placeholder:`github`,value:s.name,onChange:D})}),t[21]=s.name,t[22]=O);let k;t[23]!==s.type||t[24]!==n?(k=n===void 0?(0,Q.jsx)($,{label:`Type`,children:(0,Q.jsxs)(ae,{"aria-label":`How P4 Code reaches the server`,value:[s.type],onValueChange:e=>{let t=e[0];(t===`stdio`||t===`http`)&&y({type:t,values:[]})},children:[(0,Q.jsx)(oe,{value:`stdio`,children:`Command`}),(0,Q.jsx)(oe,{value:`http`,children:`URL`})]})}):null,t[23]=s.type,t[24]=n,t[25]=k):k=t[25];let A;t[26]!==s.args||t[27]!==s.auth||t[28]!==s.command||t[29]!==s.cwd||t[30]!==s.type||t[31]!==s.url?(A=s.type===`stdio`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)($,{label:`Command`,htmlFor:`mcp-server-command`,children:(0,Q.jsx)(se,{id:`mcp-server-command`,placeholder:`npx`,value:s.command,onChange:e=>y({command:e.target.value})})}),(0,Q.jsx)($,{label:`Arguments, one per line`,htmlFor:`mcp-server-args`,children:(0,Q.jsx)(ie,{id:`mcp-server-args`,placeholder:`-y
4
+ @modelcontextprotocol/server-postgres`,value:s.args,onChange:e=>y({args:e.target.value})})}),(0,Q.jsx)($,{label:`Working directory (optional)`,htmlFor:`mcp-server-cwd`,children:(0,Q.jsx)(se,{id:`mcp-server-cwd`,placeholder:`The session's project folder`,value:s.cwd,onChange:e=>y({cwd:e.target.value})})})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)($,{label:`URL`,htmlFor:`mcp-server-url`,children:(0,Q.jsx)(se,{id:`mcp-server-url`,placeholder:`https://mcp.example.com/mcp`,value:s.url,onChange:e=>y({url:e.target.value})})}),(0,Q.jsx)($,{label:`Authentication`,children:(0,Q.jsxs)(V,{value:s.auth,onValueChange:e=>{(e===`none`||e===`oauth`)&&y({auth:e})},children:[(0,Q.jsx)(B,{"aria-label":`Authentication`,children:(0,Q.jsx)(R,{children:ft})}),(0,Q.jsxs)(z,{alignItemWithTrigger:!1,children:[(0,Q.jsx)(L,{value:`none`,children:`None or headers`}),(0,Q.jsx)(L,{value:`oauth`,children:`OAuth (sign in after saving)`})]})]})})]}),t[26]=s.args,t[27]=s.auth,t[28]=s.command,t[29]=s.cwd,t[30]=s.type,t[31]=s.url,t[32]=A):A=t[32];let j;t[33]!==s.type||t[34]!==s.values||t[35]!==w||t[36]!==b?(j=s.values.map((e,t)=>(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(se,{"aria-label":`${b} name`,placeholder:s.type===`stdio`?`API_TOKEN`:`Authorization`,value:e.key,onChange:e=>w(t,{key:e.target.value})}),(0,Q.jsx)(Ie,{"aria-label":`${b} value`,placeholder:`Value`,value:e.value,onChange:e=>w(t,{value:e.target.value})}),(0,Q.jsx)(C,{size:`icon-sm`,variant:`ghost`,"aria-label":`Remove ${e.key||`row`}`,onClick:()=>y({values:s.values.filter((e,n)=>n!==t)}),children:(0,Q.jsx)(f,{"aria-hidden":!0})})]},t)),t[33]=s.type,t[34]=s.values,t[35]=w,t[36]=b,t[37]=j):j=t[37];let M;t[38]===s.values?M=t[39]:(M=()=>y({values:[...s.values,{key:``,value:``}]}),t[38]=s.values,t[39]=M);let N;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Q.jsx)(x,{"aria-hidden":!0}),t[40]=N):N=t[40];let P=s.type===`stdio`?`variable`:`header`,F;t[41]!==M||t[42]!==P?(F=(0,Q.jsxs)(C,{variant:`soft`,onClick:M,children:[N,`Add `,P]}),t[41]=M,t[42]=P,t[43]=F):F=t[43];let I;t[44]!==j||t[45]!==F?(I=(0,Q.jsxs)(`div`,{className:`grid gap-2`,children:[j,F]}),t[44]=j,t[45]=F,t[46]=I):I=t[46];let H;t[47]!==I||t[48]!==b?(H=(0,Q.jsx)($,{label:b,children:I}),t[47]=I,t[48]=b,t[49]=H):H=t[49];let U;t[50]!==O||t[51]!==k||t[52]!==A||t[53]!==H?(U=(0,Q.jsxs)(Se,{children:[O,k,A,H]}),t[50]=O,t[51]=k,t[52]=A,t[53]=H,t[54]=U):U=t[54];let W;t[55]!==_||t[56]!==h?(W=_&&h!==void 0?(0,Q.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive-foreground`,children:h}):null,t[55]=_,t[56]=h,t[57]=W):W=t[57];let G=!_||h!==void 0,K=n===void 0?`Add server`:`Save`,q;t[58]!==G||t[59]!==K?(q=(0,Q.jsx)(C,{type:`submit`,disabled:G,children:K}),t[58]=G,t[59]=K,t[60]=q):q=t[60];let ee;t[61]!==W||t[62]!==q?(ee=(0,Q.jsxs)(`div`,{className:`flex items-center justify-end gap-3`,children:[W,q]}),t[61]=W,t[62]=q,t[63]=ee):ee=t[63];let J;return t[64]!==U||t[65]!==ee||t[66]!==T||t[67]!==E?(J=(0,Q.jsxs)(`form`,{className:`grid gap-3`,onSubmit:T,children:[E,U,ee]}),t[64]=U,t[65]=ee,t[66]=T,t[67]=E,t[68]=J):J=t[68],J}function ft(e){return e===`oauth`?`OAuth (sign in after saving)`:`None or headers`}function pt(e){let t=(0,Y.c)(55),{environmentId:n,plugin:r,environmentLabel:i,onSave:a}=e,o=r?.path??``,s=r===void 0?null:`.claude-plugin/plugin.json`,c;t[0]!==n||t[1]!==o||t[2]!==s?(c=ye(n,o,s),t[0]=n,t[1]=o,t[2]=s,t[3]=c):c=t[3];let l=M(h(P(c))),u=We(r!==void 0&&l!==null&&!l.truncated?l.contents:null),d;t[4]===r?.options?d=t[5]:(d=r?.options??{},t[4]=r?.options,t[5]=d);let f=d,p=[...u,...Object.keys(f).filter(e=>!u.some(t=>t.key===e)).map(ht)],[m,g]=(0,X.useState)(r?.name??``),[_,v]=(0,X.useState)(r?.path??``),[y,b]=(0,X.useState)(f),x;t[6]!==r?.name||t[7]!==r?.path||t[8]!==f?(x=JSON.stringify([r?.name??``,r?.path??``,f]),t[6]=r?.name,t[7]=r?.path,t[8]=f,t[9]=x):x=t[9];let S=x,[w,T]=(0,X.useState)(S);S!==w&&(T(S),g(r?.name??``),v(r?.path??``),b(f));let E,D;t[10]!==m||t[11]!==y||t[12]!==_||t[13]!==r?.name||t[14]!==r?.path||t[15]!==f?(E=Object.fromEntries(Object.entries(y).filter(mt)),D=m!==(r?.name??``)||_!==(r?.path??``)||JSON.stringify(E)!==JSON.stringify(f),t[10]=m,t[11]=y,t[12]=_,t[13]=r?.name,t[14]=r?.path,t[15]=f,t[16]=E,t[17]=D):(E=t[16],D=t[17]);let O=D,k;t[18]!==m||t[19]!==_?(k=m.trim().length>0&&_.trim().startsWith(`/`),t[18]=m,t[19]=_,t[20]=k):k=t[20];let A=k,j;t[21]!==O||t[22]!==m||t[23]!==E||t[24]!==a||t[25]!==_||t[26]!==r?.enabled||t[27]!==A?(j=e=>{e.preventDefault(),O&&A&&a({name:m.trim(),path:_.trim(),enabled:r?.enabled??!0,options:E})},t[21]=O,t[22]=m,t[23]=E,t[24]=a,t[25]=_,t[26]=r?.enabled,t[27]=A,t[28]=j):j=t[28];let N;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(N=e=>g(e.target.value),t[29]=N):N=t[29];let F;t[30]===m?F=t[31]:(F=(0,Q.jsx)($,{label:`Name`,htmlFor:`plugin-name`,children:(0,Q.jsx)(se,{id:`plugin-name`,value:m,onChange:N})}),t[30]=m,t[31]=F);let I=`Folder on ${i}`,L;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(L=e=>v(e.target.value),t[32]=L):L=t[32];let R;t[33]===_?R=t[34]:(R=(0,Q.jsx)(se,{id:`plugin-path`,placeholder:`/Users/me/plugins/my-plugin`,value:_,onChange:L}),t[33]=_,t[34]=R);let z;t[35]!==I||t[36]!==R?(z=(0,Q.jsx)($,{label:I,htmlFor:`plugin-path`,children:R}),t[35]=I,t[36]=R,t[37]=z):z=t[37];let B=p.map(e=>(0,Q.jsx)($,{label:e.required?e.title:`${e.title} (optional)`,htmlFor:`plugin-option-${e.key}`,children:(0,Q.jsx)(Ie,{id:`plugin-option-${e.key}`,placeholder:`description`in e?e.description:void 0,value:y[e.key]??``,onChange:t=>b(n=>({...n,[e.key]:t.target.value}))})},e.key)),V;t[38]!==F||t[39]!==z||t[40]!==B?(V=(0,Q.jsxs)(Se,{children:[F,z,B]}),t[38]=F,t[39]=z,t[40]=B,t[41]=V):V=t[41];let H;t[42]!==O||t[43]!==A?(H=O&&!A?(0,Q.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive-foreground`,children:`Enter a name and the plugin folder's full path.`}):null,t[42]=O,t[43]=A,t[44]=H):H=t[44];let U=!O||!A,W=r===void 0?`Add plugin`:`Save`,G;t[45]!==U||t[46]!==W?(G=(0,Q.jsx)(C,{type:`submit`,disabled:U,children:W}),t[45]=U,t[46]=W,t[47]=G):G=t[47];let K;t[48]!==H||t[49]!==G?(K=(0,Q.jsxs)(`div`,{className:`flex items-center justify-end gap-3`,children:[H,G]}),t[48]=H,t[49]=G,t[50]=K):K=t[50];let q;return t[51]!==V||t[52]!==K||t[53]!==j?(q=(0,Q.jsxs)(`form`,{className:`grid gap-3`,onSubmit:j,children:[V,K]}),t[51]=V,t[52]=K,t[53]=j,t[54]=q):q=t[54],q}function mt(e){let[,t]=e;return t}function ht(e){return{key:e,title:e,required:!1}}var gt=e=>e.replace(/[\\/][^\\/]*$/,``)||`/`;function _t(e){let t=(0,Y.c)(69),{entry:n,environmentId:r,onClose:a}=e,{skill:o,providers:s}=n,c,l,u;t[0]!==r||t[1]!==o.path?(c=gt(o.path),l=P,u=ye(r,c,o.path),t[0]=r,t[1]=o.path,t[2]=c,t[3]=l,t[4]=u):(c=t[2],l=t[3],u=t[4]);let d=l(u),f;t[5]===d?f=t[6]:(f=M(h(d)),t[5]=d,t[6]=f);let p=f,m=ee(r),{copyToClipboard:g}=U(),_;t[7]!==r||t[8]!==o.path?(_={environmentId:r,filePath:o.path,workspaceRoot:void 0},t[7]=r,t[8]=o.path,t[9]=_):_=t[9];let v=_,x=o.shortDescription??o.description,w;t[10]===o.scope?w=t[11]:(w=ct(o.scope),t[10]=o.scope,t[11]=w);let T=w,E;t[12]===a?E=t[13]:(E=e=>!e&&a(),t[12]=a,t[13]=E);let D;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Q.jsx)(`span`,{"aria-hidden":!0,className:`flex size-12 shrink-0 items-center justify-center rounded-full border border-border/60 text-muted-foreground`,children:(0,Q.jsx)(S,{className:`size-5`})}),t[14]=D):D=t[14];let O;t[15]===o?O=t[16]:(O=st(o),t[15]=o,t[16]=O);let k=`More for ${O}`,A;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Q.jsx)(y,{"aria-hidden":!0}),t[17]=A):A=t[17];let j;t[18]===k?j=t[19]:(j=(0,Q.jsx)(F,{render:(0,Q.jsx)(C,{size:`icon-sm`,variant:`ghost`,"aria-label":k,children:A})}),t[18]=k,t[19]=j);let L;t[20]!==m||t[21]!==v?(L=m.capabilities.canOpenDefault?(0,Q.jsx)(i,{onClick:()=>void m.activate(`open`,v),children:`Open`}):null,t[20]=m,t[21]=v,t[22]=L):L=t[22];let R;t[23]!==m||t[24]!==v?(R=m.capabilities.revealLabel?(0,Q.jsx)(i,{onClick:()=>void m.activate(`reveal-in-folder`,v),children:m.capabilities.revealLabel}):null,t[23]=m,t[24]=v,t[25]=R):R=t[25];let z=p===null,B;t[26]!==g||t[27]!==p?(B=()=>p&&g(p.contents,void 0),t[26]=g,t[27]=p,t[28]=B):B=t[28];let V;t[29]!==z||t[30]!==B?(V=(0,Q.jsx)(i,{disabled:z,onClick:B,children:`Copy Markdown`}),t[29]=z,t[30]=B,t[31]=V):V=t[31];let H;t[32]!==L||t[33]!==R||t[34]!==V?(H=(0,Q.jsxs)(N,{align:`end`,children:[L,R,V]}),t[32]=L,t[33]=R,t[34]=V,t[35]=H):H=t[35];let W;t[36]!==j||t[37]!==H?(W=(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-3 pe-8`,children:[D,(0,Q.jsxs)(b,{children:[j,H]})]}),t[36]=j,t[37]=H,t[38]=W):W=t[38];let G;t[39]===o?G=t[40]:(G=st(o),t[39]=o,t[40]=G);let K;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,Q.jsx)(`span`,{className:`font-normal text-muted-foreground`,children:`Skill`}),t[41]=K):K=t[41];let q;t[42]===G?q=t[43]:(q=(0,Q.jsxs)(ce,{children:[G,` `,K]}),t[42]=G,t[43]=q);let J;t[44]===x?J=t[45]:(J=x?(0,Q.jsx)(le,{children:x}):null,t[44]=x,t[45]=J);let te;t[46]!==q||t[47]!==J?(te=(0,Q.jsxs)(`div`,{className:`grid gap-1.5`,children:[q,J]}),t[46]=q,t[47]=J,t[48]=te):te=t[48];let ne;t[49]!==c||t[50]!==r||t[51]!==p||t[52]!==d?(ne=(0,Q.jsx)(`div`,{className:`max-h-[50vh] min-h-24 overflow-y-auto rounded-xl border border-border/60 bg-card/40 px-5 py-4`,children:p===null?d._tag===`Failure`?(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This skill's file could not be read. It may have moved since the provider last scanned it.`}):(0,Q.jsxs)(`div`,{className:`grid gap-2`,children:[(0,Q.jsx)(re,{className:`h-4 w-3/4`}),(0,Q.jsx)(re,{className:`h-4 w-full`}),(0,Q.jsx)(re,{className:`h-4 w-2/3`})]}):(0,Q.jsx)(I,{text:lt(p.contents),cwd:c,environmentId:r})}),t[49]=c,t[50]=r,t[51]=p,t[52]=d,t[53]=ne):ne=t[53];let ie;t[54]===s?ie=t[55]:(ie=s.join(`, `),t[54]=s,t[55]=ie);let ae=`Loaded by ${ie}`,oe;t[56]!==T||t[57]!==ae?(oe=[T,ae].filter(Boolean),t[56]=T,t[57]=ae,t[58]=oe):oe=t[58];let se=oe.join(` · `),fe;t[59]===se?fe=t[60]:(fe=(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:se}),t[59]=se,t[60]=fe);let pe;t[61]!==W||t[62]!==te||t[63]!==ne||t[64]!==fe?(pe=(0,Q.jsx)(ue,{className:`max-w-2xl`,children:(0,Q.jsxs)(`div`,{className:`grid min-h-0 gap-4 p-6`,children:[W,te,ne,fe]})}),t[61]=W,t[62]=te,t[63]=ne,t[64]=fe,t[65]=pe):pe=t[65];let me;return t[66]!==pe||t[67]!==E?(me=(0,Q.jsx)(de,{open:!0,onOpenChange:E,children:pe}),t[66]=pe,t[67]=E,t[68]=me):me=t[68],me}var vt={claude:`Claude`,codex:`Codex`,cursor:`Cursor`},yt={success:`bg-success`,warning:`bg-warning`,error:`bg-destructive`,muted:`bg-muted-foreground/40`},bt={success:`text-success-foreground`,warning:`text-warning-foreground`,error:`text-destructive-foreground`,muted:`text-muted-foreground`},xt=l(v);function St(e){let t=_(e);return xt(t)&&t.reason===`rejected`?`This server only lets apps it has approved sign in, and it refused P4 Code. Sign in with a provider below instead.`:`Sign-in could not start. Check the server URL, then try again.`}function Ct(e,t,n){return e.transport.type===`http`&&(e.transport.auth===`oauth`||n?.auth===`signed-in`||t.needsSignIn)}function wt(e){let t=(0,Y.c)(13),{status:n,className:r}=e,i=bt[n.tone],a;t[0]!==r||t[1]!==i?(a=j(`flex min-w-0 items-center gap-1.5 text-xs`,i,r),t[0]=r,t[1]=i,t[2]=a):a=t[2];let o=yt[n.tone],s;t[3]===o?s=t[4]:(s=j(`size-1.5 shrink-0 rounded-full`,o),t[3]=o,t[4]=s);let c;t[5]===s?c=t[6]:(c=(0,Q.jsx)(`span`,{"aria-hidden":!0,className:s}),t[5]=s,t[6]=c);let l;t[7]===n.label?l=t[8]:(l=(0,Q.jsx)(`span`,{className:`truncate`,children:n.label}),t[7]=n.label,t[8]=l);let u;return t[9]!==a||t[10]!==c||t[11]!==l?(u=(0,Q.jsxs)(`span`,{className:a,children:[c,l]}),t[9]=a,t[10]=c,t[11]=l,t[12]=u):u=t[12],u}function Tt(){let e=(0,Y.c)(6),{environment:t,scope:n}=xe(),r=t?.connection.phase===`connected`&&t.serverConfig!==null,i=r?t.environmentId:null,a=r&&t.serverConfig?.environment.capabilities.mcpRegistry===!0,o;return e[0]!==r||e[1]!==t||e[2]!==i||e[3]!==n||e[4]!==a?(o=(0,Q.jsx)(we,{width:`wide`,children:t===null||!r?(0,Q.jsx)(he,{children:(0,Q.jsxs)(fe,{children:[(0,Q.jsx)(pe,{children:`Connect to manage plugins and MCP servers`}),(0,Q.jsx)(me,{children:`They live on each environment. Choose a connected one above.`})]})}):!a||i===null?(0,Q.jsx)(he,{children:(0,Q.jsxs)(fe,{children:[(0,Q.jsxs)(pe,{children:[`Update `,t.label,` to manage plugins and MCP servers`]}),(0,Q.jsx)(me,{children:`This environment runs a version without them.`})]})}):(0,Q.jsx)(kt,{environmentId:i,environmentLabel:t.label,projectId:n.kind===`checkout`?n.checkout.id:n.kind===`project`?n.members.find(e=>e.environmentId===i)?.id:void 0,projectLabel:n.kind===`project`||n.kind===`checkout`?n.label:void 0},i)}),e[0]=r,e[1]=t,e[2]=i,e[3]=n,e[4]=a,e[5]=o):o=e[5],o}var Et={plugins:`Search plugins`,mcps:`Search MCP servers`,skills:`Search skills`},Dt=(e,...t)=>e===``||t.some(t=>t.toLowerCase().includes(e));function Ot(e){let t=(0,Y.c)(9),{text:n}=e,r=(0,X.useRef)(null),[i,a]=(0,X.useState)(!1),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=e=>{let t=r.current;a(e&&t!==null&&t.scrollWidth>t.clientWidth)},t[0]=o):o=t[0];let s;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Q.jsx)(`span`,{ref:r,tabIndex:0,className:`block truncate text-xs text-muted-foreground`}),t[1]=s):s=t[1];let c,l;t[2]===n?(c=t[3],l=t[4]):(c=(0,Q.jsx)(J,{render:s,children:n}),l=(0,Q.jsx)(te,{children:n}),t[2]=n,t[3]=c,t[4]=l);let u;return t[5]!==i||t[6]!==c||t[7]!==l?(u=(0,Q.jsxs)(ne,{open:i,onOpenChange:o,children:[c,l]}),t[5]=i,t[6]=c,t[7]=l,t[8]=u):u=t[8],u}function kt({environmentId:e,environmentLabel:t,projectId:n,projectLabel:r}){let a=H({select:e=>e.hash}),[l,u]=(0,X.useState)(()=>a.replace(/^#/,``)===`mcp-servers`?`mcps`:a.replace(/^#/,``)===`skills`?`skills`:`plugins`),[f,p]=(0,X.useState)(``),[m,h]=(0,X.useState)(`All categories`),_=P(G.configValueAtom(e))?.providers,v=(0,X.useMemo)(()=>ot(_??[]),[_]),[x,O]=(0,X.useState)(null),j=be(e=>e.mcpServers),M=be(e=>e.plugins),I=be(e=>e.projectSettingsOverrides),U=be(e=>e.skillOverrides),q=ee(e),re=P(G.updateSettings.permissionAtom(e)),[ie,se]=(0,X.useState)(null),ce=P(G.mcpRegistryTest.permissionAtom(e)),le=W(e),ue=K(G.updateSettings,{label:`update MCP registry`,reportFailure:!0}),de=K(G.mcpRegistryState,{reportFailure:!1}),fe=K(G.mcpRegistryTest,{label:`check MCP server`,reportFailure:!0}),pe=K(G.mcpRegistryOAuthStart,{label:`start MCP sign-in`,reportFailure:!0}),me=K(G.mcpRegistryOAuthSignOut,{label:`sign out of MCP server`,reportFailure:!0}),he=K(G.mcpRegistryDiscover,{reportFailure:!1}),ye=K(G.mcpRegistryImport,{label:`import MCP servers`,reportFailure:!0}),[xe,Se]=(0,X.useState)({}),[Ce,we]=(0,X.useState)(new Set),[Fe,Ie]=(0,X.useState)([]),[Y,Le]=(0,X.useState)({kind:`list`}),Z=Y.kind!==`list`&&Y.id!==null&&(Y.kind===`server`?j[Y.id]===void 0:M[Y.id]===void 0)?{kind:`list`}:Y,[Be,Ve]=(0,X.useState)(a);if(a!==Be){Ve(a);let e=a.replace(/^#/,``);(e===`mcp-servers`||e===`plugins`||e===`skills`)&&(u(e===`mcp-servers`?`mcps`:e),Le({kind:`list`}))}let[He,Ue]=(0,X.useState)(null),We=(0,X.useRef)(new Map),[Ge,Ye]=(0,X.useState)(null),[Xe,Ze]=(0,X.useState)({}),Qe=(0,X.useMemo)(()=>Object.entries(j).map(([e,t])=>[c.make(e),t]).toSorted(([,e],[,t])=>e.name.localeCompare(t.name)),[j]),$e=(0,X.useMemo)(()=>Object.entries(M).map(([e,t])=>[s.make(e),t]),[M]),et=(0,X.useCallback)(async()=>{let t=await de({environmentId:e,input:{}});t._tag===`Success`&&Se(t.value.servers)},[e,de]),tt=(0,X.useCallback)(async()=>{if(!ce)return;let t=await he({environmentId:e,input:n===void 0?{}:{projectId:n}});t._tag===`Success`&&Ie(t.value.servers)},[ce,he,e,n]);(0,X.useEffect)(()=>{et(),tt()},[et,tt]);let nt=e=>{u(`mcps`),Le({kind:`server`,id:e})},rt=e=>{u(`plugins`),Le({kind:`plugin`,id:e})},it=t=>ue({environmentId:e,input:{patch:t}}),at=async t=>{we(e=>new Set(e).add(t));let n=await fe({environmentId:e,input:{serverId:t}});if(we(e=>{let n=new Set(e);return n.delete(t),n}),n._tag===`Success`)return Se(e=>({...e,[t]:n.value})),n.value},ct=(0,X.useEffectEvent)(async e=>{(await at(e))?.health.status===`connected`&&Ye(null)});(0,X.useEffect)(()=>{if(Ge===null)return;let e=()=>void ct(Ge);return window.addEventListener(`focus`,e),()=>window.removeEventListener(`focus`,e)},[Ge]);let lt=async(e,t,n)=>{(await it({mcpServers:{[e]:t}}))._tag===`Success`&&(n&&Le({kind:`list`}),tt(),t.enabled&&await at(e))},$=async(t,n=!1)=>{let r=We.current.get(t);if(!n&&Ge===t&&r){window.open(r,`_blank`,`noopener,noreferrer`);return}let i=le??window.location.origin;Ze(e=>{let n={...e};return delete n[t],n});let a=await pe({environmentId:e,input:{serverId:t,origin:new URL(i,window.location.href).origin,...n?{reauthenticate:n}:{}}});if(a._tag!==`Success`){a._tag===`Failure`&&Ze(e=>({...e,[t]:St(a.cause)}));return}if(a.value.authorizationUrl===null){await at(t);return}We.current.set(t,a.value.authorizationUrl),Ye(t),window.open(a.value.authorizationUrl,`_blank`,`noopener,noreferrer`)},ft=async t=>{let n=await me({environmentId:e,input:{serverId:t}});n._tag===`Success`&&Se(e=>({...e,[t]:n.value}))},mt=(e,t,r)=>{if(n===void 0)return;let i=I[n]??{},a={...i[e]};r===void 0?delete a[t]:a[t]={enabled:r},it({projectSettingsOverrides:{[n]:{...i,[e]:a}}})},ht=async()=>{let t=He;if(Ue(null),t!==null){if(t.kind===`server`){let n=j[t.id];n?.transport.type===`http`&&n.transport.auth===`oauth`&&await me({environmentId:e,input:{serverId:t.id}}),await it({mcpServers:{[t.id]:null}})}else await it({plugins:{[t.id]:null}});Le({kind:`list`})}},gt=Fe.filter(e=>!e.alreadyAdded),yt=new Set(Qe.filter(([e])=>Z.kind!==`server`||e!==Z.id).map(([,e])=>e.name)),bt=f.trim().toLowerCase(),xt=Qe.filter(([,e])=>Dt(bt,e.name,ze(e))),Tt=$e.filter(([,e])=>Dt(bt,e.name,e.path)),kt=gt.filter(e=>Dt(bt,e.name,e.summary)),At=(e,t)=>T({mcpServers:j,plugins:M,projectSettingsOverrides:I},e,n??null,t),Mt=(e,t,r)=>{if(n!==void 0){mt(e,t,r);return}it(e===`mcpServers`?{mcpServers:{[t]:{...j[t],enabled:r}}}:{plugins:{[t]:{...M[t],enabled:r}}})},Nt=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,Q.jsxs)(`div`,{className:`grid gap-1`,children:[(0,Q.jsx)(`h1`,{className:`text-2xl font-semibold text-foreground`,children:`Plugins`}),(0,Q.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Manage plugins, skills, and MCP servers given to agents on `,t,`.`]})]}),ce?(0,Q.jsxs)(b,{children:[(0,Q.jsx)(F,{render:(0,Q.jsxs)(C,{children:[`Add`,(0,Q.jsx)(o,{"aria-hidden":!0})]})}),(0,Q.jsxs)(N,{align:`end`,children:[(0,Q.jsxs)(i,{onClick:()=>nt(null),children:[(0,Q.jsx)(d,{"aria-hidden":!0}),`Add MCP server`]}),(0,Q.jsxs)(i,{onClick:()=>rt(null),children:[(0,Q.jsx)(g,{"aria-hidden":!0}),`Add plugin`]})]})]}):null]}),Pt=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,Q.jsxs)(ae,{"aria-label":`Show`,variant:`default`,value:[l],onValueChange:e=>{let t=e[0];(t===`plugins`||t===`mcps`||t===`skills`)&&(u(t),Le({kind:`list`}))},children:[(0,Q.jsxs)(oe,{value:`plugins`,...Me(`plugins`),children:[`Plugins `,(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:$e.length})]}),(0,Q.jsxs)(oe,{value:`mcps`,...Me(`mcp-servers`),children:[`MCPs `,(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:Qe.length})]}),(0,Q.jsxs)(oe,{value:`skills`,...Me(`skills`),children:[`Skills `,(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:v.length})]})]}),(0,Q.jsxs)(`div`,{className:`flex w-full gap-2 sm:w-auto`,children:[l===`skills`?(0,Q.jsx)(`div`,{className:`w-fit shrink-0`,children:(0,Q.jsxs)(V,{value:m,onValueChange:e=>e&&h(e),children:[(0,Q.jsx)(B,{"aria-label":`Skill category`,children:(0,Q.jsx)(R,{})}),(0,Q.jsxs)(z,{children:[(0,Q.jsx)(L,{value:`All categories`,children:`All categories`}),qe.filter(e=>e===`Personal`||e===`Built-in`||v.some(({skill:t})=>Je(t)===e)).map(e=>(0,Q.jsx)(L,{value:e,children:e},e))]})]})}):null,(0,Q.jsxs)(ve,{className:`min-w-0 flex-1 sm:w-56`,children:[(0,Q.jsx)(ge,{children:(0,Q.jsx)(D,{"aria-hidden":!0})}),(0,Q.jsx)(_e,{"aria-label":Et[l],placeholder:Et[l],value:f,onChange:e=>p(e.currentTarget.value)})]})]})]}),Ft=(e,t)=>(0,Q.jsxs)(ne,{children:[(0,Q.jsx)(J,{render:(0,Q.jsx)(C,{size:`icon-sm`,variant:`ghost`,"aria-label":e,onClick:t,children:(0,Q.jsx)(k,{"aria-hidden":!0})})}),(0,Q.jsx)(te,{children:e})]}),It=Tt.length===0?(0,Q.jsx)(`p`,{className:`py-6 text-sm text-muted-foreground`,children:$e.length===0?`No plugins yet. Add a Claude Code or Codex plugin folder to give its tools to your agents.`:`No plugins match your search.`}):(0,Q.jsx)(`ul`,{className:`grid gap-1`,children:Tt.map(([t,n])=>(0,Q.jsx)(Ke,{environmentId:e,plugin:n,enabled:At(`plugins`,t),disabled:!re,onDetails:()=>rt(t),onToggle:e=>Mt(`plugins`,t,e)},t))}),Lt=v.filter(({skill:e})=>(m===`All categories`||Je(e)===m)&&Dt(bt,st(e),e.name,e.shortDescription??``,e.description??``)),Rt=Lt.length===0?(0,Q.jsx)(`p`,{className:`py-6 text-sm text-muted-foreground`,children:v.length===0?`No skills found. Providers report the skills they load when they start.`:`No skills match these filters.`}):(0,Q.jsxs)(`div`,{className:`grid gap-3`,children:[(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Switches apply to new Claude and OpenCode sessions.`}),(0,Q.jsx)(`ul`,{className:`grid gap-1`,children:Lt.map(t=>{let r=Je(t.skill),a=(_??[]).filter(e=>w(e.driver)&&e.skills.some(e=>e.name===t.skill.name)),o=a.length?a.map(e=>e.displayName??e.driver).join(`, `):`Native settings`;return(0,Q.jsxs)(`li`,{className:`flex items-center gap-3 py-3`,children:[(0,Q.jsx)(`span`,{"aria-hidden":!0,className:`flex size-10 shrink-0 items-center justify-center rounded-full border border-border/60 text-muted-foreground`,children:(0,Q.jsx)(S,{className:`size-4`})}),(0,Q.jsxs)(`div`,{className:`grid min-w-0 flex-1 gap-1`,children:[(0,Q.jsx)(`button`,{type:`button`,onClick:()=>O(t),className:`w-fit break-words text-left text-sm font-medium outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,children:st(t.skill)}),(0,Q.jsx)(Ot,{text:t.skill.shortDescription??t.skill.description??t.skill.path}),(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:[r,o].filter(Boolean).join(` · `)})]}),(0,Q.jsxs)(b,{children:[(0,Q.jsxs)(ne,{children:[(0,Q.jsx)(J,{render:(0,Q.jsx)(F,{render:(0,Q.jsx)(C,{variant:`ghost`,size:`icon-sm`,"aria-label":`More for ${st(t.skill)}`,children:(0,Q.jsx)(y,{"aria-hidden":!0})})})}),(0,Q.jsx)(te,{children:`Skill actions`})]}),(0,Q.jsxs)(N,{align:`end`,children:[q.capabilities.canOpenDefault?(0,Q.jsx)(i,{onClick:()=>void q.activate(`open`,{environmentId:e,filePath:t.skill.path,workspaceRoot:void 0}),children:`Open`}):null,(0,Q.jsx)(i,{onClick:()=>O(t),children:`Details`}),n!==void 0&&I[n]?.skillOverrides?.[t.skill.name]!==void 0?(0,Q.jsx)(i,{onClick:()=>{let e=I[n]??{},r={...e.skillOverrides};delete r[t.skill.name],it({projectSettingsOverrides:{[n]:{...e,skillOverrides:r}}})},children:`Use environment setting`}):null]})]}),(0,Q.jsx)(Pe,{"aria-label":`Enable ${st(t.skill)} for ${o}`,checked:(n===void 0?void 0:I[n]?.skillOverrides?.[t.skill.name])??U[t.skill.name]??t.skill.enabled,disabled:!re||ie!==null||a.length===0,onCheckedChange:e=>{se(t.skill.name),it(n===void 0?{skillOverrides:{[t.skill.name]:e}}:{projectSettingsOverrides:{[n]:{...I[n],skillOverrides:{...I[n]?.skillOverrides,[t.skill.name]:e}}}}).finally(()=>se(null))}})]},t.skill.path)})})]}),Bt=(0,Q.jsxs)(`div`,{className:`grid gap-6`,children:[Qe.length>0?(0,Q.jsx)(Te,{title:`Servers`,children:xt.length===0?(0,Q.jsx)(`p`,{className:`px-3 text-sm text-muted-foreground sm:px-4`,children:`No MCP servers match your search.`}):(0,Q.jsx)(Q.Fragment,{children:xt.map(([e,t])=>{let n=At(`mcpServers`,e),r=Re({...t,enabled:n},xe[e],Ce.has(e)),a=Xe[e],o=Ct(t,r,xe[e]);return(0,Q.jsxs)(`div`,{className:`flex min-h-14 items-center gap-3 px-4 py-3`,children:[(0,Q.jsxs)(`div`,{className:`grid min-w-0 flex-1 gap-0.5`,children:[(0,Q.jsx)(`span`,{className:`break-words text-sm font-medium text-foreground`,children:t.name}),r.tone===`error`||o?(0,Q.jsx)(wt,{status:r}):null,a?(0,Q.jsx)(`span`,{className:`text-xs text-destructive-foreground`,children:a}):null]}),r.needsSignIn&&ce?(0,Q.jsx)(C,{size:`xs`,variant:`outline`,onClick:()=>void $(e),children:`Authenticate`}):null,o&&!r.needsSignIn&&ce?(0,Q.jsxs)(b,{children:[(0,Q.jsxs)(ne,{children:[(0,Q.jsx)(J,{render:(0,Q.jsx)(F,{render:(0,Q.jsx)(C,{variant:`ghost`,size:`icon-sm`,"aria-label":`More for ${t.name}`,children:(0,Q.jsx)(y,{"aria-hidden":!0})})})}),(0,Q.jsx)(te,{children:`Sign-in actions`})]}),(0,Q.jsxs)(N,{align:`end`,children:[(0,Q.jsx)(i,{onClick:()=>void $(e,!0),children:`Re-authenticate`}),xe[e]?.auth===`signed-in`?(0,Q.jsx)(i,{onClick:()=>void ft(e),children:`Sign out`}):null]})]}):null,Ft(`Settings for ${t.name}`,()=>nt(e)),(0,Q.jsx)(Pe,{"aria-label":`Give ${t.name} to agents`,checked:n,disabled:!ce,onCheckedChange:t=>Mt(`mcpServers`,e,t)})]},e)})})}):null,ce&&kt.length>0?(0,Q.jsx)(Te,{title:`Found in provider configs`,headerAction:(0,Q.jsx)(C,{size:`icon-xs`,variant:`ghost`,"aria-label":`Look again`,onClick:()=>void tt(),children:(0,Q.jsx)(A,{"aria-hidden":!0})}),children:(0,Q.jsx)(Q.Fragment,{children:kt.map(t=>(0,Q.jsxs)(`div`,{className:`flex min-h-14 items-center gap-3 px-4 py-3`,children:[(0,Q.jsxs)(`div`,{className:`grid min-w-0 flex-1 gap-0.5`,children:[(0,Q.jsx)(`span`,{className:`break-words text-sm font-medium text-foreground`,children:t.name}),kt.filter(e=>e.name===t.name).length>1?(0,Q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:(t.providers??[t.provider]).map(e=>vt[e]).join(`, `)}):null]}),(0,Q.jsx)(C,{size:`xs`,variant:`outline`,onClick:async()=>{(await ye({environmentId:e,input:{...n===void 0?{}:{projectId:n},servers:[{provider:t.provider,path:t.path,name:t.name}]}}))._tag===`Success`&&(tt(),et())},children:`Import`})]},`${t.provider}:${t.path}:${t.name}`))})}):null]}),Vt=Z.kind===`server`?(0,Q.jsxs)(ut,{title:Z.id===null?`Add MCP server`:`Update ${j[Z.id]?.name??`server`} MCP`,onBack:()=>Le({kind:`list`}),onUninstall:Z.id!==null&&ce?()=>Ue({kind:`server`,id:Z.id}):void 0,children:[(0,Q.jsx)(dt,{server:Z.id===null?void 0:j[Z.id],takenNames:yt,onSave:e=>void lt(Z.id??c.make(E()),e,Z.id===null)},Z.id??`new`),Z.id!==null&&j[Z.id]!==void 0?(0,Q.jsx)(jt,{environmentId:e,id:Z.id,server:j[Z.id],runtime:xe[Z.id],checking:Ce.has(Z.id),canManage:ce,projectLabel:r,projectOverride:n===void 0?void 0:I[n]?.mcpServers?.[Z.id],awaitingSignIn:Ge===Z.id,onProviderToggle:(e,t)=>{let n=j[Z.id],r=t?n.disabledProviders.filter(t=>t!==e):[...n.disabledProviders,e];it({mcpServers:{[Z.id]:{...n,disabledProviders:r}}})},onProjectOverride:n===void 0?void 0:e=>mt(`mcpServers`,Z.id,e),signInError:Xe[Z.id],onTest:()=>void at(Z.id),onSignIn:()=>void $(Z.id),onReauthenticate:()=>void $(Z.id,!0),onSignOut:()=>void ft(Z.id)},`${e}:${Z.id}`):null]}):null,Ht=Z.kind===`plugin`?(0,Q.jsxs)(ut,{title:Z.id===null?`Add plugin`:`Update ${M[Z.id]?.name??`plugin`}`,onBack:()=>Le({kind:`list`}),onUninstall:Z.id!==null&&ce?()=>Ue({kind:`plugin`,id:Z.id}):void 0,children:[(0,Q.jsx)(pt,{environmentId:e,plugin:Z.id===null?void 0:M[Z.id],environmentLabel:t,onSave:async e=>{let t=Z.id??s.make(E());(await it({plugins:{[t]:e}}))._tag===`Success`&&Z.id===null&&Le({kind:`list`})}},Z.id??`new`),Z.id!==null&&M[Z.id]!==void 0?(0,Q.jsx)(zt,{plugin:M[Z.id],projectLabel:r,projectOverride:n===void 0?void 0:I[n]?.plugins?.[Z.id],onProjectOverride:n===void 0?void 0:e=>mt(`plugins`,Z.id,e)}):null]}):null;return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`grid gap-6`,children:[Nt,Pt,Vt??Ht??(l===`plugins`?It:l===`mcps`?Bt:Rt)]}),x===null?null:(0,Q.jsx)(_t,{entry:x,environmentId:e,onClose:()=>O(null)}),(0,Q.jsx)(Ee,{open:He!==null,onOpenChange:e=>!e&&Ue(null),children:(0,Q.jsxs)(De,{children:[(0,Q.jsxs)(je,{children:[(0,Q.jsxs)(Oe,{children:[`Remove`,` `,He?.kind===`server`?j[He.id]?.name??`server`:He?.kind===`plugin`?M[He.id]?.name??`plugin`:``,`?`]}),(0,Q.jsxs)(ke,{children:[`New sessions on `,t,` stop getting it. Its stored values and sign-in are deleted. Provider config files are not changed.`]})]}),(0,Q.jsxs)(Ae,{children:[(0,Q.jsx)(Ne,{render:(0,Q.jsx)(C,{variant:`outline`,children:`Cancel`})}),(0,Q.jsx)(C,{variant:`destructive`,onClick:()=>void ht(),children:`Remove`})]})]})})]})}function At(e){let t=(0,Y.c)(16),{projectLabel:n,override:r,inherited:i,onChange:a}=e,o=r?.enabled!==void 0,s=`In ${n}`,c=o?`Set for this project.`:`Follows the environment (${i?`on`:`off`}).`,l;t[0]!==a||t[1]!==o?(l=o?(0,Q.jsx)(C,{size:`xs`,variant:`ghost`,onClick:()=>a(void 0),children:`Reset`}):null,t[0]=a,t[1]=o,t[2]=l):l=t[2];let u=`Use in ${n}`,d=r?.enabled??i,f;t[3]===a?f=t[4]:(f=e=>a(e),t[3]=a,t[4]=f);let p;t[5]!==u||t[6]!==d||t[7]!==f?(p=(0,Q.jsx)(Pe,{"aria-label":u,checked:d,onCheckedChange:f}),t[5]=u,t[6]=d,t[7]=f,t[8]=p):p=t[8];let m;t[9]!==l||t[10]!==p?(m=(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[l,p]}),t[9]=l,t[10]=p,t[11]=m):m=t[11];let h;return t[12]!==s||t[13]!==c||t[14]!==m?(h=(0,Q.jsx)(Ce,{title:s,description:c,control:m}),t[12]=s,t[13]=c,t[14]=m,t[15]=h):h=t[15],h}function jt(e){let t=(0,Y.c)(108),{environmentId:n,id:r,server:i,runtime:a,checking:o,canManage:s,projectLabel:c,projectOverride:l,awaitingSignIn:d,signInError:f,onProviderToggle:p,onProjectOverride:m,onTest:h,onSignIn:g,onReauthenticate:_,onSignOut:v}=e,y=s&&i.transport.type===`http`&&i.transport.auth===`oauth`&&a?.auth===`signed-out`,b=Ft(n,r,y),x=b.entries,S;t[0]!==o||t[1]!==a||t[2]!==i?(S=Re(i,a,o),t[0]=o,t[1]=a,t[2]=i,t[3]=S):S=t[3];let w=S,T;t[4]===x?T=t[5]:(T=x?.filter(Nt).length??0,t[4]=x,t[5]=T);let E=T,D;t[6]!==w||t[7]!==E||t[8]!==x||t[9]!==y?(D=y?{...w,tone:`muted`,label:x===null?`Checking providers…`:E>0?`Available to ${E} ${E===1?`provider`:`providers`}`:`No providers connected`}:w,t[6]=w,t[7]=E,t[8]=x,t[9]=y,t[10]=D):D=t[10];let O=D,k,A,j,M,N,P,F;if(t[11]!==d||t[12]!==s||t[13]!==o||t[14]!==x||t[15]!==r||t[16]!==p||t[17]!==_||t[18]!==g||t[19]!==v||t[20]!==h||t[21]!==a?.auth||t[22]!==i||t[23]!==f||t[24]!==b||t[25]!==O||t[26]!==y){let e;t[34]===x?e=t[35]:(e=e=>({...e,badge:x===null||e.unsupported!==void 0?void 0:$e(e.driver,x)}),t[34]=x,t[35]=e);let n=et(i).map(e),c=i.transport.type===`http`&&a?.auth===`signed-in`,l=f??O.detail;N=`grid gap-6`,P=r;let m;t[36]===O?m=t[37]:(m=(0,Q.jsx)(wt,{status:O,className:`flex-1 text-sm`}),t[36]=O,t[37]=m);let S;t[38]!==d||t[39]!==s||t[40]!==g||t[41]!==O.needsSignIn||t[42]!==y?(S=O.needsSignIn&&s&&!y?(0,Q.jsx)(C,{size:`xs`,onClick:g,children:d?`Open sign-in again`:`Authenticate`}):null,t[38]=d,t[39]=s,t[40]=g,t[41]=O.needsSignIn,t[42]=y,t[43]=S):S=t[43];let w;t[44]!==s||t[45]!==_||t[46]!==c||t[47]!==O.needsSignIn?(w=c&&!O.needsSignIn&&s?(0,Q.jsx)(C,{size:`xs`,variant:`outline`,onClick:_,children:`Re-authenticate`}):null,t[44]=s,t[45]=_,t[46]=c,t[47]=O.needsSignIn,t[48]=w):w=t[48];let T;t[49]!==s||t[50]!==v||t[51]!==c?(T=c&&s?(0,Q.jsx)(C,{size:`xs`,variant:`ghost`,onClick:v,children:`Sign out`}):null,t[49]=s,t[50]=v,t[51]=c,t[52]=T):T=t[52];let E;t[53]!==s||t[54]!==o||t[55]!==h||t[56]!==i.enabled?(E=s&&i.enabled?(0,Q.jsx)(C,{size:`xs`,variant:`outline`,disabled:o,onClick:h,children:`Test connection`}):null,t[53]=s,t[54]=o,t[55]=h,t[56]=i.enabled,t[57]=E):E=t[57];let D;t[58]!==m||t[59]!==S||t[60]!==w||t[61]!==T||t[62]!==E?(D=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[m,S,w,T,E]}),t[58]=m,t[59]=S,t[60]=w,t[61]=T,t[62]=E,t[63]=D):D=t[63];let I;t[64]!==d||t[65]!==O.needsSignIn||t[66]!==y?(I=O.needsSignIn&&!y?(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:d?`Finish signing in in your browser, then come back here.`:y?`Sign in here to give it to every provider.`:`Agents can't reach this server until you sign in.`}):null,t[64]=d,t[65]=O.needsSignIn,t[66]=y,t[67]=I):I=t[67];let L;t[68]!==l||t[69]!==y?(L=l&&!y?(0,Q.jsx)(`p`,{className:`rounded-md bg-destructive/8 px-2.5 py-1.5 text-xs text-destructive-foreground`,children:l}):null,t[68]=l,t[69]=y,t[70]=L):L=t[70];let R;t[71]!==d||t[72]!==l||t[73]!==g||t[74]!==y?(R=y?(0,Q.jsxs)(`details`,{className:`text-xs text-muted-foreground`,children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer`,children:l?`Shared sign-in unavailable`:`Shared sign-in`}),(0,Q.jsxs)(`div`,{className:`grid gap-2 pt-2`,children:[(0,Q.jsx)(`p`,{children:l??`Sign in through P4 Code to share access with every enabled provider.`}),(0,Q.jsx)(`div`,{children:(0,Q.jsx)(C,{size:`xs`,variant:`outline`,onClick:g,children:d?`Open browser`:l?`Retry shared sign-in`:`Sign in through P4 Code`})})]})]}):null,t[71]=d,t[72]=l,t[73]=g,t[74]=y,t[75]=R):R=t[75];let z;t[76]===i.source?z=t[77]:(z=i.source?(0,Q.jsxs)(`details`,{className:`text-xs text-muted-foreground`,children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer`,children:`Import source`}),(0,Q.jsx)(`p`,{className:`break-all pt-2`,children:i.source.path})]}):null,t[76]=i.source,t[77]=z);let B=y?(0,Q.jsx)(Lt,{serverName:i.name,signIns:b,blocked:n.filter(Mt).length}):null;t[78]!==D||t[79]!==I||t[80]!==L||t[81]!==R||t[82]!==z||t[83]!==B?(F=(0,Q.jsx)(Te,{title:`Status`,children:(0,Q.jsx)(Se,{children:(0,Q.jsxs)(`div`,{className:`grid gap-2 px-4 py-3`,children:[D,I,L,R,z,B]})})}),t[78]=D,t[79]=I,t[80]=L,t[81]=R,t[82]=z,t[83]=B,t[84]=F):F=t[84],A=Te,M=`Providers`,k=Se;let V;t[85]!==s||t[86]!==p||t[87]!==i.name?(V=e=>(0,Q.jsx)(Ce,{title:e.label,...e.unsupported===void 0?{}:{description:e.unsupported},control:(0,Q.jsxs)(`div`,{className:`flex items-center gap-3`,children:[e.badge===void 0?null:(0,Q.jsx)(u,{variant:Rt[e.badge].variant,children:Rt[e.badge].label}),(0,Q.jsx)(Pe,{"aria-label":`Give ${i.name} to ${e.label}`,checked:e.enabled&&e.badge!==`unavailable`,disabled:!s||e.unsupported!==void 0||e.badge===`unavailable`,onCheckedChange:t=>p(e.driver,t)})]})},e.driver),t[85]=s,t[86]=p,t[87]=i.name,t[88]=V):V=t[88],j=n.map(V),t[11]=d,t[12]=s,t[13]=o,t[14]=x,t[15]=r,t[16]=p,t[17]=_,t[18]=g,t[19]=v,t[20]=h,t[21]=a?.auth,t[22]=i,t[23]=f,t[24]=b,t[25]=O,t[26]=y,t[27]=k,t[28]=A,t[29]=j,t[30]=M,t[31]=N,t[32]=P,t[33]=F}else k=t[27],A=t[28],j=t[29],M=t[30],N=t[31],P=t[32],F=t[33];let I;t[89]!==k||t[90]!==j?(I=(0,Q.jsx)(k,{children:j}),t[89]=k,t[90]=j,t[91]=I):I=t[91];let L;t[92]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Q.jsx)(`p`,{className:`px-3 text-xs text-muted-foreground sm:px-4`,children:`A change reaches a thread when its provider session next starts.`}),t[92]=L):L=t[92];let R;t[93]!==A||t[94]!==M||t[95]!==I?(R=(0,Q.jsxs)(A,{title:M,children:[I,L]}),t[93]=A,t[94]=M,t[95]=I,t[96]=R):R=t[96];let z;t[97]!==m||t[98]!==c||t[99]!==l||t[100]!==i.enabled?(z=c!==void 0&&m!==void 0?(0,Q.jsx)(Te,{title:`Project`,children:(0,Q.jsx)(Se,{children:(0,Q.jsx)(At,{projectLabel:c,override:l,inherited:i.enabled,onChange:m})})}):null,t[97]=m,t[98]=c,t[99]=l,t[100]=i.enabled,t[101]=z):z=t[101];let B;return t[102]!==R||t[103]!==z||t[104]!==N||t[105]!==P||t[106]!==F?(B=(0,Q.jsxs)(`div`,{className:N,"data-server-id":P,children:[F,R,z]}),t[102]=R,t[103]=z,t[104]=N,t[105]=P,t[106]=F,t[107]=B):B=t[107],B}function Mt(e){return e.enabled&&e.badge===`unavailable`}function Nt(e){return e.status===`signed-in`}function Pt(e){let t=_(e);return xt(t)&&t.detail!==void 0?t.detail:`Sign-in could not start. Try again.`}function Ft(e,t,n){let r=K(G.mcpRegistryProviderSignInState,{reportFailure:!1}),i=K(G.mcpRegistryProviderSignInStart,{reportFailure:!1}),a=K(G.mcpRegistryProviderSignInWait,{reportFailure:!1}),o=K(G.mcpRegistryProviderSignInComplete,{reportFailure:!1}),s=K(G.mcpRegistryProviderSignInCancel,{reportFailure:!1}),c=K(G.mcpRegistryProviderSignOut,{reportFailure:!1}),l=P(G.mcpRegistryProviderSignInComplete.permissionAtom(e)),u=P(G.mcpRegistryProviderSignInCancel.permissionAtom(e)),[d,f]=(0,X.useState)(null),[p,m]=(0,X.useState)({}),[h,g]=(0,X.useState)(new Set),_=(0,X.useRef)(new Set),v=e=>f(t=>t?.map(t=>t.instanceId===e.instanceId?e:t)??null),y=(e,t)=>m(n=>{let r={...n};return t===void 0?delete r[e]:r[e]=t,r});return(0,X.useEffect)(()=>{if(!n)return;let i=!1;return r({environmentId:e,input:{serverId:t}}).then(e=>{i||f(e._tag===`Success`?e.value.providers:[])}),()=>{i=!0}},[n,e,r,t]),(0,X.useEffect)(()=>{if(!n)return;let r=!1;for(let n of d??[]){let i=n.pending;i&&a({environmentId:e,input:{serverId:t,instanceId:n.instanceId,flowId:i.flowId}}).then(e=>{r||(f(t=>t?.map(t=>{if(t.instanceId!==n.instanceId||t.pending?.flowId!==i.flowId)return t;if(e._tag===`Success`)return e.value;let{pending:r,...a}=t;return a})??null),e._tag===`Failure`?y(n.instanceId,Pt(e.cause)):e._tag===`Success`&&e.value.status!==`signed-in`&&!_.current.has(n.instanceId)&&y(n.instanceId,`Sign-in ended without connecting. Try again.`))})}return()=>{r=!0}},[n,d,e,t,a]),{entries:n?d:null,errors:p,busy:h,run:async(n,r,a)=>{if(!_.current.has(n.instanceId)){_.current.add(n.instanceId),g(new Set(_.current)),y(n.instanceId,void 0);try{let l={serverId:t,instanceId:n.instanceId};if(r===`start`){let t=await i({environmentId:e,input:l});t._tag===`Success`?(v({...n,pending:t.value}),window.open(t.value.authorizationUrl,`_blank`,`noopener,noreferrer`)):t._tag===`Failure`&&y(n.instanceId,Pt(t.cause));return}let u={...l,flowId:n.pending?.flowId??``},d=r===`complete`?await o({environmentId:e,input:{...u,callbackUrl:a.trim()}}):r===`cancel`?await s({environmentId:e,input:u}):await c({environmentId:e,input:l});d._tag===`Success`?v(d.value):d._tag===`Failure`&&y(n.instanceId,Pt(d.cause))}finally{_.current.delete(n.instanceId),g(new Set(_.current))}}},canComplete:l,canCancel:u}}function It(e){let t=(0,Y.c)(39),{entry:n,signIns:r}=e,i;t[0]!==n.displayName||t[1]!==n.driver?(i=n.displayName??Ze(n.driver),t[0]=n.displayName,t[1]=n.driver,t[2]=i):i=t[2];let a=i,[o,s]=(0,X.useState)(``),c=n.pending,l;t[3]!==n.instanceId||t[4]!==r.busy?(l=r.busy.has(n.instanceId),t[3]=n.instanceId,t[4]=r.busy,t[5]=l):l=t[5];let u=l,d=r.errors[n.instanceId],f=`mcp-callback-${n.instanceId}`,p;t[6]===a?p=t[7]:(p=(0,Q.jsx)(`p`,{className:`text-sm font-medium`,children:a}),t[6]=a,t[7]=p);let m=c?`text-warning-foreground`:n.status===`signed-in`?`text-success-foreground`:`text-muted-foreground`,h;t[8]===m?h=t[9]:(h=j(`text-xs`,m),t[8]=m,t[9]=h);let g;t[10]!==n.status||t[11]!==c?(g=c?`Waiting for sign-in`:Qe(n.status),t[10]=n.status,t[11]=c,t[12]=g):g=t[12];let _;t[13]!==h||t[14]!==g?(_=(0,Q.jsx)(`p`,{className:h,role:`status`,children:g}),t[13]=h,t[14]=g,t[15]=_):_=t[15];let v;t[16]!==p||t[17]!==_?(v=(0,Q.jsxs)(`div`,{className:`grid gap-1`,children:[p,_]}),t[16]=p,t[17]=_,t[18]=v):v=t[18];let y;t[19]!==u||t[20]!==n||t[21]!==d||t[22]!==c||t[23]!==r?(y=!c&&n.status!==`unavailable`?(0,Q.jsx)(C,{size:`xs`,variant:n.status===`signed-in`?`outline`:`default`,disabled:u,onClick:()=>void r.run(n,n.status===`signed-in`?`signOut`:`start`),children:u?`Please wait…`:n.status===`signed-in`?`Sign out`:d?`Start over`:`Sign in`}):null,t[19]=u,t[20]=n,t[21]=d,t[22]=c,t[23]=r,t[24]=y):y=t[24];let b;t[25]!==v||t[26]!==y?(b=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[v,y]}),t[25]=v,t[26]=y,t[27]=b):b=t[27];let x;t[28]!==u||t[29]!==o||t[30]!==n||t[31]!==d||t[32]!==f||t[33]!==c||t[34]!==r?(x=c?(0,Q.jsxs)(`form`,{className:`grid gap-2`,onSubmit:e=>{e.preventDefault(),o.trim()&&!u&&r.canComplete&&r.run(n,`complete`,o)},children:[(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Approve in your browser. If it ends on a callback URL, paste that URL here.`}),(0,Q.jsx)(`label`,{htmlFor:f,className:`text-xs font-medium`,children:`Callback URL`}),(0,Q.jsx)(se,{id:f,value:o,onChange:e=>s(e.target.value),placeholder:`http://localhost:…/callback?code=…&state=…`,autoComplete:`off`,spellCheck:!1,disabled:u||!r.canComplete,"aria-invalid":!!d,"aria-describedby":d?`${f}-error`:void 0}),d?(0,Q.jsx)(`p`,{id:`${f}-error`,role:`alert`,className:`text-xs text-destructive-foreground`,children:d}):null,(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Q.jsx)(C,{type:`submit`,size:`xs`,disabled:u||!o.trim()||!r.canComplete,children:u?`Please wait…`:`Finish sign-in`}),(0,Q.jsx)(C,{type:`button`,size:`xs`,variant:`outline`,disabled:u,onClick:()=>window.open(c.authorizationUrl,`_blank`,`noopener,noreferrer`),children:`Open browser`}),(0,Q.jsx)(C,{type:`button`,size:`xs`,variant:`ghost`,disabled:u||!r.canCancel,onClick:()=>void r.run(n,`cancel`),children:`Cancel`})]})]}):d?(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive-foreground`,children:d}):null,t[28]=u,t[29]=o,t[30]=n,t[31]=d,t[32]=f,t[33]=c,t[34]=r,t[35]=x):x=t[35];let S;return t[36]!==b||t[37]!==x?(S=(0,Q.jsxs)(`div`,{className:`grid gap-2 border-t border-border pt-3`,children:[b,x]}),t[36]=b,t[37]=x,t[38]=S):S=t[38],S}function Lt(e){let t=(0,Y.c)(8),{serverName:n,signIns:r,blocked:i}=e,a;t[0]===r?a=t[1]:(a=r.entries===null?(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Checking providers…`}):r.entries.length===0?(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No enabled provider here can sign in to MCP servers itself.`}):r.entries.map(e=>(0,Q.jsx)(It,{entry:e,signIns:r},`${e.instanceId}:${e.pending?.flowId??`idle`}`)),t[0]=r,t[1]=a);let o;t[2]!==i||t[3]!==n?(o=i>0?(0,Q.jsxs)(`details`,{className:`text-xs text-muted-foreground`,children:[(0,Q.jsxs)(`summary`,{className:`cursor-pointer`,children:[i,` other `,i===1?`provider`:`providers`,` unavailable`]}),(0,Q.jsxs)(`p`,{className:`pt-2`,children:[`These providers need shared sign-in to use `,n,`.`]})]}):null,t[2]=i,t[3]=n,t[4]=o):o=t[4];let s;return t[5]!==a||t[6]!==o?(s=(0,Q.jsxs)(`div`,{className:`grid gap-3`,children:[a,o]}),t[5]=a,t[6]=o,t[7]=s):s=t[7],s}var Rt={"signed-in":{variant:`success`,label:`Signed in`},"needs-sign-in":{variant:`warning`,label:`Sign in needed`},unavailable:{variant:`secondary`,label:`Unavailable`}};function zt(e){let t=(0,Y.c)(7),{plugin:n,projectLabel:r,projectOverride:i,onProjectOverride:a}=e,o;t[0]!==a||t[1]!==n||t[2]!==r||t[3]!==i?(o=r!==void 0&&a!==void 0?(0,Q.jsx)(Te,{title:`Project`,children:(0,Q.jsx)(Se,{children:(0,Q.jsx)(At,{projectLabel:r,override:i,inherited:n.enabled,onChange:a})})}):null,t[0]=a,t[1]=n,t[2]=r,t[3]=i,t[4]=o):o=t[4];let s;return t[5]===o?s=t[6]:(s=(0,Q.jsx)(`div`,{className:`grid gap-6`,children:o}),t[5]=o,t[6]=s),s}var Bt=Tt;export{Bt as component};
5
+ //# sourceMappingURL=settings.plugins-DfM65Xio.js.map