@p4code/cli 0.9.5 → 0.9.6

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 (264) hide show
  1. package/dist/bin.mjs +1 -1
  2. package/dist/{binCli-CVJEJMnj.mjs → binCli-0A0KffG3.mjs} +62396 -60542
  3. package/dist/client/.vite/manifest.json +2002 -2002
  4. package/dist/client/assets/{2NI2N5EU-B7VyxMN2.js → 2NI2N5EU-BEr-Tfqs.js} +2 -2
  5. package/dist/client/assets/{4UO7MD6I-_i-iLqe4.js → 4UO7MD6I-z55jzCJI.js} +2 -2
  6. package/dist/client/assets/{5B3SVYGG-CARRzQXp.js → 5B3SVYGG-BFexm37i.js} +2 -2
  7. package/dist/client/assets/{5GK6JWQ2-Bmp0940o.js → 5GK6JWQ2-Bn_JiXgJ.js} +2 -2
  8. package/dist/client/assets/{5N7A7DKN-Vb8SXW7T.js → 5N7A7DKN-Duo22cWA.js} +2 -2
  9. package/dist/client/assets/{5OC2THR4-y3jeEKWa.js → 5OC2THR4-DidiZL1J.js} +2 -2
  10. package/dist/client/assets/{5S6HY5KT-Bfbcbcrn.js → 5S6HY5KT-DQ4fJlKq.js} +2 -2
  11. package/dist/client/assets/{6IMQ5BUJ-DALpMJ8I.js → 6IMQ5BUJ-JMPhBK1B.js} +2 -2
  12. package/dist/client/assets/{6OLKWJ4F-yeoADL6U.js → 6OLKWJ4F-CpaocvvP.js} +2 -2
  13. package/dist/client/assets/{74OO7NKP-BSRT49ed.js → 74OO7NKP-Btg8U3A7.js} +2 -2
  14. package/dist/client/assets/{75O6YZUN-DMpxNGcI.js → 75O6YZUN-BVcu_3G6.js} +2 -2
  15. package/dist/client/assets/{77XECAW3-Cn248Dt-.js → 77XECAW3-B2dqs2a0.js} +2 -2
  16. package/dist/client/assets/{ABYRPUBD-Cv-xq6SK.js → ABYRPUBD-csm8mwzG.js} +2 -2
  17. package/dist/client/assets/AlertDialogRoot-zitC_5YS.js +2 -0
  18. package/dist/client/assets/{AnimatedHeight-CqEEdPxS.js → AnimatedHeight-CU3C1NcV.js} +2 -2
  19. package/dist/client/assets/{AuthSurfaceShell-8r4Oh4o8.js → AuthSurfaceShell-DT2jFrxd.js} +2 -2
  20. package/dist/client/assets/{BB2UYUI2-CI5XHuPZ.js → BB2UYUI2-CrLDpD9c.js} +2 -2
  21. package/dist/client/assets/{BUM34MOA-BfLbkDc3.js → BUM34MOA-DGaisF3P.js} +2 -2
  22. package/dist/client/assets/{CEQABKGZ-DpqVSfdQ.js → CEQABKGZ-BHUFEz8L.js} +2 -2
  23. package/dist/client/assets/{CXAC5362-C31Wqp-g.js → CXAC5362-CF0Q8UlN.js} +2 -2
  24. package/dist/client/assets/{ChatGptUsageButton-Dkq13hxI.js → ChatGptUsageButton-LTPdlo27.js} +2 -2
  25. package/dist/client/assets/{ChatMarkdown-DWX9SN0I.js → ChatMarkdown-WBYeOz6B.js} +5 -5
  26. package/dist/client/assets/{CheckboxIndicator-COjg4Es5.js → CheckboxIndicator-CT--c3fO.js} +2 -2
  27. package/dist/client/assets/{ClippedText-DpqkIszs.js → ClippedText-BWXvwYxu.js} +2 -2
  28. package/dist/client/assets/{CodexSetupSection.logic-C8_mcFTG.js → CodexSetupSection.logic-7Ae1lVg1.js} +2 -2
  29. package/dist/client/assets/{ComboboxClear-xR2R2-pv.js → ComboboxClear-CRWQGFjR.js} +2 -2
  30. package/dist/client/assets/{ComboboxGroupLabel-H2tPGIr6.js → ComboboxGroupLabel-BMo03qXe.js} +2 -2
  31. package/dist/client/assets/{CommandBlock-BU2CuIfo.js → CommandBlock-D57LdSoM.js} +2 -2
  32. package/dist/client/assets/{ComposerPromptEditor-T4veXUFB.js → ComposerPromptEditor-DJ9XwB1O.js} +4 -4
  33. package/dist/client/assets/{CompositeRoot-BIHvyYsZ.js → CompositeRoot-DSNl3c3G.js} +2 -2
  34. package/dist/client/assets/{ConnectionDiagnosisDetails-Blx3b1Io.js → ConnectionDiagnosisDetails-CMRX7VzH.js} +2 -2
  35. package/dist/client/assets/{ConnectionStatusDot-VMSwkMx4.js → ConnectionStatusDot-CiISG6eT.js} +2 -2
  36. package/dist/client/assets/{DRLTVNUE-CgTmY7aZ.js → DRLTVNUE-BjIXDJQN.js} +2 -2
  37. package/dist/client/assets/{DYY6UVD2-CHyCh3iy.js → DYY6UVD2-Dpro9qr4.js} +2 -2
  38. package/dist/client/assets/{DevicePanel-Du9xpjah.js → DevicePanel-DtM34nRC.js} +2 -2
  39. package/dist/client/assets/{DeviceSetup-3I8BZ0G5.js → DeviceSetup-BgzTguQP.js} +2 -2
  40. package/dist/client/assets/{DialogTitle-ueL4fmrv.js → DialogTitle-CACErOl5.js} +2 -2
  41. package/dist/client/assets/{DiffCommentAnnotation-Cb3p3y9X.js → DiffCommentAnnotation-Bcjn-Btj.js} +2 -2
  42. package/dist/client/assets/{DiffFileTree-CDCTH6OS.js → DiffFileTree-1s_6Y4bE.js} +2 -2
  43. package/dist/client/assets/{DiffPanel-vcZG1S2-.js → DiffPanel-BTNwksR-.js} +2 -2
  44. package/dist/client/assets/{DiffWorkerPoolProvider-WP0Muna6.js → DiffWorkerPoolProvider-DDVuzh7w.js} +2 -2
  45. package/dist/client/assets/{EmbeddedDesign-CpBO6uA7.js → EmbeddedDesign-3XobSUFO.js} +2 -2
  46. package/dist/client/assets/{EnvironmentMachineIcon-CAhjzBdd.js → EnvironmentMachineIcon-B6RgXF8A.js} +2 -2
  47. package/dist/client/assets/{ExpandableText-BOZbK7rv.js → ExpandableText-B3WqZ3eC.js} +2 -2
  48. package/dist/client/assets/{FNOVOB4O-BOUHvPNW.js → FNOVOB4O-BxVVUi2o.js} +2 -2
  49. package/dist/client/assets/{FieldControl-CtZ34LP0.js → FieldControl-BDrBhdoh.js} +2 -2
  50. package/dist/client/assets/{FileDiff-DU2VaZza.js → FileDiff-DM8e9Pyt.js} +2 -2
  51. package/dist/client/assets/{FilePreviewPanel-BT7yD1Je.js → FilePreviewPanel-CRdP4-01.js} +2 -2
  52. package/dist/client/assets/{FoldedSettingsSection-DyeK8ENP.js → FoldedSettingsSection-CsaWcgI5.js} +2 -2
  53. package/dist/client/assets/{FormContext-0ymX4Zdq.js → FormContext-BZ8Nuwwa.js} +2 -2
  54. package/dist/client/assets/{HDGCDEEZ-DhgkYpl1.js → HDGCDEEZ-9x1WhMZA.js} +2 -2
  55. package/dist/client/assets/{HSJLKHB7-LRZ0mZom.js → HSJLKHB7-BI4g8Uha.js} +2 -2
  56. package/dist/client/assets/{Icons-DtaiKNi8.js → Icons-CPaJO8_C.js} +2 -2
  57. package/dist/client/assets/Input-CTKz2gGc.js +2 -0
  58. package/dist/client/assets/JZOYTAAL-BSyl5qdX.js +1 -0
  59. package/dist/client/assets/{K3MD6TGW-Bms96D04.js → K3MD6TGW-QvtIomBt.js} +2 -2
  60. package/dist/client/assets/{K7RP3OMA-C4yeqngm.js → K7RP3OMA-CenKL848.js} +2 -2
  61. package/dist/client/assets/{KeybindingsSettings.logic-Z0gn-b9C.js → KeybindingsSettings.logic-Dk-UU5gV.js} +2 -2
  62. package/dist/client/assets/{LHDIQX7Q-D-iPFOmd.js → LHDIQX7Q-Du31c03t.js} +2 -2
  63. package/dist/client/assets/{LUXOKEGN-CJld9Vod.js → LUXOKEGN-DwVZaHZy.js} +2 -2
  64. package/dist/client/assets/{MathTypeset-DVrs3WeR.js → MathTypeset-DUJJZ0qR.js} +2 -2
  65. package/dist/client/assets/{N3JZAHOW-DHlQszLH.js → N3JZAHOW-f6rXQzfb.js} +2 -2
  66. package/dist/client/assets/{NUIALGQ3-BZrVZkDz.js → NUIALGQ3-B7-2dGpz.js} +2 -2
  67. package/dist/client/assets/{NoProjectsHero-DvT0SZTY.js → NoProjectsHero-BJZpoal_.js} +2 -2
  68. package/dist/client/assets/{O65XPQGZ-1Tib5Wm-.js → O65XPQGZ-pxAza1nz.js} +2 -2
  69. package/dist/client/assets/{O7XIQ6OM-B-jqX1ax.js → O7XIQ6OM-nX2_hGto.js} +2 -2
  70. package/dist/client/assets/{OFQON5FD-Z7ov13yL.js → OFQON5FD-y110aBJF.js} +2 -2
  71. package/dist/client/assets/{P4ConnectAccountPages-CLjGS23g.js → P4ConnectAccountPages-C1rFKA40.js} +2 -2
  72. package/dist/client/assets/{P4ConnectSidebarSignIn-Bqoai3_p.js → P4ConnectSidebarSignIn-40UlSrjv.js} +2 -2
  73. package/dist/client/assets/{PJQHF43J-BxO9Ed7Y.js → PJQHF43J-CbQqRUq6.js} +2 -2
  74. package/dist/client/assets/{PanelLayoutControls-CikZjTVk.js → PanelLayoutControls-CrSkXhVM.js} +4 -4
  75. package/dist/client/assets/{PierreEntryIcon-8lVXHvon.js → PierreEntryIcon-C488PFw3.js} +2 -2
  76. package/dist/client/assets/{PopoverHandle-CY48vabI.js → PopoverHandle-ByI17B8T.js} +2 -2
  77. package/dist/client/assets/{PreviewPanel-BsOxA7PG.js → PreviewPanel-CsAlP3Pf.js} +2 -2
  78. package/dist/client/assets/{ProjectDefaultsSettings-B6A-veuE.js → ProjectDefaultsSettings-b9JKMHCZ.js} +2 -2
  79. package/dist/client/assets/{ProjectFavicon-CYE59XXq.js → ProjectFavicon-BhuB_Su5.js} +3 -3
  80. package/dist/client/assets/{ProjectIconPickerDialog-B29JEJpT.js → ProjectIconPickerDialog-Cug9qYje.js} +2 -2
  81. package/dist/client/assets/{ProjectMonogram-DglZOJVY.js → ProjectMonogram-DdSkqGzz.js} +2 -2
  82. package/dist/client/assets/{ProviderAuthTerminal-Du0soMRt.js → ProviderAuthTerminal-BiaVsusp.js} +2 -2
  83. package/dist/client/assets/{ProviderModelPicker-DSQrIw5c.js → ProviderModelPicker-CHf8PGFh.js} +2 -2
  84. package/dist/client/assets/{ProviderSettingsForm-BDstI6TK.js → ProviderSettingsForm-DTCgpI31.js} +2 -2
  85. package/dist/client/assets/{PullRequestCodeTab-D5rLVyxt.js → PullRequestCodeTab-CruWTaey.js} +2 -2
  86. package/dist/client/assets/{RHNBAITX-CFRd4LdH.js → RHNBAITX-NhKz5kz6.js} +2 -2
  87. package/dist/client/assets/{ReadOnlySourcePreview-DumpnOnX.js → ReadOnlySourcePreview-BVjNlm_O.js} +2 -2
  88. package/dist/client/assets/{RenderErrorBoundary-BfOIzAFb.js → RenderErrorBoundary-C2PF8Cmu.js} +2 -2
  89. package/dist/client/assets/{SLD4V6NK-BzuDe7TY.js → SLD4V6NK-Ca5SsXR4.js} +2 -2
  90. package/dist/client/assets/{ScheduledTasksSettings-BZDLn8vh.js → ScheduledTasksSettings-QWakG9R_.js} +2 -2
  91. package/dist/client/assets/{ScopedSwitch-BDRueGC0.js → ScopedSwitch-Dpqx-0tY.js} +2 -2
  92. package/dist/client/assets/{ScrollAreaCorner-CiDeFRJG.js → ScrollAreaCorner-CGc2ioKQ.js} +2 -2
  93. package/dist/client/assets/{SecretInput-Bpz_flBS.js → SecretInput-D6soOcQS.js} +2 -2
  94. package/dist/client/assets/{SelectScrollUpArrow-UhJfY29a.js → SelectScrollUpArrow-CjMNXdhr.js} +2 -2
  95. package/dist/client/assets/{SettingsPanels-D9i_jn8e.js → SettingsPanels-5CR3ByhH.js} +2 -2
  96. package/dist/client/assets/{SettingsPanels.logic-BO_7fD50.js → SettingsPanels.logic-DYKv08oD.js} +2 -2
  97. package/dist/client/assets/{SettingsScopeNotice-DYhbVTKo.js → SettingsScopeNotice-Bq20tBUp.js} +2 -2
  98. package/dist/client/assets/{SidebarStageBackdrop-CXA-VL7f.js → SidebarStageBackdrop-CEjjEyUl.js} +2 -2
  99. package/dist/client/assets/{T3PCR2KE-Iz8AFoGq.js → T3PCR2KE-D-xJTbp-.js} +2 -2
  100. package/dist/client/assets/{TKWO2OVW-BiMX9mgc.js → TKWO2OVW-JaByeldU.js} +2 -2
  101. package/dist/client/assets/{TSHNXIZL-T9Jpa5Rz.js → TSHNXIZL-7SUhC5Vk.js} +2 -2
  102. package/dist/client/assets/{ThemeEditorPanel-DFn3Yrn1.js → ThemeEditorPanel-TxkY9El4.js} +2 -2
  103. package/dist/client/assets/{ThreadTerminalDrawer-C1eykNJF.js → ThreadTerminalDrawer-CW0oM3tO.js} +2 -2
  104. package/dist/client/assets/{TooltipViewport-DOp3kVQY.js → TooltipViewport-beytMJmq.js} +2 -2
  105. package/dist/client/assets/{UQJE5E4I-yF2s3czF.js → UQJE5E4I-CHN9jRa_.js} +2 -2
  106. package/dist/client/assets/{USNYFO5S-DyMrZB5n.js → USNYFO5S-Bvrc0sLJ.js} +2 -2
  107. package/dist/client/assets/{Virtualizer-VNN198aV.js → Virtualizer-vgqc_DSl.js} +2 -2
  108. package/dist/client/assets/{WEVWDWVA-BbR-bYXa.js → WEVWDWVA-BaKbLsuO.js} +2 -2
  109. package/dist/client/assets/{WorkspaceBreadcrumb-Bp8cxbFz.js → WorkspaceBreadcrumb-1f5BN5n1.js} +2 -2
  110. package/dist/client/assets/{WorkspacePageContainer-CZSuBU6k.js → WorkspacePageContainer-CDQRGmcV.js} +2 -2
  111. package/dist/client/assets/{WorkspacePageHeader-CTjYrqv6.js → WorkspacePageHeader-Q5YQyOFt.js} +2 -2
  112. package/dist/client/assets/{X5RFHQXM-CMXzdpa6.js → X5RFHQXM-BfoStT6R.js} +2 -2
  113. package/dist/client/assets/{X62E3GBT-C88V1WXc.js → X62E3GBT-DPqQZAUV.js} +2 -2
  114. package/dist/client/assets/{XBNEOJTC-ZXo4ara-.js → XBNEOJTC-a4pknpW1.js} +2 -2
  115. package/dist/client/assets/{YHV2MVVZ-Ddw8TiKv.js → YHV2MVVZ-CLYitNzo.js} +2 -2
  116. package/dist/client/assets/{YURCZMG2-CRwbbhO8.js → YURCZMG2-D5G4Gqxk.js} +2 -2
  117. package/dist/client/assets/{YVG2LODB-yVeDUCXO.js → YVG2LODB-BaOOPjOj.js} +2 -2
  118. package/dist/client/assets/{_chat-unmRpcW-.js → _chat-DLjkfz3i.js} +5 -5
  119. package/dist/client/assets/{_chat.design-T6D4XSc2.js → _chat.design-C8CbENny.js} +2 -2
  120. package/dist/client/assets/{_chat.index-BrgyAe9a.js → _chat.index-CWE510ct.js} +2 -2
  121. package/dist/client/assets/{_chat.new-C7fjsbGq.js → _chat.new-wb1utvr4.js} +2 -2
  122. package/dist/client/assets/{_chat.pull-requests-CToI_h67.js → _chat.pull-requests-D0bA9kLT.js} +2 -2
  123. package/dist/client/assets/{alert-kMZL9jzU.js → alert-Cq0DAg5J.js} +2 -2
  124. package/dist/client/assets/{assetUrls-CDYiJSSP.js → assetUrls-DpLOinYe.js} +2 -2
  125. package/dist/client/assets/{assets-DnrC_hwl.js → assets-Dls9s4TR.js} +2 -2
  126. package/dist/client/assets/{browserHistoryStore-CPBdgvvO.js → browserHistoryStore-CUc0_P_z.js} +2 -2
  127. package/dist/client/assets/{browserLinkTarget-oPTgFwDG.js → browserLinkTarget-BmW74g3V.js} +2 -2
  128. package/dist/client/assets/{checkbox-CP-w8eOU.js → checkbox-CoJ-ki0Z.js} +2 -2
  129. package/dist/client/assets/{color-picker-CZcpcrrS.js → color-picker-ABTfqBnJ.js} +2 -2
  130. package/dist/client/assets/{combobox-BHK8wQLo.js → combobox-C6NpXSFx.js} +2 -2
  131. package/dist/client/assets/{command-Bps-UDxp.js → command-BOsIZcjU.js} +2 -2
  132. package/dist/client/assets/{connect-CvkwK1ES.js → connect-B3OIDtgH.js} +2 -2
  133. package/dist/client/assets/{connect-agent-B9W36itu.js → connect-agent-BcH8kUjm.js} +2 -2
  134. package/dist/client/assets/{design-BPvd5t1p.js → design-D0u5lYcP.js} +2 -2
  135. package/dist/client/assets/{device-D5HNJpEC.js → device-UePDkr_L.js} +2 -2
  136. package/dist/client/assets/{dialog-BGBsXIS2.js → dialog-r1KpDpid.js} +2 -2
  137. package/dist/client/assets/{diffRendering-UyG_CIdR.js → diffRendering-cPnt2kIt.js} +2 -2
  138. package/dist/client/assets/{dist-BsVTiAl1.js → dist-D4Fzk6mX.js} +3 -3
  139. package/dist/client/assets/{draft-input-DDmbM6Qp.js → draft-input-eAeawUnI.js} +2 -2
  140. package/dist/client/assets/{duoViewer-C6sIXAmx.js → duoViewer-6tHPOGH8.js} +2 -2
  141. package/dist/client/assets/{dynamic-CeJgJNu6.js → dynamic-bKXiwQos.js} +2 -2
  142. package/dist/client/assets/{embeddedScripts-CSKss0de.js → embeddedScripts-CALp_TgN.js} +2 -2
  143. package/dist/client/assets/{empty-BchIQtwZ.js → empty-B5VIjZQf.js} +2 -2
  144. package/dist/client/assets/{entities-Ba3s4XOS.js → entities-DhRbI2L4.js} +2 -2
  145. package/dist/client/assets/{fileLinks-wfxpV-Qo.js → fileLinks-B4-TDufo.js} +2 -2
  146. package/dist/client/assets/{fileTreeExpansion-G-ylmE2I.js → fileTreeExpansion-WgU7oBBt.js} +2 -2
  147. package/dist/client/assets/{getDiffFileInput-3SvhMdx2.js → getDiffFileInput-CIsReQa3.js} +2 -2
  148. package/dist/client/assets/{guideRunStore-DzJc7VAu.js → guideRunStore-D6SjxVHH.js} +2 -2
  149. package/dist/client/assets/{htmlRender-B2qNV9TA.js → htmlRender-eKT33KVk.js} +2 -2
  150. package/dist/client/assets/{index-DYSmz54X.js → index-Gp6V8OPo.js} +3 -3
  151. package/dist/client/assets/{input-gXGwC11t.js → input-CySdZpuF.js} +2 -2
  152. package/dist/client/assets/{input-group-BqTFWskf.js → input-group-BRBXX90v.js} +2 -2
  153. package/dist/client/assets/{kbd-C2W9UqaC.js → kbd-BEi8qVF9.js} +2 -2
  154. package/dist/client/assets/{keybindings-D8lOCt7z.js → keybindings-COfPuZJ9.js} +2 -2
  155. package/dist/client/assets/{lazy-3fGMvttY.js → lazy-BKgu9oVK.js} +4 -4
  156. package/dist/client/assets/{lazyRouteComponent-7R-i6XT2.js → lazyRouteComponent-BUMdW5GA.js} +2 -2
  157. package/dist/client/assets/{link-CrHFGDcA.js → link-BLuLRp-C.js} +2 -2
  158. package/dist/client/assets/{linkedPrompt-VMNYJ9GO.js → linkedPrompt-BCdDQK81.js} +2 -2
  159. package/dist/client/assets/{main-BsbTTyDp.js → main-1tW7jidE.js} +7 -7
  160. package/dist/client/assets/main-BE5xGjw3.css +2 -0
  161. package/dist/client/assets/{mediaReference-BDgCdUPv.js → mediaReference-DAak-Bfh.js} +2 -2
  162. package/dist/client/assets/{mediaSource-Cjbr6BqZ.js → mediaSource-CI8DI4FI.js} +2 -2
  163. package/dist/client/assets/{number-field-Dhe9aDDa.js → number-field-DqB5oGdp.js} +2 -2
  164. package/dist/client/assets/{observeResize-D2-UGRv1.js → observeResize-CAGp2C1D.js} +2 -2
  165. package/dist/client/assets/{onboarding-r9FLYQ-W.js → onboarding-JbZFsvi9.js} +2 -2
  166. package/dist/client/assets/{openFileInPreview-Bw1jIEqk.js → openFileInPreview-CDCQ6rKJ.js} +2 -2
  167. package/dist/client/assets/{p4ProjectFile-BpTD1cMi.js → p4ProjectFile-DuMklfjR.js} +2 -2
  168. package/dist/client/assets/{pair-ho4TSbex.js → pair-3U4lhizd.js} +2 -2
  169. package/dist/client/assets/{pendingSendStore-CuJffLFW.js → pendingSendStore-BaAUC-mU.js} +2 -2
  170. package/dist/client/assets/{phoneViewer-D2TwG0d-.js → phoneViewer-BhDgaxtz.js} +2 -2
  171. package/dist/client/assets/{pierre-icons-DbovR9oY.js → pierre-icons-BnU3xLFM.js} +2 -2
  172. package/dist/client/assets/{popover-C7uUfSpb.js → popover-Cmd3nOX1.js} +2 -2
  173. package/dist/client/assets/{preview-CQ-dmagT.js → preview-BhM7y-5f.js} +2 -2
  174. package/dist/client/assets/{preview-DjnkVD4h.js → preview-DzgdX_e_.js} +2 -2
  175. package/dist/client/assets/{previewMiniPlayerStore-B9M2YCIo.js → previewMiniPlayerStore-JEelmjkF.js} +2 -2
  176. package/dist/client/assets/{primary-DpIL5Bs7.js → primary-C5Pkih-v.js} +2 -2
  177. package/dist/client/assets/{primaryCloudLinkState-BsLCUljE.js → primaryCloudLinkState-1Xmc8JzR.js} +2 -2
  178. package/dist/client/assets/{projectFilesQueryState-Dk3vmsg5.js → projectFilesQueryState-D9gKctiS.js} +2 -2
  179. package/dist/client/assets/{projectScriptEditor-0BJmIRyM.js → projectScriptEditor-D20MTQIS.js} +2 -2
  180. package/dist/client/assets/{providerSkills-DTnO9Kdf.js → providerSkills-DY_Eya4r.js} +2 -2
  181. package/dist/client/assets/{pullRequestDetail.logic-DtuOiGEk.js → pullRequestDetail.logic-CLAnM03l.js} +2 -2
  182. package/dist/client/assets/{pullRequestIcons-Dlewxywr.js → pullRequestIcons-1vN39RsA.js} +2 -2
  183. package/dist/client/assets/{pullRequestReviewStore-gMxEUIkY.js → pullRequestReviewStore-z8tuJFXD.js} +2 -2
  184. package/dist/client/assets/{pullRequests-B0XzWwD9.js → pullRequests-Dqd6r9gw.js} +2 -2
  185. package/dist/client/assets/{queries-OL_Htq8-.js → queries-B6XxcqnT.js} +2 -2
  186. package/dist/client/assets/{query-D2ZruPOT.js → query-yuF2-QRx.js} +2 -2
  187. package/dist/client/assets/{radio-group-B3QH_8sP.js → radio-group-Dcl3ANRp.js} +2 -2
  188. package/dist/client/assets/{renderScheduler-Dm1z2lUO.js → renderScheduler-CfBAnW7l.js} +2 -2
  189. package/dist/client/assets/{rightPanelStore-8Ds3qezY.js → rightPanelStore-DKH3Bw74.js} +2 -2
  190. package/dist/client/assets/{runtime-BdUzhUUM.js → runtime-Csw1ghUb.js} +3 -3
  191. package/dist/client/assets/{runtime-CzKn37Ie.js → runtime-DYpzE3gq.js} +3 -3
  192. package/dist/client/assets/{runtimeModeConfig-CkMiiAL3.js → runtimeModeConfig-cuNxQIV-.js} +2 -2
  193. package/dist/client/assets/{scheduledTasksSettings.logic-DQ-I14gW.js → scheduledTasksSettings.logic-9aUS0PH9.js} +2 -2
  194. package/dist/client/assets/{scroll-area-YeND7YEE.js → scroll-area-DMQd4YlU.js} +2 -2
  195. package/dist/client/assets/{select-Vs0PFHo8.js → select-kRO2vVzo.js} +2 -2
  196. package/dist/client/assets/{selfImproveFindings-Dr0Xv5Cv.js → selfImproveFindings-uaqHvfDg.js} +2 -2
  197. package/dist/client/assets/{server-BWUPVzyQ.js → server-DXSwZxzT.js} +2 -2
  198. package/dist/client/assets/{session-logic-DEPJvR2T.js → session-logic-C42l2TRa.js} +2 -2
  199. package/dist/client/assets/{session-DO9vnR62.js → session-meZM9Xpf.js} +2 -2
  200. package/dist/client/assets/{settings-C4A95qyS.js → settings-DFDwiVWH.js} +2 -2
  201. package/dist/client/assets/{settings.appearance-BJlptNKw.js → settings.appearance-Cfti608t.js} +2 -2
  202. package/dist/client/assets/settings.archived-Bh4SpQp7.js +2 -0
  203. package/dist/client/assets/{settings.computer-use-DgrTOJNC.js → settings.computer-use-BlDOxUzy.js} +2 -2
  204. package/dist/client/assets/{settings.connections-CANgvtpc.js → settings.connections-BTrzLXQG.js} +2 -2
  205. package/dist/client/assets/{settings.data-controls-BSwYGvBW.js → settings.data-controls-DUdW2NVF.js} +2 -2
  206. package/dist/client/assets/{settings.decisions-DUMCyTuZ.js → settings.decisions-DrG6xwiq.js} +2 -2
  207. package/dist/client/assets/{settings.designs-BBZMrfcr.js → settings.designs-BtuTLR8n.js} +2 -2
  208. package/dist/client/assets/{settings.diagnostics-CIZDT4cV.js → settings.diagnostics-BK6KmZ6a.js} +2 -2
  209. package/dist/client/assets/{settings.general-bSnpL1hJ.js → settings.general-BmfZwZYV.js} +2 -2
  210. package/dist/client/assets/{settings.integrations-X7_if4hO.js → settings.integrations-D1gZz8sk.js} +2 -2
  211. package/dist/client/assets/{settings.keybindings-Zqqy5SpG.js → settings.keybindings-BTpVSO__.js} +2 -2
  212. package/dist/client/assets/{settings.open-source-licenses-B78rCdLj.js → settings.open-source-licenses-XO8zNkrl.js} +2 -2
  213. package/dist/client/assets/{settings.plugins-BBBQ-lLl.js → settings.plugins-VlmvBnPN.js} +2 -2
  214. package/dist/client/assets/{settings.projects-DB2aOKVF.js → settings.projects-M8mb50zO.js} +3 -3
  215. package/dist/client/assets/{settings.providers-CK3hv5-I.js → settings.providers-CQ0OTnQ1.js} +3 -3
  216. package/dist/client/assets/{settings.scheduled-tasks-DWtqoBGX.js → settings.scheduled-tasks-Dm3QDHlc.js} +2 -2
  217. package/dist/client/assets/{settings.snap-shot-5aoNTQNE.js → settings.snap-shot-BxcK0LEY.js} +2 -2
  218. package/dist/client/assets/{settings.source-control-DrKsCyRy.js → settings.source-control-DbAJM2fi.js} +2 -2
  219. package/dist/client/assets/{settings.storage-Bd2pVP1J.js → settings.storage-BWTGbbAs.js} +2 -2
  220. package/dist/client/assets/{settingsLayout-B5eZBFxv.js → settingsLayout-D3zsCQTE.js} +2 -2
  221. package/dist/client/assets/{sidebar-DXusvEJa.js → sidebar-C_Z-zEdU.js} +2 -2
  222. package/dist/client/assets/{sidebarProjectGrouping-Bkwz22MS.js → sidebarProjectGrouping-upKKecFM.js} +2 -2
  223. package/dist/client/assets/{skeleton-CQczLiXo.js → skeleton-CAZWrHi2.js} +2 -2
  224. package/dist/client/assets/{sourceControl-iC7SBPhY.js → sourceControl-Bb4nr0Wx.js} +2 -2
  225. package/dist/client/assets/{sourceControlClients-8HF20R-d.js → sourceControlClients-DExT5Wem.js} +2 -2
  226. package/dist/client/assets/{spinner-CkQHTBh8.js → spinner-DN7lJfwl.js} +2 -2
  227. package/dist/client/assets/{terminal-links-BwPSFkUp.js → terminal-links-Dj73wz5S.js} +2 -2
  228. package/dist/client/assets/{terminalSessions-Vl5lzDOp.js → terminalSessions-CyoMi8Lk.js} +2 -2
  229. package/dist/client/assets/{textarea-C3yif1uk.js → textarea-U0rH71iw.js} +2 -2
  230. package/dist/client/assets/{themePalette-kU5foqa6.js → themePalette-B5YWcpxp.js} +2 -2
  231. package/dist/client/assets/{toast-DJ2-4imd.js → toast-C1lIuL0v.js} +2 -2
  232. package/dist/client/assets/{toggle-BwVfYVI5.js → toggle-CrlljXsx.js} +2 -2
  233. package/dist/client/assets/{toggle-group-CUE2cE-r.js → toggle-group-BIVeiRdg.js} +2 -2
  234. package/dist/client/assets/{tooltip-DctjVJ7F.js → tooltip-CMPhQaPE.js} +2 -2
  235. package/dist/client/assets/{uiStateStore-D4coYv1J.js → uiStateStore-C6-jXt5N.js} +2 -2
  236. package/dist/client/assets/{usage-DnLLaKaF.js → usage-TbP8vhYG.js} +2 -2
  237. package/dist/client/assets/{usageAccess-BifB1Sam.js → usageAccess-B68ifs1q.js} +2 -2
  238. package/dist/client/assets/{usageFormat-DgseLcCP.js → usageFormat-5HVN-IRu.js} +2 -2
  239. package/dist/client/assets/{usageShortcuts-C0xlzVwU.js → usageShortcuts-cMgT39NO.js} +2 -2
  240. package/dist/client/assets/{use-atom-command-D7oRayrc.js → use-atom-command-sg76DXcz.js} +2 -2
  241. package/dist/client/assets/{useAriaLabelledBy-ChgWEu_a.js → useAriaLabelledBy-D_ENSt33.js} +2 -2
  242. package/dist/client/assets/{useHandleNewThread-BcOvatr7.js → useHandleNewThread-DglymQWA.js} +2 -2
  243. package/dist/client/assets/{useLocation-DctIJsoW.js → useLocation-t7z8sUje.js} +2 -2
  244. package/dist/client/assets/{useNavigate-C-nl3R9B.js → useNavigate-kfVoxx_T.js} +2 -2
  245. package/dist/client/assets/{useNavigateBack-BVWPYJko.js → useNavigateBack-B79USD1h.js} +2 -2
  246. package/dist/client/assets/{useP4ConnectAuthPrompt-Ds5beo6Y.js → useP4ConnectAuthPrompt-Caj-XRNA.js} +2 -2
  247. package/dist/client/assets/{useParams-BEj3muN1.js → useParams-DuqJgNNY.js} +2 -2
  248. package/dist/client/assets/{usePermissionStatus-BpCHJG9L.js → usePermissionStatus-hWpY6-jP.js} +2 -2
  249. package/dist/client/assets/{usePullRequestActions-BjCrAcbO.js → usePullRequestActions-B6Nj3E46.js} +2 -2
  250. package/dist/client/assets/{useRegisterFieldControl-DxvlOVA9.js → useRegisterFieldControl-y1AHmvVZ.js} +2 -2
  251. package/dist/client/assets/{useScopedModelAvailability-CgXMs_Zc.js → useScopedModelAvailability-Cb_UE0gJ.js} +2 -2
  252. package/dist/client/assets/{useSettings-BzfsGrZk.js → useSettings-CyF6ezIl.js} +2 -2
  253. package/dist/client/assets/{utils-DBdIFVCj.js → utils-BlwLA0C4.js} +17 -17
  254. package/dist/client/assets/{vcsRefInvalidation-D4Oei7uu.js → vcsRefInvalidation-Bkr613aV.js} +2 -2
  255. package/dist/client/assets/{welcome-Bmf6_fLo.js → welcome-Dj-C1U_A.js} +2 -2
  256. package/dist/client/index.html +1 -1
  257. package/dist/{renderer-DXsHnrqP.mjs → renderer-BaYdZX9b.mjs} +2 -2
  258. package/dist/{runtime-Sw1S5Uy7.mjs → runtime-xvtWpueC.mjs} +3 -4
  259. package/package.json +1 -1
  260. package/dist/client/assets/AlertDialogRoot-Cb4z5Mk4.js +0 -2
  261. package/dist/client/assets/Input-YAwDiPhc.js +0 -2
  262. package/dist/client/assets/JZOYTAAL-DrWLTUgY.js +0 -1
  263. package/dist/client/assets/main-DAlZJX1g.css +0 -2
  264. package/dist/client/assets/settings.archived-rIHiy1vU.js +0 -2
