import { Optional, Pipe } from '@angular/core';
import { LayoutEditorPropertyMetadataExtractor } from '@anglr/dynamic/layout-editor';
import * as i0 from "@angular/core";
import * as i1 from "@anglr/dynamic/layout-editor";
/**
 * Gets properties metadata for for model type
 */
export class PropertiesMetadataSAPipe {
    //######################### constructor #########################
    constructor(propertyExtractor) {
        this.propertyExtractor = propertyExtractor;
    }
    //######################### public methods - implementation of PipeTransform #########################
    /**
     * Gets properties metadata for for model type
     * @param value - Type of properties model
     * @param propertyExtractor - Extractor used for obtaining metadata for model
     */
    transform(value, propertyExtractor) {
        var _a;
        if (!value) {
            return null;
        }
        (_a = this.propertyExtractor) !== null && _a !== void 0 ? _a : (this.propertyExtractor = propertyExtractor);
        if (!this.propertyExtractor) {
            throw new Error('Please provide LayoutEditorPropertyMetadataExtractor for propertiesMetadata pipe!');
        }
        return this.propertyExtractor.extract(value);
    }
}
PropertiesMetadataSAPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: PropertiesMetadataSAPipe, deps: [{ token: i1.LayoutEditorPropertyMetadataExtractor, optional: true }], target: i0.ɵɵFactoryTarget.Pipe });
PropertiesMetadataSAPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.0.4", ngImport: i0, type: PropertiesMetadataSAPipe, isStandalone: true, name: "propertiesMetadata" });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: PropertiesMetadataSAPipe, decorators: [{
            type: Pipe,
            args: [{ name: 'propertiesMetadata', standalone: true, }]
        }], ctorParameters: () => [{ type: i1.LayoutEditorPropertyMetadataExtractor, decorators: [{
                    type: Optional
                }] }] });
//# sourceMappingURL=propertiesMetadata.pipe.js.map