'enable aexpr';

System.register(['active-expression-rewriting', 'reactive-jsx', 'src/components/widgets/lively-morph.js', 'src/client/triples/triples.js', 'active-group', 'utils'], function (_export, _context) {
  "use strict";

  var _aexpr, _getAndCallMember, _traceMember, _getLocal, _getGlobal, _getMember, _setMember, _attributeStringLiteral, _attributeExpression, _childElement, _childText, _childSpread, _childExpression, _children, _attributes, _element, Morph, Graph, Triple, _, TAG_URL, select, trackInstance, baseViewForClass, debounce;

  return {
    setters: [function (_activeExpressionRewriting) {
      _aexpr = _activeExpressionRewriting.aexpr;
      _getAndCallMember = _activeExpressionRewriting.getAndCallMember;
      _traceMember = _activeExpressionRewriting.traceMember;
      _getLocal = _activeExpressionRewriting.getLocal;
      _getGlobal = _activeExpressionRewriting.getGlobal;
      _getMember = _activeExpressionRewriting.getMember;
      _setMember = _activeExpressionRewriting.setMember;
    }, function (_reactiveJsx) {
      _attributeStringLiteral = _reactiveJsx.attributeStringLiteral;
      _attributeExpression = _reactiveJsx.attributeExpression;
      _childElement = _reactiveJsx.childElement;
      _childText = _reactiveJsx.childText;
      _childSpread = _reactiveJsx.childSpread;
      _childExpression = _reactiveJsx.childExpression;
      _children = _reactiveJsx.children;
      _attributes = _reactiveJsx.attributes;
      _element = _reactiveJsx.element;
    }, function (_srcComponentsWidgetsLivelyMorphJs) {
      Morph = _srcComponentsWidgetsLivelyMorphJs.default;
    }, function (_srcClientTriplesTriplesJs) {
      Graph = _srcClientTriplesTriplesJs.Graph;
      Triple = _srcClientTriplesTriplesJs.Triple;
      _ = _srcClientTriplesTriplesJs._;
      TAG_URL = _srcClientTriplesTriplesJs.TAG_URL;
    }, function (_activeGroup) {
      select = _activeGroup.default;
      trackInstance = _activeGroup.trackInstance;
      baseViewForClass = _activeGroup.baseViewForClass;
    }, function (_utils) {
      debounce = _utils.debounce;
    }],
    execute: function () {
      _recorder_._templates_knot_view_js = _recorder_._templates_knot_view_js || {};
      let _scope = {};

      _setMember(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_templates_knot_view_js'), 'Morph', (self.__expressionAnalysisMode__ ? _getLocal(_scope, 'Morph', Morph) : void 0, Morph));

      _setMember(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_templates_knot_view_js'), 'TAG_URL', (self.__expressionAnalysisMode__ ? _getLocal(_scope, 'TAG_URL', TAG_URL) : void 0, TAG_URL));

      _setMember(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_templates_knot_view_js'), '_', (self.__expressionAnalysisMode__ ? _getLocal(_scope, '_', _) : void 0, _));

      _setMember(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_templates_knot_view_js'), 'Triple', (self.__expressionAnalysisMode__ ? _getLocal(_scope, 'Triple', Triple) : void 0, Triple));

      _setMember(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_templates_knot_view_js'), 'Graph', (self.__expressionAnalysisMode__ ? _getLocal(_scope, 'Graph', Graph) : void 0, Graph));

      _setMember(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_templates_knot_view_js'), 'baseViewForClass', (self.__expressionAnalysisMode__ ? _getLocal(_scope, 'baseViewForClass', baseViewForClass) : void 0, baseViewForClass));

      _setMember(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_templates_knot_view_js'), 'trackInstance', (self.__expressionAnalysisMode__ ? _getLocal(_scope, 'trackInstance', trackInstance) : void 0, trackInstance));

      _setMember(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_templates_knot_view_js'), 'select', (self.__expressionAnalysisMode__ ? _getLocal(_scope, 'select', select) : void 0, select));

      _setMember(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_templates_knot_view_js'), 'debounce', (self.__expressionAnalysisMode__ ? _getLocal(_scope, 'debounce', debounce) : void 0, debounce));

      class KnotView extends _getMember(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_templates_knot_view_js'), 'Morph') {
        get urlString() {
          return _getMember((self.__expressionAnalysisMode__ ? _traceMember(this, 'get') : void 0, this.get("#path-to-load")), 'value');
        }
        get tagURLString() {
          return _getMember(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_templates_knot_view_js'), 'TAG_URL');
        }

        async initialize() {
          let _scope2 = {};

          _setMember(this, 'windowTitle', "Knot View");

          var pathToLoad = (self.__expressionAnalysisMode__ ? _traceMember(this, 'get') : void 0, this.get("#path-to-load"));
          if (self.__expressionAnalysisMode__) _traceMember(pathToLoad, 'addEventListener');
          (self.__expressionAnalysisMode__ ? _getLocal(_scope2, 'pathToLoad', pathToLoad) : void 0, pathToLoad).addEventListener('keyup', event => {
            let _scope3 = {};

            if (_getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope3, 'event', event) : void 0, event), 'keyCode') == 13) {
              if (self.__expressionAnalysisMode__) _traceMember(this, 'onPathEntered');
              // ENTER
              this.onPathEntered(_getMember(this, 'urlString'));
            }
          });

          let editorComp = (self.__expressionAnalysisMode__ ? _traceMember(this, 'get') : void 0, this.get('#content-editor'));
          // editorComp.editor.setOptions({maxLines:Infinity});

          let urlToLoad = (self.__expressionAnalysisMode__ ? _traceMember(this, 'getAttribute') : void 0, this.getAttribute('data-knot-url'));
          if ((self.__expressionAnalysisMode__ ? _getLocal(_scope2, 'urlToLoad', urlToLoad) : void 0, urlToLoad) && (self.__expressionAnalysisMode__ ? _getLocal(_scope2, 'urlToLoad', urlToLoad) : void 0, urlToLoad) !== "") {
            if (self.__expressionAnalysisMode__) _traceMember(this, 'loadKnotForURL');

            this.loadKnotForURL((self.__expressionAnalysisMode__ ? _getLocal(_scope2, 'urlToLoad', urlToLoad) : void 0, urlToLoad));
          }

          if (self.__expressionAnalysisMode__) _traceMember(this, 'initAExprs');
          this.initAExprs();
        }

        knotLabel(knot, altText = "no knot label available") {
          let _scope4 = {};

          return (self.__expressionAnalysisMode__ ? _getLocal(_scope4, 'knot', knot) : void 0, knot) && _getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope4, 'knot', knot) : void 0, knot), 'label') instanceof (self.__expressionAnalysisMode__ ? _getGlobal('Function') : void 0, Function) && (self.__expressionAnalysisMode__ ? _traceMember(knot, 'label') : void 0, (self.__expressionAnalysisMode__ ? _getLocal(_scope4, 'knot', knot) : void 0, knot).label()) || (self.__expressionAnalysisMode__ ? _getLocal(_scope4, 'altText', altText) : void 0, altText);
        }

        async initAExprs() {
          let _scope5 = {};
          if (self.__expressionAnalysisMode__) _traceMember(lively, 'success');

          (self.__expressionAnalysisMode__ ? _getGlobal('lively') : void 0, lively).success('setup aexprs');

          let graph = await _getAndCallMember(_getMember(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_templates_knot_view_js'), 'Graph'), 'getInstance', []);
          let tag = await (self.__expressionAnalysisMode__ ? _traceMember(graph, 'requestKnot') : void 0, (self.__expressionAnalysisMode__ ? _getLocal(_scope5, 'graph', graph) : void 0, graph).requestKnot(new (self.__expressionAnalysisMode__ ? _getGlobal('URL') : void 0, URL)(_getMember(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_templates_knot_view_js'), 'TAG_URL'))));

          _getAndCallMember((self.__expressionAnalysisMode__ ? _traceMember(this, 'get') : void 0, this.get('#label-container')), 'appendChild', [_element('h1', _attributes(), _children(_childExpression(_aexpr(() => {
            return self.__expressionAnalysisMode__ ? _traceMember(this, 'knotLabel') : void 0, this.knotLabel(_getMember(this, 'knot'));
          }))), {
            file: 'https://lively-kernel.org/lively4/lively4-stephelm/templates/knot-view.js',
            end: {
              column: 68,
              line: 48
            },
            start: {
              column: 19,
              line: 48
            }
          })]);

          const triples = _getAndCallMember(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_templates_knot_view_js'), 'select', [_getMember(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_templates_knot_view_js'), 'Triple')]);

          _getAndCallMember((self.__expressionAnalysisMode__ ? _traceMember(this, 'get') : void 0, this.get('#r-po-table')), 'appendChild', [_element('tbody', _attributes(), _children(_childSpread(_getAndCallMember((self.__expressionAnalysisMode__ ? _traceMember(triples, 'filter') : void 0, (self.__expressionAnalysisMode__ ? _getLocal(_scope5, 'triples', triples) : void 0, triples).filter(t => {
            let _scope6 = {};
            return _getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope6, 't', t) : void 0, t), 'subject') === _getMember(this, 'knot');
          })), 'map', [t => {
            let _scope7 = {};
            return self.__expressionAnalysisMode__ ? _traceMember(this, 'buildTableRowFor') : void 0, this.buildTableRowFor((self.__expressionAnalysisMode__ ? _getLocal(_scope7, 't', t) : void 0, t), _getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope7, 't', t) : void 0, t), 'predicate'), _getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope7, 't', t) : void 0, t), 'object'));
          }]))), {
            file: 'https://lively-kernel.org/lively4/lively4-stephelm/templates/knot-view.js',
            end: {
              column: 17,
              line: 56
            },
            start: {
              column: 40,
              line: 52
            }
          })]);

          _getAndCallMember((self.__expressionAnalysisMode__ ? _traceMember(this, 'get') : void 0, this.get('#r-so-table')), 'appendChild', [_element('tbody', _attributes(), _children(_childSpread(_getAndCallMember((self.__expressionAnalysisMode__ ? _traceMember(triples, 'filter') : void 0, (self.__expressionAnalysisMode__ ? _getLocal(_scope5, 'triples', triples) : void 0, triples).filter(t => {
            let _scope8 = {};
            return _getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope8, 't', t) : void 0, t), 'predicate') === _getMember(this, 'knot');
          })), 'map', [t => {
            let _scope9 = {};
            return self.__expressionAnalysisMode__ ? _traceMember(this, 'buildTableRowFor') : void 0, this.buildTableRowFor((self.__expressionAnalysisMode__ ? _getLocal(_scope9, 't', t) : void 0, t), _getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope9, 't', t) : void 0, t), 'subject'), _getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope9, 't', t) : void 0, t), 'object'));
          }]))), {
            file: 'https://lively-kernel.org/lively4/lively4-stephelm/templates/knot-view.js',
            end: {
              column: 17,
              line: 62
            },
            start: {
              column: 40,
              line: 58
            }
          })]);

          _getAndCallMember((self.__expressionAnalysisMode__ ? _traceMember(this, 'get') : void 0, this.get('#r-sp-table')), 'appendChild', [_element('tbody', _attributes(), _children(_childSpread(_getAndCallMember((self.__expressionAnalysisMode__ ? _traceMember(triples, 'filter') : void 0, (self.__expressionAnalysisMode__ ? _getLocal(_scope5, 'triples', triples) : void 0, triples).filter(t => {
            let _scope10 = {};
            return _getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope10, 't', t) : void 0, t), 'object') === _getMember(this, 'knot');
          })), 'map', [t => {
            let _scope11 = {};
            return self.__expressionAnalysisMode__ ? _traceMember(this, 'buildTableRowFor') : void 0, this.buildTableRowFor((self.__expressionAnalysisMode__ ? _getLocal(_scope11, 't', t) : void 0, t), _getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope11, 't', t) : void 0, t), 'subject'), _getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope11, 't', t) : void 0, t), 'predicate'));
          }]))), {
            file: 'https://lively-kernel.org/lively4/lively4-stephelm/templates/knot-view.js',
            end: {
              column: 17,
              line: 68
            },
            start: {
              column: 40,
              line: 64
            }
          })]);
        }

        buildMetadata(knot) {
          let _scope12 = {};

          const metadataTable = (self.__expressionAnalysisMode__ ? _traceMember(this, 'get') : void 0, this.get("#metadata-table"));
          _setMember((self.__expressionAnalysisMode__ ? _getLocal(_scope12, 'metadataTable', metadataTable) : void 0, metadataTable), 'innerHTML', "");

          _getAndCallMember((self.__expressionAnalysisMode__ ? _traceMember(Object, 'entries') : void 0, (self.__expressionAnalysisMode__ ? _getGlobal('Object') : void 0, Object).entries((self.__expressionAnalysisMode__ ? _traceMember(knot, 'getMetadata') : void 0, (self.__expressionAnalysisMode__ ? _getLocal(_scope12, 'knot', knot) : void 0, knot).getMetadata()))), 'forEach', [entry => {
            let _scope13 = {};

            const key = _getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope13, 'entry', entry) : void 0, entry), 0);
            const value = _getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope13, 'entry', entry) : void 0, entry), 1);
            // for (const [key, value] of Object.entries(knot.getMetadata())) {
            if (self.__expressionAnalysisMode__) _traceMember(metadataTable, 'appendChild');
            (self.__expressionAnalysisMode__ ? _getLocal(_scope12, 'metadataTable', metadataTable) : void 0, metadataTable).appendChild(_element('tr', _attributes(), _children((self.__expressionAnalysisMode__ ? _getGlobal('_childText') : void 0, _childText)('\n        '), (self.__expressionAnalysisMode__ ? _getGlobal('_childElement') : void 0, _childElement)(_element('td', _attributes(), _children(_childExpression((self.__expressionAnalysisMode__ ? _getLocal(_scope13, 'key', key) : void 0, key))), {
              file: 'https://lively-kernel.org/lively4/lively4-stephelm/templates/knot-view.js',
              end: {
                column: 22,
                line: 80
              },
              start: {
                column: 8,
                line: 80
              }
            })), _childText('\n        '), _childElement(_element('td', _attributes(), _children(_childExpression((self.__expressionAnalysisMode__ ? _getLocal(_scope13, 'value', value) : void 0, value))), {
              file: 'https://lively-kernel.org/lively4/lively4-stephelm/templates/knot-view.js',
              end: {
                column: 24,
                line: 81
              },
              start: {
                column: 8,
                line: 81
              }
            })), _childText('\n      ')), {
              file: 'https://lively-kernel.org/lively4/lively4-stephelm/templates/knot-view.js',
              end: {
                column: 11,
                line: 82
              },
              start: {
                column: 32,
                line: 79
              }
            }));
            // }
          }]);
        }

        buildNavigatableLinkFor(knot) {
          let _scope14 = {};

          return _element('a', _attributes(_attributeExpression('click', e => {
            return self.__expressionAnalysisMode__ ? _traceMember(this, 'loadKnotForURL') : void 0, this.loadKnotForURL(_getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope14, 'knot', knot) : void 0, knot), 'fileName'));
          })), _children(_childText('\n      '), _childExpression((self.__expressionAnalysisMode__ ? _traceMember(knot, 'label') : void 0, (self.__expressionAnalysisMode__ ? _getLocal(_scope14, 'knot', knot) : void 0, knot).label())), _childText('\n    ')), {
            file: 'https://lively-kernel.org/lively4/lively4-stephelm/templates/knot-view.js',
            end: {
              column: 8,
              line: 90
            },
            start: {
              column: 11,
              line: 88
            }
          });
        }
        buildRefFor(knot) {
          let _scope15 = {};

          return self.__expressionAnalysisMode__ ? _traceMember(this, 'buildNavigatableLinkFor') : void 0, this.buildNavigatableLinkFor((self.__expressionAnalysisMode__ ? _getLocal(_scope15, 'knot', knot) : void 0, knot));
        }
        buildTableDataFor(knot) {
          let _scope16 = {};

          return _element('td', _attributes(), _children(_childText('\n      '), _childExpression((self.__expressionAnalysisMode__ ? _traceMember(this, 'buildRefFor') : void 0, this.buildRefFor((self.__expressionAnalysisMode__ ? _getLocal(_scope16, 'knot', knot) : void 0, knot)))), _childText('\n      '), _childElement(_element('i', _attributes(_attributeStringLiteral('class', 'fa fa-search'), _attributeExpression('click', e => {
            if (self.__expressionAnalysisMode__) _traceMember(lively, 'openInspector');

            (self.__expressionAnalysisMode__ ? _getGlobal('lively') : void 0, lively).openInspector((self.__expressionAnalysisMode__ ? _getLocal(_scope16, 'knot', knot) : void 0, knot), (self.__expressionAnalysisMode__ ? _getGlobal('undefined') : void 0, undefined), (self.__expressionAnalysisMode__ ? _traceMember(knot, 'label') : void 0, (self.__expressionAnalysisMode__ ? _getLocal(_scope16, 'knot', knot) : void 0, knot).label()));
          })), _children(), {
            file: 'https://lively-kernel.org/lively4/lively4-stephelm/templates/knot-view.js',
            end: {
              column: 13,
              line: 100
            },
            start: {
              column: 6,
              line: 98
            }
          })), _childText('\n    ')), {
            file: 'https://lively-kernel.org/lively4/lively4-stephelm/templates/knot-view.js',
            end: {
              column: 9,
              line: 101
            },
            start: {
              column: 11,
              line: 96
            }
          });
        }
        buildTableRowFor(triple, knot1, knot2) {
          let _scope17 = {};

          return _element('tr', _attributes(), _children(_childText('\n      '), _childExpression((self.__expressionAnalysisMode__ ? _traceMember(this, 'buildTableDataFor') : void 0, this.buildTableDataFor((self.__expressionAnalysisMode__ ? _getLocal(_scope17, 'knot1', knot1) : void 0, knot1)))), _childText('\n      '), _childExpression((self.__expressionAnalysisMode__ ? _traceMember(this, 'buildTableDataFor') : void 0, this.buildTableDataFor((self.__expressionAnalysisMode__ ? _getLocal(_scope17, 'knot2', knot2) : void 0, knot2)))), _childText('\n      '), _childExpression((self.__expressionAnalysisMode__ ? _traceMember(this, 'buildTableDataFor') : void 0, this.buildTableDataFor((self.__expressionAnalysisMode__ ? _getLocal(_scope17, 'triple', triple) : void 0, triple)))), _childText('\n    ')), {
            file: 'https://lively-kernel.org/lively4/lively4-stephelm/templates/knot-view.js',
            end: {
              column: 9,
              line: 108
            },
            start: {
              column: 11,
              line: 104
            }
          });
        }
        async replaceTableBodyFor(selector, s, p, o, propForFirstCell, propForSecondCell) {
          let _scope18 = {};

          let graph = await _getAndCallMember(_getMember(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_templates_knot_view_js'), 'Graph'), 'getInstance', []);
          let poTableBody = (self.__expressionAnalysisMode__ ? _traceMember(this, 'get') : void 0, this.get((self.__expressionAnalysisMode__ ? _getLocal(_scope18, 'selector', selector) : void 0, selector) + ' tbody'));
          _setMember((self.__expressionAnalysisMode__ ? _getLocal(_scope18, 'poTableBody', poTableBody) : void 0, poTableBody), 'innerHTML', "");
          _getAndCallMember((self.__expressionAnalysisMode__ ? _traceMember(graph, 'query') : void 0, (self.__expressionAnalysisMode__ ? _getLocal(_scope18, 'graph', graph) : void 0, graph).query((self.__expressionAnalysisMode__ ? _getLocal(_scope18, 's', s) : void 0, s), (self.__expressionAnalysisMode__ ? _getLocal(_scope18, 'p', p) : void 0, p), (self.__expressionAnalysisMode__ ? _getLocal(_scope18, 'o', o) : void 0, o))), 'forEach', [triple => {
            let _scope19 = {};
            if (self.__expressionAnalysisMode__) _traceMember(poTableBody, 'appendChild');

            (self.__expressionAnalysisMode__ ? _getLocal(_scope18, 'poTableBody', poTableBody) : void 0, poTableBody).appendChild((self.__expressionAnalysisMode__ ? _traceMember(this, 'buildTableRowFor') : void 0, this.buildTableRowFor((self.__expressionAnalysisMode__ ? _getLocal(_scope19, 'triple', triple) : void 0, triple), _getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope19, 'triple', triple) : void 0, triple), (self.__expressionAnalysisMode__ ? _getLocal(_scope18, 'propForFirstCell', propForFirstCell) : void 0, propForFirstCell)), _getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope19, 'triple', triple) : void 0, triple), (self.__expressionAnalysisMode__ ? _getLocal(_scope18, 'propForSecondCell', propForSecondCell) : void 0, propForSecondCell)))));
          }]);
        }

        async loadKnotForURL(url) {
          let _scope20 = {};

          return self.__expressionAnalysisMode__ ? _traceMember(this, 'loadKnot') : void 0, this.loadKnot((self.__expressionAnalysisMode__ ? _getLocal(_scope20, 'url', url) : void 0, url));
        }
        async loadKnot(url) {
          let _scope21 = {};

          let graph = await _getAndCallMember(_getMember(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_templates_knot_view_js'), 'Graph'), 'getInstance', []);
          let knot = await (self.__expressionAnalysisMode__ ? _traceMember(graph, 'requestKnot') : void 0, (self.__expressionAnalysisMode__ ? _getLocal(_scope21, 'graph', graph) : void 0, graph).requestKnot(new (self.__expressionAnalysisMode__ ? _getGlobal('URL') : void 0, URL)((self.__expressionAnalysisMode__ ? _getLocal(_scope21, 'url', url) : void 0, url))));
          _setMember(this, 'knot', (self.__expressionAnalysisMode__ ? _getLocal(_scope21, 'knot', knot) : void 0, knot));

          _setMember((self.__expressionAnalysisMode__ ? _traceMember(this, 'get') : void 0, this.get("#path-to-load")), 'value', _getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope21, 'knot', knot) : void 0, knot), 'url'));

          let deleteKnot = (self.__expressionAnalysisMode__ ? _traceMember(this, 'get') : void 0, this.get('#delete-button'));
          _setMember((self.__expressionAnalysisMode__ ? _getLocal(_scope21, 'deleteKnot', deleteKnot) : void 0, deleteKnot), 'onclick', event => {
            let _scope22 = {};
            return self.__expressionAnalysisMode__ ? _traceMember(this, 'deleteKnot') : void 0, this.deleteKnot((self.__expressionAnalysisMode__ ? _getLocal(_scope22, 'event', event) : void 0, event));
          });

          // URLs
          let urlList = (self.__expressionAnalysisMode__ ? _traceMember(this, 'get') : void 0, this.get("#url-list"));
          _setMember((self.__expressionAnalysisMode__ ? _getLocal(_scope21, 'urlList', urlList) : void 0, urlList), 'innerHTML', "");
          _getAndCallMember((self.__expressionAnalysisMode__ ? _traceMember(graph, 'getUrlsByKnot') : void 0, (self.__expressionAnalysisMode__ ? _getLocal(_scope21, 'graph', graph) : void 0, graph).getUrlsByKnot((self.__expressionAnalysisMode__ ? _getLocal(_scope21, 'knot', knot) : void 0, knot))), 'forEach', [url => {
            let _scope24 = {};

            function isExternalLink(url) {
              let _scope23 = {};

              try {
                return _getAndCallMember(_getMember(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_templates_knot_view_js'), 'Graph'), 'isExternalURL', [new (self.__expressionAnalysisMode__ ? _getGlobal('URL') : void 0, URL)((self.__expressionAnalysisMode__ ? _getLocal(_scope23, 'url', url) : void 0, url))]);
              } catch (e) {
                return false;
              }
            }

            async function followURL(e) {
              let _scope26 = {};

              if ((self.__expressionAnalysisMode__ ? _getLocal(_scope24, 'isExternalLink', isExternalLink) : void 0, isExternalLink)((self.__expressionAnalysisMode__ ? _getLocal(_scope24, 'url', url) : void 0, url))) {
                if (self.__expressionAnalysisMode__) _traceMember(window, 'open');

                (self.__expressionAnalysisMode__ ? _getGlobal('window') : void 0, window).open((self.__expressionAnalysisMode__ ? _getLocal(_scope24, 'url', url) : void 0, url));
              } else {
                let _scope25 = {};

                const container = await (self.__expressionAnalysisMode__ ? _traceMember(lively, 'openBrowser') : void 0, (self.__expressionAnalysisMode__ ? _getGlobal('lively') : void 0, lively).openBrowser((self.__expressionAnalysisMode__ ? _getLocal(_scope24, 'url', url) : void 0, url), false));
                if (self.__expressionAnalysisMode__) _traceMember(container, 'focus');
                (self.__expressionAnalysisMode__ ? _getLocal(_scope25, 'container', container) : void 0, container).focus();
              }
              if (self.__expressionAnalysisMode__) _traceMember(e, 'preventDefault');
              (self.__expressionAnalysisMode__ ? _getLocal(_scope26, 'e', e) : void 0, e).preventDefault();
              if (self.__expressionAnalysisMode__) _traceMember(e, 'stopPropagation');
              (self.__expressionAnalysisMode__ ? _getLocal(_scope26, 'e', e) : void 0, e).stopPropagation();
              return true;
            }

            if (self.__expressionAnalysisMode__) _traceMember(urlList, 'appendChild');
            (self.__expressionAnalysisMode__ ? _getLocal(_scope21, 'urlList', urlList) : void 0, urlList).appendChild(_element('li', _attributes(_attributeExpression('click', (self.__expressionAnalysisMode__ ? _getLocal(_scope24, 'followURL', followURL) : void 0, followURL))), _children(_childText('\n        '), _childExpression((self.__expressionAnalysisMode__ ? _getLocal(_scope24, 'isExternalLink', isExternalLink) : void 0, isExternalLink)((self.__expressionAnalysisMode__ ? _getLocal(_scope24, 'url', url) : void 0, url)) ? (self.__expressionAnalysisMode__ ? _getLocal(_scope24, 'url', url) : void 0, url) + '<i class="fa fa-external-link"></i>' : (self.__expressionAnalysisMode__ ? _getLocal(_scope24, 'url', url) : void 0, url)), _childText('\n      ')), {
              file: 'https://lively-kernel.org/lively4/lively4-stephelm/templates/knot-view.js',
              end: {
                column: 11,
                line: 167
              },
              start: {
                column: 26,
                line: 162
              }
            }));
          }]);

          // Tags
          let tag = await (self.__expressionAnalysisMode__ ? _traceMember(graph, 'requestKnot') : void 0, (self.__expressionAnalysisMode__ ? _getLocal(_scope21, 'graph', graph) : void 0, graph).requestKnot(new (self.__expressionAnalysisMode__ ? _getGlobal('URL') : void 0, URL)(_getMember(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_templates_knot_view_js'), 'TAG_URL'))));
          let tagContainer = (self.__expressionAnalysisMode__ ? _traceMember(this, 'get') : void 0, this.get('#tag-container'));
          _setMember((self.__expressionAnalysisMode__ ? _getLocal(_scope21, 'tagContainer', tagContainer) : void 0, tagContainer), 'innerHTML', "");
          _getAndCallMember((self.__expressionAnalysisMode__ ? _traceMember(graph, 'query') : void 0, (self.__expressionAnalysisMode__ ? _getLocal(_scope21, 'graph', graph) : void 0, graph).query((self.__expressionAnalysisMode__ ? _getLocal(_scope21, 'knot', knot) : void 0, knot), (self.__expressionAnalysisMode__ ? _getLocal(_scope21, 'tag', tag) : void 0, tag), _getMember(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_templates_knot_view_js'), '_'))), 'forEach', [triple => {
            let _scope27 = {};

            let tagElement = (self.__expressionAnalysisMode__ ? _traceMember(this, 'buildTagWidget') : void 0, this.buildTagWidget(_getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope27, 'triple', triple) : void 0, triple), 'object'), (self.__expressionAnalysisMode__ ? _getLocal(_scope27, 'triple', triple) : void 0, triple)));
            if (self.__expressionAnalysisMode__) _traceMember(tagContainer, 'appendChild');
            (self.__expressionAnalysisMode__ ? _getLocal(_scope21, 'tagContainer', tagContainer) : void 0, tagContainer).appendChild((self.__expressionAnalysisMode__ ? _getLocal(_scope27, 'tagElement', tagElement) : void 0, tagElement));
          }]);
          _setMember((self.__expressionAnalysisMode__ ? _traceMember(this, 'get') : void 0, this.get('#add-tag')), 'onclick', event => {
            let _scope28 = {};
            return self.__expressionAnalysisMode__ ? _traceMember(this, 'addTag') : void 0, this.addTag((self.__expressionAnalysisMode__ ? _getLocal(_scope28, 'event', event) : void 0, event));
          });

          // spo tables
          // this.replaceTableBodyFor('#po-table', knot, _, _, 'predicate', 'object');
          // this.replaceTableBodyFor('#so-table', _, knot, _, 'subject', 'object');
          // this.replaceTableBodyFor('#sp-table', _, _, knot, 'subject', 'predicate');

          // add button behavior
          _setMember((self.__expressionAnalysisMode__ ? _traceMember(this, 'get') : void 0, this.get('#r-add-triple-as-subject')), 'onclick', evt => {
            let _scope29 = {};
            return self.__expressionAnalysisMode__ ? _traceMember(this, 'addTripleWithKnotAsSubject') : void 0, this.addTripleWithKnotAsSubject((self.__expressionAnalysisMode__ ? _getLocal(_scope29, 'evt', evt) : void 0, evt));
          });
          _setMember((self.__expressionAnalysisMode__ ? _traceMember(this, 'get') : void 0, this.get('#r-add-triple-as-predicate')), 'onclick', evt => {
            let _scope30 = {};
            return self.__expressionAnalysisMode__ ? _traceMember(this, 'addTripleWithKnotAsPredicate') : void 0, this.addTripleWithKnotAsPredicate((self.__expressionAnalysisMode__ ? _getLocal(_scope30, 'evt', evt) : void 0, evt));
          });
          _setMember((self.__expressionAnalysisMode__ ? _traceMember(this, 'get') : void 0, this.get('#r-add-triple-as-object')), 'onclick', evt => {
            let _scope31 = {};
            return self.__expressionAnalysisMode__ ? _traceMember(this, 'addTripleWithKnotAsObject') : void 0, this.addTripleWithKnotAsObject((self.__expressionAnalysisMode__ ? _getLocal(_scope31, 'evt', evt) : void 0, evt));
          });

          // metadata
          //this.buildMetadata(knot);

          // content
          if (self.__expressionAnalysisMode__) _traceMember(this, 'buildContentFor');
          this.buildContentFor((self.__expressionAnalysisMode__ ? _getLocal(_scope21, 'knot', knot) : void 0, knot));
        }

        buildTagWidget(tag, triple) {
          let _scope32 = {};

          return _element('div', _attributes(), _children(_childText('\n      '), _childExpression((self.__expressionAnalysisMode__ ? _traceMember(this, 'buildNavigatableLinkFor') : void 0, this.buildNavigatableLinkFor((self.__expressionAnalysisMode__ ? _getLocal(_scope32, 'tag', tag) : void 0, tag)))), _childText('\n      '), _childExpression((self.__expressionAnalysisMode__ ? _traceMember(this, 'buildDeleteTagElement') : void 0, this.buildDeleteTagElement((self.__expressionAnalysisMode__ ? _getLocal(_scope32, 'triple', triple) : void 0, triple)))), _childText('\n    ')), {
            file: 'https://lively-kernel.org/lively4/lively4-stephelm/templates/knot-view.js',
            end: {
              column: 10,
              line: 202
            },
            start: {
              column: 11,
              line: 199
            }
          });
        }
        buildDeleteTagElement(triple) {
          let _scope33 = {};

          return _element('i', _attributes(_attributeStringLiteral('class', 'fa fa-trash'), _attributeExpression('click', e => {
            if (self.__expressionAnalysisMode__) _traceMember(this, 'deleteTagTriple');

            this.deleteTagTriple((self.__expressionAnalysisMode__ ? _getLocal(_scope33, 'triple', triple) : void 0, triple));
          })), _children(), {
            file: 'https://lively-kernel.org/lively4/lively4-stephelm/templates/knot-view.js',
            end: {
              column: 11,
              line: 207
            },
            start: {
              column: 11,
              line: 205
            }
          });
        }
        async deleteTagTriple(triple) {
          let _scope34 = {};

          const graph = await _getAndCallMember(_getMember(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_templates_knot_view_js'), 'Graph'), 'getInstance', []);
          const knot = await (self.__expressionAnalysisMode__ ? _traceMember(graph, 'requestKnot') : void 0, (self.__expressionAnalysisMode__ ? _getLocal(_scope34, 'graph', graph) : void 0, graph).requestKnot(new (self.__expressionAnalysisMode__ ? _getGlobal('URL') : void 0, URL)(_getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope34, 'triple', triple) : void 0, triple), 'fileName'))));

          if (await (self.__expressionAnalysisMode__ ? _traceMember(graph, 'deleteKnot') : void 0, (self.__expressionAnalysisMode__ ? _getLocal(_scope34, 'graph', graph) : void 0, graph).deleteKnot((self.__expressionAnalysisMode__ ? _getLocal(_scope34, 'knot', knot) : void 0, knot)))) {
            if (self.__expressionAnalysisMode__) _traceMember(this, 'refresh');

            this.refresh();
          } else {
            if (self.__expressionAnalysisMode__) _traceMember(lively, 'notify');

            (self.__expressionAnalysisMode__ ? _getGlobal('lively') : void 0, lively).notify(`did not delete tag ${_getMember(_getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope34, 'triple', triple) : void 0, triple), 'object'), 'fileName')}`);
          }
        }

        refresh() {
          if (self.__expressionAnalysisMode__) _traceMember(this, 'loadKnot');

          this.loadKnot(_getMember(this, 'urlString'));
        }
        async deleteKnot() {
          let _scope35 = {};

          const graph = await _getAndCallMember(_getMember(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_templates_knot_view_js'), 'Graph'), 'getInstance', []);
          const knot = await (self.__expressionAnalysisMode__ ? _traceMember(graph, 'requestKnot') : void 0, (self.__expressionAnalysisMode__ ? _getLocal(_scope35, 'graph', graph) : void 0, graph).requestKnot(new (self.__expressionAnalysisMode__ ? _getGlobal('URL') : void 0, URL)(_getMember(this, 'urlString'))));

          if (await (self.__expressionAnalysisMode__ ? _traceMember(graph, 'deleteKnot') : void 0, (self.__expressionAnalysisMode__ ? _getLocal(_scope35, 'graph', graph) : void 0, graph).deleteKnot((self.__expressionAnalysisMode__ ? _getLocal(_scope35, 'knot', knot) : void 0, knot)))) {
            let _scope36 = {};

            const elementToRemove = _getMember(_getMember(this, 'parentElement'), 'isWindow') ? _getMember(this, 'parentElement') : this;
            if (self.__expressionAnalysisMode__) _traceMember(elementToRemove, 'remove');
            (self.__expressionAnalysisMode__ ? _getLocal(_scope36, 'elementToRemove', elementToRemove) : void 0, elementToRemove).remove();
          } else {
            if (self.__expressionAnalysisMode__) _traceMember(lively, 'notify');

            (self.__expressionAnalysisMode__ ? _getGlobal('lively') : void 0, lively).notify(`did not delete knot ${_getMember(this, 'urlString')}`);
          }
        }

        async createAddTriple() {
          let _scope37 = {};

          const addTriple = await (self.__expressionAnalysisMode__ ? _traceMember(lively, 'openComponentInWindow') : void 0, (self.__expressionAnalysisMode__ ? _getGlobal('lively') : void 0, lively).openComponentInWindow("add-triple"));
          _setMember((self.__expressionAnalysisMode__ ? _getLocal(_scope37, 'addTriple', addTriple) : void 0, addTriple), 'afterSubmit', () => {
            _getAndCallMember(_getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope37, 'addTriple', addTriple) : void 0, addTriple), 'parentElement'), 'remove', []);
            if (self.__expressionAnalysisMode__) _traceMember(this, 'refresh');
            this.refresh();
          });
          return self.__expressionAnalysisMode__ ? _getLocal(_scope37, 'addTriple', addTriple) : void 0, addTriple;
        }
        async addTag(event) {
          let _scope38 = {};

          const addTriple = await (self.__expressionAnalysisMode__ ? _traceMember(this, 'createAddTriple') : void 0, this.createAddTriple());

          if (self.__expressionAnalysisMode__) _traceMember(addTriple, 'setField');
          (self.__expressionAnalysisMode__ ? _getLocal(_scope38, 'addTriple', addTriple) : void 0, addTriple).setField('subject', _getMember(this, 'urlString'));
          if (self.__expressionAnalysisMode__) _traceMember(addTriple, 'setField');
          (self.__expressionAnalysisMode__ ? _getLocal(_scope38, 'addTriple', addTriple) : void 0, addTriple).setField('predicate', _getMember(this, 'tagURLString'));
          if (self.__expressionAnalysisMode__) _traceMember(addTriple, 'focus');
          (self.__expressionAnalysisMode__ ? _getLocal(_scope38, 'addTriple', addTriple) : void 0, addTriple).focus('object');
        }

        async addTripleWithKnotAsSubject() {
          let _scope39 = {};

          const addTriple = await (self.__expressionAnalysisMode__ ? _traceMember(this, 'createAddTriple') : void 0, this.createAddTriple());

          if (self.__expressionAnalysisMode__) _traceMember(addTriple, 'setField');
          (self.__expressionAnalysisMode__ ? _getLocal(_scope39, 'addTriple', addTriple) : void 0, addTriple).setField('subject', _getMember(this, 'urlString'));
          if (self.__expressionAnalysisMode__) _traceMember(addTriple, 'focus');
          (self.__expressionAnalysisMode__ ? _getLocal(_scope39, 'addTriple', addTriple) : void 0, addTriple).focus('predicate');
        }

        async addTripleWithKnotAsPredicate() {
          let _scope40 = {};

          const addTriple = await (self.__expressionAnalysisMode__ ? _traceMember(this, 'createAddTriple') : void 0, this.createAddTriple());

          if (self.__expressionAnalysisMode__) _traceMember(addTriple, 'setField');
          (self.__expressionAnalysisMode__ ? _getLocal(_scope40, 'addTriple', addTriple) : void 0, addTriple).setField('predicate', _getMember(this, 'urlString'));
          if (self.__expressionAnalysisMode__) _traceMember(addTriple, 'focus');
          (self.__expressionAnalysisMode__ ? _getLocal(_scope40, 'addTriple', addTriple) : void 0, addTriple).focus('subject');
        }

        async addTripleWithKnotAsObject() {
          let _scope41 = {};

          const addTriple = await (self.__expressionAnalysisMode__ ? _traceMember(this, 'createAddTriple') : void 0, this.createAddTriple());

          if (self.__expressionAnalysisMode__) _traceMember(addTriple, 'setField');
          (self.__expressionAnalysisMode__ ? _getLocal(_scope41, 'addTriple', addTriple) : void 0, addTriple).setField('object', _getMember(this, 'urlString'));
          if (self.__expressionAnalysisMode__) _traceMember(addTriple, 'focus');
          (self.__expressionAnalysisMode__ ? _getLocal(_scope41, 'addTriple', addTriple) : void 0, addTriple).focus('subject');
        }

        buildListItemFor(knot, role) {
          let _scope42 = {};

          return _element('li', _attributes(), _children(_childExpression((self.__expressionAnalysisMode__ ? _getLocal(_scope42, 'role', role) : void 0, role)), _childText(': '), _childExpression((self.__expressionAnalysisMode__ ? _traceMember(this, 'buildRefFor') : void 0, this.buildRefFor((self.__expressionAnalysisMode__ ? _getLocal(_scope42, 'knot', knot) : void 0, knot))))), {
            file: 'https://lively-kernel.org/lively4/lively4-stephelm/templates/knot-view.js',
            end: {
              column: 52,
              line: 273
            },
            start: {
              column: 11,
              line: 273
            }
          });
        }
        async buildContentFor(knot) {
          let _scope43 = {};

          let editorComp = (self.__expressionAnalysisMode__ ? _traceMember(this, 'get') : void 0, this.get('#content-editor'));
          if (self.__expressionAnalysisMode__) _traceMember(lively, 'removeEventListener');
          (self.__expressionAnalysisMode__ ? _getGlobal('lively') : void 0, lively).removeEventListener('knot-view-editor', (self.__expressionAnalysisMode__ ? _getLocal(_scope43, 'editorComp', editorComp) : void 0, editorComp), 'change');
          let spoList = (self.__expressionAnalysisMode__ ? _traceMember(this, 'get') : void 0, this.get('#spo-list'));
          if (self.__expressionAnalysisMode__ ? _traceMember(knot, 'isTriple') : void 0, (self.__expressionAnalysisMode__ ? _getLocal(_scope43, 'knot', knot) : void 0, knot).isTriple()) {
            if (self.__expressionAnalysisMode__) _traceMember(this, 'hide');

            this.hide((self.__expressionAnalysisMode__ ? _getLocal(_scope43, 'editorComp', editorComp) : void 0, editorComp));
            if (self.__expressionAnalysisMode__) _traceMember(this, 'show');
            this.show((self.__expressionAnalysisMode__ ? _getLocal(_scope43, 'spoList', spoList) : void 0, spoList));
            _setMember((self.__expressionAnalysisMode__ ? _getLocal(_scope43, 'spoList', spoList) : void 0, spoList), 'innerHTML', '');
            if (self.__expressionAnalysisMode__) _traceMember(spoList, 'appendChild');
            (self.__expressionAnalysisMode__ ? _getLocal(_scope43, 'spoList', spoList) : void 0, spoList).appendChild((self.__expressionAnalysisMode__ ? _traceMember(this, 'buildListItemFor') : void 0, this.buildListItemFor(_getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope43, 'knot', knot) : void 0, knot), 'subject'), 'Subject')));
            if (self.__expressionAnalysisMode__) _traceMember(spoList, 'appendChild');
            (self.__expressionAnalysisMode__ ? _getLocal(_scope43, 'spoList', spoList) : void 0, spoList).appendChild((self.__expressionAnalysisMode__ ? _traceMember(this, 'buildListItemFor') : void 0, this.buildListItemFor(_getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope43, 'knot', knot) : void 0, knot), 'predicate'), 'Predicate')));
            if (self.__expressionAnalysisMode__) _traceMember(spoList, 'appendChild');
            (self.__expressionAnalysisMode__ ? _getLocal(_scope43, 'spoList', spoList) : void 0, spoList).appendChild((self.__expressionAnalysisMode__ ? _traceMember(this, 'buildListItemFor') : void 0, this.buildListItemFor(_getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope43, 'knot', knot) : void 0, knot), 'object'), 'Object')));
          } else {
            let _scope44 = {};
            if (self.__expressionAnalysisMode__) _traceMember(this, 'show');

            this.show((self.__expressionAnalysisMode__ ? _getLocal(_scope43, 'editorComp', editorComp) : void 0, editorComp));
            if (self.__expressionAnalysisMode__) _traceMember(this, 'hide');
            this.hide((self.__expressionAnalysisMode__ ? _getLocal(_scope43, 'spoList', spoList) : void 0, spoList));
            if (_getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope43, 'editorComp', editorComp) : void 0, editorComp), 'value') !== _getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope43, 'knot', knot) : void 0, knot), 'content')) {
              _setMember((self.__expressionAnalysisMode__ ? _getLocal(_scope43, 'editorComp', editorComp) : void 0, editorComp), 'value', _getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope43, 'knot', knot) : void 0, knot), 'content'));
            }
            if (self.__expressionAnalysisMode__) _traceMember(editorComp, 'enableAutocompletion');
            (self.__expressionAnalysisMode__ ? _getLocal(_scope43, 'editorComp', editorComp) : void 0, editorComp).enableAutocompletion();

            let graph = await _getAndCallMember(_getMember(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_templates_knot_view_js'), 'Graph'), 'getInstance', []);
            let urls = (self.__expressionAnalysisMode__ ? _traceMember(graph, 'getUrlsByKnot') : void 0, (self.__expressionAnalysisMode__ ? _getLocal(_scope44, 'graph', graph) : void 0, graph).getUrlsByKnot((self.__expressionAnalysisMode__ ? _getLocal(_scope43, 'knot', knot) : void 0, knot)));
            if (_getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope44, 'urls', urls) : void 0, urls), 'length') >= 1) {
              if (self.__expressionAnalysisMode__) _traceMember(editorComp, 'changeModeForFile');

              (self.__expressionAnalysisMode__ ? _getLocal(_scope43, 'editorComp', editorComp) : void 0, editorComp).changeModeForFile(_getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope44, 'urls', urls) : void 0, urls), 0));
            } else {
              if (self.__expressionAnalysisMode__) _traceMember(lively, 'error');

              (self.__expressionAnalysisMode__ ? _getGlobal('lively') : void 0, lively).error('no url found for ' + (self.__expressionAnalysisMode__ ? _traceMember(knot, 'label') : void 0, (self.__expressionAnalysisMode__ ? _getLocal(_scope43, 'knot', knot) : void 0, knot).label()));
            }
            const saveKnot = async text => {
              let _scope45 = {};

              await (self.__expressionAnalysisMode__ ? _traceMember(knot, 'save') : void 0, (self.__expressionAnalysisMode__ ? _getLocal(_scope43, 'knot', knot) : void 0, knot).save((self.__expressionAnalysisMode__ ? _getLocal(_scope45, 'text', text) : void 0, text)));
              if (self.__expressionAnalysisMode__) _traceMember(lively, 'notify');
              (self.__expressionAnalysisMode__ ? _getGlobal('lively') : void 0, lively).notify('saved knot'
              // this.refresh();
              );
            };
            _setMember((self.__expressionAnalysisMode__ ? _getLocal(_scope43, 'editorComp', editorComp) : void 0, editorComp), 'doSave', (self.__expressionAnalysisMode__ ? _getLocal(_scope44, 'saveKnot', saveKnot) : void 0, saveKnot));
            const debouncedSave = _getAndCallMember(() => {
              return (self.__expressionAnalysisMode__ ? _getLocal(_scope44, 'saveKnot', saveKnot) : void 0, saveKnot)(_getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope43, 'editorComp', editorComp) : void 0, editorComp), 'value'));
            }, 'debounce', [2000]);
            if (self.__expressionAnalysisMode__) _traceMember(lively, 'addEventListener');
            (self.__expressionAnalysisMode__ ? _getGlobal('lively') : void 0, lively).addEventListener('knot-view-editor', (self.__expressionAnalysisMode__ ? _getLocal(_scope43, 'editorComp', editorComp) : void 0, editorComp), 'change', (self.__expressionAnalysisMode__ ? _getLocal(_scope44, 'debouncedSave', debouncedSave) : void 0, debouncedSave));
          }
        }

        hide(element) {
          let _scope46 = {};
          _setMember(_getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope46, 'element', element) : void 0, element), 'style'), 'display', "none");
        }
        show(element) {
          let _scope47 = {};
          _setMember(_getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope47, 'element', element) : void 0, element), 'style'), 'display', "block");
        }

        onPathEntered(path) {
          let _scope48 = {};
          if (self.__expressionAnalysisMode__) _traceMember(this, 'loadKnotForURL');

          this.loadKnotForURL((self.__expressionAnalysisMode__ ? _getLocal(_scope48, 'path', path) : void 0, path));
        }

        livelyPrepareSave() {
          if (self.__expressionAnalysisMode__) _traceMember(this, 'setAttribute');

          this.setAttribute("data-knot-url", _getMember(this, 'urlString'));
        }
      }

      _export('default', KnotView);

      _setMember(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_templates_knot_view_js'), 'KnotView', (self.__expressionAnalysisMode__ ? _getLocal(_scope, 'KnotView', KnotView) : void 0, KnotView));
    }
  };
});