import { Inject, Injectable, Optional } from '@angular/core';
import { LOGGER } from '@anglr/common';
import * as i0 from "@angular/core";
/**
 * Dynamic module relations types provider, for tiny MCE types
 */
export class TinyMceDynamicModuleRelationsProvider {
    //######################### constructor #########################
    constructor(_logger) {
        this._logger = _logger;
    }
    //######################### public methods - implementation of DynamicItemLoaderProvider #########################
    /**
     * @inheritdoc
     */
    async tryToGet(source) {
        try {
            this._logger?.debug('TinyMceDynamicModuleRelationsProvider: trying to get relations types for module {{@module}}', { module: { moduleName: source.package } });
            switch (source.package) {
                case 'tinymce-components':
                    return await import('../../relations');
                default:
                    return null;
            }
        }
        catch (e) {
            this._logger?.debug('TinyMceDynamicModuleRelationsProvider: module {{@module}} was not found, reason: ' + e, { module: { moduleName: source.package } });
        }
        return null;
    }
}
TinyMceDynamicModuleRelationsProvider.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: TinyMceDynamicModuleRelationsProvider, deps: [{ token: LOGGER, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
TinyMceDynamicModuleRelationsProvider.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: TinyMceDynamicModuleRelationsProvider });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: TinyMceDynamicModuleRelationsProvider, decorators: [{
            type: Injectable
        }], ctorParameters: () => [{ type: undefined, decorators: [{
                    type: Inject,
                    args: [LOGGER]
                }, {
                    type: Optional
                }] }] });
//# sourceMappingURL=tinyMceDynamicModuleRelationsProvider.service.js.map