import { memoize } from 'lodash-es';
export const getIcon = memoize((name) => import('./lib/generated').then(m => m[`nxIcon${name}`]));
export const extractAllColors = memoize(async () => {
    const allIcons = await import('./lib/generated');
    const allSvgData = Object.values(allIcons)
        .map(({ data }) => data)
        .join('');
    const tempElement = document.createElement('div');
    tempElement.innerHTML = allSvgData;
    const colors = new Set();
    tempElement.querySelectorAll('[fill], [stroke]').forEach(el => {
        const fill = el.getAttribute('fill');
        const stroke = el.getAttribute('stroke');
        if (fill) {
            colors.add(fill);
        }
        if (stroke) {
            colors.add(stroke);
        }
    });
    return [...colors];
});
export const removeInlineStyles = memoize((svg) => svg.replace(/fill="[^"]*"/g, 'apply-fill').replace(/stroke="[^"]*"/g, 'apply-stroke'));
export const normalizeClassNames = memoize((svg) => svg
    .replace('primary', 'Primary')
    .replace('secondary', 'Secondary')
    .replace('third', 'Third')
    .replace('Vector', 'Primary')
    .replace('Union', 'Primary')
    .replace('Rectangle', 'Primary'));
export const removeClass = memoize((svg) => svg.replace(/class="[^"]*"/g, ''));
export const fullWidth = memoize((svg) => svg.replace(/width="[^"]*"/g, 'width="auto"'));
export const fullHeight = memoize((svg) => svg.replace(/height="[^"]*"/g, 'height="100%"'));
export * from './types';
//# sourceMappingURL=index.js.map