/* Minification failed. Returning unminified contents.
(1,1): run-time error CSS1019: Unexpected token, found '$'
(1,2): run-time error CSS1019: Unexpected token, found '('
(1,3): run-time error CSS1019: Unexpected token, found '"#account-logon"'
(1,19): run-time error CSS1019: Unexpected token, found ')'
(1,21): run-time error CSS1030: Expected identifier, found 'on('
(1,21): run-time error CSS1019: Unexpected token, found 'on('
(1,24): run-time error CSS1019: Unexpected token, found ''submit''
(1,32): run-time error CSS1019: Unexpected token, found ','
(1,43): run-time error CSS1031: Expected selector, found '('
(1,43): run-time error CSS1025: Expected comma or open brace, found '('
(21,2): run-time error CSS1019: Unexpected token, found ')'
(23,1): run-time error CSS1019: Unexpected token, found '$'
(23,2): run-time error CSS1019: Unexpected token, found '('
(23,3): run-time error CSS1019: Unexpected token, found '"#Login,#Password"'
(23,21): run-time error CSS1019: Unexpected token, found ')'
(23,23): run-time error CSS1030: Expected identifier, found 'on('
(23,23): run-time error CSS1019: Unexpected token, found 'on('
(23,26): run-time error CSS1019: Unexpected token, found ''keyup''
(23,33): run-time error CSS1019: Unexpected token, found ','
(23,44): run-time error CSS1031: Expected selector, found '('
(23,44): run-time error CSS1025: Expected comma or open brace, found '('
(26,2): run-time error CSS1019: Unexpected token, found ')'
(28,1): run-time error CSS1019: Unexpected token, found '$'
(28,2): run-time error CSS1019: Unexpected token, found '('
(28,3): run-time error CSS1019: Unexpected token, found '"#signup-form"'
(28,17): run-time error CSS1019: Unexpected token, found ')'
(28,19): run-time error CSS1030: Expected identifier, found 'on('
(28,19): run-time error CSS1019: Unexpected token, found 'on('
(28,22): run-time error CSS1019: Unexpected token, found ''submit''
(28,30): run-time error CSS1019: Unexpected token, found ','
(28,41): run-time error CSS1031: Expected selector, found '('
(28,41): run-time error CSS1025: Expected comma or open brace, found '('
(52,2): run-time error CSS1019: Unexpected token, found ')'
(53,1): run-time error CSS1019: Unexpected token, found '$'
(53,2): run-time error CSS1019: Unexpected token, found '('
(53,3): run-time error CSS1019: Unexpected token, found '"#recovery-form"'
(53,19): run-time error CSS1019: Unexpected token, found ')'
(53,21): run-time error CSS1030: Expected identifier, found 'on('
(53,21): run-time error CSS1019: Unexpected token, found 'on('
(53,24): run-time error CSS1019: Unexpected token, found ''submit''
(53,32): run-time error CSS1019: Unexpected token, found ','
(53,43): run-time error CSS1031: Expected selector, found '('
(53,43): run-time error CSS1025: Expected comma or open brace, found '('
(76,2): run-time error CSS1019: Unexpected token, found ')'
(77,1): run-time error CSS1019: Unexpected token, found '$'
(77,2): run-time error CSS1019: Unexpected token, found '('
(77,3): run-time error CSS1019: Unexpected token, found ''#signup-back''
(77,17): run-time error CSS1019: Unexpected token, found ')'
(77,19): run-time error CSS1030: Expected identifier, found 'click('
(77,19): run-time error CSS1019: Unexpected token, found 'click('
(77,34): run-time error CSS1031: Expected selector, found '('
(77,34): run-time error CSS1025: Expected comma or open brace, found '('
(82,2): run-time error CSS1019: Unexpected token, found ')'
(83,1): run-time error CSS1019: Unexpected token, found '$'
(83,2): run-time error CSS1019: Unexpected token, found '('
(83,3): run-time error CSS1019: Unexpected token, found '"#confirm-logon"'
(83,19): run-time error CSS1019: Unexpected token, found ')'
(83,21): run-time error CSS1030: Expected identifier, found 'on('
(83,21): run-time error CSS1019: Unexpected token, found 'on('
(83,24): run-time error CSS1019: Unexpected token, found ''submit''
(83,32): run-time error CSS1019: Unexpected token, found ','
(83,43): run-time error CSS1031: Expected selector, found '('
(83,43): run-time error CSS1025: Expected comma or open brace, found '('
(109,2): run-time error CSS1019: Unexpected token, found ')'
(111,1): run-time error CSS1019: Unexpected token, found '$'
(111,2): run-time error CSS1019: Unexpected token, found '('
(111,3): run-time error CSS1019: Unexpected token, found '"#recovery-form"'
(111,19): run-time error CSS1019: Unexpected token, found ')'
(111,21): run-time error CSS1030: Expected identifier, found 'on('
(111,21): run-time error CSS1019: Unexpected token, found 'on('
(111,24): run-time error CSS1019: Unexpected token, found '"mouseover"'
(111,35): run-time error CSS1019: Unexpected token, found ','
(111,46): run-time error CSS1031: Expected selector, found '('
(111,46): run-time error CSS1025: Expected comma or open brace, found '('
(118,2): run-time error CSS1019: Unexpected token, found ')'
(119,1): run-time error CSS1019: Unexpected token, found '$'
(119,2): run-time error CSS1019: Unexpected token, found '('
(119,3): run-time error CSS1019: Unexpected token, found '"#account-logon"'
(119,19): run-time error CSS1019: Unexpected token, found ')'
(119,21): run-time error CSS1030: Expected identifier, found 'on('
(119,21): run-time error CSS1019: Unexpected token, found 'on('
(119,24): run-time error CSS1019: Unexpected token, found '"mouseover"'
(119,35): run-time error CSS1019: Unexpected token, found ','
(119,46): run-time error CSS1031: Expected selector, found '('
(119,46): run-time error CSS1025: Expected comma or open brace, found '('
(126,2): run-time error CSS1019: Unexpected token, found ')'
(128,1): run-time error CSS1019: Unexpected token, found '$'
(128,2): run-time error CSS1019: Unexpected token, found '('
(128,3): run-time error CSS1019: Unexpected token, found '"#signup-form"'
(128,17): run-time error CSS1019: Unexpected token, found ')'
(128,19): run-time error CSS1030: Expected identifier, found 'on('
(128,19): run-time error CSS1019: Unexpected token, found 'on('
(128,22): run-time error CSS1019: Unexpected token, found '"mouseover"'
(128,33): run-time error CSS1019: Unexpected token, found ','
(129,14): run-time error CSS1031: Expected selector, found '('
(129,14): run-time error CSS1025: Expected comma or open brace, found '('
(136,6): run-time error CSS1019: Unexpected token, found ')'
(138,1): run-time error CSS1019: Unexpected token, found '$'
(138,2): run-time error CSS1019: Unexpected token, found '('
(138,3): run-time error CSS1019: Unexpected token, found ''.custom-tab''
(138,16): run-time error CSS1019: Unexpected token, found ')'
(138,18): run-time error CSS1030: Expected identifier, found 'click('
(138,18): run-time error CSS1019: Unexpected token, found 'click('
(138,33): run-time error CSS1031: Expected selector, found '('
(138,33): run-time error CSS1025: Expected comma or open brace, found '('
(145,2): run-time error CSS1019: Unexpected token, found ')'
 */
