// #region Imports
import { RouterNotFoundError } from './Errors';
// #endregion
/**
 * Navigates to a new route using the global `<mosaik-router-2>` element.
 *
 * @param navigation - The navigation target (path, href, or query).
 * @throws {RouterNotFoundError} If no `<mosaik-router-2>` element is found.
 *
 * @public
 */
export function navigate(navigation) {
    const router = document.querySelector('mosaik-router-2');
    if (!router) {
        throw new RouterNotFoundError();
    }
    void router.navigate(navigation);
}
/**
 * Moves forward in the browser's session history.
 *
 * @public
 */
export function forward() {
    window.history.forward();
}
/**
 * Moves backward in the browser's session history.
 *
 * @public
 */
export function back() {
    window.history.back();
}
//# sourceMappingURL=Utils.js.map