"use strict";
var __assign = (this && this.__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;
};
Object.defineProperty(exports, "__esModule", { value: true });
var interactionModes_1 = require("./helpers/interactionModes");
exports.DEFAULTS = {
    seed: null,
    timestamp: null,
    automount: true,
    autoplay: true,
    forceFlush: false,
    freeze: false,
    loop: false,
    frame: null,
    clock: {},
    sizing: null,
    alwaysComputeSizing: true,
    preserve3d: 'auto',
    contextMenu: 'enabled',
    position: 'relative',
    overflowX: null,
    overflowY: null,
    overflow: null,
    mixpanel: '6f31d4f99cf71024ce27c3e404a79a61',
    useWebkitPrefix: void (0),
    interactionMode: interactionModes_1.InteractionMode.LIVE,
    states: null,
    eventHandlers: null,
    timelines: null,
    vanities: null,
    children: null,
    placeholder: null,
};
function seed() {
    return Math.random().toString(36).slice(2);
}
var CONFIG_KEYS_TO_MERGE = {
    states: true,
    eventHandlers: true,
    timelines: true,
    vanities: true,
    initialStates: true,
};
function build() {
    var argums = [];
    for (var _i = 0; _i < arguments.length; _i++) {
        argums[_i] = arguments[_i];
    }
    var config = {};
    var args = argums.slice();
    args.unshift(exports.DEFAULTS);
    args.forEach(function (incoming) {
        if (!incoming || typeof incoming !== 'object') {
            return;
        }
        for (var key in incoming) {
            if (incoming[key] === undefined) {
                continue;
            }
            if (CONFIG_KEYS_TO_MERGE[key]) {
                if (!config[key]) {
                    config[key] = {};
                }
                config[key] = __assign({}, config[key], incoming[key]);
            }
            else {
                config[key] = incoming[key];
            }
        }
    });
    if (config['overflow'] && (config['overflowX'] || config['overflowY'])) {
        console.warn('[haiku core] `overflow` overrides `overflowY`/`overflowX`');
        config['overflowX'] = null;
        config['overflowY'] = null;
    }
    return config;
}
exports.default = {
    build: build,
    seed: seed,
    DEFAULTS: exports.DEFAULTS,
};
//# sourceMappingURL=Config.js.map