{"version":3,"file":"ckeditor.js","sources":["webpack://ClassicEditor/ckeditor.js"],"sourcesContent":["/*!\n * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n(function(t){const e=t[\"cs\"]=t[\"cs\"]||{};e.dictionary=Object.assign(e.dictionary||{},{\"%0 of %1\":\"%0 z %1\",Aquamarine:\"Akvamarínová\",Big:\"Velké\",Black:\"Černá\",Blue:\"Modrá\",Bold:\"Tučné\",Default:\"Výchozí\",\"Dim grey\":\"Tmavě šedá\",\"Document colors\":\"Barvy dokumentu\",\"Dropdown toolbar\":\"Rozbalovací panel nástrojů\",\"Edit block\":\"Upravit blok\",\"Editor toolbar\":\"Panel nástrojů editoru\",\"Font Color\":\"Barva písma\",\"Font Size\":\"Velikost písma\",Green:\"Zelená\",Grey:\"Šedá\",Huge:\"Obrovské\",\"Insert paragraph after block\":\"Vložte odstavec za blok\",\"Insert paragraph before block\":\"Vložte odstavec před blok\",Italic:\"Kurzíva\",\"Light blue\":\"Světle modrá\",\"Light green\":\"Světle zelená\",\"Light grey\":\"Světle šedá\",Next:\"Další\",Orange:\"Oranžová\",Previous:\"Předchozí\",Purple:\"Fialová\",Red:\"Červená\",Redo:\"Znovu\",\"Remove color\":\"Odstranit barvu\",\"Rich Text Editor\":\"Textový editor\",\"Rich Text Editor, %0\":\"Textový editor, %0\",\"Select all\":\"Vybrat vše\",\"Show more items\":\"Zobrazit další položky\",Small:\"Malé\",Tiny:\"Drobné\",Turquoise:\"Tyrkysová\",Underline:\"Podtržené\",Undo:\"Zpět\",White:\"Bílá\",Yellow:\"Žlutá\"});e.getPluralForm=function(t){return t==1&&t%1==0?0:t>=2&&t<=4&&t%1==0?1:t%1!=0?2:3}})(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(o){if(e[o]){return e[o].exports}var r=e[o]={i:o,l:false,exports:{}};t[o].call(r.exports,r,r.exports,n);r.l=true;return r.exports}n.m=t;n.c=e;n.d=function(t,e,o){if(!n.o(t,e)){Object.defineProperty(t,e,{enumerable:true,get:o})}};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 o=Object.create(null);n.r(o);Object.defineProperty(o,\"default\",{enumerable:true,value:t});if(e&2&&typeof t!=\"string\")for(var r in t)n.d(o,r,function(e){return t[e]}.bind(null,r));return o};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=43)}([function(t,e,n){\"use strict\";n.d(e,\"a\",(function(){return r}));n.d(e,\"b\",(function(){return i}));const o=\"https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html\";class r extends Error{constructor(t,e,n){const o=`${t}${n?` ${JSON.stringify(n)}`:\"\"}${a(t)}`;super(o);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 r(t.message,e);n.stack=t.stack;throw n}}function i(t,e){console.warn(...c(t,e))}function s(t,e){console.error(...c(t,e))}function a(t){return`\\nRead more: ${o}#error-${t}`}function c(t,e){const n=a(t);return e?[t,e,n]:[t,n]}},function(t,e,n){\"use strict\";var o=function t(){var e;return function t(){if(typeof e===\"undefined\"){e=Boolean(window&&document&&document.all&&!window.atob)}return e}}();var r=function t(){var e={};return function t(n){if(typeof e[n]===\"undefined\"){var o=document.querySelector(n);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement){try{o=o.contentDocument.head}catch(t){o=null}}e[n]=o}return e[n]}}();var i=[];function s(t){var e=-1;for(var n=0;n0){if(++e>=Gt){return arguments[0]}}else{e=0}return t.apply(undefined,arguments)}}var Ut=Ht;var Jt=Ut(qt);var Yt=Jt;function Qt(t,e){return Yt(Vt(t,e,Ft),t+\"\")}var Xt=Qt;var Zt=9007199254740991;function te(t){return typeof t==\"number\"&&t>-1&&t%1==0&&t<=Zt}var ee=te;function ne(t){return t!=null&&ee(t.length)&&!X(t)}var oe=ne;var re=9007199254740991;var ie=/^(?:0|[1-9]\\d*)$/;function se(t,e){var n=typeof t;e=e==null?re:e;return!!e&&(n==\"number\"||n!=\"symbol\"&&ie.test(t))&&(t>-1&&t%1==0&&t
\").replace(/\\r?\\n/g,\"
\").replace(/^\\s/,\" \").replace(/\\s$/,\" \").replace(/\\s\\s/g,\" \");if(t.includes(\"
\")||t.includes(\"
\")){t=`
${t}
`}return t}function jA(t){return t.replace(/(\\s+)<\\/span>/g,((t,e)=>{if(e.length==1){return\" \"}return e}))}const qA=[\"figcaption\",\"li\"];function GA(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 if(t.is(\"element\",\"br\")){e=\"\\n\"}else{let n=null;for(const o of t.getChildren()){const t=GA(o);if(n&&(n.is(\"containerElement\")||o.is(\"containerElement\"))){if(qA.includes(n.name)||qA.includes(o.name)){e+=\"\\n\"}else{e+=\"\\n\\n\"}}e+=t;n=o}}return e}class $A extends jn{static get pluginName(){return\"ClipboardPipeline\"}init(){const t=this.editor;const e=t.editing.view;e.addObserver(VA);this._setupPasteDrop();this._setupCopyCut()}_setupPasteDrop(){const t=this.editor;const e=t.model;const n=t.editing.view;const o=n.document;this.listenTo(o,\"clipboardInput\",(e=>{if(t.isReadOnly){e.stop()}}),{priority:\"highest\"});this.listenTo(o,\"clipboardInput\",((t,e)=>{const o=e.dataTransfer;let r=e.content||\"\";if(!r){if(o.getData(\"text/html\")){r=jA(o.getData(\"text/html\"))}else if(o.getData(\"text/plain\")){r=KA(o.getData(\"text/plain\"))}r=this.editor.data.htmlProcessor.toView(r)}const s=new i(this,\"inputTransformation\");this.fire(s,{content:r,dataTransfer:o,targetRanges:e.targetRanges,method:e.method});if(s.stop.called){t.stop()}n.scrollToTheSelection()}),{priority:\"low\"});this.listenTo(this,\"inputTransformation\",((t,n)=>{if(n.content.isEmpty){return}const o=this.editor.data;const r=o.toModel(n.content,\"$clipboardHolder\");if(r.childCount==0){return}t.stop();e.change((()=>{this.fire(\"contentInsertion\",{content:r,method:n.method,dataTransfer:n.dataTransfer,targetRanges:n.targetRanges})}))}),{priority:\"low\"});this.listenTo(this,\"contentInsertion\",((t,n)=>{n.resultRange=e.insertContent(n.content)}),{priority:\"low\"})}_setupCopyCut(){const t=this.editor;const e=t.model.document;const n=t.editing.view;const o=n.document;function r(n,r){const i=r.dataTransfer;r.preventDefault();const s=t.data.toView(t.model.getSelectedContent(e.selection));o.fire(\"clipboardOutput\",{dataTransfer:i,content:s,method:n.name})}this.listenTo(o,\"copy\",r,{priority:\"low\"});this.listenTo(o,\"cut\",((e,n)=>{if(t.isReadOnly){n.preventDefault()}else{r(e,n)}}),{priority:\"low\"});this.listenTo(o,\"clipboardOutput\",((n,o)=>{if(!o.content.isEmpty){o.dataTransfer.setData(\"text/html\",this.editor.data.htmlProcessor.toData(o.content));o.dataTransfer.setData(\"text/plain\",GA(o.content))}if(o.method==\"cut\"){t.model.deleteContent(e.selection)}}),{priority:\"low\"})}}function*WA(t,e){for(const n of e){if(n&&t.getAttributeProperties(n[0]).copyOnEnter){yield n}}}class HA extends Gn{execute(){const t=this.editor.model;const e=t.document;t.change((n=>{UA(this.editor.model,n,e.selection,t.schema);this.fire(\"afterExecute\",{writer:n})}))}}function UA(t,e,n,o){const r=n.isCollapsed;const i=n.getFirstRange();const s=i.start.parent;const a=i.end.parent;if(o.isLimit(s)||o.isLimit(a)){if(!r&&s==a){t.deleteContent(n)}return}if(r){const t=WA(e.model.schema,n.getAttributes());JA(e,i.start);e.setSelectionAttribute(t)}else{const o=!(i.start.isAtStart&&i.end.isAtEnd);const r=s==a;t.deleteContent(n,{leaveUnmerged:o});if(o){if(r){JA(e,n.focus)}else{e.setSelection(a,0)}}}}function JA(t,e){t.split(e);t.setSelection(e.parent.nextSibling,0)}class YA extends Ah{constructor(t){super(t);const e=this.document;e.on(\"keydown\",((t,n)=>{if(this.isEnabled&&n.keyCode==td.enter){const o=new Dl(e,\"enter\",e.selection.getFirstRange());e.fire(o,new yu(e,n.domEvent,{isSoft:n.shiftKey}));if(o.stop.called){t.stop()}}}))}observe(){}}class QA extends jn{static get pluginName(){return\"Enter\"}init(){const t=this.editor;const e=t.editing.view;const n=e.document;e.addObserver(YA);t.commands.add(\"enter\",new HA(t));this.listenTo(n,\"enter\",((n,o)=>{o.preventDefault();if(o.isSoft){return}t.execute(\"enter\");e.scrollToTheSelection()}),{priority:\"low\"})}}class XA{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 ZA extends Gn{constructor(t,e){super(t);this.direction=e;this._buffer=new XA(t.model,t.config.get(\"typing.undoStep\"))}get buffer(){return this._buffer}execute(t={}){const e=this.editor.model;const n=e.document;e.enqueueChange(this._buffer.batch,(o=>{this._buffer.lock();const r=o.createSelection(t.selection||n.selection);const i=t.sequence||1;const s=r.isCollapsed;if(r.isCollapsed){e.modifySelection(r,{direction:this.direction,unit:t.unit})}if(this._shouldEntireContentBeReplacedWithParagraph(i)){this._replaceEntireContentWithParagraph(o);return}if(this._shouldReplaceFirstBlockWithParagraph(r,i)){this.editor.execute(\"paragraph\",{selection:r});return}if(r.isCollapsed){return}let a=0;r.getFirstRange().getMinimalFlatRanges().forEach((t=>{a+=yl(t.getWalker({singleCharacters:true,ignoreElementEnd:true,shallow:true}))}));e.deleteContent(r,{doNotResetEntireContent:s,direction:this.direction});this._buffer.input(a);o.setSelection(r);this._buffer.unlock()}))}_shouldEntireContentBeReplacedWithParagraph(t){if(t>1){return false}const e=this.editor.model;const n=e.document;const o=n.selection;const r=e.schema.getLimitElement(o);const i=o.isCollapsed&&o.containsEntireContent(r);if(!i){return false}if(!e.schema.checkChild(r,\"paragraph\")){return false}const s=r.getChild(0);if(s&&s.name===\"paragraph\"){return false}return true}_replaceEntireContentWithParagraph(t){const e=this.editor.model;const n=e.document;const o=n.selection;const r=e.schema.getLimitElement(o);const i=t.createElement(\"paragraph\");t.remove(t.createRangeIn(r));t.insert(i,r);t.setSelection(i,0)}_shouldReplaceFirstBlockWithParagraph(t,e){const n=this.editor.model;if(e>1||this.direction!=\"backward\"){return false}if(!t.isCollapsed){return false}const o=t.getFirstPosition();const r=n.schema.getLimitElement(o);const i=r.getChild(0);if(o.parent!=i){return false}if(!t.containsEntireContent(i)){return false}if(!n.schema.checkChild(r,\"paragraph\")){return false}if(i.name==\"paragraph\"){return false}return true}}class ty extends Ah{constructor(t){super(t);const e=t.document;let n=0;e.on(\"keyup\",((t,e)=>{if(e.keyCode==td.delete||e.keyCode==td.backspace){n=0}}));e.on(\"keydown\",((t,e)=>{const r={};if(e.keyCode==td.delete){r.direction=\"forward\";r.unit=\"character\"}else if(e.keyCode==td.backspace){r.direction=\"backward\";r.unit=\"codePoint\"}else{return}const i=$l.isMac?e.altKey:e.ctrlKey;r.unit=i?\"word\":r.unit;r.sequence=++n;o(t,e.domEvent,r)}));if($l.isAndroid){e.on(\"beforeinput\",((e,n)=>{if(n.domEvent.inputType!=\"deleteContentBackward\"){return}const r={unit:\"codepoint\",direction:\"backward\",sequence:1};const i=n.domTarget.ownerDocument.defaultView.getSelection();if(i.anchorNode==i.focusNode&&i.anchorOffset+1!=i.focusOffset){r.selectionToRemove=t.domConverter.domSelectionToView(i)}o(e,n.domEvent,r)}))}function o(t,n,o){const r=new Dl(e,\"delete\",e.selection.getFirstRange());e.fire(r,new yu(e,n,o));if(r.stop.called){t.stop()}}}observe(){}}class ey extends jn{static get pluginName(){return\"Delete\"}init(){const t=this.editor;const e=t.editing.view;const n=e.document;e.addObserver(ty);const o=new ZA(t,\"forward\");t.commands.add(\"deleteForward\",o);t.commands.add(\"forwardDelete\",o);t.commands.add(\"delete\",new ZA(t,\"backward\"));this.listenTo(n,\"delete\",((n,o)=>{const r={unit:o.unit,sequence:o.sequence};if(o.selectionToRemove){const e=t.model.createSelection();const n=[];for(const e of o.selectionToRemove.getRanges()){n.push(t.editing.mapper.toModelRange(e))}e.setTo(n);r.selection=e}t.execute(o.direction==\"forward\"?\"deleteForward\":\"delete\",r);o.preventDefault();e.scrollToTheSelection()}),{priority:\"low\"});if($l.isAndroid){let t=null;this.listenTo(n,\"delete\",((e,n)=>{const o=n.domTarget.ownerDocument.defaultView.getSelection();t={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}}),{priority:\"lowest\"});this.listenTo(n,\"keyup\",((e,n)=>{if(t){const e=n.domTarget.ownerDocument.defaultView.getSelection();e.collapse(t.anchorNode,t.anchorOffset);e.extend(t.focusNode,t.focusOffset);t=null}}))}}}class ny{constructor(){this._stack=[]}add(t,e){const n=this._stack;const o=n[0];this._insertDescriptor(t);const r=n[0];if(o!==r&&!oy(o,r)){this.fire(\"change:top\",{oldDescriptor:o,newDescriptor:r,writer:e})}}remove(t,e){const n=this._stack;const o=n[0];this._removeDescriptor(t);const r=n[0];if(o!==r&&!oy(o,r)){this.fire(\"change:top\",{oldDescriptor:o,newDescriptor:r,writer:e})}}_insertDescriptor(t){const e=this._stack;const n=e.findIndex((e=>e.id===t.id));if(oy(t,e[n])){return}if(n>-1){e.splice(n,1)}let o=0;while(e[o]&&ry(e[o],t)){o++}e.splice(o,0,t)}_removeDescriptor(t){const e=this._stack;const n=e.findIndex((e=>e.id===t));if(n>-1){e.splice(n,1)}}}Kn(ny,g);function oy(t,e){return t&&e&&t.priority==e.priority&&iy(t.classes)==iy(e.classes)}function ry(t,e){if(t.priority>e.priority){return true}else if(t.priority