"enable aexpr";

System.register(['active-expression-rewriting', 'reactive-jsx', 'src/components/halo/lively-halo-item.js', 'src/client/vivide/scripts/loading.js'], function (_export, _context) {
  "use strict";

  var _setMember, _getAndCallMember, _setLocal, _getLocal, _getGlobal, _getMember, _traceMember, _childExpression, _children, _attributeExpression, _attributes, _element, HaloItem, getMatches, setScript;

  return {
    setters: [function (_activeExpressionRewriting) {
      _setMember = _activeExpressionRewriting.setMember;
      _getAndCallMember = _activeExpressionRewriting.getAndCallMember;
      _setLocal = _activeExpressionRewriting.setLocal;
      _getLocal = _activeExpressionRewriting.getLocal;
      _getGlobal = _activeExpressionRewriting.getGlobal;
      _getMember = _activeExpressionRewriting.getMember;
      _traceMember = _activeExpressionRewriting.traceMember;
    }, function (_reactiveJsx) {
      _childExpression = _reactiveJsx.childExpression;
      _children = _reactiveJsx.children;
      _attributeExpression = _reactiveJsx.attributeExpression;
      _attributes = _reactiveJsx.attributes;
      _element = _reactiveJsx.element;
    }, function (_srcComponentsHaloLivelyHaloItemJs) {
      HaloItem = _srcComponentsHaloLivelyHaloItemJs.default;
    }, function (_srcClientVivideScriptsLoadingJs) {
      getMatches = _srcClientVivideScriptsLoadingJs.getMatches;
      setScript = _srcClientVivideScriptsLoadingJs.setScript;
    }],
    execute: function () {
      const __SystemJSRewritingHack = {};
      _recorder_._src_components_halo_lively_halo_vivide_script_suggestion_js = _recorder_._src_components_halo_lively_halo_vivide_script_suggestion_js || {};
      let _scope = {
        isScope: true
      };
      if (self.__expressionAnalysisMode__) _traceMember(Object, 'defineProperty');
      Object.defineProperty(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_src_components_halo_lively_halo_vivide_script_suggestion_js'), 'HaloItem', {
        get() {
          return self.__expressionAnalysisMode__ ? _getLocal(_scope, 'HaloItem', HaloItem) : void 0, HaloItem;
        },

        set(thisIsVererySecretVariableName) {
          let _scope2 = {
            isScope: true
          };
          HaloItem = (thisIsVererySecretVariableName === Object(thisIsVererySecretVariableName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope2, 'thisIsVererySecretVariableName', thisIsVererySecretVariableName) : void 0 : thisIsVererySecretVariableName, thisIsVererySecretVariableName), true ? _setLocal(_scope, 'HaloItem', HaloItem, {
            file: 'https://lively-kernel.org/lively4/lively4-portal/src/components/halo/lively-halo-vivide-script-suggestion.js',
            end: {
              column: 15,
              line: 3
            },
            start: {
              column: 7,
              line: 3
            },
            source: ''
          }) : void 0, HaloItem;
          return true;
        },

        enumerable: true,
        configurable: true
      });
      if (self.__expressionAnalysisMode__) _traceMember(Object, 'defineProperty');
      Object.defineProperty(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_src_components_halo_lively_halo_vivide_script_suggestion_js'), 'setScript', {
        get() {
          return self.__expressionAnalysisMode__ ? _getLocal(_scope, 'setScript', setScript) : void 0, setScript;
        },

        set(thisIsVererySecretVariableName) {
          let _scope3 = {
            isScope: true
          };
          setScript = (thisIsVererySecretVariableName === Object(thisIsVererySecretVariableName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope3, 'thisIsVererySecretVariableName', thisIsVererySecretVariableName) : void 0 : thisIsVererySecretVariableName, thisIsVererySecretVariableName), true ? _setLocal(_scope, 'setScript', setScript, {
            file: 'https://lively-kernel.org/lively4/lively4-portal/src/components/halo/lively-halo-vivide-script-suggestion.js',
            end: {
              column: 30,
              line: 4
            },
            start: {
              column: 21,
              line: 4
            },
            source: ''
          }) : void 0, setScript;
          return true;
        },

        enumerable: true,
        configurable: true
      });
      if (self.__expressionAnalysisMode__) _traceMember(Object, 'defineProperty');
      Object.defineProperty(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_src_components_halo_lively_halo_vivide_script_suggestion_js'), 'getMatches', {
        get() {
          return self.__expressionAnalysisMode__ ? _getLocal(_scope, 'getMatches', getMatches) : void 0, getMatches;
        },

        set(thisIsVererySecretVariableName) {
          let _scope4 = {
            isScope: true
          };
          getMatches = (thisIsVererySecretVariableName === Object(thisIsVererySecretVariableName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope4, 'thisIsVererySecretVariableName', thisIsVererySecretVariableName) : void 0 : thisIsVererySecretVariableName, thisIsVererySecretVariableName), true ? _setLocal(_scope, 'getMatches', getMatches, {
            file: 'https://lively-kernel.org/lively4/lively4-portal/src/components/halo/lively-halo-vivide-script-suggestion.js',
            end: {
              column: 19,
              line: 4
            },
            start: {
              column: 9,
              line: 4
            },
            source: ''
          }) : void 0, getMatches;
          return true;
        },

        enumerable: true,
        configurable: true
      });
      class LivelyHaloVivideScriptSuggestion extends HaloItem {
        initialize() {
          _getAndCallMember(_getAndCallMember(_getMember(this, 'shadowRoot'), 'getElementById', ['suggestion-search']), 'addEventListener', ["keydown", evt => {
            let _scope5 = {
              isScope: true
            };
            if (self.__expressionAnalysisMode__) _traceMember(this, 'updateList');

            this.updateList(_getMember(_getMember((evt === Object(evt) ? self.__expressionAnalysisMode__ ? _getLocal(_scope5, 'evt', evt) : void 0 : evt, evt), 'target'), 'value'));
          }]);
          if (self.__expressionAnalysisMode__) _traceMember(this, 'updateList');
          this.updateList();

          _setMember(this, '__classFilePath__', 'https://lively-kernel.org/lively4/lively4-portal/src/components/halo/lively-halo-vivide-script-suggestion.js', undefined);
        }

        async updateList(search) {
          let _scope6 = {
            isScope: true
          };

          const list = _getAndCallMember(_getMember(this, 'shadowRoot'), 'getElementById', ['suggestion-list']);
          _setMember((list === Object(list) ? self.__expressionAnalysisMode__ ? _getLocal(_scope6, 'list', list) : void 0 : list, list), 'innerHTML', "", {
            file: 'https://lively-kernel.org/lively4/lively4-portal/src/components/halo/lively-halo-vivide-script-suggestion.js',
            end: {
              column: 23,
              line: 16
            },
            start: {
              column: 4,
              line: 16
            },
            source: ''
          });
          if (!_getMember((self.__expressionAnalysisMode__ ? _getGlobal('window') : void 0, window), 'that') || !_getMember(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('window') : void 0, window), 'that'), 'input')) {
            return;
          }const suggestions = await (self.__expressionAnalysisMode__ ? _getLocal(_scope, 'getMatches', getMatches) : void 0, getMatches)((self.__expressionAnalysisMode__ ? _traceMember(JSON, 'stringify') : void 0, (self.__expressionAnalysisMode__ ? _getGlobal('JSON') : void 0, JSON).stringify(_getMember(_getMember(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('window') : void 0, window), 'that'), 'input'), 0), (_, value) => {
            let _scope7 = {
              isScope: true
            };
            return typeof (value === Object(value) ? self.__expressionAnalysisMode__ ? _getLocal(_scope7, 'value', value) : void 0 : value, value) === "object" ? (value === Object(value) ? self.__expressionAnalysisMode__ ? _getLocal(_scope7, 'value', value) : void 0 : value, value) : typeof (value === Object(value) ? self.__expressionAnalysisMode__ ? _getLocal(_scope7, 'value', value) : void 0 : value, value);
          })), (search === Object(search) ? self.__expressionAnalysisMode__ ? _getLocal(_scope6, 'search', search) : void 0 : search, search));
          if (self.__expressionAnalysisMode__) _traceMember(suggestions, 'forEach');
          (suggestions === Object(suggestions) ? self.__expressionAnalysisMode__ ? _getLocal(_scope6, 'suggestions', suggestions) : void 0 : suggestions, suggestions).forEach(s => {
            let _scope8 = {
              isScope: true
            };
            if (self.__expressionAnalysisMode__) _traceMember(list, 'appendChild');

            (list === Object(list) ? self.__expressionAnalysisMode__ ? _getLocal(_scope6, 'list', list) : void 0 : list, list).appendChild(_element('li', _attributes(_attributeExpression('click', () => {
              return (self.__expressionAnalysisMode__ ? _getLocal(_scope, 'setScript', setScript) : void 0, setScript)(_getMember((s === Object(s) ? self.__expressionAnalysisMode__ ? _getLocal(_scope8, 's', s) : void 0 : s, s), 'url'), _getMember((self.__expressionAnalysisMode__ ? _getGlobal('window') : void 0, window), 'that'));
            })), _children(_childExpression(_getMember((s === Object(s) ? self.__expressionAnalysisMode__ ? _getLocal(_scope8, 's', s) : void 0 : s, s), 'name'))), {
              file: 'https://lively-kernel.org/lively4/lively4-portal/src/components/halo/lively-halo-vivide-script-suggestion.js',
              end: {
                column: 84,
                line: 20
              },
              start: {
                column: 23,
                line: 20
              }
            }));
          });
        }
      }

      _export('default', LivelyHaloVivideScriptSuggestion);

      if (self.__expressionAnalysisMode__) _traceMember(Object, 'defineProperty');
      Object.defineProperty(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_src_components_halo_lively_halo_vivide_script_suggestion_js'), 'LivelyHaloVivideScriptSuggestion', {
        get() {
          return self.__expressionAnalysisMode__ ? _getLocal(_scope, 'LivelyHaloVivideScriptSuggestion', LivelyHaloVivideScriptSuggestion) : void 0, LivelyHaloVivideScriptSuggestion;
        },

        set(thisIsVererySecretVariableName) {
          let _scope9 = {
            isScope: true
          };
          _export('default', LivelyHaloVivideScriptSuggestion = (thisIsVererySecretVariableName === Object(thisIsVererySecretVariableName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope9, 'thisIsVererySecretVariableName', thisIsVererySecretVariableName) : void 0 : thisIsVererySecretVariableName, thisIsVererySecretVariableName)), true ? _setLocal(_scope, 'LivelyHaloVivideScriptSuggestion', LivelyHaloVivideScriptSuggestion, {
            file: 'https://lively-kernel.org/lively4/lively4-portal/src/components/halo/lively-halo-vivide-script-suggestion.js',
            end: {
              column: 53,
              line: 6
            },
            start: {
              column: 21,
              line: 6
            },
            source: ''
          }) : void 0, LivelyHaloVivideScriptSuggestion;
          return true;
        },

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