"enable aexpr";

/*MD ## ActiveExpressions based Bidirectional Connectors

**WARNING** activate active expressions in client code is needed!

  - has nothing to do yet with the connection in the Halo
  - is also completely differently implemented from old lively-kernel connections
MD*/
System.register(["active-expression-rewriting"], function (_export, _context) {
  "use strict";

  var _setLocal, _getGlobal, _traceMember, _getLocal, _getMember, _aexpr, _setMember, Bindings, __SystemJSRewritingHack, _scope4;
  _export("default", void 0);
  return {
    setters: [function (_activeExpressionRewriting) {
      _setLocal = _activeExpressionRewriting.setLocal;
      _getGlobal = _activeExpressionRewriting.getGlobal;
      _traceMember = _activeExpressionRewriting.traceMember;
      _getLocal = _activeExpressionRewriting.getLocal;
      _getMember = _activeExpressionRewriting.getMember;
      _aexpr = _activeExpressionRewriting.aexpr;
      _setMember = _activeExpressionRewriting.setMember;
    }],
    execute: function () {
      __SystemJSRewritingHack = {};
      _recorder_._src_client_bindings_js = _recorder_._src_client_bindings_js || {};
      _scope4 = {
        isScope: true
      };
      _export("default", Bindings = class Bindings {
        constructor(...args) {
          _setMember(this, "__classFilePath__", "https://lively-kernel.org/lively4/lively4-ansgar/src/client/bindings.js", undefined);
        }
        static connect(object, name, element, elementPropertyName = "value") {
          let _scope = {
            isScope: true
          };
          _aexpr(() => {
            return _getMember((element === Object(element) ? self.__expressionAnalysisMode__ ? _getLocal(_scope, "element", element) : void 0 : element, element), (elementPropertyName === Object(elementPropertyName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope, "elementPropertyName", elementPropertyName) : void 0 : elementPropertyName, elementPropertyName));
          }, {
            location: {
              file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/client/bindings.js',
              end: {
                column: 9,
                line: 13
              },
              start: {
                column: 4,
                line: 13
              },
              source: ''
            },
            sourceCode: "() => element[elementPropertyName]"
          }).onChange(v => {
            let _scope2 = {
              isScope: true
            };
            return _setMember((object === Object(object) ? self.__expressionAnalysisMode__ ? _getLocal(_scope, "object", object) : void 0 : object, object), (name === Object(name) ? self.__expressionAnalysisMode__ ? _getLocal(_scope, "name", name) : void 0 : name, name), (v === Object(v) ? self.__expressionAnalysisMode__ ? _getLocal(_scope2, "v", v) : void 0 : v, v), {
              file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/client/bindings.js',
              end: {
                column: 76,
                line: 13
              },
              start: {
                column: 60,
                line: 13
              },
              source: ''
            });
          }, {
            sourceCode: "v => object[name] = v"
          });
          _aexpr(() => {
            return _getMember((object === Object(object) ? self.__expressionAnalysisMode__ ? _getLocal(_scope, "object", object) : void 0 : object, object), (name === Object(name) ? self.__expressionAnalysisMode__ ? _getLocal(_scope, "name", name) : void 0 : name, name));
          }, {
            location: {
              file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/client/bindings.js',
              end: {
                column: 9,
                line: 14
              },
              start: {
                column: 4,
                line: 14
              },
              source: ''
            },
            sourceCode: "() =>  object[name]"
          }).onChange(v => {
            let _scope3 = {
              isScope: true
            };
            return _setMember((element === Object(element) ? self.__expressionAnalysisMode__ ? _getLocal(_scope, "element", element) : void 0 : element, element), (elementPropertyName === Object(elementPropertyName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope, "elementPropertyName", elementPropertyName) : void 0 : elementPropertyName, elementPropertyName), (v === Object(v) ? self.__expressionAnalysisMode__ ? _getLocal(_scope3, "v", v) : void 0 : v, v), {
              file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/client/bindings.js',
              end: {
                column: 77,
                line: 14
              },
              start: {
                column: 45,
                line: 14
              },
              source: ''
            });
          }, {
            sourceCode: "v => element[elementPropertyName] = v"
          });
          _setMember((element === Object(element) ? self.__expressionAnalysisMode__ ? _getLocal(_scope, "element", element) : void 0 : element, element), (elementPropertyName === Object(elementPropertyName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope, "elementPropertyName", elementPropertyName) : void 0 : elementPropertyName, elementPropertyName), _getMember((object === Object(object) ? self.__expressionAnalysisMode__ ? _getLocal(_scope, "object", object) : void 0 : object, object), (name === Object(name) ? self.__expressionAnalysisMode__ ? _getLocal(_scope, "name", name) : void 0 : name, name)), {
            file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/client/bindings.js',
            end: {
              column: 47,
              line: 15
            },
            start: {
              column: 4,
              line: 15
            },
            source: ''
          }); // force first update
        }
      });
      if (self.__expressionAnalysisMode__) _traceMember(Object, "defineProperty");
      Object.defineProperty(_getMember((self.__expressionAnalysisMode__ ? _getGlobal("_recorder_") : void 0, _recorder_), "_src_client_bindings_js"), "Bindings", {
        get() {
          return self.__expressionAnalysisMode__ ? _getLocal(_scope4, "Bindings", Bindings) : void 0, Bindings;
        },
        set(thisIsVererySecretVariableName) {
          let _scope5 = {
            isScope: true
          };
          _export("default", Bindings = (thisIsVererySecretVariableName === Object(thisIsVererySecretVariableName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope5, "thisIsVererySecretVariableName", thisIsVererySecretVariableName) : void 0 : thisIsVererySecretVariableName, thisIsVererySecretVariableName)), true ? _setLocal(_scope4, "Bindings", Bindings, {
            file: 'https://lively-kernel.org/lively4/lively4-ansgar/src/client/bindings.js',
            end: {
              column: 29,
              line: 10
            },
            start: {
              column: 21,
              line: 10
            },
            source: ''
          }) : void 0, Bindings;
          return true;
        },
        enumerable: true,
        configurable: true
      });
    }
  };
});