import { __decorate, __metadata, __param } from "tslib";
import { Component, Inject } from '@angular/core';
import { SettingsService } from '@delon/theme';
import { IdentityService } from '../../../../../service/identity.service';
import { KENGIC_TOKEN_DISPLAY_CHANGE_PASSWORD_OPTION } from '../../../../../const/injection-token.const';
let KengicLayoutDefaultHeaderUserComponent = class KengicLayoutDefaultHeaderUserComponent {
    constructor(settingsService, identityService, displayChangePasswordOption) {
        this.settingsService = settingsService;
        this.identityService = identityService;
        this.displayChangePasswordOption = displayChangePasswordOption;
        this.headerUserChangePasswordComponentProp = {
            visible: false,
        };
    }
    logout() {
        this.identityService.logout();
    }
    openChangePasswordComponent() {
        this.headerUserChangePasswordComponentProp.visible = true;
    }
};
KengicLayoutDefaultHeaderUserComponent.ctorParameters = () => [
    { type: SettingsService },
    { type: IdentityService },
    { type: Boolean, decorators: [{ type: Inject, args: [KENGIC_TOKEN_DISPLAY_CHANGE_PASSWORD_OPTION,] }] }
];
KengicLayoutDefaultHeaderUserComponent = __decorate([
    Component({
        selector: 'kengic-layout-default-header-user',
        template: "<div\r\n  nz-dropdown\r\n  nzPlacement=\"bottomRight\"\r\n  [nzDropdownMenu]=\"menuTpl\"\r\n  class=\"alain-default__nav-item d-flex align-items-center px-sm\"\r\n>\r\n  <nz-avatar [nzSrc]=\"settingsService.user.avatar\" nzSize=\"small\" class=\"mr-sm\"></nz-avatar>\r\n  {{ settingsService.user.name }}\r\n</div>\r\n\r\n<nz-dropdown-menu #menuTpl=\"nzDropdownMenu\">\r\n  <div\r\n    nz-menu\r\n    [ngStyle]=\"{\r\n      width: '200px'\r\n    }\"\r\n  >\r\n    <div (click)=\"openChangePasswordComponent()\" *ngIf=\"displayChangePasswordOption\" nz-menu-item>\r\n      <i nz-icon nzType=\"lock\" nzTheme=\"outline\" class=\"mr-sm\"></i>\r\n      {{ 'projects/fe-ng/src/lib/component/change-password/kengic-change-password.change-password' | i18n }}\r\n    </div>\r\n\r\n    <div nz-menu-item (click)=\"logout()\">\r\n      <i nz-icon nzType=\"logout\" nzTheme=\"outline\" class=\"mr-sm\"></i>\r\n      {{ 'projects/fe-ng/src/lib/page/layout/default/header/user/kengic-layout-default-header-user.logout' | i18n }}\r\n    </div>\r\n  </div>\r\n</nz-dropdown-menu>\r\n\r\n<kengic-change-password [(visible)]=\"headerUserChangePasswordComponentProp.visible\"></kengic-change-password>\r\n"
    }),
    __param(2, Inject(KENGIC_TOKEN_DISPLAY_CHANGE_PASSWORD_OPTION)),
    __metadata("design:paramtypes", [SettingsService,
        IdentityService, Boolean])
], KengicLayoutDefaultHeaderUserComponent);
export { KengicLayoutDefaultHeaderUserComponent };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoia2VuZ2ljLWxheW91dC1kZWZhdWx0LWhlYWRlci11c2VyLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BrZW5naWMvZmUtbmcvIiwic291cmNlcyI6WyJsaWIvcGFnZS9sYXlvdXQvZGVmYXVsdC9oZWFkZXIvdXNlci9rZW5naWMtbGF5b3V0LWRlZmF1bHQtaGVhZGVyLXVzZXIuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0sRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUNsRCxPQUFPLEVBQUUsZUFBZSxFQUFFLE1BQU0sY0FBYyxDQUFDO0FBQy9DLE9BQU8sRUFBRSxlQUFlLEVBQUUsTUFBTSx5Q0FBeUMsQ0FBQztBQUMxRSxPQUFPLEVBQUUsMkNBQTJDLEVBQUUsTUFBTSw0Q0FBNEMsQ0FBQztBQU16RyxJQUFhLHNDQUFzQyxHQUFuRCxNQUFhLHNDQUFzQztJQUtqRCxZQUNTLGVBQWdDLEVBQy9CLGVBQWdDLEVBRWpDLDJCQUFvQztRQUhwQyxvQkFBZSxHQUFmLGVBQWUsQ0FBaUI7UUFDL0Isb0JBQWUsR0FBZix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