"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.categories = exports.getOperatorTitleByFeatureId = exports.useOperatorSpecs = exports.getOperatorSpecs = exports.HighlightedText = exports.highlightMatch = exports.isOCPVersionEqualsOrMore = void 0;
const tslib_1 = require("tslib");
const react_1 = tslib_1.__importDefault(require("react"));
const constants_1 = require("../../config/constants");
const ui_1 = require("../ui");
const config_1 = require("../../config");
const utils_1 = require("../../utils");
const newFeatureSupportLevels_1 = require("../newFeatureSupportLevels");
const operatorDescriptions_1 = require("./operatorDescriptions");
// TODO check if it's unused and it can be deleted in favor of "isMajorMinorVersionEqualOrGreater"
const isOCPVersionEqualsOrMore = (openshiftVersion, ocpVersionToCompare) => {
    const [majorA, minorA] = (0, utils_1.getMajorMinorVersion)(openshiftVersion).split('.');
    const [majorB, minorB] = ocpVersionToCompare.split('.');
    return (Number(majorA) > Number(majorB) ||
        (Number(majorA) === Number(majorB) && Number(minorA) >= Number(minorB)));
};
exports.isOCPVersionEqualsOrMore = isOCPVersionEqualsOrMore;
const highlightMatch = (text, searchTerm) => {
    if (!searchTerm)
        return text;
    try {
        const escapeSearchTerm = searchTerm.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
        const regex = new RegExp(`(${escapeSearchTerm})`, 'gi');
        const parts = text.split(regex);
        return parts.map((part, i) => part.toLowerCase() === searchTerm.toLowerCase() ? react_1.default.createElement("mark", { key: i }, part) : part);
    }
    catch (err) {
        // eslint-disable-next-line no-console
        console.log('failed to highlight search text', err);
        return text;
    }
};
exports.highlightMatch = highlightMatch;
const HighlightedText = ({ text, searchTerm }) => (react_1.default.createElement(react_1.default.Fragment, null, (0, exports.highlightMatch)(text, searchTerm)));
exports.HighlightedText = HighlightedText;
const getOperatorSpecs = (getFeatureSupportLevel, useLVMS) => {
    return {
        [exports.categories[Category.STORAGE]]: [
            {
                operatorKey: constants_1.OPERATOR_NAME_LSO,
                title: 'Local Storage Operator',
                featureId: 'LSO',
                descriptionText: operatorDescriptions_1.DESCRIPTION_LSO,
                Description: ({ openshiftVersion, searchTerm }) => (react_1.default.createElement(react_1.default.Fragment, null,
                    react_1.default.createElement(exports.HighlightedText, { text: operatorDescriptions_1.DESCRIPTION_LSO, searchTerm: searchTerm }),
                    ' ',
                    react_1.default.createElement(ui_1.ExternalLink, { href: (0, config_1.getLsoLink)(openshiftVersion) }, "Learn more"))),
                notStandalone: true,
                supportLevel: getFeatureSupportLevel('LSO'),
            },
            {
                operatorKey: constants_1.OPERATOR_NAME_LVM,
                title: useLVMS ? 'Logical Volume Manager Storage' : 'Logical Volume Manager',
                featureId: 'LVM',
                descriptionText: operatorDescriptions_1.DESCRIPTION_LVM,
                Description: ({ openshiftVersion, searchTerm }) => useLVMS ? (react_1.default.createElement(react_1.default.Fragment, null,
                    react_1.default.createElement(exports.HighlightedText, { text: operatorDescriptions_1.DESCRIPTION_LVM, searchTerm: searchTerm }),
                    ' ',
                    react_1.default.createElement(ui_1.ExternalLink, { href: (0, config_1.getLvmsDocsLink)(openshiftVersion) }, "Learn more"))) : (react_1.default.createElement(react_1.default.Fragment, null,
                    react_1.default.createElement(exports.HighlightedText, { text: operatorDescriptions_1.DESCRIPTION_LVM, searchTerm: searchTerm }),
                    ' ')),
                supportLevel: getFeatureSupportLevel('LVM'),
            },
            {
                operatorKey: constants_1.OPERATOR_NAME_ODF,
                title: 'OpenShift Data Foundation',
                featureId: 'ODF',
                descriptionText: operatorDescriptions_1.DESCRIPTION_ODF,
                Requirements: () => (react_1.default.createElement(ui_1.ExternalLink, { href: config_1.ODF_REQUIREMENTS_LINK }, "Learn more about the requirements for OpenShift Data Foundation")),
                Description: ({ searchTerm }) => (react_1.default.createElement(react_1.default.Fragment, null,
                    react_1.default.createElement(exports.HighlightedText, { text: operatorDescriptions_1.DESCRIPTION_ODF, searchTerm: searchTerm }),
                    ' ',
                    react_1.default.createElement(ui_1.ExternalLink, { href: config_1.ODF_LINK }, "Learn more"))),
                supportLevel: getFeatureSupportLevel('ODF'),
            },
            {
                operatorKey: constants_1.OPERATOR_NAME_OADP,
                title: 'OADP',
                featureId: 'OADP',
                descriptionText: operatorDescriptions_1.DESCRIPTION_OADP,
                Description: ({ openshiftVersion, searchTerm }) => (react_1.default.createElement(react_1.default.Fragment, null,
                    react_1.default.createElement(exports.HighlightedText, { text: operatorDescriptions_1.DESCRIPTION_OADP, searchTerm: searchTerm }),
                    ' ',
                    react_1.default.createElement(ui_1.ExternalLink, { href: (0, config_1.getOadpLink)(openshiftVersion) }, "Learn more"))),
                notStandalone: true,
                supportLevel: getFeatureSupportLevel('OADP'),
            },
        ],
        [exports.categories[Category.VIRT]]: [
            {
                operatorKey: constants_1.OPERATOR_NAME_CNV,
                title: 'OpenShift Virtualization',
                featureId: 'CNV',
                descriptionText: operatorDescriptions_1.DESCRIPTION_CNV,
                Requirements: () => (react_1.default.createElement(react_1.default.Fragment, null, "Enabled CPU virtualization support in BIOS (Intel-VT / AMD-V) on all nodes")),
                Description: ({ searchTerm }) => (react_1.default.createElement(react_1.default.Fragment, null,
                    react_1.default.createElement(exports.HighlightedText, { text: operatorDescriptions_1.DESCRIPTION_CNV, searchTerm: searchTerm }),
                    ' ',
                    react_1.default.createElement(ui_1.ExternalLink, { href: config_1.CNV_LINK }, "Learn more"))),
                supportLevel: getFeatureSupportLevel('CNV'),
            },
            {
                operatorKey: constants_1.OPERATOR_NAME_MTV,
                title: 'Migration Toolkit for Virtualization',
                featureId: 'MTV',
                descriptionText: operatorDescriptions_1.DESCRIPTION_MTV,
                Description: ({ searchTerm }) => (react_1.default.createElement(react_1.default.Fragment, null,
                    react_1.default.createElement(exports.HighlightedText, { text: operatorDescriptions_1.DESCRIPTION_MTV, searchTerm: searchTerm }),
                    ' ',
                    react_1.default.createElement(ui_1.ExternalLink, { href: config_1.MTV_LINK }, "Learn more"))),
                supportLevel: getFeatureSupportLevel('MTV'),
            },
            {
                operatorKey: constants_1.OPERATOR_NAME_OSC,
                title: 'OpenShift sandboxed containers',
                featureId: 'OSC',
                descriptionText: operatorDescriptions_1.DESCRIPTION_OSC,
                Requirements: () => (react_1.default.createElement(ui_1.ExternalLink, { href: config_1.OSC_REQUIREMENTS_LINK }, "Learn more about the requirements for OpenShift sandboxed containers")),
                Description: ({ searchTerm }) => (react_1.default.createElement(react_1.default.Fragment, null,
                    react_1.default.createElement(exports.HighlightedText, { text: operatorDescriptions_1.DESCRIPTION_OSC, searchTerm: searchTerm }),
                    ' ',
                    react_1.default.createElement(ui_1.ExternalLink, { href: config_1.OSC_LINK }, "Learn more"))),
                supportLevel: getFeatureSupportLevel('OSC'),
            },
        ],
        [exports.categories[Category.AI]]: [
            {
                operatorKey: constants_1.OPERATOR_NAME_OPENSHIFT_AI,
                title: 'OpenShift AI',
                featureId: 'OPENSHIFT_AI',
                descriptionText: operatorDescriptions_1.DESCRIPTION_OPENSHIFT_AI,
                Requirements: () => (react_1.default.createElement(ui_1.ExternalLink, { href: config_1.OPENSHIFT_AI_REQUIREMENTS_LINK }, "Learn more")),
                Description: ({ searchTerm }) => (react_1.default.createElement(react_1.default.Fragment, null,
                    react_1.default.createElement(exports.HighlightedText, { text: operatorDescriptions_1.DESCRIPTION_OPENSHIFT_AI, searchTerm: searchTerm }),
                    ' ',
                    react_1.default.createElement(ui_1.ExternalLink, { href: config_1.OPENSHIFT_AI_LINK }, "Learn more"))),
                supportLevel: getFeatureSupportLevel('OPENSHIFT_AI'),
            },
            {
                operatorKey: constants_1.OPERATOR_NAME_AMD_GPU,
                title: 'AMD GPU',
                featureId: 'AMD_GPU',
                descriptionText: operatorDescriptions_1.DESCRIPTION_AMD_GPU,
                Requirements: () => react_1.default.createElement(react_1.default.Fragment, null, "Requires at least one supported AMD GPU"),
                Description: ({ searchTerm }) => (react_1.default.createElement(react_1.default.Fragment, null,
                    ' ',
                    react_1.default.createElement(exports.HighlightedText, { text: operatorDescriptions_1.DESCRIPTION_AMD_GPU, searchTerm: searchTerm }),
                    ' ')),
                supportLevel: getFeatureSupportLevel('AMD_GPU'),
            },
            {
                operatorKey: constants_1.OPERATOR_NAME_NVIDIA_GPU,
                title: 'NVIDIA GPU',
                featureId: 'NVIDIA_GPU',
                descriptionText: operatorDescriptions_1.DESCRIPTION_NVIDIA_GPU,
                Requirements: () => react_1.default.createElement(react_1.default.Fragment, null, "Requires at least one supported NVIDIA GPU"),
                Description: ({ openshiftVersion, searchTerm }) => (react_1.default.createElement(react_1.default.Fragment, null,
                    react_1.default.createElement(exports.HighlightedText, { text: operatorDescriptions_1.DESCRIPTION_NVIDIA_GPU, searchTerm: searchTerm }),
                    ' ',
                    react_1.default.createElement(ui_1.ExternalLink, { href: (0, config_1.getNvidiaGpuLink)(openshiftVersion) }, "Learn more"))),
                supportLevel: getFeatureSupportLevel('NVIDIA_GPU'),
            },
        ],
        [exports.categories[Category.NETWORK]]: [
            {
                operatorKey: constants_1.OPERATOR_NAME_NMSTATE,
                title: 'NMState',
                featureId: 'NMSTATE',
                descriptionText: operatorDescriptions_1.DESCRIPTION_NMSTATE,
                Description: ({ openshiftVersion, searchTerm }) => (react_1.default.createElement(react_1.default.Fragment, null,
                    react_1.default.createElement(exports.HighlightedText, { text: operatorDescriptions_1.DESCRIPTION_NMSTATE, searchTerm: searchTerm }),
                    ' ',
                    react_1.default.createElement(ui_1.ExternalLink, { href: (0, config_1.getNmstateLink)(openshiftVersion) }, "Learn more"))),
                supportLevel: getFeatureSupportLevel('NMSTATE'),
            },
            {
                operatorKey: constants_1.OPERATOR_NAME_SERVICEMESH,
                title: 'Service Mesh',
                featureId: 'SERVICEMESH',
                descriptionText: operatorDescriptions_1.DESCRIPTION_SERVICEMESH,
                Description: ({ searchTerm }) => (react_1.default.createElement(react_1.default.Fragment, null,
                    react_1.default.createElement(exports.HighlightedText, { text: operatorDescriptions_1.DESCRIPTION_SERVICEMESH, searchTerm: searchTerm }),
                    ' ',
                    react_1.default.createElement(ui_1.ExternalLink, { href: config_1.SERVICE_MESH_OPERATOR_LINK }, "Learn more"))),
                notStandalone: true,
                supportLevel: getFeatureSupportLevel('SERVICEMESH'),
            },
            {
                operatorKey: constants_1.OPERATOR_NAME_METALLB,
                title: 'MetalLB',
                featureId: 'METALLB',
                descriptionText: operatorDescriptions_1.DESCRIPTION_METALLB,
                Description: ({ openshiftVersion, searchTerm }) => (react_1.default.createElement(react_1.default.Fragment, null,
                    react_1.default.createElement(exports.HighlightedText, { text: operatorDescriptions_1.DESCRIPTION_METALLB, searchTerm: searchTerm }),
                    ' ',
                    react_1.default.createElement(ui_1.ExternalLink, { href: (0, config_1.getMetalLbLink)(openshiftVersion) }, "Learn more"))),
                notStandalone: true,
                supportLevel: getFeatureSupportLevel('METALLB'),
            },
        ],
        [exports.categories[Category.REMEDIATION]]: [
            {
                operatorKey: constants_1.OPERATOR_NAME_NODE_HEALTHCHECK,
                title: 'Node Healthcheck',
                featureId: 'NODE_HEALTHCHECK',
                descriptionText: operatorDescriptions_1.DESCRIPTION_NODE_HEALTHCHECK,
                Description: ({ searchTerm }) => (react_1.default.createElement(react_1.default.Fragment, null,
                    react_1.default.createElement(exports.HighlightedText, { text: operatorDescriptions_1.DESCRIPTION_NODE_HEALTHCHECK, searchTerm: searchTerm }),
                    ' ',
                    react_1.default.createElement(ui_1.ExternalLink, { href: config_1.NODE_HEALTHCHECK_LINK }, "Learn more"))),
                notStandalone: true,
                supportLevel: getFeatureSupportLevel('NODE_HEALTHCHECK'),
            },
            {
                operatorKey: constants_1.OPERATOR_NAME_FENCE_AGENTS_REMEDIATION,
                title: 'Fence Agents Remediation',
                featureId: 'FENCE_AGENTS_REMEDIATION',
                descriptionText: operatorDescriptions_1.DESCRIPTION_FENCE_AGENTS_REMEDIATION,
                Description: ({ searchTerm }) => (react_1.default.createElement(react_1.default.Fragment, null,
                    react_1.default.createElement(exports.HighlightedText, { text: operatorDescriptions_1.DESCRIPTION_FENCE_AGENTS_REMEDIATION, searchTerm: searchTerm }),
                    ' ',
                    react_1.default.createElement(ui_1.ExternalLink, { href: config_1.FENCE_AGENTS_REMEDIATION_LINK }, "Learn more"))),
                notStandalone: true,
                supportLevel: getFeatureSupportLevel('FENCE_AGENTS_REMEDIATION'),
            },
        ],
        [exports.categories[Category.SECURITY]]: [
            {
                operatorKey: constants_1.OPERATOR_NAME_AUTHORINO,
                title: 'Authorino',
                featureId: 'AUTHORINO',
                descriptionText: operatorDescriptions_1.DESCRIPTION_AUTHORINO,
                Description: ({ searchTerm }) => (react_1.default.createElement(react_1.default.Fragment, null,
                    react_1.default.createElement(exports.HighlightedText, { text: operatorDescriptions_1.DESCRIPTION_AUTHORINO, searchTerm: searchTerm }),
                    ' ',
                    react_1.default.createElement(ui_1.ExternalLink, { href: config_1.AUTHORINO_OPERATOR_LINK }, "Learn more"))),
                notStandalone: true,
                supportLevel: getFeatureSupportLevel('AUTHORINO'),
            },
            {
                operatorKey: constants_1.OPERATOR_NAME_KMM,
                title: 'Kernel Module Management',
                featureId: 'KMM',
                descriptionText: operatorDescriptions_1.DESCRIPTION_KMM,
                Description: ({ openshiftVersion, searchTerm }) => (react_1.default.createElement(react_1.default.Fragment, null,
                    react_1.default.createElement(exports.HighlightedText, { text: operatorDescriptions_1.DESCRIPTION_KMM, searchTerm: searchTerm }),
                    ' ',
                    react_1.default.createElement(ui_1.ExternalLink, { href: (0, config_1.getKmmDocsLink)(openshiftVersion) }, "Learn more"))),
                supportLevel: getFeatureSupportLevel('KMM'),
            },
        ],
        [exports.categories[Category.CI_CD]]: [
            {
                operatorKey: constants_1.OPERATOR_NAME_PIPELINES,
                title: 'Pipelines',
                featureId: 'PIPELINES',
                descriptionText: operatorDescriptions_1.DESCRIPTION_PIPELINES,
                Description: ({ searchTerm }) => (react_1.default.createElement(react_1.default.Fragment, null,
                    react_1.default.createElement(exports.HighlightedText, { text: operatorDescriptions_1.DESCRIPTION_PIPELINES, searchTerm: searchTerm }),
                    ' ',
                    react_1.default.createElement(ui_1.ExternalLink, { href: config_1.PIPELINES_OPERATOR_LINK }, "Learn more"))),
                notStandalone: true,
                supportLevel: getFeatureSupportLevel('PIPELINES'),
            },
            {
                operatorKey: constants_1.OPERATOR_NAME_SERVERLESS,
                title: 'Serverless',
                featureId: 'SERVERLESS',
                descriptionText: operatorDescriptions_1.DESCRIPTION_SERVERLESS,
                Description: ({ searchTerm }) => (react_1.default.createElement(react_1.default.Fragment, null,
                    react_1.default.createElement(exports.HighlightedText, { text: operatorDescriptions_1.DESCRIPTION_SERVERLESS, searchTerm: searchTerm }),
                    ' ',
                    react_1.default.createElement(ui_1.ExternalLink, { href: config_1.SERVERLESS_OPERATOR_LINK }, "Learn more"))),
                notStandalone: true,
                supportLevel: getFeatureSupportLevel('SERVERLESS'),
            },
        ],
        [exports.categories[Category.PLATFORM]]: [
            {
                operatorKey: constants_1.OPERATOR_NAME_MCE,
                title: 'Multicluster engine',
                featureId: 'MCE',
                descriptionText: operatorDescriptions_1.DESCRIPTION_MCE,
                Description: ({ openshiftVersion, searchTerm }) => (react_1.default.createElement(react_1.default.Fragment, null,
                    react_1.default.createElement(exports.HighlightedText, { text: operatorDescriptions_1.DESCRIPTION_MCE, searchTerm: searchTerm }),
                    ' ',
                    react_1.default.createElement(ui_1.ExternalLink, { href: (0, config_1.getMceDocsLink)(openshiftVersion) }, "Learn more"))),
                supportLevel: getFeatureSupportLevel('MCE'),
            },
            {
                operatorKey: constants_1.OPERATOR_NAME_NODE_MAINTENANCE,
                title: 'Node Maintenance',
                featureId: 'NODE_MAINTENANCE',
                descriptionText: operatorDescriptions_1.DESCRIPTION_NODE_MAINTENANCE,
                Description: ({ searchTerm }) => (react_1.default.createElement(react_1.default.Fragment, null,
                    react_1.default.createElement(exports.HighlightedText, { text: operatorDescriptions_1.DESCRIPTION_NODE_MAINTENANCE, searchTerm: searchTerm }),
                    ' ',
                    react_1.default.createElement(ui_1.ExternalLink, { href: config_1.NODE_MAINTENANCE_LINK }, "Learn more"))),
                notStandalone: true,
                supportLevel: getFeatureSupportLevel('NODE_MAINTENANCE'),
            },
            {
                operatorKey: constants_1.OPERATOR_NAME_CLUSTER_OBSERVABILITY,
                title: 'Cluster Observability',
                featureId: 'CLUSTER_OBSERVABILITY',
                descriptionText: operatorDescriptions_1.DESCRIPTION_CLUSTER_OBSERVABILITY,
                Description: ({ openshiftVersion, searchTerm }) => (react_1.default.createElement(react_1.default.Fragment, null,
                    react_1.default.createElement(exports.HighlightedText, { text: operatorDescriptions_1.DESCRIPTION_CLUSTER_OBSERVABILITY, searchTerm: searchTerm }),
                    ' ',
                    react_1.default.createElement(ui_1.ExternalLink, { href: (0, config_1.getClusterObservabilityLink)(openshiftVersion) }, "Learn more"))),
                supportLevel: getFeatureSupportLevel('CLUSTER_OBSERVABILITY'),
            },
            {
                operatorKey: constants_1.OPERATOR_NAME_LOKI,
                title: 'Loki Operator',
                featureId: 'CLUSTER_OBSERVABILITY',
                descriptionText: operatorDescriptions_1.DESCRIPTION_LOKI,
                Description: ({ openshiftVersion, searchTerm }) => (react_1.default.createElement(react_1.default.Fragment, null,
                    react_1.default.createElement(exports.HighlightedText, { text: operatorDescriptions_1.DESCRIPTION_LOKI, searchTerm: searchTerm }),
                    ' ',
                    react_1.default.createElement(ui_1.ExternalLink, { href: (0, config_1.getLokiLink)(openshiftVersion) }, "Learn more"))),
                notStandalone: true,
                supportLevel: getFeatureSupportLevel('LOKI'),
            },
            {
                operatorKey: constants_1.OPERATOR_NAME_OPENSHIFT_LOGGING,
                title: 'OpenShift Logging',
                featureId: 'CLUSTER_OBSERVABILITY',
                descriptionText: operatorDescriptions_1.DESCRIPTION_OPENSHIFT_LOGGING,
                Description: ({ openshiftVersion, searchTerm }) => (react_1.default.createElement(react_1.default.Fragment, null,
                    react_1.default.createElement(exports.HighlightedText, { text: operatorDescriptions_1.DESCRIPTION_OPENSHIFT_LOGGING, searchTerm: searchTerm }),
                    ' ',
                    react_1.default.createElement(ui_1.ExternalLink, { href: (0, config_1.getOpenShiftLoggingLink)(openshiftVersion) }, "Learn more"))),
                notStandalone: true,
                supportLevel: getFeatureSupportLevel('OPENSHIFT_LOGGING'),
            },
        ],
        [exports.categories[Category.SCHEDULING]]: [
            {
                operatorKey: constants_1.OPERATOR_NAME_NODE_FEATURE_DISCOVERY,
                title: 'Node Feature Discovery',
                featureId: 'NODE_FEATURE_DISCOVERY',
                descriptionText: operatorDescriptions_1.DESCRIPTION_NODE_FEATURE_DISCOVERY,
                Description: ({ openshiftVersion, searchTerm }) => (react_1.default.createElement(react_1.default.Fragment, null,
                    react_1.default.createElement(exports.HighlightedText, { text: operatorDescriptions_1.DESCRIPTION_NODE_FEATURE_DISCOVERY, searchTerm: searchTerm }),
                    ' ',
                    react_1.default.createElement(ui_1.ExternalLink, { href: (0, config_1.getNodeFeatureDiscoveryLink)(openshiftVersion) }, "Learn more"))),
                supportLevel: getFeatureSupportLevel('NODE_FEATURE_DISCOVERY'),
            },
            {
                operatorKey: constants_1.OPERATOR_NAME_KUBE_DESCHEDULER,
                title: 'Kube Descheduler',
                featureId: 'KUBE_DESCHEDULER',
                descriptionText: operatorDescriptions_1.DESCRIPTION_KUBE_DESCHEDULER,
                Description: ({ openshiftVersion, searchTerm }) => (react_1.default.createElement(react_1.default.Fragment, null,
                    react_1.default.createElement(exports.HighlightedText, { text: operatorDescriptions_1.DESCRIPTION_KUBE_DESCHEDULER, searchTerm: searchTerm }),
                    ' ',
                    react_1.default.createElement(ui_1.ExternalLink, { href: (0, config_1.getKubeDeschedulerLink)(openshiftVersion) }, "Learn more"))),
                notStandalone: true,
                supportLevel: getFeatureSupportLevel('KUBE_DESCHEDULER'),
            },
            {
                operatorKey: constants_1.OPERATOR_NAME_NUMA_RESOURCES,
                title: 'NUMA Resources',
                featureId: 'NUMA_RESOURCES',
                descriptionText: operatorDescriptions_1.DESCRIPTION_NUMA_RESOURCES,
                Description: ({ openshiftVersion, searchTerm }) => (react_1.default.createElement(react_1.default.Fragment, null,
                    react_1.default.createElement(exports.HighlightedText, { text: operatorDescriptions_1.DESCRIPTION_NUMA_RESOURCES, searchTerm: searchTerm }),
                    ' ',
                    react_1.default.createElement(ui_1.ExternalLink, { href: (0, config_1.getNumaResourcesLink)(openshiftVersion) }, "Learn more"))),
                notStandalone: true,
                supportLevel: getFeatureSupportLevel('NUMA_RESOURCES'),
            },
        ],
    };
};
exports.getOperatorSpecs = getOperatorSpecs;
const useOperatorSpecs = () => {
    const { getFeatureSupportLevel } = (0, newFeatureSupportLevels_1.useNewFeatureSupportLevel)();
    const useLVMS = getFeatureSupportLevel('LVM') === 'supported';
    // Grouped by category
    const byCategory = react_1.default.useMemo(() => (0, exports.getOperatorSpecs)(getFeatureSupportLevel, useLVMS), [getFeatureSupportLevel, useLVMS]);
    // Flat map operatorKey -> spec
    const byKey = react_1.default.useMemo(() => {
        return Object.values(byCategory).reduce((acc, specs) => {
            specs.forEach((spec) => {
                acc[spec.operatorKey] = spec;
            });
            return acc;
        }, {});
    }, [byCategory]);
    return { byCategory, byKey };
};
exports.useOperatorSpecs = useOperatorSpecs;
const getOperatorTitleByFeatureId = (featureId) => {
    const allSpecs = (0, exports.getOperatorSpecs)(() => undefined);
    for (const categorySpecs of Object.values(allSpecs)) {
        const spec = categorySpecs.find((s) => s.featureId === featureId);
        if (spec) {
            return spec.title;
        }
    }
    return undefined;
};
exports.getOperatorTitleByFeatureId = getOperatorTitleByFeatureId;
var Category;
(function (Category) {
    Category[Category["STORAGE"] = 0] = "STORAGE";
    Category[Category["VIRT"] = 1] = "VIRT";
    Category[Category["AI"] = 2] = "AI";
    Category[Category["NETWORK"] = 3] = "NETWORK";
    Category[Category["CI_CD"] = 4] = "CI_CD";
    Category[Category["PLATFORM"] = 5] = "PLATFORM";
    Category[Category["SECURITY"] = 6] = "SECURITY";
    Category[Category["SCHEDULING"] = 7] = "SCHEDULING";
    Category[Category["REMEDIATION"] = 8] = "REMEDIATION";
    Category[Category["OTHER"] = 9] = "OTHER";
})(Category || (Category = {}));
exports.categories = {
    [Category.STORAGE]: 'Storage',
    [Category.VIRT]: 'Virtualization',
    [Category.AI]: 'AI',
    [Category.NETWORK]: 'Network',
    [Category.SECURITY]: 'Security & Access Control',
    [Category.CI_CD]: 'CI/CD & Dev Productivity',
    [Category.PLATFORM]: 'Platform Operations & Lifecycle',
    [Category.SCHEDULING]: 'Scheduling',
    [Category.REMEDIATION]: 'Remediation',
    [Category.OTHER]: 'Other',
};
//# sourceMappingURL=operatorSpecs.js.map