import { ChangeDetectionStrategy, Component, EventEmitter, HostBinding, Input, Output, } from '@angular/core';
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
export class TimelineEntryComponent {
    constructor() {
        this.collapsed = false;
        this.expandClick = new EventEmitter();
    }
    get timelineTitle() {
        return this.collapsed ? _('common.expand-entries') : _('common.collapse-entries');
    }
    getIconShape() {
        if (this.iconShape) {
            return typeof this.iconShape === 'string' ? this.iconShape : this.iconShape[0];
        }
    }
    getIconClass() {
        if (this.iconShape) {
            return typeof this.iconShape === 'string' ? '' : this.iconShape[1];
        }
    }
}
TimelineEntryComponent.decorators = [
    { type: Component, args: [{
                selector: 'vdr-timeline-entry',
                template: "<div\r\n    [ngClass]=\"displayType\"\r\n    [class.has-custom-icon]=\"!!iconShape\"\r\n    class=\"entry\"\r\n    [class.last]=\"isLast === true\"\r\n    [class.collapsed]=\"collapsed\"\r\n>\r\n    <div class=\"timeline\" (click)=\"expandClick.emit()\" [title]=\"timelineTitle | translate\">\r\n        <div class=\"custom-icon\">\r\n            <clr-icon\r\n                *ngIf=\"iconShape && !collapsed\"\r\n                [attr.shape]=\"getIconShape()\"\r\n                [ngClass]=\"getIconClass()\"\r\n                size=\"24\"\r\n            ></clr-icon>\r\n        </div>\r\n    </div>\r\n    <div class=\"entry-body\">\r\n        <div class=\"detail\">\r\n            <div class=\"time\">\r\n                {{ createdAt | localeDate: 'short' }}\r\n            </div>\r\n            <div class=\"name\">\r\n                {{ name }}\r\n            </div>\r\n        </div>\r\n        <div [class.featured-entry]=\"featured\">\r\n            <ng-content></ng-content>\r\n        </div>\r\n    </div>\r\n</div>\r\n",
                changeDetection: ChangeDetectionStrategy.OnPush,
                styles: [":host{display:block}:host:first-of-type .timeline:before{border-left-color:var(--color-timeline-thread)}:host:first-of-type .entry-body{max-height:none}.entry{display:flex}.timeline{border-left:2px solid var(--color-timeline-thread);padding-bottom:8px;position:relative}.timeline:before{content:\"\";position:absolute;width:2px;height:32px;left:-2px;border-left:2px solid var(--color-timeline-thread)}.timeline:after{content:\"\";display:block;border-radius:50%;width:8px;height:8px;background-color:var(--color-component-bg-200);border:1px solid var(--color-component-border-300);position:absolute;left:-5px;top:32px;transition:top .2s;cursor:pointer}.timeline .custom-icon{position:absolute;width:32px;height:32px;left:-17px;top:32px;align-items:center;justify-content:center;border-radius:50%;color:var(--color-primary-600);background-color:var(--color-component-bg-100);border:1px solid var(--color-component-border-200);display:none}.entry.has-custom-icon .timeline:after{display:none}.entry.has-custom-icon .custom-icon{display:flex}.entry.last .timeline{border-left-color:transparent}.entry-body{flex:1;padding-top:24px;padding-left:12px;line-height:16px;margin-left:12px;color:var(--color-text-200);overflow:visible;max-height:100px;transition:max-height .2s,padding-top .2s,opacity .2s .2s}.featured-entry ::ng-deep .title{color:var(--color-text-100);font-size:16px;line-height:26px}.featured-entry ::ng-deep .note-text{color:var(--color-text-100);white-space:pre-wrap}.detail{display:flex;color:var(--color-text-300);font-size:12px}.detail .name{margin-left:12px}.muted .timeline,.muted .timeline .custom-icon{color:var(--color-text-300)}.success .timeline,.success .timeline .custom-icon{color:var(--color-success-400)}.success .timeline:after{background-color:var(--color-success-200);border:1px solid var(--color-success-400)}.error .timeline,.error .timeline .custom-icon{color:var(--color-error-400)}.error .timeline:after{background-color:var(--color-error-200);border:1px solid var(--color-error-400)}.warning .timeline,.warning .timeline .custom-icon{color:var(--color-warning-400)}.warning .timeline:after{background-color:var(--color-warning-200);border:1px solid var(--color-warning-400)}.collapsed .entry-body{max-height:0;overflow:hidden;opacity:0;padding-top:0}.collapsed .timeline{border-left-color:transparent}.collapsed .timeline:after{top:0}"]
            },] }
];
TimelineEntryComponent.propDecorators = {
    displayType: [{ type: Input }],
    createdAt: [{ type: Input }],
    name: [{ type: Input }],
    featured: [{ type: Input }],
    iconShape: [{ type: Input }],
    isLast: [{ type: Input }],
    collapsed: [{ type: HostBinding, args: ['class.collapsed',] }, { type: Input }],
    expandClick: [{ type: Output }]
};
//# sourceMappingURL=data:application/json;base64,eyJ2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