import { Component, Input } from '@angular/core';
import { PropertyType } from '@aztrix/models';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@aztrix/icons";
import * as i3 from "@aztrix/components/image-source";
import * as i4 from "@aztrix/helpers";
export class AgreementCellViewComponent {
    constructor() {
        this.noAvatar = false;
    }
    get agreementProperties() {
        return this.agreement?.agreementData?.agreementProperties || [];
    }
    get firstNameProperty() {
        return this.agreementProperties.find((prop) => prop?.property?.type === PropertyType.FIRST_NAME)
            ?.property;
    }
    get lastNameProperty() {
        return this.agreementProperties.find((prop) => prop?.property?.type === PropertyType.LAST_NAME)
            ?.property;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AgreementCellViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: AgreementCellViewComponent, selector: "ax-agreement-cell-view", inputs: { proposal: "proposal", agreement: "agreement", noAvatar: "noAvatar" }, ngImport: i0, template: "<ax-image-source\n  *ngIf=\"!noAvatar\"\n  class=\"proposal-icon\"\n  [source]=\"\n    proposal?.languages?.[0]?.avatar\n      ? 'staticFiles/avatars/' + proposal?.languages?.[0]?.avatar\n      : undefined\n  \"\n>\n  <ax-icon class=\"icon\" name=\"file-document-edit\"></ax-icon>\n</ax-image-source>\n<div class=\"middle\">\n  <div class=\"name\">\n    {{ firstNameProperty | propertyDisplayValue }}\n    {{ lastNameProperty | propertyDisplayValue }}\n  </div>\n  <div class=\"title\">\n    <ax-icon class=\"icon\" name=\"file-document-edit\"></ax-icon>\n    {{ proposal | displayName }}\n  </div>\n</div>\n<ng-content></ng-content>\n", styles: [":host{width:100%;display:grid;grid-template-columns:auto 1fr auto;height:48px;align-items:center;gap:.75rem}.middle{overflow:hidden}.proposal-icon{background-color:var(--primary-color-500);width:40px;height:40px}.name{font-weight:400;display:block;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;line-height:1.4;height:1.5rem;color:#363f48}.title{overflow:hidden;height:15px;white-space:nowrap;text-overflow:ellipsis;color:#7a8692;font-size:.75rem;font-weight:400;line-height:.75rem}.title .icon{width:12px;height:12px;vertical-align:text-bottom}\n", ".row-cell-view{gap:10px}.avatar-wrapper{width:40px;height:40px}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.IconComponent, selector: "ax-icon", inputs: ["name", "inline"] }, { kind: "component", type: i3.ImageSourceComponent, selector: "ax-image-source", inputs: ["source", "fallbackSource", "actualSize", "alt", "round", "rounded", "border"] }, { kind: "pipe", type: i4.PropertyDisplayValuePipe, name: "propertyDisplayValue" }, { kind: "pipe", type: i4.DisplayNamePipe, name: "displayName" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AgreementCellViewComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-agreement-cell-view', template: "<ax-image-source\n  *ngIf=\"!noAvatar\"\n  class=\"proposal-icon\"\n  [source]=\"\n    proposal?.languages?.[0]?.avatar\n      ? 'staticFiles/avatars/' + proposal?.languages?.[0]?.avatar\n      : undefined\n  \"\n>\n  <ax-icon class=\"icon\" name=\"file-document-edit\"></ax-icon>\n</ax-image-source>\n<div class=\"middle\">\n  <div class=\"name\">\n    {{ firstNameProperty | propertyDisplayValue }}\n    {{ lastNameProperty | propertyDisplayValue }}\n  </div>\n  <div class=\"title\">\n    <ax-icon class=\"icon\" name=\"file-document-edit\"></ax-icon>\n    {{ proposal | displayName }}\n  </div>\n</div>\n<ng-content></ng-content>\n", styles: [":host{width:100%;display:grid;grid-template-columns:auto 1fr auto;height:48px;align-items:center;gap:.75rem}.middle{overflow:hidden}.proposal-icon{background-color:var(--primary-color-500);width:40px;height:40px}.name{font-weight:400;display:block;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;line-height:1.4;height:1.5rem;color:#363f48}.title{overflow:hidden;height:15px;white-space:nowrap;text-overflow:ellipsis;color:#7a8692;font-size:.75rem;font-weight:400;line-height:.75rem}.title .icon{width:12px;height:12px;vertical-align:text-bottom}\n", ".row-cell-view{gap:10px}.avatar-wrapper{width:40px;height:40px}\n"] }]
        }], propDecorators: { proposal: [{
                type: Input
            }], agreement: [{
                type: Input
            }], noAvatar: [{
                type: Input
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWdyZWVtZW50LWNlbGwtdmlldy5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9saWJzL2NvbXBvbmVudHMvcm93LWNlbGwtdmlldy9hZ3JlZW1lbnQtY2VsbC12aWV3L2FncmVlbWVudC1jZWxsLXZpZXcuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9jb21wb25lbnRzL3Jvdy1jZWxsLXZpZXcvYWdyZWVtZW50LWNlbGwtdmlldy9hZ3JlZW1lbnQtY2VsbC12aWV3LmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBQyxTQUFTLEVBQUUsS0FBSyxFQUFDLE1BQU0sZUFBZSxDQUFDO0FBQy9DLE9BQU8sRUFBWSxZQUFZLEVBQUMsTUFBTSxnQkFBZ0IsQ0FBQzs7Ozs7O0FBUXZELE1BQU0sT0FBTywwQkFBMEI7SUFMdkM7UUFRVyxhQUFRLEdBQUcsS0FBSyxDQUFDO0tBZTNCO0lBYkMsSUFBSSxtQkFBbUI7UUFDckIsT0FBTyxJQUFJLENBQUMsU0FBUyxFQUFFLGFBQWEsRUFBRSxtQkFBbUIsSUFBSSxFQUFFLENBQUM7SUFDbEUsQ0FBQztJQUVELElBQUksaUJBQWlCO1FBQ25CLE9BQU8sSUFBSSxDQUFDLG1CQUFtQ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