@p4code/cli 0.8.34 → 0.8.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (308) hide show
  1. package/dist/bin.mjs +1 -1
  2. package/dist/{binCli-CvWinVsO.mjs → binCli-26z5sNBT.mjs} +2242 -1476
  3. package/dist/client/.vite/manifest.json +2038 -2023
  4. package/dist/client/assets/{2NI2N5EU-Dlr3FZf7.js → 2NI2N5EU-BLnY4aCF.js} +2 -2
  5. package/dist/client/assets/{4UO7MD6I-Cy2sjs8O.js → 4UO7MD6I-BApNVkfU.js} +2 -2
  6. package/dist/client/assets/{5B3SVYGG-DaCwFaTp.js → 5B3SVYGG-Y7V7NdZO.js} +2 -2
  7. package/dist/client/assets/{5GK6JWQ2-BVM9871F.js → 5GK6JWQ2-BSIhKcw-.js} +2 -2
  8. package/dist/client/assets/{5N7A7DKN-BVMU2dmG.js → 5N7A7DKN-CNUCnWLs.js} +2 -2
  9. package/dist/client/assets/{5OC2THR4-2tkjJ38q.js → 5OC2THR4-Bne-pf_A.js} +2 -2
  10. package/dist/client/assets/{5S6HY5KT-BGTQzE2T.js → 5S6HY5KT-7d4UMONz.js} +2 -2
  11. package/dist/client/assets/{6IMQ5BUJ-DMdx9ktL.js → 6IMQ5BUJ-BWW19n-D.js} +2 -2
  12. package/dist/client/assets/{6OLKWJ4F-B0TXT19U.js → 6OLKWJ4F-CxTUuvA6.js} +2 -2
  13. package/dist/client/assets/{74OO7NKP-Cukz2OUS.js → 74OO7NKP-DByVTRKE.js} +2 -2
  14. package/dist/client/assets/{75O6YZUN-D3k2sZNm.js → 75O6YZUN-CZanyedf.js} +2 -2
  15. package/dist/client/assets/{77XECAW3-CjIq7P_x.js → 77XECAW3-TL2w7pHK.js} +2 -2
  16. package/dist/client/assets/{ABYRPUBD-hf0OeD7n.js → ABYRPUBD-CJboH7Uz.js} +2 -2
  17. package/dist/client/assets/AlertDialogRoot-9jRALQXL.js +2 -0
  18. package/dist/client/assets/{AnimatedHeight-CHpFDL1r.js → AnimatedHeight-OxEbW01v.js} +2 -2
  19. package/dist/client/assets/{AuthSurfaceShell-whDvSlDA.js → AuthSurfaceShell-KQXgPV4i.js} +2 -2
  20. package/dist/client/assets/{BB2UYUI2-RUQPN7sp.js → BB2UYUI2-BxW-R2h1.js} +2 -2
  21. package/dist/client/assets/{BUM34MOA-f5Ez9vSp.js → BUM34MOA-ngG-irUy.js} +2 -2
  22. package/dist/client/assets/{CEQABKGZ-C2ZheKpY.js → CEQABKGZ-C-u-W0bS.js} +2 -2
  23. package/dist/client/assets/{CXAC5362-B0KvwGJk.js → CXAC5362-DfFRkI7L.js} +2 -2
  24. package/dist/client/assets/ChatGptUsageButton-C3KgGt4z.js +2 -0
  25. package/dist/client/assets/{ChatMarkdown-C2KOLN1s.js → ChatMarkdown-9gWM0ED9.js} +9 -9
  26. package/dist/client/assets/{CheckboxIndicator-zwVHomgm.js → CheckboxIndicator-DbU3csPQ.js} +2 -2
  27. package/dist/client/assets/{ClippedText-Cx9jjhQp.js → ClippedText-CS_BYNco.js} +2 -2
  28. package/dist/client/assets/{CodexSetupSection.logic-150217tr.js → CodexSetupSection.logic-CNbTXxKb.js} +2 -2
  29. package/dist/client/assets/{ComboboxClear-tzFhNwrk.js → ComboboxClear-Bn_kslrf.js} +2 -2
  30. package/dist/client/assets/{ComboboxGroupLabel-C1Icd2UF.js → ComboboxGroupLabel-fL8lMA25.js} +2 -2
  31. package/dist/client/assets/{CommandBlock-D9QqOlDX.js → CommandBlock-DcQXu_lq.js} +2 -2
  32. package/dist/client/assets/ComposerPromptEditor-DQ9wFfKn.js +204 -0
  33. package/dist/client/assets/{CompositeRoot-BD0GlRg8.js → CompositeRoot-BuwzXGHT.js} +2 -2
  34. package/dist/client/assets/{ConnectionDiagnosisDetails-BQ3BFqRL.js → ConnectionDiagnosisDetails-DGbJY7Hw.js} +2 -2
  35. package/dist/client/assets/{ConnectionStatusDot-DLQm_zZ7.js → ConnectionStatusDot-CixsTBXI.js} +2 -2
  36. package/dist/client/assets/{DRLTVNUE-vgHnaBR1.js → DRLTVNUE-Cbb71R0Y.js} +2 -2
  37. package/dist/client/assets/{DYY6UVD2-BQAAF_8A.js → DYY6UVD2-BZn5fuF5.js} +2 -2
  38. package/dist/client/assets/{DevicePanel-Yd3YuPQd.js → DevicePanel-JP__PY1s.js} +2 -2
  39. package/dist/client/assets/{DeviceSetup-DW4g9NNK.js → DeviceSetup-D8qb_qBj.js} +2 -2
  40. package/dist/client/assets/{DialogTitle-DCMYEIWZ.js → DialogTitle-B_9LEmy3.js} +2 -2
  41. package/dist/client/assets/{DiffCommentAnnotation-BLItJ7Ia.js → DiffCommentAnnotation-WMKzOwCh.js} +2 -2
  42. package/dist/client/assets/{DiffFileTree-B1-D1WV6.js → DiffFileTree-BSbsOOmA.js} +2 -2
  43. package/dist/client/assets/DiffPanel-BWFuiHvv.js +2 -0
  44. package/dist/client/assets/{DiffWorkerPoolProvider-BzkGX7xm.js → DiffWorkerPoolProvider-BBk0lIX3.js} +2 -2
  45. package/dist/client/assets/EmbeddedDesign-B4RMmwTG.css +1 -0
  46. package/dist/client/assets/EmbeddedDesign-D5YUndkh.js +21 -0
  47. package/dist/client/assets/{EnvironmentMachineIcon-5-erc8l_.js → EnvironmentMachineIcon-Dpgx67FY.js} +2 -2
  48. package/dist/client/assets/{ExpandableText-D2jzDgm7.js → ExpandableText-Cpm1gOKG.js} +2 -2
  49. package/dist/client/assets/{FNOVOB4O-CE98DPML.js → FNOVOB4O-BkEIrB0k.js} +2 -2
  50. package/dist/client/assets/{FieldControl-CBMzQqd5.js → FieldControl-BHe6unoZ.js} +2 -2
  51. package/dist/client/assets/{FileDiff-2qSm00aV.js → FileDiff-C1vAOUga.js} +2 -2
  52. package/dist/client/assets/{FilePreviewPanel-Drpn6NuE.js → FilePreviewPanel-CbpNevZP.js} +4 -4
  53. package/dist/client/assets/{FoldedSettingsSection-Db7e_9rd.js → FoldedSettingsSection-DySTg20x.js} +2 -2
  54. package/dist/client/assets/{FormContext-BGRz6hhb.js → FormContext-CmvUzTS-.js} +2 -2
  55. package/dist/client/assets/{HDGCDEEZ-C0-Zci_l.js → HDGCDEEZ-CN-ckGDk.js} +2 -2
  56. package/dist/client/assets/{HSJLKHB7-4e5L-KC4.js → HSJLKHB7-B0BvmnZE.js} +2 -2
  57. package/dist/client/assets/{Icons-DwLGuyWf.js → Icons-B4l3TqYa.js} +2 -2
  58. package/dist/client/assets/Input-Cv-TKh6s.js +2 -0
  59. package/dist/client/assets/JZOYTAAL-CB_B_Rei.js +1 -0
  60. package/dist/client/assets/{K3MD6TGW-Gi4s7ooz.js → K3MD6TGW-IS0rWO1U.js} +2 -2
  61. package/dist/client/assets/{K7RP3OMA-BVc6P2bZ.js → K7RP3OMA-DcqjCOJO.js} +2 -2
  62. package/dist/client/assets/{KeybindingsSettings.logic-CU23l8mP.js → KeybindingsSettings.logic-mF9mJWrc.js} +2 -2
  63. package/dist/client/assets/{LHDIQX7Q-DbBCFdJr.js → LHDIQX7Q-CLMgIt4Y.js} +2 -2
  64. package/dist/client/assets/{LUXOKEGN-C4n0-A1h.js → LUXOKEGN-B1dkmN_M.js} +2 -2
  65. package/dist/client/assets/{MathTypeset--azkeKic.js → MathTypeset-qeRVy_bc.js} +2 -2
  66. package/dist/client/assets/{N3JZAHOW-2wC96xvZ.js → N3JZAHOW-C6sq5aqx.js} +2 -2
  67. package/dist/client/assets/{NUIALGQ3-Di1L_kRJ.js → NUIALGQ3-BG7xJ_qe.js} +2 -2
  68. package/dist/client/assets/{NoProjectsHero-CC3oMKUV.js → NoProjectsHero-B0KzU91d.js} +2 -2
  69. package/dist/client/assets/{O65XPQGZ-BeKB0m-p.js → O65XPQGZ-BEfVfDlS.js} +2 -2
  70. package/dist/client/assets/{O7XIQ6OM-1wrcdCMc.js → O7XIQ6OM-BUiRjV87.js} +2 -2
  71. package/dist/client/assets/{OFQON5FD-CsMmmhLT.js → OFQON5FD-DTgVPbd-.js} +2 -2
  72. package/dist/client/assets/{P4ConnectAccountPages-BDxb29bY.js → P4ConnectAccountPages-C4KYM5XU.js} +2 -2
  73. package/dist/client/assets/{P4ConnectSidebarSignIn-Dp5OsZBa.js → P4ConnectSidebarSignIn-DNPUNJl_.js} +2 -2
  74. package/dist/client/assets/{PJQHF43J-CY_GpbqJ.js → PJQHF43J-QRnhQpHu.js} +2 -2
  75. package/dist/client/assets/PanelLayoutControls-4VFKEoHg.js +216 -0
  76. package/dist/client/assets/{PierreEntryIcon-B5tjtDkE.js → PierreEntryIcon-DeI-j_7w.js} +2 -2
  77. package/dist/client/assets/{PopoverHandle-CZh3pqXt.js → PopoverHandle-DMB4QSp6.js} +2 -2
  78. package/dist/client/assets/PreviewPanel-CO66mekh.js +2 -0
  79. package/dist/client/assets/ProjectDefaultsSettings-BF-iyQ8T.js +2 -0
  80. package/dist/client/assets/{ProjectFavicon-CkSteHLT.js → ProjectFavicon-_6hkSNzm.js} +3 -3
  81. package/dist/client/assets/{ProjectIconPickerDialog-9heAZbVC.js → ProjectIconPickerDialog-DeL1rZxy.js} +2 -2
  82. package/dist/client/assets/{ProjectMonogram-DIqp1OmB.js → ProjectMonogram-Cn4l-YGU.js} +2 -2
  83. package/dist/client/assets/{ProviderAuthTerminal-BSsraub7.js → ProviderAuthTerminal-qGeMxZDy.js} +2 -2
  84. package/dist/client/assets/ProviderModelPicker-DJQYH_Pp.js +2 -0
  85. package/dist/client/assets/{ProviderSettingsForm-CAFBbrfr.js → ProviderSettingsForm-BSVuPnR0.js} +2 -2
  86. package/dist/client/assets/PullRequestCodeTab-0OaJE6XS.js +6 -0
  87. package/dist/client/assets/{RHNBAITX-BdiF8iR_.js → RHNBAITX-ChqB7inB.js} +2 -2
  88. package/dist/client/assets/{ReadOnlySourcePreview-BXDLfPcr.js → ReadOnlySourcePreview-B08Wms4m.js} +2 -2
  89. package/dist/client/assets/{RenderErrorBoundary-CR2cHAQ5.js → RenderErrorBoundary-BsOuLEci.js} +3 -3
  90. package/dist/client/assets/{SLD4V6NK-Bo1z-c9S.js → SLD4V6NK-IkYRGtTH.js} +2 -2
  91. package/dist/client/assets/ScheduledTasksSettings-1UDkELZo.js +4 -0
  92. package/dist/client/assets/{ScopedSwitch-CX4FTGjy.js → ScopedSwitch-Bhp6-hCj.js} +2 -2
  93. package/dist/client/assets/{ScrollAreaCorner-BCdJHqsj.js → ScrollAreaCorner-BPMuWLbs.js} +2 -2
  94. package/dist/client/assets/{SecretInput-BPPzPNI1.js → SecretInput-RlOzrLKL.js} +2 -2
  95. package/dist/client/assets/{SelectScrollUpArrow-CR3Z6_pf.js → SelectScrollUpArrow-6kh66YCd.js} +2 -2
  96. package/dist/client/assets/{SettingsPanels-DoJnxtp0.js → SettingsPanels-BfBUSBAG.js} +6 -6
  97. package/dist/client/assets/{SettingsPanels.logic-t7cG-B6z.js → SettingsPanels.logic-BsFZYDgm.js} +2 -2
  98. package/dist/client/assets/{SettingsScopeNotice-DD4QFo3v.js → SettingsScopeNotice-H7UzC9bb.js} +2 -2
  99. package/dist/client/assets/{T3PCR2KE-Cg6A465M.js → T3PCR2KE-BxaunvVy.js} +2 -2
  100. package/dist/client/assets/{TKWO2OVW-CWeCEb5C.js → TKWO2OVW-DFURsfqA.js} +2 -2
  101. package/dist/client/assets/{TSHNXIZL-DTjzxHgA.js → TSHNXIZL-CIukdyLy.js} +2 -2
  102. package/dist/client/assets/{ThemeEditorPanel-BwydY72w.js → ThemeEditorPanel-otrA-nTg.js} +3 -3
  103. package/dist/client/assets/{ThreadTerminalDrawer-QTFG89J_.js → ThreadTerminalDrawer-BQKZCFAC.js} +4 -4
  104. package/dist/client/assets/TooltipViewport-ZmVCer7P.js +2 -0
  105. package/dist/client/assets/{UQJE5E4I-DS4MjKhw.js → UQJE5E4I-CfqCotH2.js} +2 -2
  106. package/dist/client/assets/{USNYFO5S-Be1OZGok.js → USNYFO5S-CctAAheU.js} +2 -2
  107. package/dist/client/assets/{Virtualizer-BpizRoFL.js → Virtualizer-CImHNxBq.js} +2 -2
  108. package/dist/client/assets/{WEVWDWVA-oFS2VG1Y.js → WEVWDWVA-DS9YO9IT.js} +2 -2
  109. package/dist/client/assets/{WorkspaceBreadcrumb-ckARUoj9.js → WorkspaceBreadcrumb-BW_omYU1.js} +2 -2
  110. package/dist/client/assets/{WorkspacePageContainer-D5yW7_av.js → WorkspacePageContainer-BS8FWt_4.js} +2 -2
  111. package/dist/client/assets/{WorkspacePageHeader-CTWcEH7d.js → WorkspacePageHeader-CE_94tTR.js} +2 -2
  112. package/dist/client/assets/{X5RFHQXM-Bjw0rDxX.js → X5RFHQXM-B0KbwoE1.js} +2 -2
  113. package/dist/client/assets/{X62E3GBT-BPHYY59t.js → X62E3GBT-wpz8X9Yh.js} +2 -2
  114. package/dist/client/assets/{XBNEOJTC-W72qCYdc.js → XBNEOJTC-DFRK5c6Y.js} +2 -2
  115. package/dist/client/assets/{YHV2MVVZ-DA_drdwk.js → YHV2MVVZ-1NnqTTZ2.js} +2 -2
  116. package/dist/client/assets/{YURCZMG2-CsfrwNLG.js → YURCZMG2-rnzWY5ij.js} +2 -2
  117. package/dist/client/assets/{YVG2LODB-dXCBipzg.js → YVG2LODB-Dxuuk2M-.js} +2 -2
  118. package/dist/client/assets/_chat-1QGQLbCc.js +45 -0
  119. package/dist/client/assets/{_chat.design-KVMajkdX.js → _chat.design-z2pu_9A5.js} +2 -2
  120. package/dist/client/assets/{_chat.index-BknTP6QZ.js → _chat.index-D8X9o5jY.js} +2 -2
  121. package/dist/client/assets/{_chat.new-DLFV1XOJ.js → _chat.new-CGJw8cpo.js} +3 -3
  122. package/dist/client/assets/_chat.pull-requests-BfW9qMU1.js +2 -0
  123. package/dist/client/assets/{alert-Dh8AVuLe.js → alert-DO06etEs.js} +2 -2
  124. package/dist/client/assets/{assetUrls-C6W2_00u.js → assetUrls-CmOUMX2M.js} +2 -2
  125. package/dist/client/assets/assets-aBpLf8r4.js +2 -0
  126. package/dist/client/assets/{browserHistoryStore-CeBJcpoN.js → browserHistoryStore-tYgeZygn.js} +2 -2
  127. package/dist/client/assets/{browserLinkTarget-D5ew8rLG.js → browserLinkTarget-CQFfJKWJ.js} +2 -2
  128. package/dist/client/assets/{checkbox-Y4v7A1IZ.js → checkbox-BEQFb7GO.js} +2 -2
  129. package/dist/client/assets/{color-picker-DEWeNc5K.js → color-picker-CXfnfmuH.js} +2 -2
  130. package/dist/client/assets/{combobox-DGrx2JGy.js → combobox--XoXA5uu.js} +2 -2
  131. package/dist/client/assets/{command-DR1GjC1a.js → command-E2aLhsct.js} +2 -2
  132. package/dist/client/assets/composer-logic-BPTz1APL.js +6 -0
  133. package/dist/client/assets/{composerDraftUploads-DK6jH0cB.js → composerDraftUploads-b_0oxKs9.js} +2 -2
  134. package/dist/client/assets/{connect-B1NcR-kN.js → connect-CU9dNvTt.js} +2 -2
  135. package/dist/client/assets/{connect-agent-BNrm24qs.js → connect-agent-Byc9PCdW.js} +2 -2
  136. package/dist/client/assets/{design-CbG6XJYX.js → design-CoGbXd61.js} +2 -2
  137. package/dist/client/assets/{device-6R-yC55P.js → device-DmH6IHQ4.js} +2 -2
  138. package/dist/client/assets/{dialog-BwjzOzO6.js → dialog-CBBxT1gk.js} +2 -2
  139. package/dist/client/assets/{diffRendering-CG_sb5me.js → diffRendering-BOVFJuWd.js} +2 -2
  140. package/dist/client/assets/{dist-CFar2AY1.js → dist-B2P3f-0Q.js} +3 -3
  141. package/dist/client/assets/{draft-input-CpqOZR5i.js → draft-input-CSOOVntS.js} +2 -2
  142. package/dist/client/assets/{duoViewer-BhE8QUaC.js → duoViewer-BhHYrurM.js} +2 -2
  143. package/dist/client/assets/{dynamic-CIBySV57.js → dynamic-BhzrutAo.js} +2 -2
  144. package/dist/client/assets/{embeddedScripts-B0vXhhvs.js → embeddedScripts-43_R83vp.js} +2 -2
  145. package/dist/client/assets/{empty-C0oiFHy_.js → empty-FOL5U4KY.js} +2 -2
  146. package/dist/client/assets/entities-Bqo0n1Pb.js +2 -0
  147. package/dist/client/assets/{fileLinks-CP5NWXaI.js → fileLinks-D4GSqJYj.js} +2 -2
  148. package/dist/client/assets/{fileTreeExpansion-BKVd4HrC.js → fileTreeExpansion-BBT5F8P1.js} +2 -2
  149. package/dist/client/assets/{getDiffFileInput-CIK5OMl_.js → getDiffFileInput-CGw09SPI.js} +2 -2
  150. package/dist/client/assets/{guideRunStore-CegZr43-.js → guideRunStore-DvIkVECt.js} +2 -2
  151. package/dist/client/assets/{htmlRender-NqJI2UJ2.js → htmlRender-CmEeFzCo.js} +2 -2
  152. package/dist/client/assets/{index-Czsz7nXH.js → index-B1djVqM4.js} +3 -3
  153. package/dist/client/assets/{input-BCWES8Y7.js → input-ekYqAkUx.js} +2 -2
  154. package/dist/client/assets/{input-group-CfPOCEuC.js → input-group-C3pxk97H.js} +2 -2
  155. package/dist/client/assets/{kbd-EDrgCOls.js → kbd-3FPzNikV.js} +2 -2
  156. package/dist/client/assets/{keybindings-BG7j7M7S.js → keybindings-B3oDRRkK.js} +2 -2
  157. package/dist/client/assets/{lazy-D6W01WxZ.js → lazy-DyNR0b0B.js} +4 -4
  158. package/dist/client/assets/{lazyRouteComponent-B8CSLurY.js → lazyRouteComponent-BPxq_G_s.js} +2 -2
  159. package/dist/client/assets/{link-COzhJ6br.js → link-B3B5a5Ju.js} +2 -2
  160. package/dist/client/assets/{linkedPrompt-X4NBlFef.js → linkedPrompt-BsCPMHxQ.js} +2 -2
  161. package/dist/client/assets/main-BWh6jqG2.js +29 -0
  162. package/dist/client/assets/main-DdVSHl80.css +2 -0
  163. package/dist/client/assets/{mediaReference-CKap6oNP.js → mediaReference-Bb8H-qbI.js} +2 -2
  164. package/dist/client/assets/{mediaSource-DG5l5-5f.js → mediaSource-C2MsZgy8.js} +2 -2
  165. package/dist/client/assets/number-field-SoHEiP55.js +2 -0
  166. package/dist/client/assets/{observeResize-BUAH1dvA.js → observeResize-3Vj9DYOV.js} +2 -2
  167. package/dist/client/assets/{onboarding-CnVH7A6c.js → onboarding-CPgiVEVK.js} +2 -2
  168. package/dist/client/assets/{openFileInPreview-B0i3eZpu.js → openFileInPreview-BBWCOLh_.js} +2 -2
  169. package/dist/client/assets/{p4ProjectFile-0RRo3hX4.js → p4ProjectFile-qmvlbzKv.js} +2 -2
  170. package/dist/client/assets/{pair-B4KNAPh5.js → pair-CZnRGdd8.js} +2 -2
  171. package/dist/client/assets/{pendingSendStore-Dzn7x7Cg.js → pendingSendStore-L5KquCDf.js} +2 -2
  172. package/dist/client/assets/{phoneViewer-RhpfiwR2.js → phoneViewer-D-8v-sMf.js} +2 -2
  173. package/dist/client/assets/{pierre-icons-Cisj4-__.js → pierre-icons-jwqMPUxD.js} +2 -2
  174. package/dist/client/assets/{popover-BnqKHl4L.js → popover-OfG3wVsl.js} +2 -2
  175. package/dist/client/assets/{preview-CiojYkh4.js → preview-BYnEURcB.js} +2 -2
  176. package/dist/client/assets/{preview-Dwq2O7nm.js → preview-DGdQ5Ycc.js} +2 -2
  177. package/dist/client/assets/{previewMiniPlayerStore-ByZNhmNc.js → previewMiniPlayerStore-Dlbj5KrZ.js} +2 -2
  178. package/dist/client/assets/primary-B47ivN3o.js +2 -0
  179. package/dist/client/assets/primaryCloudLinkState-CreqR0gU.js +2 -0
  180. package/dist/client/assets/projectFilesQueryState-CanWrACx.js +2 -0
  181. package/dist/client/assets/{projectScriptEditor-B4iSq27p.js → projectScriptEditor-gWuw6vwd.js} +2 -2
  182. package/dist/client/assets/{providerSkills-C4Fu_qyq.js → providerSkills-C_Rxqah9.js} +2 -2
  183. package/dist/client/assets/{pullRequestDetail.logic-BmYDDw_8.js → pullRequestDetail.logic-RASi2EgP.js} +4 -4
  184. package/dist/client/assets/{pullRequestIcons-DFcQ9rtl.js → pullRequestIcons-ucGaXXG7.js} +2 -2
  185. package/dist/client/assets/{pullRequestReviewStore-BGzKslrq.js → pullRequestReviewStore-CEr41DEl.js} +2 -2
  186. package/dist/client/assets/pullRequests-Bw3Ui6hK.js +2 -0
  187. package/dist/client/assets/queries-EslKFJTV.js +2 -0
  188. package/dist/client/assets/query-d1pQlqP0.js +2 -0
  189. package/dist/client/assets/{radio-group-DOHTpBxX.js → radio-group-Ciy_K5uE.js} +2 -2
  190. package/dist/client/assets/{renderScheduler-Df4T8RWh.js → renderScheduler-CP-JkmKx.js} +2 -2
  191. package/dist/client/assets/rightPanelStore-D3KOmuPa.js +2 -0
  192. package/dist/client/assets/runtime-DR7JxgbQ.js +6 -0
  193. package/dist/client/assets/runtime-d6B1vJeH.js +3 -0
  194. package/dist/client/assets/runtimeModeConfig-Rxeb1uGg.js +2 -0
  195. package/dist/client/assets/{scheduledTasksSettings.logic-7E0KSnA7.js → scheduledTasksSettings.logic-CVIC4Kpr.js} +3 -3
  196. package/dist/client/assets/{scroll-area-B9LorBFb.js → scroll-area-yyfi3ycu.js} +2 -2
  197. package/dist/client/assets/{select-Ctq0UILH.js → select-DaYjjw1q.js} +2 -2
  198. package/dist/client/assets/selfImproveFindings-1XIHD-7i.js +2 -0
  199. package/dist/client/assets/server-sXApTCjZ.js +2 -0
  200. package/dist/client/assets/{session-C7ckxjAM.js → session-C949OsEI.js} +2 -2
  201. package/dist/client/assets/session-logic-DkSfwnHl.js +26 -0
  202. package/dist/client/assets/{settings-BqhxEPKC.js → settings-B0O54Q3P.js} +2 -2
  203. package/dist/client/assets/{settings.appearance-DljtCz6-.js → settings.appearance-BesXhA1a.js} +2 -2
  204. package/dist/client/assets/settings.archived-FtcZf_Ug.js +2 -0
  205. package/dist/client/assets/settings.computer-use-BeKmLbNe.js +2 -0
  206. package/dist/client/assets/settings.connections-D1UxckE0.js +2 -0
  207. package/dist/client/assets/{settings.data-controls-Cdccmn63.js → settings.data-controls-lPiIwMgc.js} +2 -2
  208. package/dist/client/assets/settings.decisions-D97jIUyr.js +2 -0
  209. package/dist/client/assets/{settings.designs-TeCw-uLf.js → settings.designs-B473PRvt.js} +2 -2
  210. package/dist/client/assets/settings.diagnostics-DDOaOIDg.js +2 -0
  211. package/dist/client/assets/{settings.general-uxwywmhh.js → settings.general-qzEOE2zF.js} +2 -2
  212. package/dist/client/assets/settings.integrations-D6ctQ9WI.js +2 -0
  213. package/dist/client/assets/{settings.keybindings-C0FBNk1_.js → settings.keybindings-BL57H4sD.js} +2 -2
  214. package/dist/client/assets/{settings.open-source-licenses-wMwaYCss.js → settings.open-source-licenses-DaS82UhN.js} +2 -2
  215. package/dist/client/assets/{settings.plugins-CFiDE3ms.js → settings.plugins-DnS3RrT2.js} +4 -4
  216. package/dist/client/assets/{settings.projects-DN0n2td7.js → settings.projects-D-ZICXey.js} +4 -4
  217. package/dist/client/assets/settings.providers-CFpCmv0o.js +3 -0
  218. package/dist/client/assets/{settings.scheduled-tasks-uCL4Wgvt.js → settings.scheduled-tasks-IEAC3STn.js} +2 -2
  219. package/dist/client/assets/{settings.snap-shot-C4OHP0nR.js → settings.snap-shot-BaOFk9WR.js} +2 -2
  220. package/dist/client/assets/{settings.source-control-pMBspYC4.js → settings.source-control-BW16AA5z.js} +2 -2
  221. package/dist/client/assets/{settings.storage-QCydiEyw.js → settings.storage-D4vBYBRP.js} +2 -2
  222. package/dist/client/assets/settingsLayout-CFQx1XDM.js +3 -0
  223. package/dist/client/assets/{sidebar-CRr8B41y.js → sidebar-C1E4GqL6.js} +2 -2
  224. package/dist/client/assets/{sidebarProjectGrouping-miDXfjI3.js → sidebarProjectGrouping-9cUrCOXH.js} +2 -2
  225. package/dist/client/assets/{skeleton-C9J-Xl06.js → skeleton-BCpBrYxh.js} +2 -2
  226. package/dist/client/assets/{sourceControl-C8nJMDiL.js → sourceControl-DwJWPP0h.js} +2 -2
  227. package/dist/client/assets/{sourceControlClients-DKONtKbZ.js → sourceControlClients-BBJW7ra4.js} +2 -2
  228. package/dist/client/assets/{spinner-CNva85zM.js → spinner-CSTrcxhP.js} +2 -2
  229. package/dist/client/assets/{terminal-links-BJzLp7ix.js → terminal-links-D18LpQ1T.js} +2 -2
  230. package/dist/client/assets/{terminalSessions-BPc8sBGR.js → terminalSessions-C2NUFncF.js} +2 -2
  231. package/dist/client/assets/{textarea-DjRGRzMg.js → textarea-R4UQ47Ns.js} +2 -2
  232. package/dist/client/assets/{themePalette-fhKYLCuU.js → themePalette-neUNWCzK.js} +3 -3
  233. package/dist/client/assets/toast-B84QdqqM.js +2 -0
  234. package/dist/client/assets/{toggle-Bbnow7xY.js → toggle-BH5BGBcD.js} +2 -2
  235. package/dist/client/assets/{toggle-group-Cilo8czD.js → toggle-group-Di3SFV73.js} +2 -2
  236. package/dist/client/assets/{tooltip-T5ePvxsH.js → tooltip-D-GRl-oZ.js} +2 -2
  237. package/dist/client/assets/{uiStateStore-D9r3BNZ-.js → uiStateStore-xSkh4_PU.js} +2 -2
  238. package/dist/client/assets/{usage-QBPLx2wr.js → usage-DUdXloVo.js} +2 -2
  239. package/dist/client/assets/{usageAccess-DUfVA8nU.js → usageAccess-DSLF-sRE.js} +2 -2
  240. package/dist/client/assets/{usageFormat-C-mTuUS7.js → usageFormat-Bzyvr9m4.js} +2 -2
  241. package/dist/client/assets/{usageShortcuts-CB6TvooP.js → usageShortcuts-D6nQeRtx.js} +2 -2
  242. package/dist/client/assets/{use-atom-command-BNkv9iyk.js → use-atom-command-DA6OG-Qk.js} +2 -2
  243. package/dist/client/assets/{useAriaLabelledBy-D5HM2KLM.js → useAriaLabelledBy-PLuOxvFb.js} +2 -2
  244. package/dist/client/assets/{useHandleNewThread-DntRaFvm.js → useHandleNewThread-Dm0SCq59.js} +2 -2
  245. package/dist/client/assets/{useLocation-DbWity7H.js → useLocation-Bqc94klS.js} +2 -2
  246. package/dist/client/assets/{useNavigate-Cxh24teV.js → useNavigate-DdjG4MB_.js} +2 -2
  247. package/dist/client/assets/{useNavigateBack-B5mTfIHJ.js → useNavigateBack-sP0LsL3p.js} +2 -2
  248. package/dist/client/assets/{useP4ConnectAuthPrompt-sjWWPvrn.js → useP4ConnectAuthPrompt-C9d7n33S.js} +2 -2
  249. package/dist/client/assets/{useParams-D9PdK0IA.js → useParams-DZQvRQLJ.js} +2 -2
  250. package/dist/client/assets/{usePermissionStatus-D6i3IaCj.js → usePermissionStatus-BzfAUU9X.js} +2 -2
  251. package/dist/client/assets/{usePullRequestActions-9274Vp3W.js → usePullRequestActions-DIjGLg1E.js} +3 -3
  252. package/dist/client/assets/{useRegisterFieldControl-DZyLTxKX.js → useRegisterFieldControl-CyBVe0G0.js} +2 -2
  253. package/dist/client/assets/{useScopedModelAvailability-CmlQi7Iz.js → useScopedModelAvailability-D4n22Nmm.js} +2 -2
  254. package/dist/client/assets/useSettings-CaJMqrvF.js +3 -0
  255. package/dist/client/assets/utils-BoMYW9A3.js +37 -0
  256. package/dist/client/assets/vcsRefInvalidation-w_CQ3i43.js +2 -0
  257. package/dist/client/assets/{welcome-DVusCS_L.js → welcome-BIKH3rbU.js} +2 -2
  258. package/dist/client/index.html +1 -1
  259. package/dist/{renderer-CJXpJ36b.mjs → renderer-CveKT929.mjs} +26 -3
  260. package/dist/{runtime-EqYv-lrV.mjs → runtime-DGGSjC6Q.mjs} +148 -4
  261. package/package.json +1 -1
  262. package/dist/client/assets/AlertDialogRoot-BUODcEy9.js +0 -2
  263. package/dist/client/assets/ChatGptUsageButton-CMIjZ66V.js +0 -2
  264. package/dist/client/assets/ComposerPromptEditor-D2ObH3Py.js +0 -204
  265. package/dist/client/assets/DiffPanel-BGnRzWM8.js +0 -2
  266. package/dist/client/assets/EmbeddedDesign-BV_FcJ4l.js +0 -21
  267. package/dist/client/assets/EmbeddedDesign-Cud7UEy4.css +0 -1
  268. package/dist/client/assets/Input-DLaKk0qb.js +0 -2
  269. package/dist/client/assets/JZOYTAAL-SLYGD65P.js +0 -1
  270. package/dist/client/assets/PanelLayoutControls-CqeL3uQz.js +0 -216
  271. package/dist/client/assets/PreviewPanel-CvBQAq3I.js +0 -2
  272. package/dist/client/assets/ProjectDefaultsSettings-DLJfUN7i.js +0 -2
  273. package/dist/client/assets/ProviderModelPicker-AkULlCAn.js +0 -2
  274. package/dist/client/assets/PullRequestCodeTab-BamXVeZz.js +0 -6
  275. package/dist/client/assets/ScheduledTasksSettings-DF_KhqLx.js +0 -4
  276. package/dist/client/assets/TooltipViewport-C14m3uB7.js +0 -2
  277. package/dist/client/assets/_chat-BIqme2Hz.js +0 -46
  278. package/dist/client/assets/_chat.pull-requests-BDLRkW2A.js +0 -2
  279. package/dist/client/assets/assets-D-xsxvzf.js +0 -2
  280. package/dist/client/assets/composer-logic-BW4G8aDL.js +0 -6
  281. package/dist/client/assets/entities-Om5Klild.js +0 -2
  282. package/dist/client/assets/main-BGaSDXjP.js +0 -29
  283. package/dist/client/assets/main-BP1f3auf.css +0 -2
  284. package/dist/client/assets/number-field-DGdBjQD2.js +0 -2
  285. package/dist/client/assets/primary-CMwTDEi1.js +0 -2
  286. package/dist/client/assets/primaryCloudLinkState-2j4MjqVh.js +0 -2
  287. package/dist/client/assets/projectFilesQueryState-DXrTSOqg.js +0 -2
  288. package/dist/client/assets/pullRequests-DT0oG7tF.js +0 -2
  289. package/dist/client/assets/queries-CXgT6mki.js +0 -2
  290. package/dist/client/assets/query-DlK0I8Jc.js +0 -2
  291. package/dist/client/assets/rightPanelStore-DXw7-xK3.js +0 -2
  292. package/dist/client/assets/runtime-BL7IF4n-.js +0 -3
  293. package/dist/client/assets/runtime-Dm3Pi31_.js +0 -6
  294. package/dist/client/assets/runtimeModeConfig-_-kQoAWi.js +0 -2
  295. package/dist/client/assets/server-BvxyePeo.js +0 -2
  296. package/dist/client/assets/session-logic-P8gC-UQc.js +0 -26
  297. package/dist/client/assets/settings.archived-SsFK0IFf.js +0 -2
  298. package/dist/client/assets/settings.computer-use-CVmc70Ib.js +0 -2
  299. package/dist/client/assets/settings.connections-BrPlTKQ_.js +0 -2
  300. package/dist/client/assets/settings.decisions-pkwqjsKP.js +0 -2
  301. package/dist/client/assets/settings.diagnostics-BZD1uMGP.js +0 -2
  302. package/dist/client/assets/settings.integrations-Du282Gn7.js +0 -2
  303. package/dist/client/assets/settings.providers-DeUZZg7C.js +0 -3
  304. package/dist/client/assets/settingsLayout-DFYjWgKN.js +0 -3
  305. package/dist/client/assets/toast-BcjbmUtS.js +0 -2
  306. package/dist/client/assets/useSettings-BL4ZWGQV.js +0 -3
  307. package/dist/client/assets/utils-CrFJwxSd.js +0 -37
  308. package/dist/client/assets/vcsRefInvalidation-BPy1eoDi.js +0 -2
