Liferay.Loader.define("frontend-editor-ckeditor-web@5.0.65/editor/BaseEditor",["module","exports","require","frontend-editor-ckeditor-web$ckeditor4-react","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=i(r("frontend-editor-ckeditor-web$ckeditor4-react")),o=(i(r("liferay!frontend-js-react-web$prop-types")),function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=n?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react")));function a(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return a=function(){return e},e}function i(e){return e&&e.__esModule?e:{default:e}}function c(){return(c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function f(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}const e="/o/frontend-editor-ckeditor-web/ckeditor/",u=Liferay.ThemeDisplay.getPathContext(),l=u?u+e:e,s=(0,o.forwardRef)(((e,t)=>{let{contents:r,name:a,onChange:i,onChangeMethodName:d}=e,u=f(e,["contents","name","onChange","onChangeMethodName"]);const l=(0,o.useRef)();(0,o.useEffect)((()=>{Liferay.once("beforeScreenFlip",(()=>{window.CKEDITOR&&!Object.keys(window.CKEDITOR.instances).length&&delete window.CKEDITOR}))}),[]);const s=(0,o.useCallback)((()=>{let e=r;const t=l.current.editor;return t&&t.instanceReady&&(e=t.getData(),CKEDITOR.env.gecko&&"<br />"===CKEDITOR.tools.trim(e)&&(e=""),e=e.replace(/(\u200B){7}/,"")),e}),[r]),p=(0,o.useCallback)((e=>{t&&(t.current=e),l.current=e}),[t,l]);return(0,o.useEffect)((()=>{window[a]={getHTML:s,getText:()=>r}}),[r,s,a]),o.default.createElement(n.default,c({name:a,onChange:()=>{(d||i)&&(d?window[d](s()):i(s()))},onChangeMethodName:d,ref:p},u))}));n.default.editorUrl="".concat(l,"ckeditor.js"),window.CKEDITOR_BASEPATH=l,s.displayName="BaseEditor";var d=s;t.default=d}}));
//# sourceMappingURL=BaseEditor.js.map