text: !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("lit"),require("@lrnwebcomponents/cms-hax/cms-hax.js"),require("@lrnwebcomponents/hax-body/lib/hax-store.js")):"function"==typeof define&&define.amd?define(["exports","lit","@lrnwebcomponents/cms-hax/cms-hax.js","@lrnwebcomponents/hax-body/lib/hax-store.js"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).WysiwygHax={},e.lit,null,e.haxStore_js)}(this,(function(e,t,n,r){"use strict";function o(e,t,n,r,o,i,a){try{var c=e[i](a),s=c.value}catch(e){return void n(e)}c.done?t(s):Promise.resolve(s).then(r,o)}function i(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function c(e){o(a,r,i,c,s,"next",e)}function s(e){o(a,r,i,c,s,"throw",e)}c(void 0)}))}}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},c(e)}function s(e,t){return s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},s(e,t)}function l(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function u(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=c(e);if(t){var o=c(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return l(this,n)}}function d(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=c(e)););return e}function p(){return p="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=d(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},p.apply(this,arguments)}function f(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var h,y,b=function(e){!function(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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&s(e,t)}(g,e);var n,o,l,d,b,v=u(g);function g(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,g);var t=(e=v.call(this)).querySelector("template");return t&&(e.__importContent=t.cloneNode(!0)),e.openDefault=!1,e.elementAlign="right",e.fieldId="textarea-input-field",e.fieldName="data[content]",e.endPoint=null,e.allowedTags=[],e.redirectLocation="",e.updatePageData="",e}return n=g,o=[{key:"render",value:function(){return t.html(h||(h=f(['\n      <textarea\n        class="','"\n        id="','"\n        name="','"\n        hidden=""\n      >\n      ','\n      </textarea\n      >\n      <cms-hax\n        hide-message=""\n        redirect-location="','"\n        update-page-data="','"\n        .end-point="','"\n        app-store-connection="','"\n        offset-margin="','"\n        .allowed-tags="','"\n        ?open-default="','"\n        ?sync-body="','"\n        ?hide-panel-ops="','"\n        ?hide-preferences-button="','"\n        element-align="','"\n      >\n      </cms-hax>\n    '])),this.fieldClass,this.fieldId,this.fieldName,this.bodyValue,this.redirectLocation,this.updatePageData,this.endPoint,this.appStoreConnection,this.offsetMargin,this.allowedTags,this.openDefault,this.syncBody,this.hidePanelOps,this.hidePreferencesButton,this.elementAlign)}},{key:"updated",value:function(e){var t=this;e.forEach((function(e,n){"saveButtonSelector"==n&&t[n].tagName&&t.saveButtonSelector.addEventListener("click",t.__saveClicked.bind(t))}))}},{key:"createRenderRoot",value:function(){return this}},{key:"firstUpdated",value:function(e){p(c(g.prototype),"firstUpdated",this)&&p(c(g.prototype),"firstUpdated",this).call(this,e),this.__importContent&&this.querySelector("cms-hax").appendChild(this.__importContent)}},{key:"connectedCallback",value:function(){p(c(g.prototype),"connectedCallback",this).call(this),window.addEventListener("hax-save-body-value",this._bodyContentUpdated.bind(this))}},{key:"disconnectedCallback",value:function(){window.removeEventListener("hax-save-body-value",this._bodyContentUpdated.bind(this)),this.saveButtonSelector&&this.saveButtonSelector.tagName&&this.saveButtonSelector.removeEventListener("click",this.__saveClicked.bind(this)),p(c(g.prototype),"disconnectedCallback",this).call(this)}},{key:"__saveClicked",value:(b=i(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r.HAXStore.skipExitTrap=!0,r.HAXStore.editMode=!1,this.dispatchEvent(new CustomEvent("hax-save",{bubbles:!0,cancelable:!0,composed:!0,detail:t.detail})),window.dispatchEvent(new CustomEvent("simple-modal-hide",{bubbles:!0,cancelable:!0,detail:{}}));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return b.apply(this,arguments)})},{key:"_bodyContentUpdated",value:(d=i(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.bodyValue=t.detail.value;case 1:case"end":return e.stop()}}),e,this)}))),function(e){return d.apply(this,arguments)})}],l=[{key:"styles",get:function(){return[t.css(y||(y=f(["\n        :host {\n          display: block;\n        }\n      "])))]}},{key:"tag",get:function(){return"wysiwyg-hax"}},{key:"properties",get:function(){return{openDefault:{type:Boolean,attribute:"open-default"},redirectLocation:{type:String,attribute:"redirect-location"},hidePanelOps:{type:Boolean,attribute:"hide-panel-ops"},hidePreferencesButton:{type:Boolean,attribute:"hide-preferences-button"},elementAlign:{type:String,attribute:"element-align"},offsetMargin:{type:String,attribute:"offset-margin"},bodyValue:{type:String,attribute:"body-value"},allowedTags:{type:Array,attribute:"allowed-tags"},appStoreConnection:{type:String,attribute:"app-store-connection"},saveButtonSelector:{type:Object},fieldClass:{type:String,attribute:"field-class"},fieldId:{type:String,attribute:"field-id"},fieldName:{type:String,attribute:"field-name"},syncBody:{type:Boolean,attribute:"sync-body",reflect:!0},endPoint:{type:String,attribute:"end-point"},updatePageData:{type:String,attribute:"update-page-data"}}}}],o&&a(n.prototype,o),l&&a(n,l),Object.defineProperty(n,"prototype",{writable:!1}),g}(t.LitElement);window.customElements.define(b.tag,b),e.WysiwygHax=b,Object.defineProperty(e,"__esModule",{value:!0})}));
  