import { Inject, Injectable, Optional } from '@angular/core';
import { LOGGER } from '@anglr/common';
import * as i0 from "@angular/core";
/**
 * Dynamic module items provider for built-in layout designer components
 */
export class LayoutDesignerDynamicModuleItemsProvider {
    //######################### constructor #########################
    constructor(_logger) {
        this._logger = _logger;
    }
    //######################### public methods - implementation of DynamicItemLoaderProvider #########################
    /**
     * @inheritdoc
     */
    async tryToGet(source) {
        //only works with layout-editor
        if (source.package != '@anglr/dynamic/layout-editor') {
            return null;
        }
        try {
            this._logger?.debug('LayoutDesignerDynamicModuleItemsProvider: trying to get item {{@item}}', { item: { name: source.name, package: source.package } });
            if (source.name == 'layout-designer') {
                return await import('../../components/layoutDesigner/type');
            }
        }
        catch (e) {
            this._logger?.warn('LayoutDesignerDynamicModuleItemsProvider: item {{@item}} was not found, reason:' + e, { item: { name: source.name, package: source.package } });
        }
        this._logger?.debug('LayoutDesignerDynamicModuleItemsProvider: item {{@item}} was not found', { item: { name: source.name, package: source.package } });
        return null;
    }
}
LayoutDesignerDynamicModuleItemsProvider.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: LayoutDesignerDynamicModuleItemsProvider, deps: [{ token: LOGGER, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
LayoutDesignerDynamicModuleItemsProvider.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: LayoutDesignerDynamicModuleItemsProvider });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: LayoutDesignerDynamicModuleItemsProvider, decorators: [{
            type: Injectable
        }], ctorParameters: () => [{ type: undefined, decorators: [{
                    type: Inject,
                    args: [LOGGER]
                }, {
                    type: Optional
                }] }] });
//# sourceMappingURL=layoutDesignerDynamicModuleItemsProvider.service.js.map