/**
 * @license
 * Copyright 2025 Vybestack LLC
 * SPDX-License-Identifier: Apache-2.0
 */
/**
 * Global holder for the OAuth UI callback (addItem).
 * This allows OAuth providers to be created before the UI renders,
 * but still display OAuth URLs once the UI is available.
 */
class GlobalOAuthUI {
    addItemCallback = undefined;
    /**
     * Set the addItem callback when UI is available
     */
    setAddItem(callback) {
        this.addItemCallback = callback;
    }
    /**
     * Clear the addItem callback when UI is disposed
     */
    clearAddItem() {
        this.addItemCallback = undefined;
    }
    /**
     * Get the current addItem callback, or undefined if UI not available
     */
    getAddItem() {
        return this.addItemCallback;
    }
    /**
     * Call addItem if available, otherwise no-op
     */
    callAddItem(itemData, baseTimestamp) {
        return this.addItemCallback?.(itemData, baseTimestamp);
    }
}
export const globalOAuthUI = new GlobalOAuthUI();
//# sourceMappingURL=global-oauth-ui.js.map