import { defaultWidgetIds } from '@c8y/ngx-components/widgets/definitions';
import { alarmListWidgetProviders } from '@c8y/ngx-components/widgets/definitions/alarms/alarm-list';
import { criticalAlarmsWidgetProviders } from '@c8y/ngx-components/widgets/definitions/alarms/all-critical-alarms';
import { recentAlarmsWidgetProviders } from '@c8y/ngx-components/widgets/definitions/alarms/recent-alarms';
import { dataPointsTableWidgetProviders } from '@c8y/ngx-components/widgets/definitions/datapoints-table';
import { datapointGraphWidgetproviders } from '@c8y/ngx-components/widgets/definitions/datapoints-graph';
import { infoGaugeWidgetProviders } from '@c8y/ngx-components/widgets/definitions/info-gauge';
import { kpiWidgetProviders } from '@c8y/ngx-components/widgets/definitions/kpi';
import { linearGaugeWidgetProviders } from '@c8y/ngx-components/widgets/definitions/linear-gauge';
import { mapWidgetProviders } from '@c8y/ngx-components/widgets/definitions/map';
import { radialGaugeWidgetProviders } from '@c8y/ngx-components/widgets/definitions/radial-gauge';
import { deviceControlMessageWidgetProviders } from '@c8y/ngx-components/widgets/definitions/device-control-message';
import { imageWidgetProviders } from '@c8y/ngx-components/widgets/definitions/image';
import { markdownWidgetProviders } from '@c8y/ngx-components/widgets/definitions/markdown';
import { htmlWidgetProviders } from '@c8y/ngx-components/widgets/definitions/html-widget';
import { helpAndServiceWidgetProviders } from '@c8y/ngx-components/widgets/definitions/help-and-service';
import { threeDRotationWidgetProviders } from '@c8y/ngx-components/widgets/definitions/three-d-rotation';
import { siloWidgetProviders } from '@c8y/ngx-components/widgets/definitions/silo';
import { applicationsWidgetProviders } from '@c8y/ngx-components/widgets/definitions/applications';
import { quickLinksWidgetProviders } from '@c8y/ngx-components/widgets/definitions/quick-links';
import { cockpitWelcomeWidgetProviders } from '@c8y/ngx-components/widgets/definitions/cockpit-welcome';
import { legacyCockpitWelcomeWidgetProviders } from '@c8y/ngx-components/widgets/definitions/cockpit-legacy-welcome';
import { deviceManagementWelcomeWidgetProviders } from '@c8y/ngx-components/widgets/definitions/device-management-welcome';
import { assetNotesWidgetProviders } from '@c8y/ngx-components/widgets/definitions/asset-notes';
import { eventListWidgetProviders } from '@c8y/ngx-components/widgets/definitions/event-list';
import { pieChartWidgetProviders } from '@c8y/ngx-components/widgets/definitions/pie-chart';

/**
 * Map of widget IDs to their respective providers
 * This includes both widget definitions and configuration hooks
 */
const WIDGET_PROVIDERS_MAP = {
    [defaultWidgetIds.ALARM_LIST]: alarmListWidgetProviders,
    [defaultWidgetIds.ALL_CRITICAL_ALARMS]: criticalAlarmsWidgetProviders,
    [defaultWidgetIds.RECENT_ALARMS]: recentAlarmsWidgetProviders,
    [defaultWidgetIds.DATA_POINTS_TABLE]: dataPointsTableWidgetProviders,
    [defaultWidgetIds.DATAPOINTS_GRAPH]: datapointGraphWidgetproviders,
    [defaultWidgetIds.DATAPOINTS_GRAPH_NEW]: datapointGraphWidgetproviders,
    [defaultWidgetIds.KPI]: kpiWidgetProviders,
    [defaultWidgetIds.INFO_GAUGE]: infoGaugeWidgetProviders,
    [defaultWidgetIds.LINEAR_GAUGE]: linearGaugeWidgetProviders,
    [defaultWidgetIds.RADIAL_GAUGE]: radialGaugeWidgetProviders,
    [defaultWidgetIds.MAP]: mapWidgetProviders,
    [defaultWidgetIds.DEVICE_CONTROL_MESSAGE_WIDGET]: deviceControlMessageWidgetProviders,
    [defaultWidgetIds.THREE_D_ROTATION]: threeDRotationWidgetProviders,
    [defaultWidgetIds.SILO]: siloWidgetProviders,
    [defaultWidgetIds.APPLICATIONS]: applicationsWidgetProviders,
    [defaultWidgetIds.QUICK_LINKS]: quickLinksWidgetProviders,
    [defaultWidgetIds.HELP_AND_SERVICE]: helpAndServiceWidgetProviders,
    [defaultWidgetIds.IMAGE]: imageWidgetProviders,
    [defaultWidgetIds.MARKDOWN]: markdownWidgetProviders,
    [defaultWidgetIds.HTML]: htmlWidgetProviders,
    [defaultWidgetIds.COCKPIT_WELCOME]: cockpitWelcomeWidgetProviders,
    [defaultWidgetIds.LEGACY_COCKPIT_WELCOME]: legacyCockpitWelcomeWidgetProviders,
    [defaultWidgetIds.DEVICE_MANAGEMENT_WELCOME]: deviceManagementWelcomeWidgetProviders,
    [defaultWidgetIds.ASSET_NOTES]: assetNotesWidgetProviders,
    [defaultWidgetIds.EVENT_LIST]: eventListWidgetProviders,
    [defaultWidgetIds.PIE_CHART]: pieChartWidgetProviders
};
/**
 * Default widgets that are typically useful
 * These are the widgets that will be loaded unless explicitly excluded
 */
