@p4code/cli 0.8.3 → 0.8.5

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 (406) hide show
  1. package/dist/{AcpMcpStdioBridge-D_JnxPWS.mjs → AcpMcpStdioBridge-CD9BQr2l.mjs} +1 -1
  2. package/dist/{AcpMcpStdioBridge-DBONIB-w.mjs → AcpMcpStdioBridge-DHwGLtep.mjs} +61 -4
  3. package/dist/bin.mjs +2 -2
  4. package/dist/{binCli-DouSNynJ.mjs → binCli-D9Qk_k5i.mjs} +492 -292
  5. package/dist/client/.vite/manifest.json +2138 -2115
  6. package/dist/client/assets/{AnimatedHeight-DoG4b7y8.js → AnimatedHeight-DKdClmyw.js} +2 -2
  7. package/dist/client/assets/{AuthSurfaceShell-DbeJoeXz.js → AuthSurfaceShell-UJgufrYU.js} +2 -2
  8. package/dist/client/assets/{CSPContext-DkFc4cYo.js → CSPContext-CTpTfAqS.js} +2 -2
  9. package/dist/client/assets/ChatGptUsageButton-9B_WUPVm.js +2 -0
  10. package/dist/client/assets/{ChatMarkdown-CLD9Y6dg.js → ChatMarkdown-B9_nJM54.js} +12 -12
  11. package/dist/client/assets/CodexSetupSection.logic-YSEDjbLd.js +2 -0
  12. package/dist/client/assets/{ComboboxClear-ZQvkAjz8.js → ComboboxClear-TEL6MsPn.js} +2 -2
  13. package/dist/client/assets/{CommandBlock-c98wFxMU.js → CommandBlock-C6bCrWJ5.js} +2 -2
  14. package/dist/client/assets/{ComposerPromptEditor-CBuOXkT9.js → ComposerPromptEditor-BpT2majW.js} +11 -11
  15. package/dist/client/assets/{CompositeRoot-BMUI_bmJ.js → CompositeRoot-CZuZX6hs.js} +2 -2
  16. package/dist/client/assets/{ConnectionStatusDot-B69zfKRh.js → ConnectionStatusDot-BX6msmak.js} +2 -2
  17. package/dist/client/assets/{DevicePanel-1xw7KQ15.js → DevicePanel-DavxmX2w.js} +2 -2
  18. package/dist/client/assets/{DeviceSetup-DemgUuG-.js → DeviceSetup-CZX8TKF_.js} +2 -2
  19. package/dist/client/assets/{DialogTitle-BXot7RA0.js → DialogTitle-CLcXbJRs.js} +2 -2
  20. package/dist/client/assets/{DiffCommentAnnotation-vAZP7JBy.js → DiffCommentAnnotation-B21n3tGU.js} +2 -2
  21. package/dist/client/assets/{DiffFileTree-BhqF8nD5.js → DiffFileTree--L--vp02.js} +2 -2
  22. package/dist/client/assets/DiffPanel-T4lIPUlN.js +2 -0
  23. package/dist/client/assets/{DiffWorkerPoolProvider-D4VIo5Vu.js → DiffWorkerPoolProvider-Cxzr_uYq.js} +3 -3
  24. package/dist/client/assets/{EnvironmentMachineIcon-DPQkDtvr.js → EnvironmentMachineIcon-CGINHXnT.js} +2 -2
  25. package/dist/client/assets/{ExpandableText-EZ9C25tN.js → ExpandableText-D1ewr-yU.js} +2 -2
  26. package/dist/client/assets/{FieldControl-C4IsJLMZ.js → FieldControl-BVq7aDv3.js} +2 -2
  27. package/dist/client/assets/{FileDiff-H9QHqXa0.js → FileDiff-C0ZCBwBc.js} +2 -2
  28. package/dist/client/assets/{FilePreviewPanel-DGm_SU_e.js → FilePreviewPanel-CxOIUI0_.js} +4 -4
  29. package/dist/client/assets/{FoldedSettingsSection-BSYFyChk.js → FoldedSettingsSection-DmcJrCZO.js} +2 -2
  30. package/dist/client/assets/{FormContext-DiXpMuU8.js → FormContext-CObkgUvS.js} +2 -2
  31. package/dist/client/assets/{Icons-DA4msgfR.js → Icons-CSHLGz_M.js} +2 -2
  32. package/dist/client/assets/{KeybindingsSettings.logic-7EBA0xLE.js → KeybindingsSettings.logic-D9eYCeK5.js} +2 -2
  33. package/dist/client/assets/{NoProjectsHero-YjEc2OIw.js → NoProjectsHero-C0RwYoYq.js} +2 -2
  34. package/dist/client/assets/{PanelLayoutControls-BfRIRM0o.js → PanelLayoutControls-CcE6oZUh.js} +8 -8
  35. package/dist/client/assets/{PierreEntryIcon-BxxykifK.js → PierreEntryIcon-D0PlfaRc.js} +2 -2
  36. package/dist/client/assets/PreviewPanel-DgRCZ-80.js +2 -0
  37. package/dist/client/assets/ProjectDefaultsSettings-DOXJKuJ7.js +2 -0
  38. package/dist/client/assets/{ProjectFavicon-CiauSitF.js → ProjectFavicon-CFPeQQsG.js} +3 -3
  39. package/dist/client/assets/ProjectIconPickerDialog-B5iXalFo.js +2 -0
  40. package/dist/client/assets/{ProjectMonogram-Bqe3OyZR.js → ProjectMonogram-HCgoNxPJ.js} +2 -2
  41. package/dist/client/assets/{ProviderAuthTerminal-D_OC5vdS.js → ProviderAuthTerminal-rBb4SeQd.js} +2 -2
  42. package/dist/client/assets/{ProviderModelPicker-Bfpy_Rw1.js → ProviderModelPicker-CHfA6QfR.js} +2 -2
  43. package/dist/client/assets/{ProviderSettingsForm-BA6yGdRn.js → ProviderSettingsForm-cr5QEWx_.js} +2 -2
  44. package/dist/client/assets/{PullRequestCodeTab-BOM7mgfd.js → PullRequestCodeTab-CyJ0_1HE.js} +3 -3
  45. package/dist/client/assets/{ReadOnlySourcePreview-C3LnvSkA.js → ReadOnlySourcePreview-BvUk75g2.js} +2 -2
  46. package/dist/client/assets/{RenderErrorBoundary-C-EIIrrq.js → RenderErrorBoundary-h3g72sj0.js} +2 -2
  47. package/dist/client/assets/ScheduledTasksSettings-CpUearCU.js +4 -0
  48. package/dist/client/assets/{ScopedSwitch-DsEcG6rk.js → ScopedSwitch-D1QVfZHR.js} +2 -2
  49. package/dist/client/assets/{SecretInput-Be5Akw8x.js → SecretInput-SiHUbFCV.js} +2 -2
  50. package/dist/client/assets/SettingsPanels-B9t76y-c.js +39 -0
  51. package/dist/client/assets/{SettingsPanels.logic-CLB8Pu-U.js → SettingsPanels.logic-B3IqBMv7.js} +2 -2
  52. package/dist/client/assets/{SettingsScopeNotice-CVoWG1oN.js → SettingsScopeNotice-B_awMQPw.js} +2 -2
  53. package/dist/client/assets/{T3ConnectAccountPages-ClNzwIQw.js → T3ConnectAccountPages-DOpj673A.js} +2 -2
  54. package/dist/client/assets/{T3ConnectSidebarSignIn-BqM_Vqe1.js → T3ConnectSidebarSignIn-zrB8y6DQ.js} +2 -2
  55. package/dist/client/assets/{ThemeEditorPanel-vVmQV_Vv.js → ThemeEditorPanel-Cx7KulxB.js} +2 -2
  56. package/dist/client/assets/{ThreadTerminalDrawer-aLeVbe6g.js → ThreadTerminalDrawer-ChcqArNC.js} +4 -4
  57. package/dist/client/assets/{Virtualizer-DTOYU5Jp.js → Virtualizer-DWmIp9HB.js} +2 -2
  58. package/dist/client/assets/{WorkspaceBreadcrumb-C9OPPGJE.js → WorkspaceBreadcrumb-Dx7xMwQd.js} +2 -2
  59. package/dist/client/assets/{WorkspacePageContainer-DtXJ5ept.js → WorkspacePageContainer-sM_H3DH4.js} +2 -2
  60. package/dist/client/assets/{WorkspacePageHeader-5zzLFpEN.js → WorkspacePageHeader-C_J7FxVt.js} +2 -2
  61. package/dist/client/assets/_chat-Du_FC4wO.js +45 -0
  62. package/dist/client/assets/{_chat.index-BP1JWABB.js → _chat.index-DUyKTtkh.js} +2 -2
  63. package/dist/client/assets/{_chat.new-BX5LyFum.js → _chat.new-CMoB99iV.js} +3 -3
  64. package/dist/client/assets/{_chat.pull-requests-B6-Vck8B.js → _chat.pull-requests-BuTKumeN.js} +2 -2
  65. package/dist/client/assets/{abnfDiagram-VCTEODGH-BXvAfzAg.js → abnfDiagram-VCTEODGH-D2OflHz4.js} +2 -2
  66. package/dist/client/assets/{alert-B-or1ble.js → alert-8IFNkYPw.js} +2 -2
  67. package/dist/client/assets/architecture-7GRP2DOG-BMsijJGx.js +1 -0
  68. package/dist/client/assets/{architectureDiagram-5GKGNRK7-MEUA3QVe.js → architectureDiagram-5GKGNRK7-Cz7fFw7N.js} +2 -2
  69. package/dist/client/assets/archive-x-D3w6saMD.js +2 -0
  70. package/dist/client/assets/arrow-left-DjrJekQJ.js +1 -0
  71. package/dist/client/assets/arrow-right-DNQ3322O.js +1 -0
  72. package/dist/client/assets/arrow-up-down-DpVszLOH.js +1 -0
  73. package/dist/client/assets/assets-DJce0KBy.js +2 -0
  74. package/dist/client/assets/bell-ehBYv81q.js +1 -0
  75. package/dist/client/assets/{blockDiagram-I7D4REHJ-BOdLeYJh.js → blockDiagram-I7D4REHJ-BcqcXQ0x.js} +2 -2
  76. package/dist/client/assets/blocks-CF1Wdm4Y.js +1 -0
  77. package/dist/client/assets/bot-Dj9hYg2w.js +1 -0
  78. package/dist/client/assets/{browserHistoryStore-BJD0OPpb.js → browserHistoryStore-CuO1erOb.js} +2 -2
  79. package/dist/client/assets/{browserLinkTarget-CoogLhhO.js → browserLinkTarget-B5-9Pt65.js} +2 -2
  80. package/dist/client/assets/{c4Diagram-7LVT6UL2-COZrm1O8.js → c4Diagram-7LVT6UL2-DDiDhcli.js} +2 -2
  81. package/dist/client/assets/calendar-clock-BaXgPf_7.js +1 -0
  82. package/dist/client/assets/channel-pJ5lNF0h.js +2 -0
  83. package/dist/client/assets/chart-no-axes-column-BzuvLLND.js +1 -0
  84. package/dist/client/assets/{checkbox-CaZu1EKJ.js → checkbox-BUOikrm3.js} +2 -2
  85. package/dist/client/assets/{chunk-4HAMMTFA-Bs-Fo0v1.js → chunk-4HAMMTFA-_7K6yngz.js} +2 -2
  86. package/dist/client/assets/{chunk-75Z2AOVW-DpOWzc3R.js → chunk-75Z2AOVW-CUqo_4ua.js} +2 -2
  87. package/dist/client/assets/{chunk-DU6HZSFF-Bgpi4W6E.js → chunk-DU6HZSFF-C3RStRBi.js} +2 -2
  88. package/dist/client/assets/{chunk-F27PBJKO-CLxgnzXS.js → chunk-F27PBJKO-BOr5cbtz.js} +2 -2
  89. package/dist/client/assets/{chunk-GMAD6QVW-D98J5Pan.js → chunk-GMAD6QVW-qBcSdTWV.js} +2 -2
  90. package/dist/client/assets/{chunk-GVQU2GXP-VuCIOHGI.js → chunk-GVQU2GXP-D8rhGQK_.js} +2 -2
  91. package/dist/client/assets/{chunk-IMKFNOWR-DXIyBsaE.js → chunk-IMKFNOWR-BjTZFMrm.js} +2 -2
  92. package/dist/client/assets/{chunk-L3NEJ4N5-CrMlU3ZU.js → chunk-L3NEJ4N5-DnCelWBi.js} +2 -2
  93. package/dist/client/assets/{chunk-OSK3NFVY-V2__4gNB.js → chunk-OSK3NFVY-BEgD3sGZ.js} +2 -2
  94. package/dist/client/assets/{chunk-P2QGCYS3-BrPw6V5F.js → chunk-P2QGCYS3-DDmmXS6G.js} +2 -2
  95. package/dist/client/assets/{chunk-POPQ4Y6H-DBQ9Y51x.js → chunk-POPQ4Y6H-CefHvRtI.js} +2 -2
  96. package/dist/client/assets/{chunk-PWAF6VOD-BN6AAbfF.js → chunk-PWAF6VOD-BPIKFLCK.js} +2 -2
  97. package/dist/client/assets/{chunk-SHT3W25Y-Vay44dCU.js → chunk-SHT3W25Y-B_pDi6kv.js} +2 -2
  98. package/dist/client/assets/{chunk-SVP7TREG-CcGlNErV.js → chunk-SVP7TREG-BD15vJFs.js} +2 -2
  99. package/dist/client/assets/{chunk-TICWLB2K-Dk1P_xkD.js → chunk-TICWLB2K-B2yA6VhZ.js} +2 -2
  100. package/dist/client/assets/classDiagram-ZZMXUADV-D4Ed7oKu.js +2 -0
  101. package/dist/client/assets/classDiagram-v2-VYDZK3BY-D4Ed7oKu.js +2 -0
  102. package/dist/client/assets/{color-picker-gBclRe5T.js → color-picker-Dqvd0njw.js} +2 -2
  103. package/dist/client/assets/{combobox-C81z_216.js → combobox-BPRK10Il.js} +2 -2
  104. package/dist/client/assets/{command-DnJZPOmf.js → command-B-SWHWbd.js} +2 -2
  105. package/dist/client/assets/{connect-Am2IS-vZ.js → connect-D8LGiBSX.js} +2 -2
  106. package/dist/client/assets/{connect-agent-Cw1s7hYt.js → connect-agent-B3TvHBIV.js} +2 -2
  107. package/dist/client/assets/corner-left-up-8yNxlIpO.js +1 -0
  108. package/dist/client/assets/{cynefin-OW5HDTMX-0s30RxOq.js → cynefin-OW5HDTMX-D-j3kzkd.js} +1 -1
  109. package/dist/client/assets/{cynefinDiagram-5FMLGOSQ-Drd0Msog.js → cynefinDiagram-5FMLGOSQ-CVEhj0G_.js} +2 -2
  110. package/dist/client/assets/{dagre-GXQ25YYZ-BMfu7T0o.js → dagre-GXQ25YYZ-opF-kR2J.js} +2 -2
  111. package/dist/client/assets/device-DARKbqyG.js +2 -0
  112. package/dist/client/assets/{diagram-S7CK7UJ4-8egngY0E.js → diagram-S7CK7UJ4-Y1OUf_Uf.js} +2 -2
  113. package/dist/client/assets/{diagram-UQ7AKVKN-BALPQoDH.js → diagram-UQ7AKVKN-BMAkQiYU.js} +2 -2
  114. package/dist/client/assets/{diagram-VSXAHHWV-BjyJZVGC.js → diagram-VSXAHHWV-YWI6689v.js} +2 -2
  115. package/dist/client/assets/{diagram-VX7I27RA-B9f6eKkq.js → diagram-VX7I27RA-DVxQ1Tyn.js} +2 -2
  116. package/dist/client/assets/{diagram-Z3DM3KII-CRUj2d3v.js → diagram-Z3DM3KII-DzaunCE7.js} +2 -2
  117. package/dist/client/assets/{dialog-Bn1u_Xoc.js → dialog-ChNU2rSW.js} +2 -2
  118. package/dist/client/assets/{diffRendering-C26rfQBu.js → diffRendering-TJ6NEHef.js} +2 -2
  119. package/dist/client/assets/{discovery-list-Fg_u6w-x.js → discovery-list-2jVj88oX.js} +2 -2
  120. package/dist/client/assets/{dist-DtKaGeij.js → dist-Dc07DWZJ.js} +3 -3
  121. package/dist/client/assets/download-KOf4APex.js +1 -0
  122. package/dist/client/assets/{draft-input-D8eUYug0.js → draft-input-CAOyi5vd.js} +2 -2
  123. package/dist/client/assets/{duoViewer-CBoAg4hS.js → duoViewer-CkI16mDl.js} +2 -2
  124. package/dist/client/assets/dynamic-B6ssT_6R.js +3 -0
  125. package/dist/client/assets/earth-Gh21ySR9.js +1 -0
  126. package/dist/client/assets/{ebnfDiagram-PWID7BFC-BSbPiqg7.js → ebnfDiagram-PWID7BFC-CLu3StxL.js} +2 -2
  127. package/dist/client/assets/ellipsis-Dd1lpp1y.js +1 -0
  128. package/dist/client/assets/{embeddedScripts-Dsi0aZEx.js → embeddedScripts-C0cHj-rX.js} +2 -2
  129. package/dist/client/assets/{empty-C-gDaZ_z.js → empty-DJMr9MZU.js} +2 -2
  130. package/dist/client/assets/entities-HApogVCu.js +2 -0
  131. package/dist/client/assets/{erDiagram-RLTQ6QDP-sL_q0j_k.js → erDiagram-RLTQ6QDP-CMztaIAH.js} +2 -2
  132. package/dist/client/assets/eventmodeling-NTZA5JFV-D1FYr7Uj.js +1 -0
  133. package/dist/client/assets/eye-CQCt8uGE.js +1 -0
  134. package/dist/client/assets/file-search-BXNWZ1nV.js +1 -0
  135. package/dist/client/assets/{fileLinks-DubkPNVt.js → fileLinks-3CrgspkN.js} +2 -2
  136. package/dist/client/assets/{fileTreeExpansion-VtSAPhxL.js → fileTreeExpansion-CYkjiRdT.js} +2 -2
  137. package/dist/client/assets/flowDiagram-HODETNUW-leGOLc6K.js +1 -0
  138. package/dist/client/assets/folder-git-2-BIZ4K8z0.js +1 -0
  139. package/dist/client/assets/folder-open-BI7lMTSr.js +1 -0
  140. package/dist/client/assets/folder-plus-B91hg6qR.js +1 -0
  141. package/dist/client/assets/{ganttDiagram-EL5Y4UJY-DCiKb0rQ.js → ganttDiagram-EL5Y4UJY-G_L0ijf2.js} +2 -2
  142. package/dist/client/assets/{getDiffFileInput-DU5zpXo3.js → getDiffFileInput-Kc1w64Y-.js} +2 -2
  143. package/dist/client/assets/git-branch-Yqn0BBlE.js +1 -0
  144. package/dist/client/assets/{gitGraph-4MIJSDKK-DfRe6ZT5.js → gitGraph-4MIJSDKK-BmuEuxsx.js} +1 -1
  145. package/dist/client/assets/{gitGraphDiagram-WWUBYQGX-Bt7diV1n.js → gitGraphDiagram-WWUBYQGX-C6A4msS5.js} +2 -2
  146. package/dist/client/assets/grip-vertical-DbE6Bv-r.js +1 -0
  147. package/dist/client/assets/{guideRunStore-CF9bByzk.js → guideRunStore-sdfoC8zb.js} +2 -2
  148. package/dist/client/assets/hard-drive--FvDwcA1.js +1 -0
  149. package/dist/client/assets/history-D-6p2svD.js +1 -0
  150. package/dist/client/assets/house-6Nj_TaKT.js +1 -0
  151. package/dist/client/assets/{htmlRender-vOqAdlJH.js → htmlRender-BPiW3VQi.js} +2 -2
  152. package/dist/client/assets/index-EKWtrZNr.js +3 -0
  153. package/dist/client/assets/{info-A6RAGUB7-0FtL6-Am.js → info-A6RAGUB7-CwFLPSUe.js} +1 -1
  154. package/dist/client/assets/{infoDiagram-27XIBGKW-BPLvtPCc.js → infoDiagram-27XIBGKW-bjIIr1Q4.js} +2 -2
  155. package/dist/client/assets/{input-group-CJ7ZOvDN.js → input-group-DM7QvN7X.js} +2 -2
  156. package/dist/client/assets/{input-Cd_0h7h_.js → input-w_nbMVAd.js} +2 -2
  157. package/dist/client/assets/{ishikawaDiagram-5VMMS53U-DVcx0XTh.js → ishikawaDiagram-5VMMS53U-ymImqXAG.js} +2 -2
  158. package/dist/client/assets/{journeyDiagram-3NMN7TZE-w46bbjL2.js → journeyDiagram-3NMN7TZE-TJpDU0em.js} +2 -2
  159. package/dist/client/assets/{kanban-definition-UXKFOSKX-C41yE_yV.js → kanban-definition-UXKFOSKX-Bhm6s1x1.js} +2 -2
  160. package/dist/client/assets/{kbd-c17EHIx1.js → kbd-CTZhqOH9.js} +2 -2
  161. package/dist/client/assets/{keybindings-uYm_vnXl.js → keybindings-CJFu-Dyg.js} +2 -2
  162. package/dist/client/assets/keyboard-Bf3n2zS8.js +1 -0
  163. package/dist/client/assets/{lazyRouteComponent-CTVuEvaz.js → lazyRouteComponent-WxKijHdU.js} +2 -2
  164. package/dist/client/assets/{line-tu9XZ0qp.js → line-C24Qe7Rj.js} +2 -2
  165. package/dist/client/assets/link-BVjRZ3mh.js +1 -0
  166. package/dist/client/assets/{link-C4sEUNOK.js → link-DnBUR2mx.js} +2 -2
  167. package/dist/client/assets/{linkedPrompt-VYl90REW.js → linkedPrompt-CNv-bVSs.js} +2 -2
  168. package/dist/client/assets/list-DrTK4zhP.js +1 -0
  169. package/dist/client/assets/loader-Bc9xbkPa.js +2 -0
  170. package/dist/client/assets/main-D1oD2GPo.js +30 -0
  171. package/dist/client/assets/main-hjb9WdQ8.css +2 -0
  172. package/dist/client/assets/{mediaReference-BTVvzs2e.js → mediaReference-vtwfoFLK.js} +2 -2
  173. package/dist/client/assets/{mediaSource-DXHFWHMA.js → mediaSource-BDkqXaxs.js} +2 -2
  174. package/dist/client/assets/{mermaid-parser.core-DNd412Oc.js → mermaid-parser.core-D2hAGRv3.js} +4 -4
  175. package/dist/client/assets/{mermaid.core-CyE6QOQY.js → mermaid.core-DWtHy2iz.js} +5 -5
  176. package/dist/client/assets/message-circle-question-mark-D2JAzS9x.js +1 -0
  177. package/dist/client/assets/message-square-DNTOkKRN.js +1 -0
  178. package/dist/client/assets/message-square-dashed-NGYZLQqB.js +1 -0
  179. package/dist/client/assets/{mindmap-definition-YA3MSWOX-DH1uxdTm.js → mindmap-definition-YA3MSWOX-DCzTD1Gd.js} +2 -2
  180. package/dist/client/assets/mouse-pointer-2-CgUWLVBh.js +1 -0
  181. package/dist/client/assets/{number-field-CVtwAsLe.js → number-field-yRjM_PYx.js} +2 -2
  182. package/dist/client/assets/{observeResize-Csvw3hy4.js → observeResize-wFdsooQ8.js} +2 -2
  183. package/dist/client/assets/{onboarding-CJPrQc71.js → onboarding-Buk_SNIp.js} +2 -2
  184. package/dist/client/assets/openFileInPreview-CxrjOX7D.js +2 -0
  185. package/dist/client/assets/{p4ProjectFile-BWszgcDk.js → p4ProjectFile-DNlgD3LH.js} +2 -2
  186. package/dist/client/assets/{packet-AYTQ26CC-DflCOkCN.js → packet-AYTQ26CC-CSklBRjj.js} +1 -1
  187. package/dist/client/assets/{pair-Dd_e1jxq.js → pair-DYnW2Jz0.js} +2 -2
  188. package/dist/client/assets/palette-DCF6iKZY.js +1 -0
  189. package/dist/client/assets/panel-left-BObCZ482.js +1 -0
  190. package/dist/client/assets/panels-top-left-4ditdjHS.js +1 -0
  191. package/dist/client/assets/{pegDiagram-XKGWAZYB-Cnx9j2xX.js → pegDiagram-XKGWAZYB-Cgo_C_YQ.js} +2 -2
  192. package/dist/client/assets/{phoneViewer-B9EUVDD2.js → phoneViewer-CVOLU68D.js} +2 -2
  193. package/dist/client/assets/{pie-WAS4IAKB-CDwew7fN.js → pie-WAS4IAKB-y0cNnmhp.js} +1 -1
  194. package/dist/client/assets/{pieDiagram-E7YTZNPT-BxejSN6k.js → pieDiagram-E7YTZNPT-CR9uQOKX.js} +2 -2
  195. package/dist/client/assets/{pierre-icons-C839Otpo.js → pierre-icons-YFKnGmUq.js} +2 -2
  196. package/dist/client/assets/{popover-CKyetthu.js → popover-D-VzRDzk.js} +2 -2
  197. package/dist/client/assets/{preview-CjgXQQdj.js → preview-C7hqmFHN.js} +2 -2
  198. package/dist/client/assets/{preview-CEMnbqVB.js → preview-DT6Qi-Q0.js} +2 -2
  199. package/dist/client/assets/{previewMiniPlayerStore-B9Lqaaij.js → previewMiniPlayerStore-Dmvk7kfx.js} +2 -2
  200. package/dist/client/assets/primary-bBvWt8wp.js +2 -0
  201. package/dist/client/assets/primaryCloudLinkState-DDmxU43H.js +2 -0
  202. package/dist/client/assets/projectFilesQueryState-C9bparJ7.js +2 -0
  203. package/dist/client/assets/{projectScriptEditor-BAuP_HeU.js → projectScriptEditor-2klDgdXc.js} +2 -2
  204. package/dist/client/assets/providerSkills-Bd9FOodA.js +2 -0
  205. package/dist/client/assets/{pullRequestDetail.logic-DTxWqKoX.js → pullRequestDetail.logic-BHCv2eTg.js} +4 -4
  206. package/dist/client/assets/{pullRequestReviewStore-C5gaoGaz.js → pullRequestReviewStore-DNDBmRdQ.js} +2 -2
  207. package/dist/client/assets/pullRequests-NQiU1cvE.js +2 -0
  208. package/dist/client/assets/puzzle-DC6izfkI.js +1 -0
  209. package/dist/client/assets/{quadrantDiagram-AXDQQJYC-Bj4FEpOg.js → quadrantDiagram-AXDQQJYC-B2RnhUBb.js} +2 -2
  210. package/dist/client/assets/queries-DrIiv9gC.js +2 -0
  211. package/dist/client/assets/query-B_BcLKlb.js +2 -0
  212. package/dist/client/assets/{radar-RG4KPBEZ-DEopr2Gv.js → radar-RG4KPBEZ-Dygcuho2.js} +1 -1
  213. package/dist/client/assets/{radio-group-fljQQ7Xp.js → radio-group-ESEwcJva.js} +2 -2
  214. package/dist/client/assets/{railroad-74A4TZTK-BSAOgUn6.js → railroad-74A4TZTK-CK7b6dqk.js} +1 -1
  215. package/dist/client/assets/railroad-abnf-HS5TGJTU-Bn3ASlRb.js +1 -0
  216. package/dist/client/assets/railroad-ebnf-LZEXJU2U-DpIqYG5o.js +1 -0
  217. package/dist/client/assets/railroad-peg-WCYAUIDC-9vGlAMJk.js +1 -0
  218. package/dist/client/assets/{railroadDiagram-O6MQD6OU-BSOJGJ6v.js → railroadDiagram-O6MQD6OU-DsiQNHoT.js} +2 -2
  219. package/dist/client/assets/{renderScheduler-v8LIpnE2.js → renderScheduler-DwOi4uKZ.js} +2 -2
  220. package/dist/client/assets/{requirementDiagram-BXWQKSXE-Bp5TqEho.js → requirementDiagram-BXWQKSXE-DUEtMGYN.js} +2 -2
  221. package/dist/client/assets/{rightPanelStore-DqMd0tFH.js → rightPanelStore-BWYBRVeP.js} +2 -2
  222. package/dist/client/assets/rotate-ccw-BSwk8mHM.js +1 -0
  223. package/dist/client/assets/rotate-cw-BsgLwrfv.js +1 -0
  224. package/dist/client/assets/runtime-CBB2It1x.js +6 -0
  225. package/dist/client/assets/runtime-Dydpcwo9.js +2 -0
  226. package/dist/client/assets/{sankeyDiagram-P5KCCOFB-C7KUHrP7.js → sankeyDiagram-P5KCCOFB-Bnb7-uIo.js} +2 -2
  227. package/dist/client/assets/{scheduledTasksSettings.logic-C3Mbc4mh.js → scheduledTasksSettings.logic-CFyLLJ0-.js} +3 -3
  228. package/dist/client/assets/{scroll-area-LhpLVf8r.js → scroll-area-iMm_YXqJ.js} +2 -2
  229. package/dist/client/assets/select-cvR_zMkG.js +2 -0
  230. package/dist/client/assets/{sequenceDiagram-WJ2MYXX4-Bs9mfTLC.js → sequenceDiagram-WJ2MYXX4-BKHWFnq6.js} +2 -2
  231. package/dist/client/assets/server-FMafPUns.js +2 -0
  232. package/dist/client/assets/session-BI6WO3-p.js +2 -0
  233. package/dist/client/assets/{session-logic-DneZDyPZ.js → session-logic-DVvClfzW.js} +5 -5
  234. package/dist/client/assets/settings-2-BbyXH0uI.js +1 -0
  235. package/dist/client/assets/settings-DRKdVCbB.js +1 -0
  236. package/dist/client/assets/{settings-C8FiUQu0.js → settings-Dzr6EHna.js} +2 -2
  237. package/dist/client/assets/settings.appearance-Dcbf4cgV.js +2 -0
  238. package/dist/client/assets/settings.archived-BI9u9Y07.js +2 -0
  239. package/dist/client/assets/{settings.computer-use-B3Ujc2AS.js → settings.computer-use-CE8rpPYM.js} +2 -2
  240. package/dist/client/assets/settings.connections-BWLCI5Zi.js +2 -0
  241. package/dist/client/assets/settings.data-controls-CmJZj_HT.js +2 -0
  242. package/dist/client/assets/{settings.decisions-C5UE4drK.js → settings.decisions-Bm-M9k3t.js} +2 -2
  243. package/dist/client/assets/settings.diagnostics-ao6ZzXXw.js +2 -0
  244. package/dist/client/assets/settings.general-BoU897Dm.js +2 -0
  245. package/dist/client/assets/{settings.integrations-BCtpk2dY.js → settings.integrations-ChLDKsIY.js} +2 -2
  246. package/dist/client/assets/{settings.keybindings-DfFrYXxY.js → settings.keybindings-BSg3FHQZ.js} +2 -2
  247. package/dist/client/assets/{settings.open-source-licenses-CqRM1gRd.js → settings.open-source-licenses-B4sC68Ud.js} +2 -2
  248. package/dist/client/assets/settings.plugins-CGUFRhFY.js +5 -0
  249. package/dist/client/assets/{settings.projects-CT-l0EfX.js → settings.projects-V3nNBIzc.js} +4 -4
  250. package/dist/client/assets/settings.providers-D1BgocCC.js +3 -0
  251. package/dist/client/assets/settings.scheduled-tasks-C-I22teI.js +2 -0
  252. package/dist/client/assets/{settings.snap-shot-BMxV-ClC.js → settings.snap-shot-aum1tmsR.js} +2 -2
  253. package/dist/client/assets/settings.source-control-8YMYuva4.js +2 -0
  254. package/dist/client/assets/{settings.storage-DKm6BZ2r.js → settings.storage-e3yKBYeM.js} +2 -2
  255. package/dist/client/assets/settingsLayout-BUbXPq57.js +3 -0
  256. package/dist/client/assets/shield-check-CG2tOYd1.js +1 -0
  257. package/dist/client/assets/shield-question-mark-Mk3rAYhm.js +1 -0
  258. package/dist/client/assets/{sidebar-DI1ZJMkM.js → sidebar-CjtIIYSY.js} +2 -2
  259. package/dist/client/assets/{sidebarProjectGrouping-DXRKqrOP.js → sidebarProjectGrouping-BmTLes3y.js} +2 -2
  260. package/dist/client/assets/{skeleton-BlMPaSbD.js → skeleton-DzaiJbx8.js} +2 -2
  261. package/dist/client/assets/{sortable.esm-CnSn9HhJ.js → sortable.esm-Df_JB8i3.js} +2 -2
  262. package/dist/client/assets/{sourceControl-ogZI3Qhj.js → sourceControl-BfGzu06x.js} +2 -2
  263. package/dist/client/assets/{spinner-I_NrXl2i.js → spinner-RAU9Cg6j.js} +2 -2
  264. package/dist/client/assets/square-pen-BuwM-DT0.js +1 -0
  265. package/dist/client/assets/{standalone-page-C0mvdk0N.js → standalone-page-Bsaqnigq.js} +2 -2
  266. package/dist/client/assets/{stateDiagram-D77RDMKH-lcvbm4gc.js → stateDiagram-D77RDMKH-BhdX_IDZ.js} +2 -2
  267. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-Ba0Qofsh.js +2 -0
  268. package/dist/client/assets/{swimlanes-42K2YHIH-BftXRbCQ.js → swimlanes-42K2YHIH-T7QLMavY.js} +2 -2
  269. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-C9WqWw-N.js +9 -0
  270. package/dist/client/assets/{terminal-links-BWEpET__.js → terminal-links-B9s8s-tz.js} +2 -2
  271. package/dist/client/assets/{terminalSessions-CQOPPXfy.js → terminalSessions-BmqpP0Ss.js} +2 -2
  272. package/dist/client/assets/text-search-DyMq-QgY.js +1 -0
  273. package/dist/client/assets/{textarea-Bu723jDd.js → textarea-C9YeXMVc.js} +2 -2
  274. package/dist/client/assets/{themePalette-CAxv2FDZ.js → themePalette-C1oD3Oeg.js} +3 -3
  275. package/dist/client/assets/{threadSort-BoaTqeGH.js → threadSort-C4CtIL5v.js} +2 -2
  276. package/dist/client/assets/{timeline-definition-24CTP7MA-_aV_EuqE.js → timeline-definition-24CTP7MA-Dnja29q2.js} +2 -2
  277. package/dist/client/assets/toast-DEgXlTR7.js +2 -0
  278. package/dist/client/assets/{toggle-B5fidRv0.js → toggle-CNbzG8Ec.js} +2 -2
  279. package/dist/client/assets/{toggle-group-DCQTLIPb.js → toggle-group-DIqmqqKQ.js} +2 -2
  280. package/dist/client/assets/{tooltip-taOyJZax.js → tooltip-DyiHlEs0.js} +2 -2
  281. package/dist/client/assets/{treeView-Q6P3EWNA-ALGd5g_W.js → treeView-Q6P3EWNA-KHtw7wMC.js} +1 -1
  282. package/dist/client/assets/{treemap-WGGIJYW6-CGQrkzMs.js → treemap-WGGIJYW6-BZN3U17E.js} +1 -1
  283. package/dist/client/assets/{usage-DmGxFUdr.js → usage--nsoWaqi.js} +2 -2
  284. package/dist/client/assets/{usageAccess-CY-JtQnU.js → usageAccess-Dwz13Eun.js} +2 -2
  285. package/dist/client/assets/{usageFormat-Cs-UHzLq.js → usageFormat-Z0lz-RCF.js} +2 -2
  286. package/dist/client/assets/{usageShortcuts-CP952NDO.js → usageShortcuts-cwv5i-oF.js} +2 -2
  287. package/dist/client/assets/{use-atom-command-CQHjSXPR.js → use-atom-command-BVrZ0hTO.js} +2 -2
  288. package/dist/client/assets/{useAriaLabelledBy-4I5xhNlP.js → useAriaLabelledBy-z3tVAFR_.js} +2 -2
  289. package/dist/client/assets/{useHandleNewThread-Bzaf_PDE.js → useHandleNewThread-lAV5NpwQ.js} +2 -2
  290. package/dist/client/assets/{useLocation-QINZoaPz.js → useLocation-CxFbcar1.js} +2 -2
  291. package/dist/client/assets/useNavigate-CLQYZa7I.js +2 -0
  292. package/dist/client/assets/{useNavigateBack-CbbWf0z6.js → useNavigateBack-91jfuRCn.js} +2 -2
  293. package/dist/client/assets/{useParams-BTKEXLBT.js → useParams-nxAoxVO6.js} +2 -2
  294. package/dist/client/assets/{usePermissionStatus-Zbsv_90x.js → usePermissionStatus-CVCguZPP.js} +2 -2
  295. package/dist/client/assets/{usePullRequestActions-DGTJ6ne6.js → usePullRequestActions-Cp-f2-rS.js} +3 -3
  296. package/dist/client/assets/{useRegisterFieldControl-Cr87Snzk.js → useRegisterFieldControl-hMeYQdpT.js} +2 -2
  297. package/dist/client/assets/useScopedModelAvailability-1rkaoEPh.js +2 -0
  298. package/dist/client/assets/useSettings-BCUX_14n.js +3 -0
  299. package/dist/client/assets/{useT3ConnectAuthPrompt-BYqrzQIx.js → useT3ConnectAuthPrompt-B1AHMyDF.js} +2 -2
  300. package/dist/client/assets/{utils-DmfMX1v5.js → utils-Cbsb1ks0.js} +18 -18
  301. package/dist/client/assets/vcsRefInvalidation-DMlloB2h.js +2 -0
  302. package/dist/client/assets/{vennDiagram-4TSXK5OY-9Jx7JrgE.js → vennDiagram-4TSXK5OY-B4KHYxz_.js} +2 -2
  303. package/dist/client/assets/{wardley-WFR3VGLG-qG58RzFw.js → wardley-WFR3VGLG-EUhzOM0w.js} +1 -1
  304. package/dist/client/assets/{wardleyDiagram-VM6X3IG4-8Ml3tzfR.js → wardleyDiagram-VM6X3IG4-25okiPRC.js} +2 -2
  305. package/dist/client/assets/{welcome-CPcQsM9H.js → welcome-pBX3QtZq.js} +2 -2
  306. package/dist/client/assets/{xychartDiagram-S5SC5T6Z-C-u_0wo0.js → xychartDiagram-S5SC5T6Z-Dyo2i7yf.js} +2 -2
  307. package/dist/client/index.html +1 -1
  308. package/package.json +1 -1
  309. package/dist/client/assets/ChatGptUsageButton-D93cMeTp.js +0 -2
  310. package/dist/client/assets/CodexSetupSection.logic-DJw6xB7P.js +0 -2
  311. package/dist/client/assets/DiffPanel-Dqh76p3E.js +0 -2
  312. package/dist/client/assets/PreviewPanel-QkMfuC1J.js +0 -2
  313. package/dist/client/assets/ProjectDefaultsSettings-C6wxaRmJ.js +0 -2
  314. package/dist/client/assets/ProjectIconPickerDialog-GDqk2LEH.js +0 -2
  315. package/dist/client/assets/ScheduledTasksSettings-DFtwNfb8.js +0 -4
  316. package/dist/client/assets/SettingsPanels-CI-FknGh.js +0 -39
  317. package/dist/client/assets/_chat-BKcYL38S.js +0 -45
  318. package/dist/client/assets/architecture-7GRP2DOG-DqzmsB35.js +0 -1
  319. package/dist/client/assets/archive-x-BN7DYXYC.js +0 -2
  320. package/dist/client/assets/arrow-left-DI1Oo3nI.js +0 -1
  321. package/dist/client/assets/arrow-right-DRgAj8le.js +0 -1
  322. package/dist/client/assets/arrow-up-down-C6OEPUz7.js +0 -1
  323. package/dist/client/assets/assets-_CWIS9vb.js +0 -2
  324. package/dist/client/assets/bell-DW1iPWzH.js +0 -1
  325. package/dist/client/assets/blocks-DKOyf4K4.js +0 -1
  326. package/dist/client/assets/bot-DYcBiSui.js +0 -1
  327. package/dist/client/assets/calendar-clock-BqL7OneL.js +0 -1
  328. package/dist/client/assets/channel-DbsUczqI.js +0 -2
  329. package/dist/client/assets/chart-no-axes-column-CtQ7A5KE.js +0 -1
  330. package/dist/client/assets/classDiagram-ZZMXUADV-DotTjRcO.js +0 -2
  331. package/dist/client/assets/classDiagram-v2-VYDZK3BY-DotTjRcO.js +0 -2
  332. package/dist/client/assets/corner-left-up-BT-2gfvH.js +0 -1
  333. package/dist/client/assets/device-C_oIGJqy.js +0 -2
  334. package/dist/client/assets/download-DNjijPHR.js +0 -1
  335. package/dist/client/assets/dynamic-p5s8CQGu.js +0 -3
  336. package/dist/client/assets/earth-DGA4iwBJ.js +0 -1
  337. package/dist/client/assets/ellipsis-Cbd-Ac19.js +0 -1
  338. package/dist/client/assets/entities-82m-Smm-.js +0 -2
  339. package/dist/client/assets/eventmodeling-NTZA5JFV-OEIkdS25.js +0 -1
  340. package/dist/client/assets/eye-BUplLfz9.js +0 -1
  341. package/dist/client/assets/file-search-CcnLiCku.js +0 -1
  342. package/dist/client/assets/fileContextMenu-Dcs50sFI.js +0 -2
  343. package/dist/client/assets/flowDiagram-HODETNUW-BDZPeVYD.js +0 -1
  344. package/dist/client/assets/folder-git-2-5RczFn6m.js +0 -1
  345. package/dist/client/assets/folder-open-PwiT4lvQ.js +0 -1
  346. package/dist/client/assets/folder-plus--IokSBmG.js +0 -1
  347. package/dist/client/assets/git-branch-jf-x2c63.js +0 -1
  348. package/dist/client/assets/grip-vertical-OASdudbE.js +0 -1
  349. package/dist/client/assets/hard-drive-BxN5msOb.js +0 -1
  350. package/dist/client/assets/history-DdVU5lcf.js +0 -1
  351. package/dist/client/assets/house-mbks5FAa.js +0 -1
  352. package/dist/client/assets/index-1HGbj0-7.js +0 -3
  353. package/dist/client/assets/keyboard-DckDn_SM.js +0 -1
  354. package/dist/client/assets/link-Dw3ue0Rm.js +0 -1
  355. package/dist/client/assets/list-1rglB5Lq.js +0 -1
  356. package/dist/client/assets/loader-CRsWQXUs.js +0 -2
  357. package/dist/client/assets/main-BB3F4O6Y.js +0 -30
  358. package/dist/client/assets/main-CnVegMVf.css +0 -2
  359. package/dist/client/assets/message-circle-question-mark-CLPs5tYP.js +0 -1
  360. package/dist/client/assets/message-square-BInn4EwR.js +0 -1
  361. package/dist/client/assets/message-square-dashed-Dea7_sXv.js +0 -1
  362. package/dist/client/assets/mouse-pointer-2-BPl1Yb5N.js +0 -1
  363. package/dist/client/assets/openFileInPreview-C3O_ayUT.js +0 -2
  364. package/dist/client/assets/palette-DC6st-Ld.js +0 -1
  365. package/dist/client/assets/panel-left-BxNE-mqR.js +0 -1
  366. package/dist/client/assets/panels-top-left-CpwWAaSX.js +0 -1
  367. package/dist/client/assets/primary-uszZTzpR.js +0 -2
  368. package/dist/client/assets/primaryCloudLinkState-CWT2YTBZ.js +0 -2
  369. package/dist/client/assets/projectFilesQueryState-ELgLflk5.js +0 -2
  370. package/dist/client/assets/pullRequests-DjbQ49mZ.js +0 -2
  371. package/dist/client/assets/puzzle-foT3lPUZ.js +0 -1
  372. package/dist/client/assets/queries-Cq5C9N-K.js +0 -2
  373. package/dist/client/assets/query-DpwJQzeq.js +0 -2
  374. package/dist/client/assets/railroad-abnf-HS5TGJTU-C_4g8TOP.js +0 -1
  375. package/dist/client/assets/railroad-ebnf-LZEXJU2U-CHZB5YoP.js +0 -1
  376. package/dist/client/assets/railroad-peg-WCYAUIDC-B-PbMjlp.js +0 -1
  377. package/dist/client/assets/rotate-ccw-rssHZoOL.js +0 -1
  378. package/dist/client/assets/rotate-cw-D726GGah.js +0 -1
  379. package/dist/client/assets/runtime-BQJQC-Ny.js +0 -6
  380. package/dist/client/assets/runtime-C6FwphD-.js +0 -2
  381. package/dist/client/assets/select-B4VvMEs2.js +0 -2
  382. package/dist/client/assets/server-BD_Y5Gsn.js +0 -2
  383. package/dist/client/assets/session-DsbInyNV.js +0 -2
  384. package/dist/client/assets/settings-2-Qrnq-5XQ.js +0 -1
  385. package/dist/client/assets/settings-MUAsYy_j.js +0 -1
  386. package/dist/client/assets/settings.appearance-B5-X4oyX.js +0 -2
  387. package/dist/client/assets/settings.archived-DVUmF0nS.js +0 -2
  388. package/dist/client/assets/settings.connections-EQYBOa7e.js +0 -2
  389. package/dist/client/assets/settings.diagnostics-CBcOEqPM.js +0 -2
  390. package/dist/client/assets/settings.general-BOmr4mSV.js +0 -2
  391. package/dist/client/assets/settings.plugins-DC4js6dE.js +0 -5
  392. package/dist/client/assets/settings.providers-CJuBTAiR.js +0 -3
  393. package/dist/client/assets/settings.scheduled-tasks-CvLNaadX.js +0 -2
  394. package/dist/client/assets/settings.source-control-DJWucVsM.js +0 -2
  395. package/dist/client/assets/settingsLayout-jP1a50ek.js +0 -3
  396. package/dist/client/assets/shield-check-k2SY7zjx.js +0 -2
  397. package/dist/client/assets/shield-question-mark-kKJBH4Uj.js +0 -1
  398. package/dist/client/assets/square-pen-DilH8raK.js +0 -1
  399. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-DuLLhUia.js +0 -2
  400. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-BrHQKVnf.js +0 -9
  401. package/dist/client/assets/text-search-DpDcKspl.js +0 -1
  402. package/dist/client/assets/toast-CjelgyqV.js +0 -2
  403. package/dist/client/assets/useNavigate-4thj06GJ.js +0 -2
  404. package/dist/client/assets/useScopedModelAvailability-BEfh0WXx.js +0 -2
  405. package/dist/client/assets/useSettings-CLtJrOYI.js +0 -3
  406. package/dist/client/assets/vcsRefInvalidation-nP-qgsHs.js +0 -2
@@ -406,7 +406,7 @@
406
406
  </script>
407
407
  <style>html,body,#root{width:100%;height:100%;margin:0}body{color:#262626;background:#fff;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,system-ui,sans-serif}html.dark body{color:#f5f5f5;background:#0a0a0a}#boot-shell{background:inherit;min-height:100%;color:inherit;justify-content:center;align-items:center;display:flex;position:relative;overflow:hidden}html[data-theme-selected=true] #boot-shell{background:var(--boot-background);color:var(--boot-foreground)}#boot-shell-card{z-index:1;justify-content:center;align-items:center;width:96px;height:96px;display:flex;position:relative}#boot-shell-logo{object-fit:contain;width:64px;height:64px}#boot-error{text-align:center;justify-items:center;gap:16px;max-width:600px;padding:24px;display:grid}#boot-error p{overflow-wrap:anywhere;margin:0}#boot-error button{color:inherit;font:inherit;cursor:pointer;background:0 0;border:1px solid;border-radius:4px;padding:8px 16px}</style>
408
408
  <title>P4 Code</title>
409
- <script type="module" crossorigin src="/assets/index-1HGbj0-7.js"></script>
409
+ <script type="module" crossorigin src="/assets/index-EKWtrZNr.js"></script>
410
410
  </head>
411
411
  <body>
412
412
  <div id="root">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@p4code/cli",
3
- "version": "0.8.3",
3
+ "version": "0.8.5",
4
4
  "description": "P4 Code coding agent server and command-line client",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1,2 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Ax as n,Bh as r,Bm as i,Cl as a,Hl as o,Hm as s,Nh as c,Vl as l,Vm as u,Xt as d,Ym as f,_m as p,cm as m,dm as h,ha as g,il as _,lm as v,ov as y,pg as b,ph as x,rh as S,sr as ee,t as C,ug as te,vl as ne,xl as re}from"./utils-DmfMX1v5.js";import{t as ie}from"./external-link-NWS0I_zo.js";import{q as ae}from"./useSettings-CLtJrOYI.js";import{r as oe,s as se,t as w,x as ce}from"./Icons-DA4msgfR.js";var T=e(t(),1),E=n(),D=e(g(),1),O=6e4,k=60*O,A=24*k,j=`https://chatgpt.com/#settings/Usage`;function le(e){return e?.auth.status===`authenticated`&&e.auth.subscriptionSharing===!0}var M=[{id:`totalPercentUsed`,label:`Overall`,description:`Combined usage across both allowances, not a third quota.`},{id:`autoPercentUsed`,label:`Cursor Models`,description:`Grok and Composer use this first. Auto can use either pool.`},{id:`apiPercentUsed`,label:`Other Models`,description:`Claude, GPT, and Gemini use this pool. Grok and Composer fall back here.`}];function ue(e){return M.find(t=>t.id===e)}function N(e){let t=M.findIndex(t=>t.id===e);return t<0?M.length:t}function P(e){return e.filter(e=>e.enabled&&e.installed&&_(e)&&e.usageLimits!==void 0)}function de(e){let t=new Map;for(let n of e.values())for(let e of P(n.serverConfig?.providers??[])){let r=e.usageLimits?.externalUsage;if(r&&e.auth.status===`authenticated`){let i=`${e.displayName??e.instanceId} on ${n.entry.target.label}`;t.set(r.url,{...r,message:e.usageLimits?.unavailable?.message,accounts:[...new Set([...t.get(r.url)?.accounts??[],i])]})}}return[...t.values()]}function F(e,t,n){let r=t?.trim().toLowerCase();return r?`${e}:${r}`:n?.credentialFingerprint?`${e}:credential:${n.credentialFingerprint}`:null}var I=e=>({driver:e.driver,email:e.auth.email,workspaceId:e.auth.workspaceId,usageLimits:e.usageLimits});function L(e){let t=new Map,n=new Map;for(let r of e){let e=F(r.driver,r.email,r.usageLimits);if(e&&r.workspaceId){t.set(e,(t.get(e)??new Set).add(r.workspaceId));let i=`${r.driver}:${r.workspaceId}`;n.set(i,(n.get(i)??new Set).add(e))}}return e=>{let r=F(e.driver,e.email,e.usageLimits);if(!r){if(!e.workspaceId)return null;let t=n.get(`${e.driver}:${e.workspaceId}`);return t?.size===1?`${[...t][0]}:${e.workspaceId}`:null}if(e.workspaceId)return`${r}:${e.workspaceId}`;let i=t.get(r);return i?i.size===1?`${r}:${[...i][0]}`:null:r}}function fe(e){let t=new Map,n=new Map,r=new Map,i=(e,i)=>{let a=r.get(e);i.redeem&&`sourceId`in i.redeem.input&&(!a||Date.parse(i.limits.checkedAt)>Date.parse(a.limits.checkedAt))&&r.set(e,i);let o=n.get(e);i.limits.resetCredits&&(!o||Date.parse(i.limits.checkedAt)>Date.parse(o.limits.checkedAt))&&n.set(e,i);let s=t.get(e);if(!s){t.set(e,i);return}let c=Date.parse(i.limits.checkedAt)>Date.parse(s.limits.checkedAt),l=[...s.environments,...i.environments.filter(e=>!s.environments.some(t=>t.environmentId===e.environmentId))],u=c?i:s,d=n.get(e);t.set(e,{...s,displayName:s.displayName??i.displayName,email:s.email??i.email,plan:s.plan??i.plan,accentColor:s.accentColor??i.accentColor,environments:l,sourceLabel:l.length>0?null:s.sourceLabel??i.sourceLabel,redeem:r.get(e)?.redeem??(d?d.redeem:u.redeem??s.redeem??i.redeem),limits:{...u.limits,...d?.limits.resetCredits?{resetCredits:d.limits.resetCredits}:{resetCredits:void 0}}})},a=L([...e.values()].flatMap(e=>[...(e.serverConfig?.providers??[]).filter(e=>e.enabled).map(I),...(e.serverConfig?.usageLimitSources??[]).flatMap(e=>e.accounts)]));for(let[t,n]of e){let e=n.entry.target.label;for(let r of P(n.serverConfig?.providers??[]))r.usageLimits&&H(r.usageLimits)===null&&i(a(I(r))??`${t}:${r.instanceId}`,{key:`${t}:${r.instanceId}`,driver:r.driver,displayName:r.displayName?.trim()||null,email:r.auth.email,plan:r.auth.label,accentColor:r.accentColor,environments:[{environmentId:t,label:e}],sourceLabel:null,redeem:{environmentId:t,input:{instanceId:r.instanceId}},limits:r.usageLimits})}let o=e.size>1;for(let[t,n]of e)for(let e of n.serverConfig?.usageLimitSources??[]){let r=o?`${n.entry.target.label} · ${e.label}`:e.label;for(let n of e.accounts){if(H(n.usageLimits)!==null)continue;let o=`${e.id}:${n.id}${n.workspaceId?`:${n.workspaceId}`:``}`;i(a(n)??o,{key:o,driver:n.driver,displayName:n.email?null:n.id.replace(/\.json$/i,``),email:n.email,plan:n.plan,accentColor:void 0,environments:[],sourceLabel:r,redeem:n.usageLimits.resetCredits?.nextCreditId?{environmentId:t,input:{sourceId:e.id,accountId:n.id,creditId:n.usageLimits.resetCredits.nextCreditId}}:null,limits:n.usageLimits})}}return[...t.values()]}function pe(e){let t=(t,n)=>e.size>1?`${t} · ${n}`:n,n=[];for(let r of e.values()){let e=r.entry.target.label;for(let i of P(r.serverConfig?.providers??[])){if(i.usageLimits?.unavailable?.reason===`unsupported`)continue;let r=i.usageLimits?H(i.usageLimits):null,a=i.displayName?.trim()||String(i.driver);r&&n.push(`${t(e,a)}: ${r}`)}for(let i of r.serverConfig?.usageLimitSources??[])i.error?n.push(`${t(e,i.label)}: ${i.error}`):i.accounts.length===0&&n.push(`${t(e,i.label)}: No accounts reported.`)}return n}function me(e){if(e.driver===`antigravity`)return[...e.windows].sort((e,t)=>Number(!e.id.startsWith(`gemini-`))-Number(!t.id.startsWith(`gemini-`))||e.id.replace(/-(5h|weekly|quota)$/,``).localeCompare(t.id.replace(/-(5h|weekly|quota)$/,``))||R[e.kind]-R[t.kind]);if(e.driver!==`cursor`)return e.windows;let t=e.windows.some(e=>e.id===`autoPercentUsed`),n=e.windows.some(e=>e.id===`apiPercentUsed`),r=t&&n;return e.windows.filter(e=>!r||e.id!==`totalPercentUsed`).sort((e,t)=>N(e.id)-N(t.id))}var R={session:0,weekly:1,monthly:2,other:3};function z(e,t){let n=new Map;for(let t of e){let e=n.get(t.driver);e?e.push(t):n.set(t.driver,[t])}return[...n].map(([e,n])=>{let r=n.flatMap(e=>e.limits.windows).sort((e,t)=>R[e.kind]-R[t.kind])[0],i=t=>{let n=t.limits.windows.find(t=>r&&V(e,t)===V(e,r));return(n?U(n):null)??1/0},a=[...n].sort((e,t)=>i(e)-i(t)||B(e).localeCompare(B(t))||e.key.localeCompare(t.key));return{driver:e,accounts:a,windows:he(a,t)}})}function B(e){return(e.displayName??e.email??e.key).toLowerCase()}function V(e,t){return e===`codex`?t.kind:`${t.kind}:${t.id}`}function he(e,t){let n=new Map;for(let t of e)for(let e of t.limits.windows){let r=V(t.driver,e),i=n.get(r)?.some(e=>e.account===t)?`${e.kind}:${e.id}`:r,a=n.get(i);a?a.push({account:t,window:e}):n.set(i,[{account:t,window:e}])}return[...n].map(([n,r])=>{let i=new Map(r.map(e=>[e.account.key,e])),a=r[0].window,o=r[0].account.driver===`codex`?n:a.id,s=r.reduce((e,t)=>e+t.window.usedPercent,0)/r.length,c=r.flatMap(e=>{let n=W(e.window,t);return n===null?[]:[{used:e.window.usedPercent,elapsed:n}]}),l=c.reduce((e,t)=>e+t.used,0)/c.length,u=c.length>0?c.reduce((e,t)=>e+t.elapsed,0)/c.length:null,d=r.flatMap(e=>{let t=U(e.window);return t===null?[]:[{member:e,at:t,restoresPercent:Math.round(e.window.usedPercent/r.length)}]}).sort((e,t)=>e.at-t.at);return{id:o,kind:a.kind,label:a.label,members:r,columns:e.map(e=>i.get(e.key)??{account:e,window:null}),usedPercent:Math.round(s),remainingPercent:Math.round(100-s),pace:u===null?null:G(l,u),resets:d}}).sort((e,t)=>R[e.kind]-R[t.kind])}function H(e){return e.unavailable?.reason===`unsupported`?e.unavailable.message??`This account has no subscription limits.`:e.unavailable?.reason===`probeFailed`?e.unavailable.message??`Could not read limits.`:e.windows.length===0?`No limits reported.`:null}function ge(e){return Math.round(100-Math.max(0,Math.min(100,e.usedPercent)))}function U(e){if(e.resetsAt===void 0)return null;let t=Date.parse(e.resetsAt);return Number.isFinite(t)?t:null}function W(e,t){let n=U(e);if(n===null||e.windowDurationMins===void 0)return null;let r=e.windowDurationMins*O;return r<=0?null:Math.max(0,Math.min(1,(r-(n-t))/r))}function _e(e,t){let n=W(e,t);return n===null?null:G(e.usedPercent,n)}function G(e,t){let n=e-t*100;return n>5?`ahead`:n<-5?`under`:`on`}function K(e){let t=Math.max(0,e),n=Math.floor(t/A),r=Math.floor(t%A/k),i=Math.floor(t%k/O);return n>0?`${n}d ${r}h`:r>0?`${r}h ${i}m`:`${i}m`}function ve(e,t){let n=U(e);return n===null?null:n<=t?`resets now`:n-t<O?`Resets momentarily`:`resets in ${K(n-t)}`}var ye={name:`usage-limits`,description:`Show this provider's usage limits`};function be(e){return e.trim().toLowerCase()===`/usage-limits`}function q(e,t,n){return P(t).some(t=>t.driver===e)||n.some(t=>t.accounts.some(t=>t.driver===e)||t.error!==void 0&&t.accounts.length===0)}function J(e,t,n,r){let i=t.find(t=>t.instanceId===e);if(!i||!q(i.driver,t,n))return null;let a=P(t).filter(e=>e.driver===i.driver),o=L([...t.filter(e=>e.enabled).map(I),...n.flatMap(e=>e.accounts)]),s=new Set(a.flatMap(e=>{let t=o(I(e));return t&&e.usageLimits?.windows.length&&!e.usageLimits.unavailable?[t]:[]})),c=[],l=[];for(let e of a){if(!e.usageLimits)continue;let t=o(I(e)),r=n.flatMap(e=>e.accounts.map(t=>({source:e,account:t}))).filter(({account:e})=>t!==null&&o(e)===t&&e.usageLimits.resetCredits&&!H(e.usageLimits)).sort((e,t)=>Date.parse(t.account.usageLimits.checkedAt)-Date.parse(e.account.usageLimits.checkedAt))[0],i=r?.account.usageLimits.resetCredits?.nextCreditId,a=r&&(!e.usageLimits.resetCredits||Date.parse(r.account.usageLimits.checkedAt)>Date.parse(e.usageLimits.checkedAt));c.push({id:e.instanceId,driver:e.driver,label:`${e.displayName?.trim()||String(e.driver)} [${e.instanceId}]`,...e.auth.label?{plan:e.auth.label}:{},instanceId:e.instanceId,resetCreditInput:i&&r?{sourceId:r.source.id,accountId:r.account.id,creditId:i}:{instanceId:e.instanceId},...e.displayName?{displayName:e.displayName}:{},...e.accentColor?{accentColor:e.accentColor}:{},...e.auth.email?{email:e.auth.email}:{},limits:a?{...e.usageLimits,resetCredits:r.account.usageLimits.resetCredits}:e.usageLimits})}for(let e of n){let t=e.accounts.filter(e=>e.driver===i.driver);for(let n of t){let t=o(n);t&&s.has(t)||c.push({id:`${e.id}:${n.id}`,driver:n.driver,label:`${e.label} · ${n.id}`,sourceLabel:`CLI Proxy`,...n.usageLimits.resetCredits?.nextCreditId?{resetCreditInput:{sourceId:e.id,accountId:n.id,creditId:n.usageLimits.resetCredits.nextCreditId}}:{},...n.plan?{plan:n.plan}:{},...n.email?{email:n.email}:{},limits:n.usageLimits})}e.error&&(t.length>0||e.accounts.length===0)&&l.push(`${e.label}: ${e.error}`)}return{createdAt:te(b(r)),accounts:c,notices:l}}function Y(e){return e}function xe(e){let t=new Map;for(let n of e){if(t.has(n.driverKind))throw Error(`Provider driver '${n.driverKind}' is defined more than once.`);t.set(n.driverKind,n)}return{definitions:e,get:e=>e===void 0?void 0:t.get(e)}}var Se=f([`auto`,`binary`,`npx`,`uvx`]),Ce=o({source:f([`registry`,`local`]).pipe(r(y(`registry`)),x({title:`ACP source`,providerSettingsForm:{control:`select`,options:[{value:`registry`,label:`ACP Registry`},{value:`local`,label:`Local command`}]}})),enabled:s.pipe(r(y(!0)),x({providerSettingsForm:{hidden:!0}})),agentId:i.pipe(r(y(``)),x({title:`Registry agent ID`,description:`Agent identifier from the official ACP Registry, for example 'devin'.`,providerSettingsForm:{placeholder:`devin`,clearWhenEmpty:`persist`}})),commandPath:i.pipe(r(y(``)),x({title:`Executable override`,description:`Executable on this environment. For registry agents, this overrides the distribution executable while keeping its arguments and environment.`,providerSettingsForm:{placeholder:`Registry default`,clearWhenEmpty:`omit`}})),commandArgs:u(S).pipe(r(y([])),x({providerSettingsForm:{hidden:!0}})),authMethodId:i.pipe(r(y(``)),x({title:`Authentication method`,description:`Optional ACP authentication method ID. By default, the first agent-managed method is selected.`,providerSettingsForm:{placeholder:`auto`,clearWhenEmpty:`omit`}})),distribution:Se.pipe(r(y(`auto`)),x({providerSettingsForm:{hidden:!0}})),customModels:u(S).pipe(r(y([])),x({providerSettingsForm:{hidden:!0}}))},{order:[`source`,`agentId`,`commandPath`,`authMethodId`]}),we=Y({driverKind:p.make(`acpRegistry`),label:`ACP Registry`,settingsSchema:Ce,hasDefaultInstance:!1,icon:{viewBox:`0 0 576 220`,fill:{light:`#000000`,dark:`#FFFFFF`},paths:[{d:`M568.003 115.821L517.278 27.9661C507.183 10.4816 489.084 0.0227367 468.894 0.0227367C448.727 0.0227367 430.674 10.4361 420.556 27.8752L343.251 161.749H242.755C236.23 161.749 230.386 158.384 227.135 152.745C223.861 147.106 223.861 140.376 227.135 134.715L277.861 46.8603C281.112 41.2216 286.955 37.8338 293.481 37.8338C300.006 37.8338 305.827 41.1988 309.101 46.8603L312.125 52.0897C313.353 54.2042 315.604 55.5002 318.036 55.5002C320.469 55.5002 322.743 54.1815 323.948 52.067L337.385 28.5118C338.795 26.0335 338.522 22.9413 336.703 20.7586C325.699 7.57131 309.874 0 293.322 0C292.662 0 292.003 0 291.321 0.0454733C272.04 0.75031 254.76 11.1864 245.074 27.9434L200.215 105.657L155.81 29.1484C145.465 11.2092 126.594 0.0227367 106.608 0.0227367C105.949 0.0227367 105.289 0.0227367 104.607 0.06821C85.3265 0.773047 68.0467 11.2092 58.3608 27.9661L7.65806 115.821C-6.25678 139.899 -0.868187 168.82 21.05 187.759C29.8945 195.422 41.6039 199.628 54.0181 199.628H148.648C151.081 199.628 153.332 198.332 154.56 196.217L168.52 172.026C169.748 169.911 169.748 167.319 168.52 165.205C167.292 163.09 165.041 161.794 162.608 161.794H56.0417C49.5163 161.794 43.6729 158.429 40.4216 152.79C37.1475 147.152 37.1475 140.422 40.4216 134.76L91.1471 46.9057C94.3985 41.2671 100.242 37.8793 106.767 37.8793C113.293 37.8793 119.113 41.2443 122.387 46.9057L194.826 172.526C195.031 172.89 195.258 173.208 195.531 173.526C198.76 178.665 202.83 183.485 207.786 187.782C216.631 195.444 228.34 199.651 240.754 199.651H321.424L315.581 209.769C314.353 211.883 314.353 214.475 315.581 216.59C316.809 218.704 319.059 220 321.492 220H349.436C351.868 220 354.119 218.704 355.347 216.59L364.396 200.901L367.17 196.468C367.17 196.468 367.261 196.331 367.284 196.263L453.274 46.9285C456.525 41.2898 462.369 37.902 468.894 37.902C475.42 37.902 481.263 41.2671 484.514 46.9285L535.24 134.783C538.491 140.422 538.514 147.174 535.24 152.813C531.988 158.452 526.145 161.84 519.62 161.84H418.669C416.236 161.84 413.985 163.136 412.757 165.25L398.774 189.442C397.546 191.556 397.546 194.148 398.774 196.263C400.002 198.377 402.253 199.673 404.686 199.673H518.21C539.81 199.673 559.295 188.237 569.026 169.843C578.053 152.79 577.666 132.623 567.981 115.843L568.003 115.821Z`}]}}),Te=o({enabled:s.pipe(r(y(!1)),x({providerSettingsForm:{hidden:!0}})),binaryPath:c(i).pipe(x({providerSettingsForm:{hidden:!0}})),apiEndpoint:c(i).pipe(x({providerSettingsForm:{hidden:!0}})),customModels:u(h).pipe(r(y([])),x({providerSettingsForm:{hidden:!0}}))},{order:[]}),Ee=Y({driverKind:p.make(`cursor`),label:`Cursor`,settingsSchema:Te,environmentFields:[{name:`CURSOR_API_KEY`,label:`Cursor API key`,description:`Optional. Overrides browser sign-in for this provider.`,placeholder:`Paste API key`,sensitive:!0}],icon:{viewBox:`0 0 466.73 532.09`,fill:{light:`#26251E`,dark:`#EDECEC`},paths:[{d:`M457.43,125.94L244.42,2.96c-6.84-3.95-15.28-3.95-22.12,0L9.3,125.94c-5.75,3.32-9.3,9.46-9.3,16.11v247.99c0,6.65,3.55,12.79,9.3,16.11l213.01,122.98c6.84,3.95,15.28,3.95,22.12,0l213.01-122.98c5.75-3.32,9.3-9.46,9.3-16.11v-247.99c0-6.65-3.55-12.79-9.3-16.11h-.01ZM444.05,151.99l-205.63,356.16c-1.39,2.4-5.06,1.42-5.06-1.36v-233.21c0-4.66-2.49-8.97-6.53-11.31L24.87,145.67c-2.4-1.39-1.42-5.06,1.36-5.06h411.26c5.84,0,9.49,6.33,6.57,11.39h-.01Z`}]}}),De=o({enabled:s.pipe(r(y(!1)),x({providerSettingsForm:{hidden:!0}})),binaryPath:l(`grok`).pipe(x({title:`Binary path`,description:`Path to the Grok CLI binary.`,providerSettingsForm:{placeholder:`grok`,clearWhenEmpty:`omit`}})),customModels:u(h).pipe(r(y([])),x({providerSettingsForm:{hidden:!0}}))},{order:[`binaryPath`]}),Oe=Y({driverKind:p.make(`grok`),label:`Grok`,settingsSchema:De,icon:{viewBox:`0 0 24 24`,fill:{light:`#0F0F0F`,dark:`#F5F5F5`},paths:[{d:`M9.26905 15.284L17.2479 9.36086C17.6391 9.07047 18.1981 9.18374 18.3845 9.63478C19.3655 12.0135 18.9272 14.8721 16.9755 16.8349C15.0238 18.7976 12.3082 19.228 9.8261 18.2477L7.1146 19.5102C11.0037 22.1834 15.7263 21.5223 18.6774 18.5525C21.0182 16.1985 21.7432 12.9897 21.0653 10.0961L21.0714 10.1023C20.0884 5.85143 21.3131 4.15233 23.8218 0.677913C23.8812 0.595532 23.9406 0.513151 24 0.428711L20.6987 3.74866V3.73836L9.267 15.2861`},{d:`M7.62249 16.7237C4.83113 14.0422 5.3124 9.89222 7.69417 7.49905C9.45541 5.72786 12.341 5.00497 14.86 6.06768L17.5653 4.81138C17.0779 4.45714 16.4533 4.07613 15.7365 3.80839C12.4966 2.46764 8.6178 3.13492 5.98413 5.78141C3.45081 8.32904 2.65415 12.2463 4.02219 15.5889C5.04412 18.0871 3.36889 19.8541 1.68137 21.6377C1.08337 22.2699 0.483318 22.9022 0 23.5716L7.62045 16.7257`}]}}),ke=o({enabled:s.pipe(r(y(!1)),x({providerSettingsForm:{hidden:!0}})),binaryPath:l(`muse`).pipe(x({title:`Binary path`,description:`Path to the Muse Code binary on this environment. Sign in with muse login on that host.`,providerSettingsForm:{placeholder:`muse`,clearWhenEmpty:`omit`}})),customModels:u(h).pipe(r(y([])),x({providerSettingsForm:{hidden:!0}}))},{order:[`binaryPath`]}),Ae=Y({driverKind:p.make(`muse`),label:`Muse Code`,settingsSchema:ke,badgeLabel:`Beta`,icon:{viewBox:`0 0 287.56 191`,fill:{light:`#0081fb`,dark:`#0081fb`},paths:[{d:`m31.06,125.96c0,10.98 2.41,19.41 5.56,24.51 4.13,6.68 10.29,9.51 16.57,9.51 8.1,0 15.51-2.01 29.79-21.76 11.44-15.83 24.92-38.05 33.99-51.98l15.36-23.6c10.67-16.39 23.02-34.61 37.18-46.96 11.56-10.08 24.03-15.68 36.58-15.68 21.07,0 41.14,12.21 56.5,35.11 16.81,25.08 24.97,56.67 24.97,89.27 0,19.38-3.82,33.62-10.32,44.87-6.28,10.88-18.52,21.75-39.11,21.75l0-31.02c17.63,0 22.03-16.2 22.03-34.74 0-26.42-6.16-55.74-19.73-76.69-9.63-14.86-22.11-23.94-35.84-23.94-14.85,0-26.8,11.2-40.23,31.17-7.14,10.61-14.47,23.54-22.7,38.13l-9.06,16.05c-18.2,32.27-22.81,39.62-31.91,51.75-15.95,21.24-29.57,29.29-47.5,29.29-21.27,0-34.72-9.21-43.05-23.09-6.8-11.31-10.14-26.15-10.14-43.06z`},{d:`m24.49,37.3c14.24-21.95 34.79-37.3 58.36-37.3 13.65,0 27.22,4.04 41.39,15.61 15.5,12.65 32.02,33.48 52.63,67.81l7.39,12.32c17.84,29.72 27.99,45.01 33.93,52.22 7.64,9.26 12.99,12.02 19.94,12.02 17.63,0 22.03-16.2 22.03-34.74l27.4-.86c0,19.38-3.82,33.62-10.32,44.87-6.28,10.88-18.52,21.75-39.11,21.75-12.8,0-24.14-2.78-36.68-14.61-9.64-9.08-20.91-25.21-29.58-39.71l-25.79-43.08c-12.94-21.62-24.81-37.74-31.68-45.04-7.39-7.85-16.89-17.33-32.05-17.33-12.27,0-22.69,8.61-31.41,21.78z`,gradient:{x1:61,y1:117,x2:259,y2:127,stops:[{offset:0,color:`#0064e1`},{offset:.4,color:`#0064e1`},{offset:.83,color:`#0073ee`},{offset:1,color:`#0082fb`}]}},{d:`m82.35,31.23c-12.27,0-22.69,8.61-31.41,21.78-12.33,18.61-19.88,46.33-19.88,72.95 0,10.98 2.41,19.41 5.56,24.51l-26.48,17.44c-6.8-11.31-10.14-26.15-10.14-43.06 0-30.75 8.44-62.8 24.49-87.55 14.24-21.95 34.79-37.3 58.36-37.3z`,gradient:{x1:45,y1:139,x2:45,y2:66,stops:[{offset:0,color:`#0082fb`},{offset:1,color:`#0064e0`}]}}]}}),je=o({enabled:s.pipe(r(y(!1)),x({providerSettingsForm:{hidden:!0}})),binaryPath:l(`opencode`).pipe(x({title:`Binary path`,description:`Path to the OpenCode binary.`,providerSettingsForm:{placeholder:`opencode`,clearWhenEmpty:`omit`}})),serverUrl:i.pipe(r(y(``)),x({title:`Server URL`,description:`Leave blank to let P4 Code spawn the server when needed.`,providerSettingsForm:{placeholder:`http://127.0.0.1:4096`,clearWhenEmpty:`omit`}})),serverPassword:i.pipe(r(y(``)),x({title:`Server password`,description:`Stored in plain text on disk.`,providerSettingsForm:{control:`password`,placeholder:`Optional`,clearWhenEmpty:`omit`}})),customModels:u(h).pipe(r(y([])),x({providerSettingsForm:{hidden:!0}}))},{order:[`binaryPath`,`serverUrl`,`serverPassword`]}),Me=Y({driverKind:p.make(`opencode`),label:`OpenCode`,settingsSchema:je,icon:{viewBox:`0 0 32 40`,fill:{light:`#211E1E`,dark:`#F1ECEC`},paths:[{d:`M24 32H8V16H24V32Z`,fill:{light:`#CFCECD`,dark:`#4B4646`}},{d:`M24 8H8V32H24V8ZM32 40H0V0H32V40Z`}]}}),Ne=o({enabled:s.pipe(r(y(!1)),x({providerSettingsForm:{hidden:!0}})),binaryPath:l(`pi`).pipe(x({title:`Binary path`,description:`Path to the Pi coding agent binary.`,providerSettingsForm:{placeholder:`pi`,clearWhenEmpty:`omit`}})),launchArgs:i.pipe(r(y(``)),x({title:`Launch arguments`,description:`Additional CLI arguments passed to pi --mode rpc on session start.`,providerSettingsForm:{clearWhenEmpty:`omit`}})),customModels:u(h).pipe(r(y([])),x({providerSettingsForm:{hidden:!0}}))},{order:[`binaryPath`,`launchArgs`]}),Pe=Y({driverKind:p.make(`pi`),label:`Pi`,settingsSchema:Ne,icon:{viewBox:`165.29 165.29 469.43 469.43`,fill:{light:`#0F0F0F`,dark:`#F5F5F5`},paths:[{d:`M165.29 165.29H517.36V400H400V517.36H282.65V634.72H165.29ZM282.65 282.65V400H400V282.65Z`,fillRule:`evenodd`},{d:`M517.36 400H634.72V634.72H517.36Z`}]}}),X=xe([{driverKind:p.make(`codex`),label:`Codex`,settingsSchema:a},{driverKind:p.make(`claudeAgent`),label:`Claude`,settingsSchema:re},Ee,Oe,Me,{driverKind:p.make(`antigravity`),label:`Antigravity`,settingsSchema:ne},Ae,Pe,we]);function Fe(e){let t=(0,E.c)(24),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({icon:r,className:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=(0,T.useId)(),o=r.viewBox,s;t[4]===n?s=t[5]:(s=C(`fill-(--icon-light) dark:fill-(--icon-dark)`,n),t[4]=n,t[5]=s);let c;t[6]!==r.fill.dark||t[7]!==r.fill.light?(c={"--icon-light":r.fill.light,"--icon-dark":r.fill.dark},t[6]=r.fill.dark,t[7]=r.fill.light,t[8]=c):c=t[8];let l=c,u;t[9]!==a||t[10]!==r.paths?(u=r.paths.some(Le)?(0,D.jsx)(`defs`,{children:r.paths.map((e,t)=>e.gradient?(0,D.jsx)(`linearGradient`,{id:`${a}-${t}`,x1:e.gradient.x1,y1:e.gradient.y1,x2:e.gradient.x2,y2:e.gradient.y2,gradientUnits:`userSpaceOnUse`,children:e.gradient.stops.map(Ie)},e.d):null)}):null,t[9]=a,t[10]=r.paths,t[11]=u):u=t[11];let d;if(t[12]!==a||t[13]!==r.paths){let e;t[15]===a?e=t[16]:(e=(e,t)=>(0,D.jsx)(`path`,{d:e.d,fillRule:e.fillRule,fill:e.gradient?`url(#${a}-${t})`:void 0,"data-icon-detail":e.fill?!0:void 0,className:e.fill?`fill-(--path-light) dark:fill-(--path-dark)`:void 0,style:e.fill?{"--path-light":e.fill.light,"--path-dark":e.fill.dark}:void 0},e.d),t[15]=a,t[16]=e),d=r.paths.map(e),t[12]=a,t[13]=r.paths,t[14]=d}else d=t[14];let f;return t[17]!==r.viewBox||t[18]!==i||t[19]!==s||t[20]!==l||t[21]!==u||t[22]!==d?(f=(0,D.jsxs)(`svg`,{...i,viewBox:o,fill:`none`,"data-provider-package-icon":!0,className:s,style:l,children:[u,d]}),t[17]=r.viewBox,t[18]=i,t[19]=s,t[20]=l,t[21]=u,t[22]=d,t[23]=f):f=t[23],f}function Ie(e){return(0,D.jsx)(`stop`,{offset:e.offset,stopColor:e.color},e.offset)}function Le(e){return e.gradient}var Re=`t3-acp-registry-icons-v1`,Z=524288,Q=new Map;async function $(e){if(!e.ok||e.redirected)throw Error(`ACP registry icon request failed.`);let t=e.headers.get(`content-type`)?.split(`;`,1)[0]?.trim()??``;if(!t.startsWith(`image/`))throw Error(`ACP registry icon was not an image.`);let n=Number(e.headers.get(`content-length`));if(Number.isFinite(n)&&n>Z)throw Error(`ACP registry icon was too large.`);let r=await e.arrayBuffer();if(r.byteLength>Z)throw Error(`ACP registry icon was too large.`);return new Blob([r],{type:t})}function ze(e){if(v(e)!==e)return Promise.reject(Error(`ACP registry icon URL was not allowed.`));let t=Q.get(e);if(t)return t;let n=(async()=>{let t=null;if(typeof caches<`u`)try{t=await caches.open(Re)}catch{}if(t!==null)try{let n=await t.match(e);if(n)return await $(n)}catch{}let n=await fetch(e,{credentials:`omit`,redirect:`error`,referrerPolicy:`no-referrer`}),r=n.clone(),i=await $(n);return await t?.put(e,r).catch(()=>void 0),i})();return Q.set(e,n),n.then(()=>Q.delete(e),()=>Q.delete(e)),n}function Be(e){let t=(0,E.c)(24),{icon:n,className:r,fallbackClassName:i}=e,a=(0,T.useId)(),o;t[0]===n?o=t[1]:(o=v(n),t[0]=n,t[1]=o);let s=o,[c,l]=(0,T.useState)(null),u=c?.iconUrl===s?c:null,d=u?.source??null,f=u?.status??`loading`,p,m;t[2]===s?(p=t[3],m=t[4]):(p=()=>{if(s===null)return;let e=!0,t=null;return ze(s).then(n=>{e&&(t=URL.createObjectURL(n),l({iconUrl:s,source:t,status:`loading`}))}).catch(()=>{e&&l(e=>e?.iconUrl===s?e:{iconUrl:s,source:s,status:`loading`})}),()=>{e=!1,t!==null&&URL.revokeObjectURL(t)}},m=[s],t[2]=s,t[3]=p,t[4]=m),(0,T.useEffect)(p,m);let h;t[5]===r?h=t[6]:(h=C(`relative flex size-8 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-muted text-muted-foreground`,r),t[5]=r,t[6]=h);let g,_;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,D.jsx)(`feFlood`,{floodColor:`currentColor`}),_=(0,D.jsx)(`feComposite`,{in2:`SourceAlpha`,operator:`in`}),t[7]=g,t[8]=_):(g=t[7],_=t[8]);let y;t[9]===a?y=t[10]:(y=(0,D.jsx)(`svg`,{"aria-hidden":!0,className:`pointer-events-none absolute size-0`,focusable:`false`,children:(0,D.jsx)(`defs`,{children:(0,D.jsxs)(`filter`,{id:a,colorInterpolationFilters:`sRGB`,children:[g,_]})})}),t[9]=a,t[10]=y);let b;t[11]!==i||t[12]!==f?(b=f===`loaded`?null:(0,D.jsx)(w,{className:C(`size-4`,i),"data-slot":`acp-icon-fallback`}),t[11]=i,t[12]=f,t[13]=b):b=t[13];let x;t[14]!==a||t[15]!==s||t[16]!==d||t[17]!==f?(x=d!==null&&f!==`failed`?(0,D.jsx)(`img`,{alt:``,className:C(`size-full object-contain`,f!==`loaded`&&`invisible absolute inset-0`),style:{filter:`url(#${a})`},decoding:`async`,referrerPolicy:`no-referrer`,src:d,onError:()=>{s!==null&&l(e=>e?.iconUrl===s&&e.source!==d?e:{iconUrl:s,source:d,status:`failed`})},onLoad:()=>{s!==null&&l({iconUrl:s,source:d,status:`loaded`})}}):null,t[14]=a,t[15]=s,t[16]=d,t[17]=f,t[18]=x):x=t[18];let S;return t[19]!==h||t[20]!==y||t[21]!==b||t[22]!==x?(S=(0,D.jsxs)(`span`,{"aria-hidden":!0,className:h,children:[y,b,x]}),t[19]=h,t[20]=y,t[21]=b,t[22]=x,t[23]=S):S=t[23],S}var Ve={[p.make(`codex`)]:ce,[p.make(`claudeAgent`)]:se,[p.make(`antigravity`)]:oe},He={[p.make(`codex`)]:`text-black dark:text-white`,[p.make(`claudeAgent`)]:`text-[#d97757]`,[p.make(`antigravity`)]:`text-[#5b87bf]`};function Ue(e){let t=X.get(e)?.icon;if(t)return{className:`text-(--icon-light) dark:text-(--icon-dark)`,style:{"--icon-light":t.fill.light,"--icon-dark":t.fill.dark}};let n=He[e];return n?{className:n}:{}}function We(e){return e.driverKind===`acpRegistry`?v(e.iconUrl??null)??m(e.agentId?.trim()||null):null}var Ge=(0,T.memo)(function(e){let t=(0,E.c)(32),n=Ve[e.driverKind]??null,r=X.get(e.driverKind)?.icon,i=e.indicatorBackground??`var(--card)`,a;t[0]===e.accentColor?a=t[1]:(a=e.accentColor?{"--provider-accent":e.accentColor}:void 0,t[0]=e.accentColor,t[1]=a);let o=a,s=e.badgeContent??`initials`,c=e.driverKind===`acpRegistry`,l;t[2]!==e.acpRegistryAgentId||t[3]!==e.acpRegistryIconUrl||t[4]!==e.driverKind?(l=We({driverKind:e.driverKind,agentId:e.acpRegistryAgentId,iconUrl:e.acpRegistryIconUrl}),t[2]=e.acpRegistryAgentId,t[3]=e.acpRegistryIconUrl,t[4]=e.driverKind,t[5]=l):l=t[5];let u=l,f;t[6]===e.className?f=t[7]:(f=C(`relative isolate z-30 inline-flex shrink-0 items-center justify-center overflow-visible`,e.className),t[6]=e.className,t[7]=f);let p;t[8]!==n||t[9]!==u||t[10]!==c||t[11]!==r||t[12]!==e.displayName||t[13]!==e.iconClassName?(p=c?(0,D.jsx)(Be,{className:C(`size-5 rounded-none bg-transparent`,e.iconClassName),fallbackClassName:`size-full`,icon:u}):r?(0,D.jsx)(Fe,{icon:r,className:C(`size-5 shrink-0`,e.iconClassName),"aria-hidden":!0}):n?(0,D.jsx)(n,{className:C(`size-5 shrink-0`,e.iconClassName),"aria-hidden":!0}):(0,D.jsx)(`span`,{className:C(`text-3xs font-semibold leading-none`,e.iconClassName),children:d(e.displayName)}),t[8]=n,t[9]=u,t[10]=c,t[11]=r,t[12]=e.displayName,t[13]=e.iconClassName,t[14]=p):p=t[14];let m;t[15]!==i||t[16]!==e.statusDotClassName?(m=e.statusDotClassName?(0,D.jsx)(`span`,{className:C(`pointer-events-none absolute -left-0.5 -top-0.5 z-10 size-2 rounded-full`,e.statusDotClassName),style:{boxShadow:`0 0 0 2px ${i}`},"aria-hidden":!0}):null,t[15]=i,t[16]=e.statusDotClassName,t[17]=m):m=t[17];let h;t[18]!==s||t[19]!==i||t[20]!==e.accentColor||t[21]!==e.badgeClassName||t[22]!==e.displayName||t[23]!==e.showBadge?(h=e.showBadge?(0,D.jsx)(`span`,{className:C(`pointer-events-none absolute right-0 bottom-0 z-10 flex h-3.5 min-w-3.5 items-center justify-center rounded-full border px-0.5 text-4xs font-semibold leading-none shadow-sm`,e.accentColor?`bg-(--provider-accent) text-white`:`bg-card text-muted-foreground`,e.badgeClassName),style:{borderColor:i},"aria-hidden":!0,children:s===`initials`?d(e.displayName):null}):null,t[18]=s,t[19]=i,t[20]=e.accentColor,t[21]=e.badgeClassName,t[22]=e.displayName,t[23]=e.showBadge,t[24]=h):h=t[24];let g;return t[25]!==o||t[26]!==e.accentColor||t[27]!==f||t[28]!==p||t[29]!==m||t[30]!==h?(g=(0,D.jsxs)(`span`,{className:f,style:o,"data-provider-accent-color":e.accentColor,children:[p,m,h]}),t[25]=o,t[26]=e.accentColor,t[27]=f,t[28]=p,t[29]=m,t[30]=h,t[31]=g):g=t[31],g});function Ke(e){let t=(0,E.c)(3),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,D.jsx)(ie,{className:`size-3.5`,"aria-hidden":`true`}),t[0]=n):n=t[0];let r;return t[1]===e?r=t[2]:(r=(0,D.jsxs)(ee,{variant:`ghost-muted`,size:`sm`,...e,onClick:qe,children:[`Manage usage`,n]}),t[1]=e,t[2]=r),r}function qe(){ae().shell.openExternal(j)}export{le as S,q as _,j as a,_e as b,fe as c,J as d,ue as f,ve as g,K as h,X as i,pe as l,W as m,Ge as n,ye as o,me as p,Ue as r,de as s,Ke as t,z as u,be as v,ge as x,H as y};
2
- //# sourceMappingURL=ChatGptUsageButton-D93cMeTp.js.map
@@ -1,2 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Ax as n,Cl as r,Ho as i,Nf as a,_m as o,bh as s,ha as c,l,nx as u,sr as d,vm as f,xl as p}from"./utils-DmfMX1v5.js";import{t as m}from"./check-Cmy7pM2Y.js";import{t as h}from"./chevron-right-NbahR9_s.js";import{t as g}from"./external-link-NWS0I_zo.js";import{L as _,U as v}from"./runtime-BQJQC-Ny.js";import{C as y,O as b,S as x,f as ee,q as te}from"./useSettings-CLtJrOYI.js";import{f as S}from"./server-BD_Y5Gsn.js";import{i as C,n as ne}from"./session-DsbInyNV.js";import{n as w}from"./query-DpwJQzeq.js";import{t as T}from"./use-atom-command-CQHjSXPR.js";import{n as E,t as D}from"./radio-group-fljQQ7Xp.js";import{t as re}from"./input-Cd_0h7h_.js";import{a as ie,c as ae,i as oe,r as se,s as ce,t as le}from"./dialog-Bn1u_Xoc.js";import{x as O}from"./Icons-DA4msgfR.js";import{t as k}from"./preview-CjgXQQdj.js";import{S as A,t as ue}from"./ChatGptUsageButton-D93cMeTp.js";import{a as de}from"./settingsLayout-jP1a50ek.js";import{Aa as j,Ki as fe,Ma as pe,fr as M,ja as me,ka as N,qi as he}from"./main-BB3F4O6Y.js";var P=e(t(),1),F=n(),I=e(c(),1);function L(e){let t=(0,F.c)(7),n,r;t[0]===e?(n=t[1],r=t[2]):({children:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,I.jsx)(O,{className:`size-4 shrink-0`,"aria-hidden":`true`}),t[3]=i):i=t[3];let a=n??`Continue with ChatGPT`,o;return t[4]!==r||t[5]!==a?(o=(0,I.jsxs)(d,{...r,children:[i,a]}),t[4]=r,t[5]=a,t[6]=o):o=t[6],o}function R(e){let t=(0,F.c)(23),{open:n,methods:r,onClose:i,onSelect:a}=e,o=r.filter(B),[s,c]=(0,P.useState)(null),l=s===`chatgpt-change-account`?s:o.find(e=>e.id===s)?.id??o[0]?.id??`chatgpt-change-account`,u=le,d;t[0]===i?d=t[1]:(d=e=>{e||i()},t[0]=i,t[1]=d);let f=ce,p;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,I.jsxs)(ie,{children:[(0,I.jsx)(ae,{children:`Reconnect ChatGPT`}),(0,I.jsx)(se,{children:`On OpenAI, sign in with the account you choose here.`})]}),t[2]=p):p=t[2];let m=E,h;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(h=e=>c(e),t[3]=h):h=t[3];let g=o.map(z),_;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,I.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3 rounded-lg border px-3 py-3 text-sm`,children:[(0,I.jsx)(D,{value:`chatgpt-change-account`}),(0,I.jsx)(`span`,{className:`font-medium`,children:`Use a different account`})]}),t[4]=_):_=t[4];let v;t[5]!==m||t[6]!==l||t[7]!==h||t[8]!==g?(v=(0,I.jsx)(`div`,{className:`px-6 pb-6`,children:(0,I.jsxs)(m,{"aria-label":`ChatGPT account to connect`,value:l,onValueChange:h,children:[g,_]})}),t[5]=m,t[6]=l,t[7]=h,t[8]=g,t[9]=v):v=t[9];let y;t[10]!==a||t[11]!==l?(y=(0,I.jsx)(oe,{children:(0,I.jsx)(L,{onClick:()=>a(l)})}),t[10]=a,t[11]=l,t[12]=y):y=t[12];let b;t[13]!==f||t[14]!==p||t[15]!==v||t[16]!==y?(b=(0,I.jsxs)(f,{children:[p,v,y]}),t[13]=f,t[14]=p,t[15]=v,t[16]=y,t[17]=b):b=t[17];let x;return t[18]!==u||t[19]!==n||t[20]!==d||t[21]!==b?(x=(0,I.jsx)(u,{open:n,onOpenChange:d,children:b}),t[18]=u,t[19]=n,t[20]=d,t[21]=b,t[22]=x):x=t[22],x}function z(e){return(0,I.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3 rounded-lg border px-3 py-3 text-sm`,children:[(0,I.jsx)(D,{value:e.id}),(0,I.jsx)(`span`,{className:`min-w-0 break-all font-medium`,children:e.name})]},e.id)}function B(e){return e.id.startsWith(`chatgpt-profile:`)}function V(e){let t=(0,F.c)(36),{environmentId:n,onClose:r,renderSetup:s,onAccountCreated:c}=e,u=C(n,a),p=ee(n),m;t[0]===n?m=t[1]:(m=S.providersValueAtom(n),t[0]=n,t[1]=m);let h=i(m),g=T(S.updateSettings,`Add ChatGPT account`),[_,v]=(0,P.useState)(`Personal`),y;t[2]===_?y=t[3]:(y=_.trim(),t[2]=_,t[3]=y);let b=`ChatGPT - ${y}`,[x,te]=(0,P.useState)(null),[w,E]=(0,P.useState)(!1),D=h?.find(e=>e.instanceId===x),ie=A(D),ae=(0,P.useEffectEvent)(r);(0,P.useEffect)(()=>{ie&&ae()},[ie]);let oe;t[4]!==b||t[5]!==n||t[6]!==_||t[7]!==c||t[8]!==r||t[9]!==w||t[10]!==p||t[11]!==g?(oe=async()=>{if(w||!_.trim()||!ne(n,`providers:manage`))return;E(!0);let e=f.make(`codex_${l()}`);(await g({environmentId:n,input:{patch:{providerInstances:{...p.providerInstances,[e]:{driver:o.make(`codex`),displayName:b,enabled:!0,config:{enabled:!0,setupMode:`managed`}}}}}}))._tag===`Success`&&(c?(c(e,b),r()):te(e)),E(!1)},t[4]=b,t[5]=n,t[6]=_,t[7]=c,t[8]=r,t[9]=w,t[10]=p,t[11]=g,t[12]=oe):oe=t[12];let se=oe,ce=le,O=!ie,k;t[13]===r?k=t[14]:(k=e=>{e||r()},t[13]=r,t[14]=k);let ue=pe,fe=x?b:`Add ChatGPT account`,M;t[15]===fe?M=t[16]:(M=(0,I.jsx)(j,{title:fe,description:`Each account has its own Codex instance and sign-in. Choose the other account on the sign-in page.`}),t[15]=fe,t[16]=M);let he=me,L=x?D?.setup?s(x,D):(0,I.jsx)(de,{title:`Codex runtime`,description:`Preparing managed setup.`}):(0,I.jsx)(`form`,{id:`add-codex-account`,onSubmit:e=>{e.preventDefault(),se()},children:(0,I.jsx)(de,{title:`Account name`,description:`Shown in the provider list and model picker.`,control:(0,I.jsx)(re,{"aria-label":`Account name`,value:_,disabled:w,onChange:e=>v(e.target.value),placeholder:`e.g. Personal or Work`})})}),R;t[17]!==he||t[18]!==L?(R=(0,I.jsx)(he,{children:L}),t[17]=he,t[18]=L,t[19]=R):R=t[19];let z;t[20]!==u||t[21]!==x||t[22]!==_||t[23]!==r||t[24]!==w?(z=(0,I.jsx)(N,{children:x?(0,I.jsx)(d,{variant:`outline`,onClick:r,children:`Finish later`}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(d,{variant:`outline`,disabled:w,onClick:r,children:`Cancel`}),(0,I.jsx)(d,{type:`submit`,form:`add-codex-account`,disabled:w||!_.trim()||!u,children:w?`Adding account…`:`Continue`})]})}),t[20]=u,t[21]=x,t[22]=_,t[23]=r,t[24]=w,t[25]=z):z=t[25];let B;t[26]!==ue||t[27]!==R||t[28]!==z||t[29]!==M?(B=(0,I.jsxs)(ue,{size:`wide`,children:[M,R,z]}),t[26]=ue,t[27]=R,t[28]=z,t[29]=M,t[30]=B):B=t[30];let V;return t[31]!==ce||t[32]!==B||t[33]!==O||t[34]!==k?(V=(0,I.jsx)(ce,{open:O,onOpenChange:k,children:B}),t[31]=ce,t[32]=B,t[33]=O,t[34]=k,t[35]=V):V=t[35],V}var ge=s(p),_e=s(r),ve=/^[A-Za-z0-9_./:\\-]+$/;function ye(e,t,n){return ve.test(e)&&(n===`windows`||!e.includes(`\\`))?e:n===`windows`?`& '${e.replaceAll(`'`,`''`)}'`:n===`darwin`||n===`linux`?e.startsWith(`~/`)||e.startsWith(`~\\`)?`~/'${e.slice(2).replaceAll(`'`,`'"'"'`)}'`:`'${e.replaceAll(`'`,`'"'"'`)}'`:t}function be(e){return e===void 0?`checking`:!e.enabled||e.status===`disabled`?`disabled`:!e.installed&&e.status===`warning`&&e.auth.status===`unknown`?`checking`:e.installed?e.auth.status===`unauthenticated`?`signIn`:e.status===`ready`?`ready`:`attention`:`install`}var H={checking:0,disabled:1,install:2,attention:3,signIn:4,ready:5};function xe(e){let t=new Map;for(let n of e??[]){let e=t.get(n.driver);(e===void 0||H[be(n)]>H[be(e)])&&t.set(n.driver,n)}return t}var Se={claudeAgent:{windows:`irm https://claude.ai/install.ps1 | iex`,posix:`curl -fsSL https://claude.ai/install.sh | bash`},codex:{windows:`irm https://chatgpt.com/codex/install.ps1 | iex`,posix:`curl -fsSL https://chatgpt.com/codex/install.sh | sh`}};function Ce(e,t){let n=Se[e];return t===`windows`?n.windows:n.posix}function we(e,t,n){let r=t.providerInstances[e.instanceId];if(e.driver===`claudeAgent`){let e=ge(r?.config??{});return`${ye(u(e)?e.value.binaryPath:`claude`,`claude`,n)} auth login`}if(e.driver===`codex`){let e=_e(r?.config??{});return`${ye(u(e)?e.value.binaryPath:`codex`,`codex`,n)} login`}return e.driver}var Te={disabled:{dot:`bg-muted-foreground/50`},error:{dot:`bg-destructive`},ready:{dot:`bg-success`},warning:{dot:`bg-warning`}};function U(e){if(!e)return{headline:`Checking provider status`,detail:`Waiting for the server to report installation and authentication details.`};if(!e.enabled||e.status===`disabled`)return{headline:`Disabled`,detail:e.message??`This provider is installed but disabled for new sessions in P4 Code.`};if(!e.installed)return{headline:`Not found`,detail:e.message??`CLI not detected on PATH.`};if(e.auth.status===`unauthenticated`){let t=e.auth.label??e.auth.type;return{headline:t?`Not authenticated · ${t}`:`Not authenticated`,detail:e.message??null}}if(e.status===`warning`)return{headline:`Needs attention`,detail:e.message??`The provider is installed, but the server could not fully verify it.`};if(e.status===`error`)return{headline:`Unavailable`,detail:e.message??`The provider failed its startup checks.`};if(e.auth.status===`authenticated`){let t=e.auth.label??e.auth.type;return{headline:t?`Authenticated · ${t}`:`Authenticated`,detail:e.message??null}}return{headline:`Available`,detail:e.message??null}}function Ee(e){if(!e)return null;let t=/^agy_acp_server_(\d{4})(\d{2})(\d{2})_\d+(?:_(\w+))?$/.exec(e);if(t){let[,e,n,r,i]=t;return`${e}-${n}-${r}${i?` ${i}`:``}`}return/^\d/.test(e)?`v${e}`:e}var De={graceful:`Limited support`,unsupported:`Unsupported version`,broken:`Known broken version`};function Oe(e,t,n=!0){let r=t?.latestVersionStatus===`broken`||t?.latestVersionStatus===`unsupported`;if(n&&t&&(t.status===`graceful`||t.status===`unsupported`||t.status===`broken`)){let n=t.recommendedVersion,i=Ee(n)??t.recommendedRange;return{title:De[t.status],detail:t.message??(i?`Use ${i} for full support.`:`Update for full support.`),updateCommand:n||r?null:e?.updateCommand??null,emphasis:t.status===`graceful`?`normal`:`strong`,targetVersion:n}}if(!e||e.status===`current`||e.status===`unknown`||r)return null;let i=`Update available`,a=e.latestVersion,o=Ee(a);return{title:i,detail:e.message??(o?`${i}: install ${o}.`:`${i}: install the latest provider version.`),updateCommand:e.updateCommand,emphasis:`normal`,targetVersion:null}}var ke=()=>void 0;function Ae(e){let t=(0,F.c)(11),[n,r]=(0,P.useState)(!1),i;t[0]===e.provider?i=t[1]:(i=be(e.provider),t[0]=e.provider,t[1]=i);let a=i,o=e.enabled&&a===`ready`,s=e.provider?.auth.status===`authenticated`,c=a===`checking`,l;t[2]===e.provider?l=t[3]:(l=U(e.provider),t[2]=e.provider,t[3]=l);let u=l,f;return t[4]!==s||t[5]!==c||t[6]!==o||t[7]!==u||t[8]!==e||t[9]!==n?(f=e.mode===`existing`&&e.presentation===`onboarding`?(0,I.jsx)(Pe,{title:e.displayName||e.provider?.displayName||`Codex`,description:o?e.provider?.auth.email?.trim()?(0,I.jsxs)(I.Fragment,{children:[`Signed in as`,` `,(0,I.jsx)(M,{value:e.provider.auth.email.trim(),ariaLabel:`Toggle account email visibility`,revealTooltip:`Click to reveal email`,hideTooltip:`Click to hide email`,className:`break-all`}),`.`]}):`Connected with your Codex CLI.`:c?`Checking your Codex CLI...`:e.provider?.installed?u.headline:`Code with your ChatGPT subscription.`,control:o?(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs font-medium text-success-foreground`,children:[(0,I.jsx)(m,{className:`size-3.5`}),`Ready`]}):c?(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Checking...`}):s?(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:u.headline}):(0,I.jsx)(L,{size:`sm`,disabled:e.readOnly,onClick:()=>{r(!0),e.onModeChange(`managed`)},children:`Continue with ChatGPT`}),secondaryControl:!s&&!o&&!c?(0,I.jsx)(d,{size:`sm`,variant:`ghost-muted`,onClick:()=>e.onModeChange(`existing`),children:`Use existing CLI`}):null}):e.mode===`existing`?null:e.provider?.setup===void 0?e.presentation===`onboarding`?(0,I.jsx)(Pe,{title:e.displayName||e.provider?.displayName||`Codex`,description:(0,I.jsx)(Ne,{}),control:(0,I.jsx)(d,{size:`sm`,variant:`outline`,className:`min-w-44`,disabled:!0,children:`Open sign-in page`}),secondaryControl:(0,I.jsx)(d,{size:`sm`,variant:`ghost-muted`,disabled:!0,children:`Cancel`})}):(0,I.jsx)(de,{title:`ChatGPT account`,description:`Preparing sign-in.`}):(0,I.jsx)(Me,{...e,autoStart:n||e.autoStart===!0,onAutoStartConsumed:()=>{r(!1),e.onAutoStartConsumed?.()}},`${e.environmentId}:${e.instanceId}`),t[4]=s,t[5]=c,t[6]=o,t[7]=u,t[8]=e,t[9]=n,t[10]=f):f=t[10],f}function je(e){let t=(0,F.c)(9),{environmentId:n,onClose:r,onAccountCreated:i}=e,o=C(n,a),s;t[0]!==o||t[1]!==n||t[2]!==r?(s=(e,t)=>(0,I.jsx)(Me,{environmentId:n,instanceId:e,provider:t,mode:`managed`,enabled:!0,readOnly:!o,autoStart:!0,onAutoStartConsumed:ke,onModeChange:ke,onSignInCancelled:r,allowExistingCli:!1},e),t[0]=o,t[1]=n,t[2]=r,t[3]=s):s=t[3];let c;return t[4]!==n||t[5]!==i||t[6]!==r||t[7]!==s?(c=(0,I.jsx)(V,{environmentId:n,onClose:r,onAccountCreated:i,renderSetup:s}),t[4]=n,t[5]=i,t[6]=r,t[7]=s,t[8]=c):c=t[8],c}function Me({environmentId:e,instanceId:t,provider:n,enabled:r,readOnly:i,onModeChange:a,autoStart:o,onAutoStartConsumed:s,allowExistingCli:c=!0,presentation:l,displayName:u,onSignInCancelled:f}){let p={environmentId:e,input:{instanceId:t}},h=w(S.providerAuthState(p)),ee=w(S.providerInstallState(p)),[C,ne]=(0,P.useState)(null),E=w(C?S.chatGptHandoffState(C):null),D=E.data?.phase===`auth`?E.data.state:h.data,[ie,ae]=(0,P.useState)(!1),[oe,se]=(0,P.useState)(`chatgpt`),ce=D?.methods?.find(e=>e.id===`chatgpt`)?.accountEmail,le=D?.methods?.find(e=>e.id===oe)?.accountEmail,O=D?.methods?.some(e=>e.id.startsWith(`chatgpt-profile:`)),A=D?.interaction?.type===`browser`?D.interaction.url:D?.authorizationUrl,j=ee.data,pe=y(e),me=pe!==null&&k(new URL(pe).hostname),N={reportFailure:!1,reportDefect:!1},F=T(S.startProviderAuth,N),z=T(S.refreshProviders,N),B=T(S.completeProviderAuth,N),V=T(S.cancelProviderAuth,N),ge=T(S.logoutProviderAuth,N),_e=T(S.startProviderInstall,N),ve=T(S.cancelProviderInstall,N),ye=T(S.chatGptReconnectProfile,N),be=T(S.chatGptImportProfile,N),H=!C&&(!me||window.desktopBridge?.receiveProviderAuthCallback!==void 0),xe=H&&!window.desktopBridge?.receiveProviderAuthCallback,Se=b(),Ce=x(Se),we=y(Se),Te=!me&&Se&&Ce?.connection.phase===`connected`&&we&&k(new URL(we).hostname)&&(window.desktopBridge!==void 0||k(window.location.hostname))?Se:null,U=new URL(window.location.href);U.pathname===`/welcome`&&(U.hash=`agents:${e}`),U.pathname===`/settings/providers`&&U.searchParams.set(`instanceId`,t);let Ee=xe,De=(0,P.useId)(),[Oe,ke]=(0,P.useState)(!1),[Ae,je]=(0,P.useState)({flowId:``,value:``}),Me=Ae.flowId===D?.flowId?Ae.value:``,[W,Fe]=(0,P.useState)(!1),[Ie,Le]=(0,P.useState)(null),Re=(0,P.useRef)(!1),[ze,Be]=(0,P.useState)(null),G=(0,P.useRef)(null),Ve=(0,P.useRef)(!1),He=(0,P.useRef)(null),[Ue,We]=(0,P.useState)(!1),K=j?.installedVersion!=null,q=n?.auth.status===`authenticated`,Ge=K&&j?.source!==`local`&&j?.version!=null&&j.version!==j.installedVersion,Ke=Ie!==null&&!q&&(D?.phase===`succeeded`||Ie===`handoff`);(0,P.useEffect)(()=>{(q||D?.phase===`failed`||D?.phase===`cancelled`)&&Le(null)},[q,D?.phase]),(0,P.useEffect)(()=>{Ie&&D?.phase===`succeeded`&&z({environmentId:e,input:{instanceId:t}})},[Ie,D?.phase,z,e,t]);let qe=o&&!Ue,Je=Ie===`sign-in`&&!q&&(D===null||D.phase===`idle`),Ye=Ke||Je||C!==null||D?.phase===`starting`||D?.phase===`waiting`||D?.phase===`verifying`,J=j?.phase===`downloading`||j?.phase===`extracting`||j?.phase===`verifying`,Y=qe||Ye||W&&!J,X=i||!r||W||h.error!==null||ee.error!==null,Z=W||Ye||J,Q=(0,P.useCallback)(async(e,t)=>{if(Re.current)return!1;Re.current=!0,Fe(!0),Be(null);let n=!1;try{let r=await e();if(r._tag===`Failure`){if(!_(r)){let e=v(r);Be(e instanceof Error?e.message:`Codex setup failed. Try again.`)}}else n=!0,t?.(r.value)}catch{Be(`Codex setup failed. Try again.`)}return Re.current=!1,Fe(!1),n},[]),Xe=(0,P.useId)(),Ze=(0,P.useRef)(0),Qe=(0,P.useRef)(null),[$e,et]=(0,P.useState)(!1),tt=(0,P.useCallback)(async n=>{let r=await Q(()=>be({environmentId:e,input:{instanceId:t,profile:n}}));r&&(Le(`handoff`),ne(null)),et(!r)},[Q,be,e,t]);(0,P.useEffect)(()=>{if(!C||E.data?.phase!==`finished`)return;let e=C.input.attemptId;Qe.current!==e&&(Qe.current=e,tt(E.data.profile))},[C,E.data,tt]),(0,P.useEffect)(()=>{C&&(E.error||E.data?.phase===`auth`&&[`failed`,`cancelled`].includes(E.data.state.phase))&&(Be(E.data?.phase===`auth`?E.data.state.message??`ChatGPT sign-in could not finish. Try again.`:`ChatGPT sign-in on the primary environment was interrupted. Try again.`),ne(null))},[C,E.data,E.error]);let nt=(0,P.useCallback)(()=>(Le(null),C?(ne(null),Promise.resolve()):Q(()=>V({environmentId:e,input:{instanceId:t,flowId:D.flowId}}))),[C,Q,V,e,t,D]),rt=(0,P.useCallback)(async(n=`chatgpt`)=>{if(Re.current)return;Ve.current=!0,et(!1),se(n);let r=new URL(window.location.href);if(r.pathname===`/welcome`&&(r.hash=`agents:${e}`),r.pathname===`/settings/providers`&&r.searchParams.set(`instanceId`,t),Te){let i=`${Xe}:${++Ze.current}`;await Q(()=>ye({environmentId:e,input:{instanceId:t,methodId:n}}),n=>ne({environmentId:Te,input:{instanceId:t,environmentId:e,attemptId:i,returnUrl:r.toString(),profile:n}}))||(Ve.current=!1);return}await Q(()=>F({environmentId:e,input:{instanceId:t,methodId:n,returnUrl:r.toString(),callbackMode:H?`client`:`server`}}),()=>Le(`sign-in`))||(Ve.current=!1)},[e,t,Q,F,H,Te,ye,Xe]),$=(0,P.useCallback)(async(n=`chatgpt`)=>{X||Z||(K&&!Ge?await rt(n):(G.current=n,await Q(()=>_e({environmentId:e,input:{instanceId:t}}))||(G.current=null)))},[X,Z,K,Ge,rt,Q,_e,e,t]);(0,P.useEffect)(()=>{!o||Ue||X||Z||j===null||!n?.setup?.canInstall||(We(!0),s(),$())},[o,Ue,X,Z,j,n?.setup?.canInstall,s,$]),(0,P.useEffect)(()=>{if(!(!G.current||W||J)){if(j?.phase===`failed`||j?.phase===`cancelled`)G.current=null;else if(K){let e=G.current;G.current=null,rt(e)}}},[W,J,j?.phase,K,rt]);let it=(0,P.useRef)(null),at=D?.flowId,ot=(0,P.useCallback)(async n=>{try{let r=window.desktopBridge?.receiveProviderAuthCallback;if(r&&H&&at){if(it.current===n){await te().shell.openExternal(n);return}it.current=n;let i=await r(n);if(it.current!==n)return;it.current=null,await Q(()=>B({environmentId:e,input:{instanceId:t,flowId:at,callbackUrl:i}}))}else await te().shell.openExternal(n)}catch{Be(`Could not finish sign-in on this computer. Try again or paste the redirect URL below.`)}},[H,at,Q,B,e,t]);(0,P.useEffect)(()=>{if(H&&A&&window.desktopBridge?.cancelProviderAuthCallback)return()=>{it.current===A&&(it.current=null),window.desktopBridge?.cancelProviderAuthCallback?.(A).catch(()=>void 0)}},[H,A]),(0,P.useEffect)(()=>{Ve.current&&D?.phase===`waiting`&&D.flowId&&A&&He.current!==D.flowId&&(He.current=D.flowId,Ve.current=!1,xe||ot(A))},[D?.phase,D?.flowId,A,ot,xe]);let st=j?.phase===`downloading`?`Downloading ${(j.downloadedBytes/1e6).toFixed(1)}${j.totalBytes===null?``:` of ${(j.totalBytes/1e6).toFixed(1)}`} MB.`:j?.phase===`extracting`?`Installing Codex.`:j?.phase===`verifying`?`Checking Codex.`:K?`${j?.source===`local`?`Using your installed Codex`:`Managed by P4 Code`}${j?.installedVersion?` · v${j.installedVersion}`:``}.`:j?.message??`P4 Code downloads and manages Codex for you.`,ct=Ke?`Finishing sign-in...`:J?st:Y||D?.phase===`failed`||D?.phase===`cancelled`?D?.phase===`waiting`&&le?`Continue as ${le} on OpenAI.`:D?.message??`Finish signing in in your browser.`:q?n?.auth.email?.trim()?(0,I.jsxs)(I.Fragment,{children:[`Signed in as`,` `,(0,I.jsx)(M,{value:n.auth.email.trim(),ariaLabel:`Toggle account email visibility`,revealTooltip:`Click to reveal email`,hideTooltip:`Click to hide email`}),`.`]}):`Signed in with ChatGPT.`:ce??`Use your ChatGPT subscription.`,lt=Ee&&A&&D?.flowId&&he(U.toString())?fe({authorizationUrl:A,returnUrl:U.toString(),environmentId:e,instanceId:t,flowId:D.flowId},!1):null,ut=(0,I.jsx)(d,{size:`sm`,variant:xe?`default`:`outline`,className:l===`onboarding`?`min-w-44`:void 0,disabled:E.data?.phase===`finished`?W||!$e:!A||D?.phase!==`waiting`,onClick:()=>{E.data?.phase===`finished`?tt(E.data.profile):A&&ot(A)},children:Ke?`Finishing sign-in...`:E.data?.phase===`finished`?$e?`Retry connection`:`Finishing sign-in...`:D?.phase===`waiting`?xe?`Open ChatGPT sign-in`:`Open sign-in page`:l===`onboarding`?`Open sign-in page`:`Signing in...`}),dt=!C&&D?.phase===`waiting`&&A?(0,I.jsxs)(`div`,{className:`flex w-full flex-col gap-3 text-xs leading-relaxed text-muted-foreground`,children:[(0,I.jsx)(`p`,{children:`If sign-in doesn't return to P4 Code, paste the URL from the final localhost page.`}),(0,I.jsxs)(`form`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center`,onSubmit:n=>{if(n.preventDefault(),!D.flowId||!Me.trim())return;let r=Me.trim(),i=D.flowId;Q(()=>B({environmentId:e,input:{instanceId:t,flowId:i,callbackUrl:r}})).then(e=>{e&&je({flowId:i,value:``})})},children:[(0,I.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,I.jsx)(re,{"aria-label":`ChatGPT sign-in redirect URL`,type:`password`,autoComplete:`off`,placeholder:`Paste the URL from the sign-in tab`,value:Me,maxLength:16384,disabled:W||i,onChange:e=>je({flowId:D.flowId??``,value:e.target.value})})}),(0,I.jsx)(d,{variant:`outline`,type:`submit`,disabled:W||i||!Me.trim(),children:`Connect`})]}),xe?null:(0,I.jsx)(`div`,{children:(0,I.jsxs)(d,{size:`xs`,variant:`ghost-muted`,onClick:()=>void te().shell.openExternal(A),children:[`Try sign-in in your browser`,(0,I.jsx)(g,{className:`size-3.5`})]})}),lt?(0,I.jsxs)(`details`,{children:[(0,I.jsx)(`summary`,{className:`cursor-pointer`,children:`Other ways to connect`}),(0,I.jsx)(d,{className:`mt-2`,size:`sm`,variant:`outline`,render:(0,I.jsx)(`a`,{href:lt}),children:`Use P4 Code desktop for automatic return`})]}):null]}):null,ft=dt&&Oe?(0,I.jsx)(`div`,{id:De,className:`w-full border-t border-border/50 pt-3`,children:dt}):null,pt=Ee?dt:dt?(0,I.jsxs)(`div`,{className:`space-y-3 text-xs leading-relaxed text-muted-foreground`,children:[(0,I.jsx)(Ne,{label:`Having trouble signing in?`,expanded:Oe,controls:De,onToggle:()=>ke(e=>!e)}),ft]}):null,mt=(0,I.jsx)(R,{open:ie,methods:D?.methods??[],onClose:()=>ae(!1),onSelect:e=>{ae(!1),$(D?.methods?.some(t=>t.id===e)?e:`chatgpt-change-account`)}}),ht=D?.phase===`idle`&&D.message?.startsWith(`Signed out locally.`)?D.message:null;if(l===`onboarding`){let r=ht??ze??(h.error||ee.error?`Could not read setup status. Reconnect and try again.`:j?.phase===`failed`?j.message:null);return(0,I.jsxs)(I.Fragment,{children:[mt,(0,I.jsxs)(Pe,{title:u||n?.displayName||`Codex`,description:J?st:q?n?.auth.email?.trim()?(0,I.jsxs)(I.Fragment,{children:[`Signed in as`,` `,(0,I.jsx)(M,{value:n.auth.email.trim(),ariaLabel:`Toggle account email visibility`,revealTooltip:`Click to reveal email`,hideTooltip:`Click to hide email`,className:`break-all`}),`.`]}):`Connected to ChatGPT.`:dt&&!Ee?(0,I.jsx)(Ne,{expanded:Oe,controls:De,onToggle:()=>ke(e=>!e)}):qe||Je||D?.phase===`starting`||D?.phase===`waiting`||W&&!J?(0,I.jsx)(Ne,{}):Y||D?.phase===`failed`||D?.phase===`cancelled`?ct:`Code with your ChatGPT subscription.`,control:q&&!Z?(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs font-medium text-success-foreground`,children:[(0,I.jsx)(m,{className:`size-3.5`}),`Ready`]}):Y?ut:(0,I.jsx)(L,{size:`sm`,disabled:X||Z||(K?!n?.setup?.canAuthenticate:!n?.setup?.canInstall),onClick:()=>{O?ae(!0):$()},children:J||W?`Setting up...`:O?`Reconnect account`:`Continue with ChatGPT`}),secondaryControl:Y&&!Ke||J?(0,I.jsx)(d,{size:`sm`,variant:`ghost-muted`,disabled:W||i,onClick:()=>{Ve.current=!1,G.current=null,C||Y&&D?.flowId?nt():j?.operationId&&Q(()=>ve({environmentId:e,input:{instanceId:t,operationId:j.operationId}}))},children:`Cancel`}):!Y&&!q&&O?(0,I.jsx)(d,{size:`sm`,variant:`ghost-muted`,disabled:X||Z,onClick:()=>void $(`chatgpt-change-account`),children:`Use a different account`}):!Y&&!q&&c?(0,I.jsx)(d,{size:`sm`,variant:`ghost-muted`,disabled:i||Z,onClick:()=>a(`existing`),children:`Use existing CLI`}):null,children:[Ee?pt:ft,r?(0,I.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:r}):null]})]})}return(0,I.jsxs)(`section`,{"aria-label":`Codex setup`,className:`divide-y divide-border/50`,children:[mt,(0,I.jsx)(de,{title:`ChatGPT account`,description:ct,control:(0,I.jsx)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:Y?(0,I.jsxs)(I.Fragment,{children:[ut,!Ke&&(0,I.jsx)(d,{size:`sm`,variant:`ghost`,disabled:W||i,onClick:()=>{(C||D?.flowId)&&(Ve.current=!1,nt(),f?.())},children:`Cancel`})]}):J?(0,I.jsx)(d,{size:`sm`,variant:`ghost`,disabled:W||i,onClick:()=>{j?.operationId&&(G.current=null,Q(()=>ve({environmentId:e,input:{instanceId:t,operationId:j.operationId}})))},children:`Cancel`}):q?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(d,{size:`sm`,variant:`outline`,disabled:X||Z,onClick:()=>ae(!0),children:`Change account`}),(0,I.jsx)(d,{size:`sm`,variant:`ghost`,disabled:X||Z,onClick:()=>void Q(()=>ge(p)),children:`Disconnect`})]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(L,{size:`sm`,disabled:X||Z||(K?!n?.setup?.canAuthenticate:!n?.setup?.canInstall),onClick:()=>{O?ae(!0):$()},children:W?`Setting up...`:O?`Reconnect account`:`Continue with ChatGPT`}),O?(0,I.jsx)(d,{size:`sm`,variant:`ghost`,disabled:X||Z,onClick:()=>void $(`chatgpt-change-account`),children:`Use a different account`}):null]})})}),q?(0,I.jsx)(`div`,{className:`flex justify-end px-3 py-1 sm:px-4`,children:(0,I.jsx)(ue,{})}):null,ht?(0,I.jsx)(`p`,{role:`alert`,className:`px-3 py-2 text-xs text-muted-foreground sm:px-4`,children:ht}):null,pt?(0,I.jsx)(`div`,{className:`px-3 py-3 sm:px-4`,children:pt}):null,ze||h.error||ee.error||j?.phase===`failed`?(0,I.jsx)(`p`,{role:`alert`,className:`px-3 py-2 text-xs text-destructive sm:px-4`,children:ze??(j?.phase===`failed`?j.message:`Could not read Codex setup status. Reconnect and try again.`)}):null]})}function W(e){let t=(0,F.c)(20),{environmentId:n,instanceId:r,provider:i}=e,a;t[0]!==n||t[1]!==r?(a=S.providerInstallState({environmentId:n,input:{instanceId:r}}),t[0]=n,t[1]=r,t[2]=a):a=t[2];let o=w(a),s=o.data?.executablePath??``,c=o.error?`Could not read runtime path`:`Not installed`,l;t[3]!==s||t[4]!==c?(l=(0,I.jsx)(de,{title:`Binary path`,description:`Selected by P4 Code.`,control:(0,I.jsx)(`div`,{className:`w-full sm:w-80`,children:(0,I.jsx)(re,{"aria-label":`Codex binary path`,value:s,title:s,placeholder:c,disabled:!0})})}),t[3]=s,t[4]=c,t[5]=l):l=t[5];let u=i?.runtimePaths?.homePath??``,d=i?.runtimePaths?.homePath,f;t[6]!==u||t[7]!==d?(f=(0,I.jsx)(de,{title:`CODEX_HOME path`,description:`Shared Codex config, sessions, and state.`,control:(0,I.jsx)(`div`,{className:`w-full sm:w-80`,children:(0,I.jsx)(re,{"aria-label":`Codex home path`,value:u,title:d,placeholder:`Unavailable`,disabled:!0})})}),t[6]=u,t[7]=d,t[8]=f):f=t[8];let p=i?.runtimePaths?.shadowHomePath?`Account-specific home sharing the Codex state above.`:`This instance uses the shared Codex home directly.`,m=i?.runtimePaths?.shadowHomePath??``,h=i?.runtimePaths?.shadowHomePath??void 0,g=i?.runtimePaths?`Not used`:`Unavailable`,_;t[9]!==g||t[10]!==m||t[11]!==h?(_=(0,I.jsx)(`div`,{className:`w-full sm:w-80`,children:(0,I.jsx)(re,{"aria-label":`Codex shadow home path`,value:m,title:h,placeholder:g,disabled:!0})}),t[9]=g,t[10]=m,t[11]=h,t[12]=_):_=t[12];let v;t[13]!==_||t[14]!==p?(v=(0,I.jsx)(de,{title:`Shadow home path`,description:p,control:_}),t[13]=_,t[14]=p,t[15]=v):v=t[15];let y;return t[16]!==v||t[17]!==l||t[18]!==f?(y=(0,I.jsxs)(I.Fragment,{children:[l,f,v]}),t[16]=v,t[17]=l,t[18]=f,t[19]=y):y=t[19],y}function Ne(e){let t=(0,F.c)(10),{label:n,expanded:r,controls:i,onToggle:a}=e,o=n===void 0?`Complete sign-in in your browser.`:n,s=r!==void 0&&r;if(!a){let e;return t[0]===o?e=t[1]:(e=(0,I.jsx)(`div`,{className:`leading-relaxed`,children:o}),t[0]=o,t[1]=e),e}let c=`size-3 shrink-0 ${s?`rotate-90`:``}`,l;t[2]===c?l=t[3]:(l=(0,I.jsx)(h,{"aria-hidden":!0,className:c}),t[2]=c,t[3]=l);let u;return t[4]!==i||t[5]!==s||t[6]!==o||t[7]!==a||t[8]!==l?(u=(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1.5 rounded-sm text-left leading-relaxed outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,"aria-label":`Having trouble signing in?`,"aria-expanded":s,"aria-controls":i,onClick:a,children:[o,l]}),t[4]=i,t[5]=s,t[6]=o,t[7]=a,t[8]=l,t[9]=u):u=t[9],u}function Pe(e){let t=(0,F.c)(21),{title:n,description:r,control:i,secondaryControl:a,children:o}=e,s;t[0]===o?s=t[1]:(s=P.Children.toArray(o),t[0]=o,t[1]=s);let c=s,l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,I.jsx)(O,{className:`size-5 shrink-0 fill-foreground`}),t[2]=l):l=t[2];let u;t[3]===n?u=t[4]:(u=(0,I.jsx)(`h3`,{className:`text-sm font-medium`,children:n}),t[3]=n,t[4]=u);let d;t[5]===r?d=t[6]:(d=(0,I.jsx)(`div`,{className:`mt-0.5 text-xs leading-relaxed text-muted-foreground`,children:r}),t[5]=r,t[6]=d);let f;t[7]!==u||t[8]!==d?(f=(0,I.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[u,d]}),t[7]=u,t[8]=d,t[9]=f):f=t[9];let p;t[10]!==i||t[11]!==a?(p=i||a?(0,I.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-end gap-2 has-[button]:w-full has-[button]:flex-col-reverse has-[button]:items-end sm:has-[button]:w-auto sm:has-[button]:flex-row sm:has-[button]:items-center`,children:[a,i]}):null,t[10]=i,t[11]=a,t[12]=p):p=t[12];let m;t[13]!==f||t[14]!==p?(m=(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[l,f,p]}),t[13]=f,t[14]=p,t[15]=m):m=t[15];let h;t[16]===c?h=t[17]:(h=c.length>0?(0,I.jsx)(`div`,{className:`ml-8 mt-2 flex flex-wrap items-center gap-2`,children:c}):null,t[16]=c,t[17]=h);let g;return t[18]!==m||t[19]!==h?(g=(0,I.jsxs)(`div`,{className:`rounded-lg border border-border bg-background px-4 py-4`,children:[m,h]}),t[18]=m,t[19]=h,t[20]=g):g=t[20],g}function Fe(e){return typeof e==`object`&&e&&`setupMode`in e&&e.setupMode===`managed`?`managed`:`existing`}export{Te as a,Ee as c,we as d,xe as f,Ae as i,be as l,je as n,U as o,L as p,W as r,Oe as s,Fe as t,Ce as u};
2
- //# sourceMappingURL=CodexSetupSection.logic-DJw6xB7P.js.map
@@ -1,2 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$n as n,A as r,Ax as i,D as a,Gn as o,Hm as s,Ho as c,I as l,Ip as u,Jo as d,Ko as f,Qn as p,Uo as m,Vd as h,Wg as g,Wo as _,Yg as v,Zn as ee,ar as y,ha as te,ir as b,kc as x,or as ne,ov as S,ps as re,rr as C,sr as w,t as T,ug as ie,ys as ae}from"./utils-DmfMX1v5.js";import{t as oe}from"./check-Cmy7pM2Y.js";import{t as E}from"./chevron-down-DHV04o66.js";import{t as se}from"./columns-2-D1kdFD9w.js";import{t as ce}from"./folder-tree-CIpeR87A.js";import{t as le}from"./info-BHB-83EA.js";import{t as ue}from"./pilcrow-DMiXqMTk.js";import{t as D}from"./rows-3-Bhc8vjss.js";import{t as de}from"./text-wrap-C8SwAUbc.js";import{A as O,L as k,M as A,O as j,U as M,X as N,gt as fe,j as P}from"./runtime-BQJQC-Ny.js";import{s as F}from"./vcsRefInvalidation-nP-qgsHs.js";import{E as pe,O as I,S as L}from"./entities-82m-Smm-.js";import{t as R}from"./runtime-C6FwphD-.js";import{a as z,c as me,n as B,t as V,u as he}from"./tooltip-taOyJZax.js";import{t as ge}from"./useParams-BTKEXLBT.js";import{l as _e,p as ve}from"./toast-CjelgyqV.js";import{a as ye,i as be,n as xe,r as Se,t as Ce}from"./DiffFileTree-BhqF8nD5.js";import{K as we,s as Te,v as Ee}from"./useSettings-CLtJrOYI.js";import{f as De}from"./server-BD_Y5Gsn.js";import{n as Oe}from"./query-DpwJQzeq.js";import{t as ke}from"./use-atom-command-CQHjSXPR.js";import{n as Ae,r as je}from"./fileContextMenu-Dcs50sFI.js";import{t as Me,u as Ne}from"./queries-Cq5C9N-K.js";import{a as Pe,c as Fe,l as Ie,n as Le,o as Re,r as ze,s as Be,u as H}from"./diffRendering-C26rfQBu.js";import{F as Ve,I as He,L as Ue,M as We,P as Ge}from"./PanelLayoutControls-BfRIRM0o.js";import{t as Ke}from"./DiffCommentAnnotation-vAZP7JBy.js";import{c as qe}from"./timestampFormat-wac2e_Jz.js";import{n as Je}from"./fileCommentAnnotations-BgdL_7u9.js";import{n as Ye,t as Xe}from"./toggle-group-DCQTLIPb.js";import{i as Ze,l as Qe,n as $e,o as et,r as tt,s as nt,t as rt}from"./combobox-C81z_216.js";import{La as it,Ra as at,Wa as ot,gs as st,io as ct,qa as lt}from"./main-BB3F4O6Y.js";import{A as ut,D as U,E as dt,O as ft,T as pt,j as mt,k as ht,w as gt}from"./_chat-BKcYL38S.js";var W=e(t(),1),_t=he(),G=i();function vt(e,t){let n=(0,G.c)(4),r=Me(e,t),i;return n[0]!==r.data||n[1]!==r.error||n[2]!==r.isPending?(i={data:r.data,error:r.error,isPending:r.isPending},n[0]=r.data,n[1]=r.error,n[2]=r.isPending,n[3]=i):i=n[3],i}var K=e(te(),1);function yt(e){let t=(0,G.c)(17),{filePath:n}=e,r=(0,W.useRef)(null),i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={onCopy:()=>U(r),onError:e=>dt(r,e),timeout:pt},t[0]=i):i=t[0];let{copyToClipboard:a,isCopied:o}=ve(i),s;t[1]!==a||t[2]!==n?(s=(0,K.jsx)(w,{ref:r,size:`icon-micro`,variant:`ghost-muted`,"aria-label":`Copy file path`,onClick:()=>a(n,void 0)}),t[1]=a,t[2]=n,t[3]=s):s=t[3];let c=o&&`text-success`,l;t[4]===c?l=t[5]:(l=T(`size-3`,c),t[4]=c,t[5]=l);let u=o?_t.Check:_t.Copy,d;t[6]!==l||t[7]!==u?(d=(0,K.jsx)(me,{className:l,icon:u}),t[6]=l,t[7]=u,t[8]=d):d=t[8];let f;t[9]!==s||t[10]!==d?(f=(0,K.jsx)(z,{render:s,children:d}),t[9]=s,t[10]=d,t[11]=f):f=t[11];let p=o?`Copied`:`Copy path`,m;t[12]===p?m=t[13]:(m=(0,K.jsx)(B,{children:(0,K.jsx)(`p`,{children:p})}),t[12]=p,t[13]=m);let h;return t[14]!==f||t[15]!==m?(h=(0,K.jsxs)(V,{children:[f,m]}),t[14]=f,t[15]=m,t[16]=h):h=t[16],h}var q=[];function J(e){return(e.endSide??e.side)===`deletions`?`deletions`:`additions`}function bt(e,t,n){let r=J(t),i=e.findIndex(e=>e.side===r&&e.lineNumber===t.end);return i<0?[...e,{side:r,lineNumber:t.end,metadata:{entries:[n]}}]:e.map((e,t)=>t===i?{...e,metadata:{entries:[...e.metadata.entries,n]}}:e)}function xt(e){let t=(0,G.c)(66),{codeViewKey:n,files:i,sectionId:o,sectionTitle:s,composerDraftTarget:c,options:u,viewerRef:d,className:f,renderCodeViewFooter:p,unsafeCSSExtra:m,renderHeaderMetadata:h,renderHeaderFilenameSuffix:g,renderHeaderPrefix:_,onRevealSearchMatch:v}=e,ee=a(Et),y=a(Tt),te;t[0]===c?te=t[1]:(te=e=>e.getComposerDraft(c)?.reviewComments??q,t[0]=c,t[1]=te);let b=a(te),[x,ne]=(0,W.useState)(null),[S,re]=(0,W.useState)(null),[C,w]=(0,W.useState)(``),T;t[2]===i?T=t[3]:(T=new Map(i.map(wt)),t[2]=i,t[3]=T);let ie=T,ae;if(t[4]!==S||t[5]!==i||t[6]!==b||t[7]!==o){let e;t[9]!==S||t[10]!==b||t[11]!==o?(e=e=>{let{fileDiff:t,filePath:n,fileKey:r,fileVersion:i,collapsed:a}=e,s=b.filter(e=>e.sectionId===o&&e.filePath===n&&(e.fenceLanguage??`diff`)===`diff`).reduce((e,n)=>{let r=l(t,n);return r?bt(e,r,{id:n.id,kind:`comment`,range:r,rangeLabel:n.rangeLabel,text:n.text}):e},[]),c=S?.fileKey===r?[...s,S.annotation]:s;return{id:r,type:`diff`,fileDiff:t,annotations:c,collapsed:a,version:Pe(`${i}:${a?`1`:`0`}:${c.flatMap(Ct).join(`:`)}`)}},t[9]=S,t[10]=b,t[11]=o,t[12]=e):e=t[12],ae=i.map(e),t[4]=S,t[5]=i,t[6]=b,t[7]=o,t[8]=ae}else ae=t[8];let oe=ae,E;t[13]!==c||t[14]!==S?.annotation||t[15]!==y?(E=e=>{ne(null),S?.annotation.metadata.entries.some(t=>t.id===e)?(re(null),w(``)):y(c,e)},t[13]=c,t[14]=S?.annotation,t[15]=y,t[16]=E):E=t[16];let se=E,ce;t[17]!==ee||t[18]!==c||t[19]!==S||t[20]!==ie||t[21]!==o||t[22]!==s?(ce=(e,t)=>{let n=S?.annotation.metadata.entries.find(t=>t.id===e),i=S?ie.get(S.fileKey):void 0;if(!n||!i)return;let a=r({id:n.id,sectionId:o,sectionTitle:s,filePath:i.filePath,fileDiff:i.fileDiff,range:n.range,text:t});a&&ee(c,a),ne(null),re(null),w(``)},t[17]=ee,t[18]=c,t[19]=S,t[20]=ie,t[21]=o,t[22]=s,t[23]=ce):ce=t[23];let le=ce,ue;t[24]!==o||t[25]!==s?(ue=(e,t)=>{if(!e)return;let n=t.item;if(n.type!==`diff`)return;let i=Je(),a=r({id:i,sectionId:o,sectionTitle:s,filePath:H(n.fileDiff),fileDiff:n.fileDiff,range:e,text:``});a&&(w(``),re({fileKey:n.id,annotation:{side:J(e),lineNumber:e.end,metadata:{entries:[{id:i,kind:`draft`,range:e,rangeLabel:a.rangeLabel,text:``}]}}}))},t[24]=o,t[25]=s,t[26]=ue):ue=t[26];let D=ue,de=S!==null,O;t[27]===d?O=t[28]:(O=d?{viewerRef:d}:{},t[27]=d,t[28]=O);let k;t[29]===f?k=t[30]:(k=f?{className:f}:{},t[29]=f,t[30]=k);let A;t[31]===m?A=t[32]:(A=m?{unsafeCSSExtra:m}:{},t[31]=m,t[32]=A);let j;t[33]===h?j=t[34]:(j=h?{renderHeaderMetadata:e=>e.type===`diff`?h(e.fileDiff):null}:{},t[33]=h,t[34]=j);let M;t[35]===p?M=t[36]:(M=p?{renderCodeViewFooter:p}:{},t[35]=p,t[36]=M);let N;t[37]===v?N=t[38]:(N=e=>v(e.id),t[37]=v,t[38]=N);let fe=!de,P=!de,F;t[39]!==D||t[40]!==u||t[41]!==fe||t[42]!==P?(F={...u,enableGutterUtility:fe,enableLineSelection:P,onGutterUtilityClick:D},t[39]=D,t[40]=u,t[41]=fe,t[42]=P,t[43]=F):F=t[43];let pe;t[44]===g?pe=t[45]:(pe=e=>e.type===`diff`?g(e.fileDiff):null,t[44]=g,t[45]=pe);let I;t[46]===_?I=t[47]:(I=e=>e.type===`diff`?_(e.fileDiff,e.id,e.collapsed===!0):null,t[46]=_,t[47]=I);let L;t[48]!==C||t[49]!==se||t[50]!==le?(L=e=>{let t=e.metadata.entries.some(St);return(0,K.jsx)(`div`,{className:t?`py-1`:`divide-y divide-border/30 border-y border-border/30`,children:e.metadata.entries.map(e=>(0,K.jsx)(Ke,{kind:e.kind,rangeLabel:e.rangeLabel,text:e.kind===`draft`?C:e.text,onTextChange:w,onCancel:()=>se(e.id),onComment:t=>le(e.id,t),onDelete:()=>se(e.id)},e.id))})},t[48]=C,t[49]=se,t[50]=le,t[51]=L):L=t[51];let R;return t[52]!==n||t[53]!==oe||t[54]!==x||t[55]!==j||t[56]!==M||t[57]!==N||t[58]!==F||t[59]!==pe||t[60]!==I||t[61]!==L||t[62]!==O||t[63]!==k||t[64]!==A?(R=(0,K.jsx)(Ge,{...O,...k,...A,...j,...M,items:oe,selectedLines:x,onSelectedLinesChange:ne,onRevealSearchMatch:N,options:F,renderHeaderFilenameSuffix:pe,renderHeaderPrefix:I,renderAnnotation:L},n),t[52]=n,t[53]=oe,t[54]=x,t[55]=j,t[56]=M,t[57]=N,t[58]=F,t[59]=pe,t[60]=I,t[61]=L,t[62]=O,t[63]=k,t[64]=A,t[65]=R):R=t[65],R}function St(e){return e.kind===`draft`}function Ct(e){return e.metadata.entries.map(Y)}function Y(e){return`${e.id}:${e.rangeLabel}:${e.text}`}function wt(e){return[e.fileKey,e]}function Tt(e){return e.removeReviewComment}function Et(e){return e.addReviewComment}function Dt(e){let t=u(4),n=j();return{diffPreview:A(e,{label:`environment-data:review:diff-preview`,tag:x.reviewGetDiffPreview,staleTimeMs:5e3}),diffFilePatch:O(e,{label:`environment-data:review:diff-file-patch`,staleTimeMs:3e5,execute:e=>N(x.reviewGetDiffPreview,e.request).pipe(t.withPermit,v(t=>{let n=t.sources.find(t=>t.kind===e.request.file.sourceKind);return n?S(n):g(new h({operation:`review.diffFilePatch`,kind:`git`,detail:`Diff no longer available. Refresh the comparison.`}))}))}),diffFileContents:P(e,{label:`environment-data:review:diff-file-contents`,tag:x.reviewGetDiffFileContents,scheduler:n,concurrency:{mode:`singleFlight`,key:({environmentId:e,input:t})=>JSON.stringify([e,t.cwd,t.sourceKind,t.baseRef,t.headRef,t.oldPath,t.newPath,t.changeType])}})}}var Ot=Dt(R);function X(e){return e.remoteName&&e.name.startsWith(`${e.remoteName}/`)?e.name.slice(e.remoteName.length+1):e.name}function kt(e,t){let n=new Set(t),r=e.map(e=>{let r=t.filter(t=>n.has(t)&&X(t)===e.name),i=r.find(e=>e.remoteName===`origin`)??r[0]??null;return i&&n.delete(i),{id:`local:${e.name}`,label:e.name,local:e,remote:i}}),i=t.filter(e=>n.has(e)).map(e=>({id:`remote:${e.name}`,label:e.name,local:null,remote:e}));return[...r,...i]}function At(e,t){let n=t.trim().toLocaleLowerCase();return n.length===0?e:e.filter(e=>e.label.toLocaleLowerCase().includes(n)||e.local?.name.toLocaleLowerCase().includes(n)===!0||e.remote?.name.toLocaleLowerCase().includes(n)===!0)}var jt=new Intl.Collator(void 0,{numeric:!0,sensitivity:`base`});function Mt(e){let t=(0,G.c)(86),{environmentId:n,cwd:r,source:i,baseRef:a,ignoreWhitespace:o,theme:s,revision:l,preview:u}=e,p=(0,W.useContext)(m),h;t[0]!==a||t[1]!==r||t[2]!==n||t[3]!==o||t[4]!==i?.diffHash||t[5]!==i?.kind?(h=JSON.stringify([n,r,i?.kind,i?.diffHash,a,o]),t[0]=a,t[1]=r,t[2]=n,t[3]=o,t[4]=i?.diffHash,t[5]=i?.kind,t[6]=h):h=t[6];let g=h,v;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(v=[0,1,2,3],t[7]=v):v=t[7];let ee;t[8]===g?ee=t[9]:(ee={scope:g,indices:v},t[8]=g,t[9]=ee);let[y,te]=(0,W.useState)(ee),b;t[10]!==y.indices||t[11]!==y.scope||t[12]!==g?(b=y.scope===g?y.indices:[0,1,2,3],t[10]=y.indices,t[11]=y.scope,t[12]=g,t[13]=b):b=t[13];let x=b,ne;t[14]===i?.files?ne=t[15]:(ne=()=>i?.files?.toSorted(Z)??[],t[14]=i?.files,t[15]=ne),i?.files;let S;t[16]===ne?S=t[17]:(S=ne(),t[16]=ne,t[17]=S);let C=S,w;t[18]!==a||t[19]!==r||t[20]!==n||t[21]!==C||t[22]!==o||t[23]!==x||t[24]!==g||t[25]!==i?(w=!n||!r||!i?[]:x.filter(e=>e<C.length).map(e=>{let t=C[e];return{index:e,query:Ot.diffFilePatch({environmentId:n,input:{cacheKey:g,request:{cwd:r,...a?{baseRef:a}:{},ignoreWhitespace:o,file:{path:t.path,previousPath:t.previousPath,sourceKind:i.kind}}}})}}),t[18]=a,t[19]=r,t[20]=n,t[21]=C,t[22]=o,t[23]=x,t[24]=g,t[25]=i,t[26]=w):w=t[26];let T=w,ie;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(ie=[],t[27]=ie):ie=t[27];let ae;t[28]!==l||t[29]!==g?(ae={scope:g,revision:l,queries:ie},t[28]=l,t[29]=g,t[30]=ae):ae=t[30];let oe=(0,W.useRef)(ae),E,se;t[31]!==T||t[32]!==p||t[33]!==l||t[34]!==g?(E=()=>{let e=oe.current;oe.current={scope:g,revision:l,queries:T};for(let{query:t}of T){let n=e.scope===g&&e.revision!==l,r=!e.queries.some(e=>e.query===t)&&p.get(t)._tag!==`Initial`&&!p.get(t).waiting;(n||r)&&p.refresh(t)}},se=[g,l,T,p],t[31]=T,t[32]=p,t[33]=l,t[34]=g,t[35]=E,t[36]=se):(E=t[35],se=t[36]),(0,W.useEffect)(E,se);let ce;t[37]===s?ce=t[38]:(ce=_(e=>d(e,e=>re(e,e=>{let t=Fe(e.diff,`diff-panel:${s}`,{compactPartialHunkOffsets:!0});if(t?.kind===`files`&&t.files.length===1&&e.files?.length===1){let n=e.files[0],r={...t.files[0],name:n.path};n.previousPath===null?delete r.prevName:r.prevName=n.previousPath,t={...t,files:[r]}}return{source:e,patch:t}}))),t[37]=s,t[38]=ce);let le=ce,ue;t[39]!==le||t[40]!==T?(ue=f(e=>new Map(T.map(t=>{let{index:n,query:r}=t;return[n,e(le(r))]}))),t[39]=le,t[40]=T,t[41]=ue):ue=t[41];let D=c(ue),de;t[42]===D?de=t[43]:(de=(e,t)=>{let n=D.get(t);return!n||n._tag===`Initial`},t[42]=D,t[43]=de);let O=C.findIndex(de),k=i?O<0?C.length:O:u?.kind===`files`?u.files.length:0,A;t[44]===g?A=t[45]:(A=e=>te(t=>{let n=t.scope===g?t.indices:[0,1,2,3],r=e.filter(e=>!n.includes(e));return r.length===0?t:{scope:g,indices:[...n,...r]}}),t[44]=g,t[45]=A);let j=A,M;t[46]!==j||t[47]!==k?(M=()=>j(Array.from({length:4},(e,t)=>k+t)),t[46]=j,t[47]=k,t[48]=M):M=t[48];let N=M,fe;t[49]===j?fe=t[50]:(fe=e=>j([e]),t[49]=j,t[50]=fe);let P=fe,F;t[51]!==C||t[52]!==T?(F={queries:T,files:C},t[51]=C,t[52]=T,t[53]=F):F=t[53];let pe=(0,W.useRef)(F),I,L;t[54]!==C||t[55]!==T?(I=()=>{pe.current={queries:T,files:C}},L=[T,C],t[54]=C,t[55]=T,t[56]=I,t[57]=L):(I=t[56],L=t[57]),(0,W.useLayoutEffect)(I,L);let R;t[58]===p?R=t[59]:(R=e=>{let{queries:t,files:n}=pe.current,r=t.find(t=>{let{index:r}=t;return n[r]?.path===e})?.query;r&&p.refresh(r)},t[58]=p,t[59]=R);let z=R,me;t[60]!==C||t[61]!==D||t[62]!==u||t[63]!==g||t[64]!==i?(me=i?C.map((e,t)=>{let n=D.get(t);if(n?._tag===`Success`&&n.value.patch?.kind===`files`){let t=n.value.patch.files.find(t=>H(t)===e.path);if(t)return t}return{name:e.path,...e.previousPath?{prevName:e.previousPath}:{},type:e.previousPath?`rename-changed`:`change`,hunks:[],additionLines:[],deletionLines:[],splitLineCount:0,unifiedLineCount:0,isPartial:!0,cacheKey:`${g}:${e.path}:pending`}}):(u?.kind===`files`?u.files:[]).toSorted(Ft),t[60]=C,t[61]=D,t[62]=u,t[63]=g,t[64]=i,t[65]=me):me=t[65];let B=me,V;if(t[66]!==C||t[67]!==D){let e;t[69]===D?e=t[70]:(e=(e,t)=>{let n=D.get(t);return[e.path,{error:n?._tag===`Failure`||n?._tag===`Success`&&(n.value.patch?.kind!==`files`||!n.value.patch.files.some(t=>H(t)===e.path)),truncated:n?._tag===`Success`&&n.value.source.truncated}]},t[69]=D,t[70]=e),V=new Map(C.map(e)),t[66]=C,t[67]=D,t[68]=V}else V=t[68];let he=V,ge;if(t[71]!==C||t[72]!==D){let e;t[74]===D?e=t[75]:(e=(e,t)=>{let n=D.get(t);return n&&n._tag!==`Initial`},t[74]=D,t[75]=e),ge=new Set(C.filter(e).map(Pt)),t[71]=C,t[72]=D,t[73]=ge}else ge=t[73];let _e=ge,ve=[...D.values()].some(Nt),ye;return t[76]!==he||t[77]!==N||t[78]!==_e||t[79]!==B||t[80]!==P||t[81]!==z||t[82]!==g||t[83]!==k||t[84]!==ve?(ye={scope:g,fileStates:he,isPending:ve,retry:z,requestFile:P,readyFilePaths:_e,renderableFiles:B,settledFileCount:k,loadNextFiles:N},t[76]=he,t[77]=N,t[78]=_e,t[79]=B,t[80]=P,t[81]=z,t[82]=g,t[83]=k,t[84]=ve,t[85]=ye):ye=t[85],ye}function Nt(e){return e._tag===`Initial`||e.waiting}function Pt(e){return e.path}function Ft(e,t){return jt.compare(H(e),H(t))}function Z(e,t){return jt.compare(e.path,t.path)}function It(e){let t=(0,G.c)(5),{load:n,count:r}=e,i=(0,W.useRef)(null),a,o;t[0]===n?(a=t[1],o=t[2]):(a=()=>{if(!i.current)return;let e=new IntersectionObserver(e=>{e.some(Rt)&&n()},{rootMargin:`600px`});return e.observe(i.current),()=>e.disconnect()},o=[n],t[0]=n,t[1]=a,t[2]=o),(0,W.useEffect)(a,o);let s;return t[3]===r?s=t[4]:(s=(0,K.jsx)(`div`,{ref:i,role:`status`,"aria-label":`Loading diff…`,children:Array.from({length:Math.min(r,4)},Lt)}),t[3]=r,t[4]=s),s}function Lt(e,t){return(0,K.jsx)(`div`,{"aria-hidden":!0,className:`border-b border-border/40`,children:(0,K.jsx)(Ve,{titleWidth:`medium`})},t)}function Rt(e){return e.isIntersecting}function Q(e){let t=(0,G.c)(16),{error:n,truncated:r,retry:i}=e;if(!n&&!r)return null;let a=n?`Retry loading diff`:`Partial diff preview`,o;t[0]!==n||t[1]!==i?(o=e=>{e.stopPropagation(),n&&i()},t[0]=n,t[1]=i,t[2]=o):o=t[2];let s;t[3]!==a||t[4]!==o?(s=(0,K.jsx)(w,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":a,onClick:o}),t[3]=a,t[4]=o,t[5]=s):s=t[5];let c;t[6]===n?c=t[7]:(c=n?(0,K.jsx)(ct,{className:`size-3`}):(0,K.jsx)(le,{className:`size-3`}),t[6]=n,t[7]=c);let l;t[8]!==s||t[9]!==c?(l=(0,K.jsx)(z,{render:s,children:c}),t[8]=s,t[9]=c,t[10]=l):l=t[10];let u=n?`Retry loading diff`:`This file is too large to show in full. Counts include all changes.`,d;t[11]===u?d=t[12]:(d=(0,K.jsx)(B,{children:u}),t[11]=u,t[12]=d);let f;return t[13]!==l||t[14]!==d?(f=(0,K.jsxs)(V,{children:[l,d]}),t[13]=l,t[14]=d,t[15]=f):f=t[15],f}var zt=`__automatic_base_ref__`,Bt=`t3code.diffFileTreeOpen`,Vt=new WeakMap;function Ht(e){let t=Vt.get(e);if(t)return t;let n={fileDiff:e,fileKey:ze(e),fileVersion:Le(e)};return Vt.set(e,n),n}var Ut=new Set;function Wt(e){let t=(0,G.c)(21),{filePath:n,fileKey:r,collapsed:i,unavailable:a,iconClassName:o,onToggle:s}=e,c=i?`Expand ${n}`:`Collapse ${n}`,l=!i,u;t[0]!==r||t[1]!==s?(u=e=>{e.stopPropagation(),s(r)},t[0]=r,t[1]=s,t[2]=u):u=t[2];let d;t[3]!==c||t[4]!==l||t[5]!==u||t[6]!==a?(d=(0,K.jsx)(w,{size:`icon-micro`,variant:`ghost`,className:`-ms-0.5`,"aria-label":c,"aria-expanded":l,disabled:a,onClick:u}),t[3]=c,t[4]=l,t[5]=u,t[6]=a,t[7]=d):d=t[7];let f;t[8]===o?f=t[9]:(f=T(`size-4`,o),t[8]=o,t[9]=f);let p=i?_t.ChevronRight:_t.ChevronDown,m;t[10]!==f||t[11]!==p?(m=(0,K.jsx)(me,{className:f,icon:p}),t[10]=f,t[11]=p,t[12]=m):m=t[12];let h;t[13]!==d||t[14]!==m?(h=(0,K.jsx)(z,{render:d,children:m}),t[13]=d,t[14]=m,t[15]=h):h=t[15];let g=i?`Expand diff`:`Collapse diff`,_;t[16]===g?_=t[17]:(_=(0,K.jsx)(B,{side:`top`,children:g}),t[16]=g,t[17]=_);let v;return t[18]!==_||t[19]!==h?(v=(0,K.jsxs)(V,{children:[h,_]}),t[18]=_,t[19]=h,t[20]=v):v=t[20],v}function Gt(e){let t=(0,G.c)(11),{filePath:n,hasStat:r,error:i,truncated:a,onRetry:o}=e,s;t[0]===n?s=t[1]:(s=(0,K.jsx)(yt,{filePath:n}),t[0]=n,t[1]=s);let c;t[2]!==i||t[3]!==n||t[4]!==r||t[5]!==o||t[6]!==a?(c=r?(0,K.jsx)(Q,{error:i,truncated:a,retry:()=>o(n)}):null,t[2]=i,t[3]=n,t[4]=r,t[5]=o,t[6]=a,t[7]=c):c=t[7];let l;return t[8]!==s||t[9]!==c?(l=(0,K.jsxs)(K.Fragment,{children:[s,c]}),t[8]=s,t[9]=c,t[10]=l):l=t[10],l}function Kt({mode:e=`inline`,composerDraftTarget:t,workspaceMutationId:r}){let{resolvedTheme:i}=we(),a=Te(),l=a.diffLayout,u=Ee(),[d,f]=(0,W.useState)(a.wordWrap),[m,h]=(0,W.useState)(a.diffIgnoreWhitespace),[g,_]=ae(Bt,!1,s),[v,te]=(0,W.useState)(``),[x,S]=(0,W.useState)(()=>({scopeKey:null,fileKeys:Ut})),[re,le]=(0,W.useState)(0),[O,A]=(0,W.useState)(null),j=ge({strict:!1,select:e=>_e(e)}),N=j?.threadId??null,P=I(j),R=pe(j)?.projection??null,he=F(P?.environmentId??null),{canReadFiles:ve}=he,Me=P?.projectId??null,Pe=L(P&&Me?{environmentId:P.environmentId,projectId:Me}:null),Le=P?.worktreePath??Pe?.workspaceRoot,ze=P?.worktreePath?void 0:Pe?.repositoryIdentity?.rootPath,Ve=c(De.configValueAtom(P?.environmentId??null)),Ge=Ae(P?.environmentId??null),Ke=ot(P?.environmentId??null,Ve?.availableEditors??[]),Je=ke(Ot.diffFileContents),ct=Oe(P!=null&&Le!=null?Ne.status({environmentId:P.environmentId,input:{cwd:Le}}):null),U=mt(e=>ut(e.byThreadKey,j)),dt=ct.data?.isRepo??!0,{turnDiffSummaries:pt,inferredCheckpointTurnCountByRunId:G}=ht(R),yt=(0,W.useMemo)(()=>[...pt].toSorted((e,t)=>{let n=e.checkpointTurnCount??G[e.runId]??0,r=t.checkpointTurnCount??G[t.runId]??0;return n===r?t.completedAt.localeCompare(e.completedAt):r-n}),[G,pt]);(0,W.useEffect)(()=>{j&&U.kind===`turn`&&mt.getState().reconcileTurnSelection(j,yt.map(e=>e.runId))},[U,yt,j]);let q=U.kind===`turn`?U.turnId:null,J=U.kind===`unstaged`?`unstaged`:`branch`,bt=U.kind===`branch`?U.baseRef:null,St=U.kind===`turn`?U.filePath:null,Ct=U.kind===`turn`?U.revealRequestId:0,Y=q===null?void 0:yt.find(e=>e.runId===q)??yt[0],wt=Y&&(Y.checkpointTurnCount??G[Y.runId]),Tt=yt[0],Et=q===null?J===`unstaged`?`Uncommitted`:`Changes`:Y?.runId===Tt?.runId?`Latest turn`:`Turn ${wt??`?`}`,Dt=Y?`turn:${Y.runId}`:J,X=j?`${j.environmentId}:${j.threadId}:${Dt}`:null,jt=`${X??Dt}:${re}`,Nt=Y?`Turn ${wt??`?`}`:J===`unstaged`?`Uncommitted`:`Changes`,Pt=(0,W.useMemo)(()=>typeof wt==`number`?{fromTurnCount:Math.max(0,wt-1),toTurnCount:wt}:null,[wt]),Ft=vt({environmentId:P?.environmentId??null,threadId:N,fromTurnCount:Pt?.fromTurnCount??null,toTurnCount:Pt?.toTurnCount??null,ignoreWhitespace:m,cacheScope:Y?`turn:${Y.runId}`:null},{enabled:dt&&Y!==void 0}),Z=Oe(ve&&q===null&&P&&Le?Ot.diffPreview({environmentId:P.environmentId,input:{cwd:Le,...bt?{baseRef:bt}:{},ignoreWhitespace:m}}):null),Lt=dt&&q===null&&P!=null&&Le!=null,Rt=j?`${j.environmentId}:${j.threadId}`:null,Q=Z.data?.sources.find(e=>e.kind===(J===`unstaged`?`working-tree`:`branch-range`)),Vt=Z.refresh,Kt=Vt,qt=(0,W.useMemo)(()=>{let e=Z.data;if(q===null&&P&&e&&Q&&ve)return We(Je,{environmentId:P.environmentId,cwd:e.cwd,sourceKind:Q.kind,baseRef:Q.baseRef,headRef:Q.headRef,cacheKey:Q.diffHash})},[P,Z.data,Je,ve,Q,q]),Jt=(0,W.useRef)(qt);Jt.current=qt;let Yt=(0,W.useCallback)(async e=>{let t=Jt.current;if(!t)throw Error(`Diff file contents are unavailable for this selection.`);return t(e)},[]),Xt=Oe(q===null&&J===`branch`&&P&&Z.data?.cwd?Ne.listRefs({environmentId:P.environmentId,input:{cwd:Z.data.cwd,includeMatchingRemoteRefs:!0,refKind:`local`,...v.trim().length>0?{query:v.trim()}:{},limit:100}}):null),Zt=Oe(q===null&&J===`branch`&&P&&Z.data?.cwd?Ne.listRefs({environmentId:P.environmentId,input:{cwd:Z.data.cwd,includeMatchingRemoteRefs:!0,refKind:`remote`,...v.trim().length>0?{query:v.trim()}:{},limit:100}}):null),Qt=kt(Xt.data?.refs.filter(e=>e.name!==Q?.headRef)??[],Zt.data?.refs??[]),$t=At(Qt,v),en=e=>bt&&bt===e.remote?.name?bt:e.local?.name??e.remote?.name??e.id,tn=[zt,...Qt.map(en)],nn=[...v.trim().length===0?[zt]:[],...$t.map(en)],rn=Q?.diff,an=Y?Ft.data?.diff:rn,on=!Y&&Q?.truncated===!0,sn=Y?Ft.isPending:Z.isPending,cn=Y?Ft.error:Z.error,ln=typeof an==`string`&&an.trim().length===0,$=!Y&&Q?.truncated&&Q.files?Q:null,un=(0,W.useMemo)(()=>$?null:Fe(an,`diff-panel:${i}`,{compactPartialHunkOffsets:q===null}),[$,i,an,q]),dn=(0,W.useMemo)(()=>new Map($?.files?.map(e=>[e.path,e])),[$?.files]),{scope:fn,isPending:pn,fileStates:mn,retry:hn,requestFile:gn,readyFilePaths:_n,renderableFiles:vn,settledFileCount:yn,loadNextFiles:bn}=Mt({environmentId:P?.environmentId,cwd:Z.data?.cwd,source:$,baseRef:$?.baseRef??bt,ignoreWhitespace:m,theme:i,revision:Z.data?ie(Z.data.generatedAt):void 0,preview:un}),xn=Vt;(0,W.useEffect)(()=>{if(!Lt)return;let e=()=>xn();return window.addEventListener(`focus`,e),()=>window.removeEventListener(`focus`,e)},[Lt,xn]),ft({enabled:Lt,mutationId:r,refresh:xn,resourceKey:`diff:${Rt??``}`});let Sn=Z.isPending||pn,Cn=(0,W.useMemo)(()=>vn.map(Ht),[vn]),wn=(0,W.useMemo)(()=>a.diffFilesCollapsed?new Set(Cn.map(e=>e.fileKey)):Ut,[Cn,a.diffFilesCollapsed]),Tn=x.scopeKey===X?x.fileKeys:wn,En=(0,W.useCallback)(()=>yn<vn.length?(0,K.jsx)(It,{load:bn,count:vn.length-yn}):null,[yn,vn.length,bn]),Dn=(0,W.useMemo)(()=>Cn.filter(({fileDiff:e})=>!$||_n.has(H(e))).map(({fileDiff:e,fileKey:t,fileVersion:n})=>({fileDiff:e,filePath:H(e),fileKey:t,fileVersion:n,collapsed:Tn.has(t)||e.cacheKey?.endsWith(`:pending`)===!0})),[Tn,Cn,$,_n]),On=(0,W.useMemo)(()=>Cn.map(e=>e.fileKey),[Cn]),kn=Se(On,Tn),An=(0,W.useMemo)(()=>!Y&&Q?.files?Q.files.reduce((e,t)=>({additions:e.additions+t.additions,deletions:e.deletions+t.deletions}),{additions:0,deletions:0}):Be(vn),[vn,Q,Y]),jn=(0,W.useMemo)(()=>xe(vn),[vn]),Mn=St?Dn.find(e=>e.filePath===St)?.fileKey??null:null;(0,W.useEffect)(()=>{Mn&&O?.getInstance()&&O.scrollTo({type:`item`,id:Mn,align:`start`})},[O,jt,Mn,Ct]);let Nn=(0,W.useMemo)(()=>({collapseScopeKey:X,diffSelection:U}),[X,U]),Pn=ye(O,Nn,Dn.map(e=>e.fileKey)),Fn=(0,W.useCallback)(e=>{let t=Cn.findIndex(t=>H(t.fileDiff)===e),n=Cn[t];n&&(S(e=>{let t=new Set(e.scopeKey===X?e.fileKeys:wn);return t.delete(n.fileKey),{scopeKey:X,fileKeys:t}}),$&&t>=yn&&gn(t),Pn(n.fileKey))},[Cn,X,wn,Pn,$,yn,gn]),In=(0,W.useRef)(null);(0,W.useEffect)(()=>{if(!$||!St)return;let e=`${St}:${Ct}`;(In.current?.cache!==fn||In.current.key!==e)&&(In.current={cache:fn,key:e},Fn(St))},[$,St,Ct,fn,Fn]);let Ln=(0,W.useCallback)(e=>{je({threadRef:j,filePath:e,activeCwd:Le,repositoryRoot:ze,openInEditor:e=>{(async()=>{let t=await Ke(e);t._tag===`Failure`&&!k(t)&&console.warn(`Failed to open diff file in editor.`,{operation:`open-diff-file`,...j?{environmentId:j.environmentId,threadId:j.threadId}:{},...fe(M(t))})})()}})},[Le,ze,Ke,j]),Rn=(0,W.useRef)({collapseScopeKey:X,defaultCollapsedDiffFileKeys:wn});(0,W.useLayoutEffect)(()=>{Rn.current={collapseScopeKey:X,defaultCollapsedDiffFileKeys:wn}},[X,wn]);let zn=(0,W.useCallback)(e=>{let{collapseScopeKey:t,defaultCollapsedDiffFileKeys:n}=Rn.current;S(r=>{let i=new Set(r.scopeKey===t?r.fileKeys:n);return i.has(e)?i.delete(e):i.add(e),{scopeKey:t,fileKeys:i}})},[]),Bn=(0,W.useCallback)(e=>{let{collapseScopeKey:t,defaultCollapsedDiffFileKeys:n}=Rn.current;S(r=>{let i=r.scopeKey===t?r.fileKeys:n;if(!i.has(e))return r;let a=new Set(i);return a.delete(e),{scopeKey:t,fileKeys:a}})},[]),Vn=(0,W.useCallback)(()=>{le(e=>e+1),S(e=>{let t=e.scopeKey===X?e.fileKeys:wn;return{scopeKey:X,fileKeys:be(On,t)}})},[X,wn,On]),Hn=e=>{j&&mt.getState().selectTurn(j,e)},Un=e=>{j&&mt.getState().selectGitScope(j,e)},Wn=e=>{j&&mt.getState().selectBranchBaseRef(j,e)},Gn=Y?`turn:${Y.runId}`:``,Kn=q===null?J:Y?.runId===Tt?.runId?`latest`:Gn,qn=e=>{if(e===`unstaged`||e===`branch`)Un(e);else if(e===`latest`)Tt&&Hn(Tt.runId);else{let t=yt.find(t=>`turn:${t.runId}`===e);t&&Hn(t.runId)}},Jn=(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3 [-webkit-app-region:no-drag]`,children:[(0,K.jsxs)(o,{children:[(0,K.jsxs)(ne,{render:(0,K.jsx)(w,{size:`xs`,variant:`secondary`}),className:`max-w-full`,"aria-label":`Diff scope: ${Et}`,children:[(0,K.jsx)(`span`,{className:`truncate`,children:Et}),(0,K.jsx)(E,{className:`size-3.5 shrink-0 opacity-70`})]}),(0,K.jsxs)(ee,{align:`start`,children:[(0,K.jsxs)(p,{value:Kn,onValueChange:qn,children:[(0,K.jsx)(n,{value:`branch`,closeOnClick:!0,children:(0,K.jsx)(`span`,{children:`Changes`})}),(0,K.jsx)(n,{value:`unstaged`,closeOnClick:!0,children:(0,K.jsx)(`span`,{children:`Uncommitted`})}),(0,K.jsx)(n,{value:`latest`,closeOnClick:!0,children:(0,K.jsx)(`span`,{children:`Latest turn`})})]}),(0,K.jsxs)(C,{children:[(0,K.jsx)(y,{children:`Turn`}),(0,K.jsx)(b,{children:(0,K.jsx)(p,{value:Gn,onValueChange:qn,children:yt.map(e=>{let t=e.checkpointTurnCount??G[e.runId]??`?`;return(0,K.jsx)(n,{value:`turn:${e.runId}`,closeOnClick:!0,children:(0,K.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,K.jsxs)(`span`,{children:[`Turn `,t]}),(0,K.jsx)(`span`,{className:`ml-auto text-xs tabular-nums text-muted-foreground`,children:qe(e.completedAt,a.timestampFormat)})]})},e.runId)})})})]})]})]}),q===null&&J===`branch`&&Q?.baseRef&&(0,K.jsxs)(`div`,{className:`flex min-w-0 max-w-full items-center gap-2 overflow-hidden text-xs text-muted-foreground`,"aria-label":`Comparing ${Q.headRef??`HEAD`} against ${Q.baseRef}`,children:[(0,K.jsxs)(V,{children:[(0,K.jsxs)(z,{render:(0,K.jsx)(`span`,{className:`flex min-w-0 items-center gap-2`}),children:[(0,K.jsx)(`span`,{className:`min-w-0 max-w-48 truncate`,children:Q.headRef??`HEAD`}),(0,K.jsx)(st,{className:`size-3.5 shrink-0 opacity-70`})]}),(0,K.jsx)(B,{side:`top`,children:`${Q.headRef??`HEAD`} → ${Q.baseRef}`})]}),(0,K.jsxs)(rt,{items:tn,filteredItems:nn,value:bt??zt,onOpenChange:e=>{e||te(``)},onValueChange:e=>{e&&Wn(e===zt?null:e)},children:[(0,K.jsxs)(Qe,{render:(0,K.jsx)(w,{variant:`ghost-muted`,size:`xs`}),className:`min-w-0 max-w-48`,"aria-label":`Change comparison target. Currently ${Q.baseRef}`,children:[(0,K.jsx)(`span`,{className:`min-w-0 truncate`,children:Q.baseRef}),(0,K.jsx)(E,{className:`size-3.5 shrink-0 opacity-70`})]}),(0,K.jsxs)(et,{align:`start`,className:`w-72 min-w-0 max-w-[calc(100vw-1rem)] overflow-hidden`,children:[(0,K.jsx)(nt,{placeholder:`Search refs...`,value:v,onChange:e=>te(e.target.value)}),(0,K.jsxs)(`div`,{className:`grid shrink-0 grid-cols-[1rem_minmax(0,1fr)] items-center gap-2 border-b border-border/70 ps-3 pe-6.5 pt-2 pb-1.5 font-medium text-3xs text-muted-foreground uppercase tracking-wide`,children:[(0,K.jsx)(`span`,{"aria-hidden":`true`}),(0,K.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[minmax(0,1fr)_2rem] items-center`,children:[(0,K.jsx)(`span`,{children:`Branch`}),(0,K.jsx)(`span`,{className:`text-right`,children:`Remote`})]})]}),(0,K.jsx)($e,{children:`No matching refs.`}),(0,K.jsxs)(Ze,{className:`max-h-64 min-w-0 overflow-x-hidden`,children:[(0,K.jsx)(tt,{className:`w-full min-w-0 grid-cols-[1rem_minmax(0,1fr)]`,value:zt,children:(0,K.jsx)(`span`,{className:`block min-w-0 truncate`,children:`Automatic`})}),Qt.map(e=>{let t=en(e),n=e.local!==null&&e.remote!==null,r=e.remote?.name===t;return(0,K.jsx)(tt,{className:`w-full min-w-0 grid-cols-[1rem_minmax(0,1fr)]`,value:t,children:(0,K.jsxs)(`div`,{className:`grid w-full min-w-0 grid-cols-[minmax(0,1fr)_2rem] items-center overflow-hidden`,children:[(0,K.jsx)(`span`,{className:`block min-w-0 truncate pe-2`,children:e.label}),n?(0,K.jsx)(`div`,{className:`flex justify-end`,onClick:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),children:(0,K.jsx)(it,{"aria-label":`Use remote version of ${e.label}`,checked:r,className:`[--thumb-size:--spacing(3)]`,onCheckedChange:t=>{let n=t?e.remote?.name:e.local?.name;n&&Wn(n)}})}):e.remote?(0,K.jsxs)(V,{children:[(0,K.jsx)(z,{render:(0,K.jsx)(`span`,{className:`flex justify-end text-muted-foreground`,children:(0,K.jsx)(oe,{role:`img`,"aria-label":`Remote only`,className:`size-3`})})}),(0,K.jsx)(B,{side:`top`,children:`Remote only`})]}):null]})},e.id)})]})]})]})]})]}),(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 [-webkit-app-region:no-drag]`,children:[Dn.length>0||!Y&&Q?.files?.length?(0,K.jsx)(gt,{additions:An.additions,deletions:An.deletions,className:`mr-1 text-2xs`,layout:`inline`}):null,Lt&&(0,K.jsxs)(V,{children:[(0,K.jsx)(z,{render:(0,K.jsx)(w,{type:`button`,size:`icon-sm`,variant:`ghost`,"aria-label":Sn?`Refreshing diff`:`Refresh diff`,onClick:Kt}),children:(0,K.jsx)(lt,{size:`sm`,refreshing:Sn})}),(0,K.jsx)(B,{side:`top`,children:Sn?`Refreshing diff…`:`Refresh diff`})]}),On.length>0&&(0,K.jsx)(w,{type:`button`,size:`icon-sm`,variant:`ghost`,"aria-label":kn?`Expand all files`:`Collapse all files`,onClick:Vn,children:(0,K.jsx)(me,{className:`size-3.5`,icon:kn?_t.ChevronsUpDown:_t.ChevronsDownUp})}),(0,K.jsxs)(Ye,{"aria-label":`Diff layout`,className:`shrink-0`,variant:`segmented`,value:[l],onValueChange:e=>{let t=e[0];(t===`stacked`||t===`split`)&&u({diffLayout:t})},children:[(0,K.jsx)(Xe,{"aria-label":`Stacked diff view`,value:`stacked`,children:(0,K.jsx)(D,{className:`size-3.5`})}),(0,K.jsx)(Xe,{"aria-label":`Split diff view`,value:`split`,children:(0,K.jsx)(se,{className:`size-3.5`})})]}),(0,K.jsxs)(V,{children:[(0,K.jsx)(z,{render:(0,K.jsx)(Xe,{"aria-label":d?`Disable diff line wrapping`:`Enable diff line wrapping`,variant:`ghost`,size:`sm`,pressed:d,onPressedChange:e=>{f(!!e)}}),children:(0,K.jsx)(de,{className:`size-3.5`})}),(0,K.jsx)(B,{side:`top`,children:d?`Disable line wrapping`:`Enable line wrapping`})]}),(0,K.jsxs)(V,{children:[(0,K.jsx)(z,{render:(0,K.jsx)(Xe,{"aria-label":m?`Show whitespace changes`:`Hide whitespace changes`,variant:`ghost`,size:`sm`,pressed:m,onPressedChange:e=>{h(!!e)}}),children:(0,K.jsx)(ue,{className:`size-3.5`})}),(0,K.jsx)(B,{side:`top`,children:m?`Show whitespace changes`:`Hide whitespace changes`})]}),On.length>0&&(0,K.jsxs)(V,{children:[(0,K.jsx)(z,{render:(0,K.jsx)(Xe,{"aria-label":g?`Hide file tree`:`Show file tree`,variant:`ghost`,size:`sm`,pressed:g,onPressedChange:e=>_(!!e)}),children:(0,K.jsx)(ce,{className:`size-3.5`})}),(0,K.jsx)(B,{side:`top`,children:g?`Hide file tree`:`Show file tree`})]})]})]});return(0,K.jsx)(Ue,{mode:e,header:Jn,children:P?dt?q!==null&&yt.length===0?(0,K.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:`No completed turns yet.`}):q===null&&!ve?he.isPending?(0,K.jsx)(He,{label:`Checking file access...`}):(0,K.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:he.error??`This connection cannot read local diffs.`}):(0,K.jsx)(K.Fragment,{children:(0,K.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background`,children:[on&&!$&&(0,K.jsxs)(`p`,{className:`shrink-0 border-b border-border/70 bg-muted/40 px-3 py-1.5 text-2xs text-muted-foreground`,children:[`This preview exceeds the size limit. Changes shown are incomplete.`,Q?.files?` Totals include all changes.`:``]}),cn&&!un&&(0,K.jsx)(`div`,{className:`px-3`,children:(0,K.jsx)(`p`,{className:`mb-2 text-2xs text-error/80`,children:cn})}),!un&&!$?sn?(0,K.jsx)(He,{label:Y?`Loading checkpoint diff...`:J===`unstaged`?`Loading uncommitted changes...`:`Loading changes...`}):(0,K.jsx)(`div`,{className:`flex h-full items-center justify-center px-3 py-2 text-xs text-muted-foreground/70`,children:(0,K.jsx)(`p`,{children:ln?`No net changes in this selection.`:`No patch available for this selection.`})}):$||un?.kind===`files`?(0,K.jsxs)(`div`,{className:`flex min-h-0 flex-1 overflow-hidden`,children:[(0,K.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1`,onClickCapture:e=>{let t=e.nativeEvent.composedPath?.()??[];for(let e of t)if(e instanceof HTMLElement&&(e instanceof HTMLButtonElement||e instanceof HTMLAnchorElement))return;let n=t.find(e=>e instanceof HTMLElement&&e.hasAttribute(`data-title`))?.textContent;if(n){Ln(n);return}let r=t.find(e=>e instanceof HTMLElement&&e.hasAttribute(`data-diffs-header`))?.querySelector(`[data-title]`)?.textContent;if(!r)return;let i=Dn.find(e=>e.filePath===r);i&&zn(i.fileKey)},onContextMenuCapture:e=>{let t=(e.nativeEvent.composedPath?.()??[]).find(e=>e instanceof HTMLElement&&e.hasAttribute(`data-title`))?.textContent?.trim();t&&(e.preventDefault(),Ge({environmentId:P?.environmentId??null,filePath:t,workspaceRoot:Le,repositoryRoot:ze},e))},children:(0,K.jsx)(xt,{viewerRef:A,codeViewKey:`${jt}:${$?fn:`preview`}`,className:`h-full min-h-0 overflow-auto`,files:Dn,renderCodeViewFooter:En,sectionId:Dt,sectionTitle:Nt,composerDraftTarget:t,renderHeaderFilenameSuffix:e=>{let t=H(e),n=mn.get(t);return(0,K.jsx)(Gt,{filePath:t,hasStat:dn.has(t),error:n?.error??!1,truncated:n?.truncated??!1,onRetry:hn})},...$?{unsafeCSSExtra:`[data-additions-count], [data-deletions-count] { display: none; }`,renderHeaderMetadata:e=>{let t=dn.get(H(e));return t?(0,K.jsx)(gt,{additions:t.additions,deletions:t.deletions}):null}}:{},onRevealSearchMatch:Bn,renderHeaderPrefix:(e,t)=>{let n=e.cacheKey?.endsWith(`:pending`)===!0;return(0,K.jsx)(Wt,{filePath:H(e),fileKey:t,collapsed:n||Tn.has(t),unavailable:n,iconClassName:Re(e),onToggle:zn})},options:{diffStyle:l===`split`?`split`:`unified`,lineDiffType:`none`,overflow:d?`wrap`:`scroll`,theme:Ie(i),preferredHighlighter:at,themeType:i,stickyHeaders:!0,...qt?{loadDiffFiles:Yt}:{}}},X??Dt)}),g?(0,K.jsx)(`aside`,{className:`flex w-[min(16rem,40%)] min-w-40 shrink-0 border-l border-border/60`,children:(0,K.jsx)(Ce,{ariaLabel:`${Nt} files`,entries:jn,selectedPath:St,revealRequestId:Ct,onSelectFile:Fn})}):null]}):(0,K.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto p-2`,children:(0,K.jsxs)(`div`,{className:`space-y-2`,children:[(0,K.jsx)(`p`,{className:`text-2xs text-muted-foreground/75`,children:un?.kind===`raw`?un.reason:null}),(0,K.jsx)(`pre`,{className:T(`max-h-[72vh] rounded-md border border-border/70 bg-background/70 p-3 font-mono text-2xs leading-relaxed text-muted-foreground/90`,d?`overflow-auto whitespace-pre-wrap wrap-break-word`:`overflow-auto`),children:un?.kind===`raw`?un.text:null})]})})]})}):(0,K.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:`Turn diffs are unavailable because this project is not a git repository.`}):(0,K.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:`Select a thread to inspect turn diffs.`})})}export{Kt as default};
2
- //# sourceMappingURL=DiffPanel-Dqh76p3E.js.map
@@ -1,2 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$n as n,Ax as r,D as i,Fo as a,Gn as o,Jn as s,Mf as c,No as l,Qn as u,Vs as d,Wn as f,Xl as p,Yn as m,Zn as h,ar as g,ha as _,ir as v,jo as y,nu as b,or as x,qn as S,rr as C,sr as w,t as T,tr as E,zo as D}from"./utils-DmfMX1v5.js";import{t as O}from"./camera-V1Ufc9sC.js";import{t as k}from"./ellipsis-vertical-fYTS1grT.js";import{t as ee}from"./external-link-NWS0I_zo.js";import{t as A}from"./globe-BygqUCSx.js";import{t as te}from"./minus-C7W28oE7.js";import{t as ne}from"./mouse-pointer-click-DsDE4K7M.js";import{t as re}from"./picture-in-picture-2-g5nsWFVw.js";import{t as ie}from"./plus-Cr075-cy.js";import{t as ae}from"./radio-tower-CT5Np78y.js";import{t as j}from"./x-CSwbgjBe.js";import{L as M,U as N}from"./runtime-BQJQC-Ny.js";import{b as oe}from"./entities-82m-Smm-.js";import{a as se,n as P,t as F}from"./tooltip-taOyJZax.js";import{ct as ce}from"./ChatMarkdown-CLD9Y6dg.js";import{i as I}from"./toast-CjelgyqV.js";import{C as le,O as L,S as ue,q as R}from"./useSettings-CLtJrOYI.js";import{i as de,n as z}from"./session-DsbInyNV.js";import{t as B}from"./use-atom-command-CQHjSXPR.js";import{l as V}from"./rightPanelStore-DqMd0tFH.js";import{n as H}from"./toastHelpers-Dsph6LwL.js";import{A as U,k as W}from"./PanelLayoutControls-BfRIRM0o.js";import{o as fe}from"./timestampFormat-wac2e_Jz.js";import{a as G,o as K,r as q,t as pe}from"./empty-C-gDaZ_z.js";import{a as me,i as he,t as ge}from"./previewMiniPlayerStore-B9Lqaaij.js";import{n as _e,t as ve}from"./discovery-list-Fg_u6w-x.js";import{t as ye}from"./observeResize-Csvw3hy4.js";import{n as be}from"./openFileInPreview-C3O_ayUT.js";import{T as xe,a as Se,b as Ce,f as we,i as Te,n as Ee,o as De,r as Oe,t as ke,u as Ae,w as je}from"./browserHistoryStore-BJD0OPpb.js";import{t as Me}from"./preview-CEMnbqVB.js";import{n as Ne,r as Pe,t as Fe}from"./preview-CjgXQQdj.js";import{n as Ie,r as Le,t as Re}from"./input-group-CJ7ZOvDN.js";import{Ji as ze,Mo as Be,Qi as Ve,Xi as He,Yi as Ue,Zi as We,ca as Ge,da as Ke,fa as J,gs as Y,ha as X,na as qe,oa as Je,oo as Ye,qa as Xe,ra as Ze,sa as Qe,ta as $e,vs as et}from"./main-BB3F4O6Y.js";import{a as tt,c as nt,d as rt,f as it,i as at,l as ot,n as st,o as ct,r as lt,s as ut,u as dt}from"./_chat-BKcYL38S.js";var Z=e(t(),1),Q=r(),ft=`data:image/png;base64,`;function pt(e){if(!e.screenshot)return{status:`none`};try{let{dataUrl:t}=e.screenshot;if(!t.startsWith(ft))return{status:`failed`};let n=X(t,`preview-annotation-${e.id}.png`,`image/png`);return n.size>0?{status:`captured`,file:n}:{status:`failed`}}catch{return{status:`failed`}}}var $=e(_(),1),mt=()=>{};function ht(e){let t=(0,Q.c)(78),{url:n,loading:r,canGoBack:i,canGoForward:a,refreshDisabled:o,inputDisabled:s,focusUrlNonce:c,onBack:l,onForward:u,onRefresh:d,onSubmit:f,onOpenInBrowser:p,onCapture:m,captureDisabled:h,recording:g,onPictureInPicture:_,pictureInPicture:v,pictureInPictureDisabled:y,onPickElement:b,pickActive:x,pickDisabled:S,pickDisabledReason:C,trailingActions:E,leadingActions:D}=e,k=(0,Z.useRef)(null),[A,te]=(0,Z.useState)(n),[ie,ae]=(0,Z.useState)(!1),j,M;t[0]===c?(j=t[1],M=t[2]):(j=()=>{if(c==null)return;let e=k.current;e&&e.focus()},M=[c],t[0]=c,t[1]=j,t[2]=M),(0,Z.useEffect)(j,M);let N;t[3]!==A||t[4]!==f?(N=e=>{e?.preventDefault();let t=A.trim();t.length!==0&&(f(t),k.current?.blur())},t[3]=A,t[4]=f,t[5]=N):N=t[5];let oe=N,ce=i?l:mt,I=!i,le;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(le=(0,$.jsx)(et,{}),t[6]=le):le=t[6];let L;t[7]!==ce||t[8]!==I?(L=(0,$.jsx)(w,{variant:`ghost`,size:`icon-xs`,onClick:ce,disabled:I,"aria-label":`Back`,type:`button`,children:le}),t[7]=ce,t[8]=I,t[9]=L):L=t[9];let ue=a?u:mt,R=!a,de;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,$.jsx)(Y,{}),t[10]=de):de=t[10];let z;t[11]!==ue||t[12]!==R?(z=(0,$.jsx)(w,{variant:`ghost`,size:`icon-xs`,onClick:ue,disabled:R,"aria-label":`Forward`,type:`button`,children:de}),t[11]=ue,t[12]=R,t[13]=z):z=t[13];let B=o?mt:d,V=r?`Stop`:`Refresh`,H;t[14]!==o||t[15]!==B||t[16]!==V?(H=(0,$.jsx)(w,{variant:`ghost`,size:`icon-xs`,onClick:B,disabled:o,"aria-label":V,type:`button`}),t[14]=o,t[15]=B,t[16]=V,t[17]=H):H=t[17];let U;t[18]===r?U=t[19]:(U=(0,$.jsx)(Xe,{refreshing:r}),t[18]=r,t[19]=U);let W;t[20]!==H||t[21]!==U?(W=(0,$.jsx)(se,{render:H,children:U}),t[20]=H,t[21]=U,t[22]=W):W=t[22];let fe=r?`Loading…`:`Refresh`,G;t[23]===fe?G=t[24]:(G=(0,$.jsx)(P,{children:fe}),t[23]=fe,t[24]=G);let K;t[25]!==W||t[26]!==G?(K=(0,$.jsxs)(F,{children:[W,G]}),t[25]=W,t[26]=G,t[27]=K):K=t[27];let q;t[28]!==z||t[29]!==K||t[30]!==L?(q=(0,$.jsxs)(`div`,{className:`flex items-center gap-0.5`,role:`group`,"aria-label":`Navigation`,children:[L,z,K]}),t[28]=z,t[29]=K,t[30]=L,t[31]=q):q=t[31];let pe=ie?A:n,me;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(me=e=>te(e.target.value),t[32]=me):me=t[32];let he;t[33]===n?he=t[34]:(he=()=>{te(n),ae(!0),queueMicrotask(()=>k.current?.select())},t[33]=n,t[34]=he);let ge;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(ge=()=>{ae(!1)},t[35]=ge):ge=t[35];let _e;t[36]!==oe||t[37]!==n?(_e=e=>{e.key===`Enter`&&oe(e),e.key===`Escape`&&(e.preventDefault(),te(n),k.current?.blur())},t[36]=oe,t[37]=n,t[38]=_e):_e=t[38];let ve;t[39]!==s||t[40]!==pe||t[41]!==he||t[42]!==_e?(ve=(0,$.jsx)(F,{children:(0,$.jsx)(se,{render:(0,$.jsx)(Le,{ref:k,value:pe,onChange:me,onFocus:he,onBlur:ge,onKeyDown:_e,placeholder:`Search or enter URL`,spellCheck:!1,disabled:s,"data-preview-url-input":!0,size:`sm`})})}),t[39]=s,t[40]=pe,t[41]=he,t[42]=_e,t[43]=ve):ve=t[43];let ye;t[44]!==ie||t[45]!==p?(ye=p&&!ie?(0,$.jsx)(Ie,{align:`inline-end`,children:(0,$.jsx)(`span`,{className:`pointer-events-none flex opacity-0 transition-opacity focus-within:pointer-events-auto focus-within:opacity-100 group-hover/address:pointer-events-auto group-hover/address:opacity-100`,children:(0,$.jsx)(w,{variant:`ghost`,size:`icon-xs`,onClick:p,"aria-label":`Open in system browser`,type:`button`,children:(0,$.jsx)(ee,{})})})}):null,t[44]=ie,t[45]=p,t[46]=ye):ye=t[46];let be;t[47]!==ve||t[48]!==ye?(be=(0,$.jsxs)(Re,{variant:`ghost`,className:`group/address h-7 flex-1`,children:[ve,ye]}),t[47]=ve,t[48]=ye,t[49]=be):be=t[49];let xe;t[50]!==b||t[51]!==x||t[52]!==S||t[53]!==C?(xe=b?(0,$.jsxs)(F,{children:[(0,$.jsx)(se,{render:(0,$.jsx)(w,{variant:x?`secondary`:`ghost`,size:`icon-xs`,onClick:b,disabled:S,"aria-label":x?`Cancel annotation`:`Annotate preview`,"aria-pressed":x?`true`:`false`,type:`button`}),children:(0,$.jsx)(ne,{className:T(x&&`text-primary`)})}),(0,$.jsx)(P,{children:S&&C?C:x?`Cancel annotation (Esc)`:`Annotate elements, regions, and drawings`})]}):null,t[50]=b,t[51]=x,t[52]=S,t[53]=C,t[54]=xe):xe=t[54];let Se;t[55]!==h||t[56]!==m||t[57]!==g?(Se=m?(0,$.jsxs)(F,{children:[(0,$.jsxs)(se,{render:(0,$.jsx)(w,{variant:g?`secondary`:`ghost`,size:`icon-xs`,onClick:e=>m(e.shiftKey),"aria-label":g?`Stop recording`:`Capture screenshot`,type:`button`,className:`relative`,disabled:h}),children:[(0,$.jsx)(O,{className:T(g&&`text-destructive`)}),g?(0,$.jsx)(`span`,{className:`absolute right-0.5 top-0.5 size-1.5 animate-status-pulse rounded-full bg-destructive`}):null]}),(0,$.jsx)(P,{children:g?`Stop recording`:`Screenshot · Shift-click to record`})]}):null,t[55]=h,t[56]=m,t[57]=g,t[58]=Se):Se=t[58];let Ce;t[59]!==_||t[60]!==v||t[61]!==y?(Ce=_?(0,$.jsx)(w,{variant:v?`secondary`:`ghost`,size:`icon-xs`,onClick:_,"aria-label":v?`Close floating preview`:`Float preview over chat`,"aria-pressed":v?`true`:`false`,type:`button`,disabled:y,children:(0,$.jsx)(re,{className:T(v&&`text-primary`)})}):null,t[59]=_,t[60]=v,t[61]=y,t[62]=Ce):Ce=t[62];let we;t[63]!==D||t[64]!==oe||t[65]!==q||t[66]!==be||t[67]!==xe||t[68]!==Se||t[69]!==Ce||t[70]!==E?(we=(0,$.jsxs)(`form`,{onSubmit:oe,className:`flex h-10 min-h-10 shrink-0 items-center gap-1 border-b border-border/60 bg-background px-2 in-data-[preview-panel-mode=inline]:mb-3 in-data-[preview-panel-mode=inline]:h-7 in-data-[preview-panel-mode=inline]:min-h-7 in-data-[preview-panel-mode=inline]:border-b-transparent`,"data-surface-subheader":!0,children:[q,D,be,xe,Se,Ce,E]}),t[63]=D,t[64]=oe,t[65]=q,t[66]=be,t[67]=xe,t[68]=Se,t[69]=Ce,t[70]=E,t[71]=we):we=t[71];let Te;t[72]===Symbol.for(`react.memo_cache_sentinel`)?(Te={boxShadow:`0 0 6px 1px var(--color-ring)`},t[72]=Te):Te=t[72];let Ee;t[73]===r?Ee=t[74]:(Ee=(0,$.jsx)(`div`,{"aria-hidden":!0,"data-loading":r,className:`preview-loading-progress pointer-events-none absolute bottom-0 left-0 z-10 h-0.5 w-full origin-left rounded-r-full bg-primary`,style:Te}),t[73]=r,t[74]=Ee);let De;return t[75]!==we||t[76]!==Ee?(De=(0,$.jsxs)(`div`,{className:`relative`,children:[we,Ee]}),t[75]=we,t[76]=Ee,t[77]=De):De=t[77],De}function gt(e){let t=(0,Q.c)(10),{threadRef:n,server:r,onOpen:i}=e,a;t[0]===r?a=t[1]:(a=_t(r),t[0]=r,t[1]=a);let o=a,s;t[2]!==r.requestedUrl||t[3]!==n?(s=(0,$.jsx)(W,{threadRef:n,url:r.requestedUrl}),t[2]=r.requestedUrl,t[3]=n,t[4]=s):s=t[4];let c=`${r.host}:${r.port}`,l;return t[5]!==i||t[6]!==o||t[7]!==s||t[8]!==c?(l=(0,$.jsx)(_e,{onClick:i,icon:s,title:o,description:c}),t[5]=i,t[6]=o,t[7]=s,t[8]=c,t[9]=l):l=t[9],l}function _t(e){return e.processName?e.processName:`Listening`}function vt(e){let t=(0,Q.c)(26),{threadRef:n,entry:r,onOpen:i,onRemove:a}=e,o;t[0]===r.url?o=t[1]:(o=new URL(r.url),t[0]=r.url,t[1]=o);let s=o,c=s.pathname===`/`?``:s.pathname,l=`${s.host}${c}${s.search}${s.hash}`,u;t[2]===r.lastVisitedAt?u=t[3]:(u=ke(r.lastVisitedAt)?fe(new Date(r.lastVisitedAt).toISOString()):``,t[2]=r.lastVisitedAt,t[3]=u);let d=u;ut();let f;t[4]!==r.url||t[5]!==n?(f=(0,$.jsx)(W,{threadRef:n,url:r.url}),t[4]=r.url,t[5]=n,t[6]=f):f=t[6];let p=r.title??l,m;t[7]===p?m=t[8]:(m=(0,$.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,children:p}),t[7]=p,t[8]=m);let h=r.title?`${l} · `:``,g;t[9]!==h||t[10]!==d?(g=(0,$.jsxs)(`span`,{className:`truncate text-xs text-muted-foreground`,children:[h,d]}),t[9]=h,t[10]=d,t[11]=g):g=t[11];let _;t[12]!==m||t[13]!==g?(_=(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[m,g]}),t[12]=m,t[13]=g,t[14]=_):_=t[14];let v;t[15]!==i||t[16]!==f||t[17]!==_?(v=(0,$.jsxs)(`button`,{type:`button`,onClick:i,className:`flex w-full items-center gap-3 px-3 py-3 pr-10 text-left hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,children:[f,_]}),t[15]=i,t[16]=f,t[17]=_,t[18]=v):v=t[18];let y=`Remove ${l} from history`,b;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,$.jsx)(j,{className:`size-3.5`}),t[19]=b):b=t[19];let x;t[20]!==a||t[21]!==y?(x=(0,$.jsx)(`button`,{type:`button`,"aria-label":y,onClick:a,className:`absolute right-3 rounded p-1 text-muted-foreground opacity-0 hover:bg-accent hover:text-foreground focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring group-hover:opacity-100`,children:b}),t[20]=a,t[21]=y,t[22]=x):x=t[22];let S;return t[23]!==x||t[24]!==v?(S=(0,$.jsxs)(`div`,{className:`group relative flex w-full items-center`,children:[v,x]}),t[23]=x,t[24]=v,t[25]=S):S=t[25],S}function yt(e){let t=(0,Q.c)(7),n=Ge(e.environmentId,e.configuredUrls),r;if(t[0]!==e.configuredUrls||t[1]!==e.environmentId||t[2]!==n.configuredUrlProbing||t[3]!==n.servers){let i;t[5]===e.environmentId?i=t[6]:(i=t=>({...t,url:De(e.environmentId,t.url),requestedUrl:t.url}),t[5]=e.environmentId,t[6]=i),r=bt({scanner:n.servers.map(i),configuredUrls:e.configuredUrls??[],configuredUrlProbing:n.configuredUrlProbing}),t[0]=e.configuredUrls,t[1]=e.environmentId,t[2]=n.configuredUrlProbing,t[3]=n.servers,t[4]=r}else r=t[4];return r}function bt(e){let t=new Map;for(let n of e.configuredUrls){let e=St(n);if(!e)continue;let r=xt(e.host,e.port);t.has(r)||t.set(r,e)}let n=[];for(let r of e.scanner){let i=xt(r.host,r.port),a=t.get(i);n.push({...r,requestedUrl:a&&e.configuredUrlProbing===!1?a.url:r.requestedUrl,source:a?`configured`:`scanner`})}return n.toSorted((e,t)=>{let n={configured:0,scanner:1};return n[e.source]===n[t.source]?e.port-t.port:n[e.source]-n[t.source]})}function xt(e,t){let n=e.toLowerCase();return`${Fe(n)?`loopback`:n}:${t}`}function St(e){try{let t=new URL(e);if(t.protocol!==`http:`&&t.protocol!==`https:`||!Fe(t.hostname))return null;let n=t.port?Number.parseInt(t.port,10):t.protocol===`http:`?80:443;return!Number.isFinite(n)||n<=0?null:{host:t.hostname,port:n,url:t.href}}catch{return null}}function Ct(e){let t=(0,Q.c)(24),{threadRef:n,environmentId:r,configuredUrls:i,recentEntries:a,onRemoveRecent:o,onOpenUrl:s}=e,c;t[0]!==i||t[1]!==r?(c={environmentId:r,configuredUrls:i},t[0]=i,t[1]=r,t[2]=c):c=t[2];let l=yt(c),u,d,f,p;if(t[3]!==s||t[4]!==o||t[5]!==a||t[6]!==l.length||t[7]!==n){p=Symbol.for(`react.early_return_sentinel`);bb0:{let e=a.filter(wt).slice(0,8);if(l.length===0&&e.length===0){let e;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsxs)(pe,{children:[(0,$.jsx)(G,{variant:`icon`,children:(0,$.jsx)(A,{className:`size-4.5 text-muted-foreground`})}),(0,$.jsx)(K,{children:`No preview yet`}),(0,$.jsx)(q,{children:`Type a URL above, or run a dev script. Browser-ready localhost servers will show up here automatically.`})]}),t[12]=e):e=t[12],p=e;break bb0}f=`scrollbar-gutter-both flex h-full min-h-0 overflow-y-auto px-5 py-8`,u=`mx-auto flex w-full max-w-xl flex-col gap-6`,d=e.length>0?(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,$.jsx)(Be,{className:`size-4 shrink-0`}),(0,$.jsx)(`h2`,{className:`font-medium`,children:`Recently used`})]}),(0,$.jsx)(ve,{children:e.map(e=>(0,$.jsx)(vt,{threadRef:n,entry:e,onOpen:()=>s(e.url),onRemove:()=>o(e.url)},e.url))})]}):null}t[3]=s,t[4]=o,t[5]=a,t[6]=l.length,t[7]=n,t[8]=u,t[9]=d,t[10]=f,t[11]=p}else u=t[8],d=t[9],f=t[10],p=t[11];if(p!==Symbol.for(`react.early_return_sentinel`))return p;let m;t[13]!==s||t[14]!==l||t[15]!==n?(m=l.length>0?(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,$.jsx)(ae,{className:`size-4 shrink-0`}),(0,$.jsx)(`h2`,{className:`font-medium`,children:`Local servers`})]}),(0,$.jsx)(ve,{children:l.map(e=>(0,$.jsx)(gt,{threadRef:n,server:e,onOpen:()=>s(e.requestedUrl)},`${e.host}:${e.port}`))}),(0,$.jsx)(`p`,{className:`px-1 text-xs text-muted-foreground`,children:`Select a live local server to open it in this browser tab.`})]}):null,t[13]=s,t[14]=l,t[15]=n,t[16]=m):m=t[16];let h;t[17]!==u||t[18]!==d||t[19]!==m?(h=(0,$.jsxs)(`div`,{className:u,children:[d,m]}),t[17]=u,t[18]=d,t[19]=m,t[20]=h):h=t[20];let g;return t[21]!==f||t[22]!==h?(g=(0,$.jsx)(`div`,{className:f,children:h}),t[21]=f,t[22]=h,t[23]=g):g=t[23],g}function wt(e){return URL.canParse(e.url)}var Tt=[{value:`system`,label:`System`},{value:`light`,label:`Light`},{value:`dark`,label:`Dark`}],Et=()=>{let e=(0,Q.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(F,{children:[(0,$.jsx)(se,{render:(0,$.jsx)(x,{render:(0,$.jsx)(w,{variant:`ghost`,size:`icon-xs`,type:`button`,"aria-label":`Preview menu`})}),children:(0,$.jsx)(k,{})}),(0,$.jsx)(P,{children:`More`})]}),e[0]=t):t=e[0],t};function Dt(e){let t=(0,Q.c)(74),{enabled:n,actions:r,zoomFactor:i,colorScheme:a,deviceToolbarVisible:c,onToggleDeviceToolbar:l,nativePictureInPicture:d,profileName:f,move:p}=e,_;t[0]===i?_=t[1]:(_=Math.round(i*100),t[0]=i,t[1]=_);let y=`${_}%`,b=!n,x;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(Et,{}),t[2]=x):x=t[2];let T;t[3]!==r.hardReload||t[4]!==b?(T=(0,$.jsx)(m,{onClick:r.hardReload,disabled:b,children:`Hard reload`}),t[3]=r.hardReload,t[4]=b,t[5]=T):T=t[5];let D;t[6]!==r.openDevTools||t[7]!==b?(D=r.openDevTools?(0,$.jsx)(m,{onClick:r.openDevTools,disabled:b,children:`Open DevTools`}):null,t[6]=r.openDevTools,t[7]=b,t[8]=D):D=t[8];let O;t[9]!==r.toggleNativePictureInPicture||t[10]!==b||t[11]!==d?(O=r.toggleNativePictureInPicture?(0,$.jsx)(m,{onClick:r.toggleNativePictureInPicture,disabled:b,children:d?`Close separate preview window`:`Open separate preview window`}):null,t[9]=r.toggleNativePictureInPicture,t[10]=b,t[11]=d,t[12]=O):O=t[12];let k;t[13]===p?k=t[14]:(k=p?(0,$.jsx)(m,{onClick:p.onMove,children:p.label}):null,t[13]=p,t[14]=k);let ee=c?`Hide device toolbar`:`Show device toolbar`,A;t[15]!==b||t[16]!==l||t[17]!==ee?(A=(0,$.jsx)(m,{onClick:l,disabled:b,children:ee}),t[15]=b,t[16]=l,t[17]=ee,t[18]=A):A=t[18];let ne;t[19]===b?ne=t[20]:(ne=(0,$.jsx)(g,{disabled:b,children:`Appearance`}),t[19]=b,t[20]=ne);let re;t[21]===r?re=t[22]:(re=e=>r.setColorScheme(e),t[21]=r,t[22]=re);let ae;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(ae=Tt.map(kt),t[23]=ae):ae=t[23];let j;t[24]!==a||t[25]!==re?(j=(0,$.jsx)(v,{children:(0,$.jsx)(u,{value:a,onValueChange:re,children:ae})}),t[24]=a,t[25]=re,t[26]=j):j=t[26];let M;t[27]!==j||t[28]!==ne?(M=(0,$.jsxs)(C,{children:[ne,j]}),t[27]=j,t[28]=ne,t[29]=M):M=t[29];let N;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,$.jsx)(E,{}),t[30]=N):N=t[30];let oe;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,$.jsx)(`span`,{children:`Zoom`}),t[31]=oe):oe=t[31];let se;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(se=(0,$.jsx)(te,{}),t[32]=se):se=t[32];let P;t[33]!==r.zoomOut||t[34]!==b?(P=(0,$.jsx)(w,{variant:`outline`,size:`icon-xs`,type:`button`,onClick:r.zoomOut,"aria-label":`Zoom out`,disabled:b,children:se}),t[33]=r.zoomOut,t[34]=b,t[35]=P):P=t[35];let F;t[36]===y?F=t[37]:(F=(0,$.jsx)(`span`,{className:`min-w-12 text-center text-xs tabular-nums text-muted-foreground`,children:y}),t[36]=y,t[37]=F);let ce;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,$.jsx)(ie,{}),t[38]=ce):ce=t[38];let I;t[39]!==r.zoomIn||t[40]!==b?(I=(0,$.jsx)(w,{variant:`outline`,size:`icon-xs`,type:`button`,onClick:r.zoomIn,"aria-label":`Zoom in`,disabled:b,children:ce}),t[39]=r.zoomIn,t[40]=b,t[41]=I):I=t[41];let le;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(le=(0,$.jsx)(Ye,{}),t[42]=le):le=t[42];let L;t[43]!==r.resetZoom||t[44]!==b?(L=(0,$.jsx)(w,{variant:`ghost`,size:`icon-xs`,type:`button`,onClick:r.resetZoom,"aria-label":`Reset zoom`,disabled:b,children:le}),t[43]=r.resetZoom,t[44]=b,t[45]=L):L=t[45];let ue;t[46]!==P||t[47]!==F||t[48]!==I||t[49]!==L?(ue=(0,$.jsxs)(`span`,{className:`flex items-center gap-1`,children:[P,F,I,L]}),t[46]=P,t[47]=F,t[48]=I,t[49]=L,t[50]=ue):ue=t[50];let R;t[51]!==b||t[52]!==ue?(R=(0,$.jsxs)(m,{closeOnClick:!1,onClick:Ot,className:`justify-between`,disabled:b,children:[oe,ue]}),t[51]=b,t[52]=ue,t[53]=R):R=t[53];let de;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,$.jsx)(E,{}),t[54]=de):de=t[54];let z;t[55]===f?z=t[56]:(z=f?(0,$.jsx)(s,{className:`max-w-64`,children:(0,$.jsxs)(`span`,{className:`block truncate`,children:[`Profile: `,f]})}):null,t[55]=f,t[56]=z);let B;t[57]===r.clearCookies?B=t[58]:(B=(0,$.jsx)(m,{onClick:r.clearCookies,children:`Clear cookies`}),t[57]=r.clearCookies,t[58]=B);let V;t[59]===r.clearCache?V=t[60]:(V=(0,$.jsx)(m,{onClick:r.clearCache,children:`Clear cache`}),t[59]=r.clearCache,t[60]=V);let H;t[61]!==z||t[62]!==B||t[63]!==V?(H=(0,$.jsxs)(S,{children:[z,B,V]}),t[61]=z,t[62]=B,t[63]=V,t[64]=H):H=t[64];let U;return t[65]!==M||t[66]!==R||t[67]!==H||t[68]!==T||t[69]!==D||t[70]!==O||t[71]!==k||t[72]!==A?(U=(0,$.jsxs)(o,{children:[x,(0,$.jsxs)(h,{align:`end`,sideOffset:6,children:[T,D,O,k,A,M,N,R,de,H]})]}),t[65]=M,t[66]=R,t[67]=H,t[68]=T,t[69]=D,t[70]=O,t[71]=k,t[72]=A,t[73]=U):U=t[73],U}function Ot(e){return e.preventDefault()}function kt(e){return(0,$.jsx)(n,{value:e.value,children:e.label},e.value)}function At(e){return D[e]||(e.length>0?e:`Network error`)}function jt(e){let t=(0,Q.c)(21),{url:n,fileName:r,downloadUrl:i,onOpen:a}=e,o;t[0]===n?o=t[1]:(o=Ft(n)??n,t[0]=n,t[1]=o);let s=o,c,l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(Pt,{className:`mb-6 size-12 text-muted-foreground/70`}),l=(0,$.jsx)(`h1`,{className:`mb-3 text-2xl font-semibold leading-tight text-foreground`,children:`This file can’t be shown here`}),t[2]=c,t[3]=l):(c=t[2],l=t[3]);let u;t[4]===r?u=t[5]:(u=(0,$.jsx)(`span`,{className:`font-semibold text-foreground`,children:r}),t[4]=r,t[5]=u);let d;t[6]!==s||t[7]!==u?(d=(0,$.jsxs)(`p`,{className:`text-sm leading-relaxed text-muted-foreground`,children:[u,` from `,s,` was downloaded instead.`]}),t[6]=s,t[7]=u,t[8]=d):d=t[8];let f;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsx)(`div`,{className:`flex-1`}),t[9]=f):f=t[9];let p;t[10]===a?p=t[11]:(p=(0,$.jsx)(w,{type:`button`,variant:`outline`,size:`sm`,onClick:a,children:`Open in browser`}),t[10]=a,t[11]=p);let m;t[12]!==i||t[13]!==r?(m=i?(0,$.jsx)(w,{type:`button`,size:`sm`,render:(0,$.jsx)(`a`,{href:i,download:r}),children:`Download`}):null,t[12]=i,t[13]=r,t[14]=m):m=t[14];let h;t[15]!==p||t[16]!==m?(h=(0,$.jsxs)(`div`,{className:`mt-auto flex items-center gap-2 pt-8`,children:[f,p,m]}),t[15]=p,t[16]=m,t[17]=h):h=t[17];let g;return t[18]!==d||t[19]!==h?(g=(0,$.jsx)(`div`,{className:`scrollbar-gutter-both relative flex h-full min-h-0 w-full overflow-y-auto bg-background`,children:(0,$.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-1 flex-col px-8 py-12 sm:py-16`,children:[c,l,d,h]})}),t[18]=d,t[19]=h,t[20]=g):g=t[20],g}function Mt(e){let t=(0,Q.c)(36),{url:n,code:r,description:i,onReload:a,move:o}=e,[s,c]=(0,Z.useState)(!1),l;t[0]===n?l=t[1]:(l=Ft(n)??n,t[0]=n,t[1]=l);let u=l,d;t[2]===i?d=t[3]:(d=At(i),t[2]=i,t[3]=d);let f=d,p;t[4]!==r||t[5]!==i?(p=i.length>0?i:`ERR_${Math.abs(r)||`FAILED`}`,t[4]=r,t[5]=i,t[6]=p):p=t[6];let m=p,h,g;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsx)(Pt,{className:`mb-6 size-12 text-muted-foreground/70`}),g=(0,$.jsx)(`h1`,{className:`mb-3 text-2xl font-semibold leading-tight text-foreground`,children:`This site can’t be reached`}),t[7]=h,t[8]=g):(h=t[7],g=t[8]);let _;t[9]===u?_=t[10]:(_=(0,$.jsx)(`span`,{className:`font-semibold text-foreground`,children:u}),t[9]=u,t[10]=_);let v;t[11]!==f||t[12]!==_?(v=(0,$.jsxs)(`p`,{className:`text-sm leading-relaxed text-muted-foreground`,children:[_,`: `,f,`.`]}),t[11]=f,t[12]=_,t[13]=v):v=t[13];let y;t[14]!==o||t[15]!==s?(y=s?(0,$.jsxs)(`div`,{className:`mt-6 rounded-lg border border-border bg-muted/40 p-4 text-sm`,children:[(0,$.jsx)(`p`,{className:`mb-2 font-medium text-foreground`,children:`Try:`}),(0,$.jsxs)(`ul`,{className:`list-disc space-y-1 pl-5 text-muted-foreground`,children:[(0,$.jsx)(`li`,{children:`Checking your connection`}),(0,$.jsx)(`li`,{children:`Confirming the dev server is running`}),o?(0,$.jsx)(`li`,{children:`Opening it in the environment’s browser, which reaches its network`}):null,(0,$.jsx)(`li`,{children:`Checking the proxy and the firewall`})]})]}):null,t[14]=o,t[15]=s,t[16]=y):y=t[16];let b;t[17]===m?b=t[18]:(b=(0,$.jsx)(`div`,{className:`mt-8 text-xs uppercase tracking-wide text-muted-foreground/70`,children:m}),t[17]=m,t[18]=b);let x;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(x=()=>c(Nt),t[19]=x):x=t[19];let S=s?`Hide details`:`Details`,C;t[20]===S?C=t[21]:(C=(0,$.jsx)(w,{type:`button`,variant:`outline`,size:`sm`,onClick:x,children:S}),t[20]=S,t[21]=C);let T;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,$.jsx)(`div`,{className:`flex-1`}),t[22]=T):T=t[22];let E;t[23]===o?E=t[24]:(E=o?(0,$.jsx)(w,{type:`button`,variant:`outline`,size:`sm`,onClick:o.onMove,children:o.label}):null,t[23]=o,t[24]=E);let D;t[25]===a?D=t[26]:(D=(0,$.jsx)(w,{type:`button`,size:`sm`,onClick:a,children:`Reload`}),t[25]=a,t[26]=D);let O;t[27]!==C||t[28]!==E||t[29]!==D?(O=(0,$.jsxs)(`div`,{className:`mt-auto flex items-center gap-2 pt-8`,children:[C,T,E,D]}),t[27]=C,t[28]=E,t[29]=D,t[30]=O):O=t[30];let k;return t[31]!==O||t[32]!==v||t[33]!==y||t[34]!==b?(k=(0,$.jsx)(`div`,{className:`scrollbar-gutter-both relative flex h-full min-h-0 w-full overflow-y-auto bg-background`,children:(0,$.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-1 flex-col px-8 py-12 sm:py-16`,children:[h,g,v,y,b,O]})}),t[31]=O,t[32]=v,t[33]=y,t[34]=b,t[35]=k):k=t[35],k}function Nt(e){return!e}function Pt(e){let t=(0,Q.c)(5),{className:n}=e,r,i,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(`path`,{d:`M16 12 L48 12 L48 52 L16 52 Z`}),i=(0,$.jsx)(`path`,{d:`M22 22 L42 22 M22 30 L36 30 M22 38 L40 38`,strokeLinecap:`round`}),a=(0,$.jsx)(`path`,{d:`M52 8 L12 56`,strokeLinecap:`round`}),t[0]=r,t[1]=i,t[2]=a):(r=t[0],i=t[1],a=t[2]);let o;return t[3]===n?o=t[4]:(o=(0,$.jsxs)(`svg`,{viewBox:`0 0 64 64`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,className:n,children:[r,i,a]}),t[3]=n,t[4]=o),o}function Ft(e){try{return new URL(e).host}catch{return null}}var It=1500,Lt=.001;function Rt(e){let t=(0,Q.c)(11),{zoomFactor:n}=e,[r,i]=(0,Z.useState)(!1),a=(0,Z.useRef)(n),o=(0,Z.useRef)(null),s,c;t[0]===n?(s=t[1],c=t[2]):(s=()=>{if(!(Math.abs(a.current-n)<Lt))return a.current=n,i(!0),o.current!==null&&window.clearTimeout(o.current),o.current=window.setTimeout(()=>{i(!1),o.current=null},It),()=>{o.current!==null&&(window.clearTimeout(o.current),o.current=null)}},c=[n],t[0]=n,t[1]=s,t[2]=c),(0,Z.useEffect)(s,c);let l;t[3]===n?l=t[4]:(l=Math.round(n*100),t[3]=n,t[4]=l);let u=`${l}%`,d=!r,f=r?`opacity-100 translate-y-0`:`opacity-0 -translate-y-1`,p;t[5]===f?p=t[6]:(p=T(`pointer-events-none absolute top-3 right-3 z-20 select-none rounded-full border border-border/70 bg-popover/95 px-2.5 py-1 text-xs font-medium text-foreground shadow-md/10 backdrop-blur transition-all duration-200 ease-out`,f),t[5]=f,t[6]=p);let m;return t[7]!==u||t[8]!==d||t[9]!==p?(m=(0,$.jsx)(`div`,{"aria-hidden":d,className:p,children:u}),t[7]=u,t[8]=d,t[9]=p,t[10]=m):m=t[10],m}function zt(e,t){return e.find(e=>e.id===t)?.name??`Removed profile`}var Bt=typeof window>`u`?null:R();function Vt(e){let t=(0,Q.c)(12),n=rt(e.threadRef.environmentId),r;t[0]!==n||t[1]!==e.download.id||t[2]!==e.tabId||t[3]!==e.threadRef.threadId?(r=n?it({access:n,threadId:e.threadRef.threadId,tabId:e.tabId},e.download.id):null,t[0]=n,t[1]=e.download.id,t[2]=e.tabId,t[3]=e.threadRef.threadId,t[4]=r):r=t[4];let i;t[5]===e.url?i=t[6]:(i=()=>void Bt?.shell.openExternal(e.url).catch(Ht),t[5]=e.url,t[6]=i);let a;return t[7]!==e.download.fileName||t[8]!==e.url||t[9]!==r||t[10]!==i?(a=(0,$.jsx)(jt,{url:e.url,fileName:e.download.fileName,downloadUrl:r,onOpen:i}),t[7]=e.download.fileName,t[8]=e.url,t[9]=r,t[10]=i,t[11]=a):a=t[11],a}function Ht(){}function Ut({threadRef:e,tabId:t,configuredUrls:n,visible:r,onSendAnnotation:o}){let[s,c]=(0,Z.useState)(void 0),[u,m]=(0,Z.useState)(!1),h=de(e.environmentId,`orchestration:operate`)&&!!o,g=Ve(),_=(0,Z.useRef)(null),v=(0,Z.useRef)(!0),x=(0,Z.useRef)(e);x.current=e;let S=a(e),C=Se(e,50),w=me(t=>he(t.byThreadKey,e)),E=i(e=>e.addPreviewAnnotation),D=i(e=>e.addImage),O=le(e.environmentId),k=O?new URL(O).hostname:null,ee=B(Me.open),A=B(Me.close,`preview close`),te=ue(e.environmentId)?.label??`the environment`,ne=L(),re=oe(e.environmentId),ie=B(Me.resize,`preview viewport resize`),ae=B(Me.adjust,`preview appearance or zoom`);st(e),(0,Z.useEffect)(()=>(v.current=!0,()=>{v.current=!1}),[]);let j=t??S.activeTabId,R=j?qe(e,S.serverEpoch,j):null,U=j&&R?g.has(R)?R:ze(e,j):null,W=j?S.sessions[j]??null:null,fe=xe(e.environmentId,W),G=W?.runtime===`server`&&!fe,K=W?.runtime===`server`,q=(0,Z.useRef)(null),[pe,_e]=(0,Z.useState)(!1),ve=(0,Z.useRef)(null),[ke,je]=(0,Z.useState)(0),Fe=W?.runtime===`server`&&(W.viewport??p)._tag!==`fill`;(0,Z.useEffect)(()=>{let e=ve.current;if(e&&Fe)return ye(e,([e])=>je(Math.max(1,Math.round(e?.contentRect.width??0))))},[Fe]);let[Ie,Le]=(0,Z.useState)(null),Re=G&&Ie!==R,[Be,Ge]=(0,Z.useState)(null),Y=j?S.desktopByTabId[j]??null:null,X=W?.navStatus??{_tag:`Idle`},Ye=X._tag===`Idle`?``:X.url,Xe=Y?.loading??X._tag===`Loading`,et=Y?.canGoBack??W?.canGoBack??!1,rt=Y?.canGoForward??W?.canGoForward??!1,it=X._tag===`Idle`,ut=X._tag===`LoadFailed`,Q=ct(W),ft=G&&!Q&&!ut&&Be!==R,mt=Y?.controller??`none`,gt=W?.viewport??p,_t=we(),vt=W?.profileId??`default`,yt=zt(_t.profiles,vt),bt=$e(e=>R?e.byTabId[R]?.rect??null:null),xt=X._tag===`Success`?X.url:null,St=X._tag===`Success`?X.title:null,wt=C[0]?.url,Tt=d(e);(0,Z.useEffect)(()=>{xt&&St&&wt&&Te(x.current,xt,St,k)},[k,wt,St,xt,Tt]);let Et=(0,Z.useCallback)(async t=>{if(G&&q.current)return!Re&&(q.current.navigate(t),y(e,t),!0);if(R&&J)return await J.navigate(R,t),y(e,t),!0;let n=await Ke({openPreview:ee,threadRef:e,url:t});if(n._tag===`Failure`&&!M(n)){let e=N(n);e instanceof be&&I.add({type:`error`,title:`Unable to open browser`,description:e.message})}return n._tag===`Success`},[G,ee,R,Re,e]),Ot=(0,Z.useCallback)(async t=>{try{let n=Pe(t);await Et(n)&&Ee(e,n)}catch{}},[Et,e]),kt=(0,Z.useCallback)(async t=>{try{let n=G||!J?Ne(t):De(e.environmentId,t);await Et(n)&&Ee(e,t)}catch{}},[G,Et,e]),At=(0,Z.useCallback)(()=>{G?q.current?.reload():J&&R&&J.refresh(R)},[G,R]),jt=(0,Z.useCallback)(async t=>{if(!j)return;let n=await ae({environmentId:e.environmentId,input:{threadId:e.threadId,tabId:j,...t}});if(n._tag===`Failure`){let e=N(n);I.add({type:`error`,title:`Unable to change the browser tab`,description:e instanceof Error?e.message:`An error occurred.`});return}l(e,n.value)},[ae,j,e]),Nt=W?.zoomFactor??1,Pt=(0,Z.useCallback)(e=>{let t=b.indexOf(Nt),n=e===0?1:b[Math.min(Math.max((t<0?7:t)+e,0),b.length-1)];n!==Nt&&jt({zoomFactor:n})},[jt,Nt]),Ft=(0,Z.useCallback)(()=>{K?Pt(1):J&&R&&J.zoomIn(R)},[R,K,Pt]),It=(0,Z.useCallback)(()=>{K?Pt(-1):J&&R&&J.zoomOut(R)},[R,K,Pt]),Lt=(0,Z.useCallback)(()=>{K?Pt(0):J&&R&&J.resetZoom(R)},[R,K,Pt]),Ht=(0,Z.useCallback)(async t=>{if(!j)return;let n=await ie({environmentId:e.environmentId,input:{threadId:e.threadId,tabId:j,viewport:t}});if(n._tag===`Failure`){let e=N(n);throw I.add({type:`error`,title:`Unable to resize browser viewport`,description:e instanceof Error?e.message:`An error occurred.`}),e}l(e,n.value)},[ie,j,e]),Ut=()=>{if(R){if(gt._tag!==`fill`){Je(R,p).catch(()=>void 0);return}Je(R,Ae({defaults:_t,panelRect:bt,zoomFactor:K?Nt:Y?.zoomFactor})).catch(()=>void 0)}};(0,Z.useEffect)(()=>{if(R)return Qe(R,Ht)},[Ht,R]);let Wt=(0,Z.useCallback)(()=>{G?q.current?.history(-1):J&&R&&J.goBack(R)},[G,R]),Gt=(0,Z.useCallback)(()=>{G?q.current?.history(1):J&&R&&J.goForward(R)},[G,R]),Kt=(0,Z.useCallback)(()=>{Bt&&Ye&&Bt.shell.openExternal(Ye).catch(()=>void 0)},[Ye]),qt=Ce(e.environmentId,ne,re,W),Jt=qt===`server`?`Open in ${te}'s browser`:`Open on this computer`,Yt=(0,Z.useCallback)(async()=>{if(!qt||!j||!W)return;let t=await Ke({openPreview:ee,threadRef:e,...Ye?{url:qt===`desktop`?De(e.environmentId,Ye):Ye}:{},viewport:gt,...W.profileId===void 0?{}:{profileId:W.profileId},runtime:qt});if(t._tag===`Failure`){if(M(t))return;let e=N(t);I.add({type:`error`,title:`Unable to move the browser tab`,description:e instanceof Error?e.message:`An error occurred.`});return}V.getState().openBrowser(e,t.value.tabId),await ot({closePreview:A,snapshot:W,tabId:j,threadRef:e})},[A,qt,ee,W,j,e,Ye,gt]),Xt=(0,Z.useCallback)(()=>{if(j){if(w===j){me.getState().close(e);return}me.getState().open(e,ge(j)),V.getState().close(e)}},[w,j,e]),Zt=e=>()=>{e&&R&&e(R).catch(()=>void 0)},Qt=K?{hardReload:()=>void jt({hardReload:!0}),setColorScheme:e=>void jt({colorScheme:e}),zoomIn:Ft,zoomOut:It,resetZoom:Lt,clearCookies:()=>void jt({clear:`cookies`}),clearCache:()=>void jt({clear:`cache`}),...fe&&J?{openDevTools:Zt(J.openDevTools),toggleNativePictureInPicture:()=>$t()}:{}}:J?{hardReload:Zt(J.hardReload),setColorScheme:e=>{R&&J?.setColorScheme(R,e).catch(()=>void 0)},zoomIn:Ft,zoomOut:It,resetZoom:Lt,clearCookies:()=>void J?.clearCookies(e.environmentId,vt).catch(()=>void 0),clearCache:()=>void J?.clearCache(e.environmentId,vt).catch(()=>void 0),openDevTools:Zt(J.openDevTools),toggleNativePictureInPicture:()=>$t()}:null,$t=(0,Z.useCallback)(()=>{J&&R&&(Y?.pictureInPicture?J.pictureInPicture.close:J.pictureInPicture.open)(R).catch(e=>{I.add({type:`error`,title:`Unable to update popped-out preview`,description:e instanceof Error?e.message:`An error occurred.`})})},[Y?.pictureInPicture,R]),en=(0,Z.useCallback)(t=>{if(!J||!R||!j)return;let n=J;if(U){We(U).then(e=>{if(!e)return;let t=!1,r,i=()=>{if(!navigator.clipboard?.writeText){I.update(r,H({type:`error`,title:`Unable to copy recording path`,description:`Clipboard API unavailable.`,actionProps:a}));return}navigator.clipboard.writeText(e.path).then(()=>{t=!0,o(),window.setTimeout(()=>{t=!1,o()},2e3)},e=>{I.update(r,H({type:`error`,title:`Unable to copy recording path`,description:e instanceof Error?e.message:`An error occurred.`,actionProps:a}))})},a={children:ce(navigator.platform),onClick:()=>void n.revealArtifact(e.path)},o=()=>{I.update(r,H({type:`success`,title:`Recording saved`,actionProps:a,data:{secondaryActionProps:{children:t?`Copied!`:`Copy path`,disabled:t,onClick:i},secondaryActionVariant:`outline`}}))};r=I.add(H({type:`success`,title:`Recording saved`,actionProps:a,data:{secondaryActionProps:{children:`Copy path`,onClick:i},secondaryActionVariant:`outline`}}))},e=>{I.add({type:`error`,title:`Unable to stop recording`,description:e instanceof Error?e.message:`An error occurred.`})});return}if(t){He(R,e,j).catch(e=>{let t=e instanceof Error?e.message:`An error occurred.`;Ue(e)||I.add({type:`error`,title:`Unable to start recording`,description:t})});return}n.captureScreenshot(R).then(e=>{let t={children:ce(navigator.platform),onClick:()=>void n.revealArtifact(e.path)},r=!1,i=!1,a,o=(e=`success`,n=`Screenshot saved`,o)=>{I.update(a,H({type:e,title:n,description:o,actionProps:{children:i?`Copied!`:`Copy image`,disabled:i,onClick:c},data:{additionalActions:[{id:`copy-path`,props:{children:r?`Copied!`:`Copy path`,disabled:r,onClick:s}}],secondaryActionProps:{...t},secondaryActionVariant:`outline`}}))},s=()=>{if(!navigator.clipboard?.writeText){o(`error`,`Unable to copy screenshot path`,`Clipboard API unavailable.`);return}navigator.clipboard.writeText(e.path).then(()=>{r=!0,o(),window.setTimeout(()=>{r=!1,o()},2e3)},e=>{o(`error`,`Unable to copy screenshot path`,e instanceof Error?e.message:`An error occurred.`)})},c=()=>{n.copyArtifactToClipboard(e.path).then(()=>{i=!0,o(),window.setTimeout(()=>{i=!1,o()},2e3)},e=>{o(`error`,`Unable to copy screenshot`,e instanceof Error?e.message:`An error occurred.`)})};a=I.add(H({type:`success`,title:`Screenshot saved`,actionProps:{children:`Copy image`,onClick:c},data:{additionalActions:[{id:`copy-path`,props:{children:`Copy path`,onClick:s}}],secondaryActionProps:{...t},secondaryActionVariant:`outline`}}))},e=>{I.add({type:`error`,title:`Unable to capture screenshot`,description:e instanceof Error?e.message:`An error occurred.`})})},[U,R,j,e]),tn=(0,Z.useCallback)(()=>{if(!J||!R)return;if(_.current){_.current.cancelled=!0,J.cancelPickElement(R).catch(()=>void 0);return}let t=typeof document<`u`?document.activeElement:null,n={cancelled:!1},r=!1;_.current=n,m(!0),(async()=>{try{if(await J.setAnnotationSendEnabled?.(R,!!o&&z(e.environmentId,`orchestration:operate`)),n.cancelled)return;let t=await J.pickElement(R);if(!t||n.cancelled)return;_.current===n&&(_.current=null,v.current&&m(!1),r=!0);let{annotation:i,submission:a,screenshotFailed:s=!1}=t,c=pt(i),l=s||c.status===`failed`,u=c.status===`failed`?{...i,screenshot:null}:i;E(e,u),l&&I.add(H({type:`error`,title:`Could not capture the picked element`,description:`The annotation was kept without the screenshot.`}));let d=c.status===`captured`?c.file:null,f=d&&u.screenshot?{type:`image`,id:u.id,name:d.name,mimeType:d.type,sizeBytes:d.size,previewUrl:u.screenshot.dataUrl,file:d}:null;f&&D(e,f),a===`send`&&z(e.environmentId,`orchestration:operate`)&&o?.(u,f)}catch{}finally{let e=_.current===n;if(e&&(_.current=null,v.current&&m(!1)),(e||r)&&t&&t.isConnected&&typeof t.focus==`function`)try{t.focus({preventScroll:!0})}catch{}}})()},[D,E,o,R,e]);return(0,Z.useEffect)(()=>{u&&J&&R&&J.setAnnotationSendEnabled?.(R,h).catch(()=>void 0)},[h,u,R]),(0,Z.useEffect)(()=>()=>{_.current&&(_.current.cancelled=!0,_.current=null,J&&R&&J.cancelPickElement(R).catch(()=>void 0),v.current&&m(!1))},[R]),(0,Z.useEffect)(()=>{if(r)return dt(e=>{switch(e){case`refresh`:At();return;case`focus-url`:c(e=>(e??0)+1);return;case`zoom-in`:Ft();return;case`zoom-out`:It();return;case`reset-zoom`:Lt();return;case`toggle-panel`:return}})},[At,Lt,Ft,It,r]),(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col bg-background`,"data-thread-key":d(e),children:[(0,$.jsx)(ht,{url:Ye,loading:Xe||ft,canGoBack:et&&!Re,canGoForward:rt&&!Re,refreshDisabled:it||Re,inputDisabled:Re,focusUrlNonce:s,onBack:Wt,onForward:Gt,onRefresh:At,onSubmit:e=>void Ot(e),onOpenInBrowser:j?Kt:void 0,onCapture:J&&j&&!G?en:void 0,captureDisabled:!Y||ut,recording:U!==null,onPictureInPicture:j&&(G||J)?Xt:void 0,pictureInPicture:w===j,pictureInPictureDisabled:ut||!G&&!Y?.hasWebContents,onPickElement:J&&j&&!G?tn:void 0,pickActive:u,pickDisabled:!j||ut,pickDisabledReason:ut?`Page didn't load — pick unavailable until the page renders`:void 0,leadingActions:vt===_t.profileId?null:(0,$.jsxs)(F,{children:[(0,$.jsx)(se,{render:(0,$.jsx)(f,{variant:`outline`,className:`max-w-28 shrink-0`}),children:(0,$.jsx)(`span`,{className:`truncate`,children:yt})}),(0,$.jsx)(P,{side:`top`,children:yt})]}),trailingActions:Qt?(0,$.jsx)(Dt,{enabled:R!==null&&(K||(Y?.hasWebContents??!1)),actions:Qt,...qt?{move:{label:Jt,onMove:()=>void Yt()}}:{},profileName:yt,zoomFactor:K?Nt:Y?.zoomFactor??1,colorScheme:K?W?.colorScheme??`system`:Y?.colorScheme??`system`,deviceToolbarVisible:gt._tag!==`fill`,onToggleDeviceToolbar:Ut,nativePictureInPicture:Y?.pictureInPicture??!1}):null}),(0,$.jsxs)(`div`,{ref:ve,className:`relative min-h-0 flex-1 overflow-hidden`,children:[R&&W&&G?(0,$.jsxs)($.Fragment,{children:[gt._tag!==`fill`&&!Q&&!ut?(0,$.jsx)(`div`,{className:`absolute inset-x-0 top-0 z-10`,children:(0,$.jsx)(Ze,{setting:gt,width:ke,aspectRatio:pe?gt.width/gt.height:null,onAspectRatioChange:e=>_e(e!==null),onChange:e=>Je(R,e)})}):null,(0,$.jsx)(`div`,{className:`absolute inset-x-0 bottom-0`,style:{top:gt._tag===`fill`?0:38},children:(0,$.jsx)(lt,{ref:q,environmentId:e.environmentId,threadId:e.threadId,tabId:W.tabId,visible:r,onFirstFrame:()=>Ge(R),onControl:e=>Le(e?.controller===`you`?R:null),onPopup:t=>nt(e,t,`panel`),className:T(`absolute inset-0 h-full w-full`,(Q||ut)&&`invisible`)},R)})]}):R&&W&&!Q?J?(0,$.jsx)(tt,{tabId:R,visible:r&&!ut,className:`absolute inset-0 h-full w-full`},R):(0,$.jsx)(`div`,{className:`flex h-full items-center justify-center p-8 text-center`,children:(0,$.jsx)(`p`,{className:`max-w-sm text-sm text-muted-foreground`,children:`This tab is open in the P4 Code desktop app.`})}):null,Q?(0,$.jsx)(Ct,{threadRef:e,environmentId:e.environmentId,configuredUrls:n,recentEntries:C,onRemoveRecent:t=>Oe(e,t),onOpenUrl:e=>void kt(e)}):null,W&&Y?(0,$.jsx)(Rt,{zoomFactor:Y.zoomFactor}):null,R&&Y&&!Q&&!ut&&!g.has(R)?(0,$.jsx)(at,{tabId:R,zoomFactor:Y.zoomFactor,controller:mt}):null,X._tag===`LoadFailed`&&X.download?(0,$.jsx)(`div`,{className:`absolute inset-0 z-10 bg-background`,children:(0,$.jsx)(Vt,{threadRef:e,tabId:W?.tabId??``,url:X.url,download:X.download})}):X._tag===`LoadFailed`?(0,$.jsx)(`div`,{className:`absolute inset-0 z-10 bg-background`,children:(0,$.jsx)(Mt,{url:X.url,code:X.code,description:X.description,onReload:At,...qt===`server`?{move:{label:Jt,onMove:()=>void Yt()}}:{}})}):null]})]})}function Wt(e){let t=(0,Q.c)(18),{mode:n,threadRef:r,tabId:i,configuredUrls:a,visible:o,onSendAnnotation:s}=e,l=je(r.environmentId),u=de(r.environmentId,c);if(!u||!l){let e=u?`Preview is only available in the P4 Code desktop app.`:`Pair this client again with preview access to control browser previews.`,r;t[0]===e?r=t[1]:(r=(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col items-center justify-center gap-3 p-8 text-center`,children:(0,$.jsx)(`p`,{className:`max-w-sm text-sm text-muted-foreground`,children:e})}),t[0]=e,t[1]=r);let i;return t[2]!==n||t[3]!==r?(i=(0,$.jsx)(U,{mode:n,children:r}),t[2]=n,t[3]=r,t[4]=i):i=t[4],i}let d;t[5]===i?d=t[6]:(d=i===void 0?{}:{tabId:i},t[5]=i,t[6]=d);let f;t[7]===s?f=t[8]:(f=s?{onSendAnnotation:s}:{},t[7]=s,t[8]=f);let p;t[9]!==a||t[10]!==d||t[11]!==f||t[12]!==r||t[13]!==o?(p=(0,$.jsx)(Ut,{threadRef:r,...d,configuredUrls:a,visible:o,...f}),t[9]=a,t[10]=d,t[11]=f,t[12]=r,t[13]=o,t[14]=p):p=t[14];let m;return t[15]!==n||t[16]!==p?(m=(0,$.jsx)(U,{mode:n,children:p}),t[15]=n,t[16]=p,t[17]=m):m=t[17],m}export{Wt as PreviewPanel};
2
- //# sourceMappingURL=PreviewPanel-QkMfuC1J.js.map
@@ -1,2 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{Ax as t,Ht as ee,Jt as te,Kt as n,Nt as ne,Ss as re,Vt as ie,ha as r,jl as i,nn as ae}from"./utils-DmfMX1v5.js";import{a,c as o,o as s,s as c,t as l}from"./select-B4VvMEs2.js";import{t as oe}from"./useNavigate-4thj06GJ.js";import{i as se}from"./toast-CjelgyqV.js";import{E as ce,i as le}from"./useSettings-CLtJrOYI.js";import{t as ue}from"./server-BD_Y5Gsn.js";import{t as u}from"./pullRequestDetail.logic-DTxWqKoX.js";import{i as de}from"./p4ProjectFile-BWszgcDk.js";import{B as fe,F as d,L as pe,N as me,P as he,S as ge,a as f,n as _e,p as ve,r as p,s as ye}from"./settingsLayout-jP1a50ek.js";import{La as be,ir as m}from"./main-BB3F4O6Y.js";import{t as xe}from"./ProviderModelPicker-Bfpy_Rw1.js";import{n as Se,t as Ce}from"./runtimeModeConfig-DKj6PlUP.js";var we=t(),h=e(r(),1),Te=[`recursive`,`top-level`,`none`];function Ee(e){return e!==null&&Te.includes(e)}function De(e){let t=(0,we.c)(95),{category:r}=e,{scope:De,target:g,targets:Me,connectedEnvironments:Ne}=fe(),_=he(),v=pe(),Pe=oe(),{environments:y}=ce(),b,x,S,C,w;if(t[0]!==y||t[1]!==_||t[2]!==g){S=g?y.find(e=>e.environmentId===g.environmentId):void 0;let e=S?.serverConfig?.providers??ue;C=n(e,_.defaultModelSelection),b=te(ie(ee(e),_,g?.projectId??null)),x=ne(_,e,C?.instanceId,C?.model),w=b.find(e=>e.instanceId===C?.instanceId),t[0]=y,t[1]=_,t[2]=g,t[3]=b,t[4]=x,t[5]=S,t[6]=C,t[7]=w}else b=t[3],x=t[4],S=t[5],C=t[6],w=t[7];let T=w,E;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(E=[`defaultModelSelection`],t[8]=E):E=t[8];let D=d(E),O;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(O=[`defaultRuntimeMode`],t[9]=O):O=t[9];let k=d(O),Fe=Ce[_.defaultRuntimeMode].icon,A;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(A=[`defaultThreadEnvMode`],t[10]=A):A=t[10];let j=d(A),M;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(M=[`worktreeSubmodules`],t[11]=M):M=t[11];let N=d(M),P;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(P=[`enableAgentBrowserAccess`],t[12]=P):P=t[12];let F=d(P),I;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(I=[`defaultAutoPull`],t[13]=I):I=t[13];let L=d(I),R;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(R=[`removeAgentCreditsOnMerge`],t[14]=R):R=t[14];let z=d(R),B;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(B=[`pullRequestMergeMethod`],t[15]=B):B=t[15];let Ie=d(B),V;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(V=[`defaultModelSelection`],t[16]=V):V=t[16];let Le=me(V),H=De.kind===`project`||De.kind===`checkout`,U=Ne.length===0,Re;t[17]===g?Re=t[18]:(Re=g?de(g.settings,null,null,null).settings:null,t[17]=g,t[18]=Re);let ze=Re,Be;t[19]!==b||t[20]!==y||t[21]!==_||t[22]!==Me?(Be=function(e,t){let te=b.find(t=>t.instanceId===e);for(let n of Me){let re=y.find(e=>e.environmentId===n.environmentId),r=re?.serverConfig;if(!r)continue;let i=ie(ee(r.providers),n.settings,n.projectId).find(t=>t.instanceId===e),ae=ne(le(n.settings,_),r.providers).get(e);if(!i?.enabled||!i.isAvailable||i.driverKind!==te?.driverKind||!ae?.some(e=>e.slug===t&&!e.isUnavailable))return`This model is unavailable on ${re?.label??`a selected environment`}. Select that environment to choose its model separately.`}return null},t[19]=b,t[20]=y,t[21]=_,t[22]=Me,t[23]=Be):Be=t[23];let W=Be,Ve;t[24]!==W||t[25]!==v?(Ve=e=>{let t=e?W(e.instanceId,e.model):null;if(t){se.add({type:`error`,title:`Default model not saved`,description:t});return}v({defaultModelSelection:e})},t[24]=W,t[25]=v,t[26]=Ve):Ve=t[26];let G=Ve,He;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(He=[`defaultModelSelection`],t[27]=He):He=t[27];let Ue=H?`Model for new threads in this project.`:`Default model for new threads. Projects can override it.`,We=U||D||Le===`project`?void 0:_.defaultModelSelection===null?`Automatic`:void 0,K;t[28]!==G||t[29]!==_.defaultModelSelection?(K=_.defaultModelSelection===null?null:(0,h.jsx)(p,{label:`default model`,onClick:()=>G(null)}),t[28]=G,t[29]=_.defaultModelSelection,t[30]=K):K=t[30];let q;t[31]!==T||t[32]!==b||t[33]!==D||t[34]!==W||t[35]!==x||t[36]!==Pe||t[37]!==S||t[38]!==C||t[39]!==G||t[40]!==_.planModeEnabled?(q=C&&T?(0,h.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center justify-end gap-1.5`,children:[(0,h.jsx)(xe,{environmentId:S?.environmentId??null,activeInstanceId:C.instanceId,model:C.model,lockedProvider:null,instanceEntries:b,modelOptionsByInstance:x,triggerClassName:_e,...D?{triggerLabel:`Mixed`}:{},getModelDisabledReason:W,onOpenProviderSetup:e=>{S&&Pe({to:`/settings/providers`,search:{environmentId:S.environmentId,instanceId:e}})},onInstanceModelChange:(e,t)=>G(re(e,t))}),D?null:(0,h.jsx)(ae,{provider:T.driverKind,models:T.models,model:C.model,prompt:``,onPromptChange:je,modelOptions:C.options??[],allowPromptInjectedEffort:!1,planModeEnabled:_.planModeEnabled,triggerClassName:_e,onModelOptionsChange:e=>G(re(C.instanceId,C.model,e))})]}):(0,h.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`No providers available`}),t[31]=T,t[32]=b,t[33]=D,t[34]=W,t[35]=x,t[36]=Pe,t[37]=S,t[38]=C,t[39]=G,t[40]=_.planModeEnabled,t[41]=q):q=t[41];let Ge;t[42]!==D||t[43]!==Ue||t[44]!==We||t[45]!==K||t[46]!==q?(Ge=(0,h.jsx)(f,{serverScoped:!0,settingKeys:He,mixed:D,id:`default-model`,title:`Model`,description:Ue,status:We,resetAction:K,control:q}),t[42]=D,t[43]=Ue,t[44]=We,t[45]=K,t[46]=q,t[47]=Ge):Ge=t[47];let Ke=Ge,qe;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(qe=[`defaultThreadEnvMode`],t[48]=qe):qe=t[48];let Je;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(Je=m(`new-threads`),t[49]=Je):Je=t[49];let Ye=H?`Where new threads in this project start.`:`Where new threads start. Projects and their p4.json can override it.`,J;t[50]!==H||t[51]!==_.defaultThreadEnvMode||t[52]!==v?(J=!H&&_.defaultThreadEnvMode!==null?(0,h.jsx)(p,{label:`default workspace`,onClick:()=>v({defaultThreadEnvMode:null})}):null,t[50]=H,t[51]=_.defaultThreadEnvMode,t[52]=v,t[53]=J):J=t[53];let Xe=j?null:ze?.defaultThreadEnvMode??null,Y;t[54]===v?Y=t[55]:(Y=e=>{(e===`auto`||e===`local`||e===`worktree`)&&v({defaultThreadEnvMode:e})},t[54]=v,t[55]=Y);let X;t[56]===U?X=t[57]:(X=(0,h.jsx)(c,{size:`sm`,"aria-label":`Default workspace`,children:(0,h.jsx)(o,{children:e=>e===`auto`||e===`local`||e===`worktree`?ge(e):U?`Unavailable`:`Mixed`})}),t[56]=U,t[57]=X);let Ze;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(Ze=(0,h.jsx)(a,{value:`auto`,children:ge(`auto`)}),t[58]=Ze):Ze=t[58];let Qe;t[59]===Symbol.for(`react.memo_cache_sentinel`)?(Qe=(0,h.jsx)(a,{value:`local`,children:ge(`local`)}),t[59]=Qe):Qe=t[59];let $e;t[60]===Symbol.for(`react.memo_cache_sentinel`)?($e=(0,h.jsxs)(s,{align:`end`,alignItemWithTrigger:!1,children:[Ze,Qe,(0,h.jsx)(a,{value:`worktree`,children:ge(`worktree`)})]}),t[60]=$e):$e=t[60];let Z;t[61]!==Xe||t[62]!==Y||t[63]!==X?(Z=(0,h.jsxs)(l,{value:Xe,onValueChange:Y,children:[X,$e]}),t[61]=Xe,t[62]=Y,t[63]=X,t[64]=Z):Z=t[64];let et;t[65]!==j||t[66]!==Ye||t[67]!==J||t[68]!==Z?(et=(0,h.jsx)(f,{serverScoped:!0,settingKeys:qe,mixed:j,id:Je.id,title:`Workspace`,description:Ye,resetAction:J,control:Z}),t[65]=j,t[66]=Ye,t[67]=J,t[68]=Z,t[69]=et):et=t[69];let tt=et,nt=r===`general`||r===`project`?`project-defaults`:r===`integrations`?`browser-access`:`source-control-defaults`,rt=r===`general`||r===`project`?`New threads`:r===`integrations`?`Browser`:`Repositories`,Q;t[70]!==Fe||t[71]!==r||t[72]!==ze?.worktreeSubmodules||t[73]!==H||t[74]!==z||t[75]!==L||t[76]!==F||t[77]!==Ie||t[78]!==k||t[79]!==N||t[80]!==Ke||t[81]!==_.defaultAutoPull||t[82]!==_.defaultRuntimeMode||t[83]!==_.enableAgentBrowserAccess||t[84]!==_.pullRequestMergeMethod||t[85]!==_.removeAgentCreditsOnMerge||t[86]!==_.worktreeSubmodules||t[87]!==U||t[88]!==v||t[89]!==tt?(Q=r===`project`?(0,h.jsxs)(h.Fragment,{children:[Ke,tt]}):r===`general`?(0,h.jsxs)(h.Fragment,{children:[Ke,(0,h.jsx)(f,{serverScoped:!0,settingKeys:[`defaultRuntimeMode`],mixed:k,...m(`default-permissions`),description:H?`Permissions for new threads in this project.`:`Default permissions for new threads. Projects can override them.`,resetAction:_.defaultRuntimeMode===i.defaultRuntimeMode?null:(0,h.jsx)(p,{label:`default permissions`,onClick:()=>v({defaultRuntimeMode:i.defaultRuntimeMode})}),control:(0,h.jsxs)(l,{value:k?null:_.defaultRuntimeMode,onValueChange:e=>{e&&v({defaultRuntimeMode:e})},children:[(0,h.jsxs)(c,{size:`sm`,"aria-label":`Default permissions`,children:[!k&&(0,h.jsx)(Fe,{className:`size-3.5 shrink-0 text-muted-foreground`}),(0,h.jsx)(o,{children:k?`Mixed`:Ce[_.defaultRuntimeMode].label})]}),(0,h.jsx)(s,{align:`end`,alignItemWithTrigger:!1,children:Se.map(Ae)})]})}),tt,(0,h.jsx)(f,{serverScoped:!0,settingKeys:[`worktreeSubmodules`],mixed:N,...m(`worktree-submodules`),description:H?`How new worktrees in this project populate git submodules.`:`How new worktrees populate git submodules. Projects and their p4.json can override it.`,resetAction:!H&&_.worktreeSubmodules!==null?(0,h.jsx)(p,{label:`worktree submodules`,onClick:()=>v({worktreeSubmodules:null})}):null,control:(0,h.jsxs)(l,{value:N?null:ze?.worktreeSubmodules??null,onValueChange:e=>{Ee(e)&&v({worktreeSubmodules:e})},children:[(0,h.jsx)(c,{size:`sm`,"aria-label":`Worktree submodules`,children:(0,h.jsx)(o,{children:e=>Ee(e)?ve[e]:U?`Unavailable`:`Mixed`})}),(0,h.jsx)(s,{align:`end`,alignItemWithTrigger:!1,children:Te.map(ke)})]})})]}):r===`source-control`?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(f,{serverScoped:!0,settingKeys:[`defaultAutoPull`],mixed:L,id:`automatic-pull`,title:`Automatically pull`,description:H?`Keeps this project's default branch current when the checkout has no local changes or commits.`:`Keeps the default branch current when the checkout has no local changes or commits. Projects can override it.`,resetAction:_.defaultAutoPull?(0,h.jsx)(p,{label:`default automatic pull`,tooltip:`Reset automatic pull to off`,onClick:()=>v({defaultAutoPull:!1})}):null,control:(0,h.jsx)(be,{"aria-label":`Default automatic pull`,mixed:L,checked:!L&&_.defaultAutoPull,onCheckedChange:e=>v({defaultAutoPull:e})})}),(0,h.jsx)(f,{serverScoped:!0,settingKeys:[`removeAgentCreditsOnMerge`],mixed:z,...m(`remove-agent-credits-on-merge`),description:`Remove recognized agent credit lines from GitHub merge and squash messages, keeping human co-authors. Includes auto-merge. Excludes merge queues, stack merges, and existing commits.`,resetAction:_.removeAgentCreditsOnMerge?(0,h.jsx)(p,{label:`agent credit removal`,tooltip:`Keep agent credits`,onClick:()=>v({removeAgentCreditsOnMerge:!1})}):null,control:(0,h.jsx)(be,{"aria-label":`Remove agent credits when merging`,mixed:z,checked:!z&&_.removeAgentCreditsOnMerge,onCheckedChange:e=>v({removeAgentCreditsOnMerge:e})})}),(0,h.jsx)(f,{serverScoped:!0,settingKeys:[`pullRequestMergeMethod`],mixed:Ie,...m(`pull-request-merge-method`),description:H?`Pull requests in this project start with this method.`:`Pull requests start with this method. Last selected reuses whatever you chose most recently on this device.`,resetAction:_.pullRequestMergeMethod===null?null:(0,h.jsx)(p,{label:`default merge method`,tooltip:`Reset to last selected`,onClick:()=>v({pullRequestMergeMethod:null})}),control:(0,h.jsxs)(l,{value:Ie?null:_.pullRequestMergeMethod??`last`,onValueChange:e=>{e===`last`?v({pullRequestMergeMethod:null}):(e===`merge`||e===`squash`||e===`rebase`)&&v({pullRequestMergeMethod:e})},children:[(0,h.jsx)(c,{size:`sm`,"aria-label":`Default pull request merge method`,children:(0,h.jsx)(o,{children:Oe})}),(0,h.jsxs)(s,{align:`end`,alignItemWithTrigger:!1,children:[(0,h.jsx)(a,{value:`last`,children:`Last selected`}),(0,h.jsx)(a,{value:`merge`,children:u.merge}),(0,h.jsx)(a,{value:`squash`,children:u.squash}),(0,h.jsx)(a,{value:`rebase`,children:u.rebase})]})]})})]}):(0,h.jsx)(h.Fragment,{children:(0,h.jsx)(f,{serverScoped:!0,settingKeys:[`enableAgentBrowserAccess`],mixed:F,id:m(`agent-browser-access`).id,title:`Agent browser access`,description:H?`Allow agents in this project to use the shared browser. Applies when the agent session next starts.`:`Allow agents to use the shared browser. Projects can override it.`,resetAction:_.enableAgentBrowserAccess===i.enableAgentBrowserAccess?null:(0,h.jsx)(p,{label:`default browser access`,onClick:()=>v({enableAgentBrowserAccess:i.enableAgentBrowserAccess})}),control:(0,h.jsx)(be,{"aria-label":`Agent browser access`,mixed:F,checked:!F&&_.enableAgentBrowserAccess,onCheckedChange:e=>v({enableAgentBrowserAccess:e})})})}),t[70]=Fe,t[71]=r,t[72]=ze?.worktreeSubmodules,t[73]=H,t[74]=z,t[75]=L,t[76]=F,t[77]=Ie,t[78]=k,t[79]=N,t[80]=Ke,t[81]=_.defaultAutoPull,t[82]=_.defaultRuntimeMode,t[83]=_.enableAgentBrowserAccess,t[84]=_.pullRequestMergeMethod,t[85]=_.removeAgentCreditsOnMerge,t[86]=_.worktreeSubmodules,t[87]=U,t[88]=v,t[89]=tt,t[90]=Q):Q=t[90];let $;return t[91]!==nt||t[92]!==rt||t[93]!==Q?($=(0,h.jsx)(ye,{id:nt,title:rt,children:Q}),t[91]=nt,t[92]=rt,t[93]=Q,t[94]=$):$=t[94],$}function Oe(e){return e===`merge`||e===`squash`||e===`rebase`?u[e]:e===`last`?`Last selected`:`Mixed`}function ke(e){return(0,h.jsx)(a,{value:e,children:ve[e]},e)}function Ae(e){let t=Ce[e],ee=t.icon;return(0,h.jsx)(a,{value:e,className:`min-w-64`,children:(0,h.jsxs)(`div`,{className:`grid gap-0.5`,children:[(0,h.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 font-medium`,children:[(0,h.jsx)(ee,{className:`size-3.5 shrink-0 text-muted-foreground`}),t.label]}),(0,h.jsx)(`span`,{className:`text-xs leading-4 text-muted-foreground`,children:t.description})]})},e)}function je(){}export{De as t};
2
- //# sourceMappingURL=ProjectDefaultsSettings-C6wxaRmJ.js.map
@@ -1,2 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Ax as n,Th as r,gd as i,ha as a,sr as o,t as s}from"./utils-DmfMX1v5.js";import{n as ee,t as c}from"./toggle-group-DCQTLIPb.js";import{t as l}from"./input-Cd_0h7h_.js";import{t as te}from"./scroll-area-LhpLVf8r.js";import{a as ne,c as re,i as u,o as ie,r as ae,s as oe,t as se}from"./dialog-Bn1u_Xoc.js";import{n as d,r as ce,t as le}from"./ProjectMonogram-Bqe3OyZR.js";import{DynamicIcon as ue,t as f}from"./dynamic-p5s8CQGu.js";var p=n();function m(e){return e.normalize(`NFKC`).trim()}function h(e){let t=m(e).match(/[\p{L}\p{N}]+/gu)??[],n=t[0];if(!n)return`PR`;let r=Array.from(n),i=r[0]??`P`,a=r.slice(1).find(e=>/\p{N}/u.test(e))??(t.length>1?Array.from(t.at(-1)??``)[0]:r.at(-1))??i;return Array.from(`${i}${a}`.toUpperCase()).slice(0,2).join(``)}function g(e){let t=m(e).toLocaleLowerCase(`en-US`)||`project`,n=0;for(let e of t)n=(n*31+(e.codePointAt(0)??0))%d.length;return d[n]?.value??`blue`}function _(e){return{monogram:h(e),color:g(e)}}var v=e(t(),1),y=[`folder-code`,`code-2`,`terminal`,`globe-2`,`server`,`database`,`bot`,`sparkles`,`smartphone`,`monitor`,`cloud-cog`,`package`,`book-open`,`flask-conical`,`shield-check`,`rocket`,`gamepad-2`,`music`,`image`,`shopping-bag`,`git-branch`,`workflow`,`wrench`,`layers-3`],de=[{emoji:`💻`,label:`Computer`},{emoji:`🛠️`,label:`Tools`},{emoji:`🚀`,label:`Rocket`},{emoji:`🤖`,label:`Robot`},{emoji:`✨`,label:`Sparkles`},{emoji:`⚡`,label:`Lightning`},{emoji:`🌐`,label:`Web`},{emoji:`📱`,label:`Mobile`},{emoji:`🖥️`,label:`Desktop`},{emoji:`⌨️`,label:`Keyboard`},{emoji:`⚙️`,label:`Gear`},{emoji:`🗄️`,label:`Database`},{emoji:`☁️`,label:`Cloud`},{emoji:`📦`,label:`Package`},{emoji:`📚`,label:`Books`},{emoji:`🧪`,label:`Test tube`},{emoji:`🔒`,label:`Lock`},{emoji:`🎮`,label:`Game`},{emoji:`🎵`,label:`Music`},{emoji:`🎬`,label:`Movie`},{emoji:`🖼️`,label:`Picture`},{emoji:`🛍️`,label:`Shopping`},{emoji:`🔥`,label:`Fire`},{emoji:`💡`,label:`Idea`},{emoji:`🧩`,label:`Puzzle`},{emoji:`📊`,label:`Chart`},{emoji:`🧠`,label:`Brain`},{emoji:`🦄`,label:`Unicorn`},{emoji:`🐙`,label:`Octopus`},{emoji:`🌱`,label:`Seedling`}];function fe(e){let t=e.trim().toLowerCase().replaceAll(/\s+/g,`-`);return t?f.filter(e=>e.includes(t)).slice(0,60):y}function pe(e){let t=e.trim();if(!t)return null;let n=new Intl.Segmenter(void 0,{granularity:`grapheme`}).segment(t)[Symbol.iterator]().next().value?.segment,r=/^\p{Regional_Indicator}{2}$/u.test(n??``),i=/^[#*0-9]\uFE0F?\u20E3$/u.test(n??``);return!n||!/\p{Extended_Pictographic}/u.test(n)&&!r&&!i?null:n}var b=e(a(),1),x=`folder-code`,me=r(i);function he(e){return e.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function S(e){let t=(0,p.c)(84),{current:n,projectName:r,open:i,onOpenChange:a,onSelect:f}=e,m;t[0]===r?m=t[1]:(m=_(r),t[0]=r,t[1]=m);let h=m,[g,y]=(0,v.useState)(n?.kind??`lucide`),[S,C]=(0,v.useState)(n?.kind===`lucide`?n.name:x),[w,ge]=(0,v.useState)(n&&n.kind!==`emoji`?n.color:h.color),[T,_e]=(0,v.useState)(n?.kind===`monogram`?n.text:h.monogram),[E,D]=(0,v.useState)(n?.kind===`emoji`?n.emoji:`💻`),[O,ve]=(0,v.useState)(``),[k,ye]=(0,v.useState)(``),be=(0,v.useRef)(!1),A,j;t[2]!==h.color||t[3]!==h.monogram||t[4]!==n||t[5]!==i?(A=()=>{i&&!be.current&&(y(n?.kind??`lucide`),C(n?.kind===`lucide`?n.name:x),ge(n&&n.kind!==`emoji`?n.color:h.color),_e(n?.kind===`monogram`?n.text:h.monogram),D(n?.kind===`emoji`?n.emoji:`💻`),ve(``),ye(``)),be.current=i},j=[n,i,h.color,h.monogram],t[2]=h.color,t[3]=h.monogram,t[4]=n,t[5]=i,t[6]=A,t[7]=j):(A=t[6],j=t[7]),(0,v.useEffect)(A,j);let M;t[8]===O?M=t[9]:(M=fe(O),t[8]=O,t[9]=M);let N=M,P,F,I,L,R,z,B,V,H,U,W,G,K;if(t[10]!==h.monogram||t[11]!==w||t[12]!==k||t[13]!==E||t[14]!==S||t[15]!==N||t[16]!==T||t[17]!==g||t[18]!==a||t[19]!==f||t[20]!==i||t[21]!==O){let e=ce(w),n,r;t[35]===T?(n=t[36],r=t[37]):(n=T.normalize(`NFKC`).trim().toUpperCase(),r=me(n),t[35]=T,t[36]=n,t[37]=r),K=r;let o;t[38]!==w||t[39]!==E||t[40]!==S||t[41]!==g||t[42]!==n||t[43]!==a||t[44]!==f||t[45]!==K?(o=()=>{(g!==`monogram`||K)&&(f(g===`monogram`?{kind:`monogram`,text:n,color:w}:g===`lucide`?{kind:`lucide`,name:S,color:w}:{kind:`emoji`,emoji:E}),a(!1))},t[38]=w,t[39]=E,t[40]=S,t[41]=g,t[42]=n,t[43]=a,t[44]=f,t[45]=K,t[46]=o):o=t[46],L=o,I=se,z=i,B=a,F=oe,G=`w-full sm:w-[32rem]`,t[47]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,b.jsxs)(ne,{children:[(0,b.jsx)(re,{children:`Choose project icon`}),(0,b.jsx)(ae,{children:`Choose an icon, emoji, or monogram.`})]}),t[47]=R):R=t[47],P=ie,V=`flex min-h-0 flex-col`;let u;t[48]===g?u=t[49]:(u=[g],t[48]=g,t[49]=u);let p,m,_,v;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(p=e=>{let t=e[0];(t===`lucide`||t===`emoji`||t===`monogram`)&&y(t)},m=(0,b.jsx)(c,{value:`lucide`,children:`Icons`}),_=(0,b.jsx)(c,{value:`emoji`,children:`Emoji`}),v=(0,b.jsx)(c,{value:`monogram`,children:`Monogram`}),t[50]=p,t[51]=m,t[52]=_,t[53]=v):(p=t[50],m=t[51],_=t[52],v=t[53]),t[54]===u?H=t[55]:(H=(0,b.jsxs)(ee,{"aria-label":`Icon type`,variant:`segmented`,value:u,onValueChange:p,children:[m,_,v]}),t[54]=u,t[55]=H),t[56]!==w||t[57]!==g?(U=g===`emoji`?null:(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`div`,{className:`mb-2 text-xs font-medium text-muted-foreground`,children:`Color`}),(0,b.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,role:`group`,"aria-label":`Icon color`,children:d.map(e=>(0,b.jsx)(`button`,{type:`button`,"aria-label":e.label,"aria-pressed":w===e.value,className:s(`flex size-6 items-center justify-center rounded-full border border-transparent outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,w===e.value&&`border-foreground/64`),onClick:()=>ge(e.value),children:(0,b.jsx)(`span`,{className:s(`size-4 rounded-full`,e.swatchClassName)})},e.value))})]}),t[56]=w,t[57]=g,t[58]=U):U=t[58],W=g===`lucide`?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(l,{type:`search`,value:O,"aria-label":`Search Lucide icons`,placeholder:`Search all Lucide icons`,onChange:e=>ve(e.currentTarget.value)}),(0,b.jsx)(te,{scrollFade:!0,className:`max-h-64`,children:(0,b.jsx)(`div`,{className:`grid grid-cols-8 gap-1 p-0.5 sm:grid-cols-10`,children:N.map(t=>(0,b.jsx)(`button`,{type:`button`,"aria-label":he(t),"aria-pressed":S===t,className:s(`flex aspect-square items-center justify-center rounded-md border border-transparent outline-none hover:bg-accent focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,S===t&&`border-border bg-accent`,e),onClick:()=>C(t),children:(0,b.jsx)(ue,{name:t,className:`size-5`})},t))})}),N.length===0?(0,b.jsx)(`p`,{className:`py-8 text-center text-sm text-muted-foreground`,children:`No icons found.`}):null]}):g===`monogram`?(0,b.jsxs)(`div`,{className:`flex items-center gap-4 py-2`,children:[(0,b.jsx)(le,{text:K?n:h.monogram,color:w,className:`size-12`}),(0,b.jsxs)(`div`,{className:`flex-1 space-y-2`,children:[(0,b.jsx)(`label`,{htmlFor:`project-monogram`,className:`text-sm font-medium`,children:`Letters`}),(0,b.jsx)(l,{id:`project-monogram`,value:T,onChange:e=>_e(e.currentTarget.value),"aria-describedby":`project-monogram-hint`,"aria-invalid":!K,autoComplete:`off`}),(0,b.jsx)(`p`,{id:`project-monogram-hint`,className:`text-xs text-muted-foreground`,children:`One or two letters or numbers.`})]})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(te,{scrollFade:!0,className:`max-h-64`,children:(0,b.jsx)(`div`,{className:`grid grid-cols-8 gap-1 p-0.5 sm:grid-cols-10`,children:de.map(e=>(0,b.jsx)(`button`,{type:`button`,"aria-label":e.label,"aria-pressed":E===e.emoji,className:s(`flex aspect-square items-center justify-center rounded-md border border-transparent text-xl outline-none hover:bg-accent focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,E===e.emoji&&`border-border bg-accent`),onClick:()=>D(e.emoji),children:e.emoji},e.emoji))})}),(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`div`,{className:`mb-2 text-xs font-medium text-muted-foreground`,children:`Or paste any emoji`}),(0,b.jsx)(l,{value:k,"aria-label":`Custom emoji`,placeholder:`Paste an emoji`,onChange:e=>{let t=e.currentTarget.value;ye(t);let n=pe(t);n&&D(n)}})]})]}),t[10]=h.monogram,t[11]=w,t[12]=k,t[13]=E,t[14]=S,t[15]=N,t[16]=T,t[17]=g,t[18]=a,t[19]=f,t[20]=i,t[21]=O,t[22]=P,t[23]=F,t[24]=I,t[25]=L,t[26]=R,t[27]=z,t[28]=B,t[29]=V,t[30]=H,t[31]=U,t[32]=W,t[33]=G,t[34]=K}else P=t[22],F=t[23],I=t[24],L=t[25],R=t[26],z=t[27],B=t[28],V=t[29],H=t[30],U=t[31],W=t[32],G=t[33],K=t[34];let q;t[59]!==P||t[60]!==V||t[61]!==H||t[62]!==U||t[63]!==W?(q=(0,b.jsxs)(P,{className:V,children:[H,U,W]}),t[59]=P,t[60]=V,t[61]=H,t[62]=U,t[63]=W,t[64]=q):q=t[64];let J;t[65]===a?J=t[66]:(J=(0,b.jsx)(o,{variant:`outline`,onClick:()=>a(!1),children:`Cancel`}),t[65]=a,t[66]=J);let Y=g===`monogram`&&!K,X;t[67]!==L||t[68]!==Y?(X=(0,b.jsx)(o,{onClick:L,disabled:Y,children:`Save icon`}),t[67]=L,t[68]=Y,t[69]=X):X=t[69];let Z;t[70]!==J||t[71]!==X?(Z=(0,b.jsxs)(u,{children:[J,X]}),t[70]=J,t[71]=X,t[72]=Z):Z=t[72];let Q;t[73]!==F||t[74]!==R||t[75]!==q||t[76]!==Z||t[77]!==G?(Q=(0,b.jsxs)(F,{className:G,children:[R,q,Z]}),t[73]=F,t[74]=R,t[75]=q,t[76]=Z,t[77]=G,t[78]=Q):Q=t[78];let $;return t[79]!==I||t[80]!==z||t[81]!==B||t[82]!==Q?($=(0,b.jsx)(I,{open:z,onOpenChange:B,children:Q}),t[79]=I,t[80]=z,t[81]=B,t[82]=Q,t[83]=$):$=t[83],$}export{S as ProjectIconPickerDialog};
2
- //# sourceMappingURL=ProjectIconPickerDialog-GDqk2LEH.js.map
@@ -1,4 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Ax as n,Gn as r,Ho as i,Ht as a,Jt as o,Nt as s,Vt as c,Wn as l,Yn as u,Zn as d,ha as f,or as p,qc as m,sl as h,sr as g,t as _,tr as v,vm as y}from"./utils-DmfMX1v5.js";import{t as b}from"./chevron-down-DHV04o66.js";import{t as x}from"./clock-3-SBiWJYHb.js";import{t as S}from"./copy-CoM62e83.js";import{t as C}from"./inbox-48iST-IJ.js";import{t as w}from"./pencil-CnxrJI7X.js";import{t as T}from"./play-Bvcnzkvl.js";import{t as E}from"./plus-Cr075-cy.js";import{t as D}from"./trash-2-CiyAV2xI.js";import{L as ee,Pt as O,U as te}from"./runtime-BQJQC-Ny.js";import{C as k}from"./entities-82m-Smm-.js";import{a as ne,n as A,t as j}from"./tooltip-taOyJZax.js";import{a as M,c as N,o as P,s as F,t as I}from"./select-B4VvMEs2.js";import{t as L}from"./link-C4sEUNOK.js";import{i as R,p as z}from"./toast-CjelgyqV.js";import{C as B,S as re,et as V,f as H}from"./useSettings-CLtJrOYI.js";import{f as U,t as ie}from"./server-BD_Y5Gsn.js";import{n as ae}from"./session-DsbInyNV.js";import{n as oe}from"./query-DpwJQzeq.js";import{t as se}from"./use-atom-command-CQHjSXPR.js";import{n as ce}from"./toastHelpers-Dsph6LwL.js";import{h as le,i as W,m as G,u as K}from"./queries-Cq5C9N-K.js";import{a as q}from"./timestampFormat-wac2e_Jz.js";import{t as ue}from"./textarea-Bu723jDd.js";import{n as de,t as J}from"./toggle-group-DCQTLIPb.js";import{a as fe,c as Y,l as X,n as pe,o as me,r as Z,s as he,t as ge}from"./combobox-C81z_216.js";import{t as _e}from"./input-Cd_0h7h_.js";import{n as ve}from"./scroll-area-LhpLVf8r.js";import{a as ye,c as be,i as xe,n as Se,o as Ce,r as we,s as Te,t as Ee}from"./dialog-Bn1u_Xoc.js";import{a as De,i as Oe,o as ke,r as Ae,t as je}from"./empty-C-gDaZ_z.js";import{n as Me}from"./EnvironmentMachineIcon-DPQkDtvr.js";import{B as Ne,_ as Pe,a as Fe,i as Ie,n as Le,s as Re,u as ze}from"./settingsLayout-jP1a50ek.js";import{n as Be}from"./primaryCloudLinkState-CWT2YTBZ.js";import{a as Ve,i as He,n as Ue,r as We,s as Ge,t as Ke}from"./scheduledTasksSettings.logic-C3Mbc4mh.js";import{La as qe,Ni as Je,Ro as Ye,Xo as Xe,cn as Ze,qa as Qe,xn as $e}from"./main-BB3F4O6Y.js";import{t as et}from"./ProviderModelPicker-Bfpy_Rw1.js";var tt=n(),Q=e(t(),1),$=e(f(),1);function nt(e){let t=(0,tt.c)(69),{items:n,filteredItems:r,value:i,query:a,resultsQuery:o,onQueryChange:s,open:c,onOpenChange:l,onSelectItem:u,hasNextPage:d,isFetchingNextPage:f,onLoadNext:p,statusText:m,originControl:h,popupProps:g,renderItem:v,getItemType:y,children:b}=e,x=(0,Q.useRef)(null),S=(0,Q.useId)(),C=(0,Q.useRef)(null),w=(0,Q.useRef)(null),T;t[0]===l?T=t[1]:(T=e=>{w.current=null,e||(x.current=null),l(e)},t[0]=l,t[1]=T);let E=T,[D,ee]=(0,Q.useState)(!1),[O,te]=(0,Q.useState)(!1),k;t[2]!==d||t[3]!==f||t[4]!==p?(k=()=>{d&&!f&&p()},t[2]=d,t[3]=f,t[4]=p,t[5]=k):k=t[5];let M=k,N;t[6]!==M||t[7]!==d||t[8]!==f||t[9]!==c?(N=()=>{let e=C.current;if(!e)return;let t=w.current;w.current=e.scrollTop,c&&d&&!f&&le({previousScrollTop:t,scrollTop:e.scrollTop,scrollHeight:e.scrollHeight,clientHeight:e.clientHeight})&&M()},t[6]=M,t[7]=d,t[8]=f,t[9]=c,t[10]=N):N=t[10];let P=N,F=(0,Q.useRef)(null),I;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(I=()=>{let e=F.current?.getScrollableNode?.();if(!(e instanceof HTMLElement))return;C.current=e;let t=Math.max(0,e.scrollHeight-e.clientHeight);ee(e.scrollTop>1),te(t-e.scrollTop>1)},t[11]=I):I=t[11];let L=I,R,z;t[12]===c?(R=t[13],z=t[14]):(R=()=>{if(!c)return;let e=0,t=requestAnimationFrame(()=>{L(),e=requestAnimationFrame(L)});return()=>{cancelAnimationFrame(t),cancelAnimationFrame(e)}},z=[c,L],t[12]=c,t[13]=R,t[14]=z),(0,Q.useLayoutEffect)(R,z);let B=(0,Q.useRef)(null),re,V;t[15]!==c||t[16]!==o?(re=()=>{if(!c){B.current=null;return}B.current!==o&&(B.current=o,F.current?.scrollToOffset?.({offset:0,animated:!1}))},V=[o,c],t[15]=c,t[16]=o,t[17]=re,t[18]=V):(re=t[17],V=t[18]),(0,Q.useEffect)(re,V);let H;t[19]===c?H=t[20]:(H=(e,t)=>{x.current=typeof e==`string`?e:null,!(!c||t.index<0||t.reason!==`keyboard`)&&F.current?.scrollIndexIntoView?.({index:t.index,animated:!1})},t[19]=c,t[20]=H);let U;t[21]===s?U=t[22]:(U=e=>s(e.target.value),t[21]=s,t[22]=U);let ie;t[23]!==r||t[24]!==u?(ie=e=>{if(e.key!==`Enter`||e.nativeEvent.isComposing||e.keyCode===229)return;let t=x.current;t!==null&&r.includes(t)&&(e.preventBaseUIHandler?.(),e.preventDefault(),e.stopPropagation(),x.current=null,u(t))},t[23]=r,t[24]=u,t[25]=ie):ie=t[25];let ae;t[26]!==a||t[27]!==U||t[28]!==ie?(ae=(0,$.jsx)(he,{placeholder:`Search refs...`,value:a,onChange:U,onKeyDown:ie}),t[26]=a,t[27]=U,t[28]=ie,t[29]=ae):ae=t[29];let oe;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,$.jsx)(pe,{children:`No refs found.`}),t[30]=oe):oe=t[30];let se;t[31]===y?se=t[32]:(se=y?{getItemType:y}:{},t[31]=y,t[32]=se);let ce;t[33]===v?ce=t[34]:(ce=e=>{let{item:t,index:n}=e;return v(t,n)},t[33]=v,t[34]=ce);let W;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(W=()=>{L(),w.current=C.current?.scrollTop??null},t[35]=W):W=t[35];let G;t[36]===P?G=t[37]:(G=()=>{L(),P()},t[36]=P,t[37]=G);let K;t[38]!==O||t[39]!==D?(K=_(`max-h-56 scrollbar-gutter-stable overflow-x-hidden overscroll-y-contain ps-1 pe-0 pt-2 pb-1`,ve({top:D,bottom:O})),t[38]=O,t[39]=D,t[40]=K):K=t[40];let q;t[41]!==r||t[42]!==se||t[43]!==ce||t[44]!==G||t[45]!==K?(q=(0,$.jsx)(`div`,{className:`relative min-h-0 w-full max-h-56 flex-1 overflow-hidden`,children:(0,$.jsx)(fe,{className:`size-full min-w-0`,children:(0,$.jsx)($e,{ref:F,data:r,keyExtractor:rt,...se,renderItem:ce,estimatedItemSize:28,drawDistance:336,onLayout:W,onScroll:G,className:K})})}),t[41]=r,t[42]=se,t[43]=ce,t[44]=G,t[45]=K,t[46]=q):q=t[46];let ue;t[47]!==h||t[48]!==S?(ue=h?(0,$.jsxs)(j,{children:[(0,$.jsx)(ne,{render:(0,$.jsxs)(`label`,{htmlFor:S,className:`flex cursor-pointer items-center justify-between gap-3 border-t border-border/60 px-3 py-2 text-xs`,children:[(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5 font-medium text-muted-foreground`,children:[(0,$.jsx)(Qe,{"aria-hidden":`true`,className:`size-3 shrink-0`}),(0,$.jsx)(`span`,{className:`truncate`,children:`Start from origin`})]}),(0,$.jsx)(qe,{id:S,checked:h.checked,size:`sm`,"aria-label":`Start worktree from origin`,onCheckedChange:e=>h.onCheckedChange(!!e)})]})}),(0,$.jsx)(A,{side:`top`,className:`max-w-72 whitespace-normal`,children:`Creates the worktree from the latest matching branch on origin instead of your local branch.`})]}):null,t[47]=h,t[48]=S,t[49]=ue):ue=t[49];let de;t[50]===m?de=t[51]:(de=m?(0,$.jsx)(Y,{children:m}):null,t[50]=m,t[51]=de);let J;t[52]!==q||t[53]!==ue||t[54]!==de?(J=(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden`,children:[oe,q,ue,de]}),t[52]=q,t[53]=ue,t[54]=de,t[55]=J):J=t[55];let X;t[56]!==g||t[57]!==ae||t[58]!==J?(X=(0,$.jsxs)(me,{...g,children:[ae,J]}),t[56]=g,t[57]=ae,t[58]=J,t[59]=X):X=t[59];let Z;return t[60]!==b||t[61]!==r||t[62]!==E||t[63]!==n||t[64]!==c||t[65]!==X||t[66]!==H||t[67]!==i?(Z=(0,$.jsxs)(ge,{items:n,filteredItems:r,autoHighlight:!0,virtualized:!0,onItemHighlighted:H,onOpenChange:E,open:c,value:i,children:[b,X]}),t[60]=b,t[61]=r,t[62]=E,t[63]=n,t[64]=c,t[65]=X,t[66]=H,t[67]=i,t[68]=Z):Z=t[68],Z}function rt(e){return e}function it(e){let t=(0,tt.c)(15),{branch:n,projectCwd:r,index:i,value:a,disabled:o,onClick:s,onContextMenu:c}=e,l=n.name,u=n.worktreePath&&r&&n.worktreePath!==r,d=n.current?`current`:u?`worktree`:n.isRemote?`remote`:n.isDefault?`default`:null,f=a??l,p;t[0]===l?p=t[1]:(p=(0,$.jsx)(Ze,{value:l,className:`flex-1`}),t[0]=l,t[1]=p);let m;t[2]===d?m=t[3]:(m=d&&(0,$.jsx)(`span`,{className:`shrink-0 text-3xs text-muted-foreground/45`,children:d}),t[2]=d,t[3]=m);let h;t[4]!==p||t[5]!==m?(h=(0,$.jsxs)(`div`,{className:`flex w-full min-w-0 items-center justify-between gap-2`,children:[p,m]}),t[4]=p,t[5]=m,t[6]=h):h=t[6];let g;return t[7]!==o||t[8]!==i||t[9]!==l||t[10]!==s||t[11]!==c||t[12]!==f||t[13]!==h?(g=(0,$.jsx)(Z,{disabled:o,hideIndicator:!0,index:i,value:f,onClick:s,onContextMenu:c,children:h},l),t[7]=o,t[8]=i,t[9]=l,t[10]=s,t[11]=c,t[12]=f,t[13]=h,t[14]=g):g=t[14],g}function at(e,t){if(e.url!==null)return{address:e.url,copyable:!0,note:null};if(t===null)return{address:e.path,copyable:!1,note:`Link this environment to P4 Connect for a public URL.`};let n=new URL(e.path,t);return{address:n.href,copyable:!0,note:O(n.hostname)?`Only this computer can call this address. Link P4 Connect for a public URL.`:`Works wherever this environment's address is reachable, for example over Tailscale or your own proxy. Link P4 Connect for a public URL.`}}function ot(e){let t=(0,tt.c)(58),{environmentId:n,cwd:r,value:i,onValueChange:a,startFromOrigin:o,onStartFromOriginChange:s,disabled:c,id:l}=e,u=c!==void 0&&c,[d,f]=(0,Q.useState)(!1),[p,m]=(0,Q.useState)(``),h;t[0]===p?h=t[1]:(h=p.trim(),t[0]=p,t[1]=h);let _=(0,Q.useDeferredValue)(h),v;t[2]===_?v=t[3]:(v=G(_),t[2]=_,t[3]=v);let y;t[4]!==r||t[5]!==n||t[6]!==v?(y={environmentId:n,cwd:r,query:v},t[4]=r,t[5]=n,t[6]=v,t[7]=y):y=t[7];let x=W(y),S;t[8]!==r||t[9]!==n||t[10]!==i?(S=r&&i?K.listRefs({environmentId:n,input:{cwd:r,query:i,limit:10}}):null,t[8]=r,t[9]=n,t[10]=i,t[11]=S):S=t[11];let C=oe(S),w;t[12]!==x.refs||t[13]!==C||t[14]!==i?(w=x.refs.find(e=>e.name===i)??C.data?.refs.find(e=>e.name===i),t[12]=x.refs,t[13]=C,t[14]=i,t[15]=w):w=t[15];let T=w,E=i||null,D=T?T.isRemote===!0:null,ee;t[16]!==o||t[17]!==E||t[18]!==D?(ee=Pe({activeWorktreePath:null,effectiveEnvMode:`worktree`,resolvedActiveBranch:E,resolvedActiveBranchIsRemote:D,startFromOrigin:o}),t[16]=o,t[17]=E,t[18]=D,t[19]=ee):ee=t[19];let O=ee,te;t[20]===x.refs?te=t[21]:(te=new Map(x.refs.map(st)),t[20]=x.refs,t[21]=te);let k=te,ne;t[22]===k?ne=t[23]:(ne=[...k.keys()],t[22]=k,t[23]=ne);let A=ne,j=x.data?.nextCursor!=null,M=x.error??(x.isPending&&x.data===null?`Loading refs...`:x.isFetchingNextPage?`Loading more refs...`:j?`Showing ${x.refs.length} of ${x.data?.totalCount} refs`:null),N;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(N=e=>{f(e),e||m(``)},t[24]=N):N=t[24];let P=N,F=i||null,I=d&&!u,L;t[25]===a?L=t[26]:(L=e=>{a(e),P(!1)},t[25]=a,t[26]=L);let R;t[27]!==s||t[28]!==o?(R={checked:o,onCheckedChange:s},t[27]=s,t[28]=o,t[29]=R):R=t[29];let z;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(z={align:`start`,side:`bottom`,className:`flex w-80 flex-col`},t[30]=z):z=t[30];let B;t[31]!==k||t[32]!==r||t[33]!==a?(B=(e,t)=>{let n=k.get(e);return n?(0,$.jsx)(it,{branch:n,projectCwd:r,index:t,onClick:()=>{a(n.name),P(!1)}}):null},t[31]=k,t[32]=r,t[33]=a,t[34]=B):B=t[34];let re=u||!r,V;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,$.jsx)(g,{variant:`outline`,size:`sm`}),t[35]=V):V=t[35];let H;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,$.jsx)(Ye,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[36]=H):H=t[36];let U;t[37]===O?U=t[38]:(U=(0,$.jsx)(Ze,{value:O,className:`flex-1 text-left`}),t[37]=O,t[38]=U);let ie;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,$.jsx)(b,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[39]=ie):ie=t[39];let ae;t[40]!==l||t[41]!==re||t[42]!==U?(ae=(0,$.jsxs)(X,{id:l,disabled:re,render:V,className:`w-full justify-between `,children:[H,U,ie]}),t[40]=l,t[41]=re,t[42]=U,t[43]=ae):ae=t[43];let se;return t[44]!==x.isFetchingNextPage||t[45]!==x.loadNext||t[46]!==_||t[47]!==j||t[48]!==A||t[49]!==p||t[50]!==M||t[51]!==F||t[52]!==I||t[53]!==L||t[54]!==R||t[55]!==B||t[56]!==ae?(se=(0,$.jsx)(nt,{items:A,filteredItems:A,value:F,query:p,resultsQuery:_,onQueryChange:m,open:I,onOpenChange:P,onSelectItem:L,hasNextPage:j,isFetchingNextPage:x.isFetchingNextPage,onLoadNext:x.loadNext,statusText:M,originControl:R,popupProps:z,renderItem:B,children:ae}),t[44]=x.isFetchingNextPage,t[45]=x.loadNext,t[46]=_,t[47]=j,t[48]=A,t[49]=p,t[50]=M,t[51]=F,t[52]=I,t[53]=L,t[54]=R,t[55]=B,t[56]=ae,t[57]=se):se=t[57],se}function st(e){return[e.name,e]}var ct=[1,2,3,4,5,6,0],lt=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],ut=[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],dt={auto:`Choose automatically`,worktree:`Create a new worktree`,root:`Use the project checkout`,existing_worktree:`Use a specific checkout`},ft={editingId:null,title:``,prompt:``,enabled:!0,scheduleMode:`fixed`,intervalMinutes:`15`,timeOfDay:`09:00`,weekdays:new Set([1,2,3,4,5]),projectId:``,threadId:``,workspaceMode:`worktree`,baseRef:`main`,startFromOrigin:!0,existingWorktreePath:``,modelKey:``,runtimeMode:`full-access`,interactionMode:`default`,baseModelSelection:null,signatureEnabled:!1,...Ke,signatureSecret:``,maxDeliveryAgeMinutes:``};function pt(e){let t=(0,tt.c)(11),{label:n,hint:r,htmlFor:i,children:a}=e,o;t[0]===n?o=t[1]:(o=(0,$.jsx)(`span`,{children:n}),t[0]=n,t[1]=o);let s;t[2]===r?s=t[3]:(s=r?(0,$.jsx)(`span`,{className:`font-normal text-2xs text-muted-foreground/80`,children:r}):null,t[2]=r,t[3]=s);let c;t[4]!==i||t[5]!==o||t[6]!==s?(c=(0,$.jsxs)(Je,{className:`flex items-baseline justify-between`,htmlFor:i,children:[o,s]}),t[4]=i,t[5]=o,t[6]=s,t[7]=c):c=t[7];let l;return t[8]!==a||t[9]!==c?(l=(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[c,a]}),t[8]=a,t[9]=c,t[10]=l):l=t[10],l}function mt(e){let t=e.indexOf(`:`);return t<=0||t===e.length-1?null:{instanceId:y.make(e.slice(0,t)),model:e.slice(t+1)}}function ht(e){if(e.type===`webhook`)return`On webhook`;if(e.type===`interval`){let t=e.everyMs/6e4;return Number.isInteger(t)?`Every ${t} min`:`Every ${Math.round(e.everyMs/1e3)} sec`}let t=e.weekdays??[];return`${t.length===0?`Daily`:t.length===5&&t.every(e=>e>=1&&e<=5)?`Weekdays`:t.map(e=>lt[e]).join(`, `)} at ${e.timeOfDay}`}function gt(e){if(!e)return`Not scheduled`;let t=new Date(e).getTime()-Date.now();if(t<=0){let t=q(e);return t?t.suffix?`${t.value} ${t.suffix}`:t.value:`Not scheduled`}let n=Math.ceil(t/6e4);if(n<2)return`in under a minute`;if(n<60)return`in ${n}m`;let r=Math.round(n/60);return r<24?`in ${r}h`:`in ${Math.round(r/24)}d`}var _t={accepted:`Ran`,dispatch_failed:`Run failed`,rejected_signature:`Bad signature`,disabled:`Task paused`,rate_limited:`Rate limited`,expired:`Too old`};function vt(e){return e===`accepted`?`success`:e===`disabled`||e===`rate_limited`||e===`expired`?`warning`:`error`}function yt(e){return e===`failed`?`error`:e===`succeeded`?`success`:e===`running`?`info`:`outline`}function bt(e){let t=(0,tt.c)(29),{scope:n,environments:r,connectedEnvironments:a,environment:o}=Ne(),s;t[0]!==e.environmentId||t[1]!==e.threadId?(s=()=>e.threadId&&e.environmentId?{environmentId:e.environmentId,task:null}:null,t[0]=e.environmentId,t[1]=e.threadId,t[2]=s):s=t[2];let[c,l]=(0,Q.useState)(s),u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=(e,t)=>{l({environmentId:e,task:t})},t[3]=u):u=t[3];let d=u,f=o??a[0],p;t[4]===f?.environmentId?p=t[5]:(p=U.upsertScheduledTask.permissionAtom(f?.environmentId??null),t[4]=f?.environmentId,t[5]=p);let m=i(p),h=!f||!m,_;t[6]===f?_=t[7]:(_=()=>f&&l({environmentId:f.environmentId,task:null}),t[6]=f,t[7]=_);let v;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsx)(E,{className:`size-3`}),t[8]=v):v=t[8];let y;t[9]!==h||t[10]!==_?(y=(0,$.jsxs)(g,{size:`xs`,variant:`ghost-muted`,disabled:h,onClick:_,children:[v,`New task`]}),t[9]=h,t[10]=_,t[11]=y):y=t[11];let b;t[12]!==f?.environmentId||t[13]!==r||t[14]!==n.kind||t[15]!==n.message||t[16]!==e.environmentId||t[17]!==e.taskId?(b=n.kind===`unavailable`?(0,$.jsx)(Re,{title:`Unavailable selection`,children:(0,$.jsx)(Fe,{title:n.message})}):r.length===0?(0,$.jsx)(je,{children:(0,$.jsxs)(Oe,{children:[(0,$.jsx)(De,{variant:`icon`,children:(0,$.jsx)(x,{})}),(0,$.jsx)(ke,{children:`No environments available`}),(0,$.jsx)(Ae,{children:`Connect an environment to manage scheduled tasks.`})]})}):(0,$.jsx)(`div`,{className:`space-y-8`,children:r.map(t=>(0,$.jsx)(xt,{environment:t,showEnvironmentHeading:r.length>1,taskId:(e.environmentId??f?.environmentId)===t.environmentId?e.taskId:void 0,onEdit:d},`${t.environmentId}:${e.taskId??``}`))}),t[12]=f?.environmentId,t[13]=r,t[14]=n.kind,t[15]=n.message,t[16]=e.environmentId,t[17]=e.taskId,t[18]=b):b=t[18];let S;t[19]!==y||t[20]!==b?(S=(0,$.jsx)(Re,{title:`Scheduled tasks`,variant:`plain`,headerAction:y,children:b}),t[19]=y,t[20]=b,t[21]=S):S=t[21];let C;t[22]!==c||t[23]!==e.projectId||t[24]!==e.threadId?(C=c?(0,$.jsx)(kt,{initialThreadId:e.threadId,initialProjectId:e.projectId,initialEnvironmentId:c.environmentId,task:c.task,onClose:()=>l(null)},`${c.environmentId}:${c.task?.id??`new`}`):null,t[22]=c,t[23]=e.projectId,t[24]=e.threadId,t[25]=C):C=t[25];let w;return t[26]!==S||t[27]!==C?(w=(0,$.jsxs)(Ie,{children:[S,C]}),t[26]=S,t[27]=C,t[28]=w):w=t[28],w}function xt(e){let t=(0,tt.c)(13),{environment:n,showEnvironmentHeading:r,taskId:i,onEdit:a}=e,{scope:o}=Ne(),s=n.connection.phase===`connected`&&n.serverConfig!==null,c;t[0]!==s||t[1]!==n.environmentId?(c=s?U.scheduledTasksLive({environmentId:n.environmentId,input:{}}):null,t[0]=s,t[1]=n.environmentId,t[2]=c):c=t[2];let l=oe(c),u=l.data?.tasks.filter(e=>Ue(o,n.environmentId,e.projectId)),d=u?.find(e=>e.id===i),f=(0,Q.useRef)(!1);(0,Q.useEffect)(()=>{!f.current&&d&&(f.current=!0,a(n.environmentId,d))},[n.environmentId,d,a]),ze(6e4);let p=Re,m=n.label,g=!r,_;t[3]===n.serverConfig?_=t[4]:(_=h(n.serverConfig),t[3]=n.serverConfig,t[4]=_);let v;t[5]===_?v=t[6]:(v=(0,$.jsx)(Me,{kind:_,className:`size-3.5`}),t[5]=_,t[6]=v);let y=s?l.error?(0,$.jsx)(Fe,{title:`Could not load scheduled tasks`,description:l.error}):u?(0,$.jsxs)($.Fragment,{children:[i&&!d?(0,$.jsx)(Fe,{title:`Task unavailable`,description:`This task no longer exists or is outside the selected project scope.`,role:`status`}):null,u.length===0?(0,$.jsx)(Fe,{title:`No scheduled tasks`,description:`No tasks match this environment and project selection.`}):u.map(e=>(0,$.jsx)(St,{environmentId:n.environmentId,task:e,onEdit:()=>a(n.environmentId,e)},e.id))]}):(0,$.jsx)(Fe,{title:`Loading scheduled tasks…`,role:`status`}):(0,$.jsx)(Fe,{title:`Environment disconnected`,description:`Reconnect ${n.label} to view its scheduled tasks.`}),b;return t[7]!==p||t[8]!==n.label||t[9]!==g||t[10]!==v||t[11]!==y?(b=(0,$.jsx)(p,{title:m,hideTitle:g,icon:v,children:y}),t[7]=p,t[8]=n.label,t[9]=g,t[10]=v,t[11]=y,t[12]=b):b=t[12],b}function St(e){let t=(0,tt.c)(77),{environmentId:n,task:a,onEdit:o}=e,s;t[0]===n?s=t[1]:(s=U.upsertScheduledTask.permissionAtom(n),t[0]=n,t[1]=s);let c=i(s),[f,m]=(0,Q.useState)(!1),[h,_]=(0,Q.useState)(!1),y=a.schedule.type===`webhook`,b;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(b={label:`scheduled task enabled`},t[2]=b):b=t[2];let x=se(U.setScheduledTaskEnabled,b),S;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(S={label:`scheduled task run now`},t[3]=S):S=t[3];let E=se(U.runScheduledTaskNow,S),O;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(O={label:`scheduled task delete`},t[4]=O):O=t[4];let k=se(U.deleteScheduledTask,O),ne;t[5]!==f||t[6]!==n||t[7]!==k||t[8]!==E||t[9]!==a.enabled||t[10]!==a.id||t[11]!==x?(ne=async e=>{if(f||!ae(n,`orchestration:operate`))return;m(!0);let t=e===`toggle`?await x({environmentId:n,input:{id:a.id,enabled:!a.enabled}}):e===`run`?await E({environmentId:n,input:{id:a.id}}):await k({environmentId:n,input:{id:a.id}});m(!1),t._tag===`Failure`&&!ee(t)&&R.add(ce({type:`error`,title:`Could not update scheduled task`,description:String(te(t))}))},t[5]=f,t[6]=n,t[7]=k,t[8]=E,t[9]=a.enabled,t[10]=a.id,t[11]=x,t[12]=ne):ne=t[12];let A=ne,j=a.title,M;t[13]===a.prompt?M=t[14]:(M=(0,$.jsx)(`span`,{className:`line-clamp-2`,children:a.prompt}),t[13]=a.prompt,t[14]=M);let N;t[15]===a.schedule?N=t[16]:(N=ht(a.schedule),t[15]=a.schedule,t[16]=N);let P;t[17]!==y||t[18]!==a.enabled||t[19]!==a.nextRunAt?(P=a.enabled?y?`Listening`:a.nextRunAt?`Next run ${gt(a.nextRunAt)}`:`Not scheduled`:`Paused`,t[17]=y,t[18]=a.enabled,t[19]=a.nextRunAt,t[20]=P):P=t[20];let F;t[21]!==N||t[22]!==P?(F=(0,$.jsxs)(`span`,{children:[N,` ·`,` `,P]}),t[21]=N,t[22]=P,t[23]=F):F=t[23];let I;t[24]===a.lastRunStatus?I=t[25]:(I=a.lastRunStatus===`never`?null:(0,$.jsx)(l,{variant:yt(a.lastRunStatus),children:a.lastRunStatus}),t[24]=a.lastRunStatus,t[25]=I);let L;t[26]===a.lastRunError?L=t[27]:(L=a.lastRunError?(0,$.jsx)(`span`,{className:`text-destructive`,children:a.lastRunError}):null,t[26]=a.lastRunError,t[27]=L);let z;t[28]!==F||t[29]!==I||t[30]!==L?(z=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[F,I,L]}),t[28]=F,t[29]=I,t[30]=L,t[31]=z):z=t[31];let B=f||!c,re=`Enable ${a.title}`,V;t[32]===A?V=t[33]:(V=()=>void A(`toggle`),t[32]=A,t[33]=V);let H;t[34]!==B||t[35]!==re||t[36]!==V||t[37]!==a.enabled?(H=(0,$.jsx)(qe,{checked:a.enabled,disabled:B,"aria-label":re,onCheckedChange:V}),t[34]=B,t[35]=re,t[36]=V,t[37]=a.enabled,t[38]=H):H=t[38];let ie=f||!c,oe=`Actions for ${a.title}`,le;t[39]!==ie||t[40]!==oe?(le=(0,$.jsx)(g,{size:`icon-sm`,variant:`ghost`,disabled:ie,"aria-label":oe}),t[39]=ie,t[40]=oe,t[41]=le):le=t[41];let W;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,$.jsx)(Xe,{className:`size-4`}),t[42]=W):W=t[42];let G;t[43]===le?G=t[44]:(G=(0,$.jsx)(p,{render:le,children:W}),t[43]=le,t[44]=G);let K;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,$.jsx)(w,{}),t[45]=K):K=t[45];let q;t[46]===o?q=t[47]:(q=(0,$.jsxs)(u,{onClick:o,children:[K,`Edit`]}),t[46]=o,t[47]=q);let ue;t[48]!==A||t[49]!==y?(ue=y?(0,$.jsxs)(u,{onClick:()=>_(!0),children:[(0,$.jsx)(C,{}),`Deliveries`]}):(0,$.jsxs)(u,{onClick:()=>void A(`run`),children:[(0,$.jsx)(T,{}),`Run now`]}),t[48]=A,t[49]=y,t[50]=ue):ue=t[50];let de;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,$.jsx)(v,{}),t[51]=de):de=t[51];let J;t[52]===A?J=t[53]:(J=()=>void A(`delete`),t[52]=A,t[53]=J);let fe;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(fe=(0,$.jsx)(D,{}),t[54]=fe):fe=t[54];let Y;t[55]===J?Y=t[56]:(Y=(0,$.jsxs)(u,{onClick:J,children:[fe,`Delete`]}),t[55]=J,t[56]=Y);let X;t[57]!==q||t[58]!==ue||t[59]!==Y?(X=(0,$.jsxs)(d,{align:`end`,children:[q,ue,de,Y]}),t[57]=q,t[58]=ue,t[59]=Y,t[60]=X):X=t[60];let pe;t[61]!==G||t[62]!==X?(pe=(0,$.jsxs)(r,{children:[G,X]}),t[61]=G,t[62]=X,t[63]=pe):pe=t[63];let me;t[64]!==h||t[65]!==n||t[66]!==a?(me=h?(0,$.jsx)(Ct,{environmentId:n,task:a,onClose:()=>_(!1)}):null,t[64]=h,t[65]=n,t[66]=a,t[67]=me):me=t[67];let Z;t[68]!==H||t[69]!==pe||t[70]!==me?(Z=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[H,pe,me]}),t[68]=H,t[69]=pe,t[70]=me,t[71]=Z):Z=t[71];let he;return t[72]!==z||t[73]!==Z||t[74]!==M||t[75]!==a.title?(he=(0,$.jsx)(Fe,{title:j,description:M,status:z,control:Z}),t[72]=z,t[73]=Z,t[74]=M,t[75]=a.title,t[76]=he):he=t[76],he}function Ct(e){let t=(0,tt.c)(38),{environmentId:n,task:r,onClose:i}=e,a;t[0]!==n||t[1]!==r.id?(a=U.scheduledTaskWebhookDeliveries({environmentId:n,input:{id:r.id}}),t[0]=n,t[1]=r.id,t[2]=a):a=t[2];let o=oe(a),[s,c]=(0,Q.useState)(null),u;t[3]!==n||t[4]!==s||t[5]!==r.id?(u=s===null?null:U.scheduledTaskWebhookDelivery({environmentId:n,input:{id:r.id,deliveryId:s}}),t[3]=n,t[4]=s,t[5]=r.id,t[6]=u):u=t[6];let d=oe(u),f=o.data?.deliveries??null,p=d.data?.delivery??null,m=s===null?o.error:d.error,h;t[7]===i?h=t[8]:(h=e=>{e||i()},t[7]=i,t[8]=h);let _;t[9]===r.title?_=t[10]:(_=(0,$.jsxs)(be,{children:[`Deliveries · `,r.title]}),t[9]=r.title,t[10]=_);let v;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsx)(we,{children:`Recent requests to this task's webhook URL.`}),t[11]=v):v=t[11];let y;t[12]===_?y=t[13]:(y=(0,$.jsxs)(ye,{children:[_,v]}),t[12]=_,t[13]=y);let b;t[14]===m?b=t[15]:(b=m?(0,$.jsx)(`p`,{className:`text-sm text-destructive`,children:m}):null,t[14]=m,t[15]=b);let x;t[16]!==f||t[17]!==p||t[18]!==s||t[19]!==d.error?(x=s!==null&&p===null&&d.error===null?(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,role:`status`,children:`Loading delivery…`}):p?(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm`,children:[(0,$.jsx)(l,{variant:vt(p.outcome),children:_t[p.outcome]}),(0,$.jsxs)(`span`,{children:[p.method,` · `,gt(p.receivedAt)]}),p.signatureVerified?(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:`Signature verified`}):null]}),p.error?(0,$.jsx)(`p`,{className:`text-sm text-destructive`,children:p.error}):null,(0,$.jsx)(Tt,{title:`Prompt sent to the agent`,children:p.renderedPrompt??`No run was started for this request.`}),p.missingFields.length>0?(0,$.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Empty placeholders: `,p.missingFields.join(`, `)]}):null,(0,$.jsx)(Tt,{title:`Headers`,children:Object.entries(p.headers).map(wt).join(`
2
- `)}),p.query?(0,$.jsx)(Tt,{title:`Query`,children:p.query}):null,(0,$.jsx)(Tt,{title:p.bodyTruncated?`Body (truncated)`:`Body`,children:p.body||`(empty)`})]}):s===null?f===null?(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,role:`status`,children:`Loading deliveries…`}):f.length===0?(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No requests yet.`}):(0,$.jsx)(`ul`,{className:`divide-y divide-border`,children:f.map(e=>(0,$.jsx)(`li`,{children:(0,$.jsxs)(`button`,{type:`button`,className:`flex w-full flex-wrap items-center gap-2 py-2 text-left text-sm hover:bg-accent/40`,onClick:()=>c(e.id),children:[(0,$.jsx)(l,{variant:vt(e.outcome),children:_t[e.outcome]}),(0,$.jsx)(`span`,{children:e.method}),(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:gt(e.receivedAt)}),e.missingFields.length>0?(0,$.jsxs)(`span`,{className:`text-muted-foreground`,children:[e.missingFields.length,` empty placeholder`,e.missingFields.length===1?``:`s`]}):null]})},e.id))}):null,t[16]=f,t[17]=p,t[18]=s,t[19]=d.error,t[20]=x):x=t[20];let S;t[21]!==b||t[22]!==x?(S=(0,$.jsxs)(Ce,{children:[b,x]}),t[21]=b,t[22]=x,t[23]=S):S=t[23];let C;t[24]!==o.isPending||t[25]!==o.refresh||t[26]!==s?(C=s===null?(0,$.jsx)(g,{variant:`outline`,size:`sm`,disabled:o.isPending,onClick:o.refresh,children:`Refresh`}):(0,$.jsx)(g,{variant:`outline`,size:`sm`,onClick:()=>c(null),children:`Back`}),t[24]=o.isPending,t[25]=o.refresh,t[26]=s,t[27]=C):C=t[27];let w;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,$.jsx)(Se,{render:(0,$.jsx)(g,{size:`sm`}),children:`Done`}),t[28]=w):w=t[28];let T;t[29]===C?T=t[30]:(T=(0,$.jsxs)(xe,{children:[C,w]}),t[29]=C,t[30]=T);let E;t[31]!==T||t[32]!==y||t[33]!==S?(E=(0,$.jsxs)(Te,{className:`max-w-2xl`,children:[y,S,T]}),t[31]=T,t[32]=y,t[33]=S,t[34]=E):E=t[34];let D;return t[35]!==E||t[36]!==h?(D=(0,$.jsx)(Ee,{open:!0,onOpenChange:h,children:E}),t[35]=E,t[36]=h,t[37]=D):D=t[37],D}function wt(e){let[t,n]=e;return`${t}: ${n}`}function Tt(e){let t=(0,tt.c)(7),{title:n,children:r}=e,i;t[0]===n?i=t[1]:(i=(0,$.jsx)(Je,{children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=(0,$.jsx)(`pre`,{className:`max-h-64 overflow-auto rounded-md bg-muted p-2 text-xs whitespace-pre-wrap break-all`,children:r}),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function Et(e){let t=(0,tt.c)(40),{environmentId:n,task:r}=e,a;t[0]===n?a=t[1]:(a=U.rotateScheduledTaskWebhookToken.permissionAtom(n),t[0]=n,t[1]=a);let o=i(a),s=B(n),c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c={target:`webhook URL`},t[2]=c):c=t[2];let{copyToClipboard:l,isCopied:u}=z(c),d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d={label:`scheduled task rotate webhook token`},t[3]=d):d=t[3];let f=se(U.rotateScheduledTaskWebhookToken,d),[p,m]=(0,Q.useState)(!1),h=r?.webhook;if(!r||!h){let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`The URL appears after you save.`}),t[4]=e):e=t[4],e}let _;t[5]!==h||t[6]!==s?(_=at(h,s),t[5]=h,t[6]=s,t[7]=_):_=t[7];let{address:v,copyable:y,note:b}=_,x;t[8]!==n||t[9]!==f||t[10]!==r?(x=async()=>{if(!(await V(`Rotate this webhook URL?
3
- The current URL stops working.`,{variant:`destructive`})??window.confirm(`Rotate this webhook URL? The current URL stops working.`)))return;m(!0);let e=await f({environmentId:n,input:{id:r.id}});m(!1),e._tag===`Failure`&&!ee(e)&&R.add(ce({type:`error`,title:`Could not rotate webhook URL`,description:String(te(e))}))},t[8]=n,t[9]=f,t[10]=r,t[11]=x):x=t[11];let C=x,w;t[12]===v?w=t[13]:(w=(0,$.jsx)(_e,{readOnly:!0,"aria-label":`Webhook URL`,value:v,onFocus:Dt}),t[12]=v,t[13]=w);let T=!y,E;t[14]!==l||t[15]!==v?(E=()=>l(v,void 0),t[14]=l,t[15]=v,t[16]=E):E=t[16];let D;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,$.jsx)(S,{}),t[17]=D):D=t[17];let O=u?`Copied`:`Copy`,k;t[18]!==O||t[19]!==T||t[20]!==E?(k=(0,$.jsxs)(g,{size:`sm`,variant:`outline`,type:`button`,disabled:T,onClick:E,children:[D,O]}),t[18]=O,t[19]=T,t[20]=E,t[21]=k):k=t[21];let ne=p||!o,A;t[22]===C?A=t[23]:(A=()=>void C(),t[22]=C,t[23]=A);let j;t[24]!==ne||t[25]!==A?(j=(0,$.jsx)(g,{size:`sm`,variant:`outline`,type:`button`,disabled:ne,onClick:A,children:`Rotate`}),t[24]=ne,t[25]=A,t[26]=j):j=t[26];let M;t[27]!==k||t[28]!==j||t[29]!==w?(M=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[w,k,j]}),t[27]=k,t[28]=j,t[29]=w,t[30]=M):M=t[30];let N;t[31]===b?N=t[32]:(N=b===null?null:(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:b}),t[31]=b,t[32]=N);let P;t[33]!==h.url||t[34]!==n?(P=h.url===null?null:(0,$.jsx)(Ot,{environmentId:n}),t[33]=h.url,t[34]=n,t[35]=P):P=t[35];let F;return t[36]!==M||t[37]!==N||t[38]!==P?(F=(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[M,N,P]}),t[36]=M,t[37]=N,t[38]=P,t[39]=F):F=t[39],F}function Dt(e){return e.currentTarget.select()}function Ot(e){let t=(0,tt.c)(3),{environmentId:n}=e,r=Be();if(r.target?.environmentId!==n||r.data===null)return null;let i=r.data.holdWebhooksWhileOffline?`Held for up to 24 hours while this environment is offline. `:`Forwarded live. Requests fail while this environment is offline. `,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(L,{to:`/settings/connections`,className:`underline underline-offset-2`,children:`Change in Connections`}),t[0]=a):a=t[0];let o;return t[1]===i?o=t[2]:(o=(0,$.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[i,a]}),t[1]=i,t[2]=o),o}function kt(e){let t=(0,tt.c)(203),{initialEnvironmentId:n,initialThreadId:r,initialProjectId:l,task:u,onClose:d}=e,{scope:f,connectedEnvironments:p}=Ne(),[_,v]=(0,Q.useState)(n),y=re(_),b=y?.connection.phase===`connected`&&y.serverConfig!==null,x;t[0]!==b||t[1]!==_?(x=b?U.scheduledTasksLive({environmentId:_,input:{}}):null,t[0]=b,t[1]=_,t[2]=x):x=t[2];let S=oe(x),C=k(),w;if(t[3]!==C||t[4]!==_||t[5]!==f){let e;t[7]!==_||t[8]!==f?(e=e=>e.environmentId===_&&Ue(f,_,e.id),t[7]=_,t[8]=f,t[9]=e):e=t[9],w=C.filter(e),t[3]=C,t[4]=_,t[5]=f,t[6]=w}else w=t[6];let T=w,E=H(_),D=i(U.providersValueAtom(_))??ie,O;t[10]===_?O=t[11]:(O=U.upsertScheduledTask.permissionAtom(_),t[10]=_,t[11]=O);let ne=i(O),A;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(A={label:`scheduled task upsert`},t[12]=A):A=t[12];let j=se(U.upsertScheduledTask,A),L;t[13]!==l||t[14]!==r||t[15]!==T[0]?.id||t[16]!==u?(L=()=>u?Ve(u):{...ft,projectId:l??T[0]?.id??``,threadId:r??``},t[13]=l,t[14]=r,t[15]=T[0]?.id,t[16]=u,t[17]=L):L=t[17];let[R,z]=(0,Q.useState)(L),[B,V]=(0,Q.useState)(!1),ce=(0,Q.useRef)(!1),le;t[18]!==R.editingId||t[19]!==S.data?(le=R.editingId!==null&&S.data!==null&&!S.data.tasks.some(e=>e.id===R.editingId),t[18]=R.editingId,t[19]=S.data,t[20]=le):le=t[20];let W=le,G;t[21]!==R.editingId||t[22]!==u||t[23]!==S.data?(G=S.data?S.data.tasks.find(e=>e.id===R.editingId)??null:u,t[21]=R.editingId,t[22]=u,t[23]=S.data,t[24]=G):G=t[24];let K=G,q=R.projectId||T[0]?.id||``,fe;if(t[25]!==T||t[26]!==q){let e;t[28]===q?e=t[29]:(e=e=>e.id===q,t[28]=q,t[29]=e),fe=T.find(e),t[25]=T,t[26]=q,t[27]=fe}else fe=t[27];let Y=fe;Y?.id;let X;t[30]!==D||t[31]!==Y?.id||t[32]!==E?(X=o(c(a(D),E,Y?.id??null)),t[30]=D,t[31]=Y?.id,t[32]=E,t[33]=X):X=t[33];let pe=X,me=pe[0],Z;t[34]===R.modelKey?Z=t[35]:(Z=R.modelKey?mt(R.modelKey):null,t[34]=R.modelKey,t[35]=Z);let he=Z,ge;t[36]!==he||t[37]!==pe||t[38]!==Y||t[39]!==E?(ge=he&&pe.some(e=>e.instanceId===he.instanceId&&e.enabled)?he:He(E,Y??null,pe),t[36]=he,t[37]=pe,t[38]=Y,t[39]=E,t[40]=ge):ge=t[40];let ve=ge,De=ve?.instanceId??me?.instanceId??``,Oe=ve?.model??``,ke;t[41]!==De||t[42]!==Oe||t[43]!==D||t[44]!==E?(ke=s(E,D,De,Oe),t[41]=De,t[42]=Oe,t[43]=D,t[44]=E,t[45]=ke):ke=t[45];let Ae=ke,je=Pt,Pe;t[46]!==ve||t[47]!==b||t[48]!==R||t[49]!==W||t[50]!==_||t[51]!==K||t[52]!==d||t[53]!==T||t[54]!==B||t[55]!==q||t[56]!==S.data||t[57]!==j?(Pe=async()=>{if(!ae(_,`orchestration:operate`)||ce.current||B||W||!b||S.data===null)return;let e=ve;if(!R.title.trim()||!R.prompt.trim()||!T.some(e=>e.id===q)||e===null){je(`Scheduled task is incomplete`,`Add a title, prompt, project, and model.`);return}let t=We(R);if(t===null){je(`Invalid age limit`,`Enter whole minutes from 1 to ${m}, or leave it blank.`);return}if(t.type===`webhook`&&t.signature&&(!t.signature.header||!t.signature.secret&&!(K?.schedule.type===`webhook`&&K.webhook?.hasSecret))){je(`Signing secret is required`,`Enter the signature header and secret.`);return}if(t.type===`interval`&&(!Number.isSafeInteger(t.everyMs)||t.everyMs<6e4)){je(`Invalid interval`,`Enter an interval of at least one minute.`);return}if(R.workspaceMode===`existing_worktree`&&!R.existingWorktreePath.trim()){je(`Checkout path is required`,`Enter the path of the checkout to run in.`);return}let n=R.baseModelSelection!==null&&R.baseModelSelection.instanceId===e.instanceId&&R.baseModelSelection.model===e.model?R.baseModelSelection:e,r=R.workspaceMode===`root`?{type:`root`}:R.workspaceMode===`existing_worktree`?{type:`existing_worktree`,worktreePath:R.existingWorktreePath.trim()}:{type:R.workspaceMode,baseRef:R.baseRef.trim()||`main`,startFromOrigin:R.startFromOrigin},i={...R.editingId?{id:R.editingId,requireExisting:!0}:{},title:R.title.trim(),prompt:R.prompt.trim(),enabled:R.enabled,schedule:t,projectId:q,threadId:R.threadId?R.threadId:null,workspaceStrategy:r,modelSelection:n,runtimeMode:R.runtimeMode,interactionMode:R.interactionMode,creationSource:`web`};ce.current=!0,V(!0);let a=await j({environmentId:_,input:i});if(V(!1),a._tag===`Failure`){ce.current=!1,ee(a)||je(`Could not save scheduled task`,te(a));return}d()},t[46]=ve,t[47]=b,t[48]=R,t[49]=W,t[50]=_,t[51]=K,t[52]=d,t[53]=T,t[54]=B,t[55]=q,t[56]=S.data,t[57]=j,t[58]=Pe):Pe=t[58];let Fe=Pe,Ie;t[59]!==d||t[60]!==B?(Ie=e=>{!e&&!B&&d()},t[59]=d,t[60]=B,t[61]=Ie):Ie=t[61];let Re=R.editingId?`Edit task`:`New task`,ze;t[62]===Re?ze=t[63]:(ze=(0,$.jsx)(be,{children:Re}),t[62]=Re,t[63]=ze);let Be;t[64]===Symbol.for(`react.memo_cache_sentinel`)?(Be=(0,$.jsx)(we,{children:`Run a prompt automatically — on an interval, at a fixed time, or when a webhook is called.`}),t[64]=Be):Be=t[64];let Ke;t[65]===ze?Ke=t[66]:(Ke=(0,$.jsxs)(ye,{children:[ze,Be]}),t[65]=ze,t[66]=Ke);let Ye;t[67]===b?Ye=t[68]:(Ye=b?null:(0,$.jsx)(`p`,{className:`text-sm text-destructive`,children:`Reconnect this environment before saving.`}),t[67]=b,t[68]=Ye);let Xe=u!==null||B,Ze;t[69]===p?Ze=t[70]:(Ze=e=>{let t=p.find(t=>t.environmentId===e);t&&(v(t.environmentId),z(Nt))},t[69]=p,t[70]=Ze);let Qe=y?.serverConfig??null,$e;t[71]===Qe?$e=t[72]:($e=h(Qe),t[71]=Qe,t[72]=$e);let nt;t[73]===$e?nt=t[74]:(nt=(0,$.jsx)(Me,{kind:$e,className:`size-4`}),t[73]=$e,t[74]=nt);let rt=y?.label??`Unavailable environment`,it;t[75]!==nt||t[76]!==rt?(it=(0,$.jsx)(F,{id:`scheduled-task-environment`,size:`sm`,children:(0,$.jsx)(N,{children:(0,$.jsxs)(`span`,{className:`flex items-center gap-2`,children:[nt,rt]})})}),t[75]=nt,t[76]=rt,t[77]=it):it=t[77];let at;t[78]===p?at=t[79]:(at=p.map(Mt),t[78]=p,t[79]=at);let st;t[80]===at?st=t[81]:(st=(0,$.jsx)(P,{children:at}),t[80]=at,t[81]=st);let lt;t[82]!==_||t[83]!==Xe||t[84]!==Ze||t[85]!==it||t[86]!==st?(lt=(0,$.jsx)(pt,{label:`Runs on`,htmlFor:`scheduled-task-environment`,children:(0,$.jsxs)(I,{value:_,disabled:Xe,onValueChange:Ze,children:[it,st]})}),t[82]=_,t[83]=Xe,t[84]=Ze,t[85]=it,t[86]=st,t[87]=lt):lt=t[87];let ut;t[88]===S.error?ut=t[89]:(ut=S.error?(0,$.jsx)(`p`,{className:`text-sm text-destructive`,role:`status`,children:S.error}):null,t[88]=S.error,t[89]=ut);let ht;t[90]===W?ht=t[91]:(ht=W?(0,$.jsx)(`p`,{className:`text-xs text-destructive`,role:`status`,children:`This scheduled task no longer exists.`}):null,t[90]=W,t[91]=ht);let gt;t[92]===Symbol.for(`react.memo_cache_sentinel`)?(gt=e=>z(t=>({...t,title:e.target.value})),t[92]=gt):gt=t[92];let _t;t[93]===R.title?_t=t[94]:(_t=(0,$.jsx)(pt,{label:`Name`,htmlFor:`scheduled-task-title`,children:(0,$.jsx)(_e,{id:`scheduled-task-title`,placeholder:`e.g. Check for Sentry issues`,value:R.title,onChange:gt})}),t[93]=R.title,t[94]=_t);let vt;t[95]===Symbol.for(`react.memo_cache_sentinel`)?(vt=e=>z(t=>({...t,projectId:e??``})),t[95]=vt):vt=t[95];let yt=Y?.title,bt;t[96]===yt?bt=t[97]:(bt=(0,$.jsx)(F,{size:`sm`,id:`scheduled-task-project`,children:(0,$.jsx)(N,{placeholder:`Select a project`,children:yt})}),t[96]=yt,t[97]=bt);let xt;t[98]===T?xt=t[99]:(xt=T.map(jt),t[98]=T,t[99]=xt);let St;t[100]===xt?St=t[101]:(St=(0,$.jsx)(P,{children:xt}),t[100]=xt,t[101]=St);let Ct;t[102]!==q||t[103]!==bt||t[104]!==St?(Ct=(0,$.jsx)(pt,{label:`Project`,htmlFor:`scheduled-task-project`,children:(0,$.jsxs)(I,{value:q,onValueChange:vt,children:[bt,St]})}),t[102]=q,t[103]=bt,t[104]=St,t[105]=Ct):Ct=t[105];let wt;t[106]===Symbol.for(`react.memo_cache_sentinel`)?(wt=e=>z(t=>({...t,workspaceMode:e})),t[106]=wt):wt=t[106];let Tt=dt[R.workspaceMode],Dt;t[107]===Tt?Dt=t[108]:(Dt=(0,$.jsx)(F,{size:`sm`,id:`scheduled-task-workspace`,children:(0,$.jsx)(N,{children:Tt})}),t[107]=Tt,t[108]=Dt);let Ot;t[109]===Symbol.for(`react.memo_cache_sentinel`)?(Ot=(0,$.jsxs)(P,{children:[(0,$.jsx)(M,{value:`auto`,children:`Choose automatically`}),(0,$.jsx)(M,{value:`worktree`,children:`Create a new worktree`}),(0,$.jsx)(M,{value:`root`,children:`Use the project checkout`}),(0,$.jsx)(M,{value:`existing_worktree`,children:`Use a specific checkout`})]}),t[109]=Ot):Ot=t[109];let kt;t[110]!==R.workspaceMode||t[111]!==Dt?(kt=(0,$.jsx)(pt,{label:`Workspace`,htmlFor:`scheduled-task-workspace`,children:(0,$.jsxs)(I,{value:R.workspaceMode,onValueChange:wt,children:[Dt,Ot]})}),t[110]=R.workspaceMode,t[111]=Dt,t[112]=kt):kt=t[112];let Ft;t[113]!==Ct||t[114]!==kt?(Ft=(0,$.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[Ct,kt]}),t[113]=Ct,t[114]=kt,t[115]=Ft):Ft=t[115];let It;t[116]!==b||t[117]!==R.baseRef||t[118]!==R.startFromOrigin||t[119]!==R.workspaceMode||t[120]!==_||t[121]!==B||t[122]!==Y?.workspaceRoot||t[123]!==q?(It=R.workspaceMode===`worktree`||R.workspaceMode===`auto`?(0,$.jsx)(pt,{label:`Base branch`,htmlFor:`scheduled-task-base-ref`,children:(0,$.jsx)(ot,{id:`scheduled-task-base-ref`,environmentId:_,cwd:Y?.workspaceRoot??null,value:R.baseRef,onValueChange:e=>z(t=>({...t,baseRef:e})),startFromOrigin:R.startFromOrigin,onStartFromOriginChange:e=>z(t=>({...t,startFromOrigin:e})),disabled:B||!b},`${_}:${q}`)}):null,t[116]=b,t[117]=R.baseRef,t[118]=R.startFromOrigin,t[119]=R.workspaceMode,t[120]=_,t[121]=B,t[122]=Y?.workspaceRoot,t[123]=q,t[124]=It):It=t[124];let Lt;t[125]!==R.existingWorktreePath||t[126]!==R.workspaceMode?(Lt=R.workspaceMode===`existing_worktree`?(0,$.jsx)(pt,{label:`Checkout path`,htmlFor:`scheduled-task-checkout`,children:(0,$.jsx)(_e,{id:`scheduled-task-checkout`,value:R.existingWorktreePath,placeholder:`/path/to/checkout`,onChange:e=>z(t=>({...t,existingWorktreePath:e.target.value}))})}):null,t[125]=R.existingWorktreePath,t[126]=R.workspaceMode,t[127]=Lt):Lt=t[127];let Rt;t[128]===Symbol.for(`react.memo_cache_sentinel`)?(Rt=e=>z(t=>({...t,prompt:e.target.value})),t[128]=Rt):Rt=t[128];let zt;t[129]===R.prompt?zt=t[130]:(zt=(0,$.jsx)(pt,{label:`Prompt`,htmlFor:`scheduled-task-prompt`,children:(0,$.jsx)(ue,{id:`scheduled-task-prompt`,className:`max-h-64 overflow-y-auto`,placeholder:`What should the agent do each time this runs?`,value:R.prompt,onChange:Rt})}),t[129]=R.prompt,t[130]=zt);let Bt=B||!b,Vt;t[131]===Symbol.for(`react.memo_cache_sentinel`)?(Vt=(e,t)=>z(n=>({...n,modelKey:`${e}:${t}`})),t[131]=Vt):Vt=t[131];let Ht;t[132]!==De||t[133]!==Oe||t[134]!==_||t[135]!==pe||t[136]!==Ae||t[137]!==Bt?(Ht=(0,$.jsx)(pt,{label:`Model`,children:(0,$.jsx)(`div`,{children:(0,$.jsx)(et,{environmentId:_,disabled:Bt,activeInstanceId:De,model:Oe,lockedProvider:null,instanceEntries:pe,modelOptionsByInstance:Ae,isComposerOwned:!1,triggerClassName:Le,onInstanceModelChange:Vt})})}),t[132]=De,t[133]=Oe,t[134]=_,t[135]=pe,t[136]=Ae,t[137]=Bt,t[138]=Ht):Ht=t[138];let Ut;t[139]===u?Ut=t[140]:(Ut=u?.schedule.type===`interval`&&u.schedule.everyMs<6e4?(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,role:`status`,children:`This task uses a legacy interval below one minute. Saving updates it to at least one minute.`}):null,t[139]=u,t[140]=Ut);let Wt;t[141]===Symbol.for(`react.memo_cache_sentinel`)?(Wt=(0,$.jsx)(Je,{children:`Schedule`}),t[141]=Wt):Wt=t[141];let Gt;t[142]===R.scheduleMode?Gt=t[143]:(Gt=[R.scheduleMode],t[142]=R.scheduleMode,t[143]=Gt);let Kt,qt,Jt,Yt;t[144]===Symbol.for(`react.memo_cache_sentinel`)?(Kt=e=>{let t=e[0];(t===`fixed`||t===`interval`||t===`webhook`)&&z(e=>({...e,scheduleMode:t,prompt:t===`webhook`&&!e.prompt.trim()?Ge:e.prompt}))},qt=(0,$.jsx)(J,{value:`fixed`,children:`At a time`}),Jt=(0,$.jsx)(J,{value:`interval`,children:`Every interval`}),Yt=(0,$.jsx)(J,{value:`webhook`,children:`On webhook`}),t[144]=Kt,t[145]=qt,t[146]=Jt,t[147]=Yt):(Kt=t[144],qt=t[145],Jt=t[146],Yt=t[147]);let Xt;t[148]===Gt?Xt=t[149]:(Xt=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[Wt,(0,$.jsxs)(de,{"aria-label":`Schedule type`,value:Gt,onValueChange:Kt,children:[qt,Jt,Yt]})]}),t[148]=Gt,t[149]=Xt);let Zt;t[150]!==R.intervalMinutes||t[151]!==R.maxDeliveryAgeMinutes||t[152]!==R.scheduleMode||t[153]!==R.signatureEnabled||t[154]!==R.signatureEncoding||t[155]!==R.signatureHeader||t[156]!==R.signaturePrefix||t[157]!==R.signatureSecret||t[158]!==R.timeOfDay||t[159]!==R.weekdays||t[160]!==_||t[161]!==K?(Zt=R.scheduleMode===`webhook`?(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsx)(Et,{environmentId:_,task:K}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Each request runs the prompt. Use {{body.path}}, {{headers.name}}, {{query.name}}, {{body}} or {{request}} in the prompt; only what it names reaches the agent.`}),(0,$.jsx)(pt,{label:`Skip requests older than`,hint:`minutes, optional`,htmlFor:`scheduled-task-max-age`,children:(0,$.jsx)(_e,{id:`scheduled-task-max-age`,type:`number`,nativeInput:!0,min:1,max:m,placeholder:`Run every request`,value:R.maxDeliveryAgeMinutes,onChange:e=>z(t=>({...t,maxDeliveryAgeMinutes:e.target.value}))})}),(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,$.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,$.jsx)(Je,{htmlFor:`scheduled-task-signature`,children:`Require signature`}),(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Reject requests without a valid HMAC-SHA256 signature of the body.`})]}),(0,$.jsx)(qe,{id:`scheduled-task-signature`,checked:R.signatureEnabled,onCheckedChange:e=>z(t=>({...t,signatureEnabled:e}))})]}),R.signatureEnabled?(0,$.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,$.jsx)(pt,{label:`Header`,htmlFor:`scheduled-task-signature-header`,children:(0,$.jsx)(_e,{id:`scheduled-task-signature-header`,value:R.signatureHeader,onChange:e=>z(t=>({...t,signatureHeader:e.target.value}))})}),(0,$.jsx)(pt,{label:`Prefix`,htmlFor:`scheduled-task-signature-prefix`,children:(0,$.jsx)(_e,{id:`scheduled-task-signature-prefix`,value:R.signaturePrefix,placeholder:`None`,onChange:e=>z(t=>({...t,signaturePrefix:e.target.value}))})}),(0,$.jsx)(pt,{label:`Encoding`,htmlFor:`scheduled-task-signature-encoding`,children:(0,$.jsxs)(I,{value:R.signatureEncoding,onValueChange:e=>z(t=>({...t,signatureEncoding:e===`base64`?`base64`:`hex`})),children:[(0,$.jsx)(F,{size:`sm`,id:`scheduled-task-signature-encoding`,children:(0,$.jsx)(N,{children:R.signatureEncoding})}),(0,$.jsxs)(P,{children:[(0,$.jsx)(M,{value:`hex`,children:`hex`}),(0,$.jsx)(M,{value:`base64`,children:`base64`})]})]})}),(0,$.jsx)(pt,{label:`Secret`,htmlFor:`scheduled-task-signature-secret`,children:(0,$.jsx)(_e,{id:`scheduled-task-signature-secret`,type:`password`,autoComplete:`off`,value:R.signatureSecret,placeholder:K?.schedule.type===`webhook`&&K.webhook?.hasSecret?`Unchanged`:`Shared secret`,onChange:e=>z(t=>({...t,signatureSecret:e.target.value}))})})]}):null]}):R.scheduleMode===`fixed`?(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(Je,{htmlFor:`scheduled-task-time`,children:`Run at`}),(0,$.jsx)(_e,{type:`time`,id:`scheduled-task-time`,nativeInput:!0,className:`w-32`,value:R.timeOfDay,onChange:e=>z(t=>({...t,timeOfDay:e.target.value}))}),(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`on`})]}),(0,$.jsx)(de,{multiple:!0,variant:`outline`,size:`sm`,"aria-label":`Days to run`,value:[...R.weekdays].map(String),onValueChange:e=>{e.length!==0&&z(t=>({...t,weekdays:new Set(e.map(Number))}))},children:ct.map(At)})]}):(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(Je,{htmlFor:`scheduled-task-interval`,children:`Run every`}),(0,$.jsx)(_e,{type:`number`,id:`scheduled-task-interval`,nativeInput:!0,min:1,step:`any`,className:`w-24`,value:R.intervalMinutes,onChange:e=>z(t=>({...t,intervalMinutes:e.target.value}))}),(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`minutes`})]}),t[150]=R.intervalMinutes,t[151]=R.maxDeliveryAgeMinutes,t[152]=R.scheduleMode,t[153]=R.signatureEnabled,t[154]=R.signatureEncoding,t[155]=R.signatureHeader,t[156]=R.signaturePrefix,t[157]=R.signatureSecret,t[158]=R.timeOfDay,t[159]=R.weekdays,t[160]=_,t[161]=K,t[162]=Zt):Zt=t[162];let Qt;t[163]!==Ut||t[164]!==Xt||t[165]!==Zt?(Qt=(0,$.jsxs)(`div`,{className:`space-y-3`,children:[Ut,Xt,Zt]}),t[163]=Ut,t[164]=Xt,t[165]=Zt,t[166]=Qt):Qt=t[166];let $t;t[167]===Symbol.for(`react.memo_cache_sentinel`)?($t=(0,$.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,$.jsx)(Je,{htmlFor:`scheduled-task-enabled`,children:`Enabled`}),(0,$.jsx)(`p`,{id:`scheduled-task-enabled-description`,className:`text-sm text-muted-foreground`,children:`Disabled tasks stay saved but do not run.`})]}),t[167]=$t):$t=t[167];let en;t[168]===Symbol.for(`react.memo_cache_sentinel`)?(en=e=>z(t=>({...t,enabled:e})),t[168]=en):en=t[168];let tn;t[169]===R.enabled?tn=t[170]:(tn=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[$t,(0,$.jsx)(qe,{id:`scheduled-task-enabled`,"aria-describedby":`scheduled-task-enabled-description`,checked:R.enabled,onCheckedChange:en})]}),t[169]=R.enabled,t[170]=tn);let nn;t[171]!==B||t[172]!==Ye||t[173]!==lt||t[174]!==ut||t[175]!==ht||t[176]!==_t||t[177]!==Ft||t[178]!==It||t[179]!==Lt||t[180]!==zt||t[181]!==Ht||t[182]!==Qt||t[183]!==tn?(nn=(0,$.jsx)(Ce,{children:(0,$.jsxs)(`fieldset`,{disabled:B,className:`space-y-5`,children:[Ye,lt,ut,ht,_t,Ft,It,Lt,zt,Ht,Qt,tn]})}),t[171]=B,t[172]=Ye,t[173]=lt,t[174]=ut,t[175]=ht,t[176]=_t,t[177]=Ft,t[178]=It,t[179]=Lt,t[180]=zt,t[181]=Ht,t[182]=Qt,t[183]=tn,t[184]=nn):nn=t[184];let rn;t[185]===B?rn=t[186]:(rn=(0,$.jsx)(Se,{render:(0,$.jsx)(g,{variant:`outline`,size:`sm`,disabled:B}),children:`Cancel`}),t[185]=B,t[186]=rn);let an=!ne||B||W||!b||!S.data,on;t[187]===Fe?on=t[188]:(on=()=>void Fe(),t[187]=Fe,t[188]=on);let sn=R.editingId?`Save task`:`Create task`,cn;t[189]!==an||t[190]!==on||t[191]!==sn?(cn=(0,$.jsx)(g,{size:`sm`,disabled:an,onClick:on,children:sn}),t[189]=an,t[190]=on,t[191]=sn,t[192]=cn):cn=t[192];let ln;t[193]!==rn||t[194]!==cn?(ln=(0,$.jsxs)(xe,{children:[rn,cn]}),t[193]=rn,t[194]=cn,t[195]=ln):ln=t[195];let un;t[196]!==Ke||t[197]!==nn||t[198]!==ln?(un=(0,$.jsxs)(Te,{className:`max-w-xl`,children:[Ke,nn,ln]}),t[196]=Ke,t[197]=nn,t[198]=ln,t[199]=un):un=t[199];let dn;return t[200]!==Ie||t[201]!==un?(dn=(0,$.jsx)(Ee,{open:!0,onOpenChange:Ie,children:un}),t[200]=Ie,t[201]=un,t[202]=dn):dn=t[202],dn}function At(e){return(0,$.jsx)(J,{value:String(e),"aria-label":lt[e],children:ut[e]},e)}function jt(e){return(0,$.jsx)(M,{value:e.id,children:e.title},e.id)}function Mt(e){return(0,$.jsxs)(M,{value:e.environmentId,children:[(0,$.jsx)(Me,{kind:h(e.serverConfig),className:`size-4`}),e.label]},e.environmentId)}function Nt(e){return{...e,projectId:``,modelKey:``,baseModelSelection:null,baseRef:`main`,startFromOrigin:!0,existingWorktreePath:``}}function Pt(e,t){R.add(ce({type:`error`,title:e,description:t instanceof Error?t.message:String(t)}))}export{it as a,nt as i,gt as n,ht as r,bt as t};
4
- //# sourceMappingURL=ScheduledTasksSettings-DFtwNfb8.js.map