@@ -1,2 +1,2 @@
1
- import{tl as e}from"./utils-CrFJwxSd.js";var t=new Intl.NumberFormat(`en-US`,{style:`currency`,currency:`USD`,minimumFractionDigits:2,maximumFractionDigits:2}),n=new Intl.NumberFormat(`en-US`);function r(e){return t.format(e)}function i(e){return n.format(Math.round(e))}function a(e){let t=Math.abs(e);return t>=0xe8d4a51000?`${o(e/0xe8d4a51000)}T`:t>=1e9?`${o(e/1e9)}B`:t>=1e6?`${o(e/1e6)}M`:t>=1e3?`${o(e/1e3)}K`:n.format(Math.round(e))}function o(e){let t=Math.abs(e),n=t>=100?0:t>=10?1:2;return e.toFixed(n).replace(/\.0+$/,``)}function s(e,t=1){let n=e*100,r=10**-t;return n>0&&n<r?`<${r.toFixed(t)}%`:`${n.toFixed(t)}%`}function c(e,t){return t.direction===`serverBehind`?`${e} runs an older server version and is excluded from totals.`:`This client is older than the server on ${e}; its usage is excluded from totals.`}function l(e){let[t,n,r]=e.split(`-`).map(e=>Number(e));return t===void 0||n===void 0||r===void 0?e:`${[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`][n-1]??``} ${r}`}function u(e,t){let n=[],r=Date.parse(`${e}T00:00:00Z`),i=Date.parse(`${t}T00:00:00Z`);if(Number.isNaN(r)||Number.isNaN(i)||i<r)return n;for(let e=r;e<=i;e+=864e5)n.push(new Date(e).toISOString().slice(0,10));return n}var d=36e5,f=new Map;function p(e,t){if(t.timeZone===void 0)return new Intl.DateTimeFormat(e,t);let n=JSON.stringify([e,t]),r=f.get(n);return r===void 0&&(r=new Intl.DateTimeFormat(e,t),f.size>=16&&f.clear(),f.set(n,r)),r}function m(e,t){let n=[],r=Date.parse(e),i=Date.parse(t);if(Number.isNaN(r)||Number.isNaN(i)||i<=r)return n;for(let e=r;e<i;e+=d)n.push(new Date(e).toISOString());return n}function h(e,t){let n=new Date(e);if(Number.isNaN(n.getTime()))return e;let r=t===void 0?{}:{timeZone:t},i=p(`en-US`,{...r,hour:`numeric`}),a=p(`en-CA`,{...r,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,hourCycle:`h23`}),o=a.format(n);return[-36e5,d].some(e=>a.format(new Date(n.getTime()+e))===o)?p(`en-US`,{...t===void 0?{}:{timeZone:t},hour:`numeric`,timeZoneName:`short`}).format(n):i.format(n)}function g(e,t){let n=new Date(e);return Number.isNaN(n.getTime())?e:p(`en-US`,{...t===void 0?{}:{timeZone:t},month:`short`,day:`numeric`,hour:`numeric`}).format(n)}function _(e,t,n){let r=new Date(e),i=new Date(t);if(Number.isNaN(r.getTime())||Number.isNaN(i.getTime()))return g(e,n);let a=p(`en-CA`,{...n===void 0?{}:{timeZone:n},year:`numeric`,month:`2-digit`,day:`2-digit`}),o=Date.parse(`${a.format(r)}T00:00:00Z`),s=Date.parse(`${a.format(i)}T00:00:00Z`),c=Math.round((s-o)/(24*d)),l=h(e,n);return c===0?`${l} today`:c===1?`${l} yesterday`:g(e,n)}function v(t,n=new Date,r=`day`){let i=Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`,a;try{a=new Intl.DateTimeFormat(`en-CA`,{timeZone:i,year:`numeric`,month:`2-digit`,day:`2-digit`})}catch{i=`UTC`,a=new Intl.DateTimeFormat(`en-CA`,{timeZone:`UTC`,year:`numeric`,month:`2-digit`,day:`2-digit`})}let o=a.format(n);if(r===`hour`){let t=Math.floor(n.getTime()/6e4)*6e4,o=t-24*d,s=new Date(o),c=new Date(t);return{sinceDay:e.make(a.format(s)),untilDay:e.make(a.format(c)),timeZone:i,resolution:r,sinceTime:s.toISOString(),untilTime:c.toISOString()}}let[s=0,c=1,l=1]=o.split(`-`).map(e=>Number.parseInt(e,10)),u=new Date(Date.UTC(s,c-1,l-(t-1)));return{sinceDay:e.make(u.toISOString().slice(0,10)),untilDay:e.make(o),timeZone:i,resolution:r}}export{l as a,_ as c,r as d,v as f,g as i,a as l,m as n,h as o,i as r,s,u as t,c as u};
2
- //# sourceMappingURL=usageFormat-C-mTuUS7.js.map
1
+ import{nl as e}from"./utils-BoMYW9A3.js";var t=new Intl.NumberFormat(`en-US`,{style:`currency`,currency:`USD`,minimumFractionDigits:2,maximumFractionDigits:2}),n=new Intl.NumberFormat(`en-US`);function r(e){return t.format(e)}function i(e){return n.format(Math.round(e))}function a(e){let t=Math.abs(e);return t>=0xe8d4a51000?`${o(e/0xe8d4a51000)}T`:t>=1e9?`${o(e/1e9)}B`:t>=1e6?`${o(e/1e6)}M`:t>=1e3?`${o(e/1e3)}K`:n.format(Math.round(e))}function o(e){let t=Math.abs(e),n=t>=100?0:t>=10?1:2;return e.toFixed(n).replace(/\.0+$/,``)}function s(e,t=1){let n=e*100,r=10**-t;return n>0&&n<r?`<${r.toFixed(t)}%`:`${n.toFixed(t)}%`}function c(e,t){return t.direction===`serverBehind`?`${e} runs an older server version and is excluded from totals.`:`This client is older than the server on ${e}; its usage is excluded from totals.`}function l(e){let[t,n,r]=e.split(`-`).map(e=>Number(e));return t===void 0||n===void 0||r===void 0?e:`${[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`][n-1]??``} ${r}`}function u(e,t){let n=[],r=Date.parse(`${e}T00:00:00Z`),i=Date.parse(`${t}T00:00:00Z`);if(Number.isNaN(r)||Number.isNaN(i)||i<r)return n;for(let e=r;e<=i;e+=864e5)n.push(new Date(e).toISOString().slice(0,10));return n}var d=36e5,f=new Map;function p(e,t){if(t.timeZone===void 0)return new Intl.DateTimeFormat(e,t);let n=JSON.stringify([e,t]),r=f.get(n);return r===void 0&&(r=new Intl.DateTimeFormat(e,t),f.size>=16&&f.clear(),f.set(n,r)),r}function m(e,t){let n=[],r=Date.parse(e),i=Date.parse(t);if(Number.isNaN(r)||Number.isNaN(i)||i<=r)return n;for(let e=r;e<i;e+=d)n.push(new Date(e).toISOString());return n}function h(e,t){let n=new Date(e);if(Number.isNaN(n.getTime()))return e;let r=t===void 0?{}:{timeZone:t},i=p(`en-US`,{...r,hour:`numeric`}),a=p(`en-CA`,{...r,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,hourCycle:`h23`}),o=a.format(n);return[-36e5,d].some(e=>a.format(new Date(n.getTime()+e))===o)?p(`en-US`,{...t===void 0?{}:{timeZone:t},hour:`numeric`,timeZoneName:`short`}).format(n):i.format(n)}function g(e,t){let n=new Date(e);return Number.isNaN(n.getTime())?e:p(`en-US`,{...t===void 0?{}:{timeZone:t},month:`short`,day:`numeric`,hour:`numeric`}).format(n)}function _(e,t,n){let r=new Date(e),i=new Date(t);if(Number.isNaN(r.getTime())||Number.isNaN(i.getTime()))return g(e,n);let a=p(`en-CA`,{...n===void 0?{}:{timeZone:n},year:`numeric`,month:`2-digit`,day:`2-digit`}),o=Date.parse(`${a.format(r)}T00:00:00Z`),s=Date.parse(`${a.format(i)}T00:00:00Z`),c=Math.round((s-o)/(24*d)),l=h(e,n);return c===0?`${l} today`:c===1?`${l} yesterday`:g(e,n)}function v(t,n=new Date,r=`day`){let i=Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`,a;try{a=new Intl.DateTimeFormat(`en-CA`,{timeZone:i,year:`numeric`,month:`2-digit`,day:`2-digit`})}catch{i=`UTC`,a=new Intl.DateTimeFormat(`en-CA`,{timeZone:`UTC`,year:`numeric`,month:`2-digit`,day:`2-digit`})}let o=a.format(n);if(r===`hour`){let t=Math.floor(n.getTime()/6e4)*6e4,o=t-24*d,s=new Date(o),c=new Date(t);return{sinceDay:e.make(a.format(s)),untilDay:e.make(a.format(c)),timeZone:i,resolution:r,sinceTime:s.toISOString(),untilTime:c.toISOString()}}let[s=0,c=1,l=1]=o.split(`-`).map(e=>Number.parseInt(e,10)),u=new Date(Date.UTC(s,c-1,l-(t-1)));return{sinceDay:e.make(u.toISOString().slice(0,10)),untilDay:e.make(o),timeZone:i,resolution:r}}export{l as a,_ as c,r as d,v as f,g as i,a as l,m as n,h as o,i as r,s,u as t,c as u};
2
+ //# sourceMappingURL=usageFormat-Bzyvr9m4.js.map
@@ -1,2 +1,2 @@
1
- import{_ as e}from"./keybindings-BG7j7M7S.js";var t=[{value:`cost`,label:`Cost`,command:`usage.cost`},{value:`tokens`,label:`Tokens`,command:`usage.tokens`},{value:`limits`,label:`Limits`,command:`usage.limits`}],n=[{days:1,label:`Past 24h`,command:`usage.period.day`},{days:7,label:`7 days`,command:`usage.period.week`},{days:30,label:`30 days`,command:`usage.period.month`},{days:90,label:`90 days`,command:`usage.period.quarter`}];function r(t,n){let r=t.target;return r instanceof HTMLElement&&(r.tagName===`INPUT`||r.tagName===`TEXTAREA`||r.tagName===`SELECT`||r.isContentEditable||r.closest(`[role="dialog"], [aria-modal="true"], [data-slot$="popup"]`))?null:e(t,n,{context:{usagePageOpen:!0}})}export{n,r,t};
2
- //# sourceMappingURL=usageShortcuts-CB6TvooP.js.map
1
+ import{_ as e}from"./keybindings-B3oDRRkK.js";var t=[{value:`cost`,label:`Cost`,command:`usage.cost`},{value:`tokens`,label:`Tokens`,command:`usage.tokens`},{value:`limits`,label:`Limits`,command:`usage.limits`}],n=[{days:1,label:`Past 24h`,command:`usage.period.day`},{days:7,label:`7 days`,command:`usage.period.week`},{days:30,label:`30 days`,command:`usage.period.month`},{days:90,label:`90 days`,command:`usage.period.quarter`}];function r(t,n){let r=t.target;return r instanceof HTMLElement&&(r.tagName===`INPUT`||r.tagName===`TEXTAREA`||r.tagName===`SELECT`||r.isContentEditable||r.closest(`[role="dialog"], [aria-modal="true"], [data-slot$="popup"]`))?null:e(t,n,{context:{usagePageOpen:!0}})}export{n,r,t};
2
+ //# sourceMappingURL=usageShortcuts-D6nQeRtx.js.map
@@ -1,2 +1,2 @@
1
- import{a as e,t}from"./react-DH3P2YXY.js";import{n}from"./jsx-runtime-BnjsACtP.js";import{ns as r}from"./utils-CrFJwxSd.js";import{B as i}from"./runtime-Dm3Pi31_.js";var a=n(),o=e(t(),1);function s(e,t){let n=(0,a.c)(6),s=(0,o.useContext)(r),c=typeof t==`string`?t:t?.label??e.label,l=typeof t==`string`?!0:t?.reportFailure??!0,u=typeof t==`string`?!0:t?.reportDefect??!0,d;return n[0]!==e||n[1]!==c||n[2]!==s||n[3]!==u||n[4]!==l?(d=t=>i(s,e,t,{label:c,reportFailure:l,reportDefect:u}),n[0]=e,n[1]=c,n[2]=s,n[3]=u,n[4]=l,n[5]=d):d=n[5],d}export{s as t};
2
- //# sourceMappingURL=use-atom-command-BNkv9iyk.js.map
1
+ import{a as e,t}from"./react-DH3P2YXY.js";import{n}from"./jsx-runtime-BnjsACtP.js";import{ns as r}from"./utils-BoMYW9A3.js";import{B as i}from"./runtime-DR7JxgbQ.js";var a=n(),o=e(t(),1);function s(e,t){let n=(0,a.c)(6),s=(0,o.useContext)(r),c=typeof t==`string`?t:t?.label??e.label,l=typeof t==`string`?!0:t?.reportFailure??!0,u=typeof t==`string`?!0:t?.reportDefect??!0,d;return n[0]!==e||n[1]!==c||n[2]!==s||n[3]!==u||n[4]!==l?(d=t=>i(s,e,t,{label:c,reportFailure:l,reportDefect:u}),n[0]=e,n[1]=c,n[2]=s,n[3]=u,n[4]=l,n[5]=d):d=n[5],d}export{s as t};
2
+ //# sourceMappingURL=use-atom-command-DA6OG-Qk.js.map
@@ -1,2 +1,2 @@
1
- import{a as e,t}from"./react-DH3P2YXY.js";import{Va as n,ja as r}from"./utils-CrFJwxSd.js";var i=e(t());function a(e,t,a,s=!0,c){let[l,u]=i.useState(),d=r(c?`${c}-label`:void 0),f=e??t??l;return n(()=>{let n=e||t||!s?void 0:o(a.current,d);l!==n&&u(n)}),f}function o(e,t){let n=s(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function s(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}export{a as t};
2
- //# sourceMappingURL=useAriaLabelledBy-D5HM2KLM.js.map
1
+ import{a as e,t}from"./react-DH3P2YXY.js";import{Va as n,ja as r}from"./utils-BoMYW9A3.js";var i=e(t());function a(e,t,a,s=!0,c){let[l,u]=i.useState(),d=r(c?`${c}-label`:void 0),f=e??t??l;return n(()=>{let n=e||t||!s?void 0:o(a.current,d);l!==n&&u(n)}),f}function o(e,t){let n=s(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function s(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}export{a as t};
2
+ //# sourceMappingURL=useAriaLabelledBy-PLuOxvFb.js.map
@@ -1,2 +1,2 @@
1
- import{a as e,t}from"./react-DH3P2YXY.js";import{n}from"./jsx-runtime-BnjsACtP.js";import{$s as r,C as i,D as a,Dh as o,Qs as s,Zo as c,Zs as l,c as u,g as d,i as f,s as p,sl as m,ts as h}from"./utils-CrFJwxSd.js";import{L as g,R as _}from"./runtime-Dm3Pi31_.js";import{d as ee,f as te,k as v,m as ne,p as y,w as b}from"./entities-Om5Klild.js";import{in as x,it as S,pn as C}from"./runtime-BL7IF4n-.js";import{a as w,t as re}from"./useParams-D9PdK0IA.js";import{d as T}from"./toast-BcjbmUtS.js";import{s as E}from"./useSettings-BL4ZWGQV.js";import{n as D}from"./server-BvxyePeo.js";import"./queries-CXgT6mki.js";import{p as O}from"./session-logic-P8gC-UQc.js";import{a as k,i as A,n as ie,o as j}from"./threadSort-Bd2rijEy.js";import{c as M,r as N}from"./projectFilesQueryState-DXrTSOqg.js";import{r as P,t as ae}from"./uiStateStore-D9r3BNZ-.js";import{d as F,f as I,i as oe,r as se,s as ce,t as L}from"./p4ProjectFile-0RRo3hX4.js";var R=e(t(),1),z=n(),B=`[data-thread-item], [data-thread-selection-safe]`,V=3,H=160;function U(e){let t=(0,z.c)(6),[n,r]=R.useState(null),[i,a]=R.useState(e),o,s;t[0]!==e||t[1]!==n?(o=()=>{if(e){a(!0);return}if(n===null)return;if(typeof IntersectionObserver>`u`){a(!0);return}let t=n.closest(`[data-slot="scroll-area-viewport"]`),r=new IntersectionObserver(e=>{let[t]=e;return a(t?.isIntersecting===!0)},{root:t,rootMargin:`${H}px 0px`});return r.observe(n),()=>r.disconnect()},s=[e,n],t[0]=e,t[1]=n,t[2]=o,t[3]=s):(o=t[2],s=t[3]),R.useEffect(o,s);let c=e||i,l;return t[4]===c?l=t[5]:(l={leaseLiveStatus:c,rowRef:r},t[4]=c,t[5]=l),l}function W(e,t){let n=R.useRef(null);return e!==null&&t!==null&&(n.current={key:e,value:t}),t===null?e!==null&&n.current?.key===e?n.current.value:null:t}function G(e,t,n,r){let i=e.indexOf(t),a=e.indexOf(n);return i===-1||a===-1?[]:e.slice(Math.min(i,a),Math.max(i,a)+1).filter(r)}async function K(e){let t=new Set,n=null;for(let r of e.entries){let i=await e.delete(r,t);if(i!==null){if(i._tag===`Failure`){if(_(i))break;n??=i;continue}t.add(r.threadKey)}}return{deletedThreadKeys:t,firstFailure:n}}async function q(e){let t=[],n=[];for(let r of e.entries){let i=!1,a=await e.archive(r,()=>{i=!0});if((i||a._tag===`Success`)&&t.push(r.threadKey),a._tag===`Success`)continue;let o=a;if(i){n.push(o);continue}return{archivedThreadKeys:t,mutationFailure:o,followupFailures:n}}return{archivedThreadKeys:t,mutationFailure:null,followupFailures:n}}function J(e){return[{id:`mark-unread`,label:`Mark unread (${e.count})`},{id:`archive`,label:`Archive (${e.count})`,disabled:e.hasRunningThread},{id:`delete`,label:`Delete (${e.count})`,destructive:!0}]}function Y(e){return e.lineage.relationshipToParent===`subagent`}function le(e,t){let n=S(e);return e.filter(e=>e.archivedAt===null&&!Y(e)&&n(e)&&(t===null||t.has(`${e.environmentId}:${e.projectId}`)))}var ue={"Pending Approval":5,"Awaiting Input":4,Working:3,Connecting:3,Waiting:2.5,"Plan Ready":2,Completed:1};function de(e){let t=e.setTimeoutFn??globalThis.setTimeout,n=e.clearTimeoutFn??globalThis.clearTimeout,r=!1,i=null,a=()=>{i!==null&&(n(i),i=null)};return{sync:n=>{if(!n){a(),r&&(r=!1,e.onVisibilityChange(!1));return}r||i!==null||(i=t(()=>{i=null,r=!0,e.onVisibilityChange(!0)},e.delayMs))},dispose:()=>{a()}}}function fe(){let e=(0,z.c)(5),[t,n]=R.useState(!1),r=R.useRef(null),i,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{let e=de({delayMs:200,onVisibilityChange:e=>{n(e)},setTimeoutFn:window.setTimeout.bind(window),clearTimeoutFn:window.clearTimeout.bind(window)});return r.current=e,()=>{e.dispose(),r.current=null}},a=[],e[0]=i,e[1]=a):(i=e[0],a=e[1]),R.useEffect(i,a);let o;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=e=>{r.current?.sync(e)},e[2]=o):o=e[2];let s=o,c;return e[3]===t?c=e[4]:(c={showThreadJumpHints:t,updateThreadJumpHintsVisibility:s},e[3]=t,e[4]=c),c}function pe(e,t){return e===void 0?t:e??void 0}function me(e){if(!e.latestRun?.completedAt)return!1;let t=Date.parse(e.latestRun.completedAt);if(Number.isNaN(t)||!e.lastVisitedAt)return!1;let n=Date.parse(e.lastVisitedAt);return Number.isNaN(n)?!0:t>n}function he(e){return e===null||!e.closest(B)}function ge(e){return e>1}function _e(e,t){return e===null||!(`closest`in e)||typeof e.closest!=`function`?null:e.closest(t)}function ve(e){return typeof e!=`object`||!e?!1:_e(e,`a[href]`)!==null||_e(`parentElement`in e&&e.parentElement!==null&&typeof e.parentElement==`object`?e.parentElement:null,`a[href]`)!==null}function ye(e){let{getId:t,getPreferenceIds:n,items:r,preferredIds:i}=e;if(i.length===0)return[...r];let a=new Map;for(let[e,i]of r.entries()){let r=n?.(i)??[t(i)];for(let t of new Set(r)){let n=a.get(t);n?n.push(e):a.set(t,[e])}}let o=new Set,s=i.flatMap(e=>{let t=a.get(e)?.find(e=>!o.has(e));return t===void 0?[]:(o.add(t),[r[t]])}),c=r.filter((e,t)=>!o.has(t));return[...s,...c]}function be(e,t=V){return e.slice(0,Math.max(0,t))}function xe(e){let{currentThreadId:t,direction:n,threadIds:r}=e;if(r.length===0)return null;if(t===null)return n===`previous`?r.at(-1)??null:r[0]??null;let i=r.indexOf(t);return i===-1?null:n===`previous`?i>0?r[i-1]??null:null:i<r.length-1?r[i+1]??null:null}function Se(e){return e.button===2||e.isMac&&e.button===0&&e.ctrlKey}function Ce(e){return e.hasPendingApprovals||e.pendingSubagentRequest===`approval`?`approval`:e.hasPendingUserInput||e.pendingSubagentRequest===`user_input`?`input`:e.runtime!==null&&[`preparing`,`queued`,`starting`,`running`,`waiting`].includes(e.runtime.status)?`working`:e.runtime?.status===`idle`?`waiting`:e.runtime?.status===`failed`?e.runtime.lastErrorClass===`usage_limit`?`limited`:`failed`:`ready`}function we(e,t){let n=k(e,t),r=n.filter(e=>e.pinnedAt!=null);return r.length===0?n:[...A(r),...n.filter(e=>e.pinnedAt==null)]}function Te(e,t){let n=u(t);if(n.length===0)return!1;let r=u(C(e).join(` `));return n.split(` `).every(e=>r.includes(e))}function Ee(e){let{thread:t}=e;return t.hasPendingApprovals||t.pendingSubagentRequest===`approval`?{label:`Pending Approval`,colorClass:`text-amber-600 dark:text-amber-300/90`,dotClass:`bg-amber-500 dark:bg-amber-300/90`,pulse:!1}:t.hasPendingUserInput||t.pendingSubagentRequest===`user_input`?{label:`Awaiting Input`,colorClass:`text-indigo-600 dark:text-indigo-300/90`,dotClass:`bg-indigo-500 dark:bg-indigo-300/90`,pulse:!1}:t.runtime?.status===`running`||t.runtime?.status===`waiting`?{label:`Working`,colorClass:`text-sky-600 dark:text-sky-300/80`,dotClass:`bg-sky-500 dark:bg-sky-300/80`,pulse:!0}:t.runtime?.status===`preparing`||t.runtime?.status===`starting`||t.runtime?.status===`queued`?{label:`Connecting`,colorClass:`text-sky-600 dark:text-sky-300/80`,dotClass:`bg-sky-500 dark:bg-sky-300/80`,pulse:!0}:x(t.pendingBackgroundTasks??[])?{label:`Waiting`,colorClass:`text-sidebar-muted-foreground`,dotClass:`bg-sidebar-muted-foreground`,pulse:!1}:!t.hasPendingUserInput&&t.interactionMode===`plan`&&O(t.latestRun,t.runtime)&&t.hasActionableProposedPlan?{label:`Plan Ready`,colorClass:`text-violet-600 dark:text-violet-300/90`,dotClass:`bg-violet-500 dark:bg-violet-300/90`,pulse:!1}:me(t)?{label:`Completed`,colorClass:`text-emerald-600 dark:text-emerald-300/90`,dotClass:`bg-emerald-500 dark:bg-emerald-300/90`,pulse:!1}:null}function De(e){let t=null;for(let n of e)n!==null&&(t===null||ue[n.label]>ue[t.label])&&(t=n);return t}function Oe(e,t){return t.projectExpanded?t.isThreadListExpanded||e.length<=t.previewCount?e:e.slice(0,t.previewCount):[]}function ke(e){let{deletedThreadId:t,deletedThreadIds:n,sortOrder:r,threads:i}=e,a=i.find(e=>e.id===t);return a?k(i.filter(e=>e.projectId===a.projectId&&e.id!==t&&!n?.has(e.id)),r)[0]?.id??null:null}function Ae(e,t,n){return t.length>0?t.reduce((e,t)=>Math.max(e,ie(t,n)),-1/0):n===`created_at`?j(e.createdAt)??-1/0:j(e.updatedAt??e.createdAt)??-1/0}function X(e,t,n,r){return t===`manual`?[...e]:e.map(e=>({project:e,timestamp:Ae(e,n(e),t)})).sort((e,t)=>(t.timestamp===e.timestamp?0:t.timestamp>e.timestamp?1:-1)||r(e.project,t.project)).map(({project:e})=>e)}function je(e,t,n){let r=new Map;for(let e of t){let t=r.get(e.projectId)??[];t.push(e),r.set(e.projectId,t)}return X(e,n,e=>r.get(e.id)??[],(e,t)=>e.title.localeCompare(t.title)||e.id.localeCompare(t.id))}function Me(e,t,n){let r=new Map(e.flatMap(e=>e.memberProjectRefs.map(t=>[`${t.environmentId}\0${t.projectId}`,e.projectKey]))),i=new Map;for(let e of t){if(e.archivedAt!==null)continue;let t=r.get(`${e.environmentId}\0${e.projectId}`);if(!t)continue;let n=i.get(t);n?n.push(e):i.set(t,[e])}return X(e,n,e=>i.get(e.projectKey)??[],(e,t)=>e.title.localeCompare(t.title)||e.projectKey.localeCompare(t.projectKey))}function Ne(e,t,n){return Me(e,le(t,null),n)}function Pe(e,t,n){let r=(e,t)=>`${e}\u0000${t}`,i=new Map;for(let e of t){if(e.archivedAt!==null)continue;let t=r(e.environmentId,e.projectId),n=i.get(t)??[];n.push(e),i.set(t,n)}return X(e,n,e=>i.get(r(e.environmentId,e.id))??[],(e,t)=>e.title.localeCompare(t.title)||e.environmentId.localeCompare(t.environmentId)||e.id.localeCompare(t.id))}function Z(e){return e.envMode!==`local`&&e.newWorktreesStartFromOrigin}function Fe(e){return e.projectDefaultSelection??(e.carrySourceDraftId===e.destinationDraftId?null:e.carrySelection)}function Ie(e){let t=e?.activeProvider;return e?.modelSelectionExplicit===!0&&t!=null&&e.modelSelectionByProvider[t]!==void 0}function Le(e){return e.activeThread?l(e.activeThread.environmentId,e.activeThread.projectId):e.activeDraftThread?l(e.activeDraftThread.environmentId,e.activeDraftThread.projectId):e.defaultProjectRef}async function Re(e){let t=Le(e);return t?(await e.handleNewThread(t),!0):!1}async function ze(e,t){let n=await g(c,N(e,t,m),{reportDefect:!1,reportFailure:!1}),r=M(e,t,m,M(e,t,n._tag===`Success`?n.value.relativePath:m,n._tag===`Success`?n.value:null));return r===null||r.truncated?null:L(r.contents)}function Q(e){return{...e?.branch===void 0?{}:{branch:e.branch},...e?.worktreePath===void 0?{}:{worktreePath:e.worktreePath},...e?.envMode===void 0?{}:{envMode:e.envMode},...e?.startFromOrigin===void 0?{}:{startFromOrigin:e.startFromOrigin}}}function $(){let e=(0,z.c)(7),t=h(D),n=E(I),c=w(),l;e[0]===c.state.matches?l=e[1]:(l=()=>{let e=c.state.matches[c.state.matches.length-1]?.params??{};return T(e)},e[0]=c.state.matches,e[1]=l);let u=l,m;return e[2]!==t||e[3]!==u||e[4]!==n||e[5]!==c?(m=(e,l)=>{let m=te(),h=t.get(e.environmentId)?.settings??o,{getComposerDraft:g,getDraftSessionByLogicalProjectKey:_,getDraftSession:v,getDraftThread:b,applyStickyState:x,setDraftThreadContext:S,setLogicalProjectDraftThreadId:C,setModelSelection:w}=a.getState(),re=c.state.location.href,T=()=>c.state.location.href!==re,E=u(),D=E?.kind===`server`?y(E.threadRef):null,O=E?.kind===`draft`?v(E.draftId):null,k=E?g(E.kind===`server`?E.threadRef:E.draftId):null,A=k?.activeProvider??null,ie=(A?k?.modelSelectionByProvider[A]??null:null)??D?.modelSelection??null,j=k?.interactionMode??D?.interactionMode??O?.interactionMode??null,M=m.find(t=>t.id===e.projectId&&t.environmentId===e.environmentId),N=()=>T()||M!==void 0&&ee(e)===null,P=oe(h,M?.id??null,M),ae=P.settings.defaultModelSelection,F=P.settings.defaultRuntimeMode,I=e=>Fe({projectDefaultSelection:ae??null,carrySelection:ie,carrySourceDraftId:E?.kind===`draft`?E.draftId:null,destinationDraftId:e}),L=async()=>{let n=M!==void 0&&P.settings.defaultThreadEnvMode===null?await ze(M.environmentId,M.workspaceRoot):null;return se({projectSettings:oe(h,M?.id??null,M,n),workspaceRoot:M?.workspaceRoot??null,newProjectsRoot:t.get(e.environmentId)?.newProjectsRoot,projectHasThreads:ne().some(t=>t.environmentId===e.environmentId&&t.projectId===e.projectId)})},R=M?ce(M,n):r(e),z=l?.branch!==void 0,B=l?.worktreePath!==void 0,V=l?.envMode!==void 0,H=l?.startFromOrigin!==void 0,U=_(R),W=U?s(U.environmentId,U.threadId):null,G=U!==null&&U.promotedTo==null&&W!==null&&y(W)===null?U:null;W&&G===null&&i(W);let K=G&&!d(g(G.draftId))?G:null,q=E?E.kind===`server`?b(E.threadRef):v(E.draftId):null;if(K)return(async()=>{let t=E?.kind===`draft`&&E.draftId===K.draftId,n=z||B||V||H,r=null;if(n)r=Q(l);else if(!t){let e=await L();if(N())return null;let t=u(),n=t?.kind===`draft`&&t.draftId===K.draftId,i=W!==null&&y(W)!==null,a=_(R)?.draftId!==K.draftId,o=d(g(K.draftId));if(n||i||a||o)return null;r={branch:null,worktreePath:null,envMode:e,startFromOrigin:Z({envMode:e,newWorktreesStartFromOrigin:P.settings.newWorktreesStartFromOrigin})}}if(r&&S(K.draftId,{...r,...t?{}:{runtimeMode:F},...j?{interactionMode:j}:{}}),!Ie(g(K.draftId))){x(K.draftId);let e=I(K.draftId);e&&w(K.draftId,e,{replaceOptions:!0})}C(R,e,K.draftId,{threadId:K.threadId,...r,...t?{}:{runtimeMode:F},...j?{interactionMode:j}:{}});let i={draftId:K.draftId,threadId:K.threadId},a=u();return a?.kind===`draft`&&a.draftId===K.draftId||await c.navigate({to:`/draft/$draftId`,params:{draftId:K.draftId},replace:l?.replace??!1}),i})();if(q&&E?.kind===`draft`&&q.logicalProjectKey===R&&q.promotedTo==null&&!d(g(E.draftId)))return(z||B||V||H)&&S(E.draftId,Q(l)),C(R,e,E.draftId,{threadId:q.threadId,createdAt:q.createdAt,runtimeMode:q.runtimeMode,interactionMode:q.interactionMode,...Q(l)}),Promise.resolve({draftId:E.draftId,threadId:q.threadId});let J=f(),Y=p(),le=new Date().toISOString();return(async()=>{let t=l?.envMode??await L();if(N())return null;let n=_(R);if(n&&n.draftId!==U?.draftId&&y(s(n.environmentId,n.threadId))===null)return C(R,e,n.draftId,{threadId:n.threadId,createdAt:n.createdAt,runtimeMode:n.runtimeMode,interactionMode:n.interactionMode,...Q(l)}),await c.navigate({to:`/draft/$draftId`,params:{draftId:n.draftId},replace:l?.replace??!1}),{draftId:n.draftId,threadId:n.threadId};C(R,e,J,{threadId:Y,createdAt:le,branch:l?.branch??null,worktreePath:l?.worktreePath??null,envMode:t,startFromOrigin:l?.startFromOrigin??Z({envMode:t,newWorktreesStartFromOrigin:P.settings.newWorktreesStartFromOrigin}),runtimeMode:F,...j?{interactionMode:j}:{}}),x(J);let r=I(J);return r&&w(J,r,{replaceOptions:!0}),await c.navigate({to:`/draft/$draftId`,params:{draftId:J},replace:l?.replace??!1}),{draftId:J,threadId:Y}})()},e[2]=t,e[3]=u,e[4]=n,e[5]=c,e[6]=m):m=e[6],m}function Be(){let e=(0,z.c)(16),t=P(We),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={strict:!1,select:Ue},e[0]=n):n=e[0];let r=re(n),i=r?.kind===`server`?r.threadRef:null,o=r?.kind===`draft`?r.draftId:null,s=v(i),c=a(He),u;e[1]!==c||e[2]!==r?(u=()=>r?r.kind===`server`?c(r.threadRef):a.getState().getDraftSession(r.draftId):null,e[1]=c,e[2]=r,e[3]=u):u=e[3];let d=a(u),f=b(),p;e[4]!==t||e[5]!==f?(p=ye({items:f,preferredIds:t,getId:F,getPreferenceIds:Ve}),e[4]=t,e[5]=f,e[6]=p):p=e[6];let m=p,h=$(),g;e[7]===m[0]?g=e[8]:(g=m[0]?l(m[0].environmentId,m[0].id):null,e[7]=m[0],e[8]=g);let _;return e[9]!==d||e[10]!==s||e[11]!==h||e[12]!==o||e[13]!==i||e[14]!==g?(_={activeDraftThread:d,activeThread:s,defaultProjectRef:g,handleNewThread:h,routeDraftId:o,routeThreadRef:i},e[9]=d,e[10]=s,e[11]=h,e[12]=o,e[13]=i,e[14]=g,e[15]=_):_=e[15],_}function Ve(e){return[F(e),ae(e.workspaceRoot)]}function He(e){return e.getDraftThread}function Ue(e){return T(e)}function We(e){return e.projectOrder}export{W as A,Ee as C,Pe as D,je as E,fe as M,Ne as O,pe as S,Me as T,xe as _,Le as a,G as b,J as c,be as d,Se as f,Te as g,ye as h,Z as i,U as j,we as k,K as l,ge as m,$ as n,Re as o,ve as p,Ie as r,q as s,Be as t,ke as u,De as v,he as w,Ce as x,Oe as y};
2
- //# sourceMappingURL=useHandleNewThread-DntRaFvm.js.map
1
+ import{a as e,t}from"./react-DH3P2YXY.js";import{n}from"./jsx-runtime-BnjsACtP.js";import{$s as r,C as i,D as a,Oh as o,Qs as s,Zo as c,Zs as l,c as u,cl as d,g as f,i as p,s as m,ts as h}from"./utils-BoMYW9A3.js";import{L as g,R as _}from"./runtime-DR7JxgbQ.js";import{d as ee,f as te,k as v,m as ne,p as y,w as b}from"./entities-Bqo0n1Pb.js";import{in as x,it as S,pn as C}from"./runtime-d6B1vJeH.js";import{a as w,t as re}from"./useParams-DZQvRQLJ.js";import{d as T}from"./toast-B84QdqqM.js";import{s as E}from"./useSettings-CaJMqrvF.js";import{n as D}from"./server-sXApTCjZ.js";import"./queries-EslKFJTV.js";import{p as O}from"./session-logic-DkSfwnHl.js";import{a as k,i as A,n as ie,o as j}from"./threadSort-Bd2rijEy.js";import{c as M,r as N}from"./projectFilesQueryState-CanWrACx.js";import{r as P,t as ae}from"./uiStateStore-xSkh4_PU.js";import{d as F,f as I,i as oe,r as se,s as ce,t as L}from"./p4ProjectFile-qmvlbzKv.js";var R=e(t(),1),z=n(),B=`[data-thread-item], [data-thread-selection-safe]`,V=3,H=160;function U(e){let t=(0,z.c)(6),[n,r]=R.useState(null),[i,a]=R.useState(e),o,s;t[0]!==e||t[1]!==n?(o=()=>{if(e){a(!0);return}if(n===null)return;if(typeof IntersectionObserver>`u`){a(!0);return}let t=n.closest(`[data-slot="scroll-area-viewport"]`),r=new IntersectionObserver(e=>{let[t]=e;return a(t?.isIntersecting===!0)},{root:t,rootMargin:`${H}px 0px`});return r.observe(n),()=>r.disconnect()},s=[e,n],t[0]=e,t[1]=n,t[2]=o,t[3]=s):(o=t[2],s=t[3]),R.useEffect(o,s);let c=e||i,l;return t[4]===c?l=t[5]:(l={leaseLiveStatus:c,rowRef:r},t[4]=c,t[5]=l),l}function W(e,t){let n=R.useRef(null);return e!==null&&t!==null&&(n.current={key:e,value:t}),t===null?e!==null&&n.current?.key===e?n.current.value:null:t}function G(e,t,n,r){let i=e.indexOf(t),a=e.indexOf(n);return i===-1||a===-1?[]:e.slice(Math.min(i,a),Math.max(i,a)+1).filter(r)}async function K(e){let t=new Set,n=null;for(let r of e.entries){let i=await e.delete(r,t);if(i!==null){if(i._tag===`Failure`){if(_(i))break;n??=i;continue}t.add(r.threadKey)}}return{deletedThreadKeys:t,firstFailure:n}}async function q(e){let t=[],n=[];for(let r of e.entries){let i=!1,a=await e.archive(r,()=>{i=!0});if((i||a._tag===`Success`)&&t.push(r.threadKey),a._tag===`Success`)continue;let o=a;if(i){n.push(o);continue}return{archivedThreadKeys:t,mutationFailure:o,followupFailures:n}}return{archivedThreadKeys:t,mutationFailure:null,followupFailures:n}}function J(e){return[{id:`mark-unread`,label:`Mark unread (${e.count})`},{id:`archive`,label:`Archive (${e.count})`,disabled:e.hasRunningThread},{id:`delete`,label:`Delete (${e.count})`,destructive:!0}]}function Y(e){return e.lineage.relationshipToParent===`subagent`}function le(e,t){let n=S(e);return e.filter(e=>e.archivedAt===null&&!Y(e)&&n(e)&&(t===null||t.has(`${e.environmentId}:${e.projectId}`)))}var ue={"Pending Approval":5,"Awaiting Input":4,Working:3,Connecting:3,Waiting:2.5,"Plan Ready":2,Completed:1};function de(e){let t=e.setTimeoutFn??globalThis.setTimeout,n=e.clearTimeoutFn??globalThis.clearTimeout,r=!1,i=null,a=()=>{i!==null&&(n(i),i=null)};return{sync:n=>{if(!n){a(),r&&(r=!1,e.onVisibilityChange(!1));return}r||i!==null||(i=t(()=>{i=null,r=!0,e.onVisibilityChange(!0)},e.delayMs))},dispose:()=>{a()}}}function fe(){let e=(0,z.c)(5),[t,n]=R.useState(!1),r=R.useRef(null),i,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{let e=de({delayMs:200,onVisibilityChange:e=>{n(e)},setTimeoutFn:window.setTimeout.bind(window),clearTimeoutFn:window.clearTimeout.bind(window)});return r.current=e,()=>{e.dispose(),r.current=null}},a=[],e[0]=i,e[1]=a):(i=e[0],a=e[1]),R.useEffect(i,a);let o;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=e=>{r.current?.sync(e)},e[2]=o):o=e[2];let s=o,c;return e[3]===t?c=e[4]:(c={showThreadJumpHints:t,updateThreadJumpHintsVisibility:s},e[3]=t,e[4]=c),c}function pe(e,t){return e===void 0?t:e??void 0}function me(e){if(!e.latestRun?.completedAt)return!1;let t=Date.parse(e.latestRun.completedAt);if(Number.isNaN(t)||!e.lastVisitedAt)return!1;let n=Date.parse(e.lastVisitedAt);return Number.isNaN(n)?!0:t>n}function he(e){return e===null||!e.closest(B)}function ge(e){return e>1}function _e(e,t){return e===null||!(`closest`in e)||typeof e.closest!=`function`?null:e.closest(t)}function ve(e){return typeof e!=`object`||!e?!1:_e(e,`a[href]`)!==null||_e(`parentElement`in e&&e.parentElement!==null&&typeof e.parentElement==`object`?e.parentElement:null,`a[href]`)!==null}function ye(e){let{getId:t,getPreferenceIds:n,items:r,preferredIds:i}=e;if(i.length===0)return[...r];let a=new Map;for(let[e,i]of r.entries()){let r=n?.(i)??[t(i)];for(let t of new Set(r)){let n=a.get(t);n?n.push(e):a.set(t,[e])}}let o=new Set,s=i.flatMap(e=>{let t=a.get(e)?.find(e=>!o.has(e));return t===void 0?[]:(o.add(t),[r[t]])}),c=r.filter((e,t)=>!o.has(t));return[...s,...c]}function be(e,t=V){return e.slice(0,Math.max(0,t))}function xe(e){let{currentThreadId:t,direction:n,threadIds:r}=e;if(r.length===0)return null;if(t===null)return n===`previous`?r.at(-1)??null:r[0]??null;let i=r.indexOf(t);return i===-1?null:n===`previous`?i>0?r[i-1]??null:null:i<r.length-1?r[i+1]??null:null}function Se(e){return e.button===2||e.isMac&&e.button===0&&e.ctrlKey}function Ce(e){return e.hasPendingApprovals||e.pendingSubagentRequest===`approval`?`approval`:e.hasPendingUserInput||e.pendingSubagentRequest===`user_input`?`input`:e.runtime!==null&&[`preparing`,`queued`,`starting`,`running`,`waiting`].includes(e.runtime.status)?`working`:e.runtime?.status===`idle`?`waiting`:e.runtime?.status===`failed`?e.runtime.lastErrorClass===`usage_limit`?`limited`:`failed`:`ready`}function we(e,t){let n=k(e,t),r=n.filter(e=>e.pinnedAt!=null);return r.length===0?n:[...A(r),...n.filter(e=>e.pinnedAt==null)]}function Te(e,t){let n=u(t);if(n.length===0)return!1;let r=u(C(e).join(` `));return n.split(` `).every(e=>r.includes(e))}function Ee(e){let{thread:t}=e;return t.hasPendingApprovals||t.pendingSubagentRequest===`approval`?{label:`Pending Approval`,colorClass:`text-amber-600 dark:text-amber-300/90`,dotClass:`bg-amber-500 dark:bg-amber-300/90`,pulse:!1}:t.hasPendingUserInput||t.pendingSubagentRequest===`user_input`?{label:`Awaiting Input`,colorClass:`text-indigo-600 dark:text-indigo-300/90`,dotClass:`bg-indigo-500 dark:bg-indigo-300/90`,pulse:!1}:t.runtime?.status===`running`||t.runtime?.status===`waiting`?{label:`Working`,colorClass:`text-sky-600 dark:text-sky-300/80`,dotClass:`bg-sky-500 dark:bg-sky-300/80`,pulse:!0}:t.runtime?.status===`preparing`||t.runtime?.status===`starting`||t.runtime?.status===`queued`?{label:`Connecting`,colorClass:`text-sky-600 dark:text-sky-300/80`,dotClass:`bg-sky-500 dark:bg-sky-300/80`,pulse:!0}:x(t.pendingBackgroundTasks??[])?{label:`Waiting`,colorClass:`text-sidebar-muted-foreground`,dotClass:`bg-sidebar-muted-foreground`,pulse:!1}:!t.hasPendingUserInput&&t.interactionMode===`plan`&&O(t.latestRun,t.runtime)&&t.hasActionableProposedPlan?{label:`Plan Ready`,colorClass:`text-violet-600 dark:text-violet-300/90`,dotClass:`bg-violet-500 dark:bg-violet-300/90`,pulse:!1}:me(t)?{label:`Completed`,colorClass:`text-emerald-600 dark:text-emerald-300/90`,dotClass:`bg-emerald-500 dark:bg-emerald-300/90`,pulse:!1}:null}function De(e){let t=null;for(let n of e)n!==null&&(t===null||ue[n.label]>ue[t.label])&&(t=n);return t}function Oe(e,t){return t.projectExpanded?t.isThreadListExpanded||e.length<=t.previewCount?e:e.slice(0,t.previewCount):[]}function ke(e){let{deletedThreadId:t,deletedThreadIds:n,sortOrder:r,threads:i}=e,a=i.find(e=>e.id===t);return a?k(i.filter(e=>e.projectId===a.projectId&&e.id!==t&&!n?.has(e.id)),r)[0]?.id??null:null}function Ae(e,t,n){return t.length>0?t.reduce((e,t)=>Math.max(e,ie(t,n)),-1/0):n===`created_at`?j(e.createdAt)??-1/0:j(e.updatedAt??e.createdAt)??-1/0}function X(e,t,n,r){return t===`manual`?[...e]:e.map(e=>({project:e,timestamp:Ae(e,n(e),t)})).sort((e,t)=>(t.timestamp===e.timestamp?0:t.timestamp>e.timestamp?1:-1)||r(e.project,t.project)).map(({project:e})=>e)}function je(e,t,n){let r=new Map;for(let e of t){let t=r.get(e.projectId)??[];t.push(e),r.set(e.projectId,t)}return X(e,n,e=>r.get(e.id)??[],(e,t)=>e.title.localeCompare(t.title)||e.id.localeCompare(t.id))}function Me(e,t,n){let r=new Map(e.flatMap(e=>e.memberProjectRefs.map(t=>[`${t.environmentId}\0${t.projectId}`,e.projectKey]))),i=new Map;for(let e of t){if(e.archivedAt!==null)continue;let t=r.get(`${e.environmentId}\0${e.projectId}`);if(!t)continue;let n=i.get(t);n?n.push(e):i.set(t,[e])}return X(e,n,e=>i.get(e.projectKey)??[],(e,t)=>e.title.localeCompare(t.title)||e.projectKey.localeCompare(t.projectKey))}function Ne(e,t,n){return Me(e,le(t,null),n)}function Pe(e,t,n){let r=(e,t)=>`${e}\u0000${t}`,i=new Map;for(let e of t){if(e.archivedAt!==null)continue;let t=r(e.environmentId,e.projectId),n=i.get(t)??[];n.push(e),i.set(t,n)}return X(e,n,e=>i.get(r(e.environmentId,e.id))??[],(e,t)=>e.title.localeCompare(t.title)||e.environmentId.localeCompare(t.environmentId)||e.id.localeCompare(t.id))}function Z(e){return e.envMode!==`local`&&e.newWorktreesStartFromOrigin}function Fe(e){return e.projectDefaultSelection??(e.carrySourceDraftId===e.destinationDraftId?null:e.carrySelection)}function Ie(e){let t=e?.activeProvider;return e?.modelSelectionExplicit===!0&&t!=null&&e.modelSelectionByProvider[t]!==void 0}function Le(e){return e.activeThread?l(e.activeThread.environmentId,e.activeThread.projectId):e.activeDraftThread?l(e.activeDraftThread.environmentId,e.activeDraftThread.projectId):e.defaultProjectRef}async function Re(e){let t=Le(e);return t?(await e.handleNewThread(t),!0):!1}async function ze(e,t){let n=await g(c,N(e,t,d),{reportDefect:!1,reportFailure:!1}),r=M(e,t,d,M(e,t,n._tag===`Success`?n.value.relativePath:d,n._tag===`Success`?n.value:null));return r===null||r.truncated?null:L(r.contents)}function Q(e){return{...e?.branch===void 0?{}:{branch:e.branch},...e?.worktreePath===void 0?{}:{worktreePath:e.worktreePath},...e?.envMode===void 0?{}:{envMode:e.envMode},...e?.startFromOrigin===void 0?{}:{startFromOrigin:e.startFromOrigin}}}function $(){let e=(0,z.c)(7),t=h(D),n=E(I),c=w(),l;e[0]===c.state.matches?l=e[1]:(l=()=>{let e=c.state.matches[c.state.matches.length-1]?.params??{};return T(e)},e[0]=c.state.matches,e[1]=l);let u=l,d;return e[2]!==t||e[3]!==u||e[4]!==n||e[5]!==c?(d=(e,l)=>{let d=te(),h=t.get(e.environmentId)?.settings??o,{getComposerDraft:g,getDraftSessionByLogicalProjectKey:_,getDraftSession:v,getDraftThread:b,applyStickyState:x,setDraftThreadContext:S,setLogicalProjectDraftThreadId:C,setModelSelection:w}=a.getState(),re=c.state.location.href,T=()=>c.state.location.href!==re,E=u(),D=E?.kind===`server`?y(E.threadRef):null,O=E?.kind===`draft`?v(E.draftId):null,k=E?g(E.kind===`server`?E.threadRef:E.draftId):null,A=k?.activeProvider??null,ie=(A?k?.modelSelectionByProvider[A]??null:null)??D?.modelSelection??null,j=k?.interactionMode??D?.interactionMode??O?.interactionMode??null,M=d.find(t=>t.id===e.projectId&&t.environmentId===e.environmentId),N=()=>T()||M!==void 0&&ee(e)===null,P=oe(h,M?.id??null,M),ae=P.settings.defaultModelSelection,F=P.settings.defaultRuntimeMode,I=e=>Fe({projectDefaultSelection:ae??null,carrySelection:ie,carrySourceDraftId:E?.kind===`draft`?E.draftId:null,destinationDraftId:e}),L=async()=>{let n=M!==void 0&&P.settings.defaultThreadEnvMode===null?await ze(M.environmentId,M.workspaceRoot):null;return se({projectSettings:oe(h,M?.id??null,M,n),workspaceRoot:M?.workspaceRoot??null,newProjectsRoot:t.get(e.environmentId)?.newProjectsRoot,projectHasThreads:ne().some(t=>t.environmentId===e.environmentId&&t.projectId===e.projectId)})},R=M?ce(M,n):r(e),z=l?.branch!==void 0,B=l?.worktreePath!==void 0,V=l?.envMode!==void 0,H=l?.startFromOrigin!==void 0,U=_(R),W=U?s(U.environmentId,U.threadId):null,G=U!==null&&U.promotedTo==null&&W!==null&&y(W)===null?U:null;W&&G===null&&i(W);let K=G&&!f(g(G.draftId))?G:null,q=E?E.kind===`server`?b(E.threadRef):v(E.draftId):null;if(K)return(async()=>{let t=E?.kind===`draft`&&E.draftId===K.draftId,n=z||B||V||H,r=null;if(n)r=Q(l);else if(!t){let e=await L();if(N())return null;let t=u(),n=t?.kind===`draft`&&t.draftId===K.draftId,i=W!==null&&y(W)!==null,a=_(R)?.draftId!==K.draftId,o=f(g(K.draftId));if(n||i||a||o)return null;r={branch:null,worktreePath:null,envMode:e,startFromOrigin:Z({envMode:e,newWorktreesStartFromOrigin:P.settings.newWorktreesStartFromOrigin})}}if(r&&S(K.draftId,{...r,...t?{}:{runtimeMode:F},...j?{interactionMode:j}:{}}),!Ie(g(K.draftId))){x(K.draftId);let e=I(K.draftId);e&&w(K.draftId,e,{replaceOptions:!0})}C(R,e,K.draftId,{threadId:K.threadId,...r,...t?{}:{runtimeMode:F},...j?{interactionMode:j}:{}});let i={draftId:K.draftId,threadId:K.threadId},a=u();return a?.kind===`draft`&&a.draftId===K.draftId||await c.navigate({to:`/draft/$draftId`,params:{draftId:K.draftId},replace:l?.replace??!1}),i})();if(q&&E?.kind===`draft`&&q.logicalProjectKey===R&&q.promotedTo==null&&!f(g(E.draftId)))return(z||B||V||H)&&S(E.draftId,Q(l)),C(R,e,E.draftId,{threadId:q.threadId,createdAt:q.createdAt,runtimeMode:q.runtimeMode,interactionMode:q.interactionMode,...Q(l)}),Promise.resolve({draftId:E.draftId,threadId:q.threadId});let J=p(),Y=m(),le=new Date().toISOString();return(async()=>{let t=l?.envMode??await L();if(N())return null;let n=_(R);if(n&&n.draftId!==U?.draftId&&y(s(n.environmentId,n.threadId))===null)return C(R,e,n.draftId,{threadId:n.threadId,createdAt:n.createdAt,runtimeMode:n.runtimeMode,interactionMode:n.interactionMode,...Q(l)}),await c.navigate({to:`/draft/$draftId`,params:{draftId:n.draftId},replace:l?.replace??!1}),{draftId:n.draftId,threadId:n.threadId};C(R,e,J,{threadId:Y,createdAt:le,branch:l?.branch??null,worktreePath:l?.worktreePath??null,envMode:t,startFromOrigin:l?.startFromOrigin??Z({envMode:t,newWorktreesStartFromOrigin:P.settings.newWorktreesStartFromOrigin}),runtimeMode:F,...j?{interactionMode:j}:{}}),x(J);let r=I(J);return r&&w(J,r,{replaceOptions:!0}),await c.navigate({to:`/draft/$draftId`,params:{draftId:J},replace:l?.replace??!1}),{draftId:J,threadId:Y}})()},e[2]=t,e[3]=u,e[4]=n,e[5]=c,e[6]=d):d=e[6],d}function Be(){let e=(0,z.c)(16),t=P(We),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={strict:!1,select:Ue},e[0]=n):n=e[0];let r=re(n),i=r?.kind===`server`?r.threadRef:null,o=r?.kind===`draft`?r.draftId:null,s=v(i),c=a(He),u;e[1]!==c||e[2]!==r?(u=()=>r?r.kind===`server`?c(r.threadRef):a.getState().getDraftSession(r.draftId):null,e[1]=c,e[2]=r,e[3]=u):u=e[3];let d=a(u),f=b(),p;e[4]!==t||e[5]!==f?(p=ye({items:f,preferredIds:t,getId:F,getPreferenceIds:Ve}),e[4]=t,e[5]=f,e[6]=p):p=e[6];let m=p,h=$(),g;e[7]===m[0]?g=e[8]:(g=m[0]?l(m[0].environmentId,m[0].id):null,e[7]=m[0],e[8]=g);let _;return e[9]!==d||e[10]!==s||e[11]!==h||e[12]!==o||e[13]!==i||e[14]!==g?(_={activeDraftThread:d,activeThread:s,defaultProjectRef:g,handleNewThread:h,routeDraftId:o,routeThreadRef:i},e[9]=d,e[10]=s,e[11]=h,e[12]=o,e[13]=i,e[14]=g,e[15]=_):_=e[15],_}function Ve(e){return[F(e),ae(e.workspaceRoot)]}function He(e){return e.getDraftThread}function Ue(e){return T(e)}function We(e){return e.projectOrder}export{W as A,Ee as C,Pe as D,je as E,fe as M,Ne as O,pe as S,Me as T,xe as _,Le as a,G as b,J as c,be as d,Se as f,Te as g,ye as h,Z as i,U as j,we as k,K as l,ge as m,$ as n,Re as o,ve as p,Ie as r,q as s,Be as t,ke as u,De as v,he as w,Ce as x,Oe as y};
2
+ //# sourceMappingURL=useHandleNewThread-Dm0SCq59.js.map
@@ -1,2 +1,2 @@
1
- import{a as e,t}from"./react-DH3P2YXY.js";import{a as n,r,x as i}from"./useParams-D9PdK0IA.js";var a=e(t(),1);function o(e){let t=n(),o=(0,a.useRef)(void 0);return r(t.stores.location,n=>{let r=e?.select?e.select(n):n;if(e?.structuralSharing??t.options.defaultStructuralSharing){let e=i(o.current,r);return o.current=e,e}return r})}export{o as t};
2
- //# sourceMappingURL=useLocation-DbWity7H.js.map
1
+ import{a as e,t}from"./react-DH3P2YXY.js";import{a as n,r,x as i}from"./useParams-DZQvRQLJ.js";var a=e(t(),1);function o(e){let t=n(),o=(0,a.useRef)(void 0);return r(t.stores.location,n=>{let r=e?.select?e.select(n):n;if(e?.structuralSharing??t.options.defaultStructuralSharing){let e=i(o.current,r);return o.current=e,e}return r})}export{o as t};
2
+ //# sourceMappingURL=useLocation-Bqc94klS.js.map
@@ -1,2 +1,2 @@
1
- import{a as e,t}from"./react-DH3P2YXY.js";import{a as n}from"./useParams-D9PdK0IA.js";var r=e(t(),1);function i(e){let t=n();return r.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}export{i as t};
2
- //# sourceMappingURL=useNavigate-Cxh24teV.js.map
1
+ import{a as e,t}from"./react-DH3P2YXY.js";import{a as n}from"./useParams-DZQvRQLJ.js";var r=e(t(),1);function i(e){let t=n();return r.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}export{i as t};
2
+ //# sourceMappingURL=useNavigate-DdjG4MB_.js.map
@@ -1,2 +1,2 @@
1
- import{a as e,t}from"./react-DH3P2YXY.js";import{n}from"./jsx-runtime-BnjsACtP.js";import{a as r,r as i}from"./useParams-D9PdK0IA.js";import{t as a}from"./useNavigate-Cxh24teV.js";function o(){let e=r();return i(e.stores.location,e=>e.state.__TSR_index!==0)}var s=n(),c=e(t(),1);function l(){let e=(0,s.c)(3),t=a(),n=o(),r;return e[0]!==n||e[1]!==t?(r=()=>{if(n){window.history.back();return}t({to:`/`})},e[0]=n,e[1]=t,e[2]=r):r=e[2],r}function u(e){let t=(0,s.c)(3),n=l(),r=e??n,i,a;t[0]===r?(i=t[1],a=t[2]):(i=()=>{let e=e=>{if(e.defaultPrevented||e.repeat||e.isComposing||e.key!==`Escape`)return;e.preventDefault();let t=document.activeElement;t instanceof HTMLElement&&t.blur(),r()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},a=[r],t[0]=r,t[1]=i,t[2]=a),(0,c.useEffect)(i,a)}export{u as t};
2
- //# sourceMappingURL=useNavigateBack-B5mTfIHJ.js.map
1
+ import{a as e,t}from"./react-DH3P2YXY.js";import{n}from"./jsx-runtime-BnjsACtP.js";import{a as r,r as i}from"./useParams-DZQvRQLJ.js";import{t as a}from"./useNavigate-DdjG4MB_.js";function o(){let e=r();return i(e.stores.location,e=>e.state.__TSR_index!==0)}var s=n(),c=e(t(),1);function l(){let e=(0,s.c)(3),t=a(),n=o(),r;return e[0]!==n||e[1]!==t?(r=()=>{if(n){window.history.back();return}t({to:`/`})},e[0]=n,e[1]=t,e[2]=r):r=e[2],r}function u(e){let t=(0,s.c)(3),n=l(),r=e??n,i,a;t[0]===r?(i=t[1],a=t[2]):(i=()=>{let e=e=>{if(e.defaultPrevented||e.repeat||e.isComposing||e.key!==`Escape`)return;e.preventDefault();let t=document.activeElement;t instanceof HTMLElement&&t.blur(),r()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},a=[r],t[0]=r,t[1]=i,t[2]=a),(0,c.useEffect)(i,a)}export{u as t};
2
+ //# sourceMappingURL=useNavigateBack-sP0LsL3p.js.map
@@ -1,2 +1,2 @@
1
- import{n as e}from"./jsx-runtime-BnjsACtP.js";import{t}from"./env-wK1YYxA8.js";import{i as n}from"./dist-CFar2AY1.js";import{t as r}from"./authRedirect-DWE5a_T9.js";var i=e();function a(){let e=(0,i.c)(2),a=n(),o;return e[0]===a?o=e[1]:(o={authPrompt:null,openAuthPrompt:()=>{a.openSignIn(r(window.location.href,t))}},e[0]=a,e[1]=o),o}export{a as t};
2
- //# sourceMappingURL=useP4ConnectAuthPrompt-sjWWPvrn.js.map
1
+ import{n as e}from"./jsx-runtime-BnjsACtP.js";import{t}from"./env-wK1YYxA8.js";import{i as n}from"./dist-B2P3f-0Q.js";import{t as r}from"./authRedirect-DWE5a_T9.js";var i=e();function a(){let e=(0,i.c)(2),a=n(),o;return e[0]===a?o=e[1]:(o={authPrompt:null,openAuthPrompt:()=>{a.openSignIn(r(window.location.href,t))}},e[0]=a,e[1]=o),o}export{a as t};
2
+ //# sourceMappingURL=useP4ConnectAuthPrompt-C9d7n33S.js.map
@@ -1,2 +1,2 @@
1
- import{a as e,t}from"./react-DH3P2YXY.js";import{ki as n}from"./utils-CrFJwxSd.js";function r(e){return e[e.length-1]}function i(e){return typeof e==`function`}function a(e,t){return i(e)?e(t):e}var o=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable;function c(e){for(let t in e)if(o.call(e,t))return!0;return!1}var l=()=>Object.create(null),u=(e,t)=>d(e,t,l);function d(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=h(e)&&h(i);if(!a&&!(p(e)&&p(i)))return i;let s=a?e:f(e);if(!s)return i;let c=a?i:f(i);if(!c)return i;let l=s.length,u=c.length,m=a?Array(u):n(),g=0;for(let t=0;t<u;t++){let s=a?t:c[t],u=e[s],f=i[s];if(u===f){m[s]=u,(a?t<l:o.call(e,s))&&g++;continue}if(u===null||f===null||typeof u!=`object`||typeof f!=`object`){m[s]=f;continue}let p=d(u,f,n,r+1);m[s]=p,p===u&&g++}return l===u&&g===l?e:m}function f(e){let t=Object.getOwnPropertyNames(e);for(let n of t)if(!s.call(e,n))return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;let r=t;for(let t of n){if(!s.call(e,t))return!1;r.push(t)}return r}function p(e){if(!m(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!m(n)||!n.hasOwnProperty(`isPrototypeOf`))}function m(e){return Object.prototype.toString.call(e)===`[object Object]`}function h(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function g(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!g(e[r],t[r],n))return!1;return!0}if(p(e)&&p(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!g(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!g(e[o],t[o],n)))return!1;return i===a}return!1}function _(e){let t,n,r=new Promise((e,r)=>{t=e,n=r});return r.status=`pending`,r.resolve=n=>{r.status=`resolved`,r.value=n,t(n),e?.(n)},r.reject=e=>{r.status=`rejected`,n(e)},r}function v(e){return typeof e?.message==`string`?e.message.startsWith(`Failed to fetch dynamically imported module`)||e.message.startsWith(`error loading dynamically imported module`)||e.message.startsWith(`Importing a module script failed`):!1}function y(e){return!!(e&&typeof e==`object`&&typeof e.then==`function`)}function b(e){return e.replace(/[\x00-\x1f\x7f]/g,``)}function x(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return b(t)}var S=[`http:`,`https:`,`mailto:`,`tel:`];function C(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function w(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=x(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=x(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function T(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function E(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function D(){throw Error(`Invariant failed`)}var O=n(),k=e(t(),1),A=k.createContext(null);function j(e){return k.useContext(A)}var M=k.createContext(void 0),N=k.createContext(void 0);function P(e,t){return e===t}function F(e,t,n=P){let r=(0,k.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,k.useCallback)(()=>e?.get(),[e]);return(0,O.useSyncExternalStoreWithSelector)(r,i,i,t,n)}var I={get:()=>void 0,subscribe:()=>({unsubscribe:()=>{}})};function L(e){let t=j(),n=k.useContext(e.from?N:M),r=e.from??n,i=r?e.from?t.stores.getRouteMatchStore(r):t.stores.matchStores.get(r):void 0,a=k.useRef(void 0);return F(i??I,n=>{if((e.shouldThrow??!0)&&!n&&D(),n===void 0)return;let r=e.select?e.select(n):n;if(e.structuralSharing??t.options.defaultStructuralSharing){let e=d(a.current,r);return a.current=e,e}return r})}function R(e){return L({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}export{v as _,j as a,u as b,S as c,w as d,g as f,C as g,c as h,M as i,E as l,a as m,L as n,A as o,T as p,F as r,D as s,R as t,_ as u,y as v,d as x,r as y};
2
- //# sourceMappingURL=useParams-D9PdK0IA.js.map
1
+ import{a as e,t}from"./react-DH3P2YXY.js";import{ki as n}from"./utils-BoMYW9A3.js";function r(e){return e[e.length-1]}function i(e){return typeof e==`function`}function a(e,t){return i(e)?e(t):e}var o=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable;function c(e){for(let t in e)if(o.call(e,t))return!0;return!1}var l=()=>Object.create(null),u=(e,t)=>d(e,t,l);function d(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=h(e)&&h(i);if(!a&&!(p(e)&&p(i)))return i;let s=a?e:f(e);if(!s)return i;let c=a?i:f(i);if(!c)return i;let l=s.length,u=c.length,m=a?Array(u):n(),g=0;for(let t=0;t<u;t++){let s=a?t:c[t],u=e[s],f=i[s];if(u===f){m[s]=u,(a?t<l:o.call(e,s))&&g++;continue}if(u===null||f===null||typeof u!=`object`||typeof f!=`object`){m[s]=f;continue}let p=d(u,f,n,r+1);m[s]=p,p===u&&g++}return l===u&&g===l?e:m}function f(e){let t=Object.getOwnPropertyNames(e);for(let n of t)if(!s.call(e,n))return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;let r=t;for(let t of n){if(!s.call(e,t))return!1;r.push(t)}return r}function p(e){if(!m(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!m(n)||!n.hasOwnProperty(`isPrototypeOf`))}function m(e){return Object.prototype.toString.call(e)===`[object Object]`}function h(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function g(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!g(e[r],t[r],n))return!1;return!0}if(p(e)&&p(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!g(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!g(e[o],t[o],n)))return!1;return i===a}return!1}function _(e){let t,n,r=new Promise((e,r)=>{t=e,n=r});return r.status=`pending`,r.resolve=n=>{r.status=`resolved`,r.value=n,t(n),e?.(n)},r.reject=e=>{r.status=`rejected`,n(e)},r}function v(e){return typeof e?.message==`string`?e.message.startsWith(`Failed to fetch dynamically imported module`)||e.message.startsWith(`error loading dynamically imported module`)||e.message.startsWith(`Importing a module script failed`):!1}function y(e){return!!(e&&typeof e==`object`&&typeof e.then==`function`)}function b(e){return e.replace(/[\x00-\x1f\x7f]/g,``)}function x(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return b(t)}var S=[`http:`,`https:`,`mailto:`,`tel:`];function C(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function w(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=x(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=x(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function T(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function E(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function D(){throw Error(`Invariant failed`)}var O=n(),k=e(t(),1),A=k.createContext(null);function j(e){return k.useContext(A)}var M=k.createContext(void 0),N=k.createContext(void 0);function P(e,t){return e===t}function F(e,t,n=P){let r=(0,k.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,k.useCallback)(()=>e?.get(),[e]);return(0,O.useSyncExternalStoreWithSelector)(r,i,i,t,n)}var I={get:()=>void 0,subscribe:()=>({unsubscribe:()=>{}})};function L(e){let t=j(),n=k.useContext(e.from?N:M),r=e.from??n,i=r?e.from?t.stores.getRouteMatchStore(r):t.stores.matchStores.get(r):void 0,a=k.useRef(void 0);return F(i??I,n=>{if((e.shouldThrow??!0)&&!n&&D(),n===void 0)return;let r=e.select?e.select(n):n;if(e.structuralSharing??t.options.defaultStructuralSharing){let e=d(a.current,r);return a.current=e,e}return r})}function R(e){return L({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}export{v as _,j as a,u as b,S as c,w as d,g as f,C as g,c as h,M as i,E as l,a as m,L as n,A as o,T as p,F as r,D as s,R as t,_ as u,y as v,d as x,r as y};
2
+ //# sourceMappingURL=useParams-DZQvRQLJ.js.map
@@ -1,2 +1,2 @@
1
- import{a as e,t}from"./react-DH3P2YXY.js";import{n,t as r}from"./jsx-runtime-BnjsACtP.js";import{Rd as i,dr as a}from"./utils-CrFJwxSd.js";var o=n(),s=e(r(),1);function c(e){let t=(0,o.c)(7),{permissions:n,busy:r}=e,c=r!==void 0&&r,l;if(t[0]!==c||t[1]!==n){let e;t[3]===c?e=t[4]:(e=e=>(0,s.jsxs)(`div`,{className:`flex items-center gap-3 rounded-lg border px-3 py-2`,children:[e.icon,(0,s.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,s.jsx)(`p`,{className:`font-medium`,children:e.title}),(0,s.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.description})]}),e.granted?(0,s.jsxs)(`span`,{role:`status`,className:`flex items-center gap-1 text-xs text-success`,children:[(0,s.jsx)(i,{className:`size-4`,"aria-hidden":`true`}),`Allowed`]}):(0,s.jsx)(a,{size:`xs`,variant:`outline`,disabled:c,onClick:e.onAllow,children:`Allow`})]},e.id),t[3]=c,t[4]=e),l=n.map(e),t[0]=c,t[1]=n,t[2]=l}else l=t[2];let u;return t[5]===l?u=t[6]:(u=(0,s.jsx)(`div`,{className:`space-y-2`,children:l}),t[5]=l,t[6]=u),u}function l(e){let t=(0,o.c)(9),n,r,i,c;t[0]===e?(n=t[1],r=t[2],i=t[3],c=t[4]):({ready:r,busy:i,children:c,...n}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=c);let l=i!==void 0&&i,u=c===void 0?`Continue`:c,d=!r||l,f;return t[5]!==u||t[6]!==n||t[7]!==d?(f=(0,s.jsx)(a,{...n,disabled:d,children:u}),t[5]=u,t[6]=n,t[7]=d,t[8]=f):f=t[8],f}var u=e(t(),1);function d(e,t,n){let r=(0,o.c)(12),i=n===void 0||n,[a,s]=(0,u.useState)(t),[c,l]=(0,u.useState)(null),d=(0,u.useEffectEvent)(e),f;r[0]!==d||r[1]!==i?(f=()=>{if(!i)return;let e=!1,t=!1,n=async()=>{if(!(e||t||document.visibilityState===`hidden`)){t=!0;try{let t=await d();e||(s(t),l(null))}catch{e||l(`Could not check permissions. We'll try again automatically.`)}t=!1}};n();let r=window.setInterval(()=>void n(),1500);return window.addEventListener(`focus`,n),document.addEventListener(`visibilitychange`,n),()=>{e=!0,window.clearInterval(r),window.removeEventListener(`focus`,n),document.removeEventListener(`visibilitychange`,n)}},r[0]=d,r[1]=i,r[2]=f):f=r[2];let p;r[3]===i?p=r[4]:(p=[i],r[3]=i,r[4]=p),(0,u.useEffect)(f,p);let m;r[5]!==c||r[6]!==a?(m=e=>c===null&&e.every(e=>a[e]),r[5]=c,r[6]=a,r[7]=m):m=r[7];let h;return r[8]!==c||r[9]!==a||r[10]!==m?(h={status:a,error:c,isReady:m},r[8]=c,r[9]=a,r[10]=m,r[11]=h):h=r[11],h}export{c as n,l as r,d as t};
2
- //# sourceMappingURL=usePermissionStatus-D6i3IaCj.js.map
1
+ import{a as e,t}from"./react-DH3P2YXY.js";import{n,t as r}from"./jsx-runtime-BnjsACtP.js";import{dr as i,zd as a}from"./utils-BoMYW9A3.js";var o=n(),s=e(r(),1);function c(e){let t=(0,o.c)(7),{permissions:n,busy:r}=e,c=r!==void 0&&r,l;if(t[0]!==c||t[1]!==n){let e;t[3]===c?e=t[4]:(e=e=>(0,s.jsxs)(`div`,{className:`flex items-center gap-3 rounded-lg border px-3 py-2`,children:[e.icon,(0,s.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,s.jsx)(`p`,{className:`font-medium`,children:e.title}),(0,s.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.description})]}),e.granted?(0,s.jsxs)(`span`,{role:`status`,className:`flex items-center gap-1 text-xs text-success`,children:[(0,s.jsx)(a,{className:`size-4`,"aria-hidden":`true`}),`Allowed`]}):(0,s.jsx)(i,{size:`xs`,variant:`outline`,disabled:c,onClick:e.onAllow,children:`Allow`})]},e.id),t[3]=c,t[4]=e),l=n.map(e),t[0]=c,t[1]=n,t[2]=l}else l=t[2];let u;return t[5]===l?u=t[6]:(u=(0,s.jsx)(`div`,{className:`space-y-2`,children:l}),t[5]=l,t[6]=u),u}function l(e){let t=(0,o.c)(9),n,r,a,c;t[0]===e?(n=t[1],r=t[2],a=t[3],c=t[4]):({ready:r,busy:a,children:c,...n}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=a,t[4]=c);let l=a!==void 0&&a,u=c===void 0?`Continue`:c,d=!r||l,f;return t[5]!==u||t[6]!==n||t[7]!==d?(f=(0,s.jsx)(i,{...n,disabled:d,children:u}),t[5]=u,t[6]=n,t[7]=d,t[8]=f):f=t[8],f}var u=e(t(),1);function d(e,t,n){let r=(0,o.c)(12),i=n===void 0||n,[a,s]=(0,u.useState)(t),[c,l]=(0,u.useState)(null),d=(0,u.useEffectEvent)(e),f;r[0]!==d||r[1]!==i?(f=()=>{if(!i)return;let e=!1,t=!1,n=async()=>{if(!(e||t||document.visibilityState===`hidden`)){t=!0;try{let t=await d();e||(s(t),l(null))}catch{e||l(`Could not check permissions. We'll try again automatically.`)}t=!1}};n();let r=window.setInterval(()=>void n(),1500);return window.addEventListener(`focus`,n),document.addEventListener(`visibilitychange`,n),()=>{e=!0,window.clearInterval(r),window.removeEventListener(`focus`,n),document.removeEventListener(`visibilitychange`,n)}},r[0]=d,r[1]=i,r[2]=f):f=r[2];let p;r[3]===i?p=r[4]:(p=[i],r[3]=i,r[4]=p),(0,u.useEffect)(f,p);let m;r[5]!==c||r[6]!==a?(m=e=>c===null&&e.every(e=>a[e]),r[5]=c,r[6]=a,r[7]=m):m=r[7];let h;return r[8]!==c||r[9]!==a||r[10]!==m?(h={status:a,error:c,isReady:m},r[8]=c,r[9]=a,r[10]=m,r[11]=h):h=r[11],h}export{c as n,l as r,d as t};
2
+ //# sourceMappingURL=usePermissionStatus-BzfAUU9X.js.map
@@ -1,3 +1,3 @@
1
- import{a as e,t}from"./react-DH3P2YXY.js";import{n}from"./jsx-runtime-BnjsACtP.js";import{$_ as r,D as i,K_ as a,Nw as o,Os as s,Ts as c,Uc as l,Zo as u,Zs as d,bs as f,eE as p,iv as m,ts as h}from"./utils-CrFJwxSd.js";import{M as g,N as _,W as v}from"./runtime-Dm3Pi31_.js";import{a as y,i as b}from"./vcsRefInvalidation-BPy1eoDi.js";import{w as ee}from"./entities-Om5Klild.js";import{t as te}from"./runtime-BL7IF4n-.js";import{i as x}from"./toast-BcjbmUtS.js";import{O as S,f as C,s as w}from"./useSettings-BL4ZWGQV.js";import{i as T,n as E}from"./session-C7ckxjAM.js";import{n as D}from"./query-DlK0I8Jc.js";import{t as O}from"./use-atom-command-BNkv9iyk.js";import{d as k,l as A,u as j}from"./queries-CXgT6mki.js";import{t as M}from"./sourceControl-C8nJMDiL.js";import{C as N,r as P}from"./pullRequests-DT0oG7tF.js";import{R as F,b as ne,y as re}from"./pullRequestDetail.logic-BmYDDw_8.js";import{n as ie}from"./useHandleNewThread-DntRaFvm.js";import{c as ae,f as I,i as L,s as R}from"./p4ProjectFile-0RRo3hX4.js";import{t as z}from"./sidebarProjectGrouping-miDXfjI3.js";var B=e(t(),1),V=n();function H(e){return{pullRequestResolution:_(e,{label:`environment-data:git:resolve-pull-request`,tag:l.gitResolvePullRequest}),preparePullRequestThread:g(e,{label:`environment-data:git:prepare-pull-request-thread`,tag:l.gitPreparePullRequestThread,scheduler:y,concurrency:b})}}var U=H(te),W={init:`init`,pull:`pull`,publishRepository:`publish_repository`,runStackedAction:`run_change_request`,preparePullRequestThread:`prepare_pull_request_thread`};function G(e){let t=T(e.scope.environmentId,r),n=W[e.kind],i=h(A.stateAtom(e.scope)),a=i.operation===n,s=(0,B.useCallback)(()=>{A.resetError(u,e.scope,n)},[e.scope,n]),l=(0,B.useCallback)(async(...t)=>{if(e.scope.environmentId===null||!E(e.scope.environmentId,`source-control:write`))return f(o(new m({requiredScope:r,message:`This connection cannot change source control.`})));let i=async()=>{let n=await e.action(...t);return c(n)&&e.onSuccess?.(),n};return e.managedExternally===!0?i():A.track(u,e.scope,{operation:n,label:e.label},i)},[e.action,e.label,e.managedExternally,e.onSuccess,e.scope,n]);return{isAllowed:t,error:a?i.error:null,isPending:a&&i.isRunning,resetError:s,run:l}}function K(e){return e.environmentId===null||e.cwd===null?null:{environmentId:e.environmentId,cwd:e.cwd}}function q(e,t){let n=(0,V.c)(6),r;n[0]===e?r=n[1]:(r=A.stateAtom(e),n[0]=e,n[1]=r);let i=h(r),a;return n[2]!==t||n[3]!==i.isRunning||n[4]!==i.operation?(a=i.isRunning&&i.operation!==null&&t.some(e=>W[e]===i.operation),n[2]=t,n[3]=i.isRunning,n[4]=i.operation,n[5]=a):a=n[5],a}function J(e){let t=(0,V.c)(7),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=O(j.init,n),i;t[1]!==r||t[2]!==e?(i=async()=>{let t=K(e);return t===null?f(o(new k({operation:`init`,environmentId:e.environmentId,cwd:e.cwd}))):r({environmentId:t.environmentId,input:{cwd:t.cwd}})},t[1]=r,t[2]=e,t[3]=i):i=t[3];let a=i,s;return t[4]!==a||t[5]!==e?(s={kind:`init`,label:`Initializing repository`,scope:e,action:a},t[4]=a,t[5]=e,t[6]=s):s=t[6],G(s)}function oe(e){let t=(0,V.c)(11),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=O(j.pull,n),i;t[1]!==e.cwd||t[2]!==e.environmentId?(i=e.environmentId!==null&&e.cwd!==null?j.status({environmentId:e.environmentId,input:{cwd:e.cwd}}):null,t[1]=e.cwd,t[2]=e.environmentId,t[3]=i):i=t[3];let a=D(i),s;t[4]!==r||t[5]!==e?(s=async()=>{let t=K(e);return t===null?f(o(new k({operation:`pull`,environmentId:e.environmentId,cwd:e.cwd}))):r({environmentId:t.environmentId,input:{cwd:t.cwd}})},t[4]=r,t[5]=e,t[6]=s):s=t[6];let c=s,l;return t[7]!==c||t[8]!==e||t[9]!==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=A.runStackedAction(e),t[0]=e,t[1]=n);let r;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r={reportFailure:!1},t[2]=r):r=t[2];let i=O(n,r),a;t[3]!==e.cwd||t[4]!==e.environmentId?(a=e.environmentId!==null&&e.cwd!==null?j.status({environmentId:e.environmentId,input:{cwd:e.cwd}}):null,t[3]=e.cwd,t[4]=e.environmentId,t[5]=a):a=t[5];let s=D(a),c;t[6]!==i||t[7]!==e?(c=async t=>K(e)===null?f(o(new k({operation:`run_change_request`,environmentId:e.environmentId,cwd:e.cwd}))):i(t),t[6]=i,t[7]=e,t[8]=c):c=t[8];let l=c,u;return t[9]!==l||t[10]!==e||t[11]!==s.refresh?(u={kind:`runStackedAction`,label:`Running source control action`,scope:e,action:l,onSuccess:s.refresh,managedExternally:!0},t[9]=l,t[10]=e,t[11]=s.refresh,t[12]=u):u=t[12],G(u)}function ce(e){let t=(0,V.c)(11),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=O(M.publishRepository,n),i;t[1]!==e.cwd||t[2]!==e.environmentId?(i=e.environmentId!==null&&e.cwd!==null?j.status({environmentId:e.environmentId,input:{cwd:e.cwd}}):null,t[1]=e.cwd,t[2]=e.environmentId,t[3]=i):i=t[3];let a=D(i),s;t[4]!==r||t[5]!==e?(s=async t=>{let n=K(e);return n===null?f(o(new k({operation:`publish_repository`,environmentId:e.environmentId,cwd:e.cwd}))):r({environmentId:n.environmentId,input:{cwd:n.cwd,...t}})},t[4]=r,t[5]=e,t[6]=s):s=t[6];let c=s,l;return t[7]!==c||t[8]!==e||t[9]!==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?f(o(new k({operation:`prepare_pull_request_thread`,environmentId:e.environmentId,cwd:e.cwd}))):t.mode===`worktree`&&t.threadId!==void 0&&!E(n.environmentId,`orchestration:operate`)?f(o(new m({requiredScope:a,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 s=i,c;return t[4]!==s||t[5]!==e?(c={kind:`preparePullRequestThread`,label:`Preparing pull request thread`,scope:e,action:s},t[4]=s,t[5]=e,t[6]=c):c=t[6],G(c)}function X(e){return e.environmentId===null||e.cwd===null||e.reference===null?null:p(s(u.get(U.pullRequestResolution({environmentId:e.environmentId,input:{cwd:e.cwd,reference:e.reference}}))))}function le(e){let t=(0,V.c)(12),n;t[0]!==e.cwd||t[1]!==e.environmentId||t[2]!==e.reference?(n=e.environmentId!==null&&e.cwd!==null&&e.reference!==null?U.pullRequestResolution({environmentId:e.environmentId,input:{cwd:e.cwd,reference:e.reference}}):null,t[0]=e.cwd,t[1]=e.environmentId,t[2]=e.reference,t[3]=n):n=t[3];let r=D(n),i;t[4]===e?i=t[5]:(i=X(e),t[4]=e,t[5]=i);let a=i,o=r.data??a,s=r.isPending&&a===null,c;return t[6]!==r.error||t[7]!==r.isPending||t[8]!==r.refresh||t[9]!==o||t[10]!==s?(c={data:o,error:r.error,isPending:s,isFetching:r.isPending,refresh:r.refresh},t[6]=r.error,t[7]=r.isPending,t[8]=r.refresh,t[9]=o,t[10]=s,t[11]=c):c=t[11],c}function ue(e,t){let n=(0,V.c)(10),r;n[0]===t?r=n[1]:(r=e=>L(e,t).settings.pullRequestMergeMethod,n[0]=t,n[1]=r);let i=C(e,r),a=w(de),o=w(I),s=ee(),c=S(),l;return n[2]!==e||n[3]!==o||n[4]!==a||n[5]!==c||n[6]!==i||n[7]!==t||n[8]!==s?(l=()=>{if(i!=null)return i;if(Object.keys(a).length===0)return;let n=s.find(n=>n.environmentId===e&&n.id===t);if(!n)return;let r=z({projects:s,settings:o,primaryEnvironmentId:c}).get(ae(n))??R(n,o);return a[r]},n[2]=e,n[3]=o,n[4]=a,n[5]=c,n[6]=i,n[7]=t,n[8]=s,n[9]=l):l=n[9],l}function de(e){return e.pullRequestMergeMethodOverrides}var fe={merge:`Merge requested`,ready:`Marked ready for review`,draft:`Converted to draft`,close:`Pull request closed`,reopen:`Pull request reopened`,"update-branch":`Branch updated with the base branch`,"enable-auto-merge":`Auto-merge enabled`,"disable-auto-merge":`Auto-merge disabled`,revert:`Revert pull request opened`,"delete-branch":`Branch deleted`,"approve-workflows":`Workflows approved`},pe={merge:`Could not merge this pull request`,ready:`Could not mark this ready for review`,draft:`Could not convert this to a draft`,close:`Could not close this pull request`,reopen:`Could not reopen this pull request`,"update-branch":`Could not update this branch`,"enable-auto-merge":`Could not enable auto-merge`,"disable-auto-merge":`Could not disable auto-merge`,revert:`Could not open a revert pull request`,"delete-branch":`Could not delete this branch`,"approve-workflows":`Could not approve workflows`},Z={merge:`The host refused the merge. Check that you have write access, that the checks it requires have passed, and that the branch is not conflicting.`,ready:`The host refused it. Check that you have write access to this repository.`,draft:`The host refused it. Check that you have write access to this repository.`,close:`The host refused it. Check that you have write access, or that you opened it.`,reopen:`The host refused it. Check that you have write access, and that the branch still exists.`,"update-branch":`The host refused it. Check that you have write access, and that the base branch has not diverged in a way the host cannot merge.`,"enable-auto-merge":`The host refused it. Check that auto-merge is enabled for this repository and that you have write access.`,"disable-auto-merge":`The host refused it. Check that you have write access to this repository.`,revert:`The host refused it. Check that you have write access and that this pull request was merged on the host.`,"delete-branch":`The host refused it. Check that you have write access to the source repository and that the branch has not moved since this page loaded.`,"approve-workflows":`The host refused it. Check that you have Actions write access and that these workflow runs are still awaiting approval.`};function me({environmentId:e,reference:t,onSuccess:n,resolveMergeMethod:r}){let i=O(P.runAction,{reportFailure:!1}),[a,o]=(0,B.useState)(!1),s=(0,B.useRef)(!1);return{actionPending:a,perform:async(a,c)=>{if(!(s.current||t===null)){s.current=!0,o(!0);try{let o=await i({environmentId:e,input:{...t,action:a,...c?{mergeMethod:c}:r?{resolveMergeMethod:r}:{}}});if(o._tag===`Failure`)throw v(o);x.add({type:`success`,title:fe[a]}),n?.(a)}catch(e){x.add({type:`error`,title:pe[a],description:F(e,Z[a])})}finally{s.current=!1,o(!1)}}}}}function Q(e){let t=O(P.runAction,{reportFailure:!1}),n=(0,B.useRef)(new Set),[r,i]=(0,B.useState)(()=>new Set);return{close:(0,B.useCallback)(async r=>{let a=r.filter(e=>{let t=N(e);return e.state!==`open`||n.current.has(t)?!1:(n.current.add(t),!0)});if(a.length===0)return;i(new Set(n.current));let o=0,s=[];await Promise.all(a.map(async r=>{try{let n=await t({environmentId:r.environmentId,input:{projectId:r.projectId,host:r.host,repository:r.repository,number:r.number,action:`close`}});if(n._tag===`Failure`)throw v(n);o++,e(r)}catch(e){s.push(`#${r.number}: ${F(e,Z.close)}`)}finally{n.current.delete(N(r)),i(new Set(n.current))}})),x.add({type:s.length>0?`error`:`success`,title:s.length>0?`Closed ${o} of ${a.length} pull requests`:`Closed ${o} pull request${o===1?``:`s`}`,...s.length>0?{description:s.slice(0,3).join(`
2
- `)}:{}})},[e,t]),closingKeys:r}}var $=new Map;function he(e){let t=(0,V.c)(21),{environmentId:n,detail:r}=e,a=ie(),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),f;t[3]===a?f=t[4]:(f=async(e,t,n)=>{let r=n??await a(e).then(xe,be);if(r===null)return null;let o=i.getState();if(t===null)return r;let s=o.getComposerDraft(r.draftId),c=s?.reviewComments??[],l=re({prompt:s?.prompt??``,lastHandoffPrompt:$.get(r.draftId)},t.prompt);return $.set(r.draftId,t.prompt),o.setPrompt(r.draftId,l),o.setReviewComments(r.draftId,ne(c,t.reviewComments??[])),r},t[3]=a,t[4]=f);let p=f,m;t[5]!==r||t[6]!==n||t[7]!==l||t[8]!==p?(m=async(e,t)=>{if(!r||l!==null)return;u(e);let i=d(n,r.projectId),a=await p(i,t);if(u(null),a===null){x.add({type:`error`,title:`Could not open a thread`,description:`Try again from the project, or open a thread first.`});return}x.add({type:`success`,title:`Asked in a thread`,description:t.prompt.length>0?`The question is in the composer — read it over, then send.`:`The pull request is in the composer — type your question, then send.`})},t[5]=r,t[6]=n,t[7]=l,t[8]=p,t[9]=m):m=t[9];let h=m,g;t[10]!==r||t[11]!==n||t[12]!==l||t[13]!==a||t[14]!==p||t[15]!==c?(g=async(e,t,i)=>{let o=i===void 0?`worktree`:i;if(!r||l!==null)return;u(e);let s=x.add({type:`loading`,title:`Preparing the pull request checkout...`}),f=d(n,r.projectId),m=await a(f).then(ye,ve);if(m===null){u(null),x.update(s,{type:`error`,title:`Could not open a thread for the checkout`,description:`Try again from the project, or open a thread first.`});return}let h=await c.run({reference:r.url,mode:o,threadId:m.threadId});if(h._tag===`Failure`){u(null);let e=c.error instanceof Error?c.error.message:null;x.update(s,{type:`error`,title:`Could not prepare the pull request checkout`,...e?{description:e}:{}});return}if(!await a(f,{branch:h.value.branch,worktreePath:h.value.worktreePath,envMode:h.value.worktreePath===null?`local`:`worktree`}).then(_e,ge)){u(null),x.update(s,{type:`error`,title:`Checked out, but the thread stayed where it was`,description:`The checkout is ready on \`${h.value.branch}\`. Point a thread at it from the branch picker, then ask again.`});return}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.`};if(t===null){x.update(s,h.value.isOnPullRequestHead?{type:`success`,title:o===`local`?`Checked out here`:`Checked out`,description:o===`local`?`This repository is on the pull request's branch, with a thread open on it.`:`The pull request is in its own worktree, with a thread open on it.`}:g);return}await p(f,t,m),x.update(s,h.value.isOnPullRequestHead?{type:`success`,title:`Checkout ready`,description:`The task is in the composer — read it over, then send.`}:g)},t[10]=r,t[11]=n,t[12]=l,t[13]=a,t[14]=p,t[15]=c,t[16]=g):g=t[16];let _=g,v;return t[17]!==l||t[18]!==h||t[19]!==_?(v={handoff:l,startAsk:h,startHandoff:_},t[17]=l,t[18]=h,t[19]=_,t[20]=v):v=t[20],v}function ge(){return!1}function _e(e){return e!==null}function ve(){return null}function ye(e){return e}function be(){return null}function xe(e){return e}export{X as a,le as c,J as d,oe as f,he as i,q as l,Q as n,se as o,ue as r,Y as s,me as t,ce as u};
3
- //# sourceMappingURL=usePullRequestActions-9274Vp3W.js.map
1
+ import{a as e,t}from"./react-DH3P2YXY.js";import{n}from"./jsx-runtime-BnjsACtP.js";import{D as r,Os as i,Pw as a,Ts as o,Uc as s,Zo as c,Zs as l,av as u,bs as d,ev as f,q_ as p,tE as m,ts as h}from"./utils-BoMYW9A3.js";import{M as g,N as _,W as v}from"./runtime-DR7JxgbQ.js";import{a as y,i as b}from"./vcsRefInvalidation-w_CQ3i43.js";import{w as ee}from"./entities-Bqo0n1Pb.js";import{t as te}from"./runtime-d6B1vJeH.js";import{i as x}from"./toast-B84QdqqM.js";import{O as S,f as C,s as w}from"./useSettings-CaJMqrvF.js";import{i as T,n as E}from"./session-C949OsEI.js";import{n as D}from"./query-d1pQlqP0.js";import{t as O}from"./use-atom-command-DA6OG-Qk.js";import{d as k,l as A,u as j}from"./queries-EslKFJTV.js";import{t as M}from"./sourceControl-DwJWPP0h.js";import{C as N,r as P}from"./pullRequests-Bw3Ui6hK.js";import{R as F,b as ne,y as re}from"./pullRequestDetail.logic-RASi2EgP.js";import{n as ie}from"./useHandleNewThread-Dm0SCq59.js";import{c as ae,f as I,i as L,s as R}from"./p4ProjectFile-qmvlbzKv.js";import{t as z}from"./sidebarProjectGrouping-9cUrCOXH.js";var B=e(t(),1),V=n();function H(e){return{pullRequestResolution:_(e,{label:`environment-data:git:resolve-pull-request`,tag:s.gitResolvePullRequest}),preparePullRequestThread:g(e,{label:`environment-data:git:prepare-pull-request-thread`,tag:s.gitPreparePullRequestThread,scheduler:y,concurrency:b})}}var U=H(te),W={init:`init`,pull:`pull`,publishRepository:`publish_repository`,runStackedAction:`run_change_request`,preparePullRequestThread:`prepare_pull_request_thread`};function G(e){let t=T(e.scope.environmentId,f),n=W[e.kind],r=h(A.stateAtom(e.scope)),i=r.operation===n,s=(0,B.useCallback)(()=>{A.resetError(c,e.scope,n)},[e.scope,n]),l=(0,B.useCallback)(async(...t)=>{if(e.scope.environmentId===null||!E(e.scope.environmentId,`source-control:write`))return d(a(new u({requiredScope:f,message:`This connection cannot change source control.`})));let r=async()=>{let n=await e.action(...t);return o(n)&&e.onSuccess?.(),n};return e.managedExternally===!0?r():A.track(c,e.scope,{operation:n,label:e.label},r)},[e.action,e.label,e.managedExternally,e.onSuccess,e.scope,n]);return{isAllowed:t,error:i?r.error:null,isPending:i&&r.isRunning,resetError:s,run:l}}function K(e){return e.environmentId===null||e.cwd===null?null:{environmentId:e.environmentId,cwd:e.cwd}}function q(e,t){let n=(0,V.c)(6),r;n[0]===e?r=n[1]:(r=A.stateAtom(e),n[0]=e,n[1]=r);let i=h(r),a;return n[2]!==t||n[3]!==i.isRunning||n[4]!==i.operation?(a=i.isRunning&&i.operation!==null&&t.some(e=>W[e]===i.operation),n[2]=t,n[3]=i.isRunning,n[4]=i.operation,n[5]=a):a=n[5],a}function J(e){let t=(0,V.c)(7),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=O(j.init,n),i;t[1]!==r||t[2]!==e?(i=async()=>{let t=K(e);return t===null?d(a(new k({operation:`init`,environmentId:e.environmentId,cwd:e.cwd}))):r({environmentId:t.environmentId,input:{cwd:t.cwd}})},t[1]=r,t[2]=e,t[3]=i):i=t[3];let o=i,s;return t[4]!==o||t[5]!==e?(s={kind:`init`,label:`Initializing repository`,scope:e,action:o},t[4]=o,t[5]=e,t[6]=s):s=t[6],G(s)}function oe(e){let t=(0,V.c)(11),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=O(j.pull,n),i;t[1]!==e.cwd||t[2]!==e.environmentId?(i=e.environmentId!==null&&e.cwd!==null?j.status({environmentId:e.environmentId,input:{cwd:e.cwd}}):null,t[1]=e.cwd,t[2]=e.environmentId,t[3]=i):i=t[3];let o=D(i),s;t[4]!==r||t[5]!==e?(s=async()=>{let t=K(e);return t===null?d(a(new k({operation:`pull`,environmentId:e.environmentId,cwd:e.cwd}))):r({environmentId:t.environmentId,input:{cwd:t.cwd}})},t[4]=r,t[5]=e,t[6]=s):s=t[6];let c=s,l;return t[7]!==c||t[8]!==e||t[9]!==o.refresh?(l={kind:`pull`,label:`Pulling latest changes...`,scope:e,action:c,onSuccess:o.refresh},t[7]=c,t[8]=e,t[9]=o.refresh,t[10]=l):l=t[10],G(l)}function se(e){let t=(0,V.c)(13),n;t[0]===e?n=t[1]:(n=A.runStackedAction(e),t[0]=e,t[1]=n);let r;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r={reportFailure:!1},t[2]=r):r=t[2];let i=O(n,r),o;t[3]!==e.cwd||t[4]!==e.environmentId?(o=e.environmentId!==null&&e.cwd!==null?j.status({environmentId:e.environmentId,input:{cwd:e.cwd}}):null,t[3]=e.cwd,t[4]=e.environmentId,t[5]=o):o=t[5];let s=D(o),c;t[6]!==i||t[7]!==e?(c=async t=>K(e)===null?d(a(new k({operation:`run_change_request`,environmentId:e.environmentId,cwd:e.cwd}))):i(t),t[6]=i,t[7]=e,t[8]=c):c=t[8];let l=c,u;return t[9]!==l||t[10]!==e||t[11]!==s.refresh?(u={kind:`runStackedAction`,label:`Running source control action`,scope:e,action:l,onSuccess:s.refresh,managedExternally:!0},t[9]=l,t[10]=e,t[11]=s.refresh,t[12]=u):u=t[12],G(u)}function ce(e){let t=(0,V.c)(11),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=O(M.publishRepository,n),i;t[1]!==e.cwd||t[2]!==e.environmentId?(i=e.environmentId!==null&&e.cwd!==null?j.status({environmentId:e.environmentId,input:{cwd:e.cwd}}):null,t[1]=e.cwd,t[2]=e.environmentId,t[3]=i):i=t[3];let o=D(i),s;t[4]!==r||t[5]!==e?(s=async t=>{let n=K(e);return n===null?d(a(new k({operation:`publish_repository`,environmentId:e.environmentId,cwd:e.cwd}))):r({environmentId:n.environmentId,input:{cwd:n.cwd,...t}})},t[4]=r,t[5]=e,t[6]=s):s=t[6];let c=s,l;return t[7]!==c||t[8]!==e||t[9]!==o.refresh?(l={kind:`publishRepository`,label:`Publishing repository`,scope:e,action:c,onSuccess:o.refresh},t[7]=c,t[8]=e,t[9]=o.refresh,t[10]=l):l=t[10],G(l)}function Y(e){let t=(0,V.c)(7),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=O(U.preparePullRequestThread,n),i;t[1]!==r||t[2]!==e?(i=async t=>{let n=K(e);return n===null?d(a(new k({operation:`prepare_pull_request_thread`,environmentId:e.environmentId,cwd:e.cwd}))):t.mode===`worktree`&&t.threadId!==void 0&&!E(n.environmentId,`orchestration:operate`)?d(a(new u({requiredScope:p,message:`This connection cannot change threads.`}))):r({environmentId:n.environmentId,input:{cwd:n.cwd,reference:t.reference,mode:t.mode,...t.threadId?{threadId:t.threadId}:{}}})},t[1]=r,t[2]=e,t[3]=i):i=t[3];let o=i,s;return t[4]!==o||t[5]!==e?(s={kind:`preparePullRequestThread`,label:`Preparing pull request thread`,scope:e,action:o},t[4]=o,t[5]=e,t[6]=s):s=t[6],G(s)}function X(e){return e.environmentId===null||e.cwd===null||e.reference===null?null:m(i(c.get(U.pullRequestResolution({environmentId:e.environmentId,input:{cwd:e.cwd,reference:e.reference}}))))}function le(e){let t=(0,V.c)(12),n;t[0]!==e.cwd||t[1]!==e.environmentId||t[2]!==e.reference?(n=e.environmentId!==null&&e.cwd!==null&&e.reference!==null?U.pullRequestResolution({environmentId:e.environmentId,input:{cwd:e.cwd,reference:e.reference}}):null,t[0]=e.cwd,t[1]=e.environmentId,t[2]=e.reference,t[3]=n):n=t[3];let r=D(n),i;t[4]===e?i=t[5]:(i=X(e),t[4]=e,t[5]=i);let a=i,o=r.data??a,s=r.isPending&&a===null,c;return t[6]!==r.error||t[7]!==r.isPending||t[8]!==r.refresh||t[9]!==o||t[10]!==s?(c={data:o,error:r.error,isPending:s,isFetching:r.isPending,refresh:r.refresh},t[6]=r.error,t[7]=r.isPending,t[8]=r.refresh,t[9]=o,t[10]=s,t[11]=c):c=t[11],c}function ue(e,t){let n=(0,V.c)(10),r;n[0]===t?r=n[1]:(r=e=>L(e,t).settings.pullRequestMergeMethod,n[0]=t,n[1]=r);let i=C(e,r),a=w(de),o=w(I),s=ee(),c=S(),l;return n[2]!==e||n[3]!==o||n[4]!==a||n[5]!==c||n[6]!==i||n[7]!==t||n[8]!==s?(l=()=>{if(i!=null)return i;if(Object.keys(a).length===0)return;let n=s.find(n=>n.environmentId===e&&n.id===t);if(!n)return;let r=z({projects:s,settings:o,primaryEnvironmentId:c}).get(ae(n))??R(n,o);return a[r]},n[2]=e,n[3]=o,n[4]=a,n[5]=c,n[6]=i,n[7]=t,n[8]=s,n[9]=l):l=n[9],l}function de(e){return e.pullRequestMergeMethodOverrides}var fe={merge:`Merge requested`,ready:`Marked ready for review`,draft:`Converted to draft`,close:`Pull request closed`,reopen:`Pull request reopened`,"update-branch":`Branch updated with the base branch`,"enable-auto-merge":`Auto-merge enabled`,"disable-auto-merge":`Auto-merge disabled`,revert:`Revert pull request opened`,"delete-branch":`Branch deleted`,"approve-workflows":`Workflows approved`},pe={merge:`Could not merge this pull request`,ready:`Could not mark this ready for review`,draft:`Could not convert this to a draft`,close:`Could not close this pull request`,reopen:`Could not reopen this pull request`,"update-branch":`Could not update this branch`,"enable-auto-merge":`Could not enable auto-merge`,"disable-auto-merge":`Could not disable auto-merge`,revert:`Could not open a revert pull request`,"delete-branch":`Could not delete this branch`,"approve-workflows":`Could not approve workflows`},Z={merge:`The host refused the merge. Check that you have write access, that the checks it requires have passed, and that the branch is not conflicting.`,ready:`The host refused it. Check that you have write access to this repository.`,draft:`The host refused it. Check that you have write access to this repository.`,close:`The host refused it. Check that you have write access, or that you opened it.`,reopen:`The host refused it. Check that you have write access, and that the branch still exists.`,"update-branch":`The host refused it. Check that you have write access, and that the base branch has not diverged in a way the host cannot merge.`,"enable-auto-merge":`The host refused it. Check that auto-merge is enabled for this repository and that you have write access.`,"disable-auto-merge":`The host refused it. Check that you have write access to this repository.`,revert:`The host refused it. Check that you have write access and that this pull request was merged on the host.`,"delete-branch":`The host refused it. Check that you have write access to the source repository and that the branch has not moved since this page loaded.`,"approve-workflows":`The host refused it. Check that you have Actions write access and that these workflow runs are still awaiting approval.`};function me({environmentId:e,reference:t,onSuccess:n,resolveMergeMethod:r}){let i=O(P.runAction,{reportFailure:!1}),[a,o]=(0,B.useState)(!1),s=(0,B.useRef)(!1);return{actionPending:a,perform:async(a,c)=>{if(!(s.current||t===null)){s.current=!0,o(!0);try{let o=await i({environmentId:e,input:{...t,action:a,...c?{mergeMethod:c}:r?{resolveMergeMethod:r}:{}}});if(o._tag===`Failure`)throw v(o);x.add({type:`success`,title:fe[a]}),n?.(a)}catch(e){x.add({type:`error`,title:pe[a],description:F(e,Z[a])})}finally{s.current=!1,o(!1)}}}}}function Q(e){let t=O(P.runAction,{reportFailure:!1}),n=(0,B.useRef)(new Set),[r,i]=(0,B.useState)(()=>new Set);return{close:(0,B.useCallback)(async r=>{let a=r.filter(e=>{let t=N(e);return e.state!==`open`||n.current.has(t)?!1:(n.current.add(t),!0)});if(a.length===0)return;i(new Set(n.current));let o=0,s=[];await Promise.all(a.map(async r=>{try{let n=await t({environmentId:r.environmentId,input:{projectId:r.projectId,host:r.host,repository:r.repository,number:r.number,action:`close`}});if(n._tag===`Failure`)throw v(n);o++,e(r)}catch(e){s.push(`#${r.number}: ${F(e,Z.close)}`)}finally{n.current.delete(N(r)),i(new Set(n.current))}})),x.add({type:s.length>0?`error`:`success`,title:s.length>0?`Closed ${o} of ${a.length} pull requests`:`Closed ${o} pull request${o===1?``:`s`}`,...s.length>0?{description:s.slice(0,3).join(`
2
+ `)}:{}})},[e,t]),closingKeys:r}}var $=new Map;function he(e){let t=(0,V.c)(21),{environmentId:n,detail:i}=e,a=ie(),o=i?.workspaceRoot??null,s;t[0]!==n||t[1]!==o?(s={environmentId:n,cwd:o},t[0]=n,t[1]=o,t[2]=s):s=t[2];let c=Y(s),[u,d]=(0,B.useState)(null),f;t[3]===a?f=t[4]:(f=async(e,t,n)=>{let i=n??await a(e).then(xe,be);if(i===null)return null;let o=r.getState();if(t===null)return i;let s=o.getComposerDraft(i.draftId),c=s?.reviewComments??[],l=re({prompt:s?.prompt??``,lastHandoffPrompt:$.get(i.draftId)},t.prompt);return $.set(i.draftId,t.prompt),o.setPrompt(i.draftId,l),o.setReviewComments(i.draftId,ne(c,t.reviewComments??[])),i},t[3]=a,t[4]=f);let p=f,m;t[5]!==i||t[6]!==n||t[7]!==u||t[8]!==p?(m=async(e,t)=>{if(!i||u!==null)return;d(e);let r=l(n,i.projectId),a=await p(r,t);if(d(null),a===null){x.add({type:`error`,title:`Could not open a thread`,description:`Try again from the project, or open a thread first.`});return}x.add({type:`success`,title:`Asked in a thread`,description:t.prompt.length>0?`The question is in the composer — read it over, then send.`:`The pull request is in the composer — type your question, then send.`})},t[5]=i,t[6]=n,t[7]=u,t[8]=p,t[9]=m):m=t[9];let h=m,g;t[10]!==i||t[11]!==n||t[12]!==u||t[13]!==a||t[14]!==p||t[15]!==c?(g=async(e,t,r)=>{let o=r===void 0?`worktree`:r;if(!i||u!==null)return;d(e);let s=x.add({type:`loading`,title:`Preparing the pull request checkout...`}),f=l(n,i.projectId),m=await a(f).then(ye,ve);if(m===null){d(null),x.update(s,{type:`error`,title:`Could not open a thread for the checkout`,description:`Try again from the project, or open a thread first.`});return}let h=await c.run({reference:i.url,mode:o,threadId:m.threadId});if(h._tag===`Failure`){d(null);let e=c.error instanceof Error?c.error.message:null;x.update(s,{type:`error`,title:`Could not prepare the pull request checkout`,...e?{description:e}:{}});return}if(!await a(f,{branch:h.value.branch,worktreePath:h.value.worktreePath,envMode:h.value.worktreePath===null?`local`:`worktree`}).then(_e,ge)){d(null),x.update(s,{type:`error`,title:`Checked out, but the thread stayed where it was`,description:`The checkout is ready on \`${h.value.branch}\`. Point a thread at it from the branch picker, then ask again.`});return}d(null);let g={type:`warning`,title:`Checked out, but not on the latest commits`,description:`The checkout could not be moved onto the pull request's latest commits, so the code there is older than the pull request. Uncommitted work or local commits keep it where it is.`};if(t===null){x.update(s,h.value.isOnPullRequestHead?{type:`success`,title:o===`local`?`Checked out here`:`Checked out`,description:o===`local`?`This repository is on the pull request's branch, with a thread open on it.`:`The pull request is in its own worktree, with a thread open on it.`}:g);return}await p(f,t,m),x.update(s,h.value.isOnPullRequestHead?{type:`success`,title:`Checkout ready`,description:`The task is in the composer — read it over, then send.`}:g)},t[10]=i,t[11]=n,t[12]=u,t[13]=a,t[14]=p,t[15]=c,t[16]=g):g=t[16];let _=g,v;return t[17]!==u||t[18]!==h||t[19]!==_?(v={handoff:u,startAsk:h,startHandoff:_},t[17]=u,t[18]=h,t[19]=_,t[20]=v):v=t[20],v}function ge(){return!1}function _e(e){return e!==null}function ve(){return null}function ye(e){return e}function be(){return null}function xe(e){return e}export{X as a,le as c,J as d,oe as f,he as i,q as l,Q as n,se as o,ue as r,Y as s,me as t,ce as u};
3
+ //# sourceMappingURL=usePullRequestActions-DIjGLg1E.js.map
@@ -1,2 +1,2 @@
1
- import{a as e,t}from"./react-DH3P2YXY.js";import{Va as n,Vn as r}from"./utils-CrFJwxSd.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-DZyLTxKX.js.map
1
+ import{a as e,t}from"./react-DH3P2YXY.js";import{Va as n,Vn as r}from"./utils-BoMYW9A3.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-CyBVe0G0.js.map
@@ -1,2 +1,2 @@
1
- import{n as e}from"./jsx-runtime-BnjsACtP.js";import{Ht as t,Nt as n,Vt as r}from"./utils-CrFJwxSd.js";import{E as i,i as a}from"./useSettings-BL4ZWGQV.js";import{V as o}from"./settingsLayout-DFYjWgKN.js";var s=e();function c(e,c){let l=(0,s.c)(5),{targets:u}=o(),{environments:d}=i(),f;return l[0]!==c||l[1]!==d||l[2]!==e||l[3]!==u?(f=(i,o)=>{let s=c.find(e=>e.instanceId===i);for(let c of u){let l=d.find(e=>e.environmentId===c.environmentId),u=l?.serverConfig;if(!u)continue;let f=r(t(u.providers),c.settings,c.projectId).find(e=>e.instanceId===i),p=n(a(c.settings,e),u.providers).get(i);if(!f?.enabled||!f.isAvailable||f.driverKind!==s?.driverKind||!p?.some(e=>e.slug===o&&!e.isUnavailable))return`This model is unavailable on ${l?.label??`a selected environment`}. Select that environment to choose its model separately.`}return null},l[0]=c,l[1]=d,l[2]=e,l[3]=u,l[4]=f):f=l[4],f}export{c as t};
2
- //# sourceMappingURL=useScopedModelAvailability-CmlQi7Iz.js.map
1
+ import{n as e}from"./jsx-runtime-BnjsACtP.js";import{Ht as t,Nt as n,Vt as r}from"./utils-BoMYW9A3.js";import{E as i,i as a}from"./useSettings-CaJMqrvF.js";import{V as o}from"./settingsLayout-CFQx1XDM.js";var s=e();function c(e,c){let l=(0,s.c)(5),{targets:u}=o(),{environments:d}=i(),f;return l[0]!==c||l[1]!==d||l[2]!==e||l[3]!==u?(f=(i,o)=>{let s=c.find(e=>e.instanceId===i);for(let c of u){let l=d.find(e=>e.environmentId===c.environmentId),u=l?.serverConfig;if(!u)continue;let f=r(t(u.providers),c.settings,c.projectId).find(e=>e.instanceId===i),p=n(a(c.settings,e),u.providers).get(i);if(!f?.enabled||!f.isAvailable||f.driverKind!==s?.driverKind||!p?.some(e=>e.slug===o&&!e.isUnavailable))return`This model is unavailable on ${l?.label??`a selected environment`}. Select that environment to choose its model separately.`}return null},l[0]=c,l[1]=d,l[2]=e,l[3]=u,l[4]=f):f=l[4],f}export{c as t};
2
+ //# sourceMappingURL=useScopedModelAvailability-D4n22Nmm.js.map
@@ -0,0 +1,3 @@
1
+ import{a as e,t}from"./react-DH3P2YXY.js";import{n}from"./jsx-runtime-BnjsACtP.js";import{$_ as r,$b as i,CS as a,Dh as o,Dl as s,Eb as c,Gy as l,Lg as u,M_ as d,N_ as f,Nb as ee,Nc as te,Nh as ne,Oh as re,Os as ie,P_ as ae,Rh as oe,Tb as se,Th as ce,Tl as le,Ts as ue,Ub as de,Uh as fe,Vh as pe,Wb as me,Wh as he,Ws as ge,Xx as _e,Xy as ve,Yv as ye,Zb as be,Zo as xe,_T as p,_h as Se,aE as Ce,as as m,bh as we,cb as Te,d_ as Ee,eE as De,ex as Oe,hb as ke,ib as Ae,js as je,ks as Me,l_ as Ne,ns as Pe,nx as Fe,pb as Ie,ps as h,rs as Le,rx as Re,sv as ze,tE as g,ts as _,wl as Be,xS as Ve,xT as v,xb as He,xh as Ue,yT as y,yb as We}from"./utils-BoMYW9A3.js";import{At as Ge,E as Ke,I as qe,R as Je,Sn as Ye,T as Xe,W as Ze,_t as b}from"./runtime-DR7JxgbQ.js";import{T as Qe,Tt as $e,kt as et,t as tt}from"./runtime-d6B1vJeH.js";import{i as x}from"./toast-B84QdqqM.js";import{f as S,h as C,m as nt,u as rt}from"./server-sXApTCjZ.js";import{i as it,n as at,s as ot,t as st}from"./session-C949OsEI.js";import{t as ct}from"./use-atom-command-DA6OG-Qk.js";import{B as lt,C as ut,F as dt,N as ft,O as pt,P as mt,S as ht,V as gt,_ as _t,b as vt,c as yt,i as w,n as bt,o as xt,r as St,y as Ct}from"./themePalette-neUNWCzK.js";var T=e(t(),1),E=n();function wt(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 Tt(e){let t=Le(t=>m(n=>{let r=n(e.catalogValueAtom).entries.get(t);if(r===void 0)return null;let i=De(ie(n(e.stateAtom(t))),()=>Ye);return{entry:r,connection:r.unsupportedReason===void 0?et(i):{phase:`unsupported`,error:r.unsupportedReason,traceId:null},serverConfig:n(e.serverConfigValueAtom(t))}}).pipe(h(`environment-presentation:${t}`))),n=new Map;return{presentationAtom:t,presentationsAtom:m(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 wt(n,i)||(n=i),n}).pipe(h(`environment-presentations`))}}function Et(e,t){return{environmentId:e,environmentLabel:t.entry.target.label,displayUrl:$e(t.entry)??``,isRelayManaged:Ge(t.entry),isEnabled:t.entry.enabled,connectionState:t.connection.phase,connectionError:t.connection.error,connectionErrorTraceId:t.connection.traceId}}function Dt(e){let t=m(t=>{let n=[...t(e.catalogValueAtom).entries.keys()],r=g(t.self());return r!==null&&r.length===n.length&&n.every((e,t)=>e===r[t])?r:n}),n=m(t=>{let n=[...t(e.catalogValueAtom).entries].map(([e,t])=>({environmentId:e,label:t.target.label})),r=g(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=Le(t=>m(n=>{let r=n(e.presentationAtom(t));if(r===null)return null;let i=Et(t,r),a=g(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=m(t=>{let n=[];for(let i of t(e.catalogValueAtom).entries.keys()){let e=t(r(i));e!==null&&n.push(e)}let i=g(t.self());return i!==null&&i.length===n.length&&n.every((e,t)=>e===i[t])?i:n}).pipe(h(`environment-connection-summaries`));return{environmentIdsAtom:t,connectedEnvironmentIdsAtom:m(e=>{let n=e(t).filter(t=>e(r(t))?.connectionState===`connected`),i=g(e.self());return i!==null&&i.length===n.length&&n.every((e,t)=>e===i[t])?i:n}),identitiesAtom:n,environmentsAtom:i,machineByIdAtom:m(n=>{let r=new Map(n(t).map(t=>[t,s(n(e.presentationAtom(t))?.serverConfig??null)])),i=g(n.self());return i!==null&&wt(i,r)?i:r}),pullRequestsSupportedAtom:m(n=>n(t).some(t=>n(e.presentationAtom(t))?.serverConfig?.environment.capabilities.pullRequests===!0))}}var Ot=Tt({catalogValueAtom:C.catalogValueAtom,stateAtom:C.stateAtom,serverConfigValueAtom:S.configValueAtom}),kt=Dt({catalogValueAtom:C.catalogValueAtom,presentationAtom:Ot.presentationAtom}),At=m(null).pipe(h(`web-environment-presentation:empty`));function jt(e){let t=(0,E.c)(5),n=_(C.catalogValueAtom),r;t[0]===e?r=t[1]:(r=e===null?At:Ot.presentationAtom(e),t[0]=e,t[1]=r);let i=_(r),a;return t[2]!==n.isReady||t[3]!==i?(a={isReady:n.isReady,presentation:i},t[2]=n.isReady,t[3]=i,t[4]=a):a=t[4],a}var Mt={status:`idle`},D=Mt,O=null,k=[],A=0,Nt=new Set;function j(e){D=e;for(let e of Nt)e()}function Pt(e){O?.resolve(e);for(let t of k)t.resolve(e);O=null,k=[]}function Ft(){return D}function It(e){return Nt.add(e),()=>{Nt.delete(e)}}function Lt(){A+=1;let e=!0;return()=>{e&&(e=!1,A=Math.max(0,A-1),A===0&&(Pt(!1),j(Mt)))}}function Rt(e,t){if(A!==0)return new Promise(n=>{let r={message:e,variant:t?.variant??`default`,resolve:n};if(O||D.status===`closing`){k.push(r);return}O=r,j({status:`confirming`,message:e,variant:r.variant})})}function zt(){return D.status!==`idle`||O!==null||k.length>0}function Bt(e){if(D.status!==`confirming`||!O)return;let t=O;O=null,t.resolve(e),j({status:`closing`,message:D.message,variant:D.variant})}function Vt(){if(D.status!==`closing`)return;let e=k.shift();if(!e){j(Mt);return}O=e,j({status:`confirming`,message:e.message,variant:e.variant})}var Ht={Ctrl:`⌃`,Alt:`⌥`,Shift:`⇧`,Super:`⌘`,CmdOrCtrl:`⌘`};function Ut(e,t=navigator.platform){let n=e.split(`+`),r=n.pop()??``;return te(t)?`${n.map(e=>Ht[e]??e).join(``)}${r}`:[...n.map(e=>e===`CmdOrCtrl`?`Ctrl`:e===`Super`?`Meta`:e),r].join(`+`)}var Wt=`http://www.w3.org/2000/svg`,Gt={archive:[{tag:`rect`,attrs:{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`}},{tag:`path`,attrs:{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`}},{tag:`path`,attrs:{d:`M10 12h4`}}],check:[{tag:`path`,attrs:{d:`M20 6 9 17l-5-5`}}],timer:[{tag:`line`,attrs:{x1:`10`,x2:`14`,y1:`2`,y2:`2`}},{tag:`line`,attrs:{x1:`12`,x2:`15`,y1:`14`,y2:`11`}},{tag:`circle`,attrs:{cx:`12`,cy:`14`,r:`8`}}],"chevron-right":[{tag:`path`,attrs:{d:`m9 19 7-7-7-7`}}],"circle-check":[{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`10`}},{tag:`path`,attrs:{d:`m9 12 2 2 4-4`}}],clock:[{tag:`path`,attrs:{d:`M12 6v6l4 2`}},{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`10`}}],pencil:[{tag:`path`,attrs:{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`}},{tag:`path`,attrs:{d:`m15 5 4 4`}}],copy:[{tag:`rect`,attrs:{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}},{tag:`path`,attrs:{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`}}],folder:[{tag:`path`,attrs:{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`}}],"git-branch":[{tag:`line`,attrs:{x1:`6`,x2:`6`,y1:`3`,y2:`15`}},{tag:`circle`,attrs:{cx:`18`,cy:`6`,r:`3`}},{tag:`circle`,attrs:{cx:`6`,cy:`18`,r:`3`}},{tag:`path`,attrs:{d:`M18 9a9 9 0 0 1-9 9`}}],eye:[{tag:`path`,attrs:{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`}},{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`3`}}],"eye-off":[{tag:`path`,attrs:{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`}},{tag:`path`,attrs:{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`}},{tag:`path`,attrs:{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`}},{tag:`path`,attrs:{d:`m2 2 20 20`}}],"app-window":[{tag:`rect`,attrs:{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`}},{tag:`path`,attrs:{d:`M10 4v4`}},{tag:`path`,attrs:{d:`M2 8h20`}},{tag:`path`,attrs:{d:`M6 4v4`}}],"arrow-up-right":[{tag:`path`,attrs:{d:`M7 7h10v10`}},{tag:`path`,attrs:{d:`M7 17 17 7`}}],"external-link":[{tag:`path`,attrs:{d:`M15 3h6v6`}},{tag:`path`,attrs:{d:`M10 14 21 3`}},{tag:`path`,attrs:{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`}}],link:[{tag:`path`,attrs:{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`}},{tag:`path`,attrs:{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`}}],list:[{tag:`path`,attrs:{d:`M3 5h.01`}},{tag:`path`,attrs:{d:`M3 12h.01`}},{tag:`path`,attrs:{d:`M3 19h.01`}},{tag:`path`,attrs:{d:`M8 5h13`}},{tag:`path`,attrs:{d:`M8 12h13`}},{tag:`path`,attrs:{d:`M8 19h13`}}],share:[{tag:`path`,attrs:{d:`M12 2v13`}},{tag:`path`,attrs:{d:`m16 6-4-4-4 4`}},{tag:`path`,attrs:{d:`M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8`}}],x:[{tag:`path`,attrs:{d:`M18 6 6 18`}},{tag:`path`,attrs:{d:`m6 6 12 12`}}],hash:[{tag:`line`,attrs:{x1:`4`,x2:`20`,y1:`9`,y2:`9`}},{tag:`line`,attrs:{x1:`4`,x2:`20`,y1:`15`,y2:`15`}},{tag:`line`,attrs:{x1:`10`,x2:`8`,y1:`3`,y2:`21`}},{tag:`line`,attrs:{x1:`16`,x2:`14`,y1:`3`,y2:`21`}}],"mail-open":[{tag:`path`,attrs:{d:`M21.2 8.4c.5.38.8.97.8 1.6v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V10a2 2 0 0 1 .8-1.6l8-6a2 2 0 0 1 2.4 0l8 6Z`}},{tag:`path`,attrs:{d:`m22 10-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 10`}}],"message-square-plus":[{tag:`path`,attrs:{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`}},{tag:`path`,attrs:{d:`M12 8v6`}},{tag:`path`,attrs:{d:`M9 11h6`}}],pin:[{tag:`path`,attrs:{d:`M12 17v5`}},{tag:`path`,attrs:{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`}}],"pin-off":[{tag:`path`,attrs:{d:`M12 17v5`}},{tag:`path`,attrs:{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`}},{tag:`path`,attrs:{d:`m2 2 20 20`}},{tag:`path`,attrs:{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`}}],"refresh-cw":[{tag:`path`,attrs:{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`}},{tag:`path`,attrs:{d:`M21 3v5h-5`}},{tag:`path`,attrs:{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`}},{tag:`path`,attrs:{d:`M8 16H3v5`}}],settings:[{tag:`path`,attrs:{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.38a2 2 0 0 0-.73-2.73l-.15-.09a2 2 0 0 1-1-1.74v-.51a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z`}},{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`3`}}],"folder-tree":[{tag:`path`,attrs:{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`}},{tag:`path`,attrs:{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`}},{tag:`path`,attrs:{d:`M3 5a2 2 0 0 0 2 2h3`}},{tag:`path`,attrs:{d:`M3 3v13a2 2 0 0 0 2 2h3`}}],trash:[{tag:`path`,attrs:{d:`M3 6h18`}},{tag:`path`,attrs:{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`}},{tag:`path`,attrs:{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`}},{tag:`line`,attrs:{x1:`10`,x2:`10`,y1:`11`,y2:`17`}},{tag:`line`,attrs:{x1:`14`,x2:`14`,y1:`11`,y2:`17`}}]};function Kt(e,t){let n=Gt[e];if(!n||typeof document.createElementNS!=`function`)return null;let r=document.createElementNS(Wt,`svg`);r.setAttribute(`xmlns`,Wt),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(Wt,e.tag);for(let[n,r]of Object.entries(e.attrs))t.setAttribute(n,r);r.appendChild(t)}return r}function qt(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 Jt(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 M=null;function Yt(){return M!==null}function Xt(){M?.(),M=null}function Zt(e,t){return new Promise(n=>{let r=document.activeElement instanceof HTMLElement?document.activeElement:null,i=[],a=[],o=!1,s=!1,c=()=>l(null),l=e=>{if(o)return;o=!0,M===c&&(M=null),document.removeEventListener(`keydown`,u),document.removeEventListener(`pointerdown`,d,!0),document.removeEventListener(`contextmenu`,f,!0);let t=Jt(document.activeElement,i);for(let e of i)e.remove();t&&r?.isConnected&&r.focus({preventScroll:!0}),n(e)},u=e=>{e.key===`Escape`&&(e.preventDefault(),l(null))},d=e=>{s&&!Jt(e.target,i)&&l(null)},f=e=>{s&&!Jt(e.target,i)&&(e.preventDefault(),l(null))},ee=e=>{for(;i.length>e;)a.pop()?.setAttribute(`aria-expanded`,`false`),i.pop()?.remove()},ne=(e,t,n,r,o)=>{ee(r);let c=document.createElement(`div`);c.className=`dropdown-glass fixed z-[10000] min-w-56 max-w-sm overflow-hidden rounded-lg bg-clip-padding text-popover-foreground outline-none`,c.style.cssText=`position:fixed;z-index:10000;min-width:14rem;max-width:24rem;overflow:hidden;border-radius:var(--radius-lg);background-clip:padding-box;color:var(--contrast-popover-foreground);outline:none;pointer-events:auto;`,c.style.left=`${t}px`,c.style.top=`${n}px`,c.dataset.level=String(r);let u=document.createElement(`div`);u.className=`max-h-[calc(100vh-0.5rem)] min-w-0 max-w-sm overflow-y-auto overflow-x-hidden p-1`,u.style.cssText=`max-height:calc(100vh - 0.5rem);min-width:0;max-width:24rem;overflow-x:hidden;overflow-y:auto;padding:0.25rem;`;for(let t of e){if(t.separatorBefore===!0&&u.children.length>0){let e=document.createElement(`div`);e.className=`mx-2 my-1 h-px bg-border`,e.style.cssText=`height:1px;margin:0.25rem 0.5rem;background:var(--contrast-border);`,e.dataset.contextMenuSeparator=`true`,e.setAttribute(`role`,`separator`),u.appendChild(e)}if(t.header===!0){let e=document.createElement(`div`);e.className=`px-2 py-1.5 font-medium text-muted-foreground text-xs`,e.textContent=t.label,u.appendChild(e);continue}let e=Array.isArray(t.children)&&t.children.length>0,n=!e&&(t.destructive===!0||t.id===`delete`),a=document.createElement(`button`);a.type=`button`;let o=t.disabled===!0;a.disabled=o;let c=`flex w-full cursor-default select-none items-center gap-2 rounded-sm px-2 py-1 text-left outline-none transition-colors sm:min-h-7 sm:text-sm min-h-8 text-base`;if(a.className=o?`${c} pointer-events-none cursor-not-allowed text-muted-foreground opacity-64`:n?`${c} text-destructive-foreground hover:bg-destructive/10 hover:text-destructive-foreground`:`${c} text-foreground hover:bg-accent hover:text-accent-foreground`,a.style.cssText=`display:flex;width:100%;min-height:1.75rem;align-items:center;gap:0.5rem;border:0;border-radius:var(--radius-sm);background:transparent;padding:0.25rem 0.5rem;color:var(--contrast-foreground);font-family:var(--font-sans,system-ui,sans-serif);font-size:0.875rem;line-height:1.25rem;text-align:left;cursor:default;`,n&&(a.style.color=`var(--destructive-foreground)`),o&&(a.style.color=`var(--contrast-muted-foreground)`,a.style.opacity=`0.64`,a.style.pointerEvents=`none`),typeof t.checked==`boolean`){a.setAttribute(`role`,`menuitemradio`),a.setAttribute(`aria-checked`,t.checked?`true`:`false`);let e=t.checked?Kt(`check`,`neutral`):null;if(e)a.appendChild(e);else{let e=document.createElement(`span`);e.className=`size-4.5 shrink-0 sm:size-4`,e.style.cssText=`display:inline-block;width:1rem;height:1rem;flex-shrink:0;`,e.setAttribute(`aria-hidden`,`true`),a.appendChild(e)}}else if(typeof t.icon==`string`){let e=Kt(t.icon,n?`destructive`:`neutral`);e&&a.appendChild(e)}let d=document.createElement(`span`);if(d.className=`min-w-0 flex-1 truncate`,d.textContent=t.label,a.appendChild(d),typeof t.accelerator==`string`){let e=document.createElement(`span`);e.className=`ms-6 shrink-0 text-muted-foreground text-xs tracking-widest`,e.style.cssText=`margin-inline-start:1.5rem;flex-shrink:0;color:var(--contrast-muted-foreground);font-size:0.75rem;letter-spacing:0.1em;`,e.textContent=Ut(t.accelerator),e.setAttribute(`aria-hidden`,`true`),a.setAttribute(`aria-keyshortcuts`,t.accelerator.replace(`CmdOrCtrl`,te(navigator.platform)?`Meta`:`Control`)),a.appendChild(e)}if(e){a.setAttribute(`aria-haspopup`,`menu`),a.setAttribute(`aria-expanded`,`false`);let e=Kt(`chevron-right`,`neutral`);e&&(e.setAttribute(`class`,`-me-0.5 ms-auto size-4.5 shrink-0 text-muted-foreground opacity-80 sm:size-4`),e.setAttribute(`aria-hidden`,`true`),e.dataset.contextMenuChevron=`true`,a.appendChild(e))}if(!o){let o=!1,c=!1,u=()=>{let e=o||c;a.style.background=e?n?`color-mix(in srgb, var(--destructive) 10%, transparent)`:`var(--accent)`:`transparent`,a.style.color=e?n?`var(--destructive-foreground)`:`var(--contrast-accent-foreground)`:n?`var(--destructive-foreground)`:`var(--contrast-foreground)`};if(a.addEventListener(`mouseenter`,()=>{a.focus({preventScroll:!0}),o=!0,u()}),a.addEventListener(`mouseleave`,()=>{o=!1,u()}),a.addEventListener(`focus`,()=>{c=!0,u()}),a.addEventListener(`blur`,()=>{c=!1,u()}),e){let e=(e=!1)=>{let n=a.getBoundingClientRect(),o=n.right+4,s=n.top;ne(t.children,o,s,r+1,a),a.setAttribute(`aria-expanded`,`true`);let c=i[r+1];if(!c)return;let l=c.getBoundingClientRect();l.right>window.innerWidth&&qt(c,n.left-l.width-4,n.top),e&&[...c.querySelectorAll(`button`)].find(e=>!e.disabled)?.focus()};a.addEventListener(`mouseenter`,()=>{e()}),a.addEventListener(`click`,t=>{t.preventDefault(),e(!0)})}else a.addEventListener(`mouseenter`,()=>{ee(r+1)}),a.addEventListener(`click`,()=>{s&&l(t.id)})}u.appendChild(a)}c.appendChild(u),c.addEventListener(`mouseenter`,()=>{ee(r+1)}),document.body.appendChild(c),i[r]=c,a[r]=o,requestAnimationFrame(()=>{qt(c,t,n)})};document.addEventListener(`keydown`,u),document.addEventListener(`pointerdown`,d,!0),document.addEventListener(`contextmenu`,f,!0),ne(e,t?.x??0,t?.y??0,0),M&&M(),M=c,requestAnimationFrame(()=>{s=!0})})}var Qt=`p4code:client-settings:v1`;function $t(){return typeof window<`u`}function en(){return $t()?Me(Qt,Se):null}function tn(e){$t()&&je(Qt,e,Se)}var nn;function rn(){return{dialogs:{pickFolder:async e=>window.desktopBridge?window.desktopBridge.pickFolder(e):null,confirm:async(e,t)=>Rt(e,t)??!1},shell:{openExternal:async e=>{if(window.desktopBridge){if(!await window.desktopBridge.openExternal(e))throw Error(`Unable to open link.`);return}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):Zt(e,t),close:async()=>{window.desktopBridge||Xt()}},persistence:{getClientSettings:async()=>window.desktopBridge?window.desktopBridge.getClientSettings():en(),setClientSettings:async e=>{if(window.desktopBridge)return window.desktopBridge.setClientSettings(e);tn(e)}}}}function an(){return rn()}function on(){if(typeof window<`u`)return nn||(nn=an(),nn)}function sn(){let e=on();if(!e)throw Error(`Local API not found`);return e}var N=`p4code:theme`,cn=`(prefers-color-scheme: dark)`,P={theme:`system`,resolvedTheme:`light`,systemDark:!1,followSystem:!0,appearanceMode:`system`,themeHalves:null};function ln(){return F()}function un(){return typeof window>`u`?{}:dn()}function F(){if(typeof window>`u`)return null;try{return pt(window.localStorage.getItem(w))}catch{return null}}function dn(){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 fn(e){return`${e?.light??``}|${e?.dark??``}`}var pn=`theme-color`,mn=`meta[name="${pn}"][data-dynamic-theme-color="true"]`,I=class extends Te()(`ThemeStorageError`,{operation:ve([`read`,`write`]),storageKey:Ae,theme:ee(xt),cause:l()}){get message(){return`Failed to ${this.operation} theme preference for ${this.storageKey}.`}},hn=c(I),gn=class extends Te()(`DesktopThemeSyncError`,{theme:xt,cause:l()}){get message(){return`Failed to sync the ${this.theme} theme to the desktop shell.`}},_n=c(gn),L=[],R=null,vn=!0,yn=null,z=null,B=null;function V(){vn=!0;for(let e of L)e()}function bn(){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(cn).matches}function xn(e){if(typeof window>`u`)return e===`system`;try{let e=window.localStorage.getItem(St);if(e===`true`)return!0;if(e===`false`)return!1}catch{}return e===`system`}function Sn(e){return e===`light`||e===`dark`||e===`system`}function H(e){if(typeof window<`u`)try{let e=window.localStorage.getItem(bt);if(Sn(e))return e}catch{}return xn(e)?`system`:Ct(e)??`light`}function Cn(e){if(typeof window<`u`)try{window.localStorage.setItem(bt,e)}catch(e){throw new I({operation:`write`,storageKey:bt,cause:e})}}function wn(){if(typeof window>`u`)return P.theme;let e;try{e=window.localStorage.getItem(N)}catch(e){throw new I({operation:`read`,storageKey:N,cause:e})}return e!==null&&ut(e)?e:P.theme}function Tn(e){if(typeof window<`u`)try{window.localStorage.setItem(N,e),B=null}catch(t){throw new I({operation:`write`,storageKey:N,theme:e,cause:t})}}function U(){if(B!==null)return P.theme;try{return wn()}catch(e){let t=hn(e)?e:new I({operation:`read`,storageKey:N,cause:e});return B=t,console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...b(t)}),P.theme}}function En(){let e=document.querySelector(mn);return e||(e=document.createElement(`meta`),e.name=pn,e.setAttribute(`data-dynamic-theme-color`,`true`),document.head.append(e),e)}function Dn(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 On(){return document.querySelector(`main[data-slot='sidebar-inset']`)??document.querySelector(`[data-slot='sidebar-inner']`)??document.body}function kn(){if(typeof document>`u`||typeof getComputedStyle>`u`)return;let e=getComputedStyle(document.documentElement),t=document.documentElement.dataset.themeId?Dn(e.getPropertyValue(`--app-chrome-background`)):null,n=Dn(getComputedStyle(On()).backgroundColor),r=Dn(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="${pn}"]`);if(a.length===0){En().setAttribute(`content`,i);return}for(let e of a)e.setAttribute(`content`,i)}function W(e,{suppressTransitions:t=!1,preservePreview:n=!0}={}){if(typeof document>`u`||typeof window>`u`||n&&document.documentElement.dataset?.themeId===`__preview`)return;let r=H(e),i=r===`system`,a=i?bn():!1,o=F();if(z?.theme===e&&z.systemDark===a&&z.followSystem===i&&z.appearanceMode===r&&fn(z.themeHalves)===fn(o)){jn(e,i,r);return}t&&document.documentElement.classList.add(`no-transitions`);let s=mt(e,a,i,r,o);yt(dt(e,o,s),s),document.documentElement.classList.toggle(`dark`,s===`dark`),z={theme:e,systemDark:a,followSystem:i,appearanceMode:r,themeHalves:o},kn(),jn(e,i,r),t&&(document.documentElement.offsetHeight,requestAnimationFrame(()=>{document.documentElement.classList.remove(`no-transitions`)}))}async function An(e,t,n,r,i=F()){try{await e.setTheme(ft(t,n,r,i))}catch(e){throw new gn({theme:t,cause:e})}}function jn(e,t,n){if(typeof window>`u`)return;let r=window.desktopBridge,i=F(),a=ft(e,t,n,i);r&&typeof r.setTheme==`function`&&yn!==a&&(yn=a,An(r,e,t,n,i).catch(t=>{let n=_n(t)?t:new gn({theme:e,cause:t});console.error(n.message,{theme:n.theme,...b(n)}),yn===a&&(yn=null)}))}typeof document<`u`&&typeof window<`u`&&W(U());function Mn(){if(typeof window>`u`)return P;if(!vn&&R)return R;vn=!1;let e=U(),t=H(e),n=t===`system`,r=n?bn():!1,i=F(),a=mt(e,r,n,t,i);return R&&R.theme===e&&R.resolvedTheme===a&&R.systemDark===r&&R.followSystem===n&&R.appearanceMode===t&&fn(R.themeHalves)===fn(i)||(R={theme:e,resolvedTheme:a,systemDark:r,followSystem:n,appearanceMode:t,themeHalves:i}),R}function Nn(){return P}function Pn(){let e=U();H(e)===`system`&&W(e,{suppressTransitions:!0}),V()}function Fn(e){e.key===N?(B=null,W(U(),{suppressTransitions:!0}),V()):e.key===`p4code:theme-follow-system`||e.key===`p4code:theme-appearance-mode`||e.key===`p4code:theme-halves:v1`?(W(U(),{suppressTransitions:!0}),V()):(e.key===`p4code:themes:v1`||e.key===null)&&(e.key===null&&(B=null),ht(),z=null,W(U(),{suppressTransitions:!0}),V())}var In=null;function Ln(e){if(typeof window>`u`)return()=>{};if(L.push(e),!In){let e=typeof window.matchMedia==`function`?window.matchMedia(cn):null;e?.addEventListener(`change`,Pn),window.addEventListener(`storage`,Fn),In=()=>{e?.removeEventListener(`change`,Pn),window.removeEventListener(`storage`,Fn)}}return()=>{L=L.filter(t=>t!==e),L.length===0&&(In?.(),In=null)}}function Rn(){let e=(0,T.useSyncExternalStore)(Ln,Mn,Nn),{theme:t,resolvedTheme:n}=e,r=(0,T.useCallback)(e=>{if(typeof window>`u`)return!1;try{Cn(H(U()));let t=window.localStorage.getItem(w);window.localStorage.removeItem(w);try{Tn(e)}catch(e){if(t!==null)try{window.localStorage.setItem(w,t)}catch{}throw e}}catch(t){let n=hn(t)?t:new I({operation:`write`,storageKey:N,theme:e,cause:t});return console.error(n.message,{operation:n.operation,storageKey:n.storageKey,theme:e,...b(n)}),!1}return W(e,{suppressTransitions:!0}),V(),!0},[]),i=(0,T.useCallback)(e=>{if(typeof window>`u`)return!1;try{Cn(e)}catch(e){let t=hn(e)?e:new I({operation:`write`,storageKey:bt,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...b(t)}),!1}return B=null,W(U(),{suppressTransitions:!0}),V(),!0},[]),a=(0,T.useCallback)(e=>{let n=H(t),r=e?`system`:n===`system`?Ct(t)??`light`:n;return i(r)},[i,t]),o=(0,T.useCallback)((e,t)=>{if(typeof window>`u`)return!1;try{let n={...dn()};t===null?delete n[e]:n[e]=t,n.light===void 0&&n.dark===void 0?window.localStorage.removeItem(w):window.localStorage.setItem(w,JSON.stringify(n))}catch(e){let t=new I({operation:`write`,storageKey:w,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...b(t)}),!1}return W(U(),{suppressTransitions:!0}),V(),!0},[]),s=(0,T.useCallback)(()=>{if(typeof window>`u`)return!1;try{window.localStorage.removeItem(w)}catch(e){let t=new I({operation:`write`,storageKey:w,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...b(t)}),!1}return W(U(),{suppressTransitions:!0}),V(),!0},[]),c=(0,T.useCallback)(({preservePreview:e=!1}={})=>{typeof window<`u`&&(z=null,W(U(),{suppressTransitions:!0,preservePreview:e}),V())},[]);return(0,T.useEffect)(()=>{W(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 zn=ke(se(Ie)),Bn=Re(e=>{let t=e.replace(/("(?:[^"\\]|\\.)*")|\/\/[^\n]*/g,(e,t)=>t?e:``);return t=t.replace(/("(?:[^"\\]|\\.)*")|\/\*[\s\S]*?\*\//g,(e,t)=>t?e:``),t=t.replace(/("(?:[^"\\]|\\.)*")|,(\s*[}\]])/g,(e,t,n)=>t?e:n??``),zn(t).pipe(a(e=>e.issue))}),Vn=new be(Bn,Fe());Oe().pipe(i(Fe({space:2})));var Hn=e=>Ae.pipe(We(e,Vn)),Un={performance:{profile:`performance`,automaticGitFetchInterval:y(15),providerHealthRefreshInterval:p(1),hostPowerMonitorActiveInterval:y(30),hostPowerMonitorIdleInterval:p(2),idleClientTtl:y(45),pauseWhenHostLocked:!0,pauseWhenHostLowPower:!1,pauseWhenClientLowPower:!1,pauseWhenOnBattery:!1},balanced:{profile:`balanced`,automaticGitFetchInterval:we,providerHealthRefreshInterval:o,hostPowerMonitorActiveInterval:y(30),hostPowerMonitorIdleInterval:p(5),idleClientTtl:y(45),pauseWhenHostLocked:!0,pauseWhenHostLowPower:!0,pauseWhenClientLowPower:!0,pauseWhenOnBattery:!1},"battery-saver":{profile:`battery-saver`,automaticGitFetchInterval:y(0),providerHealthRefreshInterval:p(15),hostPowerMonitorActiveInterval:p(1),hostPowerMonitorIdleInterval:p(10),idleClientTtl:y(45),pauseWhenHostLocked:!0,pauseWhenHostLowPower:!0,pauseWhenClientLowPower:!0,pauseWhenOnBattery:!0}};function G(e){return Un[e]}function Wn(e){return e.profile===`custom`?e.baseProfile??`balanced`:e.profile}function Gn(e){let t=Wn(e),n=Un[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 K(e,t){return v(e)===v(t)}function Kn(e,t){return K(e.automaticGitFetchInterval,t.automaticGitFetchInterval)&&K(e.providerHealthRefreshInterval,t.providerHealthRefreshInterval)&&K(e.hostPowerMonitorActiveInterval,t.hostPowerMonitorActiveInterval)&&K(e.hostPowerMonitorIdleInterval,t.hostPowerMonitorIdleInterval)&&K(e.idleClientTtl,t.idleClientTtl)&&e.pauseWhenHostLocked===t.pauseWhenHostLocked&&e.pauseWhenHostLowPower===t.pauseWhenHostLowPower&&e.pauseWhenClientLowPower===t.pauseWhenClientLowPower&&e.pauseWhenOnBattery===t.pauseWhenOnBattery}function qn(e){if(e.profile!==`custom`)return{schemaVersion:1,profile:e.profile,overrides:{}};let t=Gn(e),n=[Wn(e),`balanced`,`performance`,`battery-saver`];for(let e of n)if(Kn(t,Un[e]))return{schemaVersion:1,profile:e,overrides:{}};let r=Wn(e),i=Un[r];return{schemaVersion:1,profile:`custom`,baseProfile:r,overrides:{...K(t.automaticGitFetchInterval,i.automaticGitFetchInterval)?{}:{automaticGitFetchInterval:t.automaticGitFetchInterval},...K(t.providerHealthRefreshInterval,i.providerHealthRefreshInterval)?{}:{providerHealthRefreshInterval:t.providerHealthRefreshInterval},...K(t.hostPowerMonitorActiveInterval,i.hostPowerMonitorActiveInterval)?{}:{hostPowerMonitorActiveInterval:t.hostPowerMonitorActiveInterval},...K(t.hostPowerMonitorIdleInterval,i.hostPowerMonitorIdleInterval)?{}:{hostPowerMonitorIdleInterval:t.hostPowerMonitorIdleInterval},...K(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 Jn(e){let t={schemaVersion:1,profile:Ue,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`||v(e.automaticGitFetchInterval)!==v(we)||v(e.providerHealthRefreshInterval)!==v(o);return Gn(n&&i?{schemaVersion:1,profile:v(e.automaticGitFetchInterval)===v(G(r).automaticGitFetchInterval)&&v(e.providerHealthRefreshInterval)===v(G(r).providerHealthRefreshInterval)?r:`custom`,baseProfile:r,overrides:{...v(e.automaticGitFetchInterval)===v(G(r).automaticGitFetchInterval)?{}:{automaticGitFetchInterval:e.automaticGitFetchInterval},...v(e.providerHealthRefreshInterval)===v(G(r).providerHealthRefreshInterval)?{}:{providerHealthRefreshInterval:e.providerHealthRefreshInterval}}}:e.backgroundActivity)}function Yn(e){let t=Jn(e);return qn({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 Xn=Hn(ne);He(Xn);function Zn(e,t){let n=e.providerInstances[t.instanceId];return n===void 0?oe(t.instanceId):he(n)}var Qn=[`codex`,`claudeAgent`,`cursor`,`grok`,`muse`,`pi`,`opencode`,`antigravity`].map(e=>d.make(e));function $n(e,t,n){let r=[...Qn.map(e=>[ae(e),e]),...n?.includeConfiguredInstances===!0?Object.entries(e).flatMap(([e,t])=>Qn.includes(t.driver)?[[f.make(e),t.driver]]:[]):[]].find(([e,n])=>t(e,n));if(r===void 0)return null;let[i,a]=r,o=n?.defaultModelSelection,s=e[i]?.config;return o?.instanceId===i&&ge(s?.customModels).some(e=>e.slug===o.model)?o:{instanceId:i,model:Ee[a]??Ne[a]??`gpt-6-luna`}}function er(e,t,n){let r=e.sourceControlWriterModelSelection;if(!r||!fe(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&&Be(i)&&le(i)?r:e.textGenerationModelSelection}function tr(e,t,n){let r=e.reviewGuideModelSelection;if(r&&fe(e,n,r.instanceId)){let e=t?.find(e=>e.instanceId===r.instanceId);if(t===void 0||e?.enabled===!0&&Be(e)&&le(e))return r}return er(e,t,n)}function nr(e,t={}){return{favorites:e.favorites??t.favorites??[],providerModelPreferences:e.providerModelPreferences??t.providerModelPreferences??{}}}function rr(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 ir=new Set([`continueThreadsAfterServerUpdate`,`sidebarAutoSettleAfterDays`,`sidebarAutoSettleOnMerge`,`autoResumeLimitedThreads`,`snoozeLimitedThreads`,`newWorktreesStartFromOrigin`,`sourceControlWritingStyle`,`textGenerationModelSelection`]);function ar(e){let t={},n={};for(let[r,i]of Object.entries(e))ir.has(r)?t[r]=i:n[r]=i;return{sharedPatch:t,localPatch:n}}function or(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)||!Zn(n,{...n.textGenerationModelSelection,...e.textGenerationModelSelection}))&&(e=me(e,[`textGenerationModelSelection`])),t?.threadRestartContinuation===!0?e:me(e,[`continueThreadsAfterServerUpdate`])}function sr(e){return e.connection.phase===`connected`&&e.serverConfig?.environment.capabilities.threadAutoSettlement===!0}function cr(e){let t=e.atom(ye(Ke.pipe(Ve(e=>u(e.state)))),{initialValue:Xe});return{stateAtom:t,stateValueAtom:m(e=>De(ie(e(t)),()=>Xe)).pipe(h(`relay-environment-discovery-value`)),refresh:qe(e,{label:`relay-environment-discovery:refresh`,concurrency:{mode:`singleFlight`,key:()=>`refresh`},execute:e=>Ke.pipe(_e(e=>e.refresh))})}}var lr=cr(tt);function ur(e,t){return{...t,environmentId:e,label:t.entry.target.label,displayUrl:$e(t.entry),relayManaged:Ge(t.entry)}}function dr(){let e=(0,E.c)(7),t=_(C.catalogValueAtom),n=_(C.networkStatusValueAtom),r=_(Ot.presentationsAtom),i;e[0]===r?i=e[1]:(i=[...r.entries()].map(fr),e[0]=r,e[1]=i);let a=i,o;return e[2]!==t.isReady||e[3]!==a||e[4]!==n||e[5]!==r?(o={isReady:t.isReady,networkStatus:n,environments:a,presentationById:r},e[2]=t.isReady,e[3]=a,e[4]=n,e[5]=r,e[6]=o):o=e[6],o}function fr(e){let[t,n]=e;return ur(t,n)}function pr(){return _(nt)}function mr(e){let t=(0,E.c)(3),{presentation:n}=jt(e),r;return t[0]!==e||t[1]!==n?(r=e===null||n===null?null:ur(e,n),t[0]=e,t[1]=n,t[2]=r):r=t[2],r}function hr(){return mr(pr())}function gr(e){let t=(0,E.c)(2),n=ot(e),r;return t[0]===n?r=t[1]:(r=Ce(n)?n.value.httpBaseUrl:null,t[0]=n,t[1]=r),r}function _r(){return _(lr.stateValueAtom)}function vr(){return _(kt.environmentIdsAtom)}function yr(){return _(kt.identitiesAtom)}function br(){return _(kt.pullRequestsSupportedAtom)}var xr=`[CLIENT_SETTINGS]`,Sr=new Set,Cr=new Set,wr=ce,q=`pending`,J=null,Tr=0,Er=Promise.resolve(),Dr=0;function Or(){for(let e of Sr)e()}function kr(){for(let e of Cr)e()}function Y(){return wr}function X(e){wr=e,Or()}function Ar(e){q!==e&&(q=e,kr())}function jr(e){return Sr.add(e),Z().catch(()=>void 0),()=>{Sr.delete(e)}}function Mr(){return q===`ready`}function Nr(){return q}function Pr(e){return Cr.add(e),Z().catch(()=>void 0),()=>{Cr.delete(e)}}async function Z(){if(q===`ready`)return;if(J)return J;let e=Tr;Ar(q===`failed`||q===`retrying`?`retrying`:`pending`);let t=(async()=>{try{let t=await sn().persistence.getClientSettings();if(e!==Tr)return;t&&X({...ce,...t}),Ar(`ready`)}catch(t){throw e===Tr&&Ar(`failed`),console.error(`${xr} hydrate failed`,{operation:`hydrate`,...b(t)}),t}})().finally(()=>{J===t&&(J=null)});return J=t,J}var Fr=e=>sn().persistence.setClientSettings(e);function Ir(e){let t=Er.then(e);return Er=t.then(()=>void 0,()=>void 0),t}function Lr(e,t=Fr){let n=q!==`ready`||Dr>0;return n?Dr+=1:X({...Y(),...e}),Ir(async()=>{if(n)try{q!==`ready`&&await Z(),X({...Y(),...e})}finally{--Dr}await t(Y())}).catch(e=>{console.error(`${xr} persist failed`,{operation:`persist`,...b(e)})})}async function Rr(e,t=Fr){return Ir(async()=>{for(q!==`ready`&&await Z();;){let n=Y(),r=e(n);if(await t(r),Y()===n)return X(r),r}})}var zr=new Set(de(ne.fields));function Br(e){let t={},n={};for(let[r,i]of Object.entries(e))zr.has(r)?t[r]=i:n[r]=i;return{serverPatch:t,clientPatch:n}}function Vr(){return Y()}function Hr(){return Z()}function Ur(){return(0,T.useSyncExternalStore)(Pr,Mr,Wr)}function Wr(){return!1}function Gr(){return(0,T.useSyncExternalStore)(Pr,Nr,Kr)}function Kr(){return`pending`}function Q(){return(0,T.useSyncExternalStore)(jr,Y,qr)}function qr(){return ce}function Jr(e,t){return{...t,...e,...nr(e,t)}}var Yr=new Set;function $(e,t){let n=(0,E.c)(8),r=Q(),i=Ur(),a;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={reportFailure:!1},n[0]=a):a=n[0];let o=ct(S.updateSettings,a),s,c;n[1]!==r||n[2]!==e||n[3]!==i||n[4]!==o||n[5]!==t?(s=()=>{if(!e||!t||!i||Yr.has(e))return;let n=rr(t,r);n&&(Yr.add(e),o({environmentId:e,input:{patch:n}}).finally(()=>Yr.delete(e)))},c=[r,e,i,o,t],n[1]=r,n[2]=e,n[3]=i,n[4]=o,n[5]=t,n[6]=s,n[7]=c):(s=n[6],c=n[7]),(0,T.useEffect)(s,c)}function Xr(e,t){let n=(0,E.c)(6),r=Q(),i;n[0]!==r||n[1]!==e?(i=Jr(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 Zr(e){let t=(0,E.c)(3),n=Q(),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 Qr(e){return e.settingsHydrated?e.paletteThemeActive&&!e.paletteThemeAllowsArtwork&&e.mode===`artwork`?`pill`:e.mode:`none`}function $r(){let e=(0,E.c)(7),t=Ur(),n=Q().environmentIdentificationMode,{resolvedTheme:r,theme:i,themeHalves:a}=Rn(),o=(0,T.useSyncExternalStore)(lt,vt,ei),s;if(e[0]!==n||e[1]!==o||e[2]!==r||e[3]!==t||e[4]!==i||e[5]!==a){let c=dt(i,a,r),l=_t(c);s=Qr({mode:n,settingsHydrated:t,paletteThemeActive:o!==null||l!==null,paletteThemeAllowsArtwork:o??gt(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 ei(){return null}async function ti(e,t){return(e.favorites===null||e.providerModelPreferences===null)&&await Hr(),{...rr(e,Vr()),...t}}function ni(e){let t=(0,E.c)(6),n;t[0]===e?n=t[1]:(n=e?S.settingsValueAtom(e):ii,t[0]=e,t[1]=n);let r=_(n),i=ct(S.updateSettings,`model preferences update`),a;return t[2]!==e||t[3]!==i||t[4]!==r?(a=async t=>{if(!e||!r)return;let n;try{n=await ti(r,t)}catch{x.add({type:`error`,title:`Model preferences not saved`,description:`Could not load saved model preferences. Try again.`});return}return i({environmentId:e,input:{patch:n}})},t[2]=e,t[3]=i,t[4]=r,t[5]=a):a=t[5],a}function ri(e){let t=(0,T.use)(Pe),n=(0,T.useRef)(new Map),r=ni(e);return(0,T.useCallback)(async(i,a)=>{if(!e)return;let o=S.settingsValueAtom(e),s=t.get(o);if(!s)return;if(s.favorites===null)try{await Hr()}catch{x.add({type:`error`,title:`Favorites not saved`,description:`Could not load saved model preferences. Try again.`});return}let c=t.get(o)??s,l=nr(c,Vr()).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&&ue(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 ii=m(null);function ai(e){let t=(0,E.c)(5),n;t[0]===e?n=t[1]:(n=e?S.settingsValueAtom(e):ii,t[0]=e,t[1]=n);let r=_(n),i=Q();$(e,r);let a=r??re,o;return t[2]!==i||t[3]!==a?(o=nr(a,i),t[2]=i,t[3]=a,t[4]=o):o=t[4],o}function oi(e,t){let n=(0,E.c)(2),r;n[0]===e?r=n[1]:(r=S.settingsValueAtom(e),n[0]=e,n[1]=r);let i=_(r);return $(e,i),Xr(i??re,t)}function si(e){let t=(0,E.c)(4),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=ct(S.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 ci(e){let t=hr(),n=_(rt);return $(t?.environmentId??null,t?.serverConfig?.settings??null),Xr(n,e)}var li=`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 ui(){let e=(0,E.c)(2),t=hr(),n;return e[0]===t?n=e[1]:(n=t!==null||!Qe(),e[0]=t,e[1]=n),n}function di(e){let t=(0,E.c)(3),n=e!==void 0&&e,{environments:r}=dr(),i;return t[0]!==r||t[1]!==n?(i=m(e=>r.filter(sr).flatMap(t=>{let r=e(st.sessionStateAtom(t.environmentId));if(n&&r._tag===`Initial`)return[t.environmentId];let i=r._tag===`Failure`?null:g(ie(r));return i!==null&&ze(i,`settings:write`)?[t.environmentId]:[]})),t[0]=r,t[1]=n,t[2]=i):i=t[2],_(i)}function fi(e){let t=(0,E.c)(10);it(e,r);let n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={label:`server settings update`,reportFailure:!1},t[0]=n):n=t[0];let i=ct(S.updateSettings,n),{environments:a}=dr(),o;t[1]!==a||t[2]!==i?(o=async e=>{let t=await i(e);if(t._tag===`Failure`&&!Je(t)){let n=a.find(t=>t.environmentId===e.environmentId)?.label??e.environmentId,r=Ze(t);x.add({type:`error`,title:`Setting not saved`,description:`Could not save on ${n}: ${r instanceof Error?r.message:`The save failed. Try reconnecting and saving again.`}`})}return t},t[1]=a,t[2]=i,t[3]=o):o=t[3];let s=o,c=di(!0),l;return t[4]!==e||t[5]!==a||t[6]!==i||t[7]!==s||t[8]!==c?(l=t=>{let{serverPatch:n,clientPatch:r}=Br(t),o=e===null||pe(n).every(t=>at(e,t));if(Object.keys(n).length>0&&!o&&x.add({type:`warning`,title:`Setting not saved`,description:`This connection lacks permission to change settings on ${a.find(t=>t.environmentId===e)?.label??`the selected environment`}.`}),Object.keys(n).length>0&&o){let{sharedPatch:t,localPatch:r}=ar(n),o=_i;if(Object.keys(r).length>0&&(e?s({environmentId:e,input:{patch:r}}):o()),Object.keys(t).length>0){let n=a.find(t=>t.environmentId===e)?.serverConfig?.settings,r=new Set(c);e&&r.add(e);let s=[],l=[];for(let i of r){let r=a.find(e=>e.environmentId===i),o=or(t,r?.serverConfig?.environment.capabilities,r?.serverConfig?.settings,n,i===e);if(Object.keys(o).length!==0){if(xe.get(st.sessionStateAtom(i))._tag!==`Initial`&&!pe(t).every(e=>at(i,e))){l.push(r?.label??i);continue}s.push({environmentId:i,input:{patch:o}})}}s.length===0?o(l.length>0?`This connection lacks permission to change settings on ${l.join(`, `)}.`:r.size>0?`Update older servers to save this setting.`:void 0):Promise.all(s.map(async e=>({label:a.find(t=>t.environmentId===e.environmentId)?.label??e.environmentId,result:await i(e)}))).then(pi)}}Object.keys(r).length>0&&Lr(r)},t[4]=e,t[5]=a,t[6]=i,t[7]=s,t[8]=c,t[9]=l):l=t[9],l}function pi(e){let t=e.flatMap(gi);if(t.length===0)return;let n=e.filter(hi).map(mi);x.add({type:`error`,title:n.length>0?`Setting saved on some environments`:`Setting not saved`,description:[...t,...n.length>0?[`Saved on ${n.join(`, `)}.`]:[]].join(`
2
+ `)})}function mi(e){let{label:t}=e;return t}function hi(e){let{result:t}=e;return t._tag===`Success`}function gi(e){let{label:t,result:n}=e;if(n._tag!==`Failure`||Je(n))return[];let r=Ze(n);return[`Could not save on ${t}: ${r instanceof Error?r.message:`The save failed. Try reconnecting and saving again.`}`]}function _i(e){let t=e===void 0?li:e;return x.add({type:`warning`,title:`Setting not saved`,description:t})}function vi(e){return fi(e)}function yi(){return fi(hr()?.environmentId??null)}function bi(){return xi}function xi(e){return Lr(e)}export{Lt as $,_r as A,Hn as B,gr as C,hr as D,dr as E,Wn as F,kn as G,ln as H,G as I,on as J,Rn as K,qn as L,$n as M,tr as N,pr as O,er as P,Ft as Q,Yn as R,mr as S,vr as T,un as U,H as V,wn as W,Vt as X,Yt as Y,zt as Z,ri as _,Lr as a,jt as at,vi as b,Ur as c,ai as d,Rt as et,oi as f,ui as g,ci as h,Jr as i,kt as it,lr as j,br as k,Gr as l,si as m,Hr as n,It as nt,Rr as o,$ as p,sn as q,Vr as r,Ot as rt,Zr as s,li as t,Bt as tt,$r as u,bi as v,yr as w,yi as x,ni as y,Jn as z};
3
+ //# sourceMappingURL=useSettings-CaJMqrvF.js.map