
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="516e5e0e-116c-5712-83f3-a638d7a0f239")}catch(e){}}();
import open from "open";
import { isBinaryAvailableOnPath } from "../terminal/command-discovery.js";
export function openInBrowser(url, deps) {
    const warn = deps?.warn ?? (() => { });
    const openUrl = deps?.openUrl ?? open;
    const platform = deps?.platform ?? process.platform;
    const isBinaryAvailable = deps?.isBinaryAvailable ?? isBinaryAvailableOnPath;
    // On Linux the `open` package ships a bundled xdg-open fallback.
    // Prefer system xdg-open when present so PATH-based overrides still work.
    const options = platform === "linux" && isBinaryAvailable("xdg-open")
        ? { app: { name: "xdg-open" } }
        : undefined;
    void openUrl(url, options).catch(() => {
        warn(`Could not open browser automatically. Open this URL manually: ${url}`);
    });
}
//# sourceMappingURL=browser.js.map
//# debugId=516e5e0e-116c-5712-83f3-a638d7a0f239
