import { gettext } from '@c8y/ngx-components/gettext';
import { NavigatorNode, ViewContext, hookNavigator } from '@c8y/ngx-components';
import { AlarmsGuard, ALARMS_PATH, AlarmsModule, getChildrenForViewContext, AlarmsComponent, getViewContextRoutes } from '@c8y/ngx-components/alarms';
import * as i0 from '@angular/core';
import { inject, Injectable } from '@angular/core';

class DeviceManagementAlarmsNavigationFactory {
    constructor() {
        this.guard = inject(AlarmsGuard);
        this.navs = [];
    }
    async get() {
        const canActivate = this.guard.canActivate();
        if (canActivate && this.navs.length === 0) {
            this.navs.push(new NavigatorNode({
                label: gettext('Alarms'),
                icon: 'bell',
                path: `/${ALARMS_PATH}`,
                featureId: 'alarms',
                parent: 'Overviews',
                routerLinkExact: false,
                priority: 3000
            }));
        }
        return this.navs;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: DeviceManagementAlarmsNavigationFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
    static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: DeviceManagementAlarmsNavigationFactory }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: DeviceManagementAlarmsNavigationFactory, decorators: [{
            type: Injectable
        }] });

function alarmsDeviceManagementRouteAndNodeConfig() {
    return AlarmsModule.config({
        additionalProviders: [hookNavigator(DeviceManagementAlarmsNavigationFactory)],
        route: [
            {
                path: ALARMS_PATH,
                component: AlarmsComponent,
                canActivate: [AlarmsGuard],
                data: { title: true },
                children: getChildrenForViewContext(ViewContext.Alarms)
            },
            {
                context: ViewContext.Group,
                path: ALARMS_PATH,
                priority: 800,
                icon: 'bell',
                label: gettext('Alarms'),
                component: AlarmsComponent,
                canActivate: [AlarmsGuard],
                featureId: 'alarms',
                children: getChildrenForViewContext(ViewContext.GroupAlarms)
            },
            {
                context: ViewContext.Device,
                path: ALARMS_PATH,
                priority: 800,
                icon: 'bell',
                label: gettext('Alarms'),
                component: AlarmsComponent,
                canActivate: [AlarmsGuard],
                featureId: 'alarms',
                children: getChildrenForViewContext(ViewContext.DeviceAlarms)
            },
            {
                context: ViewContext.Service,
                path: ALARMS_PATH,
                priority: 800,
                icon: 'bell',
                label: gettext('Alarms'),
                component: AlarmsComponent,
                canActivate: [AlarmsGuard],
                featureId: 'alarms',
                children: getChildrenForViewContext(ViewContext.ServiceAlarms)
            },
            {
                context: ViewContext.Simulators,
                path: ALARMS_PATH,
                priority: -2,
                icon: 'bell',
                label: gettext('Alarms'),
                component: AlarmsComponent,
                canActivate: [AlarmsGuard],
                featureId: 'alarms',
                children: getChildrenForViewContext(ViewContext.SimulatorsAlarms)
            },
            ...getViewContextRoutes([
                ViewContext.Alarms,
                ViewContext.GroupAlarms,
                ViewContext.DeviceAlarms,
                ViewContext.ServiceAlarms,
                ViewContext.SimulatorsAlarms
            ])
        ]
    });
}

/**
 * Generated bundle index. Do not edit.
 */

export { alarmsDeviceManagementRouteAndNodeConfig };
//# sourceMappingURL=c8y-ngx-components-alarms-devicemanagement.mjs.map
