import { jsx } from "react/jsx-runtime";
import { Icon, SvgIcon } from "@mui/material";
import apollo_core from "@uipath/apollo-core";
import * as __rspack_external__assets_index_js_436c96f6 from "./assets/index.js";
const snakeToPascal = (str)=>str.split('_').map((word)=>word.charAt(0).toUpperCase() + word.slice(1)).join('');
const ApIcon = ({ name, size, color, variant = 'normal', style, 'data-testid': testId })=>{
    if ('outlined' === variant || 'normal' === variant) return /*#__PURE__*/ jsx(Icon, {
        className: 'outlined' === variant ? 'material-icons-outlined' : 'material-icons',
        "data-testid": testId || 'ap-icon',
        "data-name": name,
        sx: {
            fontSize: size || apollo_core.Icon.IconM,
            color: color || 'currentColor'
        },
        style: style,
        children: name
    });
    const legacyIconName = snakeToPascal(name);
    const LegacyIconComponent = __rspack_external__assets_index_js_436c96f6[legacyIconName];
    if (LegacyIconComponent) return /*#__PURE__*/ jsx(SvgIcon, {
        component: LegacyIconComponent,
        "data-testid": testId || 'ap-icon',
        "data-name": name,
        sx: {
            fontSize: size || apollo_core.Icon.IconM,
            color: color || 'currentColor'
        }
    });
    console.warn(`Icon "${name}" not found in legacy or core icons`);
    return null;
};
export { ApIcon };
