import { Component, HostBinding, ChangeDetectionStrategy, ViewEncapsulation, Input, EventEmitter, Output } from '@angular/core';
import { consumeEvent, UxAppShellService } from '@eui/core';
import * as i0 from "@angular/core";
import * as i1 from "@eui/core";
import * as i2 from "@angular/common";
import * as i3 from "../../../../components/eui-button/eui-button.component";
function EuiAppSidebarHeaderUserProfileComponent_div_3_div_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 11);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r3 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate(ctx_r3.welcomeLabel);
} }
function EuiAppSidebarHeaderUserProfileComponent_div_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 7);
    i0.ɵɵtemplate(1, EuiAppSidebarHeaderUserProfileComponent_div_3_div_1_Template, 2, 1, "div", 8);
    i0.ɵɵelementStart(2, "div", 9);
    i0.ɵɵelementStart(3, "span", 10);
    i0.ɵɵtext(4);
    i0.ɵɵpipe(5, "async");
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    var tmp_1_0 = null;
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", ctx_r0.welcomeLabel);
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate((tmp_1_0 = i0.ɵɵpipeBind1(5, 2, ctx_r0.asServie.state$)) == null ? null : tmp_1_0.userInfos);
} }
function EuiAppSidebarHeaderUserProfileComponent_div_5_span_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 11);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r4 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate1("", ctx_r4.welcomeLabel, "\u00A0");
} }
function EuiAppSidebarHeaderUserProfileComponent_div_5_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 7);
    i0.ɵɵelementStart(1, "div", 9);
    i0.ɵɵtemplate(2, EuiAppSidebarHeaderUserProfileComponent_div_5_span_2_Template, 2, 1, "span", 8);
    i0.ɵɵelementStart(3, "span", 11);
    i0.ɵɵelementStart(4, "strong");
    i0.ɵɵtext(5);
    i0.ɵɵpipe(6, "async");
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(7, "div", 9);
    i0.ɵɵelementStart(8, "span", 12);
    i0.ɵɵtext(9);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(10, "span", 10);
    i0.ɵɵtext(11);
    i0.ɵɵpipe(12, "async");
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    var tmp_1_0 = null;
    var tmp_3_0 = null;
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngIf", ctx_r1.welcomeLabel);
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate((tmp_1_0 = i0.ɵɵpipeBind1(6, 4, ctx_r1.asServie.state$)) == null ? null : tmp_1_0.userInfos);
    i0.ɵɵadvance(4);
    i0.ɵɵtextInterpolate1("", ctx_r1.impersonateLabel, "\u00A0");
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate((tmp_3_0 = i0.ɵɵpipeBind1(12, 6, ctx_r1.asServie.state$)) == null ? null : tmp_3_0.impersonatedUserInfos);
} }
function EuiAppSidebarHeaderUserProfileComponent_div_7_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 13);
    i0.ɵɵtext(1);
    i0.ɵɵpipe(2, "async");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r2 = i0.ɵɵnextContext();
    var tmp_0_0 = null;
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate1(" ", (tmp_0_0 = i0.ɵɵpipeBind1(2, 1, ctx_r2.asServie.state$)) == null ? null : tmp_0_0.userSubInfos, " ");
} }
export class EuiAppSidebarHeaderUserProfileComponent {
    constructor(asServie) {
        this.asServie = asServie;
        this.impersonateLabel = ''; // impersonating
        this.welcomeLabel = ''; // Welcome
        this.isOnline = true;
        this.toggle = new EventEmitter();
        this.toggleProfile = false;
    }
    get cssClasses() {
        return this.getCssClasses();
    }
    getCssClasses() {
        return [
            `eui-app-sidebar-header-user-profile`,
        ].join(' ').trim();
    }
    onProfileClick(event) {
        this.toggleProfile = !this.toggleProfile;
        consumeEvent(event);
        this.toggle.emit();
    }
}
/** @nocollapse */ EuiAppSidebarHeaderUserProfileComponent.ɵfac = function EuiAppSidebarHeaderUserProfileComponent_Factory(t) { return new (t || EuiAppSidebarHeaderUserProfileComponent)(i0.ɵɵdirectiveInject(i1.UxAppShellService)); };
/** @nocollapse */ EuiAppSidebarHeaderUserProfileComponent.ɵcmp = i0.ɵɵdefineComponent({ type: EuiAppSidebarHeaderUserProfileComponent, selectors: [["eui-app-sidebar-header-user-profile"]], hostVars: 2, hostBindings: function EuiAppSidebarHeaderUserProfileComponent_HostBindings(rf, ctx) { if (rf & 2) {
        i0.ɵɵclassMap(ctx.cssClasses);
    } }, inputs: { impersonateLabel: "impersonateLabel", welcomeLabel: "welcomeLabel", isOnline: "isOnline" }, outputs: { toggle: "toggle" }, decls: 11, vars: 11, consts: [[1, "eui-app-sidebar-header-user-profile-content", 3, "click"], [1, "eui-user-profile__avatar", 3, "ngClass"], [1, "eui-user-profile__infos"], ["class", "eui-user-profile__infos-wrapper", 4, "ngIf"], ["class", "eui-user-profile__infos-subinfos", 4, "ngIf"], ["euiButton", "", "euiRounded", "", "euiIconButton", "", "euiSizeS", "", "euiBasicButton", "", "euiSecondary", "", 1, "eui-user-profile__toggle"], [1, "eui-icon", 3, "ngClass"], [1, "eui-user-profile__infos-wrapper"], ["class", "eui-user-profile__infos-welcome", 4, "ngIf"], [1, "eui-user-profile__infos-container"], [1, "eui-user-profile__infos-name"], [1, "eui-user-profile__infos-welcome"], [1, "eui-user-profile__infos-impersonating"], [1, "eui-user-profile__infos-subinfos"]], template: function EuiAppSidebarHeaderUserProfileComponent_Template(rf, ctx) { if (rf & 1) {
        i0.ɵɵelementStart(0, "div", 0);
        i0.ɵɵlistener("click", function EuiAppSidebarHeaderUserProfileComponent_Template_div_click_0_listener($event) { return ctx.onProfileClick($event); });
        i0.ɵɵelement(1, "div", 1);
        i0.ɵɵelementStart(2, "div", 2);
        i0.ɵɵtemplate(3, EuiAppSidebarHeaderUserProfileComponent_div_3_Template, 6, 4, "div", 3);
        i0.ɵɵpipe(4, "async");
        i0.ɵɵtemplate(5, EuiAppSidebarHeaderUserProfileComponent_div_5_Template, 13, 8, "div", 3);
        i0.ɵɵpipe(6, "async");
        i0.ɵɵtemplate(7, EuiAppSidebarHeaderUserProfileComponent_div_7_Template, 3, 3, "div", 4);
        i0.ɵɵpipe(8, "async");
        i0.ɵɵelementEnd();
        i0.ɵɵelementStart(9, "button", 5);
        i0.ɵɵelement(10, "span", 6);
        i0.ɵɵelementEnd();
        i0.ɵɵelementEnd();
    } if (rf & 2) {
        var tmp_1_0 = null;
        var tmp_2_0 = null;
        var tmp_3_0 = null;
        i0.ɵɵadvance(1);
        i0.ɵɵproperty("ngClass", ctx.isOnline ? "eui-user-profile__avatar--online" : "eui-user-profile__avatar--offline");
        i0.ɵɵadvance(2);
        i0.ɵɵproperty("ngIf", !((tmp_1_0 = i0.ɵɵpipeBind1(4, 5, ctx.asServie.state$)) == null ? null : tmp_1_0.impersonatedUserInfos));
        i0.ɵɵadvance(2);
        i0.ɵɵproperty("ngIf", (tmp_2_0 = i0.ɵɵpipeBind1(6, 7, ctx.asServie.state$)) == null ? null : tmp_2_0.impersonatedUserInfos);
        i0.ɵɵadvance(2);
        i0.ɵɵproperty("ngIf", (tmp_3_0 = i0.ɵɵpipeBind1(8, 9, ctx.asServie.state$)) == null ? null : tmp_3_0.userSubInfos);
        i0.ɵɵadvance(3);
        i0.ɵɵproperty("ngClass", ctx.toggleProfile ? "eui-icon-angle-up" : "eui-icon-angle-down");
    } }, directives: [i2.NgClass, i2.NgIf, i3.EuiButtonComponent], pipes: [i2.AsyncPipe], styles: [".eui-app-sidebar-header-user-profile{border-bottom:1px solid var(--eui-color-grey-lightest);display:flex;padding:var(--eui-spacing);position:relative;width:100%}.eui-app-sidebar-header-user-profile-content{align-items:center;cursor:pointer;display:flex;width:100%}.eui-app-sidebar-header-user-profile-content .eui-user-profile__avatar{background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/PjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCIgdmlld0JveD0iMCAwIDUzIDUzIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1MyA1MzsiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIHN0eWxlPSJmaWxsOiNFN0VDRUQ7IiBkPSJNMTguNjEzLDQxLjU1MmwtNy45MDcsNC4zMTNjLTAuNDY0LDAuMjUzLTAuODgxLDAuNTY0LTEuMjY5LDAuOTAzQzE0LjA0Nyw1MC42NTUsMTkuOTk4LDUzLDI2LjUsNTNjNi40NTQsMCwxMi4zNjctMi4zMSwxNi45NjQtNi4xNDRjLTAuNDI0LTAuMzU4LTAuODg0LTAuNjgtMS4zOTQtMC45MzRsLTguNDY3LTQuMjMzYy0xLjA5NC0wLjU0Ny0xLjc4NS0xLjY2NS0xLjc4NS0yLjg4OHYtMy4zMjJjMC4yMzgtMC4yNzEsMC41MS0wLjYxOSwwLjgwMS0xLjAzYzEuMTU0LTEu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NjMyLDUuMzA0Yy0wLjI5MSwwLjQxMS0wLjU2MywwLjc1OS0wLjgwMSwxLjAzVjM4LjhjMCwxLjIyMywwLjY5MSwyLjM0MiwxLjc4NSwyLjg4OGw4LjQ2Nyw0LjIzM2MwLjUwOCwwLjI1NCwwLjk2NywwLjU3NSwxLjM5LDAuOTMyYzUuNzEtNC43NjIsOS4zOTktMTEuODgyLDkuNTM2LTE5LjlDNTMuMjQ2LDEyLjMyLDQxLjU4NywwLjI1NCwyNi45NTMsMC4wMDR6Ii8+PC9nPjxnPjwvZz48Zz48L2c+PGc+PC9nPjxnPjwvZz48Zz48L2c+PGc+PC9nPjxnPjwvZz48Zz48L2c+PGc+PC9nPjxnPjwvZz48Zz48L2c+PGc+PC9nPjxnPjwvZz48Zz48L2c+PGc+PC9nPjwvc3ZnPg==);background-size:cover;border:3px solid var(--eui-color-info-light);border-radius:50%;box-shadow:0 1px 2px rgba(0,0,0,.2),0 1px 3px rgba(0,0,0,.3);height:40px;margin-right:1rem;min-height:40px;min-width:40px;position:relative;width:40px}.eui-app-sidebar-header-user-profile-content .eui-user-profile__avatar--offline{border-color:var(--eui-color-danger-light)}.eui-app-sidebar-header-user-profile-content .eui-user-profile__avatar--online{border-color:var(--eui-color-info-light)}.eui-app-sidebar-header-user-profile-content .eui-user-profile__infos{align-items:flex-start;display:flex;flex-direction:column;margin:0}.eui-app-sidebar-header-user-profile-content .eui-user-profile__infos .eui-user-profile__infos-wrapper{display:flex;flex-direction:column;width:100%}.eui-app-sidebar-header-user-profile-content .eui-user-profile__infos .eui-user-profile__infos-wrapper .eui-user-profile__infos-container{align-items:center;display:flex;justify-content:flex-start;width:100%}.eui-app-sidebar-header-user-profile-content .eui-user-profile__infos .eui-user-profile__infos-wrapper .eui-user-profile__infos-container .eui-user-profile__infos-impersonating,.eui-app-sidebar-header-user-profile-content .eui-user-profile__infos .eui-user-profile__infos-wrapper .eui-user-profile__infos-container .eui-user-profile__infos-welcome{color:var(--eui-color-grey-dark);font-size:var(--eui-font-size-s)}.eui-app-sidebar-header-user-profile-content .eui-user-profile__infos .eui-user-profile__infos-wrapper .eui-user-profile__infos-container .eui-user-profile__infos-name{color:var(--eui-color-primary);font-size:var(--eui-font-size);font-weight:700}.eui-app-sidebar-header-user-profile-content .eui-user-profile__infos-subinfos{color:var(--eui-color-grey-dark);font-size:var(--eui-font-size-s);line-height:1.5}.eui-app-sidebar-header-user-profile-content .eui-user-profile__toggle{font-size:var(--eui-font-size);margin-left:auto!important;transition:all .3s linear!important}.eui-app-sidebar-header-user-profile-content .eui-user-profile__toggle:active,.eui-app-sidebar-header-user-profile-content .eui-user-profile__toggle:focus{border:2px solid var(--eui-color-accessible-focus);outline:none;transition:border .15s ease-in-out}.eui-app-sidebar-header-user-profile-content .eui-user-profile__toggle .eui-button__container .eui-icon{font-size:var(--eui-font-size-l)!important}@media screen and (min-width:992px){.eui-app-sidebar-header-user-profile{display:none}}"], encapsulation: 2 });
/*@__PURE__*/ (function () { i0.ɵsetClassMetadata(EuiAppSidebarHeaderUserProfileComponent, [{
        type: Component,
        args: [{
                selector: 'eui-app-sidebar-header-user-profile',
                templateUrl: './sidebar-header-user-profile.component.html',
                styleUrls: ['./_styles/_index.scss'],
                changeDetection: ChangeDetectionStrategy.Default,
                encapsulation: ViewEncapsulation.None,
            }]
    }], function () { return [{ type: i1.UxAppShellService }]; }, { impersonateLabel: [{
            type: Input
        }], welcomeLabel: [{
            type: Input
        }], isOnline: [{
            type: Input
        }], toggle: [{
            type: Output
        }], cssClasses: [{
            type: HostBinding,
            args: ['class']
        }] }); })();
//# sourceMappingURL=data:application/json;base64, 