import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
import { NgModule } from "@angular/core";
import { RouterModule } from "@angular/router";
import { CommonModule } from "@angular/common";
import { FormsModule, ReactiveFormsModule } from "@angular/forms";
import { AngularMyDatePickerModule } from "angular-mydatepicker";
import { HttpClientModule, HttpClient } from "@angular/common/http";

import { AdminLayoutRoutes } from "./admin.routing";
import { DashboardComponent } from "../../components/dashboard/dashboard.component";
import { ProfileComponent } from "../../components/profile/profile.component";

import { PluginsModule } from "../../components/plugins/plugins.module";

import { MatDialogModule, MatPaginatorIntl } from "@angular/material";

import { MatTableExporterModule } from "mat-table-exporter";
import {
  MatButtonModule,
  MatInputModule,
  MatRippleModule,
  MatFormFieldModule,
  MatSelectModule,
  MatExpansionModule,
  MatTableModule,
  MatPaginatorModule,
  MatProgressSpinnerModule,
  MatSortModule
} from "@angular/material";

import { MatPasswordStrengthModule } from "@angular-material-extensions/password-strength";
import { TermsComponent } from "@app/components/terms/terms.component";
import { InvestmentProposalsComponent } from "@app/components/investment-proposals/investment-proposals.component";
import { InvestmentProposalGeneralInfoComponent } from "@app/components/investment-proposals/general-info/general-info.component";

import { InvestmentsComponent } from "@app/components/investments/investments.component";
import { ArbitrationsComponent } from "@app/components/arbitrations/arbitrations.component";
import { PerformancesComponent } from "@app/components/performances/performances.component";
import { FormInvestmentProposalService } from "@app/services/form-investment-proposal.service";
import { InvestmentProposalWorkflowService } from "@app/services/investment-proposal-workflow.service";
import { ComplementInfoComponent } from "@app/components/investment-proposals/complement-info/complement-info.component";
import { InstrumentWorkComponent } from "@app/components/investment-proposals/instrument-work/instrument-work.component";
import { ResultComponent } from "@app/components/investment-proposals/result/result.component";
import { InvestmentProposalReviewComponent } from "@app/components/investment-proposals/review/review.component";

import { NavbarInvProposalComponent } from "@app/components/plugins/navbar-inv-proposals/navbar-inv-proposals";
import { LETE } from "@app/components/instruments/lete/lete.component";
import { CETE } from "@app/components/instruments/cete/cete.component";
import { VCN } from "@app/components/instruments/vcn/vcn.component";
import { PBUR } from "@app/components/instruments/pbur/pbur.component";

import { BONO } from "@app/components/instruments/bonos/bonos.component";
import { DAP } from "@app/components/instruments/dap/dap.component";

import { InstrumentDirective } from "@app/components/investment-proposals/instrument/instrument.directive";
import { WorkflowGuard } from "@app/services/investment-proposal-workflow.guard";
import { ChangeHistoryComponent } from "@app/components/investment-proposals/change-history/change-history.component";

import { PaymentRequirementComponent } from "@app/components/investment-proposals/payment-requirement/payment-requirement.component";
import { PaymentInfoComponent } from "@app/components/investment-proposals/payment-info/payment-info.component";
import { InvestmentProposalDetailComponent } from "@app/components/investment-proposals/proposal-detail/proposal-detail.component";
import { InvestmentProposalApproveComponent } from "@app/components/investment-proposals/approve/approve.component";
import { DAPCostsComponent } from "@app/components/investments/costs/dap/dap.costs.component";
import { VCNCostsComponent } from "@app/components/investments/costs/vcn/vcn.costs.component";
import { NumberPipePipe } from "@app/components/extras/convert.dec.pipe";
import { PBURCostsComponent } from "@app/components/investments/costs/pbur/pbur.costs.component";
import { IncomesComponent } from "@app/components/incomes/incomes.component";

