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 { RegisterClass } from '@memberjunction/global';
import { BaseFormComponent } from '@memberjunction/ng-base-forms';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@memberjunction/ng-user-view-grid";
import * as i3 from "@memberjunction/ng-base-forms";
import * as i4 from "@memberjunction/ng-form-toolbar";
function DataContextFormComponent_div_12_Template(rf, ctx) { if (rf & 1) {
    const _r1 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div")(1, "mj-user-view-grid", 15);
    i0.ɵɵlistener("dataLoaded", function DataContextFormComponent_div_12_Template_mj_user_view_grid_dataLoaded_1_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.SetSectionRowCount("dataContextItems", $event.totalRowCount)); });
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵadvance();
    i0.ɵɵproperty("Params", ctx_r1.BuildRelationshipViewParamsByEntityName("Data Context Items", "DataContextID"))("NewRecordValues", ctx_r1.NewRecordValues("Data Context Items"))("AllowLoad", ctx_r1.IsSectionExpanded("dataContextItems"))("EditMode", ctx_r1.GridEditMode());
} }
function DataContextFormComponent_div_14_Template(rf, ctx) { if (rf & 1) {
    const _r3 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div")(1, "mj-user-view-grid", 15);
    i0.ɵɵlistener("dataLoaded", function DataContextFormComponent_div_14_Template_mj_user_view_grid_dataLoaded_1_listener($event) { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.SetSectionRowCount("reports", $event.totalRowCount)); });
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵadvance();
    i0.ɵɵproperty("Params", ctx_r1.BuildRelationshipViewParamsByEntityName("Reports", "DataContextID"))("NewRecordValues", ctx_r1.NewRecordValues("Reports"))("AllowLoad", ctx_r1.IsSectionExpanded("reports"))("EditMode", ctx_r1.GridEditMode());
} }
function DataContextFormComponent_div_16_Template(rf, ctx) { if (rf & 1) {
    const _r4 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div")(1, "mj-user-view-grid", 15);
    i0.ɵɵlistener("dataLoaded", function DataContextFormComponent_div_16_Template_mj_user_view_grid_dataLoaded_1_listener($event) { i0.ɵɵrestoreView(_r4); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.SetSectionRowCount("conversations", $event.totalRowCount)); });
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵadvance();
    i0.ɵɵproperty("Params", ctx_r1.BuildRelationshipViewParamsByEntityName("Conversations", "DataContextID"))("NewRecordValues", ctx_r1.NewRecordValues("Conversations"))("AllowLoad", ctx_r1.IsSectionExpanded("conversations"))("EditMode", ctx_r1.GridEditMode());
} }
let DataContextFormComponent = class DataContextFormComponent extends BaseFormComponent {
    async ngOnInit() {
        await super.ngOnInit();
        this.initSections([
            { sectionKey: 'identifiers', sectionName: 'Identifiers', isExpanded: true },
            { sectionKey: 'contextDetails', sectionName: 'Context Details', isExpanded: true },
            { sectionKey: 'systemMetadata', sectionName: 'System Metadata', isExpanded: false },
            { sectionKey: 'dataContextItems', sectionName: 'Data Context Items', isExpanded: false },
            { sectionKey: 'reports', sectionName: 'Reports', isExpanded: false },
            { sectionKey: 'conversations', sectionName: 'Conversations', isExpanded: false }
        ]);
    }
    static { this.ɵfac = /*@__PURE__*/ (() => { let ɵDataContextFormComponent_BaseFactory; return function DataContextFormComponent_Factory(t) { return (ɵDataContextFormComponent_BaseFactory || (ɵDataContextFormComponent_BaseFactory = i0.ɵɵgetInheritedFactory(DataContextFormComponent)))(t || DataContextFormComponent); }; })(); }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: DataContextFormComponent, selectors: [["gen-datacontext-form"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 17, vars: 48, consts: [[3, "record", "formComponent"], ["slot", "field-panels", "sectionKey", "identifiers", "sectionName", "Identifiers", "icon", "fa fa-key", 3, "form", "formContext"], ["FieldName", "UserID", "Type", "textbox", "LinkType", "Record", "LinkComponentType", "Search", 3, "record", "ShowLabel", "EditMode", "formContext"], ["FieldName", "User", "Type", "textbox", 3, "record", "ShowLabel", "EditMode", "formContext"], ["slot", "field-panels", "sectionKey", "contextDetails", "sectionName", "Context Details", "icon", "fa fa-info-circle", 3, "form", "formContext"], ["FieldName", "Name", "Type", "textarea", 3, "record", "ShowLabel", "EditMode", "formContext"], ["FieldName", "Description", "Type", "textarea", 3, "record", "ShowLabel", "EditMode", "formContext"], ["FieldName", "LastRefreshedAt", "Type", "datepicker", 3, "record", "ShowLabel", "EditMode", "formContext"], ["slot", "field-panels", "sectionKey", "systemMetadata", "sectionName", "System Metadata", "icon", "fa fa-cog", 3, "form", "formContext"], ["FieldName", "__mj_CreatedAt", "Type", "textbox", 3, "record", "ShowLabel", "EditMode", "formContext"], ["FieldName", "__mj_UpdatedAt", "Type", "textbox", 3, "record", "ShowLabel", "EditMode", "formContext"], ["slot", "after-panels", "sectionKey", "dataContextItems", "sectionName", "Data Context Items", "icon", "fa fa-database", "variant", "related-entity", 3, "form", "formContext", "badgeCount"], [4, "ngIf"], ["slot", "after-panels", "sectionKey", "reports", "sectionName", "Reports", "icon", "fa-solid fa-chart-line", "variant", "related-entity", 3, "form", "formContext", "badgeCount"], ["slot", "after-panels", "sectionKey", "conversations", "sectionName", "Conversations", "icon", "fa-regular fa-comments", "variant", "related-entity", 3, "form", "formContext", "badgeCount"], [3, "dataLoaded", "Params", "NewRecordValues", "AllowLoad", "EditMode"]], template: function DataContextFormComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "mj-record-form-container", 0)(1, "mj-collapsible-panel", 1);
            i0.ɵɵelement(2, "mj-form-field", 2)(3, "mj-form-field", 3);
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(4, "mj-collapsible-panel", 4);
            i0.ɵɵelement(5, "mj-form-field", 5)(6, "mj-form-field", 6)(7, "mj-form-field", 7);
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(8, "mj-collapsible-panel", 8);
            i0.ɵɵelement(9, "mj-form-field", 9)(10, "mj-form-field", 10);
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(11, "mj-collapsible-panel", 11);
            i0.ɵɵtemplate(12, DataContextFormComponent_div_12_Template, 2, 4, "div", 12);
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(13, "mj-collapsible-panel", 13);
            i0.ɵɵtemplate(14, DataContextFormComponent_div_14_Template, 2, 4, "div", 12);
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(15, "mj-collapsible-panel", 14);
            i0.ɵɵtemplate(16, DataContextFormComponent_div_16_Template, 2, 4, "div", 12);
            i0.ɵɵelementEnd()();
        } if (rf & 2) {
            i0.ɵɵproperty("record", ctx.record)("formComponent", ctx);
            i0.ɵɵadvance();
            i0.ɵɵproperty("form", ctx)("formContext", ctx.formContext);
            i0.ɵɵadvance();
            i0.ɵɵproperty("record", ctx.record)("ShowLabel", true)("EditMode", ctx.EditMode)("formContext", ctx.formContext);
            i0.ɵɵadvance();
            i0.ɵɵproperty("record", ctx.record)("ShowLabel", true)("EditMode", ctx.EditMode)("formContext", ctx.formContext);
            i0.ɵɵadvance();
            i0.ɵɵproperty("form", ctx)("formContext", ctx.formContext);
            i0.ɵɵadvance();
            i0.ɵɵproperty("record", ctx.record)("ShowLabel", true)("EditMode", ctx.EditMode)("formContext", ctx.formContext);
            i0.ɵɵadvance();
            i0.ɵɵproperty("record", ctx.record)("ShowLabel", true)("EditMode", ctx.EditMode)("formContext", ctx.formContext);
            i0.ɵɵadvance();
            i0.ɵɵproperty("record", ctx.record)("ShowLabel", true)("EditMode", ctx.EditMode)("formContext", ctx.formContext);
            i0.ɵɵadvance();
            i0.ɵɵproperty("form", ctx)("formContext", ctx.formContext);
            i0.ɵɵadvance();
            i0.ɵɵproperty("record", ctx.record)("ShowLabel", true)("EditMode", ctx.EditMode)("formContext", ctx.formContext);
            i0.ɵɵadvance();
            i0.ɵɵproperty("record", ctx.record)("ShowLabel", true)("EditMode", ctx.EditMode)("formContext", ctx.formContext);
            i0.ɵɵadvance();
            i0.ɵɵproperty("form", ctx)("formContext", ctx.formContext)("badgeCount", ctx.GetSectionRowCount("dataContextItems"));
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngIf", ctx.record.IsSaved);
            i0.ɵɵadvance();
            i0.ɵɵproperty("form", ctx)("formContext", ctx.formContext)("badgeCount", ctx.GetSectionRowCount("reports"));
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngIf", ctx.record.IsSaved);
            i0.ɵɵadvance();
            i0.ɵɵproperty("form", ctx)("formContext", ctx.formContext)("badgeCount", ctx.GetSectionRowCount("conversations"));
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngIf", ctx.record.IsSaved);
        } }, dependencies: [i1.NgIf, i2.UserViewGridComponent, i3.MJFormField, i3.CollapsiblePanelComponent, i4.RecordFormContainerComponent], encapsulation: 2 }); }
};
DataContextFormComponent = __decorate([
    RegisterClass(BaseFormComponent, 'Data Contexts') // Tell MemberJunction about this class
], DataContextFormComponent);
export { DataContextFormComponent };
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DataContextFormComponent, [{
        type: Component,
        args: [{ selector: 'gen-datacontext-form', template: "<mj-record-form-container [record]=\"record\" [formComponent]=\"this\">\n\n    <!-- ========================================\n         FIELD PANELS\n         ======================================== -->\n    <!-- Identifiers Section -->\n    <mj-collapsible-panel slot=\"field-panels\"\n        sectionKey=\"identifiers\"\n        sectionName=\"Identifiers\"\n        icon=\"fa fa-key\"\n        [form]=\"this\"\n        [formContext]=\"formContext\">\n        <mj-form-field \n            [record]=\"record\"\n            [ShowLabel]=\"true\"\n            FieldName=\"UserID\"\n            Type=\"textbox\"\n            [EditMode]=\"EditMode\"\n            [formContext]=\"formContext\"\n            LinkType=\"Record\"\n            LinkComponentType=\"Search\"\n        ></mj-form-field>\n        <mj-form-field \n            [record]=\"record\"\n            [ShowLabel]=\"true\"\n            FieldName=\"User\"\n            Type=\"textbox\"\n            [EditMode]=\"EditMode\"\n            [formContext]=\"formContext\"\n        ></mj-form-field>\n\n    </mj-collapsible-panel>\n\n    <!-- Context Details Section -->\n    <mj-collapsible-panel slot=\"field-panels\"\n        sectionKey=\"contextDetails\"\n        sectionName=\"Context Details\"\n        icon=\"fa fa-info-circle\"\n        [form]=\"this\"\n        [formContext]=\"formContext\">\n        <mj-form-field \n            [record]=\"record\"\n            [ShowLabel]=\"true\"\n            FieldName=\"Name\"\n            Type=\"textarea\"\n            [EditMode]=\"EditMode\"\n            [formContext]=\"formContext\"\n        ></mj-form-field>\n        <mj-form-field \n            [record]=\"record\"\n            [ShowLabel]=\"true\"\n            FieldName=\"Description\"\n            Type=\"textarea\"\n            [EditMode]=\"EditMode\"\n            [formContext]=\"formContext\"\n        ></mj-form-field>\n        <mj-form-field \n            [record]=\"record\"\n            [ShowLabel]=\"true\"\n            FieldName=\"LastRefreshedAt\"\n            Type=\"datepicker\"\n            [EditMode]=\"EditMode\"\n            [formContext]=\"formContext\"\n        ></mj-form-field>\n\n    </mj-collapsible-panel>\n\n    <!-- System Metadata Section -->\n    <mj-collapsible-panel slot=\"field-panels\"\n        sectionKey=\"systemMetadata\"\n        sectionName=\"System Metadata\"\n        icon=\"fa fa-cog\"\n        [form]=\"this\"\n        [formContext]=\"formContext\">\n        <mj-form-field \n            [record]=\"record\"\n            [ShowLabel]=\"true\"\n            FieldName=\"__mj_CreatedAt\"\n            Type=\"textbox\"\n            [EditMode]=\"EditMode\"\n            [formContext]=\"formContext\"\n        ></mj-form-field>\n        <mj-form-field \n            [record]=\"record\"\n            [ShowLabel]=\"true\"\n            FieldName=\"__mj_UpdatedAt\"\n            Type=\"textbox\"\n            [EditMode]=\"EditMode\"\n            [formContext]=\"formContext\"\n        ></mj-form-field>\n\n    </mj-collapsible-panel>\n    <!-- ========================================\n         RELATED ENTITY PANELS - AFTER\n         ======================================== -->\n\n    <!-- Data Context Items Section -->\n    <mj-collapsible-panel slot=\"after-panels\"\n        sectionKey=\"dataContextItems\"\n        sectionName=\"Data Context Items\"\n        icon=\"fa fa-database\"\n        variant=\"related-entity\"\n        [form]=\"this\"\n        [formContext]=\"formContext\"\n        [badgeCount]=\"GetSectionRowCount('dataContextItems')\">\n        <div *ngIf=\"record.IsSaved\">\n            <mj-user-view-grid\n                [Params]=\"BuildRelationshipViewParamsByEntityName('Data Context Items','DataContextID')\"\n                [NewRecordValues]=\"NewRecordValues('Data Context Items')\"\n                [AllowLoad]=\"IsSectionExpanded('dataContextItems')\"\n                [EditMode]=\"GridEditMode()\"\n                (dataLoaded)=\"SetSectionRowCount('dataContextItems', $event.totalRowCount)\"\n                >\n            </mj-user-view-grid>\n        </div>\n    </mj-collapsible-panel>\n\n    <!-- Reports Section -->\n    <mj-collapsible-panel slot=\"after-panels\"\n        sectionKey=\"reports\"\n        sectionName=\"Reports\"\n        icon=\"fa-solid fa-chart-line\"\n        variant=\"related-entity\"\n        [form]=\"this\"\n        [formContext]=\"formContext\"\n        [badgeCount]=\"GetSectionRowCount('reports')\">\n        <div *ngIf=\"record.IsSaved\">\n            <mj-user-view-grid\n                [Params]=\"BuildRelationshipViewParamsByEntityName('Reports','DataContextID')\"\n                [NewRecordValues]=\"NewRecordValues('Reports')\"\n                [AllowLoad]=\"IsSectionExpanded('reports')\"\n                [EditMode]=\"GridEditMode()\"\n                (dataLoaded)=\"SetSectionRowCount('reports', $event.totalRowCount)\"\n                >\n            </mj-user-view-grid>\n        </div>\n    </mj-collapsible-panel>\n\n    <!-- Conversations Section -->\n    <mj-collapsible-panel slot=\"after-panels\"\n        sectionKey=\"conversations\"\n        sectionName=\"Conversations\"\n        icon=\"fa-regular fa-comments\"\n        variant=\"related-entity\"\n        [form]=\"this\"\n        [formContext]=\"formContext\"\n        [badgeCount]=\"GetSectionRowCount('conversations')\">\n        <div *ngIf=\"record.IsSaved\">\n            <mj-user-view-grid\n                [Params]=\"BuildRelationshipViewParamsByEntityName('Conversations','DataContextID')\"\n                [NewRecordValues]=\"NewRecordValues('Conversations')\"\n                [AllowLoad]=\"IsSectionExpanded('conversations')\"\n                [EditMode]=\"GridEditMode()\"\n                (dataLoaded)=\"SetSectionRowCount('conversations', $event.totalRowCount)\"\n                >\n            </mj-user-view-grid>\n        </div>\n    </mj-collapsible-panel>\n</mj-record-form-container>\n        " }]
    }], null, null); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(DataContextFormComponent, { className: "DataContextFormComponent", filePath: "src/lib/generated/Entities/DataContext/datacontext.form.component.ts", lineNumber: 12 }); })();
export function LoadDataContextFormComponent() {
    // does nothing, but called to prevent tree-shaking from eliminating this component from the build
}
//# sourceMappingURL=datacontext.form.component.js.map