import { provideHttpClient, withInterceptors } from '@angular/common/http';
import { ApplicationConfig, provideBrowserGlobalErrorListeners } from '@angular/core';
import { provideAnimations } from '@angular/platform-browser/animations';
import { provideRouter } from '@angular/router';
import { provideTaiga } from '@taiga-ui/core';
import { tuiNotificationOptionsProvider } from '@taiga-ui/core/components/notification';

import { apiBaseUrlInterceptor } from './core/http/api-base-url.interceptor';
import { devLogInterceptor } from './core/http/dev-log.interceptor';
import { routes } from './app.routes';

export const appConfig: ApplicationConfig = {
  providers: [
    provideBrowserGlobalErrorListeners(),
    provideAnimations(),
    provideRouter(routes),
    provideTaiga(),
    tuiNotificationOptionsProvider(() => ({
      block: 'start',
      inline: 'end',
    })),
    provideHttpClient(withInterceptors([apiBaseUrlInterceptor, devLogInterceptor])),
  ],
};
