@xopcai/xopc 0.0.312 → 0.0.314

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 (497) hide show
  1. package/dist/browser-ext/dist/assets/{auth-C3yV1y_l.js → auth-DKo-NMUY.js} +18 -1
  2. package/dist/browser-ext/dist/background.js +68 -2
  3. package/dist/browser-ext/dist/sidepanel.html +1 -1
  4. package/dist/browser-ext/dist/sidepanel.js +1 -1
  5. package/dist/browser-ext/manifest.json +1 -1
  6. package/dist/extensions/feishu/src/outbound/media-load.js +1 -1
  7. package/dist/extensions/telegram/src/inbound-processor.js +1 -1
  8. package/dist/extensions/telegram/src/plugin.js +2 -2
  9. package/dist/extensions/telegram/xopc.extension.json +1 -1
  10. package/dist/gateway/static/root/assets/{agent-avatar-dicebear-BVIJMP8w.js → agent-avatar-dicebear-BFkjfurL.js} +1 -1
  11. package/dist/gateway/static/root/assets/agent-defaults-settings-panel-BdOZ6q8Z.js +1 -0
  12. package/dist/gateway/static/root/assets/{agents-D6g_SeWI.js → agents-CCcavsHq.js} +1 -1
  13. package/dist/gateway/static/root/assets/{api-_aHQA8bd.js → api-BYhRsTAc.js} +1 -1
  14. package/dist/gateway/static/root/assets/{app-link-CKueEVbT.js → app-link-nL8iPwEr.js} +1 -1
  15. package/dist/gateway/static/root/assets/{app-management-settings-panel-CLg_aXYG.js → app-management-settings-panel-B4kihr-A.js} +1 -1
  16. package/dist/gateway/static/root/assets/appearance-settings-N9sYmNOx.js +1 -0
  17. package/dist/gateway/static/root/assets/apps-page-BMcy10_s.js +1 -0
  18. package/dist/gateway/static/root/assets/{archive-plugin-CHO3heHX.js → archive-plugin-k_SuYWyV.js} +1 -1
  19. package/dist/gateway/static/root/assets/{attachment-load-BsmsBCI2.js → attachment-load-DRv5QWUK.js} +1 -1
  20. package/dist/gateway/static/root/assets/{automations-page-CftigJlf.js → automations-page-CkJV3DN0.js} +1 -1
  21. package/dist/gateway/static/root/assets/automations-workspace-BEa2doeR.js +7 -0
  22. package/dist/gateway/static/root/assets/{binary-plugins-CRCLWBo2.js → binary-plugins-Dg3h3TA7.js} +1 -1
  23. package/dist/gateway/static/root/assets/{block-editor-D0LDiOTT.js → block-editor-DVhdHntT.js} +29 -29
  24. package/dist/gateway/static/root/assets/{browser-automation-inputs-C611KRBx.js → browser-automation-inputs-BMRYUW8_.js} +1 -1
  25. package/dist/gateway/static/root/assets/{browser-automations-page-Djyv3vy-.js → browser-automations-page-Byv6-FY2.js} +2 -2
  26. package/dist/gateway/static/root/assets/browser-settings-page-DRCHGFpO.js +3 -0
  27. package/dist/gateway/static/root/assets/capabilities-D0S3DuAD.js +1 -0
  28. package/dist/gateway/static/root/assets/capabilities-settings-panel-mxRP0gl0.js +8 -0
  29. package/dist/gateway/static/root/assets/channels-settings-DBt_6GsB.js +1 -0
  30. package/dist/gateway/static/root/assets/{chat-terminal-dock-CIsKqdET.js → chat-terminal-dock-D4AHa51o.js} +2 -2
  31. package/dist/gateway/static/root/assets/{computer-settings-page-C0YL9J7m.js → computer-settings-page-eXPe500D.js} +1 -1
  32. package/dist/gateway/static/root/assets/connector-service-page-BQTFlq_k.js +1 -0
  33. package/dist/gateway/static/root/assets/connectors-page-BKeBWwcI.js +2 -0
  34. package/dist/gateway/static/root/assets/conversation-identity-Cw0n9uzK.js +1 -0
  35. package/dist/gateway/static/root/assets/{date-picker-CDsfv8R0.js → date-picker-7MtovynY.js} +1 -1
  36. package/dist/gateway/static/root/assets/{dependency-picker-DvhPj3CZ.js → dependency-picker-Bj_xkXID.js} +1 -1
  37. package/dist/gateway/static/root/assets/{desktop-pet-Cyg8XMpL.js → desktop-pet-CTmba9zH.js} +1 -1
  38. package/dist/gateway/static/root/assets/desktop-pet-settings-DNM_BlWN.js +1 -0
  39. package/dist/gateway/static/root/assets/device-pairing-wizard-C2XE0QhT.js +1 -0
  40. package/dist/gateway/static/root/assets/{extension-debug-page-D-AVJU3q.js → extension-debug-page-J_olaL7e.js} +1 -1
  41. package/dist/gateway/static/root/assets/{extension-page-DrFoQ9xt.js → extension-page-pK5RvqN8.js} +1 -1
  42. package/dist/gateway/static/root/assets/{extension-settings-page-DxWjESC1.js → extension-settings-page-BwroEN08.js} +1 -1
  43. package/dist/gateway/static/root/assets/files-BK6enEvD.js +1 -0
  44. package/dist/gateway/static/root/assets/{gateway-config-swr-DUDX42qY.js → gateway-config-swr-FuJTIg_a.js} +1 -1
  45. package/dist/gateway/static/root/assets/gateway-settings-CLLDp23J.js +1 -0
  46. package/dist/gateway/static/root/assets/{gateway-startup-retry-Cf8OxlvY.js → gateway-startup-retry-CKg_gu8_.js} +1 -1
  47. package/dist/gateway/static/root/assets/home-page-B5Epb1PH.js +1 -0
  48. package/dist/gateway/static/root/assets/{image-generation-api-D2YorS--.js → image-generation-api-Bo6NZ7zb.js} +1 -1
  49. package/dist/gateway/static/root/assets/{imports-page-BKucJlXI.js → imports-page-C8-hX8gS.js} +1 -1
  50. package/dist/gateway/static/root/assets/index-14F1yGJI.js +89 -0
  51. package/dist/gateway/static/root/assets/index-cB7rWIDY.css +1 -0
  52. package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BxLXD-yU.js → keyboard-shortcuts-settings-BkBEjUZD.js} +1 -1
  53. package/dist/gateway/static/root/assets/local-app-workbench-page-6jC3vQpY.js +2 -0
  54. package/dist/gateway/static/root/assets/{local-apps-page-BAsQJQKJ.js → local-apps-page-CrbKIixo.js} +1 -1
  55. package/dist/gateway/static/root/assets/{locale-store-DA0Z5jM_.js → locale-store-CvGwNbml.js} +1 -1
  56. package/dist/gateway/static/root/assets/logs-page-DBHlZts9.js +2 -0
  57. package/dist/gateway/static/root/assets/management-settings-DsUWLu5m.js +1 -0
  58. package/dist/gateway/static/root/assets/{markdown-view-DYGPxPee.js → markdown-view-nXo5nrsv.js} +1 -1
  59. package/dist/gateway/static/root/assets/{media-plugins-CQtQzLyg.js → media-plugins-upxXJ-4l.js} +1 -1
  60. package/dist/gateway/static/root/assets/messages-B_AwRroN.js +3 -0
  61. package/dist/gateway/static/root/assets/note-detail-panel-0Q9TOtJG.js +5 -0
  62. package/dist/gateway/static/root/assets/notes-page-D0NmcwNw.js +8 -0
  63. package/dist/gateway/static/root/assets/page-context-capture-button-DUyA-K4L.js +1 -0
  64. package/dist/gateway/static/root/assets/{page-tabs-B6DjkyMM.js → page-tabs-Cl-NFPNr.js} +1 -1
  65. package/dist/gateway/static/root/assets/{preview-open-alternatives-Dn57uLhr.js → preview-open-alternatives-DX81PwJ3.js} +1 -1
  66. package/dist/gateway/static/root/assets/product-delivery-chCjIpvu.js +1 -0
  67. package/dist/gateway/static/root/assets/{product-open-page-H2YMk8TY.js → product-open-page-CrfIGwm8.js} +1 -1
  68. package/dist/gateway/static/root/assets/project-detail-page-BVfVrYmn.js +1 -0
  69. package/dist/gateway/static/root/assets/projects-page-nM9a9XNS.js +1 -0
  70. package/dist/gateway/static/root/assets/{registry-api-C0DCx3wv.js → registry-api-CHxgohY0.js} +1 -1
  71. package/dist/gateway/static/root/assets/remote-access-hub-C8b_k88G.js +1 -0
  72. package/dist/gateway/static/root/assets/runtime-tools-settings-panel-D3dLOW04.js +5 -0
  73. package/dist/gateway/static/root/assets/scenes-page-DEowreZV.js +2 -0
  74. package/dist/gateway/static/root/assets/{schema-form-CblI9WUA.js → schema-form-ZxuIvD2_.js} +1 -1
  75. package/dist/gateway/static/root/assets/schemas-88fK3zzl.js +64 -0
  76. package/dist/gateway/static/root/assets/sessions-page-B_nPhera.js +1 -0
  77. package/dist/gateway/static/root/assets/settings-advanced-gate-BqhIOuus.js +1 -0
  78. package/dist/gateway/static/root/assets/{settings-form-section-BAaVyxJH.js → settings-form-section-TZRfg4yo.js} +1 -1
  79. package/dist/gateway/static/root/assets/{settings-page-CKNPbm5q.js → settings-page-a8qcJpdZ.js} +1 -1
  80. package/dist/gateway/static/root/assets/{settings-page-layout-DqNCGKxQ.js → settings-page-layout-BfvlRT9q.js} +1 -1
  81. package/dist/gateway/static/root/assets/setup-status-panel-CRj5Ruqn.js +1 -0
  82. package/dist/gateway/static/root/assets/{share-preview-page-BzMfp_HM.js → share-preview-page-DCt1pTWB.js} +1 -1
  83. package/dist/gateway/static/root/assets/shares-settings-BNbXPk--.js +1 -0
  84. package/dist/gateway/static/root/assets/skill-reload-api-CNMCLbav.js +1 -0
  85. package/dist/gateway/static/root/assets/{skills-page-DIht92q6.js → skills-page-BIOcg44X.js} +1 -1
  86. package/dist/gateway/static/root/assets/{skills-page.utils-DLYRiEn3.js → skills-page.utils-CgZdzT4I.js} +1 -1
  87. package/dist/gateway/static/root/assets/{system-settings-panel-yYs4YgYk.js → system-settings-panel-_YaRncA6.js} +1 -1
  88. package/dist/gateway/static/root/assets/task-detail-page-CAcfAG-c.js +1 -0
  89. package/dist/gateway/static/root/assets/tasks-CDR_RVbQ.js +1 -0
  90. package/dist/gateway/static/root/assets/{tunnel-api-BasDYxvx.js → tunnel-api-uOupJOoS.js} +1 -1
  91. package/dist/gateway/static/root/assets/turn-outcome-D0SnyZ3Z.js +1 -0
  92. package/dist/gateway/static/root/assets/{use-autosave-CWAUHhcb.js → use-autosave-BezzHBLE.js} +1 -1
  93. package/dist/gateway/static/root/assets/user-model-page-BFFeneDq.js +2 -0
  94. package/dist/gateway/static/root/assets/{voice-api-key-field-Kc4UlxZs.js → voice-api-key-field-BmYifdwL.js} +1 -1
  95. package/dist/gateway/static/root/assets/{voice-config-api-DTyMdGOR.js → voice-config-api-D_5Q2_A3.js} +1 -1
  96. package/dist/gateway/static/root/assets/{work-discovery-overlay-BPC_c9dO.js → work-discovery-overlay-4DmyEckJ.js} +1 -1
  97. package/dist/gateway/static/root/assets/{workflow-run-setup-panel-DBTciOrq.js → workflow-run-setup-panel-DeZe8bTZ.js} +2 -2
  98. package/dist/gateway/static/root/assets/workflows-page-Sv4hEc6W.js +6 -0
  99. package/dist/gateway/static/root/index.html +16 -16
  100. package/dist/package.js +1 -1
  101. package/dist/packages/computer-control-contract/src/index.js +10 -1
  102. package/dist/packages/gateway-contract/src/app-context.js +55 -0
  103. package/dist/packages/gateway-contract/src/automations.js +16 -17
  104. package/dist/packages/gateway-contract/src/capabilities.js +1078 -0
  105. package/dist/packages/gateway-contract/src/extension-capabilities.js +26 -0
  106. package/dist/packages/gateway-contract/src/home.js +3 -3
  107. package/dist/packages/gateway-contract/src/index.js +8 -0
  108. package/dist/packages/gateway-contract/src/product-delivery.js +19 -4
  109. package/dist/packages/gateway-contract/src/scenes.js +199 -0
  110. package/dist/packages/gateway-contract/src/task-runs.js +8 -4
  111. package/dist/packages/gateway-contract/src/tasks.js +5 -4
  112. package/dist/packages/realtime-client/src/index.js +17 -4
  113. package/dist/src/agent/agent-manager.d.ts +1 -0
  114. package/dist/src/agent/agent-manager.js +1 -0
  115. package/dist/src/agent/child-agent-factory.d.ts +2 -0
  116. package/dist/src/agent/child-agent-factory.js +5 -0
  117. package/dist/src/agent/commands/approved-verification.d.ts +14 -0
  118. package/dist/src/agent/commands/approved-verification.js +48 -0
  119. package/dist/src/agent/context/execution-scope.js +2 -1
  120. package/dist/src/agent/context/project-context.js +2 -1
  121. package/dist/src/agent/external-tools/cliProvider.js +123 -75
  122. package/dist/src/agent/external-tools/composio-provider.d.ts +1 -1
  123. package/dist/src/agent/external-tools/composio-provider.js +70 -12
  124. package/dist/src/agent/external-tools/endpoint-provider.js +14 -1
  125. package/dist/src/agent/inbound/turn-dispatcher.d.ts +2 -0
  126. package/dist/src/agent/inbound/turn-dispatcher.js +2 -1
  127. package/dist/src/agent/memory/compaction-chunks.d.ts +6 -1
  128. package/dist/src/agent/memory/compaction-chunks.js +16 -3
  129. package/dist/src/agent/memory/compaction-ledger.d.ts +3 -1
  130. package/dist/src/agent/memory/compaction-ledger.js +31 -18
  131. package/dist/src/agent/memory/compaction-request.d.ts +2 -0
  132. package/dist/src/agent/memory/compaction-request.js +6 -1
  133. package/dist/src/agent/memory/compaction.d.ts +19 -1
  134. package/dist/src/agent/memory/compaction.js +112 -30
  135. package/dist/src/agent/service/process-direct-streaming.d.ts +3 -0
  136. package/dist/src/agent/service/process-direct-streaming.js +19 -10
  137. package/dist/src/agent/service.js +1 -0
  138. package/dist/src/agent/service.types.d.ts +1 -0
  139. package/dist/src/agent/skills/config.js +2 -0
  140. package/dist/src/agent/skills/format-skills-prompt.js +14 -1
  141. package/dist/src/agent/skills/index.js +16 -8
  142. package/dist/src/agent/skills/types.d.ts +1 -1
  143. package/dist/src/agent/source-context/app-context.d.ts +4 -0
  144. package/dist/src/agent/source-context/app-context.js +36 -0
  145. package/dist/src/agent/source-context/injector.js +1 -0
  146. package/dist/src/agent/source-context/types.d.ts +5 -1
  147. package/dist/src/agent/tasks/task-judge-service.js +2 -1
  148. package/dist/src/agent/tool-manuals/computer.d.ts +1 -1
  149. package/dist/src/agent/tool-manuals/computer.js +1 -1
  150. package/dist/src/agent/tools/automation-tool.d.ts +12 -1
  151. package/dist/src/agent/tools/automation-tool.js +106 -32
  152. package/dist/src/agent/tools/factory.d.ts +1 -0
  153. package/dist/src/agent/tools/factory.js +6 -1
  154. package/dist/src/agent/tools/scoped-workspace-tools.d.ts +8 -0
  155. package/dist/src/agent/tools/scoped-workspace-tools.js +81 -0
  156. package/dist/src/agent/tools/xopc-use-tool.d.ts +6 -3
  157. package/dist/src/agent/tools/xopc-use-tool.js +997 -908
  158. package/dist/src/agent/workflow/subagent-runner.js +1 -0
  159. package/dist/src/agent-config/index.js +2 -2
  160. package/dist/src/agent-config/schema.d.ts +5 -0
  161. package/dist/src/agent-config/schema.js +14 -10
  162. package/dist/src/automations/api/routes.js +244 -164
  163. package/dist/src/automations/capabilities/drafts.d.ts +4 -0
  164. package/dist/src/automations/capabilities/drafts.js +95 -0
  165. package/dist/src/automations/capabilities/read.d.ts +4 -0
  166. package/dist/src/automations/capabilities/read.js +119 -0
  167. package/dist/src/automations/capabilities/write.d.ts +349 -0
  168. package/dist/src/automations/capabilities/write.js +172 -0
  169. package/dist/src/automations/domain/index.js +2 -2
  170. package/dist/src/automations/domain/validation.d.ts +77 -77
  171. package/dist/src/automations/domain/validation.js +9 -6
  172. package/dist/src/automations/draft/automation-draft-validator.d.ts +2 -2
  173. package/dist/src/automations/index.js +6 -6
  174. package/dist/src/automations/service/automation-service.d.ts +31 -0
  175. package/dist/src/automations/service/automation-service.js +213 -75
  176. package/dist/src/automations/service/index.js +2 -2
  177. package/dist/src/automations/storage/automation-repository.d.ts +2 -0
  178. package/dist/src/automations/storage/automation-repository.js +9 -1
  179. package/dist/src/automations/storage/automation-run-repository.d.ts +4 -1
  180. package/dist/src/automations/storage/automation-run-repository.js +16 -3
  181. package/dist/src/automations/storage/index.js +3 -3
  182. package/dist/src/browser/automations/schema.d.ts +1 -1
  183. package/dist/src/browser/automations/service.d.ts +1 -1
  184. package/dist/src/browser/observation/format.js +4 -0
  185. package/dist/src/capabilities/adapters/http.d.ts +4 -0
  186. package/dist/src/capabilities/adapters/http.js +44 -0
  187. package/dist/src/capabilities/readiness/from-config.js +11 -7
  188. package/dist/src/capabilities/runtime/app-context.d.ts +3 -0
  189. package/dist/src/capabilities/runtime/app-context.js +72 -0
  190. package/dist/src/capabilities/runtime/atomic-operations.d.ts +11 -0
  191. package/dist/src/capabilities/runtime/atomic-operations.js +34 -0
  192. package/dist/src/capabilities/runtime/dispatcher.d.ts +67 -0
  193. package/dist/src/capabilities/runtime/dispatcher.js +170 -0
  194. package/dist/src/capabilities/runtime/errors.d.ts +6 -0
  195. package/dist/src/capabilities/runtime/errors.js +11 -0
  196. package/dist/src/capabilities/runtime/external-operations.d.ts +16 -0
  197. package/dist/src/capabilities/runtime/external-operations.js +92 -0
  198. package/dist/src/capabilities/runtime/product.d.ts +12 -0
  199. package/dist/src/capabilities/runtime/product.js +69 -0
  200. package/dist/src/capabilities/runtime/settings.d.ts +3 -0
  201. package/dist/src/capabilities/runtime/settings.js +27 -0
  202. package/dist/src/channels/index.js +2 -2
  203. package/dist/src/channels/manager.js +1 -1
  204. package/dist/src/cli/cli-log-level-preset.d.ts +2 -0
  205. package/dist/src/cli/cli-log-level-preset.js +4 -0
  206. package/dist/src/cli/command-catalog.js +4 -0
  207. package/dist/src/cli/command-loaders.js +1 -0
  208. package/dist/src/cli/command-manifest.js +4 -0
  209. package/dist/src/cli/commands/channels.js +1 -1
  210. package/dist/src/cli/commands/connectors.js +1 -1
  211. package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
  212. package/dist/src/cli/commands/extension-marketplace.js +1 -1
  213. package/dist/src/cli/commands/mcp.d.ts +1 -0
  214. package/dist/src/cli/commands/mcp.js +51 -0
  215. package/dist/src/cli/commands/models.js +1 -1
  216. package/dist/src/cli/commands/onboard.js +1 -1
  217. package/dist/src/cli/commands/project.js +1 -1
  218. package/dist/src/computer/broker.d.ts +0 -1
  219. package/dist/src/computer/broker.js +4 -6
  220. package/dist/src/computer/evaluation-harness.d.ts +45 -0
  221. package/dist/src/computer/evaluation-harness.js +108 -0
  222. package/dist/src/computer/model-adapter.d.ts +37 -2
  223. package/dist/src/computer/model-adapter.js +333 -42
  224. package/dist/src/computer/model-policy.d.ts +4 -1
  225. package/dist/src/computer/model-policy.js +11 -3
  226. package/dist/src/computer/release-gate.d.ts +22 -0
  227. package/dist/src/computer/release-gate.js +19 -0
  228. package/dist/src/computer/runtime.js +14 -10
  229. package/dist/src/computer/task-state.d.ts +1 -0
  230. package/dist/src/computer/task-state.js +1 -0
  231. package/dist/src/config/models-json.d.ts +14 -8
  232. package/dist/src/config/models-json.js +1 -1
  233. package/dist/src/config/schema.d.ts +4 -0
  234. package/dist/src/config/schema.js +3 -9
  235. package/dist/src/connectors/composio-sessions.d.ts +4 -2
  236. package/dist/src/connectors/composio-sessions.js +10 -9
  237. package/dist/src/connectors/composio.js +10 -8
  238. package/dist/src/discussions/action-tasks.js +2 -1
  239. package/dist/src/discussions/recording.js +1 -1
  240. package/dist/src/execution-environments/local-worktree-manager.d.ts +1 -0
  241. package/dist/src/execution-environments/local-worktree-manager.js +13 -2
  242. package/dist/src/extensions/activation-context.js +3 -3
  243. package/dist/src/extensions/api.js +1 -1
  244. package/dist/src/extensions/normalize-manifest.js +6 -1
  245. package/dist/src/extensions/sdk/index.js +1 -1
  246. package/dist/src/extensions/sdk/media.js +1 -1
  247. package/dist/src/extensions/types/manifest.d.ts +3 -0
  248. package/dist/src/gateway/agent-builtin-tools.d.ts +1 -1
  249. package/dist/src/gateway/hono/lib/config-payload.d.ts +1 -0
  250. package/dist/src/gateway/hono/middleware/scopes.js +1 -1
  251. package/dist/src/gateway/hono/routes/auth-registry-extensions.js +5 -2
  252. package/dist/src/gateway/hono/routes/capability-operations.d.ts +3 -0
  253. package/dist/src/gateway/hono/routes/capability-operations.js +52 -0
  254. package/dist/src/gateway/hono/routes/lazy-bundles.js +16 -0
  255. package/dist/src/gateway/hono/routes/local-app-capabilities.d.ts +4 -0
  256. package/dist/src/gateway/hono/routes/local-app-capabilities.js +41 -0
  257. package/dist/src/gateway/hono/routes/local-apps.js +41 -9
  258. package/dist/src/gateway/hono/routes/models.js +2 -2
  259. package/dist/src/gateway/hono/routes/notes.js +215 -146
  260. package/dist/src/gateway/hono/routes/projects.js +217 -374
  261. package/dist/src/gateway/hono/routes/scenes.js +188 -75
  262. package/dist/src/gateway/hono/routes/session-input-handler.d.ts +60 -16
  263. package/dist/src/gateway/hono/routes/session-input-handler.js +43 -1
  264. package/dist/src/gateway/hono/routes/sessions.js +17 -0
  265. package/dist/src/gateway/hono/routes/status.js +1 -1
  266. package/dist/src/gateway/hono/routes/tasks.js +182 -326
  267. package/dist/src/gateway/hono/routes/user-model-refresh.js +1 -1
  268. package/dist/src/gateway/hono/routes/voice.js +4 -4
  269. package/dist/src/gateway/hono/routes/workflows.js +1 -1
  270. package/dist/src/gateway/media-access.js +2 -1
  271. package/dist/src/gateway/mobile-privacy.js +2 -2
  272. package/dist/src/gateway/scenes/host.js +14 -3
  273. package/dist/src/gateway/scenes/mailContext.js +1 -1
  274. package/dist/src/gateway/scenes/slackThreadSource.d.ts +41 -0
  275. package/dist/src/gateway/scenes/slackThreadSource.js +168 -0
  276. package/dist/src/gateway/security/gateway-scopes.d.ts +1 -1
  277. package/dist/src/gateway/security/gateway-scopes.js +5 -0
  278. package/dist/src/gateway/service/app-context-access.d.ts +11 -0
  279. package/dist/src/gateway/service/app-context-access.js +70 -0
  280. package/dist/src/gateway/service/run-gateway-agent.js +11 -2
  281. package/dist/src/gateway/service/session-input-coordinator.js +54 -15
  282. package/dist/src/gateway/service/sessions-api.d.ts +1 -0
  283. package/dist/src/gateway/service/sessions-api.js +3 -0
  284. package/dist/src/gateway/service/task-conversation-query-service.d.ts +3 -1
  285. package/dist/src/gateway/service/task-conversation-query-service.js +32 -3
  286. package/dist/src/gateway/service.d.ts +3 -0
  287. package/dist/src/gateway/service.js +69 -15
  288. package/dist/src/gateway/session-context-summary.js +2 -1
  289. package/dist/src/{tasks/task-outbox-dispatcher.d.ts → infra/domain-outbox-dispatcher.d.ts} +2 -2
  290. package/dist/src/{tasks/task-outbox-dispatcher.js → infra/domain-outbox-dispatcher.js} +10 -9
  291. package/dist/src/infra/operation-context.d.ts +2 -0
  292. package/dist/src/infra/operation-context.js +16 -0
  293. package/dist/src/local-apps/capabilities/contracts.d.ts +2 -0
  294. package/dist/src/local-apps/capabilities/contracts.js +32 -0
  295. package/dist/src/local-apps/capabilities/read.d.ts +3 -0
  296. package/dist/src/local-apps/capabilities/read.js +48 -0
  297. package/dist/src/local-apps/capabilities/runtime.d.ts +16 -0
  298. package/dist/src/local-apps/capabilities/runtime.js +66 -0
  299. package/dist/src/local-apps/capabilities/write.d.ts +3 -0
  300. package/dist/src/local-apps/capabilities/write.js +35 -0
  301. package/dist/src/local-apps/release-lock.d.ts +2 -0
  302. package/dist/src/local-apps/release-lock.js +20 -0
  303. package/dist/src/local-apps/runtime-entry.d.ts +0 -2
  304. package/dist/src/local-apps/runtime-entry.js +1 -14
  305. package/dist/src/local-apps/scaffold.js +4 -1
  306. package/dist/src/local-apps/service.d.ts +24 -1
  307. package/dist/src/local-apps/service.js +186 -43
  308. package/dist/src/local-apps/store.js +0 -2
  309. package/dist/src/mcp/capability-server.d.ts +4 -0
  310. package/dist/src/mcp/capability-server.js +96 -0
  311. package/dist/src/mcp/channel-bridge.js +1 -1
  312. package/dist/src/mcp/gateway-http-client.d.ts +7 -0
  313. package/dist/src/mcp/gateway-http-client.js +27 -5
  314. package/dist/src/media-understanding/openai-compatible-audio.js +1 -1
  315. package/dist/src/notes/agent-context.js +1 -1
  316. package/dist/src/notes/capabilities/read.d.ts +3 -0
  317. package/dist/src/notes/capabilities/read.js +96 -0
  318. package/dist/src/notes/capabilities/write.d.ts +7 -0
  319. package/dist/src/notes/capabilities/write.js +152 -0
  320. package/dist/src/notes/index.js +1 -1
  321. package/dist/src/notes/service.d.ts +12 -4
  322. package/dist/src/notes/service.js +188 -175
  323. package/dist/src/notes/store.d.ts +14 -9
  324. package/dist/src/notes/store.js +81 -21
  325. package/dist/src/notifications/service.d.ts +1 -0
  326. package/dist/src/notifications/service.js +5 -0
  327. package/dist/src/platform/client.d.ts +1 -1
  328. package/dist/src/platform/contracts.d.ts +1 -1
  329. package/dist/src/projects/capabilities/read.d.ts +3 -0
  330. package/dist/src/projects/capabilities/read.js +81 -0
  331. package/dist/src/projects/capabilities/write.d.ts +9 -0
  332. package/dist/src/projects/capabilities/write.js +260 -0
  333. package/dist/src/projects/index.js +2 -2
  334. package/dist/src/projects/project-change-events.d.ts +2 -0
  335. package/dist/src/projects/project-change-events.js +18 -0
  336. package/dist/src/projects/project-service.d.ts +11 -0
  337. package/dist/src/projects/project-service.js +121 -42
  338. package/dist/src/projects/project-store.js +12 -2
  339. package/dist/src/projects/project-workspace-creation.d.ts +3 -0
  340. package/dist/src/projects/project-workspace-creation.js +45 -0
  341. package/dist/src/projects/workspace-project.js +6 -0
  342. package/dist/src/providers/model-catalog-types.d.ts +2 -1
  343. package/dist/src/providers/model-reference-auditor.js +4 -4
  344. package/dist/src/providers/model-supplements.js +13 -3
  345. package/dist/src/providers/presentation.js +3 -3
  346. package/dist/src/providers/xopc-cloud-model-source.js +4 -2
  347. package/dist/src/realtime/runtime.js +4 -0
  348. package/dist/src/scenes/capabilities/read.d.ts +3 -0
  349. package/dist/src/scenes/capabilities/read.js +187 -0
  350. package/dist/src/scenes/capabilities/write.d.ts +3 -0
  351. package/dist/src/scenes/capabilities/write.js +151 -0
  352. package/dist/src/scenes/contracts.d.ts +2 -105
  353. package/dist/src/scenes/contracts.js +3 -88
  354. package/dist/src/scenes/execution.d.ts +1 -1
  355. package/dist/src/scenes/httpServices.d.ts +2 -0
  356. package/dist/src/scenes/inbox.d.ts +1 -0
  357. package/dist/src/scenes/inbox.js +7 -7
  358. package/dist/src/scenes/preferences.d.ts +3 -24
  359. package/dist/src/scenes/preferences.js +8 -30
  360. package/dist/src/scenes/repository.d.ts +1 -0
  361. package/dist/src/scenes/repository.js +7 -3
  362. package/dist/src/scenes/resultNotifications.js +2 -2
  363. package/dist/src/scenes/schedule.d.ts +1 -8
  364. package/dist/src/scenes/schedule.js +3 -15
  365. package/dist/src/scenes/service.d.ts +6 -0
  366. package/dist/src/scenes/service.js +29 -25
  367. package/dist/src/scenes/taskFollowUp/agentExecutor.d.ts +36 -0
  368. package/dist/src/scenes/taskFollowUp/agentExecutor.js +149 -0
  369. package/dist/src/scenes/taskFollowUp/branchInventory.d.ts +38 -0
  370. package/dist/src/scenes/taskFollowUp/branchInventory.js +70 -0
  371. package/dist/src/scenes/taskFollowUp/contracts.d.ts +91 -0
  372. package/dist/src/scenes/taskFollowUp/contracts.js +100 -0
  373. package/dist/src/scenes/taskFollowUp/resources.d.ts +19 -0
  374. package/dist/src/scenes/taskFollowUp/resources.js +97 -0
  375. package/dist/src/scenes/taskFollowUp/service.d.ts +810 -0
  376. package/dist/src/scenes/taskFollowUp/service.js +710 -0
  377. package/dist/src/scenes/taskFollowUp/workspaceFingerprint.d.ts +2 -0
  378. package/dist/src/scenes/taskFollowUp/workspaceFingerprint.js +46 -0
  379. package/dist/src/scenes/templates.d.ts +2 -2
  380. package/dist/src/scenes/templates.js +1 -1
  381. package/dist/src/session/session-find.d.ts +17 -0
  382. package/dist/src/session/session-find.js +56 -0
  383. package/dist/src/session/store.d.ts +4 -0
  384. package/dist/src/session/store.js +43 -7
  385. package/dist/src/share/note-share-revocation.d.ts +3 -0
  386. package/dist/src/share/note-share-revocation.js +26 -0
  387. package/dist/src/storage/sqlite/migrations/190_scene_development.sql +37 -0
  388. package/dist/src/storage/sqlite/migrations/191_scene_task_follow_up.sql +27 -0
  389. package/dist/src/storage/sqlite/migrations/192_capability_operations.sql +20 -0
  390. package/dist/src/storage/sqlite/migrations/193_note_file_cleanup.sql +8 -0
  391. package/dist/src/storage/sqlite/migrations/194_capability_external_outcomes.sql +11 -0
  392. package/dist/src/storage/sqlite/migrations/195_automation_deleted_revisions.sql +4 -0
  393. package/dist/src/storage/sqlite/migrations/196_automation_run_requests.sql +23 -0
  394. package/dist/src/storage/sqlite/migrations/197_note_deletion_cleanup.sql +8 -0
  395. package/dist/src/storage/sqlite/migrations/198_project_workspace_creation.sql +7 -0
  396. package/dist/src/storage/sqlite/migrations/199_scene_resource_events.sql +488 -0
  397. package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
  398. package/dist/src/storage/sqlite/migrations/runner.js +6 -3
  399. package/dist/src/storage/sqlite/schema.js +1 -1
  400. package/dist/src/storage/sqlite/transaction.d.ts +5 -0
  401. package/dist/src/storage/sqlite/transaction.js +34 -3
  402. package/dist/src/tasks/capabilities/management.d.ts +195 -0
  403. package/dist/src/tasks/capabilities/management.js +111 -0
  404. package/dist/src/tasks/capabilities/read.d.ts +2 -0
  405. package/dist/src/tasks/capabilities/read.js +141 -0
  406. package/dist/src/tasks/capabilities/relations.d.ts +204 -0
  407. package/dist/src/tasks/capabilities/relations.js +140 -0
  408. package/dist/src/tasks/capabilities/runs.d.ts +2 -0
  409. package/dist/src/tasks/capabilities/runs.js +89 -0
  410. package/dist/src/tasks/capabilities/write.d.ts +207 -0
  411. package/dist/src/tasks/capabilities/write.js +107 -0
  412. package/dist/src/tasks/home-query-service.js +3 -2
  413. package/dist/src/tasks/index.d.ts +0 -1
  414. package/dist/src/tasks/index.js +9 -9
  415. package/dist/src/tasks/project-operating-view-service.js +2 -1
  416. package/dist/src/tasks/task-application-service.d.ts +1 -0
  417. package/dist/src/tasks/task-application-service.js +3 -2
  418. package/dist/src/tasks/task-change-events.js +5 -3
  419. package/dist/src/tasks/task-context-assembler.js +2 -1
  420. package/dist/src/tasks/task-deletion-service.js +2 -1
  421. package/dist/src/tasks/task-dependency-service.js +2 -1
  422. package/dist/src/tasks/task-handoff-service.js +2 -1
  423. package/dist/src/tasks/task-read-model-projector.js +2 -1
  424. package/dist/src/tasks/task-repository.d.ts +12 -7
  425. package/dist/src/tasks/task-repository.js +175 -154
  426. package/dist/src/tasks/task-run-coordinator.js +2 -1
  427. package/dist/src/tasks/task-run-dispatcher.js +2 -1
  428. package/dist/src/tasks/task-run-repository.d.ts +1 -0
  429. package/dist/src/tasks/task-run-repository.js +29 -14
  430. package/dist/src/tasks/task-signal-service.js +2 -1
  431. package/dist/src/tui/backends/embedded-backend.js +1 -1
  432. package/dist/src/tui/backends/gateway-realtime-backend.js +1 -1
  433. package/dist/src/tui/tui-commands.js +1 -1
  434. package/dist/src/user-context/config.d.ts +13 -0
  435. package/dist/src/user-context/config.js +2 -0
  436. package/dist/src/voice/platform-catalog.d.ts +1 -1
  437. package/dist/src/voice/realtime/runtime.js +3 -3
  438. package/dist/src/voice/stt/providers/alibaba-transcription.js +1 -1
  439. package/dist/src/voice/stt/providers/xopc-cloud-transcription.js +1 -1
  440. package/dist/src/voice/tts/providers/xopc-cloud-speech.js +1 -1
  441. package/dist/src/work-discovery/incremental-repository.js +1 -1
  442. package/dist/src/work-discovery/index.js +1 -1
  443. package/dist/src/work-discovery/repository.d.ts +1 -1
  444. package/dist/src/work-discovery/repository.js +3 -2
  445. package/dist/src/work-discovery/service.d.ts +4 -0
  446. package/dist/src/work-discovery/service.js +36 -11
  447. package/dist/src/workflows/context/workflow-context.js +3 -2
  448. package/dist/src/workflows/service/workflow-run-service.js +2 -1
  449. package/package.json +6 -2
  450. package/skills/THIRD_PARTY_NOTICES.md +2 -2
  451. package/skills/documents/xlsx/SKILL.md +5 -0
  452. package/skills/engineering/build-xopc-local-app/SKILL.md +2 -0
  453. package/skills/tools/find-skills/SKILL.md +3 -0
  454. package/dist/gateway/static/root/assets/activity-store-DVUTs1fk.js +0 -1
  455. package/dist/gateway/static/root/assets/agent-defaults-settings-panel-K3hTmu9d.js +0 -1
  456. package/dist/gateway/static/root/assets/appearance-settings-CU52MfIT.js +0 -1
  457. package/dist/gateway/static/root/assets/apps-page-ZpA1-6ad.js +0 -1
  458. package/dist/gateway/static/root/assets/automations-workspace-IEAxKRME.js +0 -7
  459. package/dist/gateway/static/root/assets/browser-settings-page-CU4VWsmX.js +0 -3
  460. package/dist/gateway/static/root/assets/capabilities-settings-panel-C9XQk3HL.js +0 -8
  461. package/dist/gateway/static/root/assets/channels-settings-Bqlhjooi.js +0 -1
  462. package/dist/gateway/static/root/assets/connector-service-page-BmH17JnO.js +0 -1
  463. package/dist/gateway/static/root/assets/connectors-page-zkx8Q-e6.js +0 -2
  464. package/dist/gateway/static/root/assets/desktop-pet-settings-CE4GOlMM.js +0 -1
  465. package/dist/gateway/static/root/assets/device-pairing-wizard-CdKJqnnw.js +0 -1
  466. package/dist/gateway/static/root/assets/files-Be5viEFY.js +0 -1
  467. package/dist/gateway/static/root/assets/gateway-realtime-CGOW0-b4.js +0 -1
  468. package/dist/gateway/static/root/assets/gateway-realtime-store-D4um_sV7.js +0 -1
  469. package/dist/gateway/static/root/assets/gateway-settings-CgXp2zq4.js +0 -1
  470. package/dist/gateway/static/root/assets/home-page-D6Idk732.js +0 -1
  471. package/dist/gateway/static/root/assets/index-1wIKA-kM.css +0 -1
  472. package/dist/gateway/static/root/assets/index-PFQHPGgi.js +0 -79
  473. package/dist/gateway/static/root/assets/local-app-workbench-page-BmAqTRb4.js +0 -2
  474. package/dist/gateway/static/root/assets/logs-page-ZjVYXXyM.js +0 -2
  475. package/dist/gateway/static/root/assets/management-settings-CSTkYVOZ.js +0 -1
  476. package/dist/gateway/static/root/assets/messages-4BtQKYlM.js +0 -3
  477. package/dist/gateway/static/root/assets/note-detail-panel-DuXCt-MM.js +0 -5
  478. package/dist/gateway/static/root/assets/notes-page-BjOgBVq5.js +0 -8
  479. package/dist/gateway/static/root/assets/product-delivery-CrAI8ZEa.js +0 -1
  480. package/dist/gateway/static/root/assets/project-detail-page-0zi4-i9X.js +0 -1
  481. package/dist/gateway/static/root/assets/projects-page-B18OxmJj.js +0 -1
  482. package/dist/gateway/static/root/assets/remote-access-hub-z-DxbuaE.js +0 -1
  483. package/dist/gateway/static/root/assets/runtime-tools-settings-panel-DGsBTbo6.js +0 -5
  484. package/dist/gateway/static/root/assets/scenes-page-Bgba03B_.js +0 -1
  485. package/dist/gateway/static/root/assets/schemas-BaskVM5g.js +0 -64
  486. package/dist/gateway/static/root/assets/sessions-page-B1t3bMsm.js +0 -1
  487. package/dist/gateway/static/root/assets/settings-advanced-gate-CBX0Ezhf.js +0 -1
  488. package/dist/gateway/static/root/assets/setup-status-panel-Bw71C2X3.js +0 -1
  489. package/dist/gateway/static/root/assets/shares-settings-BoVDQolc.js +0 -1
  490. package/dist/gateway/static/root/assets/skill-reload-api-DtTptpAt.js +0 -1
  491. package/dist/gateway/static/root/assets/task-detail-page-vgkiGo-D.js +0 -1
  492. package/dist/gateway/static/root/assets/theme-store-CegIlB8d.js +0 -1
  493. package/dist/gateway/static/root/assets/user-model-page-CAGafNfP.js +0 -2
  494. package/dist/gateway/static/root/assets/workflows-page-CSxHVs1p.js +0 -6
  495. package/skills/creative/algorithmic-art/SKILL.md +0 -44
  496. package/skills/creative/algorithmic-art/templates/generator-template.js +0 -27
  497. package/skills/creative/algorithmic-art/templates/viewer.html +0 -27
