@hienlh/ppm 0.20.0 → 0.20.1
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.
- package/CHANGELOG.md +5 -0
- package/assets/skills/ppm/SKILL.md +1 -1
- package/assets/skills/ppm/references/http-api.md +1 -1
- package/dist/web/assets/{accounts-settings-section-BQyru31C.js → accounts-settings-section-_sG1AqtH.js} +1 -1
- package/dist/web/assets/{ai-resource-editor-BgYIPGVP.js → ai-resource-editor-BLctP1Pr.js} +1 -1
- package/dist/web/assets/{ai-settings-section-iBRCQvBR.js → ai-settings-section-0hSDp7xx.js} +1 -1
- package/dist/web/assets/{ai-settings-section-Cywmtnps.js → ai-settings-section-CTEU2uGa.js} +1 -1
- package/dist/web/assets/{appearance-settings-section-mhu9T6Fk.js → appearance-settings-section-BkcoSV0E.js} +1 -1
- package/dist/web/assets/{chat-tab-Bs9OD6ss.js → chat-tab-CJi4uYb9.js} +3 -3
- package/dist/web/assets/{code-editor-Cv_pzHo7.js → code-editor-C4kKhamq.js} +2 -2
- package/dist/web/assets/{conflict-editor-BnWaMSEa.js → conflict-editor-BEULKwHk.js} +1 -1
- package/dist/web/assets/{csv-preview-DG4YAabr.js → csv-preview-k3eM8nFf.js} +1 -1
- package/dist/web/assets/{database-viewer-B-wA2qT-.js → database-viewer-Cslir1dr.js} +1 -1
- package/dist/web/assets/{diff-viewer-DRtzdfXk.js → diff-viewer-DzAIvBbn.js} +1 -1
- package/dist/web/assets/{edit-diff-preview-6tzdk7Pn.js → edit-diff-preview-xdDQvPhs.js} +1 -1
- package/dist/web/assets/{explorer-body-uh8oJp6J.js → explorer-body-D6H-4cz9.js} +1 -1
- package/dist/web/assets/{explorer-window-content-DLn_4egF.js → explorer-window-content-C5W_JzCz.js} +1 -1
- package/dist/web/assets/{extension-manager-section-C_ZGYvWf.js → extension-manager-section-DwicI3CA.js} +1 -1
- package/dist/web/assets/{extension-webview-DbFWxJpj.js → extension-webview-Z3HhC8Pd.js} +1 -1
- package/dist/web/assets/{files-settings-section-BrUbJglA.js → files-settings-section-ByV7bRbB.js} +1 -1
- package/dist/web/assets/{general-settings-section-B9ZPZVso.js → general-settings-section-nLksKHur.js} +1 -1
- package/dist/web/assets/{git-log-panel-C0jnhmgC.js → git-log-panel-iUXltiTB.js} +1 -1
- package/dist/web/assets/{glide-data-grid-CZVKIum-.js → glide-data-grid-C1QB4DHt.js} +1 -1
- package/dist/web/assets/{group-chat-tab-DnPtmbPc.js → group-chat-tab-ezXKVVpg.js} +1 -1
- package/dist/web/assets/{index-CHQAPZIX.js → index-CJWbFurD.js} +4 -4
- package/dist/web/assets/{jira-watcher-section-Bjldyhru.js → jira-watcher-section-DwARwskB.js} +1 -1
- package/dist/web/assets/{keybindings-store-DBVXZKp8.js → keybindings-store-S7YLGd8B.js} +1 -1
- package/dist/web/assets/{keyboard-shortcuts-section-D7jaCPrv.js → keyboard-shortcuts-section-BoUDvdDy.js} +1 -1
- package/dist/web/assets/{markdown-renderer-B4B5oxQS.js → markdown-renderer-DKdfiSIX.js} +2 -2
- package/dist/web/assets/{markdown-renderer-DwHh-jd_.js → markdown-renderer-DYFmMC_8.js} +1 -1
- package/dist/web/assets/{mobile-explorer-sheet-JJxZYWkV.js → mobile-explorer-sheet-CMdqLCV-.js} +1 -1
- package/dist/web/assets/{notification-store-CCWNUHsS.js → notification-store-DpSYFj36.js} +1 -1
- package/dist/web/assets/{notifications-settings-section-DbbX7-Qp.js → notifications-settings-section-CIf3-3xd.js} +1 -1
- package/dist/web/assets/{pdf-preview-DxNjWa1v.js → pdf-preview-C-7IdkIK.js} +1 -1
- package/dist/web/assets/{postgres-viewer-BScvk5ev.js → postgres-viewer-BYXFYlLg.js} +1 -1
- package/dist/web/assets/{ppmbot-settings-section-jFA9Ncgo.js → ppmbot-settings-section-B9dXvQ6p.js} +1 -1
- package/dist/web/assets/{process-table-BexeYWQm.js → process-table-B6NeTWt8.js} +1 -1
- package/dist/web/assets/{proxy-settings-section-C_seKq56.js → proxy-settings-section-CUqq7pdU.js} +1 -1
- package/dist/web/assets/{query-audit-section-BWXJmPDV.js → query-audit-section-C1TYrPIp.js} +1 -1
- package/dist/web/assets/{remote-desktop-mobile-sheet-B--PeL5i.js → remote-desktop-mobile-sheet-DuKwKe5F.js} +2 -2
- package/dist/web/assets/{remote-desktop-mobile-view-jgn8nmQa.js → remote-desktop-mobile-view-DxMTtsa6.js} +1 -1
- package/dist/web/assets/{remote-desktop-readiness-gate-CjDth-W_.js → remote-desktop-readiness-gate-BwjfLWqg.js} +1 -1
- package/dist/web/assets/{remote-desktop-window-content-CrHAUA03.js → remote-desktop-window-content-BIl4N5Hn.js} +1 -1
- package/dist/web/assets/{schedules-settings-section-DMFn3mYL.js → schedules-settings-section-C0qOb7GI.js} +1 -1
- package/dist/web/assets/{settings-body-Dz2vPTEP.js → settings-body-qbrJXX_A.js} +2 -2
- package/dist/web/assets/{settings-tab-B5QbsvS4.js → settings-tab-BKRgYVxf.js} +1 -1
- package/dist/web/assets/{settings-window-content-iM2bPoX5.js → settings-window-content-DWsxJDu-.js} +1 -1
- package/dist/web/assets/{sql-query-editor-C0mGgLfX.js → sql-query-editor-CsZOpCW3.js} +1 -1
- package/dist/web/assets/{sqlite-viewer-Bs3RKf1X.js → sqlite-viewer-DUrnCaP7.js} +1 -1
- package/dist/web/assets/{system-monitor-body-DvUmEdNe.js → system-monitor-body-C5cMpg7I.js} +2 -2
- package/dist/web/assets/{system-monitor-tab-CHZ5F_ZE.js → system-monitor-tab-C66ywbVZ.js} +1 -1
- package/dist/web/assets/{system-monitor-window-content-DjzqoeCN.js → system-monitor-window-content-CENaXYJ-.js} +1 -1
- package/dist/web/assets/{tab-host-window-content-DKeAr5mD.js → tab-host-window-content-HViABGoS.js} +1 -1
- package/dist/web/assets/{team-member-sheet-Cl9ZB3dl.js → team-member-sheet-CK6eyBRL.js} +2 -2
- package/dist/web/assets/{team-member-window-content-DfP7WdFD.js → team-member-window-content-D6wxg37P.js} +1 -1
- package/dist/web/assets/{terminal-tab-J1Fqa_rm.js → terminal-tab-BmyTawmN.js} +1 -1
- package/dist/web/assets/{tool-cards-DQghSuKX.js → tool-cards-y-XJcJHo.js} +3 -3
- package/dist/web/assets/{use-accounts-data-KWcMgRlc.js → use-accounts-data-BbOb2QNP.js} +1 -1
- package/dist/web/assets/{use-monaco-theme-aa4-wjKQ.js → use-monaco-theme-BkM5rMgL.js} +1 -1
- package/dist/web/assets/{use-remote-desktop-display-choice-B-TpQ-Ua.js → use-remote-desktop-display-choice-BT2r1td1.js} +1 -1
- package/dist/web/assets/{use-websocket-BBslmv3D.js → use-websocket-BvVTwMjI.js} +1 -1
- package/dist/web/assets/{video-preview-Bd0lcK3d.js → video-preview-BEaofjN7.js} +1 -1
- package/dist/web/index.html +1 -1
- package/dist/web/sw.js +1 -1
- package/package.json +1 -1
- package/src/web/components/chat/edit-diff-preview.tsx +14 -7
- package/src/web/components/shared/markdown-code-block.tsx +10 -5
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/markdown-renderer-
|
|
2
|
-
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{S as t,x as n}from"./vendor-markdown-Ls5AcU91.js";import{t as r}from"./createLucideIcon-D8pyde1A.js";import{n as i,t as a}from"./circle-question-mark-CzR7YRc-.js";import{t as o}from"./bot-D6sx11y0.js";import{t as s}from"./chevron-down-Dp0rpHb8.js";import{t as c}from"./chevron-right-De-Wz5Lz.js";import{t as l}from"./clock-C1CQUQPZ.js";import{t as u}from"./code-DJgYrFzm.js";import{n as d,t as f}from"./sparkles-Dh-_J2Rd.js";import{t as p}from"./loader-circle-DPMrnLQ2.js";import{t as m}from"./send-Bb0jtcR6.js";import{q as h}from"./vendor-mermaid-CfY1-PkA.js";import{t as g}from"./utils-IrnQujwR.js";import{t as _}from"./tab-store-1xYJb0gM.js";import{Ar as v,Dr as y,It as b,Mr as x,Nn as S,Rn as C,_r as w,nn as T,qn as E,r as D}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/markdown-renderer-DYFmMC_8.js","assets/vendor-mermaid-CfY1-PkA.js","assets/rolldown-runtime-FhOqtrmT.js","assets/vendor-ui-CaeeFO0B.js","assets/vendor-markdown-Ls5AcU91.js","assets/markdown-renderer-DKdfiSIX.js","assets/index-CJWbFurD.js","assets/button-DX32ffge.js","assets/utils-IrnQujwR.js","assets/createLucideIcon-D8pyde1A.js","assets/arrow-left-CyFcsyzD.js","assets/bot-D6sx11y0.js","assets/check-DN75Ucvz.js","assets/chevron-down-Dp0rpHb8.js","assets/chevron-right-De-Wz5Lz.js","assets/chevron-up-8PbsNiJp.js","assets/circle-BCy0AUCo.js","assets/clock-C1CQUQPZ.js","assets/sparkles-Dh-_J2Rd.js","assets/copy-BewHj66E.js","assets/database-Y3ESDK4-.js","assets/download-DG3_9xXy.js","assets/use-coarse-long-press-BmI_GVW5.js","assets/eye-off-GjXVuAOn.js","assets/eye-gWwaF4Lg.js","assets/loader-circle-DPMrnLQ2.js","assets/monitor-C835ucWH.js","assets/x-CxoBA0po.js","assets/api-client-CEYCBt_0.js","assets/react-D1Yg256j.js","assets/window-store-D0HbQ1pM.js","assets/window-pip-registry-CrCYYTTf.js","assets/panel-store-BmdcSBNb.js","assets/context-menu-CJL8L98s.js","assets/portal-container-context-DKymYOY-.js","assets/mobile-bottom-sheet-CmySDB6I.js","assets/use-visual-viewport-Bfl3Bxxb.js","assets/use-is-mobile-D1weanbj.js","assets/project-store-wWZ6bjwq.js","assets/ws-auth-D111jj32.js","assets/settings-store-CzLnTR8p.js","assets/streaming-store-9XVmAMfV.js","assets/tab-store-1xYJb0gM.js","assets/apply-theme-BVXAUYoN.js","assets/resolve-theme-CMp5xxCW.js","assets/index-CoaVwAF6.css","assets/image-gallery-J8h8IY0c.js","assets/run-in-terminal-wHKwAnWP.js","assets/edit-diff-preview-xdDQvPhs.js","assets/libesm-CdttTIAd.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{S as t,x as n}from"./vendor-markdown-Ls5AcU91.js";import{t as r}from"./createLucideIcon-D8pyde1A.js";import{n as i,t as a}from"./circle-question-mark-CzR7YRc-.js";import{t as o}from"./bot-D6sx11y0.js";import{t as s}from"./chevron-down-Dp0rpHb8.js";import{t as c}from"./chevron-right-De-Wz5Lz.js";import{t as l}from"./clock-C1CQUQPZ.js";import{t as u}from"./code-DJgYrFzm.js";import{n as d,t as f}from"./sparkles-Dh-_J2Rd.js";import{t as p}from"./loader-circle-DPMrnLQ2.js";import{t as m}from"./send-Bb0jtcR6.js";import{q as h}from"./vendor-mermaid-CfY1-PkA.js";import{t as g}from"./utils-IrnQujwR.js";import{t as _}from"./tab-store-1xYJb0gM.js";import{Ar as v,Dr as y,It as b,Mr as x,Nn as S,Rn as C,_r as w,nn as T,qn as E,r as D}from"./index-CJWbFurD.js";import{t as O}from"./use-blob-url-CrwoZJUJ.js";import{r as k,t as A}from"./image-gallery-J8h8IY0c.js";var j=r(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),M=r(`clipboard-list`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M12 11h4`,key:`1jrz19`}],[`path`,{d:`M12 16h4`,key:`n85exb`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]),N=r(`file-pen`,[[`path`,{d:`M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34`,key:`o6klzx`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z`,key:`zhnas1`}]]),P=r(`file-plus-corner`,[[`path`,{d:`M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35`,key:`17jvcc`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M14 19h6`,key:`bvotb8`}],[`path`,{d:`M17 16v6`,key:`18yu1i`}]]),F=r(`file-search`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`11.5`,cy:`14.5`,r:`2.5`,key:`1bq0ko`}],[`path`,{d:`M13.3 16.3 15 18`,key:`2quom7`}]]),I=r(`image-plus`,[[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`,key:`1ue2ih`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]),ee=r(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),L=r(`list-todo`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`,key:`cif1o7`}]]),R=e(t(),1),z=n(),te=(0,R.lazy)(()=>h(()=>import(`./markdown-renderer-DYFmMC_8.js`).then(e=>({default:e.MarkdownRenderer})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47])));function B({content:e,maxHeight:t=`max-h-48`}){return(0,z.jsx)(R.Suspense,{fallback:(0,z.jsx)(`div`,{className:`animate-pulse h-4 bg-muted rounded`}),children:(0,z.jsx)(te,{content:e,className:`text-text-secondary overflow-auto ${t}`})})}var ne={task_assignment:{label:`task`,className:`bg-primary/20 text-primary`},idle_notification:{label:`idle`,className:`bg-warning/20 text-warning`},completion:{label:`done`,className:`bg-success/20 text-success`},shutdown_request:{label:`shutdown`,className:`bg-error/20 text-error`},shutdown_approved:{label:`shutdown ✓`,className:`bg-text-3/20 text-text-3`},shutdown_response:{label:`shutdown reply`,className:`bg-text-3/20 text-text-3`},plan_approval_request:{label:`plan review`,className:`bg-primary/20 text-primary`},plan_approval_response:{label:`plan reply`,className:`bg-primary/20 text-primary`}},re=new Set([`to`,`message`,`summary`,`notify_when_idle`,`recipient`,`content`,`type`]),V=e=>typeof e==`string`?e:e==null?``:String(e);function H(e){if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e;return typeof t.type!=`string`||!t.type?null:{type:t.type,request_id:typeof t.request_id==`string`?t.request_id:void 0,approve:typeof t.approve==`boolean`?t.approve:void 0,reason:typeof t.reason==`string`?t.reason:void 0,feedback:typeof t.feedback==`string`?t.feedback:void 0}}function ie(e){let t=e.trim();if(!t.startsWith(`{`))return null;try{return H(JSON.parse(t))}catch{return null}}function U(e){let t=V(e.to)||V(e.recipient),n=e.message??e.content,r=H(n)??ie(V(n)),i=r?``:V(n),a=V(e.type),o=r?.type||(a&&a!==`message`?a:`message`),s=V(e.summary).trim(),c=Object.entries(e).filter(([e])=>!re.has(e)).map(([e,t])=>({key:e,value:typeof t==`string`?t:JSON.stringify(t)??``}));return{to:t,summary:s||void 0,text:i,firstLine:i.split(`
|
|
3
3
|
`).map(e=>e.trim()).find(e=>e.length>0)??``,protocol:r??void 0,kind:o,notifyWhenIdle:e.notify_when_idle===!0,extras:c}}function W(e){if(!e)return null;let t;try{t=JSON.parse(e)}catch{return null}if(Array.isArray(t)){let e=V(t.find(e=>e&&typeof e==`object`&&e.type===`text`)?.text);if(!e)return null;try{t=JSON.parse(e)}catch{return null}}if(!t||typeof t!=`object`||Array.isArray(t))return null;let n=t;if(typeof n.success!=`boolean`)return null;let r=n.pin&&typeof n.pin==`object`?n.pin:null;return{ok:n.success,detail:V(n.message)||V(n.error)||void 0,peer:r&&V(r.name)||void 0,ref:r&&V(r.ref)||void 0}}function ae({kind:e}){if(e===`message`)return null;let t=ne[e];return(0,z.jsx)(`span`,{className:`inline-block rounded px-1.5 py-0.5 text-[10px] ${t?.className??`bg-panel-2 text-text-3`}`,children:t?.label??e})}function oe({name:e,input:t}){let n=U(t),r=n.summary||n.firstLine||(n.protocol?n.kind:``),a=r.length>72?`${r.slice(0,72)}…`:r;return(0,z.jsxs)(z.Fragment,{children:[e,` `,(0,z.jsxs)(`span`,{className:`text-text-subtle`,children:[(0,z.jsx)(i,{className:`size-3 inline`}),` `,n.to||`unknown`,a?` · ${a}`:``]}),n.notifyWhenIdle&&(0,z.jsx)(l,{className:`size-3 inline ml-1 text-text-3`})]})}function se({input:e}){let t=U(e);return(0,z.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,z.jsx)(`span`,{className:`text-text-subtle`,children:`To`}),(0,z.jsx)(`span`,{className:`font-medium text-text-primary`,children:t.to||`unknown`}),(0,z.jsx)(ae,{kind:t.kind}),t.notifyWhenIdle&&(0,z.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] bg-panel-2 text-text-3`,children:[(0,z.jsx)(l,{className:`size-3`}),` notify when idle`]})]}),!!t.text&&(0,z.jsx)(B,{content:t.text,maxHeight:`max-h-40`}),t.protocol&&(0,z.jsxs)(`div`,{className:`space-y-0.5 text-text-secondary`,children:[t.protocol.approve!=null&&(0,z.jsxs)(`p`,{children:[t.protocol.approve?`Approved`:`Rejected`,t.protocol.request_id?(0,z.jsxs)(`span`,{className:`text-text-subtle font-mono`,children:[` · `,t.protocol.request_id]}):null]}),!!t.protocol.reason&&(0,z.jsx)(`p`,{className:`text-text-subtle`,children:t.protocol.reason}),!!t.protocol.feedback&&(0,z.jsx)(`p`,{className:`text-text-subtle`,children:t.protocol.feedback})]}),t.extras.length>0&&(0,z.jsx)(`div`,{className:`space-y-0.5`,children:t.extras.map(e=>(0,z.jsxs)(`p`,{className:`text-text-subtle`,children:[(0,z.jsx)(`span`,{className:`font-mono`,children:e.key}),`: `,e.value]},e.key))})]})}function ce({output:e}){let[t,n]=(0,R.useState)(!1),r=W(e);return r?(0,z.jsxs)(`div`,{className:`border-t border-border pt-1.5 space-y-1`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-1.5 flex-wrap`,children:[r.ok?(0,z.jsx)(v,{className:`size-3 text-success shrink-0`}):(0,z.jsx)(j,{className:`size-3 text-error shrink-0`}),(0,z.jsx)(`span`,{className:r.ok?`text-success`:`text-error`,children:r.ok?`Delivered`:`Not delivered`}),!!r.detail&&(0,z.jsxs)(`span`,{className:`text-text-subtle`,children:[`· `,r.detail]}),!!r.ref&&(0,z.jsxs)(`span`,{className:`text-text-3 font-mono text-[10px]`,children:[`[`,r.ref,`]`]})]}),(0,z.jsxs)(`button`,{type:`button`,onClick:()=>n(!t),className:`flex items-center gap-1 text-[10px] text-text-subtle hover:text-text-secondary transition-colors`,children:[(0,z.jsx)(u,{className:`size-3`}),t?`Hide`:`Show`,` raw`]}),t&&(0,z.jsx)(`pre`,{className:`overflow-x-auto text-text-subtle font-mono max-h-40 whitespace-pre-wrap break-all text-[10px]`,children:e})]}):null}var le=new Set([`.png`,`.jpg`,`.jpeg`,`.gif`,`.webp`,`.bmp`,`.avif`,`.ico`]);function ue(e){let t=e.lastIndexOf(`.`);return t===-1?!1:le.has(e.slice(t).toLowerCase())}var de=/^\[image(?: · [\d.]+(?:B|KB|MB))?\]$/;function fe(e){if(!e.startsWith(`[`))return!1;let t;try{t=JSON.parse(e)}catch{return!1}return Array.isArray(t)?t.some(e=>{let t=e;return t?.type===`text`&&typeof t.text==`string`&&de.test(t.text)}):!1}var pe=`Async agent launched successfully`;function me(e){return!!e&&e.includes(pe)}var he=`text-[var(--img-meta-label)] @max-[470px]:hidden`,ge=[`60%`,`45%`,`80%`];function _e({aspect:e,actions:t}){return(0,z.jsxs)(`div`,{className:`grid grid-cols-[132px_1fr] items-start gap-[14px] overflow-hidden rounded-lg border border-border bg-panel p-[14px] @max-[470px]:grid-cols-[64px_1fr] @max-[470px]:gap-[11px] @max-[470px]:p-[11px]`,children:[(0,z.jsx)(`div`,{className:`img-skeleton rounded-lg`,style:{aspectRatio:e}}),(0,z.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-[9px]`,children:[(0,z.jsx)(`div`,{className:`img-skeleton h-[13px] w-2/5 rounded @max-[470px]:hidden`}),(0,z.jsx)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-[14px] gap-y-[4px] font-mono text-[11.5px] @max-[470px]:grid-cols-[1fr]`,children:[`dimensions`,`size`,`path`].map((e,t)=>(0,z.jsxs)(R.Fragment,{children:[(0,z.jsx)(`dt`,{className:he,children:e}),(0,z.jsx)(`dd`,{className:`flex items-center`,children:(0,z.jsx)(`span`,{className:`img-skeleton h-[11px] rounded`,style:{width:ge[t]}})})]},e))}),t]})]})}function ve({code:e,onRetry:t}){return(0,z.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-border bg-panel px-2.5 py-2 font-mono text-[12px] text-text-2`,children:[(0,z.jsx)(x,{className:`size-3 shrink-0`}),(0,z.jsxs)(`span`,{className:`truncate`,children:[`preview unavailable`,e?` · ${e}`:``]}),(0,z.jsx)(`button`,{type:`button`,onClick:t,className:`ml-auto shrink-0 text-accent`,children:`retry`})]})}var ye=.62;function be(e,t){let n=e.w/e.h;if(n>2.4)return{variant:`band`,aspect:n,fit:`contain`};let r=Math.max(ye,n),i=t/r;return e.w<t&&e.h<i?{variant:`split`,aspect:r,fit:`native`}:{variant:`split`,aspect:r,fit:n<.62?`contain`:`cover`}}function xe(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:e>=1024?`${Math.round(e/1024)} KB`:`${e} B`}function Se(e,t){let n=`${e.w} × ${e.h} px`;return t===`native`?`${n} · shown 1:1`:n}var G=new Map;function Ce(e){return G.get(e)}function we(e,t){G.set(e,t)}var Te=4/5,K=`text-[var(--img-meta-label)] @max-[470px]:hidden`,q=`truncate text-text @max-[470px]:text-text-2`,J=`h-[30px] @max-[470px]:h-[36px] shrink-0 rounded-[7px] px-[9px] font-mono text-[11.5px] text-text-2 bg-[var(--img-ghost)] border border-[var(--img-ghost-border)] backdrop-blur-[6px] transition-colors can-hover:hover:bg-[var(--img-ghost-hover)] can-hover:hover:border-[var(--img-ghost-hover-border)] can-hover:hover:text-text`;function Ee({filePath:e,projectName:t}){let[n,r]=(0,R.useState)(0),{blobUrl:i,blob:a,error:o,errorCode:s}=O(e,t,void 0,n),[c,l]=(0,R.useState)(()=>Ce(e)),[u,d]=(0,R.useState)(!1),[f,p]=(0,R.useState)(!1),m=D(e=>e.open),{openTab:h}=_(b(e=>({openTab:e.openTab}))),v=g(e);(0,R.useEffect)(()=>{if(!f)return;let e=setTimeout(()=>p(!1),1200);return()=>clearTimeout(e)},[f]);let y=t=>{let n={w:t.naturalWidth,h:t.naturalHeight};if(!n.w||!n.h)return d(!0);we(e,n),l(n)},x=()=>{d(!1),r(e=>e+1)};if(o||u)return(0,z.jsx)(`div`,{className:`border-t border-border pt-1.5`,children:(0,z.jsx)(ve,{code:u?void 0:s??void 0,onRetry:x})});let S=c?be(c,132):null,C=S?.aspect??Te,w=(0,z.jsxs)(`div`,{className:`flex flex-wrap gap-[6px]`,children:[(0,z.jsxs)(`button`,{type:`button`,onClick:E,className:J,children:[(0,z.jsx)(`span`,{className:`@max-[470px]:hidden`,children:`open in editor`}),(0,z.jsx)(`span`,{className:`hidden @max-[470px]:inline`,children:`open`})]}),(0,z.jsx)(`button`,{type:`button`,onClick:j,className:J,children:f?`copied`:`copy path`}),(0,z.jsx)(`button`,{type:`button`,onClick:M,className:J,children:`full size`})]});function E(){t&&h({type:`editor`,title:v,metadata:{filePath:e,projectName:t},projectId:t,closable:!0})}function j(){T(e).then(()=>p(!0))}function M(e){i&&m(i,v,k(e.currentTarget))}if(!i||!S||!c)return(0,z.jsxs)(`div`,{className:`@container border-t border-border pt-1.5`,children:[i&&(0,z.jsx)(`img`,{src:i,alt:``,className:`hidden`,onLoad:e=>y(e.currentTarget),onError:()=>d(!0)}),(0,z.jsx)(_e,{aspect:C,actions:w})]});let N=(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`dt`,{className:K,children:`dimensions`}),(0,z.jsx)(`dd`,{className:q,children:Se(c,S.fit)}),a&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`dt`,{className:K,children:`size`}),(0,z.jsxs)(`dd`,{className:q,children:[xe(a.size),a.type?` · ${a.type}`:``]})]}),(0,z.jsx)(`dt`,{className:K,children:`path`}),(0,z.jsx)(`dd`,{dir:`rtl`,className:`${q} text-left`,children:e})]}),P=(0,z.jsx)(`img`,{src:i,alt:v,[A]:``,onLoad:e=>y(e.currentTarget),onError:()=>d(!0),className:S.fit===`cover`?`size-full object-cover`:S.fit===`contain`?`size-full object-contain`:`max-h-full max-w-full`});return(0,z.jsx)(`div`,{className:`@container border-t border-border pt-1.5`,children:(0,z.jsxs)(`div`,{className:`relative overflow-hidden rounded-lg border border-border p-[14px] @max-[470px]:p-[11px]`,children:[(0,z.jsx)(`img`,{"aria-hidden":`true`,alt:``,src:i,className:`absolute inset-0 size-full object-cover`,style:{filter:`var(--img-backdrop)`,transform:`scale(1.3)`}}),(0,z.jsx)(`div`,{className:`absolute inset-0`,style:{background:`var(--img-veil)`}}),S.variant===`band`?(0,z.jsxs)(`div`,{className:`relative grid gap-[11px]`,children:[(0,z.jsx)(`button`,{type:`button`,onClick:M,title:`Open ${v}`,className:`img-checkerboard w-full cursor-zoom-in overflow-hidden rounded-lg border border-[var(--img-plate-border)]`,style:{aspectRatio:S.aspect},children:P}),(0,z.jsx)(`dl`,{className:`grid grid-cols-[auto_auto_1fr] gap-x-[18px] font-mono text-[11.5px] [&_dt]:hidden`,children:N}),w]}):(0,z.jsxs)(`div`,{className:`relative grid grid-cols-[132px_1fr] items-start gap-[14px] @max-[470px]:grid-cols-[64px_1fr] @max-[470px]:gap-[11px]`,children:[(0,z.jsx)(`button`,{type:`button`,onClick:M,title:`Open ${v}`,className:`cursor-zoom-in overflow-hidden rounded-lg border border-[var(--img-plate-border)] bg-[var(--img-plate)] shadow-[var(--img-plate-shadow)] ${S.fit===`cover`?``:`img-checkerboard flex items-center justify-center`}`,style:{aspectRatio:S.aspect},children:P}),(0,z.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-[9px]`,children:[(0,z.jsx)(`p`,{className:`truncate text-[13px] font-semibold text-text @max-[470px]:hidden`,children:v}),(0,z.jsx)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-[14px] gap-y-[4px] font-mono text-[11.5px] @max-[470px]:grid-cols-[1fr]`,children:N}),w]})]})]})})}function Y(e,t){if(e!==`Agent`&&e!==`Task`)return null;let n=t.name;return typeof n==`string`&&n.trim()?n.trim():null}function De(e,t,n=!1){if(t&&(e===`Bash`||e===`PowerShell`))return{Icon:C,cls:`bg-error/15 text-error`};if(n)return{Icon:S,cls:`bg-accent-2/15 text-accent-2`};switch(e){case`Read`:case`Glob`:case`LS`:return{Icon:F,cls:`bg-accent-wash text-primary`};case`Grep`:case`Search`:case`WebSearch`:case`ToolSearch`:return{Icon:E,cls:`bg-accent-wash text-primary`};case`WebFetch`:case`Fetch`:return{Icon:w,cls:`bg-info/15 text-info`};case`Edit`:case`MultiEdit`:case`NotebookEdit`:return{Icon:N,cls:`bg-accent-2/15 text-accent-2`};case`Write`:return{Icon:P,cls:`bg-success/15 text-success`};case`Bash`:case`PowerShell`:return{Icon:C,cls:`bg-panel-2 text-text-2`};case`TodoWrite`:return{Icon:ee,cls:`bg-warning/15 text-warning`};case`Task`:case`Agent`:return{Icon:o,cls:`bg-accent-wash text-primary`};case`SendMessage`:return{Icon:m,cls:`bg-info/15 text-info`};case`AskUserQuestion`:return{Icon:a,cls:`bg-accent-wash text-primary`};case`ExitPlanMode`:return{Icon:M,cls:`bg-accent-wash text-primary`};case`Skill`:return{Icon:f,cls:`bg-accent-2/15 text-accent-2`};case`ImageGen`:return{Icon:I,cls:`bg-accent-2/15 text-accent-2`};default:return{Icon:u,cls:`bg-panel-2 text-text-2`}}}function Oe(e){let t=e.type===`approval_request`;return{toolName:e.type===`tool_use`?e.tool:t?e.tool??`Tool`:`Tool`,input:e.type===`tool_use`?e.input:t?e.input??{}:{}}}var ke=new Set([`Read`,`ImageGen`]);function X(e){if(e.type!==`tool_use`||!ke.has(e.tool))return null;let t=e.input?.file_path;return typeof t!=`string`||!/^(\/|[A-Za-z]:[/\\])/.test(t)?null:ue(t)?t:null}function Z({tool:e,result:t,completed:n,projectName:r,bashPartialOutput:i}){let[a,o]=(0,R.useState)(()=>{let n=(e.type,e.tool),r=t?.type===`tool_result`&&!!t.isError;return(n===`Edit`||n===`MultiEdit`)&&!r?!0:!!X(e)});if(e.type===`error`)return(0,z.jsxs)(`div`,{className:`flex items-center gap-2 rounded bg-error/10 border border-error/20 px-2 py-1.5 text-xs text-error`,children:[(0,z.jsx)(x,{className:`size-3`}),(0,z.jsx)(`span`,{children:e.message})]});let{toolName:l,input:u}=Oe(e),d=t?.type===`tool_result`,f=d&&!!t.isError,m=l===`AskUserQuestion`&&!!u?.answers,h=e.type===`approval_request`&&e.approved!=null,g=(l===`Agent`||l===`Task`)&&e.type===`tool_use`,_=g?e.children:void 0,y=_&&_.length>0,b=g&&e.type===`tool_use`?e.bgStatus:void 0,S=g&&(b!=null||d&&!f&&me(String(t.output??``)))&&b==null,C=b===`failed`||b===`stopped`,w=S?!1:d||m||h||n,T=[`Edit`,`MultiEdit`,`Write`,`NotebookEdit`].includes(l),E=X(e),D=d&&fe(String(t.output??``)),O=!!E,k=e.type===`tool_use`?e.toolUseId:void 0,A=(l===`Bash`||l===`PowerShell`)&&!d&&k?i?.current?.get(k):void 0,M=!!A;(0,R.useEffect)(()=>{M&&!a&&o(!0)},[M]);let N=(0,R.useRef)(!1);(0,R.useEffect)(()=>{f&&(l===`Edit`||l===`MultiEdit`)&&!N.current&&(N.current=!0,o(!1))},[f,l]);let{Icon:P,cls:F}=De(l,f,!!Y(l,u)),I=l===`AskUserQuestion`||l===`ExitPlanMode`||g;return(0,z.jsxs)(`div`,{"data-tool-ref":k,className:`rounded-[11px] border overflow-hidden text-xs bg-panel ${I?`border-accent-wash-border`:`border-border`}`,children:[(0,z.jsxs)(`button`,{onClick:()=>o(!a),className:`flex items-center gap-2.5 px-2.5 py-2 w-full text-left hover:bg-panel-2/40 transition-colors min-w-0`,children:[(0,z.jsx)(`span`,{className:`inline-flex items-center justify-center size-6 rounded-[7px] shrink-0 ${F}`,children:(0,z.jsx)(P,{className:`size-3.5`})}),(0,z.jsx)(`span`,{className:`truncate text-text font-medium`,children:(0,z.jsx)(Ae,{name:l,input:u})}),(0,z.jsxs)(`span`,{className:`ml-auto flex items-center gap-2 shrink-0`,children:[M&&(0,z.jsxs)(`span`,{className:`text-[10px] text-warning`,children:[A.lineCount,` line`,A.lineCount===1?``:`s`,` streaming…`]}),y&&!M&&(0,z.jsxs)(`span`,{className:`text-[10px] text-text-3 font-mono`,children:[_.length,` steps`]}),S&&(0,z.jsx)(`span`,{className:`text-[10px] text-primary`,children:`running…`}),f||C?(0,z.jsx)(j,{className:`size-3.5 text-error`}):w?(0,z.jsx)(v,{className:`size-3.5 text-success`}):(0,z.jsx)(p,{className:`size-3.5 text-primary animate-spin`}),a?(0,z.jsx)(s,{className:`size-3 text-text-3`}):(0,z.jsx)(c,{className:`size-3 text-text-3`})]})]}),a&&(0,z.jsxs)(`div`,{className:`px-2 pb-2 space-y-1.5 select-text`,children:[(e.type===`tool_use`||e.type===`approval_request`)&&(0,z.jsx)(je,{name:l,input:u,projectName:r,toolUseId:k}),A&&(0,z.jsx)(Le,{content:A.content,lineCount:A.lineCount}),y&&(0,z.jsx)(Ie,{events:_,projectName:r}),E&&(0,z.jsx)(Ee,{filePath:E,projectName:r??``}),d&&!(T&&!f)&&!(D&&!f)&&!(O&&!f)&&(0,z.jsx)(Pe,{toolName:l,output:t.output})]})]})}function Ae({name:e,input:t}){let n=e=>String(e??``);switch(e){case`Read`:case`Write`:case`Edit`:case`MultiEdit`:case`NotebookEdit`:return(0,z.jsxs)(z.Fragment,{children:[e,` `,(0,z.jsx)(`span`,{className:`text-text-subtle`,children:g(n(t.file_path))})]});case`Bash`:case`PowerShell`:{let r=t.description?n(t.description):n(t.command);return(0,z.jsxs)(z.Fragment,{children:[e,` `,(0,z.jsx)(`span`,{className:`text-text-subtle${t.description?``:` font-mono`}`,children:Q(r,60)})]})}case`Glob`:return(0,z.jsxs)(z.Fragment,{children:[e,` `,(0,z.jsx)(`span`,{className:`font-mono text-text-subtle`,children:n(t.pattern)})]});case`Grep`:return(0,z.jsxs)(z.Fragment,{children:[e,` `,(0,z.jsx)(`span`,{className:`font-mono text-text-subtle`,children:Q(n(t.pattern),40)})]});case`WebSearch`:return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(E,{className:`size-3 inline`}),` `,e,` `,(0,z.jsx)(`span`,{className:`text-text-subtle`,children:Q(n(t.query),50)})]});case`WebFetch`:return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(w,{className:`size-3 inline`}),` `,e,` `,(0,z.jsx)(`span`,{className:`text-text-subtle`,children:Q(n(t.url),50)})]});case`ToolSearch`:return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(E,{className:`size-3 inline`}),` `,e,` `,(0,z.jsx)(`span`,{className:`text-text-subtle`,children:Q(n(t.query),50)})]});case`ImageGen`:{let e=(n(t.prompt).split(`
|
|
4
4
|
`).find(e=>e.trim())??``)||g(n(t.file_path));return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(I,{className:`size-3 inline`}),` Image`,(0,z.jsxs)(`span`,{className:`text-text-subtle`,children:[` `,Q(e,50)]})]})}case`Agent`:case`Task`:{let r=Y(e,t),i=Q(n(t.description||t.prompt),r?44:60);return(0,z.jsxs)(z.Fragment,{children:[!r&&(0,z.jsx)(o,{className:`size-3 inline`}),` `,e,` `,r&&(0,z.jsx)(`span`,{className:`text-text-primary font-medium`,children:r}),(0,z.jsx)(`span`,{className:`text-text-subtle`,children:r?` · ${i}`:i})]})}case`SendMessage`:return(0,z.jsx)(oe,{name:e,input:t});case`TodoWrite`:{let n=Array.isArray(t.todos)?t.todos:[],r=n.filter(e=>e.status===`completed`).length;return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(L,{className:`size-3 inline`}),` `,e,` `,(0,z.jsxs)(`span`,{className:`text-text-subtle`,children:[r,`/`,n.length,` done`]})]})}case`AskUserQuestion`:{let n=Array.isArray(t.questions)?t.questions:[],r=!!t.answers;return(0,z.jsxs)(z.Fragment,{children:[e,` `,(0,z.jsxs)(`span`,{className:`text-text-subtle`,children:[n.length,` question`,n.length===1?``:`s`,r?` ✓`:``]})]})}case`ScheduleWakeup`:return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(l,{className:`size-3 inline`}),` `,e,` `,(0,z.jsxs)(`span`,{className:`text-text-subtle`,children:[`in `,$(Number(t.delaySeconds)),t.reason?` — ${Q(n(t.reason),50)}`:``]})]});case`TaskCreate`:return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(L,{className:`size-3 inline`}),` `,e,` `,(0,z.jsx)(`span`,{className:`text-text-subtle`,children:Q(n(t.subject),60)})]});case`TaskUpdate`:return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(L,{className:`size-3 inline`}),` `,e,` `,(0,z.jsxs)(`span`,{className:`text-text-subtle`,children:[`#`,n(t.taskId),` → `,n(t.status)]})]});case`TaskStop`:return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(L,{className:`size-3 inline`}),` `,e,` `,(0,z.jsxs)(`span`,{className:`text-text-subtle`,children:[`#`,n(t.taskId),` stopped`]})]});default:return(0,z.jsx)(z.Fragment,{children:e})}}function je({name:e,input:t,projectName:n,toolUseId:r}){let i=e=>String(e??``),{openTab:a}=_(b(e=>({openTab:e.openTab}))),o=e=>{n&&a({type:`editor`,title:g(e),metadata:{filePath:e,projectName:n},projectId:n,closable:!0})},s=(e,t,r)=>{a({type:`git-diff`,title:`Diff ${g(e)}`,metadata:{filePath:e,projectName:n,original:t,modified:r},projectId:n??null,closable:!0})};switch(e){case`Bash`:case`PowerShell`:return(0,z.jsxs)(`div`,{className:`space-y-1`,children:[!!t.description&&(0,z.jsx)(`p`,{className:`text-text-subtle italic`,children:i(t.description)}),(0,z.jsx)(`pre`,{className:`font-mono text-text-secondary overflow-x-auto whitespace-pre-wrap break-all`,children:i(t.command)})]});case`Read`:case`Write`:case`Edit`:case`MultiEdit`:case`NotebookEdit`:{let n=i(t.notebook_path||t.file_path),a=e===`Edit`&&(!!t.old_string||!!t.new_string),c=e=>r?`${r}-${e}`:void 0;return(0,z.jsxs)(`div`,{className:`space-y-1`,children:[(0,z.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,z.jsxs)(`button`,{type:`button`,className:`font-mono text-text-secondary break-all hover:text-primary hover:underline text-left flex items-center gap-1 min-w-0`,onClick:()=>o(n),title:`Open file in editor`,children:[(0,z.jsx)(y,{className:`size-3 shrink-0`}),n]}),a&&(0,z.jsxs)(`button`,{type:`button`,className:`text-text-subtle hover:text-primary hover:underline flex items-center gap-1 shrink-0 whitespace-nowrap`,onClick:()=>s(n,i(t.old_string),i(t.new_string)),title:`View diff in new tab`,children:[(0,z.jsx)(d,{className:`size-3 shrink-0`}),`View Diff`]})]}),a&&(0,z.jsx)(`div`,{"data-edit-ref":c(0),children:(0,z.jsx)(Be,{oldStr:i(t.old_string),newStr:i(t.new_string),filePath:n})}),e===`MultiEdit`&&Array.isArray(t.edits)&&(0,z.jsx)(`div`,{className:`space-y-1.5`,children:t.edits.map((e,t)=>(0,z.jsxs)(`div`,{"data-edit-ref":c(t),className:`space-y-0.5`,children:[(0,z.jsxs)(`p`,{className:`text-text-subtle text-[10px]`,children:[`Edit `,t+1]}),(0,z.jsx)(Be,{oldStr:i(e.old_string),newStr:i(e.new_string),filePath:n})]},t))}),e===`Write`&&!!t.content&&(0,z.jsx)(`pre`,{"data-edit-ref":c(0),className:`font-mono text-text-subtle overflow-x-auto max-h-32 whitespace-pre-wrap`,children:Q(i(t.content),300)})]})}case`Glob`:return(0,z.jsxs)(`p`,{className:`font-mono text-text-secondary`,children:[i(t.pattern),t.path?` in ${i(t.path)}`:``]});case`Grep`:return(0,z.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,z.jsxs)(`p`,{className:`font-mono text-text-secondary`,children:[`/`,i(t.pattern),`/`]}),!!t.path&&(0,z.jsxs)(`p`,{className:`text-text-subtle`,children:[`in `,i(t.path)]})]});case`TodoWrite`:return(0,z.jsx)(Ne,{todos:t.todos??[]});case`Agent`:case`Task`:{let n=Y(e,t);return(0,z.jsxs)(`div`,{className:`space-y-1`,children:[!!n&&(0,z.jsxs)(`p`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,z.jsx)(`span`,{className:`text-text-subtle`,children:`Name`}),(0,z.jsx)(`span`,{className:`font-medium text-text-primary`,children:n}),(0,z.jsx)(`span`,{className:`inline-block rounded px-1.5 py-0.5 text-[10px] bg-accent-2/15 text-accent-2`,children:`teammate`}),t.isolation===`worktree`&&(0,z.jsx)(`span`,{className:`inline-block rounded px-1.5 py-0.5 text-[10px] bg-panel-2 text-text-3`,children:`worktree`})]}),!!t.description&&(0,z.jsx)(`p`,{className:`text-text-secondary font-medium`,children:i(t.description)}),!!t.subagent_type&&(0,z.jsxs)(`p`,{className:`text-text-subtle`,children:[`Type: `,i(t.subagent_type)]}),!!t.prompt&&(0,z.jsx)(B,{content:i(t.prompt),maxHeight:`max-h-48`})]})}case`SendMessage`:return(0,z.jsx)(se,{input:t});case`ToolSearch`:return(0,z.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,z.jsx)(`p`,{className:`font-mono text-text-secondary`,children:i(t.query)}),!!t.max_results&&(0,z.jsxs)(`p`,{className:`text-text-subtle`,children:[`Max results: `,i(t.max_results)]})]});case`WebFetch`:return(0,z.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,z.jsxs)(`a`,{href:i(t.url),target:`_blank`,rel:`noopener noreferrer`,className:`font-mono text-primary hover:underline break-all flex items-center gap-1`,children:[(0,z.jsx)(w,{className:`size-3 shrink-0`}),i(t.url)]}),!!t.prompt&&(0,z.jsx)(`p`,{className:`text-text-subtle`,children:Q(i(t.prompt),100)})]});case`AskUserQuestion`:{let e=t.questions??[],n=t.answers??{};return(0,z.jsx)(`div`,{className:`space-y-2`,children:e.map((e,t)=>(0,z.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,z.jsxs)(`p`,{className:`text-text-primary font-medium`,children:[e.header?`${e.header}: `:``,e.question]}),(0,z.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:e.options.map((t,r)=>(0,z.jsx)(`span`,{className:`inline-block rounded px-1.5 py-0.5 text-xs border ${(n[e.question]??``).split(`, `).includes(t.label)?`border-primary bg-primary/20 text-text-primary`:`border-border text-text-subtle`}`,children:t.label},r))}),n[e.question]&&(0,z.jsxs)(`p`,{className:`text-foreground text-xs`,children:[`Answer: `,n[e.question]]})]},t))})}case`ScheduleWakeup`:{let e=Number(t.delaySeconds)||0;return(0,z.jsxs)(`div`,{className:`space-y-1`,children:[(0,z.jsxs)(`p`,{className:`text-text-secondary`,children:[(0,z.jsx)(l,{className:`size-3 inline mr-1`}),`Wake in `,(0,z.jsx)(`span`,{className:`font-medium text-text-primary`,children:$(e)}),(0,z.jsxs)(`span`,{className:`text-text-subtle`,children:[` (`,e,`s)`]})]}),!!t.reason&&(0,z.jsx)(`p`,{className:`text-text-secondary italic`,children:i(t.reason)}),!!t.prompt&&(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`p`,{className:`text-text-subtle text-[10px] mb-0.5`,children:`Prompt on wake`}),(0,z.jsx)(B,{content:i(t.prompt),maxHeight:`max-h-48`})]})]})}case`TaskCreate`:return(0,z.jsxs)(`div`,{className:`space-y-1`,children:[(0,z.jsx)(`p`,{className:`text-text-primary font-medium`,children:i(t.subject)}),!!t.description&&(0,z.jsx)(`p`,{className:`text-text-subtle`,children:i(t.description)}),!!t.activeForm&&(0,z.jsx)(`p`,{className:`text-text-subtle italic`,children:i(t.activeForm)})]});case`TaskUpdate`:return(0,z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,z.jsxs)(`span`,{className:`font-mono text-text-secondary`,children:[`#`,i(t.taskId)]}),(0,z.jsx)(Me,{status:i(t.status)})]});case`TaskStop`:return(0,z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,z.jsxs)(`span`,{className:`font-mono text-text-secondary`,children:[`#`,i(t.taskId)]}),(0,z.jsx)(Me,{status:`stopped`})]});case`ImageGen`:return(0,z.jsxs)(`div`,{className:`space-y-1`,children:[!!t.prompt&&(0,z.jsx)(`p`,{className:`text-text-secondary whitespace-pre-wrap`,children:i(t.prompt)}),t.transparentBackground===!0&&(0,z.jsx)(`p`,{className:`text-text-subtle`,children:`Transparent background`})]});default:return(0,z.jsx)(`pre`,{className:`overflow-x-auto text-text-secondary font-mono whitespace-pre-wrap break-all`,children:JSON.stringify(t,null,2)})}}function Me({status:e}){return(0,z.jsx)(`span`,{className:`inline-block rounded px-1.5 py-0.5 text-[10px] border ${e===`completed`?`text-success border-success/30 bg-success/10`:e===`in_progress`?`text-warning border-warning/30 bg-warning/10`:`text-text-subtle border-border bg-surface`}`,children:e})}function Ne({todos:e}){return(0,z.jsx)(`div`,{className:`space-y-0.5`,children:e.map((e,t)=>(0,z.jsxs)(`div`,{className:`flex items-start gap-1.5`,children:[(0,z.jsx)(`span`,{className:`shrink-0 mt-0.5 ${e.status===`completed`?`text-success`:e.status===`in_progress`?`text-warning`:`text-text-subtle`}`,children:e.status===`completed`?`✓`:e.status===`in_progress`?`▶`:`○`}),(0,z.jsx)(`span`,{className:e.status===`completed`?`line-through text-text-subtle`:`text-text-secondary`,children:e.content})]},t))})}function Pe({toolName:e,output:t}){let[n,r]=(0,R.useState)(!1),i=(0,R.useMemo)(()=>{if(e!==`Agent`&&e!==`Task`)return null;try{let e=JSON.parse(t);if(Array.isArray(e)){let t=e.filter(e=>e.type===`text`&&e.text).map(e=>e.text).join(`
|
|
5
5
|
|
|
6
6
|
`);if(t)return t}if(typeof e==`string`)return e}catch{if(t&&!t.startsWith(`[{`))return t}return null},[e,t]);return e===`SendMessage`&&W(t)?(0,z.jsx)(ce,{output:t}):i?(0,z.jsxs)(`div`,{className:`border-t border-border pt-1.5 space-y-1`,children:[(0,z.jsx)(B,{content:i,maxHeight:`max-h-60`}),(0,z.jsxs)(`button`,{type:`button`,onClick:()=>r(!n),className:`flex items-center gap-1 text-[10px] text-text-subtle hover:text-text-secondary transition-colors`,children:[(0,z.jsx)(u,{className:`size-3`}),n?`Hide`:`Show`,` raw`]}),n&&(0,z.jsx)(`pre`,{className:`overflow-x-auto text-text-subtle font-mono max-h-40 whitespace-pre-wrap break-all text-[10px]`,children:t})]}):(0,z.jsx)(Fe,{output:t})}function Fe({output:e}){let t=e.split(`
|
|
7
7
|
`).length,n=t>3||e.length>200,[r,i]=(0,R.useState)(n);return(0,z.jsxs)(`div`,{className:`border-t border-border pt-1.5`,children:[n&&(0,z.jsxs)(`button`,{type:`button`,onClick:()=>i(!r),className:`flex items-center gap-1 text-[10px] text-text-subtle hover:text-text-secondary transition-colors mb-1`,children:[r?(0,z.jsx)(c,{className:`size-3`}):(0,z.jsx)(s,{className:`size-3`}),`Output (`,t,` lines)`]}),(0,z.jsx)(`pre`,{className:`overflow-x-auto text-text-subtle font-mono whitespace-pre-wrap break-all ${r?`max-h-16 overflow-hidden`:`max-h-60`}`,children:e})]})}function Ie({events:e,projectName:t,className:n}){let r=[],i=``;for(let t of e)if(t.type===`text`)i+=t.content;else if(t.type===`tool_use`)i&&=(r.push({kind:`text`,content:i}),``),r.push({kind:`tool`,tool:t});else if(t.type===`tool_result`){let e=t.toolUseId,n=e?r.find(t=>t.kind===`tool`&&t.tool.type===`tool_use`&&t.tool.toolUseId===e&&!t.result):r.findLast(e=>e.kind===`tool`&&!e.result);n&&(n.result=t)}i&&r.push({kind:`text`,content:i});let a=(0,R.useRef)(null),o=(0,R.useRef)(!1);return(0,R.useEffect)(()=>{a.current&&!o.current&&(a.current.scrollTop=a.current.scrollHeight)},[r.length]),(0,z.jsx)(`div`,{ref:a,onScroll:e=>{let t=e.currentTarget;o.current=t.scrollTop+t.clientHeight<t.scrollHeight-20},className:n??`border-l-2 border-accent/20 pl-2 space-y-1 mt-1 max-h-64 md:max-h-96 overflow-y-auto`,children:r.map((e,n)=>e.kind===`text`?(0,z.jsx)(`div`,{className:`text-text-secondary text-[11px]`,children:(0,z.jsx)(B,{content:e.content,maxHeight:`max-h-24`})},`st-${n}`):(0,z.jsx)(Z,{tool:e.tool,result:e.result,completed:!!e.result,projectName:t},`sc-${n}`))})}function Le({content:e,lineCount:t}){let n=(0,R.useRef)(null),r=(0,R.useRef)(!1);return(0,R.useEffect)(()=>{n.current&&!r.current&&(n.current.scrollTop=n.current.scrollHeight)},[e]),(0,z.jsxs)(`div`,{className:`border-t border-border pt-1.5`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-1 text-[10px] text-warning mb-1`,children:[(0,z.jsx)(p,{className:`size-3 animate-spin`}),(0,z.jsxs)(`span`,{children:[`Output (`,t,` line`,t===1?``:`s`,`, streaming...)`]})]}),(0,z.jsx)(`pre`,{ref:n,onScroll:e=>{let t=e.currentTarget;r.current=t.scrollTop+t.clientHeight<t.scrollHeight-20},className:`overflow-x-auto overflow-y-auto max-h-60 text-text-subtle font-mono whitespace-pre-wrap break-all text-[11px]`,children:e.split(`
|
|
8
8
|
`).slice(-200).join(`
|
|
9
|
-
`)})]})}var Re=h(()=>import(`./edit-diff-preview-
|
|
9
|
+
`)})]})}var Re=h(()=>import(`./edit-diff-preview-xdDQvPhs.js`),__vite__mapDeps([48,2,4,49])),ze=(0,R.lazy)(()=>Re);function Be(e){return(0,z.jsx)(R.Suspense,{fallback:(0,z.jsx)(`div`,{className:`animate-pulse h-8 bg-muted rounded`}),children:(0,z.jsx)(ze,{...e})})}function Q(e,t=50){return e?e.length>t?e.slice(0,t)+`…`:e:``}function $(e){if(!Number.isFinite(e)||e<=0)return`0s`;let t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=Math.round(e%60),i=[];return t&&i.push(`${t}h`),n&&i.push(`${n}m`),(r||i.length===0)&&i.push(`${r}s`),i.join(` `)}export{M as a,L as i,Z as n,j as o,ne as r,Ie as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{S as t,x as n}from"./vendor-markdown-Ls5AcU91.js";import{t as r}from"./download-DG3_9xXy.js";import{t as i}from"./eye-gWwaF4Lg.js";import{t as a}from"./key-round-CQpDrDxg.js";import{t as o}from"./x-CxoBA0po.js";import{t as s}from"./button-DX32ffge.js";import{Dn as c,G as l,Ln as u,On as d,Xn as f,kn as p}from"./index-CHQAPZIX.js";import{getAccounts as m,getActiveAccount as h,getAllAccountUsages as g,patchAccount as _}from"./api-settings-D18Q4Ocp.js";function v(e){return e>=90?`text-error`:e>=70?`text-warning`:`text-success`}function y(e){return e>=90?`bg-error`:e>=70?`bg-warning`:`bg-success`}function b(e){if(!e)return null;let t=null;if(e.resetsInMinutes!=null)t=e.resetsInMinutes;else if(e.resetsInHours!=null)t=Math.round(e.resetsInHours*60);else if(e.resetsAt){let n=new Date(e.resetsAt).getTime()-Date.now();t=n>0?Math.ceil(n/6e4):0}if(t==null)return null;if(t<=0)return`now`;let n=Math.floor(t/1440),r=Math.floor(t%1440/60),i=t%60;return n>0?i>0?`${n}d ${r}h ${i}m`:r>0?`${n}d ${r}h`:`${n}d`:r>0?i>0?`${r}h ${i}m`:`${r}h`:`${i}m`}function x(e){if(!e)return null;let t=new Date(e).getTime();return Number.isFinite(t)?new Date(t).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`}):null}function S(e){let t=e-Date.now();if(t<=0)return`expired`;let n=Math.ceil(t/6e4),r=Math.floor(n/60),i=Math.floor(r/24);return i>0?`${i}d ${r%24}h`:r>0?`${r}h ${n%60}m`:`${n}m`}function C(e){if(!e)return{label:`unknown`,tip:`No account info available`,color:`text-text-subtle`};if(!e.expiresAt)return{label:`key`,tip:`API key (no expiry)`,color:`text-text-subtle`};if(e.reauthRequired)return{label:`sign in again`,tip:`Anthropic rejected this account's refresh token. Sign in again to restore it.`,color:`text-error`};let t=e.expiresAt*1e3<Date.now();return t&&e.hasRefreshToken?{label:`expired`,tip:`Token expired but has refresh token — will auto-renew`,color:`text-warning`}:t?{label:`expired`,tip:`Token expired, no refresh token`,color:`text-error`}:e.hasRefreshToken?{label:`long-lived`,tip:`OAuth token with refresh — long-lived`,color:`text-success`}:{label:`temp`,tip:`Temporary token without refresh — will expire`,color:`text-warning`}}function w(e){if(!e)return null;let t=Math.round((Date.now()-e)/1e3);if(t<5)return`just now`;if(t<60)return`${t}s ago`;let n=Math.floor(t/60);if(n<60)return`${n}m ago`;let r=Math.floor(n/60),i=n%60;return r<24?i>0?`${r}h ${i}m ago`:`${r}h ago`:`${Math.floor(r/24)}d ago`}var T=n();function E({label:e,pct:t,reset:n,resetsAt:r}){let i=x(r);return(0,T.jsxs)(`div`,{className:`space-y-1`,"data-testid":`account-usage-bar`,children:[(0,T.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,T.jsx)(`span`,{className:`text-xs font-medium text-text-primary`,children:e}),n&&(0,T.jsxs)(c,{children:[(0,T.jsx)(p,{asChild:!0,children:(0,T.jsxs)(`span`,{className:`text-[10px] text-text-subtle cursor-default`,children:[`↻ `,n]})}),(0,T.jsx)(d,{side:`top`,children:i?`Resets ${i}`:`Resets in`})]})]}),(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(`div`,{className:`flex-1 h-2 rounded-full bg-border overflow-hidden`,children:t!=null&&(0,T.jsx)(`div`,{className:`h-full rounded-full transition-all ${y(t)}`,style:{width:`${Math.min(t,100)}%`}})}),(0,T.jsx)(`span`,{className:`text-xs font-medium tabular-nums w-10 text-right ${t==null?`text-text-subtle`:v(t)}`,children:t==null?`—`:`${t}%`})]})]})}function D({label:e,bucket:t}){return t?(0,T.jsx)(E,{label:e,pct:Math.round(t.utilization*100),reset:b(t),resetsAt:t.resetsAt}):null}function O({hint:e,className:t,children:n}){return(0,T.jsxs)(c,{children:[(0,T.jsx)(p,{asChild:!0,children:(0,T.jsx)(`button`,{type:`button`,className:[`cursor-help text-left`,t].filter(Boolean).join(` `),children:n})}),(0,T.jsx)(d,{side:`top`,className:`max-w-[260px] text-xs leading-relaxed`,children:e})]})}function k({description:e,onRefresh:t,refreshing:n,disabled:r,actions:i}){return(0,T.jsxs)(`section`,{className:`space-y-2`,children:[(0,T.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,T.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e}),(0,T.jsx)(s,{variant:`ghost`,size:`icon`,className:`size-8 shrink-0 cursor-pointer`,onClick:t,disabled:r||n,title:`Refresh`,"aria-label":`Refresh accounts`,children:(0,T.jsx)(f,{className:`size-4 ${n?`animate-spin`:``}`})})]}),(0,T.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:i})]})}function A({message:e,onDismiss:t}){return e?(0,T.jsxs)(`div`,{className:`flex items-start gap-2 text-xs p-2 rounded bg-muted`,role:`status`,children:[(0,T.jsx)(`span`,{className:`flex-1`,children:e}),(0,T.jsx)(`button`,{onClick:t,className:`shrink-0 text-muted-foreground hover:text-foreground cursor-pointer`,"aria-label":`Dismiss message`,children:(0,T.jsx)(o,{className:`size-3.5`})})]}):null}function j({children:e}){return(0,T.jsx)(`div`,{className:`flex gap-2 overflow-x-auto pb-1 -mx-1 px-1 snap-x snap-mandatory scrollbar-thin`,children:e})}function M({active:e,flash:t,dense:n,children:r,...i}){return(0,T.jsx)(`div`,{...i,className:[`rounded-md border transition-colors duration-500`,n?`p-2.5 space-y-1.5`:`p-3 space-y-2`,t?`bg-primary/10 border-primary/40`:``,e?`border-primary/30 bg-primary/5`:`border-border/50`,i.className??``].filter(Boolean).join(` `),children:r})}var N={readOnly:`min-w-[220px]`,withActions:`min-w-[300px]`};function P({entry:e,isActive:t,accountInfo:n,onToggle:o,toggling:s,onDelete:m,onExport:h,onViewProfile:g,flash:_,onSelect:v,unselectableReason:y,selecting:b,layout:x=`list`}){let{usage:E}=e,k=E.session||E.weekly||E.weeklyOpus||E.weeklySonnet,A=n?.status??e.accountStatus,j=!!(n&&!n.hasRefreshToken&&n.expiresAt&&n.expiresAt<Math.floor(Date.now()/1e3)),P=C(n),F=!!n?.reauthRequired,I=n?.grantExpiresAt?n.grantExpiresAt*1e3:null,L=!!I&&I-Date.now()<5*864e5,R=P.label===`temp`||P.label===`unknown`||P.label===`expired`&&!j&&!F,z=I?new Date(I).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`}):null,B=!!(o||m||h||g),V=j?`Token expired — sign in again`:F?`Sign in again to use this account`:y??null,H=x===`list`?``:x===`grid`?`flex flex-col justify-evenly overflow-hidden min-h-0`:`shrink-0 snap-start ${B?N.withActions:N.readOnly}`;return(0,T.jsxs)(M,{active:t,flash:_,dense:x!==`list`,className:[H,j||F?`opacity-50`:``].filter(Boolean).join(` `)||void 0,"data-testid":`account-card`,"data-account-id":e.accountId,children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(`span`,{className:`text-sm font-medium truncate flex-1 min-w-0`,children:e.accountLabel??e.accountId.slice(0,8)}),t&&(0,T.jsx)(O,{className:`text-[10px] text-primary shrink-0 font-medium`,hint:`The next turn will run on this account.`,children:`Active`}),v&&!t&&(0,T.jsxs)(c,{children:[(0,T.jsx)(p,{asChild:!0,children:(0,T.jsx)(`button`,{type:`button`,onClick:()=>v(e.accountId),disabled:b,className:[`shrink-0 rounded px-1.5 py-0.5 text-[10px] font-medium transition-colors cursor-pointer disabled:cursor-wait`,V?`text-text-subtle hover:text-error hover:bg-error/10`:`text-text-secondary hover:text-foreground hover:bg-surface-elevated`].join(` `),children:b?`Switching…`:`Use`})}),(0,T.jsx)(d,{side:`top`,children:V??`Use this account for this chat`})]}),j&&(0,T.jsx)(O,{className:`text-[10px] text-error shrink-0 font-medium`,hint:`This token has expired and carries no refresh token, so nothing can renew it. Add the account again.`,children:`Expired`}),F&&!j&&(0,T.jsx)(O,{className:`text-[10px] text-error shrink-0 font-medium`,hint:`Anthropic rejected this account's refresh token, so no turn can run on it. Signing in again is the only thing that restores it.`,children:`Sign in again`}),!e.isOAuth&&!j&&(0,T.jsx)(O,{className:`text-[10px] text-text-subtle shrink-0`,hint:`A static API key rather than a sign-in: nothing to expire and nothing to renew.`,children:`API key`}),(0,T.jsxs)(`div`,{className:`flex items-center gap-0.5 shrink-0`,children:[!j&&g&&n?.profileData&&(0,T.jsxs)(c,{children:[(0,T.jsx)(p,{asChild:!0,children:(0,T.jsx)(`button`,{className:`p-2 rounded cursor-pointer text-text-subtle hover:text-foreground hover:bg-surface-elevated transition-colors`,onClick:()=>g(n.profileData,e.accountId),"aria-label":`View profile`,children:(0,T.jsx)(i,{className:`size-4`})})}),(0,T.jsx)(d,{side:`top`,children:`View profile`})]}),!j&&h&&e.isOAuth&&(0,T.jsxs)(c,{children:[(0,T.jsx)(p,{asChild:!0,children:(0,T.jsx)(`button`,{className:`p-2 rounded cursor-pointer text-text-subtle hover:text-primary hover:bg-surface-elevated transition-colors`,onClick:()=>h(e.accountId),"aria-label":`Export this account`,children:(0,T.jsx)(r,{className:`size-4`})})}),(0,T.jsx)(d,{side:`top`,children:`Export this account`})]}),!j&&o&&(0,T.jsx)(l,{checked:A!==`disabled`,onCheckedChange:()=>o(e.accountId,A),disabled:s||A===`cooldown`,"aria-label":A===`disabled`?`Enable account`:`Disable account`,className:`cursor-pointer`}),m&&(0,T.jsxs)(c,{children:[(0,T.jsx)(p,{asChild:!0,children:(0,T.jsx)(`button`,{className:`p-2 rounded cursor-pointer text-text-subtle hover:text-error hover:bg-surface-elevated transition-colors`,onClick:()=>m(e.accountId,e.accountLabel??e.accountId.slice(0,8)),"aria-label":`Remove account`,children:(0,T.jsx)(u,{className:`size-4`})})}),(0,T.jsx)(d,{side:`top`,children:`Remove account`})]})]})]}),k?(0,T.jsxs)(`div`,{className:`space-y-2`,children:[(0,T.jsx)(D,{label:`5-Hour Session`,bucket:E.session}),(0,T.jsx)(D,{label:`Weekly`,bucket:E.weekly}),(0,T.jsx)(D,{label:`Weekly (Opus)`,bucket:E.weeklyOpus}),(0,T.jsx)(D,{label:`Weekly (Sonnet)`,bucket:E.weeklySonnet})]}):(0,T.jsx)(`p`,{className:`text-xs text-text-subtle`,children:e.isOAuth?`No usage data yet`:`Usage tracking not available for API keys`}),(0,T.jsxs)(`div`,{className:`flex items-center gap-2 text-[10px] text-text-subtle flex-wrap`,children:[E.lastFetchedAt&&(0,T.jsxs)(O,{className:`inline-flex items-center gap-1`,hint:`Usage last read from Anthropic on ${new Date(E.lastFetchedAt).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`})}. The bars above are only as current as this.`,children:[(0,T.jsx)(f,{className:`size-3 shrink-0`,"aria-hidden":!0}),w(new Date(E.lastFetchedAt).getTime())]}),I&&!F&&(0,T.jsxs)(O,{className:[`inline-flex items-center gap-1`,L?`text-warning`:``].filter(Boolean).join(` `),hint:`Sign-in stops working on ${z}. Anthropic ends every sign-in on a fixed schedule from the day it was made, whether or not the account gets used — refreshing does not extend it. After that the account fails until you sign in again.`,children:[(0,T.jsx)(a,{className:`size-3 shrink-0`,"aria-hidden":!0}),`sign-in `,S(I)]}),R&&(0,T.jsxs)(O,{className:P.color,hint:P.tip,children:[`© `,P.label]})]})]})}var F=e(t(),1);function I(e){let t=e.usage;return[t.session?.utilization,t.weekly?.utilization,t.weeklyOpus?.utilization,t.weeklySonnet?.utilization].join(`|`)}function L(e=!0){let[t,n]=(0,F.useState)([]),[r,i]=(0,F.useState)([]),[a,o]=(0,F.useState)(null),[s,c]=(0,F.useState)(!0),[l,u]=(0,F.useState)(!1),[d,f]=(0,F.useState)(new Set),[p,v]=(0,F.useState)(null),y=(0,F.useRef)([]),b=(0,F.useRef)(void 0),x=(0,F.useCallback)(async()=>{let e=y.current.length>0;e?u(!0):c(!0);let[t,r,a]=await Promise.allSettled([g(),m(),h()]);if(t.status===`fulfilled`){let r=t.value;if(e){let e=new Map(y.current.map(e=>[e.accountId,I(e)])),t=new Set(r.filter(t=>e.get(t.accountId)!==I(t)).map(e=>e.accountId));t.size>0&&(f(t),clearTimeout(b.current),b.current=setTimeout(()=>f(new Set),1500))}y.current=r,n(r)}r.status===`fulfilled`&&i(r.value),a.status===`fulfilled`&&o(a.value?.id??null),c(!1),u(!1)},[]),S=(0,F.useCallback)(async(e,t)=>{v(e);let n=null;try{await _(e,{status:t===`disabled`?`active`:`disabled`})}catch(e){n=e.message}return v(null),await x(),n},[x]);return(0,F.useEffect)(()=>(e&&x(),()=>clearTimeout(b.current)),[e,x]),{usages:t,accounts:r,activeAccountId:a,initialLoading:s,refreshing:l,flashIds:d,reload:x,toggle:S,togglingId:p}}export{k as a,E as c,M as i,w as l,P as n,A as o,j as r,D as s,L as t,b as u};
|
|
1
|
+
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{S as t,x as n}from"./vendor-markdown-Ls5AcU91.js";import{t as r}from"./download-DG3_9xXy.js";import{t as i}from"./eye-gWwaF4Lg.js";import{t as a}from"./key-round-CQpDrDxg.js";import{t as o}from"./x-CxoBA0po.js";import{t as s}from"./button-DX32ffge.js";import{Dn as c,G as l,Ln as u,On as d,Xn as f,kn as p}from"./index-CJWbFurD.js";import{getAccounts as m,getActiveAccount as h,getAllAccountUsages as g,patchAccount as _}from"./api-settings-D18Q4Ocp.js";function v(e){return e>=90?`text-error`:e>=70?`text-warning`:`text-success`}function y(e){return e>=90?`bg-error`:e>=70?`bg-warning`:`bg-success`}function b(e){if(!e)return null;let t=null;if(e.resetsInMinutes!=null)t=e.resetsInMinutes;else if(e.resetsInHours!=null)t=Math.round(e.resetsInHours*60);else if(e.resetsAt){let n=new Date(e.resetsAt).getTime()-Date.now();t=n>0?Math.ceil(n/6e4):0}if(t==null)return null;if(t<=0)return`now`;let n=Math.floor(t/1440),r=Math.floor(t%1440/60),i=t%60;return n>0?i>0?`${n}d ${r}h ${i}m`:r>0?`${n}d ${r}h`:`${n}d`:r>0?i>0?`${r}h ${i}m`:`${r}h`:`${i}m`}function x(e){if(!e)return null;let t=new Date(e).getTime();return Number.isFinite(t)?new Date(t).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`}):null}function S(e){let t=e-Date.now();if(t<=0)return`expired`;let n=Math.ceil(t/6e4),r=Math.floor(n/60),i=Math.floor(r/24);return i>0?`${i}d ${r%24}h`:r>0?`${r}h ${n%60}m`:`${n}m`}function C(e){if(!e)return{label:`unknown`,tip:`No account info available`,color:`text-text-subtle`};if(!e.expiresAt)return{label:`key`,tip:`API key (no expiry)`,color:`text-text-subtle`};if(e.reauthRequired)return{label:`sign in again`,tip:`Anthropic rejected this account's refresh token. Sign in again to restore it.`,color:`text-error`};let t=e.expiresAt*1e3<Date.now();return t&&e.hasRefreshToken?{label:`expired`,tip:`Token expired but has refresh token — will auto-renew`,color:`text-warning`}:t?{label:`expired`,tip:`Token expired, no refresh token`,color:`text-error`}:e.hasRefreshToken?{label:`long-lived`,tip:`OAuth token with refresh — long-lived`,color:`text-success`}:{label:`temp`,tip:`Temporary token without refresh — will expire`,color:`text-warning`}}function w(e){if(!e)return null;let t=Math.round((Date.now()-e)/1e3);if(t<5)return`just now`;if(t<60)return`${t}s ago`;let n=Math.floor(t/60);if(n<60)return`${n}m ago`;let r=Math.floor(n/60),i=n%60;return r<24?i>0?`${r}h ${i}m ago`:`${r}h ago`:`${Math.floor(r/24)}d ago`}var T=n();function E({label:e,pct:t,reset:n,resetsAt:r}){let i=x(r);return(0,T.jsxs)(`div`,{className:`space-y-1`,"data-testid":`account-usage-bar`,children:[(0,T.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,T.jsx)(`span`,{className:`text-xs font-medium text-text-primary`,children:e}),n&&(0,T.jsxs)(c,{children:[(0,T.jsx)(p,{asChild:!0,children:(0,T.jsxs)(`span`,{className:`text-[10px] text-text-subtle cursor-default`,children:[`↻ `,n]})}),(0,T.jsx)(d,{side:`top`,children:i?`Resets ${i}`:`Resets in`})]})]}),(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(`div`,{className:`flex-1 h-2 rounded-full bg-border overflow-hidden`,children:t!=null&&(0,T.jsx)(`div`,{className:`h-full rounded-full transition-all ${y(t)}`,style:{width:`${Math.min(t,100)}%`}})}),(0,T.jsx)(`span`,{className:`text-xs font-medium tabular-nums w-10 text-right ${t==null?`text-text-subtle`:v(t)}`,children:t==null?`—`:`${t}%`})]})]})}function D({label:e,bucket:t}){return t?(0,T.jsx)(E,{label:e,pct:Math.round(t.utilization*100),reset:b(t),resetsAt:t.resetsAt}):null}function O({hint:e,className:t,children:n}){return(0,T.jsxs)(c,{children:[(0,T.jsx)(p,{asChild:!0,children:(0,T.jsx)(`button`,{type:`button`,className:[`cursor-help text-left`,t].filter(Boolean).join(` `),children:n})}),(0,T.jsx)(d,{side:`top`,className:`max-w-[260px] text-xs leading-relaxed`,children:e})]})}function k({description:e,onRefresh:t,refreshing:n,disabled:r,actions:i}){return(0,T.jsxs)(`section`,{className:`space-y-2`,children:[(0,T.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,T.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e}),(0,T.jsx)(s,{variant:`ghost`,size:`icon`,className:`size-8 shrink-0 cursor-pointer`,onClick:t,disabled:r||n,title:`Refresh`,"aria-label":`Refresh accounts`,children:(0,T.jsx)(f,{className:`size-4 ${n?`animate-spin`:``}`})})]}),(0,T.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:i})]})}function A({message:e,onDismiss:t}){return e?(0,T.jsxs)(`div`,{className:`flex items-start gap-2 text-xs p-2 rounded bg-muted`,role:`status`,children:[(0,T.jsx)(`span`,{className:`flex-1`,children:e}),(0,T.jsx)(`button`,{onClick:t,className:`shrink-0 text-muted-foreground hover:text-foreground cursor-pointer`,"aria-label":`Dismiss message`,children:(0,T.jsx)(o,{className:`size-3.5`})})]}):null}function j({children:e}){return(0,T.jsx)(`div`,{className:`flex gap-2 overflow-x-auto pb-1 -mx-1 px-1 snap-x snap-mandatory scrollbar-thin`,children:e})}function M({active:e,flash:t,dense:n,children:r,...i}){return(0,T.jsx)(`div`,{...i,className:[`rounded-md border transition-colors duration-500`,n?`p-2.5 space-y-1.5`:`p-3 space-y-2`,t?`bg-primary/10 border-primary/40`:``,e?`border-primary/30 bg-primary/5`:`border-border/50`,i.className??``].filter(Boolean).join(` `),children:r})}var N={readOnly:`min-w-[220px]`,withActions:`min-w-[300px]`};function P({entry:e,isActive:t,accountInfo:n,onToggle:o,toggling:s,onDelete:m,onExport:h,onViewProfile:g,flash:_,onSelect:v,unselectableReason:y,selecting:b,layout:x=`list`}){let{usage:E}=e,k=E.session||E.weekly||E.weeklyOpus||E.weeklySonnet,A=n?.status??e.accountStatus,j=!!(n&&!n.hasRefreshToken&&n.expiresAt&&n.expiresAt<Math.floor(Date.now()/1e3)),P=C(n),F=!!n?.reauthRequired,I=n?.grantExpiresAt?n.grantExpiresAt*1e3:null,L=!!I&&I-Date.now()<5*864e5,R=P.label===`temp`||P.label===`unknown`||P.label===`expired`&&!j&&!F,z=I?new Date(I).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`}):null,B=!!(o||m||h||g),V=j?`Token expired — sign in again`:F?`Sign in again to use this account`:y??null,H=x===`list`?``:x===`grid`?`flex flex-col justify-evenly overflow-hidden min-h-0`:`shrink-0 snap-start ${B?N.withActions:N.readOnly}`;return(0,T.jsxs)(M,{active:t,flash:_,dense:x!==`list`,className:[H,j||F?`opacity-50`:``].filter(Boolean).join(` `)||void 0,"data-testid":`account-card`,"data-account-id":e.accountId,children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(`span`,{className:`text-sm font-medium truncate flex-1 min-w-0`,children:e.accountLabel??e.accountId.slice(0,8)}),t&&(0,T.jsx)(O,{className:`text-[10px] text-primary shrink-0 font-medium`,hint:`The next turn will run on this account.`,children:`Active`}),v&&!t&&(0,T.jsxs)(c,{children:[(0,T.jsx)(p,{asChild:!0,children:(0,T.jsx)(`button`,{type:`button`,onClick:()=>v(e.accountId),disabled:b,className:[`shrink-0 rounded px-1.5 py-0.5 text-[10px] font-medium transition-colors cursor-pointer disabled:cursor-wait`,V?`text-text-subtle hover:text-error hover:bg-error/10`:`text-text-secondary hover:text-foreground hover:bg-surface-elevated`].join(` `),children:b?`Switching…`:`Use`})}),(0,T.jsx)(d,{side:`top`,children:V??`Use this account for this chat`})]}),j&&(0,T.jsx)(O,{className:`text-[10px] text-error shrink-0 font-medium`,hint:`This token has expired and carries no refresh token, so nothing can renew it. Add the account again.`,children:`Expired`}),F&&!j&&(0,T.jsx)(O,{className:`text-[10px] text-error shrink-0 font-medium`,hint:`Anthropic rejected this account's refresh token, so no turn can run on it. Signing in again is the only thing that restores it.`,children:`Sign in again`}),!e.isOAuth&&!j&&(0,T.jsx)(O,{className:`text-[10px] text-text-subtle shrink-0`,hint:`A static API key rather than a sign-in: nothing to expire and nothing to renew.`,children:`API key`}),(0,T.jsxs)(`div`,{className:`flex items-center gap-0.5 shrink-0`,children:[!j&&g&&n?.profileData&&(0,T.jsxs)(c,{children:[(0,T.jsx)(p,{asChild:!0,children:(0,T.jsx)(`button`,{className:`p-2 rounded cursor-pointer text-text-subtle hover:text-foreground hover:bg-surface-elevated transition-colors`,onClick:()=>g(n.profileData,e.accountId),"aria-label":`View profile`,children:(0,T.jsx)(i,{className:`size-4`})})}),(0,T.jsx)(d,{side:`top`,children:`View profile`})]}),!j&&h&&e.isOAuth&&(0,T.jsxs)(c,{children:[(0,T.jsx)(p,{asChild:!0,children:(0,T.jsx)(`button`,{className:`p-2 rounded cursor-pointer text-text-subtle hover:text-primary hover:bg-surface-elevated transition-colors`,onClick:()=>h(e.accountId),"aria-label":`Export this account`,children:(0,T.jsx)(r,{className:`size-4`})})}),(0,T.jsx)(d,{side:`top`,children:`Export this account`})]}),!j&&o&&(0,T.jsx)(l,{checked:A!==`disabled`,onCheckedChange:()=>o(e.accountId,A),disabled:s||A===`cooldown`,"aria-label":A===`disabled`?`Enable account`:`Disable account`,className:`cursor-pointer`}),m&&(0,T.jsxs)(c,{children:[(0,T.jsx)(p,{asChild:!0,children:(0,T.jsx)(`button`,{className:`p-2 rounded cursor-pointer text-text-subtle hover:text-error hover:bg-surface-elevated transition-colors`,onClick:()=>m(e.accountId,e.accountLabel??e.accountId.slice(0,8)),"aria-label":`Remove account`,children:(0,T.jsx)(u,{className:`size-4`})})}),(0,T.jsx)(d,{side:`top`,children:`Remove account`})]})]})]}),k?(0,T.jsxs)(`div`,{className:`space-y-2`,children:[(0,T.jsx)(D,{label:`5-Hour Session`,bucket:E.session}),(0,T.jsx)(D,{label:`Weekly`,bucket:E.weekly}),(0,T.jsx)(D,{label:`Weekly (Opus)`,bucket:E.weeklyOpus}),(0,T.jsx)(D,{label:`Weekly (Sonnet)`,bucket:E.weeklySonnet})]}):(0,T.jsx)(`p`,{className:`text-xs text-text-subtle`,children:e.isOAuth?`No usage data yet`:`Usage tracking not available for API keys`}),(0,T.jsxs)(`div`,{className:`flex items-center gap-2 text-[10px] text-text-subtle flex-wrap`,children:[E.lastFetchedAt&&(0,T.jsxs)(O,{className:`inline-flex items-center gap-1`,hint:`Usage last read from Anthropic on ${new Date(E.lastFetchedAt).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`})}. The bars above are only as current as this.`,children:[(0,T.jsx)(f,{className:`size-3 shrink-0`,"aria-hidden":!0}),w(new Date(E.lastFetchedAt).getTime())]}),I&&!F&&(0,T.jsxs)(O,{className:[`inline-flex items-center gap-1`,L?`text-warning`:``].filter(Boolean).join(` `),hint:`Sign-in stops working on ${z}. Anthropic ends every sign-in on a fixed schedule from the day it was made, whether or not the account gets used — refreshing does not extend it. After that the account fails until you sign in again.`,children:[(0,T.jsx)(a,{className:`size-3 shrink-0`,"aria-hidden":!0}),`sign-in `,S(I)]}),R&&(0,T.jsxs)(O,{className:P.color,hint:P.tip,children:[`© `,P.label]})]})]})}var F=e(t(),1);function I(e){let t=e.usage;return[t.session?.utilization,t.weekly?.utilization,t.weeklyOpus?.utilization,t.weeklySonnet?.utilization].join(`|`)}function L(e=!0){let[t,n]=(0,F.useState)([]),[r,i]=(0,F.useState)([]),[a,o]=(0,F.useState)(null),[s,c]=(0,F.useState)(!0),[l,u]=(0,F.useState)(!1),[d,f]=(0,F.useState)(new Set),[p,v]=(0,F.useState)(null),y=(0,F.useRef)([]),b=(0,F.useRef)(void 0),x=(0,F.useCallback)(async()=>{let e=y.current.length>0;e?u(!0):c(!0);let[t,r,a]=await Promise.allSettled([g(),m(),h()]);if(t.status===`fulfilled`){let r=t.value;if(e){let e=new Map(y.current.map(e=>[e.accountId,I(e)])),t=new Set(r.filter(t=>e.get(t.accountId)!==I(t)).map(e=>e.accountId));t.size>0&&(f(t),clearTimeout(b.current),b.current=setTimeout(()=>f(new Set),1500))}y.current=r,n(r)}r.status===`fulfilled`&&i(r.value),a.status===`fulfilled`&&o(a.value?.id??null),c(!1),u(!1)},[]),S=(0,F.useCallback)(async(e,t)=>{v(e);let n=null;try{await _(e,{status:t===`disabled`?`active`:`disabled`})}catch(e){n=e.message}return v(null),await x(),n},[x]);return(0,F.useEffect)(()=>(e&&x(),()=>clearTimeout(b.current)),[e,x]),{usages:t,accounts:r,activeAccountId:a,initialLoading:s,refreshing:l,flashIds:d,reload:x,toggle:S,togglingId:p}}export{k as a,E as c,M as i,w as l,P as n,A as o,j as r,D as s,L as t,b as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{S as t}from"./vendor-markdown-Ls5AcU91.js";import{t as n}from"./settings-store-CzLnTR8p.js";import{r,t as i}from"./apply-theme-BVXAUYoN.js";import{t as a}from"./resolve-theme-CMp5xxCW.js";import{o}from"./index-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{S as t}from"./vendor-markdown-Ls5AcU91.js";import{t as n}from"./settings-store-CzLnTR8p.js";import{r,t as i}from"./apply-theme-BVXAUYoN.js";import{t as a}from"./resolve-theme-CMp5xxCW.js";import{o}from"./index-CJWbFurD.js";var s=e(t(),1);function c(){let e=n(e=>e.themeStyle),t=n(e=>e.themeMode),c=n(e=>e.customThemeId),l=n(e=>e.customThemes),u=()=>o(r()??a(e,t,l,c)),[d,f]=(0,s.useState)(u);return(0,s.useEffect)(()=>{f(u());let e=()=>f(u());return window.addEventListener(i,e),()=>window.removeEventListener(i,e)},[e,t,c,l]),d}export{c as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{S as t,x as n}from"./vendor-markdown-Ls5AcU91.js";import{t as r}from"./createLucideIcon-D8pyde1A.js";import{n as i}from"./api-client-CEYCBt_0.js";import{t as a}from"./settings-store-CzLnTR8p.js";import{t as o}from"./ws-auth-D111jj32.js";import{y as s}from"./index-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{S as t,x as n}from"./vendor-markdown-Ls5AcU91.js";import{t as r}from"./createLucideIcon-D8pyde1A.js";import{n as i}from"./api-client-CEYCBt_0.js";import{t as a}from"./settings-store-CzLnTR8p.js";import{t as o}from"./ws-auth-D111jj32.js";import{y as s}from"./index-CJWbFurD.js";var c=r(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),l=r(`monitor-x`,[[`path`,{d:`m14.5 12.5-5-5`,key:`1jahn5`}],[`path`,{d:`m9.5 12.5 5-5`,key:`1k2t7b`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`path`,{d:`M12 17v4`,key:`1riwvh`}],[`path`,{d:`M8 21h8`,key:`1ev6f3`}]]);function u(e,t,n=`8081`){let r=o(`/ws/remote-desktop`),i=e.protocol===`https:`?`wss:`:`ws:`;return t&&e.protocol!==`https:`?`ws://${e.hostname}:${n}${r}`:`${i}//${e.host}${r}`}var d=30;function f(e,t=d){return Math.round(e*1e6/t)}var p=e(t(),1);function m(e,t){return t||e}function h(e){let[t,n]=(0,p.useState)(`idle`),[r,i]=(0,p.useState)(null),a=(0,p.useRef)(null),o=(0,p.useRef)(null),s=(0,p.useRef)(!1),c=(0,p.useRef)(0),l=(0,p.useRef)(0),u=(0,p.useRef)(null),d=(0,p.useRef)(!1),h=(0,p.useCallback)(e=>{n(`error`),i(e)},[]),g=(0,p.useCallback)(async t=>{if(u.current=t,typeof VideoDecoder>`u`){n(`unsupported`),i(`This browser has no WebCodecs VideoDecoder — try Chrome, Edge, or Safari 16.4+.`);return}let r={codec:t,optimizeForLatency:!0};try{if(!(await VideoDecoder.isConfigSupported(r)).supported){n(`unsupported`),i(`This browser's decoder does not support ${t}.`);return}}catch(e){h(e.message);return}a.current?.close(),s.current=!1,l.current=0;let f=new VideoDecoder({output:t=>{c.current+=1;let n=e.current;n&&((n.width!==t.displayWidth||n.height!==t.displayHeight)&&(n.width=t.displayWidth,n.height=t.displayHeight),o.current||=n.getContext(`2d`),o.current?.drawImage(t,0,0,n.width,n.height)),t.close()},error:e=>_(e.message)});try{f.configure(r)}catch(e){h(e.message);return}a.current=f,d.current=!0,n(`ready`),i(null)},[e,h]),_=(0,p.useCallback)(e=>{if(!d.current)return;let t=u.current;if(!t){h(e);return}try{a.current?.close()}catch{}a.current=null,g(t)},[g,h]);return{status:t,errorMessage:r,configure:g,decodeAccessUnit:(0,p.useCallback)((e,t)=>{let n=a.current;if(!(!n||n.state!==`configured`)&&m(s.current,t)){t&&(s.current=!0);try{n.decode(new EncodedVideoChunk({type:t?`key`:`delta`,timestamp:f(l.current++),data:e}))}catch(e){_(e.message)}}},[_]),reset:(0,p.useCallback)(()=>{d.current=!1;try{a.current?.close()}catch{}a.current=null,s.current=!1,c.current=0,l.current=0,n(`idle`),i(null)},[]),getFrameCount:(0,p.useCallback)(()=>c.current,[])}}var g=5e3;function _(e,{displayId:t}={}){let n=(0,p.useRef)(null),r=(0,p.useRef)(0),[a,o]=(0,p.useState)(`connecting`),[s,c]=(0,p.useState)(null),[l,d]=(0,p.useState)(0),f=h(e),m=(0,p.useCallback)(e=>{let t=n.current;t?.readyState===WebSocket.OPEN&&t.send(JSON.stringify(e))},[]);(0,p.useEffect)(()=>{let e=!1,a=null;o(`connecting`),c(null),r.current=0,f.reset(),(async()=>{let s;try{s=(await i.post(`/api/remote-desktop/session`)).nonce}catch(t){e||(o(`error`),c(t.message));return}if(e)return;let l=u(window.location,!1,void 0),d=new WebSocket(l);d.binaryType=`arraybuffer`,n.current=d,d.onopen=()=>{d.send(JSON.stringify({type:`auth`,nonce:s,...t?{displayId:t}:{}})),a=setInterval(()=>m({type:`ping`}),g)},d.onmessage=t=>{if(typeof t.data==`string`){let n;try{n=JSON.parse(t.data)}catch{return}n.type===`config`&&typeof n.codec==`string`?f.configure(n.codec).then(()=>{e||o(`streaming`)}):n.type===`error`&&(o(`error`),c(typeof n.message==`string`?n.message:`Server error`));return}let n=new Uint8Array(t.data);n.length<1||(r.current+=n.length,f.decodeAccessUnit(n.subarray(1),n[0]===1))},d.onerror=()=>{e||(o(`error`),c(`WebSocket error`))},d.onclose=()=>{e||o(e=>e===`error`?e:`closed`)}})();let s=()=>{if(document.hidden||e)return;let t=n.current;t&&t.readyState===WebSocket.OPEN?t.send(JSON.stringify({type:`ping`})):d(e=>e+1)};return document.addEventListener(`visibilitychange`,s),()=>{e=!0,document.removeEventListener(`visibilitychange`,s),a&&clearInterval(a);try{n.current?.close()}catch{}n.current=null;try{f.reset()}catch{}}},[l,t]);let _=(0,p.useCallback)(()=>d(e=>e+1),[]),v=(0,p.useCallback)(()=>r.current,[]);return{connState:a,errorMessage:s,decoderStatus:f.status,decoderErrorMessage:f.errorMessage,sendMessage:m,reconnect:_,getTotalBytes:v,getFrameCount:f.getFrameCount}}function v(e){return Math.min(Math.max(e,0),1)}function y(e,t,n){let r=n.width>0?(e-n.left)/n.width:0,i=n.height>0?(t-n.top)/n.height:0;return{xFrac:v(r),yFrac:v(i)}}function b(e,t,n,r){let i=r.scale||1,a=n.left+n.width/2,o=n.top+n.height/2;return y(a+(e-a-r.panX)/i,o+(t-o-r.panY)/i,n)}function x(e,t,n){if(t<=0||n<=0||e.width<=0||e.height<=0)return e;let r=e.width/e.height,i=t/n;if(i>r){let t=e.width/i;return{left:e.left,top:e.top+(e.height-t)/2,width:e.width,height:t}}let a=e.height*i;return{left:e.left+(e.width-a)/2,top:e.top,width:a,height:e.height}}var S={fps:0,kbps:0};function C(e,t){let n=t.atMs-e.atMs;if(n<=0)return S;let r=n/1e3,i=Math.max(0,t.frameCount-e.frameCount),a=Math.max(0,t.totalBytes-e.totalBytes);return{fps:i/r,kbps:a/1024/r}}var w=n(),T=500;function E({canvasRef:e,getFrameCount:t,getTotalBytes:n,positionClassName:r=`left-1 top-1`}){let i=a(e=>e.remoteDesktopStatsVisible),[o,s]=(0,p.useState)({fps:0,kbps:0,width:0,height:0}),c=(0,p.useRef)({frameCount:0,totalBytes:0,atMs:0});return(0,p.useEffect)(()=>{if(!i)return;c.current={frameCount:t(),totalBytes:n(),atMs:performance.now()};let r=setInterval(()=>{let r={frameCount:t(),totalBytes:n(),atMs:performance.now()},{fps:i,kbps:a}=C(c.current,r);c.current=r;let o=e.current;s({fps:i,kbps:a,width:o?.width??0,height:o?.height??0})},T);return()=>clearInterval(r)},[i,e,t,n]),i?(0,w.jsxs)(`div`,{className:`pointer-events-none absolute z-40 rounded bg-black/60 px-1.5 py-0.5 font-mono text-[10px] text-white/80 ${r}`,"data-testid":`remote-desktop-stats-overlay`,children:[Math.round(o.fps),` fps · `,Math.round(o.kbps),` KB/s · `,o.width,`×`,o.height]}):null}function D(){let{caps:e}=s(!1),t=e?.displays??[],[n,r]=(0,p.useState)(void 0),i=t.find(e=>e.id===n)??t.find(e=>e.primary)??t[0];return{displays:t,displayId:n,current:i,select:r,next:(0,p.useCallback)(()=>{t.length<2||r(t[(t.findIndex(e=>e.id===i?.id)+1)%t.length]?.id)},[t,i])}}export{x as a,c,b as i,E as n,_ as o,y as r,l as s,D as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{S as t}from"./vendor-markdown-Ls5AcU91.js";import{i as n}from"./index-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{S as t}from"./vendor-markdown-Ls5AcU91.js";import{i as n}from"./index-CJWbFurD.js";var r=e(t(),1);function i({url:e,onMessage:t,autoConnect:i=!0}){let a=(0,r.useRef)(null);return(0,r.useEffect)(()=>{let r=new n(e);return a.current=r,t&&r.onMessage(t),i&&r.connect(),()=>{r.disconnect(),a.current=null}},[e,i]),{send:(0,r.useCallback)(e=>{a.current?.send(e)},[]),connect:(0,r.useCallback)(()=>{a.current?.connect()},[]),disconnect:(0,r.useCallback)(()=>{a.current?.disconnect()},[])}}export{i as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{S as t,x as n}from"./vendor-markdown-Ls5AcU91.js";import"./vendor-ui-CaeeFO0B.js";import{t as r}from"./createLucideIcon-D8pyde1A.js";import{t as i}from"./download-DG3_9xXy.js";import{t as a}from"./file-exclamation-point-JzhTU2TX.js";import{t as o}from"./loader-circle-DPMrnLQ2.js";import"./api-client-CEYCBt_0.js";import"./portal-container-context-DKymYOY-.js";import{t as s}from"./button-DX32ffge.js";import{$n as c,Bt as l,Fn as u,Gn as d,Ht as f,Jn as p,Lt as m,Rt as h,Ut as g,Vt as _,Yn as v,qt as y,zt as b}from"./index-CHQAPZIX.js";import{a as ee,i as x,n as S,r as C,t as w}from"./media-url-BMeBaB0q.js";import{o as T}from"./can-open-in-ppm-_yqa69dV.js";var E=r(`flip-horizontal-2`,[[`path`,{d:`m3 7 5 5-5 5V7`,key:`couhi7`}],[`path`,{d:`m21 7-5 5 5 5V7`,key:`6ouia7`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 14v2`,key:`8jcxud`}],[`path`,{d:`M12 8v2`,key:`1woqiv`}],[`path`,{d:`M12 2v2`,key:`tus03m`}]]),D=r(`flip-vertical-2`,[[`path`,{d:`m17 3-5 5-5-5h10`,key:`1ftt6x`}],[`path`,{d:`m17 21-5-5-5 5h10`,key:`1m0wmu`}],[`path`,{d:`M4 12H2`,key:`rhcxmi`}],[`path`,{d:`M10 12H8`,key:`s88cx1`}],[`path`,{d:`M16 12h-2`,key:`10asgb`}],[`path`,{d:`M22 12h-2`,key:`14jgyd`}]]),O=r(`maximize`,[[`path`,{d:`M8 3H5a2 2 0 0 0-2 2v3`,key:`1dcmit`}],[`path`,{d:`M21 8V5a2 2 0 0 0-2-2h-3`,key:`1e4gt3`}],[`path`,{d:`M3 16v3a2 2 0 0 0 2 2h3`,key:`wsl5sc`}],[`path`,{d:`M16 21h3a2 2 0 0 0 2-2v-3`,key:`18trek`}]]),k=r(`minimize`,[[`path`,{d:`M8 3v3a2 2 0 0 1-2 2H3`,key:`hohbtr`}],[`path`,{d:`M21 8h-3a2 2 0 0 1-2-2V3`,key:`5jw1f3`}],[`path`,{d:`M3 16h3a2 2 0 0 1 2 2v3`,key:`198tvr`}],[`path`,{d:`M16 21v-3a2 2 0 0 1 2-2h3`,key:`ph8mxp`}]]),A=r(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),j=r(`volume-2`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]),M=r(`volume-1`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}]]),N=r(`volume-x`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`line`,{x1:`22`,x2:`16`,y1:`9`,y2:`15`,key:`1ewh16`}],[`line`,{x1:`16`,x2:`22`,y1:`9`,y2:`15`,key:`5ykzw1`}]]),P=e(t(),1),F={rotation:0,flipH:!1,flipV:!1};function I(e){return{...e,rotation:(e.rotation+90)%360}}function L(e){return{...e,rotation:(e.rotation+270)%360}}function R(e){return e.rotation===0&&!e.flipH&&!e.flipV}function z(e){let t=[];return e.rotation&&t.push(`rotate(${e.rotation}deg)`),e.flipH&&t.push(`scaleX(-1)`),e.flipV&&t.push(`scaleY(-1)`),t.length?t.join(` `):`none`}function te(e,t){return e.rotation===90||e.rotation===270?{maxWidth:t.height,maxHeight:t.width}:{maxWidth:t.width,maxHeight:t.height}}var B=[[`Space / K`,`Play / pause`],[`← / →`,`Seek 5s`],[`J / L or Shift+← / →`,`Seek 10s`],[`↑ / ↓`,`Volume`],[`M`,`Mute`],[`F`,`Fullscreen`],[`< / >`,`Speed`],[`R / Shift+R`,`Rotate`]];function ne(e){return(0,P.useCallback)(t=>{let n=t.target;if(n.tagName===`INPUT`||n.tagName===`TEXTAREA`||n.isContentEditable||t.ctrlKey||t.metaKey||t.altKey)return;let r=!0;switch(t.key){case` `:case`k`:case`K`:e.togglePlay();break;case`ArrowLeft`:e.seekBy(t.shiftKey?-10:-5);break;case`ArrowRight`:e.seekBy(t.shiftKey?10:5);break;case`j`:case`J`:e.seekBy(-10);break;case`l`:case`L`:e.seekBy(10);break;case`ArrowUp`:e.volumeBy(.1);break;case`ArrowDown`:e.volumeBy(-.1);break;case`m`:case`M`:e.toggleMute();break;case`f`:case`F`:e.toggleFullscreen();break;case`<`:case`,`:e.speedStep(-1);break;case`>`:case`.`:e.speedStep(1);break;case`r`:e.rotate(1);break;case`R`:e.rotate(-1);break;default:r=!1}r&&t.preventDefault()},[e])}var V=n(),H=[.25,.5,.75,1,1.25,1.5,2,3];function U({speed:e,onSpeed:t,transform:n,onRotate:r,onFlipH:i,onFlipV:a,onResetTransform:o}){return(0,V.jsxs)(m,{children:[(0,V.jsx)(y,{asChild:!0,children:(0,V.jsxs)(s,{variant:`ghost`,size:`icon`,className:`size-11 shrink-0 relative`,"aria-label":`Playback settings`,children:[(0,V.jsx)(d,{className:`size-5`}),e!==1&&(0,V.jsxs)(`span`,{className:`absolute -top-0.5 -right-0.5 text-[10px] leading-none px-1 rounded bg-primary text-primary-foreground tabular-nums`,children:[e,`x`]})]})}),(0,V.jsxs)(h,{align:`end`,className:`w-60 max-h-[70vh] overflow-y-auto`,children:[(0,V.jsx)(l,{children:`Speed`}),(0,V.jsx)(_,{value:String(e),onValueChange:e=>t(Number(e)),children:(0,V.jsx)(`div`,{className:`grid grid-cols-4 gap-1 px-1 pb-1`,children:H.map(e=>(0,V.jsxs)(f,{value:String(e),className:`justify-center pl-2 min-h-11 text-xs tabular-nums data-[state=checked]:bg-accent [&>span:first-child]:hidden`,children:[e,`x`]},e))})}),(0,V.jsx)(g,{}),(0,V.jsx)(l,{children:`Orientation`}),(0,V.jsxs)(b,{className:`min-h-11`,onSelect:e=>{e.preventDefault(),r(1)},children:[(0,V.jsx)(p,{className:`size-4`}),` Rotate right `,(0,V.jsx)(`span`,{className:`ml-auto text-xs text-text-subtle`,children:`R`})]}),(0,V.jsxs)(b,{className:`min-h-11`,onSelect:e=>{e.preventDefault(),r(-1)},children:[(0,V.jsx)(v,{className:`size-4`}),` Rotate left `,(0,V.jsx)(`span`,{className:`ml-auto text-xs text-text-subtle`,children:`⇧R`})]}),(0,V.jsxs)(b,{className:`min-h-11`,onSelect:e=>{e.preventDefault(),i()},children:[(0,V.jsx)(E,{className:`size-4`}),` Flip horizontal `,n.flipH&&(0,V.jsx)(`span`,{className:`ml-auto text-xs`,children:`✓`})]}),(0,V.jsxs)(b,{className:`min-h-11`,onSelect:e=>{e.preventDefault(),a()},children:[(0,V.jsx)(D,{className:`size-4`}),` Flip vertical `,n.flipV&&(0,V.jsx)(`span`,{className:`ml-auto text-xs`,children:`✓`})]}),!R(n)&&(0,V.jsxs)(b,{className:`min-h-11`,onSelect:o,children:[(0,V.jsx)(u,{className:`size-4`}),` Reset orientation`]}),(0,V.jsx)(g,{}),(0,V.jsx)(l,{children:`Keyboard`}),(0,V.jsx)(`div`,{className:`px-2 pb-2 grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-xs text-text-secondary`,children:B.map(([e,t])=>(0,V.jsxs)(`div`,{className:`contents`,children:[(0,V.jsx)(`kbd`,{className:`font-mono text-text-subtle whitespace-nowrap`,children:e}),(0,V.jsx)(`span`,{children:t})]},e))})]})]})}function re(e){let t=e.muted||e.volume===0?N:e.volume<.5?M:j,n=t=>e.onSeek(Number(t.target.value));return(0,V.jsxs)(`div`,{className:`flex items-center gap-1 px-2 py-1 bg-surface border-t border-border`,children:[(0,V.jsx)(s,{variant:`ghost`,size:`icon`,className:`size-11 shrink-0`,onClick:e.onTogglePlay,"aria-label":e.playing?`Pause`:`Play`,children:e.playing?(0,V.jsx)(A,{className:`size-5`}):(0,V.jsx)(c,{className:`size-5`})}),(0,V.jsxs)(`span`,{className:`text-xs tabular-nums text-text-secondary shrink-0 min-w-[4.5rem] text-center`,children:[W(e.position),e.duration?` / ${W(e.duration)}`:``]}),e.duration?(0,V.jsx)(`input`,{type:`range`,min:0,max:e.duration,step:.1,value:Math.min(e.position,e.duration),"aria-label":`Seek`,className:`flex-1 h-11 accent-primary cursor-pointer min-w-0`,onChange:t=>e.onScrub(Number(t.target.value)),onPointerUp:n,onKeyUp:n,onTouchEnd:n}):(0,V.jsx)(`div`,{className:`flex-1`}),(0,V.jsxs)(`div`,{className:`flex items-center shrink-0`,children:[(0,V.jsx)(s,{variant:`ghost`,size:`icon`,className:`size-11`,onClick:e.onToggleMute,"aria-label":e.muted?`Unmute`:`Mute`,children:(0,V.jsx)(t,{className:`size-5`})}),(0,V.jsx)(`input`,{type:`range`,min:0,max:1,step:.05,value:e.muted?0:e.volume,"aria-label":`Volume`,className:`hidden sm:block w-20 h-11 accent-primary cursor-pointer`,onChange:t=>e.onVolume(Number(t.target.value))})]}),(0,V.jsx)(U,{speed:e.speed,onSpeed:e.onSpeed,transform:e.transform,onRotate:e.onRotate,onFlipH:e.onFlipH,onFlipV:e.onFlipV,onResetTransform:e.onResetTransform}),(0,V.jsx)(s,{variant:`ghost`,size:`icon`,className:`size-11 shrink-0`,onClick:e.onToggleFullscreen,"aria-label":e.fullscreen?`Exit fullscreen`:`Fullscreen`,children:e.fullscreen?(0,V.jsx)(k,{className:`size-5`}):(0,V.jsx)(O,{className:`size-5`})})]})}function W(e){let t=Math.max(0,Math.floor(Number.isFinite(e)?e:0)),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60,a=n?String(r).padStart(2,`0`):String(r);return`${n?`${n}:`:``}${a}:${String(i).padStart(2,`0`)}`}function G({filePath:e,projectName:t,mode:n,probeDuration:r=null,onNativeError:i}){let a=(0,P.useRef)(null),c=(0,P.useRef)(null),l=(0,P.useRef)(null),u=(0,P.useRef)(!0),[d]=(0,P.useState)(w),[f,p]=(0,P.useState)(0),[m,h]=(0,P.useState)(0),[g,_]=(0,P.useState)(null),[v,y]=(0,P.useState)(!1),[b,S]=(0,P.useState)(!0),[T,E]=(0,P.useState)(null),[D,O]=(0,P.useState)(1),[k,A]=(0,P.useState)(!1),[j,M]=(0,P.useState)(1),[N,R]=(0,P.useState)(F),[B,U]=(0,P.useState)(!1),[W,G]=(0,P.useState)({width:0,height:0}),[K,q]=(0,P.useState)(null),J=n===`transcode`,Y=J?ee(e,t,f,d):C(e,t),X=J?r:g,ie=T??(J?f+m:m);(0,P.useEffect)(()=>{h(0),S(!0),q(null)},[Y]),(0,P.useEffect)(()=>{p(0),_(null),R(F)},[e,n]),(0,P.useEffect)(()=>{let e=l.current;e&&(e.volume=D,e.muted=k)},[D,k]),(0,P.useEffect)(()=>{let e=l.current;e&&(e.playbackRate=j)},[j,Y]),(0,P.useEffect)(()=>{let n=l.current,r=()=>{J&&x(e,t,d)};return window.addEventListener(`pagehide`,r),()=>{window.removeEventListener(`pagehide`,r),n&&!n.isConnected&&(n.pause(),n.removeAttribute(`src`),n.load(),r())}},[e,t,J,d]),(0,P.useEffect)(()=>{let e=()=>U(document.fullscreenElement===a.current);return document.addEventListener(`fullscreenchange`,e),()=>document.removeEventListener(`fullscreenchange`,e)},[]),(0,P.useEffect)(()=>{let e=c.current;if(!e)return;let t=new ResizeObserver(()=>G({width:e.clientWidth,height:e.clientHeight}));return t.observe(e),()=>t.disconnect()},[]);let Z=(0,P.useCallback)(e=>{let t=l.current,n=Math.max(0,X?Math.min(e,X-.5):e);if(E(null),!J){t&&(t.currentTime=n);return}Math.abs(n-(f+(t?.currentTime??0)))<.5||p(n)},[X,J,f]),Q=(0,P.useMemo)(()=>({togglePlay:()=>{let e=l.current;e&&(u.current=e.paused,e.paused?e.play().catch(()=>{}):e.pause())},seekBy:e=>Z((J?f:0)+(l.current?.currentTime??0)+e),toggleFullscreen:()=>{document.fullscreenElement?document.exitFullscreen():a.current?.requestFullscreen?.()},toggleMute:()=>A(e=>!e),volumeBy:e=>{A(!1),O(t=>Math.min(1,Math.max(0,Math.round((t+e)*100)/100)))},speedStep:e=>M(t=>{let n=H.indexOf(t);return H[Math.min(H.length-1,Math.max(0,(n===-1?3:n)+e))]??1}),rotate:e=>R(t=>e===1?I(t):L(t))}),[Z,J,f]),ae=ne(Q),$=te(N,W),oe=()=>{q(null),p(e=>e+.001)};return(0,V.jsxs)(`div`,{ref:a,"data-testid":`video-player`,tabIndex:0,onKeyDown:ae,className:`flex flex-col h-full bg-black outline-none focus-visible:ring-1 focus-visible:ring-primary/60`,children:[(0,V.jsxs)(`div`,{ref:c,className:`relative flex-1 min-h-0 flex items-center justify-center overflow-hidden`,onClick:e=>{a.current?.focus(),e.detail===1&&Q.togglePlay()},onDoubleClick:Q.toggleFullscreen,children:[(0,V.jsx)(`video`,{ref:l,src:Y,autoPlay:!0,playsInline:!0,preload:J?`auto`:`metadata`,style:{transform:z(N),maxWidth:$.maxWidth||void 0,maxHeight:$.maxHeight||void 0},onLoadedMetadata:e=>{let t=e.currentTarget;t.playbackRate=j,t.volume=D,t.muted=k,!J&&Number.isFinite(t.duration)&&_(t.duration),J&&!u.current&&t.pause()},onPlay:()=>y(!0),onPause:()=>y(!1),onWaiting:()=>S(!0),onPlaying:()=>S(!1),onCanPlay:()=>S(!1),onTimeUpdate:e=>h(e.currentTarget.currentTime),onEnded:()=>{y(!1),u.current=!1},onError:()=>{J?q(`Transcoding failed. ffmpeg may have stopped or the file is corrupt.`):i?.()}}),b&&!K&&(0,V.jsx)(o,{className:`absolute size-8 animate-spin text-white/80 pointer-events-none`}),K&&(0,V.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center gap-3 bg-black/85 text-text-secondary p-4 text-center`,onClick:e=>e.stopPropagation(),onDoubleClick:e=>e.stopPropagation(),children:[(0,V.jsx)(`p`,{className:`text-sm`,children:K}),(0,V.jsx)(s,{variant:`outline`,size:`sm`,className:`h-11 px-4`,onClick:oe,children:`Retry`})]})]}),(0,V.jsx)(re,{playing:v,position:ie,duration:X,volume:D,muted:k,speed:j,transform:N,fullscreen:B,onTogglePlay:Q.togglePlay,onScrub:E,onSeek:Z,onVolume:e=>{O(e),A(e===0)},onToggleMute:Q.toggleMute,onSpeed:M,onRotate:Q.rotate,onFlipH:()=>R(e=>({...e,flipH:!e.flipH})),onFlipV:()=>R(e=>({...e,flipV:!e.flipV})),onResetTransform:()=>R(F),onToggleFullscreen:Q.toggleFullscreen})]})}var K=new Set([`mp4`,`m4v`,`webm`,`ogg`,`ogv`,`mov`]);function q({filePath:e,projectName:t}){let n=T(e),[r,i]=(0,P.useState)(()=>K.has(n)?{kind:`native`}:{kind:`probing`});return(0,P.useEffect)(()=>{i(K.has(T(e))?{kind:`native`}:{kind:`probing`})},[e]),(0,P.useEffect)(()=>{if(r.kind!==`probing`)return;let n=!1;return S(e,t).then(e=>{n||i(e.transcodable?{kind:`transcode`,probe:e}:{kind:`unsupported`,probe:e})}).catch(()=>{n||i({kind:`unsupported`,probe:null})}),()=>{n=!0}},[r.kind,e,t]),r.kind===`probing`?(0,V.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,V.jsx)(o,{className:`size-5 animate-spin text-text-subtle`})}):r.kind===`transcode`?(0,V.jsx)(G,{filePath:e,projectName:t,mode:`transcode`,probeDuration:r.probe.duration}):r.kind===`unsupported`?(0,V.jsx)(J,{filePath:e,projectName:t,probe:r.probe}):(0,V.jsx)(G,{filePath:e,projectName:t,mode:`native`,onNativeError:()=>i({kind:`probing`})})}function J({filePath:e,projectName:t,probe:n}){let r=[n?.video?.codec,n?.audio?.codec].filter(Boolean).join(` + `);return(0,V.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-3 text-text-secondary p-6 text-center`,children:[(0,V.jsx)(a,{className:`size-10 text-text-subtle`}),(0,V.jsxs)(`p`,{className:`text-sm`,children:[`This video cannot be played in the browser`,r?` (${r})`:``,`.`]}),(0,V.jsxs)(`p`,{className:`text-xs text-text-subtle max-w-sm`,children:[`Install `,(0,V.jsx)(`code`,{children:`ffmpeg`}),` on the PPM server (e.g. `,(0,V.jsx)(`code`,{children:`winget install ffmpeg`}),`, `,(0,V.jsx)(`code`,{children:`brew install ffmpeg`}),`,`,` `,(0,V.jsx)(`code`,{children:`apt install ffmpeg`}),`) and restart PPM to transcode it on the fly.`]}),(0,V.jsx)(s,{asChild:!0,variant:`outline`,size:`sm`,className:`h-11 px-4`,children:(0,V.jsxs)(`a`,{href:`${C(e,t)}&download=true`,download:!0,children:[(0,V.jsx)(i,{className:`size-4 mr-2`}),` Download file`]})})]})}export{q as VideoPreview};
|
|
1
|
+
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{S as t,x as n}from"./vendor-markdown-Ls5AcU91.js";import"./vendor-ui-CaeeFO0B.js";import{t as r}from"./createLucideIcon-D8pyde1A.js";import{t as i}from"./download-DG3_9xXy.js";import{t as a}from"./file-exclamation-point-JzhTU2TX.js";import{t as o}from"./loader-circle-DPMrnLQ2.js";import"./api-client-CEYCBt_0.js";import"./portal-container-context-DKymYOY-.js";import{t as s}from"./button-DX32ffge.js";import{$n as c,Bt as l,Fn as u,Gn as d,Ht as f,Jn as p,Lt as m,Rt as h,Ut as g,Vt as _,Yn as v,qt as y,zt as b}from"./index-CJWbFurD.js";import{a as ee,i as x,n as S,r as C,t as w}from"./media-url-BMeBaB0q.js";import{o as T}from"./can-open-in-ppm-_yqa69dV.js";var E=r(`flip-horizontal-2`,[[`path`,{d:`m3 7 5 5-5 5V7`,key:`couhi7`}],[`path`,{d:`m21 7-5 5 5 5V7`,key:`6ouia7`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 14v2`,key:`8jcxud`}],[`path`,{d:`M12 8v2`,key:`1woqiv`}],[`path`,{d:`M12 2v2`,key:`tus03m`}]]),D=r(`flip-vertical-2`,[[`path`,{d:`m17 3-5 5-5-5h10`,key:`1ftt6x`}],[`path`,{d:`m17 21-5-5-5 5h10`,key:`1m0wmu`}],[`path`,{d:`M4 12H2`,key:`rhcxmi`}],[`path`,{d:`M10 12H8`,key:`s88cx1`}],[`path`,{d:`M16 12h-2`,key:`10asgb`}],[`path`,{d:`M22 12h-2`,key:`14jgyd`}]]),O=r(`maximize`,[[`path`,{d:`M8 3H5a2 2 0 0 0-2 2v3`,key:`1dcmit`}],[`path`,{d:`M21 8V5a2 2 0 0 0-2-2h-3`,key:`1e4gt3`}],[`path`,{d:`M3 16v3a2 2 0 0 0 2 2h3`,key:`wsl5sc`}],[`path`,{d:`M16 21h3a2 2 0 0 0 2-2v-3`,key:`18trek`}]]),k=r(`minimize`,[[`path`,{d:`M8 3v3a2 2 0 0 1-2 2H3`,key:`hohbtr`}],[`path`,{d:`M21 8h-3a2 2 0 0 1-2-2V3`,key:`5jw1f3`}],[`path`,{d:`M3 16h3a2 2 0 0 1 2 2v3`,key:`198tvr`}],[`path`,{d:`M16 21v-3a2 2 0 0 1 2-2h3`,key:`ph8mxp`}]]),A=r(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),j=r(`volume-2`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]),M=r(`volume-1`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}]]),N=r(`volume-x`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`line`,{x1:`22`,x2:`16`,y1:`9`,y2:`15`,key:`1ewh16`}],[`line`,{x1:`16`,x2:`22`,y1:`9`,y2:`15`,key:`5ykzw1`}]]),P=e(t(),1),F={rotation:0,flipH:!1,flipV:!1};function I(e){return{...e,rotation:(e.rotation+90)%360}}function L(e){return{...e,rotation:(e.rotation+270)%360}}function R(e){return e.rotation===0&&!e.flipH&&!e.flipV}function z(e){let t=[];return e.rotation&&t.push(`rotate(${e.rotation}deg)`),e.flipH&&t.push(`scaleX(-1)`),e.flipV&&t.push(`scaleY(-1)`),t.length?t.join(` `):`none`}function te(e,t){return e.rotation===90||e.rotation===270?{maxWidth:t.height,maxHeight:t.width}:{maxWidth:t.width,maxHeight:t.height}}var B=[[`Space / K`,`Play / pause`],[`← / →`,`Seek 5s`],[`J / L or Shift+← / →`,`Seek 10s`],[`↑ / ↓`,`Volume`],[`M`,`Mute`],[`F`,`Fullscreen`],[`< / >`,`Speed`],[`R / Shift+R`,`Rotate`]];function ne(e){return(0,P.useCallback)(t=>{let n=t.target;if(n.tagName===`INPUT`||n.tagName===`TEXTAREA`||n.isContentEditable||t.ctrlKey||t.metaKey||t.altKey)return;let r=!0;switch(t.key){case` `:case`k`:case`K`:e.togglePlay();break;case`ArrowLeft`:e.seekBy(t.shiftKey?-10:-5);break;case`ArrowRight`:e.seekBy(t.shiftKey?10:5);break;case`j`:case`J`:e.seekBy(-10);break;case`l`:case`L`:e.seekBy(10);break;case`ArrowUp`:e.volumeBy(.1);break;case`ArrowDown`:e.volumeBy(-.1);break;case`m`:case`M`:e.toggleMute();break;case`f`:case`F`:e.toggleFullscreen();break;case`<`:case`,`:e.speedStep(-1);break;case`>`:case`.`:e.speedStep(1);break;case`r`:e.rotate(1);break;case`R`:e.rotate(-1);break;default:r=!1}r&&t.preventDefault()},[e])}var V=n(),H=[.25,.5,.75,1,1.25,1.5,2,3];function U({speed:e,onSpeed:t,transform:n,onRotate:r,onFlipH:i,onFlipV:a,onResetTransform:o}){return(0,V.jsxs)(m,{children:[(0,V.jsx)(y,{asChild:!0,children:(0,V.jsxs)(s,{variant:`ghost`,size:`icon`,className:`size-11 shrink-0 relative`,"aria-label":`Playback settings`,children:[(0,V.jsx)(d,{className:`size-5`}),e!==1&&(0,V.jsxs)(`span`,{className:`absolute -top-0.5 -right-0.5 text-[10px] leading-none px-1 rounded bg-primary text-primary-foreground tabular-nums`,children:[e,`x`]})]})}),(0,V.jsxs)(h,{align:`end`,className:`w-60 max-h-[70vh] overflow-y-auto`,children:[(0,V.jsx)(l,{children:`Speed`}),(0,V.jsx)(_,{value:String(e),onValueChange:e=>t(Number(e)),children:(0,V.jsx)(`div`,{className:`grid grid-cols-4 gap-1 px-1 pb-1`,children:H.map(e=>(0,V.jsxs)(f,{value:String(e),className:`justify-center pl-2 min-h-11 text-xs tabular-nums data-[state=checked]:bg-accent [&>span:first-child]:hidden`,children:[e,`x`]},e))})}),(0,V.jsx)(g,{}),(0,V.jsx)(l,{children:`Orientation`}),(0,V.jsxs)(b,{className:`min-h-11`,onSelect:e=>{e.preventDefault(),r(1)},children:[(0,V.jsx)(p,{className:`size-4`}),` Rotate right `,(0,V.jsx)(`span`,{className:`ml-auto text-xs text-text-subtle`,children:`R`})]}),(0,V.jsxs)(b,{className:`min-h-11`,onSelect:e=>{e.preventDefault(),r(-1)},children:[(0,V.jsx)(v,{className:`size-4`}),` Rotate left `,(0,V.jsx)(`span`,{className:`ml-auto text-xs text-text-subtle`,children:`⇧R`})]}),(0,V.jsxs)(b,{className:`min-h-11`,onSelect:e=>{e.preventDefault(),i()},children:[(0,V.jsx)(E,{className:`size-4`}),` Flip horizontal `,n.flipH&&(0,V.jsx)(`span`,{className:`ml-auto text-xs`,children:`✓`})]}),(0,V.jsxs)(b,{className:`min-h-11`,onSelect:e=>{e.preventDefault(),a()},children:[(0,V.jsx)(D,{className:`size-4`}),` Flip vertical `,n.flipV&&(0,V.jsx)(`span`,{className:`ml-auto text-xs`,children:`✓`})]}),!R(n)&&(0,V.jsxs)(b,{className:`min-h-11`,onSelect:o,children:[(0,V.jsx)(u,{className:`size-4`}),` Reset orientation`]}),(0,V.jsx)(g,{}),(0,V.jsx)(l,{children:`Keyboard`}),(0,V.jsx)(`div`,{className:`px-2 pb-2 grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-xs text-text-secondary`,children:B.map(([e,t])=>(0,V.jsxs)(`div`,{className:`contents`,children:[(0,V.jsx)(`kbd`,{className:`font-mono text-text-subtle whitespace-nowrap`,children:e}),(0,V.jsx)(`span`,{children:t})]},e))})]})]})}function re(e){let t=e.muted||e.volume===0?N:e.volume<.5?M:j,n=t=>e.onSeek(Number(t.target.value));return(0,V.jsxs)(`div`,{className:`flex items-center gap-1 px-2 py-1 bg-surface border-t border-border`,children:[(0,V.jsx)(s,{variant:`ghost`,size:`icon`,className:`size-11 shrink-0`,onClick:e.onTogglePlay,"aria-label":e.playing?`Pause`:`Play`,children:e.playing?(0,V.jsx)(A,{className:`size-5`}):(0,V.jsx)(c,{className:`size-5`})}),(0,V.jsxs)(`span`,{className:`text-xs tabular-nums text-text-secondary shrink-0 min-w-[4.5rem] text-center`,children:[W(e.position),e.duration?` / ${W(e.duration)}`:``]}),e.duration?(0,V.jsx)(`input`,{type:`range`,min:0,max:e.duration,step:.1,value:Math.min(e.position,e.duration),"aria-label":`Seek`,className:`flex-1 h-11 accent-primary cursor-pointer min-w-0`,onChange:t=>e.onScrub(Number(t.target.value)),onPointerUp:n,onKeyUp:n,onTouchEnd:n}):(0,V.jsx)(`div`,{className:`flex-1`}),(0,V.jsxs)(`div`,{className:`flex items-center shrink-0`,children:[(0,V.jsx)(s,{variant:`ghost`,size:`icon`,className:`size-11`,onClick:e.onToggleMute,"aria-label":e.muted?`Unmute`:`Mute`,children:(0,V.jsx)(t,{className:`size-5`})}),(0,V.jsx)(`input`,{type:`range`,min:0,max:1,step:.05,value:e.muted?0:e.volume,"aria-label":`Volume`,className:`hidden sm:block w-20 h-11 accent-primary cursor-pointer`,onChange:t=>e.onVolume(Number(t.target.value))})]}),(0,V.jsx)(U,{speed:e.speed,onSpeed:e.onSpeed,transform:e.transform,onRotate:e.onRotate,onFlipH:e.onFlipH,onFlipV:e.onFlipV,onResetTransform:e.onResetTransform}),(0,V.jsx)(s,{variant:`ghost`,size:`icon`,className:`size-11 shrink-0`,onClick:e.onToggleFullscreen,"aria-label":e.fullscreen?`Exit fullscreen`:`Fullscreen`,children:e.fullscreen?(0,V.jsx)(k,{className:`size-5`}):(0,V.jsx)(O,{className:`size-5`})})]})}function W(e){let t=Math.max(0,Math.floor(Number.isFinite(e)?e:0)),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60,a=n?String(r).padStart(2,`0`):String(r);return`${n?`${n}:`:``}${a}:${String(i).padStart(2,`0`)}`}function G({filePath:e,projectName:t,mode:n,probeDuration:r=null,onNativeError:i}){let a=(0,P.useRef)(null),c=(0,P.useRef)(null),l=(0,P.useRef)(null),u=(0,P.useRef)(!0),[d]=(0,P.useState)(w),[f,p]=(0,P.useState)(0),[m,h]=(0,P.useState)(0),[g,_]=(0,P.useState)(null),[v,y]=(0,P.useState)(!1),[b,S]=(0,P.useState)(!0),[T,E]=(0,P.useState)(null),[D,O]=(0,P.useState)(1),[k,A]=(0,P.useState)(!1),[j,M]=(0,P.useState)(1),[N,R]=(0,P.useState)(F),[B,U]=(0,P.useState)(!1),[W,G]=(0,P.useState)({width:0,height:0}),[K,q]=(0,P.useState)(null),J=n===`transcode`,Y=J?ee(e,t,f,d):C(e,t),X=J?r:g,ie=T??(J?f+m:m);(0,P.useEffect)(()=>{h(0),S(!0),q(null)},[Y]),(0,P.useEffect)(()=>{p(0),_(null),R(F)},[e,n]),(0,P.useEffect)(()=>{let e=l.current;e&&(e.volume=D,e.muted=k)},[D,k]),(0,P.useEffect)(()=>{let e=l.current;e&&(e.playbackRate=j)},[j,Y]),(0,P.useEffect)(()=>{let n=l.current,r=()=>{J&&x(e,t,d)};return window.addEventListener(`pagehide`,r),()=>{window.removeEventListener(`pagehide`,r),n&&!n.isConnected&&(n.pause(),n.removeAttribute(`src`),n.load(),r())}},[e,t,J,d]),(0,P.useEffect)(()=>{let e=()=>U(document.fullscreenElement===a.current);return document.addEventListener(`fullscreenchange`,e),()=>document.removeEventListener(`fullscreenchange`,e)},[]),(0,P.useEffect)(()=>{let e=c.current;if(!e)return;let t=new ResizeObserver(()=>G({width:e.clientWidth,height:e.clientHeight}));return t.observe(e),()=>t.disconnect()},[]);let Z=(0,P.useCallback)(e=>{let t=l.current,n=Math.max(0,X?Math.min(e,X-.5):e);if(E(null),!J){t&&(t.currentTime=n);return}Math.abs(n-(f+(t?.currentTime??0)))<.5||p(n)},[X,J,f]),Q=(0,P.useMemo)(()=>({togglePlay:()=>{let e=l.current;e&&(u.current=e.paused,e.paused?e.play().catch(()=>{}):e.pause())},seekBy:e=>Z((J?f:0)+(l.current?.currentTime??0)+e),toggleFullscreen:()=>{document.fullscreenElement?document.exitFullscreen():a.current?.requestFullscreen?.()},toggleMute:()=>A(e=>!e),volumeBy:e=>{A(!1),O(t=>Math.min(1,Math.max(0,Math.round((t+e)*100)/100)))},speedStep:e=>M(t=>{let n=H.indexOf(t);return H[Math.min(H.length-1,Math.max(0,(n===-1?3:n)+e))]??1}),rotate:e=>R(t=>e===1?I(t):L(t))}),[Z,J,f]),ae=ne(Q),$=te(N,W),oe=()=>{q(null),p(e=>e+.001)};return(0,V.jsxs)(`div`,{ref:a,"data-testid":`video-player`,tabIndex:0,onKeyDown:ae,className:`flex flex-col h-full bg-black outline-none focus-visible:ring-1 focus-visible:ring-primary/60`,children:[(0,V.jsxs)(`div`,{ref:c,className:`relative flex-1 min-h-0 flex items-center justify-center overflow-hidden`,onClick:e=>{a.current?.focus(),e.detail===1&&Q.togglePlay()},onDoubleClick:Q.toggleFullscreen,children:[(0,V.jsx)(`video`,{ref:l,src:Y,autoPlay:!0,playsInline:!0,preload:J?`auto`:`metadata`,style:{transform:z(N),maxWidth:$.maxWidth||void 0,maxHeight:$.maxHeight||void 0},onLoadedMetadata:e=>{let t=e.currentTarget;t.playbackRate=j,t.volume=D,t.muted=k,!J&&Number.isFinite(t.duration)&&_(t.duration),J&&!u.current&&t.pause()},onPlay:()=>y(!0),onPause:()=>y(!1),onWaiting:()=>S(!0),onPlaying:()=>S(!1),onCanPlay:()=>S(!1),onTimeUpdate:e=>h(e.currentTarget.currentTime),onEnded:()=>{y(!1),u.current=!1},onError:()=>{J?q(`Transcoding failed. ffmpeg may have stopped or the file is corrupt.`):i?.()}}),b&&!K&&(0,V.jsx)(o,{className:`absolute size-8 animate-spin text-white/80 pointer-events-none`}),K&&(0,V.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center gap-3 bg-black/85 text-text-secondary p-4 text-center`,onClick:e=>e.stopPropagation(),onDoubleClick:e=>e.stopPropagation(),children:[(0,V.jsx)(`p`,{className:`text-sm`,children:K}),(0,V.jsx)(s,{variant:`outline`,size:`sm`,className:`h-11 px-4`,onClick:oe,children:`Retry`})]})]}),(0,V.jsx)(re,{playing:v,position:ie,duration:X,volume:D,muted:k,speed:j,transform:N,fullscreen:B,onTogglePlay:Q.togglePlay,onScrub:E,onSeek:Z,onVolume:e=>{O(e),A(e===0)},onToggleMute:Q.toggleMute,onSpeed:M,onRotate:Q.rotate,onFlipH:()=>R(e=>({...e,flipH:!e.flipH})),onFlipV:()=>R(e=>({...e,flipV:!e.flipV})),onResetTransform:()=>R(F),onToggleFullscreen:Q.toggleFullscreen})]})}var K=new Set([`mp4`,`m4v`,`webm`,`ogg`,`ogv`,`mov`]);function q({filePath:e,projectName:t}){let n=T(e),[r,i]=(0,P.useState)(()=>K.has(n)?{kind:`native`}:{kind:`probing`});return(0,P.useEffect)(()=>{i(K.has(T(e))?{kind:`native`}:{kind:`probing`})},[e]),(0,P.useEffect)(()=>{if(r.kind!==`probing`)return;let n=!1;return S(e,t).then(e=>{n||i(e.transcodable?{kind:`transcode`,probe:e}:{kind:`unsupported`,probe:e})}).catch(()=>{n||i({kind:`unsupported`,probe:null})}),()=>{n=!0}},[r.kind,e,t]),r.kind===`probing`?(0,V.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,V.jsx)(o,{className:`size-5 animate-spin text-text-subtle`})}):r.kind===`transcode`?(0,V.jsx)(G,{filePath:e,projectName:t,mode:`transcode`,probeDuration:r.probe.duration}):r.kind===`unsupported`?(0,V.jsx)(J,{filePath:e,projectName:t,probe:r.probe}):(0,V.jsx)(G,{filePath:e,projectName:t,mode:`native`,onNativeError:()=>i({kind:`probing`})})}function J({filePath:e,projectName:t,probe:n}){let r=[n?.video?.codec,n?.audio?.codec].filter(Boolean).join(` + `);return(0,V.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-3 text-text-secondary p-6 text-center`,children:[(0,V.jsx)(a,{className:`size-10 text-text-subtle`}),(0,V.jsxs)(`p`,{className:`text-sm`,children:[`This video cannot be played in the browser`,r?` (${r})`:``,`.`]}),(0,V.jsxs)(`p`,{className:`text-xs text-text-subtle max-w-sm`,children:[`Install `,(0,V.jsx)(`code`,{children:`ffmpeg`}),` on the PPM server (e.g. `,(0,V.jsx)(`code`,{children:`winget install ffmpeg`}),`, `,(0,V.jsx)(`code`,{children:`brew install ffmpeg`}),`,`,` `,(0,V.jsx)(`code`,{children:`apt install ffmpeg`}),`) and restart PPM to transcode it on the fly.`]}),(0,V.jsx)(s,{asChild:!0,variant:`outline`,size:`sm`,className:`h-11 px-4`,children:(0,V.jsxs)(`a`,{href:`${C(e,t)}&download=true`,download:!0,children:[(0,V.jsx)(i,{className:`size-4 mr-2`}),` Download file`]})})]})}export{q as VideoPreview};
|
package/dist/web/index.html
CHANGED
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
40
40
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
41
41
|
<link href="https://fonts.googleapis.com/css2?family=Geist+Mono:wght@400;500;600;700&family=Geist:wght@400;500;600;700&display=swap" rel="stylesheet" />
|
|
42
|
-
<script type="module" crossorigin src="/assets/index-
|
|
42
|
+
<script type="module" crossorigin src="/assets/index-CJWbFurD.js"></script>
|
|
43
43
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-FhOqtrmT.js">
|
|
44
44
|
<link rel="modulepreload" crossorigin href="/assets/vendor-mermaid-CfY1-PkA.js">
|
|
45
45
|
<link rel="modulepreload" crossorigin href="/assets/vendor-markdown-Ls5AcU91.js">
|