"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Renderables_1 = require("../Renderables");
var timestamp_1 = require("../timestamp");
var node_1 = require("../../support/node");
var Specification_1 = require("../../support/Specification");
/**
 * Implementation of the 'block' markup element. A div HTML element
 * is created and the and the classes lto-block is added to
 * allow CSS modifications.
 *
 * @see {@link IRenderable}
 * @see {@link IStackeable}
 */
var Block = /** @class */ (function () {
    function Block(message) {
        this.spec = message;
    }
    /**
     * @inheritDoc
     */
    Block.prototype.render = function (renderer, isNested) {
        var _this = this;
        var block = node_1.default("div");
        new Specification_1.Specification(this.spec).initNode(block, "lto-block");
        block.setAriaLabel(this.spec.ariaLabel);
        block.unwrap().appendChild(timestamp_1.Timestamp.render());
        var elements = (this.spec.elements || []).map(function (e) { return renderer.render(e, _this); });
        elements.forEach(function (e) { return e.forEach(function (x) { return block.unwrap().appendChild(x); }); });
        isNested && block.addClasses('lto-nested');
        return block.unwrap();
    };
    return Block;
}());
exports.Block = Block;
Renderables_1.default.register("block", Block);
//# sourceMappingURL=index.js.map