import { Component, Input } from '@angular/core';
import { Section } from '../../../forms/page/data-detail-view/section';
import { SectionType } from '../../../forms/page/common/widget-enums';
import { DetailViewType } from '../../../forms/page/common/detail-view-enums';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@angular/material/form-field";
import * as i3 from "../section/section.component";
import * as i4 from "@angular/material/expansion";
function SectionViewComponent_div_0_div_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 3);
    i0.ɵɵelementStart(1, "mat-label");
    i0.ɵɵtext(2);
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r2 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate(ctx_r2.section.title);
} }
function SectionViewComponent_div_0_ng_container_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelement(1, "app-section", 4);
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const ctx_r3 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("section", ctx_r3.section)("formObjectId", ctx_r3.formObjectId)("baseUrl", ctx_r3.baseUrl)("axonatorX1Url", ctx_r3.axonatorX1Url);
} }
function SectionViewComponent_div_0_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div");
    i0.ɵɵelementStart(1, "div", 1);
    i0.ɵɵtemplate(2, SectionViewComponent_div_0_div_2_Template, 3, 1, "div", 2);
    i0.ɵɵelementEnd();
    i0.ɵɵtemplate(3, SectionViewComponent_div_0_ng_container_3_Template, 2, 4, "ng-container", 0);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngIf", ctx_r0.section.showPrompt);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", ctx_r0.section.sections.length);
} }
function SectionViewComponent_mat_accordion_1_div_5_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 3);
    i0.ɵɵelementStart(1, "mat-label");
    i0.ɵɵtext(2);
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r4 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate(ctx_r4.section.title);
} }
function SectionViewComponent_mat_accordion_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "mat-accordion");
    i0.ɵɵelementStart(1, "mat-expansion-panel");
    i0.ɵɵelementStart(2, "mat-expansion-panel-header");
    i0.ɵɵelementStart(3, "mat-panel-title");
    i0.ɵɵelementStart(4, "div", 1);
    i0.ɵɵtemplate(5, SectionViewComponent_mat_accordion_1_div_5_Template, 3, 1, "div", 2);
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelement(6, "app-section", 4);
    i0.ɵɵelementEnd();
    i0.ɵɵelement(7, "mat-accordion");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵadvance(5);
    i0.ɵɵproperty("ngIf", ctx_r1.section.showPrompt);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("section", ctx_r1.section)("formObjectId", ctx_r1.formObjectId)("baseUrl", ctx_r1.baseUrl)("axonatorX1Url", ctx_r1.axonatorX1Url);
} }
export class SectionViewComponent {
    constructor() {
        this.sectionType = Object.assign({}, SectionType);
        this.detailViewType = Object.assign({}, DetailViewType);
    }
    ngOnInit() {
        this.section.isCollapsible = this.section.isCollapsible;
    }
    showBorder() {
        this.section.showPrompt = !this.section?.showPrompt;
        this.section.showBorder = !this.section?.showBorder;
    }
}
SectionViewComponent.ɵfac = function SectionViewComponent_Factory(t) { return new (t || SectionViewComponent)(); };
SectionViewComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SectionViewComponent, selectors: [["app-section-view"]], inputs: { section: "section", baseUrl: "baseUrl", formObjectId: "formObjectId", axonatorX1Url: "axonatorX1Url" }, decls: 2, vars: 2, consts: [[4, "ngIf"], [1, "data-detail"], ["class", "data-detail-title flex text-sm", 4, "ngIf"], [1, "data-detail-title", "flex", "text-sm"], [3, "section", "formObjectId", "baseUrl", "axonatorX1Url"]], template: function SectionViewComponent_Template(rf, ctx) { if (rf & 1) {
        i0.ɵɵtemplate(0, SectionViewComponent_div_0_Template, 4, 2, "div", 0);
        i0.ɵɵtemplate(1, SectionViewComponent_mat_accordion_1_Template, 8, 5, "mat-accordion", 0);
    } if (rf & 2) {
        i0.ɵɵproperty("ngIf", !ctx.section.isCollapsible);
        i0.ɵɵadvance(1);
        i0.ɵɵproperty("ngIf", ctx.section.isCollapsible);
    } }, directives: [i1.NgIf, i2.MatLabel, i3.SectionComponent, i4.MatAccordion, i4.MatExpansionPanel, i4.MatExpansionPanelHeader, i4.MatExpansionPanelTitle], styles: [""] });
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SectionViewComponent, [{
        type: Component,
        args: [{ selector: 'app-section-view', template: "\n<div *ngIf=\"!section.isCollapsible\" >\n    <div class=\"data-detail\">\n        <div class=\"data-detail-title flex text-sm\" *ngIf=\"section.showPrompt\">\n            <mat-label>{{section.title}}</mat-label>\n        </div>\n    </div>\n    <ng-container *ngIf=\"section.sections.length\">\n        <app-section  [section]=\"section\" [formObjectId] = \"formObjectId\" [baseUrl] =\"baseUrl\" [axonatorX1Url] =\"axonatorX1Url\"></app-section>\n    </ng-container>\n</div>\n<mat-accordion *ngIf=\"section.isCollapsible\">\n    <mat-expansion-panel>\n        <mat-expansion-panel-header>\n            <mat-panel-title>\n\n                <div class=\"data-detail\">\n                    <div class=\"data-detail-title flex text-sm\" *ngIf=\"section.showPrompt\">\n                        <mat-label>{{section.title}}</mat-label>\n                    </div>\n                </div>\n            </mat-panel-title>\n        </mat-expansion-panel-header>\n\n        <app-section [section]=\"section\" [formObjectId] = \"formObjectId\" [baseUrl] =\"baseUrl\" [axonatorX1Url] =\"axonatorX1Url\"></app-section>\n    </mat-expansion-panel>\n<mat-accordion>\n\n", styles: [""] }]
    }], function () { return []; }, { section: [{
            type: Input
        }], baseUrl: [{
            type: Input
        }], formObjectId: [{
            type: Input
        }], axonatorX1Url: [{
            type: Input
        }] }); })();
//# sourceMappingURL=data:application/json;base64, 