import { Component, Input, Output, EventEmitter, ChangeDetectionStrategy } from '@angular/core';
import { BehaviorSubject, Subject, combineLatest } from 'rxjs';
import { debounceTime, distinctUntilChanged, takeUntil } from 'rxjs/operators';
import { CompositeKey } from '@memberjunction/core';
import { UserInfoEngine } from '@memberjunction/core-entities';
import { SharedService } from '@memberjunction/ng-shared';
import * as i0 from "@angular/core";
import * as i1 from "../services/scheduling-instrumentation.service";
import * as i2 from "@angular/common";
import * as i3 from "@angular/forms";
import * as i4 from "@memberjunction/ng-ui-components";
import * as i5 from "@memberjunction/ng-shared-generic";
function SchedulingActivityComponent_For_10_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "option", 8);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const s_r1 = ctx.$implicit;
    i0.ɵɵproperty("value", s_r1);
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(s_r1);
} }
function SchedulingActivityComponent_For_15_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "option", 8);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const name_r2 = ctx.$implicit;
    i0.ɵɵproperty("value", name_r2);
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(name_r2);
} }
function SchedulingActivityComponent_For_19_Template(rf, ctx) { if (rf & 1) {
    const _r3 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "button", 16);
    i0.ɵɵlistener("click", function SchedulingActivityComponent_For_19_Template_button_click_0_listener() { const range_r4 = i0.ɵɵrestoreView(_r3).$implicit; const ctx_r4 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r4.OnTimeRangeChange(range_r4.value)); });
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const range_r4 = ctx.$implicit;
    const ctx_r4 = i0.ɵɵnextContext();
    i0.ɵɵclassProp("active", ctx_r4.SelectedTimeRange === range_r4.value);
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate1(" ", range_r4.label, " ");
} }
function SchedulingActivityComponent_Conditional_23_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 14);
    i0.ɵɵelement(1, "mj-loading", 17);
    i0.ɵɵelementEnd();
} }
function SchedulingActivityComponent_Conditional_24_Conditional_1_For_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 27)(1, "div", 28);
    i0.ɵɵelement(2, "i");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(3, "div", 29)(4, "div", 30);
    i0.ɵɵtext(5);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(6, "div", 31)(7, "span");
    i0.ɵɵtext(8);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(9, "span", 32);
    i0.ɵɵtext(10, "\u00B7");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(11, "span");
    i0.ɵɵtext(12);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(13, "span", 32);
    i0.ɵɵtext(14, "\u00B7");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(15, "span");
    i0.ɵɵtext(16);
    i0.ɵɵelementEnd()()();
    i0.ɵɵelementStart(17, "div", 33);
    i0.ɵɵelement(18, "div", 34);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const type_r6 = ctx.$implicit;
    const ctx_r4 = i0.ɵɵnextContext(3);
    i0.ɵɵadvance(2);
    i0.ɵɵclassMap(ctx_r4.GetTypeIcon(type_r6.typeName));
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate(type_r6.typeName);
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate1("", type_r6.activeJobsCount, " active");
    i0.ɵɵadvance(4);
    i0.ɵɵtextInterpolate1("", type_r6.totalRuns, " runs");
    i0.ɵɵadvance(3);
    i0.ɵɵstyleProp("color", ctx_r4.GetSuccessRateColor(type_r6.successRate));
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate1(" ", ctx_r4.FormatPercentage(type_r6.successRate), " ");
    i0.ɵɵadvance(2);
    i0.ɵɵstyleProp("width", type_r6.successRate * 100 + "%")("background", ctx_r4.GetSuccessRateColor(type_r6.successRate));
} }
function SchedulingActivityComponent_Conditional_24_Conditional_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 18);
    i0.ɵɵrepeaterCreate(1, SchedulingActivityComponent_Conditional_24_Conditional_1_For_2_Template, 19, 12, "div", 27, i0.ɵɵrepeaterTrackByIdentity);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r4 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance();
    i0.ɵɵrepeater(ctx_r4.JobTypes);
} }
function SchedulingActivityComponent_Conditional_24_Conditional_2_For_10_Conditional_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "div", 47);
} if (rf & 2) {
    const trend_r7 = i0.ɵɵnextContext().$implicit;
    const ctx_r4 = i0.ɵɵnextContext(3);
    i0.ɵɵstyleProp("height", ctx_r4.GetBarHeight(trend_r7.failures));
    i0.ɵɵproperty("title", trend_r7.failures + " failed");
} }
function SchedulingActivityComponent_Conditional_24_Conditional_2_For_10_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 38)(1, "div", 43);
    i0.ɵɵelement(2, "div", 44);
    i0.ɵɵconditionalCreate(3, SchedulingActivityComponent_Conditional_24_Conditional_2_For_10_Conditional_3_Template, 1, 3, "div", 45);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(4, "div", 46);
    i0.ɵɵtext(5);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const trend_r7 = ctx.$implicit;
    const ɵ$index_105_r8 = ctx.$index;
    const ctx_r4 = i0.ɵɵnextContext(3);
    i0.ɵɵadvance(2);
    i0.ɵɵstyleProp("height", ctx_r4.GetBarHeight(trend_r7.successes));
    i0.ɵɵproperty("title", trend_r7.successes + " successful");
    i0.ɵɵadvance();
    i0.ɵɵconditional(trend_r7.failures > 0 ? 3 : -1);
    i0.ɵɵadvance();
    i0.ɵɵclassProp("hidden-label", !ctx_r4.ShouldShowLabel(ɵ$index_105_r8));
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(ctx_r4.FormatChartLabel(trend_r7.timestamp));
} }
function SchedulingActivityComponent_Conditional_24_Conditional_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 19)(1, "div", 20)(2, "div", 21);
    i0.ɵɵelement(3, "i", 35);
    i0.ɵɵtext(4, " Execution Trends ");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(5, "span", 23);
    i0.ɵɵtext(6);
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(7, "div", 36)(8, "div", 37);
    i0.ɵɵrepeaterCreate(9, SchedulingActivityComponent_Conditional_24_Conditional_2_For_10_Template, 6, 7, "div", 38, i0.ɵɵrepeaterTrackByIdentity);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(11, "div", 39)(12, "span", 40);
    i0.ɵɵelement(13, "span", 41);
    i0.ɵɵtext(14, " Successful");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(15, "span", 40);
    i0.ɵɵelement(16, "span", 42);
    i0.ɵɵtext(17, " Failed");
    i0.ɵɵelementEnd()()()();
} if (rf & 2) {
    const ctx_r4 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(6);
    i0.ɵɵtextInterpolate1("", ctx_r4.FilteredExecutions.length, " executions");
    i0.ɵɵadvance(3);
    i0.ɵɵrepeater(ctx_r4.Trends);
} }
function SchedulingActivityComponent_Conditional_24_Conditional_11_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 25);
    i0.ɵɵelement(1, "i", 48);
    i0.ɵɵelementStart(2, "span");
    i0.ɵɵtext(3, "No executions found for this time range");
    i0.ɵɵelementEnd()();
} }
function SchedulingActivityComponent_Conditional_24_Conditional_12_For_16_Conditional_15_Conditional_31_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 59)(1, "span", 60);
    i0.ɵɵtext(2, "Error");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(3, "span", 67);
    i0.ɵɵtext(4);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const exec_r10 = i0.ɵɵnextContext(2).$implicit;
    i0.ɵɵadvance(4);
    i0.ɵɵtextInterpolate(exec_r10.errorMessage);
} }
function SchedulingActivityComponent_Conditional_24_Conditional_12_For_16_Conditional_15_Template(rf, ctx) { if (rf & 1) {
    const _r11 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "tr", 56)(1, "td")(2, "div", 57)(3, "div", 58)(4, "div", 59)(5, "span", 60);
    i0.ɵɵtext(6, "Job Name");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(7, "span", 61);
    i0.ɵɵtext(8);
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(9, "div", 59)(10, "span", 60);
    i0.ɵɵtext(11, "Started");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(12, "span", 61);
    i0.ɵɵtext(13);
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(14, "div", 59)(15, "span", 60);
    i0.ɵɵtext(16, "Completed");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(17, "span", 61);
    i0.ɵɵtext(18);
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(19, "div", 59)(20, "span", 60);
    i0.ɵɵtext(21, "Duration");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(22, "span", 61);
    i0.ɵɵtext(23);
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(24, "div", 59)(25, "span", 60);
    i0.ɵɵtext(26, "Status");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(27, "span", 61)(28, "span", 52);
    i0.ɵɵelement(29, "i");
    i0.ɵɵtext(30);
    i0.ɵɵelementEnd()()();
    i0.ɵɵconditionalCreate(31, SchedulingActivityComponent_Conditional_24_Conditional_12_For_16_Conditional_15_Conditional_31_Template, 5, 1, "div", 59);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(32, "div", 62)(33, "button", 63);
    i0.ɵɵlistener("click", function SchedulingActivityComponent_Conditional_24_Conditional_12_For_16_Conditional_15_Template_button_click_33_listener($event) { i0.ɵɵrestoreView(_r11); const exec_r10 = i0.ɵɵnextContext().$implicit; const ctx_r4 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r4.OpenExecutionRecord(exec_r10, $event)); });
    i0.ɵɵelement(34, "i", 64);
    i0.ɵɵtext(35, " Open Run Record ");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(36, "button", 65);
    i0.ɵɵlistener("click", function SchedulingActivityComponent_Conditional_24_Conditional_12_For_16_Conditional_15_Template_button_click_36_listener($event) { i0.ɵɵrestoreView(_r11); const exec_r10 = i0.ɵɵnextContext().$implicit; const ctx_r4 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r4.OpenJobRecord(exec_r10, $event)); });
    i0.ɵɵelement(37, "i", 66);
    i0.ɵɵtext(38, " Open Job ");
    i0.ɵɵelementEnd()()()()();
} if (rf & 2) {
    const exec_r10 = i0.ɵɵnextContext().$implicit;
    const ctx_r4 = i0.ɵɵnextContext(3);
    i0.ɵɵadvance();
    i0.ɵɵattribute("colspan", 6);
    i0.ɵɵadvance(7);
    i0.ɵɵtextInterpolate(exec_r10.jobName);
    i0.ɵɵadvance(5);
    i0.ɵɵtextInterpolate(ctx_r4.FormatDateTime(exec_r10.startedAt));
    i0.ɵɵadvance(5);
    i0.ɵɵtextInterpolate(exec_r10.completedAt ? ctx_r4.FormatDateTime(exec_r10.completedAt) : "-");
    i0.ɵɵadvance(5);
    i0.ɵɵtextInterpolate(ctx_r4.FormatDuration(exec_r10.duration));
    i0.ɵɵadvance(5);
    i0.ɵɵproperty("ngClass", ctx_r4.GetStatusClass(exec_r10.status));
    i0.ɵɵadvance();
    i0.ɵɵclassMap(ctx_r4.GetStatusIcon(exec_r10.status));
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate1(" ", exec_r10.status, " ");
    i0.ɵɵadvance();
    i0.ɵɵconditional(exec_r10.errorMessage ? 31 : -1);
} }
function SchedulingActivityComponent_Conditional_24_Conditional_12_For_16_Template(rf, ctx) { if (rf & 1) {
    const _r9 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "tr", 50);
    i0.ɵɵlistener("click", function SchedulingActivityComponent_Conditional_24_Conditional_12_For_16_Template_tr_click_0_listener() { const exec_r10 = i0.ɵɵrestoreView(_r9).$implicit; const ctx_r4 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r4.ToggleExpand(exec_r10)); });
    i0.ɵɵelementStart(1, "td", 49);
    i0.ɵɵelement(2, "i", 51);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(3, "td")(4, "span", 52);
    i0.ɵɵelement(5, "i");
    i0.ɵɵtext(6);
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(7, "td", 53);
    i0.ɵɵtext(8);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(9, "td", 54);
    i0.ɵɵtext(10);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(11, "td", 54);
    i0.ɵɵtext(12);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(13, "td", 55);
    i0.ɵɵtext(14);
    i0.ɵɵelementEnd()();
    i0.ɵɵconditionalCreate(15, SchedulingActivityComponent_Conditional_24_Conditional_12_For_16_Conditional_15_Template, 39, 10, "tr", 56);
} if (rf & 2) {
    const exec_r10 = ctx.$implicit;
    const ctx_r4 = i0.ɵɵnextContext(3);
    i0.ɵɵclassProp("expanded", ctx_r4.IsExpanded(exec_r10));
    i0.ɵɵadvance(2);
    i0.ɵɵclassProp("rotated", ctx_r4.IsExpanded(exec_r10));
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngClass", ctx_r4.GetStatusClass(exec_r10.status));
    i0.ɵɵadvance();
    i0.ɵɵclassMap(ctx_r4.GetStatusIcon(exec_r10.status));
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate1(" ", exec_r10.status, " ");
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate(exec_r10.jobName);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate(ctx_r4.FormatDateTime(exec_r10.startedAt));
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate(ctx_r4.FormatDuration(exec_r10.duration));
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate(ctx_r4.TruncateError(exec_r10.errorMessage));
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r4.IsExpanded(exec_r10) ? 15 : -1);
} }
function SchedulingActivityComponent_Conditional_24_Conditional_12_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "table", 26)(1, "thead")(2, "tr");
    i0.ɵɵelement(3, "th", 49);
    i0.ɵɵelementStart(4, "th");
    i0.ɵɵtext(5, "Status");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(6, "th");
    i0.ɵɵtext(7, "Job Name");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(8, "th");
    i0.ɵɵtext(9, "Started");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(10, "th");
    i0.ɵɵtext(11, "Duration");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(12, "th");
    i0.ɵɵtext(13, "Error");
    i0.ɵɵelementEnd()()();
    i0.ɵɵelementStart(14, "tbody");
    i0.ɵɵrepeaterCreate(15, SchedulingActivityComponent_Conditional_24_Conditional_12_For_16_Template, 16, 13, null, null, i0.ɵɵrepeaterTrackByIdentity);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const ctx_r4 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(15);
    i0.ɵɵrepeater(ctx_r4.FilteredExecutions);
} }
function SchedulingActivityComponent_Conditional_24_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 15);
    i0.ɵɵconditionalCreate(1, SchedulingActivityComponent_Conditional_24_Conditional_1_Template, 3, 0, "div", 18);
    i0.ɵɵconditionalCreate(2, SchedulingActivityComponent_Conditional_24_Conditional_2_Template, 18, 1, "div", 19);
    i0.ɵɵelementStart(3, "div", 19)(4, "div", 20)(5, "div", 21);
    i0.ɵɵelement(6, "i", 22);
    i0.ɵɵtext(7, " Execution History ");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(8, "span", 23);
    i0.ɵɵtext(9);
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(10, "div", 24);
    i0.ɵɵconditionalCreate(11, SchedulingActivityComponent_Conditional_24_Conditional_11_Template, 4, 0, "div", 25);
    i0.ɵɵconditionalCreate(12, SchedulingActivityComponent_Conditional_24_Conditional_12_Template, 17, 0, "table", 26);
    i0.ɵɵelementEnd()()();
} if (rf & 2) {
    const ctx_r4 = i0.ɵɵnextContext();
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r4.JobTypes.length > 0 ? 1 : -1);
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r4.Trends.length > 0 ? 2 : -1);
    i0.ɵɵadvance(7);
    i0.ɵɵtextInterpolate2("", ctx_r4.FilteredExecutions.length, " of ", ctx_r4.Executions.length);
    i0.ɵɵadvance(2);
    i0.ɵɵconditional(ctx_r4.FilteredExecutions.length === 0 ? 11 : -1);
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r4.FilteredExecutions.length > 0 ? 12 : -1);
} }
export class SchedulingActivityComponent {
    schedulingService;
    cdr;
    initialState = {};
    stateChange = new EventEmitter();
    Executions = [];
    FilteredExecutions = [];
    Trends = [];
    JobTypes = [];
    IsLoading = true;
    SearchTerm = '';
    StatusFilter = '';
    JobNameFilter = '';
    SelectedTimeRange = '7d';
    StatusOptions = ['', 'Running', 'Completed', 'Failed', 'Cancelled', 'Timeout'];
    UniqueJobNames = [];
    ExpandedExecutionIds = new Set();
    TimeRanges = [
        { value: '24h', label: '24 Hours' },
        { value: '7d', label: '7 Days' },
        { value: '30d', label: '30 Days' },
        { value: '90d', label: '90 Days' }
    ];
    static SEARCH_STATE_KEY = 'Scheduling.ActivitySearchState';
    searchSubject = new BehaviorSubject('');
    statusSubject = new BehaviorSubject('');
    jobNameSubject = new BehaviorSubject('');
    settingsPersistSubject = new Subject();
    destroy$ = new Subject();
    subscriptions = [];
    settingsLoaded = false;
    constructor(schedulingService, cdr) {
        this.schedulingService = schedulingService;
        this.cdr = cdr;
    }
    ngOnInit() {
        this.loadUserSettings();
        this.restoreState();
        this.applyTimeRange();
        this.setupFilters();
        this.setupSettingsPersistence();
        this.subscriptions.push(this.schedulingService.executionHistory$.subscribe(execs => {
            this.Executions = execs;
            this.IsLoading = false;
            this.applyFilters();
            this.cdr.markForCheck();
        }), this.schedulingService.executionTrends$.subscribe(trends => {
            this.Trends = trends;
            this.cdr.markForCheck();
        }), this.schedulingService.jobTypes$.subscribe(types => {
            this.JobTypes = types;
            this.cdr.markForCheck();
        }));
    }
    ngOnDestroy() {
        this.destroy$.next();
        this.destroy$.complete();
        this.subscriptions.forEach(s => s.unsubscribe());
    }
    loadUserSettings() {
        try {
            const stateStr = UserInfoEngine.Instance.GetSetting(SchedulingActivityComponent.SEARCH_STATE_KEY);
            if (stateStr) {
                const state = JSON.parse(stateStr);
                if (state.searchTerm)
                    this.SearchTerm = state.searchTerm;
                if (state.statusFilter)
                    this.StatusFilter = state.statusFilter;
                if (state.jobNameFilter)
                    this.JobNameFilter = state.jobNameFilter;
                if (state.timeRange)
                    this.SelectedTimeRange = state.timeRange;
            }
        }
        catch (error) {
            console.warn('[SchedulingActivity] Failed to load user settings:', error);
        }
        finally {
            this.settingsLoaded = true;
        }
    }
    restoreState() {
        if (this.initialState) {
            if (this.initialState['searchTerm'])
                this.SearchTerm = this.initialState['searchTerm'];
            if (this.initialState['statusFilter'])
                this.StatusFilter = this.initialState['statusFilter'];
            if (this.initialState['jobNameFilter'])
                this.JobNameFilter = this.initialState['jobNameFilter'];
            if (this.initialState['timeRange'])
                this.SelectedTimeRange = this.initialState['timeRange'];
        }
    }
    setupSettingsPersistence() {
        this.settingsPersistSubject.pipe(debounceTime(500), takeUntil(this.destroy$)).subscribe(() => {
            this.persistSearchState();
        });
    }
    persistSearchState() {
        if (!this.settingsLoaded)
            return;
        try {
            const state = {
                searchTerm: this.SearchTerm,
                statusFilter: this.StatusFilter,
                jobNameFilter: this.JobNameFilter,
                timeRange: this.SelectedTimeRange
            };
            UserInfoEngine.Instance.SetSettingDebounced(SchedulingActivityComponent.SEARCH_STATE_KEY, JSON.stringify(state));
        }
        catch (error) {
            console.warn('[SchedulingActivity] Failed to persist search state:', error);
        }
    }
    setupFilters() {
        this.subscriptions.push(combineLatest([
            this.searchSubject.pipe(debounceTime(300), distinctUntilChanged()),
            this.statusSubject.pipe(distinctUntilChanged()),
            this.jobNameSubject.pipe(distinctUntilChanged())
        ]).subscribe(() => {
            this.applyFilters();
            this.emitState();
            this.cdr.markForCheck();
        }));
        this.searchSubject.next(this.SearchTerm);
        this.statusSubject.next(this.StatusFilter);
        this.jobNameSubject.next(this.JobNameFilter);
    }
    OnSearchChange(term) {
        this.SearchTerm = term;
        this.searchSubject.next(term);
    }
    OnStatusFilterChange(status) {
        this.StatusFilter = status;
        this.statusSubject.next(status);
    }
    OnJobNameFilterChange(name) {
        this.JobNameFilter = name;
        this.jobNameSubject.next(name);
    }
    ShouldShowLabel(index) {
        const total = this.Trends.length;
        if (total <= 10)
            return true;
        const step = Math.ceil(total / 8);
        return index % step === 0 || index === total - 1;
    }
    OnTimeRangeChange(range) {
        this.SelectedTimeRange = range;
        this.applyTimeRange();
        this.emitState();
    }
    Refresh() {
        this.schedulingService.refresh();
    }
    ToggleExpand(exec) {
        if (this.ExpandedExecutionIds.has(exec.id)) {
            this.ExpandedExecutionIds.delete(exec.id);
        }
        else {
            this.ExpandedExecutionIds.add(exec.id);
        }
        this.cdr.markForCheck();
    }
    IsExpanded(exec) {
        return this.ExpandedExecutionIds.has(exec.id);
    }
    OpenExecutionRecord(exec, event) {
        event.stopPropagation();
        const compositeKey = new CompositeKey();
        compositeKey.LoadFromSingleKeyValuePair('ID', exec.id);
        SharedService.Instance.OpenEntityRecord('MJ: Scheduled Job Runs', compositeKey);
    }
    OpenJobRecord(exec, event) {
        event.stopPropagation();
        const compositeKey = new CompositeKey();
        compositeKey.LoadFromSingleKeyValuePair('ID', exec.jobId);
        SharedService.Instance.OpenEntityRecord('MJ: Scheduled Jobs', compositeKey);
    }
    GetStatusIcon(status) {
        switch (status) {
            case 'Running': return 'fa-solid fa-spinner fa-spin';
            case 'Completed': return 'fa-solid fa-circle-check';
            case 'Failed': return 'fa-solid fa-circle-xmark';
            case 'Cancelled': return 'fa-solid fa-ban';
            case 'Timeout': return 'fa-solid fa-clock';
            default: return 'fa-solid fa-circle-question';
        }
    }
    GetStatusClass(status) {
        switch (status) {
            case 'Running': return 'status-running';
            case 'Completed': return 'status-success';
            case 'Failed': return 'status-error';
            case 'Cancelled': return 'status-warning';
            case 'Timeout': return 'status-warning';
            default: return '';
        }
    }
    GetTypeIcon(name) {
        const lower = name.toLowerCase();
        if (lower.includes('agent'))
            return 'fa-solid fa-robot';
        if (lower.includes('action'))
            return 'fa-solid fa-bolt';
        return 'fa-solid fa-gear';
    }
    GetSuccessRateColor(rate) {
        if (rate >= 0.9)
            return '#10b981';
        if (rate >= 0.7)
            return '#f59e0b';
        return '#ef4444';
    }
    FormatDuration(ms) {
        if (ms == null)
            return '-';
        const seconds = Math.floor(ms / 1000);
        if (seconds < 60)
            return `${seconds}s`;
        const minutes = Math.floor(seconds / 60);
        const remainingSeconds = seconds % 60;
        if (minutes < 60)
            return `${minutes}m ${remainingSeconds}s`;
        const hours = Math.floor(minutes / 60);
        return `${hours}h ${minutes % 60}m`;
    }
    FormatDateTime(date) {
        return date.toLocaleString(undefined, {
            month: 'numeric', day: 'numeric', year: '2-digit',
            hour: 'numeric', minute: '2-digit', hour12: true
        });
    }
    FormatChartLabel(date) {
        const hours = (this.schedulingService.CurrentDateRange.end.getTime() -
            this.schedulingService.CurrentDateRange.start.getTime()) / (1000 * 60 * 60);
        if (hours <= 24) {
            return date.toLocaleTimeString(undefined, { hour: 'numeric', minute: '2-digit', hour12: true });
        }
        return date.toLocaleDateString(undefined, { month: 'short', day: 'numeric' });
    }
    GetMaxTrendValue() {
        if (this.Trends.length === 0)
            return 1;
        return Math.max(...this.Trends.map(t => t.executions), 1);
    }
    GetBarHeight(count) {
        const max = this.GetMaxTrendValue();
        return `${Math.max((count / max) * 100, 2)}%`;
    }
    FormatPercentage(value) {
        return `${(value * 100).toFixed(1)}%`;
    }
    TruncateError(msg) {
        if (!msg)
            return '-';
        return msg.length > 60 ? msg.substring(0, 60) + '...' : msg;
    }
    applyTimeRange() {
        const now = new Date();
        let start;
        switch (this.SelectedTimeRange) {
            case '24h':
                start = new Date(now.getTime() - 24 * 60 * 60 * 1000);
                break;
            case '7d':
                start = new Date(now.getTime() - 7 * 24 * 60 * 60 * 1000);
                break;
            case '30d':
                start = new Date(now.getTime() - 30 * 24 * 60 * 60 * 1000);
                break;
            case '90d':
                start = new Date(now.getTime() - 90 * 24 * 60 * 60 * 1000);
                break;
        }
        this.schedulingService.setDateRange(start, now);
    }
    applyFilters() {
        this.buildUniqueJobNames();
        let filtered = [...this.Executions];
        if (this.SearchTerm) {
            const term = this.SearchTerm.toLowerCase();
            filtered = filtered.filter(e => e.jobName.toLowerCase().includes(term) ||
                (e.errorMessage && e.errorMessage.toLowerCase().includes(term)));
        }
        if (this.StatusFilter) {
            filtered = filtered.filter(e => e.status === this.StatusFilter);
        }
        if (this.JobNameFilter) {
            filtered = filtered.filter(e => e.jobName === this.JobNameFilter);
        }
        this.FilteredExecutions = filtered;
    }
    buildUniqueJobNames() {
        const names = new Set();
        for (const exec of this.Executions) {
            names.add(exec.jobName);
        }
        this.UniqueJobNames = Array.from(names).sort();
    }
    emitState() {
        this.stateChange.emit({
            searchTerm: this.SearchTerm,
            statusFilter: this.StatusFilter,
            jobNameFilter: this.JobNameFilter,
            timeRange: this.SelectedTimeRange
        });
        this.settingsPersistSubject.next();
    }
    static ɵfac = function SchedulingActivityComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || SchedulingActivityComponent)(i0.ɵɵdirectiveInject(i1.SchedulingInstrumentationService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); };
    static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SchedulingActivityComponent, selectors: [["app-scheduling-activity"]], inputs: { initialState: "initialState" }, outputs: { stateChange: "stateChange" }, standalone: false, decls: 25, vars: 5, consts: [[1, "activity-container"], [1, "activity-toolbar"], [1, "toolbar-left"], [1, "search-box"], [1, "fa-solid", "fa-search"], ["type", "text", "placeholder", "Search executions...", 3, "input", "value"], [1, "filter-select", 3, "change", "value"], ["value", ""], [3, "value"], [1, "toolbar-right"], [1, "time-range-group"], [1, "range-btn", 3, "active"], ["mjButton", "", "variant", "secondary", 3, "click"], [1, "fa-solid", "fa-arrows-rotate"], [1, "loading-container"], [1, "activity-content"], [1, "range-btn", 3, "click"], ["text", "Loading activity...", "size", "medium"], [1, "type-cards-row"], [1, "panel"], [1, "panel-header"], [1, "panel-title"], [1, "fa-solid", "fa-clock-rotate-left"], [1, "result-count"], [1, "panel-body", "table-container"], [1, "empty-state-small"], [1, "data-table"], [1, "type-card"], [1, "type-card-icon"], [1, "type-card-info"], [1, "type-card-name"], [1, "type-card-stats"], [1, "dot"], [1, "type-card-bar"], [1, "type-bar-fill"], [1, "fa-solid", "fa-chart-bar"], [1, "panel-body", "chart-container"], [1, "trend-chart"], [1, "chart-column"], [1, "chart-legend"], [1, "legend-item"], [1, "legend-dot", "success"], [1, "legend-dot", "failure"], [1, "bars-wrapper"], [1, "bar", "success-bar", 3, "title"], [1, "bar", "failure-bar", 3, "height", "title"], [1, "chart-label"], [1, "bar", "failure-bar", 3, "title"], [1, "fa-solid", "fa-inbox"], [1, "col-expand"], [1, "exec-row", 3, "click"], [1, "fa-solid", "fa-chevron-right", "expand-icon"], [1, "exec-status-badge", 3, "ngClass"], [1, "cell-name"], [1, "cell-meta"], [1, "cell-error"], [1, "exec-detail-row"], [1, "exec-detail-content"], [1, "exec-detail-grid"], [1, "detail-item"], [1, "detail-label"], [1, "detail-value"], [1, "exec-detail-actions"], [1, "detail-action-btn", 3, "click"], [1, "fa-solid", "fa-arrow-up-right-from-square"], [1, "detail-action-btn", "secondary", 3, "click"], [1, "fa-solid", "fa-briefcase"], [1, "detail-value", "error-text"]], template: function SchedulingActivityComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "div", 2)(3, "div", 3);
            i0.ɵɵelement(4, "i", 4);
            i0.ɵɵelementStart(5, "input", 5);
            i0.ɵɵlistener("input", function SchedulingActivityComponent_Template_input_input_5_listener($event) { return ctx.OnSearchChange($event.target.value); });
            i0.ɵɵelementEnd()();
            i0.ɵɵelementStart(6, "select", 6);
            i0.ɵɵlistener("change", function SchedulingActivityComponent_Template_select_change_6_listener($event) { return ctx.OnStatusFilterChange($event.target.value); });
            i0.ɵɵelementStart(7, "option", 7);
            i0.ɵɵtext(8, "All Statuses");
            i0.ɵɵelementEnd();
            i0.ɵɵrepeaterCreate(9, SchedulingActivityComponent_For_10_Template, 2, 2, "option", 8, i0.ɵɵrepeaterTrackByIdentity);
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(11, "select", 6);
            i0.ɵɵlistener("change", function SchedulingActivityComponent_Template_select_change_11_listener($event) { return ctx.OnJobNameFilterChange($event.target.value); });
            i0.ɵɵelementStart(12, "option", 7);
            i0.ɵɵtext(13, "All Jobs");
            i0.ɵɵelementEnd();
            i0.ɵɵrepeaterCreate(14, SchedulingActivityComponent_For_15_Template, 2, 2, "option", 8, i0.ɵɵrepeaterTrackByIdentity);
            i0.ɵɵelementEnd()();
            i0.ɵɵelementStart(16, "div", 9)(17, "div", 10);
            i0.ɵɵrepeaterCreate(18, SchedulingActivityComponent_For_19_Template, 2, 3, "button", 11, i0.ɵɵrepeaterTrackByIdentity);
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(20, "button", 12);
            i0.ɵɵlistener("click", function SchedulingActivityComponent_Template_button_click_20_listener() { return ctx.Refresh(); });
            i0.ɵɵelement(21, "i", 13);
            i0.ɵɵtext(22, " Refresh ");
            i0.ɵɵelementEnd()()();
            i0.ɵɵconditionalCreate(23, SchedulingActivityComponent_Conditional_23_Template, 2, 0, "div", 14);
            i0.ɵɵconditionalCreate(24, SchedulingActivityComponent_Conditional_24_Template, 13, 6, "div", 15);
            i0.ɵɵelementEnd();
        } if (rf & 2) {
            i0.ɵɵadvance(5);
            i0.ɵɵproperty("value", ctx.SearchTerm);
            i0.ɵɵadvance();
            i0.ɵɵproperty("value", ctx.StatusFilter);
            i0.ɵɵadvance(3);
            i0.ɵɵrepeater(ctx.StatusOptions.slice(1));
            i0.ɵɵadvance(2);
            i0.ɵɵproperty("value", ctx.JobNameFilter);
            i0.ɵɵadvance(3);
            i0.ɵɵrepeater(ctx.UniqueJobNames);
            i0.ɵɵadvance(4);
            i0.ɵɵrepeater(ctx.TimeRanges);
            i0.ɵɵadvance(5);
            i0.ɵɵconditional(ctx.IsLoading ? 23 : -1);
            i0.ɵɵadvance();
            i0.ɵɵconditional(!ctx.IsLoading ? 24 : -1);
        } }, dependencies: [i2.NgClass, i3.NgSelectOption, i3.ɵNgSelectMultipleOption, i4.MJButtonDirective, i5.LoadingComponent], styles: [".activity-container[_ngcontent-%COMP%] {\n    display: flex;\n    flex-direction: column;\n    gap: 20px;\n}\n\n\n\n.activity-toolbar[_ngcontent-%COMP%] {\n    display: flex;\n    justify-content: space-between;\n    align-items: center;\n    flex-wrap: wrap;\n    gap: 12px;\n}\n\n.toolbar-left[_ngcontent-%COMP%] {\n    display: flex;\n    gap: 8px;\n    align-items: center;\n    flex-wrap: wrap;\n}\n\n.toolbar-right[_ngcontent-%COMP%] {\n    display: flex;\n    gap: 8px;\n    align-items: center;\n}\n\n.search-box[_ngcontent-%COMP%] {\n    display: flex;\n    align-items: center;\n    gap: 8px;\n    padding: 8px 14px;\n    background: var(--mj-bg-surface-card);\n    border: 1px solid var(--mj-border-default);\n    border-radius: 10px;\n    min-width: 220px;\n    transition: border-color 0.2s;\n}\n\n.search-box[_ngcontent-%COMP%]:focus-within {\n    border-color: var(--mj-brand-primary);\n    box-shadow: var(--mj-shadow-sm);\n}\n\n.search-box[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] { color: var(--mj-text-muted); font-size: 0.85rem; }\n\n.search-box[_ngcontent-%COMP%]   input[_ngcontent-%COMP%] {\n    border: none; outline: none; background: transparent;\n    font-size: 0.85rem; color: var(--mj-text-primary); width: 100%;\n}\n\n.filter-select[_ngcontent-%COMP%] {\n    padding: 8px 14px;\n    background: var(--mj-bg-surface-card);\n    border: 1px solid var(--mj-border-default);\n    border-radius: 10px;\n    font-size: 0.85rem;\n    color: var(--mj-text-secondary);\n    cursor: pointer;\n    outline: none;\n}\n\n.time-range-group[_ngcontent-%COMP%] {\n    display: flex;\n    background: var(--mj-bg-surface-card);\n    border: 1px solid var(--mj-border-default);\n    border-radius: 10px;\n    overflow: hidden;\n}\n\n.range-btn[_ngcontent-%COMP%] {\n    padding: 8px 14px;\n    border: none;\n    background: transparent;\n    font-size: 0.8rem;\n    font-weight: 500;\n    color: var(--mj-text-secondary);\n    cursor: pointer;\n    transition: all 0.2s;\n    border-right: 1px solid var(--mj-border-default);\n}\n\n.range-btn[_ngcontent-%COMP%]:last-child { border-right: none; }\n\n.range-btn[_ngcontent-%COMP%]:hover { background: var(--mj-bg-surface-sunken); }\n\n.range-btn.active[_ngcontent-%COMP%] {\n    background: var(--mj-brand-primary);\n    color: var(--mj-text-inverse);\n}\n\n.control-btn[_ngcontent-%COMP%] {\n    display: inline-flex;\n    align-items: center;\n    gap: 6px;\n    padding: 8px 16px;\n    background: var(--mj-bg-surface-card);\n    border: 1px solid var(--mj-border-default);\n    border-radius: 10px;\n    cursor: pointer;\n    font-size: 0.8rem;\n    font-weight: 500;\n    color: var(--mj-text-secondary);\n    transition: all 0.2s ease;\n}\n\n.control-btn[_ngcontent-%COMP%]:hover {\n    background: var(--mj-bg-surface-sunken);\n    border-color: var(--mj-border-strong);\n}\n\n.result-count[_ngcontent-%COMP%] {\n    font-size: 0.8rem;\n    color: var(--mj-text-muted);\n    white-space: nowrap;\n}\n\n.loading-container[_ngcontent-%COMP%] {\n    display: flex;\n    justify-content: center;\n    align-items: center;\n    min-height: 300px;\n}\n\n\n\n.type-cards-row[_ngcontent-%COMP%] {\n    display: flex;\n    gap: 16px;\n    flex-wrap: wrap;\n}\n\n.type-card[_ngcontent-%COMP%] {\n    display: flex;\n    align-items: center;\n    gap: 14px;\n    padding: 16px 20px;\n    background: var(--mj-bg-surface-card);\n    border-radius: 14px;\n    border: 1px solid var(--mj-border-default);\n    box-shadow: var(--mj-shadow-sm);\n    flex: 1;\n    min-width: 240px;\n    transition: all 0.2s ease;\n}\n\n.type-card[_ngcontent-%COMP%]:hover {\n    transform: translateY(-1px);\n    box-shadow: var(--mj-shadow-md);\n}\n\n.type-card-icon[_ngcontent-%COMP%] {\n    width: 44px;\n    height: 44px;\n    border-radius: 12px;\n    background: var(--mj-brand-primary);\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    color: var(--mj-text-inverse);\n    font-size: 1.1rem;\n    flex-shrink: 0;\n}\n\n.type-card-info[_ngcontent-%COMP%] {\n    flex: 1;\n}\n\n.type-card-name[_ngcontent-%COMP%] {\n    font-weight: 700;\n    color: var(--mj-text-primary);\n    font-size: 0.9rem;\n}\n\n.type-card-stats[_ngcontent-%COMP%] {\n    font-size: 0.75rem;\n    color: var(--mj-text-secondary);\n    margin-top: 2px;\n}\n\n.type-card-stats[_ngcontent-%COMP%]   .dot[_ngcontent-%COMP%] {\n    margin: 0 4px;\n}\n\n.type-card-bar[_ngcontent-%COMP%] {\n    width: 60px;\n    height: 6px;\n    background: var(--mj-bg-surface-sunken);\n    border-radius: 3px;\n    overflow: hidden;\n}\n\n.type-bar-fill[_ngcontent-%COMP%] {\n    height: 100%;\n    border-radius: 3px;\n    transition: width 0.5s;\n}\n\n\n\n.panel[_ngcontent-%COMP%] {\n    background: var(--mj-bg-surface-card);\n    border-radius: 16px;\n    border: 1px solid var(--mj-border-default);\n    box-shadow: var(--mj-shadow-sm);\n    overflow: hidden;\n}\n\n.panel-header[_ngcontent-%COMP%] {\n    display: flex;\n    justify-content: space-between;\n    align-items: center;\n    padding: 16px 20px;\n    background: var(--mj-bg-surface-sunken);\n    border-bottom: 1px solid var(--mj-border-default);\n}\n\n.panel-title[_ngcontent-%COMP%] {\n    font-size: 0.95rem;\n    font-weight: 700;\n    color: var(--mj-text-primary);\n    display: flex;\n    align-items: center;\n    gap: 8px;\n}\n\n.panel-title[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] { color: var(--mj-brand-primary); }\n\n.panel-body[_ngcontent-%COMP%] {\n    padding: 20px;\n}\n\n.chart-container[_ngcontent-%COMP%] {\n    padding: 20px;\n}\n\n.table-container[_ngcontent-%COMP%] {\n    padding: 0;\n    max-height: 600px;\n    overflow-y: auto;\n}\n\n\n\n.trend-chart[_ngcontent-%COMP%] {\n    display: flex;\n    gap: 4px;\n    height: 220px;\n    align-items: flex-end;\n    padding-bottom: 50px;\n    overflow-x: auto;\n}\n\n.chart-column[_ngcontent-%COMP%] {\n    display: flex;\n    flex-direction: column;\n    align-items: center;\n    flex: 1;\n    min-width: 24px;\n    max-width: 40px;\n    height: 100%;\n}\n\n.bars-wrapper[_ngcontent-%COMP%] {\n    display: flex;\n    flex-direction: column;\n    align-items: center;\n    gap: 1px;\n    flex: 1;\n    justify-content: flex-end;\n    width: 100%;\n}\n\n.bar[_ngcontent-%COMP%] {\n    width: 100%;\n    border-radius: 3px 3px 0 0;\n    min-height: 2px;\n    transition: height 0.3s;\n}\n\n.success-bar[_ngcontent-%COMP%] {\n    background: var(--mj-status-success);\n}\n\n.failure-bar[_ngcontent-%COMP%] {\n    background: var(--mj-status-error);\n    border-radius: 0;\n}\n\n.chart-label[_ngcontent-%COMP%] {\n    font-size: 0.6rem;\n    color: var(--mj-text-muted);\n    margin-top: 6px;\n    white-space: nowrap;\n    text-align: center;\n    transform: rotate(-45deg);\n    transform-origin: top center;\n    height: 40px;\n    overflow: visible;\n}\n\n.chart-label.hidden-label[_ngcontent-%COMP%] {\n    visibility: hidden;\n}\n\n.chart-legend[_ngcontent-%COMP%] {\n    display: flex;\n    justify-content: center;\n    gap: 20px;\n    margin-top: 12px;\n}\n\n.legend-item[_ngcontent-%COMP%] {\n    display: flex;\n    align-items: center;\n    gap: 6px;\n    font-size: 0.75rem;\n    color: var(--mj-text-secondary);\n}\n\n.legend-dot[_ngcontent-%COMP%] {\n    width: 10px;\n    height: 10px;\n    border-radius: 3px;\n}\n\n.legend-dot.success[_ngcontent-%COMP%] { background: var(--mj-status-success); }\n.legend-dot.failure[_ngcontent-%COMP%] { background: var(--mj-status-error); }\n\n\n\n.data-table[_ngcontent-%COMP%] {\n    width: 100%;\n    border-collapse: collapse;\n}\n\n.data-table[_ngcontent-%COMP%]   th[_ngcontent-%COMP%] {\n    text-align: left;\n    font-size: 0.7rem;\n    font-weight: 700;\n    color: var(--mj-text-muted);\n    text-transform: uppercase;\n    letter-spacing: 0.05em;\n    padding: 12px 16px;\n    border-bottom: 1px solid var(--mj-border-default);\n    position: sticky;\n    top: 0;\n    background: var(--mj-bg-surface-sunken);\n    z-index: 1;\n}\n\n.data-table[_ngcontent-%COMP%]   td[_ngcontent-%COMP%] {\n    padding: 10px 16px;\n    font-size: 0.85rem;\n    border-bottom: 1px solid var(--mj-bg-surface-sunken);\n}\n\n.data-table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]:hover {\n    background: var(--mj-bg-surface-sunken);\n}\n\n.cell-name[_ngcontent-%COMP%] { font-weight: 600; color: var(--mj-text-primary); }\n.cell-meta[_ngcontent-%COMP%] { color: var(--mj-text-secondary); }\n.cell-error[_ngcontent-%COMP%] { color: var(--mj-status-error); font-size: 0.8rem; max-width: 300px; }\n\n.exec-status-badge[_ngcontent-%COMP%] {\n    display: inline-flex;\n    align-items: center;\n    gap: 5px;\n    font-size: 0.7rem;\n    font-weight: 600;\n    padding: 3px 10px;\n    border-radius: 12px;\n    white-space: nowrap;\n}\n\n.exec-status-badge.status-running[_ngcontent-%COMP%] { background: color-mix(in srgb, var(--mj-brand-primary) 15%, var(--mj-bg-surface)); color: var(--mj-brand-primary); }\n.exec-status-badge.status-success[_ngcontent-%COMP%] { background: color-mix(in srgb, var(--mj-status-success) 15%, var(--mj-bg-surface)); color: var(--mj-status-success); }\n.exec-status-badge.status-error[_ngcontent-%COMP%] { background: color-mix(in srgb, var(--mj-status-error) 15%, var(--mj-bg-surface)); color: var(--mj-status-error); }\n.exec-status-badge.status-warning[_ngcontent-%COMP%] { background: color-mix(in srgb, var(--mj-status-warning) 15%, var(--mj-bg-surface)); color: var(--mj-status-warning); }\n\n\n\n.col-expand[_ngcontent-%COMP%] {\n    width: 32px;\n    text-align: center;\n}\n\n.expand-icon[_ngcontent-%COMP%] {\n    font-size: 0.7rem;\n    color: var(--mj-text-muted);\n    transition: transform 0.2s ease;\n}\n\n.expand-icon.rotated[_ngcontent-%COMP%] {\n    transform: rotate(90deg);\n}\n\n.exec-row[_ngcontent-%COMP%] {\n    cursor: pointer;\n    transition: background 0.15s;\n}\n\n.exec-row[_ngcontent-%COMP%]:hover {\n    background: var(--mj-bg-surface-sunken);\n}\n\n.exec-row.expanded[_ngcontent-%COMP%] {\n    background: var(--mj-bg-surface-sunken);\n    border-bottom-color: transparent;\n}\n\n.exec-detail-row[_ngcontent-%COMP%]   td[_ngcontent-%COMP%] {\n    padding: 0 !important;\n    border-bottom: 1px solid var(--mj-border-default);\n}\n\n.exec-detail-content[_ngcontent-%COMP%] {\n    padding: 16px 20px 16px 48px;\n    background: var(--mj-bg-surface-sunken);\n    border-top: 1px solid var(--mj-bg-surface-sunken);\n}\n\n.exec-detail-grid[_ngcontent-%COMP%] {\n    display: grid;\n    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));\n    gap: 12px 24px;\n    margin-bottom: 14px;\n}\n\n.detail-item[_ngcontent-%COMP%] {\n    display: flex;\n    flex-direction: column;\n    gap: 2px;\n}\n\n.detail-label[_ngcontent-%COMP%] {\n    font-size: 0.7rem;\n    font-weight: 600;\n    color: var(--mj-text-muted);\n    text-transform: uppercase;\n    letter-spacing: 0.03em;\n}\n\n.detail-value[_ngcontent-%COMP%] {\n    font-size: 0.85rem;\n    color: var(--mj-text-primary);\n}\n\n.detail-value.error-text[_ngcontent-%COMP%] {\n    color: var(--mj-status-error);\n    font-size: 0.8rem;\n    word-break: break-word;\n}\n\n.exec-detail-actions[_ngcontent-%COMP%] {\n    display: flex;\n    gap: 8px;\n    padding-top: 10px;\n    border-top: 1px solid var(--mj-border-default);\n}\n\n.detail-action-btn[_ngcontent-%COMP%] {\n    display: inline-flex;\n    align-items: center;\n    gap: 6px;\n    padding: 6px 14px;\n    background: var(--mj-brand-primary);\n    color: var(--mj-text-inverse);\n    border: none;\n    border-radius: 8px;\n    font-size: 0.8rem;\n    font-weight: 500;\n    cursor: pointer;\n    transition: background 0.2s;\n}\n\n.detail-action-btn[_ngcontent-%COMP%]:hover {\n    background: var(--mj-brand-primary-hover);\n}\n\n.detail-action-btn.secondary[_ngcontent-%COMP%] {\n    background: var(--mj-bg-surface-card);\n    color: var(--mj-text-secondary);\n    border: 1px solid var(--mj-border-default);\n}\n\n.detail-action-btn.secondary[_ngcontent-%COMP%]:hover {\n    background: var(--mj-bg-surface-sunken);\n    border-color: var(--mj-border-strong);\n}\n\n.empty-state-small[_ngcontent-%COMP%] {\n    display: flex;\n    flex-direction: column;\n    align-items: center;\n    gap: 8px;\n    padding: 48px 16px;\n    color: var(--mj-text-muted);\n}\n\n.empty-state-small[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] { font-size: 2rem; color: var(--mj-border-strong); }\n.empty-state-small[_ngcontent-%COMP%]   span[_ngcontent-%COMP%] { font-size: 0.85rem; }\n\n\n\n@media (max-width: 1024px) {\n    .type-cards-row[_ngcontent-%COMP%] {\n        flex-direction: column;\n    }\n    .type-card[_ngcontent-%COMP%] {\n        min-width: auto;\n    }\n}\n\n@media (max-width: 768px) {\n    .activity-toolbar[_ngcontent-%COMP%] {\n        flex-direction: column;\n        align-items: stretch;\n    }\n    .toolbar-right[_ngcontent-%COMP%] {\n        flex-wrap: wrap;\n        justify-content: space-between;\n    }\n    .search-box[_ngcontent-%COMP%] {\n        min-width: auto;\n        flex: 1;\n    }\n    .trend-chart[_ngcontent-%COMP%] {\n        height: 120px;\n    }\n    .data-table[_ngcontent-%COMP%] {\n        font-size: 0.8rem;\n    }\n}"], changeDetection: 0 });
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SchedulingActivityComponent, [{
        type: Component,
        args: [{ standalone: false, selector: 'app-scheduling-activity', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"activity-container\">\n  <!-- Toolbar -->\n  <div class=\"activity-toolbar\">\n    <div class=\"toolbar-left\">\n      <div class=\"search-box\">\n        <i class=\"fa-solid fa-search\"></i>\n        <input type=\"text\" placeholder=\"Search executions...\"\n          [value]=\"SearchTerm\"\n          (input)=\"OnSearchChange($any($event.target).value)\" />\n      </div>\n      <select class=\"filter-select\" [value]=\"StatusFilter\" (change)=\"OnStatusFilterChange($any($event.target).value)\">\n        <option value=\"\">All Statuses</option>\n        @for (s of StatusOptions.slice(1); track s) {\n          <option [value]=\"s\">{{s}}</option>\n        }\n      </select>\n      <select class=\"filter-select\" [value]=\"JobNameFilter\" (change)=\"OnJobNameFilterChange($any($event.target).value)\">\n        <option value=\"\">All Jobs</option>\n        @for (name of UniqueJobNames; track name) {\n          <option [value]=\"name\">{{name}}</option>\n        }\n      </select>\n    </div>\n    <div class=\"toolbar-right\">\n      <div class=\"time-range-group\">\n        @for (range of TimeRanges; track range) {\n          <button\n            class=\"range-btn\"\n            [class.active]=\"SelectedTimeRange === range.value\"\n            (click)=\"OnTimeRangeChange(range.value)\">\n            {{range.label}}\n          </button>\n        }\n      </div>\n      <button mjButton variant=\"secondary\" (click)=\"Refresh()\">\n        <i class=\"fa-solid fa-arrows-rotate\"></i> Refresh\n      </button>\n    </div>\n  </div>\n\n  <!-- Loading -->\n  @if (IsLoading) {\n    <div class=\"loading-container\">\n      <mj-loading text=\"Loading activity...\" size=\"medium\"></mj-loading>\n    </div>\n  }\n\n  @if (!IsLoading) {\n    <div class=\"activity-content\">\n      <!-- Job Type Summary Cards -->\n      @if (JobTypes.length > 0) {\n        <div class=\"type-cards-row\">\n          @for (type of JobTypes; track type) {\n            <div class=\"type-card\">\n              <div class=\"type-card-icon\">\n                <i [class]=\"GetTypeIcon(type.typeName)\"></i>\n              </div>\n              <div class=\"type-card-info\">\n                <div class=\"type-card-name\">{{type.typeName}}</div>\n                <div class=\"type-card-stats\">\n                  <span>{{type.activeJobsCount}} active</span>\n                  <span class=\"dot\">&middot;</span>\n                  <span>{{type.totalRuns}} runs</span>\n                  <span class=\"dot\">&middot;</span>\n                  <span [style.color]=\"GetSuccessRateColor(type.successRate)\">\n                    {{FormatPercentage(type.successRate)}}\n                  </span>\n                </div>\n              </div>\n              <div class=\"type-card-bar\">\n                <div class=\"type-bar-fill\"\n                  [style.width]=\"(type.successRate * 100) + '%'\"\n                  [style.background]=\"GetSuccessRateColor(type.successRate)\">\n                </div>\n              </div>\n            </div>\n          }\n        </div>\n      }\n      <!-- Execution Trends Chart -->\n      @if (Trends.length > 0) {\n        <div class=\"panel\">\n          <div class=\"panel-header\">\n            <div class=\"panel-title\">\n              <i class=\"fa-solid fa-chart-bar\"></i> Execution Trends\n            </div>\n            <span class=\"result-count\">{{FilteredExecutions.length}} executions</span>\n          </div>\n          <div class=\"panel-body chart-container\">\n            <div class=\"trend-chart\">\n              @for (trend of Trends; track trend; let i = $index) {\n                <div class=\"chart-column\">\n                  <div class=\"bars-wrapper\">\n                    <div class=\"bar success-bar\"\n                      [style.height]=\"GetBarHeight(trend.successes)\"\n                      [title]=\"trend.successes + ' successful'\">\n                    </div>\n                    @if (trend.failures > 0) {\n                      <div class=\"bar failure-bar\"\n                        [style.height]=\"GetBarHeight(trend.failures)\"\n                        [title]=\"trend.failures + ' failed'\">\n                      </div>\n                    }\n                  </div>\n                  <div class=\"chart-label\" [class.hidden-label]=\"!ShouldShowLabel(i)\" >{{FormatChartLabel(trend.timestamp)}}</div>\n                </div>\n              }\n            </div>\n            <div class=\"chart-legend\">\n              <span class=\"legend-item\"><span class=\"legend-dot success\"></span> Successful</span>\n              <span class=\"legend-item\"><span class=\"legend-dot failure\"></span> Failed</span>\n            </div>\n          </div>\n        </div>\n      }\n      <!-- Execution History Table -->\n      <div class=\"panel\">\n        <div class=\"panel-header\">\n          <div class=\"panel-title\">\n            <i class=\"fa-solid fa-clock-rotate-left\"></i> Execution History\n          </div>\n          <span class=\"result-count\">{{FilteredExecutions.length}} of {{Executions.length}}</span>\n        </div>\n        <div class=\"panel-body table-container\">\n          @if (FilteredExecutions.length === 0) {\n            <div class=\"empty-state-small\">\n              <i class=\"fa-solid fa-inbox\"></i>\n              <span>No executions found for this time range</span>\n            </div>\n          }\n          @if (FilteredExecutions.length > 0) {\n            <table class=\"data-table\">\n              <thead>\n                <tr>\n                  <th class=\"col-expand\"></th>\n                  <th>Status</th>\n                  <th>Job Name</th>\n                  <th>Started</th>\n                  <th>Duration</th>\n                  <th>Error</th>\n                </tr>\n              </thead>\n              <tbody>\n                @for (exec of FilteredExecutions; track exec) {\n                  <tr class=\"exec-row\" [class.expanded]=\"IsExpanded(exec)\" (click)=\"ToggleExpand(exec)\">\n                    <td class=\"col-expand\">\n                      <i class=\"fa-solid fa-chevron-right expand-icon\"\n                      [class.rotated]=\"IsExpanded(exec)\"></i>\n                    </td>\n                    <td>\n                      <span class=\"exec-status-badge\" [ngClass]=\"GetStatusClass(exec.status)\">\n                        <i [class]=\"GetStatusIcon(exec.status)\"></i>\n                        {{exec.status}}\n                      </span>\n                    </td>\n                    <td class=\"cell-name\">{{exec.jobName}}</td>\n                    <td class=\"cell-meta\">{{FormatDateTime(exec.startedAt)}}</td>\n                    <td class=\"cell-meta\">{{FormatDuration(exec.duration)}}</td>\n                    <td class=\"cell-error\">{{TruncateError(exec.errorMessage)}}</td>\n                  </tr>\n                  @if (IsExpanded(exec)) {\n                    <tr class=\"exec-detail-row\">\n                      <td [attr.colspan]=\"6\">\n                        <div class=\"exec-detail-content\">\n                          <div class=\"exec-detail-grid\">\n                            <div class=\"detail-item\">\n                              <span class=\"detail-label\">Job Name</span>\n                              <span class=\"detail-value\">{{exec.jobName}}</span>\n                            </div>\n                            <div class=\"detail-item\">\n                              <span class=\"detail-label\">Started</span>\n                              <span class=\"detail-value\">{{FormatDateTime(exec.startedAt)}}</span>\n                            </div>\n                            <div class=\"detail-item\">\n                              <span class=\"detail-label\">Completed</span>\n                              <span class=\"detail-value\">{{exec.completedAt ? FormatDateTime(exec.completedAt) : '-'}}</span>\n                            </div>\n                            <div class=\"detail-item\">\n                              <span class=\"detail-label\">Duration</span>\n                              <span class=\"detail-value\">{{FormatDuration(exec.duration)}}</span>\n                            </div>\n                            <div class=\"detail-item\">\n                              <span class=\"detail-label\">Status</span>\n                              <span class=\"detail-value\">\n                                <span class=\"exec-status-badge\" [ngClass]=\"GetStatusClass(exec.status)\">\n                                  <i [class]=\"GetStatusIcon(exec.status)\"></i>\n                                  {{exec.status}}\n                                </span>\n                              </span>\n                            </div>\n                            @if (exec.errorMessage) {\n                              <div class=\"detail-item\">\n                                <span class=\"detail-label\">Error</span>\n                                <span class=\"detail-value error-text\">{{exec.errorMessage}}</span>\n                              </div>\n                            }\n                          </div>\n                          <div class=\"exec-detail-actions\">\n                            <button class=\"detail-action-btn\" (click)=\"OpenExecutionRecord(exec, $event)\">\n                              <i class=\"fa-solid fa-arrow-up-right-from-square\"></i> Open Run Record\n                            </button>\n                            <button class=\"detail-action-btn secondary\" (click)=\"OpenJobRecord(exec, $event)\">\n                              <i class=\"fa-solid fa-briefcase\"></i> Open Job\n                            </button>\n                          </div>\n                        </div>\n                      </td>\n                    </tr>\n                  }\n                }\n              </tbody>\n            </table>\n          }\n        </div>\n      </div>\n    </div>\n  }\n</div>\n", styles: [".activity-container {\n    display: flex;\n    flex-direction: column;\n    gap: 20px;\n}\n\n/* \u2500\u2500 Toolbar \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n.activity-toolbar {\n    display: flex;\n    justify-content: space-between;\n    align-items: center;\n    flex-wrap: wrap;\n    gap: 12px;\n}\n\n.toolbar-left {\n    display: flex;\n    gap: 8px;\n    align-items: center;\n    flex-wrap: wrap;\n}\n\n.toolbar-right {\n    display: flex;\n    gap: 8px;\n    align-items: center;\n}\n\n.search-box {\n    display: flex;\n    align-items: center;\n    gap: 8px;\n    padding: 8px 14px;\n    background: var(--mj-bg-surface-card);\n    border: 1px solid var(--mj-border-default);\n    border-radius: 10px;\n    min-width: 220px;\n    transition: border-color 0.2s;\n}\n\n.search-box:focus-within {\n    border-color: var(--mj-brand-primary);\n    box-shadow: var(--mj-shadow-sm);\n}\n\n.search-box i { color: var(--mj-text-muted); font-size: 0.85rem; }\n\n.search-box input {\n    border: none; outline: none; background: transparent;\n    font-size: 0.85rem; color: var(--mj-text-primary); width: 100%;\n}\n\n.filter-select {\n    padding: 8px 14px;\n    background: var(--mj-bg-surface-card);\n    border: 1px solid var(--mj-border-default);\n    border-radius: 10px;\n    font-size: 0.85rem;\n    color: var(--mj-text-secondary);\n    cursor: pointer;\n    outline: none;\n}\n\n.time-range-group {\n    display: flex;\n    background: var(--mj-bg-surface-card);\n    border: 1px solid var(--mj-border-default);\n    border-radius: 10px;\n    overflow: hidden;\n}\n\n.range-btn {\n    padding: 8px 14px;\n    border: none;\n    background: transparent;\n    font-size: 0.8rem;\n    font-weight: 500;\n    color: var(--mj-text-secondary);\n    cursor: pointer;\n    transition: all 0.2s;\n    border-right: 1px solid var(--mj-border-default);\n}\n\n.range-btn:last-child { border-right: none; }\n\n.range-btn:hover { background: var(--mj-bg-surface-sunken); }\n\n.range-btn.active {\n    background: var(--mj-brand-primary);\n    color: var(--mj-text-inverse);\n}\n\n.control-btn {\n    display: inline-flex;\n    align-items: center;\n    gap: 6px;\n    padding: 8px 16px;\n    background: var(--mj-bg-surface-card);\n    border: 1px solid var(--mj-border-default);\n    border-radius: 10px;\n    cursor: pointer;\n    font-size: 0.8rem;\n    font-weight: 500;\n    color: var(--mj-text-secondary);\n    transition: all 0.2s ease;\n}\n\n.control-btn:hover {\n    background: var(--mj-bg-surface-sunken);\n    border-color: var(--mj-border-strong);\n}\n\n.result-count {\n    font-size: 0.8rem;\n    color: var(--mj-text-muted);\n    white-space: nowrap;\n}\n\n.loading-container {\n    display: flex;\n    justify-content: center;\n    align-items: center;\n    min-height: 300px;\n}\n\n/* \u2500\u2500 Type Summary Cards \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n.type-cards-row {\n    display: flex;\n    gap: 16px;\n    flex-wrap: wrap;\n}\n\n.type-card {\n    display: flex;\n    align-items: center;\n    gap: 14px;\n    padding: 16px 20px;\n    background: var(--mj-bg-surface-card);\n    border-radius: 14px;\n    border: 1px solid var(--mj-border-default);\n    box-shadow: var(--mj-shadow-sm);\n    flex: 1;\n    min-width: 240px;\n    transition: all 0.2s ease;\n}\n\n.type-card:hover {\n    transform: translateY(-1px);\n    box-shadow: var(--mj-shadow-md);\n}\n\n.type-card-icon {\n    width: 44px;\n    height: 44px;\n    border-radius: 12px;\n    background: var(--mj-brand-primary);\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    color: var(--mj-text-inverse);\n    font-size: 1.1rem;\n    flex-shrink: 0;\n}\n\n.type-card-info {\n    flex: 1;\n}\n\n.type-card-name {\n    font-weight: 700;\n    color: var(--mj-text-primary);\n    font-size: 0.9rem;\n}\n\n.type-card-stats {\n    font-size: 0.75rem;\n    color: var(--mj-text-secondary);\n    margin-top: 2px;\n}\n\n.type-card-stats .dot {\n    margin: 0 4px;\n}\n\n.type-card-bar {\n    width: 60px;\n    height: 6px;\n    background: var(--mj-bg-surface-sunken);\n    border-radius: 3px;\n    overflow: hidden;\n}\n\n.type-bar-fill {\n    height: 100%;\n    border-radius: 3px;\n    transition: width 0.5s;\n}\n\n/* \u2500\u2500 Panels \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n.panel {\n    background: var(--mj-bg-surface-card);\n    border-radius: 16px;\n    border: 1px solid var(--mj-border-default);\n    box-shadow: var(--mj-shadow-sm);\n    overflow: hidden;\n}\n\n.panel-header {\n    display: flex;\n    justify-content: space-between;\n    align-items: center;\n    padding: 16px 20px;\n    background: var(--mj-bg-surface-sunken);\n    border-bottom: 1px solid var(--mj-border-default);\n}\n\n.panel-title {\n    font-size: 0.95rem;\n    font-weight: 700;\n    color: var(--mj-text-primary);\n    display: flex;\n    align-items: center;\n    gap: 8px;\n}\n\n.panel-title i { color: var(--mj-brand-primary); }\n\n.panel-body {\n    padding: 20px;\n}\n\n.chart-container {\n    padding: 20px;\n}\n\n.table-container {\n    padding: 0;\n    max-height: 600px;\n    overflow-y: auto;\n}\n\n/* \u2500\u2500 Trend Chart \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n.trend-chart {\n    display: flex;\n    gap: 4px;\n    height: 220px;\n    align-items: flex-end;\n    padding-bottom: 50px;\n    overflow-x: auto;\n}\n\n.chart-column {\n    display: flex;\n    flex-direction: column;\n    align-items: center;\n    flex: 1;\n    min-width: 24px;\n    max-width: 40px;\n    height: 100%;\n}\n\n.bars-wrapper {\n    display: flex;\n    flex-direction: column;\n    align-items: center;\n    gap: 1px;\n    flex: 1;\n    justify-content: flex-end;\n    width: 100%;\n}\n\n.bar {\n    width: 100%;\n    border-radius: 3px 3px 0 0;\n    min-height: 2px;\n    transition: height 0.3s;\n}\n\n.success-bar {\n    background: var(--mj-status-success);\n}\n\n.failure-bar {\n    background: var(--mj-status-error);\n    border-radius: 0;\n}\n\n.chart-label {\n    font-size: 0.6rem;\n    color: var(--mj-text-muted);\n    margin-top: 6px;\n    white-space: nowrap;\n    text-align: center;\n    transform: rotate(-45deg);\n    transform-origin: top center;\n    height: 40px;\n    overflow: visible;\n}\n\n.chart-label.hidden-label {\n    visibility: hidden;\n}\n\n.chart-legend {\n    display: flex;\n    justify-content: center;\n    gap: 20px;\n    margin-top: 12px;\n}\n\n.legend-item {\n    display: flex;\n    align-items: center;\n    gap: 6px;\n    font-size: 0.75rem;\n    color: var(--mj-text-secondary);\n}\n\n.legend-dot {\n    width: 10px;\n    height: 10px;\n    border-radius: 3px;\n}\n\n.legend-dot.success { background: var(--mj-status-success); }\n.legend-dot.failure { background: var(--mj-status-error); }\n\n/* \u2500\u2500 Data Table \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n.data-table {\n    width: 100%;\n    border-collapse: collapse;\n}\n\n.data-table th {\n    text-align: left;\n    font-size: 0.7rem;\n    font-weight: 700;\n    color: var(--mj-text-muted);\n    text-transform: uppercase;\n    letter-spacing: 0.05em;\n    padding: 12px 16px;\n    border-bottom: 1px solid var(--mj-border-default);\n    position: sticky;\n    top: 0;\n    background: var(--mj-bg-surface-sunken);\n    z-index: 1;\n}\n\n.data-table td {\n    padding: 10px 16px;\n    font-size: 0.85rem;\n    border-bottom: 1px solid var(--mj-bg-surface-sunken);\n}\n\n.data-table tbody tr:hover {\n    background: var(--mj-bg-surface-sunken);\n}\n\n.cell-name { font-weight: 600; color: var(--mj-text-primary); }\n.cell-meta { color: var(--mj-text-secondary); }\n.cell-error { color: var(--mj-status-error); font-size: 0.8rem; max-width: 300px; }\n\n.exec-status-badge {\n    display: inline-flex;\n    align-items: center;\n    gap: 5px;\n    font-size: 0.7rem;\n    font-weight: 600;\n    padding: 3px 10px;\n    border-radius: 12px;\n    white-space: nowrap;\n}\n\n.exec-status-badge.status-running { background: color-mix(in srgb, var(--mj-brand-primary) 15%, var(--mj-bg-surface)); color: var(--mj-brand-primary); }\n.exec-status-badge.status-success { background: color-mix(in srgb, var(--mj-status-success) 15%, var(--mj-bg-surface)); color: var(--mj-status-success); }\n.exec-status-badge.status-error { background: color-mix(in srgb, var(--mj-status-error) 15%, var(--mj-bg-surface)); color: var(--mj-status-error); }\n.exec-status-badge.status-warning { background: color-mix(in srgb, var(--mj-status-warning) 15%, var(--mj-bg-surface)); color: var(--mj-status-warning); }\n\n/* \u2500\u2500 Expandable Rows \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n.col-expand {\n    width: 32px;\n    text-align: center;\n}\n\n.expand-icon {\n    font-size: 0.7rem;\n    color: var(--mj-text-muted);\n    transition: transform 0.2s ease;\n}\n\n.expand-icon.rotated {\n    transform: rotate(90deg);\n}\n\n.exec-row {\n    cursor: pointer;\n    transition: background 0.15s;\n}\n\n.exec-row:hover {\n    background: var(--mj-bg-surface-sunken);\n}\n\n.exec-row.expanded {\n    background: var(--mj-bg-surface-sunken);\n    border-bottom-color: transparent;\n}\n\n.exec-detail-row td {\n    padding: 0 !important;\n    border-bottom: 1px solid var(--mj-border-default);\n}\n\n.exec-detail-content {\n    padding: 16px 20px 16px 48px;\n    background: var(--mj-bg-surface-sunken);\n    border-top: 1px solid var(--mj-bg-surface-sunken);\n}\n\n.exec-detail-grid {\n    display: grid;\n    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));\n    gap: 12px 24px;\n    margin-bottom: 14px;\n}\n\n.detail-item {\n    display: flex;\n    flex-direction: column;\n    gap: 2px;\n}\n\n.detail-label {\n    font-size: 0.7rem;\n    font-weight: 600;\n    color: var(--mj-text-muted);\n    text-transform: uppercase;\n    letter-spacing: 0.03em;\n}\n\n.detail-value {\n    font-size: 0.85rem;\n    color: var(--mj-text-primary);\n}\n\n.detail-value.error-text {\n    color: var(--mj-status-error);\n    font-size: 0.8rem;\n    word-break: break-word;\n}\n\n.exec-detail-actions {\n    display: flex;\n    gap: 8px;\n    padding-top: 10px;\n    border-top: 1px solid var(--mj-border-default);\n}\n\n.detail-action-btn {\n    display: inline-flex;\n    align-items: center;\n    gap: 6px;\n    padding: 6px 14px;\n    background: var(--mj-brand-primary);\n    color: var(--mj-text-inverse);\n    border: none;\n    border-radius: 8px;\n    font-size: 0.8rem;\n    font-weight: 500;\n    cursor: pointer;\n    transition: background 0.2s;\n}\n\n.detail-action-btn:hover {\n    background: var(--mj-brand-primary-hover);\n}\n\n.detail-action-btn.secondary {\n    background: var(--mj-bg-surface-card);\n    color: var(--mj-text-secondary);\n    border: 1px solid var(--mj-border-default);\n}\n\n.detail-action-btn.secondary:hover {\n    background: var(--mj-bg-surface-sunken);\n    border-color: var(--mj-border-strong);\n}\n\n.empty-state-small {\n    display: flex;\n    flex-direction: column;\n    align-items: center;\n    gap: 8px;\n    padding: 48px 16px;\n    color: var(--mj-text-muted);\n}\n\n.empty-state-small i { font-size: 2rem; color: var(--mj-border-strong); }\n.empty-state-small span { font-size: 0.85rem; }\n\n/* \u2500\u2500 Responsive \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n@media (max-width: 1024px) {\n    .type-cards-row {\n        flex-direction: column;\n    }\n    .type-card {\n        min-width: auto;\n    }\n}\n\n@media (max-width: 768px) {\n    .activity-toolbar {\n        flex-direction: column;\n        align-items: stretch;\n    }\n    .toolbar-right {\n        flex-wrap: wrap;\n        justify-content: space-between;\n    }\n    .search-box {\n        min-width: auto;\n        flex: 1;\n    }\n    .trend-chart {\n        height: 120px;\n    }\n    .data-table {\n        font-size: 0.8rem;\n    }\n}\n"] }]
    }], () => [{ type: i1.SchedulingInstrumentationService }, { type: i0.ChangeDetectorRef }], { initialState: [{
            type: Input
        }], stateChange: [{
            type: Output
        }] }); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SchedulingActivityComponent, { className: "SchedulingActivityComponent", filePath: "src/Scheduling/components/scheduling-activity.component.ts", lineNumber: 23 }); })();
//# sourceMappingURL=scheduling-activity.component.js.map