{"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[\"pt-br\"]=t[\"pt-br\"]||{};e.dictionary=Object.assign(e.dictionary||{},{\"%0 of %1\":\"%0 de %1\",\"Align cell text to the bottom\":\"Alinhar texto da célula para baixo\",\"Align cell text to the center\":\"Alinhar texto da célula centralizado\",\"Align cell text to the left\":\"Alinhar texto da célula para a esquerda\",\"Align cell text to the middle\":\"Alinhar texto da célula para o meio\",\"Align cell text to the right\":\"Alinhar texto da célula para a direita\",\"Align cell text to the top\":\"Alinhar texto da célula para o topo\",\"Align center\":\"Centralizar\",\"Align left\":\"Alinhar à esquerda\",\"Align right\":\"Alinhar à direita\",\"Align table to the left\":\"Alinhar tabela para esquerda\",\"Align table to the right\":\"Alinhar tabela para direita\",Alignment:\"Alinhamento\",Aquamarine:\"Água-marinha\",Background:\"Cor de fundo\",Big:\"Grande\",Black:\"Preto\",\"Block quote\":\"Bloco de citação\",Blue:\"Azul\",\"Blue marker\":\"Marcador azul\",Bold:\"Negrito\",Border:\"Borda\",\"Bulleted List\":\"Lista com marcadores\",Cancel:\"Cancelar\",\"Cell properties\":\"Propriedades da célula\",\"Center table\":\"Centralizar tabela\",\"Centered image\":\"Imagem centralizada\",\"Change image text alternative\":\"Alterar texto alternativo da imagem\",\"Choose heading\":\"Escolha o título\",Color:\"Cor\",\"Color picker\":\"Seletor de cor\",Column:\"Coluna\",Dashed:\"Tracejada\",Default:\"Padrão\",\"Delete column\":\"Excluir coluna\",\"Delete row\":\"Excluir linha\",\"Dim grey\":\"Cinza escuro\",Dimensions:\"Dimensões\",\"Document colors\":\"Cores do documento\",Dotted:\"Pontilhada\",Double:\"Dupla\",Downloadable:\"Pode ser baixado\",\"Dropdown toolbar\":\"Barra de Ferramentas da Lista Suspensa\",\"Edit link\":\"Editar link\",\"Editor toolbar\":\"Ferramentas do Editor\",\"Font Background Color\":\"Cor de Fundo\",\"Font Color\":\"Cor da Fonte\",\"Font Family\":\"Fonte\",\"Font Size\":\"Tamanho da fonte\",\"Full size image\":\"Imagem completa\",Green:\"Verde\",\"Green marker\":\"Marcador verde\",\"Green pen\":\"Caneta verde\",Grey:\"Cinza\",Groove:\"Ranhura\",\"Header column\":\"Coluna de cabeçalho\",\"Header row\":\"Linha de cabeçalho\",Heading:\"Titulo\",\"Heading 1\":\"Título 1\",\"Heading 2\":\"Título 2\",\"Heading 3\":\"Título 3\",\"Heading 4\":\"Título 4\",\"Heading 5\":\"Título 5\",\"Heading 6\":\"Título 6\",Height:\"Altura\",Highlight:\"Realce\",\"Horizontal line\":\"Linha horizontal\",\"Horizontal text alignment toolbar\":\"Ferramentas de alinhamento horizontal do texto\",Huge:\"Gigante\",\"Image resize list\":\"Lista de redimensionamento de imagem\",\"Image toolbar\":\"Ferramentas de Imagem\",\"image widget\":\"Ferramenta de imagem\",Insert:\"Inserir\",\"Insert column left\":\"Inserir coluna à esquerda\",\"Insert column right\":\"Inserir coluna à direita\",\"Insert image\":\"Inserir imagem\",\"Insert image via URL\":\"Inserir imagem via URL\",\"Insert media\":\"Inserir mídia\",\"Insert paragraph after block\":\"Inserir parágrafo após o bloco\",\"Insert paragraph before block\":\"Inserir parágrafo antes do bloco\",\"Insert row above\":\"Inserir linha acima\",\"Insert row below\":\"Inserir linha abaixo\",\"Insert table\":\"Inserir tabela\",Inset:\"Baixo relevo\",Italic:\"Itálico\",Justify:\"Justificar\",\"Justify cell text\":\"Justificar texto da célula\",\"Left aligned image\":\"Imagem alinhada à esquerda\",\"Light blue\":\"Azul claro\",\"Light green\":\"Verde claro\",\"Light grey\":\"Cinza claro\",Link:\"Link\",\"Link URL\":\"URL\",\"Media URL\":\"URL da mídia\",\"media widget\":\"Ferramenta de mídia\",\"Merge cell down\":\"Mesclar abaixo\",\"Merge cell left\":\"Mesclar à esquerda\",\"Merge cell right\":\"Mesclar à direita\",\"Merge cell up\":\"Mesclar acima\",\"Merge cells\":\"Mesclar células\",Next:\"Próximo\",None:\"Sem borda\",\"Numbered List\":\"Lista numerada\",\"Open in a new tab\":\"Abrir em nova aba\",\"Open link in new tab\":\"Abrir link em nova aba\",Orange:\"Laranja\",Original:\"Original\",Outset:\"Alto relevo\",Padding:\"Margem interna\",Paragraph:\"Parágrafo\",\"Paste the image source URL.\":\"Colar a URL da imagem.\",\"Paste the media URL in the input.\":\"Cole o endereço da mídia no campo.\",\"Pink marker\":\"Marcador rosa\",Previous:\"Anterior\",Purple:\"Púrpura\",Red:\"Vermelho\",\"Red pen\":\"Caneta vermelha\",Redo:\"Refazer\",\"Remove color\":\"Remover cor\",\"Remove highlight\":\"Remover realce\",\"Resize image\":\"Redimensionar imagem\",\"Resize image to %0\":\"Redimensionar a imagem para 0%\",\"Resize image to the original size\":\"Redimensionar a imagem para o tamanho original\",\"Rich Text Editor\":\"Editor de Formatação\",\"Rich Text Editor, %0\":\"Editor de Formatação, %0\",Ridge:\"Crista\",\"Right aligned image\":\"Imagem alinhada à direita\",Row:\"Linha\",Save:\"Salvar\",\"Select all\":\"Selecionar tudo\",\"Select column\":\"Selecionar coluna\",\"Select row\":\"Selecionar linha\",\"Show more items\":\"Exibir mais itens\",\"Side image\":\"Imagem lateral\",Small:\"Pequeno\",Solid:\"Sólida\",\"Split cell horizontally\":\"Dividir horizontalmente\",\"Split cell vertically\":\"Dividir verticalmente\",Style:\"Estilo\",\"Table alignment toolbar\":\"Ferramentas de alinhamento da tabela\",\"Table cell text alignment\":\"Alinhamento do texto na célula\",\"Table properties\":\"Propriedades da tabela\",\"Table toolbar\":\"Ferramentas de Tabela\",\"Text alignment\":\"Alinhamento do texto\",\"Text alignment toolbar\":\"Ferramentas de alinhamento de texto\",\"Text alternative\":\"Texto alternativo\",\"Text highlight toolbar\":\"Ferramentas de realce\",'The color is invalid. Try \"#FF0000\" or \"rgb(255,0,0)\" or \"red\".':'Cor inválida. Tente \"#FF0000\" ou \"rgb(255,0,0)\" ou \"red\"',\"The URL must not be empty.\":\"A URL não pode ficar em branco.\",'The value is invalid. Try \"10px\" or \"2em\" or simply \"2\".':'Valor inválido. Tente \"10px\" ou \"2em\" ou apenas \"2\"',\"This link has no URL\":\"Este link não possui uma URL\",\"This media URL is not supported.\":\"A URL desta mídia não é suportada.\",Tiny:\"Minúsculo\",\"Tip: Paste the URL into the content to embed faster.\":\"Cole o endereço dentro do conteúdo para embutir mais rapidamente.\",Turquoise:\"Turquesa\",Underline:\"Sublinhado\",Undo:\"Desfazer\",Unlink:\"Remover link\",Update:\"Atualizar\",\"Update image URL\":\"\",\"Upload failed\":\"Falha ao subir arquivo\",\"Upload in progress\":\"Enviando dados\",\"Vertical text alignment toolbar\":\"Ferramentas de alinhamento vertical do texto\",White:\"Branco\",\"Widget toolbar\":\"Ferramentas de Widgets\",Width:\"Largura\",Yellow:\"Amarelo\",\"Yellow marker\":\"Marcador amarelo\"});e.getPluralForm=function(t){return t>1}})(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 i=e[o]={i:o,l:false,exports:{}};t[o].call(i.exports,i,i.exports,n);i.l=true;return i.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 i in t)n.d(o,i,function(e){return t[e]}.bind(null,i));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=129)}([function(t,e,n){\"use strict\";n.d(e,\"b\",(function(){return i}));n.d(e,\"a\",(function(){return r}));const o=\"https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html\";class i extends Error{constructor(t,e,n){let o=r(t);if(n){o+=\" \"+JSON.stringify(n)}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 i(t.message,e);n.stack=t.stack;throw n}}function r(t){return t+` Read more: ${o}#error-${t}\\n`}},function(t,e,n){\"use strict\";t.exports=function(t){var e=[];e.toString=function e(){return this.map((function(e){var n=o(e,t);if(e[2]){return\"@media \".concat(e[2],\" {\").concat(n,\"}\")}return n})).join(\"\")};e.i=function(t,n,o){if(typeof t===\"string\"){t=[[null,t,\"\"]]}var i={};if(o){for(var r=0;r
\").replace(/\\r?\\n/g,\"
\").replace(/^\\s/,\" \").replace(/\\s$/,\" \").replace(/\\s\\s/g,\" \");if(t.includes(\"
\")||t.includes(\"
\")){t=`
${t}
`}return t}function aC(t){return t.replace(/(\\s+)<\\/span>/g,((t,e)=>{if(e.length==1){return\" \"}return e}))}const cC=[\"figcaption\",\"li\"];function lC(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=lC(o);if(n&&(n.is(\"containerElement\")||o.is(\"containerElement\"))){if(cC.includes(n.name)||cC.includes(o.name)){e+=\"\\n\"}else{e+=\"\\n\\n\"}}e+=t;n=o}}return e}class dC extends rw{static get pluginName(){return\"Clipboard\"}static get requires(){return[rC]}init(){const t=this.editor;const e=t.model.document;const n=t.editing.view;const o=n.document;this._htmlDataProcessor=new Yp(o);n.addObserver(oC);this.listenTo(o,\"clipboardInput\",(e=>{if(t.isReadOnly){e.stop()}}),{priority:\"highest\"});this.listenTo(o,\"clipboardInput\",((t,e)=>{const o=e.dataTransfer;let i=\"\";if(o.getData(\"text/html\")){i=aC(o.getData(\"text/html\"))}else if(o.getData(\"text/plain\")){i=sC(o.getData(\"text/plain\"))}i=this._htmlDataProcessor.toView(i);const r=new ts(this,\"inputTransformation\");this.fire(r,{content:i,dataTransfer:o,asPlainText:e.asPlainText});if(r.stop.called){t.stop()}n.scrollToTheSelection()}),{priority:\"low\"});this.listenTo(this,\"inputTransformation\",((n,o)=>{if(!o.content.isEmpty){const i=this.editor.data;const r=this.editor.model;const s=i.toModel(o.content,\"$clipboardHolder\");if(s.childCount==0){return}if(o.asPlainText||uC(s)){const n=new Map(Array.from(e.selection.getAttributes()).filter((e=>t.model.schema.getAttributeProperties(e[0]).isFormatting)));r.change((t=>{const e=t.createRangeIn(s);for(const o of e.getItems()){if(o.is(\"$text\")||o.is(\"$textProxy\")){t.setAttributes(n,o)}}}))}r.insertContent(s);n.stop()}}),{priority:\"low\"});function i(n,i){const r=i.dataTransfer;i.preventDefault();const s=t.data.toView(t.model.getSelectedContent(e.selection));o.fire(\"clipboardOutput\",{dataTransfer:r,content:s,method:n.name})}this.listenTo(o,\"copy\",i,{priority:\"low\"});this.listenTo(o,\"cut\",((e,n)=>{if(t.isReadOnly){n.preventDefault()}else{i(e,n)}}),{priority:\"low\"});this.listenTo(o,\"clipboardOutput\",((n,o)=>{if(!o.content.isEmpty){o.dataTransfer.setData(\"text/html\",this._htmlDataProcessor.toData(o.content));o.dataTransfer.setData(\"text/plain\",lC(o.content))}if(o.method==\"cut\"){t.model.deleteContent(e.selection)}}),{priority:\"low\"})}}function uC(t){if(t.childCount>1){return false}const e=t.getChild(0);return[...e.getAttributeKeys()].length==0}function*hC(t,e){for(const n of e){if(n&&t.getAttributeProperties(n[0]).copyOnEnter){yield n}}}class fC extends aw{execute(){const t=this.editor.model;const e=t.document;t.change((n=>{mC(this.editor.model,n,e.selection,t.schema);this.fire(\"afterExecute\",{writer:n})}))}}function mC(t,e,n,o){const i=n.isCollapsed;const r=n.getFirstRange();const s=r.start.parent;const a=r.end.parent;if(o.isLimit(s)||o.isLimit(a)){if(!i&&s==a){t.deleteContent(n)}return}if(i){const t=hC(e.model.schema,n.getAttributes());gC(e,r.start);e.setSelectionAttribute(t)}else{const o=!(r.start.isAtStart&&r.end.isAtEnd);const i=s==a;t.deleteContent(n,{leaveUnmerged:o});if(o){if(i){gC(e,n.focus)}else{e.setSelection(a,0)}}}}function gC(t,e){t.split(e);t.setSelection(e.parent.nextSibling,0)}class pC extends Xd{constructor(t){super(t);const e=this.document;e.on(\"keydown\",((t,n)=>{if(this.isEnabled&&n.keyCode==zl.enter){let o;e.once(\"enter\",(t=>o=t),{priority:\"highest\"});e.fire(\"enter\",new th(e,n.domEvent,{isSoft:n.shiftKey}));if(o&&o.stop.called){t.stop()}}}))}observe(){}}class bC extends rw{static get pluginName(){return\"Enter\"}init(){const t=this.editor;const e=t.editing.view;const n=e.document;e.addObserver(pC);t.commands.add(\"enter\",new fC(t));this.listenTo(n,\"enter\",((n,o)=>{o.preventDefault();if(o.isSoft){return}t.execute(\"enter\");e.scrollToTheSelection()}),{priority:\"low\"})}}class kC extends aw{execute(){const t=this.editor.model;const e=t.document;t.change((n=>{CC(t,n,e.selection);this.fire(\"afterExecute\",{writer:n})}))}refresh(){const t=this.editor.model;const e=t.document;this.isEnabled=wC(t.schema,e.selection)}}function wC(t,e){if(e.rangeCount>1){return false}const n=e.anchor;if(!n||!t.checkChild(n,\"softBreak\")){return false}const o=e.getFirstRange();const i=o.start.parent;const r=o.end.parent;if((_C(i,t)||_C(r,t))&&i!==r){return false}return true}function CC(t,e,n){const o=n.isCollapsed;const i=n.getFirstRange();const r=i.start.parent;const s=i.end.parent;const a=r==s;if(o){const o=hC(t.schema,n.getAttributes());AC(t,e,i.end);e.removeSelectionAttribute(n.getAttributeKeys());e.setSelectionAttribute(o)}else{const o=!(i.start.isAtStart&&i.end.isAtEnd);t.deleteContent(n,{leaveUnmerged:o});if(a){AC(t,e,n.focus)}else{if(o){e.setSelection(s,0)}}}}function AC(t,e,n){const o=e.createElement(\"softBreak\");t.insertContent(o,n);e.setSelection(o,\"after\")}function _C(t,e){if(t.is(\"rootElement\")){return false}return e.isLimit(t)||_C(t.parent,e)}class vC extends rw{static get pluginName(){return\"ShiftEnter\"}init(){const t=this.editor;const e=t.model.schema;const n=t.conversion;const o=t.editing.view;const i=o.document;e.register(\"softBreak\",{allowWhere:\"$text\",isInline:true});n.for(\"upcast\").elementToElement({model:\"softBreak\",view:\"br\"});n.for(\"downcast\").elementToElement({model:\"softBreak\",view:(t,{writer:e})=>e.createEmptyElement(\"br\")});o.addObserver(pC);t.commands.add(\"shiftEnter\",new kC(t));this.listenTo(i,\"enter\",((e,n)=>{n.preventDefault();if(!n.isSoft){return}t.execute(\"shiftEnter\");o.scrollToTheSelection()}),{priority:\"low\"})}}class yC extends aw{execute(){const t=this.editor.model;const e=t.document.selection;let n=t.schema.getLimitElement(e);if(e.containsEntireContent(n)||!xC(t.schema,n)){do{n=n.parent;if(!n){return}}while(!xC(t.schema,n))}t.change((t=>{t.setSelection(n,\"in\")}))}}function xC(t,e){return t.isLimit(e)&&(t.checkChild(e,\"$text\")||t.checkChild(e,\"paragraph\"))}const DC=Ol(\"Ctrl+A\");class EC extends rw{static get pluginName(){return\"SelectAllEditing\"}init(){const t=this.editor;const e=t.editing.view;const n=e.document;t.commands.add(\"selectAll\",new yC(t));this.listenTo(n,\"keydown\",((e,n)=>{if(Ll(n)===DC){t.execute(\"selectAll\");n.preventDefault()}}))}}var MC='';class TC extends rw{static get pluginName(){return\"SelectAllUI\"}init(){const t=this.editor;t.ui.componentFactory.add(\"selectAll\",(e=>{const n=t.commands.get(\"selectAll\");const o=new Tk(e);const i=e.t;o.set({label:i(\"Select all\"),icon:MC,keystroke:\"Ctrl+A\",tooltip:true});o.bind(\"isOn\",\"isEnabled\").to(n,\"value\",\"isEnabled\");this.listenTo(o,\"execute\",(()=>{t.execute(\"selectAll\");t.editing.view.focus()}));return o}))}}class SC extends rw{static get requires(){return[EC,TC]}static get pluginName(){return\"SelectAll\"}}class IC{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 NC extends aw{constructor(t,e){super(t);this._buffer=new IC(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 o=t.text||\"\";const i=o.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(o){e.insertContent(t.createText(o,n.selection.getAttributes()),r)}if(s){t.setSelection(s)}else if(!r.is(\"documentSelection\")){t.setSelection(r)}this._buffer.unlock();this._buffer.input(i)}))}}function BC(t){let e=null;const n=t.model;const o=t.editing.view;const i=t.commands.get(\"input\");if(Dl.isAndroid){o.document.on(\"beforeinput\",((t,e)=>r(e)),{priority:\"lowest\"})}else{o.document.on(\"keydown\",((t,e)=>r(e)),{priority:\"lowest\"})}o.document.on(\"compositionstart\",s,{priority:\"lowest\"});o.document.on(\"compositionend\",(()=>{e=n.createSelection(n.document.selection)}),{priority:\"lowest\"});function r(t){const r=n.document;const s=o.document.isComposing;const c=e&&e.isEqual(r.selection);e=null;if(!i.isEnabled){return}if(zC(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=i.buffer;t.lock();const e=t.batch;i._batches.add(e);n.enqueueChange(e,(()=>{n.deleteContent(n.document.selection)}));t.unlock()}}const PC=[Ll(\"arrowUp\"),Ll(\"arrowRight\"),Ll(\"arrowDown\"),Ll(\"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++){PC.push(t)}function zC(t){if(t.ctrlKey){return true}return PC.includes(t.keyCode)}function LC(t,e){const n=[];let o=0;let i;t.forEach((t=>{if(t==\"equal\"){r();o++}else if(t==\"insert\"){if(s(\"insert\")){i.values.push(e[o])}else{r();i={type:\"insert\",index:o,values:[e[o]]}}o++}else{if(s(\"delete\")){i.howMany++}else{r();i={type:\"delete\",index:o,howMany:1}}}}));r();return n;function r(){if(i){n.push(i);i=null}}function s(t){return i&&i.type==t}}function OC(t){if(t.length==0){return false}for(const e of t){if(e.type===\"children\"&&!RC(e)){return true}}return false}function RC(t){if(t.newChildren.length-t.oldChildren.length!=1){return}const e=Dd(t.oldChildren,t.newChildren,jC);const n=LC(e,t.newChildren);if(n.length>1){return}const o=n[0];if(!(!!o.values[0]&&o.values[0].is(\"$text\"))){return}return o}function jC(t,e){if(!!t&&t.is(\"$text\")&&!!e&&e.is(\"$text\")){return t.data===e.data}else{return t===e}}function FC(t){t.editing.view.document.on(\"mutations\",((e,n,o)=>{new VC(t).handle(n,o)}))}class VC{constructor(t){this.editor=t;this.editing=this.editor.editing}handle(t,e){if(OC(t)){this._handleContainerChildrenMutations(t,e)}else{for(const n of t){this._handleTextMutation(n,e);this._handleTextNodeInsertion(n)}}}_handleContainerChildrenMutations(t,e){const n=UC(t);if(!n){return}const o=this.editor.editing.view.domConverter;const i=o.mapViewToDom(n);const r=new Hd(this.editor.editing.view.document);const s=this.editor.data.toModel(r.domToView(i)).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(!HC(c,m)||!HC(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=Dd(p,g);const{firstChangeAt:k,insertions:w,deletions:C}=WC(b);let A=null;if(e){A=this.editing.mapper.toModelRange(e.getFirstRange())}const _=g.substr(k,w);const v=this.editor.model.createRange(this.editor.model.createPositionAt(a,k),this.editor.model.createPositionAt(a,k+C));this.editor.execute(\"input\",{text:_,range:v,resultRange:A})}_handleTextMutation(t,e){if(t.type!=\"text\"){return}const n=t.newText.replace(/\\u00A0/g,\" \");const o=t.oldText.replace(/\\u00A0/g,\" \");if(o===n){return}const i=Dd(o,n);const{firstChangeAt:r,insertions:s,deletions:a}=WC(i);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=RC(t);const n=this.editing.view.createPositionAt(t.node,e.index);const o=this.editing.mapper.toModelPosition(n);const i=e.values[0].data;this.editor.execute(\"input\",{text:i.replace(/\\u00A0/g,\" \"),range:this.editor.model.createRange(o)})}}function UC(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 HC(t,e){return t.every((t=>e.isInline(t)))}function WC(t){let e=null;let n=null;for(let o=0;o