"use strict";
var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
var __read = (this && this.__read) || function (o, n) {
    var m = typeof Symbol === "function" && o[Symbol.iterator];
    if (!m) return o;
    var i = m.call(o), r, ar = [], e;
    try {
        while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
    }
    catch (error) { e = { error: error }; }
    finally {
        try {
            if (r && !r.done && (m = i["return"])) m.call(i);
        }
        finally { if (e) throw e.error; }
    }
    return ar;
};
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
    if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
        if (ar || !(i in from)) {
            if (!ar) ar = Array.prototype.slice.call(from, 0, i);
            ar[i] = from[i];
        }
    }
    return to.concat(ar || Array.prototype.slice.call(from));
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.GlGithubStarCount = void 0;
var jsx_runtime_1 = require("react/jsx-runtime");
var react_1 = require("react");
var lib_1 = require("onyxia-ui/lib");
var theme_1 = require("../theme");
var react_github_btn_1 = __importDefault(require("react-github-btn"));
exports.GlGithubStarCount = (0, react_1.memo)(function (props) {
    var repoUrl = props.repoUrl, size = props.size, className = props.className, showCount = props.showCount;
    var _a = useStyles(), classes = _a.classes, cx = _a.cx;
    var themeVariant = (function useClosure() {
        var isDarkModeEnabled = (0, lib_1.useIsDarkModeEnabled)().isDarkModeEnabled;
        var themeVariant = isDarkModeEnabled ? "dark" : "light";
        return { themeVariant: themeVariant };
    })().themeVariant;
    return ((0, jsx_runtime_1.jsx)("div", __assign({ className: cx(classes.root, className) }, { children: (0, jsx_runtime_1.jsx)(react_github_btn_1.default, { href: repoUrl, "data-color-scheme": __spreadArray([
                "no-preference: light;"
            ], __read(["light", "dark"].map(function (osPref) { return "".concat(osPref, ": ").concat(themeVariant, ";"); })), false).join("\n"), "data-icon": "octicon-star", "data-size": size === "large" ? size : "", "data-show-count": "".concat(showCount !== null && showCount !== void 0 ? showCount : false) }) })));
});
var useStyles = (0, theme_1.makeStyles)({ "name": { GlGithubStarCount: exports.GlGithubStarCount } })({
    "root": {
        "& span": {
            "display": "flex",
            "alignItems": "center",
        },
    },
});
//# sourceMappingURL=GlGithubStarCount.js.map