import { Component, Input, Output, EventEmitter } from '@angular/core';
import { Metadata, RunView } from '@memberjunction/core';
import { MJNotificationService } from '@memberjunction/ng-notifications';
import * as i0 from "@angular/core";
import * as i1 from "@angular/forms";
import * as i2 from "@progress/kendo-angular-layout";
import * as i3 from "@progress/kendo-angular-dialog";
import * as i4 from "@progress/kendo-angular-inputs";
import * as i5 from "@progress/kendo-angular-buttons";
function TemplateParamDialogComponent_Conditional_0_Conditional_12_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 7);
    i0.ɵɵelement(1, "i", 14);
    i0.ɵɵelementStart(2, "span");
    i0.ɵɵtext(3, "Loading template parameters...");
    i0.ɵɵelementEnd()();
} }
function TemplateParamDialogComponent_Conditional_0_Conditional_13_ng_template_1_Conditional_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 29);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext(4);
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate1(" ", ctx_r1.parameters.length, " ");
} }
function TemplateParamDialogComponent_Conditional_0_Conditional_13_ng_template_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 28);
    i0.ɵɵelement(1, "i", 5);
    i0.ɵɵtext(2, " Template Parameters ");
    i0.ɵɵconditionalCreate(3, TemplateParamDialogComponent_Conditional_0_Conditional_13_ng_template_1_Conditional_3_Template, 2, 1, "span", 29);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext(3);
    i0.ɵɵadvance(3);
    i0.ɵɵconditional(ctx_r1.parameters.length > 0 ? 3 : -1);
} }
function TemplateParamDialogComponent_Conditional_0_Conditional_13_Conditional_6_For_9_Conditional_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "i", 37);
} }
function TemplateParamDialogComponent_Conditional_0_Conditional_13_Conditional_6_For_9_Conditional_4_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "i", 38);
} }
function TemplateParamDialogComponent_Conditional_0_Conditional_13_Conditional_6_For_9_Conditional_5_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 39);
    i0.ɵɵtext(1, "*");
    i0.ɵɵelementEnd();
} }
function TemplateParamDialogComponent_Conditional_0_Conditional_13_Conditional_6_For_9_Conditional_6_Conditional_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 46);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const param_r6 = i0.ɵɵnextContext(2).$implicit;
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate1(" ", param_r6.description, " ");
} }
function TemplateParamDialogComponent_Conditional_0_Conditional_13_Conditional_6_For_9_Conditional_6_Conditional_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 47);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const param_r6 = i0.ɵɵnextContext(2).$implicit;
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate1(" Type: ", param_r6.type, " ");
} }
function TemplateParamDialogComponent_Conditional_0_Conditional_13_Conditional_6_For_9_Conditional_6_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 45);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
    i0.ɵɵconditionalCreate(2, TemplateParamDialogComponent_Conditional_0_Conditional_13_Conditional_6_For_9_Conditional_6_Conditional_2_Template, 2, 1, "div", 46);
    i0.ɵɵconditionalCreate(3, TemplateParamDialogComponent_Conditional_0_Conditional_13_Conditional_6_For_9_Conditional_6_Conditional_3_Template, 2, 1, "div", 47);
} if (rf & 2) {
    const param_r6 = i0.ɵɵnextContext().$implicit;
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate1(" ", param_r6.key, " ");
    i0.ɵɵadvance();
    i0.ɵɵconditional(param_r6.description ? 2 : -1);
    i0.ɵɵadvance();
    i0.ɵɵconditional(param_r6.type && param_r6.type !== "Scalar" ? 3 : -1);
} }
function TemplateParamDialogComponent_Conditional_0_Conditional_13_Conditional_6_For_9_Conditional_7_Template(rf, ctx) { if (rf & 1) {
    const _r7 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "kendo-textbox", 48);
    i0.ɵɵtwoWayListener("ngModelChange", function TemplateParamDialogComponent_Conditional_0_Conditional_13_Conditional_6_For_9_Conditional_7_Template_kendo_textbox_ngModelChange_0_listener($event) { i0.ɵɵrestoreView(_r7); const param_r6 = i0.ɵɵnextContext().$implicit; i0.ɵɵtwoWayBindingSet(param_r6.key, $event) || (param_r6.key = $event); return i0.ɵɵresetView($event); });
    i0.ɵɵlistener("ngModelChange", function TemplateParamDialogComponent_Conditional_0_Conditional_13_Conditional_6_For_9_Conditional_7_Template_kendo_textbox_ngModelChange_0_listener() { i0.ɵɵrestoreView(_r7); const ctx_r1 = i0.ɵɵnextContext(5); return i0.ɵɵresetView(ctx_r1.onParameterChange()); });
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const param_r6 = i0.ɵɵnextContext().$implicit;
    const ctx_r1 = i0.ɵɵnextContext(4);
    i0.ɵɵtwoWayProperty("ngModel", param_r6.key);
    i0.ɵɵproperty("disabled", ctx_r1.isRunning);
} }
function TemplateParamDialogComponent_Conditional_0_Conditional_13_Conditional_6_For_9_Conditional_11_Template(rf, ctx) { if (rf & 1) {
    const _r8 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "button", 49);
    i0.ɵɵlistener("click", function TemplateParamDialogComponent_Conditional_0_Conditional_13_Conditional_6_For_9_Conditional_11_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r8); const ɵ$index_65_r9 = i0.ɵɵnextContext().$index; const ctx_r1 = i0.ɵɵnextContext(4); return i0.ɵɵresetView(ctx_r1.removeParameter(ɵ$index_65_r9)); });
    i0.ɵɵelement(1, "i", 50);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext(5);
    i0.ɵɵproperty("disabled", ctx_r1.isRunning);
} }
function TemplateParamDialogComponent_Conditional_0_Conditional_13_Conditional_6_For_9_Template(rf, ctx) { if (rf & 1) {
    const _r5 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 31)(1, "div", 35)(2, "div", 36);
    i0.ɵɵconditionalCreate(3, TemplateParamDialogComponent_Conditional_0_Conditional_13_Conditional_6_For_9_Conditional_3_Template, 1, 0, "i", 37)(4, TemplateParamDialogComponent_Conditional_0_Conditional_13_Conditional_6_For_9_Conditional_4_Template, 1, 0, "i", 38);
    i0.ɵɵconditionalCreate(5, TemplateParamDialogComponent_Conditional_0_Conditional_13_Conditional_6_For_9_Conditional_5_Template, 2, 0, "span", 39);
    i0.ɵɵelementEnd();
    i0.ɵɵconditionalCreate(6, TemplateParamDialogComponent_Conditional_0_Conditional_13_Conditional_6_For_9_Conditional_6_Template, 4, 3)(7, TemplateParamDialogComponent_Conditional_0_Conditional_13_Conditional_6_For_9_Conditional_7_Template, 1, 2, "kendo-textbox", 40);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(8, "div", 41)(9, "kendo-textarea", 42);
    i0.ɵɵtwoWayListener("ngModelChange", function TemplateParamDialogComponent_Conditional_0_Conditional_13_Conditional_6_For_9_Template_kendo_textarea_ngModelChange_9_listener($event) { const param_r6 = i0.ɵɵrestoreView(_r5).$implicit; i0.ɵɵtwoWayBindingSet(param_r6.value, $event) || (param_r6.value = $event); return i0.ɵɵresetView($event); });
    i0.ɵɵlistener("ngModelChange", function TemplateParamDialogComponent_Conditional_0_Conditional_13_Conditional_6_For_9_Template_kendo_textarea_ngModelChange_9_listener() { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(4); return i0.ɵɵresetView(ctx_r1.onParameterChange()); });
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(10, "div", 43);
    i0.ɵɵconditionalCreate(11, TemplateParamDialogComponent_Conditional_0_Conditional_13_Conditional_6_For_9_Conditional_11_Template, 2, 1, "button", 44);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const param_r6 = ctx.$implicit;
    const ctx_r1 = i0.ɵɵnextContext(4);
    i0.ɵɵadvance(3);
    i0.ɵɵconditional(param_r6.isFromTemplate ? 3 : 4);
    i0.ɵɵadvance(2);
    i0.ɵɵconditional(param_r6.isRequired ? 5 : -1);
    i0.ɵɵadvance();
    i0.ɵɵconditional(param_r6.isFromTemplate ? 6 : 7);
    i0.ɵɵadvance(3);
    i0.ɵɵtwoWayProperty("ngModel", param_r6.value);
    i0.ɵɵproperty("rows", 2)("disabled", ctx_r1.isRunning);
    i0.ɵɵadvance(2);
    i0.ɵɵconditional(!param_r6.isFromTemplate && ctx_r1.parameters.length > 1 ? 11 : -1);
} }
function TemplateParamDialogComponent_Conditional_0_Conditional_13_Conditional_6_Template(rf, ctx) { if (rf & 1) {
    const _r4 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 20)(1, "div", 30)(2, "div");
    i0.ɵɵtext(3, "Parameter Name");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(4, "div");
    i0.ɵɵtext(5, "Value");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(6, "div");
    i0.ɵɵtext(7, "Actions");
    i0.ɵɵelementEnd()();
    i0.ɵɵrepeaterCreate(8, TemplateParamDialogComponent_Conditional_0_Conditional_13_Conditional_6_For_9_Template, 12, 7, "div", 31, i0.ɵɵrepeaterTrackByIndex);
    i0.ɵɵelementStart(10, "div", 32)(11, "button", 33);
    i0.ɵɵlistener("click", function TemplateParamDialogComponent_Conditional_0_Conditional_13_Conditional_6_Template_button_click_11_listener() { i0.ɵɵrestoreView(_r4); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.addParameter()); });
    i0.ɵɵelement(12, "i", 34);
    i0.ɵɵtext(13, " Add Parameter ");
    i0.ɵɵelementEnd()()();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext(3);
    i0.ɵɵadvance(8);
    i0.ɵɵrepeater(ctx_r1.parameters);
    i0.ɵɵadvance(3);
    i0.ɵɵproperty("disabled", ctx_r1.isRunning);
} }
function TemplateParamDialogComponent_Conditional_0_Conditional_13_Conditional_7_Template(rf, ctx) { if (rf & 1) {
    const _r10 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 21);
    i0.ɵɵelement(1, "i", 19);
    i0.ɵɵelementStart(2, "p");
    i0.ɵɵtext(3, "No parameters defined yet");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(4, "button", 51);
    i0.ɵɵlistener("click", function TemplateParamDialogComponent_Conditional_0_Conditional_13_Conditional_7_Template_button_click_4_listener() { i0.ɵɵrestoreView(_r10); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.addParameter()); });
    i0.ɵɵelement(5, "i", 34);
    i0.ɵɵtext(6, " Add First Parameter ");
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext(3);
    i0.ɵɵadvance(4);
    i0.ɵɵproperty("disabled", ctx_r1.isRunning);
} }
function TemplateParamDialogComponent_Conditional_0_Conditional_13_ng_template_9_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 28);
    i0.ɵɵelement(1, "i", 52);
    i0.ɵɵtext(2, " Context Data (JSON) ");
    i0.ɵɵelementEnd();
} }
function TemplateParamDialogComponent_Conditional_0_Conditional_13_ng_template_15_Conditional_3_Conditional_0_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 54);
    i0.ɵɵtext(1, "Success");
    i0.ɵɵelementEnd();
} }
function TemplateParamDialogComponent_Conditional_0_Conditional_13_ng_template_15_Conditional_3_Conditional_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 55);
    i0.ɵɵtext(1, "Error");
    i0.ɵɵelementEnd();
} }
function TemplateParamDialogComponent_Conditional_0_Conditional_13_ng_template_15_Conditional_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵconditionalCreate(0, TemplateParamDialogComponent_Conditional_0_Conditional_13_ng_template_15_Conditional_3_Conditional_0_Template, 2, 0, "span", 54)(1, TemplateParamDialogComponent_Conditional_0_Conditional_13_ng_template_15_Conditional_3_Conditional_1_Template, 2, 0, "span", 55);
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext(4);
    i0.ɵɵconditional(ctx_r1.testResult.success ? 0 : 1);
} }
function TemplateParamDialogComponent_Conditional_0_Conditional_13_ng_template_15_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 28);
    i0.ɵɵelement(1, "i", 53);
    i0.ɵɵtext(2, " Test Results ");
    i0.ɵɵconditionalCreate(3, TemplateParamDialogComponent_Conditional_0_Conditional_13_ng_template_15_Conditional_3_Template, 2, 1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext(3);
    i0.ɵɵadvance(3);
    i0.ɵɵconditional(ctx_r1.testResult ? 3 : -1);
} }
function TemplateParamDialogComponent_Conditional_0_Conditional_13_Conditional_17_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 25);
    i0.ɵɵelement(1, "i", 14);
    i0.ɵɵelementStart(2, "span");
    i0.ɵɵtext(3, "Running template...");
    i0.ɵɵelementEnd()();
} }
function TemplateParamDialogComponent_Conditional_0_Conditional_13_Conditional_18_Conditional_7_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 57)(1, "div", 58);
    i0.ɵɵtext(2, "EXECUTION TIME");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(3, "div", 59);
    i0.ɵɵtext(4);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext(4);
    i0.ɵɵadvance(4);
    i0.ɵɵtextInterpolate1("", ctx_r1.testResult.executionTimeMs, "ms");
} }
function TemplateParamDialogComponent_Conditional_0_Conditional_13_Conditional_18_Conditional_14_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 62)(1, "h6", 63);
    i0.ɵɵelement(2, "i", 64);
    i0.ɵɵtext(3, " Template Output ");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(4, "div", 65);
    i0.ɵɵtext(5);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext(4);
    i0.ɵɵadvance(5);
    i0.ɵɵtextInterpolate1(" ", ctx_r1.testResult.output, " ");
} }
function TemplateParamDialogComponent_Conditional_0_Conditional_13_Conditional_18_Conditional_15_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 62)(1, "h6", 63);
    i0.ɵɵelement(2, "i", 66);
    i0.ɵɵtext(3, " Error Details ");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(4, "div", 67);
    i0.ɵɵtext(5);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext(4);
    i0.ɵɵadvance(5);
    i0.ɵɵtextInterpolate(ctx_r1.testResult.error);
} }
function TemplateParamDialogComponent_Conditional_0_Conditional_13_Conditional_18_Template(rf, ctx) { if (rf & 1) {
    const _r11 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 26)(1, "div", 56)(2, "div", 57)(3, "div", 58);
    i0.ɵɵtext(4, "STATUS");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(5, "div", 59);
    i0.ɵɵtext(6);
    i0.ɵɵelementEnd()();
    i0.ɵɵconditionalCreate(7, TemplateParamDialogComponent_Conditional_0_Conditional_13_Conditional_18_Conditional_7_Template, 5, 1, "div", 57);
    i0.ɵɵelementStart(8, "div", 57)(9, "div", 58);
    i0.ɵɵtext(10, "ACTIONS");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(11, "button", 60);
    i0.ɵɵlistener("click", function TemplateParamDialogComponent_Conditional_0_Conditional_13_Conditional_18_Template_button_click_11_listener() { i0.ɵɵrestoreView(_r11); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.saveResults()); });
    i0.ɵɵelement(12, "i", 61);
    i0.ɵɵelementEnd()()();
    i0.ɵɵelementStart(13, "div", 26);
    i0.ɵɵconditionalCreate(14, TemplateParamDialogComponent_Conditional_0_Conditional_13_Conditional_18_Conditional_14_Template, 6, 1, "div", 62)(15, TemplateParamDialogComponent_Conditional_0_Conditional_13_Conditional_18_Conditional_15_Template, 6, 1, "div", 62);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext(3);
    i0.ɵɵadvance();
    i0.ɵɵclassProp("success", ctx_r1.testResult.success)("error", !ctx_r1.testResult.success);
    i0.ɵɵadvance(5);
    i0.ɵɵtextInterpolate1(" ", ctx_r1.testResult.success ? "Success" : "Failed", " ");
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r1.testResult.executionTimeMs ? 7 : -1);
    i0.ɵɵadvance(7);
    i0.ɵɵconditional(ctx_r1.testResult.success && ctx_r1.testResult.output ? 14 : !ctx_r1.testResult.success && ctx_r1.testResult.error ? 15 : -1);
} }
function TemplateParamDialogComponent_Conditional_0_Conditional_13_Conditional_19_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 27)(1, "div", 68);
    i0.ɵɵelement(2, "i", 69);
    i0.ɵɵelementStart(3, "p");
    i0.ɵɵtext(4, "No test results yet. Run the template to see results here.");
    i0.ɵɵelementEnd()()();
} }
function TemplateParamDialogComponent_Conditional_0_Conditional_13_Template(rf, ctx) { if (rf & 1) {
    const _r3 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "kendo-expansionpanel", 15);
    i0.ɵɵtwoWayListener("expandedChange", function TemplateParamDialogComponent_Conditional_0_Conditional_13_Template_kendo_expansionpanel_expandedChange_0_listener($event) { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(2); i0.ɵɵtwoWayBindingSet(ctx_r1.parametersExpanded, $event) || (ctx_r1.parametersExpanded = $event); return i0.ɵɵresetView($event); });
    i0.ɵɵtemplate(1, TemplateParamDialogComponent_Conditional_0_Conditional_13_ng_template_1_Template, 4, 1, "ng-template", 16);
    i0.ɵɵelementStart(2, "div", 17)(3, "div", 18);
    i0.ɵɵelement(4, "i", 19);
    i0.ɵɵtext(5, " Configure parameter values for template testing. Values can be JSON objects, strings, or numbers. ");
    i0.ɵɵelementEnd();
    i0.ɵɵconditionalCreate(6, TemplateParamDialogComponent_Conditional_0_Conditional_13_Conditional_6_Template, 14, 1, "div", 20)(7, TemplateParamDialogComponent_Conditional_0_Conditional_13_Conditional_7_Template, 7, 1, "div", 21);
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(8, "kendo-expansionpanel", 15);
    i0.ɵɵtwoWayListener("expandedChange", function TemplateParamDialogComponent_Conditional_0_Conditional_13_Template_kendo_expansionpanel_expandedChange_8_listener($event) { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(2); i0.ɵɵtwoWayBindingSet(ctx_r1.jsonPreviewExpanded, $event) || (ctx_r1.jsonPreviewExpanded = $event); return i0.ɵɵresetView($event); });
    i0.ɵɵtemplate(9, TemplateParamDialogComponent_Conditional_0_Conditional_13_ng_template_9_Template, 3, 0, "ng-template", 16);
    i0.ɵɵelementStart(10, "div", 17)(11, "div", 22)(12, "pre");
    i0.ɵɵtext(13);
    i0.ɵɵelementEnd()()()();
    i0.ɵɵelementStart(14, "kendo-expansionpanel", 23);
    i0.ɵɵtwoWayListener("expandedChange", function TemplateParamDialogComponent_Conditional_0_Conditional_13_Template_kendo_expansionpanel_expandedChange_14_listener($event) { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(2); i0.ɵɵtwoWayBindingSet(ctx_r1.resultsExpanded, $event) || (ctx_r1.resultsExpanded = $event); return i0.ɵɵresetView($event); });
    i0.ɵɵtemplate(15, TemplateParamDialogComponent_Conditional_0_Conditional_13_ng_template_15_Template, 4, 1, "ng-template", 16);
    i0.ɵɵelementStart(16, "div", 24);
    i0.ɵɵconditionalCreate(17, TemplateParamDialogComponent_Conditional_0_Conditional_13_Conditional_17_Template, 4, 0, "div", 25)(18, TemplateParamDialogComponent_Conditional_0_Conditional_13_Conditional_18_Template, 16, 7, "div", 26)(19, TemplateParamDialogComponent_Conditional_0_Conditional_13_Conditional_19_Template, 5, 0, "div", 27);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext(2);
    i0.ɵɵtwoWayProperty("expanded", ctx_r1.parametersExpanded);
    i0.ɵɵadvance(6);
    i0.ɵɵconditional(ctx_r1.parameters.length > 0 ? 6 : 7);
    i0.ɵɵadvance(2);
    i0.ɵɵtwoWayProperty("expanded", ctx_r1.jsonPreviewExpanded);
    i0.ɵɵadvance(5);
    i0.ɵɵtextInterpolate(ctx_r1.parametersAsJson);
    i0.ɵɵadvance();
    i0.ɵɵtwoWayProperty("expanded", ctx_r1.resultsExpanded);
    i0.ɵɵadvance(3);
    i0.ɵɵconditional(ctx_r1.isRunning ? 17 : ctx_r1.testResult ? 18 : 19);
} }
function TemplateParamDialogComponent_Conditional_0_Conditional_17_Template(rf, ctx) { if (rf & 1) {
    const _r12 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "button", 70);
    i0.ɵɵlistener("click", function TemplateParamDialogComponent_Conditional_0_Conditional_17_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r12); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.updateTemplateParams()); });
    i0.ɵɵelement(1, "i", 71);
    i0.ɵɵtext(2, " Update Template Params ");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext(2);
    i0.ɵɵproperty("disabled", ctx_r1.isRunning);
} }
function TemplateParamDialogComponent_Conditional_0_Conditional_21_Template(rf, ctx) { if (rf & 1) {
    const _r13 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "button", 72);
    i0.ɵɵlistener("click", function TemplateParamDialogComponent_Conditional_0_Conditional_21_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r13); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.saveResults()); });
    i0.ɵɵelement(1, "i", 61);
    i0.ɵɵtext(2, " Save Results ");
    i0.ɵɵelementEnd();
} }
function TemplateParamDialogComponent_Conditional_0_Conditional_23_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "i", 14);
    i0.ɵɵtext(1, " Running... ");
} }
function TemplateParamDialogComponent_Conditional_0_Conditional_24_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "i", 73);
    i0.ɵɵtext(1, " Run Template ");
} }
function TemplateParamDialogComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
    const _r1 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "kendo-dialog", 1);
    i0.ɵɵlistener("close", function TemplateParamDialogComponent_Conditional_0_Template_kendo_dialog_close_0_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.close()); });
    i0.ɵɵelementStart(1, "div", 2)(2, "div", 3)(3, "div", 4);
    i0.ɵɵelement(4, "i", 5);
    i0.ɵɵelementStart(5, "h5");
    i0.ɵɵtext(6, "Template Testing");
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(7, "p");
    i0.ɵɵtext(8, " Configure parameter values for testing. Parameters with ");
    i0.ɵɵelementStart(9, "span", 6);
    i0.ɵɵtext(10, "*");
    i0.ɵɵelementEnd();
    i0.ɵɵtext(11, " are required. ");
    i0.ɵɵelementEnd()();
    i0.ɵɵconditionalCreate(12, TemplateParamDialogComponent_Conditional_0_Conditional_12_Template, 4, 0, "div", 7)(13, TemplateParamDialogComponent_Conditional_0_Conditional_13_Template, 20, 6);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(14, "kendo-dialog-actions")(15, "div", 8)(16, "div");
    i0.ɵɵconditionalCreate(17, TemplateParamDialogComponent_Conditional_0_Conditional_17_Template, 3, 1, "button", 9);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(18, "div", 10)(19, "button", 11);
    i0.ɵɵlistener("click", function TemplateParamDialogComponent_Conditional_0_Template_button_click_19_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.close()); });
    i0.ɵɵtext(20, " Close ");
    i0.ɵɵelementEnd();
    i0.ɵɵconditionalCreate(21, TemplateParamDialogComponent_Conditional_0_Conditional_21_Template, 3, 0, "button", 12);
    i0.ɵɵelementStart(22, "button", 13);
    i0.ɵɵlistener("click", function TemplateParamDialogComponent_Conditional_0_Template_button_click_22_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.runTemplate()); });
    i0.ɵɵconditionalCreate(23, TemplateParamDialogComponent_Conditional_0_Conditional_23_Template, 2, 0)(24, TemplateParamDialogComponent_Conditional_0_Conditional_24_Template, 2, 0);
    i0.ɵɵelementEnd()()()()();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵproperty("minWidth", 600)("width", 800)("height", 700)("title", "Test Template: " + ((ctx_r1.template == null ? null : ctx_r1.template.Name) || "Unknown"));
    i0.ɵɵadvance(12);
    i0.ɵɵconditional(ctx_r1.isLoading ? 12 : 13);
    i0.ɵɵadvance(5);
    i0.ɵɵconditional(ctx_r1.hasUnsavedParameters ? 17 : -1);
    i0.ɵɵadvance(4);
    i0.ɵɵconditional(ctx_r1.testResult ? 21 : -1);
    i0.ɵɵadvance();
    i0.ɵɵproperty("disabled", ctx_r1.isRunning || ctx_r1.isLoading);
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r1.isRunning ? 23 : 24);
} }
export class TemplateParamDialogComponent {
    constructor() {
        this.template = null;
        this._isVisible = false;
        this.isVisibleChange = new EventEmitter();
        this.onClose = new EventEmitter();
        this.parameters = [];
        this.isLoading = false;
        this.isRunning = false;
        this.testResult = null;
        this.hasUnsavedParameters = false;
        this.parametersExpanded = true;
        this.jsonPreviewExpanded = false;
        this.resultsExpanded = true;
        this.originalTemplateParams = [];
    }
    get isVisible() {
        return this._isVisible;
    }
    set isVisible(value) {
        const wasVisible = this._isVisible;
        this._isVisible = value;
        // Reset dialog state when opening
        if (value && !wasVisible) {
            this.resetDialogState();
        }
    }
    ngOnInit() {
        if (this.template) {
            this.loadTemplateParams();
        }
    }
    async loadTemplateParams() {
        if (!this.template?.ID)
            return;
        this.isLoading = true;
        try {
            const rv = new RunView();
            const results = await rv.RunView({
                EntityName: 'MJ: Template Params',
                ExtraFilter: `TemplateID='${this.template.ID}'`,
                OrderBy: 'Name ASC'
            });
            this.originalTemplateParams = results.Results;
            // Convert template params to parameter pairs
            this.parameters = this.originalTemplateParams.map(param => ({
                key: param.Name,
                value: param.DefaultValue || '',
                isFromTemplate: true,
                description: param.Description || undefined,
                isRequired: param.IsRequired,
                type: param.Type
            }));
            // If no template params, add one empty pair to start
            if (this.parameters.length === 0) {
                this.addParameter();
            }
        }
        catch (error) {
            console.error('Error loading template params:', error);
            MJNotificationService.Instance.CreateSimpleNotification('Error loading template parameters', 'error');
        }
        finally {
            this.isLoading = false;
        }
    }
    addParameter() {
        this.parameters.push({
            key: '',
            value: '',
            isFromTemplate: false
        });
    }
    removeParameter(index) {
        if (this.parameters.length > 1) {
            this.parameters.splice(index, 1);
        }
    }
    onParameterChange() {
        // Check if we have new parameters not in template
        this.hasUnsavedParameters = this.parameters.some(param => param.key &&
            !param.isFromTemplate &&
            !this.originalTemplateParams.find(tp => tp.Name === param.key));
    }
    async runTemplate() {
        if (!this.template?.ID)
            return;
        // Validate parameter names - check for empty parameter names
        const emptyNameParams = this.parameters.filter(p => p.value && !p.key);
        if (emptyNameParams.length > 0) {
            MJNotificationService.Instance.CreateSimpleNotification('All parameters must have a name. Please enter parameter names or remove empty parameters.', 'warning');
            return;
        }
        // Validate required parameters
        const invalidParams = this.parameters.filter(p => p.key && !p.value && p.isRequired);
        if (invalidParams.length > 0) {
            MJNotificationService.Instance.CreateSimpleNotification(`Required parameters missing: ${invalidParams.map(p => p.key).join(', ')}`, 'warning');
            return;
        }
        this.isRunning = true;
        this.testResult = null;
        try {
            // Build context data object from parameters
            const contextData = {};
            this.parameters.forEach(param => {
                if (param.key && param.value) {
                    try {
                        // Try to parse as JSON first, fallback to string
                        contextData[param.key] = JSON.parse(param.value);
                    }
                    catch {
                        contextData[param.key] = param.value;
                    }
                }
            });
            // Get GraphQL data provider
            const dataProvider = Metadata.Provider;
            // Execute the RunTemplate GraphQL mutation
            const query = `
                mutation RunTemplate($templateId: String!, $contextData: String) {
                    RunTemplate(templateId: $templateId, contextData: $contextData) {
                        success
                        output
                        error
                        executionTimeMs
                    }
                }
            `;
            const variables = {
                templateId: this.template.ID,
                contextData: JSON.stringify(contextData)
            };
            const result = await dataProvider.ExecuteGQL(query, variables);
            if (result?.RunTemplate) {
                this.testResult = result.RunTemplate;
                // Collapse parameters and expand results after execution
                this.parametersExpanded = false;
                this.resultsExpanded = true;
                if (this.testResult?.success) {
                    MJNotificationService.Instance.CreateSimpleNotification(`Template executed successfully in ${this.testResult.executionTimeMs || 0}ms`, 'success', 4000);
                }
                else {
                    MJNotificationService.Instance.CreateSimpleNotification(`Template execution failed: ${this.testResult?.error || 'Unknown error'}`, 'error', 5000);
                }
            }
            else {
                throw new Error(result.errors?.[0]?.message || 'Unknown GraphQL error');
            }
        }
        catch (error) {
            console.error('Template test error:', error);
            this.testResult = {
                success: false,
                error: error.message || 'Unknown error occurred'
            };
            // Still collapse parameters and expand results on error
            this.parametersExpanded = false;
            this.resultsExpanded = true;
            MJNotificationService.Instance.CreateSimpleNotification(`Template test failed: ${this.testResult?.error || 'Unknown error'}`, 'error', 5000);
        }
        finally {
            this.isRunning = false;
        }
    }
    async updateTemplateParams() {
        if (!this.template?.ID || !this.hasUnsavedParameters)
            return;
        const newParams = this.parameters.filter(param => param.key &&
            !param.isFromTemplate &&
            !this.originalTemplateParams.find(tp => tp.Name === param.key));
        if (newParams.length === 0)
            return;
        try {
            const md = new Metadata();
            for (const param of newParams) {
                const templateParam = await md.GetEntityObject('MJ: Template Params');
                templateParam.TemplateID = this.template.ID;
                templateParam.Name = param.key;
                templateParam.Description = param.description || null;
                templateParam.Type = 'Scalar'; // Default type
                templateParam.DefaultValue = param.value || null;
                templateParam.IsRequired = param.isRequired || false;
                const saved = await templateParam.Save();
                if (!saved) {
                    throw new Error(`Failed to save parameter: ${param.key}`);
                }
            }
            MJNotificationService.Instance.CreateSimpleNotification(`Added ${newParams.length} new parameter(s) to template`, 'success');
            this.hasUnsavedParameters = false;
            // Reload template params to sync
            await this.loadTemplateParams();
        }
        catch (error) {
            console.error('Error updating template params:', error);
            MJNotificationService.Instance.CreateSimpleNotification('Error saving template parameters', 'error');
        }
    }
    close() {
        this._isVisible = false;
        this.isVisibleChange.emit(false);
        this.onClose.emit();
    }
    resetDialogState() {
        // Reset expansion states for a clean testing experience
        this.parametersExpanded = true; // Show params by default
        this.jsonPreviewExpanded = false; // Hide JSON (developer-focused)
        this.resultsExpanded = true; // Show results when they exist
        // Clear previous test results
        this.testResult = null;
        this.isRunning = false;
        // Reset unsaved parameters flag
        this.hasUnsavedParameters = false;
    }
    saveResults() {
        if (!this.testResult)
            return;
        const content = this.testResult.success
            ? this.testResult.output || 'No output'
            : this.testResult.error || 'No error details';
        const timestamp = new Date().toISOString().replace(/[:.]/g, '-').slice(0, -5);
        const templateName = this.template?.Name?.replace(/[^a-zA-Z0-9]/g, '_') || 'template';
        const status = this.testResult.success ? 'success' : 'error';
        const filename = `${templateName}_${status}_${timestamp}.txt`;
        // Create blob and download
        const blob = new Blob([content], { type: 'text/plain' });
        const url = window.URL.createObjectURL(blob);
        const link = document.createElement('a');
        link.href = url;
        link.download = filename;
        document.body.appendChild(link);
        link.click();
        document.body.removeChild(link);
        window.URL.revokeObjectURL(url);
        MJNotificationService.Instance.CreateSimpleNotification(`Results saved as ${filename}`, 'success');
    }
    get parametersAsJson() {
        const contextData = {};
        this.parameters.forEach(param => {
            if (param.key && param.value) {
                try {
                    contextData[param.key] = JSON.parse(param.value);
                }
                catch {
                    contextData[param.key] = param.value;
                }
            }
        });
        return JSON.stringify(contextData, null, 2);
    }
    static { this.ɵfac = function TemplateParamDialogComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TemplateParamDialogComponent)(); }; }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: TemplateParamDialogComponent, selectors: [["mj-template-param-dialog"]], inputs: { template: "template", isVisible: "isVisible" }, outputs: { isVisibleChange: "isVisibleChange", onClose: "onClose" }, standalone: false, decls: 1, vars: 1, consts: [[3, "minWidth", "width", "height", "title"], [3, "close", "minWidth", "width", "height", "title"], [1, "dialog-content", 2, "display", "flex", "flex-direction", "column", "height", "100%", "font-family", "'Segoe UI', Tahoma, Geneva, Verdana, sans-serif"], [1, "dlg-header"], [1, "dlg-header-row"], [1, "fa-solid", "fa-sliders"], [1, "required-marker"], [1, "dlg-loading"], [2, "display", "flex", "justify-content", "space-between", "align-items", "center", "width", "100%"], ["kendoButton", "", "fillMode", "outline", "themeColor", "info", 3, "disabled"], [2, "display", "flex", "gap", "8px"], ["kendoButton", "", "fillMode", "outline", 3, "click"], ["kendoButton", "", "fillMode", "outline", "themeColor", "info"], ["kendoButton", "", "themeColor", "primary", 3, "click", "disabled"], [1, "fa-solid", "fa-spinner", "fa-spin"], [2, "margin-bottom", "16px", "flex-shrink", "0", 3, "expandedChange", "expanded"], ["kendoExpansionPanelTitleDirective", ""], [2, "padding", "12px 0"], [1, "dlg-info-text"], [1, "fa-solid", "fa-info-circle"], [1, "params-table"], [1, "no-params-state"], [1, "json-preview-box"], [2, "margin-bottom", "16px", "flex", "1", "display", "flex", "flex-direction", "column", 3, "expandedChange", "expanded"], [2, "padding", "12px 0", "flex", "1", "display", "flex", "flex-direction", "column"], [1, "dlg-loading", 2, "flex", "1"], [2, "flex", "1", "display", "flex", "flex-direction", "column"], [1, "no-results-state"], [1, "dlg-panel-title"], [1, "count-badge"], [1, "params-table-header"], [1, "params-table-row"], [1, "add-param-row"], ["kendoButton", "", "fillMode", "outline", "themeColor", "success", "size", "small", 3, "click", "disabled"], [1, "fa-solid", "fa-plus"], [1, "param-name", 2, "display", "flex", "flex-direction", "column"], [2, "display", "flex", "align-items", "center", "gap", "4px", "margin-bottom", "4px"], ["title", "From template definition", 1, "fa-solid", "fa-database", "param-source-icon-template"], ["title", "Custom parameter", 1, "fa-solid", "fa-edit", "param-source-icon-custom"], [1, "param-required-marker"], ["placeholder", "Parameter name...", 2, "font-family", "'Courier New', monospace", "width", "100%", 3, "ngModel", "disabled"], [1, "param-value"], ["placeholder", "Enter value (JSON strings, numbers, objects)...", 2, "font-family", "'Courier New', monospace", "font-size", "0.9em", "width", "100%", 3, "ngModelChange", "ngModel", "rows", "disabled"], [1, "param-actions"], ["kendoButton", "", "fillMode", "flat", "themeColor", "error", "size", "small", "title", "Remove parameter", 3, "disabled"], [1, "param-key-text"], [1, "param-description-text"], [1, "param-type-text"], ["placeholder", "Parameter name...", 2, "font-family", "'Courier New', monospace", "width", "100%", 3, "ngModelChange", "ngModel", "disabled"], ["kendoButton", "", "fillMode", "flat", "themeColor", "error", "size", "small", "title", "Remove parameter", 3, "click", "disabled"], [1, "fa-solid", "fa-times"], ["kendoButton", "", "themeColor", "primary", "size", "small", 3, "click", "disabled"], [1, "fa-solid", "fa-code"], [1, "fa-solid", "fa-chart-line"], [1, "result-badge-success"], [1, "result-badge-error"], [1, "result-stats"], [1, "result-stat"], [1, "result-stat-label"], [1, "result-stat-value"], ["kendoButton", "", "fillMode", "flat", "size", "small", "title", "Save results to file", 2, "min-width", "auto", "padding", "4px 8px", 3, "click"], [1, "fa-solid", "fa-download"], [2, "margin-bottom", "12px", "flex", "1", "display", "flex", "flex-direction", "column"], [1, "output-header"], [1, "fa-solid", "fa-check-circle", "success-icon"], [1, "output-box"], [1, "fa-solid", "fa-exclamation-triangle", "error-icon"], [1, "error-output-box"], [2, "text-align", "center"], [1, "fa-solid", "fa-play-circle"], ["kendoButton", "", "fillMode", "outline", "themeColor", "info", 3, "click", "disabled"], [1, "fa-solid", "fa-save"], ["kendoButton", "", "fillMode", "outline", "themeColor", "info", 3, "click"], [1, "fa-solid", "fa-play"]], template: function TemplateParamDialogComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵconditionalCreate(0, TemplateParamDialogComponent_Conditional_0_Template, 25, 9, "kendo-dialog", 0);
        } if (rf & 2) {
            i0.ɵɵconditional(ctx._isVisible ? 0 : -1);
        } }, dependencies: [i1.NgControlStatus, i1.NgModel, i2.ExpansionPanelComponent, i2.ExpansionPanelTitleDirective, i3.DialogComponent, i3.DialogActionsComponent, i4.TextBoxComponent, i4.TextAreaComponent, i5.ButtonComponent], styles: [".dialog-content[_ngcontent-%COMP%] {\n    min-height: 500px;\n    max-height: 650px;\n}\n\n.parameter-row[_ngcontent-%COMP%]:hover {\n    background-color: var(--mj-bg-surface-card) !important;\n}\n\n.parameter-row[_ngcontent-%COMP%]:last-child {\n    border-bottom: none;\n}\n\n.param-name[_ngcontent-%COMP%], \n.param-value[_ngcontent-%COMP%] {\n    min-width: 0;\n}\n\n.param-name[_ngcontent-%COMP%]   kendo-textbox[_ngcontent-%COMP%], \n.param-value[_ngcontent-%COMP%]   kendo-textarea[_ngcontent-%COMP%] {\n    width: 100%;\n}\n\n.json-preview[_ngcontent-%COMP%]   pre[_ngcontent-%COMP%] {\n    line-height: 1.3;\n}\n\n.test-results[_ngcontent-%COMP%] {\n    box-shadow: 0 2px 4px var(--mj-shadow-sm);\n}\n\n.result-content[_ngcontent-%COMP%]   pre[_ngcontent-%COMP%] {\n    line-height: 1.4;\n}\n\n\n\n.parameters-list[_ngcontent-%COMP%]::-webkit-scrollbar, \n.result-content[_ngcontent-%COMP%]::-webkit-scrollbar, \n.json-preview[_ngcontent-%COMP%]    > div[_ngcontent-%COMP%]::-webkit-scrollbar {\n    width: 6px;\n}\n\n.parameters-list[_ngcontent-%COMP%]::-webkit-scrollbar-track, \n.result-content[_ngcontent-%COMP%]::-webkit-scrollbar-track, \n.json-preview[_ngcontent-%COMP%]    > div[_ngcontent-%COMP%]::-webkit-scrollbar-track {\n    background: var(--mj-bg-surface-card);\n    border-radius: 3px;\n}\n\n.parameters-list[_ngcontent-%COMP%]::-webkit-scrollbar-thumb, \n.result-content[_ngcontent-%COMP%]::-webkit-scrollbar-thumb, \n.json-preview[_ngcontent-%COMP%]    > div[_ngcontent-%COMP%]::-webkit-scrollbar-thumb {\n    background: var(--mj-border-strong);\n    border-radius: 3px;\n}\n\n.parameters-list[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover, \n.result-content[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover, \n.json-preview[_ngcontent-%COMP%]    > div[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover {\n    background: var(--mj-text-muted);\n}\n\n.parameter-row[_ngcontent-%COMP%] {\n    align-items: flex-start;\n}\n\n.parameters-section[_ngcontent-%COMP%] {\n    flex-shrink: 0;\n}\n\n.param-name[_ngcontent-%COMP%]    > div[_ngcontent-%COMP%] {\n    word-wrap: break-word;\n    overflow-wrap: break-word;\n}\n\n.header-section[_ngcontent-%COMP%]    > div[_ngcontent-%COMP%]:first-child:hover, \n.json-preview-header[_ngcontent-%COMP%]    > div[_ngcontent-%COMP%]:first-child:hover, \n.result-header[_ngcontent-%COMP%]:hover {\n    background-color: var(--mj-bg-surface-card) !important;\n    transition: background-color 0.2s ease;\n}\n\n.fa-chevron-down[_ngcontent-%COMP%], \n.fa-chevron-right[_ngcontent-%COMP%] {\n    transition: transform 0.2s ease;\n}\n\n.test-results[_ngcontent-%COMP%]   .result-header[_ngcontent-%COMP%]   kendo-button[_ngcontent-%COMP%] {\n    opacity: 0.8;\n    transition: opacity 0.2s ease;\n}\n\n.test-results[_ngcontent-%COMP%]   .result-header[_ngcontent-%COMP%]:hover   kendo-button[_ngcontent-%COMP%] {\n    opacity: 1;\n}\n\n\n\n.dlg-header[_ngcontent-%COMP%] {\n    margin-bottom: 20px;\n    padding-bottom: 16px;\n    border-bottom: 2px solid var(--mj-border-default);\n}\n\n.dlg-header-row[_ngcontent-%COMP%] {\n    display: flex;\n    align-items: center;\n    gap: 12px;\n    margin-bottom: 8px;\n}\n\n.dlg-header-row[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n    color: var(--mj-text-muted);\n    font-size: 1.2em;\n}\n\n.dlg-header-row[_ngcontent-%COMP%]   h5[_ngcontent-%COMP%] {\n    margin: 0;\n    color: var(--mj-text-primary);\n    font-weight: 600;\n}\n\n.dlg-header[_ngcontent-%COMP%]   p[_ngcontent-%COMP%] {\n    margin: 0;\n    color: var(--mj-text-muted);\n    font-size: 0.9em;\n}\n\n.dlg-header[_ngcontent-%COMP%]   .required-marker[_ngcontent-%COMP%] {\n    color: var(--mj-status-error);\n}\n\n\n\n.dlg-loading[_ngcontent-%COMP%] {\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    padding: 40px;\n}\n\n.dlg-loading[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n    font-size: 24px;\n    color: var(--mj-text-muted);\n    margin-right: 12px;\n}\n\n.dlg-loading[_ngcontent-%COMP%]   span[_ngcontent-%COMP%] {\n    color: var(--mj-text-muted);\n}\n\n\n\n.dlg-panel-title[_ngcontent-%COMP%] {\n    display: flex;\n    align-items: center;\n    gap: 8px;\n    font-weight: 600;\n}\n\n.dlg-panel-title[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n    color: var(--mj-text-muted);\n}\n\n.dlg-panel-title[_ngcontent-%COMP%]   .count-badge[_ngcontent-%COMP%] {\n    background: var(--mj-brand-primary);\n    color: var(--mj-text-inverse);\n    padding: 2px 6px;\n    border-radius: 10px;\n    font-size: 0.7em;\n}\n\n\n\n.dlg-info-text[_ngcontent-%COMP%] {\n    margin-bottom: 12px;\n    color: var(--mj-text-muted);\n    font-size: 0.85em;\n}\n\n\n\n.params-table[_ngcontent-%COMP%] {\n    border: 1px solid var(--mj-border-default);\n    border-radius: 6px;\n    background: var(--mj-bg-surface-card);\n}\n\n.params-table-header[_ngcontent-%COMP%] {\n    display: grid;\n    grid-template-columns: 200px 1fr 60px;\n    gap: 12px;\n    padding: 12px 16px;\n    background: var(--mj-bg-surface-sunken);\n    font-weight: 600;\n    font-size: 0.85em;\n    color: var(--mj-text-secondary);\n    border-bottom: 1px solid var(--mj-border-default);\n}\n\n.params-table-row[_ngcontent-%COMP%] {\n    display: grid;\n    grid-template-columns: 200px 1fr 60px;\n    gap: 12px;\n    padding: 12px 16px;\n    border-bottom: 1px solid var(--mj-border-default);\n    align-items: start;\n    background: var(--mj-bg-surface);\n}\n\n.param-source-icon-template[_ngcontent-%COMP%] {\n    color: var(--mj-status-success);\n    font-size: 0.75em;\n}\n\n.param-source-icon-custom[_ngcontent-%COMP%] {\n    color: var(--mj-status-warning);\n    font-size: 0.75em;\n}\n\n.param-required-marker[_ngcontent-%COMP%] {\n    color: var(--mj-status-error);\n    font-weight: bold;\n}\n\n.param-key-text[_ngcontent-%COMP%] {\n    font-family: 'Courier New', monospace;\n    font-size: 0.9em;\n    font-weight: 500;\n    color: var(--mj-text-primary);\n    padding: 4px 0;\n    word-break: break-word;\n}\n\n.param-description-text[_ngcontent-%COMP%] {\n    font-size: 0.75em;\n    color: var(--mj-text-muted);\n    margin-top: 2px;\n    font-style: italic;\n    word-break: break-word;\n}\n\n.param-type-text[_ngcontent-%COMP%] {\n    font-size: 0.7em;\n    color: var(--mj-brand-primary);\n    margin-top: 2px;\n}\n\n.param-actions[_ngcontent-%COMP%] {\n    display: flex;\n    align-items: start;\n    justify-content: center;\n    padding-top: 4px;\n}\n\n\n\n.add-param-row[_ngcontent-%COMP%] {\n    padding: 12px 16px;\n    text-align: center;\n    background: var(--mj-bg-surface);\n    border-top: 1px solid var(--mj-border-default);\n}\n\n\n\n.no-params-state[_ngcontent-%COMP%] {\n    text-align: center;\n    padding: 20px;\n    color: var(--mj-text-muted);\n}\n\n.no-params-state[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n    font-size: 2em;\n    margin-bottom: 12px;\n    opacity: 0.5;\n}\n\n.no-params-state[_ngcontent-%COMP%]   p[_ngcontent-%COMP%] {\n    margin: 0 0 12px 0;\n}\n\n\n\n.json-preview-box[_ngcontent-%COMP%] {\n    background: var(--mj-bg-surface-card);\n    border: 1px solid var(--mj-border-default);\n    border-radius: 4px;\n    padding: 12px;\n    font-family: 'Courier New', monospace;\n    font-size: 0.85em;\n    color: var(--mj-text-primary);\n    max-height: 200px;\n    overflow-y: auto;\n}\n\n.json-preview-box[_ngcontent-%COMP%]   pre[_ngcontent-%COMP%] {\n    margin: 0;\n    white-space: pre-wrap;\n}\n\n\n\n.result-badge-success[_ngcontent-%COMP%] {\n    background: color-mix(in srgb, var(--mj-status-success) 15%, var(--mj-bg-surface));\n    color: var(--mj-status-success);\n    border: 1px solid color-mix(in srgb, var(--mj-status-success) 30%, transparent);\n    padding: 2px 6px;\n    border-radius: 10px;\n    font-size: 0.7em;\n    font-weight: 600;\n}\n\n.result-badge-error[_ngcontent-%COMP%] {\n    background: color-mix(in srgb, var(--mj-status-error) 15%, var(--mj-bg-surface));\n    color: var(--mj-status-error);\n    border: 1px solid color-mix(in srgb, var(--mj-status-error) 30%, transparent);\n    padding: 2px 6px;\n    border-radius: 10px;\n    font-size: 0.7em;\n    font-weight: 600;\n}\n\n\n\n.result-stats[_ngcontent-%COMP%] {\n    display: grid;\n    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));\n    gap: 12px;\n    margin-bottom: 16px;\n    padding: 12px;\n    border: 1px solid var(--mj-border-default);\n    border-radius: 6px;\n}\n\n.result-stats.success[_ngcontent-%COMP%] {\n    background: color-mix(in srgb, var(--mj-status-success) 10%, var(--mj-bg-surface));\n}\n\n.result-stats.error[_ngcontent-%COMP%] {\n    background: color-mix(in srgb, var(--mj-status-error) 10%, var(--mj-bg-surface));\n}\n\n.result-stat[_ngcontent-%COMP%] {\n    text-align: center;\n}\n\n.result-stat-label[_ngcontent-%COMP%] {\n    font-size: 0.75em;\n    margin-bottom: 2px;\n    color: var(--mj-text-muted);\n}\n\n.result-stat-value[_ngcontent-%COMP%] {\n    font-weight: 600;\n    color: var(--mj-text-primary);\n}\n\n\n\n.output-header[_ngcontent-%COMP%] {\n    margin: 0 0 8px 0;\n    color: var(--mj-text-primary);\n    display: flex;\n    align-items: center;\n    gap: 6px;\n}\n\n.output-header[_ngcontent-%COMP%]   .success-icon[_ngcontent-%COMP%] {\n    color: var(--mj-status-success);\n}\n\n.output-header[_ngcontent-%COMP%]   .error-icon[_ngcontent-%COMP%] {\n    color: var(--mj-status-error);\n}\n\n.output-box[_ngcontent-%COMP%] {\n    background: var(--mj-bg-surface-card);\n    border: 1px solid var(--mj-border-default);\n    border-radius: 4px;\n    padding: 12px;\n    font-family: 'Courier New', monospace;\n    font-size: 0.9em;\n    white-space: pre-wrap;\n    overflow: auto;\n    height: 150px;\n    color: var(--mj-text-primary);\n}\n\n.error-output-box[_ngcontent-%COMP%] {\n    background: color-mix(in srgb, var(--mj-status-error) 8%, var(--mj-bg-surface));\n    border: 1px solid color-mix(in srgb, var(--mj-status-error) 20%, var(--mj-bg-surface));\n    border-radius: 4px;\n    padding: 12px;\n    color: var(--mj-status-error);\n    font-family: 'Courier New', monospace;\n    font-size: 0.9em;\n    white-space: pre-wrap;\n    overflow: auto;\n    height: 150px;\n}\n\n\n\n.no-results-state[_ngcontent-%COMP%] {\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    padding: 40px;\n    color: var(--mj-text-muted);\n    flex: 1;\n}\n\n.no-results-state[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n    font-size: 3em;\n    margin-bottom: 12px;\n    opacity: 0.3;\n}\n\n.no-results-state[_ngcontent-%COMP%]   p[_ngcontent-%COMP%] {\n    margin: 0;\n}"] }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TemplateParamDialogComponent, [{
        type: Component,
        args: [{ standalone: false, selector: 'mj-template-param-dialog', template: "@if (_isVisible) {\n  <kendo-dialog\n    [minWidth]=\"600\"\n    [width]=\"800\"\n    [height]=\"700\"\n    (close)=\"close()\"\n    [title]=\"'Test Template: ' + (template?.Name || 'Unknown')\">\n    <div class=\"dialog-content\" style=\"display: flex; flex-direction: column; height: 100%; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;\">\n      <!-- Header Section -->\n      <div class=\"dlg-header\">\n        <div class=\"dlg-header-row\">\n          <i class=\"fa-solid fa-sliders\"></i>\n          <h5>Template Testing</h5>\n        </div>\n        <p>\n          Configure parameter values for testing. Parameters with <span class=\"required-marker\">*</span> are required.\n        </p>\n      </div>\n      <!-- Loading State -->\n      @if (isLoading) {\n        <div class=\"dlg-loading\">\n          <i class=\"fa-solid fa-spinner fa-spin\"></i>\n          <span>Loading template parameters...</span>\n        </div>\n      } @else {\n        <!-- Template Parameters Section -->\n        <kendo-expansionpanel\n          [(expanded)]=\"parametersExpanded\"\n          style=\"margin-bottom: 16px; flex-shrink: 0;\">\n          <ng-template kendoExpansionPanelTitleDirective>\n            <span class=\"dlg-panel-title\">\n              <i class=\"fa-solid fa-sliders\"></i>\n              Template Parameters\n              @if (parameters.length > 0) {\n                <span class=\"count-badge\">\n                  {{ parameters.length }}\n                </span>\n              }\n            </span>\n          </ng-template>\n          <div style=\"padding: 12px 0;\">\n            <div class=\"dlg-info-text\">\n              <i class=\"fa-solid fa-info-circle\"></i>\n              Configure parameter values for template testing. Values can be JSON objects, strings, or numbers.\n            </div>\n            <!-- Parameters Table -->\n            @if (parameters.length > 0) {\n              <div class=\"params-table\">\n                <!-- Header -->\n                <div class=\"params-table-header\">\n                  <div>Parameter Name</div>\n                  <div>Value</div>\n                  <div>Actions</div>\n                </div>\n                <!-- Parameter Rows -->\n                @for (param of parameters; track $index; let i = $index) {\n                  <div class=\"params-table-row\">\n                    <!-- Parameter Name -->\n                    <div class=\"param-name\" style=\"display: flex; flex-direction: column;\">\n                      <div style=\"display: flex; align-items: center; gap: 4px; margin-bottom: 4px;\">\n                        @if (param.isFromTemplate) {\n                          <i class=\"fa-solid fa-database param-source-icon-template\" title=\"From template definition\"></i>\n                        } @else {\n                          <i class=\"fa-solid fa-edit param-source-icon-custom\" title=\"Custom parameter\"></i>\n                        }\n                        @if (param.isRequired) {\n                          <span class=\"param-required-marker\">*</span>\n                        }\n                      </div>\n                      @if (param.isFromTemplate) {\n                        <div class=\"param-key-text\">\n                          {{ param.key }}\n                        </div>\n                        @if (param.description) {\n                          <div class=\"param-description-text\">\n                            {{ param.description }}\n                          </div>\n                        }\n                        @if (param.type && param.type !== 'Scalar') {\n                          <div class=\"param-type-text\">\n                            Type: {{ param.type }}\n                          </div>\n                        }\n                      } @else {\n                        <kendo-textbox [(ngModel)]=\"param.key\"\n                          (ngModelChange)=\"onParameterChange()\"\n                          placeholder=\"Parameter name...\"\n                          [disabled]=\"isRunning\"\n                          style=\"font-family: 'Courier New', monospace; width: 100%;\">\n                        </kendo-textbox>\n                      }\n                    </div>\n                    <!-- Parameter Value -->\n                    <div class=\"param-value\">\n                      <kendo-textarea [(ngModel)]=\"param.value\"\n                        (ngModelChange)=\"onParameterChange()\"\n                        [rows]=\"2\"\n                        placeholder=\"Enter value (JSON strings, numbers, objects)...\"\n                        [disabled]=\"isRunning\"\n                        style=\"font-family: 'Courier New', monospace; font-size: 0.9em; width: 100%;\">\n                      </kendo-textarea>\n                    </div>\n                    <!-- Actions -->\n                    <div class=\"param-actions\">\n                      @if (!param.isFromTemplate && parameters.length > 1) {\n                        <button kendoButton fillMode=\"flat\"\n                          themeColor=\"error\"\n                          size=\"small\"\n                          (click)=\"removeParameter(i)\"\n                          [disabled]=\"isRunning\"\n                          title=\"Remove parameter\">\n                          <i class=\"fa-solid fa-times\"></i>\n                        </button>\n                      }\n                    </div>\n                  </div>\n                }\n                <!-- Add Parameter Row -->\n                <div class=\"add-param-row\">\n                  <button kendoButton fillMode=\"outline\"\n                    themeColor=\"success\"\n                    size=\"small\"\n                    (click)=\"addParameter()\"\n                    [disabled]=\"isRunning\">\n                    <i class=\"fa-solid fa-plus\"></i> Add Parameter\n                  </button>\n                </div>\n              </div>\n            } @else {\n              <div class=\"no-params-state\">\n                <i class=\"fa-solid fa-info-circle\"></i>\n                <p>No parameters defined yet</p>\n                <button kendoButton themeColor=\"primary\" size=\"small\"\n                  (click)=\"addParameter()\"\n                  [disabled]=\"isRunning\">\n                  <i class=\"fa-solid fa-plus\"></i> Add First Parameter\n                </button>\n              </div>\n            }\n          </div>\n        </kendo-expansionpanel>\n        <!-- JSON Preview Section -->\n        <kendo-expansionpanel\n          [(expanded)]=\"jsonPreviewExpanded\"\n          style=\"margin-bottom: 16px; flex-shrink: 0;\">\n          <ng-template kendoExpansionPanelTitleDirective>\n            <span class=\"dlg-panel-title\">\n              <i class=\"fa-solid fa-code\"></i>\n              Context Data (JSON)\n            </span>\n          </ng-template>\n          <div style=\"padding: 12px 0;\">\n            <div class=\"json-preview-box\">\n              <pre>{{ parametersAsJson }}</pre>\n            </div>\n          </div>\n        </kendo-expansionpanel>\n        <!-- Test Results Section -->\n        <kendo-expansionpanel\n          [(expanded)]=\"resultsExpanded\"\n          style=\"margin-bottom: 16px; flex: 1; display: flex; flex-direction: column;\">\n          <ng-template kendoExpansionPanelTitleDirective>\n            <span class=\"dlg-panel-title\">\n              <i class=\"fa-solid fa-chart-line\"></i>\n              Test Results\n              @if (testResult) {\n                @if (testResult.success) {\n                  <span class=\"result-badge-success\">Success</span>\n                } @else {\n                  <span class=\"result-badge-error\">Error</span>\n                }\n              }\n            </span>\n          </ng-template>\n          <div style=\"padding: 12px 0; flex: 1; display: flex; flex-direction: column;\">\n            @if (isRunning) {\n              <div class=\"dlg-loading\" style=\"flex: 1;\">\n                <i class=\"fa-solid fa-spinner fa-spin\"></i>\n                <span>Running template...</span>\n              </div>\n            } @else if (testResult) {\n              <div style=\"flex: 1; display: flex; flex-direction: column;\">\n                <!-- Result Header with Stats -->\n                <div class=\"result-stats\" [class.success]=\"testResult.success\" [class.error]=\"!testResult.success\">\n                  <div class=\"result-stat\">\n                    <div class=\"result-stat-label\">STATUS</div>\n                    <div class=\"result-stat-value\">\n                      {{ testResult.success ? 'Success' : 'Failed' }}\n                    </div>\n                  </div>\n                  @if (testResult.executionTimeMs) {\n                    <div class=\"result-stat\">\n                      <div class=\"result-stat-label\">EXECUTION TIME</div>\n                      <div class=\"result-stat-value\">{{ testResult.executionTimeMs }}ms</div>\n                    </div>\n                  }\n                  <div class=\"result-stat\">\n                    <div class=\"result-stat-label\">ACTIONS</div>\n                    <button kendoButton fillMode=\"flat\" size=\"small\"\n                      (click)=\"saveResults()\"\n                      title=\"Save results to file\"\n                      style=\"min-width: auto; padding: 4px 8px;\">\n                      <i class=\"fa-solid fa-download\"></i>\n                    </button>\n                  </div>\n                </div>\n                <!-- Result Content -->\n                <div style=\"flex: 1; display: flex; flex-direction: column;\">\n                  @if (testResult.success && testResult.output) {\n                    <div style=\"margin-bottom: 12px; flex: 1; display: flex; flex-direction: column;\">\n                      <h6 class=\"output-header\">\n                        <i class=\"fa-solid fa-check-circle success-icon\"></i>\n                        Template Output\n                      </h6>\n                      <div class=\"output-box\">\n                        {{ testResult.output }}\n                      </div>\n                    </div>\n                  } @else if (!testResult.success && testResult.error) {\n                    <div style=\"margin-bottom: 12px; flex: 1; display: flex; flex-direction: column;\">\n                      <h6 class=\"output-header\">\n                        <i class=\"fa-solid fa-exclamation-triangle error-icon\"></i>\n                        Error Details\n                      </h6>\n                      <div class=\"error-output-box\">{{ testResult.error }}</div>\n                    </div>\n                  }\n                </div>\n              </div>\n            } @else {\n              <div class=\"no-results-state\">\n                <div style=\"text-align: center;\">\n                  <i class=\"fa-solid fa-play-circle\"></i>\n                  <p>No test results yet. Run the template to see results here.</p>\n                </div>\n              </div>\n            }\n          </div>\n        </kendo-expansionpanel>\n      }\n    </div>\n    <!-- Dialog Actions -->\n    <kendo-dialog-actions>\n      <div style=\"display: flex; justify-content: space-between; align-items: center; width: 100%;\">\n        <div>\n          @if (hasUnsavedParameters) {\n            <button kendoButton fillMode=\"outline\"\n              themeColor=\"info\"\n              (click)=\"updateTemplateParams()\"\n              [disabled]=\"isRunning\">\n              <i class=\"fa-solid fa-save\"></i> Update Template Params\n            </button>\n          }\n        </div>\n        <div style=\"display: flex; gap: 8px;\">\n          <button kendoButton fillMode=\"outline\" (click)=\"close()\">\n            Close\n          </button>\n          @if (testResult) {\n            <button kendoButton fillMode=\"outline\" themeColor=\"info\" (click)=\"saveResults()\">\n              <i class=\"fa-solid fa-download\"></i> Save Results\n            </button>\n          }\n          <button kendoButton themeColor=\"primary\"\n            [disabled]=\"isRunning || isLoading\"\n            (click)=\"runTemplate()\">\n            @if (isRunning) {\n              <i class=\"fa-solid fa-spinner fa-spin\"></i> Running...\n            } @else {\n              <i class=\"fa-solid fa-play\"></i> Run Template\n            }\n          </button>\n        </div>\n      </div>\n    </kendo-dialog-actions>\n  </kendo-dialog>\n}\n", styles: [".dialog-content {\n    min-height: 500px;\n    max-height: 650px;\n}\n\n.parameter-row:hover {\n    background-color: var(--mj-bg-surface-card) !important;\n}\n\n.parameter-row:last-child {\n    border-bottom: none;\n}\n\n.param-name,\n.param-value {\n    min-width: 0;\n}\n\n.param-name kendo-textbox,\n.param-value kendo-textarea {\n    width: 100%;\n}\n\n.json-preview pre {\n    line-height: 1.3;\n}\n\n.test-results {\n    box-shadow: 0 2px 4px var(--mj-shadow-sm);\n}\n\n.result-content pre {\n    line-height: 1.4;\n}\n\n/* Scrollbar styling */\n.parameters-list::-webkit-scrollbar,\n.result-content::-webkit-scrollbar,\n.json-preview > div::-webkit-scrollbar {\n    width: 6px;\n}\n\n.parameters-list::-webkit-scrollbar-track,\n.result-content::-webkit-scrollbar-track,\n.json-preview > div::-webkit-scrollbar-track {\n    background: var(--mj-bg-surface-card);\n    border-radius: 3px;\n}\n\n.parameters-list::-webkit-scrollbar-thumb,\n.result-content::-webkit-scrollbar-thumb,\n.json-preview > div::-webkit-scrollbar-thumb {\n    background: var(--mj-border-strong);\n    border-radius: 3px;\n}\n\n.parameters-list::-webkit-scrollbar-thumb:hover,\n.result-content::-webkit-scrollbar-thumb:hover,\n.json-preview > div::-webkit-scrollbar-thumb:hover {\n    background: var(--mj-text-muted);\n}\n\n.parameter-row {\n    align-items: flex-start;\n}\n\n.parameters-section {\n    flex-shrink: 0;\n}\n\n.param-name > div {\n    word-wrap: break-word;\n    overflow-wrap: break-word;\n}\n\n.header-section > div:first-child:hover,\n.json-preview-header > div:first-child:hover,\n.result-header:hover {\n    background-color: var(--mj-bg-surface-card) !important;\n    transition: background-color 0.2s ease;\n}\n\n.fa-chevron-down,\n.fa-chevron-right {\n    transition: transform 0.2s ease;\n}\n\n.test-results .result-header kendo-button {\n    opacity: 0.8;\n    transition: opacity 0.2s ease;\n}\n\n.test-results .result-header:hover kendo-button {\n    opacity: 1;\n}\n\n/* Dialog header section */\n.dlg-header {\n    margin-bottom: 20px;\n    padding-bottom: 16px;\n    border-bottom: 2px solid var(--mj-border-default);\n}\n\n.dlg-header-row {\n    display: flex;\n    align-items: center;\n    gap: 12px;\n    margin-bottom: 8px;\n}\n\n.dlg-header-row i {\n    color: var(--mj-text-muted);\n    font-size: 1.2em;\n}\n\n.dlg-header-row h5 {\n    margin: 0;\n    color: var(--mj-text-primary);\n    font-weight: 600;\n}\n\n.dlg-header p {\n    margin: 0;\n    color: var(--mj-text-muted);\n    font-size: 0.9em;\n}\n\n.dlg-header .required-marker {\n    color: var(--mj-status-error);\n}\n\n/* Loading state */\n.dlg-loading {\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    padding: 40px;\n}\n\n.dlg-loading i {\n    font-size: 24px;\n    color: var(--mj-text-muted);\n    margin-right: 12px;\n}\n\n.dlg-loading span {\n    color: var(--mj-text-muted);\n}\n\n/* Panel title */\n.dlg-panel-title {\n    display: flex;\n    align-items: center;\n    gap: 8px;\n    font-weight: 600;\n}\n\n.dlg-panel-title i {\n    color: var(--mj-text-muted);\n}\n\n.dlg-panel-title .count-badge {\n    background: var(--mj-brand-primary);\n    color: var(--mj-text-inverse);\n    padding: 2px 6px;\n    border-radius: 10px;\n    font-size: 0.7em;\n}\n\n/* Info text */\n.dlg-info-text {\n    margin-bottom: 12px;\n    color: var(--mj-text-muted);\n    font-size: 0.85em;\n}\n\n/* Parameters table */\n.params-table {\n    border: 1px solid var(--mj-border-default);\n    border-radius: 6px;\n    background: var(--mj-bg-surface-card);\n}\n\n.params-table-header {\n    display: grid;\n    grid-template-columns: 200px 1fr 60px;\n    gap: 12px;\n    padding: 12px 16px;\n    background: var(--mj-bg-surface-sunken);\n    font-weight: 600;\n    font-size: 0.85em;\n    color: var(--mj-text-secondary);\n    border-bottom: 1px solid var(--mj-border-default);\n}\n\n.params-table-row {\n    display: grid;\n    grid-template-columns: 200px 1fr 60px;\n    gap: 12px;\n    padding: 12px 16px;\n    border-bottom: 1px solid var(--mj-border-default);\n    align-items: start;\n    background: var(--mj-bg-surface);\n}\n\n.param-source-icon-template {\n    color: var(--mj-status-success);\n    font-size: 0.75em;\n}\n\n.param-source-icon-custom {\n    color: var(--mj-status-warning);\n    font-size: 0.75em;\n}\n\n.param-required-marker {\n    color: var(--mj-status-error);\n    font-weight: bold;\n}\n\n.param-key-text {\n    font-family: 'Courier New', monospace;\n    font-size: 0.9em;\n    font-weight: 500;\n    color: var(--mj-text-primary);\n    padding: 4px 0;\n    word-break: break-word;\n}\n\n.param-description-text {\n    font-size: 0.75em;\n    color: var(--mj-text-muted);\n    margin-top: 2px;\n    font-style: italic;\n    word-break: break-word;\n}\n\n.param-type-text {\n    font-size: 0.7em;\n    color: var(--mj-brand-primary);\n    margin-top: 2px;\n}\n\n.param-actions {\n    display: flex;\n    align-items: start;\n    justify-content: center;\n    padding-top: 4px;\n}\n\n/* Add parameter row */\n.add-param-row {\n    padding: 12px 16px;\n    text-align: center;\n    background: var(--mj-bg-surface);\n    border-top: 1px solid var(--mj-border-default);\n}\n\n/* No params state */\n.no-params-state {\n    text-align: center;\n    padding: 20px;\n    color: var(--mj-text-muted);\n}\n\n.no-params-state i {\n    font-size: 2em;\n    margin-bottom: 12px;\n    opacity: 0.5;\n}\n\n.no-params-state p {\n    margin: 0 0 12px 0;\n}\n\n/* JSON preview */\n.json-preview-box {\n    background: var(--mj-bg-surface-card);\n    border: 1px solid var(--mj-border-default);\n    border-radius: 4px;\n    padding: 12px;\n    font-family: 'Courier New', monospace;\n    font-size: 0.85em;\n    color: var(--mj-text-primary);\n    max-height: 200px;\n    overflow-y: auto;\n}\n\n.json-preview-box pre {\n    margin: 0;\n    white-space: pre-wrap;\n}\n\n/* Result status badges */\n.result-badge-success {\n    background: color-mix(in srgb, var(--mj-status-success) 15%, var(--mj-bg-surface));\n    color: var(--mj-status-success);\n    border: 1px solid color-mix(in srgb, var(--mj-status-success) 30%, transparent);\n    padding: 2px 6px;\n    border-radius: 10px;\n    font-size: 0.7em;\n    font-weight: 600;\n}\n\n.result-badge-error {\n    background: color-mix(in srgb, var(--mj-status-error) 15%, var(--mj-bg-surface));\n    color: var(--mj-status-error);\n    border: 1px solid color-mix(in srgb, var(--mj-status-error) 30%, transparent);\n    padding: 2px 6px;\n    border-radius: 10px;\n    font-size: 0.7em;\n    font-weight: 600;\n}\n\n/* Result stats box */\n.result-stats {\n    display: grid;\n    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));\n    gap: 12px;\n    margin-bottom: 16px;\n    padding: 12px;\n    border: 1px solid var(--mj-border-default);\n    border-radius: 6px;\n}\n\n.result-stats.success {\n    background: color-mix(in srgb, var(--mj-status-success) 10%, var(--mj-bg-surface));\n}\n\n.result-stats.error {\n    background: color-mix(in srgb, var(--mj-status-error) 10%, var(--mj-bg-surface));\n}\n\n.result-stat {\n    text-align: center;\n}\n\n.result-stat-label {\n    font-size: 0.75em;\n    margin-bottom: 2px;\n    color: var(--mj-text-muted);\n}\n\n.result-stat-value {\n    font-weight: 600;\n    color: var(--mj-text-primary);\n}\n\n/* Output section */\n.output-header {\n    margin: 0 0 8px 0;\n    color: var(--mj-text-primary);\n    display: flex;\n    align-items: center;\n    gap: 6px;\n}\n\n.output-header .success-icon {\n    color: var(--mj-status-success);\n}\n\n.output-header .error-icon {\n    color: var(--mj-status-error);\n}\n\n.output-box {\n    background: var(--mj-bg-surface-card);\n    border: 1px solid var(--mj-border-default);\n    border-radius: 4px;\n    padding: 12px;\n    font-family: 'Courier New', monospace;\n    font-size: 0.9em;\n    white-space: pre-wrap;\n    overflow: auto;\n    height: 150px;\n    color: var(--mj-text-primary);\n}\n\n.error-output-box {\n    background: color-mix(in srgb, var(--mj-status-error) 8%, var(--mj-bg-surface));\n    border: 1px solid color-mix(in srgb, var(--mj-status-error) 20%, var(--mj-bg-surface));\n    border-radius: 4px;\n    padding: 12px;\n    color: var(--mj-status-error);\n    font-family: 'Courier New', monospace;\n    font-size: 0.9em;\n    white-space: pre-wrap;\n    overflow: auto;\n    height: 150px;\n}\n\n/* No results state */\n.no-results-state {\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    padding: 40px;\n    color: var(--mj-text-muted);\n    flex: 1;\n}\n\n.no-results-state i {\n    font-size: 3em;\n    margin-bottom: 12px;\n    opacity: 0.3;\n}\n\n.no-results-state p {\n    margin: 0;\n}\n"] }]
    }], null, { template: [{
            type: Input
        }], isVisible: [{
            type: Input
        }], isVisibleChange: [{
            type: Output
        }], onClose: [{
            type: Output
        }] }); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(TemplateParamDialogComponent, { className: "TemplateParamDialogComponent", filePath: "src/lib/custom/Templates/template-param-dialog.component.ts", lineNumber: 29 }); })();
//# sourceMappingURL=template-param-dialog.component.js.map