@p4code/cli 0.8.23 → 0.8.25

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 (217) hide show
  1. package/dist/bin.mjs +1 -1
  2. package/dist/{binCli-DzKk3bdm.mjs → binCli-DxnOvHXE.mjs} +610 -480
  3. package/dist/client/.vite/manifest.json +1319 -1319
  4. package/dist/client/assets/{AuthSurfaceShell-DJcUG_EN.js → AuthSurfaceShell-CDrUzEa3.js} +2 -2
  5. package/dist/client/assets/{ChatGptUsageButton-BDCO7XMy.js → ChatGptUsageButton-DkUVOC7j.js} +2 -2
  6. package/dist/client/assets/{ChatMarkdown-CDno8Ayh.js → ChatMarkdown-1bLgD-eb.js} +4 -4
  7. package/dist/client/assets/{CodexSetupSection.logic-BB9JxUR1.js → CodexSetupSection.logic-BGYo_Oa-.js} +2 -2
  8. package/dist/client/assets/{CommandBlock-DQi0VdAG.js → CommandBlock-C1v99dbA.js} +2 -2
  9. package/dist/client/assets/{ComposerPromptEditor-DCjk2_nI.js → ComposerPromptEditor-C462LHSn.js} +4 -4
  10. package/dist/client/assets/{DevicePanel-D192Fic3.js → DevicePanel-DoPmTqL7.js} +2 -2
  11. package/dist/client/assets/{DeviceSetup-D9F7F9pV.js → DeviceSetup-D1v4OInd.js} +2 -2
  12. package/dist/client/assets/{DiffCommentAnnotation-mA-RZ8Su.js → DiffCommentAnnotation-ByLSJGCC.js} +2 -2
  13. package/dist/client/assets/{DiffFileTree-CaPQB8J4.js → DiffFileTree-DmXODV6-.js} +2 -2
  14. package/dist/client/assets/{DiffPanel-3G1enpU9.js → DiffPanel-DKvM9n17.js} +2 -2
  15. package/dist/client/assets/{DiffWorkerPoolProvider-BOInEqDW.js → DiffWorkerPoolProvider-31z0fGQ6.js} +2 -2
  16. package/dist/client/assets/{EmbeddedDesign-D97sS_-D.js → EmbeddedDesign-CJh4mXjr.js} +2 -2
  17. package/dist/client/assets/{FileDiff-DLYKd8S8.js → FileDiff-Cb7Q8DoF.js} +2 -2
  18. package/dist/client/assets/{FilePreviewPanel-BCtCBzc7.js → FilePreviewPanel-CN68pCae.js} +2 -2
  19. package/dist/client/assets/{FoldedSettingsSection-BIr-uvTu.js → FoldedSettingsSection-TSMWCMo5.js} +2 -2
  20. package/dist/client/assets/{NoProjectsHero-Dj3URl4e.js → NoProjectsHero-B5wdlXLT.js} +2 -2
  21. package/dist/client/assets/{P4ConnectAccountPages-CFPHk3YU.js → P4ConnectAccountPages-BNv1XOMs.js} +2 -2
  22. package/dist/client/assets/{P4ConnectSidebarSignIn-BMrzp8XI.js → P4ConnectSidebarSignIn-BqW3vURC.js} +2 -2
  23. package/dist/client/assets/{PanelLayoutControls-C1Bf67DQ.js → PanelLayoutControls-CJ69MZ4v.js} +4 -4
  24. package/dist/client/assets/{PierreEntryIcon--dw21QmY.js → PierreEntryIcon-BS77_eRn.js} +2 -2
  25. package/dist/client/assets/{PreviewPanel-DCqFsoQM.js → PreviewPanel-pImDpkWH.js} +2 -2
  26. package/dist/client/assets/{ProjectDefaultsSettings-B4srG1Zj.js → ProjectDefaultsSettings-DY_6-1vn.js} +2 -2
  27. package/dist/client/assets/{ProjectFavicon--HkFaTb7.js → ProjectFavicon-Bhsql8UU.js} +3 -3
  28. package/dist/client/assets/{ProjectIconPickerDialog-Bl6Uid40.js → ProjectIconPickerDialog-D1bu7Uyx.js} +2 -2
  29. package/dist/client/assets/{ProviderAuthTerminal-njw98kWo.js → ProviderAuthTerminal-BRbiaLWc.js} +2 -2
  30. package/dist/client/assets/{ProviderModelPicker-DBjdgQjr.js → ProviderModelPicker-DqLbhWdo.js} +2 -2
  31. package/dist/client/assets/{ProviderSettingsForm-_kCwzsZ5.js → ProviderSettingsForm-DLBbky90.js} +2 -2
  32. package/dist/client/assets/{PullRequestCodeTab-2OTuKeLP.js → PullRequestCodeTab-CKppy0OY.js} +2 -2
  33. package/dist/client/assets/{ReadOnlySourcePreview-BfF8Dhuk.js → ReadOnlySourcePreview-BJ6Yf9Nm.js} +2 -2
  34. package/dist/client/assets/{RenderErrorBoundary-CReszKsZ.js → RenderErrorBoundary-DQlXjNRV.js} +2 -2
  35. package/dist/client/assets/{ScheduledTasksSettings-BJ6fD98R.js → ScheduledTasksSettings-DY0ICix9.js} +2 -2
  36. package/dist/client/assets/{ScopedSwitch-QH2iiv6j.js → ScopedSwitch-Ciu5HpYa.js} +2 -2
  37. package/dist/client/assets/{SettingsPanels-BRQsxDAj.js → SettingsPanels-D8LJq_2u.js} +2 -2
  38. package/dist/client/assets/{SettingsPanels.logic-DADnLbJa.js → SettingsPanels.logic-Dn4swS42.js} +2 -2
  39. package/dist/client/assets/{SettingsScopeNotice-D8WXgfaz.js → SettingsScopeNotice-FZ1p4m0I.js} +2 -2
  40. package/dist/client/assets/{ThemeEditorPanel-UEzfMVAc.js → ThemeEditorPanel-CyGAzSmS.js} +2 -2
  41. package/dist/client/assets/{ThreadTerminalDrawer-Do19kCZu.js → ThreadTerminalDrawer-COPVkKqd.js} +2 -2
  42. package/dist/client/assets/{Virtualizer-BSpDafyf.js → Virtualizer-Cy8TBFLE.js} +2 -2
  43. package/dist/client/assets/{_chat-D4YotsBW.js → _chat-CWIHenSN.js} +6 -6
  44. package/dist/client/assets/{_chat.design-BPvdgNpo.js → _chat.design-CmJbkQbO.js} +2 -2
  45. package/dist/client/assets/{_chat.index-Z_VqAv7I.js → _chat.index-6PXQMCFp.js} +2 -2
  46. package/dist/client/assets/{_chat.new-DOi-AUHb.js → _chat.new-DlduiMxM.js} +2 -2
  47. package/dist/client/assets/{_chat.pull-requests-6QyjmUBZ.js → _chat.pull-requests-BVZO85Vs.js} +2 -2
  48. package/dist/client/assets/{abnfDiagram-VCTEODGH--jeYDB6y.js → abnfDiagram-VCTEODGH-DoT8_FXH.js} +2 -2
  49. package/dist/client/assets/architecture-7GRP2DOG-ZioZXeD8.js +1 -0
  50. package/dist/client/assets/{architectureDiagram-5GKGNRK7-CZT297Q4.js → architectureDiagram-5GKGNRK7-HFFuwzkK.js} +2 -2
  51. package/dist/client/assets/{assets-CJFG5Oow.js → assets-v9gHTSJ2.js} +2 -2
  52. package/dist/client/assets/{blockDiagram-I7D4REHJ-EkNtHyvf.js → blockDiagram-I7D4REHJ-Df3TzjDM.js} +2 -2
  53. package/dist/client/assets/{browserHistoryStore-DO5WuJ8O.js → browserHistoryStore-DY3kofkL.js} +2 -2
  54. package/dist/client/assets/{browserLinkTarget-CJGymzWC.js → browserLinkTarget-BHJMZNAn.js} +2 -2
  55. package/dist/client/assets/{c4Diagram-7LVT6UL2-CWpB4Da8.js → c4Diagram-7LVT6UL2-Bx6hu1pT.js} +2 -2
  56. package/dist/client/assets/channel-BY4Mhil-.js +2 -0
  57. package/dist/client/assets/{chunk-4HAMMTFA-DmxkShmg.js → chunk-4HAMMTFA-DztP-PZY.js} +2 -2
  58. package/dist/client/assets/{chunk-75Z2AOVW-DR0PpYOm.js → chunk-75Z2AOVW-uoFI_96z.js} +2 -2
  59. package/dist/client/assets/{chunk-DU6HZSFF-BO8x-KoS.js → chunk-DU6HZSFF-D_0nd_m5.js} +2 -2
  60. package/dist/client/assets/{chunk-F27PBJKO-Bj6z3Mgi.js → chunk-F27PBJKO-CVo5wWUL.js} +2 -2
  61. package/dist/client/assets/{chunk-GMAD6QVW-DDPfmhbi.js → chunk-GMAD6QVW-DVJraU0z.js} +2 -2
  62. package/dist/client/assets/{chunk-GVQU2GXP-Dt2y3Ljq.js → chunk-GVQU2GXP-D1KDAS1u.js} +2 -2
  63. package/dist/client/assets/{chunk-IMKFNOWR-ulVnFkwU.js → chunk-IMKFNOWR-B4iQ5Hh8.js} +2 -2
  64. package/dist/client/assets/{chunk-L3NEJ4N5-Bq_d7JXK.js → chunk-L3NEJ4N5-Cg0GbrIO.js} +2 -2
  65. package/dist/client/assets/{chunk-OSK3NFVY-D3zjZoqS.js → chunk-OSK3NFVY-B4_CzVzL.js} +2 -2
  66. package/dist/client/assets/{chunk-P2QGCYS3-BO8zGK2Q.js → chunk-P2QGCYS3-DZOYqNgv.js} +2 -2
  67. package/dist/client/assets/{chunk-POPQ4Y6H-gzBrIuwg.js → chunk-POPQ4Y6H-4nivFn8h.js} +2 -2
  68. package/dist/client/assets/{chunk-PWAF6VOD-D5kNvXnl.js → chunk-PWAF6VOD-HbLsvJ11.js} +2 -2
  69. package/dist/client/assets/{chunk-SHT3W25Y-BUoRhLSC.js → chunk-SHT3W25Y-DFCZ-Krf.js} +2 -2
  70. package/dist/client/assets/{chunk-SVP7TREG-Bjv2VnZc.js → chunk-SVP7TREG-BvQW-XJf.js} +2 -2
  71. package/dist/client/assets/{chunk-TICWLB2K-DAdtg5Kx.js → chunk-TICWLB2K-BkfJ58tX.js} +2 -2
  72. package/dist/client/assets/classDiagram-ZZMXUADV-VEcRygcq.js +2 -0
  73. package/dist/client/assets/classDiagram-v2-VYDZK3BY-VEcRygcq.js +2 -0
  74. package/dist/client/assets/{composer-logic-LXlav2Vb.js → composer-logic-CwhwgR76.js} +2 -2
  75. package/dist/client/assets/{composerDraftUploads-ykQlcbPE.js → composerDraftUploads-DmqvTkwP.js} +2 -2
  76. package/dist/client/assets/{connect-BtrTxy8-.js → connect-DwVFJmN3.js} +2 -2
  77. package/dist/client/assets/{connect-agent-CVmArWh1.js → connect-agent-DEQZN1JX.js} +2 -2
  78. package/dist/client/assets/{cynefin-OW5HDTMX-DOViMxbO.js → cynefin-OW5HDTMX-4JOEXKIi.js} +1 -1
  79. package/dist/client/assets/{cynefinDiagram-5FMLGOSQ-BWRCt23-.js → cynefinDiagram-5FMLGOSQ-Drs4oZCg.js} +2 -2
  80. package/dist/client/assets/{dagre-GXQ25YYZ-DgnOAR1P.js → dagre-GXQ25YYZ-DKMbY0zs.js} +2 -2
  81. package/dist/client/assets/{design-D2FoGDbP.js → design-CNu64Zbr.js} +2 -2
  82. package/dist/client/assets/{device-CdLsoK0D.js → device-BLFqXUPD.js} +2 -2
  83. package/dist/client/assets/{diagram-S7CK7UJ4-C-BUdvbR.js → diagram-S7CK7UJ4-BadxuMFL.js} +2 -2
  84. package/dist/client/assets/{diagram-UQ7AKVKN-CYox921O.js → diagram-UQ7AKVKN-PnCAv0MQ.js} +2 -2
  85. package/dist/client/assets/{diagram-VSXAHHWV-CCHV1RQz.js → diagram-VSXAHHWV-Cny8HiZ9.js} +2 -2
  86. package/dist/client/assets/{diagram-VX7I27RA-B4SkxxZx.js → diagram-VX7I27RA-CRUGb_uz.js} +2 -2
  87. package/dist/client/assets/{diagram-Z3DM3KII-D80OJGVQ.js → diagram-Z3DM3KII-3me_mb7C.js} +2 -2
  88. package/dist/client/assets/{diffRendering-CdquEtfn.js → diffRendering-D5-wCc8J.js} +2 -2
  89. package/dist/client/assets/{dist-DWlOCBGN.js → dist-DJO3gX7B.js} +2 -2
  90. package/dist/client/assets/{duoViewer-Cig0lw70.js → duoViewer-DLfl5Kz-.js} +2 -2
  91. package/dist/client/assets/{dynamic-DUhOBcsP.js → dynamic-BtC962Ss.js} +2 -2
  92. package/dist/client/assets/{ebnfDiagram-PWID7BFC-AJpsDjYU.js → ebnfDiagram-PWID7BFC-CihgSPXH.js} +2 -2
  93. package/dist/client/assets/{embeddedScripts-DVwzRCwI.js → embeddedScripts-BYDwhk1c.js} +2 -2
  94. package/dist/client/assets/{entities-BBhhC0Ry.js → entities-BmcX1OB3.js} +2 -2
  95. package/dist/client/assets/{erDiagram-RLTQ6QDP-qU4wtJw2.js → erDiagram-RLTQ6QDP-F6qh1mx2.js} +2 -2
  96. package/dist/client/assets/eventmodeling-NTZA5JFV-CFX4D-ej.js +1 -0
  97. package/dist/client/assets/{fileLinks-16LrhkMX.js → fileLinks-D6tZCcrX.js} +2 -2
  98. package/dist/client/assets/{fileTreeExpansion-BwModZ8t.js → fileTreeExpansion-XMXwSF13.js} +2 -2
  99. package/dist/client/assets/flowDiagram-HODETNUW-fTwgLjbL.js +1 -0
  100. package/dist/client/assets/{ganttDiagram-EL5Y4UJY-CMa5sD7U.js → ganttDiagram-EL5Y4UJY-YGfup7SG.js} +2 -2
  101. package/dist/client/assets/{getDiffFileInput-CMp2lO2J.js → getDiffFileInput-CaAoEF2q.js} +2 -2
  102. package/dist/client/assets/ghostty-write-pty-BWDOU6dy.wasm +0 -0
  103. package/dist/client/assets/{gitGraph-4MIJSDKK-d8ivfU97.js → gitGraph-4MIJSDKK-lmNva9e6.js} +1 -1
  104. package/dist/client/assets/{gitGraphDiagram-WWUBYQGX-dltGGWCt.js → gitGraphDiagram-WWUBYQGX-doYkHAhC.js} +2 -2
  105. package/dist/client/assets/{guideRunStore-CKZDf9-2.js → guideRunStore-DgsITXCn.js} +2 -2
  106. package/dist/client/assets/{index-oiPu1asR.js → index-CfFLhAIJ.js} +3 -3
  107. package/dist/client/assets/{info-A6RAGUB7-B_ozJ3Df.js → info-A6RAGUB7-D_A6DQid.js} +1 -1
  108. package/dist/client/assets/{infoDiagram-27XIBGKW-BiB0fE5_.js → infoDiagram-27XIBGKW-BRwXCKSf.js} +2 -2
  109. package/dist/client/assets/{ishikawaDiagram-5VMMS53U-DhfuI9PX.js → ishikawaDiagram-5VMMS53U-C7LnJqXH.js} +2 -2
  110. package/dist/client/assets/{journeyDiagram-3NMN7TZE-8alknR0e.js → journeyDiagram-3NMN7TZE-BzOGENTa.js} +2 -2
  111. package/dist/client/assets/{kanban-definition-UXKFOSKX-IrCQ1z1D.js → kanban-definition-UXKFOSKX-COHFjuBb.js} +2 -2
  112. package/dist/client/assets/{line-wwHo_z2p.js → line-CrPHt5m8.js} +2 -2
  113. package/dist/client/assets/{linkedPrompt-P6UqYCja.js → linkedPrompt-DcngDDYL.js} +2 -2
  114. package/dist/client/assets/{main-COMts6-0.js → main-DTxzRLjF.js} +7 -7
  115. package/dist/client/assets/{mediaReference-C10FT-nO.js → mediaReference-DZXLlXcJ.js} +2 -2
  116. package/dist/client/assets/{mediaSource-tGWQYhPt.js → mediaSource-gPZdDlVt.js} +2 -2
  117. package/dist/client/assets/{mermaid-parser.core-YE1Gxotj.js → mermaid-parser.core-DWtiDQYU.js} +4 -4
  118. package/dist/client/assets/{mermaid.core-DE9uOpTH.js → mermaid.core-BFUbfTlG.js} +5 -5
  119. package/dist/client/assets/{mindmap-definition-YA3MSWOX-CLa2hbBW.js → mindmap-definition-YA3MSWOX-DBtRzghf.js} +2 -2
  120. package/dist/client/assets/{onboarding-DCwprQF7.js → onboarding-DrdqSiQH.js} +2 -2
  121. package/dist/client/assets/{openFileInPreview-Dj9ZUFfJ.js → openFileInPreview-weURIMTS.js} +2 -2
  122. package/dist/client/assets/{p4ProjectFile-DfE23uqD.js → p4ProjectFile-B8OhdeMF.js} +2 -2
  123. package/dist/client/assets/{packet-AYTQ26CC-Be9nXFns.js → packet-AYTQ26CC-DJZVK2K9.js} +1 -1
  124. package/dist/client/assets/{pair-CZDxH6ja.js → pair-gR_rTadh.js} +2 -2
  125. package/dist/client/assets/{pegDiagram-XKGWAZYB-C230ixTv.js → pegDiagram-XKGWAZYB-DDF_R7aG.js} +2 -2
  126. package/dist/client/assets/{phoneViewer-CdFM4t6r.js → phoneViewer-DxQG2wwP.js} +2 -2
  127. package/dist/client/assets/{pie-WAS4IAKB-DdxLVm9y.js → pie-WAS4IAKB-DdceO1sC.js} +1 -1
  128. package/dist/client/assets/{pieDiagram-E7YTZNPT-AK3e5d1A.js → pieDiagram-E7YTZNPT-BW2s3CyE.js} +2 -2
  129. package/dist/client/assets/{pierre-icons-BodtO6xC.js → pierre-icons-CFlecESq.js} +2 -2
  130. package/dist/client/assets/{preview-x-GNJPih.js → preview-Dz5JGjMV.js} +2 -2
  131. package/dist/client/assets/{primary-BDy4SXjC.js → primary-CREvWUGh.js} +2 -2
  132. package/dist/client/assets/{primaryCloudLinkState--Kh80aBj.js → primaryCloudLinkState-C-mUT5JX.js} +2 -2
  133. package/dist/client/assets/{projectFilesQueryState-Bb-3twEo.js → projectFilesQueryState-Au75qUTL.js} +2 -2
  134. package/dist/client/assets/{projectScriptEditor-CAk1a7Bv.js → projectScriptEditor-4NhfCuq1.js} +2 -2
  135. package/dist/client/assets/{providerSkills-9AaADmXt.js → providerSkills-BmzuNl-9.js} +2 -2
  136. package/dist/client/assets/{pullRequestDetail.logic-Fv7ouL_B.js → pullRequestDetail.logic-yPUei2ak.js} +2 -2
  137. package/dist/client/assets/{pullRequests-I9yJXxf5.js → pullRequests-BBLgbQTu.js} +2 -2
  138. package/dist/client/assets/{quadrantDiagram-AXDQQJYC-CcagVHbG.js → quadrantDiagram-AXDQQJYC-Bf2672qf.js} +2 -2
  139. package/dist/client/assets/{queries-DY5q7KFy.js → queries-BJzayyNh.js} +2 -2
  140. package/dist/client/assets/{radar-RG4KPBEZ-YiDR7Sp-.js → radar-RG4KPBEZ-BiG5ioV7.js} +1 -1
  141. package/dist/client/assets/{railroad-74A4TZTK-Cg9vU93U.js → railroad-74A4TZTK-DiRzkVRF.js} +1 -1
  142. package/dist/client/assets/railroad-abnf-HS5TGJTU-CyBZRJjf.js +1 -0
  143. package/dist/client/assets/railroad-ebnf-LZEXJU2U-7jpgdtqn.js +1 -0
  144. package/dist/client/assets/railroad-peg-WCYAUIDC-Bhvv4cdb.js +1 -0
  145. package/dist/client/assets/{railroadDiagram-O6MQD6OU-DKJFQoet.js → railroadDiagram-O6MQD6OU-BschbLXV.js} +2 -2
  146. package/dist/client/assets/{renderScheduler-skv2ZK84.js → renderScheduler-BgjQdysj.js} +2 -2
  147. package/dist/client/assets/{requirementDiagram-BXWQKSXE-CsnTqOO2.js → requirementDiagram-BXWQKSXE-DIHx2XKp.js} +2 -2
  148. package/dist/client/assets/{runtime-D-mOwjrE.js → runtime-DPOrcghx.js} +3 -3
  149. package/dist/client/assets/{runtime-BSS7jQw6.js → runtime-SBjACoAG.js} +2 -2
  150. package/dist/client/assets/{sankeyDiagram-P5KCCOFB-DkydPO4_.js → sankeyDiagram-P5KCCOFB-B37UMb9Z.js} +2 -2
  151. package/dist/client/assets/{scheduledTasksSettings.logic-C-rCAoCn.js → scheduledTasksSettings.logic-l7uZVAyW.js} +2 -2
  152. package/dist/client/assets/{sequenceDiagram-WJ2MYXX4-Df0N4Qqb.js → sequenceDiagram-WJ2MYXX4-BWWC8joI.js} +2 -2
  153. package/dist/client/assets/{server-WufAYYa2.js → server-BNs54wEo.js} +2 -2
  154. package/dist/client/assets/{session-pjgqVscl.js → session-CFXzhAhI.js} +2 -2
  155. package/dist/client/assets/{session-logic-VyTvpA5f.js → session-logic-Zk8ix8K9.js} +2 -2
  156. package/dist/client/assets/{settings-CsOciX79.js → settings-D8GZZ79P.js} +2 -2
  157. package/dist/client/assets/{settings.appearance-BTa_DZJP.js → settings.appearance-BGApKe_v.js} +2 -2
  158. package/dist/client/assets/settings.archived-QGKwBjUx.js +2 -0
  159. package/dist/client/assets/{settings.computer-use-0aB9RoDX.js → settings.computer-use-CeLystec.js} +2 -2
  160. package/dist/client/assets/{settings.connections-DUkG_06v.js → settings.connections-56mhuPd9.js} +2 -2
  161. package/dist/client/assets/{settings.data-controls-Cn2MWFbv.js → settings.data-controls-D607JRzk.js} +2 -2
  162. package/dist/client/assets/{settings.decisions-nRlfWokn.js → settings.decisions-C0aFb-Kn.js} +2 -2
  163. package/dist/client/assets/{settings.designs-CYIwYmP5.js → settings.designs-DLcNkfmF.js} +2 -2
  164. package/dist/client/assets/{settings.diagnostics-pCb9rEgL.js → settings.diagnostics-Bk9ZlqSV.js} +2 -2
  165. package/dist/client/assets/{settings.general-DPkJcwHC.js → settings.general-D8pNduE9.js} +2 -2
  166. package/dist/client/assets/{settings.integrations-DVMeSb1K.js → settings.integrations-CyPCeqvd.js} +2 -2
  167. package/dist/client/assets/{settings.keybindings-PZlDKFMi.js → settings.keybindings-B6cKpR8G.js} +2 -2
  168. package/dist/client/assets/{settings.open-source-licenses-CoY0kkph.js → settings.open-source-licenses-Cdo94wbK.js} +2 -2
  169. package/dist/client/assets/{settings.plugins-DCo7nzjN.js → settings.plugins-B1SQQuJ1.js} +2 -2
  170. package/dist/client/assets/{settings.projects-iA51Y3aj.js → settings.projects-HuCRzR1Z.js} +3 -3
  171. package/dist/client/assets/{settings.providers-BkUKaZF-.js → settings.providers-BsfVxPA5.js} +3 -3
  172. package/dist/client/assets/{settings.scheduled-tasks-C0FpV34l.js → settings.scheduled-tasks-Chug6jlO.js} +2 -2
  173. package/dist/client/assets/{settings.snap-shot-C29-fDJw.js → settings.snap-shot-Dvf_zwkG.js} +2 -2
  174. package/dist/client/assets/{settings.source-control-CqLszsPJ.js → settings.source-control-twI2L8vl.js} +2 -2
  175. package/dist/client/assets/{settings.storage-JCo0X6p0.js → settings.storage-af4E8nEQ.js} +2 -2
  176. package/dist/client/assets/{settingsLayout-DkRcMtAs.js → settingsLayout-BloLque1.js} +2 -2
  177. package/dist/client/assets/{sidebarProjectGrouping-C94BzdFc.js → sidebarProjectGrouping-DwnHgZqz.js} +2 -2
  178. package/dist/client/assets/{sourceControl-BvubWC9K.js → sourceControl-wI790oDs.js} +2 -2
  179. package/dist/client/assets/{sourceControlClients-DKVeNHGN.js → sourceControlClients-CKlG76Mu.js} +2 -2
  180. package/dist/client/assets/{stateDiagram-D77RDMKH-Ctp0qVPg.js → stateDiagram-D77RDMKH-D8v7Nh9y.js} +2 -2
  181. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-DymT6Xtk.js +2 -0
  182. package/dist/client/assets/{swimlanes-42K2YHIH-_LIKBAWu.js → swimlanes-42K2YHIH-8aPT3vMS.js} +2 -2
  183. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-CjvsefHc.js +9 -0
  184. package/dist/client/assets/{terminalSessions-WR45SySR.js → terminalSessions-BVJWTQ-r.js} +2 -2
  185. package/dist/client/assets/{timeline-definition-24CTP7MA--fH4g9Xi.js → timeline-definition-24CTP7MA-qKze8CmD.js} +2 -2
  186. package/dist/client/assets/{toast-x69BFrW5.js → toast-CfeQA1vM.js} +2 -2
  187. package/dist/client/assets/{treeView-Q6P3EWNA-BYF4NjYA.js → treeView-Q6P3EWNA-DHv3H0LY.js} +1 -1
  188. package/dist/client/assets/{treemap-WGGIJYW6-DTEnfmuA.js → treemap-WGGIJYW6-B3OEzWME.js} +1 -1
  189. package/dist/client/assets/{uiStateStore-CP4WDmc8.js → uiStateStore-DBCETYy3.js} +2 -2
  190. package/dist/client/assets/{usage-C8NW06hk.js → usage-C4KIRe38.js} +2 -2
  191. package/dist/client/assets/{use-atom-command-rhVarDA8.js → use-atom-command-BCNOgemk.js} +2 -2
  192. package/dist/client/assets/{useHandleNewThread-Bhl1v82B.js → useHandleNewThread-B116cHue.js} +2 -2
  193. package/dist/client/assets/{useP4ConnectAuthPrompt-ubtmHQ6f.js → useP4ConnectAuthPrompt-qVqxcT08.js} +2 -2
  194. package/dist/client/assets/{usePullRequestActions-Djf1UHJs.js → usePullRequestActions-CdOseawP.js} +2 -2
  195. package/dist/client/assets/{useScopedModelAvailability-BAzgc0gB.js → useScopedModelAvailability-DL2tq_KI.js} +2 -2
  196. package/dist/client/assets/{useSettings-BNs1IeKk.js → useSettings-DkjziVJm.js} +2 -2
  197. package/dist/client/assets/{vcsRefInvalidation-DmqB0sWy.js → vcsRefInvalidation-BPBh7p3I.js} +2 -2
  198. package/dist/client/assets/{vennDiagram-4TSXK5OY-BzIqk05W.js → vennDiagram-4TSXK5OY-Yh5vCDok.js} +2 -2
  199. package/dist/client/assets/{wardley-WFR3VGLG-CWuiB19I.js → wardley-WFR3VGLG-BeDK7hdA.js} +1 -1
  200. package/dist/client/assets/{wardleyDiagram-VM6X3IG4-C3KRakQk.js → wardleyDiagram-VM6X3IG4-BXdOv1zU.js} +2 -2
  201. package/dist/client/assets/{welcome-BFUhADQd.js → welcome-wbx9XdLq.js} +2 -2
  202. package/dist/client/assets/{xychartDiagram-S5SC5T6Z-cK0SAbmi.js → xychartDiagram-S5SC5T6Z-mciO_D_V.js} +2 -2
  203. package/dist/client/index.html +1 -1
  204. package/package.json +1 -1
  205. package/dist/client/assets/architecture-7GRP2DOG-5FKzTtFB.js +0 -1
  206. package/dist/client/assets/channel-mtMr1s7n.js +0 -2
  207. package/dist/client/assets/classDiagram-ZZMXUADV-B1oFCLrU.js +0 -2
  208. package/dist/client/assets/classDiagram-v2-VYDZK3BY-B1oFCLrU.js +0 -2
  209. package/dist/client/assets/eventmodeling-NTZA5JFV-CIzOZUSe.js +0 -1
  210. package/dist/client/assets/flowDiagram-HODETNUW-G6NoS3v2.js +0 -1
  211. package/dist/client/assets/ghostty-write-pty-hgyAvVbe.wasm +0 -0
  212. package/dist/client/assets/railroad-abnf-HS5TGJTU-CFQBiMqT.js +0 -1
  213. package/dist/client/assets/railroad-ebnf-LZEXJU2U-KvUMMzpJ.js +0 -1
  214. package/dist/client/assets/railroad-peg-WCYAUIDC-ps7Jjity.js +0 -1
  215. package/dist/client/assets/settings.archived-5E_Gxvpz.js +0 -2
  216. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-DTjnbS5I.js +0 -2
  217. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-BEo2_7TC.js +0 -9
