@p4code/cli 0.9.25 → 0.9.26

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 (288) hide show
  1. package/dist/{TraceDiagnostics-BHUn_HS7.mjs → TraceDiagnostics-D1Qz3qce.mjs} +3 -3
  2. package/dist/bin.mjs +1 -1
  3. package/dist/{binCli-DzJr0M8f.mjs → binCli-CcEaWLAR.mjs} +6 -6
  4. package/dist/client/.vite/manifest.json +2130 -2130
  5. package/dist/client/assets/{2NI2N5EU-DU0Cg_Lb.js → 2NI2N5EU--LXjbTE-.js} +2 -2
  6. package/dist/client/assets/{4UO7MD6I-B38qXGVF.js → 4UO7MD6I-D_jr6_IV.js} +2 -2
  7. package/dist/client/assets/{5B3SVYGG-FTIXhvjJ.js → 5B3SVYGG-tThUTA_S.js} +2 -2
  8. package/dist/client/assets/{5GK6JWQ2-H3C8D_6P.js → 5GK6JWQ2-BCuuAhKJ.js} +2 -2
  9. package/dist/client/assets/{5N7A7DKN-CozSLHAy.js → 5N7A7DKN-rdPMRoZL.js} +2 -2
  10. package/dist/client/assets/{5OC2THR4-CEpIVrtv.js → 5OC2THR4-gvpm3IL0.js} +2 -2
  11. package/dist/client/assets/{5S6HY5KT-BJiBcrC3.js → 5S6HY5KT-CWanNmdR.js} +2 -2
  12. package/dist/client/assets/{6IMQ5BUJ-Bc6nCKkc.js → 6IMQ5BUJ-1sguTKZ9.js} +2 -2
  13. package/dist/client/assets/{6OLKWJ4F-BQObFAo6.js → 6OLKWJ4F-9loy41nw.js} +2 -2
  14. package/dist/client/assets/{74OO7NKP-Bf7mJdAJ.js → 74OO7NKP-ukQR6jKi.js} +2 -2
  15. package/dist/client/assets/{75O6YZUN-CW0D2fdL.js → 75O6YZUN-BjBd5LQ0.js} +2 -2
  16. package/dist/client/assets/{77XECAW3-DYpoU6GE.js → 77XECAW3-Ccw2Y7VD.js} +2 -2
  17. package/dist/client/assets/{ABYRPUBD-DspDYvjC.js → ABYRPUBD-CvqVJLPf.js} +2 -2
  18. package/dist/client/assets/AlertDialogRoot-CimqRgXh.js +2 -0
  19. package/dist/client/assets/{AnimatedHeight-baWnHH74.js → AnimatedHeight-Dwarin_V.js} +2 -2
  20. package/dist/client/assets/{AuthSurfaceShell-DpXUdirf.js → AuthSurfaceShell-BvGaTutU.js} +2 -2
  21. package/dist/client/assets/{BB2UYUI2-DBvVdzXq.js → BB2UYUI2-Drnmium_.js} +2 -2
  22. package/dist/client/assets/{BUM34MOA-DD8_qVgf.js → BUM34MOA-AkPmeijf.js} +2 -2
  23. package/dist/client/assets/{CEQABKGZ-CVQF1BSd.js → CEQABKGZ-BNUlDSIK.js} +2 -2
  24. package/dist/client/assets/{CXAC5362-D-ErUdji.js → CXAC5362-Bmar3Iii.js} +2 -2
  25. package/dist/client/assets/{ChatGptUsageButton-CQGToDEF.js → ChatGptUsageButton-D6Iy8SVv.js} +2 -2
  26. package/dist/client/assets/{ChatMarkdown-LJASbkfc.js → ChatMarkdown-DHhJpg3q.js} +7 -7
  27. package/dist/client/assets/{CheckboxIndicator-C1r4pplS.js → CheckboxIndicator-DbA95VlZ.js} +2 -2
  28. package/dist/client/assets/{ClippedText-DfXsEQeG.js → ClippedText-UM8CaEu4.js} +2 -2
  29. package/dist/client/assets/{CodexSetupSection.logic-Bc4DfjCh.js → CodexSetupSection.logic-kKJPABQZ.js} +2 -2
  30. package/dist/client/assets/{CollapsiblePanel-BXH3rQRh.js → CollapsiblePanel-C1iRr4kZ.js} +2 -2
  31. package/dist/client/assets/{ComboboxClear-CVernRAh.js → ComboboxClear-DaifQLU5.js} +2 -2
  32. package/dist/client/assets/{ComboboxGroupLabel-DvjyoFJL.js → ComboboxGroupLabel-C03JGZRD.js} +2 -2
  33. package/dist/client/assets/{CommandBlock-WsIIEStK.js → CommandBlock-DH_L_Tgo.js} +2 -2
  34. package/dist/client/assets/{CompositeRoot-ByiP4GnC.js → CompositeRoot-B1DTZCNU.js} +2 -2
  35. package/dist/client/assets/{ConnectAgentSurface-DvJ8PBIx.js → ConnectAgentSurface-C5bZc2ZR.js} +2 -2
  36. package/dist/client/assets/{ConnectionStatusDot-K3y7Ct8v.js → ConnectionStatusDot-CCTiSlHA.js} +2 -2
  37. package/dist/client/assets/{DRLTVNUE-31JTQ6nY.js → DRLTVNUE-BqWUfmRf.js} +2 -2
  38. package/dist/client/assets/{DYY6UVD2-D_ZDUMtR.js → DYY6UVD2-CyRsghfa.js} +2 -2
  39. package/dist/client/assets/{DevicePanel-DZK0y5Ap.js → DevicePanel-DocID7hH.js} +2 -2
  40. package/dist/client/assets/{DeviceSetup-D3E85Zrd.js → DeviceSetup-CX2OWVB9.js} +2 -2
  41. package/dist/client/assets/{DialogRoot-CNtnfAJy.js → DialogRoot-D64NsaiW.js} +2 -2
  42. package/dist/client/assets/{DialogTitle-DV_YdpJC.js → DialogTitle-CYefNdHm.js} +2 -2
  43. package/dist/client/assets/{DiffCommentAnnotation-BOVXuQGc.js → DiffCommentAnnotation-ChKqFxt5.js} +2 -2
  44. package/dist/client/assets/{DiffFileTree-B5NHhHgk.js → DiffFileTree-B6AgzOXX.js} +2 -2
  45. package/dist/client/assets/{DiffPanel-Iu14e7z4.js → DiffPanel-DKAHtq5x.js} +2 -2
  46. package/dist/client/assets/{DiffWorkerPoolProvider-Dwi-pu0V.js → DiffWorkerPoolProvider-CK3y5UA1.js} +2 -2
  47. package/dist/client/assets/{EmbeddedDesign-B7W3XrYS.js → EmbeddedDesign-Bj-kkArq.js} +5 -5
  48. package/dist/client/assets/{EnvironmentMachineIcon-CXBfI2NX.js → EnvironmentMachineIcon-CJ30kzSK.js} +2 -2
  49. package/dist/client/assets/{ExpandableText-DfUAVk6K.js → ExpandableText-CBPvhWvZ.js} +2 -2
  50. package/dist/client/assets/{FNOVOB4O-uinkA45N.js → FNOVOB4O-DYXYw-b1.js} +2 -2
  51. package/dist/client/assets/{FieldControl-CIowDCcv.js → FieldControl-CkgERQaU.js} +2 -2
  52. package/dist/client/assets/{FileDiff-BmQX_G3I.js → FileDiff-BLuBewdN.js} +2 -2
  53. package/dist/client/assets/{FilePreviewPanel-X0C-_bsa.js → FilePreviewPanel-DWNimHTU.js} +5 -5
  54. package/dist/client/assets/{FoldedSettingsSection-veJCJBGN.js → FoldedSettingsSection-C3cuD_W9.js} +2 -2
  55. package/dist/client/assets/{HDGCDEEZ-C-FshFnT.js → HDGCDEEZ-7WPyPcLr.js} +2 -2
  56. package/dist/client/assets/{HSJLKHB7-DkWuWTFm.js → HSJLKHB7-t8_OkffK.js} +2 -2
  57. package/dist/client/assets/{Icons-CzUirT4o.js → Icons-BUrn1Fzo.js} +2 -2
  58. package/dist/client/assets/Input-Gb8KV9DV.js +2 -0
  59. package/dist/client/assets/{IntervalSecondsField-jhisp3XJ.js → IntervalSecondsField-D9JXVV-s.js} +2 -2
  60. package/dist/client/assets/JZOYTAAL-BzA5Kg5m.js +1 -0
  61. package/dist/client/assets/{K3MD6TGW-a8yr5Ewj.js → K3MD6TGW-DoqPvoaq.js} +2 -2
  62. package/dist/client/assets/{K7RP3OMA-B0CXNed1.js → K7RP3OMA--ZFOkyEG.js} +2 -2
  63. package/dist/client/assets/{KeybindingsSettings.logic-BJLp2hK6.js → KeybindingsSettings.logic-CMs7OPcH.js} +2 -2
  64. package/dist/client/assets/{LHDIQX7Q-CkhjJ70Y.js → LHDIQX7Q-hUqw2I9B.js} +2 -2
  65. package/dist/client/assets/{LUXOKEGN-DhYrChjL.js → LUXOKEGN-Dvu_mp-q.js} +2 -2
  66. package/dist/client/assets/{LinkMachineSelect-rWCX7r86.js → LinkMachineSelect-SHXPDP_g.js} +2 -2
  67. package/dist/client/assets/{MathTypeset-C9x0hMF0.js → MathTypeset-TM-3r0WA.js} +2 -2
  68. package/dist/client/assets/{ModelLiveLayer-Dv_jCIXj.js → ModelLiveLayer-Bb-7OhJ9.js} +3 -3
  69. package/dist/client/assets/{N3JZAHOW-B97FAWso.js → N3JZAHOW-LjhhJ-00.js} +2 -2
  70. package/dist/client/assets/{NUIALGQ3-Dq5lVW3w.js → NUIALGQ3-Dg1KXz02.js} +2 -2
  71. package/dist/client/assets/{NoProjectsHero-BsinbzdV.js → NoProjectsHero-D0OPZtzO.js} +2 -2
  72. package/dist/client/assets/{O65XPQGZ-D4-546m0.js → O65XPQGZ-BxaJR80d.js} +2 -2
  73. package/dist/client/assets/{O7XIQ6OM-BPEf7K4J.js → O7XIQ6OM-CCXPxMuU.js} +2 -2
  74. package/dist/client/assets/{OFQON5FD-ANLB_eks.js → OFQON5FD-WUMBXQkX.js} +2 -2
  75. package/dist/client/assets/{P4ConnectAccountPages-BkUG1cNj.js → P4ConnectAccountPages-BNK6s-RS.js} +2 -2
  76. package/dist/client/assets/{P4ConnectSidebarSignIn-Bd8SD-N2.js → P4ConnectSidebarSignIn-CWW40SMl.js} +2 -2
  77. package/dist/client/assets/{PJQHF43J-U5Qjv9uU.js → PJQHF43J-BrNjCaLl.js} +2 -2
  78. package/dist/client/assets/{PanelLayoutControls-BiOzQEUj.js → PanelLayoutControls-DiXjRWIw.js} +7 -7
  79. package/dist/client/assets/{PierreEntryIcon-C3yCp-3j.js → PierreEntryIcon-D29_Ylm_.js} +2 -2
  80. package/dist/client/assets/{PopoverHandle-BOG8GZW9.js → PopoverHandle-BgggGdpn.js} +2 -2
  81. package/dist/client/assets/PreviewPanel-DutKwWE7.js +2 -0
  82. package/dist/client/assets/{ProjectDefaultsSettings-BNoHUxLB.js → ProjectDefaultsSettings-DMfJN66D.js} +2 -2
  83. package/dist/client/assets/{ProjectFavicon-DJihy670.js → ProjectFavicon-DFI1NI3D.js} +3 -3
  84. package/dist/client/assets/{ProjectIconPickerDialog-B64NU333.js → ProjectIconPickerDialog-BqGWzrTc.js} +2 -2
  85. package/dist/client/assets/{ProjectMonogram-Bm8g4eoe.js → ProjectMonogram-D4xxVtw8.js} +2 -2
  86. package/dist/client/assets/{ProviderAuthTerminal-ep_3vQXs.js → ProviderAuthTerminal-CRSvI-Og.js} +2 -2
  87. package/dist/client/assets/ProviderModelPicker-D73G0AKf.js +2 -0
  88. package/dist/client/assets/{ProviderSettingsForm-DdzTiAwr.js → ProviderSettingsForm-DchD8HSN.js} +2 -2
  89. package/dist/client/assets/{PullRequestCodeTab-DxIVyifS.js → PullRequestCodeTab-BdXdTg-d.js} +3 -3
  90. package/dist/client/assets/{RHNBAITX-Ca700xaA.js → RHNBAITX-PsYrngSs.js} +2 -2
  91. package/dist/client/assets/{ReadOnlySourcePreview-DwbQjZ6S.js → ReadOnlySourcePreview-8jLKmc3M.js} +2 -2
  92. package/dist/client/assets/{RedactedSensitiveText-CKBxO8RE.js → RedactedSensitiveText-DhV2Jdu8.js} +2 -2
  93. package/dist/client/assets/{RenderErrorBoundary-Ds0CLe6f.js → RenderErrorBoundary-56lc2IQ3.js} +2 -2
  94. package/dist/client/assets/{RightPanelResizeHandle-kgBW_OmO.js → RightPanelResizeHandle-ClzdYxWw.js} +2 -2
  95. package/dist/client/assets/{SLD4V6NK-DHgBQG4y.js → SLD4V6NK-CxidvPXU.js} +2 -2
  96. package/dist/client/assets/{ScheduledTasksSettings-G10yO5DO.js → ScheduledTasksSettings-BdMCgBm5.js} +5 -5
  97. package/dist/client/assets/{ScopedSwitch-DGi7EZuF.js → ScopedSwitch-CwnjCta_.js} +2 -2
  98. package/dist/client/assets/{ScrollAreaCorner-sEIv5sN-.js → ScrollAreaCorner-CfTQYjCW.js} +2 -2
  99. package/dist/client/assets/{SecretInput-C8mfkoqW.js → SecretInput-BYfVbTLh.js} +2 -2
  100. package/dist/client/assets/{SelectScrollUpArrow-BBy8ExJB.js → SelectScrollUpArrow-BE0-tVtP.js} +2 -2
  101. package/dist/client/assets/{SelfImproveSettingsSection-CJpzoxZq.js → SelfImproveSettingsSection-DsqFeICK.js} +2 -2
  102. package/dist/client/assets/{SettingsPanels-CKuvIEcT.js → SettingsPanels-D_rJsyjt.js} +7 -7
  103. package/dist/client/assets/{SettingsPanels.logic-mWhM0JKq.js → SettingsPanels.logic-BTJUBh-T.js} +2 -2
  104. package/dist/client/assets/{SettingsScopeNotice-CYlVOS9U.js → SettingsScopeNotice-CAVvn3pQ.js} +2 -2
  105. package/dist/client/assets/{SidebarStageBackdrop-CcJgZb4i.js → SidebarStageBackdrop-DdxWuxIk.js} +2 -2
  106. package/dist/client/assets/{T3PCR2KE-sETS2BfN.js → T3PCR2KE-BtQsKjM5.js} +2 -2
  107. package/dist/client/assets/{TKWO2OVW-DOxrph0T.js → TKWO2OVW-CeYF-suq.js} +2 -2
  108. package/dist/client/assets/{TSHNXIZL-LkLzenBL.js → TSHNXIZL-FQ7ZWHEn.js} +2 -2
  109. package/dist/client/assets/{ThemeEditorPanel-BSPkdhmj.js → ThemeEditorPanel-BJucNhy-.js} +2 -2
  110. package/dist/client/assets/{ThreadDetailsItemsMenu-8anoK4Or.js → ThreadDetailsItemsMenu-CRBBIuc7.js} +8 -8
  111. package/dist/client/assets/{ThreadTerminalDrawer-Wd-He1GI.js → ThreadTerminalDrawer-Ci0mbLzJ.js} +4 -4
  112. package/dist/client/assets/{TooltipProvider-DMrkN3Xd.js → TooltipProvider-BH5ni_Lo.js} +2 -2
  113. package/dist/client/assets/{UQJE5E4I-DbEWChzq.js → UQJE5E4I-CeqBk-r6.js} +2 -2
  114. package/dist/client/assets/{USNYFO5S-D2NfvkZx.js → USNYFO5S-_1m41tJt.js} +2 -2
  115. package/dist/client/assets/{Virtualizer-C2gQRrRy.js → Virtualizer-DLB0FYm-.js} +2 -2
  116. package/dist/client/assets/{WEVWDWVA-CWLLvNnc.js → WEVWDWVA-DmSV8HLL.js} +2 -2
  117. package/dist/client/assets/{WorkspaceBreadcrumb-DDBBo54L.js → WorkspaceBreadcrumb-DQkeBQUl.js} +2 -2
  118. package/dist/client/assets/{WorkspacePageContainer-D-b_7VnU.js → WorkspacePageContainer-D2rx9iDg.js} +2 -2
  119. package/dist/client/assets/{WorkspacePageHeader-C8bAlMLy.js → WorkspacePageHeader-D8-RIRjQ.js} +2 -2
  120. package/dist/client/assets/{X5RFHQXM-B_4xBer1.js → X5RFHQXM-BUdDYXox.js} +2 -2
  121. package/dist/client/assets/{X62E3GBT-DH4DDJbS.js → X62E3GBT-BbQ7FmNB.js} +2 -2
  122. package/dist/client/assets/{XBNEOJTC-CH0FX2u2.js → XBNEOJTC-BLEZA-vx.js} +2 -2
  123. package/dist/client/assets/{YHV2MVVZ-vkFosclt.js → YHV2MVVZ-DM2RTtkR.js} +2 -2
  124. package/dist/client/assets/{YURCZMG2-CflztzI6.js → YURCZMG2-D5w6cPMY.js} +2 -2
  125. package/dist/client/assets/{YVG2LODB-BU5mIo0f.js → YVG2LODB-BkLbsaCo.js} +2 -2
  126. package/dist/client/assets/{_chat-rr4Pa6Jr.js → _chat-CKMs-ajx.js} +19 -19
  127. package/dist/client/assets/{_chat.design-DcTokS2n.js → _chat.design-CpqXODBn.js} +2 -2
  128. package/dist/client/assets/{_chat.index-Cx2rD23U.js → _chat.index-B0eOfZAf.js} +2 -2
  129. package/dist/client/assets/{_chat.new-Bef-dZPa.js → _chat.new-CqLuDynd.js} +2 -2
  130. package/dist/client/assets/{_chat.pull-requests-CEwED8fj.js → _chat.pull-requests-C4Eo8GDQ.js} +2 -2
  131. package/dist/client/assets/{alert-iNR43-xr.js → alert-D1O9oex3.js} +2 -2
  132. package/dist/client/assets/{alert-dialog-B7VzBOev.js → alert-dialog-3XDceRWv.js} +2 -2
  133. package/dist/client/assets/{assetUrls-BMHkXryh.js → assetUrls-Dq0gsqWs.js} +2 -2
  134. package/dist/client/assets/{assets-C96oF_eX.js → assets-C3_UZib9.js} +2 -2
  135. package/dist/client/assets/{browserHistoryStore-DcyxHvEZ.js → browserHistoryStore-CVCo7qfb.js} +2 -2
  136. package/dist/client/assets/{browserLinkTarget-5NDfBwMZ.js → browserLinkTarget-CopcRHna.js} +2 -2
  137. package/dist/client/assets/{checkbox-BnoBa5Yw.js → checkbox-CxRqp4sO.js} +2 -2
  138. package/dist/client/assets/{color-picker-DGBwf4df.js → color-picker-CvbP7BS3.js} +2 -2
  139. package/dist/client/assets/{combobox-BViCCYpe.js → combobox-CuyUAuiC.js} +2 -2
  140. package/dist/client/assets/{command-DD9AbES_.js → command-4bqVdX0m.js} +2 -2
  141. package/dist/client/assets/{connect-B3_KXIyQ.js → connect-DFGquf-O.js} +2 -2
  142. package/dist/client/assets/connect-agent-Db5rxxY1.js +2 -0
  143. package/dist/client/assets/{design-BwQ33zDs.js → design-DzoN9JgQ.js} +2 -2
  144. package/dist/client/assets/{device-CAueNfph.js → device-H2MyT_kA.js} +2 -2
  145. package/dist/client/assets/{dialog-DvBVJIw1.js → dialog-CrLVN_m6.js} +2 -2
  146. package/dist/client/assets/{diffPanelStore-B43kjSer.js → diffPanelStore-CxnPNigi.js} +2 -2
  147. package/dist/client/assets/{diffRendering-DwbgLJaq.js → diffRendering-cyTQV5bk.js} +2 -2
  148. package/dist/client/assets/{dist-B-8eHEk-.js → dist-J7s-H61h.js} +3 -3
  149. package/dist/client/assets/{draft-input-CBmbOI5j.js → draft-input-UuEBPJE8.js} +2 -2
  150. package/dist/client/assets/{duoViewer-Dml9fvvm.js → duoViewer-C3DQnADY.js} +2 -2
  151. package/dist/client/assets/{dynamic-C2hTfNo4.js → dynamic-PDa6LTqb.js} +2 -2
  152. package/dist/client/assets/{embeddedScripts-DmobRpxc.js → embeddedScripts-BDzRNXSL.js} +2 -2
  153. package/dist/client/assets/{empty-CGA6iTo1.js → empty-YMXgQbNI.js} +2 -2
  154. package/dist/client/assets/{entities-ygRGujH7.js → entities-HOBDIiHK.js} +2 -2
  155. package/dist/client/assets/{fileLinks-COT45KrB.js → fileLinks-BlT4My6t.js} +2 -2
  156. package/dist/client/assets/{fileTreeExpansion-t42YM2NT.js → fileTreeExpansion-D5nN-Oqd.js} +2 -2
  157. package/dist/client/assets/{getDiffFileInput-BRoo9f7T.js → getDiffFileInput-4gToQuSl.js} +2 -2
  158. package/dist/client/assets/{htmlRender-w5A35V7p.js → htmlRender-CUGVJXGf.js} +2 -2
  159. package/dist/client/assets/{index-BfU6cQrF.js → index-C04a0SKq.js} +3 -3
  160. package/dist/client/assets/{input-L7UBCORX.js → input-DxHa9qj5.js} +2 -2
  161. package/dist/client/assets/{input-group-B4A2yaVX.js → input-group-_rAbDbys.js} +2 -2
  162. package/dist/client/assets/{kbd-CNvVBYtE.js → kbd-DjUfNaix.js} +2 -2
  163. package/dist/client/assets/{keybindings-DoiXiZn5.js → keybindings-8_1sqf8s.js} +2 -2
  164. package/dist/client/assets/{lazy-BYuTmsKJ.js → lazy-C1dqAep6.js} +4 -4
  165. package/dist/client/assets/{lazyRouteComponent-DlaI8YOu.js → lazyRouteComponent-DLamKhHF.js} +2 -2
  166. package/dist/client/assets/{link-Vg2garcH.js → link-D1nkgCv7.js} +2 -2
  167. package/dist/client/assets/{linkedPrompt-Bg0S0srn.js → linkedPrompt-Quysf0mk.js} +2 -2
  168. package/dist/client/assets/main-BFdCLmkY.js +39 -0
  169. package/dist/client/assets/{mediaReference-BGHvhhnE.js → mediaReference-D19Dzoh3.js} +2 -2
  170. package/dist/client/assets/{mediaSource-CeGNee1z.js → mediaSource-DfsR3T70.js} +2 -2
  171. package/dist/client/assets/{modelScene-DtBAQ8-k.js → modelScene-CcF-Uii-.js} +2 -2
  172. package/dist/client/assets/{number-field-BRlzUJEB.js → number-field-CALZZPio.js} +2 -2
  173. package/dist/client/assets/{observeResize-CNiPL-bo.js → observeResize-DLmefMqO.js} +2 -2
  174. package/dist/client/assets/{onboarding-9Isl06ny.js → onboarding-plATuZco.js} +2 -2
  175. package/dist/client/assets/{openFileInPreview-CgNdFzHq.js → openFileInPreview-BCGQQ_Ia.js} +2 -2
  176. package/dist/client/assets/{p4ProjectFile-kzawDum5.js → p4ProjectFile-DCNJ4pTp.js} +2 -2
  177. package/dist/client/assets/{pair-ClGrg_fl.js → pair-umv6-haX.js} +2 -2
  178. package/dist/client/assets/{pendingSendStore-Kz-cNs4v.js → pendingSendStore-CgfQk4GV.js} +2 -2
  179. package/dist/client/assets/{phoneViewer-B5Ue7Mj_.js → phoneViewer-DJWjzgFc.js} +2 -2
  180. package/dist/client/assets/{pierre-icons-cxD685IX.js → pierre-icons-fv1goMS6.js} +2 -2
  181. package/dist/client/assets/{popover-DYDa4qjy.js → popover-DxCAIK62.js} +2 -2
  182. package/dist/client/assets/{preview-BypB2j7r.js → preview-Ce5ECOHv.js} +2 -2
  183. package/dist/client/assets/{preview-BPJ2QBFC.js → preview-x1tmlUez.js} +2 -2
  184. package/dist/client/assets/{previewMiniPlayerStore-C_zTFBAY.js → previewMiniPlayerStore-CEd7VI6J.js} +2 -2
  185. package/dist/client/assets/{primary-BP9P8Pte.js → primary-DcnaBKM0.js} +2 -2
  186. package/dist/client/assets/{primaryCloudLinkState-DRbP1pee.js → primaryCloudLinkState-TS0IW37f.js} +2 -2
  187. package/dist/client/assets/{projectFilesQueryState-DodSPNTI.js → projectFilesQueryState-DKw9S3nn.js} +2 -2
  188. package/dist/client/assets/{projectScriptEditor-DxYgPh8M.js → projectScriptEditor-DT7-Ivvb.js} +2 -2
  189. package/dist/client/assets/{providerSkills-DA9qtjVM.js → providerSkills-G8ld9nNp.js} +2 -2
  190. package/dist/client/assets/{pullRequestDetail.logic-Car0C0YH.js → pullRequestDetail.logic-Dm3mx1US.js} +2 -2
  191. package/dist/client/assets/{pullRequestIcons-CJzQ9q45.js → pullRequestIcons-D8rnFTkk.js} +2 -2
  192. package/dist/client/assets/{pullRequestReviewStore-CWrDaNh_.js → pullRequestReviewStore-C45fih_P.js} +2 -2
  193. package/dist/client/assets/{pullRequests-Dx8h1wyx.js → pullRequests-euX1Ch2G.js} +2 -2
  194. package/dist/client/assets/{queries-DY1lhLYl.js → queries-DNRXml7d.js} +2 -2
  195. package/dist/client/assets/{query-C-5C8CaD.js → query-Bw8YoCbO.js} +2 -2
  196. package/dist/client/assets/{radio-group-DpsCw8_-.js → radio-group-DpD3XHAp.js} +2 -2
  197. package/dist/client/assets/{relay-Bjm0weca.js → relay-YiJpGyaO.js} +2 -2
  198. package/dist/client/assets/{relayFailureReason-1tQ1xfnE.js → relayFailureReason-Baxcpnas.js} +2 -2
  199. package/dist/client/assets/{renderScheduler-Bza_olpQ.js → renderScheduler-BuGbk7RK.js} +2 -2
  200. package/dist/client/assets/{rightPanelStore-BNvdVe0q.js → rightPanelStore-BF1zmmXM.js} +2 -2
  201. package/dist/client/assets/{runtime-DGtwOpiP.js → runtime-DIAcbMTc.js} +5 -5
  202. package/dist/client/assets/{runtimeModeConfig-DicWhVdl.js → runtimeModeConfig-4g_-_dE2.js} +2 -2
  203. package/dist/client/assets/{scheduledTasksSettings.logic-u5XriP_U.js → scheduledTasksSettings.logic-BOrkdeD3.js} +2 -2
  204. package/dist/client/assets/{scroll-area-Ct6TrgZr.js → scroll-area-CokPD3-i.js} +2 -2
  205. package/dist/client/assets/{select-B3jSTp6e.js → select-CxYi0YMi.js} +2 -2
  206. package/dist/client/assets/{selfImproveFindings-Bw954UOu.js → selfImproveFindings-CE-lxRTw.js} +2 -2
  207. package/dist/client/assets/{server-BjY-vKW2.js → server-BNjk2K1j.js} +2 -2
  208. package/dist/client/assets/{session-CkASndp1.js → session-DMNo4Bh3.js} +2 -2
  209. package/dist/client/assets/{session-logic-C3HuEav7.js → session-logic-CELyWJ1v.js} +2 -2
  210. package/dist/client/assets/{settings-DpDhgaUs.js → settings-Bt6o5coA.js} +2 -2
  211. package/dist/client/assets/{settings.appearance-BMBe1DlC.js → settings.appearance-pkRxkhgs.js} +2 -2
  212. package/dist/client/assets/settings.archived-OjOh5b0A.js +2 -0
  213. package/dist/client/assets/{settings.computer-use-dlKT7XFQ.js → settings.computer-use-Dh6Z2-Jg.js} +2 -2
  214. package/dist/client/assets/{settings.connections-BaU6DQRh.js → settings.connections-F3LWiK8-.js} +2 -2
  215. package/dist/client/assets/{settings.data-controls-DrInQbPq.js → settings.data-controls-DgOo9a4b.js} +2 -2
  216. package/dist/client/assets/{settings.decisions-Dibz4qNv.js → settings.decisions-lQFEkC9t.js} +2 -2
  217. package/dist/client/assets/{settings.designs-BGdZiNGp.js → settings.designs-C1tyiETD.js} +2 -2
  218. package/dist/client/assets/settings.diagnostics-kp_wJw6e.js +2 -0
  219. package/dist/client/assets/{settings.general-rsdZzWCJ.js → settings.general-B5Kke4t3.js} +2 -2
  220. package/dist/client/assets/{settings.integrations-DK-S9Pa1.js → settings.integrations-CjiKCDy_.js} +2 -2
  221. package/dist/client/assets/{settings.keybindings-Coe8Ydce.js → settings.keybindings-CouYSmxE.js} +2 -2
  222. package/dist/client/assets/{settings.open-source-licenses--xUZ68RR.js → settings.open-source-licenses-CHFTLx1q.js} +2 -2
  223. package/dist/client/assets/{settings.plugins-DXoF7IBB.js → settings.plugins-StUBBho3.js} +3 -3
  224. package/dist/client/assets/{settings.projects-ChEJ7uSA.js → settings.projects-B_SxK9Cl.js} +3 -3
  225. package/dist/client/assets/{settings.providers-BYwf6_Ds.js → settings.providers-Ch16WkgV.js} +3 -3
  226. package/dist/client/assets/{settings.scheduled-tasks-Cu69dh_-.js → settings.scheduled-tasks-KNcUc94O.js} +2 -2
  227. package/dist/client/assets/{settings.secrets-CdyzqqJR.js → settings.secrets-2aMmfgKR.js} +2 -2
  228. package/dist/client/assets/{settings.snap-shot-DdYHf8Q5.js → settings.snap-shot-B5cEBXZD.js} +2 -2
  229. package/dist/client/assets/settings.source-control-G_TX95re.js +2 -0
  230. package/dist/client/assets/{settings.storage-CuUZoWfT.js → settings.storage-BdNNKm9m.js} +2 -2
  231. package/dist/client/assets/{settingsLayout-DbyBB8ZI.js → settingsLayout-CzGbLP4v.js} +2 -2
  232. package/dist/client/assets/{sidebar-Do4Myy34.js → sidebar-ovj9EiR4.js} +2 -2
  233. package/dist/client/assets/{sidebarProjectGrouping-Ks0H3W1r.js → sidebarProjectGrouping-DT6LCDEX.js} +2 -2
  234. package/dist/client/assets/{skeleton-M5MIqTy6.js → skeleton-0IEb3e4e.js} +2 -2
  235. package/dist/client/assets/{sourceControl-gpSCT1i6.js → sourceControl-CPobWWHq.js} +2 -2
  236. package/dist/client/assets/{sourceControlClients-YDf1HZkJ.js → sourceControlClients-4PlkytxQ.js} +2 -2
  237. package/dist/client/assets/{spinner-89SWutMk.js → spinner-7CSKKESP.js} +2 -2
  238. package/dist/client/assets/{src-upZEL2qH.js → src-BVovWpja.js} +2 -2
  239. package/dist/client/assets/{terminal-links-ztYtKVge.js → terminal-links-BTdovUFa.js} +2 -2
  240. package/dist/client/assets/{terminalSessions-DuQL-Su5.js → terminalSessions-EUiRWJti.js} +2 -2
  241. package/dist/client/assets/{textarea-Dk6r4lQ8.js → textarea-DMmmmGA1.js} +2 -2
  242. package/dist/client/assets/{themePalette-CwTOEe8R.js → themePalette-C7ZOgucT.js} +2 -2
  243. package/dist/client/assets/{threadCheckpoints-BBbnkFJd.js → threadCheckpoints-DjIk4Kvg.js} +2 -2
  244. package/dist/client/assets/{toggle-CzhtG7Ix.js → toggle-4vFx94TS.js} +2 -2
  245. package/dist/client/assets/{toggle-group-DVojM2PG.js → toggle-group-d6H735Xi.js} +2 -2
  246. package/dist/client/assets/{tooltip-CZBiwhnV.js → tooltip-CGvxq8k3.js} +2 -2
  247. package/dist/client/assets/{uiStateStore-DbqU-t2g.js → uiStateStore-MbQdhAPp.js} +2 -2
  248. package/dist/client/assets/{usage-CvKBHOpJ.js → usage-Da_tm2dn.js} +2 -2
  249. package/dist/client/assets/{usageAccess-12EW-JWb.js → usageAccess-B-HGPPkp.js} +2 -2
  250. package/dist/client/assets/{usageFormat-Bpgdmf94.js → usageFormat-DcON9Kz_.js} +2 -2
  251. package/dist/client/assets/{usageShortcuts-BK6jQ69t.js → usageShortcuts-B_o9XxKX.js} +2 -2
  252. package/dist/client/assets/{use-atom-command-Dv8zTjOp.js → use-atom-command-C4Tyb1VL.js} +2 -2
  253. package/dist/client/assets/{useAriaLabelledBy-CLMjXrdj.js → useAriaLabelledBy-CcwjH1QH.js} +2 -2
  254. package/dist/client/assets/useHandleNewThread-Qb_yy6KY.js +2 -0
  255. package/dist/client/assets/{useLocation-DsTBGqgr.js → useLocation-CIvcNoeU.js} +2 -2
  256. package/dist/client/assets/{useNavigate-DeDarx0_.js → useNavigate-DVrOlf8m.js} +2 -2
  257. package/dist/client/assets/{useNavigateBack-nU9Xh3KX.js → useNavigateBack-Dmf0SIc3.js} +2 -2
  258. package/dist/client/assets/{useP4ConnectAuthPrompt-wImG3qls.js → useP4ConnectAuthPrompt-BPXqJdyY.js} +2 -2
  259. package/dist/client/assets/{useParams-D8m5ONq0.js → useParams-BeJIRxxE.js} +2 -2
  260. package/dist/client/assets/{usePermissionStatus-DPEHxlfG.js → usePermissionStatus-Cx1Wuwk0.js} +2 -2
  261. package/dist/client/assets/{usePopupViewport-DDPbext7.js → usePopupViewport-OR_PF2s-.js} +2 -2
  262. package/dist/client/assets/{usePullRequestActions-Bk-wSv5o.js → usePullRequestActions-B_Nrg846.js} +2 -2
  263. package/dist/client/assets/{useRegisterFieldControl-By1bF-jd.js → useRegisterFieldControl-B72Afmil.js} +2 -2
  264. package/dist/client/assets/{useScopedModelAvailability-CTzd1AsV.js → useScopedModelAvailability-DVQ42jT4.js} +2 -2
  265. package/dist/client/assets/{useSettings-DwDYuiOf.js → useSettings-BWMcQzC-.js} +2 -2
  266. package/dist/client/assets/{utils-sVhLpEl6.js → utils-DFNDxNZi.js} +2 -2
  267. package/dist/client/assets/{vcsRefInvalidation-9bbPf9DL.js → vcsRefInvalidation-CV8dYgi0.js} +2 -2
  268. package/dist/client/assets/{welcome-D36q57wJ.js → welcome-BxhPM21H.js} +2 -2
  269. package/dist/client/index.html +1 -1
  270. package/dist/{preview-D0Bi2g4U.mjs → preview-BGylKXB6.mjs} +5 -3
  271. package/dist/{renderer-Cq4PzLVY.mjs → renderer-CQkeNW9b.mjs} +2 -2
  272. package/dist/{runtime-Cy8_QlEa.mjs → runtime-O5AWAEzD.mjs} +2 -2
  273. package/dist/{runtimeLayer-DUru7wpz.mjs → runtimeLayer-C-Fo4HWH.mjs} +1 -1
  274. package/dist/{runtimeLayer-DZa24xtO.mjs → runtimeLayer-ChPBglJB.mjs} +535 -481
  275. package/dist/{server-BK48ByhE.mjs → server-CsS0d2BE.mjs} +116 -15
  276. package/dist/{sha2-D9ocDAIA.mjs → sha2-BjjJcoUu.mjs} +4 -1
  277. package/package.json +1 -1
  278. package/dist/client/assets/AlertDialogRoot-3k-2cSKF.js +0 -2
  279. package/dist/client/assets/Input-DRxcOIy1.js +0 -2
  280. package/dist/client/assets/JZOYTAAL-CaZB6S8Y.js +0 -1
  281. package/dist/client/assets/PreviewPanel-DzlmHQZw.js +0 -2
  282. package/dist/client/assets/ProviderModelPicker-Dj26-4yu.js +0 -2
  283. package/dist/client/assets/connect-agent-CX7YZ3cf.js +0 -2
  284. package/dist/client/assets/main-CNs583QD.js +0 -39
  285. package/dist/client/assets/settings.archived-UyT8Vo2k.js +0 -2
  286. package/dist/client/assets/settings.diagnostics-30yarj2c.js +0 -2
  287. package/dist/client/assets/settings.source-control-x5yuK078.js +0 -2
  288. package/dist/client/assets/useHandleNewThread-Do-y1VVt.js +0 -2
