function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
/**
 * 应用上下文属性和配置到元素（纯函数版本）
 * @param el - 目标元素或元素数组
 * @param contextProps - 上下文属性对象
 * @param config - 配置对象
 * @returns 返回应用了属性和配置的新元素
 */ export var applyContextPropsAndConfig = function(el, contextProps, config) {
    var hasContextProps = Object.keys(contextProps || {}).length > 0;
    var hasConfig = Object.keys(config || {}).length > 0;
    if (Array.isArray(el)) {
        return el.map(function(item) {
            var result = _object_spread({}, item);
            if (hasContextProps) {
                result.contextProps = contextProps;
            }
            if (hasConfig && !item.otherProps) {
                result.otherProps = config;
            }
            return result;
        });
    }
    var result = _object_spread({}, el);
    if (hasContextProps) {
        result.contextProps = contextProps;
    }
    if (hasConfig && !el.otherProps) {
        result.otherProps = config;
    }
    return result;
};
