(() => {
    "use strict";
    var o, n, e, t, r, i = ["iPhone", "iPad", "iPod"],
        a = ["Win32", "Win64", "Windows", "WinCE"],
        d = ["Macintosh", "MacIntel", "MacPPC", "Mac68K"],
        c = ["Linux", "Linux i686", "Linux armv7l", "Linux armv8l", "Linux x86_64"];

    function l() {
        var o = window.location.hostname;
        return ["discord.com", "ptb.discord.com", "canary.discord.com", "staging.discord.co"].includes(o) ? o : "discord.com"
    }
    o = l(), n = "https://" + o + "/register", e = "https://" + o + "/channels/@me", t = null != window.localStorage.getItem("token"), (r = document.querySelectorAll(".open-or-signup-js")).length > 0 && r.forEach((function(o) {
        if (t) {
            o.innerText = "Open Discord";
            o.href = e
        } else {
            o.innerText = "Sign up";
            o.href = n
        }
    }));
    ! function() {
        var o, n, e, t, r = !0,
            i = l(),
            a = "https://" + i + "/login",
            d = "https://" + i + "/register",
            c = "https://" + i + "/channels/@me";
        if (null != window.localStorage.getItem("token")) {
            o = "Open Discord";
            n = c;
            r = !0;
            e = "Open Discord";
            t = c
        } else {
            r = !1;
            o = "Login";
            e = "Sign up";
            n = a;
            t = d
        }
        var s = document.querySelectorAll(".login-button-js"),
            u = document.querySelectorAll(".footer-open-discord-button-js");
        s.length > 0 && s.forEach((function(e) {
            r || e.classList.add("hide-on-mobile");
            e.innerText = o;
            e.href = n;
            r && (e.dataset.trackNav = "navbar-open-button")
        }));
        u.length > 0 && u.forEach((function(o) {
            window.innerWidth <= 768 ? o.innerText = "Download" : o.innerText = e;
            o.href = t
        }))
    }();
    ! function() {
        var o = l(),
            n = function() {
                var o = window.navigator.userAgent,
                    n = window.navigator.platform;
                return i.includes(n) ? "IOS" : d.includes(n) ? "MAC" : a.includes(n) ? "WINDOWS" : /Android/.test(o) ? "ANDROID" : c.includes(n) || /Linux/.test(o) ? "LINUX" : void 0
            }(),
            e = {
                text: "Download",
                href: "https://discord.com/download"
            };
        switch (n) {
            case "IOS":
                e.text = "Download on the App Store";
                e.href = "https://itunes.apple.com/us/app/discord-chat-for-games/id985746746";
                break;
            case "ANDROID":
                e.text = "Download on Google Play";
                e.href = "https://play.google.com/store/apps/details?id=com.discord";
                break;
            case "WINDOWS":
                e.text = "Download for Windows";
                e.href = "https://" + o + "/api/download?platform=win";
                break;
            case "MAC":
                e.text = "Download for Mac";
                e.href = "https://" + o + "/api/download?platform=osx";
                break;
            case "LINUX":
                e.text = "Download for Linux";
                e.href = "https://" + o + "/api/download?platform=linux"
        }
        var t = document.querySelectorAll(".download-button"),
            r = document.querySelectorAll(".ua-download-btn");
        t.forEach((function(o) {
            o.text = e.text;
            o.href = e.href
        }));
        r.forEach((function(o) {
            o.href = e.href;
            o.text = "Download";
            o.addEventListener("click", (function() {
                fbq("trackCustom", "Download", {
                    source: "banner-download"
                })
            }), !1)
        }))
    }()
})();
//# sourceMappingURL=loginOrDownload.js.map