@@ -1,2 +1,2 @@
1
- import{a as e,t}from"./react-BUfh6y28.js";import{t as n}from"./jsx-runtime-DJeoFXNw.js";import{Ea as r,Ga as i,Ja as a,Rr as o,Ta as s,Ua as c,Wa as l,aa as u,ka as d,la as f,zr as p}from"./utils-sVhLpEl6.js";import{c as m,s as h}from"./useRender-BP5vR6yH.js";import{t as g}from"./usePreviousValue-Dx4Nv0v8.js";var _=e(t()),v=e(r());function y(e){let t=i(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,o=a(e),s=o?e.offsetWidth:n,c=o?e.offsetHeight:r;return(u(n)!==s||u(r)!==c)&&(n=s,r=c),{width:n,height:r}}var b=()=>!0;function x(e){let{popupElement:t,positionerElement:n,content:r,mounted:i,enabled:a=b,onMeasureLayout:o,onMeasureLayoutComplete:u,side:f,direction:p}=e,g=s(t,!0,!1),v=d(),x=_.useRef(null),E=_.useRef(null),D=_.useRef(!0),O=_.useRef(m),k=l(o),A=l(u),j=_.useMemo(()=>{let e=f===`top`,t=f===`left`;return p===`rtl`?(e||=f===`inline-end`,t||=f===`inline-end`):(e||=f===`inline-start`,t||=f===`inline-start`),e?{position:`absolute`,[f===`top`?`bottom`:`top`]:`0`,[t?`right`:`left`]:`0`}:h},[f,p]);c(()=>{if(!i||!a()||typeof ResizeObserver!=`function`){O.current=m,D.current=!0,x.current=null,E.current=null;return}if(!t||!n)return;O.current=C(t,j);let e=new ResizeObserver(e=>{let t=e[0];t&&(E.current={width:Math.ceil(t.borderBoxSize[0].inlineSize),height:Math.ceil(t.borderBoxSize[0].blockSize)})});e.observe(t),w(t,`auto`);let r=S(t,`position`,`static`),o=S(t,`transform`,`none`),s=S(t,`scale`,`1`),c=C(n,{"--available-width":`max-content`,"--available-height":`max-content`});function l(){r(),o(),c()}function u(){l(),s()}if(k?.(),D.current||x.current===null){T(n,`max-content`);let r=y(t);return x.current=r,T(n,r),u(),A?.(null,r),D.current=!1,()=>{e.disconnect(),O.current(),O.current=m}}w(t,`auto`),T(n,`max-content`);let d=x.current??E.current,f=y(t);if(x.current=f,!d)return T(n,f),u(),A?.(null,f),()=>{e.disconnect(),v.cancel(),O.current(),O.current=m};w(t,d),u(),A?.(d,f),T(n,f);let p=new AbortController;return v.request(()=>{w(t,f),g(()=>{t.style.setProperty(`--popup-width`,`auto`),t.style.setProperty(`--popup-height`,`auto`)},p.signal)}),()=>{e.disconnect(),p.abort(),v.cancel(),O.current(),O.current=m}},[r,t,n,g,v,a,i,k,A,j])}function S(e,t,n){let r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{e.style.setProperty(t,r)}}function C(e,t){let n=[];for(let[r,i]of Object.entries(t))n.push(S(e,r,i));return n.length?()=>{n.forEach(e=>e())}:m}function w(e,t){let n=t===`auto`?`auto`:`${t.width}px`,r=t===`auto`?`auto`:`${t.height}px`;e.style.setProperty(`--popup-width`,n),e.style.setProperty(`--popup-height`,r)}function T(e,t){let n=t===`max-content`?`max-content`:`${t.width}px`,r=t===`max-content`?`max-content`:`${t.height}px`;e.style.setProperty(`--positioner-width`,n),e.style.setProperty(`--positioner-height`,r)}var E=e(n());function D(e){let{store:t,side:n,cssVars:r,children:i}=e,a=o(),u=t.useState(`activeTriggerElement`),m=t.useState(`activeTriggerId`),h=t.useState(`open`),y=t.useState(`payload`),b=t.useState(`mounted`),S=t.useState(`popupElement`),C=t.useState(`positionerElement`),w=g(h?u:null),T=j(m,y),D=_.useRef(null),[k,M]=_.useState(null),[N,P]=_.useState(null),F=_.useRef(null),I=_.useRef(null),L=s(F,!0,!1),R=d(),[z,B]=_.useState(null),[V,H]=_.useState(!1);c(()=>(t.set(`hasViewport`,!0),()=>{t.set(`hasViewport`,!1)}),[t]);let U=l(()=>{F.current?.style.setProperty(`animation`,`none`),F.current?.style.setProperty(`transition`,`none`),I.current?.style.setProperty(`display`,`none`)}),W=l(e=>{F.current?.style.removeProperty(`animation`),F.current?.style.removeProperty(`transition`),I.current?.style.removeProperty(`display`),e&&B(e)}),G=_.useRef(null);c(()=>{if(u&&w&&u!==w&&G.current!==u&&D.current){M(D.current),H(!0);let e=A(w,u);P(e),R.request(()=>{v.flushSync(()=>{H(!1)}),L(()=>{M(null),B(null),D.current=null})}),G.current=u}},[u,w,k,L,R]),c(()=>{let e=F.current;if(!e)return;let t=f(e).createElement(`div`);for(let n of Array.from(e.childNodes))t.appendChild(n.cloneNode(!0));D.current=t});let K=k!=null,q;q=K?(0,E.jsxs)(_.Fragment,{children:[(0,E.jsx)(`div`,{"data-previous":!0,inert:p(!0),ref:I,style:{...z?{[r.popupWidth]:`${z.width}px`,[r.popupHeight]:`${z.height}px`}:null,position:`absolute`},"data-ending-style":V?void 0:``},`previous`),(0,E.jsx)(`div`,{"data-current":!0,ref:F,"data-starting-style":V?``:void 0,children:i},T)]}):(0,E.jsx)(`div`,{"data-current":!0,ref:F,children:i},T),c(()=>{let e=I.current;e&&k&&e.replaceChildren(...Array.from(k.childNodes))},[k]),x({popupElement:S,positionerElement:C,mounted:b,content:y,onMeasureLayout:U,onMeasureLayoutComplete:W,side:n,direction:a});let J={activationDirection:O(N),transitioning:K};return{children:q,state:J}}function O(e){if(e)return`${k(e.horizontal,5,`right`,`left`)} ${k(e.vertical,5,`down`,`up`)}`}function k(e,t,n,r){return e>t?n:e<-t?r:``}function A(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i={x:n.left+n.width/2,y:n.top+n.height/2},a={x:r.left+r.width/2,y:r.top+r.height/2};return{horizontal:a.x-i.x,vertical:a.y-i.y}}function j(e,t){let[n,r]=_.useState(0),i=_.useRef(e),a=_.useRef(t),o=_.useRef(!1);return c(()=>{let n=i.current,s=a.current,c=e!==n,l=t!==s;c?(r(e=>e+1),o.current=!l):o.current&&l&&(r(e=>e+1),o.current=!1),i.current=e,a.current=t},[e,t]),`${e??`current`}-${n}`}export{D as t};
2
- //# sourceMappingURL=usePopupViewport-DDPbext7.js.map
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{t as n}from"./jsx-runtime-DJeoFXNw.js";import{Ea as r,Ga as i,Ja as a,Rr as o,Ta as s,Ua as c,Wa as l,aa as u,ka as d,la as f,zr as p}from"./utils-DFNDxNZi.js";import{c as m,s as h}from"./useRender-BP5vR6yH.js";import{t as g}from"./usePreviousValue-Dx4Nv0v8.js";var _=e(t()),v=e(r());function y(e){let t=i(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,o=a(e),s=o?e.offsetWidth:n,c=o?e.offsetHeight:r;return(u(n)!==s||u(r)!==c)&&(n=s,r=c),{width:n,height:r}}var b=()=>!0;function x(e){let{popupElement:t,positionerElement:n,content:r,mounted:i,enabled:a=b,onMeasureLayout:o,onMeasureLayoutComplete:u,side:f,direction:p}=e,g=s(t,!0,!1),v=d(),x=_.useRef(null),E=_.useRef(null),D=_.useRef(!0),O=_.useRef(m),k=l(o),A=l(u),j=_.useMemo(()=>{let e=f===`top`,t=f===`left`;return p===`rtl`?(e||=f===`inline-end`,t||=f===`inline-end`):(e||=f===`inline-start`,t||=f===`inline-start`),e?{position:`absolute`,[f===`top`?`bottom`:`top`]:`0`,[t?`right`:`left`]:`0`}:h},[f,p]);c(()=>{if(!i||!a()||typeof ResizeObserver!=`function`){O.current=m,D.current=!0,x.current=null,E.current=null;return}if(!t||!n)return;O.current=C(t,j);let e=new ResizeObserver(e=>{let t=e[0];t&&(E.current={width:Math.ceil(t.borderBoxSize[0].inlineSize),height:Math.ceil(t.borderBoxSize[0].blockSize)})});e.observe(t),w(t,`auto`);let r=S(t,`position`,`static`),o=S(t,`transform`,`none`),s=S(t,`scale`,`1`),c=C(n,{"--available-width":`max-content`,"--available-height":`max-content`});function l(){r(),o(),c()}function u(){l(),s()}if(k?.(),D.current||x.current===null){T(n,`max-content`);let r=y(t);return x.current=r,T(n,r),u(),A?.(null,r),D.current=!1,()=>{e.disconnect(),O.current(),O.current=m}}w(t,`auto`),T(n,`max-content`);let d=x.current??E.current,f=y(t);if(x.current=f,!d)return T(n,f),u(),A?.(null,f),()=>{e.disconnect(),v.cancel(),O.current(),O.current=m};w(t,d),u(),A?.(d,f),T(n,f);let p=new AbortController;return v.request(()=>{w(t,f),g(()=>{t.style.setProperty(`--popup-width`,`auto`),t.style.setProperty(`--popup-height`,`auto`)},p.signal)}),()=>{e.disconnect(),p.abort(),v.cancel(),O.current(),O.current=m}},[r,t,n,g,v,a,i,k,A,j])}function S(e,t,n){let r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{e.style.setProperty(t,r)}}function C(e,t){let n=[];for(let[r,i]of Object.entries(t))n.push(S(e,r,i));return n.length?()=>{n.forEach(e=>e())}:m}function w(e,t){let n=t===`auto`?`auto`:`${t.width}px`,r=t===`auto`?`auto`:`${t.height}px`;e.style.setProperty(`--popup-width`,n),e.style.setProperty(`--popup-height`,r)}function T(e,t){let n=t===`max-content`?`max-content`:`${t.width}px`,r=t===`max-content`?`max-content`:`${t.height}px`;e.style.setProperty(`--positioner-width`,n),e.style.setProperty(`--positioner-height`,r)}var E=e(n());function D(e){let{store:t,side:n,cssVars:r,children:i}=e,a=o(),u=t.useState(`activeTriggerElement`),m=t.useState(`activeTriggerId`),h=t.useState(`open`),y=t.useState(`payload`),b=t.useState(`mounted`),S=t.useState(`popupElement`),C=t.useState(`positionerElement`),w=g(h?u:null),T=j(m,y),D=_.useRef(null),[k,M]=_.useState(null),[N,P]=_.useState(null),F=_.useRef(null),I=_.useRef(null),L=s(F,!0,!1),R=d(),[z,B]=_.useState(null),[V,H]=_.useState(!1);c(()=>(t.set(`hasViewport`,!0),()=>{t.set(`hasViewport`,!1)}),[t]);let U=l(()=>{F.current?.style.setProperty(`animation`,`none`),F.current?.style.setProperty(`transition`,`none`),I.current?.style.setProperty(`display`,`none`)}),W=l(e=>{F.current?.style.removeProperty(`animation`),F.current?.style.removeProperty(`transition`),I.current?.style.removeProperty(`display`),e&&B(e)}),G=_.useRef(null);c(()=>{if(u&&w&&u!==w&&G.current!==u&&D.current){M(D.current),H(!0);let e=A(w,u);P(e),R.request(()=>{v.flushSync(()=>{H(!1)}),L(()=>{M(null),B(null),D.current=null})}),G.current=u}},[u,w,k,L,R]),c(()=>{let e=F.current;if(!e)return;let t=f(e).createElement(`div`);for(let n of Array.from(e.childNodes))t.appendChild(n.cloneNode(!0));D.current=t});let K=k!=null,q;q=K?(0,E.jsxs)(_.Fragment,{children:[(0,E.jsx)(`div`,{"data-previous":!0,inert:p(!0),ref:I,style:{...z?{[r.popupWidth]:`${z.width}px`,[r.popupHeight]:`${z.height}px`}:null,position:`absolute`},"data-ending-style":V?void 0:``},`previous`),(0,E.jsx)(`div`,{"data-current":!0,ref:F,"data-starting-style":V?``:void 0,children:i},T)]}):(0,E.jsx)(`div`,{"data-current":!0,ref:F,children:i},T),c(()=>{let e=I.current;e&&k&&e.replaceChildren(...Array.from(k.childNodes))},[k]),x({popupElement:S,positionerElement:C,mounted:b,content:y,onMeasureLayout:U,onMeasureLayoutComplete:W,side:n,direction:a});let J={activationDirection:O(N),transitioning:K};return{children:q,state:J}}function O(e){if(e)return`${k(e.horizontal,5,`right`,`left`)} ${k(e.vertical,5,`down`,`up`)}`}function k(e,t,n,r){return e>t?n:e<-t?r:``}function A(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i={x:n.left+n.width/2,y:n.top+n.height/2},a={x:r.left+r.width/2,y:r.top+r.height/2};return{horizontal:a.x-i.x,vertical:a.y-i.y}}function j(e,t){let[n,r]=_.useState(0),i=_.useRef(e),a=_.useRef(t),o=_.useRef(!1);return c(()=>{let n=i.current,s=a.current,c=e!==n,l=t!==s;c?(r(e=>e+1),o.current=!l):o.current&&l&&(r(e=>e+1),o.current=!1),i.current=e,a.current=t},[e,t]),`${e??`current`}-${n}`}export{D as t};
2
+ //# sourceMappingURL=usePopupViewport-OR_PF2s-.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,Jo as i,Js as a,Wo as o,gs as s,ws as c,xs as l}from"./utils-sVhLpEl6.js";import{ha as u,n as d,ra as f,ua as p,vg as m,xm as h}from"./src-upZEL2qH.js";import{Ar as g,br as _,t as v,yr as ee}from"./runtime-DGtwOpiP.js";import{a as y,i as b,t as x}from"./vcsRefInvalidation-9bbPf9DL.js";import{C as S}from"./entities-ygRGujH7.js";import{a as C}from"./relay-Bjm0weca.js";import{f as w,k as te,s as T}from"./useSettings-DwDYuiOf.js";import{i as ne,n as E}from"./session-CkASndp1.js";import{n as D}from"./query-C-5C8CaD.js";import{t as O}from"./use-atom-command-Dv8zTjOp.js";import{d as k,f as A,p as j}from"./queries-DY1lhLYl.js";import{t as re}from"./sourceControl-gpSCT1i6.js";import{r as M,w as N}from"./pullRequests-Dx8h1wyx.js";import{L as P,i as ie}from"./pullRequestDetail.logic-Car0C0YH.js";import{n as ae}from"./useHandleNewThread-Do-y1VVt.js";import{c as F,f as I,i as L,s as R}from"./p4ProjectFile-kzawDum5.js";import{t as z}from"./sidebarProjectGrouping-Ks0H3W1r.js";var B=e(t(),1),V=n();function H(e){return{pullRequestResolution:_(e,{label:`environment-data:git:resolve-pull-request`,tag:d.gitResolvePullRequest}),preparePullRequestThread:ee(e,{label:`environment-data:git:prepare-pull-request-thread`,tag:d.gitPreparePullRequestThread,scheduler:y,concurrency:b,onSettled:({environmentId:e,input:t},n)=>x(n,{environmentId:e,cwd:t.cwd})})}}var U=H(v),W={init:`init`,pull:`pull`,publishRepository:`publish_repository`,runStackedAction:`run_change_request`,preparePullRequestThread:`prepare_pull_request_thread`};function G(e){let t=ne(e.scope.environmentId,p),n=W[e.kind],r=i(k.stateAtom(e.scope)),a=r.operation===n,c=(0,B.useCallback)(()=>{k.resetError(o,e.scope,n)},[e.scope,n]),d=(0,B.useCallback)(async(...t)=>{if(e.scope.environmentId===null||!E(e.scope.environmentId,`source-control:write`))return s(h(new u({requiredScope:p,message:`This connection cannot change source control.`})));let r=async()=>{let n=await e.action(...t);return l(n)&&e.onSuccess?.(),n};return e.managedExternally===!0?r():k.track(o,e.scope,{operation:n,label:e.label},r)},[e.action,e.label,e.managedExternally,e.onSuccess,e.scope,n]);return{isAllowed:t,error:a?r.error:null,isPending:a&&r.isRunning,resetError:c,run:d}}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=k.stateAtom(e),n[0]=e,n[1]=r);let a=i(r),o;return n[2]!==t||n[3]!==a.isRunning||n[4]!==a.operation?(o=a.isRunning&&a.operation!==null&&t.some(e=>W[e]===a.operation),n[2]=t,n[3]=a.isRunning,n[4]=a.operation,n[5]=o):o=n[5],o}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(A.init,n),i;t[1]!==r||t[2]!==e?(i=async()=>{let t=K(e);return t===null?s(h(new j({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 a=i,o;return t[4]!==a||t[5]!==e?(o={kind:`init`,label:`Initializing repository`,scope:e,action:a},t[4]=a,t[5]=e,t[6]=o):o=t[6],G(o)}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(A.pull,n),i;t[1]!==e.cwd||t[2]!==e.environmentId?(i=e.environmentId!==null&&e.cwd!==null?A.status({environmentId:e.environmentId,input:{cwd:e.cwd}}):null,t[1]=e.cwd,t[2]=e.environmentId,t[3]=i):i=t[3];let a=D(i),o;t[4]!==r||t[5]!==e?(o=async()=>{let t=K(e);return t===null?s(h(new j({operation:`pull`,environmentId:e.environmentId,cwd:e.cwd}))):r({environmentId:t.environmentId,input:{cwd:t.cwd}})},t[4]=r,t[5]=e,t[6]=o):o=t[6];let c=o,l;return t[7]!==c||t[8]!==e||t[9]!==a.refresh?(l={kind:`pull`,label:`Pulling latest changes...`,scope:e,action:c,onSuccess:a.refresh},t[7]=c,t[8]=e,t[9]=a.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=k.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),a;t[3]!==e.cwd||t[4]!==e.environmentId?(a=e.environmentId!==null&&e.cwd!==null?A.status({environmentId:e.environmentId,input:{cwd:e.cwd}}):null,t[3]=e.cwd,t[4]=e.environmentId,t[5]=a):a=t[5];let o=D(a),c;t[6]!==i||t[7]!==e?(c=async t=>K(e)===null?s(h(new j({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]!==o.refresh?(u={kind:`runStackedAction`,label:`Running source control action`,scope:e,action:l,onSuccess:o.refresh,managedExternally:!0},t[9]=l,t[10]=e,t[11]=o.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(re.publishRepository,n),i;t[1]!==e.cwd||t[2]!==e.environmentId?(i=e.environmentId!==null&&e.cwd!==null?A.status({environmentId:e.environmentId,input:{cwd:e.cwd}}):null,t[1]=e.cwd,t[2]=e.environmentId,t[3]=i):i=t[3];let a=D(i),o;t[4]!==r||t[5]!==e?(o=async t=>{let n=K(e);return n===null?s(h(new j({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]=o):o=t[6];let c=o,l;return t[7]!==c||t[8]!==e||t[9]!==a.refresh?(l={kind:`publishRepository`,label:`Publishing repository`,scope:e,action:c,onSuccess:a.refresh},t[7]=c,t[8]=e,t[9]=a.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?s(h(new j({operation:`prepare_pull_request_thread`,environmentId:e.environmentId,cwd:e.cwd}))):t.mode===`worktree`&&t.threadId!==void 0&&!E(n.environmentId,`orchestration:operate`)?s(h(new u({requiredScope:f,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 a=i,o;return t[4]!==a||t[5]!==e?(o={kind:`preparePullRequestThread`,label:`Preparing pull request thread`,scope:e,action:a},t[4]=a,t[5]=e,t[6]=o):o=t[6],G(o)}function X(e){return e.environmentId===null||e.cwd===null||e.reference===null?null:m(c(o.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=w(e,r),a=T(de),o=T(I),s=S(),c=te(),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(F(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(M.runAction,{reportFailure:!1}),a=(0,B.useRef)(new Set),[o,s]=(0,B.useState)(()=>new Set),c=t===null?null:JSON.stringify([e,t.host??null,t.repository,t.number]);return{actionPending:c!==null&&o.has(c),perform:async(o,l)=>{if(!(c===null||t===null||a.current.has(c))){a.current.add(c),s(new Set(a.current));try{let a=await i({environmentId:e,input:{...t,action:o,...l?{mergeMethod:l}:r?{resolveMergeMethod:r}:{}}});if(a._tag===`Failure`)throw g(a);C.add({type:`success`,title:fe[o]}),n?.(o)}catch(e){C.add({type:`error`,title:pe[o],description:P(e,Z[o])})}finally{a.current.delete(c),s(new Set(a.current))}}}}}function Q(e){let t=O(M.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 g(n);o++,e(r)}catch(e){s.push(`#${r.number}: ${P(e,Z.close)}`)}finally{n.current.delete(N(r)),i(new Set(n.current))}})),C.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,Jo as i,Js as a,Wo as o,gs as s,ws as c,xs as l}from"./utils-DFNDxNZi.js";import{ha as u,n as d,ra as f,ua as p,vg as m,xm as h}from"./src-BVovWpja.js";import{Ar as g,br as _,t as v,yr as ee}from"./runtime-DIAcbMTc.js";import{a as y,i as b,t as x}from"./vcsRefInvalidation-CV8dYgi0.js";import{C as S}from"./entities-HOBDIiHK.js";import{a as C}from"./relay-YiJpGyaO.js";import{f as w,k as te,s as T}from"./useSettings-BWMcQzC-.js";import{i as ne,n as E}from"./session-DMNo4Bh3.js";import{n as D}from"./query-Bw8YoCbO.js";import{t as O}from"./use-atom-command-C4Tyb1VL.js";import{d as k,f as A,p as j}from"./queries-DNRXml7d.js";import{t as re}from"./sourceControl-CPobWWHq.js";import{r as M,w as N}from"./pullRequests-euX1Ch2G.js";import{L as P,i as ie}from"./pullRequestDetail.logic-Dm3mx1US.js";import{n as ae}from"./useHandleNewThread-Qb_yy6KY.js";import{c as F,f as I,i as L,s as R}from"./p4ProjectFile-DCNJ4pTp.js";import{t as z}from"./sidebarProjectGrouping-DT6LCDEX.js";var B=e(t(),1),V=n();function H(e){return{pullRequestResolution:_(e,{label:`environment-data:git:resolve-pull-request`,tag:d.gitResolvePullRequest}),preparePullRequestThread:ee(e,{label:`environment-data:git:prepare-pull-request-thread`,tag:d.gitPreparePullRequestThread,scheduler:y,concurrency:b,onSettled:({environmentId:e,input:t},n)=>x(n,{environmentId:e,cwd:t.cwd})})}}var U=H(v),W={init:`init`,pull:`pull`,publishRepository:`publish_repository`,runStackedAction:`run_change_request`,preparePullRequestThread:`prepare_pull_request_thread`};function G(e){let t=ne(e.scope.environmentId,p),n=W[e.kind],r=i(k.stateAtom(e.scope)),a=r.operation===n,c=(0,B.useCallback)(()=>{k.resetError(o,e.scope,n)},[e.scope,n]),d=(0,B.useCallback)(async(...t)=>{if(e.scope.environmentId===null||!E(e.scope.environmentId,`source-control:write`))return s(h(new u({requiredScope:p,message:`This connection cannot change source control.`})));let r=async()=>{let n=await e.action(...t);return l(n)&&e.onSuccess?.(),n};return e.managedExternally===!0?r():k.track(o,e.scope,{operation:n,label:e.label},r)},[e.action,e.label,e.managedExternally,e.onSuccess,e.scope,n]);return{isAllowed:t,error:a?r.error:null,isPending:a&&r.isRunning,resetError:c,run:d}}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=k.stateAtom(e),n[0]=e,n[1]=r);let a=i(r),o;return n[2]!==t||n[3]!==a.isRunning||n[4]!==a.operation?(o=a.isRunning&&a.operation!==null&&t.some(e=>W[e]===a.operation),n[2]=t,n[3]=a.isRunning,n[4]=a.operation,n[5]=o):o=n[5],o}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(A.init,n),i;t[1]!==r||t[2]!==e?(i=async()=>{let t=K(e);return t===null?s(h(new j({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 a=i,o;return t[4]!==a||t[5]!==e?(o={kind:`init`,label:`Initializing repository`,scope:e,action:a},t[4]=a,t[5]=e,t[6]=o):o=t[6],G(o)}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(A.pull,n),i;t[1]!==e.cwd||t[2]!==e.environmentId?(i=e.environmentId!==null&&e.cwd!==null?A.status({environmentId:e.environmentId,input:{cwd:e.cwd}}):null,t[1]=e.cwd,t[2]=e.environmentId,t[3]=i):i=t[3];let a=D(i),o;t[4]!==r||t[5]!==e?(o=async()=>{let t=K(e);return t===null?s(h(new j({operation:`pull`,environmentId:e.environmentId,cwd:e.cwd}))):r({environmentId:t.environmentId,input:{cwd:t.cwd}})},t[4]=r,t[5]=e,t[6]=o):o=t[6];let c=o,l;return t[7]!==c||t[8]!==e||t[9]!==a.refresh?(l={kind:`pull`,label:`Pulling latest changes...`,scope:e,action:c,onSuccess:a.refresh},t[7]=c,t[8]=e,t[9]=a.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=k.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),a;t[3]!==e.cwd||t[4]!==e.environmentId?(a=e.environmentId!==null&&e.cwd!==null?A.status({environmentId:e.environmentId,input:{cwd:e.cwd}}):null,t[3]=e.cwd,t[4]=e.environmentId,t[5]=a):a=t[5];let o=D(a),c;t[6]!==i||t[7]!==e?(c=async t=>K(e)===null?s(h(new j({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]!==o.refresh?(u={kind:`runStackedAction`,label:`Running source control action`,scope:e,action:l,onSuccess:o.refresh,managedExternally:!0},t[9]=l,t[10]=e,t[11]=o.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(re.publishRepository,n),i;t[1]!==e.cwd||t[2]!==e.environmentId?(i=e.environmentId!==null&&e.cwd!==null?A.status({environmentId:e.environmentId,input:{cwd:e.cwd}}):null,t[1]=e.cwd,t[2]=e.environmentId,t[3]=i):i=t[3];let a=D(i),o;t[4]!==r||t[5]!==e?(o=async t=>{let n=K(e);return n===null?s(h(new j({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]=o):o=t[6];let c=o,l;return t[7]!==c||t[8]!==e||t[9]!==a.refresh?(l={kind:`publishRepository`,label:`Publishing repository`,scope:e,action:c,onSuccess:a.refresh},t[7]=c,t[8]=e,t[9]=a.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?s(h(new j({operation:`prepare_pull_request_thread`,environmentId:e.environmentId,cwd:e.cwd}))):t.mode===`worktree`&&t.threadId!==void 0&&!E(n.environmentId,`orchestration:operate`)?s(h(new u({requiredScope:f,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 a=i,o;return t[4]!==a||t[5]!==e?(o={kind:`preparePullRequestThread`,label:`Preparing pull request thread`,scope:e,action:a},t[4]=a,t[5]=e,t[6]=o):o=t[6],G(o)}function X(e){return e.environmentId===null||e.cwd===null||e.reference===null?null:m(c(o.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=w(e,r),a=T(de),o=T(I),s=S(),c=te(),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(F(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(M.runAction,{reportFailure:!1}),a=(0,B.useRef)(new Set),[o,s]=(0,B.useState)(()=>new Set),c=t===null?null:JSON.stringify([e,t.host??null,t.repository,t.number]);return{actionPending:c!==null&&o.has(c),perform:async(o,l)=>{if(!(c===null||t===null||a.current.has(c))){a.current.add(c),s(new Set(a.current));try{let a=await i({environmentId:e,input:{...t,action:o,...l?{mergeMethod:l}:r?{resolveMergeMethod:r}:{}}});if(a._tag===`Failure`)throw g(a);C.add({type:`success`,title:fe[o]}),n?.(o)}catch(e){C.add({type:`error`,title:pe[o],description:P(e,Z[o])})}finally{a.current.delete(c),s(new Set(a.current))}}}}}function Q(e){let t=O(M.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 g(n);o++,e(r)}catch(e){s.push(`#${r.number}: ${P(e,Z.close)}`)}finally{n.current.delete(N(r)),i(new Set(n.current))}})),C.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}}function $(e,t){let n=r.getState(),i=n.getComposerDraft(e),a=ie({prompt:i?.prompt??``,reviewComments:i?.reviewComments??[]},t);n.setPrompt(e,a.prompt),n.setReviewComments(e,a.reviewComments)}function he(e){let t=(0,V.c)(21),{environmentId:n,detail:r}=e,i=ae(),o=r?.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,u]=(0,B.useState)(null),d;t[3]===i?d=t[4]:(d=async(e,t,n)=>{let r=n??await i(e).then(xe,be);return r===null?null:(t===null||$(r.draftId,t),r)},t[3]=i,t[4]=d);let f=d,p;t[5]!==r||t[6]!==n||t[7]!==l||t[8]!==f?(p=async(e,t)=>{if(!r||l!==null)return;u(e);let i=a(n,r.projectId),o=await f(i,t);u(null),o===null?C.add({type:`error`,title:`Could not open a thread`,description:`Try again from the project, or open a thread first.`}):C.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]=r,t[6]=n,t[7]=l,t[8]=f,t[9]=p):p=t[9];let m=p,h;t[10]!==r||t[11]!==n||t[12]!==l||t[13]!==i||t[14]!==f||t[15]!==c?(h=async(e,t,o)=>{let s=o===void 0?`worktree`:o;if(!r||l!==null)return;u(e);let d=C.add({type:`loading`,title:`Preparing the pull request checkout...`}),p=a(n,r.projectId),m=await i(p).then(ye,ve);if(m===null){u(null),C.update(d,{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:r.url,mode:s,threadId:m.threadId});if(h._tag===`Failure`){u(null);let e=c.error instanceof Error?c.error.message:null;C.update(d,{type:`error`,title:`Could not prepare the pull request checkout`,...e?{description:e}:{}});return}if(!await i(p,{branch:h.value.branch,worktreePath:h.value.worktreePath,envMode:h.value.worktreePath===null?`local`:`worktree`}).then(_e,ge)){u(null),C.update(d,{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}u(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?C.update(d,h.value.isOnPullRequestHead?{type:`success`,title:s===`local`?`Checked out here`:`Checked out`,description:s===`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 f(p,t,m),C.update(d,h.value.isOnPullRequestHead?{type:`success`,title:`Checkout ready`,description:`The task is in the composer — read it over, then send.`}:g))},t[10]=r,t[11]=n,t[12]=l,t[13]=i,t[14]=f,t[15]=c,t[16]=h):h=t[16];let g=h,_;return t[17]!==l||t[18]!==m||t[19]!==g?(_={handoff:l,startAsk:m,startHandoff:g},t[17]=l,t[18]=m,t[19]=g,t[20]=_):_=t[20],_}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{$ as a,Y as c,ce as d,J as f,he as i,le as l,Q as n,X as o,oe as p,ue as r,se as s,me as t,q as u};
3
- //# sourceMappingURL=usePullRequestActions-Bk-wSv5o.js.map
3
+ //# sourceMappingURL=usePullRequestActions-B_Nrg846.js.map
@@ -1,2 +1,2 @@
1
- import{a as e,t}from"./react-BUfh6y28.js";import{Ua as n,Un as r}from"./utils-sVhLpEl6.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-By1bF-jd.js.map
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{Ua as n,Un as r}from"./utils-DFNDxNZi.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-B72Afmil.js.map
@@ -1,2 +1,2 @@
1
- import{n as e}from"./jsx-runtime-DJeoFXNw.js";import{Ft as t,Ut as n,Wt as r}from"./utils-sVhLpEl6.js";import{D as i,i as a}from"./useSettings-DwDYuiOf.js";import{U as o}from"./settingsLayout-DbyBB8ZI.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=n(r(u.providers),c.settings,c.projectId).find(e=>e.instanceId===i),p=t(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-CTzd1AsV.js.map
1
+ import{n as e}from"./jsx-runtime-DJeoFXNw.js";import{Ft as t,Ut as n,Wt as r}from"./utils-DFNDxNZi.js";import{D as i,i as a}from"./useSettings-BWMcQzC-.js";import{U as o}from"./settingsLayout-CzGbLP4v.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=n(r(u.providers),c.settings,c.projectId).find(e=>e.instanceId===i),p=t(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-DVQ42jT4.js.map
@@ -1,3 +1,3 @@
1
- import{a as e,t}from"./react-BUfh6y28.js";import{n}from"./jsx-runtime-DJeoFXNw.js";import{Bs as r,Ds as i,Jo as a,Pc as o,Ts as s,Wo as c,Yo as l,Zo as u,es as d,ls as f,ws as ee,xs as te}from"./utils-sVhLpEl6.js";import{$l as p,An as ne,B as re,Cg as ie,Ch as m,En as ae,Gc as oe,Hi as se,Hl as ce,Ic as le,In as ue,Ln as de,Oh as h,Pn as fe,Sl as pe,Th as g,U as me,Ui as he,Ul as ge,Un as _e,V as ve,Wi as ye,Xc as be,_g as xe,ar as Se,bl as Ce,cl as we,cr as Te,gi as Ee,hl as De,iu as Oe,jl as ke,kc as Ae,kn as je,la as Me,mi as Ne,nl as Pe,ou as Fe,pl as Ie,qc as Le,qd as Re,qn as ze,ru as Be,sr as Ve,su as He,tr as Ue,va as We,vg as _}from"./src-upZEL2qH.js";import{$t as Ge,Ar as Ke,Kr as v,T as qe,Tr as Je,Yt as Ye,Zr as Xe,gi as Ze}from"./runtime-DGtwOpiP.js";import{a as y,t as Qe}from"./relay-Bjm0weca.js";import{f as b,h as x,m as $e,u as et}from"./server-BjY-vKW2.js";import{i as tt,n as nt,s as rt,t as it}from"./session-CkASndp1.js";import{t as at}from"./use-atom-command-Dv8zTjOp.js";import{B as ot,C as st,F as ct,N as lt,O as ut,P as dt,S as ft,V as pt,_ as mt,b as ht,c as gt,i as S,n as C,o as _t,r as vt,y as yt}from"./themePalette-CwTOEe8R.js";var w=e(t(),1),T=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=u(t=>d(n=>{let r=n(e.catalogValueAtom).entries.get(t);if(r===void 0)return null;let i=xe(ee(n(e.stateAtom(t))),()=>Ze);return{entry:r,connection:r.unsupportedReason===void 0?i===Ze&&r.enabled?{phase:`connecting`,error:null,traceId:null}:Ge(i):{phase:`unsupported`,error:r.unsupportedReason,traceId:null},serverConfig:n(e.serverConfigValueAtom(t))}}).pipe(f(`environment-presentation:${t}`))),n=new Map;return{presentationAtom:t,presentationsAtom:d(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(f(`environment-presentations`))}}function St(e,t){return{environmentId:e,environmentLabel:t.entry.target.label,displayUrl:Ye(t.entry)??``,isRelayManaged:Xe(t.entry),isEnabled:t.entry.enabled,connectionState:t.connection.phase,connectionError:t.connection.error,connectionErrorTraceId:t.connection.traceId}}function Ct(e){let t=d(t=>{let n=[...t(e.catalogValueAtom).entries.keys()],r=_(t.self());return r!==null&&r.length===n.length&&n.every((e,t)=>e===r[t])?r:n}),n=d(t=>{let n=[...t(e.catalogValueAtom).entries].map(([e,t])=>({environmentId:e,label:t.target.label})),r=_(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=u(t=>d(n=>{let r=n(e.presentationAtom(t));if(r===null)return null;let i=St(t,r),a=_(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=d(t=>{let n=[];for(let i of t(e.catalogValueAtom).entries.keys()){let e=t(r(i));e!==null&&n.push(e)}let i=_(t.self());return i!==null&&i.length===n.length&&n.every((e,t)=>e===i[t])?i:n}).pipe(f(`environment-connection-summaries`));return{environmentIdsAtom:t,connectedEnvironmentIdsAtom:d(e=>{let n=e(t).filter(t=>e(r(t))?.connectionState===`connected`),i=_(e.self());return i!==null&&i.length===n.length&&n.every((e,t)=>e===i[t])?i:n}),identitiesAtom:n,environmentsAtom:i,machineByIdAtom:d(n=>{let r=new Map(n(t).map(t=>[t,me(n(e.presentationAtom(t))?.serverConfig??null)])),i=_(n.self());return i!==null&&bt(i,r)?i:r}),pullRequestsSupportedAtom:d(n=>n(t).some(t=>n(e.presentationAtom(t))?.serverConfig?.environment.capabilities.pullRequests===!0))}}var E=xt({catalogValueAtom:x.catalogValueAtom,stateAtom:x.stateAtom,serverConfigValueAtom:b.configValueAtom}),D=Ct({catalogValueAtom:x.catalogValueAtom,presentationAtom:E.presentationAtom}),wt=d(null).pipe(f(`web-environment-presentation:empty`));function Tt(e){let t=(0,T.c)(5),n=a(x.catalogValueAtom),r;t[0]===e?r=t[1]:(r=e===null?wt:E.presentationAtom(e),t[0]=e,t[1]=r);let i=a(r),o;return t[2]!==n.isReady||t[3]!==i?(o={isReady:n.isReady,presentation:i},t[2]=n.isReady,t[3]=i,t[4]=o):o=t[4],o}var Et={status:`idle`},O=Et,k=null,A=[],j=0,Dt=new Set;function M(e){O=e;for(let e of Dt)e()}function Ot(e){k?.resolve(e);for(let t of A)t.resolve(e);k=null,A=[]}function kt(){return O}function At(e){return Dt.add(e),()=>{Dt.delete(e)}}function jt(){j+=1;let e=!0;return()=>{e&&(e=!1,j=Math.max(0,j-1),j===0&&(Ot(!1),M(Et)))}}function Mt(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 Nt(){return O.status!==`idle`||k!==null||A.length>0}function Pt(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 Ft(){if(O.status!==`closing`)return;let e=A.shift();e?(k=e,M({status:`confirming`,message:e.message,variant:e.variant})):M(Et)}var It={Ctrl:`⌃`,Alt:`⌥`,Shift:`⇧`,Super:`⌘`,CmdOrCtrl:`⌘`};function Lt(e,t=navigator.platform){let n=e.split(`+`),r=n.pop()??``;return o(t)?`${n.map(e=>It[e]??e).join(``)}${r}`:[...n.map(e=>e===`CmdOrCtrl`?`Ctrl`:e===`Super`?`Meta`:e),r].join(`+`)}var Rt=`http://www.w3.org/2000/svg`,zt={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":[{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`}}],"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-plus":[{tag:`path`,attrs:{d:`M12 10v6`}},{tag:`path`,attrs:{d:`M9 13h6`}},{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`}}],"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`}}],"text-search":[{tag:`path`,attrs:{d:`M21 5H3`}},{tag:`path`,attrs:{d:`M10 12H3`}},{tag:`path`,attrs:{d:`M10 19H3`}},{tag:`circle`,attrs:{cx:`17`,cy:`15`,r:`3`}},{tag:`path`,attrs:{d:`m21 19-1.9-1.9`}}],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 Bt(e,t){let n=zt[e];if(!n||typeof document.createElementNS!=`function`)return null;let r=document.createElementNS(Rt,`svg`);r.setAttribute(`xmlns`,Rt),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(Rt,e.tag);for(let[n,r]of Object.entries(e.attrs))t.setAttribute(n,r);r.appendChild(t)}return r}function Vt(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 Ht(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 Ut(){return N!==null}function Wt(){N?.(),N=null}function Gt(e,t){return new Promise(n=>{let r=document.activeElement;for(;r?.shadowRoot?.activeElement;)r=r.shadowRoot.activeElement;let i=r instanceof HTMLElement?r:null,a=[],s=[],c=!1,l=!1,u=()=>d(null),d=e=>{if(c)return;c=!0,N===u&&(N=null),document.removeEventListener(`keydown`,f),document.removeEventListener(`pointerdown`,ee,!0),document.removeEventListener(`contextmenu`,te,!0);let t=Ht(document.activeElement,a);for(let e of a)e.remove();t&&i?.isConnected&&i.focus({preventScroll:!0}),n(e)},f=e=>{e.key===`Escape`&&(e.preventDefault(),d(null))},ee=e=>{l&&!Ht(e.target,a)&&d(null)},te=e=>{l&&!Ht(e.target,a)&&(e.preventDefault(),d(null))},p=e=>{for(;a.length>e;)s.pop()?.setAttribute(`aria-expanded`,`false`),a.pop()?.remove()},ne=(e,t,n,r,i)=>{p(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`),i=document.createElement(`button`);i.type=`button`;let s=t.disabled===!0;i.disabled=s;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(i.className=s?`${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`,i.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&&(i.style.color=`var(--destructive-foreground)`),s&&(i.style.color=`var(--contrast-muted-foreground)`,i.style.opacity=`0.64`,i.style.pointerEvents=`none`),typeof t.checked==`boolean`){i.setAttribute(`role`,`menuitemradio`),i.setAttribute(`aria-checked`,t.checked?`true`:`false`);let e=t.checked?Bt(`check`,`neutral`):null;if(e)i.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`),i.appendChild(e)}}else if(typeof t.icon==`string`){let e=Bt(t.icon,n?`destructive`:`neutral`);e&&i.appendChild(e)}let f=document.createElement(`span`);if(f.className=`min-w-0 flex-1 truncate`,f.textContent=t.label,i.appendChild(f),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=Lt(t.accelerator),e.setAttribute(`aria-hidden`,`true`),i.setAttribute(`aria-keyshortcuts`,t.accelerator.replace(`CmdOrCtrl`,o(navigator.platform)?`Meta`:`Control`)),i.appendChild(e)}if(e){i.setAttribute(`aria-haspopup`,`menu`),i.setAttribute(`aria-expanded`,`false`);let e=Bt(`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`,i.appendChild(e))}if(!s){let o=!1,s=!1,c=()=>{let e=o||s;i.style.background=e?n?`color-mix(in srgb, var(--destructive) 10%, transparent)`:`var(--accent)`:`transparent`,i.style.color=e?n?`var(--destructive-foreground)`:`var(--contrast-accent-foreground)`:n?`var(--destructive-foreground)`:`var(--contrast-foreground)`};if(i.addEventListener(`mouseenter`,()=>{i.focus({preventScroll:!0}),o=!0,c()}),i.addEventListener(`mouseleave`,()=>{o=!1,c()}),i.addEventListener(`focus`,()=>{s=!0,c()}),i.addEventListener(`blur`,()=>{s=!1,c()}),e){let e=(e=!1)=>{let n=i.getBoundingClientRect(),o=n.right+4,s=n.top;ne(t.children,o,s,r+1,i),i.setAttribute(`aria-expanded`,`true`);let c=a[r+1];if(!c)return;let l=c.getBoundingClientRect();l.right>window.innerWidth&&Vt(c,n.left-l.width-4,n.top),e&&[...c.querySelectorAll(`button`)].find(e=>!e.disabled)?.focus()};i.addEventListener(`mouseenter`,()=>{e()}),i.addEventListener(`click`,t=>{t.preventDefault(),e(!0)})}else i.addEventListener(`mouseenter`,()=>{p(r+1)}),i.addEventListener(`click`,()=>{l&&d(t.id)})}u.appendChild(i)}c.appendChild(u),c.addEventListener(`mouseenter`,()=>{p(r+1)}),document.body.appendChild(c),a[r]=c,s[r]=i,requestAnimationFrame(()=>{Vt(c,t,n)})};document.addEventListener(`keydown`,f),document.addEventListener(`pointerdown`,ee,!0),document.addEventListener(`contextmenu`,te,!0),ne(e,t?.x??0,t?.y??0,0),N&&N(),N=u,requestAnimationFrame(()=>{l=!0})})}var Kt=`p4code:client-settings:v1`;function qt(){return typeof window<`u`}function Jt(){return qt()?s(Kt,ae):null}function Yt(e){qt()&&i(Kt,e,ae)}var Xt;function Zt(){return{dialogs:{pickFolder:async e=>window.desktopBridge?window.desktopBridge.pickFolder(e):null,confirm:async(e,t)=>Mt(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):Gt(e,t),close:async()=>{window.desktopBridge||Wt()}},persistence:{getClientSettings:async()=>window.desktopBridge?window.desktopBridge.getClientSettings():Jt(),setClientSettings:async e=>{if(window.desktopBridge)return window.desktopBridge.setClientSettings(e);Yt(e)}}}}function Qt(){return Zt()}function $t(){if(typeof window<`u`)return Xt||(Xt=Qt(),Xt)}function en(){let e=$t();if(!e)throw Error(`Local API not found`);return e}var P=`p4code:theme`,tn=`(prefers-color-scheme: dark)`,F={theme:`system`,resolvedTheme:`light`,systemDark:!1,followSystem:!0,appearanceMode:`system`,themeHalves:null};function nn(){return I()}function rn(){return typeof window>`u`?{}:an()}function I(){if(typeof window>`u`)return null;try{return ut(window.localStorage.getItem(S))}catch{return null}}function an(){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 on=`theme-color`,sn=`meta[name="${on}"][data-dynamic-theme-color="true"]`,R=class extends be()(`ThemeStorageError`,{operation:le([`read`,`write`]),storageKey:oe,theme:ke(_t),cause:Ae()}){get message(){return`Failed to ${this.operation} theme preference for ${this.storageKey}.`}},cn=pe(R),ln=class extends be()(`DesktopThemeSyncError`,{theme:_t,cause:Ae()}){get message(){return`Failed to sync the ${this.theme} theme to the desktop shell.`}},un=pe(ln),z=[],B=null,dn=!0,fn=null,V=null,H=null;function U(){dn=!0;for(let e of z)e()}function pn(){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(tn).matches}function mn(e){if(typeof window>`u`)return e===`system`;try{let e=window.localStorage.getItem(vt);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 W(e){if(typeof window<`u`)try{let e=window.localStorage.getItem(C);if(hn(e))return e}catch{}return mn(e)?`system`:yt(e)??`light`}function gn(e){if(typeof window<`u`)try{window.localStorage.setItem(C,e)}catch(e){throw new R({operation:`write`,storageKey:C,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&&st(e)?e:F.theme}function vn(e){if(typeof window<`u`)try{window.localStorage.setItem(P,e),H=null}catch(t){throw new R({operation:`write`,storageKey:P,theme:e,cause:t})}}function G(){if(H!==null)return F.theme;try{return _n()}catch(e){let t=cn(e)?e:new R({operation:`read`,storageKey:P,cause:e});return H=t,console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...v(t)}),F.theme}}function yn(){let e=document.querySelector(sn);return e||(e=document.createElement(`meta`),e.name=on,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="${on}"]`);if(a.length===0)yn().setAttribute(`content`,i);else for(let e of a)e.setAttribute(`content`,i)}function K(e,{suppressTransitions:t=!1,preservePreview:n=!0}={}){if(typeof document>`u`||typeof window>`u`||n&&document.documentElement.dataset?.themeId===`__preview`)return;let r=W(e),i=r===`system`,a=i?pn():!1,o=I();if(V?.theme===e&&V.systemDark===a&&V.followSystem===i&&V.appearanceMode===r&&L(V.themeHalves)===L(o)){wn(e,i,r);return}t&&document.documentElement.classList.add(`no-transitions`);let s=dt(e,a,i,r,o);gt(ct(e,o,s),s),document.documentElement.classList.toggle(`dark`,s===`dark`),V={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(lt(t,n,r,i))}catch(e){throw new ln({theme:t,cause:e})}}function wn(e,t,n){if(typeof window>`u`)return;let r=window.desktopBridge,i=I(),a=lt(e,t,n,i);r&&typeof r.setTheme==`function`&&fn!==a&&(fn=a,Cn(r,e,t,n,i).catch(t=>{let n=un(t)?t:new ln({theme:e,cause:t});console.error(n.message,{theme:n.theme,...v(n)}),fn===a&&(fn=null)}))}typeof document<`u`&&typeof window<`u`&&K(G());function Tn(){if(typeof window>`u`)return F;if(!dn&&B)return B;dn=!1;let e=G(),t=W(e),n=t===`system`,r=n?pn():!1,i=I(),a=dt(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=G();W(e)===`system`&&K(e,{suppressTransitions:!0}),U()}function On(e){e.key===P?(H=null,K(G(),{suppressTransitions:!0}),U()):e.key===`p4code:theme-follow-system`||e.key===`p4code:theme-appearance-mode`||e.key===`p4code:theme-halves:v1`?(K(G(),{suppressTransitions:!0}),U()):(e.key===`p4code:themes:v1`||e.key===null)&&(e.key===null&&(H=null),ft(),V=null,K(G(),{suppressTransitions:!0}),U())}var kn=null;function An(e){if(typeof window>`u`)return()=>{};if(z.push(e),!kn){let e=typeof window.matchMedia==`function`?window.matchMedia(tn):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,w.useSyncExternalStore)(An,Tn,En),{theme:t,resolvedTheme:n}=e,r=(0,w.useCallback)(e=>{if(typeof window>`u`)return!1;try{gn(W(G()));let t=window.localStorage.getItem(S);window.localStorage.removeItem(S);try{vn(e)}catch(e){if(t!==null)try{window.localStorage.setItem(S,t)}catch{}throw e}}catch(t){let n=cn(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,...v(n)}),!1}return K(e,{suppressTransitions:!0}),U(),!0},[]),i=(0,w.useCallback)(e=>{if(typeof window>`u`)return!1;try{gn(e)}catch(e){let t=cn(e)?e:new R({operation:`write`,storageKey:C,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...v(t)}),!1}return H=null,K(G(),{suppressTransitions:!0}),U(),!0},[]),a=(0,w.useCallback)(e=>{let n=W(t),r=e?`system`:n===`system`?yt(t)??`light`:n;return i(r)},[i,t]),o=(0,w.useCallback)((e,t)=>{if(typeof window>`u`)return!1;try{let n={...an()};t===null?delete n[e]:n[e]=t,n.light===void 0&&n.dark===void 0?window.localStorage.removeItem(S):window.localStorage.setItem(S,JSON.stringify(n))}catch(e){let t=new R({operation:`write`,storageKey:S,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...v(t)}),!1}return K(G(),{suppressTransitions:!0}),U(),!0},[]),s=(0,w.useCallback)(()=>{if(typeof window>`u`)return!1;try{window.localStorage.removeItem(S)}catch(e){let t=new R({operation:`write`,storageKey:S,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...v(t)}),!1}return K(G(),{suppressTransitions:!0}),U(),!0},[]),c=(0,w.useCallback)(({preservePreview:e=!1}={})=>{typeof window<`u`&&(V=null,K(G(),{suppressTransitions:!0,preservePreview:e}),U())},[]);return(0,w.useEffect)(()=>{K(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=we(Ce(Pe)),Nn=He(e=>{let t=e.replace(/("(?:[^"\\]|\\.)*")|\/\/[^\r\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(Re(e=>e.issue))}),Pn=new p(Nn,Fe());Oe().pipe(Be(Fe({space:2})));var Fn=e=>oe.pipe(Ie(e,Pn)),In={performance:{profile:`performance`,automaticGitFetchInterval:g(15),providerHealthRefreshInterval:m(1),hostPowerMonitorActiveInterval:g(30),hostPowerMonitorIdleInterval:m(2),idleClientTtl:g(45),pauseWhenHostLocked:!0,pauseWhenHostLowPower:!1,pauseWhenClientLowPower:!1,pauseWhenOnBattery:!1},balanced:{profile:`balanced`,automaticGitFetchInterval:je,providerHealthRefreshInterval:ue,hostPowerMonitorActiveInterval:g(30),hostPowerMonitorIdleInterval:m(5),idleClientTtl:g(45),pauseWhenHostLocked:!0,pauseWhenHostLowPower:!0,pauseWhenClientLowPower:!0,pauseWhenOnBattery:!1},"battery-saver":{profile:`battery-saver`,automaticGitFetchInterval:g(0),providerHealthRefreshInterval:m(15),hostPowerMonitorActiveInterval:m(1),hostPowerMonitorIdleInterval:m(10),idleClientTtl:g(45),pauseWhenHostLocked:!0,pauseWhenHostLowPower:!0,pauseWhenClientLowPower:!0,pauseWhenOnBattery:!0}};function q(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 J(e,t){return h(e)===h(t)}function zn(e,t){return J(e.automaticGitFetchInterval,t.automaticGitFetchInterval)&&J(e.providerHealthRefreshInterval,t.providerHealthRefreshInterval)&&J(e.hostPowerMonitorActiveInterval,t.hostPowerMonitorActiveInterval)&&J(e.hostPowerMonitorIdleInterval,t.hostPowerMonitorIdleInterval)&&J(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:{...J(t.automaticGitFetchInterval,i.automaticGitFetchInterval)?{}:{automaticGitFetchInterval:t.automaticGitFetchInterval},...J(t.providerHealthRefreshInterval,i.providerHealthRefreshInterval)?{}:{providerHealthRefreshInterval:t.providerHealthRefreshInterval},...J(t.hostPowerMonitorActiveInterval,i.hostPowerMonitorActiveInterval)?{}:{hostPowerMonitorActiveInterval:t.hostPowerMonitorActiveInterval},...J(t.hostPowerMonitorIdleInterval,i.hostPowerMonitorIdleInterval)?{}:{hostPowerMonitorIdleInterval:t.hostPowerMonitorIdleInterval},...J(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:ne,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`||h(e.automaticGitFetchInterval)!==h(je)||h(e.providerHealthRefreshInterval)!==h(ue);return Rn(n&&i?{schemaVersion:1,profile:h(e.automaticGitFetchInterval)===h(q(r).automaticGitFetchInterval)&&h(e.providerHealthRefreshInterval)===h(q(r).providerHealthRefreshInterval)?r:`custom`,baseProfile:r,overrides:{...h(e.automaticGitFetchInterval)===h(q(r).automaticGitFetchInterval)?{}:{automaticGitFetchInterval:e.automaticGitFetchInterval},...h(e.providerHealthRefreshInterval)===h(q(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(Le({observability:ze.fields.observability}));De(Un);function Wn(e,t){let n=e.providerInstances[t.instanceId];return n===void 0?Ue(t.instanceId):Te(n)}var Gn=[`codex`,`claudeAgent`,`cursor`,`grok`,`muse`,`pi`,`opencode`,`antigravity`].map(e=>se.make(e));function Kn(e,t,n){let i=[...Gn.map(e=>[ye(e),e]),...n?.includeConfiguredInstances===!0?Object.entries(e).flatMap(([e,t])=>Gn.includes(t.driver)?[[he.make(e),t.driver]]:[]):[]].find(([e,n])=>t(e,n));if(i===void 0)return null;let[a,o]=i,s=n?.defaultModelSelection,c=e[a]?.config;return s?.instanceId===a&&r(c?.customModels).some(e=>e.slug===s.model)?s:{instanceId:a,model:Ee[o]??Ne[o]??`gpt-6-luna`}}function qn(e,t,n){let r=e.sourceControlWriterModelSelection;if(!r||!Ve(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&&re(i)&&ve(i)?r:e.textGenerationModelSelection}function Jn(e,t,n){let r=e.reviewGuideModelSelection;if(r&&Ve(e,n,r.instanceId)){let e=t?.find(e=>e.instanceId===r.instanceId);if(t===void 0||e?.enabled===!0&&re(e)&&ve(e))return r}return qn(e,t,n)}new Set(Object.keys(_e.fields));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`,`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=ge(e,[`textGenerationModelSelection`])),t?.threadRestartContinuation===!0?e:ge(e,[`continueThreadsAfterServerUpdate`])}function er(e){return e.connection.phase===`connected`&&e.serverConfig!==null}function tr(e,t){return{...t,environmentId:e,label:t.entry.target.label,displayUrl:Ye(t.entry),relayManaged:Xe(t.entry)}}function nr(){let e=(0,T.c)(7),t=a(x.catalogValueAtom),n=a(x.networkStatusValueAtom),r=a(E.presentationsAtom),i;e[0]===r?i=e[1]:(i=[...r.entries()].map(rr),e[0]=r,e[1]=i);let o=i,s;return e[2]!==t.isReady||e[3]!==o||e[4]!==n||e[5]!==r?(s={isReady:t.isReady,networkStatus:n,environments:o,presentationById:r},e[2]=t.isReady,e[3]=o,e[4]=n,e[5]=r,e[6]=s):s=e[6],s}function rr(e){let[t,n]=e;return tr(t,n)}function ir(){return a($e)}function ar(e){let t=(0,T.c)(3),{presentation:n}=Tt(e),r;return t[0]!==e||t[1]!==n?(r=e===null||n===null?null:tr(e,n),t[0]=e,t[1]=n,t[2]=r):r=t[2],r}function or(){return ar(ir())}function sr(e){let t=(0,T.c)(2),n=rt(e),r;return t[0]===n?r=t[1]:(r=ie(n)?n.value.httpBaseUrl:null,t[0]=n,t[1]=r),r}function cr(){return a(Qe.stateValueAtom)}function lr(){return a(D.environmentIdsAtom)}function ur(){return a(D.identitiesAtom)}function dr(){return a(D.pullRequestsSupportedAtom)}function fr(){return a(D.machineByIdAtom)}var pr=`[CLIENT_SETTINGS]`,mr=new Set,hr=new Set,gr=fe,Y=`pending`,X=null,_r=0,vr=Promise.resolve(),yr=0;function br(){for(let e of mr)e()}function xr(){for(let e of hr)e()}function Z(){return gr}function Sr(e){gr=e,br()}function Cr(e){Y!==e&&(Y=e,xr())}function wr(e){return mr.add(e),Q().catch(()=>void 0),()=>{mr.delete(e)}}function Tr(){return Y===`ready`}function Er(){return Y}function Dr(e){return hr.add(e),Q().catch(()=>void 0),()=>{hr.delete(e)}}async function Q(){if(Y===`ready`)return;if(X)return X;let e=_r;Cr(Y===`failed`||Y===`retrying`?`retrying`:`pending`);let t=(async()=>{try{let t=await en().persistence.getClientSettings();if(e!==_r)return;t&&Sr({...fe,...t}),Cr(`ready`)}catch(t){throw e===_r&&Cr(`failed`),console.error(`${pr} hydrate failed`,{operation:`hydrate`,...v(t)}),t}})().finally(()=>{X===t&&(X=null)});return X=t,X}var Or=e=>en().persistence.setClientSettings(e);function kr(e){let t=vr.then(e);return vr=t.then(()=>void 0,()=>void 0),t}function Ar(e,t=Or){let n=Y!==`ready`||yr>0;return n?yr+=1:Sr({...Z(),...e}),kr(async()=>{if(n)try{Y!==`ready`&&await Q(),Sr({...Z(),...e})}finally{--yr}await t(Z())}).catch(e=>{console.error(`${pr} persist failed`,{operation:`persist`,...v(e)})})}async function jr(e,t=Or){return kr(async()=>{for(Y!==`ready`&&await Q();;){let n=Z(),r=e(n);if(await t(r),Z()===n)return Sr(r),r}})}var Mr=new Set(ce(ze.fields));function Nr(e){let t={},n={};for(let[r,i]of Object.entries(e))Mr.has(r)?t[r]=i:n[r]=i;return{serverPatch:t,clientPatch:n}}function Pr(){return Z()}function Fr(){return Q()}function Ir(){return(0,w.useSyncExternalStore)(Dr,Tr,Lr)}function Lr(){return!1}function Rr(){return(0,w.useSyncExternalStore)(Dr,Er,zr)}function zr(){return`pending`}function $(){return(0,w.useSyncExternalStore)(wr,Z,Br)}function Br(){return fe}function Vr(e,t){return{...t,...e,...Yn(e,t)}}var Hr=new Set;function Ur(e,t){let n=(0,T.c)(8),r=$(),i=Ir(),a;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={reportFailure:!1},n[0]=a):a=n[0];let o=at(b.updateSettings,a),s,c;n[1]!==r||n[2]!==e||n[3]!==i||n[4]!==o||n[5]!==t?(s=()=>{if(!e||!t||!i||Hr.has(e))return;let n=Xn(t,r);n&&(Hr.add(e),o({environmentId:e,input:{patch:n}}).finally(()=>Hr.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,w.useEffect)(s,c)}function Wr(e,t){let n=(0,T.c)(6),r=$(),i;n[0]!==r||n[1]!==e?(i=Vr(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 Gr(e){let t=(0,T.c)(3),n=$(),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}function Kr(e){return e.settingsHydrated?e.paletteThemeActive&&!e.paletteThemeAllowsArtwork&&e.mode===`artwork`?`pill`:e.mode:`none`}function qr(){let e=(0,T.c)(7),t=Ir(),n=$().environmentIdentificationMode,{resolvedTheme:r,theme:i,themeHalves:a}=jn(),o=(0,w.useSyncExternalStore)(ot,ht,Jr),s;if(e[0]!==n||e[1]!==o||e[2]!==r||e[3]!==t||e[4]!==i||e[5]!==a){let c=ct(i,a,r),l=mt(c);s=Kr({mode:n,settingsHydrated:t,paletteThemeActive:o!==null||l!==null,paletteThemeAllowsArtwork:o??pt(c)}),e[0]=n,e[1]=o,e[2]=r,e[3]=t,e[4]=i,e[5]=a,e[6]=s}else s=e[6];return s}function Jr(){return null}async function Yr(e,t){return(e.favorites===null||e.providerModelPreferences===null)&&await Fr(),{...Xn(e,Pr()),...t}}function Xr(e){let t=(0,T.c)(6),n;t[0]===e?n=t[1]:(n=e?b.settingsValueAtom(e):Qr,t[0]=e,t[1]=n);let r=a(n),i=at(b.updateSettings,`model preferences update`),o;return t[2]!==e||t[3]!==i||t[4]!==r?(o=async t=>{if(!e||!r)return;let n;try{n=await Yr(r,t)}catch{y.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]=o):o=t[5],o}function Zr(e){let t=(0,w.use)(l),n=(0,w.useRef)(new Map),r=Xr(e);return(0,w.useCallback)(async(i,a)=>{if(!e)return;let o=b.settingsValueAtom(e),s=t.get(o);if(!s)return;if(s.favorites===null)try{await Fr()}catch{y.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,Pr()).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&&te(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 Qr=d(null);function $r(e){let t=(0,T.c)(5),n;t[0]===e?n=t[1]:(n=e?b.settingsValueAtom(e):Qr,t[0]=e,t[1]=n);let r=a(n),i=$();Ur(e,r);let o=r??de,s;return t[2]!==i||t[3]!==o?(s=Yn(o,i),t[2]=i,t[3]=o,t[4]=s):s=t[4],s}function ei(e,t){let n=(0,T.c)(2),r;n[0]===e?r=n[1]:(r=b.settingsValueAtom(e),n[0]=e,n[1]=r);let i=a(r);return Ur(e,i),Wr(i??de,t)}function ti(e){let t=(0,T.c)(4),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=at(b.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 ni(e){let t=or(),n=a(et);return Ur(t?.environmentId??null,t?.serverConfig?.settings??null),Wr(n,e)}var ri=`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 ii(){let e=(0,T.c)(2),t=or(),n;return e[0]===t?n=e[1]:(n=t!==null||!qe(),e[0]=t,e[1]=n),n}function ai(e){let t=(0,T.c)(3),n=e!==void 0&&e,{environments:r}=nr(),i;return t[0]!==r||t[1]!==n?(i=d(e=>r.filter(er).flatMap(t=>{let r=e(it.sessionStateAtom(t.environmentId));if(n&&r._tag===`Initial`)return[t.environmentId];let i=r._tag===`Failure`?null:_(ee(r));return i!==null&&We(i,`settings:write`)?[t.environmentId]:[]})),t[0]=r,t[1]=n,t[2]=i):i=t[2],a(i)}function oi(e){let t=(0,T.c)(10);tt(e,Me);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=at(b.updateSettings,n),{environments:i}=nr(),a;t[1]!==i||t[2]!==r?(a=async(e,t)=>{let n=await r(e);if(n._tag===`Failure`&&t?.(),n._tag===`Failure`&&!Je(n)){let t=i.find(t=>t.environmentId===e.environmentId)?.label??e.environmentId,r=Ke(n);y.add({type:`error`,title:`Setting not saved`,description:`Could not save on ${t}: ${r instanceof Error?r.message:`The save failed. Try reconnecting and saving again.`}`})}return n},t[1]=i,t[2]=r,t[3]=a):a=t[3];let o=a,s=ai(!0),l;return t[4]!==e||t[5]!==i||t[6]!==r||t[7]!==o||t[8]!==s?(l=(t,n)=>{let{serverPatch:a,clientPatch:l}=Nr(t),u=e===null||Se(a).every(t=>nt(e,t));if(Object.keys(a).length>0&&!u&&(n?.onFailed?.(),y.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(a).length>0&&u){let{sharedPatch:t,localPatch:l}=Qn(a),u=e=>{let t=e===void 0?ri:e;return n?.onFailed?.(),y.add({type:`warning`,title:`Setting not saved`,description:t})};if(Object.keys(l).length>0&&(e?o({environmentId:e,input:{patch:l}},n?.onFailed):u()),Object.keys(t).length>0){let a=i.find(t=>t.environmentId===e)?.serverConfig?.settings,o=new Set(s);e&&o.add(e);let l=[],d=[];for(let n of o){let r=i.find(e=>e.environmentId===n),o=$n(t,r?.serverConfig?.environment.capabilities,r?.serverConfig?.settings,a,n===e);Object.keys(o).length!==0&&(c.get(it.sessionStateAtom(n))._tag!==`Initial`&&!Se(t).every(e=>nt(n,e))?d.push(r?.label??n):l.push({environmentId:n,input:{patch:o}}))}l.length===0?u(d.length>0?`This connection lacks permission to change settings on ${d.join(`, `)}.`:o.size>0?`Update older servers to save this setting.`:void 0):Promise.all(l.map(async e=>({label:i.find(t=>t.environmentId===e.environmentId)?.label??e.environmentId,result:await r(e)}))).then(e=>{(d.length>0||e.some(ui))&&n?.onFailed?.();let t=e.flatMap(li);if(t.length===0)return;let r=e.filter(ci).map(si);y.add({type:`error`,title:r.length>0?`Setting saved on some environments`:`Setting not saved`,description:[...t,...r.length>0?[`Saved on ${r.join(`, `)}.`]:[]].join(`
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{n}from"./jsx-runtime-DJeoFXNw.js";import{Bs as r,Ds as i,Jo as a,Pc as o,Ts as s,Wo as c,Yo as l,Zo as u,es as d,ls as f,ws as ee,xs as te}from"./utils-DFNDxNZi.js";import{$l as p,An as ne,B as re,Cg as ie,Ch as m,En as ae,Gc as oe,Hi as se,Hl as ce,Ic as le,In as ue,Ln as de,Oh as h,Pn as fe,Sl as pe,Th as g,U as me,Ui as he,Ul as ge,Un as _e,V as ve,Wi as ye,Xc as be,_g as xe,ar as Se,bl as Ce,cl as we,cr as Te,gi as Ee,hl as De,iu as Oe,jl as ke,kc as Ae,kn as je,la as Me,mi as Ne,nl as Pe,ou as Fe,pl as Ie,qc as Le,qd as Re,qn as ze,ru as Be,sr as Ve,su as He,tr as Ue,va as We,vg as _}from"./src-BVovWpja.js";import{$t as Ge,Ar as Ke,Kr as v,T as qe,Tr as Je,Yt as Ye,Zr as Xe,gi as Ze}from"./runtime-DIAcbMTc.js";import{a as y,t as Qe}from"./relay-YiJpGyaO.js";import{f as b,h as x,m as $e,u as et}from"./server-BNjk2K1j.js";import{i as tt,n as nt,s as rt,t as it}from"./session-DMNo4Bh3.js";import{t as at}from"./use-atom-command-C4Tyb1VL.js";import{B as ot,C as st,F as ct,N as lt,O as ut,P as dt,S as ft,V as pt,_ as mt,b as ht,c as gt,i as S,n as C,o as _t,r as vt,y as yt}from"./themePalette-C7ZOgucT.js";var w=e(t(),1),T=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=u(t=>d(n=>{let r=n(e.catalogValueAtom).entries.get(t);if(r===void 0)return null;let i=xe(ee(n(e.stateAtom(t))),()=>Ze);return{entry:r,connection:r.unsupportedReason===void 0?i===Ze&&r.enabled?{phase:`connecting`,error:null,traceId:null}:Ge(i):{phase:`unsupported`,error:r.unsupportedReason,traceId:null},serverConfig:n(e.serverConfigValueAtom(t))}}).pipe(f(`environment-presentation:${t}`))),n=new Map;return{presentationAtom:t,presentationsAtom:d(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(f(`environment-presentations`))}}function St(e,t){return{environmentId:e,environmentLabel:t.entry.target.label,displayUrl:Ye(t.entry)??``,isRelayManaged:Xe(t.entry),isEnabled:t.entry.enabled,connectionState:t.connection.phase,connectionError:t.connection.error,connectionErrorTraceId:t.connection.traceId}}function Ct(e){let t=d(t=>{let n=[...t(e.catalogValueAtom).entries.keys()],r=_(t.self());return r!==null&&r.length===n.length&&n.every((e,t)=>e===r[t])?r:n}),n=d(t=>{let n=[...t(e.catalogValueAtom).entries].map(([e,t])=>({environmentId:e,label:t.target.label})),r=_(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=u(t=>d(n=>{let r=n(e.presentationAtom(t));if(r===null)return null;let i=St(t,r),a=_(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=d(t=>{let n=[];for(let i of t(e.catalogValueAtom).entries.keys()){let e=t(r(i));e!==null&&n.push(e)}let i=_(t.self());return i!==null&&i.length===n.length&&n.every((e,t)=>e===i[t])?i:n}).pipe(f(`environment-connection-summaries`));return{environmentIdsAtom:t,connectedEnvironmentIdsAtom:d(e=>{let n=e(t).filter(t=>e(r(t))?.connectionState===`connected`),i=_(e.self());return i!==null&&i.length===n.length&&n.every((e,t)=>e===i[t])?i:n}),identitiesAtom:n,environmentsAtom:i,machineByIdAtom:d(n=>{let r=new Map(n(t).map(t=>[t,me(n(e.presentationAtom(t))?.serverConfig??null)])),i=_(n.self());return i!==null&&bt(i,r)?i:r}),pullRequestsSupportedAtom:d(n=>n(t).some(t=>n(e.presentationAtom(t))?.serverConfig?.environment.capabilities.pullRequests===!0))}}var E=xt({catalogValueAtom:x.catalogValueAtom,stateAtom:x.stateAtom,serverConfigValueAtom:b.configValueAtom}),D=Ct({catalogValueAtom:x.catalogValueAtom,presentationAtom:E.presentationAtom}),wt=d(null).pipe(f(`web-environment-presentation:empty`));function Tt(e){let t=(0,T.c)(5),n=a(x.catalogValueAtom),r;t[0]===e?r=t[1]:(r=e===null?wt:E.presentationAtom(e),t[0]=e,t[1]=r);let i=a(r),o;return t[2]!==n.isReady||t[3]!==i?(o={isReady:n.isReady,presentation:i},t[2]=n.isReady,t[3]=i,t[4]=o):o=t[4],o}var Et={status:`idle`},O=Et,k=null,A=[],j=0,Dt=new Set;function M(e){O=e;for(let e of Dt)e()}function Ot(e){k?.resolve(e);for(let t of A)t.resolve(e);k=null,A=[]}function kt(){return O}function At(e){return Dt.add(e),()=>{Dt.delete(e)}}function jt(){j+=1;let e=!0;return()=>{e&&(e=!1,j=Math.max(0,j-1),j===0&&(Ot(!1),M(Et)))}}function Mt(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 Nt(){return O.status!==`idle`||k!==null||A.length>0}function Pt(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 Ft(){if(O.status!==`closing`)return;let e=A.shift();e?(k=e,M({status:`confirming`,message:e.message,variant:e.variant})):M(Et)}var It={Ctrl:`⌃`,Alt:`⌥`,Shift:`⇧`,Super:`⌘`,CmdOrCtrl:`⌘`};function Lt(e,t=navigator.platform){let n=e.split(`+`),r=n.pop()??``;return o(t)?`${n.map(e=>It[e]??e).join(``)}${r}`:[...n.map(e=>e===`CmdOrCtrl`?`Ctrl`:e===`Super`?`Meta`:e),r].join(`+`)}var Rt=`http://www.w3.org/2000/svg`,zt={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":[{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`}}],"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-plus":[{tag:`path`,attrs:{d:`M12 10v6`}},{tag:`path`,attrs:{d:`M9 13h6`}},{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`}}],"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`}}],"text-search":[{tag:`path`,attrs:{d:`M21 5H3`}},{tag:`path`,attrs:{d:`M10 12H3`}},{tag:`path`,attrs:{d:`M10 19H3`}},{tag:`circle`,attrs:{cx:`17`,cy:`15`,r:`3`}},{tag:`path`,attrs:{d:`m21 19-1.9-1.9`}}],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 Bt(e,t){let n=zt[e];if(!n||typeof document.createElementNS!=`function`)return null;let r=document.createElementNS(Rt,`svg`);r.setAttribute(`xmlns`,Rt),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(Rt,e.tag);for(let[n,r]of Object.entries(e.attrs))t.setAttribute(n,r);r.appendChild(t)}return r}function Vt(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 Ht(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 Ut(){return N!==null}function Wt(){N?.(),N=null}function Gt(e,t){return new Promise(n=>{let r=document.activeElement;for(;r?.shadowRoot?.activeElement;)r=r.shadowRoot.activeElement;let i=r instanceof HTMLElement?r:null,a=[],s=[],c=!1,l=!1,u=()=>d(null),d=e=>{if(c)return;c=!0,N===u&&(N=null),document.removeEventListener(`keydown`,f),document.removeEventListener(`pointerdown`,ee,!0),document.removeEventListener(`contextmenu`,te,!0);let t=Ht(document.activeElement,a);for(let e of a)e.remove();t&&i?.isConnected&&i.focus({preventScroll:!0}),n(e)},f=e=>{e.key===`Escape`&&(e.preventDefault(),d(null))},ee=e=>{l&&!Ht(e.target,a)&&d(null)},te=e=>{l&&!Ht(e.target,a)&&(e.preventDefault(),d(null))},p=e=>{for(;a.length>e;)s.pop()?.setAttribute(`aria-expanded`,`false`),a.pop()?.remove()},ne=(e,t,n,r,i)=>{p(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`),i=document.createElement(`button`);i.type=`button`;let s=t.disabled===!0;i.disabled=s;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(i.className=s?`${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`,i.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&&(i.style.color=`var(--destructive-foreground)`),s&&(i.style.color=`var(--contrast-muted-foreground)`,i.style.opacity=`0.64`,i.style.pointerEvents=`none`),typeof t.checked==`boolean`){i.setAttribute(`role`,`menuitemradio`),i.setAttribute(`aria-checked`,t.checked?`true`:`false`);let e=t.checked?Bt(`check`,`neutral`):null;if(e)i.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`),i.appendChild(e)}}else if(typeof t.icon==`string`){let e=Bt(t.icon,n?`destructive`:`neutral`);e&&i.appendChild(e)}let f=document.createElement(`span`);if(f.className=`min-w-0 flex-1 truncate`,f.textContent=t.label,i.appendChild(f),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=Lt(t.accelerator),e.setAttribute(`aria-hidden`,`true`),i.setAttribute(`aria-keyshortcuts`,t.accelerator.replace(`CmdOrCtrl`,o(navigator.platform)?`Meta`:`Control`)),i.appendChild(e)}if(e){i.setAttribute(`aria-haspopup`,`menu`),i.setAttribute(`aria-expanded`,`false`);let e=Bt(`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`,i.appendChild(e))}if(!s){let o=!1,s=!1,c=()=>{let e=o||s;i.style.background=e?n?`color-mix(in srgb, var(--destructive) 10%, transparent)`:`var(--accent)`:`transparent`,i.style.color=e?n?`var(--destructive-foreground)`:`var(--contrast-accent-foreground)`:n?`var(--destructive-foreground)`:`var(--contrast-foreground)`};if(i.addEventListener(`mouseenter`,()=>{i.focus({preventScroll:!0}),o=!0,c()}),i.addEventListener(`mouseleave`,()=>{o=!1,c()}),i.addEventListener(`focus`,()=>{s=!0,c()}),i.addEventListener(`blur`,()=>{s=!1,c()}),e){let e=(e=!1)=>{let n=i.getBoundingClientRect(),o=n.right+4,s=n.top;ne(t.children,o,s,r+1,i),i.setAttribute(`aria-expanded`,`true`);let c=a[r+1];if(!c)return;let l=c.getBoundingClientRect();l.right>window.innerWidth&&Vt(c,n.left-l.width-4,n.top),e&&[...c.querySelectorAll(`button`)].find(e=>!e.disabled)?.focus()};i.addEventListener(`mouseenter`,()=>{e()}),i.addEventListener(`click`,t=>{t.preventDefault(),e(!0)})}else i.addEventListener(`mouseenter`,()=>{p(r+1)}),i.addEventListener(`click`,()=>{l&&d(t.id)})}u.appendChild(i)}c.appendChild(u),c.addEventListener(`mouseenter`,()=>{p(r+1)}),document.body.appendChild(c),a[r]=c,s[r]=i,requestAnimationFrame(()=>{Vt(c,t,n)})};document.addEventListener(`keydown`,f),document.addEventListener(`pointerdown`,ee,!0),document.addEventListener(`contextmenu`,te,!0),ne(e,t?.x??0,t?.y??0,0),N&&N(),N=u,requestAnimationFrame(()=>{l=!0})})}var Kt=`p4code:client-settings:v1`;function qt(){return typeof window<`u`}function Jt(){return qt()?s(Kt,ae):null}function Yt(e){qt()&&i(Kt,e,ae)}var Xt;function Zt(){return{dialogs:{pickFolder:async e=>window.desktopBridge?window.desktopBridge.pickFolder(e):null,confirm:async(e,t)=>Mt(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):Gt(e,t),close:async()=>{window.desktopBridge||Wt()}},persistence:{getClientSettings:async()=>window.desktopBridge?window.desktopBridge.getClientSettings():Jt(),setClientSettings:async e=>{if(window.desktopBridge)return window.desktopBridge.setClientSettings(e);Yt(e)}}}}function Qt(){return Zt()}function $t(){if(typeof window<`u`)return Xt||(Xt=Qt(),Xt)}function en(){let e=$t();if(!e)throw Error(`Local API not found`);return e}var P=`p4code:theme`,tn=`(prefers-color-scheme: dark)`,F={theme:`system`,resolvedTheme:`light`,systemDark:!1,followSystem:!0,appearanceMode:`system`,themeHalves:null};function nn(){return I()}function rn(){return typeof window>`u`?{}:an()}function I(){if(typeof window>`u`)return null;try{return ut(window.localStorage.getItem(S))}catch{return null}}function an(){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 on=`theme-color`,sn=`meta[name="${on}"][data-dynamic-theme-color="true"]`,R=class extends be()(`ThemeStorageError`,{operation:le([`read`,`write`]),storageKey:oe,theme:ke(_t),cause:Ae()}){get message(){return`Failed to ${this.operation} theme preference for ${this.storageKey}.`}},cn=pe(R),ln=class extends be()(`DesktopThemeSyncError`,{theme:_t,cause:Ae()}){get message(){return`Failed to sync the ${this.theme} theme to the desktop shell.`}},un=pe(ln),z=[],B=null,dn=!0,fn=null,V=null,H=null;function U(){dn=!0;for(let e of z)e()}function pn(){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(tn).matches}function mn(e){if(typeof window>`u`)return e===`system`;try{let e=window.localStorage.getItem(vt);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 W(e){if(typeof window<`u`)try{let e=window.localStorage.getItem(C);if(hn(e))return e}catch{}return mn(e)?`system`:yt(e)??`light`}function gn(e){if(typeof window<`u`)try{window.localStorage.setItem(C,e)}catch(e){throw new R({operation:`write`,storageKey:C,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&&st(e)?e:F.theme}function vn(e){if(typeof window<`u`)try{window.localStorage.setItem(P,e),H=null}catch(t){throw new R({operation:`write`,storageKey:P,theme:e,cause:t})}}function G(){if(H!==null)return F.theme;try{return _n()}catch(e){let t=cn(e)?e:new R({operation:`read`,storageKey:P,cause:e});return H=t,console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...v(t)}),F.theme}}function yn(){let e=document.querySelector(sn);return e||(e=document.createElement(`meta`),e.name=on,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="${on}"]`);if(a.length===0)yn().setAttribute(`content`,i);else for(let e of a)e.setAttribute(`content`,i)}function K(e,{suppressTransitions:t=!1,preservePreview:n=!0}={}){if(typeof document>`u`||typeof window>`u`||n&&document.documentElement.dataset?.themeId===`__preview`)return;let r=W(e),i=r===`system`,a=i?pn():!1,o=I();if(V?.theme===e&&V.systemDark===a&&V.followSystem===i&&V.appearanceMode===r&&L(V.themeHalves)===L(o)){wn(e,i,r);return}t&&document.documentElement.classList.add(`no-transitions`);let s=dt(e,a,i,r,o);gt(ct(e,o,s),s),document.documentElement.classList.toggle(`dark`,s===`dark`),V={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(lt(t,n,r,i))}catch(e){throw new ln({theme:t,cause:e})}}function wn(e,t,n){if(typeof window>`u`)return;let r=window.desktopBridge,i=I(),a=lt(e,t,n,i);r&&typeof r.setTheme==`function`&&fn!==a&&(fn=a,Cn(r,e,t,n,i).catch(t=>{let n=un(t)?t:new ln({theme:e,cause:t});console.error(n.message,{theme:n.theme,...v(n)}),fn===a&&(fn=null)}))}typeof document<`u`&&typeof window<`u`&&K(G());function Tn(){if(typeof window>`u`)return F;if(!dn&&B)return B;dn=!1;let e=G(),t=W(e),n=t===`system`,r=n?pn():!1,i=I(),a=dt(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=G();W(e)===`system`&&K(e,{suppressTransitions:!0}),U()}function On(e){e.key===P?(H=null,K(G(),{suppressTransitions:!0}),U()):e.key===`p4code:theme-follow-system`||e.key===`p4code:theme-appearance-mode`||e.key===`p4code:theme-halves:v1`?(K(G(),{suppressTransitions:!0}),U()):(e.key===`p4code:themes:v1`||e.key===null)&&(e.key===null&&(H=null),ft(),V=null,K(G(),{suppressTransitions:!0}),U())}var kn=null;function An(e){if(typeof window>`u`)return()=>{};if(z.push(e),!kn){let e=typeof window.matchMedia==`function`?window.matchMedia(tn):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,w.useSyncExternalStore)(An,Tn,En),{theme:t,resolvedTheme:n}=e,r=(0,w.useCallback)(e=>{if(typeof window>`u`)return!1;try{gn(W(G()));let t=window.localStorage.getItem(S);window.localStorage.removeItem(S);try{vn(e)}catch(e){if(t!==null)try{window.localStorage.setItem(S,t)}catch{}throw e}}catch(t){let n=cn(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,...v(n)}),!1}return K(e,{suppressTransitions:!0}),U(),!0},[]),i=(0,w.useCallback)(e=>{if(typeof window>`u`)return!1;try{gn(e)}catch(e){let t=cn(e)?e:new R({operation:`write`,storageKey:C,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...v(t)}),!1}return H=null,K(G(),{suppressTransitions:!0}),U(),!0},[]),a=(0,w.useCallback)(e=>{let n=W(t),r=e?`system`:n===`system`?yt(t)??`light`:n;return i(r)},[i,t]),o=(0,w.useCallback)((e,t)=>{if(typeof window>`u`)return!1;try{let n={...an()};t===null?delete n[e]:n[e]=t,n.light===void 0&&n.dark===void 0?window.localStorage.removeItem(S):window.localStorage.setItem(S,JSON.stringify(n))}catch(e){let t=new R({operation:`write`,storageKey:S,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...v(t)}),!1}return K(G(),{suppressTransitions:!0}),U(),!0},[]),s=(0,w.useCallback)(()=>{if(typeof window>`u`)return!1;try{window.localStorage.removeItem(S)}catch(e){let t=new R({operation:`write`,storageKey:S,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...v(t)}),!1}return K(G(),{suppressTransitions:!0}),U(),!0},[]),c=(0,w.useCallback)(({preservePreview:e=!1}={})=>{typeof window<`u`&&(V=null,K(G(),{suppressTransitions:!0,preservePreview:e}),U())},[]);return(0,w.useEffect)(()=>{K(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=we(Ce(Pe)),Nn=He(e=>{let t=e.replace(/("(?:[^"\\]|\\.)*")|\/\/[^\r\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(Re(e=>e.issue))}),Pn=new p(Nn,Fe());Oe().pipe(Be(Fe({space:2})));var Fn=e=>oe.pipe(Ie(e,Pn)),In={performance:{profile:`performance`,automaticGitFetchInterval:g(15),providerHealthRefreshInterval:m(1),hostPowerMonitorActiveInterval:g(30),hostPowerMonitorIdleInterval:m(2),idleClientTtl:g(45),pauseWhenHostLocked:!0,pauseWhenHostLowPower:!1,pauseWhenClientLowPower:!1,pauseWhenOnBattery:!1},balanced:{profile:`balanced`,automaticGitFetchInterval:je,providerHealthRefreshInterval:ue,hostPowerMonitorActiveInterval:g(30),hostPowerMonitorIdleInterval:m(5),idleClientTtl:g(45),pauseWhenHostLocked:!0,pauseWhenHostLowPower:!0,pauseWhenClientLowPower:!0,pauseWhenOnBattery:!1},"battery-saver":{profile:`battery-saver`,automaticGitFetchInterval:g(0),providerHealthRefreshInterval:m(15),hostPowerMonitorActiveInterval:m(1),hostPowerMonitorIdleInterval:m(10),idleClientTtl:g(45),pauseWhenHostLocked:!0,pauseWhenHostLowPower:!0,pauseWhenClientLowPower:!0,pauseWhenOnBattery:!0}};function q(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 J(e,t){return h(e)===h(t)}function zn(e,t){return J(e.automaticGitFetchInterval,t.automaticGitFetchInterval)&&J(e.providerHealthRefreshInterval,t.providerHealthRefreshInterval)&&J(e.hostPowerMonitorActiveInterval,t.hostPowerMonitorActiveInterval)&&J(e.hostPowerMonitorIdleInterval,t.hostPowerMonitorIdleInterval)&&J(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:{...J(t.automaticGitFetchInterval,i.automaticGitFetchInterval)?{}:{automaticGitFetchInterval:t.automaticGitFetchInterval},...J(t.providerHealthRefreshInterval,i.providerHealthRefreshInterval)?{}:{providerHealthRefreshInterval:t.providerHealthRefreshInterval},...J(t.hostPowerMonitorActiveInterval,i.hostPowerMonitorActiveInterval)?{}:{hostPowerMonitorActiveInterval:t.hostPowerMonitorActiveInterval},...J(t.hostPowerMonitorIdleInterval,i.hostPowerMonitorIdleInterval)?{}:{hostPowerMonitorIdleInterval:t.hostPowerMonitorIdleInterval},...J(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:ne,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`||h(e.automaticGitFetchInterval)!==h(je)||h(e.providerHealthRefreshInterval)!==h(ue);return Rn(n&&i?{schemaVersion:1,profile:h(e.automaticGitFetchInterval)===h(q(r).automaticGitFetchInterval)&&h(e.providerHealthRefreshInterval)===h(q(r).providerHealthRefreshInterval)?r:`custom`,baseProfile:r,overrides:{...h(e.automaticGitFetchInterval)===h(q(r).automaticGitFetchInterval)?{}:{automaticGitFetchInterval:e.automaticGitFetchInterval},...h(e.providerHealthRefreshInterval)===h(q(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(Le({observability:ze.fields.observability}));De(Un);function Wn(e,t){let n=e.providerInstances[t.instanceId];return n===void 0?Ue(t.instanceId):Te(n)}var Gn=[`codex`,`claudeAgent`,`cursor`,`grok`,`muse`,`pi`,`opencode`,`antigravity`].map(e=>se.make(e));function Kn(e,t,n){let i=[...Gn.map(e=>[ye(e),e]),...n?.includeConfiguredInstances===!0?Object.entries(e).flatMap(([e,t])=>Gn.includes(t.driver)?[[he.make(e),t.driver]]:[]):[]].find(([e,n])=>t(e,n));if(i===void 0)return null;let[a,o]=i,s=n?.defaultModelSelection,c=e[a]?.config;return s?.instanceId===a&&r(c?.customModels).some(e=>e.slug===s.model)?s:{instanceId:a,model:Ee[o]??Ne[o]??`gpt-6-luna`}}function qn(e,t,n){let r=e.sourceControlWriterModelSelection;if(!r||!Ve(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&&re(i)&&ve(i)?r:e.textGenerationModelSelection}function Jn(e,t,n){let r=e.reviewGuideModelSelection;if(r&&Ve(e,n,r.instanceId)){let e=t?.find(e=>e.instanceId===r.instanceId);if(t===void 0||e?.enabled===!0&&re(e)&&ve(e))return r}return qn(e,t,n)}new Set(Object.keys(_e.fields));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`,`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=ge(e,[`textGenerationModelSelection`])),t?.threadRestartContinuation===!0?e:ge(e,[`continueThreadsAfterServerUpdate`])}function er(e){return e.connection.phase===`connected`&&e.serverConfig!==null}function tr(e,t){return{...t,environmentId:e,label:t.entry.target.label,displayUrl:Ye(t.entry),relayManaged:Xe(t.entry)}}function nr(){let e=(0,T.c)(7),t=a(x.catalogValueAtom),n=a(x.networkStatusValueAtom),r=a(E.presentationsAtom),i;e[0]===r?i=e[1]:(i=[...r.entries()].map(rr),e[0]=r,e[1]=i);let o=i,s;return e[2]!==t.isReady||e[3]!==o||e[4]!==n||e[5]!==r?(s={isReady:t.isReady,networkStatus:n,environments:o,presentationById:r},e[2]=t.isReady,e[3]=o,e[4]=n,e[5]=r,e[6]=s):s=e[6],s}function rr(e){let[t,n]=e;return tr(t,n)}function ir(){return a($e)}function ar(e){let t=(0,T.c)(3),{presentation:n}=Tt(e),r;return t[0]!==e||t[1]!==n?(r=e===null||n===null?null:tr(e,n),t[0]=e,t[1]=n,t[2]=r):r=t[2],r}function or(){return ar(ir())}function sr(e){let t=(0,T.c)(2),n=rt(e),r;return t[0]===n?r=t[1]:(r=ie(n)?n.value.httpBaseUrl:null,t[0]=n,t[1]=r),r}function cr(){return a(Qe.stateValueAtom)}function lr(){return a(D.environmentIdsAtom)}function ur(){return a(D.identitiesAtom)}function dr(){return a(D.pullRequestsSupportedAtom)}function fr(){return a(D.machineByIdAtom)}var pr=`[CLIENT_SETTINGS]`,mr=new Set,hr=new Set,gr=fe,Y=`pending`,X=null,_r=0,vr=Promise.resolve(),yr=0;function br(){for(let e of mr)e()}function xr(){for(let e of hr)e()}function Z(){return gr}function Sr(e){gr=e,br()}function Cr(e){Y!==e&&(Y=e,xr())}function wr(e){return mr.add(e),Q().catch(()=>void 0),()=>{mr.delete(e)}}function Tr(){return Y===`ready`}function Er(){return Y}function Dr(e){return hr.add(e),Q().catch(()=>void 0),()=>{hr.delete(e)}}async function Q(){if(Y===`ready`)return;if(X)return X;let e=_r;Cr(Y===`failed`||Y===`retrying`?`retrying`:`pending`);let t=(async()=>{try{let t=await en().persistence.getClientSettings();if(e!==_r)return;t&&Sr({...fe,...t}),Cr(`ready`)}catch(t){throw e===_r&&Cr(`failed`),console.error(`${pr} hydrate failed`,{operation:`hydrate`,...v(t)}),t}})().finally(()=>{X===t&&(X=null)});return X=t,X}var Or=e=>en().persistence.setClientSettings(e);function kr(e){let t=vr.then(e);return vr=t.then(()=>void 0,()=>void 0),t}function Ar(e,t=Or){let n=Y!==`ready`||yr>0;return n?yr+=1:Sr({...Z(),...e}),kr(async()=>{if(n)try{Y!==`ready`&&await Q(),Sr({...Z(),...e})}finally{--yr}await t(Z())}).catch(e=>{console.error(`${pr} persist failed`,{operation:`persist`,...v(e)})})}async function jr(e,t=Or){return kr(async()=>{for(Y!==`ready`&&await Q();;){let n=Z(),r=e(n);if(await t(r),Z()===n)return Sr(r),r}})}var Mr=new Set(ce(ze.fields));function Nr(e){let t={},n={};for(let[r,i]of Object.entries(e))Mr.has(r)?t[r]=i:n[r]=i;return{serverPatch:t,clientPatch:n}}function Pr(){return Z()}function Fr(){return Q()}function Ir(){return(0,w.useSyncExternalStore)(Dr,Tr,Lr)}function Lr(){return!1}function Rr(){return(0,w.useSyncExternalStore)(Dr,Er,zr)}function zr(){return`pending`}function $(){return(0,w.useSyncExternalStore)(wr,Z,Br)}function Br(){return fe}function Vr(e,t){return{...t,...e,...Yn(e,t)}}var Hr=new Set;function Ur(e,t){let n=(0,T.c)(8),r=$(),i=Ir(),a;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={reportFailure:!1},n[0]=a):a=n[0];let o=at(b.updateSettings,a),s,c;n[1]!==r||n[2]!==e||n[3]!==i||n[4]!==o||n[5]!==t?(s=()=>{if(!e||!t||!i||Hr.has(e))return;let n=Xn(t,r);n&&(Hr.add(e),o({environmentId:e,input:{patch:n}}).finally(()=>Hr.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,w.useEffect)(s,c)}function Wr(e,t){let n=(0,T.c)(6),r=$(),i;n[0]!==r||n[1]!==e?(i=Vr(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 Gr(e){let t=(0,T.c)(3),n=$(),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}function Kr(e){return e.settingsHydrated?e.paletteThemeActive&&!e.paletteThemeAllowsArtwork&&e.mode===`artwork`?`pill`:e.mode:`none`}function qr(){let e=(0,T.c)(7),t=Ir(),n=$().environmentIdentificationMode,{resolvedTheme:r,theme:i,themeHalves:a}=jn(),o=(0,w.useSyncExternalStore)(ot,ht,Jr),s;if(e[0]!==n||e[1]!==o||e[2]!==r||e[3]!==t||e[4]!==i||e[5]!==a){let c=ct(i,a,r),l=mt(c);s=Kr({mode:n,settingsHydrated:t,paletteThemeActive:o!==null||l!==null,paletteThemeAllowsArtwork:o??pt(c)}),e[0]=n,e[1]=o,e[2]=r,e[3]=t,e[4]=i,e[5]=a,e[6]=s}else s=e[6];return s}function Jr(){return null}async function Yr(e,t){return(e.favorites===null||e.providerModelPreferences===null)&&await Fr(),{...Xn(e,Pr()),...t}}function Xr(e){let t=(0,T.c)(6),n;t[0]===e?n=t[1]:(n=e?b.settingsValueAtom(e):Qr,t[0]=e,t[1]=n);let r=a(n),i=at(b.updateSettings,`model preferences update`),o;return t[2]!==e||t[3]!==i||t[4]!==r?(o=async t=>{if(!e||!r)return;let n;try{n=await Yr(r,t)}catch{y.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]=o):o=t[5],o}function Zr(e){let t=(0,w.use)(l),n=(0,w.useRef)(new Map),r=Xr(e);return(0,w.useCallback)(async(i,a)=>{if(!e)return;let o=b.settingsValueAtom(e),s=t.get(o);if(!s)return;if(s.favorites===null)try{await Fr()}catch{y.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,Pr()).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&&te(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 Qr=d(null);function $r(e){let t=(0,T.c)(5),n;t[0]===e?n=t[1]:(n=e?b.settingsValueAtom(e):Qr,t[0]=e,t[1]=n);let r=a(n),i=$();Ur(e,r);let o=r??de,s;return t[2]!==i||t[3]!==o?(s=Yn(o,i),t[2]=i,t[3]=o,t[4]=s):s=t[4],s}function ei(e,t){let n=(0,T.c)(2),r;n[0]===e?r=n[1]:(r=b.settingsValueAtom(e),n[0]=e,n[1]=r);let i=a(r);return Ur(e,i),Wr(i??de,t)}function ti(e){let t=(0,T.c)(4),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=at(b.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 ni(e){let t=or(),n=a(et);return Ur(t?.environmentId??null,t?.serverConfig?.settings??null),Wr(n,e)}var ri=`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 ii(){let e=(0,T.c)(2),t=or(),n;return e[0]===t?n=e[1]:(n=t!==null||!qe(),e[0]=t,e[1]=n),n}function ai(e){let t=(0,T.c)(3),n=e!==void 0&&e,{environments:r}=nr(),i;return t[0]!==r||t[1]!==n?(i=d(e=>r.filter(er).flatMap(t=>{let r=e(it.sessionStateAtom(t.environmentId));if(n&&r._tag===`Initial`)return[t.environmentId];let i=r._tag===`Failure`?null:_(ee(r));return i!==null&&We(i,`settings:write`)?[t.environmentId]:[]})),t[0]=r,t[1]=n,t[2]=i):i=t[2],a(i)}function oi(e){let t=(0,T.c)(10);tt(e,Me);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=at(b.updateSettings,n),{environments:i}=nr(),a;t[1]!==i||t[2]!==r?(a=async(e,t)=>{let n=await r(e);if(n._tag===`Failure`&&t?.(),n._tag===`Failure`&&!Je(n)){let t=i.find(t=>t.environmentId===e.environmentId)?.label??e.environmentId,r=Ke(n);y.add({type:`error`,title:`Setting not saved`,description:`Could not save on ${t}: ${r instanceof Error?r.message:`The save failed. Try reconnecting and saving again.`}`})}return n},t[1]=i,t[2]=r,t[3]=a):a=t[3];let o=a,s=ai(!0),l;return t[4]!==e||t[5]!==i||t[6]!==r||t[7]!==o||t[8]!==s?(l=(t,n)=>{let{serverPatch:a,clientPatch:l}=Nr(t),u=e===null||Se(a).every(t=>nt(e,t));if(Object.keys(a).length>0&&!u&&(n?.onFailed?.(),y.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(a).length>0&&u){let{sharedPatch:t,localPatch:l}=Qn(a),u=e=>{let t=e===void 0?ri:e;return n?.onFailed?.(),y.add({type:`warning`,title:`Setting not saved`,description:t})};if(Object.keys(l).length>0&&(e?o({environmentId:e,input:{patch:l}},n?.onFailed):u()),Object.keys(t).length>0){let a=i.find(t=>t.environmentId===e)?.serverConfig?.settings,o=new Set(s);e&&o.add(e);let l=[],d=[];for(let n of o){let r=i.find(e=>e.environmentId===n),o=$n(t,r?.serverConfig?.environment.capabilities,r?.serverConfig?.settings,a,n===e);Object.keys(o).length!==0&&(c.get(it.sessionStateAtom(n))._tag!==`Initial`&&!Se(t).every(e=>nt(n,e))?d.push(r?.label??n):l.push({environmentId:n,input:{patch:o}}))}l.length===0?u(d.length>0?`This connection lacks permission to change settings on ${d.join(`, `)}.`:o.size>0?`Update older servers to save this setting.`:void 0):Promise.all(l.map(async e=>({label:i.find(t=>t.environmentId===e.environmentId)?.label??e.environmentId,result:await r(e)}))).then(e=>{(d.length>0||e.some(ui))&&n?.onFailed?.();let t=e.flatMap(li);if(t.length===0)return;let r=e.filter(ci).map(si);y.add({type:`error`,title:r.length>0?`Setting saved on some environments`:`Setting not saved`,description:[...t,...r.length>0?[`Saved on ${r.join(`, `)}.`]:[]].join(`
2
2
  `)})})}}Object.keys(l).length>0&&Ar(l)},t[4]=e,t[5]=i,t[6]=r,t[7]=o,t[8]=s,t[9]=l):l=t[9],l}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`||Je(n))return[];let r=Ke(n);return[`Could not save on ${t}: ${r instanceof Error?r.message:`The save failed. Try reconnecting and saving again.`}`]}function ui(e){let{result:t}=e;return t._tag===`Failure`}function di(e){return oi(e)}function fi(){return oi(or()?.environmentId??null)}function pi(){return mi}function mi(e){return Ar(e)}export{jt as $,dr as A,Fn as B,sr as C,nr as D,fr as E,Ln as F,Sn as G,nn as H,q as I,$t as J,jn as K,Bn as L,Kn as M,Jn as N,or as O,qn as P,kt as Q,Hn as R,ar as S,lr as T,rn as U,W as V,_n as W,Ft as X,Ut as Y,Nt as Z,Zr as _,Ar as a,Tt as at,di as b,Ir as c,$r as d,Mt as et,ei as f,ii as g,ni as h,Vr as i,D as it,cr as j,ir as k,Rr as l,ti as m,Fr as n,At as nt,jr as o,Ur as p,en as q,Pr as r,E as rt,Gr as s,ri as t,Pt as tt,qr as u,pi as v,ur as w,fi as x,Xr as y,Vn as z};
3
- //# sourceMappingURL=useSettings-DwDYuiOf.js.map
3
+ //# sourceMappingURL=useSettings-BWMcQzC-.js.map