pisper 0.6.29 → 0.6.30

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 (119) hide show
  1. package/package.json +5 -5
  2. package/web/.vite/manifest.json +635 -635
  3. package/web/assets/{AppDialog-CX0n4qav.js → AppDialog-CkcKXNVx.js} +1 -1
  4. package/web/assets/{AppOverlays-J_rOhlw3.js → AppOverlays-8_a8G80q.js} +1 -1
  5. package/web/assets/{AssetsPage-BuAZJf2M.js → AssetsPage-CZ7QjoFZ.js} +1 -1
  6. package/web/assets/{BoardPage-BT684h8Y.js → BoardPage-UwrtEMkO.js} +3 -3
  7. package/web/assets/{ChannelsPage-CznKEDyh.js → ChannelsPage-v1or6g85.js} +1 -1
  8. package/web/assets/{ChatAppearancePage-BrZ30LfD.js → ChatAppearancePage-BWiw5pd9.js} +1 -1
  9. package/web/assets/{ChatHistoryPage-BEJbiMs3.js → ChatHistoryPage-BDFnmYkk.js} +1 -1
  10. package/web/assets/{ChatPage-CCL8A95i.js → ChatPage-DzQO0hD7.js} +3 -3
  11. package/web/assets/{ConfigPage-_YQZcZlC.js → ConfigPage-CfXNpwBp.js} +2 -2
  12. package/web/assets/{DesktopWindowControls-C-LzcrLu.js → DesktopWindowControls-Cz8Wg_hN.js} +1 -1
  13. package/web/assets/{FeaturePage-C4fMefC-.js → FeaturePage-CoalHN81.js} +1 -1
  14. package/web/assets/{FileAttachmentPreview-DCdc0GFC.js → FileAttachmentPreview-1U8-b6EF.js} +1 -1
  15. package/web/assets/{FloatingWidgets-C5PMwmK1.js → FloatingWidgets-g5sPCtIK.js} +1 -1
  16. package/web/assets/{FocusRuntimeControls-D6Rj2AHK.js → FocusRuntimeControls-DtXWdr8l.js} +1 -1
  17. package/web/assets/{GitDiffViewer-D2QUzasQ.js → GitDiffViewer-Dc46yAUc.js} +1 -1
  18. package/web/assets/{ManageProjectsDialog-CCg0vZ07.js → ManageProjectsDialog-5QL6Rsyx.js} +1 -1
  19. package/web/assets/{MarkdownMessage-DbPFHAG0.js → MarkdownMessage-BYQ5qUjo.js} +1 -1
  20. package/web/assets/{McpPage-DAg9VlnU.js → McpPage-CMMyexGW.js} +1 -1
  21. package/web/assets/{MemoryEvolution-CVF6CYuV.js → MemoryEvolution-DPD3_wye.js} +1 -1
  22. package/web/assets/{MemoryPage-C4C8Efhi.js → MemoryPage-Ba_yfJPT.js} +2 -2
  23. package/web/assets/{MobileNavigation-EsJOtmUl.js → MobileNavigation-CWfgl4Om.js} +1 -1
  24. package/web/assets/{MorePage-BslKLMFa.js → MorePage-D7Ez-MdJ.js} +1 -1
  25. package/web/assets/{NewFolderDialog-Bb4T0UPO.js → NewFolderDialog-CvV_ioYA.js} +1 -1
  26. package/web/assets/{PageHeader-DjJ0Ab6e.js → PageHeader-DeZrNdHv.js} +1 -1
  27. package/web/assets/{PhoneDrawer-Cu2FDUc1.js → PhoneDrawer-DrKWtKrk.js} +1 -1
  28. package/web/assets/{PhoneMenuButton-C8pYulkt.js → PhoneMenuButton-CKS9DzOB.js} +1 -1
  29. package/web/assets/{PhoneTopBar-CvMWkksM.js → PhoneTopBar-l-4k9nw_.js} +1 -1
  30. package/web/assets/{PluginsPage-DxjMMa05.js → PluginsPage-BsBzoPyO.js} +1 -1
  31. package/web/assets/{SafeModePrompt-DG64bady.js → SafeModePrompt-BBqKG3rI.js} +1 -1
  32. package/web/assets/{SchedulesPage-Bd0sjkiZ.js → SchedulesPage-C9VdDHsU.js} +1 -1
  33. package/web/assets/{SessionBrowserPane-CigWhKGU.js → SessionBrowserPane-Dsf4QuHa.js} +2 -2
  34. package/web/assets/{SessionContextPanel-HfjETMcF.js → SessionContextPanel-D_DlmWUB.js} +2 -2
  35. package/web/assets/{SessionHome-DtzbkF19.js → SessionHome-xbtukAlf.js} +1 -1
  36. package/web/assets/{SessionInspector-BZyFstFl.js → SessionInspector-iJDqtJQH.js} +1 -1
  37. package/web/assets/{SessionShell-BCIVsKr9.js → SessionShell-CgbIeUd0.js} +1 -1
  38. package/web/assets/{SettingsSidebar-F20r1qhh.js → SettingsSidebar-l2Fq0Fjv.js} +1 -1
  39. package/web/assets/{ShortcutHelpDialog-BSiv5k3S.js → ShortcutHelpDialog-C9Cg-rDI.js} +1 -1
  40. package/web/assets/{ShortcutKeys-BWYkyL77.js → ShortcutKeys-COCK3Z1P.js} +1 -1
  41. package/web/assets/{SidebarUpdateStatus-BA3cyY6N.js → SidebarUpdateStatus-Db5HG75S.js} +1 -1
  42. package/web/assets/{SkillsPage-C6cF2A7j.js → SkillsPage-bUxTQh3g.js} +1 -1
  43. package/web/assets/{TaskProcessesPane-B6O5Mirv.js → TaskProcessesPane-CepFj3M9.js} +1 -1
  44. package/web/assets/{TaskTerminalView-IR5bGXk7.js → TaskTerminalView-B3uXJaXz.js} +1 -1
  45. package/web/assets/{TerminalPanel-BAl1Ytmx.js → TerminalPanel-WjT3RQwU.js} +1 -1
  46. package/web/assets/{WebDesktopPet-CLjE98zM.js → WebDesktopPet-C0tCcQDc.js} +1 -1
  47. package/web/assets/{WorkflowsPage-5kMzkdP5.js → WorkflowsPage-CjYNxv4V.js} +1 -1
  48. package/web/assets/{WorkspacePicker-Dy3QRSbL.js → WorkspacePicker-B5zEAngW.js} +1 -1
  49. package/web/assets/{api-BhPOJ07B.js → api-CHqbIMkc.js} +1 -1
  50. package/web/assets/{app-update-DK-2lnli.js → app-update-K5RbjYD1.js} +1 -1
  51. package/web/assets/{approval-confirm-BiKVYJXn.js → approval-confirm-By4nwBEC.js} +1 -1
  52. package/web/assets/{board-projects-BmfKMy9W.js → board-projects-Cn6F0I5D.js} +1 -1
  53. package/web/assets/{bots-store-sXgxSYjm.js → bots-store-Cf4rK-qw.js} +1 -1
  54. package/web/assets/{chat-api-CdqM-TFw.js → chat-api-H18lBlnu.js} +1 -1
  55. package/web/assets/{client-store-CkmBBzE5.js → client-store-DtL9pe9n.js} +1 -1
  56. package/web/assets/{config-search-DTHZrqfb.js → config-search-CYSyHqnu.js} +1 -1
  57. package/web/assets/{desktop-hosts-BzI81G6K.js → desktop-hosts-Coceul_o.js} +1 -1
  58. package/web/assets/{dialog-BVAtioHy.js → dialog-C_ew2HiI.js} +1 -1
  59. package/web/assets/{event-stream-B9eeQcgA.js → event-stream-CJDJ_f9g.js} +1 -1
  60. package/web/assets/{events-CcKmvwE6.js → events-S66w92oA.js} +1 -1
  61. package/web/assets/{focus-session-composer-bits-BuYWKdXR.js → focus-session-composer-bits-CVCWWebM.js} +1 -1
  62. package/web/assets/{folder-paths-D8nYAh7q.js → folder-paths-CptXLCCu.js} +1 -1
  63. package/web/assets/{hosts-BRNTbndS.js → hosts-DPhLIJU_.js} +1 -1
  64. package/web/assets/{http-CXQuFoDX.js → http-Clt0jbV2.js} +1 -1
  65. package/web/assets/{http-response-scdqC11Q.js → http-response-C_f1S2cS.js} +1 -1
  66. package/web/assets/{i18n-D5XUOwJ3.js → i18n-Zs9wBTpa.js} +1 -1
  67. package/web/assets/{index-at6jiRd2.js → index-BpFQSLJJ.js} +2 -2
  68. package/web/assets/{machine-messages-BhLpbeyp.js → machine-messages-0-CA3CIF.js} +1 -1
  69. package/web/assets/{machines-api-c4gyvYeB.js → machines-api-C6W1eWgQ.js} +1 -1
  70. package/web/assets/{memory-api-BZLLcIF1.js → memory-api-BdiBvhoi.js} +1 -1
  71. package/web/assets/{mount-app-713eDAlJ.js → mount-app-Cx_t3TyS.js} +3 -3
  72. package/web/assets/{permission-rules-api-BoggV-So.js → permission-rules-api-B3tMaJim.js} +1 -1
  73. package/web/assets/{pick-system-directory-COxOQmRm.js → pick-system-directory-nvVGfFRB.js} +1 -1
  74. package/web/assets/{placements-CWg24KPB.js → placements-DQgsRjpv.js} +2 -2
  75. package/web/assets/{popover-BKEwGK6p.js → popover-CXY-wqxd.js} +1 -1
  76. package/web/assets/{public-Ds92tfxs.js → public-BFJhCijs.js} +2 -2
  77. package/web/assets/{public-DyoA5qbn.js → public-Cy9CZkvX.js} +2 -2
  78. package/web/assets/{public-CFmAK4C5.js → public-DftK6qxa.js} +1 -1
  79. package/web/assets/{public-components-CiFLJxlo.js → public-components-Dy2rT6tl.js} +1 -1
  80. package/web/assets/public-diff-DpqhuEMa.js +1 -0
  81. package/web/assets/public-events-DeehiuZW.js +1 -0
  82. package/web/assets/{public-flags-wwqdZl3u.js → public-flags-C0MjuPsC.js} +1 -1
  83. package/web/assets/{public-folder-dialog-MYvmKYka.js → public-folder-dialog-B_ho2Tuq.js} +1 -1
  84. package/web/assets/{public-greeting-DFC9u9sY.js → public-greeting-CuNs0758.js} +1 -1
  85. package/web/assets/{public-_SuCE3iR.js → public-ha8Otx14.js} +1 -1
  86. package/web/assets/{public-session-qSMh175y.js → public-session-B9nhW7qH.js} +1 -1
  87. package/web/assets/{public-sidebar-WFoUZVnB.js → public-sidebar-CWBvWdYQ.js} +1 -1
  88. package/web/assets/{runtime-capabilities-store-D0EC-a9c.js → runtime-capabilities-store-DoZOSQiv.js} +1 -1
  89. package/web/assets/{safe-mode-instance-Ct43-TDv.js → safe-mode-instance-B9F0Xu3o.js} +1 -1
  90. package/web/assets/safe-mode-sentinel-Bk2p-CVG.js +1 -0
  91. package/web/assets/{session-change-summary-api-CyghX14t.js → session-change-summary-api-BbviMo7L.js} +1 -1
  92. package/web/assets/{session-home-DY7RkKbH.js → session-home-D75yfsOZ.js} +1 -1
  93. package/web/assets/{session-inspector-store-BocK0l86.js → session-inspector-store-D8oaLlKH.js} +1 -1
  94. package/web/assets/{session-organization-api-CGRK7VMP.js → session-organization-api-DyiM7H-D.js} +1 -1
  95. package/web/assets/{session-scope-DDZF_AQ6.js → session-scope-D4AVO880.js} +1 -1
  96. package/web/assets/{session-tree-actions-g769G3qz.js → session-tree-actions-BiZreN0W.js} +1 -1
  97. package/web/assets/{session-tree-summary-CqrRroey.js → session-tree-summary-DZk4xiEt.js} +1 -1
  98. package/web/assets/{shortcuts-BsrTXPiU.js → shortcuts-1-ySiY-G.js} +1 -1
  99. package/web/assets/{side-chat-context-DNQ3tThq.js → side-chat-context-BXN0j7F9.js} +4 -4
  100. package/web/assets/{sidebar-R690QKPw.js → sidebar-6NqiNUCV.js} +1 -1
  101. package/web/assets/{sidebar-store-QvX0w7hQ.js → sidebar-store-CRSu48Er.js} +1 -1
  102. package/web/assets/{speech-session-DnBIZldd.js → speech-session-LPLnrut8.js} +1 -1
  103. package/web/assets/{startup-queries-BpV9-ykp.js → startup-queries-D4Xgj-oO.js} +1 -1
  104. package/web/assets/{use-i18n-AM3jlRYR.js → use-i18n-D6tl7SDi.js} +1 -1
  105. package/web/assets/{use-open-bot-BDco631W.js → use-open-bot-DFkiPFzc.js} +1 -1
  106. package/web/assets/{use-studio-actions-C7W6Soh6.js → use-studio-actions-DUeKLKcG.js} +1 -1
  107. package/web/assets/{useCatalogProjects-DCT51aGo.js → useCatalogProjects-Cv6RLD5k.js} +1 -1
  108. package/web/assets/{useMachines-BJtbuUVt.js → useMachines-5sQYc73a.js} +1 -1
  109. package/web/assets/{useNewProjectPicker-B85EuCYh.js → useNewProjectPicker-B058VLdC.js} +2 -2
  110. package/web/assets/{useNow-BUhFR4QI.js → useNow-v0wgDYcL.js} +1 -1
  111. package/web/assets/{usePhoneShell-CK9XBtgf.js → usePhoneShell-CcoVb1v0.js} +1 -1
  112. package/web/assets/{useSessionListQuery-B4Xmcfwa.js → useSessionListQuery-BaBpkejJ.js} +1 -1
  113. package/web/assets/{useSessionRowActions-BMestf2F.js → useSessionRowActions-B-TF8WrJ.js} +1 -1
  114. package/web/assets/{useSidebarModel-BDfzya9Z.js → useSidebarModel-B5Mjqu8a.js} +1 -1
  115. package/web/assets/{workspace-order-store-C_t43Zgq.js → workspace-order-store-DTeP4wAO.js} +1 -1
  116. package/web/index.html +1 -1
  117. package/web/assets/public-diff-ByaSqbeU.js +0 -1
  118. package/web/assets/public-events-BZoQRupR.js +0 -1
  119. package/web/assets/safe-mode-sentinel-BKPGGJEL.js +0 -1
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./index-at6jiRd2.js";import{i as n,r}from"./vendor-react-DwNgTV1j.js";import{t as i}from"./use-i18n-AM3jlRYR.js";import{t as a}from"./storage-DtvZ_lEu.js";import{t as o}from"./useQuery-DfOU-27z.js";import{a as s,n as c,o as l,t as u}from"./startup-queries-BpV9-ykp.js";import{t as d}from"./api-BhPOJ07B.js";import{t as ee}from"./usePhoneShell-CK9XBtgf.js";import{t as f}from"./createLucideIcon-Cd-3GVxJ.js";import{t as te}from"./archive-ojKJT7Fp.js";import{t as ne}from"./ellipsis-CfGKfbq6.js";import{t as re}from"./pencil-U08v_vV9.js";import{t as ie}from"./pin-off-BpRu_vrC.js";import{t as p}from"./pin-CU0FG0lI.js";import{t as ae}from"./refresh-cw-TbWxTY4K.js";import{t as oe}from"./square-pen-hYbjKh6A.js";import{t as se}from"./trash-2-CNrPOoPR.js";import{t as m}from"./brand-DIEc3fK8.js";import{t as ce}from"./more-pages-D_PnxLN0.js";import{c as le,i as h,p as ue,r as de,t as fe}from"./dropdown-menu-Ds0gD8S8.js";import{t as g}from"./utils-C8uzG5AZ.js";import{n as pe,t as _}from"./button-CCcCN8tE.js";import{c as me,t as v,u as y,y as he}from"./events-CcKmvwE6.js";import{s as ge}from"./shortcuts-BsrTXPiU.js";import{n as _e,t as ve}from"./session-organization-api-CGRK7VMP.js";import{a as ye,o as be}from"./format-DMJQzoZ7.js";import{t as b}from"./StatusGlyph-1KgitlUg.js";import{t as x}from"./session-change-summary-api-CyghX14t.js";import{n as S}from"./PageState-Cz6vFMXv.js";import{a as xe,i as Se,n as Ce,o as we,r as Te,s as Ee,t as De}from"./FeaturePage-C4fMefC-.js";import{t as Oe}from"./badge-CWB3lj2H.js";import{a as C,t as ke}from"./session-list-BRMu9JWa.js";var Ae=f(`archive-restore`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h2`,key:`tvwodi`}],[`path`,{d:`M20 8v11a2 2 0 0 1-2 2h-2`,key:`1gkqxj`}],[`path`,{d:`m9 15 3-3 3 3`,key:`1pd0qc`}],[`path`,{d:`M12 12v9`,key:`192myk`}]]),je=f(`folder-closed`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}],[`path`,{d:`M2 10h20`,key:`1ir3d8`}]]),w=e(n(),1),T=864e5;function E(e,t=Date.now()){if(e.pinned)return`pinned`;let n=Date.parse(e.modified||``);if(!Number.isFinite(n))return`earlier`;let r=new Date(t);return r.setHours(0,0,0,0),n>=r.getTime()?`today`:n>=r.getTime()-6*T?`week`:`earlier`}function D(e,t,n=Date.now()){let r=new Map;return e.forEach((e,i)=>{let a=E(e,n),o=r.get(a)??{key:a,count:0,items:[]};o.count+=1,i<t&&o.items.push(e),r.set(a,o)}),[...r.values()].filter(e=>e.items.length>0)}function Me(e,t,n,r=`active`,i=Date.now()){let a=t.trim().toLowerCase(),o=a?e.filter(e=>`${e.name||``} ${e.firstMessage||``} ${e.cwd||``} ${e.model||``}`.toLowerCase().includes(a)):e.filter(e=>!!e.archived==(r===`archived`)),s=C(o),c=s.slice(0,Math.max(0,n));return{total:o.length,items:c,groups:D(s,c.length,i)}}var O=r();function Ne({sessionId:e,lastCompletedAt:t,streaming:n}){let{t:r}=i(),a=(0,w.useRef)(null),[s,c]=(0,w.useState)(!1);(0,w.useEffect)(()=>{let e=a.current;if(!e||s)return;if(!(`IntersectionObserver`in window)){c(!0);return}let t=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&(c(!0),t.disconnect())},{rootMargin:`120px`});return t.observe(e),()=>t.disconnect()},[s]);let{data:l}=o({queryKey:[`session-change-summary`,e,t],queryFn:()=>x(e),enabled:s,staleTime:6e4,retry:0,refetchInterval:n&&s?2e4:!1});return l?.status!==`known`||!l.changedFiles?(0,O.jsx)(`span`,{ref:a}):(0,O.jsx)(`span`,{ref:a,className:`ml-1 inline-flex items-center gap-1 tabular-nums before:mr-1 before:content-['·']`,children:r(`chat:chatHistoryPage.changeSummary`,{count:l.changedFiles,added:l.added||0,removed:l.removed||0})})}function k(e){s.setQueryData(u,t=>t&&{...t,sessions:e(t.sessions||[])})}function A({navigate:e,onBack:n,onNewTask:r,notify:s,requestConfirm:u,requestText:f}){let{t:x,language:T}=i(),E=ee(),D=ge(`focusSearch`),[A,j]=(0,w.useState)(``),M=o(l(`sessions`)),N=(0,w.useMemo)(()=>C(M.data?.sessions||[]),[M.data]),[P,Pe]=(0,w.useState)(`active`),F=`${P}\0${A}`,[I,L]=(0,w.useState)({filterKey:F,count:50}),R=(0,w.useRef)(!1),z=(0,w.useRef)(null),[B,V]=(0,w.useState)(()=>t.getItem(a.activeSession)||``),[Fe,H]=(0,w.useState)(!1),[U,W]=(0,w.useState)(``),G=M.isPending||Fe,K=M.error&&!M.data?M.error instanceof Error?M.error.message:String(M.error):``;(0,w.useEffect)(()=>{L(e=>e.filterKey===F&&e.count===50?e:{filterKey:F,count:50})},[F]);let q=(0,w.useCallback)(async()=>{H(!0),W(``);try{await c(`sessions`,!0)}catch(e){W(e instanceof Error?e.message:String(e))}finally{H(!1)}},[]);(0,w.useEffect)(()=>(document.title=`${x(`chat:chatHistoryPage.chatHistory`)} · ${m}`,()=>{document.title=m}),[x]),(0,w.useEffect)(()=>{let e=e=>V(e.detail?.id||t.getItem(a.activeSession)||``);return window.addEventListener(v,e),()=>window.removeEventListener(v,e)},[]);let J=I.filterKey===F?I.count:50,Y=(0,w.useMemo)(()=>Me(N,A,J,P),[P,A,N,J]),X=N.filter(e=>e.archived).length,Z={active:N.length-X,archived:X},Ie={pinned:x(`chat:chatHistoryPage.groupPinned`),today:x(`chat:chatHistoryPage.groupToday`),week:x(`chat:chatHistoryPage.groupWeek`),earlier:x(`chat:chatHistoryPage.groupEarlier`)};(0,w.useEffect)(()=>{R.current&&(R.current=!1,z.current?.focus())},[Y.items.length,Y.total]);let Le=t=>{he(t),e(`chat`)},Re=async e=>{let t=await f({title:x(`chat:chatHistoryPage.renameChat`),inputLabel:x(`chat:chatHistoryPage.chatTitle`),value:e.name,confirmLabel:x(`chat:chatHistoryPage.save`)});if(t!==null&&t!==e.name)try{let n=await d(`/api/sessions/${encodeURIComponent(e.id)}`,{method:`PATCH`,body:JSON.stringify({name:t})});k(t=>t.map(t=>t.id===e.id?{...t,name:n.name}:t)),y({id:e.id,name:n.name}),s(x(`chat:chatHistoryPage.chatTitleUpdated`))}catch(e){W(e instanceof Error?e.message:String(e))}},Q=async(e,t,n)=>{try{let r=await _e(e.id,t);k(e=>ke(e,r)),s(n)}catch(e){W(e instanceof ve?x(`chat:chatHistoryPage.sessionUpdateFailed`):e instanceof Error?e.message:String(e))}},ze=async e=>{if(await u({title:x(`chat:chatHistoryPage.deleteChat`),message:x(`chat:chatHistoryPage.deleteChatNameThisAlsoRemovesLocalChatHistory`,{name:e.name}),confirmLabel:x(`chat:chatHistoryPage.delete`)}))try{await d(`/api/sessions/${encodeURIComponent(e.id)}`,{method:`DELETE`});let n=N.filter(t=>t.id!==e.id);if(k(t=>t.filter(t=>t.id!==e.id)),B===e.id){let e=n[0]?.id||``;V(e),e?t.setItem(a.activeSession,e):t.removeItem(a.activeSession),me(e)}y({deletedIds:[e.id]}),s(x(`chat:chatHistoryPage.chatDeleted`))}catch(e){W(e instanceof Error?e.message:String(e))}},Be=e=>e.streaming?(0,O.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 text-content-secondary`,children:[(0,O.jsx)(b,{status:`run`,className:`size-3.5`}),x(`chat:chatHistoryPage.statusRunning`)]}):e.needsAttention?(0,O.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 font-medium text-warning-strong`,children:[(0,O.jsx)(b,{status:`attention`,className:`size-3.5`}),e.attentionReason===`failure`?x(`chat:chatHistoryPage.statusFailed`):e.attentionReason===`approval`?x(`chat:chatHistoryPage.statusApproval`):x(`chat:chatHistoryPage.needsAttention`)]}):null,$=x(`chat:chatHistoryPage.chatHistory`),Ve=A?x(`chat:chatHistoryPage.noMatchingConversations`):P===`archived`?x(`chat:chatHistoryPage.noArchivedChats`):N.length?x(`chat:chatHistoryPage.noActiveChats`):x(`chat:chatHistoryPage.noConversationsHaveLeftAnEchoYet`),He=A?x(`chat:chatHistoryPage.tryADifferentSearch`):P===`archived`?x(`chat:chatHistoryPage.archivedChatsAppearHere`):N.length?x(`chat:chatHistoryPage.restoreArchivedChats`):x(`chat:chatHistoryPage.onceAConversationBeginsItWillBeQuietlyGatheredHere`);return(0,O.jsx)(Te,{title:$,description:x(`chat:chatHistoryPage.lede`),back:n&&{label:x(`navigation:sidebar.features`),ariaLabel:x(`navigation:shell.backToFeaturesLabel`),onBack:n},toolbar:(0,O.jsx)(Ee,{search:(0,O.jsx)(xe,{id:ce,value:A,onValueChange:j,placeholder:x(`navigation:pageHeader.searchPage`,{page:$}),shortcut:D,clearLabel:x(`navigation:more.clearSearch`)}),actions:r&&!E&&(0,O.jsxs)(_,{type:`button`,className:`h-9`,onClick:r,children:[(0,O.jsx)(oe,{}),x(`navigation:shell.newTask`)]}),filters:(0,O.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-4 gap-y-2`,children:[(0,O.jsx)(`div`,{role:`group`,"aria-label":x(`chat:chatHistoryPage.historySections`),className:`inline-grid h-8 grid-cols-2 rounded-md border border-stroke bg-chrome p-[3px] max-[650px]:h-auto max-[650px]:flex-1 max-[650px]:rounded-[10px] pointer-coarse:h-auto`,children:[`active`,`archived`].map(e=>(0,O.jsxs)(`button`,{type:`button`,"aria-pressed":P===e,"aria-label":e===`active`?x(`chat:chatHistoryPage.activeChatsCount`,{count:Z.active}):x(`chat:chatHistoryPage.archivedChats`,{count:Z.archived}),className:g(`inline-flex min-w-0 items-center justify-center gap-1.5 rounded-sm border border-transparent px-3 text-sm text-content-secondary transition-colors duration-(--d-fast) hover:text-content max-[650px]:h-11 max-[650px]:text-base pointer-coarse:h-11`,P===e&&`border-key-border bg-key font-medium text-content shadow-key`),onClick:()=>Pe(e),children:[x(e===`active`?`chat:chatHistoryPage.activeChats`:`chat:chatHistoryPage.archived`),(0,O.jsx)(`span`,{className:g(`text-xs font-normal tabular-nums`,P===e?`text-content-secondary`:`text-content-muted`),children:Z[e]})]},e))}),(0,O.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1 text-xs text-content-muted tabular-nums`,children:[(0,O.jsxs)(`span`,{className:g(`truncate`,!A&&`max-[650px]:hidden`),children:[x(`chat:chatHistoryPage.countChatHistoryItems`,{count:N.length}),` · `,A?x(`chat:chatHistoryPage.countCurrentlyFiltered`,{count:Y.total}):x(`chat:chatHistoryPage.sortedByMostRecentlyUpdated`)]}),(0,O.jsx)(_,{variant:`ghost`,size:`icon-sm`,className:`text-content-muted max-[650px]:size-11 pointer-coarse:size-11`,"aria-label":x(`chat:chatHistoryPage.refresh`),title:x(`chat:chatHistoryPage.refresh`),onClick:()=>void q(),disabled:G,children:G?(0,O.jsx)(pe,{className:`text-current`}):(0,O.jsx)(ae,{size:14})})]})]})}),children:G&&!N.length?(0,O.jsx)(S,{kind:`loading`,title:x(`chat:chatHistoryPage.loadingChatHistory`)}):K&&!N.length?(0,O.jsx)(S,{kind:`error`,title:x(`chat:chatHistoryPage.loadFailed`),description:K,action:(0,O.jsx)(_,{variant:`secondary`,className:`max-[650px]:h-11`,loading:G,disabled:G,onClick:()=>void q(),children:x(`common:pageTemplate.retry`)})}):(0,O.jsxs)(O.Fragment,{children:[(U||K)&&(0,O.jsx)(De,{children:U||K}),Y.total?(0,O.jsxs)(`div`,{className:`chat-history-list`,children:[Y.groups.map(e=>(0,O.jsx)(we,{title:Ie[e.key],count:e.count,children:(0,O.jsx)(Ce,{children:e.items.map(e=>{let t=e.name||x(`chat:chatHistoryPage.untitledChat`),n=e.model&&!/(^|\/)unknown$/i.test(String(e.model))?String(e.model).split(`/`).at(-1):``,r=e.id===B;return(0,O.jsx)(Se,{"data-history-session":e.id,"data-current":r||void 0,className:g(`chat-history-row relative`,r&&`after:absolute after:top-3.5 after:bottom-3.5 after:-left-3 after:w-[3px] after:rounded-r-[3px] after:bg-star max-[650px]:after:-left-2.5`),onOpen:()=>Le(e.id),openLabel:x(`chat:chatHistoryPage.openChatNamed`,{name:t}),name:(0,O.jsxs)(`span`,{className:`chat-history-copy inline-flex max-w-full min-w-0 items-center gap-2`,children:[e.unread&&(0,O.jsx)(`span`,{role:`img`,"aria-label":x(`chat:chatHistoryPage.unread`),className:`size-1.5 shrink-0 rounded-full bg-ink`}),e.pinned&&(0,O.jsx)(p,{className:`size-3.5 shrink-0 text-content-muted`,"aria-hidden":`true`}),(0,O.jsx)(`strong`,{"data-history-name":!0,className:`min-w-0 truncate font-medium`,title:t,children:t})]}),description:(0,O.jsx)(`span`,{className:g(`line-clamp-1`,e.firstMessage?`text-content-secondary`:void 0),children:e.firstMessage||x(`chat:chatHistoryPage.noMessageSummary`)}),meta:(0,O.jsxs)(O.Fragment,{children:[Be(e),e.archived&&A.trim()&&(0,O.jsx)(Oe,{children:x(`chat:chatHistoryPage.archived`)}),(0,O.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-1 font-mono`,children:[(0,O.jsx)(je,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),(0,O.jsx)(`span`,{className:`truncate`,children:be(e.projectless?``:e.cwd,T)})]}),(0,O.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,O.jsx)(`span`,{className:`shrink-0 tabular-nums`,children:x(`chat:chatHistoryPage.countMessages`,{count:e.messageCount||0})}),n&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`span`,{"aria-hidden":`true`,className:`max-[650px]:hidden`,children:`·`}),(0,O.jsx)(`span`,{className:`min-w-0 truncate font-mono max-[650px]:hidden`,children:n})]}),(0,O.jsx)(Ne,{sessionId:e.id,lastCompletedAt:e.lastCompletedAt,streaming:e.streaming})]}),status:(0,O.jsx)(`time`,{dateTime:e.modified,children:ye(e.modified,T)}),actions:(0,O.jsxs)(fe,{children:[(0,O.jsx)(ue,{asChild:!0,children:(0,O.jsx)(_,{type:`button`,variant:`ghost`,size:`icon`,className:`size-8 shrink-0 text-content-muted max-[650px]:size-11 pointer-coarse:size-11`,"aria-label":x(`chat:chatHistoryPage.moreActionsForChat`,{name:t}),children:(0,O.jsx)(ne,{size:16})})}),(0,O.jsxs)(de,{align:`end`,className:`min-w-48`,children:[(0,O.jsxs)(h,{className:`min-h-11`,onSelect:()=>void Re(e),children:[(0,O.jsx)(re,{}),x(`chat:chatHistoryPage.renameChat`)]}),(0,O.jsxs)(h,{className:`min-h-11`,onSelect:()=>void Q(e,{pinned:!e.pinned},e.pinned?x(`chat:chatHistoryPage.unpinned`):x(`chat:chatHistoryPage.pinned`)),children:[e.pinned?(0,O.jsx)(ie,{}):(0,O.jsx)(p,{}),e.pinned?x(`chat:chatHistoryPage.unpin`):x(`chat:chatHistoryPage.pin`)]}),(0,O.jsxs)(h,{className:`min-h-11`,onSelect:()=>void Q(e,{archived:!e.archived},e.archived?x(`chat:chatHistoryPage.restored`):x(`chat:chatHistoryPage.movedToArchive`)),children:[e.archived?(0,O.jsx)(Ae,{}):(0,O.jsx)(te,{}),e.archived?x(`chat:chatHistoryPage.restore`):x(`chat:chatHistoryPage.archive`)]}),e.unread&&(0,O.jsx)(h,{className:`min-h-11`,onSelect:()=>void Q(e,{read:!0},x(`chat:chatHistoryPage.markedRead`)),children:x(`chat:chatHistoryPage.markRead`)}),(0,O.jsx)(le,{}),(0,O.jsxs)(h,{variant:`destructive`,className:`min-h-11`,onSelect:()=>void ze(e),children:[(0,O.jsx)(se,{}),x(`chat:chatHistoryPage.deleteChat`)]})]})]})},e.id)})})},e.key)),Y.total>50&&(0,O.jsx)(`div`,{className:`flex justify-center pt-4`,children:Y.total>Y.items.length?(0,O.jsx)(_,{type:`button`,variant:`secondary`,className:`tabular-nums max-[650px]:min-h-11 pointer-coarse:min-h-11`,onClick:()=>{let e=J+50;R.current=e>=Y.total,L({filterKey:F,count:e})},children:x(`chat:chatHistoryPage.loadMoreChats`,{shown:Y.items.length,total:Y.total})}):(0,O.jsx)(`p`,{ref:z,tabIndex:-1,role:`status`,className:`py-2 text-xs text-content-muted tabular-nums`,children:x(`chat:chatHistoryPage.allChatsShown`,{count:Y.total})})})]}):(0,O.jsx)(S,{kind:`empty`,title:Ve,description:He})]})})}export{A as ChatHistoryPage};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./index-BpFQSLJJ.js";import{i as n,r}from"./vendor-react-DwNgTV1j.js";import{t as i}from"./use-i18n-D6tl7SDi.js";import{t as a}from"./storage-DtvZ_lEu.js";import{t as o}from"./useQuery-DfOU-27z.js";import{a as s,n as c,o as l,t as u}from"./startup-queries-D4Xgj-oO.js";import{t as d}from"./api-CHqbIMkc.js";import{t as ee}from"./usePhoneShell-CcoVb1v0.js";import{t as f}from"./createLucideIcon-Cd-3GVxJ.js";import{t as te}from"./archive-ojKJT7Fp.js";import{t as ne}from"./ellipsis-CfGKfbq6.js";import{t as re}from"./pencil-U08v_vV9.js";import{t as ie}from"./pin-off-BpRu_vrC.js";import{t as p}from"./pin-CU0FG0lI.js";import{t as ae}from"./refresh-cw-TbWxTY4K.js";import{t as oe}from"./square-pen-hYbjKh6A.js";import{t as se}from"./trash-2-CNrPOoPR.js";import{t as m}from"./brand-DIEc3fK8.js";import{t as ce}from"./more-pages-D_PnxLN0.js";import{c as le,i as h,p as ue,r as de,t as fe}from"./dropdown-menu-Ds0gD8S8.js";import{t as g}from"./utils-C8uzG5AZ.js";import{n as pe,t as _}from"./button-CCcCN8tE.js";import{c as me,t as v,u as y,y as he}from"./events-S66w92oA.js";import{s as ge}from"./shortcuts-1-ySiY-G.js";import{n as _e,t as ve}from"./session-organization-api-DyiM7H-D.js";import{a as ye,o as be}from"./format-DMJQzoZ7.js";import{t as b}from"./StatusGlyph-1KgitlUg.js";import{t as x}from"./session-change-summary-api-BbviMo7L.js";import{n as S}from"./PageState-Cz6vFMXv.js";import{a as xe,i as Se,n as Ce,o as we,r as Te,s as Ee,t as De}from"./FeaturePage-CoalHN81.js";import{t as Oe}from"./badge-CWB3lj2H.js";import{a as C,t as ke}from"./session-list-BRMu9JWa.js";var Ae=f(`archive-restore`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h2`,key:`tvwodi`}],[`path`,{d:`M20 8v11a2 2 0 0 1-2 2h-2`,key:`1gkqxj`}],[`path`,{d:`m9 15 3-3 3 3`,key:`1pd0qc`}],[`path`,{d:`M12 12v9`,key:`192myk`}]]),je=f(`folder-closed`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}],[`path`,{d:`M2 10h20`,key:`1ir3d8`}]]),w=e(n(),1),T=864e5;function E(e,t=Date.now()){if(e.pinned)return`pinned`;let n=Date.parse(e.modified||``);if(!Number.isFinite(n))return`earlier`;let r=new Date(t);return r.setHours(0,0,0,0),n>=r.getTime()?`today`:n>=r.getTime()-6*T?`week`:`earlier`}function D(e,t,n=Date.now()){let r=new Map;return e.forEach((e,i)=>{let a=E(e,n),o=r.get(a)??{key:a,count:0,items:[]};o.count+=1,i<t&&o.items.push(e),r.set(a,o)}),[...r.values()].filter(e=>e.items.length>0)}function Me(e,t,n,r=`active`,i=Date.now()){let a=t.trim().toLowerCase(),o=a?e.filter(e=>`${e.name||``} ${e.firstMessage||``} ${e.cwd||``} ${e.model||``}`.toLowerCase().includes(a)):e.filter(e=>!!e.archived==(r===`archived`)),s=C(o),c=s.slice(0,Math.max(0,n));return{total:o.length,items:c,groups:D(s,c.length,i)}}var O=r();function Ne({sessionId:e,lastCompletedAt:t,streaming:n}){let{t:r}=i(),a=(0,w.useRef)(null),[s,c]=(0,w.useState)(!1);(0,w.useEffect)(()=>{let e=a.current;if(!e||s)return;if(!(`IntersectionObserver`in window)){c(!0);return}let t=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&(c(!0),t.disconnect())},{rootMargin:`120px`});return t.observe(e),()=>t.disconnect()},[s]);let{data:l}=o({queryKey:[`session-change-summary`,e,t],queryFn:()=>x(e),enabled:s,staleTime:6e4,retry:0,refetchInterval:n&&s?2e4:!1});return l?.status!==`known`||!l.changedFiles?(0,O.jsx)(`span`,{ref:a}):(0,O.jsx)(`span`,{ref:a,className:`ml-1 inline-flex items-center gap-1 tabular-nums before:mr-1 before:content-['·']`,children:r(`chat:chatHistoryPage.changeSummary`,{count:l.changedFiles,added:l.added||0,removed:l.removed||0})})}function k(e){s.setQueryData(u,t=>t&&{...t,sessions:e(t.sessions||[])})}function A({navigate:e,onBack:n,onNewTask:r,notify:s,requestConfirm:u,requestText:f}){let{t:x,language:T}=i(),E=ee(),D=ge(`focusSearch`),[A,j]=(0,w.useState)(``),M=o(l(`sessions`)),N=(0,w.useMemo)(()=>C(M.data?.sessions||[]),[M.data]),[P,Pe]=(0,w.useState)(`active`),F=`${P}\0${A}`,[I,L]=(0,w.useState)({filterKey:F,count:50}),R=(0,w.useRef)(!1),z=(0,w.useRef)(null),[B,V]=(0,w.useState)(()=>t.getItem(a.activeSession)||``),[Fe,H]=(0,w.useState)(!1),[U,W]=(0,w.useState)(``),G=M.isPending||Fe,K=M.error&&!M.data?M.error instanceof Error?M.error.message:String(M.error):``;(0,w.useEffect)(()=>{L(e=>e.filterKey===F&&e.count===50?e:{filterKey:F,count:50})},[F]);let q=(0,w.useCallback)(async()=>{H(!0),W(``);try{await c(`sessions`,!0)}catch(e){W(e instanceof Error?e.message:String(e))}finally{H(!1)}},[]);(0,w.useEffect)(()=>(document.title=`${x(`chat:chatHistoryPage.chatHistory`)} · ${m}`,()=>{document.title=m}),[x]),(0,w.useEffect)(()=>{let e=e=>V(e.detail?.id||t.getItem(a.activeSession)||``);return window.addEventListener(v,e),()=>window.removeEventListener(v,e)},[]);let J=I.filterKey===F?I.count:50,Y=(0,w.useMemo)(()=>Me(N,A,J,P),[P,A,N,J]),X=N.filter(e=>e.archived).length,Z={active:N.length-X,archived:X},Ie={pinned:x(`chat:chatHistoryPage.groupPinned`),today:x(`chat:chatHistoryPage.groupToday`),week:x(`chat:chatHistoryPage.groupWeek`),earlier:x(`chat:chatHistoryPage.groupEarlier`)};(0,w.useEffect)(()=>{R.current&&(R.current=!1,z.current?.focus())},[Y.items.length,Y.total]);let Le=t=>{he(t),e(`chat`)},Re=async e=>{let t=await f({title:x(`chat:chatHistoryPage.renameChat`),inputLabel:x(`chat:chatHistoryPage.chatTitle`),value:e.name,confirmLabel:x(`chat:chatHistoryPage.save`)});if(t!==null&&t!==e.name)try{let n=await d(`/api/sessions/${encodeURIComponent(e.id)}`,{method:`PATCH`,body:JSON.stringify({name:t})});k(t=>t.map(t=>t.id===e.id?{...t,name:n.name}:t)),y({id:e.id,name:n.name}),s(x(`chat:chatHistoryPage.chatTitleUpdated`))}catch(e){W(e instanceof Error?e.message:String(e))}},Q=async(e,t,n)=>{try{let r=await _e(e.id,t);k(e=>ke(e,r)),s(n)}catch(e){W(e instanceof ve?x(`chat:chatHistoryPage.sessionUpdateFailed`):e instanceof Error?e.message:String(e))}},ze=async e=>{if(await u({title:x(`chat:chatHistoryPage.deleteChat`),message:x(`chat:chatHistoryPage.deleteChatNameThisAlsoRemovesLocalChatHistory`,{name:e.name}),confirmLabel:x(`chat:chatHistoryPage.delete`)}))try{await d(`/api/sessions/${encodeURIComponent(e.id)}`,{method:`DELETE`});let n=N.filter(t=>t.id!==e.id);if(k(t=>t.filter(t=>t.id!==e.id)),B===e.id){let e=n[0]?.id||``;V(e),e?t.setItem(a.activeSession,e):t.removeItem(a.activeSession),me(e)}y({deletedIds:[e.id]}),s(x(`chat:chatHistoryPage.chatDeleted`))}catch(e){W(e instanceof Error?e.message:String(e))}},Be=e=>e.streaming?(0,O.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 text-content-secondary`,children:[(0,O.jsx)(b,{status:`run`,className:`size-3.5`}),x(`chat:chatHistoryPage.statusRunning`)]}):e.needsAttention?(0,O.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 font-medium text-warning-strong`,children:[(0,O.jsx)(b,{status:`attention`,className:`size-3.5`}),e.attentionReason===`failure`?x(`chat:chatHistoryPage.statusFailed`):e.attentionReason===`approval`?x(`chat:chatHistoryPage.statusApproval`):x(`chat:chatHistoryPage.needsAttention`)]}):null,$=x(`chat:chatHistoryPage.chatHistory`),Ve=A?x(`chat:chatHistoryPage.noMatchingConversations`):P===`archived`?x(`chat:chatHistoryPage.noArchivedChats`):N.length?x(`chat:chatHistoryPage.noActiveChats`):x(`chat:chatHistoryPage.noConversationsHaveLeftAnEchoYet`),He=A?x(`chat:chatHistoryPage.tryADifferentSearch`):P===`archived`?x(`chat:chatHistoryPage.archivedChatsAppearHere`):N.length?x(`chat:chatHistoryPage.restoreArchivedChats`):x(`chat:chatHistoryPage.onceAConversationBeginsItWillBeQuietlyGatheredHere`);return(0,O.jsx)(Te,{title:$,description:x(`chat:chatHistoryPage.lede`),back:n&&{label:x(`navigation:sidebar.features`),ariaLabel:x(`navigation:shell.backToFeaturesLabel`),onBack:n},toolbar:(0,O.jsx)(Ee,{search:(0,O.jsx)(xe,{id:ce,value:A,onValueChange:j,placeholder:x(`navigation:pageHeader.searchPage`,{page:$}),shortcut:D,clearLabel:x(`navigation:more.clearSearch`)}),actions:r&&!E&&(0,O.jsxs)(_,{type:`button`,className:`h-9`,onClick:r,children:[(0,O.jsx)(oe,{}),x(`navigation:shell.newTask`)]}),filters:(0,O.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-4 gap-y-2`,children:[(0,O.jsx)(`div`,{role:`group`,"aria-label":x(`chat:chatHistoryPage.historySections`),className:`inline-grid h-8 grid-cols-2 rounded-md border border-stroke bg-chrome p-[3px] max-[650px]:h-auto max-[650px]:flex-1 max-[650px]:rounded-[10px] pointer-coarse:h-auto`,children:[`active`,`archived`].map(e=>(0,O.jsxs)(`button`,{type:`button`,"aria-pressed":P===e,"aria-label":e===`active`?x(`chat:chatHistoryPage.activeChatsCount`,{count:Z.active}):x(`chat:chatHistoryPage.archivedChats`,{count:Z.archived}),className:g(`inline-flex min-w-0 items-center justify-center gap-1.5 rounded-sm border border-transparent px-3 text-sm text-content-secondary transition-colors duration-(--d-fast) hover:text-content max-[650px]:h-11 max-[650px]:text-base pointer-coarse:h-11`,P===e&&`border-key-border bg-key font-medium text-content shadow-key`),onClick:()=>Pe(e),children:[x(e===`active`?`chat:chatHistoryPage.activeChats`:`chat:chatHistoryPage.archived`),(0,O.jsx)(`span`,{className:g(`text-xs font-normal tabular-nums`,P===e?`text-content-secondary`:`text-content-muted`),children:Z[e]})]},e))}),(0,O.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1 text-xs text-content-muted tabular-nums`,children:[(0,O.jsxs)(`span`,{className:g(`truncate`,!A&&`max-[650px]:hidden`),children:[x(`chat:chatHistoryPage.countChatHistoryItems`,{count:N.length}),` · `,A?x(`chat:chatHistoryPage.countCurrentlyFiltered`,{count:Y.total}):x(`chat:chatHistoryPage.sortedByMostRecentlyUpdated`)]}),(0,O.jsx)(_,{variant:`ghost`,size:`icon-sm`,className:`text-content-muted max-[650px]:size-11 pointer-coarse:size-11`,"aria-label":x(`chat:chatHistoryPage.refresh`),title:x(`chat:chatHistoryPage.refresh`),onClick:()=>void q(),disabled:G,children:G?(0,O.jsx)(pe,{className:`text-current`}):(0,O.jsx)(ae,{size:14})})]})]})}),children:G&&!N.length?(0,O.jsx)(S,{kind:`loading`,title:x(`chat:chatHistoryPage.loadingChatHistory`)}):K&&!N.length?(0,O.jsx)(S,{kind:`error`,title:x(`chat:chatHistoryPage.loadFailed`),description:K,action:(0,O.jsx)(_,{variant:`secondary`,className:`max-[650px]:h-11`,loading:G,disabled:G,onClick:()=>void q(),children:x(`common:pageTemplate.retry`)})}):(0,O.jsxs)(O.Fragment,{children:[(U||K)&&(0,O.jsx)(De,{children:U||K}),Y.total?(0,O.jsxs)(`div`,{className:`chat-history-list`,children:[Y.groups.map(e=>(0,O.jsx)(we,{title:Ie[e.key],count:e.count,children:(0,O.jsx)(Ce,{children:e.items.map(e=>{let t=e.name||x(`chat:chatHistoryPage.untitledChat`),n=e.model&&!/(^|\/)unknown$/i.test(String(e.model))?String(e.model).split(`/`).at(-1):``,r=e.id===B;return(0,O.jsx)(Se,{"data-history-session":e.id,"data-current":r||void 0,className:g(`chat-history-row relative`,r&&`after:absolute after:top-3.5 after:bottom-3.5 after:-left-3 after:w-[3px] after:rounded-r-[3px] after:bg-star max-[650px]:after:-left-2.5`),onOpen:()=>Le(e.id),openLabel:x(`chat:chatHistoryPage.openChatNamed`,{name:t}),name:(0,O.jsxs)(`span`,{className:`chat-history-copy inline-flex max-w-full min-w-0 items-center gap-2`,children:[e.unread&&(0,O.jsx)(`span`,{role:`img`,"aria-label":x(`chat:chatHistoryPage.unread`),className:`size-1.5 shrink-0 rounded-full bg-ink`}),e.pinned&&(0,O.jsx)(p,{className:`size-3.5 shrink-0 text-content-muted`,"aria-hidden":`true`}),(0,O.jsx)(`strong`,{"data-history-name":!0,className:`min-w-0 truncate font-medium`,title:t,children:t})]}),description:(0,O.jsx)(`span`,{className:g(`line-clamp-1`,e.firstMessage?`text-content-secondary`:void 0),children:e.firstMessage||x(`chat:chatHistoryPage.noMessageSummary`)}),meta:(0,O.jsxs)(O.Fragment,{children:[Be(e),e.archived&&A.trim()&&(0,O.jsx)(Oe,{children:x(`chat:chatHistoryPage.archived`)}),(0,O.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-1 font-mono`,children:[(0,O.jsx)(je,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),(0,O.jsx)(`span`,{className:`truncate`,children:be(e.projectless?``:e.cwd,T)})]}),(0,O.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,O.jsx)(`span`,{className:`shrink-0 tabular-nums`,children:x(`chat:chatHistoryPage.countMessages`,{count:e.messageCount||0})}),n&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`span`,{"aria-hidden":`true`,className:`max-[650px]:hidden`,children:`·`}),(0,O.jsx)(`span`,{className:`min-w-0 truncate font-mono max-[650px]:hidden`,children:n})]}),(0,O.jsx)(Ne,{sessionId:e.id,lastCompletedAt:e.lastCompletedAt,streaming:e.streaming})]}),status:(0,O.jsx)(`time`,{dateTime:e.modified,children:ye(e.modified,T)}),actions:(0,O.jsxs)(fe,{children:[(0,O.jsx)(ue,{asChild:!0,children:(0,O.jsx)(_,{type:`button`,variant:`ghost`,size:`icon`,className:`size-8 shrink-0 text-content-muted max-[650px]:size-11 pointer-coarse:size-11`,"aria-label":x(`chat:chatHistoryPage.moreActionsForChat`,{name:t}),children:(0,O.jsx)(ne,{size:16})})}),(0,O.jsxs)(de,{align:`end`,className:`min-w-48`,children:[(0,O.jsxs)(h,{className:`min-h-11`,onSelect:()=>void Re(e),children:[(0,O.jsx)(re,{}),x(`chat:chatHistoryPage.renameChat`)]}),(0,O.jsxs)(h,{className:`min-h-11`,onSelect:()=>void Q(e,{pinned:!e.pinned},e.pinned?x(`chat:chatHistoryPage.unpinned`):x(`chat:chatHistoryPage.pinned`)),children:[e.pinned?(0,O.jsx)(ie,{}):(0,O.jsx)(p,{}),e.pinned?x(`chat:chatHistoryPage.unpin`):x(`chat:chatHistoryPage.pin`)]}),(0,O.jsxs)(h,{className:`min-h-11`,onSelect:()=>void Q(e,{archived:!e.archived},e.archived?x(`chat:chatHistoryPage.restored`):x(`chat:chatHistoryPage.movedToArchive`)),children:[e.archived?(0,O.jsx)(Ae,{}):(0,O.jsx)(te,{}),e.archived?x(`chat:chatHistoryPage.restore`):x(`chat:chatHistoryPage.archive`)]}),e.unread&&(0,O.jsx)(h,{className:`min-h-11`,onSelect:()=>void Q(e,{read:!0},x(`chat:chatHistoryPage.markedRead`)),children:x(`chat:chatHistoryPage.markRead`)}),(0,O.jsx)(le,{}),(0,O.jsxs)(h,{variant:`destructive`,className:`min-h-11`,onSelect:()=>void ze(e),children:[(0,O.jsx)(se,{}),x(`chat:chatHistoryPage.deleteChat`)]})]})]})},e.id)})})},e.key)),Y.total>50&&(0,O.jsx)(`div`,{className:`flex justify-center pt-4`,children:Y.total>Y.items.length?(0,O.jsx)(_,{type:`button`,variant:`secondary`,className:`tabular-nums max-[650px]:min-h-11 pointer-coarse:min-h-11`,onClick:()=>{let e=J+50;R.current=e>=Y.total,L({filterKey:F,count:e})},children:x(`chat:chatHistoryPage.loadMoreChats`,{shown:Y.items.length,total:Y.total})}):(0,O.jsx)(`p`,{ref:z,tabIndex:-1,role:`status`,className:`py-2 text-xs text-content-muted tabular-nums`,children:x(`chat:chatHistoryPage.allChatsShown`,{count:Y.total})})})]}):(0,O.jsx)(S,{kind:`empty`,title:Ve,description:He})]})})}export{A as ChatHistoryPage};