"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 = {};
      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 = {};
          HaloItem = (self.__expressionAnalysisMode__ ? _getLocal(_scope2, 'thisIsVererySecretVariableName', thisIsVererySecretVariableName) : void 0, thisIsVererySecretVariableName), true ? _setLocal(_scope, 'HaloItem', HaloItem) : 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 = {};
          setScript = (self.__expressionAnalysisMode__ ? _getLocal(_scope3, 'thisIsVererySecretVariableName', thisIsVererySecretVariableName) : void 0, thisIsVererySecretVariableName), true ? _setLocal(_scope, 'setScript', setScript) : 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 = {};
          getMatches = (self.__expressionAnalysisMode__ ? _getLocal(_scope4, 'thisIsVererySecretVariableName', thisIsVererySecretVariableName) : void 0, thisIsVererySecretVariableName), true ? _setLocal(_scope, 'getMatches', getMatches) : 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 = {};
            if (self.__expressionAnalysisMode__) _traceMember(this, 'updateList');

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

        async updateList(search) {
          let _scope6 = {};

          const list = _getAndCallMember(_getMember(this, 'shadowRoot'), 'getElementById', ['suggestion-list']);
          _setMember((self.__expressionAnalysisMode__ ? _getLocal(_scope6, 'list', list) : void 0, list), 'innerHTML', "");
          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 = {};
            return typeof (self.__expressionAnalysisMode__ ? _getLocal(_scope7, 'value', value) : void 0, value) === "object" ? (self.__expressionAnalysisMode__ ? _getLocal(_scope7, 'value', value) : void 0, value) : typeof (self.__expressionAnalysisMode__ ? _getLocal(_scope7, 'value', value) : void 0, value);
          })), (self.__expressionAnalysisMode__ ? _getLocal(_scope6, 'search', search) : void 0, search));
          if (self.__expressionAnalysisMode__) _traceMember(suggestions, 'forEach');
          (self.__expressionAnalysisMode__ ? _getLocal(_scope6, 'suggestions', suggestions) : void 0, suggestions).forEach(s => {
            let _scope8 = {};
            if (self.__expressionAnalysisMode__) _traceMember(list, 'appendChild');

            (self.__expressionAnalysisMode__ ? _getLocal(_scope6, 'list', list) : void 0, list).appendChild(_element('li', _attributes(_attributeExpression('click', () => {
              return (self.__expressionAnalysisMode__ ? _getLocal(_scope, 'setScript', setScript) : void 0, setScript)(_getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope8, 's', s) : void 0, s), 'url'), _getMember((self.__expressionAnalysisMode__ ? _getGlobal('window') : void 0, window), 'that'));
            })), _children(_childExpression(_getMember((self.__expressionAnalysisMode__ ? _getLocal(_scope8, 's', s) : void 0, s), 'name'))), {
              file: 'https://lively-kernel.org/lively4/lively4-function-completion/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 = {};
          _export('default', LivelyHaloVivideScriptSuggestion = (self.__expressionAnalysisMode__ ? _getLocal(_scope9, 'thisIsVererySecretVariableName', thisIsVererySecretVariableName) : void 0, thisIsVererySecretVariableName)), true ? _setLocal(_scope, 'LivelyHaloVivideScriptSuggestion', LivelyHaloVivideScriptSuggestion) : void 0, LivelyHaloVivideScriptSuggestion;
          return true;
        },

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