/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
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';
export class KengicLayoutDefaultHeaderUserComponent {
    /**
     * @param {?} settingsService
     * @param {?} identityService
     * @param {?} displayChangePasswordOption
     */
    constructor(settingsService, identityService, displayChangePasswordOption) {
        this.settingsService = settingsService;
        this.identityService = identityService;
        this.displayChangePasswordOption = displayChangePasswordOption;
        this.headerUserChangePasswordComponentProp = {
            visible: false,
        };
    }
    /**
     * @return {?}
     */
    logout() {
        this.identityService.logout();
    }
    /**
     * @return {?}
     */
    openChangePasswordComponent() {
        this.headerUserChangePasswordComponentProp.visible = true;
    }
}
KengicLayoutDefaultHeaderUserComponent.decorators = [
    { type: Component, args: [{
                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      {{\r\n        'projects/fe-ng/src/lib/page/layout/default/header/user/kengic-layout-default-header-user.logout' | i18n\r\n      }}\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"
            }] }
];
/** @nocollapse */
KengicLayoutDefaultHeaderUserComponent.ctorParameters = () => [
    { type: SettingsService },
    { type: IdentityService },
    { type: Boolean, decorators: [{ type: Inject, args: [KENGIC_TOKEN_DISPLAY_CHANGE_PASSWORD_OPTION,] }] }
];
if (false) {
    /** @type {?} */
    KengicLayoutDefaultHeaderUserComponent.prototype.headerUserChangePasswordComponentProp;
    /** @type {?} */
    KengicLayoutDefaultHeaderUserComponent.prototype.settingsService;
    /**
     * @type {?}
     * @private
     */
    KengicLayoutDefaultHeaderUserComponent.prototype.identityService;
    /** @type {?} */
    KengicLayoutDefaultHeaderUserComponent.prototype.displayChangePasswordOption;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoia2VuZ2ljLWxheW91dC1kZWZhdWx0LWhlYWRlci11c2VyLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BrZW5naWMvZmUtbmcvIiwic291cmNlcyI6WyJsaWIvcGFnZS9sYXlvdXQvZGVmYXVsdC9oZWFkZXIvdXNlci9rZW5naWMtbGF5b3V0LWRlZmF1bHQtaGVhZGVyLXVzZXIuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0sRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUNsRCxPQUFPLEVBQUUsZUFBZSxFQUFFLE1BQU0sY0FBYyxDQUFDO0FBQy9DLE9BQU8sRUFBRSxlQUFlLEVBQUUsTUFBTSx5Q0FBeUMsQ0FBQztBQUMxRS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