import { ApplicationConfig, provideBrowserGlobalErrorListeners, LOCALE_ID } from '@angular/core';
import { provideRouter } from '@angular/router';
import { provideHttpClient, withFetch } from '@angular/common/http';
import { provideNgIconsConfig } from '@ng-icons/core';
import { environment } from '../environments/openpanel';
import { provideOpenPanel } from '@core/provider/openpanel.provider';
import { registerLocaleData } from '@angular/common';
import localeDe from '@angular/common/locales/de';

registerLocaleData(localeDe);

import { routes } from './app.routes';
import { provideClientHydration, withEventReplay } from '@angular/platform-browser';

export const appConfig: ApplicationConfig = {
  providers: [
    { provide: LOCALE_ID, useValue: 'de' },
    provideBrowserGlobalErrorListeners(),
    provideRouter(routes),
    provideHttpClient(withFetch()),
    provideClientHydration(withEventReplay()),
    provideNgIconsConfig({}),
    provideOpenPanel({
      clientId: environment.openPanel.clientId,
      apiUrl: environment.openPanel.apiUrl,
      trackScreenViews: true,
      debug: !environment.production,
    })
  ]
};
