import { OnInit, OnDestroy } from '@angular/core';
import { CompositeKey } from '@memberjunction/core';
import { BaseResourceComponent } from '@memberjunction/ng-shared';
import { ResourceData, MJCompanyIntegrationEntity, MJCredentialEntity, MJIntegrationEntity } from '@memberjunction/core-entities';
import { CredentialDialogResult } from '@memberjunction/ng-credentials';
import { TreeBranchConfig, TreeLeafConfig, TreeNode, TreeDropdownComponent } from '@memberjunction/ng-trees';
import { IntegrationSummary, EntityMapRow } from '../../services/integration-data.service';
import * as i0 from "@angular/core";
type StatusBadgeType = 'Connected' | 'Error' | 'Inactive' | 'Syncing';
type WizardStepType = 1 | 2 | 3;
type CardMenuAction = 'edit' | 'disable' | 'delete';
interface WizardStep {
    Number: number;
    Label: string;
}
interface CompanyRow {
    ID: string;
    Name: string;
}
export declare class ConnectionsComponent extends BaseResourceComponent implements OnInit, OnDestroy {
    Connections: IntegrationSummary[];
    EntityMapCounts: Map<string, number>;
    IsLoading: boolean;
    TestingCardID: string | null;
    TestCardResults: Map<string, {
        Success: boolean;
        Message: string;
    }>;
    WizardOpen: boolean;
    WizardStep: WizardStepType;
    WizardSteps: WizardStep[];
    AvailableIntegrations: MJIntegrationEntity[];
    SearchQuery: string;
    SelectedIntegration: MJIntegrationEntity | null;
    ConnectionName: string;
    SelectedCompanyID: string | null;
    ConnectionDescription: string;
    Companies: CompanyRow[];
    SelectedCredentialID: string | null;
    ShowCredentialDialog: boolean;
    PreselectedCredentialTypeId: string | undefined;
    ExistingCredentials: MJCredentialEntity[];
    IsLoadingCredentials: boolean;
    SelectedCredential: MJCredentialEntity | null;
    TestResult: {
        Success: boolean;
        Message: string;
        ServerVersion?: string;
    } | null;
    IsTesting: boolean;
    IsSaving: boolean;
    SavedIntegrationID: string | null;
    OpenMenuID: string | null;
    EditPanelOpen: boolean;
    EditingSummary: IntegrationSummary | null;
    EditEntity: MJCompanyIntegrationEntity | null;
    EditName: string;
    EditDescription: string;
    EditCredentialID: string | null;
    EditCredential: MJCredentialEntity | null;
    EditCredentials: MJCredentialEntity[];
    EditIsActive: boolean;
    IsEditSaving: boolean;
    IsEditLoading: boolean;
    SelectedSummary: IntegrationSummary | null;
    DetailEntityMaps: EntityMapRow[];
    DetailFilteredMaps: EntityMapRow[];
    DetailSearchTerm: string;
    IsDetailLoading: boolean;
    ScheduledJobID: string | null;
    ShowScheduleSlidePanel: boolean;
    EditorEntityMap: EntityMapRow | null;
    ShowAddMapPanel: boolean;
    AvailableSourceObjects: Array<{
        Name: string;
        Label: string;
    }>;
    IsLoadingSourceObjects: boolean;
    AddMapSourceObjectName: string;
    AddMapEntityID: string;
    AddMapDirection: 'Pull' | 'Push' | 'Bidirectional';
    IsSavingAddMap: boolean;
    entityTreeDropdown: TreeDropdownComponent | undefined;
    EntityBranchConfig: TreeBranchConfig;
    EntityLeafConfig: TreeLeafConfig;
    ShowCreateEntity: boolean;
    NewEntitySchema: string;
    NewEntityTable: string;
    DDLPreview: string | null;
    DDLPreviewWarnings: string[];
    IsGeneratingDDL: boolean;
    IsCreatingEntity: boolean;
    ShowAutoMapPanel: boolean;
    AutoMapSchemas: string[];
    AutoMapSelectedSchema: string;
    AutoMapDirection: 'Pull' | 'Push' | 'Bidirectional';
    IsAutoMapping: boolean;
    AutoMapResult: {
        EntityMapsCreated: number;
        FieldMapsCreated: number;
        Errors: string[];
    } | null;
    ShowCreateTablesPanel: boolean;
    CreateTablesObjects: Array<{
        /** IntegrationObject.ID when AlreadyPersisted; undefined for freshly-discovered objects. */
        ID?: string;
        Name: string;
        Label: string;
        Selected: boolean;
        AlreadyPersisted: boolean;
        IsCustom: boolean;
    }>;
    IsLoadingCreateTablesObjects: boolean;
    CreateTablesSearch: string;
    CreateTablesSchema: string;
    IsCreatingTables: boolean;
    CreateTablesResult: {
        Success: boolean;
        Message: string;
    } | null;
    SyncingIntegrationID: string | null;
    SyncResult: {
        Success: boolean;
        Message: string;
    } | null;
    SyncMenuIntegrationID: string | null;
    DeleteConfirmID: string | null;
    IsDeleting: boolean;
    private dataService;
    private cdr;
    private documentClickHandler;
    ngOnInit(): Promise<void>;
    ngOnDestroy(): void;
    GetResourceDisplayName(_data: ResourceData): Promise<string>;
    GetResourceIconClass(_data: ResourceData): Promise<string>;
    LoadData(): Promise<void>;
    GetStatusBadge(summary: IntegrationSummary): StatusBadgeType;
    GetStatusBadgeClass(summary: IntegrationSummary): string;
    GetIntegrationIcon(name: string, icon?: string | null): string;
    GetIconBrandColor(name: string): string;
    GetEntityMapCount(integrationID: string): number;
    GetCredentialHint(summary: IntegrationSummary): string;
    GetSourceTypeLabel(summary: IntegrationSummary): string;
    IsConnectionActive(summary: IntegrationSummary): boolean;
    ToggleMenu(integrationID: string, event: Event): void;
    IsMenuOpen(integrationID: string): boolean;
    OnMenuAction(action: CardMenuAction, summary: IntegrationSummary): void;
    GetMenuActionLabel(summary: IntegrationSummary): string;
    OpenEditPanel(summary: IntegrationSummary): Promise<void>;
    CloseEditPanel(): void;
    SaveEditChanges(): Promise<void>;
    SelectEditCredential(credential: MJCredentialEntity): void;
    ClearEditCredential(): void;
    OpenEditCredentialDialog(): void;
    OnEditCredentialDialogClose(result: CredentialDialogResult): void;
    ShowDeleteConfirm(integrationID: string): void;
    CancelDelete(): void;
    ConfirmDelete(integrationID: string): Promise<void>;
    IsDeleteConfirming(integrationID: string): boolean;
    TestExistingConnection(integrationID: string): Promise<void>;
    IsTestingCard(integrationID: string): boolean;
    GetCardTestResult(integrationID: string): {
        Success: boolean;
        Message: string;
    } | null;
    IsSyncing(integrationID: string): boolean;
    RunSync(integrationID: string, fullSync?: boolean): Promise<void>;
    ToggleSyncMenu(integrationID: string, event: Event): void;
    RunSyncWithDirection(integrationID: string, fullSync: boolean, syncDirection: 'Pull' | 'Push' | 'Bidirectional', event: Event): Promise<void>;
    SelectIntegrationCard(summary: IntegrationSummary): Promise<void>;
    CloseDetailView(): void;
    OpenSchedulePanel(): void;
    CloseSchedulePanel(): void;
    OnScheduleSaved(): Promise<void>;
    OnScheduleDeleted(): Promise<void>;
    get ScheduleDefaultConfiguration(): string;
    get IntegrationSyncJobTypeID(): string | null;
    private integrationSyncJobTypeID;
    private loadScheduledJobForIntegration;
    OnDetailSearch(event: Event): void;
    DirectionLabel(direction: string): string;
    DirectionText(direction: string): string;
    DirectionBadgeClass(direction: string): string;
    private static readonly DIRECTION_CYCLE;
    CycleSyncDirection(em: EntityMapRow): Promise<void>;
    OnToggleMapEnabled(em: EntityMapRow, event: Event): Promise<void>;
    get DetailActiveMapCount(): number;
    private applyDetailFilter;
    OnEntityMapClick(em: EntityMapRow): void;
    CloseEntityMapEditor(): void;
    ToggleAddMapPanel(): Promise<void>;
    CloseAddMapPanel(): void;
    get CanSaveAddMap(): boolean;
    get AddMapEntityIDAsKey(): CompositeKey | null;
    OnEntityTreeSelection(node: TreeNode | TreeNode[] | null): void;
    OpenNewEntityDialog(): void;
    CloseNewEntityDialog(): void;
    DDLCopied: boolean;
    CopyDDLToClipboard(): Promise<void>;
    get CanGenerateSQL(): boolean;
    get NewEntityName(): string;
    PreviewDDL(): Promise<void>;
    SaveAddMap(): Promise<void>;
    private resetAddMapState;
    private loadAddMapData;
    private loadEntityMapsForIntegration;
    OpenWizard(): Promise<void>;
    CloseWizard(): void;
    OnKeydown(event: KeyboardEvent): void;
    NextStep(): void;
    PreviousStep(): void;
    get IsNextDisabled(): boolean;
    get NextButtonLabel(): string;
    IsStepCompleted(stepNumber: number): boolean;
    IsStepActive(stepNumber: number): boolean;
    SelectIntegration(def: MJIntegrationEntity): void;
    IsSelectedIntegration(def: MJIntegrationEntity): boolean;
    get FilteredIntegrations(): MJIntegrationEntity[];
    get NeedsCompanyPicker(): boolean;
    get IntegrationCredentialTypeID(): string | null;
    ShowExistingCredentials(): Promise<void>;
    SelectExistingCredential(credential: MJCredentialEntity): void;
    OpenCredentialDialog(): void;
    OnCredentialDialogClose(result: CredentialDialogResult): void;
    ClearCredential(): void;
    TestNewConnection(): Promise<void>;
    FinishWizard(): Promise<void>;
    ToggleAutoMapPanel(): void;
    CloseAutoMapPanel(): void;
    get CanAutoMap(): boolean;
    RunAutoMap(): Promise<void>;
    ToggleCreateTablesPanel(): Promise<void>;
    CloseCreateTablesPanel(): void;
    ToggleAllCreateTablesObjects(selected: boolean): void;
    get CreateTablesSelectedCount(): number;
    get CanCreateTables(): boolean;
    RunCreateTables(): Promise<void>;
    /**
     * Search-only filter for the picker. Standard/Custom/Registered state
     * shows up as badges — never hides anything — so Select All covers
     * everything the user can see.
     */
    get FilteredCreateTablesObjects(): Array<{
        ID?: string;
        Name: string;
        Label: string;
        Selected: boolean;
        AlreadyPersisted: boolean;
        IsCustom: boolean;
    }>;
    private loadCreateTablesObjects;
    private loadWizardData;
    private saveCompanyIntegration;
    private loadAllEntityMaps;
    private countMapsByIntegration;
    private resolveBrandColor;
    private toggleConnectionActive;
    private loadEditCredentials;
    private resetWizardState;
    private onDocumentClick;
    static ɵfac: i0.ɵɵFactoryDeclaration<ConnectionsComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<ConnectionsComponent, "app-integration-connections", never, {}, {}, never, never, false, never>;
}
export declare function LoadConnectionsComponent(): void;
export {};
//# sourceMappingURL=connections.component.d.ts.map