import { NgModule } from '@angular/core'
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
import { CommonModule } from '@angular/common'

import { CdkTreeModule } from '@angular/cdk/tree'
import { ClipboardModule } from '@angular/cdk/clipboard'

import { MatButtonModule } from '@angular/material/button'
import { MatCardModule } from '@angular/material/card'
import { MatCheckboxModule } from '@angular/material/checkbox'
import { MatChipsModule } from '@angular/material/chips'
import { MatDialogModule } from '@angular/material/dialog'
import { MatDividerModule } from '@angular/material/divider'
import { MatExpansionModule } from '@angular/material/expansion'
import { MatFormFieldModule } from '@angular/material/form-field'
import { MatIconModule } from '@angular/material/icon'
import { MatInputModule } from '@angular/material/input'
import { MatMenuModule } from '@angular/material/menu'
import { MatProgressBarModule } from '@angular/material/progress-bar'
import { MatSelectModule } from '@angular/material/select'
import { MatSidenavModule } from '@angular/material/sidenav'
import { MatSlideToggleModule } from '@angular/material/slide-toggle'
import { MatSliderModule } from '@angular/material/slider'
import { MatSnackBarModule } from '@angular/material/snack-bar'
import { MatTreeModule } from '@angular/material/tree'
import { MatTooltipModule } from '@angular/material/tooltip'

import { FlexLayoutModule } from 'ngx-flexible-layout'

import { NgxMapLibreGLModule } from '@maplibre/ngx-maplibre-gl'

import { PipesModule } from '../pipes.module'

import { InfoModule }   from '../info/info.module'
import { DataService } from '../_services/data.service'
import { WebsocketService } from '../_services/websocket.service'

import { MapComponent } from './map.component'
import { BaseMapComponent } from './base-map/base-map.component'
import { GisafMapboxComponent } from './gisaf-mapbox/gisaf-mapbox.component'
import { MapControlsComponent } from './controls/map-controls.component'
import { TreeLayerComponent } from './tree-layer/tree-layer.component'
import { TreeLayerItemComponent } from './tree-layer-item/tree-layer-item.component'

import { MapRoutingModule } from './map-routing.module'
import { CreateBaseMapDialogComponent } from './controls/create-base-map-dialog'
import { GisafControlComponent } from './gisaf-mapbox/gisaf-control.component'
import { GisafRulerDirective } from './gisaf-mapbox/gisaf-ruler.directive'

@NgModule({
    imports: [
        CommonModule,
        FormsModule,
        ReactiveFormsModule,

        CdkTreeModule,
        ClipboardModule,

        MatButtonModule,
        MatCardModule,
        MatCheckboxModule,
        MatChipsModule,
        MatDialogModule,
        MatDividerModule,
        MatExpansionModule,
        MatFormFieldModule,
        MatIconModule,
        MatInputModule,
        MatMenuModule,
        MatProgressBarModule,
        MatSelectModule,
        MatSidenavModule,
        MatSlideToggleModule,
        MatSliderModule,
        MatSnackBarModule,
        MatTreeModule,
        MatTooltipModule,

        FlexLayoutModule,

        PipesModule,

        NgxMapLibreGLModule,

        InfoModule,

        MapRoutingModule,
    ],
    declarations: [
        BaseMapComponent,
        CreateBaseMapDialogComponent,
        GisafMapboxComponent,
        GisafControlComponent,
        GisafRulerDirective,
        MapComponent,
        MapControlsComponent,
        TreeLayerComponent,
        TreeLayerItemComponent,
    ],
    providers: [
        DataService,
        WebsocketService,
    ],
})

export class MapModule {}
