import { ServicesComponent } from './servicesItems/services.component';
import { ExternalPageModule } from './External-Page/external-page.module';
import { InternalPageModule } from './Internal-Page/internal-page.module';
import { DashBoardModule } from './dashboard/dashboard.module';

import { CanDeactivateGuard } from './shared/can-deactivate-guards.service';
import { HashLocationStrategy, LocationStrategy } from '@angular/common';

import { FooterComponent } from './dashboard/main-footer/footer.component';
import { HeaderComponent } from './dashboard/header/header.component';


import { AuthGuardService } from './shared/auth-guard.service';
import { ResponceInterceptService } from './shared/responce-intercept.service';
import { TokenInterceptorService } from './shared/token-interceptor.service';
import { BrowserModule } from '@angular/platform-browser';

import { LOCALE_ID, NgModule } from '@angular/core';

import { QuillModule } from 'ngx-quill';

import { MomentModule } from 'ngx-moment';

import {FormsModule, ReactiveFormsModule} from '@angular/forms';
import { SlideMenuModule } from 'cuppa-ng2-slidemenu/cuppa-ng2-slidemenu';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { HttpModule } from '@angular/http';
import { HttpClientModule } from '@angular/common/http';
import {NgbModule} from '@ng-bootstrap/ng-bootstrap';
import { LoginComponent } from './login/login.component';
import { RegesterComponent } from './regester/regester.component';
import { PageNotFoundComponent } from './page-not-found/page-not-found.component';
import { AuthServiceService } from './shared/auth-service.service';
import { HTTP_INTERCEPTORS } from '@angular/common/http';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { ToastrModule } from 'ngx-toastr';
import { NgxSpinnerModule } from 'ngx-spinner';
import {NgxPaginationModule} from 'ngx-pagination';
import { FiltterPipePipe } from './filtter-pipe.pipe';

import { AlifeFileToBase64Module } from 'alife-file-to-base64';

import { CollapsibleModule } from 'angular2-collapsible'; // <-- import the module
import { FlatpickrModule } from 'angularx-flatpickr';
import { CalendarModule, DateAdapter } from 'angular-calendar';
import { adapterFactory } from 'angular-calendar/date-adapters/date-fns';

import { BootstrapModalModule } from 'ngx-modialog/plugins/bootstrap';
import { JwSocialButtonsModule } from 'jw-angular-social-buttons';

import { Ng2CarouselamosModule } from 'ng2-carouselamos';
import { NumberDerictiveDirective } from './number-derictive.directive';
import { OnlyNumberDirective } from './shared/only-number.directive';
import {SharedModule} from './shared/shared.module';
import { AddRequestComponent } from './trainning-service/add-request/add-request.component';
import { AllRequestsComponent } from './trainning-service/all-requests/all-requests.component';
import { TrainningServicesComponent } from './trainning-service/trainning-services/trainning-services.component';


@NgModule({
  declarations: [
    AppComponent,
    HeaderComponent,
    FooterComponent,
    LoginComponent,
    RegesterComponent,
    ServicesComponent,
    PageNotFoundComponent,
    NumberDerictiveDirective,
    AddRequestComponent,
    AllRequestsComponent,
    TrainningServicesComponent,
  ],
  imports: [
    BrowserModule,
    FormsModule,
    ReactiveFormsModule,
    HttpModule,
    HttpClientModule,
    DashBoardModule,
    InternalPageModule,
    ExternalPageModule,
    SharedModule,
    AppRoutingModule,
    SlideMenuModule,
    NgxSpinnerModule,
    NgxPaginationModule,
    MomentModule,
    AlifeFileToBase64Module,
    BrowserAnimationsModule,  // <-- include required BrowserAnimationsModule
    CollapsibleModule,
    BootstrapModalModule,
    Ng2CarouselamosModule,
    ToastrModule.forRoot(), // ToastrModule added
    NgbModule.forRoot(),
    FlatpickrModule.forRoot(),
    CalendarModule.forRoot({
      provide: DateAdapter,
      useFactory: adapterFactory
    }),
    QuillModule,
  ],
  providers: [AuthServiceService,
    TokenInterceptorService,
    AuthGuardService,
    CanDeactivateGuard,
    //{ provide: LOCALE_ID, useValue: 'ar-SA' },
    {provide: LocationStrategy, useClass: HashLocationStrategy},
    ResponceInterceptService , {
      provide: HTTP_INTERCEPTORS,
      useClass: TokenInterceptorService,
      multi: true
    },
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }
