import { CommonModule } from '@angular/common';
import { HttpClient } from '@angular/common/http';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { ComponentsModule } from '@components/components.module';
import { FlightsModule } from '@modules/flights.module';
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
import { SharedModule } from '@shared';
import { ToolkitModule } from '@toolkit/toolkit.module';
import { AccordionModule } from 'primeng/accordion';
import { CheckboxModule } from 'primeng/checkbox';
import { TooltipModule } from 'primeng/tooltip';
import { TranslateHttpLoaderFactory } from '../../shared/factories';
import { ScheduleFilterComponent } from './components/schedule-filter/schedule-filter.component';
import { CanActivateScheduleDetails } from './guards/can-activate-schedule-details.service';
import { CanActivateRedirrect } from './guards/can-activate-redirrect-to-not-found';
import { CanActivateScheduleRouteSearch } from './guards/can-activate-schedule-route-search.service';
import { ScheduleFlightsMiniListComponent } from './pages/flight-details/components/flights-mini-list/schedule-flights-mini-list.component';
import { ScheduleFlightDetailsMetaTagsComponent } from './pages/flight-details/components/meta-tags/schedule-flight-details-meta-tags.component';
import { ScheduleFlightDetailsTitleComponent } from './pages/flight-details/components/title/schedule-flight-details-title.component';
import { ScheduleFlightDetailsViewComponent } from './pages/flight-details/components/view/schedule-flight-details-view.component';
import { ScheduleFlightDetailsPageComponent } from './pages/flight-details/schedule-flight-details-page.component';
import { ScheduleDirectionSwitchComponent } from './pages/search/components/direction-switch/schedule-direction-switch.component';
import { ScheduleSearchMetaTagsComponent } from './pages/search/components/meta-tags/schedule-search-meta-tags.component';
import { ScheduleDaysComponent } from './pages/search/components/schedule-days/schedule-days.component';
import { ScheduleSearchTitleComponent } from './pages/search/components/title/schedule-search-title.component';
import { ScheduleSearchViewComponent } from './pages/search/components/view/schedule-search-view.component';
import { ScheduleSearchPageComponent } from './pages/search/schedule-search-page.component';
import { ScheduleStartMetaTagsComponent } from './pages/start/components/meta-tags/schedule-start-meta-tags.component';
import { ScheduleStartTitleComponent } from './pages/start/components/title/schedule-start-title.component';
import { ScheduleStartPageComponent } from './pages/start/schedule-start-page.component';
import { ScheduleDetailsBreadCrumbsResolver } from './resolvers/bread-crumbs/details-bread-crumbs.resolver';
import { ScheduleSearchBreadCrumbsResolver } from './resolvers/bread-crumbs/search-bread-crumbs.resolver';
import { ScheduleDetailsUrlParamsResolver } from './resolvers/url-params/details-url-params.resolver';
import { ScheduleRequestDataResolver } from './resolvers/request-data.resolver';
import { ScheduleSearchPageUrlParamsResolver } from './resolvers/url-params/search-page-url-params.resolver';
import {
    FLIGHTS_INFO_PARAM_NAME,
    ScheduleRoutingModule,
} from './schedule-routing.module';
import { ScheduleApiService } from './services/api.service';
import { ScheduleBreadCrumbService } from './services/bread-crumb.service';
import { ScheduleDetailsDataSourceService } from './services/data-source/details-data-source.service';
import { ScheduleSearchDataSourceService } from './services/data-source/search-data-source.service';
import { ScheduleDateValidationService } from './services/date-validation.service';
import { ScheduleNavigationService } from './services/navigation.service';
import { ScheduleRequestBuilderService } from './services/request/request-builder.service';
import { ScheduleRequestParserService } from './services/request/request-parser.service';
import { ScheduleRouteParamsValidationService } from './services/route-params-validation.service';
import { ScheduleHelpersService } from './services/schedule-helpers.service';
import { ScheduleStateService } from './services/state.service';
import { FLIGHTS_INFO_PARAM } from './services/url/flights-info-param';
import { ScheduleTitleService } from './services/title.service';
import { SCHEDULE_URL_BASE } from './services/url/url-base';
import { ScheduleUrlBuilderService } from './services/url/url-builder.service';
import { ScheduleUrlParserService } from './services/url/url-parser.service';
import { PopularRequestsModule } from "../popular-requests/popular-requests.module";
import { BottomDescriptionComponent } from './pages/start/components/bottom-description/bottom-description.component';

@NgModule({
    declarations: [
        ScheduleStartPageComponent,
        ScheduleSearchPageComponent,
        ScheduleFlightDetailsPageComponent,
        ScheduleSearchViewComponent,
        ScheduleDirectionSwitchComponent,
        ScheduleSearchMetaTagsComponent,
        ScheduleSearchTitleComponent,
        ScheduleFlightDetailsViewComponent,
        ScheduleFlightDetailsMetaTagsComponent,
        ScheduleFlightDetailsTitleComponent,
        ScheduleFlightsMiniListComponent,
        ScheduleStartMetaTagsComponent,
        ScheduleStartTitleComponent,
        ScheduleDaysComponent,
        ScheduleFilterComponent,
        BottomDescriptionComponent,
    ],
    providers: [
        ScheduleApiService,
        ScheduleSearchDataSourceService,
        ScheduleDetailsDataSourceService,
        CanActivateScheduleRouteSearch,
        CanActivateScheduleDetails,
        CanActivateRedirrect,
        ScheduleDateValidationService,
        ScheduleRouteParamsValidationService,
        ScheduleRequestParserService,
        ScheduleRequestBuilderService,
        ScheduleUrlBuilderService,
        ScheduleUrlParserService,
        ScheduleNavigationService,
        ScheduleStateService,
        ScheduleHelpersService,
        ScheduleSearchPageUrlParamsResolver,
        ScheduleDetailsUrlParamsResolver,
        ScheduleRequestDataResolver,
        ScheduleTitleService,
        ScheduleBreadCrumbService,
        ScheduleSearchBreadCrumbsResolver,
        ScheduleDetailsBreadCrumbsResolver,
        {
            provide: SCHEDULE_URL_BASE,
            useValue: 'schedule',
        },
        {
            provide: FLIGHTS_INFO_PARAM,
            useValue: FLIGHTS_INFO_PARAM_NAME,
        },
    ],
    imports: [
    CommonModule,
    ScheduleRoutingModule,
    FormsModule,
    ToolkitModule,
    ComponentsModule,
    FlightsModule,
    SharedModule,
    AccordionModule,
    TooltipModule,
    CheckboxModule,
    PopularRequestsModule
],
})
export class ScheduleModule {}
