import { NgModule } from '@angular/core';
import { DirtyGuard, XdfGalleryModule, EditableDataTableTemplateResolver } from '@xdf/gallery';
import { DashboardsRoutingModule } from './dashboards-routing.module';
import { TranslateModule } from '@ngx-translate/core';
import { ReactiveFormsModule, FormsModule } from '@angular/forms';
import { CommonModule } from '@angular/common';
import { MatFormFieldModule, MatSelectModule, MatTooltipModule, MatButtonModule } from '@angular/material';
import { XdfSettingsModule } from '@xdf/settings';
import { XdfLayoutsModule } from '@xdf/layouts';
import { OperativeDashboardComponent } from './components/operative-dashboard/operative-dashboard.component';
import { SummaryPetiWidgetComponent } from './components/summary-peti-widget/summary-peti-widget.component';
import { CustomerActivityWidgetComponent } from './components/customer-activity-widget/customer-activity-widget.component';
import { ChartsModule } from 'ng2-charts';
import { NgxChartsModule } from '@swimlane/ngx-charts';
import { ChartModule, HIGHCHARTS_MODULES } from 'angular-highcharts';
import more from 'highcharts/highcharts-more.src';
import exporting from 'highcharts/modules/exporting.src';
import highmaps from 'highcharts/modules/map.src';
import { XdfGraphModule } from '@xdf/graph';
import { WidgetPetiComponent } from './components/widget-peti/widget-peti.component';
import { GaugeChartComponent } from './components/gauge-chart/gauge-chart.component';
import { GaugeChartModule } from 'angular-gauge-chart';
import { InactivitySesionComponent } from './components/inactivity-sesion/inactivity-sesion.component';
import { HeatMapComponent } from './components/heat-map/heat-map.component'

export function highchartsModules() { 
  // apply Highcharts Modules to this array
  return [ more, exporting, highmaps];
}

@NgModule({
  declarations: [
    OperativeDashboardComponent,
    SummaryPetiWidgetComponent,
    CustomerActivityWidgetComponent,
    WidgetPetiComponent,
    GaugeChartComponent,
    InactivitySesionComponent,
    HeatMapComponent],
  imports: [
    CommonModule,
    FormsModule,
    ReactiveFormsModule,
    TranslateModule,
    DashboardsRoutingModule,
    MatFormFieldModule,
    MatSelectModule,
    MatTooltipModule,
    XdfGalleryModule,
    XdfSettingsModule,
    XdfLayoutsModule,
    MatButtonModule,
    ChartModule,
    XdfGraphModule,
    GaugeChartModule,
    NgxChartsModule,
    ChartsModule
  ],
  entryComponents: [
  ],
  providers: [
    { provide: DirtyGuard, useClass: DirtyGuard },
    EditableDataTableTemplateResolver,
    { provide: HIGHCHARTS_MODULES, useFactory: highchartsModules }
  ]
})
export class DashboardsModule { }
