sickbay 1.14.2 → 1.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Header
3
- } from "./chunk-DC4FULTJ.js";
3
+ } from "./chunk-SC444YPU.js";
4
4
  import "./chunk-JSBRDJBE.js";
5
5
 
6
6
  // src/components/DiffApp.tsx
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-RH2MTL2L.js";
4
4
  import {
5
5
  Header
6
- } from "./chunk-DC4FULTJ.js";
6
+ } from "./chunk-SC444YPU.js";
7
7
  import {
8
8
  detectPackageManager,
9
9
  detectProject
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-MBVA75EM.js";
7
7
  import {
8
8
  Header
9
- } from "./chunk-DC4FULTJ.js";
9
+ } from "./chunk-SC444YPU.js";
10
10
  import {
11
11
  runSickbay
12
12
  } from "./chunk-CYUCJO47.js";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-RH2MTL2L.js";
4
4
  import {
5
5
  Header
6
- } from "./chunk-DC4FULTJ.js";
6
+ } from "./chunk-SC444YPU.js";
7
7
  import {
8
8
  detectProject
9
9
  } from "./chunk-CYUCJO47.js";
@@ -7,7 +7,7 @@ import {
7
7
  } from "./chunk-RH2MTL2L.js";
8
8
  import {
9
9
  Header
10
- } from "./chunk-DC4FULTJ.js";
10
+ } from "./chunk-SC444YPU.js";
11
11
  import "./chunk-CYUCJO47.js";