@@ -1,2 +1,2 @@
1
- import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Bd as i,dr as a}from"./utils-DBdIFVCj.js";var o=n(),s=e(r(),1);function c(e){let t=(0,o.c)(7),{permissions:n,busy:r}=e,c=r!==void 0&&r,l;if(t[0]!==c||t[1]!==n){let e;t[3]===c?e=t[4]:(e=e=>(0,s.jsxs)(`div`,{className:`flex items-center gap-3 rounded-lg border px-3 py-2`,children:[e.icon,(0,s.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,s.jsx)(`p`,{className:`font-medium`,children:e.title}),(0,s.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.description})]}),e.granted?(0,s.jsxs)(`span`,{role:`status`,className:`flex items-center gap-1 text-xs text-success`,children:[(0,s.jsx)(i,{className:`size-4`,"aria-hidden":`true`}),`Allowed`]}):(0,s.jsx)(a,{size:`xs`,variant:`outline`,disabled:c,onClick:e.onAllow,children:`Allow`})]},e.id),t[3]=c,t[4]=e),l=n.map(e),t[0]=c,t[1]=n,t[2]=l}else l=t[2];let u;return t[5]===l?u=t[6]:(u=(0,s.jsx)(`div`,{className:`space-y-2`,children:l}),t[5]=l,t[6]=u),u}function l(e){let t=(0,o.c)(9),n,r,i,c;t[0]===e?(n=t[1],r=t[2],i=t[3],c=t[4]):({ready:r,busy:i,children:c,...n}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=c);let l=i!==void 0&&i,u=c===void 0?`Continue`:c,d=!r||l,f;return t[5]!==u||t[6]!==n||t[7]!==d?(f=(0,s.jsx)(a,{...n,disabled:d,children:u}),t[5]=u,t[6]=n,t[7]=d,t[8]=f):f=t[8],f}var u=e(t(),1);function d(e,t,n){let r=(0,o.c)(12),i=n===void 0||n,[a,s]=(0,u.useState)(t),[c,l]=(0,u.useState)(null),d=(0,u.useEffectEvent)(e),f;r[0]!==d||r[1]!==i?(f=()=>{if(!i)return;let e=!1,t=!1,n=async()=>{if(!(e||t||document.visibilityState===`hidden`)){t=!0;try{let t=await d();e||(s(t),l(null))}catch{e||l(`Could not check permissions. We'll try again automatically.`)}t=!1}};n();let r=window.setInterval(()=>void n(),1500);return window.addEventListener(`focus`,n),document.addEventListener(`visibilitychange`,n),()=>{e=!0,window.clearInterval(r),window.removeEventListener(`focus`,n),document.removeEventListener(`visibilitychange`,n)}},r[0]=d,r[1]=i,r[2]=f):f=r[2];let p;r[3]===i?p=r[4]:(p=[i],r[3]=i,r[4]=p),(0,u.useEffect)(f,p);let m;r[5]!==c||r[6]!==a?(m=e=>c===null&&e.every(e=>a[e]),r[5]=c,r[6]=a,r[7]=m):m=r[7];let h;return r[8]!==c||r[9]!==a||r[10]!==m?(h={status:a,error:c,isReady:m},r[8]=c,r[9]=a,r[10]=m,r[11]=h):h=r[11],h}export{c as n,l as r,d as t};
2
- //# sourceMappingURL=usePermissionStatus-BpCHJG9L.js.map
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Bd as i,dr as a}from"./utils-BlwLA0C4.js";var o=n(),s=e(r(),1);function c(e){let t=(0,o.c)(7),{permissions:n,busy:r}=e,c=r!==void 0&&r,l;if(t[0]!==c||t[1]!==n){let e;t[3]===c?e=t[4]:(e=e=>(0,s.jsxs)(`div`,{className:`flex items-center gap-3 rounded-lg border px-3 py-2`,children:[e.icon,(0,s.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,s.jsx)(`p`,{className:`font-medium`,children:e.title}),(0,s.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.description})]}),e.granted?(0,s.jsxs)(`span`,{role:`status`,className:`flex items-center gap-1 text-xs text-success`,children:[(0,s.jsx)(i,{className:`size-4`,"aria-hidden":`true`}),`Allowed`]}):(0,s.jsx)(a,{size:`xs`,variant:`outline`,disabled:c,onClick:e.onAllow,children:`Allow`})]},e.id),t[3]=c,t[4]=e),l=n.map(e),t[0]=c,t[1]=n,t[2]=l}else l=t[2];let u;return t[5]===l?u=t[6]:(u=(0,s.jsx)(`div`,{className:`space-y-2`,children:l}),t[5]=l,t[6]=u),u}function l(e){let t=(0,o.c)(9),n,r,i,c;t[0]===e?(n=t[1],r=t[2],i=t[3],c=t[4]):({ready:r,busy:i,children:c,...n}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=c);let l=i!==void 0&&i,u=c===void 0?`Continue`:c,d=!r||l,f;return t[5]!==u||t[6]!==n||t[7]!==d?(f=(0,s.jsx)(a,{...n,disabled:d,children:u}),t[5]=u,t[6]=n,t[7]=d,t[8]=f):f=t[8],f}var u=e(t(),1);function d(e,t,n){let r=(0,o.c)(12),i=n===void 0||n,[a,s]=(0,u.useState)(t),[c,l]=(0,u.useState)(null),d=(0,u.useEffectEvent)(e),f;r[0]!==d||r[1]!==i?(f=()=>{if(!i)return;let e=!1,t=!1,n=async()=>{if(!(e||t||document.visibilityState===`hidden`)){t=!0;try{let t=await d();e||(s(t),l(null))}catch{e||l(`Could not check permissions. We'll try again automatically.`)}t=!1}};n();let r=window.setInterval(()=>void n(),1500);return window.addEventListener(`focus`,n),document.addEventListener(`visibilitychange`,n),()=>{e=!0,window.clearInterval(r),window.removeEventListener(`focus`,n),document.removeEventListener(`visibilitychange`,n)}},r[0]=d,r[1]=i,r[2]=f):f=r[2];let p;r[3]===i?p=r[4]:(p=[i],r[3]=i,r[4]=p),(0,u.useEffect)(f,p);let m;r[5]!==c||r[6]!==a?(m=e=>c===null&&e.every(e=>a[e]),r[5]=c,r[6]=a,r[7]=m):m=r[7];let h;return r[8]!==c||r[9]!==a||r[10]!==m?(h={status:a,error:c,isReady:m},r[8]=c,r[9]=a,r[10]=m,r[11]=h):h=r[11],h}export{c as n,l as r,d as t};
2
+ //# sourceMappingURL=usePermissionStatus-hWpY6-jP.js.map
@@ -1,3 +1,3 @@
1
- import{a as e,t}from"./react-BUfh6y28.js";import{n}from"./jsx-runtime-DJeoFXNw.js";import{D as r,Os as i,Rw as a,Ts as o,Wc as s,Z_ as c,Zo as l,Zs as u,aE as d,bs as f,iv as p,lv as m,ts as h}from"./utils-DBdIFVCj.js";import{M as g,N as _,W as v}from"./runtime-CzKn37Ie.js";import{a as y,i as b}from"./vcsRefInvalidation-D4Oei7uu.js";import{w as ee}from"./entities-Ba3s4XOS.js";import{t as te}from"./runtime-BdUzhUUM.js";import{i as x}from"./toast-DJ2-4imd.js";import{D as S,d as C,s as w}from"./useSettings-BzfsGrZk.js";import{i as T,n as E}from"./session-DO9vnR62.js";import{n as D}from"./query-D2ZruPOT.js";import{t as O}from"./use-atom-command-D7oRayrc.js";import{d as k,l as A,u as j}from"./queries-OL_Htq8-.js";import{t as M}from"./sourceControl-iC7SBPhY.js";import{C as N,r as P}from"./pullRequests-B0XzWwD9.js";import{R as F,b as ne,y as re}from"./pullRequestDetail.logic-DtuOiGEk.js";import{n as ie}from"./useHandleNewThread-BcOvatr7.js";import{c as ae,f as I,i as L,s as R}from"./p4ProjectFile-BpTD1cMi.js";import{t as z}from"./sidebarProjectGrouping-Bkwz22MS.js";var B=e(t(),1),V=n();function H(e){return{pullRequestResolution:_(e,{label:`environment-data:git:resolve-pull-request`,tag:s.gitResolvePullRequest}),preparePullRequestThread:g(e,{label:`environment-data:git:prepare-pull-request-thread`,tag:s.gitPreparePullRequestThread,scheduler:y,concurrency:b})}}var U=H(te),W={init:`init`,pull:`pull`,publishRepository:`publish_repository`,runStackedAction:`run_change_request`,preparePullRequestThread:`prepare_pull_request_thread`};function G(e){let t=T(e.scope.environmentId,p),n=W[e.kind],r=h(A.stateAtom(e.scope)),i=r.operation===n,s=(0,B.useCallback)(()=>{A.resetError(l,e.scope,n)},[e.scope,n]),c=(0,B.useCallback)(async(...t)=>{if(e.scope.environmentId===null||!E(e.scope.environmentId,`source-control:write`))return f(a(new m({requiredScope:p,message:`This connection cannot change source control.`})));let r=async()=>{let n=await e.action(...t);return o(n)&&e.onSuccess?.(),n};return e.managedExternally===!0?r():A.track(l,e.scope,{operation:n,label:e.label},r)},[e.action,e.label,e.managedExternally,e.onSuccess,e.scope,n]);return{isAllowed:t,error:i?r.error:null,isPending:i&&r.isRunning,resetError:s,run:c}}function K(e){return e.environmentId===null||e.cwd===null?null:{environmentId:e.environmentId,cwd:e.cwd}}function q(e,t){let n=(0,V.c)(6),r;n[0]===e?r=n[1]:(r=A.stateAtom(e),n[0]=e,n[1]=r);let i=h(r),a;return n[2]!==t||n[3]!==i.isRunning||n[4]!==i.operation?(a=i.isRunning&&i.operation!==null&&t.some(e=>W[e]===i.operation),n[2]=t,n[3]=i.isRunning,n[4]=i.operation,n[5]=a):a=n[5],a}function J(e){let t=(0,V.c)(7),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=O(j.init,n),i;t[1]!==r||t[2]!==e?(i=async()=>{let t=K(e);return t===null?f(a(new k({operation:`init`,environmentId:e.environmentId,cwd:e.cwd}))):r({environmentId:t.environmentId,input:{cwd:t.cwd}})},t[1]=r,t[2]=e,t[3]=i):i=t[3];let o=i,s;return t[4]!==o||t[5]!==e?(s={kind:`init`,label:`Initializing repository`,scope:e,action:o},t[4]=o,t[5]=e,t[6]=s):s=t[6],G(s)}function oe(e){let t=(0,V.c)(11),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=O(j.pull,n),i;t[1]!==e.cwd||t[2]!==e.environmentId?(i=e.environmentId!==null&&e.cwd!==null?j.status({environmentId:e.environmentId,input:{cwd:e.cwd}}):null,t[1]=e.cwd,t[2]=e.environmentId,t[3]=i):i=t[3];let o=D(i),s;t[4]!==r||t[5]!==e?(s=async()=>{let t=K(e);return t===null?f(a(new k({operation:`pull`,environmentId:e.environmentId,cwd:e.cwd}))):r({environmentId:t.environmentId,input:{cwd:t.cwd}})},t[4]=r,t[5]=e,t[6]=s):s=t[6];let c=s,l;return t[7]!==c||t[8]!==e||t[9]!==o.refresh?(l={kind:`pull`,label:`Pulling latest changes...`,scope:e,action:c,onSuccess:o.refresh},t[7]=c,t[8]=e,t[9]=o.refresh,t[10]=l):l=t[10],G(l)}function se(e){let t=(0,V.c)(13),n;t[0]===e?n=t[1]:(n=A.runStackedAction(e),t[0]=e,t[1]=n);let r;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r={reportFailure:!1},t[2]=r):r=t[2];let i=O(n,r),o;t[3]!==e.cwd||t[4]!==e.environmentId?(o=e.environmentId!==null&&e.cwd!==null?j.status({environmentId:e.environmentId,input:{cwd:e.cwd}}):null,t[3]=e.cwd,t[4]=e.environmentId,t[5]=o):o=t[5];let s=D(o),c;t[6]!==i||t[7]!==e?(c=async t=>K(e)===null?f(a(new k({operation:`run_change_request`,environmentId:e.environmentId,cwd:e.cwd}))):i(t),t[6]=i,t[7]=e,t[8]=c):c=t[8];let l=c,u;return t[9]!==l||t[10]!==e||t[11]!==s.refresh?(u={kind:`runStackedAction`,label:`Running source control action`,scope:e,action:l,onSuccess:s.refresh,managedExternally:!0},t[9]=l,t[10]=e,t[11]=s.refresh,t[12]=u):u=t[12],G(u)}function ce(e){let t=(0,V.c)(11),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=O(M.publishRepository,n),i;t[1]!==e.cwd||t[2]!==e.environmentId?(i=e.environmentId!==null&&e.cwd!==null?j.status({environmentId:e.environmentId,input:{cwd:e.cwd}}):null,t[1]=e.cwd,t[2]=e.environmentId,t[3]=i):i=t[3];let o=D(i),s;t[4]!==r||t[5]!==e?(s=async t=>{let n=K(e);return n===null?f(a(new k({operation:`publish_repository`,environmentId:e.environmentId,cwd:e.cwd}))):r({environmentId:n.environmentId,input:{cwd:n.cwd,...t}})},t[4]=r,t[5]=e,t[6]=s):s=t[6];let c=s,l;return t[7]!==c||t[8]!==e||t[9]!==o.refresh?(l={kind:`publishRepository`,label:`Publishing repository`,scope:e,action:c,onSuccess:o.refresh},t[7]=c,t[8]=e,t[9]=o.refresh,t[10]=l):l=t[10],G(l)}function Y(e){let t=(0,V.c)(7),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=O(U.preparePullRequestThread,n),i;t[1]!==r||t[2]!==e?(i=async t=>{let n=K(e);return n===null?f(a(new k({operation:`prepare_pull_request_thread`,environmentId:e.environmentId,cwd:e.cwd}))):t.mode===`worktree`&&t.threadId!==void 0&&!E(n.environmentId,`orchestration:operate`)?f(a(new m({requiredScope:c,message:`This connection cannot change threads.`}))):r({environmentId:n.environmentId,input:{cwd:n.cwd,reference:t.reference,mode:t.mode,...t.threadId?{threadId:t.threadId}:{}}})},t[1]=r,t[2]=e,t[3]=i):i=t[3];let o=i,s;return t[4]!==o||t[5]!==e?(s={kind:`preparePullRequestThread`,label:`Preparing pull request thread`,scope:e,action:o},t[4]=o,t[5]=e,t[6]=s):s=t[6],G(s)}function X(e){return e.environmentId===null||e.cwd===null||e.reference===null?null:d(i(l.get(U.pullRequestResolution({environmentId:e.environmentId,input:{cwd:e.cwd,reference:e.reference}}))))}function le(e){let t=(0,V.c)(12),n;t[0]!==e.cwd||t[1]!==e.environmentId||t[2]!==e.reference?(n=e.environmentId!==null&&e.cwd!==null&&e.reference!==null?U.pullRequestResolution({environmentId:e.environmentId,input:{cwd:e.cwd,reference:e.reference}}):null,t[0]=e.cwd,t[1]=e.environmentId,t[2]=e.reference,t[3]=n):n=t[3];let r=D(n),i;t[4]===e?i=t[5]:(i=X(e),t[4]=e,t[5]=i);let a=i,o=r.data??a,s=r.isPending&&a===null,c;return t[6]!==r.error||t[7]!==r.isPending||t[8]!==r.refresh||t[9]!==o||t[10]!==s?(c={data:o,error:r.error,isPending:s,isFetching:r.isPending,refresh:r.refresh},t[6]=r.error,t[7]=r.isPending,t[8]=r.refresh,t[9]=o,t[10]=s,t[11]=c):c=t[11],c}function ue(e,t){let n=(0,V.c)(10),r;n[0]===t?r=n[1]:(r=e=>L(e,t).settings.pullRequestMergeMethod,n[0]=t,n[1]=r);let i=C(e,r),a=w(de),o=w(I),s=ee(),c=S(),l;return n[2]!==e||n[3]!==o||n[4]!==a||n[5]!==c||n[6]!==i||n[7]!==t||n[8]!==s?(l=()=>{if(i!=null)return i;if(Object.keys(a).length===0)return;let n=s.find(n=>n.environmentId===e&&n.id===t);if(!n)return;let r=z({projects:s,settings:o,primaryEnvironmentId:c}).get(ae(n))??R(n,o);return a[r]},n[2]=e,n[3]=o,n[4]=a,n[5]=c,n[6]=i,n[7]=t,n[8]=s,n[9]=l):l=n[9],l}function de(e){return e.pullRequestMergeMethodOverrides}var fe={merge:`Merge requested`,ready:`Marked ready for review`,draft:`Converted to draft`,close:`Pull request closed`,reopen:`Pull request reopened`,"update-branch":`Branch updated with the base branch`,"enable-auto-merge":`Auto-merge enabled`,"disable-auto-merge":`Auto-merge disabled`,revert:`Revert pull request opened`,"delete-branch":`Branch deleted`,"approve-workflows":`Workflows approved`},pe={merge:`Could not merge this pull request`,ready:`Could not mark this ready for review`,draft:`Could not convert this to a draft`,close:`Could not close this pull request`,reopen:`Could not reopen this pull request`,"update-branch":`Could not update this branch`,"enable-auto-merge":`Could not enable auto-merge`,"disable-auto-merge":`Could not disable auto-merge`,revert:`Could not open a revert pull request`,"delete-branch":`Could not delete this branch`,"approve-workflows":`Could not approve workflows`},Z={merge:`The host refused the merge. Check that you have write access, that the checks it requires have passed, and that the branch is not conflicting.`,ready:`The host refused it. Check that you have write access to this repository.`,draft:`The host refused it. Check that you have write access to this repository.`,close:`The host refused it. Check that you have write access, or that you opened it.`,reopen:`The host refused it. Check that you have write access, and that the branch still exists.`,"update-branch":`The host refused it. Check that you have write access, and that the base branch has not diverged in a way the host cannot merge.`,"enable-auto-merge":`The host refused it. Check that auto-merge is enabled for this repository and that you have write access.`,"disable-auto-merge":`The host refused it. Check that you have write access to this repository.`,revert:`The host refused it. Check that you have write access and that this pull request was merged on the host.`,"delete-branch":`The host refused it. Check that you have write access to the source repository and that the branch has not moved since this page loaded.`,"approve-workflows":`The host refused it. Check that you have Actions write access and that these workflow runs are still awaiting approval.`};function me({environmentId:e,reference:t,onSuccess:n,resolveMergeMethod:r}){let i=O(P.runAction,{reportFailure:!1}),[a,o]=(0,B.useState)(!1),s=(0,B.useRef)(!1);return{actionPending:a,perform:async(a,c)=>{if(!(s.current||t===null)){s.current=!0,o(!0);try{let o=await i({environmentId:e,input:{...t,action:a,...c?{mergeMethod:c}:r?{resolveMergeMethod:r}:{}}});if(o._tag===`Failure`)throw v(o);x.add({type:`success`,title:fe[a]}),n?.(a)}catch(e){x.add({type:`error`,title:pe[a],description:F(e,Z[a])})}finally{s.current=!1,o(!1)}}}}}function Q(e){let t=O(P.runAction,{reportFailure:!1}),n=(0,B.useRef)(new Set),[r,i]=(0,B.useState)(()=>new Set);return{close:(0,B.useCallback)(async r=>{let a=r.filter(e=>{let t=N(e);return e.state!==`open`||n.current.has(t)?!1:(n.current.add(t),!0)});if(a.length===0)return;i(new Set(n.current));let o=0,s=[];await Promise.all(a.map(async r=>{try{let n=await t({environmentId:r.environmentId,input:{projectId:r.projectId,host:r.host,repository:r.repository,number:r.number,action:`close`}});if(n._tag===`Failure`)throw v(n);o++,e(r)}catch(e){s.push(`#${r.number}: ${F(e,Z.close)}`)}finally{n.current.delete(N(r)),i(new Set(n.current))}})),x.add({type:s.length>0?`error`:`success`,title:s.length>0?`Closed ${o} of ${a.length} pull requests`:`Closed ${o} pull request${o===1?``:`s`}`,...s.length>0?{description:s.slice(0,3).join(`
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{n}from"./jsx-runtime-DJeoFXNw.js";import{D as r,Os as i,Rw as a,Ts as o,Wc as s,Z_ as c,Zo as l,Zs as u,aE as d,bs as f,iv as p,lv as m,ts as h}from"./utils-BlwLA0C4.js";import{M as g,N as _,W as v}from"./runtime-DYpzE3gq.js";import{a as y,i as b}from"./vcsRefInvalidation-Bkr613aV.js";import{w as ee}from"./entities-DhRbI2L4.js";import{t as te}from"./runtime-Csw1ghUb.js";import{i as x}from"./toast-C1lIuL0v.js";import{D as S,d as C,s as w}from"./useSettings-CyF6ezIl.js";import{i as T,n as E}from"./session-meZM9Xpf.js";import{n as D}from"./query-yuF2-QRx.js";import{t as O}from"./use-atom-command-sg76DXcz.js";import{d as k,l as A,u as j}from"./queries-B6XxcqnT.js";import{t as M}from"./sourceControl-Bb4nr0Wx.js";import{C as N,r as P}from"./pullRequests-Dqd6r9gw.js";import{R as F,b as ne,y as re}from"./pullRequestDetail.logic-CLAnM03l.js";import{n as ie}from"./useHandleNewThread-DglymQWA.js";import{c as ae,f as I,i as L,s as R}from"./p4ProjectFile-DuMklfjR.js";import{t as z}from"./sidebarProjectGrouping-upKKecFM.js";var B=e(t(),1),V=n();function H(e){return{pullRequestResolution:_(e,{label:`environment-data:git:resolve-pull-request`,tag:s.gitResolvePullRequest}),preparePullRequestThread:g(e,{label:`environment-data:git:prepare-pull-request-thread`,tag:s.gitPreparePullRequestThread,scheduler:y,concurrency:b})}}var U=H(te),W={init:`init`,pull:`pull`,publishRepository:`publish_repository`,runStackedAction:`run_change_request`,preparePullRequestThread:`prepare_pull_request_thread`};function G(e){let t=T(e.scope.environmentId,p),n=W[e.kind],r=h(A.stateAtom(e.scope)),i=r.operation===n,s=(0,B.useCallback)(()=>{A.resetError(l,e.scope,n)},[e.scope,n]),c=(0,B.useCallback)(async(...t)=>{if(e.scope.environmentId===null||!E(e.scope.environmentId,`source-control:write`))return f(a(new m({requiredScope:p,message:`This connection cannot change source control.`})));let r=async()=>{let n=await e.action(...t);return o(n)&&e.onSuccess?.(),n};return e.managedExternally===!0?r():A.track(l,e.scope,{operation:n,label:e.label},r)},[e.action,e.label,e.managedExternally,e.onSuccess,e.scope,n]);return{isAllowed:t,error:i?r.error:null,isPending:i&&r.isRunning,resetError:s,run:c}}function K(e){return e.environmentId===null||e.cwd===null?null:{environmentId:e.environmentId,cwd:e.cwd}}function q(e,t){let n=(0,V.c)(6),r;n[0]===e?r=n[1]:(r=A.stateAtom(e),n[0]=e,n[1]=r);let i=h(r),a;return n[2]!==t||n[3]!==i.isRunning||n[4]!==i.operation?(a=i.isRunning&&i.operation!==null&&t.some(e=>W[e]===i.operation),n[2]=t,n[3]=i.isRunning,n[4]=i.operation,n[5]=a):a=n[5],a}function J(e){let t=(0,V.c)(7),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=O(j.init,n),i;t[1]!==r||t[2]!==e?(i=async()=>{let t=K(e);return t===null?f(a(new k({operation:`init`,environmentId:e.environmentId,cwd:e.cwd}))):r({environmentId:t.environmentId,input:{cwd:t.cwd}})},t[1]=r,t[2]=e,t[3]=i):i=t[3];let o=i,s;return t[4]!==o||t[5]!==e?(s={kind:`init`,label:`Initializing repository`,scope:e,action:o},t[4]=o,t[5]=e,t[6]=s):s=t[6],G(s)}function oe(e){let t=(0,V.c)(11),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=O(j.pull,n),i;t[1]!==e.cwd||t[2]!==e.environmentId?(i=e.environmentId!==null&&e.cwd!==null?j.status({environmentId:e.environmentId,input:{cwd:e.cwd}}):null,t[1]=e.cwd,t[2]=e.environmentId,t[3]=i):i=t[3];let o=D(i),s;t[4]!==r||t[5]!==e?(s=async()=>{let t=K(e);return t===null?f(a(new k({operation:`pull`,environmentId:e.environmentId,cwd:e.cwd}))):r({environmentId:t.environmentId,input:{cwd:t.cwd}})},t[4]=r,t[5]=e,t[6]=s):s=t[6];let c=s,l;return t[7]!==c||t[8]!==e||t[9]!==o.refresh?(l={kind:`pull`,label:`Pulling latest changes...`,scope:e,action:c,onSuccess:o.refresh},t[7]=c,t[8]=e,t[9]=o.refresh,t[10]=l):l=t[10],G(l)}function se(e){let t=(0,V.c)(13),n;t[0]===e?n=t[1]:(n=A.runStackedAction(e),t[0]=e,t[1]=n);let r;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r={reportFailure:!1},t[2]=r):r=t[2];let i=O(n,r),o;t[3]!==e.cwd||t[4]!==e.environmentId?(o=e.environmentId!==null&&e.cwd!==null?j.status({environmentId:e.environmentId,input:{cwd:e.cwd}}):null,t[3]=e.cwd,t[4]=e.environmentId,t[5]=o):o=t[5];let s=D(o),c;t[6]!==i||t[7]!==e?(c=async t=>K(e)===null?f(a(new k({operation:`run_change_request`,environmentId:e.environmentId,cwd:e.cwd}))):i(t),t[6]=i,t[7]=e,t[8]=c):c=t[8];let l=c,u;return t[9]!==l||t[10]!==e||t[11]!==s.refresh?(u={kind:`runStackedAction`,label:`Running source control action`,scope:e,action:l,onSuccess:s.refresh,managedExternally:!0},t[9]=l,t[10]=e,t[11]=s.refresh,t[12]=u):u=t[12],G(u)}function ce(e){let t=(0,V.c)(11),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=O(M.publishRepository,n),i;t[1]!==e.cwd||t[2]!==e.environmentId?(i=e.environmentId!==null&&e.cwd!==null?j.status({environmentId:e.environmentId,input:{cwd:e.cwd}}):null,t[1]=e.cwd,t[2]=e.environmentId,t[3]=i):i=t[3];let o=D(i),s;t[4]!==r||t[5]!==e?(s=async t=>{let n=K(e);return n===null?f(a(new k({operation:`publish_repository`,environmentId:e.environmentId,cwd:e.cwd}))):r({environmentId:n.environmentId,input:{cwd:n.cwd,...t}})},t[4]=r,t[5]=e,t[6]=s):s=t[6];let c=s,l;return t[7]!==c||t[8]!==e||t[9]!==o.refresh?(l={kind:`publishRepository`,label:`Publishing repository`,scope:e,action:c,onSuccess:o.refresh},t[7]=c,t[8]=e,t[9]=o.refresh,t[10]=l):l=t[10],G(l)}function Y(e){let t=(0,V.c)(7),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=O(U.preparePullRequestThread,n),i;t[1]!==r||t[2]!==e?(i=async t=>{let n=K(e);return n===null?f(a(new k({operation:`prepare_pull_request_thread`,environmentId:e.environmentId,cwd:e.cwd}))):t.mode===`worktree`&&t.threadId!==void 0&&!E(n.environmentId,`orchestration:operate`)?f(a(new m({requiredScope:c,message:`This connection cannot change threads.`}))):r({environmentId:n.environmentId,input:{cwd:n.cwd,reference:t.reference,mode:t.mode,...t.threadId?{threadId:t.threadId}:{}}})},t[1]=r,t[2]=e,t[3]=i):i=t[3];let o=i,s;return t[4]!==o||t[5]!==e?(s={kind:`preparePullRequestThread`,label:`Preparing pull request thread`,scope:e,action:o},t[4]=o,t[5]=e,t[6]=s):s=t[6],G(s)}function X(e){return e.environmentId===null||e.cwd===null||e.reference===null?null:d(i(l.get(U.pullRequestResolution({environmentId:e.environmentId,input:{cwd:e.cwd,reference:e.reference}}))))}function le(e){let t=(0,V.c)(12),n;t[0]!==e.cwd||t[1]!==e.environmentId||t[2]!==e.reference?(n=e.environmentId!==null&&e.cwd!==null&&e.reference!==null?U.pullRequestResolution({environmentId:e.environmentId,input:{cwd:e.cwd,reference:e.reference}}):null,t[0]=e.cwd,t[1]=e.environmentId,t[2]=e.reference,t[3]=n):n=t[3];let r=D(n),i;t[4]===e?i=t[5]:(i=X(e),t[4]=e,t[5]=i);let a=i,o=r.data??a,s=r.isPending&&a===null,c;return t[6]!==r.error||t[7]!==r.isPending||t[8]!==r.refresh||t[9]!==o||t[10]!==s?(c={data:o,error:r.error,isPending:s,isFetching:r.isPending,refresh:r.refresh},t[6]=r.error,t[7]=r.isPending,t[8]=r.refresh,t[9]=o,t[10]=s,t[11]=c):c=t[11],c}function ue(e,t){let n=(0,V.c)(10),r;n[0]===t?r=n[1]:(r=e=>L(e,t).settings.pullRequestMergeMethod,n[0]=t,n[1]=r);let i=C(e,r),a=w(de),o=w(I),s=ee(),c=S(),l;return n[2]!==e||n[3]!==o||n[4]!==a||n[5]!==c||n[6]!==i||n[7]!==t||n[8]!==s?(l=()=>{if(i!=null)return i;if(Object.keys(a).length===0)return;let n=s.find(n=>n.environmentId===e&&n.id===t);if(!n)return;let r=z({projects:s,settings:o,primaryEnvironmentId:c}).get(ae(n))??R(n,o);return a[r]},n[2]=e,n[3]=o,n[4]=a,n[5]=c,n[6]=i,n[7]=t,n[8]=s,n[9]=l):l=n[9],l}function de(e){return e.pullRequestMergeMethodOverrides}var fe={merge:`Merge requested`,ready:`Marked ready for review`,draft:`Converted to draft`,close:`Pull request closed`,reopen:`Pull request reopened`,"update-branch":`Branch updated with the base branch`,"enable-auto-merge":`Auto-merge enabled`,"disable-auto-merge":`Auto-merge disabled`,revert:`Revert pull request opened`,"delete-branch":`Branch deleted`,"approve-workflows":`Workflows approved`},pe={merge:`Could not merge this pull request`,ready:`Could not mark this ready for review`,draft:`Could not convert this to a draft`,close:`Could not close this pull request`,reopen:`Could not reopen this pull request`,"update-branch":`Could not update this branch`,"enable-auto-merge":`Could not enable auto-merge`,"disable-auto-merge":`Could not disable auto-merge`,revert:`Could not open a revert pull request`,"delete-branch":`Could not delete this branch`,"approve-workflows":`Could not approve workflows`},Z={merge:`The host refused the merge. Check that you have write access, that the checks it requires have passed, and that the branch is not conflicting.`,ready:`The host refused it. Check that you have write access to this repository.`,draft:`The host refused it. Check that you have write access to this repository.`,close:`The host refused it. Check that you have write access, or that you opened it.`,reopen:`The host refused it. Check that you have write access, and that the branch still exists.`,"update-branch":`The host refused it. Check that you have write access, and that the base branch has not diverged in a way the host cannot merge.`,"enable-auto-merge":`The host refused it. Check that auto-merge is enabled for this repository and that you have write access.`,"disable-auto-merge":`The host refused it. Check that you have write access to this repository.`,revert:`The host refused it. Check that you have write access and that this pull request was merged on the host.`,"delete-branch":`The host refused it. Check that you have write access to the source repository and that the branch has not moved since this page loaded.`,"approve-workflows":`The host refused it. Check that you have Actions write access and that these workflow runs are still awaiting approval.`};function me({environmentId:e,reference:t,onSuccess:n,resolveMergeMethod:r}){let i=O(P.runAction,{reportFailure:!1}),[a,o]=(0,B.useState)(!1),s=(0,B.useRef)(!1);return{actionPending:a,perform:async(a,c)=>{if(!(s.current||t===null)){s.current=!0,o(!0);try{let o=await i({environmentId:e,input:{...t,action:a,...c?{mergeMethod:c}:r?{resolveMergeMethod:r}:{}}});if(o._tag===`Failure`)throw v(o);x.add({type:`success`,title:fe[a]}),n?.(a)}catch(e){x.add({type:`error`,title:pe[a],description:F(e,Z[a])})}finally{s.current=!1,o(!1)}}}}}function Q(e){let t=O(P.runAction,{reportFailure:!1}),n=(0,B.useRef)(new Set),[r,i]=(0,B.useState)(()=>new Set);return{close:(0,B.useCallback)(async r=>{let a=r.filter(e=>{let t=N(e);return e.state!==`open`||n.current.has(t)?!1:(n.current.add(t),!0)});if(a.length===0)return;i(new Set(n.current));let o=0,s=[];await Promise.all(a.map(async r=>{try{let n=await t({environmentId:r.environmentId,input:{projectId:r.projectId,host:r.host,repository:r.repository,number:r.number,action:`close`}});if(n._tag===`Failure`)throw v(n);o++,e(r)}catch(e){s.push(`#${r.number}: ${F(e,Z.close)}`)}finally{n.current.delete(N(r)),i(new Set(n.current))}})),x.add({type:s.length>0?`error`:`success`,title:s.length>0?`Closed ${o} of ${a.length} pull requests`:`Closed ${o} pull request${o===1?``:`s`}`,...s.length>0?{description:s.slice(0,3).join(`
2
2
  `)}:{}})},[e,t]),closingKeys:r}}var $=new Map;function he(e){let t=(0,V.c)(21),{environmentId:n,detail:i}=e,a=ie(),o=i?.workspaceRoot??null,s;t[0]!==n||t[1]!==o?(s={environmentId:n,cwd:o},t[0]=n,t[1]=o,t[2]=s):s=t[2];let c=Y(s),[l,d]=(0,B.useState)(null),f;t[3]===a?f=t[4]:(f=async(e,t,n)=>{let i=n??await a(e).then(xe,be);if(i===null)return null;let o=r.getState();if(t===null)return i;let s=o.getComposerDraft(i.draftId),c=s?.reviewComments??[],l=re({prompt:s?.prompt??``,lastHandoffPrompt:$.get(i.draftId)},t.prompt);return $.set(i.draftId,t.prompt),o.setPrompt(i.draftId,l),o.setReviewComments(i.draftId,ne(c,t.reviewComments??[])),i},t[3]=a,t[4]=f);let p=f,m;t[5]!==i||t[6]!==n||t[7]!==l||t[8]!==p?(m=async(e,t)=>{if(!i||l!==null)return;d(e);let r=u(n,i.projectId),a=await p(r,t);d(null),a===null?x.add({type:`error`,title:`Could not open a thread`,description:`Try again from the project, or open a thread first.`}):x.add({type:`success`,title:`Asked in a thread`,description:t.prompt.length>0?`The question is in the composer — read it over, then send.`:`The pull request is in the composer — type your question, then send.`})},t[5]=i,t[6]=n,t[7]=l,t[8]=p,t[9]=m):m=t[9];let h=m,g;t[10]!==i||t[11]!==n||t[12]!==l||t[13]!==a||t[14]!==p||t[15]!==c?(g=async(e,t,r)=>{let o=r===void 0?`worktree`:r;if(!i||l!==null)return;d(e);let s=x.add({type:`loading`,title:`Preparing the pull request checkout...`}),f=u(n,i.projectId),m=await a(f).then(ye,ve);if(m===null){d(null),x.update(s,{type:`error`,title:`Could not open a thread for the checkout`,description:`Try again from the project, or open a thread first.`});return}let h=await c.run({reference:i.url,mode:o,threadId:m.threadId});if(h._tag===`Failure`){d(null);let e=c.error instanceof Error?c.error.message:null;x.update(s,{type:`error`,title:`Could not prepare the pull request checkout`,...e?{description:e}:{}});return}if(!await a(f,{branch:h.value.branch,worktreePath:h.value.worktreePath,envMode:h.value.worktreePath===null?`local`:`worktree`}).then(_e,ge)){d(null),x.update(s,{type:`error`,title:`Checked out, but the thread stayed where it was`,description:`The checkout is ready on \`${h.value.branch}\`. Point a thread at it from the branch picker, then ask again.`});return}d(null);let g={type:`warning`,title:`Checked out, but not on the latest commits`,description:`The checkout could not be moved onto the pull request's latest commits, so the code there is older than the pull request. Uncommitted work or local commits keep it where it is.`};t===null?x.update(s,h.value.isOnPullRequestHead?{type:`success`,title:o===`local`?`Checked out here`:`Checked out`,description:o===`local`?`This repository is on the pull request's branch, with a thread open on it.`:`The pull request is in its own worktree, with a thread open on it.`}:g):(await p(f,t,m),x.update(s,h.value.isOnPullRequestHead?{type:`success`,title:`Checkout ready`,description:`The task is in the composer — read it over, then send.`}:g))},t[10]=i,t[11]=n,t[12]=l,t[13]=a,t[14]=p,t[15]=c,t[16]=g):g=t[16];let _=g,v;return t[17]!==l||t[18]!==h||t[19]!==_?(v={handoff:l,startAsk:h,startHandoff:_},t[17]=l,t[18]=h,t[19]=_,t[20]=v):v=t[20],v}function ge(){return!1}function _e(e){return e!==null}function ve(){return null}function ye(e){return e}function be(){return null}function xe(e){return e}export{X as a,le as c,J as d,oe as f,he as i,q as l,Q as n,se as o,ue as r,Y as s,me as t,ce as u};
3
- //# sourceMappingURL=usePullRequestActions-BjCrAcbO.js.map
3
+ //# sourceMappingURL=usePullRequestActions-B6Nj3E46.js.map
@@ -1,2 +1,2 @@
1
- import{a as e,t}from"./react-BUfh6y28.js";import{Va as n,Vn as r}from"./utils-DBdIFVCj.js";var i=e(t());function a(e,t,a,o,s=!0){let{registerFieldControl:c}=r(),l=i.useRef(null);l.current||=Symbol(),n(()=>{let n=l.current;if(n&&s)return c(n,{controlRef:e,getValue:o,id:t,value:a}),()=>{c(n,void 0)}},[e,s,o,t,c,a])}export{a as t};
2
- //# sourceMappingURL=useRegisterFieldControl-DxvlOVA9.js.map
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{Va as n,Vn as r}from"./utils-BlwLA0C4.js";var i=e(t());function a(e,t,a,o,s=!0){let{registerFieldControl:c}=r(),l=i.useRef(null);l.current||=Symbol(),n(()=>{let n=l.current;if(n&&s)return c(n,{controlRef:e,getValue:o,id:t,value:a}),()=>{c(n,void 0)}},[e,s,o,t,c,a])}export{a as t};
2
+ //# sourceMappingURL=useRegisterFieldControl-y1AHmvVZ.js.map
@@ -1,2 +1,2 @@
1
- import{n as e}from"./jsx-runtime-DJeoFXNw.js";import{Ht as t,Nt as n,Vt as r}from"./utils-DBdIFVCj.js";import{T as i,i as a}from"./useSettings-BzfsGrZk.js";import{V as o}from"./settingsLayout-B5eZBFxv.js";var s=e();function c(e,c){let l=(0,s.c)(5),{targets:u}=o(),{environments:d}=i(),f;return l[0]!==c||l[1]!==d||l[2]!==e||l[3]!==u?(f=(i,o)=>{let s=c.find(e=>e.instanceId===i);for(let c of u){let l=d.find(e=>e.environmentId===c.environmentId),u=l?.serverConfig;if(!u)continue;let f=r(t(u.providers),c.settings,c.projectId).find(e=>e.instanceId===i),p=n(a(c.settings,e),u.providers).get(i);if(!f?.enabled||!f.isAvailable||f.driverKind!==s?.driverKind||!p?.some(e=>e.slug===o&&!e.isUnavailable))return`This model is unavailable on ${l?.label??`a selected environment`}. Select that environment to choose its model separately.`}return null},l[0]=c,l[1]=d,l[2]=e,l[3]=u,l[4]=f):f=l[4],f}export{c as t};
2
- //# sourceMappingURL=useScopedModelAvailability-CgXMs_Zc.js.map
1
+ import{n as e}from"./jsx-runtime-DJeoFXNw.js";import{Ht as t,Nt as n,Vt as r}from"./utils-BlwLA0C4.js";import{T as i,i as a}from"./useSettings-CyF6ezIl.js";import{V as o}from"./settingsLayout-D3zsCQTE.js";var s=e();function c(e,c){let l=(0,s.c)(5),{targets:u}=o(),{environments:d}=i(),f;return l[0]!==c||l[1]!==d||l[2]!==e||l[3]!==u?(f=(i,o)=>{let s=c.find(e=>e.instanceId===i);for(let c of u){let l=d.find(e=>e.environmentId===c.environmentId),u=l?.serverConfig;if(!u)continue;let f=r(t(u.providers),c.settings,c.projectId).find(e=>e.instanceId===i),p=n(a(c.settings,e),u.providers).get(i);if(!f?.enabled||!f.isAvailable||f.driverKind!==s?.driverKind||!p?.some(e=>e.slug===o&&!e.isUnavailable))return`This model is unavailable on ${l?.label??`a selected environment`}. Select that environment to choose its model separately.`}return null},l[0]=c,l[1]=d,l[2]=e,l[3]=u,l[4]=f):f=l[4],f}export{c as t};
2
+ //# sourceMappingURL=useScopedModelAvailability-Cb_UE0gJ.js.map
@@ -1,3 +1,3 @@
1
- import{a as e,t}from"./react-BUfh6y28.js";import{n}from"./jsx-runtime-DJeoFXNw.js";import{$v as r,Ab as i,CT as a,Cb as o,DS as s,Eh as c,El as l,Gh as u,I_ as d,Jb as f,Jh as ee,L_ as te,Lb as ne,Oh as re,Ol as ie,Os as ae,Pc as oe,Ph as se,R_ as ce,Sh as le,TS as ue,TT as p,Tb as de,Tl as fe,Ts as pe,Vg as me,Vh as he,Ws as ge,Yy as _e,Zo as ve,_b as ye,aE as m,as as h,cb as be,dv as xe,eS as Se,eb as Ce,fb as we,h_ as Te,iE as Ee,ix as De,js as Oe,kb as ke,kh as Ae,ks as je,lE as Me,ns as Ne,ox as Pe,p_ as Fe,ps as g,qb as Ie,qh as Le,rs as Re,rv as ze,rx as Be,sx as Ve,ts as _,tx as He,vh as Ue,xT as v,xh as We,yb as Ge}from"./utils-DBdIFVCj.js";import{At as Ke,E as qe,I as Je,R as Ye,Sn as Xe,T as Ze,W as Qe,_t as y}from"./runtime-CzKn37Ie.js";import{T as $e,Tt as et,kt as tt,t as nt}from"./runtime-BdUzhUUM.js";import{i as b}from"./toast-DJ2-4imd.js";import{f as x,h as S,m as rt,u as it}from"./server-BWUPVzyQ.js";import{i as at,n as ot,s as st,t as ct}from"./session-DO9vnR62.js";import{t as lt}from"./use-atom-command-D7oRayrc.js";import{D as ut,M as dt,N as ft,P as pt,S as mt,c as ht,i as C,n as w,o as gt,r as _t,x as vt,y as yt}from"./themePalette-kU5foqa6.js";var T=e(t(),1),E=n();function bt(e,t){if(e.size!==t.size)return!1;for(let[n,r]of e)if(t.get(n)!==r)return!1;return!0}function xt(e){let t=Re(t=>h(n=>{let r=n(e.catalogValueAtom).entries.get(t);if(r===void 0)return null;let i=Ee(ae(n(e.stateAtom(t))),()=>Xe);return{entry:r,connection:r.unsupportedReason===void 0?tt(i):{phase:`unsupported`,error:r.unsupportedReason,traceId:null},serverConfig:n(e.serverConfigValueAtom(t))}}).pipe(g(`environment-presentation:${t}`))),n=new Map;return{presentationAtom:t,presentationsAtom:h(r=>{let i=new Map;for(let n of r(e.catalogValueAtom).entries.keys()){let e=r(t(n));e!==null&&i.set(n,e)}return bt(n,i)||(n=i),n}).pipe(g(`environment-presentations`))}}function St(e,t){return{environmentId:e,environmentLabel:t.entry.target.label,displayUrl:et(t.entry)??``,isRelayManaged:Ke(t.entry),isEnabled:t.entry.enabled,connectionState:t.connection.phase,connectionError:t.connection.error,connectionErrorTraceId:t.connection.traceId}}function Ct(e){let t=h(t=>{let n=[...t(e.catalogValueAtom).entries.keys()],r=m(t.self());return r!==null&&r.length===n.length&&n.every((e,t)=>e===r[t])?r:n}),n=h(t=>{let n=[...t(e.catalogValueAtom).entries].map(([e,t])=>({environmentId:e,label:t.target.label})),r=m(t.self());return r!==null&&r.length===n.length&&n.every((e,t)=>e.environmentId===r[t]?.environmentId&&e.label===r[t]?.label)?r:n}),r=Re(t=>h(n=>{let r=n(e.presentationAtom(t));if(r===null)return null;let i=St(t,r),a=m(n.self());return a!==null&&a.environmentId===i.environmentId&&a.environmentLabel===i.environmentLabel&&a.displayUrl===i.displayUrl&&a.isRelayManaged===i.isRelayManaged&&a.isEnabled===i.isEnabled&&a.connectionState===i.connectionState&&a.connectionError===i.connectionError&&a.connectionErrorTraceId===i.connectionErrorTraceId?a:i})),i=h(t=>{let n=[];for(let i of t(e.catalogValueAtom).entries.keys()){let e=t(r(i));e!==null&&n.push(e)}let i=m(t.self());return i!==null&&i.length===n.length&&n.every((e,t)=>e===i[t])?i:n}).pipe(g(`environment-connection-summaries`));return{environmentIdsAtom:t,connectedEnvironmentIdsAtom:h(e=>{let n=e(t).filter(t=>e(r(t))?.connectionState===`connected`),i=m(e.self());return i!==null&&i.length===n.length&&n.every((e,t)=>e===i[t])?i:n}),identitiesAtom:n,environmentsAtom:i,machineByIdAtom:h(n=>{let r=new Map(n(t).map(t=>[t,ie(n(e.presentationAtom(t))?.serverConfig??null)])),i=m(n.self());return i!==null&&bt(i,r)?i:r}),pullRequestsSupportedAtom:h(n=>n(t).some(t=>n(e.presentationAtom(t))?.serverConfig?.environment.capabilities.pullRequests===!0))}}var D=xt({catalogValueAtom:S.catalogValueAtom,stateAtom:S.stateAtom,serverConfigValueAtom:x.configValueAtom}),wt=Ct({catalogValueAtom:S.catalogValueAtom,presentationAtom:D.presentationAtom}),Tt=h(null).pipe(g(`web-environment-presentation:empty`));function Et(e){let t=(0,E.c)(5),n=_(S.catalogValueAtom),r;t[0]===e?r=t[1]:(r=e===null?Tt:D.presentationAtom(e),t[0]=e,t[1]=r);let i=_(r),a;return t[2]!==n.isReady||t[3]!==i?(a={isReady:n.isReady,presentation:i},t[2]=n.isReady,t[3]=i,t[4]=a):a=t[4],a}var Dt={status:`idle`},O=Dt,k=null,A=[],j=0,Ot=new Set;function M(e){O=e;for(let e of Ot)e()}function kt(e){k?.resolve(e);for(let t of A)t.resolve(e);k=null,A=[]}function At(){return O}function jt(e){return Ot.add(e),()=>{Ot.delete(e)}}function Mt(){j+=1;let e=!0;return()=>{e&&(e=!1,j=Math.max(0,j-1),j===0&&(kt(!1),M(Dt)))}}function Nt(e,t){if(j!==0)return new Promise(n=>{let r={message:e,variant:t?.variant??`default`,resolve:n};k||O.status===`closing`?A.push(r):(k=r,M({status:`confirming`,message:e,variant:r.variant}))})}function Pt(){return O.status!==`idle`||k!==null||A.length>0}function Ft(e){if(O.status!==`confirming`||!k)return;let t=k;k=null,t.resolve(e),M({status:`closing`,message:O.message,variant:O.variant})}function It(){if(O.status!==`closing`)return;let e=A.shift();e?(k=e,M({status:`confirming`,message:e.message,variant:e.variant})):M(Dt)}var Lt={Ctrl:`⌃`,Alt:`⌥`,Shift:`⇧`,Super:`⌘`,CmdOrCtrl:`⌘`};function Rt(e,t=navigator.platform){let n=e.split(`+`),r=n.pop()??``;return oe(t)?`${n.map(e=>Lt[e]??e).join(``)}${r}`:[...n.map(e=>e===`CmdOrCtrl`?`Ctrl`:e===`Super`?`Meta`:e),r].join(`+`)}var zt=`http://www.w3.org/2000/svg`,Bt={archive:[{tag:`rect`,attrs:{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`}},{tag:`path`,attrs:{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`}},{tag:`path`,attrs:{d:`M10 12h4`}}],check:[{tag:`path`,attrs:{d:`M20 6 9 17l-5-5`}}],timer:[{tag:`line`,attrs:{x1:`10`,x2:`14`,y1:`2`,y2:`2`}},{tag:`line`,attrs:{x1:`12`,x2:`15`,y1:`14`,y2:`11`}},{tag:`circle`,attrs:{cx:`12`,cy:`14`,r:`8`}}],"chevron-right":[{tag:`path`,attrs:{d:`m9 19 7-7-7-7`}}],"circle-check":[{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`10`}},{tag:`path`,attrs:{d:`m9 12 2 2 4-4`}}],clock:[{tag:`path`,attrs:{d:`M12 6v6l4 2`}},{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`10`}}],pencil:[{tag:`path`,attrs:{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`}},{tag:`path`,attrs:{d:`m15 5 4 4`}}],copy:[{tag:`rect`,attrs:{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}},{tag:`path`,attrs:{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`}}],folder:[{tag:`path`,attrs:{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`}}],"git-branch":[{tag:`line`,attrs:{x1:`6`,x2:`6`,y1:`3`,y2:`15`}},{tag:`circle`,attrs:{cx:`18`,cy:`6`,r:`3`}},{tag:`circle`,attrs:{cx:`6`,cy:`18`,r:`3`}},{tag:`path`,attrs:{d:`M18 9a9 9 0 0 1-9 9`}}],eye:[{tag:`path`,attrs:{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`}},{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`3`}}],"eye-off":[{tag:`path`,attrs:{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`}},{tag:`path`,attrs:{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`}},{tag:`path`,attrs:{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`}},{tag:`path`,attrs:{d:`m2 2 20 20`}}],"app-window":[{tag:`rect`,attrs:{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`}},{tag:`path`,attrs:{d:`M10 4v4`}},{tag:`path`,attrs:{d:`M2 8h20`}},{tag:`path`,attrs:{d:`M6 4v4`}}],"arrow-up-right":[{tag:`path`,attrs:{d:`M7 7h10v10`}},{tag:`path`,attrs:{d:`M7 17 17 7`}}],"external-link":[{tag:`path`,attrs:{d:`M15 3h6v6`}},{tag:`path`,attrs:{d:`M10 14 21 3`}},{tag:`path`,attrs:{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`}}],link:[{tag:`path`,attrs:{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`}},{tag:`path`,attrs:{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`}}],list:[{tag:`path`,attrs:{d:`M3 5h.01`}},{tag:`path`,attrs:{d:`M3 12h.01`}},{tag:`path`,attrs:{d:`M3 19h.01`}},{tag:`path`,attrs:{d:`M8 5h13`}},{tag:`path`,attrs:{d:`M8 12h13`}},{tag:`path`,attrs:{d:`M8 19h13`}}],share:[{tag:`path`,attrs:{d:`M12 2v13`}},{tag:`path`,attrs:{d:`m16 6-4-4-4 4`}},{tag:`path`,attrs:{d:`M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8`}}],x:[{tag:`path`,attrs:{d:`M18 6 6 18`}},{tag:`path`,attrs:{d:`m6 6 12 12`}}],hash:[{tag:`line`,attrs:{x1:`4`,x2:`20`,y1:`9`,y2:`9`}},{tag:`line`,attrs:{x1:`4`,x2:`20`,y1:`15`,y2:`15`}},{tag:`line`,attrs:{x1:`10`,x2:`8`,y1:`3`,y2:`21`}},{tag:`line`,attrs:{x1:`16`,x2:`14`,y1:`3`,y2:`21`}}],"mail-open":[{tag:`path`,attrs:{d:`M21.2 8.4c.5.38.8.97.8 1.6v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V10a2 2 0 0 1 .8-1.6l8-6a2 2 0 0 1 2.4 0l8 6Z`}},{tag:`path`,attrs:{d:`m22 10-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 10`}}],"message-square-plus":[{tag:`path`,attrs:{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`}},{tag:`path`,attrs:{d:`M12 8v6`}},{tag:`path`,attrs:{d:`M9 11h6`}}],pin:[{tag:`path`,attrs:{d:`M12 17v5`}},{tag:`path`,attrs:{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`}}],"pin-off":[{tag:`path`,attrs:{d:`M12 17v5`}},{tag:`path`,attrs:{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`}},{tag:`path`,attrs:{d:`m2 2 20 20`}},{tag:`path`,attrs:{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`}}],"refresh-cw":[{tag:`path`,attrs:{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`}},{tag:`path`,attrs:{d:`M21 3v5h-5`}},{tag:`path`,attrs:{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`}},{tag:`path`,attrs:{d:`M8 16H3v5`}}],settings:[{tag:`path`,attrs:{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.38a2 2 0 0 0-.73-2.73l-.15-.09a2 2 0 0 1-1-1.74v-.51a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z`}},{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`3`}}],"folder-tree":[{tag:`path`,attrs:{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`}},{tag:`path`,attrs:{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`}},{tag:`path`,attrs:{d:`M3 5a2 2 0 0 0 2 2h3`}},{tag:`path`,attrs:{d:`M3 3v13a2 2 0 0 0 2 2h3`}}],trash:[{tag:`path`,attrs:{d:`M3 6h18`}},{tag:`path`,attrs:{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`}},{tag:`path`,attrs:{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`}},{tag:`line`,attrs:{x1:`10`,x2:`10`,y1:`11`,y2:`17`}},{tag:`line`,attrs:{x1:`14`,x2:`14`,y1:`11`,y2:`17`}}]};function Vt(e,t){let n=Bt[e];if(!n||typeof document.createElementNS!=`function`)return null;let r=document.createElementNS(zt,`svg`);r.setAttribute(`xmlns`,zt),r.setAttribute(`viewBox`,`0 0 24 24`),r.setAttribute(`fill`,`none`),r.setAttribute(`stroke`,`currentColor`),r.setAttribute(`stroke-width`,`2`),r.setAttribute(`stroke-linecap`,`round`),r.setAttribute(`stroke-linejoin`,`round`),r.setAttribute(`class`,t===`destructive`?`size-4.5 shrink-0 sm:size-4`:`size-4.5 shrink-0 text-muted-foreground sm:size-4`);for(let e of n){let t=document.createElementNS(zt,e.tag);for(let[n,r]of Object.entries(e.attrs))t.setAttribute(n,r);r.appendChild(t)}return r}function Ht(e,t,n){let r=e.getBoundingClientRect(),i=Math.min(Math.max(4,t),Math.max(4,window.innerWidth-r.width-4)),a=Math.min(Math.max(4,n),Math.max(4,window.innerHeight-r.height-4));e.style.left=`${i}px`,e.style.top=`${a}px`}function Ut(e,t){if(typeof Node<`u`&&e instanceof Node)return t.some(t=>t.contains(e));if(!e||typeof e!=`object`)return!1;let n=e;for(;n&&typeof n==`object`;){if(t.includes(n))return!0;n=n.parent}return!1}var N=null;function Wt(){return N!==null}function Gt(){N?.(),N=null}function Kt(e,t){return new Promise(n=>{let r=document.activeElement instanceof HTMLElement?document.activeElement:null,i=[],a=[],o=!1,s=!1,c=()=>l(null),l=e=>{if(o)return;o=!0,N===c&&(N=null),document.removeEventListener(`keydown`,u),document.removeEventListener(`pointerdown`,d,!0),document.removeEventListener(`contextmenu`,f,!0);let t=Ut(document.activeElement,i);for(let e of i)e.remove();t&&r?.isConnected&&r.focus({preventScroll:!0}),n(e)},u=e=>{e.key===`Escape`&&(e.preventDefault(),l(null))},d=e=>{s&&!Ut(e.target,i)&&l(null)},f=e=>{s&&!Ut(e.target,i)&&(e.preventDefault(),l(null))},ee=e=>{for(;i.length>e;)a.pop()?.setAttribute(`aria-expanded`,`false`),i.pop()?.remove()},te=(e,t,n,r,o)=>{ee(r);let c=document.createElement(`div`);c.className=`dropdown-glass fixed z-[10000] min-w-56 max-w-sm overflow-hidden rounded-lg bg-clip-padding text-popover-foreground outline-none`,c.style.cssText=`position:fixed;z-index:10000;min-width:14rem;max-width:24rem;overflow:hidden;border-radius:var(--radius-lg);background-clip:padding-box;color:var(--contrast-popover-foreground);outline:none;pointer-events:auto;`,c.style.left=`${t}px`,c.style.top=`${n}px`,c.dataset.level=String(r);let u=document.createElement(`div`);u.className=`max-h-[calc(100vh-0.5rem)] min-w-0 max-w-sm overflow-y-auto overflow-x-hidden p-1`,u.style.cssText=`max-height:calc(100vh - 0.5rem);min-width:0;max-width:24rem;overflow-x:hidden;overflow-y:auto;padding:0.25rem;`;for(let t of e){if(t.separatorBefore===!0&&u.children.length>0){let e=document.createElement(`div`);e.className=`mx-2 my-1 h-px bg-border`,e.style.cssText=`height:1px;margin:0.25rem 0.5rem;background:var(--contrast-border);`,e.dataset.contextMenuSeparator=`true`,e.setAttribute(`role`,`separator`),u.appendChild(e)}if(t.header===!0){let e=document.createElement(`div`);e.className=`px-2 py-1.5 font-medium text-muted-foreground text-xs`,e.textContent=t.label,u.appendChild(e);continue}let e=Array.isArray(t.children)&&t.children.length>0,n=!e&&(t.destructive===!0||t.id===`delete`),a=document.createElement(`button`);a.type=`button`;let o=t.disabled===!0;a.disabled=o;let c=`flex w-full cursor-default select-none items-center gap-2 rounded-sm px-2 py-1 text-left outline-none transition-colors sm:min-h-7 sm:text-sm min-h-8 text-base`;if(a.className=o?`${c} pointer-events-none cursor-not-allowed text-muted-foreground opacity-64`:n?`${c} text-destructive-foreground hover:bg-destructive/10 hover:text-destructive-foreground`:`${c} text-foreground hover:bg-accent hover:text-accent-foreground`,a.style.cssText=`display:flex;width:100%;min-height:1.75rem;align-items:center;gap:0.5rem;border:0;border-radius:var(--radius-sm);background:transparent;padding:0.25rem 0.5rem;color:var(--contrast-foreground);font-family:var(--font-sans,system-ui,sans-serif);font-size:0.875rem;line-height:1.25rem;text-align:left;cursor:default;`,n&&(a.style.color=`var(--destructive-foreground)`),o&&(a.style.color=`var(--contrast-muted-foreground)`,a.style.opacity=`0.64`,a.style.pointerEvents=`none`),typeof t.checked==`boolean`){a.setAttribute(`role`,`menuitemradio`),a.setAttribute(`aria-checked`,t.checked?`true`:`false`);let e=t.checked?Vt(`check`,`neutral`):null;if(e)a.appendChild(e);else{let e=document.createElement(`span`);e.className=`size-4.5 shrink-0 sm:size-4`,e.style.cssText=`display:inline-block;width:1rem;height:1rem;flex-shrink:0;`,e.setAttribute(`aria-hidden`,`true`),a.appendChild(e)}}else if(typeof t.icon==`string`){let e=Vt(t.icon,n?`destructive`:`neutral`);e&&a.appendChild(e)}let d=document.createElement(`span`);if(d.className=`min-w-0 flex-1 truncate`,d.textContent=t.label,a.appendChild(d),typeof t.accelerator==`string`){let e=document.createElement(`span`);e.className=`ms-6 shrink-0 text-muted-foreground text-xs tracking-widest`,e.style.cssText=`margin-inline-start:1.5rem;flex-shrink:0;color:var(--contrast-muted-foreground);font-size:0.75rem;letter-spacing:0.1em;`,e.textContent=Rt(t.accelerator),e.setAttribute(`aria-hidden`,`true`),a.setAttribute(`aria-keyshortcuts`,t.accelerator.replace(`CmdOrCtrl`,oe(navigator.platform)?`Meta`:`Control`)),a.appendChild(e)}if(e){a.setAttribute(`aria-haspopup`,`menu`),a.setAttribute(`aria-expanded`,`false`);let e=Vt(`chevron-right`,`neutral`);e&&(e.setAttribute(`class`,`-me-0.5 ms-auto size-4.5 shrink-0 text-muted-foreground opacity-80 sm:size-4`),e.setAttribute(`aria-hidden`,`true`),e.dataset.contextMenuChevron=`true`,a.appendChild(e))}if(!o){let o=!1,c=!1,u=()=>{let e=o||c;a.style.background=e?n?`color-mix(in srgb, var(--destructive) 10%, transparent)`:`var(--accent)`:`transparent`,a.style.color=e?n?`var(--destructive-foreground)`:`var(--contrast-accent-foreground)`:n?`var(--destructive-foreground)`:`var(--contrast-foreground)`};if(a.addEventListener(`mouseenter`,()=>{a.focus({preventScroll:!0}),o=!0,u()}),a.addEventListener(`mouseleave`,()=>{o=!1,u()}),a.addEventListener(`focus`,()=>{c=!0,u()}),a.addEventListener(`blur`,()=>{c=!1,u()}),e){let e=(e=!1)=>{let n=a.getBoundingClientRect(),o=n.right+4,s=n.top;te(t.children,o,s,r+1,a),a.setAttribute(`aria-expanded`,`true`);let c=i[r+1];if(!c)return;let l=c.getBoundingClientRect();l.right>window.innerWidth&&Ht(c,n.left-l.width-4,n.top),e&&[...c.querySelectorAll(`button`)].find(e=>!e.disabled)?.focus()};a.addEventListener(`mouseenter`,()=>{e()}),a.addEventListener(`click`,t=>{t.preventDefault(),e(!0)})}else a.addEventListener(`mouseenter`,()=>{ee(r+1)}),a.addEventListener(`click`,()=>{s&&l(t.id)})}u.appendChild(a)}c.appendChild(u),c.addEventListener(`mouseenter`,()=>{ee(r+1)}),document.body.appendChild(c),i[r]=c,a[r]=o,requestAnimationFrame(()=>{Ht(c,t,n)})};document.addEventListener(`keydown`,u),document.addEventListener(`pointerdown`,d,!0),document.addEventListener(`contextmenu`,f,!0),te(e,t?.x??0,t?.y??0,0),N&&N(),N=c,requestAnimationFrame(()=>{s=!0})})}var qt=`p4code:client-settings:v1`;function Jt(){return typeof window<`u`}function Yt(){return Jt()?je(qt,Ue):null}function Xt(e){Jt()&&Oe(qt,e,Ue)}var Zt;function Qt(){return{dialogs:{pickFolder:async e=>window.desktopBridge?window.desktopBridge.pickFolder(e):null,confirm:async(e,t)=>Nt(e,t)??!1},shell:{openExternal:async e=>{if(window.desktopBridge){if(!await window.desktopBridge.openExternal(e))throw Error(`Unable to open link.`)}else window.open(e,`_blank`,`noopener,noreferrer`)},openSystemSettings:async e=>{if(!window.desktopBridge?.openSystemSettings||!await window.desktopBridge.openSystemSettings(e))throw Error(`Unable to open System Settings.`)}},contextMenu:{show:async(e,t)=>window.desktopBridge?window.desktopBridge.showContextMenu(e,t):Kt(e,t),close:async()=>{window.desktopBridge||Gt()}},persistence:{getClientSettings:async()=>window.desktopBridge?window.desktopBridge.getClientSettings():Yt(),setClientSettings:async e=>{if(window.desktopBridge)return window.desktopBridge.setClientSettings(e);Xt(e)}}}}function $t(){return Qt()}function en(){if(typeof window<`u`)return Zt||(Zt=$t(),Zt)}function tn(){let e=en();if(!e)throw Error(`Local API not found`);return e}var P=`p4code:theme`,nn=`(prefers-color-scheme: dark)`,F={theme:`system`,resolvedTheme:`light`,systemDark:!1,followSystem:!0,appearanceMode:`system`,themeHalves:null};function rn(){return I()}function an(){return typeof window>`u`?{}:on()}function I(){if(typeof window>`u`)return null;try{return ut(window.localStorage.getItem(C))}catch{return null}}function on(){try{let e=JSON.parse(window.localStorage.getItem(`p4code:theme-halves:v1`)??`null`);if(typeof e!=`object`||!e)return{};let t={};for(let n of[`light`,`dark`]){let r=e[n];typeof r==`string`&&(t[n]=r)}return t}catch{return{}}}function L(e){return`${e?.light??``}|${e?.dark??``}`}var sn=`theme-color`,cn=`meta[name="${sn}"][data-dynamic-theme-color="true"]`,R=class extends we()(`ThemeStorageError`,{operation:Ce([`read`,`write`]),storageKey:be,theme:ne(gt),cause:_e()}){get message(){return`Failed to ${this.operation} theme preference for ${this.storageKey}.`}},ln=i(R),un=class extends we()(`DesktopThemeSyncError`,{theme:gt,cause:_e()}){get message(){return`Failed to sync the ${this.theme} theme to the desktop shell.`}},dn=i(un),z=[],B=null,fn=!0,V=null,H=null,U=null;function W(){fn=!0;for(let e of z)e()}function pn(){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(nn).matches}function mn(e){if(typeof window>`u`)return e===`system`;try{let e=window.localStorage.getItem(_t);if(e===`true`)return!0;if(e===`false`)return!1}catch{}return e===`system`}function hn(e){return e===`light`||e===`dark`||e===`system`}function G(e){if(typeof window<`u`)try{let e=window.localStorage.getItem(w);if(hn(e))return e}catch{}return mn(e)?`system`:yt(e)??`light`}function gn(e){if(typeof window<`u`)try{window.localStorage.setItem(w,e)}catch(e){throw new R({operation:`write`,storageKey:w,cause:e})}}function _n(){if(typeof window>`u`)return F.theme;let e;try{e=window.localStorage.getItem(P)}catch(e){throw new R({operation:`read`,storageKey:P,cause:e})}return e!==null&&mt(e)?e:F.theme}function vn(e){if(typeof window<`u`)try{window.localStorage.setItem(P,e),U=null}catch(t){throw new R({operation:`write`,storageKey:P,theme:e,cause:t})}}function K(){if(U!==null)return F.theme;try{return _n()}catch(e){let t=ln(e)?e:new R({operation:`read`,storageKey:P,cause:e});return U=t,console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...y(t)}),F.theme}}function yn(){let e=document.querySelector(cn);return e||(e=document.createElement(`meta`),e.name=sn,e.setAttribute(`data-dynamic-theme-color`,`true`),document.head.append(e),e)}function bn(e){let t=e?.trim().toLowerCase();return!t||t===`transparent`||t===`rgba(0, 0, 0, 0)`||t===`rgba(0 0 0 / 0)`?null:e?.trim()??null}function xn(){return document.querySelector(`main[data-slot='sidebar-inset']`)??document.querySelector(`[data-slot='sidebar-inner']`)??document.body}function Sn(){if(typeof document>`u`||typeof getComputedStyle>`u`)return;let e=getComputedStyle(document.documentElement),t=document.documentElement.dataset.themeId?bn(e.getPropertyValue(`--app-chrome-background`)):null,n=bn(getComputedStyle(xn()).backgroundColor),r=bn(getComputedStyle(document.body).backgroundColor),i=t??n??r;if(!i)return;document.documentElement.style.backgroundColor=i,document.body.style.backgroundColor=i;let a=document.querySelectorAll(`meta[name="${sn}"]`);if(a.length===0)yn().setAttribute(`content`,i);else for(let e of a)e.setAttribute(`content`,i)}function q(e,{suppressTransitions:t=!1,preservePreview:n=!0}={}){if(typeof document>`u`||typeof window>`u`||n&&document.documentElement.dataset?.themeId===`__preview`)return;let r=G(e),i=r===`system`,a=i?pn():!1,o=I();if(H?.theme===e&&H.systemDark===a&&H.followSystem===i&&H.appearanceMode===r&&L(H.themeHalves)===L(o)){wn(e,i,r);return}t&&document.documentElement.classList.add(`no-transitions`);let s=ft(e,a,i,r,o);ht(pt(e,o,s),s),document.documentElement.classList.toggle(`dark`,s===`dark`),H={theme:e,systemDark:a,followSystem:i,appearanceMode:r,themeHalves:o},Sn(),wn(e,i,r),t&&(document.documentElement.offsetHeight,requestAnimationFrame(()=>{document.documentElement.classList.remove(`no-transitions`)}))}async function Cn(e,t,n,r,i=I()){try{await e.setTheme(dt(t,n,r,i))}catch(e){throw new un({theme:t,cause:e})}}function wn(e,t,n){if(typeof window>`u`)return;let r=window.desktopBridge,i=I(),a=dt(e,t,n,i);r&&typeof r.setTheme==`function`&&V!==a&&(V=a,Cn(r,e,t,n,i).catch(t=>{let n=dn(t)?t:new un({theme:e,cause:t});console.error(n.message,{theme:n.theme,...y(n)}),V===a&&(V=null)}))}typeof document<`u`&&typeof window<`u`&&q(K());function Tn(){if(typeof window>`u`)return F;if(!fn&&B)return B;fn=!1;let e=K(),t=G(e),n=t===`system`,r=n?pn():!1,i=I(),a=ft(e,r,n,t,i);return B&&B.theme===e&&B.resolvedTheme===a&&B.systemDark===r&&B.followSystem===n&&B.appearanceMode===t&&L(B.themeHalves)===L(i)||(B={theme:e,resolvedTheme:a,systemDark:r,followSystem:n,appearanceMode:t,themeHalves:i}),B}function En(){return F}function Dn(){let e=K();G(e)===`system`&&q(e,{suppressTransitions:!0}),W()}function On(e){e.key===P?(U=null,q(K(),{suppressTransitions:!0}),W()):e.key===`p4code:theme-follow-system`||e.key===`p4code:theme-appearance-mode`||e.key===`p4code:theme-halves:v1`?(q(K(),{suppressTransitions:!0}),W()):(e.key===`p4code:themes:v1`||e.key===null)&&(e.key===null&&(U=null),vt(),H=null,q(K(),{suppressTransitions:!0}),W())}var kn=null;function An(e){if(typeof window>`u`)return()=>{};if(z.push(e),!kn){let e=typeof window.matchMedia==`function`?window.matchMedia(nn):null;e?.addEventListener(`change`,Dn),window.addEventListener(`storage`,On),kn=()=>{e?.removeEventListener(`change`,Dn),window.removeEventListener(`storage`,On)}}return()=>{z=z.filter(t=>t!==e),z.length===0&&(kn?.(),kn=null)}}function jn(){let e=(0,T.useSyncExternalStore)(An,Tn,En),{theme:t,resolvedTheme:n}=e,r=(0,T.useCallback)(e=>{if(typeof window>`u`)return!1;try{gn(G(K()));let t=window.localStorage.getItem(C);window.localStorage.removeItem(C);try{vn(e)}catch(e){if(t!==null)try{window.localStorage.setItem(C,t)}catch{}throw e}}catch(t){let n=ln(t)?t:new R({operation:`write`,storageKey:P,theme:e,cause:t});return console.error(n.message,{operation:n.operation,storageKey:n.storageKey,theme:e,...y(n)}),!1}return q(e,{suppressTransitions:!0}),W(),!0},[]),i=(0,T.useCallback)(e=>{if(typeof window>`u`)return!1;try{gn(e)}catch(e){let t=ln(e)?e:new R({operation:`write`,storageKey:w,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...y(t)}),!1}return U=null,q(K(),{suppressTransitions:!0}),W(),!0},[]),a=(0,T.useCallback)(e=>{let n=G(t),r=e?`system`:n===`system`?yt(t)??`light`:n;return i(r)},[i,t]),o=(0,T.useCallback)((e,t)=>{if(typeof window>`u`)return!1;try{let n={...on()};t===null?delete n[e]:n[e]=t,n.light===void 0&&n.dark===void 0?window.localStorage.removeItem(C):window.localStorage.setItem(C,JSON.stringify(n))}catch(e){let t=new R({operation:`write`,storageKey:C,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...y(t)}),!1}return q(K(),{suppressTransitions:!0}),W(),!0},[]),s=(0,T.useCallback)(()=>{if(typeof window>`u`)return!1;try{window.localStorage.removeItem(C)}catch(e){let t=new R({operation:`write`,storageKey:C,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...y(t)}),!1}return q(K(),{suppressTransitions:!0}),W(),!0},[]),c=(0,T.useCallback)(({preservePreview:e=!1}={})=>{typeof window<`u`&&(H=null,q(K(),{suppressTransitions:!0,preservePreview:e}),W())},[]);return(0,T.useEffect)(()=>{q(t)},[e.appearanceMode,t]),{theme:t,setTheme:r,setAppearanceMode:i,setFollowSystem:a,setThemeHalf:o,clearThemeHalves:s,refreshTheme:c,followSystem:e.followSystem,appearanceMode:e.appearanceMode,resolvedTheme:n,themeHalves:e.themeHalves}}var Mn=Ge(ke(ye)),Nn=Ve(e=>{let t=e.replace(/("(?:[^"\\]|\\.)*")|\/\/[^\n]*/g,(e,t)=>t?e:``);return t=t.replace(/("(?:[^"\\]|\\.)*")|\/\*[\s\S]*?\*\//g,(e,t)=>t?e:``),t=t.replace(/("(?:[^"\\]|\\.)*")|,(\s*[}\]])/g,(e,t,n)=>t?e:n??``),Mn(t).pipe(s(e=>e.issue))}),Pn=new He(Nn,Pe());De().pipe(Be(Pe({space:2})));var Fn=e=>be.pipe(o(e,Pn)),In={performance:{profile:`performance`,automaticGitFetchInterval:a(15),providerHealthRefreshInterval:v(1),hostPowerMonitorActiveInterval:a(30),hostPowerMonitorIdleInterval:v(2),idleClientTtl:a(45),pauseWhenHostLocked:!0,pauseWhenHostLowPower:!1,pauseWhenClientLowPower:!1,pauseWhenOnBattery:!1},balanced:{profile:`balanced`,automaticGitFetchInterval:We,providerHealthRefreshInterval:re,hostPowerMonitorActiveInterval:a(30),hostPowerMonitorIdleInterval:v(5),idleClientTtl:a(45),pauseWhenHostLocked:!0,pauseWhenHostLowPower:!0,pauseWhenClientLowPower:!0,pauseWhenOnBattery:!1},"battery-saver":{profile:`battery-saver`,automaticGitFetchInterval:a(0),providerHealthRefreshInterval:v(15),hostPowerMonitorActiveInterval:v(1),hostPowerMonitorIdleInterval:v(10),idleClientTtl:a(45),pauseWhenHostLocked:!0,pauseWhenHostLowPower:!0,pauseWhenClientLowPower:!0,pauseWhenOnBattery:!0}};function J(e){return In[e]}function Ln(e){return e.profile===`custom`?e.baseProfile??`balanced`:e.profile}function Rn(e){let t=Ln(e),n=In[t],r=e.profile===`custom`?e.overrides:{};return{profile:t,automaticGitFetchInterval:r.automaticGitFetchInterval??n.automaticGitFetchInterval,providerHealthRefreshInterval:r.providerHealthRefreshInterval??n.providerHealthRefreshInterval,hostPowerMonitorActiveInterval:r.hostPowerMonitorActiveInterval??n.hostPowerMonitorActiveInterval,hostPowerMonitorIdleInterval:r.hostPowerMonitorIdleInterval??n.hostPowerMonitorIdleInterval,idleClientTtl:r.idleClientTtl??n.idleClientTtl,pauseWhenHostLocked:r.pauseWhenHostLocked??n.pauseWhenHostLocked,pauseWhenHostLowPower:r.pauseWhenHostLowPower??n.pauseWhenHostLowPower,pauseWhenClientLowPower:r.pauseWhenClientLowPower??n.pauseWhenClientLowPower,pauseWhenOnBattery:r.pauseWhenOnBattery??n.pauseWhenOnBattery}}function Y(e,t){return p(e)===p(t)}function zn(e,t){return Y(e.automaticGitFetchInterval,t.automaticGitFetchInterval)&&Y(e.providerHealthRefreshInterval,t.providerHealthRefreshInterval)&&Y(e.hostPowerMonitorActiveInterval,t.hostPowerMonitorActiveInterval)&&Y(e.hostPowerMonitorIdleInterval,t.hostPowerMonitorIdleInterval)&&Y(e.idleClientTtl,t.idleClientTtl)&&e.pauseWhenHostLocked===t.pauseWhenHostLocked&&e.pauseWhenHostLowPower===t.pauseWhenHostLowPower&&e.pauseWhenClientLowPower===t.pauseWhenClientLowPower&&e.pauseWhenOnBattery===t.pauseWhenOnBattery}function Bn(e){if(e.profile!==`custom`)return{schemaVersion:1,profile:e.profile,overrides:{}};let t=Rn(e),n=[Ln(e),`balanced`,`performance`,`battery-saver`];for(let e of n)if(zn(t,In[e]))return{schemaVersion:1,profile:e,overrides:{}};let r=Ln(e),i=In[r];return{schemaVersion:1,profile:`custom`,baseProfile:r,overrides:{...Y(t.automaticGitFetchInterval,i.automaticGitFetchInterval)?{}:{automaticGitFetchInterval:t.automaticGitFetchInterval},...Y(t.providerHealthRefreshInterval,i.providerHealthRefreshInterval)?{}:{providerHealthRefreshInterval:t.providerHealthRefreshInterval},...Y(t.hostPowerMonitorActiveInterval,i.hostPowerMonitorActiveInterval)?{}:{hostPowerMonitorActiveInterval:t.hostPowerMonitorActiveInterval},...Y(t.hostPowerMonitorIdleInterval,i.hostPowerMonitorIdleInterval)?{}:{hostPowerMonitorIdleInterval:t.hostPowerMonitorIdleInterval},...Y(t.idleClientTtl,i.idleClientTtl)?{}:{idleClientTtl:t.idleClientTtl},...t.pauseWhenHostLocked===i.pauseWhenHostLocked?{}:{pauseWhenHostLocked:t.pauseWhenHostLocked},...t.pauseWhenHostLowPower===i.pauseWhenHostLowPower?{}:{pauseWhenHostLowPower:t.pauseWhenHostLowPower},...t.pauseWhenClientLowPower===i.pauseWhenClientLowPower?{}:{pauseWhenClientLowPower:t.pauseWhenClientLowPower},...t.pauseWhenOnBattery===i.pauseWhenOnBattery?{}:{pauseWhenOnBattery:t.pauseWhenOnBattery}}}}function Vn(e){let t={schemaVersion:1,profile:le,overrides:{}},n=e.backgroundActivity.profile===t.profile&&e.backgroundActivity.baseProfile===void 0&&Object.keys(e.backgroundActivity.overrides).length===0,r=e.backgroundActivityProfile,i=r!==`balanced`||p(e.automaticGitFetchInterval)!==p(We)||p(e.providerHealthRefreshInterval)!==p(re);return Rn(n&&i?{schemaVersion:1,profile:p(e.automaticGitFetchInterval)===p(J(r).automaticGitFetchInterval)&&p(e.providerHealthRefreshInterval)===p(J(r).providerHealthRefreshInterval)?r:`custom`,baseProfile:r,overrides:{...p(e.automaticGitFetchInterval)===p(J(r).automaticGitFetchInterval)?{}:{automaticGitFetchInterval:e.automaticGitFetchInterval},...p(e.providerHealthRefreshInterval)===p(J(r).providerHealthRefreshInterval)?{}:{providerHealthRefreshInterval:e.providerHealthRefreshInterval}}}:e.backgroundActivity)}function Hn(e){let t=Vn(e);return Bn({schemaVersion:1,profile:`custom`,baseProfile:t.profile,overrides:{automaticGitFetchInterval:t.automaticGitFetchInterval,providerHealthRefreshInterval:t.providerHealthRefreshInterval,hostPowerMonitorActiveInterval:t.hostPowerMonitorActiveInterval,hostPowerMonitorIdleInterval:t.hostPowerMonitorIdleInterval,idleClientTtl:t.idleClientTtl,pauseWhenHostLocked:t.pauseWhenHostLocked,pauseWhenHostLowPower:t.pauseWhenHostLowPower,pauseWhenClientLowPower:t.pauseWhenClientLowPower,pauseWhenOnBattery:t.pauseWhenOnBattery}})}var Un=Fn(se);de(Un);function Wn(e,t){let n=e.providerInstances[t.instanceId];return n===void 0?he(t.instanceId):ee(n)}var Gn=[`codex`,`claudeAgent`,`cursor`,`grok`,`muse`,`pi`,`opencode`,`antigravity`].map(e=>d.make(e));function Kn(e,t,n){let r=[...Gn.map(e=>[ce(e),e]),...n?.includeConfiguredInstances===!0?Object.entries(e).flatMap(([e,t])=>Gn.includes(t.driver)?[[te.make(e),t.driver]]:[]):[]].find(([e,n])=>t(e,n));if(r===void 0)return null;let[i,a]=r,o=n?.defaultModelSelection,s=e[i]?.config;return o?.instanceId===i&&ge(s?.customModels).some(e=>e.slug===o.model)?o:{instanceId:i,model:Te[a]??Fe[a]??`gpt-6-luna`}}function qn(e,t,n){let r=e.sourceControlWriterModelSelection;if(!r||!Le(e,n,r.instanceId))return e.textGenerationModelSelection;if(t===void 0)return r;let i=t.find(e=>e.instanceId===r.instanceId);return i?.enabled===!0&&fe(i)&&l(i)?r:e.textGenerationModelSelection}function Jn(e,t,n){let r=e.reviewGuideModelSelection;if(r&&Le(e,n,r.instanceId)){let e=t?.find(e=>e.instanceId===r.instanceId);if(t===void 0||e?.enabled===!0&&fe(e)&&l(e))return r}return qn(e,t,n)}function Yn(e,t={}){return{favorites:e.favorites??t.favorites??[],providerModelPreferences:e.providerModelPreferences??t.providerModelPreferences??{}}}function Xn(e,t){let n=e.favorites===null&&(t.favorites?.length??0)>0?t.favorites:void 0,r=e.providerModelPreferences===null&&Object.keys(t.providerModelPreferences??{}).length>0?t.providerModelPreferences:void 0;return n===void 0&&r===void 0?null:{migrateModelPreferences:{...n===void 0?{}:{favorites:n},...r===void 0?{}:{providerModelPreferences:r}}}}var Zn=new Set([`continueThreadsAfterServerUpdate`,`sidebarAutoSettleAfterDays`,`sidebarAutoSettleOnMerge`,`autoResumeLimitedThreads`,`snoozeLimitedThreads`,`newWorktreesStartFromOrigin`,`sourceControlWritingStyle`,`textGenerationModelSelection`]);function Qn(e){let t={},n={};for(let[r,i]of Object.entries(e))Zn.has(r)?t[r]=i:n[r]=i;return{sharedPatch:t,localPatch:n}}function $n(e,t,n,r=n,i=!1){let a=e.textGenerationModelSelection?.instanceId??r?.textGenerationModelSelection.instanceId;return!i&&e.textGenerationModelSelection&&(!n||a!==void 0&&(r?.providerInstances[a]?.driver??a)!==(n.providerInstances[a]?.driver??a)||!Wn(n,{...n.textGenerationModelSelection,...e.textGenerationModelSelection}))&&(e=f(e,[`textGenerationModelSelection`])),t?.threadRestartContinuation===!0?e:f(e,[`continueThreadsAfterServerUpdate`])}function er(e){return e.connection.phase===`connected`&&e.serverConfig?.environment.capabilities.threadAutoSettlement===!0}function tr(e){let t=e.atom(r(qe.pipe(ue(e=>me(e.state)))),{initialValue:Ze});return{stateAtom:t,stateValueAtom:h(e=>Ee(ae(e(t)),()=>Ze)).pipe(g(`relay-environment-discovery-value`)),refresh:Je(e,{label:`relay-environment-discovery:refresh`,concurrency:{mode:`singleFlight`,key:()=>`refresh`},execute:e=>qe.pipe(Se(e=>e.refresh))})}}var nr=tr(nt);function rr(e,t){return{...t,environmentId:e,label:t.entry.target.label,displayUrl:et(t.entry),relayManaged:Ke(t.entry)}}function ir(){let e=(0,E.c)(7),t=_(S.catalogValueAtom),n=_(S.networkStatusValueAtom),r=_(D.presentationsAtom),i;e[0]===r?i=e[1]:(i=[...r.entries()].map(ar),e[0]=r,e[1]=i);let a=i,o;return e[2]!==t.isReady||e[3]!==a||e[4]!==n||e[5]!==r?(o={isReady:t.isReady,networkStatus:n,environments:a,presentationById:r},e[2]=t.isReady,e[3]=a,e[4]=n,e[5]=r,e[6]=o):o=e[6],o}function ar(e){let[t,n]=e;return rr(t,n)}function or(){return _(rt)}function sr(e){let t=(0,E.c)(3),{presentation:n}=Et(e),r;return t[0]!==e||t[1]!==n?(r=e===null||n===null?null:rr(e,n),t[0]=e,t[1]=n,t[2]=r):r=t[2],r}function cr(){return sr(or())}function lr(e){let t=(0,E.c)(2),n=st(e),r;return t[0]===n?r=t[1]:(r=Me(n)?n.value.httpBaseUrl:null,t[0]=n,t[1]=r),r}function ur(){return _(nr.stateValueAtom)}function dr(){return _(wt.environmentIdsAtom)}function fr(){return _(wt.identitiesAtom)}function pr(){return _(wt.pullRequestsSupportedAtom)}var mr=`[CLIENT_SETTINGS]`,hr=new Set,gr=new Set,_r=c,X=`pending`,Z=null,vr=0,yr=Promise.resolve(),br=0;function xr(){for(let e of hr)e()}function Sr(){for(let e of gr)e()}function Q(){return _r}function Cr(e){_r=e,xr()}function wr(e){X!==e&&(X=e,Sr())}function Tr(e){return hr.add(e),$().catch(()=>void 0),()=>{hr.delete(e)}}function Er(){return X===`ready`}function Dr(){return X}function Or(e){return gr.add(e),$().catch(()=>void 0),()=>{gr.delete(e)}}async function $(){if(X===`ready`)return;if(Z)return Z;let e=vr;wr(X===`failed`||X===`retrying`?`retrying`:`pending`);let t=(async()=>{try{let t=await tn().persistence.getClientSettings();if(e!==vr)return;t&&Cr({...c,...t}),wr(`ready`)}catch(t){throw e===vr&&wr(`failed`),console.error(`${mr} hydrate failed`,{operation:`hydrate`,...y(t)}),t}})().finally(()=>{Z===t&&(Z=null)});return Z=t,Z}var kr=e=>tn().persistence.setClientSettings(e);function Ar(e){let t=yr.then(e);return yr=t.then(()=>void 0,()=>void 0),t}function jr(e,t=kr){let n=X!==`ready`||br>0;return n?br+=1:Cr({...Q(),...e}),Ar(async()=>{if(n)try{X!==`ready`&&await $(),Cr({...Q(),...e})}finally{--br}await t(Q())}).catch(e=>{console.error(`${mr} persist failed`,{operation:`persist`,...y(e)})})}async function Mr(e,t=kr){return Ar(async()=>{for(X!==`ready`&&await $();;){let n=Q(),r=e(n);if(await t(r),Q()===n)return Cr(r),r}})}var Nr=new Set(Ie(se.fields));function Pr(e){let t={},n={};for(let[r,i]of Object.entries(e))Nr.has(r)?t[r]=i:n[r]=i;return{serverPatch:t,clientPatch:n}}function Fr(){return Q()}function Ir(){return $()}function Lr(){return(0,T.useSyncExternalStore)(Or,Er,Rr)}function Rr(){return!1}function zr(){return(0,T.useSyncExternalStore)(Or,Dr,Br)}function Br(){return`pending`}function Vr(){return(0,T.useSyncExternalStore)(Tr,Q,Hr)}function Hr(){return c}function Ur(e,t){return{...t,...e,...Yn(e,t)}}var Wr=new Set;function Gr(e,t){let n=(0,E.c)(8),r=Vr(),i=Lr(),a;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={reportFailure:!1},n[0]=a):a=n[0];let o=lt(x.updateSettings,a),s,c;n[1]!==r||n[2]!==e||n[3]!==i||n[4]!==o||n[5]!==t?(s=()=>{if(!e||!t||!i||Wr.has(e))return;let n=Xn(t,r);n&&(Wr.add(e),o({environmentId:e,input:{patch:n}}).finally(()=>Wr.delete(e)))},c=[r,e,i,o,t],n[1]=r,n[2]=e,n[3]=i,n[4]=o,n[5]=t,n[6]=s,n[7]=c):(s=n[6],c=n[7]),(0,T.useEffect)(s,c)}function Kr(e,t){let n=(0,E.c)(6),r=Vr(),i;n[0]!==r||n[1]!==e?(i=Ur(e,r),n[0]=r,n[1]=e,n[2]=i):i=n[2];let a=i,o;return n[3]!==a||n[4]!==t?(o=t?t(a):a,n[3]=a,n[4]=t,n[5]=o):o=n[5],o}function qr(e){let t=(0,E.c)(3),n=Vr(),r;return t[0]!==e||t[1]!==n?(r=e?e(n):n,t[0]=e,t[1]=n,t[2]=r):r=t[2],r}async function Jr(e,t){return(e.favorites===null||e.providerModelPreferences===null)&&await Ir(),{...Xn(e,Fr()),...t}}function Yr(e){let t=(0,E.c)(6),n;t[0]===e?n=t[1]:(n=e?x.settingsValueAtom(e):Zr,t[0]=e,t[1]=n);let r=_(n),i=lt(x.updateSettings,`model preferences update`),a;return t[2]!==e||t[3]!==i||t[4]!==r?(a=async t=>{if(!e||!r)return;let n;try{n=await Jr(r,t)}catch{b.add({type:`error`,title:`Model preferences not saved`,description:`Could not load saved model preferences. Try again.`});return}return i({environmentId:e,input:{patch:n}})},t[2]=e,t[3]=i,t[4]=r,t[5]=a):a=t[5],a}function Xr(e){let t=(0,T.use)(Ne),n=(0,T.useRef)(new Map),r=Yr(e);return(0,T.useCallback)(async(i,a)=>{if(!e)return;let o=x.settingsValueAtom(e),s=t.get(o);if(!s)return;if(s.favorites===null)try{await Ir()}catch{b.add({type:`error`,title:`Favorites not saved`,description:`Could not load saved model preferences. Try again.`});return}let c=t.get(o)??s,l=Yn(c,Fr()).favorites,u=JSON.stringify([e,i,a]),d=n.current.get(u),f={favorite:!(d&&(d.pending||d.settings.favorites===c.favorites)?d.favorite:l.some(e=>e.provider===i&&e.model===a)),settings:c,pending:!0};n.current.set(u,f);try{let e=await r({setModelFavorites:[{provider:i,model:a,favorite:f.favorite}]});e&&pe(e)&&t.get(o)?.favorites===c.favorites&&(f.pending=!1)}finally{f.pending&&n.current.get(u)===f&&(d&&!d.pending&&t.get(o)?.favorites===d.settings.favorites?n.current.set(u,d):n.current.delete(u))}},[e,t,r])}var Zr=h(null);function Qr(e){let t=(0,E.c)(5),n;t[0]===e?n=t[1]:(n=e?x.settingsValueAtom(e):Zr,t[0]=e,t[1]=n);let r=_(n),i=Vr();Gr(e,r);let a=r??Ae,o;return t[2]!==i||t[3]!==a?(o=Yn(a,i),t[2]=i,t[3]=a,t[4]=o):o=t[4],o}function $r(e,t){let n=(0,E.c)(2),r;n[0]===e?r=n[1]:(r=x.settingsValueAtom(e),n[0]=e,n[1]=r);let i=_(r);return Gr(e,i),Kr(i??Ae,t)}function ei(e){let t=(0,E.c)(4),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=lt(x.mutateProviderInstance,n),i;return t[1]!==e||t[2]!==r?(i=(t,n)=>r({environmentId:e,input:{patch:n===void 0?{}:n,providerInstanceMutation:t}}),t[1]=e,t[2]=r,t[3]=i):i=t[3],i}function ti(e){let t=cr(),n=_(it);return Gr(t?.environmentId??null,t?.serverConfig?.settings??null),Kr(n,e)}var ni=`This setting is saved on a server, and the hosted app is not anchored to one. Change it from the desktop app or from the server's own address.`;function ri(){let e=(0,E.c)(2),t=cr(),n;return e[0]===t?n=e[1]:(n=t!==null||!$e(),e[0]=t,e[1]=n),n}function ii(e){let t=(0,E.c)(3),n=e!==void 0&&e,{environments:r}=ir(),i;return t[0]!==r||t[1]!==n?(i=h(e=>r.filter(er).flatMap(t=>{let r=e(ct.sessionStateAtom(t.environmentId));if(n&&r._tag===`Initial`)return[t.environmentId];let i=r._tag===`Failure`?null:m(ae(r));return i!==null&&xe(i,`settings:write`)?[t.environmentId]:[]})),t[0]=r,t[1]=n,t[2]=i):i=t[2],_(i)}function ai(e){let t=(0,E.c)(10);at(e,ze);let n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={label:`server settings update`,reportFailure:!1},t[0]=n):n=t[0];let r=lt(x.updateSettings,n),{environments:i}=ir(),a;t[1]!==i||t[2]!==r?(a=async e=>{let t=await r(e);if(t._tag===`Failure`&&!Ye(t)){let n=i.find(t=>t.environmentId===e.environmentId)?.label??e.environmentId,r=Qe(t);b.add({type:`error`,title:`Setting not saved`,description:`Could not save on ${n}: ${r instanceof Error?r.message:`The save failed. Try reconnecting and saving again.`}`})}return t},t[1]=i,t[2]=r,t[3]=a):a=t[3];let o=a,s=ii(!0),c;return t[4]!==e||t[5]!==i||t[6]!==r||t[7]!==o||t[8]!==s?(c=t=>{let{serverPatch:n,clientPatch:a}=Pr(t),c=e===null||u(n).every(t=>ot(e,t));if(Object.keys(n).length>0&&!c&&b.add({type:`warning`,title:`Setting not saved`,description:`This connection lacks permission to change settings on ${i.find(t=>t.environmentId===e)?.label??`the selected environment`}.`}),Object.keys(n).length>0&&c){let{sharedPatch:t,localPatch:a}=Qn(n),c=ui;if(Object.keys(a).length>0&&(e?o({environmentId:e,input:{patch:a}}):c()),Object.keys(t).length>0){let n=i.find(t=>t.environmentId===e)?.serverConfig?.settings,a=new Set(s);e&&a.add(e);let o=[],l=[];for(let r of a){let a=i.find(e=>e.environmentId===r),s=$n(t,a?.serverConfig?.environment.capabilities,a?.serverConfig?.settings,n,r===e);Object.keys(s).length!==0&&(ve.get(ct.sessionStateAtom(r))._tag!==`Initial`&&!u(t).every(e=>ot(r,e))?l.push(a?.label??r):o.push({environmentId:r,input:{patch:s}}))}o.length===0?c(l.length>0?`This connection lacks permission to change settings on ${l.join(`, `)}.`:a.size>0?`Update older servers to save this setting.`:void 0):Promise.all(o.map(async e=>({label:i.find(t=>t.environmentId===e.environmentId)?.label??e.environmentId,result:await r(e)}))).then(oi)}}Object.keys(a).length>0&&jr(a)},t[4]=e,t[5]=i,t[6]=r,t[7]=o,t[8]=s,t[9]=c):c=t[9],c}function oi(e){let t=e.flatMap(li);if(t.length===0)return;let n=e.filter(ci).map(si);b.add({type:`error`,title:n.length>0?`Setting saved on some environments`:`Setting not saved`,description:[...t,...n.length>0?[`Saved on ${n.join(`, `)}.`]:[]].join(`
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{n}from"./jsx-runtime-DJeoFXNw.js";import{$v as r,Ab as i,CT as a,Cb as o,DS as s,Eh as c,El as l,Gh as u,I_ as d,Jb as f,Jh as ee,L_ as te,Lb as ne,Oh as re,Ol as ie,Os as ae,Pc as oe,Ph as se,R_ as ce,Sh as le,TS as ue,TT as p,Tb as de,Tl as fe,Ts as pe,Vg as me,Vh as he,Ws as ge,Yy as _e,Zo as ve,_b as ye,aE as m,as as h,cb as be,dv as xe,eS as Se,eb as Ce,fb as we,h_ as Te,iE as Ee,ix as De,js as Oe,kb as ke,kh as Ae,ks as je,lE as Me,ns as Ne,ox as Pe,p_ as Fe,ps as g,qb as Ie,qh as Le,rs as Re,rv as ze,rx as Be,sx as Ve,ts as _,tx as He,vh as Ue,xT as v,xh as We,yb as Ge}from"./utils-BlwLA0C4.js";import{At as Ke,E as qe,I as Je,R as Ye,Sn as Xe,T as Ze,W as Qe,_t as y}from"./runtime-DYpzE3gq.js";import{T as $e,Tt as et,kt as tt,t as nt}from"./runtime-Csw1ghUb.js";import{i as b}from"./toast-C1lIuL0v.js";import{f as x,h as S,m as rt,u as it}from"./server-DXSwZxzT.js";import{i as at,n as ot,s as st,t as ct}from"./session-meZM9Xpf.js";import{t as lt}from"./use-atom-command-sg76DXcz.js";import{D as ut,M as dt,N as ft,P as pt,S as mt,c as ht,i as C,n as w,o as gt,r as _t,x as vt,y as yt}from"./themePalette-B5YWcpxp.js";var T=e(t(),1),E=n();function bt(e,t){if(e.size!==t.size)return!1;for(let[n,r]of e)if(t.get(n)!==r)return!1;return!0}function xt(e){let t=Re(t=>h(n=>{let r=n(e.catalogValueAtom).entries.get(t);if(r===void 0)return null;let i=Ee(ae(n(e.stateAtom(t))),()=>Xe);return{entry:r,connection:r.unsupportedReason===void 0?tt(i):{phase:`unsupported`,error:r.unsupportedReason,traceId:null},serverConfig:n(e.serverConfigValueAtom(t))}}).pipe(g(`environment-presentation:${t}`))),n=new Map;return{presentationAtom:t,presentationsAtom:h(r=>{let i=new Map;for(let n of r(e.catalogValueAtom).entries.keys()){let e=r(t(n));e!==null&&i.set(n,e)}return bt(n,i)||(n=i),n}).pipe(g(`environment-presentations`))}}function St(e,t){return{environmentId:e,environmentLabel:t.entry.target.label,displayUrl:et(t.entry)??``,isRelayManaged:Ke(t.entry),isEnabled:t.entry.enabled,connectionState:t.connection.phase,connectionError:t.connection.error,connectionErrorTraceId:t.connection.traceId}}function Ct(e){let t=h(t=>{let n=[...t(e.catalogValueAtom).entries.keys()],r=m(t.self());return r!==null&&r.length===n.length&&n.every((e,t)=>e===r[t])?r:n}),n=h(t=>{let n=[...t(e.catalogValueAtom).entries].map(([e,t])=>({environmentId:e,label:t.target.label})),r=m(t.self());return r!==null&&r.length===n.length&&n.every((e,t)=>e.environmentId===r[t]?.environmentId&&e.label===r[t]?.label)?r:n}),r=Re(t=>h(n=>{let r=n(e.presentationAtom(t));if(r===null)return null;let i=St(t,r),a=m(n.self());return a!==null&&a.environmentId===i.environmentId&&a.environmentLabel===i.environmentLabel&&a.displayUrl===i.displayUrl&&a.isRelayManaged===i.isRelayManaged&&a.isEnabled===i.isEnabled&&a.connectionState===i.connectionState&&a.connectionError===i.connectionError&&a.connectionErrorTraceId===i.connectionErrorTraceId?a:i})),i=h(t=>{let n=[];for(let i of t(e.catalogValueAtom).entries.keys()){let e=t(r(i));e!==null&&n.push(e)}let i=m(t.self());return i!==null&&i.length===n.length&&n.every((e,t)=>e===i[t])?i:n}).pipe(g(`environment-connection-summaries`));return{environmentIdsAtom:t,connectedEnvironmentIdsAtom:h(e=>{let n=e(t).filter(t=>e(r(t))?.connectionState===`connected`),i=m(e.self());return i!==null&&i.length===n.length&&n.every((e,t)=>e===i[t])?i:n}),identitiesAtom:n,environmentsAtom:i,machineByIdAtom:h(n=>{let r=new Map(n(t).map(t=>[t,ie(n(e.presentationAtom(t))?.serverConfig??null)])),i=m(n.self());return i!==null&&bt(i,r)?i:r}),pullRequestsSupportedAtom:h(n=>n(t).some(t=>n(e.presentationAtom(t))?.serverConfig?.environment.capabilities.pullRequests===!0))}}var D=xt({catalogValueAtom:S.catalogValueAtom,stateAtom:S.stateAtom,serverConfigValueAtom:x.configValueAtom}),wt=Ct({catalogValueAtom:S.catalogValueAtom,presentationAtom:D.presentationAtom}),Tt=h(null).pipe(g(`web-environment-presentation:empty`));function Et(e){let t=(0,E.c)(5),n=_(S.catalogValueAtom),r;t[0]===e?r=t[1]:(r=e===null?Tt:D.presentationAtom(e),t[0]=e,t[1]=r);let i=_(r),a;return t[2]!==n.isReady||t[3]!==i?(a={isReady:n.isReady,presentation:i},t[2]=n.isReady,t[3]=i,t[4]=a):a=t[4],a}var Dt={status:`idle`},O=Dt,k=null,A=[],j=0,Ot=new Set;function M(e){O=e;for(let e of Ot)e()}function kt(e){k?.resolve(e);for(let t of A)t.resolve(e);k=null,A=[]}function At(){return O}function jt(e){return Ot.add(e),()=>{Ot.delete(e)}}function Mt(){j+=1;let e=!0;return()=>{e&&(e=!1,j=Math.max(0,j-1),j===0&&(kt(!1),M(Dt)))}}function Nt(e,t){if(j!==0)return new Promise(n=>{let r={message:e,variant:t?.variant??`default`,resolve:n};k||O.status===`closing`?A.push(r):(k=r,M({status:`confirming`,message:e,variant:r.variant}))})}function Pt(){return O.status!==`idle`||k!==null||A.length>0}function Ft(e){if(O.status!==`confirming`||!k)return;let t=k;k=null,t.resolve(e),M({status:`closing`,message:O.message,variant:O.variant})}function It(){if(O.status!==`closing`)return;let e=A.shift();e?(k=e,M({status:`confirming`,message:e.message,variant:e.variant})):M(Dt)}var Lt={Ctrl:`⌃`,Alt:`⌥`,Shift:`⇧`,Super:`⌘`,CmdOrCtrl:`⌘`};function Rt(e,t=navigator.platform){let n=e.split(`+`),r=n.pop()??``;return oe(t)?`${n.map(e=>Lt[e]??e).join(``)}${r}`:[...n.map(e=>e===`CmdOrCtrl`?`Ctrl`:e===`Super`?`Meta`:e),r].join(`+`)}var zt=`http://www.w3.org/2000/svg`,Bt={archive:[{tag:`rect`,attrs:{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`}},{tag:`path`,attrs:{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`}},{tag:`path`,attrs:{d:`M10 12h4`}}],check:[{tag:`path`,attrs:{d:`M20 6 9 17l-5-5`}}],timer:[{tag:`line`,attrs:{x1:`10`,x2:`14`,y1:`2`,y2:`2`}},{tag:`line`,attrs:{x1:`12`,x2:`15`,y1:`14`,y2:`11`}},{tag:`circle`,attrs:{cx:`12`,cy:`14`,r:`8`}}],"chevron-right":[{tag:`path`,attrs:{d:`m9 19 7-7-7-7`}}],"circle-check":[{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`10`}},{tag:`path`,attrs:{d:`m9 12 2 2 4-4`}}],clock:[{tag:`path`,attrs:{d:`M12 6v6l4 2`}},{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`10`}}],pencil:[{tag:`path`,attrs:{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`}},{tag:`path`,attrs:{d:`m15 5 4 4`}}],copy:[{tag:`rect`,attrs:{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}},{tag:`path`,attrs:{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`}}],folder:[{tag:`path`,attrs:{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`}}],"git-branch":[{tag:`line`,attrs:{x1:`6`,x2:`6`,y1:`3`,y2:`15`}},{tag:`circle`,attrs:{cx:`18`,cy:`6`,r:`3`}},{tag:`circle`,attrs:{cx:`6`,cy:`18`,r:`3`}},{tag:`path`,attrs:{d:`M18 9a9 9 0 0 1-9 9`}}],eye:[{tag:`path`,attrs:{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`}},{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`3`}}],"eye-off":[{tag:`path`,attrs:{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`}},{tag:`path`,attrs:{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`}},{tag:`path`,attrs:{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`}},{tag:`path`,attrs:{d:`m2 2 20 20`}}],"app-window":[{tag:`rect`,attrs:{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`}},{tag:`path`,attrs:{d:`M10 4v4`}},{tag:`path`,attrs:{d:`M2 8h20`}},{tag:`path`,attrs:{d:`M6 4v4`}}],"arrow-up-right":[{tag:`path`,attrs:{d:`M7 7h10v10`}},{tag:`path`,attrs:{d:`M7 17 17 7`}}],"external-link":[{tag:`path`,attrs:{d:`M15 3h6v6`}},{tag:`path`,attrs:{d:`M10 14 21 3`}},{tag:`path`,attrs:{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`}}],link:[{tag:`path`,attrs:{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`}},{tag:`path`,attrs:{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`}}],list:[{tag:`path`,attrs:{d:`M3 5h.01`}},{tag:`path`,attrs:{d:`M3 12h.01`}},{tag:`path`,attrs:{d:`M3 19h.01`}},{tag:`path`,attrs:{d:`M8 5h13`}},{tag:`path`,attrs:{d:`M8 12h13`}},{tag:`path`,attrs:{d:`M8 19h13`}}],share:[{tag:`path`,attrs:{d:`M12 2v13`}},{tag:`path`,attrs:{d:`m16 6-4-4-4 4`}},{tag:`path`,attrs:{d:`M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8`}}],x:[{tag:`path`,attrs:{d:`M18 6 6 18`}},{tag:`path`,attrs:{d:`m6 6 12 12`}}],hash:[{tag:`line`,attrs:{x1:`4`,x2:`20`,y1:`9`,y2:`9`}},{tag:`line`,attrs:{x1:`4`,x2:`20`,y1:`15`,y2:`15`}},{tag:`line`,attrs:{x1:`10`,x2:`8`,y1:`3`,y2:`21`}},{tag:`line`,attrs:{x1:`16`,x2:`14`,y1:`3`,y2:`21`}}],"mail-open":[{tag:`path`,attrs:{d:`M21.2 8.4c.5.38.8.97.8 1.6v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V10a2 2 0 0 1 .8-1.6l8-6a2 2 0 0 1 2.4 0l8 6Z`}},{tag:`path`,attrs:{d:`m22 10-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 10`}}],"message-square-plus":[{tag:`path`,attrs:{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`}},{tag:`path`,attrs:{d:`M12 8v6`}},{tag:`path`,attrs:{d:`M9 11h6`}}],pin:[{tag:`path`,attrs:{d:`M12 17v5`}},{tag:`path`,attrs:{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`}}],"pin-off":[{tag:`path`,attrs:{d:`M12 17v5`}},{tag:`path`,attrs:{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`}},{tag:`path`,attrs:{d:`m2 2 20 20`}},{tag:`path`,attrs:{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`}}],"refresh-cw":[{tag:`path`,attrs:{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`}},{tag:`path`,attrs:{d:`M21 3v5h-5`}},{tag:`path`,attrs:{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`}},{tag:`path`,attrs:{d:`M8 16H3v5`}}],settings:[{tag:`path`,attrs:{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.38a2 2 0 0 0-.73-2.73l-.15-.09a2 2 0 0 1-1-1.74v-.51a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z`}},{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`3`}}],"folder-tree":[{tag:`path`,attrs:{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`}},{tag:`path`,attrs:{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`}},{tag:`path`,attrs:{d:`M3 5a2 2 0 0 0 2 2h3`}},{tag:`path`,attrs:{d:`M3 3v13a2 2 0 0 0 2 2h3`}}],trash:[{tag:`path`,attrs:{d:`M3 6h18`}},{tag:`path`,attrs:{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`}},{tag:`path`,attrs:{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`}},{tag:`line`,attrs:{x1:`10`,x2:`10`,y1:`11`,y2:`17`}},{tag:`line`,attrs:{x1:`14`,x2:`14`,y1:`11`,y2:`17`}}]};function Vt(e,t){let n=Bt[e];if(!n||typeof document.createElementNS!=`function`)return null;let r=document.createElementNS(zt,`svg`);r.setAttribute(`xmlns`,zt),r.setAttribute(`viewBox`,`0 0 24 24`),r.setAttribute(`fill`,`none`),r.setAttribute(`stroke`,`currentColor`),r.setAttribute(`stroke-width`,`2`),r.setAttribute(`stroke-linecap`,`round`),r.setAttribute(`stroke-linejoin`,`round`),r.setAttribute(`class`,t===`destructive`?`size-4.5 shrink-0 sm:size-4`:`size-4.5 shrink-0 text-muted-foreground sm:size-4`);for(let e of n){let t=document.createElementNS(zt,e.tag);for(let[n,r]of Object.entries(e.attrs))t.setAttribute(n,r);r.appendChild(t)}return r}function Ht(e,t,n){let r=e.getBoundingClientRect(),i=Math.min(Math.max(4,t),Math.max(4,window.innerWidth-r.width-4)),a=Math.min(Math.max(4,n),Math.max(4,window.innerHeight-r.height-4));e.style.left=`${i}px`,e.style.top=`${a}px`}function Ut(e,t){if(typeof Node<`u`&&e instanceof Node)return t.some(t=>t.contains(e));if(!e||typeof e!=`object`)return!1;let n=e;for(;n&&typeof n==`object`;){if(t.includes(n))return!0;n=n.parent}return!1}var N=null;function Wt(){return N!==null}function Gt(){N?.(),N=null}function Kt(e,t){return new Promise(n=>{let r=document.activeElement instanceof HTMLElement?document.activeElement:null,i=[],a=[],o=!1,s=!1,c=()=>l(null),l=e=>{if(o)return;o=!0,N===c&&(N=null),document.removeEventListener(`keydown`,u),document.removeEventListener(`pointerdown`,d,!0),document.removeEventListener(`contextmenu`,f,!0);let t=Ut(document.activeElement,i);for(let e of i)e.remove();t&&r?.isConnected&&r.focus({preventScroll:!0}),n(e)},u=e=>{e.key===`Escape`&&(e.preventDefault(),l(null))},d=e=>{s&&!Ut(e.target,i)&&l(null)},f=e=>{s&&!Ut(e.target,i)&&(e.preventDefault(),l(null))},ee=e=>{for(;i.length>e;)a.pop()?.setAttribute(`aria-expanded`,`false`),i.pop()?.remove()},te=(e,t,n,r,o)=>{ee(r);let c=document.createElement(`div`);c.className=`dropdown-glass fixed z-[10000] min-w-56 max-w-sm overflow-hidden rounded-lg bg-clip-padding text-popover-foreground outline-none`,c.style.cssText=`position:fixed;z-index:10000;min-width:14rem;max-width:24rem;overflow:hidden;border-radius:var(--radius-lg);background-clip:padding-box;color:var(--contrast-popover-foreground);outline:none;pointer-events:auto;`,c.style.left=`${t}px`,c.style.top=`${n}px`,c.dataset.level=String(r);let u=document.createElement(`div`);u.className=`max-h-[calc(100vh-0.5rem)] min-w-0 max-w-sm overflow-y-auto overflow-x-hidden p-1`,u.style.cssText=`max-height:calc(100vh - 0.5rem);min-width:0;max-width:24rem;overflow-x:hidden;overflow-y:auto;padding:0.25rem;`;for(let t of e){if(t.separatorBefore===!0&&u.children.length>0){let e=document.createElement(`div`);e.className=`mx-2 my-1 h-px bg-border`,e.style.cssText=`height:1px;margin:0.25rem 0.5rem;background:var(--contrast-border);`,e.dataset.contextMenuSeparator=`true`,e.setAttribute(`role`,`separator`),u.appendChild(e)}if(t.header===!0){let e=document.createElement(`div`);e.className=`px-2 py-1.5 font-medium text-muted-foreground text-xs`,e.textContent=t.label,u.appendChild(e);continue}let e=Array.isArray(t.children)&&t.children.length>0,n=!e&&(t.destructive===!0||t.id===`delete`),a=document.createElement(`button`);a.type=`button`;let o=t.disabled===!0;a.disabled=o;let c=`flex w-full cursor-default select-none items-center gap-2 rounded-sm px-2 py-1 text-left outline-none transition-colors sm:min-h-7 sm:text-sm min-h-8 text-base`;if(a.className=o?`${c} pointer-events-none cursor-not-allowed text-muted-foreground opacity-64`:n?`${c} text-destructive-foreground hover:bg-destructive/10 hover:text-destructive-foreground`:`${c} text-foreground hover:bg-accent hover:text-accent-foreground`,a.style.cssText=`display:flex;width:100%;min-height:1.75rem;align-items:center;gap:0.5rem;border:0;border-radius:var(--radius-sm);background:transparent;padding:0.25rem 0.5rem;color:var(--contrast-foreground);font-family:var(--font-sans,system-ui,sans-serif);font-size:0.875rem;line-height:1.25rem;text-align:left;cursor:default;`,n&&(a.style.color=`var(--destructive-foreground)`),o&&(a.style.color=`var(--contrast-muted-foreground)`,a.style.opacity=`0.64`,a.style.pointerEvents=`none`),typeof t.checked==`boolean`){a.setAttribute(`role`,`menuitemradio`),a.setAttribute(`aria-checked`,t.checked?`true`:`false`);let e=t.checked?Vt(`check`,`neutral`):null;if(e)a.appendChild(e);else{let e=document.createElement(`span`);e.className=`size-4.5 shrink-0 sm:size-4`,e.style.cssText=`display:inline-block;width:1rem;height:1rem;flex-shrink:0;`,e.setAttribute(`aria-hidden`,`true`),a.appendChild(e)}}else if(typeof t.icon==`string`){let e=Vt(t.icon,n?`destructive`:`neutral`);e&&a.appendChild(e)}let d=document.createElement(`span`);if(d.className=`min-w-0 flex-1 truncate`,d.textContent=t.label,a.appendChild(d),typeof t.accelerator==`string`){let e=document.createElement(`span`);e.className=`ms-6 shrink-0 text-muted-foreground text-xs tracking-widest`,e.style.cssText=`margin-inline-start:1.5rem;flex-shrink:0;color:var(--contrast-muted-foreground);font-size:0.75rem;letter-spacing:0.1em;`,e.textContent=Rt(t.accelerator),e.setAttribute(`aria-hidden`,`true`),a.setAttribute(`aria-keyshortcuts`,t.accelerator.replace(`CmdOrCtrl`,oe(navigator.platform)?`Meta`:`Control`)),a.appendChild(e)}if(e){a.setAttribute(`aria-haspopup`,`menu`),a.setAttribute(`aria-expanded`,`false`);let e=Vt(`chevron-right`,`neutral`);e&&(e.setAttribute(`class`,`-me-0.5 ms-auto size-4.5 shrink-0 text-muted-foreground opacity-80 sm:size-4`),e.setAttribute(`aria-hidden`,`true`),e.dataset.contextMenuChevron=`true`,a.appendChild(e))}if(!o){let o=!1,c=!1,u=()=>{let e=o||c;a.style.background=e?n?`color-mix(in srgb, var(--destructive) 10%, transparent)`:`var(--accent)`:`transparent`,a.style.color=e?n?`var(--destructive-foreground)`:`var(--contrast-accent-foreground)`:n?`var(--destructive-foreground)`:`var(--contrast-foreground)`};if(a.addEventListener(`mouseenter`,()=>{a.focus({preventScroll:!0}),o=!0,u()}),a.addEventListener(`mouseleave`,()=>{o=!1,u()}),a.addEventListener(`focus`,()=>{c=!0,u()}),a.addEventListener(`blur`,()=>{c=!1,u()}),e){let e=(e=!1)=>{let n=a.getBoundingClientRect(),o=n.right+4,s=n.top;te(t.children,o,s,r+1,a),a.setAttribute(`aria-expanded`,`true`);let c=i[r+1];if(!c)return;let l=c.getBoundingClientRect();l.right>window.innerWidth&&Ht(c,n.left-l.width-4,n.top),e&&[...c.querySelectorAll(`button`)].find(e=>!e.disabled)?.focus()};a.addEventListener(`mouseenter`,()=>{e()}),a.addEventListener(`click`,t=>{t.preventDefault(),e(!0)})}else a.addEventListener(`mouseenter`,()=>{ee(r+1)}),a.addEventListener(`click`,()=>{s&&l(t.id)})}u.appendChild(a)}c.appendChild(u),c.addEventListener(`mouseenter`,()=>{ee(r+1)}),document.body.appendChild(c),i[r]=c,a[r]=o,requestAnimationFrame(()=>{Ht(c,t,n)})};document.addEventListener(`keydown`,u),document.addEventListener(`pointerdown`,d,!0),document.addEventListener(`contextmenu`,f,!0),te(e,t?.x??0,t?.y??0,0),N&&N(),N=c,requestAnimationFrame(()=>{s=!0})})}var qt=`p4code:client-settings:v1`;function Jt(){return typeof window<`u`}function Yt(){return Jt()?je(qt,Ue):null}function Xt(e){Jt()&&Oe(qt,e,Ue)}var Zt;function Qt(){return{dialogs:{pickFolder:async e=>window.desktopBridge?window.desktopBridge.pickFolder(e):null,confirm:async(e,t)=>Nt(e,t)??!1},shell:{openExternal:async e=>{if(window.desktopBridge){if(!await window.desktopBridge.openExternal(e))throw Error(`Unable to open link.`)}else window.open(e,`_blank`,`noopener,noreferrer`)},openSystemSettings:async e=>{if(!window.desktopBridge?.openSystemSettings||!await window.desktopBridge.openSystemSettings(e))throw Error(`Unable to open System Settings.`)}},contextMenu:{show:async(e,t)=>window.desktopBridge?window.desktopBridge.showContextMenu(e,t):Kt(e,t),close:async()=>{window.desktopBridge||Gt()}},persistence:{getClientSettings:async()=>window.desktopBridge?window.desktopBridge.getClientSettings():Yt(),setClientSettings:async e=>{if(window.desktopBridge)return window.desktopBridge.setClientSettings(e);Xt(e)}}}}function $t(){return Qt()}function en(){if(typeof window<`u`)return Zt||(Zt=$t(),Zt)}function tn(){let e=en();if(!e)throw Error(`Local API not found`);return e}var P=`p4code:theme`,nn=`(prefers-color-scheme: dark)`,F={theme:`system`,resolvedTheme:`light`,systemDark:!1,followSystem:!0,appearanceMode:`system`,themeHalves:null};function rn(){return I()}function an(){return typeof window>`u`?{}:on()}function I(){if(typeof window>`u`)return null;try{return ut(window.localStorage.getItem(C))}catch{return null}}function on(){try{let e=JSON.parse(window.localStorage.getItem(`p4code:theme-halves:v1`)??`null`);if(typeof e!=`object`||!e)return{};let t={};for(let n of[`light`,`dark`]){let r=e[n];typeof r==`string`&&(t[n]=r)}return t}catch{return{}}}function L(e){return`${e?.light??``}|${e?.dark??``}`}var sn=`theme-color`,cn=`meta[name="${sn}"][data-dynamic-theme-color="true"]`,R=class extends we()(`ThemeStorageError`,{operation:Ce([`read`,`write`]),storageKey:be,theme:ne(gt),cause:_e()}){get message(){return`Failed to ${this.operation} theme preference for ${this.storageKey}.`}},ln=i(R),un=class extends we()(`DesktopThemeSyncError`,{theme:gt,cause:_e()}){get message(){return`Failed to sync the ${this.theme} theme to the desktop shell.`}},dn=i(un),z=[],B=null,fn=!0,V=null,H=null,U=null;function W(){fn=!0;for(let e of z)e()}function pn(){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(nn).matches}function mn(e){if(typeof window>`u`)return e===`system`;try{let e=window.localStorage.getItem(_t);if(e===`true`)return!0;if(e===`false`)return!1}catch{}return e===`system`}function hn(e){return e===`light`||e===`dark`||e===`system`}function G(e){if(typeof window<`u`)try{let e=window.localStorage.getItem(w);if(hn(e))return e}catch{}return mn(e)?`system`:yt(e)??`light`}function gn(e){if(typeof window<`u`)try{window.localStorage.setItem(w,e)}catch(e){throw new R({operation:`write`,storageKey:w,cause:e})}}function _n(){if(typeof window>`u`)return F.theme;let e;try{e=window.localStorage.getItem(P)}catch(e){throw new R({operation:`read`,storageKey:P,cause:e})}return e!==null&&mt(e)?e:F.theme}function vn(e){if(typeof window<`u`)try{window.localStorage.setItem(P,e),U=null}catch(t){throw new R({operation:`write`,storageKey:P,theme:e,cause:t})}}function K(){if(U!==null)return F.theme;try{return _n()}catch(e){let t=ln(e)?e:new R({operation:`read`,storageKey:P,cause:e});return U=t,console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...y(t)}),F.theme}}function yn(){let e=document.querySelector(cn);return e||(e=document.createElement(`meta`),e.name=sn,e.setAttribute(`data-dynamic-theme-color`,`true`),document.head.append(e),e)}function bn(e){let t=e?.trim().toLowerCase();return!t||t===`transparent`||t===`rgba(0, 0, 0, 0)`||t===`rgba(0 0 0 / 0)`?null:e?.trim()??null}function xn(){return document.querySelector(`main[data-slot='sidebar-inset']`)??document.querySelector(`[data-slot='sidebar-inner']`)??document.body}function Sn(){if(typeof document>`u`||typeof getComputedStyle>`u`)return;let e=getComputedStyle(document.documentElement),t=document.documentElement.dataset.themeId?bn(e.getPropertyValue(`--app-chrome-background`)):null,n=bn(getComputedStyle(xn()).backgroundColor),r=bn(getComputedStyle(document.body).backgroundColor),i=t??n??r;if(!i)return;document.documentElement.style.backgroundColor=i,document.body.style.backgroundColor=i;let a=document.querySelectorAll(`meta[name="${sn}"]`);if(a.length===0)yn().setAttribute(`content`,i);else for(let e of a)e.setAttribute(`content`,i)}function q(e,{suppressTransitions:t=!1,preservePreview:n=!0}={}){if(typeof document>`u`||typeof window>`u`||n&&document.documentElement.dataset?.themeId===`__preview`)return;let r=G(e),i=r===`system`,a=i?pn():!1,o=I();if(H?.theme===e&&H.systemDark===a&&H.followSystem===i&&H.appearanceMode===r&&L(H.themeHalves)===L(o)){wn(e,i,r);return}t&&document.documentElement.classList.add(`no-transitions`);let s=ft(e,a,i,r,o);ht(pt(e,o,s),s),document.documentElement.classList.toggle(`dark`,s===`dark`),H={theme:e,systemDark:a,followSystem:i,appearanceMode:r,themeHalves:o},Sn(),wn(e,i,r),t&&(document.documentElement.offsetHeight,requestAnimationFrame(()=>{document.documentElement.classList.remove(`no-transitions`)}))}async function Cn(e,t,n,r,i=I()){try{await e.setTheme(dt(t,n,r,i))}catch(e){throw new un({theme:t,cause:e})}}function wn(e,t,n){if(typeof window>`u`)return;let r=window.desktopBridge,i=I(),a=dt(e,t,n,i);r&&typeof r.setTheme==`function`&&V!==a&&(V=a,Cn(r,e,t,n,i).catch(t=>{let n=dn(t)?t:new un({theme:e,cause:t});console.error(n.message,{theme:n.theme,...y(n)}),V===a&&(V=null)}))}typeof document<`u`&&typeof window<`u`&&q(K());function Tn(){if(typeof window>`u`)return F;if(!fn&&B)return B;fn=!1;let e=K(),t=G(e),n=t===`system`,r=n?pn():!1,i=I(),a=ft(e,r,n,t,i);return B&&B.theme===e&&B.resolvedTheme===a&&B.systemDark===r&&B.followSystem===n&&B.appearanceMode===t&&L(B.themeHalves)===L(i)||(B={theme:e,resolvedTheme:a,systemDark:r,followSystem:n,appearanceMode:t,themeHalves:i}),B}function En(){return F}function Dn(){let e=K();G(e)===`system`&&q(e,{suppressTransitions:!0}),W()}function On(e){e.key===P?(U=null,q(K(),{suppressTransitions:!0}),W()):e.key===`p4code:theme-follow-system`||e.key===`p4code:theme-appearance-mode`||e.key===`p4code:theme-halves:v1`?(q(K(),{suppressTransitions:!0}),W()):(e.key===`p4code:themes:v1`||e.key===null)&&(e.key===null&&(U=null),vt(),H=null,q(K(),{suppressTransitions:!0}),W())}var kn=null;function An(e){if(typeof window>`u`)return()=>{};if(z.push(e),!kn){let e=typeof window.matchMedia==`function`?window.matchMedia(nn):null;e?.addEventListener(`change`,Dn),window.addEventListener(`storage`,On),kn=()=>{e?.removeEventListener(`change`,Dn),window.removeEventListener(`storage`,On)}}return()=>{z=z.filter(t=>t!==e),z.length===0&&(kn?.(),kn=null)}}function jn(){let e=(0,T.useSyncExternalStore)(An,Tn,En),{theme:t,resolvedTheme:n}=e,r=(0,T.useCallback)(e=>{if(typeof window>`u`)return!1;try{gn(G(K()));let t=window.localStorage.getItem(C);window.localStorage.removeItem(C);try{vn(e)}catch(e){if(t!==null)try{window.localStorage.setItem(C,t)}catch{}throw e}}catch(t){let n=ln(t)?t:new R({operation:`write`,storageKey:P,theme:e,cause:t});return console.error(n.message,{operation:n.operation,storageKey:n.storageKey,theme:e,...y(n)}),!1}return q(e,{suppressTransitions:!0}),W(),!0},[]),i=(0,T.useCallback)(e=>{if(typeof window>`u`)return!1;try{gn(e)}catch(e){let t=ln(e)?e:new R({operation:`write`,storageKey:w,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...y(t)}),!1}return U=null,q(K(),{suppressTransitions:!0}),W(),!0},[]),a=(0,T.useCallback)(e=>{let n=G(t),r=e?`system`:n===`system`?yt(t)??`light`:n;return i(r)},[i,t]),o=(0,T.useCallback)((e,t)=>{if(typeof window>`u`)return!1;try{let n={...on()};t===null?delete n[e]:n[e]=t,n.light===void 0&&n.dark===void 0?window.localStorage.removeItem(C):window.localStorage.setItem(C,JSON.stringify(n))}catch(e){let t=new R({operation:`write`,storageKey:C,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...y(t)}),!1}return q(K(),{suppressTransitions:!0}),W(),!0},[]),s=(0,T.useCallback)(()=>{if(typeof window>`u`)return!1;try{window.localStorage.removeItem(C)}catch(e){let t=new R({operation:`write`,storageKey:C,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...y(t)}),!1}return q(K(),{suppressTransitions:!0}),W(),!0},[]),c=(0,T.useCallback)(({preservePreview:e=!1}={})=>{typeof window<`u`&&(H=null,q(K(),{suppressTransitions:!0,preservePreview:e}),W())},[]);return(0,T.useEffect)(()=>{q(t)},[e.appearanceMode,t]),{theme:t,setTheme:r,setAppearanceMode:i,setFollowSystem:a,setThemeHalf:o,clearThemeHalves:s,refreshTheme:c,followSystem:e.followSystem,appearanceMode:e.appearanceMode,resolvedTheme:n,themeHalves:e.themeHalves}}var Mn=Ge(ke(ye)),Nn=Ve(e=>{let t=e.replace(/("(?:[^"\\]|\\.)*")|\/\/[^\n]*/g,(e,t)=>t?e:``);return t=t.replace(/("(?:[^"\\]|\\.)*")|\/\*[\s\S]*?\*\//g,(e,t)=>t?e:``),t=t.replace(/("(?:[^"\\]|\\.)*")|,(\s*[}\]])/g,(e,t,n)=>t?e:n??``),Mn(t).pipe(s(e=>e.issue))}),Pn=new He(Nn,Pe());De().pipe(Be(Pe({space:2})));var Fn=e=>be.pipe(o(e,Pn)),In={performance:{profile:`performance`,automaticGitFetchInterval:a(15),providerHealthRefreshInterval:v(1),hostPowerMonitorActiveInterval:a(30),hostPowerMonitorIdleInterval:v(2),idleClientTtl:a(45),pauseWhenHostLocked:!0,pauseWhenHostLowPower:!1,pauseWhenClientLowPower:!1,pauseWhenOnBattery:!1},balanced:{profile:`balanced`,automaticGitFetchInterval:We,providerHealthRefreshInterval:re,hostPowerMonitorActiveInterval:a(30),hostPowerMonitorIdleInterval:v(5),idleClientTtl:a(45),pauseWhenHostLocked:!0,pauseWhenHostLowPower:!0,pauseWhenClientLowPower:!0,pauseWhenOnBattery:!1},"battery-saver":{profile:`battery-saver`,automaticGitFetchInterval:a(0),providerHealthRefreshInterval:v(15),hostPowerMonitorActiveInterval:v(1),hostPowerMonitorIdleInterval:v(10),idleClientTtl:a(45),pauseWhenHostLocked:!0,pauseWhenHostLowPower:!0,pauseWhenClientLowPower:!0,pauseWhenOnBattery:!0}};function J(e){return In[e]}function Ln(e){return e.profile===`custom`?e.baseProfile??`balanced`:e.profile}function Rn(e){let t=Ln(e),n=In[t],r=e.profile===`custom`?e.overrides:{};return{profile:t,automaticGitFetchInterval:r.automaticGitFetchInterval??n.automaticGitFetchInterval,providerHealthRefreshInterval:r.providerHealthRefreshInterval??n.providerHealthRefreshInterval,hostPowerMonitorActiveInterval:r.hostPowerMonitorActiveInterval??n.hostPowerMonitorActiveInterval,hostPowerMonitorIdleInterval:r.hostPowerMonitorIdleInterval??n.hostPowerMonitorIdleInterval,idleClientTtl:r.idleClientTtl??n.idleClientTtl,pauseWhenHostLocked:r.pauseWhenHostLocked??n.pauseWhenHostLocked,pauseWhenHostLowPower:r.pauseWhenHostLowPower??n.pauseWhenHostLowPower,pauseWhenClientLowPower:r.pauseWhenClientLowPower??n.pauseWhenClientLowPower,pauseWhenOnBattery:r.pauseWhenOnBattery??n.pauseWhenOnBattery}}function Y(e,t){return p(e)===p(t)}function zn(e,t){return Y(e.automaticGitFetchInterval,t.automaticGitFetchInterval)&&Y(e.providerHealthRefreshInterval,t.providerHealthRefreshInterval)&&Y(e.hostPowerMonitorActiveInterval,t.hostPowerMonitorActiveInterval)&&Y(e.hostPowerMonitorIdleInterval,t.hostPowerMonitorIdleInterval)&&Y(e.idleClientTtl,t.idleClientTtl)&&e.pauseWhenHostLocked===t.pauseWhenHostLocked&&e.pauseWhenHostLowPower===t.pauseWhenHostLowPower&&e.pauseWhenClientLowPower===t.pauseWhenClientLowPower&&e.pauseWhenOnBattery===t.pauseWhenOnBattery}function Bn(e){if(e.profile!==`custom`)return{schemaVersion:1,profile:e.profile,overrides:{}};let t=Rn(e),n=[Ln(e),`balanced`,`performance`,`battery-saver`];for(let e of n)if(zn(t,In[e]))return{schemaVersion:1,profile:e,overrides:{}};let r=Ln(e),i=In[r];return{schemaVersion:1,profile:`custom`,baseProfile:r,overrides:{...Y(t.automaticGitFetchInterval,i.automaticGitFetchInterval)?{}:{automaticGitFetchInterval:t.automaticGitFetchInterval},...Y(t.providerHealthRefreshInterval,i.providerHealthRefreshInterval)?{}:{providerHealthRefreshInterval:t.providerHealthRefreshInterval},...Y(t.hostPowerMonitorActiveInterval,i.hostPowerMonitorActiveInterval)?{}:{hostPowerMonitorActiveInterval:t.hostPowerMonitorActiveInterval},...Y(t.hostPowerMonitorIdleInterval,i.hostPowerMonitorIdleInterval)?{}:{hostPowerMonitorIdleInterval:t.hostPowerMonitorIdleInterval},...Y(t.idleClientTtl,i.idleClientTtl)?{}:{idleClientTtl:t.idleClientTtl},...t.pauseWhenHostLocked===i.pauseWhenHostLocked?{}:{pauseWhenHostLocked:t.pauseWhenHostLocked},...t.pauseWhenHostLowPower===i.pauseWhenHostLowPower?{}:{pauseWhenHostLowPower:t.pauseWhenHostLowPower},...t.pauseWhenClientLowPower===i.pauseWhenClientLowPower?{}:{pauseWhenClientLowPower:t.pauseWhenClientLowPower},...t.pauseWhenOnBattery===i.pauseWhenOnBattery?{}:{pauseWhenOnBattery:t.pauseWhenOnBattery}}}}function Vn(e){let t={schemaVersion:1,profile:le,overrides:{}},n=e.backgroundActivity.profile===t.profile&&e.backgroundActivity.baseProfile===void 0&&Object.keys(e.backgroundActivity.overrides).length===0,r=e.backgroundActivityProfile,i=r!==`balanced`||p(e.automaticGitFetchInterval)!==p(We)||p(e.providerHealthRefreshInterval)!==p(re);return Rn(n&&i?{schemaVersion:1,profile:p(e.automaticGitFetchInterval)===p(J(r).automaticGitFetchInterval)&&p(e.providerHealthRefreshInterval)===p(J(r).providerHealthRefreshInterval)?r:`custom`,baseProfile:r,overrides:{...p(e.automaticGitFetchInterval)===p(J(r).automaticGitFetchInterval)?{}:{automaticGitFetchInterval:e.automaticGitFetchInterval},...p(e.providerHealthRefreshInterval)===p(J(r).providerHealthRefreshInterval)?{}:{providerHealthRefreshInterval:e.providerHealthRefreshInterval}}}:e.backgroundActivity)}function Hn(e){let t=Vn(e);return Bn({schemaVersion:1,profile:`custom`,baseProfile:t.profile,overrides:{automaticGitFetchInterval:t.automaticGitFetchInterval,providerHealthRefreshInterval:t.providerHealthRefreshInterval,hostPowerMonitorActiveInterval:t.hostPowerMonitorActiveInterval,hostPowerMonitorIdleInterval:t.hostPowerMonitorIdleInterval,idleClientTtl:t.idleClientTtl,pauseWhenHostLocked:t.pauseWhenHostLocked,pauseWhenHostLowPower:t.pauseWhenHostLowPower,pauseWhenClientLowPower:t.pauseWhenClientLowPower,pauseWhenOnBattery:t.pauseWhenOnBattery}})}var Un=Fn(se);de(Un);function Wn(e,t){let n=e.providerInstances[t.instanceId];return n===void 0?he(t.instanceId):ee(n)}var Gn=[`codex`,`claudeAgent`,`cursor`,`grok`,`muse`,`pi`,`opencode`,`antigravity`].map(e=>d.make(e));function Kn(e,t,n){let r=[...Gn.map(e=>[ce(e),e]),...n?.includeConfiguredInstances===!0?Object.entries(e).flatMap(([e,t])=>Gn.includes(t.driver)?[[te.make(e),t.driver]]:[]):[]].find(([e,n])=>t(e,n));if(r===void 0)return null;let[i,a]=r,o=n?.defaultModelSelection,s=e[i]?.config;return o?.instanceId===i&&ge(s?.customModels).some(e=>e.slug===o.model)?o:{instanceId:i,model:Te[a]??Fe[a]??`gpt-6-luna`}}function qn(e,t,n){let r=e.sourceControlWriterModelSelection;if(!r||!Le(e,n,r.instanceId))return e.textGenerationModelSelection;if(t===void 0)return r;let i=t.find(e=>e.instanceId===r.instanceId);return i?.enabled===!0&&fe(i)&&l(i)?r:e.textGenerationModelSelection}function Jn(e,t,n){let r=e.reviewGuideModelSelection;if(r&&Le(e,n,r.instanceId)){let e=t?.find(e=>e.instanceId===r.instanceId);if(t===void 0||e?.enabled===!0&&fe(e)&&l(e))return r}return qn(e,t,n)}function Yn(e,t={}){return{favorites:e.favorites??t.favorites??[],providerModelPreferences:e.providerModelPreferences??t.providerModelPreferences??{}}}function Xn(e,t){let n=e.favorites===null&&(t.favorites?.length??0)>0?t.favorites:void 0,r=e.providerModelPreferences===null&&Object.keys(t.providerModelPreferences??{}).length>0?t.providerModelPreferences:void 0;return n===void 0&&r===void 0?null:{migrateModelPreferences:{...n===void 0?{}:{favorites:n},...r===void 0?{}:{providerModelPreferences:r}}}}var Zn=new Set([`continueThreadsAfterServerUpdate`,`sidebarAutoSettleAfterDays`,`sidebarAutoSettleOnMerge`,`autoResumeLimitedThreads`,`snoozeLimitedThreads`,`newWorktreesStartFromOrigin`,`sourceControlWritingStyle`,`textGenerationModelSelection`]);function Qn(e){let t={},n={};for(let[r,i]of Object.entries(e))Zn.has(r)?t[r]=i:n[r]=i;return{sharedPatch:t,localPatch:n}}function $n(e,t,n,r=n,i=!1){let a=e.textGenerationModelSelection?.instanceId??r?.textGenerationModelSelection.instanceId;return!i&&e.textGenerationModelSelection&&(!n||a!==void 0&&(r?.providerInstances[a]?.driver??a)!==(n.providerInstances[a]?.driver??a)||!Wn(n,{...n.textGenerationModelSelection,...e.textGenerationModelSelection}))&&(e=f(e,[`textGenerationModelSelection`])),t?.threadRestartContinuation===!0?e:f(e,[`continueThreadsAfterServerUpdate`])}function er(e){return e.connection.phase===`connected`&&e.serverConfig?.environment.capabilities.threadAutoSettlement===!0}function tr(e){let t=e.atom(r(qe.pipe(ue(e=>me(e.state)))),{initialValue:Ze});return{stateAtom:t,stateValueAtom:h(e=>Ee(ae(e(t)),()=>Ze)).pipe(g(`relay-environment-discovery-value`)),refresh:Je(e,{label:`relay-environment-discovery:refresh`,concurrency:{mode:`singleFlight`,key:()=>`refresh`},execute:e=>qe.pipe(Se(e=>e.refresh))})}}var nr=tr(nt);function rr(e,t){return{...t,environmentId:e,label:t.entry.target.label,displayUrl:et(t.entry),relayManaged:Ke(t.entry)}}function ir(){let e=(0,E.c)(7),t=_(S.catalogValueAtom),n=_(S.networkStatusValueAtom),r=_(D.presentationsAtom),i;e[0]===r?i=e[1]:(i=[...r.entries()].map(ar),e[0]=r,e[1]=i);let a=i,o;return e[2]!==t.isReady||e[3]!==a||e[4]!==n||e[5]!==r?(o={isReady:t.isReady,networkStatus:n,environments:a,presentationById:r},e[2]=t.isReady,e[3]=a,e[4]=n,e[5]=r,e[6]=o):o=e[6],o}function ar(e){let[t,n]=e;return rr(t,n)}function or(){return _(rt)}function sr(e){let t=(0,E.c)(3),{presentation:n}=Et(e),r;return t[0]!==e||t[1]!==n?(r=e===null||n===null?null:rr(e,n),t[0]=e,t[1]=n,t[2]=r):r=t[2],r}function cr(){return sr(or())}function lr(e){let t=(0,E.c)(2),n=st(e),r;return t[0]===n?r=t[1]:(r=Me(n)?n.value.httpBaseUrl:null,t[0]=n,t[1]=r),r}function ur(){return _(nr.stateValueAtom)}function dr(){return _(wt.environmentIdsAtom)}function fr(){return _(wt.identitiesAtom)}function pr(){return _(wt.pullRequestsSupportedAtom)}var mr=`[CLIENT_SETTINGS]`,hr=new Set,gr=new Set,_r=c,X=`pending`,Z=null,vr=0,yr=Promise.resolve(),br=0;function xr(){for(let e of hr)e()}function Sr(){for(let e of gr)e()}function Q(){return _r}function Cr(e){_r=e,xr()}function wr(e){X!==e&&(X=e,Sr())}function Tr(e){return hr.add(e),$().catch(()=>void 0),()=>{hr.delete(e)}}function Er(){return X===`ready`}function Dr(){return X}function Or(e){return gr.add(e),$().catch(()=>void 0),()=>{gr.delete(e)}}async function $(){if(X===`ready`)return;if(Z)return Z;let e=vr;wr(X===`failed`||X===`retrying`?`retrying`:`pending`);let t=(async()=>{try{let t=await tn().persistence.getClientSettings();if(e!==vr)return;t&&Cr({...c,...t}),wr(`ready`)}catch(t){throw e===vr&&wr(`failed`),console.error(`${mr} hydrate failed`,{operation:`hydrate`,...y(t)}),t}})().finally(()=>{Z===t&&(Z=null)});return Z=t,Z}var kr=e=>tn().persistence.setClientSettings(e);function Ar(e){let t=yr.then(e);return yr=t.then(()=>void 0,()=>void 0),t}function jr(e,t=kr){let n=X!==`ready`||br>0;return n?br+=1:Cr({...Q(),...e}),Ar(async()=>{if(n)try{X!==`ready`&&await $(),Cr({...Q(),...e})}finally{--br}await t(Q())}).catch(e=>{console.error(`${mr} persist failed`,{operation:`persist`,...y(e)})})}async function Mr(e,t=kr){return Ar(async()=>{for(X!==`ready`&&await $();;){let n=Q(),r=e(n);if(await t(r),Q()===n)return Cr(r),r}})}var Nr=new Set(Ie(se.fields));function Pr(e){let t={},n={};for(let[r,i]of Object.entries(e))Nr.has(r)?t[r]=i:n[r]=i;return{serverPatch:t,clientPatch:n}}function Fr(){return Q()}function Ir(){return $()}function Lr(){return(0,T.useSyncExternalStore)(Or,Er,Rr)}function Rr(){return!1}function zr(){return(0,T.useSyncExternalStore)(Or,Dr,Br)}function Br(){return`pending`}function Vr(){return(0,T.useSyncExternalStore)(Tr,Q,Hr)}function Hr(){return c}function Ur(e,t){return{...t,...e,...Yn(e,t)}}var Wr=new Set;function Gr(e,t){let n=(0,E.c)(8),r=Vr(),i=Lr(),a;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={reportFailure:!1},n[0]=a):a=n[0];let o=lt(x.updateSettings,a),s,c;n[1]!==r||n[2]!==e||n[3]!==i||n[4]!==o||n[5]!==t?(s=()=>{if(!e||!t||!i||Wr.has(e))return;let n=Xn(t,r);n&&(Wr.add(e),o({environmentId:e,input:{patch:n}}).finally(()=>Wr.delete(e)))},c=[r,e,i,o,t],n[1]=r,n[2]=e,n[3]=i,n[4]=o,n[5]=t,n[6]=s,n[7]=c):(s=n[6],c=n[7]),(0,T.useEffect)(s,c)}function Kr(e,t){let n=(0,E.c)(6),r=Vr(),i;n[0]!==r||n[1]!==e?(i=Ur(e,r),n[0]=r,n[1]=e,n[2]=i):i=n[2];let a=i,o;return n[3]!==a||n[4]!==t?(o=t?t(a):a,n[3]=a,n[4]=t,n[5]=o):o=n[5],o}function qr(e){let t=(0,E.c)(3),n=Vr(),r;return t[0]!==e||t[1]!==n?(r=e?e(n):n,t[0]=e,t[1]=n,t[2]=r):r=t[2],r}async function Jr(e,t){return(e.favorites===null||e.providerModelPreferences===null)&&await Ir(),{...Xn(e,Fr()),...t}}function Yr(e){let t=(0,E.c)(6),n;t[0]===e?n=t[1]:(n=e?x.settingsValueAtom(e):Zr,t[0]=e,t[1]=n);let r=_(n),i=lt(x.updateSettings,`model preferences update`),a;return t[2]!==e||t[3]!==i||t[4]!==r?(a=async t=>{if(!e||!r)return;let n;try{n=await Jr(r,t)}catch{b.add({type:`error`,title:`Model preferences not saved`,description:`Could not load saved model preferences. Try again.`});return}return i({environmentId:e,input:{patch:n}})},t[2]=e,t[3]=i,t[4]=r,t[5]=a):a=t[5],a}function Xr(e){let t=(0,T.use)(Ne),n=(0,T.useRef)(new Map),r=Yr(e);return(0,T.useCallback)(async(i,a)=>{if(!e)return;let o=x.settingsValueAtom(e),s=t.get(o);if(!s)return;if(s.favorites===null)try{await Ir()}catch{b.add({type:`error`,title:`Favorites not saved`,description:`Could not load saved model preferences. Try again.`});return}let c=t.get(o)??s,l=Yn(c,Fr()).favorites,u=JSON.stringify([e,i,a]),d=n.current.get(u),f={favorite:!(d&&(d.pending||d.settings.favorites===c.favorites)?d.favorite:l.some(e=>e.provider===i&&e.model===a)),settings:c,pending:!0};n.current.set(u,f);try{let e=await r({setModelFavorites:[{provider:i,model:a,favorite:f.favorite}]});e&&pe(e)&&t.get(o)?.favorites===c.favorites&&(f.pending=!1)}finally{f.pending&&n.current.get(u)===f&&(d&&!d.pending&&t.get(o)?.favorites===d.settings.favorites?n.current.set(u,d):n.current.delete(u))}},[e,t,r])}var Zr=h(null);function Qr(e){let t=(0,E.c)(5),n;t[0]===e?n=t[1]:(n=e?x.settingsValueAtom(e):Zr,t[0]=e,t[1]=n);let r=_(n),i=Vr();Gr(e,r);let a=r??Ae,o;return t[2]!==i||t[3]!==a?(o=Yn(a,i),t[2]=i,t[3]=a,t[4]=o):o=t[4],o}function $r(e,t){let n=(0,E.c)(2),r;n[0]===e?r=n[1]:(r=x.settingsValueAtom(e),n[0]=e,n[1]=r);let i=_(r);return Gr(e,i),Kr(i??Ae,t)}function ei(e){let t=(0,E.c)(4),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=lt(x.mutateProviderInstance,n),i;return t[1]!==e||t[2]!==r?(i=(t,n)=>r({environmentId:e,input:{patch:n===void 0?{}:n,providerInstanceMutation:t}}),t[1]=e,t[2]=r,t[3]=i):i=t[3],i}function ti(e){let t=cr(),n=_(it);return Gr(t?.environmentId??null,t?.serverConfig?.settings??null),Kr(n,e)}var ni=`This setting is saved on a server, and the hosted app is not anchored to one. Change it from the desktop app or from the server's own address.`;function ri(){let e=(0,E.c)(2),t=cr(),n;return e[0]===t?n=e[1]:(n=t!==null||!$e(),e[0]=t,e[1]=n),n}function ii(e){let t=(0,E.c)(3),n=e!==void 0&&e,{environments:r}=ir(),i;return t[0]!==r||t[1]!==n?(i=h(e=>r.filter(er).flatMap(t=>{let r=e(ct.sessionStateAtom(t.environmentId));if(n&&r._tag===`Initial`)return[t.environmentId];let i=r._tag===`Failure`?null:m(ae(r));return i!==null&&xe(i,`settings:write`)?[t.environmentId]:[]})),t[0]=r,t[1]=n,t[2]=i):i=t[2],_(i)}function ai(e){let t=(0,E.c)(10);at(e,ze);let n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={label:`server settings update`,reportFailure:!1},t[0]=n):n=t[0];let r=lt(x.updateSettings,n),{environments:i}=ir(),a;t[1]!==i||t[2]!==r?(a=async e=>{let t=await r(e);if(t._tag===`Failure`&&!Ye(t)){let n=i.find(t=>t.environmentId===e.environmentId)?.label??e.environmentId,r=Qe(t);b.add({type:`error`,title:`Setting not saved`,description:`Could not save on ${n}: ${r instanceof Error?r.message:`The save failed. Try reconnecting and saving again.`}`})}return t},t[1]=i,t[2]=r,t[3]=a):a=t[3];let o=a,s=ii(!0),c;return t[4]!==e||t[5]!==i||t[6]!==r||t[7]!==o||t[8]!==s?(c=t=>{let{serverPatch:n,clientPatch:a}=Pr(t),c=e===null||u(n).every(t=>ot(e,t));if(Object.keys(n).length>0&&!c&&b.add({type:`warning`,title:`Setting not saved`,description:`This connection lacks permission to change settings on ${i.find(t=>t.environmentId===e)?.label??`the selected environment`}.`}),Object.keys(n).length>0&&c){let{sharedPatch:t,localPatch:a}=Qn(n),c=ui;if(Object.keys(a).length>0&&(e?o({environmentId:e,input:{patch:a}}):c()),Object.keys(t).length>0){let n=i.find(t=>t.environmentId===e)?.serverConfig?.settings,a=new Set(s);e&&a.add(e);let o=[],l=[];for(let r of a){let a=i.find(e=>e.environmentId===r),s=$n(t,a?.serverConfig?.environment.capabilities,a?.serverConfig?.settings,n,r===e);Object.keys(s).length!==0&&(ve.get(ct.sessionStateAtom(r))._tag!==`Initial`&&!u(t).every(e=>ot(r,e))?l.push(a?.label??r):o.push({environmentId:r,input:{patch:s}}))}o.length===0?c(l.length>0?`This connection lacks permission to change settings on ${l.join(`, `)}.`:a.size>0?`Update older servers to save this setting.`:void 0):Promise.all(o.map(async e=>({label:i.find(t=>t.environmentId===e.environmentId)?.label??e.environmentId,result:await r(e)}))).then(oi)}}Object.keys(a).length>0&&jr(a)},t[4]=e,t[5]=i,t[6]=r,t[7]=o,t[8]=s,t[9]=c):c=t[9],c}function oi(e){let t=e.flatMap(li);if(t.length===0)return;let n=e.filter(ci).map(si);b.add({type:`error`,title:n.length>0?`Setting saved on some environments`:`Setting not saved`,description:[...t,...n.length>0?[`Saved on ${n.join(`, `)}.`]:[]].join(`
2
2
  `)})}function si(e){let{label:t}=e;return t}function ci(e){let{result:t}=e;return t._tag===`Success`}function li(e){let{label:t,result:n}=e;if(n._tag!==`Failure`||Ye(n))return[];let r=Qe(n);return[`Could not save on ${t}: ${r instanceof Error?r.message:`The save failed. Try reconnecting and saving again.`}`]}function ui(e){let t=e===void 0?ni:e;return b.add({type:`warning`,title:`Setting not saved`,description:t})}function di(e){return ai(e)}function fi(){return ai(cr()?.environmentId??null)}function pi(){return mi}function mi(e){return jr(e)}export{Nt as $,nr as A,G as B,fr as C,or as D,cr as E,J as F,jn as G,an as H,Bn as I,Wt as J,tn as K,Hn as L,Jn as M,qn as N,pr as O,Ln as P,Mt as Q,Vn as R,lr as S,ir as T,_n as U,rn as V,Sn as W,Pt as X,It as Y,At as Z,pi as _,jr as a,fi as b,Lr as c,$r as d,Ft as et,Gr as f,Xr as g,ri as h,Ur as i,Et as it,Kn as j,ur as k,zr as l,ti as m,Ir as n,D as nt,Mr as o,ei as p,en as q,Fr as r,wt as rt,qr as s,ni as t,jt as tt,Qr as u,Yr as v,dr as w,sr as x,di as y,Fn as z};
3
- //# sourceMappingURL=useSettings-BzfsGrZk.js.map
3
+ //# sourceMappingURL=useSettings-CyF6ezIl.js.map