@@ -1,5 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/block-editor-D0LDiOTT.js","assets/rolldown-runtime-aKtaBQYM.js","assets/index-PFQHPGgi.js","assets/preload-helper-zJ_50EbN.js","assets/es2015-DBLcMg5B.js","assets/vendor-react-BOUWij0V.js","assets/dist-CxGUk8J-.js","assets/dist-CI_fqRk-.js","assets/floating-ui.dom-B7uQOZZW.js","assets/markdown-view-DYGPxPee.js","assets/dist-BGTk37IG.js","assets/chunk-KS7C4IRE-BMYIfy9x.js","assets/createLucideIcon-DPHK1VkS.js","assets/download-Dk-ZjtO6.js","assets/plus-Q2yW6OE7.js","assets/x-B_N4OPjy.js","assets/locale-store-DA0Z5jM_.js","assets/messages-4BtQKYlM.js","assets/cn-JdwAhgNB.js","assets/app-link-CKueEVbT.js","assets/product-delivery-CrAI8ZEa.js","assets/schemas-BaskVM5g.js","assets/copy-to-clipboard-HOJ79TWv.js","assets/markdown-view-DSjfHfaW.css","assets/dist-Che_jiQF.js","assets/vendor-swr-BIWyz7Rc.js","assets/check-DUBLcKHA.js","assets/popover-select-B-GDnZO9.js","assets/skeleton-BwbyijEw.js","assets/settings-shell-dialog-layer-BU3UuiJr.js","assets/settings-shell-layer-context-BTQUDoJ2.js","assets/circle-check-C23XjkUj.js","assets/copy-Dv6d4Dvw.js","assets/middleware-Pd0e8Igk.js","assets/gateway-realtime-CGOW0-b4.js","assets/gateway-realtime-store-D4um_sV7.js","assets/files-Be5viEFY.js","assets/tool-activity-BtJkgjFf.js","assets/button-CS04eWY9.js","assets/registry-api-C0DCx3wv.js","assets/gateway-startup-retry-Cf8OxlvY.js","assets/gateway-config-swr-DUDX42qY.js","assets/electron-env-Dit0bHgy.js","assets/activity-store-DVUTs1fk.js","assets/theme-store-CegIlB8d.js","assets/index-1wIKA-kM.css","assets/vendor-codemirror-DFxP3B9T.js","assets/with-selector-aYPsXwdl.js","assets/block-editor-BdOTO0Yo.css","assets/markdown-editor-BhBJANcx.js","assets/code-editor-CXIH8jQw.js","assets/languages-BFe8nIOO.js"])))=>i.map(i=>d[i]);
2
- 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"./preload-helper-zJ_50EbN.js";import{f as a,t as o}from"./chunk-KS7C4IRE-BMYIfy9x.js";import{t as s}from"./check-DUBLcKHA.js";import{n as c,r as l}from"./popover-select-B-GDnZO9.js";import{t as u}from"./circle-check-C23XjkUj.js";import{t as d}from"./copy-Dv6d4Dvw.js";import{t as f}from"./download-Dk-ZjtO6.js";import{t as p}from"./x-B_N4OPjy.js";import{t as m}from"./cn-JdwAhgNB.js";import{a as h,f as g,n as _,r as v}from"./locale-store-DA0Z5jM_.js";import{t as y}from"./messages-4BtQKYlM.js";import{a as b,i as x,n as S,o as C,r as w,s as T,t as E}from"./dist-BGTk37IG.js";import{t as D}from"./copy-to-clipboard-HOJ79TWv.js";import{i as O}from"./vendor-swr-BIWyz7Rc.js";import{t as k}from"./button-CS04eWY9.js";import{i as A}from"./theme-store-CegIlB8d.js";import{t as j}from"./skeleton-BwbyijEw.js";import{$t as M,An as N,Cn as P,Do as F,Ec as I,En as L,Gn as R,In as ee,Jn as te,Kn as ne,Ll as z,Ln as re,Mi as ie,Mn as ae,Mu as B,Nn as oe,Oi as se,On as ce,Pn as V,Qi as le,Ql as ue,Qt as de,Sn as fe,Ti as pe,Tn as H,Uc as U,Un as me,Wn as he,Xn as W,Xu as ge,Yu as _e,a as G,au as ve,bn as ye,bt as be,c as xe,dc as Se,do as Ce,er as we,fl as Te,hc as Ee,iu as De,jc as Oe,ji as K,jn as q,kn as ke,l as J,mu as Ae,nc as je,nr as Me,o as Ne,qn as Pe,rc as Fe,rr as Ie,ru as Le,s as Re,sl as ze,tc as Be,tr as Ve,wi as Y,wn as He,xc as Ue,xl as X,xn as We,yn as Ge,zc as Ke,zn as qe}from"./index-PFQHPGgi.js";var Je=n(),Z=e(t(),1),Q=r(),Ye=(0,Z.createContext)(null);function Xe(){let e=(0,Je.c)(1),t=(0,Z.useContext)(Ye);if(!t){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={openImage:Ze},e[0]=t):t=e[0],t}return t}function Ze(){}function Qe(e){let t=(0,Je.c)(22),{children:n,closeLabel:r}=e,i=r===void 0?`Close`:r,[a,o]=(0,Z.useState)(null),s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(e,t)=>{o({src:e,alt:t})},t[0]=s):s=t[0];let c=s,l;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(l={openImage:c},t[1]=l):l=t[1];let u=l,d=a!==null,f;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=e=>{e||o(null)},t[2]=f):f=t[2];let h;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Q.jsx)(b,{className:`fixed inset-0 z-[70] bg-scrim/90 backdrop-blur-sm`}),t[3]=h):h=t[3];let g;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(g=m(`fixed inset-0 z-[71] flex items-center justify-center p-4 outline-none`,`data-[state=open]:animate-in data-[state=closed]:animate-out`),t[4]=g):g=t[4];let _=a?.alt||`Image preview`,v;t[5]===_?v=t[6]:(v=(0,Q.jsx)(T,{className:`sr-only`,children:_}),t[5]=_,t[6]=v);let y;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Q.jsx)(p,{className:`size-5`,"aria-hidden":!0}),t[7]=y):y=t[7];let x;t[8]===i?x=t[9]:(x=(0,Q.jsx)(S,{asChild:!0,children:(0,Q.jsx)(`button`,{type:`button`,"aria-label":i,className:`absolute right-4 top-4 z-10 rounded-lg bg-surface-panel/80 p-2 text-fg-muted backdrop-blur transition-colors hover:bg-surface-hover hover:text-fg`,children:y})}),t[8]=i,t[9]=x);let D;t[10]===a?D=t[11]:(D=a?(0,Q.jsx)(`img`,{src:a.src,alt:a.alt??``,className:`max-h-[min(90vh,900px)] max-w-[min(95vw,1200px)] rounded-lg object-contain shadow-lg`}):null,t[10]=a,t[11]=D);let O;t[12]!==x||t[13]!==D||t[14]!==v?(O=(0,Q.jsxs)(C,{children:[h,(0,Q.jsxs)(w,{className:g,"aria-describedby":void 0,children:[v,x,D]})]}),t[12]=x,t[13]=D,t[14]=v,t[15]=O):O=t[15];let k;t[16]!==O||t[17]!==d?(k=(0,Q.jsx)(E,{open:d,onOpenChange:f,children:O}),t[16]=O,t[17]=d,t[18]=k):k=t[18];let A;return t[19]!==n||t[20]!==k?(A=(0,Q.jsxs)(Ye.Provider,{value:u,children:[n,k]}),t[19]=n,t[20]=k,t[21]=A):A=t[21],A}var $e=6e4,et=36e5,$=864e5;function tt(e){let t=new Date(e);return t.setHours(0,0,0,0),t.getTime()}function nt(e,t,n){let r=t-e;if(r<$e)return n.justNow;if(r<et){let e=Math.floor(r/$e);return n.minutesAgo.replace(`{{n}}`,String(e))}let i=tt(t);if(e>=i)return n.today+` `+new Date(e).toLocaleTimeString(n.locale,{hour:`2-digit`,minute:`2-digit`});if(e>=i-$)return n.yesterday+` `+new Date(e).toLocaleTimeString(n.locale,{hour:`2-digit`,minute:`2-digit`});if(r<7*$){let e=Math.floor(r/$);return n.daysAgo.replace(`{{n}}`,String(e))}return new Date(e).toLocaleDateString(n.locale,{month:`short`,day:`numeric`})}function rt(e,t,n){let r=tt(t);if(e>=r)return n.today;if(e>=r-$)return n.yesterday;let i=new Date(e),a=new Date(t);return i.getFullYear()===a.getFullYear()?i.toLocaleDateString(n.locale,{month:`long`,day:`numeric`}):i.toLocaleDateString(n.locale,{year:`numeric`,month:`long`,day:`numeric`})}function it(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)}`}function at(e){let t=(0,Je.c)(45),{title:n,description:r,prompt:i,coverage:o,className:s,variant:c}=e,l=c===void 0?`card`:c,d=_(ct),f=y(d).automations.suggestions,p=y(d).automations,h=a(),g;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(g={revalidateOnFocus:!1,refreshInterval:15e3},t[0]=g):g=t[0];let{data:v}=O(o?`automation-suggestion-coverage`:null,st,g),b=o?v?.automations.find(e=>xe(e,o)):void 0,x=b?Ne(b,p):[];if(l===`titleAction`){if(b){let e;t[1]===s?e=t[2]:(e=m(`flex min-w-0 items-center gap-2 rounded-lg border border-emerald-500/25 bg-emerald-500/10 px-2.5 py-1.5`,s),t[1]=s,t[2]=e);let n;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsx)(u,{className:`size-3.5 shrink-0 text-emerald-700 dark:text-emerald-300`,"aria-hidden":!0}),t[3]=n):n=t[3];let r;return t[4]===h?r=t[5]:(r=()=>h(`/automations`),t[4]=h,t[5]=r),(0,Q.jsxs)(`section`,{className:e,children:[n,(0,Q.jsx)(`span`,{className:`min-w-0 truncate text-xs font-medium text-fg`,children:f.coveredTitle}),(0,Q.jsx)(k,{variant:`ghost`,className:`h-7 shrink-0 rounded-md px-2 text-xs`,onClick:r,children:f.manage})]})}let e;t[6]===s?e=t[7]:(e=m(`flex min-w-0 items-center gap-2 rounded-lg bg-surface-panel px-2.5 py-1.5 shadow-surface`,s),t[6]=s,t[7]=e);let a;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(X,{className:`size-3.5 shrink-0 text-accent`,"aria-hidden":!0}),t[8]=a):a=t[8];let o;t[9]!==r||t[10]!==n?(o=(0,Q.jsx)(`span`,{className:`min-w-0 truncate text-xs font-medium text-fg`,title:r,children:n}),t[9]=r,t[10]=n,t[11]=o):o=t[11];let c;t[12]!==h||t[13]!==i?(c=()=>{h(`/automations?${new URLSearchParams({draft:i,autogenerate:`1`}).toString()}`)},t[12]=h,t[13]=i,t[14]=c):c=t[14];let l;return t[15]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Q.jsx)(Ee,{className:`size-3.5`,"aria-hidden":!0}),t[15]=l):l=t[15],(0,Q.jsxs)(`section`,{className:e,children:[a,o,(0,Q.jsxs)(k,{variant:`secondary`,className:`h-7 shrink-0 rounded-md px-2 text-xs`,onClick:c,children:[l,f.setup]})]})}if(b){let e;t[16]===s?e=t[17]:(e=m(`rounded-lg border border-emerald-500/25 bg-emerald-500/10 p-3`,s),t[16]=s,t[17]=e);let n;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsx)(u,{className:`mt-0.5 size-4 shrink-0 text-emerald-700 dark:text-emerald-300`,"aria-hidden":!0}),t[18]=n):n=t[18];let r;t[19]===h?r=t[20]:(r=()=>h(`/automations`),t[19]=h,t[20]=r);let i;return t[21]!==f||t[22]!==r?(i=(0,Q.jsx)(`div`,{className:`mt-3 flex justify-end`,children:(0,Q.jsx)(k,{variant:`ghost`,className:`h-8 rounded-md px-2.5 text-xs`,onClick:r,children:f.manage})}),t[21]=f,t[22]=r,t[23]=i):i=t[23],(0,Q.jsxs)(`section`,{className:e,children:[(0,Q.jsxs)(`div`,{className:`flex items-start gap-2`,children:[n,(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:f.coveredTitle}),(0,Q.jsx)(`p`,{className:`mt-1 break-words text-xs leading-5 text-fg-muted`,children:Re(f.coveredDescription,{name:b.name})})]})]}),(0,Q.jsxs)(`div`,{className:`mt-2 rounded-md bg-surface-base/55 px-2.5 py-2`,children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg`,children:p.explain.whyCovered}),(0,Q.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-1.5`,children:x.map(ot)})]}),i]})}let S;t[24]===s?S=t[25]:(S=m(`rounded-lg bg-surface-panel p-3 shadow-surface`,s),t[24]=s,t[25]=S);let C;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Q.jsx)(X,{className:`mt-0.5 size-4 shrink-0 text-accent`,"aria-hidden":!0}),t[26]=C):C=t[26];let w;t[27]===n?w=t[28]:(w=(0,Q.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:n}),t[27]=n,t[28]=w);let T;t[29]===r?T=t[30]:(T=(0,Q.jsx)(`p`,{className:`mt-1 break-words text-xs leading-5 text-fg-muted`,children:r}),t[29]=r,t[30]=T);let E;t[31]!==w||t[32]!==T?(E=(0,Q.jsxs)(`div`,{className:`flex items-start gap-2`,children:[C,(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[w,T]})]}),t[31]=w,t[32]=T,t[33]=E):E=t[33];let D;t[34]!==h||t[35]!==i?(D=()=>{h(`/automations?${new URLSearchParams({draft:i,autogenerate:`1`}).toString()}`)},t[34]=h,t[35]=i,t[36]=D):D=t[36];let A;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Q.jsx)(Ee,{className:`size-3.5`,"aria-hidden":!0}),t[37]=A):A=t[37];let j;t[38]!==f.create||t[39]!==D?(j=(0,Q.jsx)(`div`,{className:`mt-3 flex justify-end`,children:(0,Q.jsxs)(k,{variant:`secondary`,className:`h-8 rounded-md px-2.5 text-xs`,onClick:D,children:[A,f.create]})}),t[38]=f.create,t[39]=D,t[40]=j):j=t[40];let M;return t[41]!==j||t[42]!==S||t[43]!==E?(M=(0,Q.jsxs)(`section`,{className:S,children:[E,j]}),t[41]=j,t[42]=S,t[43]=E,t[44]=M):M=t[44],M}function ot(e){return(0,Q.jsx)(`span`,{className:`rounded-full bg-surface-panel px-2 py-0.5 text-xs text-fg-muted`,children:e},e)}function st(){return J.list()}function ct(e){return e.language}function lt(e){let t=(0,Je.c)(51),{initial:n,zh:r,busy:i,onClose:a,onSave:o}=e,[s,c]=(0,Z.useState)(n),l;t[0]!==i||t[1]!==a?(l=e=>{!e&&!i&&a()},t[0]=i,t[1]=a,t[2]=l):l=t[2];let u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Q.jsx)(b,{className:`xopc-dialog-overlay fixed inset-0 z-[70] bg-scrim backdrop-blur-[2px]`}),t[3]=u):u=t[3];let d=r?`编辑纪要内容`:`Edit meeting content`,f;t[4]===d?f=t[5]:(f=(0,Q.jsx)(`header`,{className:`border-b border-edge p-4`,children:(0,Q.jsx)(T,{children:d})}),t[4]=d,t[5]=f);let p=r?`人工修改会保留,重新整理不会覆盖。已创建任务保持不变。`:`Your changes survive regeneration. Existing tasks remain unchanged.`,m;t[6]===p?m=t[7]:(m=(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:p}),t[6]=p,t[7]=m);let h=r?`内容`:`Content`,g;t[8]===s?g=t[9]:(g=e=>c({...s,text:e.target.value}),t[8]=s,t[9]=g);let _;t[10]!==s.text||t[11]!==g?(_=(0,Q.jsx)(`textarea`,{className:`mt-1 min-h-32 w-full rounded border border-edge bg-transparent p-2`,value:s.text,onChange:g}),t[10]=s.text,t[11]=g,t[12]=_):_=t[12];let v;t[13]!==h||t[14]!==_?(v=(0,Q.jsxs)(`label`,{className:`block text-sm`,children:[h,_]}),t[13]=h,t[14]=_,t[15]=v):v=t[15];let y;t[16]!==s||t[17]!==r?(y=s.kind===`actionItems`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`label`,{className:`block text-sm`,children:[r?`负责人原话`:`Owner as stated`,(0,Q.jsx)(`input`,{className:`mt-1 w-full rounded border border-edge bg-transparent p-2`,value:s.owner??``,onChange:e=>c({...s,owner:e.target.value})})]}),(0,Q.jsxs)(`label`,{className:`block text-sm`,children:[r?`期限原话`:`Date as stated`,(0,Q.jsx)(`input`,{className:`mt-1 w-full rounded border border-edge bg-transparent p-2`,value:s.dueDate??``,onChange:e=>c({...s,dueDate:e.target.value})})]})]}):null,t[16]=s,t[17]=r,t[18]=y):y=t[18];let x;t[19]!==s||t[20]!==r?(x=s.kind===`summary`?null:(0,Q.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:!!s.ignored,onChange:e=>c({...s,ignored:e.target.checked})}),r?`忽略此项`:`Ignore this item`]}),t[19]=s,t[20]=r,t[21]=x):x=t[21];let S;t[22]!==v||t[23]!==y||t[24]!==x||t[25]!==m?(S=(0,Q.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto p-4`,children:[m,v,y,x]}),t[22]=v,t[23]=y,t[24]=x,t[25]=m,t[26]=S):S=t[26];let D=r?`取消`:`Cancel`,O;t[27]!==i||t[28]!==a||t[29]!==D?(O=(0,Q.jsx)(k,{disabled:i,onClick:a,children:D}),t[27]=i,t[28]=a,t[29]=D,t[30]=O):O=t[30];let A;t[31]!==i||t[32]!==s.text?(A=i||!s.text.trim(),t[31]=i,t[32]=s.text,t[33]=A):A=t[33];let j;t[34]!==s||t[35]!==o?(j=()=>void o(s),t[34]=s,t[35]=o,t[36]=j):j=t[36];let M=r?`保存修改`:`Save changes`,N;t[37]!==A||t[38]!==j||t[39]!==M?(N=(0,Q.jsx)(k,{variant:`primary`,disabled:A,onClick:j,children:M}),t[37]=A,t[38]=j,t[39]=M,t[40]=N):N=t[40];let P;t[41]!==O||t[42]!==N?(P=(0,Q.jsxs)(`footer`,{className:`flex justify-end gap-2 border-t border-edge p-3`,children:[O,N]}),t[41]=O,t[42]=N,t[43]=P):P=t[43];let F;t[44]!==S||t[45]!==P||t[46]!==f?(F=(0,Q.jsxs)(C,{children:[u,(0,Q.jsxs)(w,{"aria-describedby":void 0,className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[71] flex h-[min(32rem,90dvh)] w-[min(36rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay`,children:[f,S,P]})]}),t[44]=S,t[45]=P,t[46]=f,t[47]=F):F=t[47];let I;return t[48]!==l||t[49]!==F?(I=(0,Q.jsx)(E,{open:!0,onOpenChange:l,children:F}),t[48]=l,t[49]=F,t[50]=I):I=t[50],I}var ut=e=>`${String(Math.floor(e/6e4)).padStart(2,`0`)}:${String(Math.floor(e/1e3)%60).padStart(2,`0`)}`;function dt({noteId:e}){let t=_(e=>e.language)===`zh`,{data:n,mutate:r,isLoading:i}=O([`note-discussion-document`,e],()=>de(e),{refreshInterval:e=>e&&([`recording`,`stopping`,`sealing`,`organizing`].includes(e.discussion.status)||e.recordingJob?.state===`queued`||e.recordingJob?.state===`running`)?3e3:0}),a=n?.discussion.id,u=`/api/discussions/${encodeURIComponent(a??``)}`,{data:d=[],mutate:m}=O(a?`${u}/actions`:null,e=>h(v(e)),{refreshInterval:1e4}),[g,y]=(0,Z.useState)(`summary`),[x,S]=(0,Z.useState)(``),[D,A]=(0,Z.useState)(`general`),[N,P]=(0,Z.useState)(null),[F,L]=(0,Z.useState)(null),[R,ee]=(0,Z.useState)(null),[te,ne]=(0,Z.useState)(!1),[z,re]=(0,Z.useState)([]),[ie,ae]=(0,Z.useState)(null),[B,oe]=(0,Z.useState)(!1),[se,ce]=(0,Z.useState)(1),V=(0,Z.useRef)(null),le=(0,Z.useRef)(null),[fe,pe]=(0,Z.useState)(0);(0,Z.useEffect)(()=>{let e=()=>{r(),m()};return window.addEventListener(`discussion-updated`,e),window.addEventListener(`discussion-segment-updated`,e),()=>{window.removeEventListener(`discussion-updated`,e),window.removeEventListener(`discussion-segment-updated`,e)}},[r,m]),(0,Z.useEffect)(()=>{n?.discussion.template&&A(n.discussion.template)},[n?.discussion.template]);async function H(e){if(!B){oe(!0),ae(null);try{await e(),await r(),await m()}catch(e){ae(e instanceof Error?e.message:String(e))}finally{oe(!1)}}}function U(e){V.current&&(V.current.readyState===0?(le.current=e/1e3,V.current.load()):V.current.currentTime=e/1e3,V.current.play().catch(()=>void 0))}async function me(e,t){n?.organization&&await H(async()=>{P((await h(v(`${u}/transcript?revision=${t??n.organization.transcriptRevision}`))).segments.filter(t=>e.includes(t.sequence)))})}let he=(e,n,r)=>n.some(e=>te||!e.ignored)?(0,Q.jsxs)(`section`,{className:`space-y-2`,children:[(0,Q.jsx)(`h3`,{className:`font-semibold text-fg`,children:e}),n.filter(e=>te||!e.ignored).map(e=>(0,Q.jsxs)(`div`,{className:`flex items-start gap-3 text-sm`,children:[(0,Q.jsxs)(`p`,{className:`flex-1 whitespace-pre-wrap`,children:[e.text,e.supersededBy||e.disputedBy?(0,Q.jsx)(`span`,{className:`ml-2 text-xs text-fg-muted`,children:t?`有后续变更`:`Later changes`}):null,e.editedByUser?(0,Q.jsx)(`span`,{className:`ml-2 text-xs text-fg-muted`,children:t?e.ignored?`已忽略`:`人工编辑`:e.ignored?`Ignored`:`Edited`}):null]}),(0,Q.jsx)(`button`,{className:`text-xs text-fg-muted`,disabled:B,onClick:()=>ee({kind:r,itemId:e.id,text:e.text,ignored:e.ignored}),children:t?`编辑`:`Edit`}),e.evidenceSegmentIds.length?(0,Q.jsx)(`button`,{disabled:B,className:`shrink-0 text-accent-fg`,onClick:()=>void me(e.evidenceSegmentIds,e.evidenceRevision),children:t?`原话`:`Source`}):(0,Q.jsx)(`span`,{className:`text-xs text-fg-muted`,children:t?`暂无定位`:`No source timing`})]},e.id))]}):null;if(i)return(0,Q.jsx)(j,{className:`h-48 w-full`});if(!n)return null;let{discussion:W,transcript:ge,organization:_e}=n,G=_e?.organization,ve=[`stopping`,`sealing`,`organizing`].includes(W.status),ye=[`recording`,`completed`,`needs_attention`].includes(W.status),be=ge.segments.filter(e=>(e.displayText??e.rawText??``).toLocaleLowerCase().includes(x.toLocaleLowerCase())||e.speakerLabel?.toLocaleLowerCase().includes(x.toLocaleLowerCase()));return(0,Q.jsxs)(`section`,{className:`relative flex h-full min-h-0 w-full flex-col text-fg`,children:[(0,Q.jsxs)(`header`,{className:`flex shrink-0 flex-wrap items-center gap-3 border-b border-edge-subtle p-4`,children:[(0,Q.jsx)(ue,{className:`size-4 text-accent`}),(0,Q.jsxs)(`span`,{className:`text-sm font-medium`,children:[ut(W.durationMs??0),` · `,ve?t?`正在整理`:`Processing`:W.status===`completed`?t?`整理完成`:`Ready`:W.status]}),(0,Q.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,Q.jsxs)(c,{value:D,"aria-label":t?`纪要模板`:`Summary template`,onChange:e=>A(e.target.value),children:[(0,Q.jsx)(l,{value:`general`,children:t?`通用会议`:`General`}),(0,Q.jsx)(l,{value:`project`,children:t?`项目例会`:`Project`}),(0,Q.jsx)(l,{value:`review`,children:t?`需求评审`:`Review`}),(0,Q.jsx)(l,{value:`interview`,children:t?`客户访谈`:`Interview`})]}),(0,Q.jsxs)(k,{disabled:B||ve||!W.canonicalTranscript,onClick:()=>void H(()=>h(v(`${u}/organize`),{method:`POST`,body:JSON.stringify({template:D})})),children:[(0,Q.jsx)(Oe,{className:`size-3.5`}),t?`重新整理`:`Regenerate`]})]})]}),(0,Q.jsxs)(`nav`,{"aria-label":t?`会议内容`:`Meeting content`,className:`flex shrink-0 items-center gap-4 border-b border-edge-subtle px-4 py-2 text-sm`,children:[[`summary`,`transcript`].map(e=>(0,Q.jsx)(`button`,{className:g===e?`font-medium text-accent-fg`:`text-fg-muted`,onClick:()=>y(e),children:e===`summary`?t?`纪要与行动`:`Summary & actions`:t?`逐字稿`:`Transcript`},e)),(0,Q.jsxs)(`div`,{className:`ml-auto flex items-center gap-2 text-xs`,children:[(0,Q.jsx)(f,{className:`size-3`}),[`md`,`txt`,`srt`].map(e=>(0,Q.jsx)(`a`,{className:`text-accent-fg`,href:v(`${u}/export?format=${e}`),download:!0,children:e.toUpperCase()},e))]})]}),ie?(0,Q.jsx)(`p`,{role:`alert`,className:`px-4 py-2 text-sm text-danger`,children:ie}):null,n.recordingJob?.state===`queued`||n.recordingJob?.state===`running`?(0,Q.jsx)(`p`,{role:`status`,className:`px-4 py-2 text-sm text-fg-muted`,children:t?`录音已上传,正在后台校验与保存。关闭此页面不会中断处理。`:`Recording uploaded. Verification and saving continue in the background, even if you close this page.`}):null,W.status===`needs_attention`?(0,Q.jsxs)(`div`,{className:`flex gap-2 p-4 text-sm text-danger`,children:[(0,Q.jsx)(`span`,{children:W.failureMessage}),(0,Q.jsx)(`button`,{disabled:B,onClick:()=>void H(()=>M(W.id)),children:t?`重试`:`Retry`})]}):null,_e&&_e.transcriptRevision!==ge.revision?(0,Q.jsx)(`p`,{className:`px-4 py-2 text-xs text-fg-muted`,children:t?`转写已修改,当前纪要引用的是修改前版本。重新整理可生成新版纪要。`:`Transcript changed. This summary cites the previous revision; regenerate to update.`}):null,(0,Q.jsx)(`main`,{className:`min-h-0 flex-1 overflow-y-auto p-4 sm:p-6`,children:g===`summary`?G?(0,Q.jsxs)(`div`,{className:`mx-auto max-w-3xl space-y-6`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-fg-muted`,children:[(0,Q.jsx)(`span`,{children:G.summaryEditedByUser?t?`概要已人工编辑`:`Overview edited`:``}),(0,Q.jsx)(`button`,{disabled:B||ve,onClick:()=>ee({kind:`summary`,itemId:`summary`,text:G.summary}),children:t?`编辑概要`:`Edit overview`})]}),(0,Q.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-7`,children:G.summary}),(0,Q.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-fg-muted`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:te,onChange:e=>ne(e.target.checked)}),t?`显示已忽略项`:`Show ignored items`]}),z.length?(0,Q.jsx)(k,{disabled:B,onClick:()=>void H(async()=>{for(let e of z)await h(v(`${u}/actions/${encodeURIComponent(e)}/convert`),{method:`POST`,body:JSON.stringify({organizationRevision:_e.revision})});re([])}),children:t?`加入所选 ${z.length} 项任务`:`Add ${z.length} selected tasks`}):null,he(t?`已决定事项`:`Decisions`,G.decisions,`decisions`),G.actionItems.length?(0,Q.jsxs)(`section`,{className:`space-y-3`,children:[(0,Q.jsx)(`h3`,{className:`font-semibold`,children:t?`下一步行动`:`Next actions`}),G.actionItems.filter(e=>te||!e.ignored).map(e=>{let n=d.find(t=>t.actionId===e.id);return(0,Q.jsxs)(`article`,{className:`rounded-lg border border-edge-subtle p-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-start gap-2`,children:[!n&&!e.ignored&&(!(e.supersededBy||e.disputedBy)||e.reviewedChangeId===(e.supersededBy??e.disputedBy))?(0,Q.jsx)(`input`,{type:`checkbox`,"aria-label":`${t?`选择行动`:`Select action`}: ${e.title}`,className:`ui-checkbox`,checked:z.includes(e.id),onChange:t=>re(t.target.checked?[...z,e.id]:z.filter(t=>t!==e.id))}):null,(0,Q.jsxs)(`p`,{className:`flex-1 text-sm font-medium`,children:[e.title,e.supersededBy||e.disputedBy?(0,Q.jsx)(`span`,{className:`ml-2 text-xs text-fg-muted`,children:t?`有后续变更,请复核`:`Review later changes`}):null,e.editedByUser?(0,Q.jsx)(`span`,{className:`ml-2 text-xs text-fg-muted`,children:t?e.ignored?`已忽略`:`人工编辑`:e.ignored?`Ignored`:`Edited`}):null]}),(0,Q.jsx)(`button`,{className:`text-xs text-fg-muted`,disabled:B||ve,onClick:()=>ee({kind:`actionItems`,itemId:e.id,text:e.title,owner:e.owner,dueDate:e.dueDate,ignored:e.ignored}),children:t?`编辑`:`Edit`})]}),(0,Q.jsxs)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:[e.owner??(t?`负责人未明确`:`Owner unspecified`),` · `,e.dueDate??(t?`期限未明确`:`Date unspecified`)]}),(0,Q.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-3 text-xs`,children:[e.evidenceSegmentIds.length?(0,Q.jsx)(`button`,{disabled:B,className:`text-accent-fg`,onClick:()=>void me(e.evidenceSegmentIds,e.evidenceRevision),children:t?`查看原话`:`Source`}):null,n?n.deleted?(0,Q.jsx)(`span`,{children:t?`关联任务已删除`:`Linked task deleted`}):(0,Q.jsx)(o,{className:`text-accent-fg`,to:`/tasks/${encodeURIComponent(n.taskId)}`,children:n.resolution===`done`?t?`已完成 · 查看任务`:`Done · View task`:t?`查看任务 / 交给助手`:`View task / Delegate`}):e.ignored?null:(0,Q.jsx)(k,{disabled:B||!!(e.supersededBy||e.disputedBy)&&e.reviewedChangeId!==(e.supersededBy??e.disputedBy),onClick:()=>void H(()=>h(v(`${u}/actions/${encodeURIComponent(e.id)}/convert`),{method:`POST`,body:JSON.stringify({organizationRevision:_e.revision})})),children:t?`加入我的任务`:`Add to my tasks`})]})]},e.id)})]}):null,he(t?`风险`:`Risks`,G.risks,`risks`),he(t?`尚未确定`:`Open questions`,G.openQuestions,`openQuestions`),G.changes?.length?(0,Q.jsxs)(`section`,{className:`space-y-3`,children:[(0,Q.jsx)(`h3`,{className:`font-semibold`,children:t?`前后变更`:`Changes during the meeting`}),G.changes.map(e=>{let n=[...G.decisions,...G.actionItems,...G.risks,...G.openQuestions],r=n.find(t=>t.id===e.fromId),i=n.find(t=>t.id===e.toId);return!r||!i?null:(0,Q.jsxs)(`article`,{className:`space-y-2 rounded border border-edge p-3 text-sm`,children:[(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:e.relation===`supersedes`?t?`后续撤销或替代`:`Later superseded`:t?`存在冲突,尚未明确解决`:`Unresolved conflict`}),(0,Q.jsx)(`button`,{className:`block text-left text-accent-fg`,onClick:()=>void me(r.evidenceSegmentIds,r.evidenceRevision),children:`title`in r?r.title:r.text}),(0,Q.jsx)(`span`,{children:`↓`}),(0,Q.jsx)(`button`,{className:`block text-left text-accent-fg`,onClick:()=>void me(i.evidenceSegmentIds,i.evidenceRevision),children:`title`in i?i.title:i.text})]},`${e.fromId}:${e.toId}`)})]}):null,G.chapters.length?(0,Q.jsxs)(`section`,{className:`space-y-3`,children:[(0,Q.jsx)(`h3`,{className:`font-semibold`,children:t?`章节回顾`:`Chapters`}),G.chapters.map((e,t)=>(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`button`,{className:`text-sm text-accent-fg`,onClick:()=>U(e.startedAtMs),children:[ut(e.startedAtMs),` · `,e.title]}),(0,Q.jsx)(`p`,{className:`mt-1 whitespace-pre-wrap text-sm text-fg-muted`,children:e.summary})]},t))]}):null]}):(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:ve?t?`录音已保存,纪要正在生成。可以先查看逐字稿。`:`Recording saved. Summary is processing; you can read the transcript.`:t?`录音结束后自动生成纪要。`:`Summary appears after recording ends.`}),ve?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(j,{className:`h-6 w-3/4`}),(0,Q.jsx)(j,{className:`h-24 w-full`})]}):null]}):(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(`label`,{className:`flex items-center gap-2 rounded-md border border-edge px-3`,children:[(0,Q.jsx)(I,{className:`size-4 text-fg-muted`}),(0,Q.jsx)(`input`,{className:`w-full bg-transparent py-2 text-sm outline-none`,placeholder:t?`查找原话或说话人`:`Search words or speaker`,value:x,onChange:e=>{S(e.target.value),ce(1)}})]}),be.slice(0,se*50).map(e=>(0,Q.jsxs)(`article`,{className:`rounded-md border p-3 ${fe>=e.startedAtMs&&fe<e.endedAtMs?`border-accent`:`border-edge-subtle`}`,children:[(0,Q.jsxs)(`div`,{className:`mb-2 flex items-center gap-3 text-xs text-fg-muted`,children:[(0,Q.jsxs)(`button`,{className:`inline-flex items-center gap-1 text-accent-fg`,onClick:()=>U(e.startedAtMs),children:[(0,Q.jsx)(Ke,{className:`size-3`}),ut(e.startedAtMs)]}),(0,Q.jsx)(`span`,{children:e.speakerLabel??(t?`未区分说话人`:`Speaker unknown`)}),ye&&e.status===`confirmed`?(0,Q.jsx)(`button`,{className:`ml-auto`,onClick:()=>L({segment:e,text:e.displayText??e.rawText??``,speaker:e.speakerLabel??``}),children:t?`校对`:`Edit`}):null]}),(0,Q.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-6`,children:e.displayText??e.rawText??(t?`等待转写`:`Awaiting transcription`)})]},e.sequence)),be.length>se*50?(0,Q.jsx)(k,{onClick:()=>ce(se+1),children:t?`加载更多`:`More`}):null]})}),W.audioAttachmentId&&!W.audioDeletedAt?(0,Q.jsxs)(`footer`,{className:`shrink-0 border-t border-edge-subtle p-3`,children:[(0,Q.jsx)(`audio`,{ref:V,controls:!0,preload:`metadata`,className:`h-10 w-full`,src:v(`${u}/audio`),onTimeUpdate:()=>pe((V.current?.currentTime??0)*1e3),onLoadedMetadata:()=>{le.current!==null&&V.current&&(V.current.currentTime=le.current,le.current=null)},onError:()=>ae(t?`录音暂不可播放`:`Recording unavailable`)}),(0,Q.jsx)(`a`,{className:`mt-1 block text-right text-xs text-accent-fg`,href:v(`${u}/audio`),download:!0,children:t?`下载录音`:`Download recording`})]}):null,N?(0,Q.jsxs)(`aside`,{"aria-label":t?`原话证据`:`Source evidence`,className:`absolute inset-y-0 right-0 z-10 flex w-[min(26rem,100%)] flex-col border-l border-edge bg-surface-panel`,children:[(0,Q.jsxs)(`header`,{className:`flex shrink-0 items-center justify-between border-b border-edge p-4`,children:[(0,Q.jsx)(`h3`,{children:t?`原话证据`:`Source evidence`}),(0,Q.jsx)(`button`,{"aria-label":t?`关闭`:`Close`,onClick:()=>P(null),children:(0,Q.jsx)(p,{className:`size-4`})})]}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto p-4`,children:N.length?N.map(e=>(0,Q.jsxs)(`article`,{children:[(0,Q.jsxs)(`button`,{className:`mb-2 text-xs text-accent-fg`,onClick:()=>U(e.startedAtMs),children:[ut(e.startedAtMs),` · `,e.speakerLabel??(t?`说话人未明确`:`Unknown speaker`)]}),(0,Q.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-7`,children:e.displayText??e.rawText})]},e.sequence)):(0,Q.jsx)(`p`,{children:t?`此版本暂无可定位原话。`:`No timed source available for this revision.`})})]}):null,R&&_e?(0,Q.jsx)(lt,{initial:R,zh:t,busy:B,onClose:()=>ee(null),onSave:e=>H(async()=>{await h(v(`${u}/summary`),{method:`PATCH`,body:JSON.stringify({...e,expectedRevision:_e.revision})}),ee(null)})},`${R.kind}:${R.itemId}:${_e.revision}`):null,F?(0,Q.jsx)(E,{open:!0,onOpenChange:e=>{e||L(null)},children:(0,Q.jsxs)(C,{children:[(0,Q.jsx)(b,{className:`xopc-dialog-overlay fixed inset-0 z-[70] bg-scrim backdrop-blur-[2px]`}),(0,Q.jsxs)(w,{"aria-describedby":void 0,className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[71] flex h-[min(28rem,90dvh)] w-[min(36rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay`,children:[(0,Q.jsxs)(`header`,{className:`flex items-center justify-between border-b border-edge p-4`,children:[(0,Q.jsx)(T,{children:t?`校对逐字稿`:`Edit transcript`}),(0,Q.jsx)(`button`,{"aria-label":t?`关闭校对`:`Close editor`,onClick:()=>L(null),children:(0,Q.jsx)(p,{className:`size-4`})})]}),(0,Q.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-3 overflow-y-auto p-4`,children:[(0,Q.jsxs)(`label`,{className:`block text-xs`,children:[t?`本段说话人`:`Speaker for this segment`,(0,Q.jsx)(`input`,{className:`mt-1 w-full rounded border border-edge bg-surface-inset p-2 text-sm`,value:F.speaker,onChange:e=>L({...F,speaker:e.target.value})})]}),F.segment.speakerLabel?(0,Q.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:!!F.applyToSpeakerGroup,onChange:e=>L({...F,applyToSpeakerGroup:e.target.checked})}),t?`同时更名所有同标签片段;输入已有标签可合并说话人`:`Rename all segments with this label; use an existing label to merge speakers`]}):null,(0,Q.jsx)(`textarea`,{className:`min-h-32 w-full rounded border border-edge bg-surface-inset p-2 text-sm`,value:F.text,onChange:e=>L({...F,text:e.target.value})})]}),(0,Q.jsx)(`footer`,{className:`border-t border-edge p-3`,children:(0,Q.jsxs)(k,{variant:`primary`,disabled:B||!F.text.trim(),onClick:()=>void H(async()=>{await h(v(`${u}/segments/${F.segment.sequence}`),{method:`PATCH`,body:JSON.stringify({displayText:F.text,speakerLabel:F.speaker,expectedRevision:F.segment.revision,applyToSpeakerGroup:F.applyToSpeakerGroup,expectedTranscriptRevision:ge.revision})}),L(null)}),children:[(0,Q.jsx)(s,{className:`size-4`}),t?`保存修订`:`Save revision`]})})]})]})}):null]})}var ft={edit:U,ai_edit:Ee,sync:Oe,restore:ge};function pt(e,t){return{edit:t.triggerEdit,ai_edit:t.triggerAiEdit,sync:t.triggerSync,restore:t.triggerRestore}[e]??e}function mt({noteId:e,activeTimestamp:t,onSelect:n,onClose:r,onRestored:i}){let a=_(e=>e.language),o=y(a).notes,s={justNow:o.justNow,minutesAgo:o.minutesAgo,today:o.today,yesterday:o.yesterday,daysAgo:o.daysAgo,locale:g(a)},{data:c}=O(e?[`note-history`,e]:null,()=>V(e)),[l,u]=(0,Z.useState)(!1),[d,f]=(0,Z.useState)(null),[h,v]=(0,Z.useState)(null),b=(0,Z.useCallback)(async t=>{u(!0),v(null);try{await Pe(e,t),f(null),i()}catch{v(o.restoreFailed)}finally{u(!1)}},[e,o.restoreSuccess,o.restoreFailed,i]),x=Date.now();return(0,Q.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between border-b border-edge px-4 py-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium text-fg`,children:[(0,Q.jsx)(z,{className:`size-4`,"aria-hidden":!0}),o.history]}),(0,Q.jsx)(`button`,{type:`button`,onClick:r,className:`rounded-lg p-1 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,children:(0,Q.jsx)(p,{className:`size-4`,"aria-hidden":!0})})]}),(0,Q.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:[h?(0,Q.jsx)(`p`,{className:`border-b border-danger/20 bg-danger-soft px-4 py-2 text-xs text-danger`,role:`alert`,children:h}):null,c?.length?(0,Q.jsx)(`ul`,{className:`divide-y divide-edge`,children:c.map(e=>{let r=ft[e.trigger]??U,i=t===e.timestamp,a=d===e.timestamp;return(0,Q.jsxs)(`li`,{children:[(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>n(e),className:m(`w-full px-4 py-3 text-left transition-colors`,i?`bg-accent/10`:`hover:bg-surface-hover`),children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(r,{className:`size-3.5 shrink-0 text-fg-muted`,"aria-hidden":!0}),(0,Q.jsx)(`span`,{className:`text-xs font-medium text-fg`,children:pt(e.trigger,o)}),(0,Q.jsx)(`span`,{className:`ml-auto text-xs text-fg-muted`,children:nt(e.timestamp,x,s)})]}),e.snippet&&(0,Q.jsx)(`p`,{className:`mt-1 truncate text-xs text-fg-muted/60`,children:e.snippet})]}),i&&(0,Q.jsx)(`div`,{className:`border-t border-edge/50 px-4 py-2`,children:a?(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 truncate text-xs text-fg-muted`,children:o.restoreConfirm}),(0,Q.jsx)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),b(e.timestamp)},disabled:l,className:`shrink-0 rounded-lg bg-accent px-3 py-1 text-xs font-medium text-on-accent transition-colors hover:bg-accent/90 disabled:opacity-50`,children:l?`...`:o.restore}),(0,Q.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),f(null)},className:`shrink-0 rounded-lg px-2 py-1 text-xs text-fg-muted hover:bg-surface-hover`,children:`Cancel`})]}):(0,Q.jsx)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),f(e.timestamp)},className:`rounded-lg bg-surface-hover px-3 py-1 text-xs font-medium text-fg transition-colors hover:bg-accent hover:text-on-accent`,children:o.restore})})]},e.timestamp)})}):(0,Q.jsxs)(`div`,{className:`px-4 py-8 text-center`,children:[(0,Q.jsx)(`p`,{className:`text-sm font-medium text-fg-muted`,children:o.historyEmpty}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted/60`,children:o.historyEmptyDescription})]})]})]})}function ht({noteId:e,note:t,catalyzing:n,onCatalyze:r,onClose:i,noteThreads:o,openingChat:s,onOpenChat:c,onOpenNewChat:l}){let u=y(_(e=>e.language)).notes,d=a(),f=t?.aiDeep?.catalysis,p=f?.report??null,[h,g]=(0,Z.useState)(null),[v,b]=(0,Z.useState)(!1),{data:x,mutate:S,isLoading:C}=O(e?[`note-agent-context-status`,e]:null,()=>q(e),{revalidateOnFocus:!1}),w=(0,Z.useCallback)(async()=>{if(!v){b(!0),g(null);try{await S(()=>me(e),{revalidate:!1})}catch(e){g(`${u.contextRebuildFailed}: ${e instanceof Error?e.message:u.quickCaptureFailedHint}`)}finally{b(!1)}}},[v,S,u.contextRebuildFailed,u.quickCaptureFailedHint,e]),T=(0,Z.useCallback)(async t=>{try{await he(e,t)}catch{}},[e]);return(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between border-b border-edge-subtle px-4 py-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(Ee,{className:`size-4 text-accent`,"aria-hidden":!0}),(0,Q.jsx)(`span`,{className:`text-sm font-semibold text-fg`,children:u.catalysisSectionTitle})]}),(0,Q.jsx)(`button`,{type:`button`,onClick:i,"aria-label":u.lightboxClose,className:`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,children:(0,Q.jsx)(_e,{className:`size-4 rotate-180`,"aria-hidden":!0})})]}),(0,Q.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-4`,children:[(0,Q.jsx)(`p`,{className:`mb-4 text-xs leading-relaxed text-fg-muted`,children:u.catalysisSectionDescription}),x?(0,Q.jsxs)(`section`,{className:`mb-4 rounded-xl bg-surface-base p-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:u.contextStatusTitle}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>void w(),disabled:C||v,className:`rounded-md px-1.5 py-0.5 text-[11px] font-medium text-accent transition-colors hover:bg-accent/10 disabled:cursor-not-allowed disabled:opacity-50`,children:v?u.processing:u.contextRebuild}),(0,Q.jsx)(`span`,{className:m(`rounded-full px-2 py-0.5 text-[11px] font-medium`,x.status===`ready`?`bg-emerald-500/10 text-emerald-600 dark:text-emerald-300`:x.status===`partial`?`bg-amber-500/10 text-amber-600 dark:text-amber-300`:`bg-red-500/10 text-red-600 dark:text-red-300`),children:x.status})]}),(0,Q.jsx)(`div`,{className:`mt-2 text-xs leading-relaxed text-fg-muted`,children:u.contextStatusDetail.replace(`{{attachments}}`,String(x.attachments.length)).replace(`{{tokens}}`,String(x.tokenEstimate??0))}),h?(0,Q.jsx)(`p`,{className:`mt-3 rounded-lg border border-danger/25 bg-danger-soft px-3 py-2 text-xs text-danger`,role:`alert`,children:h}):null,x.attachments.length>0?(0,Q.jsx)(`div`,{className:`mt-3 space-y-1.5`,children:x.attachments.slice(0,5).map(e=>(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-2 rounded-lg bg-surface-hover px-2 py-1.5 text-xs`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 truncate text-fg`,children:e.fileName}),(0,Q.jsx)(`span`,{className:`shrink-0 text-fg-muted`,children:e.status})]},e.attachmentId))}):null]}):null,(0,Q.jsx)(`button`,{type:`button`,onClick:r,disabled:n,className:`w-full rounded-lg bg-accent px-2.5 py-1.5 text-xs font-medium text-on-accent transition-colors hover:bg-accent/90 disabled:cursor-not-allowed disabled:opacity-50`,children:n?u.processing:p?u.recatalyze:u.catalyzeAction}),p?(0,Q.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:u.valueHypothesis}),(0,Q.jsx)(`p`,{className:`mt-1 text-sm leading-relaxed text-fg`,children:p.valueHypothesis})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:u.targetUsers}),(0,Q.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-1.5`,children:p.targetUsers.slice(0,5).map(e=>(0,Q.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-0.5 text-xs text-fg`,children:e},e))})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:u.keyQuestions}),(0,Q.jsx)(`ul`,{className:`mt-1 space-y-1 text-sm leading-relaxed text-fg`,children:p.keyQuestions.slice(0,3).map(e=>(0,Q.jsxs)(`li`,{className:`flex gap-2`,children:[(0,Q.jsx)(`span`,{className:`mt-2 size-1 shrink-0 rounded-full bg-accent`}),(0,Q.jsx)(`span`,{children:e})]},e))})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:u.mvpPathLabel}),(0,Q.jsx)(`ol`,{className:`mt-1 space-y-1 text-sm leading-relaxed text-fg`,children:p.mvpPath.slice(0,3).map((e,t)=>(0,Q.jsxs)(`li`,{className:`flex gap-2`,children:[(0,Q.jsxs)(`span`,{className:`text-fg-muted`,children:[t+1,`.`]}),(0,Q.jsx)(`span`,{children:e})]},e))})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:u.risks}),(0,Q.jsx)(`ul`,{className:`mt-1 space-y-1 text-sm leading-relaxed text-fg`,children:p.risks.slice(0,3).map(e=>(0,Q.jsxs)(`li`,{className:`flex gap-2`,children:[(0,Q.jsx)(`span`,{className:`mt-2 size-1 shrink-0 rounded-full bg-fg-muted`}),(0,Q.jsx)(`span`,{children:e})]},e))})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:u.nextActions}),(0,Q.jsx)(`ul`,{className:`mt-1 space-y-1 text-sm leading-relaxed text-fg`,children:p.nextActions.slice(0,4).map(e=>(0,Q.jsxs)(`li`,{className:`flex gap-2`,children:[(0,Q.jsx)(`span`,{className:`rounded bg-accent/10 px-1.5 py-0.5 text-[10px] uppercase tracking-wide text-accent`,children:e.kind}),(0,Q.jsx)(`span`,{children:e.text})]},`${e.kind}:${e.text}`))})]}),(0,Q.jsxs)(`div`,{className:`flex items-center justify-between border-t border-edge-subtle pt-3`,children:[(0,Q.jsx)(`span`,{className:`text-xs text-fg-muted`,children:u.confidenceLabel.replace(`{{percent}}`,String(Math.round(p.confidence*100)))}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Q.jsx)(`button`,{type:`button`,onClick:()=>void T(`helpful`),className:m(`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,f?.feedback===`helpful`&&`bg-accent/10 text-accent`),"aria-label":u.feedbackHelpfulAria,children:(0,Q.jsx)(je,{className:`size-3.5`,"aria-hidden":!0})}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>void T(`not_helpful`),className:m(`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,f?.feedback===`not_helpful`&&`bg-accent/10 text-accent`),"aria-label":u.feedbackNotHelpfulAria,children:(0,Q.jsx)(Fe,{className:`size-3.5`,"aria-hidden":!0})})]})]})]}):(0,Q.jsx)(`div`,{className:`mt-4 rounded-lg border border-dashed border-edge-subtle px-3 py-6 text-center text-sm text-fg-muted`,children:u.noCatalysisReportHint}),(0,Q.jsxs)(`section`,{className:`mt-6 rounded-xl bg-surface-base p-4`,children:[(0,Q.jsxs)(`div`,{className:`mb-3 flex items-center justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-fg`,children:[(0,Q.jsx)(ze,{className:`size-4 text-accent`,"aria-hidden":!0}),u.relatedThreadsTitle]}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:u.relatedThreadsDescription})]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[(0,Q.jsx)(`button`,{type:`button`,onClick:c,disabled:s,className:`rounded-lg border border-edge px-2.5 py-1.5 text-xs font-medium text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg disabled:cursor-not-allowed disabled:opacity-50`,children:s?u.openingChat:u.openThread}),(0,Q.jsx)(`button`,{type:`button`,onClick:l,disabled:s,className:`rounded-lg bg-accent px-2.5 py-1.5 text-xs font-medium text-on-accent transition-colors hover:bg-accent/90 disabled:cursor-not-allowed disabled:opacity-50`,children:u.newThread})]})]}),o.length>0?(0,Q.jsx)(`div`,{className:`space-y-2`,children:o.slice(0,5).map(e=>(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>d(`/chat/${encodeURIComponent(e.key)}`),className:`w-full rounded-lg border border-edge-subtle px-3 py-2 text-left transition-colors hover:bg-surface-hover`,children:[(0,Q.jsx)(`div`,{className:`truncate text-sm font-medium text-fg`,children:e.name||u.noteDiscussionFallback}),(0,Q.jsx)(`div`,{className:`mt-0.5 text-xs text-fg-muted`,children:u.messageCount.replace(`{{count}}`,String(e.messageCount??0))})]},e.key))}):(0,Q.jsx)(`div`,{className:`rounded-lg border border-dashed border-edge-subtle px-3 py-5 text-center text-sm text-fg-muted`,children:u.noThreads})]})]})]})}var gt=[{value:`86400000`,zh:`24 小时`,en:`24 hours`},{value:`604800000`,zh:`7 天`,en:`7 days`},{value:`2592000000`,zh:`30 天`,en:`30 days`}];function _t({open:e,onOpenChange:t,note:n}){let r=_(e=>e.language)===`zh`,i=r?xt:St,{data:a,mutate:o}=O(e?[`note-shares`,n.id]:null,()=>ee(n.id)),u=O(e?`hosted-share-auth-status`:null,se),f=u.data===!0,m=O(e&&f?`hosted-publication-capabilities`:null,pe),h=m.data?.publishing.allowed===!0,g=O(e&&f?[`hosted-note-publications`,n.id]:null,()=>oe(n.id)),[v,y]=(0,Z.useState)(new Set),[A,j]=(0,Z.useState)(`86400000`),[M,N]=(0,Z.useState)(``),[P,F]=(0,Z.useState)(``),[I,te]=(0,Z.useState)(`hosted`),[z,re]=(0,Z.useState)(!1),[ae,B]=(0,Z.useState)(null),[V,le]=(0,Z.useState)(null),[ue,de]=(0,Z.useState)(!1),[fe,H]=(0,Z.useState)(null),U=(0,Z.useMemo)(()=>{let e=new Set;return n.markdown.replace(/xopc-attachment:\/\/notes\/([^/]+)\/([^\s)]+)/gi,(t,r,i)=>{try{decodeURIComponent(r)===n.id&&e.add(decodeURIComponent(i))}catch{}return t}),(n.attachments??[]).filter(t=>e.has(t.id))},[n.attachments,n.id,n.markdown]);(0,Z.useEffect)(()=>{e&&(y(new Set(U.map(e=>e.id))),le(null),de(!1),H(null))},[e,U]);let me=async()=>{re(!0),H(null);try{let e={expectedNoteVersion:n.updatedAt,attachmentIds:[...v],ttlMs:Number(A),maxViews:M.trim()?Number(M):null,description:P.trim()||void 0};I===`hosted`?(le((await L(n.id,e)).shareUrl),await g.mutate()):(le((await ce(n.id,e)).payload.shareUrl),await o())}catch(e){H(e instanceof Error?e.message:String(e))}finally{re(!1)}},he=async(e,t)=>{B(e.id),H(null);try{t===`refresh`?await R(n.id,e.id,{expectedNoteVersion:n.updatedAt,attachmentIds:[...v]}):await K(e.id),await g.mutate()}catch(e){H(e instanceof Error?e.message:String(e))}finally{B(null)}},W=async(e,t)=>{B(e.id),H(null);try{t===`refresh`?await ne(n.id,e.id,{expectedNoteVersion:n.updatedAt,attachmentIds:[...v]}):t===`extend`?await Y(e.id,864e5):await ie(e.id),await o()}catch(e){H(e instanceof Error?e.message:String(e))}finally{B(null)}},ge=async e=>{H(null);try{if(!await D(e)){de(!1),H(i.copyFailed);return}de(!0),window.setTimeout(()=>de(!1),1500)}catch{de(!1),H(i.copyFailed)}};return(0,Q.jsx)(E,{open:e,onOpenChange:t,children:(0,Q.jsxs)(C,{children:[(0,Q.jsx)(b,{className:`xopc-dialog-overlay fixed inset-0 z-[70] bg-scrim backdrop-blur-[2px]`}),(0,Q.jsxs)(w,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[71] flex h-[min(42rem,calc(100dvh-2rem))] w-[min(40rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay shadow-popover outline-none`,children:[(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-start justify-between border-b border-edge px-5 py-4`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(T,{className:`flex items-center gap-2 text-base font-semibold text-fg`,children:[(0,Q.jsx)(Ue,{className:`size-4`}),i.title]}),(0,Q.jsx)(x,{className:`mt-1 text-xs text-fg-muted`,children:i.description})]}),(0,Q.jsx)(S,{asChild:!0,children:(0,Q.jsx)(`button`,{type:`button`,className:`rounded-md p-1.5 text-fg-muted hover:bg-surface-hover`,"aria-label":i.close,children:(0,Q.jsx)(p,{className:`size-4`})})})]}),(0,Q.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:[(0,Q.jsxs)(`section`,{className:`rounded-lg border border-edge bg-surface-inset p-4`,children:[(0,Q.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:n.title||i.untitled}),(0,Q.jsx)(`p`,{className:`mt-2 line-clamp-4 whitespace-pre-wrap text-xs leading-5 text-fg-muted`,children:n.markdown||i.empty}),(0,Q.jsx)(`p`,{className:`mt-3 text-xs text-fg-subtle`,children:i.privateExcluded})]}),U.length>0?(0,Q.jsxs)(`section`,{className:`mt-5`,children:[(0,Q.jsx)(`h3`,{className:`text-sm font-medium text-fg`,children:i.attachments}),(0,Q.jsx)(`div`,{className:`mt-2 grid gap-2`,children:U.map(e=>(0,Q.jsxs)(`label`,{className:`flex items-center gap-3 rounded-lg border border-edge-subtle px-3 py-2 text-sm text-fg-muted`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,checked:v.has(e.id),onChange:()=>y(t=>{let n=new Set(t);return n.has(e.id)?n.delete(e.id):n.add(e.id),n}),className:`accent-accent`}),(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.fileName}),(0,Q.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:bt(e.size)})]},e.id))})]}):null,(0,Q.jsxs)(`section`,{className:`mt-5 grid gap-4 sm:grid-cols-2`,children:[(0,Q.jsxs)(`label`,{className:`grid gap-1.5 text-xs text-fg-muted sm:col-span-2`,children:[i.delivery,(0,Q.jsxs)(c,{value:I,onChange:e=>te(e.target.value),children:[(0,Q.jsx)(l,{value:`hosted`,children:i.deliveryHosted}),(0,Q.jsx)(l,{value:`local`,children:i.deliveryLocal})]})]}),I===`hosted`&&u.data===!1?(0,Q.jsx)(`div`,{className:`sm:col-span-2`,children:(0,Q.jsx)(be,{providerId:`xopc-share`,displayName:`XOPC Hosted Share`,connected:!1,onConnected:()=>void u.mutate(!0,{revalidate:!1})})}):null,I===`hosted`&&f&&m.data&&!h?(0,Q.jsx)(`p`,{className:`rounded-lg border border-warning/30 bg-warning-soft px-3 py-2 text-xs text-warning sm:col-span-2`,children:i.hostedDisabled}):null,(0,Q.jsxs)(`label`,{className:`grid gap-1.5 text-xs text-fg-muted`,children:[i.expires,(0,Q.jsx)(c,{value:A,onChange:e=>j(e.target.value),children:gt.map(e=>(0,Q.jsx)(l,{value:e.value,children:r?e.zh:e.en},e.value))})]}),(0,Q.jsxs)(`label`,{className:`grid gap-1.5 text-xs text-fg-muted`,children:[i.maxViews,(0,Q.jsx)(`input`,{type:`number`,min:1,max:1e3,value:M,onChange:e=>N(e.target.value),placeholder:i.unlimited,className:`h-9 rounded-md border border-edge bg-surface-panel px-3 text-sm text-fg outline-none focus:border-accent`})]}),(0,Q.jsxs)(`label`,{className:`grid gap-1.5 text-xs text-fg-muted sm:col-span-2`,children:[i.publicDescription,(0,Q.jsx)(`input`,{value:P,onChange:e=>F(e.target.value),className:`h-9 rounded-md border border-edge bg-surface-panel px-3 text-sm text-fg outline-none focus:border-accent`})]})]}),V?(0,Q.jsx)(`div`,{className:`mt-5 rounded-lg border border-success/25 bg-success-soft p-3`,children:(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Q.jsx)(`input`,{readOnly:!0,value:V,className:`min-w-0 flex-1 bg-transparent text-xs text-fg outline-none`}),(0,Q.jsxs)(k,{type:`button`,className:`px-2 py-1 text-xs`,variant:`ghost`,onClick:()=>void ge(V),children:[ue?(0,Q.jsx)(s,{className:`size-4`}):(0,Q.jsx)(d,{className:`size-4`}),ue?i.copied:i.copy]}),(0,Q.jsxs)(k,{type:`button`,className:`px-2 py-1 text-xs`,variant:`ghost`,onClick:()=>window.open(V,`_blank`,`noopener,noreferrer`),children:[(0,Q.jsx)(De,{className:`size-4`}),i.open]})]})}):null,fe?(0,Q.jsx)(`p`,{className:`mt-4 rounded-lg border border-danger/25 bg-danger-soft px-3 py-2 text-sm text-danger`,children:fe}):null,(a?.items.length??0)>0?(0,Q.jsxs)(`section`,{className:`mt-6 border-t border-edge pt-5`,children:[(0,Q.jsx)(`h3`,{className:`text-sm font-medium text-fg`,children:i.activeLinks}),(0,Q.jsx)(`div`,{className:`mt-2 grid gap-2`,children:a.items.map(e=>(0,Q.jsx)(yt,{share:e,busy:ae===e.id,t:i,onCopy:ge,onAction:W},e.id))})]}):null,(g.data?.length??0)>0?(0,Q.jsxs)(`section`,{className:`mt-6 border-t border-edge pt-5`,children:[(0,Q.jsx)(`h3`,{className:`text-sm font-medium text-fg`,children:i.hostedLinks}),(0,Q.jsx)(`div`,{className:`mt-2 grid gap-2`,children:g.data.map(e=>(0,Q.jsx)(vt,{publication:e,stale:e.source?.version!==String(n.updatedAt),busy:ae===e.id,publishingAllowed:h,t:i,onCopy:ge,onAction:he},e.id))})]}):null]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center justify-end gap-2 border-t border-edge px-5 py-3`,children:[(0,Q.jsx)(S,{asChild:!0,children:(0,Q.jsx)(k,{type:`button`,variant:`ghost`,children:i.close})}),(0,Q.jsxs)(k,{type:`button`,onClick:()=>void me(),disabled:z||I===`hosted`&&(!f||!h),children:[z?(0,Q.jsx)(Te,{className:`size-4 animate-spin`}):(0,Q.jsx)(Ue,{className:`size-4`}),z?i.creating:i.create]})]})]})]})})}function vt(e){let t=(0,Je.c)(64),{publication:n,stale:r,busy:i,publishingAllowed:a,t:o,onCopy:s,onAction:c}=e,l=n.revoked||n.expired,u=l&&`opacity-60`,f;t[0]===u?f=t[1]:(f=m(`rounded-lg border border-edge-subtle p-3`,u),t[0]=u,t[1]=f);let p=r&&!l?o.stale:l?o.inactive:o.active,h;t[2]===p?h=t[3]:(h=(0,Q.jsx)(`span`,{children:p}),t[2]=p,t[3]=h);let g;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Q.jsx)(`span`,{children:`·`}),t[4]=g):g=t[4];let _=n.maxViews===null?``:` / ${n.maxViews}`,v;t[5]!==n.viewCount||t[6]!==o.views||t[7]!==_?(v=(0,Q.jsxs)(`span`,{children:[o.views,` `,n.viewCount,_]}),t[5]=n.viewCount,t[6]=o.views,t[7]=_,t[8]=v):v=t[8];let y;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Q.jsx)(`span`,{children:`·`}),t[9]=y):y=t[9];let b;t[10]!==n.revision||t[11]!==o.revision?(b=(0,Q.jsxs)(`span`,{children:[o.revision,` `,n.revision]}),t[10]=n.revision,t[11]=o.revision,t[12]=b):b=t[12];let x;t[13]!==h||t[14]!==v||t[15]!==b?(x=(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-fg-muted`,children:[h,g,v,y,b]}),t[13]=h,t[14]=v,t[15]=b,t[16]=x):x=t[16];let S;t[17]===n.shareUrl?S=t[18]:(S=(0,Q.jsx)(`div`,{className:`mt-1 truncate text-xs text-fg-subtle`,children:n.shareUrl}),t[17]=n.shareUrl,t[18]=S);let C;t[19]!==x||t[20]!==S?(C=(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[x,S]}),t[19]=x,t[20]=S,t[21]=C):C=t[21];let w;t[22]===i?w=t[23]:(w=i?(0,Q.jsx)(Te,{className:`size-4 animate-spin text-fg-muted`}):null,t[22]=i,t[23]=w);let T;t[24]!==C||t[25]!==w?(T=(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[C,w]}),t[24]=C,t[25]=w,t[26]=T):T=t[26];let E=!a,D;t[27]!==s||t[28]!==n.shareUrl?(D=()=>void s(n.shareUrl),t[27]=s,t[28]=n.shareUrl,t[29]=D):D=t[29];let O;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Q.jsx)(d,{className:`size-3.5`}),t[30]=O):O=t[30];let A;t[31]!==o.copy||t[32]!==E||t[33]!==D?(A=(0,Q.jsxs)(k,{className:`px-2 py-1 text-xs`,variant:`ghost`,disabled:E,onClick:D,children:[O,o.copy]}),t[31]=o.copy,t[32]=E,t[33]=D,t[34]=A):A=t[34];let j=!a,M;t[35]===n.shareUrl?M=t[36]:(M=()=>window.open(n.shareUrl,`_blank`,`noopener,noreferrer`),t[35]=n.shareUrl,t[36]=M);let N;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Q.jsx)(De,{className:`size-3.5`}),t[37]=N):N=t[37];let P;t[38]!==o.open||t[39]!==j||t[40]!==M?(P=(0,Q.jsxs)(k,{className:`px-2 py-1 text-xs`,variant:`ghost`,disabled:j,onClick:M,children:[N,o.open]}),t[38]=o.open,t[39]=j,t[40]=M,t[41]=P):P=t[41];let F;t[42]!==i||t[43]!==l||t[44]!==c||t[45]!==n||t[46]!==a||t[47]!==r||t[48]!==o.refresh?(F=r&&!l?(0,Q.jsxs)(k,{className:`px-2 py-1 text-xs`,variant:`ghost`,disabled:i||!a,onClick:()=>void c(n,`refresh`),children:[(0,Q.jsx)(Oe,{className:`size-3.5`}),o.refresh]}):null,t[42]=i,t[43]=l,t[44]=c,t[45]=n,t[46]=a,t[47]=r,t[48]=o.refresh,t[49]=F):F=t[49];let I;t[50]!==i||t[51]!==c||t[52]!==n||t[53]!==o.revoke?(I=n.revoked?null:(0,Q.jsxs)(k,{className:`px-2 py-1 text-xs`,variant:`ghost`,disabled:i,onClick:()=>void c(n,`revoke`),children:[(0,Q.jsx)(Be,{className:`size-3.5`}),o.revoke]}),t[50]=i,t[51]=c,t[52]=n,t[53]=o.revoke,t[54]=I):I=t[54];let L;t[55]!==A||t[56]!==P||t[57]!==F||t[58]!==I?(L=(0,Q.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1`,children:[A,P,F,I]}),t[55]=A,t[56]=P,t[57]=F,t[58]=I,t[59]=L):L=t[59];let R;return t[60]!==T||t[61]!==f||t[62]!==L?(R=(0,Q.jsxs)(`div`,{className:f,children:[T,L]}),t[60]=T,t[61]=f,t[62]=L,t[63]=R):R=t[63],R}function yt(e){let t=(0,Je.c)(68),{share:n,busy:r,t:i,onCopy:a,onAction:o}=e,s=n.revoked||n.expired,c=s&&`opacity-60`,l;t[0]===c?l=t[1]:(l=m(`rounded-lg border border-edge-subtle p-3`,c),t[0]=c,t[1]=l);let u=n.stale&&!s?i.stale:s?i.inactive:i.active,f;t[2]===u?f=t[3]:(f=(0,Q.jsx)(`span`,{children:u}),t[2]=u,t[3]=f);let p;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Q.jsx)(`span`,{children:`·`}),t[4]=p):p=t[4];let h=n.maxViews===null?``:` / ${n.maxViews}`,g;t[5]!==n.viewCount||t[6]!==i.views||t[7]!==h?(g=(0,Q.jsxs)(`span`,{children:[i.views,` `,n.viewCount,h]}),t[5]=n.viewCount,t[6]=i.views,t[7]=h,t[8]=g):g=t[8];let _;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Q.jsx)(`span`,{children:`·`}),t[9]=_):_=t[9];let v;t[10]===n.expiresAt?v=t[11]:(v=new Date(n.expiresAt).toLocaleDateString(),t[10]=n.expiresAt,t[11]=v);let y;t[12]===v?y=t[13]:(y=(0,Q.jsx)(`span`,{children:v}),t[12]=v,t[13]=y);let b;t[14]!==y||t[15]!==f||t[16]!==g?(b=(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-fg-muted`,children:[f,p,g,_,y]}),t[14]=y,t[15]=f,t[16]=g,t[17]=b):b=t[17];let x;t[18]===n.shareUrl?x=t[19]:(x=(0,Q.jsx)(`div`,{className:`mt-1 truncate text-xs text-fg-subtle`,children:n.shareUrl}),t[18]=n.shareUrl,t[19]=x);let S;t[20]!==b||t[21]!==x?(S=(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[b,x]}),t[20]=b,t[21]=x,t[22]=S):S=t[22];let C;t[23]===r?C=t[24]:(C=r?(0,Q.jsx)(Te,{className:`size-4 animate-spin text-fg-muted`}):null,t[23]=r,t[24]=C);let w;t[25]!==S||t[26]!==C?(w=(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[S,C]}),t[25]=S,t[26]=C,t[27]=w):w=t[27];let T;t[28]!==a||t[29]!==n.shareUrl?(T=()=>void a(n.shareUrl),t[28]=a,t[29]=n.shareUrl,t[30]=T):T=t[30];let E;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,Q.jsx)(d,{className:`size-3.5`}),t[31]=E):E=t[31];let D;t[32]!==i.copy||t[33]!==T?(D=(0,Q.jsxs)(k,{className:`px-2 py-1 text-xs`,variant:`ghost`,onClick:T,children:[E,i.copy]}),t[32]=i.copy,t[33]=T,t[34]=D):D=t[34];let O;t[35]===n.shareUrl?O=t[36]:(O=()=>window.open(n.shareUrl,`_blank`,`noopener,noreferrer`),t[35]=n.shareUrl,t[36]=O);let A;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Q.jsx)(De,{className:`size-3.5`}),t[37]=A):A=t[37];let j;t[38]!==i.open||t[39]!==O?(j=(0,Q.jsxs)(k,{className:`px-2 py-1 text-xs`,variant:`ghost`,onClick:O,children:[A,i.open]}),t[38]=i.open,t[39]=O,t[40]=j):j=t[40];let M;t[41]!==r||t[42]!==s||t[43]!==o||t[44]!==n||t[45]!==i.refresh?(M=n.stale&&!s?(0,Q.jsxs)(k,{className:`px-2 py-1 text-xs`,variant:`ghost`,disabled:r,onClick:()=>void o(n,`refresh`),children:[(0,Q.jsx)(Oe,{className:`size-3.5`}),i.refresh]}):null,t[41]=r,t[42]=s,t[43]=o,t[44]=n,t[45]=i.refresh,t[46]=M):M=t[46];let N;t[47]!==r||t[48]!==s||t[49]!==o||t[50]!==n||t[51]!==i.extend?(N=s?null:(0,Q.jsx)(k,{className:`px-2 py-1 text-xs`,variant:`ghost`,disabled:r,onClick:()=>void o(n,`extend`),children:i.extend}),t[47]=r,t[48]=s,t[49]=o,t[50]=n,t[51]=i.extend,t[52]=N):N=t[52];let P;t[53]!==r||t[54]!==o||t[55]!==n||t[56]!==i.revoke?(P=n.revoked?null:(0,Q.jsxs)(k,{className:`px-2 py-1 text-xs`,variant:`ghost`,disabled:r,onClick:()=>void o(n,`revoke`),children:[(0,Q.jsx)(Be,{className:`size-3.5`}),i.revoke]}),t[53]=r,t[54]=o,t[55]=n,t[56]=i.revoke,t[57]=P):P=t[57];let F;t[58]!==D||t[59]!==j||t[60]!==M||t[61]!==N||t[62]!==P?(F=(0,Q.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1`,children:[D,j,M,N,P]}),t[58]=D,t[59]=j,t[60]=M,t[61]=N,t[62]=P,t[63]=F):F=t[63];let I;return t[64]!==w||t[65]!==l||t[66]!==F?(I=(0,Q.jsxs)(`div`,{className:l,children:[w,F]}),t[64]=w,t[65]=l,t[66]=F,t[67]=I):I=t[67],I}function bt(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}var xt={title:`分享笔记`,description:`创建一个无需登录即可查看的只读快照。`,close:`关闭`,untitled:`无标题笔记`,empty:`空笔记`,privateExcluded:`不会分享标签、AI 元数据、项目、讨论、历史版本或未引用附件。`,attachments:`包含的附件`,expires:`有效期`,maxViews:`最多查看次数`,unlimited:`不限`,publicDescription:`公开说明(可选)`,create:`创建分享链接`,creating:`创建中…`,copy:`复制`,copied:`已复制`,open:`打开`,activeLinks:`这条笔记的分享`,copyFailed:`无法复制到剪贴板,请手动选择链接并复制。`,delivery:`发布方式`,deliveryHosted:`平台托管(外网稳定访问)`,deliveryLocal:`本机直连(需要隧道或公网部署)`,hostedLinks:`平台托管发布`,revision:`版本`,hostedDisabled:`管理员已暂停你的公网分享能力。已有托管链接当前不可访问,但仍可撤销。`,stale:`旧版本`,inactive:`已失效`,active:`有效`,views:`查看`,refresh:`更新快照`,extend:`延长 24 小时`,revoke:`撤销`},St={title:`Share Note`,description:`Create a read-only snapshot that opens without sign-in.`,close:`Close`,untitled:`Untitled Note`,empty:`Empty Note`,privateExcluded:`Tags, AI metadata, projects, discussions, history, and unreferenced attachments are excluded.`,attachments:`Included attachments`,expires:`Expires`,maxViews:`Maximum views`,unlimited:`Unlimited`,publicDescription:`Public description (optional)`,create:`Create share link`,creating:`Creating…`,copy:`Copy`,copied:`Copied`,open:`Open`,activeLinks:`Shares for this Note`,copyFailed:`Could not copy to the clipboard. Select the link and copy it manually.`,delivery:`Publishing method`,deliveryHosted:`Hosted platform (stable public access)`,deliveryLocal:`Direct from this device (requires public access)`,hostedLinks:`Hosted publications`,revision:`Revision`,hostedDisabled:`An administrator has paused public sharing for your account. Existing hosted links are unavailable, but can still be revoked.`,stale:`Older version`,inactive:`Inactive`,active:`Active`,views:`Views`,refresh:`Update snapshot`,extend:`Extend 24 hours`,revoke:`Revoke`};function Ct(e){let t=(0,Je.c)(18),{input:n,labels:r,showLabel:i}=e,a=i===void 0?!0:i,o;t[0]===n?o=t[1]:(o=n(),t[0]=n,t[1]=o);let s=o.source.id,c;t[2]===s?c=t[3]:(c=e=>e.source?.type===`note`&&e.source.id===s&&e.status!==`idle`,t[2]=s,t[3]=c);let l=Ve(c),u;t[4]===s?u=t[5]:(u=e=>e.source?.type===`note`&&e.source.id===s&&e.status===`preparing`,t[4]=s,t[5]=u);let d=Ve(u),f=Ve(wt),p;t[6]!==n||t[7]!==r||t[8]!==d||t[9]!==a?(p=(0,Q.jsx)(we,{input:n,labels:r,disabled:d,showLabel:a}),t[6]=n,t[7]=r,t[8]=d,t[9]=a,t[10]=p):p=t[10];let m;t[11]!==l||t[12]!==r||t[13]!==f?(m=l?(0,Q.jsx)(`button`,{type:`button`,onClick:f,title:r.stop,"aria-label":r.stop,className:`inline-flex size-8 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`,children:(0,Q.jsx)(Se,{className:`size-3.5`,"aria-hidden":!0})}):null,t[11]=l,t[12]=r,t[13]=f,t[14]=m):m=t[14];let h;return t[15]!==p||t[16]!==m?(h=(0,Q.jsxs)(`div`,{className:`flex items-center gap-1`,children:[p,m]}),t[15]=p,t[16]=m,t[17]=h):h=t[17],h}function wt(e){return e.stop}function Tt(e,t){let n=Me(t.replace(/^\s*(`{3,}|~{3,})[^\n]*$/gm,``).replace(/xopc-attachment:\/\/[^\s)]+/g,``).replace(/^(\s*[-*+]\s+)\[[ xX]\]\s*/gm,`$1`)),r=Me(e);return!r||n.split(`
3
- `)[0]===r?n:[r,n].filter(Boolean).join(`
4
-
5
- `)}var Et=()=>i(()=>import(`./block-editor-D0LDiOTT.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48])),Dt=()=>i(()=>import(`./markdown-editor-BhBJANcx.js`),__vite__mapDeps([49,1,46,5,50,51,3])),Ot=(0,Z.lazy)(()=>Et().then(e=>({default:e.BlockEditor}))),kt=(0,Z.lazy)(()=>Dt().then(e=>({default:e.MarkdownEditor})));function At(){let e=(0,Je.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col px-6 py-4`,"aria-busy":!0,children:[(0,Q.jsx)(`div`,{className:`h-8 w-56 max-w-full animate-pulse rounded-md bg-surface-hover`}),(0,Q.jsx)(`div`,{className:`mt-6 h-4 w-11/12 animate-pulse rounded bg-surface-hover`}),(0,Q.jsx)(`div`,{className:`mt-3 h-4 w-9/12 animate-pulse rounded bg-surface-hover`}),(0,Q.jsx)(`div`,{className:`mt-3 h-4 w-10/12 animate-pulse rounded bg-surface-hover`})]}),e[0]=t):t=e[0],t}function jt(e){let t=(0,Je.c)(29),{mode:n,onModeChange:r,labels:i}=e,a;t[0]===i.edit?a=t[1]:(a={id:`wysiwyg`,label:i.edit,Icon:ue},t[0]=i.edit,t[1]=a);let o;t[2]===i.source?o=t[3]:(o={id:`source`,label:i.source,Icon:Ae},t[2]=i.source,t[3]=o);let c;t[4]===i.preview?c=t[5]:(c={id:`preview`,label:i.preview,Icon:Le},t[4]=i.preview,t[5]=c);let l;t[6]!==a||t[7]!==o||t[8]!==c?(l=[a,o,c],t[6]=a,t[7]=o,t[8]=c,t[9]=l):l=t[9];let u=l,d;t[10]!==n||t[11]!==u?(d=u.find(e=>e.id===n)??u[0],t[10]=n,t[11]=u,t[12]=d):d=t[12];let f=d,p=f.Icon,m=Mt,h;t[13]===p?h=t[14]:(h=(0,Q.jsx)(p,{className:`size-3.5`,"aria-hidden":!0}),t[13]=p,t[14]=h);let g;t[15]===f.label?g=t[16]:(g=(0,Q.jsx)(`span`,{children:f.label}),t[15]=f.label,t[16]=g);let _;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Q.jsx)(B,{className:`size-3 text-fg-subtle`,"aria-hidden":!0}),t[17]=_):_=t[17];let v;t[18]!==f.label||t[19]!==h||t[20]!==g?(v=(0,Q.jsx)(He,{asChild:!0,children:(0,Q.jsxs)(`button`,{type:`button`,"aria-label":f.label,className:`inline-flex h-8 items-center gap-1.5 rounded-lg border border-edge px-2.5 text-xs font-medium text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[h,g,_]})}),t[18]=f.label,t[19]=h,t[20]=g,t[21]=v):v=t[21];let y;t[22]!==n||t[23]!==u||t[24]!==r?(y=(0,Q.jsx)(We,{children:(0,Q.jsx)(Ge,{align:`end`,sideOffset:6,className:`z-50 min-w-36 rounded-xl border border-edge bg-surface-panel p-1 shadow-popover`,children:u.map(e=>{let{id:t,label:i,Icon:a}=e;return(0,Q.jsxs)(ye,{onSelect:()=>r(t),onPointerMove:()=>m(t),onFocus:()=>m(t),className:`flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-fg outline-none hover:bg-surface-hover focus:bg-surface-hover`,children:[(0,Q.jsx)(a,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),(0,Q.jsx)(`span`,{className:`flex-1`,children:i}),n===t?(0,Q.jsx)(s,{className:`size-4 text-accent`,"aria-hidden":!0}):null]},t)})})}),t[22]=n,t[23]=u,t[24]=r,t[25]=y):y=t[25];let b;return t[26]!==y||t[27]!==v?(b=(0,Q.jsxs)(fe,{modal:!1,children:[v,y]}),t[26]=y,t[27]=v,t[28]=b):b=t[28],b}function Mt(e){e===`wysiwyg`&&Et(),e===`source`&&Dt()}function Nt(e){let t=(0,Je.c)(16),{noteId:n,onBack:r,onSaved:i,showBackButton:a,backButtonClassName:o,clearHeaderOnCleanup:s,onOpenSearch:c,autoFocus:l,initialMode:u,onAutoFocusConsumed:d}=e,f=a===void 0?!0:a,p=s===void 0?!0:s,m=l===void 0?!1:l,h=_(Pt),g;t[0]===h?g=t[1]:(g=y(h),t[0]=h,t[1]=g);let v=g.notes.lightboxClose,b;t[2]!==m||t[3]!==o||t[4]!==p||t[5]!==u||t[6]!==n||t[7]!==d||t[8]!==r||t[9]!==c||t[10]!==i||t[11]!==f?(b=(0,Q.jsx)(Ft,{noteId:n,onBack:r,onSaved:i,showBackButton:f,backButtonClassName:o,clearHeaderOnCleanup:p,onOpenSearch:c,autoFocus:m,initialMode:u,onAutoFocusConsumed:d}),t[2]=m,t[3]=o,t[4]=p,t[5]=u,t[6]=n,t[7]=d,t[8]=r,t[9]=c,t[10]=i,t[11]=f,t[12]=b):b=t[12];let x;return t[13]!==v||t[14]!==b?(x=(0,Q.jsx)(Qe,{closeLabel:v,children:b}),t[13]=v,t[14]=b,t[15]=x):x=t[15],x}function Pt(e){return e.language}function Ft({noteId:e,onBack:t,onSaved:n,showBackButton:r=!0,backButtonClassName:i,clearHeaderOnCleanup:o=!0,onOpenSearch:c,autoFocus:l=!1,initialMode:u=`wysiwyg`,onAutoFocusConsumed:d}){let f=_(e=>e.language),p=y(f).notes,h=y(f).automations.suggestions,{data:g}=O([`note-discussion-document`,e],()=>de(e)),[v,b]=(0,Z.useState)(!0),x=a(),S=A(e=>e.resolved)===`dark`,{openImage:C}=Xe(),[w,T]=(0,Z.useState)(u),[E,D]=(0,Z.useState)(null),[k,j]=(0,Z.useState)(null),[M,L]=(0,Z.useState)(!1),[R,ee]=(0,Z.useState)(``),[ne,ie]=(0,Z.useState)(360),[B,oe]=(0,Z.useState)(!1),[se,ce]=(0,Z.useState)(!1),[V,ue]=(0,Z.useState)(!1),[pe,U]=(0,Z.useState)(null),[me,he]=(0,Z.useState)(!1),[ge,be]=(0,Z.useState)(null),[xe,Se]=(0,Z.useState)(!1),[we,Te]=(0,Z.useState)(!1),De=(0,Z.useRef)(!1),Oe=(0,Z.useRef)(!1),K=(0,Z.useRef)(null),q=(0,Z.useRef)(null),J=(0,Z.useRef)(null),Ae=(0,Z.useRef)(null),je=(0,Z.useRef)(null),Me=(0,Z.useRef)(null),Ne=(0,Z.useRef)(null),Pe=(0,Z.useRef)(null),Fe=(0,Z.useRef)(null),Le=Ce(e=>e.setPageHeader),Re=Ce(e=>e.clearPageHeader),{data:Y,mutate:X,error:Ke}=O(e?[`note-detail`,e]:null,()=>N(e)),{data:Je=[],mutate:Ye}=O(e?[`note-threads`,e]:null,()=>re(e),{revalidateOnFocus:!1}),Ze=k!==null,Qe=(0,Z.useCallback)(e=>{U(`${p.refreshFailed}: ${e instanceof Error?e.message:p.quickCaptureFailedHint}`)},[p.quickCaptureFailedHint,p.refreshFailed]);(0,Z.useEffect)(()=>{if(!e)return;let t=t=>{t.detail?.noteId===e&&X().catch(Qe)};return window.addEventListener(`note-updated`,t),()=>window.removeEventListener(`note-updated`,t)},[X,e,Qe]),(0,Z.useEffect)(()=>{De.current=!1,ee(``),j(null),D(null),Oe.current=!1,Fe.current=null},[e]),(0,Z.useEffect)(()=>{!Y||De.current||(ee(Y.title??``),De.current=!0)},[Y]),(0,Z.useEffect)(()=>{if(!l||!Y||Ze||Fe.current===e)return;let t=window.requestAnimationFrame(()=>{Pe.current?.focus(),d?.()});return Fe.current=e,()=>window.cancelAnimationFrame(t)},[l,Ze,Y,e,d]);let $e=Y?new Date(Y.createdAt).toLocaleString(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}):``,et=(0,Z.useMemo)(()=>r?(0,Q.jsx)(`button`,{type:`button`,onClick:t,"aria-label":p.back,className:m(`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,F,i),children:(0,Q.jsx)(_e,{className:`size-4`,"aria-hidden":!0})}):null,[i,p.back,t,r]),$=(0,Z.useCallback)(()=>{let t=Ve.getState();t.source?.type===`note`&&t.source.id===e&&t.stop()},[e]),tt=(0,Z.useCallback)(e=>{e!==`preview`&&$(),T(e)},[$]),nt=(0,Z.useCallback)(t=>{$(),ee(t),e&&(Ae.current=t,q.current&&clearTimeout(q.current),q.current=setTimeout(async()=>{let t=Ae.current;if(Ae.current=null,t!==null){L(!0);try{await te(e,{title:t}),await X(),n?.()}catch{}finally{L(!1)}}},600))},[$,e,X,n]),rt=(0,Z.useMemo)(()=>(0,Q.jsxs)(`div`,{className:m(`flex min-w-0 items-center gap-2`,F),children:[(0,Q.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium text-fg`,title:R||$e||void 0,children:R||$e}),M?(0,Q.jsx)(`span`,{className:`shrink-0 text-xs text-fg-muted opacity-60`,children:p.saving}):null]}),[p.saving,M,$e,R]),it=(0,Z.useCallback)(async(t=!1)=>{ue(!0),U(null);try{let n=await qe(e,{forceNew:t});await X(),await Ye(),x(`/chat/${encodeURIComponent(n.conversationId)}`)}catch(e){U(`${p.chatOpenFailedTitle}: ${e instanceof Error?e.message:p.chatOpenFailedMessage}`)}finally{ue(!1)}},[X,Ye,x,e,p.chatOpenFailedMessage,p.chatOpenFailedTitle]),ot=(0,Z.useCallback)(async()=>{ce(!0),U(null);try{await H(e),await X()}catch(e){U(`${p.catalysisFailed}: ${e instanceof Error?e.message:p.chatOpenFailedMessage}`)}finally{ce(!1)}},[X,e]),st=(0,Z.useCallback)(()=>{D(E===`breakdown`?null:`breakdown`),!Y?.aiDeep?.catalysis?.report&&!se&&ot()},[E,se,ot,Y?.aiDeep?.catalysis?.report]),ct=(0,Z.useCallback)(()=>{let t=k?k.markdown??``:J.current??Y?.markdown??``,n=k?k.title??``:R,r=Tt(n,t);return{source:{type:`note`,id:e,title:n||p.titlePlaceholder},text:r,language:Ie(r,f)}},[f,p.titlePlaceholder,Y?.markdown,e,k,R]),lt=(0,Z.useCallback)(async()=>{K.current&&clearTimeout(K.current),q.current&&clearTimeout(q.current),K.current=null,q.current=null;let t=J.current,r=Ae.current;J.current=null,Ae.current=null;let i={};if(t!==null&&(i.markdown=t),r!==null&&(i.title=r),Object.keys(i).length===0)return Y??null;L(!0);try{let t=await te(e,i);return await X(t,{revalidate:!1}),n?.(),t}catch(e){return U(`${p.saveFailed}: ${e instanceof Error?e.message:p.saveFailedHint}`),null}finally{L(!1)}},[X,p.saveFailed,p.saveFailedHint,Y,e,n]),ut=(0,Z.useCallback)(async()=>{U(null);let e=await lt();e&&(be(e),he(!0))},[lt]),ft=(0,Z.useCallback)(async()=>{if(!(we||M)){Se(!1),Te(!0),U(null),$(),K.current&&clearTimeout(K.current),q.current&&clearTimeout(q.current),K.current=null,q.current=null,J.current=null,Ae.current=null;try{await ke(e),window.dispatchEvent(new CustomEvent(`note-deleted`,{detail:{noteId:e}})),n?.(),t()}catch(e){U(`${p.deleteFailed}: ${e instanceof Error?e.message:p.quickCaptureFailedHint}`)}finally{Te(!1)}}},[we,p.deleteFailed,p.quickCaptureFailedHint,e,t,n,M,$]),pt=(0,Z.useMemo)(()=>(0,Q.jsxs)(`div`,{className:m(`flex min-w-0 items-center gap-1 sm:gap-2`,F),children:[c?(0,Q.jsx)(`button`,{type:`button`,onClick:c,"aria-label":p.searchDialogTitle,className:`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:(0,Q.jsx)(I,{className:`size-4`,"aria-hidden":!0})}):null,(0,Q.jsx)(Ct,{input:ct,showLabel:!1,labels:{read:p.readAloud,preparing:p.readAloudPreparing,pause:p.readAloudPause,resume:p.readAloudResume,retry:p.readAloudRetry,stop:p.readAloudStop}}),(0,Q.jsxs)(`button`,{type:`button`,onClick:st,disabled:se,"aria-label":p.catalysisSectionTitle,className:m(`inline-flex items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50`,E===`breakdown`?`bg-accent/10 text-accent`:`bg-accent/10 text-fg hover:bg-accent/15`),children:[(0,Q.jsx)(Ee,{className:`size-3.5`,"aria-hidden":!0}),(0,Q.jsx)(`span`,{className:`hidden sm:inline`,children:se?p.catalyzing:p.catalyzeButton})]}),(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>it(!1),"aria-label":p.openChatButton,disabled:V,className:m(`inline-flex items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-xs font-medium transition-colors`,`border border-edge text-fg-muted hover:bg-surface-hover hover:text-fg disabled:cursor-not-allowed disabled:opacity-50`),children:[(0,Q.jsx)(ze,{className:`size-3.5`,"aria-hidden":!0}),(0,Q.jsx)(`span`,{className:`hidden sm:inline`,children:V?p.openingChat:p.openChatButton})]}),(0,Q.jsx)(jt,{mode:w,onModeChange:tt,labels:{edit:p.modeEdit,source:p.modeSource,preview:p.modePreview}}),(0,Q.jsxs)(fe,{modal:!1,children:[(0,Q.jsx)(He,{asChild:!0,children:(0,Q.jsx)(`button`,{type:`button`,"aria-label":p.noteActions,title:p.noteActions,className:`inline-flex size-8 items-center justify-center rounded-lg text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:(0,Q.jsx)(ve,{className:`size-4`,"aria-hidden":!0})})}),(0,Q.jsx)(We,{children:(0,Q.jsxs)(Ge,{align:`end`,sideOffset:6,className:`z-50 min-w-40 rounded-xl border border-edge bg-surface-panel p-1 shadow-popover`,children:[(0,Q.jsxs)(ye,{onSelect:()=>void ut(),className:`flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-fg outline-none hover:bg-surface-hover focus:bg-surface-hover`,children:[(0,Q.jsx)(Ue,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),f===`zh`?`分享`:`Share`]}),(0,Q.jsxs)(ye,{onSelect:()=>D(E===`history`?null:`history`),className:`flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-fg outline-none hover:bg-surface-hover focus:bg-surface-hover`,children:[(0,Q.jsx)(z,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),(0,Q.jsx)(`span`,{className:`flex-1`,children:p.history}),E===`history`?(0,Q.jsx)(s,{className:`size-4 text-accent`,"aria-hidden":!0}):null]}),(0,Q.jsx)(P,{className:`my-1 h-px bg-edge-subtle`}),(0,Q.jsxs)(ye,{disabled:we||M,onSelect:()=>Se(!0),className:`flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-danger outline-none hover:bg-danger-soft focus:bg-danger-soft data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50`,children:[(0,Q.jsx)(Be,{className:`size-4`,"aria-hidden":!0}),p.delete]})]})})]})]}),[se,st,it,w,p.history,p.modeEdit,p.modePreview,p.modeSource,V,E,c,p.searchDialogTitle,p.readAloud,p.readAloudPause,p.readAloudPreparing,p.readAloudResume,p.readAloudRetry,p.readAloudStop,tt,ct,ut,we,M,f,p.delete,Se]);(0,Z.useLayoutEffect)(()=>(Le({startExtra:et,main:Y?rt:null,end:Y?pt:null}),()=>{o&&Re()}),[o,Re,pt,rt,et,Y,Le]);let gt=(0,Z.useCallback)(t=>{e&&($(),J.current=t,K.current&&clearTimeout(K.current),K.current=setTimeout(async()=>{let t=J.current;if(J.current=null,t!==null){L(!0),U(null);try{await te(e,{markdown:t}),await X(),n?.()}catch(e){U(`${p.saveFailed}: ${e instanceof Error?e.message:p.saveFailedHint}`)}finally{L(!1)}}},600))},[$,e,X,p.saveFailed,p.saveFailedHint,n]),vt=(0,Z.useCallback)(t=>{ae(e,t.timestamp).then(e=>{e&&($(),j(e))})},[e,$]),yt=(0,Z.useCallback)(()=>{$(),D(null),j(null)},[$]),bt=(0,Z.useCallback)(()=>{$(),D(null),j(null),X().catch(Qe),n?.()},[X,n,Qe,$]);if((0,Z.useEffect)(()=>()=>{K.current&&clearTimeout(K.current),q.current&&clearTimeout(q.current);let t=J.current,n=Ae.current;J.current=null,Ae.current=null;let r={};t!==null&&(r.markdown=t),n!==null&&(r.title=n),Object.keys(r).length>0&&te(e,r).catch(()=>void 0)},[e]),Y===void 0)return Ke?(0,Q.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 p-6 text-center`,role:`alert`,children:[(0,Q.jsx)(`p`,{className:`text-sm text-danger`,children:p.home.loadFailed}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>void X().catch(Qe),className:`rounded-lg border border-edge px-3 py-2 text-sm text-fg hover:bg-surface-hover`,children:p.home.retry}),(0,Q.jsx)(`button`,{type:`button`,onClick:t,className:`text-sm text-fg-muted hover:text-fg`,children:p.back})]}):(0,Q.jsx)(At,{});if(Y===null)return(0,Q.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 text-center`,children:[(0,Q.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:p.notFoundTitle}),(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:p.notFoundDescription}),(0,Q.jsx)(`button`,{type:`button`,onClick:t,className:`rounded-lg border border-edge px-3 py-1.5 text-sm font-medium text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,children:p.back})]});let xt=Ze?k.title??``:R,St=Ze?k.markdown??``:J.current??Y.markdown??``,wt=new Date(Y.createdAt).getTime(),Et=Number.isFinite(wt)&&Date.now()-wt<3600*1e3?(0,Q.jsx)(at,{title:h.noteCreatedTitle,description:h.noteCreatedDescription,prompt:h.noteCreatedPrompt,coverage:{eventType:`note.created`,source:`notes`,eventPayload:{noteId:e}},variant:`titleAction`,className:`ml-3 hidden max-w-[18rem] shrink-0 md:flex`}):null;return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`flex h-full min-h-0 gap-3 p-4 sm:px-5`,children:[(0,Q.jsxs)(`div`,{className:`mx-auto flex min-h-0 min-w-0 w-full max-w-[60rem] flex-1 flex-col`,children:[pe?(0,Q.jsx)(`p`,{className:`mb-3 shrink-0 rounded-lg border border-danger/25 bg-danger-soft px-3 py-2 text-sm text-danger`,role:`alert`,children:pe}):null,(0,Q.jsx)(G,{eventType:`note.created`,source:`notes`,payloadKey:`noteId`,payloadValue:e,className:`mb-3 shrink-0`}),(0,Q.jsx)(G,{eventType:`note.updated`,source:`notes`,payloadKey:`noteId`,payloadValue:e,className:`mb-3 shrink-0`}),g?(0,Q.jsxs)(`div`,{className:`mb-2 flex shrink-0 gap-4 text-sm`,children:[(0,Q.jsx)(`button`,{className:v?`text-accent-fg`:`text-fg-muted`,onClick:()=>b(!0),children:f===`zh`?`会议`:`Meeting`}),(0,Q.jsx)(`button`,{className:v?`text-fg-muted`:`text-accent-fg`,onClick:()=>b(!1),children:f===`zh`?`我的笔记`:`My notes`})]}):null,(0,Q.jsxs)(`div`,{ref:je,className:`flex min-h-0 flex-1 flex-col overflow-hidden rounded-xl border border-edge-subtle bg-surface-panel xl:flex-row`,children:[g&&v?(0,Q.jsx)(dt,{noteId:e}):null,(0,Q.jsx)(`div`,{className:g&&v?`hidden`:`min-h-0 min-w-0 flex-1`,children:Ze?(0,Q.jsxs)(`div`,{className:`h-full overflow-y-auto px-4 py-4 sm:px-6`,children:[xt&&(0,Q.jsx)(`h1`,{className:`mb-4 text-2xl font-bold text-fg/70`,children:xt}),St?(0,Q.jsx)(W,{noteId:e,content:St,className:`opacity-80`}):(0,Q.jsx)(`p`,{className:`italic text-fg-muted`,children:p.emptyPreview})]}):(0,Q.jsxs)(Q.Fragment,{children:[w===`wysiwyg`&&(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-start px-6 pt-4`,children:[(0,Q.jsx)(`input`,{ref:Pe,type:`text`,value:R,onChange:e=>nt(e.target.value),onCompositionStart:()=>{Oe.current=!0},onCompositionEnd:()=>{Oe.current=!1},onKeyDown:e=>{let t=e.nativeEvent;e.key===`Enter`&&!Oe.current&&!t.isComposing&&(e.preventDefault(),(je.current?.querySelector(`.ProseMirror`))?.focus())},placeholder:p.titlePlaceholder,className:`min-w-0 flex-1 border-none bg-transparent text-2xl font-bold text-fg placeholder:text-fg-muted/40 focus:outline-none`}),Et]}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,Q.jsx)(Z.Suspense,{fallback:(0,Q.jsx)(At,{}),children:(0,Q.jsx)(Ot,{initialContent:Y.markdown??``,onChange:gt,noteId:e},`wysiwyg-${e}`)})})]}),w===`source`&&(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-start px-6 pt-4`,children:[(0,Q.jsx)(`input`,{ref:Pe,type:`text`,value:R,onChange:e=>nt(e.target.value),placeholder:p.titlePlaceholder,className:`min-w-0 flex-1 border-none bg-transparent text-2xl font-bold text-fg placeholder:text-fg-muted/40 focus:outline-none`}),Et]}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,Q.jsx)(Z.Suspense,{fallback:(0,Q.jsx)(At,{}),children:(0,Q.jsx)(kt,{initialContent:Y.markdown??``,onChange:gt,isDark:S},`source-${e}`)})})]}),w===`preview`&&(0,Q.jsxs)(`div`,{className:`h-full overflow-y-auto px-4 py-4 sm:px-6`,onClick:e=>{let t=e.target;t instanceof HTMLImageElement&&C(t.currentSrc||t.src,t.alt)},children:[R&&!Y.markdown.trimStart().startsWith(`# ${R.trim()}\n`)&&Y.markdown.trim()!==`# ${R.trim()}`&&(0,Q.jsx)(`h1`,{className:`mb-4 text-2xl font-bold text-fg`,children:R}),Y.markdown?(0,Q.jsx)(W,{noteId:e,content:Y.markdown,className:`[&_img]:cursor-zoom-in`}):(0,Q.jsx)(`p`,{className:`italic text-fg-muted`,children:p.emptyPreview})]})]})})]})]}),(0,Q.jsx)(`div`,{ref:Me,className:m(`relative flex min-h-0 shrink-0 flex-col overflow-hidden`,!B&&`transition-[width] duration-300 ease-in-out`),style:{width:E?ne:0},children:(0,Q.jsxs)(`div`,{ref:Ne,className:`flex min-h-0 flex-1 flex-col`,style:{width:ne},children:[(0,Q.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,onPointerDown:e=>{e.preventDefault();let t=e.currentTarget;t.setPointerCapture(e.pointerId),oe(!0);let n=e.clientX,r=ne,i=e.pointerId,a=0,o=ne,s=ne,c=()=>{a=0,s=o,E&&Me.current?.style.setProperty(`width`,`${s}px`),Ne.current?.style.setProperty(`width`,`${s}px`)},l=e=>{let t=r-(e.clientX-n);o=Math.max(280,Math.min(600,Math.round(t))),a===0&&(a=window.requestAnimationFrame(c))},u=()=>{a!==0&&(window.cancelAnimationFrame(a),c());try{t.releasePointerCapture(i)}catch{}oe(!1),ie(s),window.removeEventListener(`pointermove`,l),window.removeEventListener(`pointerup`,u),window.removeEventListener(`pointercancel`,u)};window.addEventListener(`pointermove`,l),window.addEventListener(`pointerup`,u),window.addEventListener(`pointercancel`,u)},className:m(`absolute left-0 top-0 z-10 h-full w-2 -translate-x-1/2 cursor-col-resize`,`before:content-[''] before:pointer-events-none before:absolute before:left-1/2 before:top-0 before:h-full before:w-px before:-translate-x-1/2`,`before:bg-transparent before:transition-[background-color] before:duration-150`,`hover:before:bg-edge/65 dark:hover:before:bg-edge/75`,B&&`before:!bg-edge/80 dark:before:!bg-edge/85`,`touch-none select-none`)}),(0,Q.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden rounded-xl border border-edge-subtle bg-surface-panel`,children:E===`history`?(0,Q.jsx)(mt,{noteId:e,activeTimestamp:k?.timestamp??null,onSelect:vt,onClose:yt,onRestored:bt}):E===`breakdown`?(0,Q.jsx)(ht,{noteId:e,note:Y??null,catalyzing:se,onCatalyze:ot,onClose:()=>D(null),noteThreads:Je,openingChat:V,onOpenChat:()=>it(!1),onOpenNewChat:()=>it(!0)}):null})]})})]}),ge?(0,Q.jsx)(_t,{open:me,onOpenChange:he,note:ge}):null,(0,Q.jsx)(le,{open:xe,title:p.deleteConfirmTitle,description:p.deleteConfirmDescription.replace(`{{title}}`,Y.title||p.titlePlaceholder),confirmLabel:p.deleteConfirmLabel,cancelLabel:p.deleteCancelLabel,destructive:!0,onConfirm:()=>void ft(),onCancel:()=>Se(!1)})]})}export{Xe as a,nt as i,it as n,rt as r,Nt as t};
@@ -1,8 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{f as i,g as a,m as o,u as s}from"./chunk-KS7C4IRE-BMYIfy9x.js";import{t as c}from"./popover-select-B-GDnZO9.js";import{f as l}from"./markdown-view-DYGPxPee.js";import{t as u}from"./plus-Q2yW6OE7.js";import{t as d}from"./x-B_N4OPjy.js";import{t as f}from"./cn-JdwAhgNB.js";import{c as p,f as m,n as h}from"./locale-store-DA0Z5jM_.js";import{t as g}from"./messages-4BtQKYlM.js";import{i as _}from"./vendor-swr-BIWyz7Rc.js";import{t as v}from"./skeleton-BwbyijEw.js";import{Bu as y,Dc as b,Dn as x,Do as S,Ec as ee,Fn as te,Gl as ne,Gt as C,Gu as w,Jn as T,Jt as E,Ju as D,Kc as O,Kt as k,Ku as A,Ml as re,Nu as j,Qi as ie,Ql as ae,Qn as M,Rn as oe,Sn as se,Ta as ce,Xt as le,Yn as N,Yt as P,Yu as ue,Zc as de,Zs as fe,Zt as pe,Zu as me,au as he,bn as ge,do as _e,fl as ve,hc as ye,kn as be,lo as xe,qt as F,rl as I,tc as Se,uc as Ce,wn as we,xn as Te,yn as Ee,zn as De}from"./index-PFQHPGgi.js";import{i as Oe,t as ke}from"./note-detail-panel-DuXCt-MM.js";var L=n(),R=e(t(),1),z=r();function B({projectId:e}){let t=h(e=>e.language)===`zh`,n=i(),r=(0,R.useRef)(null),a=(0,R.useRef)(null),[o,s]=(0,R.useState)(null),[c,l]=(0,R.useState)(null),[u,d]=(0,R.useState)(null);async function f(){let t=a.current;if(!(!t||o!==null)){s(0),l(null);try{let r=await pe();if(r.consentAcknowledgedAt==null){d(r.consentPolicyVersion);return}let i=await C(t.file,t.requestId),o=await le({clientRequestId:t.requestId,contextProjectId:e,source:`web`,consentPolicyVersion:r.consentPolicyVersion});t.discussionId=o.discussion.id,await E({...i,serverDiscussionId:o.discussion.id,projectId:e}),o.discussion.audioAttachmentId||await k(i,o.discussion.id,s),await F(t.requestId),a.current=null,n(`/notes/${encodeURIComponent(o.note.id)}`)}catch(e){l(e instanceof Error?e.message:String(e))}finally{s(null)}}}return(0,z.jsxs)(`div`,{className:`inline-flex flex-wrap items-center gap-2 text-xs`,children:[(0,z.jsx)(`input`,{ref:r,hidden:!0,type:`file`,accept:`audio/*,.m4a,.wav,.mp3,.webm,.ogg`,onChange:e=>{let n=e.target.files?.[0];if(e.target.value=``,n){if(!n.size||n.size>1073741824){l(t?`音频须为 1 字节至 1 GiB`:`Audio must be between 1 byte and 1 GiB`);return}a.current={file:n,requestId:crypto.randomUUID()},f()}}}),(0,z.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 rounded-md p-2 hover:bg-surface-hover`,disabled:o!==null,onClick:()=>c&&a.current?void f():r.current?.click(),children:[(0,z.jsx)(fe,{className:`size-3.5`}),o===null?c&&a.current?t?`重试导入`:`Retry import`:t?`导入录音`:`Import recording`:`${o}%`]}),u===null?null:(0,z.jsxs)(`span`,{children:[t?`请确认你有权上传此录音,并允许配置的语音服务处理。`:`Confirm permission to upload this recording and process it with your configured speech service.`,(0,z.jsx)(`button`,{type:`button`,className:`p-2 text-accent`,onClick:()=>void P(u).then(()=>(d(null),f())).catch(e=>l(String(e))),children:t?`确认导入`:`Confirm import`})]}),c?(0,z.jsx)(`span`,{role:`alert`,className:`text-danger`,children:c}):null]})}async function V(e){e.note??=await x({title:e.title,markdown:e.markdown,projectId:e.projectId,channel:`web`},e.requestId);let t=e.note.id;for(let n=e.attachments.length;n<e.files.length;n++)e.attachments.push(await N(t,e.files[n],`${e.requestId}:file:${n}`));if(e.attachments.length){let n=e.attachments.map(e=>`[${e.fileName.replace(/[\\[\]]/g,`\\$&`).replace(/[\r\n]/g,` `)}](${M(t,e.id)})`);e.note=await T(t,{markdown:`${e.markdown}\n\n## ${e.materialHeading}\n\n${n.join(`
2
-
3
- `)}`})}return{noteId:t,conversationId:(await De(t,{projectId:e.projectId})).conversationId}}function H(e,t,n){let r=new URLSearchParams({draft:n.replace(`{{id}}`,t),autoSend:`1`});return`/chat/${encodeURIComponent(e)}?${r}`}var U={meeting:w,requirements:ae,research:b,weekly:j};function Ae({projects:e,projectId:t,onProjectChange:n,onCreated:r,labels:a,projectsLoading:o,projectsError:s}){let l=a.home,u=i(),[p,m]=(0,R.useState)(``),[h,g]=(0,R.useState)(null),[_,v]=(0,R.useState)([]),[y,b]=(0,R.useState)(!1),[x,S]=(0,R.useState)(null),[ee,te]=(0,R.useState)(``),C=(0,R.useRef)(null),w=(0,R.useRef)(!1),T=(0,R.useRef)(null),E=(0,R.useRef)(null),D=y||!!C.current,k=h?l.templateOptions[h]:null,re=!!(p.trim()||_.length);async function j(){if(!(w.current||!re&&!C.current)){w.current=!0,b(!0),S(null),C.current??={requestId:crypto.randomUUID(),title:p.trim().split(`
4
- `)[0]?.slice(0,80)||k?.label||a.titlePlaceholder,markdown:`## ${l.requestHeading}\n\n${k?`${k.prompt}\n`:``}${p.trim()}`,projectId:t||void 0,files:[..._],attachments:[],materialHeading:l.materialsHeading};try{let e=await V(C.current);r(),u(H(e.conversationId,e.noteId,l.agentPrompt))}catch(e){C.current.note&&r(),S(e instanceof Error?e.message:a.quickCaptureFailedHint)}finally{w.current=!1,b(!1)}}}function ie(){C.current=null,S(null),m(``),v([]),g(null),E.current?.focus()}return(0,z.jsxs)(`section`,{"aria-label":l.askLabel,children:[(0,z.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),j()},className:`relative rounded-xl border border-edge bg-surface-panel p-4 focus-within:border-accent/60 sm:p-5`,children:[(0,z.jsxs)(`fieldset`,{disabled:D,className:`min-w-0`,children:[(0,z.jsxs)(`label`,{htmlFor:`notes-home-prompt`,className:`flex items-center gap-2 text-xs font-medium text-accent-fg`,children:[(0,z.jsx)(ye,{className:`size-4`,"aria-hidden":!0}),l.askLabel]}),k?(0,z.jsxs)(`div`,{className:`mt-3 flex items-start gap-2 rounded-lg bg-accent-soft px-3 py-2 text-xs leading-5 text-accent-fg`,children:[(0,z.jsxs)(`p`,{className:`min-w-0 flex-1`,children:[(0,z.jsxs)(`span`,{className:`font-medium`,children:[k.label,` · `]}),k.prompt.split(`
5
-
6
- `)[0]]}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>g(null),"aria-label":a.searchClear,className:`shrink-0 rounded p-1 hover:bg-surface-hover`,children:(0,z.jsx)(d,{className:`size-3.5`})})]}):null,(0,z.jsx)(`textarea`,{ref:E,id:`notes-home-prompt`,value:p,onChange:e=>m(e.target.value),placeholder:k?k.prompt.split(`
7
-
8
- `).at(-1):l.askPlaceholder,rows:2,onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&!e.nativeEvent.isComposing&&(e.preventDefault(),j())},className:`mt-2 min-h-16 w-full resize-y bg-transparent py-2 text-base leading-6 text-fg outline-none placeholder:text-fg-muted sm:text-sm`}),_.length?(0,z.jsx)(`ul`,{className:`mb-3 flex flex-wrap gap-2`,children:_.map((e,t)=>(0,z.jsxs)(`li`,{className:`flex max-w-full items-center gap-2 rounded-md border border-edge px-2 py-1 text-xs text-fg-muted`,children:[(0,z.jsx)(O,{className:`size-3 shrink-0`,"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`truncate`,children:e.name}),(0,z.jsx)(`button`,{type:`button`,"aria-label":`${l.removeMaterial}: ${e.name}`,onClick:()=>v(e=>e.filter((e,n)=>n!==t)),className:`rounded p-1 hover:bg-surface-hover`,children:(0,z.jsx)(d,{className:`size-3`})})]},`${e.name}-${t}`))}):null,(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 sm:pr-40`,children:[(0,z.jsx)(`div`,{className:`w-44 max-w-full`,children:(0,z.jsx)(c,{value:t,options:e.filter(e=>e.name.toLowerCase().includes(ee.toLowerCase())).map(e=>({value:e.id,label:e.name})),selectedLabel:t?e.find(e=>e.id===t)?.name:l.unassigned,placeholder:l.unassigned,emptyLabel:l.unassigned,ariaLabel:l.assignProject,triggerIcon:(0,z.jsx)(ne,{className:`size-4 shrink-0`,"aria-hidden":!0}),triggerClassName:`h-8 border-transparent bg-transparent px-2 text-xs text-fg-muted hover:bg-surface-hover`,onChange:n,disabled:D,loading:o,statusMessage:s?l.projectsLoadFailed:void 0,searchPlaceholder:l.projectSearch,searchValue:ee,onSearchChange:te})}),(0,z.jsxs)(`button`,{type:`button`,onClick:()=>T.current?.click(),className:`inline-flex h-8 items-center gap-1.5 rounded-md px-2 text-xs text-fg-muted hover:bg-surface-hover`,children:[(0,z.jsx)(O,{className:`size-4`,"aria-hidden":!0}),l.addMaterials]}),(0,z.jsx)(`input`,{ref:T,type:`file`,multiple:!0,className:`hidden`,"aria-label":l.addMaterials,onChange:e=>{let t=Array.from(e.target.files??[]);v(e=>[...e,...t]),e.target.value=``}})]})]}),(0,z.jsx)(`div`,{className:`mt-2 flex justify-end sm:absolute sm:bottom-5 sm:right-5 sm:mt-0`,children:(0,z.jsxs)(`button`,{type:`submit`,disabled:y||!C.current&&!re,className:`inline-flex h-9 items-center gap-2 rounded-lg bg-accent px-4 text-sm font-medium text-on-accent hover:bg-accent-hover focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50`,children:[y?(0,z.jsx)(ve,{className:`size-4 animate-spin`,"aria-hidden":!0}):(0,z.jsx)(A,{className:`size-4`,"aria-hidden":!0}),y?l.creating:x?l.retry:l.agentCreate]})})]}),x?(0,z.jsxs)(`div`,{className:`mt-3 rounded-lg border border-danger/25 bg-danger-soft px-3 py-3 text-xs text-danger`,role:`alert`,children:[(0,z.jsx)(`p`,{children:x}),C.current?.note?(0,z.jsx)(`p`,{className:`mt-1`,children:l.partialFailure}):null,(0,z.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-3`,children:[C.current?.note?(0,z.jsx)(`button`,{type:`button`,onClick:()=>u(`/notes/${encodeURIComponent(C.current.note.id)}?edit=1`),className:`underline`,children:l.openSavedDraft}):null,(0,z.jsx)(`button`,{type:`button`,onClick:ie,className:`underline`,children:l.newRequest})]})]}):null,(0,z.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-x-1 gap-y-1 text-xs text-fg-muted`,children:[(0,z.jsx)(`span`,{className:`mr-1 py-2`,children:l.templates}),Object.keys(U).map(e=>{let t=U[e];return(0,z.jsxs)(`button`,{type:`button`,disabled:D,"aria-pressed":h===e,onClick:()=>{g(h===e?null:e),E.current?.focus()},className:f(`inline-flex items-center gap-1.5 rounded-md px-2 py-2 hover:bg-surface-hover disabled:opacity-50`,h===e&&`bg-accent-soft text-accent-fg`),children:[(0,z.jsx)(t,{className:`size-3.5`,"aria-hidden":!0}),l.templateOptions[e].label]},e)}),(0,z.jsx)(B,{}),(0,z.jsxs)(`button`,{type:`button`,disabled:y,onClick:()=>xe(),className:`ml-auto inline-flex items-center gap-1.5 rounded-md px-2 py-2 hover:bg-surface-hover`,children:[(0,z.jsx)(I,{className:`size-3.5`,"aria-hidden":!0}),l.recordDiscussion]})]})]})}function je(e,t){let n=Number(e.get(`page`)??0),r=Number.isSafeInteger(n)&&n>=0?n:0,i=e.get(`view`);return{projectId:e.get(`projectId`)||void 0,unassigned:e.get(`unassigned`)===`true`||i===`unassigned`||void 0,pinned:i===`favorites`?!0:void 0,agentEdited:i===`agent`||void 0,status:i===`archived`?`archived`:void 0,search:t.trim()||void 0,sortBy:`updatedAt`,sortOrder:`desc`,limit:12,offset:r*12}}function Me(e){let t=e.snippet?.trim()??``,n=e.title?.trim();return n&&t.startsWith(n)?t.slice(n.length).replace(/^[\s::·—-]+/,``):t}var W=`touch-target inline-flex min-h-9 items-center justify-center gap-2 rounded-lg px-3 text-sm text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:cursor-not-allowed disabled:opacity-50`;function G(){let e=h(e=>e.language),t=g(e).notes,n=t.home,r=p(e=>e.conversationId),o=_e(e=>e.setPageHeader),l=_e(e=>e.clearPageHeader),d=i(),{pathname:b,search:C}=s(),[E,O]=a(),k=E.get(`projectId`)||``,A=E.get(`view`)||`all`,j=E.get(`unassigned`)===`true`||A===`unassigned`,M=E.get(`search`)||``,[le]=ce(M,250),[N,P]=(0,R.useState)(k),[fe,pe]=(0,R.useState)(``),[xe,F]=(0,R.useState)(null),[I,De]=(0,R.useState)(!1),[ke,L]=(0,R.useState)(new Set),[B,V]=(0,R.useState)(null),[H,U]=(0,R.useState)(null),G=(0,R.useRef)(new Set),K=(0,R.useRef)(null),q=(0,R.useRef)(!1),Ne=(0,R.useRef)(null),Pe=je(E,le),J=(Pe.offset??0)/12,{data:Fe,error:Ie,isLoading:Le,mutate:Re}=_(r?[`notes-home`,r,Pe]:null,()=>oe(Pe)),{data:ze,error:Be,isLoading:Y,mutate:Ve}=_(r?[`notes-home-projects`,r]:null,te),X=ze?.items??[],He=X.find(e=>e.id===k)?.name??n.projectNotes,Ue=Fe?.items??[],Z=Fe?.total??0,We=Le||M!==le,Ge=(0,R.useMemo)(()=>({justNow:t.justNow,minutesAgo:t.minutesAgo,today:t.today,yesterday:t.yesterday,daysAgo:t.daysAgo,locale:m(e)}),[e,t.justNow,t.minutesAgo,t.today,t.yesterday,t.daysAgo]),[Ke,qe]=(0,R.useState)(()=>Date.now());(0,R.useEffect)(()=>{P(k)},[k]),(0,R.useEffect)(()=>{let e=window.setInterval(()=>qe(Date.now()),6e4);return()=>window.clearInterval(e)},[]);let Q=(0,R.useCallback)(()=>{Re().catch(()=>void 0),Ve().catch(()=>void 0)},[Re,Ve]);(0,R.useEffect)(()=>{let e=[`note-updated`,`note-created`,`note-deleted`,`project-updated`,`project-created`,`project-deleted`];return e.forEach(e=>window.addEventListener(e,Q)),()=>e.forEach(e=>window.removeEventListener(e,Q))},[Q]);let Je=(0,R.useCallback)((e,t=!1)=>{let n=`${b}${C}`,r=new URLSearchParams({returnTo:n});t&&r.set(`edit`,`1`),d(`/notes/${encodeURIComponent(e)}?${r}`)},[b,C,d]),$=(0,R.useCallback)(async()=>{if(!(q.current||!r)){q.current=!0,De(!0),F(null),K.current??={key:crypto.randomUUID(),projectId:N||void 0};try{let e=await x({markdown:``,kind:`thought`,projectId:K.current.projectId},K.current.key);K.current=null,Q(),Je(e.id,!0)}catch(e){F(`${t.createBlankFailed}: ${e instanceof Error?e.message:t.createBlankFailedHint}`)}finally{q.current=!1,De(!1)}}},[N,t.createBlankFailed,t.createBlankFailedHint,Je,Q,r]),Ye=(0,R.useCallback)(e=>{O(t=>{let n=new URLSearchParams(t);return e?n.set(`search`,e):n.delete(`search`),n.delete(`page`),n},{replace:!0})},[O]);function Xe(e,t=`all`){let n=new URLSearchParams;e&&n.set(`projectId`,e),t===`unassigned`?n.set(`unassigned`,`true`):t!==`all`&&n.set(`view`,t),P(e),O(n)}function Ze(e){O(t=>{let n=new URLSearchParams(t);return j&&n.set(`unassigned`,`true`),e===`all`?n.delete(`view`):n.set(`view`,e),n.delete(`page`),n})}async function Qe(e,n){if(!G.current.has(e)){G.current.add(e),L(new Set(G.current)),F(null);try{await T(e,{pinned:n}),Q()}catch(e){F(`${t.actionFailed}: ${e instanceof Error?e.message:t.quickCaptureFailedHint}`)}finally{G.current.delete(e),L(new Set(G.current))}}}async function $e(){let e=B;if(!(!e||H)){V(null),U(e.id),F(null);try{await be(e.id),window.dispatchEvent(new CustomEvent(`note-deleted`,{detail:{noteId:e.id}})),Q()}catch(e){F(`${t.deleteFailed}: ${e instanceof Error?e.message:t.quickCaptureFailedHint}`)}finally{U(null)}}}if((0,R.useLayoutEffect)(()=>{if(!r){l();return}return o({startExtra:null,main:(0,z.jsx)(`h1`,{className:`truncate text-base font-semibold text-fg`,children:t.title}),end:(0,z.jsxs)(`div`,{className:f(`flex min-w-0 items-center gap-2`,S),children:[(0,z.jsxs)(`label`,{className:`flex h-9 w-32 min-w-0 items-center gap-2 rounded-lg border border-edge bg-surface-panel px-2 sm:w-48`,children:[(0,z.jsx)(ee,{className:`size-4 shrink-0 text-fg-muted`,"aria-hidden":!0}),(0,z.jsx)(`input`,{ref:Ne,type:`search`,value:M,onChange:e=>Ye(e.target.value),"aria-label":t.searchDialogTitle,placeholder:t.searchPlaceholder,className:`min-w-0 flex-1 bg-transparent text-sm text-fg outline-none placeholder:text-fg-muted`})]}),(0,z.jsxs)(`button`,{type:`button`,onClick:()=>void $(),disabled:I,"aria-label":n.blankNote,className:f(W,`border border-edge bg-surface-panel text-fg`),children:[I?(0,z.jsx)(ve,{className:`size-4 animate-spin`,"aria-hidden":!0}):(0,z.jsx)(u,{className:`size-4`,"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`hidden sm:inline`,children:n.blankNote})]})]})}),()=>l()},[l,$,I,n.blankNote,t.searchDialogTitle,t.searchPlaceholder,t.title,M,o,Ye,r]),(0,R.useEffect)(()=>{let e=e=>{!(e.metaKey||e.ctrlKey)||e.altKey||e.isComposing||e.target?.closest(`input, textarea, [contenteditable="true"], [role="dialog"]`)||(e.key.toLowerCase()===`n`&&(e.preventDefault(),$()),e.key.toLowerCase()===`f`&&(e.preventDefault(),Ne.current?.focus()))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[$]),!r)return(0,z.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8 text-sm text-fg-muted`,children:t.needToken});let et=[{id:`all`,label:n.homeNav,Icon:de},{id:`favorites`,label:n.favorites,Icon:Ce},{id:`unassigned`,label:n.unassigned,Icon:re},{id:`archived`,label:t.filterArchived,Icon:me}],tt=k?`project:${k}`:j?`unassigned`:`all`;return(0,z.jsxs)(`div`,{className:`flex h-full min-h-0 w-full flex-1 overflow-hidden bg-surface-panel`,children:[(0,z.jsxs)(`aside`,{className:`hidden w-44 shrink-0 flex-col gap-1 overflow-y-auto px-3 py-6 xl:flex`,"aria-label":n.homeNav,children:[et.map(({id:e,label:t,Icon:n})=>(0,z.jsxs)(`button`,{type:`button`,onClick:()=>Xe(``,e),"aria-current":!k&&(e===`unassigned`?j:!j&&A===e)?`page`:void 0,className:f(W,`justify-start px-2 text-left text-xs`,!k&&(e===`unassigned`?j:!j&&A===e)&&`bg-surface-hover font-medium text-fg`),children:[(0,z.jsx)(n,{className:`size-4 shrink-0`,"aria-hidden":!0}),t]},e)),(0,z.jsx)(`span`,{className:`mb-1 mt-7 px-2 text-xs text-fg-muted`,children:n.projects}),Y?[0,1,2].map(e=>(0,z.jsx)(v,{className:`mb-2 h-8 w-full`},e)):X.slice(0,8).map(e=>(0,z.jsxs)(`button`,{type:`button`,onClick:()=>Xe(e.id),"aria-current":k===e.id?`page`:void 0,className:f(W,`justify-start px-2 text-left text-xs`,k===e.id&&`bg-surface-hover font-medium text-fg`),children:[(0,z.jsx)(ne,{className:`size-4 shrink-0`,"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`truncate`,children:e.name})]},e.id)),(0,z.jsxs)(`button`,{type:`button`,onClick:()=>d(`/projects`),className:f(W,`mt-2 justify-start px-2 text-xs`),children:[n.allProjects,(0,z.jsx)(D,{className:`ml-auto size-3`,"aria-hidden":!0})]})]}),(0,z.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto overscroll-contain`,children:(0,z.jsxs)(`div`,{className:`mx-auto flex w-full max-w-6xl flex-col px-4 py-4 sm:py-7 sm:px-8 lg:px-10 lg:py-9`,children:[(0,z.jsxs)(`div`,{className:`mb-6 flex flex-wrap items-start justify-between gap-4`,children:[(0,z.jsx)(`h2`,{className:`min-w-0 break-words text-2xl font-semibold tracking-tight text-fg`,children:k?He:j?n.unassigned:n.homeTitle}),k?(0,z.jsxs)(`button`,{type:`button`,onClick:()=>d(`/projects/${encodeURIComponent(k)}`),className:f(W,`text-xs`),children:[n.openProject,(0,z.jsx)(D,{className:`size-3.5`,"aria-hidden":!0})]}):null]}),xe?(0,z.jsx)(`p`,{className:`mb-4 rounded-lg border border-danger/25 bg-danger-soft px-3 py-2 text-sm text-danger`,role:`alert`,children:xe}):null,(0,z.jsx)(`div`,{className:`order-3 mt-6 sm:order-none sm:mt-0`,children:(0,z.jsx)(Ae,{projects:X,projectId:N,onProjectChange:P,onCreated:Q,labels:t,projectsLoading:Y,projectsError:!!Be})}),Be?(0,z.jsxs)(`div`,{role:`alert`,className:`mt-4 flex items-center gap-3 text-xs text-danger`,children:[(0,z.jsx)(`span`,{children:n.projectsLoadFailed}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>void Ve().catch(()=>void 0),className:`underline`,children:n.retry})]}):null,!k&&!j&&(Y||X.length>0)?(0,z.jsxs)(`section`,{className:`order-4 mt-8 sm:order-none`,"aria-label":n.continueProjects,children:[(0,z.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,z.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:n.continueProjects}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>d(`/projects`),className:`text-xs text-fg-muted hover:text-fg`,children:n.allProjects})]}),(0,z.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:Y?[0,1,2].map(e=>(0,z.jsx)(v,{className:`h-28 w-full`},e)):X.slice(0,3).map(e=>(0,z.jsxs)(`button`,{type:`button`,onClick:()=>Xe(e.id),className:`min-w-0 rounded-lg border border-edge bg-surface-panel p-3 text-left transition-colors sm:p-4 hover:bg-surface-base focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,z.jsxs)(`span`,{className:`flex items-center gap-2 text-sm font-medium text-fg`,children:[(0,z.jsx)(ne,{className:`size-4 shrink-0`,"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`truncate`,children:e.name})]}),e.description?(0,z.jsx)(`p`,{className:`mt-2 hidden line-clamp-1 text-xs text-fg-muted sm:block`,children:e.description}):null,(0,z.jsxs)(`span`,{className:`mt-2 flex flex-wrap items-center justify-between gap-1 text-xs text-fg-muted sm:mt-3`,children:[(0,z.jsx)(`span`,{children:t.noteCount.replace(`{{count}}`,String(e.noteCount))}),(0,z.jsx)(`span`,{children:e.updatedAt?Oe(e.updatedAt,Ke,Ge):n.emptyProject})]})]},e.id))})]}):null,(0,z.jsxs)(`section`,{className:`order-2 mt-2 pb-6 sm:order-none sm:mt-8`,"aria-label":n.recentNotes,children:[(0,z.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-3`,children:[(0,z.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:k?n.projectNotes:n.recentNotes}),(0,z.jsx)(`div`,{className:`w-48 max-w-full`,children:(0,z.jsx)(c,{value:tt,allowEmpty:!1,ariaLabel:n.projects,placeholder:n.allNotes,options:[{value:`all`,label:n.allNotes},{value:`unassigned`,label:n.unassigned},...X.filter(e=>e.name.toLowerCase().includes(fe.toLowerCase())).map(e=>({value:`project:${e.id}`,label:e.name}))],selectedLabel:k?He:j?n.unassigned:n.allNotes,triggerClassName:`h-8 bg-surface-panel text-xs`,loading:Y,searchPlaceholder:n.projectSearch,searchValue:fe,onSearchChange:pe,onChange:e=>Xe(e.startsWith(`project:`)?e.slice(8):``,e===`unassigned`?e:`all`)})})]}),(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-5 border-b border-edge`,"aria-label":t.libraryTitle,children:[[{id:`all`,label:t.filterAll},{id:`agent`,label:n.agentEdited},{id:`favorites`,label:n.favorites},{id:`archived`,label:t.filterArchived}].map(({id:e,label:t})=>(0,z.jsx)(`button`,{type:`button`,"aria-pressed":A===e||e===`all`&&A===`unassigned`,onClick:()=>Ze(e),className:f(`touch-target border-b-2 border-transparent py-3 text-xs text-fg-muted hover:text-fg`,(A===e||e===`all`&&A===`unassigned`)&&`border-fg font-medium text-fg`),children:t},e)),(0,z.jsx)(`span`,{className:`ml-auto py-3 text-xs text-fg-muted`,children:n.sortUpdated})]}),Ie?(0,z.jsxs)(`div`,{className:`py-10 text-center`,role:`alert`,children:[(0,z.jsx)(`p`,{className:`text-sm text-danger`,children:n.loadFailed}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>void Re().catch(()=>void 0),className:f(W,`mt-2`),children:n.retry})]}):We?(0,z.jsx)(`div`,{"aria-busy":`true`,className:`divide-y divide-edge`,children:[0,1,2,3].map(e=>(0,z.jsxs)(`div`,{className:`flex items-center gap-3 py-4`,children:[(0,z.jsx)(v,{className:`h-10 w-8 shrink-0`}),(0,z.jsxs)(`div`,{className:`flex-1 space-y-2`,children:[(0,z.jsx)(v,{className:`h-4 w-2/3`}),(0,z.jsx)(v,{className:`h-3 w-1/2`})]})]},e))}):Ue.length===0?(0,z.jsxs)(`div`,{className:`flex flex-col items-center px-4 py-12 text-center`,children:[(0,z.jsx)(de,{className:`mb-4 size-8 text-fg-muted`,strokeWidth:1.3,"aria-hidden":!0}),(0,z.jsx)(`h4`,{className:`text-sm font-medium text-fg`,children:M||A!==`all`&&A!==`unassigned`?n.noMatches:k?n.projectEmpty:n.emptyTitle}),(0,z.jsx)(`p`,{className:`mt-2 max-w-md text-sm leading-6 text-fg-muted`,children:M||A!==`all`&&A!==`unassigned`?n.noMatchesHint:k?n.projectEmptyHint:n.emptyDescription})]}):(0,z.jsx)(`ul`,{className:`divide-y divide-edge`,children:Ue.map(e=>{let r=e.voiceAttachmentId||e.kind===`voice`?w:e.kind===`bookmark`?y:ae,i=Me(e)||(e.coverAttachmentId?t.imageNote:t.noText);return(0,z.jsxs)(`li`,{className:`group flex min-w-0 items-center gap-3 py-4`,children:[(0,z.jsxs)(`button`,{type:`button`,onClick:()=>Je(e.id),className:`touch-target flex min-w-0 flex-1 items-center gap-3 rounded-md text-left focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,z.jsx)(`span`,{className:`flex h-10 w-8 shrink-0 items-center justify-center rounded-md border border-edge text-fg-muted`,children:(0,z.jsx)(r,{className:`size-4`,"aria-hidden":!0})}),(0,z.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,z.jsx)(`span`,{className:`block truncate text-base font-medium text-fg sm:text-sm group-hover:text-accent-fg`,children:e.title||i.slice(0,48)||t.titlePlaceholder}),(0,z.jsxs)(`span`,{className:`mt-1 flex min-w-0 items-center gap-1.5 text-xs text-fg-muted`,children:[e.lastEditTrigger===`ai_edit`?(0,z.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 text-accent-fg`,children:[(0,z.jsx)(ye,{className:`size-3`,"aria-hidden":!0}),n.agentEditLabel,(0,z.jsx)(`span`,{"aria-hidden":!0,children:`·`})]}):null,(0,z.jsx)(`span`,{className:`truncate`,children:i})]}),(0,z.jsx)(`time`,{dateTime:new Date(e.updatedAt).toISOString(),className:`mt-1.5 block text-xs text-fg-muted sm:hidden`,children:Oe(e.updatedAt,Ke,Ge)})]})]}),(0,z.jsx)(`span`,{className:`hidden max-w-32 truncate text-xs text-fg-muted md:block`,title:e.projects?.map(e=>e.name).join(` · `),children:e.projects?.map(e=>e.name).join(` · `)||n.unassigned}),(0,z.jsx)(`time`,{dateTime:new Date(e.updatedAt).toISOString(),className:`hidden w-24 shrink-0 text-right text-xs text-fg-muted sm:block`,children:Oe(e.updatedAt,Ke,Ge)}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>void Qe(e.id,!e.pinned),disabled:ke.has(e.id),"aria-label":`${e.pinned?n.unfavorite:n.favorite}: ${e.title||t.titlePlaceholder}`,"aria-pressed":!!e.pinned,className:`touch-target inline-flex size-9 shrink-0 items-center justify-center rounded-md text-fg-muted hover:bg-surface-hover hover:text-fg disabled:opacity-50 focus-visible:ring-2 focus-visible:ring-accent`,children:(0,z.jsx)(Ce,{className:f(`size-4`,e.pinned&&`fill-current text-fg`),"aria-hidden":!0})}),(0,z.jsxs)(se,{children:[(0,z.jsx)(we,{asChild:!0,children:(0,z.jsx)(`button`,{type:`button`,disabled:H===e.id,"aria-label":`${t.noteActions}: ${e.title||t.titlePlaceholder}`,className:`touch-target inline-flex size-9 shrink-0 items-center justify-center rounded-md text-fg-muted hover:bg-surface-hover hover:text-fg disabled:opacity-50 focus-visible:ring-2 focus-visible:ring-accent`,children:H===e.id?(0,z.jsx)(ve,{className:`size-4 animate-spin`,"aria-hidden":!0}):(0,z.jsx)(he,{className:`size-4`,"aria-hidden":!0})})}),(0,z.jsx)(Te,{children:(0,z.jsx)(Ee,{align:`end`,sideOffset:4,className:`z-50 min-w-36 rounded-lg border border-edge bg-surface-panel p-1 shadow-popover`,children:(0,z.jsxs)(ge,{className:`touch-target flex cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-sm text-danger outline-none hover:bg-danger-soft focus:bg-danger-soft`,onSelect:()=>V(e),children:[(0,z.jsx)(Se,{className:`size-4`,"aria-hidden":!0}),t.delete]})})})]})]},e.id)})}),!We&&!Ie&&Z>0?(0,z.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center justify-between gap-3 text-xs text-fg-muted`,"aria-live":`polite`,children:[(0,z.jsx)(`span`,{children:t.noteCount.replace(`{{count}}`,String(Z))}),Z>12||J>0?(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(`button`,{type:`button`,"aria-label":n.previousPage,disabled:J===0,className:W,onClick:()=>O(e=>{let t=new URLSearchParams(e);return t.set(`page`,String(J-1)),t}),children:(0,z.jsx)(ue,{className:`size-4`,"aria-hidden":!0})}),(0,z.jsxs)(`span`,{children:[J+1,` / `,Math.max(1,Math.ceil(Z/12))]}),(0,z.jsx)(`button`,{type:`button`,"aria-label":n.nextPage,disabled:(J+1)*12>=Z,className:W,onClick:()=>O(e=>{let t=new URLSearchParams(e);return t.set(`page`,String(J+1)),t}),children:(0,z.jsx)(D,{className:`size-4`,"aria-hidden":!0})})]}):null]}):null]})]})}),(0,z.jsx)(ie,{open:B!==null,title:t.deleteConfirmTitle,description:t.deleteConfirmDescription.replace(`{{title}}`,B?.title||t.titlePlaceholder),confirmLabel:t.deleteConfirmLabel,cancelLabel:t.deleteCancelLabel,destructive:!0,onConfirm:()=>void $e(),onCancel:()=>V(null)})]})}function K(){let e=(0,L.c)(12),{noteId:t}=o(),n=i(),[r]=a(),s;e[0]===r?s=e[1]:(s=l(r.get(`returnTo`),`/notes`,[`/chat`,`/projects`,`/notes`,`/tasks`]),e[0]=r,e[1]=s);let c=s,u;e[2]!==n||e[3]!==c?(u=()=>{n(c)},e[2]=n,e[3]=c,e[4]=u):u=e[4];let d=u;if(!t)return null;let f=r.get(`edit`)===`1`?`wysiwyg`:`preview`,p;e[5]===r?p=e[6]:(p=r.get(`edit`),e[5]=r,e[6]=p);let m=p===`1`,h;return e[7]!==d||e[8]!==t||e[9]!==f||e[10]!==m?(h=(0,z.jsx)(`div`,{className:`mx-auto flex h-full min-h-0 w-full max-w-6xl flex-1 flex-col`,children:(0,z.jsx)(ke,{noteId:t,onBack:d,initialMode:f,autoFocus:m},t)}),e[7]=d,e[8]=t,e[9]=f,e[10]=m,e[11]=h):h=e[11],h}function q(){let e=(0,L.c)(2),{noteId:t}=o(),n;return e[0]===t?n=e[1]:(n=t?(0,z.jsx)(K,{}):(0,z.jsx)(G,{}),e[0]=t,e[1]=n),n}export{q as NotesPage};
@@ -1 +0,0 @@
1
- import{a as e,n as t,s as n,t as r,u as i}from"./schemas-BaskVM5g.js";var a=r([`task`,`project`,`note`,`workflow_definition`,`workflow_run`,`automation`,`scene`,`local_app`,`file`,`session`,`settings`]),o=r([`open`,`preview`,`edit`,`continue_in_chat`,`run`,`pause`,`resume`,`share`,`reveal`,`configure`]),s=n({kind:a,id:i().min(1),title:i().min(1),summary:i().optional(),status:i().optional(),revision:i().optional(),projectId:i().optional(),capabilities:t(o).default([])}),c=r([`created`,`updated`,`opened`,`started`,`completed`,`failed`]),l=n({version:e(1),operation:c,primary:s.optional(),related:t(s).optional()});function u(e){let t=l.safeParse(e);return t.success?t.data:null}var d=`xopc-product-delivery:`;function f(e){let t=e.split(/\s+/).find(e=>e.startsWith(d));if(!t)return null;try{return u(JSON.parse(decodeURIComponent(t.slice(22))))}catch{return null}}function p(e){let t=encodeURIComponent(e.id);switch(e.kind){case`task`:return`/tasks/${t}`;case`project`:return`/projects/${t}`;case`note`:return`/notes/${t}`;case`workflow_definition`:return`/workflows/${t}`;case`workflow_run`:return`/workflows/runs/${t}`;case`automation`:return`/automations?automation=${t}`;case`scene`:return`/scenes/${t}`;case`local_app`:return`/local-apps/${t}`;case`session`:return`/chat/${t}`;case`settings`:return`/settings/${e.id.replace(/^\/+/,``).split(`/`).map(encodeURIComponent).join(`/`)}`;case`file`:return null}}function m(e){return e.kind===`local_app`?`/open?${new URLSearchParams({kind:e.kind,id:e.id}).toString()}`:p(e)}function h(e){try{let t=new URL(e);if(t.protocol!==`xopc:`||t.hostname!==`open`)return null;let n=a.safeParse(t.searchParams.get(`kind`)),r=t.searchParams.get(`id`)?.trim()||(n.success&&n.data===`session`?t.searchParams.get(`key`)?.trim():void 0);return n.success&&r?{kind:n.data,id:r}:null}catch{return null}}export{p as a,m as i,f as n,h as r,u as t};