import { jsx } from "react/jsx-runtime";
import "react";
import * as __WEBPACK_EXTERNAL_MODULE__ant_design_icons_a8184985__ from "@ant-design/icons";
import * as __WEBPACK_EXTERNAL_MODULE__preloaded_mjs_9b71dc23__ from "./preloaded.mjs";
let IconFont;
const Icon_icons = new Map();
function registerIcon(type) {
    let icon = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : IconFont;
    Icon_icons.set(type.toLowerCase(), icon);
}
function hasIcon(type) {
    if (!type) return false;
    return Icon_icons.has(type.toLowerCase());
}
function registerIcons(components) {
    Object.keys(components).forEach((type)=>{
        registerIcon(type, components[type]);
    });
}
Object.keys(__WEBPACK_EXTERNAL_MODULE__ant_design_icons_a8184985__).forEach((name)=>{
    if (name.endsWith('Outlined')) registerIcon(name, __WEBPACK_EXTERNAL_MODULE__ant_design_icons_a8184985__[name]);
});
const Icon = (props)=>{
    const { type = '', component, ...restProps } = props;
    if (component) return /*#__PURE__*/ jsx(__WEBPACK_EXTERNAL_MODULE__ant_design_icons_a8184985__["default"], {
        component: component,
        ...restProps
    });
    if (type && Icon_icons.has(type.toLowerCase())) {
        const IconComponent = Icon_icons.get(type.toLowerCase());
        return /*#__PURE__*/ jsx(IconComponent, {
            ...restProps
        });
    }
    if (type && IconFont) return /*#__PURE__*/ jsx(IconFont, {
        type: type,
        ...restProps
    });
    return null;
};
Icon.createFromIconfontCN = (options)=>{
    IconFont = (0, __WEBPACK_EXTERNAL_MODULE__ant_design_icons_a8184985__.createFromIconfontCN)(options);
};
Icon.register = (icons)=>{
    registerIcons(icons);
};
for(const name in __WEBPACK_EXTERNAL_MODULE__preloaded_mjs_9b71dc23__){
    const PreloadedIcon = (props)=>/*#__PURE__*/ jsx(Icon, {
            component: __WEBPACK_EXTERNAL_MODULE__preloaded_mjs_9b71dc23__[name],
            ...props
        });
    Icon.register({
        [name]: PreloadedIcon
    });
}
const icon_Icon = Icon;
export { Icon, icon_Icon as default, hasIcon, Icon_icons as icons, registerIcon, registerIcons };
