@vellumai/web 0.12.7 → 0.12.8

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 (328) hide show
  1. package/dist/assets/{a2a-invite-CYkZ2bwB.js → a2a-invite-C4885wc_.js} +1 -1
  2. package/dist/assets/{about-page-CDf8_c83.js → about-page-OhJ1Y0_b.js} +1 -1
  3. package/dist/assets/{account-page-DYgu7ene.js → account-page-Bd7a2i5_.js} +1 -1
  4. package/dist/assets/{account-shell-Cxi1v479.js → account-shell-RM4hokh5.js} +1 -1
  5. package/dist/assets/{acp-run-detail-panel--S5Mrgwf.js → acp-run-detail-panel-CCLk2KCU.js} +1 -1
  6. package/dist/assets/{activation-list-route-fUUXXrqq.js → activation-list-route-DzBmo7MF.js} +1 -1
  7. package/dist/assets/{activity-redirect-page-Dday27zi.js → activity-redirect-page-aalRz3ru.js} +1 -1
  8. package/dist/assets/{activity-steps-panel-BnCTZLXH.js → activity-steps-panel-MY7LyILM.js} +1 -1
  9. package/dist/assets/add-credits-modal-C65Z6nbb.js +1 -0
  10. package/dist/assets/{add-credits-modal-BPRQXrJL.js → add-credits-modal-DYXqJVrA.js} +1 -1
  11. package/dist/assets/{ai-page-BmPw_Cbb.js → ai-page-Bv8MHKwy.js} +1 -1
  12. package/dist/assets/{all-chats-page-route-XyYPy--V.js → all-chats-page-route-BC4cJbn9.js} +1 -1
  13. package/dist/assets/{android-billing-handoff-CvgyuFs9.js → android-billing-handoff-DkztgMMX.js} +1 -1
  14. package/dist/assets/{animated-stat-square-gKVZj83m.js → animated-stat-square-DfspueEE.js} +1 -1
  15. package/dist/assets/{api-key-screen-B3eNGHTQ.js → api-key-screen-DMYrX3xq.js} +1 -1
  16. package/dist/assets/{app-KRIEMzuO.js → app-BEoekemj.js} +21 -19
  17. package/dist/assets/{app-info-BS5SWiPy.js → app-info-JELjTeSr.js} +1 -1
  18. package/dist/assets/{archive-redirect-page-B_JVRF8z.js → archive-redirect-page-CDu9_cSE.js} +1 -1
  19. package/dist/assets/{assistant-handle-modal-cqAXFvU4.js → assistant-handle-modal-B9aYt_fz.js} +1 -1
  20. package/dist/assets/{assistant-inbox-page-route-BmMCSNYC.js → assistant-inbox-page-route-BlKCkLjN.js} +1 -1
  21. package/dist/assets/{assistant-status-panel-5KKU97Nr.js → assistant-status-panel-Ib811iyR.js} +1 -1
  22. package/dist/assets/auth-store-BNRELUI-.js +1 -0
  23. package/dist/assets/{auth-welcome-screen-CK9ayr5r.js → auth-welcome-screen-CnpHRdVh.js} +1 -1
  24. package/dist/assets/avatar-bundled-components-CA2b3Qbn.js +1 -0
  25. package/dist/assets/{avatar-random-B0PlMwfP.js → avatar-random-Bqs0WRXW.js} +2 -2
  26. package/dist/assets/{await-org-header-settled-DCrUbt__.js → await-org-header-settled-Bka_Fh2i.js} +1 -1
  27. package/dist/assets/{background-task-detail-panel-ByZEhdsg.js → background-task-detail-panel-pwmuvBdb.js} +1 -1
  28. package/dist/assets/{billing-page-CYKuyCF5.js → billing-page-CQDe4wC9.js} +3 -3
  29. package/dist/assets/{billing-redirect-page-t6TNZq6q.js → billing-redirect-page-CgxuQ6OG.js} +1 -1
  30. package/dist/assets/{bookmarks-page-DkomjdJQ.js → bookmarks-page-BVSEx2HM.js} +1 -1
  31. package/dist/assets/{bundle-confirm-page-BRqor1bF.js → bundle-confirm-page-DxLUosoE.js} +1 -1
  32. package/dist/assets/{channel-transcript-panel-BZPmdLEj.js → channel-transcript-panel-AnyjZw-p.js} +1 -1
  33. package/dist/assets/{channels-page-route-CtttpYll.js → channels-page-route-CoXHj9DC.js} +1 -1
  34. package/dist/assets/{chat-info-panel-DQumRkcF.js → chat-info-panel-oNSMH-Rg.js} +1 -1
  35. package/dist/assets/{checkout-continuation-DDjhky4Y.js → checkout-continuation-ZsRm--tW.js} +1 -1
  36. package/dist/assets/{checkout-page-CDYYh4ze.js → checkout-page-Cbc1Yxhk.js} +1 -1
  37. package/dist/assets/checkout-return-target-DMexYntq.js +1 -0
  38. package/dist/assets/{command-palette-BUFKVA4Z.js → command-palette-D98tgb3c.js} +1 -1
  39. package/dist/assets/{command-palette-window-page-C0dY_FbH.js → command-palette-window-page-BwYCB4uz.js} +1 -1
  40. package/dist/assets/command-palette-xFt9p-Zp.js +1 -0
  41. package/dist/assets/{community-page-DDVVXFKB.js → community-page-C_t6hJx9.js} +1 -1
  42. package/dist/assets/{companion-accent-obJ7TDkU.js → companion-accent-DHN8mSGN.js} +1 -1
  43. package/dist/assets/{companion-dock-zones-page-CUZsYl_W.js → companion-dock-zones-page-yp3BLs-9.js} +1 -1
  44. package/dist/assets/{companion-layout-Cl8T5Bfs.js → companion-layout-DUIauyGx.js} +1 -1
  45. package/dist/assets/{companion-popover-Duq3If7x.js → companion-popover-CEltebX7.js} +1 -1
  46. package/dist/assets/{companion-popover-page-8OaaN-qP.js → companion-popover-page-NrLfgW85.js} +1 -1
  47. package/dist/assets/{companion-surface-DzxGavvE.js → companion-surface-CEpWVTaQ.js} +1 -1
  48. package/dist/assets/{companion-surface-page-BI1DVG0L.js → companion-surface-page-Dfs9lnVq.js} +1 -1
  49. package/dist/assets/{companion-tour-entry-D35urSvp.js → companion-tour-entry-CEdPrBsl.js} +1 -1
  50. package/dist/assets/{companion-watch-frame-page-chC7gmAI.js → companion-watch-frame-page-XbdyXdlU.js} +1 -1
  51. package/dist/assets/{connect-page-Cx7ACmXt.js → connect-page-DvwqAL21.js} +1 -1
  52. package/dist/assets/{consent-controls-B8KluMR-.js → consent-controls-CSns_4iB.js} +1 -1
  53. package/dist/assets/{contacts-gateway-DJQtU5it.js → contacts-gateway-DL44TLR9.js} +1 -1
  54. package/dist/assets/{contacts-page-route-g0cBfSRU.js → contacts-page-route-BIASFsPk.js} +1 -1
  55. package/dist/assets/{copy-button-Bwu12tAq.js → copy-button-benjZQNN.js} +1 -1
  56. package/dist/assets/{credential-entry-page-CrMmjA4m.js → credential-entry-page-fH4FNFwY.js} +1 -1
  57. package/dist/assets/{credentials-page-DXegpKuT.js → credentials-page-BgsUXMw4.js} +1 -1
  58. package/dist/assets/{csv-preview-BUNDraKQ.js → csv-preview-CBVZAL8V.js} +1 -1
  59. package/dist/assets/{danger-zone-redirect-page-Dju7UyCP.js → danger-zone-redirect-page-rAqyukS8.js} +1 -1
  60. package/dist/assets/debug-page-s3VnB3Jn.js +4 -0
  61. package/dist/assets/{deploy-dialogs-CKv9kQor.js → deploy-dialogs-BwKeOiNO.js} +1 -1
  62. package/dist/assets/deploy-dialogs-CKFVL9lA.js +1 -0
  63. package/dist/assets/{desktop-preview-content-BwMNHlWb.js → desktop-preview-content-DyhOQZfU.js} +2 -2
  64. package/dist/assets/{desktop-status-CCzewHXe.js → desktop-status-rhE91WHU.js} +1 -1
  65. package/dist/assets/{desktop-viewer-DBH1IT5s.js → desktop-viewer-DnRXsZHE.js} +1 -1
  66. package/dist/assets/{detail-card-C53pHjsM.js → detail-card-DdL-TwEw.js} +1 -1
  67. package/dist/assets/{detail-panel-stop-button-t_VDZYtt.js → detail-panel-stop-button-9gdxgBZq.js} +1 -1
  68. package/dist/assets/{detail-primitives-BHVQRcGw.js → detail-primitives-DbHxZutJ.js} +1 -1
  69. package/dist/assets/{developer-page-CKcDBScK.js → developer-page-CLDXmpgw.js} +1 -1
  70. package/dist/assets/{devices-redirect-page-BEyGhbmn.js → devices-redirect-page-DTriAmul.js} +1 -1
  71. package/dist/assets/{dictation-overlay-page-DpanSK5-.js → dictation-overlay-page-8oynsdBm.js} +1 -1
  72. package/dist/assets/document-load-Dd9T9sVB.js +1 -0
  73. package/dist/assets/{document-load-B5HpKq-W.js → document-load-DdRg4kwv.js} +1 -1
  74. package/dist/assets/{document-viewer-page-4Z_VnjKZ.js → document-viewer-page-DwqleCG5.js} +1 -1
  75. package/dist/assets/{emails-page-DyrcXFet.js → emails-page-d48Qo5TY.js} +1 -1
  76. package/dist/assets/esm-BMVS8Ywz.js +2 -0
  77. package/dist/assets/esm-Bm61i-L4.js +1 -0
  78. package/dist/assets/esm-CUO0AHtA.js +2 -0
  79. package/dist/assets/esm-Ci2CqtrR.js +2 -0
  80. package/dist/assets/esm-DM-kxKqE.js +1 -0
  81. package/dist/assets/esm-PJP6gQUq.js +2 -0
  82. package/dist/assets/{esm-DFoZ6rpj.js → esm-YJgArrZn.js} +1 -1
  83. package/dist/assets/esm-ZDwTeYcs.js +2 -0
  84. package/dist/assets/{esm-COgrn4oo.js → esm-oFf4cNn1.js} +2 -2
  85. package/dist/assets/{esm-DPwp_tyY.js → esm-xHo3DTmi.js} +1 -1
  86. package/dist/assets/{file-diff-view-DqA1_0h3.js → file-diff-view-A52sCKKz.js} +1 -1
  87. package/dist/assets/{file-view-mode-DPofWJnz.js → file-view-mode-DqXCmgGD.js} +1 -1
  88. package/dist/assets/general-page-Y55ICpxV.js +2 -0
  89. package/dist/assets/{hatching-screen-C5fid3Mi.js → hatching-screen-BCrEhJki.js} +1 -1
  90. package/dist/assets/{hosting-screen-BTxmBl_3.js → hosting-screen-DrbGcUwu.js} +1 -1
  91. package/dist/assets/{identity-page-route-DSyT39Yq.js → identity-page-route-PW0b8HfB.js} +1 -1
  92. package/dist/assets/{inspect-page-WDA56TDM.js → inspect-page-DsB1BUwJ.js} +3 -3
  93. package/dist/assets/{integrations-page-7jff5YRS.js → integrations-page-phceinc7.js} +1 -1
  94. package/dist/assets/{intelligence-layout-DOOxr8TM.js → intelligence-layout-ClXPJOlz.js} +1 -1
  95. package/dist/assets/intelligence-layout-slots-store-jzhqxk-F.js +1 -0
  96. package/dist/assets/{keyboard-shortcuts-redirect-page-0f4iR9cK.js → keyboard-shortcuts-redirect-page-CZG9PbfD.js} +1 -1
  97. package/dist/assets/{latest-assistant-text-C5TlzsjF.js → latest-assistant-text-CfRyVmjf.js} +1 -1
  98. package/dist/assets/{library-detail-page-CXu1dzI8.js → library-detail-page-DB03TRkW.js} +1 -1
  99. package/dist/assets/{library-page-BdtUHlv5.js → library-page-SCpSNw8r.js} +1 -1
  100. package/dist/assets/local-mode-C-TKP5UT.js +1 -0
  101. package/dist/assets/{login-page-BYz-IJwG.js → login-page-DlzYKg__.js} +1 -1
  102. package/dist/assets/{logout-page-CA2Gb3fM.js → logout-page-DNJegpBL.js} +1 -1
  103. package/dist/assets/{logs-layout-BgviygkY.js → logs-layout-BYnI6Won.js} +1 -1
  104. package/dist/assets/managed-export-B8hZl8fK.js +1 -0
  105. package/dist/assets/{markdown-preview-CBXcCZg7.js → markdown-preview-BOAf9rHZ.js} +1 -1
  106. package/dist/assets/{media-preview-CTjI28Y4.js → media-preview-CiWddeik.js} +1 -1
  107. package/dist/assets/{memory-page-route-Od3Muhow.js → memory-page-route-DAe7cXOM.js} +1 -1
  108. package/dist/assets/{memory-router-playground-page-D8do5kDw.js → memory-router-playground-page-B6RLB6SJ.js} +1 -1
  109. package/dist/assets/{message-files-panel-CnyA6dJL.js → message-files-panel-D8Cvtzm7.js} +1 -1
  110. package/dist/assets/mutation-error-C2MukXLE.js +1 -0
  111. package/dist/assets/native-attachment-pickers-DMi3o2P3.js +1 -0
  112. package/dist/assets/native-file-Dcnehsuk.js +1 -0
  113. package/dist/assets/{notifications-page-CICwZV_j.js → notifications-page-B6BaoRe4.js} +1 -1
  114. package/dist/assets/{oauth-complete-page-HYAqM-h3.js → oauth-complete-page-C8RguTIe.js} +1 -1
  115. package/dist/assets/{oauth-popup-complete-page-0Nnhyx6m.js → oauth-popup-complete-page-9mkrWQG1.js} +1 -1
  116. package/dist/assets/paired-platform-identity-RQOjYmiL.js +1 -0
  117. package/dist/assets/{pairing-page-CbPjyGMx.js → pairing-page-BoIDiN07.js} +1 -1
  118. package/dist/assets/password-reset-page-CMKwr9QD.js +1 -0
  119. package/dist/assets/{pdf-file-preview-CfJUarVV.js → pdf-file-preview-BdmWkRby.js} +1 -1
  120. package/dist/assets/{peeking-eyes-C3X1d6Jj.js → peeking-eyes-GhtIN21V.js} +1 -1
  121. package/dist/assets/{permission-guide-page-DgNjuyxd.js → permission-guide-page-D4XS94Lj.js} +1 -1
  122. package/dist/assets/{permission-setup-C4VdQwwz.js → permission-setup-BKUZnWJQ.js} +1 -1
  123. package/dist/assets/{personality-page-BEzNdxON.js → personality-page-B7hhb6bJ.js} +1 -1
  124. package/dist/assets/{personality-page-ILl8FXFu.js → personality-page-DbSLfV_N.js} +1 -1
  125. package/dist/assets/{personality-sliders-PxNPuK2H.js → personality-sliders-DahfpXIK.js} +1 -1
  126. package/dist/assets/{plans-page-CI3FmLNs.js → plans-page-Q2u7IYdx.js} +1 -1
  127. package/dist/assets/{platform-loopback-page-DM2A9sb6.js → platform-loopback-page-Gsgl1-C1.js} +1 -1
  128. package/dist/assets/{plugin-detail-page-Cj6u283V.js → plugin-detail-page-CwTxMfPK.js} +1 -1
  129. package/dist/assets/{plugins-page-D7_NjR08.js → plugins-page-BeceTGDE.js} +1 -1
  130. package/dist/assets/plugins-surface-DRWOFcBb.js +1 -0
  131. package/dist/assets/{preview-error-B2MuMDf7.js → preview-error-Bsw56ZjR.js} +1 -1
  132. package/dist/assets/privacy-page-C0L5u1-E.js +1 -0
  133. package/dist/assets/{privacy-screen-BnqXrWj-.js → privacy-screen-q5pYNYHV.js} +1 -1
  134. package/dist/assets/{profile-card-BJ45rF7O.js → profile-card-ORX8JyeJ.js} +1 -1
  135. package/dist/assets/{provider-callback-page-CNNhqRdO.js → provider-callback-page-Bh4aARKp.js} +1 -1
  136. package/dist/assets/{provider-key-CqD-hAxF.js → provider-key-DhHj1MSM.js} +1 -1
  137. package/dist/assets/{provider-signup-page-BEBgiI0J.js → provider-signup-page-BZcyuRq8.js} +1 -1
  138. package/dist/assets/{quick-input-page-ZC5y6AKn.js → quick-input-page-B0vdeXBp.js} +1 -1
  139. package/dist/assets/referral-modal-0tLKuYzN.js +1 -0
  140. package/dist/assets/{referral-modal-B5zxNJBt.js → referral-modal-BgoEpFmG.js} +1 -1
  141. package/dist/assets/{rehype-katex-DWUGzNKD.js → rehype-katex-CwfN9TOG.js} +1 -1
  142. package/dist/assets/{research-mock-page-B3giO94y.js → research-mock-page-oXOlmOna.js} +1 -1
  143. package/dist/assets/{research-onboarding-route-Dim74aoQ.js → research-onboarding-route-q3lZEjxC.js} +1 -1
  144. package/dist/assets/{review-terms-screen-CIYiUq4M.js → review-terms-screen-LCDdoz6t.js} +1 -1
  145. package/dist/assets/routes-1ENCqxlq.js +1 -0
  146. package/dist/assets/{schedules-J3G9N-px.js → schedules-RwCneOYe.js} +1 -1
  147. package/dist/assets/{schedules-page-Cnl8mEzJ.js → schedules-page-D2HxxCQz.js} +1 -1
  148. package/dist/assets/{security-redirect-page-BEtWQiAG.js → security-redirect-page-BdOwkxkl.js} +1 -1
  149. package/dist/assets/{select-assistant-screen-BHvcUbOb.js → select-assistant-screen-B1NbmvWZ.js} +1 -1
  150. package/dist/assets/{self-hosted-servers-Bn0mvFIm.js → self-hosted-servers-Dn5AaPCS.js} +1 -1
  151. package/dist/assets/{service-form-controls-DaeZPEiA.js → service-form-controls-Bn1R361b.js} +1 -1
  152. package/dist/assets/{setting-row-DPTW9jvI.js → setting-row-CaxliRhN.js} +1 -1
  153. package/dist/assets/{settings-Bh67VJVe.js → settings-CPmDyMN-.js} +4 -2
  154. package/dist/assets/{settings-k5uhZfPH.js → settings-DFXVH_HE.js} +4 -2
  155. package/dist/assets/{settings-ClEDqshB.js → settings-DydJJiwS.js} +4 -2
  156. package/dist/assets/settings-divider-DipomhZT.js +1 -0
  157. package/dist/assets/{settings-layout-DEmxtBd4.js → settings-layout-C7CQeAi8.js} +1 -1
  158. package/dist/assets/{settings-DDU54LDK.js → settings-w04_tItH.js} +4 -2
  159. package/dist/assets/share-feedback-modal-CrOSSoWU.js +1 -0
  160. package/dist/assets/{share-feedback-modal-Du_F68zS.js → share-feedback-modal-W3JhVF1c.js} +2 -2
  161. package/dist/assets/{sidebar-tree-D43H3cb8.js → sidebar-tree-CtDTchuN.js} +1 -1
  162. package/dist/assets/{signup-page-BiV-Kq2O.js → signup-page-BgVg1-Cz.js} +1 -1
  163. package/dist/assets/{signup-shell-BbFj5txC.js → signup-shell-rqZZKQs9.js} +1 -1
  164. package/dist/assets/{skill-detail-page-CNTwONYG.js → skill-detail-page-DVceqbB8.js} +1 -1
  165. package/dist/assets/{skill-detail-panel-Duoeqpk6.js → skill-detail-panel-D0MQeUNt.js} +1 -1
  166. package/dist/assets/{skill-removal-dialog-DcbMCW1X.js → skill-removal-dialog-CKyIY15v.js} +1 -1
  167. package/dist/assets/{skills-page-DeEyocII.js → skills-page-BNFEhwCh.js} +1 -1
  168. package/dist/assets/{sounds-page-CYqyUiLI.js → sounds-page-D-1xB2X0.js} +1 -1
  169. package/dist/assets/{start-screen-C4ocEh6e.js → start-screen-BfdqRCiG.js} +1 -1
  170. package/dist/assets/{step-detail-header-C0_Bji0I.js → step-detail-header-LQsSbC2J.js} +1 -1
  171. package/dist/assets/{stt-language-picker-modal-Dw_dzvcQ.js → stt-language-picker-modal-CU8T9AvB.js} +1 -1
  172. package/dist/assets/{subagent-detail-panel-DqFckc_d.js → subagent-detail-panel-CBnRBOPg.js} +1 -1
  173. package/dist/assets/{superpowers-page-kjcwHwaR.js → superpowers-page-DabWyYFo.js} +1 -1
  174. package/dist/assets/{system-events-page-C0Nrrv_n.js → system-events-page-BO75f0oo.js} +1 -1
  175. package/dist/assets/{system-events-redirect-page-DR4dTzmZ.js → system-events-redirect-page-DTc8VcbG.js} +1 -1
  176. package/dist/assets/{tabular-grid-9asraGxC.js → tabular-grid-TnP0G_0N.js} +1 -1
  177. package/dist/assets/teleport-gateway-client-BY9KVOT2.js +1 -0
  178. package/dist/assets/{text-preview-C6jKP_-h.js → text-preview-ClaaOGkz.js} +1 -1
  179. package/dist/assets/{theme-stage-page-BCd5ZTdW.js → theme-stage-page-CDguIcG0.js} +1 -1
  180. package/dist/assets/{tiptap-document-editor-BCrbYYDo.js → tiptap-document-editor-C6mVckqJ.js} +1 -1
  181. package/dist/assets/{tool-detail-panel-nu-dK5jf.js → tool-detail-panel-CQ-R1S2x.js} +1 -1
  182. package/dist/assets/tool-detail-panel-D2UjNK8Q.js +1 -0
  183. package/dist/assets/{trait-cycle-row-CPRGog-6.js → trait-cycle-row-Dw9MgLO3.js} +1 -1
  184. package/dist/assets/{upgrade-cancel-page-BiU2HQZG.js → upgrade-cancel-page-BMNn9Xs4.js} +1 -1
  185. package/dist/assets/{upgrade-success-page-BCvxSNPT.js → upgrade-success-page-6A6LKBWV.js} +1 -1
  186. package/dist/assets/{usage-redirect-page-A2FxznAL.js → usage-redirect-page-DuL6faM2.js} +1 -1
  187. package/dist/assets/{use-app-delete-Bd9ibG9z.js → use-app-delete-CzP_P0YE.js} +1 -1
  188. package/dist/assets/{use-assistant-identity-details-BPVOfzxy.js → use-assistant-identity-details-C3ihvjLl.js} +1 -1
  189. package/dist/assets/{use-channel-trust-floors-BkkxL6wd.js → use-channel-trust-floors-ENV3m3Vx.js} +1 -1
  190. package/dist/assets/{use-checkout-dismiss-refresh-DYmiO0wT.js → use-checkout-dismiss-refresh-Db6rZnu3.js} +1 -1
  191. package/dist/assets/{use-edge-swipe-back-B2Kt4500.js → use-edge-swipe-back-zSNP4R0a.js} +1 -1
  192. package/dist/assets/{use-hotkey-recorder-Dngc9P3v.js → use-hotkey-recorder-DZfuD-Wf.js} +1 -1
  193. package/dist/assets/{use-invite-link-dialog-Dqkj_T4s.js → use-invite-link-dialog-D8vtY1q5.js} +1 -1
  194. package/dist/assets/{use-plugins-list-DJlgCfb-.js → use-plugins-list-Bfr06IMK.js} +1 -1
  195. package/dist/assets/{use-return-to-short-circuit-CrgMpIk2.js → use-return-to-short-circuit-C0-TwAO7.js} +1 -1
  196. package/dist/assets/{use-side-list-room-CttXRA29.js → use-side-list-room-CDaRUxpt.js} +1 -1
  197. package/dist/assets/{use-skill-actions-BhUkfXmL.js → use-skill-actions-BvJl4cE_.js} +1 -1
  198. package/dist/assets/{use-skill-detail-files-JWSwpirW.js → use-skill-detail-files-upPaF1Ti.js} +1 -1
  199. package/dist/assets/use-supports-credentials-settings-BmKvWH5p.js +1 -0
  200. package/dist/assets/{vendor-DLH51Vjf.js → vendor-cVd2QlFV.js} +2 -2
  201. package/dist/assets/{voice-page-CN-XVbya.js → voice-page-CyiYN5gw.js} +1 -1
  202. package/dist/assets/{wake-detail-panel-BN6Np2AU.js → wake-detail-panel-Ca8kOmoN.js} +1 -1
  203. package/dist/assets/{weather-forecast-display-Dg7Tug8o.js → weather-forecast-display-C5WJSVZN.js} +1 -1
  204. package/dist/assets/{web-C2Y5uOI1.js → web-4gtEtmAK.js} +1 -1
  205. package/dist/assets/{web-BmoVVmPZ.js → web-B2la00zR.js} +1 -1
  206. package/dist/assets/{web-D0qh5Vlp.js → web-BD6n-X3I.js} +1 -1
  207. package/dist/assets/{web-BlKAJber.js → web-BDmJP5H5.js} +1 -1
  208. package/dist/assets/{web-D5UHHnMG.js → web-Bb3-M0eN.js} +1 -1
  209. package/dist/assets/{web-Xy5dhNHF.js → web-Co3fdUhk.js} +1 -1
  210. package/dist/assets/{web-CAi9YePi.js → web-DUEEDTea.js} +1 -1
  211. package/dist/assets/{web-vcW3se1t.js → web-FCPcWxlK.js} +1 -1
  212. package/dist/assets/{web-DZvE04fg.js → web-p3qShnRq.js} +1 -1
  213. package/dist/assets/welcome-screen-BoF2bJeJ.js +1 -0
  214. package/dist/assets/{workflow-detail-panel-Bo3bUe-w.js → workflow-detail-panel-BWjagS_I.js} +1 -1
  215. package/dist/assets/{workspace-page-yTSdnWq3.js → workspace-page-BwYluW9Z.js} +1 -1
  216. package/dist/assets/{xlsx-preview-C7vk2tgm.js → xlsx-preview-D7-VqTY7.js} +1 -1
  217. package/dist/index.html +2 -2
  218. package/package.json +1 -1
  219. package/dist/assets/add-credits-modal-htqAQMX6.js +0 -1
  220. package/dist/assets/auth-store-CUfwxB8-.js +0 -1
  221. package/dist/assets/avatar-bundled-components-BQa_U1xg.js +0 -1
  222. package/dist/assets/checkout-return-target-B6Qnd5vl.js +0 -1
  223. package/dist/assets/command-palette-CYJg3gK4.js +0 -1
  224. package/dist/assets/debug-page-Cu82bP9V.js +0 -4
  225. package/dist/assets/deploy-dialogs-B1_w7Ez-.js +0 -1
  226. package/dist/assets/document-load-DHdbQvKt.js +0 -1
  227. package/dist/assets/esm-5n5jSt3e.js +0 -2
  228. package/dist/assets/esm-B5HvNA2f.js +0 -1
  229. package/dist/assets/esm-BVAuvmyr.js +0 -2
  230. package/dist/assets/esm-CIgMNIdz.js +0 -1
  231. package/dist/assets/esm-CvOYazPQ.js +0 -2
  232. package/dist/assets/esm-DetZupO7.js +0 -2
  233. package/dist/assets/esm-DpDUzGbk.js +0 -2
  234. package/dist/assets/general-page-B5G4H9NJ.js +0 -2
  235. package/dist/assets/intelligence-layout-slots-store-BvTIV21o.js +0 -1
  236. package/dist/assets/local-mode-C-1-fXwg.js +0 -1
  237. package/dist/assets/mutation-error--JEZBa3Q.js +0 -1
  238. package/dist/assets/native-attachment-pickers-BAxJDXTk.js +0 -1
  239. package/dist/assets/native-file-BlJDG-CS.js +0 -1
  240. package/dist/assets/paired-platform-identity-BN7Zkoo1.js +0 -1
  241. package/dist/assets/password-reset-page-j1R5YVAm.js +0 -1
  242. package/dist/assets/plugins-surface-ClVSBf-s.js +0 -1
  243. package/dist/assets/privacy-page-B2g1Pqqs.js +0 -1
  244. package/dist/assets/referral-modal-BUgtMC2a.js +0 -1
  245. package/dist/assets/routes-zhZ8T_Wu.js +0 -1
  246. package/dist/assets/share-feedback-modal-C2fAj8NH.js +0 -1
  247. package/dist/assets/teleport-gateway-client-B8e53i-5.js +0 -1
  248. package/dist/assets/tool-detail-panel-BM_9qtZ-.js +0 -1
  249. package/dist/assets/use-supports-credentials-settings-fg3eXgQy.js +0 -1
  250. package/dist/assets/welcome-screen-B1WHzW0q.js +0 -1
  251. /package/dist/assets/{account-BkxBMG9Z.js → account-BlV1qOTL.js} +0 -0
  252. /package/dist/assets/{account-OIF2BHH7.js → account-Yhb7EPiE.js} +0 -0
  253. /package/dist/assets/{account-D5JdUO7K.js → account-iXFebGNX.js} +0 -0
  254. /package/dist/assets/{account-DYG79724.js → account-zbO2wvfB.js} +0 -0
  255. /package/dist/assets/{activation-Dd7eAIHs.js → activation-BBxBYSHn.js} +0 -0
  256. /package/dist/assets/{activation-tasks-rViOqW7C.js → activation-BpktogSQ.js} +0 -0
  257. /package/dist/assets/{activation-C91KPzrh.js → activation-CflM_LQ5.js} +0 -0
  258. /package/dist/assets/{activation-ReimSfhn.js → activation-Daef_l1I.js} +0 -0
  259. /package/dist/assets/{activation-tasks-wtMwJ0EV.js → activation-tasks-CV_7HKqY.js} +0 -0
  260. /package/dist/assets/{activation-yoBQ36AY.js → activation-tasks-CumTmEGs.js} +0 -0
  261. /package/dist/assets/{activation-tasks-efxGWsFw.js → activation-tasks-ayYeMiiM.js} +0 -0
  262. /package/dist/assets/{activation-tasks-D4dorV2v.js → activation-tasks-cUwRl0aM.js} +0 -0
  263. /package/dist/assets/{assistant-inbox-CAvCHzi9.js → assistant-inbox-BTOw7wfJ.js} +0 -0
  264. /package/dist/assets/{assistant-inbox-qWeVmA1L.js → assistant-inbox-CrSow2BT.js} +0 -0
  265. /package/dist/assets/{assistant-inbox-DslyrhIn.js → assistant-inbox-DFWc70zr.js} +0 -0
  266. /package/dist/assets/{assistant-inbox-CQdSXLLi.js → assistant-inbox-Yf62pQhK.js} +0 -0
  267. /package/dist/assets/{build.umd-B0ATW5UM.js → build.umd-DYhQfml1.js} +0 -0
  268. /package/dist/assets/{channels-Cz7YAOIH.js → channels-CgD67LT0.js} +0 -0
  269. /package/dist/assets/{channels-BMnoL5SH.js → channels-DeTGbiPP.js} +0 -0
  270. /package/dist/assets/{channels-vNXfvsPT.js → channels-DmpyD-3T.js} +0 -0
  271. /package/dist/assets/{channels-CsbKXJZc.js → channels-DuQeNaoa.js} +0 -0
  272. /package/dist/assets/{chat-DSN9cMJf.js → chat--ZmD-zey.js} +0 -0
  273. /package/dist/assets/{chat-bnp2gG3L.js → chat-Ck0pUgkI.js} +0 -0
  274. /package/dist/assets/{chat-BgW0N2Gb.js → chat-D6epoOzw.js} +0 -0
  275. /package/dist/assets/{chat-BE3uio8d.js → chat-D7C62t6i.js} +0 -0
  276. /package/dist/assets/{common-LOT1T5DR.js → common-BE18Mx30.js} +0 -0
  277. /package/dist/assets/{common-IoqtSg0p.js → common-Csoou9wq.js} +0 -0
  278. /package/dist/assets/{common-kmi6H4cg.js → common-Da7fmzzI.js} +0 -0
  279. /package/dist/assets/{common-BdQfnACd.js → common-Du9wm05t.js} +0 -0
  280. /package/dist/assets/{contacts-BTmOfEVL.js → contacts-Caqw0Sif.js} +0 -0
  281. /package/dist/assets/{contacts-Cxz-DyYF.js → contacts-Co__1ikw.js} +0 -0
  282. /package/dist/assets/{contacts-DgC-8PHB.js → contacts-DD_eTIfs.js} +0 -0
  283. /package/dist/assets/{contacts-mijLgegD.js → contacts-DK2Vo7jK.js} +0 -0
  284. /package/dist/assets/{credential-requests-CmFaXPwz.js → credential-requests-BGJaT5P8.js} +0 -0
  285. /package/dist/assets/{credential-requests-gl4lfjL4.js → credential-requests-CLJKvy8_.js} +0 -0
  286. /package/dist/assets/{credential-requests-D3J3i5oa.js → credential-requests-CY3rhP-v.js} +0 -0
  287. /package/dist/assets/{credential-requests-h908NRpv.js → credential-requests-K_K5QYWo.js} +0 -0
  288. /package/dist/assets/{definitions-BUCExH-9.js → definitions-BlPXXV5t.js} +0 -0
  289. /package/dist/assets/{definitions-DpZNNWA7.js → definitions-LeNf6LcI.js} +0 -0
  290. /package/dist/assets/{home-D4Knhe9B.js → home-Ciwnqb-0.js} +0 -0
  291. /package/dist/assets/{home-BI-fzzA0.js → home-D9CyYzwt.js} +0 -0
  292. /package/dist/assets/{home-BZGFmZ0D.js → home-DRimDXb8.js} +0 -0
  293. /package/dist/assets/{home-CM9kRnjx.js → home-FBlk-Kn_.js} +0 -0
  294. /package/dist/assets/{intelligence-DFW_P1Fv.js → intelligence-CxgptCMO.js} +0 -0
  295. /package/dist/assets/{intelligence-DXMdwG0t.js → intelligence-DNvhgTjL.js} +0 -0
  296. /package/dist/assets/{intelligence-B6UWzaf0.js → intelligence-leUjdPLY.js} +0 -0
  297. /package/dist/assets/{intelligence-DaVJutXG.js → intelligence-xPDdEiiN.js} +0 -0
  298. /package/dist/assets/{library-Dv9w5D8Z.js → library-DyYHQ0GO.js} +0 -0
  299. /package/dist/assets/{library-CFGvGWZt.js → library-EaBsKALT.js} +0 -0
  300. /package/dist/assets/{library-CmSFUt9r.js → library-Hu58bAic.js} +0 -0
  301. /package/dist/assets/{library-D26ezl8B.js → library-JzJCLakz.js} +0 -0
  302. /package/dist/assets/{logs-BJTGRcSn.js → logs-Bz1qUaJ9.js} +0 -0
  303. /package/dist/assets/{logs-BpX8Zuzb.js → logs-CZofq5k0.js} +0 -0
  304. /package/dist/assets/{logs-5jFWrQRx.js → logs-DWYxin7R.js} +0 -0
  305. /package/dist/assets/{logs-BPrpYBp7.js → logs-g4hcj_Po.js} +0 -0
  306. /package/dist/assets/{onboarding-B9_JitSg.js → onboarding-B8Kqi3lF.js} +0 -0
  307. /package/dist/assets/{onboarding-cBGAfB74.js → onboarding-BmTUYcow.js} +0 -0
  308. /package/dist/assets/{onboarding-BrS1fcVE.js → onboarding-Cg2xtY6u.js} +0 -0
  309. /package/dist/assets/{onboarding-Cx2yoeE5.js → onboarding-CudNVueP.js} +0 -0
  310. /package/dist/assets/{pdf-_tTrkaWt.js → pdf-D787RoTm.js} +0 -0
  311. /package/dist/assets/{remote-web-DkzrBzGi.js → remote-web-B48hBzZQ.js} +0 -0
  312. /package/dist/assets/{remote-web-42kFkA33.js → remote-web-BWB9gusD.js} +0 -0
  313. /package/dist/assets/{remote-web-DFX945w2.js → remote-web-Dir5X2Uc.js} +0 -0
  314. /package/dist/assets/{remote-web-CFPdQIeJ.js → remote-web-DoH8uPma.js} +0 -0
  315. /package/dist/assets/{schedules-CGU7CKaM.js → schedules-BWTSjt7H.js} +0 -0
  316. /package/dist/assets/{schedules-JnprnWDo.js → schedules-CWPFs_Xm.js} +0 -0
  317. /package/dist/assets/{schedules-J687h0Fh.js → schedules-DrYrmkfN.js} +0 -0
  318. /package/dist/assets/{schedules-Bk7XGnqS.js → schedules-Oj3x1jCN.js} +0 -0
  319. /package/dist/assets/{terminal-Cxm0NKaj.js → terminal-0PGnTYRE.js} +0 -0
  320. /package/dist/assets/{terminal-BV6xg9ZA.js → terminal-BxOTNQdO.js} +0 -0
  321. /package/dist/assets/{terminal-CYHsl1AH.js → terminal-CTNk9Vx-.js} +0 -0
  322. /package/dist/assets/{terminal-BjOF3LBT.js → terminal-DMbjaLiG.js} +0 -0
  323. /package/dist/assets/{workspace-C-huZiu_.js → workspace-7FfNfyOX.js} +0 -0
  324. /package/dist/assets/{workspace-Bcvg2VfS.js → workspace-ALDzNPUC.js} +0 -0
  325. /package/dist/assets/{workspace-P8HaFDdu.js → workspace-DrLe-8Lj.js} +0 -0
  326. /package/dist/assets/{workspace-BscXtFFU.js → workspace-Dxoo5uUn.js} +0 -0
  327. /package/dist/assets/{xterm-Pyzkt_-B.js → xterm-6q1BGEu_.js} +0 -0
  328. /package/dist/assets/{xterm-addon-fit-HaY_WHvm.js → xterm-addon-fit-DARdNMYD.js} +0 -0
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/esm-BVAuvmyr.js","assets/react-B9IgSVeK.js","assets/rolldown-runtime-BM3Ffeng.js","assets/vendor-DLH51Vjf.js"])))=>i.map(i=>d[i]);
2
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$C as t,Ch as n,DC as r,Hf as i,Ir as a,OC as o,SS as s,Xa as ee,aS as c,dd as l,ey as u,fC as d,kC as te,sg as ne,zC as f,zy as p}from"./app-KRIEMzuO.js";import{E as m,O as h,Xn as re,nr as ie,x as g}from"./vendor-DLH51Vjf.js";import{b as _,t as v,v as y,x as b}from"./react-B9IgSVeK.js";import{Mn as x,Vn as ae,Yn as oe,_t as se,fr as ce,i as le,in as ue,nr as S,pa as C,ri as de}from"./icons-C0wyat6T.js";var w=e(b(),1),fe=e(_(),1),pe=`vellum:debug:`;function T(){let e={};if(typeof window>`u`)return e;try{for(let t=0;t<window.localStorage.length;t++){let n=window.localStorage.key(t);if(n===null||!n.startsWith(pe))continue;let r=window.localStorage.getItem(n);r!==null&&(e[n]=r)}}catch{}return e}function me(){return{collectedAt:new Date().toISOString(),resolved:{impersonateAssistantVersion:c()},overrides:T()}}var E=v(),he=`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,ge=`mx-4 flex w-full max-w-lg flex-col rounded-xl border p-6 shadow-xl`,_e={backgroundColor:`var(--surface-lift)`,borderColor:`var(--border-base)`,maxHeight:`calc(100vh - 2rem)`},D=[{value:`bug_report`,icon:C,includesLogsByDefault:!0},{value:`feature_request`,icon:S,includesLogsByDefault:!1},{value:`other`,icon:x,includesLogsByDefault:!1}],O=[{value:`past_hour`,cutoffMs:3600*1e3},{value:`past_24_hours`,cutoffMs:1440*60*1e3},{value:`all_time`,cutoffMs:null}],k=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`,`video/mp4`,`video/quicktime`,`video/webm`]),A=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`mp4`,`mov`,`webm`]),j=10,M=50*1024*1024,ve={bug_report:`bug_report`,feature_request:`feature_request`,other:`other`};function ye(){if(s())return`electron`;let e=g.getPlatform();return e===`ios`||e===`android`?e:`web`}function be(e){return typeof e==`object`&&!!e&&`client`in e}function xe(e){if(e.size>M)return!1;if(e.type&&k.has(e.type))return!0;if(!e.type){let t=e.name.split(`.`).pop()?.toLowerCase();return t?A.has(t):!1}return!1}var N=8192,P=/^data:([^;,]+);base64,/i,F=/^[A-Za-z0-9+/]+={0,2}$/;function I(e,t,n=new WeakSet){let r=t(e);if(r)return r.replacement;if(typeof e!=`object`||!e)return e;if(n.has(e))return`[cyclic]`;n.add(e);let i;if(Array.isArray(e))i=e.map(e=>I(e,t,n));else{let r={};for(let[i,a]of Object.entries(e))r[i]=I(a,t,n);i=r}return n.delete(e),i}function L(e){return I(e,e=>{if(typeof e!=`string`)return null;let t=P.exec(e);return t?{replacement:`[stripped data URI ${t[1]}, ${e.length} chars]`}:e.length>=N&&F.test(e)?{replacement:`[stripped base64, ${e.length} chars]`}:null})}function R(e,t){if(!Array.isArray(t))return e;let n=new Map;return t.forEach((e,t)=>{if(e&&typeof e==`object`){let r=e.id;n.set(e,typeof r==`string`?r:`index ${t}`)}}),I(e,e=>{if(typeof e!=`object`||!e)return null;let t=n.get(e);return t===void 0?null:{replacement:`[deduplicated: see clientMessages ${t}]`}})}function z(e,t){let n=Math.ceil(t.length/512),r=new Uint8Array(512+n*512),i=new TextEncoder,a=(e,t,n)=>{let a=i.encode(e);r.set(a.slice(0,n),t)},o=(e,t,n)=>{a(e.toString(8).padStart(n-1,`0`)+`\0`,t,n)};a(e,0,100),o(420,100,8),o(0,108,8),o(0,116,8),o(t.length,124,12),o(Math.floor(Date.now()/1e3),136,12);for(let e=148;e<156;e++)r[e]=32;r[156]=48,a(`ustar\0`,257,6),a(`00`,263,2);let s=0;for(let e=0;e<512;e++)s+=r[e];return o(s,148,7),r[155]=32,r.set(t,512),r}async function B(e,t){try{let n={};t.window.startTime!=null&&(n.startTime=t.window.startTime,n.endTime=t.window.endTime),t.activeConversationId&&(n.conversationId=t.activeConversationId);let{data:r,error:i}=await u({path:{assistant_id:e},body:n,parseAs:`blob`,throwOnError:!1});if(i||!(r instanceof Blob))return null;let a=await r.arrayBuffer();return new Uint8Array(a)}catch{return null}}async function V(){if(!g.isNativePlatform())return null;try{let{App:e}=await y(async()=>{let{App:e}=await import(`./esm-BVAuvmyr.js`);return{App:e}},__vite__mapDeps([0,1,2,3])),{id:t,name:n,version:r,build:i}=await e.getInfo();return{id:t,name:n,version:r,build:i}}catch{return null}}async function Se(e,t,n,r={}){if(typeof CompressionStream>`u`)return null;let{diagnosticsProvider:a,doctorSessionId:o,extraLogFiles:ee=[]}=r,c=new Date,l=O.find(t=>t.value===e),u=c.getTime(),d=l?.cutoffMs==null?null:u-l.cutoffMs,te=d==null?null:new Date(d).toISOString(),f=null;try{f=a?.()??null}catch{f=null}let p=ne(f),m={collected_at:c.toISOString(),time_range:e,cutoff:te,log_window:{start_time_ms:d,end_time_ms:u},assistant_id:t,active_conversation_id:n,doctor_session_id:o??null,client_version:null,native_app:await V(),user_agent:typeof navigator<`u`?navigator.userAgent:``,language:typeof navigator<`u`?navigator.language:``,platform:typeof navigator<`u`?navigator.platform:``,url:typeof window<`u`?window.location.href:``,viewport:typeof window<`u`?{width:window.innerWidth,height:window.innerHeight}:null,screen:typeof screen<`u`?{width:screen.width,height:screen.height}:null,connection:typeof navigator<`u`&&`connection`in navigator?{effectiveType:navigator.connection.effectiveType,downlink:navigator.connection.downlink,rtt:navigator.connection.rtt}:null,deviceMemory:typeof navigator<`u`&&`deviceMemory`in navigator?navigator.deviceMemory:null,hardwareConcurrency:typeof navigator<`u`?navigator.hardwareConcurrency:null},h=new TextEncoder,re=h.encode(JSON.stringify(m,null,2)),ie=h.encode(JSON.stringify(p,null,2)),g=[z(`web-client-context.json`,re),z(`web-chat-diagnostics.json`,ie)];if(r.queryClient)try{g.push(z(`web-asset-diagnostics.json`,h.encode(JSON.stringify(i(r.queryClient),null,2))))}catch{}let _=new TextEncoder().encode(JSON.stringify(me(),null,2));g.push(z(`web-debug-flags.json`,_));for(let e of ee){let t=e.contents.trim();t&&g.push(z(e.filename,h.encode(t)))}try{let e=typeof window<`u`?window._vellumDebug?.chat:null;if(e){let t=e.getClientMessages?.()??null,n={clientMessages:t,transcriptItems:R(e.getTranscriptItems?.()??null,t),pendingInteractions:e.listPendingInteractions?.()??null,thinkingIndicator:e.thinkingIndicator?.()??null,streamingRing:e.streamingRing?.()??null,reconciliationDiagnostics:e.getReconciliationDiagnostics?.()??null},r=new TextEncoder().encode(JSON.stringify(L(n),null,2));g.push(z(`web-chat-debug-api-triage.json`,r))}}catch{}try{let e=typeof window<`u`?window._vellumDebug?.events:null;if(e){let t={focus:typeof document<`u`?{hasFocus:typeof document.hasFocus==`function`?document.hasFocus():null,visibilityState:document.visibilityState}:null,clients:e.getClients().map(({abortSignal:e,...t})=>({...t,aborted:e.aborted})),events:e.getEvents()},n=new TextEncoder().encode(JSON.stringify(L(t),null,2));g.push(z(`web-sse-liveness-triage.json`,n))}}catch{}if(s()&&window.vellum?.feedback){try{let e=await window.vellum.feedback.diagnostics(),t=new TextEncoder().encode(JSON.stringify(e,null,2));g.push(z(`electron-diagnostics.json`,t))}catch{}try{let e=await window.vellum.feedback.logs();if(e){let t=new TextEncoder().encode(e);g.push(z(`electron-main-logs.txt`,t))}}catch{}}if(t){let e=await B(t,{window:{startTime:d,endTime:u},activeConversationId:n});e&&g.push(z(`platform-logs.tar.gz`,e))}g.push(new Uint8Array(1024));let v=g.reduce((e,t)=>e+t.length,0),y=new Uint8Array(v),b=0;for(let e of g)y.set(e,b),b+=e.length;let x=new Blob([y.buffer]),ae=await new Response(x.stream().pipeThrough(new CompressionStream(`gzip`))).blob();return new File([ae],`web-client-logs-${c.getTime()}.tar.gz`,{type:`application/gzip`})}function H({open:e,onClose:i,initialReason:c,initialMessage:u,onSubmitted:ne,assistantId:g,assistantVersion:_,activeConversationId:v,doctorSessionId:y,doctorSessionLog:b,getDiagnosticsSnapshot:x}){let{t:S}=m(),C=ie(),pe=n.use.user(),T=pe?.email,me=pe?.isStaff??!1,O=(0,w.useId)(),k=(0,w.useRef)(null),A=(0,w.useRef)(null),M=(0,w.useRef)(null),N=(0,w.useRef)(null),P=(0,w.useMemo)(()=>[{value:`past_hour`,label:S(`shareFeedbackModal.timeRangePastHour`)},{value:`past_24_hours`,label:S(`shareFeedbackModal.timeRangePast24Hours`)},{value:`all_time`,label:S(`shareFeedbackModal.timeRangeAllTime`)}],[S]),[F,I]=(0,w.useState)(c??`bug_report`),[L,R]=(0,w.useState)(``),[z,B]=(0,w.useState)(``),[V,H]=(0,w.useState)(D.find(e=>e.value===(c??`bug_report`))?.includesLogsByDefault??!0),[Te,Ee]=(0,w.useState)(!1),[U,W]=(0,w.useState)(`past_hour`),[G,K]=(0,w.useState)([]),[De,q]=(0,w.useState)(null),[Oe,J]=(0,w.useState)(!1),[Y,ke]=(0,w.useState)(!1),[X,Ae]=(0,w.useState)(!1),Z=re(l()),[je,Q]=(0,w.useState)(!1),$=Z.isPending||je,Me=!T,Ne=(0,w.useMemo)(()=>L.trim().length>0&&z.trim().length>0,[L,z]);(0,w.useEffect)(()=>{if(!e)return;let t=c??`bug_report`;I(t),R(u??``),B(T??``),H(D.find(e=>e.value===t)?.includesLogsByDefault??!0),Ee(!1),W(`past_hour`),K([]),ke(!1),Ae(!1),q(null),Q(!1),Z.reset();let n=setTimeout(()=>{T?M.current?.focus():N.current?.focus()},50);return()=>clearTimeout(n)},[e]),ee(e);let Pe=e=>{I(e),Te||H(D.find(t=>t.value===e)?.includesLogsByDefault??!1)},Fe=()=>{H(e=>!e),Ee(!0)},Ie=b?.trim()?[{filename:`doctor-session.txt`,contents:b}]:[],Le=(0,w.useCallback)(e=>{e.key===`Escape`&&!e.defaultPrevented&&!$&&(e.preventDefault(),i())},[i,$]),Re=(0,w.useCallback)(e=>{e.target===k.current&&!$&&i()},[i,$]),ze=(0,w.useCallback)(e=>{K(t=>{let n=j-t.length;if(n<=0)return t;let r=new Set(t.map(e=>`${e.name}:${e.size}`)),i=[];for(let t of e){if(i.length>=n)break;if(!xe(t))continue;let e=`${t.name}:${t.size}`;r.has(e)||(r.add(e),i.push(t))}return i.length>0?[...t,...i]:t})},[]),Be=e=>{e.target.files&&ze(Array.from(e.target.files)),e.target.value=``},Ve=e=>{e.preventDefault(),J(!1),e.dataTransfer.files?.length&&ze(Array.from(e.dataTransfer.files))},He=e=>{e.preventDefault(),J(!0)},Ue=e=>{e.preventDefault(),e.currentTarget===e.target&&J(!1)},We=e=>{K(t=>t.filter((t,n)=>n!==e))};return e?(0,fe.createPortal)((0,E.jsx)(`div`,{ref:k,role:`dialog`,"aria-modal":`true`,"aria-labelledby":O,className:he,onKeyDown:Le,onClick:Re,onDrop:Ve,onDragOver:He,onDragLeave:Ue,children:(0,E.jsxs)(`div`,{className:ge,style:_e,children:[(0,E.jsxs)(`div`,{className:`flex items-center justify-between border-b pb-4`,style:{borderColor:`var(--border-subtle)`},children:[(0,E.jsx)(`h2`,{id:O,className:`!m-0 text-title-small text-[var(--content-default)]`,children:S(`shareFeedbackModal.title`)}),(0,E.jsx)(t,{variant:`ghost`,iconOnly:(0,E.jsx)(le,{}),onClick:i,disabled:$,"aria-label":S(`shareFeedbackModal.closeAria`),tintColor:`var(--content-secondary)`})]}),(0,E.jsxs)(`div`,{className:`flex flex-col gap-3.5 overflow-y-auto pt-4 ${$?`pointer-events-none opacity-60`:``}`,children:[me&&(0,E.jsxs)(`div`,{className:`flex flex-col gap-1.5 rounded-lg border border-[var(--border-base)] bg-[var(--surface-base)] px-3 py-2.5`,children:[(0,E.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3`,children:[(0,E.jsx)(r,{checked:X,onChange:()=>Ae(e=>!e),"aria-label":S(`shareFeedbackModal.downloadDiagnosticsAria`)}),(0,E.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:S(`shareFeedbackModal.downloadDiagnostics`)})]}),(0,E.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:S(`shareFeedbackModal.adminOnlyHint`)})]}),X?(0,E.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,E.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:S(`shareFeedbackModal.timeRange`)}),(0,E.jsx)(d,{options:P,value:U,onChange:W,"aria-label":S(`shareFeedbackModal.timeRangeAria`)})]}):(0,E.jsxs)(E.Fragment,{children:[Me&&(0,E.jsx)(o,{id:`${O}-email`,ref:N,label:S(`shareFeedbackModal.email`),type:`email`,placeholder:`you@example.com`,value:z,onChange:e=>B(e.target.value),leftIcon:(0,E.jsx)(ae,{className:`h-4 w-4`,"aria-hidden":!0}),fullWidth:!0}),(0,E.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,E.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:S(`shareFeedbackModal.category`)}),(0,E.jsx)(`div`,{className:`flex gap-2`,children:D.map(e=>(0,E.jsx)(Ce,{option:e,isSelected:F===e.value,onSelect:()=>Pe(e.value)},e.value))})]}),(0,E.jsx)(`hr`,{className:`border-[var(--border-subtle)]`}),F===`bug_report`&&(0,E.jsx)(f,{tone:`info`,children:(0,E.jsx)(h,{ns:`common`,i18nKey:`shareFeedbackModal.bugTip`,components:{discordLink:(0,E.jsx)(p,{href:`https://vellum.ai/community`,tone:`quiet`,className:`text-[var(--content-default)]`,glyph:!1})}})}),F===`feature_request`&&(0,E.jsx)(f,{tone:`info`,children:(0,E.jsx)(h,{ns:`common`,i18nKey:`shareFeedbackModal.featureTip`,components:{roadmapLink:(0,E.jsx)(p,{href:`https://vellum.ai/roadmap`,tone:`quiet`,className:`text-[var(--content-default)]`,glyph:!1})}})}),(0,E.jsx)(te,{id:`${O}-message`,ref:M,label:S(F===`bug_report`?`shareFeedbackModal.messageLabelBug`:F===`feature_request`?`shareFeedbackModal.messageLabelFeature`:`shareFeedbackModal.messageLabelOther`),rows:3,placeholder:S(F===`bug_report`?`shareFeedbackModal.messagePlaceholderBug`:F===`feature_request`?`shareFeedbackModal.messagePlaceholderFeature`:`shareFeedbackModal.messagePlaceholderOther`),value:L,onChange:e=>R(e.target.value),fullWidth:!0}),F!==`feature_request`&&(0,E.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,E.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,E.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2.5`,children:[(0,E.jsx)(r,{checked:V,onChange:Fe,"aria-label":S(`shareFeedbackModal.includeDiagnosticsAria`)}),(0,E.jsx)(`span`,{className:`text-body-medium-lighter leading-6 text-[var(--content-default)]`,children:S(`shareFeedbackModal.includeDiagnostics`)})]}),(0,E.jsx)(t,{variant:`ghost`,size:`compact`,iconOnly:(0,E.jsx)(ce,{}),expandOnMobile:!1,"aria-label":S(`shareFeedbackModal.aboutDiagnosticsAria`),tooltip:S(`shareFeedbackModal.diagnosticsTooltip`)})]}),V&&(0,E.jsx)(d,{options:P,value:U,onChange:W,"aria-label":S(`shareFeedbackModal.timeRangeAria`)})]}),s()&&v&&F!==`feature_request`&&(0,E.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2.5`,children:[(0,E.jsx)(r,{checked:Y,onChange:()=>ke(e=>!e),"aria-label":S(`shareFeedbackModal.includeConversationAria`)}),(0,E.jsx)(`span`,{className:`text-body-medium-lighter leading-6 text-[var(--content-default)]`,children:S(`shareFeedbackModal.includeConversation`)})]}),(0,E.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,E.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,E.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:[S(`shareFeedbackModal.attachments`),G.length>0&&(0,E.jsxs)(`span`,{className:`text-[var(--content-tertiary)]`,children:[` · `,G.length,`/`,j]})]}),(0,E.jsx)(t,{variant:`outlined`,size:`compact`,leftIcon:(0,E.jsx)(ue,{}),onClick:()=>A.current?.click(),disabled:G.length>=j,children:S(`shareFeedbackModal.addFiles`)}),(0,E.jsx)(`input`,{ref:A,type:`file`,multiple:!0,accept:`image/png,image/jpeg,image/gif,image/webp,video/mp4,video/quicktime,video/webm`,onChange:Be,className:`hidden`})]}),G.length>0&&(0,E.jsx)(`div`,{className:`flex gap-2 overflow-x-auto`,children:G.map((e,t)=>(0,E.jsx)(we,{file:e,onRemove:()=>We(t)},`${e.name}-${t}`))}),Oe&&(0,E.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:S(`shareFeedbackModal.dropFiles`)})]})]}),De&&(0,E.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--system-negative-strong)]`,children:De})]}),(0,E.jsx)(`div`,{className:`mt-4 flex items-center justify-end gap-2 border-t pt-4`,style:{borderColor:`var(--border-subtle)`},children:$?(0,E.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-body-medium-lighter text-[var(--content-secondary)]`,children:[(0,E.jsx)(oe,{className:`h-4 w-4 animate-spin`}),S(X?`shareFeedbackModal.preparingDiagnostics`:`shareFeedbackModal.sendingFeedback`)]}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(t,{variant:`ghost`,onClick:i,children:S(`shareFeedbackModal.cancel`)}),X?(0,E.jsx)(t,{variant:`primary`,leftIcon:(0,E.jsx)(de,{}),onClick:async()=>{if(!$){q(null),Q(!0);try{let e=await Se(U,g??null,s()?Y?v??null:null:v??null,{diagnosticsProvider:x,queryClient:C,doctorSessionId:y,extraLogFiles:Ie});if(!e){q(`Diagnostics export isn't supported in this browser.`);return}await a(e,e.name),i()}catch(e){q(e instanceof Error?e.message:`Failed to build diagnostics. Please try again.`)}finally{Q(!1)}}},children:S(`shareFeedbackModal.downloadDiagnosticsButton`)}):(0,E.jsx)(t,{variant:`primary`,leftIcon:(0,E.jsx)(se,{}),onClick:async()=>{if(!(!Ne||$)){q(null),Q(!0);try{let e=V&&F!==`feature_request`?await Se(U,g??null,s()?Y?v??null:null:v??null,{diagnosticsProvider:x,queryClient:C,doctorSessionId:y,extraLogFiles:Ie}):null,t=ye(),n;if(t===`electron`)try{n=(await window.vellum?.app.versionInfo())?.version??n}catch{}let r=t=>Z.mutateAsync({headers:{"Content-Type":null},body:{message:L.trim(),classification:ve[F],email:z.trim(),client:t,client_version:n,...g?{assistant_id:g}:{},..._?{assistant_version:_}:{},...y?{doctor_session_id:y}:{},...e?{logs_file:e}:{},...G.length?{attachments:G}:{}},bodySerializer:e=>{let t=new FormData;for(let[n,r]of Object.entries(e))if(r!=null){if(n===`attachments`&&Array.isArray(r)){for(let e of r)t.append(`attachments`,e);continue}r instanceof Blob?t.append(n,r):t.append(n,String(r))}return t}});try{await r(t)}catch(e){if(t!==`android`||!be(e))throw e;await r(`web`)}ne?.(),i()}catch(e){q(e instanceof Error?e.message:`Failed to submit feedback. Please try again.`)}finally{Q(!1)}}},disabled:!Ne,children:S(`shareFeedbackModal.submit`)})]})})]})}),document.body):null}function Ce({option:e,isSelected:t,onSelect:n}){let{t:r}=m(),i=e.icon,a=e.value===`bug_report`?r(`shareFeedbackModal.reasonBugReport`):e.value===`feature_request`?r(`shareFeedbackModal.reasonFeatureRequest`):r(`shareFeedbackModal.reasonOther`);return(0,E.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,className:`flex items-center gap-1.5 rounded-full border px-3 py-1.5 text-left transition-colors`,style:{borderColor:t?`var(--primary-base)`:`var(--border-base)`,backgroundColor:t?`color-mix(in oklab, var(--primary-base) 10%, transparent)`:`transparent`},children:[(0,E.jsx)(i,{className:`h-3.5 w-3.5 shrink-0`,style:{color:t?`var(--primary-base)`:`var(--content-secondary)`}}),(0,E.jsx)(`span`,{className:`text-body-small-default`,style:{color:t?`var(--primary-base)`:`var(--content-default)`},children:a})]})}function we({file:e,onRemove:n}){let{t:r}=m(),i=e.type.startsWith(`image/`),a=(0,w.useMemo)(()=>i?URL.createObjectURL(e):null,[e,i]);return(0,w.useEffect)(()=>{if(a)return()=>URL.revokeObjectURL(a)},[a]),(0,E.jsxs)(`div`,{className:`relative flex h-16 w-16 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-[var(--border-base)] bg-[var(--surface-base)]`,title:e.name,children:[i&&a?(0,E.jsx)(`img`,{src:a,alt:e.name,className:`h-full w-full object-cover`}):(0,E.jsx)(ue,{className:`h-5 w-5 text-[var(--content-secondary)]`}),(0,E.jsx)(t,{shape:`pill`,variant:`ghost`,size:`compact`,iconOnly:(0,E.jsx)(le,{}),onClick:n,"aria-label":r(`shareFeedbackModal.removeAttachmentAria`,{name:e.name}),className:`absolute top-0.5 right-0.5 h-4 w-4 bg-black/60 text-white hover:bg-black/70`,tintColor:`#fff`})]})}export{R as n,L as r,H as t};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/esm-CUO0AHtA.js","assets/react-B9IgSVeK.js","assets/rolldown-runtime-BM3Ffeng.js","assets/vendor-cVd2QlFV.js"])))=>i.map(i=>d[i]);
2
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$C as t,Ch as n,DC as r,Hf as i,Ir as a,OC as o,SS as s,Xa as ee,aS as c,dd as l,ey as u,fC as d,kC as te,sg as ne,zC as f,zy as p}from"./app-BEoekemj.js";import{E as m,O as h,Xn as re,nr as ie,x as g}from"./vendor-cVd2QlFV.js";import{b as _,t as v,v as y,x as b}from"./react-B9IgSVeK.js";import{Mn as x,Vn as ae,Yn as oe,_t as se,fr as ce,i as le,in as ue,nr as S,pa as C,ri as de}from"./icons-C0wyat6T.js";var w=e(b(),1),fe=e(_(),1),pe=`vellum:debug:`;function T(){let e={};if(typeof window>`u`)return e;try{for(let t=0;t<window.localStorage.length;t++){let n=window.localStorage.key(t);if(n===null||!n.startsWith(pe))continue;let r=window.localStorage.getItem(n);r!==null&&(e[n]=r)}}catch{}return e}function me(){return{collectedAt:new Date().toISOString(),resolved:{impersonateAssistantVersion:c()},overrides:T()}}var E=v(),he=`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,ge=`mx-4 flex w-full max-w-lg flex-col rounded-xl border p-6 shadow-xl`,_e={backgroundColor:`var(--surface-lift)`,borderColor:`var(--border-base)`,maxHeight:`calc(100vh - 2rem)`},D=[{value:`bug_report`,icon:C,includesLogsByDefault:!0},{value:`feature_request`,icon:S,includesLogsByDefault:!1},{value:`other`,icon:x,includesLogsByDefault:!1}],O=[{value:`past_hour`,cutoffMs:3600*1e3},{value:`past_24_hours`,cutoffMs:1440*60*1e3},{value:`all_time`,cutoffMs:null}],k=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`,`video/mp4`,`video/quicktime`,`video/webm`]),A=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`mp4`,`mov`,`webm`]),j=10,M=50*1024*1024,ve={bug_report:`bug_report`,feature_request:`feature_request`,other:`other`};function ye(){if(s())return`electron`;let e=g.getPlatform();return e===`ios`||e===`android`?e:`web`}function be(e){return typeof e==`object`&&!!e&&`client`in e}function xe(e){if(e.size>M)return!1;if(e.type&&k.has(e.type))return!0;if(!e.type){let t=e.name.split(`.`).pop()?.toLowerCase();return t?A.has(t):!1}return!1}var N=8192,P=/^data:([^;,]+);base64,/i,F=/^[A-Za-z0-9+/]+={0,2}$/;function I(e,t,n=new WeakSet){let r=t(e);if(r)return r.replacement;if(typeof e!=`object`||!e)return e;if(n.has(e))return`[cyclic]`;n.add(e);let i;if(Array.isArray(e))i=e.map(e=>I(e,t,n));else{let r={};for(let[i,a]of Object.entries(e))r[i]=I(a,t,n);i=r}return n.delete(e),i}function L(e){return I(e,e=>{if(typeof e!=`string`)return null;let t=P.exec(e);return t?{replacement:`[stripped data URI ${t[1]}, ${e.length} chars]`}:e.length>=N&&F.test(e)?{replacement:`[stripped base64, ${e.length} chars]`}:null})}function R(e,t){if(!Array.isArray(t))return e;let n=new Map;return t.forEach((e,t)=>{if(e&&typeof e==`object`){let r=e.id;n.set(e,typeof r==`string`?r:`index ${t}`)}}),I(e,e=>{if(typeof e!=`object`||!e)return null;let t=n.get(e);return t===void 0?null:{replacement:`[deduplicated: see clientMessages ${t}]`}})}function z(e,t){let n=Math.ceil(t.length/512),r=new Uint8Array(512+n*512),i=new TextEncoder,a=(e,t,n)=>{let a=i.encode(e);r.set(a.slice(0,n),t)},o=(e,t,n)=>{a(e.toString(8).padStart(n-1,`0`)+`\0`,t,n)};a(e,0,100),o(420,100,8),o(0,108,8),o(0,116,8),o(t.length,124,12),o(Math.floor(Date.now()/1e3),136,12);for(let e=148;e<156;e++)r[e]=32;r[156]=48,a(`ustar\0`,257,6),a(`00`,263,2);let s=0;for(let e=0;e<512;e++)s+=r[e];return o(s,148,7),r[155]=32,r.set(t,512),r}async function B(e,t){try{let n={};t.window.startTime!=null&&(n.startTime=t.window.startTime,n.endTime=t.window.endTime),t.activeConversationId&&(n.conversationId=t.activeConversationId);let{data:r,error:i}=await u({path:{assistant_id:e},body:n,parseAs:`blob`,throwOnError:!1});if(i||!(r instanceof Blob))return null;let a=await r.arrayBuffer();return new Uint8Array(a)}catch{return null}}async function V(){if(!g.isNativePlatform())return null;try{let{App:e}=await y(async()=>{let{App:e}=await import(`./esm-CUO0AHtA.js`);return{App:e}},__vite__mapDeps([0,1,2,3])),{id:t,name:n,version:r,build:i}=await e.getInfo();return{id:t,name:n,version:r,build:i}}catch{return null}}async function Se(e,t,n,r={}){if(typeof CompressionStream>`u`)return null;let{diagnosticsProvider:a,doctorSessionId:o,extraLogFiles:ee=[]}=r,c=new Date,l=O.find(t=>t.value===e),u=c.getTime(),d=l?.cutoffMs==null?null:u-l.cutoffMs,te=d==null?null:new Date(d).toISOString(),f=null;try{f=a?.()??null}catch{f=null}let p=ne(f),m={collected_at:c.toISOString(),time_range:e,cutoff:te,log_window:{start_time_ms:d,end_time_ms:u},assistant_id:t,active_conversation_id:n,doctor_session_id:o??null,client_version:null,native_app:await V(),user_agent:typeof navigator<`u`?navigator.userAgent:``,language:typeof navigator<`u`?navigator.language:``,platform:typeof navigator<`u`?navigator.platform:``,url:typeof window<`u`?window.location.href:``,viewport:typeof window<`u`?{width:window.innerWidth,height:window.innerHeight}:null,screen:typeof screen<`u`?{width:screen.width,height:screen.height}:null,connection:typeof navigator<`u`&&`connection`in navigator?{effectiveType:navigator.connection.effectiveType,downlink:navigator.connection.downlink,rtt:navigator.connection.rtt}:null,deviceMemory:typeof navigator<`u`&&`deviceMemory`in navigator?navigator.deviceMemory:null,hardwareConcurrency:typeof navigator<`u`?navigator.hardwareConcurrency:null},h=new TextEncoder,re=h.encode(JSON.stringify(m,null,2)),ie=h.encode(JSON.stringify(p,null,2)),g=[z(`web-client-context.json`,re),z(`web-chat-diagnostics.json`,ie)];if(r.queryClient)try{g.push(z(`web-asset-diagnostics.json`,h.encode(JSON.stringify(i(r.queryClient),null,2))))}catch{}let _=new TextEncoder().encode(JSON.stringify(me(),null,2));g.push(z(`web-debug-flags.json`,_));for(let e of ee){let t=e.contents.trim();t&&g.push(z(e.filename,h.encode(t)))}try{let e=typeof window<`u`?window._vellumDebug?.chat:null;if(e){let t=e.getClientMessages?.()??null,n={clientMessages:t,transcriptItems:R(e.getTranscriptItems?.()??null,t),pendingInteractions:e.listPendingInteractions?.()??null,thinkingIndicator:e.thinkingIndicator?.()??null,streamingRing:e.streamingRing?.()??null,reconciliationDiagnostics:e.getReconciliationDiagnostics?.()??null},r=new TextEncoder().encode(JSON.stringify(L(n),null,2));g.push(z(`web-chat-debug-api-triage.json`,r))}}catch{}try{let e=typeof window<`u`?window._vellumDebug?.events:null;if(e){let t={focus:typeof document<`u`?{hasFocus:typeof document.hasFocus==`function`?document.hasFocus():null,visibilityState:document.visibilityState}:null,clients:e.getClients().map(({abortSignal:e,...t})=>({...t,aborted:e.aborted})),events:e.getEvents()},n=new TextEncoder().encode(JSON.stringify(L(t),null,2));g.push(z(`web-sse-liveness-triage.json`,n))}}catch{}if(s()&&window.vellum?.feedback){try{let e=await window.vellum.feedback.diagnostics(),t=new TextEncoder().encode(JSON.stringify(e,null,2));g.push(z(`electron-diagnostics.json`,t))}catch{}try{let e=await window.vellum.feedback.logs();if(e){let t=new TextEncoder().encode(e);g.push(z(`electron-main-logs.txt`,t))}}catch{}}if(t){let e=await B(t,{window:{startTime:d,endTime:u},activeConversationId:n});e&&g.push(z(`platform-logs.tar.gz`,e))}g.push(new Uint8Array(1024));let v=g.reduce((e,t)=>e+t.length,0),y=new Uint8Array(v),b=0;for(let e of g)y.set(e,b),b+=e.length;let x=new Blob([y.buffer]),ae=await new Response(x.stream().pipeThrough(new CompressionStream(`gzip`))).blob();return new File([ae],`web-client-logs-${c.getTime()}.tar.gz`,{type:`application/gzip`})}function H({open:e,onClose:i,initialReason:c,initialMessage:u,onSubmitted:ne,assistantId:g,assistantVersion:_,activeConversationId:v,doctorSessionId:y,doctorSessionLog:b,getDiagnosticsSnapshot:x}){let{t:S}=m(),C=ie(),pe=n.use.user(),T=pe?.email,me=pe?.isStaff??!1,O=(0,w.useId)(),k=(0,w.useRef)(null),A=(0,w.useRef)(null),M=(0,w.useRef)(null),N=(0,w.useRef)(null),P=(0,w.useMemo)(()=>[{value:`past_hour`,label:S(`shareFeedbackModal.timeRangePastHour`)},{value:`past_24_hours`,label:S(`shareFeedbackModal.timeRangePast24Hours`)},{value:`all_time`,label:S(`shareFeedbackModal.timeRangeAllTime`)}],[S]),[F,I]=(0,w.useState)(c??`bug_report`),[L,R]=(0,w.useState)(``),[z,B]=(0,w.useState)(``),[V,H]=(0,w.useState)(D.find(e=>e.value===(c??`bug_report`))?.includesLogsByDefault??!0),[Te,Ee]=(0,w.useState)(!1),[U,W]=(0,w.useState)(`past_hour`),[G,K]=(0,w.useState)([]),[De,q]=(0,w.useState)(null),[Oe,J]=(0,w.useState)(!1),[Y,ke]=(0,w.useState)(!1),[X,Ae]=(0,w.useState)(!1),Z=re(l()),[je,Q]=(0,w.useState)(!1),$=Z.isPending||je,Me=!T,Ne=(0,w.useMemo)(()=>L.trim().length>0&&z.trim().length>0,[L,z]);(0,w.useEffect)(()=>{if(!e)return;let t=c??`bug_report`;I(t),R(u??``),B(T??``),H(D.find(e=>e.value===t)?.includesLogsByDefault??!0),Ee(!1),W(`past_hour`),K([]),ke(!1),Ae(!1),q(null),Q(!1),Z.reset();let n=setTimeout(()=>{T?M.current?.focus():N.current?.focus()},50);return()=>clearTimeout(n)},[e]),ee(e);let Pe=e=>{I(e),Te||H(D.find(t=>t.value===e)?.includesLogsByDefault??!1)},Fe=()=>{H(e=>!e),Ee(!0)},Ie=b?.trim()?[{filename:`doctor-session.txt`,contents:b}]:[],Le=(0,w.useCallback)(e=>{e.key===`Escape`&&!e.defaultPrevented&&!$&&(e.preventDefault(),i())},[i,$]),Re=(0,w.useCallback)(e=>{e.target===k.current&&!$&&i()},[i,$]),ze=(0,w.useCallback)(e=>{K(t=>{let n=j-t.length;if(n<=0)return t;let r=new Set(t.map(e=>`${e.name}:${e.size}`)),i=[];for(let t of e){if(i.length>=n)break;if(!xe(t))continue;let e=`${t.name}:${t.size}`;r.has(e)||(r.add(e),i.push(t))}return i.length>0?[...t,...i]:t})},[]),Be=e=>{e.target.files&&ze(Array.from(e.target.files)),e.target.value=``},Ve=e=>{e.preventDefault(),J(!1),e.dataTransfer.files?.length&&ze(Array.from(e.dataTransfer.files))},He=e=>{e.preventDefault(),J(!0)},Ue=e=>{e.preventDefault(),e.currentTarget===e.target&&J(!1)},We=e=>{K(t=>t.filter((t,n)=>n!==e))};return e?(0,fe.createPortal)((0,E.jsx)(`div`,{ref:k,role:`dialog`,"aria-modal":`true`,"aria-labelledby":O,className:he,onKeyDown:Le,onClick:Re,onDrop:Ve,onDragOver:He,onDragLeave:Ue,children:(0,E.jsxs)(`div`,{className:ge,style:_e,children:[(0,E.jsxs)(`div`,{className:`flex items-center justify-between border-b pb-4`,style:{borderColor:`var(--border-subtle)`},children:[(0,E.jsx)(`h2`,{id:O,className:`!m-0 text-title-small text-[var(--content-default)]`,children:S(`shareFeedbackModal.title`)}),(0,E.jsx)(t,{variant:`ghost`,iconOnly:(0,E.jsx)(le,{}),onClick:i,disabled:$,"aria-label":S(`shareFeedbackModal.closeAria`),tintColor:`var(--content-secondary)`})]}),(0,E.jsxs)(`div`,{className:`flex flex-col gap-3.5 overflow-y-auto pt-4 ${$?`pointer-events-none opacity-60`:``}`,children:[me&&(0,E.jsxs)(`div`,{className:`flex flex-col gap-1.5 rounded-lg border border-[var(--border-base)] bg-[var(--surface-base)] px-3 py-2.5`,children:[(0,E.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3`,children:[(0,E.jsx)(r,{checked:X,onChange:()=>Ae(e=>!e),"aria-label":S(`shareFeedbackModal.downloadDiagnosticsAria`)}),(0,E.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:S(`shareFeedbackModal.downloadDiagnostics`)})]}),(0,E.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:S(`shareFeedbackModal.adminOnlyHint`)})]}),X?(0,E.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,E.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:S(`shareFeedbackModal.timeRange`)}),(0,E.jsx)(d,{options:P,value:U,onChange:W,"aria-label":S(`shareFeedbackModal.timeRangeAria`)})]}):(0,E.jsxs)(E.Fragment,{children:[Me&&(0,E.jsx)(o,{id:`${O}-email`,ref:N,label:S(`shareFeedbackModal.email`),type:`email`,placeholder:`you@example.com`,value:z,onChange:e=>B(e.target.value),leftIcon:(0,E.jsx)(ae,{className:`h-4 w-4`,"aria-hidden":!0}),fullWidth:!0}),(0,E.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,E.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:S(`shareFeedbackModal.category`)}),(0,E.jsx)(`div`,{className:`flex gap-2`,children:D.map(e=>(0,E.jsx)(Ce,{option:e,isSelected:F===e.value,onSelect:()=>Pe(e.value)},e.value))})]}),(0,E.jsx)(`hr`,{className:`border-[var(--border-subtle)]`}),F===`bug_report`&&(0,E.jsx)(f,{tone:`info`,children:(0,E.jsx)(h,{ns:`common`,i18nKey:`shareFeedbackModal.bugTip`,components:{discordLink:(0,E.jsx)(p,{href:`https://vellum.ai/community`,tone:`quiet`,className:`text-[var(--content-default)]`,glyph:!1})}})}),F===`feature_request`&&(0,E.jsx)(f,{tone:`info`,children:(0,E.jsx)(h,{ns:`common`,i18nKey:`shareFeedbackModal.featureTip`,components:{roadmapLink:(0,E.jsx)(p,{href:`https://vellum.ai/roadmap`,tone:`quiet`,className:`text-[var(--content-default)]`,glyph:!1})}})}),(0,E.jsx)(te,{id:`${O}-message`,ref:M,label:S(F===`bug_report`?`shareFeedbackModal.messageLabelBug`:F===`feature_request`?`shareFeedbackModal.messageLabelFeature`:`shareFeedbackModal.messageLabelOther`),rows:3,placeholder:S(F===`bug_report`?`shareFeedbackModal.messagePlaceholderBug`:F===`feature_request`?`shareFeedbackModal.messagePlaceholderFeature`:`shareFeedbackModal.messagePlaceholderOther`),value:L,onChange:e=>R(e.target.value),fullWidth:!0}),F!==`feature_request`&&(0,E.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,E.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,E.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2.5`,children:[(0,E.jsx)(r,{checked:V,onChange:Fe,"aria-label":S(`shareFeedbackModal.includeDiagnosticsAria`)}),(0,E.jsx)(`span`,{className:`text-body-medium-lighter leading-6 text-[var(--content-default)]`,children:S(`shareFeedbackModal.includeDiagnostics`)})]}),(0,E.jsx)(t,{variant:`ghost`,size:`compact`,iconOnly:(0,E.jsx)(ce,{}),expandOnMobile:!1,"aria-label":S(`shareFeedbackModal.aboutDiagnosticsAria`),tooltip:S(`shareFeedbackModal.diagnosticsTooltip`)})]}),V&&(0,E.jsx)(d,{options:P,value:U,onChange:W,"aria-label":S(`shareFeedbackModal.timeRangeAria`)})]}),s()&&v&&F!==`feature_request`&&(0,E.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2.5`,children:[(0,E.jsx)(r,{checked:Y,onChange:()=>ke(e=>!e),"aria-label":S(`shareFeedbackModal.includeConversationAria`)}),(0,E.jsx)(`span`,{className:`text-body-medium-lighter leading-6 text-[var(--content-default)]`,children:S(`shareFeedbackModal.includeConversation`)})]}),(0,E.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,E.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,E.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:[S(`shareFeedbackModal.attachments`),G.length>0&&(0,E.jsxs)(`span`,{className:`text-[var(--content-tertiary)]`,children:[` · `,G.length,`/`,j]})]}),(0,E.jsx)(t,{variant:`outlined`,size:`compact`,leftIcon:(0,E.jsx)(ue,{}),onClick:()=>A.current?.click(),disabled:G.length>=j,children:S(`shareFeedbackModal.addFiles`)}),(0,E.jsx)(`input`,{ref:A,type:`file`,multiple:!0,accept:`image/png,image/jpeg,image/gif,image/webp,video/mp4,video/quicktime,video/webm`,onChange:Be,className:`hidden`})]}),G.length>0&&(0,E.jsx)(`div`,{className:`flex gap-2 overflow-x-auto`,children:G.map((e,t)=>(0,E.jsx)(we,{file:e,onRemove:()=>We(t)},`${e.name}-${t}`))}),Oe&&(0,E.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:S(`shareFeedbackModal.dropFiles`)})]})]}),De&&(0,E.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--system-negative-strong)]`,children:De})]}),(0,E.jsx)(`div`,{className:`mt-4 flex items-center justify-end gap-2 border-t pt-4`,style:{borderColor:`var(--border-subtle)`},children:$?(0,E.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-body-medium-lighter text-[var(--content-secondary)]`,children:[(0,E.jsx)(oe,{className:`h-4 w-4 animate-spin`}),S(X?`shareFeedbackModal.preparingDiagnostics`:`shareFeedbackModal.sendingFeedback`)]}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(t,{variant:`ghost`,onClick:i,children:S(`shareFeedbackModal.cancel`)}),X?(0,E.jsx)(t,{variant:`primary`,leftIcon:(0,E.jsx)(de,{}),onClick:async()=>{if(!$){q(null),Q(!0);try{let e=await Se(U,g??null,s()?Y?v??null:null:v??null,{diagnosticsProvider:x,queryClient:C,doctorSessionId:y,extraLogFiles:Ie});if(!e){q(`Diagnostics export isn't supported in this browser.`);return}await a(e,e.name),i()}catch(e){q(e instanceof Error?e.message:`Failed to build diagnostics. Please try again.`)}finally{Q(!1)}}},children:S(`shareFeedbackModal.downloadDiagnosticsButton`)}):(0,E.jsx)(t,{variant:`primary`,leftIcon:(0,E.jsx)(se,{}),onClick:async()=>{if(!(!Ne||$)){q(null),Q(!0);try{let e=V&&F!==`feature_request`?await Se(U,g??null,s()?Y?v??null:null:v??null,{diagnosticsProvider:x,queryClient:C,doctorSessionId:y,extraLogFiles:Ie}):null,t=ye(),n;if(t===`electron`)try{n=(await window.vellum?.app.versionInfo())?.version??n}catch{}let r=t=>Z.mutateAsync({headers:{"Content-Type":null},body:{message:L.trim(),classification:ve[F],email:z.trim(),client:t,client_version:n,...g?{assistant_id:g}:{},..._?{assistant_version:_}:{},...y?{doctor_session_id:y}:{},...e?{logs_file:e}:{},...G.length?{attachments:G}:{}},bodySerializer:e=>{let t=new FormData;for(let[n,r]of Object.entries(e))if(r!=null){if(n===`attachments`&&Array.isArray(r)){for(let e of r)t.append(`attachments`,e);continue}r instanceof Blob?t.append(n,r):t.append(n,String(r))}return t}});try{await r(t)}catch(e){if(t!==`android`||!be(e))throw e;await r(`web`)}ne?.(),i()}catch(e){q(e instanceof Error?e.message:`Failed to submit feedback. Please try again.`)}finally{Q(!1)}}},disabled:!Ne,children:S(`shareFeedbackModal.submit`)})]})})]})}),document.body):null}function Ce({option:e,isSelected:t,onSelect:n}){let{t:r}=m(),i=e.icon,a=e.value===`bug_report`?r(`shareFeedbackModal.reasonBugReport`):e.value===`feature_request`?r(`shareFeedbackModal.reasonFeatureRequest`):r(`shareFeedbackModal.reasonOther`);return(0,E.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,className:`flex items-center gap-1.5 rounded-full border px-3 py-1.5 text-left transition-colors`,style:{borderColor:t?`var(--primary-base)`:`var(--border-base)`,backgroundColor:t?`color-mix(in oklab, var(--primary-base) 10%, transparent)`:`transparent`},children:[(0,E.jsx)(i,{className:`h-3.5 w-3.5 shrink-0`,style:{color:t?`var(--primary-base)`:`var(--content-secondary)`}}),(0,E.jsx)(`span`,{className:`text-body-small-default`,style:{color:t?`var(--primary-base)`:`var(--content-default)`},children:a})]})}function we({file:e,onRemove:n}){let{t:r}=m(),i=e.type.startsWith(`image/`),a=(0,w.useMemo)(()=>i?URL.createObjectURL(e):null,[e,i]);return(0,w.useEffect)(()=>{if(a)return()=>URL.revokeObjectURL(a)},[a]),(0,E.jsxs)(`div`,{className:`relative flex h-16 w-16 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-[var(--border-base)] bg-[var(--surface-base)]`,title:e.name,children:[i&&a?(0,E.jsx)(`img`,{src:a,alt:e.name,className:`h-full w-full object-cover`}):(0,E.jsx)(ue,{className:`h-5 w-5 text-[var(--content-secondary)]`}),(0,E.jsx)(t,{shape:`pill`,variant:`ghost`,size:`compact`,iconOnly:(0,E.jsx)(le,{}),onClick:n,"aria-label":r(`shareFeedbackModal.removeAttachmentAria`,{name:e.name}),className:`absolute top-0.5 right-0.5 h-4 w-4 bg-black/60 text-white hover:bg-black/70`,tintColor:`#fff`})]})}export{R as n,L as r,H as t};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$C as t,Dg as n,HC as r,Ia as i,Jo as a,SS as o,nu as s,oC as c,xS as l}from"./app-KRIEMzuO.js";import{E as u}from"./vendor-DLH51Vjf.js";import{d,f,n as p,t as m,x as h}from"./react-B9IgSVeK.js";import{Gi as g,za as _}from"./icons-C0wyat6T.js";import{t as v}from"./use-edge-swipe-back-B2Kt4500.js";import{t as y}from"./link-click-CR9uUEsb.js";var b=e(h(),1),x=`data-page-transition`,S=400,C;function w(){return typeof document<`u`&&typeof document.startViewTransition==`function`}function T(){return n()&&w()}function E(e,t,n,r){if(!T()){e(t,r);return}document.documentElement.setAttribute(x,n),C!==void 0&&clearTimeout(C),C=setTimeout(()=>{C=void 0,document.documentElement.removeAttribute(x)},S),e(t,{...r,viewTransition:!0})}var D=m();function O({sidebar:e,children:n,actions:c,backHref:m,title:h=`Settings`,menuRoute:g=l.settings.root,menuReplacesContentOnMobile:y=!1}){let{t:x}=u(),{pathname:S}=d(),C=f(),w=S===g,T=s(),O=T&&w,k=!(O&&y),A=(0,b.useRef)(null),j=(0,b.useRef)(null);(0,b.useLayoutEffect)(()=>{j.current?.scrollTo(0,0)},[S]);let M=w?m:g;v({containerRef:A,onBack:(0,b.useCallback)(()=>{C(M)},[C,M]),enabled:T,navKey:S,prefetchHref:M});let N=o(),P=x(w?`sidebarShell.backFrom`:`sidebarShell.backToMenu`,{title:h}),F=(0,D.jsx)(t,{variant:`ghost`,iconOnly:(0,D.jsx)(_,{}),"aria-label":P,tintColor:`var(--content-secondary)`,onClick:()=>E(C,M,`pop`)}),I=(0,D.jsx)(t,{asChild:!0,variant:`outlined`,"aria-label":x(`sidebarShell.backFrom`,{title:h}),className:`h-8 w-8 px-0`,tintColor:`var(--content-secondary)`,children:(0,D.jsx)(p,{to:m,className:`flex items-center justify-center no-underline`,children:(0,D.jsx)(_,{size:16,"aria-hidden":`true`})})});return(0,D.jsxs)(`div`,{ref:A,className:`flex h-full min-h-0 w-full flex-1 flex-col gap-4 p-4 sm:p-6 md:gap-0`,style:{paddingTop:N?`3.75rem`:`1rem`},children:[(0,D.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3 md:hidden`,children:[F,(0,D.jsx)(r,{as:`h1`,variant:`body-large-default`,className:`flex-1 truncate text-center`,style:{color:`var(--content-tertiary)`,lineHeight:1.4},children:h}),(0,D.jsx)(`div`,{className:`h-10 w-10 shrink-0`,"aria-hidden":`true`})]}),N?(0,D.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-2 pb-4 empty:hidden`,children:[(0,D.jsx)(a,{placement:`electron`,className:`px-0 pt-0`}),(0,D.jsx)(i,{placement:`electron`,className:`px-0 pt-0`})]}):null,(0,D.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden md:rounded-[12px] md:border md:border-[var(--border-base)] md:bg-[var(--surface-overlay)]`,children:[(0,D.jsxs)(`div`,{className:`hidden shrink-0 items-center justify-between gap-4 px-6 py-5 md:flex`,children:[(0,D.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[I,(0,D.jsx)(`h1`,{className:`text-title-large truncate`,style:{color:`var(--content-emphasised)`,lineHeight:1.2},children:h})]}),(0,D.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:c})]}),(0,D.jsxs)(`div`,{className:`flex min-h-0 flex-1 overflow-hidden`,children:[T?null:(0,D.jsx)(`aside`,{className:`w-64 shrink-0 overflow-y-auto`,"aria-label":x(`sidebarShell.navigationAria`,{title:h}),children:e}),O?(0,D.jsx)(`div`,{className:`flex min-w-0 min-h-0 flex-1 flex-col overflow-y-auto overflow-x-hidden pb-6`,children:e}):null,k?(0,D.jsx)(`main`,{ref:j,className:`min-w-0 min-h-0 flex-1 flex-col gap-4 overflow-y-auto overflow-x-hidden pb-6 md:px-6 md:pt-0 ${O?`hidden`:`flex`}`,children:n}):null]})]})]})}function k({items:e,bottomItems:t,indexPath:n}){let{t:r}=u(),{pathname:i}=d(),a=f(),o=s(),l=(e,t,r)=>{let{href:s,onSelect:l}=e,u=s!=null&&(i===s||i.startsWith(s+`/`)||!o&&r&&n!=null&&i===n);return(0,D.jsxs)(b.Fragment,{children:[(0,D.jsx)(c.Item,{icon:e.icon,label:e.label,active:u,trailingIcon:s==null?void 0:g,trailingIconClassName:s==null?void 0:`md:hidden`,href:s,onSelect:l,onClick:s==null?void 0:e=>{y(e)||(e.preventDefault(),E(a,s,`push`))}}),!t&&(0,D.jsx)(`div`,{role:`presentation`,"aria-hidden":!0,className:`my-2 h-px w-full bg-[var(--border-base)] md:hidden`})]},e.id)};return(0,D.jsxs)(`nav`,{"aria-label":r(`sidebarTree.ariaLabel`),className:`flex min-h-full flex-col md:gap-2 md:px-6 md:pb-4`,children:[e.map((n,r)=>l(n,r===e.length-1&&!t?.length,r===0)),t&&t.length>0&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`div`,{className:`flex-1`}),(0,D.jsx)(`div`,{role:`presentation`,"aria-hidden":!0,className:`mx-0 my-2 h-px w-full bg-[var(--border-base)] md:mx-0`}),t.map((e,n)=>l(e,n===t.length-1,!1))]})]})}export{O as n,k as t};
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$C as t,Dg as n,HC as r,Ia as i,Jo as a,SS as o,nu as s,oC as c,xS as l}from"./app-BEoekemj.js";import{E as u}from"./vendor-cVd2QlFV.js";import{d,f,n as p,t as m,x as h}from"./react-B9IgSVeK.js";import{Gi as g,za as _}from"./icons-C0wyat6T.js";import{t as v}from"./use-edge-swipe-back-zSNP4R0a.js";import{t as y}from"./link-click-CR9uUEsb.js";var b=e(h(),1),x=`data-page-transition`,S=400,C;function w(){return typeof document<`u`&&typeof document.startViewTransition==`function`}function T(){return n()&&w()}function E(e,t,n,r){if(!T()){e(t,r);return}document.documentElement.setAttribute(x,n),C!==void 0&&clearTimeout(C),C=setTimeout(()=>{C=void 0,document.documentElement.removeAttribute(x)},S),e(t,{...r,viewTransition:!0})}var D=m();function O({sidebar:e,children:n,actions:c,backHref:m,title:h=`Settings`,menuRoute:g=l.settings.root,menuReplacesContentOnMobile:y=!1}){let{t:x}=u(),{pathname:S}=d(),C=f(),w=S===g,T=s(),O=T&&w,k=!(O&&y),A=(0,b.useRef)(null),j=(0,b.useRef)(null);(0,b.useLayoutEffect)(()=>{j.current?.scrollTo(0,0)},[S]);let M=w?m:g;v({containerRef:A,onBack:(0,b.useCallback)(()=>{C(M)},[C,M]),enabled:T,navKey:S,prefetchHref:M});let N=o(),P=x(w?`sidebarShell.backFrom`:`sidebarShell.backToMenu`,{title:h}),F=(0,D.jsx)(t,{variant:`ghost`,iconOnly:(0,D.jsx)(_,{}),"aria-label":P,tintColor:`var(--content-secondary)`,onClick:()=>E(C,M,`pop`)}),I=(0,D.jsx)(t,{asChild:!0,variant:`outlined`,"aria-label":x(`sidebarShell.backFrom`,{title:h}),className:`h-8 w-8 px-0`,tintColor:`var(--content-secondary)`,children:(0,D.jsx)(p,{to:m,className:`flex items-center justify-center no-underline`,children:(0,D.jsx)(_,{size:16,"aria-hidden":`true`})})});return(0,D.jsxs)(`div`,{ref:A,className:`flex h-full min-h-0 w-full flex-1 flex-col gap-4 p-4 sm:p-6 md:gap-0`,style:{paddingTop:N?`3.75rem`:`1rem`},children:[(0,D.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3 md:hidden`,children:[F,(0,D.jsx)(r,{as:`h1`,variant:`body-large-default`,className:`flex-1 truncate text-center`,style:{color:`var(--content-tertiary)`,lineHeight:1.4},children:h}),(0,D.jsx)(`div`,{className:`h-10 w-10 shrink-0`,"aria-hidden":`true`})]}),N?(0,D.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-2 pb-4 empty:hidden`,children:[(0,D.jsx)(a,{placement:`electron`,className:`px-0 pt-0`}),(0,D.jsx)(i,{placement:`electron`,className:`px-0 pt-0`})]}):null,(0,D.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden md:rounded-[12px] md:border md:border-[var(--border-base)] md:bg-[var(--surface-overlay)]`,children:[(0,D.jsxs)(`div`,{className:`hidden shrink-0 items-center justify-between gap-4 px-6 py-5 md:flex`,children:[(0,D.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[I,(0,D.jsx)(`h1`,{className:`text-title-large truncate`,style:{color:`var(--content-emphasised)`,lineHeight:1.2},children:h})]}),(0,D.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:c})]}),(0,D.jsxs)(`div`,{className:`flex min-h-0 flex-1 overflow-hidden`,children:[T?null:(0,D.jsx)(`aside`,{className:`w-64 shrink-0 overflow-y-auto`,"aria-label":x(`sidebarShell.navigationAria`,{title:h}),children:e}),O?(0,D.jsx)(`div`,{className:`flex min-w-0 min-h-0 flex-1 flex-col overflow-y-auto overflow-x-hidden pb-6`,children:e}):null,k?(0,D.jsx)(`main`,{ref:j,className:`min-w-0 min-h-0 flex-1 flex-col gap-4 overflow-y-auto overflow-x-hidden pb-6 md:px-6 md:pt-0 ${O?`hidden`:`flex`}`,children:n}):null]})]})]})}function k({items:e,bottomItems:t,indexPath:n}){let{t:r}=u(),{pathname:i}=d(),a=f(),o=s(),l=(e,t,r)=>{let{href:s,onSelect:l}=e,u=s!=null&&(i===s||i.startsWith(s+`/`)||!o&&r&&n!=null&&i===n);return(0,D.jsxs)(b.Fragment,{children:[(0,D.jsx)(c.Item,{icon:e.icon,label:e.label,active:u,trailingIcon:s==null?void 0:g,trailingIconClassName:s==null?void 0:`md:hidden`,href:s,onSelect:l,onClick:s==null?void 0:e=>{y(e)||(e.preventDefault(),E(a,s,`push`))}}),!t&&(0,D.jsx)(`div`,{role:`presentation`,"aria-hidden":!0,className:`my-2 h-px w-full bg-[var(--border-base)] md:hidden`})]},e.id)};return(0,D.jsxs)(`nav`,{"aria-label":r(`sidebarTree.ariaLabel`),className:`flex min-h-full flex-col md:gap-2 md:px-6 md:pb-4`,children:[e.map((n,r)=>l(n,r===e.length-1&&!t?.length,r===0)),t&&t.length>0&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`div`,{className:`flex-1`}),(0,D.jsx)(`div`,{role:`presentation`,"aria-hidden":!0,className:`mx-0 my-2 h-px w-full bg-[var(--border-base)] md:mx-0`}),t.map((e,n)=>l(e,n===t.length-1,!1))]})]})}export{O as n,k as t};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{al as t,cn as n,il as r,qy as i}from"./app-KRIEMzuO.js";import{E as a,O as o,d as s,f as c}from"./vendor-DLH51Vjf.js";import{t as l,x as u}from"./react-B9IgSVeK.js";import{n as d,t as f}from"./use-return-to-short-circuit-CrgMpIk2.js";import{t as p}from"./signup-shell-BbFj5txC.js";var m=e(u(),1),h=l();function g({words:e}){let[t,n]=(0,m.useState)(0),r=(0,m.useMemo)(()=>e.reduce((e,t)=>e.length>=t.length?e:t),[e]);return(0,m.useEffect)(()=>{let t=setInterval(()=>{n(t=>(t+1)%e.length)},2400);return()=>clearInterval(t)},[e.length]),(0,h.jsxs)(`span`,{className:`signup__rotating`,children:[(0,h.jsxs)(`span`,{className:`signup__rotating-sizer`,"aria-hidden":!0,children:[r,`.`]}),(0,h.jsx)(c,{mode:`wait`,children:(0,h.jsxs)(s.em,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},exit:{opacity:0,y:-16},transition:{duration:.3,ease:`easeInOut`},children:[e[t],`.`]},e[t])})]})}var _=[`signupScreen.headlineRoles.personalIntelligence`,`signupScreen.headlineRoles.softwareEngineer`,`signupScreen.headlineRoles.financeOps`,`signupScreen.headlineRoles.householdManager`,`signupScreen.headlineRoles.gtmEngineer`,`signupScreen.headlineRoles.productLead`];function v({returnTo:e}){let{t:s}=a(`account`),c=(0,m.useMemo)(()=>_.map(e=>s(e)),[s]),[l,u]=(0,m.useState)(null),[d,f]=(0,m.useState)(!1),v=(n,a)=>{u(null),f(!0),i(r,t(e,{authIntent:n}),{returnTo:e,intent:n}).catch(e=>{console.error(a,e),u(s(`authErrors.genericFailure`))}).finally(()=>{f(!1)})};return(0,h.jsxs)(p,{children:[(0,h.jsxs)(`h1`,{className:`signup__title`,children:[s(`signupScreen.headlineLead`),(0,h.jsx)(`br`,{}),(0,h.jsx)(g,{words:c})]}),(0,h.jsx)(`p`,{className:`signup__subtitle`,children:s(`signupScreen.subtitle`)}),(0,h.jsx)(`div`,{className:`signup__buttons`,children:(0,h.jsx)(`button`,{type:`button`,className:`signup__btn`,onClick:()=>{v(`signup`,`[signup] auth flow failed:`)},disabled:d,children:s(`signupScreen.continue`)})}),l&&(0,h.jsx)(`p`,{className:`signup__error`,children:l}),(0,h.jsx)(`p`,{className:`signup__footer`,children:(0,h.jsx)(o,{i18nKey:`signupScreen.haveAccountPrompt`,ns:`account`,components:{signIn:(0,h.jsx)(`button`,{type:`button`,className:`signup__link`,onClick:()=>{v(void 0,`[signup] sign-in flow failed:`)},disabled:d})}})}),(0,h.jsxs)(`a`,{className:`signup__download`,href:`/downloads`,children:[(0,h.jsx)(n,{size:16}),s(`signupScreen.downloadMac`)]})]})}function y(){let e=f();return e.kind===`wait`?(0,h.jsx)(p,{children:(0,h.jsx)(d,{})}):e.kind===`redirect`?e.node:(0,h.jsx)(v,{returnTo:e.returnTo})}export{y as SignupPage};
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{al as t,cn as n,il as r,qy as i}from"./app-BEoekemj.js";import{E as a,O as o,d as s,f as c}from"./vendor-cVd2QlFV.js";import{t as l,x as u}from"./react-B9IgSVeK.js";import{n as d,t as f}from"./use-return-to-short-circuit-C0-TwAO7.js";import{t as p}from"./signup-shell-rqZZKQs9.js";var m=e(u(),1),h=l();function g({words:e}){let[t,n]=(0,m.useState)(0),r=(0,m.useMemo)(()=>e.reduce((e,t)=>e.length>=t.length?e:t),[e]);return(0,m.useEffect)(()=>{let t=setInterval(()=>{n(t=>(t+1)%e.length)},2400);return()=>clearInterval(t)},[e.length]),(0,h.jsxs)(`span`,{className:`signup__rotating`,children:[(0,h.jsxs)(`span`,{className:`signup__rotating-sizer`,"aria-hidden":!0,children:[r,`.`]}),(0,h.jsx)(c,{mode:`wait`,children:(0,h.jsxs)(s.em,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},exit:{opacity:0,y:-16},transition:{duration:.3,ease:`easeInOut`},children:[e[t],`.`]},e[t])})]})}var _=[`signupScreen.headlineRoles.personalIntelligence`,`signupScreen.headlineRoles.softwareEngineer`,`signupScreen.headlineRoles.financeOps`,`signupScreen.headlineRoles.householdManager`,`signupScreen.headlineRoles.gtmEngineer`,`signupScreen.headlineRoles.productLead`];function v({returnTo:e}){let{t:s}=a(`account`),c=(0,m.useMemo)(()=>_.map(e=>s(e)),[s]),[l,u]=(0,m.useState)(null),[d,f]=(0,m.useState)(!1),v=(n,a)=>{u(null),f(!0),i(r,t(e,{authIntent:n}),{returnTo:e,intent:n}).catch(e=>{console.error(a,e),u(s(`authErrors.genericFailure`))}).finally(()=>{f(!1)})};return(0,h.jsxs)(p,{children:[(0,h.jsxs)(`h1`,{className:`signup__title`,children:[s(`signupScreen.headlineLead`),(0,h.jsx)(`br`,{}),(0,h.jsx)(g,{words:c})]}),(0,h.jsx)(`p`,{className:`signup__subtitle`,children:s(`signupScreen.subtitle`)}),(0,h.jsx)(`div`,{className:`signup__buttons`,children:(0,h.jsx)(`button`,{type:`button`,className:`signup__btn`,onClick:()=>{v(`signup`,`[signup] auth flow failed:`)},disabled:d,children:s(`signupScreen.continue`)})}),l&&(0,h.jsx)(`p`,{className:`signup__error`,children:l}),(0,h.jsx)(`p`,{className:`signup__footer`,children:(0,h.jsx)(o,{i18nKey:`signupScreen.haveAccountPrompt`,ns:`account`,components:{signIn:(0,h.jsx)(`button`,{type:`button`,className:`signup__link`,onClick:()=>{v(void 0,`[signup] sign-in flow failed:`)},disabled:d})}})}),(0,h.jsxs)(`a`,{className:`signup__download`,href:`/downloads`,children:[(0,h.jsx)(n,{size:16}),s(`signupScreen.downloadMac`)]})]})}function y(){let e=f();return e.kind===`wait`?(0,h.jsx)(p,{children:(0,h.jsx)(d,{})}):e.kind===`redirect`?e.node:(0,h.jsx)(v,{returnTo:e.returnTo})}export{y as SignupPage};
@@ -1 +1 @@
1
- import{Ci as e}from"./app-KRIEMzuO.js";import{d as t}from"./vendor-DLH51Vjf.js";import{t as n}from"./react-B9IgSVeK.js";var r=n();function i({children:n}){return(0,r.jsxs)(t.div,{"data-theme":`dark`,className:`signup`,initial:{opacity:0},animate:{opacity:1},transition:{duration:.5},children:[(0,r.jsxs)(`div`,{className:`signup__left`,children:[(0,r.jsx)(`div`,{className:`signup__logo`,children:(0,r.jsx)(`img`,{src:e(`/vellum-logo-white.svg`),alt:`Vellum`,width:82,height:25})}),(0,r.jsx)(`div`,{className:`signup__form`,children:n})]}),(0,r.jsx)(t.div,{className:`signup__right`,initial:{opacity:0},animate:{opacity:1},transition:{duration:.6,delay:.15},"aria-hidden":!0,children:(0,r.jsx)(`video`,{className:`signup__video`,src:e(`/vellum-scene-cut.mp4`),autoPlay:!0,loop:!0,muted:!0,playsInline:!0})})]})}export{i as t};
1
+ import{Ci as e}from"./app-BEoekemj.js";import{d as t}from"./vendor-cVd2QlFV.js";import{t as n}from"./react-B9IgSVeK.js";var r=n();function i({children:n}){return(0,r.jsxs)(t.div,{"data-theme":`dark`,className:`signup`,initial:{opacity:0},animate:{opacity:1},transition:{duration:.5},children:[(0,r.jsxs)(`div`,{className:`signup__left`,children:[(0,r.jsx)(`div`,{className:`signup__logo`,children:(0,r.jsx)(`img`,{src:e(`/vellum-logo-white.svg`),alt:`Vellum`,width:82,height:25})}),(0,r.jsx)(`div`,{className:`signup__form`,children:n})]}),(0,r.jsx)(t.div,{className:`signup__right`,initial:{opacity:0},animate:{opacity:1},transition:{duration:.6,delay:.15},"aria-hidden":!0,children:(0,r.jsx)(`video`,{className:`signup__video`,src:e(`/vellum-scene-cut.mp4`),autoPlay:!0,loop:!0,muted:!0,playsInline:!0})})]})}export{i as t};
@@ -1,2 +1,2 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$C as t,AS as n,BC as r,Cm as i,Dc as a,Ft as o,JC as s,Lt as c,On as l,RS as u,Sm as d,Tm as f,Ty as p,W as m,eh as h,g,h as _,iC as v,iw as y,kn as b,nu as x,xS as S,yC as C}from"./app-KRIEMzuO.js";import{$n as w,E as T,nr as E}from"./vendor-DLH51Vjf.js";import{_ as D,b as O,d as k,f as A,h as j,r as M,t as N,x as ee}from"./react-B9IgSVeK.js";import{A as P,Br as F,D as I,Gi as L,Ha as R,Ya as z,Yn as B,Zr as V,kr as H,qi as te,za as U}from"./icons-C0wyat6T.js";import{a as W,n as G,r as K,t as ne}from"./use-skill-actions-BhUkfXmL.js";import{t as re}from"./use-edge-swipe-back-B2Kt4500.js";import{t as ie}from"./diff-rows-BqSnRbXL.js";import{t as q}from"./skill-icon-CWKAcXVy.js";import{n as J,t as Y}from"./use-skill-detail-files-JWSwpirW.js";import{t as ae}from"./skill-removal-dialog-DcbMCW1X.js";import{a as X,i as oe,n as se,r as ce,t as le}from"./file-view-mode-DPofWJnz.js";var ue=z(`search-x`,[[`path`,{d:`m13.5 8.5-5 5`,key:`1cs55j`}],[`path`,{d:`m8.5 8.5 5 5`,key:`a8mexj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]),Z=e(ee(),1),Q=N();function $(){return(0,Q.jsx)(`div`,{className:`flex items-center justify-center py-16`,children:(0,Q.jsx)(B,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})})}var de=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/,fe=/^diff --git a\/(.+) b\/\1$/;function pe(e,t){let n=e.replace(/^[ab]\//,``),r=`skills/${t}/`;return n.startsWith(r)?n.slice(r.length):n}function me(e){let t=e.slice(4).replace(/\t$/,``);return t===`/dev/null`?null:t}function he(e,t){let n=[],r=null,i=0,a=0,o=!1,s=!1;for(let c of e.split(`
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$C as t,AS as n,BC as r,Cm as i,Dc as a,Ft as o,JC as s,Lt as c,On as l,RS as u,Sm as d,Tm as f,Ty as p,W as m,eh as h,g,h as _,iC as v,iw as y,kn as b,nu as x,xS as S,yC as C}from"./app-BEoekemj.js";import{$n as w,E as T,nr as E}from"./vendor-cVd2QlFV.js";import{_ as D,b as O,d as k,f as A,h as j,r as M,t as N,x as ee}from"./react-B9IgSVeK.js";import{A as P,Br as F,D as I,Gi as L,Ha as R,Ya as z,Yn as B,Zr as V,kr as H,qi as te,za as U}from"./icons-C0wyat6T.js";import{a as W,n as G,r as K,t as ne}from"./use-skill-actions-BvJl4cE_.js";import{t as re}from"./use-edge-swipe-back-zSNP4R0a.js";import{t as ie}from"./diff-rows-BqSnRbXL.js";import{t as q}from"./skill-icon-CWKAcXVy.js";import{n as J,t as Y}from"./use-skill-detail-files-upPaF1Ti.js";import{t as ae}from"./skill-removal-dialog-CKyIY15v.js";import{a as X,i as oe,n as se,r as ce,t as le}from"./file-view-mode-DqXCmgGD.js";var ue=z(`search-x`,[[`path`,{d:`m13.5 8.5-5 5`,key:`1cs55j`}],[`path`,{d:`m8.5 8.5 5 5`,key:`a8mexj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]),Z=e(ee(),1),Q=N();function $(){return(0,Q.jsx)(`div`,{className:`flex items-center justify-center py-16`,children:(0,Q.jsx)(B,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})})}var de=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/,fe=/^diff --git a\/(.+) b\/\1$/;function pe(e,t){let n=e.replace(/^[ab]\//,``),r=`skills/${t}/`;return n.startsWith(r)?n.slice(r.length):n}function me(e){let t=e.slice(4).replace(/\t$/,``);return t===`/dev/null`?null:t}function he(e,t){let n=[],r=null,i=0,a=0,o=!1,s=!1;for(let c of e.split(`
2
2
  `)){if(c.startsWith(`diff --git `)){r={path:pe(fe.exec(c)?.[1]??(c.split(` `).slice(3).join(` `)||``),t),rows:[],added:0,removed:0},n.push(r),i=0,a=0,o=!1,s=!1;continue}if(!r)continue;let e=de.exec(c);if(e){i=Number(e[1]),a=Number(e[2]),o=!0,r.rows.length>0&&r.rows.push({type:`meta`,text:c});continue}if(!c.startsWith(`\\ No newline`)){if(!o&&(c.startsWith(`+++ `)||c.startsWith(`--- `))){let e=me(c);e!==null&&(c.startsWith(`+++ `)||!s)&&(r.path=pe(e,t),s=c.startsWith(`+++ `));continue}!o&&(c.startsWith(`index `)||c.startsWith(`new file mode `)||c.startsWith(`deleted file mode `)||c.startsWith(`similarity index `)||c.startsWith(`rename `)||c.startsWith(`old mode `)||c.startsWith(`new mode `)||c.startsWith(`Binary files `))||(c.startsWith(`+`)?(r.rows.push({type:`add`,text:c.slice(1),newNo:a}),r.added+=1,a+=1):c.startsWith(`-`)?(r.rows.push({type:`del`,text:c.slice(1),oldNo:i}),r.removed+=1,i+=1):c.startsWith(` `)&&(r.rows.push({type:`ctx`,text:c.slice(1),oldNo:i,newNo:a}),i+=1,a+=1))}}return{files:n,added:n.reduce((e,t)=>e+t.added,0),removed:n.reduce((e,t)=>e+t.removed,0)}}async function ge(e,t,n){let{data:r,error:i,response:a}=await p({path:{assistant_id:e,id:t},throwOnError:!1,signal:n});if(!a||!a.ok){if(a?.status===404)return null;throw a?u(i,a):i??Error(`Failed to fetch skill history.`)}return r??null}function _e(e){return e.isLoading?!1:e.isError||e.revisionCount>0}function ve(e,t){let n=!!(e&&t),r=w({queryKey:i({path:{assistant_id:e??``,id:t}}),queryFn:({signal:n})=>ge(e??``,t,n),enabled:n,refetchOnWindowFocus:!1});return{history:r.data??null,revisions:r.data?.revisions??[],truncatedByCompaction:r.data?.truncatedByCompaction??!1,isLoading:r.isLoading,isError:r.isError}}function ye({assistantId:e,skillId:t}){let{t:n}=T(`intelligence`),{revisions:r,truncatedByCompaction:i,isLoading:a,isError:o}=ve(e,t);return a?(0,Q.jsx)($,{}):o?(0,Q.jsx)(xe,{children:n(`skillRevisionHistory.loadError`)}):(0,Q.jsx)(be,{skillId:t,revisions:r,truncatedByCompaction:i})}function be({skillId:e,revisions:t,truncatedByCompaction:n}){let{t:r}=T(`intelligence`);return t.length===0?(0,Q.jsx)(xe,{children:r(`skillRevisionHistory.noChanges`)}):(0,Q.jsxs)(v.Root,{type:`multiple`,className:`flex flex-col gap-2 p-3`,children:[t.map(t=>(0,Q.jsx)(Se,{revision:t,skillId:e},t.id)),n&&(0,Q.jsx)(`p`,{className:`px-1 pt-1 text-body-small-lighter`,style:{color:`var(--content-tertiary)`},children:r(`skillRevisionHistory.truncatedNotice`)})]})}function xe({children:e}){return(0,Q.jsx)(`p`,{className:`px-3 py-10 text-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:e})}function Se({revision:e,skillId:t}){let{t:n}=T(`intelligence`),r=(0,Z.useMemo)(()=>he(e.diff,t),[e.diff,t]);return(0,Q.jsxs)(v.Item,{value:e.id,className:`overflow-hidden rounded-md border`,style:{borderColor:`var(--border-base)`},children:[(0,Q.jsxs)(v.Trigger,{className:`group flex w-full items-center gap-3 px-3 py-2.5 text-left transition-colors hover:bg-[var(--surface-hover)]`,children:[(0,Q.jsx)(L,{className:`h-4 w-4 shrink-0 transition-transform group-data-[state=open]:rotate-90`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0}),(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`span`,{className:`block truncate text-body-medium-default`,style:{color:`var(--content-default)`},children:c(e.changedAt)}),(0,Q.jsx)(`span`,{className:`mt-0.5 block truncate text-body-small-lighter`,style:{color:`var(--content-tertiary)`},children:e.files.join(` · `)})]}),r.added>0&&(0,Q.jsxs)(`span`,{className:`shrink-0 text-body-small-default tabular-nums`,style:{color:`var(--system-positive-strong)`},children:[`+`,r.added]}),r.removed>0&&(0,Q.jsxs)(`span`,{className:`shrink-0 text-body-small-default tabular-nums`,style:{color:`var(--system-negative-strong)`},children:[`−`,r.removed]})]}),(0,Q.jsxs)(v.Content,{className:`border-t`,style:{borderColor:`var(--border-base)`},children:[(0,Q.jsx)(`p`,{className:`px-3 py-2 text-body-small-lighter`,style:{color:`var(--content-tertiary)`},children:o(e.changedAt)}),r.files.length===0?(0,Q.jsx)(`p`,{className:`px-3 pb-3 text-body-small-lighter`,style:{color:`var(--content-tertiary)`},children:n(`skillRevisionHistory.noPreviewForChange`)}):r.files.map(e=>(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:`border-t px-3 py-1.5 font-mono text-body-small-default`,style:{borderColor:`var(--border-base)`,backgroundColor:`var(--surface-base)`,color:`var(--content-secondary)`},children:e.path}),(0,Q.jsx)(`div`,{className:`py-1`,children:(0,Q.jsx)(ie,{rows:e.rows})})]},e.path))]})]})}function Ce(e){return e===`history`?`history`:`files`}function we({assistantId:e,skill:n,tab:i,onTabChange:a,onBack:o,backToConversation:s=!1,onInstall:c,onRemove:l,isInstalling:u=!1,isRemoving:d=!1,sourceConversationId:f}){let{t:p}=T(`intelligence`),m=K(n),h=g(n),{fileEntries:_,setSelectedPath:v,activePath:y,activeFile:b,isFilesLoading:x,fileContent:S,isBinary:w,isContentLoading:E}=Y(e,n.id),{revisions:D,isLoading:O,isError:k}=ve(e,n.id),A=_e({isLoading:O,isError:k,revisionCount:D.length}),j=A?i:`files`,M=(0,Q.jsxs)(`div`,{className:`mb-4 flex items-start gap-3`,children:[(0,Q.jsx)(t,{type:`button`,variant:`ghost`,iconOnly:(0,Q.jsx)(U,{"aria-hidden":!0}),"aria-label":p(s?`skillDetail.backToConversationAriaLabel`:`skillDetail.backToSkillsAriaLabel`),onClick:o}),(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3 sm:flex-row sm:items-center`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3`,children:[(0,Q.jsx)(q,{skill:n,className:`h-8 w-8 text-3xl`}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,Q.jsx)(`h2`,{className:`text-title-medium`,style:{color:`var(--content-default)`},children:n.name}),(0,Q.jsx)(W,{origin:n.origin})]}),(0,Q.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-body-medium-lighter`,style:{color:`var(--content-secondary)`},children:n.description}),(0,Q.jsx)(J,{skill:{origin:n.origin,sourceConversationId:f},className:`mt-1`})]})]}),m?u?(0,Q.jsx)(`div`,{className:`flex h-9 items-center px-3`,children:(0,Q.jsx)(B,{className:`h-4 w-4 animate-spin`,style:{color:`var(--content-tertiary)`}})}):(0,Q.jsx)(t,{type:`button`,onClick:c,disabled:!c,leftIcon:(0,Q.jsx)(R,{"aria-hidden":!0}),children:p(`skillDetail.install`)}):(0,Q.jsx)(t,{type:`button`,variant:h?`dangerOutline`:`outlined`,onClick:l,disabled:!h||d||!l,loading:d,leftIcon:(0,Q.jsx)(P,{"aria-hidden":!0}),children:p(`skillDetail.remove`)})]})]}),N=(0,Q.jsx)(r.Root,{asChild:!0,noPadding:!0,children:(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden sm:grid`,style:{gridTemplateColumns:`240px 1fr`},children:[(0,Q.jsx)(`div`,{className:`max-h-40 shrink-0 overflow-y-auto border-b p-2 sm:max-h-none sm:border-b-0 sm:border-r`,style:{borderColor:`var(--border-base)`},children:x?(0,Q.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,Q.jsx)(B,{className:`h-4 w-4 animate-spin`,style:{color:`var(--content-tertiary)`}})}):_.length===0?(0,Q.jsx)(`p`,{className:`px-3 py-4 text-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:p(`skillDetail.noFilesAvailable`)}):_.map(e=>{let t=y===e.path,n=(e.mimeType??``).endsWith(`/directory`);return(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>v(e.path),className:`flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-body-medium-lighter transition-colors hover:bg-[var(--surface-hover)]`,style:{color:t?`var(--primary-base)`:`var(--content-default)`,backgroundColor:t?`color-mix(in oklab, var(--primary-base) 10%, transparent)`:void 0},children:[n?(0,Q.jsx)(H,{className:`h-4 w-4 shrink-0`,style:{color:`var(--system-mid-strong)`}}):(0,Q.jsx)(F,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),(0,Q.jsx)(`span`,{className:`truncate`,children:e.name})]},e.path)})}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:E?(0,Q.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,Q.jsx)(B,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})}):b?(0,Q.jsx)(Te,{assistantId:e,skillId:n.id,fileName:b.name,filePath:b.path,content:S,isBinary:w,editable:n.kind===`installed`},`${n.id}/${b.path}`):(0,Q.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:p(`skillDetail.selectFilePrompt`)})})]})});return(0,Q.jsxs)(`div`,{className:`flex h-[calc(100vh-14rem)] flex-col`,children:[M,(0,Q.jsxs)(C.Root,{value:j,onValueChange:e=>a(Ce(e)),className:`flex min-h-0 flex-1 flex-col`,children:[A&&(0,Q.jsxs)(C.List,{className:`mb-3`,children:[(0,Q.jsx)(C.Trigger,{value:`files`,children:p(`skillDetail.filesTab`)}),(0,Q.jsx)(C.Trigger,{value:`history`,children:p(`skillDetail.historyTab`)})]}),(0,Q.jsx)(C.Panel,{value:`files`,forceMount:!0,className:`min-h-0 flex-1 flex-col`,style:{display:j===`files`?`flex`:`none`},children:N}),A&&(0,Q.jsx)(C.Panel,{value:`history`,className:`flex min-h-0 flex-1 flex-col`,children:(0,Q.jsx)(r.Root,{asChild:!0,noPadding:!0,children:(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:(0,Q.jsx)(ye,{assistantId:e,skillId:n.id})})})})]})]})}function Te({assistantId:e,skillId:r,fileName:i,filePath:o,content:s,isBinary:c,editable:u}){let{t:d}=T(`intelligence`),f=E(),[p,m]=(0,Z.useState)(!1),[g,v]=(0,Z.useState)(``),[y,x]=(0,Z.useState)(`formatted`),S=`skills/${r}/${o}`,C=h({onSuccess:()=>{m(!1),v(``),f.invalidateQueries({queryKey:[{_id:`skillsByIdFilesContentGet`}]}),f.invalidateQueries({queryKey:[{_id:`skillsByIdFilesGet`}]}),f.invalidateQueries({queryKey:[{_id:`skillsByIdHistoryGet`}]}),o===`SKILL.md`&&_(f,e)},onError:e=>{n(e,{context:`skill-file-save`,bestEffort:!0})}}),w=p&&g!==(s??``),D=(0,Z.useCallback)(()=>{!w||C.isPending||C.mutate({path:{assistant_id:e},body:{path:S,content:g,encoding:`utf8`}})},[w,C,e,S,g]),O=(0,Z.useCallback)(()=>{m(!0),v(s??``),C.reset()},[s,C]),k=(0,Z.useCallback)(()=>{m(!1),v(``),C.reset()},[C]);if(c)return(0,Q.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:d(`skillFileContent.binaryFile`)});if(s===null)return(0,Q.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:d(`skillFileContent.noPreviewAvailable`,{fileName:i})});let A=u?(0,Q.jsx)(t,{variant:`ghost`,size:`regular`,iconOnly:(0,Q.jsx)(V,{"aria-hidden":!0}),onClick:()=>void a(S),"aria-label":d(`skillDetail.openInWorkspaceAriaLabel`),className:`hover:bg-[var(--surface-base)]`}):void 0;return b(i,void 0)&&!p?(0,Q.jsx)(`div`,{className:`relative flex h-full flex-col`,children:(0,Q.jsxs)(`div`,{className:`relative flex-1 overflow-auto px-6 py-4`,style:{color:`var(--content-default)`},children:[(0,Q.jsx)(se,{content:s,fileName:i,showEdit:u,isEditing:!1,onToggleEdit:O,leading:(0,Q.jsx)(le,{mode:y,onChange:x}),extraActions:A}),y===`formatted`?(0,Q.jsx)(l,{content:s}):(0,Q.jsx)(X,{content:s,readOnly:!u,onStartEdit:O})]})}):(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsxs)(`div`,{className:`relative flex-1 overflow-hidden`,children:[(0,Q.jsx)(se,{content:p?g:s,fileName:i,showEdit:u,isEditing:p,onToggleEdit:()=>p?k():O(),extraActions:A}),p?(0,Q.jsx)(oe,{value:g,onChange:v,onSave:D}):(0,Q.jsx)(X,{content:s,readOnly:!u,onStartEdit:O})]}),p&&(0,Q.jsx)(ce,{isDirty:w,isSaving:C.isPending,error:C.isError?d(`skillDetail.saveFailed`):null,onSave:D,onDiscard:k})]})}var Ee=e(O(),1);function De({content:e,defaultMode:t=`formatted`,className:n}){let[r,i]=(0,Z.useState)(t);return(0,Q.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-2`,children:[(0,Q.jsx)(`div`,{className:`flex justify-end px-4 pt-2`,children:(0,Q.jsx)(le,{mode:r,onChange:i})}),r===`formatted`?(0,Q.jsx)(`div`,{className:y(`min-h-0 flex-1 overflow-auto`,n),children:(0,Q.jsx)(l,{content:e})}):(0,Q.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,Q.jsx)(X,{content:e,readOnly:!0})})]})}function Oe({fileName:e,content:t,isBinary:n}){let{t:r}=T(`intelligence`);return n?(0,Q.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:r(`skillFileContent.binaryFile`)}):t===null?(0,Q.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:r(`skillFileContent.noPreviewAvailable`,{fileName:e})}):b(e,void 0)?(0,Q.jsx)(De,{content:t,className:`px-6 py-4`}):(0,Q.jsx)(`pre`,{className:`h-full overflow-y-auto whitespace-pre-wrap break-words p-4 font-mono text-body-small-default`,style:{color:`var(--content-default)`},children:t})}function ke({assistantId:e,skill:n,onBack:i,backToConversation:a=!1,onInstall:o,onRemove:s,isInstalling:c=!1,isRemoving:l=!1,swipeContainerRef:u,sourceConversationId:d}){let{t:f}=T(`intelligence`),p=K(n),m=g(n),{fileEntries:h,setSelectedPath:_,activePath:v,activeFile:y,isFilesLoading:b,fileContent:x,isBinary:S,isContentLoading:C}=Y(e,n.id),[w,E]=(0,Z.useState)(null);(0,Z.useEffect)(()=>{E(document.getElementById(`viewport-overlays`))},[]);let D=(0,Q.jsxs)(`div`,{ref:u,className:`fixed inset-0 z-40 flex flex-col overflow-hidden bg-[var(--surface-overlay)]`,style:{paddingTop:`calc(8px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px)))`,paddingBottom:`calc(8px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)))`,paddingLeft:`calc(12px + var(--safe-area-inset-left, env(safe-area-inset-left, 0px)))`,paddingRight:`calc(12px + var(--safe-area-inset-right, env(safe-area-inset-right, 0px)))`},children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Q.jsx)(t,{variant:`ghost`,iconOnly:(0,Q.jsx)(U,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":f(a?`skillDetail.backToConversationAriaLabel`:`skillDetail.backToSkillsAriaLabel`),onClick:i,className:`max-md:bg-[var(--surface-active)]`}),(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate px-2 text-center text-body-medium-default`,style:{color:`var(--content-secondary)`},children:n.name}),(0,Q.jsx)(Ae,{available:p,removable:m,isInstalling:c,isRemoving:l,onInstall:o,onRemove:s})]}),(0,Q.jsxs)(`div`,{className:`mt-4 flex flex-col gap-2`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Q.jsx)(q,{skill:n,className:`h-6 w-6 shrink-0 text-[22px] leading-none`}),(0,Q.jsx)(`h2`,{className:`min-w-0 truncate text-title-medium`,style:{color:`var(--content-emphasised)`},children:n.name})]}),(0,Q.jsx)(W,{origin:n.origin})]}),(0,Q.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:n.description}),(0,Q.jsx)(J,{skill:{origin:n.origin,sourceConversationId:d}})]}),(0,Q.jsx)(r.Root,{asChild:!0,noPadding:!0,children:(0,Q.jsxs)(`div`,{className:`mt-6 flex min-h-0 flex-1 flex-col overflow-hidden rounded-2xl border bg-[var(--surface-lift)]`,style:{borderColor:`var(--border-hover)`},children:[(0,Q.jsx)(`div`,{className:`flex items-center justify-between gap-2 border-b px-3 py-2`,style:{borderColor:`var(--border-hover)`},children:(0,Q.jsx)(Me,{fileEntries:h,activePath:v,activeName:y?.name??null,onSelect:_})}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:b||C?(0,Q.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,Q.jsx)(B,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})}):y?(0,Q.jsx)(Oe,{fileName:y.name,content:x,isBinary:S},y.path):(0,Q.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:f(`skillDetail.selectFilePrompt`)})})]})})]});return w?(0,Ee.createPortal)(D,w):D}function Ae({available:e,removable:n,isInstalling:r,isRemoving:i,onInstall:a,onRemove:o}){let{t:s}=T(`intelligence`);return r||i?(0,Q.jsx)(t,{variant:`ghost`,loading:!0,iconOnly:i?(0,Q.jsx)(P,{"aria-hidden":!0}):(0,Q.jsx)(R,{"aria-hidden":!0}),expandOnMobile:!0,disabled:!0,"aria-label":s(`skillDetail.pendingAriaLabel`),className:`max-md:bg-[var(--surface-active)]`}):e?(0,Q.jsx)(t,{variant:`ghost`,iconOnly:(0,Q.jsx)(R,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":s(`skillRow.installSkillAriaLabel`),onClick:a,disabled:!a,className:`max-md:bg-[var(--surface-active)]`}):n?(0,Q.jsx)(t,{variant:`dangerGhost`,iconOnly:(0,Q.jsx)(P,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":s(`skillRow.removeSkillAriaLabel`),onClick:o,disabled:!o,className:`max-md:rounded-full max-md:bg-[var(--system-negative-weak)]`}):(0,Q.jsx)(t,{variant:`dangerGhost`,iconOnly:(0,Q.jsx)(P,{"aria-hidden":!0}),expandOnMobile:!0,disabled:!0,title:s(`skillRow.bundledSkillsCannotBeRemoved`),"aria-label":s(`skillRow.bundledSkillCannotBeRemovedAriaLabel`),className:`max-md:rounded-full max-md:bg-[var(--system-negative-weak)]`})}function je(e){return(e??``).endsWith(`/directory`)}function Me({fileEntries:e,activePath:t,activeName:n,onSelect:r}){let{t:i}=T(`intelligence`),a=n??i(`skillDetail.selectAFile`);return e.length===0?(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-body-medium-default`,style:{color:`var(--content-emphasised)`},children:[(0,Q.jsx)(Ne,{}),(0,Q.jsx)(`span`,{className:`truncate`,children:a})]}):(0,Q.jsxs)(s.Root,{children:[(0,Q.jsx)(s.Trigger,{children:(0,Q.jsxs)(`button`,{type:`button`,className:`flex min-w-0 items-center gap-2 rounded-md text-body-medium-default`,style:{color:`var(--content-emphasised)`},children:[(0,Q.jsx)(Ne,{}),(0,Q.jsx)(`span`,{className:`truncate`,children:a}),(0,Q.jsx)(te,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0})]})}),(0,Q.jsx)(s.Content,{align:`start`,children:e.map(e=>{let n=je(e.mimeType);return(0,Q.jsx)(s.Item,{onSelect:()=>r(e.path),leftIcon:n?(0,Q.jsx)(H,{}):(0,Q.jsx)(F,{}),"aria-current":e.path===t?`true`:void 0,children:e.name},e.path)})})]})}function Ne(){return(0,Q.jsx)(`span`,{className:`flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-[var(--surface-base)]`,"aria-hidden":!0,children:(0,Q.jsx)(F,{className:`h-4 w-4`,style:{color:`var(--content-secondary)`}})})}function Pe(){let{t:e}=T(`intelligence`);return(0,Q.jsx)(G,{icon:I,iconColor:`var(--system-negative-strong)`,title:e(`skillsErrorState.title`),subtitle:e(`skillsErrorState.subtitle`)})}function Fe(){let{t:e}=T(`intelligence`),n=m(),{skillId:r}=j(),i=A(),a=k(),{pathname:o}=a,s=x(),c=(0,Z.useRef)(null),l=a.state,u=typeof l?.listSearch==`string`?l.listSearch:``,p=typeof l?.backTo==`string`&&l.backTo.startsWith(`/`)&&!l.backTo.startsWith(`//`)?l.backTo:null,[h,g]=D(),_=Ce(h.get(`tab`)),v=(0,Z.useCallback)(e=>{let t=new URLSearchParams(h);e===`history`?t.set(`tab`,`history`):t.delete(`tab`),g(t,{replace:!0,state:a.state})},[h,g,a.state]),y=w({...f({path:{assistant_id:n},query:{include:`catalog`}}),select:e=>e.skills,refetchOnMount:`always`}),b=p??`${S.superpowers}${u}`,C=(0,Z.useCallback)(()=>{i(b)},[i,b]),E=(0,Z.useCallback)(()=>{i(b,{replace:!0})},[i,b]);re({containerRef:c,onBack:C,enabled:s,navKey:o,prefetchHref:b.split(`?`)[0]??b});let{handleInstall:O,handleRemove:N,isInstallingSkill:ee,isRemovingSkill:P,skillPendingRemoval:F,confirmRemove:I,cancelRemove:L}=ne(n,{onRemoved:E}),R=y.data,z=(0,Z.useMemo)(()=>R?.find(e=>e.id===r)??null,[R,r]),B=w({...d({path:{assistant_id:n,id:r??``}}),enabled:!!r&&z?.origin===`assistant-memory`,select:e=>e.skill.origin===`assistant-memory`?e.skill.sourceConversationId??null:null});if(!r)return(0,Q.jsx)(M,{to:S.superpowers,replace:!0});if(y.isLoading)return(0,Q.jsx)($,{});if(y.isError&&!z)return(0,Q.jsx)(Pe,{});if(!z&&y.isFetching)return(0,Q.jsx)($,{});if(!z)return(0,Q.jsx)(G,{icon:ue,title:e(`skillDetailPage.notFoundTitle`),subtitle:e(`skillDetailPage.notFoundSubtitle`),children:(0,Q.jsx)(t,{type:`button`,variant:`outlined`,className:`mt-4`,leftIcon:(0,Q.jsx)(U,{"aria-hidden":!0}),onClick:C,children:e(p?`skillDetailPage.backToConversation`:`skillDetailPage.backToSuperpowers`)})});let V={assistantId:n,skill:z,onBack:C,backToConversation:p!==null,onInstall:()=>O(z),onRemove:()=>N(z),isInstalling:ee(z),isRemoving:P(z),sourceConversationId:B.data??void 0};return(0,Q.jsxs)(Q.Fragment,{children:[s?(0,Q.jsx)(ke,{...V,swipeContainerRef:c}):(0,Q.jsx)(we,{...V,tab:_,onTabChange:v}),(0,Q.jsx)(ae,{skillName:F?.name??null,onConfirm:I,onCancel:L})]})}export{Fe as SkillDetailPage};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$C as t,$m as n,AS as r,Gn as i,HC as a,JC as o,On as s,Sm as c,Un as l,_ as u,g as d,h as f,nx as p,xS as m,zC as h}from"./app-KRIEMzuO.js";import{$n as g,E as _,nr as v}from"./vendor-DLH51Vjf.js";import{d as y,f as b,t as x,x as S}from"./react-B9IgSVeK.js";import{$r as C,A as w,ha as T}from"./icons-C0wyat6T.js";import{n as E,t as D}from"./use-skill-detail-files-JWSwpirW.js";import{t as O}from"./skill-removal-dialog-DcbMCW1X.js";var k=e(S(),1),A=x();function j({skillId:e,onClose:x}){let{t:S}=_(`chat`),j=b(),M=y(),N=v(),P=p.use.activeAssistantId(),[F,I]=(0,k.useState)(!1),L=g({...c({path:{assistant_id:P??``,id:e}}),select:e=>e.skill,enabled:!!P}),R=L.data,{skillMd:z,fileContent:B,isFilesPending:V,isContentPending:H}=D(P,e),U=n({onSuccess:()=>{P&&f(N,P),x()},onError:e=>{r(e,{context:`skill-detail-panel-remove`})}}),W=()=>{P&&(U.mutate({path:{assistant_id:P,id:e}}),I(!1))},G=L.isPending||V||z!=null&&H,K=R!=null&&d(R);return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(l,{icon:R?.emoji?(0,A.jsx)(`span`,{className:`text-xl leading-none`,"aria-hidden":!0,children:R.emoji}):void 0,Glyph:T,title:R?.name??S(`skillDetailPanel.titleFallback`),closeLabel:S(`skillDetailPanel.closeDetails`),onClose:x,headerActions:K?(0,A.jsxs)(o.Root,{children:[(0,A.jsx)(o.Trigger,{asChild:!0,children:(0,A.jsx)(t,{variant:`outlined`,iconOnly:(0,A.jsx)(C,{}),"aria-label":S(`skillDetailPanel.actionsAria`),tooltip:S(`skillDetailPanel.moreTooltip`),className:`shrink-0`})}),(0,A.jsx)(o.Content,{side:`bottom`,align:`end`,children:(0,A.jsx)(o.Item,{leftIcon:(0,A.jsx)(w,{size:14}),onSelect:()=>I(!0),children:S(`skillDetailPanel.removeSkill`)})})]}):void 0,footer:(0,A.jsx)(`div`,{className:`flex justify-end`,children:(0,A.jsx)(t,{onClick:()=>{x(),j(m.skills.detail(e),{state:u(M)})},children:S(`skillDetailPanel.goToSkill`)})}),children:L.isError&&!R?(0,A.jsx)(h,{tone:`error`,children:S(`skillDetailPanel.loadError`)}):G?(0,A.jsx)(i,{placement:`panel`}):(0,A.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[R?.description&&(0,A.jsx)(a,{variant:`body-medium-lighter`,as:`p`,className:`text-[var(--content-secondary)]`,children:R.description}),R&&(0,A.jsx)(E,{skill:R,onNavigate:x}),B&&(0,A.jsx)(`div`,{children:(0,A.jsx)(s,{content:B})})]})}),(0,A.jsx)(O,{skillName:F&&R?R.name:null,onConfirm:W,onCancel:()=>I(!1)})]})}export{j as SkillDetailPanel};
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$C as t,$m as n,AS as r,Gn as i,HC as a,JC as o,On as s,Sm as c,Un as l,_ as u,g as d,h as f,nx as p,xS as m,zC as h}from"./app-BEoekemj.js";import{$n as g,E as _,nr as v}from"./vendor-cVd2QlFV.js";import{d as y,f as b,t as x,x as S}from"./react-B9IgSVeK.js";import{$r as C,A as w,ha as T}from"./icons-C0wyat6T.js";import{n as E,t as D}from"./use-skill-detail-files-upPaF1Ti.js";import{t as O}from"./skill-removal-dialog-CKyIY15v.js";var k=e(S(),1),A=x();function j({skillId:e,onClose:x}){let{t:S}=_(`chat`),j=b(),M=y(),N=v(),P=p.use.activeAssistantId(),[F,I]=(0,k.useState)(!1),L=g({...c({path:{assistant_id:P??``,id:e}}),select:e=>e.skill,enabled:!!P}),R=L.data,{skillMd:z,fileContent:B,isFilesPending:V,isContentPending:H}=D(P,e),U=n({onSuccess:()=>{P&&f(N,P),x()},onError:e=>{r(e,{context:`skill-detail-panel-remove`})}}),W=()=>{P&&(U.mutate({path:{assistant_id:P,id:e}}),I(!1))},G=L.isPending||V||z!=null&&H,K=R!=null&&d(R);return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(l,{icon:R?.emoji?(0,A.jsx)(`span`,{className:`text-xl leading-none`,"aria-hidden":!0,children:R.emoji}):void 0,Glyph:T,title:R?.name??S(`skillDetailPanel.titleFallback`),closeLabel:S(`skillDetailPanel.closeDetails`),onClose:x,headerActions:K?(0,A.jsxs)(o.Root,{children:[(0,A.jsx)(o.Trigger,{asChild:!0,children:(0,A.jsx)(t,{variant:`outlined`,iconOnly:(0,A.jsx)(C,{}),"aria-label":S(`skillDetailPanel.actionsAria`),tooltip:S(`skillDetailPanel.moreTooltip`),className:`shrink-0`})}),(0,A.jsx)(o.Content,{side:`bottom`,align:`end`,children:(0,A.jsx)(o.Item,{leftIcon:(0,A.jsx)(w,{size:14}),onSelect:()=>I(!0),children:S(`skillDetailPanel.removeSkill`)})})]}):void 0,footer:(0,A.jsx)(`div`,{className:`flex justify-end`,children:(0,A.jsx)(t,{onClick:()=>{x(),j(m.skills.detail(e),{state:u(M)})},children:S(`skillDetailPanel.goToSkill`)})}),children:L.isError&&!R?(0,A.jsx)(h,{tone:`error`,children:S(`skillDetailPanel.loadError`)}):G?(0,A.jsx)(i,{placement:`panel`}):(0,A.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[R?.description&&(0,A.jsx)(a,{variant:`body-medium-lighter`,as:`p`,className:`text-[var(--content-secondary)]`,children:R.description}),R&&(0,A.jsx)(E,{skill:R,onNavigate:x}),B&&(0,A.jsx)(`div`,{children:(0,A.jsx)(s,{content:B})})]})}),(0,A.jsx)(O,{skillName:F&&R?R.name:null,onConfirm:W,onCancel:()=>I(!1)})]})}export{j as SkillDetailPanel};
@@ -1 +1 @@
1
- import{mC as e}from"./app-KRIEMzuO.js";import{E as t}from"./vendor-DLH51Vjf.js";import{t as n}from"./react-B9IgSVeK.js";var r=n();function i({skillName:n,onConfirm:i,onCancel:a}){let{t:o}=t();return(0,r.jsx)(e,{open:n!==null,title:o(`skillRemovalDialog.title`),message:n?o(`skillRemovalDialog.message`,{name:n}):``,confirmLabel:o(`skillRemovalDialog.remove`),destructive:!0,onConfirm:i,onCancel:a})}export{i as t};
1
+ import{mC as e}from"./app-BEoekemj.js";import{E as t}from"./vendor-cVd2QlFV.js";import{t as n}from"./react-B9IgSVeK.js";var r=n();function i({skillName:n,onConfirm:i,onCancel:a}){let{t:o}=t();return(0,r.jsx)(e,{open:n!==null,title:o(`skillRemovalDialog.title`),message:n?o(`skillRemovalDialog.message`,{name:n}):``,confirmLabel:o(`skillRemovalDialog.remove`),destructive:!0,onConfirm:i,onCancel:a})}export{i as t};
@@ -1 +1 @@
1
- import{xS as e}from"./app-KRIEMzuO.js";import{_ as t,r as n,t as r}from"./react-B9IgSVeK.js";var i=r();function a(){let[r]=t(),a=r.get(`skill`);if(a)return(0,i.jsx)(n,{to:e.skills.detail(a),replace:!0});let o=r.toString();return(0,i.jsx)(n,{to:`${e.superpowers}${o?`?${o}`:``}`,replace:!0})}export{a as SkillsPage};
1
+ import{xS as e}from"./app-BEoekemj.js";import{_ as t,r as n,t as r}from"./react-B9IgSVeK.js";var i=r();function a(){let[r]=t(),a=r.get(`skill`);if(a)return(0,i.jsx)(n,{to:e.skills.detail(a),replace:!0});let o=r.toString();return(0,i.jsx)(n,{to:`${e.superpowers}${o?`?${o}`:``}`,replace:!0})}export{a as SkillsPage};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$C as t,BC as n,DC as r,Dm as i,Em as a,Om as o,W as s,au as c,iu as l,km as u,ou as d,ru as f}from"./app-KRIEMzuO.js";import{$n as p,E as m,Xn as h,nr as g}from"./vendor-DLH51Vjf.js";import{t as _,x as v}from"./react-B9IgSVeK.js";import{A as y,qi as b,zt as x}from"./icons-C0wyat6T.js";var S=e(v(),1),C=_(),w={task_complete:`soundsSections.soundEventTaskComplete`,needs_input:`soundsSections.soundEventNeedsInput`,task_failed:`soundsSections.soundEventTaskFailed`,notification:`soundsSections.soundEventNotification`,new_conversation:`soundsSections.soundEventNewConversation`,message_sent:`soundsSections.soundEventMessageSent`,character_poke:`soundsSections.soundEventCharacterPoke`,random:`soundsSections.soundEventRandom`};function T(e,t){return t(w[e])}function E({label:e,description:t,checked:n,disabled:i,onChange:a}){return(0,C.jsxs)(`div`,{className:`flex items-center justify-between gap-3 py-1`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`div`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:e}),t&&(0,C.jsx)(`div`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:t})]}),(0,C.jsx)(r,{checked:n,disabled:i,onChange:a,label:e})]})}function D(){return(0,C.jsx)(`div`,{className:`border-t border-[var(--border-base)]`})}function O({event:e,eventConfig:n,availableSounds:i,globalEnabled:a,onToggle:o,onAddSound:s,onRemoveSound:c,onPreview:l,t:u}){let[f,p]=(0,S.useState)(!1),m=T(e,u),h=i.filter(e=>!n.sounds.includes(e.filename)),g=i.length>0&&h.length===0;return(0,C.jsxs)(`div`,{className:`py-3`,children:[(0,C.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,C.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:m}),(0,C.jsx)(r,{checked:n.enabled,disabled:!a,onChange:o,label:u(`soundsSections.enableEvent`,{eventName:m})})]}),n.enabled&&(0,C.jsxs)(`div`,{className:`mt-2 space-y-1 pl-2`,children:[n.sounds.length===0?(0,C.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:u(`soundsSections.defaultBlip`)}):n.sounds.map(e=>(0,C.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,C.jsx)(`span`,{className:`truncate text-body-small-default text-[var(--content-secondary)]`,title:e,children:d(e)}),(0,C.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,C.jsx)(t,{variant:`ghost`,size:`compact`,iconOnly:(0,C.jsx)(x,{}),iconOnlyGlyphClassName:`[&_svg]:size-3`,expandOnMobile:!1,onClick:()=>l(e),className:`h-4 w-6`,"aria-label":u(`soundsSections.previewSoundAriaLabel`,{filename:e})}),(0,C.jsx)(t,{variant:`ghost`,size:`compact`,iconOnly:(0,C.jsx)(y,{}),iconOnlyGlyphClassName:`[&_svg]:size-3`,expandOnMobile:!1,onClick:()=>c(e),className:`h-4 w-6`,"aria-label":u(`soundsSections.removeSoundAriaLabel`,{filename:e})})]})]},e)),i.length===0?(0,C.jsx)(`p`,{className:`text-body-small-default italic text-[var(--content-disabled)]`,children:u(`soundsSections.noSoundFiles`)}):g?(0,C.jsx)(`button`,{type:`button`,disabled:!0,className:`inline-flex items-center gap-1 rounded-md border border-[var(--border-base)] bg-white px-2 py-1 text-body-small-default text-[var(--content-disabled)] disabled:cursor-not-allowed dark:bg-[var(--surface-lift)] dark:text-[var(--content-tertiary)]`,children:u(`soundsSections.allSoundsAdded`)}):(0,C.jsxs)(`div`,{className:`relative inline-block`,children:[(0,C.jsxs)(`button`,{type:`button`,onClick:()=>p(e=>!e),className:`inline-flex items-center gap-1 rounded-md border border-[var(--border-base)] bg-white px-2 py-1 text-body-small-default text-[var(--content-default)] hover:bg-[var(--surface-base)] dark:bg-[var(--surface-lift)] dark:hover:bg-[var(--ghost-hover)]`,children:[u(`soundsSections.addSound`),(0,C.jsx)(b,{className:`h-3 w-3`})]}),f&&(0,C.jsx)(`div`,{className:`absolute left-0 z-10 mt-1 max-h-64 w-56 overflow-auto rounded-md border border-[var(--border-base)] bg-white p-1 shadow-lg dark:bg-[var(--surface-lift)]`,onMouseLeave:()=>p(!1),children:h.map(e=>(0,C.jsx)(`button`,{type:`button`,onClick:()=>{s(e.filename),p(!1)},className:`block w-full truncate rounded px-2 py-1 text-left text-body-small-default text-[var(--content-default)] hover:bg-[var(--surface-base)] dark:hover:bg-[var(--ghost-hover)]`,title:e.filename,children:e.label},e.filename))})]})]})]})}function k(){let{t:e}=m(`settings`),t=g(),r=s(),d=(0,S.useMemo)(()=>i({path:{assistant_id:r}}),[r]),_=(0,S.useMemo)(()=>a({path:{assistant_id:r}}),[r]),{data:v}=p(d),{data:y}=p(_),b=v??c(),w=y?.sounds??[],T=(0,S.useMemo)(()=>({path:{assistant_id:r}}),[r]),k=h({...u(T),onMutate:async e=>{await t.cancelQueries({queryKey:d.queryKey});let n=t.getQueryData(d.queryKey);return o(t,T,e.body),{previous:n}},onError:(e,n,r)=>{r?.previous!==void 0&&o(t,T,r.previous)},onSettled:()=>{t.invalidateQueries({queryKey:d.queryKey})}}),A=(0,S.useCallback)(e=>{let n=e(t.getQueryData(d.queryKey)??c());k.mutate({path:{assistant_id:r},body:n})},[r,d.queryKey,t,k]),j=e=>{A(t=>({...t,globalEnabled:e}))},M=e=>{A(t=>({...t,volume:e}))},[N,P]=(0,S.useState)(null),F=N??b.volume,I=(e,t)=>{A(n=>({...n,events:{...n.events,[e]:{...n.events[e]??{enabled:!1,sounds:[]},enabled:t}}}))},L=(e,t)=>{A(n=>{let r=n.events[e]??{enabled:!0,sounds:[]};return r.sounds.includes(t)?n:{...n,events:{...n.events,[e]:{...r,sounds:[...r.sounds,t]}}}})},R=(e,t)=>{A(n=>{let r=n.events[e];return r?{...n,events:{...n.events,[e]:{...r,sounds:r.sounds.filter(e=>e!==t)}}}:n})},z=()=>{f().previewFallbackBlip(b.volume)},B=e=>{f().previewSound(e,b.volume)};return(0,C.jsxs)(`div`,{className:`space-y-6`,children:[(0,C.jsxs)(n,{children:[(0,C.jsx)(E,{label:e(`soundsSections.enableSoundEffects`),description:e(`soundsSections.enableSoundEffectsDescription`),checked:b.globalEnabled,onChange:j}),(0,C.jsx)(D,{}),(0,C.jsxs)(`div`,{className:`flex items-center gap-3 py-3`,children:[(0,C.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:e(`soundsSections.volume`)}),(0,C.jsx)(`input`,{type:`range`,min:0,max:1,step:.05,value:F,onChange:e=>P(parseFloat(e.target.value)),onPointerUp:e=>{let t=parseFloat(e.currentTarget.value);P(null),t!==b.volume&&M(t)},onKeyUp:e=>{let t=parseFloat(e.currentTarget.value);P(null),t!==b.volume&&M(t)},onBlur:e=>{let t=parseFloat(e.currentTarget.value);P(null),t!==b.volume&&M(t)},className:`h-1 w-48 cursor-pointer`,disabled:!b.globalEnabled,"aria-label":e(`soundsSections.volumeAriaLabel`)}),(0,C.jsxs)(`span`,{className:`tabular-nums text-body-small-default text-[var(--content-tertiary)]`,children:[Math.round(F*100),`%`]})]}),(0,C.jsx)(D,{}),(0,C.jsxs)(`div`,{className:`flex items-center justify-between py-3`,children:[(0,C.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:e(`soundsSections.previewDefaultBlip`)}),(0,C.jsxs)(`button`,{type:`button`,onClick:z,disabled:!b.globalEnabled,className:`inline-flex cursor-pointer items-center gap-1.5 rounded-md border border-[var(--border-base)] bg-white px-3 py-1.5 text-body-medium-lighter text-[var(--content-default)] transition-colors hover:bg-[var(--surface-hover)] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-[var(--surface-lift)] dark:hover:bg-[var(--ghost-hover)]`,children:[(0,C.jsx)(x,{className:`h-3.5 w-3.5`}),e(`soundsSections.preview`)]})]})]}),(0,C.jsxs)(n,{children:[(0,C.jsxs)(`div`,{className:`pb-2`,children:[(0,C.jsx)(`h3`,{className:`text-title-small text-[var(--content-default)]`,children:e(`soundsSections.soundEventsTitle`)}),(0,C.jsx)(`p`,{className:`text-body-small-lighter text-[var(--content-tertiary)]`,children:e(`soundsSections.soundEventsDescription`)})]}),(0,C.jsx)(`div`,{className:`divide-y divide-[var(--border-base)]`,children:l.map(t=>(0,C.jsx)(O,{event:t,eventConfig:b.events[t]??{enabled:!1,sounds:[]},availableSounds:w,globalEnabled:b.globalEnabled,onToggle:e=>I(t,e),onAddSound:e=>L(t,e),onRemoveSound:e=>R(t,e),onPreview:e=>B(e),t:e},t))})]})]})}function A(){return(0,C.jsx)(k,{})}export{A as SoundsPage};
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$C as t,BC as n,DC as r,Dm as i,Em as a,Om as o,W as s,au as c,iu as l,km as u,ou as d,ru as f}from"./app-BEoekemj.js";import{$n as p,E as m,Xn as h,nr as g}from"./vendor-cVd2QlFV.js";import{t as _,x as v}from"./react-B9IgSVeK.js";import{A as y,qi as b,zt as x}from"./icons-C0wyat6T.js";var S=e(v(),1),C=_(),w={task_complete:`soundsSections.soundEventTaskComplete`,needs_input:`soundsSections.soundEventNeedsInput`,task_failed:`soundsSections.soundEventTaskFailed`,notification:`soundsSections.soundEventNotification`,new_conversation:`soundsSections.soundEventNewConversation`,message_sent:`soundsSections.soundEventMessageSent`,character_poke:`soundsSections.soundEventCharacterPoke`,random:`soundsSections.soundEventRandom`};function T(e,t){return t(w[e])}function E({label:e,description:t,checked:n,disabled:i,onChange:a}){return(0,C.jsxs)(`div`,{className:`flex items-center justify-between gap-3 py-1`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`div`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:e}),t&&(0,C.jsx)(`div`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:t})]}),(0,C.jsx)(r,{checked:n,disabled:i,onChange:a,label:e})]})}function D(){return(0,C.jsx)(`div`,{className:`border-t border-[var(--border-base)]`})}function O({event:e,eventConfig:n,availableSounds:i,globalEnabled:a,onToggle:o,onAddSound:s,onRemoveSound:c,onPreview:l,t:u}){let[f,p]=(0,S.useState)(!1),m=T(e,u),h=i.filter(e=>!n.sounds.includes(e.filename)),g=i.length>0&&h.length===0;return(0,C.jsxs)(`div`,{className:`py-3`,children:[(0,C.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,C.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:m}),(0,C.jsx)(r,{checked:n.enabled,disabled:!a,onChange:o,label:u(`soundsSections.enableEvent`,{eventName:m})})]}),n.enabled&&(0,C.jsxs)(`div`,{className:`mt-2 space-y-1 pl-2`,children:[n.sounds.length===0?(0,C.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:u(`soundsSections.defaultBlip`)}):n.sounds.map(e=>(0,C.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,C.jsx)(`span`,{className:`truncate text-body-small-default text-[var(--content-secondary)]`,title:e,children:d(e)}),(0,C.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,C.jsx)(t,{variant:`ghost`,size:`compact`,iconOnly:(0,C.jsx)(x,{}),iconOnlyGlyphClassName:`[&_svg]:size-3`,expandOnMobile:!1,onClick:()=>l(e),className:`h-4 w-6`,"aria-label":u(`soundsSections.previewSoundAriaLabel`,{filename:e})}),(0,C.jsx)(t,{variant:`ghost`,size:`compact`,iconOnly:(0,C.jsx)(y,{}),iconOnlyGlyphClassName:`[&_svg]:size-3`,expandOnMobile:!1,onClick:()=>c(e),className:`h-4 w-6`,"aria-label":u(`soundsSections.removeSoundAriaLabel`,{filename:e})})]})]},e)),i.length===0?(0,C.jsx)(`p`,{className:`text-body-small-default italic text-[var(--content-disabled)]`,children:u(`soundsSections.noSoundFiles`)}):g?(0,C.jsx)(`button`,{type:`button`,disabled:!0,className:`inline-flex items-center gap-1 rounded-md border border-[var(--border-base)] bg-white px-2 py-1 text-body-small-default text-[var(--content-disabled)] disabled:cursor-not-allowed dark:bg-[var(--surface-lift)] dark:text-[var(--content-tertiary)]`,children:u(`soundsSections.allSoundsAdded`)}):(0,C.jsxs)(`div`,{className:`relative inline-block`,children:[(0,C.jsxs)(`button`,{type:`button`,onClick:()=>p(e=>!e),className:`inline-flex items-center gap-1 rounded-md border border-[var(--border-base)] bg-white px-2 py-1 text-body-small-default text-[var(--content-default)] hover:bg-[var(--surface-base)] dark:bg-[var(--surface-lift)] dark:hover:bg-[var(--ghost-hover)]`,children:[u(`soundsSections.addSound`),(0,C.jsx)(b,{className:`h-3 w-3`})]}),f&&(0,C.jsx)(`div`,{className:`absolute left-0 z-10 mt-1 max-h-64 w-56 overflow-auto rounded-md border border-[var(--border-base)] bg-white p-1 shadow-lg dark:bg-[var(--surface-lift)]`,onMouseLeave:()=>p(!1),children:h.map(e=>(0,C.jsx)(`button`,{type:`button`,onClick:()=>{s(e.filename),p(!1)},className:`block w-full truncate rounded px-2 py-1 text-left text-body-small-default text-[var(--content-default)] hover:bg-[var(--surface-base)] dark:hover:bg-[var(--ghost-hover)]`,title:e.filename,children:e.label},e.filename))})]})]})]})}function k(){let{t:e}=m(`settings`),t=g(),r=s(),d=(0,S.useMemo)(()=>i({path:{assistant_id:r}}),[r]),_=(0,S.useMemo)(()=>a({path:{assistant_id:r}}),[r]),{data:v}=p(d),{data:y}=p(_),b=v??c(),w=y?.sounds??[],T=(0,S.useMemo)(()=>({path:{assistant_id:r}}),[r]),k=h({...u(T),onMutate:async e=>{await t.cancelQueries({queryKey:d.queryKey});let n=t.getQueryData(d.queryKey);return o(t,T,e.body),{previous:n}},onError:(e,n,r)=>{r?.previous!==void 0&&o(t,T,r.previous)},onSettled:()=>{t.invalidateQueries({queryKey:d.queryKey})}}),A=(0,S.useCallback)(e=>{let n=e(t.getQueryData(d.queryKey)??c());k.mutate({path:{assistant_id:r},body:n})},[r,d.queryKey,t,k]),j=e=>{A(t=>({...t,globalEnabled:e}))},M=e=>{A(t=>({...t,volume:e}))},[N,P]=(0,S.useState)(null),F=N??b.volume,I=(e,t)=>{A(n=>({...n,events:{...n.events,[e]:{...n.events[e]??{enabled:!1,sounds:[]},enabled:t}}}))},L=(e,t)=>{A(n=>{let r=n.events[e]??{enabled:!0,sounds:[]};return r.sounds.includes(t)?n:{...n,events:{...n.events,[e]:{...r,sounds:[...r.sounds,t]}}}})},R=(e,t)=>{A(n=>{let r=n.events[e];return r?{...n,events:{...n.events,[e]:{...r,sounds:r.sounds.filter(e=>e!==t)}}}:n})},z=()=>{f().previewFallbackBlip(b.volume)},B=e=>{f().previewSound(e,b.volume)};return(0,C.jsxs)(`div`,{className:`space-y-6`,children:[(0,C.jsxs)(n,{children:[(0,C.jsx)(E,{label:e(`soundsSections.enableSoundEffects`),description:e(`soundsSections.enableSoundEffectsDescription`),checked:b.globalEnabled,onChange:j}),(0,C.jsx)(D,{}),(0,C.jsxs)(`div`,{className:`flex items-center gap-3 py-3`,children:[(0,C.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:e(`soundsSections.volume`)}),(0,C.jsx)(`input`,{type:`range`,min:0,max:1,step:.05,value:F,onChange:e=>P(parseFloat(e.target.value)),onPointerUp:e=>{let t=parseFloat(e.currentTarget.value);P(null),t!==b.volume&&M(t)},onKeyUp:e=>{let t=parseFloat(e.currentTarget.value);P(null),t!==b.volume&&M(t)},onBlur:e=>{let t=parseFloat(e.currentTarget.value);P(null),t!==b.volume&&M(t)},className:`h-1 w-48 cursor-pointer`,disabled:!b.globalEnabled,"aria-label":e(`soundsSections.volumeAriaLabel`)}),(0,C.jsxs)(`span`,{className:`tabular-nums text-body-small-default text-[var(--content-tertiary)]`,children:[Math.round(F*100),`%`]})]}),(0,C.jsx)(D,{}),(0,C.jsxs)(`div`,{className:`flex items-center justify-between py-3`,children:[(0,C.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:e(`soundsSections.previewDefaultBlip`)}),(0,C.jsxs)(`button`,{type:`button`,onClick:z,disabled:!b.globalEnabled,className:`inline-flex cursor-pointer items-center gap-1.5 rounded-md border border-[var(--border-base)] bg-white px-3 py-1.5 text-body-medium-lighter text-[var(--content-default)] transition-colors hover:bg-[var(--surface-hover)] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-[var(--surface-lift)] dark:hover:bg-[var(--ghost-hover)]`,children:[(0,C.jsx)(x,{className:`h-3.5 w-3.5`}),e(`soundsSections.preview`)]})]})]}),(0,C.jsxs)(n,{children:[(0,C.jsxs)(`div`,{className:`pb-2`,children:[(0,C.jsx)(`h3`,{className:`text-title-small text-[var(--content-default)]`,children:e(`soundsSections.soundEventsTitle`)}),(0,C.jsx)(`p`,{className:`text-body-small-lighter text-[var(--content-tertiary)]`,children:e(`soundsSections.soundEventsDescription`)})]}),(0,C.jsx)(`div`,{className:`divide-y divide-[var(--border-base)]`,children:l.map(t=>(0,C.jsx)(O,{event:t,eventConfig:b.events[t]??{enabled:!1,sounds:[]},availableSounds:w,globalEnabled:b.globalEnabled,onToggle:e=>I(t,e),onAddSound:e=>L(t,e),onRemoveSound:e=>R(t,e),onPreview:e=>B(e),t:e},t))})]})]})}function A(){return(0,C.jsx)(k,{})}export{A as SoundsPage};
@@ -1 +1 @@
1
- import{$C as e,Oi as t,Si as n,ub as r,xS as i}from"./app-KRIEMzuO.js";import{E as a}from"./vendor-DLH51Vjf.js";import{f as o,t as s}from"./react-B9IgSVeK.js";var c=s();function l(){let{t:s}=a(`onboarding`),l=o();return(0,c.jsx)(n,{avatarWave:`around`,children:(0,c.jsx)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-xl flex-col items-center px-6 pb-40 md:min-h-full md:pb-6 text-[var(--content-default)]`,children:(0,c.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center`,children:[(0,c.jsx)(`h1`,{className:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:s(`welcome.title`)}),(0,c.jsx)(`p`,{className:`mt-3 text-center text-body-medium-lighter text-[var(--content-tertiary)]`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:s(`welcome.body`)}),(0,c.jsx)(`div`,{className:`mt-10 flex w-full max-w-sm flex-col`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`},children:(0,c.jsx)(e,{variant:`primary`,size:`large`,fullWidth:!0,onClick:()=>void l(`${i.onboarding.privacy}?${r}=1`,t),children:s(`startScreen.createAssistant`)})})]})})})}export{l as StartScreen};
1
+ import{$C as e,Oi as t,Si as n,ub as r,xS as i}from"./app-BEoekemj.js";import{E as a}from"./vendor-cVd2QlFV.js";import{f as o,t as s}from"./react-B9IgSVeK.js";var c=s();function l(){let{t:s}=a(`onboarding`),l=o();return(0,c.jsx)(n,{avatarWave:`around`,children:(0,c.jsx)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-xl flex-col items-center px-6 pb-40 md:min-h-full md:pb-6 text-[var(--content-default)]`,children:(0,c.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center`,children:[(0,c.jsx)(`h1`,{className:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:s(`welcome.title`)}),(0,c.jsx)(`p`,{className:`mt-3 text-center text-body-medium-lighter text-[var(--content-tertiary)]`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:s(`welcome.body`)}),(0,c.jsx)(`div`,{className:`mt-10 flex w-full max-w-sm flex-col`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`},children:(0,c.jsx)(e,{variant:`primary`,size:`large`,fullWidth:!0,onClick:()=>void l(`${i.onboarding.privacy}?${r}=1`,t),children:s(`startScreen.createAssistant`)})})]})})})}export{l as StartScreen};
@@ -1 +1 @@
1
- import{Fn as e,Ih as t,Zr as n,vt as r}from"./app-KRIEMzuO.js";import{E as i}from"./vendor-DLH51Vjf.js";import{t as a}from"./react-B9IgSVeK.js";import{xa as o}from"./icons-C0wyat6T.js";import{c as s,i as c}from"./tool-detail-panel-nu-dK5jf.js";var l=a();function u(e){return e.kind===`web_search`?`globe`:e.kind===`thinking`?`brain`:n(e.toolName,e.input).iconName}function d({detail:n,source:i}){let a=s(i,n.toolCallId);return(a?t(a):n.status===`running`)?(0,l.jsx)(e,{className:`shrink-0`,"data-testid":`nested-detail-running`}):(0,l.jsx)(r[u(n)]??o,{"aria-hidden":!0,className:`h-5 w-5 shrink-0 text-[var(--content-secondary)]`})}function f(e){let{t}=i(`chat`);return e?e.kind===`thinking`?t(`thinkingDetail.title`):c(e):``}export{f as n,d as t};
1
+ import{Fn as e,Ih as t,Zr as n,vt as r}from"./app-BEoekemj.js";import{E as i}from"./vendor-cVd2QlFV.js";import{t as a}from"./react-B9IgSVeK.js";import{xa as o}from"./icons-C0wyat6T.js";import{c as s,i as c}from"./tool-detail-panel-CQ-R1S2x.js";var l=a();function u(e){return e.kind===`web_search`?`globe`:e.kind===`thinking`?`brain`:n(e.toolName,e.input).iconName}function d({detail:n,source:i}){let a=s(i,n.toolCallId);return(a?t(a):n.status===`running`)?(0,l.jsx)(e,{className:`shrink-0`,"data-testid":`nested-detail-running`}):(0,l.jsx)(r[u(n)]??o,{"aria-hidden":!0,className:`h-5 w-5 shrink-0 text-[var(--content-secondary)]`})}function f(e){let{t}=i(`chat`);return e?e.kind===`thinking`?t(`thinkingDetail.title`):c(e):``}export{f as n,d as t};
@@ -1 +1 @@
1
- import{gC as e,q as t}from"./app-KRIEMzuO.js";import{E as n}from"./vendor-DLH51Vjf.js";import{t as r}from"./react-B9IgSVeK.js";var i=r();function a({open:r,onOpenChange:a,title:o,currentCode:s,configuredProviderId:c,suggestedCode:l,selectLanguage:u,selecting:d}){let{t:f}=n();return(0,i.jsx)(e.Root,{open:r,onOpenChange:a,children:(0,i.jsxs)(e.Content,{size:`sm`,onOpenAutoFocus:e=>{e.preventDefault(),e.target?.querySelector(`input[role="combobox"]`)?.focus()},children:[(0,i.jsxs)(e.Header,{children:[(0,i.jsx)(e.Title,{children:o}),(0,i.jsx)(e.Description,{children:f(`sttLanguagePickerModal.description`)})]}),(0,i.jsx)(e.Body,{children:(0,i.jsx)(t,{currentCode:s,configuredProviderId:c,suggestedCode:l,selectLanguage:u,selecting:d,onDone:()=>a(!1)})})]})})}export{a as t};
1
+ import{gC as e,q as t}from"./app-BEoekemj.js";import{E as n}from"./vendor-cVd2QlFV.js";import{t as r}from"./react-B9IgSVeK.js";var i=r();function a({open:r,onOpenChange:a,title:o,currentCode:s,configuredProviderId:c,suggestedCode:l,selectLanguage:u,selecting:d}){let{t:f}=n();return(0,i.jsx)(e.Root,{open:r,onOpenChange:a,children:(0,i.jsxs)(e.Content,{size:`sm`,onOpenAutoFocus:e=>{e.preventDefault(),e.target?.querySelector(`input[role="combobox"]`)?.focus()},children:[(0,i.jsxs)(e.Header,{children:[(0,i.jsx)(e.Title,{children:o}),(0,i.jsx)(e.Description,{children:f(`sttLanguagePickerModal.description`)})]}),(0,i.jsx)(e.Body,{children:(0,i.jsx)(t,{currentCode:s,configuredProviderId:c,suggestedCode:l,selectLanguage:u,selecting:d,onDone:()=>a(!1)})})]})})}export{a as t};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$C as t,$r as n,Dt as r,Et as i,Gr as a,HC as o,In as s,Kn as c,Kr as l,Ot as u,Qr as d,Rn as f,St as p,Su as m,Ti as h,Tt as g,Un as _,Xr as v,Yo as y,_t as b,_u as x,bt as S,bu as C,gt as w,ht as T,mt as E,nx as D,vu as O,wt as k,xt as A,xu as j,zn as M}from"./app-KRIEMzuO.js";import{E as N,d as P,f as ee,s as te}from"./vendor-DLH51Vjf.js";import{t as F,x as I}from"./react-B9IgSVeK.js";import{Cr as L,Gi as R,Ha as z,Ki as B,ha as V}from"./icons-C0wyat6T.js";import{n as H,r as U,t as W}from"./animated-stat-square-gKVZj83m.js";import{o as G,t as K}from"./detail-primitives-BHVQRcGw.js";import{t as ne}from"./detail-panel-stop-button-t_VDZYtt.js";import{t as q}from"./status-badge-pill-TVPV4D5e.js";import{a as J,c as re,l as ie,n as ae,s as oe,t as se}from"./tool-detail-panel-nu-dK5jf.js";import{n as ce,t as le}from"./step-detail-header-C0_Bji0I.js";var Y=e(I(),1),X=F();function ue({status:e}){return(0,X.jsx)(q,{color:j(e),label:m(e)})}function de(e,t){let n=D.use.activeAssistantId(),r=t??n,{subagentId:i,conversationId:a}=e,o=e.history===null;return(0,Y.useEffect)(()=>{o&&r&&a&&x.getState().loadHistoryIfNeeded(r,i)},[o,r,i,a]),(0,Y.useCallback)(()=>r?x.getState().loadHistoryIfNeeded(r,i):Promise.resolve(),[r,i])}function Z(e,t){let n=e.steps[0];return`${t}-${e.label}-${n?g(n,t):``}`}function Q(e){for(let t=e.steps.length-1;t>=0;t--){let n=e.steps[t];if(n.kind===`tool`&&n.status===`running`||n.kind===`web_search`&&n.title===`Searching the web`)return n}}function fe(e,t){return e&&e.kind===`tool`&&(e.activity||e.info)||t}function pe(e){for(let t=e.steps.length-1;t>=0;t--){let n=e.steps[t];if(n.kind===`web_search`&&n.query)return n.query}}function me(e){for(let t=e.steps.length-1;t>=0;t--){let n=e.steps[t];if(n.kind===`thinking`&&n.text)return v(n.text)}}function he(e){if(e.kind===`tool`)return e.toolCallId||void 0;if(e.kind===`thinking`||e.kind===`web_search`||e.kind===`web_search_error`)return e.detailKey}function ge({steps:e,onStepDetailClick:t,expandedKeys:n,onExpandedKeysChange:r,isRunning:i=!1}){let[a,o]=(0,Y.useState)(new Set),s=n??a,c=(0,Y.useCallback)(e=>{let t=t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n};if(r){r(t);return}o(t)},[r]),l=(0,Y.useMemo)(()=>p(e),[e]);return l.length===0?null:(0,X.jsx)(`div`,{className:`flex w-full flex-col`,children:l.map((e,n)=>{let r=Z(e,n),a=n===l.length-1;return(0,X.jsx)(_e,{section:e,isLast:a,isActiveTail:a&&i,expanded:s.has(r),sectionKeyValue:r,onToggle:c,onStepDetailClick:t},r)})})}var _e=(0,Y.memo)(function({section:e,isLast:t,isActiveTail:n,expanded:a,sectionKeyValue:c,onToggle:l,onStepDetailClick:d}){let{t:f}=N(`chat`),p=u(),m=te(),h=k(e.steps),_=h===`running`&&!n?`completed`:h,x=_===`running`||n,C=e.steps[0]?.kind===`thinking`,D=e.steps.length,O=e.label===`Searching the web`,j=O?pe(e):void 0,M=D>=2,F=e.steps.some(e=>i(e,p)||!!d&&!!he(e)),I=_===`running`?``:r(e.steps.map(e=>`durationLabel`in e?e.durationLabel:``)),R=_===`running`?Q(e):void 0,z=_===`running`&&!O?fe(R,e.label):``,B=O&&(_===`running`||!!j),H=j??e.label,U=C&&x,W=U?me(e)??e.label:void 0,G=_===`running`||B||U||!!I,K=`${D} step${D===1?``:`s`}`;return(0,X.jsxs)(`div`,{"data-testid":`subagent-phase-section`,"data-phase-label":e.label,className:y(`relative flex flex-col gap-2`,!t&&`pb-4`),children:[!t&&(0,X.jsx)(S,{className:`top-[17.5px] -bottom-[4.5px]`}),(0,X.jsxs)(`button`,{type:`button`,"data-testid":`subagent-phase-header`,disabled:!F,"aria-expanded":F?a:void 0,onClick:F?()=>l(c):void 0,className:y(`flex h-[22px] w-full items-center gap-2 text-left`,F&&`cursor-pointer`),children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:`flex h-[14px] w-[14px] shrink-0 items-center justify-center`,children:(0,X.jsx)(`span`,{className:`h-[5px] w-[5px] rounded-full bg-[var(--content-disabled)]`})}),(0,X.jsx)(A,{status:x?`running`:_,isThinking:C&&!x}),(0,X.jsx)(o,{variant:`body-medium-default`,className:`shrink-0 text-[var(--content-default)]`,children:e.label}),G&&(0,X.jsx)(`span`,{"aria-hidden":!0,className:`shrink-0 leading-none text-[var(--content-tertiary)] opacity-10`,children:`|`}),B?(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1`,children:[(0,X.jsx)(L,{"aria-hidden":`true`,className:`h-3.5 w-3.5 shrink-0 text-[var(--content-tertiary)]`}),(0,X.jsx)(s,{currentStepTitle:``,currentStepInfo:H})]}):U?(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1`,children:[(0,X.jsx)(V,{"aria-hidden":`true`,className:`h-3.5 w-3.5 shrink-0 text-[var(--content-tertiary)]`}),(0,X.jsx)(s,{currentStepTitle:``,currentStepInfo:W??e.label})]}):_===`running`?(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1`,children:[(0,X.jsx)(V,{"aria-hidden":`true`,className:`h-3.5 w-3.5 shrink-0 text-[var(--content-tertiary)]`}),(0,X.jsx)(s,{currentStepTitle:``,currentStepInfo:z})]}):I?(0,X.jsx)(o,{variant:`body-small-default`,className:`min-w-0 truncate text-[var(--content-tertiary)]`,children:f(`subagentPhaseTimeline.workedFor`,{duration:I})}):null,F&&M&&(0,X.jsx)(`span`,{"data-testid":`subagent-phase-step-count`,className:`ml-auto inline-flex shrink-0 items-center self-stretch whitespace-nowrap rounded-full bg-[var(--surface-base)] px-2`,children:(0,X.jsx)(o,{variant:`body-small-default`,className:`whitespace-nowrap text-[var(--content-secondary)]`,children:K})})]}),(0,X.jsx)(ee,{initial:!1,children:F&&a&&(0,X.jsx)(P.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:m?{duration:0}:{duration:.25,ease:[.16,1,.3,1]},className:`overflow-hidden`,children:(0,X.jsx)(`div`,{className:`flex flex-col items-start gap-1 pl-[22px]`,children:e.steps.map((e,t)=>{let n=d?he(e):void 0;if(n&&d){if(e.kind===`tool`)return(0,X.jsx)(w,{variant:`tool`,iconName:e.iconName,label:p({activity:e.activity,actionDisplayKey:e.actionDisplayKey,fallback:e.activity||e.info||e.title}),ariaLabel:f(`subagentPhaseTimeline.viewToolDetails`),onClick:()=>d(n)},g(e,t));if(e.kind===`thinking`)return(0,X.jsx)(w,{variant:`tool`,iconName:`brain`,label:v(e.text),ariaLabel:f(`subagentPhaseTimeline.viewReasoning`),onClick:()=>d(n)},g(e,t));if(e.kind===`web_search`)return(0,X.jsx)(w,{variant:`tool`,iconName:`globe`,label:e.query||e.title,ariaLabel:f(`subagentPhaseTimeline.viewSearchDetails`),onClick:()=>d(n)},g(e,t));if(e.kind===`web_search_error`)return(0,X.jsx)(w,{variant:`tool`,iconName:`globe`,label:e.errorMessage,ariaLabel:f(`subagentPhaseTimeline.viewSearchError`),onClick:()=>d(n)},g(e,t))}return e.kind===`web_search`?(0,X.jsxs)(`div`,{className:`flex w-full flex-col gap-1`,children:[e.query?(0,X.jsx)(o,{variant:`body-small-default`,className:`text-[var(--content-secondary)]`,children:`"${e.query}"`}):null,(0,X.jsx)(T,{step:e})]},g(e,t)):e.kind===`web_search_error`?(0,X.jsx)(E,{step:e},g(e,t)):(0,X.jsx)(b,{step:e},g(e,t))})})},`phase-steps`)})]})});function $(e){return new Map(e.map(e=>[e.toolCallId,e]))}function ve(e=a){let t=null,r=[],i=[],o=new Map;function s(n){let a=[],s=[];for(let t of n)e(a,s,t);return t=n,r=a,i=s,o=$(r),o}function c(a){let c=n(t,a);switch(c.kind){case`identity`:return o;case`first`:return s(a);case`append`:{let n=a.length,s=r.slice(),l=i.slice();for(let t=c.from;t<n;t++)e(s,l,a[t]);return t=a,r=s,i=l,o=$(r),o}case`mutate-last`:{let n=a.length,s=r.slice(),c=i.slice(),l=s[s.length-1];return l&&l.kind===`thinking`&&l.toolCallId===a[n-1].id&&(s.pop(),c.pop()),e(s,c,a[n-1]),t=a,r=s,i=c,o=$(r),o}case`fallback`:return s(a)}}return{project:c}}function ye(e){let t=(0,Y.useRef)(null);return t.current??=ve(),t.current.project(e)}var be={running:0,completed:1,error:2,denied:2};function xe(e,t){return{...e,kind:e.kind??t.kind,result:e.result??t.result,streamedOutput:e.streamedOutput??t.streamedOutput,durationLabel:e.durationLabel||t.durationLabel,searchQuery:e.searchQuery||t.searchQuery,searchResults:e.searchResults?.length?e.searchResults:t.searchResults??e.searchResults,status:be[t.status]>be[e.status]?t.status:e.status}}function Se(e,t){return e?t?xe(l(Object.keys(e.input).length>0?e:{...e,input:t.input}),t):l(e):t}function Ce({entry:e,onClose:n,onStop:r,onRequestDetail:i,assistantId:a}){let{t:s}=N(`chat`),l=C(e.status),u=te(),p=h(),m=(0,Y.useMemo)(()=>f(e.subagentId),[e.subagentId]),{steps:g}=d(e.events),v=ye(e.events),y=(0,Y.useMemo)(()=>({kind:`subagent`,subagentId:e.subagentId}),[e.subagentId]),b=de(e,a),[x,S]=(0,Y.useState)(null),w=(0,Y.useRef)(v),T=(0,Y.useRef)(e.history);(0,Y.useLayoutEffect)(()=>{w.current=v,T.current=e.history},[v,e.history]);let E=(0,Y.useCallback)(e=>{T.current===null&&b(),(w.current.has(e)||oe(T.current?.messages??[],e))&&S(e)},[b]),[D,k]=(0,Y.useState)(new Set),[A,j]=(0,Y.useState)(!1),[ee,F]=(0,Y.useState)(e.subagentId);ee!==e.subagentId&&(F(e.subagentId),j(!1),S(null),k(new Set));let I=O(e);(0,Y.useEffect)(()=>{i&&I&&e.events.length===0&&i(e.subagentId)},[e.subagentId,I,e.events.length,i]);let L=Se(re(y,x),x?v.get(x):void 0),V=(0,Y.useCallback)(()=>S(null),[]),q=ce(L),Z=L?q:e.label,Q=!!(L&&L.kind!==`thinking`);return(0,X.jsx)(_,{headerAbove:L&&(0,X.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-[var(--border-hover)] px-5 py-3`,children:[(0,X.jsx)(t,{variant:`link`,onClick:V,title:e.label,className:`inline-flex min-w-0 shrink border-0 text-left text-[color:var(--content-default)]`,children:(0,X.jsx)(o,{variant:`body-small-default`,as:`span`,className:`min-w-0 truncate`,children:e.label})}),(0,X.jsx)(R,{className:`h-2.5 w-2.5 shrink-0 text-[var(--content-tertiary)]`,"aria-hidden":!0}),(0,X.jsx)(o,{variant:`body-small-default`,as:`span`,title:q,className:`min-w-0 shrink truncate text-[var(--content-secondary)]`,children:q})]}),icon:(0,X.jsxs)(X.Fragment,{children:[L&&(0,X.jsx)(t,{variant:`outlined`,iconOnly:(0,X.jsx)(B,{}),onClick:V,"aria-label":s(`subagentDetailPanel.backToTimelineAria`),tooltip:s(`subagentDetailPanel.backTooltip`),className:`shrink-0`}),L?(0,X.jsx)(le,{detail:L,source:J}):p?(0,X.jsx)(M,{components:p,bodyShapeId:m.bodyShape,eyeStyleId:m.eyeStyle,colorId:m.color,size:32}):(0,X.jsx)(`div`,{style:{width:32,height:32,flexShrink:0},"aria-hidden":!0})]}),title:Q?void 0:Z,titleNode:Q&&L?(0,X.jsx)(ae,{detail:L,source:J}):void 0,headerTrailing:(0,X.jsx)(ue,{status:e.status}),headerActions:l&&r?(0,X.jsx)(ne,{onStop:()=>r(e.subagentId),ariaLabel:s(`subagentDetailPanel.stopSubagentAria`)}):void 0,closeLabel:s(`subagentDetailPanel.closeDetail`),onClose:n,children:(0,X.jsx)(P.div,{className:`flex flex-col gap-5`,initial:{opacity:0},animate:{opacity:1},transition:u?{duration:0}:{duration:.18,ease:[.16,1,.3,1]},children:L?(0,X.jsx)(X.Fragment,{children:L.kind===`thinking`?(0,X.jsx)(ie,{detail:L,assistantId:a}):(0,X.jsx)(se,{detail:L,source:J,assistantId:a})}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,X.jsx)(W,{icon:(0,X.jsx)(z,{}),target:e.inputTokens,format:e=>H(Math.round(e)),label:s(`subagentDetailPanel.input`)}),(0,X.jsx)(W,{icon:(0,X.jsx)(U,{}),target:e.outputTokens,format:e=>H(Math.round(e)),label:s(`subagentDetailPanel.output`)})]}),e.objective&&(0,X.jsxs)(`div`,{children:[(0,X.jsx)(G,{as:`h3`,children:s(`subagentDetailPanel.objective`)}),(0,X.jsx)(K,{label:s(`subagentDetailPanel.objective`),expanded:A,onExpandedChange:j,children:(0,X.jsx)(o,{variant:`body-medium-lighter`,as:`p`,className:`whitespace-pre-wrap break-words leading-relaxed text-[var(--content-default)]`,children:e.objective})},e.subagentId),(0,X.jsx)(`div`,{className:`mt-5 h-px w-full bg-[var(--border-hover)]`})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(G,{as:`h3`,children:s(`subagentDetailPanel.timeline`)}),e.events.length>0?(0,X.jsx)(ge,{steps:g,expandedKeys:D,onExpandedKeysChange:k,onStepDetailClick:E,isRunning:l},e.subagentId):(0,X.jsx)(c,{placement:`section`,children:s(`subagentDetailPanel.noEventsYet`)})]})]})},L?`detail`:`list`)})}export{Ce as SubagentDetailPanel};
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$C as t,$r as n,Dt as r,Et as i,Gr as a,HC as o,In as s,Kn as c,Kr as l,Ot as u,Qr as d,Rn as f,St as p,Su as m,Ti as h,Tt as g,Un as _,Xr as v,Yo as y,_t as b,_u as x,bt as S,bu as C,gt as w,ht as T,mt as E,nx as D,vu as O,wt as k,xt as A,xu as j,zn as M}from"./app-BEoekemj.js";import{E as N,d as P,f as ee,s as te}from"./vendor-cVd2QlFV.js";import{t as F,x as I}from"./react-B9IgSVeK.js";import{Cr as L,Gi as R,Ha as z,Ki as B,ha as V}from"./icons-C0wyat6T.js";import{n as H,r as U,t as W}from"./animated-stat-square-DfspueEE.js";import{o as G,t as K}from"./detail-primitives-DbHxZutJ.js";import{t as ne}from"./detail-panel-stop-button-9gdxgBZq.js";import{t as q}from"./status-badge-pill-TVPV4D5e.js";import{a as J,c as re,l as ie,n as ae,s as oe,t as se}from"./tool-detail-panel-CQ-R1S2x.js";import{n as ce,t as le}from"./step-detail-header-LQsSbC2J.js";var Y=e(I(),1),X=F();function ue({status:e}){return(0,X.jsx)(q,{color:j(e),label:m(e)})}function de(e,t){let n=D.use.activeAssistantId(),r=t??n,{subagentId:i,conversationId:a}=e,o=e.history===null;return(0,Y.useEffect)(()=>{o&&r&&a&&x.getState().loadHistoryIfNeeded(r,i)},[o,r,i,a]),(0,Y.useCallback)(()=>r?x.getState().loadHistoryIfNeeded(r,i):Promise.resolve(),[r,i])}function Z(e,t){let n=e.steps[0];return`${t}-${e.label}-${n?g(n,t):``}`}function Q(e){for(let t=e.steps.length-1;t>=0;t--){let n=e.steps[t];if(n.kind===`tool`&&n.status===`running`||n.kind===`web_search`&&n.title===`Searching the web`)return n}}function fe(e,t){return e&&e.kind===`tool`&&(e.activity||e.info)||t}function pe(e){for(let t=e.steps.length-1;t>=0;t--){let n=e.steps[t];if(n.kind===`web_search`&&n.query)return n.query}}function me(e){for(let t=e.steps.length-1;t>=0;t--){let n=e.steps[t];if(n.kind===`thinking`&&n.text)return v(n.text)}}function he(e){if(e.kind===`tool`)return e.toolCallId||void 0;if(e.kind===`thinking`||e.kind===`web_search`||e.kind===`web_search_error`)return e.detailKey}function ge({steps:e,onStepDetailClick:t,expandedKeys:n,onExpandedKeysChange:r,isRunning:i=!1}){let[a,o]=(0,Y.useState)(new Set),s=n??a,c=(0,Y.useCallback)(e=>{let t=t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n};if(r){r(t);return}o(t)},[r]),l=(0,Y.useMemo)(()=>p(e),[e]);return l.length===0?null:(0,X.jsx)(`div`,{className:`flex w-full flex-col`,children:l.map((e,n)=>{let r=Z(e,n),a=n===l.length-1;return(0,X.jsx)(_e,{section:e,isLast:a,isActiveTail:a&&i,expanded:s.has(r),sectionKeyValue:r,onToggle:c,onStepDetailClick:t},r)})})}var _e=(0,Y.memo)(function({section:e,isLast:t,isActiveTail:n,expanded:a,sectionKeyValue:c,onToggle:l,onStepDetailClick:d}){let{t:f}=N(`chat`),p=u(),m=te(),h=k(e.steps),_=h===`running`&&!n?`completed`:h,x=_===`running`||n,C=e.steps[0]?.kind===`thinking`,D=e.steps.length,O=e.label===`Searching the web`,j=O?pe(e):void 0,M=D>=2,F=e.steps.some(e=>i(e,p)||!!d&&!!he(e)),I=_===`running`?``:r(e.steps.map(e=>`durationLabel`in e?e.durationLabel:``)),R=_===`running`?Q(e):void 0,z=_===`running`&&!O?fe(R,e.label):``,B=O&&(_===`running`||!!j),H=j??e.label,U=C&&x,W=U?me(e)??e.label:void 0,G=_===`running`||B||U||!!I,K=`${D} step${D===1?``:`s`}`;return(0,X.jsxs)(`div`,{"data-testid":`subagent-phase-section`,"data-phase-label":e.label,className:y(`relative flex flex-col gap-2`,!t&&`pb-4`),children:[!t&&(0,X.jsx)(S,{className:`top-[17.5px] -bottom-[4.5px]`}),(0,X.jsxs)(`button`,{type:`button`,"data-testid":`subagent-phase-header`,disabled:!F,"aria-expanded":F?a:void 0,onClick:F?()=>l(c):void 0,className:y(`flex h-[22px] w-full items-center gap-2 text-left`,F&&`cursor-pointer`),children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:`flex h-[14px] w-[14px] shrink-0 items-center justify-center`,children:(0,X.jsx)(`span`,{className:`h-[5px] w-[5px] rounded-full bg-[var(--content-disabled)]`})}),(0,X.jsx)(A,{status:x?`running`:_,isThinking:C&&!x}),(0,X.jsx)(o,{variant:`body-medium-default`,className:`shrink-0 text-[var(--content-default)]`,children:e.label}),G&&(0,X.jsx)(`span`,{"aria-hidden":!0,className:`shrink-0 leading-none text-[var(--content-tertiary)] opacity-10`,children:`|`}),B?(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1`,children:[(0,X.jsx)(L,{"aria-hidden":`true`,className:`h-3.5 w-3.5 shrink-0 text-[var(--content-tertiary)]`}),(0,X.jsx)(s,{currentStepTitle:``,currentStepInfo:H})]}):U?(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1`,children:[(0,X.jsx)(V,{"aria-hidden":`true`,className:`h-3.5 w-3.5 shrink-0 text-[var(--content-tertiary)]`}),(0,X.jsx)(s,{currentStepTitle:``,currentStepInfo:W??e.label})]}):_===`running`?(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1`,children:[(0,X.jsx)(V,{"aria-hidden":`true`,className:`h-3.5 w-3.5 shrink-0 text-[var(--content-tertiary)]`}),(0,X.jsx)(s,{currentStepTitle:``,currentStepInfo:z})]}):I?(0,X.jsx)(o,{variant:`body-small-default`,className:`min-w-0 truncate text-[var(--content-tertiary)]`,children:f(`subagentPhaseTimeline.workedFor`,{duration:I})}):null,F&&M&&(0,X.jsx)(`span`,{"data-testid":`subagent-phase-step-count`,className:`ml-auto inline-flex shrink-0 items-center self-stretch whitespace-nowrap rounded-full bg-[var(--surface-base)] px-2`,children:(0,X.jsx)(o,{variant:`body-small-default`,className:`whitespace-nowrap text-[var(--content-secondary)]`,children:K})})]}),(0,X.jsx)(ee,{initial:!1,children:F&&a&&(0,X.jsx)(P.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:m?{duration:0}:{duration:.25,ease:[.16,1,.3,1]},className:`overflow-hidden`,children:(0,X.jsx)(`div`,{className:`flex flex-col items-start gap-1 pl-[22px]`,children:e.steps.map((e,t)=>{let n=d?he(e):void 0;if(n&&d){if(e.kind===`tool`)return(0,X.jsx)(w,{variant:`tool`,iconName:e.iconName,label:p({activity:e.activity,actionDisplayKey:e.actionDisplayKey,fallback:e.activity||e.info||e.title}),ariaLabel:f(`subagentPhaseTimeline.viewToolDetails`),onClick:()=>d(n)},g(e,t));if(e.kind===`thinking`)return(0,X.jsx)(w,{variant:`tool`,iconName:`brain`,label:v(e.text),ariaLabel:f(`subagentPhaseTimeline.viewReasoning`),onClick:()=>d(n)},g(e,t));if(e.kind===`web_search`)return(0,X.jsx)(w,{variant:`tool`,iconName:`globe`,label:e.query||e.title,ariaLabel:f(`subagentPhaseTimeline.viewSearchDetails`),onClick:()=>d(n)},g(e,t));if(e.kind===`web_search_error`)return(0,X.jsx)(w,{variant:`tool`,iconName:`globe`,label:e.errorMessage,ariaLabel:f(`subagentPhaseTimeline.viewSearchError`),onClick:()=>d(n)},g(e,t))}return e.kind===`web_search`?(0,X.jsxs)(`div`,{className:`flex w-full flex-col gap-1`,children:[e.query?(0,X.jsx)(o,{variant:`body-small-default`,className:`text-[var(--content-secondary)]`,children:`"${e.query}"`}):null,(0,X.jsx)(T,{step:e})]},g(e,t)):e.kind===`web_search_error`?(0,X.jsx)(E,{step:e},g(e,t)):(0,X.jsx)(b,{step:e},g(e,t))})})},`phase-steps`)})]})});function $(e){return new Map(e.map(e=>[e.toolCallId,e]))}function ve(e=a){let t=null,r=[],i=[],o=new Map;function s(n){let a=[],s=[];for(let t of n)e(a,s,t);return t=n,r=a,i=s,o=$(r),o}function c(a){let c=n(t,a);switch(c.kind){case`identity`:return o;case`first`:return s(a);case`append`:{let n=a.length,s=r.slice(),l=i.slice();for(let t=c.from;t<n;t++)e(s,l,a[t]);return t=a,r=s,i=l,o=$(r),o}case`mutate-last`:{let n=a.length,s=r.slice(),c=i.slice(),l=s[s.length-1];return l&&l.kind===`thinking`&&l.toolCallId===a[n-1].id&&(s.pop(),c.pop()),e(s,c,a[n-1]),t=a,r=s,i=c,o=$(r),o}case`fallback`:return s(a)}}return{project:c}}function ye(e){let t=(0,Y.useRef)(null);return t.current??=ve(),t.current.project(e)}var be={running:0,completed:1,error:2,denied:2};function xe(e,t){return{...e,kind:e.kind??t.kind,result:e.result??t.result,streamedOutput:e.streamedOutput??t.streamedOutput,durationLabel:e.durationLabel||t.durationLabel,searchQuery:e.searchQuery||t.searchQuery,searchResults:e.searchResults?.length?e.searchResults:t.searchResults??e.searchResults,status:be[t.status]>be[e.status]?t.status:e.status}}function Se(e,t){return e?t?xe(l(Object.keys(e.input).length>0?e:{...e,input:t.input}),t):l(e):t}function Ce({entry:e,onClose:n,onStop:r,onRequestDetail:i,assistantId:a}){let{t:s}=N(`chat`),l=C(e.status),u=te(),p=h(),m=(0,Y.useMemo)(()=>f(e.subagentId),[e.subagentId]),{steps:g}=d(e.events),v=ye(e.events),y=(0,Y.useMemo)(()=>({kind:`subagent`,subagentId:e.subagentId}),[e.subagentId]),b=de(e,a),[x,S]=(0,Y.useState)(null),w=(0,Y.useRef)(v),T=(0,Y.useRef)(e.history);(0,Y.useLayoutEffect)(()=>{w.current=v,T.current=e.history},[v,e.history]);let E=(0,Y.useCallback)(e=>{T.current===null&&b(),(w.current.has(e)||oe(T.current?.messages??[],e))&&S(e)},[b]),[D,k]=(0,Y.useState)(new Set),[A,j]=(0,Y.useState)(!1),[ee,F]=(0,Y.useState)(e.subagentId);ee!==e.subagentId&&(F(e.subagentId),j(!1),S(null),k(new Set));let I=O(e);(0,Y.useEffect)(()=>{i&&I&&e.events.length===0&&i(e.subagentId)},[e.subagentId,I,e.events.length,i]);let L=Se(re(y,x),x?v.get(x):void 0),V=(0,Y.useCallback)(()=>S(null),[]),q=ce(L),Z=L?q:e.label,Q=!!(L&&L.kind!==`thinking`);return(0,X.jsx)(_,{headerAbove:L&&(0,X.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-[var(--border-hover)] px-5 py-3`,children:[(0,X.jsx)(t,{variant:`link`,onClick:V,title:e.label,className:`inline-flex min-w-0 shrink border-0 text-left text-[color:var(--content-default)]`,children:(0,X.jsx)(o,{variant:`body-small-default`,as:`span`,className:`min-w-0 truncate`,children:e.label})}),(0,X.jsx)(R,{className:`h-2.5 w-2.5 shrink-0 text-[var(--content-tertiary)]`,"aria-hidden":!0}),(0,X.jsx)(o,{variant:`body-small-default`,as:`span`,title:q,className:`min-w-0 shrink truncate text-[var(--content-secondary)]`,children:q})]}),icon:(0,X.jsxs)(X.Fragment,{children:[L&&(0,X.jsx)(t,{variant:`outlined`,iconOnly:(0,X.jsx)(B,{}),onClick:V,"aria-label":s(`subagentDetailPanel.backToTimelineAria`),tooltip:s(`subagentDetailPanel.backTooltip`),className:`shrink-0`}),L?(0,X.jsx)(le,{detail:L,source:J}):p?(0,X.jsx)(M,{components:p,bodyShapeId:m.bodyShape,eyeStyleId:m.eyeStyle,colorId:m.color,size:32}):(0,X.jsx)(`div`,{style:{width:32,height:32,flexShrink:0},"aria-hidden":!0})]}),title:Q?void 0:Z,titleNode:Q&&L?(0,X.jsx)(ae,{detail:L,source:J}):void 0,headerTrailing:(0,X.jsx)(ue,{status:e.status}),headerActions:l&&r?(0,X.jsx)(ne,{onStop:()=>r(e.subagentId),ariaLabel:s(`subagentDetailPanel.stopSubagentAria`)}):void 0,closeLabel:s(`subagentDetailPanel.closeDetail`),onClose:n,children:(0,X.jsx)(P.div,{className:`flex flex-col gap-5`,initial:{opacity:0},animate:{opacity:1},transition:u?{duration:0}:{duration:.18,ease:[.16,1,.3,1]},children:L?(0,X.jsx)(X.Fragment,{children:L.kind===`thinking`?(0,X.jsx)(ie,{detail:L,assistantId:a}):(0,X.jsx)(se,{detail:L,source:J,assistantId:a})}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,X.jsx)(W,{icon:(0,X.jsx)(z,{}),target:e.inputTokens,format:e=>H(Math.round(e)),label:s(`subagentDetailPanel.input`)}),(0,X.jsx)(W,{icon:(0,X.jsx)(U,{}),target:e.outputTokens,format:e=>H(Math.round(e)),label:s(`subagentDetailPanel.output`)})]}),e.objective&&(0,X.jsxs)(`div`,{children:[(0,X.jsx)(G,{as:`h3`,children:s(`subagentDetailPanel.objective`)}),(0,X.jsx)(K,{label:s(`subagentDetailPanel.objective`),expanded:A,onExpandedChange:j,children:(0,X.jsx)(o,{variant:`body-medium-lighter`,as:`p`,className:`whitespace-pre-wrap break-words leading-relaxed text-[var(--content-default)]`,children:e.objective})},e.subagentId),(0,X.jsx)(`div`,{className:`mt-5 h-px w-full bg-[var(--border-hover)]`})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(G,{as:`h3`,children:s(`subagentDetailPanel.timeline`)}),e.events.length>0?(0,X.jsx)(ge,{steps:g,expandedKeys:D,onExpandedKeysChange:k,onStepDetailClick:E,isRunning:l},e.subagentId):(0,X.jsx)(c,{placement:`section`,children:s(`subagentDetailPanel.noEventsYet`)})]})]})},L?`detail`:`list`)})}export{Ce as SubagentDetailPanel};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$C as t,AC as n,BC as r,Ca as i,DC as a,Ir as o,KC as s,Kc as c,NC as l,OC as u,On as d,PC as f,QC as p,Qm as m,Tm as h,US as g,W as _,Xm as v,Yo as y,Zm as b,cm as x,g as S,hC as C,iS as ee,lm as w,ly as te,mC as T,nu as ne,um as E,uy as D,wm as re,xS as ie,zS as ae,zy as oe}from"./app-KRIEMzuO.js";import{$n as O,E as k,Xn as se,j as A,nr as ce}from"./vendor-DLH51Vjf.js";import{_ as le,b as ue,d as de,f as fe,t as j,x as M}from"./react-B9IgSVeK.js";import{$ as pe,A as N,Bi as me,Cr as he,D as ge,Ha as P,Ji as _e,Mn as ve,P as ye,Pt as F,Vi as be,Vn as xe,Ya as I,Yn as L,Zr as Se,_r as Ce,b as we,gt as Te,ha as Ee,i as De,ir as R,mi as Oe,oa as ke,r as z,ri as Ae,sn as je,st as B,tr as Me,vt as Ne,wn as Pe,xr as Fe,yi as Ie,za as Le}from"./icons-C0wyat6T.js";import{a as Re,i as ze,n as V,o as Be,r as H,t as Ve}from"./use-skill-actions-BhUkfXmL.js";import{t as He}from"./skill-icon-CWKAcXVy.js";import{t as Ue}from"./skill-removal-dialog-DcbMCW1X.js";import{t as We}from"./plugins-surface-ClVSBf-s.js";import{c as Ge,i as Ke,l as qe,n as Je,o as Ye,r as U,s as Xe,u as W}from"./use-plugins-list-DJlgCfb-.js";import{t as Ze}from"./use-debounced-value-CiNn3pzA.js";var Qe=I(`funnel`,[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]]),G=e(M(),1),$e=e=>A(`pluginConstants.removeConfirmMessage`,{ns:`intelligence`,name:e}),et=e=>A(`pluginConstants.riskyUpgradeConfirmMessage`,{ns:`intelligence`,name:e}),tt=A(`pluginConstants.riskyUpgradeConfirmLabel`,{ns:`intelligence`}),nt=A(`pluginConstants.installError`,{ns:`intelligence`}),rt=A(`pluginConstants.removeError`,{ns:`intelligence`}),it=A(`pluginConstants.upgradeError`,{ns:`intelligence`}),at=A(`pluginConstants.toggleError`,{ns:`intelligence`}),K=j();function ot(e){try{return new URL(e,window.location.href).pathname.split(`/`).pop()||`plugin-artifact`}catch{return`plugin-artifact`}}function st({plugin:e,surfaces:t=null,className:n}){let{t:r}=k(`intelligence`),i=e.source?.kind===`github`?e.source.repo:r(`pluginDetailShared.localSource`),a=e.source?.kind===`github`?`https://github.com/${e.source.repo}`:null,o=[{label:r(`pluginDetailShared.sourceLabel`),value:i,href:a??void 0}];return e.homepage&&o.push({label:r(`pluginDetailShared.homepageLabel`),value:e.homepage,href:e.homepage}),e.license&&o.push({label:r(`pluginDetailShared.licenseLabel`),value:e.license}),t&&(t.skills.length>0&&o.push({label:r(`pluginDetailShared.skillsLabel`),value:String(t.skills.length)}),t.hooks.length>0&&o.push({label:r(`pluginDetailShared.hooksLabel`),value:String(t.hooks.length)}),t.tools.length>0&&o.push({label:r(`pluginDetailShared.toolsLabel`),value:String(t.tools.length)})),(0,K.jsx)(`dl`,{className:y(`mb-5 grid gap-x-6 gap-y-2 border-b pb-5 sm:grid-cols-[max-content_1fr]`,n),style:{borderColor:`var(--border-base)`},children:o.map(e=>(0,K.jsxs)(`div`,{className:`contents`,children:[(0,K.jsx)(`dt`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:e.label}),(0,K.jsx)(`dd`,{className:`min-w-0 truncate text-body-small-default`,style:{color:`var(--content-secondary)`},children:e.href?(0,K.jsxs)(oe,{href:e.href,tone:`default`,className:`inline-flex items-center gap-1`,glyph:!1,children:[e.value,(0,K.jsx)(Se,{className:`h-3 w-3`,"aria-hidden":!0})]}):e.value})]},e.label))})}function q({plugin:e,drift:n,onInstall:r,onRemove:i,onUpgrade:s,isInstalling:c,isRemoving:l,isUpgrading:u,hasLocalEdits:d,enabled:f,onToggle:p,isToggling:m}){let{t:h}=k(`intelligence`),[g,_]=(0,G.useState)(!1),[v,y]=(0,G.useState)(!1),b=e.installed??!1,x=e.artifact??null,S=n?.status===`update-available`,C=S?h(`pluginDetailShared.upgradeTitle`,{fromSha:qe(n?.local?.commit??null),toSha:qe(n?.remote?.commit??null)}):void 0;return(0,K.jsxs)(K.Fragment,{children:[b?(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 md:flex-nowrap md:shrink-0`,children:[f!==void 0&&p?(0,K.jsx)(a,{label:h(`pluginDetailShared.autoIncludeInChat`),checked:f,onChange:()=>p(),disabled:m}):null,x?(0,K.jsx)(t,{type:`button`,leftIcon:(0,K.jsx)(Ae,{"aria-hidden":!0}),onClick:()=>void o(x.url,ot(x.url)),children:x.label??h(`pluginDetailShared.download`)}):null,S?(0,K.jsx)(t,{type:`button`,onClick:()=>{if(d){y(!0);return}s()},disabled:u,title:C,loading:u,leftIcon:(0,K.jsx)(be,{"aria-hidden":!0}),children:h(`pluginDetailShared.upgrade`)}):null,(0,K.jsx)(t,{type:`button`,variant:`dangerOutline`,onClick:()=>_(!0),disabled:l,loading:l,leftIcon:(0,K.jsx)(N,{"aria-hidden":!0}),children:h(`pluginDetailShared.remove`)})]}):(0,K.jsx)(t,{type:`button`,onClick:r,disabled:c,loading:c,leftIcon:(0,K.jsx)(P,{"aria-hidden":!0}),children:h(`pluginDetailShared.install`)}),(0,K.jsx)(T,{open:g,title:h(`pluginDetailShared.removePluginTitle`),message:$e(e.name),confirmLabel:h(`pluginDetailShared.remove`),destructive:!0,onConfirm:()=>{_(!1),i()},onCancel:()=>_(!1)}),(0,K.jsx)(T,{open:v,title:h(`pluginDetailShared.upgradePluginTitle`),message:et(e.name),confirmLabel:tt,destructive:!0,onConfirm:()=>{y(!1),s()},onCancel:()=>y(!1)})]})}function ct(){return(0,K.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,K.jsx)(L,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})})}function lt(){let{t:e}=k(`intelligence`);return(0,K.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-12 text-center`,style:{color:`var(--content-tertiary)`},children:[(0,K.jsx)(ge,{className:`h-6 w-6`,"aria-hidden":!0}),(0,K.jsx)(`p`,{className:`text-body-medium-default`,children:e(`pluginDetailShared.loadErrorTitle`)}),(0,K.jsx)(`p`,{className:`text-body-small-lighter`,children:e(`pluginDetailShared.loadErrorDetail`)})]})}function J({isInstallError:e,isRemoveError:t,isUpgradeError:n}){let r=e?nt:t?rt:n?it:null;return r?(0,K.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 rounded px-3 py-2 text-body-small-default`,style:{backgroundColor:`var(--surface-active)`,color:`var(--content-warning, var(--content-tertiary))`},role:`alert`,children:[(0,K.jsx)(ge,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0}),r]}):null}function ut({external:e,className:t}){let{t:n}=k(`intelligence`),r=e?{label:n(`pluginOriginBadge.external`),icon:he}:{label:n(`pluginOriginBadge.local`),icon:Fe};return(0,K.jsx)(f,{tone:`neutral`,leftIcon:(0,G.createElement)(r.icon),className:t,children:r.label})}function Y({onClick:e,isUpgrading:t=!1}={}){let{t:n}=k(`intelligence`),r=(0,G.createElement)(t?L:be,{className:t?`animate-spin`:void 0}),i=n(`updateAvailableBadge.updateAvailable`);return e?(0,K.jsx)(l,{tone:`warning`,leftIcon:r,onClick:t=>{t.stopPropagation(),e()},disabled:t,"aria-label":n(`updateAvailableBadge.upgradePluginAriaLabel`),className:`shrink-0`,children:i}):(0,K.jsx)(f,{tone:`warning`,leftIcon:r,className:`shrink-0`,children:i})}var dt=300*1e3;function X({assistantId:e,name:t,enabled:n=!0}){return O({...w({path:{assistant_id:e,name:t}}),enabled:!!e&&!!t&&n,staleTime:dt,retry:!1})}function ft(e){let t=e?.local?.localChanges;return!!t&&t?.clean===!1}function Z(e,t,n){let{t:r}=k(`intelligence`),i=ce(),a=n?.onInstalled,o=n?.onRemoved,s=O({...x({path:{assistant_id:e,name:t}}),enabled:!!e&&!!t}),l=X({assistantId:e,name:t,enabled:s.data?.installed??!1}).data,u=(0,G.useCallback)(()=>c(i,e,t),[e,t,i]),d=Ke(e,t,{onInstalled:a,onRemoved:o}),f=b({onSuccess:e=>{u(),C.success(e.outcome===`already-up-to-date`?r(`pluginToast.alreadyUpToDate`,{name:t||r(`pluginToast.pluginFallbackCapitalized`)}):r(`pluginToast.upgraded`,{name:t||r(`pluginToast.pluginFallback`),sha:qe(e.toCommit)}))}});return{plugin:s.data??null,drift:l,isLoading:s.isLoading,isError:s.isError,install:d.install,remove:d.remove,upgrade:()=>{f.mutate({path:{assistant_id:e,name:t},body:{}})},isInstalling:d.isInstalling,isRemoving:d.isRemoving,isUpgrading:f.isPending,isInstallError:d.isInstallError,isRemoveError:d.isRemoveError,isUpgradeError:f.isError,hasLocalEdits:ft(l)}}function pt(e){let t=ce(),n={queryKey:E({path:{assistant_id:e}})},r=(e,r)=>{t.setQueriesData(n,t=>t&&{...t,plugins:t.plugins.map(t=>t.name===e?{...t,enabled:r}:t)})},i=se({mutationFn:async({name:t,nextEnabled:n})=>{let r=await(n?D({path:{assistant_id:e,name:t},throwOnError:!1}):te({path:{assistant_id:e,name:t},throwOnError:!1})),i=r.response?.status;if(r.response?.ok||i===409)return r;throw Error(`Plugin toggle failed (${i??`network error`})`)},onMutate:async({name:e,nextEnabled:i})=>{await t.cancelQueries(n),r(e,i)},onError:(e,{name:t,nextEnabled:n})=>{r(t,!n),C.error(at)},onSettled:(n,r,i)=>{c(t,e,i.name)}});return{toggle:(e,t)=>{i.mutate({name:e,nextEnabled:t})},togglingName:i.isPending?i.variables?.name??null:null}}function mt({assistantId:e,name:n,onBack:i,externalHint:a,enabled:o}){let{plugin:s,drift:c,isLoading:l,isError:u,install:f,remove:p,upgrade:m,isInstalling:h,isRemoving:g,isUpgrading:_,isInstallError:v,isRemoveError:y,isUpgradeError:b,hasLocalEdits:x}=Z(e,n,{onRemoved:i}),{t:S}=k(`intelligence`),{toggle:C,togglingName:ee}=pt(e),w=U(e,n,s?.hasIcon,s?.iconVersion);return(0,K.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col`,children:[(0,K.jsxs)(`div`,{className:`mb-4 flex items-start gap-3`,children:[(0,K.jsx)(t,{type:`button`,variant:`ghost`,iconOnly:(0,K.jsx)(Le,{"aria-hidden":!0}),"aria-label":S(`pluginDetail.backToPluginsAriaLabel`),onClick:i}),(0,K.jsx)(ht,{name:n,plugin:s,externalHint:a,iconSrc:w,drift:c,onInstall:f,onRemove:p,onUpgrade:m,isInstalling:h,isRemoving:g,isUpgrading:_,hasLocalEdits:x,enabled:o,onToggle:()=>C(n,!o),isToggling:ee===n})]}),(v||y||b)&&(0,K.jsx)(J,{isInstallError:v,isRemoveError:y,isUpgradeError:b}),(0,K.jsx)(r.Root,{asChild:!0,children:(0,K.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-6 py-5`,children:l?(0,K.jsx)(ct,{}):u||!s?(0,K.jsx)(lt,{}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(st,{plugin:s,surfaces:c?.surfaces??null}),s.readme?(0,K.jsx)(d,{content:s.readme}):(0,K.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:S(`pluginDetail.noReadme`)})]})})})]})}function ht({name:e,plugin:t,externalHint:n,iconSrc:r,drift:i,onInstall:a,onRemove:o,onUpgrade:s,isInstalling:c,isRemoving:l,isUpgrading:u,hasLocalEdits:d,enabled:f,onToggle:p,isToggling:m}){let{t:h}=k(`intelligence`),g=t?.source?.kind===`github`,_=t?g:n,v=i?.status===`update-available`;return(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3 sm:flex-row sm:items-center`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-start gap-3`,children:[_===void 0?(0,K.jsx)(`span`,{"aria-hidden":!0,className:`h-8 w-8 shrink-0`}):(0,K.jsx)(W,{external:_,icon:t?.icon??void 0,iconSrc:r,size:`md`}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,K.jsx)(`h2`,{className:`text-title-medium`,style:{color:`var(--content-default)`},children:t?.name??e}),t?.version?(0,K.jsx)(`span`,{className:`shrink-0 text-body-small-default`,style:{color:`var(--content-tertiary)`},children:h(`pluginDetail.version`,{version:t.version})}):null,t?(0,K.jsx)(ut,{external:g}):null,v?(0,K.jsx)(Y,{}):null]}),t?.description?(0,K.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-body-medium-lighter`,style:{color:`var(--content-secondary)`},children:t.description}):null]})]}),t?(0,K.jsx)(q,{plugin:t,drift:i,onInstall:a,onRemove:o,onUpgrade:s,isInstalling:c,isRemoving:l,isUpgrading:u,hasLocalEdits:d,enabled:f,onToggle:p,isToggling:m}):null]})}var gt=e(ue(),1);function _t({assistantId:e,name:n,onBack:i,externalHint:a,enabled:o}){let{plugin:s,drift:c,isLoading:l,isError:u,install:f,remove:p,upgrade:m,isInstalling:h,isRemoving:g,isUpgrading:_,isInstallError:v,isRemoveError:y,isUpgradeError:b,hasLocalEdits:x}=Z(e,n,{onRemoved:i}),{t:S}=k(`intelligence`),{toggle:C,togglingName:ee}=pt(e),[w,te]=(0,G.useState)(null);(0,G.useEffect)(()=>{te(document.getElementById(`viewport-overlays`))},[]);let T=s?.source?.kind===`github`,ne=s?T:a,E=c?.status===`update-available`,D=s?.name??n,re=U(e,n,s?.hasIcon,s?.iconVersion),ie=(0,K.jsxs)(`div`,{className:`fixed inset-0 z-40 flex flex-col overflow-hidden bg-[var(--surface-overlay)]`,style:{paddingTop:`calc(8px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px)))`,paddingBottom:`calc(8px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)))`,paddingLeft:`calc(12px + var(--safe-area-inset-left, env(safe-area-inset-left, 0px)))`,paddingRight:`calc(12px + var(--safe-area-inset-right, env(safe-area-inset-right, 0px)))`},children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,K.jsx)(t,{variant:`ghost`,iconOnly:(0,K.jsx)(Le,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":S(`pluginDetail.backToPluginsAriaLabel`),onClick:i,className:`max-md:bg-[var(--surface-active)]`}),(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate px-2 text-center text-body-medium-default`,style:{color:`var(--content-secondary)`},children:D}),(0,K.jsx)(`span`,{"aria-hidden":!0,className:`h-8 w-8 shrink-0 touch-mobile:h-10 touch-mobile:w-10`})]}),(0,K.jsxs)(`div`,{className:`mt-4 flex flex-col gap-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[ne===void 0?(0,K.jsx)(`span`,{"aria-hidden":!0,className:`h-8 w-8 shrink-0`}):(0,K.jsx)(W,{external:ne,icon:s?.icon??void 0,iconSrc:re,size:`md`}),(0,K.jsx)(`h2`,{className:`min-w-0 truncate text-title-medium`,style:{color:`var(--content-emphasised)`},children:D})]}),(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[E?(0,K.jsx)(Y,{}):null,s?(0,K.jsx)(ut,{external:T}):null]})]}),s?.description?(0,K.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:s.description}):null]}),s?(0,K.jsx)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:(0,K.jsx)(q,{plugin:s,drift:c,enabled:o,onToggle:()=>C(n,!o),isToggling:ee===n,onInstall:f,onRemove:p,onUpgrade:m,isInstalling:h,isRemoving:g,isUpgrading:_,hasLocalEdits:x})}):null,(v||y||b)&&(0,K.jsx)(`div`,{className:`mt-3`,children:(0,K.jsx)(J,{isInstallError:v,isRemoveError:y,isUpgradeError:b})}),(0,K.jsx)(r.Root,{asChild:!0,noPadding:!0,children:(0,K.jsx)(`div`,{className:`mt-6 flex min-h-0 flex-1 flex-col overflow-hidden rounded-2xl border bg-[var(--surface-lift)]`,style:{borderColor:`var(--border-hover)`},children:(0,K.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-4`,children:l?(0,K.jsx)(ct,{}):u||!s?(0,K.jsx)(lt,{}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(st,{plugin:s,surfaces:c?.surfaces??null}),s.readme?(0,K.jsx)(d,{content:s.readme}):(0,K.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:S(`pluginDetail.noReadme`)})]})})})})]});return w?(0,gt.createPortal)(ie,w):ie}function vt({assistantId:e,item:n,drift:i,onSelect:a,onInstall:o,onRemove:s,onUpgrade:c,isInstalling:l=!1,isRemoving:u=!1,isUpgrading:d=!1}){let{t:p}=k(`intelligence`),m=n.status===`available`,h=i?.status===`update-available`,g=n.enabled!==void 0,_=n.enabled===!1,v=U(e,n.name,n.hasIcon,n.iconVersion);return(0,K.jsx)(r.Root,{asChild:!0,children:(0,K.jsxs)(`div`,{role:`button`,tabIndex:0,onClick:a,onKeyDown:e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),a())},className:`flex cursor-pointer items-center gap-3 px-3 py-2 text-left transition-colors hover:bg-[var(--surface-hover)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]`,children:[(0,K.jsx)(W,{size:`sm`,external:n.external,icon:n.icon,iconUrl:n.iconUrl,iconSrc:v,className:_?`opacity-50`:void 0}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`truncate text-body-medium-default`,style:{color:_?`var(--content-tertiary)`:`var(--content-emphasised)`},children:n.name}),n.version?(0,K.jsx)(`span`,{className:`shrink-0 text-body-small-default`,style:{color:`var(--content-tertiary)`},children:p(`pluginListRow.version`,{version:n.version})}):null,(0,K.jsx)(f,{tone:`neutral`,leftIcon:(0,K.jsx)(F,{"aria-hidden":!0}),children:p(`pluginListRow.pluginTag`)}),h?(0,K.jsx)(Y,{onClick:c,isUpgrading:d}):null]}),(0,K.jsx)(`p`,{className:`mt-1 truncate text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:n.description??p(`pluginListRow.noDescription`)}),n.issues&&n.issues.length>0?(0,K.jsxs)(`p`,{className:`mt-1 truncate text-body-small-default`,style:{color:`var(--content-warning, var(--content-tertiary))`},title:n.issues.join(`; `),children:[n.issues[0],n.issues.length>1?p(`pluginListRow.moreIssues`,{count:n.issues.length-1}):null]}):null]}),m?l?(0,K.jsx)(t,{type:`button`,loading:!0,iconOnly:(0,K.jsx)(P,{"aria-hidden":!0}),disabled:!0,"aria-label":p(`pluginListRow.installingAriaLabel`),expandOnMobile:!1}):(0,K.jsx)(t,{type:`button`,iconOnly:(0,K.jsx)(P,{"aria-hidden":!0}),onClick:e=>{e.stopPropagation(),o?.()},disabled:!o,"aria-label":p(`pluginListRow.installPluginAriaLabel`),expandOnMobile:!1}):(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[g?(0,K.jsx)(f,{tone:n.enabled?`positive`:`neutral`,children:n.enabled?p(`pluginListRow.enabled`):p(`pluginListRow.disabled`)}):null,(0,K.jsx)(t,{type:`button`,variant:`dangerOutline`,loading:u,iconOnly:(0,K.jsx)(N,{"aria-hidden":!0}),onClick:e=>{e.stopPropagation(),s?.()},disabled:u||d||!s,"aria-label":p(`pluginListRow.removePluginAriaLabel`),expandOnMobile:!1})]})]})})}var yt={mail:xe,calendar:ke,"message-circle":ve,globe:he,zap:z,code:Oe,mic:Pe,"shopping-cart":B,palette:je,heart:Ce,settings:Te,"link-2":Me};function bt(e){return yt[e]}var Q={email:`categories.email`,calendar:`categories.calendar`,messaging:`categories.messaging`,browsing:`categories.browsing`,productivity:`categories.productivity`,development:`categories.development`,voice:`categories.voice`,commerce:`categories.commerce`,content:`categories.content`,health:`categories.health`,system:`categories.system`,integrations:`categories.integrations`,other:`categories.other`};function xt({selected:e,onSelect:t,counts:n,totalCount:r,showCounts:i,categories:a,ariaLabel:o}){let{t:s}=k(`intelligence`),c=e=>{let t=Q[e.slug];return t?s(t,e.label):e.label},l=[...a].sort((e,t)=>c(e).localeCompare(c(t)));return(0,K.jsxs)(`nav`,{className:`flex flex-col gap-1`,"aria-label":o??s(`categorySidebar.skillCategoriesAriaLabel`),children:[(0,K.jsx)(St,{icon:R,label:s(`categorySidebar.all`),count:r,isActive:e===null,showCount:i,onClick:()=>t(null)}),l.map(r=>(0,K.jsx)(St,{icon:bt(r.icon)??R,label:c(r),count:n[r.slug]??0,isActive:e===r.slug,showCount:i,onClick:()=>t(r.slug)},r.slug))]})}function St({icon:e,label:n,count:r,isActive:i,showCount:a,onClick:o}){return(0,K.jsxs)(t,{variant:`ghost`,onClick:o,"aria-pressed":i,className:`h-auto justify-between gap-3 rounded-lg border-0 bg-transparent px-3 py-2 text-left hover:bg-[var(--ghost-hover)]`,style:{backgroundColor:i?`var(--surface-active)`:void 0,color:i?`var(--content-default)`:`var(--content-secondary)`},children:[(0,K.jsxs)(`span`,{className:`flex items-center gap-2.5`,children:[(0,K.jsx)(e,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0}),(0,K.jsx)(`span`,{className:`text-body-medium-default`,children:n})]}),a&&(0,K.jsx)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:r})]})}function Ct({skill:e,onSelect:n,onInstall:i,onRemove:a,isInstalling:o=!1,isRemoving:s=!1}){let{t:c}=k(`intelligence`),l=H(e),u=S(e);return(0,K.jsx)(r.Root,{asChild:!0,children:(0,K.jsxs)(`div`,{role:`button`,tabIndex:0,onClick:n,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),n())},className:`flex cursor-pointer items-center gap-3 px-3 py-2 text-left transition-colors hover:bg-[var(--surface-hover)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]`,children:[(0,K.jsx)(`div`,{className:`flex shrink-0 items-center justify-center text-[28px] leading-none`,children:(0,K.jsx)(He,{skill:e,className:`h-7 w-7`})}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`truncate text-body-medium-default`,style:{color:`var(--content-emphasised)`},children:e.name}),(0,K.jsx)(Re,{origin:e.origin})]}),(0,K.jsx)(`p`,{className:`mt-1 truncate text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:e.description})]}),l?o?(0,K.jsx)(t,{type:`button`,loading:!0,iconOnly:(0,K.jsx)(P,{"aria-hidden":!0}),disabled:!0,"aria-label":c(`skillRow.installingAriaLabel`),expandOnMobile:!1}):(0,K.jsx)(t,{type:`button`,iconOnly:(0,K.jsx)(P,{"aria-hidden":!0}),onClick:e=>{e.stopPropagation(),i?.()},disabled:!i,"aria-label":c(`skillRow.installSkillAriaLabel`),expandOnMobile:!1}):(0,K.jsx)(t,{type:`button`,variant:`dangerOutline`,loading:s,iconOnly:(0,K.jsx)(N,{"aria-hidden":!0}),onClick:e=>{e.stopPropagation(),a?.()},disabled:!u||s||!a,"aria-label":c(u?`skillRow.removeSkillAriaLabel`:`skillRow.bundledSkillCannotBeRemovedAriaLabel`),title:u?void 0:c(`skillRow.bundledSkillsCannotBeRemoved`),expandOnMobile:!1})]})})}function $(e,t){switch(e){case`vellum`:return`Vellum`;case`clawhub`:return`Clawhub`;case`skillssh`:return`skills.sh`;case`all`:return t(`superpowersFilters.filterLabel.all`);case`installed`:return t(`superpowersFilters.filterLabel.installed`);case`available`:return t(`superpowersFilters.filterLabel.available`);case`skills`:return t(`superpowersFilters.filterLabel.skills`);case`plugins`:return t(`superpowersFilters.filterLabel.plugins`);case`custom`:return t(`superpowersFilters.filterLabel.custom`);case`assistant-memory`:return t(`superpowersFilters.filterLabel.assistantMemory`)}}function wt(){let{t:e}=k(`intelligence`);return{statusFilters:[{value:`all`,label:$(`all`,e),icon:R},{value:`installed`,label:$(`installed`,e),icon:me},{value:`available`,label:$(`available`,e),icon:P}],typeFilters:[{value:`skills`,label:$(`skills`,e),icon:z},{value:`plugins`,label:$(`plugins`,e),icon:F}],originFilters:[{value:`vellum`,label:$(`vellum`,e),icon:Be},{value:`clawhub`,label:$(`clawhub`,e),icon:he},{value:`skillssh`,label:$(`skillssh`,e),icon:ye},{value:`custom`,label:$(`custom`,e),icon:we},{value:`assistant-memory`,label:$(`assistant-memory`,e),icon:Ee}]}}function Tt({search:e,onSearchChange:t,filter:n,onFilterChange:r,isSearching:i,categories:a,category:o,onCategoryChange:s,counts:c,totalCount:l,showCounts:d,pluginsSupported:f,showCategories:p}){let{t:m}=k(`intelligence`);return(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(u,{type:`search`,value:e,onChange:e=>{t(e.target.value)},placeholder:m(`superpowersFilters.searchPlaceholder`),"aria-label":m(`superpowersFilters.searchAriaLabel`),leftIcon:(0,K.jsx)(Ne,{className:`h-4 w-4`,"aria-hidden":!0}),rightIcon:i?(0,K.jsx)(L,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}):void 0,fullWidth:!0,wrapperClassName:`flex-1`}),(0,K.jsx)(Et,{filter:n,onFilterChange:r,categories:a,category:o,onCategoryChange:s,counts:c,totalCount:l,showCounts:d,pluginsSupported:f,showCategories:p})]})}function Et(e){let{t:r}=k(`intelligence`),a=i(),[o,s]=(0,G.useState)(!1),{statusFilters:c,typeFilters:l,originFilters:u}=wt(),d=(0,K.jsx)(t,{type:`button`,variant:`outlined`,iconOnly:(0,K.jsx)(Qe,{"aria-hidden":!0}),"aria-label":r(`superpowersFilters.filterAriaLabel`),"aria-haspopup":a?`dialog`:`listbox`,"aria-expanded":o,tintColor:`var(--primary-base)`});if(a)return(0,K.jsx)(Dt,{...e,open:o,onOpenChange:s,trigger:d});let f=t=>{e.onFilterChange(t),s(!1)};return(0,K.jsxs)(n.Root,{open:o,onOpenChange:s,children:[(0,K.jsx)(n.Trigger,{asChild:!0,children:d}),(0,K.jsx)(n.Content,{align:`end`,sideOffset:4,className:`w-44`,children:(0,K.jsxs)(`ul`,{role:`listbox`,children:[(0,K.jsx)(Mt,{label:r(`superpowersFilters.statusLabel`),options:c,selected:e.filter,onSelect:f}),e.pluginsSupported&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`my-1 h-px bg-[var(--border-base)]`}),(0,K.jsx)(Mt,{label:r(`superpowersFilters.typeLabel`),options:l,selected:e.filter,onSelect:f})]}),(0,K.jsx)(`div`,{className:`my-1 h-px bg-[var(--border-base)]`}),(0,K.jsx)(Mt,{label:r(`superpowersFilters.sourceLabel`),options:u,selected:e.filter,onSelect:f}),e.showCategories&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`my-1 h-px bg-[var(--border-base)]`}),(0,K.jsx)(jt,{categories:e.categories,category:e.category,counts:e.counts,totalCount:e.totalCount,showCounts:e.showCounts,allLabel:r(`superpowersFilters.filterLabel.all`),categoriesLabel:r(`superpowersFilters.categoriesLabel`),onSelect:t=>{e.onCategoryChange(t),s(!1)}})]})]})})]})}function Dt({filter:e,onFilterChange:n,categories:r,category:i,onCategoryChange:a,counts:o,totalCount:s,showCounts:c,pluginsSupported:l,showCategories:u,open:d,onOpenChange:f,trigger:m}){let{t:h}=k(`intelligence`),{statusFilters:g,typeFilters:_,originFilters:v}=wt();return(0,K.jsxs)(p.Root,{open:d,onOpenChange:f,children:[(0,K.jsx)(p.Trigger,{asChild:!0,children:m}),(0,K.jsxs)(p.Content,{className:`max-h-[85dvh]`,"aria-describedby":void 0,children:[(0,K.jsx)(`div`,{"aria-hidden":!0,className:`mx-auto mb-3 h-1 w-9 shrink-0 rounded-full bg-[var(--border-element)]`}),(0,K.jsx)(p.Header,{children:(0,K.jsx)(p.Title,{children:h(`superpowersFilters.filtersTitle`)})}),(0,K.jsxs)(p.Body,{className:`flex flex-col gap-3 pt-2`,children:[(0,K.jsx)(Ot,{label:h(`superpowersFilters.statusLabel`),children:g.map(t=>(0,K.jsx)(kt,{icon:t.icon,label:t.label,active:e===t.value,onSelect:()=>n(t.value)},t.value))}),l&&(0,K.jsx)(Ot,{label:h(`superpowersFilters.typeLabel`),children:_.map(t=>(0,K.jsx)(kt,{icon:t.icon,label:t.label,active:e===t.value,onSelect:()=>n(t.value)},t.value))}),(0,K.jsx)(Ot,{label:h(`superpowersFilters.sourceLabel`),children:v.map(t=>(0,K.jsx)(kt,{icon:t.icon,label:t.label,active:e===t.value,onSelect:()=>n(t.value)},t.value))}),u&&(0,K.jsxs)(Ot,{label:h(`superpowersFilters.categoriesLabel`),children:[(0,K.jsx)(kt,{icon:R,label:h(`superpowersFilters.filterLabel.all`),active:i===null,badge:c?s:void 0,onSelect:()=>a(null)}),At(r).map(e=>(0,K.jsx)(kt,{icon:bt(e.icon)??R,label:e.label,active:i===e.slug,badge:c?o[e.slug]??0:void 0,onSelect:()=>a(e.slug)},e.slug))]})]}),(0,K.jsx)(p.Footer,{children:(0,K.jsx)(t,{type:`button`,variant:`primary`,fullWidth:!0,onClick:()=>f(!1),children:h(`superpowersFilters.done`)})})]})]})}function Ot({label:e,children:t}){return(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`px-2 pb-1 text-body-small-default uppercase tracking-wide`,style:{color:`var(--content-tertiary)`},children:e}),t]})}function kt({icon:e,label:t,active:n,badge:r,onSelect:i}){return(0,K.jsx)(s,{icon:e,label:t,active:n,activeVariant:`branded`,badge:r,trailingAction:n&&r==null?(0,K.jsx)(_e,{className:`h-4 w-4 text-[var(--primary-base)]`,"aria-hidden":!0}):void 0,onSelect:i})}function At(e){return[...e].sort((e,t)=>e.label.localeCompare(t.label))}function jt({categories:e,category:t,counts:n,totalCount:r,showCounts:i,allLabel:a,categoriesLabel:o,onSelect:s}){return(0,K.jsx)(Nt,{label:o,children:(0,K.jsx)(`ul`,{className:`max-h-48 overflow-y-auto`,children:[{slug:null,label:a,count:r},...At(e).map(e=>({slug:e.slug,label:e.label,count:n[e.slug]??0}))].map(e=>{let n=t===e.slug;return(0,K.jsx)(`li`,{children:(0,K.jsxs)(`button`,{type:`button`,onClick:()=>s(e.slug),role:`option`,"aria-selected":n,className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-body-medium-default transition-colors hover:bg-[var(--surface-hover)] ${n?`text-[var(--primary-base)]`:`text-[var(--content-secondary)] hover:text-[var(--content-emphasised)]`}`,children:[(0,K.jsx)(`span`,{className:`flex-1 truncate`,children:e.label}),i&&(0,K.jsx)(`span`,{style:{color:`var(--content-tertiary)`},children:e.count})]})},e.slug??`all`)})})})}function Mt({label:e,options:t,selected:n,onSelect:r}){return(0,K.jsx)(Nt,{label:e,children:(0,K.jsx)(`ul`,{children:t.map(e=>{let t=e.icon,i=n===e.value;return(0,K.jsx)(`li`,{children:(0,K.jsxs)(`button`,{type:`button`,onClick:()=>r(e.value),role:`option`,"aria-selected":i,className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-body-medium-default transition-colors hover:bg-[var(--surface-hover)] ${i?`text-[var(--primary-base)]`:`text-[var(--content-secondary)] hover:text-[var(--content-emphasised)]`}`,children:[(0,K.jsx)(t,{className:`h-4 w-4`,"aria-hidden":!0}),(0,K.jsx)(`span`,{className:`flex-1`,children:e.label}),i&&(0,K.jsx)(me,{className:`h-3.5 w-3.5`,"aria-hidden":!0})]})},e.value)})})})}function Nt({label:e,children:t}){return(0,K.jsxs)(`li`,{role:`group`,"aria-label":e,children:[(0,K.jsx)(`div`,{className:`px-2 py-1.5 text-body-small-default uppercase tracking-wide text-[var(--content-tertiary)]`,children:e}),t]})}function Pt(e){return O({...re({path:{assistant_id:e}}),select:e=>e.categories,staleTime:300*1e3})}var Ft=new Set([`all`,`installed`,`available`,`skills`,`plugins`,`vellum`,`clawhub`,`skillssh`,`custom`,`assistant-memory`]);function It(e){let t=e.get(`filter`),n=e.get(`category`);return{q:e.get(`q`)??``,filter:zt(t)?t:`all`,category:n||null}}function Lt(e,t){let n=new URLSearchParams(e);return t.q!==void 0&&Rt(n,`q`,t.q.trim()||null),t.filter!==void 0&&Rt(n,`filter`,t.filter===`all`?null:t.filter),t.category!==void 0&&Rt(n,`category`,t.category),n}function Rt(e,t,n){n===null?e.delete(t):e.set(t,n)}function zt(e){return e!==null&&Ft.has(e)}function Bt(e){switch(e){case`installed`:return{kind:`installed`};case`available`:return{kind:`available`};case`vellum`:case`clawhub`:case`skillssh`:case`custom`:case`assistant-memory`:return{origin:e};default:return{}}}function Vt(e){return e!==`plugins`}function Ht(e){return e===`all`||e===`installed`||e===`available`||e===`plugins`}function Ut(e){switch(e){case`installed`:return`installed`;case`available`:return`available`;default:return`all`}}var Wt=300,Gt=`vellum:superpowers:tipDismissed`;function Kt(e){return[...e].sort((e,t)=>e.installed===t.installed?e.name.localeCompare(t.name,void 0,{sensitivity:`base`}):e.installed?-1:1)}function qt({assistantId:e}){let{t}=k(`intelligence`),n=fe(),r=de(),i=ce(),a=ne(),o=ee.use.version(),s=We(),[l,u]=le(),{q:d,filter:f,category:p}=(0,G.useMemo)(()=>It(l),[l]),_=l.get(`plugin`),y=(0,G.useCallback)(e=>{u(t=>Lt(t,e),{replace:!0})},[u]),x=l.get(`success`),S=(0,G.useRef)(!1);(0,G.useEffect)(()=>{x!==`true`||S.current||(S.current=!0,_&&C.success(t(`pluginToast.installed`,{name:_})),u(e=>{let t=new URLSearchParams(e);return t.delete(`success`),t},{replace:!0}))},[x,_,u,t]);let[w,te]=(0,G.useState)(d),E=Ze(w.trim(),Wt),D=(0,G.useRef)(d);(0,G.useEffect)(()=>{if(d!==D.current&&(D.current=d,d!==w.trim())){te(d);return}E!==d&&E===w.trim()&&(D.current=E,y({q:E}))},[E,d,w,y]);let re=(0,G.useCallback)(e=>y({filter:e}),[y]),oe=(0,G.useCallback)(e=>y({category:e}),[y]),[se,A]=(0,G.useState)(()=>ae(Gt,!1)),ue=(0,G.useCallback)(()=>{A(!0),g(Gt,!0)},[]),j=!s&&f===`plugins`?`all`:f,M=Vt(j),pe=s&&Ht(j),N=Ut(j),{handleInstall:me,handleRemove:he,isInstallingSkill:ge,isRemovingSkill:P,skillPendingRemoval:_e,confirmRemove:ve,cancelRemove:ye}=Ve(e),{data:F=[]}=Pt(e),{origin:be,kind:xe}=(0,G.useMemo)(()=>Bt(j),[j]),I=O({...h({path:{assistant_id:e},query:{include:`catalog`,origin:be,kind:xe,q:E||void 0,category:p??void 0}}),select:e=>({skills:e.skills,categoryCounts:e.categoryCounts,totalCount:e.totalCount}),enabled:!!e&&M}),L=O({...h({path:{assistant_id:e},query:{include:`catalog`,origin:be,kind:xe,q:E||void 0}}),select:e=>({skills:e.skills,categoryCounts:e.categoryCounts,totalCount:e.totalCount}),enabled:!!e&&M&&p!==null}),{items:Se,isLoading:Ce,catalogLoading:we,isError:Te,isFetching:Ee,catalogError:De,categorySupported:R,installedCategoryCounts:Oe,installedPlugins:ke,installedTotal:z,catalogMatches:Ae,unfilteredInstalledNames:je}=Je(e,p,s),B=pe&&(p===null||R),Me=(0,G.useCallback)(t=>c(i,e,t),[e,i]),[Ne,Pe]=(0,G.useState)(null),[Fe,Ie]=(0,G.useState)(null),[Le,Re]=(0,G.useState)(null),[V,Be]=(0,G.useState)(null),[H,He]=(0,G.useState)(null),Ke=m({onMutate:e=>Pe(e.body.name),onSuccess:(e,n)=>C.success(t(`pluginToast.installed`,{name:n.body.name})),onError:()=>C.error(nt),onSettled:(e,t,n)=>{Pe(null),Me(n.body.name)}}),U=v({onMutate:e=>Ie(e.path.name),onSuccess:(e,n)=>{C.success(t(`pluginToast.removed`,{name:n.path.name})),Ye(e.warnings,t)},onError:()=>C.error(rt),onSettled:(e,t,n)=>{Ie(null),Me(n.path.name)}}),W=b({onMutate:e=>Re(e.path.name),onSuccess:(e,n)=>C.success(e.outcome===`already-up-to-date`?t(`pluginToast.alreadyUpToDate`,{name:n.path.name}):t(`pluginToast.upgraded`,{name:n.path.name,sha:qe(e.toCommit)})),onError:()=>C.error(it),onSettled:(e,t,n)=>{Re(null),Me(n.path.name)}}),Qe=(0,G.useCallback)(e=>u(t=>{let n=new URLSearchParams(t);return n.set(`plugin`,e.name),n}),[u]),at=(0,G.useCallback)(()=>u(e=>{let t=new URLSearchParams(e);return t.delete(`plugin`),t},{replace:!0}),[u]),ot=(0,G.useCallback)(t=>{Ke.mutate({path:{assistant_id:e},body:{name:t.name}})},[e,Ke]),st=(0,G.useCallback)(()=>{V&&(U.mutate({path:{assistant_id:e,name:V.name}}),Be(null))},[e,V,U]),q=(0,G.useCallback)(t=>{W.mutate({path:{assistant_id:e,name:t},body:{}})},[e,W]),ct=(0,G.useCallback)(()=>{H&&(q(H.name),He(null))},[H,q]),lt=(0,G.useCallback)((e,t)=>{if(ft(t)){He(e);return}q(e.name)},[q]),J=(0,G.useMemo)(()=>M?I.data?.skills??[]:[],[M,I.data?.skills]),ut=(0,G.useMemo)(()=>B?Xe(Se,N).filter(e=>Ge(e,E)):[],[B,Se,N,E]),Y=(0,G.useMemo)(()=>Kt([...J.map(e=>({type:`skill`,key:`skill:${e.id}`,name:e.name,installed:ze(e),skill:e})),...ut.map(e=>({type:`plugin`,key:`plugin:${e.name}`,name:e.name,installed:e.status===`installed`,item:e}))]),[J,ut]),dt=p===null?I.data:L.data,X=Jt(M,dt?.skills??J,dt?.categoryCounts,dt?.totalCount),Z=Yt(pe&&R,Oe,ke,z,Ae,je,N),{counts:pt,totalCount:ht}=(0,G.useMemo)(()=>{let e={...X.counts};for(let[t,n]of Object.entries(Z.counts))e[t]=(e[t]??0)+n;return{counts:e,totalCount:X.totalCount+Z.totalCount}},[X,Z]),gt=M&&I.isLoading,yt=M&&I.isError,bt=B&&Ce,Q=B&&Te,St=(yt||!M)&&(Q||!B)&&(yt||Q),$=gt||bt,wt=!!E&&(M&&I.isFetching||B&&Ee&&!Ce),Et=w.trim().length>0;if(_&&!s&&o===null)return null;if(_&&s){let t=Se.find(e=>e.name===_),n={assistantId:e,name:_,externalHint:t?.external,enabled:t?.enabled,onBack:at};return a?(0,K.jsx)(_t,{...n}):(0,K.jsx)(mt,{...n})}let Dt=(0,K.jsx)(`div`,{className:`min-w-0 flex-1 overflow-y-auto`,children:$?(0,K.jsx)($t,{}):St?(0,K.jsx)(en,{}):Y.length===0?B&&we&&N!==`installed`?(0,K.jsx)($t,{}):(0,K.jsx)(tn,{filter:j,category:p}):(0,K.jsx)(`ul`,{className:`flex flex-col gap-2`,children:Y.map(t=>(0,K.jsx)(`li`,{children:t.type===`skill`?(0,K.jsx)(Ct,{skill:t.skill,onSelect:()=>n(ie.skills.detail(t.skill.id),{state:{listSearch:r.search}}),onInstall:()=>me(t.skill),onRemove:()=>he(t.skill),isInstalling:ge(t.skill),isRemoving:P(t.skill)}):t.installed?(0,K.jsx)(Xt,{assistantId:e,item:t.item,onSelect:()=>Qe(t.item),onRemove:()=>Be(t.item),onUpgrade:e=>lt(t.item,e),isRemoving:Fe===t.item.name,isUpgrading:Le===t.item.name}):(0,K.jsx)(vt,{assistantId:e,item:t.item,onSelect:()=>Qe(t.item),onInstall:()=>ot(t.item),isInstalling:Ne===t.item.name})},t.key))})});return(0,K.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col gap-4`,children:[!se&&(0,K.jsx)(Zt,{onDismiss:ue}),(0,K.jsx)(Tt,{search:w,onSearchChange:te,filter:j,onFilterChange:re,isSearching:wt,categories:F,category:p,onCategoryChange:oe,counts:pt,totalCount:ht,showCounts:!Et,pluginsSupported:s,showCategories:a}),!$&&!St&&yt?(0,K.jsx)(Qt,{text:t(`superpowersTab.skillsUnavailableNotice`)}):null,!$&&!St&&Q?(0,K.jsx)(Qt,{text:t(`superpowersTab.pluginsUnavailableNotice`)}):null,B&&De&&!bt&&!Q?(0,K.jsx)(Qt,{text:t(`superpowersTab.catalogBrowsingUnavailableNotice`)}):null,(0,K.jsxs)(`div`,{className:`flex min-h-0 flex-1 gap-6`,children:[!a&&(0,K.jsx)(`aside`,{className:`w-56 shrink-0 overflow-y-auto`,children:(0,K.jsx)(xt,{ariaLabel:t(`superpowersTab.categoriesAriaLabel`),selected:p,onSelect:oe,counts:pt,totalCount:ht,showCounts:!Et,categories:F})}),Dt]}),(0,K.jsx)(Ue,{skillName:_e?.name??null,onConfirm:ve,onCancel:ye}),(0,K.jsx)(T,{open:V!==null,title:t(`pluginDetailShared.removePluginTitle`),message:V?$e(V.name):``,confirmLabel:t(`pluginDetailShared.remove`),destructive:!0,onConfirm:st,onCancel:()=>Be(null)}),(0,K.jsx)(T,{open:H!==null,title:t(`pluginDetailShared.upgradePluginTitle`),message:H?et(H.name):``,confirmLabel:tt,destructive:!0,onConfirm:ct,onCancel:()=>He(null)})]})}function Jt(e,t,n,r){return(0,G.useMemo)(()=>{if(!e)return{counts:{},totalCount:0};if(n&&Object.keys(n).length>0)return{counts:n,totalCount:r??t.length};let i={};for(let e of t){let t=e.category??`system`;i[t]=(i[t]??0)+1}return{counts:i,totalCount:r??t.length}},[e,t,n,r])}function Yt(e,t,n,r,i,a,o){return(0,G.useMemo)(()=>{if(!e)return{counts:{},totalCount:0};let s={},c=o!==`available`,l=o===`all`||o===`available`;if(c)if(t&&Object.keys(t).length>0)Object.assign(s,t);else for(let e of n){let t=e.category??`system`;s[t]=(s[t]??0)+1}let u=0;if(l)for(let e of i){if(a.has(e.name))continue;let t=e.category??`system`;s[t]=(s[t]??0)+1,u+=1}let d=r??n.length;return{counts:s,totalCount:(c?d:0)+u}},[e,t,n,r,i,a,o])}function Xt({assistantId:e,item:t,onSelect:n,onRemove:r,onUpgrade:i,isRemoving:a,isUpgrading:o}){let s=X({assistantId:e,name:t.name}).data;return(0,K.jsx)(vt,{assistantId:e,item:t,drift:s,onSelect:n,onRemove:r,onUpgrade:()=>i(s),isRemoving:a,isUpgrading:o})}function Zt({onDismiss:e}){let{t:n}=k(`intelligence`);return(0,K.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg px-4 py-2.5 text-body-small-default`,style:{backgroundColor:`var(--surface-base)`,color:`var(--content-secondary)`},children:[(0,K.jsx)(pe,{className:`h-4 w-4 shrink-0`,style:{color:`var(--primary-base)`}}),(0,K.jsx)(`p`,{className:`flex-1`,children:n(`superpowersTab.tipBannerText`)}),(0,K.jsx)(t,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,K.jsx)(De,{"aria-hidden":!0}),onClick:e,"aria-label":n(`superpowersTab.dismissTipAriaLabel`),tintColor:`var(--content-tertiary)`,expandOnMobile:!1})]})}function Qt({text:e}){return(0,K.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg px-4 py-2.5 text-body-small-default`,style:{backgroundColor:`var(--surface-base)`,color:`var(--content-secondary)`},children:[(0,K.jsx)(Ie,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0}),(0,K.jsx)(`p`,{className:`flex-1`,children:e})]})}function $t(){return(0,K.jsx)(`div`,{className:`flex items-center justify-center py-16`,children:(0,K.jsx)(L,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})})}function en(){let{t:e}=k(`intelligence`);return(0,K.jsx)(r.Root,{children:(0,K.jsxs)(r.Body,{className:`flex flex-col items-center justify-center py-16 text-center`,children:[(0,K.jsx)(ge,{className:`mb-3 h-8 w-8`,style:{color:`var(--system-negative-strong)`},"aria-hidden":!0}),(0,K.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:e(`superpowersTab.errorStateTitle`)}),(0,K.jsx)(`p`,{className:`mt-1 max-w-sm text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:e(`superpowersTab.errorStateSubtitle`)})]})})}function tn({filter:e,category:t}){let{t:n}=k(`intelligence`),{title:r,subtitle:i,Icon:a}=nn(e,t,n);return(0,K.jsx)(V,{icon:a,title:r,subtitle:i})}function nn(e,t,n){if(t)return{title:n(`superpowersTab.emptyState.categoryTitle`),subtitle:n(`superpowersTab.emptyState.categorySubtitle`),Icon:R};switch(e){case`installed`:return{title:n(`superpowersTab.emptyState.installedTitle`),subtitle:n(`superpowersTab.emptyState.installedSubtitle`),Icon:z};case`available`:return{title:n(`superpowersTab.emptyState.availableTitle`),subtitle:n(`superpowersTab.emptyState.availableSubtitle`),Icon:me};case`skills`:return{title:n(`superpowersTab.emptyState.skillsTitle`),subtitle:n(`superpowersTab.emptyState.skillsSubtitle`),Icon:z};case`plugins`:return{title:n(`superpowersTab.emptyState.pluginsTitle`),subtitle:n(`superpowersTab.emptyState.pluginsSubtitle`),Icon:F};case`vellum`:return{title:n(`superpowersTab.emptyState.vellumTitle`),subtitle:n(`superpowersTab.emptyState.vellumSubtitle`),Icon:z};case`clawhub`:return{title:n(`superpowersTab.emptyState.clawhubTitle`),subtitle:n(`superpowersTab.emptyState.clawhubSubtitle`),Icon:z};case`skillssh`:return{title:n(`superpowersTab.emptyState.skillsshTitle`),subtitle:n(`superpowersTab.emptyState.skillsshSubtitle`),Icon:z};case`custom`:return{title:n(`superpowersTab.emptyState.customTitle`),subtitle:n(`superpowersTab.emptyState.customSubtitle`),Icon:z};case`assistant-memory`:return{title:n(`superpowersTab.emptyState.assistantMemoryTitle`),subtitle:n(`superpowersTab.emptyState.assistantMemorySubtitle`),Icon:z};default:return{title:n(`superpowersTab.emptyState.defaultTitle`),subtitle:n(`superpowersTab.emptyState.defaultSubtitle`),Icon:Ie}}}function rn(){return(0,K.jsx)(qt,{assistantId:_()})}export{rn as SuperpowersPage};
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$C as t,AC as n,BC as r,Ca as i,DC as a,Ir as o,KC as s,Kc as c,NC as l,OC as u,On as d,PC as f,QC as p,Qm as m,Tm as h,US as g,W as _,Xm as v,Yo as y,Zm as b,cm as x,g as S,hC as C,iS as ee,lm as w,ly as te,mC as T,nu as ne,um as E,uy as D,wm as re,xS as ie,zS as ae,zy as oe}from"./app-BEoekemj.js";import{$n as O,E as k,Xn as se,j as A,nr as ce}from"./vendor-cVd2QlFV.js";import{_ as le,b as ue,d as de,f as fe,t as j,x as M}from"./react-B9IgSVeK.js";import{$ as pe,A as N,Bi as me,Cr as he,D as ge,Ha as P,Ji as _e,Mn as ve,P as ye,Pt as F,Vi as be,Vn as xe,Ya as I,Yn as L,Zr as Se,_r as Ce,b as we,gt as Te,ha as Ee,i as De,ir as R,mi as Oe,oa as ke,r as z,ri as Ae,sn as je,st as B,tr as Me,vt as Ne,wn as Pe,xr as Fe,yi as Ie,za as Le}from"./icons-C0wyat6T.js";import{a as Re,i as ze,n as V,o as Be,r as H,t as Ve}from"./use-skill-actions-BvJl4cE_.js";import{t as He}from"./skill-icon-CWKAcXVy.js";import{t as Ue}from"./skill-removal-dialog-CKyIY15v.js";import{t as We}from"./plugins-surface-DRWOFcBb.js";import{c as Ge,i as Ke,l as qe,n as Je,o as Ye,r as U,s as Xe,u as W}from"./use-plugins-list-Bfr06IMK.js";import{t as Ze}from"./use-debounced-value-CiNn3pzA.js";var Qe=I(`funnel`,[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]]),G=e(M(),1),$e=e=>A(`pluginConstants.removeConfirmMessage`,{ns:`intelligence`,name:e}),et=e=>A(`pluginConstants.riskyUpgradeConfirmMessage`,{ns:`intelligence`,name:e}),tt=A(`pluginConstants.riskyUpgradeConfirmLabel`,{ns:`intelligence`}),nt=A(`pluginConstants.installError`,{ns:`intelligence`}),rt=A(`pluginConstants.removeError`,{ns:`intelligence`}),it=A(`pluginConstants.upgradeError`,{ns:`intelligence`}),at=A(`pluginConstants.toggleError`,{ns:`intelligence`}),K=j();function ot(e){try{return new URL(e,window.location.href).pathname.split(`/`).pop()||`plugin-artifact`}catch{return`plugin-artifact`}}function st({plugin:e,surfaces:t=null,className:n}){let{t:r}=k(`intelligence`),i=e.source?.kind===`github`?e.source.repo:r(`pluginDetailShared.localSource`),a=e.source?.kind===`github`?`https://github.com/${e.source.repo}`:null,o=[{label:r(`pluginDetailShared.sourceLabel`),value:i,href:a??void 0}];return e.homepage&&o.push({label:r(`pluginDetailShared.homepageLabel`),value:e.homepage,href:e.homepage}),e.license&&o.push({label:r(`pluginDetailShared.licenseLabel`),value:e.license}),t&&(t.skills.length>0&&o.push({label:r(`pluginDetailShared.skillsLabel`),value:String(t.skills.length)}),t.hooks.length>0&&o.push({label:r(`pluginDetailShared.hooksLabel`),value:String(t.hooks.length)}),t.tools.length>0&&o.push({label:r(`pluginDetailShared.toolsLabel`),value:String(t.tools.length)})),(0,K.jsx)(`dl`,{className:y(`mb-5 grid gap-x-6 gap-y-2 border-b pb-5 sm:grid-cols-[max-content_1fr]`,n),style:{borderColor:`var(--border-base)`},children:o.map(e=>(0,K.jsxs)(`div`,{className:`contents`,children:[(0,K.jsx)(`dt`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:e.label}),(0,K.jsx)(`dd`,{className:`min-w-0 truncate text-body-small-default`,style:{color:`var(--content-secondary)`},children:e.href?(0,K.jsxs)(oe,{href:e.href,tone:`default`,className:`inline-flex items-center gap-1`,glyph:!1,children:[e.value,(0,K.jsx)(Se,{className:`h-3 w-3`,"aria-hidden":!0})]}):e.value})]},e.label))})}function q({plugin:e,drift:n,onInstall:r,onRemove:i,onUpgrade:s,isInstalling:c,isRemoving:l,isUpgrading:u,hasLocalEdits:d,enabled:f,onToggle:p,isToggling:m}){let{t:h}=k(`intelligence`),[g,_]=(0,G.useState)(!1),[v,y]=(0,G.useState)(!1),b=e.installed??!1,x=e.artifact??null,S=n?.status===`update-available`,C=S?h(`pluginDetailShared.upgradeTitle`,{fromSha:qe(n?.local?.commit??null),toSha:qe(n?.remote?.commit??null)}):void 0;return(0,K.jsxs)(K.Fragment,{children:[b?(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 md:flex-nowrap md:shrink-0`,children:[f!==void 0&&p?(0,K.jsx)(a,{label:h(`pluginDetailShared.autoIncludeInChat`),checked:f,onChange:()=>p(),disabled:m}):null,x?(0,K.jsx)(t,{type:`button`,leftIcon:(0,K.jsx)(Ae,{"aria-hidden":!0}),onClick:()=>void o(x.url,ot(x.url)),children:x.label??h(`pluginDetailShared.download`)}):null,S?(0,K.jsx)(t,{type:`button`,onClick:()=>{if(d){y(!0);return}s()},disabled:u,title:C,loading:u,leftIcon:(0,K.jsx)(be,{"aria-hidden":!0}),children:h(`pluginDetailShared.upgrade`)}):null,(0,K.jsx)(t,{type:`button`,variant:`dangerOutline`,onClick:()=>_(!0),disabled:l,loading:l,leftIcon:(0,K.jsx)(N,{"aria-hidden":!0}),children:h(`pluginDetailShared.remove`)})]}):(0,K.jsx)(t,{type:`button`,onClick:r,disabled:c,loading:c,leftIcon:(0,K.jsx)(P,{"aria-hidden":!0}),children:h(`pluginDetailShared.install`)}),(0,K.jsx)(T,{open:g,title:h(`pluginDetailShared.removePluginTitle`),message:$e(e.name),confirmLabel:h(`pluginDetailShared.remove`),destructive:!0,onConfirm:()=>{_(!1),i()},onCancel:()=>_(!1)}),(0,K.jsx)(T,{open:v,title:h(`pluginDetailShared.upgradePluginTitle`),message:et(e.name),confirmLabel:tt,destructive:!0,onConfirm:()=>{y(!1),s()},onCancel:()=>y(!1)})]})}function ct(){return(0,K.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,K.jsx)(L,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})})}function lt(){let{t:e}=k(`intelligence`);return(0,K.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-12 text-center`,style:{color:`var(--content-tertiary)`},children:[(0,K.jsx)(ge,{className:`h-6 w-6`,"aria-hidden":!0}),(0,K.jsx)(`p`,{className:`text-body-medium-default`,children:e(`pluginDetailShared.loadErrorTitle`)}),(0,K.jsx)(`p`,{className:`text-body-small-lighter`,children:e(`pluginDetailShared.loadErrorDetail`)})]})}function J({isInstallError:e,isRemoveError:t,isUpgradeError:n}){let r=e?nt:t?rt:n?it:null;return r?(0,K.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 rounded px-3 py-2 text-body-small-default`,style:{backgroundColor:`var(--surface-active)`,color:`var(--content-warning, var(--content-tertiary))`},role:`alert`,children:[(0,K.jsx)(ge,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0}),r]}):null}function ut({external:e,className:t}){let{t:n}=k(`intelligence`),r=e?{label:n(`pluginOriginBadge.external`),icon:he}:{label:n(`pluginOriginBadge.local`),icon:Fe};return(0,K.jsx)(f,{tone:`neutral`,leftIcon:(0,G.createElement)(r.icon),className:t,children:r.label})}function Y({onClick:e,isUpgrading:t=!1}={}){let{t:n}=k(`intelligence`),r=(0,G.createElement)(t?L:be,{className:t?`animate-spin`:void 0}),i=n(`updateAvailableBadge.updateAvailable`);return e?(0,K.jsx)(l,{tone:`warning`,leftIcon:r,onClick:t=>{t.stopPropagation(),e()},disabled:t,"aria-label":n(`updateAvailableBadge.upgradePluginAriaLabel`),className:`shrink-0`,children:i}):(0,K.jsx)(f,{tone:`warning`,leftIcon:r,className:`shrink-0`,children:i})}var dt=300*1e3;function X({assistantId:e,name:t,enabled:n=!0}){return O({...w({path:{assistant_id:e,name:t}}),enabled:!!e&&!!t&&n,staleTime:dt,retry:!1})}function ft(e){let t=e?.local?.localChanges;return!!t&&t?.clean===!1}function Z(e,t,n){let{t:r}=k(`intelligence`),i=ce(),a=n?.onInstalled,o=n?.onRemoved,s=O({...x({path:{assistant_id:e,name:t}}),enabled:!!e&&!!t}),l=X({assistantId:e,name:t,enabled:s.data?.installed??!1}).data,u=(0,G.useCallback)(()=>c(i,e,t),[e,t,i]),d=Ke(e,t,{onInstalled:a,onRemoved:o}),f=b({onSuccess:e=>{u(),C.success(e.outcome===`already-up-to-date`?r(`pluginToast.alreadyUpToDate`,{name:t||r(`pluginToast.pluginFallbackCapitalized`)}):r(`pluginToast.upgraded`,{name:t||r(`pluginToast.pluginFallback`),sha:qe(e.toCommit)}))}});return{plugin:s.data??null,drift:l,isLoading:s.isLoading,isError:s.isError,install:d.install,remove:d.remove,upgrade:()=>{f.mutate({path:{assistant_id:e,name:t},body:{}})},isInstalling:d.isInstalling,isRemoving:d.isRemoving,isUpgrading:f.isPending,isInstallError:d.isInstallError,isRemoveError:d.isRemoveError,isUpgradeError:f.isError,hasLocalEdits:ft(l)}}function pt(e){let t=ce(),n={queryKey:E({path:{assistant_id:e}})},r=(e,r)=>{t.setQueriesData(n,t=>t&&{...t,plugins:t.plugins.map(t=>t.name===e?{...t,enabled:r}:t)})},i=se({mutationFn:async({name:t,nextEnabled:n})=>{let r=await(n?D({path:{assistant_id:e,name:t},throwOnError:!1}):te({path:{assistant_id:e,name:t},throwOnError:!1})),i=r.response?.status;if(r.response?.ok||i===409)return r;throw Error(`Plugin toggle failed (${i??`network error`})`)},onMutate:async({name:e,nextEnabled:i})=>{await t.cancelQueries(n),r(e,i)},onError:(e,{name:t,nextEnabled:n})=>{r(t,!n),C.error(at)},onSettled:(n,r,i)=>{c(t,e,i.name)}});return{toggle:(e,t)=>{i.mutate({name:e,nextEnabled:t})},togglingName:i.isPending?i.variables?.name??null:null}}function mt({assistantId:e,name:n,onBack:i,externalHint:a,enabled:o}){let{plugin:s,drift:c,isLoading:l,isError:u,install:f,remove:p,upgrade:m,isInstalling:h,isRemoving:g,isUpgrading:_,isInstallError:v,isRemoveError:y,isUpgradeError:b,hasLocalEdits:x}=Z(e,n,{onRemoved:i}),{t:S}=k(`intelligence`),{toggle:C,togglingName:ee}=pt(e),w=U(e,n,s?.hasIcon,s?.iconVersion);return(0,K.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col`,children:[(0,K.jsxs)(`div`,{className:`mb-4 flex items-start gap-3`,children:[(0,K.jsx)(t,{type:`button`,variant:`ghost`,iconOnly:(0,K.jsx)(Le,{"aria-hidden":!0}),"aria-label":S(`pluginDetail.backToPluginsAriaLabel`),onClick:i}),(0,K.jsx)(ht,{name:n,plugin:s,externalHint:a,iconSrc:w,drift:c,onInstall:f,onRemove:p,onUpgrade:m,isInstalling:h,isRemoving:g,isUpgrading:_,hasLocalEdits:x,enabled:o,onToggle:()=>C(n,!o),isToggling:ee===n})]}),(v||y||b)&&(0,K.jsx)(J,{isInstallError:v,isRemoveError:y,isUpgradeError:b}),(0,K.jsx)(r.Root,{asChild:!0,children:(0,K.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-6 py-5`,children:l?(0,K.jsx)(ct,{}):u||!s?(0,K.jsx)(lt,{}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(st,{plugin:s,surfaces:c?.surfaces??null}),s.readme?(0,K.jsx)(d,{content:s.readme}):(0,K.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:S(`pluginDetail.noReadme`)})]})})})]})}function ht({name:e,plugin:t,externalHint:n,iconSrc:r,drift:i,onInstall:a,onRemove:o,onUpgrade:s,isInstalling:c,isRemoving:l,isUpgrading:u,hasLocalEdits:d,enabled:f,onToggle:p,isToggling:m}){let{t:h}=k(`intelligence`),g=t?.source?.kind===`github`,_=t?g:n,v=i?.status===`update-available`;return(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3 sm:flex-row sm:items-center`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-start gap-3`,children:[_===void 0?(0,K.jsx)(`span`,{"aria-hidden":!0,className:`h-8 w-8 shrink-0`}):(0,K.jsx)(W,{external:_,icon:t?.icon??void 0,iconSrc:r,size:`md`}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,K.jsx)(`h2`,{className:`text-title-medium`,style:{color:`var(--content-default)`},children:t?.name??e}),t?.version?(0,K.jsx)(`span`,{className:`shrink-0 text-body-small-default`,style:{color:`var(--content-tertiary)`},children:h(`pluginDetail.version`,{version:t.version})}):null,t?(0,K.jsx)(ut,{external:g}):null,v?(0,K.jsx)(Y,{}):null]}),t?.description?(0,K.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-body-medium-lighter`,style:{color:`var(--content-secondary)`},children:t.description}):null]})]}),t?(0,K.jsx)(q,{plugin:t,drift:i,onInstall:a,onRemove:o,onUpgrade:s,isInstalling:c,isRemoving:l,isUpgrading:u,hasLocalEdits:d,enabled:f,onToggle:p,isToggling:m}):null]})}var gt=e(ue(),1);function _t({assistantId:e,name:n,onBack:i,externalHint:a,enabled:o}){let{plugin:s,drift:c,isLoading:l,isError:u,install:f,remove:p,upgrade:m,isInstalling:h,isRemoving:g,isUpgrading:_,isInstallError:v,isRemoveError:y,isUpgradeError:b,hasLocalEdits:x}=Z(e,n,{onRemoved:i}),{t:S}=k(`intelligence`),{toggle:C,togglingName:ee}=pt(e),[w,te]=(0,G.useState)(null);(0,G.useEffect)(()=>{te(document.getElementById(`viewport-overlays`))},[]);let T=s?.source?.kind===`github`,ne=s?T:a,E=c?.status===`update-available`,D=s?.name??n,re=U(e,n,s?.hasIcon,s?.iconVersion),ie=(0,K.jsxs)(`div`,{className:`fixed inset-0 z-40 flex flex-col overflow-hidden bg-[var(--surface-overlay)]`,style:{paddingTop:`calc(8px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px)))`,paddingBottom:`calc(8px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)))`,paddingLeft:`calc(12px + var(--safe-area-inset-left, env(safe-area-inset-left, 0px)))`,paddingRight:`calc(12px + var(--safe-area-inset-right, env(safe-area-inset-right, 0px)))`},children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,K.jsx)(t,{variant:`ghost`,iconOnly:(0,K.jsx)(Le,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":S(`pluginDetail.backToPluginsAriaLabel`),onClick:i,className:`max-md:bg-[var(--surface-active)]`}),(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate px-2 text-center text-body-medium-default`,style:{color:`var(--content-secondary)`},children:D}),(0,K.jsx)(`span`,{"aria-hidden":!0,className:`h-8 w-8 shrink-0 touch-mobile:h-10 touch-mobile:w-10`})]}),(0,K.jsxs)(`div`,{className:`mt-4 flex flex-col gap-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[ne===void 0?(0,K.jsx)(`span`,{"aria-hidden":!0,className:`h-8 w-8 shrink-0`}):(0,K.jsx)(W,{external:ne,icon:s?.icon??void 0,iconSrc:re,size:`md`}),(0,K.jsx)(`h2`,{className:`min-w-0 truncate text-title-medium`,style:{color:`var(--content-emphasised)`},children:D})]}),(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[E?(0,K.jsx)(Y,{}):null,s?(0,K.jsx)(ut,{external:T}):null]})]}),s?.description?(0,K.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:s.description}):null]}),s?(0,K.jsx)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:(0,K.jsx)(q,{plugin:s,drift:c,enabled:o,onToggle:()=>C(n,!o),isToggling:ee===n,onInstall:f,onRemove:p,onUpgrade:m,isInstalling:h,isRemoving:g,isUpgrading:_,hasLocalEdits:x})}):null,(v||y||b)&&(0,K.jsx)(`div`,{className:`mt-3`,children:(0,K.jsx)(J,{isInstallError:v,isRemoveError:y,isUpgradeError:b})}),(0,K.jsx)(r.Root,{asChild:!0,noPadding:!0,children:(0,K.jsx)(`div`,{className:`mt-6 flex min-h-0 flex-1 flex-col overflow-hidden rounded-2xl border bg-[var(--surface-lift)]`,style:{borderColor:`var(--border-hover)`},children:(0,K.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-4`,children:l?(0,K.jsx)(ct,{}):u||!s?(0,K.jsx)(lt,{}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(st,{plugin:s,surfaces:c?.surfaces??null}),s.readme?(0,K.jsx)(d,{content:s.readme}):(0,K.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:S(`pluginDetail.noReadme`)})]})})})})]});return w?(0,gt.createPortal)(ie,w):ie}function vt({assistantId:e,item:n,drift:i,onSelect:a,onInstall:o,onRemove:s,onUpgrade:c,isInstalling:l=!1,isRemoving:u=!1,isUpgrading:d=!1}){let{t:p}=k(`intelligence`),m=n.status===`available`,h=i?.status===`update-available`,g=n.enabled!==void 0,_=n.enabled===!1,v=U(e,n.name,n.hasIcon,n.iconVersion);return(0,K.jsx)(r.Root,{asChild:!0,children:(0,K.jsxs)(`div`,{role:`button`,tabIndex:0,onClick:a,onKeyDown:e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),a())},className:`flex cursor-pointer items-center gap-3 px-3 py-2 text-left transition-colors hover:bg-[var(--surface-hover)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]`,children:[(0,K.jsx)(W,{size:`sm`,external:n.external,icon:n.icon,iconUrl:n.iconUrl,iconSrc:v,className:_?`opacity-50`:void 0}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`truncate text-body-medium-default`,style:{color:_?`var(--content-tertiary)`:`var(--content-emphasised)`},children:n.name}),n.version?(0,K.jsx)(`span`,{className:`shrink-0 text-body-small-default`,style:{color:`var(--content-tertiary)`},children:p(`pluginListRow.version`,{version:n.version})}):null,(0,K.jsx)(f,{tone:`neutral`,leftIcon:(0,K.jsx)(F,{"aria-hidden":!0}),children:p(`pluginListRow.pluginTag`)}),h?(0,K.jsx)(Y,{onClick:c,isUpgrading:d}):null]}),(0,K.jsx)(`p`,{className:`mt-1 truncate text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:n.description??p(`pluginListRow.noDescription`)}),n.issues&&n.issues.length>0?(0,K.jsxs)(`p`,{className:`mt-1 truncate text-body-small-default`,style:{color:`var(--content-warning, var(--content-tertiary))`},title:n.issues.join(`; `),children:[n.issues[0],n.issues.length>1?p(`pluginListRow.moreIssues`,{count:n.issues.length-1}):null]}):null]}),m?l?(0,K.jsx)(t,{type:`button`,loading:!0,iconOnly:(0,K.jsx)(P,{"aria-hidden":!0}),disabled:!0,"aria-label":p(`pluginListRow.installingAriaLabel`),expandOnMobile:!1}):(0,K.jsx)(t,{type:`button`,iconOnly:(0,K.jsx)(P,{"aria-hidden":!0}),onClick:e=>{e.stopPropagation(),o?.()},disabled:!o,"aria-label":p(`pluginListRow.installPluginAriaLabel`),expandOnMobile:!1}):(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[g?(0,K.jsx)(f,{tone:n.enabled?`positive`:`neutral`,children:n.enabled?p(`pluginListRow.enabled`):p(`pluginListRow.disabled`)}):null,(0,K.jsx)(t,{type:`button`,variant:`dangerOutline`,loading:u,iconOnly:(0,K.jsx)(N,{"aria-hidden":!0}),onClick:e=>{e.stopPropagation(),s?.()},disabled:u||d||!s,"aria-label":p(`pluginListRow.removePluginAriaLabel`),expandOnMobile:!1})]})]})})}var yt={mail:xe,calendar:ke,"message-circle":ve,globe:he,zap:z,code:Oe,mic:Pe,"shopping-cart":B,palette:je,heart:Ce,settings:Te,"link-2":Me};function bt(e){return yt[e]}var Q={email:`categories.email`,calendar:`categories.calendar`,messaging:`categories.messaging`,browsing:`categories.browsing`,productivity:`categories.productivity`,development:`categories.development`,voice:`categories.voice`,commerce:`categories.commerce`,content:`categories.content`,health:`categories.health`,system:`categories.system`,integrations:`categories.integrations`,other:`categories.other`};function xt({selected:e,onSelect:t,counts:n,totalCount:r,showCounts:i,categories:a,ariaLabel:o}){let{t:s}=k(`intelligence`),c=e=>{let t=Q[e.slug];return t?s(t,e.label):e.label},l=[...a].sort((e,t)=>c(e).localeCompare(c(t)));return(0,K.jsxs)(`nav`,{className:`flex flex-col gap-1`,"aria-label":o??s(`categorySidebar.skillCategoriesAriaLabel`),children:[(0,K.jsx)(St,{icon:R,label:s(`categorySidebar.all`),count:r,isActive:e===null,showCount:i,onClick:()=>t(null)}),l.map(r=>(0,K.jsx)(St,{icon:bt(r.icon)??R,label:c(r),count:n[r.slug]??0,isActive:e===r.slug,showCount:i,onClick:()=>t(r.slug)},r.slug))]})}function St({icon:e,label:n,count:r,isActive:i,showCount:a,onClick:o}){return(0,K.jsxs)(t,{variant:`ghost`,onClick:o,"aria-pressed":i,className:`h-auto justify-between gap-3 rounded-lg border-0 bg-transparent px-3 py-2 text-left hover:bg-[var(--ghost-hover)]`,style:{backgroundColor:i?`var(--surface-active)`:void 0,color:i?`var(--content-default)`:`var(--content-secondary)`},children:[(0,K.jsxs)(`span`,{className:`flex items-center gap-2.5`,children:[(0,K.jsx)(e,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0}),(0,K.jsx)(`span`,{className:`text-body-medium-default`,children:n})]}),a&&(0,K.jsx)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:r})]})}function Ct({skill:e,onSelect:n,onInstall:i,onRemove:a,isInstalling:o=!1,isRemoving:s=!1}){let{t:c}=k(`intelligence`),l=H(e),u=S(e);return(0,K.jsx)(r.Root,{asChild:!0,children:(0,K.jsxs)(`div`,{role:`button`,tabIndex:0,onClick:n,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),n())},className:`flex cursor-pointer items-center gap-3 px-3 py-2 text-left transition-colors hover:bg-[var(--surface-hover)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]`,children:[(0,K.jsx)(`div`,{className:`flex shrink-0 items-center justify-center text-[28px] leading-none`,children:(0,K.jsx)(He,{skill:e,className:`h-7 w-7`})}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`truncate text-body-medium-default`,style:{color:`var(--content-emphasised)`},children:e.name}),(0,K.jsx)(Re,{origin:e.origin})]}),(0,K.jsx)(`p`,{className:`mt-1 truncate text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:e.description})]}),l?o?(0,K.jsx)(t,{type:`button`,loading:!0,iconOnly:(0,K.jsx)(P,{"aria-hidden":!0}),disabled:!0,"aria-label":c(`skillRow.installingAriaLabel`),expandOnMobile:!1}):(0,K.jsx)(t,{type:`button`,iconOnly:(0,K.jsx)(P,{"aria-hidden":!0}),onClick:e=>{e.stopPropagation(),i?.()},disabled:!i,"aria-label":c(`skillRow.installSkillAriaLabel`),expandOnMobile:!1}):(0,K.jsx)(t,{type:`button`,variant:`dangerOutline`,loading:s,iconOnly:(0,K.jsx)(N,{"aria-hidden":!0}),onClick:e=>{e.stopPropagation(),a?.()},disabled:!u||s||!a,"aria-label":c(u?`skillRow.removeSkillAriaLabel`:`skillRow.bundledSkillCannotBeRemovedAriaLabel`),title:u?void 0:c(`skillRow.bundledSkillsCannotBeRemoved`),expandOnMobile:!1})]})})}function $(e,t){switch(e){case`vellum`:return`Vellum`;case`clawhub`:return`Clawhub`;case`skillssh`:return`skills.sh`;case`all`:return t(`superpowersFilters.filterLabel.all`);case`installed`:return t(`superpowersFilters.filterLabel.installed`);case`available`:return t(`superpowersFilters.filterLabel.available`);case`skills`:return t(`superpowersFilters.filterLabel.skills`);case`plugins`:return t(`superpowersFilters.filterLabel.plugins`);case`custom`:return t(`superpowersFilters.filterLabel.custom`);case`assistant-memory`:return t(`superpowersFilters.filterLabel.assistantMemory`)}}function wt(){let{t:e}=k(`intelligence`);return{statusFilters:[{value:`all`,label:$(`all`,e),icon:R},{value:`installed`,label:$(`installed`,e),icon:me},{value:`available`,label:$(`available`,e),icon:P}],typeFilters:[{value:`skills`,label:$(`skills`,e),icon:z},{value:`plugins`,label:$(`plugins`,e),icon:F}],originFilters:[{value:`vellum`,label:$(`vellum`,e),icon:Be},{value:`clawhub`,label:$(`clawhub`,e),icon:he},{value:`skillssh`,label:$(`skillssh`,e),icon:ye},{value:`custom`,label:$(`custom`,e),icon:we},{value:`assistant-memory`,label:$(`assistant-memory`,e),icon:Ee}]}}function Tt({search:e,onSearchChange:t,filter:n,onFilterChange:r,isSearching:i,categories:a,category:o,onCategoryChange:s,counts:c,totalCount:l,showCounts:d,pluginsSupported:f,showCategories:p}){let{t:m}=k(`intelligence`);return(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(u,{type:`search`,value:e,onChange:e=>{t(e.target.value)},placeholder:m(`superpowersFilters.searchPlaceholder`),"aria-label":m(`superpowersFilters.searchAriaLabel`),leftIcon:(0,K.jsx)(Ne,{className:`h-4 w-4`,"aria-hidden":!0}),rightIcon:i?(0,K.jsx)(L,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}):void 0,fullWidth:!0,wrapperClassName:`flex-1`}),(0,K.jsx)(Et,{filter:n,onFilterChange:r,categories:a,category:o,onCategoryChange:s,counts:c,totalCount:l,showCounts:d,pluginsSupported:f,showCategories:p})]})}function Et(e){let{t:r}=k(`intelligence`),a=i(),[o,s]=(0,G.useState)(!1),{statusFilters:c,typeFilters:l,originFilters:u}=wt(),d=(0,K.jsx)(t,{type:`button`,variant:`outlined`,iconOnly:(0,K.jsx)(Qe,{"aria-hidden":!0}),"aria-label":r(`superpowersFilters.filterAriaLabel`),"aria-haspopup":a?`dialog`:`listbox`,"aria-expanded":o,tintColor:`var(--primary-base)`});if(a)return(0,K.jsx)(Dt,{...e,open:o,onOpenChange:s,trigger:d});let f=t=>{e.onFilterChange(t),s(!1)};return(0,K.jsxs)(n.Root,{open:o,onOpenChange:s,children:[(0,K.jsx)(n.Trigger,{asChild:!0,children:d}),(0,K.jsx)(n.Content,{align:`end`,sideOffset:4,className:`w-44`,children:(0,K.jsxs)(`ul`,{role:`listbox`,children:[(0,K.jsx)(Mt,{label:r(`superpowersFilters.statusLabel`),options:c,selected:e.filter,onSelect:f}),e.pluginsSupported&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`my-1 h-px bg-[var(--border-base)]`}),(0,K.jsx)(Mt,{label:r(`superpowersFilters.typeLabel`),options:l,selected:e.filter,onSelect:f})]}),(0,K.jsx)(`div`,{className:`my-1 h-px bg-[var(--border-base)]`}),(0,K.jsx)(Mt,{label:r(`superpowersFilters.sourceLabel`),options:u,selected:e.filter,onSelect:f}),e.showCategories&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`my-1 h-px bg-[var(--border-base)]`}),(0,K.jsx)(jt,{categories:e.categories,category:e.category,counts:e.counts,totalCount:e.totalCount,showCounts:e.showCounts,allLabel:r(`superpowersFilters.filterLabel.all`),categoriesLabel:r(`superpowersFilters.categoriesLabel`),onSelect:t=>{e.onCategoryChange(t),s(!1)}})]})]})})]})}function Dt({filter:e,onFilterChange:n,categories:r,category:i,onCategoryChange:a,counts:o,totalCount:s,showCounts:c,pluginsSupported:l,showCategories:u,open:d,onOpenChange:f,trigger:m}){let{t:h}=k(`intelligence`),{statusFilters:g,typeFilters:_,originFilters:v}=wt();return(0,K.jsxs)(p.Root,{open:d,onOpenChange:f,children:[(0,K.jsx)(p.Trigger,{asChild:!0,children:m}),(0,K.jsxs)(p.Content,{className:`max-h-[85dvh]`,"aria-describedby":void 0,children:[(0,K.jsx)(`div`,{"aria-hidden":!0,className:`mx-auto mb-3 h-1 w-9 shrink-0 rounded-full bg-[var(--border-element)]`}),(0,K.jsx)(p.Header,{children:(0,K.jsx)(p.Title,{children:h(`superpowersFilters.filtersTitle`)})}),(0,K.jsxs)(p.Body,{className:`flex flex-col gap-3 pt-2`,children:[(0,K.jsx)(Ot,{label:h(`superpowersFilters.statusLabel`),children:g.map(t=>(0,K.jsx)(kt,{icon:t.icon,label:t.label,active:e===t.value,onSelect:()=>n(t.value)},t.value))}),l&&(0,K.jsx)(Ot,{label:h(`superpowersFilters.typeLabel`),children:_.map(t=>(0,K.jsx)(kt,{icon:t.icon,label:t.label,active:e===t.value,onSelect:()=>n(t.value)},t.value))}),(0,K.jsx)(Ot,{label:h(`superpowersFilters.sourceLabel`),children:v.map(t=>(0,K.jsx)(kt,{icon:t.icon,label:t.label,active:e===t.value,onSelect:()=>n(t.value)},t.value))}),u&&(0,K.jsxs)(Ot,{label:h(`superpowersFilters.categoriesLabel`),children:[(0,K.jsx)(kt,{icon:R,label:h(`superpowersFilters.filterLabel.all`),active:i===null,badge:c?s:void 0,onSelect:()=>a(null)}),At(r).map(e=>(0,K.jsx)(kt,{icon:bt(e.icon)??R,label:e.label,active:i===e.slug,badge:c?o[e.slug]??0:void 0,onSelect:()=>a(e.slug)},e.slug))]})]}),(0,K.jsx)(p.Footer,{children:(0,K.jsx)(t,{type:`button`,variant:`primary`,fullWidth:!0,onClick:()=>f(!1),children:h(`superpowersFilters.done`)})})]})]})}function Ot({label:e,children:t}){return(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`px-2 pb-1 text-body-small-default uppercase tracking-wide`,style:{color:`var(--content-tertiary)`},children:e}),t]})}function kt({icon:e,label:t,active:n,badge:r,onSelect:i}){return(0,K.jsx)(s,{icon:e,label:t,active:n,activeVariant:`branded`,badge:r,trailingAction:n&&r==null?(0,K.jsx)(_e,{className:`h-4 w-4 text-[var(--primary-base)]`,"aria-hidden":!0}):void 0,onSelect:i})}function At(e){return[...e].sort((e,t)=>e.label.localeCompare(t.label))}function jt({categories:e,category:t,counts:n,totalCount:r,showCounts:i,allLabel:a,categoriesLabel:o,onSelect:s}){return(0,K.jsx)(Nt,{label:o,children:(0,K.jsx)(`ul`,{className:`max-h-48 overflow-y-auto`,children:[{slug:null,label:a,count:r},...At(e).map(e=>({slug:e.slug,label:e.label,count:n[e.slug]??0}))].map(e=>{let n=t===e.slug;return(0,K.jsx)(`li`,{children:(0,K.jsxs)(`button`,{type:`button`,onClick:()=>s(e.slug),role:`option`,"aria-selected":n,className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-body-medium-default transition-colors hover:bg-[var(--surface-hover)] ${n?`text-[var(--primary-base)]`:`text-[var(--content-secondary)] hover:text-[var(--content-emphasised)]`}`,children:[(0,K.jsx)(`span`,{className:`flex-1 truncate`,children:e.label}),i&&(0,K.jsx)(`span`,{style:{color:`var(--content-tertiary)`},children:e.count})]})},e.slug??`all`)})})})}function Mt({label:e,options:t,selected:n,onSelect:r}){return(0,K.jsx)(Nt,{label:e,children:(0,K.jsx)(`ul`,{children:t.map(e=>{let t=e.icon,i=n===e.value;return(0,K.jsx)(`li`,{children:(0,K.jsxs)(`button`,{type:`button`,onClick:()=>r(e.value),role:`option`,"aria-selected":i,className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-body-medium-default transition-colors hover:bg-[var(--surface-hover)] ${i?`text-[var(--primary-base)]`:`text-[var(--content-secondary)] hover:text-[var(--content-emphasised)]`}`,children:[(0,K.jsx)(t,{className:`h-4 w-4`,"aria-hidden":!0}),(0,K.jsx)(`span`,{className:`flex-1`,children:e.label}),i&&(0,K.jsx)(me,{className:`h-3.5 w-3.5`,"aria-hidden":!0})]})},e.value)})})})}function Nt({label:e,children:t}){return(0,K.jsxs)(`li`,{role:`group`,"aria-label":e,children:[(0,K.jsx)(`div`,{className:`px-2 py-1.5 text-body-small-default uppercase tracking-wide text-[var(--content-tertiary)]`,children:e}),t]})}function Pt(e){return O({...re({path:{assistant_id:e}}),select:e=>e.categories,staleTime:300*1e3})}var Ft=new Set([`all`,`installed`,`available`,`skills`,`plugins`,`vellum`,`clawhub`,`skillssh`,`custom`,`assistant-memory`]);function It(e){let t=e.get(`filter`),n=e.get(`category`);return{q:e.get(`q`)??``,filter:zt(t)?t:`all`,category:n||null}}function Lt(e,t){let n=new URLSearchParams(e);return t.q!==void 0&&Rt(n,`q`,t.q.trim()||null),t.filter!==void 0&&Rt(n,`filter`,t.filter===`all`?null:t.filter),t.category!==void 0&&Rt(n,`category`,t.category),n}function Rt(e,t,n){n===null?e.delete(t):e.set(t,n)}function zt(e){return e!==null&&Ft.has(e)}function Bt(e){switch(e){case`installed`:return{kind:`installed`};case`available`:return{kind:`available`};case`vellum`:case`clawhub`:case`skillssh`:case`custom`:case`assistant-memory`:return{origin:e};default:return{}}}function Vt(e){return e!==`plugins`}function Ht(e){return e===`all`||e===`installed`||e===`available`||e===`plugins`}function Ut(e){switch(e){case`installed`:return`installed`;case`available`:return`available`;default:return`all`}}var Wt=300,Gt=`vellum:superpowers:tipDismissed`;function Kt(e){return[...e].sort((e,t)=>e.installed===t.installed?e.name.localeCompare(t.name,void 0,{sensitivity:`base`}):e.installed?-1:1)}function qt({assistantId:e}){let{t}=k(`intelligence`),n=fe(),r=de(),i=ce(),a=ne(),o=ee.use.version(),s=We(),[l,u]=le(),{q:d,filter:f,category:p}=(0,G.useMemo)(()=>It(l),[l]),_=l.get(`plugin`),y=(0,G.useCallback)(e=>{u(t=>Lt(t,e),{replace:!0})},[u]),x=l.get(`success`),S=(0,G.useRef)(!1);(0,G.useEffect)(()=>{x!==`true`||S.current||(S.current=!0,_&&C.success(t(`pluginToast.installed`,{name:_})),u(e=>{let t=new URLSearchParams(e);return t.delete(`success`),t},{replace:!0}))},[x,_,u,t]);let[w,te]=(0,G.useState)(d),E=Ze(w.trim(),Wt),D=(0,G.useRef)(d);(0,G.useEffect)(()=>{if(d!==D.current&&(D.current=d,d!==w.trim())){te(d);return}E!==d&&E===w.trim()&&(D.current=E,y({q:E}))},[E,d,w,y]);let re=(0,G.useCallback)(e=>y({filter:e}),[y]),oe=(0,G.useCallback)(e=>y({category:e}),[y]),[se,A]=(0,G.useState)(()=>ae(Gt,!1)),ue=(0,G.useCallback)(()=>{A(!0),g(Gt,!0)},[]),j=!s&&f===`plugins`?`all`:f,M=Vt(j),pe=s&&Ht(j),N=Ut(j),{handleInstall:me,handleRemove:he,isInstallingSkill:ge,isRemovingSkill:P,skillPendingRemoval:_e,confirmRemove:ve,cancelRemove:ye}=Ve(e),{data:F=[]}=Pt(e),{origin:be,kind:xe}=(0,G.useMemo)(()=>Bt(j),[j]),I=O({...h({path:{assistant_id:e},query:{include:`catalog`,origin:be,kind:xe,q:E||void 0,category:p??void 0}}),select:e=>({skills:e.skills,categoryCounts:e.categoryCounts,totalCount:e.totalCount}),enabled:!!e&&M}),L=O({...h({path:{assistant_id:e},query:{include:`catalog`,origin:be,kind:xe,q:E||void 0}}),select:e=>({skills:e.skills,categoryCounts:e.categoryCounts,totalCount:e.totalCount}),enabled:!!e&&M&&p!==null}),{items:Se,isLoading:Ce,catalogLoading:we,isError:Te,isFetching:Ee,catalogError:De,categorySupported:R,installedCategoryCounts:Oe,installedPlugins:ke,installedTotal:z,catalogMatches:Ae,unfilteredInstalledNames:je}=Je(e,p,s),B=pe&&(p===null||R),Me=(0,G.useCallback)(t=>c(i,e,t),[e,i]),[Ne,Pe]=(0,G.useState)(null),[Fe,Ie]=(0,G.useState)(null),[Le,Re]=(0,G.useState)(null),[V,Be]=(0,G.useState)(null),[H,He]=(0,G.useState)(null),Ke=m({onMutate:e=>Pe(e.body.name),onSuccess:(e,n)=>C.success(t(`pluginToast.installed`,{name:n.body.name})),onError:()=>C.error(nt),onSettled:(e,t,n)=>{Pe(null),Me(n.body.name)}}),U=v({onMutate:e=>Ie(e.path.name),onSuccess:(e,n)=>{C.success(t(`pluginToast.removed`,{name:n.path.name})),Ye(e.warnings,t)},onError:()=>C.error(rt),onSettled:(e,t,n)=>{Ie(null),Me(n.path.name)}}),W=b({onMutate:e=>Re(e.path.name),onSuccess:(e,n)=>C.success(e.outcome===`already-up-to-date`?t(`pluginToast.alreadyUpToDate`,{name:n.path.name}):t(`pluginToast.upgraded`,{name:n.path.name,sha:qe(e.toCommit)})),onError:()=>C.error(it),onSettled:(e,t,n)=>{Re(null),Me(n.path.name)}}),Qe=(0,G.useCallback)(e=>u(t=>{let n=new URLSearchParams(t);return n.set(`plugin`,e.name),n}),[u]),at=(0,G.useCallback)(()=>u(e=>{let t=new URLSearchParams(e);return t.delete(`plugin`),t},{replace:!0}),[u]),ot=(0,G.useCallback)(t=>{Ke.mutate({path:{assistant_id:e},body:{name:t.name}})},[e,Ke]),st=(0,G.useCallback)(()=>{V&&(U.mutate({path:{assistant_id:e,name:V.name}}),Be(null))},[e,V,U]),q=(0,G.useCallback)(t=>{W.mutate({path:{assistant_id:e,name:t},body:{}})},[e,W]),ct=(0,G.useCallback)(()=>{H&&(q(H.name),He(null))},[H,q]),lt=(0,G.useCallback)((e,t)=>{if(ft(t)){He(e);return}q(e.name)},[q]),J=(0,G.useMemo)(()=>M?I.data?.skills??[]:[],[M,I.data?.skills]),ut=(0,G.useMemo)(()=>B?Xe(Se,N).filter(e=>Ge(e,E)):[],[B,Se,N,E]),Y=(0,G.useMemo)(()=>Kt([...J.map(e=>({type:`skill`,key:`skill:${e.id}`,name:e.name,installed:ze(e),skill:e})),...ut.map(e=>({type:`plugin`,key:`plugin:${e.name}`,name:e.name,installed:e.status===`installed`,item:e}))]),[J,ut]),dt=p===null?I.data:L.data,X=Jt(M,dt?.skills??J,dt?.categoryCounts,dt?.totalCount),Z=Yt(pe&&R,Oe,ke,z,Ae,je,N),{counts:pt,totalCount:ht}=(0,G.useMemo)(()=>{let e={...X.counts};for(let[t,n]of Object.entries(Z.counts))e[t]=(e[t]??0)+n;return{counts:e,totalCount:X.totalCount+Z.totalCount}},[X,Z]),gt=M&&I.isLoading,yt=M&&I.isError,bt=B&&Ce,Q=B&&Te,St=(yt||!M)&&(Q||!B)&&(yt||Q),$=gt||bt,wt=!!E&&(M&&I.isFetching||B&&Ee&&!Ce),Et=w.trim().length>0;if(_&&!s&&o===null)return null;if(_&&s){let t=Se.find(e=>e.name===_),n={assistantId:e,name:_,externalHint:t?.external,enabled:t?.enabled,onBack:at};return a?(0,K.jsx)(_t,{...n}):(0,K.jsx)(mt,{...n})}let Dt=(0,K.jsx)(`div`,{className:`min-w-0 flex-1 overflow-y-auto`,children:$?(0,K.jsx)($t,{}):St?(0,K.jsx)(en,{}):Y.length===0?B&&we&&N!==`installed`?(0,K.jsx)($t,{}):(0,K.jsx)(tn,{filter:j,category:p}):(0,K.jsx)(`ul`,{className:`flex flex-col gap-2`,children:Y.map(t=>(0,K.jsx)(`li`,{children:t.type===`skill`?(0,K.jsx)(Ct,{skill:t.skill,onSelect:()=>n(ie.skills.detail(t.skill.id),{state:{listSearch:r.search}}),onInstall:()=>me(t.skill),onRemove:()=>he(t.skill),isInstalling:ge(t.skill),isRemoving:P(t.skill)}):t.installed?(0,K.jsx)(Xt,{assistantId:e,item:t.item,onSelect:()=>Qe(t.item),onRemove:()=>Be(t.item),onUpgrade:e=>lt(t.item,e),isRemoving:Fe===t.item.name,isUpgrading:Le===t.item.name}):(0,K.jsx)(vt,{assistantId:e,item:t.item,onSelect:()=>Qe(t.item),onInstall:()=>ot(t.item),isInstalling:Ne===t.item.name})},t.key))})});return(0,K.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col gap-4`,children:[!se&&(0,K.jsx)(Zt,{onDismiss:ue}),(0,K.jsx)(Tt,{search:w,onSearchChange:te,filter:j,onFilterChange:re,isSearching:wt,categories:F,category:p,onCategoryChange:oe,counts:pt,totalCount:ht,showCounts:!Et,pluginsSupported:s,showCategories:a}),!$&&!St&&yt?(0,K.jsx)(Qt,{text:t(`superpowersTab.skillsUnavailableNotice`)}):null,!$&&!St&&Q?(0,K.jsx)(Qt,{text:t(`superpowersTab.pluginsUnavailableNotice`)}):null,B&&De&&!bt&&!Q?(0,K.jsx)(Qt,{text:t(`superpowersTab.catalogBrowsingUnavailableNotice`)}):null,(0,K.jsxs)(`div`,{className:`flex min-h-0 flex-1 gap-6`,children:[!a&&(0,K.jsx)(`aside`,{className:`w-56 shrink-0 overflow-y-auto`,children:(0,K.jsx)(xt,{ariaLabel:t(`superpowersTab.categoriesAriaLabel`),selected:p,onSelect:oe,counts:pt,totalCount:ht,showCounts:!Et,categories:F})}),Dt]}),(0,K.jsx)(Ue,{skillName:_e?.name??null,onConfirm:ve,onCancel:ye}),(0,K.jsx)(T,{open:V!==null,title:t(`pluginDetailShared.removePluginTitle`),message:V?$e(V.name):``,confirmLabel:t(`pluginDetailShared.remove`),destructive:!0,onConfirm:st,onCancel:()=>Be(null)}),(0,K.jsx)(T,{open:H!==null,title:t(`pluginDetailShared.upgradePluginTitle`),message:H?et(H.name):``,confirmLabel:tt,destructive:!0,onConfirm:ct,onCancel:()=>He(null)})]})}function Jt(e,t,n,r){return(0,G.useMemo)(()=>{if(!e)return{counts:{},totalCount:0};if(n&&Object.keys(n).length>0)return{counts:n,totalCount:r??t.length};let i={};for(let e of t){let t=e.category??`system`;i[t]=(i[t]??0)+1}return{counts:i,totalCount:r??t.length}},[e,t,n,r])}function Yt(e,t,n,r,i,a,o){return(0,G.useMemo)(()=>{if(!e)return{counts:{},totalCount:0};let s={},c=o!==`available`,l=o===`all`||o===`available`;if(c)if(t&&Object.keys(t).length>0)Object.assign(s,t);else for(let e of n){let t=e.category??`system`;s[t]=(s[t]??0)+1}let u=0;if(l)for(let e of i){if(a.has(e.name))continue;let t=e.category??`system`;s[t]=(s[t]??0)+1,u+=1}let d=r??n.length;return{counts:s,totalCount:(c?d:0)+u}},[e,t,n,r,i,a,o])}function Xt({assistantId:e,item:t,onSelect:n,onRemove:r,onUpgrade:i,isRemoving:a,isUpgrading:o}){let s=X({assistantId:e,name:t.name}).data;return(0,K.jsx)(vt,{assistantId:e,item:t,drift:s,onSelect:n,onRemove:r,onUpgrade:()=>i(s),isRemoving:a,isUpgrading:o})}function Zt({onDismiss:e}){let{t:n}=k(`intelligence`);return(0,K.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg px-4 py-2.5 text-body-small-default`,style:{backgroundColor:`var(--surface-base)`,color:`var(--content-secondary)`},children:[(0,K.jsx)(pe,{className:`h-4 w-4 shrink-0`,style:{color:`var(--primary-base)`}}),(0,K.jsx)(`p`,{className:`flex-1`,children:n(`superpowersTab.tipBannerText`)}),(0,K.jsx)(t,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,K.jsx)(De,{"aria-hidden":!0}),onClick:e,"aria-label":n(`superpowersTab.dismissTipAriaLabel`),tintColor:`var(--content-tertiary)`,expandOnMobile:!1})]})}function Qt({text:e}){return(0,K.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg px-4 py-2.5 text-body-small-default`,style:{backgroundColor:`var(--surface-base)`,color:`var(--content-secondary)`},children:[(0,K.jsx)(Ie,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0}),(0,K.jsx)(`p`,{className:`flex-1`,children:e})]})}function $t(){return(0,K.jsx)(`div`,{className:`flex items-center justify-center py-16`,children:(0,K.jsx)(L,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})})}function en(){let{t:e}=k(`intelligence`);return(0,K.jsx)(r.Root,{children:(0,K.jsxs)(r.Body,{className:`flex flex-col items-center justify-center py-16 text-center`,children:[(0,K.jsx)(ge,{className:`mb-3 h-8 w-8`,style:{color:`var(--system-negative-strong)`},"aria-hidden":!0}),(0,K.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:e(`superpowersTab.errorStateTitle`)}),(0,K.jsx)(`p`,{className:`mt-1 max-w-sm text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:e(`superpowersTab.errorStateSubtitle`)})]})})}function tn({filter:e,category:t}){let{t:n}=k(`intelligence`),{title:r,subtitle:i,Icon:a}=nn(e,t,n);return(0,K.jsx)(V,{icon:a,title:r,subtitle:i})}function nn(e,t,n){if(t)return{title:n(`superpowersTab.emptyState.categoryTitle`),subtitle:n(`superpowersTab.emptyState.categorySubtitle`),Icon:R};switch(e){case`installed`:return{title:n(`superpowersTab.emptyState.installedTitle`),subtitle:n(`superpowersTab.emptyState.installedSubtitle`),Icon:z};case`available`:return{title:n(`superpowersTab.emptyState.availableTitle`),subtitle:n(`superpowersTab.emptyState.availableSubtitle`),Icon:me};case`skills`:return{title:n(`superpowersTab.emptyState.skillsTitle`),subtitle:n(`superpowersTab.emptyState.skillsSubtitle`),Icon:z};case`plugins`:return{title:n(`superpowersTab.emptyState.pluginsTitle`),subtitle:n(`superpowersTab.emptyState.pluginsSubtitle`),Icon:F};case`vellum`:return{title:n(`superpowersTab.emptyState.vellumTitle`),subtitle:n(`superpowersTab.emptyState.vellumSubtitle`),Icon:z};case`clawhub`:return{title:n(`superpowersTab.emptyState.clawhubTitle`),subtitle:n(`superpowersTab.emptyState.clawhubSubtitle`),Icon:z};case`skillssh`:return{title:n(`superpowersTab.emptyState.skillsshTitle`),subtitle:n(`superpowersTab.emptyState.skillsshSubtitle`),Icon:z};case`custom`:return{title:n(`superpowersTab.emptyState.customTitle`),subtitle:n(`superpowersTab.emptyState.customSubtitle`),Icon:z};case`assistant-memory`:return{title:n(`superpowersTab.emptyState.assistantMemoryTitle`),subtitle:n(`superpowersTab.emptyState.assistantMemorySubtitle`),Icon:z};default:return{title:n(`superpowersTab.emptyState.defaultTitle`),subtitle:n(`superpowersTab.emptyState.defaultSubtitle`),Icon:Ie}}}function rn(){return(0,K.jsx)(qt,{assistantId:_()})}export{rn as SuperpowersPage};