$("#account-logon").on('submit', function (e) {
    e.preventDefault();
    $.ajax({
        url: "/account/logon",
        data: $(this).serialize(),
        type: "POST",
        async: false,
        success: function (data) {
            //$("#logon-error h5").html(data);
            if ((typeof data === "object")) {
                if (!data.IsValid) {
                    $("#logon-error").show();
                }
            }
            else {
                //TODO: div update  
                document.location.href = data;
            }
        }
    });
});

$("#Login,#Password").on('keyup', function (e) {
    if ($("#logon-error").is(":visible"))
        $("#logon-error").hide();
});

$("#signup-form").on('submit', function (e) {
    e.preventDefault();
    $("#signup-error").hide();
    $.ajax({
        url: "/account/Signup",
        data: $(this).serialize(),
        type: "POST",
        success: function (data) {
            console.log('Success Res::',data);
            if ((typeof data === "object")) {
                if (!data.IsOK) {
                    $("#signup-error h5").text(data.ResultMessage);
                    $("#signup-error").show();
                } else {
                    $('#forms').hide();
                    $('#signup-check').show();
                }
            }
            else {
                //TODO: div update  
                alert('Sorry, bad request. Please, try again later');
            }
        }
    });
});
$("#recovery-form").on('submit', function (e) {
    e.preventDefault();
    $.ajax({
        url: "/account/RecoverPassword",
        data: $(this).serialize(),
        type: "POST",
        success: function (data) {
            console.log('DATA PasswordRecovery::', data);
            if ((typeof data === "object")) {
                if (!data.IsOK) {
                    alert(data.ResultMessage);
                    console.log('There\'re errors');
                } else {
                    alert(data.ResultMessage);
                    document.location.href = '/Account/Logon/'
                }
            }
            else {
                console.log('Data isnt object::', data);
            }
        }
    });

});
$('#signup-back').click(function () {
    $('#forms').show();
    $('#signup-check').hide();
    $('a[href="#login"').click();
    $('#signup-form').trigger("reset");
})
$("#confirm-logon").on('submit', function (e) {
    e.preventDefault();
    if ($(this).find('#Password').val() === $(this).find('#PasswordConfirm').val()) {
        $('#password-error').addClass('d-none');
        $.ajax({
            url: "/account/PasswordConfirm",
            data: $(this).serialize(),
            type: "POST",
            success: function (data) {
                console.log('DATA signconf::', data);
                if ((typeof data === "object")) {
                    alert(data.ResultMessage);
                    if (!data.IsOK) {                        
                    } else {                    
                        document.location.href = '/Account/Logon/'
                    }
                }
                else {
                    console.log('Data isnt object::', data);
                }
            }
        });
    } else {
        $('#password-error').removeClass('d-none');
    }

});

