meshy-node 0.9.8 → 0.9.10

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.
@@ -1,18 +0,0 @@
1
- import{c as W,j as n,d as k,r as c,bR as A,bM as B,y as U,n as I,$ as V,l as G}from"./index-CGBx_AxR.js";import{G as H}from"./DashboardPage-D5Gk6vkS.js";import{F as J}from"./file-D0mZphVr.js";import"./DashboardShared-CdOWTY_U.js";import"./MarkdownPreviewFrame-Bf2NJ862.js";import"./PreviewTab-CO-6Sjwr.js";/**
2
- * @license lucide-react v1.7.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const z=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],q=W("columns-2",z);/**
7
- * @license lucide-react v1.7.0 - ISC
8
- *
9
- * This source code is licensed under the ISC license.
10
- * See the LICENSE file in the root directory of this source tree.
11
- */const K=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]],Q=W("rows-3",K);function X(e,t){if(!(e!=null&&e.trim()))return[];const r=e.split(`
12
- `),i=[];let s=[];const d=()=>{if(s.length===0)return;const a=s.join(`
13
- `).trim();if(!a){s=[];return}const o=oe(s);if(!o){s=[];return}i.push({id:`${t}:${o}`,path:o,section:t,patch:a}),s=[]};for(const a of r)a.startsWith("diff --git ")&&s.length>0&&d(),s.push(a);return d(),i}function F(e,t,r){const i=(e==null?void 0:e.filter(s=>s.section===r))??[];return i.length===0?X(t,r):i.map(s=>({id:`${r}:${s.path}`,path:s.path,section:r,status:s.status,patch:s.patch,oldExists:s.oldExists,newExists:s.newExists,oldContent:s.oldContent,newContent:s.newContent,oldTruncated:s.oldTruncated,newTruncated:s.newTruncated,binary:s.binary}))}function Y(e){const t=[];for(const r of[...e].sort((i,s)=>i.path.localeCompare(s.path))){const i=r.path.split("/").filter(Boolean);let s=t,d="";i.forEach((a,o)=>{d=d?`${d}/${a}`:a;const l=o===i.length-1;let m=s.find(u=>u.name===a);m||(m=l?{type:"file",name:a,path:d,item:r}:{type:"folder",name:a,path:d,children:[]},s.push(m)),l||(m.children??(m.children=[]),s=m.children)})}return t}function Z(e){const t=[];let r="";for(const i of e.split("/").filter(Boolean).slice(0,-1))r=r?`${r}/${i}`:i,t.push(r);return t}function ee(e){return e.filter(t=>t&&!t.endsWith("/")).map(t=>({id:`untracked:${t}`,path:t,section:"untracked"}))}function te({oldContent:e,newContent:t,patch:r}){const i=D(e),s=D(t),d=se(r);if(d.length===0)return ie(i,s);const a=[];let o=1,l=1;const m=(u,h)=>{const f=Math.min(u,i.length+1),v=Math.min(h,s.length+1);for(;o<f||l<v;){const p=o<f&&o<=i.length,y=l<v&&l<=s.length;a.push({oldLineNumber:p?o:null,newLineNumber:y?l:null,oldContent:p?i[o-1]??"":"",newContent:y?s[l-1]??"":"",kind:p&&y?"context":p?"removed":"added"}),o<f&&(o+=1),l<v&&(l+=1)}o<u&&(o=u),l<h&&(l=h)};for(const u of d){m(u.oldStart>0?u.oldStart:o,u.newStart>0?u.newStart:l);let h=0;for(;h<u.lines.length;){const f=u.lines[h];if(!f)break;if(f.kind==="context"){a.push({oldLineNumber:o,newLineNumber:l,oldContent:i[o-1]??f.content,newContent:s[l-1]??f.content,kind:"context"}),o+=1,l+=1,h+=1;continue}const v=[],p=[];for(;h<u.lines.length;){const g=u.lines[h];if(!g||g.kind==="context")break;g.kind==="removed"?(v.push({lineNumber:o,content:i[o-1]??g.content}),o+=1):(p.push({lineNumber:l,content:s[l-1]??g.content}),l+=1),h+=1}const y=Math.max(v.length,p.length);for(let g=0;g<y;g+=1){const N=v[g],w=p[g];a.push({oldLineNumber:(N==null?void 0:N.lineNumber)??null,newLineNumber:(w==null?void 0:w.lineNumber)??null,oldContent:(N==null?void 0:N.content)??"",newContent:(w==null?void 0:w.content)??"",kind:N&&w?"changed":N?"removed":"added"})}}}for(;o<=i.length||l<=s.length;){const u=o<=i.length,h=l<=s.length;a.push({oldLineNumber:u?o:null,newLineNumber:h?l:null,oldContent:u?i[o-1]??"":"",newContent:h?s[l-1]??"":"",kind:u&&h?"context":u?"removed":"added"}),u&&(o+=1),h&&(l+=1)}return a}function ne(e){return D(e).map((t,r)=>({oldLineNumber:null,newLineNumber:r+1,oldContent:"",newContent:t,kind:"added"}))}function re(e){const t=[];for(const r of e){if(r.kind==="context"){t.push({oldLineNumber:r.oldLineNumber,newLineNumber:r.newLineNumber,content:r.newContent||r.oldContent,kind:"context",prefix:" "});continue}if(r.kind==="changed"){t.push({oldLineNumber:r.oldLineNumber,newLineNumber:null,content:r.oldContent,kind:"removed",prefix:"-"}),t.push({oldLineNumber:null,newLineNumber:r.newLineNumber,content:r.newContent,kind:"added",prefix:"+"});continue}if(r.kind==="removed"){t.push({oldLineNumber:r.oldLineNumber,newLineNumber:null,content:r.oldContent,kind:"removed",prefix:"-"});continue}t.push({oldLineNumber:null,newLineNumber:r.newLineNumber,content:r.newContent,kind:"added",prefix:"+"})}return t}function D(e){if(!e)return[];const t=e.replace(/\r\n/g,`
14
- `).replace(/\r/g,`
15
- `).split(`
16
- `);return t.length>0&&t[t.length-1]===""&&t.pop(),t}function se(e){if(!e)return[];const t=[];let r=null;for(const i of e.split(`
17
- `)){const s=i.match(/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/);if(s){r={oldStart:Number(s[1]??0),newStart:Number(s[2]??0),lines:[]},t.push(r);continue}if(!r||i.startsWith("\\ No newline"))continue;const d=i.charAt(0);d===" "?r.lines.push({kind:"context",content:i.slice(1)}):d==="+"?r.lines.push({kind:"added",content:i.slice(1)}):d==="-"&&r.lines.push({kind:"removed",content:i.slice(1)})}return t}function ie(e,t){const r=Math.max(e.length,t.length),i=[];for(let s=0;s<r;s+=1){const d=s<e.length,a=s<t.length,o=e[s]??"",l=t[s]??"";i.push({oldLineNumber:d?s+1:null,newLineNumber:a?s+1:null,oldContent:o,newContent:l,kind:d&&a?o===l?"context":"changed":d?"removed":"added"})}return i}function oe(e){var d,a;const t=(d=e.find(o=>o.startsWith("+++ ")))==null?void 0:d.slice(4).trim();if(t&&t!=="/dev/null")return T(t);const r=(a=e.find(o=>o.startsWith("--- ")))==null?void 0:a.slice(4).trim();if(r&&r!=="/dev/null")return T(r);const i=e.find(o=>o.startsWith("diff --git "));if(!i)return null;const s=i.match(/^diff --git a\/(.+?) b\/(.+)$/);return s?T(s[2]||s[1]||""):null}function T(e){return e.replace(/^[ab]\//,"")}function de({item:e,viewMode:t}){return e.binary?n.jsx(j,{tone:"muted",children:"Binary file changed."}):typeof e.oldContent=="string"||typeof e.newContent=="string"?n.jsx(M,{oldContent:e.oldContent??"",newContent:e.newContent??"",patch:e.patch,oldTitle:e.oldExists===!1?"Missing base":"Base",newTitle:e.newExists===!1?"Deleted":"Current",oldTruncated:e.oldTruncated,newTruncated:e.newTruncated,viewMode:t}):n.jsx(xe,{patch:e.patch??""})}function le({loading:e,error:t,content:r,viewMode:i}){if(e)return n.jsx(j,{tone:"muted",children:"Loading file content..."});if(t)return n.jsx(j,{tone:"destructive",children:t});if(!r)return n.jsx(j,{tone:"muted",children:"Select an untracked file to preview its content."});if(r.kind==="image"){const s=r.content?`data:${r.mimeType};base64,${r.content}`:r.downloadUrl;return s?n.jsx("div",{className:"flex min-h-[18rem] items-center justify-center rounded-sm bg-background/55 p-3",children:n.jsx("img",{src:s,alt:r.path,className:"max-h-full max-w-full rounded-sm object-contain shadow-[0_24px_90px_-52px_rgba(0,0,0,0.65)]"})}):n.jsx(j,{tone:"muted",children:"Image preview is not available."})}if(r.kind==="pdf"&&r.downloadUrl)return n.jsx("div",{className:"h-full min-h-[22rem] overflow-hidden rounded-sm bg-background/55",children:n.jsx("iframe",{src:r.downloadUrl,title:r.path,className:"h-full w-full border-0"})});if(r.kind==="json"){let s=r.content;try{s=JSON.stringify(JSON.parse(r.content),null,2)}catch{}return n.jsx(M,{oldContent:"",newContent:s,addedOnly:!0,newTitle:"Untracked",newTruncated:r.truncated,viewMode:i})}return r.kind==="markdown"||r.kind==="text"||r.kind==="html"?n.jsx(M,{oldContent:"",newContent:r.content,addedOnly:!0,newTitle:"Untracked",newTruncated:r.truncated,viewMode:i}):n.jsx(j,{tone:"muted",children:"This file cannot be previewed inline."})}function M({oldContent:e,newContent:t,patch:r,oldTitle:i="Base",newTitle:s="Current",oldTruncated:d=!1,newTruncated:a=!1,addedOnly:o=!1,viewMode:l}){const m=c.useMemo(()=>o?ne(t):te({oldContent:e,newContent:t,patch:r}),[o,t,e,r]);return n.jsxs("div",{className:"overflow-hidden rounded-sm bg-background/55",children:[n.jsx("div",{className:"overflow-x-auto",children:l==="inline"?n.jsx(ce,{rows:m,oldTitle:i,newTitle:s}):n.jsx(ae,{rows:m,oldTitle:i,newTitle:s})}),(d||a)&&n.jsx("div",{className:"bg-muted/30 px-2.5 py-1.5 text-[10px] text-muted-foreground",children:"Content truncated. Open the Files tab to inspect the full artifact."})]})}function ae({rows:e,oldTitle:t,newTitle:r}){return n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"grid min-w-[52rem] grid-cols-[3rem_minmax(16rem,1fr)_3rem_minmax(16rem,1fr)] bg-muted/30 font-mono text-[10px] leading-4",children:[n.jsx("span",{className:"border-r border-border/50 px-2 py-1.5 text-right text-muted-foreground/60",children:"#"}),n.jsx("span",{className:"border-r border-border/60 px-2 py-1.5 font-medium text-foreground",children:t}),n.jsx("span",{className:"border-r border-border/50 px-2 py-1.5 text-right text-muted-foreground/60",children:"#"}),n.jsx("span",{className:"px-2 py-1.5 font-medium text-foreground",children:r})]}),n.jsx("div",{className:"font-mono text-[10px] leading-4",children:e.length>0?e.map((i,s)=>n.jsx(ue,{row:i},`${s}:${i.oldLineNumber??"x"}:${i.newLineNumber??"x"}`)):n.jsx("div",{className:"min-w-[52rem] px-2.5 py-2 text-[10px] text-muted-foreground",children:"No text content."})})]})}function ce({rows:e,oldTitle:t,newTitle:r}){const i=c.useMemo(()=>re(e),[e]);return n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"grid min-w-[42rem] grid-cols-[3rem_3rem_minmax(0,1fr)] bg-muted/30 font-mono text-[10px] leading-4",children:[n.jsx("span",{className:"border-r border-border/50 px-2 py-1.5 text-right text-muted-foreground/60",children:"old"}),n.jsx("span",{className:"border-r border-border/50 px-2 py-1.5 text-right text-muted-foreground/60",children:"new"}),n.jsxs("span",{className:"px-2 py-1.5 font-medium text-foreground",children:[t," / ",r]})]}),n.jsx("div",{className:"font-mono text-[10px] leading-4",children:i.length>0?i.map((s,d)=>n.jsx(me,{row:s},`${d}:${s.oldLineNumber??"x"}:${s.newLineNumber??"x"}:${s.prefix}`)):n.jsx("div",{className:"min-w-[42rem] px-2.5 py-2 text-[10px] text-muted-foreground",children:"No text content."})})]})}function ue({row:e}){return n.jsxs("div",{className:"grid min-w-[52rem] grid-cols-[3rem_minmax(16rem,1fr)_3rem_minmax(16rem,1fr)] border-b border-border/25 last:border-b-0",children:[n.jsx("span",{className:k("select-none border-r border-border/40 px-2 py-px text-right text-muted-foreground/55",_(e)),children:e.oldLineNumber??""}),n.jsx("span",{className:k("whitespace-pre-wrap break-all border-r border-border/60 px-2 py-px text-foreground",_(e)),children:e.oldContent||" "}),n.jsx("span",{className:k("select-none border-r border-border/40 px-2 py-px text-right text-muted-foreground/55",R(e)),children:e.newLineNumber??""}),n.jsx("span",{className:k("whitespace-pre-wrap break-all px-2 py-px text-foreground",R(e)),children:e.newContent||" "})]})}function me({row:e}){return n.jsxs("div",{className:k("grid min-w-[42rem] grid-cols-[3rem_3rem_minmax(0,1fr)] border-b border-border/25 last:border-b-0",he(e)),children:[n.jsx("span",{className:"select-none border-r border-border/40 px-2 py-px text-right text-muted-foreground/55",children:e.oldLineNumber??""}),n.jsx("span",{className:"select-none border-r border-border/40 px-2 py-px text-right text-muted-foreground/55",children:e.newLineNumber??""}),n.jsxs("span",{className:"whitespace-pre-wrap break-all px-2 py-px text-foreground",children:[n.jsx("span",{className:"mr-2 inline-block w-2 select-none text-muted-foreground/60",children:e.prefix}),e.content||" "]})]})}function xe({patch:e}){const t=e.split(`
18
- `);return n.jsxs("div",{className:"rounded-sm bg-background/55",children:[n.jsxs("div",{className:"px-2.5 py-1.5",children:[n.jsx("div",{className:"text-[10px] font-medium text-foreground",children:"Patch"}),n.jsxs("div",{className:"mt-0.5 text-[9px] text-muted-foreground",children:[t.length," lines"]})]}),n.jsx("div",{className:"font-mono text-[10px] leading-4",children:t.map((r,i)=>n.jsxs("div",{className:k("grid grid-cols-[36px_minmax(0,1fr)] gap-2 px-2.5 py-px",fe(r)),children:[n.jsx("span",{className:"select-none text-right text-muted-foreground/55",children:i+1}),n.jsx("span",{className:"whitespace-pre-wrap break-all text-foreground",children:r||" "})]},`${i}-${r}`))})]})}function j({children:e,tone:t}){return n.jsx("div",{className:k("flex h-full min-h-[10rem] items-center justify-center rounded-sm text-[10px]",t==="muted"?"text-muted-foreground":"text-destructive"),children:e})}function _(e){return e.kind==="removed"||e.kind==="changed"?"bg-destructive/10":e.kind==="added"?"bg-muted/25 text-muted-foreground":""}function R(e){return e.kind==="added"||e.kind==="changed"?"bg-emerald-500/10":e.kind==="removed"?"bg-muted/25 text-muted-foreground":""}function he(e){return e.kind==="added"?"bg-emerald-500/10":e.kind==="removed"?"bg-destructive/10":""}function fe(e){return e.startsWith("@@")?"bg-sky-500/10":e.startsWith("+")&&!e.startsWith("+++")?"bg-emerald-500/10":e.startsWith("-")&&!e.startsWith("---")?"bg-destructive/10":e.startsWith("diff ")||e.startsWith("index ")||e.startsWith("---")||e.startsWith("+++")?"bg-muted/45":""}const pe={staged:"Staged",unstaged:"Unstaged",untracked:"Untracked"};function Se({taskId:e}){const[t,r]=c.useState(null),[i,s]=c.useState(!0),[d,a]=c.useState(null),[o,l]=c.useState(null),[m,u]=c.useState(null),[h,f]=c.useState(!1),[v,p]=c.useState(null),[y,g]=c.useState("split"),N=c.useCallback(async()=>{s(!0),a(null),r(null);try{const x=await A(e);r(x)}catch(x){a(x instanceof Error?x.message:"Failed to load diff")}finally{s(!1)}},[e]);c.useEffect(()=>{N()},[N]);const w=c.useMemo(()=>F(t==null?void 0:t.files,t==null?void 0:t.staged,"staged"),[t==null?void 0:t.files,t==null?void 0:t.staged]),$=c.useMemo(()=>F(t==null?void 0:t.files,t==null?void 0:t.unstaged,"unstaged"),[t==null?void 0:t.files,t==null?void 0:t.unstaged]),E=c.useMemo(()=>ee((t==null?void 0:t.untrackedFiles)??[]),[t==null?void 0:t.untrackedFiles]),S=c.useMemo(()=>[{section:"staged",items:w},{section:"unstaged",items:$},{section:"untracked",items:E}],[w,$,E]),L=c.useMemo(()=>S.flatMap(x=>x.items),[S]),P=c.useMemo(()=>S.filter(x=>x.items.length>0),[S]),b=c.useMemo(()=>L.find(x=>x.id===o)??L[0]??null,[L,o]);return c.useEffect(()=>{var x;(!o||!L.some(C=>C.id===o))&&l(((x=L[0])==null?void 0:x.id)??null)},[L,o]),c.useEffect(()=>{if(u(null),p(null),f(!1),!b||b.section!=="untracked")return;if(b.path.endsWith("/")){p("This untracked path is a directory. Open the Files tab to inspect its contents.");return}let x=!1;return f(!0),B(e,b.path).then(C=>{x||u(C)}).catch(C=>{x||p(C instanceof Error?C.message:"Failed to load file content")}).finally(()=>{x||f(!1)}),()=>{x=!0}},[b,e]),i?n.jsx(j,{tone:"muted",children:"Loading diff..."}):d?n.jsx(j,{tone:"destructive",children:d}):t!=null&&t.available?L.length>0?n.jsxs("div",{className:"grid h-full min-h-0 grid-cols-1 lg:grid-cols-[16rem_minmax(0,1fr)] lg:pl-5",children:[n.jsxs("aside",{className:"flex min-h-0 flex-col bg-card/25 lg:border-r lg:border-border/50",children:[n.jsx("div",{className:"shrink-0 bg-card/20 px-2.5 py-1.5",children:n.jsx("div",{className:"flex items-start justify-between gap-1.5",children:n.jsxs("div",{className:"min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-1 text-[10px] font-semibold text-foreground",children:[n.jsx(H,{className:"h-3 w-3 text-muted-foreground"}),n.jsx("span",{className:"truncate",children:t.branch??"detached HEAD"})]}),t.repoRoot&&n.jsx("div",{className:"mt-1 truncate font-mono text-[10px] leading-4 text-muted-foreground",children:t.repoRoot})]})})}),n.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto p-1",children:n.jsx("div",{className:"space-y-1",children:P.map(({section:x,items:C})=>n.jsx(ge,{section:x,items:C,selectedId:(b==null?void 0:b.id)??null,onSelect:l},x))})})]}),n.jsx("section",{className:"min-h-0 flex flex-col bg-card/15",children:b?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"shrink-0 px-2.5 py-1.5",children:n.jsxs("div",{className:"flex items-start justify-between gap-2",children:[n.jsx("div",{className:"min-w-0 break-all font-mono text-[9px] text-muted-foreground",children:b.path}),n.jsx(be,{mode:y,onModeChange:g})]})}),n.jsx("div",{className:"min-h-0 flex-1 overflow-auto px-1.5 pb-1.5 pt-1",children:b.section==="untracked"?n.jsx(le,{loading:h,error:v,content:m,viewMode:y}):n.jsx(de,{item:b,viewMode:y})})]}):n.jsx(j,{tone:"muted",children:"Select a file to inspect."})})]}):n.jsx(j,{tone:"muted",children:"Working tree is clean."}):n.jsx(j,{tone:"muted",children:"Task working directory is not inside a Git repository."})}function ge({section:e,items:t,selectedId:r,onSelect:i}){const s=c.useMemo(()=>Y(t),[t]),d=c.useMemo(()=>t.find(m=>m.id===r)??null,[t,r]),a=c.useMemo(()=>new Set(d?Z(d.path):[]),[d]),[o,l]=c.useState(!0);return t.length===0?null:n.jsxs("section",{className:"rounded-sm bg-background/35",children:[n.jsxs("button",{type:"button",onClick:()=>l(m=>!m),"aria-expanded":o,className:k("flex w-full items-center justify-between gap-1.5 px-2 py-1 text-left transition-colors hover:bg-background/55"),children:[n.jsxs("div",{className:"flex items-center gap-1",children:[o?n.jsx(U,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):n.jsx(I,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),n.jsx("span",{className:"text-[10px] font-medium text-foreground",children:pe[e]})]}),n.jsx(V,{variant:"outline",className:"rounded-sm border-transparent bg-muted/45 px-1.5 py-0 text-[9px]",children:t.length})]}),o&&n.jsx("div",{className:"p-1",children:s.length>0?n.jsx("div",{className:"space-y-0.5",children:s.map(m=>n.jsx(O,{node:m,depth:0,selectedId:r,expandedAncestorPaths:a,onSelect:i},`${e}:${m.path}`))}):null})]})}function be({mode:e,onModeChange:t}){const r=i=>k("flex items-center gap-1 rounded-sm px-2 py-0.5 text-[10px] transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60",i?"bg-primary/10 font-medium text-primary":"text-muted-foreground hover:bg-background/45 hover:text-foreground");return n.jsxs("div",{className:"flex shrink-0 items-center gap-1 rounded-sm bg-muted/40 p-0.5",role:"group","aria-label":"Diff view mode",children:[n.jsxs("button",{type:"button","aria-pressed":e==="split",title:"Split diff",onClick:()=>t("split"),className:r(e==="split"),children:[n.jsx(q,{className:"h-3 w-3"}),n.jsx("span",{children:"Split"})]}),n.jsxs("button",{type:"button","aria-pressed":e==="inline",title:"Inline diff",onClick:()=>t("inline"),className:r(e==="inline"),children:[n.jsx(Q,{className:"h-3 w-3"}),n.jsx("span",{children:"Inline"})]})]})}function O({node:e,depth:t,selectedId:r,expandedAncestorPaths:i,onSelect:s}){var d;return e.type==="folder"?n.jsx(Ne,{node:e,depth:t,selectedId:r,expandedAncestorPaths:i,onSelect:s}):n.jsxs("button",{type:"button",onClick:()=>{e.item&&s(e.item.id)},className:k("flex w-full cursor-pointer items-center gap-1 rounded-sm px-1 py-0.5 text-left transition-colors",((d=e.item)==null?void 0:d.id)===r?"bg-primary/10 text-foreground":"text-foreground/90 hover:bg-background/55"),style:{paddingLeft:`${t*10+5}px`},children:[n.jsx(J,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),n.jsx("span",{className:"truncate text-[10px] leading-4",children:e.name})]})}function Ne({node:e,depth:t,selectedId:r,expandedAncestorPaths:i,onSelect:s}){const[d,a]=c.useState(!0);return c.useEffect(()=>{i.has(e.path)&&a(!0)},[i,e.path]),n.jsxs("div",{children:[n.jsxs("button",{type:"button",onClick:()=>a(o=>!o),"aria-expanded":d,className:"flex w-full cursor-pointer select-none items-center gap-1 rounded-sm px-1 py-0.5 text-left text-[10px] leading-4 text-muted-foreground transition-colors hover:bg-background/55 hover:text-foreground",style:{paddingLeft:`${t*10+5}px`},children:[d?n.jsx(U,{className:"h-3 w-3 shrink-0"}):n.jsx(I,{className:"h-3 w-3 shrink-0"}),n.jsx(G,{className:"h-3 w-3 shrink-0"}),n.jsx("span",{className:"truncate",children:e.name})]}),d&&n.jsx("div",{className:"space-y-0.5",children:(e.children??[]).map(o=>n.jsx(O,{node:o,depth:t+1,selectedId:r,expandedAncestorPaths:i,onSelect:s},o.path))})]})}export{Se as DiffTab};