module.exports=[88111,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(15687),e=a.i(32283),f=a.i(38246);let g=[{value:"seed",label:"种子"},{value:"growing",label:"成长中"},{value:"mature",label:"成熟"},{value:"needs-split",label:"待拆分"},{value:"archived",label:"已归档"}];function h(){let a=(0,d.useWikiData)(),[h,i]=(0,c.useState)("updated"),[j,k]=(0,c.useState)(new Set),l=(0,c.useMemo)(()=>{let b=new Map;for(let c of a.nodes){let d={derivedFrom:[],splitsInto:[]};for(let b of c.derived_from){let c=a.nodeMap[b];c&&d.derivedFrom.push(c)}for(let b of c.splits_into){let c=a.nodeMap[b];c&&d.splitsInto.push(c)}(d.derivedFrom.length||d.splitsInto.length)&&b.set(c.id,d)}return b},[a.nodes,a.nodeMap]),m=(0,c.useMemo)(()=>{let b=a.nodes;j.size>0&&(b=b.filter(a=>j.has(a.status)));let c=[...b].sort((a,b)=>{let c="updated"===h?a.updated:a.created;return("updated"===h?b.updated:b.created).localeCompare(c)}),d=[];for(let a of c){let b="updated"===h?a.updated:a.created,c=d[d.length-1];c&&c.date===b?c.nodes.push(a):d.push({date:b,nodes:[a]})}return d},[a.nodes,h,j]);return(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,b.jsx)("h2",{className:"text-[22px] font-semibold m-0",children:"时间线"}),(0,b.jsxs)("div",{className:"flex items-center gap-2 text-[13px]",children:[(0,b.jsx)("button",{onClick:()=>i("updated"),className:`px-2.5 py-1 rounded-md border transition-colors ${"updated"===h?"":"hover:bg-[var(--hover)]"}`,style:{borderColor:"updated"===h?"var(--active-bg)":"var(--border)",background:"updated"===h?"var(--active-bg)":void 0,color:"updated"===h?"var(--active-text)":"var(--text)"},children:"按更新"}),(0,b.jsx)("button",{onClick:()=>i("created"),className:`px-2.5 py-1 rounded-md border transition-colors ${"created"===h?"":"hover:bg-[var(--hover)]"}`,style:{borderColor:"created"===h?"var(--active-bg)":"var(--border)",background:"created"===h?"var(--active-bg)":void 0,color:"created"===h?"var(--active-text)":"var(--text)"},children:"按创建"})]})]}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-1.5 mb-6",children:[g.map(a=>(0,b.jsx)("button",{onClick:()=>{var b;return b=a.value,void k(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})},className:"px-2 py-0.5 rounded-full text-[11px] border transition-colors",style:{borderColor:j.has(a.value)?"var(--active-bg)":"var(--border)",background:j.has(a.value)?"var(--active-bg)":void 0,color:j.has(a.value)?"var(--active-text)":"var(--text)"},children:a.label},a.value)),j.size>0&&(0,b.jsx)("button",{onClick:()=>k(new Set),className:"px-2 py-0.5 rounded-full text-[11px]",style:{color:"var(--muted)"},children:"清除筛选"})]}),(0,b.jsxs)("div",{className:"relative pl-6",children:[(0,b.jsx)("div",{className:"absolute left-[9px] top-0 bottom-0 w-px",style:{background:"var(--border)"}}),m.map(a=>(0,b.jsxs)("div",{className:"mb-6 relative",children:[(0,b.jsx)("div",{className:"absolute left-[-15px] top-[6px] w-[12px] h-[12px] rounded-full bg-amber-400 border-2 shadow-sm",style:{borderColor:"var(--surface)"}}),(0,b.jsx)("div",{className:"text-[13px] font-medium mb-2",style:{color:"var(--muted)"},children:a.date}),(0,b.jsx)("div",{className:"border rounded-lg p-4",style:{borderColor:"var(--border)",background:"var(--surface)"},children:a.nodes.map(a=>{let c=l.get(a.id);return(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"flex items-center gap-2",children:(0,b.jsx)("div",{className:"flex-1 min-w-0",children:(0,b.jsx)(e.NodeCard,{...a,subtitle:"updated"===h?`创建于 ${a.created}`:`更新于 ${a.updated}`})})}),c&&(0,b.jsxs)("div",{className:"ml-6 mb-1 text-[11px] flex flex-wrap gap-x-3",style:{color:"var(--muted)"},children:[c.derivedFrom.map(a=>(0,b.jsxs)("span",{children:["↑ 演化自 ",(0,b.jsx)(f.default,{href:`/node/${a.id}`,className:"underline",style:{color:"var(--accent)"},children:a.title})]},a.id)),c.splitsInto.map(a=>(0,b.jsxs)("span",{children:["↓ 拆分为 ",(0,b.jsx)(f.default,{href:`/node/${a.id}`,className:"underline",style:{color:"var(--accent)"},children:a.title})]},a.id))]})]},a.id)})})]},a.date))]})]})}a.s(["default",0,function(){return(0,b.jsx)(h,{})}],88111)}];

//# sourceMappingURL=src_app_%28main%29_timeline_page_tsx_12y-0pv._.js.map