System.register(['reactive-jsx', 'src/client/lively.js', 'src/client/morphic/node-helpers.js', 'src/client/morphic/event-helpers.js', 'src/client/graphics.js', 'src/components/halo/lively-halo-item.js', 'src/client/preferences.js', 'src/client/morphic/snapping.js'], function (_export, _context) {
  "use strict";

  var _addSourceLocation, lively, nodes, events, pt, HaloItem, Preferences, Snapping, Grid;

  return {
    setters: [function (_reactiveJsx) {
      _addSourceLocation = _reactiveJsx.addSourceLocation;
    }, function (_srcClientLivelyJs) {
      lively = _srcClientLivelyJs.default;
    }, function (_srcClientMorphicNodeHelpersJs) {
      nodes = _srcClientMorphicNodeHelpersJs;
    }, function (_srcClientMorphicEventHelpersJs) {
      events = _srcClientMorphicEventHelpersJs;
    }, function (_srcClientGraphicsJs) {
      pt = _srcClientGraphicsJs.pt;
    }, function (_srcComponentsHaloLivelyHaloItemJs) {
      HaloItem = _srcComponentsHaloLivelyHaloItemJs.default;
    }, function (_srcClientPreferencesJs) {
      Preferences = _srcClientPreferencesJs.default;
    }, function (_srcClientMorphicSnappingJs) {
      Snapping = _srcClientMorphicSnappingJs.default;
      Grid = _srcClientMorphicSnappingJs.Grid;
    }],
    execute: function () {
      const __SystemJSRewritingHack = {};
      _recorder_._src_components_halo_lively_halo_vivide_combine_item_js = _recorder_._src_components_halo_lively_halo_vivide_combine_item_js || {};
      Object.defineProperty(_recorder_._src_components_halo_lively_halo_vivide_combine_item_js, 'lively', {
        get() {
          return lively;
        },

        set(thisIsVererySecretVariableName) {
          lively = thisIsVererySecretVariableName;
          return true;
        },

        enumerable: true,
        configurable: true
      });
      Object.defineProperty(_recorder_._src_components_halo_lively_halo_vivide_combine_item_js, 'nodes', {
        get() {
          return nodes;
        },

        set(thisIsVererySecretVariableName) {
          nodes = thisIsVererySecretVariableName;
          return true;
        },

        enumerable: true,
        configurable: true
      });
      Object.defineProperty(_recorder_._src_components_halo_lively_halo_vivide_combine_item_js, 'events', {
        get() {
          return events;
        },

        set(thisIsVererySecretVariableName) {
          events = thisIsVererySecretVariableName;
          return true;
        },

        enumerable: true,
        configurable: true
      });
      Object.defineProperty(_recorder_._src_components_halo_lively_halo_vivide_combine_item_js, 'pt', {
        get() {
          return pt;
        },

        set(thisIsVererySecretVariableName) {
          pt = thisIsVererySecretVariableName;
          return true;
        },

        enumerable: true,
        configurable: true
      });
      Object.defineProperty(_recorder_._src_components_halo_lively_halo_vivide_combine_item_js, 'HaloItem', {
        get() {
          return HaloItem;
        },

        set(thisIsVererySecretVariableName) {
          HaloItem = thisIsVererySecretVariableName;
          return true;
        },

        enumerable: true,
        configurable: true
      });
      Object.defineProperty(_recorder_._src_components_halo_lively_halo_vivide_combine_item_js, 'Preferences', {
        get() {
          return Preferences;
        },

        set(thisIsVererySecretVariableName) {
          Preferences = thisIsVererySecretVariableName;
          return true;
        },

        enumerable: true,
        configurable: true
      });
      Object.defineProperty(_recorder_._src_components_halo_lively_halo_vivide_combine_item_js, 'Snapping', {
        get() {
          return Snapping;
        },

        set(thisIsVererySecretVariableName) {
          Snapping = thisIsVererySecretVariableName;
          return true;
        },

        enumerable: true,
        configurable: true
      });
      Object.defineProperty(_recorder_._src_components_halo_lively_halo_vivide_combine_item_js, 'Grid', {
        get() {
          return Grid;
        },

        set(thisIsVererySecretVariableName) {
          Grid = thisIsVererySecretVariableName;
          return true;
        },

        enumerable: true,
        configurable: true
      });
      class HaloVivideCombineItem extends HaloItem {

        onClick(evt) {
          if (this._view) {
            HaloService.hideHalos();
            lively.openInspector('WOOHOO', pt(evt.clientX, evt.clientY));
          }
        }

        async onClick(evt) {
          if (evt.composedPath().find(ea => ea.tagName == "LIVELY-STYLE-EDITOR")) return;

          var inspectTarget = window.that;

          var editor = this.querySelector("lively-style-editor");
          if (editor) {
            editor.remove();
          } else {
            editor = await _addSourceLocation(lively.create("lively-style-editor"), {
              file: 'https://lively-kernel.org/lively4/lively4-bp2019/src/components/halo/lively-halo-vivide-combine-item.js',
              end: {
                column: 57,
                line: 28
              },
              start: {
                column: 21,
                line: 28
              }
            });
            editor.setTarget(inspectTarget);
            editor.hideTargetButton();
            this.appendChild(editor);

            lively.setPosition(editor, pt(0, -60)
            // this.hideHalo(); 
            );
          }
        }

        updateTarget(target) {
          return;
          var editor = this.querySelector("lively-style-editor");
          if (editor) {
            editor.setTarget(target);
          }
          if (view && view.tagName === 'VIVIDE-VIEW') {
            this._view = view;
          }
        }
      }

      _export('default', HaloVivideCombineItem);

      Object.defineProperty(_recorder_._src_components_halo_lively_halo_vivide_combine_item_js, 'HaloVivideCombineItem', {
        get() {
          return HaloVivideCombineItem;
        },

        set(thisIsVererySecretVariableName) {
          _export('default', HaloVivideCombineItem = thisIsVererySecretVariableName);

          return true;
        },

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