/**
 * Tools - Heavy components with lazy loading (React.lazy + Suspense)
 *
 * All components are lazy-loaded to reduce initial bundle size:
 * - Mermaid: ~800KB (diagram rendering)
 * - PrettyCode: ~500KB (code syntax highlighting)
 * - JsonTree: ~100KB (JSON visualization)
 * - LottiePlayer: ~200KB (Lottie animation player)
 * - JsonForm: ~300KB (JSON Schema form generator)
 * - OpenapiViewer: ~400KB (OpenAPI schema viewer & playground)
 * - VideoPlayer: ~150KB (Professional video player with Vidstack)
 * - AudioPlayer: ~200KB (Audio player with WaveSurfer.js)
 * - ImageViewer: ~50KB (Image viewer with zoom/pan/rotate)
 * - CronScheduler: ~15KB (Cron expression builder)
 *
 * Works in any React environment: Next.js, Vite, Wails, CRA
 */

// Export tools as named exports (all use React.lazy internally)
export { default as JsonTree } from './JsonTree';
export type { JsonTreeConfig } from './JsonTree';
export { default as Mermaid } from './Mermaid';
export { default as PrettyCode } from './PrettyCode';
export type { Language } from './PrettyCode';
export { LottiePlayer, useLottie } from './LottiePlayer';
export type {
  LottiePlayerProps,
  LottieSize,
  LottieSpeed,
  LottieDirection,
  UseLottieOptions,
  UseLottieReturn,
} from './LottiePlayer';

// Export JsonForm components
export { JsonSchemaForm } from './JsonForm';
export type { JsonSchemaFormProps } from './JsonForm';
export * from './JsonForm/widgets';
export * from './JsonForm/templates';
export * from './JsonForm/utils';

// Export OpenapiViewer
export { default as OpenapiViewer } from './OpenapiViewer';
export type { PlaygroundConfig, SchemaSource, PlaygroundProps } from './OpenapiViewer';

// Export VideoPlayer
export {
  VideoPlayer,
  VideoControls,
  VidstackProvider,
  NativeProvider,
  StreamProvider,
  VideoPlayerProvider,
  useVideoPlayerContext,
  VideoErrorFallback,
  createVideoErrorFallback,
  resolvePlayerMode,
  resolveFileSource,
  isSimpleStreamSource,
  resolveStreamSource,
} from './VideoPlayer';
export type {
  VideoSourceUnion,
  UrlSource,
  YouTubeSource,
  VimeoSource,
  HLSSource,
  DASHSource,
  StreamSource,
  BlobSource,
  DataUrlSource,
  PlayerMode,
  AspectRatioValue,
  VideoPlayerProps,
  VideoPlayerRef,
  ErrorFallbackProps,
  ResolveFileSourceOptions,
  VideoPlayerContextValue,
  VideoPlayerProviderProps,
  SimpleStreamSource,
  VideoErrorFallbackProps,
  CreateVideoErrorFallbackOptions,
} from './VideoPlayer';

// Export AudioPlayer (Hybrid - HTML5 audio + Web Audio visualization)
export {
  // Components
  HybridSimplePlayer,
  HybridAudioPlayer,
  HybridWaveform,
  AudioReactiveCover,
  GlowEffect,
  OrbsEffect,
  SpotlightEffect,
  MeshEffect,
  // Context
  HybridAudioProvider,
  useHybridAudioContext,
  useHybridAudioState,
  useHybridAudioControls,
  useHybridAudioLevels,
  useHybridWebAudio,
  // Hooks
  useHybridAudio,
  useHybridAudioAnalysis,
  useVisualization,
  useAudioVisualization,
  VisualizationProvider,
  VARIANT_INFO,
  INTENSITY_INFO,
  COLOR_SCHEME_INFO,
  // Effects utilities
  getEffectConfig,
  getColors,
  prepareEffectColors,
  calculateGlowLayers,
  calculateOrbs,
  calculateMeshGradients,
  calculateSpotlight,
  INTENSITY_CONFIG,
  COLOR_SCHEMES,
  EFFECT_ANIMATIONS,
  // Utils
  formatTime,
} from './AudioPlayer';
export type {
  // Component types
  HybridSimplePlayerProps,
  HybridAudioPlayerProps,
  HybridWaveformProps,
  AudioReactiveCoverProps,
  GlowEffectData,
  // Context types
  HybridAudioProviderProps,
  HybridAudioContextValue,
  // Hook types
  UseHybridAudioOptions,
  HybridAudioState,
  HybridAudioControls,
  HybridWebAudioAPI,
  UseHybridAudioReturn,
  VisualizationSettings,
  VisualizationVariant,
  VisualizationIntensity,
  VisualizationColorScheme,
  UseVisualizationReturn,
  UseAudioVisualizationReturn,
  VisualizationProviderProps,
  // Effect types
  EffectVariant,
  EffectIntensity,
  EffectColorScheme,
  AudioLevels,
  EffectConfig,
  EffectColors,
  EffectLayer,
  // Other types
  EqualizerOptions,
} from './AudioPlayer';

// Export ImageViewer
export { ImageViewer } from './ImageViewer';
export type { ImageViewerProps, ImageFile } from './ImageViewer';

// Export CronScheduler (~15KB)
export {
  CronScheduler,
  // Context & Hooks
  CronSchedulerProvider,
  useCronSchedulerContext,
  useCronType,
  useCronTime,
  useCronWeekDays,
  useCronMonthDays,
  useCronCustom,
  useCronPreview,
  useCronScheduler,
  // Utilities
  buildCron,
  parseCron,
  isValidCron,
  humanizeCron,
  // Components
  ScheduleTypeSelector,
  TimeSelector,
  DayChips,
  MonthDayGrid,
  CustomInput,
  SchedulePreview,
} from './CronScheduler';
export type {
  CronSchedulerProps,
  ScheduleType,
  WeekDay,
  MonthDay,
  CronSchedulerState,
  CronSchedulerContextValue,
} from './CronScheduler';

// Export CodeEditor (Monaco ~550KB)
export {
  Editor,
  DiffEditor,
} from './CodeEditor/components';
export type { EditorRef } from './CodeEditor/components/Editor';
export {
  EditorProvider,
  useEditorContext,
} from './CodeEditor/context';
export {
  useMonaco,
  useEditor,
  useLanguage,
} from './CodeEditor/hooks';
export type {
  EditorFile,
  EditorOptions,
  EditorProps,
  DiffEditorProps,
  EditorContextValue,
  UseEditorReturn,
  UseMonacoReturn,
} from './CodeEditor/types';

// Export MarkdownEditor (Tiptap ~200KB)
export { MarkdownEditor, mentionPresets } from './MarkdownEditor';
export type {
  MarkdownEditorProps,
  MentionItem,
  MentionConfig,
  MentionAttrs,
  MentionMarkdownRenderer,
} from './MarkdownEditor';

// Export Media Cache Store
export {
  useMediaCacheStore,
  useImageCache,
  useAudioCache,
  useVideoCache,
  useBlobUrlCleanup,
  generateContentKey,
} from '../stores/mediaCache';
