import * as i0 from '@angular/core';
import { NgModule } from '@angular/core';
import { hookWidget } from '@c8y/ngx-components';

/**
 * Module with providers for the given widgets.
 * Does not include any widgets by default.
 * Import this modules by using the `WidgetsModule.config` method.
 */
class WidgetsModule {
    static config(config) {
        return {
            ngModule: WidgetsModule,
            providers: this.providers(config)
        };
    }
    static providers(config) {
        const filteredWidgets = this.excludeById(config.widgets, config.excludeList || []);
        return [hookWidget(filteredWidgets)];
    }
    static excludeById(widgetDefinitions, excludeList) {
        return widgetDefinitions.filter(widgetDefinition => !excludeList.includes(widgetDefinition.id));
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: WidgetsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: WidgetsModule }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: WidgetsModule }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: WidgetsModule, decorators: [{
            type: NgModule
        }] });

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

export { WidgetsModule };
//# sourceMappingURL=c8y-ngx-components-widgets.mjs.map
