// Single source of truth for the docs sidebar AND the node card grids, the
// per-node "Related Nodes" chips, and the in-page search index. Add a node =
// add one entry here. Nothing else to edit.
//
// Each node item carries:
//   label   — display name (sidebar link + card heading)
//   href    — docs-root-relative path (e.g. 'nodes/actions/zip.html')
//   icon    — SF-Symbol-style keyword shown in the card chip (omit for nodes
//             whose card uses a colored dot instead of a chip)
//   desc    — one-line description (card body + search)
//   related — array of node-id basenames (filename without .html); the renderer
//             maps each back to its full href via a global id->href lookup
//
// Card grids (nodes/<cat>/index.html), Related-Nodes chips, and the sidebar
// search index are all DERIVED from this file by shared/sidebar.js.
// 'Overview' items (href ending index.html) are NOT nodes — they carry none of
// icon/desc/related.
window.WATCHFLOWS_NAV = {
  gettingStarted: [
    { label: 'Overview', href: 'index.html' },
    { label: 'Getting Started', href: 'getting-started.html' }
  ],
  concepts: [
    { label: 'Home Page', href: 'concepts/home-page.html' },
    { label: 'Folders & Favorites', href: 'concepts/folders-favorites.html' },
    { label: 'Payloads', href: 'concepts/payloads.html' },
    { label: 'Port Types', href: 'concepts/port-types.html' },
    { label: 'Execution Model', href: 'concepts/execution.html' },
    { label: 'Canvas Operations', href: 'concepts/canvas-operations.html' },
    { label: 'Triggers Panel', href: 'concepts/triggers-panel.html' },
    { label: 'AI Providers', href: 'concepts/ai-providers.html' },
    { label: 'AI Flow Builder', href: 'concepts/flow-builder.html' },
    { label: 'AI Agents (MCP)', href: 'concepts/ai-agents.html' },
    { label: 'Destructive Actions', href: 'concepts/destructive-actions.html' },
    { label: 'Importing & Exporting', href: 'concepts/importing-exporting.html' }
  ],
  categories: [
    {
      id: 'triggers',
      label: 'Triggers',
      dot: 'bg-trigger',
      count: 11,
      items: [
        { label: 'Overview', href: 'nodes/triggers/index.html' },
        { label: 'File Changed', href: 'nodes/triggers/file-changed.html', icon: '📄', desc: 'Fires when a specific file is created, modified, or deleted.', related: ['directory-changed', 'notification', 'script', 'compare'] },
        { label: 'Directory Changed', href: 'nodes/triggers/directory-changed.html', icon: '📁', desc: 'Fires when files change in a watched directory.', related: ['file-changed', 'move-file', 'compare', 'notification'] },
        { label: 'Photo Added', href: 'nodes/triggers/photo-added.html', icon: '🖼️', desc: 'Fires when a new photo is added to the Photos library, including iCloud and iPhone syncs.', related: ['extract-image-metadata', 'extract-text-ocr', 'directory-changed', 'prompt', 'apple-notes', 'notification'] },
        { label: 'Schedule', href: 'nodes/triggers/schedule.html', icon: '⏰', desc: 'Fires on a time-based schedule at configurable intervals.', related: ['api-request', 'script', 'notification'] },
        { label: 'App Event', href: 'nodes/triggers/app-event.html', icon: '🪟', desc: 'Fires when an application launches, quits, or activates.', related: ['log-to-file', 'notification', 'script', 'system-event'] },
        { label: 'Webhook', href: 'nodes/triggers/webhook.html', icon: '🪝', desc: 'Fires when an HTTP request is received on a local endpoint.', related: ['api-request', 'template', 'notification', 'input'] },
        { label: 'Clipboard Changed', href: 'nodes/triggers/clipboard.html', icon: '📋', desc: 'Fires when the clipboard content changes.', related: ['copy-to-clipboard', 'prompt', 'notification', 'keyboard-shortcut'] },
        { label: 'Input', href: 'nodes/triggers/input.html', icon: '✍️', desc: 'Manual trigger with user-defined text, JSON, or file input.', related: ['webhook', 'prompt', 'script', 'template'] },
        { label: 'System Event', href: 'nodes/triggers/system-event.html', icon: '⚙️', desc: 'Fires on macOS system events like sleep, wake, lock, network, volume, or Bluetooth device changes.', related: ['device-event', 'app-event', 'script', 'compare'] },
        { label: 'Device Event', href: 'nodes/triggers/device-event.html', icon: '🔌', desc: 'Fires when USB devices, displays, or audio devices connect or disconnect.', related: ['system-event', 'script', 'notification', 'compare'] },
        { label: 'Keyboard Shortcut', href: 'nodes/triggers/keyboard-shortcut.html', icon: '⌨️', desc: 'Fires when a keyboard shortcut is pressed.', related: ['clipboard', 'simulate-keys', 'copy-to-clipboard', 'prompt'] }
      ]
    },
    {
      id: 'emitters',
      label: 'Emitters',
      dot: 'bg-emitter',
      count: 2,
      items: [
        { label: 'Overview', href: 'nodes/emitters/index.html' },
        { label: 'Resource Monitor', href: 'nodes/emitters/resource-monitor.html', icon: '📊', desc: 'Streams CPU, memory, disk, and battery metrics from your Mac.', related: ['process', 'compare', 'time-series'] },
        { label: 'Process Monitor', href: 'nodes/emitters/process.html', icon: '🛠️', desc: 'Streams per-application CPU and memory usage for a specific app.', related: ['resource-monitor', 'compare', 'notification'] }
      ]
    },
    {
      id: 'conditions',
      label: 'Conditions',
      dot: 'bg-condition',
      count: 1,
      items: [
        { label: 'Overview', href: 'nodes/conditions/index.html' },
        { label: 'Compare', href: 'nodes/conditions/compare.html', icon: '⚖️', desc: 'Evaluate a condition against the incoming payload and route execution to either the Yes or No outlet. Supports equals, contains, regex, and more.', related: ['template', 'for-each', 'prompt'] }
      ]
    },
    {
      id: 'transformers',
      label: 'Transformers',
      dot: 'bg-transformer',
      count: 8,
      items: [
        { label: 'Overview', href: 'nodes/transformers/index.html' },
        { label: 'For Each', href: 'nodes/transformers/for-each.html', icon: '🔄', desc: 'Iterate over an array, executing downstream nodes once per item.', related: [] },
        { label: 'While', href: 'nodes/transformers/while.html', icon: '🔁', desc: 'Repeat loop body until a condition is met, with configurable iteration limits.', related: [] },
        { label: 'Template', href: 'nodes/transformers/template.html', icon: '📝', desc: 'Interpolate payload values into text using {{key}} syntax.', related: [] },
        { label: 'Math', href: 'nodes/transformers/math.html', icon: '𝑓', desc: 'Perform arithmetic on payload values using mathematical expressions.', related: [] },
        { label: 'Map Keys', href: 'nodes/transformers/map-keys.html', icon: '⇄', desc: 'Rename, extract, or reshape payload keys to match downstream expectations.', related: [] },
        { label: 'Extract Text (OCR)', href: 'nodes/transformers/extract-text-ocr.html', icon: '🔍', desc: 'Run on-device Vision OCR on an image and output the recognized text.', related: [] },
        { label: 'Image Metadata', href: 'nodes/transformers/extract-image-metadata.html', icon: '📷', desc: 'Extract EXIF metadata — date taken, camera, lens, GPS — from an image for {{exif.*}} templates.', related: ['photo-added', 'extract-text-ocr', 'rename-file'] },
        { label: 'Extract Text (PDF)', href: 'nodes/transformers/extract-text-pdf.html', icon: '📄', desc: 'Extract text from any PDF — born-digital or scanned (auto OCR) — and optionally render page images for AI vision.', related: [] }
      ]
    },
    {
      id: 'actions',
      label: 'Actions',
      dot: 'bg-action',
      count: 23,
      items: [
        { label: 'Overview', href: 'nodes/actions/index.html' },
        { label: 'Run Watchflow', href: 'nodes/actions/run-watchflow.html', icon: '🔀', desc: 'Run up to 3 other saved flows inline, with each result merged back under {{flow_1.result}}, {{flow_2.result}}, and so on.', related: ['script', 'set-value', 'notification', 'agent'] },
        { label: 'Run Script', href: 'nodes/actions/script.html', icon: '🖥️', desc: 'Execute a shell script in Bash, Zsh, or Python with full payload access.', related: ['api-request', 'write-file', 'simulate-keys'] },
        { label: 'Notification', href: 'nodes/actions/notification.html', icon: '🔔', desc: 'Show a macOS notification with optional click-through URL.', related: ['open-url'] },
        { label: 'API Request', href: 'nodes/actions/api-request.html', icon: '🌐', desc: 'Make HTTP requests with full auth support: Basic, Bearer, and API Key.', related: ['script', 'notification', 'log-to-file'] },
        { label: 'Delay', href: 'nodes/actions/delay.html', icon: '⏳', desc: 'Pause workflow execution for a configurable number of seconds.', related: ['api-request', 'script'] },
        { label: 'Keep Mac Awake', href: 'nodes/actions/keep-mac-awake.html', icon: '☕️', desc: 'Prevent your Mac from sleeping until released (or an optional timeout).', related: ['allow-sleep', 'delay', 'script'] },
        { label: 'Allow Sleep', href: 'nodes/actions/allow-sleep.html', icon: '🌙', desc: 'Release any active Keep Mac Awake holds and let the Mac sleep normally.', related: ['keep-mac-awake', 'delay'] },
        { label: 'Bluetooth Scan', href: 'nodes/actions/bluetooth-scan.html', icon: '📡', desc: 'Read which Bluetooth devices your Mac is connected to (and optionally paired-but-offline) and check a target for a plain true/false.', related: ['system-event', 'compare', 'notification'] },
        { label: 'Copy to Clipboard', href: 'nodes/actions/copy-to-clipboard.html', icon: '📋', desc: 'Copy text or a file reference to the macOS clipboard.', related: ['set-value', 'write-file', 'notification'] },
        { label: 'Log to File', href: 'nodes/actions/log-to-file.html', icon: '🧾', desc: 'Append structured lines to a log file in JSONL, text, or CSV format.', related: ['write-file', 'notification', 'api-request'] },
        { label: 'User Input', href: 'nodes/actions/user-input.html', icon: '💬', desc: 'Show a popup dialog to collect text, file paths, or choices from the user.', related: ['set-value', 'move-file', 'notification'] },
        { label: 'Set Value', href: 'nodes/actions/set-value.html', icon: '🏷️', desc: 'Inject or override a payload variable with a typed value.', related: ['user-input', 'copy-to-clipboard'] },
        { label: 'Open URL', href: 'nodes/actions/open-url.html', icon: '🔗', desc: 'Open a URL in the default web browser.', related: ['open-file', 'notification', 'api-request'] },
        { label: 'Open File', href: 'nodes/actions/open-file.html', icon: '📂', desc: 'Open a file in its default application via macOS Launch Services.', related: ['open-url', 'move-file', 'write-file'] },
        { label: 'Move File', href: 'nodes/actions/move-file.html', icon: '🚚', desc: 'Move or copy a file to a new destination path.', related: ['rename-file', 'write-file', 'open-file'] },
        { label: 'Rename File', href: 'nodes/actions/rename-file.html', icon: '📛', desc: 'Rename a file in place — change its name without moving it.', related: ['move-file', 'extract-image-metadata', 'write-file', 'open-file'] },
        { label: 'Move to Trash', href: 'nodes/actions/move-to-trash.html', icon: '🗑️', desc: 'Move a file to the macOS Trash (recoverable)', related: ['write-file', 'open-file', 'user-input'] },
        { label: 'Delete File', href: 'nodes/actions/delete-file.html', icon: '❌', desc: 'Permanently delete a file (irreversible — prefer Move to Trash for safer flows)', related: ['move-to-trash', 'move-file', 'write-file'] },
        { label: 'Zip', href: 'nodes/actions/zip.html', icon: '🗜️', desc: 'Compress a file or folder into a .zip archive.', related: ['unzip', 'move-file', 'write-file'] },
        { label: 'Unzip', href: 'nodes/actions/unzip.html', icon: '📦', desc: 'Extract a .zip and fan out over its files.', related: ['zip', 'extract-text-pdf', 'for-each', 'move-file'] },
        { label: 'Write File', href: 'nodes/actions/write-file.html', icon: '✏️', desc: 'Write or append text content to a file on disk.', related: ['log-to-file', 'move-file', 'open-file'] },
        { label: 'Simulate Key Press', href: 'nodes/actions/simulate-keys.html', icon: '⌨️', desc: 'Simulate a keyboard shortcut to control other applications.', related: ['script', 'open-url', 'delay'] },
        { label: 'Apple Notes', href: 'nodes/actions/apple-notes.html', icon: '📒', desc: 'Create, search, or append to notes in Apple Notes via AppleScript.', related: ['write-file', 'apple-music', 'notification'] },
        { label: 'Apple Reminders', href: 'nodes/actions/apple-reminders.html', icon: '✅', desc: 'Create, list, and complete reminders in Apple Reminders', related: ['apple-notes', 'notification', 'agent'] },
        { label: 'Apple Music', href: 'nodes/actions/apple-music.html', icon: '🎵', desc: 'Control Apple Music playback: search, play, pause, skip tracks.', related: ['apple-notes'] }
      ]
    },
    {
      id: 'ai',
      label: 'AI',
      dot: 'bg-ai',
      count: 2,
      items: [
        { label: 'Overview', href: 'nodes/ai/index.html' },
        { label: 'AI Prompt', href: 'nodes/ai/prompt.html', icon: '🧠', desc: 'Send a prompt to an AI model and get a response. Supports structured JSON output with schema validation.', related: ['agent', 'template', 'compare'] },
        { label: 'Agent', href: 'nodes/ai/agent.html', icon: '🧑‍💻', desc: 'Autonomous agent that reasons, plans, and uses tools iteratively to accomplish complex goals.', related: ['prompt', 'script', 'api-request'] }
      ]
    },
    {
      id: 'utilities',
      label: 'Utilities',
      dot: 'bg-utility',
      count: 7,
      items: [
        { label: 'Overview', href: 'nodes/utilities/index.html' },
        { label: 'Breakpoint', href: 'nodes/utilities/breakpoint.html', icon: '⏸︎', desc: 'Pause execution until manually resumed. Inspect payloads at any point in your workflow.', related: [] },
        { label: 'Note', href: 'nodes/utilities/note.html', icon: '🗒︎', desc: 'Sticky note for canvas annotations. Purely visual, no connections.', related: [] },
        { label: 'JSON Viewer', href: 'nodes/utilities/json-viewer.html', icon: '⌨︎', desc: 'Display incoming payload as a collapsible JSON tree directly on the canvas.', related: [] },
        { label: 'File Log', href: 'nodes/utilities/file-log.html', icon: '🔍︎', desc: 'Display log file contents in a terminal-style viewer on the canvas.', related: [] },
        { label: 'Time Series', href: 'nodes/utilities/time-series.html', icon: '📈︎', desc: 'Display streaming numeric data as a live line chart on the canvas.', related: [] },
        { label: 'Log', href: 'nodes/utilities/log.html', icon: '📄︎', desc: 'Log payload to the execution timeline for inspection.', related: [] },
        { label: 'Timer', href: 'nodes/utilities/timer.html', icon: '⏱︎', desc: 'Start or stop a named timer to measure execution duration between nodes.', related: [] }
      ]
    }
  ]
};
