text: Object.defineProperty(exports,"__esModule",{value:!0}),exports.HaxExportDialog=void 0;var e=require("lit");require("@lrnwebcomponents/simple-modal/lib/simple-modal-template.js"),require("./hax-view-source.js");var t=require("./hax-ui-styles.js"),o=require("@lrnwebcomponents/i18n-manager/lib/I18NMixin.js");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},_typeof(e)}function _templateObject2_ff824990941711ec8d52c707f928eca0(){var e=_taggedTemplateLiteral(["\n        :host {\n          display: none;\n          --simple-modal-resize: both;\n          --simple-modal-height: 100vh;\n        }\n      "]);return _templateObject2_ff824990941711ec8d52c707f928eca0=function _templateObject2_ff824990941711ec8d52c707f928eca0(){return e},e}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 _templateObject_ff824990941711ec8d52c707f928eca0(){var e=_taggedTemplateLiteral(['\n      <simple-modal-template\n        modal-id="hax-export"\n        mode="hax-ui"\n        id="dialog"\n        .title="','"\n      >\n        <hax-view-source slot="custom"></hax-view-source>\n      </simple-modal-template>\n    ']);return _templateObject_ff824990941711ec8d52c707f928eca0=function _templateObject_ff824990941711ec8d52c707f928eca0(){return e},e}function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _defineProperties(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _setPrototypeOf(e,t){return _setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(e,t){return e.__proto__=t,e},_setPrototypeOf(e,t)}function _get(e,t,o){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function _get(e,t,o){var r=function _superPropBase(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=_getPrototypeOf(e)););return e}(e,t);if(r){var n=Object.getOwnPropertyDescriptor(r,t);return n.get?n.get.call(o):n.value}},_get(e,t,o||e)}function _getPrototypeOf(e){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(e){return e.__proto__||Object.getPrototypeOf(e)},_getPrototypeOf(e)}var r=function(r){function HaxExportDialog(){var e;return function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,HaxExportDialog),(e=function _possibleConstructorReturn(e,t){return!t||"object"!==_typeof(t)&&"function"!=typeof t?_assertThisInitialized(e):t}(this,_getPrototypeOf(HaxExportDialog).call(this))).t={viewPageSource:"View Page Source"},e.registerTranslation({context:_assertThisInitialized(e),namespace:"hax"}),e}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)}(HaxExportDialog,(0,o.I18NMixin)(e.LitElement)),function _createClass(e,t,o){return t&&_defineProperties(e.prototype,t),o&&_defineProperties(e,o),e}(HaxExportDialog,[{key:"connectedCallback",value:function connectedCallback(){_get(_getPrototypeOf(HaxExportDialog.prototype),"connectedCallback",this).call(this),window.addEventListener("simple-modal-show",this.modalToggle.bind(this))}},{key:"disconnectedCallback",value:function disconnectedCallback(){window.removeEventListener("simple-modal-show",this.modalToggle.bind(this)),_get(_getPrototypeOf(HaxExportDialog.prototype),"disconnectedCallback",this).call(this)}},{key:"modalToggle",value:function modalToggle(e){"hax-export"==e.detail.id&&e.detail.elements.custom.openSource()}},{key:"render",value:function render(){return(0,e.html)(_templateObject_ff824990941711ec8d52c707f928eca0(),this.t.viewPageSource)}},{key:"firstUpdated",value:function firstUpdated(){this.dispatchEvent(new CustomEvent("hax-register-core-piece",{bubbles:!0,cancelable:!0,composed:!0,detail:{piece:"haxExport",object:this}}))}}],[{key:"styles",get:function get(){return[].concat(_toConsumableArray(t.HaxComponentStyles),[(0,e.css)(_templateObject2_ff824990941711ec8d52c707f928eca0())])}},{key:"tag",get:function get(){return"hax-export-dialog"}}]),HaxExportDialog}();exports.HaxExportDialog=r,window.customElements.define(r.tag,r);