// Lucide-style line icons for Nodestone cards.
// One component, name-keyed. 24×24, currentColor strokes.

(function () {
  const SVG_PROPS = {
    width: 22,
    height: 22,
    viewBox: "0 0 24 24",
    fill: "none",
    stroke: "currentColor",
    strokeWidth: 1.5,
    strokeLinecap: "round",
    strokeLinejoin: "round",
  };

  const PATHS = {
    // — Problems —
    stack: (
      <g>
        <path d="M12 3 3 7.5l9 4.5 9-4.5z" />
        <path d="M3 12.5l9 4.5 9-4.5" />
        <path d="M3 17l9 4.5 9-4.5" />
      </g>
    ),
    gauge: (
      <g>
        <path d="M4 17a8 8 0 1 1 16 0" />
        <path d="M12 17l4-4" />
        <circle cx="12" cy="17" r="1.2" fill="currentColor" stroke="none" />
      </g>
    ),
    expand: (
      <g>
        <path d="M3 9V3h6" />
        <path d="M21 9V3h-6" />
        <path d="M3 15v6h6" />
        <path d="M21 15v6h-6" />
        <path d="M9 12h6" />
      </g>
    ),

    // — Process —
    search: (
      <g>
        <circle cx="11" cy="11" r="7" />
        <path d="m21 21-4.3-4.3" />
      </g>
    ),
    shield: (
      <g>
        <path d="M12 3 4 6v6c0 4.5 3.4 8 8 9 4.6-1 8-4.5 8-9V6z" />
        <path d="m9 12 2 2 4-4" />
      </g>
    ),
    wrench: (
      <g>
        <path d="M14.5 4.5a4 4 0 0 1 4 6.3l-12 12-3-3 12-12a4 4 0 0 1-1-3.3z" />
        <path d="m14.5 4.5 3 3" />
      </g>
    ),
    book: (
      <g>
        <path d="M12 7c-1.5-1-3.5-1.5-6-1.5H3v13h3c2.5 0 4.5.5 6 1.5" />
        <path d="M12 7c1.5-1 3.5-1.5 6-1.5h3v13h-3c-2.5 0-4.5.5-6 1.5" />
        <path d="M12 7v13" />
      </g>
    ),

    // — Contact: what to expect —
    send: (
      <g>
        <path d="M22 2 11 13" />
        <path d="M22 2 15 22l-4-9-9-4z" />
      </g>
    ),
    chat: (
      <g>
        <path d="M21 11.5a8 8 0 0 1-3.5 6.6L17 21l-3.5-2a8 8 0 0 1-9.5-7.5 8 8 0 0 1 16 0z" />
      </g>
    ),
    route: (
      <g>
        <circle cx="6" cy="19" r="2" />
        <circle cx="18" cy="5" r="2" />
        <path d="M6 17V9a4 4 0 0 1 4-4h6" />
        <path d="m14 3 2 2-2 2" />
      </g>
    ),

    // — About: principles —
    terminal: (
      <g>
        <rect x="3" y="4" width="18" height="16" rx="2" />
        <path d="m7 9 3 3-3 3" />
        <path d="M13 15h4" />
      </g>
    ),
    speech: (
      <g>
        <path d="M4 5h16v11H9l-5 4z" />
      </g>
    ),
    calendarClock: (
      <g>
        <rect x="3" y="5" width="18" height="16" rx="2" />
        <path d="M16 3v4M8 3v4M3 11h18" />
        <path d="M16 16v1l1 1" />
        <circle cx="16" cy="16" r="3.5" />
      </g>
    ),
    diamond: (
      <g>
        <path d="m12 3 9 9-9 9-9-9z" />
        <path d="M12 8v8M8 12h8" />
      </g>
    ),

    // — Modes —
    compass: (
      <g>
        <circle cx="12" cy="12" r="9" />
        <path d="m15.5 8.5-2 5-5 2 2-5z" />
      </g>
    ),
    rocket: (
      <g>
        <path d="M4.5 16.5 3 21l4.5-1.5" />
        <path d="M14 13.5 10.5 10 5 14l1 4 4 1 4-5.5z" />
        <path d="M14 13.5c4-1.5 6-4.5 6-9 0-.5 0-1-.5-1-4.5 0-7.5 2-9 6" />
        <circle cx="14.5" cy="9.5" r="1.5" />
      </g>
    ),
    handshake: (
      <g>
        <path d="m11 17 4-4 3 3-2 2a2 2 0 0 1-3 0z" />
        <path d="M11 17l-1 1a2 2 0 0 1-3-3l1-1" />
        <path d="m3 12 5-5 4 4" />
        <path d="m21 12-5-5-4 4" />
      </g>
    ),

    // — UI —
    x: (
      <g>
        <path d="M18 6 6 18M6 6l12 12" />
      </g>
    ),

    // — Workshop bench —
    cube: (
      <g>
        <path d="M21 8.5 12 3 3 8.5 12 14l9-5.5z" />
        <path d="M3 8.5v7L12 21l9-5.5v-7" />
        <path d="M12 14v7" />
      </g>
    ),
    pencil: (
      <g>
        <path d="m18 2 4 4-14 14H4v-4z" />
        <path d="m14 6 4 4" />
      </g>
    ),
    bulb: (
      <g>
        <path d="M9 18h6" />
        <path d="M10 21h4" />
        <path d="M12 3a6 6 0 0 0-4 10.5c1 1 1.5 2 1.5 3.5h5c0-1.5.5-2.5 1.5-3.5A6 6 0 0 0 12 3z" />
      </g>
    ),
  };

  function Icon({ name, size = 22, strokeWidth = 1.5, className = "", style }) {
    const props = { ...SVG_PROPS, width: size, height: size, strokeWidth, className, style };
    const body = PATHS[name];
    if (!body) return null;
    return <svg {...props} aria-hidden="true">{body}</svg>;
  }

  window.Icon = Icon;
})();
