<commit_before>import { CommonModule } from '@angular/common';
import { ModuleWithProviders, NgModule } from '@angular/core';

import { NotifierContainerComponent } from './components/notifier-container.component';
import { NotifierNotificationComponent } from './components/notifier-notification.component';
import { NotifierConfig, NotifierOptions } from './models/notifier-config.model';
import { NotifierAnimationService } from './services/notifier-animation.service';
import { NotifierQueueService } from './services/notifier-queue.service';
import { NotifierService } from './services/notifier.service';

/**
 * Notifier module
 */
@NgModule( {
	declarations: [
		NotifierContainerComponent,
		NotifierNotificationComponent
	],
	exports: [
		NotifierContainerComponent
	],
	imports: [
		CommonModule
	],
	providers: [
		NotifierAnimationService,
		NotifierService,
		NotifierQueueService
	]
} )
export class NotifierModule {

	/**
	 * Setup custom module (service) configuration
	 */
	public static forRoot( options: NotifierOptions ): ModuleWithProviders {
		return {
			ngModule: NotifierModule,
			providers: [
				{
					provide: NotifierConfig,
					useValue: new NotifierConfig( options )
				}
			]
		};
	}<commit_msg>fix(aot): Fixed error occuring when using NotifierModule.forRoot with AoT<commit_after>import { CommonModule } from '@angular/common';
import { ModuleWithProviders, NgModule, OpaqueToken } from '@angular/core';

import { NotifierContainerComponent } from './components/notifier-container.component';
import { NotifierNotificationComponent } from './components/notifier-notification.component';
import { NotifierConfig, NotifierOptions } from './models/notifier-config.model';
import { NotifierAnimationService } from './services/notifier-animation.service';
import { NotifierQueueService } from './services/notifier-queue.service';
import { NotifierService } from './services/notifier.service';

// tslint:disable variable-name
/**
 * Dependency Injection token for custom notifier options
 */
export const CustomNotifierOptions: OpaqueToken = new OpaqueToken( 'NotifierOptions' );
// tslint:enable variable-name

/**
 * Factory for creating a notifier configuration object
 *
 * Sidenote:
 * This functionality had to be extracted from the NotifierModule.forRoot function, described below. Otherwhise, the Angular AoT compiler
 * would throw errors. For further details, also see:
 * - Angular issue #11262 <https://github.com/angular/angular/issues/11262>
 * - Angular issue #10789 <https://github.com/angular/angular/issues/10789>
 */
export function notifierConfigFactory( options: NotifierOptions ): NotifierConfig {
	return new NotifierConfig( options );
}

/**
 * Notifier module
 */
@NgModule( {
	declarations: [
		NotifierContainerComponent,
		NotifierNotificationComponent
	],
	exports: [
		NotifierContainerComponent
	],
	imports: [
		CommonModule
	],
	providers: [
		NotifierAnimationService,
		NotifierService,
		NotifierQueueService
	]
} )
export class NotifierModule {

	/**
	 * Setup custom module (service) configuration
	 */
	public static forRoot( options: NotifierOptions ): ModuleWithProviders {
		return {
			ngModule: NotifierModule,
			providers: [
				{
					provide: CustomNotifierOptions,
					useValue: options
				},
				{
					deps: [
						CustomNotifierOptions
					],
					provide: NotifierConfig,
					useFactory: notifierConfigFactory
				}
			]
		};
	}
{'fraction_non_alphanumeric': 0.10558642878034513, 'fraction_numerical': 0.0058496636443404505, 'mean_word_length': 4.560975609756097, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3588752', 'n_tokens_mistral': 1061, 'n_tokens_neox': 947, 'n_words': 226}