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 { BaseFormSectionComponent } from '@memberjunction/ng-base-forms';
import { RegisterClass } from '@memberjunction/global';
import * as i0 from "@angular/core";
import * as i1 from "@memberjunction/ng-flow-editor";
function FlowAgentFormSectionComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
    const _r1 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "mj-flow-agent-editor", 2);
    i0.ɵɵlistener("FlowSaved", function FlowAgentFormSectionComponent_Conditional_0_Template_mj_flow_agent_editor_FlowSaved_0_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.OnFlowSaved()); })("FullScreenToggled", function FlowAgentFormSectionComponent_Conditional_0_Template_mj_flow_agent_editor_FullScreenToggled_0_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.OnFullScreenToggled($event)); });
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵproperty("AgentID", ctx_r1.AgentID)("EditMode", ctx_r1.EditMode)("FullScreen", ctx_r1.IsFullScreen);
} }
function FlowAgentFormSectionComponent_Conditional_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 1);
    i0.ɵɵelement(1, "i", 3);
    i0.ɵɵelementStart(2, "p");
    i0.ɵɵtext(3, "Save the agent first to configure the workflow.");
    i0.ɵɵelementEnd()();
} }
/**
 * Form section component for Flow Agent types.
 * Simply wraps the FlowAgentEditorComponent from @memberjunction/ng-flow-editor
 * and passes through the agent ID and edit mode.
 */
let FlowAgentFormSectionComponent = class FlowAgentFormSectionComponent extends BaseFormSectionComponent {
    get AgentID() {
        return this.record && 'ID' in this.record ? this.record.ID : null;
    }
    constructor(cdr) {
        super();
        this.cdr = cdr;
        /** Whether the flow editor is in full-screen mode */
        this.IsFullScreen = false;
    }
    OnFlowSaved() {
        // Trigger form dirty-state refresh if needed
        this.cdr.detectChanges();
    }
    OnFullScreenToggled(fullScreen) {
        this.IsFullScreen = fullScreen;
        this.cdr.detectChanges();
    }
    static { this.ɵfac = function FlowAgentFormSectionComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || FlowAgentFormSectionComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); }; }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: FlowAgentFormSectionComponent, selectors: [["mj-flow-agent-form-section"]], standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 2, vars: 1, consts: [[3, "AgentID", "EditMode", "FullScreen"], [1, "flow-empty-state"], [3, "FlowSaved", "FullScreenToggled", "AgentID", "EditMode", "FullScreen"], [1, "fa-solid", "fa-info-circle"]], template: function FlowAgentFormSectionComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵconditionalCreate(0, FlowAgentFormSectionComponent_Conditional_0_Template, 1, 3, "mj-flow-agent-editor", 0)(1, FlowAgentFormSectionComponent_Conditional_1_Template, 4, 0, "div", 1);
        } if (rf & 2) {
            i0.ɵɵconditional(ctx.AgentID ? 0 : 1);
        } }, dependencies: [i1.FlowAgentEditorComponent], styles: ["\n\n[_nghost-%COMP%] {\n    display: block;\n    width: 100%;\n    height: 100%;\n}\n\nmj-flow-agent-editor[_ngcontent-%COMP%] {\n    display: block;\n    width: 100%;\n    \n\n\n\n\n    height: calc(100vh - 300px);\n    min-height: 400px;\n}\n\n.flow-empty-state[_ngcontent-%COMP%] {\n    display: flex;\n    flex-direction: column;\n    align-items: center;\n    justify-content: center;\n    padding: 40px 20px;\n    text-align: center;\n    color: var(--mj-text-disabled);\n}\n\n.flow-empty-state[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n    font-size: 32px;\n    margin-bottom: 12px;\n    color: var(--mj-border-strong);\n}\n\n.flow-empty-state[_ngcontent-%COMP%]   p[_ngcontent-%COMP%] {\n    font-size: 14px;\n    margin: 0;\n}"] }); }
};
FlowAgentFormSectionComponent = __decorate([
    RegisterClass(BaseFormSectionComponent, 'AI Agents.FlowAgentSection')
], FlowAgentFormSectionComponent);
export { FlowAgentFormSectionComponent };
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FlowAgentFormSectionComponent, [{
        type: Component,
        args: [{ standalone: false, selector: 'mj-flow-agent-form-section', template: "@if (AgentID) {\n    <mj-flow-agent-editor\n        [AgentID]=\"AgentID\"\n        [EditMode]=\"EditMode\"\n        [FullScreen]=\"IsFullScreen\"\n        (FlowSaved)=\"OnFlowSaved()\"\n        (FullScreenToggled)=\"OnFullScreenToggled($event)\">\n    </mj-flow-agent-editor>\n} @else {\n    <div class=\"flow-empty-state\">\n        <i class=\"fa-solid fa-info-circle\"></i>\n        <p>Save the agent first to configure the workflow.</p>\n    </div>\n}\n", styles: ["/* Flow Agent Form Section - thin wrapper */\n:host {\n    display: block;\n    width: 100%;\n    height: 100%;\n}\n\nmj-flow-agent-editor {\n    display: block;\n    width: 100%;\n    /* Subtract the full stack of containers above:\n       form-toolbar (~40px) + agent-header (~75px) + form-content padding (24px)\n       + panelbar-item header (~52px) + panel-content padding (16px) + margins (~30px)\n       + browser chrome (~50px) \u2248 290px. Use 300px with a safety buffer. */\n    height: calc(100vh - 300px);\n    min-height: 400px;\n}\n\n.flow-empty-state {\n    display: flex;\n    flex-direction: column;\n    align-items: center;\n    justify-content: center;\n    padding: 40px 20px;\n    text-align: center;\n    color: var(--mj-text-disabled);\n}\n\n.flow-empty-state i {\n    font-size: 32px;\n    margin-bottom: 12px;\n    color: var(--mj-border-strong);\n}\n\n.flow-empty-state p {\n    font-size: 14px;\n    margin: 0;\n}\n"] }]
    }], () => [{ type: i0.ChangeDetectorRef }], null); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(FlowAgentFormSectionComponent, { className: "FlowAgentFormSectionComponent", filePath: "src/lib/custom/AIAgents/FlowAgentType/flow-agent-form-section.component.ts", lineNumber: 18 }); })();
//# sourceMappingURL=flow-agent-form-section.component.js.map