zdashboard 2.13.0 → 2.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/dist/cli.js +45 -118
  2. package/dist/cli.js.map +1 -1
  3. package/dist/web/assets/{FileIcon-KX0Rfn5x.js → FileIcon-qMWiXCuh.js} +1 -1
  4. package/dist/web/assets/{FilterPills-D2zZaent.js → FilterPills-D4oEoDdf.js} +1 -1
  5. package/dist/web/assets/Sidebar-K85f6s_v.js +1 -0
  6. package/dist/web/assets/{Sidebar-B6Pvc7pb.js → Sidebar-UhpDd_r6.js} +1 -1
  7. package/dist/web/assets/{DiagramViewer-CQYfB79k.js → UnsupportedViewer-DW7gYl0e.js} +49 -50
  8. package/dist/web/assets/Workspace-CDIORqDn.js +2 -0
  9. package/dist/web/assets/{Workspace-5hZEbEDw.js → Workspace-CEGk753f.js} +1 -1
  10. package/dist/web/assets/{Workspace-CpV2wf10.js → Workspace-D1535fIs.js} +2 -2
  11. package/dist/web/assets/Workspace-FYtBxShi.js +1 -0
  12. package/dist/web/assets/{cynefin-OW5HDTMX-BLthHq8j.js → cynefin-OW5HDTMX-CafNfxMw.js} +2 -2
  13. package/dist/web/assets/{excalidraw-Duf4g83v.js → excalidraw-B6QTBxnj.js} +6 -6
  14. package/dist/web/assets/index-B7bsV2ku.css +1 -0
  15. package/dist/web/assets/{index-BxPRo4R9.js → index-Ipssembb.js} +9 -9
  16. package/dist/web/assets/{usePluginData-BaCM6nnK.js → usePluginData-B8y55C_P.js} +1 -1
  17. package/dist/web/assets/{web-oi27dtPg.js → web-BT48JLMA.js} +2 -2
  18. package/dist/web/assets/web-CeRdVt5Q.js +2 -0
  19. package/dist/web/assets/{web-C7ddFKgL.js → web-DKDQ9hoO.js} +2 -2
  20. package/dist/web/assets/{web-CmZk5ox_.js → web-QjEj88xq.js} +2 -2
  21. package/dist/web/index.html +2 -2
  22. package/package.json +1 -1
  23. package/dist/web/assets/Sidebar-Cg5Nabqa.js +0 -1
  24. package/dist/web/assets/Workspace-BzLI5G5q.js +0 -1
  25. package/dist/web/assets/Workspace-DbRd77b0.js +0 -1
  26. package/dist/web/assets/index-DJ7iFi2B.css +0 -1
  27. package/dist/web/assets/web-CBXj6xFf.js +0 -2
  28. /package/dist/web/assets/{DiagramViewer-BTcE7LSd.css → UnsupportedViewer-BTcE7LSd.css} +0 -0
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/excalidraw-B6QTBxnj.js","assets/index-D7HrI6pR.js","assets/vendor-react-OhDMXABq.js","assets/vendor-ui-D8qdFUhC.js","assets/excalidraw-CbfdidzT.css"])))=>i.map(i=>d[i]);
2
+ var A=Object.defineProperty;var M=(e,r,l)=>r in e?A(e,r,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[r]=l;var R=(e,r,l)=>M(e,typeof r!="symbol"?r+"":r,l);import{r as i,j as t}from"./vendor-react-OhDMXABq.js";import{u as k,R as W,C as y,M as L,I as D,F as T,U as V}from"./UnsupportedViewer-DW7gYl0e.js";import{_ as S}from"./index-D7HrI6pR.js";import{f as U,v as F}from"./fetchJson-D-dWeu1j.js";import{d as P,u as O,R as z,a as B,P as q,E as X}from"./index-Ipssembb.js";import{m as C}from"./web-QjEj88xq.js";import"./vendor-ui-D8qdFUhC.js";import"./client-Cw4K1Nx3.js";const $=2*1024*1024,H=6e5,J="https://viewer.diagrams.net/?#R";function Y(){return Promise.all([S(()=>import("./excalidraw-B6QTBxnj.js").then(e=>e.i),__vite__mapDeps([0,1,2,3,4])),S(()=>import("./excalidraw-B6QTBxnj.js").then(e=>e.a),__vite__mapDeps([0,1,2,3,4]))]).then(([e])=>({default:e.Excalidraw}))}function K(e){const r=e.slice(e.lastIndexOf("/")+1).toLowerCase();return r.endsWith(".excalidraw")?"excalidraw":r.endsWith(".drawio")?"drawio":null}function G(e){return new TextEncoder().encode(e).length}function w({message:e,onRetry:r}){return t.jsx("div",{className:"h-full flex flex-col p-4",children:t.jsx(P,{message:e,onRetry:r})})}class Q extends i.Component{constructor(){super(...arguments);R(this,"state",{failed:!1})}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?t.jsx(w,{message:"渲染器加载失败(网络中断或部署不一致)",onRetry:this.props.onRetry}):this.props.children}}function Z({path:e,resolve:r}){const l=K(e),[n,g]=i.useState(null),[x,d]=i.useState(null),[j,h]=k(),E=i.useRef(null),[v,s]=i.useState(null),[c,a]=i.useState(0);i.useEffect(()=>{let o=!0;if(E.current!==e&&(E.current=e,g(null)),d(null),!l){d("不支持的图表格式");return}return U(r?r(e):"/__file-content/"+encodeURI(e),{cache:"no-store"}).then(u=>{o&&(g(u),d(null))}).catch(u=>{o&&d(F(u))}),()=>{o=!1}},[e,r,j,l]),i.useEffect(()=>{if(l!=="excalidraw")return;let o=!0;return s(null),Y().then(u=>{o&&s({Comp:u.default})}).catch(()=>{o&&s({loadErr:!0})}),()=>{o=!1}},[c,l]);const f=i.useMemo(()=>n===null?0:G(n),[n]),p=i.useMemo(()=>n===null?0:encodeURIComponent(n).length,[n]);if(x&&n===null)return t.jsx(w,{message:x,onRetry:h});if(n===null)return t.jsx("p",{className:"p-3 text-xs text-muted-foreground",children:"加载中…"});if(l==="excalidraw"){if(f>$)return t.jsx(w,{message:"文件过大,无法在线预览",onRetry:h});let o;try{o=JSON.parse(n)}catch{return t.jsx(w,{message:"文件内容损坏:不是有效的 Excalidraw JSON",onRetry:h})}return t.jsxs("div",{className:"relative flex flex-col h-full",children:[t.jsx("div",{className:"absolute right-2 top-2 z-10",children:t.jsx(W,{onClick:h})}),t.jsx("div",{className:"flex-1 min-h-0 [&>.excalidraw]:h-full",children:v===null?t.jsx("p",{className:"p-3 text-xs text-muted-foreground",children:"加载渲染器…"}):"loadErr"in v?t.jsx(w,{message:"渲染器加载失败(网络中断或部署不一致)",onRetry:()=>a(u=>u+1)}):t.jsx(Q,{onRetry:()=>a(u=>u+1),children:t.jsx(v.Comp,{initialData:o,viewModeEnabled:!0})})})]})}if(p>H)return t.jsx(w,{message:"文件过大,无法在线预览",onRetry:h});const m=J+encodeURIComponent(n);return t.jsxs("div",{className:"flex flex-col h-full",children:[t.jsx("iframe",{src:m,title:e.slice(e.lastIndexOf("/")+1),referrerPolicy:"no-referrer",className:"flex-1 min-h-0 w-full border-0 bg-background"}),t.jsxs("div",{className:"flex-none px-4 py-2 border-t text-xs text-muted-foreground flex items-center gap-2",children:[t.jsx("span",{children:"由 diagrams.net 官方 viewer 只读渲染(需联网)"}),t.jsx("a",{href:m,target:"_blank",rel:"noreferrer noopener",className:"underline hover:text-foreground",children:"在新窗口打开 viewer"})]})]})}const N=176,_=400,b=176,I="zd-outline-w",ee=e=>Math.min(_,Math.max(N,e));function te(){try{const e=localStorage.getItem(I);if(e===null)return b;const r=Number(e);return Number.isFinite(r)&&r>=N&&r<=_?r:b}catch{return b}}function re({containerRef:e}){const{icon:r}=O(),[l,n]=i.useState([]),[g,x]=i.useState(null),[d,j]=i.useState(te),h=(s,c)=>{const a=ee(s);if(j(a),c)try{localStorage.setItem(I,String(a))}catch{}},E=()=>{j(b);try{localStorage.removeItem(I)}catch{}};i.useEffect(()=>{const s=e.current;if(!s)return;let c=!1;const a=()=>{if(c)return;const p=s.querySelectorAll("h1[id], h2[id], h3[id]"),m=[];p.forEach(o=>{var u;m.push({id:o.id,text:((u=o.textContent)==null?void 0:u.trim())??"",level:parseInt(o.tagName[1],10)})}),n(m)};a();const f=new MutationObserver(a);return f.observe(s,{childList:!0,subtree:!0,characterData:!0}),()=>{c=!0,f.disconnect()}},[e]),i.useEffect(()=>{const s=e.current;if(!s||!l.length)return;const c=new IntersectionObserver(a=>{const f=a.filter(p=>p.isIntersecting);if(f.length){const p=f.reduce((m,o)=>m.boundingClientRect.top<o.boundingClientRect.top?m:o);x(p.target.id)}},{root:s,rootMargin:"-60px 0px -70% 0px",threshold:0});return l.forEach(({id:a})=>{const f=s.querySelector(`#${CSS.escape(a)}`);f&&c.observe(f)}),()=>c.disconnect()},[l,e]);const v=s=>{var a;const c=(a=e.current)==null?void 0:a.querySelector(`#${CSS.escape(s)}`);c==null||c.scrollIntoView({behavior:"smooth",block:"start"})};return l.length?t.jsxs("nav",{className:"hidden md:flex shrink-0 border-l py-2 overflow-hidden",style:{width:`${d}px`},"aria-label":"文档大纲",children:[t.jsx(z,{orientation:"vertical",invert:!0,min:N,max:_,value:d,onChange:h,onReset:E,label:"调整大纲宽度",className:"flex-none w-1.5 cursor-col-resize self-stretch"}),t.jsxs("div",{className:"flex-1 min-w-0 min-h-0 overflow-y-auto pl-3",children:[t.jsxs("div",{className:"flex items-center gap-1 mb-2 text-sm font-medium text-muted-foreground uppercase tracking-wider",children:[r("file-text","h-3 w-3"),t.jsx("span",{children:"大纲"})]}),t.jsx("ul",{className:"space-y-0.5",children:l.map(s=>t.jsx("li",{children:t.jsx("button",{type:"button",title:s.text,onClick:()=>v(s.id),className:`w-full text-left text-sm leading-snug py-0.5 px-1.5 rounded line-clamp-2 transition-colors ${g===s.id?"bg-primary/10 text-foreground font-medium":"text-muted-foreground hover:bg-muted/70"}`,style:{paddingLeft:6+Math.min(s.level-1,2)*10},children:s.text||s.id})},s.id))})]})]}):null}function ne(e){const r=e.slice(e.lastIndexOf("/")+1).toLowerCase();if(r==="justfile"||r==="makefile")return y;const l=r.lastIndexOf("."),n=l>=0?r.slice(l):"";return n===".md"||n===".markdown"?L:[".svg",".png",".jpg",".jpeg",".gif",".webp",".ico"].includes(n)?D:[".pdf",".html",".htm"].includes(n)?T:[".excalidraw",".drawio"].includes(n)?Z:[".sql",".txt",".csv",".tsv",".json",".yaml",".yml",".xml",".py",".js",".ts",".java",".go",".rs",".rb",".php",".c",".cpp",".h",".cs",".swift",".kt",".scala",".sh",".bash",".zsh",".fish",".env",".gitignore",".dockerfile"].includes(n)?y:l===-1?y:V}function xe({params:e}){const{icon:r}=O(),l=B(C.mode,"h-5 w-5"),n=e.get("file"),g=e.get("wt"),x=i.useRef(null),d=n?ne(n):null;return i.useEffect(()=>{x.current&&(x.current.scrollTop=0)},[n]),t.jsx(q,{manifest:C,icon:l,breadcrumb:["插件",g??"当前分支",...n?[n]:[]],children:t.jsx("div",{className:"mx-auto h-full max-w-5xl bg-background border rounded-lg shadow-sm overflow-hidden flex flex-col",children:n&&d?t.jsxs("div",{className:"flex-1 min-h-0 flex overflow-hidden",children:[t.jsx("div",{ref:x,className:"flex-1 min-h-0 overflow-auto",children:t.jsx(d,{path:n})}),t.jsx(re,{containerRef:x})]}):t.jsx(X,{icon:r("eye","h-6 w-6"),title:"从左侧选择文件预览",hint:"支持 Markdown、图片、代码等格式"})})})}export{xe as default};
@@ -1 +1 @@
1
- import{j as e}from"./vendor-react-OhDMXABq.js";import{d as g,u as h,a as j,b as v,E as N,S as y,f as w,P as _}from"./index-BxPRo4R9.js";import{u}from"./usePluginData-BaCM6nnK.js";import{a as m}from"./fetchJson-D-dWeu1j.js";import{m as n}from"./web-C7ddFKgL.js";import"./vendor-ui-D8qdFUhC.js";import"./index-D7HrI6pR.js";import"./client-Cw4K1Nx3.js";function k({value:i,className:l}){const r=Math.max(0,Math.min(100,i));return e.jsx("div",{className:g("rounded-[var(--radius-full)] bg-muted overflow-hidden",l),role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuetext":`${r}%`,children:e.jsx("div",{className:"h-full rounded-[var(--radius-full)] bg-primary transition-all",style:{width:`${r}%`}})})}function F(i){var d,c;const{icon:l}=h(),r=j(n.mode,"h-5 w-5"),x=v(),a=u("stats:/__stats/data",()=>m("/__stats/data",{cache:"no-store"}),{subscribe:"files"}),o=u("stats:/__detect",()=>m("/__detect",{cache:"no-store"}));if(a.error)return e.jsx("div",{className:"h-full flex flex-col",children:e.jsx(N,{message:a.error,onRetry:a.reload})});if(!a.data)return e.jsx("div",{className:"h-full p-6",children:e.jsx(y,{rows:8})});const s=a.data,f=Math.max(...s.byExt.map(t=>t.count),1),p=[{label:"文件",value:String(s.files),iconName:"file-text",drill:null},{label:"目录",value:String(s.dirs),iconName:"folder-tree",drill:null},{label:"总大小",value:w(s.totalSize),iconName:null,drill:null},{label:"Worktree",value:String(s.worktrees),iconName:"git-branch",drill:"worktree"},{label:"未提交",value:String(s.dirty??0),iconName:null,drill:"dirty"}],b=t=>x.navigate({p:"view",card:t});return e.jsx(_,{manifest:n,icon:r,breadcrumb:["插件",n.mode],children:e.jsxs("div",{className:"mx-auto h-full max-w-6xl overflow-auto rounded-lg border bg-background p-6 shadow-sm",children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-5",children:"后端 fs 扫描 + 前端渲染 · 改文件即时刷新 · 点击卡片跳转"}),e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-3 mb-6",children:p.map(t=>e.jsxs("button",{type:"button",onClick:()=>t.drill&&b(t.drill),disabled:!t.drill,title:t.drill?`点击跳转至 ${t.label}`:void 0,className:`rounded-lg border bg-background p-4 text-left transition-colors ${t.drill?"hover:bg-muted/70 cursor-pointer":"cursor-default opacity-80"}`,children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"text-xl font-bold",children:t.value}),t.iconName&&l(t.iconName,"h-4 w-4 text-muted-foreground/50")]}),e.jsx("div",{className:"text-sm text-muted-foreground mt-1",children:t.label})]},t.label))}),e.jsx("h2",{className:"text-xs font-medium text-muted-foreground mb-3",children:"文件类型 Top 10"}),e.jsx("div",{className:"space-y-2",children:s.byExt.map(t=>e.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[e.jsx("span",{className:"w-16 font-mono text-foreground truncate",children:t.ext}),e.jsx(k,{value:parseFloat((t.count/f*100).toFixed(1)),className:"flex-1 h-2"}),e.jsx("span",{className:"w-8 text-right font-mono text-muted-foreground",children:t.count})]},t.ext))}),e.jsxs("div",{className:"mt-5 flex items-center gap-2 text-xs",children:[o.error?e.jsx("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded border text-muted-foreground border-border",children:"justfile 探测失败"}):e.jsxs("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded border ${(d=o.data)!=null&&d.hasJust?"text-success border-success/30 bg-success/10":"text-muted-foreground border-border"}`,children:["justfile ",(c=o.data)!=null&&c.hasJust?"✓":"✗"]}),typeof s.dirty=="number"&&e.jsx("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded border ${s.dirty?"text-warning border-warning/30 bg-warning/10":"text-success border-success/30 bg-success/10"}`,children:s.dirty?`${s.dirty} 未提交`:"clean"}),e.jsxs("span",{className:"text-muted-foreground",children:["root: ",s.root]})]})]})})}export{F as default};
1
+ import{j as e}from"./vendor-react-OhDMXABq.js";import{c as b,u as h,a as j,e as v,d as N,S as y,f as w,P as _}from"./index-Ipssembb.js";import{u}from"./usePluginData-B8y55C_P.js";import{a as m}from"./fetchJson-D-dWeu1j.js";import{m as n}from"./web-DKDQ9hoO.js";import"./vendor-ui-D8qdFUhC.js";import"./index-D7HrI6pR.js";import"./client-Cw4K1Nx3.js";function k({value:i,className:l}){const r=Math.max(0,Math.min(100,i));return e.jsx("div",{className:b("rounded-[var(--radius-full)] bg-muted overflow-hidden",l),role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuetext":`${r}%`,children:e.jsx("div",{className:"h-full rounded-[var(--radius-full)] bg-primary transition-all",style:{width:`${r}%`}})})}function F(i){var d,c;const{icon:l}=h(),r=j(n.mode,"h-5 w-5"),x=v(),a=u("stats:/__stats/data",()=>m("/__stats/data",{cache:"no-store"}),{subscribe:"files"}),o=u("stats:/__detect",()=>m("/__detect",{cache:"no-store"}));if(a.error)return e.jsx("div",{className:"h-full flex flex-col",children:e.jsx(N,{message:a.error,onRetry:a.reload})});if(!a.data)return e.jsx("div",{className:"h-full p-6",children:e.jsx(y,{rows:8})});const s=a.data,f=Math.max(...s.byExt.map(t=>t.count),1),p=[{label:"文件",value:String(s.files),iconName:"file-text",drill:null},{label:"目录",value:String(s.dirs),iconName:"folder-tree",drill:null},{label:"总大小",value:w(s.totalSize),iconName:null,drill:null},{label:"Worktree",value:String(s.worktrees),iconName:"git-branch",drill:"worktree"},{label:"未提交",value:String(s.dirty??0),iconName:null,drill:"dirty"}],g=t=>x.navigate({p:"view",card:t});return e.jsx(_,{manifest:n,icon:r,breadcrumb:["插件",n.mode],children:e.jsxs("div",{className:"mx-auto h-full max-w-6xl overflow-auto rounded-lg border bg-background p-6 shadow-sm",children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-5",children:"后端 fs 扫描 + 前端渲染 · 改文件即时刷新 · 点击卡片跳转"}),e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-3 mb-6",children:p.map(t=>e.jsxs("button",{type:"button",onClick:()=>t.drill&&g(t.drill),disabled:!t.drill,title:t.drill?`点击跳转至 ${t.label}`:void 0,className:`rounded-lg border bg-background p-4 text-left transition-colors ${t.drill?"hover:bg-muted/70 cursor-pointer":"cursor-default opacity-80"}`,children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"text-xl font-bold",children:t.value}),t.iconName&&l(t.iconName,"h-4 w-4 text-muted-foreground/50")]}),e.jsx("div",{className:"text-sm text-muted-foreground mt-1",children:t.label})]},t.label))}),e.jsx("h2",{className:"text-xs font-medium text-muted-foreground mb-3",children:"文件类型 Top 10"}),e.jsx("div",{className:"space-y-2",children:s.byExt.map(t=>e.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[e.jsx("span",{className:"w-16 font-mono text-foreground truncate",children:t.ext}),e.jsx(k,{value:parseFloat((t.count/f*100).toFixed(1)),className:"flex-1 h-2"}),e.jsx("span",{className:"w-8 text-right font-mono text-muted-foreground",children:t.count})]},t.ext))}),e.jsxs("div",{className:"mt-5 flex items-center gap-2 text-xs",children:[o.error?e.jsx("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded border text-muted-foreground border-border",children:"justfile 探测失败"}):e.jsxs("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded border ${(d=o.data)!=null&&d.hasJust?"text-success border-success/30 bg-success/10":"text-muted-foreground border-border"}`,children:["justfile ",(c=o.data)!=null&&c.hasJust?"✓":"✗"]}),typeof s.dirty=="number"&&e.jsx("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded border ${s.dirty?"text-warning border-warning/30 bg-warning/10":"text-success border-success/30 bg-success/10"}`,children:s.dirty?`${s.dirty} 未提交`:"clean"}),e.jsxs("span",{className:"text-muted-foreground",children:["root: ",s.root]})]})]})})}export{F as default};
@@ -1,5 +1,5 @@
1
- import{r as h,c as S,j as f}from"./vendor-react-OhDMXABq.js";import{u as ht,S as Le,E as gt,c as mt,B as $,a as pt,b as xt,P as Dt}from"./index-BxPRo4R9.js";import{F as Me}from"./FilterPills-D2zZaent.js";import{u as te}from"./vendor-ui-D8qdFUhC.js";import{u as bt}from"./usePluginData-BaCM6nnK.js";import{a as $e}from"./fetchJson-D-dWeu1j.js";import{m as ge}from"./web-oi27dtPg.js";import"./index-D7HrI6pR.js";import"./client-Cw4K1Nx3.js";function x(t){const e=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&e==="[object Date]"?new t.constructor(+t):typeof t=="number"||e==="[object Number]"||typeof t=="string"||e==="[object String]"?new Date(t):new Date(NaN)}function re(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}function Ft(t,e){const s=x(t);return isNaN(e)?re(t,NaN):(e&&s.setDate(s.getDate()+e),s)}function vt(t,e){const s=x(t);if(isNaN(e))return re(t,NaN);if(!e)return s;const r=s.getDate(),n=re(t,s.getTime());n.setMonth(s.getMonth()+e+1,0);const i=n.getDate();return r>=i?n:(s.setFullYear(n.getFullYear(),n.getMonth(),r),s)}function W(t,e){const{years:s=0,months:r=0,weeks:n=0,days:i=0,hours:c=0,minutes:o=0,seconds:d=0}=e,a=x(t),m=r||s?vt(a,r+s*12):a,_=i||n?Ft(m,i+n*7):m,v=o+c*60,b=(d+v*60)*1e3;return re(t,_.getTime()+b)}const yt=864e5,Et=6e4,Ct=36e5;function Ie(t){const e=x(t);return e.setHours(0,0,0,0),e}function Be(t){const e=x(t),s=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return s.setUTCFullYear(e.getFullYear()),+t-+s}function jt(t,e){const s=Ie(t),r=Ie(e),n=+s-Be(s),i=+r-Be(r);return Math.round((n-i)/yt)}function G(t,e){const s=x(t),r=x(e),n=s.getTime()-r.getTime();return n<0?-1:n>0?1:n}function wt(t,e){const s=x(t),r=x(e),n=s.getFullYear()-r.getFullYear(),i=s.getMonth()-r.getMonth();return n*12+i}function At(t,e){const s=x(t),r=x(e);return s.getFullYear()-r.getFullYear()}function zt(t,e){const s=x(t),r=x(e),n=Pe(s,r),i=Math.abs(jt(s,r));s.setDate(s.getDate()-n*i);const c=+(Pe(s,r)===-n),o=n*(i-c);return o===0?0:o}function Pe(t,e){const s=t.getFullYear()-e.getFullYear()||t.getMonth()-e.getMonth()||t.getDate()-e.getDate()||t.getHours()-e.getHours()||t.getMinutes()-e.getMinutes()||t.getSeconds()-e.getSeconds()||t.getMilliseconds()-e.getMilliseconds();return s<0?-1:s>0?1:s}function ye(t){return e=>{const r=(t?Math[t]:Math.trunc)(e);return r===0?0:r}}function Ee(t,e){return+x(t)-+x(e)}function kt(t,e,s){const r=Ee(t,e)/Ct;return ye(s==null?void 0:s.roundingMethod)(r)}function Nt(t,e,s){const r=Ee(t,e)/Et;return ye(s==null?void 0:s.roundingMethod)(r)}function Rt(t){const e=x(t);return e.setHours(23,59,59,999),e}function St(t){const e=x(t),s=e.getMonth();return e.setFullYear(e.getFullYear(),s+1,0),e.setHours(23,59,59,999),e}function Ot(t){const e=x(t);return+Rt(e)==+St(e)}function Tt(t,e){const s=x(t),r=x(e),n=G(s,r),i=Math.abs(wt(s,r));let c;if(i<1)c=0;else{s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-n*i);let o=G(s,r)===-n;Ot(x(t))&&i===1&&G(t,r)===1&&(o=!1),c=n*(i-Number(o))}return c===0?0:c}function Lt(t,e,s){const r=Ee(t,e)/1e3;return ye(s==null?void 0:s.roundingMethod)(r)}function Mt(t,e){const s=x(t),r=x(e),n=G(s,r),i=Math.abs(At(s,r));s.setFullYear(1584),r.setFullYear(1584);const c=G(s,r)===-n,o=n*(i-+c);return o===0?0:o}function $t(t){const e=x(t.start),s=x(t.end),r={},n=Mt(s,e);n&&(r.years=n);const i=W(e,{years:r.years}),c=Tt(s,i);c&&(r.months=c);const o=W(i,{months:r.months}),d=zt(s,o);d&&(r.days=d);const a=W(o,{days:r.days}),m=kt(s,a);m&&(r.hours=m);const _=W(a,{hours:r.hours}),v=Nt(s,_);v&&(r.minutes=v);const y=W(_,{minutes:r.minutes}),b=Lt(s,y);return b&&(r.seconds=b),r}const It=40,se=1e3;function Ze(t,e,s,r=It){return t-e-s<r}function Bt(t){return/^\[(ERROR|FATAL)\]/.test(t)||/^ERROR\b/.test(t)?"error":/^\[(WARN|WARNING)\]/.test(t)||/^WARN(ING)?\b/.test(t)?"warn":/^\[DEBUG\]/.test(t)||/^DEBUG\b/.test(t)?"info":/^\[(INFO|DOWNLOAD|PROGRESS)\]/.test(t)||/^INFO\b/.test(t)?"success":"plain"}function Fe(t){switch(Bt(t)){case"error":return"text-destructive";case"warn":return"text-warning";case"info":return"text-info";case"success":return"text-success";default:return"text-terminal-fg"}}function Pt(t,e){if(!e)return null;const s=t.toLowerCase(),r=e.toLowerCase(),n=[];let i=0,c=!1;for(;i<t.length;){const o=s.indexOf(r,i);if(o<0){n.push({text:t.slice(i),hit:!1});break}o>i&&n.push({text:t.slice(i,o),hit:!1}),n.push({text:t.slice(o,o+r.length),hit:!0}),c=!0,i=o+r.length}return c?n:null}var et={};const N=[[{color:"0, 0, 0",class:"ansi-black"},{color:"187, 0, 0",class:"ansi-red"},{color:"0, 187, 0",class:"ansi-green"},{color:"187, 187, 0",class:"ansi-yellow"},{color:"0, 0, 187",class:"ansi-blue"},{color:"187, 0, 187",class:"ansi-magenta"},{color:"0, 187, 187",class:"ansi-cyan"},{color:"255,255,255",class:"ansi-white"}],[{color:"85, 85, 85",class:"ansi-bright-black"},{color:"255, 85, 85",class:"ansi-bright-red"},{color:"0, 255, 0",class:"ansi-bright-green"},{color:"255, 255, 85",class:"ansi-bright-yellow"},{color:"85, 85, 255",class:"ansi-bright-blue"},{color:"255, 85, 255",class:"ansi-bright-magenta"},{color:"85, 255, 255",class:"ansi-bright-cyan"},{color:"255, 255, 255",class:"ansi-bright-white"}]],Zt=/(https?:\/\/(?:[A-Za-z0-9#;/?:@=+$',_.!~*()[\]-]|&amp;|%[A-Fa-f0-9]{2})+)/gm;class I{static escapeForHtml(e){return new I().escapeForHtml(e)}static linkify(e){return new I().linkify(e)}static ansiToHtml(e,s){return new I().ansiToHtml(e,s)}static ansiToJson(e,s){return new I().ansiToJson(e,s)}static ansiToText(e){return new I().ansiToText(e)}constructor(){this.fg=this.bg=this.fg_truecolor=this.bg_truecolor=null,this.bright=0,this.decorations=[]}setupPalette(){this.PALETTE_COLORS=[];for(let n=0;n<2;++n)for(let i=0;i<8;++i)this.PALETTE_COLORS.push(N[n][i].color);let e=[0,95,135,175,215,255],s=(n,i,c)=>e[n]+", "+e[i]+", "+e[c];for(let n=0;n<6;++n)for(let i=0;i<6;++i)for(let c=0;c<6;++c)this.PALETTE_COLORS.push(s(n,i,c));let r=8;for(let n=0;n<24;++n,r+=10)this.PALETTE_COLORS.push(r+", "+r+", "+r)}escapeForHtml(e){return e.replace(/[&<>\"]/gm,s=>s=="&"?"&amp;":s=='"'?"&quot;":s=="<"?"&lt;":s==">"?"&gt;":"")}linkify(e){return e.replace(Zt,s=>`<a href="${s}">${s}</a>`)}ansiToHtml(e,s){return this.process(e,s,!0)}ansiToJson(e,s){return s=s||{},s.json=!0,s.clearLine=!1,this.process(e,s,!0)}ansiToText(e){return this.process(e,{},!1)}process(e,s,r){let n=this,i=e.split(/\033\[/),c=i.shift();s==null&&(s={}),s.clearLine=/\r/.test(e);let o=i.map(d=>this.processChunk(d,s,r));if(s&&s.json){let d=n.processChunkJson("");return d.content=c,d.clearLine=s.clearLine,o.unshift(d),s.remove_empty&&(o=o.filter(a=>!a.isEmpty())),o}else o.unshift(c);return o.join("")}processChunkJson(e,s,r){s=typeof s>"u"?{}:s;let n=s.use_classes=typeof s.use_classes<"u"&&s.use_classes,i=s.key=n?"class":"color",c={content:e,fg:null,bg:null,fg_truecolor:null,bg_truecolor:null,isInverted:!1,clearLine:s.clearLine,decoration:null,decorations:[],was_processed:!1,isEmpty:()=>!c.content},o=e.match(/^([!\x3c-\x3f]*)([\d;]*)([\x20-\x2c]*[\x40-\x7e])([\s\S]*)/m);if(!o)return c;c.content=o[4];let d=o[2].split(";");if(o[1]!==""||o[3]!=="m"||!r)return c;let a=this;for(;d.length>0;){let m=d.shift(),_=parseInt(m);if(isNaN(_)||_===0)a.fg=a.bg=null,a.decorations=[];else if(_===1)a.decorations.push("bold");else if(_===2)a.decorations.push("dim");else if(_===3)a.decorations.push("italic");else if(_===4)a.decorations.push("underline");else if(_===5)a.decorations.push("blink");else if(_===7)a.decorations.push("reverse");else if(_===8)a.decorations.push("hidden");else if(_===9)a.decorations.push("strikethrough");else if(_===21)a.removeDecoration("bold");else if(_===22)a.removeDecoration("bold"),a.removeDecoration("dim");else if(_===23)a.removeDecoration("italic");else if(_===24)a.removeDecoration("underline");else if(_===25)a.removeDecoration("blink");else if(_===27)a.removeDecoration("reverse");else if(_===28)a.removeDecoration("hidden");else if(_===29)a.removeDecoration("strikethrough");else if(_===39)a.fg=null;else if(_===49)a.bg=null;else if(_>=30&&_<38)a.fg=N[0][_%10][i];else if(_>=90&&_<98)a.fg=N[1][_%10][i];else if(_>=40&&_<48)a.bg=N[0][_%10][i];else if(_>=100&&_<108)a.bg=N[1][_%10][i];else if(_===38||_===48){let v=_===38;if(d.length>=1){let y=d.shift();if(y==="5"&&d.length>=1){let b=parseInt(d.shift());if(b>=0&&b<=255)if(!n)this.PALETTE_COLORS||a.setupPalette(),v?a.fg=this.PALETTE_COLORS[b]:a.bg=this.PALETTE_COLORS[b];else{let w=b>=16?"ansi-palette-"+b:N[b>7?1:0][b%8].class;v?a.fg=w:a.bg=w}}else if(y==="2"&&d.length>=3){let b=parseInt(d.shift()),w=parseInt(d.shift()),B=parseInt(d.shift());if(b>=0&&b<=255&&w>=0&&w<=255&&B>=0&&B<=255){let A=b+", "+w+", "+B;n?v?(a.fg="ansi-truecolor",a.fg_truecolor=A):(a.bg="ansi-truecolor",a.bg_truecolor=A):v?a.fg=A:a.bg=A}}}}}return a.fg===null&&a.bg===null&&a.decorations.length===0||(c.fg=a.fg,c.bg=a.bg,c.fg_truecolor=a.fg_truecolor,c.bg_truecolor=a.bg_truecolor,c.decorations=a.decorations,c.decoration=a.decorations.slice(-1).pop()||null,c.was_processed=!0),c}processChunk(e,s,r){s=s||{};let n=this.processChunkJson(e,s,r),i=s.use_classes;if(n.decorations=n.decorations.filter(_=>{if(_==="reverse"){n.fg||(n.fg=N[0][7][i?"class":"color"]),n.bg||(n.bg=N[0][0][i?"class":"color"]);let v=n.fg;n.fg=n.bg,n.bg=v;let y=n.fg_truecolor;return n.fg_truecolor=n.bg_truecolor,n.bg_truecolor=y,n.isInverted=!0,!1}return!0}),s.json)return n;if(n.isEmpty())return"";if(!n.was_processed)return n.content;let c=[],o=[],d=[],a={},m=_=>{let v=[],y;for(y in _)_.hasOwnProperty(y)&&v.push("data-"+y+'="'+this.escapeForHtml(_[y])+'"');return v.length>0?" "+v.join(" "):""};return n.isInverted&&(a["ansi-is-inverted"]="true"),n.fg&&(i?(c.push(n.fg+"-fg"),n.fg_truecolor!==null&&(a["ansi-truecolor-fg"]=n.fg_truecolor,n.fg_truecolor=null)):c.push("color:rgb("+n.fg+")")),n.bg&&(i?(c.push(n.bg+"-bg"),n.bg_truecolor!==null&&(a["ansi-truecolor-bg"]=n.bg_truecolor,n.bg_truecolor=null)):c.push("background-color:rgb("+n.bg+")")),n.decorations.forEach(_=>{if(i){o.push("ansi-"+_);return}_==="bold"?o.push("font-weight:bold"):_==="dim"?o.push("opacity:0.5"):_==="italic"?o.push("font-style:italic"):_==="hidden"?o.push("visibility:hidden"):_==="strikethrough"?d.push("line-through"):d.push(_)}),d.length&&o.push("text-decoration:"+d.join(" ")),i?'<span class="'+c.concat(o).join(" ")+'"'+m(a)+">"+n.content+"</span>":'<span style="'+c.concat(o).join(";")+'"'+m(a)+">"+n.content+"</span>"}removeDecoration(e){const s=this.decorations.indexOf(e);s>=0&&this.decorations.splice(s,1)}}var Ht=I,ie={exports:{}};function Ce(t){if(!t)return"";if(!/\r/.test(t))return t;for(t=t.replace(/\r+\n/gm,`
1
+ import{r as h,c as S,j as f}from"./vendor-react-OhDMXABq.js";import{u as ht,S as Le,d as gt,E as mt,B as $,a as pt,e as xt,P as Dt}from"./index-Ipssembb.js";import{F as Me}from"./FilterPills-D4oEoDdf.js";import{u as te}from"./vendor-ui-D8qdFUhC.js";import{u as Ft}from"./usePluginData-B8y55C_P.js";import{a as $e}from"./fetchJson-D-dWeu1j.js";import{m as ge}from"./web-BT48JLMA.js";import"./index-D7HrI6pR.js";import"./client-Cw4K1Nx3.js";function x(t){const e=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&e==="[object Date]"?new t.constructor(+t):typeof t=="number"||e==="[object Number]"||typeof t=="string"||e==="[object String]"?new Date(t):new Date(NaN)}function re(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}function bt(t,e){const s=x(t);return isNaN(e)?re(t,NaN):(e&&s.setDate(s.getDate()+e),s)}function vt(t,e){const s=x(t);if(isNaN(e))return re(t,NaN);if(!e)return s;const r=s.getDate(),n=re(t,s.getTime());n.setMonth(s.getMonth()+e+1,0);const i=n.getDate();return r>=i?n:(s.setFullYear(n.getFullYear(),n.getMonth(),r),s)}function W(t,e){const{years:s=0,months:r=0,weeks:n=0,days:i=0,hours:o=0,minutes:c=0,seconds:d=0}=e,a=x(t),m=r||s?vt(a,r+s*12):a,_=i||n?bt(m,i+n*7):m,v=c+o*60,F=(d+v*60)*1e3;return re(t,_.getTime()+F)}const yt=864e5,Et=6e4,Ct=36e5;function Ie(t){const e=x(t);return e.setHours(0,0,0,0),e}function Be(t){const e=x(t),s=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return s.setUTCFullYear(e.getFullYear()),+t-+s}function jt(t,e){const s=Ie(t),r=Ie(e),n=+s-Be(s),i=+r-Be(r);return Math.round((n-i)/yt)}function G(t,e){const s=x(t),r=x(e),n=s.getTime()-r.getTime();return n<0?-1:n>0?1:n}function wt(t,e){const s=x(t),r=x(e),n=s.getFullYear()-r.getFullYear(),i=s.getMonth()-r.getMonth();return n*12+i}function At(t,e){const s=x(t),r=x(e);return s.getFullYear()-r.getFullYear()}function zt(t,e){const s=x(t),r=x(e),n=Pe(s,r),i=Math.abs(jt(s,r));s.setDate(s.getDate()-n*i);const o=+(Pe(s,r)===-n),c=n*(i-o);return c===0?0:c}function Pe(t,e){const s=t.getFullYear()-e.getFullYear()||t.getMonth()-e.getMonth()||t.getDate()-e.getDate()||t.getHours()-e.getHours()||t.getMinutes()-e.getMinutes()||t.getSeconds()-e.getSeconds()||t.getMilliseconds()-e.getMilliseconds();return s<0?-1:s>0?1:s}function ye(t){return e=>{const r=(t?Math[t]:Math.trunc)(e);return r===0?0:r}}function Ee(t,e){return+x(t)-+x(e)}function kt(t,e,s){const r=Ee(t,e)/Ct;return ye(s==null?void 0:s.roundingMethod)(r)}function Nt(t,e,s){const r=Ee(t,e)/Et;return ye(s==null?void 0:s.roundingMethod)(r)}function Rt(t){const e=x(t);return e.setHours(23,59,59,999),e}function St(t){const e=x(t),s=e.getMonth();return e.setFullYear(e.getFullYear(),s+1,0),e.setHours(23,59,59,999),e}function Ot(t){const e=x(t);return+Rt(e)==+St(e)}function Tt(t,e){const s=x(t),r=x(e),n=G(s,r),i=Math.abs(wt(s,r));let o;if(i<1)o=0;else{s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-n*i);let c=G(s,r)===-n;Ot(x(t))&&i===1&&G(t,r)===1&&(c=!1),o=n*(i-Number(c))}return o===0?0:o}function Lt(t,e,s){const r=Ee(t,e)/1e3;return ye(s==null?void 0:s.roundingMethod)(r)}function Mt(t,e){const s=x(t),r=x(e),n=G(s,r),i=Math.abs(At(s,r));s.setFullYear(1584),r.setFullYear(1584);const o=G(s,r)===-n,c=n*(i-+o);return c===0?0:c}function $t(t){const e=x(t.start),s=x(t.end),r={},n=Mt(s,e);n&&(r.years=n);const i=W(e,{years:r.years}),o=Tt(s,i);o&&(r.months=o);const c=W(i,{months:r.months}),d=zt(s,c);d&&(r.days=d);const a=W(c,{days:r.days}),m=kt(s,a);m&&(r.hours=m);const _=W(a,{hours:r.hours}),v=Nt(s,_);v&&(r.minutes=v);const y=W(_,{minutes:r.minutes}),F=Lt(s,y);return F&&(r.seconds=F),r}const It=40,se=1e3;function Ze(t,e,s,r=It){return t-e-s<r}function Bt(t){return/^\[(ERROR|FATAL)\]/.test(t)||/^ERROR\b/.test(t)?"error":/^\[(WARN|WARNING)\]/.test(t)||/^WARN(ING)?\b/.test(t)?"warn":/^\[DEBUG\]/.test(t)||/^DEBUG\b/.test(t)?"info":/^\[(INFO|DOWNLOAD|PROGRESS)\]/.test(t)||/^INFO\b/.test(t)?"success":"plain"}function be(t){switch(Bt(t)){case"error":return"text-destructive";case"warn":return"text-warning";case"info":return"text-info";case"success":return"text-success";default:return"text-terminal-fg"}}function Pt(t,e){if(!e)return null;const s=t.toLowerCase(),r=e.toLowerCase(),n=[];let i=0,o=!1;for(;i<t.length;){const c=s.indexOf(r,i);if(c<0){n.push({text:t.slice(i),hit:!1});break}c>i&&n.push({text:t.slice(i,c),hit:!1}),n.push({text:t.slice(c,c+r.length),hit:!0}),o=!0,i=c+r.length}return o?n:null}var et={};const N=[[{color:"0, 0, 0",class:"ansi-black"},{color:"187, 0, 0",class:"ansi-red"},{color:"0, 187, 0",class:"ansi-green"},{color:"187, 187, 0",class:"ansi-yellow"},{color:"0, 0, 187",class:"ansi-blue"},{color:"187, 0, 187",class:"ansi-magenta"},{color:"0, 187, 187",class:"ansi-cyan"},{color:"255,255,255",class:"ansi-white"}],[{color:"85, 85, 85",class:"ansi-bright-black"},{color:"255, 85, 85",class:"ansi-bright-red"},{color:"0, 255, 0",class:"ansi-bright-green"},{color:"255, 255, 85",class:"ansi-bright-yellow"},{color:"85, 85, 255",class:"ansi-bright-blue"},{color:"255, 85, 255",class:"ansi-bright-magenta"},{color:"85, 255, 255",class:"ansi-bright-cyan"},{color:"255, 255, 255",class:"ansi-bright-white"}]],Zt=/(https?:\/\/(?:[A-Za-z0-9#;/?:@=+$',_.!~*()[\]-]|&amp;|%[A-Fa-f0-9]{2})+)/gm;class I{static escapeForHtml(e){return new I().escapeForHtml(e)}static linkify(e){return new I().linkify(e)}static ansiToHtml(e,s){return new I().ansiToHtml(e,s)}static ansiToJson(e,s){return new I().ansiToJson(e,s)}static ansiToText(e){return new I().ansiToText(e)}constructor(){this.fg=this.bg=this.fg_truecolor=this.bg_truecolor=null,this.bright=0,this.decorations=[]}setupPalette(){this.PALETTE_COLORS=[];for(let n=0;n<2;++n)for(let i=0;i<8;++i)this.PALETTE_COLORS.push(N[n][i].color);let e=[0,95,135,175,215,255],s=(n,i,o)=>e[n]+", "+e[i]+", "+e[o];for(let n=0;n<6;++n)for(let i=0;i<6;++i)for(let o=0;o<6;++o)this.PALETTE_COLORS.push(s(n,i,o));let r=8;for(let n=0;n<24;++n,r+=10)this.PALETTE_COLORS.push(r+", "+r+", "+r)}escapeForHtml(e){return e.replace(/[&<>\"]/gm,s=>s=="&"?"&amp;":s=='"'?"&quot;":s=="<"?"&lt;":s==">"?"&gt;":"")}linkify(e){return e.replace(Zt,s=>`<a href="${s}">${s}</a>`)}ansiToHtml(e,s){return this.process(e,s,!0)}ansiToJson(e,s){return s=s||{},s.json=!0,s.clearLine=!1,this.process(e,s,!0)}ansiToText(e){return this.process(e,{},!1)}process(e,s,r){let n=this,i=e.split(/\033\[/),o=i.shift();s==null&&(s={}),s.clearLine=/\r/.test(e);let c=i.map(d=>this.processChunk(d,s,r));if(s&&s.json){let d=n.processChunkJson("");return d.content=o,d.clearLine=s.clearLine,c.unshift(d),s.remove_empty&&(c=c.filter(a=>!a.isEmpty())),c}else c.unshift(o);return c.join("")}processChunkJson(e,s,r){s=typeof s>"u"?{}:s;let n=s.use_classes=typeof s.use_classes<"u"&&s.use_classes,i=s.key=n?"class":"color",o={content:e,fg:null,bg:null,fg_truecolor:null,bg_truecolor:null,isInverted:!1,clearLine:s.clearLine,decoration:null,decorations:[],was_processed:!1,isEmpty:()=>!o.content},c=e.match(/^([!\x3c-\x3f]*)([\d;]*)([\x20-\x2c]*[\x40-\x7e])([\s\S]*)/m);if(!c)return o;o.content=c[4];let d=c[2].split(";");if(c[1]!==""||c[3]!=="m"||!r)return o;let a=this;for(;d.length>0;){let m=d.shift(),_=parseInt(m);if(isNaN(_)||_===0)a.fg=a.bg=null,a.decorations=[];else if(_===1)a.decorations.push("bold");else if(_===2)a.decorations.push("dim");else if(_===3)a.decorations.push("italic");else if(_===4)a.decorations.push("underline");else if(_===5)a.decorations.push("blink");else if(_===7)a.decorations.push("reverse");else if(_===8)a.decorations.push("hidden");else if(_===9)a.decorations.push("strikethrough");else if(_===21)a.removeDecoration("bold");else if(_===22)a.removeDecoration("bold"),a.removeDecoration("dim");else if(_===23)a.removeDecoration("italic");else if(_===24)a.removeDecoration("underline");else if(_===25)a.removeDecoration("blink");else if(_===27)a.removeDecoration("reverse");else if(_===28)a.removeDecoration("hidden");else if(_===29)a.removeDecoration("strikethrough");else if(_===39)a.fg=null;else if(_===49)a.bg=null;else if(_>=30&&_<38)a.fg=N[0][_%10][i];else if(_>=90&&_<98)a.fg=N[1][_%10][i];else if(_>=40&&_<48)a.bg=N[0][_%10][i];else if(_>=100&&_<108)a.bg=N[1][_%10][i];else if(_===38||_===48){let v=_===38;if(d.length>=1){let y=d.shift();if(y==="5"&&d.length>=1){let F=parseInt(d.shift());if(F>=0&&F<=255)if(!n)this.PALETTE_COLORS||a.setupPalette(),v?a.fg=this.PALETTE_COLORS[F]:a.bg=this.PALETTE_COLORS[F];else{let w=F>=16?"ansi-palette-"+F:N[F>7?1:0][F%8].class;v?a.fg=w:a.bg=w}}else if(y==="2"&&d.length>=3){let F=parseInt(d.shift()),w=parseInt(d.shift()),B=parseInt(d.shift());if(F>=0&&F<=255&&w>=0&&w<=255&&B>=0&&B<=255){let A=F+", "+w+", "+B;n?v?(a.fg="ansi-truecolor",a.fg_truecolor=A):(a.bg="ansi-truecolor",a.bg_truecolor=A):v?a.fg=A:a.bg=A}}}}}return a.fg===null&&a.bg===null&&a.decorations.length===0||(o.fg=a.fg,o.bg=a.bg,o.fg_truecolor=a.fg_truecolor,o.bg_truecolor=a.bg_truecolor,o.decorations=a.decorations,o.decoration=a.decorations.slice(-1).pop()||null,o.was_processed=!0),o}processChunk(e,s,r){s=s||{};let n=this.processChunkJson(e,s,r),i=s.use_classes;if(n.decorations=n.decorations.filter(_=>{if(_==="reverse"){n.fg||(n.fg=N[0][7][i?"class":"color"]),n.bg||(n.bg=N[0][0][i?"class":"color"]);let v=n.fg;n.fg=n.bg,n.bg=v;let y=n.fg_truecolor;return n.fg_truecolor=n.bg_truecolor,n.bg_truecolor=y,n.isInverted=!0,!1}return!0}),s.json)return n;if(n.isEmpty())return"";if(!n.was_processed)return n.content;let o=[],c=[],d=[],a={},m=_=>{let v=[],y;for(y in _)_.hasOwnProperty(y)&&v.push("data-"+y+'="'+this.escapeForHtml(_[y])+'"');return v.length>0?" "+v.join(" "):""};return n.isInverted&&(a["ansi-is-inverted"]="true"),n.fg&&(i?(o.push(n.fg+"-fg"),n.fg_truecolor!==null&&(a["ansi-truecolor-fg"]=n.fg_truecolor,n.fg_truecolor=null)):o.push("color:rgb("+n.fg+")")),n.bg&&(i?(o.push(n.bg+"-bg"),n.bg_truecolor!==null&&(a["ansi-truecolor-bg"]=n.bg_truecolor,n.bg_truecolor=null)):o.push("background-color:rgb("+n.bg+")")),n.decorations.forEach(_=>{if(i){c.push("ansi-"+_);return}_==="bold"?c.push("font-weight:bold"):_==="dim"?c.push("opacity:0.5"):_==="italic"?c.push("font-style:italic"):_==="hidden"?c.push("visibility:hidden"):_==="strikethrough"?d.push("line-through"):d.push(_)}),d.length&&c.push("text-decoration:"+d.join(" ")),i?'<span class="'+o.concat(c).join(" ")+'"'+m(a)+">"+n.content+"</span>":'<span style="'+o.concat(c).join(";")+'"'+m(a)+">"+n.content+"</span>"}removeDecoration(e){const s=this.decorations.indexOf(e);s>=0&&this.decorations.splice(s,1)}}var Ht=I,ie={exports:{}};function Ce(t){if(!t)return"";if(!/\r/.test(t))return t;for(t=t.replace(/\r+\n/gm,`
2
2
  `);/\r./.test(t);)t=t.replace(/^([^\r\n]*)\r+([^\r\n]+)/gm,function(e,s,r){return r+s.slice(r.length)});return t}function qt(t){for(var e=0,s=0;s<t.length;s++)t[e].length<=t[s].length&&(e=s);return e}function He(t){if(!/\r/.test(t))return t;for(var e=t.split("\r"),s=[];e.length>0;){var r=qt(e);s.push(e[r]),e=e.slice(r+1)}return s.join("\r")}function Yt(t){if(!t)return"";if(!/\r/.test(t))return t;if(!/\n/.test(t))return He(t);t=t.replace(/\r+\n/gm,`
3
3
  `);var e=t.lastIndexOf(`
4
4
  `);return Ce(t.slice(0,e))+`
5
- `+He(t.slice(e+1))}ie.exports=Ce;ie.exports.escapeCarriageReturn=Ce;ie.exports.escapeCarriageReturnSafe=Yt;var Jt=ie.exports,me,qe;function Wt(){return qe||(qe=1,me=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/),me}var pe,Ye;function Gt(){return Ye||(Ye=1,pe=/[\0-\x1F\x7F-\x9F]/),pe}var xe,Je;function Ut(){return Je||(Je=1,xe=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/),xe}var De,We;function Vt(){return We||(We=1,De=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/),De}var be,Ge;function Qt(){return Ge||(Ge=1,be=function(t){var e={};e.src_Any=Wt().source,e.src_Cc=Gt().source,e.src_Z=Ut().source,e.src_P=Vt().source,e.src_ZPCc=[e.src_Z,e.src_P,e.src_Cc].join("|"),e.src_ZCc=[e.src_Z,e.src_Cc].join("|");var s="[><|]";return e.src_pseudo_letter="(?:(?!"+s+"|"+e.src_ZPCc+")"+e.src_Any+")",e.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",e.src_auth="(?:(?:(?!"+e.src_ZCc+"|[@/\\[\\]()]).)+@)?",e.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",e.src_host_terminator="(?=$|"+s+"|"+e.src_ZPCc+")(?!-|_|:\\d|\\.-|\\.(?!$|"+e.src_ZPCc+"))",e.src_path="(?:[/?#](?:(?!"+e.src_ZCc+"|"+s+`|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+e.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+e.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+e.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+e.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+e.src_ZCc+"|[']).)+\\'|\\'(?="+e.src_pseudo_letter+"|[-]).|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+e.src_ZCc+"|[.]).|"+(t&&t["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+e.src_ZCc+").|;(?!"+e.src_ZCc+").|\\!+(?!"+e.src_ZCc+"|[!]).|\\?(?!"+e.src_ZCc+"|[?]).)+|\\/)?",e.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',e.src_xn="xn--[a-z0-9\\-]{1,59}",e.src_domain_root="(?:"+e.src_xn+"|"+e.src_pseudo_letter+"{1,63})",e.src_domain="(?:"+e.src_xn+"|(?:"+e.src_pseudo_letter+")|(?:"+e.src_pseudo_letter+"(?:-|"+e.src_pseudo_letter+"){0,61}"+e.src_pseudo_letter+"))",e.src_host="(?:(?:(?:(?:"+e.src_domain+")\\.)*"+e.src_domain+"))",e.tpl_host_fuzzy="(?:"+e.src_ip4+"|(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%)))",e.tpl_host_no_ip_fuzzy="(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%))",e.src_host_strict=e.src_host+e.src_host_terminator,e.tpl_host_fuzzy_strict=e.tpl_host_fuzzy+e.src_host_terminator,e.src_host_port_strict=e.src_host+e.src_port+e.src_host_terminator,e.tpl_host_port_fuzzy_strict=e.tpl_host_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_port_no_ip_fuzzy_strict=e.tpl_host_no_ip_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+e.src_ZPCc+"|>|$))",e.tpl_email_fuzzy="(^|"+s+'|"|\\(|'+e.src_ZCc+")("+e.src_email_name+"@"+e.tpl_host_fuzzy_strict+")",e.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_fuzzy_strict+e.src_path+")",e.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_no_ip_fuzzy_strict+e.src_path+")",e}),be}function ve(t){var e=Array.prototype.slice.call(arguments,1);return e.forEach(function(s){s&&Object.keys(s).forEach(function(r){t[r]=s[r]})}),t}function ue(t){return Object.prototype.toString.call(t)}function Xt(t){return ue(t)==="[object String]"}function Kt(t){return ue(t)==="[object Object]"}function es(t){return ue(t)==="[object RegExp]"}function Ue(t){return ue(t)==="[object Function]"}function ts(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var tt={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function ss(t){return Object.keys(t||{}).reduce(function(e,s){return e||tt.hasOwnProperty(s)},!1)}var rs={"http:":{validate:function(t,e,s){var r=t.slice(e);return s.re.http||(s.re.http=new RegExp("^\\/\\/"+s.re.src_auth+s.re.src_host_port_strict+s.re.src_path,"i")),s.re.http.test(r)?r.match(s.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(t,e,s){var r=t.slice(e);return s.re.no_http||(s.re.no_http=new RegExp("^"+s.re.src_auth+"(?:localhost|(?:(?:"+s.re.src_domain+")\\.)+"+s.re.src_domain_root+")"+s.re.src_port+s.re.src_host_terminator+s.re.src_path,"i")),s.re.no_http.test(r)?e>=3&&t[e-3]===":"||e>=3&&t[e-3]==="/"?0:r.match(s.re.no_http)[0].length:0}},"mailto:":{validate:function(t,e,s){var r=t.slice(e);return s.re.mailto||(s.re.mailto=new RegExp("^"+s.re.src_email_name+"@"+s.re.src_host_strict,"i")),s.re.mailto.test(r)?r.match(s.re.mailto)[0].length:0}}},ns="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",is="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function us(t){t.__index__=-1,t.__text_cache__=""}function cs(t){return function(e,s){var r=e.slice(s);return t.test(r)?r.match(t)[0].length:0}}function Ve(){return function(t,e){e.normalize(t)}}function ne(t){var e=t.re=Qt()(t.__opts__),s=t.__tlds__.slice();t.onCompile(),t.__tlds_replaced__||s.push(ns),s.push(e.src_xn),e.src_tlds=s.join("|");function r(o){return o.replace("%TLDS%",e.src_tlds)}e.email_fuzzy=RegExp(r(e.tpl_email_fuzzy),"i"),e.link_fuzzy=RegExp(r(e.tpl_link_fuzzy),"i"),e.link_no_ip_fuzzy=RegExp(r(e.tpl_link_no_ip_fuzzy),"i"),e.host_fuzzy_test=RegExp(r(e.tpl_host_fuzzy_test),"i");var n=[];t.__compiled__={};function i(o,d){throw new Error('(LinkifyIt) Invalid schema "'+o+'": '+d)}Object.keys(t.__schemas__).forEach(function(o){var d=t.__schemas__[o];if(d!==null){var a={validate:null,link:null};if(t.__compiled__[o]=a,Kt(d)){es(d.validate)?a.validate=cs(d.validate):Ue(d.validate)?a.validate=d.validate:i(o,d),Ue(d.normalize)?a.normalize=d.normalize:d.normalize?i(o,d):a.normalize=Ve();return}if(Xt(d)){n.push(o);return}i(o,d)}}),n.forEach(function(o){t.__compiled__[t.__schemas__[o]]&&(t.__compiled__[o].validate=t.__compiled__[t.__schemas__[o]].validate,t.__compiled__[o].normalize=t.__compiled__[t.__schemas__[o]].normalize)}),t.__compiled__[""]={validate:null,normalize:Ve()};var c=Object.keys(t.__compiled__).filter(function(o){return o.length>0&&t.__compiled__[o]}).map(ts).join("|");t.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+c+")","i"),t.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+c+")","ig"),t.re.pretest=RegExp("("+t.re.schema_test.source+")|("+t.re.host_fuzzy_test.source+")|@","i"),us(t)}function os(t,e){var s=t.__index__,r=t.__last_index__,n=t.__text_cache__.slice(s,r);this.schema=t.__schema__.toLowerCase(),this.index=s+e,this.lastIndex=r+e,this.raw=n,this.text=n,this.url=n}function Qe(t,e){var s=new os(t,e);return t.__compiled__[s.schema].normalize(s,t),s}function j(t,e){if(!(this instanceof j))return new j(t,e);e||ss(t)&&(e=t,t={}),this.__opts__=ve({},tt,e),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=ve({},rs,t),this.__compiled__={},this.__tlds__=is,this.__tlds_replaced__=!1,this.re={},ne(this)}j.prototype.add=function(e,s){return this.__schemas__[e]=s,ne(this),this};j.prototype.set=function(e){return this.__opts__=ve(this.__opts__,e),this};j.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;var s,r,n,i,c,o,d,a,m;if(this.re.schema_test.test(e)){for(d=this.re.schema_search,d.lastIndex=0;(s=d.exec(e))!==null;)if(i=this.testSchemaAt(e,s[2],d.lastIndex),i){this.__schema__=s[2],this.__index__=s.index+s[1].length,this.__last_index__=s.index+s[0].length+i;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(a=e.search(this.re.host_fuzzy_test),a>=0&&(this.__index__<0||a<this.__index__)&&(r=e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(c=r.index+r[1].length,(this.__index__<0||c<this.__index__)&&(this.__schema__="",this.__index__=c,this.__last_index__=r.index+r[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(m=e.indexOf("@"),m>=0&&(n=e.match(this.re.email_fuzzy))!==null&&(c=n.index+n[1].length,o=n.index+n[0].length,(this.__index__<0||c<this.__index__||c===this.__index__&&o>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=c,this.__last_index__=o))),this.__index__>=0};j.prototype.pretest=function(e){return this.re.pretest.test(e)};j.prototype.testSchemaAt=function(e,s,r){return this.__compiled__[s.toLowerCase()]?this.__compiled__[s.toLowerCase()].validate(e,r,this):0};j.prototype.match=function(e){var s=0,r=[];this.__index__>=0&&this.__text_cache__===e&&(r.push(Qe(this,s)),s=this.__last_index__);for(var n=s?e.slice(s):e;this.test(n);)r.push(Qe(this,s)),n=n.slice(this.__last_index__),s+=this.__last_index__;return r.length?r:null};j.prototype.tlds=function(e,s){return e=Array.isArray(e)?e:[e],s?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(r,n,i){return r!==i[n-1]}).reverse(),ne(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,ne(this),this)};j.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url="mailto:"+e.url)};j.prototype.onCompile=function(){};var as=j,ls=S&&S.__createBinding||(Object.create?function(t,e,s,r){r===void 0&&(r=s);var n=Object.getOwnPropertyDescriptor(e,s);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[s]}}),Object.defineProperty(t,r,n)}:function(t,e,s,r){r===void 0&&(r=s),t[r]=e[s]}),fs=S&&S.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),_s=S&&S.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(s){var r=[];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(r[r.length]=n);return r},t(e)};return function(e){if(e&&e.__esModule)return e;var s={};if(e!=null)for(var r=t(e),n=0;n<r.length;n++)r[n]!=="default"&&ls(s,e,r[n]);return fs(s,e),s}}(),st=S&&S.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(et,"__esModule",{value:!0});var ds=et.default=ys;const hs=st(Ht),gs=Jt,ms=st(as),R=_s(h);function ps(t,e=!1){return t=(0,gs.escapeCarriageReturn)(Es(t)),hs.default.ansiToJson(t,{json:!0,remove_empty:!0,use_classes:e})}function xs(t){let e="";return t.bg&&(e+=`${t.bg}-bg `),t.fg&&(e+=`${t.fg}-fg `),t.decoration&&(e+=`ansi-${t.decoration} `),e===""?null:(e=e.substring(0,e.length-1),e)}function Ds(t){const e={};switch(t.bg&&(e.backgroundColor=`rgb(${t.bg})`),t.fg&&(e.color=`rgb(${t.fg})`),t.decoration){case"bold":e.fontWeight="bold";break;case"dim":e.opacity="0.5";break;case"italic":e.fontStyle="italic";break;case"hidden":e.visibility="hidden";break;case"strikethrough":e.textDecoration="line-through";break;case"underline":e.textDecoration="underline";break;case"blink":e.textDecoration="blink";break}return e}function bs(t,e,s,r){const n=e?null:Ds(s),i=e?xs(s):null;return t?t==="fuzzy"?vs(s,r,n,i):Fs(s,r,n,i):R.createElement("span",{style:n,key:r,className:i},s.content)}function Fs(t,e,s,r){const n=[],i=/(\s|^)(https?:\/\/(?:www\.|(?!www))[^\s.]+\.[^\s]{2,}|www\.[^\s]+\.[^\s]{2,})/g;let c=0,o;for(;(o=i.exec(t.content))!==null;){const[,d,a]=o,m=o.index+d.length;m>c&&n.push(t.content.substring(c,m));const _=a.startsWith("www.")?`http://${a}`:a;n.push(R.createElement("a",{key:c,href:_,target:"_blank"},`${a}`)),c=i.lastIndex}return c<t.content.length&&n.push(t.content.substring(c)),R.createElement("span",{style:s,key:e,className:r},n)}function vs(t,e,s,r){var n;const i=(0,ms.default)({fuzzyEmail:!1}).tlds(["io"],!0);if(!i.pretest(t.content))return R.createElement("span",{style:s,key:e,className:r},t.content);const c=i.match(t.content);if(!c)return R.createElement("span",{style:s,key:e,className:r},t.content);const o=[t.content.substring(0,(n=c[0])===null||n===void 0?void 0:n.index)];return c.forEach((d,a)=>{var m;o.push(R.createElement("a",{href:d.url,target:"_blank",key:a},t.content.substring(d.index,d.lastIndex))),c[a+1]&&o.push(t.content.substring(c[a].lastIndex,(m=c[a+1])===null||m===void 0?void 0:m.index))}),c[c.length-1].lastIndex!==t.content.length&&o.push(t.content.substring(c[c.length-1].lastIndex,t.content.length)),R.createElement("span",{style:s,key:e,className:r},o)}function ys(t){const{className:e,useClasses:s,children:r,linkify:n}=t;return R.createElement("code",{className:e},ps(r??"",s??!1).map(bs.bind(null,n??!1,s??!1)))}function Es(t){let e=t;do t=e,e=t.replace(/[^\n]\x08/gm,"");while(e.length<t.length);return t}const Cs=h.memo(function({line:e,query:s=""}){const r=e.text.replace(/\r?\n$/,""),n=s?Pt(r,s):null;return f.jsx("div",{className:"whitespace-pre-wrap break-all min-h-[1.25rem]",children:/\x1b\[/.test(r)?f.jsx(ds,{children:r}):n?n.map((i,c)=>i.hit?f.jsx("mark",{className:"bg-warning/40 text-inherit",children:i.text},c):f.jsx("span",{className:Fe(r),children:i.text},c)):f.jsx("span",{className:Fe(r),children:r})})}),js=[{key:"all",label:"全部"},{key:"text-info",label:"信息"},{key:"text-warning",label:"警告"},{key:"text-destructive",label:"错误"},{key:"text-success",label:"成功"}],Xe={start:"启动",stop:"停止",clear:"清屏"},ws=3e3;function As(t){const e=$t({start:0,end:t}),s=e.hours??0,r=e.minutes??0,n=e.seconds??0;return s===0&&r===0?`${n}s`:s===0?`${r}m${n}s`:`${s}h${r}m`}function Ke({startedAt:t,className:e}){const[,s]=h.useState(0);return h.useEffect(()=>{const r=setInterval(()=>s(n=>n+1),1e3);return()=>clearInterval(r)},[]),f.jsx("span",{className:e,children:As(Math.max(0,Date.now()-t))})}function zs({params:t,values:e,onChange:s,onSubmit:r,onCancel:n}){return f.jsxs("div",{"data-testid":"param-panel",onClick:i=>i.stopPropagation(),className:"flex flex-wrap items-center gap-2 px-3.5 py-2 border-b bg-card text-sm",children:[t.map(i=>f.jsxs("label",{className:"inline-flex items-center gap-1 text-xs",children:[f.jsx("span",{className:"font-mono text-muted-foreground",children:i}),f.jsx("input",{"aria-label":i,placeholder:i,value:e[i]??"",onChange:c=>s(i,c.target.value),className:"h-6 w-32 rounded-[var(--radius-md)] border bg-transparent px-1.5 font-mono placeholder:text-muted-foreground/50 focus:border-muted-foreground/50"})]},i)),f.jsx($,{variant:"ghost",className:"h-6 gap-1 px-2 text-sm text-success",onClick:r,children:"启动"}),f.jsx($,{variant:"ghost",className:"h-6 gap-1 px-2 text-sm",onClick:n,children:"取消"})]})}function ks({selected:t,onSelect:e}){const s=typeof e=="function",[r,n]=h.useState(null),i=s?t??null:r,c=u=>{s?e(u):n(u)},o=bt("just:/__just/recipes",()=>$e("/__just/recipes",{cache:"no-store"}),{subscribe:"plugin:just:state"}),d=o.data??[],a=!o.loading&&o.error===null&&d.length===0,[m,_]=h.useState(null);h.useEffect(()=>{if(!a){_(null);return}_(null);let u=!1;return $e("/__just/status",{cache:"no-store"}).then(l=>{u||_(l)}).catch(()=>{u||_({installed:!0,hasJustfile:!1})}),()=>{u=!0}},[a]);const[v,y]=h.useState({}),[b,w]=h.useState({}),B=h.useRef(""),A=h.useRef(null),O=i?b[i]??[]:[],{icon:T}=ht(),q=h.useRef(!0),L=h.useRef(0),[je,U]=h.useState(0),we=h.useRef(i);h.useEffect(()=>{we.current=i});const P=h.useRef(new Map),rt=h.useRef(0),Z=h.useRef(!1),M=h.useRef(null);h.useEffect(()=>{const u=()=>{var Te;Z.current=!1;const F=P.current;if(F.size===0)return;P.current=new Map;const p=new Map;for(const[k,H]of F)p.set(k,H.map(ee=>({seq:++rt.current,text:ee})));w(k=>{const H={...k};for(const[ee,dt]of p){const he=(H[ee]??[]).concat(dt);H[ee]=he.length>se?he.slice(-se):he}return H});const E=we.current,J=E?((Te=p.get(E))==null?void 0:Te.length)??0:0;if(J>0){const k=A.current;!k||Ze(k.scrollHeight,k.scrollTop,k.clientHeight)?q.current=!0:L.current+=J,U(L.current)}},l=()=>{Z.current&&(Z.current=!1,M.current!==null&&(clearTimeout(M.current),M.current=null),u())},g=()=>{Z.current||(Z.current=!0,typeof requestAnimationFrame=="function"&&requestAnimationFrame(l),M.current=setTimeout(l,50))};fetch("/__config").then(F=>F.json()).then(F=>{B.current=F.stopToken??""}).catch(()=>{});const D=new EventSource("/__just/logs");let C=!0;return D.onopen=()=>{if(C){C=!1;return}P.current.clear(),w({}),y({})},D.onmessage=F=>{try{const p=JSON.parse(F.data);if(p.type==="log"){const E=P.current.get(p.recipe);E?E.push(p.text):P.current.set(p.recipe,[p.text]),g()}else p.type==="clear"?(P.current.delete(p.recipe),w(E=>({...E,[p.recipe]:[]}))):p.type==="state"&&(y(E=>{var J;return{...E,[p.recipe]:{state:p.state,code:p.code,signal:p.signal,startedAt:p.startedAt??((J=E[p.recipe])==null?void 0:J.startedAt)??Date.now()}}}),oe(E=>E[p.recipe]?{...E,[p.recipe]:void 0}:E),p.state==="running"&&!s&&c(p.recipe))}catch{}},D.onerror=()=>{},()=>{D.close(),M.current!==null&&(clearTimeout(M.current),M.current=null),Z.current=!1}},[]);const Ae=h.useRef(i);h.useEffect(()=>{const u=A.current,l=Ae.current!==i;Ae.current=i,u&&(q.current||l)&&(q.current=!0,u.scrollTop=u.scrollHeight-u.clientHeight,L.current!==0&&(L.current=0,U(0)))},[O.length,i]);const nt=()=>{const u=A.current;if(!u)return;const l=Ze(u.scrollHeight,u.scrollTop,u.clientHeight);q.current=l,l&&L.current!==0&&(L.current=0,U(0))},it=()=>{const u=A.current;u&&(u.scrollTop=u.scrollHeight-u.clientHeight,q.current=!0,L.current=0,U(0))},[ce,ut]=h.useState(""),[V,ct]=h.useState("");h.useEffect(()=>{const u=setTimeout(()=>ct(ce),150);return()=>clearTimeout(u)},[ce]);const[Q,ot]=h.useState("all"),ze=h.useMemo(()=>{let u=O;if(Q!=="all"&&(u=u.filter(l=>Fe(l.text.replace(/\r?\n$/,""))===Q)),V){const l=V.toLowerCase();u=u.filter(g=>g.text.toLowerCase().includes(l))}return u},[O,Q,V]),[X,oe]=h.useState({}),ae=u=>oe(l=>l[u]?{...l,[u]:void 0}:l),Y=async(u,l,g)=>{u!=="clear"&&oe(D=>({...D,[l]:u}));try{const D=await fetch(`/__just/${u}`,{method:"POST",headers:{"x-stop-token":B.current,"Content-Type":"application/json"},body:JSON.stringify({recipe:l,...u==="start"&&g?{args:g}:{}})});if(!D.ok){let C="";try{const F=await D.json();typeof(F==null?void 0:F.error)=="string"&&F.error&&(C=`:${F.error}`)}catch{}return te.error(`just ${l} ${Xe[u]}失败${C||`(HTTP ${D.status})`}`),u!=="clear"&&ae(l),!1}return u==="clear"?(te.success(`已清屏 ${l}`),!0):(setTimeout(()=>ae(l),ws),te.success(u==="start"?`已启动 ${l}`:`已停止 ${l}`),!0)}catch{return te.error(`just ${l} ${Xe[u]}失败:网络异常`),u!=="clear"&&ae(l),!1}},le=d.map(u=>({...u,task:v[u.name]})),ke=le.filter(u=>{var l;return((l=u.task)==null?void 0:l.state)==="running"}).length,z=i?v[i]:void 0,fe=(z==null?void 0:z.state)==="running",[_e,de]=h.useState(null),[Ne,K]=h.useState({}),Re=u=>{var g;const l=((g=d.find(D=>D.name===u))==null?void 0:g.params)??[];if(l.length===0){Y("start",u);return}K(Object.fromEntries(l.map(D=>[D,""]))),de(u)},at=()=>{if(!_e)return;const u=Object.entries(Ne).filter(([,l])=>l!=="");Y("start",_e,u.length>0?Object.fromEntries(u):void 0),de(null),K({})},lt=()=>{de(null),K({})},Se=u=>{var l;return _e===u?f.jsx(zs,{params:((l=d.find(g=>g.name===u))==null?void 0:l.params)??[],values:Ne,onChange:(g,D)=>K(C=>({...C,[g]:D})),onSubmit:at,onCancel:lt}):null},Oe=(u,l,g)=>u?"bg-success animate-pulse":l?g!=null&&g.signal?"bg-muted-foreground":g!=null&&g.code?"bg-destructive":"bg-success/60":"bg-muted-foreground/30",ft={key:"__console__",label:"总控台",badge:f.jsx("span",{className:"font-mono opacity-80",children:ke>0?ke:""}),className:i===null?"":"border-border text-muted-foreground hover:text-foreground hover:border-muted-foreground/40",renderLabel:()=>f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[f.jsx("span",{className:"h-3 w-3",children:T("monitor","h-3 w-3")}),f.jsx("span",{children:"总控台"})]})},_t=d.map(u=>{const l=v[u.name],g=(l==null?void 0:l.state)==="running",D=(l==null?void 0:l.state)==="exited",C=i===u.name;return{key:u.name,label:u.name,className:C?"":g?"border-success/40 bg-success/10 text-success hover:bg-success/20":"",renderLabel:()=>f.jsxs(f.Fragment,{children:[f.jsx("span",{className:`h-1.5 w-1.5 rounded-[var(--radius-full)] ${Oe(g,D,l)}`}),f.jsx("span",{children:u.name})]}),renderExtra:()=>D&&!C?f.jsx("span",{className:`text-xs ${l!=null&&l.signal?"opacity-60":l!=null&&l.code?"text-destructive":"text-success"}`,children:l!=null&&l.signal?"停":l==null?void 0:l.code}):void 0}});return f.jsxs("div",{className:"h-full flex flex-col",children:[f.jsx("div",{className:"flex-none flex items-center gap-1.5 flex-wrap px-3 py-2 border-b bg-background",children:f.jsx(Me,{items:[ft,..._t],value:i??"__console__",onChange:u=>c(u==="__console__"?null:u),ariaLabel:"任务筛选"})}),i===null?f.jsx("div",{className:"flex-1 min-h-0 flex flex-col",children:o.loading&&!o.data?f.jsx(Le,{rows:4,className:"m-3"}):o.error?f.jsx(gt,{message:o.error,onRetry:o.reload}):le.length===0?m?f.jsx(mt,{title:m.installed?m.hasJustfile?"justfile 中未发现可运行 recipe":"未发现 justfile":"未安装 just",hint:m.installed?m.hasJustfile?"justfile 存在但未解析到可展示的 recipe,检查 recipe 定义":"在项目根目录放置 justfile,即可在这里查看与启停任务":"未检测到 just 命令,安装 just 后即可在这里查看与启停任务"}):f.jsx(Le,{rows:4,className:"m-3"}):f.jsx("div",{className:"flex-1 min-h-0 overflow-auto p-3 grid gap-2.5 grid-cols-1 md:grid-cols-2 xl:grid-cols-3 content-start",children:le.map(u=>{const l=u.task,g=(l==null?void 0:l.state)==="running",D=(l==null?void 0:l.state)==="exited",C=(b[u.name]??[]).slice(-3).map(F=>F.text.replace(/\r?\n$/,"").replace(/\x1b\[[0-9;]*m/g,""));return f.jsxs("div",{onClick:()=>c(u.name),className:"group rounded-[var(--radius-lg)] border bg-card p-3 cursor-pointer hover:border-muted-foreground/40 transition-colors",children:[f.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[f.jsx("span",{className:`h-2 w-2 rounded-[var(--radius-full)] flex-none ${Oe(g,D,l)}`}),f.jsx("span",{className:"font-mono font-medium",children:u.name}),g&&f.jsx(Ke,{startedAt:l.startedAt,className:"text-success font-mono"}),D&&f.jsx("span",{className:`font-mono ${l.signal?"text-muted-foreground":l.code?"text-destructive":"text-success"}`,children:l.signal?"已停止":`exit ${l.code}`}),!l&&f.jsx("span",{className:"text-muted-foreground/60",children:"未运行"}),f.jsx("span",{className:"ml-auto flex items-center gap-1",onClick:F=>F.stopPropagation(),children:g?f.jsxs($,{variant:"ghost",className:"h-6 gap-1 px-2 text-sm",disabled:!!X[u.name],onClick:()=>Y("stop",u.name),children:[T("square","h-2.5 w-2.5"),"停止"]}):f.jsxs($,{variant:"ghost",className:"h-6 gap-1 px-2 text-sm",disabled:!!X[u.name],onClick:()=>Re(u.name),children:[T(D?"rotate-cw":"play","h-2.5 w-2.5"),D?"重跑":"启动"]})})]}),Se(u.name),u.description&&f.jsx("p",{className:"mt-1 text-sm text-muted-foreground/70 truncate",children:u.description}),f.jsx("div",{className:"mt-2 rounded bg-terminal-bg px-2 py-1.5 font-mono text-xs leading-relaxed text-terminal-fg/70 min-h-[3.4em]",children:C.length?C.map((F,p)=>f.jsx("div",{className:"truncate",children:F},p)):f.jsxs("span",{className:"text-terminal-fg/40",children:["$ just ",u.name," …"]})})]},u.name)})})}):f.jsxs("div",{className:"flex-1 min-h-0 flex flex-col",children:[f.jsxs("div",{className:"flex-none flex items-center gap-2 px-3.5 h-8 border-b bg-background text-sm",children:[f.jsx("span",{className:`h-1.5 w-1.5 rounded-[var(--radius-full)] ${fe?"bg-success animate-pulse":"bg-muted-foreground"}`}),f.jsx("span",{className:"font-mono font-medium",children:i}),f.jsx("span",{className:"text-muted-foreground font-mono",children:fe?f.jsxs(f.Fragment,{children:["running · ",f.jsx(Ke,{startedAt:z.startedAt})]}):z!=null&&z.signal?"已停止":z?`exit ${z.code}`:"未运行"}),f.jsxs("span",{className:"ml-auto flex items-center gap-1",children:[fe?f.jsxs($,{variant:"ghost",className:"h-6 gap-1 px-2 text-sm",disabled:!!X[i],onClick:()=>Y("stop",i),children:[T("square","h-2.5 w-2.5"),"停止"]}):f.jsxs($,{variant:"ghost",className:"h-6 gap-1 px-2 text-sm",disabled:!!X[i],onClick:()=>Re(i),children:[T("rotate-cw","h-2.5 w-2.5"),z?"重跑":"启动"]}),f.jsxs($,{variant:"ghost",className:"h-6 gap-1 px-2 text-sm",onClick:()=>Y("clear",i),disabled:!O.length,children:[T("eraser","h-2.5 w-2.5"),"清屏"]}),f.jsx("span",{className:"text-muted-foreground font-mono ml-1",children:O.length>=se?`${se}+ 行`:`${O.length} 行`})]})]}),Se(i),f.jsxs("div",{className:"flex-none flex items-center gap-2 px-3.5 py-1.5 border-b bg-background",children:[f.jsx("input",{value:ce,onChange:u=>ut(u.target.value),placeholder:"搜索日志…","aria-label":"搜索日志",className:"h-6 w-40 rounded-[var(--radius-md)] border bg-transparent px-2 text-xs font-mono placeholder:text-muted-foreground/50 focus:border-muted-foreground/50"}),f.jsx(Me,{items:js,value:Q,onChange:ot,ariaLabel:"日志级别"})]}),f.jsxs("div",{className:"relative flex-1 min-h-0",children:[f.jsxs("div",{ref:A,"data-testid":"log-scroll",role:"log","aria-live":"polite","aria-label":"日志输出",tabIndex:0,onScroll:nt,className:"h-full overflow-auto bg-terminal-bg p-3.5 font-mono text-xs leading-relaxed text-terminal-fg",children:[ze.length===0&&f.jsx("p",{className:"text-terminal-fg/50",children:O.length===0?`$ just ${i} · 等待输出…`:"无匹配行"}),ze.map(u=>f.jsx(Cs,{line:u,query:V},u.seq))]}),je>0&&f.jsxs("button",{type:"button",onClick:it,className:"absolute bottom-3 right-4 inline-flex items-center gap-1 h-7 px-3 rounded-[var(--radius-full)] border border-success/40 bg-success/10 text-success text-xs shadow-sm hover:bg-success/20 transition-colors",children:["↓ ",je," 行新输出"]})]})]})]})}function Bs({params:t}){const e=pt(ge.mode,"h-5 w-5"),s=xt(),r=t.get("task")??t.get("recipe");return f.jsx(Dt,{manifest:ge,icon:e,breadcrumb:["插件",ge.mode,...r?[r]:[]],children:f.jsx("div",{className:"mx-auto h-full bg-background border rounded-lg shadow-sm overflow-hidden flex flex-col",children:f.jsx(ks,{selected:r,onSelect:n=>s.navigate(n?{recipe:n,task:null}:{recipe:null,task:null})})})})}export{Bs as default};
5
+ `+He(t.slice(e+1))}ie.exports=Ce;ie.exports.escapeCarriageReturn=Ce;ie.exports.escapeCarriageReturnSafe=Yt;var Jt=ie.exports,me,qe;function Wt(){return qe||(qe=1,me=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/),me}var pe,Ye;function Gt(){return Ye||(Ye=1,pe=/[\0-\x1F\x7F-\x9F]/),pe}var xe,Je;function Ut(){return Je||(Je=1,xe=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/),xe}var De,We;function Vt(){return We||(We=1,De=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/),De}var Fe,Ge;function Qt(){return Ge||(Ge=1,Fe=function(t){var e={};e.src_Any=Wt().source,e.src_Cc=Gt().source,e.src_Z=Ut().source,e.src_P=Vt().source,e.src_ZPCc=[e.src_Z,e.src_P,e.src_Cc].join("|"),e.src_ZCc=[e.src_Z,e.src_Cc].join("|");var s="[><|]";return e.src_pseudo_letter="(?:(?!"+s+"|"+e.src_ZPCc+")"+e.src_Any+")",e.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",e.src_auth="(?:(?:(?!"+e.src_ZCc+"|[@/\\[\\]()]).)+@)?",e.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",e.src_host_terminator="(?=$|"+s+"|"+e.src_ZPCc+")(?!-|_|:\\d|\\.-|\\.(?!$|"+e.src_ZPCc+"))",e.src_path="(?:[/?#](?:(?!"+e.src_ZCc+"|"+s+`|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+e.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+e.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+e.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+e.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+e.src_ZCc+"|[']).)+\\'|\\'(?="+e.src_pseudo_letter+"|[-]).|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+e.src_ZCc+"|[.]).|"+(t&&t["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+e.src_ZCc+").|;(?!"+e.src_ZCc+").|\\!+(?!"+e.src_ZCc+"|[!]).|\\?(?!"+e.src_ZCc+"|[?]).)+|\\/)?",e.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',e.src_xn="xn--[a-z0-9\\-]{1,59}",e.src_domain_root="(?:"+e.src_xn+"|"+e.src_pseudo_letter+"{1,63})",e.src_domain="(?:"+e.src_xn+"|(?:"+e.src_pseudo_letter+")|(?:"+e.src_pseudo_letter+"(?:-|"+e.src_pseudo_letter+"){0,61}"+e.src_pseudo_letter+"))",e.src_host="(?:(?:(?:(?:"+e.src_domain+")\\.)*"+e.src_domain+"))",e.tpl_host_fuzzy="(?:"+e.src_ip4+"|(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%)))",e.tpl_host_no_ip_fuzzy="(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%))",e.src_host_strict=e.src_host+e.src_host_terminator,e.tpl_host_fuzzy_strict=e.tpl_host_fuzzy+e.src_host_terminator,e.src_host_port_strict=e.src_host+e.src_port+e.src_host_terminator,e.tpl_host_port_fuzzy_strict=e.tpl_host_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_port_no_ip_fuzzy_strict=e.tpl_host_no_ip_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+e.src_ZPCc+"|>|$))",e.tpl_email_fuzzy="(^|"+s+'|"|\\(|'+e.src_ZCc+")("+e.src_email_name+"@"+e.tpl_host_fuzzy_strict+")",e.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_fuzzy_strict+e.src_path+")",e.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_no_ip_fuzzy_strict+e.src_path+")",e}),Fe}function ve(t){var e=Array.prototype.slice.call(arguments,1);return e.forEach(function(s){s&&Object.keys(s).forEach(function(r){t[r]=s[r]})}),t}function ue(t){return Object.prototype.toString.call(t)}function Xt(t){return ue(t)==="[object String]"}function Kt(t){return ue(t)==="[object Object]"}function es(t){return ue(t)==="[object RegExp]"}function Ue(t){return ue(t)==="[object Function]"}function ts(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var tt={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function ss(t){return Object.keys(t||{}).reduce(function(e,s){return e||tt.hasOwnProperty(s)},!1)}var rs={"http:":{validate:function(t,e,s){var r=t.slice(e);return s.re.http||(s.re.http=new RegExp("^\\/\\/"+s.re.src_auth+s.re.src_host_port_strict+s.re.src_path,"i")),s.re.http.test(r)?r.match(s.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(t,e,s){var r=t.slice(e);return s.re.no_http||(s.re.no_http=new RegExp("^"+s.re.src_auth+"(?:localhost|(?:(?:"+s.re.src_domain+")\\.)+"+s.re.src_domain_root+")"+s.re.src_port+s.re.src_host_terminator+s.re.src_path,"i")),s.re.no_http.test(r)?e>=3&&t[e-3]===":"||e>=3&&t[e-3]==="/"?0:r.match(s.re.no_http)[0].length:0}},"mailto:":{validate:function(t,e,s){var r=t.slice(e);return s.re.mailto||(s.re.mailto=new RegExp("^"+s.re.src_email_name+"@"+s.re.src_host_strict,"i")),s.re.mailto.test(r)?r.match(s.re.mailto)[0].length:0}}},ns="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",is="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function us(t){t.__index__=-1,t.__text_cache__=""}function os(t){return function(e,s){var r=e.slice(s);return t.test(r)?r.match(t)[0].length:0}}function Ve(){return function(t,e){e.normalize(t)}}function ne(t){var e=t.re=Qt()(t.__opts__),s=t.__tlds__.slice();t.onCompile(),t.__tlds_replaced__||s.push(ns),s.push(e.src_xn),e.src_tlds=s.join("|");function r(c){return c.replace("%TLDS%",e.src_tlds)}e.email_fuzzy=RegExp(r(e.tpl_email_fuzzy),"i"),e.link_fuzzy=RegExp(r(e.tpl_link_fuzzy),"i"),e.link_no_ip_fuzzy=RegExp(r(e.tpl_link_no_ip_fuzzy),"i"),e.host_fuzzy_test=RegExp(r(e.tpl_host_fuzzy_test),"i");var n=[];t.__compiled__={};function i(c,d){throw new Error('(LinkifyIt) Invalid schema "'+c+'": '+d)}Object.keys(t.__schemas__).forEach(function(c){var d=t.__schemas__[c];if(d!==null){var a={validate:null,link:null};if(t.__compiled__[c]=a,Kt(d)){es(d.validate)?a.validate=os(d.validate):Ue(d.validate)?a.validate=d.validate:i(c,d),Ue(d.normalize)?a.normalize=d.normalize:d.normalize?i(c,d):a.normalize=Ve();return}if(Xt(d)){n.push(c);return}i(c,d)}}),n.forEach(function(c){t.__compiled__[t.__schemas__[c]]&&(t.__compiled__[c].validate=t.__compiled__[t.__schemas__[c]].validate,t.__compiled__[c].normalize=t.__compiled__[t.__schemas__[c]].normalize)}),t.__compiled__[""]={validate:null,normalize:Ve()};var o=Object.keys(t.__compiled__).filter(function(c){return c.length>0&&t.__compiled__[c]}).map(ts).join("|");t.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+o+")","i"),t.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+o+")","ig"),t.re.pretest=RegExp("("+t.re.schema_test.source+")|("+t.re.host_fuzzy_test.source+")|@","i"),us(t)}function cs(t,e){var s=t.__index__,r=t.__last_index__,n=t.__text_cache__.slice(s,r);this.schema=t.__schema__.toLowerCase(),this.index=s+e,this.lastIndex=r+e,this.raw=n,this.text=n,this.url=n}function Qe(t,e){var s=new cs(t,e);return t.__compiled__[s.schema].normalize(s,t),s}function j(t,e){if(!(this instanceof j))return new j(t,e);e||ss(t)&&(e=t,t={}),this.__opts__=ve({},tt,e),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=ve({},rs,t),this.__compiled__={},this.__tlds__=is,this.__tlds_replaced__=!1,this.re={},ne(this)}j.prototype.add=function(e,s){return this.__schemas__[e]=s,ne(this),this};j.prototype.set=function(e){return this.__opts__=ve(this.__opts__,e),this};j.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;var s,r,n,i,o,c,d,a,m;if(this.re.schema_test.test(e)){for(d=this.re.schema_search,d.lastIndex=0;(s=d.exec(e))!==null;)if(i=this.testSchemaAt(e,s[2],d.lastIndex),i){this.__schema__=s[2],this.__index__=s.index+s[1].length,this.__last_index__=s.index+s[0].length+i;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(a=e.search(this.re.host_fuzzy_test),a>=0&&(this.__index__<0||a<this.__index__)&&(r=e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(o=r.index+r[1].length,(this.__index__<0||o<this.__index__)&&(this.__schema__="",this.__index__=o,this.__last_index__=r.index+r[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(m=e.indexOf("@"),m>=0&&(n=e.match(this.re.email_fuzzy))!==null&&(o=n.index+n[1].length,c=n.index+n[0].length,(this.__index__<0||o<this.__index__||o===this.__index__&&c>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=o,this.__last_index__=c))),this.__index__>=0};j.prototype.pretest=function(e){return this.re.pretest.test(e)};j.prototype.testSchemaAt=function(e,s,r){return this.__compiled__[s.toLowerCase()]?this.__compiled__[s.toLowerCase()].validate(e,r,this):0};j.prototype.match=function(e){var s=0,r=[];this.__index__>=0&&this.__text_cache__===e&&(r.push(Qe(this,s)),s=this.__last_index__);for(var n=s?e.slice(s):e;this.test(n);)r.push(Qe(this,s)),n=n.slice(this.__last_index__),s+=this.__last_index__;return r.length?r:null};j.prototype.tlds=function(e,s){return e=Array.isArray(e)?e:[e],s?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(r,n,i){return r!==i[n-1]}).reverse(),ne(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,ne(this),this)};j.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url="mailto:"+e.url)};j.prototype.onCompile=function(){};var as=j,ls=S&&S.__createBinding||(Object.create?function(t,e,s,r){r===void 0&&(r=s);var n=Object.getOwnPropertyDescriptor(e,s);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[s]}}),Object.defineProperty(t,r,n)}:function(t,e,s,r){r===void 0&&(r=s),t[r]=e[s]}),fs=S&&S.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),_s=S&&S.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(s){var r=[];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(r[r.length]=n);return r},t(e)};return function(e){if(e&&e.__esModule)return e;var s={};if(e!=null)for(var r=t(e),n=0;n<r.length;n++)r[n]!=="default"&&ls(s,e,r[n]);return fs(s,e),s}}(),st=S&&S.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(et,"__esModule",{value:!0});var ds=et.default=ys;const hs=st(Ht),gs=Jt,ms=st(as),R=_s(h);function ps(t,e=!1){return t=(0,gs.escapeCarriageReturn)(Es(t)),hs.default.ansiToJson(t,{json:!0,remove_empty:!0,use_classes:e})}function xs(t){let e="";return t.bg&&(e+=`${t.bg}-bg `),t.fg&&(e+=`${t.fg}-fg `),t.decoration&&(e+=`ansi-${t.decoration} `),e===""?null:(e=e.substring(0,e.length-1),e)}function Ds(t){const e={};switch(t.bg&&(e.backgroundColor=`rgb(${t.bg})`),t.fg&&(e.color=`rgb(${t.fg})`),t.decoration){case"bold":e.fontWeight="bold";break;case"dim":e.opacity="0.5";break;case"italic":e.fontStyle="italic";break;case"hidden":e.visibility="hidden";break;case"strikethrough":e.textDecoration="line-through";break;case"underline":e.textDecoration="underline";break;case"blink":e.textDecoration="blink";break}return e}function Fs(t,e,s,r){const n=e?null:Ds(s),i=e?xs(s):null;return t?t==="fuzzy"?vs(s,r,n,i):bs(s,r,n,i):R.createElement("span",{style:n,key:r,className:i},s.content)}function bs(t,e,s,r){const n=[],i=/(\s|^)(https?:\/\/(?:www\.|(?!www))[^\s.]+\.[^\s]{2,}|www\.[^\s]+\.[^\s]{2,})/g;let o=0,c;for(;(c=i.exec(t.content))!==null;){const[,d,a]=c,m=c.index+d.length;m>o&&n.push(t.content.substring(o,m));const _=a.startsWith("www.")?`http://${a}`:a;n.push(R.createElement("a",{key:o,href:_,target:"_blank"},`${a}`)),o=i.lastIndex}return o<t.content.length&&n.push(t.content.substring(o)),R.createElement("span",{style:s,key:e,className:r},n)}function vs(t,e,s,r){var n;const i=(0,ms.default)({fuzzyEmail:!1}).tlds(["io"],!0);if(!i.pretest(t.content))return R.createElement("span",{style:s,key:e,className:r},t.content);const o=i.match(t.content);if(!o)return R.createElement("span",{style:s,key:e,className:r},t.content);const c=[t.content.substring(0,(n=o[0])===null||n===void 0?void 0:n.index)];return o.forEach((d,a)=>{var m;c.push(R.createElement("a",{href:d.url,target:"_blank",key:a},t.content.substring(d.index,d.lastIndex))),o[a+1]&&c.push(t.content.substring(o[a].lastIndex,(m=o[a+1])===null||m===void 0?void 0:m.index))}),o[o.length-1].lastIndex!==t.content.length&&c.push(t.content.substring(o[o.length-1].lastIndex,t.content.length)),R.createElement("span",{style:s,key:e,className:r},c)}function ys(t){const{className:e,useClasses:s,children:r,linkify:n}=t;return R.createElement("code",{className:e},ps(r??"",s??!1).map(Fs.bind(null,n??!1,s??!1)))}function Es(t){let e=t;do t=e,e=t.replace(/[^\n]\x08/gm,"");while(e.length<t.length);return t}const Cs=h.memo(function({line:e,query:s=""}){const r=e.text.replace(/\r?\n$/,""),n=s?Pt(r,s):null;return f.jsx("div",{className:"whitespace-pre-wrap break-all min-h-[1.25rem]",children:/\x1b\[/.test(r)?f.jsx(ds,{children:r}):n?n.map((i,o)=>i.hit?f.jsx("mark",{className:"bg-warning/40 text-inherit",children:i.text},o):f.jsx("span",{className:be(r),children:i.text},o)):f.jsx("span",{className:be(r),children:r})})}),js=[{key:"all",label:"全部"},{key:"text-info",label:"信息"},{key:"text-warning",label:"警告"},{key:"text-destructive",label:"错误"},{key:"text-success",label:"成功"}],Xe={start:"启动",stop:"停止",clear:"清屏"},ws=3e3;function As(t){const e=$t({start:0,end:t}),s=e.hours??0,r=e.minutes??0,n=e.seconds??0;return s===0&&r===0?`${n}s`:s===0?`${r}m${n}s`:`${s}h${r}m`}function Ke({startedAt:t,className:e}){const[,s]=h.useState(0);return h.useEffect(()=>{const r=setInterval(()=>s(n=>n+1),1e3);return()=>clearInterval(r)},[]),f.jsx("span",{className:e,children:As(Math.max(0,Date.now()-t))})}function zs({params:t,values:e,onChange:s,onSubmit:r,onCancel:n}){return f.jsxs("div",{"data-testid":"param-panel",onClick:i=>i.stopPropagation(),className:"flex flex-wrap items-center gap-2 px-3.5 py-2 border-b bg-card text-sm",children:[t.map(i=>f.jsxs("label",{className:"inline-flex items-center gap-1 text-xs",children:[f.jsx("span",{className:"font-mono text-muted-foreground",children:i}),f.jsx("input",{"aria-label":i,placeholder:i,value:e[i]??"",onChange:o=>s(i,o.target.value),className:"h-6 w-32 rounded-[var(--radius-md)] border bg-transparent px-1.5 font-mono placeholder:text-muted-foreground/50 focus:border-muted-foreground/50"})]},i)),f.jsx($,{variant:"ghost",className:"h-6 gap-1 px-2 text-sm text-success",onClick:r,children:"启动"}),f.jsx($,{variant:"ghost",className:"h-6 gap-1 px-2 text-sm",onClick:n,children:"取消"})]})}function ks({selected:t,onSelect:e}){const s=typeof e=="function",[r,n]=h.useState(null),i=s?t??null:r,o=u=>{s?e(u):n(u)},c=Ft("just:/__just/recipes",()=>$e("/__just/recipes",{cache:"no-store"}),{subscribe:"plugin:just:state"}),d=c.data??[],a=!c.loading&&c.error===null&&d.length===0,[m,_]=h.useState(null);h.useEffect(()=>{if(!a){_(null);return}_(null);let u=!1;return $e("/__just/status",{cache:"no-store"}).then(l=>{u||_(l)}).catch(()=>{u||_({installed:!0,hasJustfile:!1})}),()=>{u=!0}},[a]);const[v,y]=h.useState({}),[F,w]=h.useState({}),B=h.useRef(""),A=h.useRef(null),O=i?F[i]??[]:[],{icon:T}=ht(),q=h.useRef(!0),L=h.useRef(0),[je,U]=h.useState(0),we=h.useRef(i);h.useEffect(()=>{we.current=i});const P=h.useRef(new Map),rt=h.useRef(0),Z=h.useRef(!1),M=h.useRef(null);h.useEffect(()=>{const u=()=>{var Te;Z.current=!1;const b=P.current;if(b.size===0)return;P.current=new Map;const p=new Map;for(const[k,H]of b)p.set(k,H.map(ee=>({seq:++rt.current,text:ee})));w(k=>{const H={...k};for(const[ee,dt]of p){const he=(H[ee]??[]).concat(dt);H[ee]=he.length>se?he.slice(-se):he}return H});const E=we.current,J=E?((Te=p.get(E))==null?void 0:Te.length)??0:0;if(J>0){const k=A.current;!k||Ze(k.scrollHeight,k.scrollTop,k.clientHeight)?q.current=!0:L.current+=J,U(L.current)}},l=()=>{Z.current&&(Z.current=!1,M.current!==null&&(clearTimeout(M.current),M.current=null),u())},g=()=>{Z.current||(Z.current=!0,typeof requestAnimationFrame=="function"&&requestAnimationFrame(l),M.current=setTimeout(l,50))};fetch("/__config").then(b=>b.json()).then(b=>{B.current=b.stopToken??""}).catch(()=>{});const D=new EventSource("/__just/logs");let C=!0;return D.onopen=()=>{if(C){C=!1;return}P.current.clear(),w({}),y({})},D.onmessage=b=>{try{const p=JSON.parse(b.data);if(p.type==="log"){const E=P.current.get(p.recipe);E?E.push(p.text):P.current.set(p.recipe,[p.text]),g()}else p.type==="clear"?(P.current.delete(p.recipe),w(E=>({...E,[p.recipe]:[]}))):p.type==="state"&&(y(E=>{var J;return{...E,[p.recipe]:{state:p.state,code:p.code,signal:p.signal,startedAt:p.startedAt??((J=E[p.recipe])==null?void 0:J.startedAt)??Date.now()}}}),ce(E=>E[p.recipe]?{...E,[p.recipe]:void 0}:E),p.state==="running"&&!s&&o(p.recipe))}catch{}},D.onerror=()=>{},()=>{D.close(),M.current!==null&&(clearTimeout(M.current),M.current=null),Z.current=!1}},[]);const Ae=h.useRef(i);h.useEffect(()=>{const u=A.current,l=Ae.current!==i;Ae.current=i,u&&(q.current||l)&&(q.current=!0,u.scrollTop=u.scrollHeight-u.clientHeight,L.current!==0&&(L.current=0,U(0)))},[O.length,i]);const nt=()=>{const u=A.current;if(!u)return;const l=Ze(u.scrollHeight,u.scrollTop,u.clientHeight);q.current=l,l&&L.current!==0&&(L.current=0,U(0))},it=()=>{const u=A.current;u&&(u.scrollTop=u.scrollHeight-u.clientHeight,q.current=!0,L.current=0,U(0))},[oe,ut]=h.useState(""),[V,ot]=h.useState("");h.useEffect(()=>{const u=setTimeout(()=>ot(oe),150);return()=>clearTimeout(u)},[oe]);const[Q,ct]=h.useState("all"),ze=h.useMemo(()=>{let u=O;if(Q!=="all"&&(u=u.filter(l=>be(l.text.replace(/\r?\n$/,""))===Q)),V){const l=V.toLowerCase();u=u.filter(g=>g.text.toLowerCase().includes(l))}return u},[O,Q,V]),[X,ce]=h.useState({}),ae=u=>ce(l=>l[u]?{...l,[u]:void 0}:l),Y=async(u,l,g)=>{u!=="clear"&&ce(D=>({...D,[l]:u}));try{const D=await fetch(`/__just/${u}`,{method:"POST",headers:{"x-stop-token":B.current,"Content-Type":"application/json"},body:JSON.stringify({recipe:l,...u==="start"&&g?{args:g}:{}})});if(!D.ok){let C="";try{const b=await D.json();typeof(b==null?void 0:b.error)=="string"&&b.error&&(C=`:${b.error}`)}catch{}return te.error(`just ${l} ${Xe[u]}失败${C||`(HTTP ${D.status})`}`),u!=="clear"&&ae(l),!1}return u==="clear"?(te.success(`已清屏 ${l}`),!0):(setTimeout(()=>ae(l),ws),te.success(u==="start"?`已启动 ${l}`:`已停止 ${l}`),!0)}catch{return te.error(`just ${l} ${Xe[u]}失败:网络异常`),u!=="clear"&&ae(l),!1}},le=d.map(u=>({...u,task:v[u.name]})),ke=le.filter(u=>{var l;return((l=u.task)==null?void 0:l.state)==="running"}).length,z=i?v[i]:void 0,fe=(z==null?void 0:z.state)==="running",[_e,de]=h.useState(null),[Ne,K]=h.useState({}),Re=u=>{var g;const l=((g=d.find(D=>D.name===u))==null?void 0:g.params)??[];if(l.length===0){Y("start",u);return}K(Object.fromEntries(l.map(D=>[D,""]))),de(u)},at=()=>{if(!_e)return;const u=Object.entries(Ne).filter(([,l])=>l!=="");Y("start",_e,u.length>0?Object.fromEntries(u):void 0),de(null),K({})},lt=()=>{de(null),K({})},Se=u=>{var l;return _e===u?f.jsx(zs,{params:((l=d.find(g=>g.name===u))==null?void 0:l.params)??[],values:Ne,onChange:(g,D)=>K(C=>({...C,[g]:D})),onSubmit:at,onCancel:lt}):null},Oe=(u,l,g)=>u?"bg-success animate-pulse":l?g!=null&&g.signal?"bg-muted-foreground":g!=null&&g.code?"bg-destructive":"bg-success/60":"bg-muted-foreground/30",ft={key:"__console__",label:"总控台",badge:f.jsx("span",{className:"font-mono opacity-80",children:ke>0?ke:""}),className:i===null?"":"border-border text-muted-foreground hover:text-foreground hover:border-muted-foreground/40",renderLabel:()=>f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[f.jsx("span",{className:"h-3 w-3",children:T("monitor","h-3 w-3")}),f.jsx("span",{children:"总控台"})]})},_t=d.map(u=>{const l=v[u.name],g=(l==null?void 0:l.state)==="running",D=(l==null?void 0:l.state)==="exited",C=i===u.name;return{key:u.name,label:u.name,className:C?"":g?"border-success/40 bg-success/10 text-success hover:bg-success/20":"",renderLabel:()=>f.jsxs(f.Fragment,{children:[f.jsx("span",{className:`h-1.5 w-1.5 rounded-[var(--radius-full)] ${Oe(g,D,l)}`}),f.jsx("span",{children:u.name})]}),renderExtra:()=>D&&!C?f.jsx("span",{className:`text-xs ${l!=null&&l.signal?"opacity-60":l!=null&&l.code?"text-destructive":"text-success"}`,children:l!=null&&l.signal?"停":l==null?void 0:l.code}):void 0}});return f.jsxs("div",{className:"h-full flex flex-col",children:[f.jsx("div",{className:"flex-none flex items-center gap-1.5 flex-wrap px-3 py-2 border-b bg-background",children:f.jsx(Me,{items:[ft,..._t],value:i??"__console__",onChange:u=>o(u==="__console__"?null:u),ariaLabel:"任务筛选"})}),i===null?f.jsx("div",{className:"flex-1 min-h-0 flex flex-col",children:c.loading&&!c.data?f.jsx(Le,{rows:4,className:"m-3"}):c.error?f.jsx(gt,{message:c.error,onRetry:c.reload}):le.length===0?m?f.jsx(mt,{title:m.installed?m.hasJustfile?"justfile 中未发现可运行 recipe":"未发现 justfile":"未安装 just",hint:m.installed?m.hasJustfile?"justfile 存在但未解析到可展示的 recipe,检查 recipe 定义":"在项目根目录放置 justfile,即可在这里查看与启停任务":"未检测到 just 命令,安装 just 后即可在这里查看与启停任务"}):f.jsx(Le,{rows:4,className:"m-3"}):f.jsx("div",{className:"flex-1 min-h-0 overflow-auto p-3 grid gap-2.5 grid-cols-1 md:grid-cols-2 xl:grid-cols-3 content-start",children:le.map(u=>{const l=u.task,g=(l==null?void 0:l.state)==="running",D=(l==null?void 0:l.state)==="exited",C=(F[u.name]??[]).slice(-3).map(b=>b.text.replace(/\r?\n$/,"").replace(/\x1b\[[0-9;]*m/g,""));return f.jsxs("div",{onClick:()=>o(u.name),className:"group rounded-[var(--radius-lg)] border bg-card p-3 cursor-pointer hover:border-muted-foreground/40 transition-colors",children:[f.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[f.jsx("span",{className:`h-2 w-2 rounded-[var(--radius-full)] flex-none ${Oe(g,D,l)}`}),f.jsx("span",{className:"font-mono font-medium",children:u.name}),g&&f.jsx(Ke,{startedAt:l.startedAt,className:"text-success font-mono"}),D&&f.jsx("span",{className:`font-mono ${l.signal?"text-muted-foreground":l.code?"text-destructive":"text-success"}`,children:l.signal?"已停止":`exit ${l.code}`}),!l&&f.jsx("span",{className:"text-muted-foreground/60",children:"未运行"}),f.jsx("span",{className:"ml-auto flex items-center gap-1",onClick:b=>b.stopPropagation(),children:g?f.jsxs($,{variant:"ghost",className:"h-6 gap-1 px-2 text-sm",disabled:!!X[u.name],onClick:()=>Y("stop",u.name),children:[T("square","h-2.5 w-2.5"),"停止"]}):f.jsxs($,{variant:"ghost",className:"h-6 gap-1 px-2 text-sm",disabled:!!X[u.name],onClick:()=>Re(u.name),children:[T(D?"rotate-cw":"play","h-2.5 w-2.5"),D?"重跑":"启动"]})})]}),Se(u.name),u.description&&f.jsx("p",{className:"mt-1 text-sm text-muted-foreground/70 truncate",children:u.description}),f.jsx("div",{className:"mt-2 rounded bg-terminal-bg px-2 py-1.5 font-mono text-xs leading-relaxed text-terminal-fg/70 min-h-[3.4em]",children:C.length?C.map((b,p)=>f.jsx("div",{className:"truncate",children:b},p)):f.jsxs("span",{className:"text-terminal-fg/40",children:["$ just ",u.name," …"]})})]},u.name)})})}):f.jsxs("div",{className:"flex-1 min-h-0 flex flex-col",children:[f.jsxs("div",{className:"flex-none flex items-center gap-2 px-3.5 h-8 border-b bg-background text-sm",children:[f.jsx("span",{className:`h-1.5 w-1.5 rounded-[var(--radius-full)] ${fe?"bg-success animate-pulse":"bg-muted-foreground"}`}),f.jsx("span",{className:"font-mono font-medium",children:i}),f.jsx("span",{className:"text-muted-foreground font-mono",children:fe?f.jsxs(f.Fragment,{children:["running · ",f.jsx(Ke,{startedAt:z.startedAt})]}):z!=null&&z.signal?"已停止":z?`exit ${z.code}`:"未运行"}),f.jsxs("span",{className:"ml-auto flex items-center gap-1",children:[fe?f.jsxs($,{variant:"ghost",className:"h-6 gap-1 px-2 text-sm",disabled:!!X[i],onClick:()=>Y("stop",i),children:[T("square","h-2.5 w-2.5"),"停止"]}):f.jsxs($,{variant:"ghost",className:"h-6 gap-1 px-2 text-sm",disabled:!!X[i],onClick:()=>Re(i),children:[T("rotate-cw","h-2.5 w-2.5"),z?"重跑":"启动"]}),f.jsxs($,{variant:"ghost",className:"h-6 gap-1 px-2 text-sm",onClick:()=>Y("clear",i),disabled:!O.length,children:[T("eraser","h-2.5 w-2.5"),"清屏"]}),f.jsx("span",{className:"text-muted-foreground font-mono ml-1",children:O.length>=se?`${se}+ 行`:`${O.length} 行`})]})]}),Se(i),f.jsxs("div",{className:"flex-none flex items-center gap-2 px-3.5 py-1.5 border-b bg-background",children:[f.jsx("input",{value:oe,onChange:u=>ut(u.target.value),placeholder:"搜索日志…","aria-label":"搜索日志",className:"h-6 w-40 rounded-[var(--radius-md)] border bg-transparent px-2 text-xs font-mono placeholder:text-muted-foreground/50 focus:border-muted-foreground/50"}),f.jsx(Me,{items:js,value:Q,onChange:ct,ariaLabel:"日志级别"})]}),f.jsxs("div",{className:"relative flex-1 min-h-0",children:[f.jsxs("div",{ref:A,"data-testid":"log-scroll",role:"log","aria-live":"polite","aria-label":"日志输出",tabIndex:0,onScroll:nt,className:"h-full overflow-auto bg-terminal-bg p-3.5 font-mono text-xs leading-relaxed text-terminal-fg",children:[ze.length===0&&f.jsx("p",{className:"text-terminal-fg/50",children:O.length===0?`$ just ${i} · 等待输出…`:"无匹配行"}),ze.map(u=>f.jsx(Cs,{line:u,query:V},u.seq))]}),je>0&&f.jsxs("button",{type:"button",onClick:it,className:"absolute bottom-3 right-4 inline-flex items-center gap-1 h-7 px-3 rounded-[var(--radius-full)] border border-success/40 bg-success/10 text-success text-xs shadow-sm hover:bg-success/20 transition-colors",children:["↓ ",je," 行新输出"]})]})]})]})}function Bs({params:t}){const e=pt(ge.mode,"h-5 w-5"),s=xt(),r=t.get("task")??t.get("recipe");return f.jsx(Dt,{manifest:ge,icon:e,breadcrumb:["插件",ge.mode,...r?[r]:[]],children:f.jsx("div",{className:"mx-auto h-full bg-background border rounded-lg shadow-sm overflow-hidden flex flex-col",children:f.jsx(ks,{selected:r,onSelect:n=>s.navigate(n?{recipe:n,task:null}:{recipe:null,task:null})})})})}export{Bs as default};
@@ -0,0 +1 @@
1
+ import{r as S,j as e}from"./vendor-react-OhDMXABq.js";import{F}from"./FilterPills-D4oEoDdf.js";import{u as N,a as M,P as C,E as P,r as W,s as _}from"./index-Ipssembb.js";import{M as R,I as H,F as L,C as j,U as A,u as T,R as U}from"./UnsupportedViewer-DW7gYl0e.js";import{m as b}from"./web-CeRdVt5Q.js";import"./vendor-ui-D8qdFUhC.js";import"./index-D7HrI6pR.js";import"./fetchJson-D-dWeu1j.js";import"./client-Cw4K1Nx3.js";const k="zd-design-viewport",z={mode:0,w:1024,h:768},D=[0,768,375],y=280,I=3e3,V=400,E=3e3;function $(n){if(!n||typeof n!="object")return!1;const s=n,r=D.includes(s.mode)||s.mode==="custom",t=typeof s.w=="number"&&Number.isFinite(s.w)&&s.w>=y&&s.w<=I,a=typeof s.h=="number"&&Number.isFinite(s.h)&&s.h>=V&&s.h<=E;return r&&t&&a}const J=()=>W(k,{...z},$);function g(n){_(k,JSON.stringify(n))}function X({path:n}){const[s,r]=T(),t="/"+encodeURI(n)+(s?"?v="+s:"");return e.jsxs("div",{className:"relative h-full",children:[e.jsx("div",{className:"absolute right-3 top-3 z-10",children:e.jsx(U,{onClick:r})}),e.jsx("iframe",{src:t,title:n,className:"w-full h-full border-0 bg-background"})]})}function q(n){const s=n.slice(n.lastIndexOf("/")+1).toLowerCase(),r=s.lastIndexOf("."),t=r>=0?s.slice(r):"";return t===".md"||t===".markdown"?R:[".svg",".png",".jpg",".jpeg",".gif",".webp",".ico"].includes(t)?H:t===".pdf"?L:[".html",".htm"].includes(t)?X:[".sql",".txt",".csv",".tsv",".json",".yaml",".yml",".xml",".py",".js",".ts",".java",".go",".rs",".rb",".php",".c",".cpp",".h",".cs",".swift",".kt",".scala",".sh",".bash",".zsh",".fish",".env",".gitignore",".dockerfile"].includes(t)?j:r===-1?j:A}function B({mode:n,onMode:s,w:r,h:t,onW:a,onH:l}){N();const u=[{v:0,label:"桌面"},{v:768,label:"768"},{v:375,label:"375"},{v:"custom",label:"自定义"}],d="w-[var(--design-input-w)] h-7 px-1 text-center text-xs rounded border border-border bg-background text-foreground [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none focus:border-primary";return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"flex items-center gap-1 rounded-md border border-border p-0.5 bg-muted",children:e.jsx(F,{items:u.map(o=>({key:String(o.v),label:o.label})),value:String(n),onChange:o=>s(o==="0"?0:o==="custom"?"custom":Number(o)),ariaLabel:"视口模式"})}),e.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[e.jsx("input",{type:"number",value:r,min:y,max:I,step:8,onChange:o=>a(Number(o.target.value)),"aria-label":"自定义宽度",className:d}),e.jsx("span",{className:"text-muted-foreground/70",children:"×"}),e.jsx("input",{type:"number",value:t,min:V,max:E,step:8,onChange:o=>l(Number(o.target.value)),"aria-label":"自定义高度",className:d}),e.jsx("span",{className:"text-sm text-muted-foreground/70",children:"px"})]})]})}function oe({params:n}){const{icon:s}=N(),r=M(b.mode,"h-5 w-5"),t=n.get("asset"),[a,l]=S.useState(J),u=m=>{const c={...a,mode:m};l(c),g(c)},d=m=>{const c={...a,w:m};l(c),g(c)},o=m=>{const c={...a,h:m};l(c),g(c)},{mode:i,w:x,h:p}=a,f=(t==null?void 0:t.slice(t.lastIndexOf("/")+1))??"",w=f.includes(".")?f.slice(f.lastIndexOf(".")).toLowerCase():"",v=w===".html"||w===".htm",h=t?q(t):null,O=i===0?"桌面":i==="custom"?`${x} × ${p}`:`${i}px`;return e.jsx(C,{manifest:b,icon:r,breadcrumb:["插件",b.mode,...t?[t]:[]],children:e.jsx("div",{className:"mx-auto h-full flex flex-col bg-background border rounded-lg shadow-sm overflow-hidden",children:t&&h?e.jsxs(e.Fragment,{children:[v&&e.jsxs("div",{className:"h-[var(--design-toolbar-h)] flex-none flex items-center justify-between px-3.5 border-b bg-background text-xs",children:[e.jsx("span",{className:"font-mono truncate",children:t}),e.jsx("span",{className:"text-muted-foreground ml-3 flex-none",children:O}),e.jsx(B,{mode:i,onMode:u,w:x,h:p,onW:d,onH:o})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-auto",children:v?e.jsx("div",{className:"mx-auto bg-background overflow-hidden",style:{maxWidth:i===0?void 0:i==="custom"?x:i,height:i==="custom"?p:"100%"},children:e.jsx(h,{path:t})}):e.jsx("div",{className:"mx-auto max-w-5xl h-full overflow-auto",children:e.jsx(h,{path:t})})})]}):e.jsx(P,{icon:s("palette","h-6 w-6"),title:"从左侧选择一个资产预览",hint:"prototypes/ 与 design/ 目录下的文件可直接预览"})})})}export{oe as default};