function findTheme(themeId, themes) {
    if (!themeId)
        return undefined;
    return themes.find((theme) => theme.id === themeId);
}
export function resolveThemeTokensForAppearance(theme, appearance) {
    if (!theme)
        return undefined;
    return theme.variants?.[appearance] ?? theme.tokens;
}
export function resolveThemeTokensById(themeId, themes, appearance) {
    if (!themes || themes.length === 0)
        return undefined;
    const match = findTheme(themeId, themes);
    return resolveThemeTokensForAppearance(match, appearance);
}
//# sourceMappingURL=theme_variants.js.map