{"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\",Bold:\"Negrito\",Border:\"Borda\",\"Bulleted List\":\"Lista com marcadores\",Cancel:\"Cancelar\",\"Cannot upload file:\":\"Não foi possível enviar o arquivo:\",\"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\",\"Could not insert image at the current position.\":\"Não foi possível inserir a imagem na posição atual\",\"Could not obtain resized image URL.\":\"Não foi possível obter o endereço da imagem redimensionada\",Dashed:\"Tracejada\",\"Decrease indent\":\"Diminuir indentação\",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\",\"Enter image caption\":\"Inserir legenda da imagem\",\"Font Color\":\"Cor da Fonte\",\"Font Family\":\"Fonte\",\"Font Size\":\"Tamanho da fonte\",\"Full size image\":\"Imagem completa\",Green:\"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\",\"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\",\"Increase indent\":\"Aumentar indentação\",\"Insert column left\":\"Inserir coluna à esquerda\",\"Insert column right\":\"Inserir coluna à direita\",\"Insert image\":\"Inserir imagem\",\"Insert image or file\":\"Inserir imagem ou arquivo\",\"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\",\"Inserting image failed\":\"Falha ao inserir imagem\",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\",\"Page break\":\"Quebra de página\",Paragraph:\"Parágrafo\",\"Paste the media URL in the input.\":\"Cole o endereço da mídia no campo.\",Previous:\"Anterior\",Purple:\"Púrpura\",Red:\"Vermelho\",Redo:\"Refazer\",\"Remove color\":\"Remover cor\",\"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\",\"Selecting resized image failed\":\"Seleção da imagem redimensionada falhou\",\"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\",'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\",Undo:\"Desfazer\",Unlink:\"Remover link\",\"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\"});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=71)}([function(t,e,n){\"use strict\";n.d(e,\"a\",(function(){return i}));n.d(e,\"c\",(function(){return r}));n.d(e,\"b\",(function(){return s}));const o=\"https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html\";class i 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 i(t.message,e);n.stack=t.stack;throw n}}function r(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 i=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 r=[];function s(t){var e=-1;for(var n=0;n
\").replace(/\\r?\\n/g,\"
\").replace(/^\\s/,\" \").replace(/\\s$/,\" \").replace(/\\s\\s/g,\" \");if(t.includes(\"
\")||t.includes(\"
\")){t=`
${t}
`}return t}function M_(t){return t.replace(/(\\s+)<\\/span>/g,((t,e)=>{if(e.length==1){return\" \"}return e}))}const I_=[\"figcaption\",\"li\"];function N_(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=N_(o);if(n&&(n.is(\"containerElement\")||o.is(\"containerElement\"))){if(I_.includes(n.name)||I_.includes(o.name)){e+=\"\\n\"}else{e+=\"\\n\\n\"}}e+=t;n=o}}return e}class B_ extends tC{static get pluginName(){return\"Clipboard\"}static get requires(){return[T_]}init(){const t=this.editor;const e=t.model.document;const n=t.editing.view;const o=n.document;this._htmlDataProcessor=new $p(o);n.addObserver(D_);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=M_(o.getData(\"text/html\"))}else if(o.getData(\"text/plain\")){i=S_(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||P_(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\",N_(o.content))}if(o.method==\"cut\"){t.model.deleteContent(e.selection)}}),{priority:\"low\"})}}function P_(t){if(t.childCount>1){return false}const e=t.getChild(0);return[...e.getAttributeKeys()].length==0}class z_{constructor(){this._definitions=new Set}get length(){return this._definitions.size}add(t){if(Array.isArray(t)){t.forEach((t=>this._definitions.add(t)))}else{this._definitions.add(t)}}getDispatcher(){return t=>{t.on(\"attribute:linkHref\",((t,e,n)=>{if(!n.consumable.test(e.item,\"attribute:linkHref\")){return}const o=n.writer;const i=o.document.selection;for(const t of this._definitions){const r=o.createAttributeElement(\"a\",t.attributes,{priority:5});o.setCustomProperty(\"link\",true,r);if(t.callback(e.attributeNewValue)){if(e.item.is(\"selection\")){o.wrap(i.getFirstRange(),r)}else{o.wrap(n.mapper.toViewRange(e.range),r)}}else{o.unwrap(n.mapper.toViewRange(e.range),r)}}}),{priority:\"high\"})}}getDispatcherForLinkedImage(){return t=>{t.on(\"attribute:linkHref:image\",((t,e,n)=>{const o=n.mapper.toViewElement(e.item);const i=Array.from(o.getChildren()).find((t=>t.name===\"a\"));for(const t of this._definitions){const o=Hs(t.attributes);if(t.callback(e.attributeNewValue)){for(const[t,e]of o){if(t===\"class\"){n.writer.addClass(e,i)}else{n.writer.setAttribute(t,e,i)}}}else{for(const[t,e]of o){if(t===\"class\"){n.writer.removeClass(e,i)}else{n.writer.removeAttribute(t,i)}}}}}))}}}function L_(t,e,n){var o=t.length;n=n===undefined?o:n;return!e&&n>=o?t:Na(t,e,n)}var O_=L_;var R_=\"\\\\ud800-\\\\udfff\",j_=\"\\\\u0300-\\\\u036f\",F_=\"\\\\ufe20-\\\\ufe2f\",V_=\"\\\\u20d0-\\\\u20ff\",U_=j_+F_+V_,H_=\"\\\\ufe0e\\\\ufe0f\";var W_=\"\\\\u200d\";var K_=RegExp(\"[\"+W_+R_+U_+H_+\"]\");function G_(t){return K_.test(t)}var q_=G_;function Y_(t){return t.split(\"\")}var Q_=Y_;var $_=\"\\\\ud800-\\\\udfff\",J_=\"\\\\u0300-\\\\u036f\",Z_=\"\\\\ufe20-\\\\ufe2f\",X_=\"\\\\u20d0-\\\\u20ff\",tv=J_+Z_+X_,ev=\"\\\\ufe0e\\\\ufe0f\";var nv=\"[\"+$_+\"]\",ov=\"[\"+tv+\"]\",iv=\"\\\\ud83c[\\\\udffb-\\\\udfff]\",rv=\"(?:\"+ov+\"|\"+iv+\")\",sv=\"[^\"+$_+\"]\",av=\"(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}\",cv=\"[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]\",lv=\"\\\\u200d\";var dv=rv+\"?\",uv=\"[\"+ev+\"]?\",hv=\"(?:\"+lv+\"(?:\"+[sv,av,cv].join(\"|\")+\")\"+uv+dv+\")*\",fv=uv+dv+hv,mv=\"(?:\"+[sv+ov+\"?\",ov,av,cv,nv].join(\"|\")+\")\";var gv=RegExp(iv+\"(?=\"+iv+\")|\"+mv+fv,\"g\");function pv(t){return t.match(gv)||[]}var bv=pv;function kv(t){return q_(t)?bv(t):Q_(t)}var wv=kv;function Cv(t){return function(e){e=Aa(e);var n=q_(e)?wv(e):undefined;var o=n?n[0]:e.charAt(0);var i=n?O_(n,1).join(\"\"):e.slice(1);return o[t]()+i}}var Av=Cv;var _v=Av(\"toUpperCase\");var vv=_v;const yv=/[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205f\\u3000]/g;const xv=/^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i;const Dv=/^[\\S]+@((?![-_])(?:[-\\w\\u00a1-\\uffff]{0,63}[^-_]\\.))+(?:[a-z\\u00a1-\\uffff]{2,})$/i;const Ev=/^((\\w+:(\\/{2,})?)|(\\W))/i;const Tv=\"Ctrl+K\";function Sv(t){return t.is(\"attributeElement\")&&!!t.getCustomProperty(\"link\")}function Mv(t,{writer:e}){const n=e.createAttributeElement(\"a\",{href:t},{priority:5});e.setCustomProperty(\"link\",true,n);return n}function Iv(t){t=String(t);return Nv(t)?t:\"#\"}function Nv(t){const e=t.replace(yv,\"\");return e.match(xv)}function Bv(t,e){const n={\"Open in a new tab\":t(\"Open in a new tab\"),Downloadable:t(\"Downloadable\")};e.forEach((t=>{if(t.label&&n[t.label]){t.label=n[t.label]}return t}));return e}function Pv(t){const e=[];if(t){for(const[n,o]of Object.entries(t)){const t=Object.assign({},o,{id:`link${vv(n)}`});e.push(t)}}return e}function zv(t,e){if(!t){return false}return t.is(\"element\",\"image\")&&e.checkAttribute(\"image\",\"linkHref\")}function Lv(t){return Dv.test(t)}function Ov(t,e){const n=Lv(t)?\"mailto:\":e;const o=!!n&&!Ev.test(t);return t&&o?n+t:t}class Rv extends nC{constructor(t){super(t);this.manualDecorators=new vs;this.automaticDecorators=new z_}restoreManualDecoratorStates(){for(const t of this.manualDecorators){t.value=this._getDecoratorStateFromModel(t.id)}}refresh(){const t=this.editor.model;const e=t.document;const n=iC(e.selection.getSelectedBlocks());if(zv(n,t.schema)){this.value=n.getAttribute(\"linkHref\");this.isEnabled=t.schema.checkAttribute(n,\"linkHref\")}else{this.value=e.selection.getAttribute(\"linkHref\");this.isEnabled=t.schema.checkAttributeInSelection(e.selection,\"linkHref\")}for(const t of this.manualDecorators){t.value=this._getDecoratorStateFromModel(t.id)}}execute(t,e={}){const n=this.editor.model;const o=n.document.selection;const i=[];const r=[];for(const t in e){if(e[t]){i.push(t)}else{r.push(t)}}n.change((e=>{if(o.isCollapsed){const s=o.getFirstPosition();if(o.hasAttribute(\"linkHref\")){const a=s_(s,\"linkHref\",o.getAttribute(\"linkHref\"),n);e.setAttribute(\"linkHref\",t,a);i.forEach((t=>{e.setAttribute(t,true,a)}));r.forEach((t=>{e.removeAttribute(t,a)}));e.setSelection(e.createPositionAfter(a.end.nodeBefore))}else if(t!==\"\"){const r=Hs(o.getAttributes());r.set(\"linkHref\",t);i.forEach((t=>{r.set(t,true)}));const a=e.createText(t,r);n.insertContent(a,s);e.setSelection(e.createPositionAfter(a))}[\"linkHref\",...i,...r].forEach((t=>{e.removeSelectionAttribute(t)}))}else{const s=n.schema.getValidRanges(o.getRanges(),\"linkHref\");const a=[];for(const t of o.getSelectedBlocks()){if(n.schema.checkAttribute(t,\"linkHref\")){a.push(e.createRangeOn(t))}}const c=a.slice();for(const t of s){if(this._isRangeToUpdate(t,a)){c.push(t)}}for(const n of c){e.setAttribute(\"linkHref\",t,n);i.forEach((t=>{e.setAttribute(t,true,n)}));r.forEach((t=>{e.removeAttribute(t,n)}))}}}))}_getDecoratorStateFromModel(t){const e=this.editor.model;const n=e.document;const o=iC(n.selection.getSelectedBlocks());if(zv(o,e.schema)){return o.getAttribute(t)}return n.selection.getAttribute(t)}_isRangeToUpdate(t,e){for(const n of e){if(n.containsRange(t)){return false}}return true}}class jv extends nC{refresh(){const t=this.editor.model;const e=t.document;const n=iC(e.selection.getSelectedBlocks());if(zv(n,t.schema)){this.isEnabled=t.schema.checkAttribute(n,\"linkHref\")}else{this.isEnabled=t.schema.checkAttributeInSelection(e.selection,\"linkHref\")}}execute(){const t=this.editor;const e=this.editor.model;const n=e.document.selection;const o=t.commands.get(\"link\");e.change((t=>{const i=n.isCollapsed?[s_(n.getFirstPosition(),\"linkHref\",n.getAttribute(\"linkHref\"),e)]:n.getRanges();for(const e of i){t.removeAttribute(\"linkHref\",e);if(o){for(const n of o.manualDecorators){t.removeAttribute(n.id,e)}}}}))}}class Fv{constructor({id:t,label:e,attributes:n,defaultValue:o}){this.id=t;this.set(\"value\");this.defaultValue=o;this.label=e;this.attributes=n}}_s(Fv,$c);var Vv=n(29);var Uv={injectType:\"singletonStyleTag\",attributes:{\"data-cke\":true}};Uv.insert=\"head\";Uv.singleton=true;var Hv=ib()(Vv[\"a\"],Uv);var Wv=Vv[\"a\"].locals||{};const Kv=\"ck-link_selected\";const Gv=\"automatic\";const qv=\"manual\";const Yv=/^(https?:)?\\/\\//;class Qv extends tC{static get pluginName(){return\"LinkEditing\"}static get requires(){return[t_,v_,B_]}constructor(t){super(t);t.config.define(\"link\",{addTargetToExternalLinks:false})}init(){const t=this.editor;t.model.schema.extend(\"$text\",{allowAttributes:\"linkHref\"});t.conversion.for(\"dataDowncast\").attributeToElement({model:\"linkHref\",view:Mv});t.conversion.for(\"editingDowncast\").attributeToElement({model:\"linkHref\",view:(t,e)=>Mv(Iv(t),e)});t.conversion.for(\"upcast\").elementToAttribute({view:{name:\"a\",attributes:{href:true}},model:{key:\"linkHref\",value:t=>t.getAttribute(\"href\")}});t.commands.add(\"link\",new Rv(t));t.commands.add(\"unlink\",new jv(t));const e=Bv(t.t,Pv(t.config.get(\"link.decorators\")));this._enableAutomaticDecorators(e.filter((t=>t.mode===Gv)));this._enableManualDecorators(e.filter((t=>t.mode===qv)));const n=t.plugins.get(t_);n.registerAttribute(\"linkHref\");c_(t,\"linkHref\",\"a\",Kv);this._enableInsertContentSelectionAttributesFixer();this._enableClickingAfterLink();this._enableTypingOverLink();this._handleDeleteContentAfterLink()}_enableAutomaticDecorators(t){const e=this.editor;const n=e.commands.get(\"link\");const o=n.automaticDecorators;if(e.config.get(\"link.addTargetToExternalLinks\")){o.add({id:\"linkIsExternal\",mode:Gv,callback:t=>Yv.test(t),attributes:{target:\"_blank\",rel:\"noopener noreferrer\"}})}o.add(t);if(o.length){e.conversion.for(\"downcast\").add(o.getDispatcher())}}_enableManualDecorators(t){if(!t.length){return}const e=this.editor;const n=e.commands.get(\"link\");const o=n.manualDecorators;t.forEach((t=>{e.model.schema.extend(\"$text\",{allowAttributes:t.id});o.add(new Fv(t));e.conversion.for(\"downcast\").attributeToElement({model:t.id,view:(e,{writer:n})=>{if(e){const e=o.get(t.id).attributes;const i=n.createAttributeElement(\"a\",e,{priority:5});n.setCustomProperty(\"link\",true,i);return i}}});e.conversion.for(\"upcast\").elementToAttribute({view:{name:\"a\",attributes:o.get(t.id).attributes},model:{key:t.id}})}))}_enableInsertContentSelectionAttributesFixer(){const t=this.editor;const e=t.model;const n=e.document.selection;const o=t.commands.get(\"link\");this.listenTo(e,\"insertContent\",(()=>{const t=n.anchor.nodeBefore;const i=n.anchor.nodeAfter;if(!n.hasAttribute(\"linkHref\")){return}if(!t){return}if(!t.hasAttribute(\"linkHref\")){return}if(i&&i.hasAttribute(\"linkHref\")){return}e.change((t=>{$v(t,o.manualDecorators)}))}),{priority:\"low\"})}_enableClickingAfterLink(){const t=this.editor;const e=t.commands.get(\"link\");t.editing.view.addObserver(XA);let n=false;this.listenTo(t.editing.view.document,\"mousedown\",(()=>{n=true}));this.listenTo(t.editing.view.document,\"selectionChange\",(()=>{if(!n){return}n=false;const o=t.model.document.selection;if(!o.isCollapsed){return}if(!o.hasAttribute(\"linkHref\")){return}const i=o.getFirstPosition();const r=s_(i,\"linkHref\",o.getAttribute(\"linkHref\"),t.model);if(i.isTouching(r.start)||i.isTouching(r.end)){t.model.change((t=>{$v(t,e.manualDecorators)}))}}))}_enableTypingOverLink(){const t=this.editor;const e=t.editing.view;let n;let o;this.listenTo(e.document,\"delete\",(()=>{o=true}),{priority:\"high\"});this.listenTo(t.model,\"deleteContent\",(()=>{const e=t.model.document.selection;if(e.isCollapsed){return}if(o){o=false;return}if(!Zv(t)){return}if(Jv(t.model)){n=e.getAttributes()}}),{priority:\"high\"});this.listenTo(t.model,\"insertContent\",((e,[i])=>{o=false;if(!Zv(t)){return}if(!n){return}t.model.change((t=>{for(const[e,o]of n){t.setAttribute(e,o,i)}}));n=null}),{priority:\"high\"})}_handleDeleteContentAfterLink(){const t=this.editor;const e=t.model;const n=e.document.selection;const o=t.editing.view;const i=t.commands.get(\"link\");let r=false;let s=false;this.listenTo(o.document,\"delete\",((t,e)=>{s=e.domEvent.keyCode===zl.backspace}),{priority:\"high\"});this.listenTo(e,\"deleteContent\",(()=>{r=false;const t=n.getFirstPosition();const o=n.getAttribute(\"linkHref\");if(!o){return}const i=s_(t,\"linkHref\",o,e);r=i.containsPosition(t)||i.end.isEqual(t)}),{priority:\"high\"});this.listenTo(e,\"deleteContent\",(()=>{if(!s){return}s=false;if(r){return}t.model.enqueueChange((t=>{$v(t,i.manualDecorators)}))}),{priority:\"low\"})}}function $v(t,e){t.removeSelectionAttribute(\"linkHref\");for(const n of e){t.removeSelectionAttribute(n.id)}}function Jv(t){const e=t.document.selection;const n=e.getFirstPosition();const o=e.getLastPosition();const i=n.nodeAfter;if(!i){return false}if(!i.is(\"$text\")){return false}if(!i.hasAttribute(\"linkHref\")){return false}const r=o.textNode||o.nodeBefore;if(i===r){return true}const s=s_(n,\"linkHref\",i.getAttribute(\"linkHref\"),t);return s.containsRange(t.createRange(n,o),true)}function Zv(t){const e=t.plugins.get(\"Input\");return e.isInput(t.model.change((t=>t.batch)))}class Xv extends EC{static get pluginName(){return\"Notification\"}init(){this.on(\"show:warning\",((t,e)=>{window.alert(e.message)}),{priority:\"lowest\"})}showSuccess(t,e={}){this._showNotification({message:t,type:\"success\",namespace:e.namespace,title:e.title})}showInfo(t,e={}){this._showNotification({message:t,type:\"info\",namespace:e.namespace,title:e.title})}showWarning(t,e={}){this._showNotification({message:t,type:\"warning\",namespace:e.namespace,title:e.title})}_showNotification(t){const e=`show:${t.type}`+(t.namespace?`:${t.namespace}`:\"\");this.fire(e,{message:t.message,type:t.type,title:t.title||\"\"})}}class ty extends nC{constructor(t){super(t);this.stopListening(this.editor.model.document,\"change\");this.listenTo(this.editor.model.document,\"change\",(()=>this.refresh()),{priority:\"low\"})}refresh(){const t=this.editor.commands.get(\"imageInsert\");const e=this.editor.commands.get(\"link\");this.isEnabled=t.isEnabled||e.isEnabled}execute(){const t=this.editor;const e=this.editor.config.get(\"ckfinder.openerMethod\")||\"modal\";if(e!=\"popup\"&&e!=\"modal\"){throw new ss[\"a\"](\"ckfinder-unknown-openermethod\",t)}const n=this.editor.config.get(\"ckfinder.options\")||{};n.chooseFiles=true;const o=n.onInit;if(!n.language){n.language=t.locale.uiLanguage}n.onInit=e=>{if(o){o(e)}e.on(\"files:choose\",(n=>{const o=n.data.files.toArray();const i=o.filter((t=>!t.isImage()));const r=o.filter((t=>t.isImage()));for(const e of i){t.execute(\"link\",e.getUrl())}const s=[];for(const t of r){const n=t.getUrl();s.push(n?n:e.request(\"file:getProxyUrl\",{file:t}))}if(s.length){ey(t,s)}}));e.on(\"file:choose:resizedImage\",(e=>{const n=e.data.resizedUrl;if(!n){const e=t.plugins.get(\"Notification\");const n=t.locale.t;e.showWarning(n(\"Could not obtain resized image URL.\"),{title:n(\"Selecting resized image failed\"),namespace:\"ckfinder\"});return}ey(t,[n])}))};window.CKFinder[e](n)}}function ey(t,e){const n=t.commands.get(\"imageInsert\");if(!n.isEnabled){const e=t.plugins.get(\"Notification\");const n=t.locale.t;e.showWarning(n(\"Could not insert image at the current position.\"),{title:n(\"Inserting image failed\"),namespace:\"ckfinder\"});return}t.execute(\"imageInsert\",{source:e})}class ny extends tC{static get pluginName(){return\"CKFinderEditing\"}static get requires(){return[Xv,JA,Qv]}init(){const t=this.editor;t.commands.add(\"ckfinder\",new ty(t))}}const oy=\"ckCsrfToken\";const iy=40;const ry=\"abcdefghijklmnopqrstuvwxyz0123456789\";function sy(){let t=ay(oy);if(!t||t.length!=iy){t=ly(iy);cy(oy,t)}return t}function ay(t){t=t.toLowerCase();const e=document.cookie.split(\";\");for(const n of e){const e=n.split(\"=\");const o=decodeURIComponent(e[0].trim().toLowerCase());if(o===t){return decodeURIComponent(e[1])}}return null}function cy(t,e){document.cookie=encodeURIComponent(t)+\"=\"+encodeURIComponent(e)+\";path=/\"}function ly(t){let e=\"\";const n=new Uint8Array(t);window.crypto.getRandomValues(n);for(let t=0;t