import { Component, EventEmitter, Inject, Input, Output } from '@angular/core';
import { EvoSidebarCloseTargets } from '../enums/evo-sidebar-close-targets';
import { SidebarInjectionToken } from '../sidebar-injection-token';
import * as i0 from "@angular/core";
import * as i1 from "../../evo-icon/evo-icon.component";
import * as i2 from "@angular/common";
export class EvoSidebarHeaderComponent {
    constructor(sidebar) {
        this.sidebar = sidebar;
        this.back = new EventEmitter();
    }
    ngOnInit() {
        var _a;
        if (!this.sidebar) {
            throw new Error(`EvoSidebarHeaderComponent must be used inside EvoSidebarComponent only!`);
        }
        this.backButton = (_a = this.backButton) !== null && _a !== void 0 ? _a : this.sidebar.backButton;
    }
    handleBackClick() {
        this.back.emit();
    }
    closeSidebar() {
        this.sidebar.closeSidebar(EvoSidebarCloseTargets.BUTTON);
    }
}
EvoSidebarHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: EvoSidebarHeaderComponent, deps: [{ token: SidebarInjectionToken }], target: i0.ɵɵFactoryTarget.Component });
EvoSidebarHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: EvoSidebarHeaderComponent, selector: "evo-sidebar-header, [evo-sidebar-header]", inputs: { backButton: "backButton" }, outputs: { back: "back" }, host: { classAttribute: "evo-sidebar__header" }, ngImport: i0, template: "<div class=\"evo-sidebar__back\"\n    *ngIf=\"backButton\"\n    (click)=\"handleBackClick()\">\n    <evo-icon class=\"evo-sidebar__icon\" shape=\"chevron-left\"></evo-icon>\n</div>\n\n<div class=\"evo-sidebar__title\">\n    <ng-content></ng-content>\n</div>\n\n<div class=\"evo-sidebar__close\" (click)=\"closeSidebar()\">\n    <evo-icon class=\"evo-sidebar__icon\" shape=\"close\"></evo-icon>\n</div>\n\n", styles: [":host{display:flex;flex-shrink:0;align-items:flex-start;margin:0 15px;padding:16px 0;border-bottom:solid 1px #C6C6C6}@media (min-width: 768px){:host{padding-top:32px;padding-bottom:16px}}@media (min-width: 992px){:host{margin:0 32px}}.evo-sidebar__title{flex:1;color:#212121;font-weight:700;font-size:24px;font-family:var(--evo-font-secondary);line-height:32px}@media (min-width: 768px){.evo-sidebar__title{font-size:30px;line-height:38px}}.evo-sidebar__close{flex-shrink:0;margin-left:8px;padding:0;color:#231f20;cursor:pointer;transition:opacity .3s}.evo-sidebar__close:hover{opacity:.8}.evo-sidebar__icon{display:block;width:32px;height:32px;vertical-align:bottom;fill:#91b1b8}@media (min-width: 768px){.evo-sidebar__icon{width:36px;height:36px}}.evo-sidebar__back{flex-shrink:0;margin-right:8px;color:#231f20;cursor:pointer;-webkit-user-select:none;user-select:none}\n"], components: [{ type: i1.EvoIconComponent, selector: "evo-icon", inputs: ["shape", "svgWidth", "svgHeight", "svgViewBox"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: EvoSidebarHeaderComponent, decorators: [{
            type: Component,
            args: [{
                    selector: 'evo-sidebar-header, [evo-sidebar-header]',
                    templateUrl: './evo-sidebar-header.component.html',
                    styleUrls: ['./evo-sidebar-header.component.scss'],
                    // eslint-disable-next-line
                    host: {
                        class: 'evo-sidebar__header',
                    },
                }]
        }], ctorParameters: function () { return [{ type: undefined, decorators: [{
                    type: Inject,
                    args: [SidebarInjectionToken]
                }] }]; }, propDecorators: { backButton: [{
                type: Input
            }], back: [{
                type: Output
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXZvLXNpZGViYXItaGVhZGVyLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2V2by11aS1raXQvc3JjL2xpYi9jb21wb25lbnRzL2V2by1zaWRlYmFyL2V2by1zaWRlYmFyLWhlYWRlci9ldm8t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