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;
}
function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) {
            symbols = symbols.filter(function(sym) {
                return Object.getOwnPropertyDescriptor(object, sym).enumerable;
            });
        }
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function _object_spread_props(target, source) {
    source = source != null ? source : {};
    if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
        ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    }
    return target;
}
/**
 * 创建 Jinja 插件，启用模板面板（输入 `{}` 触发）与编辑器内 Jinja 语法高亮。
 * 可通过 props.jinja 配置，或仅通过插件启用并在此传入默认配置。
 * 不在 options 中接受 enable，插件即表示启用，产出配置始终 enable: true。
 *
 * @param options 可选，与 props.jinja 同结构（不含 enable），用于通过插件启用时提供默认配置
 * @returns MarkdownEditorPlugin & { jinja: true; jinjaConfig?: JinjaConfig }
 */ export function createJinjaPlugin(options) {
    var jinjaConfig = options ? _object_spread_props(_object_spread({}, options), {
        enable: true
    }) : undefined;
    return _object_spread({
        jinja: true
    }, jinjaConfig ? {
        jinjaConfig: jinjaConfig
    } : {});
}
/** 默认 Jinja 插件实例，可直接用于 plugins={[jinjaPlugin]} */ export var jinjaPlugin = createJinjaPlugin();
