// retoor <retoor@molodetz.nl>

import "./components/index.js";
import { ModalManager } from "./ModalManager.js";
import { FormManager } from "./FormManager.js";
import { VoteManager } from "./VoteManager.js";
import { NotificationManager } from "./NotificationManager.js";
import { MessageSearch } from "./MessageSearch.js";
import { MessagesLayout } from "./MessagesLayout.js";
import { ProfileEditor } from "./ProfileEditor.js";
import { MobileNav } from "./MobileNav.js";
import { CommentManager } from "./CommentManager.js";
import { ContentEnhancer } from "./ContentEnhancer.js";
import { DomUtils } from "./DomUtils.js";
import { PushManager } from "./PushManager.js";
import { CounterManager } from "./CounterManager.js";
import { ReactionBar } from "./ReactionBar.js";
import { BookmarkManager } from "./BookmarkManager.js";
import { PollManager } from "./PollManager.js";
import { ApiKeyManager } from "./ApiKeyManager.js";
import { CustomizationToggle } from "./CustomizationToggle.js";
import { NotificationPrefs } from "./NotificationPrefs.js";
import { AiCorrection } from "./AiCorrection.js";
import { AiModifier } from "./AiModifier.js";
import { AdminNotificationDefaults } from "./AdminNotificationDefaults.js";
import { UserAiUsage } from "./UserAiUsage.js";
import { Tabs } from "./Tabs.js";
import { DeviiTerminal } from "./DeviiTerminal.js";
import { ZipDownloader } from "./ZipDownloader.js";
import { ProjectForker } from "./ProjectForker.js";
import { IssueReporter } from "./IssueReporter.js";
import { PlanningGenerator } from "./PlanningGenerator.js";
import { MediaGallery } from "./MediaGallery.js";
import WindowManager from "./components/WindowManager.js";
import { ContainerTerminalManager } from "./ContainerTerminalManager.js";
import { PubSubClient } from "./PubSubClient.js";
import { LiveNotifications } from "./LiveNotifications.js";
import { LocalTime } from "./LocalTime.js";

class Application {
    constructor() {
        this.dialog = document.createElement("dp-dialog");
        this.contextMenu = document.createElement("dp-context-menu");
        this.toast = document.createElement("dp-toast");
        this.lightbox = document.createElement("dp-lightbox");
        document.body.append(this.dialog, this.contextMenu, this.toast, this.lightbox);
        this.modals = new ModalManager();
        this.forms = new FormManager();
        this.votes = new VoteManager();
        this.notifications = new NotificationManager();
        this.messageSearch = new MessageSearch();
        this.messagesLayout = new MessagesLayout();
        this.profile = new ProfileEditor();
        this.mobileNav = new MobileNav();
        this.comments = new CommentManager();
        this.content = new ContentEnhancer();
        this.dom = new DomUtils();
        this.push = new PushManager();
        this.pubsub = new PubSubClient();
        this.counters = new CounterManager(this.pubsub);
        this.reactions = new ReactionBar();
        this.bookmarks = new BookmarkManager();
        this.polls = new PollManager();
        this.apiKey = new ApiKeyManager();
        this.customizationToggle = new CustomizationToggle();
        this.notificationPrefs = new NotificationPrefs();
        this.aiCorrection = new AiCorrection();
        this.aiModifier = new AiModifier();
        this.adminNotificationDefaults = new AdminNotificationDefaults();
        this.userAiUsage = new UserAiUsage();
        this.tabs = new Tabs();
        this.windows = new WindowManager();
        this.containerTerminals = new ContainerTerminalManager();
        this.devii = new DeviiTerminal();
        this.zipDownloader = new ZipDownloader();
        this.projectForker = new ProjectForker();
        this.issueReporter = new IssueReporter();
        this.planningGenerator = new PlanningGenerator();
        this.mediaGallery = new MediaGallery();
        this.liveNotifications = new LiveNotifications(this.pubsub, this.toast);
        this.localTime = new LocalTime();
    }
}

const app = new Application();
window.app = app;
app.containerTerminals.restore();
