@xopcai/xopc 0.0.173 → 0.0.174

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 (190) hide show
  1. package/dist/browser-ext/manifest.json +1 -1
  2. package/dist/extensions/telegram/xopc.extension.json +1 -1
  3. package/dist/gateway/static/root/assets/{activity-store-ByVA0N5n.js → activity-store-CyEDJeIt.js} +1 -1
  4. package/dist/gateway/static/root/assets/{agent-avatar-dicebear-CJ5HvqE7.js → agent-avatar-dicebear-DF7Bol6I.js} +1 -1
  5. package/dist/gateway/static/root/assets/agents-BVxEFPQ5.js +2 -0
  6. package/dist/gateway/static/root/assets/{api-BZtCKzg4.js → api-DYunqroX.js} +1 -1
  7. package/dist/gateway/static/root/assets/api-DwyUxpgY.js +1 -0
  8. package/dist/gateway/static/root/assets/{app-management-settings-panel-B0oNNcFn.js → app-management-settings-panel-B4xJyvDu.js} +1 -1
  9. package/dist/gateway/static/root/assets/{appearance-settings-DbIj4NQ1.js → appearance-settings-B2PQxRiu.js} +1 -1
  10. package/dist/gateway/static/root/assets/apps-page-BtIgd82S.js +1 -0
  11. package/dist/gateway/static/root/assets/{archive-plugin-BICLQFWJ.js → archive-plugin-DWhBmmjD.js} +1 -1
  12. package/dist/gateway/static/root/assets/{attachment-load-DV3PteSU.js → attachment-load-BOpZfa_I.js} +1 -1
  13. package/dist/gateway/static/root/assets/{automation-suggestion-card-CZUImis0.js → automation-suggestion-card-Byu3I7Rs.js} +1 -1
  14. package/dist/gateway/static/root/assets/automations-page-CG_SCH5b.js +6 -0
  15. package/dist/gateway/static/root/assets/{binary-plugins-D6zkab6N.js → binary-plugins-6AG1qatz.js} +1 -1
  16. package/dist/gateway/static/root/assets/{block-editor-zCzoQI-g.js → block-editor-CJhrn98_.js} +5 -5
  17. package/dist/gateway/static/root/assets/browser-settings-page-CfLqPWZC.js +8 -0
  18. package/dist/gateway/static/root/assets/{browser-workflow-inputs-CY3X83xQ.js → browser-workflow-inputs-CBVb4mt9.js} +1 -1
  19. package/dist/gateway/static/root/assets/{browser-workflows-page-DDRtZLuM.js → browser-workflows-page-Cq4XUKbu.js} +2 -2
  20. package/dist/gateway/static/root/assets/capabilities-settings-panel-DCJmm6cR.js +7 -0
  21. package/dist/gateway/static/root/assets/{capability-presets-api-pYLW6P7g.js → capability-presets-api-hbW4NAKO.js} +1 -1
  22. package/dist/gateway/static/root/assets/capability-presets-settings-panel-CnkAYvWI.js +1 -0
  23. package/dist/gateway/static/root/assets/{channel-recipient-api-DxyOH3BO.js → channel-recipient-api-CzMjHb17.js} +1 -1
  24. package/dist/gateway/static/root/assets/channels-settings-DtqqFpDn.js +1 -0
  25. package/dist/gateway/static/root/assets/channels-status-swr-C-5yHbc0.js +1 -0
  26. package/dist/gateway/static/root/assets/{connector-logo-BgANwjt-.js → connector-logo-B9Au6gMZ.js} +1 -1
  27. package/dist/gateway/static/root/assets/connectors-page-CaHfs8YF.js +2 -0
  28. package/dist/gateway/static/root/assets/copy-VueTIC2x.js +1 -0
  29. package/dist/gateway/static/root/assets/desktop-pet-CvFMKYdb.js +1 -0
  30. package/dist/gateway/static/root/assets/{desktop-pet-settings-8CaU1Mhm.js → desktop-pet-settings-CNff5TFb.js} +1 -1
  31. package/dist/gateway/static/root/assets/{directory-picker-path-field-BtNRUvzM.js → directory-picker-path-field-Bf956uo-.js} +1 -1
  32. package/dist/gateway/static/root/assets/dreaming-settings-CHM8FE1g.js +3 -0
  33. package/dist/gateway/static/root/assets/{extension-debug-page-DFjTfx6f.js → extension-debug-page-ZqM_0eUs.js} +1 -1
  34. package/dist/gateway/static/root/assets/{extension-page-NyEYtWWg.js → extension-page-D4hvXOMM.js} +1 -1
  35. package/dist/gateway/static/root/assets/{extension-settings-page-BynTCfgf.js → extension-settings-page-GsqxaJjA.js} +1 -1
  36. package/dist/gateway/static/root/assets/focus-detail-page-CE6uwrl1.js +1 -0
  37. package/dist/gateway/static/root/assets/{gateway-config-api-BzOWImvU.js → gateway-config-api-B4THmgnS.js} +1 -1
  38. package/dist/gateway/static/root/assets/{gateway-settings-DXepE_Jw.js → gateway-settings-CPv-MxGE.js} +1 -1
  39. package/dist/gateway/static/root/assets/{gateway-startup-retry-C2JXXtwg.js → gateway-startup-retry-MP3K71pP.js} +1 -1
  40. package/dist/gateway/static/root/assets/goal-create-dialog-DAeb82xP.js +1 -0
  41. package/dist/gateway/static/root/assets/goal-detail-page-CwLSp01r.js +4 -0
  42. package/dist/gateway/static/root/assets/{goals-config-api-CU3JR9MI.js → goals-config-api-DCcDuIjG.js} +1 -1
  43. package/dist/gateway/static/root/assets/goals-page-DvJQ6_4M.js +2 -0
  44. package/dist/gateway/static/root/assets/{goals-settings-DSZguLEx.js → goals-settings-o9QMXvNq.js} +1 -1
  45. package/dist/gateway/static/root/assets/{heartbeat-settings-KRkYziEF.js → heartbeat-settings-DixwpXnH.js} +1 -1
  46. package/dist/gateway/static/root/assets/{image-generation-api-Y-n6TaZ_.js → image-generation-api-BOGH9FGi.js} +1 -1
  47. package/dist/gateway/static/root/assets/index-CfXiRNN5.css +1 -0
  48. package/dist/gateway/static/root/assets/index-eyttVNS_.js +212 -0
  49. package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-CwrQv952.js → keyboard-shortcuts-settings-D4o4ZPF6.js} +1 -1
  50. package/dist/gateway/static/root/assets/local-app-workbench-page-CPcfqn_A.js +2 -0
  51. package/dist/gateway/static/root/assets/{local-apps-page-DtITcS4K.js → local-apps-page-GzMmpO7G.js} +1 -1
  52. package/dist/gateway/static/root/assets/{locale-store-Ccv7tH8B.js → locale-store-CAuhEGCn.js} +1 -1
  53. package/dist/gateway/static/root/assets/logs-page-DXABWCZp.js +7 -0
  54. package/dist/gateway/static/root/assets/{markdown-split-D1oZlq1m.js → markdown-split-CIX8D1pv.js} +1 -1
  55. package/dist/gateway/static/root/assets/{media-plugins-BKz5V32t.js → media-plugins-Bp3eIA45.js} +1 -1
  56. package/dist/gateway/static/root/assets/messages-BiBdO1-O.js +3 -0
  57. package/dist/gateway/static/root/assets/{notes-page-DLekBQPa.js → notes-page-RVFiYAoO.js} +1 -1
  58. package/dist/gateway/static/root/assets/notes-workbench-DgJzZRX3.js +4 -0
  59. package/dist/gateway/static/root/assets/{page-tabs-pT4nLfqS.js → page-tabs-BGAYH3Ef.js} +1 -1
  60. package/dist/gateway/static/root/assets/{preview-open-alternatives-OtAiaJm2.js → preview-open-alternatives-BM6pDkHp.js} +1 -1
  61. package/dist/gateway/static/root/assets/{product-open-page-CfryBKD9.js → product-open-page-BiMetEmn.js} +1 -1
  62. package/dist/gateway/static/root/assets/project-detail-page-DF7F70Vg.js +1 -0
  63. package/dist/gateway/static/root/assets/projects-page-Cw3jyi5s.js +1 -0
  64. package/dist/gateway/static/root/assets/remote-access-hub-ChAJsaNY.js +1 -0
  65. package/dist/gateway/static/root/assets/{save-bar-controls-nP1SB3Lf.js → save-bar-controls-BdjV8MK5.js} +1 -1
  66. package/dist/gateway/static/root/assets/{schedule-field-OEQTsUNz.js → schedule-field-ChlqXU46.js} +1 -1
  67. package/dist/gateway/static/root/assets/{schema-form-DIcAa7CJ.js → schema-form-DDKf5ZSH.js} +1 -1
  68. package/dist/gateway/static/root/assets/sessions-page-BxZIxt7z.js +1 -0
  69. package/dist/gateway/static/root/assets/settings-advanced-gate-DcDLS0xV.js +1 -0
  70. package/dist/gateway/static/root/assets/{settings-form-section-BxNcTbYO.js → settings-form-section-CPG0KGVs.js} +1 -1
  71. package/dist/gateway/static/root/assets/{settings-loading-skeleton-Dpdxu4sf.js → settings-loading-skeleton-DRSDHucM.js} +1 -1
  72. package/dist/gateway/static/root/assets/{settings-page-DwPeOm1c.js → settings-page-CeB7_xD0.js} +1 -1
  73. package/dist/gateway/static/root/assets/{settings-page-layout-CqirFmMn.js → settings-page-layout-BENrkwd0.js} +1 -1
  74. package/dist/gateway/static/root/assets/setup-status-panel-4Xa9NA7v.js +1 -0
  75. package/dist/gateway/static/root/assets/{share-preview-page-D72gYeux.js → share-preview-page-DIzczJkG.js} +1 -1
  76. package/dist/gateway/static/root/assets/shares-settings-BpN0o5Cf.js +1 -0
  77. package/dist/gateway/static/root/assets/skill-reload-api-DvF2UAaL.js +1 -0
  78. package/dist/gateway/static/root/assets/skills-page-CGKXpNfy.js +2 -0
  79. package/dist/gateway/static/root/assets/{system-settings-panel-U0tBgW46.js → system-settings-panel-Dp4d5Q1B.js} +1 -1
  80. package/dist/gateway/static/root/assets/{theme-store-DCKDVPFF.js → theme-store-CbGc1laW.js} +1 -1
  81. package/dist/gateway/static/root/assets/{time-picker-BpiBF5-d.js → time-picker-BhgCeDuO.js} +1 -1
  82. package/dist/gateway/static/root/assets/{typed-models-lib-D0XCOCAM.js → typed-models-lib-DwPk3OPL.js} +1 -1
  83. package/dist/gateway/static/root/assets/{use-channel-catalog-mq_Inao2.js → use-channel-catalog-CXrEu2dw.js} +1 -1
  84. package/dist/gateway/static/root/assets/user-context-page-Dy_fKAK_.js +1 -0
  85. package/dist/gateway/static/root/assets/{voice-api-key-field-CKaDitO6.js → voice-api-key-field-DFoA79LB.js} +1 -1
  86. package/dist/gateway/static/root/assets/work-discovery-page-BWkjb1NK.js +1 -0
  87. package/dist/gateway/static/root/assets/work-item-detail-page-DLBNFse5.js +1 -0
  88. package/dist/gateway/static/root/assets/work-page-Bn5RXMIE.js +1 -0
  89. package/dist/gateway/static/root/assets/{workflow-run-setup-panel-s_kS_FYA.js → workflow-run-setup-panel-BuniGPO0.js} +2 -2
  90. package/dist/gateway/static/root/assets/workflows-page-_vFhRrAl.js +11 -0
  91. package/dist/gateway/static/root/index.html +7 -7
  92. package/dist/package.js +1 -1
  93. package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
  94. package/dist/src/focuses/candidate-repository.d.ts +15 -0
  95. package/dist/src/focuses/candidate-repository.js +91 -0
  96. package/dist/src/focuses/index.d.ts +7 -0
  97. package/dist/src/focuses/index.js +7 -0
  98. package/dist/src/focuses/insight-repository.d.ts +22 -0
  99. package/dist/src/focuses/insight-repository.js +77 -0
  100. package/dist/src/focuses/prompts.d.ts +2 -0
  101. package/dist/src/focuses/prompts.js +18 -0
  102. package/dist/src/focuses/reconciler.d.ts +5 -0
  103. package/dist/src/focuses/reconciler.js +26 -0
  104. package/dist/src/focuses/repository.d.ts +61 -0
  105. package/dist/src/focuses/repository.js +214 -0
  106. package/dist/src/focuses/run-processor.d.ts +18 -0
  107. package/dist/src/focuses/run-processor.js +162 -0
  108. package/dist/src/focuses/service.d.ts +42 -0
  109. package/dist/src/focuses/service.js +241 -0
  110. package/dist/src/focuses/types.d.ts +89 -0
  111. package/dist/src/gateway/heartbeat/service.js +1 -1
  112. package/dist/src/gateway/hono/routes/focuses.d.ts +3 -0
  113. package/dist/src/gateway/hono/routes/focuses.js +319 -0
  114. package/dist/src/gateway/hono/routes/home.js +15 -17
  115. package/dist/src/gateway/hono/routes/index.js +2 -0
  116. package/dist/src/gateway/hono/routes/local-apps.js +1 -1
  117. package/dist/src/gateway/hono/routes/projects.js +2 -103
  118. package/dist/src/gateway/hono/routes/work-discovery.js +0 -239
  119. package/dist/src/gateway/service.d.ts +1 -1
  120. package/dist/src/gateway/service.js +17 -13
  121. package/dist/src/heartbeat/index.js +1 -1
  122. package/dist/src/mcp/channel-bridge.js +1 -1
  123. package/dist/src/storage/sqlite/migrations/066_first_class_focuses.sql +126 -0
  124. package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
  125. package/dist/src/storage/sqlite/migrations/runner.js +3 -3
  126. package/dist/src/storage/sqlite/migrations/runner.ts +1 -1
  127. package/dist/src/storage/sqlite/schema.js +1 -1
  128. package/dist/src/work-discovery/index.d.ts +0 -2
  129. package/dist/src/work-discovery/index.js +1 -3
  130. package/dist/src/work-discovery/service.d.ts +0 -30
  131. package/dist/src/work-discovery/service.js +1 -35
  132. package/dist/src/work-discovery/thread-service.d.ts +5 -0
  133. package/dist/src/work-discovery/thread-service.js +36 -88
  134. package/package.json +1 -1
  135. package/dist/gateway/static/root/assets/agents--TQ9jM_1.js +0 -2
  136. package/dist/gateway/static/root/assets/apps-page-BDsoZDEn.js +0 -1
  137. package/dist/gateway/static/root/assets/automations-page-CHrNcppN.js +0 -6
  138. package/dist/gateway/static/root/assets/browser-settings-page-BQoRuQzH.js +0 -8
  139. package/dist/gateway/static/root/assets/capabilities-settings-panel-BOcU0qeM.js +0 -7
  140. package/dist/gateway/static/root/assets/capability-presets-settings-panel-CJ1F_hlX.js +0 -1
  141. package/dist/gateway/static/root/assets/channels-settings-C4vDwRil.js +0 -1
  142. package/dist/gateway/static/root/assets/channels-status-swr-B0Pgq5x2.js +0 -1
  143. package/dist/gateway/static/root/assets/connectors-page-D6JEqDEj.js +0 -2
  144. package/dist/gateway/static/root/assets/desktop-pet-BPjQbPeA.js +0 -1
  145. package/dist/gateway/static/root/assets/dreaming-settings-Byv-h8XZ.js +0 -3
  146. package/dist/gateway/static/root/assets/goal-create-dialog-ClOZyG52.js +0 -1
  147. package/dist/gateway/static/root/assets/goal-detail-page-UbZB77De.js +0 -4
  148. package/dist/gateway/static/root/assets/goals-page-GMqV8Fwv.js +0 -2
  149. package/dist/gateway/static/root/assets/index-BCkNJ5cR.css +0 -1
  150. package/dist/gateway/static/root/assets/index-CAZ9343h.js +0 -212
  151. package/dist/gateway/static/root/assets/local-app-workbench-page-m5HEyrHT.js +0 -2
  152. package/dist/gateway/static/root/assets/logs-page-Bf_nk75f.js +0 -7
  153. package/dist/gateway/static/root/assets/messages-DWrg3c4K.js +0 -3
  154. package/dist/gateway/static/root/assets/notes-workbench-BTDmprHM.js +0 -4
  155. package/dist/gateway/static/root/assets/project-detail-page-C7kntu4H.js +0 -1
  156. package/dist/gateway/static/root/assets/projects-page-3ubcbqHr.js +0 -1
  157. package/dist/gateway/static/root/assets/remote-access-hub-DoUkN3ik.js +0 -1
  158. package/dist/gateway/static/root/assets/sessions-page-ElAAlZ-R.js +0 -1
  159. package/dist/gateway/static/root/assets/settings-advanced-gate-CQn_KBqr.js +0 -1
  160. package/dist/gateway/static/root/assets/setup-status-panel-DX_LdcTN.js +0 -1
  161. package/dist/gateway/static/root/assets/shares-settings-nSfe-5xK.js +0 -1
  162. package/dist/gateway/static/root/assets/skill-reload-api-1tYpZrJf.js +0 -1
  163. package/dist/gateway/static/root/assets/skills-page-BUJl8LJG.js +0 -2
  164. package/dist/gateway/static/root/assets/user-context-page-BOC6Hn19.js +0 -1
  165. package/dist/gateway/static/root/assets/work-discovery-page-DWGYp5yV.js +0 -1
  166. package/dist/gateway/static/root/assets/work-item-detail-page-CpeWcpSp.js +0 -1
  167. package/dist/gateway/static/root/assets/work-page-MsEKzmSt.js +0 -1
  168. package/dist/gateway/static/root/assets/workflows-page-ByhHaUHB.js +0 -11
  169. package/dist/src/proactive/calendar-signals.d.ts +0 -4
  170. package/dist/src/proactive/calendar-signals.js +0 -120
  171. package/dist/src/proactive/focus-service.d.ts +0 -62
  172. package/dist/src/proactive/focus-service.js +0 -173
  173. package/dist/src/proactive/index.d.ts +0 -7
  174. package/dist/src/proactive/index.js +0 -7
  175. package/dist/src/proactive/insight-repository.d.ts +0 -21
  176. package/dist/src/proactive/insight-repository.js +0 -109
  177. package/dist/src/proactive/run-processor.d.ts +0 -19
  178. package/dist/src/proactive/run-processor.js +0 -146
  179. package/dist/src/proactive/trial-expiry-reconciler.d.ts +0 -5
  180. package/dist/src/proactive/trial-expiry-reconciler.js +0 -30
  181. package/dist/src/proactive/types.d.ts +0 -66
  182. package/dist/src/proactive/value-score.d.ts +0 -13
  183. package/dist/src/proactive/value-score.js +0 -30
  184. package/dist/src/proactive/watch-repository.d.ts +0 -28
  185. package/dist/src/proactive/watch-repository.js +0 -129
  186. package/dist/src/work-discovery/governance.d.ts +0 -25
  187. package/dist/src/work-discovery/governance.js +0 -96
  188. package/dist/src/work-discovery/thread-repository.d.ts +0 -34
  189. package/dist/src/work-discovery/thread-repository.js +0 -112
  190. /package/dist/src/{proactive → focuses}/types.js +0 -0
