"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.showLoader = showLoader;
exports.hideLoader = hideLoader;
exports.showErrors = showErrors;
exports.jsonShow = jsonShow;
const dom_1 = require("../dom/dom");
function showLoader(id) {
    const el = (0, dom_1.getElementById)(id);
    el.addClass('activeGlobalLoader').css({ display: 'block' });
}
function hideLoader(id) {
    const el = (0, dom_1.getElementById)(id);
    el.removeClass('activeGlobalLoader').css({ display: 'none' });
}
function showErrors(id, html) {
    const el = (0, dom_1.getElementById)(id);
    el.html(html);
    $('#errorBase').addClass('activateErrors').fadeIn(500);
}
function jsonShow(errors) {
    for (const k in errors) {
        const parts = k.split('.');
        const id = parts.length === 1 ? `#${k}_error` : `#${parts[0]}\\.${parts[1]}_error`;
        $(id).addClass('text-red-600').html(errors[k][0]);
    }
}
//# sourceMappingURL=loader.js.map