{"version":3,"file":"ckeditor.js","sources":["webpack://ClassicEditor/ckeditor.js"],"sourcesContent":["/*!\n * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n(function(t){const e=t[\"en\"]=t[\"en\"]||{};e.dictionary=Object.assign(e.dictionary||{},{\"%0 of %1\":\"%0 of %1\",\"Block quote\":\"Block quote\",Bold:\"Bold\",\"Bulleted List\":\"Bulleted List\",Cancel:\"Cancel\",\"Centered image\":\"Centered image\",\"Change image text alternative\":\"Change image text alternative\",\"Choose heading\":\"Choose heading\",Column:\"Column\",\"Decrease indent\":\"Decrease indent\",\"Delete column\":\"Delete column\",\"Delete row\":\"Delete row\",Downloadable:\"Downloadable\",\"Dropdown toolbar\":\"Dropdown toolbar\",\"Edit link\":\"Edit link\",\"Editor toolbar\":\"Editor toolbar\",\"Enter image caption\":\"Enter image caption\",\"Full size image\":\"Full size image\",\"Header column\":\"Header column\",\"Header row\":\"Header row\",Heading:\"Heading\",\"Heading 1\":\"Heading 1\",\"Heading 2\":\"Heading 2\",\"Heading 3\":\"Heading 3\",\"Heading 4\":\"Heading 4\",\"Heading 5\":\"Heading 5\",\"Heading 6\":\"Heading 6\",\"Image toolbar\":\"Image toolbar\",\"image widget\":\"image widget\",\"Increase indent\":\"Increase indent\",\"Insert column left\":\"Insert column left\",\"Insert column right\":\"Insert column right\",\"Insert image\":\"Insert image\",\"Insert media\":\"Insert media\",\"Insert paragraph after block\":\"Insert paragraph after block\",\"Insert paragraph before block\":\"Insert paragraph before block\",\"Insert row above\":\"Insert row above\",\"Insert row below\":\"Insert row below\",\"Insert table\":\"Insert table\",Italic:\"Italic\",\"Left aligned image\":\"Left aligned image\",Link:\"Link\",\"Link URL\":\"Link URL\",\"Media URL\":\"Media URL\",\"media widget\":\"media widget\",\"Merge cell down\":\"Merge cell down\",\"Merge cell left\":\"Merge cell left\",\"Merge cell right\":\"Merge cell right\",\"Merge cell up\":\"Merge cell up\",\"Merge cells\":\"Merge cells\",Next:\"Next\",\"Numbered List\":\"Numbered List\",\"Open in a new tab\":\"Open in a new tab\",\"Open link in new tab\":\"Open link in new tab\",Paragraph:\"Paragraph\",\"Paste the media URL in the input.\":\"Paste the media URL in the input.\",Previous:\"Previous\",Redo:\"Redo\",\"Rich Text Editor\":\"Rich Text Editor\",\"Rich Text Editor, %0\":\"Rich Text Editor, %0\",\"Right aligned image\":\"Right aligned image\",Row:\"Row\",Save:\"Save\",\"Select all\":\"Select all\",\"Select column\":\"Select column\",\"Select row\":\"Select row\",\"Show more items\":\"Show more items\",\"Side image\":\"Side image\",\"Split cell horizontally\":\"Split cell horizontally\",\"Split cell vertically\":\"Split cell vertically\",\"Table toolbar\":\"Table toolbar\",\"Text alternative\":\"Text alternative\",\"The URL must not be empty.\":\"The URL must not be empty.\",\"This link has no URL\":\"This link has no URL\",\"This media URL is not supported.\":\"This media URL is not supported.\",\"Tip: Paste the URL into the content to embed faster.\":\"Tip: Paste the URL into the content to embed faster.\",Undo:\"Undo\",Unlink:\"Unlink\",\"Upload failed\":\"Upload failed\",\"Upload in progress\":\"Upload in progress\",\"Widget toolbar\":\"Widget toolbar\"})})(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));(function t(e,n){if(typeof exports===\"object\"&&typeof module===\"object\")module.exports=n();else if(typeof define===\"function\"&&define.amd)define([],n);else if(typeof exports===\"object\")exports[\"ClassicEditor\"]=n();else e[\"ClassicEditor\"]=n()})(window,(function(){return function(t){var e={};function n(i){if(e[i]){return e[i].exports}var o=e[i]={i:i,l:false,exports:{}};t[i].call(o.exports,o,o.exports,n);o.l=true;return o.exports}n.m=t;n.c=e;n.d=function(t,e,i){if(!n.o(t,e)){Object.defineProperty(t,e,{enumerable:true,get:i})}};n.r=function(t){if(typeof Symbol!==\"undefined\"&&Symbol.toStringTag){Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"})}Object.defineProperty(t,\"__esModule\",{value:true})};n.t=function(t,e){if(e&1)t=n(t);if(e&8)return t;if(e&4&&typeof t===\"object\"&&t&&t.__esModule)return t;var i=Object.create(null);n.r(i);Object.defineProperty(i,\"default\",{enumerable:true,value:t});if(e&2&&typeof t!=\"string\")for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i};n.n=function(t){var e=t&&t.__esModule?function e(){return t[\"default\"]}:function e(){return t};n.d(e,\"a\",e);return e};n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};n.p=\"\";return n(n.s=96)}([function(t,e,n){\"use strict\";n.d(e,\"b\",(function(){return o}));n.d(e,\"a\",(function(){return r}));const i=\"https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html\";class o extends Error{constructor(t,e,n){t=r(t);if(n){t+=\" \"+JSON.stringify(n)}super(t);this.name=\"CKEditorError\";this.context=e;this.data=n}is(t){return t===\"CKEditorError\"}static rethrowUnexpectedError(t,e){if(t.is&&t.is(\"CKEditorError\")){throw t}const n=new o(t.message,e);n.stack=t.stack;throw n}}function r(t){const e=t.match(/^([^:]+):/);if(!e){return t}return t+` Read more: ${i}#error-${e[1]}\\n`}},function(t,e,n){\"use strict\";var i=function t(){var e;return function t(){if(typeof e===\"undefined\"){e=Boolean(window&&document&&document.all&&!window.atob)}return e}}();var o=function t(){var e={};return function t(n){if(typeof e[n]===\"undefined\"){var i=document.querySelector(n);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement){try{i=i.contentDocument.head}catch(t){i=null}}e[n]=i}return e[n]}}();var r=[];function s(t){var e=-1;for(var n=0;n
\").replace(/^\\s/,\" \").replace(/\\s$/,\" \").replace(/\\s\\s/g,\" \");if(t.indexOf(\"
\")>-1){t=`
${t}
`}return t}function Bk(t){return t.replace(/(\\s+)<\\/span>/g,(t,e)=>{if(e.length==1){return\" \"}return e})}const Fk=[\"figcaption\",\"li\"];function Uk(t){let e=\"\";if(t.is(\"$text\")||t.is(\"$textProxy\")){e=t.data}else if(t.is(\"element\",\"img\")&&t.hasAttribute(\"alt\")){e=t.getAttribute(\"alt\")}else{let n=null;for(const i of t.getChildren()){const t=Uk(i);if(n&&(n.is(\"containerElement\")||i.is(\"containerElement\"))){if(Fk.includes(n.name)||Fk.includes(i.name)){e+=\"\\n\"}else{e+=\"\\n\\n\"}}e+=t;n=i}}return e}class Hk extends sk{static get pluginName(){return\"Clipboard\"}init(){const t=this.editor;const e=t.model.document;const n=t.editing.view;const i=n.document;this._htmlDataProcessor=new Wp(i);n.addObserver(Vk);this.listenTo(i,\"clipboardInput\",e=>{if(t.isReadOnly){e.stop()}},{priority:\"highest\"});this.listenTo(i,\"clipboardInput\",(t,e)=>{const i=e.dataTransfer;let o=\"\";if(i.getData(\"text/html\")){o=Bk(i.getData(\"text/html\"))}else if(i.getData(\"text/plain\")){o=zk(i.getData(\"text/plain\"))}o=this._htmlDataProcessor.toView(o);const r=new ts(this,\"inputTransformation\");this.fire(r,{content:o,dataTransfer:i});if(r.stop.called){t.stop()}n.scrollToTheSelection()},{priority:\"low\"});this.listenTo(this,\"inputTransformation\",(t,e)=>{if(!e.content.isEmpty){const n=this.editor.data;const i=this.editor.model;const o=n.toModel(e.content,\"$clipboardHolder\");if(o.childCount==0){return}i.insertContent(o);t.stop()}},{priority:\"low\"});function o(n,o){const r=o.dataTransfer;o.preventDefault();const s=t.data.toView(t.model.getSelectedContent(e.selection));i.fire(\"clipboardOutput\",{dataTransfer:r,content:s,method:n.name})}this.listenTo(i,\"copy\",o,{priority:\"low\"});this.listenTo(i,\"cut\",(e,n)=>{if(t.isReadOnly){n.preventDefault()}else{o(e,n)}},{priority:\"low\"});this.listenTo(i,\"clipboardOutput\",(n,i)=>{if(!i.content.isEmpty){i.dataTransfer.setData(\"text/html\",this._htmlDataProcessor.toData(i.content));i.dataTransfer.setData(\"text/plain\",Uk(i.content))}if(i.method==\"cut\"){t.model.deleteContent(e.selection)}},{priority:\"low\"})}}function*Wk(t,e){for(const n of e){if(n&&t.getAttributeProperties(n[0]).copyOnEnter){yield n}}}class qk extends bk{execute(){const t=this.editor.model;const e=t.document;t.change(n=>{$k(this.editor.model,n,e.selection,t.schema);this.fire(\"afterExecute\",{writer:n})})}}function $k(t,e,n,i){const o=n.isCollapsed;const r=n.getFirstRange();const s=r.start.parent;const a=r.end.parent;if(i.isLimit(s)||i.isLimit(a)){if(!o&&s==a){t.deleteContent(n)}return}if(o){const t=Wk(e.model.schema,n.getAttributes());Yk(e,r.start);e.setSelectionAttribute(t)}else{const i=!(r.start.isAtStart&&r.end.isAtEnd);const o=s==a;t.deleteContent(n,{leaveUnmerged:i});if(i){if(o){Yk(e,n.focus)}else{e.setSelection(a,0)}}}}function Yk(t,e){t.split(e);t.setSelection(e.parent.nextSibling,0)}class Gk extends Zd{constructor(t){super(t);const e=this.document;e.on(\"keydown\",(t,n)=>{if(this.isEnabled&&n.keyCode==Rl.enter){let i;e.once(\"enter\",t=>i=t,{priority:\"highest\"});e.fire(\"enter\",new Xu(e,n.domEvent,{isSoft:n.shiftKey}));if(i&&i.stop.called){t.stop()}}})}observe(){}}class Kk extends sk{static get pluginName(){return\"Enter\"}init(){const t=this.editor;const e=t.editing.view;const n=e.document;e.addObserver(Gk);t.commands.add(\"enter\",new qk(t));this.listenTo(n,\"enter\",(n,i)=>{i.preventDefault();if(i.isSoft){return}t.execute(\"enter\");e.scrollToTheSelection()},{priority:\"low\"})}}class Qk extends bk{execute(){const t=this.editor.model;const e=t.document;t.change(n=>{Zk(t,n,e.selection);this.fire(\"afterExecute\",{writer:n})})}refresh(){const t=this.editor.model;const e=t.document;this.isEnabled=Jk(t.schema,e.selection)}}function Jk(t,e){if(e.rangeCount>1){return false}const n=e.anchor;if(!n||!t.checkChild(n,\"softBreak\")){return false}const i=e.getFirstRange();const o=i.start.parent;const r=i.end.parent;if((t_(o,t)||t_(r,t))&&o!==r){return false}return true}function Zk(t,e,n){const i=n.isCollapsed;const o=n.getFirstRange();const r=o.start.parent;const s=o.end.parent;const a=r==s;if(i){const i=Wk(t.schema,n.getAttributes());Xk(t,e,o.end);e.removeSelectionAttribute(n.getAttributeKeys());e.setSelectionAttribute(i)}else{const i=!(o.start.isAtStart&&o.end.isAtEnd);t.deleteContent(n,{leaveUnmerged:i});if(a){Xk(t,e,n.focus)}else{if(i){e.setSelection(s,0)}}}}function Xk(t,e,n){const i=e.createElement(\"softBreak\");t.insertContent(i,n);e.setSelection(i,\"after\")}function t_(t,e){if(t.is(\"rootElement\")){return false}return e.isLimit(t)||t_(t.parent,e)}class e_ extends sk{static get pluginName(){return\"ShiftEnter\"}init(){const t=this.editor;const e=t.model.schema;const n=t.conversion;const i=t.editing.view;const o=i.document;e.register(\"softBreak\",{allowWhere:\"$text\",isInline:true});n.for(\"upcast\").elementToElement({model:\"softBreak\",view:\"br\"});n.for(\"downcast\").elementToElement({model:\"softBreak\",view:(t,e)=>e.createEmptyElement(\"br\")});i.addObserver(Gk);t.commands.add(\"shiftEnter\",new Qk(t));this.listenTo(o,\"enter\",(e,n)=>{n.preventDefault();if(!n.isSoft){return}t.execute(\"shiftEnter\");i.scrollToTheSelection()},{priority:\"low\"})}}class n_ extends bk{execute(){const t=this.editor.model;const e=t.document.selection;let n=t.schema.getLimitElement(e);if(e.containsEntireContent(n)||!i_(t.schema,n)){do{n=n.parent;if(!n){return}}while(!i_(t.schema,n))}t.change(t=>{t.setSelection(n,\"in\")})}}function i_(t,e){return t.isLimit(e)&&(t.checkChild(e,\"$text\")||t.checkChild(e,\"paragraph\"))}const o_=Ll(\"Ctrl+A\");class r_ extends sk{static get pluginName(){return\"SelectAllEditing\"}init(){const t=this.editor;const e=t.editing.view;const n=e.document;t.commands.add(\"selectAll\",new n_(t));this.listenTo(n,\"keydown\",(e,n)=>{if(Dl(n)===o_){t.execute(\"selectAll\");n.preventDefault()}})}}var s_='';class a_ extends sk{static get pluginName(){return\"SelectAllUI\"}init(){const t=this.editor;t.ui.componentFactory.add(\"selectAll\",e=>{const n=t.commands.get(\"selectAll\");const i=new Cw(e);const o=e.t;i.set({label:o(\"Select all\"),icon:s_,keystroke:\"Ctrl+A\",tooltip:true});i.bind(\"isOn\",\"isEnabled\").to(n,\"value\",\"isEnabled\");this.listenTo(i,\"execute\",()=>{t.execute(\"selectAll\");t.editing.view.focus()});return i})}}class c_ extends sk{static get requires(){return[r_,a_]}static get pluginName(){return\"SelectAll\"}}class l_{constructor(t,e=20){this.model=t;this.size=0;this.limit=e;this.isLocked=false;this._changeCallback=(t,e)=>{if(e.type!=\"transparent\"&&e!==this._batch){this._reset(true)}};this._selectionChangeCallback=()=>{this._reset()};this.model.document.on(\"change\",this._changeCallback);this.model.document.selection.on(\"change:range\",this._selectionChangeCallback);this.model.document.selection.on(\"change:attribute\",this._selectionChangeCallback)}get batch(){if(!this._batch){this._batch=this.model.createBatch()}return this._batch}input(t){this.size+=t;if(this.size>=this.limit){this._reset(true)}}lock(){this.isLocked=true}unlock(){this.isLocked=false}destroy(){this.model.document.off(\"change\",this._changeCallback);this.model.document.selection.off(\"change:range\",this._selectionChangeCallback);this.model.document.selection.off(\"change:attribute\",this._selectionChangeCallback)}_reset(t){if(!this.isLocked||t){this._batch=null;this.size=0}}}class d_ extends bk{constructor(t,e){super(t);this._buffer=new l_(t.model,e);this._batches=new WeakSet}get buffer(){return this._buffer}destroy(){super.destroy();this._buffer.destroy()}execute(t={}){const e=this.editor.model;const n=e.document;const i=t.text||\"\";const o=i.length;const r=t.range?e.createSelection(t.range):n.selection;const s=t.resultRange;e.enqueueChange(this._buffer.batch,t=>{this._buffer.lock();this._batches.add(this._buffer.batch);e.deleteContent(r);if(i){e.insertContent(t.createText(i,n.selection.getAttributes()),r)}if(s){t.setSelection(s)}else if(!r.is(\"documentSelection\")){t.setSelection(r)}this._buffer.unlock();this._buffer.input(o)})}}function u_(t){let e=null;const n=t.model;const i=t.editing.view;const o=t.commands.get(\"input\");if(Tl.isAndroid){i.document.on(\"beforeinput\",(t,e)=>r(e),{priority:\"lowest\"})}else{i.document.on(\"keydown\",(t,e)=>r(e),{priority:\"lowest\"})}i.document.on(\"compositionstart\",s,{priority:\"lowest\"});i.document.on(\"compositionend\",()=>{e=n.createSelection(n.document.selection)},{priority:\"lowest\"});function r(t){const r=n.document;const s=i.document.isComposing;const c=e&&e.isEqual(r.selection);e=null;if(!o.isEnabled){return}if(f_(t)||r.selection.isCollapsed){return}if(s&&t.keyCode===229){return}if(!s&&t.keyCode===229&&c){return}a()}function s(){const t=n.document;const e=t.selection.rangeCount===1?t.selection.getFirstRange().isFlat:true;if(t.selection.isCollapsed||e){return}a()}function a(){const t=o.buffer;t.lock();const e=t.batch;o._batches.add(e);n.enqueueChange(e,()=>{n.deleteContent(n.document.selection)});t.unlock()}}const h_=[Dl(\"arrowUp\"),Dl(\"arrowRight\"),Dl(\"arrowDown\"),Dl(\"arrowLeft\"),9,16,17,18,19,20,27,33,34,35,36,45,91,93,144,145,173,174,175,176,177,178,179,255];for(let t=112;t<=135;t++){h_.push(t)}function f_(t){if(t.ctrlKey){return true}return h_.includes(t.keyCode)}function m_(t,e){const n=[];let i=0;let o;t.forEach(t=>{if(t==\"equal\"){r();i++}else if(t==\"insert\"){if(s(\"insert\")){o.values.push(e[i])}else{r();o={type:\"insert\",index:i,values:[e[i]]}}i++}else{if(s(\"delete\")){o.howMany++}else{r();o={type:\"delete\",index:i,howMany:1}}}});r();return n;function r(){if(o){n.push(o);o=null}}function s(t){return o&&o.type==t}}function g_(t){if(t.length==0){return false}for(const e of t){if(e.type===\"children\"&&!p_(e)){return true}}return false}function p_(t){if(t.newChildren.length-t.oldChildren.length!=1){return}const e=Cd(t.oldChildren,t.newChildren,b_);const n=m_(e,t.newChildren);if(n.length>1){return}const i=n[0];if(!(!!i.values[0]&&i.values[0].is(\"$text\"))){return}return i}function b_(t,e){if(!!t&&t.is(\"$text\")&&!!e&&e.is(\"$text\")){return t.data===e.data}else{return t===e}}function w_(t){t.editing.view.document.on(\"mutations\",(e,n,i)=>{new k_(t).handle(n,i)})}class k_{constructor(t){this.editor=t;this.editing=this.editor.editing}handle(t,e){if(g_(t)){this._handleContainerChildrenMutations(t,e)}else{for(const n of t){this._handleTextMutation(n,e);this._handleTextNodeInsertion(n)}}}_handleContainerChildrenMutations(t,e){const n=__(t);if(!n){return}const i=this.editor.editing.view.domConverter;const o=i.mapViewToDom(n);const r=new Ud(this.editor.editing.view.document);const s=this.editor.data.toModel(r.domToView(o)).getChild(0);const a=this.editor.editing.mapper.toModelElement(n);if(!a){return}const c=Array.from(s.getChildren());const l=Array.from(a.getChildren());const d=c[c.length-1];const u=l[l.length-1];const h=d&&d.is(\"element\",\"softBreak\");const f=u&&!u.is(\"element\",\"softBreak\");if(h&&f){c.pop()}const m=this.editor.model.schema;if(!v_(c,m)||!v_(l,m)){return}const g=c.map(t=>t.is(\"$text\")?t.data:\"@\").join(\"\").replace(/\\u00A0/g,\" \");const p=l.map(t=>t.is(\"$text\")?t.data:\"@\").join(\"\").replace(/\\u00A0/g,\" \");if(p===g){return}const b=Cd(p,g);const{firstChangeAt:w,insertions:k,deletions:_}=y_(b);let v=null;if(e){v=this.editing.mapper.toModelRange(e.getFirstRange())}const y=g.substr(w,k);const x=this.editor.model.createRange(this.editor.model.createPositionAt(a,w),this.editor.model.createPositionAt(a,w+_));this.editor.execute(\"input\",{text:y,range:x,resultRange:v})}_handleTextMutation(t,e){if(t.type!=\"text\"){return}const n=t.newText.replace(/\\u00A0/g,\" \");const i=t.oldText.replace(/\\u00A0/g,\" \");if(i===n){return}const o=Cd(i,n);const{firstChangeAt:r,insertions:s,deletions:a}=y_(o);let c=null;if(e){c=this.editing.mapper.toModelRange(e.getFirstRange())}const l=this.editing.view.createPositionAt(t.node,r);const d=this.editing.mapper.toModelPosition(l);const u=this.editor.model.createRange(d,d.getShiftedBy(a));const h=n.substr(r,s);this.editor.execute(\"input\",{text:h,range:u,resultRange:c})}_handleTextNodeInsertion(t){if(t.type!=\"children\"){return}const e=p_(t);const n=this.editing.view.createPositionAt(t.node,e.index);const i=this.editing.mapper.toModelPosition(n);const o=e.values[0].data;this.editor.execute(\"input\",{text:o.replace(/\\u00A0/g,\" \"),range:this.editor.model.createRange(i)})}}function __(t){const e=t.map(t=>t.node).reduce((t,e)=>t.getCommonAncestor(e,{includeSelf:true}));if(!e){return}return e.getAncestors({includeSelf:true,parentFirst:true}).find(t=>t.is(\"containerElement\")||t.is(\"rootElement\"))}function v_(t,e){return t.every(t=>e.isInline(t))}function y_(t){let e=null;let n=null;for(let i=0;i