maestro-flow 0.4.3 → 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dashboard/dist/assets/{ArtifactsPage-iJZtYsmR.js → ArtifactsPage-CVh0Z2I2.js} +3 -3
- package/dashboard/dist/assets/{ChatInput-DNnDLdQF.js → ChatInput-CBI3qHQQ.js} +2 -2
- package/dashboard/dist/assets/ChatPage-BjJ9CYox.js +22 -0
- package/dashboard/dist/assets/CollabPage-CprGGO9y.js +1 -0
- package/dashboard/dist/assets/{ExecutionPanel-BKV3GZ7Q.js → ExecutionPanel-CClxD7cH.js} +1 -1
- package/dashboard/dist/assets/KanbanPage-copqjdPg.js +16 -0
- package/dashboard/dist/assets/MaestroCoordinatePage-CioZjQ9N.js +4 -0
- package/dashboard/dist/assets/{MarkdownRenderer-cYFfe1uX.js → MarkdownRenderer-CtUhoxCT.js} +1 -1
- package/dashboard/dist/assets/McpPage-BcPPcJpr.js +21 -0
- package/dashboard/dist/assets/{MeetingRoomPage-wnvT7wlB.js → MeetingRoomPage-BgmAKxU-.js} +1 -1
- package/dashboard/dist/assets/{OutputPanel-DDL90Idy.js → OutputPanel-DgT3gMyp.js} +1 -1
- package/dashboard/dist/assets/{ProblemsPanel-zFN9IIs0.js → ProblemsPanel-BmG7rxoG.js} +1 -1
- package/dashboard/dist/assets/{RequirementBoardPage-DOPJoT0I.js → RequirementBoardPage-k8YoeQ0r.js} +1 -1
- package/dashboard/dist/assets/{RequirementPage-CEVquRgM.js → RequirementPage-Da2354px.js} +1 -1
- package/dashboard/dist/assets/{RoomsPage-D5USEWDh.js → RoomsPage-BtqDiYaU.js} +1 -1
- package/dashboard/dist/assets/SpecsPage-ByPVH_M3.js +36 -0
- package/dashboard/dist/assets/{TeamsPage-DlcEmr_Q.js → TeamsPage-sFDLN30L.js} +1 -1
- package/dashboard/dist/assets/{TreeBrowser-Y48Wz-QY.js → TreeBrowser-oEx8YJXV.js} +1 -1
- package/dashboard/dist/assets/WorkflowPage-JrX7CVHh.js +6 -0
- package/dashboard/dist/assets/{arrow-left-NCUOENvg.js → arrow-left-DYvgSdIH.js} +1 -1
- package/dashboard/dist/assets/{check-o7nfGNHf.js → check-jcgYBWVR.js} +1 -1
- package/dashboard/dist/assets/{chevron-right-BXySK2fn.js → chevron-right-DvZ5sMOg.js} +1 -1
- package/dashboard/dist/assets/{circle-cooAwnAR.js → circle-DYT-zoRZ.js} +1 -1
- package/dashboard/dist/assets/{circle-alert-DcSBokh4.js → circle-alert-Bfbv3gt4.js} +1 -1
- package/dashboard/dist/assets/{circle-check-Cd-jce4j.js → circle-check-D82WnpbI.js} +1 -1
- package/dashboard/dist/assets/{circle-check-big-BN7Mdp4i.js → circle-check-big-CPVD1GKF.js} +1 -1
- package/dashboard/dist/assets/{code-BQa9oL1n.js → code-B3bKFGI4.js} +1 -1
- package/dashboard/dist/assets/{columns-3-BzgxelGx.js → columns-3-BeMAQCix.js} +1 -1
- package/dashboard/dist/assets/{download-swRJnate.js → download-BCtpoWYB.js} +1 -1
- package/dashboard/dist/assets/en-2h6fD0j8.js +1 -0
- package/dashboard/dist/assets/{folder-DbGbLNFN.js → folder-CTj6SNNu.js} +1 -1
- package/dashboard/dist/assets/index-6-yE5Yl9.css +1 -0
- package/dashboard/dist/assets/{index-DIoMBMbv.js → index-BxR_3IbJ.js} +1 -1
- package/dashboard/dist/assets/{index-DLBN_7fb.js → index-CWBJLu42.js} +1 -1
- package/dashboard/dist/assets/index-DpcPd-UG.js +236 -0
- package/dashboard/dist/assets/{list-BTRAIvDq.js → list-BMv8pIQn.js} +1 -1
- package/dashboard/dist/assets/{loader-NHtB6Mdn.js → loader-DdM4VOgF.js} +1 -1
- package/dashboard/dist/assets/{minus-BjMxRTET.js → minus-D15s2E__.js} +1 -1
- package/dashboard/dist/assets/{pen-line-C4_O16H0.js → pen-line-DO6o4xWz.js} +1 -1
- package/dashboard/dist/assets/{pencil-DTmKhyDY.js → pencil-qGxg9jOe.js} +1 -1
- package/dashboard/dist/assets/{proxy-Dtx5p6IO.js → proxy-DOffTzwA.js} +1 -1
- package/dashboard/dist/assets/refresh-cw-C9UNdLCy.js +6 -0
- package/dashboard/dist/assets/{rows-2-GR1dZtRu.js → rows-2-CifAA5SL.js} +1 -1
- package/dashboard/dist/assets/{search-DVtgy2W7.js → search-pe7pU1YN.js} +1 -1
- package/dashboard/dist/assets/{shallow-BOmvDNsv.js → shallow-r7YynQYA.js} +1 -1
- package/dashboard/dist/assets/table-Bh772iIw.js +6 -0
- package/dashboard/dist/assets/{team-types-BPeOvVdA.js → team-types-C_HqX2p2.js} +1 -1
- package/dashboard/dist/assets/{terminal-CzogW4cl.js → terminal-EpmtGBlw.js} +1 -1
- package/dashboard/dist/assets/{trash-2-52LATVfW.js → trash-2-Xen46iNQ.js} +1 -1
- package/dashboard/dist/assets/{users-DLFE2voE.js → users-BLueDPxF.js} +1 -1
- package/dashboard/dist/assets/{zap-DhiYlgyZ.js → zap-DsQCPF61.js} +1 -1
- package/dashboard/dist/assets/zh-CN-r3AvxxOL.js +1 -0
- package/dashboard/dist/index.html +2 -2
- package/dashboard/dist-server/dashboard/src/server/routes/settings.js +70 -1
- package/dashboard/dist-server/dashboard/src/server/routes/settings.js.map +1 -1
- package/dashboard/dist-server/src/types/index.d.ts +48 -6
- package/dist/src/commands/coordinate.d.ts.map +1 -1
- package/dist/src/commands/coordinate.js +2 -0
- package/dist/src/commands/coordinate.js.map +1 -1
- package/dist/src/commands/hooks.d.ts.map +1 -1
- package/dist/src/commands/hooks.js +201 -6
- package/dist/src/commands/hooks.js.map +1 -1
- package/dist/src/commands/spec.d.ts.map +1 -1
- package/dist/src/commands/spec.js +466 -0
- package/dist/src/commands/spec.js.map +1 -1
- package/dist/src/config/index.d.ts +5 -1
- package/dist/src/config/index.d.ts.map +1 -1
- package/dist/src/config/index.js +42 -0
- package/dist/src/config/index.js.map +1 -1
- package/dist/src/hooks/keyword-spec-injector.d.ts.map +1 -1
- package/dist/src/hooks/keyword-spec-injector.js +63 -4
- package/dist/src/hooks/keyword-spec-injector.js.map +1 -1
- package/dist/src/hooks/plugins/spec-analytics-plugin.d.ts +13 -0
- package/dist/src/hooks/plugins/spec-analytics-plugin.d.ts.map +1 -0
- package/dist/src/hooks/plugins/spec-analytics-plugin.js +92 -0
- package/dist/src/hooks/plugins/spec-analytics-plugin.js.map +1 -0
- package/dist/src/hooks/plugins/spec-injection-plugin.d.ts.map +1 -1
- package/dist/src/hooks/plugins/spec-injection-plugin.js +57 -4
- package/dist/src/hooks/plugins/spec-injection-plugin.js.map +1 -1
- package/dist/src/hooks/spec-analytics.d.ts +128 -0
- package/dist/src/hooks/spec-analytics.d.ts.map +1 -0
- package/dist/src/hooks/spec-analytics.js +311 -0
- package/dist/src/hooks/spec-analytics.js.map +1 -0
- package/dist/src/hooks/spec-injector.d.ts.map +1 -1
- package/dist/src/hooks/spec-injector.js +127 -5
- package/dist/src/hooks/spec-injector.js.map +1 -1
- package/dist/src/tools/spec-loader.d.ts +20 -0
- package/dist/src/tools/spec-loader.d.ts.map +1 -1
- package/dist/src/tools/spec-loader.js +58 -7
- package/dist/src/tools/spec-loader.js.map +1 -1
- package/dist/src/tui/config-ui/ConfigHub.d.ts +1 -1
- package/dist/src/tui/config-ui/ConfigHub.d.ts.map +1 -1
- package/dist/src/tui/config-ui/ConfigHub.js +16 -10
- package/dist/src/tui/config-ui/ConfigHub.js.map +1 -1
- package/dist/src/tui/config-ui/ConfigSourcesView.d.ts.map +1 -1
- package/dist/src/tui/config-ui/ConfigSourcesView.js +3 -2
- package/dist/src/tui/config-ui/ConfigSourcesView.js.map +1 -1
- package/dist/src/tui/config-ui/HooksPanel.d.ts.map +1 -1
- package/dist/src/tui/config-ui/HooksPanel.js +15 -19
- package/dist/src/tui/config-ui/HooksPanel.js.map +1 -1
- package/dist/src/tui/config-ui/SkillConfigDashboard.d.ts.map +1 -1
- package/dist/src/tui/config-ui/SkillConfigDashboard.js +5 -9
- package/dist/src/tui/config-ui/SkillConfigDashboard.js.map +1 -1
- package/dist/src/tui/config-ui/SkillParamEditor.d.ts.map +1 -1
- package/dist/src/tui/config-ui/SkillParamEditor.js +1 -3
- package/dist/src/tui/config-ui/SkillParamEditor.js.map +1 -1
- package/dist/src/tui/config-ui/SkillsList.d.ts.map +1 -1
- package/dist/src/tui/config-ui/SkillsList.js +7 -9
- package/dist/src/tui/config-ui/SkillsList.js.map +1 -1
- package/dist/src/tui/config-ui/SpecAnalyticsPanel.d.ts +6 -0
- package/dist/src/tui/config-ui/SpecAnalyticsPanel.d.ts.map +1 -0
- package/dist/src/tui/config-ui/SpecAnalyticsPanel.js +164 -0
- package/dist/src/tui/config-ui/SpecAnalyticsPanel.js.map +1 -0
- package/dist/src/tui/config-ui/SpecPanel.d.ts.map +1 -1
- package/dist/src/tui/config-ui/SpecPanel.js +918 -20
- package/dist/src/tui/config-ui/SpecPanel.js.map +1 -1
- package/dist/src/tui/config-ui/index.d.ts +3 -1
- package/dist/src/tui/config-ui/index.d.ts.map +1 -1
- package/dist/src/tui/config-ui/index.js +4 -0
- package/dist/src/tui/config-ui/index.js.map +1 -1
- package/dist/src/tui/install-ui/BackupConfig.d.ts.map +1 -1
- package/dist/src/tui/install-ui/BackupConfig.js +3 -2
- package/dist/src/tui/install-ui/BackupConfig.js.map +1 -1
- package/dist/src/tui/install-ui/BlueprintPreview.d.ts.map +1 -1
- package/dist/src/tui/install-ui/BlueprintPreview.js +7 -6
- package/dist/src/tui/install-ui/BlueprintPreview.js.map +1 -1
- package/dist/src/tui/install-ui/ComponentGrid.d.ts.map +1 -1
- package/dist/src/tui/install-ui/ComponentGrid.js +3 -2
- package/dist/src/tui/install-ui/ComponentGrid.js.map +1 -1
- package/dist/src/tui/install-ui/ConfigPanel.d.ts.map +1 -1
- package/dist/src/tui/install-ui/ConfigPanel.js +4 -3
- package/dist/src/tui/install-ui/ConfigPanel.js.map +1 -1
- package/dist/src/tui/install-ui/CyberItem.d.ts.map +1 -1
- package/dist/src/tui/install-ui/CyberItem.js +7 -6
- package/dist/src/tui/install-ui/CyberItem.js.map +1 -1
- package/dist/src/tui/install-ui/CyberdeckBlueprint.d.ts.map +1 -1
- package/dist/src/tui/install-ui/CyberdeckBlueprint.js +2 -1
- package/dist/src/tui/install-ui/CyberdeckBlueprint.js.map +1 -1
- package/dist/src/tui/install-ui/ExecutionView.d.ts.map +1 -1
- package/dist/src/tui/install-ui/ExecutionView.js +3 -2
- package/dist/src/tui/install-ui/ExecutionView.js.map +1 -1
- package/dist/src/tui/install-ui/GradientHeader.d.ts.map +1 -1
- package/dist/src/tui/install-ui/GradientHeader.js +2 -1
- package/dist/src/tui/install-ui/GradientHeader.js.map +1 -1
- package/dist/src/tui/install-ui/HooksConfig.d.ts.map +1 -1
- package/dist/src/tui/install-ui/HooksConfig.js +8 -8
- package/dist/src/tui/install-ui/HooksConfig.js.map +1 -1
- package/dist/src/tui/install-ui/InstallConfirm.d.ts.map +1 -1
- package/dist/src/tui/install-ui/InstallConfirm.js +4 -3
- package/dist/src/tui/install-ui/InstallConfirm.js.map +1 -1
- package/dist/src/tui/install-ui/InstallExecution.d.ts.map +1 -1
- package/dist/src/tui/install-ui/InstallExecution.js +3 -2
- package/dist/src/tui/install-ui/InstallExecution.js.map +1 -1
- package/dist/src/tui/install-ui/InstallFlow.d.ts.map +1 -1
- package/dist/src/tui/install-ui/InstallFlow.js +3 -2
- package/dist/src/tui/install-ui/InstallFlow.js.map +1 -1
- package/dist/src/tui/install-ui/InstallHub.d.ts.map +1 -1
- package/dist/src/tui/install-ui/InstallHub.js +9 -8
- package/dist/src/tui/install-ui/InstallHub.js.map +1 -1
- package/dist/src/tui/install-ui/InstallResult.d.ts.map +1 -1
- package/dist/src/tui/install-ui/InstallResult.js +3 -2
- package/dist/src/tui/install-ui/InstallResult.js.map +1 -1
- package/dist/src/tui/install-ui/McpConfig.d.ts.map +1 -1
- package/dist/src/tui/install-ui/McpConfig.js +4 -3
- package/dist/src/tui/install-ui/McpConfig.js.map +1 -1
- package/dist/src/tui/install-ui/ResultDashboard.d.ts.map +1 -1
- package/dist/src/tui/install-ui/ResultDashboard.js +3 -2
- package/dist/src/tui/install-ui/ResultDashboard.js.map +1 -1
- package/dist/src/tui/install-ui/ReviewPanel.d.ts.map +1 -1
- package/dist/src/tui/install-ui/ReviewPanel.js +2 -1
- package/dist/src/tui/install-ui/ReviewPanel.js.map +1 -1
- package/dist/src/tui/install-ui/StatuslineConfig.d.ts.map +1 -1
- package/dist/src/tui/install-ui/StatuslineConfig.js +3 -2
- package/dist/src/tui/install-ui/StatuslineConfig.js.map +1 -1
- package/dist/src/tui/install-ui/StepSelector.d.ts.map +1 -1
- package/dist/src/tui/install-ui/StepSelector.js +11 -10
- package/dist/src/tui/install-ui/StepSelector.js.map +1 -1
- package/dist/src/tui/overlay-ui/OverlayList.d.ts.map +1 -1
- package/dist/src/tui/overlay-ui/OverlayList.js +8 -12
- package/dist/src/tui/overlay-ui/OverlayList.js.map +1 -1
- package/dist/src/tui/shared/components.d.ts +56 -0
- package/dist/src/tui/shared/components.d.ts.map +1 -0
- package/dist/src/tui/shared/components.js +55 -0
- package/dist/src/tui/shared/components.js.map +1 -0
- package/dist/src/tui/shared/helpers.d.ts +24 -0
- package/dist/src/tui/shared/helpers.d.ts.map +1 -0
- package/dist/src/tui/shared/helpers.js +49 -0
- package/dist/src/tui/shared/helpers.js.map +1 -0
- package/dist/src/tui/shared/index.d.ts +4 -0
- package/dist/src/tui/shared/index.d.ts.map +1 -0
- package/dist/src/tui/shared/index.js +7 -0
- package/dist/src/tui/shared/index.js.map +1 -0
- package/dist/src/tui/shared/tokens.d.ts +79 -0
- package/dist/src/tui/shared/tokens.d.ts.map +1 -0
- package/dist/src/tui/shared/tokens.js +81 -0
- package/dist/src/tui/shared/tokens.js.map +1 -0
- package/dist/src/tui/tools-ui/CommandReference.d.ts.map +1 -1
- package/dist/src/tui/tools-ui/CommandReference.js +2 -4
- package/dist/src/tui/tools-ui/CommandReference.js.map +1 -1
- package/dist/src/tui/tools-ui/ConfigSources.d.ts.map +1 -1
- package/dist/src/tui/tools-ui/ConfigSources.js +3 -2
- package/dist/src/tui/tools-ui/ConfigSources.js.map +1 -1
- package/dist/src/tui/tools-ui/RegisterSettings.d.ts.map +1 -1
- package/dist/src/tui/tools-ui/RegisterSettings.js +2 -1
- package/dist/src/tui/tools-ui/RegisterSettings.js.map +1 -1
- package/dist/src/tui/tools-ui/RoleMappings.d.ts.map +1 -1
- package/dist/src/tui/tools-ui/RoleMappings.js +3 -5
- package/dist/src/tui/tools-ui/RoleMappings.js.map +1 -1
- package/dist/src/tui/tools-ui/ToolsDashboard.d.ts.map +1 -1
- package/dist/src/tui/tools-ui/ToolsDashboard.js +3 -5
- package/dist/src/tui/tools-ui/ToolsDashboard.js.map +1 -1
- package/dist/src/tui/tools-ui/ToolsOverview.d.ts.map +1 -1
- package/dist/src/tui/tools-ui/ToolsOverview.js +3 -5
- package/dist/src/tui/tools-ui/ToolsOverview.js.map +1 -1
- package/dist/src/tui/uninstall-ui/UninstallFlow.d.ts.map +1 -1
- package/dist/src/tui/uninstall-ui/UninstallFlow.js +8 -7
- package/dist/src/tui/uninstall-ui/UninstallFlow.js.map +1 -1
- package/dist/src/types/index.d.ts +48 -6
- package/dist/src/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/dashboard/dist/assets/ChatPage-BjBibfE4.js +0 -22
- package/dashboard/dist/assets/CollabPage-8lUMUol_.js +0 -1
- package/dashboard/dist/assets/KanbanPage-diY3QmGd.js +0 -21
- package/dashboard/dist/assets/McpPage-COjuIf7U.js +0 -21
- package/dashboard/dist/assets/SpecsPage-BOwBin_o.js +0 -36
- package/dashboard/dist/assets/SupervisorPage-5iRyMU5T.js +0 -6
- package/dashboard/dist/assets/WorkflowPage-CmQaRVgL.js +0 -6
- package/dashboard/dist/assets/en-C_BD3UCD.js +0 -1
- package/dashboard/dist/assets/index-BEUaOz_b.css +0 -1
- package/dashboard/dist/assets/index-uIqUCT8y.js +0 -236
- package/dashboard/dist/assets/table-DCzuJAFh.js +0 -6
- package/dashboard/dist/assets/zh-CN-DvQKfow3.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{d as W,r as d,A as J,j as e,F as C,o as xe,W as j,p as pe,V as ue,X as fe,n as Z,B as he}from"./index-
|
|
1
|
+
import{d as W,r as d,A as J,j as e,F as C,o as xe,W as j,p as pe,V as ue,X as fe,n as Z,B as he}from"./index-DpcPd-UG.js";import{C as me}from"./code-B3bKFGI4.js";import{S as X}from"./search-pe7pU1YN.js";import{u as Q}from"./shallow-r7YynQYA.js";import{F as M,T as ge}from"./TreeBrowser-oEx8YJXV.js";import{M as ve}from"./MarkdownRenderer-CtUhoxCT.js";import{C as ee}from"./chevron-right-DvZ5sMOg.js";import{D as te}from"./folder-CTj6SNNu.js";import{C as re}from"./circle-DYT-zoRZ.js";import{C as $}from"./circle-check-D82WnpbI.js";import{A as be}from"./index-BxR_3IbJ.js";import{m as N}from"./proxy-DOffTzwA.js";/**
|
|
2
2
|
* @license lucide-react v0.577.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -15,7 +15,7 @@ import{d as W,r as d,A as J,j as e,F as C,o as xe,W as j,p as pe,V as ue,X as fe
|
|
|
15
15
|
* See the LICENSE file in the root directory of this source tree.
|
|
16
16
|
*/const ke=[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]],Ce=W("library",ke);function Se(){const[t,r]=d.useState([]),[a,s]=d.useState(null),[i,o]=d.useState(null),[c,n]=d.useState(!1),[l,x]=d.useState(!0),[p,u]=d.useState(null),f=d.useCallback(async()=>{x(!0);try{const b=await fetch(`${J.ARTIFACTS}/?tree=true`);if(!b.ok){u(`Failed to load tree: ${b.status}`);return}const y=await b.json();r(y),u(null)}catch{u("Failed to connect to server")}finally{x(!1)}},[]);d.useEffect(()=>{f()},[f]);const g=d.useCallback(async b=>{s(b),n(!0),u(null);try{const y=await fetch(`${J.ARTIFACTS}/${b}`);if(!y.ok){u(`Failed to load file: ${y.status}`),o(null);return}const S=await y.text();o(S)}catch{u("Failed to fetch file content"),o(null)}finally{n(!1)}},[]);return{tree:t,selectedPath:a,content:i,loading:c,treeLoading:l,error:p,selectFile:g,refreshTree:f}}function se({data:t}){const[r,a]=d.useState(!1);return e.jsxs("div",{className:"font-mono text-[length:var(--font-size-sm)] leading-[var(--line-height-normal)]",role:"tree","aria-label":"JSON data viewer",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] mb-[var(--spacing-3)] pb-[var(--spacing-2)] border-b border-border bg-bg-secondary px-[var(--spacing-2)] py-[var(--spacing-1-5)] -mx-[var(--spacing-2)] -mt-[var(--spacing-1)]",children:[e.jsx("button",{type:"button",onClick:()=>a(s=>!s),"aria-label":r?"Expand all":"Collapse all",className:["px-[var(--spacing-2)] py-[var(--spacing-1)] text-[length:var(--font-size-xs)] rounded-[var(--radius-default)]","text-text-secondary hover:bg-bg-hover hover:text-text-primary","transition-colors duration-[var(--duration-fast)] ease-[var(--ease-notion)]","focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus-ring)]","active:scale-[0.98] active:duration-[var(--duration-fast)]"].join(" "),children:r?"Expand All":"Collapse All"}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] text-text-tertiary",children:"Click a value to copy"})]}),e.jsx(_,{value:t,path:"$",depth:0,forceCollapse:r})]})}function _({value:t,path:r,depth:a,keyName:s,forceCollapse:i}){const[o,c]=d.useState(a>2),n=i?!0:o,l=d.useCallback(u=>{navigator.clipboard.writeText(u).catch(()=>{})},[]),x=a*16;if(t===null)return e.jsxs("div",{className:"flex items-center gap-[var(--spacing-1)] hover:bg-bg-hover rounded-[var(--radius-default)] transition-colors duration-[var(--duration-fast)]",style:{paddingLeft:x},role:"treeitem",children:[s!==void 0&&e.jsx(w,{name:s}),e.jsx("span",{className:"text-text-tertiary cursor-pointer hover:opacity-70",onClick:()=>l("null"),title:`Copy: null | Path: ${r}`,children:"null"})]});if(typeof t!="object"){const{colorVar:u,display:f}=Ie(t);return e.jsxs("div",{className:"flex items-center gap-[var(--spacing-1)] hover:bg-bg-hover rounded-[var(--radius-default)] transition-colors duration-[var(--duration-fast)]",style:{paddingLeft:x},role:"treeitem",children:[s!==void 0&&e.jsx(w,{name:s}),e.jsx("span",{className:"cursor-pointer hover:opacity-70",style:{color:u},onClick:()=>l(String(t)),title:`Copy value | Path: ${r}`,children:f})]})}if(Array.isArray(t))return t.length===0?e.jsxs("div",{className:"flex items-center gap-[var(--spacing-1)]",style:{paddingLeft:x},role:"treeitem",children:[s!==void 0&&e.jsx(w,{name:s}),e.jsx("span",{className:"text-text-tertiary",children:"[]"})]}):e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-1)] cursor-pointer hover:bg-bg-hover rounded-[var(--radius-default)] px-[var(--spacing-1)] transition-colors duration-[var(--duration-fast)]",style:{paddingLeft:x},onClick:()=>c(u=>!u),role:"treeitem","aria-expanded":!n,children:[e.jsx(D,{open:!n}),s!==void 0&&e.jsx(w,{name:s}),e.jsxs("span",{className:"text-text-tertiary",children:["[",n?`${t.length} items`:""]})]}),!n&&e.jsxs(e.Fragment,{children:[t.map((u,f)=>e.jsx(_,{value:u,path:`${r}[${f}]`,depth:a+1,keyName:String(f),forceCollapse:i},f)),e.jsx("div",{style:{paddingLeft:x},children:e.jsx("span",{className:"text-text-tertiary",children:"]"})})]}),n&&e.jsx("span",{className:"text-text-tertiary",style:{paddingLeft:x},children:"]"})]});const p=Object.entries(t);return p.length===0?e.jsxs("div",{className:"flex items-center gap-[var(--spacing-1)]",style:{paddingLeft:x},role:"treeitem",children:[s!==void 0&&e.jsx(w,{name:s}),e.jsx("span",{className:"text-text-tertiary",children:"{}"})]}):e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-1)] cursor-pointer hover:bg-bg-hover rounded-[var(--radius-default)] px-[var(--spacing-1)] transition-colors duration-[var(--duration-fast)]",style:{paddingLeft:x},onClick:()=>c(u=>!u),role:"treeitem","aria-expanded":!n,children:[e.jsx(D,{open:!n}),s!==void 0&&e.jsx(w,{name:s}),e.jsxs("span",{className:"text-text-tertiary",children:["{",n?`${p.length} keys`:""]})]}),!n&&e.jsxs(e.Fragment,{children:[p.map(([u,f])=>e.jsx(_,{value:f,path:`${r}.${u}`,depth:a+1,keyName:u,forceCollapse:i},u)),e.jsx("div",{style:{paddingLeft:x},children:e.jsx("span",{className:"text-text-tertiary",children:"}"})})]}),n&&e.jsx("span",{className:"text-text-tertiary",style:{paddingLeft:x},children:"}"})]})}function w({name:t}){return e.jsxs("span",{className:"text-text-primary font-[var(--font-weight-medium)]",children:['"',t,'"',e.jsx("span",{className:"text-text-tertiary",children:": "})]})}function D({open:t}){return e.jsx("span",{className:["text-text-tertiary text-[length:var(--font-size-xs)] w-[var(--size-icon-sm)] inline-flex items-center justify-center select-none","transition-transform duration-[var(--duration-normal)] ease-[var(--ease-notion)]",t?"rotate-90":""].join(" "),children:"▸"})}function Ie(t){return typeof t=="string"?{colorVar:"var(--color-status-completed)",display:`"${t}"`}:typeof t=="number"?{colorVar:"var(--color-accent-blue)",display:String(t)}:typeof t=="boolean"?{colorVar:"var(--color-accent-yellow)",display:String(t)}:{colorVar:"var(--color-text-tertiary)",display:String(t)}}function ae({content:t,path:r,rawOverride:a}){const[s,i]=d.useState(!1),o=Ee(r),c=a!==void 0,n=c?a:s;return c?e.jsx("div",{role:"region","aria-label":"File content",children:n?e.jsx(I,{content:t}):e.jsx(K,{content:t,ext:o})}):e.jsxs("div",{className:"flex flex-col h-full",role:"region","aria-label":"File content",children:[e.jsxs("div",{className:"flex items-center justify-between px-[var(--spacing-3)] py-[var(--spacing-2)] border-b border-border bg-bg-secondary shrink-0 h-9",children:[e.jsx("span",{className:"text-[length:var(--font-size-sm)] text-text-secondary font-mono truncate",children:r}),e.jsx("button",{type:"button",onClick:()=>i(l=>!l),"aria-pressed":n,"aria-label":n?"Show rendered view":"Show raw view",className:["px-[var(--spacing-2)] py-[var(--spacing-1)] text-[length:var(--font-size-xs)] rounded-[var(--radius-default)]","transition-colors duration-[var(--duration-fast)] ease-[var(--ease-notion)]","focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus-ring)]",n?"bg-bg-active text-accent-blue font-[var(--font-weight-medium)]":"text-text-secondary hover:bg-bg-hover hover:text-text-primary"].join(" "),children:n?"Rendered":"Raw"})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-[var(--spacing-4)] bg-bg-primary",children:n?e.jsx(I,{content:t}):e.jsx(K,{content:t,ext:o})})]})}function K({content:t,ext:r}){switch(r){case".md":return e.jsx(ve,{content:t});case".json":return e.jsx(Fe,{content:t});case".ndjson":return e.jsx(Le,{content:t});default:return e.jsx(I,{content:t})}}function Fe({content:t}){try{const r=JSON.parse(t);return e.jsx(se,{data:r})}catch{return e.jsxs("div",{children:[e.jsx("p",{className:"text-status-blocked text-[length:var(--font-size-sm)] mb-[var(--spacing-2)]",children:"Invalid JSON"}),e.jsx(I,{content:t})]})}}function Le({content:t}){const r=t.split(`
|
|
17
17
|
`).filter(a=>a.trim().length>0);return r.length===0?e.jsx("p",{className:"text-text-secondary text-[length:var(--font-size-sm)] italic",children:"Empty NDJSON file"}):e.jsxs("div",{className:"space-y-[var(--spacing-3)]",children:[e.jsxs("p",{className:"text-[length:var(--font-size-xs)] text-text-secondary mb-[var(--spacing-2)]",children:[r.length," record",r.length!==1?"s":""]}),r.map((a,s)=>{try{const i=JSON.parse(a);return e.jsxs("div",{className:"border border-border rounded-[var(--radius-default)] p-[var(--spacing-2)] bg-bg-secondary",children:[e.jsxs("span",{className:"text-[length:var(--font-size-xs)] text-text-secondary mb-[var(--spacing-1)] block",children:["#",s+1]}),e.jsx(se,{data:i})]},s)}catch{return e.jsxs("div",{className:"border border-border rounded-[var(--radius-default)] p-[var(--spacing-2)] bg-bg-secondary",children:[e.jsxs("span",{className:"text-[length:var(--font-size-xs)] text-text-secondary",children:["#",s+1," (invalid)"]}),e.jsx("pre",{className:"text-[length:var(--font-size-sm)] font-mono text-text-primary whitespace-pre-wrap mt-[var(--spacing-1)]",children:a})]},s)}})]})}function I({content:t}){return e.jsx("pre",{className:"font-mono text-[length:var(--font-size-sm)] text-text-primary whitespace-pre-wrap break-words leading-[var(--line-height-relaxed)]",children:t})}function Ee(t){const r=t.lastIndexOf(".");return r===-1?"":t.slice(r).toLowerCase()}function ze(t){const r=t.lastIndexOf(".");return r===-1?"":t.slice(r).toLowerCase()}function Te(t){const r=[],a=t.split(`
|
|
18
|
-
`);for(const s of a){const i=s.match(/^(#{1,4})\s+(.+)/);i&&r.push({level:i[1].length,text:i[2].trim()})}return r}function Oe(t){try{const r=JSON.parse(t);return typeof r!="object"||r===null||Array.isArray(r)?[]:Object.entries(r).map(([a,s])=>({key:a,type:Array.isArray(s)?"array":typeof s}))}catch{return[]}}function Ae({path:t,content:r}){if(!t)return e.jsx("div",{className:"w-[240px] bg-bg-primary border-l border-border shrink-0 flex items-center justify-center",children:e.jsx("p",{className:"text-[length:var(--font-size-xs)] text-text-tertiary",children:"No file selected"})});const a=ze(t),s=t.includes("/")?t.slice(t.lastIndexOf("/")+1):t,i=t.includes("/")?t.slice(0,t.lastIndexOf("/")):"/";return e.jsxs("div",{className:"w-[240px] bg-bg-primary border-l border-border shrink-0 flex flex-col overflow-hidden",children:[e.jsx("div",{className:"px-[14px] py-[10px] border-b border-border-divider text-[length:var(--font-size-sm)] font-[var(--font-weight-semibold)] text-text-primary shrink-0",children:"Properties"}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-[14px] py-[var(--spacing-3)]",children:[e.jsxs(F,{title:"File Info",defaultOpen:!0,children:[e.jsx(T,{label:"Name",value:s}),e.jsx(T,{label:"Type",value:a.replace(".","").toUpperCase()||"Unknown"}),e.jsx(T,{label:"Directory",value:i,mono:!0})]}),e.jsx(F,{title:"Tags",children:e.jsxs("div",{className:"flex flex-wrap gap-[var(--spacing-1)]",children:[e.jsx(O,{label:a.replace(".","")||"file",color:"blue"}),t.includes("phase")&&e.jsx(O,{label:"phase",color:"purple"}),t.includes("verification")&&e.jsx(O,{label:"verify",color:"green"})]})}),a===".md"&&r&&e.jsx($e,{content:r}),a===".json"&&r&&e.jsx(_e,{content:r})]})]})}function F({title:t,defaultOpen:r=!0,children:a}){const[s,i]=d.useState(r);return e.jsxs("div",{className:"mb-[var(--spacing-4)]",children:[e.jsxs("button",{type:"button",onClick:()=>i(o=>!o),className:["flex items-center gap-[var(--spacing-1)] w-full text-left mb-[var(--spacing-1-5)]","text-[9px] font-[var(--font-weight-semibold)] uppercase tracking-[0.06em] text-text-placeholder","hover:text-text-secondary transition-colors duration-[var(--duration-fast)]"].join(" "),children:[e.jsx(ee,{size:10,strokeWidth:2.5,className:["transition-transform duration-[var(--duration-fast)]",s?"rotate-90":""].join(" ")}),t]}),s&&a]})}function T({label:t,value:r,mono:a}){return e.jsxs("div",{className:"flex items-center justify-between py-[var(--spacing-1)] text-[length:var(--font-size-sm)]",children:[e.jsx("span",{className:"text-text-tertiary",children:t}),e.jsx("span",{className:`text-text-primary font-[var(--font-weight-medium)] ${a?"font-mono text-[11px]":""} truncate max-w-[140px]`,children:r})]})}function O({label:t,color:r}){const s={blue:{bg:"rgba(91,141,184,0.12)",text:"var(--color-accent-blue)"},purple:{bg:"rgba(145,120,181,0.12)",text:"var(--color-accent-purple, #9178B5)"},green:{bg:"rgba(90,158,120,0.12)",text:"var(--color-status-completed)"}}[r];return e.jsx("span",{className:"text-[10px] font-[var(--font-weight-semibold)] px-[var(--spacing-2)] py-[2px] rounded-full",style:{background:s.bg,color:s.text},children:t})}function $e({content:t}){const r=d.useMemo(()=>Te(t),[t]);return r.length===0?null:e.jsx(F,{title:"Outline",children:e.jsx("div",{className:"flex flex-col gap-[2px]",children:r.map((a,s)=>e.jsxs("button",{type:"button",className:["flex items-center gap-[var(--spacing-1-5)] px-[var(--spacing-2)] py-[3px] rounded-[var(--radius-sm)] text-[11px] w-full text-left","hover:bg-bg-hover hover:text-text-primary transition-colors duration-[var(--duration-fast)] cursor-pointer",s===0?"text-text-primary font-[var(--font-weight-semibold)]":"text-text-tertiary"].join(" "),style:{paddingLeft:(a.level-1)*10+8},children:[e.jsx("span",{className:"w-1 h-1 rounded-full shrink-0",style:{background:s===0?"var(--color-accent-purple)":"var(--color-text-placeholder)"}}),e.jsx("span",{className:"truncate",children:a.text})]},s))})})}function _e({content:t}){const r=d.useMemo(()=>Oe(t),[t]);return r.length===0?null:e.jsx(F,{title:"Structure",children:e.jsx("div",{className:"flex flex-col gap-0",children:r.map(a=>e.jsxs("div",{className:"flex items-center justify-between py-[var(--spacing-1)] text-[length:var(--font-size-sm)]",children:[e.jsx("span",{className:"text-text-primary font-mono text-[11px] truncate max-w-[120px]",children:a.key}),e.jsx("span",{className:"text-text-placeholder text-[10px]",children:a.type})]},a.key))})})}function We(t){switch(t.slice(t.lastIndexOf(".")).toLowerCase()){case".json":return{Icon:M,bg:"rgba(184,149,64,0.10)",color:"var(--color-accent-yellow)"};case".md":return{Icon:C,bg:"rgba(91,141,184,0.10)",color:"var(--color-accent-blue)"};case".ndjson":return{Icon:te,bg:"rgba(200,134,58,0.10)",color:"var(--color-accent-orange, #C8863A)"};default:return{Icon:C,bg:"rgba(160,157,151,0.10)",color:"var(--color-text-tertiary)"}}}function ne({content:t,path:r,onNavigate:a,loading:s,error:i,title:o,subtitle:c}){const[n,l]=d.useState(!1);if(i)return e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsx("div",{role:"alert",className:"px-[var(--spacing-3)] py-[var(--spacing-2)] text-[length:var(--font-size-xs)] rounded-[var(--radius-default)]",style:{backgroundColor:"var(--color-status-bg-blocked)",color:"var(--color-status-blocked)",borderColor:"var(--color-status-blocked)"},children:i})});if(s)return e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsx("p",{className:"text-text-secondary text-[length:var(--font-size-sm)] animate-pulse",children:"Loading..."})});if(!r||t===null)return e.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-text-secondary",children:[e.jsx("p",{className:"text-[length:var(--font-size-lg)] mb-[var(--spacing-2)]",children:"Select a file"}),e.jsx("p",{className:"text-[length:var(--font-size-sm)]",children:"Choose an artifact from the tree to view"})]});const x=r.includes("/")?r.slice(r.lastIndexOf("/")+1):r,{Icon:p,bg:u,color:f}=We(r);return e.jsxs("div",{className:"flex h-full overflow-hidden",children:[e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-3)] px-[24px] py-[10px] border-b border-border-divider shrink-0",children:[e.jsx("div",{className:"w-7 h-7 rounded-[var(--radius-default)] flex items-center justify-center shrink-0",style:{background:u,color:f},children:e.jsx(p,{size:14,strokeWidth:1.8})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[c&&e.jsx("div",{className:"text-[10px] uppercase tracking-wider text-text-tertiary font-medium truncate",children:c}),e.jsx("div",{className:"text-[14px] font-[var(--font-weight-bold)] text-text-primary truncate",children:o??x}),e.jsx("div",{className:"text-[10px] font-mono text-text-tertiary truncate",children:r})]}),e.jsxs("div",{className:"flex gap-[var(--spacing-1)]",children:[e.jsx("button",{type:"button",onClick:()=>l(!1),className:["px-[10px] py-[var(--spacing-1)] rounded-[var(--radius-default)] border text-[10px] font-[var(--font-weight-semibold)]","transition-all duration-[var(--duration-fast)] ease-[var(--ease-notion)]","focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus-ring)]",n?"bg-bg-card text-text-secondary border-border hover:border-text-tertiary hover:text-text-primary":"bg-text-primary text-bg-primary border-text-primary"].join(" "),children:"Rendered"}),e.jsx("button",{type:"button",onClick:()=>l(!0),className:["px-[10px] py-[var(--spacing-1)] rounded-[var(--radius-default)] border text-[10px] font-[var(--font-weight-semibold)]","transition-all duration-[var(--duration-fast)] ease-[var(--ease-notion)]","focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus-ring)]",n?"bg-text-primary text-bg-primary border-text-primary":"bg-bg-card text-text-secondary border-border hover:border-text-tertiary hover:text-text-primary"].join(" "),children:"Source"})]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsx("div",{className:"max-w-[720px] mx-auto px-[32px] py-[24px]",children:e.jsx(ae,{content:t,path:r,rawOverride:n})})})]}),e.jsx(Ae,{path:r,content:t})]})}function Me(t){const r=t.slice(t.lastIndexOf(".")).toLowerCase();switch(r){case".json":return"json";case".md":return"md";case".ndjson":return"jsonl";default:return r.replace(".","")||"file"}}function Re(t){switch(t){case"json":return{Icon:M,tintBg:"rgba(184,149,64,0.10)",iconColor:"var(--color-accent-yellow)",badgeBg:"rgba(184,149,64,0.12)",badgeColor:"var(--color-accent-yellow)"};case"md":return{Icon:C,tintBg:"rgba(91,141,184,0.10)",iconColor:"var(--color-accent-blue)",badgeBg:"rgba(91,141,184,0.12)",badgeColor:"var(--color-accent-blue)"};case"jsonl":return{Icon:te,tintBg:"rgba(200,134,58,0.10)",iconColor:"var(--color-accent-orange, #C8863A)",badgeBg:"rgba(200,134,58,0.12)",badgeColor:"var(--color-accent-orange, #C8863A)"};default:return{Icon:C,tintBg:"rgba(160,157,151,0.10)",iconColor:"var(--color-text-tertiary)",badgeBg:"rgba(160,157,151,0.12)",badgeColor:"var(--color-text-tertiary)"}}}function Ve({name:t,path:r,isSelected:a,onClick:s}){const i=Me(t),o=Re(i),{Icon:c}=o,n=r.includes("/")?r.slice(0,r.lastIndexOf("/")):"";return e.jsxs("button",{type:"button",onClick:s,className:["bg-bg-card border rounded-[var(--radius-lg)] p-[14px_16px] cursor-pointer text-left w-full","transition-all duration-[180ms] ease-[var(--ease-spring)]","flex flex-col gap-[var(--spacing-2)]","hover:-translate-y-[2px] hover:shadow-[0_6px_20px_rgba(0,0,0,0.06)]","focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus-ring)]",a?"border-accent-purple shadow-[0_0_0_2px_rgba(145,120,181,0.2)]":"border-border-divider hover:border-border"].join(" "),children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)]",children:[e.jsx("div",{className:"w-8 h-8 rounded-[var(--radius-md)] flex items-center justify-center shrink-0",style:{background:o.tintBg,color:o.iconColor},children:e.jsx(c,{size:16,strokeWidth:1.8})}),e.jsx("span",{className:"text-[length:var(--font-size-sm)] font-[var(--font-weight-semibold)] text-text-primary flex-1 truncate",children:t}),e.jsx("span",{className:"text-[9px] font-[var(--font-weight-semibold)] px-[5px] py-[1px] rounded-[var(--radius-sm)] uppercase font-mono shrink-0",style:{background:o.badgeBg,color:o.badgeColor},children:i})]}),e.jsx("div",{className:"text-[length:var(--font-size-xs)] text-text-tertiary leading-[1.5] line-clamp-3 min-h-[48px]",children:r}),n&&e.jsx("div",{className:"flex items-center gap-[var(--spacing-1-5)] pt-[var(--spacing-1)] border-t border-border-divider",children:e.jsx("span",{className:"text-[10px] text-text-placeholder font-mono truncate",children:n})})]})}function ie(t,r=""){const a=[];for(const s of t)s.type==="file"?a.push({name:s.name,path:s.path,group:r||"root"}):s.children&&a.push(...ie(s.children,s.name));return a}function Pe(t){const r=new Map;for(const a of t){const s=r.get(a.group)||[];s.push(a),r.set(a.group,s)}return r}const Be=["All","json","md","jsonl"];function Je(t){if(t==="root"||!t.match(/^\d{2}-/))return{dotColor:"var(--color-text-tertiary)"};const r=t.toLowerCase();return r.includes("setup")||r.includes("complete")||r.includes("init")?{dotColor:"var(--color-status-completed)",statusLabel:"Done",statusBg:"var(--color-status-bg-completed)",statusColor:"var(--color-status-completed)"}:{dotColor:"var(--color-accent-yellow)",statusLabel:"Active",statusBg:"var(--color-status-bg-executing)",statusColor:"var(--color-status-executing)"}}function De({tree:t,onSelectFile:r,selectedPath:a}){const[s,i]=d.useState(""),[o,c]=d.useState("All"),n=d.useMemo(()=>ie(t),[t]),l=d.useMemo(()=>{let p=n;if(s.trim()){const u=s.toLowerCase();p=p.filter(f=>f.name.toLowerCase().includes(u)||f.path.toLowerCase().includes(u))}return o!=="All"&&(p=p.filter(u=>{const f=u.name.slice(u.name.lastIndexOf(".")).toLowerCase();return o==="json"?f===".json":o==="md"?f===".md":o==="jsonl"?f===".ndjson"||f===".jsonl":!0})),p},[n,s,o]),x=d.useMemo(()=>Pe(l),[l]);return e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] px-[24px] py-[10px] border-b border-border-divider shrink-0",children:[e.jsxs("div",{className:["flex items-center gap-[var(--spacing-1-5)] px-[var(--spacing-3)] py-[5px] rounded-[var(--radius-md)]","bg-bg-card border border-border w-[200px]","focus-within:border-accent-purple transition-colors duration-[var(--duration-fast)]"].join(" "),children:[e.jsx(X,{size:13,strokeWidth:2,className:"text-text-placeholder shrink-0"}),e.jsx("input",{type:"search",value:s,onChange:p=>i(p.target.value),placeholder:"Search artifacts...","aria-label":"Search artifacts",className:"border-none bg-transparent outline-none text-[12px] text-text-primary placeholder:text-text-placeholder w-full font-[inherit]"})]}),e.jsx("div",{className:"flex-1"}),Be.map(p=>e.jsx("button",{type:"button",onClick:()=>c(p),className:["text-[11px] font-[var(--font-weight-medium)] px-[var(--spacing-3)] py-[var(--spacing-1)] rounded-full","border transition-all duration-[var(--duration-fast)] ease-[var(--ease-notion)]","focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus-ring)]",o===p?"bg-text-primary text-bg-primary border-text-primary":"bg-bg-card text-text-secondary border-border hover:border-text-tertiary hover:text-text-primary"].join(" "),children:p==="All"?"All":p.toUpperCase()},p))]}),e.jsx("div",{className:"flex-1 overflow-y-auto px-[24px] py-[var(--spacing-4)]",children:l.length===0?e.jsx("div",{className:"flex items-center justify-center h-full text-text-tertiary text-[length:var(--font-size-sm)]",children:"No artifacts found"}):Array.from(x.entries()).map(([p,u])=>{const f=Je(p);return e.jsxs("div",{className:"mb-[24px]",children:[e.jsxs("div",{className:"flex items-center gap-[10px] mb-[10px] pl-[var(--spacing-1)]",children:[e.jsx("span",{className:"w-[10px] h-[10px] rounded-full shrink-0",style:{background:f.dotColor}}),e.jsx("span",{className:"text-[13px] font-[var(--font-weight-bold)] text-text-primary",children:p==="root"?"Project":p}),f.statusLabel&&e.jsx("span",{className:"text-[10px] font-[var(--font-weight-semibold)] px-[var(--spacing-2)] py-[2px] rounded-full",style:{background:f.statusBg,color:f.statusColor},children:f.statusLabel}),e.jsxs("span",{className:"text-[11px] text-text-tertiary",children:[u.length," file",u.length!==1?"s":""]}),e.jsx("div",{className:"flex-1 h-px bg-border-divider ml-[var(--spacing-2)]"})]}),e.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(240px,1fr))] gap-[10px]",children:u.map(g=>e.jsx(Ve,{name:g.name,path:g.path,type:g.name.slice(g.name.lastIndexOf(".")),isSelected:g.path===a,onClick:()=>r(g.path)},g.path))})]},p)})})]})}function Ke({content:t,path:r}){const[a,s]=d.useState(!1);if(!r||t===null)return e.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-text-secondary",children:[e.jsx("p",{className:"text-[length:var(--font-size-lg)] mb-[var(--spacing-2)]",children:"Select a file"}),e.jsx("p",{className:"text-[length:var(--font-size-sm)]",children:"Choose a JSON artifact to view its structure"})]});const o=r.slice(r.lastIndexOf(".")).toLowerCase()===".json",c=r.includes("/")?r.slice(r.lastIndexOf("/")+1):r;return o?e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsx(H,{fileName:c,path:r,isJson:!0,rawMode:a,onToggle:()=>s(n=>!n)}),e.jsx("div",{className:"flex-1 overflow-y-auto px-[24px] py-[20px]",children:e.jsx("div",{className:"max-w-[780px] mx-auto",children:a?e.jsx(le,{content:t}):e.jsx(He,{content:t})})})]}):e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsx(H,{fileName:c,path:r,isJson:!1,rawMode:!1,onToggle:()=>{}}),e.jsx("div",{className:"flex-1 overflow-hidden",children:e.jsx(ae,{content:t,path:r})})]})}function H({fileName:t,path:r,isJson:a,rawMode:s,onToggle:i}){const o=a?M:C,c=a?"rgba(184,149,64,0.10)":"rgba(91,141,184,0.10)",n=a?"var(--color-accent-yellow)":"var(--color-accent-blue)";return e.jsxs("div",{className:"flex items-center gap-[var(--spacing-3)] px-[24px] py-[10px] border-b border-border-divider shrink-0",children:[e.jsx("div",{className:"w-7 h-7 rounded-[var(--radius-default)] flex items-center justify-center shrink-0",style:{background:c,color:n},children:e.jsx(o,{size:14,strokeWidth:1.8})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-[14px] font-[var(--font-weight-bold)] text-text-primary truncate",children:t}),e.jsx("div",{className:"text-[10px] font-mono text-text-tertiary truncate",children:r})]}),a&&e.jsxs("div",{className:"flex gap-[var(--spacing-1)]",children:[e.jsx("button",{type:"button",onClick:i,className:["px-[10px] py-[var(--spacing-1)] rounded-[var(--radius-default)] border text-[10px] font-[var(--font-weight-semibold)]","transition-all duration-[var(--duration-fast)] ease-[var(--ease-notion)]","focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus-ring)]",s?"bg-bg-card text-text-secondary border-border hover:border-text-tertiary hover:text-text-primary":"bg-text-primary text-bg-primary border-text-primary"].join(" "),children:"Structured"}),e.jsx("button",{type:"button",onClick:i,className:["px-[10px] py-[var(--spacing-1)] rounded-[var(--radius-default)] border text-[10px] font-[var(--font-weight-semibold)]","transition-all duration-[var(--duration-fast)] ease-[var(--ease-notion)]","focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus-ring)]",s?"bg-text-primary text-bg-primary border-text-primary":"bg-bg-card text-text-secondary border-border hover:border-text-tertiary hover:text-text-primary"].join(" "),children:"Raw"})]})]})}function He({content:t}){const r=d.useMemo(()=>{try{return JSON.parse(t)}catch{return null}},[t]);if(!r||typeof r!="object")return e.jsx(le,{content:t});if(Array.isArray(r))return e.jsx("div",{className:"flex flex-col gap-[var(--spacing-4)]",children:r.map((s,i)=>e.jsx(A,{title:`Item ${i+1}`,data:s},i))});const a=Object.entries(r);return e.jsxs("div",{className:"flex flex-col gap-[var(--spacing-4)]",children:[a.map(([s,i])=>Array.isArray(i)&&i.length>0&&typeof i[0]=="object"?e.jsxs("div",{children:[e.jsx(L,{title:s,badge:`${i.length}`}),e.jsx("div",{className:"flex flex-col gap-[var(--spacing-1-5)]",children:i.map((o,c)=>qe(o)?e.jsx(Ue,{data:o},c):Ye(o)?e.jsx(Ze,{data:o},c):e.jsx(A,{title:`#${c+1}`,data:o},c))})]},s):typeof i=="object"&&i!==null&&!Array.isArray(i)?e.jsx(A,{title:s,data:i},s):null),e.jsx(Ge,{data:r})]})}function L({title:t,badge:r}){return e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] mb-[var(--spacing-2)] pb-[var(--spacing-1-5)] border-b border-border-divider",children:[e.jsx("span",{className:"text-[11px] font-[var(--font-weight-bold)] uppercase tracking-[0.06em] text-text-tertiary",children:t}),r&&e.jsx("span",{className:"text-[10px] font-[var(--font-weight-semibold)] px-[var(--spacing-1-5)] py-[1px] rounded-full",style:{background:"rgba(91,141,184,0.12)",color:"var(--color-accent-blue)"},children:r})]})}function A({title:t,data:r}){if(typeof r!="object"||r===null)return e.jsxs("div",{children:[e.jsx(L,{title:t}),e.jsx("div",{className:"text-[13px] text-text-primary",children:String(r)})]});const a=Object.entries(r);return e.jsxs("div",{children:[e.jsx(L,{title:t}),e.jsx("div",{className:"flex flex-col",children:a.map(([s,i])=>e.jsxs("div",{className:"grid grid-cols-[140px_1fr] gap-[var(--spacing-3)] py-[var(--spacing-1-5)] border-b border-border-divider last:border-b-0 items-start",children:[e.jsx("span",{className:"text-[11px] font-[var(--font-weight-semibold)] text-text-tertiary font-mono pt-[1px]",children:s}),e.jsx(oe,{value:i})]},s))})]})}function oe({value:t}){return t==null?e.jsx("span",{className:"text-[13px] text-text-placeholder italic",children:"null"}):typeof t=="boolean"?e.jsxs("span",{className:"text-[10px] font-[var(--font-weight-semibold)] px-[var(--spacing-2)] py-[2px] rounded-full inline-flex items-center gap-[var(--spacing-1)]",style:{background:t?"rgba(90,158,120,0.12)":"rgba(160,157,151,0.12)",color:t?"var(--color-status-completed)":"var(--color-text-tertiary)"},children:[t?e.jsx($,{size:10,strokeWidth:2.5}):e.jsx(re,{size:10,strokeWidth:2.5}),String(t)]}):typeof t=="number"?e.jsx("span",{className:"text-[13px] font-mono text-accent-blue",children:t}):typeof t=="string"?/^(completed|done|passed|active|success)$/i.test(t)?e.jsxs("span",{className:"text-[10px] font-[var(--font-weight-semibold)] px-[var(--spacing-2)] py-[2px] rounded-full inline-flex items-center gap-[var(--spacing-1)]",style:{background:"rgba(90,158,120,0.12)",color:"var(--color-status-completed)"},children:[e.jsx($,{size:10,strokeWidth:2.5}),t]}):/^(blocked|failed|error)$/i.test(t)?e.jsx("span",{className:"text-[10px] font-[var(--font-weight-semibold)] px-[var(--spacing-2)] py-[2px] rounded-full",style:{background:"var(--color-status-bg-blocked)",color:"var(--color-status-blocked)"},children:t}):/^(in.?progress|running|executing)$/i.test(t)?e.jsx("span",{className:"text-[10px] font-[var(--font-weight-semibold)] px-[var(--spacing-2)] py-[2px] rounded-full",style:{background:"rgba(91,141,184,0.12)",color:"var(--color-accent-blue)"},children:t}):e.jsx("span",{className:"text-[13px] text-text-primary",children:t}):Array.isArray(t)?t.length===0?e.jsx("span",{className:"text-[13px] text-text-placeholder italic",children:"[]"}):t.every(r=>typeof r=="string")?e.jsx("div",{className:"flex flex-wrap gap-[var(--spacing-1)]",children:t.map((r,a)=>e.jsx("span",{className:"text-[11px] px-[var(--spacing-2)] py-[2px] rounded-[var(--radius-default)] bg-bg-secondary text-text-secondary",children:String(r)},a))}):e.jsxs("span",{className:"text-[13px] font-mono text-text-secondary",children:["[",t.length," items]"]}):typeof t=="object"?e.jsx("span",{className:"text-[13px] font-mono text-text-secondary",children:JSON.stringify(t)}):e.jsx("span",{className:"text-[13px] text-text-primary",children:String(t)})}function Ge({data:t}){const r=Object.entries(t).filter(([,a])=>typeof a!="object"||a===null);return r.length===0?null:e.jsxs("div",{children:[e.jsx(L,{title:"Properties"}),e.jsx("div",{className:"flex flex-col",children:r.map(([a,s])=>e.jsxs("div",{className:"grid grid-cols-[140px_1fr] gap-[var(--spacing-3)] py-[var(--spacing-1-5)] border-b border-border-divider last:border-b-0 items-start",children:[e.jsx("span",{className:"text-[11px] font-[var(--font-weight-semibold)] text-text-tertiary font-mono pt-[1px]",children:a}),e.jsx(oe,{value:s})]},a))})]})}function qe(t){if(typeof t!="object"||t===null)return!1;const r=t;return"severity"in r||"gap_id"in r||"type"in r}function Ue({data:t}){const r=String(t.gap_id||t.id||""),a=String(t.severity||"medium"),s=String(t.type||""),i=String(t.description||t.claim||""),o=String(t.suggested_fix||t.fix||""),c={critical:{bg:"rgba(196,101,85,0.20)",color:"var(--color-status-blocked)"},high:{bg:"rgba(200,134,58,0.20)",color:"var(--color-accent-orange, #C8863A)"},medium:{bg:"rgba(184,149,64,0.20)",color:"var(--color-accent-yellow)"},low:{bg:"rgba(91,141,184,0.20)",color:"var(--color-accent-blue)"}},n=c[a.toLowerCase()]||c.medium;return e.jsxs("div",{className:"p-[10px_14px] rounded-[10px] border-l-[3px] mb-[var(--spacing-1-5)]",style:{borderLeftColor:"var(--color-status-blocked)",background:"var(--color-status-bg-blocked)"},children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-1-5)] mb-[var(--spacing-1)]",children:[r&&e.jsx("span",{className:"text-[10px] font-[var(--font-weight-bold)] font-mono",style:{color:"var(--color-status-blocked)"},children:r}),e.jsx("span",{className:"text-[9px] font-[var(--font-weight-bold)] px-[5px] py-[1px] rounded-[var(--radius-sm)] uppercase",style:{background:n.bg,color:n.color},children:a}),s&&e.jsx("span",{className:"text-[10px] text-text-tertiary ml-auto font-mono",children:s})]}),i&&e.jsx("p",{className:"text-[13px] text-text-primary mb-[var(--spacing-1)]",children:i}),o&&e.jsxs("p",{className:"text-[length:var(--font-size-sm)] text-text-secondary italic",children:[e.jsx("strong",{className:"font-[var(--font-weight-semibold)] not-italic text-text-tertiary text-[10px] uppercase",children:"Fix: "}),o]})]})}function Ye(t){if(typeof t!="object"||t===null)return!1;const r=t;return("claim"in r||"check"in r)&&!("severity"in r)}function Ze({data:t}){const r=String(t.claim||t.check||t.description||""),a=String(t.evidence||t.detail||""),s=t.passed===!0||t.status==="passed"||t.status==="completed";return e.jsxs("div",{className:"flex items-start gap-[var(--spacing-2)] p-[var(--spacing-2)_var(--spacing-3)] rounded-[var(--radius-md)] bg-bg-card border border-border-divider",children:[s?e.jsx($,{size:16,strokeWidth:2,className:"shrink-0 mt-[1px]",style:{color:"var(--color-status-completed)"}}):e.jsx(re,{size:16,strokeWidth:2,className:"shrink-0 mt-[1px] text-text-placeholder"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("span",{className:"text-[13px] text-text-primary font-[var(--font-weight-medium)]",children:r}),a&&e.jsx("p",{className:"text-[11px] text-text-tertiary mt-[2px] italic",children:a})]})]})}function le({content:t}){const r=d.useMemo(()=>{try{return JSON.stringify(JSON.parse(t),null,2)}catch{return t}},[t]);return e.jsx("pre",{className:["rounded-[10px] p-[16px_20px] font-mono text-[11px] leading-[1.6] overflow-x-auto","bg-[#2C2723] text-[#D9D0C4] border border-[#3D3731]"].join(" "),children:r})}const m=xe((t,r)=>({entries:[],byId:{},loading:!1,error:null,typeFilter:"all",tagFilter:"all",categoryFilter:"all",statusFilter:"all",search:"",selectedId:null,backlinksCache:{},health:null,graph:null,setTypeFilter:a=>t({typeFilter:a}),setTagFilter:a=>t({tagFilter:a}),setCategoryFilter:a=>t({categoryFilter:a}),setStatusFilter:a=>t({statusFilter:a}),setSearch:a=>t({search:a}),setSelected:a=>{t({selectedId:a}),a&&!r().backlinksCache[a]&&r().fetchBacklinks(a)},fetchEntries:async()=>{t({loading:!0,error:null});try{const{search:a}=r(),s=a?`${j.WIKI}?q=${encodeURIComponent(a)}`:j.WIKI,i=await fetch(s);if(!i.ok)throw new Error(`Failed: ${i.status}`);const c=(await i.json()).entries??[],n={};for(const l of c)n[l.id]=l;t({entries:c,byId:n,loading:!1})}catch(a){t({loading:!1,error:String(a)})}},fetchBacklinks:async a=>{try{const s=j.WIKI_BACKLINKS.replace(":id",encodeURIComponent(a)),i=await fetch(s);if(!i.ok)return;const o=await i.json();t(c=>({backlinksCache:{...c.backlinksCache,[a]:o.backlinks??[]}}))}catch{}},fetchHealth:async()=>{try{const a=await fetch(j.WIKI_HEALTH);if(!a.ok)return;const s=await a.json();t({health:s})}catch{}},fetchGraph:async()=>{try{const a=await fetch(j.WIKI_GRAPH);if(!a.ok)return;const s=await a.json();t({graph:s})}catch{}},createEntry:async a=>{const s=await fetch(j.WIKI,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(a)});if(!s.ok){const o=await s.json().catch(()=>({}));throw new Error(o.error??`create failed: ${s.status}`)}const i=await s.json();return await r().fetchEntries(),i.entry},updateEntry:async(a,s)=>{const i=j.WIKI_DETAIL.replace(":id",encodeURIComponent(a)),o=await fetch(i,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(s)});if(!o.ok){const n=await o.json().catch(()=>({}));throw new Error(n.error??`update failed: ${o.status}`)}const c=await o.json();return await r().fetchEntries(),c.entry},removeEntry:async a=>{const s=j.WIKI_DETAIL.replace(":id",encodeURIComponent(a)),i=await fetch(s,{method:"DELETE"});if(!i.ok){const o=await i.json().catch(()=>({}));throw new Error(o.error??`delete failed: ${i.status}`)}await r().fetchEntries()},filteredEntries:()=>{const{entries:a,typeFilter:s,tagFilter:i,categoryFilter:o,statusFilter:c}=r();return a.filter(n=>!(s!=="all"&&n.type!==s||i!=="all"&&!n.tags.includes(i)||o!=="all"&&n.category!==o||c!=="all"&&n.status!==c))},entriesByType:()=>{const a=r().filteredEntries(),s={project:[],roadmap:[],spec:[],issue:[],lesson:[],knowhow:[],note:[]};for(const i of a)s[i.type].push(i);return s},allTags:()=>{const a=new Set;for(const s of r().entries)for(const i of s.tags)a.add(i);return Array.from(a).sort()}})),Xe={project:"Project",roadmap:"Roadmap",spec:"Specs",issue:"Issues",lesson:"Lessons",knowhow:"KnowHow",note:"Notes"},G={project:"var(--color-accent-blue, #3b82f6)",roadmap:"var(--color-accent-purple, #8b5cf6)",spec:"var(--color-accent-green, #16a34a)",issue:"var(--color-accent-red, #dc2626)",lesson:"var(--color-accent-yellow, #ca8a04)",knowhow:"var(--color-accent-cyan, #0891b2)",note:"var(--color-text-tertiary, #9ca3af)"},Qe=["project","roadmap","spec","issue","lesson","knowhow","note"];function et(t){return t.replace(/^#{1,6}\s+/,"").trim()}function tt(){const t=m(l=>l.entries),r=m(l=>l.typeFilter),a=m(l=>l.tagFilter),s=m(l=>l.categoryFilter),i=m(l=>l.statusFilter),o=m(l=>l.selectedId),c=m(l=>l.setSelected),n=d.useMemo(()=>{const l={project:[],roadmap:[],spec:[],issue:[],lesson:[],knowhow:[],note:[]};for(const x of t)r!=="all"&&x.type!==r||a!=="all"&&!x.tags.includes(a)||s!=="all"&&x.category!==s||i!=="all"&&x.status!==i||l[x.type].push(x);return l},[t,r,a,s,i]);return e.jsx("div",{className:"flex flex-col gap-1 py-1 overflow-y-auto h-full",children:Qe.map(l=>{const x=n[l];return!x||x.length===0?null:e.jsxs("section",{className:"px-2",children:[e.jsxs("h3",{className:"flex items-center gap-1.5 px-1 py-1.5 text-[10px] text-text-tertiary uppercase tracking-wider font-semibold",children:[e.jsx("span",{className:"inline-block w-[6px] h-[6px] rounded-full shrink-0",style:{backgroundColor:G[l]}}),Xe[l],e.jsx("span",{className:"text-text-quaternary font-normal ml-0.5",children:x.length})]}),e.jsx("ul",{className:"flex flex-col gap-px",children:x.map(p=>e.jsx(rt,{entry:p,typeColor:G[p.type],selected:p.id===o,onSelect:()=>c(p.id)},p.id))})]},l)})})}function rt({entry:t,typeColor:r,selected:a,onSelect:s}){return e.jsx("li",{children:e.jsx("button",{type:"button",onClick:s,className:`w-full text-left rounded-[var(--radius-md,6px)] px-2.5 py-2 transition-all ${a?"bg-bg-secondary shadow-[inset_0_0_0_1px_var(--color-border-strong)]":"hover:bg-bg-secondary"}`,style:a?{borderLeft:`2px solid ${r}`,paddingLeft:"8px"}:void 0,children:e.jsxs("div",{className:"flex items-start gap-1.5",children:[!a&&e.jsx("span",{className:"inline-block w-[5px] h-[5px] rounded-full shrink-0 mt-[5px]",style:{backgroundColor:r,opacity:.6}}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"font-medium text-text-primary text-[length:var(--font-size-sm)] truncate leading-snug",children:t.title}),t.summary&&e.jsx("div",{className:"text-text-tertiary text-[11px] line-clamp-1 mt-0.5 leading-snug",children:et(t.summary)}),t.tags.length>0&&e.jsxs("div",{className:"mt-1 flex flex-wrap gap-1",children:[t.tags.slice(0,3).map(i=>e.jsx("span",{className:"px-1 py-px text-[10px] rounded bg-bg-tertiary text-text-tertiary leading-snug",children:i},i)),t.tags.length>3&&e.jsxs("span",{className:"text-[10px] text-text-quaternary",children:["+",t.tags.length-3]})]})]})]})})})}function st(t){const r=t.split(`
|
|
18
|
+
`);for(const s of a){const i=s.match(/^(#{1,4})\s+(.+)/);i&&r.push({level:i[1].length,text:i[2].trim()})}return r}function Oe(t){try{const r=JSON.parse(t);return typeof r!="object"||r===null||Array.isArray(r)?[]:Object.entries(r).map(([a,s])=>({key:a,type:Array.isArray(s)?"array":typeof s}))}catch{return[]}}function Ae({path:t,content:r}){if(!t)return e.jsx("div",{className:"w-[240px] bg-bg-primary border-l border-border shrink-0 flex items-center justify-center",children:e.jsx("p",{className:"text-[length:var(--font-size-xs)] text-text-tertiary",children:"No file selected"})});const a=ze(t),s=t.includes("/")?t.slice(t.lastIndexOf("/")+1):t,i=t.includes("/")?t.slice(0,t.lastIndexOf("/")):"/";return e.jsxs("div",{className:"w-[240px] bg-bg-primary border-l border-border shrink-0 flex flex-col overflow-hidden",children:[e.jsx("div",{className:"px-[14px] py-[10px] border-b border-border-divider text-[length:var(--font-size-sm)] font-[var(--font-weight-semibold)] text-text-primary shrink-0",children:"Properties"}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-[14px] py-[var(--spacing-3)]",children:[e.jsxs(F,{title:"File Info",defaultOpen:!0,children:[e.jsx(T,{label:"Name",value:s}),e.jsx(T,{label:"Type",value:a.replace(".","").toUpperCase()||"Unknown"}),e.jsx(T,{label:"Directory",value:i,mono:!0})]}),e.jsx(F,{title:"Tags",children:e.jsxs("div",{className:"flex flex-wrap gap-[var(--spacing-1)]",children:[e.jsx(O,{label:a.replace(".","")||"file",color:"blue"}),t.includes("phase")&&e.jsx(O,{label:"phase",color:"purple"}),t.includes("verification")&&e.jsx(O,{label:"verify",color:"green"})]})}),a===".md"&&r&&e.jsx($e,{content:r}),a===".json"&&r&&e.jsx(_e,{content:r})]})]})}function F({title:t,defaultOpen:r=!0,children:a}){const[s,i]=d.useState(r);return e.jsxs("div",{className:"mb-[var(--spacing-4)]",children:[e.jsxs("button",{type:"button",onClick:()=>i(o=>!o),className:["flex items-center gap-[var(--spacing-1)] w-full text-left mb-[var(--spacing-1-5)]","text-[9px] font-[var(--font-weight-semibold)] uppercase tracking-[0.06em] text-text-placeholder","hover:text-text-secondary transition-colors duration-[var(--duration-fast)]"].join(" "),children:[e.jsx(ee,{size:10,strokeWidth:2.5,className:["transition-transform duration-[var(--duration-fast)]",s?"rotate-90":""].join(" ")}),t]}),s&&a]})}function T({label:t,value:r,mono:a}){return e.jsxs("div",{className:"flex items-center justify-between py-[var(--spacing-1)] text-[length:var(--font-size-sm)]",children:[e.jsx("span",{className:"text-text-tertiary",children:t}),e.jsx("span",{className:`text-text-primary font-[var(--font-weight-medium)] ${a?"font-mono text-[11px]":""} truncate max-w-[140px]`,children:r})]})}function O({label:t,color:r}){const s={blue:{bg:"rgba(91,141,184,0.12)",text:"var(--color-accent-blue)"},purple:{bg:"rgba(145,120,181,0.12)",text:"var(--color-accent-purple, #9178B5)"},green:{bg:"rgba(90,158,120,0.12)",text:"var(--color-status-completed)"}}[r];return e.jsx("span",{className:"text-[10px] font-[var(--font-weight-semibold)] px-[var(--spacing-2)] py-[2px] rounded-full",style:{background:s.bg,color:s.text},children:t})}function $e({content:t}){const r=d.useMemo(()=>Te(t),[t]);return r.length===0?null:e.jsx(F,{title:"Outline",children:e.jsx("div",{className:"flex flex-col gap-[2px]",children:r.map((a,s)=>e.jsxs("button",{type:"button",className:["flex items-center gap-[var(--spacing-1-5)] px-[var(--spacing-2)] py-[3px] rounded-[var(--radius-sm)] text-[11px] w-full text-left","hover:bg-bg-hover hover:text-text-primary transition-colors duration-[var(--duration-fast)] cursor-pointer",s===0?"text-text-primary font-[var(--font-weight-semibold)]":"text-text-tertiary"].join(" "),style:{paddingLeft:(a.level-1)*10+8},children:[e.jsx("span",{className:"w-1 h-1 rounded-full shrink-0",style:{background:s===0?"var(--color-accent-purple)":"var(--color-text-placeholder)"}}),e.jsx("span",{className:"truncate",children:a.text})]},s))})})}function _e({content:t}){const r=d.useMemo(()=>Oe(t),[t]);return r.length===0?null:e.jsx(F,{title:"Structure",children:e.jsx("div",{className:"flex flex-col gap-0",children:r.map(a=>e.jsxs("div",{className:"flex items-center justify-between py-[var(--spacing-1)] text-[length:var(--font-size-sm)]",children:[e.jsx("span",{className:"text-text-primary font-mono text-[11px] truncate max-w-[120px]",children:a.key}),e.jsx("span",{className:"text-text-placeholder text-[10px]",children:a.type})]},a.key))})})}function We(t){switch(t.slice(t.lastIndexOf(".")).toLowerCase()){case".json":return{Icon:M,bg:"rgba(184,149,64,0.10)",color:"var(--color-accent-yellow)"};case".md":return{Icon:C,bg:"rgba(91,141,184,0.10)",color:"var(--color-accent-blue)"};case".ndjson":return{Icon:te,bg:"rgba(200,134,58,0.10)",color:"var(--color-accent-orange, #C8863A)"};default:return{Icon:C,bg:"rgba(160,157,151,0.10)",color:"var(--color-text-tertiary)"}}}function ne({content:t,path:r,onNavigate:a,loading:s,error:i,title:o,subtitle:c}){const[n,l]=d.useState(!1);if(i)return e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsx("div",{role:"alert",className:"px-[var(--spacing-3)] py-[var(--spacing-2)] text-[length:var(--font-size-xs)] rounded-[var(--radius-default)]",style:{backgroundColor:"var(--color-status-bg-blocked)",color:"var(--color-status-blocked)",borderColor:"var(--color-status-blocked)"},children:i})});if(s)return e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsx("p",{className:"text-text-secondary text-[length:var(--font-size-sm)] animate-pulse",children:"Loading..."})});if(!r||t===null)return e.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-text-secondary",children:[e.jsx("p",{className:"text-[length:var(--font-size-lg)] mb-[var(--spacing-2)]",children:"Select a file"}),e.jsx("p",{className:"text-[length:var(--font-size-sm)]",children:"Choose an artifact from the tree to view"})]});const x=r.includes("/")?r.slice(r.lastIndexOf("/")+1):r,{Icon:p,bg:u,color:f}=We(r);return e.jsxs("div",{className:"flex h-full overflow-hidden",children:[e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-3)] px-[24px] py-[10px] border-b border-border-divider shrink-0",children:[e.jsx("div",{className:"w-7 h-7 rounded-[var(--radius-default)] flex items-center justify-center shrink-0",style:{background:u,color:f},children:e.jsx(p,{size:14,strokeWidth:1.8})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[c&&e.jsx("div",{className:"text-[10px] uppercase tracking-wider text-text-tertiary font-medium truncate",children:c}),e.jsx("div",{className:"text-[14px] font-[var(--font-weight-bold)] text-text-primary truncate",children:o??x}),e.jsx("div",{className:"text-[10px] font-mono text-text-tertiary truncate",children:r})]}),e.jsxs("div",{className:"flex gap-[var(--spacing-1)]",children:[e.jsx("button",{type:"button",onClick:()=>l(!1),className:["px-[10px] py-[var(--spacing-1)] rounded-[var(--radius-default)] border text-[10px] font-[var(--font-weight-semibold)]","transition-all duration-[var(--duration-fast)] ease-[var(--ease-notion)]","focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus-ring)]",n?"bg-bg-card text-text-secondary border-border hover:border-text-tertiary hover:text-text-primary":"bg-text-primary text-bg-primary border-text-primary"].join(" "),children:"Rendered"}),e.jsx("button",{type:"button",onClick:()=>l(!0),className:["px-[10px] py-[var(--spacing-1)] rounded-[var(--radius-default)] border text-[10px] font-[var(--font-weight-semibold)]","transition-all duration-[var(--duration-fast)] ease-[var(--ease-notion)]","focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus-ring)]",n?"bg-text-primary text-bg-primary border-text-primary":"bg-bg-card text-text-secondary border-border hover:border-text-tertiary hover:text-text-primary"].join(" "),children:"Source"})]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsx("div",{className:"max-w-[720px] mx-auto px-[32px] py-[24px]",children:e.jsx(ae,{content:t,path:r,rawOverride:n})})})]}),e.jsx(Ae,{path:r,content:t})]})}function Me(t){const r=t.slice(t.lastIndexOf(".")).toLowerCase();switch(r){case".json":return"json";case".md":return"md";case".ndjson":return"jsonl";default:return r.replace(".","")||"file"}}function Re(t){switch(t){case"json":return{Icon:M,tintBg:"rgba(184,149,64,0.10)",iconColor:"var(--color-accent-yellow)",badgeBg:"rgba(184,149,64,0.12)",badgeColor:"var(--color-accent-yellow)"};case"md":return{Icon:C,tintBg:"rgba(91,141,184,0.10)",iconColor:"var(--color-accent-blue)",badgeBg:"rgba(91,141,184,0.12)",badgeColor:"var(--color-accent-blue)"};case"jsonl":return{Icon:te,tintBg:"rgba(200,134,58,0.10)",iconColor:"var(--color-accent-orange, #C8863A)",badgeBg:"rgba(200,134,58,0.12)",badgeColor:"var(--color-accent-orange, #C8863A)"};default:return{Icon:C,tintBg:"rgba(160,157,151,0.10)",iconColor:"var(--color-text-tertiary)",badgeBg:"rgba(160,157,151,0.12)",badgeColor:"var(--color-text-tertiary)"}}}function Ve({name:t,path:r,isSelected:a,onClick:s}){const i=Me(t),o=Re(i),{Icon:c}=o,n=r.includes("/")?r.slice(0,r.lastIndexOf("/")):"";return e.jsxs("button",{type:"button",onClick:s,className:["bg-bg-card border rounded-[var(--radius-lg)] p-[14px_16px] cursor-pointer text-left w-full","transition-all duration-[180ms] ease-[var(--ease-spring)]","flex flex-col gap-[var(--spacing-2)]","hover:-translate-y-[2px] hover:shadow-[0_6px_20px_rgba(0,0,0,0.06)]","focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus-ring)]",a?"border-accent-purple shadow-[0_0_0_2px_rgba(145,120,181,0.2)]":"border-border-divider hover:border-border"].join(" "),children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)]",children:[e.jsx("div",{className:"w-8 h-8 rounded-[var(--radius-md)] flex items-center justify-center shrink-0",style:{background:o.tintBg,color:o.iconColor},children:e.jsx(c,{size:16,strokeWidth:1.8})}),e.jsx("span",{className:"text-[length:var(--font-size-sm)] font-[var(--font-weight-semibold)] text-text-primary flex-1 truncate",children:t}),e.jsx("span",{className:"text-[9px] font-[var(--font-weight-semibold)] px-[5px] py-[1px] rounded-[var(--radius-sm)] uppercase font-mono shrink-0",style:{background:o.badgeBg,color:o.badgeColor},children:i})]}),e.jsx("div",{className:"text-[length:var(--font-size-xs)] text-text-tertiary leading-[1.5] line-clamp-3 min-h-[48px]",children:r}),n&&e.jsx("div",{className:"flex items-center gap-[var(--spacing-1-5)] pt-[var(--spacing-1)] border-t border-border-divider",children:e.jsx("span",{className:"text-[10px] text-text-placeholder font-mono truncate",children:n})})]})}function ie(t,r=""){const a=[];for(const s of t)s.type==="file"?a.push({name:s.name,path:s.path,group:r||"root"}):s.children&&a.push(...ie(s.children,s.name));return a}function Pe(t){const r=new Map;for(const a of t){const s=r.get(a.group)||[];s.push(a),r.set(a.group,s)}return r}const Be=["All","json","md","jsonl"];function Je(t){if(t==="root"||!t.match(/^\d{2}-/))return{dotColor:"var(--color-text-tertiary)"};const r=t.toLowerCase();return r.includes("setup")||r.includes("complete")||r.includes("init")?{dotColor:"var(--color-status-completed)",statusLabel:"Done",statusBg:"var(--color-status-bg-completed)",statusColor:"var(--color-status-completed)"}:{dotColor:"var(--color-accent-yellow)",statusLabel:"Active",statusBg:"var(--color-status-bg-executing)",statusColor:"var(--color-status-executing)"}}function De({tree:t,onSelectFile:r,selectedPath:a}){const[s,i]=d.useState(""),[o,c]=d.useState("All"),n=d.useMemo(()=>ie(t),[t]),l=d.useMemo(()=>{let p=n;if(s.trim()){const u=s.toLowerCase();p=p.filter(f=>f.name.toLowerCase().includes(u)||f.path.toLowerCase().includes(u))}return o!=="All"&&(p=p.filter(u=>{const f=u.name.slice(u.name.lastIndexOf(".")).toLowerCase();return o==="json"?f===".json":o==="md"?f===".md":o==="jsonl"?f===".ndjson"||f===".jsonl":!0})),p},[n,s,o]),x=d.useMemo(()=>Pe(l),[l]);return e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] px-[24px] py-[10px] border-b border-border-divider shrink-0",children:[e.jsxs("div",{className:["flex items-center gap-[var(--spacing-1-5)] px-[var(--spacing-3)] py-[5px] rounded-[var(--radius-md)]","bg-bg-card border border-border w-[200px]","focus-within:border-accent-purple transition-colors duration-[var(--duration-fast)]"].join(" "),children:[e.jsx(X,{size:13,strokeWidth:2,className:"text-text-placeholder shrink-0"}),e.jsx("input",{type:"search",value:s,onChange:p=>i(p.target.value),placeholder:"Search artifacts...","aria-label":"Search artifacts",className:"border-none bg-transparent outline-none text-[12px] text-text-primary placeholder:text-text-placeholder w-full font-[inherit]"})]}),e.jsx("div",{className:"flex-1"}),Be.map(p=>e.jsx("button",{type:"button",onClick:()=>c(p),className:["text-[11px] font-[var(--font-weight-medium)] px-[var(--spacing-3)] py-[var(--spacing-1)] rounded-full","border transition-all duration-[var(--duration-fast)] ease-[var(--ease-notion)]","focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus-ring)]",o===p?"bg-text-primary text-bg-primary border-text-primary":"bg-bg-card text-text-secondary border-border hover:border-text-tertiary hover:text-text-primary"].join(" "),children:p==="All"?"All":p.toUpperCase()},p))]}),e.jsx("div",{className:"flex-1 overflow-y-auto px-[24px] py-[var(--spacing-4)]",children:l.length===0?e.jsx("div",{className:"flex items-center justify-center h-full text-text-tertiary text-[length:var(--font-size-sm)]",children:"No artifacts found"}):Array.from(x.entries()).map(([p,u])=>{const f=Je(p);return e.jsxs("div",{className:"mb-[24px]",children:[e.jsxs("div",{className:"flex items-center gap-[10px] mb-[10px] pl-[var(--spacing-1)]",children:[e.jsx("span",{className:"w-[10px] h-[10px] rounded-full shrink-0",style:{background:f.dotColor}}),e.jsx("span",{className:"text-[13px] font-[var(--font-weight-bold)] text-text-primary",children:p==="root"?"Project":p}),f.statusLabel&&e.jsx("span",{className:"text-[10px] font-[var(--font-weight-semibold)] px-[var(--spacing-2)] py-[2px] rounded-full",style:{background:f.statusBg,color:f.statusColor},children:f.statusLabel}),e.jsxs("span",{className:"text-[11px] text-text-tertiary",children:[u.length," file",u.length!==1?"s":""]}),e.jsx("div",{className:"flex-1 h-px bg-border-divider ml-[var(--spacing-2)]"})]}),e.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(240px,1fr))] gap-[10px]",children:u.map(g=>e.jsx(Ve,{name:g.name,path:g.path,type:g.name.slice(g.name.lastIndexOf(".")),isSelected:g.path===a,onClick:()=>r(g.path)},g.path))})]},p)})})]})}function Ke({content:t,path:r}){const[a,s]=d.useState(!1);if(!r||t===null)return e.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-text-secondary",children:[e.jsx("p",{className:"text-[length:var(--font-size-lg)] mb-[var(--spacing-2)]",children:"Select a file"}),e.jsx("p",{className:"text-[length:var(--font-size-sm)]",children:"Choose a JSON artifact to view its structure"})]});const o=r.slice(r.lastIndexOf(".")).toLowerCase()===".json",c=r.includes("/")?r.slice(r.lastIndexOf("/")+1):r;return o?e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsx(H,{fileName:c,path:r,isJson:!0,rawMode:a,onToggle:()=>s(n=>!n)}),e.jsx("div",{className:"flex-1 overflow-y-auto px-[24px] py-[20px]",children:e.jsx("div",{className:"max-w-[780px] mx-auto",children:a?e.jsx(le,{content:t}):e.jsx(He,{content:t})})})]}):e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsx(H,{fileName:c,path:r,isJson:!1,rawMode:!1,onToggle:()=>{}}),e.jsx("div",{className:"flex-1 overflow-hidden",children:e.jsx(ae,{content:t,path:r})})]})}function H({fileName:t,path:r,isJson:a,rawMode:s,onToggle:i}){const o=a?M:C,c=a?"rgba(184,149,64,0.10)":"rgba(91,141,184,0.10)",n=a?"var(--color-accent-yellow)":"var(--color-accent-blue)";return e.jsxs("div",{className:"flex items-center gap-[var(--spacing-3)] px-[24px] py-[10px] border-b border-border-divider shrink-0",children:[e.jsx("div",{className:"w-7 h-7 rounded-[var(--radius-default)] flex items-center justify-center shrink-0",style:{background:c,color:n},children:e.jsx(o,{size:14,strokeWidth:1.8})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-[14px] font-[var(--font-weight-bold)] text-text-primary truncate",children:t}),e.jsx("div",{className:"text-[10px] font-mono text-text-tertiary truncate",children:r})]}),a&&e.jsxs("div",{className:"flex gap-[var(--spacing-1)]",children:[e.jsx("button",{type:"button",onClick:i,className:["px-[10px] py-[var(--spacing-1)] rounded-[var(--radius-default)] border text-[10px] font-[var(--font-weight-semibold)]","transition-all duration-[var(--duration-fast)] ease-[var(--ease-notion)]","focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus-ring)]",s?"bg-bg-card text-text-secondary border-border hover:border-text-tertiary hover:text-text-primary":"bg-text-primary text-bg-primary border-text-primary"].join(" "),children:"Structured"}),e.jsx("button",{type:"button",onClick:i,className:["px-[10px] py-[var(--spacing-1)] rounded-[var(--radius-default)] border text-[10px] font-[var(--font-weight-semibold)]","transition-all duration-[var(--duration-fast)] ease-[var(--ease-notion)]","focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus-ring)]",s?"bg-text-primary text-bg-primary border-text-primary":"bg-bg-card text-text-secondary border-border hover:border-text-tertiary hover:text-text-primary"].join(" "),children:"Raw"})]})]})}function He({content:t}){const r=d.useMemo(()=>{try{return JSON.parse(t)}catch{return null}},[t]);if(!r||typeof r!="object")return e.jsx(le,{content:t});if(Array.isArray(r))return e.jsx("div",{className:"flex flex-col gap-[var(--spacing-4)]",children:r.map((s,i)=>e.jsx(A,{title:`Item ${i+1}`,data:s},i))});const a=Object.entries(r);return e.jsxs("div",{className:"flex flex-col gap-[var(--spacing-4)]",children:[a.map(([s,i])=>Array.isArray(i)&&i.length>0&&typeof i[0]=="object"?e.jsxs("div",{children:[e.jsx(L,{title:s,badge:`${i.length}`}),e.jsx("div",{className:"flex flex-col gap-[var(--spacing-1-5)]",children:i.map((o,c)=>qe(o)?e.jsx(Ue,{data:o},c):Ye(o)?e.jsx(Ze,{data:o},c):e.jsx(A,{title:`#${c+1}`,data:o},c))})]},s):typeof i=="object"&&i!==null&&!Array.isArray(i)?e.jsx(A,{title:s,data:i},s):null),e.jsx(Ge,{data:r})]})}function L({title:t,badge:r}){return e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] mb-[var(--spacing-2)] pb-[var(--spacing-1-5)] border-b border-border-divider",children:[e.jsx("span",{className:"text-[11px] font-[var(--font-weight-bold)] uppercase tracking-[0.06em] text-text-tertiary",children:t}),r&&e.jsx("span",{className:"text-[10px] font-[var(--font-weight-semibold)] px-[var(--spacing-1-5)] py-[1px] rounded-full",style:{background:"rgba(91,141,184,0.12)",color:"var(--color-accent-blue)"},children:r})]})}function A({title:t,data:r}){if(typeof r!="object"||r===null)return e.jsxs("div",{children:[e.jsx(L,{title:t}),e.jsx("div",{className:"text-[13px] text-text-primary",children:String(r)})]});const a=Object.entries(r);return e.jsxs("div",{children:[e.jsx(L,{title:t}),e.jsx("div",{className:"flex flex-col",children:a.map(([s,i])=>e.jsxs("div",{className:"grid grid-cols-[140px_1fr] gap-[var(--spacing-3)] py-[var(--spacing-1-5)] border-b border-border-divider last:border-b-0 items-start",children:[e.jsx("span",{className:"text-[11px] font-[var(--font-weight-semibold)] text-text-tertiary font-mono pt-[1px]",children:s}),e.jsx(oe,{value:i})]},s))})]})}function oe({value:t}){return t==null?e.jsx("span",{className:"text-[13px] text-text-placeholder italic",children:"null"}):typeof t=="boolean"?e.jsxs("span",{className:"text-[10px] font-[var(--font-weight-semibold)] px-[var(--spacing-2)] py-[2px] rounded-full inline-flex items-center gap-[var(--spacing-1)]",style:{background:t?"rgba(90,158,120,0.12)":"rgba(160,157,151,0.12)",color:t?"var(--color-status-completed)":"var(--color-text-tertiary)"},children:[t?e.jsx($,{size:10,strokeWidth:2.5}):e.jsx(re,{size:10,strokeWidth:2.5}),String(t)]}):typeof t=="number"?e.jsx("span",{className:"text-[13px] font-mono text-accent-blue",children:t}):typeof t=="string"?/^(completed|done|passed|active|success)$/i.test(t)?e.jsxs("span",{className:"text-[10px] font-[var(--font-weight-semibold)] px-[var(--spacing-2)] py-[2px] rounded-full inline-flex items-center gap-[var(--spacing-1)]",style:{background:"rgba(90,158,120,0.12)",color:"var(--color-status-completed)"},children:[e.jsx($,{size:10,strokeWidth:2.5}),t]}):/^(blocked|failed|error)$/i.test(t)?e.jsx("span",{className:"text-[10px] font-[var(--font-weight-semibold)] px-[var(--spacing-2)] py-[2px] rounded-full",style:{background:"var(--color-status-bg-blocked)",color:"var(--color-status-blocked)"},children:t}):/^(in.?progress|running|executing)$/i.test(t)?e.jsx("span",{className:"text-[10px] font-[var(--font-weight-semibold)] px-[var(--spacing-2)] py-[2px] rounded-full",style:{background:"rgba(91,141,184,0.12)",color:"var(--color-accent-blue)"},children:t}):e.jsx("span",{className:"text-[13px] text-text-primary",children:t}):Array.isArray(t)?t.length===0?e.jsx("span",{className:"text-[13px] text-text-placeholder italic",children:"[]"}):t.every(r=>typeof r=="string")?e.jsx("div",{className:"flex flex-wrap gap-[var(--spacing-1)]",children:t.map((r,a)=>e.jsx("span",{className:"text-[11px] px-[var(--spacing-2)] py-[2px] rounded-[var(--radius-default)] bg-bg-secondary text-text-secondary",children:String(r)},a))}):e.jsxs("span",{className:"text-[13px] font-mono text-text-secondary",children:["[",t.length," items]"]}):typeof t=="object"?e.jsx("span",{className:"text-[13px] font-mono text-text-secondary",children:JSON.stringify(t)}):e.jsx("span",{className:"text-[13px] text-text-primary",children:String(t)})}function Ge({data:t}){const r=Object.entries(t).filter(([,a])=>typeof a!="object"||a===null);return r.length===0?null:e.jsxs("div",{children:[e.jsx(L,{title:"Properties"}),e.jsx("div",{className:"flex flex-col",children:r.map(([a,s])=>e.jsxs("div",{className:"grid grid-cols-[140px_1fr] gap-[var(--spacing-3)] py-[var(--spacing-1-5)] border-b border-border-divider last:border-b-0 items-start",children:[e.jsx("span",{className:"text-[11px] font-[var(--font-weight-semibold)] text-text-tertiary font-mono pt-[1px]",children:a}),e.jsx(oe,{value:s})]},a))})]})}function qe(t){if(typeof t!="object"||t===null)return!1;const r=t;return"severity"in r||"gap_id"in r||"type"in r}function Ue({data:t}){const r=String(t.gap_id||t.id||""),a=String(t.severity||"medium"),s=String(t.type||""),i=String(t.description||t.claim||""),o=String(t.suggested_fix||t.fix||""),c={critical:{bg:"rgba(196,101,85,0.20)",color:"var(--color-status-blocked)"},high:{bg:"rgba(200,134,58,0.20)",color:"var(--color-accent-orange, #C8863A)"},medium:{bg:"rgba(184,149,64,0.20)",color:"var(--color-accent-yellow)"},low:{bg:"rgba(91,141,184,0.20)",color:"var(--color-accent-blue)"}},n=c[a.toLowerCase()]||c.medium;return e.jsxs("div",{className:"p-[10px_14px] rounded-[10px] border-l-[3px] mb-[var(--spacing-1-5)]",style:{borderLeftColor:"var(--color-status-blocked)",background:"var(--color-status-bg-blocked)"},children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-1-5)] mb-[var(--spacing-1)]",children:[r&&e.jsx("span",{className:"text-[10px] font-[var(--font-weight-bold)] font-mono",style:{color:"var(--color-status-blocked)"},children:r}),e.jsx("span",{className:"text-[9px] font-[var(--font-weight-bold)] px-[5px] py-[1px] rounded-[var(--radius-sm)] uppercase",style:{background:n.bg,color:n.color},children:a}),s&&e.jsx("span",{className:"text-[10px] text-text-tertiary ml-auto font-mono",children:s})]}),i&&e.jsx("p",{className:"text-[13px] text-text-primary mb-[var(--spacing-1)]",children:i}),o&&e.jsxs("p",{className:"text-[length:var(--font-size-sm)] text-text-secondary italic",children:[e.jsx("strong",{className:"font-[var(--font-weight-semibold)] not-italic text-text-tertiary text-[10px] uppercase",children:"Fix: "}),o]})]})}function Ye(t){if(typeof t!="object"||t===null)return!1;const r=t;return("claim"in r||"check"in r)&&!("severity"in r)}function Ze({data:t}){const r=String(t.claim||t.check||t.description||""),a=String(t.evidence||t.detail||""),s=t.passed===!0||t.status==="passed"||t.status==="completed";return e.jsxs("div",{className:"flex items-start gap-[var(--spacing-2)] p-[var(--spacing-2)_var(--spacing-3)] rounded-[var(--radius-md)] bg-bg-card border border-border-divider",children:[s?e.jsx($,{size:16,strokeWidth:2,className:"shrink-0 mt-[1px]",style:{color:"var(--color-status-completed)"}}):e.jsx(re,{size:16,strokeWidth:2,className:"shrink-0 mt-[1px] text-text-placeholder"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("span",{className:"text-[13px] text-text-primary font-[var(--font-weight-medium)]",children:r}),a&&e.jsx("p",{className:"text-[11px] text-text-tertiary mt-[2px] italic",children:a})]})]})}function le({content:t}){const r=d.useMemo(()=>{try{return JSON.stringify(JSON.parse(t),null,2)}catch{return t}},[t]);return e.jsx("pre",{className:["rounded-[10px] p-[16px_20px] font-mono text-[11px] leading-[1.6] overflow-x-auto","bg-[#2C2723] text-[#D9D0C4] border border-[#3D3731]"].join(" "),children:r})}const m=xe((t,r)=>({entries:[],byId:{},loading:!1,error:null,typeFilter:"all",tagFilter:"all",categoryFilter:"all",statusFilter:"all",search:"",selectedId:null,backlinksCache:{},health:null,graph:null,setTypeFilter:a=>t({typeFilter:a}),setTagFilter:a=>t({tagFilter:a}),setCategoryFilter:a=>t({categoryFilter:a}),setStatusFilter:a=>t({statusFilter:a}),setSearch:a=>t({search:a}),setSelected:a=>{t({selectedId:a}),a&&!r().backlinksCache[a]&&r().fetchBacklinks(a)},fetchEntries:async()=>{t({loading:!0,error:null});try{const{search:a}=r(),s=a?`${j.WIKI}?q=${encodeURIComponent(a)}`:j.WIKI,i=await fetch(s);if(!i.ok)throw new Error(`Failed: ${i.status}`);const c=(await i.json()).entries??[],n={};for(const l of c)n[l.id]=l;t({entries:c,byId:n,loading:!1})}catch(a){t({loading:!1,error:String(a)})}},fetchBacklinks:async a=>{try{const s=j.WIKI_BACKLINKS.replace(":id",encodeURIComponent(a)),i=await fetch(s);if(!i.ok)return;const o=await i.json();t(c=>({backlinksCache:{...c.backlinksCache,[a]:o.backlinks??[]}}))}catch{}},fetchHealth:async()=>{try{const a=await fetch(j.WIKI_HEALTH);if(!a.ok)return;const s=await a.json();t({health:s})}catch{}},fetchGraph:async()=>{try{const a=await fetch(j.WIKI_GRAPH);if(!a.ok)return;const s=await a.json();t({graph:s})}catch{}},createEntry:async a=>{const s=await fetch(j.WIKI,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(a)});if(!s.ok){const o=await s.json().catch(()=>({}));throw new Error(o.error??`create failed: ${s.status}`)}const i=await s.json();return await r().fetchEntries(),i.entry},updateEntry:async(a,s)=>{const i=j.WIKI_DETAIL.replace(":id",encodeURIComponent(a)),o=await fetch(i,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(s)});if(!o.ok){const n=await o.json().catch(()=>({}));throw new Error(n.error??`update failed: ${o.status}`)}const c=await o.json();return await r().fetchEntries(),c.entry},removeEntry:async a=>{const s=j.WIKI_DETAIL.replace(":id",encodeURIComponent(a)),i=await fetch(s,{method:"DELETE"});if(!i.ok){const o=await i.json().catch(()=>({}));throw new Error(o.error??`delete failed: ${i.status}`)}await r().fetchEntries()},filteredEntries:()=>{const{entries:a,typeFilter:s,tagFilter:i,categoryFilter:o,statusFilter:c}=r();return a.filter(n=>!(s!=="all"&&n.type!==s||i!=="all"&&!n.tags.includes(i)||o!=="all"&&n.category!==o||c!=="all"&&n.status!==c))},entriesByType:()=>{const a=r().filteredEntries(),s={project:[],roadmap:[],spec:[],issue:[],knowhow:[],note:[]};for(const i of a)s[i.type].push(i);return s},allTags:()=>{const a=new Set;for(const s of r().entries)for(const i of s.tags)a.add(i);return Array.from(a).sort()}})),Xe={project:"Project",roadmap:"Roadmap",spec:"Specs",issue:"Issues",knowhow:"KnowHow",note:"Notes"},G={project:"var(--color-accent-blue, #3b82f6)",roadmap:"var(--color-accent-purple, #8b5cf6)",spec:"var(--color-accent-green, #16a34a)",issue:"var(--color-accent-red, #dc2626)",knowhow:"var(--color-accent-cyan, #0891b2)",note:"var(--color-text-tertiary, #9ca3af)"},Qe=["project","roadmap","spec","issue","knowhow","note"];function et(t){return t.replace(/^#{1,6}\s+/,"").trim()}function tt(){const t=m(l=>l.entries),r=m(l=>l.typeFilter),a=m(l=>l.tagFilter),s=m(l=>l.categoryFilter),i=m(l=>l.statusFilter),o=m(l=>l.selectedId),c=m(l=>l.setSelected),n=d.useMemo(()=>{const l={project:[],roadmap:[],spec:[],issue:[],knowhow:[],note:[]};for(const x of t)r!=="all"&&x.type!==r||a!=="all"&&!x.tags.includes(a)||s!=="all"&&x.category!==s||i!=="all"&&x.status!==i||l[x.type].push(x);return l},[t,r,a,s,i]);return e.jsx("div",{className:"flex flex-col gap-1 py-1 overflow-y-auto h-full",children:Qe.map(l=>{const x=n[l];return!x||x.length===0?null:e.jsxs("section",{className:"px-2",children:[e.jsxs("h3",{className:"flex items-center gap-1.5 px-1 py-1.5 text-[10px] text-text-tertiary uppercase tracking-wider font-semibold",children:[e.jsx("span",{className:"inline-block w-[6px] h-[6px] rounded-full shrink-0",style:{backgroundColor:G[l]}}),Xe[l],e.jsx("span",{className:"text-text-quaternary font-normal ml-0.5",children:x.length})]}),e.jsx("ul",{className:"flex flex-col gap-px",children:x.map(p=>e.jsx(rt,{entry:p,typeColor:G[p.type],selected:p.id===o,onSelect:()=>c(p.id)},p.id))})]},l)})})}function rt({entry:t,typeColor:r,selected:a,onSelect:s}){return e.jsx("li",{children:e.jsx("button",{type:"button",onClick:s,className:`w-full text-left rounded-[var(--radius-md,6px)] px-2.5 py-2 transition-all ${a?"bg-bg-secondary shadow-[inset_0_0_0_1px_var(--color-border-strong)]":"hover:bg-bg-secondary"}`,style:a?{borderLeft:`2px solid ${r}`,paddingLeft:"8px"}:void 0,children:e.jsxs("div",{className:"flex items-start gap-1.5",children:[!a&&e.jsx("span",{className:"inline-block w-[5px] h-[5px] rounded-full shrink-0 mt-[5px]",style:{backgroundColor:r,opacity:.6}}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"font-medium text-text-primary text-[length:var(--font-size-sm)] truncate leading-snug",children:t.title}),t.summary&&e.jsx("div",{className:"text-text-tertiary text-[11px] line-clamp-1 mt-0.5 leading-snug",children:et(t.summary)}),t.tags.length>0&&e.jsxs("div",{className:"mt-1 flex flex-wrap gap-1",children:[t.tags.slice(0,3).map(i=>e.jsx("span",{className:"px-1 py-px text-[10px] rounded bg-bg-tertiary text-text-tertiary leading-snug",children:i},i)),t.tags.length>3&&e.jsxs("span",{className:"text-[10px] text-text-quaternary",children:["+",t.tags.length-3]})]})]})]})})})}function st(t){const r=t.split(`
|
|
19
19
|
`);let a=!1;const s=[];for(const i of r){if(/^```/.test(i.trim())){a=!a,s.push(i);continue}if(a){s.push(i);continue}s.push(i.replace(/\[\[([^\]]+)\]\]/g,(o,c)=>`[${c}](wiki:${c})`))}return s.join(`
|
|
20
20
|
`)}function at(t){return t.replace(/^#{1,6}\s+/,"").trim()}function nt(){const t=m(n=>n.selectedId),r=m(n=>n.byId),a=m(n=>n.backlinksCache);m(n=>n.setSelected);const s=t?r[t]:void 0,i=t?a[t]??[]:[],o=d.useMemo(()=>{if(!s)return null;const n=[];if(s.summary&&(n.push(`> ${at(s.summary)}`),n.push("")),s.tags.length>0&&(n.push(s.tags.map(l=>`\`${l}\``).join(" ")),n.push("")),s.category&&(n.push(`**Category:** ${s.category}`),n.push("")),n.push("---"),n.push(""),s.body&&s.source.kind==="file"&&(n.push(st(s.body)),n.push("")),s.source.kind==="virtual"&&s.raw!==void 0&&(n.push("## Raw"),n.push("```json"),n.push(JSON.stringify(s.raw,null,2)),n.push("```"),n.push("")),Object.keys(s.ext).length>0&&(n.push("## Metadata"),n.push("```json"),n.push(JSON.stringify(s.ext,null,2)),n.push("```"),n.push("")),i.length>0){n.push(`## Backlinks (${i.length})`);for(const l of i)n.push(`- **${l.title}** _${l.type}_`);n.push("")}return n.join(`
|
|
21
|
-
`)},[s,i]);if(!t)return e.jsx("div",{className:"flex items-center justify-center h-full text-text-tertiary text-[length:var(--font-size-sm)]",children:"Select an entry"});if(!s)return e.jsx("div",{className:"p-4 text-text-tertiary text-[length:var(--font-size-sm)]",children:"Entry not found."});const c=s.source.path+(s.source.line!==void 0?`:${s.source.line}`:"");return e.jsx(ne,{content:o,path:c,onNavigate:()=>{},loading:!1,error:null,title:s.title,subtitle:`${s.type.toUpperCase()} · ${s.status.toUpperCase()}`})}function it(){const{health:t,fetchHealth:r,setSelected:a,byId:s}=m(Q(n=>({health:n.health,fetchHealth:n.fetchHealth,setSelected:n.setSelected,byId:n.byId}))),[i,o]=d.useState(!1);if(d.useEffect(()=>{r()},[r]),!t)return e.jsx("div",{className:"px-3 py-2 text-[length:var(--font-size-xs)] text-text-tertiary border-b border-border",children:"Loading health…"});const c=t.score>=80?"var(--color-accent-green, #16a34a)":t.score>=50?"var(--color-accent-yellow, #ca8a04)":"var(--color-accent-red, #dc2626)";return e.jsxs("div",{className:"border-b border-border",children:[e.jsxs("button",{type:"button",onClick:()=>o(!i),className:"w-full flex items-center gap-2 px-3 py-2 hover:bg-bg-secondary transition-colors",children:[e.jsx(ee,{size:12,strokeWidth:2,className:"text-text-tertiary transition-transform shrink-0",style:{transform:i?"rotate(90deg)":void 0}}),e.jsx(pe,{size:12,strokeWidth:2,className:"text-text-tertiary shrink-0"}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] text-text-secondary font-medium",children:"Health"}),e.jsx("span",{className:"text-[length:var(--font-size-sm)] font-semibold ml-auto",style:{color:c},children:t.score}),e.jsxs("div",{className:"flex gap-2 text-[length:var(--font-size-xs)] text-text-tertiary",children:[e.jsxs("span",{children:[t.totals.entries," entries"]}),t.totals.orphans>0&&e.jsxs("span",{children:["· ",t.totals.orphans," orphans"]}),t.totals.brokenLinks>0&&e.jsxs("span",{className:"text-accent-red",children:["· ",t.totals.brokenLinks," broken"]})]})]}),i&&e.jsxs("div",{className:"px-3 pb-2 flex flex-col gap-2 text-[length:var(--font-size-xs)]",children:[t.hubs.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"uppercase tracking-wider text-text-tertiary mb-1 text-[10px]",children:"Top hubs"}),e.jsx("ul",{className:"flex flex-col gap-0.5",children:t.hubs.slice(0,5).map(n=>{var l;return e.jsxs("li",{className:"flex justify-between gap-2",children:[e.jsx("button",{type:"button",onClick:()=>a(n.id),className:"truncate text-accent-blue hover:underline text-left",children:((l=s[n.id])==null?void 0:l.title)??n.id}),e.jsx("span",{className:"text-text-tertiary shrink-0",children:n.inDegree})]},n.id)})})]}),t.orphans.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"uppercase tracking-wider text-text-tertiary mb-1 text-[10px]",children:["Orphans (",t.orphans.length,")"]}),e.jsx("ul",{className:"flex flex-wrap gap-1 max-h-16 overflow-y-auto",children:t.orphans.slice(0,10).map(n=>{var l;return e.jsx("li",{children:e.jsx("button",{type:"button",onClick:()=>a(n),className:"px-1.5 py-0.5 rounded bg-bg-tertiary text-text-secondary hover:text-accent-blue hover:underline transition-colors",children:((l=s[n])==null?void 0:l.title)??n})},n)})})]}),t.brokenLinks.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"uppercase tracking-wider text-text-tertiary mb-1 text-[10px]",children:["Broken (",t.brokenLinks.length,")"]}),e.jsx("ul",{className:"flex flex-col gap-0.5 max-h-16 overflow-y-auto text-text-secondary",children:t.brokenLinks.slice(0,5).map((n,l)=>e.jsxs("li",{className:"truncate",children:[e.jsx("span",{className:"text-text-tertiary",children:n.sourceId})," → ",e.jsx("span",{className:"line-through",children:n.target})]},`${n.sourceId}-${l}`))})]})]})]})}const ot={project:"var(--color-accent-blue, #3b82f6)",roadmap:"var(--color-accent-purple, #8b5cf6)",spec:"var(--color-accent-green, #16a34a)",issue:"var(--color-accent-red, #dc2626)",lesson:"var(--color-accent-yellow, #ca8a04)",knowhow:"var(--color-accent-cyan, #0891b2)",note:"var(--color-text-tertiary, #9ca3af)"};function lt(t){return t.replace(/^#{1,6}\s+/,"").trim()}function ct(){const t=m(l=>l.entries),r=m(l=>l.typeFilter),a=m(l=>l.tagFilter),s=m(l=>l.categoryFilter),i=m(l=>l.statusFilter),o=m(l=>l.setSelected),c=m(l=>l.selectedId),n=d.useMemo(()=>t.filter(l=>!(r!=="all"&&l.type!==r||a!=="all"&&!l.tags.includes(a)||s!=="all"&&l.category!==s||i!=="all"&&l.status!==i)),[t,r,a,s,i]);return n.length===0?e.jsx("div",{className:"flex items-center justify-center h-full text-text-tertiary text-[length:var(--font-size-sm)]",children:"No entries match the current filters"}):e.jsx("div",{className:"p-4 overflow-y-auto h-full",children:e.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-3",children:n.map(l=>e.jsx(dt,{entry:l,selected:l.id===c,onSelect:()=>o(l.id)},l.id))})})}function dt({entry:t,selected:r,onSelect:a}){const s=ot[t.type];return e.jsxs("button",{type:"button",onClick:a,className:`text-left rounded-[var(--radius-md,6px)] border p-3 transition-all flex flex-col gap-1.5 ${r?"border-border-strong bg-bg-secondary shadow-sm":"border-border bg-bg-primary hover:bg-bg-secondary hover:border-border-strong"}`,children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"inline-block w-[6px] h-[6px] rounded-full shrink-0",style:{backgroundColor:s}}),e.jsx("span",{className:"text-[10px] uppercase tracking-wider text-text-tertiary font-medium",children:t.type}),e.jsx("span",{className:"text-[10px] text-text-quaternary ml-auto",children:t.status})]}),e.jsx("div",{className:"font-medium text-text-primary text-[length:var(--font-size-sm)] leading-snug line-clamp-2",children:t.title}),t.summary&&e.jsx("div",{className:"text-text-tertiary text-[11px] line-clamp-2 leading-snug",children:lt(t.summary)}),t.tags.length>0&&e.jsxs("div",{className:"flex flex-wrap gap-1 mt-0.5",children:[t.tags.slice(0,4).map(i=>e.jsx("span",{className:"px-1 py-px text-[10px] rounded bg-bg-tertiary text-text-tertiary",children:i},i)),t.tags.length>4&&e.jsxs("span",{className:"text-[10px] text-text-quaternary",children:["+",t.tags.length-4]})]}),e.jsx("div",{className:"text-[10px] text-text-quaternary font-mono truncate mt-auto pt-1",children:t.source.path})]})}const xt={project:"#3b82f6",roadmap:"#8b5cf6",spec:"#16a34a",issue:"#dc2626",lesson:"#ca8a04",knowhow:"#0891b2",note:"#9ca3af"};function pt(){const t=m(o=>o.fetchGraph),r=m(o=>o.graph),a=m(o=>o.byId),s=m(o=>o.setSelected);d.useEffect(()=>{t()},[t]);const i=d.useMemo(()=>{if(!r)return[];const o=new Map;for(const[c,n]of Object.entries(r.forwardLinks)){o.has(c)||o.set(c,{out:0,in:0}),o.get(c).out=n.length;for(const l of n)o.has(l)||o.set(l,{out:0,in:0}),o.get(l).in+=1}return Array.from(o.entries()).map(([c,n])=>{var l,x;return{id:c,title:((l=a[c])==null?void 0:l.title)??c,type:(x=a[c])==null?void 0:x.type,outDegree:n.out,inDegree:n.in,total:n.out+n.in}}).sort((c,n)=>n.total-c.total)},[r,a]);return r?e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-4 px-4 py-2.5 border-b border-border text-[length:var(--font-size-xs)] text-text-secondary",children:[e.jsxs("span",{children:[i.length," connected nodes"]}),e.jsx("span",{children:"·"}),e.jsxs("span",{children:[Object.values(r.forwardLinks).reduce((o,c)=>o+c.length,0)," links"]}),r.brokenLinks.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{className:"text-accent-red",children:[r.brokenLinks.length," broken"]})]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto",children:[e.jsxs("table",{className:"w-full text-[length:var(--font-size-sm)]",children:[e.jsx("thead",{className:"sticky top-0 bg-bg-primary z-10",children:e.jsxs("tr",{className:"border-b border-border text-[10px] uppercase tracking-wider text-text-tertiary",children:[e.jsx("th",{className:"text-left px-4 py-2 font-medium",children:"Entry"}),e.jsx("th",{className:"text-left px-3 py-2 font-medium w-16",children:"Type"}),e.jsx("th",{className:"text-center px-3 py-2 font-medium w-16",children:"Out"}),e.jsx("th",{className:"text-center px-3 py-2 font-medium w-16",children:"In"})]})}),e.jsx("tbody",{children:i.map(o=>e.jsxs("tr",{className:"border-b border-border hover:bg-bg-secondary transition-colors cursor-pointer",onClick:()=>s(o.id),children:[e.jsx("td",{className:"px-4 py-2",children:e.jsxs("div",{className:"flex items-center gap-2",children:[o.type&&e.jsx("span",{className:"inline-block w-[6px] h-[6px] rounded-full shrink-0",style:{backgroundColor:xt[o.type]??"#9ca3af"}}),e.jsx("span",{className:"text-text-primary truncate",children:o.title})]})}),e.jsx("td",{className:"px-3 py-2 text-text-tertiary text-[length:var(--font-size-xs)]",children:o.type??"—"}),e.jsx("td",{className:"px-3 py-2 text-center",children:o.outDegree>0?e.jsx("span",{className:"text-accent-blue font-medium",children:o.outDegree}):e.jsx("span",{className:"text-text-quaternary",children:"0"})}),e.jsx("td",{className:"px-3 py-2 text-center",children:o.inDegree>0?e.jsx("span",{className:"text-accent-green font-medium",children:o.inDegree}):e.jsx("span",{className:"text-text-quaternary",children:"0"})})]},o.id))})]}),r.brokenLinks.length>0&&e.jsxs("div",{className:"p-4 border-t border-border",children:[e.jsxs("h3",{className:"text-[10px] uppercase tracking-wider text-text-tertiary font-medium mb-2",children:["Broken Links (",r.brokenLinks.length,")"]}),e.jsx("ul",{className:"flex flex-col gap-1 text-[length:var(--font-size-xs)]",children:r.brokenLinks.map((o,c)=>{var n;return e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",onClick:()=>s(o.sourceId),className:"text-accent-blue hover:underline truncate",children:((n=a[o.sourceId])==null?void 0:n.title)??o.sourceId}),e.jsx("span",{className:"text-text-quaternary",children:"→"}),e.jsx("span",{className:"text-text-tertiary line-through",children:o.target})]},`${o.sourceId}-${c}`)})})]})]})]}):e.jsx("div",{className:"flex items-center justify-center h-full text-text-tertiary text-[length:var(--font-size-sm)]",children:"Loading graph data…"})}const ut=[{label:"Reader",icon:e.jsx(C,{size:14,strokeWidth:2}),shortcut:"1"},{label:"Gallery",icon:e.jsx(Z,{size:14,strokeWidth:2}),shortcut:"2"},{label:"Structured",icon:e.jsx(me,{size:14,strokeWidth:2}),shortcut:"3"}],q=["reader","gallery","structured"],ft=[{label:"Reader",icon:e.jsx(he,{size:14,strokeWidth:2}),shortcut:"1"},{label:"Gallery",icon:e.jsx(Z,{size:14,strokeWidth:2}),shortcut:"2"},{label:"Graph",icon:e.jsx(we,{size:14,strokeWidth:2}),shortcut:"3"}],U=["reader","gallery","graph"],ht=[{value:"all",label:"All"},{value:"project",label:"Project"},{value:"roadmap",label:"Roadmap"},{value:"spec",label:"Specs"},{value:"issue",label:"Issues"},{value:"lesson",label:"Lessons"},{value:"knowhow",label:"KnowHow"},{value:"note",label:"Notes"}],k={initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8}};function Ft(){const[t,r]=d.useState("files"),[a,s]=d.useState("reader"),[i,o]=d.useState("reader"),{tree:c,selectedPath:n,content:l,loading:x,treeLoading:p,error:u,selectFile:f}=Se(),{fetchEntries:g,loading:b,error:y,entries:S,search:E,setSearch:R,typeFilter:ce,setTypeFilter:de}=m(Q(h=>({fetchEntries:h.fetchEntries,loading:h.loading,error:h.error,entries:h.entries,search:h.search,setSearch:h.setSearch,typeFilter:h.typeFilter,setTypeFilter:h.setTypeFilter})));d.useEffect(()=>{t==="wiki"&&g()},[t,g]),d.useEffect(()=>{if(t!=="wiki")return;const h=setTimeout(()=>void g(),200);return()=>clearTimeout(h)},[E,g,t]);const{register:V,unregister:P}=d.useContext(ue),B=d.useCallback(h=>{t==="files"?s(q[h]):o(U[h])},[t]);return d.useEffect(()=>{const h=t==="files"?ut:ft,v=t==="files"?q.indexOf(a):U.indexOf(i);V({items:h.map(z=>({label:z.label,icon:z.icon,shortcut:z.shortcut})),activeIndex:v,onSwitch:B})},[t,a,i,V,B]),d.useEffect(()=>()=>P(),[P]),d.useEffect(()=>{function h(v){v.target instanceof HTMLInputElement||v.target instanceof HTMLTextAreaElement||(t==="files"?v.key==="1"?s("reader"):v.key==="2"?s("gallery"):v.key==="3"&&s("structured"):v.key==="1"?o("reader"):v.key==="2"?o("gallery"):v.key==="3"&&o("graph"))}return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[t]),e.jsxs("div",{className:"flex h-full overflow-hidden",children:[e.jsxs("div",{className:"w-[272px] shrink-0 border-r border-border overflow-hidden flex flex-col bg-bg-primary",children:[e.jsxs("div",{className:"flex items-center gap-1 px-2 py-2 border-b border-border shrink-0",children:[e.jsx(Y,{mode:"files",active:t==="files",icon:e.jsx(je,{size:13,strokeWidth:2}),label:"Files",onClick:()=>r("files")}),e.jsx(Y,{mode:"wiki",active:t==="wiki",icon:e.jsx(Ce,{size:13,strokeWidth:2}),label:"Wiki",onClick:()=>r("wiki")})]}),t==="files"?e.jsx(ge,{tree:c,selectedPath:n,onSelectFile:f,loading:p}):e.jsxs(e.Fragment,{children:[e.jsx(it,{}),e.jsxs("div",{className:"flex flex-col gap-2 px-3 py-2 border-b border-border",children:[e.jsxs("div",{className:"relative",children:[e.jsx(X,{size:13,strokeWidth:2,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-text-tertiary pointer-events-none"}),e.jsx("input",{type:"text",value:E,placeholder:"Search…",onChange:h=>R(h.target.value),className:"w-full pl-7 pr-7 py-1.5 bg-bg-secondary border border-border rounded-[var(--radius-md,6px)] text-[length:var(--font-size-sm)] text-text-primary placeholder:text-text-quaternary focus:outline-none focus:border-border-strong transition-colors"}),E&&e.jsx("button",{type:"button",onClick:()=>R(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-tertiary hover:text-text-secondary transition-colors",children:e.jsx(fe,{size:12,strokeWidth:2})})]}),e.jsx("div",{className:"flex flex-wrap gap-1",children:ht.map(h=>e.jsx("button",{type:"button",onClick:()=>de(h.value),className:`px-2 py-0.5 rounded-[var(--radius-full,999px)] text-[10px] font-medium transition-all ${ce===h.value?"bg-text-primary text-bg-primary":"text-text-tertiary hover:text-text-secondary hover:bg-bg-secondary"}`,children:h.label},h.value))}),e.jsxs("div",{className:"flex items-center gap-1 text-[10px] text-text-quaternary",children:[e.jsxs("span",{children:[S.length," entr",S.length===1?"y":"ies"]}),b&&e.jsx("span",{className:"animate-pulse",children:"· loading…"}),y&&e.jsx("span",{className:"text-accent-red ml-1",children:y})]})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:e.jsx(tt,{})})]})]}),e.jsx("div",{className:"flex-1 overflow-hidden relative min-w-0",children:e.jsx(be,{mode:"wait",children:t==="files"?e.jsxs(e.Fragment,{children:[a==="reader"&&e.jsx(N.div,{className:"absolute inset-0 flex flex-col",variants:k,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.25,ease:[.34,1.56,.64,1]},children:e.jsx(ne,{content:l,path:n,onNavigate:f,loading:x,error:u})},"file-reader"),a==="gallery"&&e.jsx(N.div,{className:"absolute inset-0 flex flex-col",variants:k,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.25,ease:[.34,1.56,.64,1]},children:e.jsx(De,{tree:c,onSelectFile:f,selectedPath:n})},"file-gallery"),a==="structured"&&e.jsx(N.div,{className:"absolute inset-0 flex flex-col",variants:k,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.25,ease:[.34,1.56,.64,1]},children:e.jsx(Ke,{content:l,path:n})},"file-structured")]}):e.jsxs(e.Fragment,{children:[i==="reader"&&e.jsx(N.div,{className:"absolute inset-0",variants:k,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.2},children:e.jsx(nt,{})},"wiki-reader"),i==="gallery"&&e.jsx(N.div,{className:"absolute inset-0",variants:k,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.2},children:e.jsx(ct,{})},"wiki-gallery"),i==="graph"&&e.jsx(N.div,{className:"absolute inset-0",variants:k,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.2},children:e.jsx(pt,{})},"wiki-graph")]})})})]})}function Y({active:t,icon:r,label:a,onClick:s}){return e.jsxs("button",{type:"button",onClick:s,className:["flex-1 flex items-center justify-center gap-1.5 px-2 py-1.5 rounded-[var(--radius-md,6px)]","text-[length:var(--font-size-sm)] font-medium transition-all duration-150",t?"bg-bg-active text-text-primary shadow-sm":"text-text-tertiary hover:text-text-secondary hover:bg-bg-hover"].join(" "),children:[r,e.jsx("span",{children:a})]})}export{Ft as ArtifactsPage};
|
|
21
|
+
`)},[s,i]);if(!t)return e.jsx("div",{className:"flex items-center justify-center h-full text-text-tertiary text-[length:var(--font-size-sm)]",children:"Select an entry"});if(!s)return e.jsx("div",{className:"p-4 text-text-tertiary text-[length:var(--font-size-sm)]",children:"Entry not found."});const c=s.source.path+(s.source.line!==void 0?`:${s.source.line}`:"");return e.jsx(ne,{content:o,path:c,onNavigate:()=>{},loading:!1,error:null,title:s.title,subtitle:`${s.type.toUpperCase()} · ${s.status.toUpperCase()}`})}function it(){const{health:t,fetchHealth:r,setSelected:a,byId:s}=m(Q(n=>({health:n.health,fetchHealth:n.fetchHealth,setSelected:n.setSelected,byId:n.byId}))),[i,o]=d.useState(!1);if(d.useEffect(()=>{r()},[r]),!t)return e.jsx("div",{className:"px-3 py-2 text-[length:var(--font-size-xs)] text-text-tertiary border-b border-border",children:"Loading health…"});const c=t.score>=80?"var(--color-accent-green, #16a34a)":t.score>=50?"var(--color-accent-yellow, #ca8a04)":"var(--color-accent-red, #dc2626)";return e.jsxs("div",{className:"border-b border-border",children:[e.jsxs("button",{type:"button",onClick:()=>o(!i),className:"w-full flex items-center gap-2 px-3 py-2 hover:bg-bg-secondary transition-colors",children:[e.jsx(ee,{size:12,strokeWidth:2,className:"text-text-tertiary transition-transform shrink-0",style:{transform:i?"rotate(90deg)":void 0}}),e.jsx(pe,{size:12,strokeWidth:2,className:"text-text-tertiary shrink-0"}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] text-text-secondary font-medium",children:"Health"}),e.jsx("span",{className:"text-[length:var(--font-size-sm)] font-semibold ml-auto",style:{color:c},children:t.score}),e.jsxs("div",{className:"flex gap-2 text-[length:var(--font-size-xs)] text-text-tertiary",children:[e.jsxs("span",{children:[t.totals.entries," entries"]}),t.totals.orphans>0&&e.jsxs("span",{children:["· ",t.totals.orphans," orphans"]}),t.totals.brokenLinks>0&&e.jsxs("span",{className:"text-accent-red",children:["· ",t.totals.brokenLinks," broken"]})]})]}),i&&e.jsxs("div",{className:"px-3 pb-2 flex flex-col gap-2 text-[length:var(--font-size-xs)]",children:[t.hubs.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"uppercase tracking-wider text-text-tertiary mb-1 text-[10px]",children:"Top hubs"}),e.jsx("ul",{className:"flex flex-col gap-0.5",children:t.hubs.slice(0,5).map(n=>{var l;return e.jsxs("li",{className:"flex justify-between gap-2",children:[e.jsx("button",{type:"button",onClick:()=>a(n.id),className:"truncate text-accent-blue hover:underline text-left",children:((l=s[n.id])==null?void 0:l.title)??n.id}),e.jsx("span",{className:"text-text-tertiary shrink-0",children:n.inDegree})]},n.id)})})]}),t.orphans.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"uppercase tracking-wider text-text-tertiary mb-1 text-[10px]",children:["Orphans (",t.orphans.length,")"]}),e.jsx("ul",{className:"flex flex-wrap gap-1 max-h-16 overflow-y-auto",children:t.orphans.slice(0,10).map(n=>{var l;return e.jsx("li",{children:e.jsx("button",{type:"button",onClick:()=>a(n),className:"px-1.5 py-0.5 rounded bg-bg-tertiary text-text-secondary hover:text-accent-blue hover:underline transition-colors",children:((l=s[n])==null?void 0:l.title)??n})},n)})})]}),t.brokenLinks.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"uppercase tracking-wider text-text-tertiary mb-1 text-[10px]",children:["Broken (",t.brokenLinks.length,")"]}),e.jsx("ul",{className:"flex flex-col gap-0.5 max-h-16 overflow-y-auto text-text-secondary",children:t.brokenLinks.slice(0,5).map((n,l)=>e.jsxs("li",{className:"truncate",children:[e.jsx("span",{className:"text-text-tertiary",children:n.sourceId})," → ",e.jsx("span",{className:"line-through",children:n.target})]},`${n.sourceId}-${l}`))})]})]})]})}const ot={project:"var(--color-accent-blue, #3b82f6)",roadmap:"var(--color-accent-purple, #8b5cf6)",spec:"var(--color-accent-green, #16a34a)",issue:"var(--color-accent-red, #dc2626)",knowhow:"var(--color-accent-cyan, #0891b2)",note:"var(--color-text-tertiary, #9ca3af)"};function lt(t){return t.replace(/^#{1,6}\s+/,"").trim()}function ct(){const t=m(l=>l.entries),r=m(l=>l.typeFilter),a=m(l=>l.tagFilter),s=m(l=>l.categoryFilter),i=m(l=>l.statusFilter),o=m(l=>l.setSelected),c=m(l=>l.selectedId),n=d.useMemo(()=>t.filter(l=>!(r!=="all"&&l.type!==r||a!=="all"&&!l.tags.includes(a)||s!=="all"&&l.category!==s||i!=="all"&&l.status!==i)),[t,r,a,s,i]);return n.length===0?e.jsx("div",{className:"flex items-center justify-center h-full text-text-tertiary text-[length:var(--font-size-sm)]",children:"No entries match the current filters"}):e.jsx("div",{className:"p-4 overflow-y-auto h-full",children:e.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-3",children:n.map(l=>e.jsx(dt,{entry:l,selected:l.id===c,onSelect:()=>o(l.id)},l.id))})})}function dt({entry:t,selected:r,onSelect:a}){const s=ot[t.type];return e.jsxs("button",{type:"button",onClick:a,className:`text-left rounded-[var(--radius-md,6px)] border p-3 transition-all flex flex-col gap-1.5 ${r?"border-border-strong bg-bg-secondary shadow-sm":"border-border bg-bg-primary hover:bg-bg-secondary hover:border-border-strong"}`,children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"inline-block w-[6px] h-[6px] rounded-full shrink-0",style:{backgroundColor:s}}),e.jsx("span",{className:"text-[10px] uppercase tracking-wider text-text-tertiary font-medium",children:t.type}),e.jsx("span",{className:"text-[10px] text-text-quaternary ml-auto",children:t.status})]}),e.jsx("div",{className:"font-medium text-text-primary text-[length:var(--font-size-sm)] leading-snug line-clamp-2",children:t.title}),t.summary&&e.jsx("div",{className:"text-text-tertiary text-[11px] line-clamp-2 leading-snug",children:lt(t.summary)}),t.tags.length>0&&e.jsxs("div",{className:"flex flex-wrap gap-1 mt-0.5",children:[t.tags.slice(0,4).map(i=>e.jsx("span",{className:"px-1 py-px text-[10px] rounded bg-bg-tertiary text-text-tertiary",children:i},i)),t.tags.length>4&&e.jsxs("span",{className:"text-[10px] text-text-quaternary",children:["+",t.tags.length-4]})]}),e.jsx("div",{className:"text-[10px] text-text-quaternary font-mono truncate mt-auto pt-1",children:t.source.path})]})}const xt={project:"#3b82f6",roadmap:"#8b5cf6",spec:"#16a34a",issue:"#dc2626",knowhow:"#0891b2",note:"#9ca3af"};function pt(){const t=m(o=>o.fetchGraph),r=m(o=>o.graph),a=m(o=>o.byId),s=m(o=>o.setSelected);d.useEffect(()=>{t()},[t]);const i=d.useMemo(()=>{if(!r)return[];const o=new Map;for(const[c,n]of Object.entries(r.forwardLinks)){o.has(c)||o.set(c,{out:0,in:0}),o.get(c).out=n.length;for(const l of n)o.has(l)||o.set(l,{out:0,in:0}),o.get(l).in+=1}return Array.from(o.entries()).map(([c,n])=>{var l,x;return{id:c,title:((l=a[c])==null?void 0:l.title)??c,type:(x=a[c])==null?void 0:x.type,outDegree:n.out,inDegree:n.in,total:n.out+n.in}}).sort((c,n)=>n.total-c.total)},[r,a]);return r?e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-4 px-4 py-2.5 border-b border-border text-[length:var(--font-size-xs)] text-text-secondary",children:[e.jsxs("span",{children:[i.length," connected nodes"]}),e.jsx("span",{children:"·"}),e.jsxs("span",{children:[Object.values(r.forwardLinks).reduce((o,c)=>o+c.length,0)," links"]}),r.brokenLinks.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{className:"text-accent-red",children:[r.brokenLinks.length," broken"]})]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto",children:[e.jsxs("table",{className:"w-full text-[length:var(--font-size-sm)]",children:[e.jsx("thead",{className:"sticky top-0 bg-bg-primary z-10",children:e.jsxs("tr",{className:"border-b border-border text-[10px] uppercase tracking-wider text-text-tertiary",children:[e.jsx("th",{className:"text-left px-4 py-2 font-medium",children:"Entry"}),e.jsx("th",{className:"text-left px-3 py-2 font-medium w-16",children:"Type"}),e.jsx("th",{className:"text-center px-3 py-2 font-medium w-16",children:"Out"}),e.jsx("th",{className:"text-center px-3 py-2 font-medium w-16",children:"In"})]})}),e.jsx("tbody",{children:i.map(o=>e.jsxs("tr",{className:"border-b border-border hover:bg-bg-secondary transition-colors cursor-pointer",onClick:()=>s(o.id),children:[e.jsx("td",{className:"px-4 py-2",children:e.jsxs("div",{className:"flex items-center gap-2",children:[o.type&&e.jsx("span",{className:"inline-block w-[6px] h-[6px] rounded-full shrink-0",style:{backgroundColor:xt[o.type]??"#9ca3af"}}),e.jsx("span",{className:"text-text-primary truncate",children:o.title})]})}),e.jsx("td",{className:"px-3 py-2 text-text-tertiary text-[length:var(--font-size-xs)]",children:o.type??"—"}),e.jsx("td",{className:"px-3 py-2 text-center",children:o.outDegree>0?e.jsx("span",{className:"text-accent-blue font-medium",children:o.outDegree}):e.jsx("span",{className:"text-text-quaternary",children:"0"})}),e.jsx("td",{className:"px-3 py-2 text-center",children:o.inDegree>0?e.jsx("span",{className:"text-accent-green font-medium",children:o.inDegree}):e.jsx("span",{className:"text-text-quaternary",children:"0"})})]},o.id))})]}),r.brokenLinks.length>0&&e.jsxs("div",{className:"p-4 border-t border-border",children:[e.jsxs("h3",{className:"text-[10px] uppercase tracking-wider text-text-tertiary font-medium mb-2",children:["Broken Links (",r.brokenLinks.length,")"]}),e.jsx("ul",{className:"flex flex-col gap-1 text-[length:var(--font-size-xs)]",children:r.brokenLinks.map((o,c)=>{var n;return e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",onClick:()=>s(o.sourceId),className:"text-accent-blue hover:underline truncate",children:((n=a[o.sourceId])==null?void 0:n.title)??o.sourceId}),e.jsx("span",{className:"text-text-quaternary",children:"→"}),e.jsx("span",{className:"text-text-tertiary line-through",children:o.target})]},`${o.sourceId}-${c}`)})})]})]})]}):e.jsx("div",{className:"flex items-center justify-center h-full text-text-tertiary text-[length:var(--font-size-sm)]",children:"Loading graph data…"})}const ut=[{label:"Reader",icon:e.jsx(C,{size:14,strokeWidth:2}),shortcut:"1"},{label:"Gallery",icon:e.jsx(Z,{size:14,strokeWidth:2}),shortcut:"2"},{label:"Structured",icon:e.jsx(me,{size:14,strokeWidth:2}),shortcut:"3"}],q=["reader","gallery","structured"],ft=[{label:"Reader",icon:e.jsx(he,{size:14,strokeWidth:2}),shortcut:"1"},{label:"Gallery",icon:e.jsx(Z,{size:14,strokeWidth:2}),shortcut:"2"},{label:"Graph",icon:e.jsx(we,{size:14,strokeWidth:2}),shortcut:"3"}],U=["reader","gallery","graph"],ht=[{value:"all",label:"All"},{value:"project",label:"Project"},{value:"roadmap",label:"Roadmap"},{value:"spec",label:"Specs"},{value:"issue",label:"Issues"},{value:"knowhow",label:"KnowHow"},{value:"note",label:"Notes"}],k={initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8}};function Ft(){const[t,r]=d.useState("files"),[a,s]=d.useState("reader"),[i,o]=d.useState("reader"),{tree:c,selectedPath:n,content:l,loading:x,treeLoading:p,error:u,selectFile:f}=Se(),{fetchEntries:g,loading:b,error:y,entries:S,search:E,setSearch:R,typeFilter:ce,setTypeFilter:de}=m(Q(h=>({fetchEntries:h.fetchEntries,loading:h.loading,error:h.error,entries:h.entries,search:h.search,setSearch:h.setSearch,typeFilter:h.typeFilter,setTypeFilter:h.setTypeFilter})));d.useEffect(()=>{t==="wiki"&&g()},[t,g]),d.useEffect(()=>{if(t!=="wiki")return;const h=setTimeout(()=>void g(),200);return()=>clearTimeout(h)},[E,g,t]);const{register:V,unregister:P}=d.useContext(ue),B=d.useCallback(h=>{t==="files"?s(q[h]):o(U[h])},[t]);return d.useEffect(()=>{const h=t==="files"?ut:ft,v=t==="files"?q.indexOf(a):U.indexOf(i);V({items:h.map(z=>({label:z.label,icon:z.icon,shortcut:z.shortcut})),activeIndex:v,onSwitch:B})},[t,a,i,V,B]),d.useEffect(()=>()=>P(),[P]),d.useEffect(()=>{function h(v){v.target instanceof HTMLInputElement||v.target instanceof HTMLTextAreaElement||(t==="files"?v.key==="1"?s("reader"):v.key==="2"?s("gallery"):v.key==="3"&&s("structured"):v.key==="1"?o("reader"):v.key==="2"?o("gallery"):v.key==="3"&&o("graph"))}return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[t]),e.jsxs("div",{className:"flex h-full overflow-hidden",children:[e.jsxs("div",{className:"w-[272px] shrink-0 border-r border-border overflow-hidden flex flex-col bg-bg-primary",children:[e.jsxs("div",{className:"flex items-center gap-1 px-2 py-2 border-b border-border shrink-0",children:[e.jsx(Y,{mode:"files",active:t==="files",icon:e.jsx(je,{size:13,strokeWidth:2}),label:"Files",onClick:()=>r("files")}),e.jsx(Y,{mode:"wiki",active:t==="wiki",icon:e.jsx(Ce,{size:13,strokeWidth:2}),label:"Wiki",onClick:()=>r("wiki")})]}),t==="files"?e.jsx(ge,{tree:c,selectedPath:n,onSelectFile:f,loading:p}):e.jsxs(e.Fragment,{children:[e.jsx(it,{}),e.jsxs("div",{className:"flex flex-col gap-2 px-3 py-2 border-b border-border",children:[e.jsxs("div",{className:"relative",children:[e.jsx(X,{size:13,strokeWidth:2,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-text-tertiary pointer-events-none"}),e.jsx("input",{type:"text",value:E,placeholder:"Search…",onChange:h=>R(h.target.value),className:"w-full pl-7 pr-7 py-1.5 bg-bg-secondary border border-border rounded-[var(--radius-md,6px)] text-[length:var(--font-size-sm)] text-text-primary placeholder:text-text-quaternary focus:outline-none focus:border-border-strong transition-colors"}),E&&e.jsx("button",{type:"button",onClick:()=>R(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-tertiary hover:text-text-secondary transition-colors",children:e.jsx(fe,{size:12,strokeWidth:2})})]}),e.jsx("div",{className:"flex flex-wrap gap-1",children:ht.map(h=>e.jsx("button",{type:"button",onClick:()=>de(h.value),className:`px-2 py-0.5 rounded-[var(--radius-full,999px)] text-[10px] font-medium transition-all ${ce===h.value?"bg-text-primary text-bg-primary":"text-text-tertiary hover:text-text-secondary hover:bg-bg-secondary"}`,children:h.label},h.value))}),e.jsxs("div",{className:"flex items-center gap-1 text-[10px] text-text-quaternary",children:[e.jsxs("span",{children:[S.length," entr",S.length===1?"y":"ies"]}),b&&e.jsx("span",{className:"animate-pulse",children:"· loading…"}),y&&e.jsx("span",{className:"text-accent-red ml-1",children:y})]})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:e.jsx(tt,{})})]})]}),e.jsx("div",{className:"flex-1 overflow-hidden relative min-w-0",children:e.jsx(be,{mode:"wait",children:t==="files"?e.jsxs(e.Fragment,{children:[a==="reader"&&e.jsx(N.div,{className:"absolute inset-0 flex flex-col",variants:k,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.25,ease:[.34,1.56,.64,1]},children:e.jsx(ne,{content:l,path:n,onNavigate:f,loading:x,error:u})},"file-reader"),a==="gallery"&&e.jsx(N.div,{className:"absolute inset-0 flex flex-col",variants:k,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.25,ease:[.34,1.56,.64,1]},children:e.jsx(De,{tree:c,onSelectFile:f,selectedPath:n})},"file-gallery"),a==="structured"&&e.jsx(N.div,{className:"absolute inset-0 flex flex-col",variants:k,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.25,ease:[.34,1.56,.64,1]},children:e.jsx(Ke,{content:l,path:n})},"file-structured")]}):e.jsxs(e.Fragment,{children:[i==="reader"&&e.jsx(N.div,{className:"absolute inset-0",variants:k,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.2},children:e.jsx(nt,{})},"wiki-reader"),i==="gallery"&&e.jsx(N.div,{className:"absolute inset-0",variants:k,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.2},children:e.jsx(ct,{})},"wiki-gallery"),i==="graph"&&e.jsx(N.div,{className:"absolute inset-0",variants:k,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.2},children:e.jsx(pt,{})},"wiki-graph")]})})})]})}function Y({active:t,icon:r,label:a,onClick:s}){return e.jsxs("button",{type:"button",onClick:s,className:["flex-1 flex items-center justify-center gap-1.5 px-2 py-1.5 rounded-[var(--radius-md,6px)]","text-[length:var(--font-size-sm)] font-medium transition-all duration-150",t?"bg-bg-active text-text-primary shadow-sm":"text-text-tertiary hover:text-text-secondary hover:bg-bg-hover"].join(" "),children:[r,e.jsx("span",{children:a})]})}export{Ft as ArtifactsPage};
|