import { gettext } from '@c8y/ngx-components/gettext';
import { DynamicComponentErrorStrategy, DynamicManagedObjectResolver, hookWidget } from '@c8y/ngx-components';
import { hookWidgetConfig } from '@c8y/ngx-components/context-dashboard';
import { PRESET_NAME } from '@c8y/ngx-components/global-context';
import { defaultWidgetIds } from '@c8y/ngx-components/widgets/definitions';
import { importConfigWithDevice, exportConfigWithDevice } from '@c8y/ngx-components/widgets/import-export-config';

const criticalAlarmsWidgetDefinition = {
    id: defaultWidgetIds.ALL_CRITICAL_ALARMS,
    label: gettext('All critical alarms'),
    description: gettext(`Display all critical alarms from all devices`),
    loadComponent: () => import('@c8y/ngx-components/widgets/implementations/alarms').then(m => m.AlarmListWidgetComponent),
    loadConfigComponent: () => import('@c8y/ngx-components/widgets/implementations/alarms').then(m => m.AlarmListWidgetConfigComponent),
    resolve: {
        device: DynamicManagedObjectResolver
    },
    errorStrategy: DynamicComponentErrorStrategy.OVERLAY_ERROR,
    data: {
        schema: () => import('c8y-schema-loader?interfaceName=AlarmListWidgetConfig&type=widget-config!@c8y/ngx-components/widgets/implementations/alarms'),
        export: exportConfigWithDevice,
        import: importConfigWithDevice,
        settings: {
            criticalAlarmsWidget: true,
            noNewWidgets: true,
            widgetDefaults: {
                _width: 4,
                _height: 4
            },
            ng1: {
                options: {
                    noDeviceTarget: false,
                    groupsSelectable: true,
                    deviceTargetNotRequired: true
                }
            }
        },
        displaySettings: {
            globalAutoRefreshContext: true
        }
    }
};
const criticalAlarmsWidgetProviders = [
    hookWidget(criticalAlarmsWidgetDefinition),
    hookWidgetConfig({
        widgetId: defaultWidgetIds.ALL_CRITICAL_ALARMS,
        priority: 10,
        label: gettext('Time context'),
        initialState: {
            controls: PRESET_NAME.LIFETIME_LIST_CONFIG
        },
        loadComponent: () => import('@c8y/ngx-components/context-dashboard').then(m => m.GlobalContextSectionComponent)
    })
];

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

export { criticalAlarmsWidgetDefinition, criticalAlarmsWidgetProviders };
//# sourceMappingURL=c8y-ngx-components-widgets-definitions-alarms-all-critical-alarms.mjs.map
