@xopcai/xopc 0.0.440 → 0.0.442

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 (379) hide show
  1. package/README.md +2 -3
  2. package/README.zh-CN.md +1 -2
  3. package/dist/browser-ext/_locales/en/messages.json +0 -28
  4. package/dist/browser-ext/_locales/zh_CN/messages.json +0 -28
  5. package/dist/browser-ext/dist/assets/{sidepanel-CQeQB5vW.css → sidepanel-lpBGVKwZ.css} +0 -42
  6. package/dist/browser-ext/dist/background.js +247 -647
  7. package/dist/browser-ext/dist/sidepanel.html +2 -2
  8. package/dist/browser-ext/dist/sidepanel.js +110 -347
  9. package/dist/browser-ext/manifest.json +1 -1
  10. package/dist/extensions/telegram/xopc.extension.json +1 -1
  11. package/dist/gateway/static/root/assets/{activity-store-t5c6XavH.js → activity-store-CuPXAoLe.js} +1 -1
  12. package/dist/gateway/static/root/assets/{agent-avatar-dicebear-CSTtf3RI.js → agent-avatar-dicebear-D92uHOFV.js} +1 -1
  13. package/dist/gateway/static/root/assets/{agent-avatar-display-Cm0afn_O.js → agent-avatar-display-DINzeGs0.js} +2 -2
  14. package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-BMbsLf16.js → agent-defaults-settings-panel-Chneosh4.js} +1 -1
  15. package/dist/gateway/static/root/assets/{agent-plugin-dialog-DofyWKnP.js → agent-plugin-dialog-B2vXlrDW.js} +1 -1
  16. package/dist/gateway/static/root/assets/{agents-CAqwtADW.js → agents-DKfOY5z9.js} +3 -3
  17. package/dist/gateway/static/root/assets/{agents-admin-api-CewiIx4v.js → agents-admin-api-DPLtjJtX.js} +1 -1
  18. package/dist/gateway/static/root/assets/{api-CE6gdBWx.js → api-CEzBruRJ.js} +1 -1
  19. package/dist/gateway/static/root/assets/{api-DRyQFk9q.js → api-ClZ7BrD4.js} +1 -1
  20. package/dist/gateway/static/root/assets/app-link-CdD448kS.js +1 -0
  21. package/dist/gateway/static/root/assets/{app-management-settings-panel-BZfs2ydm.js → app-management-settings-panel-CONwDpqL.js} +1 -1
  22. package/dist/gateway/static/root/assets/{appearance-settings-BA7spRv6.js → appearance-settings-Bu7K-_ri.js} +1 -1
  23. package/dist/gateway/static/root/assets/{apps-page-DOcr7J4E.js → apps-page-CBLj-m2k.js} +1 -1
  24. package/dist/gateway/static/root/assets/{archive-plugin-CPCI6nqQ.js → archive-plugin-CfLz9o-2.js} +1 -1
  25. package/dist/gateway/static/root/assets/{automation-api-paBg5ie6.js → automation-api-Dl9fi8t0.js} +1 -1
  26. package/dist/gateway/static/root/assets/{automation-result-state-Ds-59DdX.js → automation-result-state-BjjZCxee.js} +1 -1
  27. package/dist/gateway/static/root/assets/{automation-run-list-Crw5qn_I.js → automation-run-list-9IPHu_UC.js} +1 -1
  28. package/dist/gateway/static/root/assets/automation-task-card-DLg-LYCm.js +3 -0
  29. package/dist/gateway/static/root/assets/{automations-page-6ti-Fduf.js → automations-page-CYngiwxI.js} +1 -1
  30. package/dist/gateway/static/root/assets/automations-workspace-zyhyqSdH.js +9 -0
  31. package/dist/gateway/static/root/assets/{binary-plugins-CFJCUpWH.js → binary-plugins-Bv4ixxo4.js} +1 -1
  32. package/dist/gateway/static/root/assets/{block-editor-DbG2QKd0.js → block-editor-CtaJSB9U.js} +1 -1
  33. package/dist/gateway/static/root/assets/browser-settings-page-CmBsnx24.js +8 -0
  34. package/dist/gateway/static/root/assets/capabilities-BpYi2fQO.js +1 -0
  35. package/dist/gateway/static/root/assets/{capabilities-DSfd2fMv.js → capabilities-oWWLfwf3.js} +1 -1
  36. package/dist/gateway/static/root/assets/capabilities-page-Dlgwv1dI.js +2 -0
  37. package/dist/gateway/static/root/assets/capabilities-settings-panel-CslXPIs8.js +8 -0
  38. package/dist/gateway/static/root/assets/capability-icon-CmvCZOJX.js +1 -0
  39. package/dist/gateway/static/root/assets/{capability-links-DeO34GIF.js → capability-links-MZdYfPKx.js} +1 -1
  40. package/dist/gateway/static/root/assets/{channels-DVTl7Jqc.js → channels-P-xOLYBz.js} +1 -1
  41. package/dist/gateway/static/root/assets/{chat-agents-api-CTL8cwNk.js → chat-agents-api-BOB3dILf.js} +1 -1
  42. package/dist/gateway/static/root/assets/{chat-chart-block-Z41MRuzh.js → chat-chart-block-DsaCatBN.js} +1 -1
  43. package/dist/gateway/static/root/assets/chat-page-Cen4dGHa.js +72 -0
  44. package/dist/gateway/static/root/assets/{chat-terminal-dock-BJ8SYeo7.js → chat-terminal-dock-DTQL2DBu.js} +1 -1
  45. package/dist/gateway/static/root/assets/{command-palette-api-DUDKFXBH.js → command-palette-api-Cj0_7g9o.js} +1 -1
  46. package/dist/gateway/static/root/assets/{composer-payload-handoff-Cqi83bL5.js → composer-payload-handoff-B1GFVFK_.js} +1 -1
  47. package/dist/gateway/static/root/assets/{computer-settings-page-CTkICYyM.js → computer-settings-page-DJ9BIOHC.js} +1 -1
  48. package/dist/gateway/static/root/assets/connected-providers-grid-sULM6YyQ.js +1 -0
  49. package/dist/gateway/static/root/assets/connection-usage-BhdQRWgQ.js +1 -0
  50. package/dist/gateway/static/root/assets/connection-usage-guide-bD1sKiAp.js +1 -0
  51. package/dist/gateway/static/root/assets/{connector-service-page-C6yeCQWW.js → connector-service-page-BEq3i3Vi.js} +1 -1
  52. package/dist/gateway/static/root/assets/{connectors-api-HFW1Iey5.js → connectors-api-DEExP6a7.js} +1 -1
  53. package/dist/gateway/static/root/assets/connectors-page-DN9BOiFk.js +1 -0
  54. package/dist/gateway/static/root/assets/{date-picker-C_tweuM0.js → date-picker-D2whl8Ci.js} +1 -1
  55. package/dist/gateway/static/root/assets/{desktop-pet-narrative-ChwjpnsG.js → desktop-pet-narrative-C8zQtMcw.js} +1 -1
  56. package/dist/gateway/static/root/assets/{desktop-pet-BAX0ZLyq.js → desktop-pet-qnIdmNnH.js} +1 -1
  57. package/dist/gateway/static/root/assets/{desktop-pet-settings-BIIsWpW9.js → desktop-pet-settings-C54b1FY4.js} +1 -1
  58. package/dist/gateway/static/root/assets/{dev-view-store-D4C_zjRq.js → dev-view-store-bryv5YRw.js} +1 -1
  59. package/dist/gateway/static/root/assets/{device-pairing-wizard-ZUE6wZ1X.js → device-pairing-wizard-Du-yOxZv.js} +1 -1
  60. package/dist/gateway/static/root/assets/{directory-picker-path-field-CFb2VFW-.js → directory-picker-path-field-GsMkjw59.js} +1 -1
  61. package/dist/gateway/static/root/assets/{discussion-annotation-sync-Bd4r2auZ.js → discussion-annotation-sync-CrpDiC7J.js} +1 -1
  62. package/dist/gateway/static/root/assets/earth-C9Z4bTTG.js +1 -0
  63. package/dist/gateway/static/root/assets/{extension-debug-page-CSsZoz0G.js → extension-debug-page-D2Dhtu6H.js} +1 -1
  64. package/dist/gateway/static/root/assets/{extension-iframe-host-DHeeJG5w.js → extension-iframe-host-Dra7k_6o.js} +1 -1
  65. package/dist/gateway/static/root/assets/{extension-marketplace-api-Q6E4x8gu.js → extension-marketplace-api-D7Av-sOf.js} +1 -1
  66. package/dist/gateway/static/root/assets/{extension-page-DhQJVav9.js → extension-page-Dd16lQg-.js} +1 -1
  67. package/dist/gateway/static/root/assets/{extension-provider-CJQkyfle.js → extension-provider-C4WwnCxf.js} +1 -1
  68. package/dist/gateway/static/root/assets/{extension-settings-page-qUg8c93J.js → extension-settings-page-BHwQ2ipj.js} +1 -1
  69. package/dist/gateway/static/root/assets/{file-preview-surface-D62ph0m0.js → file-preview-surface-Dtla5oAW.js} +1 -1
  70. package/dist/gateway/static/root/assets/{gateway-config-swr-BW6eBLIt.js → gateway-config-swr-B5THNdYK.js} +1 -1
  71. package/dist/gateway/static/root/assets/{gateway-realtime-Bg4Mf7HA.js → gateway-realtime-hnEaDFaA.js} +1 -1
  72. package/dist/gateway/static/root/assets/gateway-realtime-store-ugwtyD4q.js +1 -0
  73. package/dist/gateway/static/root/assets/{gateway-restart-BzrJNB4Q.js → gateway-restart-kwv0njYq.js} +1 -1
  74. package/dist/gateway/static/root/assets/{gateway-settings-BOW90CER.js → gateway-settings-CxYPJTy8.js} +1 -1
  75. package/dist/gateway/static/root/assets/{gateway-startup-retry-DCjREMIO.js → gateway-startup-retry-CqtCJzWJ.js} +1 -1
  76. package/dist/gateway/static/root/assets/{global-defaults-api-myAmGZ2_.js → global-defaults-api-BQMdHLlp.js} +1 -1
  77. package/dist/gateway/static/root/assets/{home-page-BjAejNQt.js → home-page-D-gy9LlQ.js} +2 -2
  78. package/dist/gateway/static/root/assets/{image-generation-api-CLkuZdsz.js → image-generation-api-G3tQFhif.js} +1 -1
  79. package/dist/gateway/static/root/assets/{imports-page-BFsLQu7n.js → imports-page-BmEqiunH.js} +1 -1
  80. package/dist/gateway/static/root/assets/index-CqQZfWRQ.js +11 -0
  81. package/dist/gateway/static/root/assets/index-D7Noveui.css +1 -0
  82. package/dist/gateway/static/root/assets/{install-connector-dialog-CVjCFdly.js → install-connector-dialog-BU4l6KJv.js} +1 -1
  83. package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-DdZfxLQb.js → keyboard-shortcuts-settings-CtNI6i7K.js} +1 -1
  84. package/dist/gateway/static/root/assets/{local-app-workbench-page-B6iL_VbY.js → local-app-workbench-page-Drbzz4Lm.js} +1 -1
  85. package/dist/gateway/static/root/assets/{local-apps-page-buwr_S_-.js → local-apps-page-DqZT5hLH.js} +1 -1
  86. package/dist/gateway/static/root/assets/local-session-drafts-Bt_e3A8f.js +4 -0
  87. package/dist/gateway/static/root/assets/{locale-store-DGtk-KSF.js → locale-store-Bld7_m-Q.js} +1 -1
  88. package/dist/gateway/static/root/assets/{logs-page-D_VBpYkM.js → logs-page-CzajqK40.js} +1 -1
  89. package/dist/gateway/static/root/assets/{management-settings-BlRCdUF3.js → management-settings-BgdAP0kf.js} +1 -1
  90. package/dist/gateway/static/root/assets/{markdown-view-JXJ3e1CB.js → markdown-view-B3cFKCfO.js} +1 -1
  91. package/dist/gateway/static/root/assets/markdown-view-DG8DDkEA.css +1 -0
  92. package/dist/gateway/static/root/assets/{mcp-conversation-setup-page-Vr2dpowU.js → mcp-conversation-setup-page-ZcY1nqMO.js} +1 -1
  93. package/dist/gateway/static/root/assets/{media-plugins-DcN8Y0hJ.js → media-plugins-DSOplRhW.js} +1 -1
  94. package/dist/gateway/static/root/assets/messages-CGO1P4mz.js +3 -0
  95. package/dist/gateway/static/root/assets/{model-selector-zD2x0Sn6.js → model-selector-yAKlOR3O.js} +1 -1
  96. package/dist/gateway/static/root/assets/{models-hub-cache-DtZG5bA_.js → models-hub-cache-8V-ZpAIa.js} +1 -1
  97. package/dist/gateway/static/root/assets/{note-detail-panel-i_c7IJon.js → note-detail-panel-BQdgpm0s.js} +3 -3
  98. package/dist/gateway/static/root/assets/note-image-lightbox-BbNYW2Rw.js +1 -0
  99. package/dist/gateway/static/root/assets/notes-api-CVQqqmGI.js +1 -0
  100. package/dist/gateway/static/root/assets/{notes-page-DUpUq3ca.js → notes-page-IefutMyg.js} +3 -3
  101. package/dist/gateway/static/root/assets/{oauth-api-DYNQAQBx.js → oauth-api-DGa6PTuq.js} +1 -1
  102. package/dist/gateway/static/root/assets/{oauth-provider-connect-BvV6SP0k.js → oauth-provider-connect-Bc-KLH1e.js} +1 -1
  103. package/dist/gateway/static/root/assets/{page-context-capture-button-BJASJMLv.js → page-context-capture-button-DDmLslYG.js} +1 -1
  104. package/dist/gateway/static/root/assets/{page-context-draft-5xnVOZAF.js → page-context-draft-GveHK8e2.js} +1 -1
  105. package/dist/gateway/static/root/assets/page-header-store-YZfSLNTg.js +1 -0
  106. package/dist/gateway/static/root/assets/palette-CDI0VweW.js +1 -0
  107. package/dist/gateway/static/root/assets/{personal-avatar-CF6T0aTT.js → personal-avatar-Cu8lGBXZ.js} +1 -1
  108. package/dist/gateway/static/root/assets/personal-page-DkrDSJqk.js +1 -0
  109. package/dist/gateway/static/root/assets/{personal-settings-panel-BrQ94X_A.js → personal-settings-panel-awr10jTV.js} +1 -1
  110. package/dist/gateway/static/root/assets/{phone-dependencies-card-Zvbw-N0D.js → phone-dependencies-card-CAxn3usD.js} +1 -1
  111. package/dist/gateway/static/root/assets/{phone-model-connection-CQ4PhhE5.js → phone-model-connection-BBG3LxRP.js} +1 -1
  112. package/dist/gateway/static/root/assets/{phone-model-picker-BDBtemUm.js → phone-model-picker-CfPjKpnd.js} +1 -1
  113. package/dist/gateway/static/root/assets/{phone-settings-page-D2KXWcg1.js → phone-settings-page-C4dJdwRW.js} +1 -1
  114. package/dist/gateway/static/root/assets/{phone-workspace-store-BhJAeHdQ.js → phone-workspace-store-BKltFHtG.js} +1 -1
  115. package/dist/gateway/static/root/assets/{plugin-details-dialog-DpPtI0sI.js → plugin-details-dialog-BqcFfZFH.js} +1 -1
  116. package/dist/gateway/static/root/assets/{popover-select-CEMWIrtY.js → popover-select-CLsphyzA.js} +1 -1
  117. package/dist/gateway/static/root/assets/{preference-select-fields-Bx26yGRF.js → preference-select-fields-QlyIA8ve.js} +1 -1
  118. package/dist/gateway/static/root/assets/product-automation-feedback-CRsfuAXl.js +7 -0
  119. package/dist/gateway/static/root/assets/product-navigation-Dp-adLY_.js +1 -0
  120. package/dist/gateway/static/root/assets/{product-open-page-DSWELoz0.js → product-open-page-CQ4dk-_l.js} +1 -1
  121. package/dist/gateway/static/root/assets/{product-preview-content-DJb-OtMo.js → product-preview-content-COU6H_jO.js} +1 -1
  122. package/dist/gateway/static/root/assets/{product-preview-modal-DaQhXcev.js → product-preview-modal-Ct5q4tv6.js} +2 -2
  123. package/dist/gateway/static/root/assets/{project-detail-page-BpFMnYqe.js → project-detail-page-CQj7nm6I.js} +1 -1
  124. package/dist/gateway/static/root/assets/{project-understanding-CjhVk8l-.js → project-understanding-CU2af95r.js} +1 -1
  125. package/dist/gateway/static/root/assets/{projects-page-sVWDuzmC.js → projects-page-sWxQJrFS.js} +1 -1
  126. package/dist/gateway/static/root/assets/{providers-api-gWGsgOOf.js → providers-api-CspehmSU.js} +1 -1
  127. package/dist/gateway/static/root/assets/recording-upload-BOZAOdCI.js +1 -0
  128. package/dist/gateway/static/root/assets/{registry-api-CRxE9kFY.js → registry-api-Bdp3UUyz.js} +1 -1
  129. package/dist/gateway/static/root/assets/{remote-access-hub-Bw__qp-v.js → remote-access-hub-Bos3uwAT.js} +1 -1
  130. package/dist/gateway/static/root/assets/{resource-unavailable-BaczkGfK.js → resource-unavailable-DJR3SCy6.js} +1 -1
  131. package/dist/gateway/static/root/assets/route-preload-CDQtPdgq.js +2 -0
  132. package/dist/gateway/static/root/assets/{runtime-tools-api-ygfM5FCT.js → runtime-tools-api-DsbahxzE.js} +1 -1
  133. package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-BWEK7BZS.js → runtime-tools-settings-panel-DW9_OFi2.js} +1 -1
  134. package/dist/gateway/static/root/assets/{schema-form-C-jw6Hid.js → schema-form-CtRM41Re.js} +1 -1
  135. package/dist/gateway/static/root/assets/{service-recommendation-list-DrgwXSEt.js → service-recommendation-list-Bd1JDO5T.js} +1 -1
  136. package/dist/gateway/static/root/assets/{session-api-CpZ24vrQ.js → session-api-DjnHJ-0n.js} +1 -1
  137. package/dist/gateway/static/root/assets/{session-manager-BpO7h2es.js → session-manager-Czu9GpZX.js} +2 -2
  138. package/dist/gateway/static/root/assets/{sessions-page-DgXRw0_8.js → sessions-page-CGkbbrz-.js} +1 -1
  139. package/dist/gateway/static/root/assets/settings-advanced-gate-DyGT3o1e.js +1 -0
  140. package/dist/gateway/static/root/assets/{settings-advanced-section-DmCp3OWb.js → settings-advanced-section-CM44UlF8.js} +1 -1
  141. package/dist/gateway/static/root/assets/{settings-loading-skeleton-BTqvr_Fw.js → settings-loading-skeleton-CAoOV17i.js} +1 -1
  142. package/dist/gateway/static/root/assets/{settings-mode-store-fZ6mzf4A.js → settings-mode-store-Blc4C8aw.js} +1 -1
  143. package/dist/gateway/static/root/assets/{settings-page-header-4d1u-o-F.js → settings-page-header-BYFaTD8a.js} +1 -1
  144. package/dist/gateway/static/root/assets/{settings-page-layout-Cy9_VBag.js → settings-page-layout-CnUQSxT3.js} +1 -1
  145. package/dist/gateway/static/root/assets/{settings-page-JEaz5Vzy.js → settings-page-zGjDXdHY.js} +1 -1
  146. package/dist/gateway/static/root/assets/{setup-interaction-page-OFU6DKgp.js → setup-interaction-page-DqaiLQ0I.js} +1 -1
  147. package/dist/gateway/static/root/assets/{setup-status-panel-KKAneNTe.js → setup-status-panel-iOYgfkoK.js} +1 -1
  148. package/dist/gateway/static/root/assets/{share-link-dialog-Apq3cegw.js → share-link-dialog-C_uYNUlp.js} +1 -1
  149. package/dist/gateway/static/root/assets/{share-preview-page-pLEAG660.js → share-preview-page-Bs3VjTGj.js} +1 -1
  150. package/dist/gateway/static/root/assets/{shares-api-Q5x_ty6F.js → shares-api-C2GDyqxP.js} +1 -1
  151. package/dist/gateway/static/root/assets/{shares-settings-Zdv1sVrv.js → shares-settings-BseSozxm.js} +1 -1
  152. package/dist/gateway/static/root/assets/skeleton-DzdOeGYz.js +1 -0
  153. package/dist/gateway/static/root/assets/{skill-api-CBFXDh9m.js → skill-api-BnpTSZGc.js} +1 -1
  154. package/dist/gateway/static/root/assets/{skill-list-api-C8tm-XxH.js → skill-list-api-7MY9ewiu.js} +1 -1
  155. package/dist/gateway/static/root/assets/{skill-reload-api-B-4Yj46U.js → skill-reload-api-DkDpu3Wd.js} +1 -1
  156. package/dist/gateway/static/root/assets/skills-page-sL2kGqHZ.js +2 -0
  157. package/dist/gateway/static/root/assets/{system-settings-panel-a4mBz4J2.js → system-settings-panel-BltKPJdb.js} +1 -1
  158. package/dist/gateway/static/root/assets/{task-detail-page-BkPUm6sy.js → task-detail-page-CwMpmFVS.js} +1 -1
  159. package/dist/gateway/static/root/assets/{task-result-evidence-MOHY0Myr.js → task-result-evidence-BNhYqUAa.js} +1 -1
  160. package/dist/gateway/static/root/assets/{terminal-panel-store-BdOlpRkY.js → terminal-panel-store-DUEJoa1M.js} +1 -1
  161. package/dist/gateway/static/root/assets/{theme-store-D58tk8pq.js → theme-store-DsvYj7Vy.js} +1 -1
  162. package/dist/gateway/static/root/assets/tool-friendly-title-DEGpbye4.js +1 -0
  163. package/dist/gateway/static/root/assets/{tracing-settings-page-CO0-AiCl.js → tracing-settings-page-CMtFem_g.js} +1 -1
  164. package/dist/gateway/static/root/assets/{tunnel-api-DVRX9yW6.js → tunnel-api-B6BhWTh3.js} +1 -1
  165. package/dist/gateway/static/root/assets/{understanding-activity-store-B_-648uj.js → understanding-activity-store-B7rFXhDk.js} +1 -1
  166. package/dist/gateway/static/root/assets/{understanding-refresh-store-BXJ-kwzq.js → understanding-refresh-store-DCFASve5.js} +1 -1
  167. package/dist/gateway/static/root/assets/{usage-page-C76JnWR8.js → usage-page-BO2OFCoA.js} +1 -1
  168. package/dist/gateway/static/root/assets/{use-autosave-xytwr7Lc.js → use-autosave-DsqcLHV9.js} +1 -1
  169. package/dist/gateway/static/root/assets/use-composer-attachments-DA6SxZPQ.js +2 -0
  170. package/dist/gateway/static/root/assets/use-file-preview-expanded-g4SwMHbx.js +2 -0
  171. package/dist/gateway/static/root/assets/{use-personal-profile-BXHU0P8I.js → use-personal-profile-T2e6P5Ed.js} +1 -1
  172. package/dist/gateway/static/root/assets/{use-workspace-tree-CU-lW_cN.js → use-workspace-tree-DG5ZMfaY.js} +1 -1
  173. package/dist/gateway/static/root/assets/user-model-page-B5_01fi_.js +2 -0
  174. package/dist/gateway/static/root/assets/{voice-api-key-field-Dn092u0X.js → voice-api-key-field-D7NPAc1E.js} +1 -1
  175. package/dist/gateway/static/root/assets/voice-call-context-CJ1ZiJWR.js +1 -0
  176. package/dist/gateway/static/root/assets/{voice-config-api-fqUzP-ZY.js → voice-config-api-UQDTh6hh.js} +1 -1
  177. package/dist/gateway/static/root/assets/{voice-input-shortcut-events-D7QdPeuj.js → voice-input-shortcut-events-SD2gZVg8.js} +1 -1
  178. package/dist/gateway/static/root/assets/{voice-transcribe-api-Z56gWWll.js → voice-transcribe-api-Cc92OabY.js} +1 -1
  179. package/dist/gateway/static/root/assets/{work-discovery-overlay-BARpCMZl.js → work-discovery-overlay-B41GOFXh.js} +1 -1
  180. package/dist/gateway/static/root/assets/{work-discovery-page-p0aVb8xr.js → work-discovery-page-NNhExALx.js} +1 -1
  181. package/dist/gateway/static/root/assets/{working-directory-picker-modal-7G-6icvh.js → working-directory-picker-modal-DeNWVFFK.js} +1 -1
  182. package/dist/gateway/static/root/assets/{workspace-api-DJ3Ebhz_.js → workspace-api-fKmmIslV.js} +2 -2
  183. package/dist/gateway/static/root/assets/workspace-editor-agent-store-CmSYxTmk.js +1 -0
  184. package/dist/gateway/static/root/assets/{workspace-file-preview-dialog-BlVJ5Vmn.js → workspace-file-preview-dialog-C_0lUEsm.js} +1 -1
  185. package/dist/gateway/static/root/assets/{workspace-open-location-menu-jAwoLoam.js → workspace-open-location-menu-BznuSmFZ.js} +1 -1
  186. package/dist/gateway/static/root/assets/{xopc-cloud-account-card-Bc5rXL-E.js → xopc-cloud-account-card-BlhFT1q9.js} +1 -1
  187. package/dist/gateway/static/root/index.html +95 -98
  188. package/dist/package.js +1 -1
  189. package/dist/packages/browser-control-contract/src/dom.js +79 -0
  190. package/dist/packages/browser-control-contract/src/index.js +2 -25
  191. package/dist/packages/gateway-contract/src/automations.js +0 -6
  192. package/dist/packages/gateway-contract/src/session-input-command.js +5 -1
  193. package/dist/src/agent/agent-manager.d.ts +0 -1
  194. package/dist/src/agent/agent-manager.js +0 -1
  195. package/dist/src/agent/external-tools/index.d.ts +1 -1
  196. package/dist/src/agent/service.js +0 -1
  197. package/dist/src/agent/service.types.d.ts +0 -1
  198. package/dist/src/agent/tool-manuals/browser.d.ts +1 -1
  199. package/dist/src/agent/tool-manuals/browser.js +0 -3
  200. package/dist/src/agent/tools/factory.d.ts +0 -2
  201. package/dist/src/agent/tools/factory.js +0 -2
  202. package/dist/src/agent/tools/find.d.ts +1 -1
  203. package/dist/src/agent/tools/grep.d.ts +1 -1
  204. package/dist/src/agent/tools/index.d.ts +0 -1
  205. package/dist/src/agent/tools/index.js +1 -2
  206. package/dist/src/agent/tools/metadata.d.ts +1 -1
  207. package/dist/src/auth/oauth/anthropic.d.ts +1 -7
  208. package/dist/src/auth/oauth/anthropic.js +6 -83
  209. package/dist/src/auth/oauth/index.d.ts +0 -2
  210. package/dist/src/auth/oauth/index.js +2 -6
  211. package/dist/src/auth/oauth/kimi-coding.d.ts +1 -6
  212. package/dist/src/auth/oauth/kimi-coding.js +5 -79
  213. package/dist/src/auth/oauth/openai.js +1 -1
  214. package/dist/src/auth/oauth/pi-oauth-adapter.d.ts +4 -0
  215. package/dist/src/auth/oauth/pi-oauth-adapter.js +53 -0
  216. package/dist/src/auth/oauth/registry.js +0 -9
  217. package/dist/src/automations/capabilities/write.d.ts +0 -12
  218. package/dist/src/automations/domain/defaults.d.ts +0 -1
  219. package/dist/src/automations/domain/defaults.js +2 -3
  220. package/dist/src/automations/domain/index.js +2 -2
  221. package/dist/src/automations/domain/types.d.ts +0 -26
  222. package/dist/src/automations/domain/validation.d.ts +0 -24
  223. package/dist/src/automations/domain/validation.js +0 -7
  224. package/dist/src/automations/draft/automation-draft-validator.d.ts +0 -6
  225. package/dist/src/automations/draft/automation-draft-validator.js +0 -1
  226. package/dist/src/automations/index.js +2 -2
  227. package/dist/src/automations/service/action-executor.d.ts +0 -1
  228. package/dist/src/automations/service/action-executor.js +0 -31
  229. package/dist/src/automations/service/automation-service.d.ts +0 -1
  230. package/dist/src/automations/service/automation-service.js +1 -13
  231. package/dist/src/browser/drivers/playwright-driver.js +1 -2
  232. package/dist/src/cli/commands/extension-dev.js +1 -1
  233. package/dist/src/cli/commands/extension-marketplace.js +1 -1
  234. package/dist/src/cli/commands/extension.js +1 -1
  235. package/dist/src/cli/commands/gateway/lifecycle.js +1 -1
  236. package/dist/src/cli/commands/models.js +1 -1
  237. package/dist/src/cli/commands/onboard/model.js +3 -3
  238. package/dist/src/cli/commands/tunnel.js +1 -1
  239. package/dist/src/cli/commands/update.js +1 -1
  240. package/dist/src/config/models-json.d.ts +24 -24
  241. package/dist/src/endpoint-tools/policy.js +3 -4
  242. package/dist/src/gateway/hono/app.js +1 -1
  243. package/dist/src/gateway/hono/middleware/auth.js +1 -1
  244. package/dist/src/gateway/hono/routes/config-patch/misc.js +2 -2
  245. package/dist/src/gateway/hono/routes/desktop-host.js +1 -1
  246. package/dist/src/gateway/hono/routes/exposure.js +1 -1
  247. package/dist/src/gateway/hono/routes/files.js +2 -2
  248. package/dist/src/gateway/hono/routes/imports.js +1 -1
  249. package/dist/src/gateway/hono/routes/lazy-bundles.js +0 -16
  250. package/dist/src/gateway/hono/routes/local-apps.js +1 -1
  251. package/dist/src/gateway/hono/routes/logs.js +1 -1
  252. package/dist/src/gateway/hono/routes/models.js +5 -5
  253. package/dist/src/gateway/hono/routes/notes.js +1 -1
  254. package/dist/src/gateway/hono/routes/personal-agent.js +2 -2
  255. package/dist/src/gateway/hono/routes/phone-setup.js +1 -1
  256. package/dist/src/gateway/hono/routes/runtime-tools.js +1 -1
  257. package/dist/src/gateway/hono/routes/sessions.js +1 -1
  258. package/dist/src/gateway/hono/routes/shares.js +5 -5
  259. package/dist/src/gateway/hono/routes/status.js +1 -1
  260. package/dist/src/gateway/hono/routes/tasks.js +1 -1
  261. package/dist/src/gateway/hono/routes/tunnel.js +2 -2
  262. package/dist/src/gateway/hono/routes/update.js +2 -2
  263. package/dist/src/gateway/hono/routes/voice.js +1 -1
  264. package/dist/src/gateway/index.js +2 -2
  265. package/dist/src/gateway/provider-model-setup.js +1 -1
  266. package/dist/src/gateway/run-loop.js +2 -2
  267. package/dist/src/gateway/security/audit.js +1 -1
  268. package/dist/src/gateway/security/gateway-scopes.js +0 -2
  269. package/dist/src/gateway/security/index.js +2 -2
  270. package/dist/src/gateway/server.js +1 -1
  271. package/dist/src/gateway/service/agent-runner.js +1 -1
  272. package/dist/src/gateway/service/run-gateway-agent.js +2 -2
  273. package/dist/src/gateway/service/session-command-service.js +6 -0
  274. package/dist/src/gateway/service/sessions-api.js +1 -1
  275. package/dist/src/gateway/service.d.ts +0 -3
  276. package/dist/src/gateway/service.js +31 -46
  277. package/dist/src/gateway/side-chat/run-service.js +1 -1
  278. package/dist/src/home-intelligence/host.js +2 -2
  279. package/dist/src/infra/gateway-processes.js +1 -1
  280. package/dist/src/infra/update-restart.js +1 -1
  281. package/dist/src/infra/update-runner.js +2 -2
  282. package/dist/src/infra/update-startup.js +1 -1
  283. package/dist/src/notifications/service.js +2 -2
  284. package/dist/src/personal-agent/prompts.js +1 -1
  285. package/dist/src/personal-agent/reply-style.d.ts +2 -2
  286. package/dist/src/personal-agent/reply-style.js +10 -0
  287. package/dist/src/phone/stream-gateway.js +1 -1
  288. package/dist/src/providers/domestic-presets.d.ts +2 -310
  289. package/dist/src/providers/domestic-presets.js +2 -396
  290. package/dist/src/providers/env-keys.js +2 -6
  291. package/dist/src/providers/index.js +6 -13
  292. package/dist/src/providers/presentation.js +4 -6
  293. package/dist/src/providers/setup/profiles.js +1 -2
  294. package/dist/src/providers/setup/voice.js +1 -1
  295. package/dist/src/realtime/runtime.js +1 -1
  296. package/dist/src/remote-access/exposure-manager.js +1 -1
  297. package/dist/src/share/site-share-router.js +2 -2
  298. package/dist/src/storage/sqlite/schema.sql +0 -81
  299. package/dist/src/storage/sqlite/session-creation-repository.js +2 -1
  300. package/dist/src/tasks/home-query-service.js +0 -1
  301. package/dist/src/tui/backends/embedded-backend.js +3 -3
  302. package/dist/src/tunnel/gateway-lifecycle.js +1 -1
  303. package/dist/src/voice/realtime/runtime.js +1 -1
  304. package/dist/src/work-discovery/index.js +2 -2
  305. package/dist/src/work-discovery/investigator.js +1 -1
  306. package/dist/src/work-discovery/service.js +3 -3
  307. package/package.json +9 -9
  308. package/dist/gateway/static/root/assets/app-link-DRy3-k7j.js +0 -1
  309. package/dist/gateway/static/root/assets/arrow-up-right-T72JbQ1Q.js +0 -1
  310. package/dist/gateway/static/root/assets/automation-task-card-BecBULES.js +0 -3
  311. package/dist/gateway/static/root/assets/automations-workspace-AJhsnIMA.js +0 -9
  312. package/dist/gateway/static/root/assets/book-open-CCGtrT3R.js +0 -1
  313. package/dist/gateway/static/root/assets/browser-automation-inputs-DADzEaqe.js +0 -1
  314. package/dist/gateway/static/root/assets/browser-automations-page-V7_ZTcyU.js +0 -3
  315. package/dist/gateway/static/root/assets/browser-control-api-Bdr2nGCE.js +0 -6
  316. package/dist/gateway/static/root/assets/browser-settings-page-irOt8KDh.js +0 -3
  317. package/dist/gateway/static/root/assets/capabilities-bTEnfGla.js +0 -1
  318. package/dist/gateway/static/root/assets/capabilities-page-BmTXUhQp.js +0 -2
  319. package/dist/gateway/static/root/assets/capabilities-settings-panel-DWelRpM-.js +0 -8
  320. package/dist/gateway/static/root/assets/capability-icon-DVoZxEgW.js +0 -1
  321. package/dist/gateway/static/root/assets/chat-page-ATnFh_yO.js +0 -72
  322. package/dist/gateway/static/root/assets/connected-providers-grid-CpO98SqR.js +0 -1
  323. package/dist/gateway/static/root/assets/connection-usage-Cm_McddI.js +0 -1
  324. package/dist/gateway/static/root/assets/connection-usage-guide-DOf2VWzv.js +0 -1
  325. package/dist/gateway/static/root/assets/connectors-page-B_qTQG1-.js +0 -1
  326. package/dist/gateway/static/root/assets/earth-BMhZtzcj.js +0 -1
  327. package/dist/gateway/static/root/assets/gateway-realtime-store-xYMxjztG.js +0 -1
  328. package/dist/gateway/static/root/assets/index-Bn4t_KuI.js +0 -11
  329. package/dist/gateway/static/root/assets/index-CKIirf4W.css +0 -1
  330. package/dist/gateway/static/root/assets/local-session-drafts-DILglF8O.js +0 -4
  331. package/dist/gateway/static/root/assets/markdown-view-C-DHb3Io.css +0 -1
  332. package/dist/gateway/static/root/assets/messages-DYDySzn1.js +0 -3
  333. package/dist/gateway/static/root/assets/note-image-lightbox-V4rmgfLB.js +0 -1
  334. package/dist/gateway/static/root/assets/notes-api-UXC3eyeM.js +0 -1
  335. package/dist/gateway/static/root/assets/page-header-store-f8XcAs9b.js +0 -1
  336. package/dist/gateway/static/root/assets/personal-page-Cen6HXw_.js +0 -1
  337. package/dist/gateway/static/root/assets/product-automation-feedback-_K6grEOt.js +0 -7
  338. package/dist/gateway/static/root/assets/product-navigation-Co8pLbDP.js +0 -1
  339. package/dist/gateway/static/root/assets/recording-upload-CBefH7C5.js +0 -1
  340. package/dist/gateway/static/root/assets/route-preload-C2b1djX_.js +0 -2
  341. package/dist/gateway/static/root/assets/settings-advanced-gate-Ch9MNvvk.js +0 -1
  342. package/dist/gateway/static/root/assets/skeleton-BI5TyibZ.js +0 -1
  343. package/dist/gateway/static/root/assets/skills-page-ftr5UzWS.js +0 -2
  344. package/dist/gateway/static/root/assets/star-BUWJqJ5c.js +0 -1
  345. package/dist/gateway/static/root/assets/tool-friendly-title-DcCc6g7o.js +0 -1
  346. package/dist/gateway/static/root/assets/use-composer-attachments-CgVehTrs.js +0 -2
  347. package/dist/gateway/static/root/assets/use-file-preview-expanded-GOK8-Bzy.js +0 -2
  348. package/dist/gateway/static/root/assets/user-model-page-BzpV1hq_.js +0 -2
  349. package/dist/gateway/static/root/assets/video-B6V0GFss.js +0 -1
  350. package/dist/gateway/static/root/assets/voice-call-context-BM2A4bLz.js +0 -1
  351. package/dist/gateway/static/root/assets/workspace-editor-agent-store-CODAQqJn.js +0 -1
  352. package/dist/packages/browser-control-contract/src/automation.js +0 -213
  353. package/dist/src/agent/tools/browser-automation-tool.d.ts +0 -194
  354. package/dist/src/agent/tools/browser-automation-tool.js +0 -243
  355. package/dist/src/auth/oauth/minimax-cn.d.ts +0 -11
  356. package/dist/src/auth/oauth/minimax-cn.js +0 -95
  357. package/dist/src/auth/oauth/minimax.d.ts +0 -8
  358. package/dist/src/auth/oauth/minimax.js +0 -95
  359. package/dist/src/browser/automations/index.d.ts +0 -4
  360. package/dist/src/browser/automations/index.js +0 -4
  361. package/dist/src/browser/automations/repository.d.ts +0 -17
  362. package/dist/src/browser/automations/repository.js +0 -81
  363. package/dist/src/browser/automations/runner.d.ts +0 -17
  364. package/dist/src/browser/automations/runner.js +0 -265
  365. package/dist/src/browser/automations/runtime-service.d.ts +0 -8
  366. package/dist/src/browser/automations/runtime-service.js +0 -38
  367. package/dist/src/browser/automations/schema.d.ts +0 -227
  368. package/dist/src/browser/automations/schema.js +0 -201
  369. package/dist/src/browser/automations/service.d.ts +0 -232
  370. package/dist/src/browser/automations/service.js +0 -214
  371. package/dist/src/browser/automations/types.d.ts +0 -105
  372. package/dist/src/browser/automations/types.js +0 -1
  373. package/dist/src/browser/recordings/service.d.ts +0 -22
  374. package/dist/src/browser/recordings/service.js +0 -159
  375. package/dist/src/gateway/hono/routes/browser-automations.d.ts +0 -3
  376. package/dist/src/gateway/hono/routes/browser-automations.js +0 -93
  377. package/dist/src/gateway/hono/routes/browser-recordings.d.ts +0 -3
  378. package/dist/src/gateway/hono/routes/browser-recordings.js +0 -78
  379. package/dist/browser-ext/dist/assets/{page-context-DngcqfGf.js → auth-DAIwDtVp.js} +1368 -1368
