export { C as CodeExecuteStatus } from './codeExecuteStatus-e8a6c019.js';
export { l as FileFormatUtils } from './languageUtils-d43f5d69.js';
export { t as Toast } from './toastController-5becfc9e.js';
import { g as getMode } from './index-2305c23c.js';
import { g as getMode$1 } from './mode-e9fa2ced.js';
import './codeUtils-453d011a.js';
import './_commonjsHelpers-9943807e.js';

const loadFonts = async (fontFamilies) => {
  if (window === undefined || document === undefined)
    return;
  const WebFont = await import('./webfontloader-bdd8de6e.js').then(function (n) { return n.w; });
  let families = fontFamilies;
  if (!families) {
    const mode = getMode(document.documentElement);
    families =
      mode === 'material'
        ? ['Roboto', 'IBM Plex Mono']
        : ['Montserrat:400,600', 'Lato:400,400i,700,700i', 'IBM Plex Mono'];
  }
  WebFont.load({
    google: {
      families,
    },
  });
};

// These version numbers are automatically updated when releasing new versions.
// see `../../scripts/prepare.mjs`
const stencilaThemeVersion = '0.29.7';
const materialThemeVersion = '0.16.11';
// Inject theme CSS variables depending on the `mode` attribute
const injectThemeVariables = () => {
  const mode = getMode$1(document.documentElement);
  const themeName = mode === 'material' ? 'material' : 'stencila';
  const themeVersion = mode === 'material' ? materialThemeVersion : stencilaThemeVersion;
  const themeVariables = document.createElement('link');
  themeVariables.rel = 'stylesheet';
  themeVariables.href = `https://unpkg.com/@stencila/style-${themeName}@${themeVersion !== null && themeVersion !== void 0 ? themeVersion : 'latest'}/dist/variables.css`;
  document.head.prepend(themeVariables);
};

export { injectThemeVariables, loadFonts };

//# sourceMappingURL=index.js.map