@@ -1 +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{l as i,t as a}from"./chunk-KS7C4IRE-BMhrPKJC.js";import{t as o}from"./check-DUBLcKHA.js";import{t as s}from"./circle-alert-BEjgurr2.js";import{t as c}from"./cn-JdwAhgNB.js";import{t as l}from"./messages-DWrg3c4K.js";import{n as u,o as d,r as f,s as p}from"./locale-store-Ccv7tH8B.js";import{n as m}from"./activity-store-ByVA0N5n.js";import{Eo as h,Go as g,Ha as _,Hu as v,Io as y,Iu as b,Jo as x,Ko as S,Ls as C,Mo as w,Oo as T,Pa as E,Pc as D,Ps as O,Sl as k,Su as A,Wo as j,Xo as M,Xs as N,Yo as ee,Ys as te,_u as P,al as F,bc as ne,io as I,nl as re,ql as ie,qo as ae,su as oe,tt as se,uc as ce,vt as L,yu as le,zl as ue}from"./index-CAZ9343h.js";var R=e(t(),1),z=n();function B(e){try{return decodeURIComponent(e).trim()||null}catch{return null}}function V(e){if(!e)return null;let t=e.split(/[?#]/,1)[0],n=/^\/goals\/([^/]+)\/?$/.exec(t);if(n){let e=B(n[1]);return e?{kind:`goal`,id:e}:null}let r=/^\/chat\/([^/]+)\/?$/.exec(t);if(r){let e=B(r[1]);return!e||e===`new`?null:{kind:`session`,id:e}}return null}async function H(e,t){let n=e.kind===`goal`?`/api/goals/${encodeURIComponent(e.id)}`:`/api/sessions/${encodeURIComponent(e.id)}?limit=1`;try{return(await d(f(n),{signal:t})).status===404?`missing`:`available`}catch(e){if(t?.aborted)throw e;return`available`}}var U=r(),W=3,de={info:{Icon:k,className:`text-accent-fg bg-accent-soft`},success:{Icon:P,className:`text-success bg-success-soft`},warning:{Icon:te,className:`text-warning bg-warning-soft`},error:{Icon:s,className:`text-danger bg-danger-soft`}};function G(e,t){let n=Math.max(0,Math.round((Date.now()-e)/1e3));if(n<60)return t===`zh`?`刚刚`:`Just now`;let r=Math.round(n/60);if(r<60)return t===`zh`?`${r} 分钟前`:`${r}m ago`;let i=Math.round(r/60);if(i<24)return t===`zh`?`${i} 小时前`:`${i}h ago`;let a=Math.round(i/24);return t===`zh`?`${a} 天前`:`${a}d ago`}function K(e){let t=(0,z.c)(55),{item:n,targetAvailability:r}=e,i=u(J),o;t[0]===i?o=t[1]:(o=l(i),t[0]=i,t[1]=o);let s=o.projectsPage.workHome,d=m(q),{Icon:f,className:p}=de[n.tone],h;t[2]===p?h=t[3]:(h=c(`mt-0.5 flex size-7 shrink-0 items-center justify-center rounded-lg`,p),t[2]=p,t[3]=h);let g;t[4]!==f||t[5]!==n.status?(g=n.status===`running`?(0,U.jsx)(F,{className:`size-3.5 animate-spin motion-reduce:animate-none`,"aria-hidden":!0}):(0,U.jsx)(f,{className:`size-3.5`,"aria-hidden":!0}),t[4]=f,t[5]=n.status,t[6]=g):g=t[6];let _;t[7]!==h||t[8]!==g?(_=(0,U.jsx)(`div`,{className:h,children:g}),t[7]=h,t[8]=g,t[9]=_):_=t[9];let v;t[10]===n.title?v=t[11]:(v=(0,U.jsx)(`h3`,{className:`min-w-0 flex-1 text-sm font-medium leading-5 text-fg`,children:n.title}),t[10]=n.title,t[11]=v);let y;t[12]!==s.activityUnread||t[13]!==n.read?(y=n.read?null:(0,U.jsx)(`span`,{className:`mt-1.5 size-1.5 shrink-0 rounded-full bg-accent`,"aria-label":s.activityUnread}),t[12]=s.activityUnread,t[13]=n.read,t[14]=y):y=t[14];let b;t[15]!==v||t[16]!==y?(b=(0,U.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,children:[v,y]}),t[15]=v,t[16]=y,t[17]=b):b=t[17];let x;t[18]===n.message?x=t[19]:(x=n.message?(0,U.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-xs leading-5 text-fg-muted`,children:n.message}):null,t[18]=n.message,t[19]=x);let S;t[20]===n.source?S=t[21]:(S=n.source?(0,U.jsx)(`span`,{className:`max-w-48 truncate`,children:n.source}):null,t[20]=n.source,t[21]=S);let w;t[22]!==n.updatedAt||t[23]!==i?(w=G(n.updatedAt,i),t[22]=n.updatedAt,t[23]=i,t[24]=w):w=t[24];let T;t[25]===w?T=t[26]:(T=(0,U.jsx)(`span`,{children:w}),t[25]=w,t[26]=T);let E;t[27]===n.occurrences?E=t[28]:(E=n.occurrences>1?(0,U.jsxs)(`span`,{children:[`×`,n.occurrences]}):null,t[27]=n.occurrences,t[28]=E);let D;t[29]!==s.activityCheckingRelated||t[30]!==s.activityRelatedMissing||t[31]!==s.activityViewRelated||t[32]!==n.href||t[33]!==r?(D=n.href&&r===`available`?(0,U.jsxs)(a,{to:n.href,className:`inline-flex items-center gap-0.5 font-medium text-accent-fg hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[s.activityViewRelated,(0,U.jsx)(le,{className:`size-3`,"aria-hidden":!0})]}):n.href&&r===`checking`?(0,U.jsx)(I,{className:`h-3 w-20 rounded`,"aria-label":s.activityCheckingRelated}):n.href&&r===`missing`?(0,U.jsx)(`span`,{className:`font-medium text-fg-subtle`,role:`status`,children:s.activityRelatedMissing}):null,t[29]=s.activityCheckingRelated,t[30]=s.activityRelatedMissing,t[31]=s.activityViewRelated,t[32]=n.href,t[33]=r,t[34]=D):D=t[34];let O;t[35]!==T||t[36]!==E||t[37]!==D||t[38]!==S?(O=(0,U.jsxs)(`div`,{className:`mt-1.5 flex min-w-0 flex-wrap items-center gap-x-2 text-[11px] text-fg-subtle`,children:[S,T,E,D]}),t[35]=T,t[36]=E,t[37]=D,t[38]=S,t[39]=O):O=t[39];let k;t[40]!==O||t[41]!==b||t[42]!==x?(k=(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[b,x,O]}),t[40]=O,t[41]=b,t[42]=x,t[43]=k):k=t[43];let A;t[44]!==n.id||t[45]!==d?(A=()=>d(n.id),t[44]=n.id,t[45]=d,t[46]=A):A=t[46];let j;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,U.jsx)(C,{className:`size-3.5`,"aria-hidden":!0}),t[47]=j):j=t[47];let M;t[48]!==s.activityRemove||t[49]!==A?(M=(0,U.jsx)(`button`,{type:`button`,className:`rounded-md p-1 text-fg-subtle opacity-0 transition-opacity hover:bg-surface-hover hover:text-fg group-hover:opacity-100 focus:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":s.activityRemove,onClick:A,children:j}),t[48]=s.activityRemove,t[49]=A,t[50]=M):M=t[50];let N;return t[51]!==k||t[52]!==M||t[53]!==_?(N=(0,U.jsxs)(`article`,{className:`group flex items-start gap-3 border-t border-edge-subtle px-1 py-3 first:border-t-0`,children:[_,k,M]}),t[51]=k,t[52]=M,t[53]=_,t[54]=N):N=t[54],N}function q(e){return e.remove}function J(e){return e.language}function fe(){let e=(0,z.c)(12),t=l(u(ve)).projectsPage.workHome,n=m(_e),r=m(ge),i=m(he),[a,s]=(0,R.useState)(!1),c;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(c={},e[0]=c):c=e[0];let[d,f]=(0,R.useState)(c),p;e[1]===n?p=e[2]:(p=n.filter(me),e[1]=n,e[2]=p);let h=p.length,g;e[3]===n?g=e[4]:(g=n.filter(pe),e[3]=n,e[4]=g);let _=g.length,y;e[5]!==a||e[6]!==n?(y=a?n:n.slice(0,W),e[5]=a,e[6]=n,e[7]=y):y=e[7];let b=y,x,S;e[8]===n?(x=e[9],S=e[10]):(x=()=>{let e=new AbortController,t=new Map(n.flatMap($));return f(Object.fromEntries([...t.keys()].map(Q))),Promise.all([...t].map(async t=>{let[n,r]=t,i=await H(r,e.signal);e.signal.aborted||f(e=>({...e,[n]:i}))})).catch(Z),()=>e.abort()},S=[n],e[8]=n,e[9]=x,e[10]=S),(0,R.useEffect)(x,S);let C;return e[11]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,U.jsx)(v,{className:`size-4 text-fg-subtle`,"aria-hidden":!0}),e[11]=C):C=e[11],(0,U.jsxs)(`section`,{className:`rounded-2xl bg-surface-base p-4 shadow-surface`,"aria-labelledby":`workbench-activity-title`,children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,U.jsx)(`div`,{children:(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[C,(0,U.jsx)(`h2`,{id:`workbench-activity-title`,className:`text-sm font-semibold text-fg`,children:t.activityTitle}),h>0?(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-full bg-accent-soft px-2 py-0.5 text-[11px] font-medium text-accent-fg`,children:[(0,U.jsx)(F,{className:`size-3 animate-spin motion-reduce:animate-none`,"aria-hidden":!0}),h,` `,t.running]}):_>0?(0,U.jsxs)(`span`,{className:`rounded-full bg-surface-panel px-2 py-0.5 text-[11px] font-medium text-fg-muted`,children:[_,` `,t.activityNew]}):null]})}),a&&n.length>0?(0,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[_>0?(0,U.jsxs)(O,{type:`button`,variant:`ghost`,className:`h-8 px-2 text-xs`,onClick:r,children:[(0,U.jsx)(o,{className:`size-3.5`,"aria-hidden":!0}),t.activityMarkRead]}):null,n.some(X)?(0,U.jsxs)(O,{type:`button`,variant:`ghost`,className:`h-8 px-2 text-xs text-fg-muted`,onClick:i,children:[(0,U.jsx)(N,{className:`size-3.5`,"aria-hidden":!0}),t.activityClearFinished]}):null]}):null]}),n.length>0?(0,U.jsxs)(`div`,{className:`mt-3 px-1`,children:[b.map(e=>(0,U.jsx)(K,{item:e,targetAvailability:e.href&&V(e.href)?d[e.href]??`checking`:`available`},e.id)),n.length>W?(0,U.jsx)(`div`,{className:`border-t border-edge-subtle py-2 text-center`,children:(0,U.jsx)(O,{type:`button`,variant:`ghost`,className:`h-8 px-2 text-xs`,onClick:()=>s(Y),children:a?t.activityShowLess:t.activityShowAll.replace(`{{count}}`,String(n.length))})}):null]}):(0,U.jsxs)(`div`,{className:`mt-3 flex items-center gap-2 text-sm text-fg-muted`,children:[(0,U.jsx)(oe,{className:`size-4 text-fg-subtle`,"aria-hidden":!0}),(0,U.jsx)(`p`,{children:t.activityEmpty})]})]})}function Y(e){return!e}function X(e){return e.status===`done`}function Z(){}function Q(e){return[e,`checking`]}function $(e){let t=V(e.href);return e.href&&t?[[e.href,t]]:[]}function pe(e){return!e.read}function me(e){return e.status===`running`}function he(e){return e.clearFinished}function ge(e){return e.markAllRead}function _e(e){return e.items}function ve(e){return e.language}function ye(e){return p(f(`/api/home${e?`?locale=${encodeURIComponent(e)}`:``}`))}function be(e,t){return p(f(`/api/proactive/insights/${encodeURIComponent(e)}`),{method:`PATCH`,body:JSON.stringify({status:t})})}function xe(e){return p(f(`/api/proactive/insights/${encodeURIComponent(e)}/approve`),{method:`POST`})}function Se(e,t){return p(f(`/api/focuses/${encodeURIComponent(e)}/calendar/${encodeURIComponent(t)}/prepare`),{method:`POST`})}function Ce(e,t){return p(f(`/api/home/decisions/respond`),{method:`POST`,body:JSON.stringify({...e,decision:t})})}function we(e,t){return e.replace(/\{\{(\w+)\}\}/g,(e,n)=>String(t[n]??``))}function Te(e,t){if(e==null)return t;let n=new Date(e);return Number.isNaN(n.getTime())?t:L(n)}function Ee(e){let t=(0,z.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,U.jsx)(`span`,{className:`rounded-full bg-surface-muted px-2 py-0.5 text-[11px] font-medium text-fg-muted`,children:n}),t[0]=n,t[1]=r),r}function De(){let e=(0,z.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,U.jsxs)(`div`,{className:`space-y-5`,"aria-busy":!0,children:[(0,U.jsx)(I,{className:`h-20 rounded-2xl`}),(0,U.jsx)(I,{className:`h-72 rounded-2xl`}),(0,U.jsx)(I,{className:`h-44 rounded-2xl`})]}),e[0]=t):t=e[0],t}function Oe(e){let t=(0,z.c)(19),{item:n,statusLabel:r}=e,i=`/work-items/${encodeURIComponent(n.id)}`,o;t[0]===n.title?o=t[1]:(o=(0,U.jsx)(`h3`,{className:`truncate text-sm font-semibold text-fg`,children:n.title}),t[0]=n.title,t[1]=o);let s;t[2]===n.projectName?s=t[3]:(s=(0,U.jsx)(`p`,{className:`mt-1 truncate text-xs text-fg-subtle`,children:n.projectName}),t[2]=n.projectName,t[3]=s);let c;t[4]!==o||t[5]!==s?(c=(0,U.jsxs)(`div`,{className:`min-w-0`,children:[o,s]}),t[4]=o,t[5]=s,t[6]=c):c=t[6];let l;t[7]===r?l=t[8]:(l=(0,U.jsx)(`span`,{className:`shrink-0 text-xs text-fg-subtle`,children:r}),t[7]=r,t[8]=l);let u;t[9]!==c||t[10]!==l?(u=(0,U.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[c,l]}),t[9]=c,t[10]=l,t[11]=u):u=t[11];let d;t[12]!==n.blockedReason||t[13]!==n.nextAction?(d=n.blockedReason||n.nextAction?(0,U.jsx)(`p`,{className:`mt-2 line-clamp-2 text-xs leading-5 text-fg-muted`,children:n.blockedReason||n.nextAction}):null,t[12]=n.blockedReason,t[13]=n.nextAction,t[14]=d):d=t[14];let f;return t[15]!==i||t[16]!==u||t[17]!==d?(f=(0,U.jsxs)(a,{to:i,className:`group block rounded-lg px-1 py-2.5 transition-colors hover:bg-surface-hover/55 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[u,d]}),t[15]=i,t[16]=u,t[17]=d,t[18]=f):f=t[18],f}function ke(e){let t=(0,z.c)(27),{item:n,kindLabel:r,reasonLabel:i,approveLabel:o,denyLabel:s,busy:c,onRespond:l}=e,u;t[0]===n.title?u=t[1]:(u=(0,U.jsx)(`h3`,{className:`truncate text-sm font-semibold text-fg`,children:n.title}),t[0]=n.title,t[1]=u);let d=n.projectName||r,f;t[2]===d?f=t[3]:(f=(0,U.jsx)(`p`,{className:`mt-1 truncate text-xs text-fg-subtle`,children:d}),t[2]=d,t[3]=f);let p;t[4]!==u||t[5]!==f?(p=(0,U.jsxs)(`div`,{className:`min-w-0`,children:[u,f]}),t[4]=u,t[5]=f,t[6]=p):p=t[6];let m;t[7]===i?m=t[8]:(m=(0,U.jsx)(`span`,{className:`shrink-0 rounded-full bg-surface-panel/80 px-2 py-0.5 text-[11px] font-medium text-fg-muted`,children:i}),t[7]=i,t[8]=m);let h;t[9]!==p||t[10]!==m?(h=(0,U.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[p,m]}),t[9]=p,t[10]=m,t[11]=h):h=t[11];let g;t[12]===n.detail?g=t[13]:(g=n.detail?(0,U.jsx)(`p`,{className:`mt-2 line-clamp-2 text-xs leading-5 text-fg-muted`,children:n.detail}):null,t[12]=n.detail,t[13]=g);let _;t[14]!==n.href||t[15]!==h||t[16]!==g?(_=(0,U.jsxs)(a,{to:n.href,className:`group block focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[h,g]}),t[14]=n.href,t[15]=h,t[16]=g,t[17]=_):_=t[17];let v;t[18]!==o||t[19]!==c||t[20]!==s||t[21]!==n.response||t[22]!==l?(v=n.response?(0,U.jsxs)(`div`,{className:`mt-3 flex justify-end gap-2 border-t border-warning/20 pt-3`,children:[(0,U.jsx)(O,{type:`button`,variant:`ghost`,className:`h-8 px-2`,disabled:c,onClick:()=>l(`deny`),children:s}),(0,U.jsx)(O,{type:`button`,variant:`primary`,className:`h-8 px-2`,disabled:c,onClick:()=>l(`approve`),children:o})]}):null,t[18]=o,t[19]=c,t[20]=s,t[21]=n.response,t[22]=l,t[23]=v):v=t[23];let y;return t[24]!==_||t[25]!==v?(y=(0,U.jsxs)(`article`,{className:`rounded-xl border border-warning/35 bg-warning-soft/25 p-3.5 transition-colors hover:bg-warning-soft/40`,children:[_,v]}),t[24]=_,t[25]=v,t[26]=y):y=t[26],y}function Ae(e){let t=(0,z.c)(19),{project:n,openLabel:r,noDescription:i}=e,o=`/projects/${encodeURIComponent(n.id)}`,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,U.jsx)(ue,{className:`size-4 shrink-0 text-accent`,"aria-hidden":!0}),t[0]=s):s=t[0];let c;t[1]===n.name?c=t[2]:(c=(0,U.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[s,(0,U.jsx)(`h3`,{className:`truncate text-sm font-semibold text-fg`,children:n.name})]}),t[1]=n.name,t[2]=c);let l;t[3]===r?l=t[4]:(l=(0,U.jsx)(b,{className:`size-4 shrink-0 text-fg-subtle transition-transform group-hover:translate-x-0.5`,"aria-label":r}),t[3]=r,t[4]=l);let u;t[5]!==c||t[6]!==l?(u=(0,U.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[c,l]}),t[5]=c,t[6]=l,t[7]=u):u=t[7];let d=n.description||n.brief||i,f;t[8]===d?f=t[9]:(f=(0,U.jsx)(`p`,{className:`mt-3 line-clamp-2 text-xs leading-5 text-fg-muted`,children:d}),t[8]=d,t[9]=f);let p=n.lastActiveAt??n.updatedAt,m;t[10]===p?m=t[11]:(m=Te(p,``),t[10]=p,t[11]=m);let h;t[12]===m?h=t[13]:(h=(0,U.jsx)(`p`,{className:`mt-auto pt-3 text-[11px] text-fg-subtle`,children:m}),t[12]=m,t[13]=h);let g;return t[14]!==o||t[15]!==h||t[16]!==u||t[17]!==f?(g=(0,U.jsxs)(a,{to:o,className:`group flex min-h-32 flex-col rounded-xl border border-edge-subtle bg-surface-panel p-4 transition-colors hover:bg-surface-hover/55 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[u,f,h]}),t[14]=o,t[15]=h,t[16]=u,t[17]=f,t[18]=g):g=t[18],g}function je(){let e=u(e=>e.language),t=l(e),n=t.projectsPage,r=i(),o=h(e=>e.setPageHeader),c=h(e=>e.clearPageHeader),[d,f]=(0,R.useState)(null),[p,m]=(0,R.useState)([]),[v,b]=(0,R.useState)([]),[k,N]=(0,R.useState)(!0),[te,P]=(0,R.useState)(null),[F,I]=(0,R.useState)(null),[L,le]=(0,R.useState)(``),[ue,z]=(0,R.useState)(!1),[B,V]=(0,R.useState)(``),[H,W]=(0,R.useState)(!1),[de,G]=(0,R.useState)(null),[K,q]=(0,R.useState)(null),[J,Y]=(0,R.useState)(null),X=(0,R.useCallback)(async()=>{N(!0),P(null);try{let[t,n,r]=await Promise.all([ye(e),_({limit:100,sortBy:`updatedAt`,sortOrder:`desc`}),w()]);f(t),m(n.items),b(r)}catch(e){P(e instanceof Error?e.message:String(e))}finally{N(!1)}},[e]);(0,R.useEffect)(()=>{X()},[X]);let Z=(0,R.useMemo)(()=>{let e=L.trim().toLocaleLowerCase(),t=p.filter(e=>e.status!==`archived`);return e?t.filter(t=>[t.name,t.description,t.brief].filter(Boolean).some(t=>t.toLocaleLowerCase().includes(e))):t.slice(0,6)},[p,L]),Q=(0,R.useMemo)(()=>d?.decisions??[],[d]),$=(0,R.useMemo)(()=>d?.work.current.filter(e=>e.status!==`needs_input`&&e.status!==`in_review`&&e.status!==`blocked`).slice(0,10)??[],[d]),pe=(0,R.useCallback)(async t=>{t.preventDefault();let n=B.trim();if(!(!n||H)){W(!0),I(null);try{let t=await E({outcome:n,uiLocale:e});V(``),z(!1),r(`/projects/${encodeURIComponent(t.project.id)}`)}catch(e){I(e instanceof Error?e.message:String(e))}finally{W(!1)}}},[H,e,r,B]),me=(0,R.useMemo)(()=>(0,U.jsxs)(O,{type:`button`,variant:`primary`,className:`h-9 rounded-lg`,onClick:()=>z(!0),children:[(0,U.jsx)(D,{className:`size-4`,"aria-hidden":!0}),n.workHome.newWork]}),[n.workHome.newWork]),he=(0,R.useCallback)(async(e,t)=>{if(e.response){G(e.id),P(null);try{await Ce(e.response,t),await X()}catch(e){P(e instanceof Error?e.message:String(e))}finally{G(null)}}},[X]),ge=(0,R.useCallback)(async(e,t)=>{q(e.id),P(null);try{let n=e.watches.find(e=>e.kind===t&&e.status===`active`);n?await y(e.id,n.id):await T(e.id,t),b(await w())}catch(e){P(e instanceof Error?e.message:String(e))}finally{q(null)}},[]),_e=(0,R.useCallback)(async(e,t)=>{Y(e),P(null);try{t===`approved`?await xe(e):await be(e,`dismissed`),f(t=>t&&{...t,proactiveInsights:t.proactiveInsights.filter(t=>t.id!==e)})}catch(e){P(e instanceof Error?e.message:String(e))}finally{Y(null)}},[]),ve=(0,R.useCallback)(async(e,t)=>{q(e),P(null);try{await Se(e,t),b(await w())}catch(e){P(e instanceof Error?e.message:String(e))}finally{q(null)}},[]);return(0,R.useLayoutEffect)(()=>(o({startExtra:null,main:(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:n.title}),(0,U.jsx)(`p`,{className:`truncate text-xs text-fg-muted`,children:n.workHome.subtitle})]}),end:me}),()=>c()),[c,me,o,n.title,n.workHome.subtitle]),(0,U.jsxs)(`main`,{className:`mx-auto flex w-full max-w-[1200px] flex-1 flex-col gap-7 px-4 py-7 sm:px-6 lg:px-8 lg:py-9`,children:[(0,U.jsx)(j,{open:ue,onOpenChange:e=>{!e&&H||(z(e),e||I(null))},children:(0,U.jsxs)(ee,{children:[(0,U.jsx)(x,{className:`fixed inset-0 z-[80] bg-scrim backdrop-blur-[2px]`}),(0,U.jsxs)(S,{className:`fixed left-1/2 top-1/2 z-[90] flex h-[min(31rem,calc(100dvh-1.5rem))] w-[min(36rem,calc(100vw-1.5rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-panel shadow-float focus:outline-none`,children:[(0,U.jsxs)(`div`,{className:`flex shrink-0 items-start gap-4 border-b border-edge px-5 py-4`,children:[(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(M,{className:`text-base font-semibold text-fg`,children:n.workHome.delegateTitle}),(0,U.jsx)(ae,{className:`mt-1 text-sm leading-5 text-fg-muted`,children:n.workHome.delegateDescription})]}),(0,U.jsx)(g,{asChild:!0,children:(0,U.jsx)(O,{type:`button`,variant:`ghost`,className:`-mr-2 -mt-1 size-8 shrink-0 rounded-lg p-0`,title:n.cancel,"aria-label":n.cancel,disabled:H,children:(0,U.jsx)(C,{className:`size-4`,"aria-hidden":!0})})})]}),(0,U.jsxs)(`form`,{onSubmit:pe,className:`flex min-h-0 flex-1 flex-col`,children:[(0,U.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto px-5 py-4`,children:[(0,U.jsx)(`label`,{htmlFor:`new-work-outcome`,className:`mb-2 shrink-0 text-sm font-medium text-fg`,children:n.workHome.outcomeLabel}),(0,U.jsx)(`textarea`,{id:`new-work-outcome`,className:`min-h-32 w-full flex-1 resize-none rounded-xl border border-edge bg-surface-base p-3 text-sm font-normal leading-6 text-fg outline-none placeholder:text-fg-subtle focus:border-accent focus:ring-2 focus:ring-accent/20`,value:B,onChange:e=>V(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),e.currentTarget.form?.requestSubmit())},placeholder:n.workHome.outcomePlaceholder,maxLength:12e3,disabled:H,autoFocus:!0}),(0,U.jsxs)(`div`,{className:`mt-2 flex shrink-0 items-center justify-between gap-3 text-[11px] text-fg-subtle`,children:[(0,U.jsx)(`span`,{children:n.workHome.submitShortcut}),(0,U.jsxs)(`span`,{className:`tabular-nums`,children:[B.length.toLocaleString(),` / `,12e3.toLocaleString()]})]}),F?(0,U.jsx)(`p`,{className:`mt-3 rounded-lg bg-danger-soft px-3 py-2 text-xs text-danger`,role:`alert`,children:F}):null]}),(0,U.jsxs)(`div`,{className:`flex shrink-0 justify-end gap-2 border-t border-edge px-5 py-4`,children:[(0,U.jsx)(g,{asChild:!0,children:(0,U.jsx)(O,{type:`button`,variant:`ghost`,disabled:H,children:n.cancel})}),(0,U.jsxs)(O,{type:`submit`,variant:`primary`,className:`min-w-32`,disabled:H||!B.trim(),children:[(0,U.jsx)(ce,{className:`size-4`,"aria-hidden":!0}),H?n.workHome.delegating:n.workHome.delegate]})]})]})]})]})}),te?(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-xl border border-danger/25 bg-danger-soft px-4 py-3 text-sm text-danger`,children:[(0,U.jsx)(`span`,{children:te}),(0,U.jsx)(O,{type:`button`,variant:`ghost`,className:`h-8 px-2`,onClick:()=>void X(),children:n.workHome.retry})]}):null,k?(0,U.jsx)(De,{}):d?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`section`,{className:`border-b border-edge-subtle pb-5`,children:[(0,U.jsx)(`p`,{className:`text-xs font-medium text-fg-subtle`,children:n.workHome.briefingTitle}),(0,U.jsx)(`h2`,{className:`mt-1 text-xl font-semibold tracking-tight text-fg`,children:d.decisions.length>0?we(n.workHome.todaySummary,{attention:d.decisions.length,moving:d.briefing.progress.movingCount}):we(n.workHome.todaySummaryClear,{moving:d.briefing.progress.movingCount})}),d.briefing.summary?(0,U.jsx)(`p`,{className:`mt-2 max-w-3xl text-sm leading-6 text-fg-muted`,children:d.briefing.summary}):null]}),d.proactiveInsights.length>0?(0,U.jsxs)(`section`,{className:`rounded-2xl border border-accent/20 bg-accent-soft/20 p-5`,children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,U.jsx)(ce,{className:`size-4 text-accent`,"aria-hidden":!0}),(0,U.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:n.workHome.insightsTitle}),(0,U.jsx)(Ee,{children:n.workHome.insightsBadge})]}),(0,U.jsx)(`div`,{className:`mt-4 space-y-3`,children:d.proactiveInsights.map(e=>(0,U.jsxs)(`article`,{className:`rounded-xl border border-edge-subtle bg-surface-panel p-4`,children:[(0,U.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:e.title}),(0,U.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:e.summary}),(0,U.jsxs)(`p`,{className:`mt-2 text-xs leading-5 text-fg-muted`,children:[(0,U.jsxs)(`span`,{className:`font-medium text-fg`,children:[n.workHome.whyItMatters,`: `]}),e.whyItMatters]}),(0,U.jsxs)(`p`,{className:`mt-2 rounded-lg bg-surface-base px-3 py-2 text-xs leading-5 text-fg-muted`,children:[(0,U.jsxs)(`span`,{className:`font-medium text-fg`,children:[n.workHome.suggestedNext,`: `]}),e.nextAction]}),(0,U.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:e.evidence.map((e,t)=>(0,U.jsxs)(`span`,{className:`rounded-full border border-edge-subtle px-2 py-1 text-[11px] text-fg-subtle`,children:[e.label,e.source?` · ${e.source}`:``]},`${e.label}-${t}`))}),(0,U.jsxs)(`div`,{className:`mt-3 flex justify-end gap-2 border-t border-edge-subtle pt-3`,children:[(0,U.jsx)(O,{type:`button`,variant:`ghost`,className:`h-8 px-2 text-xs`,disabled:J===e.id,onClick:()=>void _e(e.id,`dismissed`),children:n.workHome.dismissInsight}),(0,U.jsx)(O,{type:`button`,variant:`primary`,className:`h-8 px-2 text-xs`,disabled:J===e.id,onClick:()=>void _e(e.id,`approved`),children:n.workHome.investigateInsight})]})]},e.id))})]}):null,d.calendarSignals.length>0?(0,U.jsxs)(`section`,{className:`rounded-2xl bg-surface-base p-5 shadow-surface`,children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,U.jsx)(A,{className:`size-4 text-accent`,"aria-hidden":!0}),(0,U.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:n.workHome.relatedCalendarTitle}),(0,U.jsx)(Ee,{children:n.workHome.relatedCalendarBadge})]}),(0,U.jsx)(`div`,{className:`mt-4 divide-y divide-edge-subtle`,children:d.calendarSignals.map(e=>(0,U.jsxs)(`article`,{className:`flex flex-col gap-3 py-3 first:pt-0 last:pb-0 sm:flex-row sm:items-center sm:justify-between`,children:[(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsx)(`h3`,{className:`truncate text-sm font-semibold text-fg`,children:e.title}),(0,U.jsxs)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:[e.focusTitle,` · `,Te(e.startsAt,``)]})]}),(0,U.jsx)(O,{type:`button`,variant:`secondary`,className:`h-8 shrink-0 px-2 text-xs`,disabled:K===e.focusId,onClick:()=>void ve(e.focusId,e.id),children:K===e.focusId?n.workHome.focusWatchUpdating:n.workHome.prepareForEvent})]},e.id))})]}):null,v.length>0?(0,U.jsxs)(`section`,{className:`rounded-2xl bg-surface-base p-5 shadow-surface`,children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,U.jsx)(ie,{className:`size-4 text-accent`,"aria-hidden":!0}),(0,U.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:n.workHome.focusesTitle}),(0,U.jsx)(Ee,{children:n.workHome.focusesBadge})]}),(0,U.jsx)(`div`,{className:`mt-4 grid gap-3 md:grid-cols-2`,children:v.slice(0,6).map(e=>{let t=e.watches.some(e=>e.kind===`progress`&&e.status===`active`),r=e.watches.some(e=>e.kind===`intelligence`&&e.status===`active`),i=t||r;return(0,U.jsxs)(`article`,{className:`rounded-xl border border-edge-subtle bg-surface-panel p-4`,children:[(0,U.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsx)(`h3`,{className:`truncate text-sm font-semibold text-fg`,children:e.title}),(0,U.jsx)(`p`,{className:`mt-1 line-clamp-2 text-xs leading-5 text-fg-muted`,children:e.summary})]}),(0,U.jsx)(`span`,{className:`mt-0.5 size-2 shrink-0 rounded-full ${i?`bg-success`:`bg-fg-subtle/40`}`,"aria-hidden":!0})]}),e.blockedReason||e.nextAction?(0,U.jsx)(`p`,{className:`mt-3 line-clamp-2 border-t border-edge-subtle pt-3 text-xs leading-5 text-fg-muted`,children:e.blockedReason||e.nextAction}):null,(0,U.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center justify-between gap-2`,children:[(0,U.jsx)(`span`,{className:`text-[11px] text-fg-subtle`,children:i?n.workHome.focusWatchActive:n.workHome.focusWatchInactive}),(0,U.jsxs)(`div`,{className:`flex gap-1`,children:[(0,U.jsx)(O,{type:`button`,variant:`ghost`,className:`h-8 px-2 text-xs`,disabled:K===e.id,onClick:()=>void ge(e,`progress`),children:K===e.id?n.workHome.focusWatchUpdating:t?n.workHome.pauseProgressWatch:n.workHome.startFocusWatch}),(0,U.jsx)(O,{type:`button`,variant:`ghost`,className:`h-8 px-2 text-xs`,disabled:K===e.id,onClick:()=>void ge(e,`intelligence`),children:K===e.id?n.workHome.focusWatchUpdating:r?n.workHome.pauseNewsWatch:n.workHome.startNewsWatch})]})]})]},e.id)})})]}):null,d.work.current.length===0&&d.workflowRuns.active.length===0&&d.decisions.length===0&&d.upcomingAutomations.length===0&&v.length===0?(0,U.jsxs)(`section`,{className:`rounded-2xl border border-dashed border-edge p-8 text-center`,children:[(0,U.jsx)(re,{className:`mx-auto size-6 text-accent`,"aria-hidden":!0}),(0,U.jsx)(`h2`,{className:`mt-3 text-sm font-semibold text-fg`,children:n.workHome.emptyTitle}),(0,U.jsx)(`p`,{className:`mx-auto mt-1 max-w-lg text-sm leading-6 text-fg-muted`,children:n.workHome.emptyBody}),(0,U.jsxs)(`div`,{className:`mt-4 flex justify-center gap-2`,children:[(0,U.jsx)(O,{type:`button`,variant:`primary`,onClick:()=>r(`/chat/new`),children:n.workHome.startChat}),(0,U.jsx)(O,{type:`button`,variant:`secondary`,onClick:()=>z(!0),children:n.workHome.startLongWork})]})]}):null,(0,U.jsxs)(`div`,{className:`grid items-start gap-6 xl:grid-cols-[minmax(0,2fr)_minmax(18rem,1fr)]`,children:[(0,U.jsxs)(`div`,{className:`min-w-0 space-y-6`,children:[Q.length>0?(0,U.jsxs)(`section`,{className:`rounded-2xl bg-surface-base p-5 shadow-surface`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(s,{className:`size-4 text-warning`,"aria-hidden":!0}),(0,U.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:n.workHome.needsYou})]}),(0,U.jsx)(`div`,{className:`mt-4 space-y-2`,children:Q.map(e=>(0,U.jsx)(ke,{item:e,kindLabel:n.workHome.decisionKinds[e.kind],reasonLabel:n.workHome.decisionReasons[e.reason],approveLabel:n.workHome.approve,denyLabel:n.workHome.deny,busy:de===e.id,onRespond:t=>void he(e,t)},e.id))})]}):(0,U.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-fg-muted`,children:[(0,U.jsx)(`span`,{className:`flex size-5 items-center justify-center rounded-full bg-success-soft text-xs text-success`,"aria-hidden":!0,children:`✓`}),n.workHome.nothingNeedsYou]}),(0,U.jsxs)(`section`,{className:`rounded-2xl bg-surface-base p-5 shadow-surface`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(oe,{className:`size-4 text-fg-subtle`,"aria-hidden":!0}),(0,U.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:n.workHome.continueTitle})]}),(0,U.jsxs)(`div`,{className:`mt-4 divide-y divide-edge-subtle px-1`,children:[d.workflowRuns.active.map(e=>(0,U.jsxs)(a,{to:se(e.id),className:`flex items-center justify-between gap-3 rounded-lg px-2 py-3 text-sm hover:bg-surface-hover/55`,children:[(0,U.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`size-1.5 shrink-0 rounded-full bg-accent`,"aria-hidden":!0}),(0,U.jsx)(`span`,{className:`truncate font-medium text-fg`,children:e.title})]}),(0,U.jsx)(`span`,{className:`shrink-0 text-xs text-fg-subtle`,children:n.workHome.running})]},e.id)),$.map(e=>(0,U.jsx)(`div`,{className:`py-1`,children:(0,U.jsx)(Oe,{item:e,statusLabel:t.projectDetailPage.workItems.statuses[e.status]})},e.id)),d.workflowRuns.active.length===0&&$.length===0?(0,U.jsx)(`p`,{className:`py-6 text-center text-sm text-fg-muted`,children:n.workHome.noCurrentWork}):null]})]})]}),(0,U.jsxs)(`aside`,{className:`min-w-0 space-y-4`,"aria-label":n.workHome.nowTitle,children:[(0,U.jsx)(`div`,{className:`px-1`,children:(0,U.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:n.workHome.nowTitle})}),d.upcomingAutomations.length>0?(0,U.jsxs)(`section`,{className:`rounded-2xl bg-surface-base p-4 shadow-surface`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(A,{className:`size-4 text-fg-subtle`,"aria-hidden":!0}),(0,U.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:n.workHome.scheduled})]}),(0,U.jsx)(`div`,{className:`mt-2 divide-y divide-edge-subtle`,children:d.upcomingAutomations.slice(0,3).map(e=>(0,U.jsxs)(a,{to:`/automations`,className:`flex items-center justify-between gap-3 rounded-lg px-1 py-3 text-sm hover:bg-surface-hover/55`,children:[(0,U.jsx)(`span`,{className:`min-w-0 truncate text-fg`,children:e.name||e.action}),(0,U.jsx)(`time`,{className:`shrink-0 text-xs text-fg-subtle`,children:Te(e.nextRunAt,n.never)})]},e.id))})]}):null,(0,U.jsx)(fe,{}),d.briefing.wins.length>0?(0,U.jsxs)(a,{to:d.briefing.wins[0].href,className:`flex items-center justify-between gap-3 rounded-xl px-2 py-2 text-sm text-fg-muted hover:bg-surface-hover/55 hover:text-fg`,children:[(0,U.jsx)(`span`,{children:we(n.workHome.completedSummary,{count:d.briefing.wins.length})}),(0,U.jsxs)(`span`,{className:`shrink-0 text-xs font-medium text-accent`,children:[n.workHome.viewLatestResult,` →`]})]}):null]})]})]}):null,(0,U.jsxs)(`section`,{className:`border-t border-edge-subtle pt-7`,children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,U.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:n.workHome.spacesTitle}),(0,U.jsx)(a,{to:`/projects`,className:`text-xs font-medium text-accent hover:underline`,children:n.management.viewAll})]}),p.filter(e=>e.status!==`archived`).length>6?(0,U.jsx)(`div`,{className:`mt-3 flex justify-end`,children:(0,U.jsxs)(`label`,{className:`relative block min-w-0`,children:[(0,U.jsx)(ne,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`,"aria-hidden":!0}),(0,U.jsx)(`input`,{className:`h-9 w-52 rounded-lg border border-edge bg-surface-panel pl-9 pr-3 text-sm text-fg outline-none placeholder:text-fg-muted focus:border-accent`,value:L,onChange:e=>le(e.target.value),placeholder:n.searchPlaceholder,"aria-label":n.searchPlaceholder})]})}):null,(0,U.jsx)(`div`,{className:`mt-4 grid gap-3 md:grid-cols-2 xl:grid-cols-3`,children:Z.map(e=>(0,U.jsx)(Ae,{project:e,openLabel:n.workHome.openSpace,noDescription:n.noDescription},e.id))}),!k&&Z.length===0?(0,U.jsx)(`p`,{className:`py-8 text-center text-sm text-fg-muted`,children:n.workHome.noSpaces}):null]})]})}export{je as WorkPage};