function _array_like_to_array(arr, len) {
    if (len == null || len > arr.length) len = arr.length;
    for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
    return arr2;
}
function _array_with_holes(arr) {
    if (Array.isArray(arr)) return arr;
}
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 _iterable_to_array_limit(arr, i) {
    var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
    if (_i == null) return;
    var _arr = [];
    var _n = true;
    var _d = false;
    var _s, _e;
    try {
        for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
            _arr.push(_s.value);
            if (i && _arr.length === i) break;
        }
    } catch (err) {
        _d = true;
        _e = err;
    } finally{
        try {
            if (!_n && _i["return"] != null) _i["return"]();
        } finally{
            if (_d) throw _e;
        }
    }
    return _arr;
}
function _non_iterable_rest() {
    throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _sliced_to_array(arr, i) {
    return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
}
function _unsupported_iterable_to_array(o, minLen) {
    if (!o) return;
    if (typeof o === "string") return _array_like_to_array(o, minLen);
    var n = Object.prototype.toString.call(o).slice(8, -1);
    if (n === "Object" && o.constructor) n = o.constructor.name;
    if (n === "Map" || n === "Set") return Array.from(n);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
}
import { genStyleHooks, resetComponent } from "../../../../Hooks/useStyle";
export var JINJA_PANEL_PREFIX_CLS = 'agentic-md-editor-jinja-panel';
var genJinjaPanelStyle = function genJinjaPanelStyle(token) {
    return _define_property({}, token.componentCls, {
        boxSizing: 'border-box',
        display: 'flex',
        flexDirection: 'column',
        width: 360,
        height: 200,
        maxHeight: 320,
        minWidth: 240,
        overflow: 'hidden',
        borderRadius: 'var(--radius-control-sm, var(--ant-border-radius-sm))',
        backgroundColor: 'var(--color-gray-bg-page-light, var(--ant-color-bg-container))',
        boxShadow: 'var(--shadow-control-lg, var(--ant-box-shadow))',
        '&-content': {
            display: 'flex',
            flexDirection: 'column',
            flex: 1,
            overflow: 'hidden',
            padding: 4
        },
        '&-header': {
            padding: '6px 12px',
            display: 'flex',
            alignItems: 'center',
            justifyContent: 'space-between',
            flexShrink: 0
        },
        '&-header-actions': {
            display: 'flex',
            alignItems: 'center',
            gap: 8
        },
        '&-close': {
            display: 'flex',
            alignItems: 'center',
            justifyContent: 'center',
            padding: 4,
            margin: -4,
            border: 'none',
            background: 'transparent',
            cursor: 'pointer',
            color: 'var(--color-gray-text-light, var(--ant-color-text-secondary))',
            borderRadius: token.borderRadiusSM,
            '&:hover': {
                color: 'var(--color-gray-text-default, var(--ant-color-text))',
                backgroundColor: token.colorFillTertiary
            }
        },
        '&-title': {
            font: 'var(--font-text-body-emphasized-sm)',
            letterSpacing: 'var(--letter-spacing-body-emphasized-sm, normal)',
            color: 'var(--color-gray-text-light, var(--ant-color-text-secondary))'
        },
        '&-doc-link': {
            display: 'flex',
            cursor: 'pointer',
            alignItems: 'center',
            gap: 4,
            font: 'var(--font-text-body-emphasized-sm)',
            letterSpacing: 'var(--letter-spacing-body-emphasized-sm, normal)',
            color: 'var(--color-primary-text-default, var(--ant-color-link))'
        },
        '&-list-box': {
            flex: 1,
            overflowY: 'auto',
            padding: '4px 0'
        },
        '&-item': {
            display: 'flex',
            borderRadius: token.borderRadiusSM,
            flexDirection: 'row',
            alignItems: 'center',
            gap: 8,
            padding: '8px 12px',
            cursor: 'pointer',
            '&:hover': {
                backgroundColor: token.colorFillTertiary
            }
        },
        '&-item-active': {
            backgroundColor: token.controlItemBgHover
        },
        '&-item-title': {
            flexShrink: 0,
            font: 'var(--font-text-body-base)',
            letterSpacing: 'var(--letter-spacing-body-base, normal)',
            color: 'var(--color-gray-text-default, var(--ant-color-text))'
        },
        '&-item-desc': {
            flex: 1,
            minWidth: 0,
            font: 'var(--font-text-body-sm)',
            letterSpacing: 'var(--letter-spacing-body-sm, normal)',
            color: 'var(--color-gray-text-light, var(--ant-color-text-secondary))'
        }
    });
};
var useGenStyle = genStyleHooks('JinjaTemplatePanel', function(token, info) {
    return [
        resetComponent(token),
        genJinjaPanelStyle(token, info)
    ];
});
export function useJinjaTemplatePanelStyle(prefixCls) {
    // 缺省 prefixCls 时回退到 JINJA_PANEL_PREFIX_CLS，与组件内
    // `getPrefixCls('agentic-md-editor-jinja-panel') ?? JINJA_PANEL_PREFIX_CLS`
    // 保持一致
    var _useGenStyle = _sliced_to_array(useGenStyle(prefixCls !== null && prefixCls !== void 0 ? prefixCls : JINJA_PANEL_PREFIX_CLS), 2), wrapSSR = _useGenStyle[0], hashId = _useGenStyle[1];
    return {
        wrapSSR: wrapSSR,
        hashId: hashId
    };
}