@@ -1,4 +1,4 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$n as n,As as r,Cd as i,D as a,Ds as o,Ey as s,Fw as c,Gm as l,Of as u,RE as d,Yn as f,Yo as p,Zn as m,Zu as h,_f as g,cr as _,er as v,fn as y,j as b,ks as x,lr as S,mE as C,qn as w,rr as T,t as E,tr as D,w_ as O,y_ as k}from"./utils-hgbJ2TVM.js";import{L as A,R as ee,W as te}from"./runtime-D-mOwjrE.js";import{s as ne}from"./vcsRefInvalidation-DmqB0sWy.js";import{G as re}from"./entities-BBhhC0Ry.js";import{Sn as j,d as ie,f as ae,kn as M,u as oe,yn as N}from"./runtime-BSS7jQw6.js";import{C as se,V as ce,b as le,g as ue,h as de,l as fe}from"./TooltipViewport-DJ2VRKCt.js";import{$ as P,et as F,n as pe,ot as me}from"./ChatMarkdown-CDno8Ayh.js";import{t as he}from"./spinner-Bzrp5oww.js";import{i as ge,m as _e}from"./toast-x69BFrW5.js";import{C as ve,J as I,K as ye,O as be,s as xe,v as Se}from"./useSettings-BNs1IeKk.js";import{i as Ce,n as we}from"./session-pjgqVscl.js";import{t as Te}from"./use-atom-command-rhVarDA8.js";import{a as Ee}from"./fileLinks-16LrhkMX.js";import{u as De}from"./providerSkills-9AaADmXt.js";import{n as Oe}from"./toastHelpers-Dsph6LwL.js";import{o as ke}from"./queries-DY5q7KFy.js";import{H as L,V as Ae,l as je,ot as R,st as Me}from"./diffRendering-CdquEtfn.js";import{A as Ne,B as Pe,G as z,K as B,T as Fe,a as Ie,j as V,l as Le,t as Re}from"./Virtualizer-BSpDafyf.js";import{B as H,G as ze,H as Be,J as Ve,K as He,Q as Ue,U as We,V as Ge,W as Ke,q as qe}from"./getDiffFileInput-CMp2lO2J.js";import{c as Je,i as Ye,n as Xe,o as Ze,s as Qe,t as $e}from"./DiffWorkerPoolProvider-BOInEqDW.js";import{n as et}from"./cloneFileDiffMetadata-zVRGqYgv.js";import{S as tt,_ as nt,b as rt,c as it,d as at,f as ot,g as st,h as U,i as ct,l as lt,m as W,o as ut,p as dt,r as ft,s as G,t as pt,u as K,v as mt,x as ht,y as gt}from"./DiffCommentAnnotation-mA-RZ8Su.js";import{t as _t}from"./mediaReference-C10FT-nO.js";import{a as vt,n as yt,t as bt}from"./tooltip-D-SzZpgJ.js";import{i as xt,n as St,r as Ct,t as wt}from"./fileCommentAnnotations-BgdL_7u9.js";import{r as Tt,t as Et}from"./ReadOnlySourcePreview-BfF8Dhuk.js";import{a as Dt,c as Ot,i as kt,n as At,o as jt,r as Mt,s as Nt,t as Pt}from"./fileTreeExpansion-BwModZ8t.js";import{t as Ft}from"./pierre-icons-BodtO6xC.js";import{t as It}from"./scroll-area-DORwTFtw.js";import{A as Lt,C as Rt,E as zt,O as Bt,S as Vt,T as Ht,_ as Ut,b as Wt,j as Gt,w as Kt,x as qt,y as Jt}from"./ComposerPromptEditor-DCjk2_nI.js";import{t as Yt}from"./assets-CJFG5Oow.js";import{i as Xt,l as Zt,o as Qt,r as $t,s as en}from"./openFileInPreview-Dj9ZUFfJ.js";import{w as tn}from"./browserHistoryStore-DO5WuJ8O.js";import{t as nn}from"./preview-x-GNJPih.js";import{t as rn}from"./PierreEntryIcon--dw21QmY.js";import{r as an,t as on}from"./input-group-BM_USnbh.js";import{f as sn,i as cn,l as ln,n as un,o as dn,t as fn,u as pn}from"./projectFilesQueryState-Bb-3twEo.js";import{Ca as mn,ma as hn,va as gn}from"./main-COMts6-0.js";import{O as _n,g as vn,h as yn,m as bn,p as xn}from"./_chat-D4YotsBW.js";var Sn={compositeOverBg:H,contrastRatio:Ge,deriveMutedFg:Be,hoverWouldEraseText:We,isDarkSurface:Ke,isFullyTransparent:ze,pickReadableForeground:He,relativeLuminance:qe,surfacesMatch:Ve},q=e(t(),1);function Cn(e,t){return e.isOpen===t.isOpen&&e.value===t.value&&Dt(e.matchingPaths,t.matchingPaths)}function wn(e){let t=jt(e,e=>({isOpen:e.isSearchOpen(),matchingPaths:e.getSearchMatchingPaths(),value:e.getSearchValue()}),Cn);return(0,q.useMemo)(()=>({...t,close:()=>{e.closeSearch()},focusNextMatch:()=>{e.focusNextSearchMatch()},focusPreviousMatch:()=>{e.focusPreviousSearchMatch()},open:t=>{e.openSearch(t)},setValue:t=>{e.setSearch(t)}}),[e,t])}var Tn=100,En=`insert`,Dn=`backspace`,On=`delete`,kn=class e{#e=[];#t=[];#n;#r=!1;constructor(e){this.#n=Math.max(1,e?.maxEntries??Tn)}get canUndo(){return this.#e.length>0}get canRedo(){return this.#t.length>0}getState(){return{undoStack:this.#e.map(jn),redoStack:this.#t.map(jn),maxEntries:this.#n,canCoalesce:this.#r}}getLiveState(){return Object.defineProperties({},{undoStack:{enumerable:!0,get:()=>this.#e},redoStack:{enumerable:!0,get:()=>this.#t},maxEntries:{enumerable:!0,get:()=>this.#n},canCoalesce:{enumerable:!0,get:()=>this.#r}})}static fromState(t){let n=new e({maxEntries:t.maxEntries});return n.#e=t.undoStack,n.#t=t.redoStack,n.#r=t.canCoalesce,n}clear(){this.#e.length=0,this.#t.length=0,this.#r=!1}clearRedo(){this.#t.length=0}push(e){this.#e.push(e),this.clearRedo(),this.#r=!0,this.#e.length>this.#n&&this.#e.shift()}setLastUndoSelectionsAfter(e){let t=this.#e[this.#e.length-1];t!==void 0&&(t.selectionsAfter=e.map(e=>({...e})))}setLastUndoLineAnnotations(e,t){let n=this.#e[this.#e.length-1];n!==void 0&&(n.lineAnnotationsBefore=e.slice(),n.lineAnnotationsAfter=t.slice())}peekUndo(){return this.#e[this.#e.length-1]}peekUndoForCoalescing(){return this.#r?this.peekUndo():void 0}replaceLastUndo(e){if(this.#e.length===0){this.push(e);return}this.#e[this.#e.length-1]=e,this.clearRedo(),this.#r=!0}popUndoToRedo(){let e=this.#e.pop();if(e!==void 0)return this.#t.push(e),this.#r=!1,e}popRedoToUndo(){let e=this.#t.pop();if(e!==void 0)return this.#e.push(e),this.#r=!1,e}};function An(e){return{...e,forwardEdits:e.forwardEdits.map(e=>({...e})),inverseEdits:e.inverseEdits.map(e=>({...e})),selectionsBefore:e.selectionsBefore?.map(Mn),selectionsAfter:e.selectionsAfter?.map(Mn),lineAnnotationsBefore:e.lineAnnotationsBefore?.slice(),lineAnnotationsAfter:e.lineAnnotationsAfter?.slice()}}function jn(e){return{...An(e),lineAnnotationsBefore:e.lineAnnotationsBefore?.map(e=>({...e})),lineAnnotationsAfter:e.lineAnnotationsAfter?.map(e=>({...e}))}}function Mn(e){return{...e,start:{...e.start},end:{...e.end}}}function Nn(e,t,n,r,i,a,o,s){let c=[...t].sort((e,t)=>e.start-t.start),l=[],u;if(i?.length===c.length){let t=[];for(let n of i){if(n.start.line!==n.end.line||n.start.character!==n.end.character)break;t.push(e.offsetAt(n.start))}if(t.length===c.length){t.sort((e,t)=>e-t);let e=!0,n=!0;for(let r=0;r<c.length;r++){let i=c[r];if(i.text.length>0||i.start===i.end){e=!1,n=!1;break}e&&=t[r]===i.end,n&&=t[r]===i.start}u=e?Dn:n?On:void 0}}for(let t=0,n=0;t<c.length;t++){let r=c[t],i=e.getTextSlice(r.start,r.end),a=r.start+n;l.push({start:a,end:a+r.text.length,text:i}),n+=r.text.length-(r.end-r.start)}return{forwardEdits:c.map(e=>({...e})),inverseEdits:l,versionBefore:n,versionAfter:r,selectionsBefore:i?.map(e=>({...e})),selectionsAfter:a?.map(e=>({...e})),lineAnnotationsBefore:o?.slice(),lineAnnotationsAfter:s?.slice(),coalescingMode:u}}function Pn(e,t){if(e===void 0||e.undoBoundary===!0||t.undoBoundary===!0||e.forwardEdits.length===0||e.forwardEdits.length!==e.inverseEdits.length||e.forwardEdits.length!==t.forwardEdits.length||t.forwardEdits.length!==t.inverseEdits.length)return!1;let n;for(let r=0;r<e.forwardEdits.length;r++){let i=e.forwardEdits[r],a=e.inverseEdits[r],o=t.forwardEdits[r],s=t.inverseEdits[r],c=Ln(o.start,e.forwardEdits),l=i.start<=i.end&&i.text.length>0&&!i.text.includes(`
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$n as n,As as r,Cd as i,D as a,Ds as o,Ey as s,Fw as c,Gm as l,Of as u,RE as d,Yn as f,Yo as p,Zn as m,Zu as h,_f as g,cr as _,er as v,fn as y,j as b,ks as x,lr as S,mE as C,qn as w,rr as T,t as E,tr as D,w_ as O,y_ as k}from"./utils-hgbJ2TVM.js";import{L as A,R as ee,W as te}from"./runtime-DPOrcghx.js";import{s as ne}from"./vcsRefInvalidation-BPBh7p3I.js";import{G as re}from"./entities-BmcX1OB3.js";import{Sn as j,d as ie,f as ae,kn as M,u as oe,yn as N}from"./runtime-SBjACoAG.js";import{C as se,V as ce,b as le,g as ue,h as de,l as fe}from"./TooltipViewport-DJ2VRKCt.js";import{$ as P,et as F,n as pe,ot as me}from"./ChatMarkdown-1bLgD-eb.js";import{t as he}from"./spinner-Bzrp5oww.js";import{i as ge,m as _e}from"./toast-CfeQA1vM.js";import{C as ve,J as I,K as ye,O as be,s as xe,v as Se}from"./useSettings-DkjziVJm.js";import{i as Ce,n as we}from"./session-CFXzhAhI.js";import{t as Te}from"./use-atom-command-BCNOgemk.js";import{a as Ee}from"./fileLinks-D6tZCcrX.js";import{u as De}from"./providerSkills-BmzuNl-9.js";import{n as Oe}from"./toastHelpers-Dsph6LwL.js";import{o as ke}from"./queries-BJzayyNh.js";import{H as L,V as Ae,l as je,ot as R,st as Me}from"./diffRendering-D5-wCc8J.js";import{A as Ne,B as Pe,G as z,K as B,T as Fe,a as Ie,j as V,l as Le,t as Re}from"./Virtualizer-Cy8TBFLE.js";import{B as H,G as ze,H as Be,J as Ve,K as He,Q as Ue,U as We,V as Ge,W as Ke,q as qe}from"./getDiffFileInput-CaAoEF2q.js";import{c as Je,i as Ye,n as Xe,o as Ze,s as Qe,t as $e}from"./DiffWorkerPoolProvider-31z0fGQ6.js";import{n as et}from"./cloneFileDiffMetadata-zVRGqYgv.js";import{S as tt,_ as nt,b as rt,c as it,d as at,f as ot,g as st,h as U,i as ct,l as lt,m as W,o as ut,p as dt,r as ft,s as G,t as pt,u as K,v as mt,x as ht,y as gt}from"./DiffCommentAnnotation-ByLSJGCC.js";import{t as _t}from"./mediaReference-DZXLlXcJ.js";import{a as vt,n as yt,t as bt}from"./tooltip-D-SzZpgJ.js";import{i as xt,n as St,r as Ct,t as wt}from"./fileCommentAnnotations-BgdL_7u9.js";import{r as Tt,t as Et}from"./ReadOnlySourcePreview-BJ6Yf9Nm.js";import{a as Dt,c as Ot,i as kt,n as At,o as jt,r as Mt,s as Nt,t as Pt}from"./fileTreeExpansion-XMXwSF13.js";import{t as Ft}from"./pierre-icons-CFlecESq.js";import{t as It}from"./scroll-area-DORwTFtw.js";import{A as Lt,C as Rt,E as zt,O as Bt,S as Vt,T as Ht,_ as Ut,b as Wt,j as Gt,w as Kt,x as qt,y as Jt}from"./ComposerPromptEditor-C462LHSn.js";import{t as Yt}from"./assets-v9gHTSJ2.js";import{i as Xt,l as Zt,o as Qt,r as $t,s as en}from"./openFileInPreview-weURIMTS.js";import{w as tn}from"./browserHistoryStore-DY3kofkL.js";import{t as nn}from"./preview-Dz5JGjMV.js";import{t as rn}from"./PierreEntryIcon-BS77_eRn.js";import{r as an,t as on}from"./input-group-BM_USnbh.js";import{f as sn,i as cn,l as ln,n as un,o as dn,t as fn,u as pn}from"./projectFilesQueryState-Au75qUTL.js";import{Ca as mn,ma as hn,va as gn}from"./main-DTxzRLjF.js";import{O as _n,g as vn,h as yn,m as bn,p as xn}from"./_chat-CWIHenSN.js";var Sn={compositeOverBg:H,contrastRatio:Ge,deriveMutedFg:Be,hoverWouldEraseText:We,isDarkSurface:Ke,isFullyTransparent:ze,pickReadableForeground:He,relativeLuminance:qe,surfacesMatch:Ve},q=e(t(),1);function Cn(e,t){return e.isOpen===t.isOpen&&e.value===t.value&&Dt(e.matchingPaths,t.matchingPaths)}function wn(e){let t=jt(e,e=>({isOpen:e.isSearchOpen(),matchingPaths:e.getSearchMatchingPaths(),value:e.getSearchValue()}),Cn);return(0,q.useMemo)(()=>({...t,close:()=>{e.closeSearch()},focusNextMatch:()=>{e.focusNextSearchMatch()},focusPreviousMatch:()=>{e.focusPreviousSearchMatch()},open:t=>{e.openSearch(t)},setValue:t=>{e.setSearch(t)}}),[e,t])}var Tn=100,En=`insert`,Dn=`backspace`,On=`delete`,kn=class e{#e=[];#t=[];#n;#r=!1;constructor(e){this.#n=Math.max(1,e?.maxEntries??Tn)}get canUndo(){return this.#e.length>0}get canRedo(){return this.#t.length>0}getState(){return{undoStack:this.#e.map(jn),redoStack:this.#t.map(jn),maxEntries:this.#n,canCoalesce:this.#r}}getLiveState(){return Object.defineProperties({},{undoStack:{enumerable:!0,get:()=>this.#e},redoStack:{enumerable:!0,get:()=>this.#t},maxEntries:{enumerable:!0,get:()=>this.#n},canCoalesce:{enumerable:!0,get:()=>this.#r}})}static fromState(t){let n=new e({maxEntries:t.maxEntries});return n.#e=t.undoStack,n.#t=t.redoStack,n.#r=t.canCoalesce,n}clear(){this.#e.length=0,this.#t.length=0,this.#r=!1}clearRedo(){this.#t.length=0}push(e){this.#e.push(e),this.clearRedo(),this.#r=!0,this.#e.length>this.#n&&this.#e.shift()}setLastUndoSelectionsAfter(e){let t=this.#e[this.#e.length-1];t!==void 0&&(t.selectionsAfter=e.map(e=>({...e})))}setLastUndoLineAnnotations(e,t){let n=this.#e[this.#e.length-1];n!==void 0&&(n.lineAnnotationsBefore=e.slice(),n.lineAnnotationsAfter=t.slice())}peekUndo(){return this.#e[this.#e.length-1]}peekUndoForCoalescing(){return this.#r?this.peekUndo():void 0}replaceLastUndo(e){if(this.#e.length===0){this.push(e);return}this.#e[this.#e.length-1]=e,this.clearRedo(),this.#r=!0}popUndoToRedo(){let e=this.#e.pop();if(e!==void 0)return this.#t.push(e),this.#r=!1,e}popRedoToUndo(){let e=this.#t.pop();if(e!==void 0)return this.#e.push(e),this.#r=!1,e}};function An(e){return{...e,forwardEdits:e.forwardEdits.map(e=>({...e})),inverseEdits:e.inverseEdits.map(e=>({...e})),selectionsBefore:e.selectionsBefore?.map(Mn),selectionsAfter:e.selectionsAfter?.map(Mn),lineAnnotationsBefore:e.lineAnnotationsBefore?.slice(),lineAnnotationsAfter:e.lineAnnotationsAfter?.slice()}}function jn(e){return{...An(e),lineAnnotationsBefore:e.lineAnnotationsBefore?.map(e=>({...e})),lineAnnotationsAfter:e.lineAnnotationsAfter?.map(e=>({...e}))}}function Mn(e){return{...e,start:{...e.start},end:{...e.end}}}function Nn(e,t,n,r,i,a,o,s){let c=[...t].sort((e,t)=>e.start-t.start),l=[],u;if(i?.length===c.length){let t=[];for(let n of i){if(n.start.line!==n.end.line||n.start.character!==n.end.character)break;t.push(e.offsetAt(n.start))}if(t.length===c.length){t.sort((e,t)=>e-t);let e=!0,n=!0;for(let r=0;r<c.length;r++){let i=c[r];if(i.text.length>0||i.start===i.end){e=!1,n=!1;break}e&&=t[r]===i.end,n&&=t[r]===i.start}u=e?Dn:n?On:void 0}}for(let t=0,n=0;t<c.length;t++){let r=c[t],i=e.getTextSlice(r.start,r.end),a=r.start+n;l.push({start:a,end:a+r.text.length,text:i}),n+=r.text.length-(r.end-r.start)}return{forwardEdits:c.map(e=>({...e})),inverseEdits:l,versionBefore:n,versionAfter:r,selectionsBefore:i?.map(e=>({...e})),selectionsAfter:a?.map(e=>({...e})),lineAnnotationsBefore:o?.slice(),lineAnnotationsAfter:s?.slice(),coalescingMode:u}}function Pn(e,t){if(e===void 0||e.undoBoundary===!0||t.undoBoundary===!0||e.forwardEdits.length===0||e.forwardEdits.length!==e.inverseEdits.length||e.forwardEdits.length!==t.forwardEdits.length||t.forwardEdits.length!==t.inverseEdits.length)return!1;let n;for(let r=0;r<e.forwardEdits.length;r++){let i=e.forwardEdits[r],a=e.inverseEdits[r],o=t.forwardEdits[r],s=t.inverseEdits[r],c=Ln(o.start,e.forwardEdits),l=i.start<=i.end&&i.text.length>0&&!i.text.includes(`
2
2
  `)&&!a.text.includes(`
3
3
  `),u=o.start===o.end&&o.text.length>0&&!o.text.includes(`
4
4
  `)&&s.text.length===0;if(l&&u){if(o.start!==a.end||(n??=En,n!==En||e.coalescingMode!==void 0&&e.coalescingMode!==En||t.coalescingMode!==void 0&&t.coalescingMode!==En))return!1;continue}let d=i.text.length===0&&i.end>i.start&&a.text.length>0,f=o.text.length===0&&o.end>o.start&&s.text.length>0;if(d&&f){let r;if(c===i.end)r=On;else if(c+(o.end-o.start)!==i.start)return!1;else r=Dn;if(n??=r,n!==r||e.coalescingMode!==void 0&&e.coalescingMode!==r||t.coalescingMode!==void 0&&t.coalescingMode!==r)return!1;continue}return!1}return n!==void 0}function Fn(e,t){let n=[],r=[],i;for(let a=0;a<e.forwardEdits.length;a++){let o=e.forwardEdits[a],s=e.inverseEdits[a],c=t.forwardEdits[a],l=t.inverseEdits[a],u=Ln(c.start,e.forwardEdits);if(o.text.length>0){i??=En,n.push({start:o.start,end:o.end,text:o.text+c.text}),r.push(s.text);continue}if(u===o.end){i??=On,n.push({start:o.start,end:u+(c.end-c.start),text:``}),r.push(s.text+l.text);continue}i??=Dn,n.push({start:Math.min(o.start,u),end:o.end,text:``}),r.push(l.text+s.text)}return{forwardEdits:n,inverseEdits:In(n,r),versionBefore:e.versionBefore,versionAfter:t.versionAfter,selectionsBefore:e.selectionsBefore?.slice(),selectionsAfter:t.selectionsAfter?.slice(),lineAnnotationsBefore:e.lineAnnotationsBefore?.slice(),lineAnnotationsAfter:t.lineAnnotationsAfter?.slice(),coalescingMode:i}}function In(e,t){let n=[];for(let r=0,i=0;r<e.length;r++){let a=e[r],o=a.start+i;n.push({start:o,end:o+a.text.length,text:t[r]}),i+=a.text.length-(a.end-a.start)}return n}function Ln(e,t){let n=e;for(let e of t){let t=e.end-e.start,r=e.text.length,i=r-t;if(!(n<e.start)){if(n>=e.start+r){n-=i;continue}n=e.start+Math.min(n-e.start,t)}}return n}var Rn=new WeakMap;function zn(e){return Rn.get(e)}function Bn(e,t){Rn.set(e,t)}var Vn=class e{#e;#t;#n;#r;#i;#a;constructor(e,t,n=`text`,r=0,i=new kn,a){if(this.#e=new URL(e,`file://`).toString(),this.#t=n,this.#n=r,this.#r=new mt(t),this.#i=i,a!=null)this.#a=a;else{let e=this.#r.getLineText(0,!0);this.#a=e.endsWith(`\r
@@ -31,4 +31,4 @@ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19
31
31
  `)&&(i=n,a=[t.offsetAt(e.start),t.offsetAt(e.end)])}}let o=([e,n],r)=>{let i=Lr(t,e,n);this.#Wt([i]),this.#Pe(Y(i).line),this.#gt(!0),this.#pe=r},s=new ct({textDocument:t,containerElement:n,defaultQuery:i,mode:e,initialMatch:a,scrollToMatch:o,applyReplace:e=>{if(e.length===0)return;let n=t.applyEdits(e.map(e=>({range:{start:t.positionAt(e.start),end:t.positionAt(e.end)},newText:e.text})),!0,this.#se);n!==void 0&&this.#dn(n,void 0,this.#pn(n),{skipSearchRefresh:!0})},onUpdate:(e,n)=>{if(e.length===0){this.#ce=void 0,this.#Wt(this.#se??[]);return}if(this.#ce=e,n?.syncSelection===!1){this.#Wt(this.#se??[]);let n=this.#se?.at(-1);if(n!==void 0){let r=t.offsetAt(n.start),i=t.offsetAt(n.end);for(let t of e)if(t[0]===r&&t[1]===i)return t}return}let r=this.#se?.at(-1),i=0,a;r!==void 0&&(i=t.offsetAt(r.start));for(let t of e)if(t[0]>=i){a=t;break}return a===void 0?this.#Wt(this.#se??[]):o(a,!0),a},onClose:()=>{this.#G=void 0,this.#pe=!1,this.#ce=void 0,this.#Wt(this.#se??[])}});this.#G=s,this.#pe=!1}#en(){let e=this.#n?.document,t=this.#se;return e===void 0||t===void 0?``:Qr(e,t)}#tn(){let e=this.#n?.document,t=this.#se;return e===void 0||t===void 0?[]:Zr(e,t)}#nn(e,t,n){e!==null&&(e.setData(`text`,t),n.length>1&&e.setData(eo,JSON.stringify(n)))}#rn(){let e=this.#n?.document,t=this.#se;if(e===void 0||t===void 0||t.length===0)return``;if(t.some(e=>J(e))){let n=ri(e,t);return this.#in(n.edits,n.nextSelectionOffsets),n.text}let n=Qr(e,t);return this.#an(``,void 0,!0),n}#in(e,t){let n=this.#n?.document,r=this.#se;if(n===void 0||r===void 0||e.length===0)return;let i=n.applyResolvedEdits(e,!0,r,void 0,!0);if(i===void 0)return;let a=t.map(e=>{let t=n.positionAt(e);return{start:t,end:t,direction:0}});n.setLastUndoSelectionsAfter(a),this.#dn(i,a,this.#pn(i))}#an(e,t=this.#se,n=!1,r=`selection`){if(t===void 0)return;let i=this.#n?.document,a=t.at(-1);if(i===void 0||a===void 0)return;let{nextSelections:o,change:s}=Array.isArray(e)&&e.length===t.length?Er(i,t,e,this.#R,n,r):Cr(i,t,{start:i.offsetAt(a.start),end:i.offsetAt(a.end),text:Array.isArray(e)?e.join(i.eol):e},this.#R,void 0,n);s!==void 0&&this.#dn(s,o,this.#pn(s))}#on(e=!1){let t=this.#se,n=this.#n?.document;if(t===void 0||n===void 0)return;let{nextSelections:r,change:i}=Pr(n,t,e,this.#R,this.#r.tabSize);i!==void 0&&this.#dn(i,r,this.#pn(i))}#sn(){let e=this.#se,t=this.#n?.document;if(e===void 0||t===void 0)return;let{nextSelections:n,change:r}=jr(t,e,this.#Le?(e,t)=>{let n=this.#Sn(e);for(let e=0;e+1<n.length;e++){let r=n[e],i=n[e+1];if(t>=r&&t<=i)return r}return 0}:void 0,this.#R);r!==void 0&&this.#dn(r,n,this.#pn(r))}#cn(){let e=this.#se,t=this.#n?.document;if(e===void 0||t===void 0)return;let{nextSelections:n,change:r}=Mr(t,e,this.#R);r!==void 0&&this.#dn(r,n,this.#pn(r))}#ln(){let e=this.#se,t=this.#n?.document;if(e===void 0||t===void 0)return;let{nextSelections:n,change:r}=Ar(t,e,this.#R);r!==void 0&&this.#dn(r,n,this.#pn(r))}#un(){let e=this.#se,t=this.#n?.document;if(e===void 0||t===void 0)return;let{nextSelections:n,change:r}=kr(t,e,this.#R);r!==void 0&&this.#dn(r,n,this.#pn(r))}#dn(e,t,n,r){this.#xe!=null&&this.#Rt(!0);let i=this.#n?.document;if(i!==void 0&&this.#W!==void 0)for(let t of this.#W)t.anchorOffset=Rr(t.anchorOffset,e.changes),t.focusOffset=Rr(t.focusOffset,e.changes),t.caret.anchor=i.positionAt(t.anchorOffset),t.caret.focus=i.positionAt(t.focusOffset);if(e.lineDelta!==0||this.#Le)for(let t of this.#m.keys())t>=e.startLine&&this.#m.delete(t);if(this.#h.size>0){if(e.lineDelta===0&&(e.changedLineRanges.length===1||e.changedLineChanges?.every(([,,e])=>e===0)===!0))for(let[t,n]of e.changedLineRanges)for(let e=t;e<=n;e++)this.#h.delete(e);else for(let t of this.#h.keys())t>=e.startLine&&this.#h.delete(t)}this.#_=void 0;let a=this.#V,o;if(a!==void 0&&t!==void 0&&t.length>0){let n=t.at(-1),r=a.startingLine+a.totalLines;if(n.end.line>=r){let t=n.end.line-a.startingLine+1,i=this.#H===void 0||this.#H===1/0?1/0:this.#H*qa;e.startLine<=r&&t<=i&&this.#Me(n.end.line)?(n.end.line>r&&(o=!0),a={...a,totalLines:t},this.#V=a):o=!0}}if(this.#I&&this.#i!=null&&this.#w!=null?this.#ct(e,n,a,o):i!=null&&(this.#P?.(i,n),n!=null&&(this.#R=n)),t!=null&&this.#Wt(t),this.#M?.__acknowledgeDocumentUpdate(),this.#De(),this.#Vt(e,r?.editSource??`user`),this.#Bt(),this.#fn(e.changes,n??this.#R),r?.skipSearchRefresh!==!0&&this.#G!==void 0&&this.#ce!==void 0&&this.#G.updateMatches({syncSelection:!1}),t!=null&&r?.skipFocus!==!0){let e=t.at(-1);if(e!==void 0&&this.#Pe(Y(e).line),this.#A!==void 0)requestAnimationFrame(()=>{this.#A?.scrollIntoView({block:`nearest`,inline:`nearest`})});else if(t.length>0){let e=Y(t.at(-1));this.#vt(e.line,e.character)}this.focus({preventScroll:!0})}}#fn(e,t){let n=this.getFile(),r=this.#F;n!=null&&r!=null&&r(e,n,t)}#pn(e){if(this.#R!=null){let t=$n(e,this.#R);if(t!=null)return this.#n?.document?.setLastUndoLineAnnotations(this.#R,t),t}}#mn(){let e=this.#w;if(e===void 0)return[];let t=[];for(let n of e.children){let e=n,r=e.dataset.lineType,i=W(e);if(i===void 0||r===void 0||!Fr(r))continue;let a=i-1,o=t.at(-1);o!==void 0&&a<=o[1]+1?o[1]=Math.max(o[1],a):t.push([a,a])}return t}#hn(e){let t=this.#V;return t==null||e>=t.startingLine&&e<t.startingLine+t.totalLines}#gn(e){let t=this.#g.get(e);if(t!==void 0)return t??void 0;let n=this.#V;if(!this.#hn(e))return;let r=this.#w;if(r!==void 0){if(n!==void 0){let{startingLine:i}=n,{children:a}=r;for(let n=e-i;n<=a.length;n++){let r=a[n];if(r===void 0)break;let i=W(r),o=r.dataset.lineType;if(i!==void 0&&i===e+1&&o!==void 0&&Fr(o)){t=r;break}}}return t??=r.querySelector(`[data-line="${e+1}"]`+(this.#Fe===`unified`?`:not([data-line-type="change-deletion"])`:``)),t!==void 0&&this.#g.set(e,t),t??void 0}}#_n(){if(this.#C===void 0)return 0;if(this.#f===void 0){let e=this.#w?.parentElement?.style.getPropertyValue(`--diffs-column-number-width`);this.#f=e!==void 0&&e.length>2&&e.endsWith(`px`)?parseInt(e.slice(0,-2),10):this.#C.offsetWidth}return this.#f}#vn(){if(this.#w===void 0)return 0;if(this.#p===void 0){let e=this.#w.parentElement?.style.getPropertyValue(`--diffs-column-content-width`);this.#p=e!==void 0&&e.length>2&&e.endsWith(`px`)?parseFloat(e.slice(0,-2)):this.#w.offsetWidth}return this.#p}#yn(e){let t=this.#m.get(e);if(t!==void 0)return t;let n=this.#gn(e);if(n===void 0)return-1;let r=n.offsetTop+this.#r.paddingTop;return r+=this.#$e?.top??0,this.#m.set(e,r),r}#bn(e,t){if(this.#_!==void 0&&this.#_[0]===e&&this.#_[1]===t)return[this.#_[2],this.#_[3]];let n=this.#n?.document?.getLineText(e),r=this.#_n()+this.#r.ch;if(n===void 0||n.length===0||t<=0)return[r+(this.#$e?.left??0),0];let i=Fa(n,Math.min(t,n.length)),a=n.slice(0,i),o=La(a,this.#r.tabSize),s=0,c=0;if(s=o===-1?r+this.#r.measureTextWidth(a):r+o*this.#r.ch,this.#Le){let t=this.#vn();if(2*this.#r.ch+this.#r.measureTextWidth(n)>t){let t=this.#xn(e);if(t==null)return[s+(this.#$e?.left??0),0];for(let e=0;e+1<t.length;e++){let a=t[e];if(i<=t[e+1]){c=e;let t=n.slice(a,i),o=La(t,this.#r.tabSize);s=o===-1?r+this.#r.measureTextWidth(t):r+o*this.#r.ch;break}}}s+=this.#$e?.left??0}return this.#_===void 0?this.#_=[e,t,s,c]:(this.#_[0]=e,this.#_[1]=t,this.#_[2]=s,this.#_[3]=c),[s,c]}#xn(e){let t=this.#h.get(e);if(t!==void 0)return t;this.#h.size>=Ja&&this.#h.clear();let n=this.#n?.document?.getLineText(e);if(n===void 0||n.length===0){let t=new Uint32Array([0]);return this.#h.set(e,t),t}let r=this.#w;if(r==null||!r.isConnected)return;let i=U(`div`,{style:{position:`absolute`,top:`0`,left:`0`,width:`100%`,boxSizing:`border-box`,visibility:`hidden`,pointerEvents:`none`,whiteSpace:`pre-wrap`,wordBreak:`break-word`,font:`inherit`,paddingInline:`1ch`,tabSize:this.#r.tabSize.toString()},textContent:n},r),a=i.firstChild,o=document.createRange(),s=[];try{let t=i.getBoundingClientRect();if(t.width===0)return;let r=Ia(n),c=t.left+this.#r.ch,l=r===void 0?n.length:r.length-1,u=e=>r===void 0?e:r[e],d=e=>{o.setStart(a,u(e)),o.setEnd(a,u(e+1));let t=o.getClientRects();return t.item(t.length-1)??o.getBoundingClientRect()};s.push(0);let f=d(0).top,p=1;for(;p<l;){let e=p,t=l;for(;e<t;){let n=e+t>>1;d(n).top>f?t=n:e=n+1}if(e>=l)break;let{left:n,top:r}=d(e),i=Fe()&&n-c>this.#r.ch/2;s.push(u(i?e-1:e)),f=r,p=e+1}let m=new Uint32Array(s.length+1);for(let e=0;e<s.length;e++)m[e]=s[e];return m[s.length]=n.length,this.#h.set(e,m),m}finally{i.remove()}}#Sn(e){let t=this.#xn(e);if(t!==void 0)return t;let n=this.#n?.document?.getLineText(e)?.length??0;return Uint32Array.of(0,n)}#Cn({startContainer:e,endContainer:t}){let n=this.#w;return n!==void 0&&n.contains(e)&&n.contains(t)}#wn(e){let t=this.#n?.document?.lineCount??0;return e<0||e>=t?!1:this.#gn(e)!==void 0}};function no({type:e,editStateKey:t,owner:n,initialState:r,previousSession:i}){if(r!=null&&r.type!==e)throw TypeError(`Editor: initialState: a ${r.type} state cannot initialize a ${e} editor`);let a=r;return t==null?a??i??(e===`file`?{type:`file`}:{type:`file-diff`}):Yn.activate(e,t,n,a)}function ro(e){return e instanceof HTMLElement?Number(e.dataset.bufferSize??1):1}function io(e,t){return t!==void 0&&Number.isInteger(t.line)&&Number.isInteger(t.character)&&t.line>=0&&t.line<e.lineCount&&t.character>=0&&t.character<=e.getLineLength(t.line)}function ao(e,t){let n=e.charCodeAt(t-1),r=e.charCodeAt(t);return t>0&&t<e.length&&n>=55296&&n<=56319&&r>=56320&&r<=57343}var Q=d(),oo=e=>{if(typeof e!=`object`||!e)return null;let t=e;return typeof t.getAttribute==`function`?t.getAttribute(`data-item-path`):null};function so(e){let t=[],n=[];return{isDragInProgress:()=>n.length>0,handleSelectionChange(e){t=e},handleDragStart(e){if(e.dataTransfer===null)return;let r=null;for(let t of e.composedPath())if(r=oo(t),r!==null)break;if(r===null)return;let i=t.includes(r)?t:[r],a=i.map(e=>bn(e)).filter(e=>e!==null);a.length!==0&&(n=i,e.dataTransfer.setData(xn,a.join(` `)))},handleDragEnd(){if(n.length!==0){for(let t of n)e.deselect(t);n=[]}}}}function co(e){return e.split(`/`).filter(Boolean).length}function lo(e,t){let n=new Set(e),r=new Set(t),i=[],a=[],o=e.filter(e=>!r.has(e)).toSorted((e,t)=>co(e)-co(t));for(let e of o){if(i.some(t=>e.startsWith(t)))continue;let t=e.endsWith(`/`);a.push({type:`remove`,path:e,...t?{recursive:!0}:{}}),t&&i.push(e)}let s=t.filter(e=>!n.has(e)).toSorted((e,t)=>co(e)-co(t));for(let e of s)a.push({type:`add`,path:e});return a}function uo(e,t){let[n,r]=(0,q.useState)(new Map),[i,a]=(0,q.useState)(new Map),[o,s]=(0,q.useState)(0),[l,u]=(0,q.useState)(new Set),d=(0,q.useRef)(new Map),f=(0,q.useRef)(new Set),m=(0,q.useRef)(new Set),h=(0,q.useRef)(!0),g=(0,q.useRef)(0),_=(0,q.useRef)([]),v=(0,q.useCallback)(function n(i,o=!1){let l=d.current.get(i);if(l)return o?l.then(()=>n(i,!0)):l;if(!o&&f.current.has(i))return Promise.resolve();f.current.add(i),m.current.add(i);let v=re.listEntries({environmentId:e,input:{cwd:t,directoryPath:i}});s(e=>e+1),o||u(e=>new Set(e).add(i));let y=(async()=>{g.current>=4?await new Promise(e=>_.current.push(e)):g.current++;try{return h.current?await A(p,v,{refresh:!0,reportFailure:!1,reportDefect:!1}):void 0}finally{let e=_.current.shift();e?e():g.current--}})().then(e=>{if(h.current&&e){if(e._tag===`Success`)r(t=>new Map(t).set(i,e.value.entries.filter(e=>e.path.slice(0,Math.max(0,e.path.lastIndexOf(`/`)))===i))),a(e=>{let t=new Map(e);return t.delete(i),t});else{f.current.delete(i);let t=c(e.cause);a(e=>new Map(e).set(i,t instanceof Error?t.message:`Unable to load folder.`))}}}).finally(()=>{d.current.delete(i),h.current&&(s(e=>e-1),o||u(e=>{let t=new Set(e);return t.delete(i),t}))});return d.current.set(i,y),y},[t,e]);(0,q.useEffect)(()=>(h.current=!0,v(``),()=>{h.current=!1}),[v]);let y=(0,q.useMemo)(()=>{let e=[],t=r=>{for(let i of n.get(r)??[])e.push(i),i.kind===`directory`&&t(i.path)};return t(``),e},[n]),b=(0,q.useMemo)(()=>new Set([``,...y.filter(e=>e.kind===`directory`).map(e=>e.path)]),[y]);return{entries:y,load:v,refresh:(0,q.useCallback)(()=>{let e=[...m.current].filter(e=>b.has(e)),t=0,n=async()=>{for(;t<e.length&&h.current;){let n=e[t++];n!==void 0&&await v(n,!0)}};for(let t=0;t<Math.min(4,e.length);t++)n()},[v,b]),isPending:o>0,loadingDirectories:l,ready:n.has(``),error:[...i].find(([e])=>b.has(e))?.[1]??null}}var $=e(C(),1);function fo(e){return e.kind===`directory`?`${e.path}/`:e.path}function po(e){let t=(0,Q.c)(12),n;t[0]===e.onRefresh?n=t[1]:(n=(0,$.jsx)(S,{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":`Refresh workspace files`,onClick:e.onRefresh}),t[0]=e.onRefresh,t[1]=n);let r;t[2]===e.isPending?r=t[3]:(r=(0,$.jsx)(mn,{refreshing:e.isPending}),t[2]=e.isPending,t[3]=r);let i;t[4]!==n||t[5]!==r?(i=(0,$.jsx)(vt,{render:n,children:r}),t[4]=n,t[5]=r,t[6]=i):i=t[6];let a=e.isPending?`Refreshing…`:`Refresh files`,o;t[7]===a?o=t[8]:(o=(0,$.jsx)(yt,{children:a}),t[7]=a,t[8]=o);let s;return t[9]!==i||t[10]!==o?(s=(0,$.jsxs)(bt,{children:[i,o]}),t[9]=i,t[10]=o,t[11]=s):s=t[11],s}function mo(e){let t=(0,Q.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):(n=t=>e.onValueChange(t.target.value),r=t=>{t.key===`Escape`&&(e.onClose(),t.currentTarget.blur())},t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==e.ariaLabel||t[4]!==e.name||t[5]!==e.value||t[6]!==n||t[7]!==r?(i=(0,$.jsx)(on,{variant:`ghost`,className:`h-7 min-w-0 flex-1`,children:(0,$.jsx)(an,{type:`search`,name:e.name,size:`sm`,value:e.value,"aria-label":e.ariaLabel,placeholder:`Search files`,spellCheck:!1,onChange:n,onKeyDown:r})}),t[3]=e.ariaLabel,t[4]=e.name,t[5]=e.value,t[6]=n,t[7]=r,t[8]=i):i=t[8],i}function ho({environmentId:e,cwd:t,projectName:n,selectedPath:r,selectedPathRevealId:i,onOpenFile:a,onRefreshSelectedFile:o,workspaceMutationId:s}){let{resolvedTheme:c}=ye(),l=y(),u=De(e),{entries:d,load:f,refresh:p,ready:m,error:h,isPending:g,loadingDirectories:_}=uo(e,t),[v,b]=(0,q.useState)(``),[x,C]=(0,q.useState)(!1),w=ke({environmentId:e,cwd:t,query:v.slice(0,256)},200),T=(0,q.useMemo)(()=>{let e=new Map(d.map(e=>[e.path,e]));if(v.trim()&&!w.isPending)for(let t of w.entries){e.has(t.path)||e.set(t.path,t);let n=t.path.split(`/`);for(let t=1;t<n.length;t++){let r=n.slice(0,t).join(`/`);e.has(r)||e.set(r,{path:r,kind:`directory`})}}return[...e.values()]},[d,w.entries,w.isPending,v]),E=(0,q.useMemo)(()=>new Map(T.map(e=>[e.path,e.kind])),[T]),D=(0,q.useRef)(E),O=(0,q.useMemo)(()=>T.map(fo),[T]),k=(0,q.useMemo)(()=>T.filter(e=>e.kind===`directory`).map(fo),[T]),A=(0,q.useRef)(null),ee=(0,q.useRef)(!1),te=(0,q.useRef)(null),ne=(0,q.useRef)(null),re=(0,q.useRef)(null);(0,q.useEffect)(()=>{let e=e=>{re.current={x:e.clientX,y:e.clientY,at:e.timeStamp}};return document.addEventListener(`contextmenu`,e,!0),()=>document.removeEventListener(`contextmenu`,e,!0)},[]);let j=async(n,r)=>{let i=I();if(!i){r.close();return}let a=n.path.replace(/\/$/,``),o=yn(a),s=re.current,c=s!==null&&performance.now()-s.at<1e3,d=r.anchorElement.getBoundingClientRect(),f=c?{x:s.x,y:s.y}:{x:d.left,y:d.bottom},p={environmentId:e,filePath:a,workspaceRoot:t},m=u.buildItems(p);try{let e=await i.contextMenu.show([...m,{id:`copy-mention`,label:`Copy mention`},{id:`add-to-chat`,label:`Add to chat`}],f);if(e===null)return;if(m.some(t=>t.id===e)||e.startsWith(`editor:`)){await u.activate(e,p);return}if(e===`copy-mention`){try{await _e(o),ge.add({type:`success`,title:`Mention copied`,description:a})}catch(e){ge.add({type:`error`,title:`Failed to copy mention`,description:e instanceof Error?e.message:`An error occurred.`})}return}if(e===`add-to-chat`){let e=l?.current;if(!e){ge.add({type:`error`,title:`Unable to add to chat`,description:`Open a chat for this project and try again.`});return}e.insertTextAtEnd(`${o} `,{ensureLeadingBoundary:!0})||ge.add({type:`error`,title:`Unable to add to chat`,description:`The chat isn't ready to accept input right now.`})}}finally{r.close()}},ie=(0,q.useRef)(j);(0,q.useEffect)(()=>{ie.current=j});let ae=(0,q.useRef)(_),M=(0,q.useRef)(null),oe=(0,q.useMemo)(()=>so({deselect:e=>M.current?.getItem(e)?.deselect()}),[]),{model:N}=Nt({composition:{contextMenu:{triggerMode:`right-click`,onOpen:(e,t)=>{ie.current(e,t)}}},dragAndDrop:{canDrop:()=>!1},density:`compact`,fileTreeSearchMode:`hide-non-matches`,flattenEmptyDirectories:!0,initialExpansion:`closed`,icons:Ft,onSelectionChange:e=>{if(oe.handleSelectionChange(e),ee.current||oe.isDragInProgress())return;let t=e.at(-1)?.replace(/\/$/,``);t&&D.current.get(t)===`file`&&(te.current=t,a(t))},paths:[],renderRowDecoration:({item:e,row:t})=>t.kind===`directory`&&t.isExpanded&&ae.current.has(e.path.replace(/\/$/,``))?{icon:`p4-tree-icon-loading`,title:`Loading…`}:null,search:!1,onSearchChange:e=>b(e??``),unsafeCSS:Mt});(0,q.useEffect)(()=>{ae.current!==_&&(ae.current=_,N.setComposition(N.getComposition()))},[_,N]);let se=wn(N),ce=jt(N,e=>Pt(e,k)),le=()=>{let e=!(x||ce);C(e),At(N,k,e)},P=()=>{b(``),se.close()},F=(0,q.useRef)(new Set);(0,q.useEffect)(()=>{let e=new Set(k);for(let t of F.current)e.has(t)||F.current.delete(t);let t=()=>{if(!N.isSearchOpen())for(let e of k){let t=N.getItem(e);t?.isDirectory()&&`isExpanded`in t&&t.isExpanded()?F.current.has(e)||(F.current.add(e),f(e.replace(/\/$/,``))):(t?.isDirectory()&&F.current.has(e)&&C(!1),F.current.delete(e))}};return t(),N.subscribe(t)},[k,f,N]),(0,q.useEffect)(()=>{N.setGitStatus(T.filter(e=>e.ignored).map(e=>({path:fo(e),status:`ignored`})))},[T,N]),(0,q.useEffect)(()=>{if(!r)return;let e=new AbortController;return(async()=>{let t=r.split(`/`);for(let n=0;n<t.length&&!e.signal.aborted;n++)await f(t.slice(0,n).join(`/`))})(),()=>{e.abort()}},[f,r]);let pe=e=>{if(b(e),e.trim().length===0){se.close();return}se.setValue(e)},me=()=>{p(),v.trim()&&w.refresh(),o?.()};_n({mutationId:s,refresh:()=>{p(),v.trim()&&w.refresh()},resourceKey:`files:${e}:${t}`}),(0,q.useEffect)(()=>{if(!m||A.current===O)return;D.current=E;let e=A.current;if(A.current=O,e===null){N.resetPaths(O);return}let t=lo(e,O);t.length>0&&N.batch(t)},[m,E,N,O]),(0,q.useEffect)(()=>{x&&!v.trim()&&At(N,k,!0)},[k,x,N,v]),(0,q.useEffect)(()=>{if(!r){ne.current=null;return}let e=E.get(r);if(e===void 0){ne.current=null;return}let t={path:r,revealId:i},n=ne.current;if(n?.path===t.path&&n.revealId===t.revealId)return;let a=e===`directory`?`${r}/`:r,o=N.getItem(a);if(!o)return;if(N.getSelectedPaths().some(e=>e.replace(/\/$/,``)===r)&&te.current===r){te.current=null,ne.current=t;return}te.current=null,ne.current=t,ee.current=!0,b(``),N.closeSearch();for(let e of N.getSelectedPaths())N.getItem(e)?.deselect();let s=r.split(`/`),c=``;for(let e of s.slice(0,-1)){c=c?`${c}/${e}`:e;let t=N.getItem(`${c}/`)??N.getItem(c);t&&`expand`in t&&t.expand()}`expand`in o&&o.expand(),o.select(),N.scrollToPath(a,{focus:!0,offset:`center`}),queueMicrotask(()=>{ee.current=!1})},[E,N,r,i]);let he=(0,q.useRef)(null);return(0,q.useEffect)(()=>{M.current=N},[N]),(0,q.useEffect)(()=>{let e=he.current;if(e===null)return;let t=e=>oe.handleDragStart(e),n=()=>oe.handleDragEnd();return e.addEventListener(`dragstart`,t,!0),e.addEventListener(`dragend`,n),()=>{e.removeEventListener(`dragstart`,t,!0),e.removeEventListener(`dragend`,n)}},[oe]),(0,$.jsxs)(`div`,{ref:he,className:`flex min-h-0 flex-1 flex-col bg-background`,"data-file-browser-panel":`${e}:${t}`,children:[(0,$.jsxs)(`div`,{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-1 in-data-[preview-panel-mode=inline]:h-9 in-data-[preview-panel-mode=inline]:min-h-9 in-data-[preview-panel-mode=inline]:border-b-transparent`,"data-surface-subheader":!0,children:[(0,$.jsx)(po,{isPending:g,onRefresh:me}),(0,$.jsx)(mo,{name:`project-files-search`,ariaLabel:`Search ${n} files`,value:se.value,onValueChange:pe,onClose:P}),k.length>0?(0,$.jsx)(S,{type:`button`,size:`icon-xs`,variant:`ghost`,"aria-label":x||ce?`Collapse all folders`:`Expand all folders`,onClick:le,children:(0,$.jsx)(fe,{className:`size-3.5`,icon:ce?de:ue})}):null]}),h||w.error?(0,$.jsxs)(`button`,{type:`button`,onClick:me,className:`p-4 text-left text-xs leading-relaxed text-destructive`,children:[h??w.error,` Click to retry.`]}):null,v.trim()&&w.truncated&&!w.isPending?(0,$.jsx)(`div`,{className:`px-3 py-1 text-xs text-muted-foreground`,children:`More matches available. Refine your search.`}):null,(!m||w.isPending)&&(0,$.jsx)(`div`,{role:`status`,className:`px-3 py-1 text-xs text-muted-foreground`,children:`Loading files…`}),(0,$.jsx)(Ot,{model:N,"aria-label":`${n} files`,className:`min-h-0 flex-1 overflow-hidden`,style:kt(c)})]})}function go(e,t){let n=N(t),r=j(t)?`\\`:`/`,i=t.split(/[\\/]/).filter(Boolean),a=t.startsWith(`\\\\`)?`\\\\`:n&&r===`/`?`/`:``;return[...n?[]:[{label:e,path:``,kind:`project`}],...i.map((e,t)=>({label:e,path:a+i.slice(0,t+1).join(r),kind:t===i.length-1?`file`:`directory`}))]}function _o(e,t){let n,r=t?`${t}/`:``;return e.flatMap(e=>{if(!e.path.startsWith(r))return[];let t=e.path.slice(r.length);return!t||t.includes(`/`)?[]:[{...e,label:t}]}).toSorted((e,t)=>e.kind===t.kind?(n??=new Intl.Collator(void 0,{numeric:!0,sensitivity:`base`}),n.compare(e.label,t.label)):e.kind===`directory`?-1:1)}function vo(e){if(!e)return null;let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function yo(e,t){return e.slice(e.lastIndexOf(`/`)+1)||t}function bo(e){let t=(0,Q.c)(12),n=e.current?`font-medium text-foreground`:`text-muted-foreground`,r;t[0]===n?r=t[1]:(r=E(`block max-w-40 truncate rounded-sm px-0.5`,n),t[0]=n,t[1]=r);let i;t[2]===r?i=t[3]:(i=(0,$.jsx)(`span`,{className:r}),t[2]=r,t[3]=i);let a;t[4]!==e.label||t[5]!==i?(a=(0,$.jsx)(vt,{render:i,children:e.label}),t[4]=e.label,t[5]=i,t[6]=a):a=t[6];let o;t[7]===e.pathLabel?o=t[8]:(o=(0,$.jsx)(yt,{side:`top`,children:e.pathLabel}),t[7]=e.pathLabel,t[8]=o);let s;return t[9]!==a||t[10]!==o?(s=(0,$.jsxs)(bt,{children:[a,o]}),t[9]=a,t[10]=o,t[11]=s):s=t[11],s}function xo(e){let t=(0,Q.c)(44),r=pn(e.environmentId,e.cwd,e.directoryPath),a=`files:${e.environmentId}:${e.cwd}`,o;t[0]!==r.refresh||t[1]!==e.workspaceMutationId||t[2]!==a?(o={mutationId:e.workspaceMutationId,refresh:r.refresh,resourceKey:a},t[0]=r.refresh,t[1]=e.workspaceMutationId,t[2]=a,t[3]=o):o=t[3],_n(o);let{resolvedTheme:s}=ye(),c;t[4]===r.data?.entries?c=t[5]:(c=r.data?.entries??[],t[4]=r.data?.entries,t[5]=c);let l=c,u=r.data?.truncated??!1,d;t[6]!==l||t[7]!==e.directoryPath?(d=_o(l,e.directoryPath),t[6]=l,t[7]=e.directoryPath,t[8]=d):d=t[8];let p=d,g=r.data!==null,_,y,b,x,S;if(t[9]!==e){let r=vo(e.directoryPath),i=e.directoryPath!==e.rootPath&&r!==null&&(e.rootPath===``||r===e.rootPath||r.startsWith(`${e.rootPath}/`));_=n,y=`start`,b=`bottom`,x=t=>{t.key===`ArrowLeft`&&i&&r!==null&&(t.preventDefault(),t.stopPropagation(),e.onDirectoryChange(r))},S=i&&r!==null?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(m,{closeOnClick:!1,onClick:()=>e.onDirectoryChange(r),children:[(0,$.jsx)(h,{}),(0,$.jsxs)(`span`,{className:`truncate`,children:[`Back to `,yo(r,e.projectName)]})]}),(0,$.jsx)(T,{})]}):null,t[9]=e,t[10]=_,t[11]=y,t[12]=b,t[13]=x,t[14]=S}else _=t[10],y=t[11],b=t[12],x=t[13],S=t[14];let C;t[15]!==p||t[16]!==g||t[17]!==r.data||t[18]!==r.error||t[19]!==r.isPending||t[20]!==r.refresh||t[21]!==u||t[22]!==e||t[23]!==s?(C=r.isPending&&r.data===null?(0,$.jsxs)(m,{disabled:!0,children:[(0,$.jsx)(he,{}),`Loading folder…`]}):r.error&&r.data===null?(0,$.jsxs)(m,{closeOnClick:!1,onClick:r.refresh,children:[(0,$.jsx)(mn,{refreshing:r.isPending}),(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:`Retry loading folder`})]}):!g&&!u?(0,$.jsx)(m,{disabled:!0,children:`This folder is no longer available.`}):p.length===0?(0,$.jsx)(m,{disabled:!0,children:u?`No entries from this folder are available in the partial workspace index.`:`This folder is empty.`}):(0,$.jsx)(v,{value:e.currentFilePath,onValueChange:t=>{e.onOpenChange(!1),e.onOpenFile(t)},children:p.map(t=>{let n=t.kind===`file`&&t.path===e.currentFilePath,r=(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(rn,{pathValue:t.path,kind:t.kind,theme:s}),(0,$.jsxs)(bt,{children:[(0,$.jsx)(vt,{render:(0,$.jsx)(`span`,{className:E(`min-w-0 flex-1 truncate`,t.ignored&&`text-muted-foreground`)}),children:t.label}),(0,$.jsx)(yt,{side:`right`,children:t.path})]})]});return t.kind===`directory`?(0,$.jsxs)(m,{closeOnClick:!1,onClick:()=>e.onDirectoryChange(t.path),children:[r,(0,$.jsx)(i,{})]},t.path):(0,$.jsx)(D,{value:t.path,closeOnClick:!0,"aria-current":n?`page`:void 0,children:(0,$.jsx)(`span`,{className:`flex min-w-0 items-center gap-2`,children:r})},t.path)})}),t[15]=p,t[16]=g,t[17]=r.data,t[18]=r.error,t[19]=r.isPending,t[20]=r.refresh,t[21]=u,t[22]=e,t[23]=s,t[24]=C):C=t[24];let w;t[25]!==e.directoryPath||t[26]!==C?(w=(0,$.jsx)(f,{children:C},e.directoryPath),t[25]=e.directoryPath,t[26]=C,t[27]=w):w=t[27];let O;t[28]!==r.data||t[29]!==r.error||t[30]!==r.isPending||t[31]!==r.refresh?(O=r.error&&r.data!==null?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(T,{}),(0,$.jsxs)(m,{closeOnClick:!1,onClick:r.refresh,children:[(0,$.jsx)(mn,{refreshing:r.isPending}),`Refresh failed — retry`]})]}):null,t[28]=r.data,t[29]=r.error,t[30]=r.isPending,t[31]=r.refresh,t[32]=O):O=t[32];let k;t[33]===u?k=t[34]:(k=u?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(T,{}),(0,$.jsx)(m,{disabled:!0,children:`Some workspace entries are not shown.`})]}):null,t[33]=u,t[34]=k);let A;return t[35]!==_||t[36]!==O||t[37]!==k||t[38]!==y||t[39]!==b||t[40]!==x||t[41]!==S||t[42]!==w?(A=(0,$.jsxs)(_,{align:y,side:b,onKeyDown:x,children:[S,w,O,k]}),t[35]=_,t[36]=O,t[37]=k,t[38]=y,t[39]=b,t[40]=x,t[41]=S,t[42]=w,t[43]=A):A=t[43],A}function So(e){let t=(0,Q.c)(35),[n,r]=(0,q.useState)(!1),[i,a]=(0,q.useState)(e.crumb.path),o;t[0]===e.crumb.path?o=t[1]:(o=()=>{r(!1),a(e.crumb.path)},t[0]=e.crumb.path,t[1]=o);let s;t[2]!==e.crumb.path||t[3]!==e.relativePath?(s=[e.crumb.path,e.relativePath],t[2]=e.crumb.path,t[3]=e.relativePath,t[4]=s):s=t[4],(0,q.useEffect)(o,s);let c;t[5]===e.crumb.path?c=t[6]:(c=t=>{r(t),t&&a(e.crumb.path)},t[5]=e.crumb.path,t[6]=c);let l=c,u=`Browse ${e.crumb.label}`,d;t[7]===u?d=t[8]:(d=(0,$.jsx)(_,{render:(0,$.jsx)(`button`,{type:`button`,"aria-label":u,className:`relative block max-w-40 cursor-pointer rounded-sm px-0.5 text-left text-muted-foreground outline-none pointer-coarse:after:-inset-y-3 pointer-coarse:after:absolute pointer-coarse:after:inset-x-0 hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring data-popup-open:bg-accent data-popup-open:text-foreground`})}),t[7]=u,t[8]=d);let f;t[9]===e.crumb.label?f=t[10]:(f=(0,$.jsx)(`span`,{className:`block truncate`,children:e.crumb.label}),t[9]=e.crumb.label,t[10]=f);let p;t[11]!==d||t[12]!==f?(p=(0,$.jsx)(vt,{render:d,children:f}),t[11]=d,t[12]=f,t[13]=p):p=t[13];let m=e.crumb.path||e.projectName,h;t[14]===m?h=t[15]:(h=(0,$.jsx)(yt,{side:`top`,children:m}),t[14]=m,t[15]=h);let g;t[16]!==p||t[17]!==h?(g=(0,$.jsxs)(bt,{children:[p,h]}),t[16]=p,t[17]=h,t[18]=g):g=t[18];let v;t[19]!==i||t[20]!==l||t[21]!==n||t[22]!==e.crumb.path||t[23]!==e.cwd||t[24]!==e.environmentId||t[25]!==e.onOpenFile||t[26]!==e.projectName||t[27]!==e.relativePath||t[28]!==e.workspaceMutationId?(v=n?(0,$.jsx)(xo,{cwd:e.cwd,currentFilePath:e.relativePath,directoryPath:i,environmentId:e.environmentId,onDirectoryChange:a,onOpenChange:l,onOpenFile:e.onOpenFile,projectName:e.projectName,rootPath:e.crumb.path,workspaceMutationId:e.workspaceMutationId}):null,t[19]=i,t[20]=l,t[21]=n,t[22]=e.crumb.path,t[23]=e.cwd,t[24]=e.environmentId,t[25]=e.onOpenFile,t[26]=e.projectName,t[27]=e.relativePath,t[28]=e.workspaceMutationId,t[29]=v):v=t[29];let y;return t[30]!==l||t[31]!==n||t[32]!==v||t[33]!==g?(y=(0,$.jsxs)(w,{open:n,onOpenChange:l,children:[g,v]}),t[30]=l,t[31]=n,t[32]=v,t[33]=g,t[34]=y):y=t[34],y}function Co(e){let t=(0,Q.c)(12),n;t[0]===e.relativePath?n=t[1]:(n=N(e.relativePath),t[0]=e.relativePath,t[1]=n);let r=n,a;t[2]!==e.projectName||t[3]!==e.relativePath?(a=go(e.projectName,e.relativePath),t[2]=e.projectName,t[3]=e.relativePath,t[4]=a):a=t[4];let o=a,s;if(t[5]!==o||t[6]!==r||t[7]!==e){let n;t[9]!==r||t[10]!==e?(n=(t,n)=>(0,$.jsxs)(`div`,{className:`flex min-w-0 shrink-0 items-center`,"data-current-file-crumb":t.kind===`file`,children:[n>0?(0,$.jsx)(i,{className:`mx-1 size-3.5 shrink-0 text-muted-foreground/60`}):null,t.kind===`file`?(0,$.jsx)(`span`,{"aria-current":`page`,children:(0,$.jsx)(bo,{current:!0,label:t.label,pathLabel:t.path})}):r?(0,$.jsx)(bo,{label:t.label,pathLabel:t.path}):(0,$.jsx)(So,{...e,crumb:t})]},t.path||`project`),t[9]=r,t[10]=e,t[11]=n):n=t[11],s=o.map(n),t[5]=o,t[6]=r,t[7]=e,t[8]=s}else s=t[8];return s}function wo(e){let t=(0,Q.c)(14),n;t[0]===e.relativePath?n=t[1]:(n=e.relativePath.lastIndexOf(`/`),t[0]=e.relativePath,t[1]=n);let r;t[2]===e.relativePath?r=t[3]:(r=e.relativePath.lastIndexOf(`\\`),t[2]=e.relativePath,t[3]=r);let i=Math.max(n,r),a;t[4]!==i||t[5]!==e.cwd||t[6]!==e.relativePath?(a=i>=0?Ee(e.relativePath.slice(0,i),e.cwd):e.cwd,t[4]=i,t[5]=e.cwd,t[6]=e.relativePath,t[7]=a):a=t[7];let o=a,s;return t[8]!==o||t[9]!==e.cwd||t[10]!==e.onTaskListChange||t[11]!==e.text||t[12]!==e.threadRef?(s=(0,$.jsx)(pe,{text:e.text,cwd:e.cwd,imageBaseDir:o,threadRef:e.threadRef,className:`mx-auto max-w-4xl px-6 py-5`,onTaskListChange:e.onTaskListChange}),t[8]=o,t[9]=e.cwd,t[10]=e.onTaskListChange,t[11]=e.text,t[12]=e.threadRef,t[13]=s):s=t[13],s}function To({root:e,editor:t,onDismiss:n}){n(),t.setSelections([]);let r=e.querySelector(`diffs-container`)?.shadowRoot?.activeElement;r instanceof HTMLElement&&r.blur()}function Eo(e){return e.querySelector(`diffs-container`)?.shadowRoot?.activeElement?.hasAttribute(`data-content`)===!0}function Do({root:e,editor:t,isBlocked:n,onDismiss:r}){let i=i=>{n()||i.composedPath().includes(e)||To({root:e,editor:t,onDismiss:r})},a=i=>{i.key===`Escape`&&!n()&&Eo(e)&&(i.preventDefault(),i.stopImmediatePropagation(),To({root:e,editor:t,onDismiss:r}))};return document.addEventListener(`pointerdown`,i,!0),document.addEventListener(`keydown`,a,!0),()=>{document.removeEventListener(`pointerdown`,i,!0),document.removeEventListener(`keydown`,a,!0)}}function Oo(e){let t=e.renderedLine===void 0?e.fileTop+e.estimatedLine.top:e.scrollTop+e.renderedLine.top-e.viewportTop,n=e.renderedLine?.height??e.estimatedLine.height,r=Math.max(0,t-Math.max(0,(e.viewportHeight-n)/2));return Math.min(r,Math.max(0,e.scrollHeight-e.viewportHeight))}function ko(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return`${e.length}:${(t>>>0).toString(36)}`}function Ao(e,t,n){return`${e}:${t}:${ko(n)}`}function jo(e,t){return e===null||e===`.`||M(e,t)===`.`?null:e}var Mo=e=>/\.(?:md|mdx)$/i.test(e);function No(e){switch(e.failure){case`path_not_file`:return`The path is a directory or special file, not a regular file.`;case`binary_file`:return`The file is binary and cannot be displayed as text.`;case`workspace_path_outside_root`:return`The requested path is outside the workspace.`;case`resolved_path_outside_root`:return`The path resolves to a location outside the workspace.`;case`operation_failed`:return e.operation===`realpath-workspace-root`?`The workspace folder could not be accessed.`:`The file could not be accessed or read. It may be missing or inaccessible.`;default:return e.message}}function Po(e){return e.attachmentOpen||e.relativePath&&N(e.relativePath)?!1:e.explorerOpen||e.relativePath===null}function Fo(e,t,n){return t<0||e[t]!==`[`||!/[ xX]/.test(e[t+1]??``)||e[t+2]!==`]`?e:`${e.slice(0,t+1)}${n?`x`:` `}${e.slice(t+2)}`}function Io(e){return e.draft?{_tag:`draft-workspace-file`,cwd:e.workspaceRoot,path:e.absolutePath}:{_tag:e.kind,threadId:e.threadRef.threadId,path:e.absolutePath}}var Lo=class{options;timer=null;latestContents=``;latestRevision=0;confirmedRevision=0;lastChangeAt=0;saving=!1;disposed=!1;constructor(e){this.options=e}change(e){this.disposed||(this.latestContents=e,this.latestRevision+=1,this.lastChangeAt=Date.now(),this.options.onPendingChange(!0),this.schedule(this.options.debounceMs))}dispose(){this.disposed=!0,this.clearTimer(),this.latestRevision>0&&this.persistLatest()}schedule(e){this.clearTimer(),this.timer=setTimeout(()=>{this.timer=null,this.persistLatest()},e)}clearTimer(){this.timer!==null&&(clearTimeout(this.timer),this.timer=null)}async persistLatest(){if(this.saving||this.latestRevision===this.confirmedRevision||this.options.canPersist?.()===!1)return;this.saving=!0;let e=this.latestContents,t=this.latestRevision,n=(await this.options.persist(e))._tag===`Success`,r=!1;if(n&&(this.confirmedRevision=t,r=this.options.onConfirmed(e)!==!1),this.saving=!1,t===this.latestRevision){r&&this.options.onPendingChange(!1);return}let i=Math.max(0,this.options.debounceMs-(Date.now()-this.lastChangeAt));this.disposed?this.persistLatest():this.schedule(i)}},Ro=500;function zo(e){let t=(0,Q.c)(17),{environmentId:n,cwd:r,relativePath:i,onPendingChange:a}=e,o=Ce(n,k),s=Te(re.writeFile),c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,q.createRef)(),t[0]=c):c=t[0];let l=c,u;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(u=e=>l.current?.change(e),t[1]=u):u=t[1];let d;t[2]!==r||t[3]!==n||t[4]!==a||t[5]!==i||t[6]!==s?(d={change:u,setup:()=>{let e=new Lo({debounceMs:Ro,canPersist:()=>we(n,k),onPendingChange:e=>a(i,e),persist:e=>s({environmentId:n,input:{cwd:r,relativePath:i,contents:e}}),onConfirmed:e=>fn(n,r,i,e)});return l.current=e,()=>{l.current=null,e.dispose()}}},t[2]=r,t[3]=n,t[4]=a,t[5]=i,t[6]=s,t[7]=d):d=t[7];let f=d,p;t[8]===f?p=t[9]:(p=[f],t[8]=f,t[9]=p),(0,q.useEffect)(f.setup,p);let m,h;return t[10]!==o||t[11]!==r||t[12]!==n||t[13]!==i||t[14]!==f?(m=()=>{if(!o)return;let e=!1;return queueMicrotask(()=>{if(e)return;let t=dn(n,r,i);t&&f.change(t.contents)}),()=>{e=!0}},h=[o,r,n,i,f],t[10]=o,t[11]=r,t[12]=n,t[13]=i,t[14]=f,t[15]=m,t[16]=h):(m=t[15],h=t[16]),(0,q.useEffect)(m,h),f}var Bo=`p4code.fileExplorerOpen`,Vo=`p4code.renderMarkdown`,Ho=`p4code.renderBrowserFile`,Uo=`p4code.renderTable`;function Wo(e){let t=(0,Q.c)(28),n;t[0]!==e.absolutePath||t[1]!==e.draft||t[2]!==e.threadRef||t[3]!==e.workspaceRoot?(n=Io({kind:`workspace-file`,threadRef:e.threadRef,draft:e.draft,workspaceRoot:e.workspaceRoot,absolutePath:e.absolutePath}),t[0]=e.absolutePath,t[1]=e.draft,t[2]=e.threadRef,t[3]=e.workspaceRoot,t[4]=n):n=t[4];let r=n,i=en(e.environmentId,r),[a,o]=(0,q.useState)(null),s;t[5]!==i._tag||t[6]!==i.url||t[7]!==e.workspaceMutationId?(s=e.workspaceMutationId===null?``:`${i._tag===`Success`&&i.url.includes(`?`)?`&`:`?`}workspace-revision=${encodeURIComponent(e.workspaceMutationId)}`,t[5]=i._tag,t[6]=i.url,t[7]=e.workspaceMutationId,t[8]=s):s=t[8];let c=s,l=i._tag===`Success`?`${i.url}${c}`:null,u=e.alt,d;t[9]!==e.absolutePath||t[10]!==e.workspaceRoot?(d=_t(e.absolutePath,e.workspaceRoot),t[9]=e.absolutePath,t[10]=e.workspaceRoot,t[11]=d):d=t[11];let f;t[12]!==e.environmentId||t[13]!==r?(f={environmentId:e.environmentId,resource:r},t[12]=e.environmentId,t[13]=r,t[14]=f):f=t[14];let p;t[15]!==l||t[16]!==e.alt||t[17]!==d||t[18]!==f?(p={kind:`image`,name:u,src:l,reference:d,asset:f},t[15]=l,t[16]=e.alt,t[17]=d,t[18]=f,t[19]=p):p=t[19];let m=p;if(i._tag===`Failure`||l!==null&&a===l){let e;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center px-6 text-center text-xs leading-relaxed text-destructive`,children:`Unable to load workspace image.`}),t[20]=e):e=t[20];let n;return t[21]===m?n=t[22]:(n=(0,$.jsx)(F,{source:m,children:e}),t[21]=m,t[22]=n),n}let h;return t[23]!==m||t[24]!==i._tag||t[25]!==l||t[26]!==e.alt?(h=i._tag===`Success`&&l!==null?(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center overflow-auto p-4`,children:(0,$.jsx)(F,{source:m,children:(0,$.jsx)(`img`,{className:`max-h-full max-w-full object-contain`,src:l,alt:e.alt,onError:()=>o(l)})})}):(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center text-muted-foreground`,children:(0,$.jsx)(he,{size:`lg`})}),t[23]=m,t[24]=i._tag,t[25]=l,t[26]=e.alt,t[27]=h):h=t[27],h}function Go(e){let t=(0,Q.c)(18),n=_t(e.absolutePath,e.workspaceRoot).relativePath===void 0?`media-file`:`workspace-file`,r;t[0]!==e.absolutePath||t[1]!==e.draft||t[2]!==e.threadRef||t[3]!==e.workspaceRoot||t[4]!==n?(r=Io({kind:n,threadRef:e.threadRef,draft:e.draft,workspaceRoot:e.workspaceRoot,absolutePath:e.absolutePath}),t[0]=e.absolutePath,t[1]=e.draft,t[2]=e.threadRef,t[3]=e.workspaceRoot,t[4]=n,t[5]=r):r=t[5];let i=r,a=en(e.environmentId,i),o;t[6]!==a._tag||t[7]!==a.url||t[8]!==e.workspaceMutationId?(o=e.workspaceMutationId===null?``:`${a._tag===`Success`&&a.url.includes(`?`)?`&`:`?`}workspace-revision=${encodeURIComponent(e.workspaceMutationId)}`,t[6]=a._tag,t[7]=a.url,t[8]=e.workspaceMutationId,t[9]=o):o=t[9];let s=o;if(a._tag===`Failure`){let e;return t[10]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center px-6 text-center text-xs leading-relaxed text-destructive`,children:`Unable to load file preview.`}),t[10]=e):e=t[10],e}if(a._tag!==`Success`){let e;return t[11]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center text-muted-foreground`,children:(0,$.jsx)(he,{size:`lg`})}),t[11]=e):e=t[11],e}let c=`${a.url}${s}`,l=e.title,u;t[12]===e.absolutePath?u=t[13]:(u=Bt(e.absolutePath),t[12]=e.absolutePath,t[13]=u);let d;return t[14]!==e.title||t[15]!==c||t[16]!==u?(d=(0,$.jsx)(zt,{src:c,title:l,pdf:u}),t[14]=e.title,t[15]=c,t[16]=u,t[17]=d):d=t[17],d}function Ko(e){let t=(0,Q.c)(36),n;t[0]!==e.absolutePath||t[1]!==e.draft||t[2]!==e.threadRef||t[3]!==e.workspaceRoot?(n=Io({kind:`media-file`,threadRef:e.threadRef,draft:e.draft,workspaceRoot:e.workspaceRoot,absolutePath:e.absolutePath}),t[0]=e.absolutePath,t[1]=e.draft,t[2]=e.threadRef,t[3]=e.workspaceRoot,t[4]=n):n=t[4];let r=n,i=en(e.environmentId,r),a=Qt(e.environmentId,r),o=e.workspaceMutationId,s;t[5]!==e.environmentId||t[6]!==r?(s=JSON.stringify([e.environmentId,r]),t[5]=e.environmentId,t[6]=r,t[7]=s):s=t[7];let c;t[8]===a?c=t[9]:(c=()=>{a().catch(qo)},t[8]=a,t[9]=c);let l;t[10]!==e.workspaceMutationId||t[11]!==s||t[12]!==c?(l={mutationId:o,resourceKey:s,refresh:c},t[10]=e.workspaceMutationId,t[11]=s,t[12]=c,t[13]=l):l=t[13],_n(l);let u;t[14]!==i._tag||t[15]!==i.url||t[16]!==e.workspaceMutationId?(u=e.workspaceMutationId===null?``:`${i._tag===`Success`&&i.url.includes(`?`)?`&`:`?`}workspace-revision=${encodeURIComponent(e.workspaceMutationId)}`,t[14]=i._tag,t[15]=i.url,t[16]=e.workspaceMutationId,t[17]=u):u=t[17];let d=u,f=i._tag===`Success`?`${i.url}${d}`:null,p=i._tag===`Failure`,m=e.name,h=e.workspaceMutationId,g=e.name,_;t[18]!==e.absolutePath||t[19]!==e.workspaceRoot?(_=_t(e.absolutePath,e.workspaceRoot),t[18]=e.absolutePath,t[19]=e.workspaceRoot,t[20]=_):_=t[20];let v;t[21]!==e.environmentId||t[22]!==r?(v={environmentId:e.environmentId,resource:r},t[21]=e.environmentId,t[22]=r,t[23]=v):v=t[23];let y;t[24]!==f||t[25]!==e.name||t[26]!==_||t[27]!==v?(y={kind:`video`,name:g,src:f,reference:_,asset:v},t[24]=f,t[25]=e.name,t[26]=_,t[27]=v,t[28]=y):y=t[28];let b;return t[29]!==f||t[30]!==e.name||t[31]!==e.workspaceMutationId||t[32]!==a||t[33]!==y||t[34]!==p?(b=(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center overflow-hidden p-4`,children:(0,$.jsx)(P,{src:f,sourceFailed:p,label:m,revision:h,preload:`metadata`,className:`flex h-full min-h-0 w-full max-w-5xl items-center justify-center`,onRetry:a,actionsSource:y})}),t[29]=f,t[30]=e.name,t[31]=e.workspaceMutationId,t[32]=a,t[33]=y,t[34]=p,t[35]=b):b=t[35],b}function qo(){}function Jo(e){let t=(0,Q.c)(27),n;t[0]!==e.absolutePath||t[1]!==e.draft||t[2]!==e.threadRef||t[3]!==e.workspaceRoot?(n=Io({kind:`media-file`,threadRef:e.threadRef,draft:e.draft,workspaceRoot:e.workspaceRoot,absolutePath:e.absolutePath}),t[0]=e.absolutePath,t[1]=e.draft,t[2]=e.threadRef,t[3]=e.workspaceRoot,t[4]=n):n=t[4];let r=n,i=en(e.environmentId,r),a=Qt(e.environmentId,r),[o,s]=(0,q.useState)(null),c=e.workspaceMutationId,l;t[5]!==e.environmentId||t[6]!==r?(l=JSON.stringify([e.environmentId,r]),t[5]=e.environmentId,t[6]=r,t[7]=l):l=t[7];let u;t[8]===a?u=t[9]:(u=()=>{a().catch(Xo)},t[8]=a,t[9]=u);let d;t[10]!==e.workspaceMutationId||t[11]!==l||t[12]!==u?(d={mutationId:c,resourceKey:l,refresh:u},t[10]=e.workspaceMutationId,t[11]=l,t[12]=u,t[13]=d):d=t[13],_n(d);let f;t[14]!==i._tag||t[15]!==i.url||t[16]!==e.workspaceMutationId?(f=e.workspaceMutationId===null?``:`${i._tag===`Success`&&i.url.includes(`?`)?`&`:`?`}workspace-revision=${encodeURIComponent(e.workspaceMutationId)}`,t[14]=i._tag,t[15]=i.url,t[16]=e.workspaceMutationId,t[17]=f):f=t[17];let p=f,m=i._tag===`Success`?`${i.url}${p}`:null;if(i._tag===`Failure`||m!==null&&o===m){let e;return t[18]===a?e=t[19]:(e=(0,$.jsx)(Kt,{message:`Unable to load audio.`,onRetry:()=>{s(null),a().catch(Yo)}}),t[18]=a,t[19]=e),e}if(m===null){let e;return t[20]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Ht,{}),t[20]=e):e=t[20],e}let h;t[21]===m?h=t[22]:(h=()=>s(m),t[21]=m,t[22]=h);let g;return t[23]!==e.name||t[24]!==h||t[25]!==m?(g=(0,$.jsx)(Lt,{src:m,name:e.name,onError:h}),t[23]=e.name,t[24]=h,t[25]=m,t[26]=g):g=t[26],g}function Yo(){}function Xo(){}function Zo(e,t){let n=1;for(let t=0;t<e.length;t+=1){let r=e.charCodeAt(t);r===10?n+=1:r===13&&(n+=1,e.charCodeAt(t+1)===10&&(t+=1))}return Math.min(Math.max(1,t),n)}function Qo(e,t){let n=e.shadowRoot??e;for(let e of n.querySelectorAll(`[${Wt}]`))e.removeAttribute(Wt);t!==null&&(n.querySelector(`[data-line="${t}"]`)?.setAttribute(Wt,``),n.querySelector(`[data-column-number="${t}"]`)?.setAttribute(Wt,``))}var $o=30,es=20,ts=2;function ns(e,t,n){let r=(0,Q.c)(5),[i]=(0,q.useState)(rs),a;return r[0]!==e||r[1]!==t||r[2]!==n||r[3]!==i?(a=(r,a,o)=>{if(e===null)return;let s=i.get(e),c=s??{frameId:null,cancelGuard:null,handledRequestId:null,latestRequestId:null};s||i.set(e,c);let l=()=>{c.frameId!==null&&(cancelAnimationFrame(c.frameId),c.frameId=null),c.cancelGuard?.()};if(o===`unmount`){l();return}let u=a.file?.contents;if(Qo(r,t===null||u===void 0?null:Zo(u,t)),!(a instanceof Ye))return;if(c.latestRequestId!==n&&(l(),c.latestRequestId=n,c.handledRequestId=null),t===null){r.style.minHeight=``;return}let d=r.closest(`.file-preview-virtualizer`);if(!d||(r.style.minHeight=`${Math.ceil(Math.max(a.height,d.clientHeight))}px`,c.handledRequestId===n||c.frameId!==null))return;let f=e=>{let t=a.getLinePosition(e);if(!t)return null;let n=d.getBoundingClientRect(),i=d.scrollTop+r.getBoundingClientRect().top-n.top,o=(r.shadowRoot??r).querySelector(`[data-line="${e}"]`)?.getBoundingClientRect();return Oo({scrollTop:d.scrollTop,scrollHeight:d.scrollHeight,viewportTop:n.top,viewportHeight:d.clientHeight,fileTop:i,estimatedLine:t,...o&&o.height>0?{renderedLine:{top:o.top,height:o.height}}:{}})},p=e=>{let t=es,n=null,r=()=>{n!==null&&(cancelAnimationFrame(n),n=null),d.removeEventListener(`wheel`,r),d.removeEventListener(`touchstart`,r),d.removeEventListener(`pointerdown`,r,!0),window.removeEventListener(`keydown`,r,!0),c.cancelGuard===r&&(c.cancelGuard=null)};d.addEventListener(`wheel`,r,{passive:!0}),d.addEventListener(`touchstart`,r,{passive:!0}),d.addEventListener(`pointerdown`,r,{passive:!0,capture:!0}),window.addEventListener(`keydown`,r,!0);let i=()=>{if(n=null,--t,t<=0||!d.isConnected){r();return}let a=f(e);a!==null&&Math.abs(d.scrollTop-a)>ts&&(d.scrollTop=a),n=requestAnimationFrame(i)};n=requestAnimationFrame(i),c.cancelGuard=r},m=e=>{c.frameId=requestAnimationFrame(()=>{if(c.frameId=null,c.latestRequestId!==n||!r.isConnected)return;let i=a.file?.contents,o=i===void 0?null:Zo(i,t),s=o===null?null:f(o);if(o===null||s===null){e<$o&&m(e+1);return}Qo(r,o),d.scrollTop=s,c.handledRequestId=n,p(o)})};m(0)},r[0]=e,r[1]=t,r[2]=n,r[3]=i,r[4]=a):a=r[4],a}function rs(){return new Map}var is=(e,t,n)=>new to(e,t,n);function as(e,t,n,r){return{name:n,contents:r,cacheKey:`editor:${e}:${Ao(t,n,r)}`}}function os(e,t){if(e?.isWorkingPool()!==!0||(t.lang??gn(t.name))===`text`)return!1;let n=1;for(let e=t.contents.indexOf(`
32
32
  `);e!==-1;e=t.contents.indexOf(`
33
33
  `,e+1))n+=1;return n<=Me}function ss(e){let t=(0,Q.c)(15),n=Ie(),[r,i]=(0,q.useState)(null),a;t[0]!==e||t[1]!==n?(a=os(n,e),t[0]=e,t[1]=n,t[2]=a):a=t[2];let o=!a||r===e,s,c;t[3]!==e||t[4]!==o||t[5]!==n?(s=()=>{o||n===void 0||n.primeFileHighlightCache(e).catch(()=>i(e))},c=[e,o,n],t[3]=e,t[4]=o,t[5]=n,t[6]=s,t[7]=c):(s=t[6],c=t[7]),(0,q.useEffect)(s,c);let l;t[8]!==e||t[9]!==o||t[10]!==n?(l=(t,r)=>{o||r===`unmount`||t?.cacheKey!==e.cacheKey||n?.getFileResultCache(e)!==void 0&&i(e)},t[8]=e,t[9]=o,t[10]=n,t[11]=l):l=t[11];let u=l,d;return t[12]!==u||t[13]!==o?(d={ready:o,onPostRender:u},t[12]=u,t[13]=o,t[14]=d):d=t[14],d}function cs(e){let t=(0,Q.c)(68),{environmentId:n,cwd:r,relativePath:i,composerDraftTarget:o,contents:s,resolvedTheme:c,revealRequestId:l,wordWrap:u,onPostRender:d,onPendingChange:f}=e,p=a(hs),m=a(ms),h;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(h=[],t[0]=h):h=t[0];let[g,_]=(0,q.useState)(h),[v,y]=(0,q.useState)(null),x=v?.revealRequestId===l?v.range:null,S;t[1]===l?S=t[2]:(S=e=>{y({revealRequestId:l,range:e})},t[1]=l,t[2]=S);let C=S,w=(0,q.useRef)(null),T=(0,q.useRef)(null),E;t[3]!==r||t[4]!==n||t[5]!==f||t[6]!==i?(E={environmentId:n,cwd:r,relativePath:i,onPendingChange:f},t[3]=r,t[4]=n,t[5]=f,t[6]=i,t[7]=E):E=t[7];let D=zo(E),O;t[8]!==s||t[9]!==r||t[10]!==n||t[11]!==i?(O=()=>as(n,r,i,s),t[8]=s,t[9]=r,t[10]=n,t[11]=i,t[12]=O):O=t[12];let[k,A]=(0,q.useState)(O),[ee,te]=(0,q.useState)(null);s!==(ee??k.contents)&&(A(as(n,r,i,s)),te(null));let{ready:ne,onPostRender:re}=ss(k),j=(0,q.useRef)(null),ie;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(ie={onAttach:e=>{j.current=e},onComplete:()=>{j.current=null}},t[13]=ie):ie=t[13];let ae=ie,M;t[14]!==p||t[15]!==o||t[16]!==r||t[17]!==n||t[18]!==i||t[19]!==D?(M=e=>{let{file:t,lineAnnotations:a}=e;if(t.contents===cn(n,r,i)||(te(t.contents),ln(n,r,i,t.contents),D.change(t.contents),!a))return;let s=xt(a);_(e=>e===a?e:s);for(let e of s)for(let n of e.metadata.entries)n.kind===`comment`&&p(o,b({id:n.id,filePath:i,startLine:n.startLine,endLine:n.endLine,text:n.text,contents:t.contents}))},t[14]=p,t[15]=o,t[16]=r,t[17]=n,t[18]=i,t[19]=D,t[20]=M):M=t[20];let oe=M,N;t[21]!==o||t[22]!==m||t[23]!==C?(N=e=>{C(null),m(o,e),_(t=>t.flatMap(t=>{let n=t.metadata.entries.filter(t=>t.id!==e);return n.length>0?[{...t,metadata:{entries:n}}]:[]}))},t[21]=o,t[22]=m,t[23]=C,t[24]=N):N=t[24];let se=N,ce;t[25]!==p||t[26]!==o||t[27]!==s||t[28]!==g||t[29]!==i||t[30]!==C?(ce=(e,t)=>{C(null);let n=g.flatMap(ps).find(t=>t.id===e);n&&p(o,b({id:n.id,filePath:i,startLine:n.startLine,endLine:n.endLine,text:t,contents:s})),_(n=>n.map(n=>({...n,metadata:{entries:n.metadata.entries.map(n=>n.id===e?{...n,kind:`comment`,text:t}:n)}})))},t[25]=p,t[26]=o,t[27]=s,t[28]=g,t[29]=i,t[30]=C,t[31]=ce):ce=t[31];let le=ce,ue;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(ue=e=>{j.current?.setSelections([]),j.current?.blur();let{startLine:t,endLine:n}=Ct(e),r={id:St(),kind:`draft`,startLine:t,endLine:n,text:``};_(e=>{let t=e.flatMap(ds),i=t.findIndex(e=>e.lineNumber===n);return i<0?[...t,{lineNumber:n,metadata:{entries:[r]}}]:t.map((e,t)=>t===i?{...e,metadata:{entries:[...e.metadata.entries,r]}}:e)})},t[32]=ue):ue=t[32];let de=ue,fe;t[33]===g?fe=t[34]:(fe=g.some(ls),t[33]=g,t[34]=fe);let P=fe,F,pe;t[35]!==P||t[36]!==C?(F=()=>{let e=w.current;if(e)return Do({root:e,editor:{setSelections:e=>j.current?.setSelections(e)},isBlocked:()=>P,onDismiss:()=>C(null)})},pe=[P,C],t[35]=P,t[36]=C,t[37]=F,t[38]=pe):(F=t[37],pe=t[38]),(0,q.useEffect)(F,pe);let me;t[39]===C?me=t[40]:(me=e=>{C(e),e&&de(e)},t[39]=C,t[40]=me);let he=me,ge;t[41]!==re||t[42]!==d||t[43]!==x?(ge=(e,t,n)=>{d(e,t,n),re(t.file,n),T.current!==null&&(cancelAnimationFrame(T.current),T.current=null),n!==`unmount`&&(T.current=requestAnimationFrame(()=>{T.current=null,e.isConnected&&t.setSelectedLines(x,{notify:!1})}))},t[41]=re,t[42]=d,t[43]=x,t[44]=ge):ge=t[44];let _e=ge,ve;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(ve={overscrollSize:600,intersectionObserverMargin:1200},t[45]=ve):ve=t[45];let I=!P,ye=!P,be=u?`wrap`:`scroll`,xe;t[46]===c?xe=t[47]:(xe=je(c),t[46]=c,t[47]=xe);let Se;t[48]!==he||t[49]!==_e||t[50]!==c||t[51]!==C||t[52]!==I||t[53]!==ye||t[54]!==be||t[55]!==xe?(Se={disableFileHeader:!0,enableGutterUtility:I,enableLineSelection:ye,onGutterUtilityClick:C,onLineSelectionChange:C,onLineSelectionEnd:he,overflow:be,theme:xe,preferredHighlighter:hn,themeType:c,unsafeCSS:qt,onPostRender:_e},t[48]=he,t[49]=_e,t[50]=c,t[51]=C,t[52]=I,t[53]=ye,t[54]=be,t[55]=xe,t[56]=Se):Se=t[56];let Ce;t[57]!==se||t[58]!==le?(Ce=e=>(0,$.jsx)(`div`,{className:`py-1`,children:e.metadata.entries.map(e=>(0,$.jsx)(pt,{kind:e.kind,rangeLabel:wt(e.startLine,e.endLine),text:e.text,onCancel:()=>se(e.id),onComment:t=>le(e.id,t),onDelete:()=>se(e.id)},e.id))}),t[57]=se,t[58]=le,t[59]=Ce):Ce=t[59];let we;return t[60]!==ne||t[61]!==k||t[62]!==oe||t[63]!==g||t[64]!==x||t[65]!==Se||t[66]!==Ce?(we=(0,$.jsx)(Le,{createEditor:is,children:(0,$.jsx)(`div`,{ref:w,className:`flex min-h-0 flex-1`,children:(0,$.jsx)(Re,{className:`file-preview-virtualizer min-h-0 flex-1 overflow-auto`,config:ve,children:(0,$.jsx)(Tt,{file:k,edit:ne,editorOptions:ae,onEditChange:oe,options:Se,selectedLines:x,lineAnnotations:g,renderAnnotation:Ce,className:`min-h-full`})})})}),t[60]=ne,t[61]=k,t[62]=oe,t[63]=g,t[64]=x,t[65]=Se,t[66]=Ce,t[67]=we):we=t[67],we}function ls(e){return e.metadata.entries.some(us)}function us(e){return e.kind===`draft`}function ds(e){let t=e.metadata.entries.filter(fs);return t.length>0?[{...e,metadata:{entries:t}}]:[]}function fs(e){return e.kind!==`draft`}function ps(e){return e.metadata.entries}function ms(e){return e.removeReviewComment}function hs(e){return e.addReviewComment}function gs(e){let t=(0,Q.c)(18),{environmentId:n,cwd:r,relativePath:i,contents:a,threadRef:o,readOnly:s,onPendingChange:c}=e,l;t[0]!==r||t[1]!==n||t[2]!==c||t[3]!==i?(l={environmentId:n,cwd:r,relativePath:i,onPendingChange:c},t[0]=r,t[1]=n,t[2]=c,t[3]=i,t[4]=l):l=t[4];let u=zo(l),d;t[5]!==a||t[6]!==r||t[7]!==n||t[8]!==s||t[9]!==i||t[10]!==u?(d=s?void 0:e=>{let{markerOffset:t,checked:o}=e,s=un(n,r,i)?.contents??a,c=Fo(s,t,o);c!==s&&(ln(n,r,i,c),u.change(c))},t[5]=a,t[6]=r,t[7]=n,t[8]=s,t[9]=i,t[10]=u,t[11]=d):d=t[11];let f;return t[12]!==a||t[13]!==r||t[14]!==i||t[15]!==d||t[16]!==o?(f=(0,$.jsx)(It,{className:`min-h-0 flex-1`,children:(0,$.jsx)(wo,{text:a,cwd:r,relativePath:i,threadRef:o,onTaskListChange:d})}),t[12]=a,t[13]=r,t[14]=i,t[15]=d,t[16]=o,t[17]=f):f=t[17],f}function _s(e,t){return e===`markdown`?t?`Show markdown source`:`Show rendered markdown`:e===`table`?t?`Show source`:`Show table`:t?`Show HTML source`:`Show rendered page`}function vs(){try{return o(Bo,s)??!0}catch(e){return console.error(e),!0}}function ys(e){let t=(0,Q.c)(156),{environmentId:n,cwd:i,projectName:a,relativePath:o,attachment:c,threadRef:d,composerDraftTarget:f,keybindings:p,availableEditors:m,revealLine:h,revealRequestId:_,onOpenFile:v,onPendingChange:y,selectedFilePending:b,workspaceMutationId:x}=e,S;t[0]!==c||t[1]!==i||t[2]!==o?(S=c===void 0?jo(o,i):o,t[0]=c,t[1]=i,t[2]=o,t[3]=S):S=t[3];let C=S,w=typeof f==`string`,{resolvedTheme:T}=ye(),D=xe(xs),A=Ce(n,O),re=be(),j=me(n),M=ve(n),ue=tn(n),de;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(de={reportFailure:!1},t[4]=de):de=t[4];let P=Zt(Yt.createUrl,de),F;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(F={reportFailure:!1},t[5]=F):F=t[5];let pe=Te(nn.open,F),_e;t[6]===C?_e=t[7]:(_e=C!==null&&ae(C),t[6]=C,t[7]=_e);let I=_e,we;t[8]!==I||t[9]!==C?(we=C!==null&&!I&&oe(C),t[8]=I,t[9]=C,t[10]=we):we=t[10];let De=we,ke;t[11]!==I||t[12]!==C?(ke=C!==null&&!I&&ie(C),t[11]=I,t[12]=C,t[13]=ke):ke=t[13];let L=ke,Ae=L||I||De,je;t[14]===C?je=t[15]:(je=C!==null&&Bt(C),t[14]=C,t[15]=je);let R=je,Me;t[16]!==R||t[17]!==C?(Me=C!==null&&!R&&$t(C),t[16]=R,t[17]=C,t[18]=Me):Me=t[18];let Ne=Me,Pe;t[19]!==c||t[20]!==C?(Pe=c!==void 0||C!==null&&N(C),t[19]=c,t[20]=C,t[21]=Pe):Pe=t[21];let z=Pe,B=ne(n),{canReadFiles:Fe}=B,Ie=Ce(n,k),V=sn(n,i,C,c===void 0&&C!==null),Le=V.readError?.resolvedPath??V.readError?.operationPath,Re=V.isNotFile&&!z,H=Re?null:C,[ze,Be]=(0,q.useState)(vs),Ve=c!==void 0,He;t[22]!==ze||t[23]!==H||t[24]!==Ve?(He=Po({relativePath:H,explorerOpen:ze,attachmentOpen:Ve}),t[22]=ze,t[23]=H,t[24]=Ve,t[25]=He):He=t[25];let Ue=He,[We,Ge]=r(Vo,!1,s),[Ke,qe]=r(Ho,!0,s),[Je,Ye]=r(Uo,!0,s),[Xe,Ze]=(0,q.useState)(null),Qe=(0,q.useRef)(null),et;t[26]===H?et=t[27]:(et=H?Mo(H):!1,t[26]=H,t[27]=et);let tt=et,nt;t[28]!==c||t[29]!==H?(nt=H&&c===void 0?Gt({name:H}):null,t[28]=c,t[29]=H,t[30]=nt):nt=t[30];let rt=nt,it=h===null||Xe?.path===C&&Xe.requestId===_,at=tt&&We&&it,ot=R||Ne&&Ke&&it,st=rt!==null&&Je&&it,U=tt?`markdown`:rt?`table`:Ne?`html`:null,ct=H!==null&&c===void 0&&U!==null,lt=Se(),W=H!==null&&V.data!==null&&!(tt&&at)&&!(rt&&st)&&!ot,ut=tt?at:rt?st:ot,dt=tt?Ge:rt?Ye:qe,ft;t[31]!==c||t[32]!==A||t[33]!==I||t[34]!==ue||t[35]!==H?(ft=A&&H!==null&&c===void 0&&!I&&ue&&$t(H),t[31]=c,t[32]=A,t[33]=I,t[34]=ue,t[35]=H,t[36]=ft):ft=t[36];let G=ft,pt;t[37]!==c||t[38]!==i||t[39]!==C?(pt=C&&c===void 0?Ee(C,i):null,t[37]=c,t[38]=i,t[39]=C,t[40]=pt):pt=t[40];let K=pt,mt=ns(C,h,_),ht=c===void 0&&C!==null&&(Re||!Ae&&!R)&&!b,gt=`file:${n}:${i}:${C??``}`,_t;t[41]!==V.refresh||t[42]!==ht||t[43]!==gt||t[44]!==x?(_t={enabled:ht,mutationId:x,refresh:V.refresh,resourceKey:gt},t[41]=V.refresh,t[42]=ht,t[43]=gt,t[44]=x,t[45]=_t):_t=t[45],_n(_t);let vt;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(vt=()=>{(Qe.current?.querySelector(`[data-current-file-crumb='true']`))?.scrollIntoView({block:`nearest`,inline:`end`})},t[46]=vt):vt=t[46];let yt;t[47]===C?yt=t[48]:(yt=[C],t[47]=C,t[48]=yt),(0,q.useEffect)(vt,yt);let bt;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(bt=()=>{Be(bs)},t[49]=bt):bt=t[49];let xt=bt,St;t[50]!==K||t[51]!==A||t[52]!==Fe||t[53]!==P||t[54]!==i||t[55]!==M||t[56]!==pe||t[57]!==d?(St=()=>{Fe&&A&&K&&M&&(async()=>{let e=await Xt({threadRef:d,filePath:K,workspaceRoot:i,httpBaseUrl:M,createAssetUrl:P,openPreview:pe});if(e._tag===`Success`||ee(e))return;let t=te(e);ge.add(Oe({type:`error`,title:`Unable to open file in browser`,description:t instanceof Error?t.message:`An error occurred.`}))})()},t[50]=K,t[51]=A,t[52]=Fe,t[53]=P,t[54]=i,t[55]=M,t[56]=pe,t[57]=d,t[58]=St):St=t[58];let Ct=St;if(c===void 0&&!Fe){if(B.isPending){let e;return t[59]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center gap-2 text-sm text-muted-foreground`,children:[(0,$.jsx)(he,{className:`size-4`}),`Checking file access...`]}),t[59]=e):e=t[59],e}let e=B.error??`This connection cannot read host files.`,n;return t[60]===e?n=t[61]:(n=(0,$.jsx)(`div`,{className:`p-4 text-sm text-muted-foreground`,children:e}),t[60]=e,t[61]=n),n}let wt;t[62]!==K||t[63]!==c||t[64]!==m||t[65]!==G||t[66]!==ct||t[67]!==i||t[68]!==n||t[69]!==ze||t[70]!==Ct||t[71]!==z||t[72]!==p||t[73]!==v||t[74]!==H||t[75]!==re||t[76]!==a||t[77]!==C||t[78]!==j||t[79]!==ut||t[80]!==U||t[81]!==_||t[82]!==dt||t[83]!==W||t[84]!==lt||t[85]!==D||t[86]!==x?(wt=C&&c===void 0?(0,$.jsxs)(`div`,{className:Vt,"data-surface-subheader":!0,children:[(0,$.jsx)(It,{radius:`none`,ref:Qe,hideScrollbars:!0,scrollFade:!0,className:`min-w-0 flex-1`,"data-file-breadcrumbs":!0,children:(0,$.jsx)(`div`,{className:`flex h-full w-max min-w-full items-center text-xs`,children:(0,$.jsx)(Co,{cwd:i,environmentId:n,onOpenFile:v,projectName:a,relativePath:C,workspaceMutationId:x})})}),K&&(n===re||j.mode!==`local-exec`)?(0,$.jsx)(vn,{environmentId:n,keybindings:p,availableEditors:m,openInCwd:K,compact:!0}):null,ct&&U?(0,$.jsx)(Rt,{label:_s(U,ut),pressed:ut,onPress:()=>{let e=!ut;dt(e),Ze(e&&C!==null?{path:C,requestId:_}:null)},children:(0,$.jsx)(fe,{className:`size-3.5`,icon:ut?le:U===`table`?ce:se})}):null,W?(0,$.jsx)(Rt,{label:D?`Disable word wrap`:`Enable word wrap`,pressed:D,onPress:()=>lt({wordWrap:!D}),children:(0,$.jsx)(l,{className:`size-3.5`})}):null,G?(0,$.jsx)(Rt,{label:`Open file in preview browser`,onPress:Ct,children:(0,$.jsx)(u,{className:`size-3.5`})}):null,!z&&H!==null?(0,$.jsx)(Rt,{label:ze?`Hide file explorer`:`Show file explorer`,pressed:ze,onPress:xt,children:(0,$.jsx)(g,{className:`size-3.5`})}):null]}):null,t[62]=K,t[63]=c,t[64]=m,t[65]=G,t[66]=ct,t[67]=i,t[68]=n,t[69]=ze,t[70]=Ct,t[71]=z,t[72]=p,t[73]=v,t[74]=H,t[75]=re,t[76]=a,t[77]=C,t[78]=j,t[79]=ut,t[80]=U,t[81]=_,t[82]=dt,t[83]=W,t[84]=lt,t[85]=D,t[86]=x,t[87]=wt):wt=t[87];let Tt;t[88]!==c||t[89]!==Ie||t[90]!==B.isPending||t[91]!==z||t[92]!==C?(Tt=C&&!c&&!z&&!Ie&&!B.isPending?(0,$.jsx)(`div`,{className:`shrink-0 border-b px-3 py-1.5 text-2xs text-muted-foreground`,children:`Read-only connection. Unsaved edits are kept until write access returns.`}):null,t[88]=c,t[89]=Ie,t[90]=B.isPending,t[91]=z,t[92]=C,t[93]=Tt):Tt=t[93];let Dt;t[94]!==c||t[95]!==V.data||t[96]!==Ae||t[97]!==H||t[98]!==ot?(Dt=H&&c===void 0&&!Ae&&!ot&&V.data?.truncated?(0,$.jsxs)(`div`,{className:`shrink-0 border-b border-warning/20 bg-warning-surface px-3 py-1.5 text-2xs text-warning-foreground`,children:[`Preview limited to the first 1 MB of a `,V.data.byteLength.toLocaleString(),` byte file.`]}):null,t[94]=c,t[95]=V.data,t[96]=Ae,t[97]=H,t[98]=ot,t[99]=Dt):Dt=t[99];let Ot=H?`flex`:`hidden`,kt;t[100]===Ot?kt=t[101]:(kt=E(`min-w-0 flex-1 flex-col overflow-hidden`,Ot),t[100]=Ot,t[101]=kt);let At;t[102]!==K||t[103]!==c||t[104]!==Le||t[105]!==Ie||t[106]!==f||t[107]!==i||t[108]!==w||t[109]!==n||t[110]!==V.data||t[111]!==V.error||t[112]!==V.readError||t[113]!==De||t[114]!==Re||t[115]!==z||t[116]!==L||t[117]!==tt||t[118]!==I||t[119]!==mt||t[120]!==y||t[121]!==C||t[122]!==ot||t[123]!==at||t[124]!==st||t[125]!==T||t[126]!==_||t[127]!==rt||t[128]!==d||t[129]!==D||t[130]!==x?(At=Re?null:C&&c?(0,$.jsx)(Ut,{name:c.name,mimeType:c.mimeType,sizeBytes:c.sizeBytes,asset:{environmentId:n,attachmentId:c.id},htmlRender:c.htmlRender===!0,threadRef:d},`${n}:${c.id}`):C&&I&&K?(0,$.jsx)(Ko,{environmentId:n,threadRef:d,draft:w,absolutePath:K,workspaceRoot:i,name:C,workspaceMutationId:x},`${n}:${d.threadId}:${K}`):C&&De&&K?(0,$.jsx)(Jo,{environmentId:n,threadRef:d,draft:w,absolutePath:K,workspaceRoot:i,name:C,workspaceMutationId:x},`${n}:${d.threadId}:${K}`):C&&L&&K?(0,$.jsx)(Wo,{environmentId:n,threadRef:d,draft:w,absolutePath:K,workspaceRoot:i,alt:C,workspaceMutationId:x},K):C&&ot&&K?(0,$.jsx)(Go,{environmentId:n,threadRef:d,draft:w,absolutePath:K,workspaceRoot:i,title:C,workspaceMutationId:x},K):C&&V.error&&V.data===null?(0,$.jsx)(`div`,{role:`alert`,className:`scrollbar-gutter-both flex min-h-0 flex-1 flex-col overflow-auto`,children:(0,$.jsxs)(`div`,{className:`my-auto flex shrink-0 flex-col gap-3 px-6 py-6 text-center text-xs leading-relaxed`,children:[(0,$.jsx)(`p`,{className:`text-destructive`,children:V.readError?No(V.readError):V.error}),Le?(0,$.jsxs)(`p`,{className:`text-muted-foreground`,children:[`Attempted path`,(0,$.jsx)(`code`,{className:`block break-all font-mono text-foreground select-all`,children:Le})]}):null,z?null:(0,$.jsxs)(`p`,{className:`text-muted-foreground`,children:[`Workspace folder:`,` `,(0,$.jsx)(`code`,{className:`break-all font-mono select-all`,children:V.readError?.cwd??i}),`. Check the link's path or locate the file in Files.`]})]})}):C&&V.data===null?(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center text-muted-foreground`,children:(0,$.jsx)(he,{size:`lg`})}):C&&V.data?tt&&at?(0,$.jsx)(gs,{environmentId:n,cwd:i,relativePath:C,threadRef:d,contents:V.data.contents,readOnly:z||!Ie,onPendingChange:y},C):rt&&st?(0,$.jsx)(Jt,{name:C,text:V.data.contents,delimiter:rt},C):V.data.truncated||z||!Ie?(0,$.jsx)(Et,{name:C,text:V.data.contents,cacheKey:Ao(i,C,V.data.contents),onPostRender:mt}):(0,$.jsx)($e,{children:(0,$.jsx)(cs,{environmentId:n,cwd:i,relativePath:C,composerDraftTarget:f,contents:V.data.contents,resolvedTheme:T,revealRequestId:_,wordWrap:D,onPostRender:mt,onPendingChange:y},`${C}:${T}`)}):null,t[102]=K,t[103]=c,t[104]=Le,t[105]=Ie,t[106]=f,t[107]=i,t[108]=w,t[109]=n,t[110]=V.data,t[111]=V.error,t[112]=V.readError,t[113]=De,t[114]=Re,t[115]=z,t[116]=L,t[117]=tt,t[118]=I,t[119]=mt,t[120]=y,t[121]=C,t[122]=ot,t[123]=at,t[124]=st,t[125]=T,t[126]=_,t[127]=rt,t[128]=d,t[129]=D,t[130]=x,t[131]=At):At=t[131];let jt;t[132]!==kt||t[133]!==At?(jt=(0,$.jsx)(`div`,{className:kt,children:At}),t[132]=kt,t[133]=At,t[134]=jt):jt=t[134];let Mt;t[135]!==i||t[136]!==n||t[137]!==V.refresh||t[138]!==Ae||t[139]!==R||t[140]!==v||t[141]!==H||t[142]!==a||t[143]!==C||t[144]!==_||t[145]!==Ue||t[146]!==x?(Mt=Ue?(0,$.jsx)(`aside`,{className:E(`flex min-h-0 shrink-0 bg-background`,H?`w-[min(22rem,46%)] min-w-64 border-l border-border/60`:`min-w-0 flex-1`),children:(0,$.jsx)(ho,{environmentId:n,cwd:i,projectName:a,selectedPath:C,selectedPathRevealId:_,onOpenFile:v,workspaceMutationId:x,...H&&!Ae&&!R?{onRefreshSelectedFile:V.refresh}:{}},`${n}:${i}`)}):null,t[135]=i,t[136]=n,t[137]=V.refresh,t[138]=Ae,t[139]=R,t[140]=v,t[141]=H,t[142]=a,t[143]=C,t[144]=_,t[145]=Ue,t[146]=x,t[147]=Mt):Mt=t[147];let Nt;t[148]!==jt||t[149]!==Mt?(Nt=(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-1 overflow-hidden`,children:[jt,Mt]}),t[148]=jt,t[149]=Mt,t[150]=Nt):Nt=t[150];let Pt;return t[151]!==wt||t[152]!==Tt||t[153]!==Dt||t[154]!==Nt?(Pt=(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden bg-background`,children:[wt,Tt,Dt,Nt]}),t[151]=wt,t[152]=Tt,t[153]=Dt,t[154]=Nt,t[155]=Pt):Pt=t[155],Pt}function bs(e){let t=!e;try{x(Bo,t,s)}catch(e){console.error(e)}return t}function xs(e){return e.wordWrap}export{ys as default};
34
- //# sourceMappingURL=FilePreviewPanel-BCtCBzc7.js.map
34
+ //# sourceMappingURL=FilePreviewPanel-CN68pCae.js.map
@@ -1,2 +1,2 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Cd as n,RE as r,mE as i,t as a}from"./utils-hgbJ2TVM.js";import{U as o,d as s,f as c}from"./settingsLayout-DkRcMtAs.js";import{da as l,fa as u,ua as d}from"./main-COMts6-0.js";var f=r(),p=e(t(),1),m=e(i(),1);function h(e){let t=(0,f.c)(50),{id:r,title:i,summary:h,control:g,headerPlacement:_,children:v}=e,y=_===void 0?`inside`:_,[b,x]=(0,p.useState)(!1),S=c(),C=s(r),[w,T]=(0,p.useState)(null);if(S===r&&w!==r&&(T(r),b||x(!0)),y===`outside`){let e=b&&`rotate-90`,s;t[0]===e?s=t[1]:(s=a(`size-4 shrink-0 transition-transform duration-150 motion-reduce:transition-none`,e),t[0]=e,t[1]=s);let c;t[2]===s?c=t[3]:(c=(0,m.jsx)(n,{"aria-hidden":!0,className:s}),t[2]=s,t[3]=c);let f;t[4]!==c||t[5]!==i?(f=(0,m.jsx)(`h2`,{children:(0,m.jsxs)(u,{className:`flex min-h-7 items-center gap-2 rounded-md text-sm font-normal text-foreground/70 outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,children:[i,c]})}),t[4]=c,t[5]=i,t[6]=f):f=t[6];let p;t[7]!==g||t[8]!==f?(p=(0,m.jsxs)(`div`,{"data-settings-scroll-target":!0,className:`flex min-h-7 items-start justify-between gap-4 px-3 sm:px-4`,children:[f,g]}),t[7]=g,t[8]=f,t[9]=p):p=t[9];let h;t[10]===v?h=t[11]:(h=(0,m.jsx)(l,{children:(0,m.jsx)(o,{children:v})}),t[10]=v,t[11]=h);let _;t[12]!==p||t[13]!==h?(_=(0,m.jsxs)(`div`,{className:`space-y-2.5`,children:[p,h]}),t[12]=p,t[13]=h,t[14]=_):_=t[14];let y;t[15]!==b||t[16]!==_?(y=(0,m.jsx)(d,{open:b,onOpenChange:x,children:_}),t[15]=b,t[16]=_,t[17]=y):y=t[17];let S;return t[18]!==r||t[19]!==y||t[20]!==C?(S=(0,m.jsx)(`section`,{id:r,ref:C,tabIndex:-1,className:`outline-none`,children:y}),t[18]=r,t[19]=y,t[20]=C,t[21]=S):S=t[21],S}let E;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,m.jsx)(o,{divided:!1}),t[22]=E):E=t[22];let D=b&&`rotate-90`,O;t[23]===D?O=t[24]:(O=a(`size-4 shrink-0 text-muted-foreground transition-transform duration-150 motion-reduce:transition-none`,D),t[23]=D,t[24]=O);let k;t[25]===O?k=t[26]:(k=(0,m.jsx)(n,{"aria-hidden":!0,className:O}),t[25]=O,t[26]=k);let A;t[27]===i?A=t[28]:(A=(0,m.jsx)(`span`,{className:`shrink-0 text-sm font-medium`,children:i}),t[27]=i,t[28]=A);let j;t[29]===h?j=t[30]:(j=h?(0,m.jsx)(`span`,{className:`min-w-0 truncate text-xs text-muted-foreground`,children:h}):null,t[29]=h,t[30]=j);let M;t[31]!==k||t[32]!==A||t[33]!==j?(M=(0,m.jsxs)(u,{className:`flex min-h-11 min-w-0 flex-1 items-center gap-2 py-2 text-left outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring rounded-md`,children:[k,A,j]}),t[31]=k,t[32]=A,t[33]=j,t[34]=M):M=t[34];let N;t[35]===g?N=t[36]:(N=g?(0,m.jsx)(`div`,{className:`flex shrink-0 items-center`,children:g}):null,t[35]=g,t[36]=N);let P;t[37]!==M||t[38]!==N?(P=(0,m.jsxs)(`div`,{className:`flex items-center gap-4 px-3 sm:px-4`,children:[M,N]}),t[37]=M,t[38]=N,t[39]=P):P=t[39];let F;t[40]===v?F=t[41]:(F=(0,m.jsx)(l,{children:(0,m.jsx)(`div`,{className:`border-t border-border/50 [&>*+*]:border-t [&>*+*]:border-border/50`,children:v})}),t[40]=v,t[41]=F);let I;t[42]!==b||t[43]!==P||t[44]!==F?(I=(0,m.jsxs)(d,{open:b,onOpenChange:x,render:E,children:[P,F]}),t[42]=b,t[43]=P,t[44]=F,t[45]=I):I=t[45];let L;return t[46]!==r||t[47]!==I||t[48]!==C?(L=(0,m.jsx)(`section`,{id:r,ref:C,tabIndex:-1,className:`outline-none`,children:I}),t[46]=r,t[47]=I,t[48]=C,t[49]=L):L=t[49],L}export{h as t};
2
- //# sourceMappingURL=FoldedSettingsSection-BIr-uvTu.js.map
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Cd as n,RE as r,mE as i,t as a}from"./utils-hgbJ2TVM.js";import{U as o,d as s,f as c}from"./settingsLayout-BloLque1.js";import{da as l,fa as u,ua as d}from"./main-DTxzRLjF.js";var f=r(),p=e(t(),1),m=e(i(),1);function h(e){let t=(0,f.c)(50),{id:r,title:i,summary:h,control:g,headerPlacement:_,children:v}=e,y=_===void 0?`inside`:_,[b,x]=(0,p.useState)(!1),S=c(),C=s(r),[w,T]=(0,p.useState)(null);if(S===r&&w!==r&&(T(r),b||x(!0)),y===`outside`){let e=b&&`rotate-90`,s;t[0]===e?s=t[1]:(s=a(`size-4 shrink-0 transition-transform duration-150 motion-reduce:transition-none`,e),t[0]=e,t[1]=s);let c;t[2]===s?c=t[3]:(c=(0,m.jsx)(n,{"aria-hidden":!0,className:s}),t[2]=s,t[3]=c);let f;t[4]!==c||t[5]!==i?(f=(0,m.jsx)(`h2`,{children:(0,m.jsxs)(u,{className:`flex min-h-7 items-center gap-2 rounded-md text-sm font-normal text-foreground/70 outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,children:[i,c]})}),t[4]=c,t[5]=i,t[6]=f):f=t[6];let p;t[7]!==g||t[8]!==f?(p=(0,m.jsxs)(`div`,{"data-settings-scroll-target":!0,className:`flex min-h-7 items-start justify-between gap-4 px-3 sm:px-4`,children:[f,g]}),t[7]=g,t[8]=f,t[9]=p):p=t[9];let h;t[10]===v?h=t[11]:(h=(0,m.jsx)(l,{children:(0,m.jsx)(o,{children:v})}),t[10]=v,t[11]=h);let _;t[12]!==p||t[13]!==h?(_=(0,m.jsxs)(`div`,{className:`space-y-2.5`,children:[p,h]}),t[12]=p,t[13]=h,t[14]=_):_=t[14];let y;t[15]!==b||t[16]!==_?(y=(0,m.jsx)(d,{open:b,onOpenChange:x,children:_}),t[15]=b,t[16]=_,t[17]=y):y=t[17];let S;return t[18]!==r||t[19]!==y||t[20]!==C?(S=(0,m.jsx)(`section`,{id:r,ref:C,tabIndex:-1,className:`outline-none`,children:y}),t[18]=r,t[19]=y,t[20]=C,t[21]=S):S=t[21],S}let E;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,m.jsx)(o,{divided:!1}),t[22]=E):E=t[22];let D=b&&`rotate-90`,O;t[23]===D?O=t[24]:(O=a(`size-4 shrink-0 text-muted-foreground transition-transform duration-150 motion-reduce:transition-none`,D),t[23]=D,t[24]=O);let k;t[25]===O?k=t[26]:(k=(0,m.jsx)(n,{"aria-hidden":!0,className:O}),t[25]=O,t[26]=k);let A;t[27]===i?A=t[28]:(A=(0,m.jsx)(`span`,{className:`shrink-0 text-sm font-medium`,children:i}),t[27]=i,t[28]=A);let j;t[29]===h?j=t[30]:(j=h?(0,m.jsx)(`span`,{className:`min-w-0 truncate text-xs text-muted-foreground`,children:h}):null,t[29]=h,t[30]=j);let M;t[31]!==k||t[32]!==A||t[33]!==j?(M=(0,m.jsxs)(u,{className:`flex min-h-11 min-w-0 flex-1 items-center gap-2 py-2 text-left outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring rounded-md`,children:[k,A,j]}),t[31]=k,t[32]=A,t[33]=j,t[34]=M):M=t[34];let N;t[35]===g?N=t[36]:(N=g?(0,m.jsx)(`div`,{className:`flex shrink-0 items-center`,children:g}):null,t[35]=g,t[36]=N);let P;t[37]!==M||t[38]!==N?(P=(0,m.jsxs)(`div`,{className:`flex items-center gap-4 px-3 sm:px-4`,children:[M,N]}),t[37]=M,t[38]=N,t[39]=P):P=t[39];let F;t[40]===v?F=t[41]:(F=(0,m.jsx)(l,{children:(0,m.jsx)(`div`,{className:`border-t border-border/50 [&>*+*]:border-t [&>*+*]:border-border/50`,children:v})}),t[40]=v,t[41]=F);let I;t[42]!==b||t[43]!==P||t[44]!==F?(I=(0,m.jsxs)(d,{open:b,onOpenChange:x,render:E,children:[P,F]}),t[42]=b,t[43]=P,t[44]=F,t[45]=I):I=t[45];let L;return t[46]!==r||t[47]!==I||t[48]!==C?(L=(0,m.jsx)(`section`,{id:r,ref:C,tabIndex:-1,className:`outline-none`,children:I}),t[46]=r,t[47]=I,t[48]=C,t[49]=L):L=t[49],L}export{h as t};
2
+ //# sourceMappingURL=FoldedSettingsSection-TSMWCMo5.js.map
@@ -1,2 +1,2 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{RE as t,ap as n,lr as r,mE as i,zp as a}from"./utils-hgbJ2TVM.js";import{O as o}from"./useSettings-BNs1IeKk.js";import{t as s}from"./env-wK1YYxA8.js";import{o as c}from"./sidebar-CV_a9dPF.js";import{i as l,o as u,r as d,t as f}from"./empty-DHl8_LXy.js";import{Gr as p,bn as m}from"./main-COMts6-0.js";import{t as h}from"./WorkspacePageHeader-BaCxaW-R.js";var g=t(),_=e(i(),1);function v(){let e=(0,g.c)(16),t=y,i=o(),{scratchEnvironmentId:p,startScratchThread:v}=m(),b;e[0]!==i||e[1]!==p?(b=p(i),e[0]=i,e[1]=p,e[2]=b):b=e[2];let x=b,S;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(S=s?(0,_.jsx)(h,{electron:!0}):null,e[3]=S):S=e[3];let C;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,_.jsx)(u,{children:`What should we work on?`}),e[4]=C):C=e[4];let w=x===null?`Add a project to start your first thread.`:`Add a project, or start without one.`,T;e[5]===w?T=e[6]:(T=(0,_.jsx)(d,{children:w}),e[5]=w,e[6]=T);let E;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,_.jsxs)(r,{size:`sm`,onClick:t,children:[(0,_.jsx)(a,{className:`size-4`}),`Add project`]}),e[7]=E):E=e[7];let D;e[8]!==x||e[9]!==v?(D=x===null?null:(0,_.jsxs)(r,{size:`sm`,variant:`outline`,onClick:()=>void v(x),children:[(0,_.jsx)(n,{className:`size-4`}),`Start without a project`]}),e[8]=x,e[9]=v,e[10]=D):D=e[10];let O;e[11]===D?O=e[12]:(O=(0,_.jsxs)(`div`,{className:`mt-6 flex justify-center gap-2`,children:[E,D]}),e[11]=D,e[12]=O);let k;return e[13]!==T||e[14]!==O?(k=(0,_.jsx)(c,{className:`h-dvh min-h-0 overflow-hidden overscroll-y-none`,children:(0,_.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-x-hidden bg-background`,children:[S,(0,_.jsx)(f,{size:`hero`,className:`flex-1`,children:(0,_.jsx)(`div`,{className:`w-full max-w-lg px-8 py-12`,children:(0,_.jsxs)(l,{className:`max-w-none`,children:[C,T,O]})})})]})}),e[13]=T,e[14]=O,e[15]=k):k=e[15],k}function y(){return p({open:`add-project`})}export{v as t};
2
- //# sourceMappingURL=NoProjectsHero-Dj3URl4e.js.map
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{RE as t,ap as n,lr as r,mE as i,zp as a}from"./utils-hgbJ2TVM.js";import{O as o}from"./useSettings-DkjziVJm.js";import{t as s}from"./env-wK1YYxA8.js";import{o as c}from"./sidebar-CV_a9dPF.js";import{i as l,o as u,r as d,t as f}from"./empty-DHl8_LXy.js";import{Gr as p,bn as m}from"./main-DTxzRLjF.js";import{t as h}from"./WorkspacePageHeader-BaCxaW-R.js";var g=t(),_=e(i(),1);function v(){let e=(0,g.c)(16),t=y,i=o(),{scratchEnvironmentId:p,startScratchThread:v}=m(),b;e[0]!==i||e[1]!==p?(b=p(i),e[0]=i,e[1]=p,e[2]=b):b=e[2];let x=b,S;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(S=s?(0,_.jsx)(h,{electron:!0}):null,e[3]=S):S=e[3];let C;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,_.jsx)(u,{children:`What should we work on?`}),e[4]=C):C=e[4];let w=x===null?`Add a project to start your first thread.`:`Add a project, or start without one.`,T;e[5]===w?T=e[6]:(T=(0,_.jsx)(d,{children:w}),e[5]=w,e[6]=T);let E;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,_.jsxs)(r,{size:`sm`,onClick:t,children:[(0,_.jsx)(a,{className:`size-4`}),`Add project`]}),e[7]=E):E=e[7];let D;e[8]!==x||e[9]!==v?(D=x===null?null:(0,_.jsxs)(r,{size:`sm`,variant:`outline`,onClick:()=>void v(x),children:[(0,_.jsx)(n,{className:`size-4`}),`Start without a project`]}),e[8]=x,e[9]=v,e[10]=D):D=e[10];let O;e[11]===D?O=e[12]:(O=(0,_.jsxs)(`div`,{className:`mt-6 flex justify-center gap-2`,children:[E,D]}),e[11]=D,e[12]=O);let k;return e[13]!==T||e[14]!==O?(k=(0,_.jsx)(c,{className:`h-dvh min-h-0 overflow-hidden overscroll-y-none`,children:(0,_.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-x-hidden bg-background`,children:[S,(0,_.jsx)(f,{size:`hero`,className:`flex-1`,children:(0,_.jsx)(`div`,{className:`w-full max-w-lg px-8 py-12`,children:(0,_.jsxs)(l,{className:`max-w-none`,children:[C,T,O]})})})]})}),e[13]=T,e[14]=O,e[15]=k):k=e[15],k}function y(){return p({open:`add-project`})}export{v as t};
2
+ //# sourceMappingURL=NoProjectsHero-B5wdlXLT.js.map
@@ -1,2 +1,2 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$o as n,Kn as r,MC as i,RE as a,Sa as o,Ts as s,Yo as c,cm as l,dT as u,ds as d,iS as f,lr as p,mE as m,ns as h,os as g,rs as _,t as v,tm as y}from"./utils-hgbJ2TVM.js";import{I as b,O as x,R as S,W as C,d as w,f as T,h as E,k as D,m as O,mn as k,r as ee}from"./runtime-D-mOwjrE.js";import{i as A}from"./toast-x69BFrW5.js";import{t as j}from"./use-atom-command-rhVarDA8.js";import{t as M}from"./skeleton-Bq50sEah.js";import{i as te,r as ne}from"./dist-DWlOCBGN.js";import{a as N,i as P,o as F,r as I,t as L}from"./empty-DHl8_LXy.js";import{Ca as re,da as ie,fa as ae,ua as oe}from"./main-COMts6-0.js";var R=e(o(),1),z=a(),B=e(t(),1),V=g(i(k,ee.contextEffect.pipe(f(e=>u(e,k))))),H=w(V),U=D(),W=b(V,{label:`web:managed-relay:deregister-environment`,scheduler:U,concurrency:{mode:`serial`,key:e=>e.accountId},execute:(e,t)=>T(t,e)}),G=_(s([])).pipe(h,d(`managed-relay:web:environments:null`)),K=_(s([])).pipe(h,d(`managed-relay:web:devices:null`));function se(){let e=(0,z.c)(14),t=n(O)?.accountId??null,r;e[0]===t?r=e[1]:(r=t?H.environmentsAtom(t):G,e[0]=t,e[1]=r);let i=n(r),a;e[2]===i?a=e[3]:(a=E(i),e[2]=i,e[3]=a);let o=a,s,l;e[4]!==o.error||e[5]!==o.errorTraceId?(s=()=>{o.error&&console.error(`[p4-cloud] Relay environment listing failed`,{message:o.error,traceId:o.errorTraceId})},l=[o.error,o.errorTraceId],e[4]=o.error,e[5]=o.errorTraceId,e[6]=s,e[7]=l):(s=e[6],l=e[7]),(0,B.useEffect)(s,l);let u;e[8]===t?u=e[9]:(u=()=>{t&&H.refreshEnvironments(c,t)},e[8]=t,e[9]=u);let d=u,f;return e[10]!==t||e[11]!==d||e[12]!==o?(f={...o,accountId:t,refresh:d},e[10]=t,e[11]=d,e[12]=o,e[13]=f):f=e[13],f}function q(){let e=(0,z.c)(14),t=n(O)?.accountId??null,r;e[0]===t?r=e[1]:(r=t?H.devicesAtom(t):K,e[0]=t,e[1]=r);let i=n(r),a;e[2]===i?a=e[3]:(a=E(i),e[2]=i,e[3]=a);let o=a,s,l;e[4]!==o.error||e[5]!==o.errorTraceId?(s=()=>{o.error&&console.error(`[p4-cloud] Relay device listing failed`,{message:o.error,traceId:o.errorTraceId})},l=[o.error,o.errorTraceId],e[4]=o.error,e[5]=o.errorTraceId,e[6]=s,e[7]=l):(s=e[6],l=e[7]),(0,B.useEffect)(s,l);let u;e[8]===t?u=e[9]:(u=()=>{t&&H.refreshDevices(c,t)},e[8]=t,e[9]=u);let d=u,f;return e[10]!==t||e[11]!==d||e[12]!==o?(f={...o,accountId:t,refresh:d},e[10]=t,e[11]=d,e[12]=o,e[13]=f):f=e[13],f}var ce=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`}),le=[[`notifyOnApproval`,`approvals`],[`notifyOnInput`,`input requests`],[`notifyOnCompletion`,`completions`],[`notifyOnFailure`,`failures`]];function ue(e){return`${e.platform===`android`?`Android`:e.iosMajorVersion===null?`iOS`:`iOS ${e.iosMajorVersion}`}${e.appVersion?` · P4 Code ${e.appVersion}`:``}`}function de(e){if(!e.notifications.enabled)return`Push notifications are disabled on this device.`;let t=le.flatMap(([t,n])=>e.notifications[t]?[n]:[]);return t.length>0?`Alerts enabled for ${t.join(`, `)}.`:`Push notifications are enabled, but no alert types are selected.`}function fe(e){let t=new Date(e);return Number.isNaN(t.getTime())?`Update time unavailable`:`Updated ${ce.format(t)}`}var J=e(m(),1);function Y(e){let t=(0,z.c)(18),{action:n,children:r,className:i,description:a,title:o}=e,s;t[0]===i?s=t[1]:(s=v(`w-full min-w-0 text-foreground`,i),t[0]=i,t[1]=s);let c;t[2]===o?c=t[3]:(c=(0,J.jsx)(`h2`,{className:`text-base leading-6 font-semibold`,children:o}),t[2]=o,t[3]=c);let l;t[4]===a?l=t[5]:(l=a?(0,J.jsx)(`p`,{className:`mt-1 max-w-[34rem] text-xs leading-4.5 text-muted-foreground sm:min-h-9`,children:a}):null,t[4]=a,t[5]=l);let u;t[6]!==c||t[7]!==l?(u=(0,J.jsxs)(`div`,{className:`min-w-0`,children:[c,l]}),t[6]=c,t[7]=l,t[8]=u):u=t[8];let d;t[9]===n?d=t[10]:(d=n?(0,J.jsx)(`div`,{className:`shrink-0`,children:n}):null,t[9]=n,t[10]=d);let f;t[11]!==u||t[12]!==d?(f=(0,J.jsxs)(`header`,{className:`flex flex-col gap-3 pb-4 sm:flex-row sm:items-center sm:justify-between sm:gap-4 sm:pr-8`,children:[u,d]}),t[11]=u,t[12]=d,t[13]=f):f=t[13];let p;return t[14]!==r||t[15]!==s||t[16]!==f?(p=(0,J.jsxs)(`div`,{className:s,children:[f,r]}),t[14]=r,t[15]=s,t[16]=f,t[17]=p):p=t[17],p}function X(e){let t=(0,z.c)(7),{className:n,disabled:r,isPending:i,onClick:a}=e,o=r!==void 0&&r||i,s;t[0]===i?s=t[1]:(s=(0,J.jsx)(re,{"aria-hidden":`true`,size:`sm`,refreshing:i}),t[0]=i,t[1]=s);let c;return t[2]!==n||t[3]!==a||t[4]!==o||t[5]!==s?(c=(0,J.jsxs)(p,{size:`sm`,variant:`outline`,className:n,disabled:o,onClick:a,children:[s,`Refresh`]}),t[2]=n,t[3]=a,t[4]=o,t[5]=s,t[6]=c):c=t[6],c}function Z(e){let t=(0,z.c)(12),{children:n,className:r,icon:i}=e,a;t[0]===r?a=t[1]:(a=v(`border-t py-4 first:border-t-0`,r),t[0]=r,t[1]=a);let o;t[2]===i?o=t[3]:(o=(0,J.jsx)(`div`,{"aria-hidden":`true`,className:`flex size-8 shrink-0 items-center justify-center rounded-lg border bg-muted/32 text-muted-foreground`,children:i}),t[2]=i,t[3]=o);let s;t[4]===n?s=t[5]:(s=(0,J.jsx)(`div`,{className:`min-w-0 flex-1`,children:n}),t[4]=n,t[5]=s);let c;t[6]!==o||t[7]!==s?(c=(0,J.jsxs)(`div`,{className:`flex items-start gap-3`,children:[o,s]}),t[6]=o,t[7]=s,t[8]=c):c=t[8];let l;return t[9]!==a||t[10]!==c?(l=(0,J.jsx)(`li`,{className:a,children:c}),t[9]=a,t[10]=c,t[11]=l):l=t[11],l}var pe=[`primary`,`secondary`];function Q(e){let t=(0,z.c)(4),{enabled:n,label:i}=e,a=n?`success`:`outline`,o=n?`On`:`Off`,s;return t[0]!==i||t[1]!==a||t[2]!==o?(s=(0,J.jsxs)(r,{variant:a,children:[i,`: `,o]}),t[0]=i,t[1]=a,t[2]=o,t[3]=s):s=t[3],s}function me(e){let t=(0,z.c)(32),{device:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,J.jsx)(l,{className:`size-4`}),t[0]=r):r=t[0];let i;t[1]===n.label?i=t[2]:(i=(0,J.jsx)(`h3`,{className:`truncate text-sm leading-4.5 font-medium text-foreground`,children:n.label}),t[1]=n.label,t[2]=i);let a;t[3]===n?a=t[4]:(a=ue(n),t[3]=n,t[4]=a);let o;t[5]===a?o=t[6]:(o=(0,J.jsx)(`p`,{className:`text-xs leading-4.5 text-muted-foreground`,children:a}),t[5]=a,t[6]=o);let s;t[7]!==i||t[8]!==o?(s=(0,J.jsxs)(`div`,{className:`min-w-0`,children:[i,o]}),t[7]=i,t[8]=o,t[9]=s):s=t[9];let c;t[10]===n.updatedAt?c=t[11]:(c=fe(n.updatedAt),t[10]=n.updatedAt,t[11]=c);let u;t[12]===c?u=t[13]:(u=(0,J.jsx)(`p`,{className:`shrink-0 text-2xs leading-4 text-muted-foreground/75`,children:c}),t[12]=c,t[13]=u);let d;t[14]!==s||t[15]!==u?(d=(0,J.jsxs)(`div`,{className:`flex flex-col gap-0.5 sm:flex-row sm:items-start sm:justify-between sm:gap-3`,children:[s,u]}),t[14]=s,t[15]=u,t[16]=d):d=t[16];let f;t[17]===n.notifications.enabled?f=t[18]:(f=(0,J.jsx)(Q,{enabled:n.notifications.enabled,label:`Push notifications`}),t[17]=n.notifications.enabled,t[18]=f);let p;t[19]===n.liveActivities.enabled?p=t[20]:(p=(0,J.jsx)(Q,{enabled:n.liveActivities.enabled,label:`Live Activities`}),t[19]=n.liveActivities.enabled,t[20]=p);let m;t[21]!==p||t[22]!==f?(m=(0,J.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:[f,p]}),t[21]=p,t[22]=f,t[23]=m):m=t[23];let h;t[24]===n?h=t[25]:(h=de(n),t[24]=n,t[25]=h);let g;t[26]===h?g=t[27]:(g=(0,J.jsx)(`p`,{className:`mt-1.5 text-xs leading-4.5 text-muted-foreground/80`,children:h}),t[26]=h,t[27]=g);let _;return t[28]!==m||t[29]!==g||t[30]!==d?(_=(0,J.jsxs)(Z,{icon:r,children:[d,m,g]}),t[28]=m,t[29]=g,t[30]=d,t[31]=_):_=t[31],_}function he(){let e=(0,z.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,J.jsx)(`div`,{"aria-label":`Loading mobile clients`,className:`divide-y border-t`,role:`status`,children:pe.map(ge)}),e[0]=t):t=e[0],t}function ge(e){return(0,J.jsx)(`div`,{className:`py-4`,children:(0,J.jsxs)(`div`,{className:`flex gap-3`,children:[(0,J.jsx)(M,{shape:`card`,className:`size-8 shrink-0`}),(0,J.jsxs)(`div`,{className:`flex-1 space-y-2`,children:[(0,J.jsx)(M,{className:`h-3.5 w-36`}),(0,J.jsx)(M,{className:`h-3 w-28`}),(0,J.jsxs)(`div`,{className:`flex gap-2`,children:[(0,J.jsx)(M,{className:`h-4.5 w-28`}),(0,J.jsx)(M,{className:`h-4.5 w-24`})]})]})]})},e)}function _e(){let e=(0,z.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,J.jsx)(N,{variant:`icon`,children:(0,J.jsx)(l,{})}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,J.jsxs)(L,{size:`compact`,children:[t,(0,J.jsxs)(P,{children:[(0,J.jsx)(F,{children:`No mobile clients`}),(0,J.jsx)(I,{children:`Install P4 Code on your phone and sign in to P4 Connect to get push notifications and Live Activities.`})]})]}),e[1]=n):n=e[1],n}function ve(){let e=(0,z.c)(18),t=q(),n;e[0]===t.data?n=e[1]:(n=t.data??[],e[0]=t.data,e[1]=n);let r=n,i=!t.accountId||t.data===null&&!t.error,a=t.error!==null&&t.data===null,o;e[2]!==t.isPending||e[3]!==t.refresh?(o=(0,J.jsx)(X,{isPending:t.isPending,onClick:t.refresh}),e[2]=t.isPending,e[3]=t.refresh,e[4]=o):o=e[4];let s;e[5]!==t.error||e[6]!==t.refresh?(s=t.error?(0,J.jsxs)(`div`,{className:`mb-4 flex flex-col gap-3 border-t border-destructive/35 py-3 text-xs sm:flex-row sm:items-center sm:justify-between`,role:`alert`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`p`,{className:`font-medium text-destructive-foreground`,children:`Could not load mobile clients`}),(0,J.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:t.error})]}),(0,J.jsx)(p,{size:`xs`,variant:`outline`,onClick:t.refresh,children:`Try again`})]}):null,e[5]=t.error,e[6]=t.refresh,e[7]=s):s=e[7];let c;e[8]!==r||e[9]!==a||e[10]!==i?(c=i?(0,J.jsx)(he,{}):a?null:r.length>0?(0,J.jsx)(`ul`,{className:`border-t`,children:r.map(ye)}):(0,J.jsx)(`div`,{className:`border-t`,children:(0,J.jsx)(_e,{})}),e[8]=r,e[9]=a,e[10]=i,e[11]=c):c=e[11];let l;e[12]!==s||e[13]!==c?(l=(0,J.jsxs)(`div`,{children:[s,c]}),e[12]=s,e[13]=c,e[14]=l):l=e[14];let u;return e[15]!==o||e[16]!==l?(u=(0,J.jsx)(Y,{title:`Mobile clients`,description:`Mobile devices that get notifications from your environments.`,action:o,children:l}),e[15]=o,e[16]=l,e[17]=u):u=e[17],u}function ye(e){return(0,J.jsx)(me,{device:e},e.deviceId)}var be=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`});function xe(e){let t=new Date(e);return Number.isNaN(t.getTime())?`Link date unavailable`:`Linked ${be.format(t)}`}function Se(e){return e.endpoint.providerKind===`cloudflare_tunnel`?`Managed tunnel`:`Activity publishing only`}function Ce(e){let t=(0,z.c)(46),{environment:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,J.jsx)(y,{className:`size-4`}),t[0]=r):r=t[0];let i=e.confirmationOpen,a=e.onConfirmationChange,o;t[1]===n.label?o=t[2]:(o=(0,J.jsx)(`h3`,{className:`truncate text-sm leading-4.5 font-medium text-foreground`,children:n.label}),t[1]=n.label,t[2]=o);let s;t[3]===n.linkedAt?s=t[4]:(s=xe(n.linkedAt),t[3]=n.linkedAt,t[4]=s);let c;t[5]===n?c=t[6]:(c=Se(n),t[5]=n,t[6]=c);let l;t[7]!==s||t[8]!==c?(l=(0,J.jsxs)(`p`,{className:`mt-1 text-xs leading-4.5 text-muted-foreground`,children:[s,` · `,c]}),t[7]=s,t[8]=c,t[9]=l):l=t[9];let u;t[10]!==o||t[11]!==l?(u=(0,J.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[o,l]}),t[10]=o,t[11]=l,t[12]=u):u=t[12];let d;t[13]===e.mutationPending?d=t[14]:(d=(0,J.jsx)(ae,{render:(0,J.jsx)(p,{size:`sm`,variant:`destructive-outline`,disabled:e.mutationPending,children:`Deregister`})}),t[13]=e.mutationPending,t[14]=d);let f;t[15]!==u||t[16]!==d?(f=(0,J.jsxs)(`div`,{className:`flex items-start gap-4`,children:[u,d]}),t[15]=u,t[16]=d,t[17]=f):f=t[17];let m=`Confirm deregistration of ${n.label}`,h;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,J.jsx)(`h4`,{className:`text-sm leading-4.5 font-semibold text-foreground`,children:`Deregister server`}),t[18]=h):h=t[18];let g;t[19]===n.label?g=t[20]:(g=(0,J.jsxs)(`p`,{className:`mt-1 text-xs leading-4.5 text-muted-foreground`,children:[`“`,n.label,`” will be removed from this account.`]}),t[19]=n.label,t[20]=g);let _;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,J.jsx)(`p`,{className:`mt-4 max-w-xl text-xs leading-4.5 text-muted-foreground`,children:`P4 Connect access will be revoked, any managed tunnel will be removed, and a host space will become available. Local connections on your devices are not changed.`}),t[21]=_):_=t[21];let v;t[22]===e?v=t[23]:(v=()=>e.onConfirmationChange(!1),t[22]=e,t[23]=v);let b;t[24]!==e.mutationPending||t[25]!==v?(b=(0,J.jsx)(p,{size:`sm`,variant:`ghost`,disabled:e.mutationPending,onClick:v,children:`Cancel`}),t[24]=e.mutationPending,t[25]=v,t[26]=b):b=t[26];let x;t[27]!==n||t[28]!==e?(x=()=>e.onDeregister(n),t[27]=n,t[28]=e,t[29]=x):x=t[29];let S=e.mutationPending?`Deregistering…`:`Deregister`,C;t[30]!==e.mutationPending||t[31]!==x||t[32]!==S?(C=(0,J.jsx)(p,{size:`sm`,variant:`destructive`,disabled:e.mutationPending,onClick:x,children:S}),t[30]=e.mutationPending,t[31]=x,t[32]=S,t[33]=C):C=t[33];let w;t[34]!==b||t[35]!==C?(w=(0,J.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[b,C]}),t[34]=b,t[35]=C,t[36]=w):w=t[36];let T;t[37]!==m||t[38]!==g||t[39]!==w?(T=(0,J.jsx)(ie,{children:(0,J.jsx)(`div`,{className:`pt-3`,children:(0,J.jsxs)(`div`,{className:`rounded-lg border border-input bg-muted/32 px-5 py-4 shadow-xs/5`,role:`group`,"aria-label":m,children:[h,g,_,w]})})}),t[37]=m,t[38]=g,t[39]=w,t[40]=T):T=t[40];let E;return t[41]!==e.confirmationOpen||t[42]!==e.onConfirmationChange||t[43]!==T||t[44]!==f?(E=(0,J.jsx)(Z,{icon:r,children:(0,J.jsxs)(oe,{open:i,onOpenChange:a,children:[f,T]})}),t[41]=e.confirmationOpen,t[42]=e.onConfirmationChange,t[43]=T,t[44]=f,t[45]=E):E=t[45],E}function we(){let e=(0,z.c)(41),t=se(),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},e[0]=n):n=e[0];let r=j(W,n),[i,a]=(0,B.useState)(null),[o,s]=(0,B.useState)(null),c=(0,B.useRef)(!1),l;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(l={accountId:null,linkedAtById:new Map},e[1]=l):l=e[1];let[u,d]=(0,B.useState)(l),f;e[2]!==r||e[3]!==t?(f=async e=>{let n=t.accountId;if(!n||c.current)return;c.current=!0,a(e.environmentId);let i=await r({accountId:n,environmentId:e.environmentId});if(c.current=!1,a(null),i._tag===`Success`){s(null),d(t=>{let r=new Map(t.accountId===n?t.linkedAtById:[]);return r.set(e.environmentId,e.linkedAt),{accountId:n,linkedAtById:r}}),t.refresh(),A.add({type:`success`,title:`Server deregistered`,description:`P4 Connect access was revoked and a host space is now available.`});return}if(S(i))return;let o=C(i),l=o instanceof Error?o.message:`Could not deregister the server.`,u=x(o);console.error(`[p4-connect] Could not deregister environment`,{environmentId:e.environmentId,message:l,traceId:u,cause:o}),A.add({type:`error`,title:`Could not deregister server`,description:l,data:u?{secondaryActionProps:{children:`Copy trace ID`,onClick:()=>void navigator.clipboard?.writeText(u)}}:void 0})},e[2]=r,e[3]=t,e[4]=f):f=e[4];let p=f,m;e[5]!==t.accountId||e[6]!==u.accountId||e[7]!==u.linkedAtById?(m=u.accountId===t.accountId?u.linkedAtById:new Map,e[5]=t.accountId,e[6]=u.accountId,e[7]=u.linkedAtById,e[8]=m):m=e[8];let h=m,g,_,v,b,w,T;if(e[9]!==o||e[10]!==i||e[11]!==t.accountId||e[12]!==t.data||e[13]!==t.error||e[14]!==t.isPending||e[15]!==t.refresh||e[16]!==p||e[17]!==h){let n;e[24]===h?n=e[25]:(n=e=>h.get(e.environmentId)!==e.linkedAt,e[24]=h,e[25]=n);let r=(t.data??[]).filter(n),a=!t.accountId||t.data===null&&!t.error;g=Y,b=`P4 Connect`,w=`Environments registered to your account. Connections on this device are managed in Settings.`;let c=i!==null;e[26]!==t.isPending||e[27]!==t.refresh||e[28]!==c?(T=(0,J.jsx)(X,{disabled:c,isPending:t.isPending,onClick:t.refresh}),e[26]=t.isPending,e[27]=t.refresh,e[28]=c,e[29]=T):T=e[29],e[30]===t.error?_=e[31]:(_=t.error?(0,J.jsxs)(`div`,{className:`mb-4 border-t border-destructive/35 py-3 text-xs`,role:`alert`,children:[(0,J.jsx)(`p`,{className:`font-medium text-destructive-foreground`,children:`Could not load P4 Connect environments`}),(0,J.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:t.error})]}):null,e[30]=t.error,e[31]=_),v=a?(0,J.jsx)(`p`,{className:`border-t py-4 text-xs text-muted-foreground`,role:`status`,children:`Loading environments…`}):r.length>0?(0,J.jsx)(`ul`,{className:`border-t`,children:r.map(e=>(0,J.jsx)(Ce,{environment:e,confirmationOpen:o===e.environmentId,mutationPending:i!==null,onConfirmationChange:t=>s(t?e.environmentId:null),onDeregister:e=>void p(e)},e.environmentId))}):t.error?null:(0,J.jsx)(`div`,{className:`border-t`,children:(0,J.jsxs)(L,{size:`compact`,children:[(0,J.jsx)(N,{variant:`icon`,children:(0,J.jsx)(y,{})}),(0,J.jsxs)(P,{children:[(0,J.jsx)(F,{children:`No P4 Connect environments`}),(0,J.jsx)(I,{children:`Link an environment from its local Settings to make it available through P4 Connect.`})]})]})}),e[9]=o,e[10]=i,e[11]=t.accountId,e[12]=t.data,e[13]=t.error,e[14]=t.isPending,e[15]=t.refresh,e[16]=p,e[17]=h,e[18]=g,e[19]=_,e[20]=v,e[21]=b,e[22]=w,e[23]=T}else g=e[18],_=e[19],v=e[20],b=e[21],w=e[22],T=e[23];let E;e[32]!==_||e[33]!==v?(E=(0,J.jsxs)(`div`,{children:[_,v]}),e[32]=_,e[33]=v,e[34]=E):E=e[34];let D;return e[35]!==g||e[36]!==b||e[37]!==w||e[38]!==T||e[39]!==E?(D=(0,J.jsx)(g,{title:b,description:w,action:T,children:E}),e[35]=g,e[36]=b,e[37]=w,e[38]=T,e[39]=E,e[40]=D):D=e[40],D}var $=[{label:`Mobile clients`,url:`mobile-clients`,icon:(0,J.jsx)(l,{className:`size-4`}),content:(0,J.jsx)(ve,{})},{label:`P4 Connect`,url:`p4-connect`,icon:(0,J.jsx)(y,{className:`size-4`}),content:(0,J.jsx)(we,{})}];function Te(){let e=(0,z.c)(8),t=te(),{isSignedIn:n}=ne(),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={},e[0]=r):r=e[0];let[i,a]=(0,B.useState)(r),o;e[1]===t?o=e[2]:(o=()=>{let e=(e,t)=>a(n=>({...n,[e]:t}));t.openUserProfile({__experimental_startPath:`/p4-connect`,customPages:$.map(t=>({label:t.label,url:t.url,mount:n=>e(`content:${t.url}`,n),unmount:()=>e(`content:${t.url}`,void 0),mountIcon:n=>e(`icon:${t.url}`,n),unmountIcon:()=>e(`icon:${t.url}`,void 0)}))})},e[1]=t,e[2]=o);let s=o,c;e[3]===i?c=e[4]:(c=$.flatMap(e=>{let t=i[`content:${e.url}`],n=i[`icon:${e.url}`];return[t?(0,R.createPortal)(e.content,t,`content:${e.url}`):null,n?(0,R.createPortal)(e.icon,n,`icon:${e.url}`):null]}),e[3]=i,e[4]=c);let l=c,u=n?s:null,d;return e[5]!==l||e[6]!==u?(d={open:u,portals:l},e[5]=l,e[6]=u,e[7]=d):d=e[7],d}export{Te as n,$ as t};
2
- //# sourceMappingURL=P4ConnectAccountPages-CFPHk3YU.js.map
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$o as n,Kn as r,MC as i,RE as a,Sa as o,Ts as s,Yo as c,cm as l,dT as u,ds as d,iS as f,lr as p,mE as m,ns as h,os as g,rs as _,t as v,tm as y}from"./utils-hgbJ2TVM.js";import{I as b,O as x,R as S,W as C,d as w,f as T,h as E,k as D,m as O,mn as k,r as ee}from"./runtime-DPOrcghx.js";import{i as A}from"./toast-CfeQA1vM.js";import{t as j}from"./use-atom-command-BCNOgemk.js";import{t as M}from"./skeleton-Bq50sEah.js";import{i as te,r as ne}from"./dist-DJO3gX7B.js";import{a as N,i as P,o as F,r as I,t as L}from"./empty-DHl8_LXy.js";import{Ca as re,da as ie,fa as ae,ua as oe}from"./main-DTxzRLjF.js";var R=e(o(),1),z=a(),B=e(t(),1),V=g(i(k,ee.contextEffect.pipe(f(e=>u(e,k))))),H=w(V),U=D(),W=b(V,{label:`web:managed-relay:deregister-environment`,scheduler:U,concurrency:{mode:`serial`,key:e=>e.accountId},execute:(e,t)=>T(t,e)}),G=_(s([])).pipe(h,d(`managed-relay:web:environments:null`)),K=_(s([])).pipe(h,d(`managed-relay:web:devices:null`));function se(){let e=(0,z.c)(14),t=n(O)?.accountId??null,r;e[0]===t?r=e[1]:(r=t?H.environmentsAtom(t):G,e[0]=t,e[1]=r);let i=n(r),a;e[2]===i?a=e[3]:(a=E(i),e[2]=i,e[3]=a);let o=a,s,l;e[4]!==o.error||e[5]!==o.errorTraceId?(s=()=>{o.error&&console.error(`[p4-cloud] Relay environment listing failed`,{message:o.error,traceId:o.errorTraceId})},l=[o.error,o.errorTraceId],e[4]=o.error,e[5]=o.errorTraceId,e[6]=s,e[7]=l):(s=e[6],l=e[7]),(0,B.useEffect)(s,l);let u;e[8]===t?u=e[9]:(u=()=>{t&&H.refreshEnvironments(c,t)},e[8]=t,e[9]=u);let d=u,f;return e[10]!==t||e[11]!==d||e[12]!==o?(f={...o,accountId:t,refresh:d},e[10]=t,e[11]=d,e[12]=o,e[13]=f):f=e[13],f}function q(){let e=(0,z.c)(14),t=n(O)?.accountId??null,r;e[0]===t?r=e[1]:(r=t?H.devicesAtom(t):K,e[0]=t,e[1]=r);let i=n(r),a;e[2]===i?a=e[3]:(a=E(i),e[2]=i,e[3]=a);let o=a,s,l;e[4]!==o.error||e[5]!==o.errorTraceId?(s=()=>{o.error&&console.error(`[p4-cloud] Relay device listing failed`,{message:o.error,traceId:o.errorTraceId})},l=[o.error,o.errorTraceId],e[4]=o.error,e[5]=o.errorTraceId,e[6]=s,e[7]=l):(s=e[6],l=e[7]),(0,B.useEffect)(s,l);let u;e[8]===t?u=e[9]:(u=()=>{t&&H.refreshDevices(c,t)},e[8]=t,e[9]=u);let d=u,f;return e[10]!==t||e[11]!==d||e[12]!==o?(f={...o,accountId:t,refresh:d},e[10]=t,e[11]=d,e[12]=o,e[13]=f):f=e[13],f}var ce=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`}),le=[[`notifyOnApproval`,`approvals`],[`notifyOnInput`,`input requests`],[`notifyOnCompletion`,`completions`],[`notifyOnFailure`,`failures`]];function ue(e){return`${e.platform===`android`?`Android`:e.iosMajorVersion===null?`iOS`:`iOS ${e.iosMajorVersion}`}${e.appVersion?` · P4 Code ${e.appVersion}`:``}`}function de(e){if(!e.notifications.enabled)return`Push notifications are disabled on this device.`;let t=le.flatMap(([t,n])=>e.notifications[t]?[n]:[]);return t.length>0?`Alerts enabled for ${t.join(`, `)}.`:`Push notifications are enabled, but no alert types are selected.`}function fe(e){let t=new Date(e);return Number.isNaN(t.getTime())?`Update time unavailable`:`Updated ${ce.format(t)}`}var J=e(m(),1);function Y(e){let t=(0,z.c)(18),{action:n,children:r,className:i,description:a,title:o}=e,s;t[0]===i?s=t[1]:(s=v(`w-full min-w-0 text-foreground`,i),t[0]=i,t[1]=s);let c;t[2]===o?c=t[3]:(c=(0,J.jsx)(`h2`,{className:`text-base leading-6 font-semibold`,children:o}),t[2]=o,t[3]=c);let l;t[4]===a?l=t[5]:(l=a?(0,J.jsx)(`p`,{className:`mt-1 max-w-[34rem] text-xs leading-4.5 text-muted-foreground sm:min-h-9`,children:a}):null,t[4]=a,t[5]=l);let u;t[6]!==c||t[7]!==l?(u=(0,J.jsxs)(`div`,{className:`min-w-0`,children:[c,l]}),t[6]=c,t[7]=l,t[8]=u):u=t[8];let d;t[9]===n?d=t[10]:(d=n?(0,J.jsx)(`div`,{className:`shrink-0`,children:n}):null,t[9]=n,t[10]=d);let f;t[11]!==u||t[12]!==d?(f=(0,J.jsxs)(`header`,{className:`flex flex-col gap-3 pb-4 sm:flex-row sm:items-center sm:justify-between sm:gap-4 sm:pr-8`,children:[u,d]}),t[11]=u,t[12]=d,t[13]=f):f=t[13];let p;return t[14]!==r||t[15]!==s||t[16]!==f?(p=(0,J.jsxs)(`div`,{className:s,children:[f,r]}),t[14]=r,t[15]=s,t[16]=f,t[17]=p):p=t[17],p}function X(e){let t=(0,z.c)(7),{className:n,disabled:r,isPending:i,onClick:a}=e,o=r!==void 0&&r||i,s;t[0]===i?s=t[1]:(s=(0,J.jsx)(re,{"aria-hidden":`true`,size:`sm`,refreshing:i}),t[0]=i,t[1]=s);let c;return t[2]!==n||t[3]!==a||t[4]!==o||t[5]!==s?(c=(0,J.jsxs)(p,{size:`sm`,variant:`outline`,className:n,disabled:o,onClick:a,children:[s,`Refresh`]}),t[2]=n,t[3]=a,t[4]=o,t[5]=s,t[6]=c):c=t[6],c}function Z(e){let t=(0,z.c)(12),{children:n,className:r,icon:i}=e,a;t[0]===r?a=t[1]:(a=v(`border-t py-4 first:border-t-0`,r),t[0]=r,t[1]=a);let o;t[2]===i?o=t[3]:(o=(0,J.jsx)(`div`,{"aria-hidden":`true`,className:`flex size-8 shrink-0 items-center justify-center rounded-lg border bg-muted/32 text-muted-foreground`,children:i}),t[2]=i,t[3]=o);let s;t[4]===n?s=t[5]:(s=(0,J.jsx)(`div`,{className:`min-w-0 flex-1`,children:n}),t[4]=n,t[5]=s);let c;t[6]!==o||t[7]!==s?(c=(0,J.jsxs)(`div`,{className:`flex items-start gap-3`,children:[o,s]}),t[6]=o,t[7]=s,t[8]=c):c=t[8];let l;return t[9]!==a||t[10]!==c?(l=(0,J.jsx)(`li`,{className:a,children:c}),t[9]=a,t[10]=c,t[11]=l):l=t[11],l}var pe=[`primary`,`secondary`];function Q(e){let t=(0,z.c)(4),{enabled:n,label:i}=e,a=n?`success`:`outline`,o=n?`On`:`Off`,s;return t[0]!==i||t[1]!==a||t[2]!==o?(s=(0,J.jsxs)(r,{variant:a,children:[i,`: `,o]}),t[0]=i,t[1]=a,t[2]=o,t[3]=s):s=t[3],s}function me(e){let t=(0,z.c)(32),{device:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,J.jsx)(l,{className:`size-4`}),t[0]=r):r=t[0];let i;t[1]===n.label?i=t[2]:(i=(0,J.jsx)(`h3`,{className:`truncate text-sm leading-4.5 font-medium text-foreground`,children:n.label}),t[1]=n.label,t[2]=i);let a;t[3]===n?a=t[4]:(a=ue(n),t[3]=n,t[4]=a);let o;t[5]===a?o=t[6]:(o=(0,J.jsx)(`p`,{className:`text-xs leading-4.5 text-muted-foreground`,children:a}),t[5]=a,t[6]=o);let s;t[7]!==i||t[8]!==o?(s=(0,J.jsxs)(`div`,{className:`min-w-0`,children:[i,o]}),t[7]=i,t[8]=o,t[9]=s):s=t[9];let c;t[10]===n.updatedAt?c=t[11]:(c=fe(n.updatedAt),t[10]=n.updatedAt,t[11]=c);let u;t[12]===c?u=t[13]:(u=(0,J.jsx)(`p`,{className:`shrink-0 text-2xs leading-4 text-muted-foreground/75`,children:c}),t[12]=c,t[13]=u);let d;t[14]!==s||t[15]!==u?(d=(0,J.jsxs)(`div`,{className:`flex flex-col gap-0.5 sm:flex-row sm:items-start sm:justify-between sm:gap-3`,children:[s,u]}),t[14]=s,t[15]=u,t[16]=d):d=t[16];let f;t[17]===n.notifications.enabled?f=t[18]:(f=(0,J.jsx)(Q,{enabled:n.notifications.enabled,label:`Push notifications`}),t[17]=n.notifications.enabled,t[18]=f);let p;t[19]===n.liveActivities.enabled?p=t[20]:(p=(0,J.jsx)(Q,{enabled:n.liveActivities.enabled,label:`Live Activities`}),t[19]=n.liveActivities.enabled,t[20]=p);let m;t[21]!==p||t[22]!==f?(m=(0,J.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:[f,p]}),t[21]=p,t[22]=f,t[23]=m):m=t[23];let h;t[24]===n?h=t[25]:(h=de(n),t[24]=n,t[25]=h);let g;t[26]===h?g=t[27]:(g=(0,J.jsx)(`p`,{className:`mt-1.5 text-xs leading-4.5 text-muted-foreground/80`,children:h}),t[26]=h,t[27]=g);let _;return t[28]!==m||t[29]!==g||t[30]!==d?(_=(0,J.jsxs)(Z,{icon:r,children:[d,m,g]}),t[28]=m,t[29]=g,t[30]=d,t[31]=_):_=t[31],_}function he(){let e=(0,z.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,J.jsx)(`div`,{"aria-label":`Loading mobile clients`,className:`divide-y border-t`,role:`status`,children:pe.map(ge)}),e[0]=t):t=e[0],t}function ge(e){return(0,J.jsx)(`div`,{className:`py-4`,children:(0,J.jsxs)(`div`,{className:`flex gap-3`,children:[(0,J.jsx)(M,{shape:`card`,className:`size-8 shrink-0`}),(0,J.jsxs)(`div`,{className:`flex-1 space-y-2`,children:[(0,J.jsx)(M,{className:`h-3.5 w-36`}),(0,J.jsx)(M,{className:`h-3 w-28`}),(0,J.jsxs)(`div`,{className:`flex gap-2`,children:[(0,J.jsx)(M,{className:`h-4.5 w-28`}),(0,J.jsx)(M,{className:`h-4.5 w-24`})]})]})]})},e)}function _e(){let e=(0,z.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,J.jsx)(N,{variant:`icon`,children:(0,J.jsx)(l,{})}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,J.jsxs)(L,{size:`compact`,children:[t,(0,J.jsxs)(P,{children:[(0,J.jsx)(F,{children:`No mobile clients`}),(0,J.jsx)(I,{children:`Install P4 Code on your phone and sign in to P4 Connect to get push notifications and Live Activities.`})]})]}),e[1]=n):n=e[1],n}function ve(){let e=(0,z.c)(18),t=q(),n;e[0]===t.data?n=e[1]:(n=t.data??[],e[0]=t.data,e[1]=n);let r=n,i=!t.accountId||t.data===null&&!t.error,a=t.error!==null&&t.data===null,o;e[2]!==t.isPending||e[3]!==t.refresh?(o=(0,J.jsx)(X,{isPending:t.isPending,onClick:t.refresh}),e[2]=t.isPending,e[3]=t.refresh,e[4]=o):o=e[4];let s;e[5]!==t.error||e[6]!==t.refresh?(s=t.error?(0,J.jsxs)(`div`,{className:`mb-4 flex flex-col gap-3 border-t border-destructive/35 py-3 text-xs sm:flex-row sm:items-center sm:justify-between`,role:`alert`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`p`,{className:`font-medium text-destructive-foreground`,children:`Could not load mobile clients`}),(0,J.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:t.error})]}),(0,J.jsx)(p,{size:`xs`,variant:`outline`,onClick:t.refresh,children:`Try again`})]}):null,e[5]=t.error,e[6]=t.refresh,e[7]=s):s=e[7];let c;e[8]!==r||e[9]!==a||e[10]!==i?(c=i?(0,J.jsx)(he,{}):a?null:r.length>0?(0,J.jsx)(`ul`,{className:`border-t`,children:r.map(ye)}):(0,J.jsx)(`div`,{className:`border-t`,children:(0,J.jsx)(_e,{})}),e[8]=r,e[9]=a,e[10]=i,e[11]=c):c=e[11];let l;e[12]!==s||e[13]!==c?(l=(0,J.jsxs)(`div`,{children:[s,c]}),e[12]=s,e[13]=c,e[14]=l):l=e[14];let u;return e[15]!==o||e[16]!==l?(u=(0,J.jsx)(Y,{title:`Mobile clients`,description:`Mobile devices that get notifications from your environments.`,action:o,children:l}),e[15]=o,e[16]=l,e[17]=u):u=e[17],u}function ye(e){return(0,J.jsx)(me,{device:e},e.deviceId)}var be=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`});function xe(e){let t=new Date(e);return Number.isNaN(t.getTime())?`Link date unavailable`:`Linked ${be.format(t)}`}function Se(e){return e.endpoint.providerKind===`cloudflare_tunnel`?`Managed tunnel`:`Activity publishing only`}function Ce(e){let t=(0,z.c)(46),{environment:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,J.jsx)(y,{className:`size-4`}),t[0]=r):r=t[0];let i=e.confirmationOpen,a=e.onConfirmationChange,o;t[1]===n.label?o=t[2]:(o=(0,J.jsx)(`h3`,{className:`truncate text-sm leading-4.5 font-medium text-foreground`,children:n.label}),t[1]=n.label,t[2]=o);let s;t[3]===n.linkedAt?s=t[4]:(s=xe(n.linkedAt),t[3]=n.linkedAt,t[4]=s);let c;t[5]===n?c=t[6]:(c=Se(n),t[5]=n,t[6]=c);let l;t[7]!==s||t[8]!==c?(l=(0,J.jsxs)(`p`,{className:`mt-1 text-xs leading-4.5 text-muted-foreground`,children:[s,` · `,c]}),t[7]=s,t[8]=c,t[9]=l):l=t[9];let u;t[10]!==o||t[11]!==l?(u=(0,J.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[o,l]}),t[10]=o,t[11]=l,t[12]=u):u=t[12];let d;t[13]===e.mutationPending?d=t[14]:(d=(0,J.jsx)(ae,{render:(0,J.jsx)(p,{size:`sm`,variant:`destructive-outline`,disabled:e.mutationPending,children:`Deregister`})}),t[13]=e.mutationPending,t[14]=d);let f;t[15]!==u||t[16]!==d?(f=(0,J.jsxs)(`div`,{className:`flex items-start gap-4`,children:[u,d]}),t[15]=u,t[16]=d,t[17]=f):f=t[17];let m=`Confirm deregistration of ${n.label}`,h;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,J.jsx)(`h4`,{className:`text-sm leading-4.5 font-semibold text-foreground`,children:`Deregister server`}),t[18]=h):h=t[18];let g;t[19]===n.label?g=t[20]:(g=(0,J.jsxs)(`p`,{className:`mt-1 text-xs leading-4.5 text-muted-foreground`,children:[`“`,n.label,`” will be removed from this account.`]}),t[19]=n.label,t[20]=g);let _;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,J.jsx)(`p`,{className:`mt-4 max-w-xl text-xs leading-4.5 text-muted-foreground`,children:`P4 Connect access will be revoked, any managed tunnel will be removed, and a host space will become available. Local connections on your devices are not changed.`}),t[21]=_):_=t[21];let v;t[22]===e?v=t[23]:(v=()=>e.onConfirmationChange(!1),t[22]=e,t[23]=v);let b;t[24]!==e.mutationPending||t[25]!==v?(b=(0,J.jsx)(p,{size:`sm`,variant:`ghost`,disabled:e.mutationPending,onClick:v,children:`Cancel`}),t[24]=e.mutationPending,t[25]=v,t[26]=b):b=t[26];let x;t[27]!==n||t[28]!==e?(x=()=>e.onDeregister(n),t[27]=n,t[28]=e,t[29]=x):x=t[29];let S=e.mutationPending?`Deregistering…`:`Deregister`,C;t[30]!==e.mutationPending||t[31]!==x||t[32]!==S?(C=(0,J.jsx)(p,{size:`sm`,variant:`destructive`,disabled:e.mutationPending,onClick:x,children:S}),t[30]=e.mutationPending,t[31]=x,t[32]=S,t[33]=C):C=t[33];let w;t[34]!==b||t[35]!==C?(w=(0,J.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[b,C]}),t[34]=b,t[35]=C,t[36]=w):w=t[36];let T;t[37]!==m||t[38]!==g||t[39]!==w?(T=(0,J.jsx)(ie,{children:(0,J.jsx)(`div`,{className:`pt-3`,children:(0,J.jsxs)(`div`,{className:`rounded-lg border border-input bg-muted/32 px-5 py-4 shadow-xs/5`,role:`group`,"aria-label":m,children:[h,g,_,w]})})}),t[37]=m,t[38]=g,t[39]=w,t[40]=T):T=t[40];let E;return t[41]!==e.confirmationOpen||t[42]!==e.onConfirmationChange||t[43]!==T||t[44]!==f?(E=(0,J.jsx)(Z,{icon:r,children:(0,J.jsxs)(oe,{open:i,onOpenChange:a,children:[f,T]})}),t[41]=e.confirmationOpen,t[42]=e.onConfirmationChange,t[43]=T,t[44]=f,t[45]=E):E=t[45],E}function we(){let e=(0,z.c)(41),t=se(),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},e[0]=n):n=e[0];let r=j(W,n),[i,a]=(0,B.useState)(null),[o,s]=(0,B.useState)(null),c=(0,B.useRef)(!1),l;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(l={accountId:null,linkedAtById:new Map},e[1]=l):l=e[1];let[u,d]=(0,B.useState)(l),f;e[2]!==r||e[3]!==t?(f=async e=>{let n=t.accountId;if(!n||c.current)return;c.current=!0,a(e.environmentId);let i=await r({accountId:n,environmentId:e.environmentId});if(c.current=!1,a(null),i._tag===`Success`){s(null),d(t=>{let r=new Map(t.accountId===n?t.linkedAtById:[]);return r.set(e.environmentId,e.linkedAt),{accountId:n,linkedAtById:r}}),t.refresh(),A.add({type:`success`,title:`Server deregistered`,description:`P4 Connect access was revoked and a host space is now available.`});return}if(S(i))return;let o=C(i),l=o instanceof Error?o.message:`Could not deregister the server.`,u=x(o);console.error(`[p4-connect] Could not deregister environment`,{environmentId:e.environmentId,message:l,traceId:u,cause:o}),A.add({type:`error`,title:`Could not deregister server`,description:l,data:u?{secondaryActionProps:{children:`Copy trace ID`,onClick:()=>void navigator.clipboard?.writeText(u)}}:void 0})},e[2]=r,e[3]=t,e[4]=f):f=e[4];let p=f,m;e[5]!==t.accountId||e[6]!==u.accountId||e[7]!==u.linkedAtById?(m=u.accountId===t.accountId?u.linkedAtById:new Map,e[5]=t.accountId,e[6]=u.accountId,e[7]=u.linkedAtById,e[8]=m):m=e[8];let h=m,g,_,v,b,w,T;if(e[9]!==o||e[10]!==i||e[11]!==t.accountId||e[12]!==t.data||e[13]!==t.error||e[14]!==t.isPending||e[15]!==t.refresh||e[16]!==p||e[17]!==h){let n;e[24]===h?n=e[25]:(n=e=>h.get(e.environmentId)!==e.linkedAt,e[24]=h,e[25]=n);let r=(t.data??[]).filter(n),a=!t.accountId||t.data===null&&!t.error;g=Y,b=`P4 Connect`,w=`Environments registered to your account. Connections on this device are managed in Settings.`;let c=i!==null;e[26]!==t.isPending||e[27]!==t.refresh||e[28]!==c?(T=(0,J.jsx)(X,{disabled:c,isPending:t.isPending,onClick:t.refresh}),e[26]=t.isPending,e[27]=t.refresh,e[28]=c,e[29]=T):T=e[29],e[30]===t.error?_=e[31]:(_=t.error?(0,J.jsxs)(`div`,{className:`mb-4 border-t border-destructive/35 py-3 text-xs`,role:`alert`,children:[(0,J.jsx)(`p`,{className:`font-medium text-destructive-foreground`,children:`Could not load P4 Connect environments`}),(0,J.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:t.error})]}):null,e[30]=t.error,e[31]=_),v=a?(0,J.jsx)(`p`,{className:`border-t py-4 text-xs text-muted-foreground`,role:`status`,children:`Loading environments…`}):r.length>0?(0,J.jsx)(`ul`,{className:`border-t`,children:r.map(e=>(0,J.jsx)(Ce,{environment:e,confirmationOpen:o===e.environmentId,mutationPending:i!==null,onConfirmationChange:t=>s(t?e.environmentId:null),onDeregister:e=>void p(e)},e.environmentId))}):t.error?null:(0,J.jsx)(`div`,{className:`border-t`,children:(0,J.jsxs)(L,{size:`compact`,children:[(0,J.jsx)(N,{variant:`icon`,children:(0,J.jsx)(y,{})}),(0,J.jsxs)(P,{children:[(0,J.jsx)(F,{children:`No P4 Connect environments`}),(0,J.jsx)(I,{children:`Link an environment from its local Settings to make it available through P4 Connect.`})]})]})}),e[9]=o,e[10]=i,e[11]=t.accountId,e[12]=t.data,e[13]=t.error,e[14]=t.isPending,e[15]=t.refresh,e[16]=p,e[17]=h,e[18]=g,e[19]=_,e[20]=v,e[21]=b,e[22]=w,e[23]=T}else g=e[18],_=e[19],v=e[20],b=e[21],w=e[22],T=e[23];let E;e[32]!==_||e[33]!==v?(E=(0,J.jsxs)(`div`,{children:[_,v]}),e[32]=_,e[33]=v,e[34]=E):E=e[34];let D;return e[35]!==g||e[36]!==b||e[37]!==w||e[38]!==T||e[39]!==E?(D=(0,J.jsx)(g,{title:b,description:w,action:T,children:E}),e[35]=g,e[36]=b,e[37]=w,e[38]=T,e[39]=E,e[40]=D):D=e[40],D}var $=[{label:`Mobile clients`,url:`mobile-clients`,icon:(0,J.jsx)(l,{className:`size-4`}),content:(0,J.jsx)(ve,{})},{label:`P4 Connect`,url:`p4-connect`,icon:(0,J.jsx)(y,{className:`size-4`}),content:(0,J.jsx)(we,{})}];function Te(){let e=(0,z.c)(8),t=te(),{isSignedIn:n}=ne(),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={},e[0]=r):r=e[0];let[i,a]=(0,B.useState)(r),o;e[1]===t?o=e[2]:(o=()=>{let e=(e,t)=>a(n=>({...n,[e]:t}));t.openUserProfile({__experimental_startPath:`/p4-connect`,customPages:$.map(t=>({label:t.label,url:t.url,mount:n=>e(`content:${t.url}`,n),unmount:()=>e(`content:${t.url}`,void 0),mountIcon:n=>e(`icon:${t.url}`,n),unmountIcon:()=>e(`icon:${t.url}`,void 0)}))})},e[1]=t,e[2]=o);let s=o,c;e[3]===i?c=e[4]:(c=$.flatMap(e=>{let t=i[`content:${e.url}`],n=i[`icon:${e.url}`];return[t?(0,R.createPortal)(e.content,t,`content:${e.url}`):null,n?(0,R.createPortal)(e.icon,n,`icon:${e.url}`):null]}),e[3]=i,e[4]=c);let l=c,u=n?s:null,d;return e[5]!==l||e[6]!==u?(d={open:u,portals:l},e[5]=l,e[6]=u,e[7]=d):d=e[7],d}export{Te as n,$ as t};
2
+ //# sourceMappingURL=P4ConnectAccountPages-BNv1XOMs.js.map
@@ -1,2 +1,2 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{Qf as t,RE as n,mE as r}from"./utils-hgbJ2TVM.js";import{o as i}from"./runtime-D-mOwjrE.js";import{n as a,r as o}from"./dist-DWlOCBGN.js";import{c as s,l as c,s as l}from"./sidebar-CV_a9dPF.js";import{t as u}from"./P4ConnectAccountPages-CFPHk3YU.js";import{t as d}from"./useP4ConnectAuthPrompt-ubtmHQ6f.js";var f=n(),p=e(r(),1);function m(){let e=(0,f.c)(1);if(!i())return null;let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,p.jsx)(v,{}),e[0]=t):t=e[0],t}function h(){let e=(0,f.c)(1);if(!i())return null;let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,p.jsx)(g,{}),e[0]=t):t=e[0],t}function g(){let e=(0,f.c)(1),{isLoaded:t,isSignedIn:n}=o();if(!t||!n)return null;let r;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,p.jsx)(a,{appearance:{elements:{avatarBox:`size-7`,userButtonTrigger:`rounded-lg p-1 hover:bg-sidebar-row-hover`}},children:u.map(_)}),e[0]=r):r=e[0],r}function _(e){return(0,p.jsx)(a.UserProfilePage,{label:e.label,labelIcon:e.icon,url:e.url,children:e.content},e.url)}function v(){let e=(0,f.c)(7),{isLoaded:n,isSignedIn:r}=o(),{authPrompt:i,openAuthPrompt:a}=d();if(!n||r)return null;let u,m;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,p.jsx)(t,{}),m=(0,p.jsx)(`span`,{children:`Sign in to P4 Connect`}),e[0]=u,e[1]=m):(u=e[0],m=e[1]);let h;e[2]===a?h=e[3]:(h=(0,p.jsx)(l,{children:(0,p.jsx)(c,{children:(0,p.jsxs)(s,{onClick:a,children:[u,m]})})}),e[2]=a,e[3]=h);let g;return e[4]!==i||e[5]!==h?(g=(0,p.jsxs)(p.Fragment,{children:[h,i]}),e[4]=i,e[5]=h,e[6]=g):g=e[6],g}export{h as P4ConnectSidebarAvatar,m as P4ConnectSidebarSignIn};
2
- //# sourceMappingURL=P4ConnectSidebarSignIn-BMrzp8XI.js.map
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{Qf as t,RE as n,mE as r}from"./utils-hgbJ2TVM.js";import{o as i}from"./runtime-DPOrcghx.js";import{n as a,r as o}from"./dist-DJO3gX7B.js";import{c as s,l as c,s as l}from"./sidebar-CV_a9dPF.js";import{t as u}from"./P4ConnectAccountPages-BNv1XOMs.js";import{t as d}from"./useP4ConnectAuthPrompt-qVqxcT08.js";var f=n(),p=e(r(),1);function m(){let e=(0,f.c)(1);if(!i())return null;let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,p.jsx)(v,{}),e[0]=t):t=e[0],t}function h(){let e=(0,f.c)(1);if(!i())return null;let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,p.jsx)(g,{}),e[0]=t):t=e[0],t}function g(){let e=(0,f.c)(1),{isLoaded:t,isSignedIn:n}=o();if(!t||!n)return null;let r;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,p.jsx)(a,{appearance:{elements:{avatarBox:`size-7`,userButtonTrigger:`rounded-lg p-1 hover:bg-sidebar-row-hover`}},children:u.map(_)}),e[0]=r):r=e[0],r}function _(e){return(0,p.jsx)(a.UserProfilePage,{label:e.label,labelIcon:e.icon,url:e.url,children:e.content},e.url)}function v(){let e=(0,f.c)(7),{isLoaded:n,isSignedIn:r}=o(),{authPrompt:i,openAuthPrompt:a}=d();if(!n||r)return null;let u,m;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,p.jsx)(t,{}),m=(0,p.jsx)(`span`,{children:`Sign in to P4 Connect`}),e[0]=u,e[1]=m):(u=e[0],m=e[1]);let h;e[2]===a?h=e[3]:(h=(0,p.jsx)(l,{children:(0,p.jsx)(c,{children:(0,p.jsxs)(s,{onClick:a,children:[u,m]})})}),e[2]=a,e[3]=h);let g;return e[4]!==i||e[5]!==h?(g=(0,p.jsxs)(p.Fragment,{children:[h,i]}),e[4]=i,e[5]=h,e[6]=g):g=e[6],g}export{h as P4ConnectSidebarAvatar,m as P4ConnectSidebarSignIn};
2
+ //# sourceMappingURL=P4ConnectSidebarSignIn-BqW3vURC.js.map