import {ErrorHandler, NgModule} from "@angular/core";
import {BrowserModule} from "@angular/platform-browser";
import {BrowserAnimationsModule} from "@angular/platform-browser/animations";
import {FormsModule} from "@angular/forms";
import {AgGridModule} from "ag-grid-angular";
import {WebbpmComponent} from "./component/webbpm.component";
import {WebbpmRoutingModule} from "./webbpm-routing.module";
import {NgbModule} from "@ng-bootstrap/ng-bootstrap";
import {ToastNoAnimationModule} from "ngx-toastr";
import {AppModule} from "../app/app.module";
import {HomeComponent} from "./component/home.component";
import {
  BpmnModule,
  ComponentsModule,
  CoreModule,
} from "@webbpm/base-package";
import {AppRoutingModule} from "../app/app-routing.module";
import {GlobalErrorHandler} from "./handler/global-error.handler.prod";
import {DEFAULT_HTTP_INTERCEPTOR_PROVIDERS} from "./interceptor/default-interceptors.prod";
import {TokenFormComponent} from "./component/token-form.component";
import {WebbpmTokenProvider} from "./provider/webbpm-token-provider";
import {RolesGuard} from "../app/guard/RolesGuard";
import {TokenProvider} from "../app/provider/token.provider";
import {WebbpmRolesGuard} from "./guard/WebbpmRolesGuard";

let IMPORTS = [
  BrowserAnimationsModule,
  BrowserModule,
  FormsModule,
  NgbModule,
  ToastNoAnimationModule.forRoot(),
  AgGridModule,
  AppRoutingModule,
  BpmnModule,
  CoreModule,
  ComponentsModule,
  AppModule,
  WebbpmRoutingModule
];

@NgModule({
            imports: IMPORTS,
            declarations: [
              WebbpmComponent,
              HomeComponent,
              TokenFormComponent
            ],
            exports: [],
            providers: [
              {provide: ErrorHandler, useClass: GlobalErrorHandler},
              {provide: TokenProvider, useClass: WebbpmTokenProvider},
              {provide: RolesGuard, useClass: WebbpmRolesGuard},
              DEFAULT_HTTP_INTERCEPTOR_PROVIDERS
            ],
            bootstrap: [
              WebbpmComponent
            ]
          })
export class WebbpmModule {
}
