// Site-wide config — single source of truth for values that drift.
// Change here, everything downstream follows.
window.SITE_STATS = {
  // v60 — single-Architect runtime. The multi-agent fleet was retired in
  // favour of one Claude-Code-class agent that flips between five prompt
  // modes (worker, iterator, spawner, observer, memory-keeper) within a
  // single context window. Subagents are spawned ephemerally as tools.
  agentCount: 1,
  agentWord: 'One',
  toolPaletteCount: '25+',      // Architect's tool palette — read as "25+" so we don't have to bump on every new tool
  pluginCount: 26,              // shipped plugin catalog
  cronActionTypes: 4,           // chat_message, bash, use_connection, spawn_agent
  oauthProviders: 4,            // github, slack, gmail, notion (extensible)

  // v47 — unified skills catalog. These are the counts at v47 GA.
  skillsTotal: 635,        // total skill packages indexed (categories + external)
  skillsCategories: 9,     // templates, connectors, plugins, components, sdk, agents, rules, automations, domains
  skillsDomains: 27,       // vertical domain buckets
  skillsTemplates: 42,     // starters + archetypes + deliverable templates
  skillsConnectors: 204,   // certified enterprise connectors — direct vendor APIs, validated auth + endpoints
  skillsPlugins: 26,       // 6 framework + 20 app-feature
  skillsComponents: 30,    // UI atoms
  skillsSdkHooks: 17,      // runtime hooks
  skillsAgents: 10,        // SOUL persona templates (distinct from the 10 core)
  skillsRules: 28,         // shield + quality rules
  skillsAutomations: 23,   // 12 schedules + 11 action types
  skillsDomainSeeds: 81,   // 3 × 27 domains
  skillsExternal: 87,      // imported from anthropic + mcp + openclaw with attribution
  mdConventions: 38,       // SKILL, SOUL, AGENTS, CLAUDE, DESIGN, ADR, ROADMAP, etc.
};

// Lucide-style line icons
const Icon = ({ d, size = 16, stroke = 1.75, children, style, fill='none' }) => (
  <svg
    width={size} height={size} viewBox="0 0 24 24"
    fill={fill} stroke="currentColor" strokeWidth={stroke}
    strokeLinecap="round" strokeLinejoin="round"
    style={{ flexShrink: 0, ...style }}
  >
    {children || <path d={d} />}
  </svg>
);

const I = {
  // nav
  chat: (p) => <Icon {...p}><path d="M21 12a8 8 0 0 1-11.5 7.2L4 21l1.8-5.5A8 8 0 1 1 21 12Z"/></Icon>,
  chevron: (p) => <Icon {...p}><path d="m6 9 6 6 6-6"/></Icon>,
  chevronRight: (p) => <Icon {...p}><path d="m9 6 6 6-6 6"/></Icon>,
  chevronLeft: (p) => <Icon {...p}><path d="m15 6-6 6 6 6"/></Icon>,
  arrow: (p) => <Icon {...p}><path d="M5 12h14M12 5l7 7-7 7"/></Icon>,
  arrowUp: (p) => <Icon {...p}><path d="M12 19V5M5 12l7-7 7 7"/></Icon>,
  arrowUpRight: (p) => <Icon {...p}><path d="M7 17 17 7M8 7h9v9"/></Icon>,
  plus: (p) => <Icon {...p}><path d="M12 5v14M5 12h14"/></Icon>,
  close: (p) => <Icon {...p}><path d="M6 6l12 12M18 6 6 18"/></Icon>,
  check: (p) => <Icon {...p}><path d="m5 12 5 5L20 7"/></Icon>,
  sparkle: (p) => <Icon {...p}><path d="M12 3v4M12 17v4M3 12h4M17 12h4M5.6 5.6l2.8 2.8M15.6 15.6l2.8 2.8M5.6 18.4l2.8-2.8M15.6 8.4l2.8-2.8"/></Icon>,
  spark: (p) => <Icon {...p}><path d="M12 2 14 10 22 12 14 14 12 22 10 14 2 12 10 10Z"/></Icon>,

  // brand
  github: (p) => <Icon {...p} fill="currentColor" stroke="none"><path d="M12 .5C5.6.5.5 5.7.5 12a11.5 11.5 0 0 0 7.9 11c.6.1.8-.3.8-.6v-2c-3.2.7-3.9-1.5-3.9-1.5-.5-1.4-1.3-1.7-1.3-1.7-1-.7.1-.7.1-.7 1.2.1 1.8 1.2 1.8 1.2 1 1.8 2.8 1.3 3.5 1 .1-.8.4-1.3.8-1.6-2.6-.3-5.3-1.3-5.3-5.7 0-1.3.4-2.3 1.2-3.1-.1-.3-.5-1.5.1-3.1 0 0 1-.3 3.2 1.2a11 11 0 0 1 5.8 0C17.7 4 18.7 4.3 18.7 4.3c.6 1.6.2 2.8.1 3.1.8.8 1.2 1.8 1.2 3.1 0 4.4-2.7 5.4-5.3 5.7.4.4.8 1.1.8 2.2v3.3c0 .3.2.7.8.6a11.5 11.5 0 0 0 7.9-11C23.5 5.7 18.3.5 12 .5Z"/></Icon>,
  star: (p) => <Icon {...p}><path d="M12 2 15 9l8 1-6 5 2 8-7-4-7 4 2-8-6-5 8-1Z"/></Icon>,
  starFill: (p) => <Icon {...p} fill="currentColor" stroke="none"><path d="M12 2 15 9l8 1-6 5 2 8-7-4-7 4 2-8-6-5 8-1Z"/></Icon>,

  // technical
  terminal: (p) => <Icon {...p}><path d="m4 8 4 4-4 4M12 16h8"/><rect x="2" y="4" width="20" height="16" rx="2"/></Icon>,
  code: (p) => <Icon {...p}><path d="m8 6-6 6 6 6M16 6l6 6-6 6M14 4l-4 16"/></Icon>,
  code2: (p) => <Icon {...p}><path d="m16 18 6-6-6-6M8 6l-6 6 6 6"/></Icon>,
  server: (p) => <Icon {...p}><rect x="3" y="3" width="18" height="8" rx="2"/><rect x="3" y="13" width="18" height="8" rx="2"/><path d="M7 7h.01M7 17h.01"/></Icon>,
  database: (p) => <Icon {...p}><ellipse cx="12" cy="5" rx="8" ry="3"/><path d="M4 5v6c0 1.7 3.6 3 8 3s8-1.3 8-3V5"/><path d="M4 11v6c0 1.7 3.6 3 8 3s8-1.3 8-3v-6"/></Icon>,
  cpu: (p) => <Icon {...p}><rect x="5" y="5" width="14" height="14" rx="2"/><rect x="9" y="9" width="6" height="6"/><path d="M9 2v3M15 2v3M9 19v3M15 19v3M2 9h3M2 15h3M19 9h3M19 15h3"/></Icon>,
  lock: (p) => <Icon {...p}><rect x="4" y="10" width="16" height="11" rx="2"/><path d="M8 10V7a4 4 0 0 1 8 0v3"/></Icon>,
  shield: (p) => <Icon {...p}><path d="M12 2 4 5v6c0 5 4 9 8 11 4-2 8-6 8-11V5l-8-3Z"/></Icon>,
  branch: (p) => <Icon {...p}><circle cx="6" cy="5" r="2"/><circle cx="6" cy="19" r="2"/><circle cx="18" cy="7" r="2"/><path d="M6 7v10M18 9c0 3-6 3-6 7"/></Icon>,
  globe: (p) => <Icon {...p}><circle cx="12" cy="12" r="9"/><path d="M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18"/></Icon>,
  bolt: (p) => <Icon {...p}><path d="M13 3 4 14h7l-1 7 9-11h-7l1-7Z"/></Icon>,
  key: (p) => <Icon {...p}><circle cx="7" cy="15" r="3"/><path d="m9.2 13 11.3-11.3 1.5 1.5-3 3 2 2-2 2-2-2-3 3"/></Icon>,

  // content
  docs: (p) => <Icon {...p}><path d="M7 3h8l5 5v11a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2Z"/><path d="M14 3v5h5M9 13h6M9 17h6"/></Icon>,
  chart: (p) => <Icon {...p}><path d="M3 20h18"/><rect x="5" y="10" width="3" height="10"/><rect x="11" y="5" width="3" height="15"/><rect x="17" y="13" width="3" height="7"/></Icon>,
  folder: (p) => <Icon {...p}><path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z"/></Icon>,
  users: (p) => <Icon {...p}><circle cx="9" cy="8" r="3"/><path d="M3 20a6 6 0 0 1 12 0"/><circle cx="17" cy="9" r="2.5"/><path d="M15 14a5 5 0 0 1 7 4.5"/></Icon>,
  store: (p) => <Icon {...p}><path d="M4 7h16l-1 4a3 3 0 0 1-6 0 3 3 0 0 1-6 0L4 7Z"/><path d="M5 11v9h14v-9M3 7l2-4h14l2 4"/></Icon>,
  saas: (p) => <Icon {...p}><rect x="3" y="4" width="18" height="14" rx="2"/><path d="M3 9h18M7 14h5"/></Icon>,
  cloud: (p) => <Icon {...p}><path d="M17.5 19a4.5 4.5 0 0 0 0-9 7 7 0 0 0-13.6 2A4 4 0 0 0 5 19Z"/></Icon>,
  plug: (p) => <Icon {...p}><path d="M9 2v6M15 2v6M7 8h10v4a5 5 0 0 1-5 5 5 5 0 0 1-5-5V8ZM12 17v5"/></Icon>,
  portal: (p) => <Icon {...p}><rect x="4" y="4" width="16" height="16" rx="2"/><path d="M4 9h16M9 9v11"/></Icon>,
  stack: (p) => <Icon {...p}><path d="m12 3 9 5-9 5-9-5 9-5Z"/><path d="m3 13 9 5 9-5M3 18l9 5 9-5"/></Icon>,

  // agents
  agent: (p) => <Icon {...p}><circle cx="12" cy="8" r="4"/><rect x="4" y="14" width="16" height="8" rx="2"/><path d="M8 18h.01M16 18h.01"/></Icon>,
  compass: (p) => <Icon {...p}><circle cx="12" cy="12" r="9"/><path d="m15 9-4 2-2 4 4-2 2-4Z"/></Icon>,
  scroll: (p) => <Icon {...p}><path d="M8 3h9a2 2 0 0 1 2 2v12M8 3a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2v-2H8"/><path d="M5 9H3"/></Icon>,

  // ui
  search: (p) => <Icon {...p}><circle cx="11" cy="11" r="7"/><path d="m20 20-3.5-3.5"/></Icon>,
  attach: (p) => <Icon {...p}><path d="M21 12.5 12.5 21a5 5 0 0 1-7-7l9-9a3.5 3.5 0 0 1 5 5l-9 9a2 2 0 0 1-3-3l8.5-8.5"/></Icon>,
  paperclip: (p) => <Icon {...p}><path d="M21 12.5 12.5 21a5 5 0 0 1-7-7l9-9a3.5 3.5 0 0 1 5 5l-9 9a2 2 0 0 1-3-3l8.5-8.5"/></Icon>,
  at: (p) => <Icon {...p}><circle cx="12" cy="12" r="4"/><path d="M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8"/></Icon>,
  menu: (p) => <Icon {...p}><path d="M4 6h16M4 12h16M4 18h16"/></Icon>,
  dot: (p) => <Icon {...p} fill="currentColor" stroke="none"><circle cx="12" cy="12" r="4"/></Icon>,
  sun: (p) => <Icon {...p}><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4.2 4.2l1.4 1.4M18.4 18.4l1.4 1.4M2 12h2M20 12h2M4.2 19.8l1.4-1.4M18.4 5.6l1.4-1.4"/></Icon>,
  moon: (p) => <Icon {...p}><path d="M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8Z"/></Icon>,
  settings: (p) => <Icon {...p}><circle cx="12" cy="12" r="3"/><path d="M12 2v3M12 19v3M4.2 4.2l2.1 2.1M17.7 17.7l2.1 2.1M2 12h3M19 12h3M4.2 19.8l2.1-2.1M17.7 6.3l2.1-2.1"/></Icon>,
  tag: (p) => <Icon {...p}><path d="M20 12 12 20 3 11V3h8l9 9Z"/><circle cx="8" cy="8" r="1.5" fill="currentColor"/></Icon>,
  target: (p) => <Icon {...p}><circle cx="12" cy="12" r="9"/><circle cx="12" cy="12" r="5"/><circle cx="12" cy="12" r="1.5" fill="currentColor"/></Icon>,
  inbox: (p) => <Icon {...p}><path d="M3 13h5l2 3h4l2-3h5"/><path d="M4 13 6 5h12l2 8v6a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-6Z"/></Icon>,
  circleDash: (p) => <Icon {...p} strokeDasharray="3 3"><circle cx="12" cy="12" r="9"/></Icon>,
  spin: (p) => <Icon {...p}><path d="M12 3a9 9 0 1 0 9 9"/></Icon>,
  block: (p) => <Icon {...p}><circle cx="12" cy="12" r="9"/><path d="m5.5 5.5 13 13"/></Icon>,
  package: (p) => <Icon {...p}><path d="m12 3 9 5v8l-9 5-9-5V8l9-5Z"/><path d="m3 8 9 5 9-5M12 13v10"/></Icon>,
  clock: (p) => <Icon {...p}><circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/></Icon>,

  // misc
  external: (p) => <Icon {...p}><path d="M15 3h6v6M10 14 21 3M21 14v5a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5"/></Icon>,
  play: (p) => <Icon {...p} fill="currentColor" stroke="none"><path d="M7 4v16l13-8Z"/></Icon>,
  pause: (p) => <Icon {...p} fill="currentColor" stroke="none"><rect x="6" y="4" width="4" height="16"/><rect x="14" y="4" width="4" height="16"/></Icon>,
  copy: (p) => <Icon {...p}><rect x="8" y="8" width="12" height="12" rx="2"/><path d="M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2"/></Icon>,
};

window.I = I;
window.Icon = Icon;
