import { Component, Input } from '@angular/core';
import { sortBy } from 'lodash';
import { AlertService } from '../alert/alert.service';
import * as i0 from "@angular/core";
import * as i1 from "../alert/alert.service";
import * as i2 from "../common/outlet.directive";
import * as i3 from "@angular/common";
export class SearchOutletComponent {
    constructor(alertService) {
        this.alertService = alertService;
        this.search = [];
    }
    getByPriority() {
        return sortBy(this.search, this.byPriority);
    }
    byPriority(item) {
        return -item.priority;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SearchOutletComponent, deps: [{ token: i1.AlertService }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: SearchOutletComponent, selector: "c8y-search-outlet", inputs: { search: "search" }, ngImport: i0, template: "<ng-container *ngFor=\"let item of getByPriority()\">\n  <ng-container *c8yOutlet=\"item.template; injector: item.injector\"></ng-container>\n</ng-container>\n", dependencies: [{ kind: "directive", type: i2.OutletDirective, selector: "[c8yOutlet]", inputs: ["c8yOutlet", "c8yOutletProperties", "c8yOutletInjector"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SearchOutletComponent, decorators: [{
            type: Component,
            args: [{ selector: 'c8y-search-outlet', template: "<ng-container *ngFor=\"let item of getByPriority()\">\n  <ng-container *c8yOutlet=\"item.template; injector: item.injector\"></ng-container>\n</ng-container>\n" }]
        }], ctorParameters: () => [{ type: i1.AlertService }], propDecorators: { search: [{
                type: Input
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VhcmNoLW91dGxldC5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9jb3JlL3NlYX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