text: Object.defineProperty(exports,"__esModule",{value:!0}),exports.HaxContextToolbar=void 0;var e=require("lit");function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(e){return typeof e}:function _typeof(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ownKeys(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function _defineProperty(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function _templateObject2_02797ae0feba11eb8439e3eec9305af7(){var e=_taggedTemplateLiteral(['\n      <absolute-position-behavior id="top" auto justify \n        position="top" \n        .target="','">\n        <div class="menu">\n          <hax-text-context \n            id="text"\n            class="item ','"\n            .target="','"\n          ></hax-text-context>\n          <hax-ce-context\n            id="ce"\n            class="item ','"\n            .target="','"\n          ></hax-ce-context>\n          <hax-plate-context\n            id="plate"\n            class="item ','"\n          ></hax-plate-context>\n        </div>\n      </absolute-position-behavior>\n      <absolute-position-behavior auto justify \n        position="bottom" \n        .target="','">\n        <hax-context-item\n          icon="icons:add"\n          label="','"\n          show-text-label\n          class="item '," ",'"\n        >\n        </hax-context-item>\n      </absolute-position-behavior>\n    ']);return _templateObject2_02797ae0feba11eb8439e3eec9305af7=function _templateObject2_02797ae0feba11eb8439e3eec9305af7(){return e},e}function _templateObject_02797ae0feba11eb8439e3eec9305af7(){var e=_taggedTemplateLiteral(["\n        :host {\n          width: 100%;\n        } \n        :host *:not(:defined) {\n          display: none !important;\n        }\n        :host(:not(.hax-visible)),\n        .item {\n          visibility: hidden;\n          opacity: 0;\n          z-index: 1000;\n          pointer-events: none;\n          transition: 0.2s top ease-in-out, 0.2s left ease-in-out;\n        }\n        :host(:hover),\n        :host(:focus-within),\n        .item:hover,\n        .item:focus-within {\n          z-index: var(--hax-ui-focus-z-index);\n        }\n        #top .menu {\n          display: flex;\n          width: 100%;\n          align-items: bottom;\n          justify-content: space-between;\n        }\n        #text,\n        #ce {\n          max-width: 280px;\n          flex: 1 1 auto;\n        }\n        #plate,\n        #add {\n          flex: 0 0 auto;\n        }\n        .item-visible, \n        .item-active {\n          visibility: visible;\n          pointer-events: all;\n          opacity: 1;\n        }\n        .item-tracking {\n          position: absolute;\n        }\n      "]);return _templateObject_02797ae0feba11eb8439e3eec9305af7=function _templateObject_02797ae0feba11eb8439e3eec9305af7(){return e},e}function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function _toConsumableArray(e){return function _arrayWithoutHoles(e){if(Array.isArray(e)){for(var t=0,o=new Array(e.length);t<e.length;t++)o[t]=e[t];return o}}(e)||function _iterableToArray(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function _possibleConstructorReturn(e,t){return!t||"object"!==_typeof(t)&&"function"!=typeof t?function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function _defineProperties(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass(e,t,o){return t&&_defineProperties(e.prototype,t),o&&_defineProperties(e,o),e}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(e,t){return e.__proto__=t,e})(e,t)}function _get(e,t,o){return(_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function _get(e,t,o){var n=function _superPropBase(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=_getPrototypeOf(e)););return e}(e,t);if(n){var r=Object.getOwnPropertyDescriptor(n,t);return r.get?r.get.call(o):r.value}})(e,t,o||e)}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}require("@lrnwebcomponents/hax-body/lib/hax-text-context.js"),require("@lrnwebcomponents/hax-body/lib/hax-ce-context.js"),require("@lrnwebcomponents/hax-body/lib/hax-plate-context.js"),require("@lrnwebcomponents/hax-body/lib/hax-context-item.js"),require("@lrnwebcomponents/absolute-position-behavior/absolute-position-behavior.js");var t=function(t){function HaxContextToolbar(){return function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,HaxContextToolbar),_possibleConstructorReturn(this,_getPrototypeOf(HaxContextToolbar).call(this))}return function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_setPrototypeOf(e,t)}(HaxContextToolbar,e.LitElement),_createClass(HaxContextToolbar,null,[{key:"styles",get:function get(){return[].concat(_toConsumableArray(_get(_getPrototypeOf(HaxContextToolbar),"styles",this)),[(0,e.css)(_templateObject_02797ae0feba11eb8439e3eec9305af7())])}}]),_createClass(HaxContextToolbar,[{key:"render",value:function render(){return(0,e.html)(_templateObject2_02797ae0feba11eb8439e3eec9305af7(),this.target||document.body,this.textContext?"item-visible":"",this.target,this.ceContext?"item-visible":"",this.target,this.plateContext?"item-visible":"",this.target||document.body,this.addLabel,this.addContext?"item-visible":"",this.trackMouse?"item-tracking":"")}},{key:"getToolbar",value:function getToolbar(e){return this.shadowRoot&&this.shadowRoot.querySelector("#".concat(e))?this.shadowRoot.querySelector("#".concat(e)):void 0}},{key:"haxVisible",get:function get(){var e=this.target&&(this.ceContext||this.topVisible);return this.setAttribute("hax-visible",e),e}},{key:"topVisible",get:function get(){return this.ceContext||this.plateContext||this.textContext}},{key:"topToolbar",get:function get(){return this.getToolbar("#top")}},{key:"bottomToolbar",get:function get(){return this.getToolbar("#bottom")}}],[{key:"tag",get:function get(){return"hax-context-toolbar"}},{key:"properties",get:function get(){var e;return function _objectSpread(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(o,!0).forEach((function(t){_defineProperty(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):ownKeys(o).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}({},_get(_getPrototypeOf(HaxContextToolbar),"properties",this),(_defineProperty(e={target:{type:Object},addLabel:{type:String},addContext:{type:Boolean},plateContext:{type:Boolean,reflect:!0},ceContext:{type:Boolean}},"plateContext",{type:Boolean}),_defineProperty(e,"trackMouse",{type:Boolean}),e))}}]),HaxContextToolbar}();exports.HaxContextToolbar=t,window.customElements.define(t.tag,t);