import { jsx } from "react/jsx-runtime";
import CheckCircleOutline from "@mui/icons-material/CheckCircleOutline";
import PublicOff from "@mui/icons-material/PublicOff";
import Route from "@mui/icons-material/Route";
import ScienceOutlined from "@mui/icons-material/ScienceOutlined";
import WarningAmberOutlined from "@mui/icons-material/WarningAmberOutlined";
import Chip from "@mui/material/Chip";
import Tooltip from "@mui/material/Tooltip";
const VARIANT_MAP = {
    recommended: 'success-mini',
    preview: 'info-mini',
    deprecating: 'warning-mini',
    substituted: 'warning-mini',
    'out-of-region': 'error-mini',
    custom: 'mini',
    thinking: 'info-mini',
    'cost-basic': 'mini',
    'cost-standard': 'mini',
    'cost-premium': 'mini'
};
const MINI_COLORS = {
    mini: {
        color: 'var(--color-foreground, #273139)',
        backgroundColor: 'var(--color-background-secondary, #f4f5f7)'
    },
    'info-mini': {
        color: 'var(--color-info-foreground, #1665b3)',
        backgroundColor: 'var(--color-info-background, #e9f1fa)'
    },
    'success-mini': {
        color: 'var(--color-success-text, #038108)',
        backgroundColor: 'var(--color-success-background, #eeffe5)'
    },
    'warning-mini': {
        color: 'var(--color-warning-text, #9e6100)',
        backgroundColor: 'var(--color-warning-background, #fff3db)'
    },
    'error-mini': {
        color: 'var(--color-error-text, #a6040a)',
        backgroundColor: 'var(--color-error-background, #fff0f1)'
    }
};
const ICON_MAP = {
    recommended: CheckCircleOutline,
    preview: ScienceOutlined,
    deprecating: WarningAmberOutlined,
    substituted: Route,
    'out-of-region': PublicOff
};
const ModelTagChip = ({ tag, variants, icons })=>{
    const variantClass = tag.variant ?? variants?.[tag.kind] ?? VARIANT_MAP[tag.kind] ?? 'mini';
    const Icon = icons && tag.kind in icons ? icons[tag.kind] : ICON_MAP[tag.kind];
    const colors = MINI_COLORS[variantClass] ?? MINI_COLORS['mini'];
    const chip = /*#__PURE__*/ jsx(Chip, {
        size: "small",
        label: tag.label,
        className: variantClass,
        icon: Icon ? /*#__PURE__*/ jsx(Icon, {
            fontSize: "inherit"
        }) : void 0,
        sx: {
            height: '16px',
            paddingLeft: 0,
            paddingRight: 0,
            fontSize: '10px',
            lineHeight: '16px',
            fontWeight: 600,
            ...colors,
            '& .MuiChip-label': {
                px: 0.75
            },
            '& .MuiChip-icon': {
                fontSize: 13,
                marginLeft: 0.5,
                marginRight: -0.25,
                color: 'inherit'
            }
        }
    });
    if (tag.tooltip) return /*#__PURE__*/ jsx(Tooltip, {
        title: tag.tooltip,
        arrow: true,
        placement: "top",
        children: /*#__PURE__*/ jsx("span", {
            children: chip
        })
    });
    return chip;
};
export { ModelTagChip };
