import { EventEmitter, OnInit, OnDestroy } from '@angular/core';
import { MJRecordChangeEntity, MJTemplateContentEntity } from '@memberjunction/core-entities';
import { BehaviorSubject } from 'rxjs';
import { MJNotificationService } from '@memberjunction/ng-notifications';
import { MJAIPromptEntityExtended } from '@memberjunction/ai-core-plus';
import * as i0 from "@angular/core";
interface PromptVersion {
    id: string;
    version: number;
    changedAt: Date;
    changedBy: string;
    changeType: 'Create' | 'Update' | 'Delete';
    changeSource: 'Internal' | 'External';
    changesDescription: string;
    changesJSON: any;
    fullRecordJSON: any;
    templateContent?: MJTemplateContentEntity;
    isActive: boolean;
    canRestore: boolean;
}
interface VersionComparison {
    fromVersion: PromptVersion;
    toVersion: PromptVersion;
    differences: FieldDifference[];
}
interface FieldDifference {
    fieldName: string;
    displayName: string;
    oldValue: any;
    newValue: any;
    changeType: 'added' | 'modified' | 'removed';
    isTemplate: boolean;
}
export declare class PromptVersionControlComponent implements OnInit, OnDestroy {
    private notificationService;
    prompt: MJAIPromptEntityExtended | null;
    autoLoad: boolean;
    showRestoreActions: boolean;
    showComparison: boolean;
    maxVersions: number;
    versionSelected: EventEmitter<PromptVersion>;
    versionRestored: EventEmitter<MJAIPromptEntityExtended>;
    versionCompared: EventEmitter<VersionComparison>;
    versions: PromptVersion[];
    recordChanges: MJRecordChangeEntity[];
    templateContents: Map<string, MJTemplateContentEntity>;
    availablePrompts: MJAIPromptEntityExtended[];
    filteredAvailablePrompts: MJAIPromptEntityExtended[];
    isLoading: boolean;
    loadingMessage: string;
    error: string | null;
    currentView: 'timeline' | 'comparison' | 'details';
    selectedVersion: PromptVersion | null;
    compareFromVersion: PromptVersion | null;
    compareToVersion: PromptVersion | null;
    comparisonResult: VersionComparison | null;
    filterBy: 'all' | 'updates' | 'major' | 'template';
    sortDirection: 'asc' | 'desc';
    searchTerm$: BehaviorSubject<string>;
    promptSearchTerm$: BehaviorSubject<string>;
    showSystemChanges: boolean;
    timelineConfig: {
        showThumbnails: boolean;
        showDiffs: boolean;
        compactMode: boolean;
        groupByDate: boolean;
    };
    private destroy$;
    constructor(notificationService: MJNotificationService);
    ngOnInit(): void;
    ngOnDestroy(): void;
    loadVersionHistory(): Promise<void>;
    private loadTemplateContents;
    private processRecordChanges;
    private safeParseJSON;
    private applyFilters;
    private isMajorChange;
    private hasTemplateChanges;
    onVersionSelect(version: PromptVersion): void;
    onVersionRestore(version: PromptVersion): Promise<void>;
    getObjectKeys(obj: any): string[];
    getFieldDisplayNamePublic(fieldName: string): string;
    generateComparisonPublic(): void;
    applyFiltersPublic(): void;
    restoreVersion(version: PromptVersion): Promise<void>;
    startComparison(fromVersion: PromptVersion, toVersion?: PromptVersion): void;
    private generateComparison;
    private compareTemplateContent;
    private getFieldDisplayName;
    onFilterChange(filter: string): void;
    onSortDirectionChange(): void;
    onSearchChange(term: string): void;
    onViewChange(view: string): void;
    getChangeTypeIcon(changeType: string): string;
    getChangeTypeClass(changeType: string): string;
    formatChangeValue(value: any): string;
    getVersionLabel(version: PromptVersion): string;
    exportVersionHistory(): void;
    refreshHistory(): void;
    private loadAvailablePrompts;
    private setupPromptFiltering;
    private filterAvailablePrompts;
    onPromptSearchChange(searchTerm: string): void;
    selectPromptForHistory(prompt: MJAIPromptEntityExtended): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<PromptVersionControlComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<PromptVersionControlComponent, "app-prompt-version-control", never, { "prompt": { "alias": "prompt"; "required": false; }; "autoLoad": { "alias": "autoLoad"; "required": false; }; "showRestoreActions": { "alias": "showRestoreActions"; "required": false; }; "showComparison": { "alias": "showComparison"; "required": false; }; "maxVersions": { "alias": "maxVersions"; "required": false; }; }, { "versionSelected": "versionSelected"; "versionRestored": "versionRestored"; "versionCompared": "versionCompared"; }, never, never, false, never>;
}
export {};
//# sourceMappingURL=prompt-version-control.component.d.ts.map