text: /*!
   * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
   * For licensing, see LICENSE.md.
   */
  !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports.CKEditor=e(require("react")):t.CKEditor=e(t.React)}(window,(function(t){return function(t){var e={};function r(o){if(e[o])return e[o].exports;var n=e[o]={i:o,l:!1,exports:{}};return t[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=t,r.c=e,r.d=function(t,e,o){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)r.d(o,n,function(e){return t[e]}.bind(null,n));return o},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=12)}([function(t,e,r){"use strict";var o=r(4),n="object"==typeof self&&self&&self.Object===Object&&self,i=o.a||n||Function("return this")();e.a=i},function(t,e,r){t.exports=r(9)()},function(t,e,r){"use strict";(function(t){var o=r(4),n="object"==typeof exports&&exports&&!exports.nodeType&&exports,i=n&&"object"==typeof t&&t&&!t.nodeType&&t,a=i&&i.exports===n&&o.a.process,s=function(){try{var t=i&&i.require&&i.require("util").types;return t||a&&a.binding&&a.binding("util")}catch(t){}}();e.a=s}).call(this,r(6)(t))},function(e,r){e.exports=t},function(t,e,r){"use strict";(function(t){var r="object"==typeof t&&t&&t.Object===Object&&t;e.a=r}).call(this,r(11))},function(t,e,r){"use strict";(function(t){var o=r(0),n=r(7),i="object"==typeof exports&&exports&&!exports.nodeType&&exports,a=i&&"object"==typeof t&&t&&!t.nodeType&&t,s=a&&a.exports===i?o.a.Buffer:void 0,c=(s?s.isBuffer:void 0)||n.a;e.a=c}).call(this,r(6)(t))},function(t,e){t.exports=function(t){if(!t.webpackPolyfill){var e=Object.create(t);e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),Object.defineProperty(e,"exports",{enumerable:!0}),e.webpackPolyfill=1}return e}},function(t,e,r){"use strict";e.a=function(){return!1}},function(t,e,r){"use strict";(function(t){var o=r(0),n="object"==typeof exports&&exports&&!exports.nodeType&&exports,i=n&&"object"==typeof t&&t&&!t.nodeType&&t,a=i&&i.exports===n?o.a.Buffer:void 0,s=a?a.allocUnsafe:void 0;e.a=function(t,e){if(e)return t.slice();var r=t.length,o=s?s(r):new t.constructor(r);return t.copy(o),o}}).call(this,r(6)(t))},function(t,e,r){"use strict";var o=r(10);function n(){}function i(){}i.resetWarningCache=n,t.exports=function(){function t(t,e,r,n,i,a){if(a!==o){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function e(){return t}t.isRequired=t;var r={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:i,resetWarningCache:n};return r.PropTypes=r,r}},function(t,e,r){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";r.r(e),r.d(e,"CKEditor",(function(){return Tr})),r.d(e,"CKEditorContext",(function(){return Ar}));var o=r(3),n=r.n(o),i=r(1),a=r.n(i);var s=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},c=r(0),u=function(){return c.a.Date.now()},h=c.a.Symbol,d=Object.prototype,l=d.hasOwnProperty,f=d.toString,p=h?h.toStringTag:void 0;var _=function(t){var e=l.call(t,p),r=t[p];try{t[p]=void 0;var o=!0}catch(t){}var n=f.call(t);return o&&(e?t[p]=r:delete t[p]),n},y=Object.prototype.toString;var v=function(t){return y.call(t)},b=h?h.toStringTag:void 0;var g=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":b&&b in Object(t)?_(t):v(t)};var m=function(t){return null!=t&&"object"==typeof t};var j=function(t){return"symbol"==typeof t||m(t)&&"[object Symbol]"==g(t)},w=/^\s+|\s+$/g,x=/^[-+]0x[0-9a-f]+$/i,E=/^0b[01]+$/i,O=/^0o[0-7]+$/i,P=parseInt;var C=function(t){if("number"==typeof t)return t;if(j(t))return NaN;if(s(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=s(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(w,"");var r=E.test(t);return r||O.test(t)?P(t.slice(2),r?2:8):x.test(t)?NaN:+t},A=Math.max,T=Math.min;var S=function(t,e,r){var o,n,i,a,c,h,d=0,l=!1,f=!1,p=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function _(e){var r=o,i=n;return o=n=void 0,d=e,a=t.apply(i,r)}function y(t){return d=t,c=setTimeout(b,e),l?_(t):a}function v(t){var r=t-h;return void 0===h||r>=e||r<0||f&&t-d>=i}function b(){var t=u();if(v(t))return g(t);c=setTimeout(b,function(t){var r=e-(t-h);return f?T(r,i-(t-d)):r}(t))}function g(t){return c=void 0,p&&o?_(t):(o=n=void 0,a)}function m(){var t=u(),r=v(t);if(o=arguments,n=this,h=t,r){if(void 0===c)return y(h);if(f)return clearTimeout(c),c=setTimeout(b,e),_(h)}return void 0===c&&(c=setTimeout(b,e)),a}return e=C(e)||0,s(r)&&(l=!!r.leading,i=(f="maxWait"in r)?A(C(r.maxWait)||0,e):i,p="trailing"in r?!!r.trailing:p),m.cancel=function(){void 0!==c&&clearTimeout(c),d=0,o=h=n=c=void 0},m.flush=function(){return void 0===c?a:g(u())},m};var W=function(t,e,r){var o=!0,n=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return s(r)&&(o="leading"in r?!!r.leading:o,n="trailing"in r?!!r.trailing:n),S(t,e,{leading:o,maxWait:e,trailing:n})};var R=function(){this.__data__=[],this.size=0};var D=function(t,e){return t===e||t!=t&&e!=e};var I=function(t,e){for(var r=t.length;r--;)if(D(t[r][0],e))return r;return-1},z=Array.prototype.splice;var F=function(t){var e=this.__data__,r=I(e,t);return!(r<0)&&(r==e.length-1?e.pop():z.call(e,r,1),--this.size,!0)};var M=function(t){var e=this.__data__,r=I(e,t);return r<0?void 0:e[r][1]};var U=function(t){return I(this.__data__,t)>-1};var N=function(t,e){var r=this.__data__,o=I(r,t);return o<0?(++this.size,r.push([t,e])):r[o][1]=e,this};function k(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}k.prototype.clear=R,k.prototype.delete=F,k.prototype.get=M,k.prototype.has=U,k.prototype.set=N;var L=k;var $=function(){this.__data__=new L,this.size=0};var B=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r};var q=function(t){return this.__data__.get(t)};var H=function(t){return this.__data__.has(t)};var Q,V=function(t){if(!s(t))return!1;var e=g(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},K=c.a["__core-js_shared__"],G=(Q=/[^.]+$/.exec(K&&K.keys&&K.keys.IE_PROTO||""))?"Symbol(src)_1."+Q:"";var Y=function(t){return!!G&&G in t},J=Function.prototype.toString;var X=function(t){if(null!=t){try{return J.call(t)}catch(t){}try{return t+""}catch(t){}}return""},Z=/^\[object .+?Constructor\]$/,tt=Function.prototype,et=Object.prototype,rt=tt.toString,ot=et.hasOwnProperty,nt=RegExp("^"+rt.call(ot).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var it=function(t){return!(!s(t)||Y(t))&&(V(t)?nt:Z).test(X(t))};var at=function(t,e){return null==t?void 0:t[e]};var st=function(t,e){var r=at(t,e);return it(r)?r:void 0},ct=st(c.a,"Map"),ut=st(Object,"create");var ht=function(){this.__data__=ut?ut(null):{},this.size=0};var dt=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},lt=Object.prototype.hasOwnProperty;var ft=function(t){var e=this.__data__;if(ut){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return lt.call(e,t)?e[t]:void 0},pt=Object.prototype.hasOwnProperty;var _t=function(t){var e=this.__data__;return ut?void 0!==e[t]:pt.call(e,t)};var yt=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=ut&&void 0===e?"__lodash_hash_undefined__":e,this};function vt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}vt.prototype.clear=ht,vt.prototype.delete=dt,vt.prototype.get=ft,vt.prototype.has=_t,vt.prototype.set=yt;var bt=vt;var gt=function(){this.size=0,this.__data__={hash:new bt,map:new(ct||L),string:new bt}};var mt=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var jt=function(t,e){var r=t.__data__;return mt(e)?r["string"==typeof e?"string":"hash"]:r.map};var wt=function(t){var e=jt(this,t).delete(t);return this.size-=e?1:0,e};var xt=function(t){return jt(this,t).get(t)};var Et=function(t){return jt(this,t).has(t)};var Ot=function(t,e){var r=jt(this,t),o=r.size;return r.set(t,e),this.size+=r.size==o?0:1,this};function Pt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}Pt.prototype.clear=gt,Pt.prototype.delete=wt,Pt.prototype.get=xt,Pt.prototype.has=Et,Pt.prototype.set=Ot;var Ct=Pt;var At=function(t,e){var r=this.__data__;if(r instanceof L){var o=r.__data__;if(!ct||o.length<199)return o.push([t,e]),this.size=++r.size,this;r=this.__data__=new Ct(o)}return r.set(t,e),this.size=r.size,this};function Tt(t){var e=this.__data__=new L(t);this.size=e.size}Tt.prototype.clear=$,Tt.prototype.delete=B,Tt.prototype.get=q,Tt.prototype.has=H,Tt.prototype.set=At;var St=Tt;var Wt=function(t,e){for(var r=-1,o=null==t?0:t.length;++r<o&&!1!==e(t[r],r,t););return t},Rt=function(){try{var t=st(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();var Dt=function(t,e,r){"__proto__"==e&&Rt?Rt(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r},It=Object.prototype.hasOwnProperty;var zt=function(t,e,r){var o=t[e];It.call(t,e)&&D(o,r)&&(void 0!==r||e in t)||Dt(t,e,r)};var Ft=function(t,e,r,o){var n=!r;r||(r={});for(var i=-1,a=e.length;++i<a;){var s=e[i],c=o?o(r[s],t[s],s,r,t):void 0;void 0===c&&(c=t[s]),n?Dt(r,s,c):zt(r,s,c)}return r};var Mt=function(t,e){for(var r=-1,o=Array(t);++r<t;)o[r]=e(r);return o};var Ut=function(t){return m(t)&&"[object Arguments]"==g(t)},Nt=Object.prototype,kt=Nt.hasOwnProperty,Lt=Nt.propertyIsEnumerable,$t=Ut(function(){return arguments}())?Ut:function(t){return m(t)&&kt.call(t,"callee")&&!Lt.call(t,"callee")},Bt=Array.isArray,qt=r(5),Ht=/^(?:0|[1-9]\d*)$/;var Qt=function(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&Ht.test(t))&&t>-1&&t%1==0&&t<e};var Vt=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991},Kt={};Kt["[object Float32Array]"]=Kt["[object Float64Array]"]=Kt["[object Int8Array]"]=Kt["[object Int16Array]"]=Kt["[object Int32Array]"]=Kt["[object Uint8Array]"]=Kt["[object Uint8ClampedArray]"]=Kt["[object Uint16Array]"]=Kt["[object Uint32Array]"]=!0,Kt["[object Arguments]"]=Kt["[object Array]"]=Kt["[object ArrayBuffer]"]=Kt["[object Boolean]"]=Kt["[object DataView]"]=Kt["[object Date]"]=Kt["[object Error]"]=Kt["[object Function]"]=Kt["[object Map]"]=Kt["[object Number]"]=Kt["[object Object]"]=Kt["[object RegExp]"]=Kt["[object Set]"]=Kt["[object String]"]=Kt["[object WeakMap]"]=!1;var Gt=function(t){return m(t)&&Vt(t.length)&&!!Kt[g(t)]};var Yt=function(t){return function(e){return t(e)}},Jt=r(2),Xt=Jt.a&&Jt.a.isTypedArray,Zt=Xt?Yt(Xt):Gt,te=Object.prototype.hasOwnProperty;var ee=function(t,e){var r=Bt(t),o=!r&&$t(t),n=!r&&!o&&Object(qt.a)(t),i=!r&&!o&&!n&&Zt(t),a=r||o||n||i,s=a?Mt(t.length,String):[],c=s.length;for(var u in t)!e&&!te.call(t,u)||a&&("length"==u||n&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||Qt(u,c))||s.push(u);return s},re=Object.prototype;var oe=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||re)};var ne=function(t,e){return function(r){return t(e(r))}},ie=ne(Object.keys,Object),ae=Object.prototype.hasOwnProperty;var se=function(t){if(!oe(t))return ie(t);var e=[];for(var r in Object(t))ae.call(t,r)&&"constructor"!=r&&e.push(r);return e};var ce=function(t){return null!=t&&Vt(t.length)&&!V(t)};var ue=function(t){return ce(t)?ee(t):se(t)};var he=function(t,e){return t&&Ft(e,ue(e),t)};var de=function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e},le=Object.prototype.hasOwnProperty;var fe=function(t){if(!s(t))return de(t);var e=oe(t),r=[];for(var o in t)("constructor"!=o||!e&&le.call(t,o))&&r.push(o);return r};var pe=function(t){return ce(t)?ee(t,!0):fe(t)};var _e=function(t,e){return t&&Ft(e,pe(e),t)},ye=r(8);var ve=function(t,e){var r=-1,o=t.length;for(e||(e=Array(o));++r<o;)e[r]=t[r];return e};var be=function(t,e){for(var r=-1,o=null==t?0:t.length,n=0,i=[];++r<o;){var a=t[r];e(a,r,t)&&(i[n++]=a)}return i};var ge=function(){return[]},me=Object.prototype.propertyIsEnumerable,je=Object.getOwnPropertySymbols,we=je?function(t){return null==t?[]:(t=Object(t),be(je(t),(function(e){return me.call(t,e)})))}:ge;var xe=function(t,e){return Ft(t,we(t),e)};var Ee=function(t,e){for(var r=-1,o=e.length,n=t.length;++r<o;)t[n+r]=e[r];return t},Oe=ne(Object.getPrototypeOf,Object),Pe=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)Ee(e,we(t)),t=Oe(t);return e}:ge;var Ce=function(t,e){return Ft(t,Pe(t),e)};var Ae=function(t,e,r){var o=e(t);return Bt(t)?o:Ee(o,r(t))};var Te=function(t){return Ae(t,ue,we)};var Se=function(t){return Ae(t,pe,Pe)},We=st(c.a,"DataView"),Re=st(c.a,"Promise"),De=st(c.a,"Set"),Ie=st(c.a,"WeakMap"),ze=X(We),Fe=X(ct),Me=X(Re),Ue=X(De),Ne=X(Ie),ke=g;(We&&"[object DataView]"!=ke(new We(new ArrayBuffer(1)))||ct&&"[object Map]"!=ke(new ct)||Re&&"[object Promise]"!=ke(Re.resolve())||De&&"[object Set]"!=ke(new De)||Ie&&"[object WeakMap]"!=ke(new Ie))&&(ke=function(t){var e=g(t),r="[object Object]"==e?t.constructor:void 0,o=r?X(r):"";if(o)switch(o){case ze:return"[object DataView]";case Fe:return"[object Map]";case Me:return"[object Promise]";case Ue:return"[object Set]";case Ne:return"[object WeakMap]"}return e});var Le=ke,$e=Object.prototype.hasOwnProperty;var Be=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&$e.call(t,"index")&&(r.index=t.index,r.input=t.input),r},qe=c.a.Uint8Array;var He=function(t){var e=new t.constructor(t.byteLength);return new qe(e).set(new qe(t)),e};var Qe=function(t,e){var r=e?He(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)},Ve=/\w*$/;var Ke=function(t){var e=new t.constructor(t.source,Ve.exec(t));return e.lastIndex=t.lastIndex,e},Ge=h?h.prototype:void 0,Ye=Ge?Ge.valueOf:void 0;var Je=function(t){return Ye?Object(Ye.call(t)):{}};var Xe=function(t,e){var r=e?He(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)};var Ze=function(t,e,r){var o=t.constructor;switch(e){case"[object ArrayBuffer]":return He(t);case"[object Boolean]":case"[object Date]":return new o(+t);case"[object DataView]":return Qe(t,r);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return Xe(t,r);case"[object Map]":return new o;case"[object Number]":case"[object String]":return new o(t);case"[object RegExp]":return Ke(t);case"[object Set]":return new o;case"[object Symbol]":return Je(t)}},tr=Object.create,er=function(){function t(){}return function(e){if(!s(e))return{};if(tr)return tr(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();var rr=function(t){return"function"!=typeof t.constructor||oe(t)?{}:er(Oe(t))};var or=function(t){return m(t)&&"[object Map]"==Le(t)},nr=Jt.a&&Jt.a.isMap,ir=nr?Yt(nr):or;var ar=function(t){return m(t)&&"[object Set]"==Le(t)},sr=Jt.a&&Jt.a.isSet,cr=sr?Yt(sr):ar,ur={};ur["[object Arguments]"]=ur["[object Array]"]=ur["[object ArrayBuffer]"]=ur["[object DataView]"]=ur["[object Boolean]"]=ur["[object Date]"]=ur["[object Float32Array]"]=ur["[object Float64Array]"]=ur["[object Int8Array]"]=ur["[object Int16Array]"]=ur["[object Int32Array]"]=ur["[object Map]"]=ur["[object Number]"]=ur["[object Object]"]=ur["[object RegExp]"]=ur["[object Set]"]=ur["[object String]"]=ur["[object Symbol]"]=ur["[object Uint8Array]"]=ur["[object Uint8ClampedArray]"]=ur["[object Uint16Array]"]=ur["[object Uint32Array]"]=!0,ur["[object Error]"]=ur["[object Function]"]=ur["[object WeakMap]"]=!1;var hr=function t(e,r,o,n,i,a){var c,u=1&r,h=2&r,d=4&r;if(o&&(c=i?o(e,n,i,a):o(e)),void 0!==c)return c;if(!s(e))return e;var l=Bt(e);if(l){if(c=Be(e),!u)return ve(e,c)}else{var f=Le(e),p="[object Function]"==f||"[object GeneratorFunction]"==f;if(Object(qt.a)(e))return Object(ye.a)(e,u);if("[object Object]"==f||"[object Arguments]"==f||p&&!i){if(c=h||p?{}:rr(e),!u)return h?Ce(e,_e(c,e)):xe(e,he(c,e))}else{if(!ur[f])return i?e:{};c=Ze(e,f,u)}}a||(a=new St);var _=a.get(e);if(_)return _;a.set(e,c),cr(e)?e.forEach((function(n){c.add(t(n,r,o,n,e,a))})):ir(e)&&e.forEach((function(n,i){c.set(i,t(n,r,o,i,e,a))}));var y=d?h?Se:Te:h?keysIn:ue,v=l?void 0:y(e);return Wt(v||e,(function(n,i){v&&(n=e[i=n]),zt(c,i,t(n,r,o,i,e,a))})),c};var dr=function(t,e){return hr(t,5,e="function"==typeof e?e:void 0)},lr=Function.prototype,fr=Object.prototype,pr=lr.toString,_r=fr.hasOwnProperty,yr=pr.call(Object);var vr=function(t){if(!m(t)||"[object Object]"!=g(t))return!1;var e=Oe(t);if(null===e)return!0;var r=_r.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&pr.call(r)==yr};var br=function(t){return m(t)&&1===t.nodeType&&!vr(t)};function gr(t,e=new Set){const r=[t],o=new Set;for(;r.length>0;){const t=r.shift();if(!(o.has(t)||mr(t)||e.has(t)))if(o.add(t),t[Symbol.iterator])try{for(const e of t)r.push(e)}catch(t){}else for(const e in t)"defaultValue"!==e&&r.push(t[e])}return o}function mr(t){const e=Object.prototype.toString.call(t),r=typeof t;return"number"===r||"boolean"===r||"string"===r||"symbol"===r||"function"===r||"[object Date]"===e||"[object RegExp]"===e||"[object Module]"===e||null==t||t instanceof EventTarget||t instanceof Event}function jr(t,e,r=new Set){if(t===e&&("object"==typeof(o=t)&&null!==o))return!0;var o;const n=gr(t,r),i=gr(e,r);for(const t of n)if(i.has(t))return!0;return!1}class wr{constructor(t){if(this.crashes=[],this.state="initializing",this._crashNumberLimit="number"==typeof t.crashNumberLimit?t.crashNumberLimit:3,this._now=Date.now,this._minimumNonErrorTimePeriod="number"==typeof t.minimumNonErrorTimePeriod?t.minimumNonErrorTimePeriod:5e3,this._boundErrorHandler=t=>{const e=t.error||t.reason;e instanceof Error&&this._handleError(e,t)},this._listeners={},!this._restart)throw new Error("The Watchdog class was split into the abstract `Watchdog` class and the `EditorWatchdog` class. Please, use `EditorWatchdog` if you have used the `Watchdog` class previously.")}setCreator(t){this._creator=t}setDestructor(t){this._destructor=t}destroy(){this._stopErrorHandling(),this._listeners={}}on(t,e){this._listeners[t]||(this._listeners[t]=[]),this._listeners[t].push(e)}off(t,e){this._listeners[t]=this._listeners[t].filter(t=>t!==e)}_fire(t,...e){const r=this._listeners[t]||[];for(const t of r)t.apply(this,[null,...e])}_startErrorHandling(){window.addEventListener("error",this._boundErrorHandler),window.addEventListener("unhandledrejection",this._boundErrorHandler)}_stopErrorHandling(){window.removeEventListener("error",this._boundErrorHandler),window.removeEventListener("unhandledrejection",this._boundErrorHandler)}_handleError(t,e){if(this._shouldReactToError(t)){this.crashes.push({message:t.message,stack:t.stack,filename:e.filename,lineno:e.lineno,colno:e.colno,date:this._now()});const r=this._shouldRestart();this.state="crashed",this._fire("stateChange"),this._fire("error",{error:t,causesRestart:r}),r?this._restart():(this.state="crashedPermanently",this._fire("stateChange"))}}_shouldReactToError(t){return t.is&&t.is("CKEditorError")&&void 0!==t.context&&null!==t.context&&"ready"===this.state&&this._isErrorComingFromThisItem(t)}_shouldRestart(){if(this.crashes.length<=this._crashNumberLimit)return!0;return(this.crashes[this.crashes.length-1].date-this.crashes[this.crashes.length-1-this._crashNumberLimit].date)/this._crashNumberLimit>this._minimumNonErrorTimePeriod}}class xr extends wr{constructor(t,e={}){super(e),this._editor=null,this._throttledSave=W(this._save.bind(this),"number"==typeof e.saveInterval?e.saveInterval:5e3),this._creator=(e,r)=>t.create(e,r),this._destructor=t=>t.destroy()}get editor(){return this._editor}get _item(){return this._editor}_restart(){return Promise.resolve().then(()=>(this.state="initializing",this._fire("stateChange"),this._destroy())).catch(t=>{console.error("An error happened during the editor destroying.",t)}).then(()=>{if("string"==typeof this._elementOrData)return this.create(this._data,this._config,this._config.context);{const t=Object.assign({},this._config,{initialData:this._data});return this.create(this._elementOrData,t,t.context)}}).then(()=>{this._fire("restart")})}create(t=this._elementOrData,e=this._config,r){return Promise.resolve().then(()=>(super._startErrorHandling(),this._elementOrData=t,this._config=this._cloneEditorConfiguration(e)||{},this._config.context=r,this._creator(t,this._config))).then(t=>{this._editor=t,t.model.document.on("change:data",this._throttledSave),this._lastDocumentVersion=t.model.document.version,this._data=this._getData(),this.state="ready",this._fire("stateChange")})}destroy(){return Promise.resolve().then(()=>(this.state="destroyed",this._fire("stateChange"),super.destroy(),this._destroy()))}_destroy(){return Promise.resolve().then(()=>{this._stopErrorHandling(),this._throttledSave.flush();const t=this._editor;return this._editor=null,this._destructor(t)})}_save(){const t=this._editor.model.document.version;if(t!==this._lastDocumentVersion)try{this._data=this._getData(),this._lastDocumentVersion=t}catch(t){console.error(t,"An error happened during restoring editor data. Editor will be restored from the previously saved data.")}}_setExcludedProperties(t){this._excludedProps=t}_getData(){const t={};for(const e of this._editor.model.document.getRootNames())t[e]=this._editor.data.get({rootName:e});return t}_isErrorComingFromThisItem(t){return jr(this._editor,t.context,this._excludedProps)}_cloneEditorConfiguration(t){return dr(t,(t,e)=>br(t)||"context"===e?t:void 0)}}const Er=new Array(256).fill().map((t,e)=>("0"+e.toString(16)).slice(-2));class Or extends wr{constructor(t,e={}){super(e),this._watchdogs=new Map,this._watchdogConfig=e,this._context=null,this._contextProps=new Set,this._actionQueue=new Pr,this._creator=e=>t.create(e),this._destructor=t=>t.destroy(),this._actionQueue.onEmpty(()=>{"initializing"===this.state&&(this.state="ready",this._fire("stateChange"))})}get context(){return this._context}create(t={}){return this._actionQueue.enqueue(()=>(this._contextConfig=t,this._create()))}getItem(t){return this._getWatchdog(t)._item}getItemState(t){return this._getWatchdog(t).state}add(t){const e=Array.isArray(t)?t:[t];return this._actionQueue.enqueue(()=>{if("destroyed"===this.state)throw new Error("Cannot add items to destroyed watchdog.");if(!this._context)throw new Error("Context was not created yet. You should call the `ContextWatchdog#create()` method first.");return Promise.all(e.map(t=>{let e;if(this._watchdogs.has(t.id))throw new Error(`Item with the given id is already added: '${t.id}'.`);if("editor"===t.type)return e=new xr(this._watchdogConfig),e.setCreator(t.creator),e._setExcludedProperties(this._contextProps),t.destructor&&e.setDestructor(t.destructor),this._watchdogs.set(t.id,e),e.on("error",(r,{error:o,causesRestart:n})=>{this._fire("itemError",{itemId:t.id,error:o}),n&&this._actionQueue.enqueue(()=>new Promise(r=>{e.on("restart",function o(){e.off("restart",o),this._fire("itemRestart",{itemId:t.id}),r()}.bind(this))}))}),e.create(t.sourceElementOrData,t.config,this._context);throw new Error(`Not supported item type: '${t.type}'.`)}))})}remove(t){const e=Array.isArray(t)?t:[t];return this._actionQueue.enqueue(()=>Promise.all(e.map(t=>{const e=this._getWatchdog(t);return this._watchdogs.delete(t),e.destroy()})))}destroy(){return this._actionQueue.enqueue(()=>(this.state="destroyed",this._fire("stateChange"),super.destroy(),this._destroy()))}_restart(){return this._actionQueue.enqueue(()=>(this.state="initializing",this._fire("stateChange"),this._destroy().catch(t=>{console.error("An error happened during destroying the context or items.",t)}).then(()=>this._create()).then(()=>this._fire("restart"))))}_create(){return Promise.resolve().then(()=>(this._startErrorHandling(),this._creator(this._contextConfig))).then(t=>(this._context=t,this._contextProps=gr(this._context),Promise.all(Array.from(this._watchdogs.values()).map(t=>(t._setExcludedProperties(this._contextProps),t.create(void 0,void 0,this._context))))))}_destroy(){return Promise.resolve().then(()=>{this._stopErrorHandling();const t=this._context;return this._context=null,this._contextProps=new Set,Promise.all(Array.from(this._watchdogs.values()).map(t=>t.destroy())).then(()=>this._destructor(t))})}_getWatchdog(t){const e=this._watchdogs.get(t);if(!e)throw new Error(`Item with the given id was not registered: ${t}.`);return e}_isErrorComingFromThisItem(t){for(const e of this._watchdogs.values())if(e._isErrorComingFromThisItem(t))return!1;return jr(this._context,t.context)}}class Pr{constructor(){this._promiseQueue=Promise.resolve(),this._onEmptyCallbacks=[]}onEmpty(t){this._onEmptyCallbacks.push(t)}enqueue(t){let e;const r=this._promiseQueue.then(t).then(()=>{this._promiseQueue===e&&this._onEmptyCallbacks.forEach(t=>t())});return e=this._promiseQueue=r.catch(()=>{}),r}}const Cr=n.a.createContext("contextWatchdog");class Ar extends n.a.Component{constructor(t,e){super(t,e),this.contextWatchdog=null,this.props.isLayoutReady&&this._initializeContextWatchdog(this.props.config)}shouldComponentUpdate(t){return t.id!==this.props.id&&(this.contextWatchdog&&this.contextWatchdog.destroy(),this._initializeContextWatchdog(t.config)),t.isLayoutReady&&!this.contextWatchdog?(this._initializeContextWatchdog(t.config),!0):this.props.children!==t.children}render(){return n.a.createElement(Cr.Provider,{value:this.contextWatchdog},this.props.children)}componentWillUnmount(){this._destroyContext()}_initializeContextWatchdog(t){this.contextWatchdog=new Or(this.props.context),this.contextWatchdog.create(t).catch(t=>{this.props.onError(t,{phase:"initialization",willContextRestart:!1})}),this.contextWatchdog.on("error",(t,e)=>{this.props.onError(e.error,{phase:"runtime",willContextRestart:e.causesRestart})}),this.contextWatchdog.on("stateChange",()=>{"ready"===this.contextWatchdog.state&&this.props.onReady&&this.props.onReady(this.contextWatchdog.context)})}_destroyContext(){this.contextWatchdog&&(this.contextWatchdog.destroy(),this.contextWatchdog=null)}}Ar.defaultProps={isLayoutReady:!0,onError:(t,e)=>console.error(t,e)},Ar.propTypes={id:a.a.string,isLayoutReady:a.a.bool,context:a.a.func,config:a.a.object,onReady:a.a.func,onError:a.a.func};class Tr extends n.a.Component{constructor(t){super(t),this.domContainer=n.a.createRef(),this.watchdog=null}get editor(){return this.watchdog?this.watchdog.editor:null}shouldComponentUpdate(t){return!!this.editor&&(t.id!==this.props.id?(this._destroyEditor(),!0):(this._shouldUpdateEditor(t)&&this.editor.setData(t.data),"disabled"in t&&(this.editor.isReadOnly=t.disabled),!1))}componentDidMount(){this._initializeEditor()}componentDidUpdate(){this._initializeEditor()}componentWillUnmount(){this._destroyEditor()}render(){return n.a.createElement("div",{ref:this.domContainer})}_initializeEditor(){this.context instanceof Or?this.watchdog=new Sr(this.context):this.watchdog=new xr(this.editor),this.watchdog.setCreator((t,e)=>this._createEditor(t,e)),this.watchdog.on("error",(t,{error:e,causesRestart:r})=>{this.props.onError(e,{phase:"runtime",willEditorRestart:r})}),this.watchdog.create(this.domContainer.current,this._getConfig()).catch(t=>this.props.onError(t,{phase:"initialization",willEditorRestart:!1}))}_createEditor(t,e){return this.props.editor.create(t,e).then(t=>{"disabled"in this.props&&(t.isReadOnly=this.props.disabled);const e=t.model.document,r=t.editing.view.document;return e.on("change:data",e=>{this.props.onChange&&this.props.onChange(e,t)}),r.on("focus",e=>{this.props.onFocus&&this.props.onFocus(e,t)}),r.on("blur",e=>{this.props.onBlur&&this.props.onBlur(e,t)}),setTimeout(()=>{this.props.onReady&&this.props.onReady(this.editor)}),t})}_destroyEditor(){this.watchdog.destroy(),this.watchdog=null}_shouldUpdateEditor(t){return this.props.data!==t.data&&this.editor.getData()!==t.data}_getConfig(){return this.props.data&&this.props.config.initialData&&console.warn("Editor data should be provided either using `config.initialData` or `data` properties. The config property is over the data value and the first one will be used when specified both."),{...this.props.config,initialData:this.props.config.initialData||this.props.data||""}}}class Sr{constructor(t){this._contextWatchdog=t,this._id=function(){const t=4294967296*Math.random()>>>0,e=4294967296*Math.random()>>>0,r=4294967296*Math.random()>>>0,o=4294967296*Math.random()>>>0;return"e"+Er[t>>0&255]+Er[t>>8&255]+Er[t>>16&255]+Er[t>>24&255]+Er[e>>0&255]+Er[e>>8&255]+Er[e>>16&255]+Er[e>>24&255]+Er[r>>0&255]+Er[r>>8&255]+Er[r>>16&255]+Er[r>>24&255]+Er[o>>0&255]+Er[o>>8&255]+Er[o>>16&255]+Er[o>>24&255]}()}setCreator(t){this._creator=t}create(t,e){return this._contextWatchdog.add({sourceElementOrData:t,config:e,creator:this._creator,id:this._id,type:"editor"})}on(t,e){this._contextWatchdog.on("itemError",(t,{itemId:r,causesRestart:o,error:n})=>{r===this._id&&e(null,{error:n,causesRestart:o})})}destroy(){this._contextWatchdog.remove(this._id)}get editor(){try{return this._contextWatchdog.getItem(this._id)}catch(t){return null}}}Tr.contextType=Cr,Tr.propTypes={editor:a.a.func.isRequired,data:a.a.string,config:a.a.object,onChange:a.a.func,onReady:a.a.func,onFocus:a.a.func,onBlur:a.a.func,onError:a.a.func,disabled:a.a.bool,onInit:(t,e)=>{if(t[e])return new Error('The "onInit" property is not supported anymore by the CKEditor component. Use the "onReady" property instead.')}},Tr.defaultProps={config:{},onError:(t,e)=>console.error(t,e)}}])}));
  //# sourceMappingURL=ckeditor.js.map