var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var VersionHistoryGraphResourceComponent_1;
import { Component, ChangeDetectionStrategy } from '@angular/core';
import { Subject } from 'rxjs';
import { RegisterClass, UUIDsEqual } from '@memberjunction/global';
import { BaseResourceComponent } from '@memberjunction/ng-shared';
import { UserInfoEngine } from '@memberjunction/core-entities';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@memberjunction/ng-ui-components";
import * as i3 from "@memberjunction/ng-shared-generic";
function VersionHistoryGraphResourceComponent_Conditional_10_For_1_Template(rf, ctx) { if (rf & 1) {
    const _r1 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "mj-filter-chip", 13);
    i0.ɵɵlistener("Clicked", function VersionHistoryGraphResourceComponent_Conditional_10_For_1_Template_mj_filter_chip_Clicked_0_listener() { const schema_r2 = i0.ɵɵrestoreView(_r1).$implicit; const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.OnSchemaFilterChange(schema_r2)); });
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const schema_r2 = ctx.$implicit;
    const ctx_r2 = i0.ɵɵnextContext(2);
    i0.ɵɵproperty("Label", schema_r2)("Count", ctx_r2.GetSchemaEntityCount(schema_r2))("Active", ctx_r2.SchemaFilter === schema_r2);
} }
function VersionHistoryGraphResourceComponent_Conditional_10_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵrepeaterCreate(0, VersionHistoryGraphResourceComponent_Conditional_10_For_1_Template, 1, 3, "mj-filter-chip", 12, i0.ɵɵrepeaterTrackByIdentity);
} if (rf & 2) {
    const ctx_r2 = i0.ɵɵnextContext();
    i0.ɵɵrepeater(ctx_r2.AvailableSchemas);
} }
function VersionHistoryGraphResourceComponent_Conditional_12_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "mj-loading", 10);
} }
function VersionHistoryGraphResourceComponent_Conditional_13_For_4_Conditional_4_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 23);
    i0.ɵɵtext(1);
    i0.ɵɵelement(2, "i", 25);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const entity_r5 = i0.ɵɵnextContext().$implicit;
    const ctx_r2 = i0.ɵɵnextContext(2);
    i0.ɵɵproperty("ngClass", ctx_r2.GetDependencyLevel(entity_r5.ReferencedByCount));
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate1(" ", entity_r5.ReferencedByCount, " ");
} }
function VersionHistoryGraphResourceComponent_Conditional_13_For_4_Conditional_5_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 24);
    i0.ɵɵtext(1);
    i0.ɵɵelement(2, "i", 26);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const entity_r5 = i0.ɵɵnextContext().$implicit;
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate1(" ", entity_r5.DependsOnCount, " ");
} }
function VersionHistoryGraphResourceComponent_Conditional_13_For_4_Template(rf, ctx) { if (rf & 1) {
    const _r4 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 20);
    i0.ɵɵlistener("click", function VersionHistoryGraphResourceComponent_Conditional_13_For_4_Template_div_click_0_listener() { const entity_r5 = i0.ɵɵrestoreView(_r4).$implicit; const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.SelectEntity(entity_r5)); });
    i0.ɵɵelementStart(1, "div", 21);
    i0.ɵɵtext(2);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(3, "div", 22);
    i0.ɵɵconditionalCreate(4, VersionHistoryGraphResourceComponent_Conditional_13_For_4_Conditional_4_Template, 3, 2, "span", 23);
    i0.ɵɵconditionalCreate(5, VersionHistoryGraphResourceComponent_Conditional_13_For_4_Conditional_5_Template, 3, 1, "span", 24);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const entity_r5 = ctx.$implicit;
    i0.ɵɵclassProp("selected", entity_r5.IsSelected);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate(entity_r5.Name);
    i0.ɵɵadvance(2);
    i0.ɵɵconditional(entity_r5.ReferencedByCount > 0 ? 4 : -1);
    i0.ɵɵadvance();
    i0.ɵɵconditional(entity_r5.DependsOnCount > 0 ? 5 : -1);
} }
function VersionHistoryGraphResourceComponent_Conditional_13_Conditional_5_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 17)(1, "p");
    i0.ɵɵtext(2, "No entities match your search.");
    i0.ɵɵelementEnd()();
} }
function VersionHistoryGraphResourceComponent_Conditional_13_Conditional_7_Conditional_18_For_2_Template(rf, ctx) { if (rf & 1) {
    const _r6 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 40)(1, "div", 41);
    i0.ɵɵlistener("click", function VersionHistoryGraphResourceComponent_Conditional_13_Conditional_7_Conditional_18_For_2_Template_div_click_1_listener() { const rel_r7 = i0.ɵɵrestoreView(_r6).$implicit; const ctx_r2 = i0.ɵɵnextContext(4); return i0.ɵɵresetView(ctx_r2.NavigateToEntity(rel_r7.ToEntity)); });
    i0.ɵɵelement(2, "i", 42);
    i0.ɵɵelementStart(3, "span", 43);
    i0.ɵɵtext(4);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(5, "span", 44);
    i0.ɵɵelement(6, "i", 45);
    i0.ɵɵtext(7);
    i0.ɵɵelementEnd()()();
} if (rf & 2) {
    const rel_r7 = ctx.$implicit;
    i0.ɵɵadvance(4);
    i0.ɵɵtextInterpolate(rel_r7.ToEntity);
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate1(" ", rel_r7.RelatedEntityJoinField, " ");
} }
function VersionHistoryGraphResourceComponent_Conditional_13_Conditional_7_Conditional_18_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 37);
    i0.ɵɵrepeaterCreate(1, VersionHistoryGraphResourceComponent_Conditional_13_Conditional_7_Conditional_18_For_2_Template, 8, 2, "div", 40, i0.ɵɵrepeaterTrackByIdentity);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r2 = i0.ɵɵnextContext(3);
    i0.ɵɵadvance();
    i0.ɵɵrepeater(ctx_r2.ReferencedByEntities);
} }
function VersionHistoryGraphResourceComponent_Conditional_13_Conditional_7_Conditional_19_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 38)(1, "p");
    i0.ɵɵtext(2, "No entities reference this entity.");
    i0.ɵɵelementEnd()();
} }
function VersionHistoryGraphResourceComponent_Conditional_13_Conditional_7_Conditional_31_For_2_Template(rf, ctx) { if (rf & 1) {
    const _r8 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 40)(1, "div", 41);
    i0.ɵɵlistener("click", function VersionHistoryGraphResourceComponent_Conditional_13_Conditional_7_Conditional_31_For_2_Template_div_click_1_listener() { const rel_r9 = i0.ɵɵrestoreView(_r8).$implicit; const ctx_r2 = i0.ɵɵnextContext(4); return i0.ɵɵresetView(ctx_r2.NavigateToEntity(rel_r9.FromEntity)); });
    i0.ɵɵelement(2, "i", 42);
    i0.ɵɵelementStart(3, "span", 43);
    i0.ɵɵtext(4);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(5, "span", 44);
    i0.ɵɵelement(6, "i", 45);
    i0.ɵɵtext(7);
    i0.ɵɵelementEnd()()();
} if (rf & 2) {
    const rel_r9 = ctx.$implicit;
    i0.ɵɵadvance(4);
    i0.ɵɵtextInterpolate(rel_r9.FromEntity);
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate1(" ", rel_r9.RelatedEntityJoinField, " ");
} }
function VersionHistoryGraphResourceComponent_Conditional_13_Conditional_7_Conditional_31_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 37);
    i0.ɵɵrepeaterCreate(1, VersionHistoryGraphResourceComponent_Conditional_13_Conditional_7_Conditional_31_For_2_Template, 8, 2, "div", 40, i0.ɵɵrepeaterTrackByIdentity);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r2 = i0.ɵɵnextContext(3);
    i0.ɵɵadvance();
    i0.ɵɵrepeater(ctx_r2.DependsOnEntities);
} }
function VersionHistoryGraphResourceComponent_Conditional_13_Conditional_7_Conditional_32_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 38)(1, "p");
    i0.ɵɵtext(2, "This entity has no foreign key dependencies.");
    i0.ɵɵelementEnd()();
} }
function VersionHistoryGraphResourceComponent_Conditional_13_Conditional_7_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 27);
    i0.ɵɵelement(1, "i", 28);
    i0.ɵɵelementStart(2, "div", 29)(3, "h3", 30);
    i0.ɵɵtext(4);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(5, "span", 31);
    i0.ɵɵtext(6);
    i0.ɵɵelementEnd()()();
    i0.ɵɵelementStart(7, "div", 32)(8, "div", 33);
    i0.ɵɵelement(9, "i", 34);
    i0.ɵɵelementStart(10, "h4");
    i0.ɵɵtext(11, "Referenced By");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(12, "span", 35);
    i0.ɵɵtext(13);
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(14, "p", 36);
    i0.ɵɵtext(15, "Entities that have foreign keys pointing to ");
    i0.ɵɵelementStart(16, "strong");
    i0.ɵɵtext(17);
    i0.ɵɵelementEnd()();
    i0.ɵɵconditionalCreate(18, VersionHistoryGraphResourceComponent_Conditional_13_Conditional_7_Conditional_18_Template, 3, 0, "div", 37);
    i0.ɵɵconditionalCreate(19, VersionHistoryGraphResourceComponent_Conditional_13_Conditional_7_Conditional_19_Template, 3, 0, "div", 38);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(20, "div", 32)(21, "div", 33);
    i0.ɵɵelement(22, "i", 39);
    i0.ɵɵelementStart(23, "h4");
    i0.ɵɵtext(24, "Depends On");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(25, "span", 35);
    i0.ɵɵtext(26);
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(27, "p", 36)(28, "strong");
    i0.ɵɵtext(29);
    i0.ɵɵelementEnd();
    i0.ɵɵtext(30, " has foreign keys pointing to these entities");
    i0.ɵɵelementEnd();
    i0.ɵɵconditionalCreate(31, VersionHistoryGraphResourceComponent_Conditional_13_Conditional_7_Conditional_31_Template, 3, 0, "div", 37);
    i0.ɵɵconditionalCreate(32, VersionHistoryGraphResourceComponent_Conditional_13_Conditional_7_Conditional_32_Template, 3, 0, "div", 38);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r2 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(4);
    i0.ɵɵtextInterpolate(ctx_r2.SelectedEntity.Name);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate(ctx_r2.SelectedEntity.SchemaName);
    i0.ɵɵadvance(7);
    i0.ɵɵtextInterpolate(ctx_r2.ReferencedByEntities.length);
    i0.ɵɵadvance(4);
    i0.ɵɵtextInterpolate(ctx_r2.SelectedEntity.Name);
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r2.ReferencedByEntities.length > 0 ? 18 : -1);
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r2.ReferencedByEntities.length === 0 ? 19 : -1);
    i0.ɵɵadvance(7);
    i0.ɵɵtextInterpolate(ctx_r2.DependsOnEntities.length);
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate(ctx_r2.SelectedEntity.Name);
    i0.ɵɵadvance(2);
    i0.ɵɵconditional(ctx_r2.DependsOnEntities.length > 0 ? 31 : -1);
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r2.DependsOnEntities.length === 0 ? 32 : -1);
} }
function VersionHistoryGraphResourceComponent_Conditional_13_Conditional_8_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 19);
    i0.ɵɵelement(1, "i", 46);
    i0.ɵɵelementStart(2, "h3");
    i0.ɵɵtext(3, "Select an Entity");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(4, "p");
    i0.ɵɵtext(5, "Choose an entity from the list to explore its dependency relationships.");
    i0.ɵɵelementEnd()();
} }
function VersionHistoryGraphResourceComponent_Conditional_13_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 11)(1, "div", 14)(2, "div", 15);
    i0.ɵɵrepeaterCreate(3, VersionHistoryGraphResourceComponent_Conditional_13_For_4_Template, 6, 5, "div", 16, i0.ɵɵrepeaterTrackByIdentity);
    i0.ɵɵconditionalCreate(5, VersionHistoryGraphResourceComponent_Conditional_13_Conditional_5_Template, 3, 0, "div", 17);
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(6, "div", 18);
    i0.ɵɵconditionalCreate(7, VersionHistoryGraphResourceComponent_Conditional_13_Conditional_7_Template, 33, 10)(8, VersionHistoryGraphResourceComponent_Conditional_13_Conditional_8_Template, 6, 0, "div", 19);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const ctx_r2 = i0.ɵɵnextContext();
    i0.ɵɵadvance(3);
    i0.ɵɵrepeater(ctx_r2.FilteredEntities);
    i0.ɵɵadvance(2);
    i0.ɵɵconditional(ctx_r2.FilteredEntities.length === 0 ? 5 : -1);
    i0.ɵɵadvance(2);
    i0.ɵɵconditional(ctx_r2.SelectedEntity ? 7 : 8);
} }
let VersionHistoryGraphResourceComponent = class VersionHistoryGraphResourceComponent extends BaseResourceComponent {
    static { VersionHistoryGraphResourceComponent_1 = this; }
    cdr;
    IsLoading = true;
    // Entity browser
    AllEntities = [];
    FilteredEntities = [];
    SearchText = '';
    SchemaFilter = '';
    AvailableSchemas = [];
    // Selected entity detail
    SelectedEntity = null;
    SelectedEntityInfo = null;
    ReferencedByEntities = [];
    DependsOnEntities = [];
    // Stats
    TotalEntities = 0;
    EntitiesWithDependents = 0;
    TotalRelationships = 0;
    static PREFS_KEY = 'VersionHistory.Graph.UserPreferences';
    preferencesLoaded = false;
    metadata = this.ProviderToUse;
    destroy$ = new Subject();
    constructor(cdr) {
        super();
        this.cdr = cdr;
    }
    ngOnInit() {
        super.ngOnInit();
        this.loadUserPreferences();
        this.LoadData();
    }
    ngOnDestroy() {
        super.ngOnDestroy();
        this.destroy$.next();
        this.destroy$.complete();
    }
    async GetResourceDisplayName(data) {
        return 'Dependency Graph';
    }
    async GetResourceIconClass(data) {
        return 'fa-solid fa-diagram-project';
    }
    LoadData() {
        try {
            this.IsLoading = true;
            this.cdr.markForCheck();
            const entities = this.metadata.Entities;
            this.AllEntities = entities.map(e => ({
                Name: e.Name,
                ID: e.ID,
                SchemaName: e.SchemaName,
                ReferencedByCount: this.countReferencedBy(e),
                DependsOnCount: this.countDependsOn(e),
                IsSelected: false
            })).sort((a, b) => a.Name.localeCompare(b.Name));
            // Extract unique schemas, sorted
            const schemaSet = new Set(this.AllEntities.map(e => e.SchemaName));
            this.AvailableSchemas = Array.from(schemaSet).sort();
            this.TotalEntities = this.AllEntities.length;
            this.EntitiesWithDependents = this.AllEntities.filter(e => e.ReferencedByCount > 0).length;
            this.TotalRelationships = this.AllEntities.reduce((sum, e) => sum + e.ReferencedByCount, 0);
            this.applyFilter();
        }
        catch (error) {
            console.error('Error loading dependency graph data:', error);
        }
        finally {
            this.IsLoading = false;
            this.NotifyLoadComplete();
            this.cdr.markForCheck();
        }
    }
    /** Count entities that reference this entity (have FKs pointing to it), excluding self-references */
    countReferencedBy(entity) {
        return entity.RelatedEntities.filter(r => r.Type.trim().toUpperCase() === 'ONE TO MANY' &&
            r.RelatedEntity !== entity.Name).length;
    }
    /** Count entities this entity depends on (has FKs pointing to), excluding self-references */
    countDependsOn(entity) {
        return this.metadata.Entities.filter(e => e.Name !== entity.Name &&
            e.RelatedEntities.some(r => r.Type.trim().toUpperCase() === 'ONE TO MANY' &&
                r.RelatedEntity === entity.Name)).length;
    }
    OnSearchChange(text) {
        this.SearchText = text;
        this.applyFilter();
    }
    OnSchemaFilterChange(schema) {
        this.SchemaFilter = this.SchemaFilter === schema ? '' : schema;
        this.applyFilter();
        this.persistPreferences();
    }
    loadUserPreferences() {
        try {
            const raw = UserInfoEngine.Instance.GetSetting(VersionHistoryGraphResourceComponent_1.PREFS_KEY);
            if (raw) {
                const prefs = JSON.parse(raw);
                if (prefs.SchemaFilter != null) {
                    this.SchemaFilter = prefs.SchemaFilter;
                }
            }
        }
        catch (error) {
            console.error('Error loading graph preferences:', error);
            this.SchemaFilter = '';
        }
        this.preferencesLoaded = true;
    }
    persistPreferences() {
        if (!this.preferencesLoaded)
            return;
        const prefs = {
            SchemaFilter: this.SchemaFilter
        };
        UserInfoEngine.Instance.SetSettingDebounced(VersionHistoryGraphResourceComponent_1.PREFS_KEY, JSON.stringify(prefs));
    }
    applyFilter() {
        let result = this.AllEntities;
        if (this.SchemaFilter) {
            result = result.filter(e => e.SchemaName === this.SchemaFilter);
        }
        if (this.SearchText) {
            const search = this.SearchText.toLowerCase();
            result = result.filter(e => e.Name.toLowerCase().includes(search));
        }
        this.FilteredEntities = result;
        this.cdr.markForCheck();
    }
    SelectEntity(entityNode) {
        if (this.SelectedEntity) {
            this.SelectedEntity.IsSelected = false;
        }
        entityNode.IsSelected = true;
        this.SelectedEntity = entityNode;
        const entityInfo = this.metadata.Entities.find(e => UUIDsEqual(e.ID, entityNode.ID));
        this.SelectedEntityInfo = entityInfo ?? null;
        if (entityInfo) {
            this.ReferencedByEntities = this.buildReferencedByList(entityInfo);
            this.DependsOnEntities = this.buildDependsOnList(entityInfo);
        }
        else {
            this.ReferencedByEntities = [];
            this.DependsOnEntities = [];
        }
        this.cdr.markForCheck();
    }
    /** Entities that have FKs pointing TO the selected entity (it is the "one" side) */
    buildReferencedByList(entityInfo) {
        return entityInfo.RelatedEntities
            .filter(r => r.Type.trim().toUpperCase() === 'ONE TO MANY' &&
            r.RelatedEntity !== entityInfo.Name)
            .map(r => ({
            FromEntity: entityInfo.Name,
            ToEntity: r.RelatedEntity,
            RelatedEntityJoinField: r.RelatedEntityJoinField,
            Type: r.Type
        }))
            .sort((a, b) => a.ToEntity.localeCompare(b.ToEntity));
    }
    /** Entities the selected entity has FKs pointing to (it is the "many" side) */
    buildDependsOnList(entityInfo) {
        return this.metadata.Entities
            .filter(e => e.Name !== entityInfo.Name &&
            e.RelatedEntities.some(r => r.Type.trim().toUpperCase() === 'ONE TO MANY' &&
                r.RelatedEntity === entityInfo.Name))
            .map(e => {
            const rel = e.RelatedEntities.find(r => r.Type.trim().toUpperCase() === 'ONE TO MANY' &&
                r.RelatedEntity === entityInfo.Name);
            return {
                FromEntity: e.Name,
                ToEntity: entityInfo.Name,
                RelatedEntityJoinField: rel.RelatedEntityJoinField,
                Type: rel.Type
            };
        })
            .sort((a, b) => a.FromEntity.localeCompare(b.FromEntity));
    }
    NavigateToEntity(entityName) {
        const node = this.AllEntities.find(e => e.Name === entityName);
        if (node) {
            // Clear schema filter so the entity is visible
            if (this.SchemaFilter && node.SchemaName !== this.SchemaFilter) {
                this.SchemaFilter = '';
                this.applyFilter();
            }
            this.SelectEntity(node);
        }
    }
    GetDependencyLevel(count) {
        if (count === 0)
            return 'level-none';
        if (count <= 3)
            return 'level-low';
        if (count <= 10)
            return 'level-medium';
        return 'level-high';
    }
    GetSchemaEntityCount(schema) {
        return this.AllEntities.filter(e => e.SchemaName === schema).length;
    }
    Refresh() {
        this.LoadData();
    }
    static ɵfac = function VersionHistoryGraphResourceComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || VersionHistoryGraphResourceComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); };
    static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: VersionHistoryGraphResourceComponent, selectors: [["mj-version-history-graph-resource"]], standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 14, vars: 9, consts: [["Title", "Entity Dependency Graph", "Icon", "fa-solid fa-diagram-project", "Subtitle", "Explore entity relationships used by the version history system"], ["meta", ""], ["Icon", "fa-solid fa-table", "Label", "entities", 3, "Count"], ["Icon", "fa-solid fa-diagram-project", "Label", "with dependents", 3, "Count"], ["Icon", "fa-solid fa-arrow-right-arrow-left", "Label", "relationships", 3, "Count"], ["actions", ""], [3, "Clicked", "Loading"], ["toolbar", ""], ["Placeholder", "Filter entities...", 3, "ValueChange", "Value"], [3, "Flex"], ["text", "Loading dependency graph..."], [1, "graph-layout"], [3, "Label", "Count", "Active"], [3, "Clicked", "Label", "Count", "Active"], [1, "entity-list-panel"], [1, "entity-scroll-list"], [1, "entity-list-item", 3, "selected"], [1, "empty-list"], [1, "entity-detail-panel"], [1, "no-selection"], [1, "entity-list-item", 3, "click"], [1, "entity-list-name"], [1, "entity-list-badges"], ["title", "Referenced by (entities with FKs to this)", 1, "dep-badge", 3, "ngClass"], ["title", "Depends on (entities this has FKs to)", 1, "dep-badge", "level-depends-on"], [1, "fa-solid", "fa-arrow-down"], [1, "fa-solid", "fa-arrow-up"], [1, "detail-header"], [1, "fa-solid", "fa-table", "detail-icon"], [1, "detail-header-text"], [1, "detail-title"], [1, "detail-schema"], [1, "relationship-section"], [1, "section-header"], [1, "fa-solid", "fa-arrow-down", "section-icon", "referenced-by-icon"], [1, "section-count"], [1, "section-hint"], [1, "relationship-list"], [1, "empty-relationships"], [1, "fa-solid", "fa-arrow-up", "section-icon", "depends-on-icon"], [1, "relationship-item"], [1, "rel-main", 3, "click"], [1, "fa-solid", "fa-table", "rel-icon"], [1, "rel-entity-name"], [1, "rel-join-field"], [1, "fa-solid", "fa-link"], [1, "fa-solid", "fa-diagram-project", "no-selection-icon"]], template: function VersionHistoryGraphResourceComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "mj-page-layout")(1, "mj-page-header", 0)(2, "div", 1);
            i0.ɵɵelement(3, "mj-stat-badge", 2)(4, "mj-stat-badge", 3)(5, "mj-stat-badge", 4);
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(6, "div", 5)(7, "mj-refresh-button", 6);
            i0.ɵɵlistener("Clicked", function VersionHistoryGraphResourceComponent_Template_mj_refresh_button_Clicked_7_listener() { return ctx.Refresh(); });
            i0.ɵɵelementEnd()();
            i0.ɵɵelementStart(8, "div", 7)(9, "mj-page-search", 8);
            i0.ɵɵlistener("ValueChange", function VersionHistoryGraphResourceComponent_Template_mj_page_search_ValueChange_9_listener($event) { return ctx.OnSearchChange($event); });
            i0.ɵɵelementEnd();
            i0.ɵɵconditionalCreate(10, VersionHistoryGraphResourceComponent_Conditional_10_Template, 2, 0);
            i0.ɵɵelementEnd()();
            i0.ɵɵelementStart(11, "mj-page-body", 9);
            i0.ɵɵconditionalCreate(12, VersionHistoryGraphResourceComponent_Conditional_12_Template, 1, 0, "mj-loading", 10);
            i0.ɵɵconditionalCreate(13, VersionHistoryGraphResourceComponent_Conditional_13_Template, 9, 2, "div", 11);
            i0.ɵɵelementEnd()();
        } if (rf & 2) {
            i0.ɵɵadvance(3);
            i0.ɵɵproperty("Count", ctx.TotalEntities);
            i0.ɵɵadvance();
            i0.ɵɵproperty("Count", ctx.EntitiesWithDependents);
            i0.ɵɵadvance();
            i0.ɵɵproperty("Count", ctx.TotalRelationships);
            i0.ɵɵadvance(2);
            i0.ɵɵproperty("Loading", ctx.IsLoading);
            i0.ɵɵadvance(2);
            i0.ɵɵproperty("Value", ctx.SearchText);
            i0.ɵɵadvance();
            i0.ɵɵconditional(ctx.AvailableSchemas.length > 1 ? 10 : -1);
            i0.ɵɵadvance();
            i0.ɵɵproperty("Flex", true);
            i0.ɵɵadvance();
            i0.ɵɵconditional(ctx.IsLoading ? 12 : -1);
            i0.ɵɵadvance();
            i0.ɵɵconditional(!ctx.IsLoading ? 13 : -1);
        } }, dependencies: [i1.NgClass, i2.MJPageHeaderComponent, i2.MJPageLayoutComponent, i2.MJPageBodyComponent, i2.MJPageSearchComponent, i2.MJFilterChipComponent, i2.MJStatBadgeComponent, i2.MJRefreshButtonComponent, i3.LoadingComponent], styles: ["\n\n.graph-layout[_ngcontent-%COMP%] {\n    display: grid;\n    grid-template-columns: 340px 1fr;\n    gap: 20px;\n    flex: 1;\n    min-height: 0;\n}\n\n\n\n.entity-list-panel[_ngcontent-%COMP%] {\n    background: var(--mj-bg-surface-card);\n    border: 1px solid var(--mj-border-default);\n    border-radius: 12px;\n    display: flex;\n    flex-direction: column;\n    max-height: calc(100vh - 280px);\n}\n\n.entity-scroll-list[_ngcontent-%COMP%] {\n    flex: 1;\n    overflow-y: auto;\n    padding: 8px;\n}\n\n.entity-list-item[_ngcontent-%COMP%] {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    padding: 10px 12px;\n    border-radius: 8px;\n    cursor: pointer;\n    transition: all 0.15s ease;\n}\n\n.entity-list-item[_ngcontent-%COMP%]:hover {\n    background: var(--mj-bg-surface-sunken);\n}\n\n.entity-list-item.selected[_ngcontent-%COMP%] {\n    background: color-mix(in srgb, var(--mj-brand-primary) 8%, transparent);\n    border-left: 3px solid var(--mj-brand-primary);\n}\n\n.entity-list-name[_ngcontent-%COMP%] {\n    font-size: 13px;\n    color: var(--mj-text-primary);\n    white-space: nowrap;\n    overflow: hidden;\n    text-overflow: ellipsis;\n    flex: 1;\n}\n\n.entity-list-badges[_ngcontent-%COMP%] {\n    display: flex;\n    gap: 4px;\n    flex-shrink: 0;\n}\n\n.dep-badge[_ngcontent-%COMP%] {\n    display: inline-flex;\n    align-items: center;\n    gap: 3px;\n    padding: 2px 8px;\n    border-radius: 10px;\n    font-size: 11px;\n    font-weight: 600;\n}\n\n.dep-badge[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] { font-size: 9px; }\n\n.level-none[_ngcontent-%COMP%] { display: none; }\n\n.level-low[_ngcontent-%COMP%] {\n    background: color-mix(in srgb, var(--mj-status-success) 10%, transparent);\n    color: var(--mj-status-success);\n}\n\n.level-medium[_ngcontent-%COMP%] {\n    background: color-mix(in srgb, var(--mj-status-warning) 10%, transparent);\n    color: var(--mj-status-warning);\n}\n\n.level-high[_ngcontent-%COMP%] {\n    background: color-mix(in srgb, var(--mj-status-error) 10%, transparent);\n    color: var(--mj-status-error);\n}\n\n.level-depends-on[_ngcontent-%COMP%] {\n    background: color-mix(in srgb, var(--mj-brand-primary) 10%, transparent);\n    color: var(--mj-brand-primary);\n}\n\n.empty-list[_ngcontent-%COMP%] {\n    padding: 20px;\n    text-align: center;\n    font-size: 13px;\n    color: var(--mj-text-secondary);\n}\n\n\n\n.entity-detail-panel[_ngcontent-%COMP%] {\n    background: var(--mj-bg-surface-card);\n    border: 1px solid var(--mj-border-default);\n    border-radius: 12px;\n    padding: 24px;\n    overflow-y: auto;\n    max-height: calc(100vh - 280px);\n}\n\n.detail-header[_ngcontent-%COMP%] {\n    display: flex;\n    align-items: center;\n    gap: 12px;\n    margin-bottom: 28px;\n    padding-bottom: 16px;\n    border-bottom: 1px solid var(--mj-border-default);\n}\n\n.detail-header-text[_ngcontent-%COMP%] {\n    display: flex;\n    flex-direction: column;\n    gap: 2px;\n}\n\n.detail-icon[_ngcontent-%COMP%] {\n    font-size: 20px;\n    color: var(--mj-brand-primary);\n}\n\n.detail-title[_ngcontent-%COMP%] {\n    font-size: 20px;\n    font-weight: 700;\n    color: var(--mj-text-primary);\n    margin: 0;\n}\n\n.detail-schema[_ngcontent-%COMP%] {\n    font-size: 12px;\n    color: var(--mj-text-secondary);\n}\n\n\n\n.relationship-section[_ngcontent-%COMP%] {\n    margin-bottom: 28px;\n}\n\n.section-header[_ngcontent-%COMP%] {\n    display: flex;\n    align-items: center;\n    gap: 10px;\n    margin-bottom: 4px;\n}\n\n.section-header[_ngcontent-%COMP%]   h4[_ngcontent-%COMP%] {\n    font-size: 14px;\n    font-weight: 600;\n    color: var(--mj-text-primary);\n    margin: 0;\n    flex: 1;\n}\n\n.section-hint[_ngcontent-%COMP%] {\n    font-size: 12px;\n    color: var(--mj-text-muted);\n    margin: 0 0 12px 0;\n}\n\n.section-hint[_ngcontent-%COMP%]   strong[_ngcontent-%COMP%] {\n    color: var(--mj-text-secondary);\n}\n\n.section-icon[_ngcontent-%COMP%] {\n    font-size: 14px;\n}\n\n.referenced-by-icon[_ngcontent-%COMP%] { color: var(--mj-status-success); }\n.depends-on-icon[_ngcontent-%COMP%] { color: var(--mj-brand-primary); }\n\n.section-count[_ngcontent-%COMP%] {\n    display: inline-flex;\n    align-items: center;\n    justify-content: center;\n    min-width: 24px;\n    height: 24px;\n    padding: 0 8px;\n    background: var(--mj-bg-surface-sunken);\n    border-radius: 12px;\n    font-size: 12px;\n    font-weight: 600;\n    color: var(--mj-text-secondary);\n}\n\n.relationship-list[_ngcontent-%COMP%] {\n    display: flex;\n    flex-direction: column;\n    gap: 4px;\n}\n\n.relationship-item[_ngcontent-%COMP%] {\n    border-radius: 8px;\n    transition: background 0.15s ease;\n}\n\n.relationship-item[_ngcontent-%COMP%]:hover {\n    background: var(--mj-bg-surface-sunken);\n}\n\n.rel-main[_ngcontent-%COMP%] {\n    display: flex;\n    align-items: center;\n    gap: 8px;\n    padding: 8px 12px;\n    cursor: pointer;\n}\n\n.rel-icon[_ngcontent-%COMP%] {\n    font-size: 12px;\n    color: var(--mj-brand-primary);\n    opacity: 0.7;\n    flex-shrink: 0;\n}\n\n.rel-entity-name[_ngcontent-%COMP%] {\n    font-size: 14px;\n    color: var(--mj-brand-primary);\n    font-weight: 500;\n}\n\n.rel-entity-name[_ngcontent-%COMP%]:hover {\n    text-decoration: underline;\n}\n\n.rel-join-field[_ngcontent-%COMP%] {\n    display: inline-flex;\n    align-items: center;\n    gap: 4px;\n    font-size: 11px;\n    color: var(--mj-text-muted);\n    font-family: 'SF Mono', 'Fira Code', monospace;\n    margin-left: 4px;\n    padding: 2px 8px;\n    background: var(--mj-bg-surface-sunken);\n    border-radius: 4px;\n}\n\n.rel-join-field[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n    font-size: 9px;\n    opacity: 0.5;\n}\n\n.empty-relationships[_ngcontent-%COMP%] {\n    padding: 12px;\n    text-align: center;\n    font-size: 13px;\n    color: var(--mj-text-muted);\n}\n\n\n\n.no-selection[_ngcontent-%COMP%] {\n    display: flex;\n    flex-direction: column;\n    align-items: center;\n    justify-content: center;\n    padding: 60px 20px;\n    text-align: center;\n    height: 100%;\n}\n\n.no-selection-icon[_ngcontent-%COMP%] {\n    font-size: 48px;\n    color: var(--mj-text-muted);\n    margin-bottom: 16px;\n}\n\n.no-selection[_ngcontent-%COMP%]   h3[_ngcontent-%COMP%] {\n    font-size: 18px;\n    font-weight: 600;\n    color: var(--mj-text-primary);\n    margin: 0 0 8px 0;\n}\n\n.no-selection[_ngcontent-%COMP%]   p[_ngcontent-%COMP%] {\n    font-size: 14px;\n    color: var(--mj-text-secondary);\n    margin: 0;\n    max-width: 300px;\n}"], changeDetection: 0 });
};
VersionHistoryGraphResourceComponent = VersionHistoryGraphResourceComponent_1 = __decorate([
    RegisterClass(BaseResourceComponent, 'VersionHistoryGraphResource')
], VersionHistoryGraphResourceComponent);
export { VersionHistoryGraphResourceComponent };
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(VersionHistoryGraphResourceComponent, [{
        type: Component,
        args: [{ standalone: false, selector: 'mj-version-history-graph-resource', changeDetection: ChangeDetectionStrategy.OnPush, template: "<mj-page-layout>\n  <mj-page-header\n    Title=\"Entity Dependency Graph\"\n    Icon=\"fa-solid fa-diagram-project\"\n    Subtitle=\"Explore entity relationships used by the version history system\">\n    <div meta>\n      <mj-stat-badge Icon=\"fa-solid fa-table\" [Count]=\"TotalEntities\" Label=\"entities\"></mj-stat-badge>\n      <mj-stat-badge Icon=\"fa-solid fa-diagram-project\" [Count]=\"EntitiesWithDependents\" Label=\"with dependents\"></mj-stat-badge>\n      <mj-stat-badge Icon=\"fa-solid fa-arrow-right-arrow-left\" [Count]=\"TotalRelationships\" Label=\"relationships\"></mj-stat-badge>\n    </div>\n    <div actions>\n      <mj-refresh-button [Loading]=\"IsLoading\" (Clicked)=\"Refresh()\"></mj-refresh-button>\n    </div>\n    <div toolbar>\n      <mj-page-search\n        Placeholder=\"Filter entities...\"\n        [Value]=\"SearchText\"\n        (ValueChange)=\"OnSearchChange($event)\">\n      </mj-page-search>\n      @if (AvailableSchemas.length > 1) {\n        @for (schema of AvailableSchemas; track schema) {\n          <mj-filter-chip\n            [Label]=\"schema\"\n            [Count]=\"GetSchemaEntityCount(schema)\"\n            [Active]=\"SchemaFilter === schema\"\n            (Clicked)=\"OnSchemaFilterChange(schema)\">\n          </mj-filter-chip>\n        }\n      }\n    </div>\n  </mj-page-header>\n\n  <mj-page-body [Flex]=\"true\">\n  @if (IsLoading) {\n    <mj-loading text=\"Loading dependency graph...\"></mj-loading>\n  }\n\n  @if (!IsLoading) {\n    <!-- Main Layout: Entity List + Detail -->\n    <div class=\"graph-layout\">\n      <!-- Entity List \u2014 page-header [toolbar] owns search + schema chips -->\n      <div class=\"entity-list-panel\">\n        <div class=\"entity-scroll-list\">\n          @for (entity of FilteredEntities; track entity) {\n            <div class=\"entity-list-item\"\n              [class.selected]=\"entity.IsSelected\"\n              (click)=\"SelectEntity(entity)\">\n              <div class=\"entity-list-name\">{{entity.Name}}</div>\n              <div class=\"entity-list-badges\">\n                @if (entity.ReferencedByCount > 0) {\n                  <span class=\"dep-badge\"\n                    [ngClass]=\"GetDependencyLevel(entity.ReferencedByCount)\"\n                    title=\"Referenced by (entities with FKs to this)\">\n                    {{entity.ReferencedByCount}} <i class=\"fa-solid fa-arrow-down\"></i>\n                  </span>\n                }\n                @if (entity.DependsOnCount > 0) {\n                  <span class=\"dep-badge level-depends-on\"\n                    title=\"Depends on (entities this has FKs to)\">\n                    {{entity.DependsOnCount}} <i class=\"fa-solid fa-arrow-up\"></i>\n                  </span>\n                }\n              </div>\n            </div>\n          }\n          @if (FilteredEntities.length === 0) {\n            <div class=\"empty-list\">\n              <p>No entities match your search.</p>\n            </div>\n          }\n        </div>\n      </div>\n      <!-- Detail Panel -->\n      <div class=\"entity-detail-panel\">\n        @if (SelectedEntity) {\n          <div class=\"detail-header\">\n            <i class=\"fa-solid fa-table detail-icon\"></i>\n            <div class=\"detail-header-text\">\n              <h3 class=\"detail-title\">{{SelectedEntity.Name}}</h3>\n              <span class=\"detail-schema\">{{SelectedEntity.SchemaName}}</span>\n            </div>\n          </div>\n          <!-- Referenced By (entities that have FKs pointing to this entity) -->\n          <div class=\"relationship-section\">\n            <div class=\"section-header\">\n              <i class=\"fa-solid fa-arrow-down section-icon referenced-by-icon\"></i>\n              <h4>Referenced By</h4>\n              <span class=\"section-count\">{{ReferencedByEntities.length}}</span>\n            </div>\n            <p class=\"section-hint\">Entities that have foreign keys pointing to <strong>{{SelectedEntity.Name}}</strong></p>\n            @if (ReferencedByEntities.length > 0) {\n              <div class=\"relationship-list\">\n                @for (rel of ReferencedByEntities; track rel) {\n                  <div class=\"relationship-item\">\n                    <div class=\"rel-main\"\n                      (click)=\"NavigateToEntity(rel.ToEntity)\">\n                      <i class=\"fa-solid fa-table rel-icon\"></i>\n                      <span class=\"rel-entity-name\">{{rel.ToEntity}}</span>\n                      <span class=\"rel-join-field\">\n                        <i class=\"fa-solid fa-link\"></i>\n                        {{rel.RelatedEntityJoinField}}\n                      </span>\n                    </div>\n                  </div>\n                }\n              </div>\n            }\n            @if (ReferencedByEntities.length === 0) {\n              <div class=\"empty-relationships\">\n                <p>No entities reference this entity.</p>\n              </div>\n            }\n          </div>\n          <!-- Depends On (entities this entity has FKs to) -->\n          <div class=\"relationship-section\">\n            <div class=\"section-header\">\n              <i class=\"fa-solid fa-arrow-up section-icon depends-on-icon\"></i>\n              <h4>Depends On</h4>\n              <span class=\"section-count\">{{DependsOnEntities.length}}</span>\n            </div>\n            <p class=\"section-hint\"><strong>{{SelectedEntity.Name}}</strong> has foreign keys pointing to these entities</p>\n            @if (DependsOnEntities.length > 0) {\n              <div class=\"relationship-list\">\n                @for (rel of DependsOnEntities; track rel) {\n                  <div class=\"relationship-item\">\n                    <div class=\"rel-main\"\n                      (click)=\"NavigateToEntity(rel.FromEntity)\">\n                      <i class=\"fa-solid fa-table rel-icon\"></i>\n                      <span class=\"rel-entity-name\">{{rel.FromEntity}}</span>\n                      <span class=\"rel-join-field\">\n                        <i class=\"fa-solid fa-link\"></i>\n                        {{rel.RelatedEntityJoinField}}\n                      </span>\n                    </div>\n                  </div>\n                }\n              </div>\n            }\n            @if (DependsOnEntities.length === 0) {\n              <div class=\"empty-relationships\">\n                <p>This entity has no foreign key dependencies.</p>\n              </div>\n            }\n          </div>\n        } @else {\n          <div class=\"no-selection\">\n            <i class=\"fa-solid fa-diagram-project no-selection-icon\"></i>\n            <h3>Select an Entity</h3>\n            <p>Choose an entity from the list to explore its dependency relationships.</p>\n          </div>\n        }\n      </div>\n    </div>\n  }\n  </mj-page-body>\n</mj-page-layout>\n", styles: ["/* Main Layout */\n.graph-layout {\n    display: grid;\n    grid-template-columns: 340px 1fr;\n    gap: 20px;\n    flex: 1;\n    min-height: 0;\n}\n\n/* Entity List Panel */\n.entity-list-panel {\n    background: var(--mj-bg-surface-card);\n    border: 1px solid var(--mj-border-default);\n    border-radius: 12px;\n    display: flex;\n    flex-direction: column;\n    max-height: calc(100vh - 280px);\n}\n\n.entity-scroll-list {\n    flex: 1;\n    overflow-y: auto;\n    padding: 8px;\n}\n\n.entity-list-item {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    padding: 10px 12px;\n    border-radius: 8px;\n    cursor: pointer;\n    transition: all 0.15s ease;\n}\n\n.entity-list-item:hover {\n    background: var(--mj-bg-surface-sunken);\n}\n\n.entity-list-item.selected {\n    background: color-mix(in srgb, var(--mj-brand-primary) 8%, transparent);\n    border-left: 3px solid var(--mj-brand-primary);\n}\n\n.entity-list-name {\n    font-size: 13px;\n    color: var(--mj-text-primary);\n    white-space: nowrap;\n    overflow: hidden;\n    text-overflow: ellipsis;\n    flex: 1;\n}\n\n.entity-list-badges {\n    display: flex;\n    gap: 4px;\n    flex-shrink: 0;\n}\n\n.dep-badge {\n    display: inline-flex;\n    align-items: center;\n    gap: 3px;\n    padding: 2px 8px;\n    border-radius: 10px;\n    font-size: 11px;\n    font-weight: 600;\n}\n\n.dep-badge i { font-size: 9px; }\n\n.level-none { display: none; }\n\n.level-low {\n    background: color-mix(in srgb, var(--mj-status-success) 10%, transparent);\n    color: var(--mj-status-success);\n}\n\n.level-medium {\n    background: color-mix(in srgb, var(--mj-status-warning) 10%, transparent);\n    color: var(--mj-status-warning);\n}\n\n.level-high {\n    background: color-mix(in srgb, var(--mj-status-error) 10%, transparent);\n    color: var(--mj-status-error);\n}\n\n.level-depends-on {\n    background: color-mix(in srgb, var(--mj-brand-primary) 10%, transparent);\n    color: var(--mj-brand-primary);\n}\n\n.empty-list {\n    padding: 20px;\n    text-align: center;\n    font-size: 13px;\n    color: var(--mj-text-secondary);\n}\n\n/* Detail Panel */\n.entity-detail-panel {\n    background: var(--mj-bg-surface-card);\n    border: 1px solid var(--mj-border-default);\n    border-radius: 12px;\n    padding: 24px;\n    overflow-y: auto;\n    max-height: calc(100vh - 280px);\n}\n\n.detail-header {\n    display: flex;\n    align-items: center;\n    gap: 12px;\n    margin-bottom: 28px;\n    padding-bottom: 16px;\n    border-bottom: 1px solid var(--mj-border-default);\n}\n\n.detail-header-text {\n    display: flex;\n    flex-direction: column;\n    gap: 2px;\n}\n\n.detail-icon {\n    font-size: 20px;\n    color: var(--mj-brand-primary);\n}\n\n.detail-title {\n    font-size: 20px;\n    font-weight: 700;\n    color: var(--mj-text-primary);\n    margin: 0;\n}\n\n.detail-schema {\n    font-size: 12px;\n    color: var(--mj-text-secondary);\n}\n\n/* Relationship Sections */\n.relationship-section {\n    margin-bottom: 28px;\n}\n\n.section-header {\n    display: flex;\n    align-items: center;\n    gap: 10px;\n    margin-bottom: 4px;\n}\n\n.section-header h4 {\n    font-size: 14px;\n    font-weight: 600;\n    color: var(--mj-text-primary);\n    margin: 0;\n    flex: 1;\n}\n\n.section-hint {\n    font-size: 12px;\n    color: var(--mj-text-muted);\n    margin: 0 0 12px 0;\n}\n\n.section-hint strong {\n    color: var(--mj-text-secondary);\n}\n\n.section-icon {\n    font-size: 14px;\n}\n\n.referenced-by-icon { color: var(--mj-status-success); }\n.depends-on-icon { color: var(--mj-brand-primary); }\n\n.section-count {\n    display: inline-flex;\n    align-items: center;\n    justify-content: center;\n    min-width: 24px;\n    height: 24px;\n    padding: 0 8px;\n    background: var(--mj-bg-surface-sunken);\n    border-radius: 12px;\n    font-size: 12px;\n    font-weight: 600;\n    color: var(--mj-text-secondary);\n}\n\n.relationship-list {\n    display: flex;\n    flex-direction: column;\n    gap: 4px;\n}\n\n.relationship-item {\n    border-radius: 8px;\n    transition: background 0.15s ease;\n}\n\n.relationship-item:hover {\n    background: var(--mj-bg-surface-sunken);\n}\n\n.rel-main {\n    display: flex;\n    align-items: center;\n    gap: 8px;\n    padding: 8px 12px;\n    cursor: pointer;\n}\n\n.rel-icon {\n    font-size: 12px;\n    color: var(--mj-brand-primary);\n    opacity: 0.7;\n    flex-shrink: 0;\n}\n\n.rel-entity-name {\n    font-size: 14px;\n    color: var(--mj-brand-primary);\n    font-weight: 500;\n}\n\n.rel-entity-name:hover {\n    text-decoration: underline;\n}\n\n.rel-join-field {\n    display: inline-flex;\n    align-items: center;\n    gap: 4px;\n    font-size: 11px;\n    color: var(--mj-text-muted);\n    font-family: 'SF Mono', 'Fira Code', monospace;\n    margin-left: 4px;\n    padding: 2px 8px;\n    background: var(--mj-bg-surface-sunken);\n    border-radius: 4px;\n}\n\n.rel-join-field i {\n    font-size: 9px;\n    opacity: 0.5;\n}\n\n.empty-relationships {\n    padding: 12px;\n    text-align: center;\n    font-size: 13px;\n    color: var(--mj-text-muted);\n}\n\n/* No Selection */\n.no-selection {\n    display: flex;\n    flex-direction: column;\n    align-items: center;\n    justify-content: center;\n    padding: 60px 20px;\n    text-align: center;\n    height: 100%;\n}\n\n.no-selection-icon {\n    font-size: 48px;\n    color: var(--mj-text-muted);\n    margin-bottom: 16px;\n}\n\n.no-selection h3 {\n    font-size: 18px;\n    font-weight: 600;\n    color: var(--mj-text-primary);\n    margin: 0 0 8px 0;\n}\n\n.no-selection p {\n    font-size: 14px;\n    color: var(--mj-text-secondary);\n    margin: 0;\n    max-width: 300px;\n}\n"] }]
    }], () => [{ type: i0.ChangeDetectorRef }], null); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(VersionHistoryGraphResourceComponent, { className: "VersionHistoryGraphResourceComponent", filePath: "src/VersionHistory/components/graph-resource.component.ts", lineNumber: 35 }); })();
//# sourceMappingURL=graph-resource.component.js.map