@@ -1 +1 @@
1
- import{i as e,o as t}from"./locale-store-DGtk-KSF.js";import{d as n,i as r,m as i,n as a,u as o}from"./schemas-CCWMleym.js";import{_ as s,a as c,g as l,h as u,l as d,m as f,u as p}from"./tasks-DRmd6sWt.js";import{i as m,r as h,t as g}from"./files-BNL4kkSB.js";var _=n({id:i(),name:i(),status:i(),description:i().optional(),brief:i().optional(),updatedAt:o()}),v=n({dependencyTaskId:i(),dependentTaskId:i()}),y=n({id:i(),title:i(),phase:l,resolution:s.optional(),operationalState:u,priority:d,dueAt:o().optional(),acceptanceCriteriaCount:o().int().nonnegative(),latestVerification:a([`passed`,`failed`,`unverified`]).optional(),nextCheckAt:o().int().nonnegative().optional(),attention:r(f).default([]),blockedBy:r(c).default([]),allowedCommands:r(i()),updatedAt:o()});n({health:a([`healthy`,`attention`,`idle`,`empty`]),summary:i(),recommendedAction:i().optional(),counts:n({ready:o().int().nonnegative(),moving:o().int().nonnegative(),waiting:o().int().nonnegative(),needsUser:o().int().nonnegative(),done:o().int().nonnegative()}),updatedAt:o().int().nonnegative()});var b=n({project:_,tasks:r(y),dependencyEdges:r(v),blockers:r(n({id:i(),taskId:i(),kind:i(),title:i(),detail:i().optional(),href:i().optional(),updatedAt:o().optional()})),recentResults:r(n({taskId:i(),taskTitle:i(),receipt:p})),digest:n({health:a([`healthy`,`attention`,`idle`,`empty`]),summary:i(),recommendedAction:i().optional()})});async function x(n){let r=new URLSearchParams;n?.status&&r.set(`status`,n.status),n?.search?.trim()&&r.set(`search`,n.search.trim()),n?.sortBy&&r.set(`sortBy`,n.sortBy),n?.sortOrder&&r.set(`sortOrder`,n.sortOrder),n?.limit&&r.set(`limit`,String(n.limit)),n?.offset&&r.set(`offset`,String(n.offset));let i=r.toString();return t(e(`/api/projects${i?`?${i}`:``}`))}async function S(n){return(await t(e(`/api/projects/${encodeURIComponent(n)}`))).project}async function C(n){let r=await t(e(`/api/projects/${encodeURIComponent(n)}/operating-view`));return b.parse(r&&typeof r==`object`?r.view:void 0)}async function w(n,r={}){let i=new URLSearchParams;i.set(`visibility`,`timeline`),r.includeRelated&&i.set(`includeRelated`,`true`),r.limit&&i.set(`limit`,String(r.limit)),r.offset&&i.set(`offset`,String(r.offset));let a=i.toString();return t(e(`/api/projects/${encodeURIComponent(n)}/activity${a?`?${a}`:``}`))}async function T(n){return(await t(e(`/api/projects`),{method:`POST`,headers:{"idempotency-key":crypto.randomUUID()},body:JSON.stringify(n)})).project}async function E(n,r,i){return(await t(e(`/api/projects/${encodeURIComponent(n)}`),{method:`PATCH`,headers:{"idempotency-key":crypto.randomUUID()},body:JSON.stringify({...r,expectedVersion:i})})).project}async function D(e,t,n){return E(e,{name:t},n)}async function O(e,t){return E(e,{status:`archived`},t)}async function k(e,t){return E(e,{status:`active`},t)}async function A(n,r){return(await t(e(`/api/projects/${encodeURIComponent(n)}/pin`),{method:`POST`,headers:{"idempotency-key":crypto.randomUUID()},body:JSON.stringify({expectedVersion:r})})).project}async function j(n,r){return(await t(e(`/api/projects/${encodeURIComponent(n)}/unpin`),{method:`POST`,headers:{"idempotency-key":crypto.randomUUID()},body:JSON.stringify({expectedVersion:r})})).project}async function M(n,r){await t(e(`/api/projects/${encodeURIComponent(n)}`),{method:`DELETE`,headers:{"idempotency-key":crypto.randomUUID()},body:JSON.stringify({expectedVersion:r})})}async function N(n){return(await t(e(`/api/projects/${encodeURIComponent(n)}/sessions?limit=100`))).sessions}async function P(n){await t(e(`/api/projects/${encodeURIComponent(n)}/digest-knowledge`),{method:`POST`,body:JSON.stringify({})})}async function F(n,r){return(await t(e(`/api/projects/${encodeURIComponent(n)}/blockers`),{method:`POST`,body:JSON.stringify(r)})).blocker}async function I(n,r){let i=await t(e(`/api/files/contexts/project/${encodeURIComponent(n)}`)),a=m.parse(i.space),o=new URLSearchParams;r&&o.set(`path`,r);let s=o.toString(),c=h.parse(await t(e(`/api/files/spaces/${encodeURIComponent(a.id)}/children${s?`?${s}`:``}`)));return{ok:!0,root:``,path:r??``,parentPath:r?.includes(`/`)?r.slice(0,r.lastIndexOf(`/`)):null,entries:c.items.map(e=>({fileId:e.id,name:e.name,path:e.relativePath,type:e.kind,size:e.size,updatedAt:new Date(e.modifiedAt).toISOString()}))}}async function L(n){let r=await t(e(`/api/files/contexts/project/${encodeURIComponent(n)}`)),i=m.parse(r.space),a=g.parse(await t(e(`/api/files/spaces/${encodeURIComponent(i.id)}/root`)));return{fileId:a.resource.id,name:a.resource.name}}async function R(n,r,i=50){let a=await t(e(`/api/files/contexts/project/${encodeURIComponent(n)}`)),o=m.parse(a.space),s=new URLSearchParams({q:r.trim(),limit:String(i),spaceId:o.id});return h.parse(await t(e(`/api/files/search?${s}`))).items.map(e=>({name:e.name,path:e.relativePath,isDirectory:e.kind===`directory`}))}export{j as _,S as a,C as c,x as d,A as f,R as g,P as h,M as i,L as l,k as m,T as n,w as o,D as p,F as r,I as s,O as t,N as u,E as v};
1
+ import{i as e,o as t}from"./locale-store-Bld7_m-Q.js";import{d as n,i as r,m as i,n as a,u as o}from"./schemas-CCWMleym.js";import{_ as s,a as c,g as l,h as u,l as d,m as f,u as p}from"./tasks-DRmd6sWt.js";import{i as m,r as h,t as g}from"./files-BNL4kkSB.js";var _=n({id:i(),name:i(),status:i(),description:i().optional(),brief:i().optional(),updatedAt:o()}),v=n({dependencyTaskId:i(),dependentTaskId:i()}),y=n({id:i(),title:i(),phase:l,resolution:s.optional(),operationalState:u,priority:d,dueAt:o().optional(),acceptanceCriteriaCount:o().int().nonnegative(),latestVerification:a([`passed`,`failed`,`unverified`]).optional(),nextCheckAt:o().int().nonnegative().optional(),attention:r(f).default([]),blockedBy:r(c).default([]),allowedCommands:r(i()),updatedAt:o()});n({health:a([`healthy`,`attention`,`idle`,`empty`]),summary:i(),recommendedAction:i().optional(),counts:n({ready:o().int().nonnegative(),moving:o().int().nonnegative(),waiting:o().int().nonnegative(),needsUser:o().int().nonnegative(),done:o().int().nonnegative()}),updatedAt:o().int().nonnegative()});var b=n({project:_,tasks:r(y),dependencyEdges:r(v),blockers:r(n({id:i(),taskId:i(),kind:i(),title:i(),detail:i().optional(),href:i().optional(),updatedAt:o().optional()})),recentResults:r(n({taskId:i(),taskTitle:i(),receipt:p})),digest:n({health:a([`healthy`,`attention`,`idle`,`empty`]),summary:i(),recommendedAction:i().optional()})});async function x(n){let r=new URLSearchParams;n?.status&&r.set(`status`,n.status),n?.search?.trim()&&r.set(`search`,n.search.trim()),n?.sortBy&&r.set(`sortBy`,n.sortBy),n?.sortOrder&&r.set(`sortOrder`,n.sortOrder),n?.limit&&r.set(`limit`,String(n.limit)),n?.offset&&r.set(`offset`,String(n.offset));let i=r.toString();return t(e(`/api/projects${i?`?${i}`:``}`))}async function S(n){return(await t(e(`/api/projects/${encodeURIComponent(n)}`))).project}async function C(n){let r=await t(e(`/api/projects/${encodeURIComponent(n)}/operating-view`));return b.parse(r&&typeof r==`object`?r.view:void 0)}async function w(n,r={}){let i=new URLSearchParams;i.set(`visibility`,`timeline`),r.includeRelated&&i.set(`includeRelated`,`true`),r.limit&&i.set(`limit`,String(r.limit)),r.offset&&i.set(`offset`,String(r.offset));let a=i.toString();return t(e(`/api/projects/${encodeURIComponent(n)}/activity${a?`?${a}`:``}`))}async function T(n){return(await t(e(`/api/projects`),{method:`POST`,headers:{"idempotency-key":crypto.randomUUID()},body:JSON.stringify(n)})).project}async function E(n,r,i){return(await t(e(`/api/projects/${encodeURIComponent(n)}`),{method:`PATCH`,headers:{"idempotency-key":crypto.randomUUID()},body:JSON.stringify({...r,expectedVersion:i})})).project}async function D(e,t,n){return E(e,{name:t},n)}async function O(e,t){return E(e,{status:`archived`},t)}async function k(e,t){return E(e,{status:`active`},t)}async function A(n,r){return(await t(e(`/api/projects/${encodeURIComponent(n)}/pin`),{method:`POST`,headers:{"idempotency-key":crypto.randomUUID()},body:JSON.stringify({expectedVersion:r})})).project}async function j(n,r){return(await t(e(`/api/projects/${encodeURIComponent(n)}/unpin`),{method:`POST`,headers:{"idempotency-key":crypto.randomUUID()},body:JSON.stringify({expectedVersion:r})})).project}async function M(n,r){await t(e(`/api/projects/${encodeURIComponent(n)}`),{method:`DELETE`,headers:{"idempotency-key":crypto.randomUUID()},body:JSON.stringify({expectedVersion:r})})}async function N(n){return(await t(e(`/api/projects/${encodeURIComponent(n)}/sessions?limit=100`))).sessions}async function P(n){await t(e(`/api/projects/${encodeURIComponent(n)}/digest-knowledge`),{method:`POST`,body:JSON.stringify({})})}async function F(n,r){return(await t(e(`/api/projects/${encodeURIComponent(n)}/blockers`),{method:`POST`,body:JSON.stringify(r)})).blocker}async function I(n,r){let i=await t(e(`/api/files/contexts/project/${encodeURIComponent(n)}`)),a=m.parse(i.space),o=new URLSearchParams;r&&o.set(`path`,r);let s=o.toString(),c=h.parse(await t(e(`/api/files/spaces/${encodeURIComponent(a.id)}/children${s?`?${s}`:``}`)));return{ok:!0,root:``,path:r??``,parentPath:r?.includes(`/`)?r.slice(0,r.lastIndexOf(`/`)):null,entries:c.items.map(e=>({fileId:e.id,name:e.name,path:e.relativePath,type:e.kind,size:e.size,updatedAt:new Date(e.modifiedAt).toISOString()}))}}async function L(n){let r=await t(e(`/api/files/contexts/project/${encodeURIComponent(n)}`)),i=m.parse(r.space),a=g.parse(await t(e(`/api/files/spaces/${encodeURIComponent(i.id)}/root`)));return{fileId:a.resource.id,name:a.resource.name}}async function R(n,r,i=50){let a=await t(e(`/api/files/contexts/project/${encodeURIComponent(n)}`)),o=m.parse(a.space),s=new URLSearchParams({q:r.trim(),limit:String(i),spaceId:o.id});return h.parse(await t(e(`/api/files/search?${s}`))).items.map(e=>({name:e.name,path:e.relativePath,isDirectory:e.kind===`directory`}))}export{j as _,S as a,C as c,x as d,A as f,R as g,P as h,M as i,L as l,k as m,T as n,w as o,D as p,F as r,I as s,O as t,N as u,E as v};
@@ -0,0 +1 @@
1
+ import{i as e,r as t}from"./product-delivery-DRyD9_Xq.js";var n=new Set([`agents`,`capabilities`,`personal`,`user-model`,`automations`,`channels`,`chat`,`connectors`,`mcp-setup`,`configuration`,`extensions`,`local-apps`,`notes`,`onboarding`,`open`,`projects`,`settings`,`skills`,`tasks`,`you`]);function r(e){if(!e.startsWith(`/`)||e.startsWith(`//`)||e.includes(`\\`))return null;let t=e.slice(1).split(/[/?#]/,1)[0]??``;return t&&n.has(t)?e:null}function i(e){try{let t=new URL(e);return t.protocol!==`xopc:`||t.username||t.password?null:t.hostname===`app`?r(`${t.pathname}${t.search}${t.hash}`):t.hostname===`settings`?r(`/settings${t.pathname===`/`?``:t.pathname}${t.search}${t.hash}`):null}catch{return null}}function a(n,a=window.location.href){let o=n.trim();if(!o)return{kind:`blocked`};let s=t(o);if(s){let t=e({...s,title:s.id,capabilities:[`open`]});if(t&&s.kind===`automation`){let e=new URL(o).searchParams,n=e.get(`runId`)||e.get(`run`);if(e.get(`view`)===`run`||n){let e=new URL(t,`https://xopc.local`);e.searchParams.set(`view`,`run`),n&&e.searchParams.set(`run`,n),t=`${e.pathname}${e.search}`}}return t?{kind:`internal-route`,route:t}:{kind:`blocked`}}let c=i(o);if(c)return{kind:`internal-route`,route:c};if(o.startsWith(`#/`)){let e=r(o.slice(1));return e?{kind:`internal-route`,route:e}:{kind:`blocked`}}if(o.startsWith(`/`)){let e=r(o);return e?{kind:`internal-route`,route:e}:{kind:`blocked`}}try{let e=new URL(o,a);if(e.protocol!==`http:`&&e.protocol!==`https:`||e.username||e.password)return{kind:`blocked`};let t=new URL(a);if(e.origin===t.origin&&e.hash.startsWith(`#/`)){let t=r(e.hash.slice(1));if(t)return{kind:`internal-route`,route:t}}return{kind:`external-http`,url:e.toString()}}catch{return{kind:`blocked`}}}function o(e,t){if(e.kind===`internal-route`&&/^\/automations\?/.test(e.route)&&/^(?:查看(?:运行情况|执行情况|运行结果|执行结果)|View (?:run|execution|progress|results?)|Track run)$/i.test(t)){let t=new URL(e.route,`https://xopc.local`);return t.searchParams.set(`view`,`run`),{kind:`internal-route`,route:`${t.pathname}${t.search}`}}return e}function s(e,t,n){for(let r of e.querySelectorAll(`a`)){if(n?.(r))continue;let e=a(r.getAttribute(`href`)??``),i=r.dataset.xopcLinkLabel??r.textContent?.trim()??``;if(e=o(e,i),r.dataset.xopcLinkKind=e.kind,e.kind===`blocked`){r.replaceWith(...Array.from(r.childNodes));continue}if(e.kind===`internal-route`){if(r.setAttribute(`href`,`#${e.route}`),r.removeAttribute(`target`),t){let n=e.route.slice(1).split(/[/?#]/,1)[0]??``,i=t.destinations[n]??t.open,a=r.dataset.xopcLinkLabel??r.textContent?.trim()??``;r.dataset.xopcLinkLabel=a,(/^(?:xopc:\/\/|#\/)/i.test(a)||/^(?:Open(?: in xopc)?|打开)$/i.test(a))&&(r.textContent=i),r.title||=i}continue}r.target=`_blank`;let s=new Set(r.rel.split(/\s+/).filter(Boolean));s.add(`noopener`),s.add(`noreferrer`),r.rel=[...s].join(` `)}}async function c(e){let t=a(e);if(t.kind!==`external-http`)return{ok:!1,error:`Only external HTTP(S) links can be opened`};let n=window.electronAPI?.shell?.openExternalUrl;return n?n(t.url):(window.open(t.url,`_blank`,`noopener,noreferrer`),{ok:!0})}export{o as i,c as n,a as r,s as t};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{i,n as a,o}from"./locale-store-DGtk-KSF.js";import{t as s}from"./messages-DYDySzn1.js";import{a as c,i as l,o as u,r as d,s as f,t as p}from"./dist-BGTk37IG.js";import{t as m}from"./copy-Dv6d4Dvw.js";import{t as h}from"./loader-circle-CifKLtgG.js";import{t as g}from"./package-wATCyihJ.js";import{t as _}from"./cn-0WouolD0.js";import{t as v}from"./skeleton-BI5TyibZ.js";import{i as y}from"./vendor-swr-CdRzEUwF.js";import{t as b}from"./button-Cc4hUNTt.js";import{i as x,o as S}from"./settings-shell-dialog-layer-BU3UuiJr.js";import{t as C}from"./copy-to-clipboard-HOJ79TWv.js";import{n as w}from"./interaction-BdhHBbYa.js";import{n as T}from"./electron-env-DHOGevH3.js";import{r as E}from"./settings-form-draft-Dy10ldo8.js";import{t as D}from"./settings-loading-skeleton-BTqvr_Fw.js";import{n as O,t as k}from"./settings-page-header-4d1u-o-F.js";import"./settings-page-layout-Cy9_VBag.js";import{r as A,t as j}from"./settings-form-section-num14vSv.js";var M=n(),N=e(t(),1),P=r();function F(e,t){return e==null?t:e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function I(e,t){return e===`PENDING_UPDATE`?t.pendingUpdate??t.generic:e===`UNINSTALLER_NOT_FOUND`?t.uninstallerNotFound??t.generic:e===`NOT_PACKAGED`?t.notPackaged??t.generic:t.generic}function L(e,t){if(e.platform===`darwin`)return t.uninstallDescDarwin;if(e.platform===`win32`)return t.uninstallDescWin;if(e.platform===`linux`){if(e.linuxPackageKind===`appimage`)return t.uninstallDescLinuxAppImage;if(e.linuxPackageKind===`deb`){let n=e.linuxDebPackageName??`xopc`;return t.uninstallDescLinuxDeb.replace(/\{\{package\}\}/g,n)}return t.uninstallDescLinuxUnknown}return t.uninstallDescLinuxUnknown}var R={info:null,loadError:null,actionError:null,copiedField:null,clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``,uninstallDialogOpen:!1,removeUserDataOnUninstall:!1,busy:!1};function z({api:e,messages:t,embedded:n=!0}){let[r,i]=(0,N.useReducer)(E,R),{info:a,loadError:o,actionError:s,copiedField:v,clearDialogOpen:y,clearConfirmChecked:T,clearConfirmText:O,uninstallDialogOpen:k,removeUserDataOnUninstall:A,busy:M}=r,z=(0,N.useCallback)(async()=>{if(e?.getUninstallInfo){i({type:`patch`,patch:{loadError:null}});try{let t=await e.getUninstallInfo();i({type:`patch`,patch:{info:t}})}catch(e){i({type:`patch`,patch:{loadError:e instanceof Error?e.message:String(e)}})}}},[e]);(0,N.useEffect)(()=>{z()},[z]);let B=async(e,n)=>{if(await C(e)){i({type:`patch`,patch:{actionError:null,copiedField:n}}),window.setTimeout(()=>i({type:`patch`,patch:{copiedField:null}}),2e3);return}i({type:`patch`,patch:{actionError:t.copyFailed}})},V=async()=>{if(!(!e?.clearUserData||M)){i({type:`patch`,patch:{busy:!0,actionError:null}});try{let n=await e.clearUserData();n.ok||i({type:`patch`,patch:{actionError:I(n.error,t.errors)}})}catch(e){i({type:`patch`,patch:{actionError:e instanceof Error?e.message:t.errors.generic}})}finally{i({type:`patch`,patch:{busy:!1,clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``}})}}},H=async()=>{if(e?.uninstallApp){i({type:`patch`,patch:{busy:!0,actionError:null}});try{let n=await e.uninstallApp({removeUserData:A});n.ok||i({type:`patch`,patch:{actionError:I(n.error,t.errors)}})}catch(e){i({type:`patch`,patch:{actionError:e instanceof Error?e.message:t.errors.generic}})}finally{i({type:`patch`,patch:{busy:!1,uninstallDialogOpen:!1}})}}};if(o)return(0,P.jsx)(`p`,{className:`text-sm text-amber-600 dark:text-amber-400`,role:`alert`,children:o});if(!a)return(0,P.jsx)(D,{rows:2});let U=!a.packaged,W=M||a.pendingUpdate||U,G=!U&&a.uninstallMode!==`unsupported`,K=L(a,t),q=T&&O.trim()===t.clearDataConfirmPhrase;return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(j,{children:[n?(0,P.jsxs)(`div`,{className:`mb-4 flex items-center gap-2 text-sm font-semibold text-fg`,children:[(0,P.jsx)(g,{className:`size-4 text-accent`,strokeWidth:1.75}),t.title]}):null,s?(0,P.jsx)(`p`,{className:`mb-3 text-sm text-amber-600 dark:text-amber-400`,role:`alert`,children:s}):null,U?(0,P.jsxs)(`div`,{className:`mb-4 rounded-xl bg-surface-panel/70 px-3 py-2.5 shadow-surface`,children:[(0,P.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:t.devOnlyTitle}),(0,P.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:t.devOnlyBody})]}):null,a.pendingUpdate?(0,P.jsx)(`p`,{className:`mb-3 rounded-xl bg-amber-500/10 px-3 py-2 text-xs text-amber-800 dark:text-amber-200`,children:t.pendingUpdateBlocked}):null,(0,P.jsxs)(`dl`,{className:`space-y-3 text-sm`,children:[(0,P.jsxs)(`div`,{className:`rounded-xl bg-surface-panel/70 p-3 shadow-surface`,children:[(0,P.jsx)(`dt`,{className:`text-xs font-medium text-fg-muted`,children:t.appPath}),(0,P.jsxs)(`dd`,{className:`mt-1 flex items-start justify-between gap-2`,children:[(0,P.jsx)(`code`,{className:`break-all text-xs text-fg`,children:a.appPath}),(0,P.jsxs)(`button`,{type:`button`,className:_(`inline-flex shrink-0 items-center gap-1 rounded-lg border border-edge px-2 py-1 text-xs text-fg hover:bg-surface-hover`,w.press),onClick:()=>void B(a.appPath,`app`),children:[(0,P.jsx)(m,{className:`size-3`,"aria-hidden":!0}),v===`app`?t.copied:t.copyPath]})]})]}),(0,P.jsxs)(`div`,{className:`rounded-xl bg-surface-panel/70 p-3 shadow-surface`,children:[(0,P.jsx)(`dt`,{className:`text-xs font-medium text-fg-muted`,children:t.dataPath}),(0,P.jsxs)(`dd`,{className:`mt-1 flex items-start justify-between gap-2`,children:[(0,P.jsx)(`code`,{className:`break-all text-xs text-fg`,children:a.dataPath}),(0,P.jsxs)(`button`,{type:`button`,className:_(`inline-flex shrink-0 items-center gap-1 rounded-lg border border-edge px-2 py-1 text-xs text-fg hover:bg-surface-hover`,w.press),onClick:()=>void B(a.dataPath,`data`),children:[(0,P.jsx)(m,{className:`size-3`,"aria-hidden":!0}),v===`data`?t.copied:t.copyPath]})]}),(0,P.jsxs)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:[t.dataSize,`: `,F(a.dataSizeBytes,t.dataSizeUnknown)]}),(0,P.jsx)(`p`,{className:`mt-2 text-xs leading-relaxed text-amber-800 dark:text-amber-200`,children:t.sharedDataWarning})]})]}),(0,P.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[(0,P.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-xl bg-surface-panel/70 p-3 shadow-surface sm:flex-row sm:items-center sm:justify-between`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t.clearData}),(0,P.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:t.clearDataDesc})]}),(0,P.jsx)(`button`,{type:`button`,disabled:W,className:_(`inline-flex shrink-0 items-center justify-center rounded-lg border border-danger/40 bg-danger px-3 py-1.5 text-sm font-medium text-white hover:bg-danger/90 disabled:opacity-50`,w.press),onClick:()=>{i({type:`patch`,patch:{clearConfirmChecked:!1,clearConfirmText:``,clearDialogOpen:!0}})},children:t.clearData})]}),G?(0,P.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-xl bg-surface-panel/70 p-3 shadow-surface sm:flex-row sm:items-center sm:justify-between`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t.uninstall}),(0,P.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:K})]}),(0,P.jsx)(`button`,{type:`button`,disabled:W,className:_(`inline-flex shrink-0 items-center justify-center rounded-lg border border-edge bg-surface-base px-3 py-1.5 text-sm font-medium text-fg hover:bg-surface-hover disabled:opacity-50`,w.press),onClick:()=>{i({type:`patch`,patch:{removeUserDataOnUninstall:!1,uninstallDialogOpen:!0}})},children:t.uninstall})]}):null]})]}),(0,P.jsx)(p,{open:y,onOpenChange:e=>{!e&&!M&&i({type:`patch`,patch:{clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``}})},children:(0,P.jsxs)(u,{children:[(0,P.jsx)(c,{className:_(`xopc-dialog-overlay fixed inset-0 bg-scrim backdrop-blur-[1px]`,S)}),(0,P.jsxs)(d,{className:_(`xopc-dialog-content fixed left-1/2 top-1/2 flex h-[min(30rem,calc(100dvh-2rem))] w-[min(100%-2rem,28rem)] flex-col overflow-hidden -translate-x-1/2 -translate-y-1/2`,x,`rounded-2xl border border-edge bg-surface-overlay p-6 shadow-popover outline-none dark:border-edge`),onOpenAutoFocus:e=>e.preventDefault(),onEscapeKeyDown:e=>{M&&e.preventDefault()},onInteractOutside:e=>{M&&e.preventDefault()},"aria-busy":M,children:[(0,P.jsx)(f,{className:`text-base font-semibold text-fg`,children:t.clearDataConfirmTitle}),(0,P.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain`,children:[(0,P.jsx)(l,{className:`mt-2 text-sm text-fg-muted`,children:t.clearDataConfirmDesc}),(0,P.jsxs)(`label`,{className:`mt-4 flex cursor-pointer items-start gap-2 text-sm text-fg`,children:[(0,P.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox mt-0.5`,disabled:M,checked:T,onChange:e=>i({type:`patch`,patch:{clearConfirmChecked:e.target.checked}})}),(0,P.jsx)(`span`,{children:t.clearDataConfirmCheckbox})]}),(0,P.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,P.jsx)(`label`,{className:`block text-sm font-medium text-fg`,htmlFor:`clear-data-confirm`,children:t.clearDataConfirmLabel}),(0,P.jsx)(`input`,{id:`clear-data-confirm`,disabled:M,type:`text`,autoComplete:`off`,spellCheck:!1,className:_(`w-full rounded-md border border-edge bg-surface-panel px-3 py-1.5 font-mono text-xs text-fg`,`placeholder:text-fg-subtle`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`,`dark:border-edge`),placeholder:t.clearDataConfirmPhrase,value:O,onChange:e=>i({type:`patch`,patch:{clearConfirmText:e.target.value}})}),M?(0,P.jsxs)(`div`,{className:`space-y-2`,role:`status`,"aria-live":`polite`,children:[(0,P.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:t.clearDataProgress}),(0,P.jsx)(`div`,{role:`progressbar`,"aria-label":t.clearDataProgress,className:`h-1.5 overflow-hidden rounded-full bg-surface-active`,children:(0,P.jsx)(`div`,{className:`xopc-clear-data-progress h-full w-1/3 rounded-full bg-accent`})}),(0,P.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.clearDataProgressHint})]}):(0,P.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.clearDataConfirmHint})]})]}),(0,P.jsxs)(`div`,{className:`mt-6 flex shrink-0 justify-end gap-2`,children:[(0,P.jsx)(b,{type:`button`,variant:`secondary`,disabled:M,onClick:()=>{i({type:`patch`,patch:{clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``}})},children:t.cancel}),(0,P.jsxs)(b,{type:`button`,variant:`secondary`,className:`border-danger/40 bg-danger text-white hover:bg-danger/90 dark:border-danger/40`,disabled:M||!q,onClick:()=>void V(),children:[M?(0,P.jsx)(h,{className:`size-4 animate-spin motion-reduce:animate-none`,"aria-hidden":!0}):null,M?t.clearDataProgress:t.confirmClear]})]})]})]})}),G?(0,P.jsx)(p,{open:k,onOpenChange:e=>{e||i({type:`patch`,patch:{uninstallDialogOpen:!1}})},children:(0,P.jsxs)(u,{children:[(0,P.jsx)(c,{className:_(`xopc-dialog-overlay fixed inset-0 bg-scrim backdrop-blur-[1px]`,S)}),(0,P.jsxs)(d,{className:_(`xopc-dialog-content fixed left-1/2 top-1/2 w-[min(100%-2rem,28rem)] -translate-x-1/2 -translate-y-1/2`,x,`rounded-2xl border border-edge bg-surface-overlay p-6 shadow-popover outline-none dark:border-edge`),onOpenAutoFocus:e=>e.preventDefault(),children:[(0,P.jsx)(f,{className:`text-base font-semibold text-fg`,children:t.uninstallConfirmTitle}),(0,P.jsx)(l,{className:`mt-2 text-sm text-fg-muted`,children:K}),(0,P.jsxs)(`label`,{className:`mt-4 flex cursor-pointer items-start gap-2 text-sm text-fg`,children:[(0,P.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox mt-0.5`,checked:A,onChange:e=>i({type:`patch`,patch:{removeUserDataOnUninstall:e.target.checked}})}),(0,P.jsx)(`span`,{children:t.removeUserDataCheckbox})]}),A?(0,P.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:t.clearDataConfirmDesc}):null,(0,P.jsxs)(`div`,{className:`mt-6 flex justify-end gap-2`,children:[(0,P.jsx)(b,{type:`button`,variant:`secondary`,disabled:M,onClick:()=>i({type:`patch`,patch:{uninstallDialogOpen:!1}}),children:t.cancel}),(0,P.jsx)(b,{type:`button`,variant:`secondary`,className:`border-danger/40 bg-danger text-white hover:bg-danger/90 dark:border-danger/40`,disabled:M,onClick:()=>void H(),children:t.confirmUninstall})]})]})]})}):null]})}async function B(){return(await o(i(`/api/migrations/status`))).payload}async function V(){await o(i(`/api/migrations/apply`),{method:`POST`,body:`{}`})}function H({messages:e}){let{data:t,error:n,isLoading:r,mutate:i}=y(`settings-migration-status`,B,{refreshInterval:0,revalidateOnFocus:!1}),[a,o]=(0,N.useState)(!1),[s,c]=(0,N.useState)(null);async function l(){o(!0),c(null);try{await V(),await i(),window.dispatchEvent(new CustomEvent(`config-reload`))}catch(e){c(e instanceof Error?e.message:String(e))}finally{o(!1)}}if(r)return(0,P.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-4`,"aria-busy":`true`,children:[(0,P.jsx)(v,{className:`h-5 w-40 max-w-full`}),(0,P.jsx)(v,{className:`mt-2 h-4 w-64 max-w-full`})]});if(n)return(0,P.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-4`,children:[(0,P.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:e.title}),(0,P.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:e.checkFailed})]});let u=t?.items??[],d=u.filter(e=>e.status===`conflict`||e.status===`error`),f=u.filter(e=>e.safety===`auto`&&e.status===`planned`),p=d.length>0||u.some(e=>e.safety!==`auto`);return(0,P.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-4`,children:[(0,P.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:e.title}),(0,P.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:u.length===0?e.upToDate:p?e.manualAttention:e.safeRepairs.replace(`{{count}}`,String(f.length))})]}),f.length>0&&!p?(0,P.jsx)(b,{type:`button`,variant:`primary`,className:`px-3 py-1.5 text-xs`,onClick:()=>void l(),disabled:a,children:a?e.applying:e.apply}):null]}),u.length>0?(0,P.jsx)(`div`,{className:`mt-3 space-y-2`,children:u.map(e=>(0,P.jsxs)(`div`,{className:`rounded-xl bg-surface-base/55 px-3 py-2`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,P.jsx)(`div`,{className:`truncate text-sm font-medium text-fg`,children:e.title}),(0,P.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-0.5 text-[11px] uppercase tracking-wide text-fg-muted`,children:e.status})]}),(0,P.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:e.message})]},e.id))}):null,s?(0,P.jsx)(`p`,{className:`mt-3 text-sm text-red-500`,children:s}):null]})}function U(){let e=(0,M.c)(28),t=a(W),n;e[0]===t?n=e[1]:(n=s(t),e[0]=t,e[1]=n);let r=n.systemSettings,i=r.desktopApp,o=typeof window<`u`?window.electronAPI?.system:void 0;if(!T()||!o){let t;e[2]===i.title?t=e[3]:(t=(0,P.jsx)(k,{title:i.title}),e[2]=i.title,e[3]=t);let n;e[4]===i.migrations?n=e[5]:(n=(0,P.jsx)(H,{messages:i.migrations}),e[4]=i.migrations,e[5]=n);let a;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(a=A(),e[6]=a):a=e[6];let o;e[7]===r.desktopOnlyTitle?o=e[8]:(o=(0,P.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:r.desktopOnlyTitle}),e[7]=r.desktopOnlyTitle,e[8]=o);let s;e[9]===r.desktopOnlyBody?s=e[10]:(s=(0,P.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:r.desktopOnlyBody}),e[9]=r.desktopOnlyBody,e[10]=s);let c;e[11]!==o||e[12]!==s?(c=(0,P.jsxs)(`div`,{className:a,children:[o,s]}),e[11]=o,e[12]=s,e[13]=c):c=e[13];let l;return e[14]!==t||e[15]!==n||e[16]!==c?(l=(0,P.jsxs)(O,{gap:`gap-3`,children:[t,n,c]}),e[14]=t,e[15]=n,e[16]=c,e[17]=l):l=e[17],l}let c;e[18]===i.title?c=e[19]:(c=(0,P.jsx)(k,{title:i.title}),e[18]=i.title,e[19]=c);let l;e[20]===i.migrations?l=e[21]:(l=(0,P.jsx)(H,{messages:i.migrations}),e[20]=i.migrations,e[21]=l);let u;e[22]===i?u=e[23]:(u=(0,P.jsx)(z,{api:o,messages:i,embedded:!1}),e[22]=i,e[23]=u);let d;return e[24]!==c||e[25]!==l||e[26]!==u?(d=(0,P.jsxs)(O,{gap:`gap-6`,children:[c,l,u]}),e[24]=c,e[25]=l,e[26]=u,e[27]=d):d=e[27],d}function W(e){return e.language}export{U as AppManagementSettingsPanel};
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{i,n as a,o}from"./locale-store-Bld7_m-Q.js";import{t as s}from"./messages-CGO1P4mz.js";import{a as c,i as l,o as u,r as d,s as f,t as p}from"./dist-BGTk37IG.js";import{t as m}from"./copy-Dv6d4Dvw.js";import{t as h}from"./loader-circle-CifKLtgG.js";import{t as g}from"./package-wATCyihJ.js";import{t as _}from"./cn-0WouolD0.js";import{t as v}from"./skeleton-DzdOeGYz.js";import{i as y}from"./vendor-swr-CdRzEUwF.js";import{t as b}from"./button-Cc4hUNTt.js";import{i as x,o as S}from"./settings-shell-dialog-layer-BU3UuiJr.js";import{t as C}from"./copy-to-clipboard-HOJ79TWv.js";import{n as w}from"./interaction-BdhHBbYa.js";import{n as T}from"./electron-env-DHOGevH3.js";import{r as E}from"./settings-form-draft-Dy10ldo8.js";import{t as D}from"./settings-loading-skeleton-CAoOV17i.js";import{n as O,t as k}from"./settings-page-header-BYFaTD8a.js";import"./settings-page-layout-CnUQSxT3.js";import{r as A,t as j}from"./settings-form-section-num14vSv.js";var M=n(),N=e(t(),1),P=r();function F(e,t){return e==null?t:e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function I(e,t){return e===`PENDING_UPDATE`?t.pendingUpdate??t.generic:e===`UNINSTALLER_NOT_FOUND`?t.uninstallerNotFound??t.generic:e===`NOT_PACKAGED`?t.notPackaged??t.generic:t.generic}function L(e,t){if(e.platform===`darwin`)return t.uninstallDescDarwin;if(e.platform===`win32`)return t.uninstallDescWin;if(e.platform===`linux`){if(e.linuxPackageKind===`appimage`)return t.uninstallDescLinuxAppImage;if(e.linuxPackageKind===`deb`){let n=e.linuxDebPackageName??`xopc`;return t.uninstallDescLinuxDeb.replace(/\{\{package\}\}/g,n)}return t.uninstallDescLinuxUnknown}return t.uninstallDescLinuxUnknown}var R={info:null,loadError:null,actionError:null,copiedField:null,clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``,uninstallDialogOpen:!1,removeUserDataOnUninstall:!1,busy:!1};function z({api:e,messages:t,embedded:n=!0}){let[r,i]=(0,N.useReducer)(E,R),{info:a,loadError:o,actionError:s,copiedField:v,clearDialogOpen:y,clearConfirmChecked:T,clearConfirmText:O,uninstallDialogOpen:k,removeUserDataOnUninstall:A,busy:M}=r,z=(0,N.useCallback)(async()=>{if(e?.getUninstallInfo){i({type:`patch`,patch:{loadError:null}});try{let t=await e.getUninstallInfo();i({type:`patch`,patch:{info:t}})}catch(e){i({type:`patch`,patch:{loadError:e instanceof Error?e.message:String(e)}})}}},[e]);(0,N.useEffect)(()=>{z()},[z]);let B=async(e,n)=>{if(await C(e)){i({type:`patch`,patch:{actionError:null,copiedField:n}}),window.setTimeout(()=>i({type:`patch`,patch:{copiedField:null}}),2e3);return}i({type:`patch`,patch:{actionError:t.copyFailed}})},V=async()=>{if(!(!e?.clearUserData||M)){i({type:`patch`,patch:{busy:!0,actionError:null}});try{let n=await e.clearUserData();n.ok||i({type:`patch`,patch:{actionError:I(n.error,t.errors)}})}catch(e){i({type:`patch`,patch:{actionError:e instanceof Error?e.message:t.errors.generic}})}finally{i({type:`patch`,patch:{busy:!1,clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``}})}}},H=async()=>{if(e?.uninstallApp){i({type:`patch`,patch:{busy:!0,actionError:null}});try{let n=await e.uninstallApp({removeUserData:A});n.ok||i({type:`patch`,patch:{actionError:I(n.error,t.errors)}})}catch(e){i({type:`patch`,patch:{actionError:e instanceof Error?e.message:t.errors.generic}})}finally{i({type:`patch`,patch:{busy:!1,uninstallDialogOpen:!1}})}}};if(o)return(0,P.jsx)(`p`,{className:`text-sm text-amber-600 dark:text-amber-400`,role:`alert`,children:o});if(!a)return(0,P.jsx)(D,{rows:2});let U=!a.packaged,W=M||a.pendingUpdate||U,G=!U&&a.uninstallMode!==`unsupported`,K=L(a,t),q=T&&O.trim()===t.clearDataConfirmPhrase;return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(j,{children:[n?(0,P.jsxs)(`div`,{className:`mb-4 flex items-center gap-2 text-sm font-semibold text-fg`,children:[(0,P.jsx)(g,{className:`size-4 text-accent`,strokeWidth:1.75}),t.title]}):null,s?(0,P.jsx)(`p`,{className:`mb-3 text-sm text-amber-600 dark:text-amber-400`,role:`alert`,children:s}):null,U?(0,P.jsxs)(`div`,{className:`mb-4 rounded-xl bg-surface-panel/70 px-3 py-2.5 shadow-surface`,children:[(0,P.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:t.devOnlyTitle}),(0,P.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:t.devOnlyBody})]}):null,a.pendingUpdate?(0,P.jsx)(`p`,{className:`mb-3 rounded-xl bg-amber-500/10 px-3 py-2 text-xs text-amber-800 dark:text-amber-200`,children:t.pendingUpdateBlocked}):null,(0,P.jsxs)(`dl`,{className:`space-y-3 text-sm`,children:[(0,P.jsxs)(`div`,{className:`rounded-xl bg-surface-panel/70 p-3 shadow-surface`,children:[(0,P.jsx)(`dt`,{className:`text-xs font-medium text-fg-muted`,children:t.appPath}),(0,P.jsxs)(`dd`,{className:`mt-1 flex items-start justify-between gap-2`,children:[(0,P.jsx)(`code`,{className:`break-all text-xs text-fg`,children:a.appPath}),(0,P.jsxs)(`button`,{type:`button`,className:_(`inline-flex shrink-0 items-center gap-1 rounded-lg border border-edge px-2 py-1 text-xs text-fg hover:bg-surface-hover`,w.press),onClick:()=>void B(a.appPath,`app`),children:[(0,P.jsx)(m,{className:`size-3`,"aria-hidden":!0}),v===`app`?t.copied:t.copyPath]})]})]}),(0,P.jsxs)(`div`,{className:`rounded-xl bg-surface-panel/70 p-3 shadow-surface`,children:[(0,P.jsx)(`dt`,{className:`text-xs font-medium text-fg-muted`,children:t.dataPath}),(0,P.jsxs)(`dd`,{className:`mt-1 flex items-start justify-between gap-2`,children:[(0,P.jsx)(`code`,{className:`break-all text-xs text-fg`,children:a.dataPath}),(0,P.jsxs)(`button`,{type:`button`,className:_(`inline-flex shrink-0 items-center gap-1 rounded-lg border border-edge px-2 py-1 text-xs text-fg hover:bg-surface-hover`,w.press),onClick:()=>void B(a.dataPath,`data`),children:[(0,P.jsx)(m,{className:`size-3`,"aria-hidden":!0}),v===`data`?t.copied:t.copyPath]})]}),(0,P.jsxs)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:[t.dataSize,`: `,F(a.dataSizeBytes,t.dataSizeUnknown)]}),(0,P.jsx)(`p`,{className:`mt-2 text-xs leading-relaxed text-amber-800 dark:text-amber-200`,children:t.sharedDataWarning})]})]}),(0,P.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[(0,P.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-xl bg-surface-panel/70 p-3 shadow-surface sm:flex-row sm:items-center sm:justify-between`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t.clearData}),(0,P.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:t.clearDataDesc})]}),(0,P.jsx)(`button`,{type:`button`,disabled:W,className:_(`inline-flex shrink-0 items-center justify-center rounded-lg border border-danger/40 bg-danger px-3 py-1.5 text-sm font-medium text-white hover:bg-danger/90 disabled:opacity-50`,w.press),onClick:()=>{i({type:`patch`,patch:{clearConfirmChecked:!1,clearConfirmText:``,clearDialogOpen:!0}})},children:t.clearData})]}),G?(0,P.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-xl bg-surface-panel/70 p-3 shadow-surface sm:flex-row sm:items-center sm:justify-between`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t.uninstall}),(0,P.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:K})]}),(0,P.jsx)(`button`,{type:`button`,disabled:W,className:_(`inline-flex shrink-0 items-center justify-center rounded-lg border border-edge bg-surface-base px-3 py-1.5 text-sm font-medium text-fg hover:bg-surface-hover disabled:opacity-50`,w.press),onClick:()=>{i({type:`patch`,patch:{removeUserDataOnUninstall:!1,uninstallDialogOpen:!0}})},children:t.uninstall})]}):null]})]}),(0,P.jsx)(p,{open:y,onOpenChange:e=>{!e&&!M&&i({type:`patch`,patch:{clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``}})},children:(0,P.jsxs)(u,{children:[(0,P.jsx)(c,{className:_(`xopc-dialog-overlay fixed inset-0 bg-scrim backdrop-blur-[1px]`,S)}),(0,P.jsxs)(d,{className:_(`xopc-dialog-content fixed left-1/2 top-1/2 flex h-[min(30rem,calc(100dvh-2rem))] w-[min(100%-2rem,28rem)] flex-col overflow-hidden -translate-x-1/2 -translate-y-1/2`,x,`rounded-2xl border border-edge bg-surface-overlay p-6 shadow-popover outline-none dark:border-edge`),onOpenAutoFocus:e=>e.preventDefault(),onEscapeKeyDown:e=>{M&&e.preventDefault()},onInteractOutside:e=>{M&&e.preventDefault()},"aria-busy":M,children:[(0,P.jsx)(f,{className:`text-base font-semibold text-fg`,children:t.clearDataConfirmTitle}),(0,P.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain`,children:[(0,P.jsx)(l,{className:`mt-2 text-sm text-fg-muted`,children:t.clearDataConfirmDesc}),(0,P.jsxs)(`label`,{className:`mt-4 flex cursor-pointer items-start gap-2 text-sm text-fg`,children:[(0,P.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox mt-0.5`,disabled:M,checked:T,onChange:e=>i({type:`patch`,patch:{clearConfirmChecked:e.target.checked}})}),(0,P.jsx)(`span`,{children:t.clearDataConfirmCheckbox})]}),(0,P.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,P.jsx)(`label`,{className:`block text-sm font-medium text-fg`,htmlFor:`clear-data-confirm`,children:t.clearDataConfirmLabel}),(0,P.jsx)(`input`,{id:`clear-data-confirm`,disabled:M,type:`text`,autoComplete:`off`,spellCheck:!1,className:_(`w-full rounded-md border border-edge bg-surface-panel px-3 py-1.5 font-mono text-xs text-fg`,`placeholder:text-fg-subtle`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`,`dark:border-edge`),placeholder:t.clearDataConfirmPhrase,value:O,onChange:e=>i({type:`patch`,patch:{clearConfirmText:e.target.value}})}),M?(0,P.jsxs)(`div`,{className:`space-y-2`,role:`status`,"aria-live":`polite`,children:[(0,P.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:t.clearDataProgress}),(0,P.jsx)(`div`,{role:`progressbar`,"aria-label":t.clearDataProgress,className:`h-1.5 overflow-hidden rounded-full bg-surface-active`,children:(0,P.jsx)(`div`,{className:`xopc-clear-data-progress h-full w-1/3 rounded-full bg-accent`})}),(0,P.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.clearDataProgressHint})]}):(0,P.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.clearDataConfirmHint})]})]}),(0,P.jsxs)(`div`,{className:`mt-6 flex shrink-0 justify-end gap-2`,children:[(0,P.jsx)(b,{type:`button`,variant:`secondary`,disabled:M,onClick:()=>{i({type:`patch`,patch:{clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``}})},children:t.cancel}),(0,P.jsxs)(b,{type:`button`,variant:`secondary`,className:`border-danger/40 bg-danger text-white hover:bg-danger/90 dark:border-danger/40`,disabled:M||!q,onClick:()=>void V(),children:[M?(0,P.jsx)(h,{className:`size-4 animate-spin motion-reduce:animate-none`,"aria-hidden":!0}):null,M?t.clearDataProgress:t.confirmClear]})]})]})]})}),G?(0,P.jsx)(p,{open:k,onOpenChange:e=>{e||i({type:`patch`,patch:{uninstallDialogOpen:!1}})},children:(0,P.jsxs)(u,{children:[(0,P.jsx)(c,{className:_(`xopc-dialog-overlay fixed inset-0 bg-scrim backdrop-blur-[1px]`,S)}),(0,P.jsxs)(d,{className:_(`xopc-dialog-content fixed left-1/2 top-1/2 w-[min(100%-2rem,28rem)] -translate-x-1/2 -translate-y-1/2`,x,`rounded-2xl border border-edge bg-surface-overlay p-6 shadow-popover outline-none dark:border-edge`),onOpenAutoFocus:e=>e.preventDefault(),children:[(0,P.jsx)(f,{className:`text-base font-semibold text-fg`,children:t.uninstallConfirmTitle}),(0,P.jsx)(l,{className:`mt-2 text-sm text-fg-muted`,children:K}),(0,P.jsxs)(`label`,{className:`mt-4 flex cursor-pointer items-start gap-2 text-sm text-fg`,children:[(0,P.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox mt-0.5`,checked:A,onChange:e=>i({type:`patch`,patch:{removeUserDataOnUninstall:e.target.checked}})}),(0,P.jsx)(`span`,{children:t.removeUserDataCheckbox})]}),A?(0,P.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:t.clearDataConfirmDesc}):null,(0,P.jsxs)(`div`,{className:`mt-6 flex justify-end gap-2`,children:[(0,P.jsx)(b,{type:`button`,variant:`secondary`,disabled:M,onClick:()=>i({type:`patch`,patch:{uninstallDialogOpen:!1}}),children:t.cancel}),(0,P.jsx)(b,{type:`button`,variant:`secondary`,className:`border-danger/40 bg-danger text-white hover:bg-danger/90 dark:border-danger/40`,disabled:M,onClick:()=>void H(),children:t.confirmUninstall})]})]})]})}):null]})}async function B(){return(await o(i(`/api/migrations/status`))).payload}async function V(){await o(i(`/api/migrations/apply`),{method:`POST`,body:`{}`})}function H({messages:e}){let{data:t,error:n,isLoading:r,mutate:i}=y(`settings-migration-status`,B,{refreshInterval:0,revalidateOnFocus:!1}),[a,o]=(0,N.useState)(!1),[s,c]=(0,N.useState)(null);async function l(){o(!0),c(null);try{await V(),await i(),window.dispatchEvent(new CustomEvent(`config-reload`))}catch(e){c(e instanceof Error?e.message:String(e))}finally{o(!1)}}if(r)return(0,P.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-4`,"aria-busy":`true`,children:[(0,P.jsx)(v,{className:`h-5 w-40 max-w-full`}),(0,P.jsx)(v,{className:`mt-2 h-4 w-64 max-w-full`})]});if(n)return(0,P.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-4`,children:[(0,P.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:e.title}),(0,P.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:e.checkFailed})]});let u=t?.items??[],d=u.filter(e=>e.status===`conflict`||e.status===`error`),f=u.filter(e=>e.safety===`auto`&&e.status===`planned`),p=d.length>0||u.some(e=>e.safety!==`auto`);return(0,P.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-4`,children:[(0,P.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:e.title}),(0,P.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:u.length===0?e.upToDate:p?e.manualAttention:e.safeRepairs.replace(`{{count}}`,String(f.length))})]}),f.length>0&&!p?(0,P.jsx)(b,{type:`button`,variant:`primary`,className:`px-3 py-1.5 text-xs`,onClick:()=>void l(),disabled:a,children:a?e.applying:e.apply}):null]}),u.length>0?(0,P.jsx)(`div`,{className:`mt-3 space-y-2`,children:u.map(e=>(0,P.jsxs)(`div`,{className:`rounded-xl bg-surface-base/55 px-3 py-2`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,P.jsx)(`div`,{className:`truncate text-sm font-medium text-fg`,children:e.title}),(0,P.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-0.5 text-[11px] uppercase tracking-wide text-fg-muted`,children:e.status})]}),(0,P.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:e.message})]},e.id))}):null,s?(0,P.jsx)(`p`,{className:`mt-3 text-sm text-red-500`,children:s}):null]})}function U(){let e=(0,M.c)(28),t=a(W),n;e[0]===t?n=e[1]:(n=s(t),e[0]=t,e[1]=n);let r=n.systemSettings,i=r.desktopApp,o=typeof window<`u`?window.electronAPI?.system:void 0;if(!T()||!o){let t;e[2]===i.title?t=e[3]:(t=(0,P.jsx)(k,{title:i.title}),e[2]=i.title,e[3]=t);let n;e[4]===i.migrations?n=e[5]:(n=(0,P.jsx)(H,{messages:i.migrations}),e[4]=i.migrations,e[5]=n);let a;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(a=A(),e[6]=a):a=e[6];let o;e[7]===r.desktopOnlyTitle?o=e[8]:(o=(0,P.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:r.desktopOnlyTitle}),e[7]=r.desktopOnlyTitle,e[8]=o);let s;e[9]===r.desktopOnlyBody?s=e[10]:(s=(0,P.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:r.desktopOnlyBody}),e[9]=r.desktopOnlyBody,e[10]=s);let c;e[11]!==o||e[12]!==s?(c=(0,P.jsxs)(`div`,{className:a,children:[o,s]}),e[11]=o,e[12]=s,e[13]=c):c=e[13];let l;return e[14]!==t||e[15]!==n||e[16]!==c?(l=(0,P.jsxs)(O,{gap:`gap-3`,children:[t,n,c]}),e[14]=t,e[15]=n,e[16]=c,e[17]=l):l=e[17],l}let c;e[18]===i.title?c=e[19]:(c=(0,P.jsx)(k,{title:i.title}),e[18]=i.title,e[19]=c);let l;e[20]===i.migrations?l=e[21]:(l=(0,P.jsx)(H,{messages:i.migrations}),e[20]=i.migrations,e[21]=l);let u;e[22]===i?u=e[23]:(u=(0,P.jsx)(z,{api:o,messages:i,embedded:!1}),e[22]=i,e[23]=u);let d;return e[24]!==c||e[25]!==l||e[26]!==u?(d=(0,P.jsxs)(O,{gap:`gap-6`,children:[c,l,u]}),e[24]=c,e[25]=l,e[26]=u,e[27]=d):d=e[27],d}function W(e){return e.language}export{U as AppManagementSettingsPanel};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{i,n as a,o}from"./locale-store-DGtk-KSF.js";import{t as s}from"./messages-DYDySzn1.js";import{n as c,r as l}from"./popover-select-CEMWIrtY.js";import{t as u}from"./cn-0WouolD0.js";import{t as d}from"./skeleton-BI5TyibZ.js";import{n as f,r as p}from"./gateway-config-swr-BW6eBLIt.js";import{n as m}from"./interaction-BdhHBbYa.js";import{t as h}from"./preference-select-fields-Bx26yGRF.js";import{i as g}from"./theme-store-D58tk8pq.js";import{t as _}from"./dev-view-store-D4C_zjRq.js";import{n as v,t as y}from"./settings-page-header-4d1u-o-F.js";import"./settings-page-layout-Cy9_VBag.js";import{t as b}from"./settings-advanced-gate-Ch9MNvvk.js";var x=e(t(),1),S=n();function C(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function w(e){let t=C(e)?e:{},n=C(t.gateway)?t.gateway:{},r=(C(n.webchat)?n.webchat:{}).activityDetailDefault;return r===`off`||r===`stream`||r===`on`?r:`on`}async function T(e){await o(i(`/api/config`),{method:`PATCH`,body:JSON.stringify({gateway:{webchat:{activityDetailDefault:e}}})}),await f()}var E=r();function D(e){let t=(0,S.c)(13),{title:n,footer:r,children:i,className:a}=e,o;t[0]===a?o=t[1]:(o=u(`min-w-0`,a),t[0]=a,t[1]=o);let s;t[2]===n?s=t[3]:(s=n?(0,E.jsx)(`h2`,{className:`mb-2 px-1 text-xs font-medium text-fg-muted`,children:n}):null,t[2]=n,t[3]=s);let c;t[4]===i?c=t[5]:(c=(0,E.jsx)(`div`,{className:`flex flex-col gap-1 overflow-hidden rounded-xl bg-surface-hover/20 p-1 [&>*]:rounded-lg [&>*]:bg-surface-base/45`,children:i}),t[4]=i,t[5]=c);let l;t[6]===r?l=t[7]:(l=r?(0,E.jsx)(`p`,{className:`mt-2 px-1 text-xs leading-5 text-fg-subtle`,children:r}):null,t[6]=r,t[7]=l);let d;return t[8]!==o||t[9]!==s||t[10]!==c||t[11]!==l?(d=(0,E.jsxs)(`section`,{className:o,children:[s,c,l]}),t[8]=o,t[9]=s,t[10]=c,t[11]=l,t[12]=d):d=t[12],d}var O={default:{light:{canvas:`#f7f8fa`,panel:`#ffffff`,accent:`#3a6bff`,fg:`#111111`,muted:`#ececec`},dark:{canvas:`#14171c`,panel:`#1b1f26`,accent:`#3a6bff`,fg:`#f4f6f8`,muted:`#323844`}},emerald:{light:{canvas:`#f0fdf4`,panel:`#ffffff`,accent:`#059669`,fg:`#052e16`,muted:`#86efac`},dark:{canvas:`#000000`,panel:`#0a0a0a`,accent:`#10b981`,fg:`#d1fae5`,muted:`#134e2a`}},clay:{light:{canvas:`#fffaf0`,panel:`#ffffff`,accent:`#0a0a0a`,fg:`#0a0a0a`,muted:`#e5e5e5`},dark:{canvas:`#0a1a1a`,panel:`#1a2a2a`,accent:`#ffb084`,fg:`#fffaf0`,muted:`#2a3a3a`}},porcelain:{light:{canvas:`#f6f0e7`,panel:`#fffcf7`,accent:`#985d4d`,fg:`#352e2a`,muted:`#e4dcd3`},dark:{canvas:`#211c19`,panel:`#2b2420`,accent:`#d4a08c`,fg:`#f3eae1`,muted:`#4a3e35`}},dawn:{light:{canvas:`linear-gradient(180deg, #accdec 0%, #e7ebf4 61.54%, #ffddb9 100%)`,panel:`rgb(255 255 255 / 0.6)`,accent:`#34363a`,fg:`rgb(0 0 0 / 0.85)`,muted:`rgb(111 137 163 / 0.2)`},dark:{canvas:`linear-gradient(180deg, #21394f 0%, #283545 61.54%, #564536 100%)`,panel:`rgb(31 45 59 / 0.68)`,accent:`#d9dde2`,fg:`rgb(255 255 255 / 0.92)`,muted:`rgb(255 255 255 / 0.14)`}}};function k(e){let t=(0,S.c)(23),{canvas:n,panel:r,accent:i,fg:a,muted:o}=e,s;t[0]===n?s=t[1]:(s={background:n},t[0]=n,t[1]=s);let c;t[2]===r?c=t[3]:(c={backgroundColor:r},t[2]=r,t[3]=c);let l;t[4]===i?l=t[5]:(l=(0,E.jsx)(`div`,{className:`size-1 shrink-0 rounded-full`,style:{backgroundColor:i}}),t[4]=i,t[5]=l);let u;t[6]===a?u=t[7]:(u=(0,E.jsx)(`div`,{className:`h-1 min-w-0 flex-1 rounded-full`,style:{backgroundColor:a,opacity:.85}}),t[6]=a,t[7]=u);let d;t[8]!==l||t[9]!==u?(d=(0,E.jsxs)(`div`,{className:`flex items-center gap-1`,children:[l,u]}),t[8]=l,t[9]=u,t[10]=d):d=t[10];let f;t[11]===o?f=t[12]:(f=(0,E.jsx)(`div`,{className:`h-1 w-2/3 max-w-[70%] rounded-full`,style:{backgroundColor:o}}),t[11]=o,t[12]=f);let p;t[13]===o?p=t[14]:(p=(0,E.jsx)(`div`,{className:`size-1/2 max-w-[55%] rounded-full`,style:{backgroundColor:o}}),t[13]=o,t[14]=p);let m;t[15]!==c||t[16]!==d||t[17]!==f||t[18]!==p?(m=(0,E.jsxs)(`div`,{className:`flex flex-col gap-0.5 rounded-sm p-1`,style:c,children:[d,f,p]}),t[15]=c,t[16]=d,t[17]=f,t[18]=p,t[19]=m):m=t[19];let h;return t[20]!==s||t[21]!==m?(h=(0,E.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col justify-center gap-1 p-1.5`,style:s,children:m}),t[20]=s,t[21]=m,t[22]=h):h=t[22],h}function A(e){let t=(0,S.c)(8),{scheme:n}=e,{light:r,dark:i}=O[n],a;t[0]===r?a=t[1]:(a=(0,E.jsx)(k,{...r}),t[0]=r,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,E.jsx)(`div`,{className:`w-px shrink-0 bg-black/12 dark:bg-white/12`,"aria-hidden":!0}),t[2]=o):o=t[2];let s;t[3]===i?s=t[4]:(s=(0,E.jsx)(k,{...i}),t[3]=i,t[4]=s);let c;return t[5]!==a||t[6]!==s?(c=(0,E.jsxs)(`div`,{className:`flex h-11 w-full overflow-hidden rounded-md`,children:[a,o,s]}),t[5]=a,t[6]=s,t[7]=c):c=t[7],c}var j=[{value:`default`,labelKey:`colorSchemeDefault`},{value:`porcelain`,labelKey:`colorSchemePorcelain`},{value:`dawn`,labelKey:`colorSchemeDawn`},{value:`emerald`,labelKey:`colorSchemeLightGreen`},{value:`clay`,labelKey:`colorSchemeClay`}];function M(){let e=(0,S.c)(13),t=a(F),n;e[0]===t?n=e[1]:(n=s(t),e[0]=t,e[1]=n);let r=n.appearanceSettings,i=g(P),o=g(N),c;e[2]===r.colorSchemeTitle?c=e[3]:(c=(0,E.jsx)(`div`,{className:`min-w-0`,children:(0,E.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:r.colorSchemeTitle})}),e[2]=r.colorSchemeTitle,e[3]=c);let l;e[4]!==r||e[5]!==i||e[6]!==o?(l=j.map(e=>{let{value:t,labelKey:n}=e,a=i===t;return(0,E.jsxs)(`button`,{type:`button`,"aria-pressed":a,onClick:()=>o(t),className:u(`flex flex-col gap-2 rounded-xl bg-surface-hover/25 p-2.5 text-left transition-[background-color,box-shadow,transform] duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,m.pressCard,a?`bg-surface-active shadow-surface`:`hover:bg-surface-hover/60`),children:[(0,E.jsx)(A,{scheme:t}),(0,E.jsx)(`span`,{className:u(`text-xs font-medium leading-none`,a?`text-accent-fg`:`text-fg-muted`),children:r[n]})]},t)}),e[4]=r,e[5]=i,e[6]=o,e[7]=l):l=e[7];let d;e[8]===l?d=e[9]:(d=(0,E.jsx)(`div`,{className:`grid grid-cols-2 gap-3 sm:grid-cols-3 xl:grid-cols-5`,children:l}),e[8]=l,e[9]=d);let f;return e[10]!==c||e[11]!==d?(f=(0,E.jsxs)(`div`,{className:`flex flex-col gap-3 px-4 py-3.5 sm:px-5 sm:py-4`,children:[c,d]}),e[10]=c,e[11]=d,e[12]=f):f=e[12],f}function N(e){return e.setColorScheme}function P(e){return e.colorScheme}function F(e){return e.language}function I(){let e=(0,S.c)(28),t=a(L),n;e[0]===t?n=e[1]:(n=s(t),e[0]=t,e[1]=n);let r=n.appearanceSettings,{data:i,isLoading:o}=p(!0),f=i?.payload?.config,m;e[2]===f?m=e[3]:(m=w(f),e[2]=f,e[3]=m);let h=m,[g,_]=(0,x.useState)(h),[v,y]=(0,x.useState)(!1),[b,C]=(0,x.useState)(!1),D,O;e[4]===h?(D=e[5],O=e[6]):(D=()=>_(h),O=[h],e[4]=h,e[5]=D,e[6]=O),(0,x.useEffect)(D,O);let k;e[7]===g?k=e[8]:(k=e=>{let t=g;_(e),y(!0),C(!1),T(e).catch(()=>{_(t),C(!0)}).finally(()=>y(!1))},e[7]=g,e[8]=k);let A=k,j;e[9]===r.activityDetailDefaultTitle?j=e[10]:(j=(0,E.jsx)(`div`,{className:`min-w-0 text-sm font-medium text-fg`,children:r.activityDetailDefaultTitle}),e[9]=r.activityDetailDefaultTitle,e[10]=j);let M;e[11]!==r.activityDetailLevels||e[12]!==A||e[13]!==o||e[14]!==g||e[15]!==v?(M=o?(0,E.jsx)(d,{className:`h-10 w-full rounded-lg sm:max-w-[11rem]`}):(0,E.jsxs)(c,{value:g,disabled:v,onChange:e=>A(e.target.value),triggerClassName:`w-full sm:max-w-[11rem]`,children:[(0,E.jsx)(l,{value:`off`,children:r.activityDetailLevels.off}),(0,E.jsx)(l,{value:`on`,children:r.activityDetailLevels.on}),(0,E.jsx)(l,{value:`stream`,children:r.activityDetailLevels.stream})]}),e[11]=r.activityDetailLevels,e[12]=A,e[13]=o,e[14]=g,e[15]=v,e[16]=M):M=e[16];let N;e[17]!==j||e[18]!==M?(N=(0,E.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between sm:gap-6`,children:[j,M]}),e[17]=j,e[18]=M,e[19]=N):N=e[19];let P;e[20]!==r.activityDetailSaveError||e[21]!==r.activityDetailSaving||e[22]!==b||e[23]!==v?(P=b||v?(0,E.jsx)(`p`,{className:u(`text-xs`,b?`text-red-600 dark:text-red-400`:`text-fg-subtle`),children:b?r.activityDetailSaveError:r.activityDetailSaving}):null,e[20]=r.activityDetailSaveError,e[21]=r.activityDetailSaving,e[22]=b,e[23]=v,e[24]=P):P=e[24];let F;return e[25]!==N||e[26]!==P?(F=(0,E.jsxs)(`div`,{className:`flex flex-col gap-2 px-4 py-3.5 sm:px-5 sm:py-4`,children:[N,P]}),e[25]=N,e[26]=P,e[27]=F):F=e[27],F}function L(e){return e.language}function R(){let e=(0,S.c)(17),t=a(V),n;e[0]===t?n=e[1]:(n=s(t),e[0]=t,e[1]=n);let r=n.appearanceSettings,i=_(B),o=_(z),c;e[2]===r.showRawToolDataTitle?c=e[3]:(c=(0,E.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:r.showRawToolDataTitle}),e[2]=r.showRawToolDataTitle,e[3]=c);let l;e[4]===r.showRawToolDataDescription?l=e[5]:(l=(0,E.jsx)(`p`,{className:`text-xs text-fg-muted`,children:r.showRawToolDataDescription}),e[4]=r.showRawToolDataDescription,e[5]=l);let u;e[6]!==c||e[7]!==l?(u=(0,E.jsxs)(`div`,{className:`min-w-0`,children:[c,l]}),e[6]=c,e[7]=l,e[8]=u):u=e[8];let d;e[9]===o?d=e[10]:(d=e=>o(e.target.checked),e[9]=o,e[10]=d);let f;e[11]!==i||e[12]!==d?(f=(0,E.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:i,onChange:d}),e[11]=i,e[12]=d,e[13]=f):f=e[13];let p;return e[14]!==u||e[15]!==f?(p=(0,E.jsx)(`div`,{className:`px-4 py-3.5 sm:px-5 sm:py-4`,children:(0,E.jsxs)(`label`,{className:`flex items-center justify-between gap-3`,children:[u,f]})}),e[14]=u,e[15]=f,e[16]=p):p=e[16],p}function z(e){return e.setShowRawToolData}function B(e){return e.showRawToolData}function V(e){return e.language}function H(){let e=(0,S.c)(12),t=a(U),n;e[0]===t?n=e[1]:(n=s(t),e[0]=t,e[1]=n);let r=n.appearanceSettings,i;e[2]===r.pageTitle?i=e[3]:(i=(0,E.jsx)(y,{title:r.pageTitle}),e[2]=r.pageTitle,e[3]=i);let o;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,E.jsx)(D,{children:(0,E.jsx)(h,{variant:`page`,sections:[`language`]})}),e[4]=o):o=e[4];let c;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,E.jsxs)(D,{children:[(0,E.jsx)(h,{variant:`page`,sections:[`theme`,`font`]}),(0,E.jsx)(M,{}),(0,E.jsx)(I,{})]}),e[5]=c):c=e[5];let l;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,E.jsx)(R,{}),e[6]=l):l=e[6];let u;e[7]===r.developerGroupTitle?u=e[8]:(u=(0,E.jsx)(b,{children:(0,E.jsx)(D,{title:r.developerGroupTitle,children:l})}),e[7]=r.developerGroupTitle,e[8]=u);let d;return e[9]!==i||e[10]!==u?(d=(0,E.jsxs)(v,{gap:`gap-6`,children:[i,o,c,u]}),e[9]=i,e[10]=u,e[11]=d):d=e[11],d}function U(e){return e.language}export{H as AppearanceSettingsPanel};
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{i,n as a,o}from"./locale-store-Bld7_m-Q.js";import{t as s}from"./messages-CGO1P4mz.js";import{n as c,r as l}from"./popover-select-CLsphyzA.js";import{t as u}from"./cn-0WouolD0.js";import{t as d}from"./skeleton-DzdOeGYz.js";import{n as f,r as p}from"./gateway-config-swr-B5THNdYK.js";import{n as m}from"./interaction-BdhHBbYa.js";import{t as h}from"./preference-select-fields-QlyIA8ve.js";import{i as g}from"./theme-store-DsvYj7Vy.js";import{t as _}from"./dev-view-store-bryv5YRw.js";import{n as v,t as y}from"./settings-page-header-BYFaTD8a.js";import"./settings-page-layout-CnUQSxT3.js";import{t as b}from"./settings-advanced-gate-DyGT3o1e.js";var x=e(t(),1),S=n();function C(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function w(e){let t=C(e)?e:{},n=C(t.gateway)?t.gateway:{},r=(C(n.webchat)?n.webchat:{}).activityDetailDefault;return r===`off`||r===`stream`||r===`on`?r:`on`}async function T(e){await o(i(`/api/config`),{method:`PATCH`,body:JSON.stringify({gateway:{webchat:{activityDetailDefault:e}}})}),await f()}var E=r();function D(e){let t=(0,S.c)(13),{title:n,footer:r,children:i,className:a}=e,o;t[0]===a?o=t[1]:(o=u(`min-w-0`,a),t[0]=a,t[1]=o);let s;t[2]===n?s=t[3]:(s=n?(0,E.jsx)(`h2`,{className:`mb-2 px-1 text-xs font-medium text-fg-muted`,children:n}):null,t[2]=n,t[3]=s);let c;t[4]===i?c=t[5]:(c=(0,E.jsx)(`div`,{className:`flex flex-col gap-1 overflow-hidden rounded-xl bg-surface-hover/20 p-1 [&>*]:rounded-lg [&>*]:bg-surface-base/45`,children:i}),t[4]=i,t[5]=c);let l;t[6]===r?l=t[7]:(l=r?(0,E.jsx)(`p`,{className:`mt-2 px-1 text-xs leading-5 text-fg-subtle`,children:r}):null,t[6]=r,t[7]=l);let d;return t[8]!==o||t[9]!==s||t[10]!==c||t[11]!==l?(d=(0,E.jsxs)(`section`,{className:o,children:[s,c,l]}),t[8]=o,t[9]=s,t[10]=c,t[11]=l,t[12]=d):d=t[12],d}var O={default:{light:{canvas:`#f7f8fa`,panel:`#ffffff`,accent:`#3a6bff`,fg:`#111111`,muted:`#ececec`},dark:{canvas:`#14171c`,panel:`#1b1f26`,accent:`#3a6bff`,fg:`#f4f6f8`,muted:`#323844`}},emerald:{light:{canvas:`#f0fdf4`,panel:`#ffffff`,accent:`#059669`,fg:`#052e16`,muted:`#86efac`},dark:{canvas:`#000000`,panel:`#0a0a0a`,accent:`#10b981`,fg:`#d1fae5`,muted:`#134e2a`}},clay:{light:{canvas:`#fffaf0`,panel:`#ffffff`,accent:`#0a0a0a`,fg:`#0a0a0a`,muted:`#e5e5e5`},dark:{canvas:`#0a1a1a`,panel:`#1a2a2a`,accent:`#ffb084`,fg:`#fffaf0`,muted:`#2a3a3a`}},porcelain:{light:{canvas:`#f6f0e7`,panel:`#fffcf7`,accent:`#985d4d`,fg:`#352e2a`,muted:`#e4dcd3`},dark:{canvas:`#211c19`,panel:`#2b2420`,accent:`#d4a08c`,fg:`#f3eae1`,muted:`#4a3e35`}},dawn:{light:{canvas:`linear-gradient(180deg, #accdec 0%, #e7ebf4 61.54%, #ffddb9 100%)`,panel:`rgb(255 255 255 / 0.6)`,accent:`#34363a`,fg:`rgb(0 0 0 / 0.85)`,muted:`rgb(111 137 163 / 0.2)`},dark:{canvas:`linear-gradient(180deg, #21394f 0%, #283545 61.54%, #564536 100%)`,panel:`rgb(31 45 59 / 0.68)`,accent:`#d9dde2`,fg:`rgb(255 255 255 / 0.92)`,muted:`rgb(255 255 255 / 0.14)`}}};function k(e){let t=(0,S.c)(23),{canvas:n,panel:r,accent:i,fg:a,muted:o}=e,s;t[0]===n?s=t[1]:(s={background:n},t[0]=n,t[1]=s);let c;t[2]===r?c=t[3]:(c={backgroundColor:r},t[2]=r,t[3]=c);let l;t[4]===i?l=t[5]:(l=(0,E.jsx)(`div`,{className:`size-1 shrink-0 rounded-full`,style:{backgroundColor:i}}),t[4]=i,t[5]=l);let u;t[6]===a?u=t[7]:(u=(0,E.jsx)(`div`,{className:`h-1 min-w-0 flex-1 rounded-full`,style:{backgroundColor:a,opacity:.85}}),t[6]=a,t[7]=u);let d;t[8]!==l||t[9]!==u?(d=(0,E.jsxs)(`div`,{className:`flex items-center gap-1`,children:[l,u]}),t[8]=l,t[9]=u,t[10]=d):d=t[10];let f;t[11]===o?f=t[12]:(f=(0,E.jsx)(`div`,{className:`h-1 w-2/3 max-w-[70%] rounded-full`,style:{backgroundColor:o}}),t[11]=o,t[12]=f);let p;t[13]===o?p=t[14]:(p=(0,E.jsx)(`div`,{className:`size-1/2 max-w-[55%] rounded-full`,style:{backgroundColor:o}}),t[13]=o,t[14]=p);let m;t[15]!==c||t[16]!==d||t[17]!==f||t[18]!==p?(m=(0,E.jsxs)(`div`,{className:`flex flex-col gap-0.5 rounded-sm p-1`,style:c,children:[d,f,p]}),t[15]=c,t[16]=d,t[17]=f,t[18]=p,t[19]=m):m=t[19];let h;return t[20]!==s||t[21]!==m?(h=(0,E.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col justify-center gap-1 p-1.5`,style:s,children:m}),t[20]=s,t[21]=m,t[22]=h):h=t[22],h}function A(e){let t=(0,S.c)(8),{scheme:n}=e,{light:r,dark:i}=O[n],a;t[0]===r?a=t[1]:(a=(0,E.jsx)(k,{...r}),t[0]=r,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,E.jsx)(`div`,{className:`w-px shrink-0 bg-black/12 dark:bg-white/12`,"aria-hidden":!0}),t[2]=o):o=t[2];let s;t[3]===i?s=t[4]:(s=(0,E.jsx)(k,{...i}),t[3]=i,t[4]=s);let c;return t[5]!==a||t[6]!==s?(c=(0,E.jsxs)(`div`,{className:`flex h-11 w-full overflow-hidden rounded-md`,children:[a,o,s]}),t[5]=a,t[6]=s,t[7]=c):c=t[7],c}var j=[{value:`default`,labelKey:`colorSchemeDefault`},{value:`porcelain`,labelKey:`colorSchemePorcelain`},{value:`dawn`,labelKey:`colorSchemeDawn`},{value:`emerald`,labelKey:`colorSchemeLightGreen`},{value:`clay`,labelKey:`colorSchemeClay`}];function M(){let e=(0,S.c)(13),t=a(F),n;e[0]===t?n=e[1]:(n=s(t),e[0]=t,e[1]=n);let r=n.appearanceSettings,i=g(P),o=g(N),c;e[2]===r.colorSchemeTitle?c=e[3]:(c=(0,E.jsx)(`div`,{className:`min-w-0`,children:(0,E.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:r.colorSchemeTitle})}),e[2]=r.colorSchemeTitle,e[3]=c);let l;e[4]!==r||e[5]!==i||e[6]!==o?(l=j.map(e=>{let{value:t,labelKey:n}=e,a=i===t;return(0,E.jsxs)(`button`,{type:`button`,"aria-pressed":a,onClick:()=>o(t),className:u(`flex flex-col gap-2 rounded-xl bg-surface-hover/25 p-2.5 text-left transition-[background-color,box-shadow,transform] duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,m.pressCard,a?`bg-surface-active shadow-surface`:`hover:bg-surface-hover/60`),children:[(0,E.jsx)(A,{scheme:t}),(0,E.jsx)(`span`,{className:u(`text-xs font-medium leading-none`,a?`text-accent-fg`:`text-fg-muted`),children:r[n]})]},t)}),e[4]=r,e[5]=i,e[6]=o,e[7]=l):l=e[7];let d;e[8]===l?d=e[9]:(d=(0,E.jsx)(`div`,{className:`grid grid-cols-2 gap-3 sm:grid-cols-3 xl:grid-cols-5`,children:l}),e[8]=l,e[9]=d);let f;return e[10]!==c||e[11]!==d?(f=(0,E.jsxs)(`div`,{className:`flex flex-col gap-3 px-4 py-3.5 sm:px-5 sm:py-4`,children:[c,d]}),e[10]=c,e[11]=d,e[12]=f):f=e[12],f}function N(e){return e.setColorScheme}function P(e){return e.colorScheme}function F(e){return e.language}function I(){let e=(0,S.c)(28),t=a(L),n;e[0]===t?n=e[1]:(n=s(t),e[0]=t,e[1]=n);let r=n.appearanceSettings,{data:i,isLoading:o}=p(!0),f=i?.payload?.config,m;e[2]===f?m=e[3]:(m=w(f),e[2]=f,e[3]=m);let h=m,[g,_]=(0,x.useState)(h),[v,y]=(0,x.useState)(!1),[b,C]=(0,x.useState)(!1),D,O;e[4]===h?(D=e[5],O=e[6]):(D=()=>_(h),O=[h],e[4]=h,e[5]=D,e[6]=O),(0,x.useEffect)(D,O);let k;e[7]===g?k=e[8]:(k=e=>{let t=g;_(e),y(!0),C(!1),T(e).catch(()=>{_(t),C(!0)}).finally(()=>y(!1))},e[7]=g,e[8]=k);let A=k,j;e[9]===r.activityDetailDefaultTitle?j=e[10]:(j=(0,E.jsx)(`div`,{className:`min-w-0 text-sm font-medium text-fg`,children:r.activityDetailDefaultTitle}),e[9]=r.activityDetailDefaultTitle,e[10]=j);let M;e[11]!==r.activityDetailLevels||e[12]!==A||e[13]!==o||e[14]!==g||e[15]!==v?(M=o?(0,E.jsx)(d,{className:`h-10 w-full rounded-lg sm:max-w-[11rem]`}):(0,E.jsxs)(c,{value:g,disabled:v,onChange:e=>A(e.target.value),triggerClassName:`w-full sm:max-w-[11rem]`,children:[(0,E.jsx)(l,{value:`off`,children:r.activityDetailLevels.off}),(0,E.jsx)(l,{value:`on`,children:r.activityDetailLevels.on}),(0,E.jsx)(l,{value:`stream`,children:r.activityDetailLevels.stream})]}),e[11]=r.activityDetailLevels,e[12]=A,e[13]=o,e[14]=g,e[15]=v,e[16]=M):M=e[16];let N;e[17]!==j||e[18]!==M?(N=(0,E.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between sm:gap-6`,children:[j,M]}),e[17]=j,e[18]=M,e[19]=N):N=e[19];let P;e[20]!==r.activityDetailSaveError||e[21]!==r.activityDetailSaving||e[22]!==b||e[23]!==v?(P=b||v?(0,E.jsx)(`p`,{className:u(`text-xs`,b?`text-red-600 dark:text-red-400`:`text-fg-subtle`),children:b?r.activityDetailSaveError:r.activityDetailSaving}):null,e[20]=r.activityDetailSaveError,e[21]=r.activityDetailSaving,e[22]=b,e[23]=v,e[24]=P):P=e[24];let F;return e[25]!==N||e[26]!==P?(F=(0,E.jsxs)(`div`,{className:`flex flex-col gap-2 px-4 py-3.5 sm:px-5 sm:py-4`,children:[N,P]}),e[25]=N,e[26]=P,e[27]=F):F=e[27],F}function L(e){return e.language}function R(){let e=(0,S.c)(17),t=a(V),n;e[0]===t?n=e[1]:(n=s(t),e[0]=t,e[1]=n);let r=n.appearanceSettings,i=_(B),o=_(z),c;e[2]===r.showRawToolDataTitle?c=e[3]:(c=(0,E.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:r.showRawToolDataTitle}),e[2]=r.showRawToolDataTitle,e[3]=c);let l;e[4]===r.showRawToolDataDescription?l=e[5]:(l=(0,E.jsx)(`p`,{className:`text-xs text-fg-muted`,children:r.showRawToolDataDescription}),e[4]=r.showRawToolDataDescription,e[5]=l);let u;e[6]!==c||e[7]!==l?(u=(0,E.jsxs)(`div`,{className:`min-w-0`,children:[c,l]}),e[6]=c,e[7]=l,e[8]=u):u=e[8];let d;e[9]===o?d=e[10]:(d=e=>o(e.target.checked),e[9]=o,e[10]=d);let f;e[11]!==i||e[12]!==d?(f=(0,E.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:i,onChange:d}),e[11]=i,e[12]=d,e[13]=f):f=e[13];let p;return e[14]!==u||e[15]!==f?(p=(0,E.jsx)(`div`,{className:`px-4 py-3.5 sm:px-5 sm:py-4`,children:(0,E.jsxs)(`label`,{className:`flex items-center justify-between gap-3`,children:[u,f]})}),e[14]=u,e[15]=f,e[16]=p):p=e[16],p}function z(e){return e.setShowRawToolData}function B(e){return e.showRawToolData}function V(e){return e.language}function H(){let e=(0,S.c)(12),t=a(U),n;e[0]===t?n=e[1]:(n=s(t),e[0]=t,e[1]=n);let r=n.appearanceSettings,i;e[2]===r.pageTitle?i=e[3]:(i=(0,E.jsx)(y,{title:r.pageTitle}),e[2]=r.pageTitle,e[3]=i);let o;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,E.jsx)(D,{children:(0,E.jsx)(h,{variant:`page`,sections:[`language`]})}),e[4]=o):o=e[4];let c;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,E.jsxs)(D,{children:[(0,E.jsx)(h,{variant:`page`,sections:[`theme`,`font`]}),(0,E.jsx)(M,{}),(0,E.jsx)(I,{})]}),e[5]=c):c=e[5];let l;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,E.jsx)(R,{}),e[6]=l):l=e[6];let u;e[7]===r.developerGroupTitle?u=e[8]:(u=(0,E.jsx)(b,{children:(0,E.jsx)(D,{title:r.developerGroupTitle,children:l})}),e[7]=r.developerGroupTitle,e[8]=u);let d;return e[9]!==i||e[10]!==u?(d=(0,E.jsxs)(v,{gap:`gap-6`,children:[i,o,c,u]}),e[9]=i,e[10]=u,e[11]=d):d=e[11],d}function U(e){return e.language}export{H as AppearanceSettingsPanel};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{l as i,m as a,t as o,u as s}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{l as c,n as l}from"./locale-store-DGtk-KSF.js";import{t as u}from"./messages-DYDySzn1.js";import{a as d,i as f,o as p,r as m,s as h,t as g}from"./dist-BGTk37IG.js";import{t as _}from"./arrow-left-D880xG-P.js";import{t as v}from"./box-DvYoGszj.js";import{n as y,t as b}from"./extension-paths-DvuaZJuy.js";import{t as x}from"./ellipsis-0k4rZLoy.js";import{t as S}from"./external-link-DjqjBmc3.js";import{t as C}from"./loader-circle-CifKLtgG.js";import{t as w}from"./markdown-view-JXJ3e1CB.js";import{t as T}from"./package-wATCyihJ.js";import{t as E}from"./plus-Q2yW6OE7.js";import{t as D}from"./settings-uiTATseT.js";import{t as O}from"./shield-check-BU58siTV.js";import{t as k}from"./trash-2-DusmjVPV.js";import{t as A}from"./triangle-alert-2JXFNNKU.js";import{t as j}from"./x-B_N4OPjy.js";import{t as M}from"./cn-0WouolD0.js";import{t as N}from"./skeleton-BI5TyibZ.js";import{i as P,o as F,r as I,s as L}from"./extension-provider-CJQkyfle.js";import{a as R,i as z}from"./vendor-swr-CdRzEUwF.js";import{o as B}from"./gateway-realtime-Bg4Mf7HA.js";import{t as V}from"./button-Cc4hUNTt.js";import{n as H}from"./interaction-BdhHBbYa.js";import{t as ee}from"./page-tabs-oeTY7z3_.js";import{t as U}from"./page-header-store-f8XcAs9b.js";import{r as W}from"./settings-form-draft-Dy10ldo8.js";import{l as G,m as te,o as K,r as q,t as ne}from"./dist-ZrL34Ps4.js";import{r as re,t as ie}from"./agent-plugin-dialog-DofyWKnP.js";import{n as J,t as Y}from"./capability-links-DeO34GIF.js";import{t as X}from"./capability-icon-DVoZxEgW.js";import{a as Z,i as ae,n as oe,r as se,t as ce}from"./extension-marketplace-api-Q6E4x8gu.js";import{n as le,t as ue}from"./capability-header-actions-BxMYfQ8y.js";import{n as de,r as fe,t as pe}from"./plugin-presentation-CO5BFDGW.js";var me=n(),he=`grid auto-rows-fr grid-cols-[repeat(auto-fill,minmax(min(100%,18rem),1fr))] items-stretch gap-4`,ge=`relative h-full min-w-0 rounded-xl border border-edge bg-surface-panel p-4 transition-colors hover:border-edge-strong hover:bg-surface-hover/30`,_e=`absolute inset-0 cursor-pointer rounded-xl focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent`,Q=e(t(),1);function ve(e){return e===`builtin`||e===`user`?e:`marketplace`}var $=r();function ye(e,t){let n=e.find(e=>e.id===t||e.pluginId===t||e.provenance?.packageName===t);return n?n.source===`bundled`?`bundled`:`user`:`absent`}var be={debounced:``,detailPkg:null,quickInstallPkg:null,rowBusy:null,actionError:null,restartHint:null};function xe({className:e,query:t}){let n=s(),r=i(),a=l(e=>e.language),o=u(a).extensionsPage,d=c(e=>!!e.conversationId),f=I(),{mutate:p}=R(),[m,h]=(0,Q.useReducer)(W,be),{debounced:g,detailPkg:_,quickInstallPkg:v,rowBusy:b,actionError:x,restartHint:S}=m,w=d?`marketplace-${g}`:null;(0,Q.useEffect)(()=>{let e=window.setTimeout(()=>h({type:`patch`,patch:{debounced:t.trim()}}),300);return()=>window.clearTimeout(e)},[t]);let{data:E,isLoading:D,error:O}=z(w,()=>ce(g),{revalidateOnFocus:!1}),A=(0,Q.useCallback)(()=>{p(`gateway-extensions-list`),B()},[p]),j=(0,Q.useCallback)(async(e,t)=>{h({type:`patch`,patch:{actionError:null,restartHint:null,rowBusy:e}});try{let n=await se({name:e,overwrite:t});A(),n.requiresGatewayRestart&&h({type:`patch`,patch:{restartHint:o.marketplaceRestartHint}})}catch(e){throw h({type:`patch`,patch:{actionError:e instanceof Error?e.message:o.marketplaceInstallFailed}}),e}finally{h({type:`patch`,patch:{rowBusy:null}})}},[o.marketplaceInstallFailed,o.marketplaceRestartHint,A]),P=(0,Q.useCallback)(async e=>{h({type:`patch`,patch:{actionError:null,restartHint:null,rowBusy:e}});try{let t=await Z(e);A(),t.requiresGatewayRestart&&h({type:`patch`,patch:{restartHint:o.marketplaceRestartHint}})}catch(e){throw h({type:`patch`,patch:{actionError:e instanceof Error?e.message:o.marketplaceUninstallFailed}}),e}finally{h({type:`patch`,patch:{rowBusy:null}})}},[o.marketplaceRestartHint,o.marketplaceUninstallFailed,A]),F=E??[];return(0,$.jsxs)(`div`,{className:M(`flex flex-col gap-4`,e),children:[O?(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:O instanceof Error?O.message:o.marketplaceLoadFailed}):null,x?(0,$.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:x}):null,S?(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:S}):null,D&&!E?(0,$.jsx)(`ul`,{className:he,"aria-label":o.marketplaceLoading,children:[0,1,2,3,4,5].map(e=>(0,$.jsxs)(`li`,{className:`rounded-xl border border-edge bg-surface-panel p-4`,children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,$.jsx)(N,{className:`size-10 shrink-0 rounded-xl`}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2`,children:[(0,$.jsx)(N,{className:`h-5 w-full`}),(0,$.jsx)(N,{className:`h-3 w-2/3`})]}),(0,$.jsx)(N,{className:`h-9 w-16 shrink-0 rounded-lg`})]}),(0,$.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,$.jsx)(N,{className:`h-4 w-full`}),(0,$.jsx)(N,{className:`h-4 w-full`}),(0,$.jsx)(N,{className:`h-4 w-2/3`})]})]},e))}):(0,$.jsx)(`ul`,{className:he,children:F.length===0?(0,$.jsx)(`li`,{className:`col-span-full text-sm text-fg-muted`,children:o.marketplaceEmpty}):F.map(e=>{let t=ye(f,e.id),i=b===e.id,s=f.find(t=>t.pluginId===e.id||t.provenance?.packageName===e.id),c=e.localizations?.[a.startsWith(`zh`)?`zh-CN`:`en`],l=c?.displayName??e.name,u=c?.description??e.description;return(0,$.jsxs)(`li`,{className:ge,children:[(0,$.jsx)(`button`,{type:`button`,"aria-label":`${l}, ${o.marketplaceDetailTitle}`,onClick:()=>s?.pluginId?n(Y(s.pluginId,`installed`,!1,r.pathname+r.search)):h({type:`patch`,patch:{detailPkg:e.id}}),className:_e}),(0,$.jsxs)(`div`,{className:`pointer-events-none relative flex items-start gap-3`,children:[(0,$.jsx)(X,{iconUrl:e.branding?.iconUrl,fallback:T}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 items-start gap-1.5`,children:[(0,$.jsx)(`h3`,{className:`line-clamp-2 break-words font-semibold leading-snug text-fg`,title:l,children:l}),e.verified?(0,$.jsx)(y,{className:`mt-0.5 size-3.5 shrink-0 text-emerald-600 dark:text-emerald-400`,strokeWidth:1.75,"aria-label":`Verified`}):null]}),(0,$.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-fg-subtle`,children:[e.version?(0,$.jsxs)(`span`,{children:[`v`,e.version]}):null,t===`user`?(0,$.jsx)(`span`,{className:s&&fe(s)?`text-amber-700 dark:text-amber-400`:`text-fg-muted`,children:s&&fe(s)?a.startsWith(`zh`)?`需要授权`:`Authorization required`:o.marketplaceInstalled}):null]})]}),(0,$.jsx)(`div`,{role:`group`,className:`pointer-events-auto relative z-10 flex max-w-[45%] shrink-0 items-start`,children:t===`bundled`?(0,$.jsx)(`span`,{className:`rounded-md bg-surface-hover px-2 py-1 text-[11px] font-medium text-fg-muted`,children:o.marketplaceBuiltin}):t===`user`?(0,$.jsx)($.Fragment,{children:e.packageType===`plugin`?(0,$.jsx)(`button`,{type:`button`,onClick:()=>s?.pluginId&&pe(s)?n(J(l,a.startsWith(`zh`),s.pluginId)):s?.pluginId?n(Y(s.pluginId,`installed`,fe(s),r.pathname+r.search)):h({type:`patch`,patch:{detailPkg:e.id,quickInstallPkg:null}}),className:M(`inline-flex items-center justify-center rounded-lg border border-edge px-3 py-2 text-xs font-medium text-fg`,`transition-colors active:scale-[0.98] active:bg-surface-hover/80`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`),children:s&&fe(s)?a.startsWith(`zh`)?`去授权`:`Connect account`:s&&pe(s)?a.startsWith(`zh`)?`开始使用`:`Start using`:a.startsWith(`zh`)?`管理插件`:`Manage plugin`}):(0,$.jsxs)(`button`,{type:`button`,disabled:i,onClick:()=>{window.confirm(o.marketplaceUninstallConfirm)&&P(e.id).catch(()=>{})},className:M(`inline-flex items-center justify-center gap-1.5 rounded-lg border border-edge px-3 py-2 text-xs font-medium text-fg`,`transition-colors active:scale-[0.98] active:bg-surface-hover/80`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,`disabled:pointer-events-none disabled:opacity-50`),children:[i?(0,$.jsx)(C,{className:`size-3.5 animate-spin`,"aria-hidden":!0}):(0,$.jsx)(k,{className:`size-3.5`,strokeWidth:2,"aria-hidden":!0}),o.marketplaceUninstall]})}):(0,$.jsx)(`button`,{type:`button`,onClick:()=>h({type:`patch`,patch:(e.packageType,{detailPkg:e.id,quickInstallPkg:null})}),className:M(`inline-flex min-w-16 items-center justify-center rounded-lg border border-edge px-3 py-2 text-xs font-medium text-fg`,`transition-[transform,background-color] active:scale-[0.98]`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`),children:e.packageType===`plugin`?a.startsWith(`zh`)?`安装`:`Install`:o.marketplaceReview})})]}),u?(0,$.jsx)(`p`,{className:`pointer-events-none relative mt-3 line-clamp-3 text-sm leading-relaxed text-fg-muted`,children:u}):null,(e.categories?.length??0)>0?(0,$.jsx)(`div`,{className:`pointer-events-none relative mt-3 flex flex-wrap gap-1.5`,children:e.categories?.map(e=>(0,$.jsx)(`span`,{className:`max-w-full truncate rounded-md border border-edge px-2 py-0.5 text-xs text-fg-muted`,children:e},e))}):null]},e.id)})}),_?(0,$.jsx)(Se,{packageName:_,autoInstall:v===_,copy:o,extensions:f,onClose:()=>h({type:`patch`,patch:{detailPkg:null,quickInstallPkg:null}}),onInstall:j,onUninstall:P}):null]})}function Se(e){let t=(0,me.c)(99),{packageName:n,autoInstall:r,copy:i,extensions:a,onClose:s,onInstall:u,onUninstall:f}=e,[v,y]=(0,Q.useState)(!1),b=l(Oe),[x,S]=(0,Q.useState)(!1),T=c(De)?`ext-mp-detail-${n}`:null,E;t[0]===n?E=t[1]:(E=async()=>oe(n),t[0]=n,t[1]=E);let D;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(D={revalidateOnFocus:!1},t[2]=D):D=t[2];let{data:P,error:F,isLoading:I}=z(T,E,D),L;t[3]!==a||t[4]!==n?(L=ye(a,n),t[3]=a,t[4]=n,t[5]=L):L=t[5];let R=L,B=R===`user`,V=P?.manifest?.permissions,H,ee,U,W,G,te,K,q,ne,J,Y,X;if(t[6]!==r||t[7]!==i||t[8]!==P||t[9]!==F||t[10]!==a||t[11]!==R||t[12]!==I||t[13]!==b||t[14]!==s||t[15]!==n||t[16]!==V||t[17]!==x){te=Symbol.for(`react.early_return_sentinel`);bb0:{let e=V&&typeof V==`object`&&!Array.isArray(V)?Object.entries(V):[],o;t[30]!==i||t[31]!==P?(o=P?.readme?.trim()||(P?.description?.trim()?`### ${P.name}\n\n${P.description}`:`*${i.marketplaceNoReadme}*`),t[30]=i,t[31]=P,t[32]=o):o=t[32];let c=o;if(P?.format===`agent-plugin`){let e;if(t[33]!==P||t[34]!==a||t[35]!==n){let r;t[37]!==P||t[38]!==n?(r=e=>e.provenance?.packageName===n||e.pluginId===P.manifest?.name,t[37]=P,t[38]=n,t[39]=r):r=t[39],e=a.find(r),t[33]=P,t[34]=a,t[35]=n,t[36]=e}else e=t[36];let i=`store:${n}`,o;t[40]!==r||t[41]!==P||t[42]!==s||t[43]!==e||t[44]!==i?(o=(0,$.jsx)(ie,{extension:e,initialSource:i,marketplace:P,autoInstall:r,onClose:s}),t[40]=r,t[41]=P,t[42]=s,t[43]=e,t[44]=i,t[45]=o):o=t[45],te=o;break bb0}U=g,W=!0,t[46]===s?G=t[47]:(G=e=>!e&&s(),t[46]=s,t[47]=G),ee=p,t[48]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,$.jsx)(d,{className:`xopc-dialog-overlay fixed inset-0 z-[130] bg-scrim`}),t[48]=X):X=t[48],H=m,ne=`xopc-dialog-content fixed left-1/2 top-1/2 z-[131] flex h-[min(44rem,calc(100vh-1.5rem))] w-[min(42rem,calc(100vw-1.5rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay`,J=Ee;let l;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsx)(_,{className:`size-5`}),t[49]=l):l=t[49];let u;t[50]!==i.detailBack||t[51]!==s?(u=(0,$.jsx)(`button`,{type:`button`,onClick:s,className:`inline-flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":i.detailBack,children:l}),t[50]=i.detailBack,t[51]=s,t[52]=u):u=t[52];let f;t[53]===i.marketplaceDetailTitle?f=t[54]:(f=(0,$.jsx)(h,{className:`min-w-0 flex-1 truncate text-center text-sm font-semibold text-fg`,children:i.marketplaceDetailTitle}),t[53]=i.marketplaceDetailTitle,t[54]=f);let v;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsx)(j,{className:`size-5`}),t[55]=v):v=t[55];let y;t[56]!==i.detailClose||t[57]!==s?(y=(0,$.jsx)(`button`,{type:`button`,onClick:s,className:`inline-flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":i.detailClose,children:v}),t[56]=i.detailClose,t[57]=s,t[58]=y):y=t[58],t[59]!==u||t[60]!==f||t[61]!==y?(Y=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3`,children:[u,f,y]}),t[59]=u,t[60]=f,t[61]=y,t[62]=Y):Y=t[62],K=`min-h-0 flex-1 overflow-y-auto p-5`,q=I&&!P?(0,$.jsxs)(`div`,{className:`space-y-4`,"aria-label":i.marketplaceLoading,children:[(0,$.jsx)(N,{className:`h-6 w-48`}),(0,$.jsx)(N,{className:`h-4 w-28`}),(0,$.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,$.jsx)(N,{className:`h-12`}),(0,$.jsx)(N,{className:`h-12`})]}),(0,$.jsx)(N,{className:`h-28 w-full`}),(0,$.jsx)(N,{className:`h-36 w-full`})]}):F?(0,$.jsxs)(`div`,{className:`rounded-lg border border-red-300/70 bg-red-50 p-4 text-sm dark:border-red-900 dark:bg-red-950/30`,children:[(0,$.jsx)(`p`,{className:`font-medium text-red-700 dark:text-red-300`,children:i.marketplaceDetailLoadFailed}),(0,$.jsx)(`p`,{className:`mt-1 break-words text-red-600 dark:text-red-400`,children:F instanceof Error?F.message:i.marketplaceLoadFailed})]}):P?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`h3`,{className:`text-lg font-semibold text-fg`,children:P.name}),(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:(0,$.jsx)(`code`,{className:`rounded bg-surface-panel px-1 py-0.5`,children:P.id})}),(0,$.jsxs)(`dl`,{className:`mt-3 grid gap-2 text-xs text-fg-muted sm:grid-cols-2`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`font-medium text-fg`,children:i.marketplaceAuthor}),(0,$.jsx)(`dd`,{children:P.author.username})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`font-medium text-fg`,children:i.marketplaceVersion}),(0,$.jsx)(`dd`,{children:P.latestVersion.version})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`font-medium text-fg`,children:i.marketplaceDownloads}),(0,$.jsx)(`dd`,{children:P.downloads})]})]}),(0,$.jsx)(re,{data:P,zh:b===`zh`}),R===`bundled`?null:(0,$.jsxs)(`section`,{className:`mt-5 space-y-3 rounded-lg border border-edge bg-surface-base p-4`,children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[P.installability.available?(0,$.jsx)(O,{className:`mt-0.5 size-5 shrink-0 text-emerald-600 dark:text-emerald-400`,"aria-hidden":!0}):(0,$.jsx)(A,{className:`mt-0.5 size-5 shrink-0 text-amber-600 dark:text-amber-400`,"aria-hidden":!0}),(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`h4`,{className:`text-sm font-semibold text-fg`,children:P.installability.available?i.marketplaceRiskTitle:i.marketplaceUnavailableTitle}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-fg-muted`,children:P.installability.available?i.marketplaceCodeRisk:P.installability.reason??i.marketplaceUnavailableBody})]})]}),P.installability.available?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`dl`,{className:`grid gap-2 text-xs text-fg-muted sm:grid-cols-2`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`font-medium text-fg`,children:i.marketplaceIntegrity}),(0,$.jsx)(`dd`,{children:i.marketplaceIntegrityVerified})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`font-medium text-fg`,children:i.marketplaceDependencies}),(0,$.jsx)(`dd`,{children:P.packageSummary?.dependencyCount??0})]})]}),(0,$.jsxs)(`div`,{className:`text-xs text-fg-muted`,children:[(0,$.jsx)(`p`,{className:`font-medium text-fg`,children:i.marketplacePermissions}),e.length>0?(0,$.jsx)(`ul`,{className:`mt-1 space-y-1`,children:e.map(Te)}):(0,$.jsx)(`p`,{className:`mt-1`,children:i.marketplacePermissionsNone})]}),(P.packageSummary?.lifecycleScripts.length??0)>0?(0,$.jsxs)(`p`,{className:`text-xs leading-relaxed text-amber-700 dark:text-amber-300`,children:[i.marketplaceLifecycleScripts,`: `,P.packageSummary?.lifecycleScripts.join(`, `)]}):null,(0,$.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-2 text-sm text-fg`,children:[(0,$.jsx)(`input`,{type:`checkbox`,checked:x,onChange:e=>S(e.target.checked),className:`mt-0.5 size-4 rounded border-edge accent-[var(--color-accent)]`}),(0,$.jsx)(`span`,{children:i.marketplaceRiskConfirm})]})]}):null]}),P.readme?.trim()?(0,$.jsx)(`h4`,{className:`mb-2 mt-6 text-sm font-semibold text-fg`,children:i.marketplaceDetailReadmeHeading}):null,(0,$.jsx)(`div`,{className:`markdown-content min-w-0 break-words text-sm`,children:(0,$.jsx)(w,{content:c})})]}):null}t[6]=r,t[7]=i,t[8]=P,t[9]=F,t[10]=a,t[11]=R,t[12]=I,t[13]=b,t[14]=s,t[15]=n,t[16]=V,t[17]=x,t[18]=H,t[19]=ee,t[20]=U,t[21]=W,t[22]=G,t[23]=te,t[24]=K,t[25]=q,t[26]=ne,t[27]=J,t[28]=Y,t[29]=X}else H=t[18],ee=t[19],U=t[20],W=t[21],G=t[22],te=t[23],K=t[24],q=t[25],ne=t[26],J=t[27],Y=t[28],X=t[29];if(te!==Symbol.for(`react.early_return_sentinel`))return te;let Z;t[63]!==K||t[64]!==q?(Z=(0,$.jsx)(`div`,{className:K,children:q}),t[63]=K,t[64]=q,t[65]=Z):Z=t[65];let ae;t[66]!==v||t[67]!==i.marketplaceBuiltinGoBuiltin||t[68]!==i.marketplaceBuiltinManageHint||t[69]!==i.marketplaceInstall||t[70]!==i.marketplaceReinstall||t[71]!==i.marketplaceReinstallConfirm||t[72]!==i.marketplaceUninstall||t[73]!==i.marketplaceUninstallConfirm||t[74]!==P||t[75]!==R||t[76]!==s||t[77]!==u||t[78]!==f||t[79]!==n||t[80]!==x||t[81]!==B?(ae=P?(0,$.jsx)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-end gap-2 border-t border-edge-subtle px-5 py-4`,children:R===`bundled`?(0,$.jsxs)(`div`,{className:`flex w-full flex-col items-stretch gap-2`,children:[(0,$.jsx)(`p`,{className:`text-sm leading-relaxed text-fg-muted`,children:i.marketplaceBuiltinManageHint}),(0,$.jsx)(o,{to:`/capabilities/extensions?tab=builtin`,onClick:s,className:`inline-flex w-fit items-center justify-center rounded-lg border border-edge px-3 py-2 text-sm font-medium text-fg hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:i.marketplaceBuiltinGoBuiltin})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`button`,{type:`button`,disabled:v||!P.installability.available||!x,onClick:()=>{B&&!window.confirm(i.marketplaceReinstallConfirm)||(y(!0),u(n,B).catch(we).finally(()=>y(!1)))},className:M(`inline-flex items-center justify-center gap-1.5 rounded-lg px-3 py-2 text-sm font-medium`,`bg-accent text-on-accent shadow-surface hover:bg-accent-hover`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`,`disabled:pointer-events-none disabled:opacity-50`),children:[v?(0,$.jsx)(C,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,B?i.marketplaceReinstall:i.marketplaceInstall]}),B?(0,$.jsxs)(`button`,{type:`button`,disabled:v,onClick:()=>{window.confirm(i.marketplaceUninstallConfirm)&&(y(!0),f(n).then(()=>s()).catch(Ce).finally(()=>y(!1)))},className:M(`inline-flex items-center justify-center gap-1.5 rounded-lg border border-edge px-3 py-2 text-sm font-medium text-fg`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,`disabled:pointer-events-none disabled:opacity-50`),children:[(0,$.jsx)(k,{className:`size-4 shrink-0`,"aria-hidden":!0}),i.marketplaceUninstall]}):null]})}):null,t[66]=v,t[67]=i.marketplaceBuiltinGoBuiltin,t[68]=i.marketplaceBuiltinManageHint,t[69]=i.marketplaceInstall,t[70]=i.marketplaceReinstall,t[71]=i.marketplaceReinstallConfirm,t[72]=i.marketplaceUninstall,t[73]=i.marketplaceUninstallConfirm,t[74]=P,t[75]=R,t[76]=s,t[77]=u,t[78]=f,t[79]=n,t[80]=x,t[81]=B,t[82]=ae):ae=t[82];let se;t[83]!==H||t[84]!==Z||t[85]!==ae||t[86]!==ne||t[87]!==J||t[88]!==Y?(se=(0,$.jsxs)(H,{className:ne,onOpenAutoFocus:J,children:[Y,Z,ae]}),t[83]=H,t[84]=Z,t[85]=ae,t[86]=ne,t[87]=J,t[88]=Y,t[89]=se):se=t[89];let ce;t[90]!==ee||t[91]!==se||t[92]!==X?(ce=(0,$.jsxs)(ee,{children:[X,se]}),t[90]=ee,t[91]=se,t[92]=X,t[93]=ce):ce=t[93];let le;return t[94]!==U||t[95]!==W||t[96]!==G||t[97]!==ce?(le=(0,$.jsx)(U,{defaultOpen:W,onOpenChange:G,children:ce}),t[94]=U,t[95]=W,t[96]=G,t[97]=ce,t[98]=le):le=t[98],le}function Ce(){}function we(){}function Te(e){let[t,n]=e;return(0,$.jsxs)(`li`,{className:`break-words`,children:[(0,$.jsx)(`code`,{children:t}),`: `,Array.isArray(n)?n.join(`, `):String(n)]},t)}function Ee(e){return e.preventDefault()}function De(e){return!!e.conversationId}function Oe(e){return e.language}function ke({embedded:e=!1,onHeaderActionChange:t}){let n=s(),r=i(),c=l(e=>e.language),d=u(c),f=U(e=>e.setPageHeader),p=U(e=>e.clearPageHeader),m=I(),h=P(),[g,_]=a(),y=ve(g.get(`tab`)??(m.some(e=>e.source!==`bundled`)?`user`:null)),b=(0,Q.useRef)(!1),S=g.get(`q`)??``,[C,w]=(0,Q.useState)(y),[T,D]=(0,Q.useState)(S),[O,k]=(0,Q.useState)(null),[A,j]=(0,Q.useState)(!1),N=g.toString(),F=(0,Q.useRef)(N);if(F.current!==N){F.current=N;let e=ve(g.get(`tab`)),t=g.get(`q`)??``;w(t=>t===e?t:e),D(e=>e===t?e:t)}(0,Q.useEffect)(()=>{_(e=>{let t=new URLSearchParams(e),n=T.trim();return n?t.set(`q`,n):t.delete(`q`),C===`marketplace`?t.delete(`tab`):t.set(`tab`,C),t.toString()===e.toString()?e:t},{replace:!0})},[C,T,_]);let L=(0,Q.useMemo)(()=>m.filter(e=>e.source===`bundled`),[m]),R=(0,Q.useMemo)(()=>m.filter(e=>e.source!==`bundled`),[m]);(0,Q.useEffect)(()=>{h||b.current||(b.current=!0,!g.has(`tab`)&&R.length&&w(`user`))},[h,g,R.length]);let z=C===`builtin`?L:R,B=(0,Q.useMemo)(()=>{let e=T.trim().toLowerCase(),t=z;return e&&(t=t.filter(t=>(t.name??``).toLowerCase().includes(e)||t.id.toLowerCase().includes(e)||(t.description??``).toLowerCase().includes(e))),t.toSorted((e,t)=>e.hasUi===t.hasUi?(e.name||e.id).localeCompare(t.name||t.id,c):e.hasUi?-1:1)},[z,T,c]);(0,Q.useEffect)(()=>{k(e=>{if(!e)return e;let t=m.find(t=>t.id===e.id);return t?Ae(e)===Ae(t)&&e.active===t.active&&JSON.stringify(e)===JSON.stringify(t)?e:t:null})},[m]);let W=(0,Q.useMemo)(()=>({searchLabel:C===`marketplace`?d.extensionsPage.marketplaceSearchPlaceholder:d.extensionsPage.searchPlaceholder,search:(0,$.jsx)(le,{value:T,onChange:D,placeholder:C===`marketplace`?d.extensionsPage.marketplaceSearchPlaceholder:d.extensionsPage.searchPlaceholder}),overflow:(0,$.jsxs)(G,{children:[(0,$.jsx)(te,{asChild:!0,children:(0,$.jsx)(V,{variant:`secondary`,className:`size-9 shrink-0 p-0`,"aria-label":d.capabilitiesHub.moreActions,title:d.capabilitiesHub.moreActions,children:(0,$.jsx)(x,{className:`size-4`,"aria-hidden":!0})})}),(0,$.jsx)(K,{children:(0,$.jsxs)(ne,{align:`end`,sideOffset:6,className:`z-50 min-w-48 rounded-xl border border-edge bg-surface-overlay p-1 shadow-popover`,children:[(0,$.jsxs)(q,{className:M(`touch-target flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover`,H.transition),onSelect:()=>j(!0),children:[(0,$.jsx)(E,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),c.startsWith(`zh`)?`安装插件`:`Install plugin`]}),(0,$.jsx)(q,{asChild:!0,children:(0,$.jsxs)(o,{to:`/local-apps`,className:M(`touch-target flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover`,H.transition),children:[(0,$.jsx)(v,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),d.extensionsPage.openLocalApps]})})]})})]}),primary:(0,$.jsx)(V,{asChild:!0,variant:`primary`,className:`h-9 shrink-0`,children:(0,$.jsxs)(o,{to:`/local-apps/new`,"aria-label":d.extensionsPage.createLocalApp,children:[(0,$.jsx)(E,{className:`size-4`,"aria-hidden":!0}),(0,$.jsx)(`span`,{className:`hidden sm:inline`,children:d.extensionsPage.createLocalApp})]})})}),[c,d.capabilitiesHub.moreActions,d.extensionsPage,C,T]);(0,Q.useLayoutEffect)(()=>e?(t?.(W),()=>t?.(null)):(f({startExtra:null,main:(0,$.jsx)(`div`,{className:`min-w-0`,children:(0,$.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:d.extensionsPage.title})}),end:(0,$.jsx)(ue,{contribution:W})}),()=>p()),[p,e,W,d.extensionsPage.title,t,f]);let re=[{id:`user`,label:d.extensionsPage.tabUser,count:h?void 0:R.length},{id:`marketplace`,label:d.extensionsPage.tabMarketplace},{id:`builtin`,label:d.extensionsPage.tabBuiltin,count:h?void 0:L.length}];return(0,$.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col bg-surface-panel`,children:[(0,$.jsxs)(`div`,{className:M(`mx-auto w-full max-w-7xl px-4 sm:px-6 lg:px-8`,`pb-7 pt-3 lg:pb-9 lg:pt-4`),children:[(0,$.jsx)(`div`,{className:`mb-6 border-b border-edge-subtle pb-3`,children:(0,$.jsx)(ee,{items:re,activeTab:C,onChange:w,ariaLabel:d.extensionsPage.extensionsNavAria,tabIdPrefix:`extensions-tab`,panelIdPrefix:`extensions-panel`,className:`flex-wrap`})}),C===`marketplace`?(0,$.jsx)(xe,{query:T}):h?(0,$.jsx)(Le,{}):C===`builtin`&&L.length===0?(0,$.jsx)(ze,{message:d.extensionsPage.emptyBuiltin}):C===`user`&&R.length===0?(0,$.jsx)(ze,{message:d.extensionsPage.emptyUser}):B.length===0?(0,$.jsx)(`p`,{className:`px-3 py-14 text-center text-sm text-fg-muted sm:px-5 xl:px-6`,children:d.extensionsPage.noSearchResults}):(0,$.jsx)(`div`,{className:he,children:B.map(e=>(0,$.jsx)(Ne,{extension:e,copy:d.extensionsPage,onOpen:()=>e.pluginId?n(Y(e.pluginId,`installed`,!1,r.pathname+r.search)):k(e)},e.id))})]}),O?O.format===`agent-plugin`?(0,$.jsx)(ie,{extension:O,onClose:()=>k(null)},O.id):(0,$.jsx)(Fe,{extension:O,copy:d.extensionsPage,onClose:()=>k(null)},O.id):null,A?(0,$.jsx)(ie,{onClose:()=>j(!1)}):null]})}function Ae(e){return e.activationEligible??e.active}function je(e,t){return e.source===`bundled`?t.providerBundled:e.source===`global`?t.providerGlobal:e.source===`workspace`?t.providerWorkspace:t.providerOther}function Me(e,t){let n=Ae(e);return n&&e.active?t.runStateLive:n&&!e.active?t.runStatePendingOn:!n&&e.active?t.runStatePendingOff:t.runStateOff}function Ne(e){let t=(0,me.c)(56),{extension:n,copy:r,onOpen:a}=e,o=l(Pe),c,u;t[0]!==n||t[1]!==o?(u=o.startsWith(`zh`),c=de(n,u),t[0]=n,t[1]=o,t[2]=c,t[3]=u):(c=t[2],u=t[3]);let d=c,f;t[4]===n?f=t[5]:(f=fe(n),t[4]=n,t[5]=f);let p=f,m=n.localizations?.[u?`zh-CN`:`en`]?.description??n.description,h=s(),g=i(),_;t[6]===n?_=t[7]:(_=!!n.pluginId&&pe(n),t[6]=n,t[7]=_);let b=_,x=p?u?`去授权`:`Connect account`:b?u?`开始使用`:`Start using`:u?`管理插件`:`Manage plugin`,S;t[8]!==b||t[9]!==n.pluginId||t[10]!==g||t[11]!==d||t[12]!==h||t[13]!==p||t[14]!==a||t[15]!==u?(S=()=>{b?h(J(d,u,n.pluginId)):p&&n.pluginId?h(Y(n.pluginId,`installed`,!0,g.pathname+g.search)):a()},t[8]=b,t[9]=n.pluginId,t[10]=g,t[11]=d,t[12]=h,t[13]=p,t[14]=a,t[15]=u,t[16]=S):S=t[16];let C=S,w=`${d}, ${r.marketplaceDetailTitle}`,T;t[17]!==a||t[18]!==w?(T=(0,$.jsx)(`button`,{type:`button`,"aria-label":w,onClick:a,className:_e}),t[17]=a,t[18]=w,t[19]=T):T=t[19];let E=n.branding?.iconUrl,D;t[20]===E?D=t[21]:(D=(0,$.jsx)(X,{iconUrl:E,fallback:v}),t[20]=E,t[21]=D);let O;t[22]===d?O=t[23]:(O=(0,$.jsx)(`h2`,{className:`line-clamp-2 break-words font-semibold leading-snug text-fg`,title:d,children:d}),t[22]=d,t[23]=O);let k;t[24]===n.provenance?.publisherVerification?k=t[25]:(k=n.provenance?.publisherVerification===`verified`?(0,$.jsx)(y,{className:`mt-0.5 size-3.5 shrink-0 text-emerald-600 dark:text-emerald-400`,strokeWidth:1.75,"aria-label":`Verified`}):null,t[24]=n.provenance?.publisherVerification,t[25]=k);let A;t[26]!==O||t[27]!==k?(A=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-start gap-1.5`,children:[O,k]}),t[26]=O,t[27]=k,t[28]=A):A=t[28];let j;t[29]===n.version?j=t[30]:(j=n.version?(0,$.jsxs)(`span`,{children:[`v`,n.version]}):null,t[29]=n.version,t[30]=j);let M=p?`text-amber-700 dark:text-amber-400`:`text-fg-muted`,N=p?u?`需要授权`:`Authorization required`:Ae(n)?r.statusEnabled:r.runStateOff,P;t[31]!==M||t[32]!==N?(P=(0,$.jsx)(`span`,{className:M,children:N}),t[31]=M,t[32]=N,t[33]=P):P=t[33];let F;t[34]!==j||t[35]!==P?(F=(0,$.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-fg-subtle`,children:[j,P]}),t[34]=j,t[35]=P,t[36]=F):F=t[36];let I;t[37]!==A||t[38]!==F?(I=(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[A,F]}),t[37]=A,t[38]=F,t[39]=I):I=t[39];let L;t[40]!==x||t[41]!==C?(L=(0,$.jsx)(`div`,{className:`pointer-events-auto relative z-10 flex max-w-[45%] shrink-0 items-start`,children:(0,$.jsx)(`button`,{type:`button`,onClick:C,className:`inline-flex items-center justify-center rounded-lg border border-edge px-3 py-2 text-xs font-medium text-fg transition-colors hover:bg-surface-hover active:scale-[0.98] active:bg-surface-hover/80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:x})}),t[40]=x,t[41]=C,t[42]=L):L=t[42];let R;t[43]!==I||t[44]!==L||t[45]!==D?(R=(0,$.jsxs)(`div`,{className:`pointer-events-none relative flex items-start gap-3`,children:[D,I,L]}),t[43]=I,t[44]=L,t[45]=D,t[46]=R):R=t[46];let z;t[47]!==r.cardNoDescription||t[48]!==m?(z=m?.trim()||r.cardNoDescription,t[47]=r.cardNoDescription,t[48]=m,t[49]=z):z=t[49];let B;t[50]===z?B=t[51]:(B=(0,$.jsx)(`p`,{className:`pointer-events-none relative mt-3 line-clamp-3 text-sm leading-relaxed text-fg-muted`,children:z}),t[50]=z,t[51]=B);let V;return t[52]!==R||t[53]!==B||t[54]!==T?(V=(0,$.jsxs)(`article`,{className:ge,children:[T,R,B]}),t[52]=R,t[53]=B,t[54]=T,t[55]=V):V=t[55],V}function Pe(e){return e.language}function Fe({extension:e,copy:t,onClose:n}){let{mutate:r}=R(),[i,a]=(0,Q.useState)(null),[s,c]=(0,Q.useState)(null),[l,u]=(0,Q.useState)(!1),v=e.activationEligible===!0,y=(0,Q.useCallback)(async()=>{c(null),u(!1),a(`toggle`);try{let{requiresGatewayRestart:t}=await ae({extensionId:e.id,enabled:!v});await r(`gateway-extensions-list`),B(),u(t)}catch(e){c(e instanceof Error?e.message:t.extensionToggleFailed)}finally{a(null)}},[v,t.extensionToggleFailed,e.id,r]),x=(0,Q.useCallback)(async()=>{if(!(e.source===`bundled`||!window.confirm(t.extensionUninstallConfirm))){c(null),u(!1),a(`uninstall`);try{await Z(e.id),await r(`gateway-extensions-list`),B(),n()}catch(e){c(e instanceof Error?e.message:t.marketplaceUninstallFailed),a(null)}}},[t.extensionUninstallConfirm,t.marketplaceUninstallFailed,e.id,e.source,r,n]),w=e.ui?.contributions?.pages??[],T=e.ui?.contributions?.settingsPanels??[],E=e.ui?.contributions?.chatWidgets??[],O=w.find(e=>e.showInNav)??w[0],A=T[0],N=O?b(e.id,O):null,P=A?`/settings/ext/${e.id}/${A.id}`:e.hasConfigSchema||F(e)?`/settings/ext/${e.id}`:null;return(0,$.jsx)(g,{defaultOpen:!0,onOpenChange:e=>!e&&n(),children:(0,$.jsxs)(p,{children:[(0,$.jsx)(d,{className:`xopc-dialog-overlay fixed inset-0 z-[130] bg-scrim`}),(0,$.jsxs)(m,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[131] flex max-h-[min(90vh,44rem)] w-[min(42rem,calc(100vw-1.5rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay`,onOpenAutoFocus:e=>e.preventDefault(),children:[(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3`,children:[(0,$.jsx)(`button`,{type:`button`,onClick:n,className:`inline-flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":t.detailBack,children:(0,$.jsx)(_,{className:`size-5`})}),(0,$.jsx)(h,{className:`min-w-0 flex-1 truncate text-center text-sm font-semibold text-fg`,children:t.detailTitle}),(0,$.jsxs)(f,{className:`sr-only`,children:[e.name,` (`,e.id,`)`]}),(0,$.jsx)(`button`,{type:`button`,onClick:n,className:`inline-flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":t.detailClose,children:(0,$.jsx)(j,{className:`size-5`})})]}),(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-start gap-4`,children:[(0,$.jsx)(`div`,{className:`flex size-16 shrink-0 items-center justify-center rounded-2xl bg-accent-soft text-xl font-semibold text-accent-fg`,"aria-hidden":!0,children:(e.name||e.id).charAt(0).toUpperCase()}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`h3`,{className:`text-lg font-semibold text-fg`,children:e.name}),(0,$.jsxs)(`p`,{className:`mt-0.5 text-sm text-fg-muted`,children:[t.detailProviderPrefix,` `,je(e,t)]}),e.version?(0,$.jsxs)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:[`v`,e.version]}):null]})]}),(0,$.jsx)(`p`,{className:`mt-5 text-sm leading-relaxed text-fg`,children:e.description?.trim()||t.detailNoDescription}),e.hasUi?null:(0,$.jsx)(`p`,{className:`mt-3 text-xs text-fg-muted`,children:t.backendOnlyHint}),(0,$.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:Me(e,t)}),e.source===`bundled`?(0,$.jsx)(`p`,{className:`mt-4 rounded-lg bg-surface-hover/40 px-3 py-2 text-xs text-fg-muted shadow-surface dark:bg-surface-hover/20`,children:t.builtinConfigHint}):null,(0,$.jsxs)(`div`,{className:`mt-3 rounded-lg bg-surface-hover/40 p-3 shadow-surface dark:bg-surface-hover/20`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,$.jsx)(`span`,{className:`text-xs font-medium text-fg`,children:t.builtinRuntimeToggle}),(0,$.jsx)(V,{type:`button`,variant:`secondary`,disabled:i!==null,onClick:()=>void y(),className:`shrink-0 py-1.5 text-xs`,children:i===`toggle`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(C,{className:`mr-1.5 size-3.5 shrink-0 animate-spin`,"aria-hidden":!0}),t.builtinToggleBusy]}):v?t.builtinToggleDisable:t.builtinToggleEnable})]}),s?(0,$.jsx)(`p`,{className:`mt-2 text-xs text-rose-600 dark:text-rose-400`,children:s}):null,l?(0,$.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:t.builtinToggleRestartHint}):null,e.source===`bundled`?null:(0,$.jsx)(`div`,{className:`mt-3 flex justify-end border-t border-edge-subtle pt-3`,children:(0,$.jsxs)(V,{type:`button`,variant:`ghost`,disabled:i!==null,onClick:()=>void x(),className:`text-danger hover:bg-danger-soft hover:text-danger`,children:[i===`uninstall`?(0,$.jsx)(C,{className:`size-3.5 animate-spin`,"aria-hidden":!0}):(0,$.jsx)(k,{className:`size-3.5`,"aria-hidden":!0}),t.marketplaceUninstall]})})]}),e.hasUi&&(w.length>0||T.length>0||E.length>0)?(0,$.jsxs)(`section`,{className:`mt-8`,children:[(0,$.jsx)(`h4`,{className:`mb-3 text-sm font-semibold text-fg`,children:t.detailSectionFeatures}),(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[(0,$.jsx)(Ie,{template:t.badgePages,count:w.length,hidden:w.length===0}),(0,$.jsx)(Ie,{template:t.badgeSettings,count:T.length,hidden:T.length===0}),(0,$.jsx)(Ie,{template:t.badgeWidgets,count:E.length,hidden:E.length===0})]})]}):null,L(e)&&(N||P)?(0,$.jsxs)(`div`,{className:`mt-6 flex flex-wrap gap-2 border-t border-edge-subtle pt-4`,children:[N?(0,$.jsxs)(o,{to:N,onClick:n,className:M(`inline-flex items-center gap-1.5 rounded-lg border border-edge px-3 py-2 text-sm font-medium text-fg`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`),children:[(0,$.jsx)(S,{className:`size-4 shrink-0 opacity-80`,"aria-hidden":!0}),t.open]}):null,P?(0,$.jsxs)(o,{to:P,onClick:n,className:M(`inline-flex items-center gap-1.5 rounded-lg border border-edge px-3 py-2 text-sm font-medium text-fg`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`),children:[(0,$.jsx)(D,{className:`size-4 shrink-0 opacity-80`,"aria-hidden":!0}),t.openSettings]}):null]}):null,(0,$.jsx)(`p`,{className:`mt-6 text-[11px] leading-relaxed text-fg-muted`,children:t.restartNote})]})]})]})})}function Ie(e){let t=(0,me.c)(6),{template:n,count:r,hidden:i}=e;if(i||r===0)return null;let a;if(t[0]!==r||t[1]!==n){let e;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=/\{\{count\}\}/g,t[3]=e):e=t[3],a=n.replace(e,String(r)),t[0]=r,t[1]=n,t[2]=a}else a=t[2];let o;return t[4]===a?o=t[5]:(o=(0,$.jsx)(`span`,{className:`inline-flex items-center rounded-md bg-surface-hover px-2 py-0.5 text-[11px] font-medium text-fg-muted`,children:a}),t[4]=a,t[5]=o),o}function Le(){let e=(0,me.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(`div`,{className:he,"aria-busy":`true`,children:Array.from({length:6},Re)}),e[0]=t):t=e[0],t}function Re(e,t){return(0,$.jsx)(N,{className:`h-32 rounded-xl`},t)}function ze(e){let t=(0,me.c)(2),{message:n}=e,r;return t[0]===n?r=t[1]:(r=(0,$.jsx)(`div`,{className:`flex min-h-[min(40vh,16rem)] flex-col items-center justify-center rounded-xl border border-edge-subtle bg-surface-base px-4 py-12 text-center shadow-surface`,children:(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n})}),t[0]=n,t[1]=r),r}export{ke as ExtensionsPage};
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{l as i,m as a,t as o,u as s}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{l as c,n as l}from"./locale-store-Bld7_m-Q.js";import{t as u}from"./messages-CGO1P4mz.js";import{a as d,i as f,o as p,r as m,s as h,t as g}from"./dist-BGTk37IG.js";import{t as _}from"./arrow-left-D880xG-P.js";import{t as v}from"./box-DvYoGszj.js";import{n as y,t as b}from"./extension-paths-DvuaZJuy.js";import{t as x}from"./ellipsis-0k4rZLoy.js";import{t as S}from"./external-link-DjqjBmc3.js";import{t as C}from"./loader-circle-CifKLtgG.js";import{t as w}from"./markdown-view-B3cFKCfO.js";import{t as T}from"./package-wATCyihJ.js";import{t as E}from"./plus-Q2yW6OE7.js";import{t as D}from"./settings-uiTATseT.js";import{t as O}from"./shield-check-BU58siTV.js";import{t as k}from"./trash-2-DusmjVPV.js";import{t as A}from"./triangle-alert-2JXFNNKU.js";import{t as j}from"./x-B_N4OPjy.js";import{t as M}from"./cn-0WouolD0.js";import{t as N}from"./skeleton-DzdOeGYz.js";import{i as P,o as F,r as I,s as L}from"./extension-provider-C4WwnCxf.js";import{a as R,i as z}from"./vendor-swr-CdRzEUwF.js";import{o as B}from"./gateway-realtime-hnEaDFaA.js";import{t as V}from"./button-Cc4hUNTt.js";import{n as H}from"./interaction-BdhHBbYa.js";import{t as ee}from"./page-tabs-oeTY7z3_.js";import{t as U}from"./page-header-store-YZfSLNTg.js";import{r as W}from"./settings-form-draft-Dy10ldo8.js";import{l as G,m as te,o as K,r as q,t as ne}from"./dist-ZrL34Ps4.js";import{r as re,t as ie}from"./agent-plugin-dialog-B2vXlrDW.js";import{n as J,t as Y}from"./capability-links-MZdYfPKx.js";import{t as X}from"./capability-icon-CmvCZOJX.js";import{a as Z,i as ae,n as oe,r as se,t as ce}from"./extension-marketplace-api-D7Av-sOf.js";import{n as le,t as ue}from"./capability-header-actions-BxMYfQ8y.js";import{n as de,r as fe,t as pe}from"./plugin-presentation-CO5BFDGW.js";var me=n(),he=`grid auto-rows-fr grid-cols-[repeat(auto-fill,minmax(min(100%,18rem),1fr))] items-stretch gap-4`,ge=`relative h-full min-w-0 rounded-xl border border-edge bg-surface-panel p-4 transition-colors hover:border-edge-strong hover:bg-surface-hover/30`,_e=`absolute inset-0 cursor-pointer rounded-xl focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent`,Q=e(t(),1);function ve(e){return e===`builtin`||e===`user`?e:`marketplace`}var $=r();function ye(e,t){let n=e.find(e=>e.id===t||e.pluginId===t||e.provenance?.packageName===t);return n?n.source===`bundled`?`bundled`:`user`:`absent`}var be={debounced:``,detailPkg:null,quickInstallPkg:null,rowBusy:null,actionError:null,restartHint:null};function xe({className:e,query:t}){let n=s(),r=i(),a=l(e=>e.language),o=u(a).extensionsPage,d=c(e=>!!e.conversationId),f=I(),{mutate:p}=R(),[m,h]=(0,Q.useReducer)(W,be),{debounced:g,detailPkg:_,quickInstallPkg:v,rowBusy:b,actionError:x,restartHint:S}=m,w=d?`marketplace-${g}`:null;(0,Q.useEffect)(()=>{let e=window.setTimeout(()=>h({type:`patch`,patch:{debounced:t.trim()}}),300);return()=>window.clearTimeout(e)},[t]);let{data:E,isLoading:D,error:O}=z(w,()=>ce(g),{revalidateOnFocus:!1}),A=(0,Q.useCallback)(()=>{p(`gateway-extensions-list`),B()},[p]),j=(0,Q.useCallback)(async(e,t)=>{h({type:`patch`,patch:{actionError:null,restartHint:null,rowBusy:e}});try{let n=await se({name:e,overwrite:t});A(),n.requiresGatewayRestart&&h({type:`patch`,patch:{restartHint:o.marketplaceRestartHint}})}catch(e){throw h({type:`patch`,patch:{actionError:e instanceof Error?e.message:o.marketplaceInstallFailed}}),e}finally{h({type:`patch`,patch:{rowBusy:null}})}},[o.marketplaceInstallFailed,o.marketplaceRestartHint,A]),P=(0,Q.useCallback)(async e=>{h({type:`patch`,patch:{actionError:null,restartHint:null,rowBusy:e}});try{let t=await Z(e);A(),t.requiresGatewayRestart&&h({type:`patch`,patch:{restartHint:o.marketplaceRestartHint}})}catch(e){throw h({type:`patch`,patch:{actionError:e instanceof Error?e.message:o.marketplaceUninstallFailed}}),e}finally{h({type:`patch`,patch:{rowBusy:null}})}},[o.marketplaceRestartHint,o.marketplaceUninstallFailed,A]),F=E??[];return(0,$.jsxs)(`div`,{className:M(`flex flex-col gap-4`,e),children:[O?(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:O instanceof Error?O.message:o.marketplaceLoadFailed}):null,x?(0,$.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:x}):null,S?(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:S}):null,D&&!E?(0,$.jsx)(`ul`,{className:he,"aria-label":o.marketplaceLoading,children:[0,1,2,3,4,5].map(e=>(0,$.jsxs)(`li`,{className:`rounded-xl border border-edge bg-surface-panel p-4`,children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,$.jsx)(N,{className:`size-10 shrink-0 rounded-xl`}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2`,children:[(0,$.jsx)(N,{className:`h-5 w-full`}),(0,$.jsx)(N,{className:`h-3 w-2/3`})]}),(0,$.jsx)(N,{className:`h-9 w-16 shrink-0 rounded-lg`})]}),(0,$.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,$.jsx)(N,{className:`h-4 w-full`}),(0,$.jsx)(N,{className:`h-4 w-full`}),(0,$.jsx)(N,{className:`h-4 w-2/3`})]})]},e))}):(0,$.jsx)(`ul`,{className:he,children:F.length===0?(0,$.jsx)(`li`,{className:`col-span-full text-sm text-fg-muted`,children:o.marketplaceEmpty}):F.map(e=>{let t=ye(f,e.id),i=b===e.id,s=f.find(t=>t.pluginId===e.id||t.provenance?.packageName===e.id),c=e.localizations?.[a.startsWith(`zh`)?`zh-CN`:`en`],l=c?.displayName??e.name,u=c?.description??e.description;return(0,$.jsxs)(`li`,{className:ge,children:[(0,$.jsx)(`button`,{type:`button`,"aria-label":`${l}, ${o.marketplaceDetailTitle}`,onClick:()=>s?.pluginId?n(Y(s.pluginId,`installed`,!1,r.pathname+r.search)):h({type:`patch`,patch:{detailPkg:e.id}}),className:_e}),(0,$.jsxs)(`div`,{className:`pointer-events-none relative flex items-start gap-3`,children:[(0,$.jsx)(X,{iconUrl:e.branding?.iconUrl,fallback:T}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 items-start gap-1.5`,children:[(0,$.jsx)(`h3`,{className:`line-clamp-2 break-words font-semibold leading-snug text-fg`,title:l,children:l}),e.verified?(0,$.jsx)(y,{className:`mt-0.5 size-3.5 shrink-0 text-emerald-600 dark:text-emerald-400`,strokeWidth:1.75,"aria-label":`Verified`}):null]}),(0,$.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-fg-subtle`,children:[e.version?(0,$.jsxs)(`span`,{children:[`v`,e.version]}):null,t===`user`?(0,$.jsx)(`span`,{className:s&&fe(s)?`text-amber-700 dark:text-amber-400`:`text-fg-muted`,children:s&&fe(s)?a.startsWith(`zh`)?`需要授权`:`Authorization required`:o.marketplaceInstalled}):null]})]}),(0,$.jsx)(`div`,{role:`group`,className:`pointer-events-auto relative z-10 flex max-w-[45%] shrink-0 items-start`,children:t===`bundled`?(0,$.jsx)(`span`,{className:`rounded-md bg-surface-hover px-2 py-1 text-[11px] font-medium text-fg-muted`,children:o.marketplaceBuiltin}):t===`user`?(0,$.jsx)($.Fragment,{children:e.packageType===`plugin`?(0,$.jsx)(`button`,{type:`button`,onClick:()=>s?.pluginId&&pe(s)?n(J(l,a.startsWith(`zh`),s.pluginId)):s?.pluginId?n(Y(s.pluginId,`installed`,fe(s),r.pathname+r.search)):h({type:`patch`,patch:{detailPkg:e.id,quickInstallPkg:null}}),className:M(`inline-flex items-center justify-center rounded-lg border border-edge px-3 py-2 text-xs font-medium text-fg`,`transition-colors active:scale-[0.98] active:bg-surface-hover/80`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`),children:s&&fe(s)?a.startsWith(`zh`)?`去授权`:`Connect account`:s&&pe(s)?a.startsWith(`zh`)?`开始使用`:`Start using`:a.startsWith(`zh`)?`管理插件`:`Manage plugin`}):(0,$.jsxs)(`button`,{type:`button`,disabled:i,onClick:()=>{window.confirm(o.marketplaceUninstallConfirm)&&P(e.id).catch(()=>{})},className:M(`inline-flex items-center justify-center gap-1.5 rounded-lg border border-edge px-3 py-2 text-xs font-medium text-fg`,`transition-colors active:scale-[0.98] active:bg-surface-hover/80`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,`disabled:pointer-events-none disabled:opacity-50`),children:[i?(0,$.jsx)(C,{className:`size-3.5 animate-spin`,"aria-hidden":!0}):(0,$.jsx)(k,{className:`size-3.5`,strokeWidth:2,"aria-hidden":!0}),o.marketplaceUninstall]})}):(0,$.jsx)(`button`,{type:`button`,onClick:()=>h({type:`patch`,patch:(e.packageType,{detailPkg:e.id,quickInstallPkg:null})}),className:M(`inline-flex min-w-16 items-center justify-center rounded-lg border border-edge px-3 py-2 text-xs font-medium text-fg`,`transition-[transform,background-color] active:scale-[0.98]`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`),children:e.packageType===`plugin`?a.startsWith(`zh`)?`安装`:`Install`:o.marketplaceReview})})]}),u?(0,$.jsx)(`p`,{className:`pointer-events-none relative mt-3 line-clamp-3 text-sm leading-relaxed text-fg-muted`,children:u}):null,(e.categories?.length??0)>0?(0,$.jsx)(`div`,{className:`pointer-events-none relative mt-3 flex flex-wrap gap-1.5`,children:e.categories?.map(e=>(0,$.jsx)(`span`,{className:`max-w-full truncate rounded-md border border-edge px-2 py-0.5 text-xs text-fg-muted`,children:e},e))}):null]},e.id)})}),_?(0,$.jsx)(Se,{packageName:_,autoInstall:v===_,copy:o,extensions:f,onClose:()=>h({type:`patch`,patch:{detailPkg:null,quickInstallPkg:null}}),onInstall:j,onUninstall:P}):null]})}function Se(e){let t=(0,me.c)(99),{packageName:n,autoInstall:r,copy:i,extensions:a,onClose:s,onInstall:u,onUninstall:f}=e,[v,y]=(0,Q.useState)(!1),b=l(Oe),[x,S]=(0,Q.useState)(!1),T=c(De)?`ext-mp-detail-${n}`:null,E;t[0]===n?E=t[1]:(E=async()=>oe(n),t[0]=n,t[1]=E);let D;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(D={revalidateOnFocus:!1},t[2]=D):D=t[2];let{data:P,error:F,isLoading:I}=z(T,E,D),L;t[3]!==a||t[4]!==n?(L=ye(a,n),t[3]=a,t[4]=n,t[5]=L):L=t[5];let R=L,B=R===`user`,V=P?.manifest?.permissions,H,ee,U,W,G,te,K,q,ne,J,Y,X;if(t[6]!==r||t[7]!==i||t[8]!==P||t[9]!==F||t[10]!==a||t[11]!==R||t[12]!==I||t[13]!==b||t[14]!==s||t[15]!==n||t[16]!==V||t[17]!==x){te=Symbol.for(`react.early_return_sentinel`);bb0:{let e=V&&typeof V==`object`&&!Array.isArray(V)?Object.entries(V):[],o;t[30]!==i||t[31]!==P?(o=P?.readme?.trim()||(P?.description?.trim()?`### ${P.name}\n\n${P.description}`:`*${i.marketplaceNoReadme}*`),t[30]=i,t[31]=P,t[32]=o):o=t[32];let c=o;if(P?.format===`agent-plugin`){let e;if(t[33]!==P||t[34]!==a||t[35]!==n){let r;t[37]!==P||t[38]!==n?(r=e=>e.provenance?.packageName===n||e.pluginId===P.manifest?.name,t[37]=P,t[38]=n,t[39]=r):r=t[39],e=a.find(r),t[33]=P,t[34]=a,t[35]=n,t[36]=e}else e=t[36];let i=`store:${n}`,o;t[40]!==r||t[41]!==P||t[42]!==s||t[43]!==e||t[44]!==i?(o=(0,$.jsx)(ie,{extension:e,initialSource:i,marketplace:P,autoInstall:r,onClose:s}),t[40]=r,t[41]=P,t[42]=s,t[43]=e,t[44]=i,t[45]=o):o=t[45],te=o;break bb0}U=g,W=!0,t[46]===s?G=t[47]:(G=e=>!e&&s(),t[46]=s,t[47]=G),ee=p,t[48]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,$.jsx)(d,{className:`xopc-dialog-overlay fixed inset-0 z-[130] bg-scrim`}),t[48]=X):X=t[48],H=m,ne=`xopc-dialog-content fixed left-1/2 top-1/2 z-[131] flex h-[min(44rem,calc(100vh-1.5rem))] w-[min(42rem,calc(100vw-1.5rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay`,J=Ee;let l;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsx)(_,{className:`size-5`}),t[49]=l):l=t[49];let u;t[50]!==i.detailBack||t[51]!==s?(u=(0,$.jsx)(`button`,{type:`button`,onClick:s,className:`inline-flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":i.detailBack,children:l}),t[50]=i.detailBack,t[51]=s,t[52]=u):u=t[52];let f;t[53]===i.marketplaceDetailTitle?f=t[54]:(f=(0,$.jsx)(h,{className:`min-w-0 flex-1 truncate text-center text-sm font-semibold text-fg`,children:i.marketplaceDetailTitle}),t[53]=i.marketplaceDetailTitle,t[54]=f);let v;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsx)(j,{className:`size-5`}),t[55]=v):v=t[55];let y;t[56]!==i.detailClose||t[57]!==s?(y=(0,$.jsx)(`button`,{type:`button`,onClick:s,className:`inline-flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":i.detailClose,children:v}),t[56]=i.detailClose,t[57]=s,t[58]=y):y=t[58],t[59]!==u||t[60]!==f||t[61]!==y?(Y=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3`,children:[u,f,y]}),t[59]=u,t[60]=f,t[61]=y,t[62]=Y):Y=t[62],K=`min-h-0 flex-1 overflow-y-auto p-5`,q=I&&!P?(0,$.jsxs)(`div`,{className:`space-y-4`,"aria-label":i.marketplaceLoading,children:[(0,$.jsx)(N,{className:`h-6 w-48`}),(0,$.jsx)(N,{className:`h-4 w-28`}),(0,$.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,$.jsx)(N,{className:`h-12`}),(0,$.jsx)(N,{className:`h-12`})]}),(0,$.jsx)(N,{className:`h-28 w-full`}),(0,$.jsx)(N,{className:`h-36 w-full`})]}):F?(0,$.jsxs)(`div`,{className:`rounded-lg border border-red-300/70 bg-red-50 p-4 text-sm dark:border-red-900 dark:bg-red-950/30`,children:[(0,$.jsx)(`p`,{className:`font-medium text-red-700 dark:text-red-300`,children:i.marketplaceDetailLoadFailed}),(0,$.jsx)(`p`,{className:`mt-1 break-words text-red-600 dark:text-red-400`,children:F instanceof Error?F.message:i.marketplaceLoadFailed})]}):P?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`h3`,{className:`text-lg font-semibold text-fg`,children:P.name}),(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:(0,$.jsx)(`code`,{className:`rounded bg-surface-panel px-1 py-0.5`,children:P.id})}),(0,$.jsxs)(`dl`,{className:`mt-3 grid gap-2 text-xs text-fg-muted sm:grid-cols-2`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`font-medium text-fg`,children:i.marketplaceAuthor}),(0,$.jsx)(`dd`,{children:P.author.username})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`font-medium text-fg`,children:i.marketplaceVersion}),(0,$.jsx)(`dd`,{children:P.latestVersion.version})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`font-medium text-fg`,children:i.marketplaceDownloads}),(0,$.jsx)(`dd`,{children:P.downloads})]})]}),(0,$.jsx)(re,{data:P,zh:b===`zh`}),R===`bundled`?null:(0,$.jsxs)(`section`,{className:`mt-5 space-y-3 rounded-lg border border-edge bg-surface-base p-4`,children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[P.installability.available?(0,$.jsx)(O,{className:`mt-0.5 size-5 shrink-0 text-emerald-600 dark:text-emerald-400`,"aria-hidden":!0}):(0,$.jsx)(A,{className:`mt-0.5 size-5 shrink-0 text-amber-600 dark:text-amber-400`,"aria-hidden":!0}),(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`h4`,{className:`text-sm font-semibold text-fg`,children:P.installability.available?i.marketplaceRiskTitle:i.marketplaceUnavailableTitle}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-fg-muted`,children:P.installability.available?i.marketplaceCodeRisk:P.installability.reason??i.marketplaceUnavailableBody})]})]}),P.installability.available?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`dl`,{className:`grid gap-2 text-xs text-fg-muted sm:grid-cols-2`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`font-medium text-fg`,children:i.marketplaceIntegrity}),(0,$.jsx)(`dd`,{children:i.marketplaceIntegrityVerified})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`font-medium text-fg`,children:i.marketplaceDependencies}),(0,$.jsx)(`dd`,{children:P.packageSummary?.dependencyCount??0})]})]}),(0,$.jsxs)(`div`,{className:`text-xs text-fg-muted`,children:[(0,$.jsx)(`p`,{className:`font-medium text-fg`,children:i.marketplacePermissions}),e.length>0?(0,$.jsx)(`ul`,{className:`mt-1 space-y-1`,children:e.map(Te)}):(0,$.jsx)(`p`,{className:`mt-1`,children:i.marketplacePermissionsNone})]}),(P.packageSummary?.lifecycleScripts.length??0)>0?(0,$.jsxs)(`p`,{className:`text-xs leading-relaxed text-amber-700 dark:text-amber-300`,children:[i.marketplaceLifecycleScripts,`: `,P.packageSummary?.lifecycleScripts.join(`, `)]}):null,(0,$.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-2 text-sm text-fg`,children:[(0,$.jsx)(`input`,{type:`checkbox`,checked:x,onChange:e=>S(e.target.checked),className:`mt-0.5 size-4 rounded border-edge accent-[var(--color-accent)]`}),(0,$.jsx)(`span`,{children:i.marketplaceRiskConfirm})]})]}):null]}),P.readme?.trim()?(0,$.jsx)(`h4`,{className:`mb-2 mt-6 text-sm font-semibold text-fg`,children:i.marketplaceDetailReadmeHeading}):null,(0,$.jsx)(`div`,{className:`markdown-content min-w-0 break-words text-sm`,children:(0,$.jsx)(w,{content:c})})]}):null}t[6]=r,t[7]=i,t[8]=P,t[9]=F,t[10]=a,t[11]=R,t[12]=I,t[13]=b,t[14]=s,t[15]=n,t[16]=V,t[17]=x,t[18]=H,t[19]=ee,t[20]=U,t[21]=W,t[22]=G,t[23]=te,t[24]=K,t[25]=q,t[26]=ne,t[27]=J,t[28]=Y,t[29]=X}else H=t[18],ee=t[19],U=t[20],W=t[21],G=t[22],te=t[23],K=t[24],q=t[25],ne=t[26],J=t[27],Y=t[28],X=t[29];if(te!==Symbol.for(`react.early_return_sentinel`))return te;let Z;t[63]!==K||t[64]!==q?(Z=(0,$.jsx)(`div`,{className:K,children:q}),t[63]=K,t[64]=q,t[65]=Z):Z=t[65];let ae;t[66]!==v||t[67]!==i.marketplaceBuiltinGoBuiltin||t[68]!==i.marketplaceBuiltinManageHint||t[69]!==i.marketplaceInstall||t[70]!==i.marketplaceReinstall||t[71]!==i.marketplaceReinstallConfirm||t[72]!==i.marketplaceUninstall||t[73]!==i.marketplaceUninstallConfirm||t[74]!==P||t[75]!==R||t[76]!==s||t[77]!==u||t[78]!==f||t[79]!==n||t[80]!==x||t[81]!==B?(ae=P?(0,$.jsx)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-end gap-2 border-t border-edge-subtle px-5 py-4`,children:R===`bundled`?(0,$.jsxs)(`div`,{className:`flex w-full flex-col items-stretch gap-2`,children:[(0,$.jsx)(`p`,{className:`text-sm leading-relaxed text-fg-muted`,children:i.marketplaceBuiltinManageHint}),(0,$.jsx)(o,{to:`/capabilities/extensions?tab=builtin`,onClick:s,className:`inline-flex w-fit items-center justify-center rounded-lg border border-edge px-3 py-2 text-sm font-medium text-fg hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:i.marketplaceBuiltinGoBuiltin})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`button`,{type:`button`,disabled:v||!P.installability.available||!x,onClick:()=>{B&&!window.confirm(i.marketplaceReinstallConfirm)||(y(!0),u(n,B).catch(we).finally(()=>y(!1)))},className:M(`inline-flex items-center justify-center gap-1.5 rounded-lg px-3 py-2 text-sm font-medium`,`bg-accent text-on-accent shadow-surface hover:bg-accent-hover`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`,`disabled:pointer-events-none disabled:opacity-50`),children:[v?(0,$.jsx)(C,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,B?i.marketplaceReinstall:i.marketplaceInstall]}),B?(0,$.jsxs)(`button`,{type:`button`,disabled:v,onClick:()=>{window.confirm(i.marketplaceUninstallConfirm)&&(y(!0),f(n).then(()=>s()).catch(Ce).finally(()=>y(!1)))},className:M(`inline-flex items-center justify-center gap-1.5 rounded-lg border border-edge px-3 py-2 text-sm font-medium text-fg`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,`disabled:pointer-events-none disabled:opacity-50`),children:[(0,$.jsx)(k,{className:`size-4 shrink-0`,"aria-hidden":!0}),i.marketplaceUninstall]}):null]})}):null,t[66]=v,t[67]=i.marketplaceBuiltinGoBuiltin,t[68]=i.marketplaceBuiltinManageHint,t[69]=i.marketplaceInstall,t[70]=i.marketplaceReinstall,t[71]=i.marketplaceReinstallConfirm,t[72]=i.marketplaceUninstall,t[73]=i.marketplaceUninstallConfirm,t[74]=P,t[75]=R,t[76]=s,t[77]=u,t[78]=f,t[79]=n,t[80]=x,t[81]=B,t[82]=ae):ae=t[82];let se;t[83]!==H||t[84]!==Z||t[85]!==ae||t[86]!==ne||t[87]!==J||t[88]!==Y?(se=(0,$.jsxs)(H,{className:ne,onOpenAutoFocus:J,children:[Y,Z,ae]}),t[83]=H,t[84]=Z,t[85]=ae,t[86]=ne,t[87]=J,t[88]=Y,t[89]=se):se=t[89];let ce;t[90]!==ee||t[91]!==se||t[92]!==X?(ce=(0,$.jsxs)(ee,{children:[X,se]}),t[90]=ee,t[91]=se,t[92]=X,t[93]=ce):ce=t[93];let le;return t[94]!==U||t[95]!==W||t[96]!==G||t[97]!==ce?(le=(0,$.jsx)(U,{defaultOpen:W,onOpenChange:G,children:ce}),t[94]=U,t[95]=W,t[96]=G,t[97]=ce,t[98]=le):le=t[98],le}function Ce(){}function we(){}function Te(e){let[t,n]=e;return(0,$.jsxs)(`li`,{className:`break-words`,children:[(0,$.jsx)(`code`,{children:t}),`: `,Array.isArray(n)?n.join(`, `):String(n)]},t)}function Ee(e){return e.preventDefault()}function De(e){return!!e.conversationId}function Oe(e){return e.language}function ke({embedded:e=!1,onHeaderActionChange:t}){let n=s(),r=i(),c=l(e=>e.language),d=u(c),f=U(e=>e.setPageHeader),p=U(e=>e.clearPageHeader),m=I(),h=P(),[g,_]=a(),y=ve(g.get(`tab`)??(m.some(e=>e.source!==`bundled`)?`user`:null)),b=(0,Q.useRef)(!1),S=g.get(`q`)??``,[C,w]=(0,Q.useState)(y),[T,D]=(0,Q.useState)(S),[O,k]=(0,Q.useState)(null),[A,j]=(0,Q.useState)(!1),N=g.toString(),F=(0,Q.useRef)(N);if(F.current!==N){F.current=N;let e=ve(g.get(`tab`)),t=g.get(`q`)??``;w(t=>t===e?t:e),D(e=>e===t?e:t)}(0,Q.useEffect)(()=>{_(e=>{let t=new URLSearchParams(e),n=T.trim();return n?t.set(`q`,n):t.delete(`q`),C===`marketplace`?t.delete(`tab`):t.set(`tab`,C),t.toString()===e.toString()?e:t},{replace:!0})},[C,T,_]);let L=(0,Q.useMemo)(()=>m.filter(e=>e.source===`bundled`),[m]),R=(0,Q.useMemo)(()=>m.filter(e=>e.source!==`bundled`),[m]);(0,Q.useEffect)(()=>{h||b.current||(b.current=!0,!g.has(`tab`)&&R.length&&w(`user`))},[h,g,R.length]);let z=C===`builtin`?L:R,B=(0,Q.useMemo)(()=>{let e=T.trim().toLowerCase(),t=z;return e&&(t=t.filter(t=>(t.name??``).toLowerCase().includes(e)||t.id.toLowerCase().includes(e)||(t.description??``).toLowerCase().includes(e))),t.toSorted((e,t)=>e.hasUi===t.hasUi?(e.name||e.id).localeCompare(t.name||t.id,c):e.hasUi?-1:1)},[z,T,c]);(0,Q.useEffect)(()=>{k(e=>{if(!e)return e;let t=m.find(t=>t.id===e.id);return t?Ae(e)===Ae(t)&&e.active===t.active&&JSON.stringify(e)===JSON.stringify(t)?e:t:null})},[m]);let W=(0,Q.useMemo)(()=>({searchLabel:C===`marketplace`?d.extensionsPage.marketplaceSearchPlaceholder:d.extensionsPage.searchPlaceholder,search:(0,$.jsx)(le,{value:T,onChange:D,placeholder:C===`marketplace`?d.extensionsPage.marketplaceSearchPlaceholder:d.extensionsPage.searchPlaceholder}),overflow:(0,$.jsxs)(G,{children:[(0,$.jsx)(te,{asChild:!0,children:(0,$.jsx)(V,{variant:`secondary`,className:`size-9 shrink-0 p-0`,"aria-label":d.capabilitiesHub.moreActions,title:d.capabilitiesHub.moreActions,children:(0,$.jsx)(x,{className:`size-4`,"aria-hidden":!0})})}),(0,$.jsx)(K,{children:(0,$.jsxs)(ne,{align:`end`,sideOffset:6,className:`z-50 min-w-48 rounded-xl border border-edge bg-surface-overlay p-1 shadow-popover`,children:[(0,$.jsxs)(q,{className:M(`touch-target flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover`,H.transition),onSelect:()=>j(!0),children:[(0,$.jsx)(E,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),c.startsWith(`zh`)?`安装插件`:`Install plugin`]}),(0,$.jsx)(q,{asChild:!0,children:(0,$.jsxs)(o,{to:`/local-apps`,className:M(`touch-target flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover`,H.transition),children:[(0,$.jsx)(v,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),d.extensionsPage.openLocalApps]})})]})})]}),primary:(0,$.jsx)(V,{asChild:!0,variant:`primary`,className:`h-9 shrink-0`,children:(0,$.jsxs)(o,{to:`/local-apps/new`,"aria-label":d.extensionsPage.createLocalApp,children:[(0,$.jsx)(E,{className:`size-4`,"aria-hidden":!0}),(0,$.jsx)(`span`,{className:`hidden sm:inline`,children:d.extensionsPage.createLocalApp})]})})}),[c,d.capabilitiesHub.moreActions,d.extensionsPage,C,T]);(0,Q.useLayoutEffect)(()=>e?(t?.(W),()=>t?.(null)):(f({startExtra:null,main:(0,$.jsx)(`div`,{className:`min-w-0`,children:(0,$.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:d.extensionsPage.title})}),end:(0,$.jsx)(ue,{contribution:W})}),()=>p()),[p,e,W,d.extensionsPage.title,t,f]);let re=[{id:`user`,label:d.extensionsPage.tabUser,count:h?void 0:R.length},{id:`marketplace`,label:d.extensionsPage.tabMarketplace},{id:`builtin`,label:d.extensionsPage.tabBuiltin,count:h?void 0:L.length}];return(0,$.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col bg-surface-panel`,children:[(0,$.jsxs)(`div`,{className:M(`mx-auto w-full max-w-7xl px-4 sm:px-6 lg:px-8`,`pb-7 pt-3 lg:pb-9 lg:pt-4`),children:[(0,$.jsx)(`div`,{className:`mb-6 border-b border-edge-subtle pb-3`,children:(0,$.jsx)(ee,{items:re,activeTab:C,onChange:w,ariaLabel:d.extensionsPage.extensionsNavAria,tabIdPrefix:`extensions-tab`,panelIdPrefix:`extensions-panel`,className:`flex-wrap`})}),C===`marketplace`?(0,$.jsx)(xe,{query:T}):h?(0,$.jsx)(Le,{}):C===`builtin`&&L.length===0?(0,$.jsx)(ze,{message:d.extensionsPage.emptyBuiltin}):C===`user`&&R.length===0?(0,$.jsx)(ze,{message:d.extensionsPage.emptyUser}):B.length===0?(0,$.jsx)(`p`,{className:`px-3 py-14 text-center text-sm text-fg-muted sm:px-5 xl:px-6`,children:d.extensionsPage.noSearchResults}):(0,$.jsx)(`div`,{className:he,children:B.map(e=>(0,$.jsx)(Ne,{extension:e,copy:d.extensionsPage,onOpen:()=>e.pluginId?n(Y(e.pluginId,`installed`,!1,r.pathname+r.search)):k(e)},e.id))})]}),O?O.format===`agent-plugin`?(0,$.jsx)(ie,{extension:O,onClose:()=>k(null)},O.id):(0,$.jsx)(Fe,{extension:O,copy:d.extensionsPage,onClose:()=>k(null)},O.id):null,A?(0,$.jsx)(ie,{onClose:()=>j(!1)}):null]})}function Ae(e){return e.activationEligible??e.active}function je(e,t){return e.source===`bundled`?t.providerBundled:e.source===`global`?t.providerGlobal:e.source===`workspace`?t.providerWorkspace:t.providerOther}function Me(e,t){let n=Ae(e);return n&&e.active?t.runStateLive:n&&!e.active?t.runStatePendingOn:!n&&e.active?t.runStatePendingOff:t.runStateOff}function Ne(e){let t=(0,me.c)(56),{extension:n,copy:r,onOpen:a}=e,o=l(Pe),c,u;t[0]!==n||t[1]!==o?(u=o.startsWith(`zh`),c=de(n,u),t[0]=n,t[1]=o,t[2]=c,t[3]=u):(c=t[2],u=t[3]);let d=c,f;t[4]===n?f=t[5]:(f=fe(n),t[4]=n,t[5]=f);let p=f,m=n.localizations?.[u?`zh-CN`:`en`]?.description??n.description,h=s(),g=i(),_;t[6]===n?_=t[7]:(_=!!n.pluginId&&pe(n),t[6]=n,t[7]=_);let b=_,x=p?u?`去授权`:`Connect account`:b?u?`开始使用`:`Start using`:u?`管理插件`:`Manage plugin`,S;t[8]!==b||t[9]!==n.pluginId||t[10]!==g||t[11]!==d||t[12]!==h||t[13]!==p||t[14]!==a||t[15]!==u?(S=()=>{b?h(J(d,u,n.pluginId)):p&&n.pluginId?h(Y(n.pluginId,`installed`,!0,g.pathname+g.search)):a()},t[8]=b,t[9]=n.pluginId,t[10]=g,t[11]=d,t[12]=h,t[13]=p,t[14]=a,t[15]=u,t[16]=S):S=t[16];let C=S,w=`${d}, ${r.marketplaceDetailTitle}`,T;t[17]!==a||t[18]!==w?(T=(0,$.jsx)(`button`,{type:`button`,"aria-label":w,onClick:a,className:_e}),t[17]=a,t[18]=w,t[19]=T):T=t[19];let E=n.branding?.iconUrl,D;t[20]===E?D=t[21]:(D=(0,$.jsx)(X,{iconUrl:E,fallback:v}),t[20]=E,t[21]=D);let O;t[22]===d?O=t[23]:(O=(0,$.jsx)(`h2`,{className:`line-clamp-2 break-words font-semibold leading-snug text-fg`,title:d,children:d}),t[22]=d,t[23]=O);let k;t[24]===n.provenance?.publisherVerification?k=t[25]:(k=n.provenance?.publisherVerification===`verified`?(0,$.jsx)(y,{className:`mt-0.5 size-3.5 shrink-0 text-emerald-600 dark:text-emerald-400`,strokeWidth:1.75,"aria-label":`Verified`}):null,t[24]=n.provenance?.publisherVerification,t[25]=k);let A;t[26]!==O||t[27]!==k?(A=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-start gap-1.5`,children:[O,k]}),t[26]=O,t[27]=k,t[28]=A):A=t[28];let j;t[29]===n.version?j=t[30]:(j=n.version?(0,$.jsxs)(`span`,{children:[`v`,n.version]}):null,t[29]=n.version,t[30]=j);let M=p?`text-amber-700 dark:text-amber-400`:`text-fg-muted`,N=p?u?`需要授权`:`Authorization required`:Ae(n)?r.statusEnabled:r.runStateOff,P;t[31]!==M||t[32]!==N?(P=(0,$.jsx)(`span`,{className:M,children:N}),t[31]=M,t[32]=N,t[33]=P):P=t[33];let F;t[34]!==j||t[35]!==P?(F=(0,$.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-fg-subtle`,children:[j,P]}),t[34]=j,t[35]=P,t[36]=F):F=t[36];let I;t[37]!==A||t[38]!==F?(I=(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[A,F]}),t[37]=A,t[38]=F,t[39]=I):I=t[39];let L;t[40]!==x||t[41]!==C?(L=(0,$.jsx)(`div`,{className:`pointer-events-auto relative z-10 flex max-w-[45%] shrink-0 items-start`,children:(0,$.jsx)(`button`,{type:`button`,onClick:C,className:`inline-flex items-center justify-center rounded-lg border border-edge px-3 py-2 text-xs font-medium text-fg transition-colors hover:bg-surface-hover active:scale-[0.98] active:bg-surface-hover/80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:x})}),t[40]=x,t[41]=C,t[42]=L):L=t[42];let R;t[43]!==I||t[44]!==L||t[45]!==D?(R=(0,$.jsxs)(`div`,{className:`pointer-events-none relative flex items-start gap-3`,children:[D,I,L]}),t[43]=I,t[44]=L,t[45]=D,t[46]=R):R=t[46];let z;t[47]!==r.cardNoDescription||t[48]!==m?(z=m?.trim()||r.cardNoDescription,t[47]=r.cardNoDescription,t[48]=m,t[49]=z):z=t[49];let B;t[50]===z?B=t[51]:(B=(0,$.jsx)(`p`,{className:`pointer-events-none relative mt-3 line-clamp-3 text-sm leading-relaxed text-fg-muted`,children:z}),t[50]=z,t[51]=B);let V;return t[52]!==R||t[53]!==B||t[54]!==T?(V=(0,$.jsxs)(`article`,{className:ge,children:[T,R,B]}),t[52]=R,t[53]=B,t[54]=T,t[55]=V):V=t[55],V}function Pe(e){return e.language}function Fe({extension:e,copy:t,onClose:n}){let{mutate:r}=R(),[i,a]=(0,Q.useState)(null),[s,c]=(0,Q.useState)(null),[l,u]=(0,Q.useState)(!1),v=e.activationEligible===!0,y=(0,Q.useCallback)(async()=>{c(null),u(!1),a(`toggle`);try{let{requiresGatewayRestart:t}=await ae({extensionId:e.id,enabled:!v});await r(`gateway-extensions-list`),B(),u(t)}catch(e){c(e instanceof Error?e.message:t.extensionToggleFailed)}finally{a(null)}},[v,t.extensionToggleFailed,e.id,r]),x=(0,Q.useCallback)(async()=>{if(!(e.source===`bundled`||!window.confirm(t.extensionUninstallConfirm))){c(null),u(!1),a(`uninstall`);try{await Z(e.id),await r(`gateway-extensions-list`),B(),n()}catch(e){c(e instanceof Error?e.message:t.marketplaceUninstallFailed),a(null)}}},[t.extensionUninstallConfirm,t.marketplaceUninstallFailed,e.id,e.source,r,n]),w=e.ui?.contributions?.pages??[],T=e.ui?.contributions?.settingsPanels??[],E=e.ui?.contributions?.chatWidgets??[],O=w.find(e=>e.showInNav)??w[0],A=T[0],N=O?b(e.id,O):null,P=A?`/settings/ext/${e.id}/${A.id}`:e.hasConfigSchema||F(e)?`/settings/ext/${e.id}`:null;return(0,$.jsx)(g,{defaultOpen:!0,onOpenChange:e=>!e&&n(),children:(0,$.jsxs)(p,{children:[(0,$.jsx)(d,{className:`xopc-dialog-overlay fixed inset-0 z-[130] bg-scrim`}),(0,$.jsxs)(m,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[131] flex max-h-[min(90vh,44rem)] w-[min(42rem,calc(100vw-1.5rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay`,onOpenAutoFocus:e=>e.preventDefault(),children:[(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3`,children:[(0,$.jsx)(`button`,{type:`button`,onClick:n,className:`inline-flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":t.detailBack,children:(0,$.jsx)(_,{className:`size-5`})}),(0,$.jsx)(h,{className:`min-w-0 flex-1 truncate text-center text-sm font-semibold text-fg`,children:t.detailTitle}),(0,$.jsxs)(f,{className:`sr-only`,children:[e.name,` (`,e.id,`)`]}),(0,$.jsx)(`button`,{type:`button`,onClick:n,className:`inline-flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":t.detailClose,children:(0,$.jsx)(j,{className:`size-5`})})]}),(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-start gap-4`,children:[(0,$.jsx)(`div`,{className:`flex size-16 shrink-0 items-center justify-center rounded-2xl bg-accent-soft text-xl font-semibold text-accent-fg`,"aria-hidden":!0,children:(e.name||e.id).charAt(0).toUpperCase()}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`h3`,{className:`text-lg font-semibold text-fg`,children:e.name}),(0,$.jsxs)(`p`,{className:`mt-0.5 text-sm text-fg-muted`,children:[t.detailProviderPrefix,` `,je(e,t)]}),e.version?(0,$.jsxs)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:[`v`,e.version]}):null]})]}),(0,$.jsx)(`p`,{className:`mt-5 text-sm leading-relaxed text-fg`,children:e.description?.trim()||t.detailNoDescription}),e.hasUi?null:(0,$.jsx)(`p`,{className:`mt-3 text-xs text-fg-muted`,children:t.backendOnlyHint}),(0,$.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:Me(e,t)}),e.source===`bundled`?(0,$.jsx)(`p`,{className:`mt-4 rounded-lg bg-surface-hover/40 px-3 py-2 text-xs text-fg-muted shadow-surface dark:bg-surface-hover/20`,children:t.builtinConfigHint}):null,(0,$.jsxs)(`div`,{className:`mt-3 rounded-lg bg-surface-hover/40 p-3 shadow-surface dark:bg-surface-hover/20`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,$.jsx)(`span`,{className:`text-xs font-medium text-fg`,children:t.builtinRuntimeToggle}),(0,$.jsx)(V,{type:`button`,variant:`secondary`,disabled:i!==null,onClick:()=>void y(),className:`shrink-0 py-1.5 text-xs`,children:i===`toggle`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(C,{className:`mr-1.5 size-3.5 shrink-0 animate-spin`,"aria-hidden":!0}),t.builtinToggleBusy]}):v?t.builtinToggleDisable:t.builtinToggleEnable})]}),s?(0,$.jsx)(`p`,{className:`mt-2 text-xs text-rose-600 dark:text-rose-400`,children:s}):null,l?(0,$.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:t.builtinToggleRestartHint}):null,e.source===`bundled`?null:(0,$.jsx)(`div`,{className:`mt-3 flex justify-end border-t border-edge-subtle pt-3`,children:(0,$.jsxs)(V,{type:`button`,variant:`ghost`,disabled:i!==null,onClick:()=>void x(),className:`text-danger hover:bg-danger-soft hover:text-danger`,children:[i===`uninstall`?(0,$.jsx)(C,{className:`size-3.5 animate-spin`,"aria-hidden":!0}):(0,$.jsx)(k,{className:`size-3.5`,"aria-hidden":!0}),t.marketplaceUninstall]})})]}),e.hasUi&&(w.length>0||T.length>0||E.length>0)?(0,$.jsxs)(`section`,{className:`mt-8`,children:[(0,$.jsx)(`h4`,{className:`mb-3 text-sm font-semibold text-fg`,children:t.detailSectionFeatures}),(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[(0,$.jsx)(Ie,{template:t.badgePages,count:w.length,hidden:w.length===0}),(0,$.jsx)(Ie,{template:t.badgeSettings,count:T.length,hidden:T.length===0}),(0,$.jsx)(Ie,{template:t.badgeWidgets,count:E.length,hidden:E.length===0})]})]}):null,L(e)&&(N||P)?(0,$.jsxs)(`div`,{className:`mt-6 flex flex-wrap gap-2 border-t border-edge-subtle pt-4`,children:[N?(0,$.jsxs)(o,{to:N,onClick:n,className:M(`inline-flex items-center gap-1.5 rounded-lg border border-edge px-3 py-2 text-sm font-medium text-fg`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`),children:[(0,$.jsx)(S,{className:`size-4 shrink-0 opacity-80`,"aria-hidden":!0}),t.open]}):null,P?(0,$.jsxs)(o,{to:P,onClick:n,className:M(`inline-flex items-center gap-1.5 rounded-lg border border-edge px-3 py-2 text-sm font-medium text-fg`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`),children:[(0,$.jsx)(D,{className:`size-4 shrink-0 opacity-80`,"aria-hidden":!0}),t.openSettings]}):null]}):null,(0,$.jsx)(`p`,{className:`mt-6 text-[11px] leading-relaxed text-fg-muted`,children:t.restartNote})]})]})]})})}function Ie(e){let t=(0,me.c)(6),{template:n,count:r,hidden:i}=e;if(i||r===0)return null;let a;if(t[0]!==r||t[1]!==n){let e;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=/\{\{count\}\}/g,t[3]=e):e=t[3],a=n.replace(e,String(r)),t[0]=r,t[1]=n,t[2]=a}else a=t[2];let o;return t[4]===a?o=t[5]:(o=(0,$.jsx)(`span`,{className:`inline-flex items-center rounded-md bg-surface-hover px-2 py-0.5 text-[11px] font-medium text-fg-muted`,children:a}),t[4]=a,t[5]=o),o}function Le(){let e=(0,me.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(`div`,{className:he,"aria-busy":`true`,children:Array.from({length:6},Re)}),e[0]=t):t=e[0],t}function Re(e,t){return(0,$.jsx)(N,{className:`h-32 rounded-xl`},t)}function ze(e){let t=(0,me.c)(2),{message:n}=e,r;return t[0]===n?r=t[1]:(r=(0,$.jsx)(`div`,{className:`flex min-h-[min(40vh,16rem)] flex-col items-center justify-center rounded-xl border border-edge-subtle bg-surface-base px-4 py-12 text-center shadow-surface`,children:(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n})}),t[0]=n,t[1]=r),r}export{ke as ExtensionsPage};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./messages-DYDySzn1.js";import{t as a}from"./jszip.min-Dj17eJqX.js";import{t as o}from"./preview-open-alternatives-CY_hjK4b.js";var s=n(),c=e(a(),1),l=e(t(),1),u=r();function d(e){let t=(0,s.c)(17),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=[],t[0]=n):n=t[0];let[r,a]=(0,l.useState)(n),[d,m]=(0,l.useState)(null),h,g;if(t[1]===e.binaryBuffer?(h=t[2],g=t[3]):(h=()=>{if(!e.binaryBuffer)return;let t=!1;return c.default.loadAsync(e.binaryBuffer).then(e=>{t||a(Object.values(e.files).slice(0,500).map(p))}).catch(e=>{t||m(e instanceof Error?e.message:String(e))}),()=>{t=!0}},g=[e.binaryBuffer],t[1]=e.binaryBuffer,t[2]=h,t[3]=g),(0,l.useEffect)(h,g),d){let n;t[4]===e.language?n=t[5]:(n=i(e.language),t[4]=e.language,t[5]=n);let r=n,a;t[6]!==r.chat.attachmentPreviewDownloadFull||t[7]!==r.chat.attachmentPreviewOpenElsewhereHint||t[8]!==e.actions.onDownload?(a=(0,u.jsx)(o,{message:r.chat.attachmentPreviewOpenElsewhereHint,downloadLabel:r.chat.attachmentPreviewDownloadFull,onDownload:e.actions.onDownload}),t[6]=r.chat.attachmentPreviewDownloadFull,t[7]=r.chat.attachmentPreviewOpenElsewhereHint,t[8]=e.actions.onDownload,t[9]=a):a=t[9];let s;t[10]===d?s=t[11]:(s=(0,u.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:d}),t[10]=d,t[11]=s);let c;return t[12]!==a||t[13]!==s?(c=(0,u.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 overflow-auto p-4`,children:[a,s]}),t[12]=a,t[13]=s,t[14]=c):c=t[14],c}let _;return t[15]===r?_=t[16]:(_=(0,u.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto p-4`,children:(0,u.jsx)(`div`,{className:`overflow-hidden rounded-lg border border-edge bg-surface-panel`,children:r.length===0?(0,u.jsx)(`p`,{className:`p-4 text-sm text-fg-muted`,children:`Loading archive...`}):(0,u.jsx)(`table`,{className:`w-full text-left text-xs`,children:(0,u.jsx)(`tbody`,{children:r.map(f)})})})}),t[15]=r,t[16]=_),_}function f(e){return(0,u.jsxs)(`tr`,{className:`border-b border-edge-subtle last:border-b-0 dark:border-edge`,children:[(0,u.jsx)(`td`,{className:`max-w-0 truncate px-3 py-2 font-mono text-fg`,title:e.name,children:e.dir?`${e.name}/`:e.name}),(0,u.jsx)(`td`,{className:`w-24 px-3 py-2 text-right text-fg-muted`,children:e.dir?``:m(e.size)})]},e.name)}function p(e){return{name:e.name,dir:e.dir,size:e.dir?0:e._data?.uncompressedSize??0}}function m(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}export{d as ArchivePreviewPluginView};
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./messages-CGO1P4mz.js";import{t as a}from"./jszip.min-Dj17eJqX.js";import{t as o}from"./preview-open-alternatives-CY_hjK4b.js";var s=n(),c=e(a(),1),l=e(t(),1),u=r();function d(e){let t=(0,s.c)(17),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=[],t[0]=n):n=t[0];let[r,a]=(0,l.useState)(n),[d,m]=(0,l.useState)(null),h,g;if(t[1]===e.binaryBuffer?(h=t[2],g=t[3]):(h=()=>{if(!e.binaryBuffer)return;let t=!1;return c.default.loadAsync(e.binaryBuffer).then(e=>{t||a(Object.values(e.files).slice(0,500).map(p))}).catch(e=>{t||m(e instanceof Error?e.message:String(e))}),()=>{t=!0}},g=[e.binaryBuffer],t[1]=e.binaryBuffer,t[2]=h,t[3]=g),(0,l.useEffect)(h,g),d){let n;t[4]===e.language?n=t[5]:(n=i(e.language),t[4]=e.language,t[5]=n);let r=n,a;t[6]!==r.chat.attachmentPreviewDownloadFull||t[7]!==r.chat.attachmentPreviewOpenElsewhereHint||t[8]!==e.actions.onDownload?(a=(0,u.jsx)(o,{message:r.chat.attachmentPreviewOpenElsewhereHint,downloadLabel:r.chat.attachmentPreviewDownloadFull,onDownload:e.actions.onDownload}),t[6]=r.chat.attachmentPreviewDownloadFull,t[7]=r.chat.attachmentPreviewOpenElsewhereHint,t[8]=e.actions.onDownload,t[9]=a):a=t[9];let s;t[10]===d?s=t[11]:(s=(0,u.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:d}),t[10]=d,t[11]=s);let c;return t[12]!==a||t[13]!==s?(c=(0,u.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 overflow-auto p-4`,children:[a,s]}),t[12]=a,t[13]=s,t[14]=c):c=t[14],c}let _;return t[15]===r?_=t[16]:(_=(0,u.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto p-4`,children:(0,u.jsx)(`div`,{className:`overflow-hidden rounded-lg border border-edge bg-surface-panel`,children:r.length===0?(0,u.jsx)(`p`,{className:`p-4 text-sm text-fg-muted`,children:`Loading archive...`}):(0,u.jsx)(`table`,{className:`w-full text-left text-xs`,children:(0,u.jsx)(`tbody`,{children:r.map(f)})})})}),t[15]=r,t[16]=_),_}function f(e){return(0,u.jsxs)(`tr`,{className:`border-b border-edge-subtle last:border-b-0 dark:border-edge`,children:[(0,u.jsx)(`td`,{className:`max-w-0 truncate px-3 py-2 font-mono text-fg`,title:e.name,children:e.dir?`${e.name}/`:e.name}),(0,u.jsx)(`td`,{className:`w-24 px-3 py-2 text-right text-fg-muted`,children:e.dir?``:m(e.size)})]},e.name)}function p(e){return{name:e.name,dir:e.dir,size:e.dir?0:e._data?.uncompressedSize??0}}function m(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}export{d as ArchivePreviewPluginView};
@@ -1 +1 @@
1
- import{i as e,o as t}from"./locale-store-DGtk-KSF.js";var n={get:n=>t(e(`/api/automations/${encodeURIComponent(n)}`)),configuration:n=>t(e(`/api/automations/configuration-conversations/${encodeURIComponent(n)}`)),openConfiguration:n=>t(e(`/api/automations/configuration-conversations`),{method:`POST`,body:JSON.stringify(n)}),tasks:()=>t(e(`/api/tasks?limit=200`)),list:n=>{let r=new URLSearchParams;n?.projectId&&r.set(`projectId`,n.projectId);let i=r.toString();return t(e(`/api/automations${i?`?${i}`:``}`))},metrics:()=>t(e(`/api/automations/metrics`)),draft:(n,r=crypto.randomUUID())=>t(e(`/api/automations/draft`),{method:`POST`,headers:{"Idempotency-Key":r},body:JSON.stringify(n)}),simulate:n=>t(e(`/api/automations/simulate`),{method:`POST`,body:JSON.stringify(n)}),create:n=>t(e(`/api/automations`),{method:`POST`,body:JSON.stringify(n)}),update:(n,r)=>t(e(`/api/automations/${encodeURIComponent(n)}`),{method:`PATCH`,body:JSON.stringify(r)}),remove:n=>t(e(`/api/automations/${encodeURIComponent(n)}`),{method:`DELETE`}),runNow:n=>t(e(`/api/automations/${encodeURIComponent(n)}/run`),{method:`POST`}),pause:n=>t(e(`/api/automations/${encodeURIComponent(n)}/pause`),{method:`POST`}),resume:n=>t(e(`/api/automations/${encodeURIComponent(n)}/resume`),{method:`POST`}),runs:(n=50,r,i)=>{let a=new URLSearchParams({limit:String(n)});return r&&a.set(`automationId`,r),i?.projectId&&a.set(`projectId`,i.projectId),i?.cursor&&a.set(`cursor`,i.cursor),t(e(`/api/automation-runs?${a.toString()}`))},productEventRuns:n=>{let r=new URLSearchParams({eventType:n.eventType,limit:String(n.limit??5)});return n.source&&r.set(`source`,n.source),n.payloadKey&&r.set(`payloadKey`,n.payloadKey),n.payloadValue!==void 0&&r.set(`payloadValue`,n.payloadValue),t(e(`/api/automation-runs/product-events?${r.toString()}`))},events:(n={})=>{let r=new URLSearchParams({limit:String(n.limit??50)});return n.type&&r.set(`type`,n.type),n.source&&r.set(`source`,n.source),t(e(`/api/automation-events?${r.toString()}`))},deliveries:(n={})=>{let r=new URLSearchParams({limit:String(n.limit??50)});return n.runId&&r.set(`runId`,n.runId),n.status&&r.set(`status`,n.status),t(e(`/api/automation-deliveries?${r.toString()}`))},getRun:n=>t(e(`/api/automation-runs/${encodeURIComponent(n)}`)),runEvents:n=>t(e(`/api/automation-runs/${encodeURIComponent(n)}/events`)),rerun:n=>t(e(`/api/automation-runs/${encodeURIComponent(n)}/rerun`),{method:`POST`}),repairDraft:(n,r,i=crypto.randomUUID())=>t(e(`/api/automation-runs/${encodeURIComponent(n)}/repair-draft`),{method:`POST`,headers:{"Idempotency-Key":i},body:JSON.stringify(r)}),cancelRun:n=>t(e(`/api/automation-runs/${encodeURIComponent(n)}/cancel`),{method:`POST`}),markRunRead:n=>t(e(`/api/automation-runs/${encodeURIComponent(n)}/read`),{method:`POST`}),markAllRunsRead:n=>t(e(`/api/automation-runs/read-all${n?`?projectId=${encodeURIComponent(n)}`:``}`),{method:`POST`})};export{n as t};
1
+ import{i as e,o as t}from"./locale-store-Bld7_m-Q.js";var n={get:n=>t(e(`/api/automations/${encodeURIComponent(n)}`)),configuration:n=>t(e(`/api/automations/configuration-conversations/${encodeURIComponent(n)}`)),openConfiguration:n=>t(e(`/api/automations/configuration-conversations`),{method:`POST`,body:JSON.stringify(n)}),tasks:()=>t(e(`/api/tasks?limit=200`)),list:n=>{let r=new URLSearchParams;n?.projectId&&r.set(`projectId`,n.projectId);let i=r.toString();return t(e(`/api/automations${i?`?${i}`:``}`))},metrics:()=>t(e(`/api/automations/metrics`)),draft:(n,r=crypto.randomUUID())=>t(e(`/api/automations/draft`),{method:`POST`,headers:{"Idempotency-Key":r},body:JSON.stringify(n)}),simulate:n=>t(e(`/api/automations/simulate`),{method:`POST`,body:JSON.stringify(n)}),create:n=>t(e(`/api/automations`),{method:`POST`,body:JSON.stringify(n)}),update:(n,r)=>t(e(`/api/automations/${encodeURIComponent(n)}`),{method:`PATCH`,body:JSON.stringify(r)}),remove:n=>t(e(`/api/automations/${encodeURIComponent(n)}`),{method:`DELETE`}),runNow:n=>t(e(`/api/automations/${encodeURIComponent(n)}/run`),{method:`POST`}),pause:n=>t(e(`/api/automations/${encodeURIComponent(n)}/pause`),{method:`POST`}),resume:n=>t(e(`/api/automations/${encodeURIComponent(n)}/resume`),{method:`POST`}),runs:(n=50,r,i)=>{let a=new URLSearchParams({limit:String(n)});return r&&a.set(`automationId`,r),i?.projectId&&a.set(`projectId`,i.projectId),i?.cursor&&a.set(`cursor`,i.cursor),t(e(`/api/automation-runs?${a.toString()}`))},productEventRuns:n=>{let r=new URLSearchParams({eventType:n.eventType,limit:String(n.limit??5)});return n.source&&r.set(`source`,n.source),n.payloadKey&&r.set(`payloadKey`,n.payloadKey),n.payloadValue!==void 0&&r.set(`payloadValue`,n.payloadValue),t(e(`/api/automation-runs/product-events?${r.toString()}`))},events:(n={})=>{let r=new URLSearchParams({limit:String(n.limit??50)});return n.type&&r.set(`type`,n.type),n.source&&r.set(`source`,n.source),t(e(`/api/automation-events?${r.toString()}`))},deliveries:(n={})=>{let r=new URLSearchParams({limit:String(n.limit??50)});return n.runId&&r.set(`runId`,n.runId),n.status&&r.set(`status`,n.status),t(e(`/api/automation-deliveries?${r.toString()}`))},getRun:n=>t(e(`/api/automation-runs/${encodeURIComponent(n)}`)),runEvents:n=>t(e(`/api/automation-runs/${encodeURIComponent(n)}/events`)),rerun:n=>t(e(`/api/automation-runs/${encodeURIComponent(n)}/rerun`),{method:`POST`}),repairDraft:(n,r,i=crypto.randomUUID())=>t(e(`/api/automation-runs/${encodeURIComponent(n)}/repair-draft`),{method:`POST`,headers:{"Idempotency-Key":i},body:JSON.stringify(r)}),cancelRun:n=>t(e(`/api/automation-runs/${encodeURIComponent(n)}/cancel`),{method:`POST`}),markRunRead:n=>t(e(`/api/automation-runs/${encodeURIComponent(n)}/read`),{method:`POST`}),markAllRunsRead:n=>t(e(`/api/automation-runs/read-all${n?`?projectId=${encodeURIComponent(n)}`:``}`),{method:`POST`})};export{n as t};
@@ -1 +1 @@
1
- import{n as e,t}from"./vendor-react-BOUWij0V.js";import{i as n}from"./vendor-swr-CdRzEUwF.js";import{t as r}from"./automation-api-paBg5ie6.js";var i=e(),a=t();function o(e,t){let n=t===`zh`;return e.some(e=>e.status===`dead_letter`)?n?`结果已保存,部分通知未能送达。可通过对话排查后重新发送,无需重跑任务。`:`Your result is saved, but a notification could not be sent. Ask in chat to retry delivery without rerunning the task.`:e.some(e=>e.status===`retrying`)?n?`结果已保存,通知正在重试。`:`Your result is saved. Notification delivery is retrying.`:e.some(e=>e.status===`pending`||e.status===`delivering`)?n?`结果已保存,正在发送通知。`:`Your result is saved. Sending notifications.`:null}function s(e){let t=(0,i.c)(11),{runId:s,language:c}=e,l,u;t[0]===s?(l=t[1],u=t[2]):(l=[`automation-result-deliveries`,s],u=()=>r.deliveries({runId:s}),t[0]=s,t[1]=l,t[2]=u);let d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d={refreshInterval:5e3},t[3]=d):d=t[3];let{data:f,error:p}=n(l,u,d),m;t[4]!==f||t[5]!==c?(m=f?o(f.items,c):null,t[4]=f,t[5]=c,t[6]=m):m=t[6];let h=m,g;return t[7]!==p||t[8]!==h||t[9]!==c?(g=h?(0,a.jsx)(`p`,{role:`status`,className:`mt-2 text-xs leading-5 text-fg-muted`,children:h}):p?(0,a.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:c===`zh`?`结果已保存,暂时无法确认通知状态。`:`Your result is saved. Notification status is temporarily unavailable.`}):null,t[7]=p,t[8]=h,t[9]=c,t[10]=g):g=t[10],g}function c(e,t){let n=t===`zh`;return e.error?.includes(`The selected model is unavailable:`)?n?`所选模型不可用,请更换模型或恢复默认模型后重试。`:`The selected model is unavailable. Choose another model or use the default.`:e.error?.startsWith(`Execution assistant is unavailable:`)?n?`执行助手暂不可用,请选择其他助手后重试。`:`The execution assistant is unavailable. Choose another assistant.`:e.status===`timeout`?n?`任务超时未完成,可以通过对话调整后重试。`:`The task timed out. Adjust it in chat and try again.`:e.error??(n?`这次运行未完成,可以通过对话排查原因。`:`This run did not finish. Ask in chat to investigate.`)}function l(e,t){return t.reduce((t,n)=>n.automationId===e&&(!t||n.createdAtMs>t.createdAtMs)?n:t,void 0)}function u(e,t){let n=l(e.id,t),r=!!(e.state.lastRunAtMs&&(!n||e.state.lastRunAtMs>n.createdAtMs)),i=r?e.state.lastRunStatus:n?.status??e.state.lastRunStatus;return i!==`failed`&&i!==`timeout`?null:`${i}:${(r?e.state.lastRunAtMs:n?.createdAtMs??e.state.lastRunAtMs)??`unknown`}`}function d(e,t){return u(e,t)!==null}export{s as i,d as n,c as r,u as t};
1
+ import{n as e,t}from"./vendor-react-BOUWij0V.js";import{i as n}from"./vendor-swr-CdRzEUwF.js";import{t as r}from"./automation-api-Dl9fi8t0.js";var i=e(),a=t();function o(e,t){let n=t===`zh`;return e.some(e=>e.status===`dead_letter`)?n?`结果已保存,部分通知未能送达。可通过对话排查后重新发送,无需重跑任务。`:`Your result is saved, but a notification could not be sent. Ask in chat to retry delivery without rerunning the task.`:e.some(e=>e.status===`retrying`)?n?`结果已保存,通知正在重试。`:`Your result is saved. Notification delivery is retrying.`:e.some(e=>e.status===`pending`||e.status===`delivering`)?n?`结果已保存,正在发送通知。`:`Your result is saved. Sending notifications.`:null}function s(e){let t=(0,i.c)(11),{runId:s,language:c}=e,l,u;t[0]===s?(l=t[1],u=t[2]):(l=[`automation-result-deliveries`,s],u=()=>r.deliveries({runId:s}),t[0]=s,t[1]=l,t[2]=u);let d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d={refreshInterval:5e3},t[3]=d):d=t[3];let{data:f,error:p}=n(l,u,d),m;t[4]!==f||t[5]!==c?(m=f?o(f.items,c):null,t[4]=f,t[5]=c,t[6]=m):m=t[6];let h=m,g;return t[7]!==p||t[8]!==h||t[9]!==c?(g=h?(0,a.jsx)(`p`,{role:`status`,className:`mt-2 text-xs leading-5 text-fg-muted`,children:h}):p?(0,a.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:c===`zh`?`结果已保存,暂时无法确认通知状态。`:`Your result is saved. Notification status is temporarily unavailable.`}):null,t[7]=p,t[8]=h,t[9]=c,t[10]=g):g=t[10],g}function c(e,t){let n=t===`zh`;return e.error?.includes(`The selected model is unavailable:`)?n?`所选模型不可用,请更换模型或恢复默认模型后重试。`:`The selected model is unavailable. Choose another model or use the default.`:e.error?.startsWith(`Execution assistant is unavailable:`)?n?`执行助手暂不可用,请选择其他助手后重试。`:`The execution assistant is unavailable. Choose another assistant.`:e.status===`timeout`?n?`任务超时未完成,可以通过对话调整后重试。`:`The task timed out. Adjust it in chat and try again.`:e.error??(n?`这次运行未完成,可以通过对话排查原因。`:`This run did not finish. Ask in chat to investigate.`)}function l(e,t){return t.reduce((t,n)=>n.automationId===e&&(!t||n.createdAtMs>t.createdAtMs)?n:t,void 0)}function u(e,t){let n=l(e.id,t),r=!!(e.state.lastRunAtMs&&(!n||e.state.lastRunAtMs>n.createdAtMs)),i=r?e.state.lastRunStatus:n?.status??e.state.lastRunStatus;return i!==`failed`&&i!==`timeout`?null:`${i}:${(r?e.state.lastRunAtMs:n?.createdAtMs??e.state.lastRunAtMs)??`unknown`}`}function d(e,t){return u(e,t)!==null}export{s as i,d as n,c as r,u as t};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{t as a}from"./messages-DYDySzn1.js";import{t as o}from"./createLucideIcon-DPHK1VkS.js";import{t as s}from"./cn-0WouolD0.js";import{t as c}from"./skeleton-BI5TyibZ.js";import{i as l,t as u}from"./vendor-swr-CdRzEUwF.js";import{t as d}from"./automation-api-paBg5ie6.js";var f=o(`check-check`,[[`path`,{d:`M18 6 7 17l-5-5`,key:`116fxf`}],[`path`,{d:`m22 10-7.5 7.5L13 16`,key:`ke71qq`}]]),p=o(`list-tree`,[[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`M3 10a2 2 0 0 0 2 2h3`,key:`1npucw`}],[`path`,{d:`M3 5v12a2 2 0 0 0 2 2h3`,key:`x1gjn2`}]]),m=n(),h=e(t(),1),g=r(),_=e=>[`queued`,`running`,`cancelling`].includes(e.status);function v(e){let t=(0,m.c)(66),{automationId:n,projectId:r,language:o,selectedRunId:f,selectedRun:p,enabled:v,runHref:C,onSelectRun:w}=e,T=v===void 0||v,[E,D]=(0,h.useState)(!1),O=o===`zh`,k;t[0]!==T||t[1]!==p||t[2]!==f?(k=T&&f&&!p?[`automation-navigation-selected-run`,f]:null,t[0]=T,t[1]=p,t[2]=f,t[3]=k):k=t[3];let A;t[4]===f?A=t[5]:(A=()=>d.getRun(f),t[4]=f,t[5]=A);let j;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(j={revalidateOnFocus:!1,shouldRetryOnError:!1},t[6]=j):j=t[6];let{data:M}=l(k,A,j),N=p??M?.run,P;t[7]!==n||t[8]!==T||t[9]!==r?(P=(e,t)=>!T||e&&!t?.nextCursor?null:[`automation-navigation-runs`,n,r??``,e?t.nextCursor:``],t[7]=n,t[8]=T,t[9]=r,t[10]=P):P=t[10];let F;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(F={refreshInterval:x,refreshWhenHidden:!1,refreshWhenOffline:!1,revalidateAll:!0,persistSize:!0},t[11]=F):F=t[11];let{data:I,error:L,size:R,setSize:z,isValidating:B,mutate:V}=u(P,S,F),H,U,W,G,K,q;if(t[12]!==E||t[13]!==n||t[14]!==N||t[15]!==I||t[16]!==L||t[17]!==B||t[18]!==o||t[19]!==w||t[20]!==C||t[21]!==f||t[22]!==R||t[23]!==O){U=[...new Map((I??[]).flatMap(b).map(y)).values()];let e=E?U:U.slice(0,3),r=N?.automationId===n&&!e.some(e=>e.id===N.id)?[N,...e]:e;H=B&&(!I||I.length<R),G=`space-y-1 pb-3 pl-8 pr-2`,K=O?`执行记录`:`Execution history`,t[30]!==I||t[31]!==L?(q=!I&&!L?(0,g.jsxs)(`div`,{"aria-busy":`true`,className:`space-y-2 px-3 py-2`,children:[(0,g.jsx)(c,{className:`h-8`}),(0,g.jsx)(c,{className:`h-8`})]}):null,t[30]=I,t[31]=L,t[32]=q):q=t[32],W=r.map(t=>{let n=s(`w-full rounded-lg px-3 py-2 text-left text-xs text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,f===t.id&&`bg-surface-active text-fg`),r=f===t.id?`true`:void 0,c=(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,g.jsx)(`span`,{children:new Date(t.createdAtMs).toLocaleString(O?`zh-CN`:`en-US`,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}),!_(t)&&t.readAtMs==null?(0,g.jsx)(`span`,{className:`size-1.5 shrink-0 rounded-full bg-accent`,children:(0,g.jsx)(`span`,{className:`sr-only`,children:O?`未读`:`Unread`})}):null]}),N?.id===t.id&&!e.some(e=>e.id===t.id)?(0,g.jsx)(`span`,{className:`block text-accent-fg`,children:O?`当前查看`:`Currently viewing`}):null,(0,g.jsx)(`span`,{className:s(`block`,[`failed`,`timeout`].includes(t.status)&&`text-danger`),children:a(o).automations.status[t.status]})]});return C?(0,g.jsx)(i,{to:C(t),className:s(`block`,n),"aria-current":r,onClick:()=>w(t),children:c},t.id):(0,g.jsx)(`button`,{type:`button`,className:n,"aria-current":r,onClick:()=>w(t),children:c},t.id)}),t[12]=E,t[13]=n,t[14]=N,t[15]=I,t[16]=L,t[17]=B,t[18]=o,t[19]=w,t[20]=C,t[21]=f,t[22]=R,t[23]=O,t[24]=H,t[25]=U,t[26]=W,t[27]=G,t[28]=K,t[29]=q}else H=t[24],U=t[25],W=t[26],G=t[27],K=t[28],q=t[29];let J;t[33]!==I||t[34]!==U||t[35]!==O?(J=I&&U.length===0?(0,g.jsx)(`p`,{className:`px-3 py-2 text-xs text-fg-muted`,children:O?`尚未执行`:`No executions yet`}):null,t[33]=I,t[34]=U,t[35]=O,t[36]=J):J=t[36];let Y;t[37]!==L||t[38]!==V||t[39]!==O?(Y=L?(0,g.jsxs)(`div`,{role:`alert`,className:`px-3 py-2 text-xs text-danger`,children:[(0,g.jsx)(`p`,{children:O?`执行记录加载失败`:`Could not load history`}),(0,g.jsx)(`button`,{type:`button`,className:`w-full rounded-lg px-3 py-2 text-left text-xs text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,onClick:()=>void V(),children:O?`重试`:`Retry`})]}):null,t[37]=L,t[38]=V,t[39]=O,t[40]=Y):Y=t[40];let X;t[41]!==E||t[42]!==I?.[0]?.hasMore||t[43]!==U||t[44]!==O?(X=!E&&(U.length>3||I?.[0]?.hasMore)?(0,g.jsx)(`button`,{type:`button`,className:`w-full rounded-lg px-3 py-2 text-left text-xs text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,onClick:()=>D(!0),children:O?`查看全部执行`:`View all executions`}):null,t[41]=E,t[42]=I?.[0]?.hasMore,t[43]=U,t[44]=O,t[45]=X):X=t[45];let Z;t[46]!==E||t[47]!==I||t[48]!==H||t[49]!==z||t[50]!==R||t[51]!==O?(Z=E&&I?.at(-1)?.hasMore?(0,g.jsx)(`button`,{type:`button`,className:`w-full rounded-lg px-3 py-2 text-left text-xs text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,disabled:H,onClick:()=>void z(R+1),children:H?O?`加载中…`:`Loading…`:O?`加载更多`:`Load more`}):null,t[46]=E,t[47]=I,t[48]=H,t[49]=z,t[50]=R,t[51]=O,t[52]=Z):Z=t[52];let Q;t[53]!==E||t[54]!==O?(Q=E?(0,g.jsx)(`button`,{type:`button`,className:`w-full rounded-lg px-3 py-2 text-left text-xs text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,onClick:()=>D(!1),children:O?`收起历史`:`Show recent`}):null,t[53]=E,t[54]=O,t[55]=Q):Q=t[55];let $;return t[56]!==W||t[57]!==J||t[58]!==Y||t[59]!==X||t[60]!==Z||t[61]!==Q||t[62]!==G||t[63]!==K||t[64]!==q?($=(0,g.jsxs)(`div`,{className:G,"aria-label":K,children:[q,W,J,Y,X,Z,Q]}),t[56]=W,t[57]=J,t[58]=Y,t[59]=X,t[60]=Z,t[61]=Q,t[62]=G,t[63]=K,t[64]=q,t[65]=$):$=t[65],$}function y(e){return[e.id,e]}function b(e){return e.runs}function x(e){return(e?.length??0)>1?0:e?.[0]?.runs.some(_)?3e3:15e3}function S(e){let[,t,n,r]=e;return d.runs(20,t,{projectId:n||void 0,cursor:r||void 0})}export{f as i,_ as n,p as r,v as t};
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{t as a}from"./messages-CGO1P4mz.js";import{t as o}from"./createLucideIcon-DPHK1VkS.js";import{t as s}from"./cn-0WouolD0.js";import{t as c}from"./skeleton-DzdOeGYz.js";import{i as l,t as u}from"./vendor-swr-CdRzEUwF.js";import{t as d}from"./automation-api-Dl9fi8t0.js";var f=o(`check-check`,[[`path`,{d:`M18 6 7 17l-5-5`,key:`116fxf`}],[`path`,{d:`m22 10-7.5 7.5L13 16`,key:`ke71qq`}]]),p=o(`list-tree`,[[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`M3 10a2 2 0 0 0 2 2h3`,key:`1npucw`}],[`path`,{d:`M3 5v12a2 2 0 0 0 2 2h3`,key:`x1gjn2`}]]),m=n(),h=e(t(),1),g=r(),_=e=>[`queued`,`running`,`cancelling`].includes(e.status);function v(e){let t=(0,m.c)(66),{automationId:n,projectId:r,language:o,selectedRunId:f,selectedRun:p,enabled:v,runHref:C,onSelectRun:w}=e,T=v===void 0||v,[E,D]=(0,h.useState)(!1),O=o===`zh`,k;t[0]!==T||t[1]!==p||t[2]!==f?(k=T&&f&&!p?[`automation-navigation-selected-run`,f]:null,t[0]=T,t[1]=p,t[2]=f,t[3]=k):k=t[3];let A;t[4]===f?A=t[5]:(A=()=>d.getRun(f),t[4]=f,t[5]=A);let j;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(j={revalidateOnFocus:!1,shouldRetryOnError:!1},t[6]=j):j=t[6];let{data:M}=l(k,A,j),N=p??M?.run,P;t[7]!==n||t[8]!==T||t[9]!==r?(P=(e,t)=>!T||e&&!t?.nextCursor?null:[`automation-navigation-runs`,n,r??``,e?t.nextCursor:``],t[7]=n,t[8]=T,t[9]=r,t[10]=P):P=t[10];let F;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(F={refreshInterval:x,refreshWhenHidden:!1,refreshWhenOffline:!1,revalidateAll:!0,persistSize:!0},t[11]=F):F=t[11];let{data:I,error:L,size:R,setSize:z,isValidating:B,mutate:V}=u(P,S,F),H,U,W,G,K,q;if(t[12]!==E||t[13]!==n||t[14]!==N||t[15]!==I||t[16]!==L||t[17]!==B||t[18]!==o||t[19]!==w||t[20]!==C||t[21]!==f||t[22]!==R||t[23]!==O){U=[...new Map((I??[]).flatMap(b).map(y)).values()];let e=E?U:U.slice(0,3),r=N?.automationId===n&&!e.some(e=>e.id===N.id)?[N,...e]:e;H=B&&(!I||I.length<R),G=`space-y-1 pb-3 pl-8 pr-2`,K=O?`执行记录`:`Execution history`,t[30]!==I||t[31]!==L?(q=!I&&!L?(0,g.jsxs)(`div`,{"aria-busy":`true`,className:`space-y-2 px-3 py-2`,children:[(0,g.jsx)(c,{className:`h-8`}),(0,g.jsx)(c,{className:`h-8`})]}):null,t[30]=I,t[31]=L,t[32]=q):q=t[32],W=r.map(t=>{let n=s(`w-full rounded-lg px-3 py-2 text-left text-xs text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,f===t.id&&`bg-surface-active text-fg`),r=f===t.id?`true`:void 0,c=(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,g.jsx)(`span`,{children:new Date(t.createdAtMs).toLocaleString(O?`zh-CN`:`en-US`,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}),!_(t)&&t.readAtMs==null?(0,g.jsx)(`span`,{className:`size-1.5 shrink-0 rounded-full bg-accent`,children:(0,g.jsx)(`span`,{className:`sr-only`,children:O?`未读`:`Unread`})}):null]}),N?.id===t.id&&!e.some(e=>e.id===t.id)?(0,g.jsx)(`span`,{className:`block text-accent-fg`,children:O?`当前查看`:`Currently viewing`}):null,(0,g.jsx)(`span`,{className:s(`block`,[`failed`,`timeout`].includes(t.status)&&`text-danger`),children:a(o).automations.status[t.status]})]});return C?(0,g.jsx)(i,{to:C(t),className:s(`block`,n),"aria-current":r,onClick:()=>w(t),children:c},t.id):(0,g.jsx)(`button`,{type:`button`,className:n,"aria-current":r,onClick:()=>w(t),children:c},t.id)}),t[12]=E,t[13]=n,t[14]=N,t[15]=I,t[16]=L,t[17]=B,t[18]=o,t[19]=w,t[20]=C,t[21]=f,t[22]=R,t[23]=O,t[24]=H,t[25]=U,t[26]=W,t[27]=G,t[28]=K,t[29]=q}else H=t[24],U=t[25],W=t[26],G=t[27],K=t[28],q=t[29];let J;t[33]!==I||t[34]!==U||t[35]!==O?(J=I&&U.length===0?(0,g.jsx)(`p`,{className:`px-3 py-2 text-xs text-fg-muted`,children:O?`尚未执行`:`No executions yet`}):null,t[33]=I,t[34]=U,t[35]=O,t[36]=J):J=t[36];let Y;t[37]!==L||t[38]!==V||t[39]!==O?(Y=L?(0,g.jsxs)(`div`,{role:`alert`,className:`px-3 py-2 text-xs text-danger`,children:[(0,g.jsx)(`p`,{children:O?`执行记录加载失败`:`Could not load history`}),(0,g.jsx)(`button`,{type:`button`,className:`w-full rounded-lg px-3 py-2 text-left text-xs text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,onClick:()=>void V(),children:O?`重试`:`Retry`})]}):null,t[37]=L,t[38]=V,t[39]=O,t[40]=Y):Y=t[40];let X;t[41]!==E||t[42]!==I?.[0]?.hasMore||t[43]!==U||t[44]!==O?(X=!E&&(U.length>3||I?.[0]?.hasMore)?(0,g.jsx)(`button`,{type:`button`,className:`w-full rounded-lg px-3 py-2 text-left text-xs text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,onClick:()=>D(!0),children:O?`查看全部执行`:`View all executions`}):null,t[41]=E,t[42]=I?.[0]?.hasMore,t[43]=U,t[44]=O,t[45]=X):X=t[45];let Z;t[46]!==E||t[47]!==I||t[48]!==H||t[49]!==z||t[50]!==R||t[51]!==O?(Z=E&&I?.at(-1)?.hasMore?(0,g.jsx)(`button`,{type:`button`,className:`w-full rounded-lg px-3 py-2 text-left text-xs text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,disabled:H,onClick:()=>void z(R+1),children:H?O?`加载中…`:`Loading…`:O?`加载更多`:`Load more`}):null,t[46]=E,t[47]=I,t[48]=H,t[49]=z,t[50]=R,t[51]=O,t[52]=Z):Z=t[52];let Q;t[53]!==E||t[54]!==O?(Q=E?(0,g.jsx)(`button`,{type:`button`,className:`w-full rounded-lg px-3 py-2 text-left text-xs text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,onClick:()=>D(!1),children:O?`收起历史`:`Show recent`}):null,t[53]=E,t[54]=O,t[55]=Q):Q=t[55];let $;return t[56]!==W||t[57]!==J||t[58]!==Y||t[59]!==X||t[60]!==Z||t[61]!==Q||t[62]!==G||t[63]!==K||t[64]!==q?($=(0,g.jsxs)(`div`,{className:G,"aria-label":K,children:[q,W,J,Y,X,Z,Q]}),t[56]=W,t[57]=J,t[58]=Y,t[59]=X,t[60]=Z,t[61]=Q,t[62]=G,t[63]=K,t[64]=q,t[65]=$):$=t[65],$}function y(e){return[e.id,e]}function b(e){return e.runs}function x(e){return(e?.length??0)>1?0:e?.[0]?.runs.some(_)?3e3:15e3}function S(e){let[,t,n,r]=e;return d.runs(20,t,{projectId:n||void 0,cursor:r||void 0})}export{f as i,_ as n,p as r,v as t};