12
12
  import {
13
13
  detectRegressions,
@@ -690,7 +690,7 @@ function TuiApp({
690
690
  return () => timers.forEach(clearTimeout);
691
691
  }, []);
692
692
  useEffect7(() => {
693
- checkForUpdate("1.14.1").then((info) => {
693
+ checkForUpdate("1.14.3").then((info) => {
694
694
  if (info) setUpdateInfo(info);
695
695
  });
696
696
  }, []);
@@ -11,7 +11,7 @@ var ASCII_ART = `
11
11
  A vitals health check for your app
12
12
  `.trim();
13
13
  function Header({ projectName }) {
14
- return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", marginBottom: 1 }, /* @__PURE__ */ React.createElement(Text, { color: "green" }, ASCII_ART), /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { dimColor: true }, " v", "1.14.1")), projectName && /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { dimColor: true }, " Analyzing "), /* @__PURE__ */ React.createElement(Text, { bold: true, color: "white" }, projectName)));
14
+ return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", marginBottom: 1 }, /* @__PURE__ */ React.createElement(Text, { color: "green" }, ASCII_ART), /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { dimColor: true }, " v", "1.14.3")), projectName && /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { dimColor: true }, " Analyzing "), /* @__PURE__ */ React.createElement(Text, { bold: true, color: "white" }, projectName)));
15
15
  }
16
16
 
17
17
  export {
@@ -0,0 +1,118 @@
1
+ import "./chunk-JSBRDJBE.js";
2
+
3
+ // src/commands/claude.ts
4
+ import { mkdirSync, writeFileSync } from "fs";
5
+ import { join } from "path";
6
+ var SKILL_CONTENT = `---
7
+ name: sickbay
8
+ description: Understand Sickbay health reports, scores, issues, config, and CLI commands
9
+ ---
10
+
11
+ # Sickbay \u2014 Project Health Reports
12
+
13
+ Sickbay is a zero-config health check CLI for JS/TS projects. It produces structured
14
+ JSON reports scoring a project across five categories. Use this skill when you encounter
15
+ \`.sickbay/\` files, \`sickbay.config.ts\`, or when asked to interpret health results.
16
+
17
+ ## Report Locations
18
+
19
+ | File | Purpose |
20
+ |------|---------|
21
+ | \`.sickbay/last-report.json\` | Most recent scan result |
22
+ | \`.sickbay/baseline.json\` | Committed team baseline (created by \`sickbay init\`) |
23
+ | \`.sickbay/history.json\` | Local trend history (gitignored) |
24
+
25
+ ## Report Schema
26
+
27
+ \`\`\`ts
28
+ interface SickbayReport {
29
+ overallScore: number; // 0-100 weighted average
30
+ checks: CheckResult[]; // individual check results
31
+ summary: { critical: number; warnings: number; info: number };
32
+ projectInfo: { name, framework, packageManager, totalDependencies, ... };
33
+ }
34
+
35
+ interface CheckResult {
36
+ id: string; // e.g. "knip", "npm-audit", "complexity"
37
+ category: "dependencies" | "security" | "code-quality" | "performance" | "git";
38
+ score: number; // 0-100
39
+ status: "pass" | "warning" | "fail" | "skipped";
40
+ issues: Issue[];
41
+ }
42
+
43
+ interface Issue {
44
+ severity: "critical" | "warning" | "info";
45
+ message: string;
46
+ file?: string; // affected file path
47
+ fix?: {
48
+ command?: string; // shell command to run
49
+ description: string; // human-readable fix
50
+ codeChange?: { before: string; after: string };
51
+ };
52
+ }
53
+ \`\`\`
54
+
55
+ ## Score Interpretation
56
+
57
+ | Range | Rating | Color |
58
+ |-------|--------|-------|
59
+ | 80-100 | Good | Green |
60
+ | 60-79 | Fair | Yellow |
61
+ | 0-59 | Needs work | Red |
62
+
63
+ Category weights: security 30%, dependencies 25%, code-quality 25%, performance 15%, git 5%.
64
+
65
+ ## Acting on Issues
66
+
67
+ 1. **Read the report**: parse \`.sickbay/last-report.json\`
68
+ 2. **Prioritize**: fix \`critical\` severity issues first
69
+ 3. **Use fix suggestions**: if \`issue.fix.command\` exists, run it; if \`issue.fix.codeChange\` exists, apply the diff
70
+ 4. **Verify**: re-run \`sickbay\` to confirm the score improved
71
+
72
+ ## Configuration (\`sickbay.config.ts\`)
73
+
74
+ \`\`\`ts
75
+ export default {
76
+ checks: {
77
+ knip: true, // enable (default)
78
+ 'source-map-explorer': false, // disable entirely
79
+ 'npm-audit': {
80
+ suppress: [ // hide accepted findings (improves score)
81
+ { match: 'lodash', reason: 'pinned, CVE does not affect us' },
82
+ ],
83
+ },
84
+ complexity: {
85
+ thresholds: { general: 15 }, // override default thresholds
86
+ },
87
+ },
88
+ exclude: ['dist/**', 'coverage/**'], // global file exclusions
89
+ weights: { security: 0.4 }, // override category weights
90
+ }
91
+ \`\`\`
92
+
93
+ ## CLI Commands
94
+
95
+ | Command | Purpose |
96
+ |---------|---------|
97
+ | \`sickbay\` | Run a full scan (terminal UI) |
98
+ | \`sickbay --json\` | Output raw JSON report |
99
+ | \`sickbay --web\` | Open web dashboard after scan |
100
+ | \`sickbay fix\` | Interactively apply fix suggestions |
101
+ | \`sickbay diff <branch>\` | Compare score against another branch |
102
+ | \`sickbay trend\` | Show score history over time |
103
+ | \`sickbay init\` | Scaffold config + baseline |
104
+ | \`sickbay doctor\` | Diagnose project setup issues |
105
+ | \`sickbay badge\` | Generate a README health badge |
106
+ | \`sickbay stats\` | Quick codebase overview |
107
+ `;
108
+ function generateClaudeSkill(projectPath) {
109
+ const skillsDir = join(projectPath, ".claude", "skills");
110
+ mkdirSync(skillsDir, { recursive: true });
111
+ const skillPath = join(skillsDir, "sickbay.md");
112
+ writeFileSync(skillPath, SKILL_CONTENT);
113
+ console.log(`Created ${skillPath}`);
114
+ console.log("\nClaude Code will now understand your Sickbay reports, config, and CLI commands.");
115
+ }
116
+ export {
117
+ generateClaudeSkill
118
+ };
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  } from "./chunk-TYG7ZQBP.js";
9
9
  import {
10
10
  Header
11
- } from "./chunk-DC4FULTJ.js";
11
+ } from "./chunk-SC444YPU.js";
12
12
  import {
13
13
  getScoreEmoji,
14
14
  runSickbay,
@@ -304,7 +304,7 @@ if (existsSync(globalConfigPath)) {
304
304
  }
305
305
  config({ debug: false, quiet: true });
306
306
  var program = new Command();
307
- program.name("sickbay").description("React project health check CLI").version("1.14.1", "-v, --version").enablePositionalOptions().passThroughOptions().option("-p, --path <path>", "project path to analyze", process.cwd()).option("-c, --checks <checks>", "comma-separated list of checks to run").option("--package <name>", "scope to a single named package (monorepo only)").option("--json", "output raw JSON report").option("--web", "open web dashboard after scan").option("--no-ai", "disable AI features").option("--no-quotes", "suppress personality quotes in output").option("--verbose", "show verbose output").action(async (options) => {
307
+ program.name("sickbay").description("React project health check CLI").version("1.14.3", "-v, --version").enablePositionalOptions().passThroughOptions().option("-p, --path <path>", "project path to analyze", process.cwd()).option("-c, --checks <checks>", "comma-separated list of checks to run").option("--package <name>", "scope to a single named package (monorepo only)").option("--json", "output raw JSON report").option("--web", "open web dashboard after scan").option("--no-ai", "disable AI features").option("--no-quotes", "suppress personality quotes in output").option("--verbose", "show verbose output").action(async (options) => {
308
308
  if (options.path && options.path !== process.cwd()) {
309
309
  const projectEnvPath = join(options.path, ".env");
310
310
  if (existsSync(projectEnvPath)) {
@@ -314,7 +314,7 @@ program.name("sickbay").description("React project health check CLI").version("1
314
314
  const updatePromise = (async () => {
315
315
  try {
316
316
  const { checkForUpdate } = await import("./update-check-QLG6GA4Z.js");
317
- return await checkForUpdate("1.14.1");
317
+ return await checkForUpdate("1.14.3");
318
318
  } catch {
319
319
  return null;
320
320
  }
@@ -432,7 +432,7 @@ program.command("fix").description("Interactively fix issues found by sickbay sc
432
432
  }
433
433
  const { resolveProject } = await import("./resolve-package-WMVAEA6D.js");
434
434
  const resolution = await resolveProject(options.path, options.package);
435
- const { FixApp } = await import("./FixApp-GUVSGB5F.js");
435
+ const { FixApp } = await import("./FixApp-KWZGPY7S.js");
436
436
  const checks = options.checks ? options.checks.split(",").map((s) => s.trim()) : void 0;
437
437
  const projectPath = resolution.isMonorepo ? resolution.targetPath ?? options.path : resolution.targetPath;
438
438
  render(
@@ -458,7 +458,7 @@ program.command("trend").description("Show score history and trends over time").
458
458
  const { resolveProject } = await import("./resolve-package-WMVAEA6D.js");
459
459
  const resolution = await resolveProject(options.path, options.package);
460
460
  const projectPath = resolution.isMonorepo ? resolution.targetPath ?? options.path : resolution.targetPath;
461
- const { TrendApp } = await import("./TrendApp-3KY6FXKB.js");
461
+ const { TrendApp } = await import("./TrendApp-SD3RNUWW.js");
462
462
  render(
463
463
  React6.createElement(TrendApp, {
464
464
  projectPath,
@@ -480,7 +480,7 @@ program.command("stats").description("Show a quick codebase overview and project
480
480
  const { resolveProject } = await import("./resolve-package-WMVAEA6D.js");
481
481
  const resolution = await resolveProject(options.path, options.package);
482
482
  const projectPath = resolution.isMonorepo ? resolution.targetPath ?? options.path : resolution.targetPath;
483
- const { StatsApp } = await import("./StatsApp-CEI7BSPT.js");
483
+ const { StatsApp } = await import("./StatsApp-FB2D43F4.js");
484
484
  render(
485
485
  React6.createElement(StatsApp, {
486
486
  projectPath,
@@ -492,7 +492,7 @@ program.command("stats").description("Show a quick codebase overview and project
492
492
  );
493
493
  });
494
494
  program.command("tui").description("Launch the persistent developer dashboard").option("-p, --path <path>", "project path to monitor", process.cwd()).option("--no-watch", "disable file-watching auto-refresh").option("--no-quotes", "suppress personality quotes in output").option("--refresh <seconds>", "auto-refresh interval in seconds", "300").option("-c, --checks <checks>", "comma-separated list of checks to run").action(async (options) => {
495
- const { TuiApp } = await import("./TuiApp-SRIZ5KDI.js");
495
+ const { TuiApp } = await import("./TuiApp-TY43I636.js");
496
496
  const checks = options.checks ? options.checks.split(",").map((s) => s.trim()) : void 0;
497
497
  render(
498
498
  React6.createElement(TuiApp, {
@@ -515,7 +515,7 @@ program.command("doctor").description("Diagnose project setup and configuration
515
515
  const { resolveProject } = await import("./resolve-package-WMVAEA6D.js");
516
516
  const resolution = await resolveProject(options.path, options.package);
517
517
  const projectPath = resolution.isMonorepo ? resolution.targetPath ?? options.path : resolution.targetPath;
518
- const { DoctorApp } = await import("./DoctorApp-EPJ6LBBL.js");
518
+ const { DoctorApp } = await import("./DoctorApp-IH7C6S5J.js");
519
519
  render(
520
520
  React6.createElement(DoctorApp, {
521
521
  projectPath,
@@ -555,6 +555,10 @@ program.command("badge").description("Generate a health score badge for your REA
555
555
  process.stdout.write(output + "\n");
556
556
  process.exit(0);
557
557
  });
558
+ program.command("claude").description("Generate a Claude Code skill file for your project").option("-p, --path <path>", "project path", process.cwd()).action(async (options) => {
559
+ const { generateClaudeSkill } = await import("./claude-MGZYWSIQ.js");
560
+ generateClaudeSkill(options.path);
561
+ });
558
562
  program.command("diff <branch>").description("Compare health score against another branch").option("-p, --path <path>", "project path to analyze", process.cwd()).option("-c, --checks <checks>", "comma-separated list of checks to run").option("--json", "output diff as JSON").option("--verbose", "show verbose output").action(async (branch, options) => {
559
563
  if (options.path && options.path !== process.cwd()) {
560
564
  const projectEnvPath = join(options.path, ".env");
@@ -563,7 +567,7 @@ program.command("diff <branch>").description("Compare health score against anoth
563
567
  }
564
568
  }
565
569
  const checks = options.checks ? options.checks.split(",").map((s) => s.trim()) : void 0;
566
- const { DiffApp } = await import("./DiffApp-P7GVBMLM.js");
570
+ const { DiffApp } = await import("./DiffApp-3MJBZD76.js");
567
571
  render(
568
572
  React6.createElement(DiffApp, {
569
573
  projectPath: options.path,
@@ -1,16 +1,16 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DependencyGraph-DS5sXNvY.js","assets/rolldown-runtime-B1FJdls4.js","assets/markdown-BkROfETq.js","assets/react-BEi4PGB1.js","assets/react-CHpVij2M.css","assets/graph-viz-Ls9Hbzox.js","assets/ChatDrawer-Dqewz3Yz.js","assets/MonorepoOverview-vTq9TL11.js"])))=>i.map(i=>d[i]);
2
2
  import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{a as t,i as n,r}from"./markdown-BkROfETq.js";import{a as i,i as a}from"./react-BEi4PGB1.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var o=e(t(),1),s=i(),c=a(),l={security:.3,dependencies:.25,"code-quality":.25,performance:.15,git:.05},u=n(),d={security:30,dependencies:25,"code-quality":25,performance:15,git:5},f={security:`bg-red-400`,dependencies:`bg-blue-400`,"code-quality":`bg-purple-400`,performance:`bg-orange-400`,git:`bg-gray-400`},p={knip:`Finds unused files, exports, and dependencies that can be safely removed.`,depcheck:`Detects missing and unused npm packages in your dependency tree.`,outdated:`Checks for outdated dependencies using your package manager.`,"npm-audit":`Scans for known security vulnerabilities in your dependencies.`,madge:`Detects circular dependencies in your module import graph.`,"source-map-explorer":`Analyzes bundle composition and identifies large contributors.`,coverage:`Runs your test suite and measures code coverage across lines, functions, and branches.`,"license-checker":`Scans dependency licenses and flags GPL, AGPL, or other problematic types.`,jscpd:`Detects copy-pasted code blocks (duplication) across your codebase.`,git:`Analyzes git history for staleness, commit frequency, and branch hygiene.`,eslint:`Runs your ESLint config and counts errors and warnings.`,typescript:`Runs tsc --noEmit to surface type errors without emitting output.`,"todo-scanner":`Finds TODO, FIXME, and HACK comments left in source code.`,complexity:`Identifies oversized files by line count and flags candidates for splitting.`,secrets:`Detects hardcoded credentials, API keys, and tokens in source files.`,"heavy-deps":`Identifies heavy or outdated dependencies that have lighter modern alternatives.`,"react-perf":`Analyzes React components for performance anti-patterns like inline objects and index as key.`,"asset-size":`Checks static asset sizes (images, fonts, SVGs) and flags oversized files.`,"angular-change-detection":`Scans Angular components for missing OnPush change detection strategy.`,"angular-lazy-routes":`Checks Angular routes for lazy loading via loadComponent().`,"angular-strict":`Verifies strict TypeScript and Angular compiler settings in tsconfig.json.`,"angular-subscriptions":`Detects RxJS subscriptions in components that are never unsubscribed.`,"angular-security":`Detects Angular DomSanitizer bypasses and unsafe innerHTML bindings.`,"angular-template-performance":`Flags missing trackBy in ngFor loops and function calls in templates.`,"angular-build-config":`Checks angular.json production build settings for common misconfigurations.`,"next-images":`Detects raw image elements that should use next/image for automatic optimization and lazy loading.`,"next-link":`Finds raw anchor tags used for internal navigation that should use next/link for client-side routing.`,"next-fonts":`Detects Google Fonts loaded via HTML link tags instead of next/font/google for self-hosting and performance.`,"next-missing-boundaries":`Checks App Router route segments for missing loading.tsx and error.tsx boundary files.`,"next-security-headers":`Verifies that next.config.js defines security response headers (CSP, X-Frame-Options, etc.).`,"next-client-components":`Flags components with "use client" but no hooks or event handlers that may not need client rendering.`};function m(e){let t=(0,c.c)(3),{score:n}=e,r=`text-xs font-mono font-bold ${n>=80?`text-green-400`:n>=60?`text-yellow-400`:`text-red-400`}`,i;return t[0]!==n||t[1]!==r?(i=(0,u.jsx)(`span`,{className:r,children:n}),t[0]=n,t[1]=r,t[2]=i):i=t[2],i}function h(e){let t=(0,c.c)(4),{status:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={pass:`bg-green-400/10 text-green-400`,warning:`bg-yellow-400/10 text-yellow-400`,fail:`bg-red-400/10 text-red-400`,skipped:`bg-gray-500/10 text-gray-500`},t[0]=r):r=t[0];let i=r,a=`text-xs px-1.5 py-0.5 rounded-sm font-mono ${i[n]??i.skipped}`,o;return t[1]!==n||t[2]!==a?(o=(0,u.jsx)(`span`,{className:a,children:n}),t[1]=n,t[2]=a,t[3]=o):o=t[3],o}function g({report:e}){let t=e.checks.reduce((e,t)=>((e[t.category]??=[]).push(t),e),{});return(0,u.jsxs)(`div`,{className:`space-y-10 max-w-3xl`,children:[(0,u.jsxs)(`section`,{children:[(0,u.jsx)(`h1`,{className:`text-2xl font-bold text-green-400 tracking-wider mb-2`,children:`SICKBAY`}),(0,u.jsx)(`p`,{className:`text-gray-400 leading-relaxed`,children:`Sickbay is a zero-config project health dashboard. It runs a suite of checks across your codebase — dependencies, security, code quality, performance, and git hygiene — and produces a single weighted score so you can see the overall health of your project at a glance.`})]}),(0,u.jsxs)(`section`,{children:[(0,u.jsx)(`h2`,{className:`text-sm font-semibold text-gray-400 uppercase tracking-wider mb-4`,children:`How Scoring Works`}),(0,u.jsx)(`p`,{className:`text-gray-500 text-sm mb-4`,children:`Each check scores 0–100. The overall score is a weighted average grouped by category:`}),(0,u.jsx)(`div`,{className:`space-y-3`,children:Object.entries(d).sort((e,t)=>t[1]-e[1]).map(([e,t])=>(0,u.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,u.jsx)(`div`,{className:`w-32 text-sm text-gray-400 capitalize`,children:e.replace(`-`,` `)}),(0,u.jsx)(`div`,{className:`flex-1 bg-surface rounded-full h-3 overflow-hidden`,children:(0,u.jsx)(`div`,{className:`h-3 rounded-full ${f[e]??`bg-gray-400`}`,style:{width:`${t}%`}})}),(0,u.jsxs)(`div`,{className:`w-8 text-right text-sm font-mono text-gray-400`,children:[t,`%`]})]},e))}),(0,u.jsxs)(`div`,{className:`mt-4 flex gap-4 text-xs text-gray-500`,children:[(0,u.jsxs)(`span`,{children:[(0,u.jsx)(`span`,{className:`text-green-400 font-mono font-bold`,children:`≥80`}),` — healthy`]}),(0,u.jsxs)(`span`,{children:[(0,u.jsx)(`span`,{className:`text-yellow-400 font-mono font-bold`,children:`60–79`}),` — needs attention`]}),(0,u.jsxs)(`span`,{children:[(0,u.jsx)(`span`,{className:`text-red-400 font-mono font-bold`,children:`<60`}),` — critical`]})]})]}),(0,u.jsxs)(`section`,{children:[(0,u.jsx)(`h2`,{className:`text-sm font-semibold text-gray-400 uppercase tracking-wider mb-4`,children:`Checks`}),(0,u.jsx)(`div`,{className:`space-y-6`,children:Object.entries(d).sort((e,t)=>t[1]-e[1]).map(([e])=>{let n=t[e]??[];return n.length===0?null:(0,u.jsxs)(`div`,{children:[(0,u.jsxs)(`div`,{className:`text-xs text-gray-00 uppercase tracking-wider mb-2 flex items-center gap-2`,children:[(0,u.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-full ${f[e]??`bg-gray-400`}`}),e.replace(`-`,` `)]}),(0,u.jsx)(`div`,{className:`space-y-1`,children:n.map(e=>(0,u.jsxs)(`div`,{className:`bg-card rounded-lg px-4 py-3 flex items-start gap-4`,children:[(0,u.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,u.jsxs)(`div`,{className:`flex items-center gap-2 mb-0.5`,children:[(0,u.jsx)(`span`,{className:`font-mono text-sm font-semibold`,children:e.name}),(0,u.jsx)(`span`,{className:`text-sm text-[cadetblue] font-mono`,children:e.toolsUsed.join(`, `)})]}),(0,u.jsx)(`div`,{className:`text-xs text-gray-500`,children:p[e.id]??`No description available.`})]}),(0,u.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,u.jsx)(m,{score:e.score}),(0,u.jsx)(h,{status:e.status})]})]},e.id))})]},e)})})]})]})}function _(e){let t=[],n=e.split(`
3
3
  `).filter(e=>e.trim()),r=null;for(let e of n){let n=e.match(/^\*\*(.+?)\*\*$/);n?(r&&t.push(r),r={title:n[1].trim(),content:``}):r&&(r.content+=(r.content?`
4
- `:``)+e)}return r&&t.push(r),t}var v={code:({children:e,...t})=>(0,u.jsx)(`code`,{className:`px-1.5 py-0.5 bg-gray-800/60 text-purple-300 rounded-sm text-xs font-mono border border-gray-700/50`,...t,children:e}),strong:({children:e,...t})=>(0,u.jsx)(`strong`,{className:`font-medium text-gray-100`,...t,children:e}),em:({children:e,...t})=>(0,u.jsx)(`em`,{className:`italic`,...t,children:e}),p:({children:e,...t})=>(0,u.jsx)(`p`,{className:`mb-1 last:mb-0`,...t,children:e})};function y(e){let t=(0,c.c)(5),{title:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={"Health Assessment":`●`,"Critical Issues":`●`,"What's Going Well":`●`,"Next Steps":`●`},t[0]=r):r=t[0];let i=r,a;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(a={"Health Assessment":`text-green-500`,"Critical Issues":`text-red-500`,"What's Going Well":`text-green-400`,"Next Steps":`text-blue-400`},t[1]=a):a=t[1];let o=`text-xs ${a[n]||`text-gray-400`}`,s=i[n]||`●`,l;return t[2]!==o||t[3]!==s?(l=(0,u.jsx)(`span`,{className:o,children:s}),t[2]=o,t[3]=s,t[4]=l):l=t[4],l}function b({report:e,isOpen:t,onToggle:n,packageName:i}){let[a,s]=(0,o.useState)(null),[c,l]=(0,o.useState)(!0),[d,f]=(0,o.useState)(!1),p=i?`/ai/summary?package=${encodeURIComponent(i)}`:`/ai/summary`,m=i?`${e.timestamp}-${i}`:e.timestamp,h=(0,o.useCallback)(async()=>{let e=`sickbay-ai-summary-${m}`,t=localStorage.getItem(e);if(t&&!d){s(t),l(!1);return}try{let e=await fetch(p);if(e.ok){let t=await e.json();s(t.summary),localStorage.setItem(`sickbay-ai-summary-${m}`,t.summary)}else s(null)}catch{s(null)}finally{l(!1),f(!1)}},[p,m,d]);(0,o.useEffect)(()=>{h()},[h]);let g=()=>{f(!0),l(!0),localStorage.removeItem(`sickbay-ai-summary-${m}`),h()},b=a?_(a):[];return(0,u.jsx)(u.Fragment,{children:t&&(0,u.jsxs)(`div`,{className:`fixed top-6 right-6 w-104 max-h-[calc(100vh-3rem)] bg-surface border border-border rounded-lg shadow-2xl flex flex-col z-50 overflow-hidden`,children:[(0,u.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3 bg-linear-to-r from-purple-500/10 to-blue-500/10 border-b border-purple-500/20`,children:[(0,u.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,u.jsx)(`span`,{className:`text-lg`,children:(0,u.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`32`,height:`32`,viewBox:`0 0 24 24`,children:(0,u.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,d:`M9.6 6.112c.322-.816 1.478-.816 1.8 0l.91 2.31a5.8 5.8 0 0 0 3.268 3.268l2.31.91c.816.322.816 1.478 0 1.8l-2.31.91a5.8 5.8 0 0 0-3.268 3.268l-.91 2.31c-.322.816-1.478.816-1.8 0l-.91-2.31a5.8 5.8 0 0 0-3.268-3.268l-2.31-.91c-.816-.322-.816-1.478 0-1.8l2.31-.91A5.8 5.8 0 0 0 8.69 8.422zm8.563-3.382a.363.363 0 0 1 .674 0l.342.866c.221.56.665 1.004 1.225 1.225l.866.342a.363.363 0 0 1 0 .674l-.866.342a2.18 2.18 0 0 0-1.225 1.225l-.342.866a.363.363 0 0 1-.674 0l-.342-.866a2.18 2.18 0 0 0-1.225-1.225l-.867-.342a.363.363 0 0 1 0-.674l.867-.342a2.18 2.18 0 0 0 1.225-1.225z`})})}),(0,u.jsx)(`span`,{className:`font-semibold text-base text-gray-200`,children:`AI Insights`})]}),(0,u.jsxs)(`div`,{className:`flex items-center gap-2`,children:[!c&&a&&(0,u.jsx)(`button`,{onClick:g,disabled:d,className:`text-xl text-gray-500 hover:text-accent transition-colors disabled:opacity-50 px-2 py-1 rounded-sm hover:bg-purple-500/10`,title:`Regenerate insights`,children:d?`⠋`:`↻`}),(0,u.jsx)(`button`,{onClick:()=>n(!1),className:`text-gray-500 hover:text-white transition-colors text-xl w-6 h-6 flex items-center justify-center rounded-sm hover:bg-purple-500/10`,children:`✕`})]})]}),(0,u.jsx)(`div`,{className:`flex-1 overflow-y-auto p-4 space-y-3`,children:c?(0,u.jsxs)(`div`,{className:`flex items-center gap-2 text-base text-gray-500`,children:[(0,u.jsx)(`span`,{className:`animate-pulse`,children:`⠋`}),(0,u.jsx)(`span`,{children:`Generating insights...`})]}):a?b.map((e,t)=>(0,u.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,u.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,u.jsx)(y,{title:e.title}),(0,u.jsx)(`h3`,{className:`text-base font-semibold text-white uppercase tracking-wide`,children:e.title})]}),(0,u.jsx)(`div`,{className:`text-base text-gray-300 leading-snug pl-4`,children:(0,u.jsx)(r,{components:v,children:e.content})}),t<b.length-1&&(0,u.jsx)(`div`,{className:`border-t border-border/50 mt-2`})]},e.title)):(0,u.jsxs)(`div`,{className:`space-y-2`,children:[(0,u.jsx)(`div`,{className:`text-base text-gray-400`,children:`AI insights are not available. This feature requires an Anthropic API key.`}),(0,u.jsxs)(`div`,{className:`text-base text-gray-500 bg-card p-2.5 rounded-sm border border-border font-mono`,children:[(0,u.jsx)(`div`,{className:`mb-1.5 text-gray-400`,children:`To enable AI features:`}),(0,u.jsx)(`div`,{children:`export ANTHROPIC_API_KEY=sk-ant-...`}),(0,u.jsx)(`div`,{children:`sickbay --path ~/project --web`})]})]})})]})})}var x={recommend:`bg-amber-500/20 text-amber-300 border-amber-500/30`,suggest:`bg-gray-500/20 text-gray-400 border-gray-500/30`};function S(e){let t={};for(let n of e){let e=n.framework;t[e]||(t[e]=[]),t[e].push(n)}return t}function C(e){let t=(0,c.c)(23),{recommendations:n,isOpen:r,onToggle:i}=e;if(!r)return null;let a,o,s,l;if(t[0]!==i||t[1]!==n){let e=S([...n].sort(E));s=`fixed top-6 right-6 w-104 max-h-[calc(100vh-3rem)] bg-surface border border-border rounded-lg shadow-2xl flex flex-col z-50 overflow-hidden`;let r,c;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,u.jsx)(`span`,{className:`text-lg`,children:`💡`}),c=(0,u.jsx)(`span`,{className:`font-semibold text-base text-gray-200`,children:`Advisor`}),t[6]=r,t[7]=c):(r=t[6],c=t[7]);let d=n.length===1?``:`s`,f;t[8]!==n.length||t[9]!==d?(f=(0,u.jsxs)(`div`,{className:`flex items-center gap-2`,children:[r,c,(0,u.jsxs)(`span`,{className:`text-xs text-gray-500`,children:[n.length,` recommendation`,d]})]}),t[8]=n.length,t[9]=d,t[10]=f):f=t[10];let p;t[11]===i?p=t[12]:(p=(0,u.jsx)(`button`,{onClick:()=>i(!1),className:`text-gray-500 hover:text-white transition-colors text-xl w-6 h-6 flex items-center justify-center rounded-sm hover:bg-teal-500/10`,children:`✕`}),t[11]=i,t[12]=p),t[13]!==f||t[14]!==p?(l=(0,u.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3 bg-linear-to-r from-teal-500/10 to-emerald-500/10 border-b border-teal-500/20`,children:[f,p]}),t[13]=f,t[14]=p,t[15]=l):l=t[15],a=`flex-1 overflow-y-auto p-4 space-y-4`,o=Object.entries(e).map(w),t[0]=i,t[1]=n,t[2]=a,t[3]=o,t[4]=s,t[5]=l}else a=t[2],o=t[3],s=t[4],l=t[5];let d;t[16]!==a||t[17]!==o?(d=(0,u.jsx)(`div`,{className:a,children:o}),t[16]=a,t[17]=o,t[18]=d):d=t[18];let f;return t[19]!==s||t[20]!==l||t[21]!==d?(f=(0,u.jsxs)(`div`,{className:s,children:[l,d]}),t[19]=s,t[20]=l,t[21]=d,t[22]=f):f=t[22],f}function w(e){let[t,n]=e;return(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`div`,{className:`text-xs text-gray-500 uppercase tracking-wide mb-2`,children:t}),(0,u.jsx)(`div`,{className:`space-y-3`,children:n.map(T)})]},t)}function T(e){return(0,u.jsxs)(`div`,{className:`space-y-1`,children:[(0,u.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,u.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded border ${x[e.severity]}`,children:e.severity}),(0,u.jsx)(`span`,{className:`font-medium text-sm text-white`,children:e.title})]}),(0,u.jsx)(`p`,{className:`text-sm text-gray-400 leading-snug pl-0.5`,children:e.message}),e.learnMoreUrl&&(0,u.jsx)(`a`,{href:e.learnMoreUrl,target:`_blank`,rel:`noopener noreferrer`,className:`text-xs text-teal-400 hover:text-teal-300 transition-colors pl-0.5`,children:`Learn more →`})]},e.id)}function E(e,t){let n={recommend:0,suggest:1};return n[e.severity]-n[t.severity]}var D=`modulepreload`,O=function(e){return`/`+e},k={},A=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=O(t,n),t in k)return;k[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:D,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},j=(0,o.lazy)(()=>A(()=>import(`./DependencyGraph-DS5sXNvY.js`).then(e=>({default:e.DependencyGraph})),__vite__mapDeps([0,1,2,3,4,5])));function M(e,t){return e.checks.find(e=>e.id===t)?.metadata??{}}function N(e){let t=(0,c.c)(10),{label:n,value:r,sub:i}=e,a;t[0]===n?a=t[1]:(a=(0,u.jsx)(`div`,{className:`text-xs text-gray-500 mb-1`,children:n}),t[0]=n,t[1]=a);let o;t[2]===r?o=t[3]:(o=(0,u.jsx)(`div`,{className:`text-2xl font-mono font-bold`,children:r}),t[2]=r,t[3]=o);let s;t[4]===i?s=t[5]:(s=i&&(0,u.jsx)(`div`,{className:`text-xs text-gray-500 mt-1`,children:i}),t[4]=i,t[5]=s);let l;return t[6]!==a||t[7]!==o||t[8]!==s?(l=(0,u.jsxs)(`div`,{className:`bg-card rounded-lg p-4`,children:[a,o,s]}),t[6]=a,t[7]=o,t[8]=s,t[9]=l):l=t[9],l}function P(e){let t=(0,c.c)(10),{label:n,extra:r,collapsed:i,onToggle:a}=e,o=`text-gray-500 group-hover:text-gray-300 transition-transform shrink-0 ${i?`-rotate-90`:``}`,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,u.jsx)(`polyline`,{points:`6 9 12 15 18 9`}),t[0]=s):s=t[0];let l;t[1]===o?l=t[2]:(l=(0,u.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2.5,strokeLinecap:`round`,strokeLinejoin:`round`,className:o,children:s}),t[1]=o,t[2]=l);let d;t[3]===n?d=t[4]:(d=(0,u.jsx)(`h2`,{className:`text-sm font-semibold text-gray-400 uppercase tracking-wider group-hover:text-gray-200 transition-colors`,children:n}),t[3]=n,t[4]=d);let f;return t[5]!==r||t[6]!==a||t[7]!==l||t[8]!==d?(f=(0,u.jsxs)(`button`,{onClick:a,className:`flex items-center gap-2 w-full text-left group mb-3`,children:[l,d,r]}),t[5]=r,t[6]=a,t[7]=l,t[8]=d,t[9]=f):f=t[9],f}function F(e){let t=(0,c.c)(17),{label:n,pct:r}=e,i=r>=80?`bg-green-400`:r>=60?`bg-yellow-400`:`bg-red-400`,a;t[0]===n?a=t[1]:(a=(0,u.jsx)(`span`,{className:`text-gray-400`,children:n}),t[0]=n,t[1]=a);let o;t[2]===r?o=t[3]:(o=r.toFixed(1),t[2]=r,t[3]=o);let s;t[4]===o?s=t[5]:(s=(0,u.jsxs)(`span`,{className:`font-mono font-semibold`,children:[o,`%`]}),t[4]=o,t[5]=s);let l;t[6]!==a||t[7]!==s?(l=(0,u.jsxs)(`div`,{className:`flex justify-between text-xs mb-1`,children:[a,s]}),t[6]=a,t[7]=s,t[8]=l):l=t[8];let d=`h-2 rounded-full transition-all ${i}`,f=`${Math.min(r,100)}%`,p;t[9]===f?p=t[10]:(p={width:f},t[9]=f,t[10]=p);let m;t[11]!==d||t[12]!==p?(m=(0,u.jsx)(`div`,{className:`bg-surface rounded-full h-2`,children:(0,u.jsx)(`div`,{className:d,style:p})}),t[11]=d,t[12]=p,t[13]=m):m=t[13];let h;return t[14]!==l||t[15]!==m?(h=(0,u.jsxs)(`div`,{children:[l,m]}),t[14]=l,t[15]=m,t[16]=h):h=t[16],h}function ee(e){let t=(0,c.c)(46),{report:n}=e,[r,i]=(0,o.useState)(!1),[a,s]=(0,o.useState)(!1),[l,d]=(0,o.useState)(!1),[f,p]=(0,o.useState)(!1),m,h,g,_,v,y,b,x,S,C;if(t[0]!==r||t[1]!==a||t[2]!==n){let e=M(n,`complexity`),o=M(n,`git`),c;t[13]===n?c=t[14]:(c=M(n,`coverage`),t[13]=n,t[14]=c),m=c;let l=e.topFiles??[],d=l[0]?.lines??1,f;t[15]===n?f=t[16]:(f=M(n,`madge`),t[15]=n,t[16]=f),b=f,h=b.graph;let p;t[17]===h?p=t[18]:(p=h&&Object.keys(h).length>0,t[17]=h,t[18]=p),y=p,g=e.totalFiles!=null,v=o.commitCount!=null,_=m.lines!=null,x=`space-y-8`,S=g&&(0,u.jsxs)(`section`,{children:[(0,u.jsx)(P,{label:`Codebase`,collapsed:r,onToggle:()=>i(z)}),!r&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-3 mb-6`,children:[(0,u.jsx)(N,{label:`total files`,value:e.totalFiles}),(0,u.jsx)(N,{label:`total lines`,value:e.totalLines.toLocaleString()}),(0,u.jsx)(N,{label:`avg file size`,value:`${e.avgLines} loc`}),(0,u.jsx)(N,{label:`oversized files`,value:e.oversizedCount,sub:`over threshold`})]}),l.length>0&&(0,u.jsxs)(`div`,{className:`bg-card rounded-lg p-4`,children:[(0,u.jsx)(`div`,{className:`text-xs text-gray-500 mb-3`,children:`largest files`}),(0,u.jsx)(`div`,{className:`space-y-2`,children:l.slice(0,10).map(e=>{let t=e.warn??400,n=e.critical??600,r=e.lines>=n?`bg-red-400`:e.lines>=t?`bg-yellow-400`:`bg-green-400`;return(0,u.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,u.jsx)(`div`,{className:`w-72 text-xs font-mono text-gray-400 truncate shrink-0`,title:e.path,children:e.path.split(`/`).slice(-2).join(`/`)}),(0,u.jsx)(`div`,{className:`flex-1 bg-surface rounded-full h-4 overflow-hidden`,children:(0,u.jsx)(`div`,{className:`h-4 rounded-full flex items-center justify-end pr-2 text-xs font-mono text-black font-semibold ${r}`,style:{width:`${Math.max(8,e.lines/d*100)}%`},children:e.lines})})]},e.path)})})]})]})]}),C=v&&(0,u.jsxs)(`section`,{children:[(0,u.jsx)(P,{label:`Git Activity`,collapsed:a,onToggle:()=>s(R)}),!a&&(0,u.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-3`,children:[(0,u.jsx)(N,{label:`total commits`,value:o.commitCount.toLocaleString()}),(0,u.jsx)(N,{label:`contributors`,value:o.contributorCount}),(0,u.jsx)(N,{label:`remote branches`,value:o.remoteBranches}),(0,u.jsx)(N,{label:`last commit`,value:o.lastCommit})]})]}),t[0]=r,t[1]=a,t[2]=n,t[3]=m,t[4]=h,t[5]=g,t[6]=_,t[7]=v,t[8]=y,t[9]=b,t[10]=x,t[11]=S,t[12]=C}else m=t[3],h=t[4],g=t[5],_=t[6],v=t[7],y=t[8],b=t[9],x=t[10],S=t[11],C=t[12];let w;t[19]!==m.branches||t[20]!==m.failed||t[21]!==m.functions||t[22]!==m.lines||t[23]!==m.passed||t[24]!==m.statements||t[25]!==m.totalTests||t[26]!==l||t[27]!==_?(w=_&&(0,u.jsxs)(`section`,{children:[(0,u.jsx)(P,{label:`Test Coverage`,collapsed:l,onToggle:()=>d(L)}),!l&&(0,u.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-6`,children:[(0,u.jsxs)(`div`,{className:`bg-card rounded-lg p-4 space-y-3`,children:[(0,u.jsx)(F,{label:`Lines`,pct:m.lines}),(0,u.jsx)(F,{label:`Statements`,pct:m.statements}),(0,u.jsx)(F,{label:`Functions`,pct:m.functions}),(0,u.jsx)(F,{label:`Branches`,pct:m.branches})]}),m.totalTests!=null&&(0,u.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,u.jsx)(N,{label:`total tests`,value:m.totalTests}),(0,u.jsx)(N,{label:`passing`,value:m.passed,sub:`${m.failed} failing`})]})]})]}),t[19]=m.branches,t[20]=m.failed,t[21]=m.functions,t[22]=m.lines,t[23]=m.passed,t[24]=m.statements,t[25]=m.totalTests,t[26]=l,t[27]=_,t[28]=w):w=t[28];let T;t[29]!==h||t[30]!==f||t[31]!==y||t[32]!==b.circularCount?(T=y&&(0,u.jsxs)(`section`,{children:[(0,u.jsx)(P,{label:`Module Graph`,extra:(0,u.jsxs)(`span`,{className:`text-xs font-normal text-gray-500`,children:[Object.keys(h).length,` modules`,b.circularCount>0&&(0,u.jsxs)(`span`,{className:`text-red-400 ml-1`,children:[`· `,b.circularCount,` circular`]})]}),collapsed:f,onToggle:()=>p(I)}),!f&&(0,u.jsx)(o.Suspense,{fallback:(0,u.jsx)(`div`,{className:`text-gray-500 text-sm`,children:`Loading graph...`}),children:(0,u.jsx)(j,{graph:h,circularCount:b.circularCount})})]}),t[29]=h,t[30]=f,t[31]=y,t[32]=b.circularCount,t[33]=T):T=t[33];let E;t[34]!==g||t[35]!==_||t[36]!==v||t[37]!==y?(E=!g&&!v&&!_&&!y&&(0,u.jsx)(`div`,{className:`text-gray-500 text-sm`,children:`No codebase stats available yet.`}),t[34]=g,t[35]=_,t[36]=v,t[37]=y,t[38]=E):E=t[38];let D;return t[39]!==x||t[40]!==S||t[41]!==C||t[42]!==w||t[43]!==T||t[44]!==E?(D=(0,u.jsxs)(`div`,{className:x,children:[S,C,w,T,E]}),t[39]=x,t[40]=S,t[41]=C,t[42]=w,t[43]=T,t[44]=E,t[45]=D):D=t[45],D}function I(e){return!e}function L(e){return!e}function R(e){return!e}function z(e){return!e}function B(e){let t=(0,c.c)(4),{label:n,color:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={red:`bg-red-500/20 text-red-300`,blue:`bg-blue-500/20 text-blue-300`,yellow:`bg-yellow-500/20 text-yellow-300`,purple:`bg-purple-500/20 text-purple-300`},t[0]=i):i=t[0];let a=`px-1.5 py-0.5 rounded text-xs font-mono ${i[r]??`bg-gray-500/20 text-gray-300`}`,o;return t[1]!==n||t[2]!==a?(o=(0,u.jsx)(`span`,{className:a,children:n}),t[1]=n,t[2]=a,t[3]=o):o=t[3],o}function V(e){let t=(0,c.c)(9),{label:n,collapsed:r,onToggle:i}=e,a=`text-gray-500 group-hover:text-gray-300 transition-transform shrink-0 ${r?`-rotate-90`:``}`,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,u.jsx)(`polyline`,{points:`6 9 12 15 18 9`}),t[0]=o):o=t[0];let s;t[1]===a?s=t[2]:(s=(0,u.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2.5,strokeLinecap:`round`,strokeLinejoin:`round`,className:a,children:o}),t[1]=a,t[2]=s);let l;t[3]===n?l=t[4]:(l=(0,u.jsx)(`h2`,{className:`text-sm font-semibold text-gray-400 uppercase tracking-wider group-hover:text-gray-200 transition-colors`,children:n}),t[3]=n,t[4]=l);let d;return t[5]!==i||t[6]!==s||t[7]!==l?(d=(0,u.jsxs)(`button`,{onClick:i,className:`flex items-center gap-2 w-full text-left group mb-3`,children:[s,l]}),t[5]=i,t[6]=s,t[7]=l,t[8]=d):d=t[8],d}function H(e){return typeof e==`object`}function U(e){return!!(e===!1||H(e)&&e.enabled===!1)}function W(e){return typeof e==`number`?String(e):Array.isArray(e)?e.join(`, `):typeof e==`object`&&e?Object.entries(e).map(([e,t])=>`${e}: ${t}`).join(`, `):String(e)}function te(e){let t=(0,c.c)(36),{report:n}=e,[r,i]=(0,o.useState)(null),[a,s]=(0,o.useState)(!0),[l,d]=(0,o.useState)(!1),[f,p]=(0,o.useState)(!1),[m,h]=(0,o.useState)(!1),g;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{fetch(`/sickbay-config.json`).then(ce).then(e=>{e&&i(e)}).catch(se).finally(()=>s(!1))},t[0]=g):g=t[0];let _=g,v,y;if(t[1]===Symbol.for(`react.memo_cache_sentinel`)?(v=()=>{_()},y=[_],t[1]=v,t[2]=y):(v=t[1],y=t[2]),(0,o.useEffect)(v,y),!n.config?.hasCustomConfig){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,u.jsx)(`div`,{className:`flex items-center justify-center h-48 text-gray-500 text-sm font-mono`,children:`No custom configuration — Sickbay is running with all defaults`}),t[3]=e):e=t[3],e}if(a){let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,u.jsx)(`div`,{className:`flex items-center justify-center h-48 text-gray-500 text-sm font-mono`,children:`Loading configuration...`}),t[4]=e):e=t[4],e}let b=n.config.disabledChecks.length,x=n.config.overriddenChecks.length,S,C;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,u.jsx)(`div`,{className:`text-green-400 text-lg`,children:`⚙`}),C=(0,u.jsx)(`div`,{className:`text-sm font-semibold`,children:`Custom configuration active`}),t[5]=S,t[6]=C):(S=t[5],C=t[6]);let w;t[7]===b?w=t[8]:(w=b>0&&(0,u.jsxs)(`span`,{className:`text-red-400`,children:[b,` disabled`]}),t[7]=b,t[8]=w);let T;t[9]!==b||t[10]!==x?(T=b>0&&x>0&&(0,u.jsx)(`span`,{children:` · `}),t[9]=b,t[10]=x,t[11]=T):T=t[11];let E;t[12]===x?E=t[13]:(E=x>0&&(0,u.jsxs)(`span`,{className:`text-blue-400`,children:[x,` overridden`]}),t[12]=x,t[13]=E);let D;t[14]!==b||t[15]!==x?(D=b===0&&x===0&&(0,u.jsx)(`span`,{children:`Weight or exclude overrides active`}),t[14]=b,t[15]=x,t[16]=D):D=t[16];let O;t[17]!==w||t[18]!==T||t[19]!==E||t[20]!==D?(O=(0,u.jsx)(`div`,{className:`bg-card rounded-lg p-4 border border-border`,children:(0,u.jsxs)(`div`,{className:`flex items-center gap-3`,children:[S,(0,u.jsxs)(`div`,{children:[C,(0,u.jsxs)(`div`,{className:`text-xs text-gray-500 mt-0.5`,children:[w,T,E,D]})]})]})}),t[17]=w,t[18]=T,t[19]=E,t[20]=D,t[21]=O):O=t[21];let k;t[22]!==l||t[23]!==r?(k=r?.checks&&Object.keys(r.checks).length>0&&(0,u.jsxs)(`section`,{children:[(0,u.jsx)(V,{label:`Checks`,collapsed:l,onToggle:()=>d(oe)}),!l&&(0,u.jsx)(`div`,{className:`bg-card rounded-lg divide-y divide-border`,children:Object.entries(r.checks).map(ne)})]}),t[22]=l,t[23]=r,t[24]=k):k=t[24];let A;t[25]!==r||t[26]!==f?(A=r?.weights&&Object.keys(r.weights).length>0&&(0,u.jsxs)(`section`,{children:[(0,u.jsx)(V,{label:`Scoring Weights`,collapsed:f,onToggle:()=>p(J)}),!f&&(0,u.jsx)(`div`,{className:`bg-card rounded-lg p-4`,children:(0,u.jsx)(`div`,{className:`space-y-2`,children:Object.entries(r.weights).map(q)})})]}),t[25]=r,t[26]=f,t[27]=A):A=t[27];let j;t[28]!==r||t[29]!==m?(j=r?.exclude&&r.exclude.length>0&&(0,u.jsxs)(`section`,{children:[(0,u.jsx)(V,{label:`Global Excludes`,collapsed:m,onToggle:()=>h(K)}),!m&&(0,u.jsx)(`div`,{className:`bg-card rounded-lg p-4`,children:(0,u.jsx)(`div`,{className:`space-y-1`,children:r.exclude.map(G)})})]}),t[28]=r,t[29]=m,t[30]=j):j=t[30];let M;return t[31]!==O||t[32]!==k||t[33]!==A||t[34]!==j?(M=(0,u.jsxs)(`div`,{className:`space-y-8`,children:[O,k,A,j]}),t[31]=O,t[32]=k,t[33]=A,t[34]=j,t[35]=M):M=t[35],M}function G(e){return(0,u.jsx)(`div`,{className:`text-sm font-mono text-gray-400`,children:e},e)}function K(e){return!e}function q(e){let[t,n]=e,r=l[t]??0;return(0,u.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,u.jsx)(`span`,{className:`font-mono text-sm text-gray-300`,children:t}),(0,u.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-mono`,children:[(0,u.jsx)(`span`,{className:`text-gray-500`,children:r}),(0,u.jsx)(`span`,{className:`text-gray-600`,children:`→`}),(0,u.jsx)(`span`,{className:n>r?`text-green-400`:n<r?`text-red-400`:`text-gray-300`,children:n})]})]},t)}function J(e){return!e}function ne(e){let[t,n]=e,r=U(n),i=H(n)?n:null,a=i?.thresholds&&Object.keys(i.thresholds).length>0,o=i?.suppress&&i.suppress.length>0,s=i?.exclude&&i.exclude.length>0;return(0,u.jsxs)(`div`,{className:`px-4 py-3 ${r?`opacity-50`:``}`,children:[(0,u.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,u.jsx)(`span`,{className:`font-mono text-sm`,children:t}),(0,u.jsxs)(`div`,{className:`flex gap-1.5`,children:[r&&(0,u.jsx)(B,{label:`disabled`,color:`red`}),a&&(0,u.jsx)(B,{label:`thresholds`,color:`blue`}),o&&(0,u.jsx)(B,{label:`${i.suppress.length} suppressed`,color:`yellow`}),s&&(0,u.jsx)(B,{label:`exclude`,color:`purple`})]})]}),a&&(0,u.jsx)(`div`,{className:`mt-2 pl-2 border-l-2 border-blue-500/30`,children:Object.entries(i.thresholds).map(ae)}),o&&(0,u.jsx)(`div`,{className:`mt-2 pl-2 border-l-2 border-yellow-500/30 space-y-1`,children:i.suppress.map(ie)}),s&&(0,u.jsx)(`div`,{className:`mt-2 pl-2 border-l-2 border-purple-500/30`,children:i.exclude.map(re)})]},t)}function re(e){return(0,u.jsx)(`div`,{className:`text-xs text-gray-400 font-mono`,children:e},e)}function ie(e,t){return(0,u.jsxs)(`div`,{className:`text-xs`,children:[(0,u.jsxs)(`div`,{className:`text-gray-400 font-mono`,children:[e.path&&(0,u.jsxs)(`span`,{children:[`path: `,e.path]}),e.path&&e.match&&(0,u.jsx)(`span`,{children:` · `}),e.match&&(0,u.jsxs)(`span`,{children:[`match: `,e.match]})]}),(0,u.jsx)(`div`,{className:`text-gray-500 italic`,children:e.reason})]},`${e.path??``}-${e.match??``}-${t}`)}function ae(e){let[t,n]=e;return(0,u.jsxs)(`div`,{className:`text-xs text-gray-400 font-mono`,children:[(0,u.jsxs)(`span`,{className:`text-gray-500`,children:[t,`:`]}),` `,W(n)]},t)}function oe(e){return!e}function se(){}function ce(e){return e.ok?e.json():null}function le(e){let t=(0,c.c)(14),{report:n,onCheckClick:r}=e,[i,a]=(0,o.useState)(he),s,l;t[0]===i?(s=t[1],l=t[2]):(s=()=>{localStorage.setItem(`sickbay-critical-issues-collapsed`,String(i))},l=[i],t[0]=i,t[1]=s,t[2]=l),(0,o.useEffect)(s,l);let d=n.checks,f,p;if(t[3]!==i||t[4]!==r||t[5]!==n.checks){p=Symbol.for(`react.early_return_sentinel`);bb0:{let e=d.map(pe).filter(fe);if(e.length===0){p=null;break bb0}let n=e.reduce(de,0),o;t[8]===i?o=t[9]:(o=()=>a(!i),t[8]=i,t[9]=o);let s,c;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,u.jsx)(`span`,{className:`text-lg`,children:`❗`}),c=(0,u.jsx)(`h2`,{className:`text-lg font-semibold text-red-400`,children:`Critical Issues`}),t[10]=s,t[11]=c):(s=t[10],c=t[11]);let l=`ml-auto text-gray-500 transition-transform ${i?``:`rotate-180`}`,m;t[12]===l?m=t[13]:(m=(0,u.jsx)(`span`,{className:l,children:`▼`}),t[12]=l,t[13]=m),f=(0,u.jsxs)(`div`,{className:`bg-red-900/10 border border-red-800/30 rounded-lg p-4 mb-6`,children:[(0,u.jsxs)(`button`,{onClick:o,className:`w-full flex items-center gap-2 hover:opacity-80 transition-opacity`,children:[s,c,(0,u.jsxs)(`span`,{className:`text-sm text-gray-400`,children:[`(`,n,` total)`]}),m]}),!i&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`div`,{className:`space-y-3`,children:e.map(e=>(0,u.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,u.jsxs)(`button`,{onClick:()=>r(e.id),className:`text-accent hover:underline text-sm font-semibold flex items-center gap-2`,children:[e.name,(0,u.jsxs)(`span`,{className:`text-xs text-gray-500`,children:[`(`,e.criticalIssues.length,` critical)`]})]}),(0,u.jsxs)(`ul`,{className:`space-y-1 ml-4`,children:[e.criticalIssues.slice(0,3).map(ue),e.criticalIssues.length>3&&(0,u.jsxs)(`li`,{className:`text-xs text-gray-500`,children:[`+`,e.criticalIssues.length-3,` more critical issues`]})]})]},e.id))}),(0,u.jsx)(`div`,{className:`mt-3 pt-3 border-t border-red-800/30 text-xs text-gray-500`,children:`Click on a check name to view all issues in detail`})]})]})}t[3]=i,t[4]=r,t[5]=n.checks,t[6]=f,t[7]=p}else f=t[6],p=t[7];return p===Symbol.for(`react.early_return_sentinel`)?f:p}function ue(e){return(0,u.jsxs)(`li`,{className:`text-sm text-gray-300`,children:[(0,u.jsx)(`span`,{className:`text-red-400 mr-2`,children:`•`}),e.message]},e.message)}function de(e,t){return e+t.criticalIssues.length}function fe(e){return e.criticalIssues.length>0}function pe(e){return{...e,criticalIssues:e.issues.filter(me)}}function me(e){return e.severity===`critical`}function he(){return localStorage.getItem(`sickbay-critical-issues-collapsed`)!==`false`}function ge(e){let{dependencies:t,devDependencies:n}=e.projectInfo,r=new Set,i=new Set,a=new Map;for(let t of e.checks)for(let e of t.issues){let t=e.message,n=t.match(/^Unused (?:dev)?dependency:\s+(.+)/i);n&&r.add(n[1].trim());let o=t.match(/^Missing dependency:\s+(.+)/i);o&&i.add(o[1].trim());let s=t.match(/^([^:]+):\s*([^\s]+)\s*→\s*([^\s]+?)(?:\s*\((major|minor|patch)\))?$/);if(s){let[,t,,n,r]=s,i=r??(e.severity===`warning`?`major`:`minor`);a.set(t.trim(),{to:n.trim(),updateType:i})}}let o=[];for(let[e,n]of Object.entries(t)){let t=a.get(e);o.push({name:e,version:n,dev:!1,unused:r.has(e),missing:i.has(e),outdatedTo:t?.to,updateType:t?.updateType})}for(let[e,t]of Object.entries(n)){let n=a.get(e);o.push({name:e,version:t,dev:!0,unused:r.has(e),missing:i.has(e),outdatedTo:n?.to,updateType:n?.updateType})}return o.sort((e,t)=>{let n=(e.missing?3:0)+(e.unused?2:0)+(e.outdatedTo?1:0),r=(t.missing?3:0)+(t.unused?2:0)+(t.outdatedTo?1:0);return r===n?e.name.localeCompare(t.name):r-n})}function _e(e){let t=(0,c.c)(14),{deps:n}=e,r;if(t[0]!==n){r={major:0,minor:0,patch:0};for(let e of n)e.updateType&&(r[e.updateType]=r[e.updateType]+1);t[0]=n,t[1]=r}else r=t[1];if(r.major+r.minor+r.patch===0){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,u.jsx)(`div`,{className:`mb-4 px-4 py-3 rounded-lg bg-green-900/20 border border-green-800/50`,children:(0,u.jsx)(`span`,{className:`text-sm text-green-400`,children:`All dependencies up to date`})}),t[2]=e):e=t[2],e}let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,u.jsx)(`span`,{className:`text-sm text-gray-400`,children:`Updates available:`}),t[3]=i):i=t[3];let a;t[4]===r.major?a=t[5]:(a=r.major>0&&(0,u.jsxs)(`span`,{className:`text-xs px-2.5 py-1 rounded-full bg-orange-900/40 text-orange-400 border border-orange-800 font-medium`,children:[r.major,` major`]}),t[4]=r.major,t[5]=a);let o;t[6]===r.minor?o=t[7]:(o=r.minor>0&&(0,u.jsxs)(`span`,{className:`text-xs px-2.5 py-1 rounded-full bg-blue-900/30 text-blue-400 border border-blue-800 font-medium`,children:[r.minor,` minor`]}),t[6]=r.minor,t[7]=o);let s;t[8]===r.patch?s=t[9]:(s=r.patch>0&&(0,u.jsxs)(`span`,{className:`text-xs px-2.5 py-1 rounded-full bg-gray-800 text-gray-400 border border-gray-700 font-medium`,children:[r.patch,` patch`]}),t[8]=r.patch,t[9]=s);let l;return t[10]!==a||t[11]!==o||t[12]!==s?(l=(0,u.jsxs)(`div`,{className:`mb-4 flex items-center gap-3 px-4 py-3 rounded-lg bg-gray-900/50 border border-gray-800`,children:[i,a,o,s]}),t[10]=a,t[11]=o,t[12]=s,t[13]=l):l=t[13],l}function ve(e){let t=(0,c.c)(23),{overrides:n}=e,r;t[0]===n?r=t[1]:(r=Object.entries(n),t[0]=n,t[1]=r);let i=r,[a,s]=(0,o.useState)(i.length<=3);if(i.length===0)return null;let l;t[2]!==i||t[3]!==a?(l=a?i:i.slice(0,3),t[2]=i,t[3]=a,t[4]=l):l=t[4];let d=l,f;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,u.jsx)(`span`,{className:`text-sm font-medium text-gray-300`,children:`Package Overrides`}),t[5]=f):f=t[5];let p;t[6]===i.length?p=t[7]:(p=(0,u.jsxs)(`div`,{className:`px-4 py-2.5 flex items-center gap-2 border-b border-gray-800/50`,children:[f,(0,u.jsx)(`span`,{className:`text-xs px-1.5 py-0.5 rounded-sm bg-gray-700 text-gray-400`,children:i.length})]}),t[6]=i.length,t[7]=p);let m;t[8]===d?m=t[9]:(m=d.map(ye),t[8]=d,t[9]=m);let h;t[10]!==i.length||t[11]!==a?(h=!a&&i.length>3&&(0,u.jsxs)(`button`,{onClick:()=>s(!0),className:`text-xs text-blue-400 hover:text-blue-300 mt-1 cursor-pointer`,children:[`Show all `,i.length,` overrides`]}),t[10]=i.length,t[11]=a,t[12]=h):h=t[12];let g;t[13]!==i.length||t[14]!==a?(g=a&&i.length>3&&(0,u.jsx)(`button`,{onClick:()=>s(!1),className:`text-xs text-blue-400 hover:text-blue-300 mt-1 cursor-pointer`,children:`Show fewer`}),t[13]=i.length,t[14]=a,t[15]=g):g=t[15];let _;t[16]!==m||t[17]!==h||t[18]!==g?(_=(0,u.jsxs)(`div`,{className:`px-4 py-2`,children:[m,h,g]}),t[16]=m,t[17]=h,t[18]=g,t[19]=_):_=t[19];let v;return t[20]!==p||t[21]!==_?(v=(0,u.jsxs)(`div`,{className:`mb-4 rounded-lg border border-gray-800 bg-gray-900/30 overflow-hidden`,children:[p,_]}),t[20]=p,t[21]=_,t[22]=v):v=t[22],v}function ye(e){let[t,n]=e;return(0,u.jsxs)(`div`,{className:`flex items-center gap-2 py-1`,children:[(0,u.jsx)(`span`,{className:`font-mono text-sm text-gray-300`,children:t}),(0,u.jsx)(`span`,{className:`text-gray-600`,children:`→`}),(0,u.jsx)(`span`,{className:`font-mono text-sm text-yellow-500`,children:n})]},t)}function be(e){let t=(0,c.c)(26),{report:n}=e,r,i;t[0]===n?(r=t[1],i=t[2]):(r=ge(n),i=r.filter(Se),t[0]=n,t[1]=r,t[2]=i);let a=i.length,o;t[3]===r?o=t[4]:(o=(0,u.jsx)(_e,{deps:r}),t[3]=r,t[4]=o);let s;t[5]===n.projectInfo.overrides?s=t[6]:(s=n.projectInfo.overrides&&(0,u.jsx)(ve,{overrides:n.projectInfo.overrides}),t[5]=n.projectInfo.overrides,t[6]=s);let l;t[7]===r.length?l=t[8]:(l=(0,u.jsxs)(`h2`,{className:`text-lg font-semibold text-white`,children:[`Dependencies`,(0,u.jsxs)(`span`,{className:`ml-2 text-sm font-normal text-gray-400`,children:[r.length,` total`]})]}),t[7]=r.length,t[8]=l);let d;t[9]===a?d=t[10]:(d=a>0&&(0,u.jsxs)(`div`,{className:`relative group inline-flex`,children:[(0,u.jsxs)(`span`,{className:`text-xs text-yellow-400 flex items-center gap-1 cursor-help`,children:[a,` with issues`,(0,u.jsx)(`span`,{className:`text-gray-500`,children:`ℹ`})]}),(0,u.jsx)(`div`,{className:`absolute bottom-full right-0 mb-2 hidden group-hover:block w-56 z-10`,children:(0,u.jsxs)(`div`,{className:`bg-gray-900 text-gray-200 text-xs rounded-sm px-3 py-2 shadow-lg border border-gray-700`,children:[`Dependencies that are `,(0,u.jsx)(`strong`,{className:`text-yellow-400`,children:`unused`}),`,`,` `,(0,u.jsx)(`strong`,{className:`text-red-400`,children:`missing`}),`, or`,` `,(0,u.jsx)(`strong`,{className:`text-blue-400`,children:`outdated`}),(0,u.jsx)(`div`,{className:`absolute top-full right-4 -mt-1 w-2 h-2 bg-gray-900 border-r border-b border-gray-700 transform rotate-45`})]})})]}),t[9]=a,t[10]=d);let f;t[11]!==l||t[12]!==d?(f=(0,u.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[l,d]}),t[11]=l,t[12]=d,t[13]=f):f=t[13];let p;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,u.jsx)(`thead`,{children:(0,u.jsxs)(`tr`,{className:`border-b border-gray-800 bg-gray-900/50`,children:[(0,u.jsx)(`th`,{className:`text-left px-4 py-2 text-gray-400 font-medium`,children:`Package`}),(0,u.jsx)(`th`,{className:`text-left px-4 py-2 text-gray-400 font-medium`,children:`Version`}),(0,u.jsx)(`th`,{className:`text-left px-4 py-2 text-gray-400 font-medium`,children:`Type`}),(0,u.jsx)(`th`,{className:`text-left px-4 py-2 text-gray-400 font-medium`,children:`Status`})]})}),t[14]=p):p=t[14];let m;t[15]===r?m=t[16]:(m=r.map(xe),t[15]=r,t[16]=m);let h;t[17]===m?h=t[18]:(h=(0,u.jsx)(`div`,{className:`rounded-lg border border-gray-800 overflow-hidden`,children:(0,u.jsxs)(`table`,{className:`w-full text-sm`,children:[p,(0,u.jsx)(`tbody`,{children:m})]})}),t[17]=m,t[18]=h);let g;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,u.jsx)(`a`,{href:`https://github.com/antfu/node-modules-inspector`,target:`_blank`,rel:`noopener noreferrer`,className:`text-blue-400 hover:text-blue-300 hover:underline`,children:`Node Modules Inspector`}),t[19]=g):g=t[19];let _;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,u.jsx)(`div`,{className:`mt-4 px-4 py-3 rounded-lg bg-gray-900/30 border border-gray-800/50`,children:(0,u.jsxs)(`span`,{className:`text-sm text-gray-400`,children:[`For deep dependency inspection, try`,` `,g,` `,`— run`,` `,(0,u.jsx)(`code`,{className:`px-1.5 py-0.5 rounded bg-gray-800 text-green-400 text-xs`,children:`npx node-modules-inspector`})]})}),t[20]=_):_=t[20];let v;return t[21]!==o||t[22]!==s||t[23]!==f||t[24]!==h?(v=(0,u.jsxs)(`div`,{children:[o,s,f,h,_]}),t[21]=o,t[22]=s,t[23]=f,t[24]=h,t[25]=v):v=t[25],v}function xe(e){return(0,u.jsxs)(`tr`,{className:`border-b border-gray-800/50 hover:bg-gray-800/30 transition-colors`,children:[(0,u.jsx)(`td`,{className:`px-4 py-2.5`,children:(0,u.jsx)(`a`,{href:`https://www.npmjs.com/package/${e.name}`,target:`_blank`,rel:`noopener noreferrer`,className:`font-mono text-green-400 hover:text-green-300 hover:underline`,children:e.name})}),(0,u.jsxs)(`td`,{className:`px-4 py-2.5 font-mono text-gray-300`,children:[e.version,e.outdatedTo&&(0,u.jsxs)(`span`,{className:`ml-2 text-gray-500`,children:[`→ `,e.outdatedTo]})]}),(0,u.jsx)(`td`,{className:`px-4 py-2.5`,children:(0,u.jsx)(`span`,{className:`text-xs px-1.5 py-0.5 rounded-sm ${e.dev?`bg-gray-700 text-gray-400`:`bg-gray-800 text-gray-500`}`,children:e.dev?`dev`:`prod`})}),(0,u.jsx)(`td`,{className:`px-4 py-2.5`,children:(0,u.jsx)(Ce,{dep:e})})]},`${e.dev?`dev`:`prod`}-${e.name}`)}function Se(e){return e.unused||e.missing||e.outdatedTo}function Ce(e){let t=(0,c.c)(10),{dep:n}=e,r;if(t[0]!==n.missing||t[1]!==n.unused||t[2]!==n.updateType){let e=[];if(n.missing){let n;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,u.jsx)(`span`,{className:`text-xs px-2 py-0.5 rounded-full bg-red-900/50 text-red-400 border border-red-800`,children:`missing`},`missing`),t[4]=n):n=t[4],e.push(n)}if(n.unused){let n;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,u.jsx)(`span`,{className:`text-xs px-2 py-0.5 rounded-full bg-yellow-900/40 text-yellow-500 border border-yellow-800`,children:`unused`},`unused`),t[5]=n):n=t[5],e.push(n)}if(n.updateType===`major`){let n;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,u.jsx)(`span`,{className:`text-xs px-2 py-0.5 rounded-full bg-orange-900/40 text-orange-400 border border-orange-800`,children:`major update`},`outdated`),t[6]=n):n=t[6],e.push(n)}else if(n.updateType===`minor`){let n;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,u.jsx)(`span`,{className:`text-xs px-2 py-0.5 rounded-full bg-blue-900/30 text-blue-400 border border-blue-800`,children:`minor update`},`outdated`),t[7]=n):n=t[7],e.push(n)}else if(n.updateType===`patch`){let n;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,u.jsx)(`span`,{className:`text-xs px-2 py-0.5 rounded-full bg-gray-800 text-gray-400 border border-gray-700`,children:`patch update`},`outdated`),t[8]=n):n=t[8],e.push(n)}if(e.length===0){let n;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,u.jsx)(`span`,{className:`text-xs text-gray-600`,children:`✓`},`ok`),t[9]=n):n=t[9],e.push(n)}r=(0,u.jsx)(`div`,{className:`flex gap-1.5 flex-wrap`,children:e}),t[0]=n.missing,t[1]=n.unused,t[2]=n.updateType,t[3]=r}else r=t[3];return r}var Y={dependencies:`#60a5fa`,security:`#f87171`,"code-quality":`#a78bfa`,performance:`#fb923c`,git:`#34d399`},X={top:20,right:24,bottom:44,left:44},we=800,Z=300,Q=we-X.left-X.right,Te=Z-X.top-X.bottom;function $(e){return X.top+(1-e/100)*Te}function Ee(e,t){return t===1?X.left+Q/2:X.left+e/(t-1)*Q}function De(e){let t=new Date(e);return`${t.getMonth()+1}/${t.getDate()}`}function Oe(e){return e>=80?`#4ade80`:e>=60?`#facc15`:`#f87171`}function ke(e){let t=(0,c.c)(50),{history:n}=e,{entries:r}=n,i=Array.from(new Set(r.flatMap(Ne))),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=new Set,t[0]=a):a=t[0];let[s,l]=(0,o.useState)(a);if(r.length===0){let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,u.jsxs)(`div`,{className:`flex items-center justify-center h-48 text-gray-500 text-sm font-mono`,children:[`No history yet — run `,(0,u.jsx)(`code`,{className:`mx-1 px-1 bg-card rounded-sm`,children:`sickbay`}),` to start tracking`]}),t[1]=e):e=t[1],e}let d=e=>{l(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},f=r.length,p=Math.max(1,Math.ceil(f/8)),m,h,g,_,v,y,b,x,S,C;if(t[2]!==r||t[3]!==p||t[4]!==f){let e;t[15]!==p||t[16]!==f?(e=e=>{let{i:t}=e;return t%p===0||t===f-1},t[15]=p,t[16]=f,t[17]=e):e=t[17];let n=r.map(Me).filter(e);if(t[18]!==r||t[19]!==f){let e=[0,20,40,60,80,100],n;t[29]===f?n=t[30]:(n=function(e){return e.map((e,t)=>`${Ee(t,f)},${$(e)}`).join(` `)},t[29]=f,t[30]=n),h=n;let i;t[31]!==r||t[32]!==h?(i=h(r.map(je)),t[31]=r,t[32]=h,t[33]=i):i=t[33],m=i,C=`space-y-4`,S=`bg-surface rounded-lg border border-border p-4`,g=`0 0 ${we} ${Z}`,_=`w-full`,v=`Score history chart`,y=`img`,b=e.map(Ae),t[18]=r,t[19]=f,t[20]=m,t[21]=h,t[22]=g,t[23]=_,t[24]=v,t[25]=y,t[26]=b,t[27]=S,t[28]=C}else m=t[20],h=t[21],g=t[22],_=t[23],v=t[24],y=t[25],b=t[26],S=t[27],C=t[28];let i;t[34]===f?i=t[35]:(i=e=>{let{i:t,timestamp:n,label:r}=e;return(0,u.jsx)(`text`,{x:Ee(t,f),y:Z-8,textAnchor:`middle`,fontSize:10,fill:`#6b7280`,children:r},n)},t[34]=f,t[35]=i),x=n.map(i),t[2]=r,t[3]=p,t[4]=f,t[5]=m,t[6]=h,t[7]=g,t[8]=_,t[9]=v,t[10]=y,t[11]=b,t[12]=x,t[13]=S,t[14]=C}else m=t[5],h=t[6],g=t[7],_=t[8],v=t[9],y=t[10],b=t[11],x=t[12],S=t[13],C=t[14];let w=i.map(e=>{if(s.has(e))return null;let t=r.map(t=>t.categoryScores[e]??0);return(0,u.jsx)(`polyline`,{points:h(t),fill:`none`,stroke:Y[e]??`#9ca3af`,strokeWidth:1.5,strokeOpacity:.5},e)}),T;t[36]===m?T=t[37]:(T=(0,u.jsx)(`polyline`,{points:m,fill:`none`,stroke:`#ffffff`,strokeWidth:2.5}),t[36]=m,t[37]=T);let E;if(t[38]!==r||t[39]!==f){let e;t[41]===f?e=t[42]:(e=(e,t)=>(0,u.jsx)(`circle`,{cx:Ee(t,f),cy:$(e.overallScore),r:3,fill:Oe(e.overallScore),stroke:`#0d1117`,strokeWidth:1},e.timestamp),t[41]=f,t[42]=e),E=r.map(e),t[38]=r,t[39]=f,t[40]=E}else E=t[40];let D;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,u.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-mono text-white`,children:[(0,u.jsx)(`span`,{className:`inline-block w-5 h-0.5 bg-white rounded-sm`}),`overall`]}),t[43]=D):D=t[43];let O=i.map(e=>{let t=Y[e]??`#9ca3af`;return(0,u.jsxs)(`button`,{onClick:()=>d(e),className:`flex items-center gap-1.5 text-xs font-mono transition-opacity ${s.has(e)?`opacity-30`:`opacity-80 hover:opacity-100`}`,style:{color:t},children:[(0,u.jsx)(`span`,{className:`inline-block w-5 h-0.5 rounded-sm`,style:{backgroundColor:t}}),e]},e)}),k;t[44]!==D||t[45]!==O?(k=(0,u.jsxs)(`div`,{className:`flex flex-wrap gap-3 px-1`,children:[D,O]}),t[44]=D,t[45]=O,t[46]=k):k=t[46];let A;return t[47]!==i||t[48]!==r?(A=r.length>0&&(()=>{let e=r[r.length-1],t=r.length>1?r[r.length-2]:null,n=t?e.overallScore-t.overallScore:null;return(0,u.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3`,children:[(0,u.jsxs)(`div`,{className:`bg-surface border border-border rounded-lg p-3`,children:[(0,u.jsx)(`div`,{className:`text-xs text-gray-500 mb-1`,children:`current overall`}),(0,u.jsxs)(`div`,{className:`text-2xl font-bold font-mono`,style:{color:Oe(e.overallScore)},children:[e.overallScore,n!==null&&(0,u.jsx)(`span`,{className:`text-sm ml-1.5`,style:{color:n>=0?`#4ade80`:`#f87171`},children:n>=0?`+${n}`:n})]})]}),i.map(t=>{let n=e.categoryScores[t];return n==null?null:(0,u.jsxs)(`div`,{className:`bg-surface border border-border rounded-lg p-3`,children:[(0,u.jsx)(`div`,{className:`text-xs text-gray-500 mb-1`,children:t}),(0,u.jsx)(`div`,{className:`text-2xl font-bold font-mono`,style:{color:Y[t]??Oe(n)},children:n})]},t)})]})})(),t[47]=i,t[48]=r,t[49]=A):A=t[49],(0,u.jsxs)(`div`,{className:C,children:[(0,u.jsx)(`div`,{className:S,children:(0,u.jsxs)(`svg`,{viewBox:g,className:_,"aria-label":v,role:y,children:[b,x,w,T,E]})}),k,A]})}function Ae(e){return(0,u.jsxs)(`g`,{children:[(0,u.jsx)(`line`,{x1:X.left,y1:$(e),x2:X.left+Q,y2:$(e),stroke:e===60||e===80?e===80?`#4ade8033`:`#facc1533`:`#ffffff0d`,strokeWidth:e===60||e===80?1.5:1,strokeDasharray:e===60||e===80?`4 3`:void 0}),(0,u.jsx)(`text`,{x:X.left-8,y:$(e)+4,textAnchor:`end`,fontSize:10,fill:`#6b7280`,children:e})]},e)}function je(e){return e.overallScore}function Me(e,t){return{i:t,timestamp:e.timestamp,label:De(e.timestamp)}}function Ne(e){return Object.keys(e.categoryScores)}function Pe({checkId:e,suppressMatch:t,message:n,file:r}){let i=(t??n??``).replace(/'/g,`\\'`),a=r?.replace(/'/g,`\\'`);return`// sickbay.config.ts → checks.${e}.suppress\n{ match: '${i}',${a?` /* path: '${a}', */`:``} reason: '' }`}function Fe(e){let t=(0,c.c)(28),{checks:n}=e,[r,i]=(0,o.useState)(`all`),[a,s]=(0,o.useState)(!1),l,d,f,p,m,h;if(t[0]!==n||t[1]!==r||t[2]!==a){let e=n.flatMap(Be),o=r===`all`?e:e.filter(e=>e.severity===r),c={critical:e.filter(ze).length,warning:e.filter(Re).length,info:e.filter(Le).length};p=`flex flex-col gap-3`;let g=[`all`,`critical`,`warning`,`info`].map(t=>(0,u.jsx)(`button`,{onClick:()=>i(t),className:`px-3 py-1 rounded text-xs font-mono transition-colors
4
+ `:``)+e)}return r&&t.push(r),t}var v={code:({children:e,...t})=>(0,u.jsx)(`code`,{className:`px-1.5 py-0.5 bg-gray-800/60 text-purple-300 rounded-sm text-xs font-mono border border-gray-700/50`,...t,children:e}),strong:({children:e,...t})=>(0,u.jsx)(`strong`,{className:`font-medium text-gray-100`,...t,children:e}),em:({children:e,...t})=>(0,u.jsx)(`em`,{className:`italic`,...t,children:e}),p:({children:e,...t})=>(0,u.jsx)(`p`,{className:`mb-1 last:mb-0`,...t,children:e})};function y(e){let t=(0,c.c)(5),{title:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={"Health Assessment":`●`,"Critical Issues":`●`,"What's Going Well":`●`,"Next Steps":`●`},t[0]=r):r=t[0];let i=r,a;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(a={"Health Assessment":`text-green-500`,"Critical Issues":`text-red-500`,"What's Going Well":`text-green-400`,"Next Steps":`text-blue-400`},t[1]=a):a=t[1];let o=`text-xs ${a[n]||`text-gray-400`}`,s=i[n]||`●`,l;return t[2]!==o||t[3]!==s?(l=(0,u.jsx)(`span`,{className:o,children:s}),t[2]=o,t[3]=s,t[4]=l):l=t[4],l}function b({report:e,isOpen:t,onToggle:n,packageName:i}){let[a,s]=(0,o.useState)(null),[c,l]=(0,o.useState)(!0),[d,f]=(0,o.useState)(!1),p=i?`/ai/summary?package=${encodeURIComponent(i)}`:`/ai/summary`,m=i?`${e.timestamp}-${i}`:e.timestamp,h=(0,o.useCallback)(async()=>{let e=`sickbay-ai-summary-${m}`,t=localStorage.getItem(e);if(t&&!d){s(t),l(!1);return}try{let e=await fetch(p);if(e.ok){let t=await e.json();s(t.summary),localStorage.setItem(`sickbay-ai-summary-${m}`,t.summary)}else s(null)}catch{s(null)}finally{l(!1),f(!1)}},[p,m,d]);(0,o.useEffect)(()=>{h()},[h]);let g=()=>{f(!0),l(!0),localStorage.removeItem(`sickbay-ai-summary-${m}`),h()},b=a?_(a):[];return(0,u.jsx)(u.Fragment,{children:t&&(0,u.jsxs)(`div`,{className:`fixed top-6 right-6 w-104 max-h-[calc(100vh-3rem)] bg-surface border border-border rounded-lg shadow-2xl flex flex-col z-50 overflow-hidden`,children:[(0,u.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3 bg-linear-to-r from-purple-500/10 to-blue-500/10 border-b border-purple-500/20`,children:[(0,u.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,u.jsx)(`span`,{className:`text-lg`,children:(0,u.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`32`,height:`32`,viewBox:`0 0 24 24`,children:(0,u.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,d:`M9.6 6.112c.322-.816 1.478-.816 1.8 0l.91 2.31a5.8 5.8 0 0 0 3.268 3.268l2.31.91c.816.322.816 1.478 0 1.8l-2.31.91a5.8 5.8 0 0 0-3.268 3.268l-.91 2.31c-.322.816-1.478.816-1.8 0l-.91-2.31a5.8 5.8 0 0 0-3.268-3.268l-2.31-.91c-.816-.322-.816-1.478 0-1.8l2.31-.91A5.8 5.8 0 0 0 8.69 8.422zm8.563-3.382a.363.363 0 0 1 .674 0l.342.866c.221.56.665 1.004 1.225 1.225l.866.342a.363.363 0 0 1 0 .674l-.866.342a2.18 2.18 0 0 0-1.225 1.225l-.342.866a.363.363 0 0 1-.674 0l-.342-.866a2.18 2.18 0 0 0-1.225-1.225l-.867-.342a.363.363 0 0 1 0-.674l.867-.342a2.18 2.18 0 0 0 1.225-1.225z`})})}),(0,u.jsx)(`span`,{className:`font-semibold text-base text-gray-200`,children:`AI Insights`})]}),(0,u.jsxs)(`div`,{className:`flex items-center gap-2`,children:[!c&&a&&(0,u.jsx)(`button`,{onClick:g,disabled:d,className:`text-xl text-gray-500 hover:text-accent transition-colors disabled:opacity-50 px-2 py-1 rounded-sm hover:bg-purple-500/10`,title:`Regenerate insights`,children:d?`⠋`:`↻`}),(0,u.jsx)(`button`,{onClick:()=>n(!1),className:`text-gray-500 hover:text-white transition-colors text-xl w-6 h-6 flex items-center justify-center rounded-sm hover:bg-purple-500/10`,children:`✕`})]})]}),(0,u.jsx)(`div`,{className:`flex-1 overflow-y-auto p-4 space-y-3`,children:c?(0,u.jsxs)(`div`,{className:`flex items-center gap-2 text-base text-gray-500`,children:[(0,u.jsx)(`span`,{className:`animate-pulse`,children:`⠋`}),(0,u.jsx)(`span`,{children:`Generating insights...`})]}):a?b.map((e,t)=>(0,u.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,u.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,u.jsx)(y,{title:e.title}),(0,u.jsx)(`h3`,{className:`text-base font-semibold text-white uppercase tracking-wide`,children:e.title})]}),(0,u.jsx)(`div`,{className:`text-base text-gray-300 leading-snug pl-4`,children:(0,u.jsx)(r,{components:v,children:e.content})}),t<b.length-1&&(0,u.jsx)(`div`,{className:`border-t border-border/50 mt-2`})]},e.title)):(0,u.jsxs)(`div`,{className:`space-y-2`,children:[(0,u.jsx)(`div`,{className:`text-base text-gray-400`,children:`AI insights are not available. This feature requires an Anthropic API key.`}),(0,u.jsxs)(`div`,{className:`text-base text-gray-500 bg-card p-2.5 rounded-sm border border-border font-mono`,children:[(0,u.jsx)(`div`,{className:`mb-1.5 text-gray-400`,children:`To enable AI features:`}),(0,u.jsx)(`div`,{children:`export ANTHROPIC_API_KEY=sk-ant-...`}),(0,u.jsx)(`div`,{children:`sickbay --path ~/project --web`})]})]})})]})})}var x={recommend:`bg-amber-500/20 text-amber-300 border-amber-500/30`,suggest:`bg-gray-500/20 text-gray-400 border-gray-500/30`};function S(e){let t={};for(let n of e){let e=n.framework;t[e]||(t[e]=[]),t[e].push(n)}return t}function C(e){let t=(0,c.c)(23),{recommendations:n,isOpen:r,onToggle:i}=e;if(!r)return null;let a,o,s,l;if(t[0]!==i||t[1]!==n){let e=S([...n].sort(E));s=`fixed top-6 right-6 w-104 max-h-[calc(100vh-3rem)] bg-surface border border-border rounded-lg shadow-2xl flex flex-col z-50 overflow-hidden`;let r,c;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,u.jsx)(`span`,{className:`text-lg`,children:`💡`}),c=(0,u.jsx)(`span`,{className:`font-semibold text-base text-gray-200`,children:`Advisor`}),t[6]=r,t[7]=c):(r=t[6],c=t[7]);let d=n.length===1?``:`s`,f;t[8]!==n.length||t[9]!==d?(f=(0,u.jsxs)(`div`,{className:`flex items-center gap-2`,children:[r,c,(0,u.jsxs)(`span`,{className:`text-xs text-gray-500`,children:[n.length,` recommendation`,d]})]}),t[8]=n.length,t[9]=d,t[10]=f):f=t[10];let p;t[11]===i?p=t[12]:(p=(0,u.jsx)(`button`,{onClick:()=>i(!1),className:`text-gray-500 hover:text-white transition-colors text-xl w-6 h-6 flex items-center justify-center rounded-sm hover:bg-teal-500/10`,children:`✕`}),t[11]=i,t[12]=p),t[13]!==f||t[14]!==p?(l=(0,u.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3 bg-linear-to-r from-teal-500/10 to-emerald-500/10 border-b border-teal-500/20`,children:[f,p]}),t[13]=f,t[14]=p,t[15]=l):l=t[15],a=`flex-1 overflow-y-auto p-4 space-y-4`,o=Object.entries(e).map(w),t[0]=i,t[1]=n,t[2]=a,t[3]=o,t[4]=s,t[5]=l}else a=t[2],o=t[3],s=t[4],l=t[5];let d;t[16]!==a||t[17]!==o?(d=(0,u.jsx)(`div`,{className:a,children:o}),t[16]=a,t[17]=o,t[18]=d):d=t[18];let f;return t[19]!==s||t[20]!==l||t[21]!==d?(f=(0,u.jsxs)(`div`,{className:s,children:[l,d]}),t[19]=s,t[20]=l,t[21]=d,t[22]=f):f=t[22],f}function w(e){let[t,n]=e;return(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`div`,{className:`text-xs text-gray-500 uppercase tracking-wide mb-2`,children:t}),(0,u.jsx)(`div`,{className:`space-y-3`,children:n.map(T)})]},t)}function T(e){return(0,u.jsxs)(`div`,{className:`space-y-1`,children:[(0,u.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,u.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded border ${x[e.severity]}`,children:e.severity}),(0,u.jsx)(`span`,{className:`font-medium text-sm text-white`,children:e.title})]}),(0,u.jsx)(`p`,{className:`text-sm text-gray-400 leading-snug pl-0.5`,children:e.message}),e.learnMoreUrl&&(0,u.jsx)(`a`,{href:e.learnMoreUrl,target:`_blank`,rel:`noopener noreferrer`,className:`text-xs text-teal-400 hover:text-teal-300 transition-colors pl-0.5`,children:`Learn more →`})]},e.id)}function E(e,t){let n={recommend:0,suggest:1};return n[e.severity]-n[t.severity]}var D=`modulepreload`,O=function(e){return`/`+e},k={},A=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=O(t,n),t in k)return;k[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:D,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},j=(0,o.lazy)(()=>A(()=>import(`./DependencyGraph-DS5sXNvY.js`).then(e=>({default:e.DependencyGraph})),__vite__mapDeps([0,1,2,3,4,5])));function M(e,t){return e.checks.find(e=>e.id===t)?.metadata??{}}function N(e){let t=(0,c.c)(10),{label:n,value:r,sub:i}=e,a;t[0]===n?a=t[1]:(a=(0,u.jsx)(`div`,{className:`text-xs text-gray-500 mb-1`,children:n}),t[0]=n,t[1]=a);let o;t[2]===r?o=t[3]:(o=(0,u.jsx)(`div`,{className:`text-2xl font-mono font-bold`,children:r}),t[2]=r,t[3]=o);let s;t[4]===i?s=t[5]:(s=i&&(0,u.jsx)(`div`,{className:`text-xs text-gray-500 mt-1`,children:i}),t[4]=i,t[5]=s);let l;return t[6]!==a||t[7]!==o||t[8]!==s?(l=(0,u.jsxs)(`div`,{className:`bg-card rounded-lg p-4`,children:[a,o,s]}),t[6]=a,t[7]=o,t[8]=s,t[9]=l):l=t[9],l}function P(e){let t=(0,c.c)(10),{label:n,extra:r,collapsed:i,onToggle:a}=e,o=`text-gray-500 group-hover:text-gray-300 transition-transform shrink-0 ${i?`-rotate-90`:``}`,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,u.jsx)(`polyline`,{points:`6 9 12 15 18 9`}),t[0]=s):s=t[0];let l;t[1]===o?l=t[2]:(l=(0,u.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2.5,strokeLinecap:`round`,strokeLinejoin:`round`,className:o,children:s}),t[1]=o,t[2]=l);let d;t[3]===n?d=t[4]:(d=(0,u.jsx)(`h2`,{className:`text-sm font-semibold text-gray-400 uppercase tracking-wider group-hover:text-gray-200 transition-colors`,children:n}),t[3]=n,t[4]=d);let f;return t[5]!==r||t[6]!==a||t[7]!==l||t[8]!==d?(f=(0,u.jsxs)(`button`,{onClick:a,className:`flex items-center gap-2 w-full text-left group mb-3`,children:[l,d,r]}),t[5]=r,t[6]=a,t[7]=l,t[8]=d,t[9]=f):f=t[9],f}function F(e){let t=(0,c.c)(17),{label:n,pct:r}=e,i=r>=80?`bg-green-400`:r>=60?`bg-yellow-400`:`bg-red-400`,a;t[0]===n?a=t[1]:(a=(0,u.jsx)(`span`,{className:`text-gray-400`,children:n}),t[0]=n,t[1]=a);let o;t[2]===r?o=t[3]:(o=r.toFixed(1),t[2]=r,t[3]=o);let s;t[4]===o?s=t[5]:(s=(0,u.jsxs)(`span`,{className:`font-mono font-semibold`,children:[o,`%`]}),t[4]=o,t[5]=s);let l;t[6]!==a||t[7]!==s?(l=(0,u.jsxs)(`div`,{className:`flex justify-between text-xs mb-1`,children:[a,s]}),t[6]=a,t[7]=s,t[8]=l):l=t[8];let d=`h-2 rounded-full transition-all ${i}`,f=`${Math.min(r,100)}%`,p;t[9]===f?p=t[10]:(p={width:f},t[9]=f,t[10]=p);let m;t[11]!==d||t[12]!==p?(m=(0,u.jsx)(`div`,{className:`bg-surface rounded-full h-2`,children:(0,u.jsx)(`div`,{className:d,style:p})}),t[11]=d,t[12]=p,t[13]=m):m=t[13];let h;return t[14]!==l||t[15]!==m?(h=(0,u.jsxs)(`div`,{children:[l,m]}),t[14]=l,t[15]=m,t[16]=h):h=t[16],h}function ee(e){let t=(0,c.c)(46),{report:n}=e,[r,i]=(0,o.useState)(!1),[a,s]=(0,o.useState)(!1),[l,d]=(0,o.useState)(!1),[f,p]=(0,o.useState)(!1),m,h,g,_,v,y,b,x,S,C;if(t[0]!==r||t[1]!==a||t[2]!==n){let e=M(n,`complexity`),o=M(n,`git`),c;t[13]===n?c=t[14]:(c=M(n,`coverage`),t[13]=n,t[14]=c),m=c;let l=e.topFiles??[],d=l[0]?.lines??1,f;t[15]===n?f=t[16]:(f=M(n,`madge`),t[15]=n,t[16]=f),b=f,h=b.graph;let p;t[17]===h?p=t[18]:(p=h&&Object.keys(h).length>0,t[17]=h,t[18]=p),y=p,g=e.totalFiles!=null,v=o.commitCount!=null,_=m.lines!=null,x=`space-y-8`,S=g&&(0,u.jsxs)(`section`,{children:[(0,u.jsx)(P,{label:`Codebase`,collapsed:r,onToggle:()=>i(R)}),!r&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-3 mb-6`,children:[(0,u.jsx)(N,{label:`total files`,value:e.totalFiles}),(0,u.jsx)(N,{label:`total lines`,value:e.totalLines.toLocaleString()}),(0,u.jsx)(N,{label:`avg file size`,value:`${e.avgLines} loc`}),(0,u.jsx)(N,{label:`oversized files`,value:e.oversizedCount,sub:`over threshold`})]}),l.length>0&&(0,u.jsxs)(`div`,{className:`bg-card rounded-lg p-4`,children:[(0,u.jsx)(`div`,{className:`text-xs text-gray-500 mb-3`,children:`largest files`}),(0,u.jsx)(`div`,{className:`space-y-2`,children:l.slice(0,10).map(e=>{let t=e.warn??400,n=e.critical??600,r=e.lines>=n?`bg-red-400`:e.lines>=t?`bg-yellow-400`:`bg-green-400`;return(0,u.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,u.jsx)(`div`,{className:`w-72 text-xs font-mono text-gray-400 truncate shrink-0`,title:e.path,children:e.path.split(`/`).slice(-2).join(`/`)}),(0,u.jsx)(`div`,{className:`flex-1 bg-surface rounded-full h-4 overflow-hidden`,children:(0,u.jsx)(`div`,{className:`h-4 rounded-full flex items-center justify-end pr-2 text-xs font-mono text-black font-semibold ${r}`,style:{width:`${Math.max(8,e.lines/d*100)}%`},children:e.lines})})]},e.path)})})]})]})]}),C=v&&(0,u.jsxs)(`section`,{children:[(0,u.jsx)(P,{label:`Git Activity`,collapsed:a,onToggle:()=>s(L)}),!a&&(0,u.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-3`,children:[(0,u.jsx)(N,{label:`total commits`,value:o.commitCount.toLocaleString()}),(0,u.jsx)(N,{label:`contributors`,value:o.contributorCount}),(0,u.jsx)(N,{label:`remote branches`,value:o.remoteBranches}),(0,u.jsx)(N,{label:`last commit`,value:o.lastCommit})]})]}),t[0]=r,t[1]=a,t[2]=n,t[3]=m,t[4]=h,t[5]=g,t[6]=_,t[7]=v,t[8]=y,t[9]=b,t[10]=x,t[11]=S,t[12]=C}else m=t[3],h=t[4],g=t[5],_=t[6],v=t[7],y=t[8],b=t[9],x=t[10],S=t[11],C=t[12];let w;t[19]!==m.branches||t[20]!==m.failed||t[21]!==m.functions||t[22]!==m.lines||t[23]!==m.passed||t[24]!==m.statements||t[25]!==m.totalTests||t[26]!==l||t[27]!==_?(w=_&&(0,u.jsxs)(`section`,{children:[(0,u.jsx)(P,{label:`Test Coverage`,collapsed:l,onToggle:()=>d(te)}),!l&&(0,u.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-6`,children:[(0,u.jsxs)(`div`,{className:`bg-card rounded-lg p-4 space-y-3`,children:[(0,u.jsx)(F,{label:`Lines`,pct:m.lines}),(0,u.jsx)(F,{label:`Statements`,pct:m.statements}),(0,u.jsx)(F,{label:`Functions`,pct:m.functions}),(0,u.jsx)(F,{label:`Branches`,pct:m.branches})]}),m.totalTests!=null&&(0,u.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,u.jsx)(N,{label:`total tests`,value:m.totalTests}),(0,u.jsx)(N,{label:`passing`,value:m.passed,sub:`${m.failed} failing`})]})]})]}),t[19]=m.branches,t[20]=m.failed,t[21]=m.functions,t[22]=m.lines,t[23]=m.passed,t[24]=m.statements,t[25]=m.totalTests,t[26]=l,t[27]=_,t[28]=w):w=t[28];let T;t[29]!==h||t[30]!==f||t[31]!==y||t[32]!==b.circularCount?(T=y&&(0,u.jsxs)(`section`,{children:[(0,u.jsx)(P,{label:`Module Graph`,extra:(0,u.jsxs)(`span`,{className:`text-xs font-normal text-gray-500`,children:[Object.keys(h).length,` modules`,b.circularCount>0&&(0,u.jsxs)(`span`,{className:`text-red-400 ml-1`,children:[`· `,b.circularCount,` circular`]})]}),collapsed:f,onToggle:()=>p(I)}),!f&&(0,u.jsx)(o.Suspense,{fallback:(0,u.jsx)(`div`,{className:`text-gray-500 text-sm`,children:`Loading graph...`}),children:(0,u.jsx)(j,{graph:h,circularCount:b.circularCount})})]}),t[29]=h,t[30]=f,t[31]=y,t[32]=b.circularCount,t[33]=T):T=t[33];let E;t[34]!==g||t[35]!==_||t[36]!==v||t[37]!==y?(E=!g&&!v&&!_&&!y&&(0,u.jsx)(`div`,{className:`text-gray-500 text-sm`,children:`No codebase stats available yet.`}),t[34]=g,t[35]=_,t[36]=v,t[37]=y,t[38]=E):E=t[38];let D;return t[39]!==x||t[40]!==S||t[41]!==C||t[42]!==w||t[43]!==T||t[44]!==E?(D=(0,u.jsxs)(`div`,{className:x,children:[S,C,w,T,E]}),t[39]=x,t[40]=S,t[41]=C,t[42]=w,t[43]=T,t[44]=E,t[45]=D):D=t[45],D}function I(e){return!e}function te(e){return!e}function L(e){return!e}function R(e){return!e}function z(e){let t=(0,c.c)(4),{label:n,color:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={red:`bg-red-500/20 text-red-300`,blue:`bg-blue-500/20 text-blue-300`,yellow:`bg-yellow-500/20 text-yellow-300`,purple:`bg-purple-500/20 text-purple-300`},t[0]=i):i=t[0];let a=`px-1.5 py-0.5 rounded text-xs font-mono ${i[r]??`bg-gray-500/20 text-gray-300`}`,o;return t[1]!==n||t[2]!==a?(o=(0,u.jsx)(`span`,{className:a,children:n}),t[1]=n,t[2]=a,t[3]=o):o=t[3],o}function B(e){let t=(0,c.c)(9),{label:n,collapsed:r,onToggle:i}=e,a=`text-gray-500 group-hover:text-gray-300 transition-transform shrink-0 ${r?`-rotate-90`:``}`,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,u.jsx)(`polyline`,{points:`6 9 12 15 18 9`}),t[0]=o):o=t[0];let s;t[1]===a?s=t[2]:(s=(0,u.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2.5,strokeLinecap:`round`,strokeLinejoin:`round`,className:a,children:o}),t[1]=a,t[2]=s);let l;t[3]===n?l=t[4]:(l=(0,u.jsx)(`h2`,{className:`text-sm font-semibold text-gray-400 uppercase tracking-wider group-hover:text-gray-200 transition-colors`,children:n}),t[3]=n,t[4]=l);let d;return t[5]!==i||t[6]!==s||t[7]!==l?(d=(0,u.jsxs)(`button`,{onClick:i,className:`flex items-center gap-2 w-full text-left group mb-3`,children:[s,l]}),t[5]=i,t[6]=s,t[7]=l,t[8]=d):d=t[8],d}function V(e){return typeof e==`object`}function H(e){return!!(e===!1||V(e)&&e.enabled===!1)}function U(e){return typeof e==`number`?String(e):Array.isArray(e)?e.join(`, `):typeof e==`object`&&e?Object.entries(e).map(([e,t])=>`${e}: ${t}`).join(`, `):String(e)}function ne(e){let t=(0,c.c)(36),{report:n}=e,[r,i]=(0,o.useState)(null),[a,s]=(0,o.useState)(!0),[l,d]=(0,o.useState)(!1),[f,p]=(0,o.useState)(!1),[m,h]=(0,o.useState)(!1),g;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{fetch(`/sickbay-config.json`).then(le).then(e=>{e&&i(e)}).catch(ce).finally(()=>s(!1))},t[0]=g):g=t[0];let _=g,v,y;if(t[1]===Symbol.for(`react.memo_cache_sentinel`)?(v=()=>{_()},y=[_],t[1]=v,t[2]=y):(v=t[1],y=t[2]),(0,o.useEffect)(v,y),!n.config?.hasCustomConfig){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,u.jsx)(`div`,{className:`flex items-center justify-center h-48 text-gray-500 text-sm font-mono`,children:`No custom configuration — Sickbay is running with all defaults`}),t[3]=e):e=t[3],e}if(a){let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,u.jsx)(`div`,{className:`flex items-center justify-center h-48 text-gray-500 text-sm font-mono`,children:`Loading configuration...`}),t[4]=e):e=t[4],e}let b=n.config.disabledChecks.length,x=n.config.overriddenChecks.length,S,C;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,u.jsx)(`div`,{className:`text-green-400 text-lg`,children:`⚙`}),C=(0,u.jsx)(`div`,{className:`text-sm font-semibold`,children:`Custom configuration active`}),t[5]=S,t[6]=C):(S=t[5],C=t[6]);let w;t[7]===b?w=t[8]:(w=b>0&&(0,u.jsxs)(`span`,{className:`text-red-400`,children:[b,` disabled`]}),t[7]=b,t[8]=w);let T;t[9]!==b||t[10]!==x?(T=b>0&&x>0&&(0,u.jsx)(`span`,{children:` · `}),t[9]=b,t[10]=x,t[11]=T):T=t[11];let E;t[12]===x?E=t[13]:(E=x>0&&(0,u.jsxs)(`span`,{className:`text-blue-400`,children:[x,` overridden`]}),t[12]=x,t[13]=E);let D;t[14]!==b||t[15]!==x?(D=b===0&&x===0&&(0,u.jsx)(`span`,{children:`Weight or exclude overrides active`}),t[14]=b,t[15]=x,t[16]=D):D=t[16];let O;t[17]!==w||t[18]!==T||t[19]!==E||t[20]!==D?(O=(0,u.jsx)(`div`,{className:`bg-card rounded-lg p-4 border border-border`,children:(0,u.jsxs)(`div`,{className:`flex items-center gap-3`,children:[S,(0,u.jsxs)(`div`,{children:[C,(0,u.jsxs)(`div`,{className:`text-xs text-gray-500 mt-0.5`,children:[w,T,E,D]})]})]})}),t[17]=w,t[18]=T,t[19]=E,t[20]=D,t[21]=O):O=t[21];let k;t[22]!==l||t[23]!==r?(k=r?.checks&&Object.keys(r.checks).length>0&&(0,u.jsxs)(`section`,{children:[(0,u.jsx)(B,{label:`Checks`,collapsed:l,onToggle:()=>d(se)}),!l&&(0,u.jsx)(`div`,{className:`bg-card rounded-lg divide-y divide-border`,children:Object.entries(r.checks).map(re)})]}),t[22]=l,t[23]=r,t[24]=k):k=t[24];let A;t[25]!==r||t[26]!==f?(A=r?.weights&&Object.keys(r.weights).length>0&&(0,u.jsxs)(`section`,{children:[(0,u.jsx)(B,{label:`Scoring Weights`,collapsed:f,onToggle:()=>p(q)}),!f&&(0,u.jsx)(`div`,{className:`bg-card rounded-lg p-4`,children:(0,u.jsx)(`div`,{className:`space-y-2`,children:Object.entries(r.weights).map(K)})})]}),t[25]=r,t[26]=f,t[27]=A):A=t[27];let j;t[28]!==r||t[29]!==m?(j=r?.exclude&&r.exclude.length>0&&(0,u.jsxs)(`section`,{children:[(0,u.jsx)(B,{label:`Global Excludes`,collapsed:m,onToggle:()=>h(G)}),!m&&(0,u.jsx)(`div`,{className:`bg-card rounded-lg p-4`,children:(0,u.jsx)(`div`,{className:`space-y-1`,children:r.exclude.map(W)})})]}),t[28]=r,t[29]=m,t[30]=j):j=t[30];let M;return t[31]!==O||t[32]!==k||t[33]!==A||t[34]!==j?(M=(0,u.jsxs)(`div`,{className:`space-y-8`,children:[O,k,A,j]}),t[31]=O,t[32]=k,t[33]=A,t[34]=j,t[35]=M):M=t[35],M}function W(e){return(0,u.jsx)(`div`,{className:`text-sm font-mono text-gray-400`,children:e},e)}function G(e){return!e}function K(e){let[t,n]=e,r=l[t]??0;return(0,u.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,u.jsx)(`span`,{className:`font-mono text-sm text-gray-300`,children:t}),(0,u.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-mono`,children:[(0,u.jsx)(`span`,{className:`text-gray-500`,children:r}),(0,u.jsx)(`span`,{className:`text-gray-600`,children:`→`}),(0,u.jsx)(`span`,{className:n>r?`text-green-400`:n<r?`text-red-400`:`text-gray-300`,children:n})]})]},t)}function q(e){return!e}function re(e){let[t,n]=e,r=H(n),i=V(n)?n:null,a=i?.thresholds&&Object.keys(i.thresholds).length>0,o=i?.suppress&&i.suppress.length>0,s=i?.exclude&&i.exclude.length>0;return(0,u.jsxs)(`div`,{className:`px-4 py-3 ${r?`opacity-50`:``}`,children:[(0,u.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,u.jsx)(`span`,{className:`font-mono text-sm`,children:t}),(0,u.jsxs)(`div`,{className:`flex gap-1.5`,children:[r&&(0,u.jsx)(z,{label:`disabled`,color:`red`}),a&&(0,u.jsx)(z,{label:`thresholds`,color:`blue`}),o&&(0,u.jsx)(z,{label:`${i.suppress.length} suppressed`,color:`yellow`}),s&&(0,u.jsx)(z,{label:`exclude`,color:`purple`})]})]}),a&&(0,u.jsx)(`div`,{className:`mt-2 pl-2 border-l-2 border-blue-500/30`,children:Object.entries(i.thresholds).map(oe)}),o&&(0,u.jsx)(`div`,{className:`mt-2 pl-2 border-l-2 border-yellow-500/30 space-y-1`,children:i.suppress.map(ae)}),s&&(0,u.jsx)(`div`,{className:`mt-2 pl-2 border-l-2 border-purple-500/30`,children:i.exclude.map(ie)})]},t)}function ie(e){return(0,u.jsx)(`div`,{className:`text-xs text-gray-400 font-mono`,children:e},e)}function ae(e,t){return(0,u.jsxs)(`div`,{className:`text-xs`,children:[(0,u.jsxs)(`div`,{className:`text-gray-400 font-mono`,children:[e.path&&(0,u.jsxs)(`span`,{children:[`path: `,e.path]}),e.path&&e.match&&(0,u.jsx)(`span`,{children:` · `}),e.match&&(0,u.jsxs)(`span`,{children:[`match: `,e.match]})]}),(0,u.jsx)(`div`,{className:`text-gray-500 italic`,children:e.reason})]},`${e.path??``}-${e.match??``}-${t}`)}function oe(e){let[t,n]=e;return(0,u.jsxs)(`div`,{className:`text-xs text-gray-400 font-mono`,children:[(0,u.jsxs)(`span`,{className:`text-gray-500`,children:[t,`:`]}),` `,U(n)]},t)}function se(e){return!e}function ce(){}function le(e){return e.ok?e.json():null}function ue(e){let t=(0,c.c)(14),{report:n,onCheckClick:r}=e,[i,a]=(0,o.useState)(ge),s,l;t[0]===i?(s=t[1],l=t[2]):(s=()=>{localStorage.setItem(`sickbay-critical-issues-collapsed`,String(i))},l=[i],t[0]=i,t[1]=s,t[2]=l),(0,o.useEffect)(s,l);let d=n.checks,f,p;if(t[3]!==i||t[4]!==r||t[5]!==n.checks){p=Symbol.for(`react.early_return_sentinel`);bb0:{let e=d.map(me).filter(pe);if(e.length===0){p=null;break bb0}let n=e.reduce(fe,0),o;t[8]===i?o=t[9]:(o=()=>a(!i),t[8]=i,t[9]=o);let s,c;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,u.jsx)(`span`,{className:`text-lg`,children:`❗`}),c=(0,u.jsx)(`h2`,{className:`text-lg font-semibold text-red-400`,children:`Critical Issues`}),t[10]=s,t[11]=c):(s=t[10],c=t[11]);let l=`ml-auto text-gray-500 transition-transform ${i?``:`rotate-180`}`,m;t[12]===l?m=t[13]:(m=(0,u.jsx)(`span`,{className:l,children:`▼`}),t[12]=l,t[13]=m),f=(0,u.jsxs)(`div`,{className:`bg-red-900/10 border border-red-800/30 rounded-lg p-4 mb-6`,children:[(0,u.jsxs)(`button`,{onClick:o,className:`w-full flex items-center gap-2 hover:opacity-80 transition-opacity`,children:[s,c,(0,u.jsxs)(`span`,{className:`text-sm text-gray-400`,children:[`(`,n,` total)`]}),m]}),!i&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`div`,{className:`space-y-3`,children:e.map(e=>(0,u.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,u.jsxs)(`button`,{onClick:()=>r(e.id),className:`text-accent hover:underline text-sm font-semibold flex items-center gap-2`,children:[e.name,(0,u.jsxs)(`span`,{className:`text-xs text-gray-500`,children:[`(`,e.criticalIssues.length,` critical)`]})]}),(0,u.jsxs)(`ul`,{className:`space-y-1 ml-4`,children:[e.criticalIssues.slice(0,3).map(de),e.criticalIssues.length>3&&(0,u.jsxs)(`li`,{className:`text-xs text-gray-500`,children:[`+`,e.criticalIssues.length-3,` more critical issues`]})]})]},e.id))}),(0,u.jsx)(`div`,{className:`mt-3 pt-3 border-t border-red-800/30 text-xs text-gray-500`,children:`Click on a check name to view all issues in detail`})]})]})}t[3]=i,t[4]=r,t[5]=n.checks,t[6]=f,t[7]=p}else f=t[6],p=t[7];return p===Symbol.for(`react.early_return_sentinel`)?f:p}function de(e){return(0,u.jsxs)(`li`,{className:`text-sm text-gray-300`,children:[(0,u.jsx)(`span`,{className:`text-red-400 mr-2`,children:`•`}),e.message]},e.message)}function fe(e,t){return e+t.criticalIssues.length}function pe(e){return e.criticalIssues.length>0}function me(e){return{...e,criticalIssues:e.issues.filter(he)}}function he(e){return e.severity===`critical`}function ge(){return localStorage.getItem(`sickbay-critical-issues-collapsed`)!==`false`}function _e(e){let{dependencies:t,devDependencies:n}=e.projectInfo,r=new Set,i=new Set,a=new Map;for(let t of e.checks)for(let e of t.issues){let t=e.message,n=t.match(/^Unused (?:dev)?dependency:\s+(.+)/i);n&&r.add(n[1].trim());let o=t.match(/^Missing dependency:\s+(.+)/i);o&&i.add(o[1].trim());let s=t.match(/^([^:]+):\s*([^\s]+)\s*→\s*([^\s]+?)(?:\s*\((major|minor|patch)\))?$/);if(s){let[,t,,n,r]=s,i=r??(e.severity===`warning`?`major`:`minor`);a.set(t.trim(),{to:n.trim(),updateType:i})}}let o=[];for(let[e,n]of Object.entries(t)){let t=a.get(e);o.push({name:e,version:n,dev:!1,unused:r.has(e),missing:i.has(e),outdatedTo:t?.to,updateType:t?.updateType})}for(let[e,t]of Object.entries(n)){let n=a.get(e);o.push({name:e,version:t,dev:!0,unused:r.has(e),missing:i.has(e),outdatedTo:n?.to,updateType:n?.updateType})}return o.sort((e,t)=>{let n=(e.missing?3:0)+(e.unused?2:0)+(e.outdatedTo?1:0),r=(t.missing?3:0)+(t.unused?2:0)+(t.outdatedTo?1:0);return r===n?e.name.localeCompare(t.name):r-n})}function ve(e){let t=(0,c.c)(14),{deps:n}=e,r;if(t[0]!==n){r={major:0,minor:0,patch:0};for(let e of n)e.updateType&&(r[e.updateType]=r[e.updateType]+1);t[0]=n,t[1]=r}else r=t[1];if(r.major+r.minor+r.patch===0){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,u.jsx)(`div`,{className:`mb-4 px-4 py-3 rounded-lg bg-green-900/20 border border-green-800/50`,children:(0,u.jsx)(`span`,{className:`text-sm text-green-400`,children:`All dependencies up to date`})}),t[2]=e):e=t[2],e}let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,u.jsx)(`span`,{className:`text-sm text-gray-400`,children:`Updates available:`}),t[3]=i):i=t[3];let a;t[4]===r.major?a=t[5]:(a=r.major>0&&(0,u.jsxs)(`span`,{className:`text-xs px-2.5 py-1 rounded-full bg-orange-900/40 text-orange-400 border border-orange-800 font-medium`,children:[r.major,` major`]}),t[4]=r.major,t[5]=a);let o;t[6]===r.minor?o=t[7]:(o=r.minor>0&&(0,u.jsxs)(`span`,{className:`text-xs px-2.5 py-1 rounded-full bg-blue-900/30 text-blue-400 border border-blue-800 font-medium`,children:[r.minor,` minor`]}),t[6]=r.minor,t[7]=o);let s;t[8]===r.patch?s=t[9]:(s=r.patch>0&&(0,u.jsxs)(`span`,{className:`text-xs px-2.5 py-1 rounded-full bg-gray-800 text-gray-400 border border-gray-700 font-medium`,children:[r.patch,` patch`]}),t[8]=r.patch,t[9]=s);let l;return t[10]!==a||t[11]!==o||t[12]!==s?(l=(0,u.jsxs)(`div`,{className:`mb-4 flex items-center gap-3 px-4 py-3 rounded-lg bg-gray-900/50 border border-gray-800`,children:[i,a,o,s]}),t[10]=a,t[11]=o,t[12]=s,t[13]=l):l=t[13],l}function ye(e){let t=(0,c.c)(23),{overrides:n}=e,r;t[0]===n?r=t[1]:(r=Object.entries(n),t[0]=n,t[1]=r);let i=r,[a,s]=(0,o.useState)(i.length<=3);if(i.length===0)return null;let l;t[2]!==i||t[3]!==a?(l=a?i:i.slice(0,3),t[2]=i,t[3]=a,t[4]=l):l=t[4];let d=l,f;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,u.jsx)(`span`,{className:`text-sm font-medium text-gray-300`,children:`Package Overrides`}),t[5]=f):f=t[5];let p;t[6]===i.length?p=t[7]:(p=(0,u.jsxs)(`div`,{className:`px-4 py-2.5 flex items-center gap-2 border-b border-gray-800/50`,children:[f,(0,u.jsx)(`span`,{className:`text-xs px-1.5 py-0.5 rounded-sm bg-gray-700 text-gray-400`,children:i.length})]}),t[6]=i.length,t[7]=p);let m;t[8]===d?m=t[9]:(m=d.map(be),t[8]=d,t[9]=m);let h;t[10]!==i.length||t[11]!==a?(h=!a&&i.length>3&&(0,u.jsxs)(`button`,{onClick:()=>s(!0),className:`text-xs text-blue-400 hover:text-blue-300 mt-1 cursor-pointer`,children:[`Show all `,i.length,` overrides`]}),t[10]=i.length,t[11]=a,t[12]=h):h=t[12];let g;t[13]!==i.length||t[14]!==a?(g=a&&i.length>3&&(0,u.jsx)(`button`,{onClick:()=>s(!1),className:`text-xs text-blue-400 hover:text-blue-300 mt-1 cursor-pointer`,children:`Show fewer`}),t[13]=i.length,t[14]=a,t[15]=g):g=t[15];let _;t[16]!==m||t[17]!==h||t[18]!==g?(_=(0,u.jsxs)(`div`,{className:`px-4 py-2`,children:[m,h,g]}),t[16]=m,t[17]=h,t[18]=g,t[19]=_):_=t[19];let v;return t[20]!==p||t[21]!==_?(v=(0,u.jsxs)(`div`,{className:`mb-4 rounded-lg border border-gray-800 bg-gray-900/30 overflow-hidden`,children:[p,_]}),t[20]=p,t[21]=_,t[22]=v):v=t[22],v}function be(e){let[t,n]=e;return(0,u.jsxs)(`div`,{className:`flex items-center gap-2 py-1`,children:[(0,u.jsx)(`span`,{className:`font-mono text-sm text-gray-300`,children:t}),(0,u.jsx)(`span`,{className:`text-gray-600`,children:`→`}),(0,u.jsx)(`span`,{className:`font-mono text-sm text-yellow-500`,children:n})]},t)}function xe(e){let t=(0,c.c)(26),{report:n}=e,r,i;t[0]===n?(r=t[1],i=t[2]):(r=_e(n),i=r.filter(Ce),t[0]=n,t[1]=r,t[2]=i);let a=i.length,o;t[3]===r?o=t[4]:(o=(0,u.jsx)(ve,{deps:r}),t[3]=r,t[4]=o);let s;t[5]===n.projectInfo.overrides?s=t[6]:(s=n.projectInfo.overrides&&(0,u.jsx)(ye,{overrides:n.projectInfo.overrides}),t[5]=n.projectInfo.overrides,t[6]=s);let l;t[7]===r.length?l=t[8]:(l=(0,u.jsxs)(`h2`,{className:`text-lg font-semibold text-white`,children:[`Dependencies`,(0,u.jsxs)(`span`,{className:`ml-2 text-sm font-normal text-gray-400`,children:[r.length,` total`]})]}),t[7]=r.length,t[8]=l);let d;t[9]===a?d=t[10]:(d=a>0&&(0,u.jsxs)(`div`,{className:`relative group inline-flex`,children:[(0,u.jsxs)(`span`,{className:`text-xs text-yellow-400 flex items-center gap-1 cursor-help`,children:[a,` with issues`,(0,u.jsx)(`span`,{className:`text-gray-500`,children:`ℹ`})]}),(0,u.jsx)(`div`,{className:`absolute bottom-full right-0 mb-2 hidden group-hover:block w-56 z-10`,children:(0,u.jsxs)(`div`,{className:`bg-gray-900 text-gray-200 text-xs rounded-sm px-3 py-2 shadow-lg border border-gray-700`,children:[`Dependencies that are `,(0,u.jsx)(`strong`,{className:`text-yellow-400`,children:`unused`}),`,`,` `,(0,u.jsx)(`strong`,{className:`text-red-400`,children:`missing`}),`, or`,` `,(0,u.jsx)(`strong`,{className:`text-blue-400`,children:`outdated`}),(0,u.jsx)(`div`,{className:`absolute top-full right-4 -mt-1 w-2 h-2 bg-gray-900 border-r border-b border-gray-700 transform rotate-45`})]})})]}),t[9]=a,t[10]=d);let f;t[11]!==l||t[12]!==d?(f=(0,u.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[l,d]}),t[11]=l,t[12]=d,t[13]=f):f=t[13];let p;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,u.jsx)(`thead`,{children:(0,u.jsxs)(`tr`,{className:`border-b border-gray-800 bg-gray-900/50`,children:[(0,u.jsx)(`th`,{className:`text-left px-4 py-2 text-gray-400 font-medium`,children:`Package`}),(0,u.jsx)(`th`,{className:`text-left px-4 py-2 text-gray-400 font-medium`,children:`Version`}),(0,u.jsx)(`th`,{className:`text-left px-4 py-2 text-gray-400 font-medium`,children:`Type`}),(0,u.jsx)(`th`,{className:`text-left px-4 py-2 text-gray-400 font-medium`,children:`Status`})]})}),t[14]=p):p=t[14];let m;t[15]===r?m=t[16]:(m=r.map(Se),t[15]=r,t[16]=m);let h;t[17]===m?h=t[18]:(h=(0,u.jsx)(`div`,{className:`rounded-lg border border-gray-800 overflow-hidden`,children:(0,u.jsxs)(`table`,{className:`w-full text-sm`,children:[p,(0,u.jsx)(`tbody`,{children:m})]})}),t[17]=m,t[18]=h);let g;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,u.jsx)(`a`,{href:`https://github.com/antfu/node-modules-inspector`,target:`_blank`,rel:`noopener noreferrer`,className:`text-blue-400 hover:text-blue-300 hover:underline`,children:`Node Modules Inspector`}),t[19]=g):g=t[19];let _;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,u.jsx)(`div`,{className:`mt-4 px-4 py-3 rounded-lg bg-gray-900/30 border border-gray-800/50`,children:(0,u.jsxs)(`span`,{className:`text-sm text-gray-400`,children:[`For deep dependency inspection, try`,` `,g,` `,`— run`,` `,(0,u.jsx)(`code`,{className:`px-1.5 py-0.5 rounded bg-gray-800 text-green-400 text-xs`,children:`npx node-modules-inspector`})]})}),t[20]=_):_=t[20];let v;return t[21]!==o||t[22]!==s||t[23]!==f||t[24]!==h?(v=(0,u.jsxs)(`div`,{children:[o,s,f,h,_]}),t[21]=o,t[22]=s,t[23]=f,t[24]=h,t[25]=v):v=t[25],v}function Se(e){return(0,u.jsxs)(`tr`,{className:`border-b border-gray-800/50 hover:bg-gray-800/30 transition-colors`,children:[(0,u.jsx)(`td`,{className:`px-4 py-2.5`,children:(0,u.jsx)(`a`,{href:`https://www.npmjs.com/package/${e.name}`,target:`_blank`,rel:`noopener noreferrer`,className:`font-mono text-green-400 hover:text-green-300 hover:underline`,children:e.name})}),(0,u.jsxs)(`td`,{className:`px-4 py-2.5 font-mono text-gray-300`,children:[e.version,e.outdatedTo&&(0,u.jsxs)(`span`,{className:`ml-2 text-gray-500`,children:[`→ `,e.outdatedTo]})]}),(0,u.jsx)(`td`,{className:`px-4 py-2.5`,children:(0,u.jsx)(`span`,{className:`text-xs px-1.5 py-0.5 rounded-sm ${e.dev?`bg-gray-700 text-gray-400`:`bg-gray-800 text-gray-500`}`,children:e.dev?`dev`:`prod`})}),(0,u.jsx)(`td`,{className:`px-4 py-2.5`,children:(0,u.jsx)(we,{dep:e})})]},`${e.dev?`dev`:`prod`}-${e.name}`)}function Ce(e){return e.unused||e.missing||e.outdatedTo}function we(e){let t=(0,c.c)(10),{dep:n}=e,r;if(t[0]!==n.missing||t[1]!==n.unused||t[2]!==n.updateType){let e=[];if(n.missing){let n;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,u.jsx)(`span`,{className:`text-xs px-2 py-0.5 rounded-full bg-red-900/50 text-red-400 border border-red-800`,children:`missing`},`missing`),t[4]=n):n=t[4],e.push(n)}if(n.unused){let n;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,u.jsx)(`span`,{className:`text-xs px-2 py-0.5 rounded-full bg-yellow-900/40 text-yellow-500 border border-yellow-800`,children:`unused`},`unused`),t[5]=n):n=t[5],e.push(n)}if(n.updateType===`major`){let n;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,u.jsx)(`span`,{className:`text-xs px-2 py-0.5 rounded-full bg-orange-900/40 text-orange-400 border border-orange-800`,children:`major update`},`outdated`),t[6]=n):n=t[6],e.push(n)}else if(n.updateType===`minor`){let n;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,u.jsx)(`span`,{className:`text-xs px-2 py-0.5 rounded-full bg-blue-900/30 text-blue-400 border border-blue-800`,children:`minor update`},`outdated`),t[7]=n):n=t[7],e.push(n)}else if(n.updateType===`patch`){let n;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,u.jsx)(`span`,{className:`text-xs px-2 py-0.5 rounded-full bg-gray-800 text-gray-400 border border-gray-700`,children:`patch update`},`outdated`),t[8]=n):n=t[8],e.push(n)}if(e.length===0){let n;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,u.jsx)(`span`,{className:`text-xs text-gray-600`,children:`✓`},`ok`),t[9]=n):n=t[9],e.push(n)}r=(0,u.jsx)(`div`,{className:`flex gap-1.5 flex-wrap`,children:e}),t[0]=n.missing,t[1]=n.unused,t[2]=n.updateType,t[3]=r}else r=t[3];return r}var J={dependencies:`#60a5fa`,security:`#f87171`,"code-quality":`#a78bfa`,performance:`#fb923c`,git:`#34d399`},Y={top:20,right:24,bottom:44,left:44},Te=800,X=300,Z=Te-Y.left-Y.right,Ee=X-Y.top-Y.bottom;function Q(e){return Y.top+(1-e/100)*Ee}function $(e,t){return t===1?Y.left+Z/2:Y.left+e/(t-1)*Z}function De(e){let t=new Date(e);return`${t.getMonth()+1}/${t.getDate()}`}function Oe(e){return e>=80?`#4ade80`:e>=60?`#facc15`:`#f87171`}function ke(e){let t=(0,c.c)(50),{history:n}=e,{entries:r}=n,i=Array.from(new Set(r.flatMap(Ne))),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=new Set,t[0]=a):a=t[0];let[s,l]=(0,o.useState)(a);if(r.length===0){let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,u.jsxs)(`div`,{className:`flex items-center justify-center h-48 text-gray-500 text-sm font-mono`,children:[`No history yet — run `,(0,u.jsx)(`code`,{className:`mx-1 px-1 bg-card rounded-sm`,children:`sickbay`}),` to start tracking`]}),t[1]=e):e=t[1],e}let d=e=>{l(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},f=r.length,p=Math.max(1,Math.ceil(f/8)),m,h,g,_,v,y,b,x,S,C;if(t[2]!==r||t[3]!==p||t[4]!==f){let e;t[15]!==p||t[16]!==f?(e=e=>{let{i:t}=e;return t%p===0||t===f-1},t[15]=p,t[16]=f,t[17]=e):e=t[17];let n=r.map(Me).filter(e);if(t[18]!==r||t[19]!==f){let e=[0,20,40,60,80,100],n;t[29]===f?n=t[30]:(n=function(e){return e.map((e,t)=>`${$(t,f)},${Q(e)}`).join(` `)},t[29]=f,t[30]=n),h=n;let i;t[31]!==r||t[32]!==h?(i=h(r.map(je)),t[31]=r,t[32]=h,t[33]=i):i=t[33],m=i,C=`space-y-4`,S=`bg-surface rounded-lg border border-border p-4`,g=`0 0 ${Te} ${X}`,_=`w-full`,v=`Score history chart`,y=`img`,b=e.map(Ae),t[18]=r,t[19]=f,t[20]=m,t[21]=h,t[22]=g,t[23]=_,t[24]=v,t[25]=y,t[26]=b,t[27]=S,t[28]=C}else m=t[20],h=t[21],g=t[22],_=t[23],v=t[24],y=t[25],b=t[26],S=t[27],C=t[28];let i;t[34]===f?i=t[35]:(i=e=>{let{i:t,timestamp:n,label:r}=e;return(0,u.jsx)(`text`,{x:$(t,f),y:X-8,textAnchor:`middle`,fontSize:10,fill:`#6b7280`,children:r},n)},t[34]=f,t[35]=i),x=n.map(i),t[2]=r,t[3]=p,t[4]=f,t[5]=m,t[6]=h,t[7]=g,t[8]=_,t[9]=v,t[10]=y,t[11]=b,t[12]=x,t[13]=S,t[14]=C}else m=t[5],h=t[6],g=t[7],_=t[8],v=t[9],y=t[10],b=t[11],x=t[12],S=t[13],C=t[14];let w=i.map(e=>{if(s.has(e))return null;let t=r.map(t=>t.categoryScores[e]??0);return(0,u.jsx)(`polyline`,{points:h(t),fill:`none`,stroke:J[e]??`#9ca3af`,strokeWidth:1.5,strokeOpacity:.5},e)}),T;t[36]===m?T=t[37]:(T=(0,u.jsx)(`polyline`,{points:m,fill:`none`,stroke:`#ffffff`,strokeWidth:2.5}),t[36]=m,t[37]=T);let E;if(t[38]!==r||t[39]!==f){let e;t[41]===f?e=t[42]:(e=(e,t)=>(0,u.jsx)(`circle`,{cx:$(t,f),cy:Q(e.overallScore),r:3,fill:Oe(e.overallScore),stroke:`#0d1117`,strokeWidth:1},e.timestamp),t[41]=f,t[42]=e),E=r.map(e),t[38]=r,t[39]=f,t[40]=E}else E=t[40];let D;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,u.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-mono text-white`,children:[(0,u.jsx)(`span`,{className:`inline-block w-5 h-0.5 bg-white rounded-sm`}),`overall`]}),t[43]=D):D=t[43];let O=i.map(e=>{let t=J[e]??`#9ca3af`;return(0,u.jsxs)(`button`,{onClick:()=>d(e),className:`flex items-center gap-1.5 text-xs font-mono transition-opacity ${s.has(e)?`opacity-30`:`opacity-80 hover:opacity-100`}`,style:{color:t},children:[(0,u.jsx)(`span`,{className:`inline-block w-5 h-0.5 rounded-sm`,style:{backgroundColor:t}}),e]},e)}),k;t[44]!==D||t[45]!==O?(k=(0,u.jsxs)(`div`,{className:`flex flex-wrap gap-3 px-1`,children:[D,O]}),t[44]=D,t[45]=O,t[46]=k):k=t[46];let A;return t[47]!==i||t[48]!==r?(A=r.length>0&&(()=>{let e=r[r.length-1],t=r.length>1?r[r.length-2]:null,n=t?e.overallScore-t.overallScore:null;return(0,u.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3`,children:[(0,u.jsxs)(`div`,{className:`bg-surface border border-border rounded-lg p-3`,children:[(0,u.jsx)(`div`,{className:`text-xs text-gray-500 mb-1`,children:`current overall`}),(0,u.jsxs)(`div`,{className:`text-2xl font-bold font-mono`,style:{color:Oe(e.overallScore)},children:[e.overallScore,n!==null&&(0,u.jsx)(`span`,{className:`text-sm ml-1.5`,style:{color:n>=0?`#4ade80`:`#f87171`},children:n>=0?`+${n}`:n})]})]}),i.map(t=>{let n=e.categoryScores[t];return n==null?null:(0,u.jsxs)(`div`,{className:`bg-surface border border-border rounded-lg p-3`,children:[(0,u.jsx)(`div`,{className:`text-xs text-gray-500 mb-1`,children:t}),(0,u.jsx)(`div`,{className:`text-2xl font-bold font-mono`,style:{color:J[t]??Oe(n)},children:n})]},t)})]})})(),t[47]=i,t[48]=r,t[49]=A):A=t[49],(0,u.jsxs)(`div`,{className:C,children:[(0,u.jsx)(`div`,{className:S,children:(0,u.jsxs)(`svg`,{viewBox:g,className:_,"aria-label":v,role:y,children:[b,x,w,T,E]})}),k,A]})}function Ae(e){return(0,u.jsxs)(`g`,{children:[(0,u.jsx)(`line`,{x1:Y.left,y1:Q(e),x2:Y.left+Z,y2:Q(e),stroke:e===60||e===80?e===80?`#4ade8033`:`#facc1533`:`#ffffff0d`,strokeWidth:e===60||e===80?1.5:1,strokeDasharray:e===60||e===80?`4 3`:void 0}),(0,u.jsx)(`text`,{x:Y.left-8,y:Q(e)+4,textAnchor:`end`,fontSize:10,fill:`#6b7280`,children:e})]},e)}function je(e){return e.overallScore}function Me(e,t){return{i:t,timestamp:e.timestamp,label:De(e.timestamp)}}function Ne(e){return Object.keys(e.categoryScores)}function Pe({checkId:e,suppressMatch:t,message:n,file:r}){let i=(t??n??``).replace(/'/g,`\\'`),a=r?.replace(/'/g,`\\'`);return`// sickbay.config.ts → checks.${e}.suppress\n{ match: '${i}',${a?` /* path: '${a}', */`:``} reason: '' }`}function Fe(e){let t=(0,c.c)(28),{checks:n}=e,[r,i]=(0,o.useState)(`all`),[a,s]=(0,o.useState)(!1),l,d,f,p,m,h;if(t[0]!==n||t[1]!==r||t[2]!==a){let e=n.flatMap(Be),o=r===`all`?e:e.filter(e=>e.severity===r),c={critical:e.filter(ze).length,warning:e.filter(Re).length,info:e.filter(Le).length};p=`flex flex-col gap-3`;let g=[`all`,`critical`,`warning`,`info`].map(t=>(0,u.jsx)(`button`,{onClick:()=>i(t),className:`px-3 py-1 rounded text-xs font-mono transition-colors
5
5
  ${r===t?`bg-accent text-black`:`bg-surface border border-border text-gray-400 hover:border-accent/50`}`,children:t===`all`?`all (${e.length})`:`${t} (${c[t]})`},t)),_;t[9]===a?_=t[10]:(_=()=>s(!a),t[9]=a,t[10]=_);let v=`ml-auto text-xs transition-colors ${a?`text-accent`:`text-gray-500 hover:text-gray-300`}`,y;t[11]!==_||t[12]!==v?(y=(0,u.jsx)(`button`,{onClick:_,className:v,title:`About suppress rules`,children:`ⓘ`}),t[11]=_,t[12]=v,t[13]=y):y=t[13],t[14]!==y||t[15]!==g?(m=(0,u.jsxs)(`div`,{className:`flex gap-2 items-center`,children:[g,y]}),t[14]=y,t[15]=g,t[16]=m):m=t[16],t[17]===a?h=t[18]:(h=a&&(0,u.jsxs)(`div`,{className:`bg-surface border border-border rounded px-4 py-3 text-sm text-gray-300 space-y-2`,children:[(0,u.jsxs)(`p`,{children:[`Click `,(0,u.jsx)(`span`,{className:`font-mono text-gray-400`,children:`⊘ suppress`}),` on any issue to copy a suppression rule to your clipboard.`]}),(0,u.jsxs)(`p`,{children:[`Paste it into the `,(0,u.jsx)(`span`,{className:`font-mono text-gray-400`,children:`suppress`}),` array for that check in your `,(0,u.jsx)(`span`,{className:`font-mono text-gray-400`,children:`sickbay.config.ts`}),` to hide accepted findings from future scans.`]}),(0,u.jsx)(`a`,{href:`https://nebulord-dev.github.io/sickbay/guide/suppress-rules`,target:`_blank`,rel:`noopener noreferrer`,className:`inline-block text-accent hover:underline text-xs`,children:`Learn more →`})]}),t[17]=a,t[18]=h),l=`flex flex-col gap-1`,d=o.length===0&&(0,u.jsx)(`div`,{className:`text-gray-500 text-sm py-4 text-center`,children:`No issues found ✓`}),f=o.map(Ie),t[0]=n,t[1]=r,t[2]=a,t[3]=l,t[4]=d,t[5]=f,t[6]=p,t[7]=m,t[8]=h}else l=t[3],d=t[4],f=t[5],p=t[6],m=t[7],h=t[8];let g;t[19]!==l||t[20]!==d||t[21]!==f?(g=(0,u.jsxs)(`div`,{className:l,children:[d,f]}),t[19]=l,t[20]=d,t[21]=f,t[22]=g):g=t[22];let _;return t[23]!==p||t[24]!==m||t[25]!==h||t[26]!==g?(_=(0,u.jsxs)(`div`,{className:p,children:[m,h,g]}),t[23]=p,t[24]=m,t[25]=h,t[26]=g,t[27]=_):_=t[27],_}function Ie(e){return(0,u.jsx)(Ve,{issue:e,checkName:e.checkName,checkId:e.checkId},`${e.checkName}-${e.message}`)}function Le(e){return e.severity===`info`}function Re(e){return e.severity===`warning`}function ze(e){return e.severity===`critical`}function Be(e){return e.issues.map(t=>({...t,checkName:e.name,checkId:e.id}))}function Ve(e){let t=(0,c.c)(32),{issue:n,checkName:r,checkId:i}=e,[a,s]=(0,o.useState)(!1),l;t[0]===n.fix?l=t[1]:(l=()=>{n.fix?.command&&(navigator.clipboard.writeText(n.fix.command),s(!0),setTimeout(()=>s(!1),2e3))},t[0]=n.fix,t[1]=l);let d=l,[f,p]=(0,o.useState)(!1),m;t[2]!==i||t[3]!==n.file||t[4]!==n.message||t[5]!==n.suppressMatch?(m=()=>{let e=Pe({checkId:i,suppressMatch:n.suppressMatch,message:n.message,file:n.file});navigator.clipboard.writeText(e).catch(He),p(!0),setTimeout(()=>p(!1),2e3)},t[2]=i,t[3]=n.file,t[4]=n.message,t[5]=n.suppressMatch,t[6]=m):m=t[6];let h=m,g=`flex flex-col gap-2 px-3 py-2 border-l-2 rounded-r ${n.severity===`critical`?`border-l-red-500 bg-red-500/5`:n.severity===`warning`?`border-l-yellow-500 bg-yellow-500/5`:`border-l-gray-500 bg-gray-500/5`}`,_;t[7]===r?_=t[8]:(_=(0,u.jsx)(`span`,{className:`text-xs text-gray-500 shrink-0 pt-0.5`,children:r}),t[7]=r,t[8]=_);let v;t[9]===n.message?v=t[10]:(v=(0,u.jsx)(`span`,{className:`flex-1 text-sm`,children:n.message}),t[9]=n.message,t[10]=v);let y;t[11]!==a||t[12]!==d||t[13]!==n.fix?(y=n.fix?.command&&(0,u.jsx)(`button`,{onClick:d,className:`shrink-0 text-xs text-gray-500 hover:text-accent font-mono transition-colors`,children:a?`✓ copied`:n.fix.command}),t[11]=a,t[12]=d,t[13]=n.fix,t[14]=y):y=t[14];let b=f?`✓ copied`:`⊘ suppress`,x;t[15]!==h||t[16]!==b?(x=(0,u.jsx)(`button`,{onClick:h,className:`shrink-0 text-xs text-gray-500 hover:text-accent font-mono transition-colors`,children:b}),t[15]=h,t[16]=b,t[17]=x):x=t[17];let S;t[18]!==_||t[19]!==v||t[20]!==y||t[21]!==x?(S=(0,u.jsxs)(`div`,{className:`flex items-start gap-3`,children:[_,v,y,x]}),t[18]=_,t[19]=v,t[20]=y,t[21]=x,t[22]=S):S=t[22];let C;t[23]===n.file?C=t[24]:(C=n.file&&(0,u.jsxs)(`div`,{className:`text-xs text-gray-500 font-mono flex items-center gap-1`,children:[(0,u.jsx)(`span`,{children:`📄`}),(0,u.jsx)(`span`,{children:n.file})]}),t[23]=n.file,t[24]=C);let w;t[25]===n.fix?w=t[26]:(w=n.fix?.codeChange&&(0,u.jsxs)(`div`,{className:`bg-black/30 rounded-sm p-3 font-mono text-xs border border-red-800/30`,children:[(0,u.jsxs)(`div`,{className:`text-red-400 mb-2 flex items-center gap-1.5`,children:[(0,u.jsx)(`span`,{children:`⚠️`}),(0,u.jsx)(`span`,{className:`font-semibold`,children:`Offensive code:`})]}),(0,u.jsx)(`code`,{className:`text-gray-300 block whitespace-pre-wrap break-all`,children:n.fix.codeChange.before})]}),t[25]=n.fix,t[26]=w);let T;return t[27]!==C||t[28]!==w||t[29]!==g||t[30]!==S?(T=(0,u.jsxs)(`div`,{className:g,children:[S,C,w]}),t[27]=C,t[28]=w,t[29]=g,t[30]=S,t[31]=T):T=t[31],T}function He(){}var Ue={dependencies:`📦`,security:`🔒`,"code-quality":`🔄`,performance:`⚡`,git:`🌿`};function We(e){let t=(0,c.c)(33),{check:n,onClick:r,active:i}=e,a=n.score>=80?`text-green-400`:n.score>=60?`text-yellow-400`:`text-red-400`,o=n.score>=80?`stroke-green-400`:n.score>=60?`stroke-yellow-400`:`stroke-red-400`,s=2*Math.PI*28,l=s-n.score/100*s,d;if(t[0]!==i||t[1]!==n.category||t[2]!==n.issues||t[3]!==n.name||t[4]!==n.score||t[5]!==n.toolsUsed||t[6]!==a||t[7]!==l||t[8]!==r||t[9]!==o){let e=n.issues.filter(Ke),c;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,u.jsx)(`circle`,{cx:`32`,cy:`32`,r:`28`,fill:`none`,stroke:`#2a2a2a`,strokeWidth:`4`}),t[11]=c):c=t[11];let f=`transition-all duration-700 ${o}`,p;t[12]!==l||t[13]!==f?(p=(0,u.jsxs)(`svg`,{className:`w-16 h-16 -rotate-90`,viewBox:`0 0 64 64`,children:[c,(0,u.jsx)(`circle`,{cx:`32`,cy:`32`,r:`28`,fill:`none`,strokeWidth:`4`,strokeDasharray:s,strokeDashoffset:l,strokeLinecap:`round`,className:f})]}),t[12]=l,t[13]=f,t[14]=p):p=t[14];let m=`absolute inset-0 flex items-center justify-center text-lg font-bold ${a}`,h;t[15]!==n.score||t[16]!==m?(h=(0,u.jsx)(`span`,{className:m,children:n.score}),t[15]=n.score,t[16]=m,t[17]=h):h=t[17];let g;t[18]!==p||t[19]!==h?(g=(0,u.jsxs)(`div`,{className:`relative w-16 h-16`,children:[p,h]}),t[18]=p,t[19]=h,t[20]=g):g=t[20];let _=Ue[n.category],v;t[21]!==n.name||t[22]!==_?(v=(0,u.jsxs)(`div`,{className:`text-sm font-semibold`,children:[_,` `,n.name]}),t[21]=n.name,t[22]=_,t[23]=v):v=t[23];let y;t[24]===n.toolsUsed?y=t[25]:(y=n.toolsUsed.join(`, `),t[24]=n.toolsUsed,t[25]=y);let b;t[26]===y?b=t[27]:(b=(0,u.jsx)(`div`,{className:`text-xs text-gray-500 mt-0.5`,children:y}),t[26]=y,t[27]=b);let x;t[28]!==b||t[29]!==v?(x=(0,u.jsxs)(`div`,{className:`text-center`,children:[v,b]}),t[28]=b,t[29]=v,t[30]=x):x=t[30];let S;t[31]===n.issues.length?S=t[32]:(S=n.issues.length>0&&(0,u.jsxs)(`div`,{className:`text-xs text-gray-400`,children:[n.issues.length,` issue`,n.issues.length===1?``:`s`]}),t[31]=n.issues.length,t[32]=S),d=(0,u.jsxs)(`button`,{onClick:r,className:`flex flex-col items-center gap-2 p-4 rounded-lg border transition-all cursor-pointer text-left w-full
6
- ${i?`border-accent bg-card`:`border-border bg-surface hover:border-accent/50`}`,children:[g,x,S,e.length>0&&(0,u.jsxs)(`div`,{className:`w-full mt-2 pt-3 border-t border-red-900/30`,children:[(0,u.jsxs)(`div`,{className:`text-xs text-red-400 font-semibold mb-1.5 text-center`,children:[`🚨 `,e.length,` Critical`]}),(0,u.jsxs)(`ul`,{className:`space-y-1 text-left`,children:[e.slice(0,2).map(Ge),e.length>2&&(0,u.jsxs)(`li`,{className:`text-xs text-gray-500`,children:[`+`,e.length-2,` more`]})]})]})]}),t[0]=i,t[1]=n.category,t[2]=n.issues,t[3]=n.name,t[4]=n.score,t[5]=n.toolsUsed,t[6]=a,t[7]=l,t[8]=r,t[9]=o,t[10]=d}else d=t[10];return d}function Ge(e){return(0,u.jsxs)(`li`,{className:`text-xs text-gray-400 truncate`,children:[`• `,e.message]},e.message)}function Ke(e){return e.severity===`critical`}function qe(e){return e>=80?`green`:e>=60?`yellow`:`red`}function Je(e,t){return e.checks.find(e=>e.id===t)?.metadata??{}}function Ye(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}var Xe=(0,o.lazy)(()=>A(()=>import(`./ChatDrawer-Dqewz3Yz.js`).then(e=>({default:e.ChatDrawer})),__vite__mapDeps([6,1,2,3,4])));function Ze(e){return`isMonorepo`in e}function Qe(e,t){return{timestamp:t.timestamp,projectPath:e.path,projectInfo:{name:e.name,version:`unknown`,hasTypeScript:!1,hasESLint:!1,hasPrettier:!1,framework:e.framework,packageManager:t.packageManager,totalDependencies:Object.keys(e.dependencies).length+Object.keys(e.devDependencies).length,dependencies:e.dependencies,devDependencies:e.devDependencies},checks:e.checks,overallScore:e.score,summary:e.summary}}function $e(e){let t=(0,c.c)(58),{report:n}=e,r=Ze(n)?n:null,[i,a]=(0,o.useState)(-1),s=r?i>=0?Qe(r.packages[i],r):null:n,[l,d]=(0,o.useState)(`overview`),[f,p]=(0,o.useState)(null),[m,h]=(0,o.useState)(!1),[_,v]=(0,o.useState)(!1),[y,x]=(0,o.useState)(null),S=(0,o.useRef)(!1),w=qe(s?.overallScore??n.overallScore),T=(0,o.useRef)(null),E;t[0]!==h||t[1]!==v||t[2]!==p||t[3]!==d?(E=()=>{d(`overview`),p(null),h(!1),v(!1)},t[0]=h,t[1]=v,t[2]=p,t[3]=d,t[4]=E):E=t[4];let D;t[5]===i?D=t[6]:(D=[i],t[5]=i,t[6]=D),(0,o.useEffect)(E,D);let O;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(O=()=>{T.current?.scrollTo({top:0,behavior:`smooth`})},t[7]=O):O=t[7];let k;t[8]===l?k=t[9]:(k=[l],t[8]=l,t[9]=k),(0,o.useEffect)(O,k);let A;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(A=()=>{S.current||(S.current=!0,fetch(`/sickbay-history.json`).then(tt).then(e=>{e&&Array.isArray(e.entries)&&e.entries.length>0&&x(e)}).catch(et))},t[10]=A):A=t[10];let j=A,M=s?Je(s,`complexity`):{},N=s?Je(s,`git`):{},P=s?Je(s,`coverage`):{},F=s?f?s.checks.filter(e=>e.id===f):s.checks:[],I;t[11]!==p||t[12]!==d?(I=e=>{p(e),d(`overview`)},t[11]=p,t[12]=d,t[13]=I):I=t[13];let L=I,R;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,u.jsx)(`div`,{className:`text-green-400 font-bold text-xl tracking-wider`,children:`SICKBAY`}),t[14]=R):R=t[14];let z=r?`Monorepo Health Dashboard`:`Project Health Dashboard`,B;t[15]===z?B=t[16]:(B=(0,u.jsxs)(`div`,{className:`p-4 border-b border-border`,children:[R,(0,u.jsx)(`div`,{className:`text-gray-400 text-xs mt-0.5`,children:z})]}),t[15]=z,t[16]=B);let V=r?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(`div`,{className:`p-4 border-b border-border`,children:[(0,u.jsx)(`div`,{className:`text-xs text-gray-500 mb-1`,children:`monorepo`}),(0,u.jsxs)(`div`,{className:`font-semibold text-sm`,children:[r.monorepoType,` workspaces`]}),(0,u.jsxs)(`div`,{className:`text-xs text-gray-500`,children:[r.packages.length,` packages · `,r.packageManager]})]}),(0,u.jsxs)(`div`,{className:`p-4 border-b border-border`,children:[(0,u.jsx)(`div`,{className:`text-xs text-gray-500 mb-2`,children:`overall score`}),(0,u.jsx)(`div`,{className:`text-4xl font-bold ${w===`green`?`text-green-400`:w===`yellow`?`text-yellow-400`:`text-red-400`}`,children:r.overallScore}),(0,u.jsxs)(`div`,{className:`text-xs text-gray-500 mt-1`,children:[(0,u.jsxs)(`span`,{className:`text-red-400`,children:[r.summary.critical,` critical`]}),` · `,(0,u.jsxs)(`span`,{className:`text-yellow-400`,children:[r.summary.warnings,` warnings`]})]}),r.quote&&(0,u.jsxs)(`p`,{className:`text-sm italic text-gray-400 mt-2`,children:[`"`,r.quote.text,`"`,` `,(0,u.jsxs)(`span`,{className:`not-italic`,children:[`— `,r.quote.source]})]})]}),(0,u.jsxs)(`nav`,{className:`p-2 flex-1 overflow-y-auto`,children:[(0,u.jsx)(`div`,{className:`text-xs text-gray-500 px-2 py-1`,children:`packages`}),(0,u.jsx)(`button`,{onClick:()=>a(-1),className:`w-full flex items-center justify-between px-2 py-1.5 rounded text-sm transition-colors
6
+ ${i?`border-accent bg-card`:`border-border bg-surface hover:border-accent/50`}`,children:[g,x,S,e.length>0&&(0,u.jsxs)(`div`,{className:`w-full mt-2 pt-3 border-t border-red-900/30`,children:[(0,u.jsxs)(`div`,{className:`text-xs text-red-400 font-semibold mb-1.5 text-center`,children:[`🚨 `,e.length,` Critical`]}),(0,u.jsxs)(`ul`,{className:`space-y-1 text-left`,children:[e.slice(0,2).map(Ge),e.length>2&&(0,u.jsxs)(`li`,{className:`text-xs text-gray-500`,children:[`+`,e.length-2,` more`]})]})]})]}),t[0]=i,t[1]=n.category,t[2]=n.issues,t[3]=n.name,t[4]=n.score,t[5]=n.toolsUsed,t[6]=a,t[7]=l,t[8]=r,t[9]=o,t[10]=d}else d=t[10];return d}function Ge(e){return(0,u.jsxs)(`li`,{className:`text-xs text-gray-400 truncate`,children:[`• `,e.message]},e.message)}function Ke(e){return e.severity===`critical`}function qe(e){return e>=80?`green`:e>=60?`yellow`:`red`}function Je(e,t){return e.checks.find(e=>e.id===t)?.metadata??{}}function Ye(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}var Xe=(0,o.lazy)(()=>A(()=>import(`./ChatDrawer-Dqewz3Yz.js`).then(e=>({default:e.ChatDrawer})),__vite__mapDeps([6,1,2,3,4])));function Ze(e){return`isMonorepo`in e}function Qe(e,t){return{timestamp:t.timestamp,projectPath:e.path,projectInfo:{name:e.name,version:`unknown`,hasTypeScript:!1,hasESLint:!1,hasPrettier:!1,framework:e.framework,packageManager:t.packageManager,totalDependencies:Object.keys(e.dependencies).length+Object.keys(e.devDependencies).length,dependencies:e.dependencies,devDependencies:e.devDependencies},checks:e.checks,overallScore:e.score,summary:e.summary}}function $e(e){let t=(0,c.c)(38),{report:n}=e,r=Ze(n)?n:null,[i,a]=(0,o.useState)(-1),s=r?i>=0?Qe(r.packages[i],r):null:n,[l,d]=(0,o.useState)(`overview`),[f,p]=(0,o.useState)(null),[m,h]=(0,o.useState)(!1),[_,v]=(0,o.useState)(!1),[y,x]=(0,o.useState)(null),S=(0,o.useRef)(!1),w=qe(s?.overallScore??n.overallScore),T=(0,o.useRef)(null),E;t[0]!==h||t[1]!==v?(E=()=>{d(`overview`),p(null),h(!1),v(!1)},t[0]=h,t[1]=v,t[2]=E):E=t[2];let D;t[3]===i?D=t[4]:(D=[i],t[3]=i,t[4]=D),(0,o.useEffect)(E,D);let O;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(O=()=>{T.current?.scrollTo({top:0,behavior:`smooth`})},t[5]=O):O=t[5];let k;t[6]===l?k=t[7]:(k=[l],t[6]=l,t[7]=k),(0,o.useEffect)(O,k);let A;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(A=()=>{S.current||(S.current=!0,fetch(`/sickbay-history.json`).then(ot).then(e=>{e&&Array.isArray(e.entries)&&e.entries.length>0&&x(e)}).catch(at))},t[8]=A):A=t[8];let j=A,M=s?Je(s,`complexity`):{},N=s?Je(s,`git`):{},P=s?Je(s,`coverage`):{},F=s?f?s.checks.filter(e=>e.id===f):s.checks.filter(it):[],I;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(I=e=>{p(e),d(`overview`)},t[9]=I):I=t[9];let te=I,L;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,u.jsx)(`div`,{className:`text-green-400 font-bold text-xl tracking-wider`,children:`SICKBAY`}),t[10]=L):L=t[10];let R=r?`Monorepo Health Dashboard`:`Project Health Dashboard`,z;t[11]===R?z=t[12]:(z=(0,u.jsxs)(`div`,{className:`p-4 border-b border-border`,children:[L,(0,u.jsx)(`div`,{className:`text-gray-400 text-xs mt-0.5`,children:R})]}),t[11]=R,t[12]=z);let B=r?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(`div`,{className:`p-4 border-b border-border`,children:[(0,u.jsx)(`div`,{className:`text-xs text-gray-500 mb-1`,children:`monorepo`}),(0,u.jsxs)(`div`,{className:`font-semibold text-sm`,children:[r.monorepoType,` workspaces`]}),(0,u.jsxs)(`div`,{className:`text-xs text-gray-500`,children:[r.packages.length,` packages · `,r.packageManager]})]}),(0,u.jsxs)(`div`,{className:`p-4 border-b border-border`,children:[(0,u.jsx)(`div`,{className:`text-xs text-gray-500 mb-2`,children:`overall score`}),(0,u.jsx)(`div`,{className:`text-4xl font-bold ${w===`green`?`text-green-400`:w===`yellow`?`text-yellow-400`:`text-red-400`}`,children:r.overallScore}),(0,u.jsxs)(`div`,{className:`text-xs text-gray-500 mt-1`,children:[(0,u.jsxs)(`span`,{className:`text-red-400`,children:[r.summary.critical,` critical`]}),` · `,(0,u.jsxs)(`span`,{className:`text-yellow-400`,children:[r.summary.warnings,` warnings`]})]}),r.quote&&(0,u.jsxs)(`p`,{className:`text-sm italic text-gray-400 mt-2`,children:[`"`,r.quote.text,`"`,` `,(0,u.jsxs)(`span`,{className:`not-italic`,children:[`— `,r.quote.source]})]})]}),(0,u.jsxs)(`nav`,{className:`p-2 flex-1 overflow-y-auto`,children:[(0,u.jsx)(`div`,{className:`text-xs text-gray-500 px-2 py-1`,children:`packages`}),(0,u.jsx)(`button`,{onClick:()=>a(-1),className:`w-full flex items-center justify-between px-2 py-1.5 rounded text-sm transition-colors
7
7
  ${i===-1?`bg-card text-white`:`text-gray-400 hover:text-white hover:bg-card/50`}`,children:(0,u.jsx)(`span`,{className:`font-mono`,children:`overview`})}),r.packages.map((e,t)=>{let n=e.score>=80?`text-green-400`:e.score>=60?`text-yellow-400`:`text-red-400`;return(0,u.jsxs)(`button`,{onClick:()=>a(t),className:`w-full flex items-center justify-between px-2 py-1.5 rounded text-sm transition-colors
8
- ${i===t?`bg-card text-white`:`text-gray-400 hover:text-white hover:bg-card/50`}`,children:[(0,u.jsx)(`span`,{className:`font-mono truncate text-left`,children:e.name}),(0,u.jsx)(`span`,{className:`text-xs font-bold ml-2 shrink-0 ${n}`,children:e.score})]},e.path)})]}),(0,u.jsx)(`div`,{className:`p-3 border-t border-border text-xs text-gray-600`,children:new Date(r.timestamp).toLocaleString()})]}):s?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(`div`,{className:`p-4 border-b border-border`,children:[(0,u.jsx)(`div`,{className:`text-xs text-gray-500 mb-1`,children:`project`}),(0,u.jsx)(`div`,{className:`font-semibold`,children:s.projectInfo.name}),(0,u.jsxs)(`div`,{className:`text-xs text-gray-500`,children:[`v`,s.projectInfo.version]}),(0,u.jsxs)(`div`,{className:`text-xs text-gray-500 mt-1`,children:[s.projectInfo.framework,` · `,s.projectInfo.packageManager]}),(0,u.jsxs)(`div`,{className:`text-xs text-gray-500`,children:[s.projectInfo.totalDependencies,` deps`]})]}),(0,u.jsxs)(`div`,{className:`px-4 py-3 border-b border-border grid grid-cols-2 gap-x-3 gap-y-2`,children:[M.totalFiles!=null&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`div`,{className:`text-xs text-gray-500`,children:`files`}),(0,u.jsx)(`div`,{className:`text-sm font-mono font-semibold`,children:Ye(M.totalFiles)})]}),(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`div`,{className:`text-xs text-gray-500`,children:`lines`}),(0,u.jsx)(`div`,{className:`text-sm font-mono font-semibold`,children:Ye(M.totalLines)})]})]}),N.contributorCount!=null&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`div`,{className:`text-xs text-gray-500`,children:`contributors`}),(0,u.jsx)(`div`,{className:`text-sm font-mono font-semibold`,children:String(N.contributorCount)})]}),(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`div`,{className:`text-xs text-gray-500`,children:`last commit`}),(0,u.jsx)(`div`,{className:`text-sm font-mono font-semibold truncate`,children:String(N.lastCommit)})]})]}),P.lines!=null&&(0,u.jsxs)(`div`,{className:`col-span-2`,children:[(0,u.jsx)(`div`,{className:`text-xs text-gray-500`,children:`coverage`}),(0,u.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,u.jsx)(`div`,{className:`flex-1 bg-card rounded-full h-1.5`,children:(0,u.jsx)(`div`,{className:`h-1.5 rounded-full bg-green-400`,style:{width:`${P.lines}%`}})}),(0,u.jsxs)(`span`,{className:`text-sm font-mono font-semibold`,children:[Math.round(P.lines),`%`]})]})]})]}),(0,u.jsxs)(`div`,{className:`p-4 border-b border-border`,children:[(0,u.jsx)(`div`,{className:`text-xs text-gray-500 mb-2`,children:`overall score`}),(0,u.jsx)(`div`,{className:`text-4xl font-bold ${w===`green`?`text-green-400`:w===`yellow`?`text-yellow-400`:`text-red-400`}`,children:s.overallScore}),(0,u.jsxs)(`div`,{className:`text-xs text-gray-500 mt-1`,children:[(0,u.jsxs)(`span`,{className:`text-red-400`,children:[s.summary.critical,` critical`]}),` · `,(0,u.jsxs)(`span`,{className:`text-yellow-400`,children:[s.summary.warnings,` warnings`]}),` · `,(0,u.jsxs)(`span`,{className:`text-gray-400`,children:[s.summary.info,` info`]})]}),s.quote&&(0,u.jsxs)(`p`,{className:`text-sm italic text-gray-400 mt-2`,children:[`"`,s.quote.text,`"`,` `,(0,u.jsxs)(`span`,{className:`not-italic`,children:[`— `,s.quote.source]})]})]}),(0,u.jsxs)(`nav`,{className:`p-2 flex-1 overflow-y-auto`,children:[(0,u.jsx)(`div`,{className:`text-xs text-gray-500 px-2 py-1`,children:`checks`}),s.checks.map(e=>{let t=e.score>=80?`text-green-400`:e.score>=60?`text-yellow-400`:`text-red-400`;return(0,u.jsxs)(`button`,{onClick:()=>{p(f===e.id?null:e.id),d(`issues`)},className:`w-full flex items-center justify-between px-2 py-1.5 rounded text-sm transition-colors
9
- ${f===e.id?`bg-card text-white`:`text-gray-400 hover:text-white hover:bg-card/50`}`,children:[(0,u.jsx)(`span`,{className:`font-mono`,children:e.name}),(0,u.jsx)(`span`,{className:`text-xs font-bold ${t}`,children:e.score})]},e.id)})]}),(0,u.jsx)(`div`,{className:`p-3 border-t border-border text-xs text-gray-600`,children:new Date(s.timestamp).toLocaleString()})]}):null,H;t[17]!==B||t[18]!==V?(H=(0,u.jsxs)(`aside`,{className:`w-72 border-r border-border flex flex-col shrink-0 bg-surface`,children:[B,V]}),t[17]=B,t[18]=V,t[19]=H):H=t[19];let U;t[20]!==s||t[21]!==j||t[22]!==F||t[23]!==L||t[24]!==y||t[25]!==m||t[26]!==_||t[27]!==r||t[28]!==f||t[29]!==i||t[30]!==h||t[31]!==v||t[32]!==p||t[33]!==d||t[34]!==l?(U=r&&i===-1?(0,u.jsx)(nt,{report:r,onSelectPackage:a}):s?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(`div`,{className:`p-4 border-b border-border flex items-center`,children:[(0,u.jsxs)(`div`,{className:`flex gap-2 flex-1`,children:[[`overview`,`issues`,`dependencies`,`codebase`].map(e=>(0,u.jsx)(`button`,{onClick:()=>{d(e),e===`overview`&&p(null)},className:`px-3 py-1 rounded text-sm font-mono transition-colors
8
+ ${i===t?`bg-card text-white`:`text-gray-400 hover:text-white hover:bg-card/50`}`,children:[(0,u.jsx)(`span`,{className:`font-mono truncate text-left`,children:e.name}),(0,u.jsx)(`span`,{className:`text-xs font-bold ml-2 shrink-0 ${n}`,children:e.score})]},e.path)})]}),(0,u.jsx)(`div`,{className:`p-3 border-t border-border text-xs text-gray-600`,children:new Date(r.timestamp).toLocaleString()})]}):s?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(`div`,{className:`p-4 border-b border-border`,children:[(0,u.jsx)(`div`,{className:`text-xs text-gray-500 mb-1`,children:`project`}),(0,u.jsx)(`div`,{className:`font-semibold`,children:s.projectInfo.name}),(0,u.jsxs)(`div`,{className:`text-xs text-gray-500`,children:[`v`,s.projectInfo.version]}),(0,u.jsxs)(`div`,{className:`text-xs text-gray-500 mt-1`,children:[s.projectInfo.framework,` · `,s.projectInfo.packageManager]}),(0,u.jsxs)(`div`,{className:`text-xs text-gray-500`,children:[s.projectInfo.totalDependencies,` deps`]})]}),(0,u.jsxs)(`div`,{className:`px-4 py-3 border-b border-border grid grid-cols-2 gap-x-3 gap-y-2`,children:[M.totalFiles!=null&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`div`,{className:`text-xs text-gray-500`,children:`files`}),(0,u.jsx)(`div`,{className:`text-sm font-mono font-semibold`,children:Ye(M.totalFiles)})]}),(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`div`,{className:`text-xs text-gray-500`,children:`lines`}),(0,u.jsx)(`div`,{className:`text-sm font-mono font-semibold`,children:Ye(M.totalLines)})]})]}),N.contributorCount!=null&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`div`,{className:`text-xs text-gray-500`,children:`contributors`}),(0,u.jsx)(`div`,{className:`text-sm font-mono font-semibold`,children:String(N.contributorCount)})]}),(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`div`,{className:`text-xs text-gray-500`,children:`last commit`}),(0,u.jsx)(`div`,{className:`text-sm font-mono font-semibold truncate`,children:String(N.lastCommit)})]})]}),P.lines!=null&&(0,u.jsxs)(`div`,{className:`col-span-2`,children:[(0,u.jsx)(`div`,{className:`text-xs text-gray-500`,children:`coverage`}),(0,u.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,u.jsx)(`div`,{className:`flex-1 bg-card rounded-full h-1.5`,children:(0,u.jsx)(`div`,{className:`h-1.5 rounded-full bg-green-400`,style:{width:`${P.lines}%`}})}),(0,u.jsxs)(`span`,{className:`text-sm font-mono font-semibold`,children:[Math.round(P.lines),`%`]})]})]})]}),(0,u.jsxs)(`div`,{className:`p-4 border-b border-border`,children:[(0,u.jsx)(`div`,{className:`text-xs text-gray-500 mb-2`,children:`overall score`}),(0,u.jsx)(`div`,{className:`text-4xl font-bold ${w===`green`?`text-green-400`:w===`yellow`?`text-yellow-400`:`text-red-400`}`,children:s.overallScore}),(0,u.jsxs)(`div`,{className:`text-xs text-gray-500 mt-1`,children:[(0,u.jsxs)(`span`,{className:`text-red-400`,children:[s.summary.critical,` critical`]}),` · `,(0,u.jsxs)(`span`,{className:`text-yellow-400`,children:[s.summary.warnings,` warnings`]}),` · `,(0,u.jsxs)(`span`,{className:`text-gray-400`,children:[s.summary.info,` info`]})]}),s.quote&&(0,u.jsxs)(`p`,{className:`text-sm italic text-gray-400 mt-2`,children:[`"`,s.quote.text,`"`,` `,(0,u.jsxs)(`span`,{className:`not-italic`,children:[`— `,s.quote.source]})]})]}),(0,u.jsxs)(`nav`,{className:`p-2 flex-1 overflow-y-auto`,children:[(0,u.jsx)(`div`,{className:`text-xs text-gray-500 px-2 py-1`,children:`checks`}),s.checks.filter(rt).map(e=>{let t=e.score>=80?`text-green-400`:e.score>=60?`text-yellow-400`:`text-red-400`;return(0,u.jsxs)(`button`,{onClick:()=>{p(f===e.id?null:e.id),d(`issues`)},className:`w-full flex items-center justify-between px-2 py-1.5 rounded text-sm transition-colors
9
+ ${f===e.id?`bg-card text-white`:`text-gray-400 hover:text-white hover:bg-card/50`}`,children:[(0,u.jsx)(`span`,{className:`font-mono`,children:e.name}),(0,u.jsx)(`span`,{className:`text-xs font-bold ${t}`,children:e.score})]},e.id)}),s.checks.some(nt)&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`div`,{className:`text-xs text-gray-500 px-2 py-1 mt-2`,children:`skipped`}),s.checks.filter(tt).map(et)]})]}),(0,u.jsx)(`div`,{className:`p-3 border-t border-border text-xs text-gray-600`,children:new Date(s.timestamp).toLocaleString()})]}):null,V;t[13]!==z||t[14]!==B?(V=(0,u.jsxs)(`aside`,{className:`w-72 border-r border-border flex flex-col shrink-0 bg-surface`,children:[z,B]}),t[13]=z,t[14]=B,t[15]=V):V=t[15];let H=r&&i===-1?(0,u.jsx)(st,{report:r,onSelectPackage:a}):s?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(`div`,{className:`p-4 border-b border-border flex items-center`,children:[(0,u.jsxs)(`div`,{className:`flex gap-2 flex-1`,children:[[`overview`,`issues`,`dependencies`,`codebase`].map(e=>(0,u.jsx)(`button`,{onClick:()=>{d(e),e===`overview`&&p(null)},className:`px-3 py-1 rounded text-sm font-mono transition-colors
10
10
  ${l===e?`bg-accent text-black font-semibold`:`text-gray-400 hover:text-white`}`,children:e},e)),!r&&(0,u.jsx)(`button`,{onClick:()=>{d(`history`),j()},className:`px-3 py-1 rounded text-sm font-mono transition-colors
11
11
  ${l===`history`?`bg-accent text-black font-semibold`:`text-gray-400 hover:text-white`}`,children:`history`}),s?.config?.hasCustomConfig&&(0,u.jsx)(`button`,{onClick:()=>d(`config`),className:`px-3 py-1 rounded text-sm font-mono transition-colors
12
12
  ${l===`config`?`bg-accent text-black font-semibold`:`text-gray-400 hover:text-white`}`,children:`config`})]}),(0,u.jsxs)(`div`,{className:`flex gap-2`,children:[s?.recommendations&&s.recommendations.length>0&&(0,u.jsxs)(`button`,{onClick:()=>v(!_),className:`px-3 py-1 rounded text-sm font-mono transition-colors flex items-center gap-1.5
13
13
  ${_?`bg-teal-500/20 text-teal-300 font-semibold`:`text-gray-400 hover:text-white`}`,children:[(0,u.jsx)(`span`,{children:`💡`}),(0,u.jsx)(`span`,{children:`advisor`})]}),(!r||i>=0)&&(0,u.jsxs)(`button`,{onClick:()=>h(!m),className:`px-3 py-1 rounded text-sm font-mono transition-colors flex items-center gap-1.5
14
14
  ${m?`bg-purple-500/20 text-purple-300 font-semibold`:`text-gray-400 hover:text-white`}`,children:[(0,u.jsx)(`span`,{children:(0,u.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`32`,height:`32`,viewBox:`0 0 24 24`,children:(0,u.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,d:`M9.6 6.112c.322-.816 1.478-.816 1.8 0l.91 2.31a5.8 5.8 0 0 0 3.268 3.268l2.31.91c.816.322.816 1.478 0 1.8l-2.31.91a5.8 5.8 0 0 0-3.268 3.268l-.91 2.31c-.322.816-1.478.816-1.8 0l-.91-2.31a5.8 5.8 0 0 0-3.268-3.268l-2.31-.91c-.816-.322-.816-1.478 0-1.8l2.31-.91A5.8 5.8 0 0 0 8.69 8.422zm8.563-3.382a.363.363 0 0 1 .674 0l.342.866c.221.56.665 1.004 1.225 1.225l.866.342a.363.363 0 0 1 0 .674l-.866.342a2.18 2.18 0 0 0-1.225 1.225l-.342.866a.363.363 0 0 1-.674 0l-.342-.866a2.18 2.18 0 0 0-1.225-1.225l-.867-.342a.363.363 0 0 1 0-.674l.867-.342a2.18 2.18 0 0 0 1.225-1.225z`})})}),(0,u.jsx)(`span`,{children:`ai insights`})]}),(0,u.jsx)(`button`,{onClick:()=>d(`about`),className:`px-3 py-1 rounded text-sm font-mono transition-colors
15
- ${l===`about`?`bg-accent text-black font-semibold`:`text-gray-400 hover:text-white`}`,children:`about`})]})]}),(0,u.jsxs)(`div`,{className:`p-6`,children:[l===`overview`&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(le,{report:s,onCheckClick:L}),(0,u.jsx)(`div`,{className:`grid grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4`,children:F.map(e=>(0,u.jsx)(We,{check:e,onClick:()=>{p(f===e.id?null:e.id),d(`overview`)},active:f===e.id},e.id))})]}),l===`issues`&&(0,u.jsx)(Fe,{checks:F}),l===`dependencies`&&(0,u.jsx)(be,{report:s}),l===`codebase`&&(0,u.jsx)(ee,{report:s}),l===`history`&&!r&&(y?(0,u.jsx)(ke,{history:y}):(0,u.jsxs)(`div`,{className:`flex items-center justify-center h-48 text-gray-500 text-sm font-mono`,children:[`No history found — run`,` `,(0,u.jsx)(`code`,{className:`mx-1 px-1 bg-card rounded-sm`,children:`sickbay init`}),` then scan at least once`]})),l===`config`&&s&&(0,u.jsx)(te,{report:s}),l===`about`&&(0,u.jsx)(g,{report:s})]})]}):null,t[20]=s,t[21]=j,t[22]=F,t[23]=L,t[24]=y,t[25]=m,t[26]=_,t[27]=r,t[28]=f,t[29]=i,t[30]=h,t[31]=v,t[32]=p,t[33]=d,t[34]=l,t[35]=U):U=t[35];let W;t[36]===U?W=t[37]:(W=(0,u.jsx)(`main`,{ref:T,className:`flex-1 overflow-y-auto`,children:U}),t[36]=U,t[37]=W);let G;t[38]!==s||t[39]!==m||t[40]!==r||t[41]!==i||t[42]!==h?(G=s&&(!r||i>=0)&&(0,u.jsx)(b,{report:s,isOpen:m,onToggle:h,packageName:r?r.packages[i]?.name:void 0}),t[38]=s,t[39]=m,t[40]=r,t[41]=i,t[42]=h,t[43]=G):G=t[43];let K;t[44]!==s||t[45]!==_||t[46]!==v?(K=s?.recommendations&&s.recommendations.length>0&&(0,u.jsx)(C,{recommendations:s.recommendations,isOpen:_,onToggle:v}),t[44]=s,t[45]=_,t[46]=v,t[47]=K):K=t[47];let q;t[48]!==s||t[49]!==r||t[50]!==i?(q=s&&(!r||i>=0)&&(0,u.jsx)(o.Suspense,{fallback:null,children:(0,u.jsx)(Xe,{report:s,packageName:r?r.packages[i]?.name:void 0})}),t[48]=s,t[49]=r,t[50]=i,t[51]=q):q=t[51];let J;return t[52]!==H||t[53]!==W||t[54]!==G||t[55]!==K||t[56]!==q?(J=(0,u.jsxs)(`div`,{className:`flex h-screen overflow-hidden`,children:[H,W,G,K,q]}),t[52]=H,t[53]=W,t[54]=G,t[55]=K,t[56]=q,t[57]=J):J=t[57],J}function et(){}function tt(e){return e.ok?e.json():null}function nt({report:e,onSelectPackage:t}){let n=(0,o.lazy)(()=>A(()=>import(`./MonorepoOverview-vTq9TL11.js`).then(e=>({default:e.MonorepoOverview})),__vite__mapDeps([7,2,1,3,4])));return(0,u.jsx)(o.Suspense,{fallback:(0,u.jsx)(`div`,{className:`p-8 text-gray-500`,children:`Loading overview...`}),children:(0,u.jsx)(n,{report:e,onSelectPackage:t})})}async function rt(){let e=new URLSearchParams(window.location.search).get(`report`);if(e)try{return JSON.parse(atob(e))}catch{}try{let e=await fetch(`/sickbay-report.json`),t=e.headers.get(`content-type`)??``;if(e.ok&&t.includes(`json`))return e.json()}catch{}let t=localStorage.getItem(`sickbay-report`);if(t)try{return JSON.parse(t)}catch{}return null}function it(){let e=(0,c.c)(8),[t,n]=(0,o.useState)(null),[r,i]=(0,o.useState)(!0),a,s;if(e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>{rt().then(e=>{n(e),i(!1)}).catch(()=>{i(!1)})},s=[],e[0]=a,e[1]=s):(a=e[0],s=e[1]),(0,o.useEffect)(a,s),r){let t;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,u.jsx)(`div`,{className:`flex items-center justify-center h-screen text-green-400`,children:(0,u.jsxs)(`div`,{className:`text-center`,children:[(0,u.jsx)(`div`,{className:`text-2xl font-bold mb-2`,children:`SICKBAY`}),(0,u.jsx)(`div`,{className:`text-sm text-gray-500 animate-pulse`,children:`Loading report...`})]})}),e[2]=t):t=e[2],t}if(!t){let t,n;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,u.jsx)(`div`,{className:`text-green-400 text-3xl font-bold mb-4`,children:`SICKBAY`}),n=(0,u.jsx)(`div`,{className:`text-gray-400 mb-6`,children:`No report found. Run sickbay in your project first:`}),e[3]=t,e[4]=n):(t=e[3],n=e[4]);let r;return e[5]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,u.jsx)(`div`,{className:`flex items-center justify-center h-screen`,children:(0,u.jsxs)(`div`,{className:`text-center max-w-md`,children:[t,n,(0,u.jsx)(`div`,{className:`bg-card border border-border rounded-lg p-4 text-left`,children:(0,u.jsxs)(`div`,{className:`text-green-400 font-mono text-sm`,children:[`$ npx sickbay --json `,`>`,` sickbay-report.json`]})}),(0,u.jsx)(`div`,{className:`text-xs text-gray-600 mt-4`,children:`Or drop a sickbay-report.json in this directory`})]})}),e[5]=r):r=e[5],r}let l;return e[6]===t?l=e[7]:(l=(0,u.jsx)($e,{report:t}),e[6]=t,e[7]=l),l}(0,s.createRoot)(document.getElementById(`root`)).render((0,u.jsx)(o.StrictMode,{children:(0,u.jsx)(it,{})}));
16
- //# sourceMappingURL=index-BSAa6zMs.js.map
15
+ ${l===`about`?`bg-accent text-black font-semibold`:`text-gray-400 hover:text-white`}`,children:`about`})]})]}),(0,u.jsxs)(`div`,{className:`p-6`,children:[l===`overview`&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(ue,{report:s,onCheckClick:te}),(0,u.jsx)(`div`,{className:`grid grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4`,children:F.map(e=>(0,u.jsx)(We,{check:e,onClick:()=>{p(f===e.id?null:e.id),d(`overview`)},active:f===e.id},e.id))})]}),l===`issues`&&(0,u.jsx)(Fe,{checks:F}),l===`dependencies`&&(0,u.jsx)(xe,{report:s}),l===`codebase`&&(0,u.jsx)(ee,{report:s}),l===`history`&&!r&&(y?(0,u.jsx)(ke,{history:y}):(0,u.jsxs)(`div`,{className:`flex items-center justify-center h-48 text-gray-500 text-sm font-mono`,children:[`No history found — run`,` `,(0,u.jsx)(`code`,{className:`mx-1 px-1 bg-card rounded-sm`,children:`sickbay init`}),` then scan at least once`]})),l===`config`&&s&&(0,u.jsx)(ne,{report:s}),l===`about`&&(0,u.jsx)(g,{report:s})]})]}):null,U;t[16]===H?U=t[17]:(U=(0,u.jsx)(`main`,{ref:T,className:`flex-1 overflow-y-auto`,children:H}),t[16]=H,t[17]=U);let W;t[18]!==s||t[19]!==m||t[20]!==r||t[21]!==i||t[22]!==h?(W=s&&(!r||i>=0)&&(0,u.jsx)(b,{report:s,isOpen:m,onToggle:h,packageName:r?r.packages[i]?.name:void 0}),t[18]=s,t[19]=m,t[20]=r,t[21]=i,t[22]=h,t[23]=W):W=t[23];let G;t[24]!==s||t[25]!==_||t[26]!==v?(G=s?.recommendations&&s.recommendations.length>0&&(0,u.jsx)(C,{recommendations:s.recommendations,isOpen:_,onToggle:v}),t[24]=s,t[25]=_,t[26]=v,t[27]=G):G=t[27];let K;t[28]!==s||t[29]!==r||t[30]!==i?(K=s&&(!r||i>=0)&&(0,u.jsx)(o.Suspense,{fallback:null,children:(0,u.jsx)(Xe,{report:s,packageName:r?r.packages[i]?.name:void 0})}),t[28]=s,t[29]=r,t[30]=i,t[31]=K):K=t[31];let q;return t[32]!==V||t[33]!==U||t[34]!==W||t[35]!==G||t[36]!==K?(q=(0,u.jsxs)(`div`,{className:`flex h-screen overflow-hidden`,children:[V,U,W,G,K]}),t[32]=V,t[33]=U,t[34]=W,t[35]=G,t[36]=K,t[37]=q):q=t[37],q}function et(e){return(0,u.jsxs)(`div`,{className:`w-full flex items-center justify-between px-2 py-1.5 rounded text-sm text-gray-600`,children:[(0,u.jsx)(`span`,{className:`font-mono`,children:e.name}),(0,u.jsx)(`span`,{className:`text-xs bg-gray-500/10 text-gray-500 px-1.5 py-0.5 rounded-sm font-mono`,children:`skipped`})]},e.id)}function tt(e){return e.status===`skipped`}function nt(e){return e.status===`skipped`}function rt(e){return e.status!==`skipped`}function it(e){return e.status!==`skipped`}function at(){}function ot(e){return e.ok?e.json():null}function st({report:e,onSelectPackage:t}){let n=(0,o.lazy)(()=>A(()=>import(`./MonorepoOverview-vTq9TL11.js`).then(e=>({default:e.MonorepoOverview})),__vite__mapDeps([7,2,1,3,4])));return(0,u.jsx)(o.Suspense,{fallback:(0,u.jsx)(`div`,{className:`p-8 text-gray-500`,children:`Loading overview...`}),children:(0,u.jsx)(n,{report:e,onSelectPackage:t})})}async function ct(){let e=new URLSearchParams(window.location.search).get(`report`);if(e)try{return JSON.parse(atob(e))}catch{}try{let e=await fetch(`/sickbay-report.json`),t=e.headers.get(`content-type`)??``;if(e.ok&&t.includes(`json`))return e.json()}catch{}let t=localStorage.getItem(`sickbay-report`);if(t)try{return JSON.parse(t)}catch{}return null}function lt(){let e=(0,c.c)(8),[t,n]=(0,o.useState)(null),[r,i]=(0,o.useState)(!0),a,s;if(e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>{ct().then(e=>{n(e),i(!1)}).catch(()=>{i(!1)})},s=[],e[0]=a,e[1]=s):(a=e[0],s=e[1]),(0,o.useEffect)(a,s),r){let t;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,u.jsx)(`div`,{className:`flex items-center justify-center h-screen text-green-400`,children:(0,u.jsxs)(`div`,{className:`text-center`,children:[(0,u.jsx)(`div`,{className:`text-2xl font-bold mb-2`,children:`SICKBAY`}),(0,u.jsx)(`div`,{className:`text-sm text-gray-500 animate-pulse`,children:`Loading report...`})]})}),e[2]=t):t=e[2],t}if(!t){let t,n;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,u.jsx)(`div`,{className:`text-green-400 text-3xl font-bold mb-4`,children:`SICKBAY`}),n=(0,u.jsx)(`div`,{className:`text-gray-400 mb-6`,children:`No report found. Run sickbay in your project first:`}),e[3]=t,e[4]=n):(t=e[3],n=e[4]);let r;return e[5]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,u.jsx)(`div`,{className:`flex items-center justify-center h-screen`,children:(0,u.jsxs)(`div`,{className:`text-center max-w-md`,children:[t,n,(0,u.jsx)(`div`,{className:`bg-card border border-border rounded-lg p-4 text-left`,children:(0,u.jsxs)(`div`,{className:`text-green-400 font-mono text-sm`,children:[`$ npx sickbay --json `,`>`,` sickbay-report.json`]})}),(0,u.jsx)(`div`,{className:`text-xs text-gray-600 mt-4`,children:`Or drop a sickbay-report.json in this directory`})]})}),e[5]=r):r=e[5],r}let l;return e[6]===t?l=e[7]:(l=(0,u.jsx)($e,{report:t}),e[6]=t,e[7]=l),l}(0,s.createRoot)(document.getElementById(`root`)).render((0,u.jsx)(o.StrictMode,{children:(0,u.jsx)(lt,{})}));
16
+ //# sourceMappingURL=index-B_XNCPiK.js.map