{"version":3,"file":"index.mjs","sources":["../../../../src/lib/performance/advanced/index.ts"],"sourcesContent":["/**\n * @file Advanced Performance Module\n * @description Enterprise-grade performance profiling, optimization, and analysis utilities.\n *\n * Provides deep performance insights and optimization tools for React applications,\n * including render optimization, memory management, bundle analysis, and idle scheduling.\n */\n\n// ============================================================================\n// Performance Profiler\n// ============================================================================\nexport {\n  // Class\n  PerformanceProfiler,\n  // Factory functions\n  getPerformanceProfiler,\n  resetPerformanceProfiler,\n  createProfilerCallback,\n  // Types\n  type ProfilerConfig,\n  type RenderTimingEntry,\n  type LongTaskEntry,\n  type LongTaskAttribution,\n  type FrameRateSample,\n  type MemorySample,\n  type PerformanceMark,\n  type PerformanceMeasure,\n  type PerformanceSnapshot,\n  type PerformanceSummary,\n  type ProfilerEventType,\n  type ProfilerEventListener,\n} from './performance-profiler';\n\n// ============================================================================\n// Render Optimizer\n// ============================================================================\nexport {\n  // Class\n  RenderBatchManager,\n  // Utilities\n  shallowEqual,\n  deepEqual,\n  createSelector,\n  memoizeWithLRU,\n  calculateVirtualListRange,\n  createStableKeyGenerator,\n  // Tracking\n  configureRenderTracking,\n  trackRender,\n  getRenderInfo,\n  getAllRenderInfo,\n  clearRenderTracking,\n  getSlowComponents,\n  // Constants\n  DEFAULT_BATCH_CONFIG,\n  PRIORITY_VALUES,\n  // Types\n  type RenderPriority,\n  type RenderBatchConfig,\n  type RenderStats,\n  type EqualityFn,\n  type StateUpdater,\n  type VirtualListConfig,\n  type VirtualListRange,\n  type RenderTrackingConfig,\n  type ComponentRenderInfo,\n} from './render-optimizer';\n\n// ============================================================================\n// Memory Optimizer\n// ============================================================================\nexport {\n  // Classes\n  MemoryMonitor,\n  ObjectPool,\n  MemoryAwareCache,\n  CleanupOrchestrator,\n  WeakRefManager,\n  MemoryLeakDetector,\n  // Factory functions\n  getMemoryMonitor,\n  getCleanupOrchestrator,\n  // Types\n  type MemoryPressureLevel,\n  type MemoryStats,\n  type MemoryLeakSuspect,\n  type ObjectPoolConfig,\n  type CacheConfig,\n  type CleanupCallback,\n  type MemoryPressureCallback,\n} from './memory-optimizer';\n\n// ============================================================================\n// Bundle Analyzer\n// ============================================================================\nexport {\n  // Class\n  BundleAnalyzer,\n  // Factory functions\n  getBundleAnalyzer,\n  resetBundleAnalyzer,\n  createTrackedImport,\n  // Utilities\n  formatBytes,\n  checkBundleBudget,\n  // Types\n  type ChunkInfo,\n  type ModuleInfo,\n  type BundleAnalysisReport,\n  type BundleRecommendation,\n  type ResourceTimingEntry,\n  type DynamicImportEntry,\n  type BundleAnalyzerConfig,\n} from './bundle-analyzer';\n\n// ============================================================================\n// Critical Path Analyzer\n// ============================================================================\nexport {\n  // Class\n  CriticalPathAnalyzer,\n  // Factory functions\n  getCriticalPathAnalyzer,\n  // Utilities\n  generateCriticalCSSHints,\n  shouldPreload,\n  // Types\n  type CriticalityLevel,\n  type ResourceType,\n  type RenderBlockingResource,\n  type CriticalResource,\n  type ResourceRecommendation,\n  type DOMAnalysis,\n  type CriticalPathAnalysis,\n  type CriticalPathOptimization,\n  type CriticalPathAnalyzerConfig,\n} from './critical-path-analyzer';\n\n// ============================================================================\n// Idle Scheduler\n// ============================================================================\nexport {\n  // Class\n  IdleScheduler,\n  // Factory functions\n  getIdleScheduler,\n  resetIdleScheduler,\n  // Utilities\n  runWhenIdle,\n  deferToIdle,\n  createYieldingIterator,\n  processInIdleChunks,\n  debounceToIdle,\n  // Types\n  type IdleTaskPriority,\n  type IdleTaskStatus,\n  type IdleTask,\n  type IdleSchedulerConfig,\n  type SchedulerStats,\n  type IdleDeadline,\n} from './idle-scheduler';\n\n// ============================================================================\n// Convenience Initialization\n// ============================================================================\n\nimport { getPerformanceProfiler, type ProfilerConfig } from './performance-profiler';\nimport { getBundleAnalyzer, type BundleAnalyzerConfig } from './bundle-analyzer';\nimport { getCriticalPathAnalyzer, type CriticalPathAnalyzerConfig } from './critical-path-analyzer';\nimport { getIdleScheduler, type IdleSchedulerConfig } from './idle-scheduler';\nimport { getMemoryMonitor } from './memory-optimizer';\n\n/**\n * Advanced performance initialization options\n */\nexport interface AdvancedPerformanceConfig {\n  /** Enable performance profiling */\n  enableProfiling?: boolean;\n  /** Enable bundle analysis */\n  enableBundleAnalysis?: boolean;\n  /** Enable critical path analysis */\n  enableCriticalPathAnalysis?: boolean;\n  /** Enable idle scheduling */\n  enableIdleScheduling?: boolean;\n  /** Enable memory monitoring */\n  enableMemoryMonitoring?: boolean;\n  /** Profiler configuration */\n  profilerConfig?: Partial<ProfilerConfig>;\n  /** Bundle analyzer configuration */\n  bundleAnalyzerConfig?: Partial<BundleAnalyzerConfig>;\n  /** Critical path analyzer configuration */\n  criticalPathConfig?: Partial<CriticalPathAnalyzerConfig>;\n  /** Idle scheduler configuration */\n  idleSchedulerConfig?: Partial<IdleSchedulerConfig>;\n  /** Memory monitoring interval in ms */\n  memoryMonitorInterval?: number;\n}\n\n/**\n * Initialize all advanced performance tools\n */\nexport function initAdvancedPerformance(config: AdvancedPerformanceConfig = {}): {\n  profiler: ReturnType<typeof getPerformanceProfiler> | null;\n  bundleAnalyzer: ReturnType<typeof getBundleAnalyzer> | null;\n  criticalPathAnalyzer: ReturnType<typeof getCriticalPathAnalyzer> | null;\n  idleScheduler: ReturnType<typeof getIdleScheduler> | null;\n  memoryMonitor: ReturnType<typeof getMemoryMonitor> | null;\n  cleanup: () => void;\n} {\n  const {\n    enableProfiling = true,\n    enableBundleAnalysis = true,\n    enableCriticalPathAnalysis = true,\n    enableIdleScheduling = true,\n    enableMemoryMonitoring = true,\n    profilerConfig,\n    bundleAnalyzerConfig,\n    criticalPathConfig,\n    idleSchedulerConfig,\n    memoryMonitorInterval = 5000,\n  } = config;\n\n  const profiler = enableProfiling ? getPerformanceProfiler(profilerConfig) : null;\n  const bundleAnalyzer = enableBundleAnalysis ? getBundleAnalyzer(bundleAnalyzerConfig) : null;\n  const criticalPathAnalyzer = enableCriticalPathAnalysis\n    ? getCriticalPathAnalyzer(criticalPathConfig)\n    : null;\n  const idleScheduler = enableIdleScheduling ? getIdleScheduler(idleSchedulerConfig) : null;\n  const memoryMonitor = enableMemoryMonitoring ? getMemoryMonitor() : null;\n\n  // Start services\n  profiler?.start();\n  bundleAnalyzer?.start();\n  idleScheduler?.start();\n  memoryMonitor?.start(memoryMonitorInterval);\n\n  const cleanup = (): void => {\n    profiler?.stop();\n    bundleAnalyzer?.stop();\n    idleScheduler?.stop();\n    memoryMonitor?.stop();\n  };\n\n  return {\n    profiler,\n    bundleAnalyzer,\n    criticalPathAnalyzer,\n    idleScheduler,\n    memoryMonitor,\n    cleanup,\n  };\n}\n"],"names":["initAdvancedPerformance","config","enableProfiling","enableBundleAnalysis","enableCriticalPathAnalysis","enableIdleScheduling","enableMemoryMonitoring","profilerConfig","bundleAnalyzerConfig","criticalPathConfig","idleSchedulerConfig","memoryMonitorInterval","profiler","getPerformanceProfiler","bundleAnalyzer","getBundleAnalyzer","criticalPathAnalyzer","getCriticalPathAnalyzer","idleScheduler","getIdleScheduler","memoryMonitor","getMemoryMonitor"],"mappings":";;;;;;;;;;AAyMO,SAASA,EAAwBC,IAAoC,IAO1E;AACA,QAAM;AAAA,IACJ,iBAAAC,IAAkB;AAAA,IAClB,sBAAAC,IAAuB;AAAA,IACvB,4BAAAC,IAA6B;AAAA,IAC7B,sBAAAC,IAAuB;AAAA,IACvB,wBAAAC,IAAyB;AAAA,IACzB,gBAAAC;AAAA,IACA,sBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,uBAAAC,IAAwB;AAAA,EAAA,IACtBV,GAEEW,IAAWV,IAAkBW,EAAuBN,CAAc,IAAI,MACtEO,IAAiBX,IAAuBY,EAAkBP,CAAoB,IAAI,MAClFQ,IAAuBZ,IACzBa,EAAwBR,CAAkB,IAC1C,MACES,IAAgBb,IAAuBc,EAAiBT,CAAmB,IAAI,MAC/EU,IAAgBd,IAAyBe,EAAAA,IAAqB;AAGpE,SAAAT,GAAU,MAAA,GACVE,GAAgB,MAAA,GAChBI,GAAe,MAAA,GACfE,GAAe,MAAMT,CAAqB,GASnC;AAAA,IACL,UAAAC;AAAA,IACA,gBAAAE;AAAA,IACA,sBAAAE;AAAA,IACA,eAAAE;AAAA,IACA,eAAAE;AAAA,IACA,SAbc,MAAY;AAC1B,MAAAR,GAAU,KAAA,GACVE,GAAgB,KAAA,GAChBI,GAAe,KAAA,GACfE,GAAe,KAAA;AAAA,IACjB;AAAA,EAQE;AAEJ;"}