pisper 0.6.18 → 0.6.19

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 +566 -562
  3. package/web/assets/{AppDialog-BhRRstHP.js → AppDialog-Bq_kuweh.js} +1 -1
  4. package/web/assets/{AppOverlays-DYb88MMF.js → AppOverlays-C6-uz2I7.js} +1 -1
  5. package/web/assets/{AssetsPage-jmEL7H4K.js → AssetsPage-nWK-SI9U.js} +1 -1
  6. package/web/assets/{BoardPage-Cq1A97SF.js → BoardPage-BdI3hfz8.js} +3 -3
  7. package/web/assets/{ChannelsPage-C6Ep15_G.js → ChannelsPage-CP8J3G-V.js} +1 -1
  8. package/web/assets/{ChatAppearancePage-D9mtbLrb.js → ChatAppearancePage-Cr8N98HJ.js} +1 -1
  9. package/web/assets/{ChatHistoryPage-Bb2dxbsW.js → ChatHistoryPage-9AWN-55B.js} +1 -1
  10. package/web/assets/{ChatPage-B19Ofy-n.js → ChatPage-Bl94kmVS.js} +4 -4
  11. package/web/assets/ConfigPage-CU_oPhEG.js +5 -0
  12. package/web/assets/{DesktopWindowControls-B0tf8G6E.js → DesktopWindowControls-CoqP7BM1.js} +1 -1
  13. package/web/assets/{FeaturePage-C6p1tTYM.js → FeaturePage-C6kLKix5.js} +1 -1
  14. package/web/assets/{FileAttachmentPreview-Goie7m39.js → FileAttachmentPreview-C4qvBJGC.js} +1 -1
  15. package/web/assets/{FloatingWidgets-BkJUNE2R.js → FloatingWidgets-DSbRqMGT.js} +1 -1
  16. package/web/assets/{FocusRuntimeControls-DDhn5O0c.js → FocusRuntimeControls-DlBh7Vqg.js} +1 -1
  17. package/web/assets/{GitDiffViewer-lLjb8Z6c.js → GitDiffViewer-DGkjG02b.js} +1 -1
  18. package/web/assets/{ManageProjectsDialog-BcL3O5JH.js → ManageProjectsDialog-BFiDAKW5.js} +1 -1
  19. package/web/assets/{MarkdownMessage-IIGDT1-_.js → MarkdownMessage-BiGbYY8R.js} +1 -1
  20. package/web/assets/{McpPage-Om-chXna.js → McpPage-myrbtgSi.js} +1 -1
  21. package/web/assets/{MemoryPage-DKVTRhDw.js → MemoryPage-BhKLCAgT.js} +1 -1
  22. package/web/assets/{MobileNavigation-Bg8R2cAv.js → MobileNavigation-BrLK8gc5.js} +1 -1
  23. package/web/assets/{MorePage-BBtrzGN0.js → MorePage-B6UzpykD.js} +1 -1
  24. package/web/assets/{NewFolderDialog-Ck4pp3Fu.js → NewFolderDialog-CdALMU5C.js} +1 -1
  25. package/web/assets/{PageHeader-Cyw_6Kw4.js → PageHeader-CpubVScP.js} +1 -1
  26. package/web/assets/{PhoneDrawer-CDhCPbxZ.js → PhoneDrawer-BapKZhl9.js} +1 -1
  27. package/web/assets/{PhoneMenuButton-B16JL5aU.js → PhoneMenuButton-WhIGM1zy.js} +1 -1
  28. package/web/assets/{PhoneTopBar-DU84Aa4w.js → PhoneTopBar-CjMeneXU.js} +1 -1
  29. package/web/assets/{PluginsPage-DjW7wlaR.js → PluginsPage-BEpVVSAC.js} +1 -1
  30. package/web/assets/{SafeModePrompt-CaBwfnSU.js → SafeModePrompt-HogcxEdk.js} +1 -1
  31. package/web/assets/{SchedulesPage-DGWSRJUO.js → SchedulesPage-ML5Sl4S4.js} +1 -1
  32. package/web/assets/{SessionBrowserPane-DUf0kx2D.js → SessionBrowserPane-DOmbqdHK.js} +2 -2
  33. package/web/assets/{SessionContextPanel-isXy-27d.js → SessionContextPanel-guilbPz7.js} +2 -2
  34. package/web/assets/{SessionHome-2PhdOYt0.js → SessionHome-BLhLJsZO.js} +1 -1
  35. package/web/assets/{SessionInspector-Cj6sDpI6.js → SessionInspector-DewgkKy9.js} +1 -1
  36. package/web/assets/{SessionShell-rjmSVZ_E.js → SessionShell-CMGzYCcG.js} +1 -1
  37. package/web/assets/{SettingsSidebar-h5Sax-cP.js → SettingsSidebar-BKdrNAvp.js} +1 -1
  38. package/web/assets/{ShortcutHelpDialog-D7ev01fF.js → ShortcutHelpDialog-DgQKobJy.js} +1 -1
  39. package/web/assets/{ShortcutKeys-DZsAbYeO.js → ShortcutKeys-B1HCKuqe.js} +1 -1
  40. package/web/assets/{SidebarUpdateStatus-B_NGjvl5.js → SidebarUpdateStatus-DtpsclSa.js} +1 -1
  41. package/web/assets/{SkillsPage-C2DnxWvu.js → SkillsPage-JwfOUart.js} +1 -1
  42. package/web/assets/{TaskProcessesPane-C2PtU4pC.js → TaskProcessesPane-CUUFhziU.js} +1 -1
  43. package/web/assets/{TaskTerminalView-D2TmMooE.js → TaskTerminalView-BgxdaUIZ.js} +1 -1
  44. package/web/assets/{TerminalPanel-CYY36HpY.js → TerminalPanel-B4VMm8q_.js} +1 -1
  45. package/web/assets/{WebDesktopPet-BlJybmd5.js → WebDesktopPet-C10BvWBl.js} +1 -1
  46. package/web/assets/{WorkflowsPage-Dvy-QIJo.js → WorkflowsPage-iqO_9OJO.js} +1 -1
  47. package/web/assets/{WorkspacePicker-D7djHk7o.js → WorkspacePicker-C0t_ekAf.js} +1 -1
  48. package/web/assets/{api-DHnp1y9B.js → api-Dg-aNpVe.js} +1 -1
  49. package/web/assets/app-update-8hmqlQl6.js +34 -0
  50. package/web/assets/{approval-confirm-D1i--K6V.js → approval-confirm-77ZLTNZI.js} +1 -1
  51. package/web/assets/{board-projects-BRJ_-tj0.js → board-projects-CnDn05fw.js} +1 -1
  52. package/web/assets/bots-store-DE76fA7-.js +1 -0
  53. package/web/assets/{chat-api-BdMPDpVE.js → chat-api-Dy5Hkicx.js} +1 -1
  54. package/web/assets/{client-store-DpQBjfeA.js → client-store-DF9a8Ka9.js} +1 -1
  55. package/web/assets/{config-search-DLn9UUQp.js → config-search-BA9qWX5h.js} +1 -1
  56. package/web/assets/{dialog-CVn9vhfy.js → dialog-CtFjznlx.js} +1 -1
  57. package/web/assets/{events-BphhtnIg.js → events-D0dbOYFR.js} +1 -1
  58. package/web/assets/{folder-paths-DDMQoUvb.js → folder-paths-DEFkIxr2.js} +1 -1
  59. package/web/assets/{hosts-D-ceNbyz.js → hosts-BBCDdN-M.js} +1 -1
  60. package/web/assets/i18n-CyyEaQdX.js +1 -0
  61. package/web/assets/index-DsXdZRdL.js +2 -0
  62. package/web/assets/{mobile-remote-fallback-DG_urwIg.js → mobile-remote-fallback-C2Q0wAa6.js} +1 -1
  63. package/web/assets/mount-app-BDzqFalE.js +9 -0
  64. package/web/assets/{permission-rules-api-DUCXhUyb.js → permission-rules-api-CPImVuda.js} +1 -1
  65. package/web/assets/{pick-system-directory-DzwXQwyO.js → pick-system-directory-B1clvHS6.js} +1 -1
  66. package/web/assets/{placements-C0pW79Hw.js → placements-DNdBLaY4.js} +2 -2
  67. package/web/assets/{popover-BiEbUPyI.js → popover-DN1mndHQ.js} +1 -1
  68. package/web/assets/{public-CkPP4ohL.js → public-CNoWpIiC.js} +1 -1
  69. package/web/assets/public-CUO7iS84.js +3 -0
  70. package/web/assets/{public-B9twcm-g.js → public-Cec32eBv.js} +2 -2
  71. package/web/assets/{public-components-CH3p1KVx.js → public-components-BpHOXPbD.js} +1 -1
  72. package/web/assets/public-diff-A9crjZfM.js +1 -0
  73. package/web/assets/public-events-iJAi2TnD.js +1 -0
  74. package/web/assets/{public-flags-Dr1Hy9R7.js → public-flags-BYEBqRMd.js} +1 -1
  75. package/web/assets/public-session-DM4y_qrY.js +1 -0
  76. package/web/assets/{public-sidebar-BGyKRJQ1.js → public-sidebar-Ce5o13yN.js} +1 -1
  77. package/web/assets/{runtime-capabilities-store-CHtOHvCw.js → runtime-capabilities-store-B5Bam7pC.js} +1 -1
  78. package/web/assets/{safe-mode-instance-DofnjrC0.js → safe-mode-instance-CJE36ukZ.js} +1 -1
  79. package/web/assets/safe-mode-sentinel-AmgPcPSa.js +1 -0
  80. package/web/assets/{session-change-summary-api-yVYBTolj.js → session-change-summary-api-CTAw_Fpq.js} +1 -1
  81. package/web/assets/{session-home-YfyPoMc5.js → session-home-BrU5Pj9S.js} +1 -1
  82. package/web/assets/{session-organization-api-BVv-S3ZA.js → session-organization-api-I4CSVACP.js} +1 -1
  83. package/web/assets/{session-scope-Cm9JGWmN.js → session-scope-7eIXCeDX.js} +1 -1
  84. package/web/assets/{session-tree-actions-BDCY5Rx_.js → session-tree-actions-CnUc7KFV.js} +1 -1
  85. package/web/assets/{session-tree-summary-C9jUUk8v.js → session-tree-summary-C224W_G6.js} +1 -1
  86. package/web/assets/{shortcuts-DDYN6uA3.js → shortcuts-LBxOVau1.js} +1 -1
  87. package/web/assets/{side-chat-context-BydqtUQh.js → side-chat-context-hRj7FqXK.js} +4 -4
  88. package/web/assets/sidebar-rMS3pmrQ.js +1 -0
  89. package/web/assets/{sidebar-store-C9_zt4qH.js → sidebar-store-BGW5sD2q.js} +1 -1
  90. package/web/assets/{speech-session-hLbzKBi7.js → speech-session-DTzw8niM.js} +1 -1
  91. package/web/assets/{startup-queries-Xtw8990R.js → startup-queries-qM8tclDJ.js} +1 -1
  92. package/web/assets/{storage-DH3bQdy6.js → storage-8QW6lXuT.js} +1 -1
  93. package/web/assets/{use-i18n-vlX9sewC.js → use-i18n-BuN5i-jP.js} +1 -1
  94. package/web/assets/use-open-bot-J8_CcQDt.js +1 -0
  95. package/web/assets/{use-studio-actions-Ddn1B4ZD.js → use-studio-actions-kEfc-Vr2.js} +1 -1
  96. package/web/assets/{useCatalogProjects-CKn9xBk7.js → useCatalogProjects-MO_MVlJu.js} +1 -1
  97. package/web/assets/{useNewProjectPicker-Dw_8vCGy.js → useNewProjectPicker-B5OQ8T-2.js} +2 -2
  98. package/web/assets/{useNow-Bk2SSqyl.js → useNow-ChT5op7P.js} +1 -1
  99. package/web/assets/{usePhoneShell-B1bMHq-t.js → usePhoneShell-Bkus67DO.js} +1 -1
  100. package/web/assets/{useSessionListQuery-Cmk9SaUf.js → useSessionListQuery-DdFrJGiI.js} +1 -1
  101. package/web/assets/{useSessionRowActions-DTh4fGVy.js → useSessionRowActions-CTYVP4el.js} +1 -1
  102. package/web/assets/{useSidebarModel-BFdUhpkM.js → useSidebarModel-BdWaL9Nn.js} +1 -1
  103. package/web/assets/{web-preview-C1xJDZhi.js → web-preview-DUIdcsL2.js} +1 -1
  104. package/web/assets/{web-preview-events-ottFBnUt.js → web-preview-events-4X_JU_UG.js} +1 -1
  105. package/web/assets/{workspace-order-store-_L6d1CWV.js → workspace-order-store-DlMf7MI6.js} +1 -1
  106. package/web/index.html +1 -1
  107. package/web/assets/ConfigPage-BZ90fSaF.js +0 -5
  108. package/web/assets/app-update-DPLsLaqu.js +0 -34
  109. package/web/assets/bots-store-BKZ5Va82.js +0 -1
  110. package/web/assets/i18n-D9cWCJjW.js +0 -1
  111. package/web/assets/index-DyGV2tpp.js +0 -2
  112. package/web/assets/mount-app-BJQPFzwJ.js +0 -9
  113. package/web/assets/public-D2ntc_xA.js +0 -3
  114. package/web/assets/public-diff-XnD8EDdH.js +0 -1
  115. package/web/assets/public-events-DmOklOQk.js +0 -1
  116. package/web/assets/public-session-CciAMmQg.js +0 -1
  117. package/web/assets/safe-mode-sentinel-CbERYZVc.js +0 -1
  118. package/web/assets/sidebar-BI_BMhyF.js +0 -1
  119. package/web/assets/use-open-bot-wY6Uo4E-.js +0 -1
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{t as r}from"./use-i18n-vlX9sewC.js";import{t as i}from"./api-DHnp1y9B.js";import{t as a}from"./createLucideIcon-Cd-3GVxJ.js";import{t as o}from"./check-2vYc6QaP.js";import{t as s}from"./file-code-corner-BnE1ljT0.js";import{t as c}from"./info-DATxy0fb.js";import{t as l}from"./pencil-U08v_vV9.js";import{t as u}from"./plus-fQbSqB1n.js";import{t as d}from"./refresh-cw-TbWxTY4K.js";import{t as f}from"./sparkles-S_eeuqn9.js";import{t as p}from"./trash-2-CNrPOoPR.js";import{t as m}from"./x-07u4-129.js";import{t as h}from"./more-pages-D_PnxLN0.js";import{i as ee,n as g,t as te}from"./tooltip-D4MFbqcG.js";import{t as ne}from"./utils-C8uzG5AZ.js";import{n as _,t as v}from"./button-CCcCN8tE.js";import{s as y}from"./shortcuts-DDYN6uA3.js";import{t as b}from"./input-CPw-zkYh.js";import{t as x}from"./textarea-DmATpOqT.js";import{n as S,r as re,t as ie}from"./PageState-Cz6vFMXv.js";import{a as ae,i as oe,n as se,o as ce,r as le,s as ue,t as de}from"./FeaturePage-C6p1tTYM.js";import{n as C}from"./field-DoLEb0np.js";import{t as w}from"./AppSelect-BD6RAaJ5.js";import{c as fe,i as pe,n as T,t as me}from"./app-primitives-Drz_SjnR.js";var E=a(`zoom-out`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),D=a(`zoom-in`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`11`,x2:`11`,y1:`8`,y2:`14`,key:`1vmskp`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),O=e(t(),1);function he(e={}){let{rootMargin:t=`96px 0px`,threshold:n=0}=e,[r,i]=(0,O.useState)(null),[a,o]=(0,O.useState)(()=>!document.hidden),[s,c]=(0,O.useState)(!0),l=(0,O.useCallback)(e=>{i(e)},[]);return(0,O.useEffect)(()=>{let e=()=>o(!document.hidden);return e(),document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]),(0,O.useEffect)(()=>{if(!r||typeof IntersectionObserver>`u`)return;let e=new IntersectionObserver(([e])=>{e&&c(e.isIntersecting)},{rootMargin:t,threshold:n});return e.observe(r),()=>e.disconnect()},[r,t,n]),{ref:l,playing:a&&s}}var k=n(),A={width:600,height:420,cx:300,cy:206},ge=24,_e=Math.PI*(3-Math.sqrt(5));function ve({type:e}){return(0,k.jsx)(`i`,{"aria-hidden":`true`,className:`g-dot g-${e} inline-block size-2 shrink-0 rounded-full ring-1 ring-stroke`,style:{background:j[e]}})}var j={concept:`var(--g-concept)`,file:`var(--g-file)`,risk:`var(--g-risk)`,preference:`var(--g-preference)`,decision:`var(--g-decision)`,fact:`var(--g-fact)`,task:`var(--g-task)`},ye={concept:`var(--g-concept-glow)`,file:`var(--g-file-glow)`,risk:`var(--g-risk-glow)`,preference:`var(--g-preference-glow)`,decision:`var(--g-decision-glow)`,fact:`var(--g-fact-glow)`,task:`var(--g-task-glow)`};function M(e){let t=0;for(let n=0;n<e.length;n+=1)t=t*31+e.charCodeAt(n)>>>0;return t}function N(e,t){let n=e.slice(0,ge);if(!n.length)return[];if(n.length===1)return[{node:n[0],x:A.cx,y:A.cy,twinkle:0}];let r=M(t||`galaxy`)%628/100,i=172/Math.sqrt(n.length);return n.map((e,t)=>{let n=M(e.id),a=t*_e+r,o=i*Math.sqrt(t+.55)+n%11-5;return{node:e,x:A.cx+Math.cos(a)*o*1.38,y:A.cy+Math.sin(a)*o*.74,twinkle:n%50/10}})}function P(e,t,n){let r=t.x-e.x,i=t.y-e.y,a=Math.hypot(r,i)||1,o=Math.min(24,a*.16)*(n%2==0?1:-1),s=(e.x+t.x)/2-i/a*o,c=(e.y+t.y)/2+r/a*o;return`M ${e.x.toFixed(1)} ${e.y.toFixed(1)} Q ${s.toFixed(1)} ${c.toFixed(1)} ${t.x.toFixed(1)} ${t.y.toFixed(1)}`}function be({nodes:e,links:t,spaceId:n,selectedId:i,loading:a,onSelect:o,onAdd:s}){let{t:c}=r(),[l,d]=(0,O.useState)(1),[f,p]=(0,O.useState)(``),m=(0,O.useRef)(null),h=(0,O.useRef)(0),{ref:ee,playing:g}=he(),te=(0,O.useCallback)(e=>{m.current=e,ee(e)},[ee]),ne=g?``:`[&:before]:[animation-play-state:paused]! [&:after]:[animation-play-state:paused]! [&_*]:[animation-play-state:paused]! [&_*:before]:[animation-play-state:paused]! [&_*:after]:[animation-play-state:paused]!`,_=e=>{if(!g)return;let t=m.current;if(!t)return;let n=t.getBoundingClientRect(),r=((e.clientX-n.left)/n.width-.5)*2,i=((e.clientY-n.top)/n.height-.5)*2;cancelAnimationFrame(h.current),h.current=requestAnimationFrame(()=>{t.style.setProperty(`--px`,r.toFixed(3)),t.style.setProperty(`--py`,i.toFixed(3))})},v=()=>{cancelAnimationFrame(h.current),m.current?.style.setProperty(`--px`,`0`),m.current?.style.setProperty(`--py`,`0`)};(0,O.useEffect)(()=>{g||(cancelAnimationFrame(h.current),h.current=0)},[g]),(0,O.useEffect)(()=>{let e=m.current?.querySelector(`svg`);e&&(g?e.unpauseAnimations():e.pauseAnimations())},[g]);let y=(0,O.useMemo)(()=>N(e,n),[e,n]),b=(0,O.useMemo)(()=>new Map(y.map(e=>[e.node.id,e])),[y]),x=(0,O.useMemo)(()=>{let e=new Set(y.map(e=>e.node.id));return t.filter(t=>e.has(t.sourceId)&&e.has(t.targetId))},[y,t]),S=f||i,ie=new Set(t.flatMap(e=>e.sourceId===S?[e.targetId]:e.targetId===S?[e.sourceId]:[]));return(0,k.jsxs)(me,{className:`graph-panel before:[content:''] before:absolute before:z-[0] before:inset-0 before:pointer-events-none before:bg-[url('/memory-galaxy-background.webp')] before:[background-position:center_48%] before:[background-size:cover] before:bg-no-repeat before:[filter:saturate(.62)_contrast(1.08)] before:[mix-blend-mode:screen] before:opacity-[.42] after:[content:''] after:absolute after:z-[0] after:inset-0 after:pointer-events-none after:[background-image:radial-gradient(var(--galaxy-dot)_.9px,transparent_1.2px),_radial-gradient(var(--galaxy-dot-dim)_.8px,transparent_1.2px),_radial-gradient(var(--galaxy-dot)_1.2px,transparent_1.6px)] after:[background-position:0_0,_37px_53px,_71px_19px] after:[background-size:96px_96px,_152px_152px,_236px_236px] after:[animation:galaxy-field-twinkle_6.4s_ease-in-out_infinite] after:opacity-[.7] before:inset-[-8%] before:[animation:galaxy-background-drift_34s_ease-in-out_infinite_alternate] before:[will-change:transform] after:[animation:galaxy-field-drift_15s_ease-in-out_infinite_alternate] after:[will-change:background-position,opacity] max-[650px]:min-h-[430px] relative min-h-[500px] overflow-hidden [border-color:var(--galaxy-border)] bg-[var(--galaxy-bg)]! [background-image:radial-gradient(ellipse_46%_40%_at_50%_48%,_var(--galaxy-core),_transparent_72%),_radial-gradient(ellipse_62%_48%_at_16%_6%,_var(--galaxy-nebula-a),_transparent_70%),_radial-gradient(ellipse_56%_52%_at_88%_98%,_var(--galaxy-nebula-b),_transparent_72%)] p-0 backdrop-blur-none! galaxy-panel ${ne}`,onPointerMove:_,onPointerLeave:v,children:[(0,k.jsxs)(`div`,{className:`graph-toolbar absolute top-2.5 left-2.5 z-[4] flex gap-0.5 rounded-sm border border-[var(--galaxy-toolbar-border)] bg-[var(--galaxy-toolbar-bg)] p-0.5 text-[var(--galaxy-toolbar-text)] [&_button]:grid [&_button]:size-7 [&_button]:place-items-center [&_button]:rounded-xs [&_button]:transition-colors [&_button]:duration-(--d-fast) [&_button:hover]:bg-[var(--galaxy-toolbar-hover)] max-[650px]:[&_button]:size-11 [&_svg]:size-3.5`,children:[(0,k.jsx)(`button`,{type:`button`,title:c(`memory:memoryPage.addMemory`),"aria-label":c(`memory:memoryPage.addMemory`),onClick:s,children:(0,k.jsx)(u,{})}),(0,k.jsx)(`button`,{type:`button`,title:c(`memory:memoryPage.zoomIn`),"aria-label":c(`memory:memoryPage.zoomIn`),onClick:()=>d(e=>Math.min(1.6,Number((e+.15).toFixed(2)))),children:(0,k.jsx)(D,{})}),(0,k.jsx)(`button`,{type:`button`,title:c(`memory:memoryPage.zoomOut`),"aria-label":c(`memory:memoryPage.zoomOut`),onClick:()=>d(e=>Math.max(.7,Number((e-.15).toFixed(2)))),children:(0,k.jsx)(E,{})})]}),(0,k.jsxs)(`div`,{className:`galaxy-stage [&_>_svg]:absolute [&_>_svg]:inset-0 [&_>_svg]:w-full [&_>_svg]:h-full [&_>_svg]:overflow-visible [&_>_svg]:z-[1] [&_>_svg]:[transform:translate3d(calc(var(--px,0)_*_9px),calc(var(--py,0)_*_6px),0)] [&_>_svg]:[transition:transform_.9s_var(--ease-out)] absolute z-[1] inset-0 [transform-origin:50%_50%] [transition:transform_var(--d2)_var(--ease-out)] ${S?`has-focus`:``}`,ref:te,style:{transform:`scale(${l})`},children:[(0,k.jsx)(`i`,{className:`galaxy-spiral absolute z-[0] block pointer-events-none [left:9%] [top:13%] w-[82%] h-[74%] rounded-[50%] bg-[conic-gradient(from_-18deg,transparent_0deg,var(--galaxy-nebula-a)_28deg,transparent_68deg,var(--galaxy-nebula-b)_118deg,transparent_170deg,var(--galaxy-nebula-a)_224deg,transparent_278deg,var(--galaxy-nebula-b)_322deg,transparent_360deg)] [filter:blur(13px)] [mask-image:radial-gradient(ellipse,transparent_0%,transparent_15%,var(--g-star-core)_38%,transparent_74%)] [-webkit-mask-image:radial-gradient(ellipse,transparent_0%,transparent_15%,var(--g-star-core)_38%,transparent_74%)] [mix-blend-mode:screen] opacity-[.38] [animation:galaxy-spiral-turn_42s_linear_infinite] [will-change:transform]`,"aria-hidden":`true`}),(0,k.jsx)(`i`,{className:`galaxy-core absolute z-[0] block pointer-events-none before:[content:''] before:absolute before:left-[50%] before:top-[50%] before:w-[46px] before:h-[46px] before:rounded-[50%] before:bg-[radial-gradient(circle,rgba(255,255,255,.82),rgba(191,219,254,.3)_55%,transparent_76%)] before:[filter:blur(6px)] before:[transform:translate(-50%,-50%)] [left:50%] [top:49%] w-[34%] h-[40%] rounded-[50%] bg-[radial-gradient(ellipse,rgba(219,232,255,.3)_0%,rgba(126,156,255,.15)_36%,transparent_70%)] [filter:blur(9px)] [mix-blend-mode:screen] [transform:translate(-50%,-50%)] [animation:galaxy-core-breathe_7.5s_ease-in-out_infinite] [will-change:transform,opacity]`,"aria-hidden":`true`}),(0,k.jsx)(`i`,{className:`galaxy-aurora absolute z-[0] block pointer-events-none w-[46%] h-[31%] rounded-[50%] [filter:blur(21px)] [mix-blend-mode:screen] opacity-[.42] [will-change:transform,opacity] [left:8%] [top:20%] bg-[radial-gradient(ellipse,var(--galaxy-nebula-a),transparent_70%)] [animation:galaxy-aurora-drift_18s_ease-in-out_infinite_alternate]`,"aria-hidden":`true`}),(0,k.jsx)(`i`,{className:`galaxy-aurora absolute z-[0] block pointer-events-none w-[46%] h-[31%] rounded-[50%] [filter:blur(21px)] [mix-blend-mode:screen] opacity-[.42] [will-change:transform,opacity] [right:5%] [bottom:14%] bg-[radial-gradient(ellipse,var(--galaxy-nebula-b),transparent_70%)] [animation:galaxy-aurora-drift_23s_ease-in-out_-9s_infinite_alternate-reverse]`,"aria-hidden":`true`}),(0,k.jsx)(`i`,{className:`galaxy-aurora absolute z-[0] block pointer-events-none w-[46%] h-[31%] rounded-[50%] [filter:blur(21px)] [mix-blend-mode:screen] opacity-[.42] [will-change:transform,opacity] galaxy-aurora-three left-[30%] top-[60%] !w-[40%] !h-[27%] bg-[radial-gradient(ellipse,var(--galaxy-nebula-c),transparent_70%)] [animation:galaxy-aurora-drift_27s_ease-in-out_-14s_infinite_alternate]`,"aria-hidden":`true`}),(0,k.jsxs)(`svg`,{viewBox:`0 0 600 420`,preserveAspectRatio:`none`,"aria-hidden":`true`,children:[(0,k.jsxs)(`g`,{className:`galaxy-orbits [&_ellipse]:[fill:none] [&_ellipse]:[stroke:var(--galaxy-line)] [&_ellipse]:[stroke-width:.72] [&_ellipse]:[stroke-dasharray:3_7] [&_ellipse]:opacity-[.52] [transform-box:fill-box] [transform-origin:center] [animation:galaxy-orbit-drift_90s_linear_infinite]`,children:[(0,k.jsx)(`ellipse`,{cx:`300`,cy:`206`,rx:`205`,ry:`122`,transform:`rotate(-8 300 206)`}),(0,k.jsx)(`ellipse`,{cx:`300`,cy:`206`,rx:`154`,ry:`88`,transform:`rotate(18 300 206)`}),(0,k.jsx)(`ellipse`,{cx:`300`,cy:`206`,rx:`95`,ry:`54`,transform:`rotate(-24 300 206)`})]}),(0,k.jsx)(`defs`,{children:x.map((e,t)=>{let n=b.get(e.sourceId),r=b.get(e.targetId);return!n||!r?null:(0,k.jsxs)(`linearGradient`,{id:`lg-${t}`,gradientUnits:`userSpaceOnUse`,x1:n.x,y1:n.y,x2:r.x,y2:r.y,children:[(0,k.jsx)(`stop`,{offset:`0`,stopColor:j[n.node.type]||`var(--galaxy-line-active)`}),(0,k.jsx)(`stop`,{offset:`1`,stopColor:j[r.node.type]||`var(--galaxy-line-active)`})]},e.id)})}),x.map((e,t)=>{let n=b.get(e.sourceId),r=b.get(e.targetId);if(!n||!r)return null;let i=e.sourceId===S||e.targetId===S,a=P(n,r,M(e.id));return(0,k.jsxs)(`g`,{children:[(0,k.jsx)(`path`,{className:`link-path [.galaxy-stage_>_svg_&]:[fill:none] [.galaxy-stage_>_svg_&]:[stroke-width:1.05] [.galaxy-stage_>_svg_&]:[stroke-dasharray:3_5] [.galaxy-stage_>_svg_&]:opacity-[.5] [.galaxy-stage_>_svg_&]:[animation:galaxy-link-flow_30s_linear_infinite] [.galaxy-stage_>_svg_&]:[transition:opacity_var(--d2)_var(--ease-out)] [.galaxy-stage_>_svg_&.active]:[stroke-width:1.55] [.galaxy-stage_>_svg_&.active]:[stroke-dasharray:none] [.galaxy-stage_>_svg_&.active]:opacity-100 [.galaxy-stage_>_svg_&.active]:[filter:drop-shadow(0_0_3.5px_var(--galaxy-line-active))] [.galaxy-stage.has-focus_&]:opacity-[.14] [.galaxy-stage.has-focus_&.active]:opacity-100 ${i?`active`:``}`,d:a,stroke:`url(#lg-${t})`}),i&&(0,k.jsx)(`circle`,{className:`link-pulse [.galaxy-stage_>_svg_&]:[fill:var(--g-star-core)] [.galaxy-stage_>_svg_&]:[filter:drop-shadow(0_0_4px_var(--galaxy-line-active))] [.galaxy-stage_>_svg_&]:pointer-events-none`,r:`2.1`,children:(0,k.jsx)(`animateMotion`,{dur:`2.8s`,repeatCount:`indefinite`,path:a})})]},e.id)})]}),(0,k.jsx)(`i`,{className:`galaxy-meteor before:[content:''] before:absolute before:top-[50%] before:left-[1px] before:w-[72px] before:h-[1px] before:bg-[linear-gradient(90deg,transparent,var(--galaxy-dot))] before:[transform:translateY(-50%)] absolute [top:14%] [left:80%] w-[2.4px] h-[2.4px] rounded-[50%] bg-[var(--galaxy-label-active)] shadow-[0_0_7px_1px_var(--galaxy-dot)] opacity-0 pointer-events-none [animation:galaxy-meteor_12s_linear_infinite] z-[3]`,"aria-hidden":`true`}),(0,k.jsx)(`i`,{className:`galaxy-meteor before:[content:''] before:absolute before:top-[50%] before:left-[1px] before:w-[72px] before:h-[1px] before:bg-[linear-gradient(90deg,transparent,var(--galaxy-dot))] before:[transform:translateY(-50%)] absolute [top:14%] [left:80%] w-[2.4px] h-[2.4px] rounded-[50%] bg-[var(--galaxy-label-active)] shadow-[0_0_7px_1px_var(--galaxy-dot)] opacity-0 pointer-events-none [animation:galaxy-meteor_12s_linear_infinite] z-[3] meteor-two [.galaxy-meteor&]:top-[63%] [.galaxy-meteor&]:left-[89%] [.galaxy-meteor&]:[animation:galaxy-meteor-b_17s_linear_4.5s_infinite]`,"aria-hidden":`true`}),(0,k.jsx)(`i`,{className:`galaxy-meteor before:[content:''] before:absolute before:top-[50%] before:left-[1px] before:w-[72px] before:h-[1px] before:bg-[linear-gradient(90deg,transparent,var(--galaxy-dot))] before:[transform:translateY(-50%)] absolute [top:14%] [left:80%] w-[2.4px] h-[2.4px] rounded-[50%] bg-[var(--galaxy-label-active)] shadow-[0_0_7px_1px_var(--galaxy-dot)] opacity-0 pointer-events-none [animation:galaxy-meteor_12s_linear_infinite] z-[3] meteor-three [.galaxy-meteor&]:top-[7%] [.galaxy-meteor&]:left-[36%] [.galaxy-meteor&]:[animation:galaxy-meteor-c_23s_linear_11s_infinite]`,"aria-hidden":`true`}),y.map(({node:e,x:t,y:n,twinkle:r},a)=>(0,k.jsxs)(`button`,{className:`galaxy-star focus-visible:rounded-[50%] focus-visible:[outline-color:var(--galaxy-line-active)] before:[content:''] before:absolute before:w-[calc(var(--star-size)_+_26px)] before:h-[calc(var(--star-size)_+_26px)] before:rounded-[50%] before:bg-[radial-gradient(circle,var(--g-star-glow),transparent_68%)] before:[filter:blur(3px)] before:opacity-[.76] before:pointer-events-none [&.active::after]:[content:''] [&.active::after]:absolute [&.active::after]:w-[calc(var(--star-size)_+_31px)] [&.active::after]:h-[calc(var(--star-size)_+_31px)] [&.active::after]:[border:1px_solid_var(--g-star-glow)] [&.active::after]:rounded-[50%] [&.active::after]:pointer-events-none [&.active::after]:[animation:galaxy-star-selection-pulse_2.3s_var(--ease-out)_infinite] [&:hover::before]:opacity-100 [&.active::before]:opacity-100 absolute z-[2] grid w-[52px] h-[52px] min-w-0 min-h-[52px] place-items-center [transform:translate(-50%,-50%)_translate3d(calc(var(--px,0)_*_(9px_+_var(--depth,0)_*_7px)),calc(var(--py,0)_*_(6px_+_var(--depth,0)_*_5px)),0)] border-0 rounded-[50%] bg-transparent p-0 cursor-pointer [transition:transform_.9s_var(--ease-out),opacity_.45s_var(--ease-out),filter_.45s_var(--ease-out)] [animation:galaxy-star-enter_.72s_var(--ease-out)_var(--enter-delay,0ms)_backwards] ${i===e.id?`active`:``} ${S&&e.id!==S&&!ie.has(e.id)?`dimmed [.galaxy-stage.has-focus_.galaxy-star&]:opacity-[.32] [.galaxy-stage.has-focus_.galaxy-star&]:[filter:saturate(.4)_brightness(.82)]`:``}`,"aria-pressed":i===e.id,onClick:()=>o(e.id),onMouseEnter:()=>p(e.id),onMouseLeave:()=>p(``),style:{left:`${t/A.width*100}%`,top:`${n/A.height*100}%`,"--star-size":`${12+Math.round((e.importance||.5)*9)}px`,"--twinkle-delay":`${r}s`,"--enter-delay":`${a*55}ms`,"--depth":M(e.id)%100/100,"--g-star-color":j[e.type],"--g-star-glow":ye[e.type]},title:e.content,children:[i===e.id&&(0,k.jsx)(`i`,{className:`orbit-ring [.galaxy-star_&]:absolute [.galaxy-star_&]:left-[50%] [.galaxy-star_&]:top-[50%] [.galaxy-star_&]:w-[calc(var(--star-size)_+_36px)] [.galaxy-star_&]:h-[calc(var(--star-size)_+_36px)] [.galaxy-star_&]:[border:1px_solid_var(--galaxy-line-active)] [.galaxy-star_&]:rounded-[50%] [.galaxy-star_&]:pointer-events-none [.galaxy-star_&]:[transform:translate(-50%,-50%)_rotate(-22deg)_scaleY(.44)] [.galaxy-star_&]:[animation:galaxy-selected-orbit_6s_linear_infinite] [.galaxy-star_&]:opacity-[.8] [.galaxy-star_&::before]:[content:''] [.galaxy-star_&::before]:absolute [.galaxy-star_&::before]:top-[-2.2px] [.galaxy-star_&::before]:left-[50%] [.galaxy-star_&::before]:w-[4.4px] [.galaxy-star_&::before]:h-[4.4px] [.galaxy-star_&::before]:ml-[-2.2px] [.galaxy-star_&::before]:rounded-[50%] [.galaxy-star_&::before]:bg-[var(--g-star-color)] [.galaxy-star_&::before]:shadow-[0_0_6px_1px_var(--g-star-glow)]`,"aria-hidden":`true`}),i===e.id&&(0,k.jsx)(`i`,{className:`dash-ring [.galaxy-star_&]:absolute [.galaxy-star_&]:left-[50%] [.galaxy-star_&]:top-[50%] [.galaxy-star_&]:w-[calc(var(--star-size)_+_23px)] [.galaxy-star_&]:h-[calc(var(--star-size)_+_23px)] [.galaxy-star_&]:[border:1px_dashed_var(--g-star-glow)] [.galaxy-star_&]:rounded-[50%] [.galaxy-star_&]:opacity-[.9] [.galaxy-star_&]:pointer-events-none [.galaxy-star_&]:[transform:translate(-50%,-50%)] [.galaxy-star_&]:[animation:galaxy-dash-spin_16s_linear_infinite]`,"aria-hidden":`true`}),(0,k.jsxs)(`svg`,{className:`star-core [.galaxy-star_&]:relative [.galaxy-star_&]:block [.galaxy-star_&]:w-[var(--star-size)] [.galaxy-star_&]:h-[var(--star-size)] [.galaxy-star_&]:[transition:transform_var(--d2)_var(--ease-spring)] [.galaxy-star_&]:[animation:galaxy-star-twinkle_3.8s_ease-in-out_var(--twinkle-delay)_infinite] [.galaxy-star_&]:overflow-visible [.galaxy-star_&]:rounded-[0] [.galaxy-star_&]:bg-transparent [.galaxy-star_&]:shadow-[none] [.galaxy-star_&]:[filter:drop-shadow(0_0_3px_var(--g-star-glow))_drop-shadow(0_0_8px_var(--g-star-glow))] [.galaxy-star_&]:origin-[center] [.galaxy-star:hover_&]:[transform:scale(1.28)] [.galaxy-star.active_&]:[transform:scale(1.32)] [.galaxy-star.active_&]:[animation:galaxy-star-twinkle_2.1s_ease-in-out_var(--twinkle-delay)_infinite]`,viewBox:`0 0 32 32`,"aria-hidden":`true`,children:[(0,k.jsx)(`path`,{className:`star-ray [.galaxy-star_.star-core_&]:[fill:var(--g-star-glow)] [.galaxy-star_.star-core_&]:opacity-[.58] [.galaxy-star_.star-core_&]:[transform-box:fill-box] [.galaxy-star_.star-core_&]:origin-[center] [.galaxy-star_.star-core_&]:[transform:scale(1.45)] [.galaxy-star.active_.star-core_&]:opacity-[.88] [.galaxy-star.active_.star-core_&]:[transform:scale(1.82)]`,d:`M16 0 L19.7 12.3 L32 16 L19.7 19.7 L16 32 L12.3 19.7 L0 16 L12.3 12.3 Z`}),(0,k.jsx)(`path`,{className:`star-shape [.galaxy-star_.star-core_&]:[fill:var(--g-star-color)]`,d:`M16 2 L18.8 13.2 L30 16 L18.8 18.8 L16 30 L13.2 18.8 L2 16 L13.2 13.2 Z`}),(0,k.jsx)(`circle`,{className:`star-heart [.galaxy-star_.star-core_&]:[fill:var(--g-star-core)]`,cx:`16`,cy:`16`,r:`3.2`})]}),(0,k.jsx)(`span`,{className:`star-label [.galaxy-stage.has-focus_.galaxy-star.dimmed_&]:opacity-[.3] [.galaxy-stage.has-focus_.galaxy-star.dimmed_&]:[transition:opacity_.45s_var(--ease-out)] [.galaxy-star_&]:absolute [.galaxy-star_&]:top-[calc(50%_+_17px)] [.galaxy-star_&]:left-[50%] [.galaxy-star_&]:max-w-[120px] [.galaxy-star_&]:overflow-hidden [.galaxy-star_&]:text-[var(--galaxy-label)] [.galaxy-star_&]:text-[11px] [.galaxy-star_&]:leading-[1.35] [.galaxy-star_&]:pointer-events-none [.galaxy-star_&]:text-ellipsis [.galaxy-star_&]:[text-shadow:0_1px_7px_var(--galaxy-bg)] [.galaxy-star_&]:[transform:translateX(-50%)] [.galaxy-star_&]:[transition:color_var(--d1)_var(--ease-out)] [.galaxy-star_&]:whitespace-nowrap [.galaxy-star:hover_&]:text-[var(--galaxy-label-active)] [.galaxy-star.active_&]:text-[var(--galaxy-label-active)] [.galaxy-star.active_&]:font-[700]`,children:e.title})]},e.id))]}),!!y.length&&(0,k.jsxs)(`span`,{className:`pointer-events-none absolute right-3 bottom-2.5 z-[3] rounded-xs border border-[var(--galaxy-toolbar-border)] bg-[var(--galaxy-toolbar-bg)] px-2 text-xs leading-5 text-[var(--galaxy-label)] tabular-nums`,children:[`✦`,` `,c(`memory:memoryPage.visibleTotalMemories`,{visible:y.length,total:e.length})]}),!a&&!y.length&&(0,k.jsxs)(`div`,{className:`memory-empty [.galaxy-panel_&]:text-[var(--galaxy-label)] [.galaxy-panel_&]:[--stroke:var(--galaxy-toolbar-border)] [.galaxy-panel_&]:[--control-muted:var(--galaxy-label)] [.galaxy-panel_&]:[--star:var(--g-decision)] [.galaxy-panel_&]:[--text-muted:var(--galaxy-label)] absolute z-[3] inset-0 grid [align-content:center] justify-items-center gap-[8px] text-[var(--text-muted)] text-[12px] pointer-events-none`,children:[(0,k.jsx)(re,{size:44}),(0,k.jsx)(`span`,{children:c(`memory:memoryPage.thisMemorySpaceIsStillUnlitClickInTheTopLeftToPlantTheFirstStar`)})]})]})}var xe=[`concept`,`file`,`risk`,`preference`,`decision`,`fact`,`task`],F=`modal-backdrop fixed inset-0 z-[70] grid place-items-center overflow-y-auto overscroll-contain bg-[var(--modal-overlay)] p-5 max-[650px]:p-2`,I=`modal grid max-h-[calc(100dvh_-_40px)] w-[min(430px,100%)] gap-0.5 overflow-y-auto overscroll-contain rounded-dialog bg-popover p-5 shadow-float max-[650px]:max-h-[calc(100dvh_-_16px)]`,L=`key-value flex min-h-[34px] min-w-0 items-center justify-between gap-4 border-t border-stroke-soft text-sm [&>dt]:shrink-0 [&>dt]:text-content-muted [&>dd]:min-w-0 [&>dd]:truncate [&>dd]:text-right [&>dd]:text-content`;function Se(e,t){return t(e===`file`?`memory:memoryPage.fileType`:e===`risk`?`memory:memoryPage.riskType`:e===`preference`?`memory:memoryPage.preferenceType`:e===`decision`?`memory:memoryPage.decisionType`:e===`fact`?`memory:memoryPage.factType`:e===`task`?`memory:memoryPage.taskType`:`memory:memoryPage.conceptType`)}function Ce(e,t=`zh-CN`){if(!e)return`—`;let n=new Date(e);return Number.isNaN(n.getTime())?e:new Intl.DateTimeFormat(t,{year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,hour12:!1}).format(n)}function R(e,t=e=>e){return e?.kind===`global`?t(`memory:memoryPage.globalMemorySpace`):e?.name||``}function z(e){return e instanceof Error?e.message:String(e)}function we({notify:e,onBack:t,requestConfirm:n}){let a=y(`focusSearch`),[x,re]=(0,O.useState)(``),{t:C,language:w}=r(),[T,me]=(0,O.useState)({spaces:[],nodes:[],links:[],candidates:[],selectedSpaceId:``}),[E,D]=(0,O.useState)(``),[he,A]=(0,O.useState)(``),[ge,_e]=(0,O.useState)(``),[j,ye]=(0,O.useState)(`galaxy`),M=(0,O.useRef)(null),N=(0,O.useRef)(0),[P,F]=(0,O.useState)(!0),[I,we]=(0,O.useState)(!1),[De,B]=(0,O.useState)(``),[V,H]=(0,O.useState)(null),[Oe,U]=(0,O.useState)(null),[W,G]=(0,O.useState)(``),[K,ke]=(0,O.useState)(null),[Ae,q]=(0,O.useState)(``),[je,Me]=(0,O.useState)(`load`),[Ne,Pe]=(0,O.useState)(!0),J=(0,O.useRef)(null),Y=(0,O.useRef)(0),Fe=(0,O.useRef)(0),Ie=(0,O.useRef)(0),Le=(0,O.useRef)(null),X=(0,O.useRef)(null),Re=(0,O.useRef)(!1),Z=(0,O.useRef)(null),Q=(0,O.useRef)(!0),[ze,Be]=(0,O.useState)(!1),$=(0,O.useCallback)(async(e=``)=>{let t=++N.current;F(!0),B(``);try{let n=new URLSearchParams;e&&n.set(`spaceId`,e),x.trim()&&n.set(`query`,x.trim());let r=await i(`/api/memory?${n}`);if(t!==N.current)return;me(r),we(!0),D(r.selectedSpaceId||``),A(e=>r.nodes.some(t=>t.id===e)?e:r.nodes[0]?.id||``)}catch(e){t===N.current&&B(z(e))}finally{t===N.current&&F(!1)}},[x]);(0,O.useEffect)(()=>($(E),()=>{N.current+=1}),[$,E]);let Ve=(0,O.useCallback)(async()=>{Le.current?.abort();let e=new AbortController;Le.current=e;let t=++Fe.current,n=Y.current,r=n===Ie.current;Pe(!0),q(``);try{let a=await i(`/api/settings/memory`,{signal:e.signal});if(e.signal.aborted||!Q.current||t!==Fe.current)return;let o=a.autoApproveConfidence;if(typeof o!=`number`||!Number.isInteger(o)||o<0||o>100)throw Error(C(`memory:memoryPage.invalidAutoApproveThreshold`));r&&Y.current===n&&(J.current=o,ke(String(o)))}catch(n){!e.signal.aborted&&Q.current&&t===Fe.current&&(Me(`load`),q(z(n)))}finally{!e.signal.aborted&&Q.current&&t===Fe.current&&Pe(!1)}},[C]);(0,O.useEffect)(()=>(Q.current=!0,Ve(),()=>{Q.current=!1,Le.current?.abort(),X.current?.abort(),Z.current=null}),[Ve]);let He=async()=>{if(K===null||!K.trim()||J.current===null)return;let t=Number(K);if(!Number.isFinite(t))return;let n=Math.min(100,Math.max(0,Math.round(t)));if(!X.current&&!Re.current&&n===J.current){Z.current=null,Ie.current=Y.current,ke(String(n)),q(``);return}if(Z.current={value:n,revision:Y.current},X.current)return;let r=new AbortController;X.current=r,Be(!0),q(``);try{for(;Z.current&&Q.current&&!r.signal.aborted;){let t=Z.current;if(Z.current=null,t.value!==J.current||Re.current){try{await i(`/api/settings/memory`,{method:`PATCH`,body:{autoApproveConfidence:t.value},signal:r.signal})}catch(e){if(!Q.current||r.signal.aborted)return;Z.current||=t,Re.current=!0,Me(`save`),q(z(e));return}if(!Q.current||r.signal.aborted)return;J.current=t.value,Re.current=!1}Ie.current=t.revision,Y.current===t.revision&&(ke(String(t.value)),Z.current||e(C(`memory:memoryPage.autoApproveSaved`)))}}finally{X.current===r&&(X.current=null,Q.current&&Be(!1))}},Ue=T.nodes.find(e=>e.id===he)||null,We=e=>{let t=new Set(T.links.flatMap(t=>t.sourceId===e?[t.targetId]:t.targetId===e?[t.sourceId]:[]));return{count:t.size,files:T.nodes.filter(n=>n.type===`file`&&(t.has(n.id)||n.id===e))}},Ge=T.spaces.find(e=>e.id===E),Ke=async t=>{if(await n({title:C(`memory:memoryPage.deleteMemory`),message:C(`memory:memoryPage.deleteMemoryName`,{name:t.title}),confirmLabel:C(`memory:memoryPage.delete`)}))try{await i(`/api/memory/nodes/${encodeURIComponent(t.id)}`,{method:`DELETE`}),e(C(`memory:memoryPage.memoryDeleted`)),await $(E)}catch(e){B(z(e))}},qe=async(t,n)=>{if(!W){G(t.id),B(``);try{await i(`/api/memory/candidates/${encodeURIComponent(t.id)}/${n}`,{method:`POST`,body:`{}`}),e(C(n===`accept`?`memory:memoryPage.memoryCandidateConfirmed`:`memory:memoryPage.memoryCandidateIgnored`)),await $(E)}catch(e){B(z(e))}finally{G(``)}}},Je=async()=>{if(!(W||!T.candidates?.length)){G(`__all__`),B(``);try{let t=await i(`/api/memory/candidates/reject-all`,{method:`POST`,body:`{}`});e(C(`memory:memoryPage.ignoredCountMemoryDrafts`,{count:t.rejected||0})),await $(E)}catch(e){B(z(e))}finally{G(``)}}},Ye=async()=>{if(Ge&&await n({title:C(`memory:memoryPage.deleteMemorySpace`),message:C(`memory:memoryPage.deleteMemorySpaceNameAndAllMemoriesInIt`,{name:R(Ge,C)}),confirmLabel:C(`memory:memoryPage.delete`)}))try{await i(`/api/memory/spaces/${encodeURIComponent(Ge.id)}`,{method:`DELETE`}),D(``),A(``),e(C(`memory:memoryPage.memorySpaceDeleted`))}catch(e){B(z(e))}},Xe=C(`navigation:navigation.memory`),Ze=R(Ge,C),Qe=e=>{A(e),requestAnimationFrame(()=>M.current?.scrollIntoView({block:`nearest`}))},$e=(e,t)=>{let n=We(e.id);return(0,k.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3`,children:[t&&(0,k.jsxs)(`header`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,k.jsx)(`h3`,{className:`text-[15px] leading-6 font-medium break-words text-content`,children:e.title}),(0,k.jsx)(`p`,{className:`text-[13px] leading-normal break-words text-content-secondary`,children:e.content})]}),(0,k.jsxs)(`dl`,{children:[(0,k.jsxs)(`div`,{className:L,children:[(0,k.jsx)(`dt`,{children:C(`memory:memoryPage.memoryType`)}),(0,k.jsxs)(`dd`,{className:`inline-flex items-center justify-end gap-2`,children:[(0,k.jsx)(ve,{type:e.type}),Se(e.type,C)]})]}),(0,k.jsxs)(`div`,{className:L,children:[(0,k.jsx)(`dt`,{children:C(`memory:memoryPage.source`)}),(0,k.jsx)(`dd`,{children:e.sourceType===`conversation_confirmed`?C(`memory:memoryPage.userConfirmedConversationCandidate`):e.sourceType===`user_confirmed`?C(`memory:memoryPage.explicitUserRequest`):e.sourceType===`agent`?C(`memory:memoryPage.createdByAgent`):C(`memory:memoryPage.addedManually`)})]}),(0,k.jsxs)(`div`,{className:L,children:[(0,k.jsx)(`dt`,{children:C(`memory:memoryPage.authority`)}),(0,k.jsxs)(`dd`,{className:`tabular-nums`,children:[e.authority??0,`/100`]})]}),e.evidence&&(0,k.jsxs)(`div`,{className:L,children:[(0,k.jsx)(`dt`,{children:C(`memory:memoryPage.evidence`)}),(0,k.jsx)(`dd`,{title:e.evidence,children:e.evidence})]}),(0,k.jsxs)(`div`,{className:L,children:[(0,k.jsx)(`dt`,{children:C(`memory:memoryPage.created`)}),(0,k.jsx)(`dd`,{className:`tabular-nums`,children:Ce(e.createdAt,w)})]}),(0,k.jsxs)(`div`,{className:L,children:[(0,k.jsx)(`dt`,{children:C(`memory:memoryPage.relatedMemories`)}),(0,k.jsx)(`dd`,{className:`tabular-nums`,children:C(`memory:memoryPage.count`,{count:n.count})})]})]}),(0,k.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:[(0,k.jsxs)(v,{variant:`ghost`,size:`sm`,className:`text-danger hover:bg-danger-soft hover:text-danger max-[650px]:h-11`,onClick:()=>void Ke(e),children:[(0,k.jsx)(p,{}),C(`memory:memoryPage.delete`)]}),(0,k.jsxs)(v,{variant:`secondary`,size:`sm`,className:`max-[650px]:h-11`,onClick:()=>H(e),children:[(0,k.jsx)(l,{}),C(`memory:memoryPage.edit`)]})]}),(0,k.jsxs)(`section`,{className:`min-w-0`,"aria-label":C(`memory:memoryPage.relatedFiles`),children:[(0,k.jsxs)(`h4`,{className:`mb-1 text-xs font-medium text-content-muted tabular-nums`,children:[C(`memory:memoryPage.relatedFiles`),` · `,n.files.length]}),n.files.length?(0,k.jsx)(`ul`,{className:`divide-y divide-stroke-soft border-t border-stroke-soft`,children:n.files.map(t=>(0,k.jsxs)(`li`,{className:`file-row grid min-h-11 min-w-0 grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-2.5 py-1`,children:[(0,k.jsx)(s,{className:`size-4 text-content-muted`,"aria-hidden":`true`}),(0,k.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,k.jsx)(`strong`,{className:`truncate text-sm font-medium text-content`,children:t.title}),(0,k.jsx)(`small`,{className:`truncate font-mono text-xs text-content-muted`,children:t.sourcePath||t.cwd||C(`memory:memoryPage.localMemory`)})]}),(0,k.jsxs)(`span`,{className:`flex items-center`,children:[t.id!==e.id&&(0,k.jsx)(v,{variant:`ghost`,size:`sm`,className:`max-[650px]:h-11`,onClick:()=>j===`galaxy`?A(t.id):_e(t.id),children:C(`memory:memoryPage.view`)}),(0,k.jsx)(v,{variant:`ghost`,size:`icon-sm`,className:`max-[650px]:size-11`,"aria-label":`${C(`memory:memoryPage.edit`)}: ${t.title}`,onClick:()=>H(t),children:(0,k.jsx)(l,{})}),(0,k.jsx)(v,{variant:`ghost`,size:`icon-sm`,className:`text-content-muted hover:bg-danger-soft hover:text-danger max-[650px]:size-11`,"aria-label":`${C(`memory:memoryPage.delete`)}: ${t.title}`,onClick:()=>void Ke(t),children:(0,k.jsx)(p,{})})]})]},t.id))}):(0,k.jsx)(`p`,{className:`text-xs text-content-muted`,children:C(`memory:memoryPage.thisMemoryHasNoRelatedFiles`)})]})]})};return(0,k.jsxs)(le,{title:Xe,description:C(`memory:memoryPage.lede`),back:t&&{label:C(`navigation:sidebar.features`),ariaLabel:C(`navigation:shell.backToFeaturesLabel`),onBack:t},toolbar:(0,k.jsx)(ue,{search:(0,k.jsx)(ae,{id:h,value:x,onValueChange:re,placeholder:C(`navigation:pageHeader.searchMemoriesOrFiles`),shortcut:a,clearLabel:C(`navigation:more.clearSearch`)}),actions:(0,k.jsxs)(v,{type:`button`,className:`h-9`,disabled:!I,onClick:()=>H({spaceId:E||T.selectedSpaceId}),children:[(0,k.jsx)(u,{}),C(`memory:memoryPage.addMemory`)]}),filters:(0,k.jsx)(fe,{options:[C(`memory:memoryPage.galaxyView`),C(`memory:memoryPage.listView`)],value:C(j===`galaxy`?`memory:memoryPage.galaxyView`:`memory:memoryPage.listView`),onChange:e=>ye(e===C(`memory:memoryPage.listView`)?`list`:`galaxy`)})}),children:[!I&&P?(0,k.jsx)(S,{kind:`loading`,title:C(`common:pageTemplate.loading`)}):I?(0,k.jsxs)(k.Fragment,{children:[De&&(0,k.jsx)(de,{children:De}),(0,k.jsx)(ce,{title:C(`memory:memoryPage.memorySpaces`),count:T.spaces.length,actions:(0,k.jsxs)(v,{variant:`ghost`,size:`sm`,onClick:()=>U({}),children:[(0,k.jsx)(u,{}),C(`memory:memoryPage.newMemorySpace`)]}),children:(0,k.jsx)(se,{children:T.spaces.map(e=>{let t=e.id===E;return(0,k.jsx)(oe,{"data-memory-space":e.id,"aria-current":t||void 0,className:ne(`relative`,t&&`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`),icon:(0,k.jsx)(f,{}),onOpen:()=>{D(e.id),A(``),_e(``)},name:R(e,C),status:C(`memory:memoryPage.countMemories`,{count:e.nodeCount}),actions:t&&(0,k.jsxs)(`div`,{className:`memory-space-actions flex items-center gap-1`,children:[(0,k.jsxs)(v,{variant:`ghost`,size:`sm`,onClick:()=>U(e),children:[(0,k.jsx)(l,{}),C(`memory:memoryPage.rename`)]}),e.kind!==`global`&&(0,k.jsxs)(v,{variant:`ghost`,size:`sm`,className:`text-danger hover:bg-danger-soft hover:text-danger`,onClick:()=>void Ye(),children:[(0,k.jsx)(p,{}),C(`memory:memoryPage.delete`)]})]})},e.id)})})}),(0,k.jsx)(ce,{"data-memory-stars":!0,title:Ze||C(`memory:memoryPage.memorySpaces`),count:T.nodes.length,actions:(0,k.jsx)(v,{variant:`ghost`,size:`icon-sm`,className:`text-content-muted max-[650px]:size-11 pointer-coarse:size-11`,loading:P,disabled:P,"aria-label":C(`memory:memoryPage.refresh`),title:C(`memory:memoryPage.refresh`),onClick:()=>void $(E),children:(0,k.jsx)(d,{})}),children:j===`galaxy`?(0,k.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3`,children:[(0,k.jsx)(be,{nodes:T.nodes,links:T.links,spaceId:E,selectedId:he,loading:P,onSelect:Qe,onAdd:()=>H({spaceId:E})}),(0,k.jsx)(`div`,{role:`group`,"aria-label":C(`memory:memoryPage.memoryMapTypes`),className:`galaxy-legend flex flex-wrap gap-x-4 gap-y-1.5`,children:xe.map(e=>(0,k.jsxs)(`span`,{className:`flex items-center gap-1.5 text-xs text-content-secondary`,children:[(0,k.jsx)(ve,{type:e}),Se(e,C)]},e))}),(0,k.jsx)(`div`,{ref:M,role:`region`,"data-memory-detail":!0,"aria-label":C(`memory:memoryPage.selectedMemory`),className:`min-w-0 scroll-mb-4 rounded-[var(--r-md)] border border-stroke px-4 py-3`,children:Ue?$e(Ue,!0):(0,k.jsx)(`p`,{className:`text-xs leading-normal text-content-muted`,children:C(`memory:memoryPage.selectAMemoryInTheMapToViewItsDetails`)})})]}):T.nodes.length?(0,k.jsx)(se,{children:T.nodes.map(e=>(0,k.jsx)(oe,{"data-memory-node":e.id,icon:(0,k.jsx)(ve,{type:e.type}),name:e.title,nameMeta:Se(e.type,C),description:e.content,expanded:ge===e.id,onExpandedChange:t=>_e(t?e.id:``),toggleLabel:e.title,detail:$e(e,!1)},e.id))}):(0,k.jsx)(ie,{title:x.trim()?C(`memory:memoryPage.noMatchingMemories`):C(`memory:memoryPage.noMemoriesInSpace`)})}),(0,k.jsxs)(ce,{title:C(`memory:memoryPage.memoryDrafts`),count:T.candidates?.length||0,actions:!!T.candidates?.length&&(0,k.jsxs)(v,{variant:`ghost`,size:`sm`,disabled:!!W,onClick:()=>void Je(),children:[(0,k.jsx)(m,{}),C(`memory:memoryPage.ignoreAll`)]}),children:[Ne&&(0,k.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 py-2 text-xs text-content-muted`,children:[(0,k.jsx)(_,{className:`size-3.5`}),C(`memory:memoryPage.loadingAutoApproveThreshold`)]}),Ae&&(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 py-2`,children:[(0,k.jsxs)(pe,{className:`my-0`,children:[C(`memory:memoryPage.autoApproveThresholdUnavailable`),` `,Ae]}),(0,k.jsx)(v,{variant:`secondary`,size:`sm`,className:`max-[650px]:h-11`,disabled:Ne||ze,onClick:()=>void(je===`save`?He():Ve()),children:C(`memory:memoryPage.retryAutoApproveThreshold`)})]}),K!==null&&(0,k.jsxs)(`div`,{className:`memory-auto-approve-row flex min-h-12 items-center justify-between gap-3 border-t border-stroke py-1.5`,children:[(0,k.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5 text-sm font-medium text-content`,children:[(0,k.jsx)(`span`,{children:C(`memory:memoryPage.autoApproveThreshold`)}),(0,k.jsxs)(te,{children:[(0,k.jsx)(ee,{asChild:!0,children:(0,k.jsx)(c,{className:`size-3.5 shrink-0 text-content-muted`})}),(0,k.jsx)(g,{align:`center`,side:`top`,children:C(`memory:memoryPage.autoApproveThresholdHint`)})]})]}),(0,k.jsxs)(`span`,{className:`memory-auto-approve-input flex flex-none items-center gap-1.5 text-xs text-content-muted`,children:[(0,k.jsx)(b,{type:`number`,min:0,max:100,step:5,className:`h-7 w-16 text-right tabular-nums max-[650px]:h-11`,value:K,"aria-busy":ze,"aria-label":C(`memory:memoryPage.autoApproveThreshold`),onChange:e=>{Y.current+=1,ke(e.target.value)},onBlur:()=>void He(),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),He())}}),`%`,ze&&(0,k.jsx)(_,{className:`size-3.5`})]})]}),T.candidates?.length?(0,k.jsx)(se,{children:T.candidates.map(e=>(0,k.jsx)(oe,{className:`memory-candidate`,name:e.title,description:e.content,meta:(0,k.jsxs)(`span`,{className:`truncate tabular-nums`,children:[R(T.spaces.find(t=>t.id===e.spaceId),C),` · `,e.sourceType===`agent`?C(`memory:memoryPage.agentProposed`):C(`memory:memoryPage.conversationExtracted`),` · `,C(`memory:memoryPage.confidencePercent`,{value:Math.round((e.confidence||0)*100)})]}),actions:(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(v,{variant:`secondary`,size:`sm`,disabled:!!W,onClick:()=>void qe(e,`accept`),children:[(0,k.jsx)(o,{}),C(`memory:memoryPage.confirm`)]}),(0,k.jsxs)(v,{variant:`ghost`,size:`sm`,disabled:!!W,onClick:()=>void qe(e,`reject`),children:[(0,k.jsx)(m,{}),C(`memory:memoryPage.ignore`)]})]}),detail:(0,k.jsxs)(`div`,{className:`flex flex-col gap-0.5 text-xs leading-[1.5] text-content-muted`,children:[e.topicKey&&(0,k.jsxs)(`span`,{children:[C(`memory:memoryPage.topic`),`:`,(0,k.jsx)(`code`,{className:`font-mono`,children:e.topicKey})]}),e.evidence&&(0,k.jsxs)(`span`,{className:`[overflow-wrap:anywhere]`,children:[C(`memory:memoryPage.evidence`),`:`,e.evidence]}),(0,k.jsxs)(`span`,{className:`tabular-nums`,children:[C(`memory:memoryPage.created`),`:`,Ce(e.createdAt,w),e.expiresAt?` · ${C(`memory:memoryPage.expires`)}:${Ce(e.expiresAt,w)}`:``]})]})},e.id))}):(0,k.jsx)(`p`,{className:`border-t border-stroke py-3 text-xs text-content-muted`,children:C(`memory:memoryPage.thereAreNoPendingMemoryCandidates`)})]})]}):(0,k.jsx)(S,{kind:`error`,title:C(`memory:memoryPage.loadFailed`),description:De,action:(0,k.jsx)(v,{variant:`secondary`,className:`max-[650px]:h-11`,onClick:()=>void $(E),children:C(`common:pageTemplate.retry`)})}),V&&(0,k.jsx)(Te,{spaces:T.spaces,node:V.id?V:null,initialSpaceId:V.spaceId||E,onClose:()=>H(null),onSaved:async t=>{H(null),e(t),await $(E)}}),Oe&&(0,k.jsx)(Ee,{space:Oe.id?Oe:null,onClose:()=>U(null),onSaved:async(t,n)=>{U(null),D(t.id),e(n)}})]})}function Te({spaces:e,node:t,initialSpaceId:n,onClose:a,onSaved:o}){let{t:s}=r(),[c,u]=(0,O.useState)({spaceId:t?.spaceId||n||e[0]?.id||``,title:t?.title||``,content:t?.content||``,type:t?.type||`concept`,sourcePath:t?.sourcePath||``,importance:t?.importance??.5}),[d,f]=(0,O.useState)(!1),[p,h]=(0,O.useState)(``);return(0,k.jsx)(`div`,{className:F,onMouseDown:e=>!d&&e.target===e.currentTarget&&a(),children:(0,k.jsxs)(`form`,{role:`dialog`,"aria-modal":`true`,"aria-label":s(t?`memory:memoryPage.editMemory`:`memory:memoryPage.addMemory`),className:I,onSubmit:async e=>{if(e.preventDefault(),!d){f(!0),h(``);try{await i(t?`/api/memory/nodes/${encodeURIComponent(t.id)}`:`/api/memory/nodes`,{method:t?`PATCH`:`POST`,body:JSON.stringify(c)}),await o(s(t?`memory:memoryPage.memoryUpdated`:`memory:memoryPage.memoryCreated`))}catch(e){h(z(e))}finally{f(!1)}}},children:[(0,k.jsxs)(T,{className:`[&_h2]:text-[15px] [&_h2]:font-medium`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`h2`,{children:s(t?`memory:memoryPage.editMemory`:`memory:memoryPage.addMemory`)}),(0,k.jsx)(`p`,{children:s(`memory:memoryPage.lightUpIdeasWorthKeepingAsMemoriesYouCanReturnToLater`)})]}),(0,k.jsx)(v,{type:`button`,variant:`ghost`,size:`icon`,className:`-mt-1 -mr-1 max-[650px]:size-11`,"aria-label":s(`memory:memoryPage.closeDialog`),disabled:d,onClick:a,children:(0,k.jsx)(m,{})})]}),(0,k.jsxs)(C,{variant:`control`,children:[s(`memory:memoryPage.memorySpace`),(0,k.jsx)(w,{value:c.spaceId,onChange:e=>u({...c,spaceId:e.target.value}),children:e.map(e=>(0,k.jsx)(`option`,{value:e.id,children:R(e,s)},e.id))})]}),(0,k.jsxs)(C,{variant:`control`,children:[s(`memory:memoryPage.memoryTitle`),(0,k.jsx)(b,{value:c.title,onChange:e=>u({...c,title:e.target.value}),placeholder:s(`memory:memoryPage.forExampleProjectUIConstraints`)})]}),(0,k.jsxs)(C,{variant:`control`,children:[s(`memory:memoryPage.memoryContent`),(0,k.jsx)(x,{value:c.content,onChange:e=>u({...c,content:e.target.value}),placeholder:s(`memory:memoryPage.recordStandaloneReusableMemoryForFutureChats`)})]}),(0,k.jsxs)(`div`,{className:`form-grid grid gap-x-2.5 sm:grid-cols-2`,children:[(0,k.jsxs)(C,{variant:`control`,children:[s(`memory:memoryPage.memoryType`),(0,k.jsx)(w,{value:c.type,onChange:e=>u({...c,type:e.target.value}),children:xe.map(e=>(0,k.jsx)(`option`,{value:e,children:Se(e,s)},e))})]}),(0,k.jsxs)(C,{variant:`control`,children:[s(`memory:memoryPage.importance`),(0,k.jsxs)(w,{value:c.importance,onChange:e=>u({...c,importance:Number(e.target.value)}),children:[(0,k.jsx)(`option`,{value:`0.3`,children:s(`memory:memoryPage.normal`)}),(0,k.jsx)(`option`,{value:`0.5`,children:s(`memory:memoryPage.common`)}),(0,k.jsx)(`option`,{value:`0.8`,children:s(`memory:memoryPage.important`)}),(0,k.jsx)(`option`,{value:`1`,children:s(`memory:memoryPage.strict`)})]})]})]}),(0,k.jsxs)(C,{variant:`control`,children:[s(`memory:memoryPage.relatedFilePath`),(0,k.jsx)(b,{value:c.sourcePath,onChange:e=>u({...c,sourcePath:e.target.value}),placeholder:s(`memory:memoryPage.optionalForExampleECodeProjectREADMEMd`)})]}),p&&(0,k.jsx)(pe,{children:p}),(0,k.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,k.jsx)(v,{type:`button`,variant:`secondary`,size:`dialogAction`,onClick:a,children:s(`memory:memoryPage.cancel`)}),(0,k.jsxs)(v,{type:`submit`,size:`dialogAction`,disabled:d||!c.spaceId||!c.title.trim()||!c.content.trim(),children:[d?(0,k.jsx)(_,{className:`text-current`}):(0,k.jsx)(l,{}),s(d?`memory:memoryPage.saving`:`memory:memoryPage.save`)]})]})]})})}function Ee({space:e,onClose:t,onSaved:n}){let{t:a}=r(),[o,s]=(0,O.useState)(e?.name||``),[c,l]=(0,O.useState)(!1),[d,f]=(0,O.useState)(``);return(0,k.jsx)(`div`,{className:F,onMouseDown:e=>!c&&e.target===e.currentTarget&&t(),children:(0,k.jsxs)(`form`,{role:`dialog`,"aria-modal":`true`,"aria-label":a(e?`memory:memoryPage.renameMemorySpace`:`memory:memoryPage.newMemorySpace`),className:I,onSubmit:async t=>{if(t.preventDefault(),!c){l(!0),f(``);try{await n(await i(e?`/api/memory/spaces/${encodeURIComponent(e.id)}`:`/api/memory/spaces`,{method:e?`PATCH`:`POST`,body:JSON.stringify({name:o,kind:`custom`})}),a(e?`memory:memoryPage.memorySpaceRenamed`:`memory:memoryPage.memorySpaceCreated`))}catch(e){f(z(e))}finally{l(!1)}}},children:[(0,k.jsxs)(T,{className:`[&_h2]:text-[15px] [&_h2]:font-medium`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`h2`,{children:a(e?`memory:memoryPage.renameMemorySpace`:`memory:memoryPage.newMemorySpace`)}),(0,k.jsx)(`p`,{children:a(`memory:memoryPage.giveEachThemeOrProjectItsOwnMemorySpaceSoDurableMemoriesHaveSomewhereToBelong`)})]}),(0,k.jsx)(v,{type:`button`,variant:`ghost`,size:`icon`,className:`-mt-1 -mr-1 max-[650px]:size-11`,"aria-label":a(`memory:memoryPage.closeDialog`),disabled:c,onClick:t,children:(0,k.jsx)(m,{})})]}),(0,k.jsxs)(C,{variant:`control`,children:[a(`memory:memoryPage.memorySpaceName`),(0,k.jsx)(b,{value:o,onChange:e=>s(e.target.value),placeholder:a(`memory:memoryPage.forExampleProductDesignGuidelines`),autoFocus:!0})]}),d&&(0,k.jsx)(pe,{children:d}),(0,k.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,k.jsx)(v,{type:`button`,variant:`secondary`,size:`dialogAction`,onClick:t,children:a(`memory:memoryPage.cancel`)}),(0,k.jsxs)(v,{type:`submit`,size:`dialogAction`,disabled:c||!o.trim(),children:[c?(0,k.jsx)(_,{className:`text-current`}):(0,k.jsx)(u,{}),a(c?`memory:memoryPage.saving`:`memory:memoryPage.save`)]})]})]})})}export{we as MemoryPage};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{t as r}from"./use-i18n-BuN5i-jP.js";import{t as i}from"./api-Dg-aNpVe.js";import{t as a}from"./createLucideIcon-Cd-3GVxJ.js";import{t as o}from"./check-2vYc6QaP.js";import{t as s}from"./file-code-corner-BnE1ljT0.js";import{t as c}from"./info-DATxy0fb.js";import{t as l}from"./pencil-U08v_vV9.js";import{t as u}from"./plus-fQbSqB1n.js";import{t as d}from"./refresh-cw-TbWxTY4K.js";import{t as f}from"./sparkles-S_eeuqn9.js";import{t as p}from"./trash-2-CNrPOoPR.js";import{t as m}from"./x-07u4-129.js";import{t as h}from"./more-pages-D_PnxLN0.js";import{i as ee,n as g,t as te}from"./tooltip-D4MFbqcG.js";import{t as ne}from"./utils-C8uzG5AZ.js";import{n as _,t as v}from"./button-CCcCN8tE.js";import{s as y}from"./shortcuts-LBxOVau1.js";import{t as b}from"./input-CPw-zkYh.js";import{t as x}from"./textarea-DmATpOqT.js";import{n as S,r as re,t as ie}from"./PageState-Cz6vFMXv.js";import{a as ae,i as oe,n as se,o as ce,r as le,s as ue,t as de}from"./FeaturePage-C6kLKix5.js";import{n as C}from"./field-DoLEb0np.js";import{t as w}from"./AppSelect-BD6RAaJ5.js";import{c as fe,i as pe,n as T,t as me}from"./app-primitives-Drz_SjnR.js";var E=a(`zoom-out`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),D=a(`zoom-in`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`11`,x2:`11`,y1:`8`,y2:`14`,key:`1vmskp`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),O=e(t(),1);function he(e={}){let{rootMargin:t=`96px 0px`,threshold:n=0}=e,[r,i]=(0,O.useState)(null),[a,o]=(0,O.useState)(()=>!document.hidden),[s,c]=(0,O.useState)(!0),l=(0,O.useCallback)(e=>{i(e)},[]);return(0,O.useEffect)(()=>{let e=()=>o(!document.hidden);return e(),document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]),(0,O.useEffect)(()=>{if(!r||typeof IntersectionObserver>`u`)return;let e=new IntersectionObserver(([e])=>{e&&c(e.isIntersecting)},{rootMargin:t,threshold:n});return e.observe(r),()=>e.disconnect()},[r,t,n]),{ref:l,playing:a&&s}}var k=n(),A={width:600,height:420,cx:300,cy:206},ge=24,_e=Math.PI*(3-Math.sqrt(5));function ve({type:e}){return(0,k.jsx)(`i`,{"aria-hidden":`true`,className:`g-dot g-${e} inline-block size-2 shrink-0 rounded-full ring-1 ring-stroke`,style:{background:j[e]}})}var j={concept:`var(--g-concept)`,file:`var(--g-file)`,risk:`var(--g-risk)`,preference:`var(--g-preference)`,decision:`var(--g-decision)`,fact:`var(--g-fact)`,task:`var(--g-task)`},ye={concept:`var(--g-concept-glow)`,file:`var(--g-file-glow)`,risk:`var(--g-risk-glow)`,preference:`var(--g-preference-glow)`,decision:`var(--g-decision-glow)`,fact:`var(--g-fact-glow)`,task:`var(--g-task-glow)`};function M(e){let t=0;for(let n=0;n<e.length;n+=1)t=t*31+e.charCodeAt(n)>>>0;return t}function N(e,t){let n=e.slice(0,ge);if(!n.length)return[];if(n.length===1)return[{node:n[0],x:A.cx,y:A.cy,twinkle:0}];let r=M(t||`galaxy`)%628/100,i=172/Math.sqrt(n.length);return n.map((e,t)=>{let n=M(e.id),a=t*_e+r,o=i*Math.sqrt(t+.55)+n%11-5;return{node:e,x:A.cx+Math.cos(a)*o*1.38,y:A.cy+Math.sin(a)*o*.74,twinkle:n%50/10}})}function P(e,t,n){let r=t.x-e.x,i=t.y-e.y,a=Math.hypot(r,i)||1,o=Math.min(24,a*.16)*(n%2==0?1:-1),s=(e.x+t.x)/2-i/a*o,c=(e.y+t.y)/2+r/a*o;return`M ${e.x.toFixed(1)} ${e.y.toFixed(1)} Q ${s.toFixed(1)} ${c.toFixed(1)} ${t.x.toFixed(1)} ${t.y.toFixed(1)}`}function be({nodes:e,links:t,spaceId:n,selectedId:i,loading:a,onSelect:o,onAdd:s}){let{t:c}=r(),[l,d]=(0,O.useState)(1),[f,p]=(0,O.useState)(``),m=(0,O.useRef)(null),h=(0,O.useRef)(0),{ref:ee,playing:g}=he(),te=(0,O.useCallback)(e=>{m.current=e,ee(e)},[ee]),ne=g?``:`[&:before]:[animation-play-state:paused]! [&:after]:[animation-play-state:paused]! [&_*]:[animation-play-state:paused]! [&_*:before]:[animation-play-state:paused]! [&_*:after]:[animation-play-state:paused]!`,_=e=>{if(!g)return;let t=m.current;if(!t)return;let n=t.getBoundingClientRect(),r=((e.clientX-n.left)/n.width-.5)*2,i=((e.clientY-n.top)/n.height-.5)*2;cancelAnimationFrame(h.current),h.current=requestAnimationFrame(()=>{t.style.setProperty(`--px`,r.toFixed(3)),t.style.setProperty(`--py`,i.toFixed(3))})},v=()=>{cancelAnimationFrame(h.current),m.current?.style.setProperty(`--px`,`0`),m.current?.style.setProperty(`--py`,`0`)};(0,O.useEffect)(()=>{g||(cancelAnimationFrame(h.current),h.current=0)},[g]),(0,O.useEffect)(()=>{let e=m.current?.querySelector(`svg`);e&&(g?e.unpauseAnimations():e.pauseAnimations())},[g]);let y=(0,O.useMemo)(()=>N(e,n),[e,n]),b=(0,O.useMemo)(()=>new Map(y.map(e=>[e.node.id,e])),[y]),x=(0,O.useMemo)(()=>{let e=new Set(y.map(e=>e.node.id));return t.filter(t=>e.has(t.sourceId)&&e.has(t.targetId))},[y,t]),S=f||i,ie=new Set(t.flatMap(e=>e.sourceId===S?[e.targetId]:e.targetId===S?[e.sourceId]:[]));return(0,k.jsxs)(me,{className:`graph-panel before:[content:''] before:absolute before:z-[0] before:inset-0 before:pointer-events-none before:bg-[url('/memory-galaxy-background.webp')] before:[background-position:center_48%] before:[background-size:cover] before:bg-no-repeat before:[filter:saturate(.62)_contrast(1.08)] before:[mix-blend-mode:screen] before:opacity-[.42] after:[content:''] after:absolute after:z-[0] after:inset-0 after:pointer-events-none after:[background-image:radial-gradient(var(--galaxy-dot)_.9px,transparent_1.2px),_radial-gradient(var(--galaxy-dot-dim)_.8px,transparent_1.2px),_radial-gradient(var(--galaxy-dot)_1.2px,transparent_1.6px)] after:[background-position:0_0,_37px_53px,_71px_19px] after:[background-size:96px_96px,_152px_152px,_236px_236px] after:[animation:galaxy-field-twinkle_6.4s_ease-in-out_infinite] after:opacity-[.7] before:inset-[-8%] before:[animation:galaxy-background-drift_34s_ease-in-out_infinite_alternate] before:[will-change:transform] after:[animation:galaxy-field-drift_15s_ease-in-out_infinite_alternate] after:[will-change:background-position,opacity] max-[650px]:min-h-[430px] relative min-h-[500px] overflow-hidden [border-color:var(--galaxy-border)] bg-[var(--galaxy-bg)]! [background-image:radial-gradient(ellipse_46%_40%_at_50%_48%,_var(--galaxy-core),_transparent_72%),_radial-gradient(ellipse_62%_48%_at_16%_6%,_var(--galaxy-nebula-a),_transparent_70%),_radial-gradient(ellipse_56%_52%_at_88%_98%,_var(--galaxy-nebula-b),_transparent_72%)] p-0 backdrop-blur-none! galaxy-panel ${ne}`,onPointerMove:_,onPointerLeave:v,children:[(0,k.jsxs)(`div`,{className:`graph-toolbar absolute top-2.5 left-2.5 z-[4] flex gap-0.5 rounded-sm border border-[var(--galaxy-toolbar-border)] bg-[var(--galaxy-toolbar-bg)] p-0.5 text-[var(--galaxy-toolbar-text)] [&_button]:grid [&_button]:size-7 [&_button]:place-items-center [&_button]:rounded-xs [&_button]:transition-colors [&_button]:duration-(--d-fast) [&_button:hover]:bg-[var(--galaxy-toolbar-hover)] max-[650px]:[&_button]:size-11 [&_svg]:size-3.5`,children:[(0,k.jsx)(`button`,{type:`button`,title:c(`memory:memoryPage.addMemory`),"aria-label":c(`memory:memoryPage.addMemory`),onClick:s,children:(0,k.jsx)(u,{})}),(0,k.jsx)(`button`,{type:`button`,title:c(`memory:memoryPage.zoomIn`),"aria-label":c(`memory:memoryPage.zoomIn`),onClick:()=>d(e=>Math.min(1.6,Number((e+.15).toFixed(2)))),children:(0,k.jsx)(D,{})}),(0,k.jsx)(`button`,{type:`button`,title:c(`memory:memoryPage.zoomOut`),"aria-label":c(`memory:memoryPage.zoomOut`),onClick:()=>d(e=>Math.max(.7,Number((e-.15).toFixed(2)))),children:(0,k.jsx)(E,{})})]}),(0,k.jsxs)(`div`,{className:`galaxy-stage [&_>_svg]:absolute [&_>_svg]:inset-0 [&_>_svg]:w-full [&_>_svg]:h-full [&_>_svg]:overflow-visible [&_>_svg]:z-[1] [&_>_svg]:[transform:translate3d(calc(var(--px,0)_*_9px),calc(var(--py,0)_*_6px),0)] [&_>_svg]:[transition:transform_.9s_var(--ease-out)] absolute z-[1] inset-0 [transform-origin:50%_50%] [transition:transform_var(--d2)_var(--ease-out)] ${S?`has-focus`:``}`,ref:te,style:{transform:`scale(${l})`},children:[(0,k.jsx)(`i`,{className:`galaxy-spiral absolute z-[0] block pointer-events-none [left:9%] [top:13%] w-[82%] h-[74%] rounded-[50%] bg-[conic-gradient(from_-18deg,transparent_0deg,var(--galaxy-nebula-a)_28deg,transparent_68deg,var(--galaxy-nebula-b)_118deg,transparent_170deg,var(--galaxy-nebula-a)_224deg,transparent_278deg,var(--galaxy-nebula-b)_322deg,transparent_360deg)] [filter:blur(13px)] [mask-image:radial-gradient(ellipse,transparent_0%,transparent_15%,var(--g-star-core)_38%,transparent_74%)] [-webkit-mask-image:radial-gradient(ellipse,transparent_0%,transparent_15%,var(--g-star-core)_38%,transparent_74%)] [mix-blend-mode:screen] opacity-[.38] [animation:galaxy-spiral-turn_42s_linear_infinite] [will-change:transform]`,"aria-hidden":`true`}),(0,k.jsx)(`i`,{className:`galaxy-core absolute z-[0] block pointer-events-none before:[content:''] before:absolute before:left-[50%] before:top-[50%] before:w-[46px] before:h-[46px] before:rounded-[50%] before:bg-[radial-gradient(circle,rgba(255,255,255,.82),rgba(191,219,254,.3)_55%,transparent_76%)] before:[filter:blur(6px)] before:[transform:translate(-50%,-50%)] [left:50%] [top:49%] w-[34%] h-[40%] rounded-[50%] bg-[radial-gradient(ellipse,rgba(219,232,255,.3)_0%,rgba(126,156,255,.15)_36%,transparent_70%)] [filter:blur(9px)] [mix-blend-mode:screen] [transform:translate(-50%,-50%)] [animation:galaxy-core-breathe_7.5s_ease-in-out_infinite] [will-change:transform,opacity]`,"aria-hidden":`true`}),(0,k.jsx)(`i`,{className:`galaxy-aurora absolute z-[0] block pointer-events-none w-[46%] h-[31%] rounded-[50%] [filter:blur(21px)] [mix-blend-mode:screen] opacity-[.42] [will-change:transform,opacity] [left:8%] [top:20%] bg-[radial-gradient(ellipse,var(--galaxy-nebula-a),transparent_70%)] [animation:galaxy-aurora-drift_18s_ease-in-out_infinite_alternate]`,"aria-hidden":`true`}),(0,k.jsx)(`i`,{className:`galaxy-aurora absolute z-[0] block pointer-events-none w-[46%] h-[31%] rounded-[50%] [filter:blur(21px)] [mix-blend-mode:screen] opacity-[.42] [will-change:transform,opacity] [right:5%] [bottom:14%] bg-[radial-gradient(ellipse,var(--galaxy-nebula-b),transparent_70%)] [animation:galaxy-aurora-drift_23s_ease-in-out_-9s_infinite_alternate-reverse]`,"aria-hidden":`true`}),(0,k.jsx)(`i`,{className:`galaxy-aurora absolute z-[0] block pointer-events-none w-[46%] h-[31%] rounded-[50%] [filter:blur(21px)] [mix-blend-mode:screen] opacity-[.42] [will-change:transform,opacity] galaxy-aurora-three left-[30%] top-[60%] !w-[40%] !h-[27%] bg-[radial-gradient(ellipse,var(--galaxy-nebula-c),transparent_70%)] [animation:galaxy-aurora-drift_27s_ease-in-out_-14s_infinite_alternate]`,"aria-hidden":`true`}),(0,k.jsxs)(`svg`,{viewBox:`0 0 600 420`,preserveAspectRatio:`none`,"aria-hidden":`true`,children:[(0,k.jsxs)(`g`,{className:`galaxy-orbits [&_ellipse]:[fill:none] [&_ellipse]:[stroke:var(--galaxy-line)] [&_ellipse]:[stroke-width:.72] [&_ellipse]:[stroke-dasharray:3_7] [&_ellipse]:opacity-[.52] [transform-box:fill-box] [transform-origin:center] [animation:galaxy-orbit-drift_90s_linear_infinite]`,children:[(0,k.jsx)(`ellipse`,{cx:`300`,cy:`206`,rx:`205`,ry:`122`,transform:`rotate(-8 300 206)`}),(0,k.jsx)(`ellipse`,{cx:`300`,cy:`206`,rx:`154`,ry:`88`,transform:`rotate(18 300 206)`}),(0,k.jsx)(`ellipse`,{cx:`300`,cy:`206`,rx:`95`,ry:`54`,transform:`rotate(-24 300 206)`})]}),(0,k.jsx)(`defs`,{children:x.map((e,t)=>{let n=b.get(e.sourceId),r=b.get(e.targetId);return!n||!r?null:(0,k.jsxs)(`linearGradient`,{id:`lg-${t}`,gradientUnits:`userSpaceOnUse`,x1:n.x,y1:n.y,x2:r.x,y2:r.y,children:[(0,k.jsx)(`stop`,{offset:`0`,stopColor:j[n.node.type]||`var(--galaxy-line-active)`}),(0,k.jsx)(`stop`,{offset:`1`,stopColor:j[r.node.type]||`var(--galaxy-line-active)`})]},e.id)})}),x.map((e,t)=>{let n=b.get(e.sourceId),r=b.get(e.targetId);if(!n||!r)return null;let i=e.sourceId===S||e.targetId===S,a=P(n,r,M(e.id));return(0,k.jsxs)(`g`,{children:[(0,k.jsx)(`path`,{className:`link-path [.galaxy-stage_>_svg_&]:[fill:none] [.galaxy-stage_>_svg_&]:[stroke-width:1.05] [.galaxy-stage_>_svg_&]:[stroke-dasharray:3_5] [.galaxy-stage_>_svg_&]:opacity-[.5] [.galaxy-stage_>_svg_&]:[animation:galaxy-link-flow_30s_linear_infinite] [.galaxy-stage_>_svg_&]:[transition:opacity_var(--d2)_var(--ease-out)] [.galaxy-stage_>_svg_&.active]:[stroke-width:1.55] [.galaxy-stage_>_svg_&.active]:[stroke-dasharray:none] [.galaxy-stage_>_svg_&.active]:opacity-100 [.galaxy-stage_>_svg_&.active]:[filter:drop-shadow(0_0_3.5px_var(--galaxy-line-active))] [.galaxy-stage.has-focus_&]:opacity-[.14] [.galaxy-stage.has-focus_&.active]:opacity-100 ${i?`active`:``}`,d:a,stroke:`url(#lg-${t})`}),i&&(0,k.jsx)(`circle`,{className:`link-pulse [.galaxy-stage_>_svg_&]:[fill:var(--g-star-core)] [.galaxy-stage_>_svg_&]:[filter:drop-shadow(0_0_4px_var(--galaxy-line-active))] [.galaxy-stage_>_svg_&]:pointer-events-none`,r:`2.1`,children:(0,k.jsx)(`animateMotion`,{dur:`2.8s`,repeatCount:`indefinite`,path:a})})]},e.id)})]}),(0,k.jsx)(`i`,{className:`galaxy-meteor before:[content:''] before:absolute before:top-[50%] before:left-[1px] before:w-[72px] before:h-[1px] before:bg-[linear-gradient(90deg,transparent,var(--galaxy-dot))] before:[transform:translateY(-50%)] absolute [top:14%] [left:80%] w-[2.4px] h-[2.4px] rounded-[50%] bg-[var(--galaxy-label-active)] shadow-[0_0_7px_1px_var(--galaxy-dot)] opacity-0 pointer-events-none [animation:galaxy-meteor_12s_linear_infinite] z-[3]`,"aria-hidden":`true`}),(0,k.jsx)(`i`,{className:`galaxy-meteor before:[content:''] before:absolute before:top-[50%] before:left-[1px] before:w-[72px] before:h-[1px] before:bg-[linear-gradient(90deg,transparent,var(--galaxy-dot))] before:[transform:translateY(-50%)] absolute [top:14%] [left:80%] w-[2.4px] h-[2.4px] rounded-[50%] bg-[var(--galaxy-label-active)] shadow-[0_0_7px_1px_var(--galaxy-dot)] opacity-0 pointer-events-none [animation:galaxy-meteor_12s_linear_infinite] z-[3] meteor-two [.galaxy-meteor&]:top-[63%] [.galaxy-meteor&]:left-[89%] [.galaxy-meteor&]:[animation:galaxy-meteor-b_17s_linear_4.5s_infinite]`,"aria-hidden":`true`}),(0,k.jsx)(`i`,{className:`galaxy-meteor before:[content:''] before:absolute before:top-[50%] before:left-[1px] before:w-[72px] before:h-[1px] before:bg-[linear-gradient(90deg,transparent,var(--galaxy-dot))] before:[transform:translateY(-50%)] absolute [top:14%] [left:80%] w-[2.4px] h-[2.4px] rounded-[50%] bg-[var(--galaxy-label-active)] shadow-[0_0_7px_1px_var(--galaxy-dot)] opacity-0 pointer-events-none [animation:galaxy-meteor_12s_linear_infinite] z-[3] meteor-three [.galaxy-meteor&]:top-[7%] [.galaxy-meteor&]:left-[36%] [.galaxy-meteor&]:[animation:galaxy-meteor-c_23s_linear_11s_infinite]`,"aria-hidden":`true`}),y.map(({node:e,x:t,y:n,twinkle:r},a)=>(0,k.jsxs)(`button`,{className:`galaxy-star focus-visible:rounded-[50%] focus-visible:[outline-color:var(--galaxy-line-active)] before:[content:''] before:absolute before:w-[calc(var(--star-size)_+_26px)] before:h-[calc(var(--star-size)_+_26px)] before:rounded-[50%] before:bg-[radial-gradient(circle,var(--g-star-glow),transparent_68%)] before:[filter:blur(3px)] before:opacity-[.76] before:pointer-events-none [&.active::after]:[content:''] [&.active::after]:absolute [&.active::after]:w-[calc(var(--star-size)_+_31px)] [&.active::after]:h-[calc(var(--star-size)_+_31px)] [&.active::after]:[border:1px_solid_var(--g-star-glow)] [&.active::after]:rounded-[50%] [&.active::after]:pointer-events-none [&.active::after]:[animation:galaxy-star-selection-pulse_2.3s_var(--ease-out)_infinite] [&:hover::before]:opacity-100 [&.active::before]:opacity-100 absolute z-[2] grid w-[52px] h-[52px] min-w-0 min-h-[52px] place-items-center [transform:translate(-50%,-50%)_translate3d(calc(var(--px,0)_*_(9px_+_var(--depth,0)_*_7px)),calc(var(--py,0)_*_(6px_+_var(--depth,0)_*_5px)),0)] border-0 rounded-[50%] bg-transparent p-0 cursor-pointer [transition:transform_.9s_var(--ease-out),opacity_.45s_var(--ease-out),filter_.45s_var(--ease-out)] [animation:galaxy-star-enter_.72s_var(--ease-out)_var(--enter-delay,0ms)_backwards] ${i===e.id?`active`:``} ${S&&e.id!==S&&!ie.has(e.id)?`dimmed [.galaxy-stage.has-focus_.galaxy-star&]:opacity-[.32] [.galaxy-stage.has-focus_.galaxy-star&]:[filter:saturate(.4)_brightness(.82)]`:``}`,"aria-pressed":i===e.id,onClick:()=>o(e.id),onMouseEnter:()=>p(e.id),onMouseLeave:()=>p(``),style:{left:`${t/A.width*100}%`,top:`${n/A.height*100}%`,"--star-size":`${12+Math.round((e.importance||.5)*9)}px`,"--twinkle-delay":`${r}s`,"--enter-delay":`${a*55}ms`,"--depth":M(e.id)%100/100,"--g-star-color":j[e.type],"--g-star-glow":ye[e.type]},title:e.content,children:[i===e.id&&(0,k.jsx)(`i`,{className:`orbit-ring [.galaxy-star_&]:absolute [.galaxy-star_&]:left-[50%] [.galaxy-star_&]:top-[50%] [.galaxy-star_&]:w-[calc(var(--star-size)_+_36px)] [.galaxy-star_&]:h-[calc(var(--star-size)_+_36px)] [.galaxy-star_&]:[border:1px_solid_var(--galaxy-line-active)] [.galaxy-star_&]:rounded-[50%] [.galaxy-star_&]:pointer-events-none [.galaxy-star_&]:[transform:translate(-50%,-50%)_rotate(-22deg)_scaleY(.44)] [.galaxy-star_&]:[animation:galaxy-selected-orbit_6s_linear_infinite] [.galaxy-star_&]:opacity-[.8] [.galaxy-star_&::before]:[content:''] [.galaxy-star_&::before]:absolute [.galaxy-star_&::before]:top-[-2.2px] [.galaxy-star_&::before]:left-[50%] [.galaxy-star_&::before]:w-[4.4px] [.galaxy-star_&::before]:h-[4.4px] [.galaxy-star_&::before]:ml-[-2.2px] [.galaxy-star_&::before]:rounded-[50%] [.galaxy-star_&::before]:bg-[var(--g-star-color)] [.galaxy-star_&::before]:shadow-[0_0_6px_1px_var(--g-star-glow)]`,"aria-hidden":`true`}),i===e.id&&(0,k.jsx)(`i`,{className:`dash-ring [.galaxy-star_&]:absolute [.galaxy-star_&]:left-[50%] [.galaxy-star_&]:top-[50%] [.galaxy-star_&]:w-[calc(var(--star-size)_+_23px)] [.galaxy-star_&]:h-[calc(var(--star-size)_+_23px)] [.galaxy-star_&]:[border:1px_dashed_var(--g-star-glow)] [.galaxy-star_&]:rounded-[50%] [.galaxy-star_&]:opacity-[.9] [.galaxy-star_&]:pointer-events-none [.galaxy-star_&]:[transform:translate(-50%,-50%)] [.galaxy-star_&]:[animation:galaxy-dash-spin_16s_linear_infinite]`,"aria-hidden":`true`}),(0,k.jsxs)(`svg`,{className:`star-core [.galaxy-star_&]:relative [.galaxy-star_&]:block [.galaxy-star_&]:w-[var(--star-size)] [.galaxy-star_&]:h-[var(--star-size)] [.galaxy-star_&]:[transition:transform_var(--d2)_var(--ease-spring)] [.galaxy-star_&]:[animation:galaxy-star-twinkle_3.8s_ease-in-out_var(--twinkle-delay)_infinite] [.galaxy-star_&]:overflow-visible [.galaxy-star_&]:rounded-[0] [.galaxy-star_&]:bg-transparent [.galaxy-star_&]:shadow-[none] [.galaxy-star_&]:[filter:drop-shadow(0_0_3px_var(--g-star-glow))_drop-shadow(0_0_8px_var(--g-star-glow))] [.galaxy-star_&]:origin-[center] [.galaxy-star:hover_&]:[transform:scale(1.28)] [.galaxy-star.active_&]:[transform:scale(1.32)] [.galaxy-star.active_&]:[animation:galaxy-star-twinkle_2.1s_ease-in-out_var(--twinkle-delay)_infinite]`,viewBox:`0 0 32 32`,"aria-hidden":`true`,children:[(0,k.jsx)(`path`,{className:`star-ray [.galaxy-star_.star-core_&]:[fill:var(--g-star-glow)] [.galaxy-star_.star-core_&]:opacity-[.58] [.galaxy-star_.star-core_&]:[transform-box:fill-box] [.galaxy-star_.star-core_&]:origin-[center] [.galaxy-star_.star-core_&]:[transform:scale(1.45)] [.galaxy-star.active_.star-core_&]:opacity-[.88] [.galaxy-star.active_.star-core_&]:[transform:scale(1.82)]`,d:`M16 0 L19.7 12.3 L32 16 L19.7 19.7 L16 32 L12.3 19.7 L0 16 L12.3 12.3 Z`}),(0,k.jsx)(`path`,{className:`star-shape [.galaxy-star_.star-core_&]:[fill:var(--g-star-color)]`,d:`M16 2 L18.8 13.2 L30 16 L18.8 18.8 L16 30 L13.2 18.8 L2 16 L13.2 13.2 Z`}),(0,k.jsx)(`circle`,{className:`star-heart [.galaxy-star_.star-core_&]:[fill:var(--g-star-core)]`,cx:`16`,cy:`16`,r:`3.2`})]}),(0,k.jsx)(`span`,{className:`star-label [.galaxy-stage.has-focus_.galaxy-star.dimmed_&]:opacity-[.3] [.galaxy-stage.has-focus_.galaxy-star.dimmed_&]:[transition:opacity_.45s_var(--ease-out)] [.galaxy-star_&]:absolute [.galaxy-star_&]:top-[calc(50%_+_17px)] [.galaxy-star_&]:left-[50%] [.galaxy-star_&]:max-w-[120px] [.galaxy-star_&]:overflow-hidden [.galaxy-star_&]:text-[var(--galaxy-label)] [.galaxy-star_&]:text-[11px] [.galaxy-star_&]:leading-[1.35] [.galaxy-star_&]:pointer-events-none [.galaxy-star_&]:text-ellipsis [.galaxy-star_&]:[text-shadow:0_1px_7px_var(--galaxy-bg)] [.galaxy-star_&]:[transform:translateX(-50%)] [.galaxy-star_&]:[transition:color_var(--d1)_var(--ease-out)] [.galaxy-star_&]:whitespace-nowrap [.galaxy-star:hover_&]:text-[var(--galaxy-label-active)] [.galaxy-star.active_&]:text-[var(--galaxy-label-active)] [.galaxy-star.active_&]:font-[700]`,children:e.title})]},e.id))]}),!!y.length&&(0,k.jsxs)(`span`,{className:`pointer-events-none absolute right-3 bottom-2.5 z-[3] rounded-xs border border-[var(--galaxy-toolbar-border)] bg-[var(--galaxy-toolbar-bg)] px-2 text-xs leading-5 text-[var(--galaxy-label)] tabular-nums`,children:[`✦`,` `,c(`memory:memoryPage.visibleTotalMemories`,{visible:y.length,total:e.length})]}),!a&&!y.length&&(0,k.jsxs)(`div`,{className:`memory-empty [.galaxy-panel_&]:text-[var(--galaxy-label)] [.galaxy-panel_&]:[--stroke:var(--galaxy-toolbar-border)] [.galaxy-panel_&]:[--control-muted:var(--galaxy-label)] [.galaxy-panel_&]:[--star:var(--g-decision)] [.galaxy-panel_&]:[--text-muted:var(--galaxy-label)] absolute z-[3] inset-0 grid [align-content:center] justify-items-center gap-[8px] text-[var(--text-muted)] text-[12px] pointer-events-none`,children:[(0,k.jsx)(re,{size:44}),(0,k.jsx)(`span`,{children:c(`memory:memoryPage.thisMemorySpaceIsStillUnlitClickInTheTopLeftToPlantTheFirstStar`)})]})]})}var xe=[`concept`,`file`,`risk`,`preference`,`decision`,`fact`,`task`],F=`modal-backdrop fixed inset-0 z-[70] grid place-items-center overflow-y-auto overscroll-contain bg-[var(--modal-overlay)] p-5 max-[650px]:p-2`,I=`modal grid max-h-[calc(100dvh_-_40px)] w-[min(430px,100%)] gap-0.5 overflow-y-auto overscroll-contain rounded-dialog bg-popover p-5 shadow-float max-[650px]:max-h-[calc(100dvh_-_16px)]`,L=`key-value flex min-h-[34px] min-w-0 items-center justify-between gap-4 border-t border-stroke-soft text-sm [&>dt]:shrink-0 [&>dt]:text-content-muted [&>dd]:min-w-0 [&>dd]:truncate [&>dd]:text-right [&>dd]:text-content`;function Se(e,t){return t(e===`file`?`memory:memoryPage.fileType`:e===`risk`?`memory:memoryPage.riskType`:e===`preference`?`memory:memoryPage.preferenceType`:e===`decision`?`memory:memoryPage.decisionType`:e===`fact`?`memory:memoryPage.factType`:e===`task`?`memory:memoryPage.taskType`:`memory:memoryPage.conceptType`)}function Ce(e,t=`zh-CN`){if(!e)return`—`;let n=new Date(e);return Number.isNaN(n.getTime())?e:new Intl.DateTimeFormat(t,{year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,hour12:!1}).format(n)}function R(e,t=e=>e){return e?.kind===`global`?t(`memory:memoryPage.globalMemorySpace`):e?.name||``}function z(e){return e instanceof Error?e.message:String(e)}function we({notify:e,onBack:t,requestConfirm:n}){let a=y(`focusSearch`),[x,re]=(0,O.useState)(``),{t:C,language:w}=r(),[T,me]=(0,O.useState)({spaces:[],nodes:[],links:[],candidates:[],selectedSpaceId:``}),[E,D]=(0,O.useState)(``),[he,A]=(0,O.useState)(``),[ge,_e]=(0,O.useState)(``),[j,ye]=(0,O.useState)(`galaxy`),M=(0,O.useRef)(null),N=(0,O.useRef)(0),[P,F]=(0,O.useState)(!0),[I,we]=(0,O.useState)(!1),[De,B]=(0,O.useState)(``),[V,H]=(0,O.useState)(null),[Oe,U]=(0,O.useState)(null),[W,G]=(0,O.useState)(``),[K,ke]=(0,O.useState)(null),[Ae,q]=(0,O.useState)(``),[je,Me]=(0,O.useState)(`load`),[Ne,Pe]=(0,O.useState)(!0),J=(0,O.useRef)(null),Y=(0,O.useRef)(0),Fe=(0,O.useRef)(0),Ie=(0,O.useRef)(0),Le=(0,O.useRef)(null),X=(0,O.useRef)(null),Re=(0,O.useRef)(!1),Z=(0,O.useRef)(null),Q=(0,O.useRef)(!0),[ze,Be]=(0,O.useState)(!1),$=(0,O.useCallback)(async(e=``)=>{let t=++N.current;F(!0),B(``);try{let n=new URLSearchParams;e&&n.set(`spaceId`,e),x.trim()&&n.set(`query`,x.trim());let r=await i(`/api/memory?${n}`);if(t!==N.current)return;me(r),we(!0),D(r.selectedSpaceId||``),A(e=>r.nodes.some(t=>t.id===e)?e:r.nodes[0]?.id||``)}catch(e){t===N.current&&B(z(e))}finally{t===N.current&&F(!1)}},[x]);(0,O.useEffect)(()=>($(E),()=>{N.current+=1}),[$,E]);let Ve=(0,O.useCallback)(async()=>{Le.current?.abort();let e=new AbortController;Le.current=e;let t=++Fe.current,n=Y.current,r=n===Ie.current;Pe(!0),q(``);try{let a=await i(`/api/settings/memory`,{signal:e.signal});if(e.signal.aborted||!Q.current||t!==Fe.current)return;let o=a.autoApproveConfidence;if(typeof o!=`number`||!Number.isInteger(o)||o<0||o>100)throw Error(C(`memory:memoryPage.invalidAutoApproveThreshold`));r&&Y.current===n&&(J.current=o,ke(String(o)))}catch(n){!e.signal.aborted&&Q.current&&t===Fe.current&&(Me(`load`),q(z(n)))}finally{!e.signal.aborted&&Q.current&&t===Fe.current&&Pe(!1)}},[C]);(0,O.useEffect)(()=>(Q.current=!0,Ve(),()=>{Q.current=!1,Le.current?.abort(),X.current?.abort(),Z.current=null}),[Ve]);let He=async()=>{if(K===null||!K.trim()||J.current===null)return;let t=Number(K);if(!Number.isFinite(t))return;let n=Math.min(100,Math.max(0,Math.round(t)));if(!X.current&&!Re.current&&n===J.current){Z.current=null,Ie.current=Y.current,ke(String(n)),q(``);return}if(Z.current={value:n,revision:Y.current},X.current)return;let r=new AbortController;X.current=r,Be(!0),q(``);try{for(;Z.current&&Q.current&&!r.signal.aborted;){let t=Z.current;if(Z.current=null,t.value!==J.current||Re.current){try{await i(`/api/settings/memory`,{method:`PATCH`,body:{autoApproveConfidence:t.value},signal:r.signal})}catch(e){if(!Q.current||r.signal.aborted)return;Z.current||=t,Re.current=!0,Me(`save`),q(z(e));return}if(!Q.current||r.signal.aborted)return;J.current=t.value,Re.current=!1}Ie.current=t.revision,Y.current===t.revision&&(ke(String(t.value)),Z.current||e(C(`memory:memoryPage.autoApproveSaved`)))}}finally{X.current===r&&(X.current=null,Q.current&&Be(!1))}},Ue=T.nodes.find(e=>e.id===he)||null,We=e=>{let t=new Set(T.links.flatMap(t=>t.sourceId===e?[t.targetId]:t.targetId===e?[t.sourceId]:[]));return{count:t.size,files:T.nodes.filter(n=>n.type===`file`&&(t.has(n.id)||n.id===e))}},Ge=T.spaces.find(e=>e.id===E),Ke=async t=>{if(await n({title:C(`memory:memoryPage.deleteMemory`),message:C(`memory:memoryPage.deleteMemoryName`,{name:t.title}),confirmLabel:C(`memory:memoryPage.delete`)}))try{await i(`/api/memory/nodes/${encodeURIComponent(t.id)}`,{method:`DELETE`}),e(C(`memory:memoryPage.memoryDeleted`)),await $(E)}catch(e){B(z(e))}},qe=async(t,n)=>{if(!W){G(t.id),B(``);try{await i(`/api/memory/candidates/${encodeURIComponent(t.id)}/${n}`,{method:`POST`,body:`{}`}),e(C(n===`accept`?`memory:memoryPage.memoryCandidateConfirmed`:`memory:memoryPage.memoryCandidateIgnored`)),await $(E)}catch(e){B(z(e))}finally{G(``)}}},Je=async()=>{if(!(W||!T.candidates?.length)){G(`__all__`),B(``);try{let t=await i(`/api/memory/candidates/reject-all`,{method:`POST`,body:`{}`});e(C(`memory:memoryPage.ignoredCountMemoryDrafts`,{count:t.rejected||0})),await $(E)}catch(e){B(z(e))}finally{G(``)}}},Ye=async()=>{if(Ge&&await n({title:C(`memory:memoryPage.deleteMemorySpace`),message:C(`memory:memoryPage.deleteMemorySpaceNameAndAllMemoriesInIt`,{name:R(Ge,C)}),confirmLabel:C(`memory:memoryPage.delete`)}))try{await i(`/api/memory/spaces/${encodeURIComponent(Ge.id)}`,{method:`DELETE`}),D(``),A(``),e(C(`memory:memoryPage.memorySpaceDeleted`))}catch(e){B(z(e))}},Xe=C(`navigation:navigation.memory`),Ze=R(Ge,C),Qe=e=>{A(e),requestAnimationFrame(()=>M.current?.scrollIntoView({block:`nearest`}))},$e=(e,t)=>{let n=We(e.id);return(0,k.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3`,children:[t&&(0,k.jsxs)(`header`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,k.jsx)(`h3`,{className:`text-[15px] leading-6 font-medium break-words text-content`,children:e.title}),(0,k.jsx)(`p`,{className:`text-[13px] leading-normal break-words text-content-secondary`,children:e.content})]}),(0,k.jsxs)(`dl`,{children:[(0,k.jsxs)(`div`,{className:L,children:[(0,k.jsx)(`dt`,{children:C(`memory:memoryPage.memoryType`)}),(0,k.jsxs)(`dd`,{className:`inline-flex items-center justify-end gap-2`,children:[(0,k.jsx)(ve,{type:e.type}),Se(e.type,C)]})]}),(0,k.jsxs)(`div`,{className:L,children:[(0,k.jsx)(`dt`,{children:C(`memory:memoryPage.source`)}),(0,k.jsx)(`dd`,{children:e.sourceType===`conversation_confirmed`?C(`memory:memoryPage.userConfirmedConversationCandidate`):e.sourceType===`user_confirmed`?C(`memory:memoryPage.explicitUserRequest`):e.sourceType===`agent`?C(`memory:memoryPage.createdByAgent`):C(`memory:memoryPage.addedManually`)})]}),(0,k.jsxs)(`div`,{className:L,children:[(0,k.jsx)(`dt`,{children:C(`memory:memoryPage.authority`)}),(0,k.jsxs)(`dd`,{className:`tabular-nums`,children:[e.authority??0,`/100`]})]}),e.evidence&&(0,k.jsxs)(`div`,{className:L,children:[(0,k.jsx)(`dt`,{children:C(`memory:memoryPage.evidence`)}),(0,k.jsx)(`dd`,{title:e.evidence,children:e.evidence})]}),(0,k.jsxs)(`div`,{className:L,children:[(0,k.jsx)(`dt`,{children:C(`memory:memoryPage.created`)}),(0,k.jsx)(`dd`,{className:`tabular-nums`,children:Ce(e.createdAt,w)})]}),(0,k.jsxs)(`div`,{className:L,children:[(0,k.jsx)(`dt`,{children:C(`memory:memoryPage.relatedMemories`)}),(0,k.jsx)(`dd`,{className:`tabular-nums`,children:C(`memory:memoryPage.count`,{count:n.count})})]})]}),(0,k.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:[(0,k.jsxs)(v,{variant:`ghost`,size:`sm`,className:`text-danger hover:bg-danger-soft hover:text-danger max-[650px]:h-11`,onClick:()=>void Ke(e),children:[(0,k.jsx)(p,{}),C(`memory:memoryPage.delete`)]}),(0,k.jsxs)(v,{variant:`secondary`,size:`sm`,className:`max-[650px]:h-11`,onClick:()=>H(e),children:[(0,k.jsx)(l,{}),C(`memory:memoryPage.edit`)]})]}),(0,k.jsxs)(`section`,{className:`min-w-0`,"aria-label":C(`memory:memoryPage.relatedFiles`),children:[(0,k.jsxs)(`h4`,{className:`mb-1 text-xs font-medium text-content-muted tabular-nums`,children:[C(`memory:memoryPage.relatedFiles`),` · `,n.files.length]}),n.files.length?(0,k.jsx)(`ul`,{className:`divide-y divide-stroke-soft border-t border-stroke-soft`,children:n.files.map(t=>(0,k.jsxs)(`li`,{className:`file-row grid min-h-11 min-w-0 grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-2.5 py-1`,children:[(0,k.jsx)(s,{className:`size-4 text-content-muted`,"aria-hidden":`true`}),(0,k.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,k.jsx)(`strong`,{className:`truncate text-sm font-medium text-content`,children:t.title}),(0,k.jsx)(`small`,{className:`truncate font-mono text-xs text-content-muted`,children:t.sourcePath||t.cwd||C(`memory:memoryPage.localMemory`)})]}),(0,k.jsxs)(`span`,{className:`flex items-center`,children:[t.id!==e.id&&(0,k.jsx)(v,{variant:`ghost`,size:`sm`,className:`max-[650px]:h-11`,onClick:()=>j===`galaxy`?A(t.id):_e(t.id),children:C(`memory:memoryPage.view`)}),(0,k.jsx)(v,{variant:`ghost`,size:`icon-sm`,className:`max-[650px]:size-11`,"aria-label":`${C(`memory:memoryPage.edit`)}: ${t.title}`,onClick:()=>H(t),children:(0,k.jsx)(l,{})}),(0,k.jsx)(v,{variant:`ghost`,size:`icon-sm`,className:`text-content-muted hover:bg-danger-soft hover:text-danger max-[650px]:size-11`,"aria-label":`${C(`memory:memoryPage.delete`)}: ${t.title}`,onClick:()=>void Ke(t),children:(0,k.jsx)(p,{})})]})]},t.id))}):(0,k.jsx)(`p`,{className:`text-xs text-content-muted`,children:C(`memory:memoryPage.thisMemoryHasNoRelatedFiles`)})]})]})};return(0,k.jsxs)(le,{title:Xe,description:C(`memory:memoryPage.lede`),back:t&&{label:C(`navigation:sidebar.features`),ariaLabel:C(`navigation:shell.backToFeaturesLabel`),onBack:t},toolbar:(0,k.jsx)(ue,{search:(0,k.jsx)(ae,{id:h,value:x,onValueChange:re,placeholder:C(`navigation:pageHeader.searchMemoriesOrFiles`),shortcut:a,clearLabel:C(`navigation:more.clearSearch`)}),actions:(0,k.jsxs)(v,{type:`button`,className:`h-9`,disabled:!I,onClick:()=>H({spaceId:E||T.selectedSpaceId}),children:[(0,k.jsx)(u,{}),C(`memory:memoryPage.addMemory`)]}),filters:(0,k.jsx)(fe,{options:[C(`memory:memoryPage.galaxyView`),C(`memory:memoryPage.listView`)],value:C(j===`galaxy`?`memory:memoryPage.galaxyView`:`memory:memoryPage.listView`),onChange:e=>ye(e===C(`memory:memoryPage.listView`)?`list`:`galaxy`)})}),children:[!I&&P?(0,k.jsx)(S,{kind:`loading`,title:C(`common:pageTemplate.loading`)}):I?(0,k.jsxs)(k.Fragment,{children:[De&&(0,k.jsx)(de,{children:De}),(0,k.jsx)(ce,{title:C(`memory:memoryPage.memorySpaces`),count:T.spaces.length,actions:(0,k.jsxs)(v,{variant:`ghost`,size:`sm`,onClick:()=>U({}),children:[(0,k.jsx)(u,{}),C(`memory:memoryPage.newMemorySpace`)]}),children:(0,k.jsx)(se,{children:T.spaces.map(e=>{let t=e.id===E;return(0,k.jsx)(oe,{"data-memory-space":e.id,"aria-current":t||void 0,className:ne(`relative`,t&&`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`),icon:(0,k.jsx)(f,{}),onOpen:()=>{D(e.id),A(``),_e(``)},name:R(e,C),status:C(`memory:memoryPage.countMemories`,{count:e.nodeCount}),actions:t&&(0,k.jsxs)(`div`,{className:`memory-space-actions flex items-center gap-1`,children:[(0,k.jsxs)(v,{variant:`ghost`,size:`sm`,onClick:()=>U(e),children:[(0,k.jsx)(l,{}),C(`memory:memoryPage.rename`)]}),e.kind!==`global`&&(0,k.jsxs)(v,{variant:`ghost`,size:`sm`,className:`text-danger hover:bg-danger-soft hover:text-danger`,onClick:()=>void Ye(),children:[(0,k.jsx)(p,{}),C(`memory:memoryPage.delete`)]})]})},e.id)})})}),(0,k.jsx)(ce,{"data-memory-stars":!0,title:Ze||C(`memory:memoryPage.memorySpaces`),count:T.nodes.length,actions:(0,k.jsx)(v,{variant:`ghost`,size:`icon-sm`,className:`text-content-muted max-[650px]:size-11 pointer-coarse:size-11`,loading:P,disabled:P,"aria-label":C(`memory:memoryPage.refresh`),title:C(`memory:memoryPage.refresh`),onClick:()=>void $(E),children:(0,k.jsx)(d,{})}),children:j===`galaxy`?(0,k.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3`,children:[(0,k.jsx)(be,{nodes:T.nodes,links:T.links,spaceId:E,selectedId:he,loading:P,onSelect:Qe,onAdd:()=>H({spaceId:E})}),(0,k.jsx)(`div`,{role:`group`,"aria-label":C(`memory:memoryPage.memoryMapTypes`),className:`galaxy-legend flex flex-wrap gap-x-4 gap-y-1.5`,children:xe.map(e=>(0,k.jsxs)(`span`,{className:`flex items-center gap-1.5 text-xs text-content-secondary`,children:[(0,k.jsx)(ve,{type:e}),Se(e,C)]},e))}),(0,k.jsx)(`div`,{ref:M,role:`region`,"data-memory-detail":!0,"aria-label":C(`memory:memoryPage.selectedMemory`),className:`min-w-0 scroll-mb-4 rounded-[var(--r-md)] border border-stroke px-4 py-3`,children:Ue?$e(Ue,!0):(0,k.jsx)(`p`,{className:`text-xs leading-normal text-content-muted`,children:C(`memory:memoryPage.selectAMemoryInTheMapToViewItsDetails`)})})]}):T.nodes.length?(0,k.jsx)(se,{children:T.nodes.map(e=>(0,k.jsx)(oe,{"data-memory-node":e.id,icon:(0,k.jsx)(ve,{type:e.type}),name:e.title,nameMeta:Se(e.type,C),description:e.content,expanded:ge===e.id,onExpandedChange:t=>_e(t?e.id:``),toggleLabel:e.title,detail:$e(e,!1)},e.id))}):(0,k.jsx)(ie,{title:x.trim()?C(`memory:memoryPage.noMatchingMemories`):C(`memory:memoryPage.noMemoriesInSpace`)})}),(0,k.jsxs)(ce,{title:C(`memory:memoryPage.memoryDrafts`),count:T.candidates?.length||0,actions:!!T.candidates?.length&&(0,k.jsxs)(v,{variant:`ghost`,size:`sm`,disabled:!!W,onClick:()=>void Je(),children:[(0,k.jsx)(m,{}),C(`memory:memoryPage.ignoreAll`)]}),children:[Ne&&(0,k.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 py-2 text-xs text-content-muted`,children:[(0,k.jsx)(_,{className:`size-3.5`}),C(`memory:memoryPage.loadingAutoApproveThreshold`)]}),Ae&&(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 py-2`,children:[(0,k.jsxs)(pe,{className:`my-0`,children:[C(`memory:memoryPage.autoApproveThresholdUnavailable`),` `,Ae]}),(0,k.jsx)(v,{variant:`secondary`,size:`sm`,className:`max-[650px]:h-11`,disabled:Ne||ze,onClick:()=>void(je===`save`?He():Ve()),children:C(`memory:memoryPage.retryAutoApproveThreshold`)})]}),K!==null&&(0,k.jsxs)(`div`,{className:`memory-auto-approve-row flex min-h-12 items-center justify-between gap-3 border-t border-stroke py-1.5`,children:[(0,k.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5 text-sm font-medium text-content`,children:[(0,k.jsx)(`span`,{children:C(`memory:memoryPage.autoApproveThreshold`)}),(0,k.jsxs)(te,{children:[(0,k.jsx)(ee,{asChild:!0,children:(0,k.jsx)(c,{className:`size-3.5 shrink-0 text-content-muted`})}),(0,k.jsx)(g,{align:`center`,side:`top`,children:C(`memory:memoryPage.autoApproveThresholdHint`)})]})]}),(0,k.jsxs)(`span`,{className:`memory-auto-approve-input flex flex-none items-center gap-1.5 text-xs text-content-muted`,children:[(0,k.jsx)(b,{type:`number`,min:0,max:100,step:5,className:`h-7 w-16 text-right tabular-nums max-[650px]:h-11`,value:K,"aria-busy":ze,"aria-label":C(`memory:memoryPage.autoApproveThreshold`),onChange:e=>{Y.current+=1,ke(e.target.value)},onBlur:()=>void He(),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),He())}}),`%`,ze&&(0,k.jsx)(_,{className:`size-3.5`})]})]}),T.candidates?.length?(0,k.jsx)(se,{children:T.candidates.map(e=>(0,k.jsx)(oe,{className:`memory-candidate`,name:e.title,description:e.content,meta:(0,k.jsxs)(`span`,{className:`truncate tabular-nums`,children:[R(T.spaces.find(t=>t.id===e.spaceId),C),` · `,e.sourceType===`agent`?C(`memory:memoryPage.agentProposed`):C(`memory:memoryPage.conversationExtracted`),` · `,C(`memory:memoryPage.confidencePercent`,{value:Math.round((e.confidence||0)*100)})]}),actions:(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(v,{variant:`secondary`,size:`sm`,disabled:!!W,onClick:()=>void qe(e,`accept`),children:[(0,k.jsx)(o,{}),C(`memory:memoryPage.confirm`)]}),(0,k.jsxs)(v,{variant:`ghost`,size:`sm`,disabled:!!W,onClick:()=>void qe(e,`reject`),children:[(0,k.jsx)(m,{}),C(`memory:memoryPage.ignore`)]})]}),detail:(0,k.jsxs)(`div`,{className:`flex flex-col gap-0.5 text-xs leading-[1.5] text-content-muted`,children:[e.topicKey&&(0,k.jsxs)(`span`,{children:[C(`memory:memoryPage.topic`),`:`,(0,k.jsx)(`code`,{className:`font-mono`,children:e.topicKey})]}),e.evidence&&(0,k.jsxs)(`span`,{className:`[overflow-wrap:anywhere]`,children:[C(`memory:memoryPage.evidence`),`:`,e.evidence]}),(0,k.jsxs)(`span`,{className:`tabular-nums`,children:[C(`memory:memoryPage.created`),`:`,Ce(e.createdAt,w),e.expiresAt?` · ${C(`memory:memoryPage.expires`)}:${Ce(e.expiresAt,w)}`:``]})]})},e.id))}):(0,k.jsx)(`p`,{className:`border-t border-stroke py-3 text-xs text-content-muted`,children:C(`memory:memoryPage.thereAreNoPendingMemoryCandidates`)})]})]}):(0,k.jsx)(S,{kind:`error`,title:C(`memory:memoryPage.loadFailed`),description:De,action:(0,k.jsx)(v,{variant:`secondary`,className:`max-[650px]:h-11`,onClick:()=>void $(E),children:C(`common:pageTemplate.retry`)})}),V&&(0,k.jsx)(Te,{spaces:T.spaces,node:V.id?V:null,initialSpaceId:V.spaceId||E,onClose:()=>H(null),onSaved:async t=>{H(null),e(t),await $(E)}}),Oe&&(0,k.jsx)(Ee,{space:Oe.id?Oe:null,onClose:()=>U(null),onSaved:async(t,n)=>{U(null),D(t.id),e(n)}})]})}function Te({spaces:e,node:t,initialSpaceId:n,onClose:a,onSaved:o}){let{t:s}=r(),[c,u]=(0,O.useState)({spaceId:t?.spaceId||n||e[0]?.id||``,title:t?.title||``,content:t?.content||``,type:t?.type||`concept`,sourcePath:t?.sourcePath||``,importance:t?.importance??.5}),[d,f]=(0,O.useState)(!1),[p,h]=(0,O.useState)(``);return(0,k.jsx)(`div`,{className:F,onMouseDown:e=>!d&&e.target===e.currentTarget&&a(),children:(0,k.jsxs)(`form`,{role:`dialog`,"aria-modal":`true`,"aria-label":s(t?`memory:memoryPage.editMemory`:`memory:memoryPage.addMemory`),className:I,onSubmit:async e=>{if(e.preventDefault(),!d){f(!0),h(``);try{await i(t?`/api/memory/nodes/${encodeURIComponent(t.id)}`:`/api/memory/nodes`,{method:t?`PATCH`:`POST`,body:JSON.stringify(c)}),await o(s(t?`memory:memoryPage.memoryUpdated`:`memory:memoryPage.memoryCreated`))}catch(e){h(z(e))}finally{f(!1)}}},children:[(0,k.jsxs)(T,{className:`[&_h2]:text-[15px] [&_h2]:font-medium`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`h2`,{children:s(t?`memory:memoryPage.editMemory`:`memory:memoryPage.addMemory`)}),(0,k.jsx)(`p`,{children:s(`memory:memoryPage.lightUpIdeasWorthKeepingAsMemoriesYouCanReturnToLater`)})]}),(0,k.jsx)(v,{type:`button`,variant:`ghost`,size:`icon`,className:`-mt-1 -mr-1 max-[650px]:size-11`,"aria-label":s(`memory:memoryPage.closeDialog`),disabled:d,onClick:a,children:(0,k.jsx)(m,{})})]}),(0,k.jsxs)(C,{variant:`control`,children:[s(`memory:memoryPage.memorySpace`),(0,k.jsx)(w,{value:c.spaceId,onChange:e=>u({...c,spaceId:e.target.value}),children:e.map(e=>(0,k.jsx)(`option`,{value:e.id,children:R(e,s)},e.id))})]}),(0,k.jsxs)(C,{variant:`control`,children:[s(`memory:memoryPage.memoryTitle`),(0,k.jsx)(b,{value:c.title,onChange:e=>u({...c,title:e.target.value}),placeholder:s(`memory:memoryPage.forExampleProjectUIConstraints`)})]}),(0,k.jsxs)(C,{variant:`control`,children:[s(`memory:memoryPage.memoryContent`),(0,k.jsx)(x,{value:c.content,onChange:e=>u({...c,content:e.target.value}),placeholder:s(`memory:memoryPage.recordStandaloneReusableMemoryForFutureChats`)})]}),(0,k.jsxs)(`div`,{className:`form-grid grid gap-x-2.5 sm:grid-cols-2`,children:[(0,k.jsxs)(C,{variant:`control`,children:[s(`memory:memoryPage.memoryType`),(0,k.jsx)(w,{value:c.type,onChange:e=>u({...c,type:e.target.value}),children:xe.map(e=>(0,k.jsx)(`option`,{value:e,children:Se(e,s)},e))})]}),(0,k.jsxs)(C,{variant:`control`,children:[s(`memory:memoryPage.importance`),(0,k.jsxs)(w,{value:c.importance,onChange:e=>u({...c,importance:Number(e.target.value)}),children:[(0,k.jsx)(`option`,{value:`0.3`,children:s(`memory:memoryPage.normal`)}),(0,k.jsx)(`option`,{value:`0.5`,children:s(`memory:memoryPage.common`)}),(0,k.jsx)(`option`,{value:`0.8`,children:s(`memory:memoryPage.important`)}),(0,k.jsx)(`option`,{value:`1`,children:s(`memory:memoryPage.strict`)})]})]})]}),(0,k.jsxs)(C,{variant:`control`,children:[s(`memory:memoryPage.relatedFilePath`),(0,k.jsx)(b,{value:c.sourcePath,onChange:e=>u({...c,sourcePath:e.target.value}),placeholder:s(`memory:memoryPage.optionalForExampleECodeProjectREADMEMd`)})]}),p&&(0,k.jsx)(pe,{children:p}),(0,k.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,k.jsx)(v,{type:`button`,variant:`secondary`,size:`dialogAction`,onClick:a,children:s(`memory:memoryPage.cancel`)}),(0,k.jsxs)(v,{type:`submit`,size:`dialogAction`,disabled:d||!c.spaceId||!c.title.trim()||!c.content.trim(),children:[d?(0,k.jsx)(_,{className:`text-current`}):(0,k.jsx)(l,{}),s(d?`memory:memoryPage.saving`:`memory:memoryPage.save`)]})]})]})})}function Ee({space:e,onClose:t,onSaved:n}){let{t:a}=r(),[o,s]=(0,O.useState)(e?.name||``),[c,l]=(0,O.useState)(!1),[d,f]=(0,O.useState)(``);return(0,k.jsx)(`div`,{className:F,onMouseDown:e=>!c&&e.target===e.currentTarget&&t(),children:(0,k.jsxs)(`form`,{role:`dialog`,"aria-modal":`true`,"aria-label":a(e?`memory:memoryPage.renameMemorySpace`:`memory:memoryPage.newMemorySpace`),className:I,onSubmit:async t=>{if(t.preventDefault(),!c){l(!0),f(``);try{await n(await i(e?`/api/memory/spaces/${encodeURIComponent(e.id)}`:`/api/memory/spaces`,{method:e?`PATCH`:`POST`,body:JSON.stringify({name:o,kind:`custom`})}),a(e?`memory:memoryPage.memorySpaceRenamed`:`memory:memoryPage.memorySpaceCreated`))}catch(e){f(z(e))}finally{l(!1)}}},children:[(0,k.jsxs)(T,{className:`[&_h2]:text-[15px] [&_h2]:font-medium`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`h2`,{children:a(e?`memory:memoryPage.renameMemorySpace`:`memory:memoryPage.newMemorySpace`)}),(0,k.jsx)(`p`,{children:a(`memory:memoryPage.giveEachThemeOrProjectItsOwnMemorySpaceSoDurableMemoriesHaveSomewhereToBelong`)})]}),(0,k.jsx)(v,{type:`button`,variant:`ghost`,size:`icon`,className:`-mt-1 -mr-1 max-[650px]:size-11`,"aria-label":a(`memory:memoryPage.closeDialog`),disabled:c,onClick:t,children:(0,k.jsx)(m,{})})]}),(0,k.jsxs)(C,{variant:`control`,children:[a(`memory:memoryPage.memorySpaceName`),(0,k.jsx)(b,{value:o,onChange:e=>s(e.target.value),placeholder:a(`memory:memoryPage.forExampleProductDesignGuidelines`),autoFocus:!0})]}),d&&(0,k.jsx)(pe,{children:d}),(0,k.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,k.jsx)(v,{type:`button`,variant:`secondary`,size:`dialogAction`,onClick:t,children:a(`memory:memoryPage.cancel`)}),(0,k.jsxs)(v,{type:`submit`,size:`dialogAction`,disabled:c||!o.trim(),children:[c?(0,k.jsx)(_,{className:`text-current`}):(0,k.jsx)(u,{}),a(c?`memory:memoryPage.saving`:`memory:memoryPage.save`)]})]})]})})}export{we as MemoryPage};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{t as r}from"./use-i18n-vlX9sewC.js";import{t as i}from"./runtime-capabilities-store-CHtOHvCw.js";import{t as a}from"./chevron-left-BAtyp3_6.js";import{t as o}from"./chevron-right-C3t2Rckj.js";import{r as s}from"./settings-navigation-DiP_AM1C.js";var c=e(t(),1),l=n(),u=`flex min-h-14 w-full min-w-0 items-center gap-3 px-4 text-left text-base text-content focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus active:bg-surface-hover`;function d({onNavigate:e,onOpenFeatures:t}){let{t:n}=r(),a=i(e=>e.capabilities),d=(0,c.useMemo)(()=>s(n,{capabilities:a}),[a,n]);return(0,l.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto bg-background`,children:[(0,l.jsx)(`h1`,{className:`sr-only`,children:n(`navigation:navigation.settings`)}),(0,l.jsx)(`nav`,{"aria-label":n(`config:settingsShell.settingsNavigation`),"data-mobile-navigation":`settings`,className:`mx-4 mt-2 overflow-hidden rounded-[14px] border border-stroke-soft bg-panel`,children:(0,l.jsx)(`ul`,{className:`m-0 list-none p-0 [&>li+li]:border-t [&>li+li]:border-stroke-soft`,children:d.map(t=>{let n=t.icon;return(0,l.jsx)(`li`,{children:(0,l.jsxs)(`button`,{type:`button`,"data-settings-section":t.section,className:u,onClick:()=>e(t.section),children:[(0,l.jsx)(n,{className:`size-[18px] flex-none text-content-secondary`,strokeWidth:1.75,"aria-hidden":`true`}),(0,l.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t.label}),(0,l.jsx)(o,{className:`size-4 flex-none text-content-faint`,"aria-hidden":`true`})]})},t.section)})})}),(0,l.jsx)(`button`,{type:`button`,"data-settings-features-hint":!0,className:`mx-4 mt-3 flex min-h-11 items-center rounded-[var(--r-md)] px-1 text-left text-sm text-content-muted focus-visible:outline-2 focus-visible:outline-focus active:text-content`,onClick:t,children:n(`config:settingsShell.featuresHint`)})]})}function f({onBack:e}){let{t}=r();return(0,l.jsx)(`div`,{className:`flex flex-none px-2 pt-1`,children:(0,l.jsxs)(`button`,{type:`button`,"data-settings-back":!0,className:`flex h-11 items-center gap-0.5 rounded-[var(--r-md)] pr-3 pl-1 text-sm text-content-secondary focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus active:bg-surface-hover`,onClick:e,children:[(0,l.jsx)(a,{className:`size-5`,"aria-hidden":`true`}),t(`navigation:navigation.settings`)]})})}export{f as MobileSettingsBack,d as MobileSettingsList};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{t as r}from"./use-i18n-BuN5i-jP.js";import{t as i}from"./runtime-capabilities-store-B5Bam7pC.js";import{t as a}from"./chevron-left-BAtyp3_6.js";import{t as o}from"./chevron-right-C3t2Rckj.js";import{r as s}from"./settings-navigation-DiP_AM1C.js";var c=e(t(),1),l=n(),u=`flex min-h-14 w-full min-w-0 items-center gap-3 px-4 text-left text-base text-content focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus active:bg-surface-hover`;function d({onNavigate:e,onOpenFeatures:t}){let{t:n}=r(),a=i(e=>e.capabilities),d=(0,c.useMemo)(()=>s(n,{capabilities:a}),[a,n]);return(0,l.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto bg-background`,children:[(0,l.jsx)(`h1`,{className:`sr-only`,children:n(`navigation:navigation.settings`)}),(0,l.jsx)(`nav`,{"aria-label":n(`config:settingsShell.settingsNavigation`),"data-mobile-navigation":`settings`,className:`mx-4 mt-2 overflow-hidden rounded-[14px] border border-stroke-soft bg-panel`,children:(0,l.jsx)(`ul`,{className:`m-0 list-none p-0 [&>li+li]:border-t [&>li+li]:border-stroke-soft`,children:d.map(t=>{let n=t.icon;return(0,l.jsx)(`li`,{children:(0,l.jsxs)(`button`,{type:`button`,"data-settings-section":t.section,className:u,onClick:()=>e(t.section),children:[(0,l.jsx)(n,{className:`size-[18px] flex-none text-content-secondary`,strokeWidth:1.75,"aria-hidden":`true`}),(0,l.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t.label}),(0,l.jsx)(o,{className:`size-4 flex-none text-content-faint`,"aria-hidden":`true`})]})},t.section)})})}),(0,l.jsx)(`button`,{type:`button`,"data-settings-features-hint":!0,className:`mx-4 mt-3 flex min-h-11 items-center rounded-[var(--r-md)] px-1 text-left text-sm text-content-muted focus-visible:outline-2 focus-visible:outline-focus active:text-content`,onClick:t,children:n(`config:settingsShell.featuresHint`)})]})}function f({onBack:e}){let{t}=r();return(0,l.jsx)(`div`,{className:`flex flex-none px-2 pt-1`,children:(0,l.jsxs)(`button`,{type:`button`,"data-settings-back":!0,className:`flex h-11 items-center gap-0.5 rounded-[var(--r-md)] pr-3 pl-1 text-sm text-content-secondary focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus active:bg-surface-hover`,onClick:e,children:[(0,l.jsx)(a,{className:`size-5`,"aria-hidden":`true`}),t(`navigation:navigation.settings`)]})})}export{f as MobileSettingsBack,d as MobileSettingsList};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{t as r}from"./use-i18n-vlX9sewC.js";import{t as i}from"./useQuery-DdcpUQhO.js";import{a,l as o}from"./api-DHnp1y9B.js";import{a as s,n as c,t as l}from"./runtime-capabilities-CHYOF_hE.js";import{t as u}from"./runtime-capabilities-store-CHtOHvCw.js";import{m as d}from"./placements-C0pW79Hw.js";import{t as ee}from"./client-store-DpQBjfeA.js";import{t as f}from"./usePhoneShell-B1bMHq-t.js";import{t as p}from"./createLucideIcon-Cd-3GVxJ.js";import{t as m}from"./app-window-CPNdvYNt.js";import{t as h}from"./blocks-Olsdp5Lp.js";import{t as g}from"./bot-B3TaBp_T.js";import{t as _}from"./brain-qxhnKqYP.js";import{t as v}from"./calendar-clock-VIxTaqqy.js";import{t as y}from"./chevron-right-C3t2Rckj.js";import{t as b}from"./image-BY_c3FYU.js";import{t as x}from"./monitor-smartphone-B1gIjItA.js";import{t as S}from"./plug-BsIeHRwC.js";import{t as C}from"./plus-fQbSqB1n.js";import{t as w}from"./radio-tower-jGQwrFWB.js";import{t as T}from"./rotate-ccw-clock-CO6Bw-sF.js";import{t as E}from"./search-D0mqDaf_.js";import{t as te}from"./server-BgNvmqwJ.js";import{t as ne}from"./sparkles-S_eeuqn9.js";import{t as re}from"./workflow-Bg94dy8I.js";import{t as D}from"./x-07u4-129.js";import{t as O}from"./brand-DIEc3fK8.js";import{i as k}from"./more-pages-D_PnxLN0.js";import{t as A}from"./utils-C8uzG5AZ.js";import{t as j}from"./button-CCcCN8tE.js";import{t as M}from"./kbd-CAufZTkl.js";import{g as ie}from"./events-BphhtnIg.js";import{n as N,r as P}from"./config-search-DLn9UUQp.js";import{s as F}from"./shortcuts-DDYN6uA3.js";var I=p(`command`,[[`path`,{d:`M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3`,key:`11bfej`}]]),L=e(t(),1),R=`add:component`;function z(e,{capabilities:t=l,mobileApp:n=!1,components:r=[]}={}){let i=(e,n,r,i)=>s(t,e)?{key:`page:${e}`,label:n,description:r,icon:i,destination:{type:`page`,id:e}}:null,a=e=>c(t,e,{mobileApp:n}),o=a(`remote-access`),u=a(`desktop-pet`),d=[a(`mobile-server`).supported?{key:`config:mobile-server`,label:e(`config:configPage.mobileServer`),description:e(`navigation:more.mobileServerHint`),icon:x,destination:{type:`config`,id:`mobile-server`}}:o.supported?{key:`config:remote-access`,label:e(`config:configPage.remoteAccess`),description:e(`navigation:more.remoteAccessHint`),icon:x,destination:{type:`config`,id:`remote-access`}}:null,u.supported||u.reason===`desktop-only`?{key:`config:desktop-pet`,label:e(`config:configPage.desktopPet`),description:e(`navigation:more.desktopPetHint`),icon:g,destination:{type:`config`,id:`desktop-pet`},...u.supported?{}:{disabledReason:e(`navigation:more.desktopOnly`)}}:null];return[{id:`sessions`,label:e(`navigation:more.groupSessions`),tiles:[i(`chatHistory`,e(`navigation:navigation.chatHistory`),e(`navigation:more.chatHistoryHint`),T),i(`assets`,e(`navigation:navigation.assets`),e(`navigation:more.assetsHint`),b),i(`memory`,e(`navigation:navigation.memory`),e(`navigation:more.memoryHint`),_)]},{id:`automation`,label:e(`navigation:more.groupAutomation`),tiles:[i(`workflows`,e(`navigation:navigation.workflows`),e(`navigation:more.workflowsHint`),re),i(`schedules`,e(`navigation:navigation.schedules`),e(`navigation:more.schedulesHint`),v),i(`channels`,e(`navigation:navigation.channels`),e(`navigation:more.channelsHint`),w)]},{id:`extensions`,label:e(`navigation:more.groupExtensions`),tiles:[i(`plugins`,e(`navigation:navigation.plugins`),e(`navigation:more.pluginsHint`),S),i(`skills`,e(`navigation:navigation.skills`),e(`navigation:more.skillsHint`),ne),i(`mcp`,e(`navigation:navigation.mcp`),e(`navigation:more.mcpHint`),te),{key:`page:components`,label:e(`navigation:shell.components`),description:e(`navigation:more.componentStudioHint`),icon:h,destination:{type:`page`,id:`components`}}]},{id:`devices`,label:e(`navigation:more.groupDevices`),tiles:d},{id:`components`,label:e(`navigation:more.groupComponents`),tiles:[...r.map(t=>({key:`component:${t.id}`,label:t.name,description:t.description||e(`navigation:more.componentHint`),icon:m,destination:{type:`component`,id:t.id}})),{key:R,label:e(`navigation:more.addComponent`),description:e(`navigation:more.addComponentHint`),icon:C,destination:{type:`page`,id:`components`}}]}].map(e=>({id:e.id,label:e.label,tiles:e.tiles.filter(e=>e!==null)})).filter(e=>e.tiles.length>0)}function B(e,t,n){let r=t.trim().toLocaleLowerCase(n);return r?e.map(e=>({...e,tiles:e.tiles.filter(t=>[t.label,t.description,e.label].some(e=>e.toLocaleLowerCase(n).includes(r)))})).filter(e=>e.tiles.length>0):[...e]}var V=new Set([`connected`,`connecting`,`reconnecting`]);function H(e){let t=e&&typeof e==`object`?e.connections:null;if(!t||typeof t!=`object`||Array.isArray(t))throw o();let n=0;for(let e of Object.values(t)){if(!e||typeof e!=`object`)continue;let{enabled:t,status:r}=e;t!==!1&&(typeof r!=`string`||!V.has(r))&&(n+=1)}return n}function U(e){return a(`/api/channels`,{signal:e,parse:H})}function W(e){let t=e&&typeof e==`object`?e.metrics:null,n=t&&typeof t==`object`?t.onlineServices:void 0;if(typeof n!=`number`||!Number.isFinite(n)||n<0)throw o();return Math.floor(n)}function G(e){return a(`/api/mcp?refresh=0`,{signal:e,parse:W})}function K(e){let t=e&&typeof e==`object`?e.tasks:null;if(!Array.isArray(t))throw o();return t.filter(e=>e&&typeof e==`object`&&e.enabled===!0).length}function q(e){return a(`/api/schedules`,{signal:e,parse:K})}function J(e){let t=e&&typeof e==`object`?e.limits:null,n=t&&typeof t==`object`?t.running:void 0;if(typeof n!=`number`||!Number.isFinite(n)||n<0)throw o();return Math.floor(n)}function ae(e){return a(`/api/workflows`,{signal:e,parse:J})}var Y=[{key:`page:workflows`,load:ae,tone:`run`,interval:15e3},{key:`page:schedules`,load:q,tone:`neutral`,interval:6e4},{key:`page:channels`,load:U,tone:`attn`,interval:3e4},{key:`page:mcp`,load:G,tone:`neutral`,interval:6e4}];function X(e,t){return i({queryKey:[`more-tile-badge`,e.key],queryFn:({signal:t})=>e.load(t),enabled:t,staleTime:1e4,refetchInterval:t?e.interval:!1,retry:!1}).data}function oe(e,t){let n=[X(Y[0],t.has(Y[0].key)),X(Y[1],t.has(Y[1].key)),X(Y[2],t.has(Y[2].key)),X(Y[3],t.has(Y[3].key))],r=[t=>e(`navigation:more.badgeRunning`,{count:t}),t=>e(`navigation:more.badgeEnabled`,{count:t}),t=>e(`navigation:more.badgeDisconnected`,{count:t}),t=>e(`navigation:more.badgeOnline`,{count:t})],i=new Map;return Y.forEach((e,a)=>{let o=n[a];typeof o==`number`&&o>0&&t.has(e.key)&&i.set(e.key,{label:r[a](o),tone:e.tone})}),i}var Z=n(),se=6,Q=`[data-more-tile]`,$=``;function ce(e,t){return e?.querySelector(`[data-more-tile="${CSS.escape(t)}"]`)??null}function le({onOpen:e}){let{t,language:n}=r(),i=(0,L.useId)(),[a,o]=(0,L.useState)(``),s=F(`commandPalette`),c=F(`focusSearch`),l=u(e=>e.capabilities),p=ee(e=>e.client===`mobile-app`),m=f(),h=t(`navigation:more.title`),g=d(),_=(0,L.useMemo)(()=>g.items.map(({componentId:e,name:t,description:n})=>({id:e,name:t,description:n})),[g.items]),v=(0,L.useMemo)(()=>z(t,{capabilities:l,mobileApp:p,components:_}),[l,_,p,t]),b=(0,L.useMemo)(()=>B(v,a,n),[v,n,a]),x=oe(t,(0,L.useMemo)(()=>new Set(v.flatMap(e=>e.tiles.map(e=>e.key))),[v])),S=(0,L.useMemo)(()=>a.trim()?P(a,n,{capabilities:l,mobileApp:p}).slice(0,se):[],[l,n,p,a]);(0,L.useEffect)(()=>(document.title=`${h} · ${O}`,()=>{document.title=O}),[h]);let C=t=>{if(t.entry.card===`interface-custom-ui`){e({type:`page`,id:`components`});return}N(t.entry.card,t.entry.section,{targetId:t.entry.targetId,targetText:t.title,expandGroup:t.entry.expandGroup}),e({type:`config`,id:t.entry.section})},w=(0,Z.jsxs)(j,{variant:`outline`,className:`h-auto min-h-11 w-full justify-start gap-2.5 py-2 text-left whitespace-normal`,"data-more-palette-search":!0,onClick:()=>ie(a.trim()),children:[m?(0,Z.jsx)(E,{className:`flex-none`,"aria-hidden":`true`}):(0,Z.jsx)(I,{className:`flex-none`,"aria-hidden":`true`}),(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,Z.jsx)(`span`,{className:`truncate text-sm text-content`,children:t(`navigation:more.searchPalette`,{query:a.trim()})}),(0,Z.jsx)(`span`,{className:`text-xs font-normal text-content-muted`,children:t(`navigation:more.searchPaletteHint`)})]})]}),T=`mb-2 text-[13px] font-medium text-content-muted`;return(0,L.useLayoutEffect)(()=>{let e=document.querySelector(`[data-features-index]`),t=$;$=``;let n=0,r=0,i=!t,a=()=>{let o=ce(e,t);o?(o.focus(),i=!0):(n+=1)<20?r=requestAnimationFrame(a):i=!0};return t&&(r=requestAnimationFrame(a)),()=>{cancelAnimationFrame(r),i||($=t);let n=document.activeElement,a=n instanceof HTMLElement&&e?.contains(n)?n.closest(Q):null;a?.dataset.moreTile&&($=a.dataset.moreTile)}},[]),(0,Z.jsxs)(`div`,{"data-features-index":!0,className:`flex h-full min-h-0 w-full flex-col bg-background`,children:[!m&&(0,Z.jsx)(`div`,{"data-window-drag-region":!0,"aria-hidden":`true`,className:`h-[52px] flex-none`}),(0,Z.jsx)(`div`,{"data-features-scroller":!0,className:`min-h-0 flex-1 overflow-y-auto overscroll-contain`,onKeyDown:ue,children:(0,Z.jsxs)(`div`,{"data-features-column":!0,className:`mx-auto flex w-full max-w-[808px] flex-col px-6 pb-16 max-[650px]:px-4 max-[650px]:pt-4 max-[650px]:pb-8`,children:[(0,Z.jsxs)(`header`,{"data-focus-region":`header`,className:`flex flex-col`,children:[(0,Z.jsx)(`h1`,{id:i,className:A(`text-2xl leading-8 font-semibold tracking-[-.01em] text-content`,m&&`sr-only`),children:h}),(0,Z.jsx)(`p`,{className:A(`mt-1 text-sm text-content-muted`,m&&`hidden`),children:s&&!m?t(`navigation:more.lede`,{shortcut:s}):t(`navigation:more.ledeNoShortcut`)}),(0,Z.jsxs)(`label`,{className:A(`relative mt-5 flex h-9 w-full items-center gap-2 rounded-[var(--r-md)] border border-control bg-panel px-3 text-content-muted focus-within:border-focus focus-within:ring-3 focus-within:ring-focus-ring max-[650px]:h-11`,m&&`mt-0`),children:[(0,Z.jsx)(E,{className:`size-4 flex-none`,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:t(`navigation:more.search`)}),(0,Z.jsx)(`input`,{id:k,type:`search`,value:a,placeholder:t(`navigation:more.search`),"aria-keyshortcuts":c||void 0,className:`w-full min-w-0 border-0 bg-transparent text-[length:var(--app-font-size)] text-content caret-focus outline-none max-[650px]:text-[16px] [&::-webkit-search-cancel-button]:hidden`,onChange:e=>o(e.target.value),onKeyDown:e=>{if(e.key===`Escape`&&a)e.preventDefault(),e.stopPropagation(),o(``);else if(e.key===`ArrowDown`){let t=e.currentTarget.closest(`[data-features-scroller]`)?.querySelector(Q);t&&(e.preventDefault(),e.stopPropagation(),t.focus())}}}),a?(0,Z.jsx)(`button`,{type:`button`,className:`grid size-6 flex-none place-items-center rounded-xs text-content-muted hover:bg-surface-hover hover:text-content focus-visible:outline-2 focus-visible:outline-focus pointer-coarse:size-11`,"aria-label":t(`navigation:more.clearSearch`),onClick:()=>o(``),children:(0,Z.jsx)(D,{className:`size-3.5`,"aria-hidden":`true`})}):c&&(0,Z.jsx)(M,{className:`flex-none pointer-coarse:hidden`,children:c})]})]}),b.length===0&&S.length===0?(0,Z.jsxs)(`div`,{role:`status`,"data-features-empty":!0,className:`flex flex-col items-center gap-2 py-16 text-center`,children:[(0,Z.jsx)(`p`,{className:`text-sm font-medium text-content`,children:t(`navigation:more.noResults`)}),(0,Z.jsx)(`p`,{className:`max-w-sm text-xs text-content-muted`,children:t(`navigation:more.noResultsHint`,{shortcut:s||`⌘K`})}),(0,Z.jsxs)(`div`,{className:`mt-2 flex w-full max-w-sm flex-col gap-2`,children:[w,(0,Z.jsx)(j,{variant:`secondary`,className:`min-h-11`,onClick:()=>o(``),children:t(`navigation:more.clearSearch`)})]})]}):b.map(n=>{let r=`${i}-${n.id}`;return(0,Z.jsxs)(`section`,{"data-more-group":n.id,"aria-labelledby":r,className:`mt-7 flex flex-col`,children:[(0,Z.jsx)(`h2`,{id:r,className:T,children:n.label}),(0,Z.jsx)(`ul`,{className:`grid grid-cols-2 gap-2 max-[650px]:grid-cols-1`,children:n.tiles.map(t=>(0,Z.jsx)(`li`,{className:`min-w-0`,children:(0,Z.jsx)(de,{tile:t,badge:x.get(t.key),onOpen:e})},t.key))}),n.id===`components`&&!a&&g.isLoading&&(0,Z.jsx)(`p`,{role:`status`,className:`mt-2 text-xs text-content-muted`,children:t(`navigation:more.componentsLoading`)}),n.id===`components`&&!a&&!!g.error&&(0,Z.jsxs)(`p`,{role:`alert`,className:`mt-2 flex items-center gap-2 text-xs text-content-muted`,children:[t(`navigation:more.componentsError`),(0,Z.jsx)(j,{variant:`ghost`,size:`xs`,onClick:g.refetch,children:t(`navigation:more.retry`)})]})]},n.id)}),a.trim()&&(b.length>0||S.length>0)&&(0,Z.jsxs)(`section`,{"aria-labelledby":`${i}-search`,className:`mt-7 flex flex-col`,children:[(0,Z.jsx)(`h2`,{id:`${i}-search`,className:T,children:t(`navigation:more.settingsResults`)}),S.length>0&&(0,Z.jsx)(`ul`,{"data-more-settings-results":!0,className:`mb-2 flex flex-col divide-y divide-stroke-soft overflow-hidden rounded-card border border-stroke`,children:S.map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`button`,{type:`button`,className:`flex min-h-11 w-full min-w-0 items-center gap-3 px-3.5 py-2 text-left transition-colors duration-(--d-fast) hover:bg-surface-hover focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus`,onClick:()=>C(e),children:[(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,Z.jsx)(`span`,{className:`truncate text-sm text-content`,children:e.title}),e.sectionTitle!==e.title&&(0,Z.jsx)(`span`,{className:`truncate text-xs text-content-muted`,children:e.sectionTitle})]}),(0,Z.jsx)(y,{className:`size-4 flex-none text-content-muted`,"aria-hidden":`true`})]})},e.entry.id))}),w]})]})})]})}function ue(e){let t=e.target;if(!(t instanceof HTMLElement)||!t.matches(Q)||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)return;let n=[...e.currentTarget.querySelectorAll(Q)],r=n.indexOf(t);if(r<0)return;let i;if(e.key===`ArrowRight`)i=n[r+1];else if(e.key===`ArrowLeft`)i=n[r-1];else if(e.key===`Home`)i=n[0];else if(e.key===`End`)i=n.at(-1);else if(e.key===`ArrowDown`||e.key===`ArrowUp`){let r=t.getBoundingClientRect(),a=e.key===`ArrowDown`,o=r.left+r.width/2,s=n.map(e=>({tile:e,box:e.getBoundingClientRect()})).filter(({box:e})=>a?e.top>=r.bottom-1:e.bottom<=r.top+1);if(s.length>0){let e=a?Math.min(...s.map(({box:e})=>e.top)):Math.max(...s.map(({box:e})=>e.top));i=s.filter(({box:t})=>Math.abs(t.top-e)<2).sort((e,t)=>Math.abs(e.box.left+e.box.width/2-o)-Math.abs(t.box.left+t.box.width/2-o))[0]?.tile}else if(!a){document.getElementById(k)?.focus(),e.preventDefault();return}}else return;e.preventDefault(),i?.focus()}function de({tile:e,badge:t,onOpen:n}){let{t:i}=r(),a=e.icon,o=!!e.disabledReason,s=e.key===R;return(0,Z.jsxs)(`button`,{type:`button`,"data-more-tile":e.key,"aria-disabled":o||void 0,"aria-label":o?i(`navigation:more.disabledTile`,{label:e.label,reason:e.disabledReason}):void 0,className:A(`flex min-h-16 w-full min-w-0 items-center gap-3 rounded-card border px-3.5 py-2.5 text-left transition-colors duration-(--d-fast) focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus max-[650px]:min-h-14 max-[650px]:py-2`,s?`border-dashed border-stroke-strong`:`border-stroke`,o?`cursor-not-allowed`:`hover:bg-surface-hover`),onClick:()=>{o||($=e.key,n(e.destination))},children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:A(`grid size-[34px] flex-none place-items-center rounded-[var(--r-md)] max-[650px]:size-8`,s?`text-content-muted`:`bg-surface-subtle text-content-secondary`,o&&`text-content-muted`),children:(0,Z.jsx)(a,{className:`size-[18px]`,strokeWidth:1.75})}),(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,Z.jsx)(`span`,{className:A(`truncate text-sm font-medium text-content`,(o||s)&&`text-content-secondary`),children:e.label}),(0,Z.jsx)(`span`,{className:`truncate text-xs text-content-muted`,children:e.disabledReason||e.description})]}),t&&!o&&(0,Z.jsxs)(`span`,{"data-more-badge":t.tone,className:A(`flex max-w-[45%] flex-none items-center gap-1.5 text-xs whitespace-nowrap tabular-nums`,t.tone===`attn`?`font-medium text-st-attn`:`text-content-muted`),children:[t.tone===`attn`&&(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`size-2 flex-none rounded-full bg-st-attn-fill`}),(0,Z.jsx)(`span`,{className:`truncate`,children:t.label})]})]})}export{le as MorePage};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{t as r}from"./use-i18n-BuN5i-jP.js";import{t as i}from"./useQuery-DdcpUQhO.js";import{a,l as o}from"./api-Dg-aNpVe.js";import{a as s,n as c,t as l}from"./runtime-capabilities-CHYOF_hE.js";import{t as u}from"./runtime-capabilities-store-B5Bam7pC.js";import{m as d}from"./placements-DNdBLaY4.js";import{t as ee}from"./client-store-DF9a8Ka9.js";import{t as f}from"./usePhoneShell-Bkus67DO.js";import{t as p}from"./createLucideIcon-Cd-3GVxJ.js";import{t as m}from"./app-window-CPNdvYNt.js";import{t as h}from"./blocks-Olsdp5Lp.js";import{t as g}from"./bot-B3TaBp_T.js";import{t as _}from"./brain-qxhnKqYP.js";import{t as v}from"./calendar-clock-VIxTaqqy.js";import{t as y}from"./chevron-right-C3t2Rckj.js";import{t as b}from"./image-BY_c3FYU.js";import{t as x}from"./monitor-smartphone-B1gIjItA.js";import{t as S}from"./plug-BsIeHRwC.js";import{t as C}from"./plus-fQbSqB1n.js";import{t as w}from"./radio-tower-jGQwrFWB.js";import{t as T}from"./rotate-ccw-clock-CO6Bw-sF.js";import{t as E}from"./search-D0mqDaf_.js";import{t as te}from"./server-BgNvmqwJ.js";import{t as ne}from"./sparkles-S_eeuqn9.js";import{t as re}from"./workflow-Bg94dy8I.js";import{t as D}from"./x-07u4-129.js";import{t as O}from"./brand-DIEc3fK8.js";import{i as k}from"./more-pages-D_PnxLN0.js";import{t as A}from"./utils-C8uzG5AZ.js";import{t as j}from"./button-CCcCN8tE.js";import{t as M}from"./kbd-CAufZTkl.js";import{g as ie}from"./events-D0dbOYFR.js";import{n as N,r as P}from"./config-search-BA9qWX5h.js";import{s as F}from"./shortcuts-LBxOVau1.js";var I=p(`command`,[[`path`,{d:`M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3`,key:`11bfej`}]]),L=e(t(),1),R=`add:component`;function z(e,{capabilities:t=l,mobileApp:n=!1,components:r=[]}={}){let i=(e,n,r,i)=>s(t,e)?{key:`page:${e}`,label:n,description:r,icon:i,destination:{type:`page`,id:e}}:null,a=e=>c(t,e,{mobileApp:n}),o=a(`remote-access`),u=a(`desktop-pet`),d=[a(`mobile-server`).supported?{key:`config:mobile-server`,label:e(`config:configPage.mobileServer`),description:e(`navigation:more.mobileServerHint`),icon:x,destination:{type:`config`,id:`mobile-server`}}:o.supported?{key:`config:remote-access`,label:e(`config:configPage.remoteAccess`),description:e(`navigation:more.remoteAccessHint`),icon:x,destination:{type:`config`,id:`remote-access`}}:null,u.supported||u.reason===`desktop-only`?{key:`config:desktop-pet`,label:e(`config:configPage.desktopPet`),description:e(`navigation:more.desktopPetHint`),icon:g,destination:{type:`config`,id:`desktop-pet`},...u.supported?{}:{disabledReason:e(`navigation:more.desktopOnly`)}}:null];return[{id:`sessions`,label:e(`navigation:more.groupSessions`),tiles:[i(`chatHistory`,e(`navigation:navigation.chatHistory`),e(`navigation:more.chatHistoryHint`),T),i(`assets`,e(`navigation:navigation.assets`),e(`navigation:more.assetsHint`),b),i(`memory`,e(`navigation:navigation.memory`),e(`navigation:more.memoryHint`),_)]},{id:`automation`,label:e(`navigation:more.groupAutomation`),tiles:[i(`workflows`,e(`navigation:navigation.workflows`),e(`navigation:more.workflowsHint`),re),i(`schedules`,e(`navigation:navigation.schedules`),e(`navigation:more.schedulesHint`),v),i(`channels`,e(`navigation:navigation.channels`),e(`navigation:more.channelsHint`),w)]},{id:`extensions`,label:e(`navigation:more.groupExtensions`),tiles:[i(`plugins`,e(`navigation:navigation.plugins`),e(`navigation:more.pluginsHint`),S),i(`skills`,e(`navigation:navigation.skills`),e(`navigation:more.skillsHint`),ne),i(`mcp`,e(`navigation:navigation.mcp`),e(`navigation:more.mcpHint`),te),{key:`page:components`,label:e(`navigation:shell.components`),description:e(`navigation:more.componentStudioHint`),icon:h,destination:{type:`page`,id:`components`}}]},{id:`devices`,label:e(`navigation:more.groupDevices`),tiles:d},{id:`components`,label:e(`navigation:more.groupComponents`),tiles:[...r.map(t=>({key:`component:${t.id}`,label:t.name,description:t.description||e(`navigation:more.componentHint`),icon:m,destination:{type:`component`,id:t.id}})),{key:R,label:e(`navigation:more.addComponent`),description:e(`navigation:more.addComponentHint`),icon:C,destination:{type:`page`,id:`components`}}]}].map(e=>({id:e.id,label:e.label,tiles:e.tiles.filter(e=>e!==null)})).filter(e=>e.tiles.length>0)}function B(e,t,n){let r=t.trim().toLocaleLowerCase(n);return r?e.map(e=>({...e,tiles:e.tiles.filter(t=>[t.label,t.description,e.label].some(e=>e.toLocaleLowerCase(n).includes(r)))})).filter(e=>e.tiles.length>0):[...e]}var V=new Set([`connected`,`connecting`,`reconnecting`]);function H(e){let t=e&&typeof e==`object`?e.connections:null;if(!t||typeof t!=`object`||Array.isArray(t))throw o();let n=0;for(let e of Object.values(t)){if(!e||typeof e!=`object`)continue;let{enabled:t,status:r}=e;t!==!1&&(typeof r!=`string`||!V.has(r))&&(n+=1)}return n}function U(e){return a(`/api/channels`,{signal:e,parse:H})}function W(e){let t=e&&typeof e==`object`?e.metrics:null,n=t&&typeof t==`object`?t.onlineServices:void 0;if(typeof n!=`number`||!Number.isFinite(n)||n<0)throw o();return Math.floor(n)}function G(e){return a(`/api/mcp?refresh=0`,{signal:e,parse:W})}function K(e){let t=e&&typeof e==`object`?e.tasks:null;if(!Array.isArray(t))throw o();return t.filter(e=>e&&typeof e==`object`&&e.enabled===!0).length}function q(e){return a(`/api/schedules`,{signal:e,parse:K})}function J(e){let t=e&&typeof e==`object`?e.limits:null,n=t&&typeof t==`object`?t.running:void 0;if(typeof n!=`number`||!Number.isFinite(n)||n<0)throw o();return Math.floor(n)}function ae(e){return a(`/api/workflows`,{signal:e,parse:J})}var Y=[{key:`page:workflows`,load:ae,tone:`run`,interval:15e3},{key:`page:schedules`,load:q,tone:`neutral`,interval:6e4},{key:`page:channels`,load:U,tone:`attn`,interval:3e4},{key:`page:mcp`,load:G,tone:`neutral`,interval:6e4}];function X(e,t){return i({queryKey:[`more-tile-badge`,e.key],queryFn:({signal:t})=>e.load(t),enabled:t,staleTime:1e4,refetchInterval:t?e.interval:!1,retry:!1}).data}function oe(e,t){let n=[X(Y[0],t.has(Y[0].key)),X(Y[1],t.has(Y[1].key)),X(Y[2],t.has(Y[2].key)),X(Y[3],t.has(Y[3].key))],r=[t=>e(`navigation:more.badgeRunning`,{count:t}),t=>e(`navigation:more.badgeEnabled`,{count:t}),t=>e(`navigation:more.badgeDisconnected`,{count:t}),t=>e(`navigation:more.badgeOnline`,{count:t})],i=new Map;return Y.forEach((e,a)=>{let o=n[a];typeof o==`number`&&o>0&&t.has(e.key)&&i.set(e.key,{label:r[a](o),tone:e.tone})}),i}var Z=n(),se=6,Q=`[data-more-tile]`,$=``;function ce(e,t){return e?.querySelector(`[data-more-tile="${CSS.escape(t)}"]`)??null}function le({onOpen:e}){let{t,language:n}=r(),i=(0,L.useId)(),[a,o]=(0,L.useState)(``),s=F(`commandPalette`),c=F(`focusSearch`),l=u(e=>e.capabilities),p=ee(e=>e.client===`mobile-app`),m=f(),h=t(`navigation:more.title`),g=d(),_=(0,L.useMemo)(()=>g.items.map(({componentId:e,name:t,description:n})=>({id:e,name:t,description:n})),[g.items]),v=(0,L.useMemo)(()=>z(t,{capabilities:l,mobileApp:p,components:_}),[l,_,p,t]),b=(0,L.useMemo)(()=>B(v,a,n),[v,n,a]),x=oe(t,(0,L.useMemo)(()=>new Set(v.flatMap(e=>e.tiles.map(e=>e.key))),[v])),S=(0,L.useMemo)(()=>a.trim()?P(a,n,{capabilities:l,mobileApp:p}).slice(0,se):[],[l,n,p,a]);(0,L.useEffect)(()=>(document.title=`${h} · ${O}`,()=>{document.title=O}),[h]);let C=t=>{if(t.entry.card===`interface-custom-ui`){e({type:`page`,id:`components`});return}N(t.entry.card,t.entry.section,{targetId:t.entry.targetId,targetText:t.title,expandGroup:t.entry.expandGroup}),e({type:`config`,id:t.entry.section})},w=(0,Z.jsxs)(j,{variant:`outline`,className:`h-auto min-h-11 w-full justify-start gap-2.5 py-2 text-left whitespace-normal`,"data-more-palette-search":!0,onClick:()=>ie(a.trim()),children:[m?(0,Z.jsx)(E,{className:`flex-none`,"aria-hidden":`true`}):(0,Z.jsx)(I,{className:`flex-none`,"aria-hidden":`true`}),(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,Z.jsx)(`span`,{className:`truncate text-sm text-content`,children:t(`navigation:more.searchPalette`,{query:a.trim()})}),(0,Z.jsx)(`span`,{className:`text-xs font-normal text-content-muted`,children:t(`navigation:more.searchPaletteHint`)})]})]}),T=`mb-2 text-[13px] font-medium text-content-muted`;return(0,L.useLayoutEffect)(()=>{let e=document.querySelector(`[data-features-index]`),t=$;$=``;let n=0,r=0,i=!t,a=()=>{let o=ce(e,t);o?(o.focus(),i=!0):(n+=1)<20?r=requestAnimationFrame(a):i=!0};return t&&(r=requestAnimationFrame(a)),()=>{cancelAnimationFrame(r),i||($=t);let n=document.activeElement,a=n instanceof HTMLElement&&e?.contains(n)?n.closest(Q):null;a?.dataset.moreTile&&($=a.dataset.moreTile)}},[]),(0,Z.jsxs)(`div`,{"data-features-index":!0,className:`flex h-full min-h-0 w-full flex-col bg-background`,children:[!m&&(0,Z.jsx)(`div`,{"data-window-drag-region":!0,"aria-hidden":`true`,className:`h-[52px] flex-none`}),(0,Z.jsx)(`div`,{"data-features-scroller":!0,className:`min-h-0 flex-1 overflow-y-auto overscroll-contain`,onKeyDown:ue,children:(0,Z.jsxs)(`div`,{"data-features-column":!0,className:`mx-auto flex w-full max-w-[808px] flex-col px-6 pb-16 max-[650px]:px-4 max-[650px]:pt-4 max-[650px]:pb-8`,children:[(0,Z.jsxs)(`header`,{"data-focus-region":`header`,className:`flex flex-col`,children:[(0,Z.jsx)(`h1`,{id:i,className:A(`text-2xl leading-8 font-semibold tracking-[-.01em] text-content`,m&&`sr-only`),children:h}),(0,Z.jsx)(`p`,{className:A(`mt-1 text-sm text-content-muted`,m&&`hidden`),children:s&&!m?t(`navigation:more.lede`,{shortcut:s}):t(`navigation:more.ledeNoShortcut`)}),(0,Z.jsxs)(`label`,{className:A(`relative mt-5 flex h-9 w-full items-center gap-2 rounded-[var(--r-md)] border border-control bg-panel px-3 text-content-muted focus-within:border-focus focus-within:ring-3 focus-within:ring-focus-ring max-[650px]:h-11`,m&&`mt-0`),children:[(0,Z.jsx)(E,{className:`size-4 flex-none`,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:t(`navigation:more.search`)}),(0,Z.jsx)(`input`,{id:k,type:`search`,value:a,placeholder:t(`navigation:more.search`),"aria-keyshortcuts":c||void 0,className:`w-full min-w-0 border-0 bg-transparent text-[length:var(--app-font-size)] text-content caret-focus outline-none max-[650px]:text-[16px] [&::-webkit-search-cancel-button]:hidden`,onChange:e=>o(e.target.value),onKeyDown:e=>{if(e.key===`Escape`&&a)e.preventDefault(),e.stopPropagation(),o(``);else if(e.key===`ArrowDown`){let t=e.currentTarget.closest(`[data-features-scroller]`)?.querySelector(Q);t&&(e.preventDefault(),e.stopPropagation(),t.focus())}}}),a?(0,Z.jsx)(`button`,{type:`button`,className:`grid size-6 flex-none place-items-center rounded-xs text-content-muted hover:bg-surface-hover hover:text-content focus-visible:outline-2 focus-visible:outline-focus pointer-coarse:size-11`,"aria-label":t(`navigation:more.clearSearch`),onClick:()=>o(``),children:(0,Z.jsx)(D,{className:`size-3.5`,"aria-hidden":`true`})}):c&&(0,Z.jsx)(M,{className:`flex-none pointer-coarse:hidden`,children:c})]})]}),b.length===0&&S.length===0?(0,Z.jsxs)(`div`,{role:`status`,"data-features-empty":!0,className:`flex flex-col items-center gap-2 py-16 text-center`,children:[(0,Z.jsx)(`p`,{className:`text-sm font-medium text-content`,children:t(`navigation:more.noResults`)}),(0,Z.jsx)(`p`,{className:`max-w-sm text-xs text-content-muted`,children:t(`navigation:more.noResultsHint`,{shortcut:s||`⌘K`})}),(0,Z.jsxs)(`div`,{className:`mt-2 flex w-full max-w-sm flex-col gap-2`,children:[w,(0,Z.jsx)(j,{variant:`secondary`,className:`min-h-11`,onClick:()=>o(``),children:t(`navigation:more.clearSearch`)})]})]}):b.map(n=>{let r=`${i}-${n.id}`;return(0,Z.jsxs)(`section`,{"data-more-group":n.id,"aria-labelledby":r,className:`mt-7 flex flex-col`,children:[(0,Z.jsx)(`h2`,{id:r,className:T,children:n.label}),(0,Z.jsx)(`ul`,{className:`grid grid-cols-2 gap-2 max-[650px]:grid-cols-1`,children:n.tiles.map(t=>(0,Z.jsx)(`li`,{className:`min-w-0`,children:(0,Z.jsx)(de,{tile:t,badge:x.get(t.key),onOpen:e})},t.key))}),n.id===`components`&&!a&&g.isLoading&&(0,Z.jsx)(`p`,{role:`status`,className:`mt-2 text-xs text-content-muted`,children:t(`navigation:more.componentsLoading`)}),n.id===`components`&&!a&&!!g.error&&(0,Z.jsxs)(`p`,{role:`alert`,className:`mt-2 flex items-center gap-2 text-xs text-content-muted`,children:[t(`navigation:more.componentsError`),(0,Z.jsx)(j,{variant:`ghost`,size:`xs`,onClick:g.refetch,children:t(`navigation:more.retry`)})]})]},n.id)}),a.trim()&&(b.length>0||S.length>0)&&(0,Z.jsxs)(`section`,{"aria-labelledby":`${i}-search`,className:`mt-7 flex flex-col`,children:[(0,Z.jsx)(`h2`,{id:`${i}-search`,className:T,children:t(`navigation:more.settingsResults`)}),S.length>0&&(0,Z.jsx)(`ul`,{"data-more-settings-results":!0,className:`mb-2 flex flex-col divide-y divide-stroke-soft overflow-hidden rounded-card border border-stroke`,children:S.map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`button`,{type:`button`,className:`flex min-h-11 w-full min-w-0 items-center gap-3 px-3.5 py-2 text-left transition-colors duration-(--d-fast) hover:bg-surface-hover focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus`,onClick:()=>C(e),children:[(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,Z.jsx)(`span`,{className:`truncate text-sm text-content`,children:e.title}),e.sectionTitle!==e.title&&(0,Z.jsx)(`span`,{className:`truncate text-xs text-content-muted`,children:e.sectionTitle})]}),(0,Z.jsx)(y,{className:`size-4 flex-none text-content-muted`,"aria-hidden":`true`})]})},e.entry.id))}),w]})]})})]})}function ue(e){let t=e.target;if(!(t instanceof HTMLElement)||!t.matches(Q)||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)return;let n=[...e.currentTarget.querySelectorAll(Q)],r=n.indexOf(t);if(r<0)return;let i;if(e.key===`ArrowRight`)i=n[r+1];else if(e.key===`ArrowLeft`)i=n[r-1];else if(e.key===`Home`)i=n[0];else if(e.key===`End`)i=n.at(-1);else if(e.key===`ArrowDown`||e.key===`ArrowUp`){let r=t.getBoundingClientRect(),a=e.key===`ArrowDown`,o=r.left+r.width/2,s=n.map(e=>({tile:e,box:e.getBoundingClientRect()})).filter(({box:e})=>a?e.top>=r.bottom-1:e.bottom<=r.top+1);if(s.length>0){let e=a?Math.min(...s.map(({box:e})=>e.top)):Math.max(...s.map(({box:e})=>e.top));i=s.filter(({box:t})=>Math.abs(t.top-e)<2).sort((e,t)=>Math.abs(e.box.left+e.box.width/2-o)-Math.abs(t.box.left+t.box.width/2-o))[0]?.tile}else if(!a){document.getElementById(k)?.focus(),e.preventDefault();return}}else return;e.preventDefault(),i?.focus()}function de({tile:e,badge:t,onOpen:n}){let{t:i}=r(),a=e.icon,o=!!e.disabledReason,s=e.key===R;return(0,Z.jsxs)(`button`,{type:`button`,"data-more-tile":e.key,"aria-disabled":o||void 0,"aria-label":o?i(`navigation:more.disabledTile`,{label:e.label,reason:e.disabledReason}):void 0,className:A(`flex min-h-16 w-full min-w-0 items-center gap-3 rounded-card border px-3.5 py-2.5 text-left transition-colors duration-(--d-fast) focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus max-[650px]:min-h-14 max-[650px]:py-2`,s?`border-dashed border-stroke-strong`:`border-stroke`,o?`cursor-not-allowed`:`hover:bg-surface-hover`),onClick:()=>{o||($=e.key,n(e.destination))},children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:A(`grid size-[34px] flex-none place-items-center rounded-[var(--r-md)] max-[650px]:size-8`,s?`text-content-muted`:`bg-surface-subtle text-content-secondary`,o&&`text-content-muted`),children:(0,Z.jsx)(a,{className:`size-[18px]`,strokeWidth:1.75})}),(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,Z.jsx)(`span`,{className:A(`truncate text-sm font-medium text-content`,(o||s)&&`text-content-secondary`),children:e.label}),(0,Z.jsx)(`span`,{className:`truncate text-xs text-content-muted`,children:e.disabledReason||e.description})]}),t&&!o&&(0,Z.jsxs)(`span`,{"data-more-badge":t.tone,className:A(`flex max-w-[45%] flex-none items-center gap-1.5 text-xs whitespace-nowrap tabular-nums`,t.tone===`attn`?`font-medium text-st-attn`:`text-content-muted`),children:[t.tone===`attn`&&(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`size-2 flex-none rounded-full bg-st-attn-fill`}),(0,Z.jsx)(`span`,{className:`truncate`,children:t.label})]})]})}export{le as MorePage};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{t as r}from"./use-i18n-vlX9sewC.js";import{u as i}from"./api-DHnp1y9B.js";import{t as a}from"./folder-open-FIShC5Qk.js";import{i as o}from"./workspace-order-store-_L6d1CWV.js";import{t as s}from"./triangle-alert-CE1q54ci.js";import{n as c,t as l}from"./button-CCcCN8tE.js";import{a as u,i as d,l as f,o as p,s as m,t as h}from"./dialog-CVn9vhfy.js";import{t as g}from"./input-CPw-zkYh.js";import{i as _,n as v,r as y,t as b}from"./input-group-h8z63MzW.js";import{t as x}from"./pick-system-directory-DzwXQwyO.js";import{r as S,t as C}from"./folder-paths-DDMQoUvb.js";import{n as w,t as T}from"./alert-firawb0H.js";import{n as E,t as D}from"./field-DoLEb0np.js";var O=e(t(),1),k=n();function A(e,t){switch(e){case`folder_name_required`:return t(`board:folder.error.nameRequired`);case`folder_name_invalid`:return t(`board:folder.error.nameInvalid`);case`folder_parent_missing`:case`folder_parent_invalid`:return t(`board:folder.error.parentMissing`);case`folder_exists_as_file`:return t(`board:folder.error.existsAsFile`);case`folder_permission_denied`:return t(`board:folder.error.permission`);default:return``}}function j({open:e,initialParent:t,onOpenChange:n,onCreated:j,onCloseAutoFocus:M}){let{t:N}=r(),[P,F]=(0,O.useState)(t),[I,L]=(0,O.useState)(``),[R,z]=(0,O.useState)(!1),[B,V]=(0,O.useState)(!1),[H,U]=(0,O.useState)(!1),[W,G]=(0,O.useState)(``),K=(0,O.useRef)(0),q=(0,O.useRef)(!1),J=(0,O.useRef)(null),Y=R||B;(0,O.useEffect)(()=>{K.current+=1,q.current=!1,e&&(F(t),L(``),z(!1),V(!1),U(!1),G(``))},[t,e]);let X=async()=>{if(q.current)return;q.current=!0;let e=K.current;V(!0),G(``);try{let t=await x(P.trim(),N(`board:folder.browseTitle`));if(e!==K.current)return;t.status===`picked`?F(t.path):t.status===`unavailable`&&(U(!0),J.current?.focus())}catch(t){e===K.current&&G(t instanceof Error?t.message:String(t))}finally{e===K.current&&(q.current=!1,V(!1))}},Z=async e=>{if(e.preventDefault(),q.current||!I.trim())return;q.current=!0;let t=K.current;z(!0),G(``);try{let e=await S(P.trim(),I.trim());if(t!==K.current)return;j(e.path),n(!1)}catch(e){if(t!==K.current)return;let n=A(e instanceof i?e.data?.code:void 0,N);G(n||(e instanceof Error&&e.message?N(`board:folder.error.failedWithReason`,{reason:e.message}):N(`board:folder.error.failed`)))}finally{t===K.current&&(q.current=!1,z(!1))}},Q=I.trim()?C(P,I.trim()):``;return(0,k.jsx)(h,{open:e,onOpenChange:e=>!q.current&&n(e),children:(0,k.jsxs)(d,{showCloseButton:!Y,"aria-describedby":`board-new-folder`,onCloseAutoFocus:M,"data-new-folder-dialog":!0,children:[(0,k.jsxs)(m,{children:[(0,k.jsx)(f,{children:N(`board:folder.title`)}),(0,k.jsx)(u,{id:`board-new-folder`,children:N(`board:folder.description`)})]}),(0,k.jsxs)(`form`,{className:`flex min-w-0 flex-col gap-4`,onSubmit:e=>void Z(e),children:[(0,k.jsxs)(E,{variant:`control`,children:[N(`board:folder.parent`),(0,k.jsxs)(b,{className:`max-[650px]:h-11`,children:[(0,k.jsx)(_,{ref:J,className:`font-mono text-xs`,value:P,disabled:Y,placeholder:N(`board:folder.parentPlaceholder`),"data-new-folder-parent":!0,onChange:e=>F(e.target.value)}),(0,k.jsx)(v,{align:`inline-end`,children:(0,k.jsxs)(y,{size:`xs`,disabled:Y,"data-new-folder-browse":!0,onClick:()=>void X(),children:[B?(0,k.jsx)(c,{className:`text-current`}):(0,k.jsx)(a,{}),N(`board:folder.browse`)]})})]})]}),H&&(0,k.jsx)(D,{className:`-mt-2`,children:N(`board:folder.browseUnavailable`)}),(0,k.jsxs)(E,{variant:`control`,children:[N(`board:folder.name`),(0,k.jsx)(g,{autoFocus:!0,className:`max-[650px]:h-11`,value:I,disabled:Y,placeholder:N(`board:folder.namePlaceholder`),autoComplete:`off`,spellCheck:!1,"data-new-folder-name":!0,onChange:e=>{L(e.target.value),W&&G(``)}})]}),Q&&(0,k.jsx)(`p`,{className:`-mt-2 truncate font-mono text-xs text-content-muted`,title:Q,children:N(`board:folder.preview`,{path:Q})}),W&&(0,k.jsxs)(T,{variant:`destructive`,children:[(0,k.jsx)(s,{}),(0,k.jsx)(w,{className:`min-w-0 break-words`,children:W})]}),(0,k.jsxs)(p,{children:[(0,k.jsx)(l,{type:`button`,variant:`secondary`,size:`dialogAction`,disabled:Y,onClick:()=>n(!1),children:N(`common:ui.cancel`)}),(0,k.jsxs)(l,{type:`submit`,size:`dialogAction`,disabled:Y||!I.trim(),children:[R?(0,k.jsx)(c,{className:`text-current`}):(0,k.jsx)(o,{}),N(R?`board:folder.creating`:`board:folder.create`)]})]})]})]})})}export{j as NewFolderDialog};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{t as r}from"./use-i18n-BuN5i-jP.js";import{u as i}from"./api-Dg-aNpVe.js";import{t as a}from"./folder-open-FIShC5Qk.js";import{i as o}from"./workspace-order-store-DlMf7MI6.js";import{t as s}from"./triangle-alert-CE1q54ci.js";import{n as c,t as l}from"./button-CCcCN8tE.js";import{a as u,i as d,l as f,o as p,s as m,t as h}from"./dialog-CtFjznlx.js";import{t as g}from"./input-CPw-zkYh.js";import{i as _,n as v,r as y,t as b}from"./input-group-h8z63MzW.js";import{t as x}from"./pick-system-directory-B1clvHS6.js";import{r as S,t as C}from"./folder-paths-DEFkIxr2.js";import{n as w,t as T}from"./alert-firawb0H.js";import{n as E,t as D}from"./field-DoLEb0np.js";var O=e(t(),1),k=n();function A(e,t){switch(e){case`folder_name_required`:return t(`board:folder.error.nameRequired`);case`folder_name_invalid`:return t(`board:folder.error.nameInvalid`);case`folder_parent_missing`:case`folder_parent_invalid`:return t(`board:folder.error.parentMissing`);case`folder_exists_as_file`:return t(`board:folder.error.existsAsFile`);case`folder_permission_denied`:return t(`board:folder.error.permission`);default:return``}}function j({open:e,initialParent:t,onOpenChange:n,onCreated:j,onCloseAutoFocus:M}){let{t:N}=r(),[P,F]=(0,O.useState)(t),[I,L]=(0,O.useState)(``),[R,z]=(0,O.useState)(!1),[B,V]=(0,O.useState)(!1),[H,U]=(0,O.useState)(!1),[W,G]=(0,O.useState)(``),K=(0,O.useRef)(0),q=(0,O.useRef)(!1),J=(0,O.useRef)(null),Y=R||B;(0,O.useEffect)(()=>{K.current+=1,q.current=!1,e&&(F(t),L(``),z(!1),V(!1),U(!1),G(``))},[t,e]);let X=async()=>{if(q.current)return;q.current=!0;let e=K.current;V(!0),G(``);try{let t=await x(P.trim(),N(`board:folder.browseTitle`));if(e!==K.current)return;t.status===`picked`?F(t.path):t.status===`unavailable`&&(U(!0),J.current?.focus())}catch(t){e===K.current&&G(t instanceof Error?t.message:String(t))}finally{e===K.current&&(q.current=!1,V(!1))}},Z=async e=>{if(e.preventDefault(),q.current||!I.trim())return;q.current=!0;let t=K.current;z(!0),G(``);try{let e=await S(P.trim(),I.trim());if(t!==K.current)return;j(e.path),n(!1)}catch(e){if(t!==K.current)return;let n=A(e instanceof i?e.data?.code:void 0,N);G(n||(e instanceof Error&&e.message?N(`board:folder.error.failedWithReason`,{reason:e.message}):N(`board:folder.error.failed`)))}finally{t===K.current&&(q.current=!1,z(!1))}},Q=I.trim()?C(P,I.trim()):``;return(0,k.jsx)(h,{open:e,onOpenChange:e=>!q.current&&n(e),children:(0,k.jsxs)(d,{showCloseButton:!Y,"aria-describedby":`board-new-folder`,onCloseAutoFocus:M,"data-new-folder-dialog":!0,children:[(0,k.jsxs)(m,{children:[(0,k.jsx)(f,{children:N(`board:folder.title`)}),(0,k.jsx)(u,{id:`board-new-folder`,children:N(`board:folder.description`)})]}),(0,k.jsxs)(`form`,{className:`flex min-w-0 flex-col gap-4`,onSubmit:e=>void Z(e),children:[(0,k.jsxs)(E,{variant:`control`,children:[N(`board:folder.parent`),(0,k.jsxs)(b,{className:`max-[650px]:h-11`,children:[(0,k.jsx)(_,{ref:J,className:`font-mono text-xs`,value:P,disabled:Y,placeholder:N(`board:folder.parentPlaceholder`),"data-new-folder-parent":!0,onChange:e=>F(e.target.value)}),(0,k.jsx)(v,{align:`inline-end`,children:(0,k.jsxs)(y,{size:`xs`,disabled:Y,"data-new-folder-browse":!0,onClick:()=>void X(),children:[B?(0,k.jsx)(c,{className:`text-current`}):(0,k.jsx)(a,{}),N(`board:folder.browse`)]})})]})]}),H&&(0,k.jsx)(D,{className:`-mt-2`,children:N(`board:folder.browseUnavailable`)}),(0,k.jsxs)(E,{variant:`control`,children:[N(`board:folder.name`),(0,k.jsx)(g,{autoFocus:!0,className:`max-[650px]:h-11`,value:I,disabled:Y,placeholder:N(`board:folder.namePlaceholder`),autoComplete:`off`,spellCheck:!1,"data-new-folder-name":!0,onChange:e=>{L(e.target.value),W&&G(``)}})]}),Q&&(0,k.jsx)(`p`,{className:`-mt-2 truncate font-mono text-xs text-content-muted`,title:Q,children:N(`board:folder.preview`,{path:Q})}),W&&(0,k.jsxs)(T,{variant:`destructive`,children:[(0,k.jsx)(s,{}),(0,k.jsx)(w,{className:`min-w-0 break-words`,children:W})]}),(0,k.jsxs)(p,{children:[(0,k.jsx)(l,{type:`button`,variant:`secondary`,size:`dialogAction`,disabled:Y,onClick:()=>n(!1),children:N(`common:ui.cancel`)}),(0,k.jsxs)(l,{type:`submit`,size:`dialogAction`,disabled:Y||!I.trim(),children:[R?(0,k.jsx)(c,{className:`text-current`}):(0,k.jsx)(o,{}),N(R?`board:folder.creating`:`board:folder.create`)]})]})]})]})})}export{j as NewFolderDialog};
@@ -1 +1 @@
1
- import{r as e}from"./vendor-react-DwNgTV1j.js";import{t}from"./use-i18n-vlX9sewC.js";import{t as n}from"./chevron-left-BAtyp3_6.js";import{t as r}from"./square-terminal-BVG6cUT1.js";import{r as i}from"./more-pages-D_PnxLN0.js";import{t as a}from"./utils-C8uzG5AZ.js";import{t as o}from"./button-CCcCN8tE.js";import{s}from"./shortcuts-DDYN6uA3.js";var c=e();function l({meta:e,page:l,desktopPlatform:u,terminalOpen:d,onToggleTerminal:f,onBackToMore:p,phoneShell:m=!1}){let{t:h}=t(),g=s(`toggleTerminal`),_=!!u,v=i.has(l)||p?h(`navigation:sidebar.features`):``;return(0,c.jsx)(`header`,{"data-focus-region":`header`,"data-window-drag-region":!0,className:a(`@container/page-header relative z-[2] flex flex-none flex-col`,_&&`[-webkit-app-region:drag]`),children:(0,c.jsxs)(`div`,{className:a(`flex min-h-12 items-center gap-2 border-b border-stroke-soft py-1.5 pr-2.5 in-data-[density=compact]:min-h-11 max-[650px]:min-h-0 max-[650px]:flex-wrap max-[650px]:gap-x-2 max-[650px]:gap-y-0 max-[650px]:border-b-0 max-[650px]:px-4 max-[650px]:pt-0 max-[650px]:pb-3`,`pl-[calc(16px+var(--workbench-leading-inset,0px))] max-[650px]:pl-4`,`[[data-custom-titlebar]_&]:pr-[144px]`),children:[(0,c.jsxs)(`div`,{className:a(`mr-auto flex min-w-0 items-center gap-1.5 text-[13px]`,`max-[650px]:h-14 max-[650px]:basis-full max-[650px]:gap-2`,m&&(v&&p?`max-[650px]:h-11`:`max-[650px]:h-0`)),children:[v&&p?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(`button`,{type:`button`,"data-back-to-more":!0,className:`-ml-1.5 flex h-7 shrink-0 items-center gap-0.5 rounded-sm pr-1.5 pl-1 text-content-muted transition-colors duration-(--d-fast) hover:bg-surface-hover hover:text-content focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus max-[650px]:-ml-3 max-[650px]:h-11 max-[650px]:min-w-11 max-[650px]:pr-2 max-[650px]:text-sm max-[650px]:text-content-secondary`,"aria-label":h(`navigation:shell.backToFeaturesLabel`),onClick:p,children:[(0,c.jsx)(n,{className:`size-4 max-[650px]:size-5`,"aria-hidden":`true`}),(0,c.jsx)(`span`,{children:v})]}),(0,c.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0 text-content-faint max-[650px]:hidden`,children:`/`})]}):v&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(`span`,{className:`shrink-0 text-content-muted max-[900px]:hidden`,children:v}),(0,c.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0 text-content-faint max-[900px]:hidden`,children:`/`})]}),(0,c.jsx)(`h1`,{className:a(`max-w-full min-w-[4em] truncate text-[13px] leading-5 font-medium text-content max-[650px]:min-w-0 max-[650px]:text-2xl max-[650px]:leading-8 max-[650px]:font-[650] max-[650px]:tracking-[-.015em]`,m&&`sr-only`),children:e[0]}),e[1]&&!m&&(0,c.jsx)(`p`,{className:`ml-1.5 min-w-0 truncate text-xs text-content-muted max-[900px]:hidden max-[650px]:ml-0 max-[650px]:block max-[650px]:flex-1 max-[650px]:basis-0`,children:e[1]})]}),_&&(0,c.jsx)(`div`,{className:`flex min-w-0 items-center justify-end gap-1.5 [-webkit-app-region:no-drag]`,children:(0,c.jsx)(o,{variant:`ghost`,size:`icon`,className:a(`text-content-muted max-[650px]:hidden`,d&&`bg-surface-hover text-accent-fg`),title:g?`${h(`navigation:pageHeader.toggleTerminal`)} (${g})`:h(`navigation:pageHeader.toggleTerminal`),"aria-label":h(`navigation:pageHeader.toggleTerminal`),"aria-pressed":d,onClick:f,children:(0,c.jsx)(r,{size:16})})})]})})}export{l as PageHeader};
1
+ import{r as e}from"./vendor-react-DwNgTV1j.js";import{t}from"./use-i18n-BuN5i-jP.js";import{t as n}from"./chevron-left-BAtyp3_6.js";import{t as r}from"./square-terminal-BVG6cUT1.js";import{r as i}from"./more-pages-D_PnxLN0.js";import{t as a}from"./utils-C8uzG5AZ.js";import{t as o}from"./button-CCcCN8tE.js";import{s}from"./shortcuts-LBxOVau1.js";var c=e();function l({meta:e,page:l,desktopPlatform:u,terminalOpen:d,onToggleTerminal:f,onBackToMore:p,phoneShell:m=!1}){let{t:h}=t(),g=s(`toggleTerminal`),_=!!u,v=i.has(l)||p?h(`navigation:sidebar.features`):``;return(0,c.jsx)(`header`,{"data-focus-region":`header`,"data-window-drag-region":!0,className:a(`@container/page-header relative z-[2] flex flex-none flex-col`,_&&`[-webkit-app-region:drag]`),children:(0,c.jsxs)(`div`,{className:a(`flex min-h-12 items-center gap-2 border-b border-stroke-soft py-1.5 pr-2.5 in-data-[density=compact]:min-h-11 max-[650px]:min-h-0 max-[650px]:flex-wrap max-[650px]:gap-x-2 max-[650px]:gap-y-0 max-[650px]:border-b-0 max-[650px]:px-4 max-[650px]:pt-0 max-[650px]:pb-3`,`pl-[calc(16px+var(--workbench-leading-inset,0px))] max-[650px]:pl-4`,`[[data-custom-titlebar]_&]:pr-[144px]`),children:[(0,c.jsxs)(`div`,{className:a(`mr-auto flex min-w-0 items-center gap-1.5 text-[13px]`,`max-[650px]:h-14 max-[650px]:basis-full max-[650px]:gap-2`,m&&(v&&p?`max-[650px]:h-11`:`max-[650px]:h-0`)),children:[v&&p?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(`button`,{type:`button`,"data-back-to-more":!0,className:`-ml-1.5 flex h-7 shrink-0 items-center gap-0.5 rounded-sm pr-1.5 pl-1 text-content-muted transition-colors duration-(--d-fast) hover:bg-surface-hover hover:text-content focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus max-[650px]:-ml-3 max-[650px]:h-11 max-[650px]:min-w-11 max-[650px]:pr-2 max-[650px]:text-sm max-[650px]:text-content-secondary`,"aria-label":h(`navigation:shell.backToFeaturesLabel`),onClick:p,children:[(0,c.jsx)(n,{className:`size-4 max-[650px]:size-5`,"aria-hidden":`true`}),(0,c.jsx)(`span`,{children:v})]}),(0,c.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0 text-content-faint max-[650px]:hidden`,children:`/`})]}):v&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(`span`,{className:`shrink-0 text-content-muted max-[900px]:hidden`,children:v}),(0,c.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0 text-content-faint max-[900px]:hidden`,children:`/`})]}),(0,c.jsx)(`h1`,{className:a(`max-w-full min-w-[4em] truncate text-[13px] leading-5 font-medium text-content max-[650px]:min-w-0 max-[650px]:text-2xl max-[650px]:leading-8 max-[650px]:font-[650] max-[650px]:tracking-[-.015em]`,m&&`sr-only`),children:e[0]}),e[1]&&!m&&(0,c.jsx)(`p`,{className:`ml-1.5 min-w-0 truncate text-xs text-content-muted max-[900px]:hidden max-[650px]:ml-0 max-[650px]:block max-[650px]:flex-1 max-[650px]:basis-0`,children:e[1]})]}),_&&(0,c.jsx)(`div`,{className:`flex min-w-0 items-center justify-end gap-1.5 [-webkit-app-region:no-drag]`,children:(0,c.jsx)(o,{variant:`ghost`,size:`icon`,className:a(`text-content-muted max-[650px]:hidden`,d&&`bg-surface-hover text-accent-fg`),title:g?`${h(`navigation:pageHeader.toggleTerminal`)} (${g})`:h(`navigation:pageHeader.toggleTerminal`),"aria-label":h(`navigation:pageHeader.toggleTerminal`),"aria-pressed":d,onClick:f,children:(0,c.jsx)(r,{size:16})})})]})})}export{l as PageHeader};
@@ -1 +1 @@
1
- import{r as e}from"./vendor-react-DwNgTV1j.js";import{t}from"./use-i18n-vlX9sewC.js";import{n,t as r}from"./list-T5PqlpS2.js";import{t as i}from"./search-D0mqDaf_.js";import{t as a}from"./settings-QX0oWnVK.js";import{t as o}from"./square-pen-hYbjKh6A.js";import{t as s}from"./utils-C8uzG5AZ.js";import{n as c,o as l,r as u,t as d}from"./sheet-BTaIEX4w.js";import{t as f}from"./sidebar-store-C9_zt4qH.js";var p=e(),m=`flex h-11 w-full min-w-0 items-center gap-3 rounded-[var(--r-md)] px-2.5 text-base text-content transition-colors duration-(--d-fast) focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus active:bg-surface-hover`;function h({active:e,onSearch:h,onNewTask:g,onOpenBoard:_,onOpenFeatures:v,onOpenSettings:y,content:b,boardCount:x,update:S}){let{t:C}=t(),w=f(e=>e.drawerOpen),T=f(e=>e.setDrawerOpen),E=e=>()=>{T(!1),e()},D=(t,n,r,i,a)=>(0,p.jsxs)(`button`,{type:`button`,"data-drawer-entry":t,"aria-current":e===t?`page`:void 0,className:s(m,e===t&&`bg-surface-active`),onClick:E(i),children:[(0,p.jsx)(n,{className:`size-[18px] flex-none text-content-secondary`,strokeWidth:1.75,"aria-hidden":`true`}),(0,p.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-left`,children:r}),a]});return(0,p.jsx)(d,{open:w,onOpenChange:T,children:(0,p.jsxs)(c,{side:`left`,showCloseButton:!1,"data-phone-drawer":!0,onCloseAutoFocus:e=>{let t=document.querySelector(`[data-phone-menu]`);t&&(e.preventDefault(),t.focus())},"aria-describedby":void 0,className:`w-[min(320px,85vw)] gap-0 border-stroke-soft bg-sidebar p-0 pt-[var(--pisper-safe-area-top)] pb-[var(--pisper-safe-area-bottom)] pl-[var(--pisper-safe-area-left)] data-[side=left]:w-[min(320px,85vw)] data-[side=left]:max-w-none`,children:[(0,p.jsx)(l,{className:`sr-only`,children:C(`navigation:phone.drawer`)}),(0,p.jsx)(u,{className:`sr-only`,children:C(`navigation:phone.drawerHint`)}),(0,p.jsxs)(`div`,{className:`flex flex-none items-center gap-2 px-3 pt-3 pb-2`,children:[(0,p.jsxs)(`button`,{type:`button`,"data-drawer-search":!0,className:`flex h-11 min-w-0 flex-1 items-center gap-2 rounded-[10px] bg-surface-muted px-3 text-left text-base text-content-muted focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus`,onClick:E(h),children:[(0,p.jsx)(i,{className:`size-[18px] flex-none`,strokeWidth:1.75,"aria-hidden":`true`}),(0,p.jsx)(`span`,{className:`truncate`,children:C(`navigation:sidebar.search`)})]}),(0,p.jsx)(`button`,{type:`button`,"data-drawer-new-task":!0,"aria-label":C(`navigation:shell.newTask`),className:`grid size-11 flex-none place-items-center rounded-[var(--r-md)] text-content-secondary focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus active:bg-surface-hover`,onClick:E(g),children:(0,p.jsx)(o,{className:`size-5`,strokeWidth:1.75,"aria-hidden":`true`})})]}),(0,p.jsxs)(`nav`,{"aria-label":C(`navigation:shell.primaryNavigation`),className:`flex-none px-2 pb-2`,children:[D(`board`,r,C(`navigation:sidebar.allAgents`),_,x?(0,p.jsx)(`span`,{className:`flex-none text-sm text-content-muted tabular-nums`,children:x}):void 0),D(`features`,n,C(`navigation:sidebar.features`),v)]}),(0,p.jsx)(`div`,{"data-drawer-sessions":!0,className:`min-h-0 flex-1 overflow-y-auto overscroll-contain px-2 pt-1`,children:b}),(0,p.jsxs)(`div`,{className:`flex flex-none items-center gap-1 border-t border-stroke-soft px-2 py-2`,children:[(0,p.jsx)(`div`,{className:`min-w-0 flex-1`,children:D(`settings`,a,C(`navigation:navigation.settings`),y)}),S]})]})})}export{h as PhoneDrawer};
1
+ import{r as e}from"./vendor-react-DwNgTV1j.js";import{t}from"./use-i18n-BuN5i-jP.js";import{n,t as r}from"./list-T5PqlpS2.js";import{t as i}from"./search-D0mqDaf_.js";import{t as a}from"./settings-QX0oWnVK.js";import{t as o}from"./square-pen-hYbjKh6A.js";import{t as s}from"./utils-C8uzG5AZ.js";import{n as c,o as l,r as u,t as d}from"./sheet-BTaIEX4w.js";import{t as f}from"./sidebar-store-BGW5sD2q.js";var p=e(),m=`flex h-11 w-full min-w-0 items-center gap-3 rounded-[var(--r-md)] px-2.5 text-base text-content transition-colors duration-(--d-fast) focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus active:bg-surface-hover`;function h({active:e,onSearch:h,onNewTask:g,onOpenBoard:_,onOpenFeatures:v,onOpenSettings:y,content:b,boardCount:x,update:S}){let{t:C}=t(),w=f(e=>e.drawerOpen),T=f(e=>e.setDrawerOpen),E=e=>()=>{T(!1),e()},D=(t,n,r,i,a)=>(0,p.jsxs)(`button`,{type:`button`,"data-drawer-entry":t,"aria-current":e===t?`page`:void 0,className:s(m,e===t&&`bg-surface-active`),onClick:E(i),children:[(0,p.jsx)(n,{className:`size-[18px] flex-none text-content-secondary`,strokeWidth:1.75,"aria-hidden":`true`}),(0,p.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-left`,children:r}),a]});return(0,p.jsx)(d,{open:w,onOpenChange:T,children:(0,p.jsxs)(c,{side:`left`,showCloseButton:!1,"data-phone-drawer":!0,onCloseAutoFocus:e=>{let t=document.querySelector(`[data-phone-menu]`);t&&(e.preventDefault(),t.focus())},"aria-describedby":void 0,className:`w-[min(320px,85vw)] gap-0 border-stroke-soft bg-sidebar p-0 pt-[var(--pisper-safe-area-top)] pb-[var(--pisper-safe-area-bottom)] pl-[var(--pisper-safe-area-left)] data-[side=left]:w-[min(320px,85vw)] data-[side=left]:max-w-none`,children:[(0,p.jsx)(l,{className:`sr-only`,children:C(`navigation:phone.drawer`)}),(0,p.jsx)(u,{className:`sr-only`,children:C(`navigation:phone.drawerHint`)}),(0,p.jsxs)(`div`,{className:`flex flex-none items-center gap-2 px-3 pt-3 pb-2`,children:[(0,p.jsxs)(`button`,{type:`button`,"data-drawer-search":!0,className:`flex h-11 min-w-0 flex-1 items-center gap-2 rounded-[10px] bg-surface-muted px-3 text-left text-base text-content-muted focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus`,onClick:E(h),children:[(0,p.jsx)(i,{className:`size-[18px] flex-none`,strokeWidth:1.75,"aria-hidden":`true`}),(0,p.jsx)(`span`,{className:`truncate`,children:C(`navigation:sidebar.search`)})]}),(0,p.jsx)(`button`,{type:`button`,"data-drawer-new-task":!0,"aria-label":C(`navigation:shell.newTask`),className:`grid size-11 flex-none place-items-center rounded-[var(--r-md)] text-content-secondary focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus active:bg-surface-hover`,onClick:E(g),children:(0,p.jsx)(o,{className:`size-5`,strokeWidth:1.75,"aria-hidden":`true`})})]}),(0,p.jsxs)(`nav`,{"aria-label":C(`navigation:shell.primaryNavigation`),className:`flex-none px-2 pb-2`,children:[D(`board`,r,C(`navigation:sidebar.allAgents`),_,x?(0,p.jsx)(`span`,{className:`flex-none text-sm text-content-muted tabular-nums`,children:x}):void 0),D(`features`,n,C(`navigation:sidebar.features`),v)]}),(0,p.jsx)(`div`,{"data-drawer-sessions":!0,className:`min-h-0 flex-1 overflow-y-auto overscroll-contain px-2 pt-1`,children:b}),(0,p.jsxs)(`div`,{className:`flex flex-none items-center gap-1 border-t border-stroke-soft px-2 py-2`,children:[(0,p.jsx)(`div`,{className:`min-w-0 flex-1`,children:D(`settings`,a,C(`navigation:navigation.settings`),y)}),S]})]})})}export{h as PhoneDrawer};
@@ -1 +1 @@
1
- import{r as e}from"./vendor-react-DwNgTV1j.js";import{t}from"./use-i18n-vlX9sewC.js";import{t as n}from"./createLucideIcon-Cd-3GVxJ.js";import"./public-CkPP4ohL.js";import{t as r}from"./utils-C8uzG5AZ.js";import{t as i}from"./sidebar-store-C9_zt4qH.js";import{t as a}from"./useSidebarModel-BFdUhpkM.js";var o=n(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),s=e();function c({className:e}){let{t:n}=t(),{model:c}=a(),l=i(e=>e.drawerOpen),u=i(e=>e.setDrawerOpen),d=c.counts.attention;return(0,s.jsxs)(`button`,{type:`button`,"data-phone-menu":!0,"aria-haspopup":`dialog`,"aria-expanded":l,"aria-label":d>0?n(`navigation:phone.menuAttention`,{count:d}):n(`navigation:phone.menu`),className:r(`flex h-11 min-w-11 flex-none items-center justify-center gap-1.5 rounded-full bg-surface-muted px-2.5 text-content transition-colors duration-(--d-fast) focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus active:bg-surface-hover dark:bg-surface-active`,e),onClick:()=>u(!0),children:[(0,s.jsx)(o,{className:`size-5`,strokeWidth:1.75,"aria-hidden":`true`}),d>0&&(0,s.jsxs)(`span`,{"aria-hidden":`true`,"data-phone-attention":d,className:`flex h-5 items-center gap-1 rounded-full bg-warning-soft px-1.5 text-xs leading-none font-semibold text-warning-strong tabular-nums ring-1 ring-st-attn-border ring-inset`,children:[(0,s.jsx)(`span`,{className:`size-1.5 rounded-full bg-st-attn-fill`}),d>99?`99+`:d]})]})}export{c as t};
1
+ import{r as e}from"./vendor-react-DwNgTV1j.js";import{t}from"./use-i18n-BuN5i-jP.js";import{t as n}from"./createLucideIcon-Cd-3GVxJ.js";import"./public-CNoWpIiC.js";import{t as r}from"./utils-C8uzG5AZ.js";import{t as i}from"./sidebar-store-BGW5sD2q.js";import{t as a}from"./useSidebarModel-BdWaL9Nn.js";var o=n(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),s=e();function c({className:e}){let{t:n}=t(),{model:c}=a(),l=i(e=>e.drawerOpen),u=i(e=>e.setDrawerOpen),d=c.counts.attention;return(0,s.jsxs)(`button`,{type:`button`,"data-phone-menu":!0,"aria-haspopup":`dialog`,"aria-expanded":l,"aria-label":d>0?n(`navigation:phone.menuAttention`,{count:d}):n(`navigation:phone.menu`),className:r(`flex h-11 min-w-11 flex-none items-center justify-center gap-1.5 rounded-full bg-surface-muted px-2.5 text-content transition-colors duration-(--d-fast) focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus active:bg-surface-hover dark:bg-surface-active`,e),onClick:()=>u(!0),children:[(0,s.jsx)(o,{className:`size-5`,strokeWidth:1.75,"aria-hidden":`true`}),d>0&&(0,s.jsxs)(`span`,{"aria-hidden":`true`,"data-phone-attention":d,className:`flex h-5 items-center gap-1 rounded-full bg-warning-soft px-1.5 text-xs leading-none font-semibold text-warning-strong tabular-nums ring-1 ring-st-attn-border ring-inset`,children:[(0,s.jsx)(`span`,{className:`size-1.5 rounded-full bg-st-attn-fill`}),d>99?`99+`:d]})]})}export{c as t};
@@ -1 +1 @@
1
- import{r as e}from"./vendor-react-DwNgTV1j.js";import{t}from"./use-i18n-vlX9sewC.js";import{t as n}from"./PhoneMenuButton-B16JL5aU.js";import{t as r}from"./search-D0mqDaf_.js";import{t as i}from"./square-pen-hYbjKh6A.js";var a=e(),o=`grid size-11 flex-none place-items-center rounded-full bg-surface-muted text-content focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus active:bg-surface-hover dark:bg-surface-active`;function s({title:e,onNewTask:s,onSearch:c}){let{t:l}=t();return(0,a.jsxs)(`header`,{"data-phone-topbar":!0,"data-focus-region":`header`,className:`relative grid h-14 flex-none grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-center bg-panel px-3`,children:[(0,a.jsx)(`div`,{className:`flex min-w-0 items-center`,children:(0,a.jsx)(n,{})}),(0,a.jsx)(`p`,{"data-phone-title":!0,"aria-hidden":`true`,className:`max-w-[min(56vw,240px)] truncate text-center text-base leading-6 font-semibold text-content`,children:e}),(0,a.jsxs)(`div`,{className:`flex min-w-0 items-center justify-end gap-2`,children:[c&&(0,a.jsx)(`button`,{type:`button`,"data-phone-search":!0,"aria-label":l(`navigation:sidebar.search`),className:o,onClick:c,children:(0,a.jsx)(r,{className:`size-5`,strokeWidth:1.75,"aria-hidden":`true`})}),(0,a.jsx)(`button`,{type:`button`,"data-phone-new-task":!0,"aria-label":l(`navigation:shell.newTask`),className:o,onClick:s,children:(0,a.jsx)(i,{className:`size-5`,strokeWidth:1.75,"aria-hidden":`true`})})]})]})}export{s as PhoneTopBar};
1
+ import{r as e}from"./vendor-react-DwNgTV1j.js";import{t}from"./use-i18n-BuN5i-jP.js";import{t as n}from"./PhoneMenuButton-WhIGM1zy.js";import{t as r}from"./search-D0mqDaf_.js";import{t as i}from"./square-pen-hYbjKh6A.js";var a=e(),o=`grid size-11 flex-none place-items-center rounded-full bg-surface-muted text-content focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus active:bg-surface-hover dark:bg-surface-active`;function s({title:e,onNewTask:s,onSearch:c}){let{t:l}=t();return(0,a.jsxs)(`header`,{"data-phone-topbar":!0,"data-focus-region":`header`,className:`relative grid h-14 flex-none grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-center bg-panel px-3`,children:[(0,a.jsx)(`div`,{className:`flex min-w-0 items-center`,children:(0,a.jsx)(n,{})}),(0,a.jsx)(`p`,{"data-phone-title":!0,"aria-hidden":`true`,className:`max-w-[min(56vw,240px)] truncate text-center text-base leading-6 font-semibold text-content`,children:e}),(0,a.jsxs)(`div`,{className:`flex min-w-0 items-center justify-end gap-2`,children:[c&&(0,a.jsx)(`button`,{type:`button`,"data-phone-search":!0,"aria-label":l(`navigation:sidebar.search`),className:o,onClick:c,children:(0,a.jsx)(r,{className:`size-5`,strokeWidth:1.75,"aria-hidden":`true`})}),(0,a.jsx)(`button`,{type:`button`,"data-phone-new-task":!0,"aria-label":l(`navigation:shell.newTask`),className:o,onClick:s,children:(0,a.jsx)(i,{className:`size-5`,strokeWidth:1.75,"aria-hidden":`true`})})]})]})}export{s as PhoneTopBar};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{t as r}from"./use-i18n-vlX9sewC.js";import{t as i}from"./api-DHnp1y9B.js";import{i as a}from"./runtime-capabilities-CHYOF_hE.js";import{t as o}from"./runtime-capabilities-store-CHtOHvCw.js";import{t as s}from"./createLucideIcon-Cd-3GVxJ.js";import{t as c}from"./circle-check-iEdCm3Pw.js";import{t as l}from"./earth-Ddy13fHh.js";import{t as u}from"./external-link-CEQqPcqc.js";import{t as d}from"./eye-uWAPXNzJ.js";import{t as f}from"./file-code-corner-BnE1ljT0.js";import{t as p}from"./folder-open-FIShC5Qk.js";import{t as m}from"./image-BY_c3FYU.js";import{t as h}from"./package-BOmkLaKS.js";import{t as g}from"./plug-BsIeHRwC.js";import{t as _}from"./save-CHBB52P8.js";import{t as v}from"./search-D0mqDaf_.js";import{t as y}from"./server-BgNvmqwJ.js";import{t as ee}from"./shield-alert-oZqX6MNu.js";import{t as te}from"./trash-2-CNrPOoPR.js";import{t as b}from"./triangle-alert-CE1q54ci.js";import{t as x}from"./more-pages-D_PnxLN0.js";import{a as S}from"./dist-41X0pdUs.js";import{o as C,s as w}from"./dist-BsRXXcSL.js";import{a as T,c as ne,i as E,l as D,n as O,o as k,r as re,s as ie,t as ae}from"./dist-BHkR6BLP.js";import{t as A}from"./utils-C8uzG5AZ.js";import{n as oe,t as j}from"./button-CCcCN8tE.js";import{s as se}from"./shortcuts-DDYN6uA3.js";import{a as M,i as N,l as P,o as F,s as I,t as L}from"./dialog-CVn9vhfy.js";import{t as R}from"./input-CPw-zkYh.js";import{t as ce}from"./pick-system-directory-DzwXQwyO.js";import{n as le,t as ue}from"./PageState-Cz6vFMXv.js";import{a as de,i as z,n as B,o as V,r as fe,s as pe,t as H}from"./FeaturePage-C6p1tTYM.js";import{t as U}from"./AppSelect-BD6RAaJ5.js";import{c as me,i as he,s as ge}from"./app-primitives-Drz_SjnR.js";import{a as W,i as _e,n as ve,o as ye,r as G,s as be,t as xe}from"./tool-labels-ghvpPFmc.js";var K=s(`package-plus`,[[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`path`,{d:`M16 17h6`,key:`1ook5g`}],[`path`,{d:`M19 14v6`,key:`1ckrd5`}],[`path`,{d:`M21 10.535V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.729l7 4a2 2 0 0 0 2 .001l1.675-.955`,key:`28k6lz`}],[`path`,{d:`M3.29 7 12 12l8.71-5`,key:`19ckod`}],[`path`,{d:`m7.5 4.27 8.997 5.148`,key:`9yrvtv`}]]),q=e(t(),1),J=n(),Y=Object.defineProperty,X=(e,t)=>Y(e,`name`,{value:t,configurable:!0}),[Se,Ce]=w(`AlertDialog`,[D]),Z=D(),we=X(e=>{let{__scopeAlertDialog:t,...n}=e,r=Z(t);return(0,J.jsx)(ae,{...r,...n,modal:!0})},`AlertDialog`);q.forwardRef(X(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=Z(n);return(0,J.jsx)(ne,{...i,...r,ref:t})},`AlertDialogTrigger`));var Te=X(e=>{let{__scopeAlertDialog:t,...n}=e,r=Z(t);return(0,J.jsx)(k,{...r,...n})},`AlertDialogPortal`),Q=q.forwardRef(X(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=Z(n);return(0,J.jsx)(T,{...i,...r,ref:t})},`AlertDialogOverlay`)),[Ee,$]=Se(`AlertDialogContent`),De=q.forwardRef(X(function(e,t){let{__scopeAlertDialog:n,children:r,...i}=e,a=Z(n),o=q.useRef(null),s=S(t,o),c=q.useRef(null);return(0,J.jsx)(Ee,{scope:n,cancelRef:c,children:(0,J.jsx)(re,{role:`alertdialog`,...a,...i,ref:s,onOpenAutoFocus:C(i.onOpenAutoFocus,e=>{e.preventDefault(),c.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:r})})},`AlertDialogContent`)),Oe=q.forwardRef(X(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=Z(n);return(0,J.jsx)(ie,{...i,...r,ref:t})},`AlertDialogTitle`)),ke=q.forwardRef(X(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=Z(n);return(0,J.jsx)(E,{...i,...r,ref:t})},`AlertDialogDescription`)),Ae=q.forwardRef(X(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=Z(n);return(0,J.jsx)(O,{...i,...r,ref:t})},`AlertDialogAction`)),je=`AlertDialogCancel`,Me=q.forwardRef(X(function(e,t){let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=$(je,n),a=Z(n),o=S(t,i);return(0,J.jsx)(O,{...a,...r,ref:o})},`AlertDialogCancel`)),Ne=we,Pe=Te,Fe=Q,Ie=De,Le=Ae,Re=Me,ze=Oe,Be=ke;function Ve({...e}){return(0,J.jsx)(Ne,{"data-slot":`alert-dialog`,...e})}function He({...e}){return(0,J.jsx)(Pe,{"data-slot":`alert-dialog-portal`,...e})}function Ue({className:e,...t}){return(0,J.jsx)(Fe,{"data-slot":`alert-dialog-overlay`,className:A(`fixed inset-0 z-50 bg-[var(--overlay-scrim)] duration-100 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function We({className:e,size:t=`default`,...n}){return(0,J.jsxs)(He,{children:[(0,J.jsx)(Ue,{}),(0,J.jsx)(Ie,{"data-slot":`alert-dialog-content`,"data-size":t,className:A(`group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid max-h-[calc(100vh-2rem)] supports-[height:100dvh]:max-h-[calc(100dvh-2rem)] w-full -translate-x-1/2 -translate-y-1/2 gap-4 overflow-y-auto overscroll-contain rounded-xl bg-popover p-4 text-popover-foreground shadow-float duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...n})]})}function Ge({className:e,...t}){return(0,J.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:A(`grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]`,e),...t})}function Ke({className:e,...t}){return(0,J.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:A(`-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t border-stroke bg-surface-subtle px-4 py-3 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end`,e),...t})}function qe({className:e,...t}){return(0,J.jsx)(ze,{"data-slot":`alert-dialog-title`,className:A(`font-heading text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2`,e),...t})}function Je({className:e,...t}){return(0,J.jsx)(Be,{"data-slot":`alert-dialog-description`,className:A(`text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function Ye({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,J.jsx)(j,{variant:t,size:n,asChild:!0,children:(0,J.jsx)(Le,{"data-slot":`alert-dialog-action`,className:A(e),...r})})}function Xe({className:e,variant:t=`outline`,size:n=`default`,...r}){return(0,J.jsx)(j,{variant:t,size:n,asChild:!0,children:(0,J.jsx)(Re,{"data-slot":`alert-dialog-cancel`,className:A(e),...r})})}function Ze(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function Qe({open:e,onOpenChange:t,onInstalled:n}){let{t:a}=r(),[o,s]=(0,q.useState)(``),[l,u]=(0,q.useState)(null),[d,f]=(0,q.useState)(!1),[m,h]=(0,q.useState)(``);return(0,q.useEffect)(()=>{e||(s(``),u(null),f(!1),h(``))},[e]),(0,J.jsx)(L,{open:e,onOpenChange:e=>!d&&t(e),children:(0,J.jsxs)(N,{className:`z-[220] sm:max-w-xl`,overlayClassName:`z-[220]`,children:[(0,J.jsxs)(I,{children:[(0,J.jsxs)(P,{className:`flex items-center gap-2`,children:[(0,J.jsx)(K,{className:`size-4 text-content-secondary`}),a(`plugins:pluginsPage.installLocalPlugin`)]}),(0,J.jsx)(M,{children:a(`plugins:pluginsPage.installLocalPluginDescription`)})]}),(0,J.jsxs)(`div`,{className:`grid gap-3`,children:[(0,J.jsxs)(`label`,{className:`grid gap-1.5 text-xs font-medium text-content-secondary`,children:[a(`plugins:pluginsPage.pluginDirectory`),(0,J.jsxs)(`span`,{className:`flex min-w-0 gap-2`,children:[(0,J.jsx)(R,{className:`min-w-0 flex-1 font-mono text-xs max-[650px]:h-11`,value:o,disabled:d,placeholder:a(`plugins:pluginsPage.pluginDirectoryPlaceholder`),onChange:e=>{s(e.target.value),u(null)}}),(0,J.jsx)(j,{type:`button`,variant:`secondary`,size:`icon`,className:`size-[34px] shrink-0 max-[650px]:size-11`,title:a(`plugins:pluginsPage.chooseDirectory`),"aria-label":a(`plugins:pluginsPage.chooseDirectory`),onClick:async()=>{h(``);try{let e=await ce(o,a(`plugins:pluginsPage.chooseDirectory`));e.status===`picked`?(s(e.path),u(null)):e.status===`unavailable`&&h(a(`common:workspacePicker.systemPickerUnavailable`))}catch(e){h(e instanceof Error?e.message:String(e))}},children:(0,J.jsx)(p,{})})]})]}),l&&(0,J.jsxs)(`div`,{className:`grid gap-3 overflow-hidden rounded-md border border-stroke bg-surface-subtle p-3`,children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[(0,J.jsx)(`span`,{className:`grid size-8 shrink-0 place-items-center rounded-sm bg-success-soft text-success`,children:(0,J.jsx)(c,{className:`size-4`})}),(0,J.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,J.jsx)(`strong`,{className:`block truncate text-sm font-medium text-content`,children:l.plugin.name}),(0,J.jsxs)(`small`,{className:`block truncate font-mono text-xs text-content-muted tabular-nums`,children:[l.plugin.id,` · v`,l.plugin.version,` · `,l.fileCount,` `,a(`plugins:pluginsPage.files`),` · `,Ze(l.byteCount)]})]})]}),(0,J.jsx)(`div`,{className:`grid gap-1.5`,children:l.plugin.capabilities.map(e=>(0,J.jsxs)(`div`,{className:`flex items-start justify-between gap-3 border-t border-stroke-soft pt-2 text-xs`,children:[(0,J.jsxs)(`span`,{className:`min-w-0`,children:[(0,J.jsx)(`strong`,{className:`block font-medium text-content`,children:e.label}),(0,J.jsx)(`small`,{className:`text-xs text-content-muted`,children:e.description})]}),(0,J.jsx)(`code`,{className:`shrink-0 font-mono text-xs text-content-secondary`,children:e.name})]},e.name))}),(0,J.jsxs)(`div`,{className:`flex items-start gap-2 rounded-sm bg-warning-soft p-2.5 text-xs leading-5 text-warning-strong`,children:[(0,J.jsx)(b,{className:`mt-0.5 shrink-0`,size:15}),(0,J.jsx)(`span`,{children:a(`plugins:pluginsPage.localPluginSecurityWarning`)})]})]}),m&&(0,J.jsxs)(he,{className:`m-0`,children:[(0,J.jsx)(b,{size:14}),(0,J.jsx)(`span`,{children:m})]})]}),(0,J.jsxs)(F,{children:[(0,J.jsx)(j,{type:`button`,variant:`secondary`,size:`dialogAction`,disabled:d,onClick:()=>t(!1),children:a(`common:ui.cancel`)}),(0,J.jsxs)(j,{type:`button`,size:`dialogAction`,disabled:d||!l&&!o.trim(),onClick:l?async()=>{if(!(!l||d)){f(!0),h(``);try{await i(`/api/plugins/install`,{method:`POST`,body:JSON.stringify({inspectionId:l.inspectionId})}),await n(),t(!1)}catch(e){h(e instanceof Error?e.message:String(e))}finally{f(!1)}}}:async()=>{if(!(!o.trim()||d)){f(!0),h(``);try{u(await i(`/api/plugins/inspect`,{method:`POST`,body:JSON.stringify({path:o.trim()})}))}catch(e){u(null),h(e instanceof Error?e.message:String(e))}finally{f(!1)}}},children:[d?(0,J.jsx)(oe,{className:`text-current`}):l?(0,J.jsx)(K,{}):(0,J.jsx)(c,{}),a(d?`plugins:pluginsPage.processing`:l?`plugins:pluginsPage.installPlugin`:`plugins:pluginsPage.inspectPlugin`)]})]})]})})}var $e=[`tool`,`prompt`,`skill`];function et(e){let t=Array.isArray(e.resourceTypes)?e.resourceTypes.filter(e=>$e.includes(e)):[];return t.length?t:[`tool`]}function tt(e,t){return{tool:t(`plugins:pluginsPage.extensionType.tool`),prompt:t(`plugins:pluginsPage.extensionType.prompt`),skill:t(`plugins:pluginsPage.extensionType.skill`)}[e]}var nt=[`all`,`builtin`,`local`],rt={read:d,ls:p,grep:v,find:v,edit:f,write:f,bash:y,web_search:l,browser_automation:l,generate_visual:m};function it(e,t){return t(e===`builtin`?`plugins:pluginsPage.builtIn`:e===`local`?`plugins:pluginsPage.local`:`plugins:pluginsPage.all`)}function at(e){return e.flatMap(e=>e.managedExternally?[]:e.capabilities.filter(e=>e.enabled).map(e=>e.name))}function ot(e){return e.filter(e=>!e.managedExternally||e.source===`pi`).flatMap(e=>e.capabilities.map(t=>({...t,pluginId:e.id,pluginName:e.name,pluginDescription:e.description,pluginVersion:e.version,pluginSource:e.source,pluginBuiltIn:e.builtIn,pluginPermissions:e.permissions||[],pluginSystemAccess:!!e.systemAccess})))}function st(e){return e.find(e=>e.source===`pi`&&e.name===`Computer Use`)?.enabled!==!1}function ct(e){return Object.fromEntries(e.filter(e=>e.source===`pi`&&e.name!==`Computer Use`&&!!e.packageSource).map(e=>[e.packageSource,e.enabled!==!1]))}function lt(e,t){return[...e].sort().join(`\0`)===[...t].sort().join(`\0`)}function ut(e,t){return W({id:e.name,name:e.label},t)}function dt(e,t){return e.pluginSource===`pi`?e.pluginName:G(e.pluginName,t)}function ft({value:e,testing:t,onChange:n,onTest:i}){let{t:a}=r();return(0,J.jsxs)(`div`,{className:`plugin-tool-config grid gap-2.5 border-t border-stroke pt-3 [&_label]:grid [&_label]:gap-1.5 [&_label]:text-xs [&_label]:font-medium [&_label]:text-content-secondary`,children:[(0,J.jsxs)(`div`,{className:`grid grid-cols-1 gap-2 sm:grid-cols-3`,children:[(0,J.jsxs)(`label`,{children:[a(`plugins:pluginsPage.defaultLanguage`),(0,J.jsxs)(U,{value:e.language,onChange:t=>n({...e,language:t.target.value}),children:[(0,J.jsx)(`option`,{value:`auto`,children:a(`plugins:pluginsPage.auto`)}),(0,J.jsx)(`option`,{value:`zh-CN`,children:a(`plugins:pluginsPage.simplifiedChinese`)}),(0,J.jsx)(`option`,{value:`en-US`,children:a(`plugins:pluginsPage.english`)})]})]}),(0,J.jsxs)(`label`,{children:[a(`plugins:pluginsPage.safeSearch`),(0,J.jsxs)(U,{value:e.safeSearch,onChange:t=>n({...e,safeSearch:Number(t.target.value)}),children:[(0,J.jsx)(`option`,{value:0,children:a(`plugins:pluginsPage.off`)}),(0,J.jsx)(`option`,{value:1,children:a(`plugins:pluginsPage.moderate`)}),(0,J.jsx)(`option`,{value:2,children:a(`plugins:pluginsPage.strict`)})]})]}),(0,J.jsxs)(`label`,{children:[a(`plugins:pluginsPage.resultCount`),(0,J.jsx)(R,{type:`number`,min:`1`,max:`12`,className:`tabular-nums`,value:e.maxResults,onChange:t=>n({...e,maxResults:Number(t.target.value)})})]})]}),(0,J.jsxs)(j,{type:`button`,variant:`secondary`,className:`justify-self-end max-[650px]:h-11`,loading:t,disabled:t,onClick:i,children:[(0,J.jsx)(l,{}),a(t?`plugins:pluginsPage.testing`:`plugins:pluginsPage.testConnection`)]})]})}function pt({query:e,notify:t,requestText:n,requestConfirm:a}){let{t:o}=r(),[s,c]=(0,q.useState)(``),[l,d]=(0,q.useState)(null),[f,p]=(0,q.useState)([]),[m,g]=(0,q.useState)(!1),[_,y]=(0,q.useState)(``),[ee,b]=(0,q.useState)(``),x=(0,q.useCallback)(async(e=``)=>{g(!0),b(``);try{let[t,n]=await Promise.all([i(`/api/extensions/market?name=${encodeURIComponent(e)}`),i(`/api/extensions`)]);d(t),p(n.packages||[])}catch(e){b(e instanceof Error?e.message:String(e))}finally{g(!1)}},[]);(0,q.useEffect)(()=>{x(``)},[x]);let S=(l?.packages||[]).filter(t=>`${t.name} ${t.description}`.toLowerCase().includes(e.trim().toLowerCase())),C=async e=>{if(await a?.({title:o(`plugins:pluginsPage.installExtension`),message:o(`plugins:pluginsPage.extensionSecurityWarning`,{name:e}),confirmLabel:o(`plugins:pluginsPage.installExtension`),tone:`danger`})!==!1){y(e);try{let n=/^(?:[.~\\/]|[A-Za-z]:[\\/])/.test(e)||/^(?:npm:|https?:\/\/|git\+)/i.test(e)?e:`npm:${e}`,r=await i(`/api/extensions/install`,{method:`POST`,body:JSON.stringify({source:n})});p(r.packages||[]),t(o(`plugins:pluginsPage.extensionInstalled`),`success`)}catch(e){t(e instanceof Error?e.message:String(e),`error`)}finally{y(``)}}},w=async()=>{let e=await n?.({title:o(`plugins:pluginsPage.installExtension`),message:o(`plugins:pluginsPage.extensionSourceHelp`),inputLabel:o(`plugins:pluginsPage.extensionSource`),placeholder:`npm:@scope/package or https://github.com/…`,maxLength:2e3});e?.trim()&&await C(e.trim())},T=async e=>{if(await a?.({title:o(`plugins:pluginsPage.uninstallExtension`),message:o(`plugins:pluginsPage.uninstallExtensionDescription`,{name:e.name}),confirmLabel:o(`plugins:pluginsPage.uninstallExtension`),tone:`danger`})!==!1){y(e.source);try{await i(`/api/extensions`,{method:`DELETE`,body:JSON.stringify({source:e.source,scope:e.scope})}),await x(s),t(o(`plugins:pluginsPage.extensionUninstalled`),`success`)}catch(e){t(e instanceof Error?e.message:String(e),`error`)}finally{y(``)}}},ne=$e.map(e=>({type:e,items:f.filter(t=>et(t).includes(e))})).filter(e=>e.items.length>0);return(0,J.jsxs)(J.Fragment,{children:[ne.map(e=>(0,J.jsx)(V,{className:`plugin-installed-extensions`,title:`${o(`plugins:pluginsPage.installedExtensions`)} · ${tt(e.type,o)}`,count:e.items.length,children:(0,J.jsx)(B,{children:e.items.map(t=>(0,J.jsx)(z,{icon:(0,J.jsx)(h,{}),name:(0,J.jsx)(`span`,{className:`font-mono`,children:t.name}),nameMeta:`v${t.version}`,description:(0,J.jsx)(`span`,{className:`font-mono text-xs`,children:t.source}),actions:(0,J.jsxs)(j,{type:`button`,variant:`ghost`,size:`sm`,className:`text-content-muted hover:bg-danger-soft hover:text-danger`,loading:_===t.source,disabled:!!_,onClick:()=>void T(t),children:[(0,J.jsx)(te,{}),o(`plugins:pluginsPage.uninstallExtension`)]})},`${e.type}:${t.scope}:${t.source}`))})},e.type)),(0,J.jsxs)(V,{className:`plugin-market`,title:o(`plugins:pluginsPage.extensionMarket`),actions:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(j,{asChild:!0,variant:`ghost`,size:`sm`,children:(0,J.jsxs)(`a`,{href:`https://pi.dev/packages`,target:`_blank`,rel:`noreferrer`,children:[(0,J.jsx)(u,{}),o(`plugins:pluginsPage.openPackageCatalog`)]})}),(0,J.jsxs)(j,{type:`button`,variant:`secondary`,size:`sm`,onClick:w,disabled:!!_,children:[(0,J.jsx)(K,{}),o(`plugins:pluginsPage.installExtension`)]})]}),children:[(0,J.jsxs)(`form`,{className:`mb-3 flex min-w-0 gap-2`,onSubmit:e=>{e.preventDefault(),x(s)},children:[(0,J.jsx)(R,{className:`min-w-0 flex-1 max-[650px]:h-11`,value:s,onChange:e=>c(e.target.value),placeholder:o(`plugins:pluginsPage.searchPackageCatalog`),"aria-label":o(`plugins:pluginsPage.searchPackageCatalog`)}),(0,J.jsxs)(j,{type:`submit`,variant:`secondary`,className:`h-[34px] max-[650px]:h-11`,loading:m,disabled:m,children:[(0,J.jsx)(v,{}),o(`plugins:pluginsPage.search`)]})]}),ee&&(0,J.jsx)(H,{className:`mt-0 mb-3`,children:ee}),S.length>0&&(0,J.jsx)(B,{children:S.slice(0,12).map(e=>{let t=f.some(t=>t.name===e.name||t.source===`npm:${e.name}`);return(0,J.jsx)(z,{icon:(0,J.jsx)(h,{}),name:(0,J.jsx)(`span`,{className:`font-mono`,children:e.name}),description:e.description,status:e.published,actions:(0,J.jsx)(j,{type:`button`,variant:`secondary`,size:`sm`,loading:_===e.name,disabled:t||!!_,onClick:()=>void C(e.name),children:o(t?`plugins:pluginsPage.installed`:`plugins:pluginsPage.installExtension`)})},e.name)})})]})]})}function mt({notify:e,onBack:t,requestText:n,requestConfirm:s}){let{t:c}=r(),l=se(`focusSearch`),u=o(e=>e.capabilities),d=a(u,`plugins`),f=d?nt:nt.slice(0,2),[p,m]=(0,q.useState)(``),[h,v]=(0,q.useState)(null),[y,S]=(0,q.useState)([]),[C,w]=(0,q.useState)(``),[T,ne]=(0,q.useState)(`all`),[E,D]=(0,q.useState)({provider:`bing`,language:`auto`,safeSearch:1,maxResults:8}),[O,k]=(0,q.useState)(!1),[re,ie]=(0,q.useState)(!1),[ae,M]=(0,q.useState)(!1),[N,P]=(0,q.useState)(null),[F,I]=(0,q.useState)(!1),[L,R]=(0,q.useState)(``),[ce,H]=(0,q.useState)(!1),U=(0,q.useCallback)(e=>{v(e),S(e.plugins),D(e.webSearch)},[]),W=(0,q.useCallback)(async()=>{R(``);try{U(await i(`/api/plugins`))}catch(e){R(e instanceof Error?e.message:String(e))}},[U]);(0,q.useEffect)(()=>{W()},[W]);let G=(0,q.useMemo)(()=>ot(y),[y]),Y=(0,q.useMemo)(()=>at(y),[y]),X=h?!lt(Y,h.enabledTools)||st(y)!==h.computerUseEnabled||JSON.stringify(ct(y))!==JSON.stringify(h.piExtensions)||JSON.stringify(E)!==JSON.stringify(h.webSearch):!1,Se=(0,q.useCallback)(async()=>{if(!O){if(!h||!X){h&&e(c(`plugins:pluginsPage.noPluginPolicyChanges`));return}k(!0),R(``);try{let t=await i(`/api/plugins`,{method:`PUT`,body:JSON.stringify({enabledTools:Y,webSearch:E,computerUseEnabled:st(y),piExtensions:ct(y)})});U(t),e(c(`plugins:pluginsPage.pluginPolicySavedAgentRuntimeUpdated`))}catch(e){R(e instanceof Error?e.message:String(e))}finally{k(!1)}}},[U,h,X,y,Y,e,O,c,E]),Ce=async()=>{ie(!0),R(``);try{let t=await i(`/api/plugins/web-search/test`,{method:`POST`,body:JSON.stringify(E)});e(c(`plugins:pluginsPage.bingSearchIsAvailableAndReturnedCountResults`,{count:t.count}))}catch(t){let n=t instanceof Error?t.message:String(t);R(n),e(n,`error`)}finally{ie(!1)}},Z=(e,t,n)=>{S(r=>r.map(r=>{if(r.id!==e)return r;let i=r.source===`pi`&&r.managedExternally;return{...r,enabled:n||r.capabilities.some(e=>e.enabled),capabilities:r.capabilities.map(e=>i||e.name===t?{...e,enabled:n}:e)}}))},we=()=>!X||(R(c(`plugins:pluginsPage.saveBeforePluginChanges`)),!1),Te=async()=>{if(!(!N||F)){I(!0),R(``);try{U(await i(`/api/plugins/${encodeURIComponent(N.pluginId)}`,{method:`DELETE`})),e(c(`plugins:pluginsPage.pluginUninstalled`,{name:N.pluginName})),w(``),P(null)}catch(e){R(e instanceof Error?e.message:String(e))}finally{I(!1)}}},Q=c(`navigation:navigation.plugins`),Ee=p.trim().toLowerCase(),$=G.filter(e=>T!==`all`&&e.pluginSource!==T?!1:[ut(e,c),e.name,e.description,dt(e,c),e.pluginId].join(` `).toLowerCase().includes(Ee));return(0,J.jsxs)(fe,{title:Q,description:c(`plugins:pluginsPage.lede`),back:t&&{label:c(`navigation:sidebar.features`),ariaLabel:c(`navigation:shell.backToFeaturesLabel`),onBack:t},toolbar:(0,J.jsx)(pe,{search:(0,J.jsx)(de,{id:x,value:p,onValueChange:m,placeholder:c(`navigation:pageHeader.searchPage`,{page:Q}),shortcut:l,clearLabel:c(`navigation:more.clearSearch`)}),actions:(0,J.jsxs)(J.Fragment,{children:[d&&(0,J.jsxs)(j,{type:`button`,variant:`secondary`,className:`h-9`,disabled:!h,onClick:()=>we()&&M(!0),children:[(0,J.jsx)(K,{}),c(`plugins:pluginsPage.installPlugin`)]}),(0,J.jsxs)(j,{type:`button`,className:`h-9`,"data-plugins-save":!0,loading:O,disabled:!h||O,onClick:()=>void Se(),children:[(0,J.jsx)(_,{}),c(`plugins:pluginsPage.savePolicy`)]})]}),filters:(0,J.jsx)(me,{options:f.map(e=>it(e,c)),value:it(T,c),onChange:e=>ne(f.find(t=>it(t,c)===e)||`all`)})}),children:[h?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(V,{className:`plugin-catalog`,title:c(`plugins:pluginsPage.toolCatalog`),count:$.length,meta:(0,J.jsxs)(`span`,{className:`plugin-catalog-summary`,children:[G.filter(e=>e.enabled).length,`/`,G.length,` `,c(`plugins:pluginsPage.enabled2`)]}),actions:X&&(0,J.jsxs)(`span`,{"data-plugins-unsaved":!0,className:`flex items-center gap-1.5 text-xs font-medium text-content-secondary`,children:[(0,J.jsx)(`span`,{"aria-hidden":`true`,className:`size-1.5 rounded-full bg-content-secondary`}),c(`plugins:pluginsPage.unsaved`)]}),children:$.length?(0,J.jsx)(B,{className:`plugin-tool-grid`,children:$.map(e=>{let t=rt[e.name]||g,n=ut(e,c);return(0,J.jsx)(z,{className:`plugin-tool-card`,"data-plugin-tool":e.name,icon:(0,J.jsx)(t,{}),name:(0,J.jsx)(`span`,{title:n,children:n}),nameMeta:e.name,description:`${dt(e,c)} · ${ye(e.risk,c)}`,status:e.pluginBuiltIn?void 0:c(`plugins:pluginsPage.local`),actions:(0,J.jsx)(ge,{value:e.enabled,onChange:t=>Z(e.pluginId,e.name,t),ariaLabel:n}),expanded:C===e.name,onExpandedChange:t=>w(t?e.name:``),toggleLabel:c(`plugins:pluginsPage.toggleToolDetails`,{name:n}),detail:(0,J.jsxs)(`div`,{className:`plugin-tool-details grid gap-3`,children:[(0,J.jsx)(`p`,{className:`text-sm leading-relaxed text-content-soft`,children:_e({id:e.name,description:e.description},c)}),(0,J.jsxs)(`dl`,{className:`grid grid-cols-[88px_minmax(0,1fr)] gap-x-3 gap-y-1.5 text-xs [&_dd]:min-w-0 [&_dd]:[overflow-wrap:anywhere] [&_dd]:text-content-soft [&_dt]:text-content-muted [&>div]:contents`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`dt`,{children:c(`plugins:pluginsPage.source`)}),(0,J.jsxs)(`dd`,{className:`tabular-nums`,children:[dt(e,c),!e.pluginBuiltIn&&` · v${e.pluginVersion}`]})]}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`dt`,{children:c(`plugins:pluginsPage.riskLevel`)}),(0,J.jsx)(`dd`,{className:A((xe(e.risk)||ve(e.risk))&&`font-medium text-content!`),children:ye(e.risk,c)})]}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`dt`,{children:c(`plugins:pluginsPage.pathScope`)}),(0,J.jsx)(`dd`,{children:be({id:e.name,scope:e.scope},c)})]}),!e.pluginBuiltIn&&(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`dt`,{children:c(`plugins:pluginsPage.executionMode`)}),(0,J.jsx)(`dd`,{children:c(`plugins:pluginsPage.confirmUnlessFullAccess`)})]})]}),!e.pluginBuiltIn&&(0,J.jsxs)(`div`,{className:`plugin-tool-warning flex items-start gap-2 rounded-sm bg-surface-subtle p-2.5 text-xs leading-normal text-content-secondary`,children:[(0,J.jsx)(ee,{className:`mt-px size-3.5 shrink-0`,"aria-hidden":`true`}),(0,J.jsx)(`span`,{children:c(`plugins:pluginsPage.localPluginSecurityWarning`)})]}),e.name===`web_search`&&(0,J.jsx)(ft,{value:E,testing:re,onChange:D,onTest:Ce}),!e.pluginBuiltIn&&(0,J.jsxs)(j,{type:`button`,variant:`ghost`,className:`justify-self-end text-danger hover:bg-danger-soft hover:text-danger max-[650px]:h-11`,onClick:()=>we()&&P(e),children:[(0,J.jsx)(te,{}),c(`plugins:pluginsPage.uninstallPlugin`)]})]})},e.name)})}):(0,J.jsx)(ue,{compact:!0,title:c(`plugins:pluginsPage.noMatchingTools`)})}),(0,J.jsx)(pt,{query:p,notify:e,requestText:n,requestConfirm:s})]}):L?(0,J.jsx)(le,{kind:`error`,title:c(`plugins:pluginsPage.loadFailed`),description:L,action:(0,J.jsx)(j,{variant:`secondary`,className:`max-[650px]:h-11`,loading:ce,disabled:ce,onClick:()=>{H(!0),W().finally(()=>H(!1))},children:c(`common:pageTemplate.retry`)})}):(0,J.jsx)(le,{kind:`loading`,title:c(`plugins:pluginsPage.loadingToolPlugins`)}),d&&(0,J.jsx)(Qe,{open:ae,onOpenChange:M,onInstalled:W}),(0,J.jsx)(Ve,{open:!!N,onOpenChange:e=>!e&&!F&&P(null),children:(0,J.jsxs)(We,{className:`z-[220]`,children:[(0,J.jsxs)(Ge,{children:[(0,J.jsx)(qe,{children:c(`plugins:pluginsPage.uninstallPlugin`)}),(0,J.jsx)(Je,{children:c(`plugins:pluginsPage.uninstallPluginDescription`,{name:N?.pluginName||``})})]}),(0,J.jsxs)(Ke,{children:[(0,J.jsx)(Xe,{disabled:F,children:c(`common:ui.cancel`)}),(0,J.jsxs)(Ye,{variant:`destructive`,disabled:F,onClick:Te,children:[F&&(0,J.jsx)(oe,{className:`text-current`}),c(`plugins:pluginsPage.uninstallPlugin`)]})]})]})}),L&&h&&(0,J.jsxs)(he,{className:`fixed right-6 bottom-6 z-[21] max-w-[360px] border border-danger-border shadow-float`,children:[(0,J.jsx)(b,{size:13}),L]})]})}export{mt as PluginsPage};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{t as r}from"./use-i18n-BuN5i-jP.js";import{t as i}from"./api-Dg-aNpVe.js";import{i as a}from"./runtime-capabilities-CHYOF_hE.js";import{t as o}from"./runtime-capabilities-store-B5Bam7pC.js";import{t as s}from"./createLucideIcon-Cd-3GVxJ.js";import{t as c}from"./circle-check-iEdCm3Pw.js";import{t as l}from"./earth-Ddy13fHh.js";import{t as u}from"./external-link-CEQqPcqc.js";import{t as d}from"./eye-uWAPXNzJ.js";import{t as f}from"./file-code-corner-BnE1ljT0.js";import{t as p}from"./folder-open-FIShC5Qk.js";import{t as m}from"./image-BY_c3FYU.js";import{t as h}from"./package-BOmkLaKS.js";import{t as g}from"./plug-BsIeHRwC.js";import{t as _}from"./save-CHBB52P8.js";import{t as v}from"./search-D0mqDaf_.js";import{t as y}from"./server-BgNvmqwJ.js";import{t as ee}from"./shield-alert-oZqX6MNu.js";import{t as te}from"./trash-2-CNrPOoPR.js";import{t as b}from"./triangle-alert-CE1q54ci.js";import{t as x}from"./more-pages-D_PnxLN0.js";import{a as S}from"./dist-41X0pdUs.js";import{o as C,s as w}from"./dist-BsRXXcSL.js";import{a as T,c as ne,i as E,l as D,n as O,o as k,r as re,s as ie,t as ae}from"./dist-BHkR6BLP.js";import{t as A}from"./utils-C8uzG5AZ.js";import{n as oe,t as j}from"./button-CCcCN8tE.js";import{s as se}from"./shortcuts-LBxOVau1.js";import{a as M,i as N,l as P,o as F,s as I,t as L}from"./dialog-CtFjznlx.js";import{t as R}from"./input-CPw-zkYh.js";import{t as ce}from"./pick-system-directory-B1clvHS6.js";import{n as le,t as ue}from"./PageState-Cz6vFMXv.js";import{a as de,i as z,n as B,o as V,r as fe,s as pe,t as H}from"./FeaturePage-C6kLKix5.js";import{t as U}from"./AppSelect-BD6RAaJ5.js";import{c as me,i as he,s as ge}from"./app-primitives-Drz_SjnR.js";import{a as W,i as _e,n as ve,o as ye,r as G,s as be,t as xe}from"./tool-labels-ghvpPFmc.js";var K=s(`package-plus`,[[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`path`,{d:`M16 17h6`,key:`1ook5g`}],[`path`,{d:`M19 14v6`,key:`1ckrd5`}],[`path`,{d:`M21 10.535V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.729l7 4a2 2 0 0 0 2 .001l1.675-.955`,key:`28k6lz`}],[`path`,{d:`M3.29 7 12 12l8.71-5`,key:`19ckod`}],[`path`,{d:`m7.5 4.27 8.997 5.148`,key:`9yrvtv`}]]),q=e(t(),1),J=n(),Y=Object.defineProperty,X=(e,t)=>Y(e,`name`,{value:t,configurable:!0}),[Se,Ce]=w(`AlertDialog`,[D]),Z=D(),we=X(e=>{let{__scopeAlertDialog:t,...n}=e,r=Z(t);return(0,J.jsx)(ae,{...r,...n,modal:!0})},`AlertDialog`);q.forwardRef(X(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=Z(n);return(0,J.jsx)(ne,{...i,...r,ref:t})},`AlertDialogTrigger`));var Te=X(e=>{let{__scopeAlertDialog:t,...n}=e,r=Z(t);return(0,J.jsx)(k,{...r,...n})},`AlertDialogPortal`),Q=q.forwardRef(X(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=Z(n);return(0,J.jsx)(T,{...i,...r,ref:t})},`AlertDialogOverlay`)),[Ee,$]=Se(`AlertDialogContent`),De=q.forwardRef(X(function(e,t){let{__scopeAlertDialog:n,children:r,...i}=e,a=Z(n),o=q.useRef(null),s=S(t,o),c=q.useRef(null);return(0,J.jsx)(Ee,{scope:n,cancelRef:c,children:(0,J.jsx)(re,{role:`alertdialog`,...a,...i,ref:s,onOpenAutoFocus:C(i.onOpenAutoFocus,e=>{e.preventDefault(),c.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:r})})},`AlertDialogContent`)),Oe=q.forwardRef(X(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=Z(n);return(0,J.jsx)(ie,{...i,...r,ref:t})},`AlertDialogTitle`)),ke=q.forwardRef(X(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=Z(n);return(0,J.jsx)(E,{...i,...r,ref:t})},`AlertDialogDescription`)),Ae=q.forwardRef(X(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=Z(n);return(0,J.jsx)(O,{...i,...r,ref:t})},`AlertDialogAction`)),je=`AlertDialogCancel`,Me=q.forwardRef(X(function(e,t){let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=$(je,n),a=Z(n),o=S(t,i);return(0,J.jsx)(O,{...a,...r,ref:o})},`AlertDialogCancel`)),Ne=we,Pe=Te,Fe=Q,Ie=De,Le=Ae,Re=Me,ze=Oe,Be=ke;function Ve({...e}){return(0,J.jsx)(Ne,{"data-slot":`alert-dialog`,...e})}function He({...e}){return(0,J.jsx)(Pe,{"data-slot":`alert-dialog-portal`,...e})}function Ue({className:e,...t}){return(0,J.jsx)(Fe,{"data-slot":`alert-dialog-overlay`,className:A(`fixed inset-0 z-50 bg-[var(--overlay-scrim)] duration-100 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function We({className:e,size:t=`default`,...n}){return(0,J.jsxs)(He,{children:[(0,J.jsx)(Ue,{}),(0,J.jsx)(Ie,{"data-slot":`alert-dialog-content`,"data-size":t,className:A(`group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid max-h-[calc(100vh-2rem)] supports-[height:100dvh]:max-h-[calc(100dvh-2rem)] w-full -translate-x-1/2 -translate-y-1/2 gap-4 overflow-y-auto overscroll-contain rounded-xl bg-popover p-4 text-popover-foreground shadow-float duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...n})]})}function Ge({className:e,...t}){return(0,J.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:A(`grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]`,e),...t})}function Ke({className:e,...t}){return(0,J.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:A(`-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t border-stroke bg-surface-subtle px-4 py-3 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end`,e),...t})}function qe({className:e,...t}){return(0,J.jsx)(ze,{"data-slot":`alert-dialog-title`,className:A(`font-heading text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2`,e),...t})}function Je({className:e,...t}){return(0,J.jsx)(Be,{"data-slot":`alert-dialog-description`,className:A(`text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function Ye({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,J.jsx)(j,{variant:t,size:n,asChild:!0,children:(0,J.jsx)(Le,{"data-slot":`alert-dialog-action`,className:A(e),...r})})}function Xe({className:e,variant:t=`outline`,size:n=`default`,...r}){return(0,J.jsx)(j,{variant:t,size:n,asChild:!0,children:(0,J.jsx)(Re,{"data-slot":`alert-dialog-cancel`,className:A(e),...r})})}function Ze(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function Qe({open:e,onOpenChange:t,onInstalled:n}){let{t:a}=r(),[o,s]=(0,q.useState)(``),[l,u]=(0,q.useState)(null),[d,f]=(0,q.useState)(!1),[m,h]=(0,q.useState)(``);return(0,q.useEffect)(()=>{e||(s(``),u(null),f(!1),h(``))},[e]),(0,J.jsx)(L,{open:e,onOpenChange:e=>!d&&t(e),children:(0,J.jsxs)(N,{className:`z-[220] sm:max-w-xl`,overlayClassName:`z-[220]`,children:[(0,J.jsxs)(I,{children:[(0,J.jsxs)(P,{className:`flex items-center gap-2`,children:[(0,J.jsx)(K,{className:`size-4 text-content-secondary`}),a(`plugins:pluginsPage.installLocalPlugin`)]}),(0,J.jsx)(M,{children:a(`plugins:pluginsPage.installLocalPluginDescription`)})]}),(0,J.jsxs)(`div`,{className:`grid gap-3`,children:[(0,J.jsxs)(`label`,{className:`grid gap-1.5 text-xs font-medium text-content-secondary`,children:[a(`plugins:pluginsPage.pluginDirectory`),(0,J.jsxs)(`span`,{className:`flex min-w-0 gap-2`,children:[(0,J.jsx)(R,{className:`min-w-0 flex-1 font-mono text-xs max-[650px]:h-11`,value:o,disabled:d,placeholder:a(`plugins:pluginsPage.pluginDirectoryPlaceholder`),onChange:e=>{s(e.target.value),u(null)}}),(0,J.jsx)(j,{type:`button`,variant:`secondary`,size:`icon`,className:`size-[34px] shrink-0 max-[650px]:size-11`,title:a(`plugins:pluginsPage.chooseDirectory`),"aria-label":a(`plugins:pluginsPage.chooseDirectory`),onClick:async()=>{h(``);try{let e=await ce(o,a(`plugins:pluginsPage.chooseDirectory`));e.status===`picked`?(s(e.path),u(null)):e.status===`unavailable`&&h(a(`common:workspacePicker.systemPickerUnavailable`))}catch(e){h(e instanceof Error?e.message:String(e))}},children:(0,J.jsx)(p,{})})]})]}),l&&(0,J.jsxs)(`div`,{className:`grid gap-3 overflow-hidden rounded-md border border-stroke bg-surface-subtle p-3`,children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[(0,J.jsx)(`span`,{className:`grid size-8 shrink-0 place-items-center rounded-sm bg-success-soft text-success`,children:(0,J.jsx)(c,{className:`size-4`})}),(0,J.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,J.jsx)(`strong`,{className:`block truncate text-sm font-medium text-content`,children:l.plugin.name}),(0,J.jsxs)(`small`,{className:`block truncate font-mono text-xs text-content-muted tabular-nums`,children:[l.plugin.id,` · v`,l.plugin.version,` · `,l.fileCount,` `,a(`plugins:pluginsPage.files`),` · `,Ze(l.byteCount)]})]})]}),(0,J.jsx)(`div`,{className:`grid gap-1.5`,children:l.plugin.capabilities.map(e=>(0,J.jsxs)(`div`,{className:`flex items-start justify-between gap-3 border-t border-stroke-soft pt-2 text-xs`,children:[(0,J.jsxs)(`span`,{className:`min-w-0`,children:[(0,J.jsx)(`strong`,{className:`block font-medium text-content`,children:e.label}),(0,J.jsx)(`small`,{className:`text-xs text-content-muted`,children:e.description})]}),(0,J.jsx)(`code`,{className:`shrink-0 font-mono text-xs text-content-secondary`,children:e.name})]},e.name))}),(0,J.jsxs)(`div`,{className:`flex items-start gap-2 rounded-sm bg-warning-soft p-2.5 text-xs leading-5 text-warning-strong`,children:[(0,J.jsx)(b,{className:`mt-0.5 shrink-0`,size:15}),(0,J.jsx)(`span`,{children:a(`plugins:pluginsPage.localPluginSecurityWarning`)})]})]}),m&&(0,J.jsxs)(he,{className:`m-0`,children:[(0,J.jsx)(b,{size:14}),(0,J.jsx)(`span`,{children:m})]})]}),(0,J.jsxs)(F,{children:[(0,J.jsx)(j,{type:`button`,variant:`secondary`,size:`dialogAction`,disabled:d,onClick:()=>t(!1),children:a(`common:ui.cancel`)}),(0,J.jsxs)(j,{type:`button`,size:`dialogAction`,disabled:d||!l&&!o.trim(),onClick:l?async()=>{if(!(!l||d)){f(!0),h(``);try{await i(`/api/plugins/install`,{method:`POST`,body:JSON.stringify({inspectionId:l.inspectionId})}),await n(),t(!1)}catch(e){h(e instanceof Error?e.message:String(e))}finally{f(!1)}}}:async()=>{if(!(!o.trim()||d)){f(!0),h(``);try{u(await i(`/api/plugins/inspect`,{method:`POST`,body:JSON.stringify({path:o.trim()})}))}catch(e){u(null),h(e instanceof Error?e.message:String(e))}finally{f(!1)}}},children:[d?(0,J.jsx)(oe,{className:`text-current`}):l?(0,J.jsx)(K,{}):(0,J.jsx)(c,{}),a(d?`plugins:pluginsPage.processing`:l?`plugins:pluginsPage.installPlugin`:`plugins:pluginsPage.inspectPlugin`)]})]})]})})}var $e=[`tool`,`prompt`,`skill`];function et(e){let t=Array.isArray(e.resourceTypes)?e.resourceTypes.filter(e=>$e.includes(e)):[];return t.length?t:[`tool`]}function tt(e,t){return{tool:t(`plugins:pluginsPage.extensionType.tool`),prompt:t(`plugins:pluginsPage.extensionType.prompt`),skill:t(`plugins:pluginsPage.extensionType.skill`)}[e]}var nt=[`all`,`builtin`,`local`],rt={read:d,ls:p,grep:v,find:v,edit:f,write:f,bash:y,web_search:l,browser_automation:l,generate_visual:m};function it(e,t){return t(e===`builtin`?`plugins:pluginsPage.builtIn`:e===`local`?`plugins:pluginsPage.local`:`plugins:pluginsPage.all`)}function at(e){return e.flatMap(e=>e.managedExternally?[]:e.capabilities.filter(e=>e.enabled).map(e=>e.name))}function ot(e){return e.filter(e=>!e.managedExternally||e.source===`pi`).flatMap(e=>e.capabilities.map(t=>({...t,pluginId:e.id,pluginName:e.name,pluginDescription:e.description,pluginVersion:e.version,pluginSource:e.source,pluginBuiltIn:e.builtIn,pluginPermissions:e.permissions||[],pluginSystemAccess:!!e.systemAccess})))}function st(e){return e.find(e=>e.source===`pi`&&e.name===`Computer Use`)?.enabled!==!1}function ct(e){return Object.fromEntries(e.filter(e=>e.source===`pi`&&e.name!==`Computer Use`&&!!e.packageSource).map(e=>[e.packageSource,e.enabled!==!1]))}function lt(e,t){return[...e].sort().join(`\0`)===[...t].sort().join(`\0`)}function ut(e,t){return W({id:e.name,name:e.label},t)}function dt(e,t){return e.pluginSource===`pi`?e.pluginName:G(e.pluginName,t)}function ft({value:e,testing:t,onChange:n,onTest:i}){let{t:a}=r();return(0,J.jsxs)(`div`,{className:`plugin-tool-config grid gap-2.5 border-t border-stroke pt-3 [&_label]:grid [&_label]:gap-1.5 [&_label]:text-xs [&_label]:font-medium [&_label]:text-content-secondary`,children:[(0,J.jsxs)(`div`,{className:`grid grid-cols-1 gap-2 sm:grid-cols-3`,children:[(0,J.jsxs)(`label`,{children:[a(`plugins:pluginsPage.defaultLanguage`),(0,J.jsxs)(U,{value:e.language,onChange:t=>n({...e,language:t.target.value}),children:[(0,J.jsx)(`option`,{value:`auto`,children:a(`plugins:pluginsPage.auto`)}),(0,J.jsx)(`option`,{value:`zh-CN`,children:a(`plugins:pluginsPage.simplifiedChinese`)}),(0,J.jsx)(`option`,{value:`en-US`,children:a(`plugins:pluginsPage.english`)})]})]}),(0,J.jsxs)(`label`,{children:[a(`plugins:pluginsPage.safeSearch`),(0,J.jsxs)(U,{value:e.safeSearch,onChange:t=>n({...e,safeSearch:Number(t.target.value)}),children:[(0,J.jsx)(`option`,{value:0,children:a(`plugins:pluginsPage.off`)}),(0,J.jsx)(`option`,{value:1,children:a(`plugins:pluginsPage.moderate`)}),(0,J.jsx)(`option`,{value:2,children:a(`plugins:pluginsPage.strict`)})]})]}),(0,J.jsxs)(`label`,{children:[a(`plugins:pluginsPage.resultCount`),(0,J.jsx)(R,{type:`number`,min:`1`,max:`12`,className:`tabular-nums`,value:e.maxResults,onChange:t=>n({...e,maxResults:Number(t.target.value)})})]})]}),(0,J.jsxs)(j,{type:`button`,variant:`secondary`,className:`justify-self-end max-[650px]:h-11`,loading:t,disabled:t,onClick:i,children:[(0,J.jsx)(l,{}),a(t?`plugins:pluginsPage.testing`:`plugins:pluginsPage.testConnection`)]})]})}function pt({query:e,notify:t,requestText:n,requestConfirm:a}){let{t:o}=r(),[s,c]=(0,q.useState)(``),[l,d]=(0,q.useState)(null),[f,p]=(0,q.useState)([]),[m,g]=(0,q.useState)(!1),[_,y]=(0,q.useState)(``),[ee,b]=(0,q.useState)(``),x=(0,q.useCallback)(async(e=``)=>{g(!0),b(``);try{let[t,n]=await Promise.all([i(`/api/extensions/market?name=${encodeURIComponent(e)}`),i(`/api/extensions`)]);d(t),p(n.packages||[])}catch(e){b(e instanceof Error?e.message:String(e))}finally{g(!1)}},[]);(0,q.useEffect)(()=>{x(``)},[x]);let S=(l?.packages||[]).filter(t=>`${t.name} ${t.description}`.toLowerCase().includes(e.trim().toLowerCase())),C=async e=>{if(await a?.({title:o(`plugins:pluginsPage.installExtension`),message:o(`plugins:pluginsPage.extensionSecurityWarning`,{name:e}),confirmLabel:o(`plugins:pluginsPage.installExtension`),tone:`danger`})!==!1){y(e);try{let n=/^(?:[.~\\/]|[A-Za-z]:[\\/])/.test(e)||/^(?:npm:|https?:\/\/|git\+)/i.test(e)?e:`npm:${e}`,r=await i(`/api/extensions/install`,{method:`POST`,body:JSON.stringify({source:n})});p(r.packages||[]),t(o(`plugins:pluginsPage.extensionInstalled`),`success`)}catch(e){t(e instanceof Error?e.message:String(e),`error`)}finally{y(``)}}},w=async()=>{let e=await n?.({title:o(`plugins:pluginsPage.installExtension`),message:o(`plugins:pluginsPage.extensionSourceHelp`),inputLabel:o(`plugins:pluginsPage.extensionSource`),placeholder:`npm:@scope/package or https://github.com/…`,maxLength:2e3});e?.trim()&&await C(e.trim())},T=async e=>{if(await a?.({title:o(`plugins:pluginsPage.uninstallExtension`),message:o(`plugins:pluginsPage.uninstallExtensionDescription`,{name:e.name}),confirmLabel:o(`plugins:pluginsPage.uninstallExtension`),tone:`danger`})!==!1){y(e.source);try{await i(`/api/extensions`,{method:`DELETE`,body:JSON.stringify({source:e.source,scope:e.scope})}),await x(s),t(o(`plugins:pluginsPage.extensionUninstalled`),`success`)}catch(e){t(e instanceof Error?e.message:String(e),`error`)}finally{y(``)}}},ne=$e.map(e=>({type:e,items:f.filter(t=>et(t).includes(e))})).filter(e=>e.items.length>0);return(0,J.jsxs)(J.Fragment,{children:[ne.map(e=>(0,J.jsx)(V,{className:`plugin-installed-extensions`,title:`${o(`plugins:pluginsPage.installedExtensions`)} · ${tt(e.type,o)}`,count:e.items.length,children:(0,J.jsx)(B,{children:e.items.map(t=>(0,J.jsx)(z,{icon:(0,J.jsx)(h,{}),name:(0,J.jsx)(`span`,{className:`font-mono`,children:t.name}),nameMeta:`v${t.version}`,description:(0,J.jsx)(`span`,{className:`font-mono text-xs`,children:t.source}),actions:(0,J.jsxs)(j,{type:`button`,variant:`ghost`,size:`sm`,className:`text-content-muted hover:bg-danger-soft hover:text-danger`,loading:_===t.source,disabled:!!_,onClick:()=>void T(t),children:[(0,J.jsx)(te,{}),o(`plugins:pluginsPage.uninstallExtension`)]})},`${e.type}:${t.scope}:${t.source}`))})},e.type)),(0,J.jsxs)(V,{className:`plugin-market`,title:o(`plugins:pluginsPage.extensionMarket`),actions:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(j,{asChild:!0,variant:`ghost`,size:`sm`,children:(0,J.jsxs)(`a`,{href:`https://pi.dev/packages`,target:`_blank`,rel:`noreferrer`,children:[(0,J.jsx)(u,{}),o(`plugins:pluginsPage.openPackageCatalog`)]})}),(0,J.jsxs)(j,{type:`button`,variant:`secondary`,size:`sm`,onClick:w,disabled:!!_,children:[(0,J.jsx)(K,{}),o(`plugins:pluginsPage.installExtension`)]})]}),children:[(0,J.jsxs)(`form`,{className:`mb-3 flex min-w-0 gap-2`,onSubmit:e=>{e.preventDefault(),x(s)},children:[(0,J.jsx)(R,{className:`min-w-0 flex-1 max-[650px]:h-11`,value:s,onChange:e=>c(e.target.value),placeholder:o(`plugins:pluginsPage.searchPackageCatalog`),"aria-label":o(`plugins:pluginsPage.searchPackageCatalog`)}),(0,J.jsxs)(j,{type:`submit`,variant:`secondary`,className:`h-[34px] max-[650px]:h-11`,loading:m,disabled:m,children:[(0,J.jsx)(v,{}),o(`plugins:pluginsPage.search`)]})]}),ee&&(0,J.jsx)(H,{className:`mt-0 mb-3`,children:ee}),S.length>0&&(0,J.jsx)(B,{children:S.slice(0,12).map(e=>{let t=f.some(t=>t.name===e.name||t.source===`npm:${e.name}`);return(0,J.jsx)(z,{icon:(0,J.jsx)(h,{}),name:(0,J.jsx)(`span`,{className:`font-mono`,children:e.name}),description:e.description,status:e.published,actions:(0,J.jsx)(j,{type:`button`,variant:`secondary`,size:`sm`,loading:_===e.name,disabled:t||!!_,onClick:()=>void C(e.name),children:o(t?`plugins:pluginsPage.installed`:`plugins:pluginsPage.installExtension`)})},e.name)})})]})]})}function mt({notify:e,onBack:t,requestText:n,requestConfirm:s}){let{t:c}=r(),l=se(`focusSearch`),u=o(e=>e.capabilities),d=a(u,`plugins`),f=d?nt:nt.slice(0,2),[p,m]=(0,q.useState)(``),[h,v]=(0,q.useState)(null),[y,S]=(0,q.useState)([]),[C,w]=(0,q.useState)(``),[T,ne]=(0,q.useState)(`all`),[E,D]=(0,q.useState)({provider:`bing`,language:`auto`,safeSearch:1,maxResults:8}),[O,k]=(0,q.useState)(!1),[re,ie]=(0,q.useState)(!1),[ae,M]=(0,q.useState)(!1),[N,P]=(0,q.useState)(null),[F,I]=(0,q.useState)(!1),[L,R]=(0,q.useState)(``),[ce,H]=(0,q.useState)(!1),U=(0,q.useCallback)(e=>{v(e),S(e.plugins),D(e.webSearch)},[]),W=(0,q.useCallback)(async()=>{R(``);try{U(await i(`/api/plugins`))}catch(e){R(e instanceof Error?e.message:String(e))}},[U]);(0,q.useEffect)(()=>{W()},[W]);let G=(0,q.useMemo)(()=>ot(y),[y]),Y=(0,q.useMemo)(()=>at(y),[y]),X=h?!lt(Y,h.enabledTools)||st(y)!==h.computerUseEnabled||JSON.stringify(ct(y))!==JSON.stringify(h.piExtensions)||JSON.stringify(E)!==JSON.stringify(h.webSearch):!1,Se=(0,q.useCallback)(async()=>{if(!O){if(!h||!X){h&&e(c(`plugins:pluginsPage.noPluginPolicyChanges`));return}k(!0),R(``);try{let t=await i(`/api/plugins`,{method:`PUT`,body:JSON.stringify({enabledTools:Y,webSearch:E,computerUseEnabled:st(y),piExtensions:ct(y)})});U(t),e(c(`plugins:pluginsPage.pluginPolicySavedAgentRuntimeUpdated`))}catch(e){R(e instanceof Error?e.message:String(e))}finally{k(!1)}}},[U,h,X,y,Y,e,O,c,E]),Ce=async()=>{ie(!0),R(``);try{let t=await i(`/api/plugins/web-search/test`,{method:`POST`,body:JSON.stringify(E)});e(c(`plugins:pluginsPage.bingSearchIsAvailableAndReturnedCountResults`,{count:t.count}))}catch(t){let n=t instanceof Error?t.message:String(t);R(n),e(n,`error`)}finally{ie(!1)}},Z=(e,t,n)=>{S(r=>r.map(r=>{if(r.id!==e)return r;let i=r.source===`pi`&&r.managedExternally;return{...r,enabled:n||r.capabilities.some(e=>e.enabled),capabilities:r.capabilities.map(e=>i||e.name===t?{...e,enabled:n}:e)}}))},we=()=>!X||(R(c(`plugins:pluginsPage.saveBeforePluginChanges`)),!1),Te=async()=>{if(!(!N||F)){I(!0),R(``);try{U(await i(`/api/plugins/${encodeURIComponent(N.pluginId)}`,{method:`DELETE`})),e(c(`plugins:pluginsPage.pluginUninstalled`,{name:N.pluginName})),w(``),P(null)}catch(e){R(e instanceof Error?e.message:String(e))}finally{I(!1)}}},Q=c(`navigation:navigation.plugins`),Ee=p.trim().toLowerCase(),$=G.filter(e=>T!==`all`&&e.pluginSource!==T?!1:[ut(e,c),e.name,e.description,dt(e,c),e.pluginId].join(` `).toLowerCase().includes(Ee));return(0,J.jsxs)(fe,{title:Q,description:c(`plugins:pluginsPage.lede`),back:t&&{label:c(`navigation:sidebar.features`),ariaLabel:c(`navigation:shell.backToFeaturesLabel`),onBack:t},toolbar:(0,J.jsx)(pe,{search:(0,J.jsx)(de,{id:x,value:p,onValueChange:m,placeholder:c(`navigation:pageHeader.searchPage`,{page:Q}),shortcut:l,clearLabel:c(`navigation:more.clearSearch`)}),actions:(0,J.jsxs)(J.Fragment,{children:[d&&(0,J.jsxs)(j,{type:`button`,variant:`secondary`,className:`h-9`,disabled:!h,onClick:()=>we()&&M(!0),children:[(0,J.jsx)(K,{}),c(`plugins:pluginsPage.installPlugin`)]}),(0,J.jsxs)(j,{type:`button`,className:`h-9`,"data-plugins-save":!0,loading:O,disabled:!h||O,onClick:()=>void Se(),children:[(0,J.jsx)(_,{}),c(`plugins:pluginsPage.savePolicy`)]})]}),filters:(0,J.jsx)(me,{options:f.map(e=>it(e,c)),value:it(T,c),onChange:e=>ne(f.find(t=>it(t,c)===e)||`all`)})}),children:[h?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(V,{className:`plugin-catalog`,title:c(`plugins:pluginsPage.toolCatalog`),count:$.length,meta:(0,J.jsxs)(`span`,{className:`plugin-catalog-summary`,children:[G.filter(e=>e.enabled).length,`/`,G.length,` `,c(`plugins:pluginsPage.enabled2`)]}),actions:X&&(0,J.jsxs)(`span`,{"data-plugins-unsaved":!0,className:`flex items-center gap-1.5 text-xs font-medium text-content-secondary`,children:[(0,J.jsx)(`span`,{"aria-hidden":`true`,className:`size-1.5 rounded-full bg-content-secondary`}),c(`plugins:pluginsPage.unsaved`)]}),children:$.length?(0,J.jsx)(B,{className:`plugin-tool-grid`,children:$.map(e=>{let t=rt[e.name]||g,n=ut(e,c);return(0,J.jsx)(z,{className:`plugin-tool-card`,"data-plugin-tool":e.name,icon:(0,J.jsx)(t,{}),name:(0,J.jsx)(`span`,{title:n,children:n}),nameMeta:e.name,description:`${dt(e,c)} · ${ye(e.risk,c)}`,status:e.pluginBuiltIn?void 0:c(`plugins:pluginsPage.local`),actions:(0,J.jsx)(ge,{value:e.enabled,onChange:t=>Z(e.pluginId,e.name,t),ariaLabel:n}),expanded:C===e.name,onExpandedChange:t=>w(t?e.name:``),toggleLabel:c(`plugins:pluginsPage.toggleToolDetails`,{name:n}),detail:(0,J.jsxs)(`div`,{className:`plugin-tool-details grid gap-3`,children:[(0,J.jsx)(`p`,{className:`text-sm leading-relaxed text-content-soft`,children:_e({id:e.name,description:e.description},c)}),(0,J.jsxs)(`dl`,{className:`grid grid-cols-[88px_minmax(0,1fr)] gap-x-3 gap-y-1.5 text-xs [&_dd]:min-w-0 [&_dd]:[overflow-wrap:anywhere] [&_dd]:text-content-soft [&_dt]:text-content-muted [&>div]:contents`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`dt`,{children:c(`plugins:pluginsPage.source`)}),(0,J.jsxs)(`dd`,{className:`tabular-nums`,children:[dt(e,c),!e.pluginBuiltIn&&` · v${e.pluginVersion}`]})]}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`dt`,{children:c(`plugins:pluginsPage.riskLevel`)}),(0,J.jsx)(`dd`,{className:A((xe(e.risk)||ve(e.risk))&&`font-medium text-content!`),children:ye(e.risk,c)})]}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`dt`,{children:c(`plugins:pluginsPage.pathScope`)}),(0,J.jsx)(`dd`,{children:be({id:e.name,scope:e.scope},c)})]}),!e.pluginBuiltIn&&(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`dt`,{children:c(`plugins:pluginsPage.executionMode`)}),(0,J.jsx)(`dd`,{children:c(`plugins:pluginsPage.confirmUnlessFullAccess`)})]})]}),!e.pluginBuiltIn&&(0,J.jsxs)(`div`,{className:`plugin-tool-warning flex items-start gap-2 rounded-sm bg-surface-subtle p-2.5 text-xs leading-normal text-content-secondary`,children:[(0,J.jsx)(ee,{className:`mt-px size-3.5 shrink-0`,"aria-hidden":`true`}),(0,J.jsx)(`span`,{children:c(`plugins:pluginsPage.localPluginSecurityWarning`)})]}),e.name===`web_search`&&(0,J.jsx)(ft,{value:E,testing:re,onChange:D,onTest:Ce}),!e.pluginBuiltIn&&(0,J.jsxs)(j,{type:`button`,variant:`ghost`,className:`justify-self-end text-danger hover:bg-danger-soft hover:text-danger max-[650px]:h-11`,onClick:()=>we()&&P(e),children:[(0,J.jsx)(te,{}),c(`plugins:pluginsPage.uninstallPlugin`)]})]})},e.name)})}):(0,J.jsx)(ue,{compact:!0,title:c(`plugins:pluginsPage.noMatchingTools`)})}),(0,J.jsx)(pt,{query:p,notify:e,requestText:n,requestConfirm:s})]}):L?(0,J.jsx)(le,{kind:`error`,title:c(`plugins:pluginsPage.loadFailed`),description:L,action:(0,J.jsx)(j,{variant:`secondary`,className:`max-[650px]:h-11`,loading:ce,disabled:ce,onClick:()=>{H(!0),W().finally(()=>H(!1))},children:c(`common:pageTemplate.retry`)})}):(0,J.jsx)(le,{kind:`loading`,title:c(`plugins:pluginsPage.loadingToolPlugins`)}),d&&(0,J.jsx)(Qe,{open:ae,onOpenChange:M,onInstalled:W}),(0,J.jsx)(Ve,{open:!!N,onOpenChange:e=>!e&&!F&&P(null),children:(0,J.jsxs)(We,{className:`z-[220]`,children:[(0,J.jsxs)(Ge,{children:[(0,J.jsx)(qe,{children:c(`plugins:pluginsPage.uninstallPlugin`)}),(0,J.jsx)(Je,{children:c(`plugins:pluginsPage.uninstallPluginDescription`,{name:N?.pluginName||``})})]}),(0,J.jsxs)(Ke,{children:[(0,J.jsx)(Xe,{disabled:F,children:c(`common:ui.cancel`)}),(0,J.jsxs)(Ye,{variant:`destructive`,disabled:F,onClick:Te,children:[F&&(0,J.jsx)(oe,{className:`text-current`}),c(`plugins:pluginsPage.uninstallPlugin`)]})]})]})}),L&&h&&(0,J.jsxs)(he,{className:`fixed right-6 bottom-6 z-[21] max-w-[360px] border border-danger-border shadow-float`,children:[(0,J.jsx)(b,{size:13}),L]})]})}export{mt as PluginsPage};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{t as r}from"./use-i18n-vlX9sewC.js";import{t as i}from"./button-CCcCN8tE.js";import{a,i as o,l as s,o as c,s as l,t as u}from"./dialog-CVn9vhfy.js";import{t as d}from"./safe-mode-instance-DofnjrC0.js";var f=e(t(),1),p=n();function m({notify:e,disableAll:t}){let{t:n}=r(),m=d(),h=(0,f.useSyncExternalStore)(m.subscribe,m.mode,m.mode),[g,_]=(0,f.useState)(!1);if(h!==`pending`)return null;let v=async()=>{_(!0);try{await t()||e(n(`custom-ui:safeMode.disableFailed`)),m.resolve(`normal`)}catch{e(n(`custom-ui:safeMode.disableFailed`))}finally{_(!1)}};return(0,p.jsx)(u,{open:!0,onOpenChange:e=>{!e&&!g&&m.resolve(`safe`)},children:(0,p.jsxs)(o,{"data-components-safe-mode-prompt":!0,children:[(0,p.jsxs)(l,{children:[(0,p.jsx)(s,{children:n(`custom-ui:safeMode.promptTitle`)}),(0,p.jsx)(a,{children:n(`custom-ui:safeMode.promptHint`)})]}),(0,p.jsxs)(c,{children:[(0,p.jsx)(i,{variant:`outline`,disabled:g,onClick:()=>void v(),children:n(`custom-ui:safeMode.disableAll`)}),(0,p.jsx)(i,{variant:`outline`,disabled:g,onClick:()=>m.resolve(`normal`),children:n(`custom-ui:safeMode.loadNormally`)}),(0,p.jsx)(i,{disabled:g,onClick:()=>m.resolve(`safe`),children:n(`custom-ui:safeMode.keepSafe`)})]})]})})}export{m as SafeModePrompt};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{t as r}from"./use-i18n-BuN5i-jP.js";import{t as i}from"./button-CCcCN8tE.js";import{a,i as o,l as s,o as c,s as l,t as u}from"./dialog-CtFjznlx.js";import{t as d}from"./safe-mode-instance-CJE36ukZ.js";var f=e(t(),1),p=n();function m({notify:e,disableAll:t}){let{t:n}=r(),m=d(),h=(0,f.useSyncExternalStore)(m.subscribe,m.mode,m.mode),[g,_]=(0,f.useState)(!1);if(h!==`pending`)return null;let v=async()=>{_(!0);try{await t()||e(n(`custom-ui:safeMode.disableFailed`)),m.resolve(`normal`)}catch{e(n(`custom-ui:safeMode.disableFailed`))}finally{_(!1)}};return(0,p.jsx)(u,{open:!0,onOpenChange:e=>{!e&&!g&&m.resolve(`safe`)},children:(0,p.jsxs)(o,{"data-components-safe-mode-prompt":!0,children:[(0,p.jsxs)(l,{children:[(0,p.jsx)(s,{children:n(`custom-ui:safeMode.promptTitle`)}),(0,p.jsx)(a,{children:n(`custom-ui:safeMode.promptHint`)})]}),(0,p.jsxs)(c,{children:[(0,p.jsx)(i,{variant:`outline`,disabled:g,onClick:()=>void v(),children:n(`custom-ui:safeMode.disableAll`)}),(0,p.jsx)(i,{variant:`outline`,disabled:g,onClick:()=>m.resolve(`normal`),children:n(`custom-ui:safeMode.loadNormally`)}),(0,p.jsx)(i,{disabled:g,onClick:()=>m.resolve(`safe`),children:n(`custom-ui:safeMode.keepSafe`)})]})]})})}export{m as SafeModePrompt};