//! # Rustelo Routing Crate
//!
//! Modern routing system for client and SSR that works entirely with
//! TOML-based configuration and supports dynamic language detection.
//!
//! This crate provides:
//! - Configuration-driven routing (no hardcoded routes)
//! - Language-agnostic URL handling
//! - Route caching and optimization
//! - SEO utilities (sitemaps, breadcrumbs)
//! - Navigation tracking
//!
//! ## Usage
//!
//! ```rust,ignore
//! use rustelo_routing::{get_routing_engine, resolve_route};
//!
//! // Get the routing engine
//! let engine = get_routing_engine();
//!
//! // Resolve a route
//! let resolution = resolve_route("/en/about");
//! ```

#![allow(unused_imports)]
#![allow(dead_code)]

pub mod cache;
pub mod components;
pub mod config;
pub mod core_types;
pub mod defs;
pub mod engine;
pub mod generated_access;
pub mod language;
pub mod mapping;
pub mod seo;
pub mod tracker;
pub mod traits;
pub mod url_generation;
pub mod utils;

// Re-export the core routing API
pub use cache::{
    cached_route_lookup, get_route_cache, init_route_cache, CacheStats, CachedRoute, RouteCache,
    RouteCacheConfig,
};
pub use config::get_routing_config;
// Re-export core routing types (from core_types module)
pub use core_types::{AlternateUrl, BreadcrumbItem, RouteInfo, SitemapEntry};
pub use defs::{NavigationData, Routable, RouteMetadata};
pub use engine::{
    get_language_switch_url, get_menu_navigation, get_route_breadcrumbs, get_routing_engine,
    get_sitemap_routes, get_toml_routes_for_language, is_valid_route, resolve_route,
    resolve_unified_route, NavigationItem, NavigationTarget, RouteMetadata as EngineRouteMetadata,
    RouteResolution, RoutingEngine,
};
pub use rustelo_core_types::{PageComponent, RouteComponent, RouteConfigToml, RoutesConfig};
// Re-export safe path functions (always available)
#[cfg(feature = "manifest")]
pub use rustelo_utils::{
    config_path_safe as get_config_path_buf_safe, content_path_safe as get_content_path_buf_safe,
    i18n_path_safe as get_i18n_path_buf_safe,
};
// Re-export manifest utilities when available
#[cfg(feature = "manifest")]
pub use rustelo_utils::{get_manifest, ManifestError, ManifestResolver, RusteloManifest};
// Re-export compatibility path functions (non-WASM only)
#[cfg(all(feature = "manifest", not(target_arch = "wasm32")))]
pub use rustelo_utils::{
    i18n_path as get_i18n_path_buf, manifest_config_path as get_config_path_buf,
    manifest_content_path as get_content_path_buf,
};
// Re-export available utilities from rustelo_utils (PAP-compliant)
pub use rustelo_utils::{
    normalize_category, normalize_tag, sanitize_html, title_to_slug, to_slug, validate_email,
    validate_file_path, validate_url,
};
pub use tracker::{
    get_tracker, init_navigation_tracker, track_navigation_event, track_route_resolution,
    NavigationEvent, NavigationEventType, NavigationTracker, NavigationTrackingConfig,
};
pub use traits::{ResolvedRoute, RouteHandler, RouteMetadataProvider, RouteRenderer, RouteResult};
