"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.h = void 0;
const slice_1 = require("../slice");
const constants_1 = require("../slice/constants");
const h = (tag, props, ...children) => {
    const attrs = {};
    if (props)
        attrs.data = props;
    if (tag === exports.h)
        return ['', null, ...children];
    const num = slice_1.CommonSliceType[tag];
    if (typeof num === 'number') {
        const inline = num < 0;
        attrs.inline = inline;
        attrs.stacking = inline ? (props ? constants_1.SliceStacking.Many : constants_1.SliceStacking.One) : constants_1.SliceStacking.Marker;
        return [num, attrs, ...children];
    }
    else {
        const inline = !props;
        attrs.inline = inline;
        attrs.stacking = inline ? (props ? constants_1.SliceStacking.Many : constants_1.SliceStacking.One) : constants_1.SliceStacking.Marker;
        return [tag, attrs, ...children];
    }
};
exports.h = h;
//# sourceMappingURL=jsx.js.map