import { __decorate, __metadata } from "tslib";
import { Component, EventEmitter, Input, Output } from '@angular/core';
import { ActivationStatus } from '../sales-package';
export var ListIndent;
(function (ListIndent) {
    ListIndent["INDENT_ZERO"] = "indent-zero";
    ListIndent["INDENT_ONE"] = "indent-one";
    ListIndent["INDENT_TWO"] = "indent-two";
})(ListIndent || (ListIndent = {}));
let VaPackageDropdownItemComponent = class VaPackageDropdownItemComponent {
    constructor() {
        this.enableDropdown = false;
        this.indent = ListIndent.INDENT_ZERO;
        this.itemToggled = new EventEmitter();
    }
    ngOnInit() {
    }
    toggleItem() {
        this.itemToggled.emit(null);
    }
    isActivatedStatus(status) {
        return status === ActivationStatus.SUCCESS;
    }
    isWarningStatus(status) {
        return status === ActivationStatus.WARNING;
    }
    isErrorStatus(status) {
        return status === ActivationStatus.ERROR;
    }
};
__decorate([
    Input(),
    __metadata("design:type", String)
], VaPackageDropdownItemComponent.prototype, "title", void 0);
__decorate([
    Input(),
    __metadata("design:type", String)
], VaPackageDropdownItemComponent.prototype, "titleBadge", void 0);
__decorate([
    Input(),
    __metadata("design:type", String)
], VaPackageDropdownItemComponent.prototype, "titleDescriptor", void 0);
__decorate([
    Input(),
    __metadata("design:type", String)
], VaPackageDropdownItemComponent.prototype, "iconUrl", void 0);
__decorate([
    Input(),
    __metadata("design:type", String)
], VaPackageDropdownItemComponent.prototype, "secondaryIconUrl", void 0);
__decorate([
    Input(),
    __metadata("design:type", String)
], VaPackageDropdownItemComponent.prototype, "secondaryIconName", void 0);
__decorate([
    Input(),
    __metadata("design:type", String)
], VaPackageDropdownItemComponent.prototype, "subtitle", void 0);
__decorate([
    Input(),
    __metadata("design:type", Object)
], VaPackageDropdownItemComponent.prototype, "statusItem", void 0);
__decorate([
    Input(),
    __metadata("design:type", Object)
], VaPackageDropdownItemComponent.prototype, "enableDropdown", void 0);
__decorate([
    Input(),
    __metadata("design:type", Object)
], VaPackageDropdownItemComponent.prototype, "indent", void 0);
__decorate([
    Input(),
    __metadata("design:type", Boolean)
], VaPackageDropdownItemComponent.prototype, "toggleValue", void 0);
__decorate([
    Input(),
    __metadata("design:type", String)
], VaPackageDropdownItemComponent.prototype, "description", void 0);
__decorate([
    Output(),
    __metadata("design:type", EventEmitter)
], VaPackageDropdownItemComponent.prototype, "itemToggled", void 0);
VaPackageDropdownItemComponent = __decorate([
    Component({
        selector: 'va-package-dropdown-item',
        template: "<mat-list-item [ngClass]=\"indent\" class=\"va-dropdown-list-item\">\n  <va-icon *ngIf=\"!secondaryIconUrl && !secondaryIconName; else dualIcon\" mat-list-avatar [name]=\"title\" [iconUrl]=\"iconUrl\" [diameter]=\"40\"></va-icon>\n  <h3 mat-line class=\"va-dropdown-list-item__title\">{{ title }}\n    <va-badge *ngIf=\"titleBadge\" small color=\"blue-solid\" class=\"va-dropdown-list-item__title-badge\">{{ titleBadge }}</va-badge>\n    <span *ngIf=\"titleDescriptor\" class=\"va-dropdown-list-item__title-descriptor\">{{ titleDescriptor }}</span>\n  </h3>\n  <p class=\"package-dropdown-font\" mat-line>{{subtitle}}</p>\n\n  <span *ngIf=\"!statusItem\" class=\"va-dropdown-list-item__layout\">\n    <p class=\"va-dropdown-list-item__layout va-dropdown-list-item__notice\">{{ description }}</p>\n    <ng-container *ngIf=\"enableDropdown; then dropdownButton\"></ng-container>\n  </span>\n\n  <span *ngIf=\"statusItem\" class=\"va-dropdown-list-item__layout va-dropdown-list-item__status\">\n    <div [ngClass]=\"{\n           'activated': isActivatedStatus(statusItem.status),\n           'warning': isWarningStatus(statusItem.status),\n           'error': isErrorStatus(statusItem.status)}\">\n      <mat-icon>{{statusItem.icon}}</mat-icon>\n    </div>\n    <p class=\"va-dropdown-list-item__notice\"\n       [ngClass]=\"{\n        'activated': isActivatedStatus(statusItem.status),\n        'warning': isWarningStatus(statusItem.status),\n        'error': isErrorStatus(statusItem.status)}\">\n      {{ statusItem.text | translate }}\n    </p>\n    <ng-container *ngIf=\"enableDropdown; then dropdownButton\"></ng-container>\n  </span>\n</mat-list-item>\n\n\n<ng-template #dropdownButton>\n  <button *ngIf=\"enableDropdown\" mat-icon-button type=\"button\" (click)=\"toggleItem()\">\n    <mat-icon mat-list-icon\n              class=\"dropdown-icon\"\n              [ngClass]=\"{'dropdown-icon-rotate-up': !toggleValue, 'dropdown-icon-rotate-down': toggleValue}\">\n      keyboard_arrow_down\n    </mat-icon>\n  </button>\n</ng-template>\n\n<ng-template #dualIcon>\n  <div class=\"dual-icon\">\n    <va-icon mat-list-avatar [iconUrl]=\"iconUrl\" [name]=\"title\" [diameter]=\"40\"></va-icon>\n    <va-icon mat-list-avatar class=\"secondary-icon\" [iconUrl]=\"secondaryIconUrl\" [diameter]=\"20\" [name]=\"secondaryIconName\"></va-icon>\n  </div>\n</ng-template>\n",
        styles: [".va-dropdown-list-item{border-bottom:1px solid rgba(0,0,0,.12)}mat-list-item .va-dropdown-list-item__title{font-weight:700}.va-dropdown-list-item__title-badge{padding-bottom:4px}.indent-one{padding-left:30px}.va-dropdown-list-item__title-descriptor{font-size:11px;font-weight:700;font-style:italic}.indent-two{padding-left:30px}.indent-two .mat-list-avatar{margin-left:40px}.dual-icon{position:relative;display:inline-block;order:-1;margin-right:16px}.dual-icon .secondary-icon{position:absolute;border-radius:50%;bottom:-24px;right:-24px}.va-dropdown-list-item__layout{display:flex;flex-direction:row;align-items:center}.va-dropdown-list-item__layout .va-dropdown-list-item__notice{width:-webkit-max-content;width:-moz-max-content;width:max-content;font-style:italic}@media screen and (max-width:500px){.va-dropdown-list-item__layout p{display:none}}.va-dropdown-list-item__layout mat-icon{padding:0}.va-dropdown-list-item__layout button{padding:0;min-width:0}.va-dropdown-list-item__layout button .dropdown-icon{color:rgba(0,0,0,.54)}.va-dropdown-list-item__layout button .dropdown-icon-rotate-down{transform:rotate(180deg);transition:.4s;pointer-events:none}.va-dropdown-list-item__layout button .dropdown-icon-rotate-up{transform:rotate(0);transition:.4s;pointer-events:none}.va-dropdown-list-item__status{display:flex;flex-direction:row;align-items:center}.va-dropdown-list-item__status p{padding-left:6px;font-size:14px;white-space:nowrap}.va-dropdown-list-item__status .activated{color:#4caf50}.va-dropdown-list-item__status .warning{color:#ffa000}.va-dropdown-list-item__status .error{color:#c62828}", ".package-dropdown-font,.product-dropdown-font{color:rgba(0,0,0,.54);font-size:14px;font-weight:400}.package-list-container{border-top:1px solid rgba(0,0,0,.12);padding:0}.package-list-container mat-list{padding:0}.package-dropdown-stencil-display{display:flex;width:100%;flex-grow:1}.package-dropdown-stencil-display va-icon{margin-right:20px}.package-dropdown-stencil-display .stencil-text{width:inherit;display:flex;flex-direction:column;justify-content:center}.package-dropdown-stencil-display .stencil-text .stencil-title{height:32px;width:40%;margin-bottom:5px!important;margin-top:0!important}.package-dropdown-stencil-display .stencil-text .stencil-tagline{height:32px;width:inherit}.product-or-addon-list{background-color:rgba(0,0,0,.04);overflow:hidden}"]
    })
], VaPackageDropdownItemComponent);
export { VaPackageDropdownItemComponent };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFja2FnZS1kcm9wZG93bi1pdGVtLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0B2ZW5kYXN0YS9zdG9yZS8iLCJzb3VyY2VzIjpbImxpYi9wYWNrYWdlLWRyb3Bkb3duL3BhY2thZ2UtZHJvcGRvd24taXRlbS9wYWNrYWdlLWRyb3Bkb3duLWl0ZW0uY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFFLFlBQVksRUFBRSxLQUFLLEVBQVUsTUFBTSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQy9FLE9BQU8sRUFBRSxnQkFBZ0IsRUFBMEIsTUFBTSxrQkFBa0IsQ0FBQztBQUU1RSxNQUFNLENBQU4sSUFBWSxVQUlYO0FBSkQsV0FBWSxVQUFVO0lBQ3BCLHlDQUEyQixDQUFBO0lBQzNCLHVDQUF5QixDQUFBO0lBQ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