import { Component, EventEmitter, Input, Output } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "../summary-question-details/summary-question-details.component";
import * as i2 from "@angular/common";
export class SummaryQuestionComponent {
    constructor() {
        this.status = "";
        this.onUpdate = new EventEmitter();
        this.questions = [];
    }
    ngOnInit() {
        if (!this.isGroupSection) {
            this.data.groups.map((group) => {
                if (!group.isReferenced && group.isEnabled) {
                    group.questions.forEach((question) => {
                        if (!question.isReferenced && !question.isHidden) {
                            this.questions.push(question);
                        }
                    });
                }
            });
        }
        else {
            // find questions by section id
            if (this.data.groupedSections && this.data.groupedSections.length > 0) {
                this.data.groupedSections.forEach((sectionOnGroup) => {
                    let sectionFound = this.fullData.sections.find((section) => {
                        if (section.uuid === sectionOnGroup.sectionId) {
                            return section;
                        }
                    });
                    if (sectionFound) {
                        sectionFound.groups.map((group) => {
                            if (!group.isReferenced && group.isEnabled) {
                                group.questions.forEach((question) => {
                                    if (!question.isReferenced && !question.isHidden) {
                                        this.questions.push(question);
                                    }
                                });
                            }
                        });
                    }
                });
            }
        }
    }
    getQuestions() {
        return this.questions;
    }
    update(id) { this.onUpdate.emit(id); }
}
SummaryQuestionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: SummaryQuestionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
SummaryQuestionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.3", type: SummaryQuestionComponent, selector: "app-summary-question", inputs: { data: "data", fullData: "fullData", isGroupSection: "isGroupSection", status: "status" }, outputs: { onUpdate: "onUpdate" }, ngImport: i0, template: "<!-- <ion-card>\r\n  <ion-card-header>\r\n    <ion-card-title>{{data?.title}}</ion-card-title>\r\n    <div>\r\n      <ion-button *ngIf=\"data.correction\" (click)=\"update(data.uuid)\" size=\"small\">\r\n        <ion-icon \r\n          matTooltip=\"Esta secci\u00F3n tiene elementos por corregir\"\r\n          matTooltipPosition=\"above\"\r\n          style=\"color: #ef0f0f;\"\r\n          name=\"warning\"\r\n        ></ion-icon>\r\n      </ion-button>\r\n\r\n      <ion-button\r\n        (click)=\"update(data.uuid)\" \r\n        [disabled]=\"status != formEstatusEnum.fillingInProgress && status != formEstatusEnum.upgrade && status != formEstatusEnum.hasIssues\"\r\n        size=\"small\"\r\n      >\r\n        <ion-icon\r\n          matTooltip=\"Esta secci\u00F3n tiene elementos por corregir\"\r\n          matTooltipPosition=\"above\"\r\n          style=\"color: #ef0f0f;\"\r\n          name=\"create\"\r\n        ></ion-icon>\r\n      </ion-button>\r\n  </div>\r\n  </ion-card-header>\r\n\r\n  <ion-card-content>\r\n    <div style=\"text-align: justify;padding-bottom: 10px;\"><strong>{{data?.subheading}}</strong></div>\r\n    <div *ngFor=\"let group of data.groups\" class=\"form-row\"> \r\n      <div *ngIf=\"!group.isReferenced && group.isEnabled\">\r\n        <div *ngIf=\"group.title\" class=\"group-title-container\">\r\n          <label class=\"group-title\">{{group.title}}</label>\r\n        </div>\r\n        <div *ngFor=\"let question of group.questions\" class=\"form-row\">\r\n          \r\n          <div *ngIf=\"!question.isHidden && !question.isReferenced\">\r\n            <label *ngIf=\"question.inputType != 'File' && question.inputType != 'Table'\" class=\"cardInputLabel\">{{question.name}}</label>\r\n            <div *ngIf=\"question.inputType != 'File' && question.inputType != 'Table'\" appearance=\"outline\" style=\"width: 100%\">\r\n                <div *ngIf=\"question.inputType == 'Fecha'\" class=\"cardInputInLabel\">{{question.value | date}}</div>\r\n                <div *ngIf=\"question.inputType != 'Fecha'\" class=\"cardInputInLabel\">{{question.value}}</div>      \r\n            </div>\r\n            <div *ngIf=\"question.inputType == 'File'\" style=\"margin-bottom: 10px;\">\r\n              Pregunta tipo archivo\r\n            </div>\r\n\r\n            <div *ngIf=\"question.inputType == 'Table'\" style=\"margin-bottom: 10px;\">\r\n              Pregunta tipo Tabla\r\n            </div>\r\n          </div>\r\n\r\n        </div>\r\n      </div>\r\n    </div>\r\n  </ion-card-content>\r\n</ion-card> -->\r\n\r\n<div class=\"question-container\">\r\n  <div class=\"input-question\" *ngFor=\"let question of questions\">\r\n    <app-summary-question-details [question]=\"question\"></app-summary-question-details>\r\n  </div>\r\n</div>", styles: ["ion-label{font-weight:500;color:#000!important}.question-container{padding-left:15px;padding-right:15px;padding-bottom:10px}ion-item{border-bottom:1px solid #404040;--highlight-background: none}.item-interactive.item-has-focus{--highlight-background: transparent}.input-question{padding-bottom:5px}ion-input{font-weight:700}\n"], components: [{ type: i1.SummaryQuestionDetailsComponent, selector: "app-summary-question-details", inputs: ["question"] }], directives: [{ type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: SummaryQuestionComponent, decorators: [{
            type: Component,
            args: [{ selector: 'app-summary-question', template: "<!-- <ion-card>\r\n  <ion-card-header>\r\n    <ion-card-title>{{data?.title}}</ion-card-title>\r\n    <div>\r\n      <ion-button *ngIf=\"data.correction\" (click)=\"update(data.uuid)\" size=\"small\">\r\n        <ion-icon \r\n          matTooltip=\"Esta secci\u00F3n tiene elementos por corregir\"\r\n          matTooltipPosition=\"above\"\r\n          style=\"color: #ef0f0f;\"\r\n          name=\"warning\"\r\n        ></ion-icon>\r\n      </ion-button>\r\n\r\n      <ion-button\r\n        (click)=\"update(data.uuid)\" \r\n        [disabled]=\"status != formEstatusEnum.fillingInProgress && status != formEstatusEnum.upgrade && status != formEstatusEnum.hasIssues\"\r\n        size=\"small\"\r\n      >\r\n        <ion-icon\r\n          matTooltip=\"Esta secci\u00F3n tiene elementos por corregir\"\r\n          matTooltipPosition=\"above\"\r\n          style=\"color: #ef0f0f;\"\r\n          name=\"create\"\r\n        ></ion-icon>\r\n      </ion-button>\r\n  </div>\r\n  </ion-card-header>\r\n\r\n  <ion-card-content>\r\n    <div style=\"text-align: justify;padding-bottom: 10px;\"><strong>{{data?.subheading}}</strong></div>\r\n    <div *ngFor=\"let group of data.groups\" class=\"form-row\"> \r\n      <div *ngIf=\"!group.isReferenced && group.isEnabled\">\r\n        <div *ngIf=\"group.title\" class=\"group-title-container\">\r\n          <label class=\"group-title\">{{group.title}}</label>\r\n        </div>\r\n        <div *ngFor=\"let question of group.questions\" class=\"form-row\">\r\n          \r\n          <div *ngIf=\"!question.isHidden && !question.isReferenced\">\r\n            <label *ngIf=\"question.inputType != 'File' && question.inputType != 'Table'\" class=\"cardInputLabel\">{{question.name}}</label>\r\n            <div *ngIf=\"question.inputType != 'File' && question.inputType != 'Table'\" appearance=\"outline\" style=\"width: 100%\">\r\n                <div *ngIf=\"question.inputType == 'Fecha'\" class=\"cardInputInLabel\">{{question.value | date}}</div>\r\n                <div *ngIf=\"question.inputType != 'Fecha'\" class=\"cardInputInLabel\">{{question.value}}</div>      \r\n            </div>\r\n            <div *ngIf=\"question.inputType == 'File'\" style=\"margin-bottom: 10px;\">\r\n              Pregunta tipo archivo\r\n            </div>\r\n\r\n            <div *ngIf=\"question.inputType == 'Table'\" style=\"margin-bottom: 10px;\">\r\n              Pregunta tipo Tabla\r\n            </div>\r\n          </div>\r\n\r\n        </div>\r\n      </div>\r\n    </div>\r\n  </ion-card-content>\r\n</ion-card> -->\r\n\r\n<div class=\"question-container\">\r\n  <div class=\"input-question\" *ngFor=\"let question of questions\">\r\n    <app-summary-question-details [question]=\"question\"></app-summary-question-details>\r\n  </div>\r\n</div>", styles: ["ion-label{font-weight:500;color:#000!important}.question-container{padding-left:15px;padding-right:15px;padding-bottom:10px}ion-item{border-bottom:1px solid #404040;--highlight-background: none}.item-interactive.item-has-focus{--highlight-background: transparent}.input-question{padding-bottom:5px}ion-input{font-weight:700}\n"] }]
        }], ctorParameters: function () { return []; }, propDecorators: { data: [{
                type: Input
            }], fullData: [{
                type: Input
            }], isGroupSection: [{
                type: Input
            }], status: [{
                type: Input
            }], onUpdate: [{
                type: Output
            }] } });
//# sourceMappingURL=data:application/json;base64, 