import React from "react";
//#region src/components/iconSelect/utils.tsx
function getIconfontIconList() {
	return Array.prototype.slice.call(window.document.querySelectorAll("svg[style=\"position: absolute; width: 0px; height: 0px; overflow: hidden;\"][aria-hidden=\"true\"] > symbol")).map((symbol) => {
		const { id } = symbol;
		return {
			name: id,
			group: "iconfont",
			icon: (props) => /* @__PURE__ */ React.createElement("span", {
				role: "img",
				className: "anticon"
			}, /* @__PURE__ */ React.createElement("svg", {
				viewBox: "64 64 896 896",
				width: "1em",
				height: "1em",
				fill: "currentColor",
				dangerouslySetInnerHTML: { __html: symbol.innerHTML }
			}))
		};
	});
}
function getAntdIconList() {
	const antdIcons = window.icons;
	return Object.keys(antdIcons).map((key) => {
		var _ref, _item$displayName, _item$render;
		const item = antdIcons[key];
		if (typeof item !== "object") return null;
		const name = (_ref = (_item$displayName = item === null || item === void 0 ? void 0 : item.displayName) !== null && _item$displayName !== void 0 ? _item$displayName : item === null || item === void 0 || (_item$render = item.render) === null || _item$render === void 0 ? void 0 : _item$render.displayName) !== null && _ref !== void 0 ? _ref : key;
		let group = "outlined";
		const lowercaseName = name.toLowerCase();
		if (/outlined$/.test(lowercaseName)) group = "outlined";
		else if (/filled$/.test(lowercaseName)) group = "filled";
		else if (/twotone$/.test(lowercaseName)) group = "two-tone";
		else return null;
		return {
			name,
			group,
			icon: item
		};
	}).filter(Boolean);
}
function getIconList() {
	const iconfontIconList = getIconfontIconList();
	const antdIconList = getAntdIconList();
	const allIcons = [...iconfontIconList, ...antdIconList];
	const uniqueIconsMap = /* @__PURE__ */ new Map();
	allIcons.forEach((icon) => {
		if (!uniqueIconsMap.has(icon.name)) uniqueIconsMap.set(icon.name, icon);
	});
	return Array.from(uniqueIconsMap.values());
}
//#endregion
export { getIconList };
