var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { Component } from '@angular/core';
import { ComponentHelper } from '../../classes/component-helper';
import { OptionsService } from '../../services/options.service';
import { ToastService } from '../../utils/toast.service';
let FaqsContentEcComponent = class FaqsContentEcComponent extends ComponentHelper {
    constructor(optionsService, toastr) {
        super();
        this.optionsService = optionsService;
        this.toastr = toastr;
        this.empty_faqs = false;
        this.changeFAQ = (new_index) => this.actual_index = new_index;
        this.ecOnConstruct();
    }
    ngOnInit() {
        this.optionsService.getFAQ().toPromise().then(faqs => {
            console.log('LAS FAQS; ', faqs);
            if (faqs.length > 0) {
                this.faqs = faqs;
                this.actual_index = 0;
            }
            else {
                this.empty_faqs = true;
            }
        }, error => {
            console.log(error);
            this.toastr.show('No fue posible encontrar la sección solicitada');
        }).catch(err => this.toastr.show('empty-faqs'));
        this.ecOnInit();
    }
};
FaqsContentEcComponent.ctorParameters = () => [
    { type: OptionsService },
    { type: ToastService }
];
FaqsContentEcComponent = __decorate([
    Component({
        selector: 'app-faqs-content-ec',
        template: "<section class=\"formulario container\" *ngIf=\"faqs; else loading\">\n\n    <div *ngIf=\"!empty_faqs; else emptyFaqsView\">\n        <div class=\"row w-100 mx-auto my-4 px-3 bb-s bt-md-s py-1\">\n            <strong>{{ 'FAQ' | translate }}</strong>\n        </div>\n\n        <div class=\"row w-100 m-auto\">\n            <div class=\"col-12 col-md-4 col-lg-3 col-xl-2\">\n                <div class=\"nav flex-column nav-pills\" id=\"v-pills-tab\" role=\"tablist\" aria-orientation=\"vertical\">\n                    <a [class]=\"'nav-link radius-0 text-dark bb-solid ' +  (i == 0 ? 'active' : '')\" data-toggle=\"pill\"\n                        role=\"tab\" [id]=\"'v-pills-tab-'+i\" [href]=\"'#v-pills-'+i\" [attr.data-bs-target]=\"'#v-pills-'+i\"\n                        *ngFor=\"let faq of faqs; let i = index\">{{ faq.title | translate }}</a>\n                </div>\n            </div>\n            <div class=\"col-12 col-md-8 col-lg-9 col-xl-10\">\n                <div class=\"tab-content mt-5 mt-md-0\" id=\"v-pills-tabContent\">\n                    <div [class]=\"'tab-pane fade ' +  (i == 0 ? 'show active' : '')\" role=\"tabpanel\"\n                        *ngFor=\"let faq of faqs; let i = index\" [id]=\"'v-pills-'+i\">\n                        <h3>{{ faq.title | translate }}</h3>\n                        <div *ngFor=\"let question of faq.questions\">\n                            <h5><strong>{{ question.question | translate }}</strong></h5>\n                            <p>{{ question.answer | translate }}</p>\n                        </div>\n                    </div>\n                </div>\n\n            </div>\n        </div>\n    </div>\n\n</section>\n\n<ng-template #loading>\n    <div class=\"container\">\n        <div class=\"row\">\n            <div class=\"col-12 align-items-center\">\n                <div class=\"d-flex flex-column jusitfy-content-center align-items-center my-5\">\n                    <app-loading-full-ec></app-loading-full-ec>\n                </div>\n            </div>\n        </div>\n    </div>\n</ng-template>\n\n<ng-template #emptyFaqsView>\n    <div>\n        {{ 'empty_faqs' | translate }}\n    </div>\n</ng-template>",
        styles: [".faqs-container{background-color:#fff;padding:0!important;min-height:60vh}"]
    })
], FaqsContentEcComponent);
export { FaqsContentEcComponent };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFxcy1jb250ZW50LWVjLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiJuZzovL25nLWVhc3ljb21tZXJjZS8iLCJzb3VyY2VzIjpbImxpYi9lYy1jb21wb25lbnQvZmFxcy1jb250ZW50LWVjL2ZhcXMtY29udGVudC1lYy5jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncy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cy1jb250ZW50LWVjLmNvbXBvbmVudC5odG1sJyxcbiAgICAgc3R5bGVVcmxzOiBbJ2ZhcXMtY29udGVudC1lYy5jb21wb25lbnQuc2NzcyddXG59KVxuZXhwb3J0IGNsYXNzIEZhcXNDb250ZW50RWNDb21wb25lbnQgZXh0ZW5kcyBDb21wb25lbnRIZWxwZXIgaW1wbGVtZW50cyBPbkluaXQge1xuXG4gICAgIHB1YmxpYyBmYXFzIDogRkFRW107XG4gICAgIHB1YmxpYyBhY3R1YWxfaW5kZXg7XG4gICAgIHB1YmxpYyBlbXB0eV9mYXFzID0gZmFsc2U7XG5cbiAgICAgY29uc3RydWN0b3IocHJvdGVjdGVkIG9wdGlvbnNTZXJ2aWNlOiBPcHRpb25zU2VydmljZSwgcHJvdGVjdGVkIHRvYXN0cjogVG9hc3RTZXJ2aWNlKSB7XG4gICAgICAgIHN1cGVyKCk7XG4gICAgICAgIHRoaXMuZWNPbkNvbnN0cnVjdCgpXG4gICAgIH1cblxuICAgICBuZ09uSW5pdCgpIHtcbiAgICAgICAgICB0aGlzLm9wdGlvbnNTZXJ2aWNlLmdldEZBUSgpLnRvUHJvbWlzZSgpLnRoZW4oXG4gICAgICAgICAgICAgICBmYXFzID0+IHtcbiAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coJ0xBUyBGQVFTOyAnLCBmYXFzKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGZhcXMubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuZmFxcyA9IGZhcXM7XG4gICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5hY3R1YWxfaW5kZXggPSAwO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuZW1wdHlfZmFxcyA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICBlcnJvciA9PiB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKGVycm9yKTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy50b2FzdHIuc2hvdygnTm8gZnVlIHBvc2libGUgZW5jb250cmFyIGxhIHNlY2Npw7NuIHNvbGljaXRhZGEnKTtcbiAgICAgICAgICAgICAgIH1cbiAgICAgICAgICApLmNhdGNoKGVyciA9PiB0aGlzLnRvYXN0ci5zaG93KCdlbXB0eS1mYXFzJykpOyAgICAgXG4gICAgICAgIHRoaXMuZWNPbkluaXQoKVxuXG4gICAgIH1cblxuICAgICBjaGFuZ2VGQVEgPSAobmV3X2luZGV4KSA9PiB0aGlzLmFjdHVhbF9pbmRleCA9IG5ld19pbmRleDtcbn0iXX0=