/**
 * @license
 * Copyright 2025 Vybestack LLC
 * SPDX-License-Identifier: Apache-2.0
 */
function hasSubmitAuthCode(provider) {
    return (!!provider &&
        'submitAuthCode' in provider &&
        typeof provider.submitAuthCode === 'function');
}
export function submitOAuthCode(deps, code) {
    const provider = deps.getActiveProvider();
    if (!provider) {
        return false;
    }
    const oauthManager = deps.getOAuthManager();
    if (!oauthManager) {
        return false;
    }
    const oauthProvider = oauthManager.getProvider(provider);
    if (hasSubmitAuthCode(oauthProvider)) {
        oauthProvider.submitAuthCode(code);
        return true;
    }
    return false;
}
//# sourceMappingURL=oauth-submission.js.map