"use strict";
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
    if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
    return cooked;
};
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 __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.DialogImages = void 0;
var react_1 = __importDefault(require("react"));
var styled_components_1 = __importDefault(require("@xstyled/styled-components"));
var Modal_1 = __importDefault(require("../Modal/Modal"));
var alertImages_1 = require("./alertImages");
var DialogImages;
(function (DialogImages) {
    DialogImages[DialogImages["error"] = alertImages_1.dialogError] = "error";
    DialogImages[DialogImages["info"] = alertImages_1.dialogInfo] = "info";
    DialogImages[DialogImages["question"] = alertImages_1.dialogQuestion] = "question";
    DialogImages[DialogImages["warning"] = alertImages_1.dialogWarning] = "warning";
})(DialogImages = exports.DialogImages || (exports.DialogImages = {}));
var Message = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n  display: flex;\n  align-items: center;\n  justify-content: center;\n"], ["\n  display: flex;\n  align-items: center;\n  justify-content: center;\n"])));
var Image = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n  background-repeat: no-repeat;\n  background-size: 70%;\n  height: 45px;\n  width: 45px;\n  background-position: center;\n  margin-right: 10;\n\n  ", "\n"], ["\n  background-repeat: no-repeat;\n  background-size: 70%;\n  height: 45px;\n  width: 45px;\n  background-position: center;\n  margin-right: 10;\n\n  ",
    "\n"])), function (_a) {
    var type = _a.type;
    return "background-image: url(" + (type ? DialogImages[type] : DialogImages.error) + ");";
});
var Dialog = Object.assign(styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n    display: flex;\n    flex-direction: row;\n  "], ["\n    display: flex;\n    flex-direction: row;\n  "]))), {
    Message: Message,
    Image: Image,
});
var Alert = function (_a) {
    var type = _a.type, message = _a.message, closeAlert = _a.closeAlert, rest = __rest(_a, ["type", "message", "closeAlert"]);
    return (react_1.default.createElement(Modal_1.default, __assign({ closeModal: closeAlert, height: "120" }, rest),
        react_1.default.createElement(Dialog, null,
            react_1.default.createElement(Dialog.Image, { type: type }),
            react_1.default.createElement(Dialog.Message, null, message))));
};
Alert.displayName = 'Alert';
Alert.defaultProps = {
    type: 'error',
    buttons: [{ value: 'OK', onClick: function () { } }],
    closeAlert: function () { },
    buttonsAlignment: 'center',
    defaultPosition: {
        x: Math.floor(window.innerWidth / 2) - 150,
        y: Math.floor(window.innerHeight / 2) - 80,
    },
};
exports.default = Alert;
var templateObject_1, templateObject_2, templateObject_3;
//# sourceMappingURL=Alert.js.map