System.register(["reactive-jsx", "src/external/babel/plugin-babel7.js"], function (_export, _context) {
  "use strict";

  var _addSourceLocation, parseToCheckSyntax;

  return {
    setters: [function (_reactiveJsx) {
      _addSourceLocation = _reactiveJsx.addSourceLocation;
    }, function (_srcExternalBabelPluginBabel7Js) {
      parseToCheckSyntax = _srcExternalBabelPluginBabel7Js.parseToCheckSyntax;
    }],
    execute: function () {
      const __SystemJSRewritingHack = {};
      _recorder_._src_client_syntax_js = _recorder_._src_client_syntax_js || {};
      Object.defineProperty(_recorder_._src_client_syntax_js, "parseToCheckSyntax", {
        get() {
          return parseToCheckSyntax;
        },

        set(thisIsVererySecretVariableName) {
          parseToCheckSyntax = thisIsVererySecretVariableName;
          return true;
        },

        enumerable: true,
        configurable: true
      });
      class SyntaxChecker {

        static async checkForSyntaxErrors(editor) {

          var src = editor.getValue();

          editor.clearGutter("leftgutter"

          // clear markers
          );editor.getAllMarks().filter(ea => ea.isSyntaxError).forEach(ea => ea.clear());

          try {
            var ast = parseToCheckSyntax(src
            // we are trying to get the error, if it parses everything is fine
            );return false;
          } catch (e) {
            if (!e.loc) {
              console.warn("checkForSyntaxErrors failed, loc missing ", e);
              return false;
            }
            var line = e.loc.line - 1;
            var errorMark = _addSourceLocation(document.createElement("div"), {
              file: 'https://lively-kernel.org/lively4/composed-offset/src/client/syntax.js',
              end: {
                column: 51,
                line: 28
              },
              start: {
                column: 22,
                line: 28
              }
            });
            errorMark.style.color = "red";
            errorMark.style.marginLeft = "5px";
            errorMark.innerHTML = "<b>!</b>";
            errorMark.classList.add("errorMark");
            errorMark.setAttribute("title", "" + e);
            editor.setGutterMarker(line, "leftgutter", errorMark);

            var marker = editor.markText({ line: line, ch: 0 }, // e.loc.column
            { line: line, ch: 100 }, {
              isSyntaxError: true,
              css: "background-color: rgba(255,0,0,0.3)",
              title: "" + e
            });

            return true;
          }
        }

      }

      _export("default", SyntaxChecker);

      Object.defineProperty(_recorder_._src_client_syntax_js, "SyntaxChecker", {
        get() {
          return SyntaxChecker;
        },

        set(thisIsVererySecretVariableName) {
          _export("default", SyntaxChecker = thisIsVererySecretVariableName);

          return true;
        },

        enumerable: true,
        configurable: true
      });
    }
  };
});