import { ChangeDetectionStrategy, Component } from '@angular/core';
import { AddressFormats, subPropertyOfType } from '@aztrix/helpers';
import { AbstractPropertyValueViewComponent } from '../../abstract-property-value-view.component';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@angular/material/tooltip";
import * as i3 from "@aztrix/helpers";
export class AddressValueViewComponent extends AbstractPropertyValueViewComponent {
    get addressLineProperties() {
        return (AddressFormats.addressFormatForProperty(this.property).map((line) => line
            .map((lineInfo) => subPropertyOfType(this.property, lineInfo.propertyType))
            .filter((prop) => !!prop)));
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AddressValueViewComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: AddressValueViewComponent, selector: "ax-address-value-view", usesInheritance: true, ngImport: i0, template: "<div *ngIf=\"property | propertyHasValue; else empty\">\n  <div class=\"c-card__property\" *ngFor=\"let line of addressLineProperties; let first = first\">\n    <ng-container *ngIf=\"line | propertyDisplayValue as addressLine\">\n      <span>{{ addressLine }}</span>\n      <span\n        *ngIf=\"first && verificationColor()\"\n        [ngClass]=\"verificationColor()\"\n        matTooltip=\"{{ parentProperty || property | propertyVerificationLabel }}\"\n      ></span>\n    </ng-container>\n  </div>\n</div>\n\n<ng-template #empty>\n  {{ 'property.value.empty' | translate }}\n</ng-template>\n", styles: [".property-value{font-size:16px;font-weight:700}\n", ""], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "pipe", type: i3.PropertyDisplayValuePipe, name: "propertyDisplayValue" }, { kind: "pipe", type: i3.PropertyVerificationLabelPipe, name: "propertyVerificationLabel" }, { kind: "pipe", type: i3.PropertyHasValuePipe, name: "propertyHasValue" }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AddressValueViewComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-address-value-view', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div *ngIf=\"property | propertyHasValue; else empty\">\n  <div class=\"c-card__property\" *ngFor=\"let line of addressLineProperties; let first = first\">\n    <ng-container *ngIf=\"line | propertyDisplayValue as addressLine\">\n      <span>{{ addressLine }}</span>\n      <span\n        *ngIf=\"first && verificationColor()\"\n        [ngClass]=\"verificationColor()\"\n        matTooltip=\"{{ parentProperty || property | propertyVerificationLabel }}\"\n      ></span>\n    </ng-container>\n  </div>\n</div>\n\n<ng-template #empty>\n  {{ 'property.value.empty' | translate }}\n</ng-template>\n", styles: [".property-value{font-size:16px;font-weight:700}\n"] }]
        }] });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWRkcmVzcy12YWx1ZS12aWV3LmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvY29tcG9uZW50cy9wcm9wZXJ0eS12aWV3L2NvbW11bmljYXRpb24tdmFsdWUtdmlldy9hZGRyZXNzLXZhbHVlLXZpZXcvYWRkcmVzcy12YWx1ZS12aWV3LmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uLy4uLy4uLy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