$("#recovery-form").on("mouseover", function () {
    if ($("#g-recaptcha-response-2").length > 0 && $("#g-recaptcha-response-2").val().length > 0) {
        $("#recovery-btn").attr("disabled", false);
        $(this).find("span[data-valmsg-for='captchavalidation']").hide();
    } else {
        $("#recovery-btn").attr("disabled", true);
    }
});
$("#account-logon").on("mouseover", function () {
    if ($("#g-recaptcha-response").length > 0 && $("#g-recaptcha-response").val().length > 0) {
        $("#login-btn").attr("disabled", false);
        $(this).find("span[data-valmsg-for='captchavalidation']").hide();
    } else {
        $("#login-btn").attr("disabled", true);
    }
});

$("#signup-form").on("mouseover",
    function () {
        if ($("#g-recaptcha-response-1").length > 0 && $("#g-recaptcha-response-1").val().length > 0) {
            $("#signup-btn").attr("disabled", false);
            $("span[data-valmsg-for = 'captchavalidation']").hide();
        } else {
            $("#signup-btn").attr("disabled", true);
        }
    });

$('.custom-tab').click(function (e) {
    e.preventDefault();
    var target = $(this).attr('href');
    $('.tabs-panel').removeClass('is-active');
    $('.tabs-title').removeClass('is-active').find('a').attr('aria-selected','false');
    $(this).addClass('is-active');
    $(target).addClass('is-active');
})
