/**
 * Client-safe type-safe href function
 *
 * This is a compile-time only href that validates paths against registered routes.
 * No runtime route map lookup - just an identity function with TypeScript validation.
 *
 * @example
 * ```typescript
 * import { href } from "rsc-router/client";
 *
 * href("/blog/my-post");           // ✓ matches /blog/:slug
 * href("/shop/product/widget");    // ✓ matches /shop/product/:slug
 * href("/invalid");                // ✗ TypeScript error
 * ```
 */
/**
 * Type-safe href function for client-side use
 *
 * Without mount: identity function, validates absolute paths at compile time.
 * With mount: prepends mount path, for use with useMount() inside include() scopes.
 *
 * @param path - A valid path matching one of the registered route patterns
 * @param mount - Optional mount prefix from useMount() for include-scoped paths
 * @returns The resolved path
 *
 * @example
 * ```typescript
 * // Absolute paths (type-safe)
 * href("/blog/hello");           // "/blog/hello"
 * href("/shop/product/widget");  // "/shop/product/widget"
 *
 * // With mount (inside an include)
 * const mount = useMount();      // "/articles"
 * href("/", mount);              // "/articles/"
 * href("/my-post", mount);       // "/articles/my-post"
 *
 * // Query strings and hashes pass through
 * href("/blog/hello?page=1");
 * href("/about#contact");
 * ```
 */
export function href(path, mount) {
    if (mount && mount !== "/") {
        return mount + path;
    }
    return path;
}
function createResponseHrefTag() {
    return (path, mount) => ({
        to: href(path, mount),
        "data-external": "",
    });
}
(function (href) {
    href.json = createResponseHrefTag();
    href.text = createResponseHrefTag();
    href.html = createResponseHrefTag();
    href.xml = createResponseHrefTag();
    href.md = createResponseHrefTag();
    href.image = createResponseHrefTag();
    href.stream = createResponseHrefTag();
    href.any = createResponseHrefTag();
})(href || (href = {}));
//# sourceMappingURL=href-client.js.map