import { GeneralIncomeFormComponent } from "@app/components/incomes/general-form/general-form.component";
import { PaymentApprovalComponent } from "@app/components/investment-proposals/payment-approval/payment-approval.component";
import { TIT } from "@app/components/instruments/titulos/titulos.component";
import { EURB } from "@app/components/instruments/eurobonos/eurobonos.component";
import { CINV } from "@app/components/instruments/certificados/certificados.component";
import { MatPaginatorIntlSpa } from "@app/models/i18n-paginator";
import { FINV } from "@app/components/instruments/fondos/fondos.component";
import { UploadLiquidationComponent } from "@app/components/investment-proposals/upload-liquidation/upload-liquidation.component";
import { SelectModule } from "ng-select";
import { OPC } from "@app/components/instruments/opciones/opciones.component";
import { FUTU } from "@app/components/instruments/futuros/futuros.component";
import { FINVCostsComponent } from "@app/components/investments/costs/fondos/fondos.costs.component";
import { InvestmentPrint } from "@app/components/plugins/investment-print/investment-print";
import { PPER } from "@app/components/instruments/pper/pper.component";
import { PEMP } from "@app/components/instruments/pemp/pemp.component";
import { PEMPCostsComponent } from "@app/components/investments/costs/pemp/pemp.costs.component";
import { PPERCostsComponent } from "@app/components/investments/costs/pper/pper.costs.component";

// This array defines which "componentId" maps to which lazy-loaded module.

@NgModule({
  imports: [
    CommonModule,
    RouterModule.forChild(AdminLayoutRoutes),

    FormsModule,
    ReactiveFormsModule,
    MatButtonModule,
    MatRippleModule,
    MatFormFieldModule,
    MatInputModule,
    MatSelectModule,
    MatExpansionModule,
    MatTableModule,
    MatPaginatorModule,
    MatProgressSpinnerModule,
    MatSortModule,
    MatTableExporterModule,
    PluginsModule,
    AngularMyDatePickerModule,
    MatPasswordStrengthModule,
    HttpClientModule,
    SelectModule
  ],
  providers: [
    { provide: MatPaginatorIntl, useClass: MatPaginatorIntlSpa },

    WorkflowGuard,
    {
      provide: FormInvestmentProposalService,
      useClass: FormInvestmentProposalService
    },
    {
      provide: InvestmentProposalWorkflowService,
      useClass: InvestmentProposalWorkflowService
    }
  ],
  declarations: [
    DashboardComponent,
    ProfileComponent,
    TermsComponent,
    InvestmentProposalsComponent,
    InvestmentProposalGeneralInfoComponent,
    InvestmentProposalReviewComponent,
    InvestmentProposalApproveComponent,
    ChangeHistoryComponent,
    InvestmentsComponent,
    ArbitrationsComponent,
    PerformancesComponent,
    ComplementInfoComponent,
    InstrumentWorkComponent,
    ResultComponent,
    NavbarInvProposalComponent,
    LETE,
    CETE,
    VCN,
    PBUR,
    BONO,
    DAP,
    TIT,
    EURB,
    CINV,
    FINV,
    OPC,
    FUTU,
    PPER,
    PEMP,
    InstrumentDirective,
    PaymentInfoComponent,
    PaymentRequirementComponent,
    InvestmentProposalDetailComponent,
    DAPCostsComponent,
    VCNCostsComponent,
    PBURCostsComponent,
    FINVCostsComponent,
    PEMPCostsComponent,
    PPERCostsComponent,
    IncomesComponent,
    GeneralIncomeFormComponent,
    PaymentApprovalComponent,
    UploadLiquidationComponent,
    InvestmentPrint,
    NumberPipePipe
  ],
  entryComponents: [
    LETE,
    CETE,
    VCN,
    PBUR,
    BONO,
    DAP,
    TIT,
    EURB,
    CINV,
    FINV,
    OPC,
    FUTU,
    PPER,
    PEMP
  ]
})
export class AdminModule {}
