/**
 * @fileoverview Classify · Content Sources tab.
 *
 * Self-contained sub-page: owns its header-interior, the source cards grid,
 * the per-source detail slide-in, and the quick-schedule dialog. Receives the
 * shared raw data needed to build the cards (sources, items, tags, runs, and
 * the cached ScheduledAction + EntityRecordDocument lookups) from the host
 * orchestrator via `@Input()`. Cross-tab concerns — opening the add/edit slide-in
 * form, running the pipeline, opening a content-item detail, and reloading the
 * shared source list after a mutation — bubble up via `@Output()`.
 *
 * Out of scope (stays in the host): the add/edit source slide-in FORM, the
 * pipeline tab, and the Content Duplicates section.
 */
import { EventEmitter } from '@angular/core';
import { BaseAngularComponent } from '@memberjunction/ng-base-types';
import { MJScheduledActionEntity } from '@memberjunction/core-entities';
import { SourceCard, SourceDetailInfo, ContentItemDetail, ItemPipelineStatus } from '../shared/classify.types';
import { formatNumber } from '../shared/classify.format';
import * as i0 from "@angular/core";
export declare class ClassifySourcesTabComponent extends BaseAngularComponent {
    private cdr;
    /** Raw `MJ: Content Sources` rows — the primary source for the cards. */
    private _sources;
    set Sources(value: Record<string, unknown>[]);
    get Sources(): Record<string, unknown>[];
    /** Raw `MJ: Content Items` rows — used to count items per source. */
    private _items;
    set Items(value: Record<string, unknown>[]);
    get Items(): Record<string, unknown>[];
    /** Raw `MJ: Content Item Tags` rows — used to count tags per source. */
    private _tags;
    set Tags(value: Record<string, unknown>[]);
    get Tags(): Record<string, unknown>[];
    /** Raw `MJ: Content Process Runs` rows — used to derive last-run + status. */
    private _runs;
    set Runs(value: Record<string, unknown>[]);
    get Runs(): Record<string, unknown>[];
    /** Accurate total item count from TotalRowCount (used when a single source exists). */
    private _totalItemCount;
    set TotalItemCount(value: number);
    get TotalItemCount(): number;
    /** Accurate total tag count from TotalRowCount (used when a single source exists). */
    private _totalTagCount;
    set TotalTagCount(value: number);
    get TotalTagCount(): number;
    /** Cached ScheduledAction entities, keyed by normalized ID, supplied by the host. */
    private _scheduledActions;
    set ScheduledActions(value: Map<string, MJScheduledActionEntity>);
    get ScheduledActions(): Map<string, MJScheduledActionEntity>;
    /** Cache: EntityRecordDocument ID → RecordID, supplied by the host. */
    private _entityRecordDocCache;
    set EntityRecordDocCache(value: Map<string, string>);
    get EntityRecordDocCache(): Map<string, string>;
    /** Shown while a manual Refresh() recomputes the source cards. */
    IsLoading: boolean;
    SourceCards: SourceCard[];
    SelectedSource: SourceDetailInfo | null;
    ShowSourceDetail: boolean;
    SourceDetailLoading: boolean;
    SourceDetailStatusFilter: ItemPipelineStatus | 'All';
    readonly SourceDetailStatusOptions: (ItemPipelineStatus | 'All')[];
    SourceDetailPage: number;
    readonly SourceDetailPageSize = 10;
    ShowDryRunPreview: boolean;
    DryRunSourceCard: SourceCard | null;
    ShowScheduleDialog: boolean;
    ScheduleSaving: boolean;
    SchedulingSourceCard: SourceCard | null;
    ScheduleCron: string;
    ScheduleEnabled: boolean;
    /** Template-facing formatter. */
    readonly formatNumber: typeof formatNumber;
    /** Bubble "add source" up — host opens its slide-in CRUD form. */
    AddSourceRequested: EventEmitter<void>;
    /** Bubble "add source (guided)" up — host opens the setup wizard. */
    AddSourceGuidedRequested: EventEmitter<void>;
    /** Bubble "edit source" up — host opens its slide-in CRUD form pre-filled. */
    EditSourceRequested: EventEmitter<SourceCard>;
    /** Bubble "run pipeline for source" up — host runs the pipeline for the given source ID. */
    RunSourceRequested: EventEmitter<string>;
    /** Bubble "open content item detail" up — host owns the item-detail slide-in. */
    OpenContentItemRequested: EventEmitter<ContentItemDetail>;
    /** Fired after a delete / schedule change so the host reloads the shared source list. */
    DataChanged: EventEmitter<void>;
    /**
     * Recompute the source cards from the current host-supplied inputs. The data
     * itself is owned by the host (flows in via @Input); Refresh just rebuilds the
     * view models and surfaces a brief loading state for user feedback.
     */
    Refresh(): Promise<void>;
    onAddSource(): void;
    onAddSourceGuided(): void;
    onEditSource(card: SourceCard): void;
    onRunSource(sourceID: string): void;
    /** Opens the dry-run disposition preview for a source. */
    OpenDryRunPreview(card: SourceCard): void;
    CloseDryRunPreview(): void;
    /** Rebuild the source card view models from the current inputs. */
    private rebuild;
    private countItemsBySource;
    private countTagsBySource;
    private getLastRunBySource;
    private countTagsByItem;
    private getAllWeightedTagsForItem;
    /** Check if a source type's Configuration says RequiresFileType !== false */
    private sourceTypeRequiresFileType;
    /** Resolve the entity record ID from the EntityRecordDocument for entity-sourced content items */
    private resolveEntityRecordID;
    /** Resolve the entity name for an entity-sourced content source */
    private resolveEntityName;
    private resolveEmbeddingModelName;
    private resolveVectorIndexName;
    /**
     * Infer embedding and tagging pipeline statuses for a content item. Uses tag
     * count + run-history heuristics since dedicated status columns are not yet
     * available on the ContentItem entity.
     */
    private inferPipelineStatuses;
    private mapStatusString;
    formatRelativeTime(dateStr: string | null | undefined): string;
    /** Looks up the cron expression for a cached ScheduledAction by ID */
    private getScheduledActionCron;
    /** Returns the CSS class for a pipeline status badge color */
    GetStatusBadgeClass(status: ItemPipelineStatus): string;
    DeleteSource(card: SourceCard): Promise<void>;
    OpenScheduleDialog(card: SourceCard): void;
    CloseScheduleDialog(): void;
    /**
     * Saves a new ScheduledAction for the current source, links it via
     * ContentSource.ScheduledActionID, and creates the default action params
     * for the Autotag and Vectorize action.
     */
    SaveSchedule(): Promise<void>;
    /**
     * Removes the schedule from a source card by unlinking the ScheduledActionID.
     */
    RemoveSchedule(card: SourceCard): Promise<void>;
    /** Returns the human-readable schedule description for a source card. */
    GetScheduleLabel(card: SourceCard): string;
    /** Returns a human-readable preview of a cron expression for the schedule dialog. */
    GetCronPreview(cron: string): string;
    /** Finds the Action ID for "Autotag and Vectorize Content" by querying actions */
    private findAutotagActionID;
    /**
     * Creates a ScheduledActionParam that passes the source ID to the action.
     * Looks up the "EntityNames" action param and sets the source ID as its value.
     */
    private createSourceIDParam;
    /**
     * Links (or unlinks) a ScheduledAction to a ContentSource by updating
     * the ContentSource.ScheduledActionID field.
     */
    private linkScheduleToSource;
    OpenSourceDetail(card: SourceCard): Promise<void>;
    CloseSourceDetail(): void;
    OpenContentItemDetail(item: ContentItemDetail): void;
    OpenEditSourceFromDetail(): void;
    RunSourceFromDetail(): void;
    DeleteSourceFromDetail(): Promise<void>;
    get FilteredSourceDetailItems(): ContentItemDetail[];
    get FilteredSourceDetailTotal(): number;
    get SourceDetailTotalPages(): number;
    SourceDetailPrevPage(): void;
    SourceDetailNextPage(): void;
    OnSourceDetailStatusFilterChange(): void;
    /**
     * Placeholder handler for retrying failed items in source detail. Surfaces a
     * notification; the pipeline re-processes failed items on the next run.
     */
    RetryFailedItems(): void;
    private loadContentItemsForSource;
    private loadRunHistoryForSource;
    static ɵfac: i0.ɵɵFactoryDeclaration<ClassifySourcesTabComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<ClassifySourcesTabComponent, "classify-sources-tab", never, { "Sources": { "alias": "Sources"; "required": false; }; "Items": { "alias": "Items"; "required": false; }; "Tags": { "alias": "Tags"; "required": false; }; "Runs": { "alias": "Runs"; "required": false; }; "TotalItemCount": { "alias": "TotalItemCount"; "required": false; }; "TotalTagCount": { "alias": "TotalTagCount"; "required": false; }; "ScheduledActions": { "alias": "ScheduledActions"; "required": false; }; "EntityRecordDocCache": { "alias": "EntityRecordDocCache"; "required": false; }; }, { "AddSourceRequested": "AddSourceRequested"; "AddSourceGuidedRequested": "AddSourceGuidedRequested"; "EditSourceRequested": "EditSourceRequested"; "RunSourceRequested": "RunSourceRequested"; "OpenContentItemRequested": "OpenContentItemRequested"; "DataChanged": "DataChanged"; }, never, never, false, never>;
}
//# sourceMappingURL=sources-tab.component.d.ts.map