System.register(['src/components/halo/lively-halo-item.js', 'src/client/morphic/component-loader.js', 'src/client/graphics.js'], function (_export, _context) {
  "use strict";

  var HaloItem, componentLoader, pt;
  return {
    setters: [function (_srcComponentsHaloLivelyHaloItemJs) {
      HaloItem = _srcComponentsHaloLivelyHaloItemJs.default;
    }, function (_srcClientMorphicComponentLoaderJs) {
      componentLoader = _srcClientMorphicComponentLoaderJs.default;
    }, function (_srcClientGraphicsJs) {
      pt = _srcClientGraphicsJs.pt;
    }],
    execute: function () {
      _recorder_._src_components_halo_lively_halo_style_item_js = _recorder_._src_components_halo_lively_halo_style_item_js || {};
      _recorder_._src_components_halo_lively_halo_style_item_js.HaloItem = HaloItem;
      _recorder_._src_components_halo_lively_halo_style_item_js.componentLoader = componentLoader;
      _recorder_._src_components_halo_lively_halo_style_item_js.pt = pt;
      class HaloStyleItem extends _recorder_._src_components_halo_lively_halo_style_item_js.HaloItem {

        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 lively.create("lively-style-editor");
            editor.setTarget(inspectTarget);
            editor.hideTargetButton();
            this.appendChild(editor);

            lively.setPosition(editor, _recorder_._src_components_halo_lively_halo_style_item_js.pt(0, -110)
            // this.hideHalo(); 
            );
          }
        }

        updateTarget(target) {
          var editor = this.querySelector("lively-style-editor");
          if (editor) {
            editor.setTarget(target);
          }
        }

      }

      _export('default', HaloStyleItem);

      _recorder_._src_components_halo_lively_halo_style_item_js.HaloStyleItem = HaloStyleItem;
    }
  };
});