"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
var HaikuBase_1 = require("./../../HaikuBase");
var render_1 = require("../dom/render");
var manaToXml_1 = require("../../helpers/manaToXml");
var VirtualNode_1 = require("./VirtualNode");
var HaikuHTMLRenderer = (function (_super) {
    __extends(HaikuHTMLRenderer, _super);
    function HaikuHTMLRenderer(mount, config) {
        var _this = _super.call(this) || this;
        _this.mount = mount;
        _this.config = config;
        _this.doc = new VirtualNode_1.VirtualDoc({});
        if (!_this.config.size) {
            throw new Error("HaikuHTMLRenderer requires config.size");
        }
        if (!_this.config.user) {
            throw new Error("HaikuHTMLRenderer requires config.user");
        }
        return _this;
    }
    HaikuHTMLRenderer.prototype.render = function (virtualContainer, virtualTree, component) {
        var enhancedMana = render_1.default(this.mount || new VirtualNode_1.default('div', {}, [], this.doc), virtualContainer, virtualTree, component);
        return manaToXml_1.default('', enhancedMana, {}, {});
    };
    HaikuHTMLRenderer.prototype.hasSizing = function () {
        return false;
    };
    HaikuHTMLRenderer.prototype.createContainer = function (out) {
        if (out === void 0) { out = {}; }
        out['layout'] = {
            computed: {
                size: this.config.size,
            },
        };
        return out;
    };
    HaikuHTMLRenderer.prototype.initialize = function () {
    };
    HaikuHTMLRenderer.prototype.mountEventListener = function (name, listener) {
    };
    HaikuHTMLRenderer.prototype.getUser = function () {
        return this.config.user;
    };
    return HaikuHTMLRenderer;
}(HaikuBase_1.default));
exports.default = HaikuHTMLRenderer;
//# sourceMappingURL=HaikuHTMLRenderer.js.map