{"version":3,"file":"resolveThemes.js","names":["resolvedThemes: ThemeRegistrationResolved[]","themesToResolve: Promise<ThemeRegistrationResolved | undefined>[]"],"sources":["../../../src/highlighter/themes/resolveThemes.ts"],"sourcesContent":["import type { DiffsThemeNames, ThemeRegistrationResolved } from '../../types';\nimport { getResolvedOrResolveTheme } from './getResolvedOrResolveTheme';\nimport { resolveTheme } from './resolveTheme';\n\nexport async function resolveThemes(\n  themes: DiffsThemeNames[]\n): Promise<ThemeRegistrationResolved[]> {\n  const resolvedThemes: ThemeRegistrationResolved[] = [];\n  const themesToResolve: Promise<ThemeRegistrationResolved | undefined>[] = [];\n  for (const themeName of themes) {\n    const themeData =\n      getResolvedOrResolveTheme(themeName) ?? resolveTheme(themeName);\n    if ('then' in themeData) {\n      themesToResolve.push(themeData);\n    } else {\n      resolvedThemes.push(themeData);\n    }\n  }\n\n  if (themesToResolve.length > 0) {\n    await Promise.all(themesToResolve).then((resolved) => {\n      for (const theme of resolved) {\n        if (theme != null) {\n          resolvedThemes.push(theme);\n        }\n      }\n    });\n  }\n\n  return resolvedThemes;\n}\n"],"mappings":";;;;AAIA,eAAsB,cACpB,QACsC;CACtC,MAAMA,iBAA8C,EAAE;CACtD,MAAMC,kBAAoE,EAAE;AAC5E,MAAK,MAAM,aAAa,QAAQ;EAC9B,MAAM,YACJ,0BAA0B,UAAU,IAAI,aAAa,UAAU;AACjE,MAAI,UAAU,UACZ,iBAAgB,KAAK,UAAU;MAE/B,gBAAe,KAAK,UAAU;;AAIlC,KAAI,gBAAgB,SAAS,EAC3B,OAAM,QAAQ,IAAI,gBAAgB,CAAC,MAAM,aAAa;AACpD,OAAK,MAAM,SAAS,SAClB,KAAI,SAAS,KACX,gBAAe,KAAK,MAAM;GAG9B;AAGJ,QAAO"}