{"version":3,"file":"index.cjs","names":["initialState?: Partial<CircuitState>","prevState: CircuitState","updater: (prev: CircuitState) => CircuitState","prefix: string","component: Omit<ComponentInstance, 'id'>","id: string","updates: Partial<ComponentInstance>","from: Wire['from']","to: Wire['to']","style?: Wire['style']","updates: Partial<Wire>","addToSelection: boolean","newPosition: Point","dx: number","dy: number","degrees: number","componentId: string","portId: string","toComponentId: string","toPortId: string","fromId: string","fromPortId: string","toId: string","actions: CircuitActions","wire: Wire | null","deps: any[]","componentId: string | null","portId: string | null","HeadlessPropertyPanel: React.FC<HeadlessPropertyPanelProps>","key: string","event: React.ChangeEvent<HTMLInputElement | HTMLSelectElement>","value: any","PropertyPanel: React.FC<PropertyPanelProps>","rootStyle: CSSProperties","defaultStyles: Record<string, CSSProperties>","HeadlessPropertyPanel","HeadlessComponentPalette: React.FC<HeadlessComponentPaletteProps>","HeadlessComponentListItem: React.FC<HeadlessComponentListItemProps>","event: React.DragEvent","ComponentPalette: React.FC<ComponentPaletteProps>","rootStyle: CSSProperties","defaultStyles: Record<string, CSSProperties>","HeadlessComponentPalette","HeadlessCircuitToolbar: React.FC<HeadlessCircuitToolbarProps>","CircuitToolbar: React.FC<CircuitToolbarProps>","rootStyle: CSSProperties","defaultStyles: Record<string, CSSProperties>","HeadlessCircuitToolbar","SimpleCircuitExample: React.FC","id: string","key: string","value: any","componentType: string","action: string","CircuitToolbar","ComponentPalette","CircuitCanvas","PropertyPanel","InteractiveCircuitExample: React.FC","componentType: string","position: Point","action: string","id: string","key: string","value: any","componentId: string","portId: string","event: React.MouseEvent","CircuitToolbar","ComponentPalette","CircuitCanvas","PropertyPanel","VoltageRegulatorExample: React.FC","CircuitCanvas","TimerCircuitExample: React.FC","CircuitCanvas","componentCountByCategory: Record<string, number>","componentNames: Record<string, string>","componentDescriptions: Record<string, string>","component: ComponentSchema"],"sources":["../../src/hooks/useCircuit.ts","../../src/hooks/usePortPosition.ts","../../src/ui/headless/HeadlessPropertyPanel.tsx","../../src/ui/PropertyPanel.tsx","../../src/ui/headless/HeadlessComponentPalette.tsx","../../src/ui/ComponentPalette.tsx","../../src/ui/headless/HeadlessCircuitToolbar.tsx","../../src/ui/CircuitToolbar.tsx","../../src/examples/SimpleCircuitExample.tsx","../../src/examples/InteractiveCircuitExample.tsx","../../src/examples/VoltageRegulatorExample.tsx","../../src/examples/TimerCircuitExample.tsx","../../src/registry/metadata.ts","../../src/index.ts"],"sourcesContent":["/**\n * useCircuit Hook\n *\n * A React hook for managing circuit state and operations. Provides a complete\n * state management solution for circuit components and wires, with support for\n * selection, wire drawing, and undo/redo functionality.\n *\n * @returns {[CircuitState, CircuitActions]} A tuple containing the current circuit state and actions to modify it\n *\n * @example\n * const [state, actions] = useCircuit();\n *\n * // Add a new component\n * const resistorId = actions.addComponent({\n *   type: 'resistor',\n *   position: { x: 100, y: 100 },\n *   props: { resistance: 1000 }\n * });\n *\n * // Connect components with a wire\n * actions.addWire(\n *   { componentId: resistorId, portId: 'left' },\n *   { componentId: 'battery-1', portId: 'positive' }\n * );\n *\n * // Access current state\n * console.log(state.components, state.wires);\n */\n\nimport { useState, useCallback, useRef } from 'react';\nimport { ComponentInstance, Wire, CircuitState, Point } from '../schemas/componentSchema';\nimport { getComponentSchema } from '../registry';\n\nexport interface CircuitActions {\n  /** Adds a new component to the circuit and returns its generated ID */\n  addComponent: (component: Omit<ComponentInstance, 'id'>) => string;\n\n  /** Updates properties of an existing component */\n  updateComponent: (id: string, updates: Partial<ComponentInstance>) => void;\n\n  /** Removes a component from the circuit */\n  removeComponent: (id: string) => void;\n\n  /** Adds a new wire between two ports and returns its generated ID */\n  addWire: (from: Wire['from'], to: Wire['to'], style?: Wire['style']) => string;\n\n  /** Updates properties of an existing wire */\n  updateWire: (id: string, updates: Partial<Wire>) => void;\n\n  /** Removes a wire from the circuit */\n  removeWire: (id: string) => void;\n\n  /** Selects a component, optionally adding to the current selection */\n  selectComponent: (id: string, addToSelection?: boolean) => void;\n\n  /** Selects a wire, optionally adding to the current selection */\n  selectWire: (id: string, addToSelection?: boolean) => void;\n\n  /** Deselects all currently selected components and wires */\n  deselectAll: () => void;\n\n  /** Returns an array of currently selected components */\n  getSelectedComponents: () => ComponentInstance[];\n\n  /** Returns an array of currently selected wires */\n  getSelectedWires: () => Wire[];\n\n  /** Moves a component to a new position */\n  moveComponent: (id: string, newPosition: Point) => void;\n\n  /** Moves all currently selected components by a delta */\n  moveSelectedComponents: (dx: number, dy: number) => void;\n\n  /** Starts the process of drawing a wire from a component port */\n  startWireDrawing: (componentId: string, portId: string) => void;\n\n  /** Completes the wire drawing process, connecting to another port */\n  completeWireDrawing: (componentId: string, portId: string) => boolean;\n\n  /** Cancels the wire drawing process */\n  cancelWireDrawing: () => void;\n\n  /** Checks if a connection between two ports is valid */\n  isValidConnection: (fromId: string, fromPortId: string, toId: string, toPortId: string) => boolean;\n\n  /** Rotates a component by the specified degrees */\n  rotateComponent: (id: string, degrees: number) => void;\n\n  /** Rotates all currently selected components by the specified degrees */\n  rotateSelectedComponents: (degrees: number) => void;\n\n  /** Undoes the last action */\n  undo: () => void;\n\n  /** Redoes the last undone action */\n  redo: () => void;\n\n  /** Checks if an undo action is possible */\n  canUndo: () => boolean;\n\n  /** Checks if a redo action is possible */\n  canRedo: () => boolean;\n}\n\n/**\n * React hook for managing circuit state\n *\n * @param initialState - Optional initial state for the circuit\n * @returns A tuple containing the circuit state and action functions\n */\nexport function useCircuit(initialState?: Partial<CircuitState>): [CircuitState, CircuitActions] {\n  // History for undo/redo\n  const undoStack = useRef<CircuitState[]>([]);\n  const redoStack = useRef<CircuitState[]>([]);\n\n  const [state, setState] = useState<CircuitState>({\n    components: initialState?.components || [],\n    wires: initialState?.wires || [],\n    selectedComponentIds: initialState?.selectedComponentIds || [],\n    selectedWireIds: initialState?.selectedWireIds || []\n  });\n\n  // Helper to save state for undo\n  const saveStateForUndo = useCallback((prevState: CircuitState) => {\n    undoStack.current.push(JSON.parse(JSON.stringify(prevState)));\n    // Clear redo stack when a new action is performed\n    redoStack.current = [];\n  }, []);\n\n  // Wrapped setState with history tracking\n  const setStateWithHistory = useCallback((updater: (prev: CircuitState) => CircuitState) => {\n    setState(prev => {\n      // Save the current state for undoing\n      saveStateForUndo(prev);\n      // Apply the update\n      return updater(prev);\n    });\n  }, [saveStateForUndo]);\n\n  // Generate a unique ID for new components/wires\n  const generateId = useCallback((prefix: string): string => {\n    return `${prefix}-${Math.random().toString(36).substring(2, 11)}`;\n  }, []);\n\n  // Add a component\n  const addComponent = useCallback((component: Omit<ComponentInstance, 'id'>): string => {\n    const id = generateId('component');\n    setStateWithHistory(prev => ({\n      ...prev,\n      components: [...prev.components, { ...component, id }]\n    }));\n    return id;\n  }, [generateId, setStateWithHistory]);\n\n  // Update a component\n  const updateComponent = useCallback((id: string, updates: Partial<ComponentInstance>): void => {\n    setStateWithHistory(prev => ({\n      ...prev,\n      components: prev.components.map(c =>\n        c.id === id ? { ...c, ...updates } : c\n      )\n    }));\n  }, [setStateWithHistory]);\n\n  // Remove a component\n  const removeComponent = useCallback((id: string): void => {\n    setStateWithHistory(prev => {\n      // Remove the component\n      const components = prev.components.filter(c => c.id !== id);\n\n      // Remove any wires connected to this component\n      const wires = prev.wires.filter(w =>\n        w.from.componentId !== id && w.to.componentId !== id\n      );\n\n      // Remove from selection if selected\n      const selectedComponentIds = prev.selectedComponentIds.filter(selectedId => selectedId !== id);\n\n      return {\n        ...prev,\n        components,\n        wires,\n        selectedComponentIds\n      };\n    });\n  }, [setStateWithHistory]);\n\n  // Add a wire\n  const addWire = useCallback((from: Wire['from'], to: Wire['to'], style?: Wire['style']): string => {\n    const id = generateId('wire');\n    setStateWithHistory(prev => ({\n      ...prev,\n      wires: [...prev.wires, { id, from, to, style }]\n    }));\n    return id;\n  }, [generateId, setStateWithHistory]);\n\n  // Update a wire\n  const updateWire = useCallback((id: string, updates: Partial<Wire>): void => {\n    setStateWithHistory(prev => ({\n      ...prev,\n      wires: prev.wires.map(w =>\n        w.id === id ? { ...w, ...updates } : w\n      )\n    }));\n  }, [setStateWithHistory]);\n\n  // Remove a wire\n  const removeWire = useCallback((id: string): void => {\n    setStateWithHistory(prev => ({\n      ...prev,\n      wires: prev.wires.filter(w => w.id !== id),\n      selectedWireIds: prev.selectedWireIds.filter(wireId => wireId !== id)\n    }));\n  }, [setStateWithHistory]);\n\n  // Select a component\n  const selectComponent = useCallback((id: string, addToSelection: boolean = false): void => {\n    setState(prev => {\n      // If adding to selection, keep previous selections, otherwise start fresh\n      const selectedComponentIds = addToSelection\n        ? [...prev.selectedComponentIds, id]\n        : [id];\n\n      return {\n        ...prev,\n        selectedComponentIds: [...new Set(selectedComponentIds)] // Deduplicate\n      };\n    });\n  }, []);\n\n  // Select a wire\n  const selectWire = useCallback((id: string, addToSelection: boolean = false): void => {\n    setState(prev => {\n      // If adding to selection, keep previous selections, otherwise start fresh\n      const selectedWireIds = addToSelection\n        ? [...prev.selectedWireIds, id]\n        : [id];\n\n      return {\n        ...prev,\n        selectedWireIds: [...new Set(selectedWireIds)] // Deduplicate\n      };\n    });\n  }, []);\n\n  // Deselect all components and wires\n  const deselectAll = useCallback((): void => {\n    setState(prev => ({\n      ...prev,\n      selectedComponentIds: [],\n      selectedWireIds: []\n    }));\n  }, []);\n\n  // Get selected components\n  const getSelectedComponents = useCallback((): ComponentInstance[] => {\n    return state.components.filter(c =>\n      state.selectedComponentIds.includes(c.id)\n    );\n  }, [state.components, state.selectedComponentIds]);\n\n  // Get selected wires\n  const getSelectedWires = useCallback((): Wire[] => {\n    return state.wires.filter(w =>\n      state.selectedWireIds.includes(w.id)\n    );\n  }, [state.wires, state.selectedWireIds]);\n\n  // Move a component to a new position\n  const moveComponent = useCallback((id: string, newPosition: Point): void => {\n    setStateWithHistory(prev => ({\n      ...prev,\n      components: prev.components.map(c =>\n        c.id === id ? { ...c, position: newPosition } : c\n      )\n    }));\n  }, [setStateWithHistory]);\n\n  // Move all selected components by a delta\n  const moveSelectedComponents = useCallback((dx: number, dy: number): void => {\n    setStateWithHistory(prev => ({\n      ...prev,\n      components: prev.components.map(c => {\n        if (prev.selectedComponentIds.includes(c.id)) {\n          return {\n            ...c,\n            position: {\n              x: c.position.x + dx,\n              y: c.position.y + dy\n            }\n          };\n        }\n        return c;\n      })\n    }));\n  }, [setStateWithHistory]);\n\n  // Rotate a component by the specified degrees\n  const rotateComponent = useCallback((id: string, degrees: number): void => {\n    setStateWithHistory(prev => ({\n      ...prev,\n      components: prev.components.map(c => {\n        if (c.id === id) {\n          // Calculate new rotation, normalizing between 0-359\n          const currentRotation = c.rotation || 0;\n          const newRotation = (currentRotation + degrees) % 360;\n          return {\n            ...c,\n            rotation: newRotation < 0 ? newRotation + 360 : newRotation\n          };\n        }\n        return c;\n      })\n    }));\n  }, [setStateWithHistory]);\n\n  // Rotate all selected components\n  const rotateSelectedComponents = useCallback((degrees: number): void => {\n    setStateWithHistory(prev => ({\n      ...prev,\n      components: prev.components.map(c => {\n        if (prev.selectedComponentIds.includes(c.id)) {\n          // Calculate new rotation, normalizing between 0-359\n          const currentRotation = c.rotation || 0;\n          const newRotation = (currentRotation + degrees) % 360;\n          return {\n            ...c,\n            rotation: newRotation < 0 ? newRotation + 360 : newRotation\n          };\n        }\n        return c;\n      })\n    }));\n  }, [setStateWithHistory]);\n\n  // Undo the last action\n  const undo = useCallback((): void => {\n    if (undoStack.current.length > 0) {\n      // Save current state to redo stack\n      redoStack.current.push(JSON.parse(JSON.stringify(state)));\n\n      // Pop the last state from undo stack\n      const prevState = undoStack.current.pop()!;\n\n      // Apply the previous state\n      setState(prevState);\n    }\n  }, [state]);\n\n  // Redo the last undone action\n  const redo = useCallback((): void => {\n    if (redoStack.current.length > 0) {\n      // Save current state to undo stack\n      undoStack.current.push(JSON.parse(JSON.stringify(state)));\n\n      // Pop the last state from redo stack\n      const nextState = redoStack.current.pop()!;\n\n      // Apply the next state\n      setState(nextState);\n    }\n  }, [state]);\n\n  // Check if undo is possible\n  const canUndo = useCallback((): boolean => {\n    return undoStack.current.length > 0;\n  }, []);\n\n  // Check if redo is possible\n  const canRedo = useCallback((): boolean => {\n    return redoStack.current.length > 0;\n  }, []);\n\n  // Wire drawing state\n  const [wireDrawingState, setWireDrawingState] = useState<{\n    isDrawing: boolean;\n    fromComponentId: string | null;\n    fromPortId: string | null;\n  }>({\n    isDrawing: false,\n    fromComponentId: null,\n    fromPortId: null\n  });\n\n  // Start drawing a wire from a component port\n  const startWireDrawing = useCallback((componentId: string, portId: string): void => {\n    setWireDrawingState({\n      isDrawing: true,\n      fromComponentId: componentId,\n      fromPortId: portId\n    });\n  }, []);\n\n  // Complete wire drawing by connecting to another port\n  const completeWireDrawing = useCallback((toComponentId: string, toPortId: string): boolean => {\n    const { isDrawing, fromComponentId, fromPortId } = wireDrawingState;\n\n    if (!isDrawing || !fromComponentId || !fromPortId) {\n      return false;\n    }\n\n    // Check if this is a valid connection\n    const isValid = isValidConnection(\n      fromComponentId,\n      fromPortId,\n      toComponentId,\n      toPortId\n    );\n\n    if (isValid) {\n      // Create the wire\n      addWire(\n        { componentId: fromComponentId, portId: fromPortId },\n        { componentId: toComponentId, portId: toPortId }\n      );\n\n      // Reset wire drawing state\n      setWireDrawingState({\n        isDrawing: false,\n        fromComponentId: null,\n        fromPortId: null\n      });\n\n      return true;\n    }\n\n    return false;\n  }, [wireDrawingState, addWire]);\n\n  // Cancel wire drawing\n  const cancelWireDrawing = useCallback((): void => {\n    setWireDrawingState({\n      isDrawing: false,\n      fromComponentId: null,\n      fromPortId: null\n    });\n  }, []);\n\n  // Check if a connection between two ports is valid\n  const isValidConnection = useCallback((\n    fromId: string,\n    fromPortId: string,\n    toId: string,\n    toPortId: string\n  ): boolean => {\n    // Don't allow connections to the same component\n    if (fromId === toId) {\n      return false;\n    }\n\n    // Don't allow duplicate connections\n    const isDuplicate = state.wires.some(wire =>\n      (wire.from.componentId === fromId && wire.from.portId === fromPortId &&\n       wire.to.componentId === toId && wire.to.portId === toPortId) ||\n      (wire.from.componentId === toId && wire.from.portId === toPortId &&\n       wire.to.componentId === fromId && wire.to.portId === fromPortId)\n    );\n\n    if (isDuplicate) {\n      return false;\n    }\n\n    // Get component schemas for port type checking\n    const fromComponent = state.components.find(c => c.id === fromId);\n    const toComponent = state.components.find(c => c.id === toId);\n\n    if (!fromComponent || !toComponent) {\n      return false;\n    }\n\n    const fromSchema = getComponentSchema(fromComponent.type);\n    const toSchema = getComponentSchema(toComponent.type);\n\n    if (!fromSchema || !toSchema) {\n      return false;\n    }\n\n    // Get port info\n    const fromPort = fromSchema.ports.find(p => p.id === fromPortId);\n    const toPort = toSchema.ports.find(p => p.id === toPortId);\n\n    if (!fromPort || !toPort) {\n      return false;\n    }\n\n    // Basic port compatibility check - outputs can connect to inputs\n    if (fromPort.type === 'output' && toPort.type === 'input') {\n      return true;\n    }\n\n    // Inputs can connect to outputs\n    if (fromPort.type === 'input' && toPort.type === 'output') {\n      return true;\n    }\n\n    // Bidirectional ports can connect to anything\n    if (fromPort.type === 'inout' || toPort.type === 'inout') {\n      return true;\n    }\n\n    return false;\n  }, [state.components, state.wires]);\n\n  const actions: CircuitActions = {\n    addComponent,\n    updateComponent,\n    removeComponent,\n    addWire,\n    updateWire,\n    removeWire,\n    selectComponent,\n    selectWire,\n    deselectAll,\n    getSelectedComponents,\n    getSelectedWires,\n    moveComponent,\n    moveSelectedComponents,\n    startWireDrawing,\n    completeWireDrawing,\n    cancelWireDrawing,\n    isValidConnection,\n    rotateComponent,\n    rotateSelectedComponents,\n    undo,\n    redo,\n    canUndo,\n    canRedo\n  };\n\n  return [state, actions];\n}\n\nexport default useCircuit;\n","/**\n * usePortPosition Hook\n *\n * A React hook for tracking the position of component ports.\n * Compatible with infinite circuit canvas with panning and zooming.\n */\n\nimport { useState, useEffect, useCallback } from 'react';\nimport { Point, Wire } from '../schemas/componentSchema';\nimport { getPortPosition } from '../utils/getPortPosition';\n\ninterface PortPositionState {\n  from: Point | null;\n  to: Point | null;\n  error: string | null;\n}\n\n/**\n * A hook to track the positions of ports connected by a wire\n *\n * @param wire - The wire connecting the ports\n * @param deps - Additional dependencies that should trigger position updates\n * @returns Object containing port positions and error state\n */\nexport function usePortPosition(\n  wire: Wire | null,\n  deps: any[] = []\n): PortPositionState {\n  const [state, setState] = useState<PortPositionState>({\n    from: null,\n    to: null,\n    error: null\n  });\n\n  // Use callback to get port positions to avoid useEffect dependencies\n  const updatePositions = useCallback(() => {\n    if (!wire) {\n      setState({\n        from: null,\n        to: null,\n        error: 'No wire provided'\n      });\n      return;\n    }\n\n    // Small delay to ensure DOM has been updated\n    setTimeout(() => {\n      try {\n        // Get source port position\n        const fromPos = getPortPosition(wire.from.componentId, wire.from.portId);\n\n        // Get destination port position\n        const toPos = getPortPosition(wire.to.componentId, wire.to.portId);\n\n        setState({\n          from: fromPos,\n          to: toPos,\n          error: (!fromPos || !toPos)\n            ? `Could not find ports for wire ${wire.id}`\n            : null\n        });\n      } catch (error) {\n        setState({\n          from: null,\n          to: null,\n          error: `Error getting port positions: ${error}`\n        });\n      }\n    }, 0);\n  }, [wire]);\n\n  // Update positions when wire or dependencies change\n  useEffect(() => {\n    updatePositions();\n\n    // Add event listeners for window resize and canvas transformations to update positions\n    window.addEventListener('resize', updatePositions);\n\n    // Listen to custom event for viewport transformations\n    const handleViewportChange = () => {\n      updatePositions();\n    };\n\n    // Find circuit canvas element to attach transformation event listeners\n    const canvas = document.querySelector('[data-circuit-canvas]');\n    if (canvas) {\n      // Listen to mouse wheel events for zoom changes\n      canvas.addEventListener('wheel', updatePositions, { passive: true });\n\n      // Custom event for pan/zoom that can be dispatched by CircuitCanvas\n      canvas.addEventListener('viewport-change', handleViewportChange);\n    }\n\n    return () => {\n      window.removeEventListener('resize', updatePositions);\n\n      if (canvas) {\n        canvas.removeEventListener('wheel', updatePositions);\n        canvas.removeEventListener('viewport-change', handleViewportChange);\n      }\n    };\n  }, [wire, updatePositions, ...deps]);\n\n  return state;\n}\n\n/**\n * Hook to track a single port position\n *\n * @param componentId - The component ID\n * @param portId - The port ID\n * @param deps - Additional dependencies that should trigger position updates\n * @returns The port position or null if not found\n */\nexport function useSinglePortPosition(\n  componentId: string | null,\n  portId: string | null,\n  deps: any[] = []\n): Point | null {\n  const [position, setPosition] = useState<Point | null>(null);\n\n  const updatePosition = useCallback(() => {\n    if (!componentId || !portId) {\n      setPosition(null);\n      return;\n    }\n\n    setTimeout(() => {\n      try {\n        const pos = getPortPosition(componentId, portId);\n        setPosition(pos);\n      } catch (error) {\n        console.warn(`Error getting port position: ${error}`);\n        setPosition(null);\n      }\n    }, 0);\n  }, [componentId, portId]);\n\n  useEffect(() => {\n    updatePosition();\n\n    // Add event listeners for window resize and canvas transformations\n    window.addEventListener('resize', updatePosition);\n\n    // Listen to custom event for viewport transformations\n    const handleViewportChange = () => {\n      updatePosition();\n    };\n\n    // Find circuit canvas element to attach transformation event listeners\n    const canvas = document.querySelector('[data-circuit-canvas]');\n    if (canvas) {\n      // Listen to mouse wheel events for zoom changes\n      canvas.addEventListener('wheel', updatePosition, { passive: true });\n\n      // Custom event for pan/zoom that can be dispatched by CircuitCanvas\n      canvas.addEventListener('viewport-change', handleViewportChange);\n    }\n\n    return () => {\n      window.removeEventListener('resize', updatePosition);\n\n      if (canvas) {\n        canvas.removeEventListener('wheel', updatePosition);\n        canvas.removeEventListener('viewport-change', handleViewportChange);\n      }\n    };\n  }, [componentId, portId, updatePosition, ...deps]);\n\n  return position;\n}\n\nexport default usePortPosition;\n","/**\n * HeadlessPropertyPanel Component\n *\n * A headless (unstyled) component for editing the properties of a circuit component.\n * This component provides all the functionality without any styling, allowing users\n * to apply their own styling using their preferred method.\n */\n\nimport React from 'react';\nimport { ComponentInstance } from '../../schemas/componentSchema';\nimport { getComponentSchema } from '../../registry';\n\nexport interface HeadlessPropertyPanelProps {\n  /** The component instance to edit properties for */\n  component: ComponentInstance | null;\n  /** Callback when a property changes */\n  onPropertyChange?: (id: string, key: string, value: any) => void;\n  /** Additional class name for the root element */\n  className?: string;\n  /** Additional class names for sub-components */\n  classNames?: {\n    /** Class for the empty state container */\n    emptyContainer?: string;\n    /** Class for the error state container */\n    errorContainer?: string;\n    /** Class for the header section */\n    header?: string;\n    /** Class for the title */\n    title?: string;\n    /** Class for the component ID */\n    componentId?: string;\n    /** Class for the content section */\n    content?: string;\n    /** Class for each property item */\n    propertyItem?: string;\n    /** Class for property labels */\n    propertyLabel?: string;\n    /** Class for property unit text */\n    propertyUnit?: string;\n    /** Class for number inputs */\n    numberInput?: string;\n    /** Class for text inputs */\n    textInput?: string;\n    /** Class for checkbox containers */\n    checkboxContainer?: string;\n    /** Class for checkboxes */\n    checkbox?: string;\n    /** Class for checkbox labels */\n    checkboxLabel?: string;\n    /** Class for select inputs */\n    select?: string;\n    /** Class for color input containers */\n    colorContainer?: string;\n    /** Class for color inputs */\n    colorInput?: string;\n    /** Class for color text inputs */\n    colorTextInput?: string;\n    /** Class for the position section */\n    positionSection?: string;\n    /** Class for position section title */\n    positionTitle?: string;\n    /** Class for position inputs container */\n    positionInputs?: string;\n    /** Class for position input groups */\n    positionInputGroup?: string;\n    /** Class for position labels */\n    positionLabel?: string;\n    /** Class for position inputs */\n    positionInput?: string;\n    /** Class for the rotation section */\n    rotationSection?: string;\n    /** Class for rotation section title */\n    rotationTitle?: string;\n    /** Class for rotation slider container */\n    rotationSlider?: string;\n    /** Class for rotation range input */\n    rotationRange?: string;\n    /** Class for rotation value display */\n    rotationValue?: string;\n    /** Class for rotation presets container */\n    rotationPresets?: string;\n    /** Class for rotation preset buttons */\n    rotationPresetButton?: string;\n  };\n  /** Additional inline styles for the root element */\n  style?: React.CSSProperties;\n  /** Additional inline styles for sub-components */\n  styles?: {\n    [key: string]: React.CSSProperties;\n  };\n}\n\nconst HeadlessPropertyPanel: React.FC<HeadlessPropertyPanelProps> = ({\n  component,\n  onPropertyChange,\n  className = '',\n  classNames = {},\n  style = {},\n  styles = {}\n}) => {\n  if (!component) {\n    return (\n      <div\n        className={`cb-property-panel-empty ${classNames.emptyContainer || ''} ${className}`}\n        style={style}\n        data-testid=\"property-panel-empty\"\n      >\n        <svg\n          width=\"48\"\n          height=\"48\"\n          viewBox=\"0 0 24 24\"\n          fill=\"none\"\n          stroke=\"currentColor\"\n          strokeWidth=\"1.5\"\n          strokeLinecap=\"round\"\n          strokeLinejoin=\"round\"\n          aria-hidden=\"true\"\n        >\n          <rect x=\"2\" y=\"2\" width=\"20\" height=\"8\" rx=\"2\" ry=\"2\"></rect>\n          <rect x=\"2\" y=\"14\" width=\"20\" height=\"8\" rx=\"2\" ry=\"2\"></rect>\n          <line x1=\"6\" y1=\"6\" x2=\"6.01\" y2=\"6\"></line>\n          <line x1=\"6\" y1=\"18\" x2=\"6.01\" y2=\"18\"></line>\n        </svg>\n        <p>No component selected</p>\n        <p>Select a component to edit its properties</p>\n      </div>\n    );\n  }\n\n  const schema = getComponentSchema(component.type);\n\n  if (!schema) {\n    return (\n      <div\n        className={`cb-property-panel-error ${classNames.errorContainer || ''} ${className}`}\n        style={style}\n        data-testid=\"property-panel-error\"\n        role=\"alert\"\n      >\n        <svg\n          width=\"48\"\n          height=\"48\"\n          viewBox=\"0 0 24 24\"\n          fill=\"none\"\n          stroke=\"currentColor\"\n          strokeWidth=\"1.5\"\n          strokeLinecap=\"round\"\n          strokeLinejoin=\"round\"\n          aria-hidden=\"true\"\n        >\n          <circle cx=\"12\" cy=\"12\" r=\"10\"></circle>\n          <line x1=\"12\" y1=\"8\" x2=\"12\" y2=\"12\"></line>\n          <line x1=\"12\" y1=\"16\" x2=\"12.01\" y2=\"16\"></line>\n        </svg>\n        <p>Error: Unknown component type '{component.type}'</p>\n        <p>This component type is not registered in the system</p>\n      </div>\n    );\n  }\n\n  const handleChange = (\n    key: string,\n    event: React.ChangeEvent<HTMLInputElement | HTMLSelectElement>\n  ) => {\n    const property = schema.properties.find(prop => prop.key === key);\n    if (!property) return;\n\n    let value: any = event.target.value;\n\n    // Convert value based on property type\n    if (property.type === 'number') {\n      value = parseFloat(value);\n\n      // Validate min/max if specified\n      if (property.min !== undefined && value < property.min) {\n        value = property.min;\n      }\n      if (property.max !== undefined && value > property.max) {\n        value = property.max;\n      }\n    } else if (property.type === 'boolean') {\n      value = (event.target as HTMLInputElement).checked;\n    }\n\n    onPropertyChange?.(component.id, key, value);\n  };\n\n  return (\n    <div\n      className={`cb-property-panel ${className}`}\n      style={style}\n      data-testid=\"property-panel\"\n    >\n      <div className={`cb-property-panel-header ${classNames.header || ''}`} style={styles.header}>\n        <h3 className={`cb-property-panel-title ${classNames.title || ''}`} style={styles.title}>\n          {schema.name} Properties\n        </h3>\n        <span\n          className={`cb-property-panel-component-id ${classNames.componentId || ''}`}\n          style={styles.componentId}\n        >\n          ID: {component.id}\n        </span>\n      </div>\n\n      <div className={`cb-property-panel-content ${classNames.content || ''}`} style={styles.content}>\n        {schema.properties.map(property => {\n          const currentValue = component.props[property.key] ?? property.default;\n          const inputId = `prop-${component.id}-${property.key}`;\n\n          return (\n            <div\n              key={property.key}\n              className={`cb-property-item ${classNames.propertyItem || ''}`}\n              style={styles.propertyItem}\n              data-property-key={property.key}\n            >\n              <label\n                htmlFor={inputId}\n                className={`cb-property-label ${classNames.propertyLabel || ''}`}\n                style={styles.propertyLabel}\n              >\n                {property.label}\n                {property.unit && (\n                  <span\n                    className={`cb-property-unit ${classNames.propertyUnit || ''}`}\n                    style={styles.propertyUnit}\n                  >\n                    {property.unit}\n                  </span>\n                )}\n              </label>\n\n              {property.type === 'number' && (\n                <input\n                  id={inputId}\n                  type=\"number\"\n                  value={currentValue}\n                  onChange={e => handleChange(property.key, e)}\n                  min={property.min}\n                  max={property.max}\n                  step=\"any\"\n                  className={`cb-property-number-input ${classNames.numberInput || ''}`}\n                  style={styles.numberInput}\n                  aria-label={`${property.label} ${property.unit || ''}`}\n                />\n              )}\n\n              {property.type === 'text' && (\n                <input\n                  id={inputId}\n                  type=\"text\"\n                  value={currentValue}\n                  onChange={e => handleChange(property.key, e)}\n                  className={`cb-property-text-input ${classNames.textInput || ''}`}\n                  style={styles.textInput}\n                  aria-label={property.label}\n                />\n              )}\n\n              {property.type === 'boolean' && (\n                <div\n                  className={`cb-property-checkbox-container ${classNames.checkboxContainer || ''}`}\n                  style={styles.checkboxContainer}\n                >\n                  <input\n                    id={inputId}\n                    type=\"checkbox\"\n                    checked={currentValue}\n                    onChange={e => handleChange(property.key, e)}\n                    className={`cb-property-checkbox ${classNames.checkbox || ''}`}\n                    style={styles.checkbox}\n                    aria-label={property.label}\n                  />\n                  <span\n                    className={`cb-property-checkbox-label ${classNames.checkboxLabel || ''}`}\n                    style={styles.checkboxLabel}\n                  >\n                    {currentValue ? 'Enabled' : 'Disabled'}\n                  </span>\n                </div>\n              )}\n\n              {property.type === 'select' && property.options && (\n                <select\n                  id={inputId}\n                  value={currentValue}\n                  onChange={e => handleChange(property.key, e)}\n                  className={`cb-property-select ${classNames.select || ''}`}\n                  style={styles.select}\n                  aria-label={property.label}\n                >\n                  {property.options.map(option => (\n                    <option key={option.value} value={option.value}>\n                      {option.label}\n                    </option>\n                  ))}\n                </select>\n              )}\n\n              {property.type === 'color' && (\n                <div\n                  className={`cb-property-color-container ${classNames.colorContainer || ''}`}\n                  style={styles.colorContainer}\n                >\n                  <input\n                    id={inputId}\n                    type=\"color\"\n                    value={currentValue}\n                    onChange={e => handleChange(property.key, e)}\n                    className={`cb-property-color-input ${classNames.colorInput || ''}`}\n                    style={styles.colorInput}\n                    aria-label={`${property.label} color picker`}\n                  />\n                  <input\n                    type=\"text\"\n                    value={currentValue}\n                    onChange={e => handleChange(property.key, e)}\n                    className={`cb-property-color-text-input ${classNames.colorTextInput || ''}`}\n                    style={styles.colorTextInput}\n                    aria-label={`${property.label} color value`}\n                  />\n                </div>\n              )}\n            </div>\n          );\n        })}\n      </div>\n\n      {/* Position Section */}\n      <div\n        className={`cb-property-panel-position ${classNames.positionSection || ''}`}\n        style={styles.positionSection}\n      >\n        <h4\n          className={`cb-property-panel-position-title ${classNames.positionTitle || ''}`}\n          style={styles.positionTitle}\n        >\n          Position\n        </h4>\n        <div\n          className={`cb-property-panel-position-inputs ${classNames.positionInputs || ''}`}\n          style={styles.positionInputs}\n        >\n          <div\n            className={`cb-property-panel-position-input-group ${classNames.positionInputGroup || ''}`}\n            style={styles.positionInputGroup}\n          >\n            <label\n              className={`cb-property-panel-position-label ${classNames.positionLabel || ''}`}\n              style={styles.positionLabel}\n              htmlFor=\"position-x\"\n            >\n              X:\n            </label>\n            <input\n              id=\"position-x\"\n              type=\"number\"\n              value={component.position.x}\n              onChange={e => onPropertyChange?.(\n                component.id,\n                'position',\n                { ...component.position, x: parseFloat(e.target.value) }\n              )}\n              className={`cb-property-panel-position-input ${classNames.positionInput || ''}`}\n              style={styles.positionInput}\n              aria-label=\"X position\"\n            />\n          </div>\n          <div\n            className={`cb-property-panel-position-input-group ${classNames.positionInputGroup || ''}`}\n            style={styles.positionInputGroup}\n          >\n            <label\n              className={`cb-property-panel-position-label ${classNames.positionLabel || ''}`}\n              style={styles.positionLabel}\n              htmlFor=\"position-y\"\n            >\n              Y:\n            </label>\n            <input\n              id=\"position-y\"\n              type=\"number\"\n              value={component.position.y}\n              onChange={e => onPropertyChange?.(\n                component.id,\n                'position',\n                { ...component.position, y: parseFloat(e.target.value) }\n              )}\n              className={`cb-property-panel-position-input ${classNames.positionInput || ''}`}\n              style={styles.positionInput}\n              aria-label=\"Y position\"\n            />\n          </div>\n        </div>\n      </div>\n\n      {/* Rotation Section */}\n      {component.rotation !== undefined && (\n        <div\n          className={`cb-property-panel-rotation ${classNames.rotationSection || ''}`}\n          style={styles.rotationSection}\n        >\n          <h4\n            className={`cb-property-panel-rotation-title ${classNames.rotationTitle || ''}`}\n            style={styles.rotationTitle}\n          >\n            Rotation\n          </h4>\n          <div\n            className={`cb-property-panel-rotation-slider ${classNames.rotationSlider || ''}`}\n            style={styles.rotationSlider}\n          >\n            <input\n              type=\"range\"\n              min=\"0\"\n              max=\"360\"\n              step=\"90\"\n              value={component.rotation}\n              onChange={e => onPropertyChange?.(\n                component.id,\n                'rotation',\n                parseFloat(e.target.value)\n              )}\n              className={`cb-property-panel-rotation-range ${classNames.rotationRange || ''}`}\n              style={styles.rotationRange}\n              aria-label=\"Rotation angle\"\n            />\n            <div\n              className={`cb-property-panel-rotation-value ${classNames.rotationValue || ''}`}\n              style={styles.rotationValue}\n            >\n              {component.rotation}°\n            </div>\n          </div>\n          <div\n            className={`cb-property-panel-rotation-presets ${classNames.rotationPresets || ''}`}\n            style={styles.rotationPresets}\n          >\n            {[0, 90, 180, 270, 360].map(angle => (\n              <button\n                key={angle}\n                onClick={() => onPropertyChange?.(\n                  component.id,\n                  'rotation',\n                  angle\n                )}\n                className={`cb-property-panel-rotation-preset-button ${classNames.rotationPresetButton || ''}`}\n                style={styles.rotationPresetButton}\n                data-active={component.rotation === angle}\n                aria-label={`Set rotation to ${angle} degrees`}\n                aria-pressed={component.rotation === angle}\n              >\n                {angle}°\n              </button>\n            ))}\n          </div>\n        </div>\n      )}\n    </div>\n  );\n};\n\nexport default HeadlessPropertyPanel;\n","/**\n * PropertyPanel Component\n *\n * A component for editing the properties of a circuit component.\n * This is a styled wrapper around the HeadlessPropertyPanel component.\n */\n\nimport React, { CSSProperties } from 'react';\nimport { ComponentInstance } from '../schemas/componentSchema';\nimport HeadlessPropertyPanel from './headless/HeadlessPropertyPanel';\n\nexport interface PropertyPanelProps {\n  component: ComponentInstance | null;\n  onPropertyChange?: (id: string, key: string, value: any) => void;\n  className?: string;\n  style?: React.CSSProperties;\n}\n\nconst PropertyPanel: React.FC<PropertyPanelProps> = ({\n  component,\n  onPropertyChange,\n  className = '',\n  style = {}\n}) => {\n  // Root style with user's custom style\n  const rootStyle: CSSProperties = {\n    backgroundColor: '#1a202c',\n    borderRadius: '12px',\n    boxShadow: '0 4px 12px rgba(0, 0, 0, 0.15)',\n    overflow: 'hidden',\n    border: '1px solid #2d3748',\n    color: '#e2e8f0',\n    ...style\n  };\n\n  // Default styles for the PropertyPanel\n  const defaultStyles: Record<string, CSSProperties> = {\n    // Empty state\n    emptyContainer: {\n      backgroundColor: '#1a202c',\n      borderRadius: '12px',\n      padding: '24px',\n      display: 'flex',\n      flexDirection: 'column' as const,\n      alignItems: 'center',\n      justifyContent: 'center',\n      color: '#a0aec0',\n      height: '100%',\n      boxShadow: '0 4px 12px rgba(0, 0, 0, 0.1)',\n      border: '1px solid rgb(21, 25, 32)',\n      textAlign: 'center'\n    },\n\n    // Error state\n    errorContainer: {\n      backgroundColor: '#1a202c',\n      borderRadius: '12px',\n      padding: '24px',\n      display: 'flex',\n      flexDirection: 'column' as const,\n      alignItems: 'center',\n      justifyContent: 'center',\n      color: '#f56565',\n      boxShadow: '0 4px 12px rgba(0, 0, 0, 0.1)',\n      border: '1px solid rgb(21, 26, 34)',\n      textAlign: 'center'\n    },\n\n    // Header section\n    header: {\n      padding: '16px',\n      borderBottom: '1px solid #2d3748',\n      background: '#202938'\n    },\n\n    // Title\n    title: {\n      margin: '0 0 4px 0',\n      fontSize: '18px',\n      fontWeight: 600,\n      color: '#e2e8f0'\n    },\n\n    // Component ID\n    componentId: {\n      fontSize: '12px',\n      color: '#a0aec0',\n      opacity: 0.7\n    },\n\n    // Content section\n    content: {\n      padding: '16px'\n    },\n\n    // Property item\n    propertyItem: {\n      marginBottom: '16px'\n    },\n\n    // Property label\n    propertyLabel: {\n      display: 'block',\n      marginBottom: '6px',\n      fontSize: '14px',\n      fontWeight: 500,\n      color: '#cbd5e0'\n    },\n\n    // Property unit\n    propertyUnit: {\n      marginLeft: '4px',\n      color: '#a0aec0',\n      fontSize: '12px'\n    },\n\n    // Number input\n    numberInput: {\n      width: '100%',\n      padding: '8px 12px',\n      borderRadius: '6px',\n      border: '1px solid #4a5568',\n      backgroundColor: '#2d3748',\n      color: '#e2e8f0',\n      fontSize: '14px',\n      outline: 'none',\n      transition: 'all 0.2s ease',\n      boxSizing: 'border-box'\n    },\n\n    // Text input\n    textInput: {\n      width: '100%',\n      padding: '8px 12px',\n      borderRadius: '6px',\n      border: '1px solid #4a5568',\n      backgroundColor: '#2d3748',\n      color: '#e2e8f0',\n      fontSize: '14px',\n      outline: 'none',\n      transition: 'all 0.2s ease',\n      boxSizing: 'border-box'\n    },\n\n    // Checkbox container\n    checkboxContainer: {\n      display: 'flex',\n      alignItems: 'center'\n    },\n\n    // Checkbox\n    checkbox: {\n      width: '18px',\n      height: '18px',\n      cursor: 'pointer',\n      accentColor: '#4299e1',\n      borderRadius: '4px',\n      marginRight: '8px'\n    },\n\n    // Checkbox label\n    checkboxLabel: {\n      fontSize: '14px',\n      color: '#cbd5e0'\n    },\n\n    // Select input\n    select: {\n      width: '100%',\n      padding: '8px 12px',\n      borderRadius: '6px',\n      border: '1px solid #4a5568',\n      backgroundColor: '#2d3748',\n      color: '#e2e8f0',\n      fontSize: '14px',\n      outline: 'none',\n      transition: 'all 0.2s ease',\n      cursor: 'pointer',\n      appearance: 'none',\n      backgroundImage: 'url(\"data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23a0aec0%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E\")',\n      backgroundRepeat: 'no-repeat',\n      backgroundPosition: 'right 12px top 50%',\n      backgroundSize: '12px auto',\n      paddingRight: '30px'\n    },\n\n    // Color container\n    colorContainer: {\n      display: 'flex',\n      alignItems: 'center',\n      gap: '10px'\n    },\n\n    // Color input\n    colorInput: {\n      width: '36px',\n      height: '36px',\n      border: 'none',\n      borderRadius: '6px',\n      backgroundColor: 'transparent',\n      cursor: 'pointer'\n    },\n\n    // Color text input\n    colorTextInput: {\n      flexGrow: 1,\n      padding: '8px 12px',\n      borderRadius: '6px',\n      border: '1px solid #4a5568',\n      backgroundColor: '#2d3748',\n      color: '#e2e8f0',\n      fontSize: '14px'\n    },\n\n    // Position section\n    positionSection: {\n      padding: '0 16px 16px',\n      borderTop: '1px solid #2d3748',\n      marginTop: '8px'\n    },\n\n    // Position title\n    positionTitle: {\n      fontSize: '16px',\n      fontWeight: 500,\n      margin: '16px 0 12px',\n      color: '#cbd5e0'\n    },\n\n    // Position inputs\n    positionInputs: {\n      display: 'grid',\n      gridTemplateColumns: '1fr 1fr',\n      gap: '12px'\n    },\n\n    // Position input group\n    positionInputGroup: {\n      display: 'flex',\n      flexDirection: 'column' as const\n    },\n\n    // Position label\n    positionLabel: {\n      fontSize: '14px',\n      fontWeight: 500,\n      marginBottom: '6px',\n      color: '#cbd5e0'\n    },\n\n    // Position input\n    positionInput: {\n      width: '100%',\n      padding: '8px 12px',\n      borderRadius: '6px',\n      border: '1px solid #4a5568',\n      backgroundColor: '#2d3748',\n      color: '#e2e8f0',\n      fontSize: '14px',\n      outline: 'none',\n      transition: 'all 0.2s ease'\n    },\n\n    // Rotation section\n    rotationSection: {\n      padding: '0 16px 16px',\n      borderTop: '1px solid #2d3748'\n    },\n\n    // Rotation title\n    rotationTitle: {\n      fontSize: '16px',\n      fontWeight: 500,\n      margin: '16px 0 12px',\n      color: '#cbd5e0'\n    },\n\n    // Rotation slider\n    rotationSlider: {\n      display: 'flex',\n      alignItems: 'center',\n      gap: '12px'\n    },\n\n    // Rotation range\n    rotationRange: {\n      flex: 1,\n      height: '6px',\n      borderRadius: '3px',\n      backgroundColor: '#4a5568',\n      appearance: 'none',\n      outline: 'none',\n      cursor: 'pointer',\n      accentColor: '#4299e1'\n    },\n\n    // Rotation value\n    rotationValue: {\n      padding: '6px 10px',\n      backgroundColor: '#2d3748',\n      borderRadius: '6px',\n      border: '1px solid #4a5568',\n      fontSize: '14px',\n      fontWeight: 500,\n      color: '#e2e8f0',\n      minWidth: '48px',\n      textAlign: 'center'\n    },\n\n    // Rotation presets\n    rotationPresets: {\n      display: 'flex',\n      justifyContent: 'space-between',\n      marginTop: '8px'\n    },\n\n    // Rotation preset button\n    rotationPresetButton: {\n      background: '#2d3748',\n      border: 'none',\n      borderRadius: '4px',\n      width: '32px',\n      height: '24px',\n      fontSize: '12px',\n      color: '#cbd5e0',\n      cursor: 'pointer',\n      transition: 'all 0.2s ease',\n      display: 'flex',\n      alignItems: 'center',\n      justifyContent: 'center'\n    }\n  };\n\n  return (\n    <HeadlessPropertyPanel\n      component={component}\n      onPropertyChange={onPropertyChange}\n      className={className}\n      style={rootStyle}\n      styles={defaultStyles}\n    />\n  );\n};\n\nexport default PropertyPanel;\n","/**\n * HeadlessComponentPalette Component\n *\n * A headless (unstyled) component for selecting and adding circuit components to a canvas.\n * This component provides all the functionality without any styling, allowing users\n * to apply their own styling using their preferred method.\n */\n\nimport React, { useState, useRef, useEffect } from 'react';\nimport { getAllComponents, getComponentsByCategory } from '../../registry';\nimport { ComponentSchema } from '../../schemas/componentSchema';\n\nexport interface HeadlessComponentPaletteProps {\n  /** Callback when a component is selected */\n  onSelectComponent: (componentType: string) => void;\n  /** Callback when a component is dragged */\n  onDragComponent?: (componentType: string, event: React.DragEvent) => void;\n  /** Additional class name for the root element */\n  className?: string;\n  /** Additional class names for sub-components */\n  classNames?: {\n    /** Class for the header section */\n    header?: string;\n    /** Class for the title */\n    title?: string;\n    /** Class for the search container */\n    searchContainer?: string;\n    /** Class for the search input */\n    searchInput?: string;\n    /** Class for the search icon */\n    searchIcon?: string;\n    /** Class for the clear search button */\n    clearSearchButton?: string;\n    /** Class for the category tabs container */\n    categoryTabs?: string;\n    /** Class for the category tabs inner container */\n    categoryTabsInner?: string;\n    /** Class for each category tab */\n    categoryTab?: string;\n    /** Class for the active category tab */\n    activeCategoryTab?: string;\n    /** Class for the component list container */\n    componentList?: string;\n    /** Class for the empty state container */\n    emptyState?: string;\n    /** Class for the component item */\n    componentItem?: string;\n    /** Class for the component icon container */\n    componentIcon?: string;\n    /** Class for the component details container */\n    componentDetails?: string;\n    /** Class for the component name */\n    componentName?: string;\n    /** Class for the component category */\n    componentCategory?: string;\n    /** Class for the component arrow icon */\n    componentArrow?: string;\n    /** Class for the left shadow overlay */\n    leftShadow?: string;\n    /** Class for the right shadow overlay */\n    rightShadow?: string;\n    /** Class for the top shadow overlay */\n    topShadow?: string;\n    /** Class for the bottom shadow overlay */\n    bottomShadow?: string;\n  };\n  /** Additional inline styles for the root element */\n  style?: React.CSSProperties;\n  /** Additional inline styles for sub-components */\n  styles?: {\n    [key: string]: React.CSSProperties;\n  };\n}\n\nconst HeadlessComponentPalette: React.FC<HeadlessComponentPaletteProps> = ({\n  onSelectComponent,\n  onDragComponent,\n  className = '',\n  classNames = {},\n  style = {},\n  styles = {}\n}) => {\n  const [searchTerm, setSearchTerm] = useState('');\n  const [activeCategory, setActiveCategory] = useState<string | null>(null);\n\n  // Get all components and extract unique categories\n  const allComponents = getAllComponents();\n  const allCategories = Array.from(\n    new Set(allComponents.map(comp => comp.category))\n  ).sort();\n\n  // Filter components based on search and category\n  const filteredComponents = activeCategory\n    ? getComponentsByCategory(activeCategory)\n    : allComponents;\n\n  const searchFilteredComponents = searchTerm\n    ? filteredComponents.filter(comp =>\n        comp.name.toLowerCase().includes(searchTerm.toLowerCase()) ||\n        comp.description.toLowerCase().includes(searchTerm.toLowerCase())\n      )\n    : filteredComponents;\n\n  // Refs for scroll shadow effects\n  const tabsRef = useRef<HTMLDivElement>(null);\n  const listRef = useRef<HTMLDivElement>(null);\n  const [showTabsLeftShadow, setShowTabsLeftShadow] = useState(false);\n  const [showTabsRightShadow, setShowTabsRightShadow] = useState(false);\n  const [showListTopShadow, setShowListTopShadow] = useState(false);\n  const [showListBottomShadow, setShowListBottomShadow] = useState(false);\n\n  // Handle scroll shadows for tabs\n  const handleTabsScroll = () => {\n    if (tabsRef.current) {\n      const { scrollLeft, scrollWidth, clientWidth } = tabsRef.current;\n      setShowTabsLeftShadow(scrollLeft > 0);\n      setShowTabsRightShadow(scrollLeft < scrollWidth - clientWidth - 1);\n    }\n  };\n\n  // Handle scroll shadows for component list\n  const handleListScroll = () => {\n    if (listRef.current) {\n      const { scrollTop, scrollHeight, clientHeight } = listRef.current;\n      setShowListTopShadow(scrollTop > 0);\n      setShowListBottomShadow(scrollTop < scrollHeight - clientHeight - 1);\n    }\n  };\n\n  // Initialize scroll shadows\n  useEffect(() => {\n    handleTabsScroll();\n    handleListScroll();\n\n    // Add resize event listener\n    const handleResize = () => {\n      handleTabsScroll();\n      handleListScroll();\n    };\n\n    window.addEventListener('resize', handleResize);\n\n    return () => {\n      window.removeEventListener('resize', handleResize);\n    };\n  }, []);\n\n  return (\n    <div\n      className={`cb-component-palette ${className}`}\n      style={style}\n      data-testid=\"component-palette\"\n    >\n      <div\n        className={`cb-component-palette-header ${classNames.header || ''}`}\n        style={styles.header}\n      >\n        <h3\n          className={`cb-component-palette-title ${classNames.title || ''}`}\n          style={styles.title}\n        >\n          Components\n        </h3>\n        <div\n          className={`cb-component-palette-search-container ${classNames.searchContainer || ''}`}\n          style={styles.searchContainer}\n        >\n          <input\n            type=\"text\"\n            placeholder=\"Search components...\"\n            value={searchTerm}\n            onChange={e => setSearchTerm(e.target.value)}\n            className={`cb-component-palette-search-input ${classNames.searchInput || ''}`}\n            style={styles.searchInput}\n            aria-label=\"Search components\"\n          />\n          <svg\n            width=\"18\"\n            height=\"18\"\n            viewBox=\"0 0 24 24\"\n            fill=\"none\"\n            stroke=\"currentColor\"\n            strokeWidth=\"2\"\n            strokeLinecap=\"round\"\n            strokeLinejoin=\"round\"\n            className={`cb-component-palette-search-icon ${classNames.searchIcon || ''}`}\n            style={styles.searchIcon}\n            aria-hidden=\"true\"\n          >\n            <circle cx=\"11\" cy=\"11\" r=\"8\"></circle>\n            <line x1=\"21\" y1=\"21\" x2=\"16.65\" y2=\"16.65\"></line>\n          </svg>\n          {searchTerm && (\n            <button\n              onClick={() => setSearchTerm('')}\n              className={`cb-component-palette-clear-search ${classNames.clearSearchButton || ''}`}\n              style={styles.clearSearchButton}\n              aria-label=\"Clear search\"\n            >\n              <svg\n                width=\"16\"\n                height=\"16\"\n                viewBox=\"0 0 24 24\"\n                fill=\"none\"\n                stroke=\"currentColor\"\n                strokeWidth=\"2\"\n                strokeLinecap=\"round\"\n                strokeLinejoin=\"round\"\n                aria-hidden=\"true\"\n              >\n                <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\"></line>\n                <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\"></line>\n              </svg>\n            </button>\n          )}\n        </div>\n      </div>\n\n      <div className=\"cb-component-palette-tabs-wrapper\">\n        <div\n          ref={tabsRef}\n          className={`cb-component-palette-category-tabs ${classNames.categoryTabs || ''}`}\n          style={styles.categoryTabs}\n          onScroll={handleTabsScroll}\n        >\n          <div\n            className={`cb-component-palette-category-tabs-inner ${classNames.categoryTabsInner || ''}`}\n            style={styles.categoryTabsInner}\n          >\n            <button\n              className={`cb-component-palette-category-tab ${activeCategory === null ? 'cb-component-palette-category-tab-active' : ''} ${classNames.categoryTab || ''} ${activeCategory === null ? classNames.activeCategoryTab || '' : ''}`}\n              onClick={() => setActiveCategory(null)}\n              style={activeCategory === null ? { ...styles.categoryTab, ...styles.activeCategoryTab } : styles.categoryTab}\n              data-active={activeCategory === null}\n              aria-pressed={activeCategory === null}\n            >\n              All\n            </button>\n            {allCategories.map(category => (\n              <button\n                key={category}\n                className={`cb-component-palette-category-tab ${activeCategory === category ? 'cb-component-palette-category-tab-active' : ''} ${classNames.categoryTab || ''} ${activeCategory === category ? classNames.activeCategoryTab || '' : ''}`}\n                onClick={() => setActiveCategory(category)}\n                style={activeCategory === category ? { ...styles.categoryTab, ...styles.activeCategoryTab } : styles.categoryTab}\n                data-active={activeCategory === category}\n                aria-pressed={activeCategory === category}\n              >\n                {category.charAt(0).toUpperCase() + category.slice(1)}\n              </button>\n            ))}\n          </div>\n        </div>\n\n        {/* Shadow effects for tab scroll */}\n        {showTabsLeftShadow && (\n          <div\n            className={`cb-component-palette-left-shadow ${classNames.leftShadow || ''}`}\n            style={styles.leftShadow}\n            aria-hidden=\"true\"\n          ></div>\n        )}\n        {showTabsRightShadow && (\n          <div\n            className={`cb-component-palette-right-shadow ${classNames.rightShadow || ''}`}\n            style={styles.rightShadow}\n            aria-hidden=\"true\"\n          ></div>\n        )}\n      </div>\n\n      <div className=\"cb-component-palette-list-wrapper\">\n        <div\n          ref={listRef}\n          className={`cb-component-palette-component-list ${classNames.componentList || ''}`}\n          style={styles.componentList}\n          onScroll={handleListScroll}\n        >\n          {searchFilteredComponents.length === 0 ? (\n            <div\n              className={`cb-component-palette-empty-state ${classNames.emptyState || ''}`}\n              style={styles.emptyState}\n            >\n              <svg\n                width=\"40\"\n                height=\"40\"\n                viewBox=\"0 0 24 24\"\n                fill=\"none\"\n                stroke=\"currentColor\"\n                strokeWidth=\"2\"\n                strokeLinecap=\"round\"\n                strokeLinejoin=\"round\"\n                aria-hidden=\"true\"\n              >\n                <circle cx=\"11\" cy=\"11\" r=\"8\"></circle>\n                <line x1=\"21\" y1=\"21\" x2=\"16.65\" y2=\"16.65\"></line>\n              </svg>\n              <p>No components found.</p>\n            </div>\n          ) : (\n            <div className=\"cb-component-palette-component-items\">\n              {searchFilteredComponents.map(component => (\n                <HeadlessComponentListItem\n                  key={component.id}\n                  component={component}\n                  onSelect={() => onSelectComponent(component.id)}\n                  onDrag={onDragComponent ? (e) => onDragComponent(component.id, e) : undefined}\n                  classNames={classNames}\n                  styles={styles}\n                />\n              ))}\n            </div>\n          )}\n        </div>\n\n        {/* Shadow effects for list scroll */}\n        {showListTopShadow && (\n          <div\n            className={`cb-component-palette-top-shadow ${classNames.topShadow || ''}`}\n            style={styles.topShadow}\n            aria-hidden=\"true\"\n          ></div>\n        )}\n        {showListBottomShadow && (\n          <div\n            className={`cb-component-palette-bottom-shadow ${classNames.bottomShadow || ''}`}\n            style={styles.bottomShadow}\n            aria-hidden=\"true\"\n          ></div>\n        )}\n      </div>\n    </div>\n  );\n};\n\ninterface HeadlessComponentListItemProps {\n  component: ComponentSchema;\n  onSelect: () => void;\n  onDrag?: (event: React.DragEvent) => void;\n  classNames?: HeadlessComponentPaletteProps['classNames'];\n  styles?: HeadlessComponentPaletteProps['styles'];\n}\n\nconst HeadlessComponentListItem: React.FC<HeadlessComponentListItemProps> = ({\n  component,\n  onSelect,\n  onDrag,\n  classNames = {},\n  styles = {}\n}) => {\n  const handleDragStart = (event: React.DragEvent) => {\n    // Set data to be dragged\n    event.dataTransfer.setData('application/circuit-component', component.id);\n    event.dataTransfer.effectAllowed = 'copy';\n\n    // Create a custom drag image\n    const dragImg = document.createElement('div');\n    dragImg.innerHTML = `\n      <svg width=\"40\" height=\"40\" viewBox=\"0 0 ${component.defaultWidth} ${component.defaultHeight}\">\n        <path\n          d=\"${component.svgPath}\"\n          fill=\"none\"\n          stroke=\"#333\"\n          stroke-width=\"2\"\n        />\n      </svg>\n    `;\n    dragImg.style.position = 'absolute';\n    dragImg.style.top = '-1000px';\n    document.body.appendChild(dragImg);\n\n    event.dataTransfer.setDragImage(dragImg, 20, 20);\n\n    // Custom onDrag handler\n    onDrag?.(event);\n\n    // Clean up after drag operation\n    setTimeout(() => {\n      document.body.removeChild(dragImg);\n    }, 0);\n  };\n\n  return (\n    <li\n      className={`cb-component-item ${classNames.componentItem || ''}`}\n      onClick={onSelect}\n      title={component.description}\n      draggable={true}\n      onDragStart={handleDragStart}\n      style={styles.componentItem}\n      data-component-id={component.id}\n      // data-component-type={component.type}\n      data-component-category={component.category}\n    >\n      <div\n        className={`cb-component-icon ${classNames.componentIcon || ''}`}\n        style={styles.componentIcon}\n      >\n        <svg\n          width=\"32\"\n          height=\"32\"\n          viewBox={`0 0 ${component.defaultWidth} ${component.defaultHeight}`}\n          preserveAspectRatio=\"xMidYMid meet\"\n          aria-hidden=\"true\"\n        >\n          <path\n            d={component.svgPath}\n            fill=\"none\"\n            stroke=\"currentColor\"\n            strokeWidth={2}\n            vectorEffect=\"non-scaling-stroke\"\n          />\n        </svg>\n      </div>\n      <div\n        className={`cb-component-details ${classNames.componentDetails || ''}`}\n        style={styles.componentDetails}\n      >\n        <span\n          className={`cb-component-name ${classNames.componentName || ''}`}\n          style={styles.componentName}\n        >\n          {component.name}\n        </span>\n        <span\n          className={`cb-component-category ${classNames.componentCategory || ''}`}\n          style={styles.componentCategory}\n        >\n          {component.category}\n        </span>\n      </div>\n      <div\n        className={`cb-component-arrow ${classNames.componentArrow || ''}`}\n        style={styles.componentArrow}\n        aria-hidden=\"true\"\n      >\n        <svg\n          width=\"16\"\n          height=\"16\"\n          viewBox=\"0 0 24 24\"\n          fill=\"none\"\n          stroke=\"currentColor\"\n          strokeWidth=\"2\"\n          strokeLinecap=\"round\"\n          strokeLinejoin=\"round\"\n        >\n          <polyline points=\"9 18 15 12 9 6\"></polyline>\n        </svg>\n      </div>\n    </li>\n  );\n};\n\nexport default HeadlessComponentPalette;\n","/**\n * ComponentPalette Component\n *\n * A component for selecting and adding circuit components to a canvas.\n * This is a styled wrapper around the HeadlessComponentPalette component.\n */\n\nimport React, { CSSProperties } from 'react';\nimport HeadlessComponentPalette from './headless/HeadlessComponentPalette';\n\nexport interface ComponentPaletteProps {\n  onSelectComponent: (componentType: string) => void;\n  onDragComponent?: (componentType: string, event: React.DragEvent) => void;\n  className?: string;\n  style?: React.CSSProperties;\n}\n\nconst ComponentPalette: React.FC<ComponentPaletteProps> = ({\n  onSelectComponent,\n  onDragComponent,\n  className = '',\n  style = {}\n}) => {\n  // Root style with user's custom style\n  const rootStyle: CSSProperties = {\n    display: 'flex',\n    flexDirection: 'column' as const,\n    background: '#2d3748',\n    borderRadius: '12px',\n    boxShadow: '0 4px 12px rgba(0, 0, 0, 0.15)',\n    overflow: 'hidden',\n    height: '100%',\n    border: '1px solid #1a202c',\n    ...style\n  };\n\n  // Default styles for the ComponentPalette\n  const defaultStyles: Record<string, CSSProperties> = {\n    // Header section\n    header: {\n      padding: '16px',\n      borderBottom: '1px solid #1a202c',\n      background: '#202938'\n    },\n\n    // Title\n    title: {\n      margin: '0 0 12px 0',\n      fontSize: '18px',\n      fontWeight: 600,\n      color: '#e2e8f0'\n    },\n\n    // Search container\n    searchContainer: {\n      position: 'relative',\n      display: 'flex',\n      alignItems: 'center'\n    },\n\n    // Search input\n    searchInput: {\n      width: '100%',\n      padding: '10px 12px 10px 36px',\n      fontSize: '14px',\n      border: '1px solid #4a5568',\n      borderRadius: '8px',\n      backgroundColor: '#1a202c',\n      color: '#e2e8f0',\n      transition: 'all 0.2s ease',\n      outline: 'none',\n      boxSizing: 'border-box',\n      boxShadow: 'inset 0 1px 2px rgba(0, 0, 0, 0.2)'\n    },\n\n    // Search icon\n    searchIcon: {\n      position: 'absolute',\n      left: '12px',\n      pointerEvents: 'none',\n      color: '#a0aec0'\n    },\n\n    // Clear search button\n    clearSearchButton: {\n      position: 'absolute',\n      right: '12px',\n      background: 'none',\n      border: 'none',\n      cursor: 'pointer',\n      padding: '0',\n      display: 'flex',\n      alignItems: 'center',\n      justifyContent: 'center',\n      color: '#a0aec0'\n    },\n\n    // Category tabs\n    categoryTabs: {\n      display: 'flex',\n      overflowX: 'auto',\n      padding: '0 16px',\n      scrollbarWidth: 'none' as const,\n      msOverflowStyle: 'none' as const,\n      background: '#202938',\n      position: 'relative',\n      zIndex: 1\n    },\n\n    // Category tabs inner\n    categoryTabsInner: {\n      display: 'flex',\n      padding: '8px 0',\n      gap: '8px'\n    },\n\n    // Category tab\n    categoryTab: {\n      padding: '8px 16px',\n      borderRadius: '6px',\n      fontSize: '14px',\n      fontWeight: 500,\n      border: 'none',\n      background: 'transparent',\n      color: '#a0aec0',\n      cursor: 'pointer',\n      whiteSpace: 'nowrap',\n      transition: 'all 0.2s ease',\n      boxShadow: 'none'\n    },\n\n    // Active category tab\n    activeCategoryTab: {\n      background: '#3182ce',\n      color: '#fff',\n      boxShadow: '0 1px 3px rgba(0, 0, 0, 0.2)'\n    },\n\n    // Component list\n    componentList: {\n      overflowY: 'auto',\n      height: '100%',\n      padding: '0 16px 16px',\n      position: 'relative',\n      zIndex: 1\n    },\n\n    // Empty state\n    emptyState: {\n      display: 'flex',\n      flexDirection: 'column' as const,\n      alignItems: 'center',\n      justifyContent: 'center',\n      padding: '32px 0',\n      color: '#718096',\n      textAlign: 'center',\n      margin: '16px 0'\n    },\n\n    // Component items container\n    componentItems: {\n      padding: 0,\n      margin: '16px 0 0 0',\n      display: 'grid',\n      gap: '10px'\n    },\n\n    // Component item\n    componentItem: {\n      display: 'flex',\n      alignItems: 'center',\n      padding: '10px 12px',\n      borderRadius: '8px',\n      background: '#1a202c',\n      border: '1px solid #2d3748',\n      boxShadow: '0 1px 3px rgba(0, 0, 0, 0.2)',\n      cursor: 'pointer',\n      transition: 'all 0.2s ease',\n      gap: '12px',\n      listStyle: 'none'\n    },\n\n    // Component icon\n    componentIcon: {\n      display: 'flex',\n      alignItems: 'center',\n      justifyContent: 'center',\n      width: '48px',\n      height: '48px',\n      borderRadius: '6px',\n      background: '#2d3748',\n      color: '#a0aec0',\n      flexShrink: 0\n    },\n\n    // Component details\n    componentDetails: {\n      display: 'flex',\n      flexDirection: 'column' as const,\n      overflow: 'hidden'\n    },\n\n    // Component name\n    componentName: {\n      fontWeight: 500,\n      fontSize: '14px',\n      color: '#e2e8f0',\n      whiteSpace: 'nowrap',\n      overflow: 'hidden',\n      textOverflow: 'ellipsis',\n      opacity: 0.9\n    },\n\n    // Component category\n    componentCategory: {\n      fontSize: '12px',\n      color: '#a0aec0',\n      marginTop: '2px',\n      opacity: 0.7\n    },\n\n    // Component arrow\n    componentArrow: {\n      marginLeft: 'auto',\n      opacity: 0.4,\n      flexShrink: 0,\n      color: '#718096'\n    },\n\n    // Left shadow\n    leftShadow: {\n      position: 'absolute',\n      top: 0,\n      left: 0,\n      width: '16px',\n      height: '100%',\n      background: 'linear-gradient(to right, rgba(32, 41, 56, 0.9), rgba(32, 41, 56, 0))',\n      zIndex: 2,\n      pointerEvents: 'none'\n    },\n\n    // Right shadow\n    rightShadow: {\n      position: 'absolute',\n      top: 0,\n      right: 0,\n      width: '16px',\n      height: '100%',\n      background: 'linear-gradient(to left, rgba(32, 41, 56, 0.9), rgba(32, 41, 56, 0))',\n      zIndex: 2,\n      pointerEvents: 'none'\n    },\n\n    // Top shadow\n    topShadow: {\n      position: 'absolute',\n      top: 0,\n      left: 0,\n      right: 0,\n      height: '12px',\n      background: 'linear-gradient(to bottom, rgba(45, 55, 72, 0.9), rgba(45, 55, 72, 0))',\n      zIndex: 2,\n      pointerEvents: 'none'\n    },\n\n    // Bottom shadow\n    bottomShadow: {\n      position: 'absolute',\n      bottom: 0,\n      left: 0,\n      right: 0,\n      height: '12px',\n      background: 'linear-gradient(to top, rgba(45, 55, 72, 0.9), rgba(45, 55, 72, 0))',\n      zIndex: 2,\n      pointerEvents: 'none'\n    }\n  };\n\n  return (\n    <HeadlessComponentPalette\n      onSelectComponent={onSelectComponent}\n      onDragComponent={onDragComponent}\n      className={className}\n      style={rootStyle}\n      styles={defaultStyles}\n    />\n  );\n};\n\nexport default ComponentPalette;\n","/**\n * HeadlessCircuitToolbar Component\n * \n * A headless (unstyled) toolbar for circuit operations like delete, copy, etc.\n * This component provides all the functionality without any styling, allowing users\n * to apply their own styling using their preferred method.\n */\n\nimport React from 'react';\n\nexport type ToolbarAction = \n  | 'delete'\n  | 'copy'\n  | 'paste'\n  | 'undo'\n  | 'redo'\n  | 'zoom-in'\n  | 'zoom-out'\n  | 'zoom-fit'\n  | 'grid-toggle'\n  | 'rotate-cw'\n  | 'rotate-ccw'\n  | 'validate';\n\nexport interface HeadlessCircuitToolbarProps {\n  /** Callback when a toolbar action is triggered */\n  onAction: (action: ToolbarAction) => void;\n  /** Whether there is a selection (affects button states) */\n  hasSelection?: boolean;\n  /** Whether undo is available */\n  canUndo?: boolean;\n  /** Whether redo is available */\n  canRedo?: boolean;\n  /** Whether the grid is currently shown */\n  showGrid?: boolean;\n  /** Number of validation issues */\n  validationIssues?: number;\n  /** Additional class name for the root element */\n  className?: string;\n  /** Additional class names for sub-components */\n  classNames?: {\n    /** Class for the toolbar container */\n    toolbar?: string;\n    /** Class for each toolbar group */\n    group?: string;\n    /** Class for each toolbar button */\n    button?: string;\n    /** Class for disabled buttons */\n    disabledButton?: string;\n    /** Class for the validation button */\n    validationButton?: string;\n    /** Class for the validation button with issues */\n    validationButtonWithIssues?: string;\n  };\n  /** Additional inline styles for the root element */\n  style?: React.CSSProperties;\n  /** Additional inline styles for sub-components */\n  styles?: {\n    [key: string]: React.CSSProperties;\n  };\n}\n\nconst HeadlessCircuitToolbar: React.FC<HeadlessCircuitToolbarProps> = ({\n  onAction,\n  hasSelection = false,\n  canUndo = false,\n  canRedo = false,\n  showGrid = true,\n  validationIssues = 0,\n  className = '',\n  classNames = {},\n  style = {},\n  styles = {}\n}) => {\n  return (\n    <div \n      className={`cb-circuit-toolbar ${className}`}\n      style={style}\n      data-testid=\"circuit-toolbar\"\n    >\n      <div \n        className={`cb-toolbar-group ${classNames.group || ''}`}\n        style={styles.group}\n      >\n        <button\n          className={`cb-toolbar-button ${classNames.button || ''} ${!hasSelection ? `cb-toolbar-button-disabled ${classNames.disabledButton || ''}` : ''}`}\n          onClick={() => onAction('delete')}\n          disabled={!hasSelection}\n          title=\"Delete selected elements\"\n          aria-label=\"Delete selected elements\"\n          style={!hasSelection ? { ...styles.button, ...styles.disabledButton } : styles.button}\n          data-action=\"delete\"\n          data-disabled={!hasSelection}\n        >\n          Delete\n        </button>\n        <button\n          className={`cb-toolbar-button ${classNames.button || ''} ${!hasSelection ? `cb-toolbar-button-disabled ${classNames.disabledButton || ''}` : ''}`}\n          onClick={() => onAction('copy')}\n          disabled={!hasSelection}\n          title=\"Copy selected elements\"\n          aria-label=\"Copy selected elements\"\n          style={!hasSelection ? { ...styles.button, ...styles.disabledButton } : styles.button}\n          data-action=\"copy\"\n          data-disabled={!hasSelection}\n        >\n          Copy\n        </button>\n        <button\n          className={`cb-toolbar-button ${classNames.button || ''}`}\n          onClick={() => onAction('paste')}\n          title=\"Paste elements\"\n          aria-label=\"Paste elements\"\n          style={styles.button}\n          data-action=\"paste\"\n        >\n          Paste\n        </button>\n      </div>\n      \n      <div \n        className={`cb-toolbar-group ${classNames.group || ''}`}\n        style={styles.group}\n      >\n        <button\n          className={`cb-toolbar-button ${classNames.button || ''} ${!canUndo ? `cb-toolbar-button-disabled ${classNames.disabledButton || ''}` : ''}`}\n          onClick={() => onAction('undo')}\n          disabled={!canUndo}\n          title=\"Undo last action\"\n          aria-label=\"Undo last action\"\n          style={!canUndo ? { ...styles.button, ...styles.disabledButton } : styles.button}\n          data-action=\"undo\"\n          data-disabled={!canUndo}\n        >\n          Undo\n        </button>\n        <button\n          className={`cb-toolbar-button ${classNames.button || ''} ${!canRedo ? `cb-toolbar-button-disabled ${classNames.disabledButton || ''}` : ''}`}\n          onClick={() => onAction('redo')}\n          disabled={!canRedo}\n          title=\"Redo last undone action\"\n          aria-label=\"Redo last undone action\"\n          style={!canRedo ? { ...styles.button, ...styles.disabledButton } : styles.button}\n          data-action=\"redo\"\n          data-disabled={!canRedo}\n        >\n          Redo\n        </button>\n      </div>\n      \n      <div \n        className={`cb-toolbar-group ${classNames.group || ''}`}\n        style={styles.group}\n      >\n        <button\n          className={`cb-toolbar-button ${classNames.button || ''}`}\n          onClick={() => onAction('zoom-in')}\n          title=\"Zoom in\"\n          aria-label=\"Zoom in\"\n          style={styles.button}\n          data-action=\"zoom-in\"\n        >\n          Zoom In\n        </button>\n        <button\n          className={`cb-toolbar-button ${classNames.button || ''}`}\n          onClick={() => onAction('zoom-out')}\n          title=\"Zoom out\"\n          aria-label=\"Zoom out\"\n          style={styles.button}\n          data-action=\"zoom-out\"\n        >\n          Zoom Out\n        </button>\n        <button\n          className={`cb-toolbar-button ${classNames.button || ''}`}\n          onClick={() => onAction('zoom-fit')}\n          title=\"Fit circuit to view\"\n          aria-label=\"Fit circuit to view\"\n          style={styles.button}\n          data-action=\"zoom-fit\"\n        >\n          Fit\n        </button>\n      </div>\n      \n      <div \n        className={`cb-toolbar-group ${classNames.group || ''}`}\n        style={styles.group}\n      >\n        <button\n          className={`cb-toolbar-button ${classNames.button || ''} ${!hasSelection ? `cb-toolbar-button-disabled ${classNames.disabledButton || ''}` : ''}`}\n          onClick={() => onAction('rotate-cw')}\n          disabled={!hasSelection}\n          title=\"Rotate clockwise\"\n          aria-label=\"Rotate clockwise\"\n          style={!hasSelection ? { ...styles.button, ...styles.disabledButton } : styles.button}\n          data-action=\"rotate-cw\"\n          data-disabled={!hasSelection}\n        >\n          Rotate CW\n        </button>\n        <button\n          className={`cb-toolbar-button ${classNames.button || ''} ${!hasSelection ? `cb-toolbar-button-disabled ${classNames.disabledButton || ''}` : ''}`}\n          onClick={() => onAction('rotate-ccw')}\n          disabled={!hasSelection}\n          title=\"Rotate counter-clockwise\"\n          aria-label=\"Rotate counter-clockwise\"\n          style={!hasSelection ? { ...styles.button, ...styles.disabledButton } : styles.button}\n          data-action=\"rotate-ccw\"\n          data-disabled={!hasSelection}\n        >\n          Rotate CCW\n        </button>\n      </div>\n      \n      <div \n        className={`cb-toolbar-group ${classNames.group || ''}`}\n        style={styles.group}\n      >\n        <button\n          className={`cb-toolbar-button ${classNames.button || ''} ${validationIssues > 0 ? `cb-toolbar-button-validation-issues ${classNames.validationButtonWithIssues || ''}` : `cb-toolbar-button-validation ${classNames.validationButton || ''}`}`}\n          onClick={() => onAction('validate')}\n          title=\"Validate circuit\"\n          aria-label={`Validate circuit${validationIssues > 0 ? ` (${validationIssues} issues)` : ''}`}\n          style={validationIssues > 0 ? { ...styles.button, ...styles.validationButtonWithIssues } : { ...styles.button, ...styles.validationButton }}\n          data-action=\"validate\"\n          data-issues={validationIssues}\n        >\n          Validate {validationIssues > 0 ? `(${validationIssues})` : ''}\n        </button>\n      </div>\n      \n      <div \n        className={`cb-toolbar-group ${classNames.group || ''}`}\n        style={styles.group}\n      >\n        <button\n          className={`cb-toolbar-button ${classNames.button || ''}`}\n          onClick={() => onAction('grid-toggle')}\n          title={showGrid ? \"Hide grid\" : \"Show grid\"}\n          aria-label={showGrid ? \"Hide grid\" : \"Show grid\"}\n          style={styles.button}\n          data-action=\"grid-toggle\"\n          data-grid-shown={showGrid}\n        >\n          {showGrid ? \"Hide Grid\" : \"Show Grid\"}\n        </button>\n      </div>\n    </div>\n  );\n};\n\nexport default HeadlessCircuitToolbar;\n","/**\n * CircuitToolbar Component\n *\n * A toolbar for circuit operations like delete, copy, etc.\n * This is a styled wrapper around the HeadlessCircuitToolbar component.\n */\n\nimport React, { CSSProperties } from 'react';\nimport HeadlessCircuitToolbar, { ToolbarAction } from './headless/HeadlessCircuitToolbar';\n\nexport interface CircuitToolbarProps {\n  onAction: (action: ToolbarAction) => void;\n  hasSelection?: boolean;\n  canUndo?: boolean;\n  canRedo?: boolean;\n  showGrid?: boolean;\n  validationIssues?: number;\n  className?: string;\n  style?: React.CSSProperties;\n}\n\nconst CircuitToolbar: React.FC<CircuitToolbarProps> = ({\n  onAction,\n  hasSelection = false,\n  canUndo = false,\n  canRedo = false,\n  showGrid = true,\n  validationIssues = 0,\n  className = '',\n  style = {}\n}) => {\n  // Root style with user's custom style\n  const rootStyle: CSSProperties = {\n    display: 'flex',\n    padding: '8px',\n    backgroundColor: '#1a202c',\n    borderBottom: '1px solid #2d3748',\n    gap: '8px',\n    ...style\n  };\n\n  // Default styles for the CircuitToolbar\n  const defaultStyles: Record<string, CSSProperties> = {\n    // Toolbar group\n    group: {\n      display: 'flex',\n      gap: '4px',\n      padding: '0 4px',\n      borderRight: '1px solid #2d3748',\n      marginRight: '4px'\n    },\n\n    // Toolbar button\n    button: {\n      padding: '6px 12px',\n      backgroundColor: '#2d3748',\n      color: '#e2e8f0',\n      border: 'none',\n      borderRadius: '4px',\n      fontSize: '14px',\n      cursor: 'pointer',\n      transition: 'all 0.2s ease',\n      display: 'flex',\n      alignItems: 'center',\n      justifyContent: 'center'\n    },\n\n    // Disabled button\n    disabledButton: {\n      opacity: 0.5,\n      cursor: 'not-allowed',\n      backgroundColor: '#2d3748'\n    },\n\n    // Validation button\n    validationButton: {\n      backgroundColor: '#2d3748'\n    },\n\n    // Validation button with issues\n    validationButtonWithIssues: {\n      backgroundColor: '#742a2a',\n      color: '#feb2b2'\n    }\n  };\n\n  return (\n    <HeadlessCircuitToolbar\n      onAction={onAction}\n      hasSelection={hasSelection}\n      canUndo={canUndo}\n      canRedo={canRedo}\n      showGrid={showGrid}\n      validationIssues={validationIssues}\n      className={className}\n      style={rootStyle}\n      styles={defaultStyles}\n    />\n  );\n};\n\nexport type { ToolbarAction };\nexport default CircuitToolbar;\n","/**\n * SimpleCircuitExample Component\n * \n * A simple example of using the Circuit-Bricks library.\n */\n\nimport React, { useEffect } from 'react';\nimport { \n  CircuitCanvas, \n  useCircuit, \n  PropertyPanel, \n  ComponentPalette,\n  CircuitToolbar\n} from '../index';\n\nconst SimpleCircuitExample: React.FC = () => {\n  const [circuit, actions] = useCircuit();\n  const {\n    addComponent,\n    updateComponent,\n    removeComponent,\n    addWire,\n    updateWire,\n    removeWire,\n    selectComponent,\n    selectWire,\n    deselectAll\n  } = actions;\n\n  // Create a simple circuit on component mount\n  useEffect(() => {\n    // Add a battery\n    const batteryId = addComponent({\n      type: 'battery',\n      position: { x: 100, y: 200 },\n      props: { voltage: 9 }\n    });\n\n    // Add a resistor\n    const resistorId = addComponent({\n      type: 'resistor',\n      position: { x: 200, y: 200 },\n      props: { resistance: 220 }\n    });\n\n    // Add an LED\n    const diodeId = addComponent({\n      type: 'diode',\n      position: { x: 300, y: 200 },\n      props: { forwardVoltage: 1.8 }\n    });\n\n    // Add a ground\n    const groundId = addComponent({\n      type: 'ground',\n      position: { x: 200, y: 300 },\n      props: {}\n    });\n\n    // Connect the components with wires\n    addWire(\n      { componentId: batteryId, portId: 'positive' },\n      { componentId: resistorId, portId: 'left' }\n    );\n\n    addWire(\n      { componentId: resistorId, portId: 'right' },\n      { componentId: diodeId, portId: 'anode' }\n    );\n\n    addWire(\n      { componentId: diodeId, portId: 'cathode' },\n      { componentId: groundId, portId: 'terminal' }\n    );\n\n    addWire(\n      { componentId: batteryId, portId: 'negative' },\n      { componentId: groundId, portId: 'terminal' }\n    );\n  }, []);\n\n  // Handle component selection\n  const handleComponentClick = (id: string) => {\n    selectComponent(id);\n  };\n\n  // Handle wire selection\n  const handleWireClick = (id: string) => {\n    selectWire(id);\n  };\n\n  // Handle canvas click (deselect all)\n  const handleCanvasClick = () => {\n    deselectAll();\n  };\n\n  // Handle property changes\n  const handlePropertyChange = (id: string, key: string, value: any) => {\n    updateComponent(id, {\n      props: {\n        ...circuit.components.find(c => c.id === id)?.props,\n        [key]: value\n      }\n    });\n  };\n\n  // Handle component selection from palette\n  const handleSelectComponent = (componentType: string) => {\n    addComponent({\n      type: componentType,\n      position: { x: 200, y: 200 }, // Center of canvas, should be improved\n      props: {}\n    });\n  };\n\n  // Handle toolbar actions\n  const handleToolbarAction = (action: string) => {\n    switch (action) {\n      case 'delete':\n        // Delete selected components\n        circuit.selectedComponentIds.forEach(id => removeComponent(id));\n        // Delete selected wires\n        circuit.selectedWireIds.forEach(id => removeWire(id));\n        break;\n      \n      // Other actions would be implemented here\n      \n      default:\n        console.log(`Action not implemented: ${action}`);\n    }\n  };\n\n  // Get the currently selected component (first one if multiple)\n  const selectedComponent = circuit.selectedComponentIds.length > 0\n    ? circuit.components.find(c => c.id === circuit.selectedComponentIds[0]) || null\n    : null;\n\n  return (\n    <div className=\"circuit-example\">\n      <div className=\"circuit-toolbar-container\">\n        <CircuitToolbar\n          onAction={handleToolbarAction}\n          hasSelection={circuit.selectedComponentIds.length > 0 || circuit.selectedWireIds.length > 0}\n        />\n      </div>\n      \n      <div className=\"circuit-workspace\">\n        <div className=\"component-palette-container\">\n          <ComponentPalette onSelectComponent={handleSelectComponent} />\n        </div>\n        \n        <div className=\"circuit-canvas-container\">\n          <CircuitCanvas\n            components={circuit.components}\n            wires={circuit.wires}\n            selectedComponentIds={circuit.selectedComponentIds}\n            selectedWireIds={circuit.selectedWireIds}\n            onComponentClick={handleComponentClick}\n            onWireClick={handleWireClick}\n            onCanvasClick={handleCanvasClick}\n            width=\"800px\"\n            height=\"600px\"\n          />\n        </div>\n        \n        <div className=\"property-panel-container\">\n          <PropertyPanel\n            component={selectedComponent}\n            onPropertyChange={handlePropertyChange}\n          />\n        </div>\n      </div>\n    </div>\n  );\n};\n\nexport default SimpleCircuitExample;\n","/**\n * InteractiveCircuitExample Component\n * \n * Example component showcasing interactive features of the circuit-bricks library.\n */\n\nimport React, { useRef, useEffect, useState } from 'react';\nimport { \n  CircuitCanvas, \n  useCircuit,\n  ComponentPalette,\n  PropertyPanel,\n  CircuitToolbar,\n  Point\n} from '../index';\nimport { validateCircuit } from '../utils/circuitValidation';\n\nconst InteractiveCircuitExample: React.FC = () => {\n  const containerRef = useRef<HTMLDivElement>(null);\n  \n  // Initialize the circuit state\n  const [state, {\n    addComponent,\n    updateComponent,\n    removeComponent,\n    addWire,\n    removeWire,\n    selectComponent,\n    selectWire,\n    deselectAll,\n    moveComponent,\n    startWireDrawing,\n    completeWireDrawing,\n    cancelWireDrawing,\n    isValidConnection,\n    rotateComponent,\n    rotateSelectedComponents,\n    undo,\n    redo,\n    canUndo,\n    canRedo\n  }] = useCircuit();\n  \n  // Wire drawing state\n  const [wireDrawing, setWireDrawing] = React.useState<{\n    isDrawing: boolean;\n    fromComponentId: string | null;\n    fromPortId: string | null;\n  }>({\n    isDrawing: false,\n    fromComponentId: null,\n    fromPortId: null\n  });\n  \n  // State for validation issues\n  const [validationIssues, setValidationIssues] = useState<number>(0);\n  \n  // Handler for selecting a component from the palette\n  const handleSelectComponent = (componentType: string) => {\n    // Calculate position in the middle of the canvas\n    const container = containerRef.current;\n    let posX = 200;\n    let posY = 200;\n    \n    if (container) {\n      const rect = container.getBoundingClientRect();\n      posX = rect.width / 2;\n      posY = rect.height / 2;\n    }\n    \n    // Add the component to the circuit\n    const id = addComponent({\n      type: componentType,\n      position: { x: posX, y: posY },\n      props: {}\n    });\n    \n    // Select the new component\n    selectComponent(id);\n  };\n  \n  // Handler for drag and drop\n  const handleComponentDrop = (componentType: string, position: Point) => {\n    // Add the component to the circuit at the drop position\n    const id = addComponent({\n      type: componentType,\n      position,\n      props: {}\n    });\n    \n    // Select the new component\n    selectComponent(id);\n  };\n  \n  // Handler for toolbar actions\n  const handleToolbarAction = (action: string) => {\n    switch (action) {\n      case 'delete':\n        // Delete selected components and wires\n        state.selectedComponentIds.forEach(id => removeComponent(id));\n        state.selectedWireIds.forEach(id => removeWire(id));\n        break;\n      case 'grid-toggle':\n        // Toggle grid visibility\n        break;\n      case 'undo':\n        undo();\n        break;\n      case 'redo':\n        redo();\n        break;\n      case 'rotate-cw':\n        rotateSelectedComponents(90);\n        break;\n      case 'rotate-ccw':\n        rotateSelectedComponents(-90);\n        break;\n      case 'validate':\n        // Use the validation utility\n        const issues = validateCircuit(state);\n        setValidationIssues(issues.length);\n        \n        if (issues.length > 0) {\n          // Display first few issues\n          const message = issues\n            .slice(0, 3)\n            .map(issue => `- ${issue.message}`)\n            .join('\\n');\n          \n          alert(`Circuit validation found ${issues.length} issues:\\n${message}${\n            issues.length > 3 ? '\\n\\n...and ' + (issues.length - 3) + ' more' : ''\n          }`);\n        } else {\n          alert('Circuit validation successful! No issues found.');\n        }\n        break;\n      default:\n        console.log(`Action not implemented: ${action}`);\n    }\n  };\n  \n  // Handler for component property changes\n  const handlePropertyChange = (id: string, key: string, value: any) => {\n    const component = state.components.find(c => c.id === id);\n    if (component) {\n      const updatedProps = { ...component.props, [key]: value };\n      updateComponent(id, { props: updatedProps });\n    }\n  };\n\n  // Handle starting to draw a wire\n  const handleWireDrawStart = (componentId: string, portId: string) => {\n    setWireDrawing({\n      isDrawing: true,\n      fromComponentId: componentId,\n      fromPortId: portId\n    });\n    startWireDrawing(componentId, portId);\n  };\n  \n  // Handle completing a wire\n  const handleWireDrawEnd = (componentId: string, portId: string) => {\n    if (wireDrawing.fromComponentId && wireDrawing.fromPortId) {\n      const success = completeWireDrawing(componentId, portId);\n      setWireDrawing({\n        isDrawing: false,\n        fromComponentId: null,\n        fromPortId: null\n      });\n      return success;\n    }\n    return false;\n  };\n  \n  // Handle canceling wire drawing\n  const handleWireDrawCancel = () => {\n    setWireDrawing({\n      isDrawing: false,\n      fromComponentId: null,\n      fromPortId: null\n    });\n    cancelWireDrawing();\n  };\n  \n  // Handle component clicks\n  const handleComponentClick = (id: string, event: React.MouseEvent) => {\n    // Use Shift key for multi-selection\n    const addToSelection = event.shiftKey;\n    selectComponent(id, addToSelection);\n  };\n  \n  // Handle wire clicks\n  const handleWireClick = (id: string, event: React.MouseEvent) => {\n    // Use Shift key for multi-selection\n    const addToSelection = event.shiftKey;\n    selectWire(id, addToSelection);\n  };\n  \n  // Handle canvas click (deselect all when clicking on empty space)\n  const handleCanvasClick = () => {\n    deselectAll();\n  };\n  \n  return (\n    <div className=\"interactive-circuit-example\">\n      <div className=\"circuit-container\" ref={containerRef}>\n        <CircuitToolbar\n          onAction={handleToolbarAction}\n          hasSelection={state.selectedComponentIds.length > 0 || state.selectedWireIds.length > 0}\n          showGrid={true}\n          canUndo={canUndo()}\n          canRedo={canRedo()}\n          validationIssues={validationIssues}\n        />\n        \n        <div className=\"circuit-content\">\n          <ComponentPalette onSelectComponent={handleSelectComponent} />\n          \n          <div className=\"circuit-canvas-container\">\n            <CircuitCanvas\n              components={state.components}\n              wires={state.wires}\n              selectedComponentIds={state.selectedComponentIds}\n              selectedWireIds={state.selectedWireIds}\n              showGrid={true}\n              onComponentClick={handleComponentClick}\n              onWireClick={handleWireClick}\n              onCanvasClick={handleCanvasClick}\n              onComponentDrag={moveComponent}\n              onWireDrawStart={handleWireDrawStart}\n              onWireDrawEnd={handleWireDrawEnd}\n              onWireDrawCancel={handleWireDrawCancel}\n              wireDrawing={wireDrawing}\n              onComponentDrop={handleComponentDrop}\n            />\n          </div>\n          \n          <PropertyPanel\n            component={state.selectedComponentIds.length === 1\n              ? state.components.find(c => c.id === state.selectedComponentIds[0]) || null\n              : null\n            }\n            onPropertyChange={handlePropertyChange}\n          />\n        </div>\n      </div>\n      \n      <style>\n        {`\n        .interactive-circuit-example {\n          display: flex;\n          flex-direction: column;\n          height: 100%;\n          width: 100%;\n        }\n        \n        .circuit-container {\n          display: flex;\n          flex-direction: column;\n          flex: 1;\n          border: 1px solid #e0e0e0;\n          border-radius: 4px;\n          overflow: hidden;\n        }\n        \n        .circuit-content {\n          display: flex;\n          flex: 1;\n          overflow: hidden;\n        }\n        \n        .circuit-canvas-container {\n          flex: 1;\n          position: relative;\n          overflow: hidden;\n        }\n        `}\n      </style>\n    </div>\n  );\n};\n\nexport default InteractiveCircuitExample;\n","// filepath: /Users/harshithpasupuleti/code/circuit-bricks/examples/VoltageRegulatorExample.tsx\nimport React from 'react';\nimport CircuitCanvas from '../core/CircuitCanvas';\nimport useCircuit from '../hooks/useCircuit';\n\n/**\n * Voltage Regulator Circuit Example\n * \n * This example demonstrates a simple 7805 voltage regulator circuit\n * with input and output capacitors.\n * \n * Components:\n * - Battery (9V)\n * - IC (7805 voltage regulator)\n * - Input capacitor (100µF)\n * - Output capacitor (10µF)\n * - Resistor (load)\n * - Ground\n * \n * @returns {JSX.Element} The rendered circuit example\n */\nconst VoltageRegulatorExample: React.FC = () => {\n  const [state, actions] = useCircuit();\n\n  // Initialize the circuit on mount\n  React.useEffect(() => {\n    // Add components\n    const batteryId = actions.addComponent({\n      type: 'battery',\n      position: { x: 100, y: 100 },\n      props: { voltage: 9 }\n    });\n\n    const regulatorId = actions.addComponent({\n      type: 'ic',\n      position: { x: 300, y: 100 },\n      props: { \n        name: '7805',\n        pins: 3,\n        width: 60,\n        height: 40\n      }\n    });\n\n    const inputCapId = actions.addComponent({\n      type: 'capacitor',\n      position: { x: 200, y: 150 },\n      props: { capacitance: 100, unit: 'µF' }\n    });\n\n    const outputCapId = actions.addComponent({\n      type: 'capacitor',\n      position: { x: 400, y: 150 },\n      props: { capacitance: 10, unit: 'µF' }\n    });\n\n    const loadResistorId = actions.addComponent({\n      type: 'resistor',\n      position: { x: 500, y: 100 },\n      props: { resistance: 1000 }\n    });\n\n    const groundId = actions.addComponent({\n      type: 'ground',\n      position: { x: 300, y: 200 },\n      props: {}\n    });\n\n    // Connect components with wires\n    actions.addWire(\n      { componentId: batteryId, portId: 'positive' },\n      { componentId: regulatorId, portId: 'input' }\n    );\n\n    actions.addWire(\n      { componentId: batteryId, portId: 'negative' },\n      { componentId: groundId, portId: 'input' }\n    );\n\n    actions.addWire(\n      { componentId: regulatorId, portId: 'input' },\n      { componentId: inputCapId, portId: 'positive' }\n    );\n\n    actions.addWire(\n      { componentId: inputCapId, portId: 'negative' },\n      { componentId: groundId, portId: 'input' }\n    );\n\n    actions.addWire(\n      { componentId: regulatorId, portId: 'ground' },\n      { componentId: groundId, portId: 'input' }\n    );\n\n    actions.addWire(\n      { componentId: regulatorId, portId: 'output' },\n      { componentId: outputCapId, portId: 'positive' }\n    );\n\n    actions.addWire(\n      { componentId: outputCapId, portId: 'negative' },\n      { componentId: groundId, portId: 'input' }\n    );\n\n    actions.addWire(\n      { componentId: regulatorId, portId: 'output' },\n      { componentId: loadResistorId, portId: 'left' }\n    );\n\n    actions.addWire(\n      { componentId: loadResistorId, portId: 'right' },\n      { componentId: groundId, portId: 'input' }\n    );\n  }, []);\n\n  return (\n    <div className=\"example-container\">\n      <h2>Voltage Regulator Circuit (7805)</h2>\n      <p>A simple 9V to 5V regulator with input and output capacitors</p>\n      <div className=\"circuit-container\">\n        <CircuitCanvas\n          components={state.components}\n          wires={state.wires}\n          width={700}\n          height={400}\n          showGrid={true}\n        />\n      </div>\n      <div className=\"description\">\n        <h3>Circuit Description</h3>\n        <p>\n          This circuit converts a 9V input to a regulated 5V output using the 7805 linear voltage regulator.\n          The input capacitor (100µF) helps smooth out input voltage fluctuations, while the\n          output capacitor (10µF) improves transient response. A 1kΩ resistor serves as the load.\n        </p>\n      </div>\n    </div>\n  );\n};\n\nexport default VoltageRegulatorExample;\n","import React from 'react';\nimport CircuitCanvas from '../core/CircuitCanvas';\nimport useCircuit from '../hooks/useCircuit';\n\n/**\n * 555 Timer Circuit Example\n * \n * This example demonstrates a 555 timer in astable multivibrator mode,\n * creating an LED blinker circuit.\n * \n * Components:\n * - Battery (9V)\n * - IC (555 timer)\n * - Resistors (timing resistors)\n * - Capacitor (timing capacitor)\n * - LED\n * - Ground\n * \n * @returns {JSX.Element} The rendered circuit example\n */\nconst TimerCircuitExample: React.FC = () => {\n  const [state, actions] = useCircuit();\n\n  // Initialize the circuit on mount\n  React.useEffect(() => {\n    // Add components\n    const batteryId = actions.addComponent({\n      type: 'battery',\n      position: { x: 100, y: 100 },\n      props: { voltage: 9 }\n    });\n\n    const timerICId = actions.addComponent({\n      type: 'ic',\n      position: { x: 300, y: 150 },\n      props: { \n        name: '555',\n        pins: 8,\n        width: 80,\n        height: 100\n      }\n    });\n\n    const resistor1Id = actions.addComponent({\n      type: 'resistor',\n      position: { x: 200, y: 50 },\n      props: { resistance: 10, unit: 'kΩ' }\n    });\n\n    const resistor2Id = actions.addComponent({\n      type: 'resistor',\n      position: { x: 400, y: 50 },\n      props: { resistance: 100, unit: 'kΩ' }\n    });\n\n    const capacitorId = actions.addComponent({\n      type: 'capacitor',\n      position: { x: 200, y: 250 },\n      props: { capacitance: 10, unit: 'µF' }\n    });\n\n    const ledId = actions.addComponent({\n      type: 'led',\n      position: { x: 500, y: 150 },\n      props: { color: '#ff0000' }\n    });\n\n    const resistor3Id = actions.addComponent({\n      type: 'resistor',\n      position: { x: 500, y: 250 },\n      props: { resistance: 330 }\n    });\n\n    const groundId = actions.addComponent({\n      type: 'ground',\n      position: { x: 300, y: 350 },\n      props: {}\n    });\n\n    // Connect components with wires\n    // Battery connections\n    actions.addWire(\n      { componentId: batteryId, portId: 'positive' },\n      { componentId: timerICId, portId: 'vcc' }\n    );\n\n    actions.addWire(\n      { componentId: batteryId, portId: 'negative' },\n      { componentId: groundId, portId: 'input' }\n    );\n\n    // Timer IC connections\n    actions.addWire(\n      { componentId: timerICId, portId: 'ground' },\n      { componentId: groundId, portId: 'input' }\n    );\n\n    actions.addWire(\n      { componentId: timerICId, portId: 'trigger' },\n      { componentId: capacitorId, portId: 'negative' }\n    );\n\n    actions.addWire(\n      { componentId: timerICId, portId: 'threshold' },\n      { componentId: capacitorId, portId: 'positive' }\n    );\n\n    actions.addWire(\n      { componentId: timerICId, portId: 'discharge' },\n      { componentId: resistor2Id, portId: 'left' }\n    );\n\n    actions.addWire(\n      { componentId: resistor1Id, portId: 'left' },\n      { componentId: batteryId, portId: 'positive' }\n    );\n\n    actions.addWire(\n      { componentId: resistor1Id, portId: 'right' },\n      { componentId: resistor2Id, portId: 'right' }\n    );\n\n    actions.addWire(\n      { componentId: resistor2Id, portId: 'right' },\n      { componentId: timerICId, portId: 'threshold' }\n    );\n\n    actions.addWire(\n      { componentId: capacitorId, portId: 'negative' },\n      { componentId: groundId, portId: 'input' }\n    );\n\n    // LED connections\n    actions.addWire(\n      { componentId: timerICId, portId: 'output' },\n      { componentId: ledId, portId: 'anode' }\n    );\n\n    actions.addWire(\n      { componentId: ledId, portId: 'cathode' },\n      { componentId: resistor3Id, portId: 'left' }\n    );\n\n    actions.addWire(\n      { componentId: resistor3Id, portId: 'right' },\n      { componentId: groundId, portId: 'input' }\n    );\n  }, []);\n\n  return (\n    <div className=\"example-container\">\n      <h2>555 Timer LED Blinker Circuit</h2>\n      <p>An astable multivibrator circuit using the 555 timer IC to blink an LED</p>\n      <div className=\"circuit-container\">\n        <CircuitCanvas\n          components={state.components}\n          wires={state.wires}\n          width={700}\n          height={500}\n          showGrid={true}\n        />\n      </div>\n      <div className=\"description\">\n        <h3>Circuit Description</h3>\n        <p>\n          This circuit uses a 555 timer IC configured as an astable multivibrator to generate\n          a continuous square wave output. The frequency is determined by the values of the two\n          resistors (10kΩ and 100kΩ) and the 10µF capacitor, resulting in a blinking LED.\n          The blinking rate can be adjusted by changing the resistor and capacitor values.\n        </p>\n        <p>\n          <strong>Formula:</strong> f ≈ 1.44 / ((R1 + 2 × R2) × C)\n        </p>\n      </div>\n    </div>\n  );\n};\n\nexport default TimerCircuitExample;\n","/**\n * Registry Metadata System for LLM Integration\n *\n * This module provides metadata about the component registry that helps\n * LLMs (Large Language Models) understand the available components,\n * their categories, and their capabilities.\n */\n\nimport { ComponentSchema } from '../schemas/componentSchema';\nimport { getAllComponents, getComponentsByCategory } from './index';\n\n/**\n * Registry metadata interface\n */\nexport interface RegistryMetadata {\n  /**\n   * Total number of components in the registry\n   */\n  totalComponents: number;\n\n  /**\n   * List of all available component categories\n   */\n  categories: string[];\n\n  /**\n   * Map of category to component count\n   */\n  componentCountByCategory: Record<string, number>;\n\n  /**\n   * List of all component IDs\n   */\n  componentIds: string[];\n\n  /**\n   * Map of component ID to component name\n   */\n  componentNames: Record<string, string>;\n\n  /**\n   * Map of component ID to component description\n   */\n  componentDescriptions: Record<string, string>;\n\n  /**\n   * Last updated timestamp\n   */\n  lastUpdated: string;\n}\n\n/**\n * Generate metadata about the component registry\n *\n * This function analyzes the current state of the component registry\n * and generates metadata that can be used by LLMs to understand\n * what components are available.\n *\n * @returns Registry metadata object\n */\nexport function generateRegistryMetadata(): RegistryMetadata {\n  const allComponents = getAllComponents();\n  const categories = [...new Set(allComponents.map(c => c.category))];\n\n  const componentCountByCategory: Record<string, number> = {};\n  categories.forEach(category => {\n    componentCountByCategory[category] = getComponentsByCategory(category).length;\n  });\n\n  const componentIds = allComponents.map(c => c.id);\n\n  const componentNames: Record<string, string> = {};\n  const componentDescriptions: Record<string, string> = {};\n\n  allComponents.forEach(component => {\n    componentNames[component.id] = component.name;\n    componentDescriptions[component.id] = component.description;\n  });\n\n  return {\n    totalComponents: allComponents.length,\n    categories,\n    componentCountByCategory,\n    componentIds,\n    componentNames,\n    componentDescriptions,\n    lastUpdated: new Date().toISOString()\n  };\n}\n\n/**\n * Get a summary of a component for LLM consumption\n *\n * @param componentId The ID of the component to summarize\n * @returns A string summary of the component\n */\nexport function getComponentSummary(component: ComponentSchema): string {\n  const portSummary = component.ports.map(port =>\n    `- ${port.id} (${port.type}${port.label ? `: ${port.label}` : ''})`\n  ).join('\\n');\n\n  const propertySummary = component.properties.map(prop => {\n    let summary = `- ${prop.key} (${prop.type}): ${prop.label}`;\n    if (prop.unit) summary += `, unit: ${prop.unit}`;\n    if (prop.default !== undefined) summary += `, default: ${prop.default}`;\n    if (prop.min !== undefined) summary += `, min: ${prop.min}`;\n    if (prop.max !== undefined) summary += `, max: ${prop.max}`;\n    if (prop.options) {\n      summary += `, options: [${prop.options.map(o => `${o.value} (${o.label})`).join(', ')}]`;\n    }\n    return summary;\n  }).join('\\n');\n\n  return `\nComponent: ${component.name} (${component.id})\nCategory: ${component.category}\nDescription: ${component.description}\nDimensions: ${component.defaultWidth}×${component.defaultHeight}\n\nPorts:\n${portSummary}\n\nProperties:\n${propertySummary}\n  `.trim();\n}\n\n/**\n * Generate a complete registry summary for LLM consumption\n *\n * @returns A string summary of the entire registry\n */\nexport function generateRegistrySummary(): string {\n  const metadata = generateRegistryMetadata();\n  const allComponents = getAllComponents();\n\n  const categorySummaries = metadata.categories.map(category => {\n    const components = getComponentsByCategory(category);\n    const componentList = components.map(c => `- ${c.name} (${c.id}): ${c.description}`).join('\\n');\n\n    return `\n## ${category.charAt(0).toUpperCase() + category.slice(1)} Components (${components.length})\n${componentList}\n    `.trim();\n  }).join('\\n\\n');\n\n  return `\n# Circuit-Bricks Component Registry\n\nTotal components: ${metadata.totalComponents}\nLast updated: ${metadata.lastUpdated}\n\n${categorySummaries}\n  `.trim();\n}\n","/**\n * Circuit-Bricks - A modular, Lego-style SVG circuit component system for React\n *\n * @package circuit-bricks\n * @version 0.1.0\n * @license MIT\n * @author Sphere Labs\n */\n\n// Export types from ZOD schemas (single source of truth)\nexport {\n  componentSchema,\n  portSchema,\n  propertySchema,\n  wireSchema,\n  circuitStateSchema,\n  validationIssueSchema,\n  // Export derived types\n  type PortType,\n  type Point,\n  type Size,\n  type PortSchema,\n  type PropertySchema,\n  type ComponentSchema,\n  type ComponentInstance,\n  type Wire,\n  type CircuitState,\n  type ValidationIssue\n} from './schemas/componentSchema';\n\n// Core components\nexport { default as CircuitCanvas } from './core/CircuitCanvas';\nexport { default as SSRSafeCircuitCanvas } from './core/SSRSafeCircuitCanvas';\nexport { default as Brick } from './core/Brick';\nexport { default as BaseComponent } from './core/BaseComponent';\nexport { default as Port } from './core/Port';\nexport { default as WirePath } from './core/WirePath';\n\n// Hooks\nexport { default as useCircuit } from './hooks/useCircuit';\nexport { default as usePortPosition, useSinglePortPosition } from './hooks/usePortPosition';\n\n// UI Components\nexport { default as PropertyPanel } from './ui/PropertyPanel';\nexport { default as ComponentPalette } from './ui/ComponentPalette';\nexport { default as CircuitToolbar } from './ui/CircuitToolbar';\nexport type { ToolbarAction } from './ui/CircuitToolbar';\n\n// Headless UI Components\nexport { default as HeadlessPropertyPanel } from './ui/headless/HeadlessPropertyPanel';\nexport { default as HeadlessComponentPalette } from './ui/headless/HeadlessComponentPalette';\nexport { default as HeadlessCircuitToolbar } from './ui/headless/HeadlessCircuitToolbar';\nexport type { ToolbarAction as HeadlessToolbarAction } from './ui/headless/HeadlessCircuitToolbar';\n\n// Examples\nexport { default as SimpleCircuitExample } from './examples/SimpleCircuitExample';\nexport { default as InteractiveCircuitExample } from './examples/InteractiveCircuitExample';\nexport { default as VoltageRegulatorExample } from './examples/VoltageRegulatorExample';\nexport { default as TimerCircuitExample } from './examples/TimerCircuitExample';\n\n// Utilities\nexport { validateCircuit } from './utils/circuitValidation';\nexport { getPortPosition } from './utils/getPortPosition';\nexport {\n  validateComponentSchema,\n  validateComponentInstance,\n  validateWire,\n  validateCircuitState\n} from './utils/zodValidation';\n\n// SSR and Browser Compatibility Utilities\nexport * from './utils/ssrUtils';\n\n// Performance Monitoring Utilities\nexport * from './utils/performanceUtils';\n\n// Touch and Mobile Utilities\nexport * from './utils/touchUtils';\n\n// Responsive Design Utilities\nexport * from './utils/responsiveUtils';\n\n// Registry utilities\nexport {\n  registerComponent,\n  getComponentSchema,\n  getAllComponents,\n  getComponentsByCategory\n} from './registry';\n\n// Registry metadata utilities\nexport {\n  generateRegistryMetadata,\n  generateRegistrySummary,\n  getComponentSummary\n} from './registry/metadata';\n\n// LLM Integration API\nexport * as LLM from './llm';\n\n/**\n * Current package version\n * @public\n */\nexport const version = '0.1.0';"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA8GA,SAAgB,WAAWA,cAAsE;CAE/F,MAAM,YAAY,kBAAuB,CAAE,EAAC;CAC5C,MAAM,YAAY,kBAAuB,CAAE,EAAC;CAE5C,MAAM,CAAC,OAAO,SAAS,GAAG,oBAAuB;EAC/C,YAAY,cAAc,cAAc,CAAE;EAC1C,OAAO,cAAc,SAAS,CAAE;EAChC,sBAAsB,cAAc,wBAAwB,CAAE;EAC9D,iBAAiB,cAAc,mBAAmB,CAAE;CACrD,EAAC;CAGF,MAAM,mBAAmB,uBAAY,CAACC,cAA4B;AAChE,YAAU,QAAQ,KAAK,KAAK,MAAM,KAAK,UAAU,UAAU,CAAC,CAAC;AAE7D,YAAU,UAAU,CAAE;CACvB,GAAE,CAAE,EAAC;CAGN,MAAM,sBAAsB,uBAAY,CAACC,YAAkD;AACzF,WAAS,UAAQ;AAEf,oBAAiB,KAAK;AAEtB,UAAO,QAAQ,KAAK;EACrB,EAAC;CACH,GAAE,CAAC,gBAAiB,EAAC;CAGtB,MAAM,aAAa,uBAAY,CAACC,WAA2B;AACzD,UAAQ,EAAE,OAAO,GAAG,KAAK,QAAQ,CAAC,SAAS,GAAG,CAAC,UAAU,GAAG,GAAG,CAAC;CACjE,GAAE,CAAE,EAAC;CAGN,MAAM,eAAe,uBAAY,CAACC,cAAqD;EACrF,MAAM,KAAK,WAAW,YAAY;AAClC,sBAAoB,WAAS;GAC3B,GAAG;GACH,YAAY,CAAC,GAAG,KAAK,YAAY;IAAE,GAAG;IAAW;GAAI,CAAC;E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