import { __decorate, __metadata } from "tslib";
import { Component, EventEmitter, Input, Output } from '@angular/core';
import { Product } from '../../shared/product';
import { Addon } from '@vendasta/core/shared';
import { PriceDisplayMode } from '../editions-pricing/editions-pricing.component';
let ProductInfoComponent = class ProductInfoComponent {
    constructor() {
        this.showPricing = false;
        this.hasVerifiedContract = false;
        this.canAccessContractPricing = false;
        this.priceDisplayMode = PriceDisplayMode.Wholesale;
        this.addonSelected = new EventEmitter();
    }
    onAddonSelected(addonId) {
        this.addonSelected.emit(addonId);
    }
    getAddons() {
        if (!this.addons) {
            this.addons = this.product.addons.map((addon) => Addon.fromApi(addon));
        }
        return this.addons;
    }
};
__decorate([
    Input(),
    __metadata("design:type", Product)
], ProductInfoComponent.prototype, "product", void 0);
__decorate([
    Input(),
    __metadata("design:type", Object)
], ProductInfoComponent.prototype, "showPricing", void 0);
__decorate([
    Input(),
    __metadata("design:type", Object)
], ProductInfoComponent.prototype, "hasVerifiedContract", void 0);
__decorate([
    Input(),
    __metadata("design:type", Object)
], ProductInfoComponent.prototype, "canAccessContractPricing", void 0);
__decorate([
    Input(),
    __metadata("design:type", Object)
], ProductInfoComponent.prototype, "productPricing", void 0);
__decorate([
    Input(),
    __metadata("design:type", String)
], ProductInfoComponent.prototype, "businessCountryCode", void 0);
__decorate([
    Input(),
    __metadata("design:type", Array)
], ProductInfoComponent.prototype, "editionsPricing", void 0);
__decorate([
    Input(),
    __metadata("design:type", Number)
], ProductInfoComponent.prototype, "priceDisplayMode", void 0);
__decorate([
    Output(),
    __metadata("design:type", Object)
], ProductInfoComponent.prototype, "addonSelected", void 0);
ProductInfoComponent = __decorate([
    Component({
        selector: 'va-product-info',
        template: "<div class=\"product-content\">\n\t<div class=\"left-column\">\n\n\t\t<section *ngIf=\"product.description || product.keySellingPoints\">\n\t\t\t<mat-card>\n\t\t\t\t<va-selling-info\n\t\t\t\t\t[description]=\"product.description\"\n\t\t\t\t\t[keySellingPoints]=\"product.keySellingPoints\">\n\t\t\t\t</va-selling-info>\n\t\t\t</mat-card>\n\t\t</section>\n\n\t\t<section *ngIf=\"product.addons?.length > 0\">\n\t\t\t<mat-card>\n\t\t\t\t<h2 class=\"va-component-title\">{{ 'FRONTEND.STORE.ADD_ONS' | translate }}</h2>\n\t\t\t\t<va-addon-list\n\t\t\t\t\t(addonSelected)=\"onAddonSelected($event)\"\n\t\t\t\t\t[addons]=\"getAddons()\"\n\t\t\t\t\t[showPricing]=\"showPricing\"\n\t\t\t\t\t[hasVerifiedContract]=\"hasVerifiedContract\"\n\t\t\t\t\t[canAccessContractPricing]=\"canAccessContractPricing\"\n\t\t\t\t\t[partnerID]=\"product.partnerId\">\n\t\t\t\t</va-addon-list>\n\t\t\t</mat-card>\n\t\t</section>\n\n\t\t<section *ngIf=\"product.faqs?.length > 0\">\n\t\t\t<mat-card>\n\t\t\t\t<h2 class=\"va-component-title\">{{ 'FRONTEND.STORE.FAQS' | translate }}</h2>\n\t\t\t\t<va-faqs\n\t\t\t\t\t[faqs]=\"product.faqs\">\n\t\t\t\t</va-faqs>\n\t\t\t</mat-card>\n\t\t</section>\n\t</div>\n\n\t<div class=\"right-column\">\n\t\t<section *ngIf=\"!!productPricing\">\n\t\t\t<va-editions-pricing\n\t\t\t\t[product]=\"product\"\n\t\t\t\t[productPricing]=\"productPricing\"\n\t\t\t\t[editionsPricing]=\"editionsPricing\"\n\t\t\t\t[priceDisplayMode]=\"priceDisplayMode\"\n\t\t\t></va-editions-pricing>\n\t\t</section>\n\n\t\t<section >\n\t\t\t<mat-card>\n\t\t\t\t<h2 class=\"va-component-title\">{{ 'FRONTEND.STORE.AVAILABLE_IN' | translate }}</h2>\n\t\t\t\t<supported-countries-v2\n\t\t\t\t    [businessCountryCode] = \"businessCountryCode\"\n\t\t\t\t\t[countryCodes]=\"product.restrictions.country.whitelist\">\n\t\t\t\t</supported-countries-v2>\n\t\t\t</mat-card>\n\t\t</section>\n\n\t\t<section *ngIf=\"product.needHelp\">\n            <mat-card>\n                <h2 class=\"va-component-title\">{{ 'FRONTEND.STORE.NEED_HELP' | translate }}?</h2>\n                <need-help\n                    [needHelp]=\"product.needHelp\">\n                </need-help>\n            </mat-card>\n        </section>\n\t</div>\n</div>\n",
        styles: [":host{display:block;font-size:14px;line-height:1.4}:host *{box-sizing:border-box}section{padding:12px}.left-column{width:66%}@media screen and (max-width:600px){section{padding:8px 0 0}.left-column{width:100%}}.right-column{width:34%}.product-content{display:flex}@media screen and (max-width:600px){.right-column{width:100%}.product-content{flex-direction:column}}:host ::ng-deep .product-content img{width:100%;-o-object-fit:contain;object-fit:contain}.va-component-title{font-size:16px;font-weight:300;margin-top:0}"]
    })
], ProductInfoComponent);
export { ProductInfoComponent };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvZHVjdC1pbmZvLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0B2ZW5kYXN0YS9zdG9yZS8iLCJzb3VyY2VzIjpbImxpYi9wcm9kdWN0LWRldGFpbHMtdjIvcHJvZHVjdC1pbmZvL3Byb2R1Y3QtaW5mby5jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsWUFBWSxFQUFFLEtBQUssRUFBRSxNQUFNLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDdkUsT0FBTyxFQUFFLE9BQU8sRUFBRSxNQUFNLHNCQUFzQixDQUFDO0FBQy9DLE9BQU8sRUFBRSxLQUFLLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQUU5QyxPQUFPLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxnREFBZ0QsQ0FBQztBQU9sRixJQUFhLG9CQUFvQixHQUFqQyxNQUFhLG9CQUFvQjtJQUFqQztRQUVXLGdCQUFXLEdBQUcsS0FBSyxDQUFDO1FBQ3BCLHdCQUFtQixHQUFHLEtBQUssQ0FBQztRQUM1Qiw2QkFBd0IsR0FBR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