import createDebugger from 'debug'; import { mergeIconProps } from './utils.mjs'; import { trimSVG } from '../svg/trim.mjs'; const debug = createDebugger("@iconify-loader:custom"); async function getCustomIcon(custom, collection, icon, options) { let result; debug(`${collection}:${icon}`); if (typeof custom === "function") { result = await custom(icon); } else { const inline = custom[icon]; result = typeof inline === "function" ? await inline() : inline; } if (result) { const cleanupIdx = result.indexOf(" 0) result = result.slice(cleanupIdx); const { transform } = options?.customizations ?? {}; result = typeof transform === "function" ? await transform(result, collection, icon) : result; if (!result.startsWith("