"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.OPERATOR_NAME_METALLB = exports.OPERATOR_NAME_OADP = exports.OPERATOR_NAME_NUMA_RESOURCES = exports.OPERATOR_NAME_OPENSHIFT_LOGGING = exports.OPERATOR_NAME_LOKI = exports.OPERATOR_NAME_CLUSTER_OBSERVABILITY = exports.OPERATOR_NAME_KUBE_DESCHEDULER = exports.OPERATOR_NAME_NODE_MAINTENANCE = exports.OPERATOR_NAME_FENCE_AGENTS_REMEDIATION = exports.OPERATOR_NAME_SELF_NODE_REMEDIATION = exports.OPERATOR_NAME_NODE_HEALTHCHECK = exports.OPERATOR_NAME_KMM = exports.OPERATOR_NAME_AMD_GPU = exports.OPERATOR_NAME_AUTHORINO = exports.OPERATOR_NAME_NMSTATE = exports.OPERATOR_NAME_OSC = exports.OPERATOR_NAME_OPENSHIFT_AI = exports.OPERATOR_NAME_SERVERLESS = exports.OPERATOR_NAME_SERVICEMESH = exports.OPERATOR_NAME_PIPELINES = exports.OPERATOR_NAME_NVIDIA_GPU = exports.OPERATOR_NAME_NODE_FEATURE_DISCOVERY = exports.OPERATOR_NAME_MTV = exports.OPERATOR_NAME_MCE = exports.OPERATOR_NAME_LVM = exports.OPERATOR_NAME_ODF = exports.OPERATOR_NAME_LSO = exports.OPERATOR_NAME_CNV = exports.diskRoleLabels = exports.PREFIX_MAX_RESTRICTION = exports.DUAL_STACK = exports.SINGLE_STACK = exports.NO_SUBNET_SET = exports.MS_PER_DAY = exports.TIME_ZERO = exports.EVENT_SEVERITIES = exports.getAssistedUiLibVersion = exports.CLUSTER_DEFAULT_NETWORK_SETTINGS = exports.CLUSTER_DEFAULT_NETWORK_SETTINGS_IPV6 = exports.CLUSTER_DEFAULT_NETWORK_SETTINGS_IPV4 = exports.clusterValidationGroupLabels = exports.clusterValidationLabels = exports.hostValidationFailureHints = exports.hostValidationLabels = exports.hostValidationGroupLabels = exports.clusterFieldLabels = exports.clusterStatusLabels = exports.hostRoles = exports.REDUCED_POLLING_INTERVAL = exports.DEFAULT_POLLING_INTERVAL = void 0;
exports.AI_CISCO_INTERSIGHT_TAG = exports.AI_ASSISTED_MIGRATION_TAG = exports.AI_UI_TAG = exports.singleClusterBundles = exports.singleClusterOperators = void 0;
const tslib_1 = require("tslib");
const package_json_1 = tslib_1.__importDefault(require("@openshift-assisted/ui-lib/package.json"));
exports.DEFAULT_POLLING_INTERVAL = 10 * 1000;
exports.REDUCED_POLLING_INTERVAL = 10 * 1000 * 6;
const hostRoles = (t) => [
    {
        value: 'auto-assign',
        label: t('ai:Auto-assign'),
        description: t('ai:A role will be chosen automatically based on detected hardware and network latency.'),
    },
    {
        value: 'master',
        label: t('ai:Control plane node'),
        description: t('ai:Runs the control plane components of OpenShift, including the API server.'),
    },
    {
        value: 'worker',
        label: t('ai:Worker', { count: 1 }),
        description: t('ai:Runs application workloads. Connect at least 5 hosts to enable dedicated workers.'),
    },
    {
        value: 'arbiter',
        label: t('ai:Arbiter'),
        description: t('ai:Prevents split-brain scenarios and maintains quorum.'),
    },
];
exports.hostRoles = hostRoles;
const clusterStatusLabels = (t) => ({
    'pending-for-input': t('ai:Draft'),
    insufficient: t('ai:Draft'),
    ready: t('ai:Draft'),
    'preparing-for-installation': t('ai:Preparing for installation'),
    installing: t('ai:Installing'),
    'installing-pending-user-action': t('ai:Installing (pending action)'),
    finalizing: t('ai:Finalizing'),
    cancelled: t('ai:Installation cancelled'),
    error: t('ai:Error'),
    installed: t('ai:Installed'),
    'adding-hosts': t('ai:Adding hosts'),
    unmonitored: t('ai:Unmonitored'),
});
exports.clusterStatusLabels = clusterStatusLabels;
const clusterFieldLabels = (t) => ({
    name: t('ai:Cluster name'),
    baseDnsDomain: t('ai:Base domain'),
    clusterNetworkCidr: t('ai:Cluster network CIDR'),
    clusterNetworkHostPrefix: t('ai:Cluster network host prefix'),
    serviceNetworkCidr: t('ai:Service network CIDR'),
    apiVips: t('ai:API IP'),
    ingressVips: t('ai:Ingress IP'),
    pullSecret: t('ai:Pull secret'),
    sshPublicKey: t('ai:SSH public key'),
    diskEncryptionTangServers: t("ai:Tang servers' URLs or thumbprints"),
    selectedHostIds: t('ai:Hosts selection'),
    httpProxy: t('ai:HTTP proxy'),
    httpsProxy: t('ai:HTTPS proxy'),
    noProxy: t('ai:No proxy'),
    additionalNtpSources: t('ai:Additional NTP sources'),
    machineNetworks: t('ai:Machine networks'),
    clusterNetworks: t('ai:Cluster networks'),
    serviceNetworks: t('ai:Service networks'),
});
exports.clusterFieldLabels = clusterFieldLabels;
const hostValidationGroupLabels = (t) => ({
    hardware: t('ai:Hardware'),
    network: t('ai:Network'),
    operators: t('ai:Operators'),
    infrastructure: t('ai:Infrastructure'),
});
exports.hostValidationGroupLabels = hostValidationGroupLabels;
const hostValidationLabels = (t) => ({
    'compatible-with-cluster-platform': t('ai:Compatible with cluster platform'),
    'has-default-route': t('ai:Default route to host'),
    'sufficient-network-latency-requirement-for-role': t('ai:Network latency'),
    'sufficient-packet-loss-requirement-for-role': t('ai:Packet loss'),
    'has-inventory': t('ai:Hardware information'),
    'has-min-cpu-cores': t('ai:Minimum CPU cores'),
    'has-min-memory': t('ai:Minimum Memory'),
    'has-min-valid-disks': t('ai:Minimum disks of required size'),
    'has-cpu-cores-for-role': t('ai:Minimum CPU cores for selected role'),
    'has-memory-for-role': t('ai:Minimum memory for selected role'),
    'hostname-unique': t('ai:Unique hostname'),
    'hostname-valid': t('ai:Valid hostname'),
    connected: t('ai:Connected'),
    'media-connected': t('ai:Media Connected'),
    'machine-cidr-defined': t('ai:Machine CIDR'),
    'belongs-to-machine-cidr': t('ai:Belongs to machine CIDR'),
    'ignition-downloadable': t('ai:Ignition file downloadable'),
    'belongs-to-majority-group': t('ai:Belongs to majority connected group'),
    'valid-platform-network-settings': t('ai:Platform network settings'),
    'ntp-synced': t('ai:NTP synchronization'),
    'container-images-available': t('ai:Container images availability'),
    'lso-requirements-satisfied': t('ai:LSO requirements'),
    'ocs-requirements-satisfied': t('ai:OCS requirements'),
    'odf-requirements-satisfied': t('ai:ODF requirements'),
    'lvm-requirements-satisfied': t('ai:Logical Volume Manager requirements'),
    'cnv-requirements-satisfied': t('ai:CNV requirements'),
    'disk-encryption-requirements-satisfied': t('ai:Disk encryption requirements'),
    'sufficient-installation-disk-speed': t('ai:Installation disk speed'),
    'api-domain-name-resolved-correctly': t('ai:API domain name resolution'),
    'api-int-domain-name-resolved-correctly': t('ai:API internal domain name resolution'),
    'apps-domain-name-resolved-correctly': t('ai:Application ingress domain name resolution'),
    'release-domain-name-resolved-correctly': t('ai:Release domain resolution'),
    'dns-wildcard-not-configured': t('ai:DNS wildcard not configured'),
    'non-overlapping-subnets': t('ai:Non overlapping subnets'),
    'vsphere-disk-uuid-enabled': t('ai:Vsphere disk uuid enabled'),
    'compatible-agent': t('ai:Agent compatibility'),
    'no-skip-installation-disk': t('ai:No skip installation disk'),
    'no-skip-missing-disk': t('ai:No skip missing disk'),
    'time-synced-between-host-and-service': t('ai:Time synced between host and service'),
    'no-ip-collisions-in-network': t('ai:No IP collisions in network'),
    'mce-requirements-satisfied': t('ai:Multicluster engine requirements'),
    'mtv-requirements-satisfied': t('ai:Migration toolkit for virtualization requirements'),
    'no-iscsi-nic-belongs-to-machine-cidr': t('ai:iSCSI NIC belongs to machine CIDR'),
    'node-feature-discovery-requirements-satisfied': t('ai:Node Feature Discovery requirements'),
    'nvidia-gpu-requirements-satisfied': t('ai:NVIDIA GPU requirements'),
    'pipelines-requirements-satisfied': t('ai:Pipelines requirements'),
    'serverless-requirements-satisfied': t('ai:Serverless requirements'),
    'servicemesh-requirements-satisfied': t('ai:Service Mesh requirements'),
    'openshift-ai-requirements-satisfied': t('ai:OpenShift AI requirements'),
    'osc-requirements-satisfied': t('ai:OpenShift sandboxed containers requirements'),
    'mtu-valid': t('ai:MTU requirements'),
    'authorino-requirements-satisfied': '',
    'nmstate-requirements-satisfied': '',
    'amd-gpu-requirements-satisfied': t('ai:AMD GPU requirements'),
    'kmm-requirements-satisfied': t('ai:Kernel Module Management requirements'),
    'node-healthcheck-requirements-satisfied': t('ai:Node Healthcheck requirements'),
    'self-node-remediation-requirements-satisfied': t('ai:Self Node Remediation requirements'),
    'fence-agents-remediation-requirements-satisfied': t('ai:Fence Agents Remediation requirements'),
    'node-maintenance-requirements-satisfied': t('ai:Node Maintenance requirements'),
    'kube-descheduler-requirements-satisfied': t('ai:Kube Descheduler requirements'),
    'cluster-observability-requirements-satisfied': t('ai:Cluster Observability requirements'),
    'loki-requirements-satisfied': t('ai:Loki Operator requirements'),
    'openshift-logging-requirements-satisfied': t('ai:OpenShift Logging Operator requirements'),
    'numa-resources-requirements-satisfied': t('ai:NUMA Resources requirements'),
    'oadp-requirements-satisfied': t('ai:OADP requirements'),
    'metallb-requirements-satisfied': t('ai:MetalLB requirements'),
});
exports.hostValidationLabels = hostValidationLabels;
const hostValidationFailureHints = (t) => ({
    'compatible-with-cluster-platform': '',
    'has-default-route': '',
    'sufficient-network-latency-requirement-for-role': '',
    'sufficient-packet-loss-requirement-for-role': '',
    'has-inventory': '',
    'has-min-cpu-cores': '',
    'has-min-memory': '',
    'has-min-valid-disks': '',
    'has-cpu-cores-for-role': '',
    'has-memory-for-role': '',
    'hostname-unique': '',
    'hostname-valid': '',
    connected: '',
    'media-connected': '',
    'machine-cidr-defined': '',
    'belongs-to-machine-cidr': '',
    'ignition-downloadable': '',
    'belongs-to-majority-group': '',
    'valid-platform-network-settings': '',
    'ntp-synced': t("ai:Manually fix the host's NTP configuration or provide additional NTP sources."),
    'time-synced-between-host-and-service': '',
    'container-images-available': '',
    'lso-requirements-satisfied': '',
    'ocs-requirements-satisfied': '',
    'odf-requirements-satisfied': '',
    'lvm-requirements-satisfied': '',
    'cnv-requirements-satisfied': '',
    'disk-encryption-requirements-satisfied': '',
    'sufficient-installation-disk-speed': '',
    'api-domain-name-resolved-correctly': '',
    'api-int-domain-name-resolved-correctly': '',
    'apps-domain-name-resolved-correctly': '',
    'release-domain-name-resolved-correctly': '',
    'dns-wildcard-not-configured': '',
    'non-overlapping-subnets': '',
    'vsphere-disk-uuid-enabled': '',
    'compatible-agent': '',
    'no-skip-installation-disk': '',
    'no-skip-missing-disk': '',
    'no-ip-collisions-in-network': '',
    'mce-requirements-satisfied': '',
    'mtv-requirements-satisfied': '',
    'no-iscsi-nic-belongs-to-machine-cidr': '',
    'node-feature-discovery-requirements-satisfied': '',
    'nvidia-gpu-requirements-satisfied': '',
    'pipelines-requirements-satisfied': '',
    'serverless-requirements-satisfied': '',
    'servicemesh-requirements-satisfied': '',
    'openshift-ai-requirements-satisfied': '',
    'osc-requirements-satisfied': '',
    'authorino-requirements-satisfied': '',
    'mtu-valid': '',
    'nmstate-requirements-satisfied': '',
    'amd-gpu-requirements-satisfied': '',
    'kmm-requirements-satisfied': '',
    'node-healthcheck-requirements-satisfied': '',
    'self-node-remediation-requirements-satisfied': '',
    'fence-agents-remediation-requirements-satisfied': '',
    'node-maintenance-requirements-satisfied': '',
    'kube-descheduler-requirements-satisfied': '',
    'cluster-observability-requirements-satisfied': '',
    'loki-requirements-satisfied': '',
    'openshift-logging-requirements-satisfied': '',
    'numa-resources-requirements-satisfied': '',
    'oadp-requirements-satisfied': '',
    'metallb-requirements-satisfied': '',
});
exports.hostValidationFailureHints = hostValidationFailureHints;
const clusterValidationLabels = (t) => ({
    'network-type-valid': t('ai:Valid network type'),
    'machine-cidr-defined': t('ai:Machine CIDR'),
    'cluster-cidr-defined': t('ai:Cluster CIDR'),
    'service-cidr-defined': t('ai:Service CIDR'),
    'no-cidrs-overlapping': t('ai:No overlapping CIDR'),
    'networks-same-address-families': t('ai:Networks same address families'),
    'network-prefix-valid': t('ai:Valid network prefix'),
    'machine-cidr-equals-to-calculated-cidr': t('ai:Machine CIDR conforms expected'),
    'api-vips-defined': t('ai:API IP'),
    'api-vips-valid': t('ai:API IP validity'),
    'ingress-vips-defined': t('ai:Ingress IP'),
    'ingress-vips-valid': t('ai:Ingress IP validity'),
    'all-hosts-are-ready-to-install': t('ai:All hosts are ready to install'),
    'sufficient-masters-count': t('ai:Control plane nodes count'),
    'dns-domain-defined': t('ai:DNS domain'),
    'pull-secret-set': t('ai:Pull secret'),
    'ntp-server-configured': t('ai:NTP server'),
    'lso-requirements-satisfied': t('ai:LSO requirements'),
    'ocs-requirements-satisfied': t('ai:OCS requirements'),
    'odf-requirements-satisfied': t('ai:ODF requirements'),
    'lvm-requirements-satisfied': t('ai:Logical Volume Manager requirements'),
    'cnv-requirements-satisfied': t('ai:CNV requirements'),
    'mce-requirements-satisfied': t('ai:MCE requirements'),
    'openshift-ai-gpu-requirements-satisfied': t('ai:OpenShift AI GPU requirements'),
    'platform-requirements-satisfied': t('ai:Platform requirements'),
    'cluster-observability-requirements-satisfied': t('ai:Cluster Observability requirements'),
    'loki-requirements-satisfied': t('ai:Loki Operator requirements'),
    'openshift-logging-requirements-satisfied': t('ai:OpenShift Logging Operator requirements'),
    'numa-resources-requirements-satisfied': t('ai:NUMA Resources requirements'),
    'oadp-requirements-satisfied': t('ai:OADP requirements'),
    'metallb-requirements-satisfied': t('ai:MetalLB requirements'),
});
exports.clusterValidationLabels = clusterValidationLabels;
const clusterValidationGroupLabels = (t) => ({
    configuration: t('ai:General configuration'),
    hostsData: t('ai:Hosts'),
    'hosts-data': t('ai:Hosts'),
    network: t('ai:Networking'),
    operators: t('ai:Operators'),
});
exports.clusterValidationGroupLabels = clusterValidationGroupLabels;
exports.CLUSTER_DEFAULT_NETWORK_SETTINGS_IPV4 = {
    clusterNetworkCidr: '10.128.0.0/14',
    clusterNetworkHostPrefix: 23,
    serviceNetworkCidr: '172.30.0.0/16',
};
exports.CLUSTER_DEFAULT_NETWORK_SETTINGS_IPV6 = {
    clusterNetworkCidr: 'fd01::/48',
    clusterNetworkHostPrefix: 64,
    serviceNetworkCidr: 'fd02::/112',
};
exports.CLUSTER_DEFAULT_NETWORK_SETTINGS = {
    clusterNetworksIpv4: [
        {
            cidr: exports.CLUSTER_DEFAULT_NETWORK_SETTINGS_IPV4.clusterNetworkCidr,
            hostPrefix: exports.CLUSTER_DEFAULT_NETWORK_SETTINGS_IPV4.clusterNetworkHostPrefix,
        },
    ],
    clusterNetworksIpv6: [
        {
            cidr: exports.CLUSTER_DEFAULT_NETWORK_SETTINGS_IPV6.clusterNetworkCidr,
            hostPrefix: exports.CLUSTER_DEFAULT_NETWORK_SETTINGS_IPV6.clusterNetworkHostPrefix,
        },
    ],
    clusterNetworksDualstack: [
        {
            cidr: exports.CLUSTER_DEFAULT_NETWORK_SETTINGS_IPV4.clusterNetworkCidr,
            hostPrefix: exports.CLUSTER_DEFAULT_NETWORK_SETTINGS_IPV4.clusterNetworkHostPrefix,
        },
        {
            cidr: exports.CLUSTER_DEFAULT_NETWORK_SETTINGS_IPV6.clusterNetworkCidr,
            hostPrefix: exports.CLUSTER_DEFAULT_NETWORK_SETTINGS_IPV6.clusterNetworkHostPrefix,
        },
    ],
    serviceNetworksIpv4: [{ cidr: exports.CLUSTER_DEFAULT_NETWORK_SETTINGS_IPV4.serviceNetworkCidr }],
    serviceNetworksIpv6: [{ cidr: exports.CLUSTER_DEFAULT_NETWORK_SETTINGS_IPV6.serviceNetworkCidr }],
    serviceNetworksDualstack: [
        { cidr: exports.CLUSTER_DEFAULT_NETWORK_SETTINGS_IPV4.serviceNetworkCidr },
        { cidr: exports.CLUSTER_DEFAULT_NETWORK_SETTINGS_IPV6.serviceNetworkCidr },
    ],
};
/**
 * The function returns the build-time generated version.
 * It can be overriden via the AIUI_APP_VERSION environment variable.
 */