const DEFAULT_WIDGETS = [
    defaultWidgetIds.ALARM_LIST,
    defaultWidgetIds.ALL_CRITICAL_ALARMS,
    defaultWidgetIds.RECENT_ALARMS,
    defaultWidgetIds.DATA_POINTS_TABLE,
    defaultWidgetIds.DATAPOINTS_GRAPH,
    defaultWidgetIds.DATAPOINTS_GRAPH_NEW,
    defaultWidgetIds.KPI,
    defaultWidgetIds.INFO_GAUGE,
    defaultWidgetIds.LINEAR_GAUGE,
    defaultWidgetIds.RADIAL_GAUGE,
    defaultWidgetIds.MAP,
    defaultWidgetIds.DEVICE_CONTROL_MESSAGE_WIDGET,
    defaultWidgetIds.THREE_D_ROTATION,
    defaultWidgetIds.SILO,
    defaultWidgetIds.APPLICATIONS,
    defaultWidgetIds.QUICK_LINKS,
    defaultWidgetIds.HELP_AND_SERVICE,
    defaultWidgetIds.IMAGE,
    defaultWidgetIds.MARKDOWN,
    defaultWidgetIds.HTML,
    defaultWidgetIds.COCKPIT_WELCOME,
    defaultWidgetIds.LEGACY_COCKPIT_WELCOME,
    defaultWidgetIds.DEVICE_MANAGEMENT_WELCOME,
    defaultWidgetIds.ASSET_NOTES,
    defaultWidgetIds.EVENT_LIST,
    defaultWidgetIds.PIE_CHART
];
/**
 * Configures and returns widget providers.
 *
 * This function allows selective loading of widget providers with their configuration hooks.
 * Unlike `cockpitWidgets()` which only provides widget definitions, this includes
 * the full providers with `hookWidgetConfig` registrations for features like widget preview.
 *
 * @param config Configuration options for widget providers
 * @returns Array of providers to be included in app.module.ts
 *
 * @example
 * ```typescript
 * // In app.module.ts
 * providers: [
 *   ...configureWidgetProviders({
 *     exclude: [defaultWidgetIds.HTML, defaultWidgetIds.MARKDOWN]
 *   }),
 *   // other providers
 * ]
 * ```
 *
 * @example
 * ```typescript
 * // Load all default widgets
 * providers: [
 *   ...configureWidgetProviders(),
 *   // other providers
 * ]
 * ```
 */
function configureWidgetProviders(config = {}) {
    const { exclude = [] } = config;
    const excludeSet = new Set(exclude);
    return DEFAULT_WIDGETS.filter(widgetId => !excludeSet.has(widgetId)).flatMap(widgetId => {
        const providers = WIDGET_PROVIDERS_MAP[widgetId];
        if (!providers) {
            console.warn(`Widget providers not found for widget ID: ${widgetId}`);
            return [];
        }
        return providers;
    });
}

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

export { DEFAULT_WIDGETS, configureWidgetProviders };
//# sourceMappingURL=c8y-ngx-components-widgets-widget-providers.mjs.map
