import { Component, Input, ViewEncapsulation } from '@angular/core';
import { SectionType } from '../../../../forms/page/common/widget-enums';
import { SubForm } from '../../../../forms/page/widgets/sub-form';
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/icon";
import * as i3 from "../../section/section.component";
import * as i4 from "@angular/material/expansion";
function SubFormWidgetViewComponent_div_0_span_4_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span");
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r2 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate(ctx_r2.widget.prompt);
} }
function SubFormWidgetViewComponent_div_0_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div");
    i0.ɵɵelementStart(1, "div", 1);
    i0.ɵɵelementStart(2, "div", 2);
    i0.ɵɵelement(3, "mat-icon", 3);
    i0.ɵɵtemplate(4, SubFormWidgetViewComponent_div_0_span_4_Template, 2, 1, "span", 0);
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelement(5, "app-section", 4);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance(4);
    i0.ɵɵproperty("ngIf", ctx_r0.section.showPrompt);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("section", ctx_r0.section)("baseUrl", ctx_r0.baseUrl)("axonatorX1Url", ctx_r0.axonatorX1Url)("formObjectId", ctx_r0.formObjectId);
} }
function SubFormWidgetViewComponent_mat_accordion_1_Template(rf, ctx) { if (rf & 1) {
    const _r4 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "mat-accordion");
    i0.ɵɵelementStart(1, "mat-expansion-panel", 5);
    i0.ɵɵelementStart(2, "mat-expansion-panel-header", 6);
    i0.ɵɵlistener("click", function SubFormWidgetViewComponent_mat_accordion_1_Template_mat_expansion_panel_header_click_2_listener() { i0.ɵɵrestoreView(_r4); const ctx_r3 = i0.ɵɵnextContext(); return ctx_r3.panelOpenState = !ctx_r3.panelOpenState; });
    i0.ɵɵelementStart(3, "mat-panel-title");
    i0.ɵɵelementStart(4, "div", 1);
    i0.ɵɵelementStart(5, "div", 7);
    i0.ɵɵelement(6, "mat-icon", 3);
    i0.ɵɵtext(7);
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelement(8, "app-section", 4);
    i0.ɵɵelementEnd();
    i0.ɵɵelement(9, "mat-accordion");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("expanded", ctx_r1.panelOpenState);
    i0.ɵɵadvance(6);
    i0.ɵɵtextInterpolate1(" ", ctx_r1.widget.prompt, "");
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("section", ctx_r1.section)("baseUrl", ctx_r1.baseUrl)("axonatorX1Url", ctx_r1.axonatorX1Url)("formObjectId", ctx_r1.formObjectId);
} }
export class SubFormWidgetViewComponent {
    constructor() {
        this.sectionType = Object.assign({}, SectionType);
        this.detailViewType = Object.assign({}, DetailViewType);
        this.panelOpenState = false;
    }
    ngOnInit() {
        this.section.isCollapsible = this.section.isCollapsible;
        this.section.sections = this.section.sections;
    }
    toggleAccordion(accordionToggle) {
        this.section.isCollapsible = accordionToggle.ariaExpanded === 'true';
    }
}
SubFormWidgetViewComponent.ɵfac = function SubFormWidgetViewComponent_Factory(t) { return new (t || SubFormWidgetViewComponent)(); };
SubFormWidgetViewComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SubFormWidgetViewComponent, selectors: [["lib-sub-form-widget-view"]], inputs: { widget: "widget" }, decls: 2, vars: 2, consts: [[4, "ngIf"], [1, "data-detail-info"], [1, "sub-form-title", "flex", "items-center", "text-sm", "gap-4", "mb-4"], ["svgIcon", "axo_subform", 1, "add-text"], [3, "section", "baseUrl", "axonatorX1Url", "formObjectId"], ["id", "mat-expansion-panel", 1, "border-1", 3, "expanded"], [3, "click"], [1, "data-detail-title", "flex", "text-sm"]], template: function SubFormWidgetViewComponent_Template(rf, ctx) { if (rf & 1) {
        i0.ɵɵtemplate(0, SubFormWidgetViewComponent_div_0_Template, 6, 5, "div", 0);
        i0.ɵɵtemplate(1, SubFormWidgetViewComponent_mat_accordion_1_Template, 10, 6, "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.MatIcon, i3.SectionComponent, i4.MatAccordion, i4.MatExpansionPanel, i4.MatExpansionPanelHeader, i4.MatExpansionPanelTitle], styles: ["lib-sub-form-widget-view .accordion .records-connection-line{position:absolute;left:4.1rem;height:calc(100% - 16px);border-left:1px solid;width:2px}lib-sub-form-widget-view .accordion .accordion-header{background:#FAFBFC}lib-sub-form-widget-view .accordion .accordion-header .child-expand-icon{width:1.2rem}lib-sub-form-widget-view .accordion .accordion-header .child-expanded-icon{width:1.2rem;position:relative;left:.15rem;bottom:-1.5rem}lib-sub-form-widget-view .accordion .expand-button{position:absolute;bottom:.45rem;left:3.5rem}lib-sub-form-widget-view .mat-expansion-panel-header-title{display:flex!important;height:3rem;align-items:center}lib-sub-form-widget-view #mat-expansion-panel{border:1px solid #dcdcdc75;box-shadow:none!important;transition:1s;transition-delay:1s;margin-bottom:0}lib-sub-form-widget-view .mat-expansion-panel{background-color:transparent!important;overflow:visible}lib-sub-form-widget-view .mat-expansion-panel .mat-expansion-panel-header{background:#ffffff;position:relative!important;height:auto!important}lib-sub-form-widget-view .mat-expansion-panel .mat-expansion-panel-header:hover{border-top-left-radius:10px;border-top-right-radius:10px;background:var(--page-bg-color)!important}lib-sub-form-widget-view .mat-expansion-panel .mat-expansion-panel-header.mat-expanded:hover{background:var(--page-bg-color)!important}@media screen and (max-width: 600px){lib-sub-form-widget-view .mat-expansion-panel .mat-expansion-panel-body{padding:0 .725rem}}lib-sub-form-widget-view .mat-expansion-panel .mat-expansion-panel-body{display:none}lib-sub-form-widget-view .mat-expanded{border-bottom-left-radius:0!important;border-bottom-right-radius:0!important}lib-sub-form-widget-view .mat-expanded .mat-expansion-panel-body{display:block;margin-top:.5rem;border-bottom-left-radius:10px;border-bottom-right-radius:10px}lib-sub-form-widget-view .mat-card{margin-bottom:0}@media only screen and (max-width: 768px){lib-sub-form-widget-view .mat-expansion-panel-body{padding:8px}}lib-sub-form-widget-view .mat-accordion .mat-expansion-panel:not(.mat-expanded) .mat-expansion-panel-header:not([aria-disabled=true]).cdk-keyboard-focused,lib-sub-form-widget-view .mat-accordion .mat-expansion-panel:not(.mat-expanded) .mat-expansion-panel-header:not([aria-disabled=true]).cdk-program-focused,lib-sub-form-widget-view .mat-expansion-panel-header.mat-expanded:focus,lib-sub-form-widget-view .mat-accordion .mat-expansion-panel:not(.mat-expanded) .mat-expansion-panel-header:not([aria-disabled=true]):hover{background:var(--page-bg-color)!important;border-radius:10px}\n"], encapsulation: 2 });
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SubFormWidgetViewComponent, [{
        type: Component,
        args: [{ selector: 'lib-sub-form-widget-view', encapsulation: ViewEncapsulation.None, template: "<div *ngIf=\"!section.isCollapsible\"  >\n    <div class=\"data-detail-info\">\n        <div class=\"sub-form-title flex items-center text-sm gap-4 mb-4\"><mat-icon class=\"add-text\" svgIcon=\"axo_subform\"></mat-icon> <span *ngIf=\"section.showPrompt\">{{widget.prompt}}</span>\n    </div>\n</div>\n<app-section   [section]=\"section\" [baseUrl] =\"baseUrl\" [axonatorX1Url] =\"axonatorX1Url\" [formObjectId]=\"formObjectId\" ></app-section>\n</div>\n\n<mat-accordion *ngIf=\"section.isCollapsible\" >\n    <mat-expansion-panel  class=\"border-1\" id=\"mat-expansion-panel\" [expanded]=\"panelOpenState\">\n    <mat-expansion-panel-header (click)=\"panelOpenState = !panelOpenState\" >\n        <mat-panel-title>\n            <div class=\"data-detail-info\">\n                <div class=\"data-detail-title flex text-sm\"><mat-icon class=\"add-text\" svgIcon=\"axo_subform\"></mat-icon> {{widget.prompt}}</div>\n            </div>\n        </mat-panel-title>\n    </mat-expansion-panel-header>\n    <app-section  [section]=\"section\"  [baseUrl] =\"baseUrl\" [axonatorX1Url] =\"axonatorX1Url\" [formObjectId]=\"formObjectId\"></app-section>\n    </mat-expansion-panel>\n<mat-accordion>\n\n", styles: ["lib-sub-form-widget-view .accordion .records-connection-line{position:absolute;left:4.1rem;height:calc(100% - 16px);border-left:1px solid;width:2px}lib-sub-form-widget-view .accordion .accordion-header{background:#FAFBFC}lib-sub-form-widget-view .accordion .accordion-header .child-expand-icon{width:1.2rem}lib-sub-form-widget-view .accordion .accordion-header .child-expanded-icon{width:1.2rem;position:relative;left:.15rem;bottom:-1.5rem}lib-sub-form-widget-view .accordion .expand-button{position:absolute;bottom:.45rem;left:3.5rem}lib-sub-form-widget-view .mat-expansion-panel-header-title{display:flex!important;height:3rem;align-items:center}lib-sub-form-widget-view #mat-expansion-panel{border:1px solid #dcdcdc75;box-shadow:none!important;transition:1s;transition-delay:1s;margin-bottom:0}lib-sub-form-widget-view .mat-expansion-panel{background-color:transparent!important;overflow:visible}lib-sub-form-widget-view .mat-expansion-panel .mat-expansion-panel-header{background:#ffffff;position:relative!important;height:auto!important}lib-sub-form-widget-view .mat-expansion-panel .mat-expansion-panel-header:hover{border-top-left-radius:10px;border-top-right-radius:10px;background:var(--page-bg-color)!important}lib-sub-form-widget-view .mat-expansion-panel .mat-expansion-panel-header.mat-expanded:hover{background:var(--page-bg-color)!important}@media screen and (max-width: 600px){lib-sub-form-widget-view .mat-expansion-panel .mat-expansion-panel-body{padding:0 .725rem}}lib-sub-form-widget-view .mat-expansion-panel .mat-expansion-panel-body{display:none}lib-sub-form-widget-view .mat-expanded{border-bottom-left-radius:0!important;border-bottom-right-radius:0!important}lib-sub-form-widget-view .mat-expanded .mat-expansion-panel-body{display:block;margin-top:.5rem;border-bottom-left-radius:10px;border-bottom-right-radius:10px}lib-sub-form-widget-view .mat-card{margin-bottom:0}@media only screen and (max-width: 768px){lib-sub-form-widget-view .mat-expansion-panel-body{padding:8px}}lib-sub-form-widget-view .mat-accordion .mat-expansion-panel:not(.mat-expanded) .mat-expansion-panel-header:not([aria-disabled=true]).cdk-keyboard-focused,lib-sub-form-widget-view .mat-accordion .mat-expansion-panel:not(.mat-expanded) .mat-expansion-panel-header:not([aria-disabled=true]).cdk-program-focused,lib-sub-form-widget-view .mat-expansion-panel-header.mat-expanded:focus,lib-sub-form-widget-view .mat-accordion .mat-expansion-panel:not(.mat-expanded) .mat-expansion-panel-header:not([aria-disabled=true]):hover{background:var(--page-bg-color)!important;border-radius:10px}\n"] }]
    }], function () { return []; }, { widget: [{
            type: Input
        }] }); })();
//# sourceMappingURL=data:application/json;base64, 