const getAssistedUiLibVersion = () => {
    // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-return
    return process.env.AIUI_APP_VERSION || package_json_1.default.version;
};
exports.getAssistedUiLibVersion = getAssistedUiLibVersion;
exports.EVENT_SEVERITIES = ['info', 'warning', 'error', 'critical'];
exports.TIME_ZERO = '0001-01-01T00:00:00.000Z';
exports.MS_PER_DAY = 1000 * 60 * 60 * 24;
exports.NO_SUBNET_SET = 'NO_SUBNET_SET';
exports.SINGLE_STACK = 'singleStack';
exports.DUAL_STACK = 'dualStack';
exports.PREFIX_MAX_RESTRICTION = {
    IPv6: 128,
    IPv4: 25,
};
const diskRoleLabels = (t) => ({
    none: t('ai:None'),
    install: t('ai:Installation disk'),
});
exports.diskRoleLabels = diskRoleLabels;
// The API uses free-form string for operator names, so let's guard at least using constants
exports.OPERATOR_NAME_CNV = 'cnv';
exports.OPERATOR_NAME_LSO = 'lso';
exports.OPERATOR_NAME_ODF = 'odf';
exports.OPERATOR_NAME_LVM = 'lvm';
exports.OPERATOR_NAME_MCE = 'mce';
exports.OPERATOR_NAME_MTV = 'mtv';
exports.OPERATOR_NAME_NODE_FEATURE_DISCOVERY = 'node-feature-discovery';
exports.OPERATOR_NAME_NVIDIA_GPU = 'nvidia-gpu';
exports.OPERATOR_NAME_PIPELINES = 'pipelines';
exports.OPERATOR_NAME_SERVICEMESH = 'servicemesh';
exports.OPERATOR_NAME_SERVERLESS = 'serverless';
exports.OPERATOR_NAME_OPENSHIFT_AI = 'openshift-ai';
exports.OPERATOR_NAME_OSC = 'osc';
exports.OPERATOR_NAME_NMSTATE = 'nmstate';
exports.OPERATOR_NAME_AUTHORINO = 'authorino';
exports.OPERATOR_NAME_AMD_GPU = 'amd-gpu';
exports.OPERATOR_NAME_KMM = 'kmm';
exports.OPERATOR_NAME_NODE_HEALTHCHECK = 'node-healthcheck';
exports.OPERATOR_NAME_SELF_NODE_REMEDIATION = 'self-node-remediation';
exports.OPERATOR_NAME_FENCE_AGENTS_REMEDIATION = 'fence-agents-remediation';
exports.OPERATOR_NAME_NODE_MAINTENANCE = 'node-maintenance';
exports.OPERATOR_NAME_KUBE_DESCHEDULER = 'kube-descheduler';
exports.OPERATOR_NAME_CLUSTER_OBSERVABILITY = 'cluster-observability';
exports.OPERATOR_NAME_LOKI = 'loki';
exports.OPERATOR_NAME_OPENSHIFT_LOGGING = 'openshift-logging';
exports.OPERATOR_NAME_NUMA_RESOURCES = 'numaresources';
exports.OPERATOR_NAME_OADP = 'oadp';
exports.OPERATOR_NAME_METALLB = 'metallb';
exports.singleClusterOperators = [
    exports.OPERATOR_NAME_CNV,
    exports.OPERATOR_NAME_MTV,
    exports.OPERATOR_NAME_NMSTATE,
    exports.OPERATOR_NAME_NODE_HEALTHCHECK,
    exports.OPERATOR_NAME_NODE_MAINTENANCE,
    exports.OPERATOR_NAME_FENCE_AGENTS_REMEDIATION,
    exports.OPERATOR_NAME_KUBE_DESCHEDULER,
    exports.OPERATOR_NAME_METALLB,
    exports.OPERATOR_NAME_CLUSTER_OBSERVABILITY,
    exports.OPERATOR_NAME_OADP,
    exports.OPERATOR_NAME_LSO,
    exports.OPERATOR_NAME_NUMA_RESOURCES,
    exports.OPERATOR_NAME_LOKI,
    exports.OPERATOR_NAME_OPENSHIFT_LOGGING,
];
exports.singleClusterBundles = ['virtualization'];
exports.AI_UI_TAG = 'ui_ocm';
exports.AI_ASSISTED_MIGRATION_TAG = 'assisted_migration';
exports.AI_CISCO_INTERSIGHT_TAG = 'cisco_intersight_ui';
//# sourceMappingURL=constants.js.map