/**
 * @module database-designer-dashboard.component
 * @description Root dashboard for the Database Designer feature area.
 *
 * Registered as 'DatabaseDesignerDashboard' via `@RegisterClass(BaseDashboard, ...)`.
 * Registered as a navigation item via metadata (metadata/applications/).
 *
 * Lifecycle:
 *  - `initDashboard()` — sync ?entity= URL param (deep-link support), initialize slide-panel state
 *  - `loadData()` — delegate to DatabaseDesignerEngine singleton; pass result to EntityListComponent
 *
 * The wizard and modify panels open as MjSlidePanel drawers so the entity
 * list remains visible behind them.  The dashboard orchestrates all state
 * transitions; child components communicate only via @Output events.
 */
import { AfterViewInit } from '@angular/core';
import { BaseDashboard } from '@memberjunction/ng-shared';
import { ResourceData } from '@memberjunction/core-entities';
import { DatabaseDesignerService } from '../services/database-designer.service.js';
import type { AccessibleEntity } from '../database-designer.types.js';
import * as i0 from "@angular/core";
export declare class DatabaseDesignerDashboardComponent extends BaseDashboard implements AfterViewInit {
    /** Angular DI: write operations (create, modify, validate). */
    protected readonly designerService: DatabaseDesignerService;
    /** Change detection ref for OnPush updates. */
    private readonly cdr;
    /** Reference to the active modify component — used for close-guard state. */
    private modifyRef?;
    /** Reference to the entity list — used to drive the agent's read-only search/refresh. */
    private entityListRef?;
    /**
     * Passed as `[CanClose]` to the modify slide panel.
     * Prevents the panel from closing while a pipeline is running and prompts the user
     * for confirmation.  Defined as an arrow function so `this` is captured correctly
     * when called by `MjSlidePanelComponent` (no angular binding issues).
     */
    readonly ModifyPanelCanClose: () => boolean;
    /** Entities displayed in EntityListComponent — set by loadData(). */
    Entities: AccessibleEntity[];
    IsLoadingEntities: boolean;
    LoadError: string | null;
    /** Whether the Create Wizard drawer is open. */
    ShowCreateWizard: boolean;
    /** ID of the entity currently being modified; null if panel is closed. */
    ModifyEntityId: string | null;
    /** ID to deep-link into on first load (from ?entity= query param). */
    private _deepLinkEntityId;
    /**
     * Loaded field/column detail for the currently selected entity, used ONLY to enrich the
     * agent context (the modify panel loads its own detail independently). Cleared when the
     * panel closes; refreshed (best-effort) when an entity is selected.
     */
    private _selectedEntityDetail;
    GetResourceDisplayName(_data: ResourceData): Promise<string>;
    /**
     * After the view initializes, publish the initial agent context and register the
     * (read-only) client tools the AI agent can invoke against this surface. The ongoing
     * context re-emit happens from {@link loadData} and the slide-panel handlers as the
     * browse state changes.
     */
    ngAfterViewInit(): void;
    /** Sync ?entity=<id> URL param; set initial slide-panel state. */
    protected initDashboard(): void;
    /** Load accessible entities from the engine's cached store. */
    protected loadData(): Promise<void>;
    /** Opens the Create Wizard drawer. */
    OnNewEntity(): void;
    /** Opens the Modify panel for an existing entity. */
    OnEditEntity(entity: AccessibleEntity): void;
    /** Opens the Modify panel (read-only view) for an existing entity. */
    OnViewEntity(entity: AccessibleEntity): void;
    /** Called when the Create Wizard drawer closes (cancel or success). */
    OnWizardClosed(): void;
    /** Called when the wizard successfully creates an entity. */
    OnEntityCreated(): void;
    /** Called when the Modify panel drawer closes. */
    OnModifyPanelClosed(): void;
    /** Called when the modify wizard successfully alters an entity. */
    OnEntityModified(): void;
    /**
     * React to ?entity= changes that arrive after initial load — e.g. clicking a Home pin
     * for a specific entity, or browser back/forward — when this tab is re-focused rather
     * than freshly mounted (so initDashboard() does not run again). Without this, the modify
     * panel would not open for the pinned/linked entity. (initDashboard handles the very
     * first load via _deepLinkEntityId.)
     */
    protected OnQueryParamsChanged(params: Record<string, string>, _source: 'popstate' | 'deeplink'): void;
    private openModifyPanel;
    /**
     * Load the selected entity's field detail (read-only) purely to enrich the agent
     * context. Guarded against a newer selection superseding this load. Re-publishes context
     * once the detail is available.
     */
    private loadSelectedEntityDetailForContext;
    /**
     * Registered Name of the entity whose detail panel is open, resolved from the loaded
     * list. Null when nothing is selected or the id is not (yet) in the list.
     */
    get SelectedEntityName(): string | null;
    /** Current free-text search term applied to the entity list (reads the child list's state). */
    private get currentSearchText();
    /** Active schema filter applied to the entity list (reads the child list's state). */
    private get currentSchemaFilter();
    /** Count of entities visible after the child list's search + schema filter. */
    private get filteredEntityCount();
    /**
     * Build the resolver candidate list: every accessible entity as an
     * {@link EntityNameCandidate}, enriched with the entity's `DisplayName` from `EntityInfo`
     * metadata when available (so display-name resolution matches what the user reads).
     */
    private buildEntityCandidates;
    /** Resolve the `EntityInfo` for a registered entity name (for DisplayName + RelatedEntities). */
    private lookupEntityInfo;
    /** The on-screen DISPLAY label for an accessible entity (DisplayName, else prefix-stripped Name). */
    private displayNameForEntity;
    /** Bounded-by-the-helper list of the DISPLAY names of the currently-filtered entities. */
    private get availableEntityDisplayNames();
    /** Schema → entity-count groupings across all accessible entities. */
    private buildSchemaGroups;
    /** Field summaries for the selected entity (from the loaded detail), for the agent context. */
    private buildSelectedEntityFields;
    /** Related-entity summaries for the selected entity (from EntityInfo.RelatedEntities). */
    private buildSelectedRelatedEntities;
    /**
     * Publish the current Database Designer schema-browse state to the AI agent via
     * NavigationService. Reports the accessible-entity count + filtered count, the current
     * search/schema filters, the open selection (id + registered name + DISPLAY name +
     * schema + table + field count + bounded field/relationship summary), whether the
     * modify/detail panel is open, the loading flag, the bounded available-entity DISPLAY
     * names, and the schema-grouping landscape. The shaping lives in the pure
     * {@link buildDatabaseDesignerAgentContext} helper so it stays unit-testable. Called on
     * init (ngAfterViewInit) and on every browse-state change (load, filter, open/close
     * panel, detail load).
     */
    private publishAgentContext;
    /**
     * Register the READ-ONLY (schema-browse) client tools the AI agent can invoke against
     * the Database Designer. Each handler delegates to the same read-only path a user
     * interaction would take and returns `{ Success: true }` on success or
     * `{ Success: false, ErrorMessage }` on failure. Handlers never throw.
     *
     * Tools (browse only — see SAFETY BOUNDARY above):
     * - SearchEntities: filter the accessible-entity list by a search string.
     * - SelectEntity: open an entity's detail panel by its ID OR name/display-name (VIEW).
     * - FilterBySchema: narrow the entity list to a schema (empty string clears the filter).
     * - RefreshEntityList: reload the accessible-entity list.
     * - NavigateToEntityRecord: open the `MJ: Entities` record for an entity to VIEW it.
     *
     * Intentionally NOT exposed (mutations — see SAFETY BOUNDARY): create wizard,
     * modify-schema, add/remove/change fields, delete entity, apply changes, run pipeline.
     */
    private registerAgentClientTools;
    /** Apply a read-only search filter to the entity list via the child list component. */
    private toolSearchEntities;
    /**
     * Open an entity's detail panel to VIEW its schema. Resolves the agent's reference by ID,
     * registered name, or DISPLAY name. This opens the SAME panel the user edits in, but the
     * agent only opens it for browsing — it applies nothing.
     */
    private toolSelectEntity;
    /** Narrow the entity list to a schema (empty string clears it). Read-only. */
    private toolFilterBySchema;
    /** Reload the accessible-entity list (read-only). */
    private toolRefreshEntityList;
    /**
     * Open the `MJ: Entities` record for an entity in a tab to VIEW its full metadata.
     * Resolves by ID / registered name / display name. Read-only navigation.
     */
    private toolNavigateToEntityRecord;
    static ɵfac: i0.ɵɵFactoryDeclaration<DatabaseDesignerDashboardComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<DatabaseDesignerDashboardComponent, "mj-database-designer-dashboard", never, {}, {}, never, never, false, never>;
}
/** Tree-shaking prevention — called from module's public-api.ts. */
export declare function LoadDatabaseDesignerDashboard(): void;
//# sourceMappingURL=database-designer-dashboard.component.d.ts.map