"enable aexpr";

System.register(["active-expression-rewriting", "reactive-jsx", "src/components/widgets/lively-morph.js", "src/client/fileindex.js", "src/external/lodash/lodash.js", "src/client/strings.js", "src/client/bindings.js"], function (_export, _context) {
  "use strict";

  var _getAndCallMember, _setMember, _setLocal, _getLocal, _getGlobal, _getMember, _traceMember, _childSpread, _attributeEmpty, _childText, _childExpression, _attributeExpression, _childElement, _children, _attributeStringLiteral, _attributes, _element, Morph, FileIndex, _, Strings, Bindings, IndexSearch, __SystemJSRewritingHack, _scope;
  _export("default", void 0);
  return {
    setters: [function (_activeExpressionRewriting) {
      _getAndCallMember = _activeExpressionRewriting.getAndCallMember;
      _setMember = _activeExpressionRewriting.setMember;
      _setLocal = _activeExpressionRewriting.setLocal;
      _getLocal = _activeExpressionRewriting.getLocal;
      _getGlobal = _activeExpressionRewriting.getGlobal;
      _getMember = _activeExpressionRewriting.getMember;
      _traceMember = _activeExpressionRewriting.traceMember;
    }, function (_reactiveJsx) {
      _childSpread = _reactiveJsx.childSpread;
      _attributeEmpty = _reactiveJsx.attributeEmpty;
      _childText = _reactiveJsx.childText;
      _childExpression = _reactiveJsx.childExpression;
      _attributeExpression = _reactiveJsx.attributeExpression;
      _childElement = _reactiveJsx.childElement;
      _children = _reactiveJsx.children;
      _attributeStringLiteral = _reactiveJsx.attributeStringLiteral;
      _attributes = _reactiveJsx.attributes;
      _element = _reactiveJsx.element;
    }, function (_srcComponentsWidgetsLivelyMorphJs) {
      Morph = _srcComponentsWidgetsLivelyMorphJs.default;
    }, function (_srcClientFileindexJs) {
      FileIndex = _srcClientFileindexJs.default;
    }, function (_srcExternalLodashLodashJs) {
      _ = _srcExternalLodashLodashJs.default;
    }, function (_srcClientStringsJs) {
      Strings = _srcClientStringsJs.default;
    }, function (_srcClientBindingsJs) {
      Bindings = _srcClientBindingsJs.default;
    }],
    execute: function () {
      __SystemJSRewritingHack = {};
      _recorder_._src_components_tools_lively_index_search_js = _recorder_._src_components_tools_lively_index_search_js || {};
      _scope = {
        isScope: true
      };
      if (self.__expressionAnalysisMode__) _traceMember(Object, "defineProperty");
      Object.defineProperty(_getMember((self.__expressionAnalysisMode__ ? _getGlobal("_recorder_") : void 0, _recorder_), "_src_components_tools_lively_index_search_js"), "Morph", {
        get() {
          return self.__expressionAnalysisMode__ ? _getLocal(_scope, "Morph", Morph) : void 0, Morph;
        },
        set(thisIsVererySecretVariableName) {
          let _scope2 = {
            isScope: true
          };
          Morph = (thisIsVererySecretVariableName === Object(thisIsVererySecretVariableName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope2, "thisIsVererySecretVariableName", thisIsVererySecretVariableName) : void 0 : thisIsVererySecretVariableName, thisIsVererySecretVariableName), true ? _setLocal(_scope, "Morph", Morph, {
            file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
            end: {
              column: 12,
              line: 3
            },
            start: {
              column: 7,
              line: 3
            },
            source: ''
          }) : void 0, Morph;
          return true;
        },
        enumerable: true,
        configurable: true
      });
      if (self.__expressionAnalysisMode__) _traceMember(Object, "defineProperty");
      Object.defineProperty(_getMember((self.__expressionAnalysisMode__ ? _getGlobal("_recorder_") : void 0, _recorder_), "_src_components_tools_lively_index_search_js"), "FileIndex", {
        get() {
          return self.__expressionAnalysisMode__ ? _getLocal(_scope, "FileIndex", FileIndex) : void 0, FileIndex;
        },
        set(thisIsVererySecretVariableName) {
          let _scope3 = {
            isScope: true
          };
          FileIndex = (thisIsVererySecretVariableName === Object(thisIsVererySecretVariableName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope3, "thisIsVererySecretVariableName", thisIsVererySecretVariableName) : void 0 : thisIsVererySecretVariableName, thisIsVererySecretVariableName), true ? _setLocal(_scope, "FileIndex", FileIndex, {
            file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
            end: {
              column: 16,
              line: 4
            },
            start: {
              column: 7,
              line: 4
            },
            source: ''
          }) : void 0, FileIndex;
          return true;
        },
        enumerable: true,
        configurable: true
      });
      if (self.__expressionAnalysisMode__) _traceMember(Object, "defineProperty");
      Object.defineProperty(_getMember((self.__expressionAnalysisMode__ ? _getGlobal("_recorder_") : void 0, _recorder_), "_src_components_tools_lively_index_search_js"), "_", {
        get() {
          return self.__expressionAnalysisMode__ ? _getLocal(_scope, "_", _) : void 0, _;
        },
        set(thisIsVererySecretVariableName) {
          let _scope4 = {
            isScope: true
          };
          _ = (thisIsVererySecretVariableName === Object(thisIsVererySecretVariableName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope4, "thisIsVererySecretVariableName", thisIsVererySecretVariableName) : void 0 : thisIsVererySecretVariableName, thisIsVererySecretVariableName), true ? _setLocal(_scope, "_", _, {
            file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
            end: {
              column: 8,
              line: 5
            },
            start: {
              column: 7,
              line: 5
            },
            source: ''
          }) : void 0, _;
          return true;
        },
        enumerable: true,
        configurable: true
      });
      if (self.__expressionAnalysisMode__) _traceMember(Object, "defineProperty");
      Object.defineProperty(_getMember((self.__expressionAnalysisMode__ ? _getGlobal("_recorder_") : void 0, _recorder_), "_src_components_tools_lively_index_search_js"), "Strings", {
        get() {
          return self.__expressionAnalysisMode__ ? _getLocal(_scope, "Strings", Strings) : void 0, Strings;
        },
        set(thisIsVererySecretVariableName) {
          let _scope5 = {
            isScope: true
          };
          Strings = (thisIsVererySecretVariableName === Object(thisIsVererySecretVariableName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope5, "thisIsVererySecretVariableName", thisIsVererySecretVariableName) : void 0 : thisIsVererySecretVariableName, thisIsVererySecretVariableName), true ? _setLocal(_scope, "Strings", Strings, {
            file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
            end: {
              column: 14,
              line: 6
            },
            start: {
              column: 7,
              line: 6
            },
            source: ''
          }) : void 0, Strings;
          return true;
        },
        enumerable: true,
        configurable: true
      });
      /*MD # Search (and Replace) Tool MD*/
      if (self.__expressionAnalysisMode__) _traceMember(Object, "defineProperty");
      Object.defineProperty(_getMember((self.__expressionAnalysisMode__ ? _getGlobal("_recorder_") : void 0, _recorder_), "_src_components_tools_lively_index_search_js"), "Bindings", {
        get() {
          return self.__expressionAnalysisMode__ ? _getLocal(_scope, "Bindings", Bindings) : void 0, Bindings;
        },
        set(thisIsVererySecretVariableName) {
          let _scope6 = {
            isScope: true
          };
          Bindings = (thisIsVererySecretVariableName === Object(thisIsVererySecretVariableName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope6, "thisIsVererySecretVariableName", thisIsVererySecretVariableName) : void 0 : thisIsVererySecretVariableName, thisIsVererySecretVariableName), true ? _setLocal(_scope, "Bindings", Bindings, {
            file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
            end: {
              column: 15,
              line: 7
            },
            start: {
              column: 7,
              line: 7
            },
            source: ''
          }) : void 0, Bindings;
          return true;
        },
        enumerable: true,
        configurable: true
      });
      _export("default", IndexSearch = class IndexSearch extends Morph {
        async initialize() {
          if (self.__expressionAnalysisMode__) _traceMember(this, "registerAttributes");
          this.registerAttributes(["pattern", "mode", "scope", "replace"]);
          _setMember(this, "windowTitle", "Search", {
            file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
            end: {
              column: 31,
              line: 14
            },
            start: {
              column: 4,
              line: 14
            },
            source: ''
          });
          if (self.__expressionAnalysisMode__) _traceMember(this, "registerButtons");
          this.registerButtons();
          _getAndCallMember((self.__expressionAnalysisMode__ ? _traceMember(this, "get") : void 0, this.get("lively-separator")), "toggleCollapse", []);
          // this.get("lively-editor").hideToolbar();

          _getAndCallMember(_getMember((self.__expressionAnalysisMode__ ? _getGlobal("lively") : void 0, lively), "html"), "registerInputs", [this]);
          if (self.__expressionAnalysisMode__) _traceMember(Bindings, "connect");
          (self.__expressionAnalysisMode__ ? _getLocal(_scope, "Bindings", Bindings) : void 0, Bindings).connect(this, "scope", (self.__expressionAnalysisMode__ ? _traceMember(this, "get") : void 0, this.get("#scopeInput")), "value");
          if (self.__expressionAnalysisMode__) _traceMember(Bindings, "connect");
          (self.__expressionAnalysisMode__ ? _getLocal(_scope, "Bindings", Bindings) : void 0, Bindings).connect(this, "pattern", (self.__expressionAnalysisMode__ ? _traceMember(this, "get") : void 0, this.get("#searchInput")), "value");
          if (self.__expressionAnalysisMode__) _traceMember(Bindings, "connect");
          (self.__expressionAnalysisMode__ ? _getLocal(_scope, "Bindings", Bindings) : void 0, Bindings).connect(this, "replace", (self.__expressionAnalysisMode__ ? _traceMember(this, "get") : void 0, this.get("#replaceInput")), "value");
          if (self.__expressionAnalysisMode__) _traceMember(this, "registerSignalEnter");
          this.registerSignalEnter(_getMember(this, "shadowRoot"));
          _getAndCallMember((self.__expressionAnalysisMode__ ? _traceMember(this, "get") : void 0, this.get("#replaceInput")), "addEventListener", ["enter-pressed", () => {
            return self.__expressionAnalysisMode__ ? _traceMember(this, "updateReplacePreview") : void 0, this.updateReplacePreview();
          }]);
          _getAndCallMember((self.__expressionAnalysisMode__ ? _traceMember(this, "get") : void 0, this.get("#searchInput")), "addEventListener", ["enter-pressed", () => {
            return self.__expressionAnalysisMode__ ? _traceMember(this, "onSearchButton") : void 0, this.onSearchButton();
          }]);
          _getAndCallMember((self.__expressionAnalysisMode__ ? _traceMember(this, "get") : void 0, this.get("#scopeInput")), "addEventListener", ["enter-pressed", () => {
            return self.__expressionAnalysisMode__ ? _traceMember(this, "onSearchButton") : void 0, this.onSearchButton();
          }]);

          // kick off search...
          if (_getMember(this, "pattern")) {
            await (self.__expressionAnalysisMode__ ? _traceMember(this, "search") : void 0, this.search());
          }
          _setMember(this, "__classFilePath__", "https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js", (self.__expressionAnalysisMode__ ? _getGlobal("undefined") : void 0, undefined));
        }

        /*MD ## HTML Element MD*/

        focus() {
          _getAndCallMember((self.__expressionAnalysisMode__ ? _traceMember(this, "get") : void 0, this.get("#searchInput")), "focus", []);
        }
        /*MD ## Events MD*/

        onScopeModeButton() {
          if (_getMember(this, "scope")) {
            if (self.__expressionAnalysisMode__) _traceMember(this, "removeAttribute");
            this.removeAttribute("scope");
          } else {
            _setMember(this, "scope", (self.__expressionAnalysisMode__ ? _getGlobal("lively4url") : void 0, lively4url), {
              file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
              end: {
                column: 29,
                line: 47
              },
              start: {
                column: 6,
                line: 47
              },
              source: ''
            });
          }
        }
        onSearchButton() {
          if (self.__expressionAnalysisMode__) _traceMember(this, "search");
          this.search();
        }
        onReplaceModeButton() {
          if (_getMember(this, "mode") == "replace") {
            _setMember(this, "mode", (self.__expressionAnalysisMode__ ? _getGlobal("undefined") : void 0, undefined), {
              file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
              end: {
                column: 27,
                line: 57
              },
              start: {
                column: 6,
                line: 57
              },
              source: ''
            });
          } else {
            _setMember(this, "mode", "replace", {
              file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
              end: {
                column: 27,
                line: 59
              },
              start: {
                column: 6,
                line: 59
              },
              source: ''
            });
          }
          if (self.__expressionAnalysisMode__) _traceMember(this, "search");
          this.search();
        }
        onReplaceInputEnter() {
          if (self.__expressionAnalysisMode__) _traceMember(this, "updateReplacePreview");
          this.updateReplacePreview();
        }
        async onReplaceButton() {
          if (self.__expressionAnalysisMode__) _traceMember(this, "replaceInFiles");
          this.replaceInFiles();
        }
        /*MD ## Search MD*/

        async search(text) {
          let _scope7 = {
            isScope: true
          };
          if (self.__expressionAnalysisMode__) _traceMember(this, "clearLog");
          this.clearLog();
          if (text === Object(text) ? self.__expressionAnalysisMode__ ? _getLocal(_scope7, "text", text) : void 0 : text, text) {
            _setMember(this, "pattern", (text === Object(text) ? self.__expressionAnalysisMode__ ? _getLocal(_scope7, "text", text) : void 0 : text, text), {
              file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
              end: {
                column: 25,
                line: 77
              },
              start: {
                column: 6,
                line: 77
              },
              source: ''
            });
          }
          if (!_getMember(this, "pattern") || _getMember(_getMember(this, "pattern"), "length") < 2) {
            if (self.__expressionAnalysisMode__) _traceMember(this, "log");
            this.log("please enter a longer search string");
            _setMember(this, "searchInProgres", false, {
              file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
              end: {
                column: 34,
                line: 82
              },
              start: {
                column: 6,
                line: 82
              },
              source: ''
            });
            return;
          }
          if (self.__expressionAnalysisMode__) _traceMember(this, "clearLog");
          this.clearLog();

          // check regular expression syntax
          try {
            new (self.__expressionAnalysisMode__ ? _getGlobal("RegExp") : void 0, RegExp)(_getMember(this, "pattern"));
          } catch (e) {
            let _scope8 = {
              isScope: true
            };
            if (self.__expressionAnalysisMode__) _traceMember(this, "log");
            this.log("" + (e === Object(e) ? self.__expressionAnalysisMode__ ? _getLocal(_scope8, "e", e) : void 0 : e, e));
            return;
          }
          _setMember((self.__expressionAnalysisMode__ ? _traceMember(this, "get") : void 0, this.get("#searchResults")), "innerHTML", "searching ..." + (self.__expressionAnalysisMode__ ? _traceMember(JSON, "stringify") : void 0, (self.__expressionAnalysisMode__ ? _getGlobal("JSON") : void 0, JSON).stringify(_getMember(this, "pattern"))), {
            file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
            end: {
              column: 89,
              line: 95
            },
            start: {
              column: 4,
              line: 95
            },
            source: ''
          });
          let start = (self.__expressionAnalysisMode__ ? _traceMember(Date, "now") : void 0, (self.__expressionAnalysisMode__ ? _getGlobal("Date") : void 0, Date).now());
          await (self.__expressionAnalysisMode__ ? _traceMember(this, "searchFilesList") : void 0, this.searchFilesList());
          _setMember(this, "searchInProgres", false, {
            file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
            end: {
              column: 32,
              line: 98
            },
            start: {
              column: 4,
              line: 98
            },
            source: ''
          });
          if (self.__expressionAnalysisMode__) _traceMember(this, "clearLog");
          this.clearLog();
          //this.log('found');
          if (self.__expressionAnalysisMode__) _traceMember(this, "log");
          this.log(`finished in ${(self.__expressionAnalysisMode__ ? _traceMember(Date, "now") : void 0, (self.__expressionAnalysisMode__ ? _getGlobal("Date") : void 0, Date).now()) - (start === Object(start) ? self.__expressionAnalysisMode__ ? _getLocal(_scope7, "start", start) : void 0 : start, start)}ms`);
          await (self.__expressionAnalysisMode__ ? _traceMember(this, "updateSearchResults") : void 0, this.updateSearchResults());
        }

        /*
         * find all root directories/repositories that should be search by looking, what browsers/editors the user has opened
         */
        findRootsInBrowsers() {
          let _scope9 = {
            isScope: true
          };
          var browsers = _getAndCallMember(_getMember((self.__expressionAnalysisMode__ ? _getGlobal("document") : void 0, document), "body"), "querySelectorAll", ["lively-container"]);
          var urls = _getAndCallMember((self.__expressionAnalysisMode__ ? _traceMember(browsers, "filter") : void 0, (browsers === Object(browsers) ? self.__expressionAnalysisMode__ ? _getLocal(_scope9, "browsers", browsers) : void 0 : browsers, browsers).filter(ea => {
            let _scope10 = {
              isScope: true
            };
            return _getMember((ea === Object(ea) ? self.__expressionAnalysisMode__ ? _getLocal(_scope10, "ea", ea) : void 0 : ea, ea), "getPath");
          })), "map", [ea => {
            let _scope11 = {
              isScope: true
            };
            return self.__expressionAnalysisMode__ ? _traceMember(ea, "getPath") : void 0, (ea === Object(ea) ? self.__expressionAnalysisMode__ ? _getLocal(_scope11, "ea", ea) : void 0 : ea, ea).getPath();
          }]);
          var serverURL = (self.__expressionAnalysisMode__ ? _traceMember(this, "serverURL") : void 0, this.serverURL());
          var rootURLs = _getAndCallMember((self.__expressionAnalysisMode__ ? _traceMember(urls, "filter") : void 0, (urls === Object(urls) ? self.__expressionAnalysisMode__ ? _getLocal(_scope9, "urls", urls) : void 0 : urls, urls).filter(ea => {
            let _scope12 = {
              isScope: true
            };
            return self.__expressionAnalysisMode__ ? _traceMember(ea, "match") : void 0, (ea === Object(ea) ? self.__expressionAnalysisMode__ ? _getLocal(_scope12, "ea", ea) : void 0 : ea, ea).match((serverURL === Object(serverURL) ? self.__expressionAnalysisMode__ ? _getLocal(_scope9, "serverURL", serverURL) : void 0 : serverURL, serverURL));
          })), "map", [ea => {
            let _scope13 = {
              isScope: true
            };
            var m = (self.__expressionAnalysisMode__ ? _traceMember(ea, "match") : void 0, (ea === Object(ea) ? self.__expressionAnalysisMode__ ? _getLocal(_scope13, "ea", ea) : void 0 : ea, ea).match(new (self.__expressionAnalysisMode__ ? _getGlobal("RegExp") : void 0, RegExp)("(" + (serverURL === Object(serverURL) ? self.__expressionAnalysisMode__ ? _getLocal(_scope9, "serverURL", serverURL) : void 0 : serverURL, serverURL) + "[^/]*/).*")));
            return (m === Object(m) ? self.__expressionAnalysisMode__ ? _getLocal(_scope13, "m", m) : void 0 : m, m) && _getMember((m === Object(m) ? self.__expressionAnalysisMode__ ? _getLocal(_scope13, "m", m) : void 0 : m, m), 1);
          }]);
          return self.__expressionAnalysisMode__ ? _traceMember(_, "uniq") : void 0, (self.__expressionAnalysisMode__ ? _getLocal(_scope, "_", _) : void 0, _).uniq((rootURLs === Object(rootURLs) ? self.__expressionAnalysisMode__ ? _getLocal(_scope9, "rootURLs", rootURLs) : void 0 : rootURLs, rootURLs));
        }
        async searchFilesList(pattern = this.pattern) {
          let _scope14 = {
            isScope: true
          };
          _setMember(this, "searchInProgres", true, {
            file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
            end: {
              column: 31,
              line: 123
            },
            start: {
              column: 4,
              line: 123
            },
            source: ''
          });
          var search = new (self.__expressionAnalysisMode__ ? _getGlobal("RegExp") : void 0, RegExp)((pattern === Object(pattern) ? self.__expressionAnalysisMode__ ? _getLocal(_scope14, "pattern", pattern) : void 0 : pattern, pattern));
          var result = [];
          var scope = _getMember(this, "scope");
          var searchTime = await (self.__expressionAnalysisMode__ ? _traceMember(lively, "time") : void 0, (self.__expressionAnalysisMode__ ? _getGlobal("lively") : void 0, lively).time(async () => {
            let _scope15 = {
              isScope: true
            };
            var root = (self.__expressionAnalysisMode__ ? _getGlobal("lively4url") : void 0, lively4url); // there are other files in our cache... too 
            var roots = _getAndCallMember(_getAndCallMember([(root === Object(root) ? self.__expressionAnalysisMode__ ? _getLocal(_scope15, "root", root) : void 0 : root, root)], "concat", [_getAndCallMember(_getMember((self.__expressionAnalysisMode__ ? _getGlobal("lively") : void 0, lively), "preferences"), "get", ["ExtraSearchRoots"])]), "concat", [(self.__expressionAnalysisMode__ ? _traceMember(this, "findRootsInBrowsers") : void 0, this.findRootsInBrowsers())]);
            return _getAndCallMember(_getMember(_getMember((self.__expressionAnalysisMode__ ? _traceMember(FileIndex, "current") : void 0, (self.__expressionAnalysisMode__ ? _getLocal(_scope, "FileIndex", FileIndex) : void 0, FileIndex).current()), "db"), "files"), "each", [file => {
              let _scope16 = {
                isScope: true
              };
              if ((self.__expressionAnalysisMode__ ? _traceMember(roots, "find") : void 0, (roots === Object(roots) ? self.__expressionAnalysisMode__ ? _getLocal(_scope15, "roots", roots) : void 0 : roots, roots).find(eaRoot => {
                let _scope17 = {
                  isScope: true
                };
                return _getAndCallMember(_getMember((file === Object(file) ? self.__expressionAnalysisMode__ ? _getLocal(_scope16, "file", file) : void 0 : file, file), "url"), "startsWith", [(eaRoot === Object(eaRoot) ? self.__expressionAnalysisMode__ ? _getLocal(_scope17, "eaRoot", eaRoot) : void 0 : eaRoot, eaRoot)]);
              })) && _getMember((file === Object(file) ? self.__expressionAnalysisMode__ ? _getLocal(_scope16, "file", file) : void 0 : file, file), "content") && (!(scope === Object(scope) ? self.__expressionAnalysisMode__ ? _getLocal(_scope14, "scope", scope) : void 0 : scope, scope) || _getAndCallMember(_getMember((file === Object(file) ? self.__expressionAnalysisMode__ ? _getLocal(_scope16, "file", file) : void 0 : file, file), "url"), "match", [(scope === Object(scope) ? self.__expressionAnalysisMode__ ? _getLocal(_scope14, "scope", scope) : void 0 : scope, scope)]))) {
                var m = _getAndCallMember(_getMember((file === Object(file) ? self.__expressionAnalysisMode__ ? _getLocal(_scope16, "file", file) : void 0 : file, file), "content"), "match", [(search === Object(search) ? self.__expressionAnalysisMode__ ? _getLocal(_scope14, "search", search) : void 0 : search, search)]);
                if (m === Object(m) ? self.__expressionAnalysisMode__ ? _getLocal(_scope16, "m", m) : void 0 : m, m) {
                  if (self.__expressionAnalysisMode__) _traceMember(result, "push");
                  (result === Object(result) ? self.__expressionAnalysisMode__ ? _getLocal(_scope14, "result", result) : void 0 : result, result).push({
                    file: file,
                    match: m
                  });
                }
              }
            }]);
          }));
          var list = [];
          if (self.__expressionAnalysisMode__) _traceMember(result, "forEach");
          (result === Object(result) ? self.__expressionAnalysisMode__ ? _getLocal(_scope14, "result", result) : void 0 : result, result).forEach(ea => {
            let _scope18 = {
              isScope: true
            };
            if (self.__expressionAnalysisMode__) _traceMember(console, "log");
            (self.__expressionAnalysisMode__ ? _getGlobal("console") : void 0, console).log("found " + _getMember(_getMember((ea === Object(ea) ? self.__expressionAnalysisMode__ ? _getLocal(_scope18, "ea", ea) : void 0 : ea, ea), "file"), "url"));
            var lines = _getAndCallMember(_getMember(_getMember((ea === Object(ea) ? self.__expressionAnalysisMode__ ? _getLocal(_scope18, "ea", ea) : void 0 : ea, ea), "file"), "content"), "split", ["\n"]);
            if (self.__expressionAnalysisMode__) _traceMember(lines, "forEach");
            (lines === Object(lines) ? self.__expressionAnalysisMode__ ? _getLocal(_scope18, "lines", lines) : void 0 : lines, lines).forEach((eaLine, index) => {
              let _scope19 = {
                isScope: true
              };
              var m = (self.__expressionAnalysisMode__ ? _traceMember(eaLine, "match") : void 0, (eaLine === Object(eaLine) ? self.__expressionAnalysisMode__ ? _getLocal(_scope19, "eaLine", eaLine) : void 0 : eaLine, eaLine).match((pattern === Object(pattern) ? self.__expressionAnalysisMode__ ? _getLocal(_scope14, "pattern", pattern) : void 0 : pattern, pattern)));
              if (m === Object(m) ? self.__expressionAnalysisMode__ ? _getLocal(_scope19, "m", m) : void 0 : m, m) {
                var lineNumber = (index === Object(index) ? self.__expressionAnalysisMode__ ? _getLocal(_scope19, "index", index) : void 0 : index, index);
                // var lineNumber = index + 1 // first line is "1"
                if (self.__expressionAnalysisMode__) _traceMember(list, "push");
                (list === Object(list) ? self.__expressionAnalysisMode__ ? _getLocal(_scope14, "list", list) : void 0 : list, list).push({
                  file: _getAndCallMember(_getAndCallMember(_getMember(_getMember((ea === Object(ea) ? self.__expressionAnalysisMode__ ? _getLocal(_scope18, "ea", ea) : void 0 : ea, ea), "file"), "url"), "toString", []), "replace", [/[.*\/]/, ""]),
                  url: _getAndCallMember(_getMember(_getMember((ea === Object(ea) ? self.__expressionAnalysisMode__ ? _getLocal(_scope18, "ea", ea) : void 0 : ea, ea), "file"), "url"), "toString", []),
                  line: lineNumber,
                  column: _getMember((m === Object(m) ? self.__expressionAnalysisMode__ ? _getLocal(_scope19, "m", m) : void 0 : m, m), "index"),
                  text: eaLine,
                  indexed: _getMember((ea === Object(ea) ? self.__expressionAnalysisMode__ ? _getLocal(_scope18, "ea", ea) : void 0 : ea, ea), "file"),
                  selection: _getMember((m === Object(m) ? self.__expressionAnalysisMode__ ? _getLocal(_scope19, "m", m) : void 0 : m, m), 0)
                });
              }
            });
          });
          _setMember(this, "files", (list === Object(list) ? self.__expressionAnalysisMode__ ? _getLocal(_scope14, "list", list) : void 0 : list, list), {
            file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
            end: {
              column: 21,
              line: 162
            },
            start: {
              column: 4,
              line: 162
            },
            source: ''
          });
          _setMember(this, "searchInProgres", false, {
            file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
            end: {
              column: 32,
              line: 163
            },
            start: {
              column: 4,
              line: 163
            },
            source: ''
          });
          return list === Object(list) ? self.__expressionAnalysisMode__ ? _getLocal(_scope14, "list", list) : void 0 : list, list;
        }
        async showSearchResult(url, lineAndColumn) {
          let _scope20 = {
            isScope: true
          };
          var editor = (self.__expressionAnalysisMode__ ? _traceMember(this, "get") : void 0, this.get("#editor"));

          // unhide editor, when it is needed
          if (_getMember(_getMember((editor === Object(editor) ? self.__expressionAnalysisMode__ ? _getLocal(_scope20, "editor", editor) : void 0 : editor, editor), "style"), "flexGrow") < 0.01) {
            // #Hack
            _getAndCallMember((self.__expressionAnalysisMode__ ? _traceMember(this, "get") : void 0, this.get("lively-separator")), "toggleCollapse", []);
          }
          if (self.__expressionAnalysisMode__) _traceMember(editor, "setURL");
          (editor === Object(editor) ? self.__expressionAnalysisMode__ ? _getLocal(_scope20, "editor", editor) : void 0 : editor, editor).setURL((url === Object(url) ? self.__expressionAnalysisMode__ ? _getLocal(_scope20, "url", url) : void 0 : url, url));
          await (self.__expressionAnalysisMode__ ? _traceMember(editor, "loadFile") : void 0, (editor === Object(editor) ? self.__expressionAnalysisMode__ ? _getLocal(_scope20, "editor", editor) : void 0 : editor, editor).loadFile());
          var codeMirror = await (self.__expressionAnalysisMode__ ? _traceMember(editor, "awaitEditor") : void 0, (editor === Object(editor) ? self.__expressionAnalysisMode__ ? _getLocal(_scope20, "editor", editor) : void 0 : editor, editor).awaitEditor());
          if (self.__expressionAnalysisMode__) _traceMember(codeMirror, "setSelection");
          (codeMirror === Object(codeMirror) ? self.__expressionAnalysisMode__ ? _getLocal(_scope20, "codeMirror", codeMirror) : void 0 : codeMirror, codeMirror).setSelection({
            line: _getMember((lineAndColumn === Object(lineAndColumn) ? self.__expressionAnalysisMode__ ? _getLocal(_scope20, "lineAndColumn", lineAndColumn) : void 0 : lineAndColumn, lineAndColumn), "line"),
            ch: _getMember((lineAndColumn === Object(lineAndColumn) ? self.__expressionAnalysisMode__ ? _getLocal(_scope20, "lineAndColumn", lineAndColumn) : void 0 : lineAndColumn, lineAndColumn), "column")
          }, {
            line: _getMember((lineAndColumn === Object(lineAndColumn) ? self.__expressionAnalysisMode__ ? _getLocal(_scope20, "lineAndColumn", lineAndColumn) : void 0 : lineAndColumn, lineAndColumn), "line"),
            ch: _getMember((lineAndColumn === Object(lineAndColumn) ? self.__expressionAnalysisMode__ ? _getLocal(_scope20, "lineAndColumn", lineAndColumn) : void 0 : lineAndColumn, lineAndColumn), "column") + (_getMember((lineAndColumn === Object(lineAndColumn) ? self.__expressionAnalysisMode__ ? _getLocal(_scope20, "lineAndColumn", lineAndColumn) : void 0 : lineAndColumn, lineAndColumn), "selection") ? +_getMember(_getMember((lineAndColumn === Object(lineAndColumn) ? self.__expressionAnalysisMode__ ? _getLocal(_scope20, "lineAndColumn", lineAndColumn) : void 0 : lineAndColumn, lineAndColumn), "selection"), "length") : 0)
          });
          if (self.__expressionAnalysisMode__) _traceMember(codeMirror, "focus");
          (codeMirror === Object(codeMirror) ? self.__expressionAnalysisMode__ ? _getLocal(_scope20, "codeMirror", codeMirror) : void 0 : codeMirror, codeMirror).focus();
          if (self.__expressionAnalysisMode__) _traceMember(codeMirror, "scrollIntoView");
          (codeMirror === Object(codeMirror) ? self.__expressionAnalysisMode__ ? _getLocal(_scope20, "codeMirror", codeMirror) : void 0 : codeMirror, codeMirror).scrollIntoView((self.__expressionAnalysisMode__ ? _traceMember(codeMirror, "getCursor") : void 0, (codeMirror === Object(codeMirror) ? self.__expressionAnalysisMode__ ? _getLocal(_scope20, "codeMirror", codeMirror) : void 0 : codeMirror, codeMirror).getCursor()), 200);
        }
        browseSearchResult(url, pattern) {
          let _scope21 = {
            isScope: true
          };
          return self.__expressionAnalysisMode__ ? _traceMember(lively, "openBrowser") : void 0, (self.__expressionAnalysisMode__ ? _getGlobal("lively") : void 0, lively).openBrowser((url === Object(url) ? self.__expressionAnalysisMode__ ? _getLocal(_scope21, "url", url) : void 0 : url, url), true, (pattern === Object(pattern) ? self.__expressionAnalysisMode__ ? _getLocal(_scope21, "pattern", pattern) : void 0 : pattern, pattern), (self.__expressionAnalysisMode__ ? _getGlobal("undefined") : void 0, undefined /* lively.findWorldContext(this)*/));
        }

        // #important
        async updateSearchResults(search = this.pattern) {
          let _scope23 = {
            isScope: true
          };
          var list = (self.__expressionAnalysisMode__ ? _traceMember(_, "sortBy") : void 0, (self.__expressionAnalysisMode__ ? _getLocal(_scope, "_", _) : void 0, _).sortBy(_getMember(this, "files"), ea => {
            let _scope22 = {
              isScope: true
            };
            return _getMember((ea === Object(ea) ? self.__expressionAnalysisMode__ ? _getLocal(_scope22, "ea", ea) : void 0 : ea, ea), "url");
          }));
          let lastPrefix;
          for (var ea of (list === Object(list) ? self.__expressionAnalysisMode__ ? _getLocal(_scope23, "list", list) : void 0 : list, list)) {
            let _scope24 = {
              isScope: true
            };
            let text = _getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope23, "ea", ea) : void 0, ea), "text");
            let url = _getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope23, "ea", ea) : void 0, ea), "url");
            let filename = _getAndCallMember(_getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope23, "ea", ea) : void 0, ea), "file"), "replace", [/.*\//, ""]);
            let dirAndFilename = _getAndCallMember(_getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope23, "ea", ea) : void 0, ea), "url"), "replace", [/.*\/([^/]+\/[^/]+$)/, "$1"]);
            let prefix = (self.__expressionAnalysisMode__ ? _traceMember(url, "replace") : void 0, (url === Object(url) ? self.__expressionAnalysisMode__ ? _getLocal(_scope24, "url", url) : void 0 : url, url).replace((dirAndFilename === Object(dirAndFilename) ? self.__expressionAnalysisMode__ ? _getLocal(_scope24, "dirAndFilename", dirAndFilename) : void 0 : dirAndFilename, dirAndFilename), ""));
            if ((self.__expressionAnalysisMode__ ? _getLocal(_scope23, "lastPrefix", lastPrefix) : void 0, lastPrefix) != (prefix === Object(prefix) ? self.__expressionAnalysisMode__ ? _getLocal(_scope24, "prefix", prefix) : void 0 : prefix, prefix)) {
              _getAndCallMember((self.__expressionAnalysisMode__ ? _traceMember(this, "get") : void 0, this.get("#searchResults")), "appendChild", [_element("tr", _attributes(_attributeStringLiteral("class", "prefix")), _children(_childElement(_element("td", _attributes(_attributeStringLiteral("colspan", "3"), _attributeExpression("click", () => {
                _setMember(this, "scope", (prefix === Object(prefix) ? self.__expressionAnalysisMode__ ? _getLocal(_scope24, "prefix", prefix) : void 0 : prefix, prefix), {
                  file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
                  end: {
                    column: 36,
                    line: 203
                  },
                  start: {
                    column: 17,
                    line: 203
                  },
                  source: ''
                });
                if (self.__expressionAnalysisMode__) _traceMember(this, "search");
                this.search();
              })), _children(_childExpression((prefix === Object(prefix) ? self.__expressionAnalysisMode__ ? _getLocal(_scope24, "prefix", prefix) : void 0 : prefix, prefix))), {
                file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
                end: {
                  column: 31,
                  line: 205
                },
                start: {
                  column: 67,
                  line: 202
                }
              }))), {
                file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
                end: {
                  column: 36,
                  line: 205
                },
                start: {
                  column: 48,
                  line: 202
                }
              })]);
            }
            lastPrefix = (prefix === Object(prefix) ? self.__expressionAnalysisMode__ ? _getLocal(_scope24, "prefix", prefix) : void 0 : prefix, prefix), true ? _setLocal(_scope23, "lastPrefix", lastPrefix, {
              file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
              end: {
                column: 25,
                line: 207
              },
              start: {
                column: 6,
                line: 207
              },
              source: ''
            }) : void 0, lastPrefix;
            let path = _getAndCallMember(_getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope23, "ea", ea) : void 0, ea), "url"), "replace", [(self.__expressionAnalysisMode__ ? _traceMember(this, "serverURL") : void 0, this.serverURL()), ""]);
            let lineAndColumn = {
              line: _getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope23, "ea", ea) : void 0, ea), "line"),
              column: _getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope23, "ea", ea) : void 0, ea), "column"),
              selection: _getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope23, "ea", ea) : void 0, ea), "selection")
            };
            let link = _element("a", _attributes(_attributeExpression("href", _getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope23, "ea", ea) : void 0, ea), "url")), _attributeExpression("title", _getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope23, "ea", ea) : void 0, ea), "file")), _attributeExpression("click", evt => {
              let _scope25 = {
                isScope: true
              };
              if (_getMember((evt === Object(evt) ? self.__expressionAnalysisMode__ ? _getLocal(_scope25, "evt", evt) : void 0 : evt, evt), "shiftKey") || _getMember((evt === Object(evt) ? self.__expressionAnalysisMode__ ? _getLocal(_scope25, "evt", evt) : void 0 : evt, evt), "ctrlKey")) {
                if (self.__expressionAnalysisMode__) _traceMember(this, "browseSearchResult");
                this.browseSearchResult((url === Object(url) ? self.__expressionAnalysisMode__ ? _getLocal(_scope24, "url", url) : void 0 : url, url), (lineAndColumn === Object(lineAndColumn) ? self.__expressionAnalysisMode__ ? _getLocal(_scope24, "lineAndColumn", lineAndColumn) : void 0 : lineAndColumn, lineAndColumn));
              } else {
                if (self.__expressionAnalysisMode__) _traceMember(this, "showSearchResult");
                this.showSearchResult((url === Object(url) ? self.__expressionAnalysisMode__ ? _getLocal(_scope24, "url", url) : void 0 : url, url), (lineAndColumn === Object(lineAndColumn) ? self.__expressionAnalysisMode__ ? _getLocal(_scope24, "lineAndColumn", lineAndColumn) : void 0 : lineAndColumn, lineAndColumn));
              }
              return false;
            })), _children(_childExpression((self.__expressionAnalysisMode__ ? _traceMember(dirAndFilename, "slice") : void 0, (dirAndFilename === Object(dirAndFilename) ? self.__expressionAnalysisMode__ ? _getLocal(_scope24, "dirAndFilename", dirAndFilename) : void 0 : dirAndFilename, dirAndFilename).slice(0, 60)))), {
              file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
              end: {
                column: 43,
                line: 221
              },
              start: {
                column: 17,
                line: 214
              }
            });
            let item = _element("tr", _attributes(), _children(_childText("\n          "), _childElement(_element("td", _attributes(_attributeStringLiteral("class", "filename")), _children(_childExpression((link === Object(link) ? self.__expressionAnalysisMode__ ? _getLocal(_scope24, "link", link) : void 0 : link, link))), {
              file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
              end: {
                column: 42,
                line: 224
              },
              start: {
                column: 10,
                line: 224
              }
            })), _childText("\n          "), _childElement(_element("td", _attributes(_attributeStringLiteral("class", "line")), _children(_childExpression(_getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope23, "ea", ea) : void 0, ea), "line") + 1), _childText(":")), {
              file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
              end: {
                column: 46,
                line: 225
              },
              start: {
                column: 10,
                line: 225
              }
            })), _childText("\n          "), _childElement(_element("td", _attributes(), _children(_childText("\n            "), _childExpression((self.__expressionAnalysisMode__ ? _traceMember(this, "hightlightPattern") : void 0, this.hightlightPattern((text === Object(text) ? self.__expressionAnalysisMode__ ? _getLocal(_scope24, "text", text) : void 0 : text, text), _getMember(this, "pattern")))), _childText("\n          ")), {
              file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
              end: {
                column: 15,
                line: 228
              },
              start: {
                column: 10,
                line: 226
              }
            })), _childText("\n        ")), {
              file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
              end: {
                column: 13,
                line: 229
              },
              start: {
                column: 17,
                line: 223
              }
            });
            _setMember((self.__expressionAnalysisMode__ ? _getLocal(_scope23, "ea", ea) : void 0, ea), "item", (item === Object(item) ? self.__expressionAnalysisMode__ ? _getLocal(_scope24, "item", item) : void 0 : item, item), {
              file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
              end: {
                column: 20,
                line: 230
              },
              start: {
                column: 6,
                line: 230
              },
              source: ''
            });
            _getAndCallMember((self.__expressionAnalysisMode__ ? _traceMember(this, "get") : void 0, this.get("#searchResults")), "appendChild", [(item === Object(item) ? self.__expressionAnalysisMode__ ? _getLocal(_scope24, "item", item) : void 0 : item, item)]);
          }
          if (_getMember(this, "replace")) {
            await (self.__expressionAnalysisMode__ ? _traceMember(this, "updateReplacePreview") : void 0, this.updateReplacePreview());
          }
        }
        hightlightPattern(text, pattern) {
          let _scope26 = {
            isScope: true
          };
          let textSpan = _element("span", _attributes(), _children(), {
            file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
            end: {
              column: 32,
              line: 241
            },
            start: {
              column: 19,
              line: 241
            }
          });
          _setMember((textSpan === Object(textSpan) ? self.__expressionAnalysisMode__ ? _getLocal(_scope26, "textSpan", textSpan) : void 0 : textSpan, textSpan), "innerHTML", _getAndCallMember((self.__expressionAnalysisMode__ ? _traceMember(text, "replace") : void 0, (text === Object(text) ? self.__expressionAnalysisMode__ ? _getLocal(_scope26, "text", text) : void 0 : text, text).replace(/</g, "&lt;")), "replace", [new (self.__expressionAnalysisMode__ ? _getGlobal("RegExp") : void 0, RegExp)("(" + (self.__expressionAnalysisMode__ ? _traceMember(pattern, "replace") : void 0, (pattern === Object(pattern) ? self.__expressionAnalysisMode__ ? _getLocal(_scope26, "pattern", pattern) : void 0 : pattern, pattern).replace(/</g, "&lt;")) + ")", "g"), "<b>$1</b>"]), {
            file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
            end: {
              column: 87,
              line: 244
            },
            start: {
              column: 4,
              line: 242
            },
            source: ''
          });
          return textSpan === Object(textSpan) ? self.__expressionAnalysisMode__ ? _getLocal(_scope26, "textSpan", textSpan) : void 0 : textSpan, textSpan;
        }

        /*MD ## Search and Replace MD*/

        async searchAndReplace(pattern, replace) {
          let _scope27 = {
            isScope: true
          };
          _setMember(this, "mode", "replace", {
            file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
            end: {
              column: 25,
              line: 252
            },
            start: {
              column: 4,
              line: 252
            },
            source: ''
          });
          _setMember(this, "pattern", (pattern === Object(pattern) ? self.__expressionAnalysisMode__ ? _getLocal(_scope27, "pattern", pattern) : void 0 : pattern, pattern), {
            file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
            end: {
              column: 26,
              line: 253
            },
            start: {
              column: 4,
              line: 253
            },
            source: ''
          });
          _setMember(this, "replace", (replace === Object(replace) ? self.__expressionAnalysisMode__ ? _getLocal(_scope27, "replace", replace) : void 0 : replace, replace), {
            file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
            end: {
              column: 26,
              line: 254
            },
            start: {
              column: 4,
              line: 254
            },
            source: ''
          });
          await (self.__expressionAnalysisMode__ ? _traceMember(this, "search") : void 0, this.search());
          await (self.__expressionAnalysisMode__ ? _traceMember(this, "updateReplacePreview") : void 0, this.updateReplacePreview());
          await (self.__expressionAnalysisMode__ ? _traceMember(this, "replaceInFiles") : void 0, this.replaceInFiles());
        }
        hasPreview() {
          return _getMember(this, "files") && _getMember(_getMember(this, "files"), "length") > 0 && _getAndCallMember(_getMember(_getMember(_getMember(this, "files"), 0), "item"), "querySelector", ["td#replace"]);
        }
        updateReplacePreview() {
          let _scope28 = {
            isScope: true
          };
          if (_getMember(this, "mode") != "replace") {
            return;
          }
          for (var file of _getMember(this, "files")) {
            if (_getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope28, "file", file) : void 0, file), "item")) {
              _getAndCallMember(_getAndCallMember(_getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope28, "file", file) : void 0, file), "item"), "querySelectorAll", ["#replace"]), "forEach", [td => {
                let _scope29 = {
                  isScope: true
                };
                return self.__expressionAnalysisMode__ ? _traceMember(td, "remove") : void 0, (td === Object(td) ? self.__expressionAnalysisMode__ ? _getLocal(_scope29, "td", td) : void 0 : td, td).remove();
              }]);
              var newText = _getAndCallMember(_getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope28, "file", file) : void 0, file), "text"), "replace", [new (self.__expressionAnalysisMode__ ? _getGlobal("RegExp") : void 0, RegExp)(_getMember(this, "pattern"), "g"), _getMember(this, "replace")]);
              _setMember((self.__expressionAnalysisMode__ ? _getLocal(_scope28, "file", file) : void 0, file), "replaced", (self.__expressionAnalysisMode__ ? _getLocal(_scope28, "newText", newText) : void 0, newText), {
                file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
                end: {
                  column: 31,
                  line: 273
                },
                start: {
                  column: 8,
                  line: 273
                },
                source: ''
              });
              var replacedText = (self.__expressionAnalysisMode__ ? _traceMember(this, "hightlightPattern") : void 0, this.hightlightPattern((self.__expressionAnalysisMode__ ? _getLocal(_scope28, "newText", newText) : void 0, newText), (self.__expressionAnalysisMode__ ? _traceMember(_, "escapeRegExp") : void 0, (self.__expressionAnalysisMode__ ? _getLocal(_scope, "_", _) : void 0, _).escapeRegExp(_getMember(this, "replace")))));
              var replacePreviewColumn = _element("td", _attributes(_attributeStringLiteral("id", "replace")), _children(_childExpression((self.__expressionAnalysisMode__ ? _getLocal(_scope28, "replacedText", replacedText) : void 0, replacedText))), {
                file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
                end: {
                  column: 71,
                  line: 275
                },
                start: {
                  column: 35,
                  line: 275
                }
              });
              _getAndCallMember(_getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope28, "file", file) : void 0, file), "item"), "appendChild", [(self.__expressionAnalysisMode__ ? _getLocal(_scope28, "replacePreviewColumn", replacePreviewColumn) : void 0, replacePreviewColumn)]);
              _getAndCallMember(_getAndCallMember(_getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope28, "file", file) : void 0, file), "item"), "querySelectorAll", ["#select"]), "forEach", [td => {
                let _scope30 = {
                  isScope: true
                };
                return self.__expressionAnalysisMode__ ? _traceMember(td, "remove") : void 0, (td === Object(td) ? self.__expressionAnalysisMode__ ? _getLocal(_scope30, "td", td) : void 0 : td, td).remove();
              }]);
              var selectColumn = _element("td", _attributes(_attributeStringLiteral("id", "select")), _children(_childElement(_element("input", _attributes(_attributeStringLiteral("type", "checkbox"), _attributeEmpty("checked")), _children(), {
                file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
                end: {
                  column: 82,
                  line: 280
                },
                start: {
                  column: 43,
                  line: 280
                }
              }))), {
                file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
                end: {
                  column: 87,
                  line: 280
                },
                start: {
                  column: 27,
                  line: 280
                }
              });
              _getAndCallMember(_getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope28, "file", file) : void 0, file), "item"), "insertBefore", [(self.__expressionAnalysisMode__ ? _getLocal(_scope28, "selectColumn", selectColumn) : void 0, selectColumn), _getMember(_getMember(_getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope28, "file", file) : void 0, file), "item"), "childNodes"), 0)]);
            }
          }
        }

        // #important #refactor
        async replaceInFiles(pattern = this.pattern, replace = this.replace) {
          let _scope31 = {
            isScope: true
          };
          if (_getMember(this, "searchInProgres") || !_getMember(this, "files")) {
            if (self.__expressionAnalysisMode__) _traceMember(this, "log");
            this.log("please search files first");
            return;
          }
          if (!(self.__expressionAnalysisMode__ ? _traceMember(this, "hasPreview") : void 0, this.hasPreview())) {
            await (self.__expressionAnalysisMode__ ? _traceMember(this, "updateReplacePreview") : void 0, this.updateReplacePreview());
          }
          let toReplace = [];
          let regex = new (self.__expressionAnalysisMode__ ? _getGlobal("RegExp") : void 0, RegExp)((pattern === Object(pattern) ? self.__expressionAnalysisMode__ ? _getLocal(_scope31, "pattern", pattern) : void 0 : pattern, pattern), "g");
          var selectedFilesLines = _getAndCallMember(_getMember(this, "files"), "filter", [ea => {
            let _scope32 = {
              isScope: true
            };
            return _getMember(_getAndCallMember(_getMember((ea === Object(ea) ? self.__expressionAnalysisMode__ ? _getLocal(_scope32, "ea", ea) : void 0 : ea, ea), "item"), "querySelector", ["td#select input"]), "checked");
          }]);
          var warnings = [];
          var selectedFiles = _getAndCallMember((self.__expressionAnalysisMode__ ? _traceMember(selectedFilesLines, "map") : void 0, (selectedFilesLines === Object(selectedFilesLines) ? self.__expressionAnalysisMode__ ? _getLocal(_scope31, "selectedFilesLines", selectedFilesLines) : void 0 : selectedFilesLines, selectedFilesLines).map(ea => {
            let _scope33 = {
              isScope: true
            };
            return _getMember((ea === Object(ea) ? self.__expressionAnalysisMode__ ? _getLocal(_scope33, "ea", ea) : void 0 : ea, ea), "url");
          })), "uniq", []);
          for (let url of (selectedFiles === Object(selectedFiles) ? self.__expressionAnalysisMode__ ? _getLocal(_scope31, "selectedFiles", selectedFiles) : void 0 : selectedFiles, selectedFiles)) {
            let _scope34 = {
                isScope: true
              },
              _scope36 = {
                isScope: true
              },
              _scope41 = {
                isScope: true
              };
            let getRequest = await (self.__expressionAnalysisMode__ ? _getGlobal("fetch") : void 0, fetch)((url === Object(url) ? self.__expressionAnalysisMode__ ? _getLocal(_scope34, "url", url) : void 0 : url, url));
            let lastVersion = _getAndCallMember(_getMember((getRequest === Object(getRequest) ? self.__expressionAnalysisMode__ ? _getLocal(_scope34, "getRequest", getRequest) : void 0 : getRequest, getRequest), "headers"), "get", ["fileversion"]);
            let contents = await (self.__expressionAnalysisMode__ ? _traceMember(getRequest, "text") : void 0, (getRequest === Object(getRequest) ? self.__expressionAnalysisMode__ ? _getLocal(_scope34, "getRequest", getRequest) : void 0 : getRequest, getRequest).text());
            var lines = (self.__expressionAnalysisMode__ ? _traceMember(selectedFilesLines, "filter") : void 0, (selectedFilesLines === Object(selectedFilesLines) ? self.__expressionAnalysisMode__ ? _getLocal(_scope31, "selectedFilesLines", selectedFilesLines) : void 0 : selectedFilesLines, selectedFilesLines).filter(ea => {
              let _scope35 = {
                isScope: true
              };
              return _getMember((ea === Object(ea) ? self.__expressionAnalysisMode__ ? _getLocal(_scope35, "ea", ea) : void 0 : ea, ea), "url") == (url === Object(url) ? self.__expressionAnalysisMode__ ? _getLocal(_scope36, "url", url) : void 0 : url, url);
            }));
            if ((contents === Object(contents) ? self.__expressionAnalysisMode__ ? _getLocal(_scope34, "contents", contents) : void 0 : contents, contents) === _getMember(_getMember(_getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope31, "lines", lines) : void 0, lines), 0), "indexed"), "content")) {
              let _scope39 = {
                isScope: true
              };
              // #TODO instead of replacing everthing, we should honor the selection?

              let newcontents = _getAndCallMember(_getAndCallMember((self.__expressionAnalysisMode__ ? _traceMember(contents, "split") : void 0, (contents === Object(contents) ? self.__expressionAnalysisMode__ ? _getLocal(_scope34, "contents", contents) : void 0 : contents, contents).split("\n")), "map", [(ea, index) => {
                let _scope38 = {
                  isScope: true
                };
                var line = (self.__expressionAnalysisMode__ ? _traceMember(lines, "find") : void 0, (self.__expressionAnalysisMode__ ? _getLocal(_scope31, "lines", lines) : void 0, lines).find(ea => {
                  let _scope37 = {
                    isScope: true
                  };
                  return _getMember((ea === Object(ea) ? self.__expressionAnalysisMode__ ? _getLocal(_scope37, "ea", ea) : void 0 : ea, ea), "line") == (index === Object(index) ? self.__expressionAnalysisMode__ ? _getLocal(_scope38, "index", index) : void 0 : index, index);
                }));
                if (line === Object(line) ? self.__expressionAnalysisMode__ ? _getLocal(_scope38, "line", line) : void 0 : line, line) {
                  if (_getMember((line === Object(line) ? self.__expressionAnalysisMode__ ? _getLocal(_scope38, "line", line) : void 0 : line, line), "text") != (ea === Object(ea) ? self.__expressionAnalysisMode__ ? _getLocal(_scope38, "ea", ea) : void 0 : ea, ea)) {
                    throw new (self.__expressionAnalysisMode__ ? _getGlobal("Error") : void 0, Error)("original line changed!");
                  }
                  return _getMember((line === Object(line) ? self.__expressionAnalysisMode__ ? _getLocal(_scope38, "line", line) : void 0 : line, line), "replaced"); // our replacement 
                } else {
                  return ea === Object(ea) ? self.__expressionAnalysisMode__ ? _getLocal(_scope38, "ea", ea) : void 0 : ea, ea;
                }
              }]), "join", ["\n"]);

              //  let oldnewcontents = contents.replace(regex, replace)
              // if (oldnewcontents !== newcontents) {
              //   throw new Error("Upsi!")
              // }

              if ((contents === Object(contents) ? self.__expressionAnalysisMode__ ? _getLocal(_scope34, "contents", contents) : void 0 : contents, contents) == (newcontents === Object(newcontents) ? self.__expressionAnalysisMode__ ? _getLocal(_scope39, "newcontents", newcontents) : void 0 : newcontents, newcontents)) {
                if (self.__expressionAnalysisMode__) _traceMember(this, "log");
                this.log("pattern did not match " + (pattern === Object(pattern) ? self.__expressionAnalysisMode__ ? _getLocal(_scope31, "pattern", pattern) : void 0 : pattern, pattern));
              }
              if (self.__expressionAnalysisMode__) _traceMember(toReplace, "push");
              (toReplace === Object(toReplace) ? self.__expressionAnalysisMode__ ? _getLocal(_scope31, "toReplace", toReplace) : void 0 : toReplace, toReplace).push({
                url: url,
                lastversion: lastVersion,
                oldcontent: contents,
                newcontent: newcontents
              });
            } else {
              if (self.__expressionAnalysisMode__) _traceMember(lines, "forEach");
              (self.__expressionAnalysisMode__ ? _getLocal(_scope31, "lines", lines) : void 0, lines).forEach(line => {
                let _scope40 = {
                  isScope: true
                };
                return _setMember(_getMember(_getMember((line === Object(line) ? self.__expressionAnalysisMode__ ? _getLocal(_scope40, "line", line) : void 0 : line, line), "item"), "style"), "outline", "1px solid red", {
                  file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
                  end: {
                    column: 71,
                    line: 336
                  },
                  start: {
                    column: 30,
                    line: 336
                  },
                  source: ''
                });
              });
              if (self.__expressionAnalysisMode__) _traceMember(warnings, "push");
              (warnings === Object(warnings) ? self.__expressionAnalysisMode__ ? _getLocal(_scope31, "warnings", warnings) : void 0 : warnings, warnings).push("WARNING: skip " + (url === Object(url) ? self.__expressionAnalysisMode__ ? _getLocal(_scope41, "url", url) : void 0 : url, url) + ", because content changed!");
            }
          }
          if (!(await (self.__expressionAnalysisMode__ ? _traceMember(this, "confirmReplaceDialog") : void 0, this.confirmReplaceDialog((toReplace === Object(toReplace) ? self.__expressionAnalysisMode__ ? _getLocal(_scope31, "toReplace", toReplace) : void 0 : toReplace, toReplace), (regex === Object(regex) ? self.__expressionAnalysisMode__ ? _getLocal(_scope31, "regex", regex) : void 0 : regex, regex), (warnings === Object(warnings) ? self.__expressionAnalysisMode__ ? _getLocal(_scope31, "warnings", warnings) : void 0 : warnings, warnings))))) {
            if (self.__expressionAnalysisMode__) _traceMember(lively, "warn");
            (self.__expressionAnalysisMode__ ? _getGlobal("lively") : void 0, lively).warn("replacing files canceled");
            return;
          }
          if (self.__expressionAnalysisMode__) _traceMember(this, "clearLog");
          this.clearLog();
          for (let ea of (toReplace === Object(toReplace) ? self.__expressionAnalysisMode__ ? _getLocal(_scope31, "toReplace", toReplace) : void 0 : toReplace, toReplace)) {
            let _scope42 = {
              isScope: true
            };
            await (self.__expressionAnalysisMode__ ? _traceMember(this, "replaceFile") : void 0, this.replaceFile((ea === Object(ea) ? self.__expressionAnalysisMode__ ? _getLocal(_scope42, "ea", ea) : void 0 : ea, ea), (replace === Object(replace) ? self.__expressionAnalysisMode__ ? _getLocal(_scope31, "replace", replace) : void 0 : replace, replace), (pattern === Object(pattern) ? self.__expressionAnalysisMode__ ? _getLocal(_scope31, "pattern", pattern) : void 0 : pattern, pattern)));
          }
        }
        async replaceFile(file, replace, pattern) {
          let _scope43 = {
            isScope: true
          };
          let url = _getMember((file === Object(file) ? self.__expressionAnalysisMode__ ? _getLocal(_scope43, "file", file) : void 0 : file, file), "url");
          let headers = {};
          if (_getMember((file === Object(file) ? self.__expressionAnalysisMode__ ? _getLocal(_scope43, "file", file) : void 0 : file, file), "lastVersion")) {
            _setMember((headers === Object(headers) ? self.__expressionAnalysisMode__ ? _getLocal(_scope43, "headers", headers) : void 0 : headers, headers), "lastversion", _getMember((file === Object(file) ? self.__expressionAnalysisMode__ ? _getLocal(_scope43, "file", file) : void 0 : file, file), "lastVersion"), {
              file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
              end: {
                column: 44,
                line: 356
              },
              start: {
                column: 6,
                line: 356
              },
              source: ''
            });
          }
          let putRequest = await (self.__expressionAnalysisMode__ ? _getGlobal("fetch") : void 0, fetch)((url === Object(url) ? self.__expressionAnalysisMode__ ? _getLocal(_scope43, "url", url) : void 0 : url, url), {
            method: "PUT",
            body: _getMember((file === Object(file) ? self.__expressionAnalysisMode__ ? _getLocal(_scope43, "file", file) : void 0 : file, file), "newcontent"),
            headers: headers
          });
          var item = _element("tr", _attributes(), _children(_childText("\n      "), _childElement(_element("td", _attributes(), _children(_childText("replaced")), {
            file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
            end: {
              column: 23,
              line: 365
            },
            start: {
              column: 6,
              line: 365
            }
          })), _childText("\n      "), _childElement(_element("td", _attributes(_attributeStringLiteral("class", "filename")), _children(_childText("\n        "), _childElement(_element("a", _attributes(_attributeExpression("click", evt => {
            let _scope44 = {
              isScope: true
            };
            if (self.__expressionAnalysisMode__) _traceMember(evt, "preventDefault");
            (evt === Object(evt) ? self.__expressionAnalysisMode__ ? _getLocal(_scope44, "evt", evt) : void 0 : evt, evt).preventDefault();
            if (self.__expressionAnalysisMode__) _traceMember(this, "browseSearchResult");
            this.browseSearchResult((url === Object(url) ? self.__expressionAnalysisMode__ ? _getLocal(_scope43, "url", url) : void 0 : url, url), (replace === Object(replace) ? self.__expressionAnalysisMode__ ? _getLocal(_scope43, "replace", replace) : void 0 : replace, replace));
          }), _attributeExpression("href", (url === Object(url) ? self.__expressionAnalysisMode__ ? _getLocal(_scope43, "url", url) : void 0 : url, url))), _children(_childExpression((self.__expressionAnalysisMode__ ? _traceMember(url, "replace") : void 0, (url === Object(url) ? self.__expressionAnalysisMode__ ? _getLocal(_scope43, "url", url) : void 0 : url, url).replace(/.*\//, ""))), _childText("\n        ")), {
            file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
            end: {
              column: 12,
              line: 372
            },
            start: {
              column: 8,
              line: 367
            }
          })), _childText("\n      ")), {
            file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
            end: {
              column: 11,
              line: 373
            },
            start: {
              column: 6,
              line: 366
            }
          })), _childText("\n      "), _childElement(_element("td", _attributes(), _children(_childElement(_element("b", _attributes(), _children(_childExpression((pattern === Object(pattern) ? self.__expressionAnalysisMode__ ? _getLocal(_scope43, "pattern", pattern) : void 0 : pattern, pattern))), {
            file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
            end: {
              column: 26,
              line: 374
            },
            start: {
              column: 10,
              line: 374
            }
          }))), {
            file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
            end: {
              column: 31,
              line: 374
            },
            start: {
              column: 6,
              line: 374
            }
          })), _childText("\n      "), _childElement(_element("td", _attributes(), _children(_childText("with")), {
            file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
            end: {
              column: 19,
              line: 375
            },
            start: {
              column: 6,
              line: 375
            }
          })), _childText("\n      "), _childElement(_element("td", _attributes(), _children(_childElement(_element("b", _attributes(), _children(_childExpression((replace === Object(replace) ? self.__expressionAnalysisMode__ ? _getLocal(_scope43, "replace", replace) : void 0 : replace, replace))), {
            file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
            end: {
              column: 26,
              line: 376
            },
            start: {
              column: 10,
              line: 376
            }
          }))), {
            file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
            end: {
              column: 31,
              line: 376
            },
            start: {
              column: 6,
              line: 376
            }
          })), _childText("\n    ")), {
            file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
            end: {
              column: 9,
              line: 377
            },
            start: {
              column: 15,
              line: 364
            }
          });
          _getAndCallMember((self.__expressionAnalysisMode__ ? _traceMember(this, "get") : void 0, this.get("#searchResults")), "appendChild", [(item === Object(item) ? self.__expressionAnalysisMode__ ? _getLocal(_scope43, "item", item) : void 0 : item, item)]);
          if (_getMember((putRequest === Object(putRequest) ? self.__expressionAnalysisMode__ ? _getLocal(_scope43, "putRequest", putRequest) : void 0 : putRequest, putRequest), "status") == 200) {
            if (self.__expressionAnalysisMode__) _traceMember(lively, "notify");
            // #Idea: show diff?
            (self.__expressionAnalysisMode__ ? _getGlobal("lively") : void 0, lively).notify("Replaced in " + (url === Object(url) ? self.__expressionAnalysisMode__ ? _getLocal(_scope43, "url", url) : void 0 : url, url));
          } else {
            if (self.__expressionAnalysisMode__) _traceMember(lively, "warn");
            (self.__expressionAnalysisMode__ ? _getGlobal("lively") : void 0, lively).warn("could not change " + (url === Object(url) ? self.__expressionAnalysisMode__ ? _getLocal(_scope43, "url", url) : void 0 : url, url) + ", because " + (putRequest === Object(putRequest) ? self.__expressionAnalysisMode__ ? _getLocal(_scope43, "putRequest", putRequest) : void 0 : putRequest, putRequest));
          }
        }
        confirmReplaceDialog(toReplace, regex, warnings) {
          let _scope45 = {
            isScope: true
          };
          const list = (self.__expressionAnalysisMode__ ? _traceMember(toReplace, "map") : void 0, (toReplace === Object(toReplace) ? self.__expressionAnalysisMode__ ? _getLocal(_scope45, "toReplace", toReplace) : void 0 : toReplace, toReplace).map(ea => {
            let _scope46 = {
              isScope: true
            };
            var filename = _getAndCallMember(_getMember((ea === Object(ea) ? self.__expressionAnalysisMode__ ? _getLocal(_scope46, "ea", ea) : void 0 : ea, ea), "url"), "replace", [/.*\//, ""]);
            return _element("li", _attributes(), _children(_childExpression((filename === Object(filename) ? self.__expressionAnalysisMode__ ? _getLocal(_scope46, "filename", filename) : void 0 : filename, filename))), {
              file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
              end: {
                column: 32,
                line: 391
              },
              start: {
                column: 13,
                line: 391
              }
            });
          }));
          warnings = (self.__expressionAnalysisMode__ ? _getLocal(_scope45, "warnings", warnings) : void 0, warnings), true ? _setLocal(_scope45, "warnings", warnings, {
            file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
            end: {
              column: 23,
              line: 393
            },
            start: {
              column: 4,
              line: 393
            },
            source: ''
          }) : void 0, warnings;
          var msg = _element("div", _attributes(), _children(_childText("Replace \n                "), _childElement(_element("b", _attributes(), _children(_childExpression(_getMember(this, "pattern"))), {
            file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
            end: {
              column: 37,
              line: 395
            },
            start: {
              column: 16,
              line: 395
            }
          })), _childText(" with "), _childElement(_element("b", _attributes(), _children(_childExpression(_getMember(this, "replace"))), {
            file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
            end: {
              column: 64,
              line: 395
            },
            start: {
              column: 43,
              line: 395
            }
          })), _childText(" \n                in "), _childExpression(_getMember((toReplace === Object(toReplace) ? self.__expressionAnalysisMode__ ? _getLocal(_scope45, "toReplace", toReplace) : void 0 : toReplace, toReplace), "length")), _childText(" files?\n                "), _childElement(_element("div", _attributes(_attributeStringLiteral("style", "color: red; white-space: pre;")), _children(_childExpression((self.__expressionAnalysisMode__ ? _traceMember(warnings, "join") : void 0, (self.__expressionAnalysisMode__ ? _getLocal(_scope45, "warnings", warnings) : void 0, warnings).join("\n")))), {
            file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
            end: {
              column: 86,
              line: 397
            },
            start: {
              column: 16,
              line: 397
            }
          })), _childText("\n                "), _childElement(_element("ul", _attributes(_attributeStringLiteral("style", "font-size: 10pt")), _children(_childText("\n                  "), _childSpread((list === Object(list) ? self.__expressionAnalysisMode__ ? _getLocal(_scope45, "list", list) : void 0 : list, list)), _childText("\n                ")), {
            file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
            end: {
              column: 21,
              line: 400
            },
            start: {
              column: 16,
              line: 398
            }
          })), _childText("\n              ")), {
            file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
            end: {
              column: 20,
              line: 401
            },
            start: {
              column: 14,
              line: 394
            }
          });
          return self.__expressionAnalysisMode__ ? _traceMember(lively, "confirm") : void 0, (self.__expressionAnalysisMode__ ? _getGlobal("lively") : void 0, lively).confirm((msg === Object(msg) ? self.__expressionAnalysisMode__ ? _getLocal(_scope45, "msg", msg) : void 0 : msg, msg));
        }

        /*MD ## Helper MD*/
        // #private
        log(s) {
          let _scope47 = {
            isScope: true
          };
          var entry = _element("tr", _attributes(), _children(_childElement(_element("td", _attributes(_attributeStringLiteral("class", "logentry"), _attributeStringLiteral("colspan", "2")), _children(_childExpression((s === Object(s) ? self.__expressionAnalysisMode__ ? _getLocal(_scope47, "s", s) : void 0 : s, s))), {
            file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
            end: {
              column: 61,
              line: 409
            },
            start: {
              column: 20,
              line: 409
            }
          }))), {
            file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
            end: {
              column: 66,
              line: 409
            },
            start: {
              column: 16,
              line: 409
            }
          });
          _getAndCallMember((self.__expressionAnalysisMode__ ? _traceMember(this, "get") : void 0, this.get("#searchResults")), "appendChild", [(entry === Object(entry) ? self.__expressionAnalysisMode__ ? _getLocal(_scope47, "entry", entry) : void 0 : entry, entry)]);
        }
        clearLog(s) {
          _setMember((self.__expressionAnalysisMode__ ? _traceMember(this, "get") : void 0, this.get("#searchResults")), "innerHTML", "", {
            file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
            end: {
              column: 43,
              line: 414
            },
            start: {
              column: 4,
              line: 414
            },
            source: ''
          });
        }

        // #private
        serverURL() {
          return self.__expressionAnalysisMode__ ? _traceMember(lively4url, "replace") : void 0, (self.__expressionAnalysisMode__ ? _getGlobal("lively4url") : void 0, lively4url).replace(/[^/]*$/, "");
        }

        /*MD ## Lively API MD*/
        livelyMigrate(other) {}
      });
      if (self.__expressionAnalysisMode__) _traceMember(Object, "defineProperty");
      Object.defineProperty(_getMember((self.__expressionAnalysisMode__ ? _getGlobal("_recorder_") : void 0, _recorder_), "_src_components_tools_lively_index_search_js"), "IndexSearch", {
        get() {
          return self.__expressionAnalysisMode__ ? _getLocal(_scope, "IndexSearch", IndexSearch) : void 0, IndexSearch;
        },
        set(thisIsVererySecretVariableName) {
          let _scope48 = {
            isScope: true
          };
          _export("default", IndexSearch = (thisIsVererySecretVariableName === Object(thisIsVererySecretVariableName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope48, "thisIsVererySecretVariableName", thisIsVererySecretVariableName) : void 0 : thisIsVererySecretVariableName, thisIsVererySecretVariableName)), true ? _setLocal(_scope, "IndexSearch", IndexSearch, {
            file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/components/tools/lively-index-search.js',
            end: {
              column: 32,
              line: 11
            },
            start: {
              column: 21,
              line: 11
            },
            source: ''
          }) : void 0, IndexSearch;
          return true;
        },
        enumerable: true,
        configurable: true
      });
    }
  };
});