/**
 * Singleton registry for messenger platform adapters.
 *
 * Stores one adapter per platform and exposes lookup, registration,
 * and status listing operations.
 */
export class MessengerRegistryService {
    static instance = null;
    adapters = new Map();
    /**
     * Get the singleton instance.
     *
     * @returns The MessengerRegistryService instance
     */
    static getInstance() {
        if (!MessengerRegistryService.instance) {
            MessengerRegistryService.instance = new MessengerRegistryService();
        }
        return MessengerRegistryService.instance;
    }
    /**
     * Reset the singleton instance (for testing).
     */
    static resetInstance() {
        MessengerRegistryService.instance = null;
    }
    /**
     * Register an adapter for its platform, replacing any existing one.
     *
     * @param adapter - The messenger adapter to register
     */
    register(adapter) {
        this.adapters.set(adapter.platform, adapter);
    }
    /**
     * Retrieve the adapter for the given platform.
     *
     * @param platform - The messenger platform identifier
     * @returns The adapter, or undefined if not registered
     */
    get(platform) {
        return this.adapters.get(platform);
    }
    /**
     * List the connection status of all registered adapters.
     *
     * @returns Array of adapter status objects
     */
    list() {
        return [...this.adapters.values()].map((a) => a.getStatus());
    }
}
//# sourceMappingURL=messenger-registry.service.js.map