{"version":3,"file":"ModuleProviderContext.mjs","sources":["../../../src/lib/vdom/ModuleProviderContext.tsx"],"sourcesContent":["/**\n * @file Module Provider Context\n * @module vdom/ModuleProviderContext\n * @description Context definitions for the Module Provider.\n *\n * @author Agent 5 - PhD Virtual DOM Expert\n * @version 1.0.0\n */\n\nimport { createContext, type ReactNode } from 'react';\nimport { type ModuleId, type ModuleProviderConfig, type ModulePerformanceMetrics } from './types';\nimport { type VDOMPool } from './vdom-pool';\nimport { type ModuleRegistry } from './module-registry';\nimport { type ModuleLoader } from './module-loader';\nimport { type ModuleEventBus } from './event-bus';\nimport { type SecuritySandbox } from './security-sandbox';\n\n// ============================================================================\n// Types\n// ============================================================================\n\n/**\n * Module system context value.\n */\nexport interface ModuleSystemContextValue {\n  /** Configuration */\n  readonly config: ModuleProviderConfig;\n  /** VDOM pool instance */\n  readonly pool: VDOMPool;\n  /** Module registry instance */\n  readonly registry: ModuleRegistry;\n  /** Module loader instance */\n  readonly loader: ModuleLoader;\n  /** Event bus instance */\n  readonly eventBus: ModuleEventBus;\n  /** Global security sandbox */\n  readonly security: SecuritySandbox;\n  /** Whether system is initialized */\n  readonly isInitialized: boolean;\n  /** Report performance metrics */\n  readonly reportMetrics: (moduleId: ModuleId, metrics: ModulePerformanceMetrics) => void;\n  /** Check performance budget */\n  readonly checkBudget: (moduleId: ModuleId, metrics: ModulePerformanceMetrics) => void;\n}\n\n/**\n * Module provider props.\n */\nexport interface ModuleProviderProps {\n  /** Child components */\n  children: ReactNode;\n  /** Provider configuration */\n  config?: Partial<ModuleProviderConfig>;\n  /** Custom VDOM pool (optional) */\n  pool?: VDOMPool;\n  /** Custom registry (optional) */\n  registry?: ModuleRegistry;\n  /** Custom loader (optional) */\n  loader?: ModuleLoader;\n  /** Custom event bus (optional) */\n  eventBus?: ModuleEventBus;\n  /** Callback when system is ready */\n  onReady?: () => void;\n  /** Callback on system error */\n  onError?: (error: Error) => void;\n}\n\n// ============================================================================\n// Context\n// ============================================================================\n\n/**\n * Module system context.\n */\nexport const ModuleSystemContext = createContext<ModuleSystemContextValue | null>(null);\n\n/**\n * Internal module hierarchy context for tracking module nesting.\n */\nexport const ModuleHierarchyContext = createContext<{\n  moduleId: ModuleId | null;\n  depth: number;\n  path: ModuleId[];\n}>({\n  moduleId: null,\n  depth: 0,\n  path: [],\n});\n"],"names":["ModuleSystemContext","createContext","ModuleHierarchyContext"],"mappings":";AA0EO,MAAMA,IAAsBC,EAA+C,IAAI,GAKzEC,IAAyBD,EAInC;AAAA,EACD,UAAU;AAAA,EACV,OAAO;AAAA,EACP,MAAM,CAAA;AACR,CAAC;"}