System.register(["reactive-jsx"], function (_export, _context) {
  "use strict";

  var _addSourceLocation, __SystemJSRewritingHack;
  async function preloaWebComponents(tagNames) {
    // check already loaded components
    const namesToPreload = tagNames.difference(Object.keys(lively.components.templates));
    const loadingPromises = namesToPreload.map(tagName => {
      const tag = _addSourceLocation(document.createElement(tagName), {
        file: 'no_file_given',
        end: {
          column: 47,
          line: 6
        },
        start: {
          column: 16,
          line: 6
        }
      });
      tag.style.display = 'none';
      tag.setAttribute('for-preload', 'true');
      document.body.append(tag);
      function removeTag(arg) {
        tag.remove();
        return arg;
      }
      return lively.components.ensureLoadByName(tagName, undefined, tag).then(removeTag, removeTag);
    });
    return Promise.all(loadingPromises);
  }
  _export("default", preloaWebComponents);
  return {
    setters: [function (_reactiveJsx) {
      _addSourceLocation = _reactiveJsx.addSourceLocation;
    }],
    execute: function () {
      __SystemJSRewritingHack = {};
      _recorder_._https__lively_kernel_org_lively4_lively4_ansgar_src_client_preload_components_js = _recorder_._https__lively_kernel_org_lively4_lively4_ansgar_src_client_preload_components_js || {};
      Object.defineProperty(_recorder_._https__lively_kernel_org_lively4_lively4_ansgar_src_client_preload_components_js, "preloaWebComponents", {
        get() {
          return preloaWebComponents;
        },
        set(thisIsVererySecretVariableName) {
          _export("default", preloaWebComponents = thisIsVererySecretVariableName);
          return true;
        },
        enumerable: true,
        configurable: true
      });
    }
  };
});