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 alarmListWidgetDefinition = {
    id: defaultWidgetIds.ALARM_LIST,
    label: gettext('Alarm list'),
    description: gettext(`Displays a list of alarms filtered by object, severity, status and date`),
    loadComponent: () => import('@c8y/ngx-components/widgets/implementations/alarms').then(m => m.AlarmListWidgetComponent),
    loadConfigComponent: () => import('@c8y/ngx-components/widgets/implementations/alarms').then(m => m.AlarmListWidgetConfigComponent),
    previewImage: 'c8y-style-assets/alarms/alarm-list-widget.png',
    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: {
            alarmListWidget: true,
            noNewWidgets: false,
            widgetDefaults: {
                _width: 8,
                _height: 4
            },
            ng1: {
                options: {
                    noDeviceTarget: false,
                    groupsSelectable: true,
                    deviceTargetNotRequired: true
                }
            }
        },
        controls: PRESET_NAME.ALARM_LIST_CONFIG,
        displaySettings: {
            globalTimeContext: true,
            globalAutoRefreshContext: true
        }
    }
};
const alarmListWidgetProviders = [
    hookWidget(alarmListWidgetDefinition),
    hookWidgetConfig({
        widgetId: defaultWidgetIds.ALARM_LIST,
        priority: 10,
        label: gettext('Time context'),
        initialState: {
            controls: PRESET_NAME.ALARM_LIST_CONFIG
        },
        loadComponent: () => import('@c8y/ngx-components/context-dashboard').then(m => m.GlobalContextSectionComponent)
    })
];

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

export { alarmListWidgetDefinition, alarmListWidgetProviders };
//# sourceMappingURL=c8y-ngx-components-widgets-definitions-alarms-alarm-list.mjs.map
