ckeditor.js 801 KB

123456
  1. /*!
  2. * @license Copyright (c) 2003-2022, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. !function(t){const e=t.en=t.en||{};e.dictionary=Object.assign(e.dictionary||{},{"%0 of %1":"%0 of %1","Align center":"Align center","Align left":"Align left","Align right":"Align right","Almost equal to":"Almost equal to",Angle:"Angle","Approximately equal to":"Approximately equal to",Aquamarine:"Aquamarine","Asterisk operator":"Asterisk operator","Austral sign":"Austral sign","back with leftwards arrow above":"back with leftwards arrow above","Bitcoin sign":"Bitcoin sign",Black:"Black","Block quote":"Block quote",Blue:"Blue",Bold:"Bold","Bulleted List":"Bulleted List",Cancel:"Cancel","Cannot upload file:":"Cannot upload file:","Cedi sign":"Cedi sign","Cent sign":"Cent sign","Centered image":"Centered image","Change image text alternative":"Change image text alternative","Character categories":"Character categories","Choose heading":"Choose heading","Colon sign":"Colon sign",Column:"Column","Contains as member":"Contains as member","Copyright sign":"Copyright sign","Could not insert image at the current position.":"Could not insert image at the current position.","Could not obtain resized image URL.":"Could not obtain resized image URL.","Cruzeiro sign":"Cruzeiro sign","Currency sign":"Currency sign","Decrease indent":"Decrease indent","Degree sign":"Degree sign","Delete column":"Delete column","Delete row":"Delete row","Dim grey":"Dim grey","Division sign":"Division sign","Document colors":"Document colors","Dollar sign":"Dollar sign","Dong sign":"Dong sign","Double dagger":"Double dagger","Double exclamation mark":"Double exclamation mark","Double low-9 quotation mark":"Double low-9 quotation mark","Double question mark":"Double question mark",Downloadable:"Downloadable","downwards arrow to bar":"downwards arrow to bar","downwards dashed arrow":"downwards dashed arrow","downwards double arrow":"downwards double arrow","Drachma sign":"Drachma sign","Dropdown toolbar":"Dropdown toolbar","Edit block":"Edit block","Edit link":"Edit link","Edit source":"Edit source","Editor toolbar":"Editor toolbar","Element of":"Element of","Em dash":"Em dash","Empty set":"Empty set","Empty snippet content":"Empty snippet content","En dash":"En dash","end with leftwards arrow above":"end with leftwards arrow above","Enter image caption":"Enter image caption","Euro sign":"Euro sign","Euro-currency sign":"Euro-currency sign","Exclamation question mark":"Exclamation question mark","Font Background Color":"Font Background Color","Font Color":"Font Color","For all":"For all","Fraction slash":"Fraction slash","French franc sign":"French franc sign","Full size image":"Full size image","German penny sign":"German penny sign","Greater-than or equal to":"Greater-than or equal to","Greater-than sign":"Greater-than sign",Green:"Green",Grey:"Grey","Guarani sign":"Guarani sign","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","Horizontal ellipsis":"Horizontal ellipsis","Hryvnia sign":"Hryvnia sign","HTML snippet":"HTML snippet","Identical to":"Identical to","Image resize list":"Image resize list","Image toolbar":"Image toolbar","image widget":"image widget","Increase indent":"Increase indent","Indian rupee sign":"Indian rupee sign",Infinity:"Infinity","Insert column left":"Insert column left","Insert column right":"Insert column right","Insert HTML":"Insert HTML","Insert image":"Insert image","Insert image or file":"Insert image or file","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","Inserting image failed":"Inserting image failed",Integral:"Integral",Intersection:"Intersection","Inverted exclamation mark":"Inverted exclamation mark","Inverted question mark":"Inverted question mark",Italic:"Italic",Justify:"Justify","Kip sign":"Kip sign","Latin capital letter a with breve":"Latin capital letter a with breve","Latin capital letter a with macron":"Latin capital letter a with macron","Latin capital letter a with ogonek":"Latin capital letter a with ogonek","Latin capital letter c with acute":"Latin capital letter c with acute","Latin capital letter c with caron":"Latin capital letter c with caron","Latin capital letter c with circumflex":"Latin capital letter c with circumflex","Latin capital letter c with dot above":"Latin capital letter c with dot above","Latin capital letter d with caron":"Latin capital letter d with caron","Latin capital letter d with stroke":"Latin capital letter d with stroke","Latin capital letter e with breve":"Latin capital letter e with breve","Latin capital letter e with caron":"Latin capital letter e with caron","Latin capital letter e with dot above":"Latin capital letter e with dot above","Latin capital letter e with macron":"Latin capital letter e with macron","Latin capital letter e with ogonek":"Latin capital letter e with ogonek","Latin capital letter eng":"Latin capital letter eng","Latin capital letter g with breve":"Latin capital letter g with breve","Latin capital letter g with cedilla":"Latin capital letter g with cedilla","Latin capital letter g with circumflex":"Latin capital letter g with circumflex","Latin capital letter g with dot above":"Latin capital letter g with dot above","Latin capital letter h with circumflex":"Latin capital letter h with circumflex","Latin capital letter h with stroke":"Latin capital letter h with stroke","Latin capital letter i with breve":"Latin capital letter i with breve","Latin capital letter i with dot above":"Latin capital letter i with dot above","Latin capital letter i with macron":"Latin capital letter i with macron","Latin capital letter i with ogonek":"Latin capital letter i with ogonek","Latin capital letter i with tilde":"Latin capital letter i with tilde","Latin capital letter j with circumflex":"Latin capital letter j with circumflex","Latin capital letter k with cedilla":"Latin capital letter k with cedilla","Latin capital letter l with acute":"Latin capital letter l with acute","Latin capital letter l with caron":"Latin capital letter l with caron","Latin capital letter l with cedilla":"Latin capital letter l with cedilla","Latin capital letter l with middle dot":"Latin capital letter l with middle dot","Latin capital letter l with stroke":"Latin capital letter l with stroke","Latin capital letter n with acute":"Latin capital letter n with acute","Latin capital letter n with caron":"Latin capital letter n with caron","Latin capital letter n with cedilla":"Latin capital letter n with cedilla","Latin capital letter o with breve":"Latin capital letter o with breve","Latin capital letter o with double acute":"Latin capital letter o with double acute","Latin capital letter o with macron":"Latin capital letter o with macron","Latin capital letter r with acute":"Latin capital letter r with acute","Latin capital letter r with caron":"Latin capital letter r with caron","Latin capital letter r with cedilla":"Latin capital letter r with cedilla","Latin capital letter s with acute":"Latin capital letter s with acute","Latin capital letter s with caron":"Latin capital letter s with caron","Latin capital letter s with cedilla":"Latin capital letter s with cedilla","Latin capital letter s with circumflex":"Latin capital letter s with circumflex","Latin capital letter t with caron":"Latin capital letter t with caron","Latin capital letter t with cedilla":"Latin capital letter t with cedilla","Latin capital letter t with stroke":"Latin capital letter t with stroke","Latin capital letter u with breve":"Latin capital letter u with breve","Latin capital letter u with double acute":"Latin capital letter u with double acute","Latin capital letter u with macron":"Latin capital letter u with macron","Latin capital letter u with ogonek":"Latin capital letter u with ogonek","Latin capital letter u with ring above":"Latin capital letter u with ring above","Latin capital letter u with tilde":"Latin capital letter u with tilde","Latin capital letter w with circumflex":"Latin capital letter w with circumflex","Latin capital letter y with circumflex":"Latin capital letter y with circumflex","Latin capital letter y with diaeresis":"Latin capital letter y with diaeresis","Latin capital letter z with acute":"Latin capital letter z with acute","Latin capital letter z with caron":"Latin capital letter z with caron","Latin capital letter z with dot above":"Latin capital letter z with dot above","Latin capital ligature ij":"Latin capital ligature ij","Latin capital ligature oe":"Latin capital ligature oe","Latin small letter a with breve":"Latin small letter a with breve","Latin small letter a with macron":"Latin small letter a with macron","Latin small letter a with ogonek":"Latin small letter a with ogonek","Latin small letter c with acute":"Latin small letter c with acute","Latin small letter c with caron":"Latin small letter c with caron","Latin small letter c with circumflex":"Latin small letter c with circumflex","Latin small letter c with dot above":"Latin small letter c with dot above","Latin small letter d with caron":"Latin small letter d with caron","Latin small letter d with stroke":"Latin small letter d with stroke","Latin small letter dotless i":"Latin small letter dotless i","Latin small letter e with breve":"Latin small letter e with breve","Latin small letter e with caron":"Latin small letter e with caron","Latin small letter e with dot above":"Latin small letter e with dot above","Latin small letter e with macron":"Latin small letter e with macron","Latin small letter e with ogonek":"Latin small letter e with ogonek","Latin small letter eng":"Latin small letter eng","Latin small letter f with hook":"Latin small letter f with hook","Latin small letter g with breve":"Latin small letter g with breve","Latin small letter g with cedilla":"Latin small letter g with cedilla","Latin small letter g with circumflex":"Latin small letter g with circumflex","Latin small letter g with dot above":"Latin small letter g with dot above","Latin small letter h with circumflex":"Latin small letter h with circumflex","Latin small letter h with stroke":"Latin small letter h with stroke","Latin small letter i with breve":"Latin small letter i with breve","Latin small letter i with macron":"Latin small letter i with macron","Latin small letter i with ogonek":"Latin small letter i with ogonek","Latin small letter i with tilde":"Latin small letter i with tilde","Latin small letter j with circumflex":"Latin small letter j with circumflex","Latin small letter k with cedilla":"Latin small letter k with cedilla","Latin small letter kra":"Latin small letter kra","Latin small letter l with acute":"Latin small letter l with acute","Latin small letter l with caron":"Latin small letter l with caron","Latin small letter l with cedilla":"Latin small letter l with cedilla","Latin small letter l with middle dot":"Latin small letter l with middle dot","Latin small letter l with stroke":"Latin small letter l with stroke","Latin small letter long s":"Latin small letter long s","Latin small letter n preceded by apostrophe":"Latin small letter n preceded by apostrophe","Latin small letter n with acute":"Latin small letter n with acute","Latin small letter n with caron":"Latin small letter n with caron","Latin small letter n with cedilla":"Latin small letter n with cedilla","Latin small letter o with breve":"Latin small letter o with breve","Latin small letter o with double acute":"Latin small letter o with double acute","Latin small letter o with macron":"Latin small letter o with macron","Latin small letter r with acute":"Latin small letter r with acute","Latin small letter r with caron":"Latin small letter r with caron","Latin small letter r with cedilla":"Latin small letter r with cedilla","Latin small letter s with acute":"Latin small letter s with acute","Latin small letter s with caron":"Latin small letter s with caron","Latin small letter s with cedilla":"Latin small letter s with cedilla","Latin small letter s with circumflex":"Latin small letter s with circumflex","Latin small letter t with caron":"Latin small letter t with caron","Latin small letter t with cedilla":"Latin small letter t with cedilla","Latin small letter t with stroke":"Latin small letter t with stroke","Latin small letter u with breve":"Latin small letter u with breve","Latin small letter u with double acute":"Latin small letter u with double acute","Latin small letter u with macron":"Latin small letter u with macron","Latin small letter u with ogonek":"Latin small letter u with ogonek","Latin small letter u with ring above":"Latin small letter u with ring above","Latin small letter u with tilde":"Latin small letter u with tilde","Latin small letter w with circumflex":"Latin small letter w with circumflex","Latin small letter y with circumflex":"Latin small letter y with circumflex","Latin small letter z with acute":"Latin small letter z with acute","Latin small letter z with caron":"Latin small letter z with caron","Latin small letter z with dot above":"Latin small letter z with dot above","Latin small ligature ij":"Latin small ligature ij","Latin small ligature oe":"Latin small ligature oe","Left aligned image":"Left aligned image","Left double quotation mark":"Left double quotation mark","Left single quotation mark":"Left single quotation mark","Left-pointing double angle quotation mark":"Left-pointing double angle quotation mark","leftwards arrow to bar":"leftwards arrow to bar","leftwards dashed arrow":"leftwards dashed arrow","leftwards double arrow":"leftwards double arrow","Less-than or equal to":"Less-than or equal to","Less-than sign":"Less-than sign","Light blue":"Light blue","Light green":"Light green","Light grey":"Light grey",Link:"Link","Link image":"Link image","Link URL":"Link URL","Lira sign":"Lira sign","Livre tournois sign":"Livre tournois sign","Logical and":"Logical and","Logical or":"Logical or",Macron:"Macron","Manat sign":"Manat sign","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","Mill sign":"Mill sign","Minus sign":"Minus sign","Multiplication sign":"Multiplication sign","N-ary product":"N-ary product","N-ary summation":"N-ary summation",Nabla:"Nabla","Naira sign":"Naira sign","New sheqel sign":"New sheqel sign",Next:"Next","No preview available":"No preview available","Nordic mark sign":"Nordic mark sign","Not an element of":"Not an element of","Not equal to":"Not equal to","Not sign":"Not sign","Numbered List":"Numbered List","on with exclamation mark with left right arrow above":"on with exclamation mark with left right arrow above","Open in a new tab":"Open in a new tab","Open link in new tab":"Open link in new tab",Orange:"Orange",Original:"Original",Overline:"Overline",Paragraph:"Paragraph","Paragraph sign":"Paragraph sign","Partial differential":"Partial differential","Paste raw HTML here...":"Paste raw HTML here...","Paste the media URL in the input.":"Paste the media URL in the input.","Per mille sign":"Per mille sign","Per ten thousand sign":"Per ten thousand sign","Peseta sign":"Peseta sign","Peso sign":"Peso sign","Plus-minus sign":"Plus-minus sign","Pound sign":"Pound sign",Previous:"Previous","Proportional to":"Proportional to",Purple:"Purple","Question exclamation mark":"Question exclamation mark",Red:"Red",Redo:"Redo","Registered sign":"Registered sign","Remove color":"Remove color","Remove Format":"Remove Format","Resize image":"Resize image","Resize image to %0":"Resize image to %0","Resize image to the original size":"Resize image to the original size","Reversed paragraph sign":"Reversed paragraph sign","Rich Text Editor":"Rich Text Editor","Rich Text Editor, %0":"Rich Text Editor, %0","Right aligned image":"Right aligned image","Right double quotation mark":"Right double quotation mark","Right single quotation mark":"Right single quotation mark","Right-pointing double angle quotation mark":"Right-pointing double angle quotation mark","rightwards arrow to bar":"rightwards arrow to bar","rightwards dashed arrow":"rightwards dashed arrow","rightwards double arrow":"rightwards double arrow",Row:"Row","Ruble sign":"Ruble sign","Rupee sign":"Rupee sign",Save:"Save","Save changes":"Save changes","Section sign":"Section sign","Select all":"Select all","Select column":"Select column","Select row":"Select row","Selecting resized image failed":"Selecting resized image failed","Show more items":"Show more items","Side image":"Side image","Single left-pointing angle quotation mark":"Single left-pointing angle quotation mark","Single low-9 quotation mark":"Single low-9 quotation mark","Single right-pointing angle quotation mark":"Single right-pointing angle quotation mark","soon with rightwards arrow above":"soon with rightwards arrow above","Special characters":"Special characters","Spesmilo sign":"Spesmilo sign","Split cell horizontally":"Split cell horizontally","Split cell vertically":"Split cell vertically","Square root":"Square root",Strikethrough:"Strikethrough",Subscript:"Subscript",Superscript:"Superscript","Table toolbar":"Table toolbar","Tenge sign":"Tenge sign","Text alignment":"Text alignment","Text alignment toolbar":"Text alignment toolbar","Text alternative":"Text alternative","The URL must not be empty.":"The URL must not be empty.","There exists":"There exists","This link has no URL":"This link has no URL","This media URL is not supported.":"This media URL is not supported.","Tilde operator":"Tilde operator","Tip: Paste the URL into the content to embed faster.":"Tip: Paste the URL into the content to embed faster.","top with upwards arrow above":"top with upwards arrow above","Trade mark sign":"Trade mark sign","Tugrik sign":"Tugrik sign","Turkish lira sign":"Turkish lira sign",Turquoise:"Turquoise","Two dot leader":"Two dot leader",Underline:"Underline",Undo:"Undo",Union:"Union",Unlink:"Unlink","up down arrow with base":"up down arrow with base","Upload failed":"Upload failed","Upload in progress":"Upload in progress","upwards arrow to bar":"upwards arrow to bar","upwards dashed arrow":"upwards dashed arrow","upwards double arrow":"upwards double arrow","Vulgar fraction one half":"Vulgar fraction one half","Vulgar fraction one quarter":"Vulgar fraction one quarter","Vulgar fraction three quarters":"Vulgar fraction three quarters",White:"White","Widget toolbar":"Widget toolbar","Won sign":"Won sign",Yellow:"Yellow","Yen sign":"Yen sign"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})),function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.CustomEditors=e():t.CustomEditors=e()}(window,(function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)i.d(n,o,function(e){return t[e]}.bind(null,o));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=122)}([function(t,e,i){"use strict";i.d(e,"a",(function(){return n})),i.d(e,"b",(function(){return o}));class n extends Error{constructor(t,e,i){super(`${t}${i?" "+JSON.stringify(i):""}${r(t)}`),this.name="CKEditorError",this.context=e,this.data=i}is(t){return"CKEditorError"===t}static rethrowUnexpectedError(t,e){if(t.is&&t.is("CKEditorError"))throw t;const i=new n(t.message,e);throw i.stack=t.stack,i}}function o(t,e){console.warn(...s(t,e))}function r(t){return"\nRead more: https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html#error-"+t}function s(t,e){const i=r(t);return e?[t,e,i]:[t,i]}},function(t,e,i){"use strict";var n,o=function(){return void 0===n&&(n=Boolean(window&&document&&document.all&&!window.atob)),n},r=function(){var t={};return function(e){if(void 0===t[e]){var i=document.querySelector(e);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(t){i=null}t[e]=i}return t[e]}}(),s=[];function a(t){for(var e=-1,i=0;i<s.length;i++)if(s[i].identifier===t){e=i;break}return e}function l(t,e){for(var i={},n=[],o=0;o<t.length;o++){var r=t[o],l=e.base?r[0]+e.base:r[0],c=i[l]||0,d="".concat(l," ").concat(c);i[l]=c+1;var h=a(d),u={css:r[1],media:r[2],sourceMap:r[3]};-1!==h?(s[h].references++,s[h].updater(u)):s.push({identifier:d,updater:p(u,e),references:1}),n.push(d)}return n}function c(t){var e=document.createElement("style"),n=t.attributes||{};if(void 0===n.nonce){var o=i.nc;o&&(n.nonce=o)}if(Object.keys(n).forEach((function(t){e.setAttribute(t,n[t])})),"function"==typeof t.insert)t.insert(e);else{var s=r(t.insert||"head");if(!s)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");s.appendChild(e)}return e}var d,h=(d=[],function(t,e){return d[t]=e,d.filter(Boolean).join("\n")});function u(t,e,i,n){var o=i?"":n.media?"@media ".concat(n.media," {").concat(n.css,"}"):n.css;if(t.styleSheet)t.styleSheet.cssText=h(e,o);else{var r=document.createTextNode(o),s=t.childNodes;s[e]&&t.removeChild(s[e]),s.length?t.insertBefore(r,s[e]):t.appendChild(r)}}function m(t,e,i){var n=i.css,o=i.media,r=i.sourceMap;if(o?t.setAttribute("media",o):t.removeAttribute("media"),r&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}var g=null,f=0;function p(t,e){var i,n,o;if(e.singleton){var r=f++;i=g||(g=c(e)),n=u.bind(null,i,r,!1),o=u.bind(null,i,r,!0)}else i=c(e),n=m.bind(null,i,e),o=function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(i)};return n(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;n(t=e)}else o()}}t.exports=function(t,e){(e=e||{}).singleton||"boolean"==typeof e.singleton||(e.singleton=o());var i=l(t=t||[],e);return function(t){if(t=t||[],"[object Array]"===Object.prototype.toString.call(t)){for(var n=0;n<i.length;n++){var o=a(i[n]);s[o].references--}for(var r=l(t,e),c=0;c<i.length;c++){var d=a(i[c]);0===s[d].references&&(s[d].updater(),s.splice(d,1))}i=r}}}},,function(t,e,i){"use strict";var n=i(8),o="object"==typeof self&&self&&self.Object===Object&&self,r=n.a||o||Function("return this")();e.a=r},function(t,e,i){"use strict";(function(t){var n=i(3),o=i(13),r="object"==typeof exports&&exports&&!exports.nodeType&&exports,s=r&&"object"==typeof t&&t&&!t.nodeType&&t,a=s&&s.exports===r?n.a.Buffer:void 0,l=(a?a.isBuffer:void 0)||o.a;e.a=l}).call(this,i(10)(t))},function(t,e,i){"use strict";(function(t){var n=i(8),o="object"==typeof exports&&exports&&!exports.nodeType&&exports,r=o&&"object"==typeof t&&t&&!t.nodeType&&t,s=r&&r.exports===o&&n.a.process,a=function(){try{var t=r&&r.require&&r.require("util").types;return t||s&&s.binding&&s.binding("util")}catch(t){}}();e.a=a}).call(this,i(10)(t))},function(t,e,i){"use strict";(function(t){var e=i(0);const n="object"==typeof window?window:t;if(n.CKEDITOR_VERSION)throw new e.a("ckeditor-duplicated-modules",null);n.CKEDITOR_VERSION="28.0.0"}).call(this,i(11))},function(t,e,i){var n=i(1),o=i(77);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e,i){"use strict";(function(t){var i="object"==typeof t&&t&&t.Object===Object&&t;e.a=i}).call(this,i(11))},function(t,e,i){"use strict";(function(t){var n=i(3),o="object"==typeof exports&&exports&&!exports.nodeType&&exports,r=o&&"object"==typeof t&&t&&!t.nodeType&&t,s=r&&r.exports===o?n.a.Buffer:void 0,a=s?s.allocUnsafe:void 0;e.a=function(t,e){if(e)return t.slice();var i=t.length,n=a?a(i):new t.constructor(i);return t.copy(n),n}}).call(this,i(10)(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){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(t){"object"==typeof window&&(i=window)}t.exports=i},function(t,e,i){var n=i(1),o=i(70);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e,i){"use strict";e.a=function(){return!1}},function(t,e,i){var n=i(1),o=i(15);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck-hidden{display:none!important}.ck.ck-reset,.ck.ck-reset_all,.ck.ck-reset_all *{box-sizing:border-box;width:auto;height:auto;position:static}:root{--ck-z-default:1;--ck-z-modal:calc(var(--ck-z-default) + 999)}.ck-transitions-disabled,.ck-transitions-disabled *{transition:none!important}:root{--ck-color-base-foreground:#fafafa;--ck-color-base-background:#fff;--ck-color-base-border:#c4c4c4;--ck-color-base-action:#61b045;--ck-color-base-focus:#6cb5f9;--ck-color-base-text:#333;--ck-color-base-active:#198cf0;--ck-color-base-active-focus:#0e7fe1;--ck-color-base-error:#db3700;--ck-color-focus-border-coordinates:208,79%,51%;--ck-color-focus-border:hsl(var(--ck-color-focus-border-coordinates));--ck-color-focus-outer-shadow:#bcdefb;--ck-color-focus-disabled-shadow:rgba(119,186,248,0.3);--ck-color-focus-error-shadow:rgba(255,64,31,0.3);--ck-color-text:var(--ck-color-base-text);--ck-color-shadow-drop:rgba(0,0,0,0.15);--ck-color-shadow-drop-active:rgba(0,0,0,0.2);--ck-color-shadow-inner:rgba(0,0,0,0.1);--ck-color-button-default-background:transparent;--ck-color-button-default-hover-background:#e6e6e6;--ck-color-button-default-active-background:#d9d9d9;--ck-color-button-default-active-shadow:#bfbfbf;--ck-color-button-default-disabled-background:transparent;--ck-color-button-on-background:#dedede;--ck-color-button-on-hover-background:#c4c4c4;--ck-color-button-on-active-background:#bababa;--ck-color-button-on-active-shadow:#a1a1a1;--ck-color-button-on-disabled-background:#dedede;--ck-color-button-action-background:var(--ck-color-base-action);--ck-color-button-action-hover-background:#579e3d;--ck-color-button-action-active-background:#53973b;--ck-color-button-action-active-shadow:#498433;--ck-color-button-action-disabled-background:#7ec365;--ck-color-button-action-text:var(--ck-color-base-background);--ck-color-button-save:#008a00;--ck-color-button-cancel:#db3700;--ck-color-switch-button-off-background:#b0b0b0;--ck-color-switch-button-off-hover-background:#a3a3a3;--ck-color-switch-button-on-background:var(--ck-color-button-action-background);--ck-color-switch-button-on-hover-background:#579e3d;--ck-color-switch-button-inner-background:var(--ck-color-base-background);--ck-color-switch-button-inner-shadow:rgba(0,0,0,0.1);--ck-color-dropdown-panel-background:var(--ck-color-base-background);--ck-color-dropdown-panel-border:var(--ck-color-base-border);--ck-color-input-background:var(--ck-color-base-background);--ck-color-input-border:#c7c7c7;--ck-color-input-error-border:var(--ck-color-base-error);--ck-color-input-text:var(--ck-color-base-text);--ck-color-input-disabled-background:#f2f2f2;--ck-color-input-disabled-border:#c7c7c7;--ck-color-input-disabled-text:#757575;--ck-color-list-background:var(--ck-color-base-background);--ck-color-list-button-hover-background:var(--ck-color-button-default-hover-background);--ck-color-list-button-on-background:var(--ck-color-base-active);--ck-color-list-button-on-background-focus:var(--ck-color-base-active-focus);--ck-color-list-button-on-text:var(--ck-color-base-background);--ck-color-panel-background:var(--ck-color-base-background);--ck-color-panel-border:var(--ck-color-base-border);--ck-color-toolbar-background:var(--ck-color-base-foreground);--ck-color-toolbar-border:var(--ck-color-base-border);--ck-color-tooltip-background:var(--ck-color-base-text);--ck-color-tooltip-text:var(--ck-color-base-background);--ck-color-engine-placeholder-text:#707070;--ck-color-upload-bar-background:#6cb5f9;--ck-color-link-default:#0000f0;--ck-color-link-selected-background:rgba(31,177,255,0.1);--ck-color-link-fake-selection:rgba(31,177,255,0.3);--ck-disabled-opacity:.5;--ck-focus-outer-shadow-geometry:0 0 0 3px;--ck-focus-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-outer-shadow);--ck-focus-disabled-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-disabled-shadow);--ck-focus-error-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-error-shadow);--ck-focus-ring:1px solid var(--ck-color-focus-border);--ck-font-size-base:13px;--ck-line-height-base:1.84615;--ck-font-face:Helvetica,Arial,Tahoma,Verdana,Sans-Serif;--ck-font-size-tiny:0.7em;--ck-font-size-small:0.75em;--ck-font-size-normal:1em;--ck-font-size-big:1.4em;--ck-font-size-large:1.8em;--ck-ui-component-min-height:2.3em}.ck.ck-reset,.ck.ck-reset_all,.ck.ck-reset_all *{margin:0;padding:0;border:0;background:transparent;text-decoration:none;vertical-align:middle;transition:none;word-wrap:break-word}.ck.ck-reset_all,.ck.ck-reset_all *{border-collapse:collapse;font:normal normal normal var(--ck-font-size-base)/var(--ck-line-height-base) var(--ck-font-face);color:var(--ck-color-text);text-align:left;white-space:nowrap;cursor:auto;float:none}.ck.ck-reset_all .ck-rtl *{text-align:right}.ck.ck-reset_all iframe{vertical-align:inherit}.ck.ck-reset_all textarea{white-space:pre-wrap}.ck.ck-reset_all input[type=password],.ck.ck-reset_all input[type=text],.ck.ck-reset_all textarea{cursor:text}.ck.ck-reset_all input[type=password][disabled],.ck.ck-reset_all input[type=text][disabled],.ck.ck-reset_all textarea[disabled]{cursor:default}.ck.ck-reset_all fieldset{padding:10px;border:2px groove #dfdee3}.ck.ck-reset_all button::-moz-focus-inner{padding:0;border:0}.ck[dir=rtl],.ck[dir=rtl] .ck{text-align:right}:root{--ck-border-radius:2px;--ck-inner-shadow:2px 2px 3px var(--ck-color-shadow-inner) inset;--ck-drop-shadow:0 1px 2px 1px var(--ck-color-shadow-drop);--ck-drop-shadow-active:0 3px 6px 1px var(--ck-color-shadow-drop-active);--ck-spacing-unit:0.6em;--ck-spacing-large:calc(var(--ck-spacing-unit)*1.5);--ck-spacing-standard:var(--ck-spacing-unit);--ck-spacing-medium:calc(var(--ck-spacing-unit)*0.8);--ck-spacing-small:calc(var(--ck-spacing-unit)*0.5);--ck-spacing-tiny:calc(var(--ck-spacing-unit)*0.3);--ck-spacing-extra-tiny:calc(var(--ck-spacing-unit)*0.16)}"},function(t,e,i){var n=i(1),o=i(17);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck.ck-icon{vertical-align:middle}:root{--ck-icon-size:calc(var(--ck-line-height-base)*var(--ck-font-size-normal))}.ck.ck-icon{width:var(--ck-icon-size);height:var(--ck-icon-size);font-size:.8333350694em;will-change:transform}.ck.ck-icon,.ck.ck-icon *{color:inherit;cursor:inherit}.ck.ck-icon :not([fill]){fill:currentColor}"},function(t,e,i){var n=i(1),o=i(19);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports='.ck.ck-tooltip,.ck.ck-tooltip .ck-tooltip__text:after{position:absolute;pointer-events:none;-webkit-backface-visibility:hidden}.ck.ck-tooltip{visibility:hidden;opacity:0;display:none;z-index:var(--ck-z-modal)}.ck.ck-tooltip .ck-tooltip__text{display:inline-block}.ck.ck-tooltip .ck-tooltip__text:after{content:"";width:0;height:0}:root{--ck-tooltip-arrow-size:5px}.ck.ck-tooltip{left:50%;top:0;transition:opacity .2s ease-in-out .2s}.ck.ck-tooltip .ck-tooltip__text{border-radius:0}.ck-rounded-corners .ck.ck-tooltip .ck-tooltip__text,.ck.ck-tooltip .ck-tooltip__text.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-tooltip .ck-tooltip__text{font-size:.9em;line-height:1.5;color:var(--ck-color-tooltip-text);padding:var(--ck-spacing-small) var(--ck-spacing-medium);background:var(--ck-color-tooltip-background);position:relative;left:-50%}.ck.ck-tooltip .ck-tooltip__text:after{transition:opacity .2s ease-in-out .2s;border-style:solid;left:50%}.ck.ck-tooltip.ck-tooltip_s,.ck.ck-tooltip.ck-tooltip_se,.ck.ck-tooltip.ck-tooltip_sw{bottom:calc(var(--ck-tooltip-arrow-size)*-1);transform:translateY(100%)}.ck.ck-tooltip.ck-tooltip_s .ck-tooltip__text:after,.ck.ck-tooltip.ck-tooltip_se .ck-tooltip__text:after,.ck.ck-tooltip.ck-tooltip_sw .ck-tooltip__text:after{top:calc(var(--ck-tooltip-arrow-size)*-1 + 1px);transform:translateX(-50%);border-left-color:transparent;border-bottom-color:var(--ck-color-tooltip-background);border-right-color:transparent;border-top-color:transparent;border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:var(--ck-tooltip-arrow-size);border-right-width:var(--ck-tooltip-arrow-size);border-top-width:0}.ck.ck-tooltip.ck-tooltip_sw{right:50%;left:auto}.ck.ck-tooltip.ck-tooltip_sw .ck-tooltip__text{left:auto;right:calc(var(--ck-tooltip-arrow-size)*-2)}.ck.ck-tooltip.ck-tooltip_sw .ck-tooltip__text:after{left:auto;right:0}.ck.ck-tooltip.ck-tooltip_se{left:50%;right:auto}.ck.ck-tooltip.ck-tooltip_se .ck-tooltip__text{right:auto;left:calc(var(--ck-tooltip-arrow-size)*-2)}.ck.ck-tooltip.ck-tooltip_se .ck-tooltip__text:after{right:auto;left:0;transform:translateX(50%)}.ck.ck-tooltip.ck-tooltip_n{top:calc(var(--ck-tooltip-arrow-size)*-1);transform:translateY(-100%)}.ck.ck-tooltip.ck-tooltip_n .ck-tooltip__text:after{bottom:calc(var(--ck-tooltip-arrow-size)*-1);transform:translateX(-50%);border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent;border-top-color:var(--ck-color-tooltip-background);border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:0;border-right-width:var(--ck-tooltip-arrow-size);border-top-width:var(--ck-tooltip-arrow-size)}.ck.ck-tooltip.ck-tooltip_e{left:calc(100% + var(--ck-tooltip-arrow-size));top:50%}.ck.ck-tooltip.ck-tooltip_e .ck-tooltip__text{left:0;transform:translateY(-50%)}.ck.ck-tooltip.ck-tooltip_e .ck-tooltip__text:after{left:calc(var(--ck-tooltip-arrow-size)*-1);top:calc(50% - var(--ck-tooltip-arrow-size)*1);border-left-color:transparent;border-bottom-color:transparent;border-right-color:var(--ck-color-tooltip-background);border-top-color:transparent;border-left-width:0;border-bottom-width:var(--ck-tooltip-arrow-size);border-right-width:var(--ck-tooltip-arrow-size);border-top-width:var(--ck-tooltip-arrow-size)}.ck.ck-tooltip.ck-tooltip_w{right:calc(100% + var(--ck-tooltip-arrow-size));left:auto;top:50%}.ck.ck-tooltip.ck-tooltip_w .ck-tooltip__text{left:0;transform:translateY(-50%)}.ck.ck-tooltip.ck-tooltip_w .ck-tooltip__text:after{left:100%;top:calc(50% - var(--ck-tooltip-arrow-size)*1);border-left-color:var(--ck-color-tooltip-background);border-bottom-color:transparent;border-right-color:transparent;border-top-color:transparent;border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:var(--ck-tooltip-arrow-size);border-right-width:0;border-top-width:var(--ck-tooltip-arrow-size)}'},function(t,e,i){var n=i(1),o=i(21);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck.ck-button,a.ck.ck-button{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ck.ck-button .ck-tooltip,a.ck.ck-button .ck-tooltip{display:block}@media (hover:none){.ck.ck-button .ck-tooltip,a.ck.ck-button .ck-tooltip{display:none}}.ck.ck-button,a.ck.ck-button{position:relative;display:inline-flex;align-items:center;justify-content:left}.ck.ck-button .ck-button__label,a.ck.ck-button .ck-button__label{display:none}.ck.ck-button.ck-button_with-text .ck-button__label,a.ck.ck-button.ck-button_with-text .ck-button__label{display:inline-block}.ck.ck-button:not(.ck-button_with-text),a.ck.ck-button:not(.ck-button_with-text){justify-content:center}.ck.ck-button:hover .ck-tooltip,a.ck.ck-button:hover .ck-tooltip{visibility:visible;opacity:1}.ck.ck-button:focus:not(:hover) .ck-tooltip,a.ck.ck-button:focus:not(:hover) .ck-tooltip{display:none}.ck.ck-button,a.ck.ck-button{background:var(--ck-color-button-default-background)}.ck.ck-button:not(.ck-disabled):hover,a.ck.ck-button:not(.ck-disabled):hover{background:var(--ck-color-button-default-hover-background)}.ck.ck-button:not(.ck-disabled):active,a.ck.ck-button:not(.ck-disabled):active{background:var(--ck-color-button-default-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-default-active-shadow)}.ck.ck-button.ck-disabled,a.ck.ck-button.ck-disabled{background:var(--ck-color-button-default-disabled-background)}.ck.ck-button,a.ck.ck-button{border-radius:0}.ck-rounded-corners .ck.ck-button,.ck-rounded-corners a.ck.ck-button,.ck.ck-button.ck-rounded-corners,a.ck.ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-button,a.ck.ck-button{white-space:nowrap;cursor:default;vertical-align:middle;padding:var(--ck-spacing-tiny);text-align:center;min-width:var(--ck-ui-component-min-height);min-height:var(--ck-ui-component-min-height);line-height:1;font-size:inherit;border:1px solid transparent;transition:box-shadow .2s ease-in-out,border .2s ease-in-out;-webkit-appearance:none}.ck.ck-button:active,.ck.ck-button:focus,a.ck.ck-button:active,a.ck.ck-button:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0}.ck.ck-button .ck-button__icon use,.ck.ck-button .ck-button__icon use *,a.ck.ck-button .ck-button__icon use,a.ck.ck-button .ck-button__icon use *{color:inherit}.ck.ck-button .ck-button__label,a.ck.ck-button .ck-button__label{font-size:inherit;font-weight:inherit;color:inherit;cursor:inherit;vertical-align:middle}[dir=ltr] .ck.ck-button .ck-button__label,[dir=ltr] a.ck.ck-button .ck-button__label{text-align:left}[dir=rtl] .ck.ck-button .ck-button__label,[dir=rtl] a.ck.ck-button .ck-button__label{text-align:right}.ck.ck-button .ck-button__keystroke,a.ck.ck-button .ck-button__keystroke{color:inherit}[dir=ltr] .ck.ck-button .ck-button__keystroke,[dir=ltr] a.ck.ck-button .ck-button__keystroke{margin-left:var(--ck-spacing-large)}[dir=rtl] .ck.ck-button .ck-button__keystroke,[dir=rtl] a.ck.ck-button .ck-button__keystroke{margin-right:var(--ck-spacing-large)}.ck.ck-button .ck-button__keystroke,a.ck.ck-button .ck-button__keystroke{font-weight:700;opacity:.7}.ck.ck-button.ck-disabled:active,.ck.ck-button.ck-disabled:focus,a.ck.ck-button.ck-disabled:active,a.ck.ck-button.ck-disabled:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),0 0}.ck.ck-button.ck-disabled .ck-button__icon,a.ck.ck-button.ck-disabled .ck-button__icon{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-disabled .ck-button__label,a.ck.ck-button.ck-disabled .ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-disabled .ck-button__keystroke,a.ck.ck-button.ck-disabled .ck-button__keystroke{opacity:.3}.ck.ck-button.ck-button_with-text,a.ck.ck-button.ck-button_with-text{padding:var(--ck-spacing-tiny) var(--ck-spacing-standard)}[dir=ltr] .ck.ck-button.ck-button_with-text .ck-button__icon,[dir=ltr] a.ck.ck-button.ck-button_with-text .ck-button__icon{margin-left:calc(var(--ck-spacing-small)*-1);margin-right:var(--ck-spacing-small)}[dir=rtl] .ck.ck-button.ck-button_with-text .ck-button__icon,[dir=rtl] a.ck.ck-button.ck-button_with-text .ck-button__icon{margin-right:calc(var(--ck-spacing-small)*-1);margin-left:var(--ck-spacing-small)}.ck.ck-button.ck-button_with-keystroke .ck-button__label,a.ck.ck-button.ck-button_with-keystroke .ck-button__label{flex-grow:1}.ck.ck-button.ck-on,a.ck.ck-button.ck-on{background:var(--ck-color-button-on-background)}.ck.ck-button.ck-on:not(.ck-disabled):hover,a.ck.ck-button.ck-on:not(.ck-disabled):hover{background:var(--ck-color-button-on-hover-background)}.ck.ck-button.ck-on:not(.ck-disabled):active,a.ck.ck-button.ck-on:not(.ck-disabled):active{background:var(--ck-color-button-on-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-on-active-shadow)}.ck.ck-button.ck-on.ck-disabled,a.ck.ck-button.ck-on.ck-disabled{background:var(--ck-color-button-on-disabled-background)}.ck.ck-button.ck-button-save,a.ck.ck-button.ck-button-save{color:var(--ck-color-button-save)}.ck.ck-button.ck-button-cancel,a.ck.ck-button.ck-button-cancel{color:var(--ck-color-button-cancel)}.ck.ck-button-action,a.ck.ck-button-action{background:var(--ck-color-button-action-background)}.ck.ck-button-action:not(.ck-disabled):hover,a.ck.ck-button-action:not(.ck-disabled):hover{background:var(--ck-color-button-action-hover-background)}.ck.ck-button-action:not(.ck-disabled):active,a.ck.ck-button-action:not(.ck-disabled):active{background:var(--ck-color-button-action-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-action-active-shadow)}.ck.ck-button-action.ck-disabled,a.ck.ck-button-action.ck-disabled{background:var(--ck-color-button-action-disabled-background)}.ck.ck-button-action,a.ck.ck-button-action{color:var(--ck-color-button-action-text)}.ck.ck-button-bold,a.ck.ck-button-bold{font-weight:700}"},function(t,e,i){var n=i(1),o=i(23);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck.ck-button.ck-switchbutton .ck-button__toggle,.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{display:block}:root{--ck-switch-button-toggle-width:2.6153846154em;--ck-switch-button-toggle-inner-size:1.0769230769em;--ck-switch-button-toggle-spacing:1px;--ck-switch-button-translation:calc(var(--ck-switch-button-toggle-width) - var(--ck-switch-button-toggle-inner-size) - var(--ck-switch-button-toggle-spacing)*2)}[dir=ltr] .ck.ck-button.ck-switchbutton .ck-button__label{margin-right:calc(var(--ck-spacing-large)*2)}[dir=rtl] .ck.ck-button.ck-switchbutton .ck-button__label{margin-left:calc(var(--ck-spacing-large)*2)}.ck.ck-button.ck-switchbutton .ck-button__toggle{border-radius:0}.ck-rounded-corners .ck.ck-button.ck-switchbutton .ck-button__toggle,.ck.ck-button.ck-switchbutton .ck-button__toggle.ck-rounded-corners{border-radius:var(--ck-border-radius)}[dir=ltr] .ck.ck-button.ck-switchbutton .ck-button__toggle{margin-left:auto}[dir=rtl] .ck.ck-button.ck-switchbutton .ck-button__toggle{margin-right:auto}.ck.ck-button.ck-switchbutton .ck-button__toggle{transition:background .4s ease;width:var(--ck-switch-button-toggle-width);background:var(--ck-color-switch-button-off-background)}.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{border-radius:0}.ck-rounded-corners .ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner,.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner.ck-rounded-corners{border-radius:var(--ck-border-radius);border-radius:calc(var(--ck-border-radius)*0.5)}.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{margin:var(--ck-switch-button-toggle-spacing);width:var(--ck-switch-button-toggle-inner-size);height:var(--ck-switch-button-toggle-inner-size);background:var(--ck-color-switch-button-inner-background);transition:all .3s ease}.ck.ck-button.ck-switchbutton .ck-button__toggle:hover{background:var(--ck-color-switch-button-off-hover-background)}.ck.ck-button.ck-switchbutton .ck-button__toggle:hover .ck-button__toggle__inner{box-shadow:0 0 0 5px var(--ck-color-switch-button-inner-shadow)}.ck.ck-button.ck-switchbutton.ck-disabled .ck-button__toggle{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle{background:var(--ck-color-switch-button-on-background)}.ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle:hover{background:var(--ck-color-switch-button-on-hover-background)}[dir=ltr] .ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle .ck-button__toggle__inner{transform:translateX(var(--ck-switch-button-translation))}[dir=rtl] .ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle .ck-button__toggle__inner{transform:translateX(calc(var(--ck-switch-button-translation)*-1))}"},function(t,e,i){var n=i(1),o=i(25);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck.ck-color-grid{display:grid}:root{--ck-color-grid-tile-size:24px;--ck-color-color-grid-check-icon:#000}.ck.ck-color-grid{grid-gap:5px;padding:8px}.ck.ck-color-grid__tile{width:var(--ck-color-grid-tile-size);height:var(--ck-color-grid-tile-size);min-width:var(--ck-color-grid-tile-size);min-height:var(--ck-color-grid-tile-size);padding:0;transition:box-shadow .2s ease;border:0}.ck.ck-color-grid__tile.ck-disabled{cursor:unset;transition:unset}.ck.ck-color-grid__tile.ck-color-table__color-tile_bordered{box-shadow:0 0 0 1px var(--ck-color-base-border)}.ck.ck-color-grid__tile .ck.ck-icon{display:none;color:var(--ck-color-color-grid-check-icon)}.ck.ck-color-grid__tile.ck-on{box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-base-text)}.ck.ck-color-grid__tile.ck-on .ck.ck-icon{display:block}.ck.ck-color-grid__tile.ck-on,.ck.ck-color-grid__tile:focus:not(.ck-disabled),.ck.ck-color-grid__tile:hover:not(.ck-disabled){border:0}.ck.ck-color-grid__tile:focus:not(.ck-disabled),.ck.ck-color-grid__tile:hover:not(.ck-disabled){box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-focus-border)}.ck.ck-color-grid__label{padding:0 var(--ck-spacing-standard)}"},function(t,e,i){var n=i(1),o=i(27);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck.ck-splitbutton{font-size:inherit}.ck.ck-splitbutton .ck-splitbutton__action:focus{z-index:calc(var(--ck-z-default) + 1)}.ck.ck-splitbutton.ck-splitbutton_open>.ck-button .ck-tooltip{display:none}:root{--ck-color-split-button-hover-background:#ebebeb;--ck-color-split-button-hover-border:#b3b3b3}[dir=ltr] .ck.ck-splitbutton>.ck-splitbutton__action{border-top-right-radius:unset;border-bottom-right-radius:unset}[dir=rtl] .ck.ck-splitbutton>.ck-splitbutton__action{border-top-left-radius:unset;border-bottom-left-radius:unset}.ck.ck-splitbutton>.ck-splitbutton__arrow{min-width:unset}[dir=ltr] .ck.ck-splitbutton>.ck-splitbutton__arrow{border-radius:0}.ck-rounded-corners [dir=ltr] .ck.ck-splitbutton>.ck-splitbutton__arrow,[dir=ltr] .ck.ck-splitbutton>.ck-splitbutton__arrow.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:unset;border-bottom-left-radius:unset}[dir=rtl] .ck.ck-splitbutton>.ck-splitbutton__arrow{border-top-right-radius:unset;border-bottom-right-radius:unset}.ck.ck-splitbutton>.ck-splitbutton__arrow svg{width:var(--ck-dropdown-arrow-size)}.ck.ck-splitbutton.ck-splitbutton_open>.ck-button:not(.ck-on):not(.ck-disabled):not(:hover),.ck.ck-splitbutton:hover>.ck-button:not(.ck-on):not(.ck-disabled):not(:hover){background:var(--ck-color-split-button-hover-background)}[dir=ltr] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled),[dir=ltr] .ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled){border-left-color:var(--ck-color-split-button-hover-border)}[dir=rtl] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled),[dir=rtl] .ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled){border-right-color:var(--ck-color-split-button-hover-border)}.ck.ck-splitbutton.ck-splitbutton_open{border-radius:0}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__action,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners>.ck-splitbutton__action{border-bottom-left-radius:0}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners>.ck-splitbutton__arrow{border-bottom-right-radius:0}"},function(t,e,i){var n=i(1),o=i(29);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=":root{--ck-dropdown-max-width:75vw}.ck.ck-dropdown{display:inline-block;position:relative}.ck.ck-dropdown .ck-dropdown__arrow{pointer-events:none;z-index:var(--ck-z-default)}.ck.ck-dropdown .ck-button.ck-dropdown__button{width:100%}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on .ck-tooltip{display:none}.ck.ck-dropdown .ck-dropdown__panel{-webkit-backface-visibility:hidden;display:none;z-index:var(--ck-z-modal);max-width:var(--ck-dropdown-max-width);position:absolute}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel-visible{display:inline-block}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_n,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nmw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw{bottom:100%}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_s,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_smw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{top:100%;bottom:auto}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se{left:0}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{right:0}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_n,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_s{left:50%;transform:translateX(-50%)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nmw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_smw{left:75%;transform:translateX(-75%)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sme{left:25%;transform:translateX(-25%)}.ck.ck-toolbar .ck-dropdown__panel{z-index:calc(var(--ck-z-modal) + 1)}:root{--ck-dropdown-arrow-size:calc(var(--ck-icon-size)*0.5)}.ck.ck-dropdown{font-size:inherit}.ck.ck-dropdown .ck-dropdown__arrow{width:var(--ck-dropdown-arrow-size)}[dir=ltr] .ck.ck-dropdown .ck-dropdown__arrow{right:var(--ck-spacing-standard);margin-left:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-dropdown .ck-dropdown__arrow{left:var(--ck-spacing-standard);margin-right:var(--ck-spacing-small)}.ck.ck-dropdown.ck-disabled .ck-dropdown__arrow{opacity:var(--ck-disabled-opacity)}[dir=ltr] .ck.ck-dropdown .ck-button.ck-dropdown__button:not(.ck-button_with-text){padding-left:var(--ck-spacing-small)}[dir=rtl] .ck.ck-dropdown .ck-button.ck-dropdown__button:not(.ck-button_with-text){padding-right:var(--ck-spacing-small)}.ck.ck-dropdown .ck-button.ck-dropdown__button .ck-button__label{width:7em;overflow:hidden;text-overflow:ellipsis}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-disabled .ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on{border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-dropdown__button_label-width_auto .ck-button__label{width:auto}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-off:active,.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on:active{box-shadow:none}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-off:active:focus,.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on:active:focus{box-shadow:var(--ck-focus-outer-shadow),0 0}.ck.ck-dropdown__panel{border-radius:0}.ck-rounded-corners .ck.ck-dropdown__panel,.ck.ck-dropdown__panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-dropdown__panel{box-shadow:var(--ck-drop-shadow),0 0;background:var(--ck-color-dropdown-panel-background);border:1px solid var(--ck-color-dropdown-panel-border);bottom:0;min-width:100%}.ck.ck-dropdown__panel.ck-dropdown__panel_se{border-top-left-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_sw{border-top-right-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_ne{border-bottom-left-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_nw{border-bottom-right-radius:0}"},function(t,e,i){var n=i(1),o=i(31);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck.ck-toolbar{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-flow:row nowrap;align-items:center}.ck.ck-toolbar>.ck-toolbar__items{display:flex;flex-flow:row wrap;align-items:center;flex-grow:1}.ck.ck-toolbar .ck.ck-toolbar__separator{display:inline-block}.ck.ck-toolbar .ck.ck-toolbar__separator:first-child,.ck.ck-toolbar .ck.ck-toolbar__separator:last-child{display:none}.ck.ck-toolbar .ck-toolbar__line-break{flex-basis:100%}.ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar.ck-toolbar_vertical>.ck-toolbar__items{flex-direction:column}.ck.ck-toolbar.ck-toolbar_floating>.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown>.ck-dropdown__button .ck-dropdown__arrow{display:none}.ck.ck-toolbar{border-radius:0}.ck-rounded-corners .ck.ck-toolbar,.ck.ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-toolbar{background:var(--ck-color-toolbar-background);padding:0 var(--ck-spacing-small);border:1px solid var(--ck-color-toolbar-border)}.ck.ck-toolbar .ck.ck-toolbar__separator{align-self:stretch;width:1px;min-width:1px;background:var(--ck-color-toolbar-border);margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small)}.ck.ck-toolbar .ck-toolbar__line-break{height:0}.ck.ck-toolbar>.ck-toolbar__items>:not(.ck-toolbar__line-break){margin-right:var(--ck-spacing-small)}.ck.ck-toolbar>.ck-toolbar__items:empty+.ck.ck-toolbar__separator{display:none}.ck.ck-toolbar>.ck-toolbar__items>:not(.ck-toolbar__line-break),.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown{margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small)}.ck.ck-toolbar.ck-toolbar_vertical{padding:0}.ck.ck-toolbar.ck-toolbar_vertical>.ck-toolbar__items>.ck{width:100%;margin:0;border-radius:0;border:0}.ck.ck-toolbar.ck-toolbar_compact{padding:0}.ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>*{margin:0}.ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>:not(:first-child):not(:last-child){border-radius:0}.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown>.ck.ck-button.ck-dropdown__button{padding-left:var(--ck-spacing-tiny)}.ck-toolbar-container .ck.ck-toolbar{border:0}.ck.ck-toolbar[dir=rtl]>.ck-toolbar__items>.ck,[dir=rtl] .ck.ck-toolbar>.ck-toolbar__items>.ck{margin-right:0}.ck.ck-toolbar[dir=rtl]:not(.ck-toolbar_compact)>.ck-toolbar__items>.ck,[dir=rtl] .ck.ck-toolbar:not(.ck-toolbar_compact)>.ck-toolbar__items>.ck{margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=rtl]>.ck-toolbar__items>.ck:last-child,[dir=rtl] .ck.ck-toolbar>.ck-toolbar__items>.ck:last-child{margin-left:0}.ck.ck-toolbar[dir=rtl].ck-toolbar_compact>.ck-toolbar__items>.ck:first-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.ck.ck-toolbar[dir=rtl].ck-toolbar_compact>.ck-toolbar__items>.ck:last-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-top-right-radius:0;border-bottom-right-radius:0}.ck.ck-toolbar[dir=rtl]>.ck.ck-toolbar__separator,[dir=rtl] .ck.ck-toolbar>.ck.ck-toolbar__separator{margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=rtl].ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=rtl] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child){margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=ltr]>.ck-toolbar__items>.ck:last-child,[dir=ltr] .ck.ck-toolbar>.ck-toolbar__items>.ck:last-child{margin-right:0}.ck.ck-toolbar[dir=ltr].ck-toolbar_compact>.ck-toolbar__items>.ck:first-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.ck.ck-toolbar[dir=ltr].ck-toolbar_compact>.ck-toolbar__items>.ck:last-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-top-left-radius:0;border-bottom-left-radius:0}.ck.ck-toolbar[dir=ltr]>.ck.ck-toolbar__separator,[dir=ltr] .ck.ck-toolbar>.ck.ck-toolbar__separator{margin-right:var(--ck-spacing-small)}.ck.ck-toolbar[dir=ltr].ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=ltr] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child){margin-right:var(--ck-spacing-small)}"},function(t,e,i){var n=i(1),o=i(33);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck.ck-list{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-direction:column}.ck.ck-list .ck-list__item,.ck.ck-list .ck-list__separator{display:block}.ck.ck-list .ck-list__item>:focus{position:relative;z-index:var(--ck-z-default)}.ck.ck-list{border-radius:0}.ck-rounded-corners .ck.ck-list,.ck.ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-list{list-style-type:none;background:var(--ck-color-list-background)}.ck.ck-list__item{cursor:default;min-width:12em}.ck.ck-list__item .ck-button{min-height:unset;width:100%;text-align:left;border-radius:0;padding:calc(var(--ck-line-height-base)*0.2*var(--ck-font-size-base)) calc(var(--ck-line-height-base)*0.4*var(--ck-font-size-base))}.ck.ck-list__item .ck-button .ck-button__label{line-height:calc(var(--ck-line-height-base)*1.2*var(--ck-font-size-base))}.ck.ck-list__item .ck-button:active{box-shadow:none}.ck.ck-list__item .ck-button.ck-on{background:var(--ck-color-list-button-on-background);color:var(--ck-color-list-button-on-text)}.ck.ck-list__item .ck-button.ck-on:active{box-shadow:none}.ck.ck-list__item .ck-button.ck-on:hover:not(.ck-disabled){background:var(--ck-color-list-button-on-background-focus)}.ck.ck-list__item .ck-button.ck-on:focus:not(.ck-disabled){border-color:var(--ck-color-base-background)}.ck.ck-list__item .ck-button:hover:not(.ck-disabled){background:var(--ck-color-list-button-hover-background)}.ck.ck-list__item .ck-switchbutton.ck-on{background:var(--ck-color-list-background);color:inherit}.ck.ck-list__item .ck-switchbutton.ck-on:hover:not(.ck-disabled){background:var(--ck-color-list-button-hover-background);color:inherit}.ck.ck-list__separator{height:1px;width:100%;background:var(--ck-color-base-border)}"},function(t,e,i){var n=i(1),o=i(35);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=":root{--ck-toolbar-dropdown-max-width:60vw}.ck.ck-toolbar-dropdown>.ck-dropdown__panel{width:max-content;max-width:var(--ck-toolbar-dropdown-max-width)}.ck.ck-toolbar-dropdown>.ck-dropdown__panel .ck-button:focus{z-index:calc(var(--ck-z-default) + 1)}.ck.ck-toolbar-dropdown .ck-toolbar{border:0}"},function(t,e,i){var n=i(1),o=i(37);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck.ck-dropdown .ck-dropdown__panel .ck-list{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list,.ck.ck-dropdown .ck-dropdown__panel .ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0}.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button,.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button,.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}"},function(t,e,i){var n=i(1),o=i(39);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=":root{--ck-color-editable-blur-selection:#d9d9d9}.ck.ck-editor__editable:not(.ck-editor__nested-editable){border-radius:0}.ck-rounded-corners .ck.ck-editor__editable:not(.ck-editor__nested-editable),.ck.ck-editor__editable:not(.ck-editor__nested-editable).ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-editor__editable:not(.ck-editor__nested-editable).ck-focused{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0}.ck.ck-editor__editable_inline{overflow:auto;padding:0 var(--ck-spacing-standard);border:1px solid transparent}.ck.ck-editor__editable_inline[dir=ltr]{text-align:left}.ck.ck-editor__editable_inline[dir=rtl]{text-align:right}.ck.ck-editor__editable_inline>:first-child{margin-top:var(--ck-spacing-large)}.ck.ck-editor__editable_inline>:last-child{margin-bottom:var(--ck-spacing-large)}.ck.ck-editor__editable_inline.ck-blurred ::selection{background:var(--ck-color-editable-blur-selection)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_n]:after{border-bottom-color:var(--ck-color-base-foreground)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_s]:after{border-top-color:var(--ck-color-base-foreground)}"},function(t,e,i){var n=i(1),o=i(41);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck.ck-label{display:block}.ck.ck-voice-label{display:none}.ck.ck-label{font-weight:700}"},function(t,e,i){var n=i(1),o=i(43);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck.ck-form__header{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;justify-content:space-between}:root{--ck-form-header-height:38px}.ck.ck-form__header{padding:var(--ck-spacing-small) var(--ck-spacing-large);height:var(--ck-form-header-height);line-height:var(--ck-form-header-height);border-bottom:1px solid var(--ck-color-base-border)}.ck.ck-form__header .ck-form__header__label{font-weight:700}"},function(t,e,i){var n=i(1),o=i(45);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=":root{--ck-input-text-width:18em}.ck.ck-input-text{border-radius:0}.ck-rounded-corners .ck.ck-input-text,.ck.ck-input-text.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-input-text{background:var(--ck-color-input-background);border:1px solid var(--ck-color-input-border);padding:var(--ck-spacing-extra-tiny) var(--ck-spacing-medium);min-width:var(--ck-input-text-width);min-height:var(--ck-ui-component-min-height);transition:box-shadow .1s ease-in-out,border .1s ease-in-out}.ck.ck-input-text:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0}.ck.ck-input-text[readonly]{border:1px solid var(--ck-color-input-disabled-border);background:var(--ck-color-input-disabled-background);color:var(--ck-color-input-disabled-text)}.ck.ck-input-text[readonly]:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),0 0}.ck.ck-input-text.ck-error{border-color:var(--ck-color-input-error-border);animation:ck-text-input-shake .3s ease both}.ck.ck-input-text.ck-error:focus{box-shadow:var(--ck-focus-error-outer-shadow),0 0}@keyframes ck-text-input-shake{20%{transform:translateX(-2px)}40%{transform:translateX(2px)}60%{transform:translateX(-1px)}80%{transform:translateX(1px)}}"},function(t,e,i){var n=i(1),o=i(47);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper{display:flex;position:relative}.ck.ck-labeled-field-view .ck.ck-label{display:block;position:absolute}:root{--ck-labeled-field-view-transition:.1s cubic-bezier(0,0,0.24,0.95);--ck-labeled-field-empty-unfocused-max-width:100% - 2 * var(--ck-spacing-medium);--ck-color-labeled-field-label-background:var(--ck-color-base-background)}.ck.ck-labeled-field-view{border-radius:0}.ck-rounded-corners .ck.ck-labeled-field-view,.ck.ck-labeled-field-view.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper{width:100%}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{top:0}[dir=ltr] .ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{left:0}[dir=rtl] .ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{right:0}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{pointer-events:none;transform-origin:0 0;transform:translate(var(--ck-spacing-medium),-6px) scale(.75);background:var(--ck-color-labeled-field-label-background);padding:0 calc(var(--ck-font-size-tiny)*0.5);line-height:normal;font-weight:400;text-overflow:ellipsis;overflow:hidden;max-width:100%;transition:transform var(--ck-labeled-field-view-transition),padding var(--ck-labeled-field-view-transition),background var(--ck-labeled-field-view-transition)}.ck.ck-labeled-field-view.ck-error .ck-input:not([readonly])+.ck.ck-label,.ck.ck-labeled-field-view.ck-error>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{color:var(--ck-color-base-error)}.ck.ck-labeled-field-view .ck-labeled-field-view__status{font-size:var(--ck-font-size-small);margin-top:var(--ck-spacing-small);white-space:normal}.ck.ck-labeled-field-view .ck-labeled-field-view__status.ck-labeled-field-view__status_error{color:var(--ck-color-base-error)}.ck.ck-labeled-field-view.ck-disabled>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{color:var(--ck-color-input-disabled-text)}[dir=ltr] .ck.ck-labeled-field-view.ck-disabled>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,[dir=ltr] .ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transform:translate(var(--ck-spacing-medium),calc(var(--ck-font-size-base)*0.6)) scale(1)}[dir=rtl] .ck.ck-labeled-field-view.ck-disabled>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,[dir=rtl] .ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transform:translate(calc(var(--ck-spacing-medium)*-1),calc(var(--ck-font-size-base)*0.6)) scale(1)}.ck.ck-labeled-field-view.ck-disabled>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{max-width:calc(var(--ck-labeled-field-empty-unfocused-max-width));background:transparent;padding:0}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown>.ck.ck-button{background:transparent}.ck.ck-labeled-field-view.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown>.ck-button>.ck-button__label{opacity:0}.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown+.ck-label{max-width:calc(var(--ck-labeled-field-empty-unfocused-max-width) - var(--ck-dropdown-arrow-size) - var(--ck-spacing-standard))}"},function(t,e,i){var n=i(1),o=i(49);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=':root{--ck-balloon-panel-arrow-z-index:calc(var(--ck-z-default) - 3)}.ck.ck-balloon-panel{display:none;position:absolute;z-index:var(--ck-z-modal)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{content:"";position:absolute}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_n]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_n]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_s]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_s]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel.ck-balloon-panel_visible{display:block}:root{--ck-balloon-arrow-offset:2px;--ck-balloon-arrow-height:10px;--ck-balloon-arrow-half-width:8px;--ck-balloon-arrow-drop-shadow:0 2px 2px var(--ck-color-shadow-drop)}.ck.ck-balloon-panel{border-radius:0}.ck-rounded-corners .ck.ck-balloon-panel,.ck.ck-balloon-panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-balloon-panel{box-shadow:var(--ck-drop-shadow),0 0;min-height:15px;background:var(--ck-color-panel-background);border:1px solid var(--ck-color-panel-border)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{width:0;height:0;border-style:solid}.ck.ck-balloon-panel[class*=arrow_n]:after,.ck.ck-balloon-panel[class*=arrow_n]:before{border-left-width:var(--ck-balloon-arrow-half-width);border-bottom-width:var(--ck-balloon-arrow-height);border-right-width:var(--ck-balloon-arrow-half-width);border-top-width:0}.ck.ck-balloon-panel[class*=arrow_n]:before{border-bottom-color:var(--ck-color-panel-border)}.ck.ck-balloon-panel[class*=arrow_n]:after,.ck.ck-balloon-panel[class*=arrow_n]:before{border-left-color:transparent;border-right-color:transparent;border-top-color:transparent}.ck.ck-balloon-panel[class*=arrow_n]:after{border-bottom-color:var(--ck-color-panel-background);margin-top:var(--ck-balloon-arrow-offset)}.ck.ck-balloon-panel[class*=arrow_s]:after,.ck.ck-balloon-panel[class*=arrow_s]:before{border-left-width:var(--ck-balloon-arrow-half-width);border-bottom-width:0;border-right-width:var(--ck-balloon-arrow-half-width);border-top-width:var(--ck-balloon-arrow-height)}.ck.ck-balloon-panel[class*=arrow_s]:before{border-top-color:var(--ck-color-panel-border);filter:drop-shadow(var(--ck-balloon-arrow-drop-shadow))}.ck.ck-balloon-panel[class*=arrow_s]:after,.ck.ck-balloon-panel[class*=arrow_s]:before{border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent}.ck.ck-balloon-panel[class*=arrow_s]:after{border-top-color:var(--ck-color-panel-background);margin-bottom:var(--ck-balloon-arrow-offset)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:before{left:50%;margin-left:calc(var(--ck-balloon-arrow-half-width)*-1);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:before{left:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:before{right:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:before{left:50%;margin-left:calc(var(--ck-balloon-arrow-half-width)*-1);bottom:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:before{left:calc(var(--ck-balloon-arrow-half-width)*2);bottom:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:before{right:calc(var(--ck-balloon-arrow-half-width)*2);bottom:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sme:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sme:before{right:25%;margin-right:calc(var(--ck-balloon-arrow-half-width)*2);bottom:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_smw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_smw:before{left:25%;margin-left:calc(var(--ck-balloon-arrow-half-width)*2);bottom:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nme:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nme:before{right:25%;margin-right:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nmw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nmw:before{left:25%;margin-left:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}'},function(t,e,i){var n=i(1),o=i(51);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck .ck-balloon-rotator__navigation{display:flex;align-items:center;justify-content:center}.ck .ck-balloon-rotator__content .ck-toolbar{justify-content:center}.ck .ck-balloon-rotator__navigation{background:var(--ck-color-toolbar-background);border-bottom:1px solid var(--ck-color-toolbar-border);padding:0 var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation>*{margin-right:var(--ck-spacing-small);margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation .ck-balloon-rotator__counter{margin-right:var(--ck-spacing-standard);margin-left:var(--ck-spacing-small)}.ck .ck-balloon-rotator__content .ck.ck-annotation-wrapper{box-shadow:none}"},function(t,e,i){var n=i(1),o=i(53);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck .ck-fake-panel{position:absolute;z-index:calc(var(--ck-z-modal) - 1)}.ck .ck-fake-panel div{position:absolute}.ck .ck-fake-panel div:first-child{z-index:2}.ck .ck-fake-panel div:nth-child(2){z-index:1}:root{--ck-balloon-fake-panel-offset-horizontal:6px;--ck-balloon-fake-panel-offset-vertical:6px}.ck .ck-fake-panel div{box-shadow:var(--ck-drop-shadow),0 0;min-height:15px;background:var(--ck-color-panel-background);border:1px solid var(--ck-color-panel-border);border-radius:var(--ck-border-radius);width:100%;height:100%}.ck .ck-fake-panel div:first-child{margin-left:var(--ck-balloon-fake-panel-offset-horizontal);margin-top:var(--ck-balloon-fake-panel-offset-vertical)}.ck .ck-fake-panel div:nth-child(2){margin-left:calc(var(--ck-balloon-fake-panel-offset-horizontal)*2);margin-top:calc(var(--ck-balloon-fake-panel-offset-vertical)*2)}.ck .ck-fake-panel div:nth-child(3){margin-left:calc(var(--ck-balloon-fake-panel-offset-horizontal)*3);margin-top:calc(var(--ck-balloon-fake-panel-offset-vertical)*3)}.ck .ck-balloon-panel_arrow_s+.ck-fake-panel,.ck .ck-balloon-panel_arrow_se+.ck-fake-panel,.ck .ck-balloon-panel_arrow_sw+.ck-fake-panel{--ck-balloon-fake-panel-offset-vertical:-6px}"},function(t,e,i){var n=i(1),o=i(55);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck.ck-sticky-panel .ck-sticky-panel__content_sticky{z-index:var(--ck-z-modal);position:fixed;top:0}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky_bottom-limit{top:auto;position:absolute}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky{box-shadow:var(--ck-drop-shadow),0 0;border-width:0 1px 1px;border-top-left-radius:0;border-top-right-radius:0}"},function(t,e,i){var n=i(1),o=i(57);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck.ck-block-toolbar-button{position:absolute;z-index:var(--ck-z-default)}:root{--ck-color-block-toolbar-button:var(--ck-color-text);--ck-block-toolbar-button-size:var(--ck-font-size-normal)}.ck.ck-block-toolbar-button{color:var(--ck-color-block-toolbar-button);font-size:var(--ck-block-toolbar-size)}"},function(t,e,i){var n=i(1),o=i(59);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck.ck-placeholder,.ck .ck-placeholder{position:relative}.ck.ck-placeholder:before,.ck .ck-placeholder:before{position:absolute;left:0;right:0;content:attr(data-placeholder);pointer-events:none}.ck.ck-read-only .ck-placeholder:before{display:none}.ck.ck-placeholder:before,.ck .ck-placeholder:before{cursor:text;color:var(--ck-color-engine-placeholder-text)}"},function(t,e,i){var n=i(1),o=i(61);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck.ck-editor{position:relative}.ck.ck-editor .ck-editor__top .ck-sticky-panel .ck-toolbar{z-index:var(--ck-z-modal)}.ck.ck-editor__top .ck-sticky-panel .ck-toolbar{border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-editor__top .ck-sticky-panel .ck-toolbar{border-bottom-width:0}.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar{border-bottom-width:1px;border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-radius:0}.ck.ck-editor__main>.ck-editor__editable{background:var(--ck-color-base-background);border-radius:0}.ck-rounded-corners .ck.ck-editor__main>.ck-editor__editable,.ck.ck-editor__main>.ck-editor__editable.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}.ck.ck-editor__main>.ck-editor__editable:not(.ck-focused){border-color:var(--ck-color-base-border)}"},function(t,e,i){var n=i(1),o=i(63);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports='.ck .ck-widget .ck-widget__type-around__button{display:block;position:absolute;overflow:hidden;z-index:var(--ck-z-default)}.ck .ck-widget .ck-widget__type-around__button svg{position:absolute;top:50%;left:50%;z-index:calc(var(--ck-z-default) + 2)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_before{top:calc(var(--ck-widget-outline-thickness)*-0.5);left:min(10%,30px);transform:translateY(-50%)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_after{bottom:calc(var(--ck-widget-outline-thickness)*-0.5);right:min(10%,30px);transform:translateY(50%)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:after,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover:after{content:"";display:block;position:absolute;top:1px;left:1px;z-index:calc(var(--ck-z-default) + 1)}.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__fake-caret{display:none;position:absolute;left:0;right:0}.ck .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__fake-caret{left:calc(var(--ck-widget-outline-thickness)*-1);right:calc(var(--ck-widget-outline-thickness)*-1)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__fake-caret{top:calc(var(--ck-widget-outline-thickness)*-1 - 1px);display:block}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after>.ck-widget__type-around>.ck-widget__type-around__fake-caret{bottom:calc(var(--ck-widget-outline-thickness)*-1 - 1px);display:block}.ck.ck-editor__editable.ck-read-only .ck-widget__type-around,.ck.ck-editor__editable.ck-restricted-editing_mode_restricted .ck-widget__type-around,.ck.ck-editor__editable.ck-widget__type-around_disabled .ck-widget__type-around{display:none}:root{--ck-widget-type-around-button-size:20px;--ck-color-widget-type-around-button-active:var(--ck-color-focus-border);--ck-color-widget-type-around-button-hover:var(--ck-color-widget-hover-border);--ck-color-widget-type-around-button-blurred-editable:var(--ck-color-widget-blurred-border);--ck-color-widget-type-around-button-radar-start-alpha:0;--ck-color-widget-type-around-button-radar-end-alpha:.3;--ck-color-widget-type-around-button-icon:var(--ck-color-base-background)}.ck .ck-widget .ck-widget__type-around__button{width:var(--ck-widget-type-around-button-size);height:var(--ck-widget-type-around-button-size);background:var(--ck-color-widget-type-around-button);border-radius:100px;transition:opacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);opacity:0;pointer-events:none}.ck .ck-widget .ck-widget__type-around__button svg{width:10px;height:8px;transform:translate(-50%,-50%);transition:transform .5s ease;margin-top:1px}.ck .ck-widget .ck-widget__type-around__button svg *{stroke-dasharray:10;stroke-dashoffset:0;fill:none;stroke:var(--ck-color-widget-type-around-button-icon);stroke-width:1.5px;stroke-linecap:round;stroke-linejoin:round}.ck .ck-widget .ck-widget__type-around__button svg line{stroke-dasharray:7}.ck .ck-widget .ck-widget__type-around__button:hover{animation:ck-widget-type-around-button-sonar 1s ease infinite}.ck .ck-widget .ck-widget__type-around__button:hover svg polyline{animation:ck-widget-type-around-arrow-dash 2s linear}.ck .ck-widget .ck-widget__type-around__button:hover svg line{animation:ck-widget-type-around-arrow-tip-dash 2s linear}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__button{opacity:1;pointer-events:auto}.ck .ck-widget:not(.ck-widget_selected)>.ck-widget__type-around>.ck-widget__type-around__button{background:var(--ck-color-widget-type-around-button-hover)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover{background:var(--ck-color-widget-type-around-button-active)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:after,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover:after{width:calc(var(--ck-widget-type-around-button-size) - 2px);height:calc(var(--ck-widget-type-around-button-size) - 2px);border-radius:100px;background:linear-gradient(135deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3))}.ck .ck-widget.ck-widget_with-selection-handle>.ck-widget__type-around>.ck-widget__type-around__button_before{margin-left:20px}.ck .ck-widget .ck-widget__type-around__fake-caret{pointer-events:none;height:1px;animation:ck-widget-type-around-fake-caret-pulse 1s linear infinite normal forwards;outline:1px solid hsla(0,0%,100%,.5);background:var(--ck-color-base-text)}.ck .ck-widget.ck-widget_selected.ck-widget_type-around_show-fake-caret_after,.ck .ck-widget.ck-widget_selected.ck-widget_type-around_show-fake-caret_before{outline-color:transparent}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_selected:hover,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_selected:hover{outline-color:var(--ck-color-widget-hover-border)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__button{opacity:0;pointer-events:none}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle{opacity:0}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_selected.ck-widget_with-resizer>.ck-widget__resizer,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_selected.ck-widget_with-resizer>.ck-widget__resizer{opacity:0}.ck[dir=rtl] .ck-widget.ck-widget_with-selection-handle .ck-widget__type-around>.ck-widget__type-around__button_before{margin-left:0;margin-right:20px}.ck-editor__nested-editable.ck-editor__editable_selected .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck-editor__nested-editable.ck-editor__editable_selected .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__button{opacity:0;pointer-events:none}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:not(:hover){background:var(--ck-color-widget-type-around-button-blurred-editable)}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:not(:hover) svg *{stroke:#999}@keyframes ck-widget-type-around-arrow-dash{0%{stroke-dashoffset:10}20%,to{stroke-dashoffset:0}}@keyframes ck-widget-type-around-arrow-tip-dash{0%,20%{stroke-dashoffset:7}40%,to{stroke-dashoffset:0}}@keyframes ck-widget-type-around-button-sonar{0%{box-shadow:0 0 0 0 hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-start-alpha))}50%{box-shadow:0 0 0 5px hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-end-alpha))}to{box-shadow:0 0 0 5px hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-start-alpha))}}@keyframes ck-widget-type-around-fake-caret-pulse{0%{opacity:1}49%{opacity:1}50%{opacity:0}99%{opacity:0}to{opacity:1}}'},function(t,e,i){var n=i(1),o=i(65);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=":root{--ck-color-resizer:var(--ck-color-focus-border);--ck-color-resizer-tooltip-background:#262626;--ck-color-resizer-tooltip-text:#f2f2f2;--ck-resizer-border-radius:var(--ck-border-radius);--ck-resizer-tooltip-offset:10px}.ck .ck-widget,.ck .ck-widget.ck-widget_with-selection-handle{position:relative}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{position:absolute}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon{display:block}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_with-selection-handle:hover>.ck-widget__selection-handle{visibility:visible}.ck .ck-size-view{background:var(--ck-color-resizer-tooltip-background);color:var(--ck-color-resizer-tooltip-text);border:1px solid var(--ck-color-resizer-tooltip-text);border-radius:var(--ck-resizer-border-radius);font-size:var(--ck-font-size-tiny);display:block;padding:var(--ck-spacing-small)}.ck .ck-size-view.ck-orientation-bottom-left,.ck .ck-size-view.ck-orientation-bottom-right,.ck .ck-size-view.ck-orientation-top-left,.ck .ck-size-view.ck-orientation-top-right{position:absolute}.ck .ck-size-view.ck-orientation-top-left{top:var(--ck-resizer-tooltip-offset);left:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-top-right{top:var(--ck-resizer-tooltip-offset);right:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-bottom-right{bottom:var(--ck-resizer-tooltip-offset);right:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-bottom-left{bottom:var(--ck-resizer-tooltip-offset);left:var(--ck-resizer-tooltip-offset)}:root{--ck-widget-outline-thickness:3px;--ck-widget-handler-icon-size:16px;--ck-widget-handler-animation-duration:200ms;--ck-widget-handler-animation-curve:ease;--ck-color-widget-blurred-border:#dedede;--ck-color-widget-hover-border:#ffc83d;--ck-color-widget-editable-focus-background:var(--ck-color-base-background);--ck-color-widget-drag-handler-icon-color:var(--ck-color-base-background)}.ck .ck-widget{outline-width:var(--ck-widget-outline-thickness);outline-style:solid;outline-color:transparent;transition:outline-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve)}.ck .ck-widget.ck-widget_selected,.ck .ck-widget.ck-widget_selected:hover{outline:var(--ck-widget-outline-thickness) solid var(--ck-color-focus-border)}.ck .ck-widget:hover{outline-color:var(--ck-color-widget-hover-border)}.ck .ck-editor__nested-editable{border:1px solid transparent}.ck .ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck .ck-editor__nested-editable:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0;background-color:var(--ck-color-widget-editable-focus-background)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{padding:4px;box-sizing:border-box;background-color:transparent;opacity:0;transition:background-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),visibility var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),opacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);border-radius:var(--ck-border-radius) var(--ck-border-radius) 0 0;transform:translateY(-100%);left:calc(0px - var(--ck-widget-outline-thickness));top:0}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon{width:var(--ck-widget-handler-icon-size);height:var(--ck-widget-handler-icon-size);color:var(--ck-color-widget-drag-handler-icon-color)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator{opacity:0;transition:opacity .3s var(--ck-widget-handler-animation-curve)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle:hover .ck-icon .ck-icon__selected-indicator{opacity:1}.ck .ck-widget.ck-widget_with-selection-handle:hover>.ck-widget__selection-handle{opacity:1;background-color:var(--ck-color-widget-hover-border)}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle{opacity:1;background-color:var(--ck-color-focus-border)}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator{opacity:1}.ck[dir=rtl] .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{left:auto;right:calc(0px - var(--ck-widget-outline-thickness))}.ck.ck-editor__editable.ck-read-only .ck-widget{transition:none}.ck.ck-editor__editable.ck-read-only .ck-widget:not(.ck-widget_selected){--ck-widget-outline-thickness:0px}.ck.ck-editor__editable.ck-read-only .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle,.ck.ck-editor__editable.ck-read-only .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle:hover{background:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover{outline-color:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle>.ck-widget__selection-handle,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle>.ck-widget__selection-handle:hover,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover.ck-widget_with-selection-handle>.ck-widget__selection-handle,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover.ck-widget_with-selection-handle>.ck-widget__selection-handle:hover{background:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable>.ck-widget.ck-widget_with-selection-handle:first-child,.ck.ck-editor__editable blockquote>.ck-widget.ck-widget_with-selection-handle:first-child{margin-top:calc(1em + var(--ck-widget-handler-icon-size))}"},function(t,e,i){var n=i(1),o=i(67);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports='.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position{display:inline;position:relative;pointer-events:none}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span{position:absolute;width:0}.ck.ck-editor__editable .ck-widget:-webkit-drag>.ck-widget__selection-handle,.ck.ck-editor__editable .ck-widget:-webkit-drag>.ck-widget__type-around{display:none}:root{--ck-clipboard-drop-target-dot-width:12px;--ck-clipboard-drop-target-dot-height:8px;--ck-clipboard-drop-target-color:var(--ck-color-focus-border)}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span{bottom:calc(var(--ck-clipboard-drop-target-dot-height)*-0.5);top:calc(var(--ck-clipboard-drop-target-dot-height)*-0.5);border:1px solid var(--ck-clipboard-drop-target-color);background:var(--ck-clipboard-drop-target-color);margin-left:-1px}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span:after{content:"";width:0;height:0;display:block;position:absolute;left:50%;top:calc(var(--ck-clipboard-drop-target-dot-height)*-0.5);transform:translateX(-50%);border-left:calc(var(--ck-clipboard-drop-target-dot-width)*0.5) solid transparent;border-bottom:0 solid transparent;border-right:calc(var(--ck-clipboard-drop-target-dot-width)*0.5) solid transparent;border-top:calc(var(--ck-clipboard-drop-target-dot-height)) solid var(--ck-clipboard-drop-target-color)}.ck.ck-editor__editable .ck-widget.ck-clipboard-drop-target-range{outline:var(--ck-widget-outline-thickness) solid var(--ck-clipboard-drop-target-color)!important}.ck.ck-editor__editable .ck-widget:-webkit-drag{zoom:.6;outline:none!important}'},function(t,e,i){var n=i(1),o=i(69);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck-content blockquote{overflow:hidden;padding-right:1.5em;padding-left:1.5em;margin-left:0;margin-right:0;font-style:italic;border-left:5px solid #ccc}.ck-content[dir=rtl] blockquote{border-left:0;border-right:5px solid #ccc}"},function(t,e){t.exports=".ck.ck-heading_heading1{font-size:20px}.ck.ck-heading_heading2{font-size:17px}.ck.ck-heading_heading3{font-size:14px}.ck[class*=ck-heading_heading]{font-weight:700}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__button .ck-button__label{width:8em}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__panel .ck-list__item{min-width:18em}"},function(t,e,i){var n=i(1),o=i(72);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck .ck-widget_with-resizer{position:relative}.ck .ck-widget__resizer{display:none;position:absolute;pointer-events:none;left:0;top:0}.ck-focused .ck-widget_with-resizer.ck-widget_selected>.ck-widget__resizer{display:block}.ck .ck-widget__resizer__handle{position:absolute;pointer-events:all}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-right,.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-left{cursor:nwse-resize}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-left,.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-right{cursor:nesw-resize}:root{--ck-resizer-size:10px;--ck-resizer-offset:calc(var(--ck-resizer-size)/-2 - 2px);--ck-resizer-border-width:1px}.ck .ck-widget__resizer{outline:1px solid var(--ck-color-resizer)}.ck .ck-widget__resizer__handle{width:var(--ck-resizer-size);height:var(--ck-resizer-size);background:var(--ck-color-focus-border);border:var(--ck-resizer-border-width) solid #fff;border-radius:var(--ck-resizer-border-radius)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-left{top:var(--ck-resizer-offset);left:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-right{top:var(--ck-resizer-offset);right:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-right{bottom:var(--ck-resizer-offset);right:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-left{bottom:var(--ck-resizer-offset);left:var(--ck-resizer-offset)}"},function(t,e,i){var n=i(1),o=i(74);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck-widget.raw-html-embed{margin:1em auto;position:relative;display:flow-root}.ck-widget.raw-html-embed:before{position:absolute;z-index:1}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper{position:absolute;display:flex;flex-direction:column}.ck-widget.raw-html-embed .raw-html-embed__preview{position:relative;overflow:hidden;display:flex}.ck-widget.raw-html-embed .raw-html-embed__preview-content{width:100%;position:relative;margin:auto;display:table;border-collapse:separate;border-spacing:7px}.ck-widget.raw-html-embed .raw-html-embed__preview-placeholder{position:absolute;left:0;top:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.ck-content .raw-html-embed{margin:1em auto;min-width:15em;font-style:normal}:root{--ck-html-embed-content-width:calc(100% - var(--ck-icon-size)*1.5);--ck-html-embed-source-height:10em;--ck-html-embed-unfocused-outline-width:1px;--ck-html-embed-content-min-height:calc(var(--ck-icon-size) + var(--ck-spacing-standard));--ck-html-embed-source-disabled-background:var(--ck-color-base-foreground);--ck-html-embed-source-disabled-color:#737373}.ck-widget.raw-html-embed{font-size:var(--ck-font-size-base);background-color:var(--ck-color-base-foreground)}.ck-widget.raw-html-embed:not(.ck-widget_selected):not(:hover){outline:var(--ck-html-embed-unfocused-outline-width) dashed var(--ck-color-widget-blurred-border)}.ck-widget.raw-html-embed[dir=ltr]{text-align:left}.ck-widget.raw-html-embed[dir=rtl]{text-align:right}.ck-widget.raw-html-embed:before{content:attr(data-html-embed-label);top:calc(var(--ck-html-embed-unfocused-outline-width)*-1);left:var(--ck-spacing-standard);background:#999;transition:background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);padding:calc(var(--ck-spacing-tiny) + var(--ck-html-embed-unfocused-outline-width)) var(--ck-spacing-small) var(--ck-spacing-tiny);border-radius:0 0 var(--ck-border-radius) var(--ck-border-radius);color:var(--ck-color-base-background);font-size:var(--ck-font-size-tiny);font-family:var(--ck-font-face)}.ck-widget.raw-html-embed[dir=rtl]:before{left:auto;right:var(--ck-spacing-standard)}.ck-widget.raw-html-embed[dir=ltr] .ck-widget__type-around .ck-widget__type-around__button.ck-widget__type-around__button_before{margin-left:50px}.ck.ck-editor__editable.ck-blurred .ck-widget.raw-html-embed.ck-widget_selected:before{top:0;padding:var(--ck-spacing-tiny) var(--ck-spacing-small)}.ck.ck-editor__editable:not(.ck-blurred) .ck-widget.raw-html-embed.ck-widget_selected:before{top:0;padding:var(--ck-spacing-tiny) var(--ck-spacing-small);background:var(--ck-color-focus-border)}.ck.ck-editor__editable .ck-widget.raw-html-embed:not(.ck-widget_selected):hover:before{top:0;padding:var(--ck-spacing-tiny) var(--ck-spacing-small)}.ck-widget.raw-html-embed .raw-html-embed__content-wrapper{padding:var(--ck-spacing-standard)}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper{top:var(--ck-spacing-standard);right:var(--ck-spacing-standard)}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper .ck-button.raw-html-embed__save-button{color:var(--ck-color-button-save)}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper .ck-button.raw-html-embed__cancel-button{color:var(--ck-color-button-cancel)}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper .ck-button:not(:first-child){margin-top:var(--ck-spacing-small)}.ck-widget.raw-html-embed[dir=rtl] .raw-html-embed__buttons-wrapper{left:var(--ck-spacing-standard);right:auto}.ck-widget.raw-html-embed .raw-html-embed__source{box-sizing:border-box;height:var(--ck-html-embed-source-height);width:var(--ck-html-embed-content-width);resize:none;min-width:0;padding:var(--ck-spacing-standard);font-family:monospace;tab-size:4;white-space:pre-wrap;font-size:var(--ck-font-size-base);text-align:left;direction:ltr}.ck-widget.raw-html-embed .raw-html-embed__source[disabled]{background:var(--ck-html-embed-source-disabled-background);color:var(--ck-html-embed-source-disabled-color);-webkit-text-fill-color:var(--ck-html-embed-source-disabled-color);opacity:1}.ck-widget.raw-html-embed .raw-html-embed__preview{min-height:var(--ck-html-embed-content-min-height);width:var(--ck-html-embed-content-width)}.ck-editor__editable:not(.ck-read-only) .ck-widget.raw-html-embed .raw-html-embed__preview{pointer-events:none}.ck-widget.raw-html-embed .raw-html-embed__preview-content{box-sizing:border-box;text-align:center;background-color:var(--ck-color-base-foreground)}.ck-widget.raw-html-embed .raw-html-embed__preview-content>*{margin-left:auto;margin-right:auto}.ck-widget.raw-html-embed .raw-html-embed__preview-placeholder{color:var(--ck-html-embed-source-disabled-color)}"},function(t,e,i){var n=i(1),o=i(76);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck.ck-text-alternative-form{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-text-alternative-form .ck-labeled-field-view{display:inline-block}.ck.ck-text-alternative-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-text-alternative-form{flex-wrap:wrap}.ck.ck-text-alternative-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-text-alternative-form .ck-button{flex-basis:50%}}"},function(t,e){t.exports='.ck-vertical-form .ck-button:after{content:"";width:0;position:absolute;right:-1px;top:var(--ck-spacing-small);bottom:var(--ck-spacing-small);z-index:1}@media screen and (max-width:600px){.ck.ck-responsive-form .ck-button:after{content:"";width:0;position:absolute;right:-1px;top:var(--ck-spacing-small);bottom:var(--ck-spacing-small);z-index:1}}.ck-vertical-form>.ck-button:nth-last-child(2):after{border-right:1px solid var(--ck-color-base-border)}.ck.ck-responsive-form{padding:var(--ck-spacing-large)}.ck.ck-responsive-form:focus{outline:none}[dir=ltr] .ck.ck-responsive-form>:not(:first-child),[dir=rtl] .ck.ck-responsive-form>:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-responsive-form{padding:0;width:calc(var(--ck-input-text-width)*0.8)}.ck.ck-responsive-form .ck-labeled-field-view{margin:var(--ck-spacing-large) var(--ck-spacing-large) 0}.ck.ck-responsive-form .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-responsive-form .ck-labeled-field-view .ck-labeled-field-view__error{white-space:normal}.ck.ck-responsive-form>.ck-button:last-child,.ck.ck-responsive-form>.ck-button:nth-last-child(2){padding:var(--ck-spacing-standard);margin-top:var(--ck-spacing-large);border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-responsive-form>.ck-button:last-child,[dir=ltr] .ck.ck-responsive-form>.ck-button:nth-last-child(2),[dir=rtl] .ck.ck-responsive-form>.ck-button:last-child,[dir=rtl] .ck.ck-responsive-form>.ck-button:nth-last-child(2){margin-left:0}.ck.ck-responsive-form>.ck-button:nth-last-child(2):after,[dir=rtl] .ck.ck-responsive-form>.ck-button:last-child:last-of-type,[dir=rtl] .ck.ck-responsive-form>.ck-button:nth-last-child(2):last-of-type{border-right:1px solid var(--ck-color-base-border)}}'},function(t,e,i){var n=i(1),o=i(79);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck-content .image{display:table;clear:both;text-align:center;margin:1em auto}.ck-content .image img{display:block;margin:0 auto;max-width:100%;min-width:50px}.ck.ck-editor__editable .image>figcaption.ck-placeholder:before{position:static}"},function(t,e,i){var n=i(1),o=i(81);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck-content .image>figcaption{display:table-caption;caption-side:bottom;word-break:break-word;color:#333;background-color:#f7f7f7;padding:.6em;font-size:.75em;outline-offset:-1px}"},function(t,e,i){var n=i(1),o=i(83);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=":root{--ck-image-style-spacing:1.5em}.ck-content .image-style-side{float:right;margin-left:var(--ck-image-style-spacing);max-width:50%}.ck-content .image-style-align-left{float:left;margin-right:var(--ck-image-style-spacing)}.ck-content .image-style-align-center{margin-left:auto;margin-right:auto}.ck-content .image-style-align-right{float:right;margin-left:var(--ck-image-style-spacing)}"},function(t,e,i){var n=i(1),o=i(85);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck.ck-editor__editable .image{position:relative}.ck.ck-editor__editable .image .ck-progress-bar{position:absolute;top:0;left:0}.ck.ck-editor__editable .image.ck-appear{animation:fadeIn .7s}.ck.ck-editor__editable .image .ck-progress-bar{height:2px;width:0;background:var(--ck-color-upload-bar-background);transition:width .1s}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}"},function(t,e,i){var n=i(1),o=i(87);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports='.ck-image-upload-complete-icon{display:block;position:absolute;top:10px;right:10px;border-radius:50%}.ck-image-upload-complete-icon:after{content:"";position:absolute}:root{--ck-color-image-upload-icon:#fff;--ck-color-image-upload-icon-background:#008a00;--ck-image-upload-icon-size:20px;--ck-image-upload-icon-width:2px}.ck-image-upload-complete-icon{width:var(--ck-image-upload-icon-size);height:var(--ck-image-upload-icon-size);opacity:0;background:var(--ck-color-image-upload-icon-background);animation-name:ck-upload-complete-icon-show,ck-upload-complete-icon-hide;animation-fill-mode:forwards,forwards;animation-duration:.5s,.5s;font-size:var(--ck-image-upload-icon-size);animation-delay:0ms,3s}.ck-image-upload-complete-icon:after{left:25%;top:50%;opacity:0;height:0;width:0;transform:scaleX(-1) rotate(135deg);transform-origin:left top;border-top:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);border-right:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);animation-name:ck-upload-complete-icon-check;animation-duration:.5s;animation-delay:.5s;animation-fill-mode:forwards;box-sizing:border-box}@keyframes ck-upload-complete-icon-show{0%{opacity:0}to{opacity:1}}@keyframes ck-upload-complete-icon-hide{0%{opacity:1}to{opacity:0}}@keyframes ck-upload-complete-icon-check{0%{opacity:1;width:0;height:0}33%{width:.3em;height:0}to{opacity:1;width:.3em;height:.45em}}'},function(t,e,i){var n=i(1),o=i(89);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports='.ck .ck-upload-placeholder-loader{position:absolute;display:flex;align-items:center;justify-content:center;top:0;left:0}.ck .ck-upload-placeholder-loader:before{content:"";position:relative}:root{--ck-color-upload-placeholder-loader:#b3b3b3;--ck-upload-placeholder-loader-size:32px}.ck .ck-image-upload-placeholder{width:100%;margin:0}.ck .ck-upload-placeholder-loader{width:100%;height:100%}.ck .ck-upload-placeholder-loader:before{width:var(--ck-upload-placeholder-loader-size);height:var(--ck-upload-placeholder-loader-size);border-radius:50%;border-top:3px solid var(--ck-color-upload-placeholder-loader);border-right:2px solid transparent;animation:ck-upload-placeholder-loader 1s linear infinite}@keyframes ck-upload-placeholder-loader{to{transform:rotate(1turn)}}'},function(t,e,i){var n=i(1),o=i(91);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck-content .image.image_resized{max-width:100%;display:block;box-sizing:border-box}.ck-content .image.image_resized img{width:100%}.ck-content .image.image_resized>figcaption{display:block}[dir=ltr] .ck.ck-button.ck-button_with-text.ck-resize-image-button .ck-button__icon{margin-right:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-button.ck-button_with-text.ck-resize-image-button .ck-button__icon{margin-left:var(--ck-spacing-standard)}.ck.ck-dropdown .ck-button.ck-resize-image-button .ck-button__label{width:4em}"},function(t,e,i){var n=i(1),o=i(93);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck .ck-link_selected{background:var(--ck-color-link-selected-background)}.ck .ck-fake-link-selection{background:var(--ck-color-link-fake-selection)}.ck .ck-fake-link-selection_collapsed{height:100%;border-right:1px solid var(--ck-color-base-text);margin-right:-1px;outline:1px solid hsla(0,0%,100%,.5)}"},function(t,e,i){var n=i(1),o=i(95);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck.ck-link-form{display:flex}.ck.ck-link-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-link-form{flex-wrap:wrap}.ck.ck-link-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-link-form .ck-button{flex-basis:50%}}.ck.ck-link-form_layout-vertical{display:block}.ck.ck-link-form_layout-vertical .ck-button.ck-button-cancel,.ck.ck-link-form_layout-vertical .ck-button.ck-button-save{margin-top:var(--ck-spacing-medium)}.ck.ck-link-form_layout-vertical{padding:0;min-width:var(--ck-input-text-width)}.ck.ck-link-form_layout-vertical .ck-labeled-field-view{margin:var(--ck-spacing-large) var(--ck-spacing-large) var(--ck-spacing-small)}.ck.ck-link-form_layout-vertical .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-link-form_layout-vertical .ck-button{padding:var(--ck-spacing-standard);margin:0;border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border);width:50%}[dir=ltr] .ck.ck-link-form_layout-vertical .ck-button,[dir=rtl] .ck.ck-link-form_layout-vertical .ck-button{margin-left:0}[dir=rtl] .ck.ck-link-form_layout-vertical .ck-button:last-of-type{border-right:1px solid var(--ck-color-base-border)}.ck.ck-link-form_layout-vertical .ck.ck-list{margin:var(--ck-spacing-standard) var(--ck-spacing-large)}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton{border:0;padding:0;width:100%}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton:hover{background:none}"},function(t,e,i){var n=i(1),o=i(97);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck.ck-link-actions{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-link-actions .ck-link-actions__preview{display:inline-block}.ck.ck-link-actions .ck-link-actions__preview .ck-button__label{overflow:hidden}@media screen and (max-width:600px){.ck.ck-link-actions{flex-wrap:wrap}.ck.ck-link-actions .ck-link-actions__preview{flex-basis:100%}.ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){flex-basis:50%}}.ck.ck-link-actions .ck-button.ck-link-actions__preview{padding-left:0;padding-right:0}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{padding:0 var(--ck-spacing-medium);color:var(--ck-color-link-default);text-overflow:ellipsis;cursor:pointer;max-width:var(--ck-input-text-width);min-width:3em;text-align:center}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label:hover{text-decoration:underline}.ck.ck-link-actions .ck-button.ck-link-actions__preview,.ck.ck-link-actions .ck-button.ck-link-actions__preview:active,.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus,.ck.ck-link-actions .ck-button.ck-link-actions__preview:hover{background:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:active{box-shadow:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus .ck-button__label{text-decoration:underline}[dir=ltr] .ck.ck-link-actions .ck-button:not(:first-child),[dir=rtl] .ck.ck-link-actions .ck-button:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-link-actions .ck-button.ck-link-actions__preview{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{min-width:0;max-width:100%}[dir=ltr] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview),[dir=rtl] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){margin-left:0}}"},function(t,e,i){var n=i(1),o=i(99);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck.ck-link-image_icon{position:absolute;top:var(--ck-spacing-medium);right:var(--ck-spacing-medium);width:28px;height:28px;padding:4px;box-sizing:border-box;border-radius:var(--ck-border-radius)}.ck.ck-link-image_icon svg{fill:currentColor}.ck.ck-link-image_icon{color:#fff;background:rgba(0,0,0,.4)}"},function(t,e,i){var n=i(1),o=i(101);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports='.ck-media__wrapper .ck-media__placeholder{display:flex;flex-direction:column;align-items:center}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url .ck-tooltip{display:block}@media (hover:none){.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url .ck-tooltip{display:none}}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url{max-width:100%;position:relative}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url:hover .ck-tooltip{visibility:visible;opacity:1}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url .ck-media__placeholder__url__text{overflow:hidden;display:block}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="goo.gl/maps"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="google.com/maps"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="maps.app.goo.gl"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="maps.google.com"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck-media__placeholder__icon *{display:none}.ck-editor__editable:not(.ck-read-only) .ck-media__wrapper>:not(.ck-media__placeholder),.ck-editor__editable:not(.ck-read-only) .ck-widget:not(.ck-widget_selected) .ck-media__placeholder{pointer-events:none}:root{--ck-media-embed-placeholder-icon-size:3em;--ck-color-media-embed-placeholder-url-text:#757575;--ck-color-media-embed-placeholder-url-text-hover:var(--ck-color-base-text)}.ck-media__wrapper{margin:0 auto}.ck-media__wrapper .ck-media__placeholder{padding:calc(var(--ck-spacing-standard)*3);background:var(--ck-color-base-foreground)}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__icon{min-width:var(--ck-media-embed-placeholder-icon-size);height:var(--ck-media-embed-placeholder-icon-size);margin-bottom:var(--ck-spacing-large);background-position:50%;background-size:cover}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__icon .ck-icon{width:100%;height:100%}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url__text{color:var(--ck-color-media-embed-placeholder-url-text);white-space:nowrap;text-align:center;font-style:italic;text-overflow:ellipsis}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url__text:hover{color:var(--ck-color-media-embed-placeholder-url-text-hover);cursor:pointer;text-decoration:underline}.ck-media__wrapper[data-oembed-url*="open.spotify.com"]{max-width:300px;max-height:380px}.ck-media__wrapper[data-oembed-url*="goo.gl/maps"] .ck-media__placeholder__icon,.ck-media__wrapper[data-oembed-url*="google.com/maps"] .ck-media__placeholder__icon,.ck-media__wrapper[data-oembed-url*="maps.app.goo.gl"] .ck-media__placeholder__icon,.ck-media__wrapper[data-oembed-url*="maps.google.com"] .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNTAuMzc4IiBoZWlnaHQ9IjI1NC4xNjciIHZpZXdCb3g9IjAgMCA2Ni4yNDYgNjcuMjQ4Ij48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTcyLjUzMSAtMjE4LjQ1NSkgc2NhbGUoLjk4MDEyKSI+PHJlY3Qgcnk9IjUuMjM4IiByeD0iNS4yMzgiIHk9IjIzMS4zOTkiIHg9IjE3Ni4wMzEiIGhlaWdodD0iNjAuMDk5IiB3aWR0aD0iNjAuMDk5IiBmaWxsPSIjMzRhNjY4IiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjxwYXRoIGQ9Ik0yMDYuNDc3IDI2MC45bC0yOC45ODcgMjguOTg3YTUuMjE4IDUuMjE4IDAgMDAzLjc4IDEuNjFoNDkuNjIxYzEuNjk0IDAgMy4xOS0uNzk4IDQuMTQ2LTIuMDM3eiIgZmlsbD0iIzVjODhjNSIvPjxwYXRoIGQ9Ik0yMjYuNzQyIDIyMi45ODhjLTkuMjY2IDAtMTYuNzc3IDcuMTctMTYuNzc3IDE2LjAxNC4wMDcgMi43NjIuNjYzIDUuNDc0IDIuMDkzIDcuODc1LjQzLjcwMy44MyAxLjQwOCAxLjE5IDIuMTA3LjMzMy41MDIuNjUgMS4wMDUuOTUgMS41MDguMzQzLjQ3Ny42NzMuOTU3Ljk4OCAxLjQ0IDEuMzEgMS43NjkgMi41IDMuNTAyIDMuNjM3IDUuMTY4Ljc5MyAxLjI3NSAxLjY4MyAyLjY0IDIuNDY2IDMuOTkgMi4zNjMgNC4wOTQgNC4wMDcgOC4wOTIgNC42IDEzLjkxNHYuMDEyYy4xODIuNDEyLjUxNi42NjYuODc5LjY2Ny40MDMtLjAwMS43NjgtLjMxNC45My0uNzk5LjYwMy01Ljc1NiAyLjIzOC05LjcyOSA0LjU4NS0xMy43OTQuNzgyLTEuMzUgMS42NzMtMi43MTUgMi40NjUtMy45OSAxLjEzNy0xLjY2NiAyLjMyOC0zLjQgMy42MzgtNS4xNjkuMzE1LS40ODIuNjQ1LS45NjIuOTg4LTEuNDM5LjMtLjUwMy42MTctMS4wMDYuOTUtMS41MDguMzU5LS43Ljc2LTEuNDA0IDEuMTktMi4xMDcgMS40MjYtMi40MDIgMi01LjExNCAyLjAwNC03Ljg3NSAwLTguODQ0LTcuNTExLTE2LjAxNC0xNi43NzYtMTYuMDE0eiIgZmlsbD0iI2RkNGIzZSIgcGFpbnQtb3JkZXI9Im1hcmtlcnMgc3Ryb2tlIGZpbGwiLz48ZWxsaXBzZSByeT0iNS41NjQiIHJ4PSI1LjgyOCIgY3k9IjIzOS4wMDIiIGN4PSIyMjYuNzQyIiBmaWxsPSIjODAyZDI3IiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjxwYXRoIGQ9Ik0xOTAuMzAxIDIzNy4yODNjLTQuNjcgMC04LjQ1NyAzLjg1My04LjQ1NyA4LjYwNnMzLjc4NiA4LjYwNyA4LjQ1NyA4LjYwN2MzLjA0MyAwIDQuODA2LS45NTggNi4zMzctMi41MTYgMS41My0xLjU1NyAyLjA4Ny0zLjkxMyAyLjA4Ny02LjI5IDAtLjM2Mi0uMDIzLS43MjItLjA2NC0xLjA3OWgtOC4yNTd2My4wNDNoNC44NWMtLjE5Ny43NTktLjUzMSAxLjQ1LTEuMDU4IDEuOTg2LS45NDIuOTU4LTIuMDI4IDEuNTQ4LTMuOTAxIDEuNTQ4LTIuODc2IDAtNS4yMDgtMi4zNzItNS4yMDgtNS4yOTkgMC0yLjkyNiAyLjMzMi01LjI5OSA1LjIwOC01LjI5OSAxLjM5OSAwIDIuNjE4LjQwNyAzLjU4NCAxLjI5M2wyLjM4MS0yLjM4YzAtLjAwMi0uMDAzLS4wMDQtLjAwNC0uMDA1LTEuNTg4LTEuNTI0LTMuNjItMi4yMTUtNS45NTUtMi4yMTV6bTQuNDMgNS42NmwuMDAzLjAwNnYtLjAwM3oiIGZpbGw9IiNmZmYiIHBhaW50LW9yZGVyPSJtYXJrZXJzIHN0cm9rZSBmaWxsIi8+PHBhdGggZD0iTTIxNS4xODQgMjUxLjkyOWwtNy45OCA3Ljk3OSAyOC40NzcgMjguNDc1YTUuMjMzIDUuMjMzIDAgMDAuNDQ5LTIuMTIzdi0zMS4xNjVjLS40NjkuNjc1LS45MzQgMS4zNDktMS4zODIgMi4wMDUtLjc5MiAxLjI3NS0xLjY4MiAyLjY0LTIuNDY1IDMuOTktMi4zNDcgNC4wNjUtMy45ODIgOC4wMzgtNC41ODUgMTMuNzk0LS4xNjIuNDg1LS41MjcuNzk4LS45My43OTktLjM2My0uMDAxLS42OTctLjI1NS0uODc5LS42Njd2LS4wMTJjLS41OTMtNS44MjItMi4yMzctOS44Mi00LjYtMTMuOTE0LS43ODMtMS4zNS0xLjY3My0yLjcxNS0yLjQ2Ni0zLjk5LTEuMTM3LTEuNjY2LTIuMzI3LTMuNC0zLjYzNy01LjE2OWwtLjAwMi0uMDAzeiIgZmlsbD0iI2MzYzNjMyIvPjxwYXRoIGQ9Ik0yMTIuOTgzIDI0OC40OTVsLTM2Ljk1MiAzNi45NTN2LjgxMmE1LjIyNyA1LjIyNyAwIDAwNS4yMzggNS4yMzhoMS4wMTVsMzUuNjY2LTM1LjY2NmExMzYuMjc1IDEzNi4yNzUgMCAwMC0yLjc2NC0zLjkgMzcuNTc1IDM3LjU3NSAwIDAwLS45ODktMS40NCAzNS4xMjcgMzUuMTI3IDAgMDAtLjk1LTEuNTA4Yy0uMDgzLS4xNjItLjE3Ni0uMzI2LS4yNjQtLjQ4OXoiIGZpbGw9IiNmZGRjNGYiIHBhaW50LW9yZGVyPSJtYXJrZXJzIHN0cm9rZSBmaWxsIi8+PHBhdGggZD0iTTIxMS45OTggMjYxLjA4M2wtNi4xNTIgNi4xNTEgMjQuMjY0IDI0LjI2NGguNzgxYTUuMjI3IDUuMjI3IDAgMDA1LjIzOS01LjIzOHYtMS4wNDV6IiBmaWxsPSIjZmZmIiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjwvZz48L3N2Zz4=)}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder{background:#4268b3}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAyNCIgaGVpZ2h0PSIxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik05NjcuNDg0IDBINTYuNTE3QzI1LjMwNCAwIDAgMjUuMzA0IDAgNTYuNTE3djkxMC45NjZDMCA5OTguNjk0IDI1LjI5NyAxMDI0IDU2LjUyMiAxMDI0SDU0N1Y2MjhINDE0VjQ3M2gxMzNWMzU5LjAyOWMwLTEzMi4yNjIgODAuNzczLTIwNC4yODIgMTk4Ljc1Ni0yMDQuMjgyIDU2LjUxMyAwIDEwNS4wODYgNC4yMDggMTE5LjI0NCA2LjA4OVYyOTlsLTgxLjYxNi4wMzdjLTYzLjk5MyAwLTc2LjM4NCAzMC40OTItNzYuMzg0IDc1LjIzNlY0NzNoMTUzLjQ4N2wtMTkuOTg2IDE1NUg3MDd2Mzk2aDI2MC40ODRjMzEuMjEzIDAgNTYuNTE2LTI1LjMwMyA1Ni41MTYtNTYuNTE2VjU2LjUxNUMxMDI0IDI1LjMwMyA5OTguNjk3IDAgOTY3LjQ4NCAwIiBmaWxsPSIjRkZGRkZFIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder .ck-media__placeholder__url__text{color:#cdf}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder .ck-media__placeholder__url__text:hover{color:#fff}.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder{background:linear-gradient(-135deg,#1400c7,#b800b1,#f50000)}.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTA0IiBoZWlnaHQ9IjUwNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PGRlZnM+PHBhdGggaWQ9ImEiIGQ9Ik0wIC4xNTloNTAzLjg0MVY1MDMuOTRIMHoiLz48L2RlZnM+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48bWFzayBpZD0iYiIgZmlsbD0iI2ZmZiI+PHVzZSB4bGluazpocmVmPSIjYSIvPjwvbWFzaz48cGF0aCBkPSJNMjUxLjkyMS4xNTljLTY4LjQxOCAwLTc2Ljk5Ny4yOS0xMDMuODY3IDEuNTE2LTI2LjgxNCAxLjIyMy00NS4xMjcgNS40ODItNjEuMTUxIDExLjcxLTE2LjU2NiA2LjQzNy0zMC42MTUgMTUuMDUxLTQ0LjYyMSAyOS4wNTYtMTQuMDA1IDE0LjAwNi0yMi42MTkgMjguMDU1LTI5LjA1NiA0NC42MjEtNi4yMjggMTYuMDI0LTEwLjQ4NyAzNC4zMzctMTEuNzEgNjEuMTUxQy4yOSAxNzUuMDgzIDAgMTgzLjY2MiAwIDI1Mi4wOGMwIDY4LjQxNy4yOSA3Ni45OTYgMS41MTYgMTAzLjg2NiAxLjIyMyAyNi44MTQgNS40ODIgNDUuMTI3IDExLjcxIDYxLjE1MSA2LjQzNyAxNi41NjYgMTUuMDUxIDMwLjYxNSAyOS4wNTYgNDQuNjIxIDE0LjAwNiAxNC4wMDUgMjguMDU1IDIyLjYxOSA0NC42MjEgMjkuMDU3IDE2LjAyNCA2LjIyNyAzNC4zMzcgMTAuNDg2IDYxLjE1MSAxMS43MDkgMjYuODcgMS4yMjYgMzUuNDQ5IDEuNTE2IDEwMy44NjcgMS41MTYgNjguNDE3IDAgNzYuOTk2LS4yOSAxMDMuODY2LTEuNTE2IDI2LjgxNC0xLjIyMyA0NS4xMjctNS40ODIgNjEuMTUxLTExLjcwOSAxNi41NjYtNi40MzggMzAuNjE1LTE1LjA1MiA0NC42MjEtMjkuMDU3IDE0LjAwNS0xNC4wMDYgMjIuNjE5LTI4LjA1NSAyOS4wNTctNDQuNjIxIDYuMjI3LTE2LjAyNCAxMC40ODYtMzQuMzM3IDExLjcwOS02MS4xNTEgMS4yMjYtMjYuODcgMS41MTYtMzUuNDQ5IDEuNTE2LTEwMy44NjYgMC02OC40MTgtLjI5LTc2Ljk5Ny0xLjUxNi0xMDMuODY3LTEuMjIzLTI2LjgxNC01LjQ4Mi00NS4xMjctMTEuNzA5LTYxLjE1MS02LjQzOC0xNi41NjYtMTUuMDUyLTMwLjYxNS0yOS4wNTctNDQuNjIxLTE0LjAwNi0xNC4wMDUtMjguMDU1LTIyLjYxOS00NC42MjEtMjkuMDU2LTE2LjAyNC02LjIyOC0zNC4zMzctMTAuNDg3LTYxLjE1MS0xMS43MUMzMjguOTE3LjQ0OSAzMjAuMzM4LjE1OSAyNTEuOTIxLjE1OXptMCA0NS4zOTFjNjcuMjY1IDAgNzUuMjMzLjI1NyAxMDEuNzk3IDEuNDY5IDI0LjU2MiAxLjEyIDM3LjkwMSA1LjIyNCA0Ni43NzggOC42NzQgMTEuNzU5IDQuNTcgMjAuMTUxIDEwLjAyOSAyOC45NjYgMTguODQ1IDguODE2IDguODE1IDE0LjI3NSAxNy4yMDcgMTguODQ1IDI4Ljk2NiAzLjQ1IDguODc3IDcuNTU0IDIyLjIxNiA4LjY3NCA0Ni43NzggMS4yMTIgMjYuNTY0IDEuNDY5IDM0LjUzMiAxLjQ2OSAxMDEuNzk4IDAgNjcuMjY1LS4yNTcgNzUuMjMzLTEuNDY5IDEwMS43OTctMS4xMiAyNC41NjItNS4yMjQgMzcuOTAxLTguNjc0IDQ2Ljc3OC00LjU3IDExLjc1OS0xMC4wMjkgMjAuMTUxLTE4Ljg0NSAyOC45NjYtOC44MTUgOC44MTYtMTcuMjA3IDE0LjI3NS0yOC45NjYgMTguODQ1LTguODc3IDMuNDUtMjIuMjE2IDcuNTU0LTQ2Ljc3OCA4LjY3NC0yNi41NiAxLjIxMi0zNC41MjcgMS40NjktMTAxLjc5NyAxLjQ2OS02Ny4yNzEgMC03NS4yMzctLjI1Ny0xMDEuNzk4LTEuNDY5LTI0LjU2Mi0xLjEyLTM3LjkwMS01LjIyNC00Ni43NzgtOC42NzQtMTEuNzU5LTQuNTctMjAuMTUxLTEwLjAyOS0yOC45NjYtMTguODQ1LTguODE1LTguODE1LTE0LjI3NS0xNy4yMDctMTguODQ1LTI4Ljk2Ni0zLjQ1LTguODc3LTcuNTU0LTIyLjIxNi04LjY3NC00Ni43NzgtMS4yMTItMjYuNTY0LTEuNDY5LTM0LjUzMi0xLjQ2OS0xMDEuNzk3IDAtNjcuMjY2LjI1Ny03NS4yMzQgMS40NjktMTAxLjc5OCAxLjEyLTI0LjU2MiA1LjIyNC0zNy45MDEgOC42NzQtNDYuNzc4IDQuNTctMTEuNzU5IDEwLjAyOS0yMC4xNTEgMTguODQ1LTI4Ljk2NiA4LjgxNS04LjgxNiAxNy4yMDctMTQuMjc1IDI4Ljk2Ni0xOC44NDUgOC44NzctMy40NSAyMi4yMTYtNy41NTQgNDYuNzc4LTguNjc0IDI2LjU2NC0xLjIxMiAzNC41MzItMS40NjkgMTAxLjc5OC0xLjQ2OXoiIGZpbGw9IiNGRkYiIG1hc2s9InVybCgjYikiLz48cGF0aCBkPSJNMjUxLjkyMSAzMzYuMDUzYy00Ni4zNzggMC04My45NzQtMzcuNTk2LTgzLjk3NC04My45NzMgMC00Ni4zNzggMzcuNTk2LTgzLjk3NCA4My45NzQtODMuOTc0IDQ2LjM3NyAwIDgzLjk3MyAzNy41OTYgODMuOTczIDgzLjk3NCAwIDQ2LjM3Ny0zNy41OTYgODMuOTczLTgzLjk3MyA4My45NzN6bTAtMjEzLjMzOGMtNzEuNDQ3IDAtMTI5LjM2NSA1Ny45MTgtMTI5LjM2NSAxMjkuMzY1IDAgNzEuNDQ2IDU3LjkxOCAxMjkuMzY0IDEyOS4zNjUgMTI5LjM2NCA3MS40NDYgMCAxMjkuMzY0LTU3LjkxOCAxMjkuMzY0LTEyOS4zNjQgMC03MS40NDctNTcuOTE4LTEyOS4zNjUtMTI5LjM2NC0xMjkuMzY1ek00MTYuNjI3IDExNy42MDRjMCAxNi42OTYtMTMuNTM1IDMwLjIzLTMwLjIzMSAzMC4yMy0xNi42OTUgMC0zMC4yMy0xMy41MzQtMzAuMjMtMzAuMjMgMC0xNi42OTYgMTMuNTM1LTMwLjIzMSAzMC4yMy0zMC4yMzEgMTYuNjk2IDAgMzAuMjMxIDEzLjUzNSAzMC4yMzEgMzAuMjMxIiBmaWxsPSIjRkZGIi8+PC9nPjwvc3ZnPg==)}.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder .ck-media__placeholder__url__text{color:#ffe0fe}.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder .ck-media__placeholder__url__text:hover{color:#fff}.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck.ck-media__placeholder{background:linear-gradient(90deg,#71c6f4,#0d70a5)}.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck.ck-media__placeholder .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0MDAgNDAwIj48cGF0aCBkPSJNNDAwIDIwMGMwIDExMC41LTg5LjUgMjAwLTIwMCAyMDBTMCAzMTAuNSAwIDIwMCA4OS41IDAgMjAwIDBzMjAwIDg5LjUgMjAwIDIwMHpNMTYzLjQgMzA1LjVjODguNyAwIDEzNy4yLTczLjUgMTM3LjItMTM3LjIgMC0yLjEgMC00LjItLjEtNi4yIDkuNC02LjggMTcuNi0xNS4zIDI0LjEtMjUtOC42IDMuOC0xNy45IDYuNC0yNy43IDcuNiAxMC02IDE3LjYtMTUuNCAyMS4yLTI2LjctOS4zIDUuNS0xOS42IDkuNS0zMC42IDExLjctOC44LTkuNC0yMS4zLTE1LjItMzUuMi0xNS4yLTI2LjYgMC00OC4yIDIxLjYtNDguMiA0OC4yIDAgMy44LjQgNy41IDEuMyAxMS00MC4xLTItNzUuNi0yMS4yLTk5LjQtNTAuNC00LjEgNy4xLTYuNSAxNS40LTYuNSAyNC4yIDAgMTYuNyA4LjUgMzEuNSAyMS41IDQwLjEtNy45LS4yLTE1LjMtMi40LTIxLjgtNnYuNmMwIDIzLjQgMTYuNiA0Mi44IDM4LjcgNDcuMy00IDEuMS04LjMgMS43LTEyLjcgMS43LTMuMSAwLTYuMS0uMy05LjEtLjkgNi4xIDE5LjIgMjMuOSAzMy4xIDQ1IDMzLjUtMTYuNSAxMi45LTM3LjMgMjAuNi01OS45IDIwLjYtMy45IDAtNy43LS4yLTExLjUtLjcgMjEuMSAxMy44IDQ2LjUgMjEuOCA3My43IDIxLjgiIGZpbGw9IiNmZmYiLz48L3N2Zz4=)}.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck.ck-media__placeholder .ck-media__placeholder__url__text{color:#b8e6ff}.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck.ck-media__placeholder .ck-media__placeholder__url__text:hover{color:#fff}'},function(t,e,i){var n=i(1),o=i(103);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck.ck-media-form{display:flex;align-items:flex-start;flex-direction:row;flex-wrap:nowrap}.ck.ck-media-form .ck-labeled-field-view{display:inline-block}.ck.ck-media-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-media-form{flex-wrap:wrap}.ck.ck-media-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-media-form .ck-button{flex-basis:50%}}"},function(t,e,i){var n=i(1),o=i(105);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck-content .media{clear:both;margin:1em 0;display:block;min-width:15em}"},function(t,e,i){var n=i(1),o=i(107);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=":root{--ck-color-table-focused-cell-background:rgba(158,207,250,0.3)}.ck-widget.table td.ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck-widget.table td.ck-editor__nested-editable:focus,.ck-widget.table th.ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck-widget.table th.ck-editor__nested-editable:focus{background:var(--ck-color-table-focused-cell-background);border-style:none;outline:1px solid var(--ck-color-focus-border);outline-offset:-1px}"},function(t,e,i){var n=i(1),o=i(109);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck .ck-insert-table-dropdown__grid{display:flex;flex-direction:row;flex-wrap:wrap}:root{--ck-insert-table-dropdown-padding:10px;--ck-insert-table-dropdown-box-height:11px;--ck-insert-table-dropdown-box-width:12px;--ck-insert-table-dropdown-box-margin:1px}.ck .ck-insert-table-dropdown__grid{width:calc(var(--ck-insert-table-dropdown-box-width)*10 + var(--ck-insert-table-dropdown-box-margin)*20 + var(--ck-insert-table-dropdown-padding)*2);padding:var(--ck-insert-table-dropdown-padding) var(--ck-insert-table-dropdown-padding) 0}.ck .ck-insert-table-dropdown__label{text-align:center}.ck .ck-insert-table-dropdown-grid-box{width:var(--ck-insert-table-dropdown-box-width);height:var(--ck-insert-table-dropdown-box-height);margin:var(--ck-insert-table-dropdown-box-margin);border:1px solid var(--ck-color-base-border);border-radius:1px}.ck .ck-insert-table-dropdown-grid-box.ck-on{border-color:var(--ck-color-focus-border);background:var(--ck-color-focus-outer-shadow)}"},function(t,e,i){var n=i(1),o=i(111);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=':root{--ck-table-selected-cell-background:rgba(158,207,250,0.3)}.ck.ck-editor__editable .table table td.ck-editor__editable_selected,.ck.ck-editor__editable .table table th.ck-editor__editable_selected{position:relative;caret-color:transparent;outline:unset;box-shadow:unset}.ck.ck-editor__editable .table table td.ck-editor__editable_selected:after,.ck.ck-editor__editable .table table th.ck-editor__editable_selected:after{content:"";pointer-events:none;background-color:var(--ck-table-selected-cell-background);position:absolute;top:0;left:0;right:0;bottom:0}.ck.ck-editor__editable .table table td.ck-editor__editable_selected ::selection,.ck.ck-editor__editable .table table td.ck-editor__editable_selected:focus,.ck.ck-editor__editable .table table th.ck-editor__editable_selected ::selection,.ck.ck-editor__editable .table table th.ck-editor__editable_selected:focus{background-color:transparent}.ck.ck-editor__editable .table table td.ck-editor__editable_selected .ck-widget_selected,.ck.ck-editor__editable .table table th.ck-editor__editable_selected .ck-widget_selected{outline:unset}'},function(t,e,i){var n=i(1),o=i(113);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck-content .table{margin:1em auto;display:table}.ck-content .table table{border-collapse:collapse;border-spacing:0;width:100%;height:100%;border:1px double #b3b3b3}.ck-content .table table td,.ck-content .table table th{min-width:2em;padding:.4em;border:1px solid #bfbfbf}.ck-content .table table th{font-weight:700;background:hsla(0,0%,0%,5%)}.ck-content[dir=rtl] .table th{text-align:right}.ck-content[dir=ltr] .table th{text-align:left}"},function(t,e,i){var n=i(1),o=i(115);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck .ck-button.ck-color-table__remove-color{display:flex;align-items:center;width:100%}label.ck.ck-color-grid__label{font-weight:unset}.ck .ck-button.ck-color-table__remove-color{padding:calc(var(--ck-spacing-standard)/2) var(--ck-spacing-standard);border-bottom-left-radius:0;border-bottom-right-radius:0}.ck .ck-button.ck-color-table__remove-color:not(:focus){border-bottom:1px solid var(--ck-color-base-border)}[dir=ltr] .ck .ck-button.ck-color-table__remove-color .ck.ck-icon{margin-right:var(--ck-spacing-standard)}[dir=rtl] .ck .ck-button.ck-color-table__remove-color .ck.ck-icon{margin-left:var(--ck-spacing-standard)}"},function(t,e,i){var n=i(1),o=i(117);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck.ck-character-grid{max-width:100%}.ck.ck-character-grid .ck-character-grid__tiles{display:grid}:root{--ck-character-grid-tile-size:24px}.ck.ck-character-grid{overflow-y:auto;overflow-x:hidden;width:350px;max-height:200px}.ck.ck-character-grid .ck-character-grid__tiles{grid-template-columns:repeat(auto-fit,minmax(var(--ck-character-grid-tile-size),1fr));margin:var(--ck-spacing-standard) var(--ck-spacing-large);grid-gap:var(--ck-spacing-standard)}.ck.ck-character-grid .ck-character-grid__tile{width:var(--ck-character-grid-tile-size);height:var(--ck-character-grid-tile-size);min-width:var(--ck-character-grid-tile-size);min-height:var(--ck-character-grid-tile-size);font-size:1.2em;padding:0;transition:box-shadow .2s ease;border:0}.ck.ck-character-grid .ck-character-grid__tile:focus:not(.ck-disabled),.ck.ck-character-grid .ck-character-grid__tile:hover:not(.ck-disabled){border:0;box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-focus-border)}.ck.ck-character-grid .ck-character-grid__tile .ck-button__label{line-height:var(--ck-character-grid-tile-size);width:100%;text-align:center}"},function(t,e,i){var n=i(1),o=i(119);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck.ck-character-info{display:flex;justify-content:space-between;padding:var(--ck-spacing-small) var(--ck-spacing-large);border-top:1px solid var(--ck-color-base-border)}.ck.ck-character-info>*{text-transform:uppercase;font-size:var(--ck-font-size-small)}.ck.ck-character-info .ck-character-info__name{max-width:280px;text-overflow:ellipsis;overflow:hidden}.ck.ck-character-info .ck-character-info__code{opacity:.6}"},function(t,e,i){var n=i(1),o=i(121);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck.ck-special-characters-navigation>.ck-label{max-width:160px;text-overflow:ellipsis;overflow:hidden}.ck.ck-special-characters-navigation>.ck-dropdown .ck-dropdown__panel{max-height:250px;overflow-y:auto;overflow-x:hidden}"},function(t,e,i){"use strict";i.r(e);var n=function(){return function t(){t.called=!0}};class o{constructor(t,e){this.source=t,this.name=e,this.path=[],this.stop=n(),this.off=n()}}const r=new Array(256).fill().map((t,e)=>("0"+e.toString(16)).slice(-2));function s(){const t=4294967296*Math.random()>>>0,e=4294967296*Math.random()>>>0,i=4294967296*Math.random()>>>0,n=4294967296*Math.random()>>>0;return"e"+r[t>>0&255]+r[t>>8&255]+r[t>>16&255]+r[t>>24&255]+r[e>>0&255]+r[e>>8&255]+r[e>>16&255]+r[e>>24&255]+r[i>>0&255]+r[i>>8&255]+r[i>>16&255]+r[i>>24&255]+r[n>>0&255]+r[n>>8&255]+r[n>>16&255]+r[n>>24&255]}var a={get(t){return"number"!=typeof t?this[t]||this.normal:t},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5},l=(i(6),i(0));const c=Symbol("listeningTo"),d=Symbol("emitterId");var h={on(t,e,i={}){this.listenTo(this,t,e,i)},once(t,e,i){let n=!1;this.listenTo(this,t,(function(t,...i){n||(n=!0,t.off(),e.call(this,t,...i))}),i)},off(t,e){this.stopListening(this,t,e)},listenTo(t,e,i,n={}){let o,r;this[c]||(this[c]={});const s=this[c];m(t)||u(t);const a=m(t);(o=s[a])||(o=s[a]={emitter:t,callbacks:{}}),(r=o.callbacks[e])||(r=o.callbacks[e]=[]),r.push(i),function(t,e,i,n,o){e._addEventListener?e._addEventListener(i,n,o):t._addEventListener.call(e,i,n,o)}(this,t,e,i,n)},stopListening(t,e,i){const n=this[c];let o=t&&m(t);const r=n&&o&&n[o],s=r&&e&&r.callbacks[e];if(!(!n||t&&!r||e&&!s))if(i){w(this,t,e,i);-1!==s.indexOf(i)&&(1===s.length?delete r.callbacks[e]:w(this,t,e,i))}else if(s){for(;i=s.pop();)w(this,t,e,i);delete r.callbacks[e]}else if(r){for(e in r.callbacks)this.stopListening(t,e);delete n[o]}else{for(o in n)this.stopListening(n[o].emitter);delete this[c]}},fire(t,...e){try{const i=t instanceof o?t:new o(this,t),n=i.name;let r=function t(e,i){let n;if(!e._events||!(n=e._events[i])||!n.callbacks.length)return i.indexOf(":")>-1?t(e,i.substr(0,i.lastIndexOf(":"))):null;return n.callbacks}(this,n);if(i.path.push(this),r){const t=[i,...e];r=Array.from(r);for(let e=0;e<r.length&&(r[e].callback.apply(this,t),i.off.called&&(delete i.off.called,this._removeEventListener(n,r[e].callback)),!i.stop.called);e++);}if(this._delegations){const t=this._delegations.get(n),o=this._delegations.get("*");t&&p(t,i,e),o&&p(o,i,e)}return i.return}catch(t){l.a.rethrowUnexpectedError(t,this)}},delegate(...t){return{to:(e,i)=>{this._delegations||(this._delegations=new Map),t.forEach(t=>{const n=this._delegations.get(t);n?n.set(e,i):this._delegations.set(t,new Map([[e,i]]))})}}},stopDelegating(t,e){if(this._delegations)if(t)if(e){const i=this._delegations.get(t);i&&i.delete(e)}else this._delegations.delete(t);else this._delegations.clear()},_addEventListener(t,e,i){!function(t,e){const i=g(t);if(i[e])return;let n=e,o=null;const r=[];for(;""!==n&&!i[n];)i[n]={callbacks:[],childEvents:[]},r.push(i[n]),o&&i[n].childEvents.push(o),o=n,n=n.substr(0,n.lastIndexOf(":"));if(""!==n){for(const t of r)t.callbacks=i[n].callbacks.slice();i[n].childEvents.push(o)}}(this,t);const n=f(this,t),o=a.get(i.priority),r={callback:e,priority:o};for(const t of n){let e=!1;for(let i=0;i<t.length;i++)if(t[i].priority<o){t.splice(i,0,r),e=!0;break}e||t.push(r)}},_removeEventListener(t,e){const i=f(this,t);for(const t of i)for(let i=0;i<t.length;i++)t[i].callback==e&&(t.splice(i,1),i--)}};function u(t,e){t[d]||(t[d]=e||s())}function m(t){return t[d]}function g(t){return t._events||Object.defineProperty(t,"_events",{value:{}}),t._events}function f(t,e){const i=g(t)[e];if(!i)return[];let n=[i.callbacks];for(let e=0;e<i.childEvents.length;e++){const o=f(t,i.childEvents[e]);n=n.concat(o)}return n}function p(t,e,i){for(let[n,r]of t){r?"function"==typeof r&&(r=r(e.name)):r=e.name;const t=new o(e.source,r);t.path=[...e.path],n.fire(t,...i)}}function w(t,e,i,n){e._removeEventListener?e._removeEventListener(i,n):t._removeEventListener.call(e,i,n)}var b=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},k=i(3),_=k.a.Symbol,v=Object.prototype,y=v.hasOwnProperty,x=v.toString,A=_?_.toStringTag:void 0;var C=function(t){var e=y.call(t,A),i=t[A];try{t[A]=void 0;var n=!0}catch(t){}var o=x.call(t);return n&&(e?t[A]=i:delete t[A]),o},T=Object.prototype.toString;var E=function(t){return T.call(t)},P=_?_.toStringTag:void 0;var S=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":P&&P in Object(t)?C(t):E(t)};var M,I=function(t){if(!b(t))return!1;var e=S(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},L=k.a["__core-js_shared__"],N=(M=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+M:"";var R=function(t){return!!N&&N in t},O=Function.prototype.toString;var z=function(t){if(null!=t){try{return O.call(t)}catch(t){}try{return t+""}catch(t){}}return""},D=/^\[object .+?Constructor\]$/,V=Function.prototype,j=Object.prototype,B=V.toString,F=j.hasOwnProperty,H=RegExp("^"+B.call(F).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var U=function(t){return!(!b(t)||R(t))&&(I(t)?H:D).test(z(t))};var q=function(t,e){return null==t?void 0:t[e]};var W=function(t,e){var i=q(t,e);return U(i)?i:void 0},$=function(){try{var t=W(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();var G=function(t,e,i){"__proto__"==e&&$?$(t,e,{configurable:!0,enumerable:!0,value:i,writable:!0}):t[e]=i};var Y=function(t,e){return t===e||t!=t&&e!=e},K=Object.prototype.hasOwnProperty;var Q=function(t,e,i){var n=t[e];K.call(t,e)&&Y(n,i)&&(void 0!==i||e in t)||G(t,e,i)};var J=function(t,e,i,n){var o=!i;i||(i={});for(var r=-1,s=e.length;++r<s;){var a=e[r],l=n?n(i[a],t[a],a,i,t):void 0;void 0===l&&(l=t[a]),o?G(i,a,l):Q(i,a,l)}return i};var Z=function(t){return t};var X=function(t,e,i){switch(i.length){case 0:return t.call(e);case 1:return t.call(e,i[0]);case 2:return t.call(e,i[0],i[1]);case 3:return t.call(e,i[0],i[1],i[2])}return t.apply(e,i)},tt=Math.max;var et=function(t,e,i){return e=tt(void 0===e?t.length-1:e,0),function(){for(var n=arguments,o=-1,r=tt(n.length-e,0),s=Array(r);++o<r;)s[o]=n[e+o];o=-1;for(var a=Array(e+1);++o<e;)a[o]=n[o];return a[e]=i(s),X(t,this,a)}};var it=function(t){return function(){return t}},nt=$?function(t,e){return $(t,"toString",{configurable:!0,enumerable:!1,value:it(e),writable:!0})}:Z,ot=Date.now;var rt=function(t){var e=0,i=0;return function(){var n=ot(),o=16-(n-i);if(i=n,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(nt);var st=function(t,e){return rt(et(t,e,Z),t+"")};var at=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991};var lt=function(t){return null!=t&&at(t.length)&&!I(t)},ct=/^(?:0|[1-9]\d*)$/;var dt=function(t,e){var i=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==i||"symbol"!=i&&ct.test(t))&&t>-1&&t%1==0&&t<e};var ht=function(t,e,i){if(!b(i))return!1;var n=typeof e;return!!("number"==n?lt(i)&&dt(e,i.length):"string"==n&&e in i)&&Y(i[e],t)};var ut=function(t){return st((function(e,i){var n=-1,o=i.length,r=o>1?i[o-1]:void 0,s=o>2?i[2]:void 0;for(r=t.length>3&&"function"==typeof r?(o--,r):void 0,s&&ht(i[0],i[1],s)&&(r=o<3?void 0:r,o=1),e=Object(e);++n<o;){var a=i[n];a&&t(e,a,n,r)}return e}))};var mt=function(t,e){for(var i=-1,n=Array(t);++i<t;)n[i]=e(i);return n};var gt=function(t){return null!=t&&"object"==typeof t};var ft=function(t){return gt(t)&&"[object Arguments]"==S(t)},pt=Object.prototype,wt=pt.hasOwnProperty,bt=pt.propertyIsEnumerable,kt=ft(function(){return arguments}())?ft:function(t){return gt(t)&&wt.call(t,"callee")&&!bt.call(t,"callee")},_t=Array.isArray,vt=i(4),yt={};yt["[object Float32Array]"]=yt["[object Float64Array]"]=yt["[object Int8Array]"]=yt["[object Int16Array]"]=yt["[object Int32Array]"]=yt["[object Uint8Array]"]=yt["[object Uint8ClampedArray]"]=yt["[object Uint16Array]"]=yt["[object Uint32Array]"]=!0,yt["[object Arguments]"]=yt["[object Array]"]=yt["[object ArrayBuffer]"]=yt["[object Boolean]"]=yt["[object DataView]"]=yt["[object Date]"]=yt["[object Error]"]=yt["[object Function]"]=yt["[object Map]"]=yt["[object Number]"]=yt["[object Object]"]=yt["[object RegExp]"]=yt["[object Set]"]=yt["[object String]"]=yt["[object WeakMap]"]=!1;var xt=function(t){return gt(t)&&at(t.length)&&!!yt[S(t)]};var At=function(t){return function(e){return t(e)}},Ct=i(5),Tt=Ct.a&&Ct.a.isTypedArray,Et=Tt?At(Tt):xt,Pt=Object.prototype.hasOwnProperty;var St=function(t,e){var i=_t(t),n=!i&&kt(t),o=!i&&!n&&Object(vt.a)(t),r=!i&&!n&&!o&&Et(t),s=i||n||o||r,a=s?mt(t.length,String):[],l=a.length;for(var c in t)!e&&!Pt.call(t,c)||s&&("length"==c||o&&("offset"==c||"parent"==c)||r&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||dt(c,l))||a.push(c);return a},Mt=Object.prototype;var It=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Mt)};var Lt=function(t){var e=[];if(null!=t)for(var i in Object(t))e.push(i);return e},Nt=Object.prototype.hasOwnProperty;var Rt=function(t){if(!b(t))return Lt(t);var e=It(t),i=[];for(var n in t)("constructor"!=n||!e&&Nt.call(t,n))&&i.push(n);return i};var Ot=function(t){return lt(t)?St(t,!0):Rt(t)},zt=ut((function(t,e){J(e,Ot(e),t)}));const Dt=Symbol("observableProperties"),Vt=Symbol("boundObservables"),jt=Symbol("boundProperties"),Bt=Symbol("decoratedMethods"),Ft=Symbol("decoratedOriginal"),Ht={set(t,e){if(b(t))return void Object.keys(t).forEach(e=>{this.set(e,t[e])},this);qt(this);const i=this[Dt];if(t in this&&!i.has(t))throw new l.a("observable-set-cannot-override",this);Object.defineProperty(this,t,{enumerable:!0,configurable:!0,get:()=>i.get(t),set(e){const n=i.get(t);let o=this.fire("set:"+t,t,e,n);void 0===o&&(o=e),n===o&&i.has(t)||(i.set(t,o),this.fire("change:"+t,t,o,n))}}),this[t]=e},bind(...t){if(!t.length||!Gt(t))throw new l.a("observable-bind-wrong-properties",this);if(new Set(t).size!==t.length)throw new l.a("observable-bind-duplicate-properties",this);qt(this);const e=this[jt];t.forEach(t=>{if(e.has(t))throw new l.a("observable-bind-rebind",this)});const i=new Map;return t.forEach(t=>{const n={property:t,to:[]};e.set(t,n),i.set(t,n)}),{to:Wt,toMany:$t,_observable:this,_bindProperties:t,_to:[],_bindings:i}},unbind(...t){if(!this[Dt])return;const e=this[jt],i=this[Vt];if(t.length){if(!Gt(t))throw new l.a("observable-unbind-wrong-properties",this);t.forEach(t=>{const n=e.get(t);if(!n)return;let o,r,s,a;n.to.forEach(t=>{o=t[0],r=t[1],s=i.get(o),a=s[r],a.delete(n),a.size||delete s[r],Object.keys(s).length||(i.delete(o),this.stopListening(o,"change"))}),e.delete(t)})}else i.forEach((t,e)=>{this.stopListening(e,"change")}),i.clear(),e.clear()},decorate(t){const e=this[t];if(!e)throw new l.a("observablemixin-cannot-decorate-undefined",this,{object:this,methodName:t});this.on(t,(t,i)=>{t.return=e.apply(this,i)}),this[t]=function(...e){return this.fire(t,e)},this[t][Ft]=e,this[Bt]||(this[Bt]=[]),this[Bt].push(t)}};zt(Ht,h),Ht.stopListening=function(t,e,i){if(!t&&this[Bt]){for(const t of this[Bt])this[t]=this[t][Ft];delete this[Bt]}h.stopListening.call(this,t,e,i)};var Ut=Ht;function qt(t){t[Dt]||(Object.defineProperty(t,Dt,{value:new Map}),Object.defineProperty(t,Vt,{value:new Map}),Object.defineProperty(t,jt,{value:new Map}))}function Wt(...t){const e=function(...t){if(!t.length)throw new l.a("observable-bind-to-parse-error",null);const e={to:[]};let i;"function"==typeof t[t.length-1]&&(e.callback=t.pop());return t.forEach(t=>{if("string"==typeof t)i.properties.push(t);else{if("object"!=typeof t)throw new l.a("observable-bind-to-parse-error",null);i={observable:t,properties:[]},e.to.push(i)}}),e}(...t),i=Array.from(this._bindings.keys()),n=i.length;if(!e.callback&&e.to.length>1)throw new l.a("observable-bind-to-no-callback",this);if(n>1&&e.callback)throw new l.a("observable-bind-to-extra-callback",this);var o;e.to.forEach(t=>{if(t.properties.length&&t.properties.length!==n)throw new l.a("observable-bind-to-properties-length",this);t.properties.length||(t.properties=this._bindProperties)}),this._to=e.to,e.callback&&(this._bindings.get(i[0]).callback=e.callback),o=this._observable,this._to.forEach(t=>{const e=o[Vt];let i;e.get(t.observable)||o.listenTo(t.observable,"change",(n,r)=>{i=e.get(t.observable)[r],i&&i.forEach(t=>{Yt(o,t.property)})})}),function(t){let e;t._bindings.forEach((i,n)=>{t._to.forEach(o=>{e=o.properties[i.callback?0:t._bindProperties.indexOf(n)],i.to.push([o.observable,e]),function(t,e,i,n){const o=t[Vt],r=o.get(i),s=r||{};s[n]||(s[n]=new Set);s[n].add(e),r||o.set(i,s)}(t._observable,i,o.observable,e)})})}(this),this._bindProperties.forEach(t=>{Yt(this._observable,t)})}function $t(t,e,i){if(this._bindings.size>1)throw new l.a("observable-bind-to-many-not-one-binding",this);this.to(...function(t,e){const i=t.map(t=>[t,e]);return Array.prototype.concat.apply([],i)}(t,e),i)}function Gt(t){return t.every(t=>"string"==typeof t)}function Yt(t,e){const i=t[jt].get(e);let n;i.callback?n=i.callback.apply(t,i.to.map(t=>t[0][t[1]])):(n=i.to[0],n=n[0][n[1]]),Object.prototype.hasOwnProperty.call(t,e)?t[e]=n:t.set(e,n)}function Kt(t,...e){e.forEach(e=>{Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e)).forEach(i=>{if(i in t.prototype)return;const n=Object.getOwnPropertyDescriptor(e,i);n.enumerable=!1,Object.defineProperty(t.prototype,i,n)})})}class Qt{constructor(t){this.editor=t,this.set("isEnabled",!0),this._disableStack=new Set}forceDisabled(t){this._disableStack.add(t),1==this._disableStack.size&&(this.on("set:isEnabled",Jt,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(t){this._disableStack.delete(t),0==this._disableStack.size&&(this.off("set:isEnabled",Jt),this.isEnabled=!0)}destroy(){this.stopListening()}static get isContextPlugin(){return!1}}function Jt(t){t.return=!1,t.stop()}Kt(Qt,Ut);class Zt{constructor(t){this.editor=t,this.set("value",void 0),this.set("isEnabled",!1),this._disableStack=new Set,this.decorate("execute"),this.listenTo(this.editor.model.document,"change",()=>{this.refresh()}),this.on("execute",t=>{this.isEnabled||t.stop()},{priority:"high"}),this.listenTo(t,"change:isReadOnly",(t,e,i)=>{i?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")})}refresh(){this.isEnabled=!0}forceDisabled(t){this._disableStack.add(t),1==this._disableStack.size&&(this.on("set:isEnabled",Xt,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(t){this._disableStack.delete(t),0==this._disableStack.size&&(this.off("set:isEnabled",Xt),this.refresh())}execute(){}destroy(){this.stopListening()}}function Xt(t){t.return=!1,t.stop()}Kt(Zt,Ut);class te extends Zt{constructor(t){super(t),this._childCommands=[]}refresh(){}execute(...t){const e=this._getFirstEnabledCommand();return null!=e&&e.execute(t)}registerChildCommand(t){this._childCommands.push(t),t.on("change:isEnabled",()=>this._checkEnabled()),this._checkEnabled()}_checkEnabled(){this.isEnabled=!!this._getFirstEnabledCommand()}_getFirstEnabledCommand(){return this._childCommands.find(t=>t.isEnabled)}}var ee=function(t,e){return function(i){return t(e(i))}},ie=ee(Object.getPrototypeOf,Object),ne=Function.prototype,oe=Object.prototype,re=ne.toString,se=oe.hasOwnProperty,ae=re.call(Object);var le=function(t){if(!gt(t)||"[object Object]"!=S(t))return!1;var e=ie(t);if(null===e)return!0;var i=se.call(e,"constructor")&&e.constructor;return"function"==typeof i&&i instanceof i&&re.call(i)==ae};var ce=function(){this.__data__=[],this.size=0};var de=function(t,e){for(var i=t.length;i--;)if(Y(t[i][0],e))return i;return-1},he=Array.prototype.splice;var ue=function(t){var e=this.__data__,i=de(e,t);return!(i<0)&&(i==e.length-1?e.pop():he.call(e,i,1),--this.size,!0)};var me=function(t){var e=this.__data__,i=de(e,t);return i<0?void 0:e[i][1]};var ge=function(t){return de(this.__data__,t)>-1};var fe=function(t,e){var i=this.__data__,n=de(i,t);return n<0?(++this.size,i.push([t,e])):i[n][1]=e,this};function pe(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}pe.prototype.clear=ce,pe.prototype.delete=ue,pe.prototype.get=me,pe.prototype.has=ge,pe.prototype.set=fe;var we=pe;var be=function(){this.__data__=new we,this.size=0};var ke=function(t){var e=this.__data__,i=e.delete(t);return this.size=e.size,i};var _e=function(t){return this.__data__.get(t)};var ve=function(t){return this.__data__.has(t)},ye=W(k.a,"Map"),xe=W(Object,"create");var Ae=function(){this.__data__=xe?xe(null):{},this.size=0};var Ce=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Te=Object.prototype.hasOwnProperty;var Ee=function(t){var e=this.__data__;if(xe){var i=e[t];return"__lodash_hash_undefined__"===i?void 0:i}return Te.call(e,t)?e[t]:void 0},Pe=Object.prototype.hasOwnProperty;var Se=function(t){var e=this.__data__;return xe?void 0!==e[t]:Pe.call(e,t)};var Me=function(t,e){var i=this.__data__;return this.size+=this.has(t)?0:1,i[t]=xe&&void 0===e?"__lodash_hash_undefined__":e,this};function Ie(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}Ie.prototype.clear=Ae,Ie.prototype.delete=Ce,Ie.prototype.get=Ee,Ie.prototype.has=Se,Ie.prototype.set=Me;var Le=Ie;var Ne=function(){this.size=0,this.__data__={hash:new Le,map:new(ye||we),string:new Le}};var Re=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var Oe=function(t,e){var i=t.__data__;return Re(e)?i["string"==typeof e?"string":"hash"]:i.map};var ze=function(t){var e=Oe(this,t).delete(t);return this.size-=e?1:0,e};var De=function(t){return Oe(this,t).get(t)};var Ve=function(t){return Oe(this,t).has(t)};var je=function(t,e){var i=Oe(this,t),n=i.size;return i.set(t,e),this.size+=i.size==n?0:1,this};function Be(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}Be.prototype.clear=Ne,Be.prototype.delete=ze,Be.prototype.get=De,Be.prototype.has=Ve,Be.prototype.set=je;var Fe=Be;var He=function(t,e){var i=this.__data__;if(i instanceof we){var n=i.__data__;if(!ye||n.length<199)return n.push([t,e]),this.size=++i.size,this;i=this.__data__=new Fe(n)}return i.set(t,e),this.size=i.size,this};function Ue(t){var e=this.__data__=new we(t);this.size=e.size}Ue.prototype.clear=be,Ue.prototype.delete=ke,Ue.prototype.get=_e,Ue.prototype.has=ve,Ue.prototype.set=He;var qe=Ue;var We=function(t,e){for(var i=-1,n=null==t?0:t.length;++i<n&&!1!==e(t[i],i,t););return t},$e=ee(Object.keys,Object),Ge=Object.prototype.hasOwnProperty;var Ye=function(t){if(!It(t))return $e(t);var e=[];for(var i in Object(t))Ge.call(t,i)&&"constructor"!=i&&e.push(i);return e};var Ke=function(t){return lt(t)?St(t):Ye(t)};var Qe=function(t,e){return t&&J(e,Ke(e),t)};var Je=function(t,e){return t&&J(e,Ot(e),t)},Ze=i(9);var Xe=function(t,e){var i=-1,n=t.length;for(e||(e=Array(n));++i<n;)e[i]=t[i];return e};var ti=function(t,e){for(var i=-1,n=null==t?0:t.length,o=0,r=[];++i<n;){var s=t[i];e(s,i,t)&&(r[o++]=s)}return r};var ei=function(){return[]},ii=Object.prototype.propertyIsEnumerable,ni=Object.getOwnPropertySymbols,oi=ni?function(t){return null==t?[]:(t=Object(t),ti(ni(t),(function(e){return ii.call(t,e)})))}:ei;var ri=function(t,e){return J(t,oi(t),e)};var si=function(t,e){for(var i=-1,n=e.length,o=t.length;++i<n;)t[o+i]=e[i];return t},ai=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)si(e,oi(t)),t=ie(t);return e}:ei;var li=function(t,e){return J(t,ai(t),e)};var ci=function(t,e,i){var n=e(t);return _t(t)?n:si(n,i(t))};var di=function(t){return ci(t,Ke,oi)};var hi=function(t){return ci(t,Ot,ai)},ui=W(k.a,"DataView"),mi=W(k.a,"Promise"),gi=W(k.a,"Set"),fi=W(k.a,"WeakMap"),pi=z(ui),wi=z(ye),bi=z(mi),ki=z(gi),_i=z(fi),vi=S;(ui&&"[object DataView]"!=vi(new ui(new ArrayBuffer(1)))||ye&&"[object Map]"!=vi(new ye)||mi&&"[object Promise]"!=vi(mi.resolve())||gi&&"[object Set]"!=vi(new gi)||fi&&"[object WeakMap]"!=vi(new fi))&&(vi=function(t){var e=S(t),i="[object Object]"==e?t.constructor:void 0,n=i?z(i):"";if(n)switch(n){case pi:return"[object DataView]";case wi:return"[object Map]";case bi:return"[object Promise]";case ki:return"[object Set]";case _i:return"[object WeakMap]"}return e});var yi=vi,xi=Object.prototype.hasOwnProperty;var Ai=function(t){var e=t.length,i=new t.constructor(e);return e&&"string"==typeof t[0]&&xi.call(t,"index")&&(i.index=t.index,i.input=t.input),i},Ci=k.a.Uint8Array;var Ti=function(t){var e=new t.constructor(t.byteLength);return new Ci(e).set(new Ci(t)),e};var Ei=function(t,e){var i=e?Ti(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.byteLength)},Pi=/\w*$/;var Si=function(t){var e=new t.constructor(t.source,Pi.exec(t));return e.lastIndex=t.lastIndex,e},Mi=_?_.prototype:void 0,Ii=Mi?Mi.valueOf:void 0;var Li=function(t){return Ii?Object(Ii.call(t)):{}};var Ni=function(t,e){var i=e?Ti(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.length)};var Ri=function(t,e,i){var n=t.constructor;switch(e){case"[object ArrayBuffer]":return Ti(t);case"[object Boolean]":case"[object Date]":return new n(+t);case"[object DataView]":return Ei(t,i);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 Ni(t,i);case"[object Map]":return new n;case"[object Number]":case"[object String]":return new n(t);case"[object RegExp]":return Si(t);case"[object Set]":return new n;case"[object Symbol]":return Li(t)}},Oi=Object.create,zi=function(){function t(){}return function(e){if(!b(e))return{};if(Oi)return Oi(e);t.prototype=e;var i=new t;return t.prototype=void 0,i}}();var Di=function(t){return"function"!=typeof t.constructor||It(t)?{}:zi(ie(t))};var Vi=function(t){return gt(t)&&"[object Map]"==yi(t)},ji=Ct.a&&Ct.a.isMap,Bi=ji?At(ji):Vi;var Fi=function(t){return gt(t)&&"[object Set]"==yi(t)},Hi=Ct.a&&Ct.a.isSet,Ui=Hi?At(Hi):Fi,qi={};qi["[object Arguments]"]=qi["[object Array]"]=qi["[object ArrayBuffer]"]=qi["[object DataView]"]=qi["[object Boolean]"]=qi["[object Date]"]=qi["[object Float32Array]"]=qi["[object Float64Array]"]=qi["[object Int8Array]"]=qi["[object Int16Array]"]=qi["[object Int32Array]"]=qi["[object Map]"]=qi["[object Number]"]=qi["[object Object]"]=qi["[object RegExp]"]=qi["[object Set]"]=qi["[object String]"]=qi["[object Symbol]"]=qi["[object Uint8Array]"]=qi["[object Uint8ClampedArray]"]=qi["[object Uint16Array]"]=qi["[object Uint32Array]"]=!0,qi["[object Error]"]=qi["[object Function]"]=qi["[object WeakMap]"]=!1;var Wi=function t(e,i,n,o,r,s){var a,l=1&i,c=2&i,d=4&i;if(n&&(a=r?n(e,o,r,s):n(e)),void 0!==a)return a;if(!b(e))return e;var h=_t(e);if(h){if(a=Ai(e),!l)return Xe(e,a)}else{var u=yi(e),m="[object Function]"==u||"[object GeneratorFunction]"==u;if(Object(vt.a)(e))return Object(Ze.a)(e,l);if("[object Object]"==u||"[object Arguments]"==u||m&&!r){if(a=c||m?{}:Di(e),!l)return c?li(e,Je(a,e)):ri(e,Qe(a,e))}else{if(!qi[u])return r?e:{};a=Ri(e,u,l)}}s||(s=new qe);var g=s.get(e);if(g)return g;s.set(e,a),Ui(e)?e.forEach((function(o){a.add(t(o,i,n,o,e,s))})):Bi(e)&&e.forEach((function(o,r){a.set(r,t(o,i,n,r,e,s))}));var f=h?void 0:(d?c?hi:di:c?Ot:Ke)(e);return We(f||e,(function(o,r){f&&(o=e[r=o]),Q(a,r,t(o,i,n,r,e,s))})),a};var $i=function(t,e){return Wi(t,5,e="function"==typeof e?e:void 0)};var Gi=function(t){return gt(t)&&1===t.nodeType&&!le(t)};class Yi{constructor(t,e){this._config={},e&&this.define(Ki(e)),t&&this._setObjectToTarget(this._config,t)}set(t,e){this._setToTarget(this._config,t,e)}define(t,e){this._setToTarget(this._config,t,e,!0)}get(t){return this._getFromSource(this._config,t)}*names(){for(const t of Object.keys(this._config))yield t}_setToTarget(t,e,i,n=!1){if(le(e))return void this._setObjectToTarget(t,e,n);const o=e.split(".");e=o.pop();for(const e of o)le(t[e])||(t[e]={}),t=t[e];if(le(i))return le(t[e])||(t[e]={}),t=t[e],void this._setObjectToTarget(t,i,n);n&&void 0!==t[e]||(t[e]=i)}_getFromSource(t,e){const i=e.split(".");e=i.pop();for(const e of i){if(!le(t[e])){t=null;break}t=t[e]}return t?Ki(t[e]):void 0}_setObjectToTarget(t,e,i){Object.keys(e).forEach(n=>{this._setToTarget(t,n,e[n],i)})}}function Ki(t){return $i(t,Qi)}function Qi(t){return Gi(t)?t:void 0}function Ji(t){return!(!t||!t[Symbol.iterator])}class Zi{constructor(t={},e={}){const i=Ji(t);if(i||(e=t),this._items=[],this._itemMap=new Map,this._idProperty=e.idProperty||"id",this._bindToExternalToInternalMap=new WeakMap,this._bindToInternalToExternalMap=new WeakMap,this._skippedIndexesFromExternal=[],i)for(const e of t)this._items.push(e),this._itemMap.set(this._getItemIdBeforeAdding(e),e)}get length(){return this._items.length}get first(){return this._items[0]||null}get last(){return this._items[this.length-1]||null}add(t,e){return this.addMany([t],e)}addMany(t,e){if(void 0===e)e=this._items.length;else if(e>this._items.length||e<0)throw new l.a("collection-add-item-invalid-index",this);for(let i=0;i<t.length;i++){const n=t[i],o=this._getItemIdBeforeAdding(n),r=e+i;this._items.splice(r,0,n),this._itemMap.set(o,n),this.fire("add",n,r)}return this.fire("change",{added:t,removed:[],index:e}),this}get(t){let e;if("string"==typeof t)e=this._itemMap.get(t);else{if("number"!=typeof t)throw new l.a("collection-get-invalid-arg",this);e=this._items[t]}return e||null}has(t){if("string"==typeof t)return this._itemMap.has(t);{const e=t[this._idProperty];return this._itemMap.has(e)}}getIndex(t){let e;return e="string"==typeof t?this._itemMap.get(t):t,this._items.indexOf(e)}remove(t){const[e,i]=this._remove(t);return this.fire("change",{added:[],removed:[e],index:i}),e}map(t,e){return this._items.map(t,e)}find(t,e){return this._items.find(t,e)}filter(t,e){return this._items.filter(t,e)}clear(){this._bindToCollection&&(this.stopListening(this._bindToCollection),this._bindToCollection=null);const t=Array.from(this._items);for(;this.length;)this._remove(0);this.fire("change",{added:[],removed:t,index:0})}bindTo(t){if(this._bindToCollection)throw new l.a("collection-bind-to-rebind",this);return this._bindToCollection=t,{as:t=>{this._setUpBindToBinding(e=>new t(e))},using:t=>{"function"==typeof t?this._setUpBindToBinding(e=>t(e)):this._setUpBindToBinding(e=>e[t])}}}_setUpBindToBinding(t){const e=this._bindToCollection,i=(i,n,o)=>{const r=e._bindToCollection==this,s=e._bindToInternalToExternalMap.get(n);if(r&&s)this._bindToExternalToInternalMap.set(n,s),this._bindToInternalToExternalMap.set(s,n);else{const i=t(n);if(!i)return void this._skippedIndexesFromExternal.push(o);let r=o;for(const t of this._skippedIndexesFromExternal)o>t&&r--;for(const t of e._skippedIndexesFromExternal)r>=t&&r++;this._bindToExternalToInternalMap.set(n,i),this._bindToInternalToExternalMap.set(i,n),this.add(i,r);for(let t=0;t<e._skippedIndexesFromExternal.length;t++)r<=e._skippedIndexesFromExternal[t]&&e._skippedIndexesFromExternal[t]++}};for(const t of e)i(0,t,e.getIndex(t));this.listenTo(e,"add",i),this.listenTo(e,"remove",(t,e,i)=>{const n=this._bindToExternalToInternalMap.get(e);n&&this.remove(n),this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce((t,e)=>(i<e&&t.push(e-1),i>e&&t.push(e),t),[])})}_getItemIdBeforeAdding(t){const e=this._idProperty;let i;if(e in t){if(i=t[e],"string"!=typeof i)throw new l.a("collection-add-invalid-id",this);if(this.get(i))throw new l.a("collection-add-item-already-exists",this)}else t[e]=i=s();return i}_remove(t){let e,i,n,o=!1;const r=this._idProperty;if("string"==typeof t?(i=t,n=this._itemMap.get(i),o=!n,n&&(e=this._items.indexOf(n))):"number"==typeof t?(e=t,n=this._items[e],o=!n,n&&(i=n[r])):(n=t,i=n[r],e=this._items.indexOf(n),o=-1==e||!this._itemMap.get(i)),o)throw new l.a("collection-remove-404",this);this._items.splice(e,1),this._itemMap.delete(i);const s=this._bindToInternalToExternalMap.get(n);return this._bindToInternalToExternalMap.delete(n),this._bindToExternalToInternalMap.delete(s),this.fire("remove",n,e),[n,e]}[Symbol.iterator](){return this._items[Symbol.iterator]()}}Kt(Zi,h);class Xi{constructor(t,e=[],i=[]){this._context=t,this._plugins=new Map,this._availablePlugins=new Map;for(const t of e)t.pluginName&&this._availablePlugins.set(t.pluginName,t);this._contextPlugins=new Map;for(const[t,e]of i)this._contextPlugins.set(t,e),this._contextPlugins.set(e,t),t.pluginName&&this._availablePlugins.set(t.pluginName,t)}*[Symbol.iterator](){for(const t of this._plugins)"function"==typeof t[0]&&(yield t)}get(t){const e=this._plugins.get(t);if(!e){let e=t;throw"function"==typeof t&&(e=t.pluginName||t.name),new l.a("plugincollection-plugin-not-loaded",this._context,{plugin:e})}return e}has(t){return this._plugins.has(t)}init(t,e=[],i=[]){const n=this,o=this._context;!function t(e,i=new Set){e.forEach(e=>{a(e)&&(i.has(e)||(i.add(e),e.pluginName&&!n._availablePlugins.has(e.pluginName)&&n._availablePlugins.set(e.pluginName,e),e.requires&&t(e.requires,i)))})}(t),u(t);const r=[...function t(e,i=new Set){return e.map(t=>a(t)?t:n._availablePlugins.get(t)).reduce((e,n)=>i.has(n)?e:(i.add(n),n.requires&&(u(n.requires,n),t(n.requires,i).forEach(t=>e.add(t))),e.add(n)),new Set)}(t.filter(t=>!d(t,e)))];!function(t,e){for(const i of e){if("function"!=typeof i)throw new l.a("plugincollection-replace-plugin-invalid-type",null,{pluginItem:i});const e=i.pluginName;if(!e)throw new l.a("plugincollection-replace-plugin-missing-name",null,{pluginItem:i});if(i.requires&&i.requires.length)throw new l.a("plugincollection-plugin-for-replacing-cannot-have-dependencies",null,{pluginName:e});const o=n._availablePlugins.get(e);if(!o)throw new l.a("plugincollection-plugin-for-replacing-not-exist",null,{pluginName:e});const r=t.indexOf(o);if(-1===r){if(n._contextPlugins.has(o))return;throw new l.a("plugincollection-plugin-for-replacing-not-loaded",null,{pluginName:e})}if(o.requires&&o.requires.length)throw new l.a("plugincollection-replaced-plugin-cannot-have-dependencies",null,{pluginName:e});t.splice(r,1,i),n._availablePlugins.set(e,i)}}(r,i);const s=function(t){return t.map(t=>{const e=n._contextPlugins.get(t)||new t(o);return n._add(t,e),e})}(r);return m(s,"init").then(()=>m(s,"afterInit")).then(()=>s);function a(t){return"function"==typeof t}function c(t){return a(t)&&t.isContextPlugin}function d(t,e){return e.some(e=>e===t||(h(t)===e||h(e)===t))}function h(t){return a(t)?t.pluginName||t.name:t}function u(t,i=null){t.map(t=>a(t)?t:n._availablePlugins.get(t)||t).forEach(t=>{!function(t,e){if(a(t))return;if(e)throw new l.a("plugincollection-soft-required",o,{missingPlugin:t,requiredBy:h(e)});throw new l.a("plugincollection-plugin-not-found",o,{plugin:t})}(t,i),function(t,e){if(!c(e))return;if(c(t))return;throw new l.a("plugincollection-context-required",o,{plugin:h(t),requiredBy:h(e)})}(t,i),function(t,i){if(!i)return;if(!d(t,e))return;throw new l.a("plugincollection-required",o,{plugin:h(t),requiredBy:h(i)})}(t,i)})}function m(t,e){return t.reduce((t,i)=>i[e]?n._contextPlugins.has(i)?t:t.then(i[e].bind(i)):t,Promise.resolve())}}destroy(){const t=[];for(const[,e]of this)"function"!=typeof e.destroy||this._contextPlugins.has(e)||t.push(e.destroy());return Promise.all(t)}_add(t,e){this._plugins.set(t,e);const i=t.pluginName;if(i){if(this._plugins.has(i))throw new l.a("plugincollection-plugin-name-conflict",null,{pluginName:i,plugin1:this._plugins.get(i).constructor,plugin2:t});this._plugins.set(i,e)}}}function tn(t){return Array.isArray(t)?t:[t]}function en(t,e,i=1){if("number"!=typeof i)throw new l.a("translation-service-quantity-not-a-number",null,{quantity:i});const n=Object.keys(window.CKEDITOR_TRANSLATIONS).length;1===n&&(t=Object.keys(window.CKEDITOR_TRANSLATIONS)[0]);const o=e.id||e.string;if(0===n||!function(t,e){return!!window.CKEDITOR_TRANSLATIONS[t]&&!!window.CKEDITOR_TRANSLATIONS[t].dictionary[e]}(t,o))return 1!==i?e.plural:e.string;const r=window.CKEDITOR_TRANSLATIONS[t].dictionary,s=window.CKEDITOR_TRANSLATIONS[t].getPluralForm||(t=>1===t?0:1);if("string"==typeof r[o])return r[o];const a=Number(s(i));return r[o][a]}Kt(Xi,h),window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={});const nn=["ar","ara","fa","per","fas","he","heb","ku","kur","ug","uig"];function on(t){return nn.includes(t)?"rtl":"ltr"}class rn{constructor(t={}){this.uiLanguage=t.uiLanguage||"en",this.contentLanguage=t.contentLanguage||this.uiLanguage,this.uiLanguageDirection=on(this.uiLanguage),this.contentLanguageDirection=on(this.contentLanguage),this.t=(t,e)=>this._t(t,e)}get language(){return console.warn("locale-deprecated-language-property: The Locale#language property has been deprecated and will be removed in the near future. Please use #uiLanguage and #contentLanguage properties instead."),this.uiLanguage}_t(t,e=[]){e=tn(e),"string"==typeof t&&(t={string:t});const i=!!t.plural?e[0]:1;return function(t,e){return t.replace(/%(\d+)/g,(t,i)=>i<e.length?e[i]:t)}(en(this.uiLanguage,t,i),e)}}class sn{constructor(t){this.config=new Yi(t,this.constructor.defaultConfig);const e=this.constructor.builtinPlugins;this.config.define("plugins",e),this.plugins=new Xi(this,e);const i=this.config.get("language")||{};this.locale=new rn({uiLanguage:"string"==typeof i?i:i.ui,contentLanguage:this.config.get("language.content")}),this.t=this.locale.t,this.editors=new Zi,this._contextOwner=null}initPlugins(){const t=this.config.get("plugins")||[],e=this.config.get("substitutePlugins")||[];for(const i of t.concat(e)){if("function"!=typeof i)throw new l.a("context-initplugins-constructor-only",null,{Plugin:i});if(!0!==i.isContextPlugin)throw new l.a("context-initplugins-invalid-plugin",null,{Plugin:i})}return this.plugins.init(t,[],e)}destroy(){return Promise.all(Array.from(this.editors,t=>t.destroy())).then(()=>this.plugins.destroy())}_addEditor(t,e){if(this._contextOwner)throw new l.a("context-addeditor-private-context");this.editors.add(t),e&&(this._contextOwner=t)}_removeEditor(t){return this.editors.has(t)&&this.editors.remove(t),this._contextOwner===t?this.destroy():Promise.resolve()}_getEditorConfig(){const t={};for(const e of this.config.names())["plugins","removePlugins","extraPlugins"].includes(e)||(t[e]=this.config.get(e));return t}static create(t){return new Promise(e=>{const i=new this(t);e(i.initPlugins().then(()=>i))})}}class an{constructor(t){this.context=t}destroy(){this.stopListening()}static get isContextPlugin(){return!0}}function ln(t,e){const i=Math.min(t.length,e.length);for(let n=0;n<i;n++)if(t[n]!=e[n])return n;return t.length==e.length?"same":t.length<e.length?"prefix":"extension"}Kt(an,Ut);var cn=function(t){return Wi(t,4)};class dn{constructor(t){this.document=t,this.parent=null}get index(){let t;if(!this.parent)return null;if(-1==(t=this.parent.getChildIndex(this)))throw new l.a("view-node-not-found-in-parent",this);return t}get nextSibling(){const t=this.index;return null!==t&&this.parent.getChild(t+1)||null}get previousSibling(){const t=this.index;return null!==t&&this.parent.getChild(t-1)||null}get root(){let t=this;for(;t.parent;)t=t.parent;return t}isAttached(){return this.root.is("rootElement")}getPath(){const t=[];let e=this;for(;e.parent;)t.unshift(e.index),e=e.parent;return t}getAncestors(t={includeSelf:!1,parentFirst:!1}){const e=[];let i=t.includeSelf?this:this.parent;for(;i;)e[t.parentFirst?"push":"unshift"](i),i=i.parent;return e}getCommonAncestor(t,e={}){const i=this.getAncestors(e),n=t.getAncestors(e);let o=0;for(;i[o]==n[o]&&i[o];)o++;return 0===o?null:i[o-1]}isBefore(t){if(this==t)return!1;if(this.root!==t.root)return!1;const e=this.getPath(),i=t.getPath(),n=ln(e,i);switch(n){case"prefix":return!0;case"extension":return!1;default:return e[n]<i[n]}}isAfter(t){return this!=t&&(this.root===t.root&&!this.isBefore(t))}_remove(){this.parent._removeChildren(this.index)}_fireChange(t,e){this.fire("change:"+t,e),this.parent&&this.parent._fireChange(t,e)}toJSON(){const t=cn(this);return delete t.parent,t}is(t){return"node"===t||"view:node"===t}}Kt(dn,h);class hn extends dn{constructor(t,e){super(t),this._textData=e}is(t){return"$text"===t||"view:$text"===t||"text"===t||"view:text"===t||"node"===t||"view:node"===t}get data(){return this._textData}get _data(){return this.data}set _data(t){this._fireChange("text",this),this._textData=t}isSimilar(t){return t instanceof hn&&(this===t||this.data===t.data)}_clone(){return new hn(this.document,this.data)}}class un{constructor(t,e,i){if(this.textNode=t,e<0||e>t.data.length)throw new l.a("view-textproxy-wrong-offsetintext",this);if(i<0||e+i>t.data.length)throw new l.a("view-textproxy-wrong-length",this);this.data=t.data.substring(e,e+i),this.offsetInText=e}get offsetSize(){return this.data.length}get isPartial(){return this.data.length!==this.textNode.data.length}get parent(){return this.textNode.parent}get root(){return this.textNode.root}get document(){return this.textNode.document}is(t){return"$textProxy"===t||"view:$textProxy"===t||"textProxy"===t||"view:textProxy"===t}getAncestors(t={includeSelf:!1,parentFirst:!1}){const e=[];let i=t.includeSelf?this.textNode:this.parent;for(;null!==i;)e[t.parentFirst?"push":"unshift"](i),i=i.parent;return e}}function mn(t){return Ji(t)?new Map(t):function(t){const e=new Map;for(const i in t)e.set(i,t[i]);return e}(t)}class gn{constructor(...t){this._patterns=[],this.add(...t)}add(...t){for(let e of t)("string"==typeof e||e instanceof RegExp)&&(e={name:e}),e.classes&&("string"==typeof e.classes||e.classes instanceof RegExp)&&(e.classes=[e.classes]),this._patterns.push(e)}match(...t){for(const e of t)for(const t of this._patterns){const i=fn(e,t);if(i)return{element:e,pattern:t,match:i}}return null}matchAll(...t){const e=[];for(const i of t)for(const t of this._patterns){const n=fn(i,t);n&&e.push({element:i,pattern:t,match:n})}return e.length>0?e:null}getElementName(){if(1!==this._patterns.length)return null;const t=this._patterns[0],e=t.name;return"function"==typeof t||!e||e instanceof RegExp?null:e}}function fn(t,e){if("function"==typeof e)return e(t);const i={};return e.name&&(i.name=function(t,e){if(t instanceof RegExp)return t.test(e);return t===e}(e.name,t.name),!i.name)||e.attributes&&(i.attributes=function(t,e){const i=[];for(const n in t){const o=t[n];if(!e.hasAttribute(n))return null;{const t=e.getAttribute(n);if(!0===o)i.push(n);else if(o instanceof RegExp){if(!o.test(t))return null;i.push(n)}else{if(t!==o)return null;i.push(n)}}}return i}(e.attributes,t),!i.attributes)?null:!(e.classes&&(i.classes=function(t,e){const i=[];for(const n of t)if(n instanceof RegExp){const t=e.getClassNames();for(const e of t)n.test(e)&&i.push(e);if(0===i.length)return null}else{if(!e.hasClass(n))return null;i.push(n)}return i}(e.classes,t),!i.classes))&&(!(e.styles&&(i.styles=function(t,e){const i=[];for(const n in t){const o=t[n];if(!e.hasStyle(n))return null;{const t=e.getStyle(n);if(o instanceof RegExp){if(!o.test(t))return null;i.push(n)}else{if(t!==o)return null;i.push(n)}}}return i}(e.styles,t),!i.styles))&&i)}var pn=function(t){return"symbol"==typeof t||gt(t)&&"[object Symbol]"==S(t)},wn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,bn=/^\w*$/;var kn=function(t,e){if(_t(t))return!1;var i=typeof t;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=t&&!pn(t))||(bn.test(t)||!wn.test(t)||null!=e&&t in Object(e))};function _n(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var i=function(){var n=arguments,o=e?e.apply(this,n):n[0],r=i.cache;if(r.has(o))return r.get(o);var s=t.apply(this,n);return i.cache=r.set(o,s)||r,s};return i.cache=new(_n.Cache||Fe),i}_n.Cache=Fe;var vn=_n;var yn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,xn=/\\(\\)?/g,An=function(t){var e=vn(t,(function(t){return 500===i.size&&i.clear(),t})),i=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(yn,(function(t,i,n,o){e.push(n?o.replace(xn,"$1"):i||t)})),e}));var Cn=function(t,e){for(var i=-1,n=null==t?0:t.length,o=Array(n);++i<n;)o[i]=e(t[i],i,t);return o},Tn=_?_.prototype:void 0,En=Tn?Tn.toString:void 0;var Pn=function t(e){if("string"==typeof e)return e;if(_t(e))return Cn(e,t)+"";if(pn(e))return En?En.call(e):"";var i=e+"";return"0"==i&&1/e==-1/0?"-0":i};var Sn=function(t){return null==t?"":Pn(t)};var Mn=function(t,e){return _t(t)?t:kn(t,e)?[t]:An(Sn(t))};var In=function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0};var Ln=function(t){if("string"==typeof t||pn(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e};var Nn=function(t,e){for(var i=0,n=(e=Mn(e,t)).length;null!=t&&i<n;)t=t[Ln(e[i++])];return i&&i==n?t:void 0};var Rn=function(t,e,i){var n=-1,o=t.length;e<0&&(e=-e>o?0:o+e),(i=i>o?o:i)<0&&(i+=o),o=e>i?0:i-e>>>0,e>>>=0;for(var r=Array(o);++n<o;)r[n]=t[n+e];return r};var On=function(t,e){return e.length<2?t:Nn(t,Rn(e,0,-1))};var zn=function(t,e){return e=Mn(e,t),null==(t=On(t,e))||delete t[Ln(In(e))]};var Dn=function(t,e){return null==t||zn(t,e)};var Vn=function(t,e,i){var n=null==t?void 0:Nn(t,e);return void 0===n?i:n};var jn=function(t,e,i){(void 0!==i&&!Y(t[e],i)||void 0===i&&!(e in t))&&G(t,e,i)};var Bn=function(t){return function(e,i,n){for(var o=-1,r=Object(e),s=n(e),a=s.length;a--;){var l=s[t?a:++o];if(!1===i(r[l],l,r))break}return e}}();var Fn=function(t){return gt(t)&&lt(t)};var Hn=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]};var Un=function(t){return J(t,Ot(t))};var qn=function(t,e,i,n,o,r,s){var a=Hn(t,i),l=Hn(e,i),c=s.get(l);if(c)jn(t,i,c);else{var d=r?r(a,l,i+"",t,e,s):void 0,h=void 0===d;if(h){var u=_t(l),m=!u&&Object(vt.a)(l),g=!u&&!m&&Et(l);d=l,u||m||g?_t(a)?d=a:Fn(a)?d=Xe(a):m?(h=!1,d=Object(Ze.a)(l,!0)):g?(h=!1,d=Ni(l,!0)):d=[]:le(l)||kt(l)?(d=a,kt(a)?d=Un(a):b(a)&&!I(a)||(d=Di(l))):h=!1}h&&(s.set(l,d),o(d,l,n,r,s),s.delete(l)),jn(t,i,d)}};var Wn=function t(e,i,n,o,r){e!==i&&Bn(i,(function(s,a){if(r||(r=new qe),b(s))qn(e,i,a,n,t,o,r);else{var l=o?o(Hn(e,a),s,a+"",e,i,r):void 0;void 0===l&&(l=s),jn(e,a,l)}}),Ot)},$n=ut((function(t,e,i){Wn(t,e,i)}));var Gn=function(t,e,i,n){if(!b(t))return t;for(var o=-1,r=(e=Mn(e,t)).length,s=r-1,a=t;null!=a&&++o<r;){var l=Ln(e[o]),c=i;if("__proto__"===l||"constructor"===l||"prototype"===l)return t;if(o!=s){var d=a[l];void 0===(c=n?n(d,l,a):void 0)&&(c=b(d)?d:dt(e[o+1])?[]:{})}Q(a,l,c),a=a[l]}return t};var Yn=function(t,e,i){return null==t?t:Gn(t,e,i)};class Kn{constructor(t){this._styles={},this._styleProcessor=t}get isEmpty(){const t=Object.entries(this._styles);return!Array.from(t).length}get size(){return this.isEmpty?0:this.getStyleNames().length}setTo(t){this.clear();const e=Array.from(function(t){let e=null,i=0,n=0,o=null;const r=new Map;if(""===t)return r;";"!=t.charAt(t.length-1)&&(t+=";");for(let s=0;s<t.length;s++){const a=t.charAt(s);if(null===e)switch(a){case":":o||(o=t.substr(i,s-i),n=s+1);break;case'"':case"'":e=a;break;case";":{const e=t.substr(n,s-n);o&&r.set(o.trim(),e.trim()),o=null,i=s+1;break}}else a===e&&(e=null)}return r}(t).entries());for(const[t,i]of e)this._styleProcessor.toNormalizedForm(t,i,this._styles)}has(t){if(this.isEmpty)return!1;const e=this._styleProcessor.getReducedForm(t,this._styles).find(([e])=>e===t);return Array.isArray(e)}set(t,e){if(b(t))for(const[e,i]of Object.entries(t))this._styleProcessor.toNormalizedForm(e,i,this._styles);else this._styleProcessor.toNormalizedForm(t,e,this._styles)}remove(t){const e=Jn(t);Dn(this._styles,e),delete this._styles[t],this._cleanEmptyObjectsOnPath(e)}getNormalized(t){return this._styleProcessor.getNormalized(t,this._styles)}toString(){return this.isEmpty?"":this._getStylesEntries().map(t=>t.join(":")).sort().join(";")+";"}getAsString(t){if(this.isEmpty)return;if(this._styles[t]&&!b(this._styles[t]))return this._styles[t];const e=this._styleProcessor.getReducedForm(t,this._styles).find(([e])=>e===t);return Array.isArray(e)?e[1]:void 0}getStyleNames(){if(this.isEmpty)return[];return this._getStylesEntries().map(([t])=>t)}clear(){this._styles={}}_getStylesEntries(){const t=[],e=Object.keys(this._styles);for(const i of e)t.push(...this._styleProcessor.getReducedForm(i,this._styles));return t}_cleanEmptyObjectsOnPath(t){const e=t.split(".");if(!(e.length>1))return;const i=e.splice(0,e.length-1).join("."),n=Vn(this._styles,i);if(!n)return;!Array.from(Object.keys(n)).length&&this.remove(i)}}class Qn{constructor(){this._normalizers=new Map,this._extractors=new Map,this._reducers=new Map,this._consumables=new Map}toNormalizedForm(t,e,i){if(b(e))Zn(i,Jn(t),e);else if(this._normalizers.has(t)){const n=this._normalizers.get(t),{path:o,value:r}=n(e);Zn(i,o,r)}else Zn(i,t,e)}getNormalized(t,e){if(!t)return $n({},e);if(void 0!==e[t])return e[t];if(this._extractors.has(t)){const i=this._extractors.get(t);if("string"==typeof i)return Vn(e,i);const n=i(t,e);if(n)return n}return Vn(e,Jn(t))}getReducedForm(t,e){const i=this.getNormalized(t,e);if(void 0===i)return[];if(this._reducers.has(t)){return this._reducers.get(t)(i)}return[[t,i]]}getRelatedStyles(t){return this._consumables.get(t)||[]}setNormalizer(t,e){this._normalizers.set(t,e)}setExtractor(t,e){this._extractors.set(t,e)}setReducer(t,e){this._reducers.set(t,e)}setStyleRelation(t,e){this._mapStyleNames(t,e);for(const i of e)this._mapStyleNames(i,[t])}_mapStyleNames(t,e){this._consumables.has(t)||this._consumables.set(t,[]),this._consumables.get(t).push(...e)}}function Jn(t){return t.replace("-",".")}function Zn(t,e,i){let n=i;b(i)&&(n=$n({},Vn(t,e),i)),Yn(t,e,n)}class Xn extends dn{constructor(t,e,i,n){if(super(t),this.name=e,this._attrs=function(t){t=mn(t);for(const[e,i]of t)null===i?t.delete(e):"string"!=typeof i&&t.set(e,String(i));return t}(i),this._children=[],n&&this._insertChild(0,n),this._classes=new Set,this._attrs.has("class")){const t=this._attrs.get("class");to(this._classes,t),this._attrs.delete("class")}this._styles=new Kn(this.document.stylesProcessor),this._attrs.has("style")&&(this._styles.setTo(this._attrs.get("style")),this._attrs.delete("style")),this._customProperties=new Map,this._isAllowedInsideAttributeElement=!1}get childCount(){return this._children.length}get isEmpty(){return 0===this._children.length}get isAllowedInsideAttributeElement(){return this._isAllowedInsideAttributeElement}is(t,e=null){return e?e===this.name&&("element"===t||"view:element"===t):"element"===t||"view:element"===t||"node"===t||"view:node"===t}getChild(t){return this._children[t]}getChildIndex(t){return this._children.indexOf(t)}getChildren(){return this._children[Symbol.iterator]()}*getAttributeKeys(){this._classes.size>0&&(yield"class"),this._styles.isEmpty||(yield"style"),yield*this._attrs.keys()}*getAttributes(){yield*this._attrs.entries(),this._classes.size>0&&(yield["class",this.getAttribute("class")]),this._styles.isEmpty||(yield["style",this.getAttribute("style")])}getAttribute(t){if("class"==t)return this._classes.size>0?[...this._classes].join(" "):void 0;if("style"==t){const t=this._styles.toString();return""==t?void 0:t}return this._attrs.get(t)}hasAttribute(t){return"class"==t?this._classes.size>0:"style"==t?!this._styles.isEmpty:this._attrs.has(t)}isSimilar(t){if(!(t instanceof Xn))return!1;if(this===t)return!0;if(this.name!=t.name)return!1;if(this.isAllowedInsideAttributeElement!=t.isAllowedInsideAttributeElement)return!1;if(this._attrs.size!==t._attrs.size||this._classes.size!==t._classes.size||this._styles.size!==t._styles.size)return!1;for(const[e,i]of this._attrs)if(!t._attrs.has(e)||t._attrs.get(e)!==i)return!1;for(const e of this._classes)if(!t._classes.has(e))return!1;for(const e of this._styles.getStyleNames())if(!t._styles.has(e)||t._styles.getAsString(e)!==this._styles.getAsString(e))return!1;return!0}hasClass(...t){for(const e of t)if(!this._classes.has(e))return!1;return!0}getClassNames(){return this._classes.keys()}getStyle(t){return this._styles.getAsString(t)}getNormalizedStyle(t){return this._styles.getNormalized(t)}getStyleNames(){return this._styles.getStyleNames()}hasStyle(...t){for(const e of t)if(!this._styles.has(e))return!1;return!0}findAncestor(...t){const e=new gn(...t);let i=this.parent;for(;i;){if(e.match(i))return i;i=i.parent}return null}getCustomProperty(t){return this._customProperties.get(t)}*getCustomProperties(){yield*this._customProperties.entries()}getIdentity(){const t=Array.from(this._classes).sort().join(","),e=this._styles.toString(),i=Array.from(this._attrs).map(t=>`${t[0]}="${t[1]}"`).sort().join(" ");return this.name+(""==t?"":` class="${t}"`)+(e?` style="${e}"`:"")+(""==i?"":" "+i)}_clone(t=!1){const e=[];if(t)for(const i of this.getChildren())e.push(i._clone(t));const i=new this.constructor(this.document,this.name,this._attrs,e);return i._classes=new Set(this._classes),i._styles.set(this._styles.getNormalized()),i._customProperties=new Map(this._customProperties),i.getFillerOffset=this.getFillerOffset,i._isAllowedInsideAttributeElement=this.isAllowedInsideAttributeElement,i}_appendChild(t){return this._insertChild(this.childCount,t)}_insertChild(t,e){this._fireChange("children",this);let i=0;const n=function(t,e){if("string"==typeof e)return[new hn(t,e)];Ji(e)||(e=[e]);return Array.from(e).map(e=>"string"==typeof e?new hn(t,e):e instanceof un?new hn(t,e.data):e)}(this.document,e);for(const e of n)null!==e.parent&&e._remove(),e.parent=this,e.document=this.document,this._children.splice(t,0,e),t++,i++;return i}_removeChildren(t,e=1){this._fireChange("children",this);for(let i=t;i<t+e;i++)this._children[i].parent=null;return this._children.splice(t,e)}_setAttribute(t,e){e=String(e),this._fireChange("attributes",this),"class"==t?to(this._classes,e):"style"==t?this._styles.setTo(e):this._attrs.set(t,e)}_removeAttribute(t){return this._fireChange("attributes",this),"class"==t?this._classes.size>0&&(this._classes.clear(),!0):"style"==t?!this._styles.isEmpty&&(this._styles.clear(),!0):this._attrs.delete(t)}_addClass(t){this._fireChange("attributes",this);for(const e of tn(t))this._classes.add(e)}_removeClass(t){this._fireChange("attributes",this);for(const e of tn(t))this._classes.delete(e)}_setStyle(t,e){this._fireChange("attributes",this),this._styles.set(t,e)}_removeStyle(t){this._fireChange("attributes",this);for(const e of tn(t))this._styles.remove(e)}_setCustomProperty(t,e){this._customProperties.set(t,e)}_removeCustomProperty(t){return this._customProperties.delete(t)}}function to(t,e){const i=e.split(/\s+/);t.clear(),i.forEach(e=>t.add(e))}class eo extends Xn{constructor(t,e,i,n){super(t,e,i,n),this.getFillerOffset=io}is(t,e=null){return e?e===this.name&&("containerElement"===t||"view:containerElement"===t||"element"===t||"view:element"===t):"containerElement"===t||"view:containerElement"===t||"element"===t||"view:element"===t||"node"===t||"view:node"===t}}function io(){const t=[...this.getChildren()],e=t[this.childCount-1];if(e&&e.is("element","br"))return this.childCount;for(const e of t)if(!e.is("uiElement"))return null;return this.childCount}class no extends eo{constructor(t,e,i,n){super(t,e,i,n),this.set("isReadOnly",!1),this.set("isFocused",!1),this.bind("isReadOnly").to(t),this.bind("isFocused").to(t,"isFocused",e=>e&&t.selection.editableElement==this),this.listenTo(t.selection,"change",()=>{this.isFocused=t.isFocused&&t.selection.editableElement==this})}is(t,e=null){return e?e===this.name&&("editableElement"===t||"view:editableElement"===t||"containerElement"===t||"view:containerElement"===t||"element"===t||"view:element"===t):"editableElement"===t||"view:editableElement"===t||"containerElement"===t||"view:containerElement"===t||"element"===t||"view:element"===t||"node"===t||"view:node"===t}destroy(){this.stopListening()}}Kt(no,Ut);const oo=Symbol("rootName");class ro extends no{constructor(t,e){super(t,e),this.rootName="main"}is(t,e=null){return e?e===this.name&&("rootElement"===t||"view:rootElement"===t||"editableElement"===t||"view:editableElement"===t||"containerElement"===t||"view:containerElement"===t||"element"===t||"view:element"===t):"rootElement"===t||"view:rootElement"===t||"editableElement"===t||"view:editableElement"===t||"containerElement"===t||"view:containerElement"===t||"element"===t||"view:element"===t||"node"===t||"view:node"===t}get rootName(){return this.getCustomProperty(oo)}set rootName(t){this._setCustomProperty(oo,t)}set _name(t){this.name=t}}class so{constructor(t={}){if(!t.boundaries&&!t.startPosition)throw new l.a("view-tree-walker-no-start-position",null);if(t.direction&&"forward"!=t.direction&&"backward"!=t.direction)throw new l.a("view-tree-walker-unknown-direction",t.startPosition,{direction:t.direction});this.boundaries=t.boundaries||null,t.startPosition?this.position=ao._createAt(t.startPosition):this.position=ao._createAt(t.boundaries["backward"==t.direction?"end":"start"]),this.direction=t.direction||"forward",this.singleCharacters=!!t.singleCharacters,this.shallow=!!t.shallow,this.ignoreElementEnd=!!t.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null}[Symbol.iterator](){return this}skip(t){let e,i,n;do{n=this.position,({done:e,value:i}=this.next())}while(!e&&t(i));e||(this.position=n)}next(){return"forward"==this.direction?this._next():this._previous()}_next(){let t=this.position.clone();const e=this.position,i=t.parent;if(null===i.parent&&t.offset===i.childCount)return{done:!0};if(i===this._boundaryEndParent&&t.offset==this.boundaries.end.offset)return{done:!0};let n;if(i instanceof hn){if(t.isAtEnd)return this.position=ao._createAfter(i),this._next();n=i.data[t.offset]}else n=i.getChild(t.offset);if(n instanceof Xn)return this.shallow?t.offset++:t=new ao(n,0),this.position=t,this._formatReturnValue("elementStart",n,e,t,1);if(n instanceof hn){if(this.singleCharacters)return t=new ao(n,0),this.position=t,this._next();{let i,o=n.data.length;return n==this._boundaryEndParent?(o=this.boundaries.end.offset,i=new un(n,0,o),t=ao._createAfter(i)):(i=new un(n,0,n.data.length),t.offset++),this.position=t,this._formatReturnValue("text",i,e,t,o)}}if("string"==typeof n){let n;if(this.singleCharacters)n=1;else{n=(i===this._boundaryEndParent?this.boundaries.end.offset:i.data.length)-t.offset}const o=new un(i,t.offset,n);return t.offset+=n,this.position=t,this._formatReturnValue("text",o,e,t,n)}return t=ao._createAfter(i),this.position=t,this.ignoreElementEnd?this._next():this._formatReturnValue("elementEnd",i,e,t)}_previous(){let t=this.position.clone();const e=this.position,i=t.parent;if(null===i.parent&&0===t.offset)return{done:!0};if(i==this._boundaryStartParent&&t.offset==this.boundaries.start.offset)return{done:!0};let n;if(i instanceof hn){if(t.isAtStart)return this.position=ao._createBefore(i),this._previous();n=i.data[t.offset-1]}else n=i.getChild(t.offset-1);if(n instanceof Xn)return this.shallow?(t.offset--,this.position=t,this._formatReturnValue("elementStart",n,e,t,1)):(t=new ao(n,n.childCount),this.position=t,this.ignoreElementEnd?this._previous():this._formatReturnValue("elementEnd",n,e,t));if(n instanceof hn){if(this.singleCharacters)return t=new ao(n,n.data.length),this.position=t,this._previous();{let i,o=n.data.length;if(n==this._boundaryStartParent){const e=this.boundaries.start.offset;i=new un(n,e,n.data.length-e),o=i.data.length,t=ao._createBefore(i)}else i=new un(n,0,n.data.length),t.offset--;return this.position=t,this._formatReturnValue("text",i,e,t,o)}}if("string"==typeof n){let n;if(this.singleCharacters)n=1;else{const e=i===this._boundaryStartParent?this.boundaries.start.offset:0;n=t.offset-e}t.offset-=n;const o=new un(i,t.offset,n);return this.position=t,this._formatReturnValue("text",o,e,t,n)}return t=ao._createBefore(i),this.position=t,this._formatReturnValue("elementStart",i,e,t,1)}_formatReturnValue(t,e,i,n,o){return e instanceof un&&(e.offsetInText+e.data.length==e.textNode.data.length&&("forward"!=this.direction||this.boundaries&&this.boundaries.end.isEqual(this.position)?i=ao._createAfter(e.textNode):(n=ao._createAfter(e.textNode),this.position=n)),0===e.offsetInText&&("backward"!=this.direction||this.boundaries&&this.boundaries.start.isEqual(this.position)?i=ao._createBefore(e.textNode):(n=ao._createBefore(e.textNode),this.position=n))),{done:!1,value:{type:t,item:e,previousPosition:i,nextPosition:n,length:o}}}}class ao{constructor(t,e){this.parent=t,this.offset=e}get nodeAfter(){return this.parent.is("$text")?null:this.parent.getChild(this.offset)||null}get nodeBefore(){return this.parent.is("$text")?null:this.parent.getChild(this.offset-1)||null}get isAtStart(){return 0===this.offset}get isAtEnd(){const t=this.parent.is("$text")?this.parent.data.length:this.parent.childCount;return this.offset===t}get root(){return this.parent.root}get editableElement(){let t=this.parent;for(;!(t instanceof no);){if(!t.parent)return null;t=t.parent}return t}getShiftedBy(t){const e=ao._createAt(this),i=e.offset+t;return e.offset=i<0?0:i,e}getLastMatchingPosition(t,e={}){e.startPosition=this;const i=new so(e);return i.skip(t),i.position}getAncestors(){return this.parent.is("documentFragment")?[this.parent]:this.parent.getAncestors({includeSelf:!0})}getCommonAncestor(t){const e=this.getAncestors(),i=t.getAncestors();let n=0;for(;e[n]==i[n]&&e[n];)n++;return 0===n?null:e[n-1]}is(t){return"position"===t||"view:position"===t}isEqual(t){return this.parent==t.parent&&this.offset==t.offset}isBefore(t){return"before"==this.compareWith(t)}isAfter(t){return"after"==this.compareWith(t)}compareWith(t){if(this.root!==t.root)return"different";if(this.isEqual(t))return"same";const e=this.parent.is("node")?this.parent.getPath():[],i=t.parent.is("node")?t.parent.getPath():[];e.push(this.offset),i.push(t.offset);const n=ln(e,i);switch(n){case"prefix":return"before";case"extension":return"after";default:return e[n]<i[n]?"before":"after"}}getWalker(t={}){return t.startPosition=this,new so(t)}clone(){return new ao(this.parent,this.offset)}static _createAt(t,e){if(t instanceof ao)return new this(t.parent,t.offset);{const i=t;if("end"==e)e=i.is("$text")?i.data.length:i.childCount;else{if("before"==e)return this._createBefore(i);if("after"==e)return this._createAfter(i);if(0!==e&&!e)throw new l.a("view-createpositionat-offset-required",i)}return new ao(i,e)}}static _createAfter(t){if(t.is("$textProxy"))return new ao(t.textNode,t.offsetInText+t.data.length);if(!t.parent)throw new l.a("view-position-after-root",t,{root:t});return new ao(t.parent,t.index+1)}static _createBefore(t){if(t.is("$textProxy"))return new ao(t.textNode,t.offsetInText);if(!t.parent)throw new l.a("view-position-before-root",t,{root:t});return new ao(t.parent,t.index)}}class lo{constructor(t,e=null){this.start=t.clone(),this.end=e?e.clone():t.clone()}*[Symbol.iterator](){yield*new so({boundaries:this,ignoreElementEnd:!0})}get isCollapsed(){return this.start.isEqual(this.end)}get isFlat(){return this.start.parent===this.end.parent}get root(){return this.start.root}getEnlarged(){let t=this.start.getLastMatchingPosition(co,{direction:"backward"}),e=this.end.getLastMatchingPosition(co);return t.parent.is("$text")&&t.isAtStart&&(t=ao._createBefore(t.parent)),e.parent.is("$text")&&e.isAtEnd&&(e=ao._createAfter(e.parent)),new lo(t,e)}getTrimmed(){let t=this.start.getLastMatchingPosition(co);if(t.isAfter(this.end)||t.isEqual(this.end))return new lo(t,t);let e=this.end.getLastMatchingPosition(co,{direction:"backward"});const i=t.nodeAfter,n=e.nodeBefore;return i&&i.is("$text")&&(t=new ao(i,0)),n&&n.is("$text")&&(e=new ao(n,n.data.length)),new lo(t,e)}isEqual(t){return this==t||this.start.isEqual(t.start)&&this.end.isEqual(t.end)}containsPosition(t){return t.isAfter(this.start)&&t.isBefore(this.end)}containsRange(t,e=!1){t.isCollapsed&&(e=!1);const i=this.containsPosition(t.start)||e&&this.start.isEqual(t.start),n=this.containsPosition(t.end)||e&&this.end.isEqual(t.end);return i&&n}getDifference(t){const e=[];return this.isIntersecting(t)?(this.containsPosition(t.start)&&e.push(new lo(this.start,t.start)),this.containsPosition(t.end)&&e.push(new lo(t.end,this.end))):e.push(this.clone()),e}getIntersection(t){if(this.isIntersecting(t)){let e=this.start,i=this.end;return this.containsPosition(t.start)&&(e=t.start),this.containsPosition(t.end)&&(i=t.end),new lo(e,i)}return null}getWalker(t={}){return t.boundaries=this,new so(t)}getCommonAncestor(){return this.start.getCommonAncestor(this.end)}getContainedElement(){if(this.isCollapsed)return null;let t=this.start.nodeAfter,e=this.end.nodeBefore;return this.start.parent.is("$text")&&this.start.isAtEnd&&this.start.parent.nextSibling&&(t=this.start.parent.nextSibling),this.end.parent.is("$text")&&this.end.isAtStart&&this.end.parent.previousSibling&&(e=this.end.parent.previousSibling),t&&t.is("element")&&t===e?t:null}clone(){return new lo(this.start,this.end)}*getItems(t={}){t.boundaries=this,t.ignoreElementEnd=!0;const e=new so(t);for(const t of e)yield t.item}*getPositions(t={}){t.boundaries=this;const e=new so(t);yield e.position;for(const t of e)yield t.nextPosition}is(t){return"range"===t||"view:range"===t}isIntersecting(t){return this.start.isBefore(t.end)&&this.end.isAfter(t.start)}static _createFromParentsAndOffsets(t,e,i,n){return new this(new ao(t,e),new ao(i,n))}static _createFromPositionAndShift(t,e){const i=t,n=t.getShiftedBy(e);return e>0?new this(i,n):new this(n,i)}static _createIn(t){return this._createFromParentsAndOffsets(t,0,t,t.childCount)}static _createOn(t){const e=t.is("$textProxy")?t.offsetSize:1;return this._createFromPositionAndShift(ao._createBefore(t),e)}}function co(t){return!(!t.item.is("attributeElement")&&!t.item.is("uiElement"))}function ho(t){let e=0;for(const i of t)e++;return e}class uo{constructor(t=null,e,i){this._ranges=[],this._lastRangeBackward=!1,this._isFake=!1,this._fakeSelectionLabel="",this.setTo(t,e,i)}get isFake(){return this._isFake}get fakeSelectionLabel(){return this._fakeSelectionLabel}get anchor(){if(!this._ranges.length)return null;const t=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?t.end:t.start).clone()}get focus(){if(!this._ranges.length)return null;const t=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?t.start:t.end).clone()}get isCollapsed(){return 1===this.rangeCount&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}get editableElement(){return this.anchor?this.anchor.editableElement:null}*getRanges(){for(const t of this._ranges)yield t.clone()}getFirstRange(){let t=null;for(const e of this._ranges)t&&!e.start.isBefore(t.start)||(t=e);return t?t.clone():null}getLastRange(){let t=null;for(const e of this._ranges)t&&!e.end.isAfter(t.end)||(t=e);return t?t.clone():null}getFirstPosition(){const t=this.getFirstRange();return t?t.start.clone():null}getLastPosition(){const t=this.getLastRange();return t?t.end.clone():null}isEqual(t){if(this.isFake!=t.isFake)return!1;if(this.isFake&&this.fakeSelectionLabel!=t.fakeSelectionLabel)return!1;if(this.rangeCount!=t.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(t.anchor)||!this.focus.isEqual(t.focus))return!1;for(const e of this._ranges){let i=!1;for(const n of t._ranges)if(e.isEqual(n)){i=!0;break}if(!i)return!1}return!0}isSimilar(t){if(this.isBackward!=t.isBackward)return!1;const e=ho(this.getRanges());if(e!=ho(t.getRanges()))return!1;if(0==e)return!0;for(let e of this.getRanges()){e=e.getTrimmed();let i=!1;for(let n of t.getRanges())if(n=n.getTrimmed(),e.start.isEqual(n.start)&&e.end.isEqual(n.end)){i=!0;break}if(!i)return!1}return!0}getSelectedElement(){return 1!==this.rangeCount?null:this.getFirstRange().getContainedElement()}setTo(t,e,i){if(null===t)this._setRanges([]),this._setFakeOptions(e);else if(t instanceof uo||t instanceof mo)this._setRanges(t.getRanges(),t.isBackward),this._setFakeOptions({fake:t.isFake,label:t.fakeSelectionLabel});else if(t instanceof lo)this._setRanges([t],e&&e.backward),this._setFakeOptions(e);else if(t instanceof ao)this._setRanges([new lo(t)]),this._setFakeOptions(e);else if(t instanceof dn){const n=!!i&&!!i.backward;let o;if(void 0===e)throw new l.a("view-selection-setto-required-second-parameter",this);o="in"==e?lo._createIn(t):"on"==e?lo._createOn(t):new lo(ao._createAt(t,e)),this._setRanges([o],n),this._setFakeOptions(i)}else{if(!Ji(t))throw new l.a("view-selection-setto-not-selectable",this);this._setRanges(t,e&&e.backward),this._setFakeOptions(e)}this.fire("change")}setFocus(t,e){if(null===this.anchor)throw new l.a("view-selection-setfocus-no-ranges",this);const i=ao._createAt(t,e);if("same"==i.compareWith(this.focus))return;const n=this.anchor;this._ranges.pop(),"before"==i.compareWith(n)?this._addRange(new lo(i,n),!0):this._addRange(new lo(n,i)),this.fire("change")}is(t){return"selection"===t||"view:selection"===t}_setRanges(t,e=!1){t=Array.from(t),this._ranges=[];for(const e of t)this._addRange(e);this._lastRangeBackward=!!e}_setFakeOptions(t={}){this._isFake=!!t.fake,this._fakeSelectionLabel=t.fake&&t.label||""}_addRange(t,e=!1){if(!(t instanceof lo))throw new l.a("view-selection-add-range-not-range",this);this._pushRange(t),this._lastRangeBackward=!!e}_pushRange(t){for(const e of this._ranges)if(t.isIntersecting(e))throw new l.a("view-selection-range-intersects",this,{addedRange:t,intersectingRange:e});this._ranges.push(new lo(t.start,t.end))}}Kt(uo,h);class mo{constructor(t=null,e,i){this._selection=new uo,this._selection.delegate("change").to(this),this._selection.setTo(t,e,i)}get isFake(){return this._selection.isFake}get fakeSelectionLabel(){return this._selection.fakeSelectionLabel}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get isCollapsed(){return this._selection.isCollapsed}get rangeCount(){return this._selection.rangeCount}get isBackward(){return this._selection.isBackward}get editableElement(){return this._selection.editableElement}get _ranges(){return this._selection._ranges}*getRanges(){yield*this._selection.getRanges()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getSelectedElement(){return this._selection.getSelectedElement()}isEqual(t){return this._selection.isEqual(t)}isSimilar(t){return this._selection.isSimilar(t)}is(t){return"selection"===t||"documentSelection"==t||"view:selection"==t||"view:documentSelection"==t}_setTo(t,e,i){this._selection.setTo(t,e,i)}_setFocus(t,e){this._selection.setFocus(t,e)}}Kt(mo,h);class go extends o{constructor(t,e,i){super(t,e),this.startRange=i,this._eventPhase="none",this._currentTarget=null}get eventPhase(){return this._eventPhase}get currentTarget(){return this._currentTarget}}const fo=Symbol("bubbling contexts");var po={fire(t,...e){try{const i=t instanceof o?t:new o(this,t),n=_o(this);if(!n.size)return;if(wo(i,"capturing",this),bo(n,"$capture",i,...e))return i.return;const r=i.startRange||this.selection.getFirstRange(),s=r?r.getContainedElement():null,a=!!s&&Boolean(ko(n,s));let l=s||function(t){if(!t)return null;const e=t.start.parent,i=t.end.parent,n=e.getPath(),o=i.getPath();return n.length>o.length?e:i}(r);if(wo(i,"atTarget",l),!a){if(bo(n,"$text",i,...e))return i.return;wo(i,"bubbling",l)}for(;l;){if(l.is("rootElement")){if(bo(n,"$root",i,...e))return i.return}else if(l.is("element")&&bo(n,l.name,i,...e))return i.return;if(bo(n,l,i,...e))return i.return;l=l.parent,wo(i,"bubbling",l)}return wo(i,"bubbling",this),bo(n,"$document",i,...e),i.return}catch(t){l.a.rethrowUnexpectedError(t,this)}},_addEventListener(t,e,i){const n=tn(i.context||"$document"),o=_o(this);for(const r of n){let n=o.get(r);n||(n=Object.create(h),o.set(r,n)),this.listenTo(n,t,e,i)}},_removeEventListener(t,e){const i=_o(this);for(const n of i.values())this.stopListening(n,t,e)}};function wo(t,e,i){t instanceof go&&(t._eventPhase=e,t._currentTarget=i)}function bo(t,e,i,...n){const o="string"==typeof e?t.get(e):ko(t,e);return!!o&&(o.fire(i,...n),i.stop.called)}function ko(t,e){for(const[i,n]of t)if("function"==typeof i&&i(e))return n;return null}function _o(t){return t[fo]||(t[fo]=new Map),t[fo]}class vo{constructor(t){this.selection=new mo,this.roots=new Zi({idProperty:"rootName"}),this.stylesProcessor=t,this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("isComposing",!1),this._postFixers=new Set}getRoot(t="main"){return this.roots.get(t)}registerPostFixer(t){this._postFixers.add(t)}destroy(){this.roots.map(t=>t.destroy()),this.stopListening()}_callPostFixers(t){let e=!1;do{for(const i of this._postFixers)if(e=i(t),e)break}while(e)}}Kt(vo,po),Kt(vo,Ut);class yo extends Xn{constructor(t,e,i,n){super(t,e,i,n),this.getFillerOffset=xo,this._priority=10,this._id=null,this._clonesGroup=null}get priority(){return this._priority}get id(){return this._id}getElementsWithSameId(){if(null===this.id)throw new l.a("attribute-element-get-elements-with-same-id-no-id",this);return new Set(this._clonesGroup)}is(t,e=null){return e?e===this.name&&("attributeElement"===t||"view:attributeElement"===t||"element"===t||"view:element"===t):"attributeElement"===t||"view:attributeElement"===t||"element"===t||"view:element"===t||"node"===t||"view:node"===t}isSimilar(t){return null!==this.id||null!==t.id?this.id===t.id:super.isSimilar(t)&&this.priority==t.priority}_clone(t){const e=super._clone(t);return e._priority=this._priority,e._id=this._id,e}}function xo(){if(Ao(this))return null;let t=this.parent;for(;t&&t.is("attributeElement");){if(Ao(t)>1)return null;t=t.parent}return!t||Ao(t)>1?null:this.childCount}function Ao(t){return Array.from(t.getChildren()).filter(t=>!t.is("uiElement")).length}yo.DEFAULT_PRIORITY=10;class Co extends Xn{constructor(t,e,i,n){super(t,e,i,n),this._isAllowedInsideAttributeElement=!0,this.getFillerOffset=To}is(t,e=null){return e?e===this.name&&("emptyElement"===t||"view:emptyElement"===t||"element"===t||"view:element"===t):"emptyElement"===t||"view:emptyElement"===t||"element"===t||"view:element"===t||"node"===t||"view:node"===t}_insertChild(t,e){if(e&&(e instanceof dn||Array.from(e).length>0))throw new l.a("view-emptyelement-cannot-add",[this,e])}}function To(){return null}const Eo=navigator.userAgent.toLowerCase();var Po={isMac:function(t){return t.indexOf("macintosh")>-1}(Eo),isGecko:function(t){return!!t.match(/gecko\/\d+/)}(Eo),isSafari:function(t){return t.indexOf(" applewebkit/")>-1&&-1===t.indexOf("chrome")}(Eo),isAndroid:function(t){return t.indexOf("android")>-1}(Eo),isBlink:function(t){return t.indexOf("chrome/")>-1&&t.indexOf("edge/")<0}(Eo),features:{isRegExpUnicodePropertySupported:function(){let t=!1;try{t=0==="ć".search(new RegExp("[\\p{L}]","u"))}catch(t){}return t}()}};const So={ctrl:"⌃",cmd:"⌘",alt:"⌥",shift:"⇧"},Mo={ctrl:"Ctrl+",alt:"Alt+",shift:"Shift+"},Io=function(){const t={arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,backspace:8,delete:46,enter:13,space:32,esc:27,tab:9,ctrl:1114112,shift:2228224,alt:4456448,cmd:8912896};for(let e=65;e<=90;e++){const i=String.fromCharCode(e);t[i.toLowerCase()]=e}for(let e=48;e<=57;e++)t[e-48]=e;for(let e=112;e<=123;e++)t["f"+(e-111)]=e;return t}(),Lo=Object.fromEntries(Object.entries(Io).map(([t,e])=>[e,t.charAt(0).toUpperCase()+t.slice(1)]));function No(t){let e;if("string"==typeof t){if(e=Io[t.toLowerCase()],!e)throw new l.a("keyboard-unknown-key",null,{key:t})}else e=t.keyCode+(t.altKey?Io.alt:0)+(t.ctrlKey?Io.ctrl:0)+(t.shiftKey?Io.shift:0)+(t.metaKey?Io.cmd:0);return e}function Ro(t){return"string"==typeof t&&(t=function(t){return t.split("+").map(t=>t.trim())}(t)),t.map(t=>"string"==typeof t?function(t){if(t.endsWith("!"))return No(t.slice(0,-1));const e=No(t);return Po.isMac&&e==Io.ctrl?Io.cmd:e}(t):t).reduce((t,e)=>e+t,0)}function Oo(t){let e=Ro(t);return Object.entries(Po.isMac?So:Mo).reduce((t,[i,n])=>(0!=(e&Io[i])&&(e&=~Io[i],t+=n),t),"")+(e?Lo[e]:"")}function zo(t,e){const i="ltr"===e;switch(t){case Io.arrowleft:return i?"left":"right";case Io.arrowright:return i?"right":"left";case Io.arrowup:return"up";case Io.arrowdown:return"down"}}function Do(t,e){const i=zo(t,e);return"down"===i||"right"===i}class Vo extends Xn{constructor(t,e,i,n){super(t,e,i,n),this._isAllowedInsideAttributeElement=!0,this.getFillerOffset=Bo}is(t,e=null){return e?e===this.name&&("uiElement"===t||"view:uiElement"===t||"element"===t||"view:element"===t):"uiElement"===t||"view:uiElement"===t||"element"===t||"view:element"===t||"node"===t||"view:node"===t}_insertChild(t,e){if(e&&(e instanceof dn||Array.from(e).length>0))throw new l.a("view-uielement-cannot-add",this)}render(t){return this.toDomElement(t)}toDomElement(t){const e=t.createElement(this.name);for(const t of this.getAttributeKeys())e.setAttribute(t,this.getAttribute(t));return e}}function jo(t){t.document.on("arrowKey",(e,i)=>function(t,e,i){if(e.keyCode==Io.arrowright){const t=e.domTarget.ownerDocument.defaultView.getSelection(),n=1==t.rangeCount&&t.getRangeAt(0).collapsed;if(n||e.shiftKey){const e=t.focusNode,o=t.focusOffset,r=i.domPositionToView(e,o);if(null===r)return;let s=!1;const a=r.getLastMatchingPosition(t=>(t.item.is("uiElement")&&(s=!0),!(!t.item.is("uiElement")&&!t.item.is("attributeElement"))));if(s){const e=i.viewPositionToDom(a);n?t.collapse(e.parent,e.offset):t.extend(e.parent,e.offset)}}}}(0,i,t.domConverter),{priority:"low"})}function Bo(){return null}class Fo extends Xn{constructor(t,e,i,n){super(t,e,i,n),this._isAllowedInsideAttributeElement=!0,this.getFillerOffset=Ho}is(t,e=null){return e?e===this.name&&("rawElement"===t||"view:rawElement"===t||"element"===t||"view:element"===t):"rawElement"===t||"view:rawElement"===t||t===this.name||t==="view:"+this.name||"element"===t||"view:element"===t||"node"===t||"view:node"===t}_insertChild(t,e){if(e&&(e instanceof dn||Array.from(e).length>0))throw new l.a("view-rawelement-cannot-add",[this,e])}}function Ho(){return null}class Uo{constructor(t,e){this.document=t,this._children=[],e&&this._insertChild(0,e)}[Symbol.iterator](){return this._children[Symbol.iterator]()}get childCount(){return this._children.length}get isEmpty(){return 0===this.childCount}get root(){return this}get parent(){return null}is(t){return"documentFragment"===t||"view:documentFragment"===t}_appendChild(t){return this._insertChild(this.childCount,t)}getChild(t){return this._children[t]}getChildIndex(t){return this._children.indexOf(t)}getChildren(){return this._children[Symbol.iterator]()}_insertChild(t,e){this._fireChange("children",this);let i=0;const n=function(t,e){if("string"==typeof e)return[new hn(t,e)];Ji(e)||(e=[e]);return Array.from(e).map(e=>"string"==typeof e?new hn(t,e):e instanceof un?new hn(t,e.data):e)}(this.document,e);for(const e of n)null!==e.parent&&e._remove(),e.parent=this,this._children.splice(t,0,e),t++,i++;return i}_removeChildren(t,e=1){this._fireChange("children",this);for(let i=t;i<t+e;i++)this._children[i].parent=null;return this._children.splice(t,e)}_fireChange(t,e){this.fire("change:"+t,e)}}Kt(Uo,h);class qo{constructor(t){this.document=t,this._cloneGroups=new Map}setSelection(t,e,i){this.document.selection._setTo(t,e,i)}setSelectionFocus(t,e){this.document.selection._setFocus(t,e)}createDocumentFragment(t){return new Uo(this.document,t)}createText(t){return new hn(this.document,t)}createAttributeElement(t,e,i={}){const n=new yo(this.document,t,e);return"number"==typeof i.priority&&(n._priority=i.priority),i.id&&(n._id=i.id),n}createContainerElement(t,e,i={}){const n=new eo(this.document,t,e);return void 0!==i.isAllowedInsideAttributeElement&&(n._isAllowedInsideAttributeElement=i.isAllowedInsideAttributeElement),n}createEditableElement(t,e){const i=new no(this.document,t,e);return i._document=this.document,i}createEmptyElement(t,e,i={}){const n=new Co(this.document,t,e);return void 0!==i.isAllowedInsideAttributeElement&&(n._isAllowedInsideAttributeElement=i.isAllowedInsideAttributeElement),n}createUIElement(t,e,i,n={}){const o=new Vo(this.document,t,e);return i&&(o.render=i),void 0!==n.isAllowedInsideAttributeElement&&(o._isAllowedInsideAttributeElement=n.isAllowedInsideAttributeElement),o}createRawElement(t,e,i,n={}){const o=new Fo(this.document,t,e);return o.render=i||(()=>{}),void 0!==n.isAllowedInsideAttributeElement&&(o._isAllowedInsideAttributeElement=n.isAllowedInsideAttributeElement),o}setAttribute(t,e,i){i._setAttribute(t,e)}removeAttribute(t,e){e._removeAttribute(t)}addClass(t,e){e._addClass(t)}removeClass(t,e){e._removeClass(t)}setStyle(t,e,i){le(t)&&void 0===i&&(i=e),i._setStyle(t,e)}removeStyle(t,e){e._removeStyle(t)}setCustomProperty(t,e,i){i._setCustomProperty(t,e)}removeCustomProperty(t,e){return e._removeCustomProperty(t)}breakAttributes(t){return t instanceof ao?this._breakAttributes(t):this._breakAttributesRange(t)}breakContainer(t){const e=t.parent;if(!e.is("containerElement"))throw new l.a("view-writer-break-non-container-element",this.document);if(!e.parent)throw new l.a("view-writer-break-root",this.document);if(t.isAtStart)return ao._createBefore(e);if(!t.isAtEnd){const i=e._clone(!1);this.insert(ao._createAfter(e),i);const n=new lo(t,ao._createAt(e,"end")),o=new ao(i,0);this.move(n,o)}return ao._createAfter(e)}mergeAttributes(t){const e=t.offset,i=t.parent;if(i.is("$text"))return t;if(i.is("attributeElement")&&0===i.childCount){const t=i.parent,e=i.index;return i._remove(),this._removeFromClonedElementsGroup(i),this.mergeAttributes(new ao(t,e))}const n=i.getChild(e-1),o=i.getChild(e);if(!n||!o)return t;if(n.is("$text")&&o.is("$text"))return Ko(n,o);if(n.is("attributeElement")&&o.is("attributeElement")&&n.isSimilar(o)){const t=n.childCount;return n._appendChild(o.getChildren()),o._remove(),this._removeFromClonedElementsGroup(o),this.mergeAttributes(new ao(n,t))}return t}mergeContainers(t){const e=t.nodeBefore,i=t.nodeAfter;if(!(e&&i&&e.is("containerElement")&&i.is("containerElement")))throw new l.a("view-writer-merge-containers-invalid-position",this.document);const n=e.getChild(e.childCount-1),o=n instanceof hn?ao._createAt(n,"end"):ao._createAt(e,"end");return this.move(lo._createIn(i),ao._createAt(e,"end")),this.remove(lo._createOn(i)),o}insert(t,e){(function t(e,i){for(const n of e){if(!Qo.some(t=>n instanceof t))throw new l.a("view-writer-insert-invalid-node-type",i);n.is("$text")||t(n.getChildren(),i)}})(e=Ji(e)?[...e]:[e],this.document);const i=e.reduce((t,e)=>{const i=t[t.length-1],n=!(e.is("uiElement")&&e.isAllowedInsideAttributeElement);return i&&i.breakAttributes==n?i.nodes.push(e):t.push({breakAttributes:n,nodes:[e]}),t},[]);let n=null,o=t;for(const{nodes:t,breakAttributes:e}of i){const i=this._insertNodes(o,t,e);n||(n=i.start),o=i.end}return n?new lo(n,o):new lo(t)}remove(t){const e=t instanceof lo?t:lo._createOn(t);if(Zo(e,this.document),e.isCollapsed)return new Uo(this.document);const{start:i,end:n}=this._breakAttributesRange(e,!0),o=i.parent,r=n.offset-i.offset,s=o._removeChildren(i.offset,r);for(const t of s)this._removeFromClonedElementsGroup(t);const a=this.mergeAttributes(i);return e.start=a,e.end=a.clone(),new Uo(this.document,s)}clear(t,e){Zo(t,this.document);const i=t.getWalker({direction:"backward",ignoreElementEnd:!0});for(const n of i){const i=n.item;let o;if(i.is("element")&&e.isSimilar(i))o=lo._createOn(i);else if(!n.nextPosition.isAfter(t.start)&&i.is("$textProxy")){const t=i.getAncestors().find(t=>t.is("element")&&e.isSimilar(t));t&&(o=lo._createIn(t))}o&&(o.end.isAfter(t.end)&&(o.end=t.end),o.start.isBefore(t.start)&&(o.start=t.start),this.remove(o))}}move(t,e){let i;if(e.isAfter(t.end)){const n=(e=this._breakAttributes(e,!0)).parent,o=n.childCount;t=this._breakAttributesRange(t,!0),i=this.remove(t),e.offset+=n.childCount-o}else i=this.remove(t);return this.insert(e,i)}wrap(t,e){if(!(e instanceof yo))throw new l.a("view-writer-wrap-invalid-attribute",this.document);if(Zo(t,this.document),t.isCollapsed){let n=t.start;n.parent.is("element")&&(i=n.parent,!Array.from(i.getChildren()).some(t=>!t.is("uiElement")))&&(n=n.getLastMatchingPosition(t=>t.item.is("uiElement"))),n=this._wrapPosition(n,e);const o=this.document.selection;return o.isCollapsed&&o.getFirstPosition().isEqual(t.start)&&this.setSelection(n),new lo(n)}return this._wrapRange(t,e);var i}unwrap(t,e){if(!(e instanceof yo))throw new l.a("view-writer-unwrap-invalid-attribute",this.document);if(Zo(t,this.document),t.isCollapsed)return t;const{start:i,end:n}=this._breakAttributesRange(t,!0),o=i.parent,r=this._unwrapChildren(o,i.offset,n.offset,e),s=this.mergeAttributes(r.start);s.isEqual(r.start)||r.end.offset--;const a=this.mergeAttributes(r.end);return new lo(s,a)}rename(t,e){const i=new eo(this.document,t,e.getAttributes());return this.insert(ao._createAfter(e),i),this.move(lo._createIn(e),ao._createAt(i,0)),this.remove(lo._createOn(e)),i}clearClonedElementsGroup(t){this._cloneGroups.delete(t)}createPositionAt(t,e){return ao._createAt(t,e)}createPositionAfter(t){return ao._createAfter(t)}createPositionBefore(t){return ao._createBefore(t)}createRange(t,e){return new lo(t,e)}createRangeOn(t){return lo._createOn(t)}createRangeIn(t){return lo._createIn(t)}createSelection(t,e,i){return new uo(t,e,i)}_insertNodes(t,e,i){let n,o;if(n=i?Wo(t):t.parent.is("$text")?t.parent.parent:t.parent,!n)throw new l.a("view-writer-invalid-position-container",this.document);o=i?this._breakAttributes(t,!0):t.parent.is("$text")?Yo(t):t;const r=n._insertChild(o.offset,e);for(const t of e)this._addToClonedElementsGroup(t);const s=o.getShiftedBy(r),a=this.mergeAttributes(o);a.isEqual(o)||s.offset--;const c=this.mergeAttributes(s);return new lo(a,c)}_wrapChildren(t,e,i,n){let o=e;const r=[];for(;o<i;){const e=t.getChild(o),i=e.is("$text"),s=e.is("attributeElement"),a=e.isAllowedInsideAttributeElement;if(s&&this._wrapAttributeElement(n,e))r.push(new ao(t,o));else if(i||a||s&&$o(n,e)){const i=n._clone();e._remove(),i._appendChild(e),t._insertChild(o,i),this._addToClonedElementsGroup(i),r.push(new ao(t,o))}else s&&this._wrapChildren(e,0,e.childCount,n);o++}let s=0;for(const t of r){if(t.offset-=s,t.offset==e)continue;this.mergeAttributes(t).isEqual(t)||(s++,i--)}return lo._createFromParentsAndOffsets(t,e,t,i)}_unwrapChildren(t,e,i,n){let o=e;const r=[];for(;o<i;){const e=t.getChild(o);if(e.is("attributeElement"))if(e.isSimilar(n)){const n=e.getChildren(),s=e.childCount;e._remove(),t._insertChild(o,n),this._removeFromClonedElementsGroup(e),r.push(new ao(t,o),new ao(t,o+s)),o+=s,i+=s-1}else this._unwrapAttributeElement(n,e)?(r.push(new ao(t,o),new ao(t,o+1)),o++):(this._unwrapChildren(e,0,e.childCount,n),o++);else o++}let s=0;for(const t of r){if(t.offset-=s,t.offset==e||t.offset==i)continue;this.mergeAttributes(t).isEqual(t)||(s++,i--)}return lo._createFromParentsAndOffsets(t,e,t,i)}_wrapRange(t,e){const{start:i,end:n}=this._breakAttributesRange(t,!0),o=i.parent,r=this._wrapChildren(o,i.offset,n.offset,e),s=this.mergeAttributes(r.start);s.isEqual(r.start)||r.end.offset--;const a=this.mergeAttributes(r.end);return new lo(s,a)}_wrapPosition(t,e){if(e.isSimilar(t.parent))return Go(t.clone());t.parent.is("$text")&&(t=Yo(t));const i=this.createAttributeElement();i._priority=Number.POSITIVE_INFINITY,i.isSimilar=()=>!1,t.parent._insertChild(t.offset,i);const n=new lo(t,t.getShiftedBy(1));this.wrap(n,e);const o=new ao(i.parent,i.index);i._remove();const r=o.nodeBefore,s=o.nodeAfter;return r instanceof hn&&s instanceof hn?Ko(r,s):Go(o)}_wrapAttributeElement(t,e){if(!Xo(t,e))return!1;if(t.name!==e.name||t.priority!==e.priority)return!1;for(const i of t.getAttributeKeys())if("class"!==i&&"style"!==i&&e.hasAttribute(i)&&e.getAttribute(i)!==t.getAttribute(i))return!1;for(const i of t.getStyleNames())if(e.hasStyle(i)&&e.getStyle(i)!==t.getStyle(i))return!1;for(const i of t.getAttributeKeys())"class"!==i&&"style"!==i&&(e.hasAttribute(i)||this.setAttribute(i,t.getAttribute(i),e));for(const i of t.getStyleNames())e.hasStyle(i)||this.setStyle(i,t.getStyle(i),e);for(const i of t.getClassNames())e.hasClass(i)||this.addClass(i,e);return!0}_unwrapAttributeElement(t,e){if(!Xo(t,e))return!1;if(t.name!==e.name||t.priority!==e.priority)return!1;for(const i of t.getAttributeKeys())if("class"!==i&&"style"!==i&&(!e.hasAttribute(i)||e.getAttribute(i)!==t.getAttribute(i)))return!1;if(!e.hasClass(...t.getClassNames()))return!1;for(const i of t.getStyleNames())if(!e.hasStyle(i)||e.getStyle(i)!==t.getStyle(i))return!1;for(const i of t.getAttributeKeys())"class"!==i&&"style"!==i&&this.removeAttribute(i,e);return this.removeClass(Array.from(t.getClassNames()),e),this.removeStyle(Array.from(t.getStyleNames()),e),!0}_breakAttributesRange(t,e=!1){const i=t.start,n=t.end;if(Zo(t,this.document),t.isCollapsed){const i=this._breakAttributes(t.start,e);return new lo(i,i)}const o=this._breakAttributes(n,e),r=o.parent.childCount,s=this._breakAttributes(i,e);return o.offset+=o.parent.childCount-r,new lo(s,o)}_breakAttributes(t,e=!1){const i=t.offset,n=t.parent;if(t.parent.is("emptyElement"))throw new l.a("view-writer-cannot-break-empty-element",this.document);if(t.parent.is("uiElement"))throw new l.a("view-writer-cannot-break-ui-element",this.document);if(t.parent.is("rawElement"))throw new l.a("view-writer-cannot-break-raw-element",this.document);if(!e&&n.is("$text")&&Jo(n.parent))return t.clone();if(Jo(n))return t.clone();if(n.is("$text"))return this._breakAttributes(Yo(t),e);if(i==n.childCount){const t=new ao(n.parent,n.index+1);return this._breakAttributes(t,e)}if(0===i){const t=new ao(n.parent,n.index);return this._breakAttributes(t,e)}{const t=n.index+1,o=n._clone();n.parent._insertChild(t,o),this._addToClonedElementsGroup(o);const r=n.childCount-i,s=n._removeChildren(i,r);o._appendChild(s);const a=new ao(n.parent,t);return this._breakAttributes(a,e)}}_addToClonedElementsGroup(t){if(!t.root.is("rootElement"))return;if(t.is("element"))for(const e of t.getChildren())this._addToClonedElementsGroup(e);const e=t.id;if(!e)return;let i=this._cloneGroups.get(e);i||(i=new Set,this._cloneGroups.set(e,i)),i.add(t),t._clonesGroup=i}_removeFromClonedElementsGroup(t){if(t.is("element"))for(const e of t.getChildren())this._removeFromClonedElementsGroup(e);const e=t.id;if(!e)return;const i=this._cloneGroups.get(e);i&&i.delete(t)}}function Wo(t){let e=t.parent;for(;!Jo(e);){if(!e)return;e=e.parent}return e}function $o(t,e){return t.priority<e.priority||!(t.priority>e.priority)&&t.getIdentity()<e.getIdentity()}function Go(t){const e=t.nodeBefore;if(e&&e.is("$text"))return new ao(e,e.data.length);const i=t.nodeAfter;return i&&i.is("$text")?new ao(i,0):t}function Yo(t){if(t.offset==t.parent.data.length)return new ao(t.parent.parent,t.parent.index+1);if(0===t.offset)return new ao(t.parent.parent,t.parent.index);const e=t.parent.data.slice(t.offset);return t.parent._data=t.parent.data.slice(0,t.offset),t.parent.parent._insertChild(t.parent.index+1,new hn(t.root.document,e)),new ao(t.parent.parent,t.parent.index+1)}function Ko(t,e){const i=t.data.length;return t._data+=e.data,e._remove(),new ao(t,i)}const Qo=[hn,yo,eo,Co,Fo,Vo];function Jo(t){return t&&(t.is("containerElement")||t.is("documentFragment"))}function Zo(t,e){const i=Wo(t.start),n=Wo(t.end);if(!i||!n||i!==n)throw new l.a("view-writer-invalid-range-container",e)}function Xo(t,e){return null===t.id&&null===e.id}function tr(t){return"[object Text]"==Object.prototype.toString.call(t)}const er=t=>t.createTextNode(" "),ir=t=>{const e=t.createElement("span");return e.dataset.ckeFiller=!0,e.innerHTML=" ",e},nr=t=>{const e=t.createElement("br");return e.dataset.ckeFiller=!0,e},or="⁠".repeat(7);function rr(t){return tr(t)&&t.data.substr(0,7)===or}function sr(t){return 7==t.data.length&&rr(t)}function ar(t){return rr(t)?t.data.slice(7):t.data}function lr(t,e){if(e.keyCode==Io.arrowleft){const t=e.domTarget.ownerDocument.defaultView.getSelection();if(1==t.rangeCount&&t.getRangeAt(0).collapsed){const e=t.getRangeAt(0).startContainer,i=t.getRangeAt(0).startOffset;rr(e)&&i<=7&&t.collapse(e,0)}}}function cr(t,e,i,n=!1){i=i||function(t,e){return t===e},Array.isArray(t)||(t=Array.prototype.slice.call(t)),Array.isArray(e)||(e=Array.prototype.slice.call(e));const o=function(t,e,i){const n=dr(t,e,i);if(-1===n)return{firstIndex:-1,lastIndexOld:-1,lastIndexNew:-1};const o=hr(t,n),r=hr(e,n),s=dr(o,r,i),a=t.length-s,l=e.length-s;return{firstIndex:n,lastIndexOld:a,lastIndexNew:l}}(t,e,i);return n?function(t,e){const{firstIndex:i,lastIndexOld:n,lastIndexNew:o}=t;if(-1===i)return Array(e).fill("equal");let r=[];i>0&&(r=r.concat(Array(i).fill("equal")));o-i>0&&(r=r.concat(Array(o-i).fill("insert")));n-i>0&&(r=r.concat(Array(n-i).fill("delete")));o<e&&(r=r.concat(Array(e-o).fill("equal")));return r}(o,e.length):function(t,e){const i=[],{firstIndex:n,lastIndexOld:o,lastIndexNew:r}=e;r-n>0&&i.push({index:n,type:"insert",values:t.slice(n,r)});o-n>0&&i.push({index:n+(r-n),type:"delete",howMany:o-n});return i}(e,o)}function dr(t,e,i){for(let n=0;n<Math.max(t.length,e.length);n++)if(void 0===t[n]||void 0===e[n]||!i(t[n],e[n]))return n;return-1}function hr(t,e){return t.slice(e).reverse()}function ur(t,e,i){i=i||function(t,e){return t===e};const n=t.length,o=e.length;if(n>200||o>200||n+o>300)return ur.fastDiff(t,e,i,!0);let r,s;if(o<n){const i=t;t=e,e=i,r="delete",s="insert"}else r="insert",s="delete";const a=t.length,l=e.length,c=l-a,d={},h={};function u(n){const o=(void 0!==h[n-1]?h[n-1]:-1)+1,c=void 0!==h[n+1]?h[n+1]:-1,u=o>c?-1:1;d[n+u]&&(d[n]=d[n+u].slice(0)),d[n]||(d[n]=[]),d[n].push(o>c?r:s);let m=Math.max(o,c),g=m-n;for(;g<a&&m<l&&i(t[g],e[m]);)g++,m++,d[n].push("equal");return m}let m,g=0;do{for(m=-g;m<c;m++)h[m]=u(m);for(m=c+g;m>c;m--)h[m]=u(m);h[c]=u(c),g++}while(h[c]!==l);return d[c].slice(1)}function mr(t,e,i){t.insertBefore(i,t.childNodes[e]||null)}function gr(t){const e=t.parentNode;e&&e.removeChild(t)}function fr(t){if(t){if(t.defaultView)return t instanceof t.defaultView.Document;if(t.ownerDocument&&t.ownerDocument.defaultView)return t instanceof t.ownerDocument.defaultView.Node}return!1}ur.fastDiff=cr;class pr{constructor(t,e){this.domDocuments=new Set,this.domConverter=t,this.markedAttributes=new Set,this.markedChildren=new Set,this.markedTexts=new Set,this.selection=e,this.isFocused=!1,this._inlineFiller=null,this._fakeSelectionContainer=null}markToSync(t,e){if("text"===t)this.domConverter.mapViewToDom(e.parent)&&this.markedTexts.add(e);else{if(!this.domConverter.mapViewToDom(e))return;if("attributes"===t)this.markedAttributes.add(e);else{if("children"!==t)throw new l.a("view-renderer-unknown-type",this);this.markedChildren.add(e)}}}render(){let t;for(const t of this.markedChildren)this._updateChildrenMappings(t);this._inlineFiller&&!this._isSelectionInInlineFiller()&&this._removeInlineFiller(),this._inlineFiller?t=this._getInlineFillerPosition():this._needsInlineFillerAtSelection()&&(t=this.selection.getFirstPosition(),this.markedChildren.add(t.parent));for(const t of this.markedAttributes)this._updateAttrs(t);for(const e of this.markedChildren)this._updateChildren(e,{inlineFillerPosition:t});for(const e of this.markedTexts)!this.markedChildren.has(e.parent)&&this.domConverter.mapViewToDom(e.parent)&&this._updateText(e,{inlineFillerPosition:t});if(t){const e=this.domConverter.viewPositionToDom(t),i=e.parent.ownerDocument;rr(e.parent)?this._inlineFiller=e.parent:this._inlineFiller=wr(i,e.parent,e.offset)}else this._inlineFiller=null;this._updateFocus(),this._updateSelection(),this.markedTexts.clear(),this.markedAttributes.clear(),this.markedChildren.clear()}_updateChildrenMappings(t){const e=this.domConverter.mapViewToDom(t);if(!e)return;const i=Array.from(this.domConverter.mapViewToDom(t).childNodes),n=Array.from(this.domConverter.viewChildrenToDom(t,e.ownerDocument,{withChildren:!1})),o=this._diffNodeLists(i,n),r=this._findReplaceActions(o,i,n);if(-1!==r.indexOf("replace")){const e={equal:0,insert:0,delete:0};for(const o of r)if("replace"===o){const o=e.equal+e.insert,r=e.equal+e.delete,s=t.getChild(o);!s||s.is("uiElement")||s.is("rawElement")||this._updateElementMappings(s,i[r]),gr(n[o]),e.equal++}else e[o]++}}_updateElementMappings(t,e){this.domConverter.unbindDomElement(e),this.domConverter.bindElements(e,t),this.markedChildren.add(t),this.markedAttributes.add(t)}_getInlineFillerPosition(){const t=this.selection.getFirstPosition();return t.parent.is("$text")?ao._createBefore(this.selection.getFirstPosition().parent):t}_isSelectionInInlineFiller(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const t=this.selection.getFirstPosition(),e=this.domConverter.viewPositionToDom(t);return!!(e&&tr(e.parent)&&rr(e.parent))}_removeInlineFiller(){const t=this._inlineFiller;if(!rr(t))throw new l.a("view-renderer-filler-was-lost",this);sr(t)?t.parentNode.removeChild(t):t.data=t.data.substr(7),this._inlineFiller=null}_needsInlineFillerAtSelection(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const t=this.selection.getFirstPosition(),e=t.parent,i=t.offset;if(!this.domConverter.mapViewToDom(e.root))return!1;if(!e.is("element"))return!1;if(!function(t){if("false"==t.getAttribute("contenteditable"))return!1;const e=t.findAncestor(t=>t.hasAttribute("contenteditable"));return!e||"true"==e.getAttribute("contenteditable")}(e))return!1;if(i===e.getFillerOffset())return!1;const n=t.nodeBefore,o=t.nodeAfter;return!(n instanceof hn||o instanceof hn)}_updateText(t,e){const i=this.domConverter.findCorrespondingDomText(t),n=this.domConverter.viewToDom(t,i.ownerDocument),o=i.data;let r=n.data;const s=e.inlineFillerPosition;if(s&&s.parent==t.parent&&s.offset==t.index&&(r=or+r),o!=r){const t=cr(o,r);for(const e of t)"insert"===e.type?i.insertData(e.index,e.values.join("")):i.deleteData(e.index,e.howMany)}}_updateAttrs(t){const e=this.domConverter.mapViewToDom(t);if(!e)return;const i=Array.from(e.attributes).map(t=>t.name),n=t.getAttributeKeys();for(const i of n)e.setAttribute(i,t.getAttribute(i));for(const n of i)t.hasAttribute(n)||e.removeAttribute(n)}_updateChildren(t,e){const i=this.domConverter.mapViewToDom(t);if(!i)return;const n=e.inlineFillerPosition,o=this.domConverter.mapViewToDom(t).childNodes,r=Array.from(this.domConverter.viewChildrenToDom(t,i.ownerDocument,{bind:!0,inlineFillerPosition:n}));n&&n.parent===t&&wr(i.ownerDocument,r,n.offset);const s=this._diffNodeLists(o,r);let a=0;const l=new Set;for(const t of s)"delete"===t?(l.add(o[a]),gr(o[a])):"equal"===t&&a++;a=0;for(const t of s)"insert"===t?(mr(i,a,r[a]),a++):"equal"===t&&(this._markDescendantTextToSync(this.domConverter.domToView(r[a])),a++);for(const t of l)t.parentNode||this.domConverter.unbindDomElement(t)}_diffNodeLists(t,e){return ur(t=function(t,e){const i=Array.from(t);if(0==i.length||!e)return i;i[i.length-1]==e&&i.pop();return i}(t,this._fakeSelectionContainer),e,kr.bind(null,this.domConverter))}_findReplaceActions(t,e,i){if(-1===t.indexOf("insert")||-1===t.indexOf("delete"))return t;let n=[],o=[],r=[];const s={equal:0,insert:0,delete:0};for(const a of t)"insert"===a?r.push(i[s.equal+s.insert]):"delete"===a?o.push(e[s.equal+s.delete]):(n=n.concat(ur(o,r,br).map(t=>"equal"===t?"replace":t)),n.push("equal"),o=[],r=[]),s[a]++;return n.concat(ur(o,r,br).map(t=>"equal"===t?"replace":t))}_markDescendantTextToSync(t){if(t)if(t.is("$text"))this.markedTexts.add(t);else if(t.is("element"))for(const e of t.getChildren())this._markDescendantTextToSync(e)}_updateSelection(){if(0===this.selection.rangeCount)return this._removeDomSelection(),void this._removeFakeSelection();const t=this.domConverter.mapViewToDom(this.selection.editableElement);this.isFocused&&t&&(this.selection.isFake?this._updateFakeSelection(t):(this._removeFakeSelection(),this._updateDomSelection(t)))}_updateFakeSelection(t){const e=t.ownerDocument;this._fakeSelectionContainer||(this._fakeSelectionContainer=function(t){const e=t.createElement("div");return e.className="ck-fake-selection-container",Object.assign(e.style,{position:"fixed",top:0,left:"-9999px",width:"42px"}),e.textContent=" ",e}(e));const i=this._fakeSelectionContainer;if(this.domConverter.bindFakeSelection(i,this.selection),!this._fakeSelectionNeedsUpdate(t))return;i.parentElement&&i.parentElement==t||t.appendChild(i),i.textContent=this.selection.fakeSelectionLabel||" ";const n=e.getSelection(),o=e.createRange();n.removeAllRanges(),o.selectNodeContents(i),n.addRange(o)}_updateDomSelection(t){const e=t.ownerDocument.defaultView.getSelection();if(!this._domSelectionNeedsUpdate(e))return;const i=this.domConverter.viewPositionToDom(this.selection.anchor),n=this.domConverter.viewPositionToDom(this.selection.focus);e.collapse(i.parent,i.offset),e.extend(n.parent,n.offset),Po.isGecko&&function(t,e){const i=t.parent;if(i.nodeType!=Node.ELEMENT_NODE||t.offset!=i.childNodes.length-1)return;const n=i.childNodes[t.offset];n&&"BR"==n.tagName&&e.addRange(e.getRangeAt(0))}(n,e)}_domSelectionNeedsUpdate(t){if(!this.domConverter.isDomSelectionCorrect(t))return!0;const e=t&&this.domConverter.domSelectionToView(t);return(!e||!this.selection.isEqual(e))&&!(!this.selection.isCollapsed&&this.selection.isSimilar(e))}_fakeSelectionNeedsUpdate(t){const e=this._fakeSelectionContainer,i=t.ownerDocument.getSelection();return!e||e.parentElement!==t||(i.anchorNode!==e&&!e.contains(i.anchorNode)||e.textContent!==this.selection.fakeSelectionLabel)}_removeDomSelection(){for(const t of this.domDocuments){if(t.getSelection().rangeCount){const e=t.activeElement,i=this.domConverter.mapDomToView(e);e&&i&&t.getSelection().removeAllRanges()}}}_removeFakeSelection(){const t=this._fakeSelectionContainer;t&&t.remove()}_updateFocus(){if(this.isFocused){const t=this.selection.editableElement;t&&this.domConverter.focus(t)}}}function wr(t,e,i){const n=e instanceof Array?e:e.childNodes,o=n[i];if(tr(o))return o.data=or+o.data,o;{const o=t.createTextNode(or);return Array.isArray(e)?n.splice(i,0,o):mr(e,i,o),o}}function br(t,e){return fr(t)&&fr(e)&&!tr(t)&&!tr(e)&&t.nodeType!==Node.COMMENT_NODE&&e.nodeType!==Node.COMMENT_NODE&&t.tagName.toLowerCase()===e.tagName.toLowerCase()}function kr(t,e,i){return e===i||(tr(e)&&tr(i)?e.data===i.data:!(!t.isBlockFiller(e)||!t.isBlockFiller(i)))}Kt(pr,Ut);var _r={window:window,document:document};function vr(t){let e=0;for(;t.previousSibling;)t=t.previousSibling,e++;return e}function yr(t){const e=[];for(;t&&t.nodeType!=Node.DOCUMENT_NODE;)e.unshift(t),t=t.parentNode;return e}const xr=nr(document),Ar=er(document),Cr=ir(document);class Tr{constructor(t,e={}){this.document=t,this.blockFillerMode=e.blockFillerMode||"br",this.preElements=["pre"],this.blockElements=["p","div","h1","h2","h3","h4","h5","h6","li","dd","dt","figcaption","td","th"],this._domToViewMapping=new WeakMap,this._viewToDomMapping=new WeakMap,this._fakeSelectionMapping=new WeakMap,this._rawContentElementMatcher=new gn,this._encounteredRawContentDomNodes=new WeakSet}bindFakeSelection(t,e){this._fakeSelectionMapping.set(t,new uo(e))}fakeSelectionToView(t){return this._fakeSelectionMapping.get(t)}bindElements(t,e){this._domToViewMapping.set(t,e),this._viewToDomMapping.set(e,t)}unbindDomElement(t){const e=this._domToViewMapping.get(t);if(e){this._domToViewMapping.delete(t),this._viewToDomMapping.delete(e);for(const e of t.childNodes)this.unbindDomElement(e)}}bindDocumentFragments(t,e){this._domToViewMapping.set(t,e),this._viewToDomMapping.set(e,t)}viewToDom(t,e,i={}){if(t.is("$text")){const i=this._processDataFromViewText(t);return e.createTextNode(i)}{if(this.mapViewToDom(t))return this.mapViewToDom(t);let n;if(t.is("documentFragment"))n=e.createDocumentFragment(),i.bind&&this.bindDocumentFragments(n,t);else{if(t.is("uiElement"))return n=t.render(e),i.bind&&this.bindElements(n,t),n;n=t.hasAttribute("xmlns")?e.createElementNS(t.getAttribute("xmlns"),t.name):e.createElement(t.name),t.is("rawElement")&&t.render(n),i.bind&&this.bindElements(n,t);for(const e of t.getAttributeKeys())n.setAttribute(e,t.getAttribute(e))}if(!1!==i.withChildren)for(const o of this.viewChildrenToDom(t,e,i))n.appendChild(o);return n}}*viewChildrenToDom(t,e,i={}){const n=t.getFillerOffset&&t.getFillerOffset();let o=0;for(const r of t.getChildren())n===o&&(yield this._getBlockFiller(e)),yield this.viewToDom(r,e,i),o++;n===o&&(yield this._getBlockFiller(e))}viewRangeToDom(t){const e=this.viewPositionToDom(t.start),i=this.viewPositionToDom(t.end),n=document.createRange();return n.setStart(e.parent,e.offset),n.setEnd(i.parent,i.offset),n}viewPositionToDom(t){const e=t.parent;if(e.is("$text")){const i=this.findCorrespondingDomText(e);if(!i)return null;let n=t.offset;return rr(i)&&(n+=7),{parent:i,offset:n}}{let i,n,o;if(0===t.offset){if(i=this.mapViewToDom(e),!i)return null;o=i.childNodes[0]}else{const e=t.nodeBefore;if(n=e.is("$text")?this.findCorrespondingDomText(e):this.mapViewToDom(t.nodeBefore),!n)return null;i=n.parentNode,o=n.nextSibling}if(tr(o)&&rr(o))return{parent:o,offset:7};return{parent:i,offset:n?vr(n)+1:0}}}domToView(t,e={}){if(this.isBlockFiller(t))return null;const i=this.getHostViewElement(t);if(i)return i;if(tr(t)){if(sr(t))return null;{const e=this._processDataFromDomText(t);return""===e?null:new hn(this.document,e)}}if(this.isComment(t))return null;{if(this.mapDomToView(t))return this.mapDomToView(t);let i;if(this.isDocumentFragment(t))i=new Uo(this.document),e.bind&&this.bindDocumentFragments(t,i);else{const n=e.keepOriginalCase?t.tagName:t.tagName.toLowerCase();i=new Xn(this.document,n),e.bind&&this.bindElements(t,i);const o=t.attributes;for(let t=o.length-1;t>=0;t--)i._setAttribute(o[t].name,o[t].value);if(!1!==e.withChildren&&this._rawContentElementMatcher.match(i))return i._setCustomProperty("$rawContent",t.innerHTML),this._encounteredRawContentDomNodes.add(t),i}if(!1!==e.withChildren)for(const n of this.domChildrenToView(t,e))i._appendChild(n);return i}}*domChildrenToView(t,e={}){for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i],o=this.domToView(n,e);null!==o&&(yield o)}}domSelectionToView(t){if(1===t.rangeCount){let e=t.getRangeAt(0).startContainer;tr(e)&&(e=e.parentNode);const i=this.fakeSelectionToView(e);if(i)return i}const e=this.isDomSelectionBackward(t),i=[];for(let e=0;e<t.rangeCount;e++){const n=t.getRangeAt(e),o=this.domRangeToView(n);o&&i.push(o)}return new uo(i,{backward:e})}domRangeToView(t){const e=this.domPositionToView(t.startContainer,t.startOffset),i=this.domPositionToView(t.endContainer,t.endOffset);return e&&i?new lo(e,i):null}domPositionToView(t,e){if(this.isBlockFiller(t))return this.domPositionToView(t.parentNode,vr(t));const i=this.mapDomToView(t);if(i&&(i.is("uiElement")||i.is("rawElement")))return ao._createBefore(i);if(tr(t)){if(sr(t))return this.domPositionToView(t.parentNode,vr(t));const i=this.findCorrespondingViewText(t);let n=e;return i?(rr(t)&&(n-=7,n=n<0?0:n),new ao(i,n)):null}if(0===e){const e=this.mapDomToView(t);if(e)return new ao(e,0)}else{const i=t.childNodes[e-1],n=tr(i)?this.findCorrespondingViewText(i):this.mapDomToView(i);if(n&&n.parent)return new ao(n.parent,n.index+1)}return null}mapDomToView(t){return this.getHostViewElement(t)||this._domToViewMapping.get(t)}findCorrespondingViewText(t){if(sr(t))return null;const e=this.getHostViewElement(t);if(e)return e;const i=t.previousSibling;if(i){if(!this.isElement(i))return null;const t=this.mapDomToView(i);if(t){return t.nextSibling instanceof hn?t.nextSibling:null}}else{const e=this.mapDomToView(t.parentNode);if(e){const t=e.getChild(0);return t instanceof hn?t:null}}return null}mapViewToDom(t){return this._viewToDomMapping.get(t)}findCorrespondingDomText(t){const e=t.previousSibling;return e&&this.mapViewToDom(e)?this.mapViewToDom(e).nextSibling:!e&&t.parent&&this.mapViewToDom(t.parent)?this.mapViewToDom(t.parent).childNodes[0]:null}focus(t){const e=this.mapViewToDom(t);if(e&&e.ownerDocument.activeElement!==e){const{scrollX:t,scrollY:i}=_r.window,n=[];Pr(e,t=>{const{scrollLeft:e,scrollTop:i}=t;n.push([e,i])}),e.focus(),Pr(e,t=>{const[e,i]=n.shift();t.scrollLeft=e,t.scrollTop=i}),_r.window.scrollTo(t,i)}}isElement(t){return t&&t.nodeType==Node.ELEMENT_NODE}isDocumentFragment(t){return t&&t.nodeType==Node.DOCUMENT_FRAGMENT_NODE}isComment(t){return t&&t.nodeType==Node.COMMENT_NODE}isBlockFiller(t){return"br"==this.blockFillerMode?t.isEqualNode(xr):!("BR"!==t.tagName||!Sr(t,this.blockElements)||1!==t.parentNode.childNodes.length)||(t.isEqualNode(Cr)||function(t,e){return t.isEqualNode(Ar)&&Sr(t,e)&&1===t.parentNode.childNodes.length}(t,this.blockElements))}isDomSelectionBackward(t){if(t.isCollapsed)return!1;const e=document.createRange();e.setStart(t.anchorNode,t.anchorOffset),e.setEnd(t.focusNode,t.focusOffset);const i=e.collapsed;return e.detach(),i}getHostViewElement(t){const e=yr(t);for(e.pop();e.length;){const t=e.pop(),i=this._domToViewMapping.get(t);if(i&&(i.is("uiElement")||i.is("rawElement")))return i}return null}isDomSelectionCorrect(t){return this._isDomSelectionPositionCorrect(t.anchorNode,t.anchorOffset)&&this._isDomSelectionPositionCorrect(t.focusNode,t.focusOffset)}registerRawContentMatcher(t){this._rawContentElementMatcher.add(t)}_getBlockFiller(t){switch(this.blockFillerMode){case"nbsp":return er(t);case"markedNbsp":return ir(t);case"br":return nr(t)}}_isDomSelectionPositionCorrect(t,e){if(tr(t)&&rr(t)&&e<7)return!1;if(this.isElement(t)&&rr(t.childNodes[e]))return!1;const i=this.mapDomToView(t);return!i||!i.is("uiElement")&&!i.is("rawElement")}_processDataFromViewText(t){let e=t.data;if(t.getAncestors().some(t=>this.preElements.includes(t.name)))return e;if(" "==e.charAt(0)){const i=this._getTouchingViewTextNode(t,!1);!(i&&this._nodeEndsWithSpace(i))&&i||(e=" "+e.substr(1))}if(" "==e.charAt(e.length-1)){const i=this._getTouchingViewTextNode(t,!0);" "!=e.charAt(e.length-2)&&i&&" "!=i.data.charAt(0)||(e=e.substr(0,e.length-1)+" ")}return e.replace(/ {2}/g,"  ")}_nodeEndsWithSpace(t){if(t.getAncestors().some(t=>this.preElements.includes(t.name)))return!1;const e=this._processDataFromViewText(t);return" "==e.charAt(e.length-1)}_processDataFromDomText(t){let e=t.data;if(Er(t,this.preElements))return ar(t);e=e.replace(/[ \n\t\r]{1,}/g," ");const i=this._getTouchingInlineDomNode(t,!1),n=this._getTouchingInlineDomNode(t,!0),o=this._checkShouldLeftTrimDomText(t,i),r=this._checkShouldRightTrimDomText(t,n);return o&&(e=e.replace(/^ /,"")),r&&(e=e.replace(/ $/,"")),e=ar(new Text(e)),e=e.replace(/ \u00A0/g," "),(/( |\u00A0)\u00A0$/.test(e)||!n||n.data&&" "==n.data.charAt(0))&&(e=e.replace(/\u00A0$/," ")),o&&(e=e.replace(/^\u00A0/," ")),e}_checkShouldLeftTrimDomText(t,e){return!e||(!!Gi(e)||!this._encounteredRawContentDomNodes.has(t.previousSibling)&&/[^\S\u00A0]/.test(e.data.charAt(e.data.length-1)))}_checkShouldRightTrimDomText(t,e){return!e&&!rr(t)}_getTouchingViewTextNode(t,e){const i=new so({startPosition:e?ao._createAfter(t):ao._createBefore(t),direction:e?"forward":"backward"});for(const t of i){if(t.item.is("containerElement"))return null;if(t.item.is("element","br"))return null;if(t.item.is("$textProxy"))return t.item}return null}_getTouchingInlineDomNode(t,e){if(!t.parentNode)return null;const i=e?"nextNode":"previousNode",n=t.ownerDocument,o=yr(t)[0],r=n.createTreeWalker(o,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,{acceptNode:t=>tr(t)||"BR"==t.tagName?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});r.currentNode=t;const s=r[i]();if(null!==s){const e=function(t,e){const i=yr(t),n=yr(e);let o=0;for(;i[o]==n[o]&&i[o];)o++;return 0===o?null:i[o-1]}(t,s);if(e&&!Er(t,this.blockElements,e)&&!Er(s,this.blockElements,e))return s}return null}}function Er(t,e,i){let n=yr(t);return i&&(n=n.slice(n.indexOf(i)+1)),n.some(t=>t.tagName&&e.includes(t.tagName.toLowerCase()))}function Pr(t,e){for(;t&&t!=_r.document;)e(t),t=t.parentNode}function Sr(t,e){const i=t.parentNode;return i&&i.tagName&&e.includes(i.tagName.toLowerCase())}function Mr(t){const e=Object.prototype.toString.apply(t);return"[object Window]"==e||"[object global]"==e}var Ir=zt({},h,{listenTo(t,...e){if(fr(t)||Mr(t)){const i=this._getProxyEmitter(t)||new Lr(t);i.attach(...e),t=i}h.listenTo.call(this,t,...e)},stopListening(t,e,i){if(fr(t)||Mr(t)){const e=this._getProxyEmitter(t);if(!e)return;t=e}h.stopListening.call(this,t,e,i),t instanceof Lr&&t.detach(e)},_getProxyEmitter(t){return e=this,i=Nr(t),e[c]&&e[c][i]?e[c][i].emitter:null;var e,i}});class Lr{constructor(t){u(this,Nr(t)),this._domNode=t}}function Nr(t){return t["data-ck-expando"]||(t["data-ck-expando"]=s())}zt(Lr.prototype,h,{attach(t,e,i={}){if(this._domListeners&&this._domListeners[t])return;const n={capture:!!i.useCapture,passive:!!i.usePassive},o=this._createDomListener(t,n);this._domNode.addEventListener(t,o,n),this._domListeners||(this._domListeners={}),this._domListeners[t]=o},detach(t){let e;!this._domListeners[t]||(e=this._events[t])&&e.callbacks.length||this._domListeners[t].removeListener()},_createDomListener(t,e){const i=e=>{this.fire(t,e)};return i.removeListener=()=>{this._domNode.removeEventListener(t,i,e),delete this._domListeners[t]},i}});class Rr{constructor(t){this.view=t,this.document=t.document,this.isEnabled=!1}enable(){this.isEnabled=!0}disable(){this.isEnabled=!1}destroy(){this.disable(),this.stopListening()}checkShouldIgnoreEventFromTarget(t){return t&&3===t.nodeType&&(t=t.parentNode),!(!t||1!==t.nodeType)&&t.matches("[data-cke-ignore-events], [data-cke-ignore-events] *")}}Kt(Rr,Ir);var Or=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this};var zr=function(t){return this.__data__.has(t)};function Dr(t){var e=-1,i=null==t?0:t.length;for(this.__data__=new Fe;++e<i;)this.add(t[e])}Dr.prototype.add=Dr.prototype.push=Or,Dr.prototype.has=zr;var Vr=Dr;var jr=function(t,e){for(var i=-1,n=null==t?0:t.length;++i<n;)if(e(t[i],i,t))return!0;return!1};var Br=function(t,e){return t.has(e)};var Fr=function(t,e,i,n,o,r){var s=1&i,a=t.length,l=e.length;if(a!=l&&!(s&&l>a))return!1;var c=r.get(t),d=r.get(e);if(c&&d)return c==e&&d==t;var h=-1,u=!0,m=2&i?new Vr:void 0;for(r.set(t,e),r.set(e,t);++h<a;){var g=t[h],f=e[h];if(n)var p=s?n(f,g,h,e,t,r):n(g,f,h,t,e,r);if(void 0!==p){if(p)continue;u=!1;break}if(m){if(!jr(e,(function(t,e){if(!Br(m,e)&&(g===t||o(g,t,i,n,r)))return m.push(e)}))){u=!1;break}}else if(g!==f&&!o(g,f,i,n,r)){u=!1;break}}return r.delete(t),r.delete(e),u};var Hr=function(t){var e=-1,i=Array(t.size);return t.forEach((function(t,n){i[++e]=[n,t]})),i};var Ur=function(t){var e=-1,i=Array(t.size);return t.forEach((function(t){i[++e]=t})),i},qr=_?_.prototype:void 0,Wr=qr?qr.valueOf:void 0;var $r=function(t,e,i,n,o,r,s){switch(i){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!r(new Ci(t),new Ci(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Y(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var a=Hr;case"[object Set]":var l=1&n;if(a||(a=Ur),t.size!=e.size&&!l)return!1;var c=s.get(t);if(c)return c==e;n|=2,s.set(t,e);var d=Fr(a(t),a(e),n,o,r,s);return s.delete(t),d;case"[object Symbol]":if(Wr)return Wr.call(t)==Wr.call(e)}return!1},Gr=Object.prototype.hasOwnProperty;var Yr=function(t,e,i,n,o,r){var s=1&i,a=di(t),l=a.length;if(l!=di(e).length&&!s)return!1;for(var c=l;c--;){var d=a[c];if(!(s?d in e:Gr.call(e,d)))return!1}var h=r.get(t),u=r.get(e);if(h&&u)return h==e&&u==t;var m=!0;r.set(t,e),r.set(e,t);for(var g=s;++c<l;){var f=t[d=a[c]],p=e[d];if(n)var w=s?n(p,f,d,e,t,r):n(f,p,d,t,e,r);if(!(void 0===w?f===p||o(f,p,i,n,r):w)){m=!1;break}g||(g="constructor"==d)}if(m&&!g){var b=t.constructor,k=e.constructor;b==k||!("constructor"in t)||!("constructor"in e)||"function"==typeof b&&b instanceof b&&"function"==typeof k&&k instanceof k||(m=!1)}return r.delete(t),r.delete(e),m},Kr=Object.prototype.hasOwnProperty;var Qr=function(t,e,i,n,o,r){var s=_t(t),a=_t(e),l=s?"[object Array]":yi(t),c=a?"[object Array]":yi(e),d="[object Object]"==(l="[object Arguments]"==l?"[object Object]":l),h="[object Object]"==(c="[object Arguments]"==c?"[object Object]":c),u=l==c;if(u&&Object(vt.a)(t)){if(!Object(vt.a)(e))return!1;s=!0,d=!1}if(u&&!d)return r||(r=new qe),s||Et(t)?Fr(t,e,i,n,o,r):$r(t,e,l,i,n,o,r);if(!(1&i)){var m=d&&Kr.call(t,"__wrapped__"),g=h&&Kr.call(e,"__wrapped__");if(m||g){var f=m?t.value():t,p=g?e.value():e;return r||(r=new qe),o(f,p,i,n,r)}}return!!u&&(r||(r=new qe),Yr(t,e,i,n,o,r))};var Jr=function t(e,i,n,o,r){return e===i||(null==e||null==i||!gt(e)&&!gt(i)?e!=e&&i!=i:Qr(e,i,n,o,t,r))};var Zr=function(t,e,i){var n=(i="function"==typeof i?i:void 0)?i(t,e):void 0;return void 0===n?Jr(t,e,void 0,i):!!n};class Xr extends Rr{constructor(t){super(t),this._config={childList:!0,characterData:!0,characterDataOldValue:!0,subtree:!0},this.domConverter=t.domConverter,this.renderer=t._renderer,this._domElements=[],this._mutationObserver=new window.MutationObserver(this._onMutations.bind(this))}flush(){this._onMutations(this._mutationObserver.takeRecords())}observe(t){this._domElements.push(t),this.isEnabled&&this._mutationObserver.observe(t,this._config)}enable(){super.enable();for(const t of this._domElements)this._mutationObserver.observe(t,this._config)}disable(){super.disable(),this._mutationObserver.disconnect()}destroy(){super.destroy(),this._mutationObserver.disconnect()}_onMutations(t){if(0===t.length)return;const e=this.domConverter,i=new Map,n=new Set;for(const i of t)if("childList"===i.type){const t=e.mapDomToView(i.target);if(t&&(t.is("uiElement")||t.is("rawElement")))continue;t&&!this._isBogusBrMutation(i)&&n.add(t)}for(const o of t){const t=e.mapDomToView(o.target);if((!t||!t.is("uiElement")&&!t.is("rawElement"))&&"characterData"===o.type){const t=e.findCorrespondingViewText(o.target);t&&!n.has(t.parent)?i.set(t,{type:"text",oldText:t.data,newText:ar(o.target),node:t}):!t&&rr(o.target)&&n.add(e.mapDomToView(o.target.parentNode))}}const o=[];for(const t of i.values())this.renderer.markToSync("text",t.node),o.push(t);for(const t of n){const i=e.mapViewToDom(t),n=Array.from(t.getChildren()),r=Array.from(e.domChildrenToView(i,{withChildren:!1}));Zr(n,r,a)||(this.renderer.markToSync("children",t),o.push({type:"children",oldChildren:n,newChildren:r,node:t}))}const r=t[0].target.ownerDocument.getSelection();let s=null;if(r&&r.anchorNode){const t=e.domPositionToView(r.anchorNode,r.anchorOffset),i=e.domPositionToView(r.focusNode,r.focusOffset);t&&i&&(s=new uo(t),s.setFocus(i))}function a(t,e){if(!Array.isArray(t))return t===e||!(!t.is("$text")||!e.is("$text"))&&t.data===e.data}o.length&&(this.document.fire("mutations",o,s),this.view.forceRender())}_isBogusBrMutation(t){let e=null;return null===t.nextSibling&&0===t.removedNodes.length&&1==t.addedNodes.length&&(e=this.domConverter.domToView(t.addedNodes[0],{withChildren:!1})),e&&e.is("element","br")}}class ts{constructor(t,e,i){this.view=t,this.document=t.document,this.domEvent=e,this.domTarget=e.target,zt(this,i)}get target(){return this.view.domConverter.mapDomToView(this.domTarget)}preventDefault(){this.domEvent.preventDefault()}stopPropagation(){this.domEvent.stopPropagation()}}class es extends Rr{constructor(t){super(t),this.useCapture=!1}observe(t){("string"==typeof this.domEventType?[this.domEventType]:this.domEventType).forEach(e=>{this.listenTo(t,e,(t,e)=>{this.isEnabled&&!this.checkShouldIgnoreEventFromTarget(e.target)&&this.onDomEvent(e)},{useCapture:this.useCapture})})}fire(t,e,i){this.isEnabled&&this.document.fire(t,new ts(this.view,e,i))}}class is extends es{constructor(t){super(t),this.domEventType=["keydown","keyup"]}onDomEvent(t){this.fire(t.type,t,{keyCode:t.keyCode,altKey:t.altKey,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,metaKey:t.metaKey,get keystroke(){return No(this)}})}}var ns=function(){return k.a.Date.now()},os=/\s/;var rs=function(t){for(var e=t.length;e--&&os.test(t.charAt(e)););return e},ss=/^\s+/;var as=function(t){return t?t.slice(0,rs(t)+1).replace(ss,""):t},ls=/^[-+]0x[0-9a-f]+$/i,cs=/^0b[01]+$/i,ds=/^0o[0-7]+$/i,hs=parseInt;var us=function(t){if("number"==typeof t)return t;if(pn(t))return NaN;if(b(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=b(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=as(t);var i=cs.test(t);return i||ds.test(t)?hs(t.slice(2),i?2:8):ls.test(t)?NaN:+t},ms=Math.max,gs=Math.min;var fs=function(t,e,i){var n,o,r,s,a,l,c=0,d=!1,h=!1,u=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function m(e){var i=n,r=o;return n=o=void 0,c=e,s=t.apply(r,i)}function g(t){return c=t,a=setTimeout(p,e),d?m(t):s}function f(t){var i=t-l;return void 0===l||i>=e||i<0||h&&t-c>=r}function p(){var t=ns();if(f(t))return w(t);a=setTimeout(p,function(t){var i=e-(t-l);return h?gs(i,r-(t-c)):i}(t))}function w(t){return a=void 0,u&&n?m(t):(n=o=void 0,s)}function k(){var t=ns(),i=f(t);if(n=arguments,o=this,l=t,i){if(void 0===a)return g(l);if(h)return clearTimeout(a),a=setTimeout(p,e),m(l)}return void 0===a&&(a=setTimeout(p,e)),s}return e=us(e)||0,b(i)&&(d=!!i.leading,r=(h="maxWait"in i)?ms(us(i.maxWait)||0,e):r,u="trailing"in i?!!i.trailing:u),k.cancel=function(){void 0!==a&&clearTimeout(a),c=0,n=l=o=a=void 0},k.flush=function(){return void 0===a?s:w(ns())},k};class ps extends Rr{constructor(t){super(t),this._fireSelectionChangeDoneDebounced=fs(t=>this.document.fire("selectionChangeDone",t),200)}observe(){const t=this.document;t.on("arrowKey",(e,i)=>{t.selection.isFake&&this.isEnabled&&i.preventDefault()},{context:"$capture"}),t.on("arrowKey",(e,i)=>{t.selection.isFake&&this.isEnabled&&this._handleSelectionMove(i.keyCode)},{priority:"lowest"})}destroy(){super.destroy(),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionMove(t){const e=this.document.selection,i=new uo(e.getRanges(),{backward:e.isBackward,fake:!1});t!=Io.arrowleft&&t!=Io.arrowup||i.setTo(i.getFirstPosition()),t!=Io.arrowright&&t!=Io.arrowdown||i.setTo(i.getLastPosition());const n={oldSelection:e,newSelection:i,domSelection:null};this.document.fire("selectionChange",n),this._fireSelectionChangeDoneDebounced(n)}}class ws extends Rr{constructor(t){super(t),this.mutationObserver=t.getObserver(Xr),this.selection=this.document.selection,this.domConverter=t.domConverter,this._documents=new WeakSet,this._fireSelectionChangeDoneDebounced=fs(t=>this.document.fire("selectionChangeDone",t),200),this._clearInfiniteLoopInterval=setInterval(()=>this._clearInfiniteLoop(),1e3),this._loopbackCounter=0}observe(t){const e=t.ownerDocument;this._documents.has(e)||(this.listenTo(e,"selectionchange",(t,i)=>{this._handleSelectionChange(i,e)}),this._documents.add(e))}destroy(){super.destroy(),clearInterval(this._clearInfiniteLoopInterval),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionChange(t,e){if(!this.isEnabled)return;const i=e.defaultView.getSelection();if(this.checkShouldIgnoreEventFromTarget(i.anchorNode))return;this.mutationObserver.flush();const n=this.domConverter.domSelectionToView(i);if(0!=n.rangeCount){if(this.view.hasDomSelection=!0,!(this.selection.isEqual(n)&&this.domConverter.isDomSelectionCorrect(i)||++this._loopbackCounter>60))if(this.selection.isSimilar(n))this.view.forceRender();else{const t={oldSelection:this.selection,newSelection:n,domSelection:i};this.document.fire("selectionChange",t),this._fireSelectionChangeDoneDebounced(t)}}else this.view.hasDomSelection=!1}_clearInfiniteLoop(){this._loopbackCounter=0}}class bs extends es{constructor(t){super(t),this.domEventType=["focus","blur"],this.useCapture=!0;const e=this.document;e.on("focus",()=>{e.isFocused=!0,this._renderTimeoutId=setTimeout(()=>t.forceRender(),50)}),e.on("blur",(i,n)=>{const o=e.selection.editableElement;null!==o&&o!==n.target||(e.isFocused=!1,t.forceRender())})}onDomEvent(t){this.fire(t.type,t)}destroy(){this._renderTimeoutId&&clearTimeout(this._renderTimeoutId),super.destroy()}}class ks extends es{constructor(t){super(t),this.domEventType=["compositionstart","compositionupdate","compositionend"];const e=this.document;e.on("compositionstart",()=>{e.isComposing=!0}),e.on("compositionend",()=>{e.isComposing=!1})}onDomEvent(t){this.fire(t.type,t)}}class _s extends es{constructor(t){super(t),this.domEventType=["beforeinput"]}onDomEvent(t){this.fire(t.type,t)}}class vs{constructor(){this._replacedElements=[]}replace(t,e){this._replacedElements.push({element:t,newElement:e}),t.style.display="none",e&&t.parentNode.insertBefore(e,t.nextSibling)}restore(){this._replacedElements.forEach(({element:t,newElement:e})=>{t.style.display="",e&&e.remove()}),this._replacedElements=[]}}var ys=function(t){return"string"==typeof t||!_t(t)&&gt(t)&&"[object String]"==S(t)};function xs(t,e,i={},n=[]){const o=i&&i.xmlns,r=o?t.createElementNS(o,e):t.createElement(e);for(const t in i)r.setAttribute(t,i[t]);!ys(n)&&Ji(n)||(n=[n]);for(let e of n)ys(e)&&(e=t.createTextNode(e)),r.appendChild(e);return r}function As(t){return t instanceof HTMLTextAreaElement?t.value:t.innerHTML}function Cs(t){return"[object Range]"==Object.prototype.toString.apply(t)}function Ts(t){const e=t.ownerDocument.defaultView.getComputedStyle(t);return{top:parseInt(e.borderTopWidth,10),right:parseInt(e.borderRightWidth,10),bottom:parseInt(e.borderBottomWidth,10),left:parseInt(e.borderLeftWidth,10)}}const Es=["top","right","bottom","left","width","height"];class Ps{constructor(t){const e=Cs(t);if(Object.defineProperty(this,"_source",{value:t._source||t,writable:!0,enumerable:!1}),Gi(t)||e)if(e){const e=Ps.getDomRangeRects(t);Ss(this,Ps.getBoundingRect(e))}else Ss(this,t.getBoundingClientRect());else if(Mr(t)){const{innerWidth:e,innerHeight:i}=t;Ss(this,{top:0,right:e,bottom:i,left:0,width:e,height:i})}else Ss(this,t)}clone(){return new Ps(this)}moveTo(t,e){return this.top=e,this.right=t+this.width,this.bottom=e+this.height,this.left=t,this}moveBy(t,e){return this.top+=e,this.right+=t,this.left+=t,this.bottom+=e,this}getIntersection(t){const e={top:Math.max(this.top,t.top),right:Math.min(this.right,t.right),bottom:Math.min(this.bottom,t.bottom),left:Math.max(this.left,t.left)};return e.width=e.right-e.left,e.height=e.bottom-e.top,e.width<0||e.height<0?null:new Ps(e)}getIntersectionArea(t){const e=this.getIntersection(t);return e?e.getArea():0}getArea(){return this.width*this.height}getVisible(){const t=this._source;let e=this.clone();if(!Ms(t)){let i=t.parentNode||t.commonAncestorContainer;for(;i&&!Ms(i);){const t=new Ps(i),n=e.getIntersection(t);if(!n)return null;n.getArea()<e.getArea()&&(e=n),i=i.parentNode}}return e}isEqual(t){for(const e of Es)if(this[e]!==t[e])return!1;return!0}contains(t){const e=this.getIntersection(t);return!(!e||!e.isEqual(t))}excludeScrollbarsAndBorders(){const t=this._source;let e,i,n;if(Mr(t))e=t.innerWidth-t.document.documentElement.clientWidth,i=t.innerHeight-t.document.documentElement.clientHeight,n=t.getComputedStyle(t.document.documentElement).direction;else{const o=Ts(this._source);e=t.offsetWidth-t.clientWidth-o.left-o.right,i=t.offsetHeight-t.clientHeight-o.top-o.bottom,n=t.ownerDocument.defaultView.getComputedStyle(t).direction,this.left+=o.left,this.top+=o.top,this.right-=o.right,this.bottom-=o.bottom,this.width=this.right-this.left,this.height=this.bottom-this.top}return this.width-=e,"ltr"===n?this.right-=e:this.left+=e,this.height-=i,this.bottom-=i,this}static getDomRangeRects(t){const e=[],i=Array.from(t.getClientRects());if(i.length)for(const t of i)e.push(new Ps(t));else{let i=t.startContainer;tr(i)&&(i=i.parentNode);const n=new Ps(i.getBoundingClientRect());n.right=n.left,n.width=0,e.push(n)}return e}static getBoundingRect(t){const e={left:Number.POSITIVE_INFINITY,top:Number.POSITIVE_INFINITY,right:Number.NEGATIVE_INFINITY,bottom:Number.NEGATIVE_INFINITY};let i=0;for(const n of t)i++,e.left=Math.min(e.left,n.left),e.top=Math.min(e.top,n.top),e.right=Math.max(e.right,n.right),e.bottom=Math.max(e.bottom,n.bottom);return 0==i?null:(e.width=e.right-e.left,e.height=e.bottom-e.top,new Ps(e))}}function Ss(t,e){for(const i of Es)t[i]=e[i]}function Ms(t){return!!Gi(t)&&t===t.ownerDocument.body}class Is{constructor(t,e){Is._observerInstance||Is._createObserver(),this._element=t,this._callback=e,Is._addElementCallback(t,e),Is._observerInstance.observe(t)}destroy(){Is._deleteElementCallback(this._element,this._callback)}static _addElementCallback(t,e){Is._elementCallbacks||(Is._elementCallbacks=new Map);let i=Is._elementCallbacks.get(t);i||(i=new Set,Is._elementCallbacks.set(t,i)),i.add(e)}static _deleteElementCallback(t,e){const i=Is._getElementCallbacks(t);i&&(i.delete(e),i.size||(Is._elementCallbacks.delete(t),Is._observerInstance.unobserve(t))),Is._elementCallbacks&&!Is._elementCallbacks.size&&(Is._observerInstance=null,Is._elementCallbacks=null)}static _getElementCallbacks(t){return Is._elementCallbacks?Is._elementCallbacks.get(t):null}static _createObserver(){let t;t="function"==typeof _r.window.ResizeObserver?_r.window.ResizeObserver:Ls,Is._observerInstance=new t(t=>{for(const e of t){const t=Is._getElementCallbacks(e.target);if(t)for(const i of t)i(e)}})}}Is._observerInstance=null,Is._elementCallbacks=null;class Ls{constructor(t){this._callback=t,this._elements=new Set,this._previousRects=new Map,this._periodicCheckTimeout=null}observe(t){this._elements.add(t),this._checkElementRectsAndExecuteCallback(),1===this._elements.size&&this._startPeriodicCheck()}unobserve(t){this._elements.delete(t),this._previousRects.delete(t),this._elements.size||this._stopPeriodicCheck()}_startPeriodicCheck(){const t=()=>{this._checkElementRectsAndExecuteCallback(),this._periodicCheckTimeout=setTimeout(t,100)};this.listenTo(_r.window,"resize",()=>{this._checkElementRectsAndExecuteCallback()}),this._periodicCheckTimeout=setTimeout(t,100)}_stopPeriodicCheck(){clearTimeout(this._periodicCheckTimeout),this.stopListening(),this._previousRects.clear()}_checkElementRectsAndExecuteCallback(){const t=[];for(const e of this._elements)this._hasRectChanged(e)&&t.push({target:e,contentRect:this._previousRects.get(e)});t.length&&this._callback(t)}_hasRectChanged(t){if(!t.ownerDocument.body.contains(t))return!1;const e=new Ps(t),i=this._previousRects.get(t),n=!i||!i.isEqual(e);return this._previousRects.set(t,e),n}}function Ns(t,e){t instanceof HTMLTextAreaElement&&(t.value=e),t.innerHTML=e}function Rs(t){return e=>e+t}function Os(t){const e=t.next();return e.done?null:e.value}Kt(Ls,Ir);class zs{constructor(){this.set("isFocused",!1),this.set("focusedElement",null),this._elements=new Set,this._nextEventLoopTimeout=null}add(t){if(this._elements.has(t))throw new l.a("focustracker-add-element-already-exist",this);this.listenTo(t,"focus",()=>this._focus(t),{useCapture:!0}),this.listenTo(t,"blur",()=>this._blur(),{useCapture:!0}),this._elements.add(t)}remove(t){t===this.focusedElement&&this._blur(t),this._elements.has(t)&&(this.stopListening(t),this._elements.delete(t))}destroy(){this.stopListening()}_focus(t){clearTimeout(this._nextEventLoopTimeout),this.focusedElement=t,this.isFocused=!0}_blur(){clearTimeout(this._nextEventLoopTimeout),this._nextEventLoopTimeout=setTimeout(()=>{this.focusedElement=null,this.isFocused=!1},0)}}Kt(zs,Ir),Kt(zs,Ut);class Ds{constructor(){this._listener=Object.create(Ir)}listenTo(t){this._listener.listenTo(t,"keydown",(t,e)=>{this._listener.fire("_keydown:"+No(e),e)})}set(t,e,i={}){const n=Ro(t),o=i.priority;this._listener.listenTo(this._listener,"_keydown:"+n,(t,i)=>{e(i,()=>{i.preventDefault(),i.stopPropagation(),t.stop()}),t.return=!0},{priority:o})}press(t){return!!this._listener.fire("_keydown:"+No(t),t)}destroy(){this._listener.stopListening()}}class Vs extends Rr{constructor(t){super(t),this.document.on("keydown",(t,e)=>{if(this.isEnabled&&((i=e.keyCode)==Io.arrowright||i==Io.arrowleft||i==Io.arrowup||i==Io.arrowdown)){const i=new go(this.document,"arrowKey",this.document.selection.getFirstRange());this.document.fire(i,e),i.stop.called&&t.stop()}var i})}observe(){}}function js({target:t,viewportOffset:e=0}){const i=$s(t);let n=i,o=null;for(;n;){let r;r=Gs(n==i?t:o),Fs(r,()=>Ys(t,n));const s=Ys(t,n);if(Bs(n,s,e),n.parent!=n){if(o=n.frameElement,n=n.parent,!o)return}else n=null}}function Bs(t,e,i){const n=e.clone().moveBy(0,i),o=e.clone().moveBy(0,-i),r=new Ps(t).excludeScrollbarsAndBorders();if(![o,n].every(t=>r.contains(t))){let{scrollX:s,scrollY:a}=t;Us(o,r)?a-=r.top-e.top+i:Hs(n,r)&&(a+=e.bottom-r.bottom+i),qs(e,r)?s-=r.left-e.left+i:Ws(e,r)&&(s+=e.right-r.right+i),t.scrollTo(s,a)}}function Fs(t,e){const i=$s(t);let n,o;for(;t!=i.document.body;)o=e(),n=new Ps(t).excludeScrollbarsAndBorders(),n.contains(o)||(Us(o,n)?t.scrollTop-=n.top-o.top:Hs(o,n)&&(t.scrollTop+=o.bottom-n.bottom),qs(o,n)?t.scrollLeft-=n.left-o.left:Ws(o,n)&&(t.scrollLeft+=o.right-n.right)),t=t.parentNode}function Hs(t,e){return t.bottom>e.bottom}function Us(t,e){return t.top<e.top}function qs(t,e){return t.left<e.left}function Ws(t,e){return t.right>e.right}function $s(t){return Cs(t)?t.startContainer.ownerDocument.defaultView:t.ownerDocument.defaultView}function Gs(t){if(Cs(t)){let e=t.commonAncestorContainer;return tr(e)&&(e=e.parentNode),e}return t.parentNode}function Ys(t,e){const i=$s(t),n=new Ps(t);if(i===e)return n;{let t=i;for(;t!=e;){const e=t.frameElement,i=new Ps(e).excludeScrollbarsAndBorders();n.moveBy(i.left,i.top),t=t.parent}}return n}Object.assign({},{scrollViewportToShowTarget:js,scrollAncestorsToShowTarget:function(t){Fs(Gs(t),()=>new Ps(t))}});class Ks{constructor(t){this.document=new vo(t),this.domConverter=new Tr(this.document),this.domRoots=new Map,this.set("isRenderingInProgress",!1),this.set("hasDomSelection",!1),this._renderer=new pr(this.domConverter,this.document.selection),this._renderer.bind("isFocused").to(this.document),this._initialDomRootAttributes=new WeakMap,this._observers=new Map,this._ongoingChange=!1,this._postFixersInProgress=!1,this._renderingDisabled=!1,this._hasChangedSinceTheLastRendering=!1,this._writer=new qo(this.document),this.addObserver(Xr),this.addObserver(ws),this.addObserver(bs),this.addObserver(is),this.addObserver(ps),this.addObserver(ks),this.addObserver(Vs),Po.isAndroid&&this.addObserver(_s),this.document.on("arrowKey",lr,{priority:"low"}),jo(this),this.on("render",()=>{this._render(),this.document.fire("layoutChanged"),this._hasChangedSinceTheLastRendering=!1}),this.listenTo(this.document.selection,"change",()=>{this._hasChangedSinceTheLastRendering=!0})}attachDomRoot(t,e="main"){const i=this.document.getRoot(e);i._name=t.tagName.toLowerCase();const n={};for(const{name:e,value:o}of Array.from(t.attributes))n[e]=o,"class"===e?this._writer.addClass(o.split(" "),i):this._writer.setAttribute(e,o,i);this._initialDomRootAttributes.set(t,n);const o=()=>{this._writer.setAttribute("contenteditable",!i.isReadOnly,i),i.isReadOnly?this._writer.addClass("ck-read-only",i):this._writer.removeClass("ck-read-only",i)};o(),this.domRoots.set(e,t),this.domConverter.bindElements(t,i),this._renderer.markToSync("children",i),this._renderer.markToSync("attributes",i),this._renderer.domDocuments.add(t.ownerDocument),i.on("change:children",(t,e)=>this._renderer.markToSync("children",e)),i.on("change:attributes",(t,e)=>this._renderer.markToSync("attributes",e)),i.on("change:text",(t,e)=>this._renderer.markToSync("text",e)),i.on("change:isReadOnly",()=>this.change(o)),i.on("change",()=>{this._hasChangedSinceTheLastRendering=!0});for(const i of this._observers.values())i.observe(t,e)}detachDomRoot(t){const e=this.domRoots.get(t);Array.from(e.attributes).forEach(({name:t})=>e.removeAttribute(t));const i=this._initialDomRootAttributes.get(e);for(const t in i)e.setAttribute(t,i[t]);this.domRoots.delete(t),this.domConverter.unbindDomElement(e)}getDomRoot(t="main"){return this.domRoots.get(t)}addObserver(t){let e=this._observers.get(t);if(e)return e;e=new t(this),this._observers.set(t,e);for(const[t,i]of this.domRoots)e.observe(i,t);return e.enable(),e}getObserver(t){return this._observers.get(t)}disableObservers(){for(const t of this._observers.values())t.disable()}enableObservers(){for(const t of this._observers.values())t.enable()}scrollToTheSelection(){const t=this.document.selection.getFirstRange();t&&js({target:this.domConverter.viewRangeToDom(t),viewportOffset:20})}focus(){if(!this.document.isFocused){const t=this.document.selection.editableElement;t&&(this.domConverter.focus(t),this.forceRender())}}change(t){if(this.isRenderingInProgress||this._postFixersInProgress)throw new l.a("cannot-change-view-tree",this);try{if(this._ongoingChange)return t(this._writer);this._ongoingChange=!0;const e=t(this._writer);return this._ongoingChange=!1,!this._renderingDisabled&&this._hasChangedSinceTheLastRendering&&(this._postFixersInProgress=!0,this.document._callPostFixers(this._writer),this._postFixersInProgress=!1,this.fire("render")),e}catch(t){l.a.rethrowUnexpectedError(t,this)}}forceRender(){this._hasChangedSinceTheLastRendering=!0,this.change(()=>{})}destroy(){for(const t of this._observers.values())t.destroy();this.document.destroy(),this.stopListening()}createPositionAt(t,e){return ao._createAt(t,e)}createPositionAfter(t){return ao._createAfter(t)}createPositionBefore(t){return ao._createBefore(t)}createRange(t,e){return new lo(t,e)}createRangeOn(t){return lo._createOn(t)}createRangeIn(t){return lo._createIn(t)}createSelection(t,e,i){return new uo(t,e,i)}_disableRendering(t){this._renderingDisabled=t,0==t&&this.change(()=>{})}_render(){this.isRenderingInProgress=!0,this.disableObservers(),this._renderer.render(),this.enableObservers(),this.isRenderingInProgress=!1}}Kt(Ks,Ut);class Qs{constructor(t){this.parent=null,this._attrs=mn(t)}get index(){let t;if(!this.parent)return null;if(null===(t=this.parent.getChildIndex(this)))throw new l.a("model-node-not-found-in-parent",this);return t}get startOffset(){let t;if(!this.parent)return null;if(null===(t=this.parent.getChildStartOffset(this)))throw new l.a("model-node-not-found-in-parent",this);return t}get offsetSize(){return 1}get endOffset(){return this.parent?this.startOffset+this.offsetSize:null}get nextSibling(){const t=this.index;return null!==t&&this.parent.getChild(t+1)||null}get previousSibling(){const t=this.index;return null!==t&&this.parent.getChild(t-1)||null}get root(){let t=this;for(;t.parent;)t=t.parent;return t}isAttached(){return this.root.is("rootElement")}getPath(){const t=[];let e=this;for(;e.parent;)t.unshift(e.startOffset),e=e.parent;return t}getAncestors(t={includeSelf:!1,parentFirst:!1}){const e=[];let i=t.includeSelf?this:this.parent;for(;i;)e[t.parentFirst?"push":"unshift"](i),i=i.parent;return e}getCommonAncestor(t,e={}){const i=this.getAncestors(e),n=t.getAncestors(e);let o=0;for(;i[o]==n[o]&&i[o];)o++;return 0===o?null:i[o-1]}isBefore(t){if(this==t)return!1;if(this.root!==t.root)return!1;const e=this.getPath(),i=t.getPath(),n=ln(e,i);switch(n){case"prefix":return!0;case"extension":return!1;default:return e[n]<i[n]}}isAfter(t){return this!=t&&(this.root===t.root&&!this.isBefore(t))}hasAttribute(t){return this._attrs.has(t)}getAttribute(t){return this._attrs.get(t)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}toJSON(){const t={};return this._attrs.size&&(t.attributes=Array.from(this._attrs).reduce((t,e)=>(t[e[0]]=e[1],t),{})),t}is(t){return"node"===t||"model:node"===t}_clone(){return new Qs(this._attrs)}_remove(){this.parent._removeChildren(this.index)}_setAttribute(t,e){this._attrs.set(t,e)}_setAttributesTo(t){this._attrs=mn(t)}_removeAttribute(t){return this._attrs.delete(t)}_clearAttributes(){this._attrs.clear()}}class Js extends Qs{constructor(t,e){super(e),this._data=t||""}get offsetSize(){return this.data.length}get data(){return this._data}is(t){return"$text"===t||"model:$text"===t||"text"===t||"model:text"===t||"node"===t||"model:node"===t}toJSON(){const t=super.toJSON();return t.data=this.data,t}_clone(){return new Js(this.data,this.getAttributes())}static fromJSON(t){return new Js(t.data,t.attributes)}}class Zs{constructor(t,e,i){if(this.textNode=t,e<0||e>t.offsetSize)throw new l.a("model-textproxy-wrong-offsetintext",this);if(i<0||e+i>t.offsetSize)throw new l.a("model-textproxy-wrong-length",this);this.data=t.data.substring(e,e+i),this.offsetInText=e}get startOffset(){return null!==this.textNode.startOffset?this.textNode.startOffset+this.offsetInText:null}get offsetSize(){return this.data.length}get endOffset(){return null!==this.startOffset?this.startOffset+this.offsetSize:null}get isPartial(){return this.offsetSize!==this.textNode.offsetSize}get parent(){return this.textNode.parent}get root(){return this.textNode.root}is(t){return"$textProxy"===t||"model:$textProxy"===t||"textProxy"===t||"model:textProxy"===t}getPath(){const t=this.textNode.getPath();return t.length>0&&(t[t.length-1]+=this.offsetInText),t}getAncestors(t={includeSelf:!1,parentFirst:!1}){const e=[];let i=t.includeSelf?this:this.parent;for(;i;)e[t.parentFirst?"push":"unshift"](i),i=i.parent;return e}hasAttribute(t){return this.textNode.hasAttribute(t)}getAttribute(t){return this.textNode.getAttribute(t)}getAttributes(){return this.textNode.getAttributes()}getAttributeKeys(){return this.textNode.getAttributeKeys()}}class Xs{constructor(t){this._nodes=[],t&&this._insertNodes(0,t)}[Symbol.iterator](){return this._nodes[Symbol.iterator]()}get length(){return this._nodes.length}get maxOffset(){return this._nodes.reduce((t,e)=>t+e.offsetSize,0)}getNode(t){return this._nodes[t]||null}getNodeIndex(t){const e=this._nodes.indexOf(t);return-1==e?null:e}getNodeStartOffset(t){const e=this.getNodeIndex(t);return null===e?null:this._nodes.slice(0,e).reduce((t,e)=>t+e.offsetSize,0)}indexToOffset(t){if(t==this._nodes.length)return this.maxOffset;const e=this._nodes[t];if(!e)throw new l.a("model-nodelist-index-out-of-bounds",this);return this.getNodeStartOffset(e)}offsetToIndex(t){let e=0;for(const i of this._nodes){if(t>=e&&t<e+i.offsetSize)return this.getNodeIndex(i);e+=i.offsetSize}if(e!=t)throw new l.a("model-nodelist-offset-out-of-bounds",this,{offset:t,nodeList:this});return this.length}_insertNodes(t,e){for(const t of e)if(!(t instanceof Qs))throw new l.a("model-nodelist-insertnodes-not-node",this);this._nodes.splice(t,0,...e)}_removeNodes(t,e=1){return this._nodes.splice(t,e)}toJSON(){return this._nodes.map(t=>t.toJSON())}}class ta extends Qs{constructor(t,e,i){super(e),this.name=t,this._children=new Xs,i&&this._insertChild(0,i)}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}is(t,e=null){return e?e===this.name&&("element"===t||"model:element"===t):"element"===t||"model:element"===t||"node"===t||"model:node"===t}getChild(t){return this._children.getNode(t)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(t){return this._children.getNodeIndex(t)}getChildStartOffset(t){return this._children.getNodeStartOffset(t)}offsetToIndex(t){return this._children.offsetToIndex(t)}getNodeByPath(t){let e=this;for(const i of t)e=e.getChild(e.offsetToIndex(i));return e}findAncestor(t,e={includeSelf:!1}){let i=e.includeSelf?this:this.parent;for(;i;){if(i.name===t)return i;i=i.parent}return null}toJSON(){const t=super.toJSON();if(t.name=this.name,this._children.length>0){t.children=[];for(const e of this._children)t.children.push(e.toJSON())}return t}_clone(t=!1){const e=t?Array.from(this._children).map(t=>t._clone(!0)):null;return new ta(this.name,this.getAttributes(),e)}_appendChild(t){this._insertChild(this.childCount,t)}_insertChild(t,e){const i=function(t){if("string"==typeof t)return[new Js(t)];Ji(t)||(t=[t]);return Array.from(t).map(t=>"string"==typeof t?new Js(t):t instanceof Zs?new Js(t.data,t.getAttributes()):t)}(e);for(const t of i)null!==t.parent&&t._remove(),t.parent=this;this._children._insertNodes(t,i)}_removeChildren(t,e=1){const i=this._children._removeNodes(t,e);for(const t of i)t.parent=null;return i}static fromJSON(t){let e=null;if(t.children){e=[];for(const i of t.children)i.name?e.push(ta.fromJSON(i)):e.push(Js.fromJSON(i))}return new ta(t.name,t.attributes,e)}}class ea{constructor(t={}){if(!t.boundaries&&!t.startPosition)throw new l.a("model-tree-walker-no-start-position",null);const e=t.direction||"forward";if("forward"!=e&&"backward"!=e)throw new l.a("model-tree-walker-unknown-direction",t,{direction:e});this.direction=e,this.boundaries=t.boundaries||null,t.startPosition?this.position=t.startPosition.clone():this.position=na._createAt(this.boundaries["backward"==this.direction?"end":"start"]),this.position.stickiness="toNone",this.singleCharacters=!!t.singleCharacters,this.shallow=!!t.shallow,this.ignoreElementEnd=!!t.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null,this._visitedParent=this.position.parent}[Symbol.iterator](){return this}skip(t){let e,i,n,o;do{n=this.position,o=this._visitedParent,({done:e,value:i}=this.next())}while(!e&&t(i));e||(this.position=n,this._visitedParent=o)}next(){return"forward"==this.direction?this._next():this._previous()}_next(){const t=this.position,e=this.position.clone(),i=this._visitedParent;if(null===i.parent&&e.offset===i.maxOffset)return{done:!0};if(i===this._boundaryEndParent&&e.offset==this.boundaries.end.offset)return{done:!0};const n=e.parent,o=oa(e,n),r=o||ra(e,n,o);if(r instanceof ta)return this.shallow?e.offset++:(e.path.push(0),this._visitedParent=r),this.position=e,ia("elementStart",r,t,e,1);if(r instanceof Js){let n;if(this.singleCharacters)n=1;else{let t=r.endOffset;this._boundaryEndParent==i&&this.boundaries.end.offset<t&&(t=this.boundaries.end.offset),n=t-e.offset}const o=e.offset-r.startOffset,s=new Zs(r,o,n);return e.offset+=n,this.position=e,ia("text",s,t,e,n)}return e.path.pop(),e.offset++,this.position=e,this._visitedParent=i.parent,this.ignoreElementEnd?this._next():ia("elementEnd",i,t,e)}_previous(){const t=this.position,e=this.position.clone(),i=this._visitedParent;if(null===i.parent&&0===e.offset)return{done:!0};if(i==this._boundaryStartParent&&e.offset==this.boundaries.start.offset)return{done:!0};const n=e.parent,o=oa(e,n),r=o||sa(e,n,o);if(r instanceof ta)return e.offset--,this.shallow?(this.position=e,ia("elementStart",r,t,e,1)):(e.path.push(r.maxOffset),this.position=e,this._visitedParent=r,this.ignoreElementEnd?this._previous():ia("elementEnd",r,t,e));if(r instanceof Js){let n;if(this.singleCharacters)n=1;else{let t=r.startOffset;this._boundaryStartParent==i&&this.boundaries.start.offset>t&&(t=this.boundaries.start.offset),n=e.offset-t}const o=e.offset-r.startOffset,s=new Zs(r,o-n,n);return e.offset-=n,this.position=e,ia("text",s,t,e,n)}return e.path.pop(),this.position=e,this._visitedParent=i.parent,ia("elementStart",i,t,e,1)}}function ia(t,e,i,n,o){return{done:!1,value:{type:t,item:e,previousPosition:i,nextPosition:n,length:o}}}class na{constructor(t,e,i="toNone"){if(!t.is("element")&&!t.is("documentFragment"))throw new l.a("model-position-root-invalid",t);if(!(e instanceof Array)||0===e.length)throw new l.a("model-position-path-incorrect-format",t,{path:e});t.is("rootElement")?e=e.slice():(e=[...t.getPath(),...e],t=t.root),this.root=t,this.path=e,this.stickiness=i}get offset(){return this.path[this.path.length-1]}set offset(t){this.path[this.path.length-1]=t}get parent(){let t=this.root;for(let e=0;e<this.path.length-1;e++)if(t=t.getChild(t.offsetToIndex(this.path[e])),!t)throw new l.a("model-position-path-incorrect",this,{position:this});if(t.is("$text"))throw new l.a("model-position-path-incorrect",this,{position:this});return t}get index(){return this.parent.offsetToIndex(this.offset)}get textNode(){return oa(this,this.parent)}get nodeAfter(){const t=this.parent;return ra(this,t,oa(this,t))}get nodeBefore(){const t=this.parent;return sa(this,t,oa(this,t))}get isAtStart(){return 0===this.offset}get isAtEnd(){return this.offset==this.parent.maxOffset}compareWith(t){if(this.root!=t.root)return"different";const e=ln(this.path,t.path);switch(e){case"same":return"same";case"prefix":return"before";case"extension":return"after";default:return this.path[e]<t.path[e]?"before":"after"}}getLastMatchingPosition(t,e={}){e.startPosition=this;const i=new ea(e);return i.skip(t),i.position}getParentPath(){return this.path.slice(0,-1)}getAncestors(){const t=this.parent;return t.is("documentFragment")?[t]:t.getAncestors({includeSelf:!0})}findAncestor(t){const e=this.parent;return e.is("element")?e.findAncestor(t,{includeSelf:!0}):null}getCommonPath(t){if(this.root!=t.root)return[];const e=ln(this.path,t.path),i="string"==typeof e?Math.min(this.path.length,t.path.length):e;return this.path.slice(0,i)}getCommonAncestor(t){const e=this.getAncestors(),i=t.getAncestors();let n=0;for(;e[n]==i[n]&&e[n];)n++;return 0===n?null:e[n-1]}getShiftedBy(t){const e=this.clone(),i=e.offset+t;return e.offset=i<0?0:i,e}isAfter(t){return"after"==this.compareWith(t)}isBefore(t){return"before"==this.compareWith(t)}isEqual(t){return"same"==this.compareWith(t)}isTouching(t){let e=null,i=null;switch(this.compareWith(t)){case"same":return!0;case"before":e=na._createAt(this),i=na._createAt(t);break;case"after":e=na._createAt(t),i=na._createAt(this);break;default:return!1}let n=e.parent;for(;e.path.length+i.path.length;){if(e.isEqual(i))return!0;if(e.path.length>i.path.length){if(e.offset!==n.maxOffset)return!1;e.path=e.path.slice(0,-1),n=n.parent,e.offset++}else{if(0!==i.offset)return!1;i.path=i.path.slice(0,-1)}}}is(t){return"position"===t||"model:position"===t}hasSameParentAs(t){if(this.root!==t.root)return!1;return"same"==ln(this.getParentPath(),t.getParentPath())}getTransformedByOperation(t){let e;switch(t.type){case"insert":e=this._getTransformedByInsertOperation(t);break;case"move":case"remove":case"reinsert":e=this._getTransformedByMoveOperation(t);break;case"split":e=this._getTransformedBySplitOperation(t);break;case"merge":e=this._getTransformedByMergeOperation(t);break;default:e=na._createAt(this)}return e}_getTransformedByInsertOperation(t){return this._getTransformedByInsertion(t.position,t.howMany)}_getTransformedByMoveOperation(t){return this._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany)}_getTransformedBySplitOperation(t){const e=t.movedRange;return e.containsPosition(this)||e.start.isEqual(this)&&"toNext"==this.stickiness?this._getCombined(t.splitPosition,t.moveTargetPosition):t.graveyardPosition?this._getTransformedByMove(t.graveyardPosition,t.insertionPosition,1):this._getTransformedByInsertion(t.insertionPosition,1)}_getTransformedByMergeOperation(t){const e=t.movedRange;let i;return e.containsPosition(this)||e.start.isEqual(this)?(i=this._getCombined(t.sourcePosition,t.targetPosition),t.sourcePosition.isBefore(t.targetPosition)&&(i=i._getTransformedByDeletion(t.deletionPosition,1))):i=this.isEqual(t.deletionPosition)?na._createAt(t.deletionPosition):this._getTransformedByMove(t.deletionPosition,t.graveyardPosition,1),i}_getTransformedByDeletion(t,e){const i=na._createAt(this);if(this.root!=t.root)return i;if("same"==ln(t.getParentPath(),this.getParentPath())){if(t.offset<this.offset){if(t.offset+e>this.offset)return null;i.offset-=e}}else if("prefix"==ln(t.getParentPath(),this.getParentPath())){const n=t.path.length-1;if(t.offset<=this.path[n]){if(t.offset+e>this.path[n])return null;i.path[n]-=e}}return i}_getTransformedByInsertion(t,e){const i=na._createAt(this);if(this.root!=t.root)return i;if("same"==ln(t.getParentPath(),this.getParentPath()))(t.offset<this.offset||t.offset==this.offset&&"toPrevious"!=this.stickiness)&&(i.offset+=e);else if("prefix"==ln(t.getParentPath(),this.getParentPath())){const n=t.path.length-1;t.offset<=this.path[n]&&(i.path[n]+=e)}return i}_getTransformedByMove(t,e,i){if(e=e._getTransformedByDeletion(t,i),t.isEqual(e))return na._createAt(this);const n=this._getTransformedByDeletion(t,i);return null===n||t.isEqual(this)&&"toNext"==this.stickiness||t.getShiftedBy(i).isEqual(this)&&"toPrevious"==this.stickiness?this._getCombined(t,e):n._getTransformedByInsertion(e,i)}_getCombined(t,e){const i=t.path.length-1,n=na._createAt(e);return n.stickiness=this.stickiness,n.offset=n.offset+this.path[i]-t.offset,n.path=[...n.path,...this.path.slice(i+1)],n}toJSON(){return{root:this.root.toJSON(),path:Array.from(this.path),stickiness:this.stickiness}}clone(){return new this.constructor(this.root,this.path,this.stickiness)}static _createAt(t,e,i="toNone"){if(t instanceof na)return new na(t.root,t.path,t.stickiness);{const n=t;if("end"==e)e=n.maxOffset;else{if("before"==e)return this._createBefore(n,i);if("after"==e)return this._createAfter(n,i);if(0!==e&&!e)throw new l.a("model-createpositionat-offset-required",[this,t])}if(!n.is("element")&&!n.is("documentFragment"))throw new l.a("model-position-parent-incorrect",[this,t]);const o=n.getPath();return o.push(e),new this(n.root,o,i)}}static _createAfter(t,e){if(!t.parent)throw new l.a("model-position-after-root",[this,t],{root:t});return this._createAt(t.parent,t.endOffset,e)}static _createBefore(t,e){if(!t.parent)throw new l.a("model-position-before-root",t,{root:t});return this._createAt(t.parent,t.startOffset,e)}static fromJSON(t,e){if("$graveyard"===t.root){const i=new na(e.graveyard,t.path);return i.stickiness=t.stickiness,i}if(!e.getRoot(t.root))throw new l.a("model-position-fromjson-no-root",e,{rootName:t.root});return new na(e.getRoot(t.root),t.path,t.stickiness)}}function oa(t,e){const i=e.getChild(e.offsetToIndex(t.offset));return i&&i.is("$text")&&i.startOffset<t.offset?i:null}function ra(t,e,i){return null!==i?null:e.getChild(e.offsetToIndex(t.offset))}function sa(t,e,i){return null!==i?null:e.getChild(e.offsetToIndex(t.offset)-1)}class aa{constructor(t,e=null){this.start=na._createAt(t),this.end=e?na._createAt(e):na._createAt(t),this.start.stickiness=this.isCollapsed?"toNone":"toNext",this.end.stickiness=this.isCollapsed?"toNone":"toPrevious"}*[Symbol.iterator](){yield*new ea({boundaries:this,ignoreElementEnd:!0})}get isCollapsed(){return this.start.isEqual(this.end)}get isFlat(){return"same"==ln(this.start.getParentPath(),this.end.getParentPath())}get root(){return this.start.root}containsPosition(t){return t.isAfter(this.start)&&t.isBefore(this.end)}containsRange(t,e=!1){t.isCollapsed&&(e=!1);const i=this.containsPosition(t.start)||e&&this.start.isEqual(t.start),n=this.containsPosition(t.end)||e&&this.end.isEqual(t.end);return i&&n}containsItem(t){const e=na._createBefore(t);return this.containsPosition(e)||this.start.isEqual(e)}is(t){return"range"===t||"model:range"===t}isEqual(t){return this.start.isEqual(t.start)&&this.end.isEqual(t.end)}isIntersecting(t){return this.start.isBefore(t.end)&&this.end.isAfter(t.start)}getDifference(t){const e=[];return this.isIntersecting(t)?(this.containsPosition(t.start)&&e.push(new aa(this.start,t.start)),this.containsPosition(t.end)&&e.push(new aa(t.end,this.end))):e.push(new aa(this.start,this.end)),e}getIntersection(t){if(this.isIntersecting(t)){let e=this.start,i=this.end;return this.containsPosition(t.start)&&(e=t.start),this.containsPosition(t.end)&&(i=t.end),new aa(e,i)}return null}getJoined(t,e=!1){let i=this.isIntersecting(t);if(i||(i=this.start.isBefore(t.start)?e?this.end.isTouching(t.start):this.end.isEqual(t.start):e?t.end.isTouching(this.start):t.end.isEqual(this.start)),!i)return null;let n=this.start,o=this.end;return t.start.isBefore(n)&&(n=t.start),t.end.isAfter(o)&&(o=t.end),new aa(n,o)}getMinimalFlatRanges(){const t=[],e=this.start.getCommonPath(this.end).length,i=na._createAt(this.start);let n=i.parent;for(;i.path.length>e+1;){const e=n.maxOffset-i.offset;0!==e&&t.push(new aa(i,i.getShiftedBy(e))),i.path=i.path.slice(0,-1),i.offset++,n=n.parent}for(;i.path.length<=this.end.path.length;){const e=this.end.path[i.path.length-1],n=e-i.offset;0!==n&&t.push(new aa(i,i.getShiftedBy(n))),i.offset=e,i.path.push(0)}return t}getWalker(t={}){return t.boundaries=this,new ea(t)}*getItems(t={}){t.boundaries=this,t.ignoreElementEnd=!0;const e=new ea(t);for(const t of e)yield t.item}*getPositions(t={}){t.boundaries=this;const e=new ea(t);yield e.position;for(const t of e)yield t.nextPosition}getTransformedByOperation(t){switch(t.type){case"insert":return this._getTransformedByInsertOperation(t);case"move":case"remove":case"reinsert":return this._getTransformedByMoveOperation(t);case"split":return[this._getTransformedBySplitOperation(t)];case"merge":return[this._getTransformedByMergeOperation(t)]}return[new aa(this.start,this.end)]}getTransformedByOperations(t){const e=[new aa(this.start,this.end)];for(const i of t)for(let t=0;t<e.length;t++){const n=e[t].getTransformedByOperation(i);e.splice(t,1,...n),t+=n.length-1}for(let t=0;t<e.length;t++){const i=e[t];for(let n=t+1;n<e.length;n++){const t=e[n];(i.containsRange(t)||t.containsRange(i)||i.isEqual(t))&&e.splice(n,1)}}return e}getCommonAncestor(){return this.start.getCommonAncestor(this.end)}getContainedElement(){if(this.isCollapsed)return null;const t=this.start.nodeAfter,e=this.end.nodeBefore;return t&&t.is("element")&&t===e?t:null}toJSON(){return{start:this.start.toJSON(),end:this.end.toJSON()}}clone(){return new this.constructor(this.start,this.end)}_getTransformedByInsertOperation(t,e=!1){return this._getTransformedByInsertion(t.position,t.howMany,e)}_getTransformedByMoveOperation(t,e=!1){const i=t.sourcePosition,n=t.howMany,o=t.targetPosition;return this._getTransformedByMove(i,o,n,e)}_getTransformedBySplitOperation(t){const e=this.start._getTransformedBySplitOperation(t);let i=this.end._getTransformedBySplitOperation(t);return this.end.isEqual(t.insertionPosition)&&(i=this.end.getShiftedBy(1)),e.root!=i.root&&(i=this.end.getShiftedBy(-1)),new aa(e,i)}_getTransformedByMergeOperation(t){if(this.start.isEqual(t.targetPosition)&&this.end.isEqual(t.deletionPosition))return new aa(this.start);let e=this.start._getTransformedByMergeOperation(t),i=this.end._getTransformedByMergeOperation(t);return e.root!=i.root&&(i=this.end.getShiftedBy(-1)),e.isAfter(i)?(t.sourcePosition.isBefore(t.targetPosition)?(e=na._createAt(i),e.offset=0):(t.deletionPosition.isEqual(e)||(i=t.deletionPosition),e=t.targetPosition),new aa(e,i)):new aa(e,i)}_getTransformedByInsertion(t,e,i=!1){if(i&&this.containsPosition(t))return[new aa(this.start,t),new aa(t.getShiftedBy(e),this.end._getTransformedByInsertion(t,e))];{const i=new aa(this.start,this.end);return i.start=i.start._getTransformedByInsertion(t,e),i.end=i.end._getTransformedByInsertion(t,e),[i]}}_getTransformedByMove(t,e,i,n=!1){if(this.isCollapsed){const n=this.start._getTransformedByMove(t,e,i);return[new aa(n)]}const o=aa._createFromPositionAndShift(t,i),r=e._getTransformedByDeletion(t,i);if(this.containsPosition(e)&&!n&&(o.containsPosition(this.start)||o.containsPosition(this.end))){const n=this.start._getTransformedByMove(t,e,i),o=this.end._getTransformedByMove(t,e,i);return[new aa(n,o)]}let s;const a=this.getDifference(o);let l=null;const c=this.getIntersection(o);if(1==a.length?l=new aa(a[0].start._getTransformedByDeletion(t,i),a[0].end._getTransformedByDeletion(t,i)):2==a.length&&(l=new aa(this.start,this.end._getTransformedByDeletion(t,i))),s=l?l._getTransformedByInsertion(r,i,null!==c||n):[],c){const t=new aa(c.start._getCombined(o.start,r),c.end._getCombined(o.start,r));2==s.length?s.splice(1,0,t):s.push(t)}return s}_getTransformedByDeletion(t,e){let i=this.start._getTransformedByDeletion(t,e),n=this.end._getTransformedByDeletion(t,e);return null==i&&null==n?null:(null==i&&(i=t),null==n&&(n=t),new aa(i,n))}static _createFromPositionAndShift(t,e){const i=t,n=t.getShiftedBy(e);return e>0?new this(i,n):new this(n,i)}static _createIn(t){return new this(na._createAt(t,0),na._createAt(t,t.maxOffset))}static _createOn(t){return this._createFromPositionAndShift(na._createBefore(t),t.offsetSize)}static _createFromRanges(t){if(0===t.length)throw new l.a("range-create-from-ranges-empty-array",null);if(1==t.length)return t[0].clone();const e=t[0];t.sort((t,e)=>t.start.isAfter(e.start)?1:-1);const i=t.indexOf(e),n=new this(e.start,e.end);if(i>0)for(let e=i-1;t[e].end.isEqual(n.start);e++)n.start=na._createAt(t[e].start);for(let e=i+1;e<t.length&&t[e].start.isEqual(n.end);e++)n.end=na._createAt(t[e].end);return n}static fromJSON(t,e){return new this(na.fromJSON(t.start,e),na.fromJSON(t.end,e))}}class la{constructor(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._viewToModelLengthCallbacks=new Map,this._markerNameToElements=new Map,this._elementToMarkerNames=new Map,this._unboundMarkerNames=new Set,this.on("modelToViewPosition",(t,e)=>{if(e.viewPosition)return;const i=this._modelToViewMapping.get(e.modelPosition.parent);e.viewPosition=this.findPositionIn(i,e.modelPosition.offset)},{priority:"low"}),this.on("viewToModelPosition",(t,e)=>{if(e.modelPosition)return;const i=this.findMappedViewAncestor(e.viewPosition),n=this._viewToModelMapping.get(i),o=this._toModelOffset(e.viewPosition.parent,e.viewPosition.offset,i);e.modelPosition=na._createAt(n,o)},{priority:"low"})}bindElements(t,e){this._modelToViewMapping.set(t,e),this._viewToModelMapping.set(e,t)}unbindViewElement(t){const e=this.toModelElement(t);if(this._viewToModelMapping.delete(t),this._elementToMarkerNames.has(t))for(const e of this._elementToMarkerNames.get(t))this._unboundMarkerNames.add(e);this._modelToViewMapping.get(e)==t&&this._modelToViewMapping.delete(e)}unbindModelElement(t){const e=this.toViewElement(t);this._modelToViewMapping.delete(t),this._viewToModelMapping.get(e)==t&&this._viewToModelMapping.delete(e)}bindElementToMarker(t,e){const i=this._markerNameToElements.get(e)||new Set;i.add(t);const n=this._elementToMarkerNames.get(t)||new Set;n.add(e),this._markerNameToElements.set(e,i),this._elementToMarkerNames.set(t,n)}unbindElementFromMarkerName(t,e){const i=this._markerNameToElements.get(e);i&&(i.delete(t),0==i.size&&this._markerNameToElements.delete(e));const n=this._elementToMarkerNames.get(t);n&&(n.delete(e),0==n.size&&this._elementToMarkerNames.delete(t))}flushUnboundMarkerNames(){const t=Array.from(this._unboundMarkerNames);return this._unboundMarkerNames.clear(),t}clearBindings(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._markerNameToElements=new Map,this._elementToMarkerNames=new Map,this._unboundMarkerNames=new Set}toModelElement(t){return this._viewToModelMapping.get(t)}toViewElement(t){return this._modelToViewMapping.get(t)}toModelRange(t){return new aa(this.toModelPosition(t.start),this.toModelPosition(t.end))}toViewRange(t){return new lo(this.toViewPosition(t.start),this.toViewPosition(t.end))}toModelPosition(t){const e={viewPosition:t,mapper:this};return this.fire("viewToModelPosition",e),e.modelPosition}toViewPosition(t,e={isPhantom:!1}){const i={modelPosition:t,mapper:this,isPhantom:e.isPhantom};return this.fire("modelToViewPosition",i),i.viewPosition}markerNameToElements(t){const e=this._markerNameToElements.get(t);if(!e)return null;const i=new Set;for(const t of e)if(t.is("attributeElement"))for(const e of t.getElementsWithSameId())i.add(e);else i.add(t);return i}registerViewToModelLength(t,e){this._viewToModelLengthCallbacks.set(t,e)}findMappedViewAncestor(t){let e=t.parent;for(;!this._viewToModelMapping.has(e);)e=e.parent;return e}_toModelOffset(t,e,i){if(i!=t){return this._toModelOffset(t.parent,t.index,i)+this._toModelOffset(t,e,t)}if(t.is("$text"))return e;let n=0;for(let i=0;i<e;i++)n+=this.getModelLength(t.getChild(i));return n}getModelLength(t){if(this._viewToModelLengthCallbacks.get(t.name)){return this._viewToModelLengthCallbacks.get(t.name)(t)}if(this._viewToModelMapping.has(t))return 1;if(t.is("$text"))return t.data.length;if(t.is("uiElement"))return 0;{let e=0;for(const i of t.getChildren())e+=this.getModelLength(i);return e}}findPositionIn(t,e){let i,n=0,o=0,r=0;if(t.is("$text"))return new ao(t,e);for(;o<e;)i=t.getChild(r),n=this.getModelLength(i),o+=n,r++;return o==e?this._moveViewPositionToTextNode(new ao(t,r)):this.findPositionIn(i,e-(o-n))}_moveViewPositionToTextNode(t){const e=t.nodeBefore,i=t.nodeAfter;return e instanceof hn?new ao(e,e.data.length):i instanceof hn?new ao(i,0):t}}Kt(la,h);class ca{constructor(){this._consumable=new Map,this._textProxyRegistry=new Map}add(t,e){e=da(e),t instanceof Zs&&(t=this._getSymbolForTextProxy(t)),this._consumable.has(t)||this._consumable.set(t,new Map),this._consumable.get(t).set(e,!0)}consume(t,e){return e=da(e),t instanceof Zs&&(t=this._getSymbolForTextProxy(t)),!!this.test(t,e)&&(this._consumable.get(t).set(e,!1),!0)}test(t,e){e=da(e),t instanceof Zs&&(t=this._getSymbolForTextProxy(t));const i=this._consumable.get(t);if(void 0===i)return null;const n=i.get(e);return void 0===n?null:n}revert(t,e){e=da(e),t instanceof Zs&&(t=this._getSymbolForTextProxy(t));const i=this.test(t,e);return!1===i?(this._consumable.get(t).set(e,!0),!0):!0!==i&&null}_getSymbolForTextProxy(t){let e=null;const i=this._textProxyRegistry.get(t.startOffset);if(i){const n=i.get(t.endOffset);n&&(e=n.get(t.parent))}return e||(e=this._addSymbolForTextProxy(t.startOffset,t.endOffset,t.parent)),e}_addSymbolForTextProxy(t,e,i){const n=Symbol("textProxySymbol");let o,r;return o=this._textProxyRegistry.get(t),o||(o=new Map,this._textProxyRegistry.set(t,o)),r=o.get(e),r||(r=new Map,o.set(e,r)),r.set(i,n),n}}function da(t){const e=t.split(":");return e.length>1?e[0]+":"+e[1]:e[0]}class ha{constructor(t){this.conversionApi=Object.assign({dispatcher:this},t),this._reconversionEventsMapping=new Map}convertChanges(t,e,i){for(const e of t.getMarkersToRemove())this.convertMarkerRemove(e.name,e.range,i);const n=this._mapChangesWithAutomaticReconversion(t);for(const t of n)"insert"===t.type?this.convertInsert(aa._createFromPositionAndShift(t.position,t.length),i):"remove"===t.type?this.convertRemove(t.position,t.length,t.name,i):"reconvert"===t.type?this.reconvertElement(t.element,i):this.convertAttribute(t.range,t.attributeKey,t.attributeOldValue,t.attributeNewValue,i);for(const t of this.conversionApi.mapper.flushUnboundMarkerNames()){const n=e.get(t).getRange();this.convertMarkerRemove(t,n,i),this.convertMarkerAdd(t,n,i)}for(const e of t.getMarkersToAdd())this.convertMarkerAdd(e.name,e.range,i)}convertInsert(t,e){this.conversionApi.writer=e,this.conversionApi.consumable=this._createInsertConsumable(t);for(const e of Array.from(t).map(ma))this._convertInsertWithAttributes(e);this._clearConversionApi()}convertRemove(t,e,i,n){this.conversionApi.writer=n,this.fire("remove:"+i,{position:t,length:e},this.conversionApi),this._clearConversionApi()}convertAttribute(t,e,i,n,o){this.conversionApi.writer=o,this.conversionApi.consumable=this._createConsumableForRange(t,"attribute:"+e);for(const o of t){const t={item:o.item,range:aa._createFromPositionAndShift(o.previousPosition,o.length),attributeKey:e,attributeOldValue:i,attributeNewValue:n};this._testAndFire("attribute:"+e,t)}this._clearConversionApi()}reconvertElement(t,e){const i=aa._createOn(t);this.conversionApi.writer=e,this.conversionApi.consumable=this._createInsertConsumable(i);const n=this.conversionApi.mapper,o=n.toViewElement(t);e.remove(o),this._convertInsertWithAttributes({item:t,range:i});const r=n.toViewElement(t);for(const i of aa._createIn(t)){const{item:t}=i,o=ga(t,n);o?o.root!==r.root&&e.move(e.createRangeOn(o),n.toViewPosition(na._createBefore(t))):this._convertInsertWithAttributes(ma(i))}n.unbindViewElement(o),this._clearConversionApi()}convertSelection(t,e,i){const n=Array.from(e.getMarkersAtPosition(t.getFirstPosition()));if(this.conversionApi.writer=i,this.conversionApi.consumable=this._createSelectionConsumable(t,n),this.fire("selection",{selection:t},this.conversionApi),t.isCollapsed){for(const e of n){const i=e.getRange();if(!ua(t.getFirstPosition(),e,this.conversionApi.mapper))continue;const n={item:t,markerName:e.name,markerRange:i};this.conversionApi.consumable.test(t,"addMarker:"+e.name)&&this.fire("addMarker:"+e.name,n,this.conversionApi)}for(const e of t.getAttributeKeys()){const i={item:t,range:t.getFirstRange(),attributeKey:e,attributeOldValue:null,attributeNewValue:t.getAttribute(e)};this.conversionApi.consumable.test(t,"attribute:"+i.attributeKey)&&this.fire("attribute:"+i.attributeKey+":$text",i,this.conversionApi)}this._clearConversionApi()}}convertMarkerAdd(t,e,i){if("$graveyard"==e.root.rootName)return;this.conversionApi.writer=i;const n="addMarker:"+t,o=new ca;if(o.add(e,n),this.conversionApi.consumable=o,this.fire(n,{markerName:t,markerRange:e},this.conversionApi),o.test(e,n)){this.conversionApi.consumable=this._createConsumableForRange(e,n);for(const i of e.getItems()){if(!this.conversionApi.consumable.test(i,n))continue;const o={item:i,range:aa._createOn(i),markerName:t,markerRange:e};this.fire(n,o,this.conversionApi)}this._clearConversionApi()}}convertMarkerRemove(t,e,i){"$graveyard"!=e.root.rootName&&(this.conversionApi.writer=i,this.fire("removeMarker:"+t,{markerName:t,markerRange:e},this.conversionApi),this._clearConversionApi())}_mapReconversionTriggerEvent(t,e){this._reconversionEventsMapping.set(e,t)}_createInsertConsumable(t){const e=new ca;for(const i of t){const t=i.item;e.add(t,"insert");for(const i of t.getAttributeKeys())e.add(t,"attribute:"+i)}return e}_createConsumableForRange(t,e){const i=new ca;for(const n of t.getItems())i.add(n,e);return i}_createSelectionConsumable(t,e){const i=new ca;i.add(t,"selection");for(const n of e)i.add(t,"addMarker:"+n.name);for(const e of t.getAttributeKeys())i.add(t,"attribute:"+e);return i}_testAndFire(t,e){this.conversionApi.consumable.test(e.item,t)&&this.fire(function(t,e){const i=e.item.name||"$text";return`${t}:${i}`}(t,e),e,this.conversionApi)}_clearConversionApi(){delete this.conversionApi.writer,delete this.conversionApi.consumable}_convertInsertWithAttributes(t){this._testAndFire("insert",t);for(const e of t.item.getAttributeKeys())t.attributeKey=e,t.attributeOldValue=null,t.attributeNewValue=t.item.getAttribute(e),this._testAndFire("attribute:"+e,t)}_mapChangesWithAutomaticReconversion(t){const e=new Set,i=[];for(const n of t.getChanges()){const t=n.position||n.range.start,o=t.parent;if(oa(t,o)){i.push(n);continue}const r="attribute"===n.type?ra(t,o,null):o;if(r.is("$text")){i.push(n);continue}let s;if(s="attribute"===n.type?`attribute:${n.attributeKey}:${r.name}`:`${n.type}:${n.name}`,this._isReconvertTriggerEvent(s,r.name)){if(e.has(r))continue;e.add(r),i.push({type:"reconvert",element:r})}else i.push(n)}return i}_isReconvertTriggerEvent(t,e){return this._reconversionEventsMapping.get(t)===e}}function ua(t,e,i){const n=e.getRange(),o=Array.from(t.getAncestors());o.shift(),o.reverse();return!o.some(t=>{if(n.containsItem(t)){return!!i.toViewElement(t).getCustomProperty("addHighlight")}})}function ma(t){return{item:t.item,range:aa._createFromPositionAndShift(t.previousPosition,t.length)}}function ga(t,e){if(t.is("textProxy")){const i=e.toViewPosition(na._createBefore(t)).parent;return i.is("$text")?i:null}return e.toViewElement(t)}Kt(ha,h);class fa{constructor(t,e,i){this._lastRangeBackward=!1,this._ranges=[],this._attrs=new Map,t&&this.setTo(t,e,i)}get anchor(){if(this._ranges.length>0){const t=this._ranges[this._ranges.length-1];return this._lastRangeBackward?t.end:t.start}return null}get focus(){if(this._ranges.length>0){const t=this._ranges[this._ranges.length-1];return this._lastRangeBackward?t.start:t.end}return null}get isCollapsed(){return 1===this._ranges.length&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}isEqual(t){if(this.rangeCount!=t.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(t.anchor)||!this.focus.isEqual(t.focus))return!1;for(const e of this._ranges){let i=!1;for(const n of t._ranges)if(e.isEqual(n)){i=!0;break}if(!i)return!1}return!0}*getRanges(){for(const t of this._ranges)yield new aa(t.start,t.end)}getFirstRange(){let t=null;for(const e of this._ranges)t&&!e.start.isBefore(t.start)||(t=e);return t?new aa(t.start,t.end):null}getLastRange(){let t=null;for(const e of this._ranges)t&&!e.end.isAfter(t.end)||(t=e);return t?new aa(t.start,t.end):null}getFirstPosition(){const t=this.getFirstRange();return t?t.start.clone():null}getLastPosition(){const t=this.getLastRange();return t?t.end.clone():null}setTo(t,e,i){if(null===t)this._setRanges([]);else if(t instanceof fa)this._setRanges(t.getRanges(),t.isBackward);else if(t&&"function"==typeof t.getRanges)this._setRanges(t.getRanges(),t.isBackward);else if(t instanceof aa)this._setRanges([t],!!e&&!!e.backward);else if(t instanceof na)this._setRanges([new aa(t)]);else if(t instanceof Qs){const n=!!i&&!!i.backward;let o;if("in"==e)o=aa._createIn(t);else if("on"==e)o=aa._createOn(t);else{if(void 0===e)throw new l.a("model-selection-setto-required-second-parameter",[this,t]);o=new aa(na._createAt(t,e))}this._setRanges([o],n)}else{if(!Ji(t))throw new l.a("model-selection-setto-not-selectable",[this,t]);this._setRanges(t,e&&!!e.backward)}}_setRanges(t,e=!1){const i=(t=Array.from(t)).some(e=>{if(!(e instanceof aa))throw new l.a("model-selection-set-ranges-not-range",[this,t]);return this._ranges.every(t=>!t.isEqual(e))});if(t.length!==this._ranges.length||i){this._removeAllRanges();for(const e of t)this._pushRange(e);this._lastRangeBackward=!!e,this.fire("change:range",{directChange:!0})}}setFocus(t,e){if(null===this.anchor)throw new l.a("model-selection-setfocus-no-ranges",[this,t]);const i=na._createAt(t,e);if("same"==i.compareWith(this.focus))return;const n=this.anchor;this._ranges.length&&this._popRange(),"before"==i.compareWith(n)?(this._pushRange(new aa(i,n)),this._lastRangeBackward=!0):(this._pushRange(new aa(n,i)),this._lastRangeBackward=!1),this.fire("change:range",{directChange:!0})}getAttribute(t){return this._attrs.get(t)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}hasAttribute(t){return this._attrs.has(t)}removeAttribute(t){this.hasAttribute(t)&&(this._attrs.delete(t),this.fire("change:attribute",{attributeKeys:[t],directChange:!0}))}setAttribute(t,e){this.getAttribute(t)!==e&&(this._attrs.set(t,e),this.fire("change:attribute",{attributeKeys:[t],directChange:!0}))}getSelectedElement(){return 1!==this.rangeCount?null:this.getFirstRange().getContainedElement()}is(t){return"selection"===t||"model:selection"===t}*getSelectedBlocks(){const t=new WeakSet;for(const e of this.getRanges()){const i=ba(e.start,t);i&&ka(i,e)&&(yield i);for(const i of e.getWalker()){const n=i.item;"elementEnd"==i.type&&wa(n,t,e)&&(yield n)}const n=ba(e.end,t);n&&!e.end.isTouching(na._createAt(n,0))&&ka(n,e)&&(yield n)}}containsEntireContent(t=this.anchor.root){const e=na._createAt(t,0),i=na._createAt(t,"end");return e.isTouching(this.getFirstPosition())&&i.isTouching(this.getLastPosition())}_pushRange(t){this._checkRange(t),this._ranges.push(new aa(t.start,t.end))}_checkRange(t){for(let e=0;e<this._ranges.length;e++)if(t.isIntersecting(this._ranges[e]))throw new l.a("model-selection-range-intersects",[this,t],{addedRange:t,intersectingRange:this._ranges[e]})}_removeAllRanges(){for(;this._ranges.length>0;)this._popRange()}_popRange(){this._ranges.pop()}}function pa(t,e){return!e.has(t)&&(e.add(t),t.root.document.model.schema.isBlock(t)&&t.parent)}function wa(t,e,i){return pa(t,e)&&ka(t,i)}function ba(t,e){const i=t.parent.root.document.model.schema,n=t.parent.getAncestors({parentFirst:!0,includeSelf:!0});let o=!1;const r=n.find(t=>!o&&(o=i.isLimit(t),!o&&pa(t,e)));return n.forEach(t=>e.add(t)),r}function ka(t,e){const i=function(t){const e=t.root.document.model.schema;let i=t.parent;for(;i;){if(e.isBlock(i))return i;i=i.parent}}(t);if(!i)return!0;return!e.containsRange(aa._createOn(i),!0)}Kt(fa,h);class _a extends aa{constructor(t,e){super(t,e),va.call(this)}detach(){this.stopListening()}is(t){return"liveRange"===t||"model:liveRange"===t||"range"==t||"model:range"===t}toRange(){return new aa(this.start,this.end)}static fromRange(t){return new _a(t.start,t.end)}}function va(){this.listenTo(this.root.document.model,"applyOperation",(t,e)=>{const i=e[0];i.isDocumentOperation&&ya.call(this,i)},{priority:"low"})}function ya(t){const e=this.getTransformedByOperation(t),i=aa._createFromRanges(e),n=!i.isEqual(this),o=function(t,e){switch(e.type){case"insert":return t.containsPosition(e.position);case"move":case"remove":case"reinsert":case"merge":return t.containsPosition(e.sourcePosition)||t.start.isEqual(e.sourcePosition)||t.containsPosition(e.targetPosition);case"split":return t.containsPosition(e.splitPosition)||t.containsPosition(e.insertionPosition)}return!1}(this,t);let r=null;if(n){"$graveyard"==i.root.rootName&&(r="remove"==t.type?t.sourcePosition:t.deletionPosition);const e=this.toRange();this.start=i.start,this.end=i.end,this.fire("change:range",e,{deletionPosition:r})}else o&&this.fire("change:content",this.toRange(),{deletionPosition:r})}Kt(_a,h);class xa{constructor(t){this._selection=new Aa(t),this._selection.delegate("change:range").to(this),this._selection.delegate("change:attribute").to(this),this._selection.delegate("change:marker").to(this)}get isCollapsed(){return this._selection.isCollapsed}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get rangeCount(){return this._selection.rangeCount}get hasOwnRange(){return this._selection.hasOwnRange}get isBackward(){return this._selection.isBackward}get isGravityOverridden(){return this._selection.isGravityOverridden}get markers(){return this._selection.markers}get _ranges(){return this._selection._ranges}getRanges(){return this._selection.getRanges()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getSelectedBlocks(){return this._selection.getSelectedBlocks()}getSelectedElement(){return this._selection.getSelectedElement()}containsEntireContent(t){return this._selection.containsEntireContent(t)}destroy(){this._selection.destroy()}getAttributeKeys(){return this._selection.getAttributeKeys()}getAttributes(){return this._selection.getAttributes()}getAttribute(t){return this._selection.getAttribute(t)}hasAttribute(t){return this._selection.hasAttribute(t)}refresh(){this._selection._updateMarkers(),this._selection._updateAttributes(!1)}observeMarkers(t){this._selection.observeMarkers(t)}is(t){return"selection"===t||"model:selection"==t||"documentSelection"==t||"model:documentSelection"==t}_setFocus(t,e){this._selection.setFocus(t,e)}_setTo(t,e,i){this._selection.setTo(t,e,i)}_setAttribute(t,e){this._selection.setAttribute(t,e)}_removeAttribute(t){this._selection.removeAttribute(t)}_getStoredAttributes(){return this._selection._getStoredAttributes()}_overrideGravity(){return this._selection.overrideGravity()}_restoreGravity(t){this._selection.restoreGravity(t)}static _getStoreAttributeKey(t){return"selection:"+t}static _isStoreAttributeKey(t){return t.startsWith("selection:")}}Kt(xa,h);class Aa extends fa{constructor(t){super(),this.markers=new Zi({idProperty:"name"}),this._model=t.model,this._document=t,this._attributePriority=new Map,this._selectionRestorePosition=null,this._hasChangedRange=!1,this._overriddenGravityRegister=new Set,this._observedMarkers=new Set,this.listenTo(this._model,"applyOperation",(t,e)=>{const i=e[0];i.isDocumentOperation&&"marker"!=i.type&&"rename"!=i.type&&"noop"!=i.type&&(0==this._ranges.length&&this._selectionRestorePosition&&this._fixGraveyardSelection(this._selectionRestorePosition),this._selectionRestorePosition=null,this._hasChangedRange&&(this._hasChangedRange=!1,this.fire("change:range",{directChange:!1})))},{priority:"lowest"}),this.on("change:range",()=>{for(const t of this.getRanges())if(!this._document._validateSelectionRange(t))throw new l.a("document-selection-wrong-position",this,{range:t})}),this.listenTo(this._model.markers,"update",(t,e,i,n)=>{this._updateMarker(e,n)}),this.listenTo(this._document,"change",(t,e)=>{!function(t,e){const i=t.document.differ;for(const n of i.getChanges()){if("insert"!=n.type)continue;const i=n.position.parent;n.length===i.maxOffset&&t.enqueueChange(e,t=>{const e=Array.from(i.getAttributeKeys()).filter(t=>t.startsWith("selection:"));for(const n of e)t.removeAttribute(n,i)})}}(this._model,e)})}get isCollapsed(){return 0===this._ranges.length?this._document._getDefaultRange().isCollapsed:super.isCollapsed}get anchor(){return super.anchor||this._document._getDefaultRange().start}get focus(){return super.focus||this._document._getDefaultRange().end}get rangeCount(){return this._ranges.length?this._ranges.length:1}get hasOwnRange(){return this._ranges.length>0}get isGravityOverridden(){return!!this._overriddenGravityRegister.size}destroy(){for(let t=0;t<this._ranges.length;t++)this._ranges[t].detach();this.stopListening()}*getRanges(){this._ranges.length?yield*super.getRanges():yield this._document._getDefaultRange()}getFirstRange(){return super.getFirstRange()||this._document._getDefaultRange()}getLastRange(){return super.getLastRange()||this._document._getDefaultRange()}setTo(t,e,i){super.setTo(t,e,i),this._updateAttributes(!0),this._updateMarkers()}setFocus(t,e){super.setFocus(t,e),this._updateAttributes(!0),this._updateMarkers()}setAttribute(t,e){if(this._setAttribute(t,e)){const e=[t];this.fire("change:attribute",{attributeKeys:e,directChange:!0})}}removeAttribute(t){if(this._removeAttribute(t)){const e=[t];this.fire("change:attribute",{attributeKeys:e,directChange:!0})}}overrideGravity(){const t=s();return this._overriddenGravityRegister.add(t),1===this._overriddenGravityRegister.size&&this._updateAttributes(!0),t}restoreGravity(t){if(!this._overriddenGravityRegister.has(t))throw new l.a("document-selection-gravity-wrong-restore",this,{uid:t});this._overriddenGravityRegister.delete(t),this.isGravityOverridden||this._updateAttributes(!0)}observeMarkers(t){this._observedMarkers.add(t),this._updateMarkers()}_popRange(){this._ranges.pop().detach()}_pushRange(t){const e=this._prepareRange(t);e&&this._ranges.push(e)}_prepareRange(t){if(this._checkRange(t),t.root==this._document.graveyard)return;const e=_a.fromRange(t);return e.on("change:range",(t,i,n)=>{if(this._hasChangedRange=!0,e.root==this._document.graveyard){this._selectionRestorePosition=n.deletionPosition;const t=this._ranges.indexOf(e);this._ranges.splice(t,1),e.detach()}}),e}_updateMarkers(){if(!this._observedMarkers.size)return;const t=[];let e=!1;for(const e of this._model.markers){const i=e.name.split(":",1)[0];if(!this._observedMarkers.has(i))continue;const n=e.getRange();for(const i of this.getRanges())n.containsRange(i,!i.isCollapsed)&&t.push(e)}const i=Array.from(this.markers);for(const i of t)this.markers.has(i)||(this.markers.add(i),e=!0);for(const i of Array.from(this.markers))t.includes(i)||(this.markers.remove(i),e=!0);e&&this.fire("change:marker",{oldMarkers:i,directChange:!1})}_updateMarker(t,e){const i=t.name.split(":",1)[0];if(!this._observedMarkers.has(i))return;let n=!1;const o=Array.from(this.markers),r=this.markers.has(t);if(e){let i=!1;for(const t of this.getRanges())if(e.containsRange(t,!t.isCollapsed)){i=!0;break}i&&!r?(this.markers.add(t),n=!0):!i&&r&&(this.markers.remove(t),n=!0)}else r&&(this.markers.remove(t),n=!0);n&&this.fire("change:marker",{oldMarkers:o,directChange:!1})}_updateAttributes(t){const e=mn(this._getSurroundingAttributes()),i=mn(this.getAttributes());if(t)this._attributePriority=new Map,this._attrs=new Map;else for(const[t,e]of this._attributePriority)"low"==e&&(this._attrs.delete(t),this._attributePriority.delete(t));this._setAttributesTo(e);const n=[];for(const[t,e]of this.getAttributes())i.has(t)&&i.get(t)===e||n.push(t);for(const[t]of i)this.hasAttribute(t)||n.push(t);n.length>0&&this.fire("change:attribute",{attributeKeys:n,directChange:!1})}_setAttribute(t,e,i=!0){const n=i?"normal":"low";if("low"==n&&"normal"==this._attributePriority.get(t))return!1;return super.getAttribute(t)!==e&&(this._attrs.set(t,e),this._attributePriority.set(t,n),!0)}_removeAttribute(t,e=!0){const i=e?"normal":"low";return("low"!=i||"normal"!=this._attributePriority.get(t))&&(this._attributePriority.set(t,i),!!super.hasAttribute(t)&&(this._attrs.delete(t),!0))}_setAttributesTo(t){const e=new Set;for(const[e,i]of this.getAttributes())t.get(e)!==i&&this._removeAttribute(e,!1);for(const[i,n]of t){this._setAttribute(i,n,!1)&&e.add(i)}return e}*_getStoredAttributes(){const t=this.getFirstPosition().parent;if(this.isCollapsed&&t.isEmpty)for(const e of t.getAttributeKeys())if(e.startsWith("selection:")){const i=e.substr("selection:".length);yield[i,t.getAttribute(e)]}}_getSurroundingAttributes(){const t=this.getFirstPosition(),e=this._model.schema;let i=null;if(this.isCollapsed){const n=t.textNode?t.textNode:t.nodeBefore,o=t.textNode?t.textNode:t.nodeAfter;if(this.isGravityOverridden||(i=Ca(n)),i||(i=Ca(o)),!this.isGravityOverridden&&!i){let t=n;for(;t&&!e.isInline(t)&&!i;)t=t.previousSibling,i=Ca(t)}if(!i){let t=o;for(;t&&!e.isInline(t)&&!i;)t=t.nextSibling,i=Ca(t)}i||(i=this._getStoredAttributes())}else{const t=this.getFirstRange();for(const n of t){if(n.item.is("element")&&e.isObject(n.item))break;if("text"==n.type){i=n.item.getAttributes();break}}}return i}_fixGraveyardSelection(t){const e=this._model.schema.getNearestSelectionRange(t);e&&this._pushRange(e)}}function Ca(t){return t instanceof Zs||t instanceof Js?t.getAttributes():null}class Ta{constructor(t){this._dispatchers=t}add(t){for(const e of this._dispatchers)t(e);return this}}var Ea=function(t){return Wi(t,5)};class Pa extends Ta{elementToElement(t){return this.add(function(t){return(t=Ea(t)).view=Ia(t.view,"container"),e=>{var i;if(e.on("insert:"+t.model,(i=t.view,(t,e,n)=>{const o=i(e.item,n);if(!o)return;if(!n.consumable.consume(e.item,"insert"))return;const r=n.mapper.toViewPosition(e.range.start);n.mapper.bindElements(e.item,o),n.writer.insert(r,o)}),{priority:t.converterPriority||"normal"}),t.triggerBy){if(t.triggerBy.attributes)for(const i of t.triggerBy.attributes)e._mapReconversionTriggerEvent(t.model,`attribute:${i}:${t.model}`);if(t.triggerBy.children)for(const i of t.triggerBy.children)e._mapReconversionTriggerEvent(t.model,"insert:"+i),e._mapReconversionTriggerEvent(t.model,"remove:"+i)}}}(t))}attributeToElement(t){return this.add(function(t){t=Ea(t);let e="attribute:"+(t.model.key?t.model.key:t.model);t.model.name&&(e+=":"+t.model.name);if(t.model.values)for(const e of t.model.values)t.view[e]=Ia(t.view[e],"attribute");else t.view=Ia(t.view,"attribute");const i=La(t);return n=>{n.on(e,function(t){return(e,i,n)=>{const o=t(i.attributeOldValue,n),r=t(i.attributeNewValue,n);if(!o&&!r)return;if(!n.consumable.consume(i.item,e.name))return;const s=n.writer,a=s.document.selection;if(i.item instanceof fa||i.item instanceof xa)s.wrap(a.getFirstRange(),r);else{let t=n.mapper.toViewRange(i.range);null!==i.attributeOldValue&&o&&(t=s.unwrap(t,o)),null!==i.attributeNewValue&&r&&s.wrap(t,r)}}}(i),{priority:t.converterPriority||"normal"})}}(t))}attributeToAttribute(t){return this.add(function(t){t=Ea(t);let e="attribute:"+(t.model.key?t.model.key:t.model);t.model.name&&(e+=":"+t.model.name);if(t.model.values)for(const e of t.model.values)t.view[e]=Na(t.view[e]);else t.view=Na(t.view);const i=La(t);return n=>{var o;n.on(e,(o=i,(t,e,i)=>{const n=o(e.attributeOldValue,i),r=o(e.attributeNewValue,i);if(!n&&!r)return;if(!i.consumable.consume(e.item,t.name))return;const s=i.mapper.toViewElement(e.item),a=i.writer;if(!s)throw new l.a("conversion-attribute-to-attribute-on-text",[e,i]);if(null!==e.attributeOldValue&&n)if("class"==n.key){const t=tn(n.value);for(const e of t)a.removeClass(e,s)}else if("style"==n.key){const t=Object.keys(n.value);for(const e of t)a.removeStyle(e,s)}else a.removeAttribute(n.key,s);if(null!==e.attributeNewValue&&r)if("class"==r.key){const t=tn(r.value);for(const e of t)a.addClass(e,s)}else if("style"==r.key){const t=Object.keys(r.value);for(const e of t)a.setStyle(e,r.value[e],s)}else a.setAttribute(r.key,r.value,s)}),{priority:t.converterPriority||"normal"})}}(t))}markerToElement(t){return this.add(function(t){return(t=Ea(t)).view=Ia(t.view,"ui"),e=>{var i;e.on("addMarker:"+t.model,(i=t.view,(t,e,n)=>{e.isOpening=!0;const o=i(e,n);e.isOpening=!1;const r=i(e,n);if(!o||!r)return;const s=e.markerRange;if(s.isCollapsed&&!n.consumable.consume(s,t.name))return;for(const e of s)if(!n.consumable.consume(e.item,t.name))return;const a=n.mapper,l=n.writer;l.insert(a.toViewPosition(s.start),o),n.mapper.bindElementToMarker(o,e.markerName),s.isCollapsed||(l.insert(a.toViewPosition(s.end),r),n.mapper.bindElementToMarker(r,e.markerName)),t.stop()}),{priority:t.converterPriority||"normal"}),e.on("removeMarker:"+t.model,(t.view,(t,e,i)=>{const n=i.mapper.markerNameToElements(e.markerName);if(n){for(const t of n)i.mapper.unbindElementFromMarkerName(t,e.markerName),i.writer.clear(i.writer.createRangeOn(t),t);i.writer.clearClonedElementsGroup(e.markerName),t.stop()}}),{priority:t.converterPriority||"normal"})}}(t))}markerToHighlight(t){return this.add(function(t){return e=>{var i;e.on("addMarker:"+t.model,(i=t.view,(t,e,n)=>{if(!e.item)return;if(!(e.item instanceof fa||e.item instanceof xa||e.item.is("$textProxy")))return;const o=Ra(i,e,n);if(!o)return;if(!n.consumable.consume(e.item,t.name))return;const r=n.writer,s=Sa(r,o),a=r.document.selection;if(e.item instanceof fa||e.item instanceof xa)r.wrap(a.getFirstRange(),s,a);else{const t=n.mapper.toViewRange(e.range),i=r.wrap(t,s);for(const t of i.getItems())if(t.is("attributeElement")&&t.isSimilar(s)){n.mapper.bindElementToMarker(t,e.markerName);break}}}),{priority:t.converterPriority||"normal"}),e.on("addMarker:"+t.model,function(t){return(e,i,n)=>{if(!i.item)return;if(!(i.item instanceof ta))return;const o=Ra(t,i,n);if(!o)return;if(!n.consumable.test(i.item,e.name))return;const r=n.mapper.toViewElement(i.item);if(r&&r.getCustomProperty("addHighlight")){n.consumable.consume(i.item,e.name);for(const t of aa._createIn(i.item))n.consumable.consume(t.item,e.name);r.getCustomProperty("addHighlight")(r,o,n.writer),n.mapper.bindElementToMarker(r,i.markerName)}}}(t.view),{priority:t.converterPriority||"normal"}),e.on("removeMarker:"+t.model,function(t){return(e,i,n)=>{if(i.markerRange.isCollapsed)return;const o=Ra(t,i,n);if(!o)return;const r=Sa(n.writer,o),s=n.mapper.markerNameToElements(i.markerName);if(s){for(const t of s)n.mapper.unbindElementFromMarkerName(t,i.markerName),t.is("attributeElement")?n.writer.unwrap(n.writer.createRangeOn(t),r):t.getCustomProperty("removeHighlight")(t,o.id,n.writer);n.writer.clearClonedElementsGroup(i.markerName),e.stop()}}}(t.view),{priority:t.converterPriority||"normal"})}}(t))}markerToData(t){return this.add(function(t){const e=(t=Ea(t)).model;t.view||(t.view=i=>({group:e,name:i.substr(t.model.length+1)}));return i=>{var n;i.on("addMarker:"+e,(n=t.view,(t,e,i)=>{const o=n(e.markerName,i);if(!o)return;const r=e.markerRange;i.consumable.consume(r,t.name)&&(Ma(r,!1,i,e,o),Ma(r,!0,i,e,o),t.stop())}),{priority:t.converterPriority||"normal"}),i.on("removeMarker:"+e,function(t){return(e,i,n)=>{const o=t(i.markerName,n);if(!o)return;const r=n.mapper.markerNameToElements(i.markerName);if(r){for(const t of r)n.mapper.unbindElementFromMarkerName(t,i.markerName),t.is("containerElement")?(s(`data-${o.group}-start-before`,t),s(`data-${o.group}-start-after`,t),s(`data-${o.group}-end-before`,t),s(`data-${o.group}-end-after`,t)):n.writer.clear(n.writer.createRangeOn(t),t);n.writer.clearClonedElementsGroup(i.markerName),e.stop()}function s(t,e){if(e.hasAttribute(t)){const i=new Set(e.getAttribute(t).split(","));i.delete(o.name),0==i.size?n.writer.removeAttribute(t,e):n.writer.setAttribute(t,Array.from(i).join(","),e)}}}}(t.view),{priority:t.converterPriority||"normal"})}}(t))}}function Sa(t,e){const i=t.createAttributeElement("span",e.attributes);return e.classes&&i._addClass(e.classes),"number"==typeof e.priority&&(i._priority=e.priority),i._id=e.id,i}function Ma(t,e,i,n,o){const r=e?t.start:t.end,s=r.nodeAfter&&r.nodeAfter.is("element")?r.nodeAfter:null,a=r.nodeBefore&&r.nodeBefore.is("element")?r.nodeBefore:null;if(s||a){let t,r;e&&s||!e&&!a?(t=s,r=!0):(t=a,r=!1);const l=i.mapper.toViewElement(t);if(l)return void function(t,e,i,n,o,r){const s=`data-${r.group}-${e?"start":"end"}-${i?"before":"after"}`,a=t.hasAttribute(s)?t.getAttribute(s).split(","):[];a.unshift(r.name),n.writer.setAttribute(s,a.join(","),t),n.mapper.bindElementToMarker(t,o.markerName)}(l,e,r,i,n,o)}!function(t,e,i,n,o){const r=`${o.group}-${e?"start":"end"}`,s=o.name?{name:o.name}:null,a=i.writer.createUIElement(r,s);i.writer.insert(t,a),i.mapper.bindElementToMarker(a,n.markerName)}(i.mapper.toViewPosition(r),e,i,n,o)}function Ia(t,e){return"function"==typeof t?t:(i,n)=>function(t,e,i){"string"==typeof t&&(t={name:t});let n;const o=e.writer,r=Object.assign({},t.attributes);if("container"==i)n=o.createContainerElement(t.name,r);else if("attribute"==i){const e={priority:t.priority||yo.DEFAULT_PRIORITY};n=o.createAttributeElement(t.name,r,e)}else n=o.createUIElement(t.name,r);if(t.styles){const e=Object.keys(t.styles);for(const i of e)o.setStyle(i,t.styles[i],n)}if(t.classes){const e=t.classes;if("string"==typeof e)o.addClass(e,n);else for(const t of e)o.addClass(t,n)}return n}(t,n,e)}function La(t){return t.model.values?(e,i)=>{const n=t.view[e];return n?n(e,i):null}:t.view}function Na(t){return"string"==typeof t?e=>({key:t,value:e}):"object"==typeof t?t.value?()=>t:e=>({key:t.key,value:e}):t}function Ra(t,e,i){const n="function"==typeof t?t(e,i):t;return n?(n.priority||(n.priority=10),n.id||(n.id=e.markerName),n):null}function Oa(t){const{schema:e,document:i}=t.model;for(const n of i.getRootNames()){const o=i.getRoot(n);if(o.isEmpty&&!e.checkChild(o,"$text")&&e.checkChild(o,"paragraph"))return t.insertElement("paragraph",o),!0}return!1}function za(t,e,i){const n=i.createContext(t);return!!i.checkChild(n,"paragraph")&&!!i.checkChild(n.push("paragraph"),e)}function Da(t,e){const i=e.createElement("paragraph");return e.insert(i,t),e.createPositionAt(i,0)}class Va extends Ta{elementToElement(t){return this.add(ja(t))}elementToAttribute(t){return this.add(function(t){Ha(t=Ea(t));const e=Ua(t,!1),i=Ba(t.view),n=i?"element:"+i:"element";return i=>{i.on(n,e,{priority:t.converterPriority||"low"})}}(t))}attributeToAttribute(t){return this.add(function(t){t=Ea(t);let e=null;("string"==typeof t.view||t.view.key)&&(e=function(t){"string"==typeof t.view&&(t.view={key:t.view});const e=t.view.key;let i;if("class"==e||"style"==e){i={["class"==e?"classes":"styles"]:t.view.value}}else{const n=void 0===t.view.value?/[\s\S]*/:t.view.value;i={attributes:{[e]:n}}}t.view.name&&(i.name=t.view.name);return t.view=i,e}(t));Ha(t,e);const i=Ua(t,!0);return e=>{e.on("element",i,{priority:t.converterPriority||"low"})}}(t))}elementToMarker(t){return Object(l.b)("upcast-helpers-element-to-marker-deprecated"),this.add(function(t){return function(t){const e=t.model;t.model=(t,i)=>{const n="string"==typeof e?e:e(t,i);return i.writer.createElement("$marker",{"data-name":n})}}(t=Ea(t)),ja(t)}(t))}dataToMarker(t){return this.add(function(t){(t=Ea(t)).model||(t.model=e=>e?t.view+":"+e:t.view);const e=Fa(qa(t,"start")),i=Fa(qa(t,"end"));return n=>{n.on("element:"+t.view+"-start",e,{priority:t.converterPriority||"normal"}),n.on("element:"+t.view+"-end",i,{priority:t.converterPriority||"normal"});const o=a.get("low"),r=a.get("highest"),s=a.get(t.converterPriority)/r;n.on("element",function(t){return(e,i,n)=>{const o="data-"+t.view;function r(e,o){for(const r of o){const o=t.model(r,n),s=n.writer.createElement("$marker",{"data-name":o});n.writer.insert(s,e),i.modelCursor.isEqual(e)?i.modelCursor=i.modelCursor.getShiftedBy(1):i.modelCursor=i.modelCursor._getTransformedByInsertion(e,1),i.modelRange=i.modelRange._getTransformedByInsertion(e,1)[0]}}(n.consumable.test(i.viewItem,{attributes:o+"-end-after"})||n.consumable.test(i.viewItem,{attributes:o+"-start-after"})||n.consumable.test(i.viewItem,{attributes:o+"-end-before"})||n.consumable.test(i.viewItem,{attributes:o+"-start-before"}))&&(i.modelRange||Object.assign(i,n.convertChildren(i.viewItem,i.modelCursor)),n.consumable.consume(i.viewItem,{attributes:o+"-end-after"})&&r(i.modelRange.end,i.viewItem.getAttribute(o+"-end-after").split(",")),n.consumable.consume(i.viewItem,{attributes:o+"-start-after"})&&r(i.modelRange.end,i.viewItem.getAttribute(o+"-start-after").split(",")),n.consumable.consume(i.viewItem,{attributes:o+"-end-before"})&&r(i.modelRange.start,i.viewItem.getAttribute(o+"-end-before").split(",")),n.consumable.consume(i.viewItem,{attributes:o+"-start-before"})&&r(i.modelRange.start,i.viewItem.getAttribute(o+"-start-before").split(",")))}}(t),{priority:o+s})}}(t))}}function ja(t){const e=Fa(t=Ea(t)),i=Ba(t.view),n=i?"element:"+i:"element";return i=>{i.on(n,e,{priority:t.converterPriority||"normal"})}}function Ba(t){return"string"==typeof t?t:"object"==typeof t&&"string"==typeof t.name?t.name:null}function Fa(t){const e=new gn(t.view);return(i,n,o)=>{const r=e.match(n.viewItem);if(!r)return;const s=r.match;if(s.name=!0,!o.consumable.test(n.viewItem,s))return;const a=function(t,e,i){return t instanceof Function?t(e,i):i.writer.createElement(t)}(t.model,n.viewItem,o);a&&o.safeInsert(a,n.modelCursor)&&(o.consumable.consume(n.viewItem,s),o.convertChildren(n.viewItem,a),o.updateConversionResult(a,n))}}function Ha(t,e=null){const i=null===e||(t=>t.getAttribute(e)),n="object"!=typeof t.model?t.model:t.model.key,o="object"!=typeof t.model||void 0===t.model.value?i:t.model.value;t.model={key:n,value:o}}function Ua(t,e){const i=new gn(t.view);return(n,o,r)=>{const s=i.match(o.viewItem);if(!s)return;if(!function(t,e){const i="function"==typeof t?t(e):t;if("object"==typeof i&&!Ba(i))return!1;return!i.classes&&!i.attributes&&!i.styles}(t.view,o.viewItem)?delete s.match.name:s.match.name=!0,!r.consumable.test(o.viewItem,s.match))return;const a=t.model.key,l="function"==typeof t.model.value?t.model.value(o.viewItem,r):t.model.value;if(null===l)return;o.modelRange||Object.assign(o,r.convertChildren(o.viewItem,o.modelCursor));(function(t,e,i,n){let o=!1;for(const r of Array.from(t.getItems({shallow:i})))n.schema.checkAttribute(r,e.key)&&(o=!0,r.hasAttribute(e.key)||n.writer.setAttribute(e.key,e.value,r));return o})(o.modelRange,{key:a,value:l},e,r)&&r.consumable.consume(o.viewItem,s.match)}}function qa(t,e){const i={};return i.view=t.view+"-"+e,i.model=(e,i)=>{const n=e.getAttribute("name"),o=t.model(n,i);return i.writer.createElement("$marker",{"data-name":o})},i}class Wa{constructor(t,e){this.model=t,this.view=new Ks(e),this.mapper=new la,this.downcastDispatcher=new ha({mapper:this.mapper,schema:t.schema});const i=this.model.document,n=i.selection,o=this.model.markers;this.listenTo(this.model,"_beforeChanges",()=>{this.view._disableRendering(!0)},{priority:"highest"}),this.listenTo(this.model,"_afterChanges",()=>{this.view._disableRendering(!1)},{priority:"lowest"}),this.listenTo(i,"change",()=>{this.view.change(t=>{this.downcastDispatcher.convertChanges(i.differ,o,t),this.downcastDispatcher.convertSelection(n,o,t)})},{priority:"low"}),this.listenTo(this.view.document,"selectionChange",function(t,e){return(i,n)=>{const o=n.newSelection,r=[];for(const t of o.getRanges())r.push(e.toModelRange(t));const s=t.createSelection(r,{backward:o.isBackward});s.isEqual(t.document.selection)||t.change(t=>{t.setSelection(s)})}}(this.model,this.mapper)),this.downcastDispatcher.on("insert:$text",(t,e,i)=>{if(!i.consumable.consume(e.item,"insert"))return;const n=i.writer,o=i.mapper.toViewPosition(e.range.start),r=n.createText(e.item.data);n.insert(o,r)},{priority:"lowest"}),this.downcastDispatcher.on("remove",(t,e,i)=>{const n=i.mapper.toViewPosition(e.position),o=e.position.getShiftedBy(e.length),r=i.mapper.toViewPosition(o,{isPhantom:!0}),s=i.writer.createRange(n,r),a=i.writer.remove(s.getTrimmed());for(const t of i.writer.createRangeIn(a).getItems())i.mapper.unbindViewElement(t)},{priority:"low"}),this.downcastDispatcher.on("selection",(t,e,i)=>{const n=i.writer,o=n.document.selection;for(const t of o.getRanges())t.isCollapsed&&t.end.parent.isAttached()&&i.writer.mergeAttributes(t.start);n.setSelection(null)},{priority:"low"}),this.downcastDispatcher.on("selection",(t,e,i)=>{const n=e.selection;if(n.isCollapsed)return;if(!i.consumable.consume(n,"selection"))return;const o=[];for(const t of n.getRanges()){const e=i.mapper.toViewRange(t);o.push(e)}i.writer.setSelection(o,{backward:n.isBackward})},{priority:"low"}),this.downcastDispatcher.on("selection",(t,e,i)=>{const n=e.selection;if(!n.isCollapsed)return;if(!i.consumable.consume(n,"selection"))return;const o=i.writer,r=n.getFirstPosition(),s=i.mapper.toViewPosition(r),a=o.breakAttributes(s);o.setSelection(a)},{priority:"low"}),this.view.document.roots.bindTo(this.model.document.roots).using(t=>{if("$graveyard"==t.rootName)return null;const e=new ro(this.view.document,t.name);return e.rootName=t.rootName,this.mapper.bindElements(t,e),e})}destroy(){this.view.destroy(),this.stopListening()}}Kt(Wa,Ut);class $a{constructor(){this._commands=new Map}add(t,e){this._commands.set(t,e)}get(t){return this._commands.get(t)}execute(t,...e){const i=this.get(t);if(!i)throw new l.a("commandcollection-command-not-found",this,{commandName:t});return i.execute(...e)}*names(){yield*this._commands.keys()}*commands(){yield*this._commands.values()}[Symbol.iterator](){return this._commands[Symbol.iterator]()}destroy(){for(const t of this.commands())t.destroy()}}class Ga{constructor(){this._consumables=new Map}add(t,e){let i;t.is("$text")||t.is("documentFragment")?this._consumables.set(t,!0):(this._consumables.has(t)?i=this._consumables.get(t):(i=new Ya(t),this._consumables.set(t,i)),i.add(e))}test(t,e){const i=this._consumables.get(t);return void 0===i?null:t.is("$text")||t.is("documentFragment")?i:i.test(e)}consume(t,e){return!!this.test(t,e)&&(t.is("$text")||t.is("documentFragment")?this._consumables.set(t,!1):this._consumables.get(t).consume(e),!0)}revert(t,e){const i=this._consumables.get(t);void 0!==i&&(t.is("$text")||t.is("documentFragment")?this._consumables.set(t,!0):i.revert(e))}static consumablesFromElement(t){const e={element:t,name:!0,attributes:[],classes:[],styles:[]},i=t.getAttributeKeys();for(const t of i)"style"!=t&&"class"!=t&&e.attributes.push(t);const n=t.getClassNames();for(const t of n)e.classes.push(t);const o=t.getStyleNames();for(const t of o)e.styles.push(t);return e}static createFrom(t,e){if(e||(e=new Ga(t)),t.is("$text"))return e.add(t),e;t.is("element")&&e.add(t,Ga.consumablesFromElement(t)),t.is("documentFragment")&&e.add(t);for(const i of t.getChildren())e=Ga.createFrom(i,e);return e}}class Ya{constructor(t){this.element=t,this._canConsumeName=null,this._consumables={attributes:new Map,styles:new Map,classes:new Map}}add(t){t.name&&(this._canConsumeName=!0);for(const e in this._consumables)e in t&&this._add(e,t[e])}test(t){if(t.name&&!this._canConsumeName)return this._canConsumeName;for(const e in this._consumables)if(e in t){const i=this._test(e,t[e]);if(!0!==i)return i}return!0}consume(t){t.name&&(this._canConsumeName=!1);for(const e in this._consumables)e in t&&this._consume(e,t[e])}revert(t){t.name&&(this._canConsumeName=!0);for(const e in this._consumables)e in t&&this._revert(e,t[e])}_add(t,e){const i=_t(e)?e:[e],n=this._consumables[t];for(const e of i){if("attributes"===t&&("class"===e||"style"===e))throw new l.a("viewconsumable-invalid-attribute",this);if(n.set(e,!0),"styles"===t)for(const t of this.element.document.stylesProcessor.getRelatedStyles(e))n.set(t,!0)}}_test(t,e){const i=_t(e)?e:[e],n=this._consumables[t];for(const e of i)if("attributes"!==t||"class"!==e&&"style"!==e){const t=n.get(e);if(void 0===t)return null;if(!t)return!1}else{const t="class"==e?"classes":"styles",i=this._test(t,[...this._consumables[t].keys()]);if(!0!==i)return i}return!0}_consume(t,e){const i=_t(e)?e:[e],n=this._consumables[t];for(const e of i)if("attributes"!==t||"class"!==e&&"style"!==e){if(n.set(e,!1),"styles"==t)for(const t of this.element.document.stylesProcessor.getRelatedStyles(e))n.set(t,!1)}else{const t="class"==e?"classes":"styles";this._consume(t,[...this._consumables[t].keys()])}}_revert(t,e){const i=_t(e)?e:[e],n=this._consumables[t];for(const e of i)if("attributes"!==t||"class"!==e&&"style"!==e){!1===n.get(e)&&n.set(e,!0)}else{const t="class"==e?"classes":"styles";this._revert(t,[...this._consumables[t].keys()])}}}class Ka{constructor(){this._sourceDefinitions={},this._attributeProperties={},this.decorate("checkChild"),this.decorate("checkAttribute"),this.on("checkAttribute",(t,e)=>{e[0]=new Qa(e[0])},{priority:"highest"}),this.on("checkChild",(t,e)=>{e[0]=new Qa(e[0]),e[1]=this.getDefinition(e[1])},{priority:"highest"})}register(t,e){if(this._sourceDefinitions[t])throw new l.a("schema-cannot-register-item-twice",this,{itemName:t});this._sourceDefinitions[t]=[Object.assign({},e)],this._clearCache()}extend(t,e){if(!this._sourceDefinitions[t])throw new l.a("schema-cannot-extend-missing-item",this,{itemName:t});this._sourceDefinitions[t].push(Object.assign({},e)),this._clearCache()}getDefinitions(){return this._compiledDefinitions||this._compile(),this._compiledDefinitions}getDefinition(t){let e;return e="string"==typeof t?t:t.is&&(t.is("$text")||t.is("$textProxy"))?"$text":t.name,this.getDefinitions()[e]}isRegistered(t){return!!this.getDefinition(t)}isBlock(t){const e=this.getDefinition(t);return!(!e||!e.isBlock)}isLimit(t){const e=this.getDefinition(t);return!!e&&!(!e.isLimit&&!e.isObject)}isObject(t){const e=this.getDefinition(t);return!!e&&!!(e.isObject||e.isLimit&&e.isSelectable&&e.isContent)}isInline(t){const e=this.getDefinition(t);return!(!e||!e.isInline)}isSelectable(t){const e=this.getDefinition(t);return!!e&&!(!e.isSelectable&&!e.isObject)}isContent(t){const e=this.getDefinition(t);return!!e&&!(!e.isContent&&!e.isObject)}checkChild(t,e){return!!e&&this._checkContextMatch(e,t)}checkAttribute(t,e){const i=this.getDefinition(t.last);return!!i&&i.allowAttributes.includes(e)}checkMerge(t,e=null){if(t instanceof na){const e=t.nodeBefore,i=t.nodeAfter;if(!(e instanceof ta))throw new l.a("schema-check-merge-no-element-before",this);if(!(i instanceof ta))throw new l.a("schema-check-merge-no-element-after",this);return this.checkMerge(e,i)}for(const i of e.getChildren())if(!this.checkChild(t,i))return!1;return!0}addChildCheck(t){this.on("checkChild",(e,[i,n])=>{if(!n)return;const o=t(i,n);"boolean"==typeof o&&(e.stop(),e.return=o)},{priority:"high"})}addAttributeCheck(t){this.on("checkAttribute",(e,[i,n])=>{const o=t(i,n);"boolean"==typeof o&&(e.stop(),e.return=o)},{priority:"high"})}setAttributeProperties(t,e){this._attributeProperties[t]=Object.assign(this.getAttributeProperties(t),e)}getAttributeProperties(t){return this._attributeProperties[t]||{}}getLimitElement(t){let e;if(t instanceof na)e=t.parent;else{e=(t instanceof aa?[t]:Array.from(t.getRanges())).reduce((t,e)=>{const i=e.getCommonAncestor();return t?t.getCommonAncestor(i,{includeSelf:!0}):i},null)}for(;!this.isLimit(e)&&e.parent;)e=e.parent;return e}checkAttributeInSelection(t,e){if(t.isCollapsed){const i=[...t.getFirstPosition().getAncestors(),new Js("",t.getAttributes())];return this.checkAttribute(i,e)}{const i=t.getRanges();for(const t of i)for(const i of t)if(this.checkAttribute(i.item,e))return!0}return!1}*getValidRanges(t,e){t=function*(t){for(const e of t)yield*e.getMinimalFlatRanges()}(t);for(const i of t)yield*this._getValidRangesForRange(i,e)}getNearestSelectionRange(t,e="both"){if(this.checkChild(t,"$text"))return new aa(t);let i,n;const o=t.getAncestors().reverse().find(t=>this.isLimit(t))||t.root;"both"!=e&&"backward"!=e||(i=new ea({boundaries:aa._createIn(o),startPosition:t,direction:"backward"})),"both"!=e&&"forward"!=e||(n=new ea({boundaries:aa._createIn(o),startPosition:t}));for(const t of function*(t,e){let i=!1;for(;!i;){if(i=!0,t){const e=t.next();e.done||(i=!1,yield{walker:t,value:e.value})}if(e){const t=e.next();t.done||(i=!1,yield{walker:e,value:t.value})}}}(i,n)){const e=t.walker==i?"elementEnd":"elementStart",n=t.value;if(n.type==e&&this.isObject(n.item))return aa._createOn(n.item);if(this.checkChild(n.nextPosition,"$text"))return new aa(n.nextPosition)}return null}findAllowedParent(t,e){let i=t.parent;for(;i;){if(this.checkChild(i,e))return i;if(this.isLimit(i))return null;i=i.parent}return null}removeDisallowedAttributes(t,e){for(const i of t)if(i.is("$text"))cl(this,i,e);else{const t=aa._createIn(i).getPositions();for(const i of t){cl(this,i.nodeBefore||i.parent,e)}}}createContext(t){return new Qa(t)}_clearCache(){this._compiledDefinitions=null}_compile(){const t={},e=this._sourceDefinitions,i=Object.keys(e);for(const n of i)t[n]=Ja(e[n],n);for(const e of i)Za(t,e);for(const e of i)Xa(t,e);for(const e of i)tl(t,e);for(const e of i)el(t,e),il(t,e);for(const e of i)nl(t,e),ol(t,e),rl(t,e);this._compiledDefinitions=t}_checkContextMatch(t,e,i=e.length-1){const n=e.getItem(i);if(t.allowIn.includes(n.name)){if(0==i)return!0;{const t=this.getDefinition(n);return this._checkContextMatch(t,e,i-1)}}return!1}*_getValidRangesForRange(t,e){let i=t.start,n=t.start;for(const o of t.getItems({shallow:!0}))o.is("element")&&(yield*this._getValidRangesForRange(aa._createIn(o),e)),this.checkAttribute(o,e)||(i.isEqual(n)||(yield new aa(i,n)),i=na._createAfter(o)),n=na._createAfter(o);i.isEqual(n)||(yield new aa(i,n))}}Kt(Ka,Ut);class Qa{constructor(t){if(t instanceof Qa)return t;"string"==typeof t?t=[t]:Array.isArray(t)||(t=t.getAncestors({includeSelf:!0})),this._items=t.map(ll)}get length(){return this._items.length}get last(){return this._items[this._items.length-1]}[Symbol.iterator](){return this._items[Symbol.iterator]()}push(t){const e=new Qa([t]);return e._items=[...this._items,...e._items],e}getItem(t){return this._items[t]}*getNames(){yield*this._items.map(t=>t.name)}endsWith(t){return Array.from(this.getNames()).join(" ").endsWith(t)}startsWith(t){return Array.from(this.getNames()).join(" ").startsWith(t)}}function Ja(t,e){const i={name:e,allowIn:[],allowContentOf:[],allowWhere:[],allowAttributes:[],allowAttributesOf:[],allowChildren:[],inheritTypesFrom:[]};return function(t,e){for(const i of t){const t=Object.keys(i).filter(t=>t.startsWith("is"));for(const n of t)e[n]=i[n]}}(t,i),sl(t,i,"allowIn"),sl(t,i,"allowContentOf"),sl(t,i,"allowWhere"),sl(t,i,"allowAttributes"),sl(t,i,"allowAttributesOf"),sl(t,i,"allowChildren"),sl(t,i,"inheritTypesFrom"),function(t,e){for(const i of t){const t=i.inheritAllFrom;t&&(e.allowContentOf.push(t),e.allowWhere.push(t),e.allowAttributesOf.push(t),e.inheritTypesFrom.push(t))}}(t,i),i}function Za(t,e){const i=t[e];for(const n of i.allowChildren){const i=t[n];i&&i.allowIn.push(e)}i.allowChildren.length=0}function Xa(t,e){for(const i of t[e].allowContentOf)if(t[i]){al(t,i).forEach(t=>{t.allowIn.push(e)})}delete t[e].allowContentOf}function tl(t,e){for(const i of t[e].allowWhere){const n=t[i];if(n){const i=n.allowIn;t[e].allowIn.push(...i)}}delete t[e].allowWhere}function el(t,e){for(const i of t[e].allowAttributesOf){const n=t[i];if(n){const i=n.allowAttributes;t[e].allowAttributes.push(...i)}}delete t[e].allowAttributesOf}function il(t,e){const i=t[e];for(const e of i.inheritTypesFrom){const n=t[e];if(n){const t=Object.keys(n).filter(t=>t.startsWith("is"));for(const e of t)e in i||(i[e]=n[e])}}delete i.inheritTypesFrom}function nl(t,e){const i=t[e],n=i.allowIn.filter(e=>t[e]);i.allowIn=Array.from(new Set(n))}function ol(t,e){const i=t[e];for(const n of i.allowIn){t[n].allowChildren.push(e)}}function rl(t,e){const i=t[e];i.allowAttributes=Array.from(new Set(i.allowAttributes))}function sl(t,e,i){for(const n of t)"string"==typeof n[i]?e[i].push(n[i]):Array.isArray(n[i])&&e[i].push(...n[i])}function al(t,e){const i=t[e];return(n=t,Object.keys(n).map(t=>n[t])).filter(t=>t.allowIn.includes(i.name));var n}function ll(t){return"string"==typeof t||t.is("documentFragment")?{name:"string"==typeof t?t:"$documentFragment",*getAttributeKeys(){},getAttribute(){}}:{name:t.is("element")?t.name:"$text",*getAttributeKeys(){yield*t.getAttributeKeys()},getAttribute:e=>t.getAttribute(e)}}function cl(t,e,i){for(const n of e.getAttributeKeys())t.checkAttribute(e,n)||i.removeAttribute(n,e)}class dl{constructor(t={}){this._splitParts=new Map,this._cursorParents=new Map,this._modelCursor=null,this.conversionApi=Object.assign({},t),this.conversionApi.convertItem=this._convertItem.bind(this),this.conversionApi.convertChildren=this._convertChildren.bind(this),this.conversionApi.safeInsert=this._safeInsert.bind(this),this.conversionApi.updateConversionResult=this._updateConversionResult.bind(this),this.conversionApi.splitToAllowedParent=this._splitToAllowedParent.bind(this),this.conversionApi.getSplitParts=this._getSplitParts.bind(this)}convert(t,e,i=["$root"]){this.fire("viewCleanup",t),this._modelCursor=function(t,e){let i;for(const n of new Qa(t)){const t={};for(const e of n.getAttributeKeys())t[e]=n.getAttribute(e);const o=e.createElement(n.name,t);i&&e.append(o,i),i=na._createAt(o,0)}return i}(i,e),this.conversionApi.writer=e,this.conversionApi.consumable=Ga.createFrom(t),this.conversionApi.store={};const{modelRange:n}=this._convertItem(t,this._modelCursor),o=e.createDocumentFragment();if(n){this._removeEmptyElements();for(const t of Array.from(this._modelCursor.parent.getChildren()))e.append(t,o);o.markers=function(t,e){const i=new Set,n=new Map,o=aa._createIn(t).getItems();for(const t of o)"$marker"==t.name&&i.add(t);for(const t of i){const i=t.getAttribute("data-name"),o=e.createPositionBefore(t);n.has(i)?n.get(i).end=o.clone():n.set(i,new aa(o.clone())),e.remove(t)}return n}(o,e)}return this._modelCursor=null,this._splitParts.clear(),this._cursorParents.clear(),this.conversionApi.writer=null,this.conversionApi.store=null,o}_convertItem(t,e){const i=Object.assign({viewItem:t,modelCursor:e,modelRange:null});if(t.is("element")?this.fire("element:"+t.name,i,this.conversionApi):t.is("$text")?this.fire("text",i,this.conversionApi):this.fire("documentFragment",i,this.conversionApi),i.modelRange&&!(i.modelRange instanceof aa))throw new l.a("view-conversion-dispatcher-incorrect-result",this);return{modelRange:i.modelRange,modelCursor:i.modelCursor}}_convertChildren(t,e){let i=e.is("position")?e:na._createAt(e,0);const n=new aa(i);for(const e of Array.from(t.getChildren())){const t=this._convertItem(e,i);t.modelRange instanceof aa&&(n.end=t.modelRange.end,i=t.modelCursor)}return{modelRange:n,modelCursor:i}}_safeInsert(t,e){const i=this._splitToAllowedParent(t,e);return!!i&&(this.conversionApi.writer.insert(t,i.position),!0)}_updateConversionResult(t,e){const i=this._getSplitParts(t),n=this.conversionApi.writer;e.modelRange||(e.modelRange=n.createRange(n.createPositionBefore(t),n.createPositionAfter(i[i.length-1])));const o=this._cursorParents.get(t);e.modelCursor=o?n.createPositionAt(o,0):e.modelRange.end}_splitToAllowedParent(t,e){const{schema:i,writer:n}=this.conversionApi;let o=i.findAllowedParent(e,t);if(o){if(o===e.parent)return{position:e};this._modelCursor.parent.getAncestors().includes(o)&&(o=null)}if(!o)return za(e,t,i)?{position:Da(e,n)}:null;const r=this.conversionApi.writer.split(e,o),s=[];for(const t of r.range.getWalker())if("elementEnd"==t.type)s.push(t.item);else{const e=s.pop(),i=t.item;this._registerSplitPair(e,i)}const a=r.range.end.parent;return this._cursorParents.set(t,a),{position:r.position,cursorParent:a}}_registerSplitPair(t,e){this._splitParts.has(t)||this._splitParts.set(t,[t]);const i=this._splitParts.get(t);this._splitParts.set(e,i),i.push(e)}_getSplitParts(t){let e;return e=this._splitParts.has(t)?this._splitParts.get(t):[t],e}_removeEmptyElements(){let t=!1;for(const e of this._splitParts.keys())e.isEmpty&&(this.conversionApi.writer.remove(e),this._splitParts.delete(e),t=!0);t&&this._removeEmptyElements()}}Kt(dl,h);class hl{getHtml(t){const e=document.implementation.createHTMLDocument("").createElement("div");return e.appendChild(t),e.innerHTML}}class ul{constructor(t){this._domParser=new DOMParser,this._domConverter=new Tr(t,{blockFillerMode:"nbsp"}),this._htmlWriter=new hl}toData(t){const e=this._domConverter.viewToDom(t,document);return this._htmlWriter.getHtml(e)}toView(t){const e=this._toDom(t);return this._domConverter.domToView(e)}registerRawContentMatcher(t){this._domConverter.registerRawContentMatcher(t)}useFillerType(t){this._domConverter.blockFillerMode="marked"==t?"markedNbsp":"nbsp"}_toDom(t){const e=this._domParser.parseFromString(t,"text/html"),i=e.createDocumentFragment(),n=e.body.childNodes;for(;n.length>0;)i.appendChild(n[0]);return i}}class ml{constructor(t,e){this.model=t,this.mapper=new la,this.downcastDispatcher=new ha({mapper:this.mapper,schema:t.schema}),this.downcastDispatcher.on("insert:$text",(t,e,i)=>{if(!i.consumable.consume(e.item,"insert"))return;const n=i.writer,o=i.mapper.toViewPosition(e.range.start),r=n.createText(e.item.data);n.insert(o,r)},{priority:"lowest"}),this.upcastDispatcher=new dl({schema:t.schema}),this.viewDocument=new vo(e),this.stylesProcessor=e,this.htmlProcessor=new ul(this.viewDocument),this.processor=this.htmlProcessor,this._viewWriter=new qo(this.viewDocument),this.upcastDispatcher.on("text",(t,e,{schema:i,consumable:n,writer:o})=>{let r=e.modelCursor;if(!n.test(e.viewItem))return;if(!i.checkChild(r,"$text")){if(!za(r,"$text",i))return;r=Da(r,o)}n.consume(e.viewItem);const s=o.createText(e.viewItem.data);o.insert(s,r),e.modelRange=o.createRange(r,r.getShiftedBy(s.offsetSize)),e.modelCursor=e.modelRange.end},{priority:"lowest"}),this.upcastDispatcher.on("element",(t,e,i)=>{if(!e.modelRange&&i.consumable.consume(e.viewItem,{name:!0})){const{modelRange:t,modelCursor:n}=i.convertChildren(e.viewItem,e.modelCursor);e.modelRange=t,e.modelCursor=n}},{priority:"lowest"}),this.upcastDispatcher.on("documentFragment",(t,e,i)=>{if(!e.modelRange&&i.consumable.consume(e.viewItem,{name:!0})){const{modelRange:t,modelCursor:n}=i.convertChildren(e.viewItem,e.modelCursor);e.modelRange=t,e.modelCursor=n}},{priority:"lowest"}),this.decorate("init"),this.decorate("set"),this.on("init",()=>{this.fire("ready")},{priority:"lowest"}),this.on("ready",()=>{this.model.enqueueChange("transparent",Oa)},{priority:"lowest"})}get(t={}){const{rootName:e="main",trim:i="empty"}=t;if(!this._checkIfRootsExists([e]))throw new l.a("datacontroller-get-non-existent-root",this);const n=this.model.document.getRoot(e);return"empty"!==i||this.model.hasContent(n,{ignoreWhitespaces:!0})?this.stringify(n,t):""}stringify(t,e={}){const i=this.toView(t,e);return this.processor.toData(i)}toView(t,e={}){const i=this.viewDocument,n=this._viewWriter;this.mapper.clearBindings();const o=aa._createIn(t),r=new Uo(i);this.mapper.bindElements(t,r),this.downcastDispatcher.conversionApi.options=e,this.downcastDispatcher.convertInsert(o,n);const s=t.is("documentFragment")?Array.from(t.markers):function(t){const e=[],i=t.root.document;if(!i)return[];const n=aa._createIn(t);for(const t of i.model.markers){const i=n.getIntersection(t.getRange());i&&e.push([t.name,i])}return e}(t);for(const[t,e]of s)this.downcastDispatcher.convertMarkerAdd(t,e,n);return delete this.downcastDispatcher.conversionApi.options,r}init(t){if(this.model.document.version)throw new l.a("datacontroller-init-document-not-empty",this);let e={};if("string"==typeof t?e.main=t:e=t,!this._checkIfRootsExists(Object.keys(e)))throw new l.a("datacontroller-init-non-existent-root",this);return this.model.enqueueChange("transparent",t=>{for(const i of Object.keys(e)){const n=this.model.document.getRoot(i);t.insert(this.parse(e[i],n),n,0)}}),Promise.resolve()}set(t){let e={};if("string"==typeof t?e.main=t:e=t,!this._checkIfRootsExists(Object.keys(e)))throw new l.a("datacontroller-set-non-existent-root",this);this.model.enqueueChange("transparent",t=>{t.setSelection(null),t.removeSelectionAttribute(this.model.document.selection.getAttributeKeys());for(const i of Object.keys(e)){const n=this.model.document.getRoot(i);t.remove(t.createRangeIn(n)),t.insert(this.parse(e[i],n),n,0)}})}parse(t,e="$root"){const i=this.processor.toView(t);return this.toModel(i,e)}toModel(t,e="$root"){return this.model.change(i=>this.upcastDispatcher.convert(t,i,e))}addStyleProcessorRules(t){t(this.stylesProcessor)}registerRawContentMatcher(t){this.processor&&this.processor!==this.htmlProcessor&&this.processor.registerRawContentMatcher(t),this.htmlProcessor.registerRawContentMatcher(t)}destroy(){this.stopListening()}_checkIfRootsExists(t){for(const e of t)if(!this.model.document.getRootNames().includes(e))return!1;return!0}}Kt(ml,Ut);class gl{constructor(t,e){this._helpers=new Map,this._downcast=tn(t),this._createConversionHelpers({name:"downcast",dispatchers:this._downcast,isDowncast:!0}),this._upcast=tn(e),this._createConversionHelpers({name:"upcast",dispatchers:this._upcast,isDowncast:!1})}addAlias(t,e){const i=this._downcast.includes(e);if(!this._upcast.includes(e)&&!i)throw new l.a("conversion-add-alias-dispatcher-not-registered",this);this._createConversionHelpers({name:t,dispatchers:[e],isDowncast:i})}for(t){if(!this._helpers.has(t))throw new l.a("conversion-for-unknown-group",this);return this._helpers.get(t)}elementToElement(t){this.for("downcast").elementToElement(t);for(const{model:e,view:i}of fl(t))this.for("upcast").elementToElement({model:e,view:i,converterPriority:t.converterPriority})}attributeToElement(t){this.for("downcast").attributeToElement(t);for(const{model:e,view:i}of fl(t))this.for("upcast").elementToAttribute({view:i,model:e,converterPriority:t.converterPriority})}attributeToAttribute(t){this.for("downcast").attributeToAttribute(t);for(const{model:e,view:i}of fl(t))this.for("upcast").attributeToAttribute({view:i,model:e})}_createConversionHelpers({name:t,dispatchers:e,isDowncast:i}){if(this._helpers.has(t))throw new l.a("conversion-group-exists",this);const n=i?new Pa(e):new Va(e);this._helpers.set(t,n)}}function*fl(t){if(t.model.values)for(const e of t.model.values){const i={key:t.model.key,value:e},n=t.view[e],o=t.upcastAlso?t.upcastAlso[e]:void 0;yield*pl(i,n,o)}else yield*pl(t.model,t.view,t.upcastAlso)}function*pl(t,e,i){if(yield{model:t,view:e},i)for(const e of tn(i))yield{model:t,view:e}}class wl{constructor(t="default"){this.operations=[],this.type=t}get baseVersion(){for(const t of this.operations)if(null!==t.baseVersion)return t.baseVersion;return null}addOperation(t){return t.batch=this,this.operations.push(t),t}}class bl{constructor(t){this.baseVersion=t,this.isDocumentOperation=null!==this.baseVersion,this.batch=null}_validate(){}toJSON(){const t=Object.assign({},this);return t.__className=this.constructor.className,delete t.batch,delete t.isDocumentOperation,t}static get className(){return"Operation"}static fromJSON(t){return new this(t.baseVersion)}}class kl{constructor(t){this.markers=new Map,this._children=new Xs,t&&this._insertChild(0,t)}[Symbol.iterator](){return this.getChildren()}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}get root(){return this}get parent(){return null}is(t){return"documentFragment"===t||"model:documentFragment"===t}getChild(t){return this._children.getNode(t)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(t){return this._children.getNodeIndex(t)}getChildStartOffset(t){return this._children.getNodeStartOffset(t)}getPath(){return[]}getNodeByPath(t){let e=this;for(const i of t)e=e.getChild(e.offsetToIndex(i));return e}offsetToIndex(t){return this._children.offsetToIndex(t)}toJSON(){const t=[];for(const e of this._children)t.push(e.toJSON());return t}static fromJSON(t){const e=[];for(const i of t)i.name?e.push(ta.fromJSON(i)):e.push(Js.fromJSON(i));return new kl(e)}_appendChild(t){this._insertChild(this.childCount,t)}_insertChild(t,e){const i=function(t){if("string"==typeof t)return[new Js(t)];Ji(t)||(t=[t]);return Array.from(t).map(t=>"string"==typeof t?new Js(t):t instanceof Zs?new Js(t.data,t.getAttributes()):t)}(e);for(const t of i)null!==t.parent&&t._remove(),t.parent=this;this._children._insertNodes(t,i)}_removeChildren(t,e=1){const i=this._children._removeNodes(t,e);for(const t of i)t.parent=null;return i}}function _l(t,e){const i=(e=xl(e)).reduce((t,e)=>t+e.offsetSize,0),n=t.parent;Cl(t);const o=t.index;return n._insertChild(o,e),Al(n,o+e.length),Al(n,o),new aa(t,t.getShiftedBy(i))}function vl(t){if(!t.isFlat)throw new l.a("operation-utils-remove-range-not-flat",this);const e=t.start.parent;Cl(t.start),Cl(t.end);const i=e._removeChildren(t.start.index,t.end.index-t.start.index);return Al(e,t.start.index),i}function yl(t,e){if(!t.isFlat)throw new l.a("operation-utils-move-range-not-flat",this);const i=vl(t);return _l(e=e._getTransformedByDeletion(t.start,t.end.offset-t.start.offset),i)}function xl(t){const e=[];t instanceof Array||(t=[t]);for(let i=0;i<t.length;i++)if("string"==typeof t[i])e.push(new Js(t[i]));else if(t[i]instanceof Zs)e.push(new Js(t[i].data,t[i].getAttributes()));else if(t[i]instanceof kl||t[i]instanceof Xs)for(const n of t[i])e.push(n);else t[i]instanceof Qs&&e.push(t[i]);for(let t=1;t<e.length;t++){const i=e[t],n=e[t-1];i instanceof Js&&n instanceof Js&&Tl(i,n)&&(e.splice(t-1,2,new Js(n.data+i.data,n.getAttributes())),t--)}return e}function Al(t,e){const i=t.getChild(e-1),n=t.getChild(e);if(i&&n&&i.is("$text")&&n.is("$text")&&Tl(i,n)){const o=new Js(i.data+n.data,i.getAttributes());t._removeChildren(e-1,2),t._insertChild(e-1,o)}}function Cl(t){const e=t.textNode,i=t.parent;if(e){const n=t.offset-e.startOffset,o=e.index;i._removeChildren(o,1);const r=new Js(e.data.substr(0,n),e.getAttributes()),s=new Js(e.data.substr(n),e.getAttributes());i._insertChild(o,[r,s])}}function Tl(t,e){const i=t.getAttributes(),n=e.getAttributes();for(const t of i){if(t[1]!==e.getAttribute(t[0]))return!1;n.next()}return n.next().done}var El=function(t,e){return Jr(t,e)};class Pl extends bl{constructor(t,e,i,n,o){super(o),this.range=t.clone(),this.key=e,this.oldValue=void 0===i?null:i,this.newValue=void 0===n?null:n}get type(){return null===this.oldValue?"addAttribute":null===this.newValue?"removeAttribute":"changeAttribute"}clone(){return new Pl(this.range,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new Pl(this.range,this.key,this.newValue,this.oldValue,this.baseVersion+1)}toJSON(){const t=super.toJSON();return t.range=this.range.toJSON(),t}_validate(){if(!this.range.isFlat)throw new l.a("attribute-operation-range-not-flat",this);for(const t of this.range.getItems({shallow:!0})){if(null!==this.oldValue&&!El(t.getAttribute(this.key),this.oldValue))throw new l.a("attribute-operation-wrong-old-value",this,{item:t,key:this.key,value:this.oldValue});if(null===this.oldValue&&null!==this.newValue&&t.hasAttribute(this.key))throw new l.a("attribute-operation-attribute-exists",this,{node:t,key:this.key})}}_execute(){El(this.oldValue,this.newValue)||function(t,e,i){Cl(t.start),Cl(t.end);for(const n of t.getItems({shallow:!0})){const t=n.is("$textProxy")?n.textNode:n;null!==i?t._setAttribute(e,i):t._removeAttribute(e),Al(t.parent,t.index)}Al(t.end.parent,t.end.index)}(this.range,this.key,this.newValue)}static get className(){return"AttributeOperation"}static fromJSON(t,e){return new Pl(aa.fromJSON(t.range,e),t.key,t.oldValue,t.newValue,t.baseVersion)}}class Sl extends bl{constructor(t,e){super(null),this.sourcePosition=t.clone(),this.howMany=e}get type(){return"detach"}toJSON(){const t=super.toJSON();return t.sourcePosition=this.sourcePosition.toJSON(),t}_validate(){if(this.sourcePosition.root.document)throw new l.a("detach-operation-on-document-node",this)}_execute(){vl(aa._createFromPositionAndShift(this.sourcePosition,this.howMany))}static get className(){return"DetachOperation"}}class Ml extends bl{constructor(t,e,i,n){super(n),this.sourcePosition=t.clone(),this.sourcePosition.stickiness="toNext",this.howMany=e,this.targetPosition=i.clone(),this.targetPosition.stickiness="toNone"}get type(){return"$graveyard"==this.targetPosition.root.rootName?"remove":"$graveyard"==this.sourcePosition.root.rootName?"reinsert":"move"}clone(){return new this.constructor(this.sourcePosition,this.howMany,this.targetPosition,this.baseVersion)}getMovedRangeStart(){return this.targetPosition._getTransformedByDeletion(this.sourcePosition,this.howMany)}getReversed(){const t=this.sourcePosition._getTransformedByInsertion(this.targetPosition,this.howMany);return new this.constructor(this.getMovedRangeStart(),this.howMany,t,this.baseVersion+1)}_validate(){const t=this.sourcePosition.parent,e=this.targetPosition.parent,i=this.sourcePosition.offset,n=this.targetPosition.offset;if(i+this.howMany>t.maxOffset)throw new l.a("move-operation-nodes-do-not-exist",this);if(t===e&&i<n&&n<i+this.howMany)throw new l.a("move-operation-range-into-itself",this);if(this.sourcePosition.root==this.targetPosition.root&&"prefix"==ln(this.sourcePosition.getParentPath(),this.targetPosition.getParentPath())){const t=this.sourcePosition.path.length-1;if(this.targetPosition.path[t]>=i&&this.targetPosition.path[t]<i+this.howMany)throw new l.a("move-operation-node-into-itself",this)}}_execute(){yl(aa._createFromPositionAndShift(this.sourcePosition,this.howMany),this.targetPosition)}toJSON(){const t=super.toJSON();return t.sourcePosition=this.sourcePosition.toJSON(),t.targetPosition=this.targetPosition.toJSON(),t}static get className(){return"MoveOperation"}static fromJSON(t,e){const i=na.fromJSON(t.sourcePosition,e),n=na.fromJSON(t.targetPosition,e);return new this(i,t.howMany,n,t.baseVersion)}}class Il extends bl{constructor(t,e,i){super(i),this.position=t.clone(),this.position.stickiness="toNone",this.nodes=new Xs(xl(e)),this.shouldReceiveAttributes=!1}get type(){return"insert"}get howMany(){return this.nodes.maxOffset}clone(){const t=new Xs([...this.nodes].map(t=>t._clone(!0))),e=new Il(this.position,t,this.baseVersion);return e.shouldReceiveAttributes=this.shouldReceiveAttributes,e}getReversed(){const t=this.position.root.document.graveyard,e=new na(t,[0]);return new Ml(this.position,this.nodes.maxOffset,e,this.baseVersion+1)}_validate(){const t=this.position.parent;if(!t||t.maxOffset<this.position.offset)throw new l.a("insert-operation-position-invalid",this)}_execute(){const t=this.nodes;this.nodes=new Xs([...t].map(t=>t._clone(!0))),_l(this.position,t)}toJSON(){const t=super.toJSON();return t.position=this.position.toJSON(),t.nodes=this.nodes.toJSON(),t}static get className(){return"InsertOperation"}static fromJSON(t,e){const i=[];for(const e of t.nodes)e.name?i.push(ta.fromJSON(e)):i.push(Js.fromJSON(e));const n=new Il(na.fromJSON(t.position,e),i,t.baseVersion);return n.shouldReceiveAttributes=t.shouldReceiveAttributes,n}}class Ll extends bl{constructor(t,e,i,n,o,r){super(r),this.name=t,this.oldRange=e?e.clone():null,this.newRange=i?i.clone():null,this.affectsData=o,this._markers=n}get type(){return"marker"}clone(){return new Ll(this.name,this.oldRange,this.newRange,this._markers,this.affectsData,this.baseVersion)}getReversed(){return new Ll(this.name,this.newRange,this.oldRange,this._markers,this.affectsData,this.baseVersion+1)}_execute(){const t=this.newRange?"_set":"_remove";this._markers[t](this.name,this.newRange,!0,this.affectsData)}toJSON(){const t=super.toJSON();return this.oldRange&&(t.oldRange=this.oldRange.toJSON()),this.newRange&&(t.newRange=this.newRange.toJSON()),delete t._markers,t}static get className(){return"MarkerOperation"}static fromJSON(t,e){return new Ll(t.name,t.oldRange?aa.fromJSON(t.oldRange,e):null,t.newRange?aa.fromJSON(t.newRange,e):null,e.model.markers,t.affectsData,t.baseVersion)}}class Nl extends bl{constructor(t,e,i,n){super(n),this.position=t,this.position.stickiness="toNext",this.oldName=e,this.newName=i}get type(){return"rename"}clone(){return new Nl(this.position.clone(),this.oldName,this.newName,this.baseVersion)}getReversed(){return new Nl(this.position.clone(),this.newName,this.oldName,this.baseVersion+1)}_validate(){const t=this.position.nodeAfter;if(!(t instanceof ta))throw new l.a("rename-operation-wrong-position",this);if(t.name!==this.oldName)throw new l.a("rename-operation-wrong-name",this)}_execute(){this.position.nodeAfter.name=this.newName}toJSON(){const t=super.toJSON();return t.position=this.position.toJSON(),t}static get className(){return"RenameOperation"}static fromJSON(t,e){return new Nl(na.fromJSON(t.position,e),t.oldName,t.newName,t.baseVersion)}}class Rl extends bl{constructor(t,e,i,n,o){super(o),this.root=t,this.key=e,this.oldValue=i,this.newValue=n}get type(){return null===this.oldValue?"addRootAttribute":null===this.newValue?"removeRootAttribute":"changeRootAttribute"}clone(){return new Rl(this.root,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new Rl(this.root,this.key,this.newValue,this.oldValue,this.baseVersion+1)}_validate(){if(this.root!=this.root.root||this.root.is("documentFragment"))throw new l.a("rootattribute-operation-not-a-root",this,{root:this.root,key:this.key});if(null!==this.oldValue&&this.root.getAttribute(this.key)!==this.oldValue)throw new l.a("rootattribute-operation-wrong-old-value",this,{root:this.root,key:this.key});if(null===this.oldValue&&null!==this.newValue&&this.root.hasAttribute(this.key))throw new l.a("rootattribute-operation-attribute-exists",this,{root:this.root,key:this.key})}_execute(){null!==this.newValue?this.root._setAttribute(this.key,this.newValue):this.root._removeAttribute(this.key)}toJSON(){const t=super.toJSON();return t.root=this.root.toJSON(),t}static get className(){return"RootAttributeOperation"}static fromJSON(t,e){if(!e.getRoot(t.root))throw new l.a("rootattribute-operation-fromjson-no-root",this,{rootName:t.root});return new Rl(e.getRoot(t.root),t.key,t.oldValue,t.newValue,t.baseVersion)}}class Ol extends bl{constructor(t,e,i,n,o){super(o),this.sourcePosition=t.clone(),this.sourcePosition.stickiness="toPrevious",this.howMany=e,this.targetPosition=i.clone(),this.targetPosition.stickiness="toNext",this.graveyardPosition=n.clone()}get type(){return"merge"}get deletionPosition(){return new na(this.sourcePosition.root,this.sourcePosition.path.slice(0,-1))}get movedRange(){const t=this.sourcePosition.getShiftedBy(Number.POSITIVE_INFINITY);return new aa(this.sourcePosition,t)}clone(){return new this.constructor(this.sourcePosition,this.howMany,this.targetPosition,this.graveyardPosition,this.baseVersion)}getReversed(){const t=this.targetPosition._getTransformedByMergeOperation(this),e=this.sourcePosition.path.slice(0,-1),i=new na(this.sourcePosition.root,e)._getTransformedByMergeOperation(this);return new zl(t,this.howMany,i,this.graveyardPosition,this.baseVersion+1)}_validate(){const t=this.sourcePosition.parent,e=this.targetPosition.parent;if(!t.parent)throw new l.a("merge-operation-source-position-invalid",this);if(!e.parent)throw new l.a("merge-operation-target-position-invalid",this);if(this.howMany!=t.maxOffset)throw new l.a("merge-operation-how-many-invalid",this)}_execute(){const t=this.sourcePosition.parent;yl(aa._createIn(t),this.targetPosition),yl(aa._createOn(t),this.graveyardPosition)}toJSON(){const t=super.toJSON();return t.sourcePosition=t.sourcePosition.toJSON(),t.targetPosition=t.targetPosition.toJSON(),t.graveyardPosition=t.graveyardPosition.toJSON(),t}static get className(){return"MergeOperation"}static fromJSON(t,e){const i=na.fromJSON(t.sourcePosition,e),n=na.fromJSON(t.targetPosition,e),o=na.fromJSON(t.graveyardPosition,e);return new this(i,t.howMany,n,o,t.baseVersion)}}class zl extends bl{constructor(t,e,i,n,o){super(o),this.splitPosition=t.clone(),this.splitPosition.stickiness="toNext",this.howMany=e,this.insertionPosition=i,this.graveyardPosition=n?n.clone():null,this.graveyardPosition&&(this.graveyardPosition.stickiness="toNext")}get type(){return"split"}get moveTargetPosition(){const t=this.insertionPosition.path.slice();return t.push(0),new na(this.insertionPosition.root,t)}get movedRange(){const t=this.splitPosition.getShiftedBy(Number.POSITIVE_INFINITY);return new aa(this.splitPosition,t)}clone(){return new this.constructor(this.splitPosition,this.howMany,this.insertionPosition,this.graveyardPosition,this.baseVersion)}getReversed(){const t=this.splitPosition.root.document.graveyard,e=new na(t,[0]);return new Ol(this.moveTargetPosition,this.howMany,this.splitPosition,e,this.baseVersion+1)}_validate(){const t=this.splitPosition.parent,e=this.splitPosition.offset;if(!t||t.maxOffset<e)throw new l.a("split-operation-position-invalid",this);if(!t.parent)throw new l.a("split-operation-split-in-root",this);if(this.howMany!=t.maxOffset-this.splitPosition.offset)throw new l.a("split-operation-how-many-invalid",this);if(this.graveyardPosition&&!this.graveyardPosition.nodeAfter)throw new l.a("split-operation-graveyard-position-invalid",this)}_execute(){const t=this.splitPosition.parent;if(this.graveyardPosition)yl(aa._createFromPositionAndShift(this.graveyardPosition,1),this.insertionPosition);else{const e=t._clone();_l(this.insertionPosition,e)}yl(new aa(na._createAt(t,this.splitPosition.offset),na._createAt(t,t.maxOffset)),this.moveTargetPosition)}toJSON(){const t=super.toJSON();return t.splitPosition=this.splitPosition.toJSON(),t.insertionPosition=this.insertionPosition.toJSON(),this.graveyardPosition&&(t.graveyardPosition=this.graveyardPosition.toJSON()),t}static get className(){return"SplitOperation"}static getInsertionPosition(t){const e=t.path.slice(0,-1);return e[e.length-1]++,new na(t.root,e,"toPrevious")}static fromJSON(t,e){const i=na.fromJSON(t.splitPosition,e),n=na.fromJSON(t.insertionPosition,e),o=t.graveyardPosition?na.fromJSON(t.graveyardPosition,e):null;return new this(i,t.howMany,n,o,t.baseVersion)}}class Dl extends ta{constructor(t,e,i="main"){super(e),this._document=t,this.rootName=i}get document(){return this._document}is(t,e){return e?e===this.name&&("rootElement"===t||"model:rootElement"===t||"element"===t||"model:element"===t):"rootElement"===t||"model:rootElement"===t||"element"===t||"model:element"===t||"node"===t||"model:node"===t}toJSON(){return this.rootName}}class Vl{constructor(t,e){this.model=t,this.batch=e}createText(t,e){return new Js(t,e)}createElement(t,e){return new ta(t,e)}createDocumentFragment(){return new kl}cloneElement(t,e=!0){return t._clone(e)}insert(t,e,i=0){if(this._assertWriterUsedCorrectly(),t instanceof Js&&""==t.data)return;const n=na._createAt(e,i);if(t.parent){if(Ul(t.root,n.root))return void this.move(aa._createOn(t),n);if(t.root.document)throw new l.a("model-writer-insert-forbidden-move",this);this.remove(t)}const o=n.root.document?n.root.document.version:null,r=new Il(n,t,o);if(t instanceof Js&&(r.shouldReceiveAttributes=!0),this.batch.addOperation(r),this.model.applyOperation(r),t instanceof kl)for(const[e,i]of t.markers){const t=na._createAt(i.root,0),o={range:new aa(i.start._getCombined(t,n),i.end._getCombined(t,n)),usingOperation:!0,affectsData:!0};this.model.markers.has(e)?this.updateMarker(e,o):this.addMarker(e,o)}}insertText(t,e,i,n){e instanceof kl||e instanceof ta||e instanceof na?this.insert(this.createText(t),e,i):this.insert(this.createText(t,e),i,n)}insertElement(t,e,i,n){e instanceof kl||e instanceof ta||e instanceof na?this.insert(this.createElement(t),e,i):this.insert(this.createElement(t,e),i,n)}append(t,e){this.insert(t,e,"end")}appendText(t,e,i){e instanceof kl||e instanceof ta?this.insert(this.createText(t),e,"end"):this.insert(this.createText(t,e),i,"end")}appendElement(t,e,i){e instanceof kl||e instanceof ta?this.insert(this.createElement(t),e,"end"):this.insert(this.createElement(t,e),i,"end")}setAttribute(t,e,i){if(this._assertWriterUsedCorrectly(),i instanceof aa){const n=i.getMinimalFlatRanges();for(const i of n)jl(this,t,e,i)}else Bl(this,t,e,i)}setAttributes(t,e){for(const[i,n]of mn(t))this.setAttribute(i,n,e)}removeAttribute(t,e){if(this._assertWriterUsedCorrectly(),e instanceof aa){const i=e.getMinimalFlatRanges();for(const e of i)jl(this,t,null,e)}else Bl(this,t,null,e)}clearAttributes(t){this._assertWriterUsedCorrectly();const e=t=>{for(const e of t.getAttributeKeys())this.removeAttribute(e,t)};if(t instanceof aa)for(const i of t.getItems())e(i);else e(t)}move(t,e,i){if(this._assertWriterUsedCorrectly(),!(t instanceof aa))throw new l.a("writer-move-invalid-range",this);if(!t.isFlat)throw new l.a("writer-move-range-not-flat",this);const n=na._createAt(e,i);if(n.isEqual(t.start))return;if(this._addOperationForAffectedMarkers("move",t),!Ul(t.root,n.root))throw new l.a("writer-move-different-document",this);const o=t.root.document?t.root.document.version:null,r=new Ml(t.start,t.end.offset-t.start.offset,n,o);this.batch.addOperation(r),this.model.applyOperation(r)}remove(t){this._assertWriterUsedCorrectly();const e=(t instanceof aa?t:aa._createOn(t)).getMinimalFlatRanges().reverse();for(const t of e)this._addOperationForAffectedMarkers("move",t),Hl(t.start,t.end.offset-t.start.offset,this.batch,this.model)}merge(t){this._assertWriterUsedCorrectly();const e=t.nodeBefore,i=t.nodeAfter;if(this._addOperationForAffectedMarkers("merge",t),!(e instanceof ta))throw new l.a("writer-merge-no-element-before",this);if(!(i instanceof ta))throw new l.a("writer-merge-no-element-after",this);t.root.document?this._merge(t):this._mergeDetached(t)}createPositionFromPath(t,e,i){return this.model.createPositionFromPath(t,e,i)}createPositionAt(t,e){return this.model.createPositionAt(t,e)}createPositionAfter(t){return this.model.createPositionAfter(t)}createPositionBefore(t){return this.model.createPositionBefore(t)}createRange(t,e){return this.model.createRange(t,e)}createRangeIn(t){return this.model.createRangeIn(t)}createRangeOn(t){return this.model.createRangeOn(t)}createSelection(t,e,i){return this.model.createSelection(t,e,i)}_mergeDetached(t){const e=t.nodeBefore,i=t.nodeAfter;this.move(aa._createIn(i),na._createAt(e,"end")),this.remove(i)}_merge(t){const e=na._createAt(t.nodeBefore,"end"),i=na._createAt(t.nodeAfter,0),n=t.root.document.graveyard,o=new na(n,[0]),r=t.root.document.version,s=new Ol(i,t.nodeAfter.maxOffset,e,o,r);this.batch.addOperation(s),this.model.applyOperation(s)}rename(t,e){if(this._assertWriterUsedCorrectly(),!(t instanceof ta))throw new l.a("writer-rename-not-element-instance",this);const i=t.root.document?t.root.document.version:null,n=new Nl(na._createBefore(t),t.name,e,i);this.batch.addOperation(n),this.model.applyOperation(n)}split(t,e){this._assertWriterUsedCorrectly();let i,n,o=t.parent;if(!o.parent)throw new l.a("writer-split-element-no-parent",this);if(e||(e=o.parent),!t.parent.getAncestors({includeSelf:!0}).includes(e))throw new l.a("writer-split-invalid-limit-element",this);do{const e=o.root.document?o.root.document.version:null,r=o.maxOffset-t.offset,s=zl.getInsertionPosition(t),a=new zl(t,r,s,null,e);this.batch.addOperation(a),this.model.applyOperation(a),i||n||(i=o,n=t.parent.nextSibling),o=(t=this.createPositionAfter(t.parent)).parent}while(o!==e);return{position:t,range:new aa(na._createAt(i,"end"),na._createAt(n,0))}}wrap(t,e){if(this._assertWriterUsedCorrectly(),!t.isFlat)throw new l.a("writer-wrap-range-not-flat",this);const i=e instanceof ta?e:new ta(e);if(i.childCount>0)throw new l.a("writer-wrap-element-not-empty",this);if(null!==i.parent)throw new l.a("writer-wrap-element-attached",this);this.insert(i,t.start);const n=new aa(t.start.getShiftedBy(1),t.end.getShiftedBy(1));this.move(n,na._createAt(i,0))}unwrap(t){if(this._assertWriterUsedCorrectly(),null===t.parent)throw new l.a("writer-unwrap-element-no-parent",this);this.move(aa._createIn(t),this.createPositionAfter(t)),this.remove(t)}addMarker(t,e){if(this._assertWriterUsedCorrectly(),!e||"boolean"!=typeof e.usingOperation)throw new l.a("writer-addmarker-no-usingoperation",this);const i=e.usingOperation,n=e.range,o=void 0!==e.affectsData&&e.affectsData;if(this.model.markers.has(t))throw new l.a("writer-addmarker-marker-exists",this);if(!n)throw new l.a("writer-addmarker-no-range",this);return i?(Fl(this,t,null,n,o),this.model.markers.get(t)):this.model.markers._set(t,n,i,o)}updateMarker(t,e){this._assertWriterUsedCorrectly();const i="string"==typeof t?t:t.name,n=this.model.markers.get(i);if(!n)throw new l.a("writer-updatemarker-marker-not-exists",this);if(!e)return void this.model.markers._refresh(n);const o="boolean"==typeof e.usingOperation,r="boolean"==typeof e.affectsData,s=r?e.affectsData:n.affectsData;if(!o&&!e.range&&!r)throw new l.a("writer-updatemarker-wrong-options",this);const a=n.getRange(),c=e.range?e.range:a;o&&e.usingOperation!==n.managedUsingOperations?e.usingOperation?Fl(this,i,null,c,s):(Fl(this,i,a,null,s),this.model.markers._set(i,c,void 0,s)):n.managedUsingOperations?Fl(this,i,a,c,s):this.model.markers._set(i,c,void 0,s)}removeMarker(t){this._assertWriterUsedCorrectly();const e="string"==typeof t?t:t.name;if(!this.model.markers.has(e))throw new l.a("writer-removemarker-no-marker",this);const i=this.model.markers.get(e);if(!i.managedUsingOperations)return void this.model.markers._remove(e);Fl(this,e,i.getRange(),null,i.affectsData)}setSelection(t,e,i){this._assertWriterUsedCorrectly(),this.model.document.selection._setTo(t,e,i)}setSelectionFocus(t,e){this._assertWriterUsedCorrectly(),this.model.document.selection._setFocus(t,e)}setSelectionAttribute(t,e){if(this._assertWriterUsedCorrectly(),"string"==typeof t)this._setSelectionAttribute(t,e);else for(const[e,i]of mn(t))this._setSelectionAttribute(e,i)}removeSelectionAttribute(t){if(this._assertWriterUsedCorrectly(),"string"==typeof t)this._removeSelectionAttribute(t);else for(const e of t)this._removeSelectionAttribute(e)}overrideSelectionGravity(){return this.model.document.selection._overrideGravity()}restoreSelectionGravity(t){this.model.document.selection._restoreGravity(t)}_setSelectionAttribute(t,e){const i=this.model.document.selection;if(i.isCollapsed&&i.anchor.parent.isEmpty){const n=xa._getStoreAttributeKey(t);this.setAttribute(n,e,i.anchor.parent)}i._setAttribute(t,e)}_removeSelectionAttribute(t){const e=this.model.document.selection;if(e.isCollapsed&&e.anchor.parent.isEmpty){const i=xa._getStoreAttributeKey(t);this.removeAttribute(i,e.anchor.parent)}e._removeAttribute(t)}_assertWriterUsedCorrectly(){if(this.model._currentWriter!==this)throw new l.a("writer-incorrect-use",this)}_addOperationForAffectedMarkers(t,e){for(const i of this.model.markers){if(!i.managedUsingOperations)continue;const n=i.getRange();let o=!1;if("move"===t)o=e.containsPosition(n.start)||e.start.isEqual(n.start)||e.containsPosition(n.end)||e.end.isEqual(n.end);else{const t=e.nodeBefore,i=e.nodeAfter,r=n.start.parent==t&&n.start.isAtEnd,s=n.end.parent==i&&0==n.end.offset,a=n.end.nodeAfter==i,l=n.start.nodeAfter==i;o=r||s||a||l}o&&this.updateMarker(i.name,{range:n})}}}function jl(t,e,i,n){const o=t.model,r=o.document;let s,a,l,c=n.start;for(const t of n.getWalker({shallow:!0}))l=t.item.getAttribute(e),s&&a!=l&&(a!=i&&d(),c=s),s=t.nextPosition,a=l;function d(){const n=new aa(c,s),l=n.root.document?r.version:null,d=new Pl(n,e,a,i,l);t.batch.addOperation(d),o.applyOperation(d)}s instanceof na&&s!=c&&a!=i&&d()}function Bl(t,e,i,n){const o=t.model,r=o.document,s=n.getAttribute(e);let a,l;if(s!=i){if(n.root===n){const t=n.document?r.version:null;l=new Rl(n,e,s,i,t)}else{a=new aa(na._createBefore(n),t.createPositionAfter(n));const o=a.root.document?r.version:null;l=new Pl(a,e,s,i,o)}t.batch.addOperation(l),o.applyOperation(l)}}function Fl(t,e,i,n,o){const r=t.model,s=r.document,a=new Ll(e,i,n,r.markers,o,s.version);t.batch.addOperation(a),r.applyOperation(a)}function Hl(t,e,i,n){let o;if(t.root.document){const i=n.document,r=new na(i.graveyard,[0]);o=new Ml(t,e,r,i.version)}else o=new Sl(t,e);i.addOperation(o),n.applyOperation(o)}function Ul(t,e){return t===e||t instanceof Dl&&e instanceof Dl}class ql{constructor(t){this._markerCollection=t,this._changesInElement=new Map,this._elementSnapshots=new Map,this._changedMarkers=new Map,this._changeCount=0,this._cachedChanges=null,this._cachedChangesWithGraveyard=null}get isEmpty(){return 0==this._changesInElement.size&&0==this._changedMarkers.size}refreshItem(t){if(this._isInInsertedElement(t.parent))return;this._markRemove(t.parent,t.startOffset,t.offsetSize),this._markInsert(t.parent,t.startOffset,t.offsetSize);const e=aa._createOn(t);for(const t of this._markerCollection.getMarkersIntersectingRange(e)){const e=t.getRange();this.bufferMarkerChange(t.name,e,e,t.affectsData)}this._cachedChanges=null}bufferOperation(t){switch(t.type){case"insert":if(this._isInInsertedElement(t.position.parent))return;this._markInsert(t.position.parent,t.position.offset,t.nodes.maxOffset);break;case"addAttribute":case"removeAttribute":case"changeAttribute":for(const e of t.range.getItems({shallow:!0}))this._isInInsertedElement(e.parent)||this._markAttribute(e);break;case"remove":case"move":case"reinsert":{if(t.sourcePosition.isEqual(t.targetPosition)||t.sourcePosition.getShiftedBy(t.howMany).isEqual(t.targetPosition))return;const e=this._isInInsertedElement(t.sourcePosition.parent),i=this._isInInsertedElement(t.targetPosition.parent);e||this._markRemove(t.sourcePosition.parent,t.sourcePosition.offset,t.howMany),i||this._markInsert(t.targetPosition.parent,t.getMovedRangeStart().offset,t.howMany);break}case"rename":{if(this._isInInsertedElement(t.position.parent))return;this._markRemove(t.position.parent,t.position.offset,1),this._markInsert(t.position.parent,t.position.offset,1);const e=aa._createFromPositionAndShift(t.position,1);for(const t of this._markerCollection.getMarkersIntersectingRange(e)){const e=t.getRange();this.bufferMarkerChange(t.name,e,e,t.affectsData)}break}case"split":{const e=t.splitPosition.parent;this._isInInsertedElement(e)||this._markRemove(e,t.splitPosition.offset,t.howMany),this._isInInsertedElement(t.insertionPosition.parent)||this._markInsert(t.insertionPosition.parent,t.insertionPosition.offset,1),t.graveyardPosition&&this._markRemove(t.graveyardPosition.parent,t.graveyardPosition.offset,1);break}case"merge":{const e=t.sourcePosition.parent;this._isInInsertedElement(e.parent)||this._markRemove(e.parent,e.startOffset,1);const i=t.graveyardPosition.parent;this._markInsert(i,t.graveyardPosition.offset,1);const n=t.targetPosition.parent;this._isInInsertedElement(n)||this._markInsert(n,t.targetPosition.offset,e.maxOffset);break}}this._cachedChanges=null}bufferMarkerChange(t,e,i,n){const o=this._changedMarkers.get(t);o?(o.newRange=i,o.affectsData=n,null==o.oldRange&&null==o.newRange&&this._changedMarkers.delete(t)):this._changedMarkers.set(t,{oldRange:e,newRange:i,affectsData:n})}getMarkersToRemove(){const t=[];for(const[e,i]of this._changedMarkers)null!=i.oldRange&&t.push({name:e,range:i.oldRange});return t}getMarkersToAdd(){const t=[];for(const[e,i]of this._changedMarkers)null!=i.newRange&&t.push({name:e,range:i.newRange});return t}getChangedMarkers(){return Array.from(this._changedMarkers).map(t=>({name:t[0],data:{oldRange:t[1].oldRange,newRange:t[1].newRange}}))}hasDataChanges(){for(const[,t]of this._changedMarkers)if(t.affectsData)return!0;return this._changesInElement.size>0}getChanges(t={includeChangesInGraveyard:!1}){if(this._cachedChanges)return t.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice();let e=[];for(const t of this._changesInElement.keys()){const i=this._changesInElement.get(t).sort((t,e)=>t.offset===e.offset?t.type!=e.type?"remove"==t.type?-1:1:0:t.offset<e.offset?-1:1),n=this._elementSnapshots.get(t),o=Wl(t.getChildren()),r=$l(n.length,i);let s=0,a=0;for(const i of r)if("i"===i)e.push(this._getInsertDiff(t,s,o[s].name)),s++;else if("r"===i)e.push(this._getRemoveDiff(t,s,n[a].name)),a++;else if("a"===i){const i=o[s].attributes,r=n[a].attributes;let l;if("$text"==o[s].name)l=new aa(na._createAt(t,s),na._createAt(t,s+1));else{const e=t.offsetToIndex(s);l=new aa(na._createAt(t,s),na._createAt(t.getChild(e),0))}e.push(...this._getAttributesDiff(l,r,i)),s++,a++}else s++,a++}e.sort((t,e)=>t.position.root!=e.position.root?t.position.root.rootName<e.position.root.rootName?-1:1:t.position.isEqual(e.position)?t.changeCount-e.changeCount:t.position.isBefore(e.position)?-1:1);for(let t=1,i=0;t<e.length;t++){const n=e[i],o=e[t],r="remove"==n.type&&"remove"==o.type&&"$text"==n.name&&"$text"==o.name&&n.position.isEqual(o.position),s="insert"==n.type&&"insert"==o.type&&"$text"==n.name&&"$text"==o.name&&n.position.parent==o.position.parent&&n.position.offset+n.length==o.position.offset,a="attribute"==n.type&&"attribute"==o.type&&n.position.parent==o.position.parent&&n.range.isFlat&&o.range.isFlat&&n.position.offset+n.length==o.position.offset&&n.attributeKey==o.attributeKey&&n.attributeOldValue==o.attributeOldValue&&n.attributeNewValue==o.attributeNewValue;r||s||a?(n.length++,a&&(n.range.end=n.range.end.getShiftedBy(1)),e[t]=null):i=t}e=e.filter(t=>t);for(const t of e)delete t.changeCount,"attribute"==t.type&&(delete t.position,delete t.length);return this._changeCount=0,this._cachedChangesWithGraveyard=e.slice(),this._cachedChanges=e.filter(Gl),t.includeChangesInGraveyard?this._cachedChangesWithGraveyard:this._cachedChanges}reset(){this._changesInElement.clear(),this._elementSnapshots.clear(),this._changedMarkers.clear(),this._cachedChanges=null}_markInsert(t,e,i){const n={type:"insert",offset:e,howMany:i,count:this._changeCount++};this._markChange(t,n)}_markRemove(t,e,i){const n={type:"remove",offset:e,howMany:i,count:this._changeCount++};this._markChange(t,n),this._removeAllNestedChanges(t,e,i)}_markAttribute(t){const e={type:"attribute",offset:t.startOffset,howMany:t.offsetSize,count:this._changeCount++};this._markChange(t.parent,e)}_markChange(t,e){this._makeSnapshot(t);const i=this._getChangesForElement(t);this._handleChange(e,i),i.push(e);for(let t=0;t<i.length;t++)i[t].howMany<1&&(i.splice(t,1),t--)}_getChangesForElement(t){let e;return this._changesInElement.has(t)?e=this._changesInElement.get(t):(e=[],this._changesInElement.set(t,e)),e}_makeSnapshot(t){this._elementSnapshots.has(t)||this._elementSnapshots.set(t,Wl(t.getChildren()))}_handleChange(t,e){t.nodesToHandle=t.howMany;for(const i of e){const n=t.offset+t.howMany,o=i.offset+i.howMany;if("insert"==t.type&&("insert"==i.type&&(t.offset<=i.offset?i.offset+=t.howMany:t.offset<o&&(i.howMany+=t.nodesToHandle,t.nodesToHandle=0)),"remove"==i.type&&t.offset<i.offset&&(i.offset+=t.howMany),"attribute"==i.type))if(t.offset<=i.offset)i.offset+=t.howMany;else if(t.offset<o){const o=i.howMany;i.howMany=t.offset-i.offset,e.unshift({type:"attribute",offset:n,howMany:o-i.howMany,count:this._changeCount++})}if("remove"==t.type){if("insert"==i.type)if(n<=i.offset)i.offset-=t.howMany;else if(n<=o)if(t.offset<i.offset){const e=n-i.offset;i.offset=t.offset,i.howMany-=e,t.nodesToHandle-=e}else i.howMany-=t.nodesToHandle,t.nodesToHandle=0;else if(t.offset<=i.offset)t.nodesToHandle-=i.howMany,i.howMany=0;else if(t.offset<o){const e=o-t.offset;i.howMany-=e,t.nodesToHandle-=e}if("remove"==i.type&&(n<=i.offset?i.offset-=t.howMany:t.offset<i.offset&&(t.nodesToHandle+=i.howMany,i.howMany=0)),"attribute"==i.type)if(n<=i.offset)i.offset-=t.howMany;else if(t.offset<i.offset){const e=n-i.offset;i.offset=t.offset,i.howMany-=e}else if(t.offset<o)if(n<=o){const n=i.howMany;i.howMany=t.offset-i.offset;const o=n-i.howMany-t.nodesToHandle;e.unshift({type:"attribute",offset:t.offset,howMany:o,count:this._changeCount++})}else i.howMany-=o-t.offset}if("attribute"==t.type){if("insert"==i.type)if(t.offset<i.offset&&n>i.offset){if(n>o){const t={type:"attribute",offset:o,howMany:n-o,count:this._changeCount++};this._handleChange(t,e),e.push(t)}t.nodesToHandle=i.offset-t.offset,t.howMany=t.nodesToHandle}else t.offset>=i.offset&&t.offset<o&&(n>o?(t.nodesToHandle=n-o,t.offset=o):t.nodesToHandle=0);if("remove"==i.type&&t.offset<i.offset&&n>i.offset){const o={type:"attribute",offset:i.offset,howMany:n-i.offset,count:this._changeCount++};this._handleChange(o,e),e.push(o),t.nodesToHandle=i.offset-t.offset,t.howMany=t.nodesToHandle}"attribute"==i.type&&(t.offset>=i.offset&&n<=o?(t.nodesToHandle=0,t.howMany=0,t.offset=0):t.offset<=i.offset&&n>=o&&(i.howMany=0))}}t.howMany=t.nodesToHandle,delete t.nodesToHandle}_getInsertDiff(t,e,i){return{type:"insert",position:na._createAt(t,e),name:i,length:1,changeCount:this._changeCount++}}_getRemoveDiff(t,e,i){return{type:"remove",position:na._createAt(t,e),name:i,length:1,changeCount:this._changeCount++}}_getAttributesDiff(t,e,i){const n=[];i=new Map(i);for(const[o,r]of e){const e=i.has(o)?i.get(o):null;e!==r&&n.push({type:"attribute",position:t.start,range:t.clone(),length:1,attributeKey:o,attributeOldValue:r,attributeNewValue:e,changeCount:this._changeCount++}),i.delete(o)}for(const[e,o]of i)n.push({type:"attribute",position:t.start,range:t.clone(),length:1,attributeKey:e,attributeOldValue:null,attributeNewValue:o,changeCount:this._changeCount++});return n}_isInInsertedElement(t){const e=t.parent;if(!e)return!1;const i=this._changesInElement.get(e),n=t.startOffset;if(i)for(const t of i)if("insert"==t.type&&n>=t.offset&&n<t.offset+t.howMany)return!0;return this._isInInsertedElement(e)}_removeAllNestedChanges(t,e,i){const n=new aa(na._createAt(t,e),na._createAt(t,e+i));for(const t of n.getItems({shallow:!0}))t.is("element")&&(this._elementSnapshots.delete(t),this._changesInElement.delete(t),this._removeAllNestedChanges(t,0,t.maxOffset))}}function Wl(t){const e=[];for(const i of t)if(i.is("$text"))for(let t=0;t<i.data.length;t++)e.push({name:"$text",attributes:new Map(i.getAttributes())});else e.push({name:i.name,attributes:new Map(i.getAttributes())});return e}function $l(t,e){const i=[];let n=0,o=0;for(const t of e){if(t.offset>n){for(let e=0;e<t.offset-n;e++)i.push("e");o+=t.offset-n}if("insert"==t.type){for(let e=0;e<t.howMany;e++)i.push("i");n=t.offset+t.howMany}else if("remove"==t.type){for(let e=0;e<t.howMany;e++)i.push("r");n=t.offset,o+=t.howMany}else i.push(..."a".repeat(t.howMany).split("")),n=t.offset+t.howMany,o+=t.howMany}if(o<t)for(let e=0;e<t-o-n;e++)i.push("e");return i}function Gl(t){const e=t.position&&"$graveyard"==t.position.root.rootName,i=t.range&&"$graveyard"==t.range.root.rootName;return!e&&!i}class Yl{constructor(){this._operations=[],this._undoPairs=new Map,this._undoneOperations=new Set}addOperation(t){this._operations.includes(t)||this._operations.push(t)}getOperations(t=Number.NEGATIVE_INFINITY,e=Number.POSITIVE_INFINITY){const i=[];for(const n of this._operations)n.baseVersion>=t&&n.baseVersion<e&&i.push(n);return i}getOperation(t){for(const e of this._operations)if(e.baseVersion==t)return e}setOperationAsUndone(t,e){this._undoPairs.set(e,t),this._undoneOperations.add(t)}isUndoingOperation(t){return this._undoPairs.has(t)}isUndoneOperation(t){return this._undoneOperations.has(t)}getUndoneOperation(t){return this._undoPairs.get(t)}}function Kl(t,e){return!!(i=t.charAt(e-1))&&1==i.length&&/[\ud800-\udbff]/.test(i)&&function(t){return!!t&&1==t.length&&/[\udc00-\udfff]/.test(t)}(t.charAt(e));var i}function Ql(t,e){return!!(i=t.charAt(e))&&1==i.length&&/[\u0300-\u036f\u1ab0-\u1aff\u1dc0-\u1dff\u20d0-\u20ff\ufe20-\ufe2f]/.test(i);var i}class Jl{constructor(t){this.model=t,this.version=0,this.history=new Yl(this),this.selection=new xa(this),this.roots=new Zi({idProperty:"rootName"}),this.differ=new ql(t.markers),this._postFixers=new Set,this._hasSelectionChangedFromTheLastChangeBlock=!1,this.createRoot("$root","$graveyard"),this.listenTo(t,"applyOperation",(t,e)=>{const i=e[0];if(i.isDocumentOperation&&i.baseVersion!==this.version)throw new l.a("model-document-applyoperation-wrong-version",this,{operation:i})},{priority:"highest"}),this.listenTo(t,"applyOperation",(t,e)=>{const i=e[0];i.isDocumentOperation&&this.differ.bufferOperation(i)},{priority:"high"}),this.listenTo(t,"applyOperation",(t,e)=>{const i=e[0];i.isDocumentOperation&&(this.version++,this.history.addOperation(i))},{priority:"low"}),this.listenTo(this.selection,"change",()=>{this._hasSelectionChangedFromTheLastChangeBlock=!0}),this.listenTo(t.markers,"update",(t,e,i,n)=>{this.differ.bufferMarkerChange(e.name,i,n,e.affectsData),null===i&&e.on("change",(t,i)=>{this.differ.bufferMarkerChange(e.name,i,e.getRange(),e.affectsData)})})}get graveyard(){return this.getRoot("$graveyard")}createRoot(t="$root",e="main"){if(this.roots.get(e))throw new l.a("model-document-createroot-name-exists",this,{name:e});const i=new Dl(this,t,e);return this.roots.add(i),i}destroy(){this.selection.destroy(),this.stopListening()}getRoot(t="main"){return this.roots.get(t)}getRootNames(){return Array.from(this.roots,t=>t.rootName).filter(t=>"$graveyard"!=t)}registerPostFixer(t){this._postFixers.add(t)}toJSON(){const t=cn(this);return t.selection="[engine.model.DocumentSelection]",t.model="[engine.model.Model]",t}_handleChangeBlock(t){this._hasDocumentChangedFromTheLastChangeBlock()&&(this._callPostFixers(t),this.selection.refresh(),this.differ.hasDataChanges()?this.fire("change:data",t.batch):this.fire("change",t.batch),this.selection.refresh(),this.differ.reset()),this._hasSelectionChangedFromTheLastChangeBlock=!1}_hasDocumentChangedFromTheLastChangeBlock(){return!this.differ.isEmpty||this._hasSelectionChangedFromTheLastChangeBlock}_getDefaultRoot(){for(const t of this.roots)if(t!==this.graveyard)return t;return this.graveyard}_getDefaultRange(){const t=this._getDefaultRoot(),e=this.model,i=e.schema,n=e.createPositionFromPath(t,[0]);return i.getNearestSelectionRange(n)||e.createRange(n)}_validateSelectionRange(t){return Zl(t.start)&&Zl(t.end)}_callPostFixers(t){let e=!1;do{for(const i of this._postFixers)if(this.selection.refresh(),e=i(t),e)break}while(e)}}function Zl(t){const e=t.textNode;if(e){const i=e.data,n=t.offset-e.startOffset;return!Kl(i,n)&&!Ql(i,n)}return!0}Kt(Jl,h);class Xl{constructor(){this._markers=new Map}[Symbol.iterator](){return this._markers.values()}has(t){return this._markers.has(t)}get(t){return this._markers.get(t)||null}_set(t,e,i=!1,n=!1){const o=t instanceof tc?t.name:t;if(o.includes(","))throw new l.a("markercollection-incorrect-marker-name",this);const r=this._markers.get(o);if(r){const t=r.getRange();let s=!1;return t.isEqual(e)||(r._attachLiveRange(_a.fromRange(e)),s=!0),i!=r.managedUsingOperations&&(r._managedUsingOperations=i,s=!0),"boolean"==typeof n&&n!=r.affectsData&&(r._affectsData=n,s=!0),s&&this.fire("update:"+o,r,t,e),r}const s=_a.fromRange(e),a=new tc(o,s,i,n);return this._markers.set(o,a),this.fire("update:"+o,a,null,e),a}_remove(t){const e=t instanceof tc?t.name:t,i=this._markers.get(e);return!!i&&(this._markers.delete(e),this.fire("update:"+e,i,i.getRange(),null),this._destroyMarker(i),!0)}_refresh(t){const e=t instanceof tc?t.name:t,i=this._markers.get(e);if(!i)throw new l.a("markercollection-refresh-marker-not-exists",this);const n=i.getRange();this.fire("update:"+e,i,n,n,i.managedUsingOperations,i.affectsData)}*getMarkersAtPosition(t){for(const e of this)e.getRange().containsPosition(t)&&(yield e)}*getMarkersIntersectingRange(t){for(const e of this)null!==e.getRange().getIntersection(t)&&(yield e)}destroy(){for(const t of this._markers.values())this._destroyMarker(t);this._markers=null,this.stopListening()}*getMarkersGroup(t){for(const e of this._markers.values())e.name.startsWith(t+":")&&(yield e)}_destroyMarker(t){t.stopListening(),t._detachLiveRange()}}Kt(Xl,h);class tc{constructor(t,e,i,n){this.name=t,this._liveRange=this._attachLiveRange(e),this._managedUsingOperations=i,this._affectsData=n}get managedUsingOperations(){if(!this._liveRange)throw new l.a("marker-destroyed",this);return this._managedUsingOperations}get affectsData(){if(!this._liveRange)throw new l.a("marker-destroyed",this);return this._affectsData}getStart(){if(!this._liveRange)throw new l.a("marker-destroyed",this);return this._liveRange.start.clone()}getEnd(){if(!this._liveRange)throw new l.a("marker-destroyed",this);return this._liveRange.end.clone()}getRange(){if(!this._liveRange)throw new l.a("marker-destroyed",this);return this._liveRange.toRange()}is(t){return"marker"===t||"model:marker"===t}_attachLiveRange(t){return this._liveRange&&this._detachLiveRange(),t.delegate("change:range").to(this),t.delegate("change:content").to(this),this._liveRange=t,t}_detachLiveRange(){this._liveRange.stopDelegating("change:range",this),this._liveRange.stopDelegating("change:content",this),this._liveRange.detach(),this._liveRange=null}}Kt(tc,h);class ec extends bl{get type(){return"noop"}clone(){return new ec(this.baseVersion)}getReversed(){return new ec(this.baseVersion+1)}_execute(){}static get className(){return"NoOperation"}}const ic={};ic[Pl.className]=Pl,ic[Il.className]=Il,ic[Ll.className]=Ll,ic[Ml.className]=Ml,ic[ec.className]=ec,ic[bl.className]=bl,ic[Nl.className]=Nl,ic[Rl.className]=Rl,ic[zl.className]=zl,ic[Ol.className]=Ol;class nc extends na{constructor(t,e,i="toNone"){if(super(t,e,i),!this.root.is("rootElement"))throw new l.a("model-liveposition-root-not-rootelement",t);oc.call(this)}detach(){this.stopListening()}is(t){return"livePosition"===t||"model:livePosition"===t||"position"==t||"model:position"===t}toPosition(){return new na(this.root,this.path.slice(),this.stickiness)}static fromPosition(t,e){return new this(t.root,t.path.slice(),e||t.stickiness)}}function oc(){this.listenTo(this.root.document.model,"applyOperation",(t,e)=>{const i=e[0];i.isDocumentOperation&&rc.call(this,i)},{priority:"low"})}function rc(t){const e=this.getTransformedByOperation(t);if(!this.isEqual(e)){const t=this.toPosition();this.path=e.path,this.root=e.root,this.fire("change",t)}}Kt(nc,h);class sc{constructor(t,e,i){this.model=t,this.writer=e,this.position=i,this.canMergeWith=new Set([this.position.parent]),this.schema=t.schema,this._documentFragment=e.createDocumentFragment(),this._documentFragmentPosition=e.createPositionAt(this._documentFragment,0),this._firstNode=null,this._lastNode=null,this._lastAutoParagraph=null,this._filterAttributesOf=[],this._affectedStart=null,this._affectedEnd=null}handleNodes(t){for(const e of Array.from(t))this._handleNode(e);this._insertPartialFragment(),this._lastAutoParagraph&&this._updateLastNodeFromAutoParagraph(this._lastAutoParagraph),this._mergeOnRight(),this.schema.removeDisallowedAttributes(this._filterAttributesOf,this.writer),this._filterAttributesOf=[]}_updateLastNodeFromAutoParagraph(t){const e=this.writer.createPositionAfter(this._lastNode),i=this.writer.createPositionAfter(t);if(i.isAfter(e)){if(this._lastNode=t,this.position.parent!=t||!this.position.isAtEnd)throw new l.a("insertcontent-invalid-insertion-position",this);this.position=i,this._setAffectedBoundaries(this.position)}}getSelectionRange(){return this.nodeToSelect?aa._createOn(this.nodeToSelect):this.model.schema.getNearestSelectionRange(this.position)}getAffectedRange(){return this._affectedStart?new aa(this._affectedStart,this._affectedEnd):null}destroy(){this._affectedStart&&this._affectedStart.detach(),this._affectedEnd&&this._affectedEnd.detach()}_handleNode(t){if(this.schema.isObject(t))return void this._handleObject(t);let e=this._checkAndAutoParagraphToAllowedPosition(t);e||(e=this._checkAndSplitToAllowedPosition(t),e)?(this._appendToFragment(t),this._firstNode||(this._firstNode=t),this._lastNode=t):this._handleDisallowedNode(t)}_insertPartialFragment(){if(this._documentFragment.isEmpty)return;const t=nc.fromPosition(this.position,"toNext");this._setAffectedBoundaries(this.position),this._documentFragment.getChild(0)==this._firstNode&&(this.writer.insert(this._firstNode,this.position),this._mergeOnLeft(),this.position=t.toPosition()),this._documentFragment.isEmpty||this.writer.insert(this._documentFragment,this.position),this._documentFragmentPosition=this.writer.createPositionAt(this._documentFragment,0),this.position=t.toPosition(),t.detach()}_handleObject(t){this._checkAndSplitToAllowedPosition(t)?this._appendToFragment(t):this._tryAutoparagraphing(t)}_handleDisallowedNode(t){t.is("element")?this.handleNodes(t.getChildren()):this._tryAutoparagraphing(t)}_appendToFragment(t){if(!this.schema.checkChild(this.position,t))throw new l.a("insertcontent-wrong-position",this,{node:t,position:this.position});this.writer.insert(t,this._documentFragmentPosition),this._documentFragmentPosition=this._documentFragmentPosition.getShiftedBy(t.offsetSize),this.schema.isObject(t)&&!this.schema.checkChild(this.position,"$text")?this.nodeToSelect=t:this.nodeToSelect=null,this._filterAttributesOf.push(t)}_setAffectedBoundaries(t){this._affectedStart||(this._affectedStart=nc.fromPosition(t,"toPrevious")),this._affectedEnd&&!this._affectedEnd.isBefore(t)||(this._affectedEnd&&this._affectedEnd.detach(),this._affectedEnd=nc.fromPosition(t,"toNext"))}_mergeOnLeft(){const t=this._firstNode;if(!(t instanceof ta))return;if(!this._canMergeLeft(t))return;const e=nc._createBefore(t);e.stickiness="toNext";const i=nc.fromPosition(this.position,"toNext");this._affectedStart.isEqual(e)&&(this._affectedStart.detach(),this._affectedStart=nc._createAt(e.nodeBefore,"end","toPrevious")),this._firstNode===this._lastNode&&(this._firstNode=e.nodeBefore,this._lastNode=e.nodeBefore),this.writer.merge(e),e.isEqual(this._affectedEnd)&&this._firstNode===this._lastNode&&(this._affectedEnd.detach(),this._affectedEnd=nc._createAt(e.nodeBefore,"end","toNext")),this.position=i.toPosition(),i.detach(),this._filterAttributesOf.push(this.position.parent),e.detach()}_mergeOnRight(){const t=this._lastNode;if(!(t instanceof ta))return;if(!this._canMergeRight(t))return;const e=nc._createAfter(t);if(e.stickiness="toNext",!this.position.isEqual(e))throw new l.a("insertcontent-invalid-insertion-position",this);this.position=na._createAt(e.nodeBefore,"end");const i=nc.fromPosition(this.position,"toPrevious");this._affectedEnd.isEqual(e)&&(this._affectedEnd.detach(),this._affectedEnd=nc._createAt(e.nodeBefore,"end","toNext")),this._firstNode===this._lastNode&&(this._firstNode=e.nodeBefore,this._lastNode=e.nodeBefore),this.writer.merge(e),e.getShiftedBy(-1).isEqual(this._affectedStart)&&this._firstNode===this._lastNode&&(this._affectedStart.detach(),this._affectedStart=nc._createAt(e.nodeBefore,0,"toPrevious")),this.position=i.toPosition(),i.detach(),this._filterAttributesOf.push(this.position.parent),e.detach()}_canMergeLeft(t){const e=t.previousSibling;return e instanceof ta&&this.canMergeWith.has(e)&&this.model.schema.checkMerge(e,t)}_canMergeRight(t){const e=t.nextSibling;return e instanceof ta&&this.canMergeWith.has(e)&&this.model.schema.checkMerge(t,e)}_tryAutoparagraphing(t){const e=this.writer.createElement("paragraph");this._getAllowedIn(e,this.position.parent)&&this.schema.checkChild(e,t)&&(e._appendChild(t),this._handleNode(e))}_checkAndAutoParagraphToAllowedPosition(t){if(this.schema.checkChild(this.position.parent,t))return!0;if(!this.schema.checkChild(this.position.parent,"paragraph")||!this.schema.checkChild("paragraph",t))return!1;this._insertPartialFragment();const e=this.writer.createElement("paragraph");return this.writer.insert(e,this.position),this._setAffectedBoundaries(this.position),this._lastAutoParagraph=e,this.position=this.writer.createPositionAt(e,0),!0}_checkAndSplitToAllowedPosition(t){const e=this._getAllowedIn(t,this.position.parent);if(!e)return!1;for(e!=this.position.parent&&this._insertPartialFragment();e!=this.position.parent;){if(this.schema.isLimit(this.position.parent))return!1;if(this.position.isAtStart){const t=this.position.parent;this.position=this.writer.createPositionBefore(t),t.isEmpty&&t.parent===e&&this.writer.remove(t)}else if(this.position.isAtEnd)this.position=this.writer.createPositionAfter(this.position.parent);else{const t=this.writer.createPositionAfter(this.position.parent);this._setAffectedBoundaries(this.position),this.writer.split(this.position),this.position=t,this.canMergeWith.add(this.position.nodeAfter)}}return!0}_getAllowedIn(t,e){return this.schema.checkChild(e,t)?e:e.parent?this._getAllowedIn(t,e.parent):null}}function ac(t,e,i={}){if(e.isCollapsed)return;const n=e.getFirstRange();if("$graveyard"==n.root.rootName)return;const o=t.schema;t.change(t=>{if(!i.doNotResetEntireContent&&function(t,e){const i=t.getLimitElement(e);if(!e.containsEntireContent(i))return!1;const n=e.getFirstRange();if(n.start.parent==n.end.parent)return!1;return t.checkChild(i,"paragraph")}(o,e))return void function(t,e){const i=t.model.schema.getLimitElement(e);t.remove(t.createRangeIn(i)),cc(t,t.createPositionAt(i,0),e)}(t,e);const[r,s]=function(t){const e=t.root.document.model,i=t.start;let n=t.end;if(e.hasContent(t,{ignoreMarkers:!0})){const i=function(t){const e=t.parent,i=e.root.document.model.schema,n=e.getAncestors({parentFirst:!0,includeSelf:!0});for(const t of n){if(i.isLimit(t))return null;if(i.isBlock(t))return t}}(n);if(i&&n.isTouching(e.createPositionAt(i,0))){const i=e.createSelection(t);e.modifySelection(i,{direction:"backward"});const o=i.getLastPosition(),r=e.createRange(o,n);e.hasContent(r,{ignoreMarkers:!0})||(n=o)}}return[nc.fromPosition(i,"toPrevious"),nc.fromPosition(n,"toNext")]}(n);r.isTouching(s)||t.remove(t.createRange(r,s)),i.leaveUnmerged||(!function(t,e,i){const n=t.model;if(!lc(t.model.schema,e,i))return;const[o,r]=function(t,e){const i=t.getAncestors(),n=e.getAncestors();let o=0;for(;i[o]&&i[o]==n[o];)o++;return[i[o],n[o]]}(e,i);if(!o||!r)return;!n.hasContent(o,{ignoreMarkers:!0})&&n.hasContent(r,{ignoreMarkers:!0})?function t(e,i,n,o){const r=i.parent,s=n.parent;if(r==o||s==o)return;i=e.createPositionAfter(r),(n=e.createPositionBefore(s)).isEqual(i)||e.insert(r,n);for(;i.parent.isEmpty;){const t=i.parent;i=e.createPositionBefore(t),e.remove(t)}if(n=e.createPositionBefore(s),function(t,e){const i=e.nodeBefore,n=e.nodeAfter;i.name!=n.name&&t.rename(i,n.name);t.clearAttributes(i),t.setAttributes(Object.fromEntries(n.getAttributes()),i),t.merge(e)}(e,n),!lc(e.model.schema,i,n))return;t(e,i,n,o)}(t,e,i,o.parent):function t(e,i,n,o){const r=i.parent,s=n.parent;if(r==o||s==o)return;i=e.createPositionAfter(r),(n=e.createPositionBefore(s)).isEqual(i)||e.insert(s,i);e.merge(i);for(;n.parent.isEmpty;){const t=n.parent;n=e.createPositionBefore(t),e.remove(t)}if(!lc(e.model.schema,i,n))return;t(e,i,n,o)}(t,e,i,o.parent)}(t,r,s),o.removeDisallowedAttributes(r.parent.getChildren(),t)),dc(t,e,r),!i.doNotAutoparagraph&&function(t,e){const i=t.checkChild(e,"$text"),n=t.checkChild(e,"paragraph");return!i&&n}(o,r)&&cc(t,r,e),r.detach(),s.detach()})}function lc(t,e,i){const n=e.parent,o=i.parent;return n!=o&&(!t.isLimit(n)&&!t.isLimit(o)&&function(t,e,i){const n=new aa(t,e);for(const t of n.getWalker())if(i.isLimit(t.item))return!1;return!0}(e,i,t))}function cc(t,e,i){const n=t.createElement("paragraph");t.insert(n,e),dc(t,i,t.createPositionAt(n,0))}function dc(t,e,i){e instanceof xa?t.setSelection(i):e.setTo(i)}function hc(t,e){const{isForward:i,walker:n,unit:o,schema:r}=t,{type:s,item:a,nextPosition:l}=e;if("text"==s)return"word"===t.unit?function(t,e){let i=t.position.textNode;if(i){let n=t.position.offset-i.startOffset;for(;!mc(i.data,n,e)&&!gc(i,n,e);){t.next();const o=e?t.position.nodeAfter:t.position.nodeBefore;if(o&&o.is("$text")){const n=o.data.charAt(e?0:o.data.length-1);' ,.?!:;"-()'.includes(n)||(t.next(),i=t.position.textNode)}n=t.position.offset-i.startOffset}}return t.position}(n,i):function(t,e){const i=t.position.textNode;if(i){const n=i.data;let o=t.position.offset-i.startOffset;for(;Kl(n,o)||"character"==e&&Ql(n,o);)t.next(),o=t.position.offset-i.startOffset}return t.position}(n,o);if(s==(i?"elementStart":"elementEnd")){if(r.isSelectable(a))return na._createAt(a,i?"after":"before");if(r.checkChild(l,"$text"))return l}else{if(r.isLimit(a))return void n.skip(()=>!0);if(r.checkChild(l,"$text"))return l}}function uc(t,e){const i=t.root,n=na._createAt(i,e?"end":0);return e?new aa(t,n):new aa(n,t)}function mc(t,e,i){const n=e+(i?0:-1);return' ,.?!:;"-()'.includes(t.charAt(n))}function gc(t,e,i){return e===(i?t.endOffset:0)}function fc(t,e){const i=[];Array.from(t.getItems({direction:"backward"})).map(t=>e.createRangeOn(t)).filter(e=>(e.start.isAfter(t.start)||e.start.isEqual(t.start))&&(e.end.isBefore(t.end)||e.end.isEqual(t.end))).forEach(t=>{i.push(t.start.parent),e.remove(t)}),i.forEach(t=>{let i=t;for(;i.parent&&i.isEmpty;){const t=e.createRangeOn(i);i=i.parent,e.remove(t)}})}function pc(t){t.document.registerPostFixer(e=>function(t,e){const i=e.document.selection,n=e.schema,o=[];let r=!1;for(const t of i.getRanges()){const e=wc(t,n);e&&!e.isEqual(t)?(o.push(e),r=!0):o.push(t)}r&&t.setSelection(function(t){const e=[];e.push(t.shift());for(const i of t){const t=e.pop();if(i.isEqual(t))e.push(t);else if(i.isIntersecting(t)){const n=t.start.isAfter(i.start)?i.start:t.start,o=t.end.isAfter(i.end)?t.end:i.end,r=new aa(n,o);e.push(r)}else e.push(t),e.push(i)}return e}(o),{backward:i.isBackward})}(e,t))}function wc(t,e){return t.isCollapsed?function(t,e){const i=t.start,n=e.getNearestSelectionRange(i);if(!n)return null;if(!n.isCollapsed)return n;const o=n.start;if(i.isEqual(o))return null;return new aa(o)}(t,e):function(t,e){const{start:i,end:n}=t,o=e.checkChild(i,"$text"),r=e.checkChild(n,"$text"),s=e.getLimitElement(i),a=e.getLimitElement(n);if(s===a){if(o&&r)return null;if(function(t,e,i){const n=t.nodeAfter&&!i.isLimit(t.nodeAfter)||i.checkChild(t,"$text"),o=e.nodeBefore&&!i.isLimit(e.nodeBefore)||i.checkChild(e,"$text");return n||o}(i,n,e)){const t=i.nodeAfter&&e.isSelectable(i.nodeAfter)?null:e.getNearestSelectionRange(i,"forward"),o=n.nodeBefore&&e.isSelectable(n.nodeBefore)?null:e.getNearestSelectionRange(n,"backward"),r=t?t.start:i,s=o?o.end:n;return new aa(r,s)}}const l=s&&!s.is("rootElement"),c=a&&!a.is("rootElement");if(l||c){const t=i.nodeAfter&&n.nodeBefore&&i.nodeAfter.parent===n.nodeBefore.parent,o=l&&(!t||!kc(i.nodeAfter,e)),r=c&&(!t||!kc(n.nodeBefore,e));let d=i,h=n;return o&&(d=na._createBefore(bc(s,e))),r&&(h=na._createAfter(bc(a,e))),new aa(d,h)}return null}(t,e)}function bc(t,e){let i=t,n=i;for(;e.isLimit(n)&&n.parent;)i=n,n=n.parent;return i}function kc(t,e){return t&&e.isSelectable(t)}class _c{constructor(){this.markers=new Xl,this.document=new Jl(this),this.schema=new Ka,this._pendingChanges=[],this._currentWriter=null,["insertContent","deleteContent","modifySelection","getSelectedContent","applyOperation"].forEach(t=>this.decorate(t)),this.on("applyOperation",(t,e)=>{e[0]._validate()},{priority:"highest"}),this.schema.register("$root",{isLimit:!0}),this.schema.register("$block",{allowIn:"$root",isBlock:!0}),this.schema.register("$text",{allowIn:"$block",isInline:!0,isContent:!0}),this.schema.register("$clipboardHolder",{allowContentOf:"$root",allowChildren:"$text",isLimit:!0}),this.schema.register("$documentFragment",{allowContentOf:"$root",allowChildren:"$text",isLimit:!0}),this.schema.register("$marker"),this.schema.addChildCheck((t,e)=>{if("$marker"===e.name)return!0}),pc(this),this.document.registerPostFixer(Oa)}change(t){try{return 0===this._pendingChanges.length?(this._pendingChanges.push({batch:new wl,callback:t}),this._runPendingChanges()[0]):t(this._currentWriter)}catch(t){l.a.rethrowUnexpectedError(t,this)}}enqueueChange(t,e){try{"string"==typeof t?t=new wl(t):"function"==typeof t&&(e=t,t=new wl),this._pendingChanges.push({batch:t,callback:e}),1==this._pendingChanges.length&&this._runPendingChanges()}catch(t){l.a.rethrowUnexpectedError(t,this)}}applyOperation(t){t._execute()}insertContent(t,e,i){return function(t,e,i,n){return t.change(o=>{let r;r=i?i instanceof fa||i instanceof xa?i:o.createSelection(i,n):t.document.selection,r.isCollapsed||t.deleteContent(r,{doNotAutoparagraph:!0});const s=new sc(t,o,r.anchor);let a;a=e.is("documentFragment")?e.getChildren():[e],s.handleNodes(a);const l=s.getSelectionRange();l&&(r instanceof xa?o.setSelection(l):r.setTo(l));const c=s.getAffectedRange()||t.createRange(r.anchor);return s.destroy(),c})}(this,t,e,i)}deleteContent(t,e){ac(this,t,e)}modifySelection(t,e){!function(t,e,i={}){const n=t.schema,o="backward"!=i.direction,r=i.unit?i.unit:"character",s=e.focus,a=new ea({boundaries:uc(s,o),singleCharacters:!0,direction:o?"forward":"backward"}),l={walker:a,schema:n,isForward:o,unit:r};let c;for(;c=a.next();){if(c.done)return;const i=hc(l,c.value);if(i)return void(e instanceof xa?t.change(t=>{t.setSelectionFocus(i)}):e.setFocus(i))}}(this,t,e)}getSelectedContent(t){return function(t,e){return t.change(t=>{const i=t.createDocumentFragment(),n=e.getFirstRange();if(!n||n.isCollapsed)return i;const o=n.start.root,r=n.start.getCommonPath(n.end),s=o.getNodeByPath(r);let a;a=n.start.parent==n.end.parent?n:t.createRange(t.createPositionAt(s,n.start.path[r.length]),t.createPositionAt(s,n.end.path[r.length]+1));const l=a.end.offset-a.start.offset;for(const e of a.getItems({shallow:!0}))e.is("$textProxy")?t.appendText(e.data,e.getAttributes(),i):t.append(t.cloneElement(e,!0),i);if(a!=n){const e=n._getTransformedByMove(a.start,t.createPositionAt(i,0),l)[0],o=t.createRange(t.createPositionAt(i,0),e.start);fc(t.createRange(e.end,t.createPositionAt(i,"end")),t),fc(o,t)}return i})}(this,t)}hasContent(t,e={}){const i=t instanceof ta?aa._createIn(t):t;if(i.isCollapsed)return!1;const{ignoreWhitespaces:n=!1,ignoreMarkers:o=!1}=e;if(!o)for(const t of this.markers.getMarkersIntersectingRange(i))if(t.affectsData)return!0;for(const t of i.getItems())if(this.schema.isContent(t)){if(!t.is("$textProxy"))return!0;if(!n)return!0;if(-1!==t.data.search(/\S/))return!0}return!1}createPositionFromPath(t,e,i){return new na(t,e,i)}createPositionAt(t,e){return na._createAt(t,e)}createPositionAfter(t){return na._createAfter(t)}createPositionBefore(t){return na._createBefore(t)}createRange(t,e){return new aa(t,e)}createRangeIn(t){return aa._createIn(t)}createRangeOn(t){return aa._createOn(t)}createSelection(t,e,i){return new fa(t,e,i)}createBatch(t){return new wl(t)}createOperationFromJSON(t){return class{static fromJSON(t,e){return ic[t.__className].fromJSON(t,e)}}.fromJSON(t,this.document)}destroy(){this.document.destroy(),this.stopListening()}_runPendingChanges(){const t=[];for(this.fire("_beforeChanges");this._pendingChanges.length;){const e=this._pendingChanges[0].batch;this._currentWriter=new Vl(this,e);const i=this._pendingChanges[0].callback(this._currentWriter);t.push(i),this.document._handleChangeBlock(this._currentWriter),this._pendingChanges.shift(),this._currentWriter=null}return this.fire("_afterChanges"),t}}Kt(_c,Ut);class vc extends Ds{constructor(t){super(),this.editor=t}set(t,e,i={}){if("string"==typeof e){const t=e;e=(e,i)=>{this.editor.execute(t),i()}}super.set(t,e,i)}}class yc{constructor(t={}){this._context=t.context||new sn({language:t.language}),this._context._addEditor(this,!t.context);const e=Array.from(this.constructor.builtinPlugins||[]);this.config=new Yi(t,this.constructor.defaultConfig),this.config.define("plugins",e),this.config.define(this._context._getEditorConfig()),this.plugins=new Xi(this,e,this._context.plugins),this.locale=this._context.locale,this.t=this.locale.t,this.commands=new $a,this.set("state","initializing"),this.once("ready",()=>this.state="ready",{priority:"high"}),this.once("destroy",()=>this.state="destroyed",{priority:"high"}),this.set("isReadOnly",!1),this.model=new _c;const i=new Qn;this.data=new ml(this.model,i),this.editing=new Wa(this.model,i),this.editing.view.document.bind("isReadOnly").to(this),this.conversion=new gl([this.editing.downcastDispatcher,this.data.downcastDispatcher],this.data.upcastDispatcher),this.conversion.addAlias("dataDowncast",this.data.downcastDispatcher),this.conversion.addAlias("editingDowncast",this.editing.downcastDispatcher),this.keystrokes=new vc(this),this.keystrokes.listenTo(this.editing.view.document)}initPlugins(){const t=this.config,e=t.get("plugins"),i=t.get("removePlugins")||[],n=t.get("extraPlugins")||[],o=t.get("substitutePlugins")||[];return this.plugins.init(e.concat(n),i,o)}destroy(){let t=Promise.resolve();return"initializing"==this.state&&(t=new Promise(t=>this.once("ready",t))),t.then(()=>{this.fire("destroy"),this.stopListening(),this.commands.destroy()}).then(()=>this.plugins.destroy()).then(()=>{this.model.destroy(),this.data.destroy(),this.editing.destroy(),this.keystrokes.destroy()}).then(()=>this._context._removeEditor(this))}execute(...t){try{return this.commands.execute(...t)}catch(t){l.a.rethrowUnexpectedError(t,this)}}focus(){this.editing.view.focus()}}Kt(yc,Ut);class xc{constructor(t){this.editor=t,this._components=new Map}*names(){for(const t of this._components.values())yield t.originalName}add(t,e){this._components.set(Ac(t),{callback:e,originalName:t})}create(t){if(!this.has(t))throw new l.a("componentfactory-item-missing",this,{name:t});return this._components.get(Ac(t)).callback(this.editor.locale)}has(t){return this._components.has(Ac(t))}}function Ac(t){return String(t).toLowerCase()}class Cc{constructor(t){this.editor=t,this.componentFactory=new xc(t),this.focusTracker=new zs,this._editableElementsMap=new Map,this.listenTo(t.editing.view.document,"layoutChanged",()=>this.update())}get element(){return null}update(){this.fire("update")}destroy(){this.stopListening(),this.focusTracker.destroy();for(const t of this._editableElementsMap.values())t.ckeditorInstance=null;this._editableElementsMap=new Map}setEditableElement(t,e){this._editableElementsMap.set(t,e),e.ckeditorInstance||(e.ckeditorInstance=this.editor)}getEditableElement(t="main"){return this._editableElementsMap.get(t)}getEditableElementsNames(){return this._editableElementsMap.keys()}get _editableElements(){return console.warn("editor-ui-deprecated-editable-elements: The EditorUI#_editableElements property has been deprecated and will be removed in the near future.",{editorUI:this}),this._editableElementsMap}}function Tc(t){if(!I(t.updateSourceElement))throw new l.a("attachtoform-missing-elementapi-interface",t);const e=t.sourceElement;if(e&&"textarea"===e.tagName.toLowerCase()&&e.form){let i;const n=e.form,o=()=>t.updateSourceElement();I(n.submit)&&(i=n.submit,n.submit=()=>{o(),i.apply(n)}),n.addEventListener("submit",o),t.on("destroy",()=>{n.removeEventListener("submit",o),i&&(n.submit=i)})}}Kt(Cc,h);var Ec={setData(t){this.data.set(t)},getData(t){return this.data.get(t)}};var Pc={updateSourceElement(){if(!this.sourceElement)throw new l.a("editor-missing-sourceelement",this);Ns(this.sourceElement,this.data.get())}};function Sc(t){const e=t.sourceElement;if(e){if(e.ckeditorInstance)throw new l.a("editor-source-element-already-used",t);e.ckeditorInstance=t,t.once("destroy",()=>{delete e.ckeditorInstance})}}class Mc extends an{static get pluginName(){return"PendingActions"}init(){this.set("hasAny",!1),this._actions=new Zi({idProperty:"_id"}),this._actions.delegate("add","remove").to(this)}add(t){if("string"!=typeof t)throw new l.a("pendingactions-add-invalid-message",this);const e=Object.create(Ut);return e.set("message",t),this._actions.add(e),this.hasAny=!0,e}remove(t){this._actions.remove(t),this.hasAny=!!this._actions.length}get first(){return this._actions.get(0)}[Symbol.iterator](){return this._actions[Symbol.iterator]()}}const Ic='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m11.591 10.177 4.243 4.242a1 1 0 0 1-1.415 1.415l-4.242-4.243-4.243 4.243a1 1 0 0 1-1.414-1.415l4.243-4.242L4.52 5.934A1 1 0 0 1 5.934 4.52l4.243 4.243 4.242-4.243a1 1 0 1 1 1.415 1.414l-4.243 4.243z"/></svg>',Lc='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M6.972 16.615a.997.997 0 0 1-.744-.292l-4.596-4.596a1 1 0 1 1 1.414-1.414l3.926 3.926 9.937-9.937a1 1 0 0 1 1.414 1.415L7.717 16.323a.997.997 0 0 1-.745.292z"/></svg>',Nc='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m8.636 9.531-2.758 3.94a.5.5 0 0 0 .122.696l3.224 2.284h1.314l2.636-3.736L8.636 9.53zm.288 8.451L5.14 15.396a2 2 0 0 1-.491-2.786l6.673-9.53a2 2 0 0 1 2.785-.49l3.742 2.62a2 2 0 0 1 .491 2.785l-7.269 10.053-2.147-.066z"/><path d="M4 18h5.523v-1H4zm-2 0h1v-1H2z"/></svg>',Rc='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M5.085 6.22 2.943 4.078a.75.75 0 1 1 1.06-1.06l2.592 2.59A11.094 11.094 0 0 1 10 5.068c4.738 0 8.578 3.101 8.578 5.083 0 1.197-1.401 2.803-3.555 3.887l1.714 1.713a.75.75 0 0 1-.09 1.138.488.488 0 0 1-.15.084.75.75 0 0 1-.821-.16L6.17 7.304c-.258.11-.51.233-.757.365l6.239 6.24-.006.005.78.78c-.388.094-.78.166-1.174.215l-1.11-1.11h.011L4.55 8.197a7.2 7.2 0 0 0-.665.514l-.112.098 4.897 4.897-.005.006 1.276 1.276a10.164 10.164 0 0 1-1.477-.117l-.479-.479-.009.009-4.863-4.863-.022.031a2.563 2.563 0 0 0-.124.2c-.043.077-.08.158-.108.241a.534.534 0 0 0-.028.133.29.29 0 0 0 .008.072.927.927 0 0 0 .082.226c.067.133.145.26.234.379l3.242 3.365.025.01.59.623c-3.265-.918-5.59-3.155-5.59-4.668 0-1.194 1.448-2.838 3.663-3.93zm7.07.531a4.632 4.632 0 0 1 1.108 5.992l.345.344.046-.018a9.313 9.313 0 0 0 2-1.112c.256-.187.5-.392.727-.613.137-.134.27-.277.392-.431.072-.091.141-.185.203-.286.057-.093.107-.19.148-.292a.72.72 0 0 0 .036-.12.29.29 0 0 0 .008-.072.492.492 0 0 0-.028-.133.999.999 0 0 0-.036-.096 2.165 2.165 0 0 0-.071-.145 2.917 2.917 0 0 0-.125-.2 3.592 3.592 0 0 0-.263-.335 5.444 5.444 0 0 0-.53-.523 7.955 7.955 0 0 0-1.054-.768 9.766 9.766 0 0 0-1.879-.891c-.337-.118-.68-.219-1.027-.301zm-2.85.21-.069.002a.508.508 0 0 0-.254.097.496.496 0 0 0-.104.679.498.498 0 0 0 .326.199l.045.005c.091.003.181.003.272.012a2.45 2.45 0 0 1 2.017 1.513c.024.061.043.125.069.185a.494.494 0 0 0 .45.287h.008a.496.496 0 0 0 .35-.158.482.482 0 0 0 .13-.335.638.638 0 0 0-.048-.219 3.379 3.379 0 0 0-.36-.723 3.438 3.438 0 0 0-2.791-1.543l-.028-.001h-.013z"/></svg>',Oc='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M6.91 10.54c.26-.23.64-.21.88.03l3.36 3.14 2.23-2.06a.64.64 0 0 1 .87 0l2.52 2.97V4.5H3.2v10.12l3.71-4.08zm10.27-7.51c.6 0 1.09.47 1.09 1.05v11.84c0 .59-.49 1.06-1.09 1.06H2.79c-.6 0-1.09-.47-1.09-1.06V4.08c0-.58.49-1.05 1.1-1.05h14.38zm-5.22 5.56a1.96 1.96 0 1 1 3.4-1.96 1.96 1.96 0 0 1-3.4 1.96z"/></svg>',zc='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 4c0 .414.336.75.75.75h9.929a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0-8c0 .414.336.75.75.75h9.929a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75z"/></svg>',Dc='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm2.286 4c0 .414.336.75.75.75h9.928a.75.75 0 1 0 0-1.5H5.036a.75.75 0 0 0-.75.75zm0-8c0 .414.336.75.75.75h9.928a.75.75 0 1 0 0-1.5H5.036a.75.75 0 0 0-.75.75z"/></svg>',Vc='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M18 3.75a.75.75 0 0 1-.75.75H2.75a.75.75 0 1 1 0-1.5h14.5a.75.75 0 0 1 .75.75zm0 8a.75.75 0 0 1-.75.75H2.75a.75.75 0 1 1 0-1.5h14.5a.75.75 0 0 1 .75.75zm0 4a.75.75 0 0 1-.75.75H7.321a.75.75 0 1 1 0-1.5h9.929a.75.75 0 0 1 .75.75zm0-8a.75.75 0 0 1-.75.75H7.321a.75.75 0 1 1 0-1.5h9.929a.75.75 0 0 1 .75.75z"/></svg>',jc='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 4c0 .414.336.75.75.75h9.929a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0-8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75z"/></svg>',Bc='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path d="M18 4.5V3H2v1.5h16zm0 3V6h-5.674v1.5H18zm0 3V9h-5.674v1.5H18zm0 3V12h-5.674v1.5H18zm-8.5-6V12h-6V7.5h6zm.818-1.5H2.682C2.305 6 2 6.407 2 6.91v5.68c0 .503.305.91.682.91h7.636c.377 0 .682-.407.682-.91V6.91c0-.503-.305-.91-.682-.91zM18 16.5V15H2v1.5h16z"/></svg>',Fc='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 4.5V3h16v1.5zm4.5 3V12h7V7.5h-7zM5.758 6h8.484c.419 0 .758.407.758.91v5.681c0 .502-.34.909-.758.909H5.758c-.419 0-.758-.407-.758-.91V6.91c0-.503.34-.91.758-.91zM2 16.5V15h16v1.5z"/></svg>',Hc='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 4.5V3h16v1.5zm0 3V6h5.674v1.5zm0 3V9h5.674v1.5zm0 3V12h5.674v1.5zm8.5-6V12h6V7.5h-6zM9.682 6h7.636c.377 0 .682.407.682.91v5.68c0 .503-.305.91-.682.91H9.682c-.377 0-.682-.407-.682-.91V6.91c0-.503.305-.91.682-.91zM2 16.5V15h16v1.5z"/></svg>',Uc='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 4.5V3h16v1.5zm2.5 3V12h11V7.5h-11zM4.061 6H15.94c.586 0 1.061.407 1.061.91v5.68c0 .503-.475.91-1.061.91H4.06c-.585 0-1.06-.407-1.06-.91V6.91C3 6.406 3.475 6 4.061 6zM2 16.5V15h16v1.5z"/></svg>',qc='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2.5 17v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zM1 15.5v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm0-2v1h-1v-1h1zm-19 0v1H0v-1h1zM14.5 2v1h-1V2h1zm2 0v1h-1V2h1zm2 0v1h-1V2h1zm-8 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm8 0v1h-1V2h1zm-10 0v1h-1V2h1z"/><path d="M18.095 2H1.905C.853 2 0 2.895 0 4v12c0 1.105.853 2 1.905 2h16.19C19.147 18 20 17.105 20 16V4c0-1.105-.853-2-1.905-2zm0 1.5c.263 0 .476.224.476.5v12c0 .276-.213.5-.476.5H1.905a.489.489 0 0 1-.476-.5V4c0-.276.213-.5.476-.5h16.19z"/></svg>',Wc='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2.5 17v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zM1 15.5v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm0-2v1h-1v-1h1zm-19 0v1H0v-1h1zM14.5 2v1h-1V2h1zm2 0v1h-1V2h1zm2 0v1h-1V2h1zm-8 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm8 0v1h-1V2h1zm-10 0v1h-1V2h1z"/><path d="M13 6H2a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2zm0 1.5a.5.5 0 0 1 .5.5v8a.5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5V8a.5.5 0 0 1 .5-.5h11z"/></svg>',$c='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2.5 17v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zM1 15.5v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm0-2v1h-1v-1h1zm-19 0v1H0v-1h1zM14.5 2v1h-1V2h1zm2 0v1h-1V2h1zm2 0v1h-1V2h1zm-8 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm8 0v1h-1V2h1zm-10 0v1h-1V2h1z"/><path d="M7 10H2a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h5a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2zm0 1.5a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5v-4a.5.5 0 0 1 .5-.5h5z"/></svg>',Gc='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2.5 17v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zM1 15.5v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm0-2v1h-1v-1h1zm-19 0v1H0v-1h1zM14.5 2v1h-1V2h1zm2 0v1h-1V2h1zm2 0v1h-1V2h1zm-8 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm8 0v1h-1V2h1zm-10 0v1h-1V2h1z"/><path d="M10 8H2a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2v-6a2 2 0 0 0-2-2zm0 1.5a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5v-6a.5.5 0 0 1 .5-.5h8z"/></svg>',Yc='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m7.3 17.37-.061.088a1.518 1.518 0 0 1-.934.535l-4.178.663-.806-4.153a1.495 1.495 0 0 1 .187-1.058l.056-.086L8.77 2.639c.958-1.351 2.803-1.076 4.296-.03 1.497 1.047 2.387 2.693 1.433 4.055L7.3 17.37zM9.14 4.728l-5.545 8.346 3.277 2.294 5.544-8.346L9.14 4.728zM6.07 16.512l-3.276-2.295.53 2.73 2.746-.435zM9.994 3.506 13.271 5.8c.316-.452-.16-1.333-1.065-1.966-.905-.634-1.895-.78-2.212-.328zM8 18.5 9.375 17H19v1.5H8z"/></svg>',Kc='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M3 10.423a6.5 6.5 0 0 1 6.056-6.408l.038.67C6.448 5.423 5.354 7.663 5.22 10H9c.552 0 .5.432.5.986v4.511c0 .554-.448.503-1 .503h-5c-.552 0-.5-.449-.5-1.003v-4.574zm8 0a6.5 6.5 0 0 1 6.056-6.408l.038.67c-2.646.739-3.74 2.979-3.873 5.315H17c.552 0 .5.432.5.986v4.511c0 .554-.448.503-1 .503h-5c-.552 0-.5-.449-.5-1.003v-4.574z"/></svg>',Qc='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle cx="9.5" cy="4.5" r="1.5"/><circle cx="9.5" cy="10.5" r="1.5"/><circle cx="9.5" cy="16.5" r="1.5"/></svg>';function Jc({emitter:t,activator:e,callback:i,contextElements:n}){t.listenTo(document,"mousedown",(t,o)=>{if(!e())return;const r="function"==typeof o.composedPath?o.composedPath():[];for(const t of n)if(t.contains(o.target)||r.includes(t))return;i()})}function Zc(t){t.set("_isCssTransitionsDisabled",!1),t.disableCssTransitions=()=>{t._isCssTransitionsDisabled=!0},t.enableCssTransitions=()=>{t._isCssTransitionsDisabled=!1},t.extendTemplate({attributes:{class:[t.bindTemplate.if("_isCssTransitionsDisabled","ck-transitions-disabled")]}})}function Xc({view:t}){t.listenTo(t.element,"submit",(e,i)=>{i.preventDefault(),t.fire("submit")},{useCapture:!0})}class td extends Zi{constructor(t=[]){super(t,{idProperty:"viewUid"}),this.on("add",(t,e,i)=>{this._renderViewIntoCollectionParent(e,i)}),this.on("remove",(t,e)=>{e.element&&this._parentElement&&e.element.remove()}),this._parentElement=null}destroy(){this.map(t=>t.destroy())}setParent(t){this._parentElement=t;for(const t of this)this._renderViewIntoCollectionParent(t)}delegate(...t){if(!t.length||!t.every(t=>"string"==typeof t))throw new l.a("ui-viewcollection-delegate-wrong-events",this);return{to:e=>{for(const i of this)for(const n of t)i.delegate(n).to(e);this.on("add",(i,n)=>{for(const i of t)n.delegate(i).to(e)}),this.on("remove",(i,n)=>{for(const i of t)n.stopDelegating(i,e)})}}}_renderViewIntoCollectionParent(t,e){t.isRendered||t.render(),t.element&&this._parentElement&&this._parentElement.insertBefore(t.element,this._parentElement.children[e])}}i(14);class ed{constructor(t){this.element=null,this.isRendered=!1,this.locale=t,this.t=t&&t.t,this._viewCollections=new Zi,this._unboundChildren=this.createCollection(),this._viewCollections.on("add",(e,i)=>{i.locale=t}),this.decorate("render")}get bindTemplate(){return this._bindTemplate?this._bindTemplate:this._bindTemplate=id.bind(this,this)}createCollection(t){const e=new td(t);return this._viewCollections.add(e),e}registerChild(t){Ji(t)||(t=[t]);for(const e of t)this._unboundChildren.add(e)}deregisterChild(t){Ji(t)||(t=[t]);for(const e of t)this._unboundChildren.remove(e)}setTemplate(t){this.template=new id(t)}extendTemplate(t){id.extend(this.template,t)}render(){if(this.isRendered)throw new l.a("ui-view-render-already-rendered",this);this.template&&(this.element=this.template.render(),this.registerChild(this.template.getViews())),this.isRendered=!0}destroy(){this.stopListening(),this._viewCollections.map(t=>t.destroy()),this.template&&this.template._revertData&&this.template.revert(this.element)}}Kt(ed,Ir),Kt(ed,Ut);class id{constructor(t){Object.assign(this,ud(hd(t))),this._isRendered=!1,this._revertData=null}render(){const t=this._renderNode({intoFragment:!0});return this._isRendered=!0,t}apply(t){return this._revertData={children:[],bindings:[],attributes:{}},this._renderNode({node:t,isApplying:!0,revertData:this._revertData}),t}revert(t){if(!this._revertData)throw new l.a("ui-template-revert-not-applied",[this,t]);this._revertTemplateFromNode(t,this._revertData)}*getViews(){yield*function*t(e){if(e.children)for(const i of e.children)wd(i)?yield i:bd(i)&&(yield*t(i))}(this)}static bind(t,e){return{to:(i,n)=>new od({eventNameOrFunction:i,attribute:i,observable:t,emitter:e,callback:n}),if:(i,n,o)=>new rd({observable:t,emitter:e,attribute:i,valueIfTrue:n,callback:o})}}static extend(t,e){if(t._isRendered)throw new l.a("template-extend-render",[this,t]);!function t(e,i){i.attributes&&(e.attributes||(e.attributes={}),fd(e.attributes,i.attributes));i.eventListeners&&(e.eventListeners||(e.eventListeners={}),fd(e.eventListeners,i.eventListeners));i.text&&e.text.push(...i.text);if(i.children&&i.children.length){if(e.children.length!=i.children.length)throw new l.a("ui-template-extend-children-mismatch",e);let n=0;for(const o of i.children)t(e.children[n++],o)}}(t,ud(hd(e)))}_renderNode(t){let e;if(e=t.node?this.tag&&this.text:this.tag?this.text:!this.text,e)throw new l.a("ui-template-wrong-syntax",this);return this.text?this._renderText(t):this._renderElement(t)}_renderElement(t){let e=t.node;return e||(e=t.node=document.createElementNS(this.ns||"http://www.w3.org/1999/xhtml",this.tag)),this._renderAttributes(t),this._renderElementChildren(t),this._setUpListeners(t),e}_renderText(t){let e=t.node;return e?t.revertData.text=e.textContent:e=t.node=document.createTextNode(""),sd(this.text)?this._bindToObservable({schema:this.text,updater:ld(e),data:t}):e.textContent=this.text.join(""),e}_renderAttributes(t){let e,i,n,o;if(!this.attributes)return;const r=t.node,s=t.revertData;for(e in this.attributes)if(n=r.getAttribute(e),i=this.attributes[e],s&&(s.attributes[e]=n),o=b(i[0])&&i[0].ns?i[0].ns:null,sd(i)){const a=o?i[0].value:i;s&&_d(e)&&a.unshift(n),this._bindToObservable({schema:a,updater:cd(r,e,o),data:t})}else"style"==e&&"string"!=typeof i[0]?this._renderStyleAttribute(i[0],t):(s&&n&&_d(e)&&i.unshift(n),i=i.map(t=>t&&t.value||t).reduce((t,e)=>t.concat(e),[]).reduce(gd,""),pd(i)||r.setAttributeNS(o,e,i))}_renderStyleAttribute(t,e){const i=e.node;for(const n in t){const o=t[n];sd(o)?this._bindToObservable({schema:[o],updater:dd(i,n),data:e}):i.style[n]=o}}_renderElementChildren(t){const e=t.node,i=t.intoFragment?document.createDocumentFragment():e,n=t.isApplying;let o=0;for(const r of this.children)if(kd(r)){if(!n){r.setParent(e);for(const t of r)i.appendChild(t.element)}}else if(wd(r))n||(r.isRendered||r.render(),i.appendChild(r.element));else if(fr(r))i.appendChild(r);else if(n){const e={children:[],bindings:[],attributes:{}};t.revertData.children.push(e),r._renderNode({node:i.childNodes[o++],isApplying:!0,revertData:e})}else i.appendChild(r.render());t.intoFragment&&e.appendChild(i)}_setUpListeners(t){if(this.eventListeners)for(const e in this.eventListeners){const i=this.eventListeners[e].map(i=>{const[n,o]=e.split("@");return i.activateDomEventListener(n,o,t)});t.revertData&&t.revertData.bindings.push(i)}}_bindToObservable({schema:t,updater:e,data:i}){const n=i.revertData;ad(t,e,i);const o=t.filter(t=>!pd(t)).filter(t=>t.observable).map(n=>n.activateAttributeListener(t,e,i));n&&n.bindings.push(o)}_revertTemplateFromNode(t,e){for(const t of e.bindings)for(const e of t)e();if(e.text)t.textContent=e.text;else{for(const i in e.attributes){const n=e.attributes[i];null===n?t.removeAttribute(i):t.setAttribute(i,n)}for(let i=0;i<e.children.length;++i)this._revertTemplateFromNode(t.childNodes[i],e.children[i])}}}Kt(id,h);class nd{constructor(t){Object.assign(this,t)}getValue(t){const e=this.observable[this.attribute];return this.callback?this.callback(e,t):e}activateAttributeListener(t,e,i){const n=()=>ad(t,e,i);return this.emitter.listenTo(this.observable,"change:"+this.attribute,n),()=>{this.emitter.stopListening(this.observable,"change:"+this.attribute,n)}}}class od extends nd{activateDomEventListener(t,e,i){const n=(t,i)=>{e&&!i.target.matches(e)||("function"==typeof this.eventNameOrFunction?this.eventNameOrFunction(i):this.observable.fire(this.eventNameOrFunction,i))};return this.emitter.listenTo(i.node,t,n),()=>{this.emitter.stopListening(i.node,t,n)}}}class rd extends nd{getValue(t){return!pd(super.getValue(t))&&(this.valueIfTrue||!0)}}function sd(t){return!!t&&(t.value&&(t=t.value),Array.isArray(t)?t.some(sd):t instanceof nd)}function ad(t,e,{node:i}){let n=function(t,e){return t.map(t=>t instanceof nd?t.getValue(e):t)}(t,i);n=1==t.length&&t[0]instanceof rd?n[0]:n.reduce(gd,""),pd(n)?e.remove():e.set(n)}function ld(t){return{set(e){t.textContent=e},remove(){t.textContent=""}}}function cd(t,e,i){return{set(n){t.setAttributeNS(i,e,n)},remove(){t.removeAttributeNS(i,e)}}}function dd(t,e){return{set(i){t.style[e]=i},remove(){t.style[e]=null}}}function hd(t){return $i(t,t=>{if(t&&(t instanceof nd||bd(t)||wd(t)||kd(t)))return t})}function ud(t){if("string"==typeof t?t=function(t){return{text:[t]}}(t):t.text&&function(t){t.text=tn(t.text)}(t),t.on&&(t.eventListeners=function(t){for(const e in t)md(t,e);return t}(t.on),delete t.on),!t.text){t.attributes&&function(t){for(const e in t)t[e].value&&(t[e].value=tn(t[e].value)),md(t,e)}(t.attributes);const e=[];if(t.children)if(kd(t.children))e.push(t.children);else for(const i of t.children)bd(i)||wd(i)||fr(i)?e.push(i):e.push(new id(i));t.children=e}return t}function md(t,e){t[e]=tn(t[e])}function gd(t,e){return pd(e)?t:pd(t)?e:`${t} ${e}`}function fd(t,e){for(const i in e)t[i]?t[i].push(...e[i]):t[i]=e[i]}function pd(t){return!t&&0!==t}function wd(t){return t instanceof ed}function bd(t){return t instanceof id}function kd(t){return t instanceof td}function _d(t){return"class"==t||"style"==t}class vd extends td{constructor(t,e=[]){super(e),this.locale=t}attachToDom(){this._bodyCollectionContainer=new id({tag:"div",attributes:{class:["ck","ck-reset_all","ck-body","ck-rounded-corners"],dir:this.locale.uiLanguageDirection},children:this}).render();let t=document.querySelector(".ck-body-wrapper");t||(t=xs(document,"div",{class:"ck-body-wrapper"}),document.body.appendChild(t)),t.appendChild(this._bodyCollectionContainer)}detachFromDom(){super.destroy(),this._bodyCollectionContainer&&this._bodyCollectionContainer.remove();const t=document.querySelector(".ck-body-wrapper");t&&0==t.childElementCount&&t.remove()}}i(16);class yd extends ed{constructor(){super();const t=this.bindTemplate;this.set("content",""),this.set("viewBox","0 0 20 20"),this.set("fillColor",""),this.setTemplate({tag:"svg",ns:"http://www.w3.org/2000/svg",attributes:{class:["ck","ck-icon"],viewBox:t.to("viewBox")}})}render(){super.render(),this._updateXMLContent(),this._colorFillPaths(),this.on("change:content",()=>{this._updateXMLContent(),this._colorFillPaths()}),this.on("change:fillColor",()=>{this._colorFillPaths()})}_updateXMLContent(){if(this.content){const t=(new DOMParser).parseFromString(this.content.trim(),"image/svg+xml").querySelector("svg"),e=t.getAttribute("viewBox");for(e&&(this.viewBox=e),this.element.innerHTML="";t.childNodes.length>0;)this.element.appendChild(t.childNodes[0])}}_colorFillPaths(){this.fillColor&&this.element.querySelectorAll(".ck-icon__fill").forEach(t=>{t.style.fill=this.fillColor})}}i(18);class xd extends ed{constructor(t){super(t),this.set("text",""),this.set("position","s");const e=this.bindTemplate;this.setTemplate({tag:"span",attributes:{class:["ck","ck-tooltip",e.to("position",t=>"ck-tooltip_"+t),e.if("text","ck-hidden",t=>!t.trim())]},children:[{tag:"span",attributes:{class:["ck","ck-tooltip__text"]},children:[{text:e.to("text")}]}]})}}i(20);class Ad extends ed{constructor(t){super(t);const e=this.bindTemplate,i=s();this.set("class"),this.set("labelStyle"),this.set("icon"),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isVisible",!0),this.set("isToggleable",!1),this.set("keystroke"),this.set("label"),this.set("tabindex",-1),this.set("tooltip"),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.set("withKeystroke",!1),this.children=this.createCollection(),this.tooltipView=this._createTooltipView(),this.labelView=this._createLabelView(i),this.iconView=new yd,this.iconView.extendTemplate({attributes:{class:"ck-button__icon"}}),this.keystrokeView=this._createKeystrokeView(),this.bind("_tooltipString").to(this,"tooltip",this,"label",this,"keystroke",this._getTooltipString.bind(this)),this.setTemplate({tag:"button",attributes:{class:["ck","ck-button",e.to("class"),e.if("isEnabled","ck-disabled",t=>!t),e.if("isVisible","ck-hidden",t=>!t),e.to("isOn",t=>t?"ck-on":"ck-off"),e.if("withText","ck-button_with-text"),e.if("withKeystroke","ck-button_with-keystroke")],type:e.to("type",t=>t||"button"),tabindex:e.to("tabindex"),"aria-labelledby":"ck-editor__aria-label_"+i,"aria-disabled":e.if("isEnabled",!0,t=>!t),"aria-pressed":e.to("isOn",t=>!!this.isToggleable&&String(t))},children:this.children,on:{mousedown:e.to(t=>{t.preventDefault()}),click:e.to(t=>{this.isEnabled?this.fire("execute"):t.preventDefault()})}})}render(){super.render(),this.icon&&(this.iconView.bind("content").to(this,"icon"),this.children.add(this.iconView)),this.children.add(this.tooltipView),this.children.add(this.labelView),this.withKeystroke&&this.children.add(this.keystrokeView)}focus(){this.element.focus()}_createTooltipView(){const t=new xd;return t.bind("text").to(this,"_tooltipString"),t.bind("position").to(this,"tooltipPosition"),t}_createLabelView(t){const e=new ed,i=this.bindTemplate;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__label"],style:i.to("labelStyle"),id:"ck-editor__aria-label_"+t},children:[{text:this.bindTemplate.to("label")}]}),e}_createKeystrokeView(){const t=new ed;return t.setTemplate({tag:"span",attributes:{class:["ck","ck-button__keystroke"]},children:[{text:this.bindTemplate.to("keystroke",t=>Oo(t))}]}),t}_getTooltipString(t,e,i){return t?"string"==typeof t?t:(i&&(i=Oo(i)),t instanceof Function?t(e,i):`${e}${i?` (${i})`:""}`):""}}i(22);class Cd extends Ad{constructor(t){super(t),this.isToggleable=!0,this.toggleSwitchView=this._createToggleView(),this.extendTemplate({attributes:{class:"ck-switchbutton"}})}render(){super.render(),this.children.add(this.toggleSwitchView)}_createToggleView(){const t=new ed;return t.setTemplate({tag:"span",attributes:{class:["ck","ck-button__toggle"]},children:[{tag:"span",attributes:{class:["ck","ck-button__toggle__inner"]}}]}),t}}function Td(t){return"string"==typeof t?{model:t,label:t,hasBorder:!1,view:{name:"span",styles:{color:t}}}:{model:t.color,label:t.label||t.color,hasBorder:void 0!==t.hasBorder&&t.hasBorder,view:{name:"span",styles:{color:""+t.color}}}}class Ed extends Ad{constructor(t){super(t);const e=this.bindTemplate;this.set("color"),this.set("hasBorder"),this.icon='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path class="ck-icon__fill" d="M16.935 5.328a2 2 0 0 1 0 2.829l-7.778 7.778a2 2 0 0 1-2.829 0L3.5 13.107a1.999 1.999 0 1 1 2.828-2.829l.707.707a1 1 0 0 0 1.414 0l5.658-5.657a2 2 0 0 1 2.828 0z"/><path d="M14.814 6.035 8.448 12.4a1 1 0 0 1-1.414 0l-1.413-1.415A1 1 0 1 0 4.207 12.4l2.829 2.829a1 1 0 0 0 1.414 0l7.778-7.778a1 1 0 1 0-1.414-1.415z"/></svg>',this.extendTemplate({attributes:{style:{backgroundColor:e.to("color")},class:["ck","ck-color-grid__tile",e.if("hasBorder","ck-color-table__color-tile_bordered")]}})}render(){super.render(),this.iconView.fillColor="hsl(0, 0%, 100%)"}}class Pd{constructor(t){if(Object.assign(this,t),t.actions&&t.keystrokeHandler)for(const e in t.actions){let i=t.actions[e];"string"==typeof i&&(i=[i]);for(const n of i)t.keystrokeHandler.set(n,(t,i)=>{this[e](),i()})}}get first(){return this.focusables.find(Sd)||null}get last(){return this.focusables.filter(Sd).slice(-1)[0]||null}get next(){return this._getFocusableItem(1)}get previous(){return this._getFocusableItem(-1)}get current(){let t=null;return null===this.focusTracker.focusedElement?null:(this.focusables.find((e,i)=>{const n=e.element===this.focusTracker.focusedElement;return n&&(t=i),n}),t)}focusFirst(){this._focus(this.first)}focusLast(){this._focus(this.last)}focusNext(){this._focus(this.next)}focusPrevious(){this._focus(this.previous)}_focus(t){t&&t.focus()}_getFocusableItem(t){const e=this.current,i=this.focusables.length;if(!i)return null;if(null===e)return this[1===t?"first":"last"];let n=(e+i+t)%i;do{const e=this.focusables.get(n);if(Sd(e))return e;n=(n+i+t)%i}while(n!==e);return null}}function Sd(t){return!(!t.focus||"none"==_r.window.getComputedStyle(t.element).display)}i(24);class Md extends ed{constructor(t,e){super(t);const i=e&&e.colorDefinitions||[],n={};e&&e.columns&&(n.gridTemplateColumns=`repeat( ${e.columns}, 1fr)`),this.set("selectedColor"),this.items=this.createCollection(),this.focusTracker=new zs,this.keystrokes=new Ds,this._focusCycler=new Pd({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowleft",focusNext:"arrowright"}}),this.items.on("add",(t,e)=>{e.isOn=e.color===this.selectedColor}),i.forEach(t=>{const e=new Ed;e.set({color:t.color,label:t.label,tooltip:!0,hasBorder:t.options.hasBorder}),e.on("execute",()=>{this.fire("execute",{value:t.color,hasBorder:t.options.hasBorder,label:t.label})}),this.items.add(e)}),this.setTemplate({tag:"div",children:this.items,attributes:{class:["ck","ck-color-grid"],style:n}}),this.on("change:selectedColor",(t,e,i)=>{for(const t of this.items)t.isOn=t.color===i})}focus(){this.items.length&&this.items.first.focus()}focusLast(){this.items.length&&this.items.last.focus()}render(){super.render();for(const t of this.items)this.focusTracker.add(t.element);this.items.on("add",(t,e)=>{this.focusTracker.add(e.element)}),this.items.on("remove",(t,e)=>{this.focusTracker.remove(e.element)}),this.keystrokes.listenTo(this.element)}}var Id='<svg viewBox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"><path d="M.941 4.523a.75.75 0 1 1 1.06-1.06l3.006 3.005 3.005-3.005a.75.75 0 1 1 1.06 1.06l-3.549 3.55a.75.75 0 0 1-1.168-.136L.941 4.523z"/></svg>';class Ld extends Ad{constructor(t){super(t),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{"aria-haspopup":!0}}),this.delegate("execute").to(this,"open")}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){const t=new yd;return t.content=Id,t.extendTemplate({attributes:{class:"ck-dropdown__arrow"}}),t}}i(26);class Nd extends ed{constructor(t){super(t);const e=this.bindTemplate;this.set("icon"),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isToggleable",!1),this.set("isVisible",!0),this.set("keystroke"),this.set("label"),this.set("tabindex",-1),this.set("tooltip"),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.children=this.createCollection(),this.actionView=this._createActionView(),this.arrowView=this._createArrowView(),this.keystrokes=new Ds,this.focusTracker=new zs,this.setTemplate({tag:"div",attributes:{class:["ck","ck-splitbutton",e.if("isVisible","ck-hidden",t=>!t),this.arrowView.bindTemplate.if("isOn","ck-splitbutton_open")]},children:this.children})}render(){super.render(),this.children.add(this.actionView),this.children.add(this.arrowView),this.focusTracker.add(this.actionView.element),this.focusTracker.add(this.arrowView.element),this.keystrokes.listenTo(this.element),this.keystrokes.set("arrowright",(t,e)=>{this.focusTracker.focusedElement===this.actionView.element&&(this.arrowView.focus(),e())}),this.keystrokes.set("arrowleft",(t,e)=>{this.focusTracker.focusedElement===this.arrowView.element&&(this.actionView.focus(),e())})}focus(){this.actionView.focus()}_createActionView(){const t=new Ad;return t.bind("icon","isEnabled","isOn","isToggleable","keystroke","label","tabindex","tooltip","tooltipPosition","type","withText").to(this),t.extendTemplate({attributes:{class:"ck-splitbutton__action"}}),t.delegate("execute").to(this),t}_createArrowView(){const t=new Ad,e=t.bindTemplate;return t.icon=Id,t.extendTemplate({attributes:{class:"ck-splitbutton__arrow","aria-haspopup":!0,"aria-expanded":e.to("isOn",t=>String(t))}}),t.bind("isEnabled").to(this),t.delegate("execute").to(this,"open"),t}}class Rd extends ed{constructor(t){super(t);const e=this.bindTemplate;this.set("isVisible",!1),this.set("position","se"),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-dropdown__panel",e.to("position",t=>"ck-dropdown__panel_"+t),e.if("isVisible","ck-dropdown__panel-visible")]},children:this.children,on:{selectstart:e.to(t=>t.preventDefault())}})}focus(){this.children.length&&this.children.first.focus()}focusLast(){if(this.children.length){const t=this.children.last;"function"==typeof t.focusLast?t.focusLast():t.focus()}}}i(28);function Od({element:t,target:e,positions:i,limiter:n,fitInViewport:o}){I(e)&&(e=e()),I(n)&&(n=n());const r=function(t){return t&&t.parentNode?t.offsetParent===_r.document.body?null:t.offsetParent:null}(t),s=new Ps(t),a=new Ps(e);let l,c;if(n||o){const t=function(t,e){const{elementRect:i,viewportRect:n}=e,o=i.getArea(),r=function(t,{targetRect:e,elementRect:i,limiterRect:n,viewportRect:o}){const r=[],s=i.getArea();for(const a of t){const t=zd(a,e,i);if(!t)continue;const[l,c]=t;let d=0,h=0;if(n)if(o){const t=n.getIntersection(o);t&&(d=t.getIntersectionArea(c))}else d=n.getIntersectionArea(c);o&&(h=o.getIntersectionArea(c));const u={positionName:l,positionRect:c,limiterIntersectArea:d,viewportIntersectArea:h};if(d===s)return[u];r.push(u)}return r}(t,e);if(n){const t=Dd(r.filter(({viewportIntersectArea:t})=>t===o),o);if(t)return t}return Dd(r,o)}(i,{targetRect:a,elementRect:s,limiterRect:n&&new Ps(n).getVisible(),viewportRect:o&&new Ps(_r.window)});[c,l]=t||zd(i[0],a,s)}else[c,l]=zd(i[0],a,s);let d=Vd(l);return r&&(d=function({left:t,top:e},i){const n=Vd(new Ps(i)),o=Ts(i);return t-=n.left,e-=n.top,t+=i.scrollLeft,e+=i.scrollTop,t-=o.left,e-=o.top,{left:t,top:e}}(d,r)),{left:d.left,top:d.top,name:c}}function zd(t,e,i){const n=t(e,i);if(!n)return null;const{left:o,top:r,name:s}=n;return[s,i.clone().moveTo(o,r)]}function Dd(t,e){let i,n,o=0;for(const{positionName:r,positionRect:s,limiterIntersectArea:a,viewportIntersectArea:l}of t){if(a===e)return[r,s];const t=l**2+a**2;t>o&&(o=t,i=s,n=r)}return i?[n,i]:null}function Vd({left:t,top:e}){const{scrollX:i,scrollY:n}=_r.window;return{left:t+i,top:e+n}}class jd extends ed{constructor(t,e,i){super(t);const n=this.bindTemplate;this.buttonView=e,this.panelView=i,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("class"),this.set("id"),this.set("panelPosition","auto"),this.keystrokes=new Ds,this.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown",n.to("class"),n.if("isEnabled","ck-disabled",t=>!t)],id:n.to("id"),"aria-describedby":n.to("ariaDescribedById")},children:[e,i]}),e.extendTemplate({attributes:{class:["ck-dropdown__button"]}})}render(){super.render(),this.listenTo(this.buttonView,"open",()=>{this.isOpen=!this.isOpen}),this.panelView.bind("isVisible").to(this,"isOpen"),this.on("change:isOpen",()=>{this.isOpen&&("auto"===this.panelPosition?this.panelView.position=jd._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions}).name:this.panelView.position=this.panelPosition)}),this.keystrokes.listenTo(this.element);const t=(t,e)=>{this.isOpen&&(this.buttonView.focus(),this.isOpen=!1,e())};this.keystrokes.set("arrowdown",(t,e)=>{this.buttonView.isEnabled&&!this.isOpen&&(this.isOpen=!0,e())}),this.keystrokes.set("arrowright",(t,e)=>{this.isOpen&&e()}),this.keystrokes.set("arrowleft",t),this.keystrokes.set("esc",t)}focus(){this.buttonView.focus()}get _panelPositions(){const{south:t,north:e,southEast:i,southWest:n,northEast:o,northWest:r,southMiddleEast:s,southMiddleWest:a,northMiddleEast:l,northMiddleWest:c}=jd.defaultPanelPositions;return"rtl"!==this.locale.uiLanguageDirection?[i,n,s,a,t,o,r,l,c,e]:[n,i,a,s,t,r,o,c,l,e]}}jd.defaultPanelPositions={south:(t,e)=>({top:t.bottom,left:t.left-(e.width-t.width)/2,name:"s"}),southEast:t=>({top:t.bottom,left:t.left,name:"se"}),southWest:(t,e)=>({top:t.bottom,left:t.left-e.width+t.width,name:"sw"}),southMiddleEast:(t,e)=>({top:t.bottom,left:t.left-(e.width-t.width)/4,name:"sme"}),southMiddleWest:(t,e)=>({top:t.bottom,left:t.left-3*(e.width-t.width)/4,name:"smw"}),north:(t,e)=>({top:t.top-e.height,left:t.left-(e.width-t.width)/2,name:"n"}),northEast:(t,e)=>({top:t.top-e.height,left:t.left,name:"ne"}),northWest:(t,e)=>({top:t.top-e.height,left:t.left-e.width+t.width,name:"nw"}),northMiddleEast:(t,e)=>({top:t.top-e.height,left:t.left-(e.width-t.width)/4,name:"nme"}),northMiddleWest:(t,e)=>({top:t.top-e.height,left:t.left-3*(e.width-t.width)/4,name:"nmw"})},jd._getOptimalPosition=Od;class Bd extends ed{constructor(t){super(t),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__separator"]}})}}class Fd extends ed{constructor(t){super(t),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__line-break"]}})}}function Hd(t){return Array.isArray(t)?{items:t,removeItems:[]}:t?Object.assign({items:[],removeItems:[]},t):{items:[],removeItems:[]}}i(30);class Ud extends ed{constructor(t,e){super(t);const i=this.bindTemplate,n=this.t;this.options=e||{},this.set("ariaLabel",n("Editor toolbar")),this.set("maxWidth","auto"),this.items=this.createCollection(),this.focusTracker=new zs,this.keystrokes=new Ds,this.set("class"),this.set("isCompact",!1),this.itemsView=new qd(t),this.children=this.createCollection(),this.children.add(this.itemsView),this.focusables=this.createCollection();const o="rtl"===t.uiLanguageDirection;this._focusCycler=new Pd({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:[o?"arrowright":"arrowleft","arrowup"],focusNext:[o?"arrowleft":"arrowright","arrowdown"]}});const r=["ck","ck-toolbar",i.to("class"),i.if("isCompact","ck-toolbar_compact")];var s;this.options.shouldGroupWhenFull&&this.options.isFloating&&r.push("ck-toolbar_floating"),this.setTemplate({tag:"div",attributes:{class:r,role:"toolbar","aria-label":i.to("ariaLabel"),style:{maxWidth:i.to("maxWidth")}},children:this.children,on:{mousedown:(s=this,s.bindTemplate.to(t=>{t.target===s.element&&t.preventDefault()}))}}),this._behavior=this.options.shouldGroupWhenFull?new $d(this):new Wd(this)}render(){super.render();for(const t of this.items)this.focusTracker.add(t.element);this.items.on("add",(t,e)=>{this.focusTracker.add(e.element)}),this.items.on("remove",(t,e)=>{this.focusTracker.remove(e.element)}),this.keystrokes.listenTo(this.element),this._behavior.render(this)}destroy(){return this._behavior.destroy(),super.destroy()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}fillFromConfig(t,e){const i=Hd(t),n=i.items.filter((t,n,o)=>"|"===t||-1===i.removeItems.indexOf(t)&&("-"===t?!this.options.shouldGroupWhenFull||(Object(l.b)("toolbarview-line-break-ignored-when-grouping-items",o),!1):!!e.has(t)||(Object(l.b)("toolbarview-item-unavailable",{name:t}),!1))),o=this._cleanSeparators(n).map(t=>"|"===t?new Bd:"-"===t?new Fd:e.create(t));this.items.addMany(o)}_cleanSeparators(t){const e=t=>"-"!==t&&"|"!==t,i=t.length,n=t.findIndex(e),o=i-t.slice().reverse().findIndex(e);return t.slice(n,o).filter((t,i,n)=>{if(e(t))return!0;return!(i>0&&n[i-1]===t)})}}class qd extends ed{constructor(t){super(t),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar__items"]},children:this.children})}}class Wd{constructor(t){const e=t.bindTemplate;t.set("isVertical",!1),t.itemsView.children.bindTo(t.items).using(t=>t),t.focusables.bindTo(t.items).using(t=>t),t.extendTemplate({attributes:{class:[e.if("isVertical","ck-toolbar_vertical")]}})}render(){}destroy(){}}class $d{constructor(t){this.view=t,this.viewChildren=t.children,this.viewFocusables=t.focusables,this.viewItemsView=t.itemsView,this.viewFocusTracker=t.focusTracker,this.viewLocale=t.locale,this.ungroupedItems=t.createCollection(),this.groupedItems=t.createCollection(),this.groupedItemsDropdown=this._createGroupedItemsDropdown(),this.resizeObserver=null,this.cachedPadding=null,this.shouldUpdateGroupingOnNextResize=!1,t.itemsView.children.bindTo(this.ungroupedItems).using(t=>t),this.ungroupedItems.on("add",this._updateFocusCycleableItems.bind(this)),this.ungroupedItems.on("remove",this._updateFocusCycleableItems.bind(this)),t.children.on("add",this._updateFocusCycleableItems.bind(this)),t.children.on("remove",this._updateFocusCycleableItems.bind(this)),t.items.on("change",(t,e)=>{const i=e.index;for(const t of e.removed)i>=this.ungroupedItems.length?this.groupedItems.remove(t):this.ungroupedItems.remove(t);for(let t=i;t<i+e.added.length;t++){const n=e.added[t-i];t>this.ungroupedItems.length?this.groupedItems.add(n,t-this.ungroupedItems.length):this.ungroupedItems.add(n,t)}this._updateGrouping()}),t.extendTemplate({attributes:{class:["ck-toolbar_grouping"]}})}render(t){this.viewElement=t.element,this._enableGroupingOnResize(),this._enableGroupingOnMaxWidthChange(t)}destroy(){this.groupedItemsDropdown.destroy(),this.resizeObserver.destroy()}_updateGrouping(){if(!this.viewElement.ownerDocument.body.contains(this.viewElement))return;if(!this.viewElement.offsetParent)return void(this.shouldUpdateGroupingOnNextResize=!0);const t=this.groupedItems.length;let e;for(;this._areItemsOverflowing;)this._groupLastItem(),e=!0;if(!e&&this.groupedItems.length){for(;this.groupedItems.length&&!this._areItemsOverflowing;)this._ungroupFirstItem();this._areItemsOverflowing&&this._groupLastItem()}this.groupedItems.length!==t&&this.view.fire("groupedItemsUpdate")}get _areItemsOverflowing(){if(!this.ungroupedItems.length)return!1;const t=this.viewElement,e=this.viewLocale.uiLanguageDirection,i=new Ps(t.lastChild),n=new Ps(t);if(!this.cachedPadding){const i=_r.window.getComputedStyle(t),n="ltr"===e?"paddingRight":"paddingLeft";this.cachedPadding=Number.parseInt(i[n])}return"ltr"===e?i.right>n.right-this.cachedPadding:i.left<n.left+this.cachedPadding}_enableGroupingOnResize(){let t;this.resizeObserver=new Is(this.viewElement,e=>{t&&t===e.contentRect.width&&!this.shouldUpdateGroupingOnNextResize||(this.shouldUpdateGroupingOnNextResize=!1,this._updateGrouping(),t=e.contentRect.width)}),this._updateGrouping()}_enableGroupingOnMaxWidthChange(t){t.on("change:maxWidth",()=>{this._updateGrouping()})}_groupLastItem(){this.groupedItems.length||(this.viewChildren.add(new Bd),this.viewChildren.add(this.groupedItemsDropdown),this.viewFocusTracker.add(this.groupedItemsDropdown.element)),this.groupedItems.add(this.ungroupedItems.remove(this.ungroupedItems.last),0)}_ungroupFirstItem(){this.ungroupedItems.add(this.groupedItems.remove(this.groupedItems.first)),this.groupedItems.length||(this.viewChildren.remove(this.groupedItemsDropdown),this.viewChildren.remove(this.viewChildren.last),this.viewFocusTracker.remove(this.groupedItemsDropdown.element))}_createGroupedItemsDropdown(){const t=this.viewLocale,e=t.t,i=Qd(t);return i.class="ck-toolbar__grouped-dropdown",i.panelPosition="ltr"===t.uiLanguageDirection?"sw":"se",Jd(i,[]),i.buttonView.set({label:e("Show more items"),tooltip:!0,tooltipPosition:"rtl"===t.uiLanguageDirection?"se":"sw",icon:Qc}),i.toolbarView.items.bindTo(this.groupedItems).using(t=>t),i}_updateFocusCycleableItems(){this.viewFocusables.clear(),this.ungroupedItems.map(t=>{this.viewFocusables.add(t)}),this.groupedItems.length&&this.viewFocusables.add(this.groupedItemsDropdown)}}i(32);class Gd extends ed{constructor(){super(),this.items=this.createCollection(),this.focusTracker=new zs,this.keystrokes=new Ds,this._focusCycler=new Pd({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowup",focusNext:"arrowdown"}}),this.setTemplate({tag:"ul",attributes:{class:["ck","ck-reset","ck-list"]},children:this.items})}render(){super.render();for(const t of this.items)this.focusTracker.add(t.element);this.items.on("add",(t,e)=>{this.focusTracker.add(e.element)}),this.items.on("remove",(t,e)=>{this.focusTracker.remove(e.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}}class Yd extends ed{constructor(t){super(t),this.children=this.createCollection(),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__item"]},children:this.children})}focus(){this.children.first.focus()}}class Kd extends ed{constructor(t){super(t),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__separator"]}})}}i(34),i(36);function Qd(t,e=Ld){const i=new e(t),n=new Rd(t),o=new jd(t,i,n);return i.bind("isEnabled").to(o),i instanceof Ld?i.bind("isOn").to(o,"isOpen"):i.arrowView.bind("isOn").to(o,"isOpen"),function(t){(function(t){t.on("render",()=>{Jc({emitter:t,activator:()=>t.isOpen,callback:()=>{t.isOpen=!1},contextElements:[t.element]})})})(t),function(t){t.on("execute",e=>{e.source instanceof Cd||(t.isOpen=!1)})}(t),function(t){t.keystrokes.set("arrowdown",(e,i)=>{t.isOpen&&(t.panelView.focus(),i())}),t.keystrokes.set("arrowup",(e,i)=>{t.isOpen&&(t.panelView.focusLast(),i())})}(t)}(o),o}function Jd(t,e){const i=t.locale,n=i.t,o=t.toolbarView=new Ud(i);o.set("ariaLabel",n("Dropdown toolbar")),t.extendTemplate({attributes:{class:["ck-toolbar-dropdown"]}}),e.map(t=>o.items.add(t)),t.panelView.children.add(o),o.items.delegate("execute").to(t)}function Zd(t,e){const i=t.locale,n=t.listView=new Gd(i);n.items.bindTo(e).using(({type:t,model:e})=>{if("separator"===t)return new Kd(i);if("button"===t||"switchbutton"===t){const n=new Yd(i);let o;return o="button"===t?new Ad(i):new Cd(i),o.bind(...Object.keys(e)).to(e),o.delegate("execute").to(n),n.children.add(o),n}}),t.panelView.children.add(n),n.items.delegate("execute").to(t)}i(38);class Xd extends ed{constructor(t){super(t),this.body=new vd(t)}render(){super.render(),this.body.attachToDom()}destroy(){return this.body.detachFromDom(),super.destroy()}}i(40);class th extends ed{constructor(t){super(t),this.set("text"),this.set("for"),this.id="ck-editor__label_"+s();const e=this.bindTemplate;this.setTemplate({tag:"label",attributes:{class:["ck","ck-label"],id:this.id,for:e.to("for")},children:[{text:e.to("text")}]})}}class eh extends Xd{constructor(t){super(t),this.top=this.createCollection(),this.main=this.createCollection(),this._voiceLabelView=this._createVoiceLabel(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-editor","ck-rounded-corners"],role:"application",dir:t.uiLanguageDirection,lang:t.uiLanguage,"aria-labelledby":this._voiceLabelView.id},children:[this._voiceLabelView,{tag:"div",attributes:{class:["ck","ck-editor__top","ck-reset_all"],role:"presentation"},children:this.top},{tag:"div",attributes:{class:["ck","ck-editor__main"],role:"presentation"},children:this.main}]})}_createVoiceLabel(){const t=this.t,e=new th;return e.text=t("Rich Text Editor"),e.extendTemplate({attributes:{class:"ck-voice-label"}}),e}}class ih extends ed{constructor(t,e,i){super(t),this.setTemplate({tag:"div",attributes:{class:["ck","ck-content","ck-editor__editable","ck-rounded-corners"],lang:t.contentLanguage,dir:t.contentLanguageDirection}}),this.name=null,this.set("isFocused",!1),this._editableElement=i,this._hasExternalElement=!!this._editableElement,this._editingView=e}render(){super.render(),this._hasExternalElement?this.template.apply(this.element=this._editableElement):this._editableElement=this.element,this.on("change:isFocused",()=>this._updateIsFocusedClasses()),this._updateIsFocusedClasses()}destroy(){this._hasExternalElement&&this.template.revert(this._editableElement),super.destroy()}_updateIsFocusedClasses(){const t=this._editingView;function e(e){t.change(i=>{const n=t.document.getRoot(e.name);i.addClass(e.isFocused?"ck-focused":"ck-blurred",n),i.removeClass(e.isFocused?"ck-blurred":"ck-focused",n)})}t.isRenderingInProgress?function i(n){t.once("change:isRenderingInProgress",(t,o,r)=>{r?i(n):e(n)})}(this):e(this)}}class nh extends ih{constructor(t,e,i){super(t,e,i),this.extendTemplate({attributes:{role:"textbox",class:"ck-editor__editable_inline"}})}render(){super.render();const t=this._editingView,e=this.t;t.change(i=>{const n=t.document.getRoot(this.name);i.setAttribute("aria-label",e("Rich Text Editor, %0",this.name),n)})}}i(42);class oh extends ed{constructor(t,e={}){super(t);const i=this.bindTemplate;this.set("label",e.label||""),this.set("class",e.class||null),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-form__header",i.to("class")]},children:this.children});const n=new ed(t);n.setTemplate({tag:"span",attributes:{class:["ck","ck-form__header__label"]},children:[{text:i.to("label")}]}),this.children.add(n)}}i(44);class rh extends ed{constructor(t){super(t),this.set("value"),this.set("id"),this.set("placeholder"),this.set("isReadOnly",!1),this.set("hasError",!1),this.set("ariaDescribedById"),this.focusTracker=new zs,this.bind("isFocused").to(this.focusTracker),this.set("isEmpty",!0);const e=this.bindTemplate;this.setTemplate({tag:"input",attributes:{type:"text",class:["ck","ck-input","ck-input-text",e.if("isFocused","ck-input_focused"),e.if("isEmpty","ck-input-text_empty"),e.if("hasError","ck-error")],id:e.to("id"),placeholder:e.to("placeholder"),readonly:e.to("isReadOnly"),"aria-invalid":e.if("hasError",!0),"aria-describedby":e.to("ariaDescribedById")},on:{input:e.to("input"),change:e.to(this._updateIsEmpty.bind(this))}})}render(){super.render(),this.focusTracker.add(this.element),this._setDomElementValue(this.value),this._updateIsEmpty(),this.on("change:value",(t,e,i)=>{this._setDomElementValue(i),this._updateIsEmpty()})}select(){this.element.select()}focus(){this.element.focus()}_updateIsEmpty(){this.isEmpty=!this.element.value}_setDomElementValue(t){this.element.value=t||0===t?t:""}}i(46);class sh extends ed{constructor(t,e){super(t);const i="ck-labeled-field-view-"+s(),n="ck-labeled-field-view-status-"+s();this.fieldView=e(this,i,n),this.set("label"),this.set("isEnabled",!0),this.set("isEmpty",!0),this.set("isFocused",!1),this.set("errorText",null),this.set("infoText",null),this.set("class"),this.set("placeholder"),this.labelView=this._createLabelView(i),this.statusView=this._createStatusView(n),this.bind("_statusText").to(this,"errorText",this,"infoText",(t,e)=>t||e);const o=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view",o.to("class"),o.if("isEnabled","ck-disabled",t=>!t),o.if("isEmpty","ck-labeled-field-view_empty"),o.if("isFocused","ck-labeled-field-view_focused"),o.if("placeholder","ck-labeled-field-view_placeholder"),o.if("errorText","ck-error")]},children:[{tag:"div",attributes:{class:["ck","ck-labeled-field-view__input-wrapper"]},children:[this.fieldView,this.labelView]},this.statusView]})}_createLabelView(t){const e=new th(this.locale);return e.for=t,e.bind("text").to(this,"label"),e}_createStatusView(t){const e=new ed(this.locale),i=this.bindTemplate;return e.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view__status",i.if("errorText","ck-labeled-field-view__status_error"),i.if("_statusText","ck-hidden",t=>!t)],id:t,role:i.if("errorText","alert")},children:[{text:i.to("_statusText")}]}),e}focus(){this.fieldView.focus()}}function ah(t,e,i){const n=new rh(t.locale);return n.set({id:e,ariaDescribedById:i}),n.bind("isReadOnly").to(t,"isEnabled",t=>!t),n.bind("hasError").to(t,"errorText",t=>!!t),n.on("input",()=>{t.errorText=null}),t.bind("isEmpty","isFocused","placeholder").to(n),n}class lh extends an{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 ch{constructor(t,e){e&&zt(this,e),t&&this.set(t)}}Kt(ch,Ut);i(48);const dh=Rs("px"),hh=_r.document.body;class uh extends ed{constructor(t){super(t);const e=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("position","arrow_nw"),this.set("isVisible",!1),this.set("withArrow",!0),this.set("class"),this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-panel",e.to("position",t=>"ck-balloon-panel_"+t),e.if("isVisible","ck-balloon-panel_visible"),e.if("withArrow","ck-balloon-panel_with-arrow"),e.to("class")],style:{top:e.to("top",dh),left:e.to("left",dh)}},children:this.content})}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(t){this.show();const e=uh.defaultPositions,i=Object.assign({},{element:this.element,positions:[e.southArrowNorth,e.southArrowNorthMiddleWest,e.southArrowNorthMiddleEast,e.southArrowNorthWest,e.southArrowNorthEast,e.northArrowSouth,e.northArrowSouthMiddleWest,e.northArrowSouthMiddleEast,e.northArrowSouthWest,e.northArrowSouthEast],limiter:hh,fitInViewport:!0},t),n=uh._getOptimalPosition(i),o=parseInt(n.left),r=parseInt(n.top),s=n.name;Object.assign(this,{top:r,left:o,position:s})}pin(t){this.unpin(),this._pinWhenIsVisibleCallback=()=>{this.isVisible?this._startPinning(t):this._stopPinning()},this._startPinning(t),this.listenTo(this,"change:isVisible",this._pinWhenIsVisibleCallback)}unpin(){this._pinWhenIsVisibleCallback&&(this._stopPinning(),this.stopListening(this,"change:isVisible",this._pinWhenIsVisibleCallback),this._pinWhenIsVisibleCallback=null,this.hide())}_startPinning(t){this.attachTo(t);const e=mh(t.target),i=t.limiter?mh(t.limiter):hh;this.listenTo(_r.document,"scroll",(n,o)=>{const r=o.target,s=e&&r.contains(e),a=i&&r.contains(i);!s&&!a&&e&&i||this.attachTo(t)},{useCapture:!0}),this.listenTo(_r.window,"resize",()=>{this.attachTo(t)})}_stopPinning(){this.stopListening(_r.document,"scroll"),this.stopListening(_r.window,"resize")}}function mh(t){return Gi(t)?t:Cs(t)?t.commonAncestorContainer:"function"==typeof t?mh(t()):null}function gh(t,e){return t.top-e.height-uh.arrowVerticalOffset}function fh(t){return t.bottom+uh.arrowVerticalOffset}uh.arrowHorizontalOffset=25,uh.arrowVerticalOffset=10,uh._getOptimalPosition=Od,uh.defaultPositions={northWestArrowSouthWest:(t,e)=>({top:gh(t,e),left:t.left-uh.arrowHorizontalOffset,name:"arrow_sw"}),northWestArrowSouthMiddleWest:(t,e)=>({top:gh(t,e),left:t.left-.25*e.width-uh.arrowHorizontalOffset,name:"arrow_smw"}),northWestArrowSouth:(t,e)=>({top:gh(t,e),left:t.left-e.width/2,name:"arrow_s"}),northWestArrowSouthMiddleEast:(t,e)=>({top:gh(t,e),left:t.left-.75*e.width+uh.arrowHorizontalOffset,name:"arrow_sme"}),northWestArrowSouthEast:(t,e)=>({top:gh(t,e),left:t.left-e.width+uh.arrowHorizontalOffset,name:"arrow_se"}),northArrowSouthWest:(t,e)=>({top:gh(t,e),left:t.left+t.width/2-uh.arrowHorizontalOffset,name:"arrow_sw"}),northArrowSouthMiddleWest:(t,e)=>({top:gh(t,e),left:t.left+t.width/2-.25*e.width-uh.arrowHorizontalOffset,name:"arrow_smw"}),northArrowSouth:(t,e)=>({top:gh(t,e),left:t.left+t.width/2-e.width/2,name:"arrow_s"}),northArrowSouthMiddleEast:(t,e)=>({top:gh(t,e),left:t.left+t.width/2-.75*e.width+uh.arrowHorizontalOffset,name:"arrow_sme"}),northArrowSouthEast:(t,e)=>({top:gh(t,e),left:t.left+t.width/2-e.width+uh.arrowHorizontalOffset,name:"arrow_se"}),northEastArrowSouthWest:(t,e)=>({top:gh(t,e),left:t.right-uh.arrowHorizontalOffset,name:"arrow_sw"}),northEastArrowSouthMiddleWest:(t,e)=>({top:gh(t,e),left:t.right-.25*e.width-uh.arrowHorizontalOffset,name:"arrow_smw"}),northEastArrowSouth:(t,e)=>({top:gh(t,e),left:t.right-e.width/2,name:"arrow_s"}),northEastArrowSouthMiddleEast:(t,e)=>({top:gh(t,e),left:t.right-.75*e.width+uh.arrowHorizontalOffset,name:"arrow_sme"}),northEastArrowSouthEast:(t,e)=>({top:gh(t,e),left:t.right-e.width+uh.arrowHorizontalOffset,name:"arrow_se"}),southWestArrowNorthWest:(t,e)=>({top:fh(t),left:t.left-uh.arrowHorizontalOffset,name:"arrow_nw"}),southWestArrowNorthMiddleWest:(t,e)=>({top:fh(t),left:t.left-.25*e.width-uh.arrowHorizontalOffset,name:"arrow_nmw"}),southWestArrowNorth:(t,e)=>({top:fh(t),left:t.left-e.width/2,name:"arrow_n"}),southWestArrowNorthMiddleEast:(t,e)=>({top:fh(t),left:t.left-.75*e.width+uh.arrowHorizontalOffset,name:"arrow_nme"}),southWestArrowNorthEast:(t,e)=>({top:fh(t),left:t.left-e.width+uh.arrowHorizontalOffset,name:"arrow_ne"}),southArrowNorthWest:(t,e)=>({top:fh(t),left:t.left+t.width/2-uh.arrowHorizontalOffset,name:"arrow_nw"}),southArrowNorthMiddleWest:(t,e)=>({top:fh(t),left:t.left+t.width/2-.25*e.width-uh.arrowHorizontalOffset,name:"arrow_nmw"}),southArrowNorth:(t,e)=>({top:fh(t),left:t.left+t.width/2-e.width/2,name:"arrow_n"}),southArrowNorthMiddleEast:(t,e)=>({top:fh(t),left:t.left+t.width/2-.75*e.width+uh.arrowHorizontalOffset,name:"arrow_nme"}),southArrowNorthEast:(t,e)=>({top:fh(t),left:t.left+t.width/2-e.width+uh.arrowHorizontalOffset,name:"arrow_ne"}),southEastArrowNorthWest:(t,e)=>({top:fh(t),left:t.right-uh.arrowHorizontalOffset,name:"arrow_nw"}),southEastArrowNorthMiddleWest:(t,e)=>({top:fh(t),left:t.right-.25*e.width-uh.arrowHorizontalOffset,name:"arrow_nmw"}),southEastArrowNorth:(t,e)=>({top:fh(t),left:t.right-e.width/2,name:"arrow_n"}),southEastArrowNorthMiddleEast:(t,e)=>({top:fh(t),left:t.right-.75*e.width+uh.arrowHorizontalOffset,name:"arrow_nme"}),southEastArrowNorthEast:(t,e)=>({top:fh(t),left:t.right-e.width+uh.arrowHorizontalOffset,name:"arrow_ne"})};i(50),i(52);const ph=Rs("px");class wh extends Qt{static get pluginName(){return"ContextualBalloon"}constructor(t){super(t),this.positionLimiter=()=>{const t=this.editor.editing.view,e=t.document.selection.editableElement;return e?t.domConverter.mapViewToDom(e.root):null},this.set("visibleView",null),this.view=new uh(t.locale),t.ui.view.body.add(this.view),t.ui.focusTracker.add(this.view.element),this._viewToStack=new Map,this._idToStack=new Map,this.set("_numberOfStacks",0),this.set("_singleViewMode",!1),this._rotatorView=this._createRotatorView(),this._fakePanelsView=this._createFakePanelsView()}hasView(t){return Array.from(this._viewToStack.keys()).includes(t)}add(t){if(this.hasView(t.view))throw new l.a("contextualballoon-add-view-exist",[this,t]);const e=t.stackId||"main";if(!this._idToStack.has(e))return this._idToStack.set(e,new Map([[t.view,t]])),this._viewToStack.set(t.view,this._idToStack.get(e)),this._numberOfStacks=this._idToStack.size,void(this._visibleStack&&!t.singleViewMode||this.showStack(e));const i=this._idToStack.get(e);t.singleViewMode&&this.showStack(e),i.set(t.view,t),this._viewToStack.set(t.view,i),i===this._visibleStack&&this._showView(t)}remove(t){if(!this.hasView(t))throw new l.a("contextualballoon-remove-view-not-exist",[this,t]);const e=this._viewToStack.get(t);this._singleViewMode&&this.visibleView===t&&(this._singleViewMode=!1),this.visibleView===t&&(1===e.size?this._idToStack.size>1?this._showNextStack():(this.view.hide(),this.visibleView=null,this._rotatorView.hideView()):this._showView(Array.from(e.values())[e.size-2])),1===e.size?(this._idToStack.delete(this._getStackId(e)),this._numberOfStacks=this._idToStack.size):e.delete(t),this._viewToStack.delete(t)}updatePosition(t){t&&(this._visibleStack.get(this.visibleView).position=t),this.view.pin(this._getBalloonPosition()),this._fakePanelsView.updatePosition()}showStack(t){this.visibleStack=t;const e=this._idToStack.get(t);if(!e)throw new l.a("contextualballoon-showstack-stack-not-exist",this);this._visibleStack!==e&&this._showView(Array.from(e.values()).pop())}get _visibleStack(){return this._viewToStack.get(this.visibleView)}_getStackId(t){return Array.from(this._idToStack.entries()).find(e=>e[1]===t)[0]}_showNextStack(){const t=Array.from(this._idToStack.values());let e=t.indexOf(this._visibleStack)+1;t[e]||(e=0),this.showStack(this._getStackId(t[e]))}_showPrevStack(){const t=Array.from(this._idToStack.values());let e=t.indexOf(this._visibleStack)-1;t[e]||(e=t.length-1),this.showStack(this._getStackId(t[e]))}_createRotatorView(){const t=new bh(this.editor.locale),e=this.editor.locale.t;return this.view.content.add(t),t.bind("isNavigationVisible").to(this,"_numberOfStacks",this,"_singleViewMode",(t,e)=>!e&&t>1),t.on("change:isNavigationVisible",()=>this.updatePosition(),{priority:"low"}),t.bind("counter").to(this,"visibleView",this,"_numberOfStacks",(t,i)=>{if(i<2)return"";const n=Array.from(this._idToStack.values()).indexOf(this._visibleStack)+1;return e("%0 of %1",[n,i])}),t.buttonNextView.on("execute",()=>{t.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showNextStack()}),t.buttonPrevView.on("execute",()=>{t.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showPrevStack()}),t}_createFakePanelsView(){const t=new kh(this.editor.locale,this.view);return t.bind("numberOfPanels").to(this,"_numberOfStacks",this,"_singleViewMode",(t,e)=>!e&&t>=2?Math.min(t-1,2):0),t.listenTo(this.view,"change:top",()=>t.updatePosition()),t.listenTo(this.view,"change:left",()=>t.updatePosition()),this.editor.ui.view.body.add(t),t}_showView({view:t,balloonClassName:e="",withArrow:i=!0,singleViewMode:n=!1}){this.view.class=e,this.view.withArrow=i,this._rotatorView.showView(t),this.visibleView=t,this.view.pin(this._getBalloonPosition()),this._fakePanelsView.updatePosition(),n&&(this._singleViewMode=!0)}_getBalloonPosition(){let t=Array.from(this._visibleStack.values()).pop().position;return t&&!t.limiter&&(t=Object.assign({},t,{limiter:this.positionLimiter})),t}}class bh extends ed{constructor(t){super(t);const e=t.t,i=this.bindTemplate;this.set("isNavigationVisible",!0),this.focusTracker=new zs,this.buttonPrevView=this._createButtonView(e("Previous"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11.463 5.187a.888.888 0 1 1 1.254 1.255L9.16 10l3.557 3.557a.888.888 0 1 1-1.254 1.255L7.26 10.61a.888.888 0 0 1 .16-1.382l4.043-4.042z"/></svg>'),this.buttonNextView=this._createButtonView(e("Next"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M8.537 14.813a.888.888 0 1 1-1.254-1.255L10.84 10 7.283 6.442a.888.888 0 1 1 1.254-1.255L12.74 9.39a.888.888 0 0 1-.16 1.382l-4.043 4.042z"/></svg>'),this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-rotator"],"z-index":"-1"},children:[{tag:"div",attributes:{class:["ck-balloon-rotator__navigation",i.to("isNavigationVisible",t=>t?"":"ck-hidden")]},children:[this.buttonPrevView,{tag:"span",attributes:{class:["ck-balloon-rotator__counter"]},children:[{text:i.to("counter")}]},this.buttonNextView]},{tag:"div",attributes:{class:"ck-balloon-rotator__content"},children:this.content}]})}render(){super.render(),this.focusTracker.add(this.element)}showView(t){this.hideView(),this.content.add(t)}hideView(){this.content.clear()}_createButtonView(t,e){const i=new Ad(this.locale);return i.set({label:t,icon:e,tooltip:!0}),i}}class kh extends ed{constructor(t,e){super(t);const i=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("height",0),this.set("width",0),this.set("numberOfPanels",0),this.content=this.createCollection(),this._balloonPanelView=e,this.setTemplate({tag:"div",attributes:{class:["ck-fake-panel",i.to("numberOfPanels",t=>t?"":"ck-hidden")],style:{top:i.to("top",ph),left:i.to("left",ph),width:i.to("width",ph),height:i.to("height",ph)}},children:this.content}),this.on("change:numberOfPanels",(t,e,i,n)=>{i>n?this._addPanels(i-n):this._removePanels(n-i),this.updatePosition()})}_addPanels(t){for(;t--;){const t=new ed;t.setTemplate({tag:"div"}),this.content.add(t),this.registerChild(t)}}_removePanels(t){for(;t--;){const t=this.content.last;this.content.remove(t),this.deregisterChild(t),t.destroy()}}updatePosition(){if(this.numberOfPanels){const{top:t,left:e}=this._balloonPanelView,{width:i,height:n}=new Ps(this._balloonPanelView.element);Object.assign(this,{top:t,left:e,width:i,height:n})}}}i(54);const _h=Rs("px");class vh extends ed{constructor(t){super(t);const e=this.bindTemplate;this.set("isActive",!1),this.set("isSticky",!1),this.set("limiterElement",null),this.set("limiterBottomOffset",50),this.set("viewportTopOffset",0),this.set("_marginLeft",null),this.set("_isStickyToTheLimiter",!1),this.set("_hasViewportTopOffset",!1),this.content=this.createCollection(),this._contentPanelPlaceholder=new id({tag:"div",attributes:{class:["ck","ck-sticky-panel__placeholder"],style:{display:e.to("isSticky",t=>t?"block":"none"),height:e.to("isSticky",t=>t?_h(this._panelRect.height):null)}}}).render(),this._contentPanel=new id({tag:"div",attributes:{class:["ck","ck-sticky-panel__content",e.if("isSticky","ck-sticky-panel__content_sticky"),e.if("_isStickyToTheLimiter","ck-sticky-panel__content_sticky_bottom-limit")],style:{width:e.to("isSticky",t=>t?_h(this._contentPanelPlaceholder.getBoundingClientRect().width):null),top:e.to("_hasViewportTopOffset",t=>t?_h(this.viewportTopOffset):null),bottom:e.to("_isStickyToTheLimiter",t=>t?_h(this.limiterBottomOffset):null),marginLeft:e.to("_marginLeft")}},children:this.content}).render(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-sticky-panel"]},children:[this._contentPanelPlaceholder,this._contentPanel]})}render(){super.render(),this._checkIfShouldBeSticky(),this.listenTo(_r.window,"scroll",()=>{this._checkIfShouldBeSticky()}),this.listenTo(this,"change:isActive",()=>{this._checkIfShouldBeSticky()})}_checkIfShouldBeSticky(){const t=this._panelRect=this._contentPanel.getBoundingClientRect();let e;this.limiterElement?(e=this._limiterRect=this.limiterElement.getBoundingClientRect(),this.isSticky=this.isActive&&e.top<this.viewportTopOffset&&this._panelRect.height+this.limiterBottomOffset<e.height):this.isSticky=!1,this.isSticky?(this._isStickyToTheLimiter=e.bottom<t.height+this.limiterBottomOffset+this.viewportTopOffset,this._hasViewportTopOffset=!this._isStickyToTheLimiter&&!!this.viewportTopOffset,this._marginLeft=this._isStickyToTheLimiter?null:_h(-_r.window.scrollX)):(this._isStickyToTheLimiter=!1,this._hasViewportTopOffset=!1,this._marginLeft=null)}}function yh({origin:t,originKeystrokeHandler:e,originFocusTracker:i,toolbar:n,beforeFocus:o,afterBlur:r}){i.add(n.element),e.set("Alt+F10",(t,e)=>{i.isFocused&&!n.focusTracker.isFocused&&(o&&o(),n.focus(),e())}),n.keystrokes.set("Esc",(e,i)=>{n.focusTracker.isFocused&&(t.focus(),r&&r(),i())})}const xh=Rs("px");class Ah extends Qt{static get pluginName(){return"BalloonToolbar"}static get requires(){return[wh]}constructor(t){super(t),this._balloonConfig=Hd(t.config.get("balloonToolbar")),this.toolbarView=this._createToolbarView(),this.focusTracker=new zs,t.ui.once("ready",()=>{this.focusTracker.add(t.ui.getEditableElement()),this.focusTracker.add(this.toolbarView.element)}),this._resizeObserver=null,this._balloon=t.plugins.get(wh),this._fireSelectionChangeDebounced=fs(()=>this.fire("_selectionChangeDebounced"),200),this.decorate("show")}init(){const t=this.editor,e=t.model.document.selection;this.listenTo(this.focusTracker,"change:isFocused",(t,e,i)=>{const n=this._balloon.visibleView===this.toolbarView;!i&&n?this.hide():i&&this.show()}),this.listenTo(e,"change:range",(t,i)=>{(i.directChange||e.isCollapsed)&&this.hide(),this._fireSelectionChangeDebounced()}),this.listenTo(this,"_selectionChangeDebounced",()=>{this.editor.editing.view.document.isFocused&&this.show()}),this._balloonConfig.shouldNotGroupWhenFull||this.listenTo(t,"ready",()=>{const e=t.ui.view.editable.element;this._resizeObserver=new Is(e,()=>{this.toolbarView.maxWidth=xh(.9*new Ps(e).width)})}),this.listenTo(this.toolbarView,"groupedItemsUpdate",()=>{this._updatePosition()})}afterInit(){const t=this.editor.ui.componentFactory;this.toolbarView.fillFromConfig(this._balloonConfig,t)}_createToolbarView(){const t=!this._balloonConfig.shouldNotGroupWhenFull,e=new Ud(this.editor.locale,{shouldGroupWhenFull:t,isFloating:!0});return e.render(),e}show(){const t=this.editor,e=t.model.document.selection,i=t.model.schema;this._balloon.hasView(this.toolbarView)||e.isCollapsed||function(t,e){if(1===t.rangeCount)return!1;return[...t.getRanges()].every(t=>{const i=t.getContainedElement();return i&&e.isSelectable(i)})}(e,i)||Array.from(this.toolbarView.items).every(t=>void 0!==t.isEnabled&&!t.isEnabled)||(this.listenTo(this.editor.ui,"update",()=>{this._updatePosition()}),this._balloon.add({view:this.toolbarView,position:this._getBalloonPositionData(),balloonClassName:"ck-toolbar-container"}))}hide(){this._balloon.hasView(this.toolbarView)&&(this.stopListening(this.editor.ui,"update"),this._balloon.remove(this.toolbarView))}_getBalloonPositionData(){const t=this.editor.editing.view,e=t.document,i=e.selection,n=e.selection.isBackward;return{target:()=>{const e=n?i.getFirstRange():i.getLastRange(),o=Ps.getDomRangeRects(t.domConverter.viewRangeToDom(e));return n?o[0]:(o.length>1&&0===o[o.length-1].width&&o.pop(),o[o.length-1])},positions:Ch(n)}}_updatePosition(){this._balloon.updatePosition(this._getBalloonPositionData())}destroy(){super.destroy(),this.stopListening(),this._fireSelectionChangeDebounced.cancel(),this.toolbarView.destroy(),this.focusTracker.destroy(),this._resizeObserver&&this._resizeObserver.destroy()}}function Ch(t){const e=uh.defaultPositions;return t?[e.northWestArrowSouth,e.northWestArrowSouthWest,e.northWestArrowSouthEast,e.northWestArrowSouthMiddleEast,e.northWestArrowSouthMiddleWest,e.southWestArrowNorth,e.southWestArrowNorthWest,e.southWestArrowNorthEast,e.southWestArrowNorthMiddleWest,e.southWestArrowNorthMiddleEast]:[e.southEastArrowNorth,e.southEastArrowNorthEast,e.southEastArrowNorthWest,e.southEastArrowNorthMiddleEast,e.southEastArrowNorthMiddleWest,e.northEastArrowSouth,e.northEastArrowSouthEast,e.northEastArrowSouthWest,e.northEastArrowSouthMiddleEast,e.northEastArrowSouthMiddleWest]}i(56);Rs("px");Rs("px");i(58);const Th=new WeakMap;function Eh(t){const{view:e,element:i,text:n,isDirectHost:o=!0,keepOnFocus:r=!1}=t,s=e.document;Th.has(s)||(Th.set(s,new Map),s.registerPostFixer(t=>Sh(s,t))),Th.get(s).set(i,{text:n,isDirectHost:o,keepOnFocus:r,hostElement:o?i:null}),e.change(t=>Sh(s,t))}function Ph(t,e){return!!e.hasClass("ck-placeholder")&&(t.removeClass("ck-placeholder",e),!0)}function Sh(t,e){const i=Th.get(t),n=[];let o=!1;for(const[t,r]of i)r.isDirectHost&&(n.push(t),Mh(e,t,r)&&(o=!0));for(const[t,r]of i){if(r.isDirectHost)continue;const i=Ih(t);i&&(n.includes(i)||(r.hostElement=i,Mh(e,t,r)&&(o=!0)))}return o}function Mh(t,e,i){const{text:n,isDirectHost:o,hostElement:r}=i;let s=!1;r.getAttribute("data-placeholder")!==n&&(t.setAttribute("data-placeholder",n,r),s=!0);return(o||1==e.childCount)&&function(t,e){if(!t.isAttached())return!1;if(Array.from(t.getChildren()).some(t=>!t.is("uiElement")))return!1;if(e)return!0;const i=t.document;if(!i.isFocused)return!0;const n=i.selection.anchor;return n&&n.parent!==t}(r,i.keepOnFocus)?function(t,e){return!e.hasClass("ck-placeholder")&&(t.addClass("ck-placeholder",e),!0)}(t,r)&&(s=!0):Ph(t,r)&&(s=!0),s}function Ih(t){if(t.childCount){const e=t.getChild(0);if(e.is("element")&&!e.is("uiElement"))return e}return null}const Lh=new Map;function Nh(t,e,i){let n=Lh.get(t);n||(n=new Map,Lh.set(t,n)),n.set(e,i)}function Rh(t){return[t]}function Oh(t,e,i={}){const n=function(t,e){const i=Lh.get(t);return i&&i.has(e)?i.get(e):Rh}(t.constructor,e.constructor);try{return n(t=t.clone(),e,i)}catch(t){throw t}}function zh(t,e,i){t=t.slice(),e=e.slice();const n=new Dh(i.document,i.useRelations,i.forceWeakRemove);n.setOriginalOperations(t),n.setOriginalOperations(e);const o=n.originalOperations;if(0==t.length||0==e.length)return{operationsA:t,operationsB:e,originalOperations:o};const r=new WeakMap;for(const e of t)r.set(e,0);const s={nextBaseVersionA:t[t.length-1].baseVersion+1,nextBaseVersionB:e[e.length-1].baseVersion+1,originalOperationsACount:t.length,originalOperationsBCount:e.length};let a=0;for(;a<t.length;){const i=t[a],o=r.get(i);if(o==e.length){a++;continue}const s=e[o],l=Oh(i,s,n.getContext(i,s,!0)),c=Oh(s,i,n.getContext(s,i,!1));n.updateRelation(i,s),n.setOriginalOperations(l,i),n.setOriginalOperations(c,s);for(const t of l)r.set(t,o+c.length);t.splice(a,1,...l),e.splice(o,1,...c)}if(i.padWithNoOps){const i=t.length-s.originalOperationsACount,n=e.length-s.originalOperationsBCount;jh(t,n-i),jh(e,i-n)}return Vh(t,s.nextBaseVersionB),Vh(e,s.nextBaseVersionA),{operationsA:t,operationsB:e,originalOperations:o}}class Dh{constructor(t,e,i=!1){this.originalOperations=new Map,this._history=t.history,this._useRelations=e,this._forceWeakRemove=!!i,this._relations=new Map}setOriginalOperations(t,e=null){const i=e?this.originalOperations.get(e):null;for(const e of t)this.originalOperations.set(e,i||e)}updateRelation(t,e){switch(t.constructor){case Ml:switch(e.constructor){case Ol:t.targetPosition.isEqual(e.sourcePosition)||e.movedRange.containsPosition(t.targetPosition)?this._setRelation(t,e,"insertAtSource"):t.targetPosition.isEqual(e.deletionPosition)?this._setRelation(t,e,"insertBetween"):t.targetPosition.isAfter(e.sourcePosition)&&this._setRelation(t,e,"moveTargetAfter");break;case Ml:t.targetPosition.isEqual(e.sourcePosition)||t.targetPosition.isBefore(e.sourcePosition)?this._setRelation(t,e,"insertBefore"):this._setRelation(t,e,"insertAfter")}break;case zl:switch(e.constructor){case Ol:t.splitPosition.isBefore(e.sourcePosition)&&this._setRelation(t,e,"splitBefore");break;case Ml:if(t.splitPosition.isEqual(e.sourcePosition)||t.splitPosition.isBefore(e.sourcePosition))this._setRelation(t,e,"splitBefore");else{const i=aa._createFromPositionAndShift(e.sourcePosition,e.howMany);if(t.splitPosition.hasSameParentAs(e.sourcePosition)&&i.containsPosition(t.splitPosition)){const n=i.end.offset-t.splitPosition.offset,o=t.splitPosition.offset-i.start.offset;this._setRelation(t,e,{howMany:n,offset:o})}}}break;case Ol:switch(e.constructor){case Ol:t.targetPosition.isEqual(e.sourcePosition)||this._setRelation(t,e,"mergeTargetNotMoved"),t.sourcePosition.isEqual(e.targetPosition)&&this._setRelation(t,e,"mergeSourceNotMoved"),t.sourcePosition.isEqual(e.sourcePosition)&&this._setRelation(t,e,"mergeSameElement");break;case zl:t.sourcePosition.isEqual(e.splitPosition)&&this._setRelation(t,e,"splitAtSource")}break;case Ll:{const i=t.newRange;if(!i)return;switch(e.constructor){case Ml:{const n=aa._createFromPositionAndShift(e.sourcePosition,e.howMany),o=n.containsPosition(i.start)||n.start.isEqual(i.start),r=n.containsPosition(i.end)||n.end.isEqual(i.end);!o&&!r||n.containsRange(i)||this._setRelation(t,e,{side:o?"left":"right",path:o?i.start.path.slice():i.end.path.slice()});break}case Ol:{const n=i.start.isEqual(e.targetPosition),o=i.start.isEqual(e.deletionPosition),r=i.end.isEqual(e.deletionPosition),s=i.end.isEqual(e.sourcePosition);(n||o||r||s)&&this._setRelation(t,e,{wasInLeftElement:n,wasStartBeforeMergedElement:o,wasEndBeforeMergedElement:r,wasInRightElement:s});break}}break}}}getContext(t,e,i){return{aIsStrong:i,aWasUndone:this._wasUndone(t),bWasUndone:this._wasUndone(e),abRelation:this._useRelations?this._getRelation(t,e):null,baRelation:this._useRelations?this._getRelation(e,t):null,forceWeakRemove:this._forceWeakRemove}}_wasUndone(t){const e=this.originalOperations.get(t);return e.wasUndone||this._history.isUndoneOperation(e)}_getRelation(t,e){const i=this.originalOperations.get(e),n=this._history.getUndoneOperation(i);if(!n)return null;const o=this.originalOperations.get(t),r=this._relations.get(o);return r&&r.get(n)||null}_setRelation(t,e,i){const n=this.originalOperations.get(t),o=this.originalOperations.get(e);let r=this._relations.get(n);r||(r=new Map,this._relations.set(n,r)),r.set(o,i)}}function Vh(t,e){for(const i of t)i.baseVersion=e++}function jh(t,e){for(let i=0;i<e;i++)t.push(new ec(0))}function Bh(t,e,i){const n=t.nodes.getNode(0).getAttribute(e);if(n==i)return null;const o=new aa(t.position,t.position.getShiftedBy(t.howMany));return new Pl(o,e,n,i,0)}function Fh(t,e){return null===t.targetPosition._getTransformedByDeletion(e.sourcePosition,e.howMany)}function Hh(t,e){const i=[];for(let n=0;n<t.length;n++){const o=t[n],r=new Ml(o.start,o.end.offset-o.start.offset,e,0);i.push(r);for(let e=n+1;e<t.length;e++)t[e]=t[e]._getTransformedByMove(r.sourcePosition,r.targetPosition,r.howMany)[0];e=e._getTransformedByMove(r.sourcePosition,r.targetPosition,r.howMany)}return i}Nh(Pl,Pl,(t,e,i)=>{if(t.key===e.key&&t.range.start.hasSameParentAs(e.range.start)){const n=t.range.getDifference(e.range).map(e=>new Pl(e,t.key,t.oldValue,t.newValue,0)),o=t.range.getIntersection(e.range);return o&&i.aIsStrong&&n.push(new Pl(o,e.key,e.newValue,t.newValue,0)),0==n.length?[new ec(0)]:n}return[t]}),Nh(Pl,Il,(t,e)=>{if(t.range.start.hasSameParentAs(e.position)&&t.range.containsPosition(e.position)){const i=t.range._getTransformedByInsertion(e.position,e.howMany,!e.shouldReceiveAttributes).map(e=>new Pl(e,t.key,t.oldValue,t.newValue,t.baseVersion));if(e.shouldReceiveAttributes){const n=Bh(e,t.key,t.oldValue);n&&i.unshift(n)}return i}return t.range=t.range._getTransformedByInsertion(e.position,e.howMany,!1)[0],[t]}),Nh(Pl,Ol,(t,e)=>{const i=[];t.range.start.hasSameParentAs(e.deletionPosition)&&(t.range.containsPosition(e.deletionPosition)||t.range.start.isEqual(e.deletionPosition))&&i.push(aa._createFromPositionAndShift(e.graveyardPosition,1));const n=t.range._getTransformedByMergeOperation(e);return n.isCollapsed||i.push(n),i.map(e=>new Pl(e,t.key,t.oldValue,t.newValue,t.baseVersion))}),Nh(Pl,Ml,(t,e)=>function(t,e){const i=aa._createFromPositionAndShift(e.sourcePosition,e.howMany);let n=null,o=[];i.containsRange(t,!0)?n=t:t.start.hasSameParentAs(i.start)?(o=t.getDifference(i),n=t.getIntersection(i)):o=[t];const r=[];for(let t of o){t=t._getTransformedByDeletion(e.sourcePosition,e.howMany);const i=e.getMovedRangeStart(),n=t.start.hasSameParentAs(i);t=t._getTransformedByInsertion(i,e.howMany,n),r.push(...t)}n&&r.push(n._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany,!1)[0]);return r}(t.range,e).map(e=>new Pl(e,t.key,t.oldValue,t.newValue,t.baseVersion))),Nh(Pl,zl,(t,e)=>{if(t.range.end.isEqual(e.insertionPosition))return e.graveyardPosition||t.range.end.offset++,[t];if(t.range.start.hasSameParentAs(e.splitPosition)&&t.range.containsPosition(e.splitPosition)){const i=t.clone();return i.range=new aa(e.moveTargetPosition.clone(),t.range.end._getCombined(e.splitPosition,e.moveTargetPosition)),t.range.end=e.splitPosition.clone(),t.range.end.stickiness="toPrevious",[t,i]}return t.range=t.range._getTransformedBySplitOperation(e),[t]}),Nh(Il,Pl,(t,e)=>{const i=[t];if(t.shouldReceiveAttributes&&t.position.hasSameParentAs(e.range.start)&&e.range.containsPosition(t.position)){const n=Bh(t,e.key,e.newValue);n&&i.push(n)}return i}),Nh(Il,Il,(t,e,i)=>(t.position.isEqual(e.position)&&i.aIsStrong||(t.position=t.position._getTransformedByInsertOperation(e)),[t])),Nh(Il,Ml,(t,e)=>(t.position=t.position._getTransformedByMoveOperation(e),[t])),Nh(Il,zl,(t,e)=>(t.position=t.position._getTransformedBySplitOperation(e),[t])),Nh(Il,Ol,(t,e)=>(t.position=t.position._getTransformedByMergeOperation(e),[t])),Nh(Ll,Il,(t,e)=>(t.oldRange&&(t.oldRange=t.oldRange._getTransformedByInsertOperation(e)[0]),t.newRange&&(t.newRange=t.newRange._getTransformedByInsertOperation(e)[0]),[t])),Nh(Ll,Ll,(t,e,i)=>{if(t.name==e.name){if(!i.aIsStrong)return[new ec(0)];t.oldRange=e.newRange?e.newRange.clone():null}return[t]}),Nh(Ll,Ol,(t,e)=>(t.oldRange&&(t.oldRange=t.oldRange._getTransformedByMergeOperation(e)),t.newRange&&(t.newRange=t.newRange._getTransformedByMergeOperation(e)),[t])),Nh(Ll,Ml,(t,e,i)=>{if(t.oldRange&&(t.oldRange=aa._createFromRanges(t.oldRange._getTransformedByMoveOperation(e))),t.newRange){if(i.abRelation){const n=aa._createFromRanges(t.newRange._getTransformedByMoveOperation(e));if("left"==i.abRelation.side&&e.targetPosition.isEqual(t.newRange.start))return t.newRange.start.path=i.abRelation.path,t.newRange.end=n.end,[t];if("right"==i.abRelation.side&&e.targetPosition.isEqual(t.newRange.end))return t.newRange.start=n.start,t.newRange.end.path=i.abRelation.path,[t]}t.newRange=aa._createFromRanges(t.newRange._getTransformedByMoveOperation(e))}return[t]}),Nh(Ll,zl,(t,e,i)=>{if(t.oldRange&&(t.oldRange=t.oldRange._getTransformedBySplitOperation(e)),t.newRange){if(i.abRelation){const n=t.newRange._getTransformedBySplitOperation(e);return t.newRange.start.isEqual(e.splitPosition)&&i.abRelation.wasStartBeforeMergedElement?t.newRange.start=na._createAt(e.insertionPosition):t.newRange.start.isEqual(e.splitPosition)&&!i.abRelation.wasInLeftElement&&(t.newRange.start=na._createAt(e.moveTargetPosition)),t.newRange.end.isEqual(e.splitPosition)&&i.abRelation.wasInRightElement?t.newRange.end=na._createAt(e.moveTargetPosition):t.newRange.end.isEqual(e.splitPosition)&&i.abRelation.wasEndBeforeMergedElement?t.newRange.end=na._createAt(e.insertionPosition):t.newRange.end=n.end,[t]}t.newRange=t.newRange._getTransformedBySplitOperation(e)}return[t]}),Nh(Ol,Il,(t,e)=>(t.sourcePosition.hasSameParentAs(e.position)&&(t.howMany+=e.howMany),t.sourcePosition=t.sourcePosition._getTransformedByInsertOperation(e),t.targetPosition=t.targetPosition._getTransformedByInsertOperation(e),[t])),Nh(Ol,Ol,(t,e,i)=>{if(t.sourcePosition.isEqual(e.sourcePosition)&&t.targetPosition.isEqual(e.targetPosition)){if(i.bWasUndone){const i=e.graveyardPosition.path.slice();return i.push(0),t.sourcePosition=new na(e.graveyardPosition.root,i),t.howMany=0,[t]}return[new ec(0)]}if(t.sourcePosition.isEqual(e.sourcePosition)&&!t.targetPosition.isEqual(e.targetPosition)&&!i.bWasUndone&&"splitAtSource"!=i.abRelation){const n="$graveyard"==t.targetPosition.root.rootName,o="$graveyard"==e.targetPosition.root.rootName,r=n&&!o;if(o&&!n||!r&&i.aIsStrong){const i=e.targetPosition._getTransformedByMergeOperation(e),n=t.targetPosition._getTransformedByMergeOperation(e);return[new Ml(i,t.howMany,n,0)]}return[new ec(0)]}return t.sourcePosition.hasSameParentAs(e.targetPosition)&&(t.howMany+=e.howMany),t.sourcePosition=t.sourcePosition._getTransformedByMergeOperation(e),t.targetPosition=t.targetPosition._getTransformedByMergeOperation(e),t.graveyardPosition.isEqual(e.graveyardPosition)&&i.aIsStrong||(t.graveyardPosition=t.graveyardPosition._getTransformedByMergeOperation(e)),[t]}),Nh(Ol,Ml,(t,e,i)=>{const n=aa._createFromPositionAndShift(e.sourcePosition,e.howMany);return"remove"==e.type&&!i.bWasUndone&&!i.forceWeakRemove&&t.deletionPosition.hasSameParentAs(e.sourcePosition)&&n.containsPosition(t.sourcePosition)?[new ec(0)]:(t.sourcePosition.hasSameParentAs(e.targetPosition)&&(t.howMany+=e.howMany),t.sourcePosition.hasSameParentAs(e.sourcePosition)&&(t.howMany-=e.howMany),t.sourcePosition=t.sourcePosition._getTransformedByMoveOperation(e),t.targetPosition=t.targetPosition._getTransformedByMoveOperation(e),t.graveyardPosition.isEqual(e.targetPosition)||(t.graveyardPosition=t.graveyardPosition._getTransformedByMoveOperation(e)),[t])}),Nh(Ol,zl,(t,e,i)=>{if(e.graveyardPosition&&(t.graveyardPosition=t.graveyardPosition._getTransformedByDeletion(e.graveyardPosition,1),t.deletionPosition.isEqual(e.graveyardPosition)&&(t.howMany=e.howMany)),t.targetPosition.isEqual(e.splitPosition)){const n=0!=e.howMany,o=e.graveyardPosition&&t.deletionPosition.isEqual(e.graveyardPosition);if(n||o||"mergeTargetNotMoved"==i.abRelation)return t.sourcePosition=t.sourcePosition._getTransformedBySplitOperation(e),[t]}if(t.sourcePosition.isEqual(e.splitPosition)){if("mergeSourceNotMoved"==i.abRelation)return t.howMany=0,t.targetPosition=t.targetPosition._getTransformedBySplitOperation(e),[t];if("mergeSameElement"==i.abRelation||t.sourcePosition.offset>0)return t.sourcePosition=e.moveTargetPosition.clone(),t.targetPosition=t.targetPosition._getTransformedBySplitOperation(e),[t]}return t.sourcePosition.hasSameParentAs(e.splitPosition)&&(t.howMany=e.splitPosition.offset),t.sourcePosition=t.sourcePosition._getTransformedBySplitOperation(e),t.targetPosition=t.targetPosition._getTransformedBySplitOperation(e),[t]}),Nh(Ml,Il,(t,e)=>{const i=aa._createFromPositionAndShift(t.sourcePosition,t.howMany)._getTransformedByInsertOperation(e,!1)[0];return t.sourcePosition=i.start,t.howMany=i.end.offset-i.start.offset,t.targetPosition.isEqual(e.position)||(t.targetPosition=t.targetPosition._getTransformedByInsertOperation(e)),[t]}),Nh(Ml,Ml,(t,e,i)=>{const n=aa._createFromPositionAndShift(t.sourcePosition,t.howMany),o=aa._createFromPositionAndShift(e.sourcePosition,e.howMany);let r,s=i.aIsStrong,a=!i.aIsStrong;if("insertBefore"==i.abRelation||"insertAfter"==i.baRelation?a=!0:"insertAfter"!=i.abRelation&&"insertBefore"!=i.baRelation||(a=!1),r=t.targetPosition.isEqual(e.targetPosition)&&a?t.targetPosition._getTransformedByDeletion(e.sourcePosition,e.howMany):t.targetPosition._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),Fh(t,e)&&Fh(e,t))return[e.getReversed()];if(n.containsPosition(e.targetPosition)&&n.containsRange(o,!0))return n.start=n.start._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),n.end=n.end._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),Hh([n],r);if(o.containsPosition(t.targetPosition)&&o.containsRange(n,!0))return n.start=n.start._getCombined(e.sourcePosition,e.getMovedRangeStart()),n.end=n.end._getCombined(e.sourcePosition,e.getMovedRangeStart()),Hh([n],r);const l=ln(t.sourcePosition.getParentPath(),e.sourcePosition.getParentPath());if("prefix"==l||"extension"==l)return n.start=n.start._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),n.end=n.end._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),Hh([n],r);"remove"!=t.type||"remove"==e.type||i.aWasUndone||i.forceWeakRemove?"remove"==t.type||"remove"!=e.type||i.bWasUndone||i.forceWeakRemove||(s=!1):s=!0;const c=[],d=n.getDifference(o);for(const t of d){t.start=t.start._getTransformedByDeletion(e.sourcePosition,e.howMany),t.end=t.end._getTransformedByDeletion(e.sourcePosition,e.howMany);const i="same"==ln(t.start.getParentPath(),e.getMovedRangeStart().getParentPath()),n=t._getTransformedByInsertion(e.getMovedRangeStart(),e.howMany,i);c.push(...n)}const h=n.getIntersection(o);return null!==h&&s&&(h.start=h.start._getCombined(e.sourcePosition,e.getMovedRangeStart()),h.end=h.end._getCombined(e.sourcePosition,e.getMovedRangeStart()),0===c.length?c.push(h):1==c.length?o.start.isBefore(n.start)||o.start.isEqual(n.start)?c.unshift(h):c.push(h):c.splice(1,0,h)),0===c.length?[new ec(t.baseVersion)]:Hh(c,r)}),Nh(Ml,zl,(t,e,i)=>{let n=t.targetPosition.clone();t.targetPosition.isEqual(e.insertionPosition)&&e.graveyardPosition&&"moveTargetAfter"!=i.abRelation||(n=t.targetPosition._getTransformedBySplitOperation(e));const o=aa._createFromPositionAndShift(t.sourcePosition,t.howMany);if(o.end.isEqual(e.insertionPosition))return e.graveyardPosition||t.howMany++,t.targetPosition=n,[t];if(o.start.hasSameParentAs(e.splitPosition)&&o.containsPosition(e.splitPosition)){let t=new aa(e.splitPosition,o.end);t=t._getTransformedBySplitOperation(e);return Hh([new aa(o.start,e.splitPosition),t],n)}t.targetPosition.isEqual(e.splitPosition)&&"insertAtSource"==i.abRelation&&(n=e.moveTargetPosition),t.targetPosition.isEqual(e.insertionPosition)&&"insertBetween"==i.abRelation&&(n=t.targetPosition);const r=[o._getTransformedBySplitOperation(e)];if(e.graveyardPosition){const n=o.start.isEqual(e.graveyardPosition)||o.containsPosition(e.graveyardPosition);t.howMany>1&&n&&!i.aWasUndone&&r.push(aa._createFromPositionAndShift(e.insertionPosition,1))}return Hh(r,n)}),Nh(Ml,Ol,(t,e,i)=>{const n=aa._createFromPositionAndShift(t.sourcePosition,t.howMany);if(e.deletionPosition.hasSameParentAs(t.sourcePosition)&&n.containsPosition(e.sourcePosition))if("remove"!=t.type||i.forceWeakRemove){if(1==t.howMany)return i.bWasUndone?(t.sourcePosition=e.graveyardPosition.clone(),t.targetPosition=t.targetPosition._getTransformedByMergeOperation(e),[t]):[new ec(0)]}else if(!i.aWasUndone){const i=[];let n=e.graveyardPosition.clone(),o=e.targetPosition._getTransformedByMergeOperation(e);t.howMany>1&&(i.push(new Ml(t.sourcePosition,t.howMany-1,t.targetPosition,0)),n=n._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany-1),o=o._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany-1));const r=e.deletionPosition._getCombined(t.sourcePosition,t.targetPosition),s=new Ml(n,1,r,0),a=s.getMovedRangeStart().path.slice();a.push(0);const l=new na(s.targetPosition.root,a);o=o._getTransformedByMove(n,r,1);const c=new Ml(o,e.howMany,l,0);return i.push(s),i.push(c),i}const o=aa._createFromPositionAndShift(t.sourcePosition,t.howMany)._getTransformedByMergeOperation(e);return t.sourcePosition=o.start,t.howMany=o.end.offset-o.start.offset,t.targetPosition=t.targetPosition._getTransformedByMergeOperation(e),[t]}),Nh(Nl,Il,(t,e)=>(t.position=t.position._getTransformedByInsertOperation(e),[t])),Nh(Nl,Ol,(t,e)=>t.position.isEqual(e.deletionPosition)?(t.position=e.graveyardPosition.clone(),t.position.stickiness="toNext",[t]):(t.position=t.position._getTransformedByMergeOperation(e),[t])),Nh(Nl,Ml,(t,e)=>(t.position=t.position._getTransformedByMoveOperation(e),[t])),Nh(Nl,Nl,(t,e,i)=>{if(t.position.isEqual(e.position)){if(!i.aIsStrong)return[new ec(0)];t.oldName=e.newName}return[t]}),Nh(Nl,zl,(t,e)=>{if("same"==ln(t.position.path,e.splitPosition.getParentPath())&&!e.graveyardPosition){const e=new Nl(t.position.getShiftedBy(1),t.oldName,t.newName,0);return[t,e]}return t.position=t.position._getTransformedBySplitOperation(e),[t]}),Nh(Rl,Rl,(t,e,i)=>{if(t.root===e.root&&t.key===e.key){if(!i.aIsStrong||t.newValue===e.newValue)return[new ec(0)];t.oldValue=e.newValue}return[t]}),Nh(zl,Il,(t,e)=>(t.splitPosition.hasSameParentAs(e.position)&&t.splitPosition.offset<e.position.offset&&(t.howMany+=e.howMany),t.splitPosition=t.splitPosition._getTransformedByInsertOperation(e),t.insertionPosition=t.insertionPosition._getTransformedByInsertOperation(e),[t])),Nh(zl,Ol,(t,e,i)=>{if(!t.graveyardPosition&&!i.bWasUndone&&t.splitPosition.hasSameParentAs(e.sourcePosition)){const i=e.graveyardPosition.path.slice();i.push(0);const n=new na(e.graveyardPosition.root,i),o=zl.getInsertionPosition(new na(e.graveyardPosition.root,i)),r=new zl(n,0,o,null,0);return t.splitPosition=t.splitPosition._getTransformedByMergeOperation(e),t.insertionPosition=zl.getInsertionPosition(t.splitPosition),t.graveyardPosition=r.insertionPosition.clone(),t.graveyardPosition.stickiness="toNext",[r,t]}return t.splitPosition.hasSameParentAs(e.deletionPosition)&&!t.splitPosition.isAfter(e.deletionPosition)&&t.howMany--,t.splitPosition.hasSameParentAs(e.targetPosition)&&(t.howMany+=e.howMany),t.splitPosition=t.splitPosition._getTransformedByMergeOperation(e),t.insertionPosition=zl.getInsertionPosition(t.splitPosition),t.graveyardPosition&&(t.graveyardPosition=t.graveyardPosition._getTransformedByMergeOperation(e)),[t]}),Nh(zl,Ml,(t,e,i)=>{const n=aa._createFromPositionAndShift(e.sourcePosition,e.howMany);if(t.graveyardPosition){const o=n.start.isEqual(t.graveyardPosition)||n.containsPosition(t.graveyardPosition);if(!i.bWasUndone&&o){const i=t.splitPosition._getTransformedByMoveOperation(e),n=t.graveyardPosition._getTransformedByMoveOperation(e),o=n.path.slice();o.push(0);const r=new na(n.root,o);return[new Ml(i,t.howMany,r,0)]}t.graveyardPosition=t.graveyardPosition._getTransformedByMoveOperation(e)}const o=t.splitPosition.isEqual(e.targetPosition);if(o&&("insertAtSource"==i.baRelation||"splitBefore"==i.abRelation))return t.howMany+=e.howMany,t.splitPosition=t.splitPosition._getTransformedByDeletion(e.sourcePosition,e.howMany),t.insertionPosition=zl.getInsertionPosition(t.splitPosition),[t];if(o&&i.abRelation&&i.abRelation.howMany){const{howMany:e,offset:n}=i.abRelation;return t.howMany+=e,t.splitPosition=t.splitPosition.getShiftedBy(n),[t]}if(t.splitPosition.hasSameParentAs(e.sourcePosition)&&n.containsPosition(t.splitPosition)){const i=e.howMany-(t.splitPosition.offset-e.sourcePosition.offset);return t.howMany-=i,t.splitPosition.hasSameParentAs(e.targetPosition)&&t.splitPosition.offset<e.targetPosition.offset&&(t.howMany+=e.howMany),t.splitPosition=e.sourcePosition.clone(),t.insertionPosition=zl.getInsertionPosition(t.splitPosition),[t]}return e.sourcePosition.isEqual(e.targetPosition)||(t.splitPosition.hasSameParentAs(e.sourcePosition)&&t.splitPosition.offset<=e.sourcePosition.offset&&(t.howMany-=e.howMany),t.splitPosition.hasSameParentAs(e.targetPosition)&&t.splitPosition.offset<e.targetPosition.offset&&(t.howMany+=e.howMany)),t.splitPosition.stickiness="toNone",t.splitPosition=t.splitPosition._getTransformedByMoveOperation(e),t.splitPosition.stickiness="toNext",t.graveyardPosition?t.insertionPosition=t.insertionPosition._getTransformedByMoveOperation(e):t.insertionPosition=zl.getInsertionPosition(t.splitPosition),[t]}),Nh(zl,zl,(t,e,i)=>{if(t.splitPosition.isEqual(e.splitPosition)){if(!t.graveyardPosition&&!e.graveyardPosition)return[new ec(0)];if(t.graveyardPosition&&e.graveyardPosition&&t.graveyardPosition.isEqual(e.graveyardPosition))return[new ec(0)];if("splitBefore"==i.abRelation)return t.howMany=0,t.graveyardPosition=t.graveyardPosition._getTransformedBySplitOperation(e),[t]}if(t.graveyardPosition&&e.graveyardPosition&&t.graveyardPosition.isEqual(e.graveyardPosition)){const n="$graveyard"==t.splitPosition.root.rootName,o="$graveyard"==e.splitPosition.root.rootName,r=n&&!o;if(o&&!n||!r&&i.aIsStrong){const i=[];return e.howMany&&i.push(new Ml(e.moveTargetPosition,e.howMany,e.splitPosition,0)),t.howMany&&i.push(new Ml(t.splitPosition,t.howMany,t.moveTargetPosition,0)),i}return[new ec(0)]}if(t.graveyardPosition&&(t.graveyardPosition=t.graveyardPosition._getTransformedBySplitOperation(e)),t.splitPosition.isEqual(e.insertionPosition)&&"splitBefore"==i.abRelation)return t.howMany++,[t];if(e.splitPosition.isEqual(t.insertionPosition)&&"splitBefore"==i.baRelation){const i=e.insertionPosition.path.slice();i.push(0);const n=new na(e.insertionPosition.root,i);return[t,new Ml(t.insertionPosition,1,n,0)]}return t.splitPosition.hasSameParentAs(e.splitPosition)&&t.splitPosition.offset<e.splitPosition.offset&&(t.howMany-=e.howMany),t.splitPosition=t.splitPosition._getTransformedBySplitOperation(e),t.insertionPosition=zl.getInsertionPosition(t.splitPosition),[t]});class Uh extends es{constructor(t){super(t),this.domEventType="click"}onDomEvent(t){this.fire(t.type,t)}}class qh extends es{constructor(t){super(t),this.domEventType=["mousedown","mouseup","mouseover","mouseout"]}onDomEvent(t){this.fire(t.type,t)}}class Wh{constructor(t){this.document=t}createDocumentFragment(t){return new Uo(this.document,t)}createElement(t,e,i){return new Xn(this.document,t,e,i)}createText(t){return new hn(this.document,t)}clone(t,e=!1){return t._clone(e)}appendChild(t,e){return e._appendChild(t)}insertChild(t,e,i){return i._insertChild(t,e)}removeChildren(t,e,i){return i._removeChildren(t,e)}remove(t){const e=t.parent;return e?this.removeChildren(e.getChildIndex(t),1,e):[]}replace(t,e){const i=t.parent;if(i){const n=i.getChildIndex(t);return this.removeChildren(n,1,i),this.insertChild(n,e,i),!0}return!1}unwrapElement(t){const e=t.parent;if(e){const i=e.getChildIndex(t);this.remove(t),this.insertChild(i,t.getChildren(),e)}}rename(t,e){const i=new Xn(this.document,t,e.getAttributes(),e.getChildren());return this.replace(e,i)?i:null}setAttribute(t,e,i){i._setAttribute(t,e)}removeAttribute(t,e){e._removeAttribute(t)}addClass(t,e){e._addClass(t)}removeClass(t,e){e._removeClass(t)}setStyle(t,e,i){le(t)&&void 0===i&&(i=e),i._setStyle(t,e)}removeStyle(t,e){e._removeStyle(t)}setCustomProperty(t,e,i){i._setCustomProperty(t,e)}removeCustomProperty(t,e){return e._removeCustomProperty(t)}createPositionAt(t,e){return ao._createAt(t,e)}createPositionAfter(t){return ao._createAfter(t)}createPositionBefore(t){return ao._createBefore(t)}createRange(t,e){return new lo(t,e)}createRangeOn(t){return lo._createOn(t)}createRangeIn(t){return lo._createIn(t)}createSelection(t,e,i){return new uo(t,e,i)}}const $h=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,Gh=/^rgb\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}[0-9]{1,3}[ %]?\)$/i,Yh=/^rgba\([ ]?([0-9]{1,3}[ %]?,[ ]?){3}(1|[0-9]+%|[0]?\.?[0-9]+)\)$/i,Kh=/^hsl\([ ]?([0-9]{1,3}[ %]?[,]?[ ]*){3}(1|[0-9]+%|[0]?\.?[0-9]+)?\)$/i,Qh=/^hsla\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}(1|[0-9]+%|[0]?\.?[0-9]+)\)$/i,Jh=new Set(["black","silver","gray","white","maroon","red","purple","fuchsia","green","lime","olive","yellow","navy","blue","teal","aqua","orange","aliceblue","antiquewhite","aquamarine","azure","beige","bisque","blanchedalmond","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","gainsboro","ghostwhite","gold","goldenrod","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","limegreen","linen","magenta","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","oldlace","olivedrab","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","thistle","tomato","turquoise","violet","wheat","whitesmoke","yellowgreen","rebeccapurple","currentcolor","transparent"]);function Zh(t){return t.startsWith("#")?$h.test(t):t.startsWith("rgb")?Gh.test(t)||Yh.test(t):t.startsWith("hsl")?Kh.test(t)||Qh.test(t):Jh.has(t.toLowerCase())}const Xh=["repeat-x","repeat-y","repeat","space","round","no-repeat"];const tu=["center","top","bottom","left","right"];function eu(t){return tu.includes(t)}const iu=["fixed","scroll","local"];function nu(t){return iu.includes(t)}const ou=/^url\(/;function ru(t){return ou.test(t)}function su(t){return t.replace(/, /g,",").split(" ").map(t=>t.replace(/,/g,", "))}function au(t){t.setNormalizer("background",lu),t.setNormalizer("background-color",t=>({path:"background.color",value:t})),t.setReducer("background",t=>{const e=[];return e.push(["background-color",t.color]),e})}function lu(t){const e={},i=su(t);for(const t of i)n=t,Xh.includes(n)?(e.repeat=e.repeat||[],e.repeat.push(t)):eu(t)?(e.position=e.position||[],e.position.push(t)):nu(t)?e.attachment=t:Zh(t)?e.color=t:ru(t)&&(e.image=t);var n;return{path:"background",value:e}}class cu extends Cc{constructor(t,e){super(t),this.view=e,this._toolbarConfig=Hd(t.config.get("toolbar")),this._elementReplacer=new vs}get element(){return this.view.element}init(t){const e=this.editor,i=this.view,n=e.editing.view,o=i.editable,r=n.document.getRoot();o.name=r.rootName,i.render();const s=o.element;this.setEditableElement(o.name,s),this.focusTracker.add(s),i.editable.bind("isFocused").to(this.focusTracker),n.attachDomRoot(s),t&&this._elementReplacer.replace(t,this.element),this._initPlaceholder(),this._initToolbar(),this.fire("ready")}destroy(){const t=this.view,e=this.editor.editing.view;this._elementReplacer.restore(),e.detachDomRoot(t.editable.name),t.destroy(),super.destroy()}_initToolbar(){const t=this.editor,e=this.view,i=t.editing.view;e.stickyPanel.bind("isActive").to(this.focusTracker,"isFocused"),e.stickyPanel.limiterElement=e.element,this._toolbarConfig.viewportTopOffset&&(e.stickyPanel.viewportTopOffset=this._toolbarConfig.viewportTopOffset),e.toolbar.fillFromConfig(this._toolbarConfig,this.componentFactory),yh({origin:i,originFocusTracker:this.focusTracker,originKeystrokeHandler:t.keystrokes,toolbar:e.toolbar})}_initPlaceholder(){const t=this.editor,e=t.editing.view,i=e.document.getRoot(),n=t.sourceElement,o=t.config.get("placeholder")||n&&"textarea"===n.tagName.toLowerCase()&&n.getAttribute("placeholder");o&&Eh({view:e,element:i,text:o,isDirectHost:!1,keepOnFocus:!0})}}i(60);class du extends eh{constructor(t,e,i={}){super(t),this.stickyPanel=new vh(t),this.toolbar=new Ud(t,{shouldGroupWhenFull:i.shouldToolbarGroupWhenFull}),this.editable=new nh(t,e)}render(){super.render(),this.stickyPanel.content.add(this.toolbar),this.top.add(this.stickyPanel),this.main.add(this.editable)}}class hu extends yc{constructor(t,e){super(e),Gi(t)&&(this.sourceElement=t),this.model.document.createRoot();const i=!this.config.get("toolbar.shouldNotGroupWhenFull"),n=new du(this.locale,this.editing.view,{shouldToolbarGroupWhenFull:i});this.ui=new cu(this,n),Tc(this)}destroy(){return this.sourceElement&&this.updateSourceElement(),this.ui.destroy(),super.destroy()}static create(t,e={}){return new Promise(i=>{const n=new this(t,e);i(n.initPlugins().then(()=>n.ui.init(Gi(t)?t:null)).then(()=>{if(!Gi(t)&&e.initialData)throw new l.a("editor-create-initial-data",null);const i=void 0!==e.initialData?e.initialData:function(t){return Gi(t)?As(t):t}(t);return n.data.init(i)}).then(()=>n.fire("ready")).then(()=>n))})}}Kt(hu,Ec),Kt(hu,Pc);class uu extends Cc{constructor(t,e){super(t),this.view=e}get element(){return this.view.editable.element}init(){const t=this.editor,e=this.view,i=t.plugins.get("BalloonToolbar"),n=t.editing.view,o=e.editable,r=n.document.getRoot();o.name=r.rootName,e.render();const s=o.element;this.setEditableElement(o.name,s),this.focusTracker.add(s),o.bind("isFocused").to(this.focusTracker),n.attachDomRoot(s),yh({origin:n,originFocusTracker:this.focusTracker,originKeystrokeHandler:t.keystrokes,toolbar:i.toolbarView,beforeFocus(){i.show()},afterBlur(){i.hide()}}),this._initPlaceholder(),this.fire("ready")}destroy(){const t=this.view;this.editor.editing.view.detachDomRoot(t.editable.name),t.destroy(),super.destroy()}_initPlaceholder(){const t=this.editor,e=t.editing.view,i=e.document.getRoot(),n=t.sourceElement,o=t.config.get("placeholder")||n&&"textarea"===n.tagName.toLowerCase()&&n.getAttribute("placeholder");o&&Eh({view:e,element:i,text:o,isDirectHost:!1,keepOnFocus:!0})}}class mu extends Xd{constructor(t,e,i){super(t),this.editable=new nh(t,e,i)}render(){super.render(),this.registerChild(this.editable)}}class gu extends yc{constructor(t,e){super(e),Gi(t)&&(this.sourceElement=t,Sc(this));const i=this.config.get("plugins");i.push(Ah),this.config.set("plugins",i),this.config.define("balloonToolbar",this.config.get("toolbar")),this.model.document.createRoot();const n=new mu(this.locale,this.editing.view,this.sourceElement);this.ui=new uu(this,n),Tc(this)}destroy(){const t=this.getData();return this.ui.destroy(),super.destroy().then(()=>{this.sourceElement&&Ns(this.sourceElement,t)})}static create(t,e={}){return new Promise(i=>{const n=Gi(t);if(n&&"TEXTAREA"===t.tagName)throw new l.a("editor-wrong-element",null);const o=new this(t,e);i(o.initPlugins().then(()=>{o.ui.init()}).then(()=>{if(!n&&e.initialData)throw new l.a("editor-create-initial-data",null);const i=void 0!==e.initialData?e.initialData:function(t){return Gi(t)?As(t):t}(t);return o.data.init(i)}).then(()=>o.fire("ready")).then(()=>o))})}}Kt(gu,Ec),Kt(gu,Pc);class fu extends Cc{constructor(t,e){super(t),this.view=e,this._toolbarConfig=Hd(t.config.get("toolbar"))}get element(){return this.view.editable.element}init(){const t=this.editor,e=this.view,i=t.editing.view,n=e.editable,o=i.document.getRoot();n.name=o.rootName,e.render();const r=n.element;this.setEditableElement(n.name,r),this.focusTracker.add(r),n.bind("isFocused").to(this.focusTracker),i.attachDomRoot(r),this._initPlaceholder(),this._initToolbar(),this.fire("ready")}destroy(){const t=this.view;this.editor.editing.view.detachDomRoot(t.editable.name),t.destroy(),super.destroy()}_initToolbar(){const t=this.editor,e=this.view,i=e.editable.element,n=t.editing.view,o=e.toolbar;e.panel.bind("isVisible").to(this.focusTracker,"isFocused"),this._toolbarConfig.viewportTopOffset&&(e.viewportTopOffset=this._toolbarConfig.viewportTopOffset),e.listenTo(t.ui,"update",()=>{e.panel.isVisible&&e.panel.pin({target:i,positions:e.panelPositions})}),o.fillFromConfig(this._toolbarConfig,this.componentFactory),yh({origin:n,originFocusTracker:this.focusTracker,originKeystrokeHandler:t.keystrokes,toolbar:o})}_initPlaceholder(){const t=this.editor,e=t.editing.view,i=e.document.getRoot(),n=t.sourceElement,o=t.config.get("placeholder")||n&&"textarea"===n.tagName.toLowerCase()&&n.getAttribute("placeholder");o&&Eh({view:e,element:i,text:o,isDirectHost:!1,keepOnFocus:!0})}}const pu=Rs("px");class wu extends Xd{constructor(t,e,i,n={}){super(t),this.toolbar=new Ud(t,{shouldGroupWhenFull:n.shouldToolbarGroupWhenFull,isFloating:!0}),this.set("viewportTopOffset",0),this.panel=new uh(t),this.panel.withArrow=!1,this.panelPositions=this._getPanelPositions(),this.panel.extendTemplate({attributes:{class:"ck-toolbar-container"}}),this.editable=new nh(t,e,i),this._resizeObserver=null}render(){super.render(),this.body.add(this.panel),this.registerChild(this.editable),this.panel.content.add(this.toolbar);if(this.toolbar.options.shouldGroupWhenFull){const t=this.editable.element;this._resizeObserver=new Is(t,()=>{this.toolbar.maxWidth=pu(new Ps(t).width)})}}destroy(){super.destroy(),this._resizeObserver&&this._resizeObserver.destroy()}_getPanelPositionTop(t,e){let i;return i=t.top>e.height+this.viewportTopOffset?t.top-e.height:t.bottom>e.height+this.viewportTopOffset+50?this.viewportTopOffset:t.bottom,i}_getPanelPositions(){const t=[(t,e)=>({top:this._getPanelPositionTop(t,e),left:t.left,name:"toolbar_west"}),(t,e)=>({top:this._getPanelPositionTop(t,e),left:t.left+t.width-e.width,name:"toolbar_east"})];return"ltr"===this.locale.uiLanguageDirection?t:t.reverse()}}class bu extends yc{constructor(t,e){super(e),this.model.document.createRoot(),Gi(t)&&(this.sourceElement=t,Sc(this));const i=!this.config.get("toolbar.shouldNotGroupWhenFull"),n=new wu(this.locale,this.editing.view,this.sourceElement,{shouldToolbarGroupWhenFull:i});this.ui=new fu(this,n),Tc(this)}destroy(){const t=this.getData();return this.ui.destroy(),super.destroy().then(()=>{this.sourceElement&&Ns(this.sourceElement,t)})}static create(t,e={}){return new Promise(i=>{const n=Gi(t);if(n&&"TEXTAREA"===t.tagName)throw new l.a("editor-wrong-element",null);const o=new this(t,e);i(o.initPlugins().then(()=>{o.ui.init()}).then(()=>{if(!n&&e.initialData)throw new l.a("editor-create-initial-data",null);const i=void 0!==e.initialData?e.initialData:function(t){return Gi(t)?As(t):t}(t);return o.data.init(i)}).then(()=>o.fire("ready")).then(()=>o))})}}Kt(bu,Ec),Kt(bu,Pc);class ku{constructor(t){this.files=function(t){const e=t.files?Array.from(t.files):[],i=t.items?Array.from(t.items):[];if(e.length)return e;return i.filter(t=>"file"===t.kind).map(t=>t.getAsFile())}(t),this._native=t}get types(){return this._native.types}getData(t){return this._native.getData(t)}setData(t,e){this._native.setData(t,e)}set effectAllowed(t){this._native.effectAllowed=t}get effectAllowed(){return this._native.effectAllowed}set dropEffect(t){this._native.dropEffect=t}get dropEffect(){return this._native.dropEffect}get isCanceled(){return"none"==this._native.dropEffect||!!this._native.mozUserCancelled}}class _u extends es{constructor(t){super(t);const e=this.document;function i(t){return(i,n)=>{n.preventDefault();const r=n.dropRange?[n.dropRange]:null,s=new o(e,t);e.fire(s,{dataTransfer:n.dataTransfer,method:i.name,targetRanges:r,target:n.target}),s.stop.called&&n.stopPropagation()}}this.domEventType=["paste","copy","cut","drop","dragover","dragstart","dragend","dragenter","dragleave"],this.listenTo(e,"paste",i("clipboardInput"),{priority:"low"}),this.listenTo(e,"drop",i("clipboardInput"),{priority:"low"}),this.listenTo(e,"dragover",i("dragging"),{priority:"low"})}onDomEvent(t){const e={dataTransfer:new ku(t.clipboardData?t.clipboardData:t.dataTransfer)};"drop"!=t.type&&"dragover"!=t.type||(e.dropRange=function(t,e){const i=e.target.ownerDocument,n=e.clientX,o=e.clientY;let r;i.caretRangeFromPoint&&i.caretRangeFromPoint(n,o)?r=i.caretRangeFromPoint(n,o):e.rangeParent&&(r=i.createRange(),r.setStart(e.rangeParent,e.rangeOffset),r.collapse(!0));if(r)return t.domConverter.domRangeToView(r);return null}(this.view,t)),this.fire(t.type,t,e)}}const vu=["figcaption","li"];class yu extends Qt{static get pluginName(){return"ClipboardPipeline"}init(){this.editor.editing.view.addObserver(_u),this._setupPasteDrop(),this._setupCopyCut()}_setupPasteDrop(){const t=this.editor,e=t.model,i=t.editing.view,n=i.document;this.listenTo(n,"clipboardInput",e=>{t.isReadOnly&&e.stop()},{priority:"highest"}),this.listenTo(n,"clipboardInput",(t,e)=>{const n=e.dataTransfer;let r=e.content||"";var s;r||(n.getData("text/html")?r=function(t){return t.replace(/<span(?: class="Apple-converted-space"|)>(\s+)<\/span>/g,(t,e)=>1==e.length?" ":e)}(n.getData("text/html")):n.getData("text/plain")&&(((s=(s=n.getData("text/plain")).replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\r?\n\r?\n/g,"</p><p>").replace(/\r?\n/g,"<br>").replace(/^\s/,"&nbsp;").replace(/\s$/,"&nbsp;").replace(/\s\s/g," &nbsp;")).includes("</p><p>")||s.includes("<br>"))&&(s=`<p>${s}</p>`),r=s),r=this.editor.data.htmlProcessor.toView(r));const a=new o(this,"inputTransformation");this.fire(a,{content:r,dataTransfer:n,targetRanges:e.targetRanges,method:e.method}),a.stop.called&&t.stop(),i.scrollToTheSelection()},{priority:"low"}),this.listenTo(this,"inputTransformation",(t,i)=>{if(i.content.isEmpty)return;const n=this.editor.data.toModel(i.content,"$clipboardHolder");0!=n.childCount&&(t.stop(),e.change(()=>{this.fire("contentInsertion",{content:n,method:i.method,dataTransfer:i.dataTransfer,targetRanges:i.targetRanges})}))},{priority:"low"}),this.listenTo(this,"contentInsertion",(t,i)=>{i.resultRange=e.insertContent(i.content)},{priority:"low"})}_setupCopyCut(){const t=this.editor,e=t.model.document,i=t.editing.view.document;function n(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",n,{priority:"low"}),this.listenTo(i,"cut",(e,i)=>{t.isReadOnly?i.preventDefault():n(e,i)},{priority:"low"}),this.listenTo(i,"clipboardOutput",(i,n)=>{n.content.isEmpty||(n.dataTransfer.setData("text/html",this.editor.data.htmlProcessor.toData(n.content)),n.dataTransfer.setData("text/plain",function t(e){let i="";if(e.is("$text")||e.is("$textProxy"))i=e.data;else if(e.is("element","img")&&e.hasAttribute("alt"))i=e.getAttribute("alt");else if(e.is("element","br"))i="\n";else{let n=null;for(const o of e.getChildren()){const e=t(o);n&&(n.is("containerElement")||o.is("containerElement"))&&(vu.includes(n.name)||vu.includes(o.name)?i+="\n":i+="\n\n"),i+=e,n=o}}return i}(n.content))),"cut"==n.method&&t.model.deleteContent(e.selection)},{priority:"low"})}}function*xu(t,e){for(const i of e)i&&t.getAttributeProperties(i[0]).copyOnEnter&&(yield i)}class Au extends Zt{execute(){const t=this.editor.model,e=t.document;t.change(i=>{!function(t,e,i,n){const o=i.isCollapsed,r=i.getFirstRange(),s=r.start.parent,a=r.end.parent;if(n.isLimit(s)||n.isLimit(a))return void(o||s!=a||t.deleteContent(i));if(o){const t=xu(e.model.schema,i.getAttributes());Cu(e,r.start),e.setSelectionAttribute(t)}else{const n=!(r.start.isAtStart&&r.end.isAtEnd),o=s==a;t.deleteContent(i,{leaveUnmerged:n}),n&&(o?Cu(e,i.focus):e.setSelection(a,0))}}(this.editor.model,i,e.selection,t.schema),this.fire("afterExecute",{writer:i})})}}function Cu(t,e){t.split(e),t.setSelection(e.parent.nextSibling,0)}class Tu extends Rr{constructor(t){super(t);const e=this.document;e.on("keydown",(t,i)=>{if(this.isEnabled&&i.keyCode==Io.enter){const n=new go(e,"enter",e.selection.getFirstRange());e.fire(n,new ts(e,i.domEvent,{isSoft:i.shiftKey})),n.stop.called&&t.stop()}})}observe(){}}class Eu extends Qt{static get pluginName(){return"Enter"}init(){const t=this.editor,e=t.editing.view,i=e.document;e.addObserver(Tu),t.commands.add("enter",new Au(t)),this.listenTo(i,"enter",(i,n)=>{n.preventDefault(),n.isSoft||(t.execute("enter"),e.scrollToTheSelection())},{priority:"low"})}}class Pu{constructor(t,e=20){this.model=t,this.size=0,this.limit=e,this.isLocked=!1,this._changeCallback=(t,e)=>{"transparent"!=e.type&&e!==this._batch&&this._reset(!0)},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(){return this._batch||(this._batch=this.model.createBatch()),this._batch}input(t){this.size+=t,this.size>=this.limit&&this._reset(!0)}lock(){this.isLocked=!0}unlock(){this.isLocked=!1}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){this.isLocked&&!t||(this._batch=null,this.size=0)}}class Su extends Zt{constructor(t,e){super(t),this.direction=e,this._buffer=new Pu(t.model,t.config.get("typing.undoStep"))}get buffer(){return this._buffer}execute(t={}){const e=this.editor.model,i=e.document;e.enqueueChange(this._buffer.batch,n=>{this._buffer.lock();const o=n.createSelection(t.selection||i.selection),r=t.sequence||1,s=o.isCollapsed;if(o.isCollapsed&&e.modifySelection(o,{direction:this.direction,unit:t.unit}),this._shouldEntireContentBeReplacedWithParagraph(r))return void this._replaceEntireContentWithParagraph(n);if(this._shouldReplaceFirstBlockWithParagraph(o,r))return void this.editor.execute("paragraph",{selection:o});if(o.isCollapsed)return;let a=0;o.getFirstRange().getMinimalFlatRanges().forEach(t=>{a+=ho(t.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))}),e.deleteContent(o,{doNotResetEntireContent:s,direction:this.direction}),this._buffer.input(a),n.setSelection(o),this._buffer.unlock()})}_shouldEntireContentBeReplacedWithParagraph(t){if(t>1)return!1;const e=this.editor.model,i=e.document.selection,n=e.schema.getLimitElement(i);if(!(i.isCollapsed&&i.containsEntireContent(n)))return!1;if(!e.schema.checkChild(n,"paragraph"))return!1;const o=n.getChild(0);return!o||"paragraph"!==o.name}_replaceEntireContentWithParagraph(t){const e=this.editor.model,i=e.document.selection,n=e.schema.getLimitElement(i),o=t.createElement("paragraph");t.remove(t.createRangeIn(n)),t.insert(o,n),t.setSelection(o,0)}_shouldReplaceFirstBlockWithParagraph(t,e){const i=this.editor.model;if(e>1||"backward"!=this.direction)return!1;if(!t.isCollapsed)return!1;const n=t.getFirstPosition(),o=i.schema.getLimitElement(n),r=o.getChild(0);return n.parent==r&&(!!t.containsEntireContent(r)&&(!!i.schema.checkChild(o,"paragraph")&&"paragraph"!=r.name))}}class Mu extends Rr{constructor(t){super(t);const e=t.document;let i=0;function n(t,i,n){const o=new go(e,"delete",e.selection.getFirstRange());e.fire(o,new ts(e,i,n)),o.stop.called&&t.stop()}e.on("keyup",(t,e)=>{e.keyCode!=Io.delete&&e.keyCode!=Io.backspace||(i=0)}),e.on("keydown",(t,e)=>{const o={};if(e.keyCode==Io.delete)o.direction="forward",o.unit="character";else{if(e.keyCode!=Io.backspace)return;o.direction="backward",o.unit="codePoint"}const r=Po.isMac?e.altKey:e.ctrlKey;o.unit=r?"word":o.unit,o.sequence=++i,n(t,e.domEvent,o)}),Po.isAndroid&&e.on("beforeinput",(e,i)=>{if("deleteContentBackward"!=i.domEvent.inputType)return;const o={unit:"codepoint",direction:"backward",sequence:1},r=i.domTarget.ownerDocument.defaultView.getSelection();r.anchorNode==r.focusNode&&r.anchorOffset+1!=r.focusOffset&&(o.selectionToRemove=t.domConverter.domSelectionToView(r)),n(e,i.domEvent,o)})}observe(){}}class Iu extends Qt{static get pluginName(){return"Delete"}init(){const t=this.editor,e=t.editing.view,i=e.document;e.addObserver(Mu);const n=new Su(t,"forward");if(t.commands.add("deleteForward",n),t.commands.add("forwardDelete",n),t.commands.add("delete",new Su(t,"backward")),this.listenTo(i,"delete",(i,n)=>{const o={unit:n.unit,sequence:n.sequence};if(n.selectionToRemove){const e=t.model.createSelection(),i=[];for(const e of n.selectionToRemove.getRanges())i.push(t.editing.mapper.toModelRange(e));e.setTo(i),o.selection=e}t.execute("forward"==n.direction?"deleteForward":"delete",o),n.preventDefault(),e.scrollToTheSelection()},{priority:"low"}),Po.isAndroid){let t=null;this.listenTo(i,"delete",(e,i)=>{const n=i.domTarget.ownerDocument.defaultView.getSelection();t={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}},{priority:"lowest"}),this.listenTo(i,"keyup",(e,i)=>{if(t){const e=i.domTarget.ownerDocument.defaultView.getSelection();e.collapse(t.anchorNode,t.anchorOffset),e.extend(t.focusNode,t.focusOffset),t=null}})}}}class Lu{constructor(){this._stack=[]}add(t,e){const i=this._stack,n=i[0];this._insertDescriptor(t);const o=i[0];n===o||Nu(n,o)||this.fire("change:top",{oldDescriptor:n,newDescriptor:o,writer:e})}remove(t,e){const i=this._stack,n=i[0];this._removeDescriptor(t);const o=i[0];n===o||Nu(n,o)||this.fire("change:top",{oldDescriptor:n,newDescriptor:o,writer:e})}_insertDescriptor(t){const e=this._stack,i=e.findIndex(e=>e.id===t.id);if(Nu(t,e[i]))return;i>-1&&e.splice(i,1);let n=0;for(;e[n]&&Ru(e[n],t);)n++;e.splice(n,0,t)}_removeDescriptor(t){const e=this._stack,i=e.findIndex(e=>e.id===t);i>-1&&e.splice(i,1)}}function Nu(t,e){return t&&e&&t.priority==e.priority&&Ou(t.classes)==Ou(e.classes)}function Ru(t,e){return t.priority>e.priority||!(t.priority<e.priority)&&Ou(t.classes)>Ou(e.classes)}function Ou(t){return Array.isArray(t)?t.sort().join(","):t}Kt(Lu,h);function zu(t){return!!t.is("element")&&!!t.getCustomProperty("widget")}function Du(t,e,i={}){if(!t.is("containerElement"))throw new l.a("widget-to-widget-wrong-element-type",null,{element:t});return e.setAttribute("contenteditable","false",t),e.addClass("ck-widget",t),e.setCustomProperty("widget",!0,t),t.getFillerOffset=$u,i.label&&function(t,e,i){i.setCustomProperty("widgetLabel",e,t)}(t,i.label,e),i.hasSelectionHandle&&function(t,e){const i=e.createUIElement("div",{class:"ck ck-widget__selection-handle"},(function(t){const e=this.toDomElement(t),i=new yd;return i.set("content",'<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M4 0v1H1v3H0V.5A.5.5 0 0 1 .5 0H4zm8 0h3.5a.5.5 0 0 1 .5.5V4h-1V1h-3V0zM4 16H.5a.5.5 0 0 1-.5-.5V12h1v3h3v1zm8 0v-1h3v-3h1v3.5a.5.5 0 0 1-.5.5H12z"/><path fill-opacity=".256" d="M1 1h14v14H1z"/><g class="ck-icon__selected-indicator"><path d="M7 0h2v1H7V0zM0 7h1v2H0V7zm15 0h1v2h-1V7zm-8 8h2v1H7v-1z"/><path fill-opacity=".254" d="M1 1h14v14H1z"/></g></svg>'),i.render(),e.appendChild(i.element),e}));e.insert(e.createPositionAt(t,0),i),e.addClass(["ck-widget_with-selection-handle"],t)}(t,e),Bu(t,e,Vu,ju),t}function Vu(t,e,i){if(e.classes&&i.addClass(tn(e.classes),t),e.attributes)for(const n in e.attributes)i.setAttribute(n,e.attributes[n],t)}function ju(t,e,i){if(e.classes&&i.removeClass(tn(e.classes),t),e.attributes)for(const n in e.attributes)i.removeAttribute(n,t)}function Bu(t,e,i,n){const o=new Lu;o.on("change:top",(e,o)=>{o.oldDescriptor&&n(t,o.oldDescriptor,o.writer),o.newDescriptor&&i(t,o.newDescriptor,o.writer)}),e.setCustomProperty("addHighlight",(t,e,i)=>o.add(e,i),t),e.setCustomProperty("removeHighlight",(t,e,i)=>o.remove(e,i),t)}function Fu(t){const e=t.getCustomProperty("widgetLabel");return e?"function"==typeof e?e():e:""}function Hu(t,e){return e.addClass(["ck-editor__editable","ck-editor__nested-editable"],t),e.setAttribute("contenteditable",t.isReadOnly?"false":"true",t),t.on("change:isReadOnly",(i,n,o)=>{e.setAttribute("contenteditable",o?"false":"true",t)}),t.on("change:isFocused",(i,n,o)=>{o?e.addClass("ck-editor__nested-editable_focused",t):e.removeClass("ck-editor__nested-editable_focused",t)}),t}function Uu(t,e){const i=t.getSelectedElement();if(i){const n=Yu(t);if(n)return e.createPositionAt(i,n);if(e.schema.isBlock(i))return e.createPositionAfter(i)}const n=t.getSelectedBlocks().next().value;if(n){if(n.isEmpty)return e.createPositionAt(n,0);const i=e.createPositionAfter(n);return t.focus.isTouching(i)?i:e.createPositionBefore(n)}return t.focus}function qu(t,e){const i=t.getSelectedElement();return!!i&&e.isObject(i)}function Wu(t,e){const i=new Ps(_r.window),n=i.getIntersection(t),o=e.height+uh.arrowVerticalOffset;if(t.top-o>i.top||t.bottom+o<i.bottom)return null;const r=n||t,s=r.left+r.width/2-e.width/2;return{top:Math.max(t.top,0)+uh.arrowVerticalOffset,left:s,name:"arrow_n"}}function $u(){return null}function Gu(t,e,i){return t&&zu(t)&&!i.isInline(e)}function Yu(t){return t.getAttribute("widget-type-around")}const Ku=[No("arrowUp"),No("arrowRight"),No("arrowDown"),No("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++)Ku.push(t);function Qu(t){return!(!t.ctrlKey&&!t.metaKey)||Ku.includes(t.keyCode)}i(62);const Ju=["before","after"],Zu=(new DOMParser).parseFromString('<svg viewBox="0 0 10 8" xmlns="http://www.w3.org/2000/svg"><path d="M9.055.263v3.972h-6.77M1 4.216l2-2.038m-2 2 2 2.038"/></svg>',"image/svg+xml").firstChild;class Xu extends Qt{static get pluginName(){return"WidgetTypeAround"}static get requires(){return[Eu,Iu]}constructor(t){super(t),this._currentFakeCaretModelElement=null}init(){const t=this.editor,e=t.editing.view;this.on("change:isEnabled",(i,n,o)=>{e.change(t=>{for(const i of e.document.roots)o?t.removeClass("ck-widget__type-around_disabled",i):t.addClass("ck-widget__type-around_disabled",i)}),o||t.model.change(t=>{t.removeSelectionAttribute("widget-type-around")})}),this._enableTypeAroundUIInjection(),this._enableInsertingParagraphsOnButtonClick(),this._enableInsertingParagraphsOnEnterKeypress(),this._enableInsertingParagraphsOnTypingKeystroke(),this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows(),this._enableDeleteIntegration(),this._enableInsertContentIntegration(),this._enableDeleteContentIntegration()}destroy(){this._currentFakeCaretModelElement=null}_insertParagraph(t,e){const i=this.editor,n=i.editing.view;i.execute("insertParagraph",{position:i.model.createPositionAt(t,e)}),n.focus(),n.scrollToTheSelection()}_listenToIfEnabled(t,e,i,n){this.listenTo(t,e,(...t)=>{this.isEnabled&&i(...t)},n)}_insertParagraphAccordingToFakeCaretPosition(){const t=this.editor.model.document.selection,e=Yu(t);if(!e)return!1;const i=t.getSelectedElement();return this._insertParagraph(i,e),!0}_enableTypeAroundUIInjection(){const t=this.editor,e=t.model.schema,i=t.locale.t,n={before:i("Insert paragraph before block"),after:i("Insert paragraph after block")};t.editing.downcastDispatcher.on("insert",(t,i,o)=>{const r=o.mapper.toViewElement(i.item);Gu(r,i.item,e)&&function(t,e,i){const n=t.createUIElement("div",{class:"ck ck-reset_all ck-widget__type-around"},(function(t){const i=this.toDomElement(t);return function(t,e){for(const i of Ju){const n=new id({tag:"div",attributes:{class:["ck","ck-widget__type-around__button","ck-widget__type-around__button_"+i],title:e[i]},children:[t.ownerDocument.importNode(Zu,!0)]});t.appendChild(n.render())}}(i,e),function(t){const e=new id({tag:"div",attributes:{class:["ck","ck-widget__type-around__fake-caret"]}});t.appendChild(e.render())}(i),i}));t.insert(t.createPositionAt(i,"end"),n)}(o.writer,n,r)},{priority:"low"})}_enableTypeAroundFakeCaretActivationUsingKeyboardArrows(){const t=this.editor,e=t.model,i=e.document.selection,n=e.schema,o=t.editing.view;function r(t){return"ck-widget_type-around_show-fake-caret_"+t}this._listenToIfEnabled(o.document,"arrowKey",(t,e)=>{this._handleArrowKeyPress(t,e)},{context:[zu,"$text"],priority:"high"}),this._listenToIfEnabled(i,"change:range",(e,i)=>{i.directChange&&t.model.change(t=>{t.removeSelectionAttribute("widget-type-around")})}),this._listenToIfEnabled(e.document,"change:data",()=>{const e=i.getSelectedElement();if(e){if(Gu(t.editing.mapper.toViewElement(e),e,n))return}t.model.change(t=>{t.removeSelectionAttribute("widget-type-around")})}),this._listenToIfEnabled(t.editing.downcastDispatcher,"selection",(t,e,i)=>{const o=i.writer;if(this._currentFakeCaretModelElement){const t=i.mapper.toViewElement(this._currentFakeCaretModelElement);t&&(o.removeClass(Ju.map(r),t),this._currentFakeCaretModelElement=null)}const s=e.selection.getSelectedElement();if(!s)return;const a=i.mapper.toViewElement(s);if(!Gu(a,s,n))return;const l=Yu(e.selection);l&&(o.addClass(r(l),a),this._currentFakeCaretModelElement=s)}),this._listenToIfEnabled(t.ui.focusTracker,"change:isFocused",(e,i,n)=>{n||t.model.change(t=>{t.removeSelectionAttribute("widget-type-around")})})}_handleArrowKeyPress(t,e){const i=this.editor,n=i.model,o=n.document.selection,r=n.schema,s=i.editing.view,a=Do(e.keyCode,i.locale.contentLanguageDirection),l=s.document.selection.getSelectedElement();let c;Gu(l,i.editing.mapper.toModelElement(l),r)?c=this._handleArrowKeyPressOnSelectedWidget(a):o.isCollapsed&&(c=this._handleArrowKeyPressWhenSelectionNextToAWidget(a)),c&&(e.preventDefault(),t.stop())}_handleArrowKeyPressOnSelectedWidget(t){const e=this.editor.model,i=Yu(e.document.selection);return e.change(e=>{if(!i)return e.setSelectionAttribute("widget-type-around",t?"after":"before"),!0;if(!(i===(t?"after":"before")))return e.removeSelectionAttribute("widget-type-around"),!0;return!1})}_handleArrowKeyPressWhenSelectionNextToAWidget(t){const e=this.editor,i=e.model,n=i.schema,o=e.plugins.get("Widget"),r=o._getObjectElementNextToSelection(t);return!!Gu(e.editing.mapper.toViewElement(r),r,n)&&(i.change(e=>{o._setSelectionOverElement(r),e.setSelectionAttribute("widget-type-around",t?"before":"after")}),!0)}_enableInsertingParagraphsOnButtonClick(){const t=this.editor,e=t.editing.view;this._listenToIfEnabled(e.document,"mousedown",(i,n)=>{const o=n.domTarget.closest(".ck-widget__type-around__button");if(!o)return;const r=function(t){return t.classList.contains("ck-widget__type-around__button_before")?"before":"after"}(o),s=function(t,e){const i=t.closest(".ck-widget");return e.mapDomToView(i)}(o,e.domConverter),a=t.editing.mapper.toModelElement(s);this._insertParagraph(a,r),n.preventDefault(),i.stop()})}_enableInsertingParagraphsOnEnterKeypress(){const t=this.editor,e=t.model.document.selection,i=t.editing.view;this._listenToIfEnabled(i.document,"enter",(i,n)=>{if("atTarget"!=i.eventPhase)return;const o=e.getSelectedElement(),r=t.editing.mapper.toViewElement(o),s=t.model.schema;let a;this._insertParagraphAccordingToFakeCaretPosition()?a=!0:Gu(r,o,s)&&(this._insertParagraph(o,n.isSoft?"before":"after"),a=!0),a&&(n.preventDefault(),i.stop())},{context:zu})}_enableInsertingParagraphsOnTypingKeystroke(){const t=this.editor.editing.view,e=[Io.enter,Io.delete,Io.backspace];this._listenToIfEnabled(t.document,"keydown",(t,i)=>{e.includes(i.keyCode)||Qu(i)||this._insertParagraphAccordingToFakeCaretPosition()},{priority:"high"})}_enableDeleteIntegration(){const t=this.editor,e=t.editing.view,i=t.model,n=i.schema;this._listenToIfEnabled(e.document,"delete",(e,o)=>{if("atTarget"!=e.eventPhase)return;const r=Yu(i.document.selection);if(!r)return;const s=o.direction,a=i.document.selection.getSelectedElement(),l="forward"==s;if("before"===r===l)t.execute("delete",{selection:i.createSelection(a,"on")});else{const e=n.getNearestSelectionRange(i.createPositionAt(a,r),s);if(e)if(e.isCollapsed){const o=i.createSelection(e.start);if(i.modifySelection(o,{direction:s}),o.focus.isEqual(e.start)){const t=function(t,e){let i=e;for(const n of e.getAncestors({parentFirst:!0})){if(n.childCount>1||t.isLimit(n))break;i=n}return i}(n,e.start.parent);i.deleteContent(i.createSelection(t,"on"),{doNotAutoparagraph:!0})}else i.change(i=>{i.setSelection(e),t.execute(l?"deleteForward":"delete")})}else i.change(i=>{i.setSelection(e),t.execute(l?"deleteForward":"delete")})}o.preventDefault(),e.stop()},{context:zu})}_enableInsertContentIntegration(){const t=this.editor,e=this.editor.model,i=e.document.selection;this._listenToIfEnabled(t.model,"insertContent",(t,[n,o])=>{if(o&&!o.is("documentSelection"))return;const r=Yu(i);return r?(t.stop(),e.change(t=>{const o=i.getSelectedElement(),s=e.createPositionAt(o,r),a=t.createSelection(s),l=e.insertContent(n,a);return t.setSelection(a),l})):void 0},{priority:"high"})}_enableDeleteContentIntegration(){const t=this.editor,e=this.editor.model.document.selection;this._listenToIfEnabled(t.model,"deleteContent",(t,[i])=>{if(i&&!i.is("documentSelection"))return;Yu(e)&&t.stop()},{priority:"high"})}}i(64);function tm(t){const e=t.model;return(i,n)=>{const o=n.keyCode==Io.arrowup,r=n.keyCode==Io.arrowdown,s=n.shiftKey,a=e.document.selection;if(!o&&!r)return;const l=r;if(s&&function(t,e){return!t.isCollapsed&&t.isBackward==e}(a,l))return;const c=function(t,e,i){const n=t.model;if(i){const t=e.isCollapsed?e.focus:e.getLastPosition(),i=em(n,t,"forward");if(!i)return null;const o=n.createRange(t,i),r=im(n.schema,o,"backward");return r&&t.isBefore(r)?n.createRange(t,r):null}{const t=e.isCollapsed?e.focus:e.getFirstPosition(),i=em(n,t,"backward");if(!i)return null;const o=n.createRange(i,t),r=im(n.schema,o,"forward");return r&&t.isAfter(r)?n.createRange(r,t):null}}(t,a,l);c&&!c.isCollapsed&&function(t,e,i){const n=t.model,o=t.view.domConverter;if(i){const t=n.createSelection(e.start);n.modifySelection(t),t.focus.isAtEnd||e.start.isEqual(t.focus)||(e=n.createRange(t.focus,e.end))}const r=t.mapper.toViewRange(e),s=o.viewRangeToDom(r),a=Ps.getDomRangeRects(s);let l;for(const t of a)if(void 0!==l){if(Math.round(t.top)>=l)return!1;l=Math.max(l,Math.round(t.bottom))}else l=Math.round(t.bottom);return!0}(t,c,l)&&(e.change(t=>{const i=l?c.end:c.start;if(s){const n=e.createSelection(a.anchor);n.setFocus(i),t.setSelection(n)}else t.setSelection(i)}),i.stop(),n.preventDefault(),n.stopPropagation())}}function em(t,e,i){const n=t.schema,o=t.createRangeIn(e.root),r="forward"==i?"elementStart":"elementEnd";for(const{previousPosition:t,item:s,type:a}of o.getWalker({startPosition:e,direction:i})){if(n.isLimit(s)&&!n.isInline(s))return t;if(a==r&&n.isBlock(s))return null}return null}function im(t,e,i){const n="backward"==i?e.end:e.start;if(t.checkChild(n,"$text"))return n;for(const{nextPosition:n}of e.getWalker({direction:i}))if(t.checkChild(n,"$text"))return n}class nm extends Qt{static get pluginName(){return"Widget"}static get requires(){return[Xu,Iu]}init(){const t=this.editor.editing.view,e=t.document;this._previouslySelected=new Set,this.editor.editing.downcastDispatcher.on("selection",(t,e,i)=>{this._clearPreviouslySelectedWidgets(i.writer);const n=i.writer,o=n.document.selection,r=o.getSelectedElement();let s=null;for(const t of o.getRanges())for(const e of t){const t=e.item;zu(t)&&!om(t,s)&&(n.addClass("ck-widget_selected",t),this._previouslySelected.add(t),s=t,t==r&&n.setSelection(o.getRanges(),{fake:!0,label:Fu(r)}))}},{priority:"low"}),t.addObserver(qh),this.listenTo(e,"mousedown",(...t)=>this._onMousedown(...t)),this.listenTo(e,"arrowKey",(...t)=>{this._handleSelectionChangeOnArrowKeyPress(...t)},{context:[zu,"$text"]}),this.listenTo(e,"arrowKey",(...t)=>{this._preventDefaultOnArrowKeyPress(...t)},{context:"$root"}),this.listenTo(e,"arrowKey",tm(this.editor.editing),{context:"$text"}),this.listenTo(e,"delete",(t,e)=>{this._handleDelete("forward"==e.direction)&&(e.preventDefault(),t.stop())},{context:"$root"})}_onMousedown(t,e){const i=this.editor,n=i.editing.view,o=n.document;let r=e.target;if(function(t){for(;t;){if(t.is("editableElement")&&!t.is("rootElement"))return!0;if(zu(t))return!1;t=t.parent}return!1}(r)){if((Po.isSafari||Po.isGecko)&&e.domEvent.detail>=3){const t=i.editing.mapper,n=r.is("attributeElement")?r.findAncestor(t=>!t.is("attributeElement")):r,o=t.toModelElement(n);e.preventDefault(),this.editor.model.change(t=>{t.setSelection(o,"in")})}return}if(!zu(r)&&(r=r.findAncestor(zu),!r))return;Po.isAndroid&&e.preventDefault(),o.isFocused||n.focus();const s=i.editing.mapper.toModelElement(r);this._setSelectionOverElement(s)}_handleSelectionChangeOnArrowKeyPress(t,e){const i=e.keyCode,n=this.editor.model,o=n.schema,r=n.document.selection,s=r.getSelectedElement(),a=Do(i,this.editor.locale.contentLanguageDirection);if(s&&o.isObject(s)){const i=a?r.getLastPosition():r.getFirstPosition(),s=o.getNearestSelectionRange(i,a?"forward":"backward");return void(s&&(n.change(t=>{t.setSelection(s)}),e.preventDefault(),t.stop()))}if(!r.isCollapsed)return;const l=this._getObjectElementNextToSelection(a);l&&o.isObject(l)&&(this._setSelectionOverElement(l),e.preventDefault(),t.stop())}_preventDefaultOnArrowKeyPress(t,e){const i=this.editor.model,n=i.schema,o=i.document.selection.getSelectedElement();o&&n.isObject(o)&&(e.preventDefault(),t.stop())}_handleDelete(t){if(this.editor.isReadOnly)return;const e=this.editor.model.document.selection;if(!e.isCollapsed)return;const i=this._getObjectElementNextToSelection(t);return i?(this.editor.model.change(t=>{let n=e.anchor.parent;for(;n.isEmpty;){const e=n;n=e.parent,t.remove(e)}this._setSelectionOverElement(i)}),!0):void 0}_setSelectionOverElement(t){this.editor.model.change(e=>{e.setSelection(e.createRangeOn(t))})}_getObjectElementNextToSelection(t){const e=this.editor.model,i=e.schema,n=e.document.selection,o=e.createSelection(n);e.modifySelection(o,{direction:t?"forward":"backward"});const r=t?o.focus.nodeBefore:o.focus.nodeAfter;return r&&i.isObject(r)?r:null}_clearPreviouslySelectedWidgets(t){for(const e of this._previouslySelected)t.removeClass("ck-widget_selected",e);this._previouslySelected.clear()}}function om(t,e){return!!e&&Array.from(t.getAncestors()).includes(e)}var rm=function(t,e,i){var n=!0,o=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return b(i)&&(n="leading"in i?!!i.leading:n,o="trailing"in i?!!i.trailing:o),fs(t,e,{leading:n,maxWait:e,trailing:o})};i(66);class sm extends Qt{static get pluginName(){return"DragDrop"}static get requires(){return[yu,nm]}init(){const t=this.editor,e=t.editing.view;this._draggedRange=null,this._draggingUid="",this._draggableElement=null,this._updateDropMarkerThrottled=rm(t=>this._updateDropMarker(t),40),this._removeDropMarkerDelayed=cm(()=>this._removeDropMarker(),40),this._clearDraggableAttributesDelayed=cm(()=>this._clearDraggableAttributes(),40),e.addObserver(_u),e.addObserver(qh),this._setupDragging(),this._setupContentInsertionIntegration(),this._setupClipboardInputIntegration(),this._setupDropMarker(),this._setupDraggableAttributeHandling(),this.listenTo(t,"change:isReadOnly",(t,e,i)=>{i?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")}),this.on("change:isEnabled",(t,e,i)=>{i||this._finalizeDragging(!1)}),Po.isAndroid&&this.forceDisabled("noAndroidSupport")}destroy(){return this._draggedRange&&(this._draggedRange.detach(),this._draggedRange=null),this._updateDropMarkerThrottled.cancel(),this._removeDropMarkerDelayed.cancel(),this._clearDraggableAttributesDelayed.cancel(),super.destroy()}_setupDragging(){const t=this.editor,e=t.model,i=e.document,n=t.editing.view,o=n.document;this.listenTo(o,"dragstart",(n,r)=>{const a=i.selection;if(r.target&&r.target.is("editableElement"))return void r.preventDefault();const l=r.target?dm(r.target):null;if(l){const i=t.editing.mapper.toModelElement(l);this._draggedRange=_a.fromRange(e.createRangeOn(i))}else if(!o.selection.isCollapsed){const t=o.selection.getSelectedElement();t&&zu(t)||(this._draggedRange=_a.fromRange(a.getFirstRange()))}if(!this._draggedRange)return void r.preventDefault();this._draggingUid=s(),r.dataTransfer.effectAllowed=this.isEnabled?"copyMove":"copy",r.dataTransfer.setData("application/ckeditor5-dragging-uid",this._draggingUid);const c=e.createSelection(this._draggedRange.toRange()),d=t.data.toView(e.getSelectedContent(c));o.fire("clipboardOutput",{dataTransfer:r.dataTransfer,content:d,method:n.name}),this.isEnabled||(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid="")},{priority:"low"}),this.listenTo(o,"dragend",(t,e)=>{this._finalizeDragging(!e.dataTransfer.isCanceled&&"move"==e.dataTransfer.dropEffect)},{priority:"low"}),this.listenTo(o,"dragenter",()=>{this.isEnabled&&n.focus()}),this.listenTo(o,"dragleave",()=>{this._removeDropMarkerDelayed()}),this.listenTo(o,"dragging",(e,i)=>{if(!this.isEnabled)return void(i.dataTransfer.dropEffect="none");this._removeDropMarkerDelayed.cancel();const n=am(t,i.targetRanges,i.target);this._draggedRange||(i.dataTransfer.dropEffect="copy"),Po.isGecko||("copy"==i.dataTransfer.effectAllowed?i.dataTransfer.dropEffect="copy":["all","copyMove"].includes(i.dataTransfer.effectAllowed)&&(i.dataTransfer.dropEffect="move")),n&&this._updateDropMarkerThrottled(n)},{priority:"low"})}_setupClipboardInputIntegration(){const t=this.editor,e=t.editing.view.document;this.listenTo(e,"clipboardInput",(e,i)=>{if("drop"!=i.method)return;const n=am(t,i.targetRanges,i.target);if(this._removeDropMarker(),!n)return this._finalizeDragging(!1),void e.stop();this._draggedRange&&this._draggingUid!=i.dataTransfer.getData("application/ckeditor5-dragging-uid")&&(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid="");if("move"==lm(i.dataTransfer)&&this._draggedRange&&this._draggedRange.containsRange(n,!0))return this._finalizeDragging(!1),void e.stop();i.targetRanges=[t.editing.mapper.toViewRange(n)]},{priority:"high"})}_setupContentInsertionIntegration(){const t=this.editor.plugins.get(yu);t.on("contentInsertion",(t,e)=>{if(!this.isEnabled||"drop"!==e.method)return;const i=e.targetRanges.map(t=>this.editor.editing.mapper.toModelRange(t));this.editor.model.change(t=>t.setSelection(i))},{priority:"high"}),t.on("contentInsertion",(t,e)=>{if(!this.isEnabled||"drop"!==e.method)return;const i="move"==lm(e.dataTransfer),n=!e.resultRange||!e.resultRange.isCollapsed;this._finalizeDragging(n&&i)},{priority:"lowest"})}_setupDraggableAttributeHandling(){const t=this.editor,e=t.editing.view,i=e.document;this.listenTo(i,"mousedown",(n,o)=>{if(Po.isAndroid||!o)return;this._clearDraggableAttributesDelayed.cancel();let r=dm(o.target);if(Po.isBlink&&!t.isReadOnly&&!r&&!i.selection.isCollapsed){const t=i.selection.getSelectedElement();t&&zu(t)||(r=i.selection.editableElement)}r&&(e.change(t=>{t.setAttribute("draggable","true",r)}),this._draggableElement=t.editing.mapper.toModelElement(r))}),this.listenTo(i,"mouseup",()=>{Po.isAndroid||this._clearDraggableAttributesDelayed()})}_clearDraggableAttributes(){const t=this.editor.editing;t.view.change(e=>{this._draggableElement&&"$graveyard"!=this._draggableElement.root.rootName&&e.removeAttribute("draggable",t.mapper.toViewElement(this._draggableElement)),this._draggableElement=null})}_setupDropMarker(){const t=this.editor;t.conversion.for("editingDowncast").markerToHighlight({model:"drop-target",view:{classes:["ck-clipboard-drop-target-range"]}}),t.conversion.for("editingDowncast").markerToElement({model:"drop-target",view:(e,{writer:i})=>{if(t.model.schema.checkChild(e.markerRange.start,"$text"))return i.createUIElement("span",{class:"ck ck-clipboard-drop-target-position"},(function(t){const e=this.toDomElement(t);return e.innerHTML="&NoBreak;<span></span>&NoBreak;",e}))}})}_updateDropMarker(t){const e=this.editor,i=e.model.markers;e.model.change(e=>{i.has("drop-target")?i.get("drop-target").getRange().isEqual(t)||e.updateMarker("drop-target",{range:t}):e.addMarker("drop-target",{range:t,usingOperation:!1,affectsData:!1})})}_removeDropMarker(){const t=this.editor.model;this._removeDropMarkerDelayed.cancel(),this._updateDropMarkerThrottled.cancel(),t.markers.has("drop-target")&&t.change(t=>{t.removeMarker("drop-target")})}_finalizeDragging(t){const e=this.editor.model;this._removeDropMarker(),this._clearDraggableAttributes(),this._draggingUid="",this._draggedRange&&(t&&this.isEnabled&&e.deleteContent(e.createSelection(this._draggedRange),{doNotAutoparagraph:!0}),this._draggedRange.detach(),this._draggedRange=null)}}function am(t,e,i){const n=t.model,o=t.editing.mapper;let r=null;const s=e?e[0].start:null;if(i.is("uiElement")&&(i=i.parent),r=function(t,e){const i=t.model,n=t.editing.mapper;if(zu(e))return i.createRangeOn(n.toModelElement(e));if(!e.is("editableElement")){const t=e.findAncestor(t=>zu(t)||t.is("editableElement"));if(zu(t))return i.createRangeOn(n.toModelElement(t))}return null}(t,i),r)return r;const a=function(t,e){const i=t.editing.mapper,n=t.editing.view,o=i.toModelElement(e);if(o)return o;const r=n.createPositionBefore(e),s=i.findMappedViewAncestor(r);return i.toModelElement(s)}(t,i),l=s?o.toModelPosition(s):null;return l?(r=function(t,e,i){const n=t.model;if(!n.schema.checkChild(i,"$block"))return null;const o=n.createPositionAt(i,0),r=e.path.slice(0,o.path.length),s=n.createPositionFromPath(e.root,r).nodeAfter;if(s&&n.schema.isObject(s))return n.createRangeOn(s);return null}(t,l,a),r||(r=n.schema.getNearestSelectionRange(l,Po.isGecko?"forward":"backward"),r||function(t,e){const i=t.model;for(;e;){if(i.schema.isObject(e))return i.createRangeOn(e);e=e.parent}}(t,l.parent))):function(t,e){const i=t.model,n=i.schema,o=i.createPositionAt(e,0);return n.getNearestSelectionRange(o,"forward")}(t,a)}function lm(t){return Po.isGecko?t.dropEffect:["all","copyMove"].includes(t.effectAllowed)?"move":"copy"}function cm(t,e){let i;function n(...o){n.cancel(),i=setTimeout(()=>t(...o),e)}return n.cancel=()=>{clearTimeout(i)},n}function dm(t){if(t.is("editableElement"))return null;if(t.hasClass("ck-widget__selection-handle"))return t.findAncestor(zu);if(zu(t))return t;const e=t.findAncestor(t=>zu(t)||t.is("editableElement"));return zu(e)?e:null}class hm extends Qt{static get pluginName(){return"PastePlainText"}static get requires(){return[yu]}init(){const t=this.editor,e=t.model,i=t.editing.view,n=i.document,o=e.document.selection;let r=!1;i.addObserver(_u),this.listenTo(n,"keydown",(t,e)=>{r=e.shiftKey}),t.plugins.get(yu).on("contentInsertion",(t,i)=>{(r||function(t,e){if(t.childCount>1)return!1;const i=t.getChild(0);if(e.isObject(i))return!1;return 0==[...i.getAttributeKeys()].length}(i.content,e.schema))&&e.change(t=>{const n=Array.from(o.getAttributes()).filter(([t])=>e.schema.getAttributeProperties(t).isFormatting);o.isCollapsed||e.deleteContent(o,{doNotAutoparagraph:!0}),n.push(...o.getAttributes());const r=t.createRangeIn(i.content);for(const e of r.getItems())e.is("$textProxy")&&t.setAttributes(n,e)})})}}class um extends Qt{static get pluginName(){return"Clipboard"}static get requires(){return[yu,sm,hm]}}class mm extends Zt{execute(){const t=this.editor.model,e=t.document;t.change(i=>{!function(t,e,i){const n=i.isCollapsed,o=i.getFirstRange(),r=o.start.parent,s=o.end.parent,a=r==s;if(n){const n=xu(t.schema,i.getAttributes());gm(t,e,o.end),e.removeSelectionAttribute(i.getAttributeKeys()),e.setSelectionAttribute(n)}else{const n=!(o.start.isAtStart&&o.end.isAtEnd);t.deleteContent(i,{leaveUnmerged:n}),a?gm(t,e,i.focus):n&&e.setSelection(s,0)}}(t,i,e.selection),this.fire("afterExecute",{writer:i})})}refresh(){const t=this.editor.model,e=t.document;this.isEnabled=function(t,e){if(e.rangeCount>1)return!1;const i=e.anchor;if(!i||!t.checkChild(i,"softBreak"))return!1;const n=e.getFirstRange(),o=n.start.parent,r=n.end.parent;if((fm(o,t)||fm(r,t))&&o!==r)return!1;return!0}(t.schema,e.selection)}}function gm(t,e,i){const n=e.createElement("softBreak");t.insertContent(n,i),e.setSelection(n,"after")}function fm(t,e){return!t.is("rootElement")&&(e.isLimit(t)||fm(t.parent,e))}class pm extends Qt{static get pluginName(){return"ShiftEnter"}init(){const t=this.editor,e=t.model.schema,i=t.conversion,n=t.editing.view,o=n.document;e.register("softBreak",{allowWhere:"$text",isInline:!0}),i.for("upcast").elementToElement({model:"softBreak",view:"br"}),i.for("downcast").elementToElement({model:"softBreak",view:(t,{writer:e})=>e.createEmptyElement("br")}),n.addObserver(Tu),t.commands.add("shiftEnter",new mm(t)),this.listenTo(o,"enter",(e,i)=>{i.preventDefault(),i.isSoft&&(t.execute("shiftEnter"),n.scrollToTheSelection())},{priority:"low"})}}class wm extends Zt{execute(){const t=this.editor.model,e=t.document.selection;let i=t.schema.getLimitElement(e);if(e.containsEntireContent(i)||!bm(t.schema,i))do{if(i=i.parent,!i)return}while(!bm(t.schema,i));t.change(t=>{t.setSelection(i,"in")})}}function bm(t,e){return t.isLimit(e)&&(t.checkChild(e,"$text")||t.checkChild(e,"paragraph"))}const km=Ro("Ctrl+A");class _m extends Qt{static get pluginName(){return"SelectAllEditing"}init(){const t=this.editor,e=t.editing.view.document;t.commands.add("selectAll",new wm(t)),this.listenTo(e,"keydown",(e,i)=>{No(i)===km&&(t.execute("selectAll"),i.preventDefault())})}}class vm extends Qt{static get pluginName(){return"SelectAllUI"}init(){const t=this.editor;t.ui.componentFactory.add("selectAll",e=>{const i=t.commands.get("selectAll"),n=new Ad(e),o=e.t;return n.set({label:o("Select all"),icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M.75 15.5a.75.75 0 0 1 .75.75V18l.008.09A.5.5 0 0 0 2 18.5h1.75a.75.75 0 1 1 0 1.5H1.5l-.144-.007a1.5 1.5 0 0 1-1.35-1.349L0 18.5v-2.25a.75.75 0 0 1 .75-.75zm18.5 0a.75.75 0 0 1 .75.75v2.25l-.007.144a1.5 1.5 0 0 1-1.349 1.35L18.5 20h-2.25a.75.75 0 1 1 0-1.5H18a.5.5 0 0 0 .492-.41L18.5 18v-1.75a.75.75 0 0 1 .75-.75zm-10.45 3c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2H7.2a.2.2 0 0 1-.2-.2v-1.1c0-.11.09-.2.2-.2h1.6zm4 0c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2h-1.6a.2.2 0 0 1-.2-.2v-1.1c0-.11.09-.2.2-.2h1.6zm.45-5.5a.75.75 0 1 1 0 1.5h-8.5a.75.75 0 1 1 0-1.5h8.5zM1.3 11c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2H.2a.2.2 0 0 1-.2-.2v-1.6c0-.11.09-.2.2-.2h1.1zm18.5 0c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2h-1.1a.2.2 0 0 1-.2-.2v-1.6c0-.11.09-.2.2-.2h1.1zm-4.55-2a.75.75 0 1 1 0 1.5H4.75a.75.75 0 1 1 0-1.5h10.5zM1.3 7c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2H.2a.2.2 0 0 1-.2-.2V7.2c0-.11.09-.2.2-.2h1.1zm18.5 0c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2h-1.1a.2.2 0 0 1-.2-.2V7.2c0-.11.09-.2.2-.2h1.1zm-4.55-2a.75.75 0 1 1 0 1.5h-2.5a.75.75 0 1 1 0-1.5h2.5zm-5 0a.75.75 0 1 1 0 1.5h-5.5a.75.75 0 0 1 0-1.5h5.5zm-6.5-5a.75.75 0 0 1 0 1.5H2a.5.5 0 0 0-.492.41L1.5 2v1.75a.75.75 0 0 1-1.5 0V1.5l.007-.144A1.5 1.5 0 0 1 1.356.006L1.5 0h2.25zM18.5 0l.144.007a1.5 1.5 0 0 1 1.35 1.349L20 1.5v2.25a.75.75 0 1 1-1.5 0V2l-.008-.09A.5.5 0 0 0 18 1.5h-1.75a.75.75 0 1 1 0-1.5h2.25zM8.8 0c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2H7.2a.2.2 0 0 1-.2-.2V.2c0-.11.09-.2.2-.2h1.6zm4 0c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2h-1.6a.2.2 0 0 1-.2-.2V.2c0-.11.09-.2.2-.2h1.6z"/></svg>',keystroke:"Ctrl+A",tooltip:!0}),n.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(n,"execute",()=>{t.execute("selectAll"),t.editing.view.focus()}),n})}}class ym extends Qt{static get requires(){return[_m,vm]}static get pluginName(){return"SelectAll"}}class xm extends Zt{constructor(t,e){super(t),this._buffer=new Pu(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,i=e.document,n=t.text||"",o=n.length,r=t.range?e.createSelection(t.range):i.selection,s=t.resultRange;e.enqueueChange(this._buffer.batch,t=>{this._buffer.lock(),this._batches.add(this._buffer.batch),e.deleteContent(r),n&&e.insertContent(t.createText(n,i.selection.getAttributes()),r),s?t.setSelection(s):r.is("documentSelection")||t.setSelection(r),this._buffer.unlock(),this._buffer.input(o)})}}function Am(t){if(t.newChildren.length-t.oldChildren.length!=1)return;const e=function(t,e){const i=[];let n,o=0;return t.forEach(t=>{"equal"==t?(r(),o++):"insert"==t?(s("insert")?n.values.push(e[o]):(r(),n={type:"insert",index:o,values:[e[o]]}),o++):s("delete")?n.howMany++:(r(),n={type:"delete",index:o,howMany:1})}),r(),i;function r(){n&&(i.push(n),n=null)}function s(t){return n&&n.type==t}}(ur(t.oldChildren,t.newChildren,Cm),t.newChildren);if(e.length>1)return;const i=e[0];return i.values[0]&&i.values[0].is("$text")?i:void 0}function Cm(t,e){return t&&t.is("$text")&&e&&e.is("$text")?t.data===e.data:t===e}class Tm{constructor(t){this.editor=t,this.editing=this.editor.editing}handle(t,e){if(function(t){if(0==t.length)return!1;for(const e of t)if("children"===e.type&&!Am(e))return!0;return!1}(t))this._handleContainerChildrenMutations(t,e);else for(const i of t)this._handleTextMutation(i,e),this._handleTextNodeInsertion(i)}_handleContainerChildrenMutations(t,e){const i=function(t){const e=t.map(t=>t.node).reduce((t,e)=>t.getCommonAncestor(e,{includeSelf:!0}));if(!e)return;return e.getAncestors({includeSelf:!0,parentFirst:!0}).find(t=>t.is("containerElement")||t.is("rootElement"))}(t);if(!i)return;const n=this.editor.editing.view.domConverter.mapViewToDom(i),o=new Tr(this.editor.editing.view.document),r=this.editor.data.toModel(o.domToView(n)).getChild(0),s=this.editor.editing.mapper.toModelElement(i);if(!s)return;const a=Array.from(r.getChildren()),l=Array.from(s.getChildren()),c=a[a.length-1],d=l[l.length-1],h=c&&c.is("element","softBreak"),u=d&&!d.is("element","softBreak");h&&u&&a.pop();const m=this.editor.model.schema;if(!Em(a,m)||!Em(l,m))return;const g=a.map(t=>t.is("$text")?t.data:"@").join("").replace(/\u00A0/g," "),f=l.map(t=>t.is("$text")?t.data:"@").join("").replace(/\u00A0/g," ");if(f===g)return;const p=ur(f,g),{firstChangeAt:w,insertions:b,deletions:k}=Pm(p);let _=null;e&&(_=this.editing.mapper.toModelRange(e.getFirstRange()));const v=g.substr(w,b),y=this.editor.model.createRange(this.editor.model.createPositionAt(s,w),this.editor.model.createPositionAt(s,w+k));this.editor.execute("input",{text:v,range:y,resultRange:_})}_handleTextMutation(t,e){if("text"!=t.type)return;const i=t.newText.replace(/\u00A0/g," "),n=t.oldText.replace(/\u00A0/g," ");if(n===i)return;const o=ur(n,i),{firstChangeAt:r,insertions:s,deletions:a}=Pm(o);let l=null;e&&(l=this.editing.mapper.toModelRange(e.getFirstRange()));const c=this.editing.view.createPositionAt(t.node,r),d=this.editing.mapper.toModelPosition(c),h=this.editor.model.createRange(d,d.getShiftedBy(a)),u=i.substr(r,s);this.editor.execute("input",{text:u,range:h,resultRange:l})}_handleTextNodeInsertion(t){if("children"!=t.type)return;const e=Am(t),i=this.editing.view.createPositionAt(t.node,e.index),n=this.editing.mapper.toModelPosition(i),o=e.values[0].data;this.editor.execute("input",{text:o.replace(/\u00A0/g," "),range:this.editor.model.createRange(n)})}}function Em(t,e){return t.every(t=>e.isInline(t))}function Pm(t){let e=null,i=null;for(let n=0;n<t.length;n++){"equal"!=t[n]&&(e=null===e?n:e,i=n)}let n=0,o=0;for(let r=e;r<=i;r++)"insert"!=t[r]&&n++,"delete"!=t[r]&&o++;return{insertions:o,deletions:n,firstChangeAt:e}}class Sm extends Qt{static get pluginName(){return"Input"}init(){const t=this.editor,e=new xm(t,t.config.get("typing.undoStep")||20);t.commands.add("input",e),function(t){let e=null;const i=t.model,n=t.editing.view,o=t.commands.get("input");function r(t){const r=i.document,a=n.document.isComposing,l=e&&e.isEqual(r.selection);e=null,o.isEnabled&&(Qu(t)||r.selection.isCollapsed||a&&229===t.keyCode||!a&&229===t.keyCode&&l||s())}function s(){const t=o.buffer;t.lock();const e=t.batch;o._batches.add(e),i.enqueueChange(e,()=>{i.deleteContent(i.document.selection)}),t.unlock()}Po.isAndroid?n.document.on("beforeinput",(t,e)=>r(e),{priority:"lowest"}):n.document.on("keydown",(t,e)=>r(e),{priority:"lowest"}),n.document.on("compositionstart",(function(){const t=i.document,e=1!==t.selection.rangeCount||t.selection.getFirstRange().isFlat;if(t.selection.isCollapsed||e)return;s()}),{priority:"lowest"}),n.document.on("compositionend",()=>{e=i.createSelection(i.document.selection)},{priority:"lowest"})}(t),function(t){t.editing.view.document.on("mutations",(e,i,n)=>{new Tm(t).handle(i,n)})}(t)}isInput(t){return this.editor.commands.get("input")._batches.has(t)}}class Mm extends Qt{static get requires(){return[Sm,Iu]}static get pluginName(){return"Typing"}}function Im(t,e){let i=t.start;return{text:Array.from(t.getItems()).reduce((t,n)=>n.is("$text")||n.is("$textProxy")?t+n.data:(i=e.createPositionAfter(n),""),""),range:e.createRange(i,t.end)}}class Lm{constructor(t,e){this.model=t,this.testCallback=e,this.hasMatch=!1,this.set("isEnabled",!0),this.on("change:isEnabled",()=>{this.isEnabled?this._startListening():(this.stopListening(t.document.selection),this.stopListening(t.document))}),this._startListening()}_startListening(){const t=this.model.document;this.listenTo(t.selection,"change:range",(e,{directChange:i})=>{i&&(t.selection.isCollapsed?this._evaluateTextBeforeSelection("selection"):this.hasMatch&&(this.fire("unmatched"),this.hasMatch=!1))}),this.listenTo(t,"change:data",(t,e)=>{"transparent"!=e.type&&this._evaluateTextBeforeSelection("data",{batch:e})})}_evaluateTextBeforeSelection(t,e={}){const i=this.model,n=i.document.selection,o=i.createRange(i.createPositionAt(n.focus.parent,0),n.focus),{text:r,range:s}=Im(o,i),a=this.testCallback(r);if(!a&&this.hasMatch&&this.fire("unmatched"),this.hasMatch=!!a,a){const i=Object.assign(e,{text:r,range:s});"object"==typeof a&&Object.assign(i,a),this.fire("matched:"+t,i)}}}Kt(Lm,Ut);class Nm extends Qt{static get pluginName(){return"TwoStepCaretMovement"}constructor(t){super(t),this.attributes=new Set,this._overrideUid=null}init(){const t=this.editor,e=t.model,i=t.editing.view,n=t.locale,o=e.document.selection;this.listenTo(i.document,"arrowKey",(t,e)=>{if(!o.isCollapsed)return;if(e.shiftKey||e.altKey||e.ctrlKey)return;const i=e.keyCode==Io.arrowright,r=e.keyCode==Io.arrowleft;if(!i&&!r)return;const s=n.contentLanguageDirection;let a=!1;a="ltr"===s&&i||"rtl"===s&&r?this._handleForwardMovement(e):this._handleBackwardMovement(e),!0===a&&t.stop()},{context:"$text",priority:"highest"}),this._isNextGravityRestorationSkipped=!1,this.listenTo(o,"change:range",(t,e)=>{this._isNextGravityRestorationSkipped?this._isNextGravityRestorationSkipped=!1:this._isGravityOverridden&&(!e.directChange&&Dm(o.getFirstPosition(),this.attributes)||this._restoreGravity())})}registerAttribute(t){this.attributes.add(t)}_handleForwardMovement(t){const e=this.attributes,i=this.editor.model.document.selection,n=i.getFirstPosition();return!this._isGravityOverridden&&((!n.isAtStart||!Rm(i,e))&&(Dm(n,e)?(zm(t),this._overrideGravity(),!0):void 0))}_handleBackwardMovement(t){const e=this.attributes,i=this.editor.model,n=i.document.selection,o=n.getFirstPosition();return this._isGravityOverridden?(zm(t),this._restoreGravity(),Om(i,e,o),!0):o.isAtStart?!!Rm(n,e)&&(zm(t),Om(i,e,o),!0):function(t,e){return Dm(t.getShiftedBy(-1),e)}(o,e)?o.isAtEnd&&!Rm(n,e)&&Dm(o,e)?(zm(t),Om(i,e,o),!0):(this._isNextGravityRestorationSkipped=!0,this._overrideGravity(),!1):void 0}get _isGravityOverridden(){return!!this._overrideUid}_overrideGravity(){this._overrideUid=this.editor.model.change(t=>t.overrideSelectionGravity())}_restoreGravity(){this.editor.model.change(t=>{t.restoreSelectionGravity(this._overrideUid),this._overrideUid=null})}}function Rm(t,e){for(const i of e)if(t.hasAttribute(i))return!0;return!1}function Om(t,e,i){const n=i.nodeBefore;t.change(t=>{n?t.setSelectionAttribute(n.getAttributes()):t.removeSelectionAttribute(e)})}function zm(t){t.preventDefault()}function Dm(t,e){const{nodeBefore:i,nodeAfter:n}=t;for(const t of e){const e=i?i.getAttribute(t):void 0;if((n?n.getAttribute(t):void 0)!==e)return!0}return!1}var Vm=/[\\^$.*+?()[\]{}|]/g,jm=RegExp(Vm.source);var Bm=function(t){return(t=Sn(t))&&jm.test(t)?t.replace(Vm,"\\$&"):t};const Fm={copyright:{from:"(c)",to:"©"},registeredTrademark:{from:"(r)",to:"®"},trademark:{from:"(tm)",to:"™"},oneHalf:{from:"1/2",to:"½"},oneThird:{from:"1/3",to:"⅓"},twoThirds:{from:"2/3",to:"⅔"},oneForth:{from:"1/4",to:"¼"},threeQuarters:{from:"3/4",to:"¾"},lessThanOrEqual:{from:"<=",to:"≤"},greaterThanOrEqual:{from:">=",to:"≥"},notEqual:{from:"!=",to:"≠"},arrowLeft:{from:"<-",to:"←"},arrowRight:{from:"->",to:"→"},horizontalEllipsis:{from:"...",to:"…"},enDash:{from:/(^| )(--)( )$/,to:[null,"–",null]},emDash:{from:/(^| )(---)( )$/,to:[null,"—",null]},quotesPrimary:{from:Gm('"'),to:[null,"“",null,"”"]},quotesSecondary:{from:Gm("'"),to:[null,"‘",null,"’"]},quotesPrimaryEnGb:{from:Gm("'"),to:[null,"‘",null,"’"]},quotesSecondaryEnGb:{from:Gm('"'),to:[null,"“",null,"”"]},quotesPrimaryPl:{from:Gm('"'),to:[null,"„",null,"”"]},quotesSecondaryPl:{from:Gm("'"),to:[null,"‚",null,"’"]}},Hm={symbols:["copyright","registeredTrademark","trademark"],mathematical:["oneHalf","oneThird","twoThirds","oneForth","threeQuarters","lessThanOrEqual","greaterThanOrEqual","notEqual","arrowLeft","arrowRight"],typography:["horizontalEllipsis","enDash","emDash"],quotes:["quotesPrimary","quotesSecondary"]},Um=["symbols","mathematical","typography","quotes"];function qm(t){return"string"==typeof t?new RegExp(`(${Bm(t)})$`):t}function Wm(t){return"string"==typeof t?()=>[t]:t instanceof Array?()=>t:t}function $m(t){return(t.textNode?t.textNode:t.nodeAfter).getAttributes()}function Gm(t){return new RegExp(`(^|\\s)(${t})([^${t}]*)(${t})$`)}function Ym(t,e,i,n){return n.createRange(Km(t,e,i,!0,n),Km(t,e,i,!1,n))}function Km(t,e,i,n,o){let r=t.textNode||(n?t.nodeBefore:t.nodeAfter),s=null;for(;r&&r.getAttribute(e)==i;)s=r,r=n?r.previousSibling:r.nextSibling;return s?o.createPositionAt(s,n?"before":"after"):t}class Qm extends Zt{constructor(t){super(t),this._stack=[],this._createdBatches=new WeakSet,this.refresh(),this.listenTo(t.data,"set",()=>this.clearStack())}refresh(){this.isEnabled=this._stack.length>0}addBatch(t){const e=this.editor.model.document.selection,i={ranges:e.hasOwnRange?Array.from(e.getRanges()):[],isBackward:e.isBackward};this._stack.push({batch:t,selection:i}),this.refresh()}clearStack(){this._stack=[],this.refresh()}_restoreSelection(t,e,i){const n=this.editor.model,o=n.document,r=[],s=t.map(t=>t.getTransformedByOperations(i)),a=s.flat();for(const t of s){const e=t.filter(t=>t.root!=o.graveyard).filter(t=>!Zm(t,a));e.length&&(Jm(e),r.push(e[0]))}r.length&&n.change(t=>{t.setSelection(r,{backward:e})})}_undo(t,e){const i=this.editor.model,n=i.document;this._createdBatches.add(e);const o=t.operations.slice().filter(t=>t.isDocumentOperation);o.reverse();for(const t of o){const o=t.baseVersion+1,r=Array.from(n.history.getOperations(o)),s=zh([t.getReversed()],r,{useRelations:!0,document:this.editor.model.document,padWithNoOps:!1,forceWeakRemove:!0}).operationsA;for(const o of s)e.addOperation(o),i.applyOperation(o),n.history.setOperationAsUndone(t,o)}}}function Jm(t){t.sort((t,e)=>t.start.isBefore(e.start)?-1:1);for(let e=1;e<t.length;e++){const i=t[e-1].getJoined(t[e],!0);i&&(e--,t.splice(e,2,i))}}function Zm(t,e){return e.some(e=>e!==t&&e.containsRange(t,!0))}class Xm extends Qm{execute(t=null){const e=t?this._stack.findIndex(e=>e.batch==t):this._stack.length-1,i=this._stack.splice(e,1)[0],n=this.editor.model.createBatch("transparent");this.editor.model.enqueueChange(n,()=>{this._undo(i.batch,n);const t=this.editor.model.document.history.getOperations(i.batch.baseVersion);this._restoreSelection(i.selection.ranges,i.selection.isBackward,t),this.fire("revert",i.batch,n)}),this.refresh()}}class tg extends Qm{execute(){const t=this._stack.pop(),e=this.editor.model.createBatch("transparent");this.editor.model.enqueueChange(e,()=>{const i=t.batch.operations[t.batch.operations.length-1].baseVersion+1,n=this.editor.model.document.history.getOperations(i);this._restoreSelection(t.selection.ranges,t.selection.isBackward,n),this._undo(t.batch,e)}),this.refresh()}}class eg extends Qt{static get pluginName(){return"UndoEditing"}constructor(t){super(t),this._batchRegistry=new WeakSet}init(){const t=this.editor;this._undoCommand=new Xm(t),this._redoCommand=new tg(t),t.commands.add("undo",this._undoCommand),t.commands.add("redo",this._redoCommand),this.listenTo(t.model,"applyOperation",(t,e)=>{const i=e[0];if(!i.isDocumentOperation)return;const n=i.batch,o=this._redoCommand._createdBatches.has(n),r=this._undoCommand._createdBatches.has(n);this._batchRegistry.has(n)||"transparent"==n.type&&!o&&!r||(o?this._undoCommand.addBatch(n):r||(this._undoCommand.addBatch(n),this._redoCommand.clearStack()),this._batchRegistry.add(n))},{priority:"highest"}),this.listenTo(this._undoCommand,"revert",(t,e,i)=>{this._redoCommand.addBatch(i)}),t.keystrokes.set("CTRL+Z","undo"),t.keystrokes.set("CTRL+Y","redo"),t.keystrokes.set("CTRL+SHIFT+Z","redo")}}var ig='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m5.042 9.367 2.189 1.837a.75.75 0 0 1-.965 1.149l-3.788-3.18a.747.747 0 0 1-.21-.284.75.75 0 0 1 .17-.945L6.23 4.762a.75.75 0 1 1 .964 1.15L4.863 7.866h8.917A.75.75 0 0 1 14 7.9a4 4 0 1 1-1.477 7.718l.344-1.489a2.5 2.5 0 1 0 1.094-4.73l.008-.032H5.042z"/></svg>',ng='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m14.958 9.367-2.189 1.837a.75.75 0 0 0 .965 1.149l3.788-3.18a.747.747 0 0 0 .21-.284.75.75 0 0 0-.17-.945L13.77 4.762a.75.75 0 1 0-.964 1.15l2.331 1.955H6.22A.75.75 0 0 0 6 7.9a4 4 0 1 0 1.477 7.718l-.344-1.489A2.5 2.5 0 1 1 6.039 9.4l-.008-.032h8.927z"/></svg>';class og extends Qt{static get pluginName(){return"UndoUI"}init(){const t=this.editor,e=t.locale,i=t.t,n="ltr"==e.uiLanguageDirection?ig:ng,o="ltr"==e.uiLanguageDirection?ng:ig;this._addButton("undo",i("Undo"),"CTRL+Z",n),this._addButton("redo",i("Redo"),"CTRL+Y",o)}_addButton(t,e,i,n){const o=this.editor;o.ui.componentFactory.add(t,r=>{const s=o.commands.get(t),a=new Ad(r);return a.set({label:e,icon:n,keystroke:i,tooltip:!0}),a.bind("isEnabled").to(s,"isEnabled"),this.listenTo(a,"execute",()=>{o.execute(t),o.editing.view.focus()}),a})}}class rg extends Qt{static get requires(){return[eg,og]}static get pluginName(){return"Undo"}}class sg{constructor(){const t=new window.FileReader;this._reader=t,this._data=void 0,this.set("loaded",0),t.onprogress=t=>{this.loaded=t.loaded}}get error(){return this._reader.error}get data(){return this._data}read(t){const e=this._reader;return this.total=t.size,new Promise((i,n)=>{e.onload=()=>{const t=e.result;this._data=t,i(t)},e.onerror=()=>{n("error")},e.onabort=()=>{n("aborted")},this._reader.readAsDataURL(t)})}abort(){this._reader.abort()}}Kt(sg,Ut);class ag extends Qt{static get pluginName(){return"FileRepository"}static get requires(){return[Mc]}init(){this.loaders=new Zi,this.loaders.on("add",()=>this._updatePendingAction()),this.loaders.on("remove",()=>this._updatePendingAction()),this._loadersMap=new Map,this._pendingAction=null,this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(t,e)=>e?t/e*100:0)}getLoader(t){return this._loadersMap.get(t)||null}createLoader(t){if(!this.createUploadAdapter)return Object(l.b)("filerepository-no-upload-adapter"),null;const e=new lg(Promise.resolve(t),this.createUploadAdapter);return this.loaders.add(e),this._loadersMap.set(t,e),t instanceof Promise&&e.file.then(t=>{this._loadersMap.set(t,e)}).catch(()=>{}),e.on("change:uploaded",()=>{let t=0;for(const e of this.loaders)t+=e.uploaded;this.uploaded=t}),e.on("change:uploadTotal",()=>{let t=0;for(const e of this.loaders)e.uploadTotal&&(t+=e.uploadTotal);this.uploadTotal=t}),e}destroyLoader(t){const e=t instanceof lg?t:this.getLoader(t);e._destroy(),this.loaders.remove(e),this._loadersMap.forEach((t,i)=>{t===e&&this._loadersMap.delete(i)})}_updatePendingAction(){const t=this.editor.plugins.get(Mc);if(this.loaders.length){if(!this._pendingAction){const e=this.editor.t,i=t=>`${e("Upload in progress")} ${parseInt(t)}%.`;this._pendingAction=t.add(i(this.uploadedPercent)),this._pendingAction.bind("message").to(this,"uploadedPercent",i)}}else t.remove(this._pendingAction),this._pendingAction=null}}Kt(ag,Ut);class lg{constructor(t,e){this.id=s(),this._filePromiseWrapper=this._createFilePromiseWrapper(t),this._adapter=e(this),this._reader=new sg,this.set("status","idle"),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(t,e)=>e?t/e*100:0),this.set("uploadResponse",null)}get file(){return this._filePromiseWrapper?this._filePromiseWrapper.promise.then(t=>this._filePromiseWrapper?t:null):Promise.resolve(null)}get data(){return this._reader.data}read(){if("idle"!=this.status)throw new l.a("filerepository-read-wrong-status",this);return this.status="reading",this.file.then(t=>this._reader.read(t)).then(t=>{if("reading"!==this.status)throw this.status;return this.status="idle",t}).catch(t=>{if("aborted"===t)throw this.status="aborted","aborted";throw this.status="error",this._reader.error?this._reader.error:t})}upload(){if("idle"!=this.status)throw new l.a("filerepository-upload-wrong-status",this);return this.status="uploading",this.file.then(()=>this._adapter.upload()).then(t=>(this.uploadResponse=t,this.status="idle",t)).catch(t=>{if("aborted"===this.status)throw"aborted";throw this.status="error",t})}abort(){const t=this.status;this.status="aborted",this._filePromiseWrapper.isFulfilled?"reading"==t?this._reader.abort():"uploading"==t&&this._adapter.abort&&this._adapter.abort():(this._filePromiseWrapper.promise.catch(()=>{}),this._filePromiseWrapper.rejecter("aborted")),this._destroy()}_destroy(){this._filePromiseWrapper=void 0,this._reader=void 0,this._adapter=void 0,this.uploadResponse=void 0}_createFilePromiseWrapper(t){const e={};return e.promise=new Promise((i,n)=>{e.rejecter=n,e.isFulfilled=!1,t.then(t=>{e.isFulfilled=!0,i(t)}).catch(t=>{e.isFulfilled=!0,n(t)})}),e}}Kt(lg,Ut);class cg extends ed{constructor(t){super(t),this.buttonView=new Ad(t),this._fileInputView=new dg(t),this._fileInputView.bind("acceptedType").to(this),this._fileInputView.bind("allowMultipleFiles").to(this),this._fileInputView.delegate("done").to(this),this.setTemplate({tag:"span",attributes:{class:"ck-file-dialog-button"},children:[this.buttonView,this._fileInputView]}),this.buttonView.on("execute",()=>{this._fileInputView.open()})}focus(){this.buttonView.focus()}}class dg extends ed{constructor(t){super(t),this.set("acceptedType"),this.set("allowMultipleFiles",!1);const e=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck-hidden"],type:"file",tabindex:"-1",accept:e.to("acceptedType"),multiple:e.to("allowMultipleFiles")},on:{change:e.to(()=>{this.element&&this.element.files&&this.element.files.length&&this.fire("done",this.element.files),this.element.value=""})}})}open(){this.element.click()}}function hg(){let t=function(t){t=t.toLowerCase();const e=document.cookie.split(";");for(const i of e){const e=i.split("=");if(decodeURIComponent(e[0].trim().toLowerCase())===t)return decodeURIComponent(e[1])}return null}("ckCsrfToken");var e,i;return t&&40==t.length||(t=function(t){let e="";const i=new Uint8Array(t);window.crypto.getRandomValues(i);for(let t=0;t<i.length;t++){const n="abcdefghijklmnopqrstuvwxyz0123456789".charAt(i[t]%"abcdefghijklmnopqrstuvwxyz0123456789".length);e+=Math.random()>.5?n.toUpperCase():n}return e}(40),e="ckCsrfToken",i=t,document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(i)+";path=/"),t}class ug{constructor(t,e,i){this.loader=t,this.url=e,this.t=i}upload(){return this.loader.file.then(t=>new Promise((e,i)=>{this._initRequest(),this._initListeners(e,i,t),this._sendRequest(t)}))}abort(){this.xhr&&this.xhr.abort()}_initRequest(){const t=this.xhr=new XMLHttpRequest;t.open("POST",this.url,!0),t.responseType="json"}_initListeners(t,e,i){const n=this.xhr,o=this.loader,r=(0,this.t)("Cannot upload file:")+` ${i.name}.`;n.addEventListener("error",()=>e(r)),n.addEventListener("abort",()=>e()),n.addEventListener("load",()=>{const i=n.response;if(!i||!i.uploaded)return e(i&&i.error&&i.error.message?i.error.message:r);t({default:i.url})}),n.upload&&n.upload.addEventListener("progress",t=>{t.lengthComputable&&(o.uploadTotal=t.total,o.uploaded=t.loaded)})}_sendRequest(t){const e=new FormData;e.append("upload",t),e.append("ckCsrfToken",hg()),this.xhr.send(e)}}function mg(t,e,i,n){let o,r=null;"function"==typeof n?o=n:(r=t.commands.get(n),o=()=>{t.execute(n)}),t.model.document.on("change:data",(s,a)=>{if(r&&!r.isEnabled||!e.isEnabled)return;const l=Os(t.model.document.selection.getRanges());if(!l.isCollapsed)return;if("transparent"==a.type)return;const c=Array.from(t.model.document.differ.getChanges()),d=c[0];if(1!=c.length||"insert"!==d.type||"$text"!=d.name||1!=d.length)return;const h=d.position.parent;if(h.is("element","codeBlock"))return;if(h.is("element","listItem")&&"function"!=typeof n&&!["numberedList","bulletedList","todoList"].includes(n))return;if(r&&!0===r.value)return;const u=h.getChild(0),m=t.model.createRangeOn(u);if(!m.containsRange(l)&&!l.end.isEqual(m.end))return;const g=i.exec(u.data.substr(0,l.end.offset));g&&t.model.enqueueChange(e=>{const i=e.createPositionAt(h,0),n=e.createPositionAt(h,g[0].length),r=new _a(i,n);if(!1!==o({match:g})){e.remove(r);const i=t.model.document.selection.getFirstRange(),n=e.createRangeIn(h);!h.isEmpty||n.isEqual(i)||n.containsRange(i,!0)||e.remove(h)}r.detach()})})}function gg(t,e,i,n){let o,r;i instanceof RegExp?o=i:r=i,r=r||(t=>{let e;const i=[],n=[];for(;null!==(e=o.exec(t))&&!(e&&e.length<4);){let{index:t,1:o,2:r,3:s}=e;const a=o+r+s;t+=e[0].length-a.length;const l=[t,t+o.length],c=[t+o.length+r.length,t+o.length+r.length+s.length];i.push(l),i.push(c),n.push([t+o.length,t+o.length+r.length])}return{remove:i,format:n}}),t.model.document.on("change:data",(i,o)=>{if("transparent"==o.type||!e.isEnabled)return;const s=t.model,a=s.document.selection;if(!a.isCollapsed)return;const l=Array.from(s.document.differ.getChanges()),c=l[0];if(1!=l.length||"insert"!==c.type||"$text"!=c.name||1!=c.length)return;const d=a.focus,h=d.parent,{text:u,range:m}=function(t,e){let i=t.start;return{text:Array.from(t.getItems()).reduce((t,n)=>!n.is("$text")&&!n.is("$textProxy")||n.getAttribute("code")?(i=e.createPositionAfter(n),""):t+n.data,""),range:e.createRange(i,t.end)}}(s.createRange(s.createPositionAt(h,0),d),s),g=r(u),f=fg(m.start,g.format,s),p=fg(m.start,g.remove,s);f.length&&p.length&&s.enqueueChange(t=>{if(!1!==n(t,f))for(const e of p.reverse())t.remove(e)})})}function fg(t,e,i){return e.filter(t=>void 0!==t[0]&&void 0!==t[1]).map(e=>i.createRange(t.getShiftedBy(e[0]),t.getShiftedBy(e[1])))}function pg(t,e){return(i,n)=>{if(!t.commands.get(e).isEnabled)return!1;const o=t.model.schema.getValidRanges(n,e);for(const t of o)i.setAttribute(e,!0,t);i.removeSelectionAttribute(e)}}class wg extends Zt{constructor(t,e){super(t),this.attributeKey=e}refresh(){const t=this.editor.model,e=t.document;this.value=this._getValueFromFirstAllowedNode(),this.isEnabled=t.schema.checkAttributeInSelection(e.selection,this.attributeKey)}execute(t={}){const e=this.editor.model,i=e.document.selection,n=void 0===t.forceValue?!this.value:t.forceValue;e.change(t=>{if(i.isCollapsed)n?t.setSelectionAttribute(this.attributeKey,!0):t.removeSelectionAttribute(this.attributeKey);else{const o=e.schema.getValidRanges(i.getRanges(),this.attributeKey);for(const e of o)n?t.setAttribute(this.attributeKey,n,e):t.removeAttribute(this.attributeKey,e)}})}_getValueFromFirstAllowedNode(){const t=this.editor.model,e=t.schema,i=t.document.selection;if(i.isCollapsed)return i.hasAttribute(this.attributeKey);for(const t of i.getRanges())for(const i of t.getItems())if(e.checkAttribute(i,this.attributeKey))return i.hasAttribute(this.attributeKey);return!1}}class bg extends Qt{static get pluginName(){return"BoldEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"bold"}),t.model.schema.setAttributeProperties("bold",{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:"bold",view:"strong",upcastAlso:["b",t=>{const e=t.getStyle("font-weight");return e?"bold"==e||Number(e)>=600?{name:!0,styles:["font-weight"]}:void 0:null}]}),t.commands.add("bold",new wg(t,"bold")),t.keystrokes.set("CTRL+B","bold")}}class kg extends Qt{static get pluginName(){return"BoldUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("bold",i=>{const n=t.commands.get("bold"),o=new Ad(i);return o.set({label:e("Bold"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M10.187 17H5.773c-.637 0-1.092-.138-1.364-.415-.273-.277-.409-.718-.409-1.323V4.738c0-.617.14-1.062.419-1.332.279-.27.73-.406 1.354-.406h4.68c.69 0 1.288.041 1.793.124.506.083.96.242 1.36.478.341.197.644.447.906.75a3.262 3.262 0 0 1 .808 2.162c0 1.401-.722 2.426-2.167 3.075C15.05 10.175 16 11.315 16 13.01a3.756 3.756 0 0 1-2.296 3.504 6.1 6.1 0 0 1-1.517.377c-.571.073-1.238.11-2 .11zm-.217-6.217H7v4.087h3.069c1.977 0 2.965-.69 2.965-2.072 0-.707-.256-1.22-.768-1.537-.512-.319-1.277-.478-2.296-.478zM7 5.13v3.619h2.606c.729 0 1.292-.067 1.69-.2a1.6 1.6 0 0 0 .91-.765c.165-.267.247-.566.247-.897 0-.707-.26-1.176-.778-1.409-.519-.232-1.31-.348-2.375-.348H7z"/></svg>',keystroke:"CTRL+B",tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(o,"execute",()=>{t.execute("bold"),t.editing.view.focus()}),o})}}class _g extends Qt{static get pluginName(){return"ItalicEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"italic"}),t.model.schema.setAttributeProperties("italic",{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:"italic",view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]}),t.commands.add("italic",new wg(t,"italic")),t.keystrokes.set("CTRL+I","italic")}}class vg extends Qt{static get pluginName(){return"ItalicUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("italic",i=>{const n=t.commands.get("italic"),o=new Ad(i);return o.set({label:e("Italic"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m9.586 14.633.021.004c-.036.335.095.655.393.962.082.083.173.15.274.201h1.474a.6.6 0 1 1 0 1.2H5.304a.6.6 0 0 1 0-1.2h1.15c.474-.07.809-.182 1.005-.334.157-.122.291-.32.404-.597l2.416-9.55a1.053 1.053 0 0 0-.281-.823 1.12 1.12 0 0 0-.442-.296H8.15a.6.6 0 0 1 0-1.2h6.443a.6.6 0 1 1 0 1.2h-1.195c-.376.056-.65.155-.823.296-.215.175-.423.439-.623.79l-2.366 9.347z"/></svg>',keystroke:"CTRL+I",tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(o,"execute",()=>{t.execute("italic"),t.editing.view.focus()}),o})}}class yg extends Zt{refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){const e=this.editor.model,i=e.schema,n=e.document.selection,o=Array.from(n.getSelectedBlocks()),r=void 0===t.forceValue?!this.value:t.forceValue;e.change(t=>{if(r){const e=o.filter(t=>xg(t)||Cg(i,t));this._applyQuote(t,e)}else this._removeQuote(t,o.filter(xg))})}_getValue(){const t=Os(this.editor.model.document.selection.getSelectedBlocks());return!(!t||!xg(t))}_checkEnabled(){if(this.value)return!0;const t=this.editor.model.document.selection,e=this.editor.model.schema,i=Os(t.getSelectedBlocks());return!!i&&Cg(e,i)}_removeQuote(t,e){Ag(t,e).reverse().forEach(e=>{if(e.start.isAtStart&&e.end.isAtEnd)return void t.unwrap(e.start.parent);if(e.start.isAtStart){const i=t.createPositionBefore(e.start.parent);return void t.move(e,i)}e.end.isAtEnd||t.split(e.end);const i=t.createPositionAfter(e.end.parent);t.move(e,i)})}_applyQuote(t,e){const i=[];Ag(t,e).reverse().forEach(e=>{let n=xg(e.start);n||(n=t.createElement("blockQuote"),t.wrap(e,n)),i.push(n)}),i.reverse().reduce((e,i)=>e.nextSibling==i?(t.merge(t.createPositionAfter(e)),e):i)}}function xg(t){return"blockQuote"==t.parent.name?t.parent:null}function Ag(t,e){let i,n=0;const o=[];for(;n<e.length;){const r=e[n],s=e[n+1];i||(i=t.createPositionBefore(r)),s&&r.nextSibling==s||(o.push(t.createRange(i,t.createPositionAfter(r))),i=null),n++}return o}function Cg(t,e){const i=t.checkChild(e.parent,"blockQuote"),n=t.checkChild(["$root","blockQuote"],e);return i&&n}class Tg extends Qt{static get pluginName(){return"BlockQuoteEditing"}static get requires(){return[Eu,Iu]}init(){const t=this.editor,e=t.model.schema;t.commands.add("blockQuote",new yg(t)),e.register("blockQuote",{allowWhere:"$block",allowContentOf:"$root"}),t.conversion.elementToElement({model:"blockQuote",view:"blockquote"}),t.model.document.registerPostFixer(i=>{const n=t.model.document.differ.getChanges();for(const t of n)if("insert"==t.type){const n=t.position.nodeAfter;if(!n)continue;if(n.is("element","blockQuote")&&n.isEmpty)return i.remove(n),!0;if(n.is("element","blockQuote")&&!e.checkChild(t.position,n))return i.unwrap(n),!0;if(n.is("element")){const t=i.createRangeIn(n);for(const n of t.getItems())if(n.is("element","blockQuote")&&!e.checkChild(i.createPositionBefore(n),n))return i.unwrap(n),!0}}else if("remove"==t.type){const e=t.position.parent;if(e.is("element","blockQuote")&&e.isEmpty)return i.remove(e),!0}return!1});const i=this.editor.editing.view.document,n=t.model.document.selection,o=t.commands.get("blockQuote");this.listenTo(i,"enter",(e,i)=>{if(!n.isCollapsed||!o.value)return;n.getLastPosition().parent.isEmpty&&(t.execute("blockQuote"),t.editing.view.scrollToTheSelection(),i.preventDefault(),e.stop())},{context:"blockquote"}),this.listenTo(i,"delete",(e,i)=>{if("backward"!=i.direction||!n.isCollapsed||!o.value)return;const r=n.getLastPosition().parent;r.isEmpty&&!r.previousSibling&&(t.execute("blockQuote"),t.editing.view.scrollToTheSelection(),i.preventDefault(),e.stop())},{context:"blockquote"})}}i(68);class Eg extends Qt{static get pluginName(){return"BlockQuoteUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("blockQuote",i=>{const n=t.commands.get("blockQuote"),o=new Ad(i);return o.set({label:e("Block quote"),icon:Kc,tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(o,"execute",()=>{t.execute("blockQuote"),t.editing.view.focus()}),o})}}class Pg extends Qt{static get pluginName(){return"CKFinderUI"}init(){const t=this.editor,e=t.ui.componentFactory,i=t.t;e.add("ckfinder",e=>{const n=t.commands.get("ckfinder"),o=new Ad(e);return o.set({label:i("Insert image or file"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11.627 16.5zm5.873-.196zm0-7.001V8h-13v8.5h4.341c.191.54.457 1.044.785 1.5H2a1.5 1.5 0 0 1-1.5-1.5v-13A1.5 1.5 0 0 1 2 2h4.5a1.5 1.5 0 0 1 1.06.44L9.122 4H16a1.5 1.5 0 0 1 1.5 1.5v1A1.5 1.5 0 0 1 19 8v2.531a6.027 6.027 0 0 0-1.5-1.228zM16 6.5v-1H8.5l-2-2H2v13h1V8a1.5 1.5 0 0 1 1.5-1.5H16z"/><path d="M14.5 19.5a5 5 0 1 1 0-10 5 5 0 0 1 0 10zM15 14v-2h-1v2h-2v1h2v2h1v-2h2v-1h-2z"/></svg>',tooltip:!0}),o.bind("isEnabled").to(n),o.on("execute",()=>{t.execute("ckfinder"),t.editing.view.focus()}),o})}}class Sg extends Zt{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("insertImage"),e=this.editor.commands.get("link");this.isEnabled=t.isEnabled||e.isEnabled}execute(){const t=this.editor,e=this.editor.config.get("ckfinder.openerMethod")||"modal";if("popup"!=e&&"modal"!=e)throw new l.a("ckfinder-unknown-openermethod",t);const i=this.editor.config.get("ckfinder.options")||{};i.chooseFiles=!0;const n=i.onInit;i.language||(i.language=t.locale.uiLanguage),i.onInit=e=>{n&&n(e),e.on("files:choose",i=>{const n=i.data.files.toArray(),o=n.filter(t=>!t.isImage()),r=n.filter(t=>t.isImage());for(const e of o)t.execute("link",e.getUrl());const s=[];for(const t of r){const i=t.getUrl();s.push(i||e.request("file:getProxyUrl",{file:t}))}s.length&&Mg(t,s)}),e.on("file:choose:resizedImage",e=>{const i=e.data.resizedUrl;if(i)Mg(t,[i]);else{const e=t.plugins.get("Notification"),i=t.locale.t;e.showWarning(i("Could not obtain resized image URL."),{title:i("Selecting resized image failed"),namespace:"ckfinder"})}})},window.CKFinder[e](i)}}function Mg(t,e){if(t.commands.get("insertImage").isEnabled)t.execute("insertImage",{source:e});else{const e=t.plugins.get("Notification"),i=t.locale.t;e.showWarning(i("Could not insert image at the current position."),{title:i("Inserting image failed"),namespace:"ckfinder"})}}class Ig extends Qt{static get pluginName(){return"CKFinderEditing"}static get requires(){return[lh,"ImageEditing","LinkEditing"]}init(){const t=this.editor;t.commands.add("ckfinder",new Sg(t))}}class Lg extends Zt{refresh(){const t=this.editor.model,e=Os(t.document.selection.getSelectedBlocks());this.value=!!e&&e.is("element","paragraph"),this.isEnabled=!!e&&Ng(e,t.schema)}execute(t={}){const e=this.editor.model,i=e.document;e.change(n=>{const o=(t.selection||i.selection).getSelectedBlocks();for(const t of o)!t.is("element","paragraph")&&Ng(t,e.schema)&&n.rename(t,"paragraph")})}}function Ng(t,e){return e.checkChild(t.parent,"paragraph")&&!e.isObject(t)}class Rg extends Zt{execute(t){const e=this.editor.model;let i=t.position;e.change(t=>{const n=t.createElement("paragraph");if(!e.schema.checkChild(i.parent,n)){const o=e.schema.findAllowedParent(i,n);if(!o)return;i=t.split(i,o).position}e.insertContent(n,i),t.setSelection(n,"in")})}}class Og extends Qt{static get pluginName(){return"Paragraph"}init(){const t=this.editor,e=t.model;t.commands.add("paragraph",new Lg(t)),t.commands.add("insertParagraph",new Rg(t)),e.schema.register("paragraph",{inheritAllFrom:"$block"}),t.conversion.elementToElement({model:"paragraph",view:"p"}),t.conversion.for("upcast").elementToElement({model:(t,{writer:e})=>Og.paragraphLikeElements.has(t.name)?t.isEmpty?null:e.createElement("paragraph"):null,view:/.+/,converterPriority:"low"})}}Og.paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td","th"]);class zg extends Zt{constructor(t,e){super(t),this.modelElements=e}refresh(){const t=Os(this.editor.model.document.selection.getSelectedBlocks());this.value=!!t&&this.modelElements.includes(t.name)&&t.name,this.isEnabled=!!t&&this.modelElements.some(e=>Dg(t,e,this.editor.model.schema))}execute(t){const e=this.editor.model,i=e.document,n=t.value;e.change(t=>{const o=Array.from(i.selection.getSelectedBlocks()).filter(t=>Dg(t,n,e.schema));for(const e of o)e.is("element",n)||t.rename(e,n)})}}function Dg(t,e,i){return i.checkChild(t.parent,e)&&!i.isObject(t)}class Vg extends Qt{static get pluginName(){return"HeadingEditing"}constructor(t){super(t),t.config.define("heading",{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h2",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h3",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h4",title:"Heading 3",class:"ck-heading_heading3"}]})}static get requires(){return[Og]}init(){const t=this.editor,e=t.config.get("heading.options"),i=[];for(const n of e)"paragraph"!==n.model&&(t.model.schema.register(n.model,{inheritAllFrom:"$block"}),t.conversion.elementToElement(n),i.push(n.model));this._addDefaultH1Conversion(t),t.commands.add("heading",new zg(t,i))}afterInit(){const t=this.editor,e=t.commands.get("enter"),i=t.config.get("heading.options");e&&this.listenTo(e,"afterExecute",(e,n)=>{const o=t.model.document.selection.getFirstPosition().parent;i.some(t=>o.is("element",t.model))&&!o.is("element","paragraph")&&0===o.childCount&&n.writer.rename(o,"paragraph")})}_addDefaultH1Conversion(t){t.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:a.get("low")+1})}}i(12);class jg extends Qt{static get pluginName(){return"HeadingUI"}init(){const t=this.editor,e=t.t,i=function(t){const e=t.t,i={Paragraph:e("Paragraph"),"Heading 1":e("Heading 1"),"Heading 2":e("Heading 2"),"Heading 3":e("Heading 3"),"Heading 4":e("Heading 4"),"Heading 5":e("Heading 5"),"Heading 6":e("Heading 6")};return t.config.get("heading.options").map(t=>{const e=i[t.title];return e&&e!=t.title&&(t.title=e),t})}(t),n=e("Choose heading"),o=e("Heading");t.ui.componentFactory.add("heading",e=>{const r={},s=new Zi,a=t.commands.get("heading"),l=t.commands.get("paragraph"),c=[a];for(const t of i){const e={type:"button",model:new ch({label:t.title,class:t.class,withText:!0})};"paragraph"===t.model?(e.model.bind("isOn").to(l,"value"),e.model.set("commandName","paragraph"),c.push(l)):(e.model.bind("isOn").to(a,"value",e=>e===t.model),e.model.set({commandName:"heading",commandValue:t.model})),s.add(e),r[t.model]=t.title}const d=Qd(e);return Zd(d,s),d.buttonView.set({isOn:!1,withText:!0,tooltip:o}),d.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),d.bind("isEnabled").toMany(c,"isEnabled",(...t)=>t.some(t=>t)),d.buttonView.bind("label").to(a,"value",l,"value",(t,e)=>{const i=t||e&&"paragraph";return r[i]?r[i]:n}),this.listenTo(d,"execute",e=>{t.execute(e.source.commandName,e.source.commandValue?{value:e.source.commandValue}:void 0),t.editing.view.focus()}),d})}}class Bg extends Qt{static get requires(){return[wh]}static get pluginName(){return"WidgetToolbarRepository"}init(){const t=this.editor;if(t.plugins.has("BalloonToolbar")){const e=t.plugins.get("BalloonToolbar");this.listenTo(e,"show",e=>{(function(t){const e=t.getSelectedElement();return!(!e||!zu(e))})(t.editing.view.document.selection)&&e.stop()},{priority:"high"})}this._toolbarDefinitions=new Map,this._balloon=this.editor.plugins.get("ContextualBalloon"),this.on("change:isEnabled",()=>{this._updateToolbarsVisibility()}),this.listenTo(t.ui,"update",()=>{this._updateToolbarsVisibility()}),this.listenTo(t.ui.focusTracker,"change:isFocused",()=>{this._updateToolbarsVisibility()},{priority:"low"})}destroy(){super.destroy();for(const t of this._toolbarDefinitions.values())t.view.destroy()}register(t,{ariaLabel:e,items:i,getRelatedElement:n,balloonClassName:o="ck-toolbar-container"}){if(!i.length)return void Object(l.b)("widget-toolbar-no-items",{toolbarId:t});const r=this.editor,s=r.t,a=new Ud(r.locale);if(a.ariaLabel=e||s("Widget toolbar"),this._toolbarDefinitions.has(t))throw new l.a("widget-toolbar-duplicated",this,{toolbarId:t});a.fillFromConfig(i,r.ui.componentFactory),this._toolbarDefinitions.set(t,{view:a,getRelatedElement:n,balloonClassName:o})}_updateToolbarsVisibility(){let t=0,e=null,i=null;for(const n of this._toolbarDefinitions.values()){const o=n.getRelatedElement(this.editor.editing.view.document.selection);if(this.isEnabled&&o)if(this.editor.ui.focusTracker.isFocused){const r=o.getAncestors().length;r>t&&(t=r,e=o,i=n)}else this._isToolbarVisible(n)&&this._hideToolbar(n);else this._isToolbarInBalloon(n)&&this._hideToolbar(n)}i&&this._showToolbar(i,e)}_hideToolbar(t){this._balloon.remove(t.view),this.stopListening(this._balloon,"change:visibleView")}_showToolbar(t,e){this._isToolbarVisible(t)?Fg(this.editor,e):this._isToolbarInBalloon(t)||(this._balloon.add({view:t.view,position:Hg(this.editor,e),balloonClassName:t.balloonClassName}),this.listenTo(this._balloon,"change:visibleView",()=>{for(const t of this._toolbarDefinitions.values())if(this._isToolbarVisible(t)){const e=t.getRelatedElement(this.editor.editing.view.document.selection);Fg(this.editor,e)}}))}_isToolbarVisible(t){return this._balloon.visibleView===t.view}_isToolbarInBalloon(t){return this._balloon.hasView(t.view)}}function Fg(t,e){const i=t.plugins.get("ContextualBalloon"),n=Hg(t,e);i.updatePosition(n)}function Hg(t,e){const i=t.editing.view,n=uh.defaultPositions;return{target:i.domConverter.mapViewToDom(e),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast,Wu]}}class Ug{constructor(t){this.set("activeHandlePosition",null),this.set("proposedWidthPercents",null),this.set("proposedWidth",null),this.set("proposedHeight",null),this.set("proposedHandleHostWidth",null),this.set("proposedHandleHostHeight",null),this._options=t,this._referenceCoordinates=null}begin(t,e,i){const n=new Ps(e);this.activeHandlePosition=function(t){const e=["top-left","top-right","bottom-right","bottom-left"];for(const i of e)if(t.classList.contains("ck-widget__resizer__handle-"+i))return i}(t),this._referenceCoordinates=function(t,e){const i=new Ps(t),n=e.split("-"),o={x:"right"==n[1]?i.right:i.left,y:"bottom"==n[0]?i.bottom:i.top};return o.x+=t.ownerDocument.defaultView.scrollX,o.y+=t.ownerDocument.defaultView.scrollY,o}(e,function(t){const e=t.split("-"),i={top:"bottom",bottom:"top",left:"right",right:"left"};return`${i[e[0]]}-${i[e[1]]}`}(this.activeHandlePosition)),this.originalWidth=n.width,this.originalHeight=n.height,this.aspectRatio=n.width/n.height;const o=i.style.width;o&&o.match(/^\d+(\.\d*)?%$/)?this.originalWidthPercents=parseFloat(o):this.originalWidthPercents=function(t,e){const i=t.parentElement,n=parseFloat(i.ownerDocument.defaultView.getComputedStyle(i).width);return e.width/n*100}(i,n)}update(t){this.proposedWidth=t.width,this.proposedHeight=t.height,this.proposedWidthPercents=t.widthPercents,this.proposedHandleHostWidth=t.handleHostWidth,this.proposedHandleHostHeight=t.handleHostHeight}}Kt(Ug,Ut);class qg{constructor(t){this._options=t,this._domResizerWrapper=null,this._viewResizerWrapper=null,this.set("isEnabled",!0),this.decorate("begin"),this.decorate("cancel"),this.decorate("commit"),this.decorate("updateSize"),this.on("commit",t=>{this.state.proposedWidth||this.state.proposedWidthPercents||(this._cleanup(),t.stop())},{priority:"high"}),this.on("change:isEnabled",()=>{this.isEnabled&&this.redraw()})}attach(){const t=this,e=this._options.viewElement;this._options.editor.editing.view.change(i=>{const n=i.createUIElement("div",{class:"ck ck-reset_all ck-widget__resizer"},(function(e){const i=this.toDomElement(e);return t._appendHandles(i),t._appendSizeUI(i),t._domResizerWrapper=i,t.on("change:isEnabled",(t,e,n)=>{i.style.display=n?"":"none"}),i.style.display=t.isEnabled?"":"none",i}));i.insert(i.createPositionAt(e,"end"),n),i.addClass("ck-widget_with-resizer",e),this._viewResizerWrapper=n})}begin(t){this.state=new Ug(this._options),this._sizeUI.bindToState(this._options,this.state),this._initialViewWidth=this._options.viewElement.getStyle("width"),this.state.begin(t,this._getHandleHost(),this._getResizeHost())}updateSize(t){const e=this._proposeNewSize(t);this._options.editor.editing.view.change(t=>{const i=this._options.unit||"%",n=("%"===i?e.widthPercents:e.width)+i;t.setStyle("width",n,this._options.viewElement)});const i=this._getHandleHost(),n=new Ps(i);e.handleHostWidth=Math.round(n.width),e.handleHostHeight=Math.round(n.height);const o=new Ps(i);e.width=Math.round(o.width),e.height=Math.round(o.height),this.redraw(n),this.state.update(e)}commit(){const t=this._options.unit||"%",e=("%"===t?this.state.proposedWidthPercents:this.state.proposedWidth)+t;this._options.editor.editing.view.change(()=>{this._cleanup(),this._options.onCommit(e)})}cancel(){this._cleanup()}destroy(){this.cancel()}redraw(t){const e=this._domResizerWrapper;if(!((i=e)&&i.ownerDocument&&i.ownerDocument.contains(i)))return;var i;const n=e.parentElement,o=this._getHandleHost(),r=this._viewResizerWrapper,s=[r.getStyle("width"),r.getStyle("height"),r.getStyle("left"),r.getStyle("top")];let a;if(n.isSameNode(o)){const e=t||new Ps(o);a=[e.width+"px",e.height+"px",void 0,void 0]}else a=[o.offsetWidth+"px",o.offsetHeight+"px",o.offsetLeft+"px",o.offsetTop+"px"];"same"!==ln(s,a)&&this._options.editor.editing.view.change(t=>{t.setStyle({width:a[0],height:a[1],left:a[2],top:a[3]},r)})}containsHandle(t){return this._domResizerWrapper.contains(t)}static isResizeHandle(t){return t.classList.contains("ck-widget__resizer__handle")}_cleanup(){this._sizeUI.dismiss(),this._sizeUI.isVisible=!1;this._options.editor.editing.view.change(t=>{t.setStyle("width",this._initialViewWidth,this._options.viewElement)})}_proposeNewSize(t){const e=this.state,i={x:(n=t).pageX,y:n.pageY};var n;const o=!this._options.isCentered||this._options.isCentered(this),r={x:e._referenceCoordinates.x-(i.x+e.originalWidth),y:i.y-e.originalHeight-e._referenceCoordinates.y};o&&e.activeHandlePosition.endsWith("-right")&&(r.x=i.x-(e._referenceCoordinates.x+e.originalWidth)),o&&(r.x*=2);const s={width:Math.abs(e.originalWidth+r.x),height:Math.abs(e.originalHeight+r.y)};s.dominant=s.width/e.aspectRatio>s.height?"width":"height",s.max=s[s.dominant];const a={width:s.width,height:s.height};return"width"==s.dominant?a.height=a.width/e.aspectRatio:a.width=a.height*e.aspectRatio,{width:Math.round(a.width),height:Math.round(a.height),widthPercents:Math.min(Math.round(e.originalWidthPercents/e.originalWidth*a.width*100)/100,100)}}_getResizeHost(){const t=this._domResizerWrapper.parentElement;return this._options.getResizeHost(t)}_getHandleHost(){const t=this._domResizerWrapper.parentElement;return this._options.getHandleHost(t)}_appendHandles(t){const e=["top-left","top-right","bottom-right","bottom-left"];for(const n of e)t.appendChild(new id({tag:"div",attributes:{class:"ck-widget__resizer__handle "+(i=n,"ck-widget__resizer__handle-"+i)}}).render());var i}_appendSizeUI(t){const e=new Wg;e.render(),this._sizeUI=e,t.appendChild(e.element)}}Kt(qg,Ut);class Wg extends ed{constructor(){super();const t=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-size-view",t.to("activeHandlePosition",t=>t?"ck-orientation-"+t:"")],style:{display:t.if("isVisible","none",t=>!t)}},children:[{text:t.to("label")}]})}bindToState(t,e){this.bind("isVisible").to(e,"proposedWidth",e,"proposedHeight",(t,e)=>null!==t&&null!==e),this.bind("label").to(e,"proposedHandleHostWidth",e,"proposedHandleHostHeight",e,"proposedWidthPercents",(e,i,n)=>"px"===t.unit?`${e}×${i}`:n+"%"),this.bind("activeHandlePosition").to(e)}dismiss(){this.unbind(),this.isVisible=!1}}i(71);class $g extends Qt{static get pluginName(){return"WidgetResize"}init(){this.set("visibleResizer",null),this.set("_activeResizer",null),this._resizers=new Map;const t=_r.window.document;this.editor.model.schema.setAttributeProperties("width",{isFormatting:!0}),this.editor.editing.view.addObserver(qh),this._observer=Object.create(Ir),this.listenTo(this.editor.editing.view.document,"mousedown",this._mouseDownListener.bind(this),{priority:"high"}),this._observer.listenTo(t,"mousemove",this._mouseMoveListener.bind(this)),this._observer.listenTo(t,"mouseup",this._mouseUpListener.bind(this));const e=()=>{this.visibleResizer&&this.visibleResizer.redraw()};this._redrawFocusedResizerThrottled=rm(e,200),this.on("change:visibleResizer",e),this.editor.ui.on("update",this._redrawFocusedResizerThrottled),this._observer.listenTo(_r.window,"resize",this._redrawFocusedResizerThrottled);const i=this.editor.editing.view.document.selection;i.on("change",()=>{const t=i.getSelectedElement();this.visibleResizer=this.getResizerByViewElement(t)||null})}destroy(){this._observer.stopListening();for(const t of this._resizers.values())t.destroy();this._redrawFocusedResizerThrottled.cancel()}attachTo(t){const e=new qg(t),i=this.editor.plugins;if(e.attach(),i.has("WidgetToolbarRepository")){const t=i.get("WidgetToolbarRepository");e.on("begin",()=>{t.forceDisabled("resize")},{priority:"lowest"}),e.on("cancel",()=>{t.clearForceDisabled("resize")},{priority:"highest"}),e.on("commit",()=>{t.clearForceDisabled("resize")},{priority:"highest"})}this._resizers.set(t.viewElement,e);const n=this.editor.editing.view.document.selection.getSelectedElement();return this.getResizerByViewElement(n)==e&&(this.visibleResizer=e),e}getResizerByViewElement(t){return this._resizers.get(t)}_getResizerByHandle(t){for(const e of this._resizers.values())if(e.containsHandle(t))return e}_mouseDownListener(t,e){const i=e.domTarget;qg.isResizeHandle(i)&&(this._activeResizer=this._getResizerByHandle(i),this._activeResizer&&(this._activeResizer.begin(i),t.stop(),e.preventDefault()))}_mouseMoveListener(t,e){this._activeResizer&&this._activeResizer.updateSize(e)}_mouseUpListener(){this._activeResizer&&(this._activeResizer.commit(),this._activeResizer=null)}}Kt($g,Ut);class Gg extends Zt{refresh(){this.isEnabled=function(t){const e=t.schema,i=t.document.selection;return function(t,e,i){const n=function(t,e){const i=Uu(t,e).parent;if(i.isEmpty&&!i.is("element","$root"))return i.parent;return i}(t,i);return e.checkChild(n,"rawHtml")}(i,e,t)&&!qu(i,e)}(this.editor.model)}execute(){const t=this.editor.model;t.change(e=>{const i=e.createElement("rawHtml");t.insertContent(i),e.setSelection(i,"on")})}}class Yg extends Zt{refresh(){const t=Kg(this.editor.model.document.selection);this.isEnabled=!!t}execute(t){const e=this.editor.model,i=Kg(e.document.selection);e.change(e=>{e.setAttribute("value",t,i)})}}function Kg(t){const e=t.getSelectedElement();return e&&e.is("element","rawHtml")?e:null}i(73);class Qg extends Qt{static get pluginName(){return"HtmlEmbedEditing"}constructor(t){super(t),t.config.define("htmlEmbed",{showPreviews:!1,sanitizeHtml:t=>(Object(l.b)("html-embed-provide-sanitize-function"),{html:t,hasChanged:!1})})}init(){const t=this.editor;t.model.schema.register("rawHtml",{isObject:!0,allowWhere:"$block",allowAttributes:["value"]}),t.commands.add("updateHtmlEmbed",new Yg(t)),t.commands.add("insertHtmlEmbed",new Gg(t)),this._setupConversion()}_setupConversion(){const t=this.editor,e=t.t,i=t.editing.view,n=t.config.get("htmlEmbed");function o({domElement:t,editor:i,state:n,props:o}){t.textContent="";const s=t.ownerDocument;let a;if(n.isEditable){const e={isDisabled:!1,placeholder:o.textareaPlaceholder};a=r({domDocument:s,state:n,props:e}),t.append(a)}else if(n.showPreviews){const r={sanitizeHtml:o.sanitizeHtml};t.append(function({domDocument:t,state:i,props:n,editor:o}){const r=n.sanitizeHtml(i.getRawHtmlValue()),s=i.getRawHtmlValue().length>0?e("No preview available"):e("Empty snippet content"),a=xs(t,"div",{class:"ck ck-reset_all raw-html-embed__preview-placeholder"},s),l=xs(t,"div",{class:"raw-html-embed__preview-content",dir:o.locale.contentLanguageDirection}),c=t.createRange().createContextualFragment(r.html);l.appendChild(c);return xs(t,"div",{class:"raw-html-embed__preview"},[a,l])}({domDocument:s,state:n,props:r,editor:i}))}else{const e={isDisabled:!0,placeholder:o.textareaPlaceholder};t.append(r({domDocument:s,state:n,props:e}))}const l={onEditClick:o.onEditClick,onSaveClick:()=>{o.onSaveClick(a.value)},onCancelClick:o.onCancelClick};t.prepend(function({editor:t,domDocument:e,state:i,props:n}){const o=xs(e,"div",{class:"raw-html-embed__buttons-wrapper"}),r=Jg(t,"edit"),s=Jg(t,"save"),a=Jg(t,"cancel");if(i.isEditable){const t=s.cloneNode(!0),e=a.cloneNode(!0);t.addEventListener("click",t=>{t.preventDefault(),n.onSaveClick()}),e.addEventListener("click",t=>{t.preventDefault(),n.onCancelClick()}),o.appendChild(t),o.appendChild(e)}else{const t=r.cloneNode(!0);t.addEventListener("click",t=>{t.preventDefault(),n.onEditClick()}),o.appendChild(t)}return o}({editor:i,domDocument:s,state:n,props:l}))}function r({domDocument:t,state:e,props:i}){const n=xs(t,"textarea",{placeholder:i.placeholder,class:"ck ck-reset ck-input ck-input-text raw-html-embed__source"});return n.disabled=i.isDisabled,n.value=e.getRawHtmlValue(),n}t.data.registerRawContentMatcher({name:"div",classes:"raw-html-embed"}),t.conversion.for("upcast").elementToElement({view:{name:"div",classes:"raw-html-embed"},model:(t,{writer:e})=>e.createElement("rawHtml",{value:t.getCustomProperty("$rawContent")})}),t.conversion.for("dataDowncast").elementToElement({model:"rawHtml",view:(t,{writer:e})=>e.createRawElement("div",{class:"raw-html-embed"},(function(e){e.innerHTML=t.getAttribute("value")||""}))}),t.conversion.for("editingDowncast").elementToElement({triggerBy:{attributes:["value"]},model:"rawHtml",view:(r,{writer:s})=>{let a,l,c;const d=s.createContainerElement("div",{class:"raw-html-embed","data-html-embed-label":e("HTML snippet"),dir:t.locale.uiLanguageDirection}),h=s.createRawElement("div",{class:"raw-html-embed__content-wrapper"},(function(e){a=e,o({domElement:e,editor:t,state:l,props:c}),a.addEventListener("mousedown",()=>{if(l.isEditable){const e=t.model;e.document.selection.getSelectedElement()!==r&&e.change(t=>t.setSelection(r,"on"))}},!0)})),u={makeEditable(){l=Object.assign({},l,{isEditable:!0}),o({domElement:a,editor:t,state:l,props:c}),i.change(t=>{t.setAttribute("data-cke-ignore-events","true",h)}),a.querySelector("textarea").focus()},save(e){e!==l.getRawHtmlValue()?(t.execute("updateHtmlEmbed",e),t.editing.view.focus()):this.cancel()},cancel(){l=Object.assign({},l,{isEditable:!1}),o({domElement:a,editor:t,state:l,props:c}),t.editing.view.focus(),i.change(t=>{t.removeAttribute("data-cke-ignore-events",h)})}};return l={showPreviews:n.showPreviews,isEditable:!1,getRawHtmlValue:()=>r.getAttribute("value")||""},c={sanitizeHtml:n.sanitizeHtml,textareaPlaceholder:e("Paste raw HTML here..."),onEditClick(){u.makeEditable()},onSaveClick(t){u.save(t)},onCancelClick(){u.cancel()}},s.insert(s.createPositionAt(d,0),h),s.setCustomProperty("rawHtmlApi",u,d),s.setCustomProperty("rawHtml",!0,d),Du(d,s,{widgetLabel:e("HTML snippet"),hasSelectionHandle:!0})}})}}function Jg(t,e){const i=t.locale.t,n=new Ad(t.locale),o=t.commands.get("updateHtmlEmbed");return n.set({tooltipPosition:"rtl"===t.locale.uiLanguageDirection?"e":"w",icon:Yc,tooltip:!0}),n.render(),"edit"===e?n.set({icon:Yc,label:i("Edit source"),class:"raw-html-embed__edit-button"}):"save"===e?(n.set({icon:Lc,label:i("Save changes"),class:"raw-html-embed__save-button"}),n.bind("isEnabled").to(o,"isEnabled")):n.set({icon:Ic,label:i("Cancel"),class:"raw-html-embed__cancel-button"}),n.destroy(),n.element.cloneNode(!0)}class Zg extends Qt{static get pluginName(){return"HtmlEmbedUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("htmlEmbed",i=>{const n=t.commands.get("insertHtmlEmbed"),o=new Ad(i);return o.set({label:e("Insert HTML"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M17 0a2 2 0 0 1 2 2v7a1 1 0 0 1 1 1v5a1 1 0 0 1-.883.993l-.118.006L19 17a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2l-.001-1.001-.116-.006A1 1 0 0 1 0 15v-5a1 1 0 0 1 .999-1L1 2a2 2 0 0 1 2-2h14zm.499 15.999h-15L2.5 17a.5.5 0 0 0 .5.5h14a.5.5 0 0 0 .5-.5l-.001-1.001zm-3.478-6.013-.014.014H14v.007l-1.525 1.525-1.46-1.46-.015.013V10h-1v5h1v-3.53l1.428 1.43.048.043.131-.129L14 11.421V15h1v-5h-.965l-.014-.014zM2 10H1v5h1v-2h2v2h1v-5H4v2H2v-2zm7 0H6v1h1v4h1v-4h1v-1zm8 0h-1v5h3v-1h-2v-4zm0-8.5H3a.5.5 0 0 0-.5.5l-.001 6.999h15L17.5 2a.5.5 0 0 0-.5-.5zM10 7v1H4V7h6zm3-2v1H4V5h9zm-3-2v1H4V3h6z"/></svg>',tooltip:!0}),o.bind("isEnabled").to(n,"isEnabled"),this.listenTo(o,"execute",()=>{t.execute("insertHtmlEmbed"),t.editing.view.focus();t.editing.view.document.selection.getSelectedElement().getCustomProperty("rawHtmlApi").makeEditable()}),o})}}class Xg extends Rr{observe(t){this.listenTo(t,"load",(t,e)=>{const i=e.target;this.checkShouldIgnoreEventFromTarget(i)||"IMG"==i.tagName&&this._fireEvents(e)},{useCapture:!0})}_fireEvents(t){this.isEnabled&&(this.document.fire("layoutChanged"),this.document.fire("imageLoaded",t))}}function tf(t){return!!t.getCustomProperty("image")&&zu(t)}function ef(t){const e=t.getSelectedElement();return e&&tf(e)?e:null}function nf(t){return!!t&&t.is("element","image")}function of(t,e={},i=null){t.change(n=>{const o=n.createElement("image",e),r=i||Uu(t.document.selection,t);t.insertContent(o,r),o.parent&&n.setSelection(o,"on")})}function rf(t){const e=t.schema,i=t.document.selection;return function(t,e,i){const n=function(t,e){const i=Uu(t,e).parent;if(i.isEmpty&&!i.is("element","$root"))return i.parent;return i}(t,i);return e.checkChild(n,"image")}(i,e,t)&&!qu(i,e)&&function(t){return[...t.focus.getAncestors()].every(t=>!t.is("element","image"))}(i)}function sf(t){const e=[];for(const i of t.getChildren())e.push(i),i.is("element")&&e.push(...i.getChildren());return e.find(t=>t.is("element","img"))}function af(t){return i=>{i.on(`attribute:${t}:image`,e)};function e(t,e,i){if(!i.consumable.consume(e.item,t.name))return;const n=i.writer,o=sf(i.mapper.toViewElement(e.item));n.setAttribute(e.attributeKey,e.attributeNewValue||"",o)}}class lf extends Zt{refresh(){this.isEnabled=rf(this.editor.model)}execute(t){const e=this.editor.model;for(const i of tn(t.source))of(e,{src:i})}}class cf extends Qt{static get pluginName(){return"ImageEditing"}init(){const t=this.editor,e=t.model.schema,i=t.t,n=t.conversion;t.editing.view.addObserver(Xg),e.register("image",{isObject:!0,isBlock:!0,allowWhere:"$block",allowAttributes:["alt","src","srcset"]}),n.for("dataDowncast").elementToElement({model:"image",view:(t,{writer:e})=>df(e)}),n.for("editingDowncast").elementToElement({model:"image",view:(t,{writer:e})=>function(t,e,i){return e.setCustomProperty("image",!0,t),Du(t,e,{label:function(){const e=sf(t).getAttribute("alt");return e?`${e} ${i}`:i}})}(df(e),e,i("image widget"))}),n.for("downcast").add(af("src")).add(af("alt")).add(function(){return e=>{e.on("attribute:srcset:image",t)};function t(t,e,i){if(!i.consumable.consume(e.item,t.name))return;const n=i.writer,o=sf(i.mapper.toViewElement(e.item));if(null===e.attributeNewValue){const t=e.attributeOldValue;t.data&&(n.removeAttribute("srcset",o),n.removeAttribute("sizes",o),t.width&&n.removeAttribute("width",o))}else{const t=e.attributeNewValue;t.data&&(n.setAttribute("srcset",t.data,o),n.setAttribute("sizes","100vw",o),t.width&&n.setAttribute("width",t.width,o))}}}()),n.for("upcast").elementToElement({view:{name:"img",attributes:{src:!0}},model:(t,{writer:e})=>e.createElement("image",{src:t.getAttribute("src")})}).attributeToAttribute({view:{name:"img",key:"alt"},model:"alt"}).attributeToAttribute({view:{name:"img",key:"srcset"},model:{key:"srcset",value:t=>{const e={data:t.getAttribute("srcset")};return t.hasAttribute("width")&&(e.width=t.getAttribute("width")),e}}}).add(function(){return e=>{e.on("element:figure",t)};function t(t,e,i){if(!i.consumable.test(e.viewItem,{name:!0,classes:"image"}))return;const n=sf(e.viewItem);if(!n||!n.hasAttribute("src")||!i.consumable.test(n,{name:!0}))return;const o=Os(i.convertItem(n,e.modelCursor).modelRange.getItems());o&&(i.convertChildren(e.viewItem,o),i.updateConversionResult(o,e))}}());const o=new lf(t);t.commands.add("insertImage",o),t.commands.add("imageInsert",o)}}function df(t){const e=t.createEmptyElement("img"),i=t.createContainerElement("figure",{class:"image"});return t.insert(t.createPositionAt(i,0),e),i}class hf extends Zt{refresh(){const t=this.editor.model.document.selection.getSelectedElement();this.isEnabled=nf(t),nf(t)&&t.hasAttribute("alt")?this.value=t.getAttribute("alt"):this.value=!1}execute(t){const e=this.editor.model,i=e.document.selection.getSelectedElement();e.change(e=>{e.setAttribute("alt",t.newValue,i)})}}class uf extends Qt{static get pluginName(){return"ImageTextAlternativeEditing"}init(){this.editor.commands.add("imageTextAlternative",new hf(this.editor))}}i(75),i(7);class mf extends ed{constructor(t){super(t);const e=this.locale.t;this.focusTracker=new zs,this.keystrokes=new Ds,this.labeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(e("Save"),Lc,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(e("Cancel"),Ic,"ck-button-cancel","cancel"),this._focusables=new td,this._focusCycler=new Pd({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-text-alternative-form","ck-responsive-form"],tabindex:"-1"},children:[this.labeledInput,this.saveButtonView,this.cancelButtonView]}),Zc(this)}render(){super.render(),this.keystrokes.listenTo(this.element),Xc({view:this}),[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element)})}_createButton(t,e,i,n){const o=new Ad(this.locale);return o.set({label:t,icon:e,tooltip:!0}),o.extendTemplate({attributes:{class:i}}),n&&o.delegate("execute").to(this,n),o}_createLabeledInputView(){const t=this.locale.t,e=new sh(this.locale,ah);return e.label=t("Text alternative"),e}}function gf(t){const e=t.editing.view,i=uh.defaultPositions;return{target:e.domConverter.viewToDom(e.document.selection.getSelectedElement()),positions:[i.northArrowSouth,i.northArrowSouthWest,i.northArrowSouthEast,i.southArrowNorth,i.southArrowNorthWest,i.southArrowNorthEast]}}class ff extends Qt{static get requires(){return[wh]}static get pluginName(){return"ImageTextAlternativeUI"}init(){this._createButton(),this._createForm()}destroy(){super.destroy(),this._form.destroy()}_createButton(){const t=this.editor,e=t.t;t.ui.componentFactory.add("imageTextAlternative",i=>{const n=t.commands.get("imageTextAlternative"),o=new Ad(i);return o.set({label:e("Change image text alternative"),icon:Rc,tooltip:!0}),o.bind("isEnabled").to(n,"isEnabled"),this.listenTo(o,"execute",()=>{this._showForm()}),o})}_createForm(){const t=this.editor,e=t.editing.view.document;this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new mf(t.locale),this._form.render(),this.listenTo(this._form,"submit",()=>{t.execute("imageTextAlternative",{newValue:this._form.labeledInput.fieldView.element.value}),this._hideForm(!0)}),this.listenTo(this._form,"cancel",()=>{this._hideForm(!0)}),this._form.keystrokes.set("Esc",(t,e)=>{this._hideForm(!0),e()}),this.listenTo(t.ui,"update",()=>{ef(e.selection)?this._isVisible&&function(t){const e=t.plugins.get("ContextualBalloon");if(ef(t.editing.view.document.selection)){const i=gf(t);e.updatePosition(i)}}(t):this._hideForm(!0)}),Jc({emitter:this._form,activator:()=>this._isVisible,contextElements:[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible)return;const t=this.editor,e=t.commands.get("imageTextAlternative"),i=this._form.labeledInput;this._form.disableCssTransitions(),this._isInBalloon||this._balloon.add({view:this._form,position:gf(t)}),i.fieldView.value=i.fieldView.element.value=e.value||"",this._form.labeledInput.fieldView.select(),this._form.enableCssTransitions()}_hideForm(t){this._isInBalloon&&(this._form.focusTracker.isFocused&&this._form.saveButtonView.focus(),this._balloon.remove(this._form),t&&this.editor.editing.view.focus())}get _isVisible(){return this._balloon.visibleView===this._form}get _isInBalloon(){return this._balloon.hasView(this._form)}}class pf extends Qt{static get requires(){return[uf,ff]}static get pluginName(){return"ImageTextAlternative"}}i(78);function wf(t){for(const e of t.getChildren())if(e&&e.is("element","caption"))return e;return null}function bf(t){const e=t.parent;return"figcaption"==t.name&&e&&"figure"==e.name&&e.hasClass("image")?{name:!0}:null}class kf extends Qt{static get pluginName(){return"ImageCaptionEditing"}init(){const t=this.editor,e=t.editing.view,i=t.model.schema,n=t.data,o=t.editing,r=t.t;i.isRegistered("caption")?i.extend("caption",{allowIn:"image"}):i.register("caption",{allowIn:"image",allowContentOf:"$block",isLimit:!0}),t.model.document.registerPostFixer(t=>this._insertMissingModelCaptionElement(t)),t.conversion.for("upcast").elementToElement({view:bf,model:"caption"});n.downcastDispatcher.on("insert:caption",_f(t=>t.createContainerElement("figcaption"),!1));const s=function(t,e){return i=>{const n=i.createEditableElement("figcaption");return i.setCustomProperty("imageCaption",!0,n),Eh({view:t,element:n,text:e}),Hu(n,i)}}(e,r("Enter image caption"));o.downcastDispatcher.on("insert:caption",_f(s)),o.downcastDispatcher.on("insert",this._fixCaptionVisibility(t=>t.item),{priority:"high"}),o.downcastDispatcher.on("remove",this._fixCaptionVisibility(t=>t.position.parent),{priority:"high"}),e.document.registerPostFixer(t=>this._updateCaptionVisibility(t))}_updateCaptionVisibility(t){const e=this.editor.editing.mapper,i=this._lastSelectedCaption;let n;const o=this.editor.model.document.selection,r=o.getSelectedElement();if(r&&r.is("element","image")){const t=wf(r);n=e.toViewElement(t)}const s=vf(o.getFirstPosition().parent);if(s&&(n=e.toViewElement(s)),n&&!this.editor.isReadOnly)return i?(i===n||(yf(i,t),this._lastSelectedCaption=n),xf(n,t)):(this._lastSelectedCaption=n,xf(n,t));if(i){const e=yf(i,t);return this._lastSelectedCaption=null,e}return!1}_fixCaptionVisibility(t){return(e,i,n)=>{const o=vf(t(i)),r=this.editor.editing.mapper,s=n.writer;if(o){const t=r.toViewElement(o);t&&(o.childCount?s.removeClass("ck-hidden",t):s.addClass("ck-hidden",t))}}}_insertMissingModelCaptionElement(t){const e=this.editor.model,i=e.document.differ.getChanges(),n=[];for(const t of i)if("insert"==t.type&&"$text"!=t.name){const i=t.position.nodeAfter;if(i.is("element","image")&&!wf(i)&&n.push(i),!i.is("element","image")&&i.childCount)for(const t of e.createRangeIn(i).getItems())t.is("element","image")&&!wf(t)&&n.push(t)}for(const e of n)t.appendElement("caption",e);return!!n.length}}function _f(t,e=!0){return(i,n,o)=>{const r=n.item;if((r.childCount||e)&&nf(r.parent)){if(!o.consumable.consume(n.item,"insert"))return;const e=o.mapper.toViewElement(n.range.start.parent),i=t(o.writer),s=o.writer;r.childCount||s.addClass("ck-hidden",i),function(t,e,i,n){const o=n.writer.createPositionAt(i,"end");n.writer.insert(o,t),n.mapper.bindElements(e,t)}(i,n.item,e,o)}}}function vf(t){const e=t.getAncestors({includeSelf:!0}).find(t=>"caption"==t.name);return e&&e.parent&&"image"==e.parent.name?e:null}function yf(t,e){return!t.childCount&&!t.hasClass("ck-hidden")&&(e.addClass("ck-hidden",t),!0)}function xf(t,e){return!!t.hasClass("ck-hidden")&&(e.removeClass("ck-hidden",t),!0)}i(80);class Af extends Zt{constructor(t,e){super(t),this.defaultStyle=!1,this.styles=e.reduce((t,e)=>(t[e.name]=e,e.isDefault&&(this.defaultStyle=e.name),t),{})}refresh(){const t=this.editor.model.document.selection.getSelectedElement();if(this.isEnabled=nf(t),t)if(t.hasAttribute("imageStyle")){const e=t.getAttribute("imageStyle");this.value=!!this.styles[e]&&e}else this.value=this.defaultStyle;else this.value=!1}execute(t){const e=t.value,i=this.editor.model,n=i.document.selection.getSelectedElement();i.change(t=>{this.styles[e].isDefault?t.removeAttribute("imageStyle",n):t.setAttribute("imageStyle",e,n)})}}function Cf(t,e){for(const i of e)if(i.name===t)return i}const Tf={full:{name:"full",title:"Full size image",icon:Uc,isDefault:!0},side:{name:"side",title:"Side image",icon:Hc,className:"image-style-side"},alignLeft:{name:"alignLeft",title:"Left aligned image",icon:Bc,className:"image-style-align-left"},alignCenter:{name:"alignCenter",title:"Centered image",icon:Fc,className:"image-style-align-center"},alignRight:{name:"alignRight",title:"Right aligned image",icon:Hc,className:"image-style-align-right"}},Ef={full:Uc,left:Bc,right:Hc,center:Fc};function Pf(t=[]){return t.map(Sf)}function Sf(t){if("string"==typeof t){const e=t;Tf[e]?t=Object.assign({},Tf[e]):(Object(l.b)("image-style-not-found",{name:e}),t={name:e})}else if(Tf[t.name]){const e=Tf[t.name],i=Object.assign({},t);for(const n in e)Object.prototype.hasOwnProperty.call(t,n)||(i[n]=e[n]);t=i}return"string"==typeof t.icon&&Ef[t.icon]&&(t.icon=Ef[t.icon]),t}class Mf extends Qt{static get pluginName(){return"ImageStyleEditing"}init(){const t=this.editor,e=t.model.schema,i=t.data,n=t.editing;t.config.define("image.styles",["full","side"]);const o=Pf(t.config.get("image.styles"));e.extend("image",{allowAttributes:"imageStyle"});const r=function(t){return(e,i,n)=>{if(!n.consumable.consume(i.item,e.name))return;const o=Cf(i.attributeNewValue,t),r=Cf(i.attributeOldValue,t),s=n.mapper.toViewElement(i.item),a=n.writer;r&&a.removeClass(r.className,s),o&&a.addClass(o.className,s)}}(o);n.downcastDispatcher.on("attribute:imageStyle:image",r),i.downcastDispatcher.on("attribute:imageStyle:image",r),i.upcastDispatcher.on("element:figure",function(t){const e=t.filter(t=>!t.isDefault);return(t,i,n)=>{if(!i.modelRange)return;const o=i.viewItem,r=Os(i.modelRange.getItems());if(!r||n.schema.checkAttribute(r,"imageStyle"))for(const t of e)n.consumable.consume(o,{classes:t.className})&&n.writer.setAttribute("imageStyle",t.name,r)}}(o),{priority:"low"}),t.commands.add("imageStyle",new Af(t,o))}}i(82);class If extends Qt{static get pluginName(){return"ImageStyleUI"}get localizedDefaultStylesTitles(){const t=this.editor.t;return{"Full size image":t("Full size image"),"Side image":t("Side image"),"Left aligned image":t("Left aligned image"),"Centered image":t("Centered image"),"Right aligned image":t("Right aligned image")}}init(){const t=function(t,e){for(const i of t)e[i.title]&&(i.title=e[i.title]);return t}(Pf(this.editor.config.get("image.styles")),this.localizedDefaultStylesTitles);for(const e of t)this._createButton(e)}_createButton(t){const e=this.editor,i="imageStyle:"+t.name;e.ui.componentFactory.add(i,i=>{const n=e.commands.get("imageStyle"),o=new Ad(i);return o.set({label:t.title,icon:t.icon,tooltip:!0,isToggleable:!0}),o.bind("isEnabled").to(n,"isEnabled"),o.bind("isOn").to(n,"value",e=>e===t.name),this.listenTo(o,"execute",()=>{e.execute("imageStyle",{value:t.name}),e.editing.view.focus()}),o})}}function Lf(t){const e=t.map(t=>t.replace("+","\\+"));return new RegExp(`^image\\/(${e.join("|")})$`)}function Nf(t){return new Promise((e,i)=>{const n=t.getAttribute("src");fetch(n).then(t=>t.blob()).then(t=>{const i=Rf(t,n),o=i.replace("image/",""),r=new File([t],"image."+o,{type:i});e(r)}).catch(t=>t&&"TypeError"===t.name?function(t){return function(t){return new Promise((e,i)=>{const n=_r.document.createElement("img");n.addEventListener("load",()=>{const t=_r.document.createElement("canvas");t.width=n.width,t.height=n.height;t.getContext("2d").drawImage(n,0,0),t.toBlob(t=>t?e(t):i())}),n.addEventListener("error",()=>i()),n.src=t})}(t).then(e=>{const i=Rf(e,t),n=i.replace("image/","");return new File([e],"image."+n,{type:i})})}(n).then(e).catch(i):i(t))})}function Rf(t,e){return t.type?t.type:e.match(/data:(image\/\w+);base64/)?e.match(/data:(image\/\w+);base64/)[1].toLowerCase():"image/jpeg"}class Of extends Qt{static get pluginName(){return"ImageUploadUI"}init(){const t=this.editor,e=t.t,i=i=>{const n=new cg(i),o=t.commands.get("uploadImage"),r=t.config.get("image.upload.types"),s=Lf(r);return n.set({acceptedType:r.map(t=>"image/"+t).join(","),allowMultipleFiles:!0}),n.buttonView.set({label:e("Insert image"),icon:Oc,tooltip:!0}),n.buttonView.bind("isEnabled").to(o),n.on("done",(e,i)=>{const n=Array.from(i).filter(t=>s.test(t.type));n.length&&t.execute("uploadImage",{file:n})}),n};t.ui.componentFactory.add("uploadImage",i),t.ui.componentFactory.add("imageUpload",i)}}i(84),i(86),i(88);class zf extends Qt{static get pluginName(){return"ImageUploadProgress"}constructor(t){super(t),this.placeholder="data:image/svg+xml;utf8,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 250"><rect rx="4"/></svg>')}init(){this.editor.editing.downcastDispatcher.on("attribute:uploadStatus:image",(...t)=>this.uploadStatusChange(...t))}uploadStatusChange(t,e,i){const n=this.editor,o=e.item,r=o.getAttribute("uploadId");if(!i.consumable.consume(e.item,t.name))return;const s=n.plugins.get(ag),a=r?e.attributeNewValue:null,l=this.placeholder,c=n.editing.mapper.toViewElement(o),d=i.writer;if("reading"==a)return Df(c,d),void Vf(l,c,d);if("uploading"==a){const t=s.loaders.get(r);return Df(c,d),void(t?(jf(c,d),function(t,e,i,n){const o=function(t){const e=t.createUIElement("div",{class:"ck-progress-bar"});return t.setCustomProperty("progressBar",!0,e),e}(e);e.insert(e.createPositionAt(t,"end"),o),i.on("change:uploadedPercent",(t,e,i)=>{n.change(t=>{t.setStyle("width",i+"%",o)})})}(c,d,t,n.editing.view),function(t,e,i){if(i.data){const n=sf(t);e.setAttribute("src",i.data,n)}}(c,d,t)):Vf(l,c,d))}"complete"==a&&s.loaders.get(r)&&function(t,e,i){const n=e.createUIElement("div",{class:"ck-image-upload-complete-icon"});e.insert(e.createPositionAt(t,"end"),n),setTimeout(()=>{i.change(t=>t.remove(t.createRangeOn(n)))},3e3)}(c,d,n.editing.view),function(t,e){Ff(t,e,"progressBar")}(c,d),jf(c,d),function(t,e){e.removeClass("ck-appear",t)}(c,d)}}function Df(t,e){t.hasClass("ck-appear")||e.addClass("ck-appear",t)}function Vf(t,e,i){e.hasClass("ck-image-upload-placeholder")||i.addClass("ck-image-upload-placeholder",e);const n=sf(e);n.getAttribute("src")!==t&&i.setAttribute("src",t,n),Bf(e,"placeholder")||i.insert(i.createPositionAfter(n),function(t){const e=t.createUIElement("div",{class:"ck-upload-placeholder-loader"});return t.setCustomProperty("placeholder",!0,e),e}(i))}function jf(t,e){t.hasClass("ck-image-upload-placeholder")&&e.removeClass("ck-image-upload-placeholder",t),Ff(t,e,"placeholder")}function Bf(t,e){for(const i of t.getChildren())if(i.getCustomProperty(e))return i}function Ff(t,e,i){const n=Bf(t,i);n&&e.remove(e.createRangeOn(n))}class Hf extends Zt{refresh(){const t=this.editor.model.document.selection.getSelectedElement(),e=t&&"image"===t.name||!1;this.isEnabled=rf(this.editor.model)||e}execute(t){const e=this.editor,i=e.model,n=e.plugins.get(ag);for(const e of tn(t.file))Uf(i,n,e)}}function Uf(t,e,i){const n=e.createLoader(i);n&&of(t,{uploadId:n.id})}class qf extends Qt{static get requires(){return[ag,lh,yu]}static get pluginName(){return"ImageUploadEditing"}constructor(t){super(t),t.config.define("image",{upload:{types:["jpeg","png","gif","bmp","webp","tiff"]}})}init(){const t=this.editor,e=t.model.document,i=t.model.schema,n=t.conversion,o=t.plugins.get(ag),r=Lf(t.config.get("image.upload.types"));i.extend("image",{allowAttributes:["uploadId","uploadStatus"]});const s=new Hf(t);t.commands.add("uploadImage",s),t.commands.add("imageUpload",s),n.for("upcast").attributeToAttribute({view:{name:"img",key:"uploadId"},model:"uploadId"}),this.listenTo(t.editing.view.document,"clipboardInput",(e,i)=>{if(n=i.dataTransfer,Array.from(n.types).includes("text/html")&&""!==n.getData("text/html"))return;var n;const o=Array.from(i.dataTransfer.files).filter(t=>!!t&&r.test(t.type));o.length&&(e.stop(),t.model.change(e=>{i.targetRanges&&e.setSelection(i.targetRanges.map(e=>t.editing.mapper.toModelRange(e))),t.model.enqueueChange("default",()=>{t.execute("uploadImage",{file:o})})}))}),this.listenTo(t.plugins.get("ClipboardPipeline"),"inputTransformation",(e,i)=>{const n=Array.from(t.editing.view.createRangeIn(i.content)).filter(t=>{return!(!(e=t.item).is("element","img")||!e.getAttribute("src"))&&(e.getAttribute("src").match(/^data:image\/\w+;base64,/g)||e.getAttribute("src").match(/^blob:/g))&&!t.item.getAttribute("uploadProcessed");var e}).map(t=>({promise:Nf(t.item),imageElement:t.item}));if(!n.length)return;const r=new Wh(t.editing.view.document);for(const t of n){r.setAttribute("uploadProcessed",!0,t.imageElement);const e=o.createLoader(t.promise);e&&(r.setAttribute("src","",t.imageElement),r.setAttribute("uploadId",e.id,t.imageElement))}}),t.editing.view.document.on("dragover",(t,e)=>{e.preventDefault()}),e.on("change",()=>{const i=e.differ.getChanges({includeChangesInGraveyard:!0});for(const e of i)if("insert"==e.type&&"$text"!=e.name){const i=e.position.nodeAfter,n="$graveyard"==e.position.root.rootName;for(const e of Wf(t,i)){const t=e.getAttribute("uploadId");if(!t)continue;const i=o.loaders.get(t);i&&(n?i.abort():"idle"==i.status&&this._readAndUpload(i,e))}}}),this.on("uploadComplete",(t,{imageElement:e,data:i})=>{const n=i.urls?i.urls:i;this.editor.model.change(t=>{t.setAttribute("src",n.default,e),this._parseAndSetSrcsetAttributeOnImage(n,e,t)})},{priority:"low"})}_readAndUpload(t,e){const i=this.editor,n=i.model,o=i.locale.t,r=i.plugins.get(ag),s=i.plugins.get(lh);return n.enqueueChange("transparent",t=>{t.setAttribute("uploadStatus","reading",e)}),t.read().then(()=>{const o=t.upload();if(Po.isSafari){const t=sf(i.editing.mapper.toViewElement(e));i.editing.view.once("render",()=>{if(!t.parent)return;const e=i.editing.view.domConverter.mapViewToDom(t.parent);if(!e)return;const n=e.style.display;e.style.display="none",e._ckHack=e.offsetHeight,e.style.display=n})}return n.enqueueChange("transparent",t=>{t.setAttribute("uploadStatus","uploading",e)}),o}).then(t=>{n.enqueueChange("transparent",i=>{i.setAttribute("uploadStatus","complete",e),this.fire("uploadComplete",{data:t,imageElement:e})}),a()}).catch(i=>{if("error"!==t.status&&"aborted"!==t.status)throw i;"error"==t.status&&i&&s.showWarning(i,{title:o("Upload failed"),namespace:"upload"}),a(),n.enqueueChange("transparent",t=>{t.remove(e)})});function a(){n.enqueueChange("transparent",t=>{t.removeAttribute("uploadId",e),t.removeAttribute("uploadStatus",e)}),r.destroyLoader(t)}}_parseAndSetSrcsetAttributeOnImage(t,e,i){let n=0;const o=Object.keys(t).filter(t=>{const e=parseInt(t,10);if(!isNaN(e))return n=Math.max(n,e),!0}).map(e=>`${t[e]} ${e}w`).join(", ");""!=o&&i.setAttribute("srcset",{data:o,width:n},e)}}function Wf(t,e){return Array.from(t.model.createRangeOn(e)).filter(t=>t.item.is("element","image")).map(t=>t.item)}class $f extends Zt{refresh(){const t=this.editor.model.document.selection.getSelectedElement();this.isEnabled=nf(t),t&&t.hasAttribute("width")?this.value={width:t.getAttribute("width"),height:null}:this.value=null}execute(t){const e=this.editor.model,i=e.document.selection.getSelectedElement();this.value={width:t.width,height:null},i&&e.change(e=>{e.setAttribute("width",t.width,i)})}}class Gf extends Qt{static get pluginName(){return"ImageResizeEditing"}constructor(t){super(t),t.config.define("image",{resizeUnit:"%",resizeOptions:[{name:"resizeImage:original",value:null,icon:"original"},{name:"resizeImage:25",value:"25",icon:"small"},{name:"resizeImage:50",value:"50",icon:"medium"},{name:"resizeImage:75",value:"75",icon:"large"}]})}init(){const t=this.editor,e=new $f(t);this._registerSchema(),this._registerConverters(),t.commands.add("resizeImage",e),t.commands.add("imageResize",e)}_registerSchema(){this.editor.model.schema.extend("image",{allowAttributes:"width"}),this.editor.model.schema.setAttributeProperties("width",{isFormatting:!0})}_registerConverters(){const t=this.editor;t.conversion.for("downcast").add(t=>t.on("attribute:width:image",(t,e,i)=>{if(!i.consumable.consume(e.item,t.name))return;const n=i.writer,o=i.mapper.toViewElement(e.item);null!==e.attributeNewValue?(n.setStyle("width",e.attributeNewValue,o),n.addClass("image_resized",o)):(n.removeStyle("width",o),n.removeClass("image_resized",o))})),t.conversion.for("upcast").attributeToAttribute({view:{name:"figure",styles:{width:/.+/}},model:{key:"width",value:t=>t.getStyle("width")}})}}const Yf={small:$c,medium:Gc,large:Wc,original:qc};class Kf extends Qt{static get requires(){return[Gf]}static get pluginName(){return"ImageResizeButtons"}constructor(t){super(t),this._resizeUnit=t.config.get("image.resizeUnit")}init(){const t=this.editor,e=t.config.get("image.resizeOptions"),i=t.commands.get("resizeImage");this.bind("isEnabled").to(i);for(const t of e)this._registerImageResizeButton(t);this._registerImageResizeDropdown(e)}_registerImageResizeButton(t){const e=this.editor,{name:i,value:n,icon:o}=t,r=n?n+this._resizeUnit:null;e.ui.componentFactory.add(i,i=>{const n=new Ad(i),s=e.commands.get("resizeImage"),a=this._getOptionLabelValue(t,!0);if(!Yf[o])throw new l.a("imageresizebuttons-missing-icon",e,t);return n.set({label:a,icon:Yf[o],tooltip:a,isToggleable:!0}),n.bind("isEnabled").to(this),n.bind("isOn").to(s,"value",Qf(r)),this.listenTo(n,"execute",()=>{e.execute("resizeImage",{width:r})}),n})}_registerImageResizeDropdown(t){const e=this.editor,i=e.t,n=t.find(t=>!t.value),o=o=>{const r=e.commands.get("resizeImage"),s=Qd(o,Ld),a=s.buttonView;return a.set({tooltip:i("Resize image"),commandValue:n.value,icon:Yf.medium,isToggleable:!0,label:this._getOptionLabelValue(n),withText:!0,class:"ck-resize-image-button"}),a.bind("label").to(r,"value",t=>t&&t.width?t.width:this._getOptionLabelValue(n)),s.bind("isOn").to(r),s.bind("isEnabled").to(this),Zd(s,this._getResizeDropdownListItemDefinitions(t,r)),s.listView.ariaLabel=i("Image resize list"),this.listenTo(s,"execute",t=>{e.execute(t.source.commandName,{width:t.source.commandValue}),e.editing.view.focus()}),s};e.ui.componentFactory.add("resizeImage",o),e.ui.componentFactory.add("imageResize",o)}_getOptionLabelValue(t,e){const i=this.editor.t;return t.label?t.label:e?t.value?i("Resize image to %0",t.value+this._resizeUnit):i("Resize image to the original size"):t.value?t.value+this._resizeUnit:i("Original")}_getResizeDropdownListItemDefinitions(t,e){const i=new Zi;return t.map(t=>{const n=t.value?t.value+this._resizeUnit:null,o={type:"button",model:new ch({commandName:"resizeImage",commandValue:n,label:this._getOptionLabelValue(t),withText:!0,icon:null})};o.model.bind("isOn").to(e,"value",Qf(n)),i.add(o)}),i}}function Qf(t){return e=>null===t&&e===t||e&&e.width===t}class Jf extends Qt{static get requires(){return[$g]}static get pluginName(){return"ImageResizeHandles"}init(){const t=this.editor.commands.get("resizeImage");this.bind("isEnabled").to(t),this._setupResizerCreator()}_setupResizerCreator(){const t=this.editor,e=t.editing.view;e.addObserver(Xg),this.listenTo(e.document,"imageLoaded",(i,n)=>{if(!n.target.matches("figure.image.ck-widget > img, figure.image.ck-widget > a > img"))return;const o=t.editing.view.domConverter.domToView(n.target).findAncestor("figure");let r=this.editor.plugins.get($g).getResizerByViewElement(o);if(r)return void r.redraw();const s=t.editing.mapper.toModelElement(o);r=t.plugins.get($g).attachTo({unit:t.config.get("image.resizeUnit"),modelElement:s,viewElement:o,editor:t,getHandleHost:t=>t.querySelector("img"),getResizeHost:t=>t,isCentered(){const t=s.getAttribute("imageStyle");return!t||"full"==t||"alignCenter"==t},onCommit(e){t.execute("resizeImage",{width:e})}}),r.on("updateSize",()=>{o.hasClass("image_resized")||e.change(t=>{t.addClass("image_resized",o)})}),r.bind("isEnabled").to(this)})}}i(90);class Zf{constructor(){this._definitions=new Set}get length(){return this._definitions.size}add(t){Array.isArray(t)?t.forEach(t=>this._definitions.add(t)):this._definitions.add(t)}getDispatcher(){return t=>{t.on("attribute:linkHref",(t,e,i)=>{if(!i.consumable.test(e.item,"attribute:linkHref"))return;const n=i.writer,o=n.document.selection;for(const t of this._definitions){const r=n.createAttributeElement("a",t.attributes,{priority:5});n.setCustomProperty("link",!0,r),t.callback(e.attributeNewValue)?e.item.is("selection")?n.wrap(o.getFirstRange(),r):n.wrap(i.mapper.toViewRange(e.range),r):n.unwrap(i.mapper.toViewRange(e.range),r)}},{priority:"high"})}}getDispatcherForLinkedImage(){return t=>{t.on("attribute:linkHref:image",(t,e,i)=>{const n=i.mapper.toViewElement(e.item),o=Array.from(n.getChildren()).find(t=>"a"===t.name);for(const t of this._definitions){const n=mn(t.attributes);if(t.callback(e.attributeNewValue))for(const[t,e]of n)"class"===t?i.writer.addClass(e,o):i.writer.setAttribute(t,e,o);else for(const[t,e]of n)"class"===t?i.writer.removeClass(e,o):i.writer.removeAttribute(t,o)}})}}}var Xf=function(t,e,i){var n=t.length;return i=void 0===i?n:i,!e&&i>=n?t:Rn(t,e,i)},tp=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");var ep=function(t){return tp.test(t)};var ip=function(t){return t.split("")},np="[\\ud800-\\udfff]",op="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",rp="\\ud83c[\\udffb-\\udfff]",sp="[^\\ud800-\\udfff]",ap="(?:\\ud83c[\\udde6-\\uddff]){2}",lp="[\\ud800-\\udbff][\\udc00-\\udfff]",cp="(?:"+op+"|"+rp+")"+"?",dp="[\\ufe0e\\ufe0f]?"+cp+("(?:\\u200d(?:"+[sp,ap,lp].join("|")+")[\\ufe0e\\ufe0f]?"+cp+")*"),hp="(?:"+[sp+op+"?",op,ap,lp,np].join("|")+")",up=RegExp(rp+"(?="+rp+")|"+hp+dp,"g");var mp=function(t){return t.match(up)||[]};var gp=function(t){return ep(t)?mp(t):ip(t)};var fp=function(t){return function(e){e=Sn(e);var i=ep(e)?gp(e):void 0,n=i?i[0]:e.charAt(0),o=i?Xf(i,1).join(""):e.slice(1);return n[t]()+o}}("toUpperCase");const pp=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,wp=/^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i,bp=/^[\S]+@((?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.))+(?:[a-z\u00a1-\uffff]{2,})$/i,kp=/^((\w+:(\/{2,})?)|(\W))/i;function _p(t,{writer:e}){const i=e.createAttributeElement("a",{href:t},{priority:5});return e.setCustomProperty("link",!0,i),i}function vp(t){return function(t){return t.replace(pp,"").match(wp)}(t=String(t))?t:"#"}function yp(t,e){return!!t&&(t.is("element","image")&&e.checkAttribute("image","linkHref"))}function xp(t,e){const i=(n=t,bp.test(n)?"mailto:":e);var n;const o=!!i&&!kp.test(t);return t&&o?i+t:t}class Ap extends Zt{constructor(t){super(t),this.manualDecorators=new Zi,this.automaticDecorators=new Zf}restoreManualDecoratorStates(){for(const t of this.manualDecorators)t.value=this._getDecoratorStateFromModel(t.id)}refresh(){const t=this.editor.model,e=t.document,i=Os(e.selection.getSelectedBlocks());yp(i,t.schema)?(this.value=i.getAttribute("linkHref"),this.isEnabled=t.schema.checkAttribute(i,"linkHref")):(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 i=this.editor.model,n=i.document.selection,o=[],r=[];for(const t in e)e[t]?o.push(t):r.push(t);i.change(e=>{if(n.isCollapsed){const s=n.getFirstPosition();if(n.hasAttribute("linkHref")){const a=Ym(s,"linkHref",n.getAttribute("linkHref"),i);e.setAttribute("linkHref",t,a),o.forEach(t=>{e.setAttribute(t,!0,a)}),r.forEach(t=>{e.removeAttribute(t,a)}),e.setSelection(e.createPositionAfter(a.end.nodeBefore))}else if(""!==t){const r=mn(n.getAttributes());r.set("linkHref",t),o.forEach(t=>{r.set(t,!0)});const{end:a}=i.insertContent(e.createText(t,r),s);e.setSelection(a)}["linkHref",...o,...r].forEach(t=>{e.removeSelectionAttribute(t)})}else{const s=i.schema.getValidRanges(n.getRanges(),"linkHref"),a=[];for(const t of n.getSelectedBlocks())i.schema.checkAttribute(t,"linkHref")&&a.push(e.createRangeOn(t));const l=a.slice();for(const t of s)this._isRangeToUpdate(t,a)&&l.push(t);for(const i of l)e.setAttribute("linkHref",t,i),o.forEach(t=>{e.setAttribute(t,!0,i)}),r.forEach(t=>{e.removeAttribute(t,i)})}})}_getDecoratorStateFromModel(t){const e=this.editor.model,i=e.document,n=Os(i.selection.getSelectedBlocks());return yp(n,e.schema)?n.getAttribute(t):i.selection.getAttribute(t)}_isRangeToUpdate(t,e){for(const i of e)if(i.containsRange(t))return!1;return!0}}class Cp extends Zt{refresh(){const t=this.editor.model,e=t.document,i=Os(e.selection.getSelectedBlocks());yp(i,t.schema)?this.isEnabled=t.schema.checkAttribute(i,"linkHref"):this.isEnabled=t.schema.checkAttributeInSelection(e.selection,"linkHref")}execute(){const t=this.editor,e=this.editor.model,i=e.document.selection,n=t.commands.get("link");e.change(t=>{const o=i.isCollapsed?[Ym(i.getFirstPosition(),"linkHref",i.getAttribute("linkHref"),e)]:e.schema.getValidRanges(i.getRanges(),"linkHref");for(const e of o)if(t.removeAttribute("linkHref",e),n)for(const i of n.manualDecorators)t.removeAttribute(i.id,e)})}}class Tp{constructor({id:t,label:e,attributes:i,defaultValue:n}){this.id=t,this.set("value"),this.defaultValue=n,this.label=e,this.attributes=i}}Kt(Tp,Ut);i(92);const Ep=/^(https?:)?\/\//;class Pp extends Qt{static get pluginName(){return"LinkEditing"}static get requires(){return[Nm,Sm,yu]}constructor(t){super(t),t.config.define("link",{addTargetToExternalLinks:!1})}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"linkHref"}),t.conversion.for("dataDowncast").attributeToElement({model:"linkHref",view:_p}),t.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(t,e)=>_p(vp(t),e)}),t.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:!0}},model:{key:"linkHref",value:t=>t.getAttribute("href")}}),t.commands.add("link",new Ap(t)),t.commands.add("unlink",new Cp(t));const e=function(t,e){const i={"Open in a new tab":t("Open in a new tab"),Downloadable:t("Downloadable")};return e.forEach(t=>(t.label&&i[t.label]&&(t.label=i[t.label]),t)),e}(t.t,function(t){const e=[];if(t)for(const[i,n]of Object.entries(t)){const t=Object.assign({},n,{id:"link"+fp(i)});e.push(t)}return e}(t.config.get("link.decorators")));this._enableAutomaticDecorators(e.filter(t=>"automatic"===t.mode)),this._enableManualDecorators(e.filter(t=>"manual"===t.mode));t.plugins.get(Nm).registerAttribute("linkHref"),function(t,e,i,n){const o=t.editing.view,r=new Set;o.document.registerPostFixer(o=>{const s=t.model.document.selection;let a=!1;if(s.hasAttribute(e)){const l=Ym(s.getFirstPosition(),e,s.getAttribute(e),t.model),c=t.editing.mapper.toViewRange(l);for(const t of c.getItems())t.is("element",i)&&!t.hasClass(n)&&(o.addClass(n,t),r.add(t),a=!0)}return a}),t.conversion.for("editingDowncast").add(t=>{function e(){o.change(t=>{for(const e of r.values())t.removeClass(n,e),r.delete(e)})}t.on("insert",e,{priority:"highest"}),t.on("remove",e,{priority:"highest"}),t.on("attribute",e,{priority:"highest"}),t.on("selection",e,{priority:"highest"})})}(t,"linkHref","a","ck-link_selected"),this._enableInsertContentSelectionAttributesFixer(),this._enableClickingAfterLink(),this._enableTypingOverLink(),this._handleDeleteContentAfterLink()}_enableAutomaticDecorators(t){const e=this.editor,i=e.commands.get("link").automaticDecorators;e.config.get("link.addTargetToExternalLinks")&&i.add({id:"linkIsExternal",mode:"automatic",callback:t=>Ep.test(t),attributes:{target:"_blank",rel:"noopener noreferrer"}}),i.add(t),i.length&&e.conversion.for("downcast").add(i.getDispatcher())}_enableManualDecorators(t){if(!t.length)return;const e=this.editor,i=e.commands.get("link").manualDecorators;t.forEach(t=>{e.model.schema.extend("$text",{allowAttributes:t.id}),i.add(new Tp(t)),e.conversion.for("downcast").attributeToElement({model:t.id,view:(e,{writer:n})=>{if(e){const e=i.get(t.id).attributes,o=n.createAttributeElement("a",e,{priority:5});return n.setCustomProperty("link",!0,o),o}}}),e.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:i.get(t.id).attributes},model:{key:t.id}})})}_enableInsertContentSelectionAttributesFixer(){const t=this.editor.model,e=t.document.selection;this.listenTo(t,"insertContent",()=>{const i=e.anchor.nodeBefore,n=e.anchor.nodeAfter;e.hasAttribute("linkHref")&&i&&i.hasAttribute("linkHref")&&(n&&n.hasAttribute("linkHref")||t.change(e=>{Sp(e,Ip(t.schema))}))},{priority:"low"})}_enableClickingAfterLink(){const t=this.editor,e=t.model;t.editing.view.addObserver(qh);let i=!1;this.listenTo(t.editing.view.document,"mousedown",()=>{i=!0}),this.listenTo(t.editing.view.document,"selectionChange",()=>{if(!i)return;i=!1;const t=e.document.selection;if(!t.isCollapsed)return;if(!t.hasAttribute("linkHref"))return;const n=t.getFirstPosition(),o=Ym(n,"linkHref",t.getAttribute("linkHref"),e);(n.isTouching(o.start)||n.isTouching(o.end))&&e.change(t=>{Sp(t,Ip(e.schema))})})}_enableTypingOverLink(){const t=this.editor,e=t.editing.view;let i,n;this.listenTo(e.document,"delete",()=>{n=!0},{priority:"high"}),this.listenTo(t.model,"deleteContent",()=>{const e=t.model.document.selection;e.isCollapsed||(n?n=!1:Mp(t)&&function(t){const e=t.document.selection,i=e.getFirstPosition(),n=e.getLastPosition(),o=i.nodeAfter;if(!o)return!1;if(!o.is("$text"))return!1;if(!o.hasAttribute("linkHref"))return!1;const r=n.textNode||n.nodeBefore;if(o===r)return!0;return Ym(i,"linkHref",o.getAttribute("linkHref"),t).containsRange(t.createRange(i,n),!0)}(t.model)&&(i=e.getAttributes()))},{priority:"high"}),this.listenTo(t.model,"insertContent",(e,[o])=>{n=!1,Mp(t)&&i&&(t.model.change(t=>{for(const[e,n]of i)t.setAttribute(e,n,o)}),i=null)},{priority:"high"})}_handleDeleteContentAfterLink(){const t=this.editor,e=t.model,i=e.document.selection,n=t.editing.view;let o=!1,r=!1;this.listenTo(n.document,"delete",(t,e)=>{r=e.domEvent.keyCode===Io.backspace},{priority:"high"}),this.listenTo(e,"deleteContent",()=>{o=!1;const t=i.getFirstPosition(),n=i.getAttribute("linkHref");if(!n)return;const r=Ym(t,"linkHref",n,e);o=r.containsPosition(t)||r.end.isEqual(t)},{priority:"high"}),this.listenTo(e,"deleteContent",()=>{r&&(r=!1,o||t.model.enqueueChange(t=>{Sp(t,Ip(e.schema))}))},{priority:"low"})}}function Sp(t,e){t.removeSelectionAttribute("linkHref");for(const i of e)t.removeSelectionAttribute(i)}function Mp(t){return t.plugins.get("Input").isInput(t.model.change(t=>t.batch))}function Ip(t){return t.getDefinition("$text").allowAttributes.filter(t=>t.startsWith("link"))}var Lp='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m11.077 15 .991-1.416a.75.75 0 1 1 1.229.86l-1.148 1.64a.748.748 0 0 1-.217.206 5.251 5.251 0 0 1-8.503-5.955.741.741 0 0 1 .12-.274l1.147-1.639a.75.75 0 1 1 1.228.86L4.933 10.7l.006.003a3.75 3.75 0 0 0 6.132 4.294l.006.004zm5.494-5.335a.748.748 0 0 1-.12.274l-1.147 1.639a.75.75 0 1 1-1.228-.86l.86-1.23a3.75 3.75 0 0 0-6.144-4.301l-.86 1.229a.75.75 0 0 1-1.229-.86l1.148-1.64a.748.748 0 0 1 .217-.206 5.251 5.251 0 0 1 8.503 5.955zm-4.563-2.532a.75.75 0 0 1 .184 1.045l-3.155 4.505a.75.75 0 1 1-1.229-.86l3.155-4.506a.75.75 0 0 1 1.045-.184z"/></svg>';class Np extends Qt{static get requires(){return["ImageEditing",Pp]}static get pluginName(){return"LinkImageEditing"}init(){const t=this.editor;t.model.schema.extend("image",{allowAttributes:["linkHref"]}),t.conversion.for("upcast").add(t=>{t.on("element:a",(t,e,i)=>{const n=e.viewItem,o=Dp(n);if(!o)return;if(!i.consumable.consume(n,{attributes:["href"]}))return;const r=n.getAttribute("href");if(!r)return;let s=e.modelCursor.parent;if(!s.is("element","image")){const t=i.convertItem(o,e.modelCursor);e.modelRange=t.modelRange,e.modelCursor=t.modelCursor,s=e.modelCursor.nodeBefore}s&&s.is("element","image")&&i.writer.setAttribute("linkHref",r,s)},{priority:"high"})}),t.conversion.for("editingDowncast").add(Rp({attachIconIndicator:!0})),t.conversion.for("dataDowncast").add(Rp({attachIconIndicator:!1})),this._enableAutomaticDecorators(),this._enableManualDecorators()}_enableAutomaticDecorators(){const t=this.editor,e=t.commands.get("link").automaticDecorators;e.length&&t.conversion.for("downcast").add(e.getDispatcherForLinkedImage())}_enableManualDecorators(){const t=this.editor,e=t.commands.get("link"),i=e.manualDecorators;for(const n of e.manualDecorators)t.model.schema.extend("image",{allowAttributes:n.id}),t.conversion.for("downcast").add(Op(i,n)),t.conversion.for("upcast").add(zp(i,n))}}function Rp(t){return e=>{e.on("attribute:linkHref:image",(e,i,n)=>{const o=n.mapper.toViewElement(i.item),r=n.writer,s=Array.from(o.getChildren()).find(t=>"a"===t.name);let a;if(t.attachIconIndicator&&(a=r.createUIElement("span",{class:"ck ck-link-image_icon"},(function(t){const e=this.toDomElement(t);return e.innerHTML=Lp,e}))),s)if(i.attributeNewValue)r.setAttribute("href",i.attributeNewValue,s);else{const t=Array.from(s.getChildren()).find(t=>"img"===t.name);r.move(r.createRangeOn(t),r.createPositionAt(o,0)),r.remove(s)}else{const t=r.createContainerElement("a",{href:i.attributeNewValue});r.insert(r.createPositionAt(o,0),t),r.move(r.createRangeOn(o.getChild(1)),r.createPositionAt(t,0)),a&&r.insert(r.createPositionAt(t,"end"),a)}})}}function Op(t,e){return i=>{i.on(`attribute:${e.id}:image`,(i,n,o)=>{const r=t.get(e.id).attributes,s=o.mapper.toViewElement(n.item),a=Array.from(s.getChildren()).find(t=>"a"===t.name);if(a)for(const[t,e]of mn(r))o.writer.setAttribute(t,e,a)})}}function zp(t,e){return i=>{i.on("element:a",(i,n,o)=>{const r=n.viewItem;if(!Dp(r))return;const s={attributes:t.get(e.id).attributes},a=new gn(s).match(r);if(!a)return;if(!o.consumable.consume(r,a.match))return;const l=n.modelCursor.nodeBefore||n.modelCursor.parent;o.writer.setAttribute(e.id,!0,l)},{priority:"high"})}}function Dp(t){return Array.from(t.getChildren()).find(t=>"img"===t.name)}i(94);class Vp extends ed{constructor(t,e){super(t);const i=t.t;this.focusTracker=new zs,this.keystrokes=new Ds,this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(i("Save"),Lc,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(i("Cancel"),Ic,"ck-button-cancel","cancel"),this._manualDecoratorSwitches=this._createManualDecoratorSwitches(e),this.children=this._createFormChildren(e.manualDecorators),this._focusables=new td,this._focusCycler=new Pd({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});const n=["ck","ck-link-form","ck-responsive-form"];e.manualDecorators.length&&n.push("ck-link-form_layout-vertical","ck-vertical-form"),this.setTemplate({tag:"form",attributes:{class:n,tabindex:"-1"},children:this.children}),Zc(this)}getDecoratorSwitchesState(){return Array.from(this._manualDecoratorSwitches).reduce((t,e)=>(t[e.name]=e.isOn,t),{})}render(){super.render(),Xc({view:this});[this.urlInputView,...this._manualDecoratorSwitches,this.saveButtonView,this.cancelButtonView].forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}_createUrlInput(){const t=this.locale.t,e=new sh(this.locale,ah);return e.label=t("Link URL"),e}_createButton(t,e,i,n){const o=new Ad(this.locale);return o.set({label:t,icon:e,tooltip:!0}),o.extendTemplate({attributes:{class:i}}),n&&o.delegate("execute").to(this,n),o}_createManualDecoratorSwitches(t){const e=this.createCollection();for(const i of t.manualDecorators){const n=new Cd(this.locale);n.set({name:i.id,label:i.label,withText:!0}),n.bind("isOn").toMany([i,t],"value",(t,e)=>void 0===e&&void 0===t?i.defaultValue:t),n.on("execute",()=>{i.set("value",!n.isOn)}),e.add(n)}return e}_createFormChildren(t){const e=this.createCollection();if(e.add(this.urlInputView),t.length){const t=new ed;t.setTemplate({tag:"ul",children:this._manualDecoratorSwitches.map(t=>({tag:"li",children:[t],attributes:{class:["ck","ck-list__item"]}})),attributes:{class:["ck","ck-reset","ck-list"]}}),e.add(t)}return e.add(this.saveButtonView),e.add(this.cancelButtonView),e}}i(96);class jp extends ed{constructor(t){super(t);const e=t.t;this.focusTracker=new zs,this.keystrokes=new Ds,this.previewButtonView=this._createPreviewButton(),this.unlinkButtonView=this._createButton(e("Unlink"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m11.077 15 .991-1.416a.75.75 0 1 1 1.229.86l-1.148 1.64a.748.748 0 0 1-.217.206 5.251 5.251 0 0 1-8.503-5.955.741.741 0 0 1 .12-.274l1.147-1.639a.75.75 0 1 1 1.228.86L4.933 10.7l.006.003a3.75 3.75 0 0 0 6.132 4.294l.006.004zm5.494-5.335a.748.748 0 0 1-.12.274l-1.147 1.639a.75.75 0 1 1-1.228-.86l.86-1.23a3.75 3.75 0 0 0-6.144-4.301l-.86 1.229a.75.75 0 0 1-1.229-.86l1.148-1.64a.748.748 0 0 1 .217-.206 5.251 5.251 0 0 1 8.503 5.955zm-4.563-2.532a.75.75 0 0 1 .184 1.045l-3.155 4.505a.75.75 0 1 1-1.229-.86l3.155-4.506a.75.75 0 0 1 1.045-.184zm4.919 10.562-1.414 1.414a.75.75 0 1 1-1.06-1.06l1.414-1.415-1.415-1.414a.75.75 0 0 1 1.061-1.06l1.414 1.414 1.414-1.415a.75.75 0 0 1 1.061 1.061l-1.414 1.414 1.414 1.415a.75.75 0 0 1-1.06 1.06l-1.415-1.414z"/></svg>',"unlink"),this.editButtonView=this._createButton(e("Edit link"),Yc,"edit"),this.set("href"),this._focusables=new td,this._focusCycler=new Pd({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-link-actions","ck-responsive-form"],tabindex:"-1"},children:[this.previewButtonView,this.editButtonView,this.unlinkButtonView]})}render(){super.render();[this.previewButtonView,this.editButtonView,this.unlinkButtonView].forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}_createButton(t,e,i){const n=new Ad(this.locale);return n.set({label:t,icon:e,tooltip:!0}),n.delegate("execute").to(this,i),n}_createPreviewButton(){const t=new Ad(this.locale),e=this.bindTemplate,i=this.t;return t.set({withText:!0,tooltip:i("Open link in new tab")}),t.extendTemplate({attributes:{class:["ck","ck-link-actions__preview"],href:e.to("href",t=>t&&vp(t)),target:"_blank",rel:"noopener noreferrer"}}),t.bind("label").to(this,"href",t=>t||i("This link has no URL")),t.bind("isEnabled").to(this,"href",t=>!!t),t.template.tag="a",t.template.eventListeners={},t}}class Bp extends Qt{static get requires(){return[wh]}static get pluginName(){return"LinkUI"}init(){const t=this.editor;t.editing.view.addObserver(Uh),this.actionsView=this._createActionsView(),this.formView=this._createFormView(),this._balloon=t.plugins.get(wh),this._createToolbarLinkButton(),this._enableUserBalloonInteractions(),t.conversion.for("editingDowncast").markerToHighlight({model:"link-ui",view:{classes:["ck-fake-link-selection"]}}),t.conversion.for("editingDowncast").markerToElement({model:"link-ui",view:{name:"span",classes:["ck-fake-link-selection","ck-fake-link-selection_collapsed"]}})}destroy(){super.destroy(),this.formView.destroy()}_createActionsView(){const t=this.editor,e=new jp(t.locale),i=t.commands.get("link"),n=t.commands.get("unlink");return e.bind("href").to(i,"value"),e.editButtonView.bind("isEnabled").to(i),e.unlinkButtonView.bind("isEnabled").to(n),this.listenTo(e,"edit",()=>{this._addFormView()}),this.listenTo(e,"unlink",()=>{t.execute("unlink"),this._hideUI()}),e.keystrokes.set("Esc",(t,e)=>{this._hideUI(),e()}),e.keystrokes.set("Ctrl+K",(t,e)=>{this._addFormView(),e()}),e}_createFormView(){const t=this.editor,e=t.commands.get("link"),i=t.config.get("link.defaultProtocol"),n=new Vp(t.locale,e);return n.urlInputView.fieldView.bind("value").to(e,"value"),n.urlInputView.bind("isReadOnly").to(e,"isEnabled",t=>!t),n.saveButtonView.bind("isEnabled").to(e),this.listenTo(n,"submit",()=>{const{value:e}=n.urlInputView.fieldView.element,o=xp(e,i);t.execute("link",o,n.getDecoratorSwitchesState()),this._closeFormView()}),this.listenTo(n,"cancel",()=>{this._closeFormView()}),n.keystrokes.set("Esc",(t,e)=>{this._closeFormView(),e()}),n}_createToolbarLinkButton(){const t=this.editor,e=t.commands.get("link"),i=t.t;t.keystrokes.set("Ctrl+K",(t,i)=>{i(),e.isEnabled&&this._showUI(!0)}),t.ui.componentFactory.add("link",t=>{const n=new Ad(t);return n.isEnabled=!0,n.label=i("Link"),n.icon=Lp,n.keystroke="Ctrl+K",n.tooltip=!0,n.isToggleable=!0,n.bind("isEnabled").to(e,"isEnabled"),n.bind("isOn").to(e,"value",t=>!!t),this.listenTo(n,"execute",()=>this._showUI(!0)),n})}_enableUserBalloonInteractions(){const t=this.editor.editing.view.document;this.listenTo(t,"click",()=>{this._getSelectedLinkElement()&&this._showUI()}),this.editor.keystrokes.set("Tab",(t,e)=>{this._areActionsVisible&&!this.actionsView.focusTracker.isFocused&&(this.actionsView.focus(),e())},{priority:"high"}),this.editor.keystrokes.set("Esc",(t,e)=>{this._isUIVisible&&(this._hideUI(),e())}),Jc({emitter:this.formView,activator:()=>this._isUIInPanel,contextElements:[this._balloon.view.element],callback:()=>this._hideUI()})}_addActionsView(){this._areActionsInPanel||this._balloon.add({view:this.actionsView,position:this._getBalloonPositionData()})}_addFormView(){if(this._isFormInPanel)return;const t=this.editor.commands.get("link");this.formView.disableCssTransitions(),this._balloon.add({view:this.formView,position:this._getBalloonPositionData()}),this._balloon.visibleView===this.formView&&this.formView.urlInputView.fieldView.select(),this.formView.enableCssTransitions(),this.formView.urlInputView.fieldView.element.value=t.value||""}_closeFormView(){const t=this.editor.commands.get("link");t.restoreManualDecoratorStates(),void 0!==t.value?this._removeFormView():this._hideUI()}_removeFormView(){this._isFormInPanel&&(this.formView.saveButtonView.focus(),this._balloon.remove(this.formView),this.editor.editing.view.focus(),this._hideFakeVisualSelection())}_showUI(t=!1){this._getSelectedLinkElement()?(this._areActionsVisible?this._addFormView():this._addActionsView(),t&&this._balloon.showStack("main")):(this._showFakeVisualSelection(),this._addActionsView(),t&&this._balloon.showStack("main"),this._addFormView()),this._startUpdatingUI()}_hideUI(){if(!this._isUIInPanel)return;const t=this.editor;this.stopListening(t.ui,"update"),this.stopListening(this._balloon,"change:visibleView"),t.editing.view.focus(),this._removeFormView(),this._balloon.remove(this.actionsView),this._hideFakeVisualSelection()}_startUpdatingUI(){const t=this.editor,e=t.editing.view.document;let i=this._getSelectedLinkElement(),n=r();const o=()=>{const t=this._getSelectedLinkElement(),e=r();i&&!t||!i&&e!==n?this._hideUI():this._isUIVisible&&this._balloon.updatePosition(this._getBalloonPositionData()),i=t,n=e};function r(){return e.selection.focus.getAncestors().reverse().find(t=>t.is("element"))}this.listenTo(t.ui,"update",o),this.listenTo(this._balloon,"change:visibleView",o)}get _isFormInPanel(){return this._balloon.hasView(this.formView)}get _areActionsInPanel(){return this._balloon.hasView(this.actionsView)}get _areActionsVisible(){return this._balloon.visibleView===this.actionsView}get _isUIInPanel(){return this._isFormInPanel||this._areActionsInPanel}get _isUIVisible(){return this._balloon.visibleView==this.formView||this._areActionsVisible}_getBalloonPositionData(){const t=this.editor.editing.view,e=this.editor.model,i=t.document;let n=null;if(e.markers.has("link-ui")){const e=Array.from(this.editor.editing.mapper.markerNameToElements("link-ui")),i=t.createRange(t.createPositionBefore(e[0]),t.createPositionAfter(e[e.length-1]));n=t.domConverter.viewRangeToDom(i)}else{const e=this._getSelectedLinkElement(),o=i.selection.getFirstRange();n=e?t.domConverter.mapViewToDom(e):t.domConverter.viewRangeToDom(o)}return{target:n}}_getSelectedLinkElement(){const t=this.editor.editing.view,e=t.document.selection;if(e.isCollapsed)return Fp(e.getFirstPosition());{const i=e.getFirstRange().getTrimmed(),n=Fp(i.start),o=Fp(i.end);return n&&n==o&&t.createRangeIn(n).getTrimmed().isEqual(i)?n:null}}_showFakeVisualSelection(){const t=this.editor.model;t.change(e=>{const i=t.document.selection.getFirstRange();if(t.markers.has("link-ui"))e.updateMarker("link-ui",{range:i});else if(i.start.isAtEnd){const n=i.start.getLastMatchingPosition(({item:e})=>!t.schema.isContent(e),{boundaries:i});e.addMarker("link-ui",{usingOperation:!1,affectsData:!1,range:e.createRange(n,i.end)})}else e.addMarker("link-ui",{usingOperation:!1,affectsData:!1,range:i})})}_hideFakeVisualSelection(){const t=this.editor.model;t.markers.has("link-ui")&&t.change(t=>{t.removeMarker("link-ui")})}}function Fp(t){return t.getAncestors().find(t=>{return(e=t).is("attributeElement")&&!!e.getCustomProperty("link");var e})}class Hp extends Qt{static get requires(){return[Pp,Bp,"Image"]}static get pluginName(){return"LinkImageUI"}init(){const t=this.editor,e=t.editing.view.document;this.listenTo(e,"click",(i,n)=>{Up(e.selection.getSelectedElement(),t.plugins.get("Image"))&&n.preventDefault()}),this._createToolbarLinkImageButton()}_createToolbarLinkImageButton(){const t=this.editor,e=t.t;t.ui.componentFactory.add("linkImage",i=>{const n=new Ad(i),o=t.plugins.get("LinkUI"),r=t.commands.get("link");return n.set({isEnabled:!0,label:e("Link image"),icon:Lp,keystroke:"Ctrl+K",tooltip:!0,isToggleable:!0}),n.bind("isEnabled").to(r,"isEnabled"),n.bind("isOn").to(r,"value",t=>!!t),this.listenTo(n,"execute",()=>{Up(t.editing.view.document.selection.getSelectedElement(),t.plugins.get("Image"))?o._addActionsView():o._showUI(!0)}),n})}}function Up(t,e){return!(!t||!e.isImageWidget(t))&&t.getChild(0).is("element","a")}i(98);class qp extends Qt{static get pluginName(){return"IndentEditing"}init(){const t=this.editor;t.commands.add("indent",new te(t)),t.commands.add("outdent",new te(t))}}var Wp='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm5 6c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zM2.75 16.5h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 1 0 0 1.5zM1.632 6.95 5.02 9.358a.4.4 0 0 1-.013.661l-3.39 2.207A.4.4 0 0 1 1 11.892V7.275a.4.4 0 0 1 .632-.326z"/></svg>',$p='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm5 6c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zM2.75 16.5h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 1 0 0 1.5zm1.618-9.55L.98 9.358a.4.4 0 0 0 .013.661l3.39 2.207A.4.4 0 0 0 5 11.892V7.275a.4.4 0 0 0-.632-.326z"/></svg>';class Gp extends Qt{static get pluginName(){return"IndentUI"}init(){const t=this.editor,e=t.locale,i=t.t,n="ltr"==e.uiLanguageDirection?Wp:$p,o="ltr"==e.uiLanguageDirection?$p:Wp;this._defineButton("indent",i("Increase indent"),n),this._defineButton("outdent",i("Decrease indent"),o)}_defineButton(t,e,i){const n=this.editor;n.ui.componentFactory.add(t,o=>{const r=n.commands.get(t),s=new Ad(o);return s.set({label:e,icon:i,tooltip:!0}),s.bind("isOn","isEnabled").to(r,"value","isEnabled"),this.listenTo(s,"execute",()=>{n.execute(t),n.editing.view.focus()}),s})}}const Yp=new RegExp("(^|\\s)(((?:(?:(?:https?|ftp):)?\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(((?!www\\.)|(www\\.))(?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.)+(?:[a-z\\u00a1-\\uffff]{2,63})))(?::\\d{2,5})?(?:[/?#]\\S*)?)|((www.|(\\S+@))((?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.))+(?:[a-z\\u00a1-\\uffff]{2,63})))$","i");class Kp extends Qt{static get pluginName(){return"AutoLink"}init(){const t=this.editor.model.document.selection;t.on("change:range",()=>{this.isEnabled=!t.anchor.parent.is("element","codeBlock")}),this._enableTypingHandling()}afterInit(){this._enableEnterHandling(),this._enableShiftEnterHandling()}_enableTypingHandling(){const t=this.editor,e=new Lm(t.model,t=>{if(!function(t){return t.length>4&&" "===t[t.length-1]&&" "!==t[t.length-2]}(t))return;const e=Qp(t.substr(0,t.length-1));return e?{url:e}:void 0}),i=t.plugins.get("Input");e.on("matched:data",(e,n)=>{const{batch:o,range:r,url:s}=n;if(!i.isInput(o))return;const a=r.end.getShiftedBy(-1),l=a.getShiftedBy(-s.length),c=t.model.createRange(l,a);this._applyAutoLink(s,c)}),e.bind("isEnabled").to(this)}_enableEnterHandling(){const t=this.editor,e=t.model,i=t.commands.get("enter");i&&i.on("execute",()=>{const t=e.document.selection.getFirstPosition();if(!t.parent.previousSibling)return;const i=e.createRangeIn(t.parent.previousSibling);this._checkAndApplyAutoLinkOnRange(i)})}_enableShiftEnterHandling(){const t=this.editor,e=t.model,i=t.commands.get("shiftEnter");i&&i.on("execute",()=>{const t=e.document.selection.getFirstPosition(),i=e.createRange(e.createPositionAt(t.parent,0),t.getShiftedBy(-1));this._checkAndApplyAutoLinkOnRange(i)})}_checkAndApplyAutoLinkOnRange(t){const e=this.editor.model,{text:i,range:n}=Im(t,e),o=Qp(i);if(o){const t=e.createRange(n.end.getShiftedBy(-o.length),n.end);this._applyAutoLink(o,t)}}_applyAutoLink(t,e){const i=this.editor.model;this.isEnabled&&function(t,e){return e.schema.checkAttributeInSelection(e.createSelection(t),"linkHref")}(e,i)&&i.enqueueChange(i=>{const n=this.editor.config.get("link.defaultProtocol"),o=xp(t,n);i.setAttribute("linkHref",o,e)})}}function Qp(t){const e=Yp.exec(t);return e?e[2]:null}class Jp extends Zt{constructor(t,e){super(t),this.type=e}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){const e=this.editor.model,i=e.document,n=Array.from(i.selection.getSelectedBlocks()).filter(t=>Xp(t,e.schema)),o=void 0!==t.forceValue?!t.forceValue:this.value;e.change(t=>{if(o){let e=n[n.length-1].nextSibling,i=Number.POSITIVE_INFINITY,o=[];for(;e&&"listItem"==e.name&&0!==e.getAttribute("listIndent");){const t=e.getAttribute("listIndent");t<i&&(i=t);const n=t-i;o.push({element:e,listIndent:n}),e=e.nextSibling}o=o.reverse();for(const e of o)t.setAttribute("listIndent",e.listIndent,e.element)}if(!o){let t=Number.POSITIVE_INFINITY;for(const e of n)e.is("element","listItem")&&e.getAttribute("listIndent")<t&&(t=e.getAttribute("listIndent"));t=0===t?1:t,Zp(n,!0,t),Zp(n,!1,t)}for(const e of n.reverse())o&&"listItem"==e.name?t.rename(e,"paragraph"):o||"listItem"==e.name?o||"listItem"!=e.name||e.getAttribute("listType")==this.type||t.setAttribute("listType",this.type,e):(t.setAttributes({listType:this.type,listIndent:0},e),t.rename(e,"listItem"));this.fire("_executeCleanup",n)})}_getValue(){const t=Os(this.editor.model.document.selection.getSelectedBlocks());return!!t&&t.is("element","listItem")&&t.getAttribute("listType")==this.type}_checkEnabled(){if(this.value)return!0;const t=this.editor.model.document.selection,e=this.editor.model.schema,i=Os(t.getSelectedBlocks());return!!i&&Xp(i,e)}}function Zp(t,e,i){const n=e?t[0]:t[t.length-1];if(n.is("element","listItem")){let o=n[e?"previousSibling":"nextSibling"],r=n.getAttribute("listIndent");for(;o&&o.is("element","listItem")&&o.getAttribute("listIndent")>=i;)r>o.getAttribute("listIndent")&&(r=o.getAttribute("listIndent")),o.getAttribute("listIndent")==r&&t[e?"unshift":"push"](o),o=o[e?"previousSibling":"nextSibling"]}}function Xp(t,e){return e.checkChild(t.parent,"listItem")&&!e.isObject(t)}class tw extends Zt{constructor(t,e){super(t),this._indentBy="forward"==e?1:-1}refresh(){this.isEnabled=this._checkEnabled()}execute(){const t=this.editor.model,e=t.document;let i=Array.from(e.selection.getSelectedBlocks());t.change(t=>{const e=i[i.length-1];let n=e.nextSibling;for(;n&&"listItem"==n.name&&n.getAttribute("listIndent")>e.getAttribute("listIndent");)i.push(n),n=n.nextSibling;this._indentBy<0&&(i=i.reverse());for(const e of i){const i=e.getAttribute("listIndent")+this._indentBy;i<0?t.rename(e,"paragraph"):t.setAttribute("listIndent",i,e)}this.fire("_executeCleanup",i)})}_checkEnabled(){const t=Os(this.editor.model.document.selection.getSelectedBlocks());if(!t||!t.is("element","listItem"))return!1;if(this._indentBy>0){const e=t.getAttribute("listIndent"),i=t.getAttribute("listType");let n=t.previousSibling;for(;n&&n.is("element","listItem")&&n.getAttribute("listIndent")>=e;){if(n.getAttribute("listIndent")==e)return n.getAttribute("listType")==i;n=n.previousSibling}return!1}return!0}}function ew(t,e){const i=e.mapper,n=e.writer,o="numbered"==t.getAttribute("listType")?"ol":"ul",r=function(t){const e=t.createContainerElement("li");return e.getFillerOffset=aw,e}(n),s=n.createContainerElement(o,null);return n.insert(n.createPositionAt(s,0),r),i.bindElements(t,r),r}function iw(t,e,i,n){const o=e.parent,r=i.mapper,s=i.writer;let a=r.toViewPosition(n.createPositionBefore(t));const l=rw(t.previousSibling,{sameIndent:!0,smallerIndent:!0,listIndent:t.getAttribute("listIndent")}),c=t.previousSibling;if(l&&l.getAttribute("listIndent")==t.getAttribute("listIndent")){const t=r.toViewElement(l);a=s.breakContainer(s.createPositionAfter(t))}else if(c&&"listItem"==c.name){a=r.toViewPosition(n.createPositionAt(c,"end"));const t=r.findMappedViewAncestor(a),e=function(t){for(const e of t.getChildren())if("ul"==e.name||"ol"==e.name)return e;return null}(t);a=e?s.createPositionBefore(e):s.createPositionAt(t,"end")}else a=r.toViewPosition(n.createPositionBefore(t));if(a=ow(a),s.insert(a,o),c&&"listItem"==c.name){const t=r.toViewElement(c),i=s.createRange(s.createPositionAt(t,0),a).getWalker({ignoreElementEnd:!0});for(const t of i)if(t.item.is("element","li")){const n=s.breakContainer(s.createPositionBefore(t.item)),o=t.item.parent,r=s.createPositionAt(e,"end");nw(s,r.nodeBefore,r.nodeAfter),s.move(s.createRangeOn(o),r),i.position=n}}else{const i=o.nextSibling;if(i&&(i.is("element","ul")||i.is("element","ol"))){let n=null;for(const e of i.getChildren()){const i=r.toModelElement(e);if(!(i&&i.getAttribute("listIndent")>t.getAttribute("listIndent")))break;n=e}n&&(s.breakContainer(s.createPositionAfter(n)),s.move(s.createRangeOn(n.parent),s.createPositionAt(e,"end")))}}nw(s,o,o.nextSibling),nw(s,o.previousSibling,o)}function nw(t,e,i){return!e||!i||"ul"!=e.name&&"ol"!=e.name||e.name!=i.name||e.getAttribute("class")!==i.getAttribute("class")?null:t.mergeContainers(t.createPositionAfter(e))}function ow(t){return t.getLastMatchingPosition(t=>t.item.is("uiElement"))}function rw(t,e){const i=!!e.sameIndent,n=!!e.smallerIndent,o=e.listIndent;let r=t;for(;r&&"listItem"==r.name;){const t=r.getAttribute("listIndent");if(i&&o==t||n&&o>t)return r;r="forward"===e.direction?r.nextSibling:r.previousSibling}return null}function sw(t,e,i,n){t.ui.componentFactory.add(e,o=>{const r=t.commands.get(e),s=new Ad(o);return s.set({label:i,icon:n,tooltip:!0,isToggleable:!0}),s.bind("isOn","isEnabled").to(r,"value","isEnabled"),s.on("execute",()=>{t.execute(e),t.editing.view.focus()}),s})}function aw(){const t=!this.isEmpty&&("ul"==this.getChild(0).name||"ol"==this.getChild(0).name);return this.isEmpty||t?0:io.call(this)}function lw(t){return(e,i,n)=>{const o=n.consumable;if(!o.test(i.item,"insert")||!o.test(i.item,"attribute:listType")||!o.test(i.item,"attribute:listIndent"))return;o.consume(i.item,"insert"),o.consume(i.item,"attribute:listType"),o.consume(i.item,"attribute:listIndent");const r=i.item;iw(r,ew(r,n),n,t)}}function cw(t,e,i){if(!i.consumable.consume(e.item,"attribute:listType"))return;const n=i.mapper.toViewElement(e.item),o=i.writer;o.breakContainer(o.createPositionBefore(n)),o.breakContainer(o.createPositionAfter(n));const r=n.parent,s="numbered"==e.attributeNewValue?"ol":"ul";o.rename(s,r)}function dw(t,e,i){const n=i.mapper.toViewElement(e.item).parent,o=i.writer;nw(o,n,n.nextSibling),nw(o,n.previousSibling,n);for(const t of e.item.getChildren())i.consumable.consume(t,"insert")}function hw(t,e,i){if("listItem"!=e.item.name){let t=i.mapper.toViewPosition(e.range.start);const n=i.writer,o=[];for(;("ul"==t.parent.name||"ol"==t.parent.name)&&(t=n.breakContainer(t),"li"==t.parent.name);){const e=t,i=n.createPositionAt(t.parent,"end");if(!e.isEqual(i)){const t=n.remove(n.createRange(e,i));o.push(t)}t=n.createPositionAfter(t.parent)}if(o.length>0){for(let e=0;e<o.length;e++){const i=t.nodeBefore;if(t=n.insert(t,o[e]).end,e>0){const e=nw(n,i,i.nextSibling);e&&e.parent==i&&t.offset--}}nw(n,t.nodeBefore,t.nodeAfter)}}}function uw(t,e,i){const n=i.mapper.toViewPosition(e.position),o=n.nodeBefore,r=n.nodeAfter;nw(i.writer,o,r)}function mw(t,e,i){if(i.consumable.consume(e.viewItem,{name:!0})){const t=i.writer,n=t.createElement("listItem"),o=function(t){let e=0,i=t.parent;for(;i;){if(i.is("element","li"))e++;else{const t=i.previousSibling;t&&t.is("element","li")&&e++}i=i.parent}return e}(e.viewItem);t.setAttribute("listIndent",o,n);const r=e.viewItem.parent&&"ol"==e.viewItem.parent.name?"numbered":"bulleted";if(t.setAttribute("listType",r,n),!i.safeInsert(n,e.modelCursor))return;const s=function(t,e,i){const{writer:n,schema:o}=i;let r=n.createPositionAfter(t);for(const s of e)if("ul"==s.name||"ol"==s.name)r=i.convertItem(s,r).modelCursor;else{const e=i.convertItem(s,n.createPositionAt(t,"end")),a=e.modelRange.start.nodeAfter;a&&a.is("element")&&!o.checkChild(t,a.name)&&(t=e.modelCursor.parent.is("element","listItem")?e.modelCursor.parent:bw(e.modelCursor),r=n.createPositionAfter(t))}return r}(n,e.viewItem.getChildren(),i);e.modelRange=t.createRange(e.modelCursor,s),i.updateConversionResult(n,e)}}function gw(t,e,i){if(i.consumable.test(e.viewItem,{name:!0})){const t=Array.from(e.viewItem.getChildren());for(const e of t){!(e.is("element","li")||_w(e))&&e._remove()}}}function fw(t,e,i){if(i.consumable.test(e.viewItem,{name:!0})){if(0===e.viewItem.childCount)return;const t=[...e.viewItem.getChildren()];let i=!1,n=!0;for(const e of t)i&&!_w(e)&&e._remove(),e.is("$text")?(n&&(e._data=e.data.trimStart()),e.nextSibling&&!_w(e.nextSibling)||(e._data=e.data.trimEnd())):_w(e)&&(i=!0),n=!1}}function pw(t){return(e,i)=>{if(i.isPhantom)return;const n=i.modelPosition.nodeBefore;if(n&&n.is("element","listItem")){const e=i.mapper.toViewElement(n),o=e.getAncestors().find(_w),r=t.createPositionAt(e,0).getWalker();for(const t of r){if("elementStart"==t.type&&t.item.is("element","li")){i.viewPosition=t.previousPosition;break}if("elementEnd"==t.type&&t.item==o){i.viewPosition=t.nextPosition;break}}}}}function ww(t,[e,i]){let n,o=e.is("documentFragment")?e.getChild(0):e;if(n=i?this.createSelection(i):this.document.selection,o&&o.is("element","listItem")){const t=n.getFirstPosition();let e=null;if(t.parent.is("element","listItem")?e=t.parent:t.nodeBefore&&t.nodeBefore.is("element","listItem")&&(e=t.nodeBefore),e){const t=e.getAttribute("listIndent");if(t>0)for(;o&&o.is("element","listItem");)o._setAttribute("listIndent",o.getAttribute("listIndent")+t),o=o.nextSibling}}}function bw(t){const e=new ea({startPosition:t});let i;do{i=e.next()}while(!i.value.item.is("element","listItem"));return i.value.item}function kw(t,e,i,n,o,r){const s=rw(e.nodeBefore,{sameIndent:!0,smallerIndent:!0,listIndent:t,foo:"b"}),a=o.mapper,l=o.writer,c=s?s.getAttribute("listIndent"):null;let d;if(s)if(c==t){const t=a.toViewElement(s).parent;d=l.createPositionAfter(t)}else{const t=r.createPositionAt(s,"end");d=a.toViewPosition(t)}else d=i;d=ow(d);for(const t of[...n.getChildren()])_w(t)&&(d=l.move(l.createRangeOn(t),d).end,nw(l,t,t.nextSibling),nw(l,t.previousSibling,t))}function _w(t){return t.is("element","ol")||t.is("element","ul")}class vw extends Qt{static get pluginName(){return"ListEditing"}static get requires(){return[Eu,Iu]}init(){const t=this.editor;t.model.schema.register("listItem",{inheritAllFrom:"$block",allowAttributes:["listType","listIndent"]});const e=t.data,i=t.editing;var n;t.model.document.registerPostFixer(e=>function(t,e){const i=t.document.differ.getChanges(),n=new Map;let o=!1;for(const n of i)if("insert"==n.type&&"listItem"==n.name)r(n.position);else if("insert"==n.type&&"listItem"!=n.name){if("$text"!=n.name){const i=n.position.nodeAfter;i.hasAttribute("listIndent")&&(e.removeAttribute("listIndent",i),o=!0),i.hasAttribute("listType")&&(e.removeAttribute("listType",i),o=!0),i.hasAttribute("listStyle")&&(e.removeAttribute("listStyle",i),o=!0);for(const e of Array.from(t.createRangeIn(i)).filter(t=>t.item.is("element","listItem")))r(e.previousPosition)}r(n.position.getShiftedBy(n.length))}else"remove"==n.type&&"listItem"==n.name?r(n.position):("attribute"==n.type&&"listIndent"==n.attributeKey||"attribute"==n.type&&"listType"==n.attributeKey)&&r(n.range.start);for(const t of n.values())s(t),a(t);return o;function r(t){const e=t.nodeBefore;if(e&&e.is("element","listItem")){let t=e;if(n.has(t))return;for(let e=t.previousSibling;e&&e.is("element","listItem");e=t.previousSibling)if(t=e,n.has(t))return;n.set(e,t)}else{const e=t.nodeAfter;e&&e.is("element","listItem")&&n.set(e,e)}}function s(t){let i=0,n=null;for(;t&&t.is("element","listItem");){const r=t.getAttribute("listIndent");if(r>i){let s;null===n?(n=r-i,s=i):(n>r&&(n=r),s=r-n),e.setAttribute("listIndent",s,t),o=!0}else n=null,i=t.getAttribute("listIndent")+1;t=t.nextSibling}}function a(t){let i=[],n=null;for(;t&&t.is("element","listItem");){const r=t.getAttribute("listIndent");if(n&&n.getAttribute("listIndent")>r&&(i=i.slice(0,r+1)),0!=r)if(i[r]){const n=i[r];t.getAttribute("listType")!=n&&(e.setAttribute("listType",n,t),o=!0)}else i[r]=t.getAttribute("listType");n=t,t=t.nextSibling}}}(t.model,e)),i.mapper.registerViewToModelLength("li",yw),e.mapper.registerViewToModelLength("li",yw),i.mapper.on("modelToViewPosition",pw(i.view)),i.mapper.on("viewToModelPosition",(n=t.model,(t,e)=>{const i=e.viewPosition,o=i.parent,r=e.mapper;if("ul"==o.name||"ol"==o.name){if(i.isAtEnd){const t=r.toModelElement(i.nodeBefore),o=r.getModelLength(i.nodeBefore);e.modelPosition=n.createPositionBefore(t).getShiftedBy(o)}else{const t=r.toModelElement(i.nodeAfter);e.modelPosition=n.createPositionBefore(t)}t.stop()}else if("li"==o.name&&i.nodeBefore&&("ul"==i.nodeBefore.name||"ol"==i.nodeBefore.name)){const s=r.toModelElement(o);let a=1,l=i.nodeBefore;for(;l&&_w(l);)a+=r.getModelLength(l),l=l.previousSibling;e.modelPosition=n.createPositionBefore(s).getShiftedBy(a),t.stop()}})),e.mapper.on("modelToViewPosition",pw(i.view)),t.conversion.for("editingDowncast").add(e=>{e.on("insert",hw,{priority:"high"}),e.on("insert:listItem",lw(t.model)),e.on("attribute:listType:listItem",cw,{priority:"high"}),e.on("attribute:listType:listItem",dw,{priority:"low"}),e.on("attribute:listIndent:listItem",function(t){return(e,i,n)=>{if(!n.consumable.consume(i.item,"attribute:listIndent"))return;const o=n.mapper.toViewElement(i.item),r=n.writer;r.breakContainer(r.createPositionBefore(o)),r.breakContainer(r.createPositionAfter(o));const s=o.parent,a=s.previousSibling,l=r.createRangeOn(s);r.remove(l),a&&a.nextSibling&&nw(r,a,a.nextSibling),kw(i.attributeOldValue+1,i.range.start,l.start,o,n,t),iw(i.item,o,n,t);for(const t of i.item.getChildren())n.consumable.consume(t,"insert")}}(t.model)),e.on("remove:listItem",function(t){return(e,i,n)=>{const o=n.mapper.toViewPosition(i.position).getLastMatchingPosition(t=>!t.item.is("element","li")).nodeAfter,r=n.writer;r.breakContainer(r.createPositionBefore(o)),r.breakContainer(r.createPositionAfter(o));const s=o.parent,a=s.previousSibling,l=r.createRangeOn(s),c=r.remove(l);a&&a.nextSibling&&nw(r,a,a.nextSibling);kw(n.mapper.toModelElement(o).getAttribute("listIndent")+1,i.position,l.start,o,n,t);for(const t of r.createRangeIn(c).getItems())n.mapper.unbindViewElement(t);e.stop()}}(t.model)),e.on("remove",uw,{priority:"low"})}),t.conversion.for("dataDowncast").add(e=>{e.on("insert",hw,{priority:"high"}),e.on("insert:listItem",lw(t.model))}),t.conversion.for("upcast").add(t=>{t.on("element:ul",gw,{priority:"high"}),t.on("element:ol",gw,{priority:"high"}),t.on("element:li",fw,{priority:"high"}),t.on("element:li",mw)}),t.model.on("insertContent",ww,{priority:"high"}),t.commands.add("numberedList",new Jp(t,"numbered")),t.commands.add("bulletedList",new Jp(t,"bulleted")),t.commands.add("indentList",new tw(t,"forward")),t.commands.add("outdentList",new tw(t,"backward"));const o=i.view.document;this.listenTo(o,"enter",(t,e)=>{const i=this.editor.model.document,n=i.selection.getLastPosition().parent;i.selection.isCollapsed&&"listItem"==n.name&&n.isEmpty&&(this.editor.execute("outdentList"),e.preventDefault(),t.stop())},{context:"li"}),this.listenTo(o,"delete",(t,e)=>{if("backward"!==e.direction)return;const i=this.editor.model.document.selection;if(!i.isCollapsed)return;const n=i.getFirstPosition();if(!n.isAtStart)return;const o=n.parent;if("listItem"!==o.name)return;o.previousSibling&&"listItem"===o.previousSibling.name||(this.editor.execute("outdentList"),e.preventDefault(),t.stop())},{context:"li"});const r=t=>(e,i)=>{this.editor.commands.get(t).isEnabled&&(this.editor.execute(t),i())};t.keystrokes.set("Tab",r("indentList")),t.keystrokes.set("Shift+Tab",r("outdentList"))}afterInit(){const t=this.editor.commands,e=t.get("indent"),i=t.get("outdent");e&&e.registerChildCommand(t.get("indentList")),i&&i.registerChildCommand(t.get("outdentList"))}}function yw(t){let e=1;for(const i of t.getChildren())if("ul"==i.name||"ol"==i.name)for(const t of i.getChildren())e+=yw(t);return e}class xw extends Qt{static get pluginName(){return"ListUI"}init(){const t=this.editor.t;sw(this.editor,"numberedList",t("Numbered List"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M7 5.75c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zM3.5 3v5H2V3.7H1v-1h2.5V3zM.343 17.857l2.59-3.257H2.92a.6.6 0 1 0-1.04 0H.302a2 2 0 1 1 3.995 0h-.001c-.048.405-.16.734-.333.988-.175.254-.59.692-1.244 1.312H4.3v1h-4l.043-.043zM7 14.75a.75.75 0 0 1 .75-.75h9.5a.75.75 0 1 1 0 1.5h-9.5a.75.75 0 0 1-.75-.75z"/></svg>'),sw(this.editor,"bulletedList",t("Bulleted List"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M7 5.75c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zm-6 0C1 4.784 1.777 4 2.75 4c.966 0 1.75.777 1.75 1.75 0 .966-.777 1.75-1.75 1.75C1.784 7.5 1 6.723 1 5.75zm6 9c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zm-6 0c0-.966.777-1.75 1.75-1.75.966 0 1.75.777 1.75 1.75 0 .966-.777 1.75-1.75 1.75-.966 0-1.75-.777-1.75-1.75z"/></svg>')}}function Aw(t,e){return t=>{t.on("attribute:url:media",i)};function i(i,n,o){if(!o.consumable.consume(n.item,i.name))return;const r=n.attributeNewValue,s=o.writer,a=o.mapper.toViewElement(n.item),l=[...a.getChildren()].find(t=>t.getCustomProperty("media-content"));s.remove(l);const c=t.getMediaViewElement(s,r,e);s.insert(s.createPositionAt(a,0),c)}}function Cw(t,e,i,n){const o=t.createContainerElement("figure",{class:"media"});return t.insert(t.createPositionAt(o,0),e.getMediaViewElement(t,i,n)),o}function Tw(t){const e=t.getSelectedElement();return e&&e.is("element","media")?e:null}function Ew(t,e,i){t.change(n=>{const o=n.createElement("media",{url:e});t.insertContent(o,i),n.setSelection(o,"on")})}class Pw extends Zt{refresh(){const t=this.editor.model,e=t.document.selection,i=t.schema,n=Tw(e);this.value=n?n.getAttribute("url"):null,this.isEnabled=function(t){const e=t.getSelectedElement();return!!e&&"media"===e.name}(e)||function(t,e){let i=Uu(t,e).parent;i.isEmpty&&!e.schema.isLimit(i)&&(i=i.parent);return e.schema.checkChild(i,"media")}(e,t)&&!qu(e,i)}execute(t){const e=this.editor.model,i=e.document.selection,n=Tw(i);if(n)e.change(e=>{e.setAttribute("url",t,n)});else{const n=Uu(i,e);Ew(e,t,n)}}}class Sw{constructor(t,e){const i=e.providers,n=e.extraProviders||[],o=new Set(e.removeProviders),r=i.concat(n).filter(t=>{const e=t.name;return e?!o.has(e):(Object(l.b)("media-embed-no-provider-name",{provider:t}),!1)});this.locale=t,this.providerDefinitions=r}hasMedia(t){return!!this._getMedia(t)}getMediaViewElement(t,e,i){return this._getMedia(e).getViewElement(t,i)}_getMedia(t){if(!t)return new Mw(this.locale);t=t.trim();for(const e of this.providerDefinitions){const i=e.html,n=tn(e.url);for(const e of n){const n=this._getUrlMatches(t,e);if(n)return new Mw(this.locale,t,n,i)}}return null}_getUrlMatches(t,e){let i=t.match(e);if(i)return i;let n=t.replace(/^https?:\/\//,"");return i=n.match(e),i||(n=n.replace(/^www\./,""),i=n.match(e),i||null)}}class Mw{constructor(t,e,i,n){this.url=this._getValidUrl(e),this._t=t.t,this._match=i,this._previewRenderer=n}getViewElement(t,e){const i={};let n;if(e.renderForEditingView||e.renderMediaPreview&&this.url&&this._previewRenderer){this.url&&(i["data-oembed-url"]=this.url),e.renderForEditingView&&(i.class="ck-media__wrapper");const o=this._getPreviewHtml(e);n=t.createRawElement("div",i,(function(t){t.innerHTML=o}))}else this.url&&(i.url=this.url),n=t.createEmptyElement(e.elementName,i);return t.setCustomProperty("media-content",!0,n),n}_getPreviewHtml(t){return this._previewRenderer?this._previewRenderer(this._match):this.url&&t.renderForEditingView?this._getPlaceholderHtml():""}_getPlaceholderHtml(){const t=new xd,e=new yd;t.text=this._t("Open media in new tab"),e.content='<svg viewBox="0 0 64 42" xmlns="http://www.w3.org/2000/svg"><path d="M47.426 17V3.713L63.102 0v19.389h-.001l.001.272c0 1.595-2.032 3.43-4.538 4.098-2.506.668-4.538-.083-4.538-1.678 0-1.594 2.032-3.43 4.538-4.098.914-.244 2.032-.565 2.888-.603V4.516L49.076 7.447v9.556A1.014 1.014 0 0 0 49 17h-1.574zM29.5 17h-8.343a7.073 7.073 0 1 0-4.657 4.06v3.781H3.3a2.803 2.803 0 0 1-2.8-2.804V8.63a2.803 2.803 0 0 1 2.8-2.805h4.082L8.58 2.768A1.994 1.994 0 0 1 10.435 1.5h8.985c.773 0 1.477.448 1.805 1.149l1.488 3.177H26.7c1.546 0 2.8 1.256 2.8 2.805V17zm-11.637 0H17.5a1 1 0 0 0-1 1v.05A4.244 4.244 0 1 1 17.863 17zm29.684 2c.97 0 .953-.048.953.889v20.743c0 .953.016.905-.953.905H19.453c-.97 0-.953.048-.953-.905V19.89c0-.937-.016-.889.97-.889h28.077zm-4.701 19.338V22.183H24.154v16.155h18.692zM20.6 21.375v1.616h1.616v-1.616H20.6zm0 3.231v1.616h1.616v-1.616H20.6zm0 3.231v1.616h1.616v-1.616H20.6zm0 3.231v1.616h1.616v-1.616H20.6zm0 3.231v1.616h1.616v-1.616H20.6zm0 3.231v1.616h1.616V37.53H20.6zm24.233-16.155v1.616h1.615v-1.616h-1.615zm0 3.231v1.616h1.615v-1.616h-1.615zm0 3.231v1.616h1.615v-1.616h-1.615zm0 3.231v1.616h1.615v-1.616h-1.615zm0 3.231v1.616h1.615v-1.616h-1.615zm0 3.231v1.616h1.615V37.53h-1.615zM29.485 25.283a.4.4 0 0 1 .593-.35l9.05 4.977a.4.4 0 0 1 0 .701l-9.05 4.978a.4.4 0 0 1-.593-.35v-9.956z"/></svg>',e.viewBox="0 0 64 42";return new id({tag:"div",attributes:{class:"ck ck-reset_all ck-media__placeholder"},children:[{tag:"div",attributes:{class:"ck-media__placeholder__icon"},children:[e]},{tag:"a",attributes:{class:"ck-media__placeholder__url",target:"_blank",rel:"noopener noreferrer",href:this.url},children:[{tag:"span",attributes:{class:"ck-media__placeholder__url__text"},children:[this.url]},t]}]}).render().outerHTML}_getValidUrl(t){return t?t.match(/^https?/)?t:"https://"+t:null}}i(100);class Iw extends Qt{static get pluginName(){return"MediaEmbedEditing"}constructor(t){super(t),t.config.define("mediaEmbed",{elementName:"oembed",providers:[{name:"dailymotion",url:/^dailymotion\.com\/video\/(\w+)/,html:t=>`<div style="position: relative; padding-bottom: 100%; height: 0; "><iframe src="https://www.dailymotion.com/embed/video/${t[1]}" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" frameborder="0" width="480" height="270" allowfullscreen allow="autoplay"></iframe></div>`},{name:"spotify",url:[/^open\.spotify\.com\/(artist\/\w+)/,/^open\.spotify\.com\/(album\/\w+)/,/^open\.spotify\.com\/(track\/\w+)/],html:t=>`<div style="position: relative; padding-bottom: 100%; height: 0; padding-bottom: 126%;"><iframe src="https://open.spotify.com/embed/${t[1]}" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" frameborder="0" allowtransparency="true" allow="encrypted-media"></iframe></div>`},{name:"youtube",url:[/^(?:m\.)?youtube\.com\/watch\?v=([\w-]+)/,/^(?:m\.)?youtube\.com\/v\/([\w-]+)/,/^youtube\.com\/embed\/([\w-]+)/,/^youtu\.be\/([\w-]+)/],html:t=>`<div style="position: relative; padding-bottom: 100%; height: 0; padding-bottom: 56.2493%;"><iframe src="https://www.youtube.com/embed/${t[1]}" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe></div>`},{name:"vimeo",url:[/^vimeo\.com\/(\d+)/,/^vimeo\.com\/[^/]+\/[^/]+\/video\/(\d+)/,/^vimeo\.com\/album\/[^/]+\/video\/(\d+)/,/^vimeo\.com\/channels\/[^/]+\/(\d+)/,/^vimeo\.com\/groups\/[^/]+\/videos\/(\d+)/,/^vimeo\.com\/ondemand\/[^/]+\/(\d+)/,/^player\.vimeo\.com\/video\/(\d+)/],html:t=>`<div style="position: relative; padding-bottom: 100%; height: 0; padding-bottom: 56.2493%;"><iframe src="https://player.vimeo.com/video/${t[1]}" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div>`},{name:"instagram",url:/^instagram\.com\/p\/(\w+)/},{name:"twitter",url:/^twitter\.com/},{name:"googleMaps",url:[/^google\.com\/maps/,/^goo\.gl\/maps/,/^maps\.google\.com/,/^maps\.app\.goo\.gl/]},{name:"flickr",url:/^flickr\.com/},{name:"facebook",url:/^facebook\.com/}]}),this.registry=new Sw(t.locale,t.config.get("mediaEmbed"))}init(){const t=this.editor,e=t.model.schema,i=t.t,n=t.conversion,o=t.config.get("mediaEmbed.previewsInData"),r=t.config.get("mediaEmbed.elementName"),s=this.registry;t.commands.add("mediaEmbed",new Pw(t)),e.register("media",{isObject:!0,isBlock:!0,allowWhere:"$block",allowAttributes:["url"]}),n.for("dataDowncast").elementToElement({model:"media",view:(t,{writer:e})=>{const i=t.getAttribute("url");return Cw(e,s,i,{elementName:r,renderMediaPreview:i&&o})}}),n.for("dataDowncast").add(Aw(s,{elementName:r,renderMediaPreview:o})),n.for("editingDowncast").elementToElement({model:"media",view:(t,{writer:e})=>{const n=t.getAttribute("url");return function(t,e,i){return e.setCustomProperty("media",!0,t),Du(t,e,{label:i})}(Cw(e,s,n,{elementName:r,renderForEditingView:!0}),e,i("media widget"))}}),n.for("editingDowncast").add(Aw(s,{elementName:r,renderForEditingView:!0})),n.for("upcast").elementToElement({view:t=>["oembed",r].includes(t.name)&&t.getAttribute("url")?{name:!0}:null,model:(t,{writer:e})=>{const i=t.getAttribute("url");if(s.hasMedia(i))return e.createElement("media",{url:i})}}).elementToElement({view:{name:"div",attributes:{"data-oembed-url":!0}},model:(t,{writer:e})=>{const i=t.getAttribute("data-oembed-url");if(s.hasMedia(i))return e.createElement("media",{url:i})}})}}const Lw=/^(?:http(s)?:\/\/)?[\w-]+\.[\w-.~:/?#[\]@!$&'()*+,;=%]+$/;class Nw extends Qt{static get requires(){return[um,rg]}static get pluginName(){return"AutoMediaEmbed"}constructor(t){super(t),this._timeoutId=null,this._positionToInsert=null}init(){const t=this.editor,e=t.model.document;this.listenTo(t.plugins.get("ClipboardPipeline"),"inputTransformation",()=>{const t=e.selection.getFirstRange(),i=nc.fromPosition(t.start);i.stickiness="toPrevious";const n=nc.fromPosition(t.end);n.stickiness="toNext",e.once("change:data",()=>{this._embedMediaBetweenPositions(i,n),i.detach(),n.detach()},{priority:"high"})}),t.commands.get("undo").on("execute",()=>{this._timeoutId&&(_r.window.clearTimeout(this._timeoutId),this._positionToInsert.detach(),this._timeoutId=null,this._positionToInsert=null)},{priority:"high"})}_embedMediaBetweenPositions(t,e){const i=this.editor,n=i.plugins.get(Iw).registry,o=new _a(t,e),r=o.getWalker({ignoreElementEnd:!0});let s="";for(const t of r)t.item.is("$textProxy")&&(s+=t.item.data);if(s=s.trim(),!s.match(Lw))return void o.detach();if(!n.hasMedia(s))return void o.detach();i.commands.get("mediaEmbed").isEnabled?(this._positionToInsert=nc.fromPosition(t),this._timeoutId=_r.window.setTimeout(()=>{i.model.change(t=>{let e;this._timeoutId=null,t.remove(o),o.detach(),"$graveyard"!==this._positionToInsert.root.rootName&&(e=this._positionToInsert),Ew(i.model,s,e),this._positionToInsert.detach(),this._positionToInsert=null})},100)):o.detach()}}i(102);class Rw extends ed{constructor(t,e){super(e);const i=e.t;this.focusTracker=new zs,this.keystrokes=new Ds,this.set("mediaURLInputValue",""),this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(i("Save"),Lc,"ck-button-save"),this.saveButtonView.type="submit",this.saveButtonView.bind("isEnabled").to(this,"mediaURLInputValue",t=>!!t),this.cancelButtonView=this._createButton(i("Cancel"),Ic,"ck-button-cancel","cancel"),this._focusables=new td,this._focusCycler=new Pd({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this._validators=t,this.setTemplate({tag:"form",attributes:{class:["ck","ck-media-form","ck-responsive-form"],tabindex:"-1"},children:[this.urlInputView,this.saveButtonView,this.cancelButtonView]}),Zc(this)}render(){super.render(),Xc({view:this});[this.urlInputView,this.saveButtonView,this.cancelButtonView].forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element)}),this.keystrokes.listenTo(this.element);const t=t=>t.stopPropagation();this.keystrokes.set("arrowright",t),this.keystrokes.set("arrowleft",t),this.keystrokes.set("arrowup",t),this.keystrokes.set("arrowdown",t),this.listenTo(this.urlInputView.element,"selectstart",(t,e)=>{e.stopPropagation()},{priority:"high"})}focus(){this._focusCycler.focusFirst()}get url(){return this.urlInputView.fieldView.element.value.trim()}set url(t){this.urlInputView.fieldView.element.value=t.trim()}isValid(){this.resetFormStatus();for(const t of this._validators){const e=t(this);if(e)return this.urlInputView.errorText=e,!1}return!0}resetFormStatus(){this.urlInputView.errorText=null,this.urlInputView.infoText=this._urlInputViewInfoDefault}_createUrlInput(){const t=this.locale.t,e=new sh(this.locale,ah),i=e.fieldView;return this._urlInputViewInfoDefault=t("Paste the media URL in the input."),this._urlInputViewInfoTip=t("Tip: Paste the URL into the content to embed faster."),e.label=t("Media URL"),e.infoText=this._urlInputViewInfoDefault,i.on("input",()=>{e.infoText=i.element.value?this._urlInputViewInfoTip:this._urlInputViewInfoDefault,this.mediaURLInputValue=i.element.value.trim()}),e}_createButton(t,e,i,n){const o=new Ad(this.locale);return o.set({label:t,icon:e,tooltip:!0}),o.extendTemplate({attributes:{class:i}}),n&&o.delegate("execute").to(this,n),o}}class Ow extends Qt{static get requires(){return[Iw]}static get pluginName(){return"MediaEmbedUI"}init(){const t=this.editor,e=t.commands.get("mediaEmbed"),i=t.plugins.get(Iw).registry;t.ui.componentFactory.add("mediaEmbed",n=>{const o=Qd(n),r=new Rw(function(t,e){return[e=>{if(!e.url.length)return t("The URL must not be empty.")},i=>{if(!e.hasMedia(i.url))return t("This media URL is not supported.")}]}(t.t,i),t.locale);return this._setUpDropdown(o,r,e,t),this._setUpForm(o,r,e),o})}_setUpDropdown(t,e,i){const n=this.editor,o=n.t,r=t.buttonView;function s(){n.editing.view.focus(),t.isOpen=!1}t.bind("isEnabled").to(i),t.panelView.children.add(e),r.set({label:o("Insert media"),icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M18.68 3.03c.6 0 .59-.03.59.55v12.84c0 .59.01.56-.59.56H1.29c-.6 0-.59.03-.59-.56V3.58c0-.58-.01-.55.6-.55h17.38zM15.77 15V5H4.2v10h11.57zM2 4v1h1V4H2zm0 2v1h1V6H2zm0 2v1h1V8H2zm0 2v1h1v-1H2zm0 2v1h1v-1H2zm0 2v1h1v-1H2zM17 4v1h1V4h-1zm0 2v1h1V6h-1zm0 2v1h1V8h-1zm0 2v1h1v-1h-1zm0 2v1h1v-1h-1zm0 2v1h1v-1h-1zM7.5 7.177a.4.4 0 0 1 .593-.351l5.133 2.824a.4.4 0 0 1 0 .7l-5.133 2.824a.4.4 0 0 1-.593-.35V7.176v.001z"/></svg>',tooltip:!0}),r.on("open",()=>{e.disableCssTransitions(),e.url=i.value||"",e.urlInputView.fieldView.select(),e.focus(),e.enableCssTransitions()},{priority:"low"}),t.on("submit",()=>{e.isValid()&&(n.execute("mediaEmbed",e.url),s())}),t.on("change:isOpen",()=>e.resetFormStatus()),t.on("cancel",()=>s())}_setUpForm(t,e,i){e.delegate("submit","cancel").to(t),e.urlInputView.bind("value").to(i,"value"),e.urlInputView.bind("isReadOnly").to(i,"isEnabled",t=>!t)}}i(104);function zw(t,e){if(!t.childCount)return;const i=new Wh(t.document),n=function(t,e){const i=e.createRangeIn(t),n=new gn({name:/^p|h\d+$/,styles:{"mso-list":/.*/}}),o=[];for(const t of i)if("elementStart"===t.type&&n.match(t.item)){const e=jw(t.item);o.push({element:t.item,id:e.id,order:e.order,indent:e.indent})}return o}(t,i);if(!n.length)return;let o=null,r=1;n.forEach((t,s)=>{const a=function(t,e){if(!t)return!0;if(t.id!==e.id)return e.indent-t.indent!=1;const i=e.element.previousSibling;if(!i)return!0;return n=i,!(n.is("element","ol")||n.is("element","ul"));var n}(n[s-1],t),l=a?null:n[s-1],c=(h=t,(d=l)?h.indent-d.indent:h.indent-1);var d,h;if(a&&(o=null,r=1),!o||0!==c){const n=function(t,e){const i=new RegExp(`@list l${t.id}:level${t.indent}\\s*({[^}]*)`,"gi"),n=/mso-level-number-format:([^;]{0,100});/gi,o=i.exec(e);let r="decimal",s="ol";if(o&&o[1]){const e=n.exec(o[1]);if(e&&e[1]&&(r=e[1].trim(),s="bullet"!==r&&"image"!==r?"ol":"ul"),"bullet"===r){const e=function(t){const e=function(t){if(t.getChild(0).is("$text"))return null;const e=t.getChild(0).getChild(0);if(e.is("$text"))return e;return e.getChild(0)}(t);if(!e)return null;const i=e._data;if("o"===i)return"circle";if("·"===i)return"disc";if("§"===i)return"square";return null}(t.element);e&&(r=e)}}return{type:s,style:Dw(r)}}(t,e);if(o){if(t.indent>r){const t=o.getChild(o.childCount-1),e=t.getChild(t.childCount-1);o=Vw(n,e,i),r+=1}else if(t.indent<r){const e=r-t.indent;o=function(t,e){const i=t.getAncestors({parentFirst:!0});let n=null,o=0;for(const t of i)if("ul"!==t.name&&"ol"!==t.name||o++,o===e){n=t;break}return n}(o,e),r=parseInt(t.indent)}}else o=Vw(n,t.element,i);t.indent<=r&&(o.is("element",n.type)||(o=i.rename(n.type,o)))}const u=function(t,e){return function(t,e){const i=new gn({name:"span",styles:{"mso-list":"Ignore"}}),n=e.createRangeIn(t);for(const t of n)"elementStart"===t.type&&i.match(t.item)&&e.remove(t.item)}(t,e),e.rename("li",t)}(t.element,i);i.appendChild(u,o)})}function Dw(t){switch(t){case"arabic-leading-zero":return"decimal-leading-zero";case"alpha-upper":return"upper-alpha";case"alpha-lower":return"lower-alpha";case"roman-upper":return"upper-roman";case"roman-lower":return"lower-roman";case"circle":case"disc":case"square":return t;default:return null}}function Vw(t,e,i){const n=e.parent,o=i.createElement(t.type),r=n.getChildIndex(e)+1;return i.insertChild(r,o,n),t.style&&i.setStyle("list-style-type",t.style,o),o}function jw(t){const e={},i=t.getStyle("mso-list");if(i){const t=i.match(/(^|\s{1,100})l(\d+)/i),n=i.match(/\s{0,100}lfo(\d+)/i),o=i.match(/\s{0,100}level(\d+)/i);t&&n&&o&&(e.id=t[2],e.order=n[1],e.indent=o[1])}return e}const Bw=/id=("|')docs-internal-guid-[-0-9a-f]+("|')/i;class Fw{constructor(t){this.document=t}isActive(t){return Bw.test(t)}execute(t){const e=new Wh(this.document);!function(t,e){for(const i of t.getChildren())if(i.is("element","b")&&"normal"===i.getStyle("font-weight")){const n=t.getChildIndex(i);e.remove(i),e.insertChild(n,i.getChildren(),t)}}(t.content,e),function(t,e){for(const i of e.createRangeIn(t)){const t=i.item;if(t.is("element","li")){const i=t.getChild(0);i&&i.is("element","p")&&e.unwrapElement(i)}}}(t.content,e)}}function Hw(t){return t.replace(/<span(?: class="Apple-converted-space"|)>(\s+)<\/span>/g,(t,e)=>1===e.length?" ":Array(e.length+1).join("  ").substr(0,e.length))}function Uw(t,e){const i=new DOMParser,n=function(t){return Hw(Hw(t)).replace(/(<span\s+style=['"]mso-spacerun:yes['"]>[^\S\r\n]*?)[\r\n]+([^\S\r\n]*<\/span>)/g,"$1$2").replace(/<span\s+style=['"]mso-spacerun:yes['"]><\/span>/g,"").replace(/ <\//g," </").replace(/ <o:p><\/o:p>/g," <o:p></o:p>").replace(/<o:p>(&nbsp;|\u00A0)<\/o:p>/g,"").replace(/>([^\S\r\n]*[\r\n]\s*)</g,"><")}(function(t){const e=t.indexOf("</body>");if(e<0)return t;const i=t.indexOf("</html>",e+"</body>".length);return t.substring(0,e+"</body>".length)+(i>=0?t.substring(i):"")}(t=t.replace(/<!--\[if gte vml 1]>/g,""))),o=i.parseFromString(n,"text/html");!function(t){t.querySelectorAll("span[style*=spacerun]").forEach(t=>{const e=t.innerText.length||0;t.innerHTML=Array(e+1).join("  ").substr(0,e)})}(o);const r=o.body.innerHTML,s=function(t,e){const i=new vo(e),n=new Tr(i,{blockFillerMode:"nbsp"}),o=t.createDocumentFragment(),r=t.body.childNodes;for(;r.length>0;)o.appendChild(r[0]);return n.domToView(o)}(o,e),a=function(t){const e=[],i=[],n=Array.from(t.getElementsByTagName("style"));for(const t of n)t.sheet&&t.sheet.cssRules&&t.sheet.cssRules.length&&(e.push(t.sheet),i.push(t.innerHTML));return{styles:e,stylesString:i.join(" ")}}(o);return{body:s,bodyString:r,styles:a.styles,stylesString:a.stylesString}}function qw(t,e){if(!t.childCount)return;const i=new Wh;!function(t,e,i){const n=i.createRangeIn(e),o=new gn({name:"img"}),r=[];for(const e of n)if(o.match(e.item)){const i=e.item,n=i.getAttribute("v:shapes")?i.getAttribute("v:shapes").split(" "):[];n.length&&n.every(e=>t.indexOf(e)>-1)?r.push(i):i.getAttribute("src")||r.push(i)}for(const t of r)i.remove(t)}(function(t,e){const i=e.createRangeIn(t),n=new gn({name:/v:(.+)/}),o=[];for(const t of i){const e=t.item,i=e.previousSibling&&e.previousSibling.name||null;n.match(e)&&e.getAttribute("o:gfxdata")&&"v:shapetype"!==i&&o.push(t.item.getAttribute("id"))}return o}(t,i),t,i),function(t,e){const i=e.createRangeIn(t),n=new gn({name:/v:(.+)/}),o=[];for(const t of i)n.match(t.item)&&o.push(t.item);for(const t of o)e.remove(t)}(t,i);const n=function(t,e){const i=e.createRangeIn(t),n=new gn({name:"img"}),o=[];for(const t of i)n.match(t.item)&&t.item.getAttribute("src").startsWith("file://")&&o.push(t.item);return o}(t,i);n.length&&function(t,e,i){if(t.length===e.length)for(let o=0;o<t.length;o++){const r=`data:${e[o].type};base64,${n=e[o].hex,btoa(n.match(/\w{2}/g).map(t=>String.fromCharCode(parseInt(t,16))).join(""))}`;i.setAttribute("src",r,t[o])}var n}(n,function(t){if(!t)return[];const e=/{\\pict[\s\S]+?\\bliptag-?\d+(\\blipupi-?\d+)?({\\\*\\blipuid\s?[\da-fA-F]+)?[\s}]*?/,i=new RegExp("(?:("+e.source+"))([\\da-fA-F\\s]+)\\}","g"),n=t.match(i),o=[];if(n)for(const t of n){let i=!1;t.includes("\\pngblip")?i="image/png":t.includes("\\jpegblip")&&(i="image/jpeg"),i&&o.push({hex:t.replace(e,"").replace(/[^\da-fA-F]/g,""),type:i})}return o}(e),i)}const Ww=/<meta\s*name="?generator"?\s*content="?microsoft\s*word\s*\d+"?\/?>/i,$w=/xmlns:o="urn:schemas-microsoft-com/i;class Gw{constructor(t){this.document=t}isActive(t){return Ww.test(t)||$w.test(t)}execute(t){const{body:e,stylesString:i}=Uw(t.dataTransfer.getData("text/html"),this.document.stylesProcessor);zw(e,i),qw(e,t.dataTransfer.getData("text/rtf")),t.content=e}}class Yw extends Qt{static get pluginName(){return"RemoveFormatUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("removeFormat",i=>{const n=t.commands.get("removeFormat"),o=new Ad(i);return o.set({label:e("Remove Format"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M8.69 14.915c.053.052.173.083.36.093a.366.366 0 0 1 .345.485l-.003.01a.738.738 0 0 1-.697.497h-2.67a.374.374 0 0 1-.353-.496l.013-.038a.681.681 0 0 1 .644-.458c.197-.012.325-.043.386-.093a.28.28 0 0 0 .072-.11L9.592 4.5H6.269c-.359-.017-.609.013-.75.09-.142.078-.289.265-.442.563-.192.29-.516.464-.864.464H4.17a.43.43 0 0 1-.407-.569L4.46 3h13.08l-.62 2.043a.81.81 0 0 1-.775.574h-.114a.486.486 0 0 1-.486-.486c.001-.284-.054-.464-.167-.54-.112-.076-.367-.106-.766-.091h-3.28l-2.68 10.257c-.006.074.007.127.038.158zM3 17h8a.5.5 0 1 1 0 1H3a.5.5 0 1 1 0-1zm11.299 1.17a.75.75 0 1 1-1.06-1.06l1.414-1.415-1.415-1.414a.75.75 0 0 1 1.06-1.06l1.415 1.414 1.414-1.415a.75.75 0 1 1 1.06 1.06l-1.413 1.415 1.414 1.415a.75.75 0 0 1-1.06 1.06l-1.415-1.414-1.414 1.414z"/></svg>',tooltip:!0}),o.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(o,"execute",()=>{t.execute("removeFormat"),t.editing.view.focus()}),o})}}class Kw extends Zt{refresh(){const t=this.editor.model;this.isEnabled=!!Os(this._getFormattingItems(t.document.selection,t.schema))}execute(){const t=this.editor.model,e=t.schema;t.change(i=>{for(const n of this._getFormattingItems(t.document.selection,e))if(n.is("selection"))for(const t of this._getFormattingAttributes(n,e))i.removeSelectionAttribute(t);else{const t=i.createRangeOn(n);for(const o of this._getFormattingAttributes(n,e))i.removeAttribute(o,t)}})}*_getFormattingItems(t,e){const i=t=>!!Os(this._getFormattingAttributes(t,e));for(const n of t.getRanges())for(const t of n.getItems())!e.isBlock(t)&&i(t)&&(yield t);for(const e of t.getSelectedBlocks())i(e)&&(yield e);i(t)&&(yield t)}*_getFormattingAttributes(t,e){for(const[i]of t.getAttributes()){const t=e.getAttributeProperties(i);t&&t.isFormatting&&(yield i)}}}class Qw extends Qt{static get pluginName(){return"RemoveFormatEditing"}init(){const t=this.editor;t.commands.add("removeFormat",new Kw(t))}}function Jw(t,e,i,n,o=1){e>o?n.setAttribute(t,e,i):n.removeAttribute(t,i)}function Zw(t,e,i={}){const n=t.createElement("tableCell",i);return t.insertElement("paragraph",n),t.insert(n,e),n}function Xw(t,e){const i=e.parent.parent,n=parseInt(i.getAttribute("headingColumns")||0),{column:o}=t.getCellLocation(e);return!!n&&o<n}function tb(){return t=>{t.on("element:table",(t,e,i)=>{const n=e.viewItem;if(!i.consumable.test(n,{name:!0}))return;const{rows:o,headingRows:r,headingColumns:s}=function(t){const e={headingRows:0,headingColumns:0},i=[],n=[];let o;for(const r of Array.from(t.getChildren()))if("tbody"===r.name||"thead"===r.name||"tfoot"===r.name){"thead"!==r.name||o||(o=r);const t=Array.from(r.getChildren()).filter(t=>t.is("element","tr"));for(const r of t)if("thead"===r.parent.name&&r.parent===o)e.headingRows++,i.push(r);else{n.push(r);const t=ib(r);t>e.headingColumns&&(e.headingColumns=t)}}return e.rows=[...i,...n],e}(n),a={};s&&(a.headingColumns=s),r&&(a.headingRows=r);const l=i.writer.createElement("table",a);if(i.safeInsert(l,e.modelCursor)){if(i.consumable.consume(n,{name:!0}),o.forEach(t=>i.convertItem(t,i.writer.createPositionAt(l,"end"))),i.convertChildren(n,i.writer.createPositionAt(l,"end")),l.isEmpty){const t=i.writer.createElement("tableRow");i.writer.insert(t,i.writer.createPositionAt(l,"end")),Zw(i.writer,i.writer.createPositionAt(t,"end"))}i.updateConversionResult(l,e)}})}}function eb(t){return e=>{e.on("element:"+t,(t,e,i)=>{if(e.modelRange&&e.viewItem.isEmpty){const t=e.modelRange.start.nodeAfter,n=i.writer.createPositionAt(t,0);i.writer.insertElement("paragraph",n)}},{priority:"low"})}}function ib(t){let e=0,i=0;const n=Array.from(t.getChildren()).filter(t=>"th"===t.name||"td"===t.name);for(;i<n.length&&"th"===n[i].name;){const t=n[i];e+=parseInt(t.getAttribute("colspan")||1),i++}return e}class nb{constructor(t,e={}){this._table=t,this._startRow=void 0!==e.row?e.row:e.startRow||0,this._endRow=void 0!==e.row?e.row:e.endRow,this._startColumn=void 0!==e.column?e.column:e.startColumn||0,this._endColumn=void 0!==e.column?e.column:e.endColumn,this._includeAllSlots=!!e.includeAllSlots,this._skipRows=new Set,this._row=0,this._rowIndex=0,this._column=0,this._cellIndex=0,this._spannedCells=new Map,this._nextCellAtColumn=-1}[Symbol.iterator](){return this}next(){const t=this._table.getChild(this._rowIndex);if(!t||this._isOverEndRow())return{done:!0};if(!t.is("element","tableRow"))return this._rowIndex++,this.next();if(this._isOverEndColumn())return this._advanceToNextRow();let e=null;const i=this._getSpanned();if(i)this._includeAllSlots&&!this._shouldSkipSlot()&&(e=this._formatOutValue(i.cell,i.row,i.column));else{const i=t.getChild(this._cellIndex);if(!i)return this._advanceToNextRow();const n=parseInt(i.getAttribute("colspan")||1),o=parseInt(i.getAttribute("rowspan")||1);(n>1||o>1)&&this._recordSpans(i,o,n),this._shouldSkipSlot()||(e=this._formatOutValue(i)),this._nextCellAtColumn=this._column+n}return this._column++,this._column==this._nextCellAtColumn&&this._cellIndex++,e||this.next()}skipRow(t){this._skipRows.add(t)}_advanceToNextRow(){return this._row++,this._rowIndex++,this._column=0,this._cellIndex=0,this._nextCellAtColumn=-1,this.next()}_isOverEndRow(){return void 0!==this._endRow&&this._row>this._endRow}_isOverEndColumn(){return void 0!==this._endColumn&&this._column>this._endColumn}_formatOutValue(t,e=this._row,i=this._column){return{done:!1,value:new ob(this,t,e,i)}}_shouldSkipSlot(){const t=this._skipRows.has(this._row),e=this._row<this._startRow,i=this._column<this._startColumn,n=void 0!==this._endColumn&&this._column>this._endColumn;return t||e||i||n}_getSpanned(){const t=this._spannedCells.get(this._row);return t&&t.get(this._column)||null}_recordSpans(t,e,i){const n={cell:t,row:this._row,column:this._column};for(let t=this._row;t<this._row+e;t++)for(let e=this._column;e<this._column+i;e++)t==this._row&&e==this._column||this._markSpannedCell(t,e,n)}_markSpannedCell(t,e,i){this._spannedCells.has(t)||this._spannedCells.set(t,new Map);this._spannedCells.get(t).set(e,i)}}class ob{constructor(t,e,i,n){this.cell=e,this.row=t._row,this.column=t._column,this.cellAnchorRow=i,this.cellAnchorColumn=n,this._cellIndex=t._cellIndex,this._rowIndex=t._rowIndex,this._table=t._table}get isAnchor(){return this.row===this.cellAnchorRow&&this.column===this.cellAnchorColumn}get cellWidth(){return parseInt(this.cell.getAttribute("colspan")||1)}get cellHeight(){return parseInt(this.cell.getAttribute("rowspan")||1)}get rowIndex(){return this._rowIndex}getPositionBefore(){return this._table.root.document.model.createPositionAt(this._table.getChild(this.row),this._cellIndex)}}function rb(t={}){return e=>e.on("insert:table",(e,i,n)=>{const o=i.item;if(!n.consumable.consume(o,"insert"))return;n.consumable.consume(o,"attribute:headingRows:table"),n.consumable.consume(o,"attribute:headingColumns:table");const r=t&&t.asWidget,s=n.writer.createContainerElement("figure",{class:"table"}),a=n.writer.createContainerElement("table");let l;var c,d;n.writer.insert(n.writer.createPositionAt(s,0),a),r&&(c=s,(d=n.writer).setCustomProperty("table",!0,c),l=Du(c,d,{hasSelectionHandle:!0}));const h=new nb(o),u={headingRows:o.getAttribute("headingRows")||0,headingColumns:o.getAttribute("headingColumns")||0},m=new Map;for(const e of h){const{row:i,cell:r}=e,s=o.getChild(i),l=m.get(i)||db(a,s,i,u,n);m.set(i,l),n.consumable.consume(r,"insert");cb(e,u,n.writer.createPositionAt(l,"end"),n,t)}for(const t of o.getChildren()){const e=t.index;t.is("element","tableRow")&&!m.has(e)&&m.set(e,db(a,t,e,u,n))}const g=n.mapper.toViewPosition(i.range.start);n.mapper.bindElements(o,r?l:s),n.writer.insert(g,r?l:s)})}function sb(t,e){const{writer:i}=e;if(t.parent.is("element","tableCell"))return ab(t)?i.createContainerElement("span",{style:"display:inline-block"}):i.createContainerElement("p")}function ab(t){return 1===t.parent.childCount&&!gb(t)}function lb(t,e,i){const{cell:n}=t,o=hb(t,e),r=i.mapper.toViewElement(n);r&&r.name!==o&&function(t,e,i){const n=i.writer,o=i.mapper.toViewElement(t),r=Hu(n.createEditableElement(e,o.getAttributes()),n);Bu(r,n,(t,e,i)=>i.addClass(tn(e.classes),t),(t,e,i)=>i.removeClass(tn(e.classes),t)),n.insert(n.createPositionAfter(o),r),n.move(n.createRangeIn(o),n.createPositionAt(r,0)),n.remove(n.createRangeOn(o)),i.mapper.unbindViewElement(o),i.mapper.bindElements(t,r)}(n,o,i)}function cb(t,e,i,n,o){const r=o&&o.asWidget,s=hb(t,e),a=r?Hu(n.writer.createEditableElement(s),n.writer):n.writer.createContainerElement(s);r&&Bu(a,n.writer,(t,e,i)=>i.addClass(tn(e.classes),t),(t,e,i)=>i.removeClass(tn(e.classes),t));const l=t.cell,c=l.getChild(0),d=1===l.childCount&&"paragraph"===c.name;if(n.writer.insert(i,a),n.mapper.bindElements(l,a),!r&&d&&!gb(c)){const t=l.getChild(0);n.consumable.consume(t,"insert"),n.mapper.bindElements(t,a)}}function db(t,e,i,n,o){o.consumable.consume(e,"insert");const r=e.isEmpty?o.writer.createEmptyElement("tr"):o.writer.createContainerElement("tr");o.mapper.bindElements(e,r);const s=n.headingRows,a=function(t,e,i){const n=ub(t,e);return n||function(t,e,i){const n=i.writer.createContainerElement(t),o=i.writer.createPositionAt(e,"tbody"==t?"end":0);return i.writer.insert(o,n),n}(t,e,i)}(function(t,e){return t<e.headingRows?"thead":"tbody"}(i,n),t,o),l=s>0&&i>=s?i-s:i,c=o.writer.createPositionAt(a,l);return o.writer.insert(c,r),r}function hb(t,e){const{row:i,column:n}=t,{headingColumns:o,headingRows:r}=e;if(r&&r>i)return"th";return o&&o>n?"th":"td"}function ub(t,e){for(const i of e.getChildren())if(i.name==t)return i}function mb(t,e,i){const n=ub(t,e);n&&0===n.childCount&&i.writer.remove(i.writer.createRangeOn(n))}function gb(t){return!![...t.getAttributeKeys()].length}class fb extends Zt{refresh(){const t=this.editor.model,e=t.document.selection,i=t.schema;this.isEnabled=function(t,e){const i=t.getFirstPosition().parent,n=i===i.root?i:i.parent;return e.checkChild(n,"table")}(e,i)&&!qu(e,i)}execute(t={}){const e=this.editor.model,i=e.document.selection,n=this.editor.plugins.get("TableUtils"),o=Uu(i,e);e.change(i=>{const r=n.createTable(i,t);e.insertContent(r,o),i.setSelection(i.createPositionAt(r.getNodeByPath([0,0,0]),0))})}}function pb(t){const e=[];for(const i of yb(t.getRanges())){const t=i.getContainedElement();t&&t.is("element","tableCell")&&e.push(t)}return e}function wb(t){const e=[];for(const i of t.getRanges()){const t=i.start.findAncestor("tableCell");t&&e.push(t)}return e}function bb(t){const e=pb(t);return e.length?e:wb(t)}function kb(t){return xb(t.map(t=>t.parent.index))}function _b(t){const e=t[0].findAncestor("table");return xb([...new nb(e)].filter(e=>t.includes(e.cell)).map(t=>t.column))}function vb(t,e){if(t.length<2||!function(t){const e=t[0].findAncestor("table"),i=kb(t),n=parseInt(e.getAttribute("headingRows")||0);if(!Cb(i,n))return!1;const o=parseInt(e.getAttribute("headingColumns")||0);return Cb(_b(t),o)}(t))return!1;const i=new Set,n=new Set;let o=0;for(const r of t){const{row:t,column:s}=e.getCellLocation(r),a=parseInt(r.getAttribute("rowspan")||1),l=parseInt(r.getAttribute("colspan")||1);i.add(t),n.add(s),a>1&&i.add(t+a-1),l>1&&n.add(s+l-1),o+=a*l}return function(t,e){const i=Array.from(t.values()),n=Array.from(e.values()),o=Math.max(...i),r=Math.min(...i),s=Math.max(...n),a=Math.min(...n);return(o-r+1)*(s-a+1)}(i,n)==o}function yb(t){return Array.from(t).sort(Ab)}function xb(t){const e=t.sort((t,e)=>t-e);return{first:e[0],last:e[e.length-1]}}function Ab(t,e){const i=t.start,n=e.start;return i.isBefore(n)?-1:1}function Cb({first:t,last:e},i){return t<i===e<i}class Tb extends Zt{constructor(t,e={}){super(t),this.order=e.order||"below"}refresh(){const t=!!bb(this.editor.model.document.selection).length;this.isEnabled=t}execute(){const t=this.editor,e=t.model.document.selection,i=t.plugins.get("TableUtils"),n="above"===this.order,o=bb(e),r=kb(o),s=n?r.first:r.last,a=o[0].findAncestor("table");i.insertRows(a,{at:n?s:s+1,copyStructureFromAbove:!n})}}class Eb extends Zt{constructor(t,e={}){super(t),this.order=e.order||"right"}refresh(){const t=!!bb(this.editor.model.document.selection).length;this.isEnabled=t}execute(){const t=this.editor,e=t.model.document.selection,i=t.plugins.get("TableUtils"),n="left"===this.order,o=bb(e),r=_b(o),s=n?r.first:r.last,a=o[0].findAncestor("table");i.insertColumns(a,{columns:1,at:n?s:s+1})}}class Pb extends Zt{constructor(t,e={}){super(t),this.direction=e.direction||"horizontally"}refresh(){const t=bb(this.editor.model.document.selection);this.isEnabled=1===t.length}execute(){const t=bb(this.editor.model.document.selection)[0],e="horizontally"===this.direction,i=this.editor.plugins.get("TableUtils");e?i.splitCellHorizontally(t,2):i.splitCellVertically(t,2)}}function Sb(t,e,i){const{startRow:n,startColumn:o,endRow:r,endColumn:s}=e,a=i.createElement("table"),l=r-n+1;for(let t=0;t<l;t++)i.insertElement("tableRow",a,"end");const c=[...new nb(t,{startRow:n,endRow:r,startColumn:o,endColumn:s,includeAllSlots:!0})];for(const{row:t,column:e,cell:l,isAnchor:d,cellAnchorRow:h,cellAnchorColumn:u}of c){const c=t-n,m=a.getChild(c);if(d){const n=i.cloneElement(l);i.append(n,m),Rb(n,t,e,r,s,i)}else(h<n||u<o)&&Zw(i,i.createPositionAt(m,"end"))}return function(t,e,i,n,o){const r=parseInt(e.getAttribute("headingRows")||0);if(r>0){Jw("headingRows",r-i,t,o,0)}const s=parseInt(e.getAttribute("headingColumns")||0);if(s>0){Jw("headingColumns",s-n,t,o,0)}}(a,t,n,o,i),a}function Mb(t,e,i=0){const n=[],o=new nb(t,{startRow:i,endRow:e-1});for(const t of o){const{row:i,cellHeight:o}=t,r=i+o-1;i<e&&e<=r&&n.push(t)}return n}function Ib(t,e,i){const n=t.parent,o=n.parent,r=n.index,s=e-r,a={},l=parseInt(t.getAttribute("rowspan"))-s;l>1&&(a.rowspan=l);const c=parseInt(t.getAttribute("colspan")||1);c>1&&(a.colspan=c);const d=r+s,h=[...new nb(o,{startRow:r,endRow:d,includeAllSlots:!0})];let u,m=null;for(const e of h){const{row:n,column:o,cell:r}=e;r===t&&void 0===u&&(u=o),void 0!==u&&u===o&&n===d&&(m=Zw(i,e.getPositionBefore(),a))}return Jw("rowspan",s,t,i),m}function Lb(t,e){const i=[],n=new nb(t);for(const t of n){const{column:n,cellWidth:o}=t,r=n+o-1;n<e&&e<=r&&i.push(t)}return i}function Nb(t,e,i,n){const o=i-e,r={},s=parseInt(t.getAttribute("colspan"))-o;s>1&&(r.colspan=s);const a=parseInt(t.getAttribute("rowspan")||1);a>1&&(r.rowspan=a);const l=Zw(n,n.createPositionAfter(t),r);return Jw("colspan",o,t,n),l}function Rb(t,e,i,n,o,r){const s=parseInt(t.getAttribute("colspan")||1),a=parseInt(t.getAttribute("rowspan")||1);if(i+s-1>o){Jw("colspan",o-i+1,t,r,1)}if(e+a-1>n){Jw("rowspan",n-e+1,t,r,1)}}function Ob(t,e){const i=e.getColumns(t),n=new Array(i).fill(0);for(const{column:e}of new nb(t))n[e]++;const o=n.reduce((t,e,i)=>e?t:[...t,i],[]);if(o.length>0){const i=o[o.length-1];return e.removeColumns(t,{at:i}),!0}return!1}function zb(t,e){const i=[],n=e.getRows(t);for(let e=0;e<n;e++){t.getChild(e).isEmpty&&i.push(e)}if(i.length>0){const n=i[i.length-1];return e.removeRows(t,{at:n}),!0}return!1}function Db(t,e){Ob(t,e)||zb(t,e)}function Vb(t,e){const i=Array.from(new nb(t,{startColumn:e.firstColumn,endColumn:e.lastColumn,row:e.lastRow}));if(i.every(({cellHeight:t})=>1===t))return e.lastRow;const n=i[0].cellHeight-1;return e.lastRow+n}function jb(t,e){const i=Array.from(new nb(t,{startRow:e.firstRow,endRow:e.lastRow,column:e.lastColumn}));if(i.every(({cellWidth:t})=>1===t))return e.lastColumn;const n=i[0].cellWidth-1;return e.lastColumn+n}class Bb extends Zt{constructor(t,e){super(t),this.direction=e.direction,this.isHorizontal="right"==this.direction||"left"==this.direction}refresh(){const t=this._getMergeableCell();this.value=t,this.isEnabled=!!t}execute(){const t=this.editor.model,e=wb(t.document.selection)[0],i=this.value,n=this.direction;t.change(t=>{const o="right"==n||"down"==n,r=o?e:i,s=o?i:e,a=s.parent;!function(t,e,i){Fb(t)||(Fb(e)&&i.remove(i.createRangeIn(e)),i.move(i.createRangeIn(t),i.createPositionAt(e,"end")));i.remove(t)}(s,r,t);const l=this.isHorizontal?"colspan":"rowspan",c=parseInt(e.getAttribute(l)||1),d=parseInt(i.getAttribute(l)||1);t.setAttribute(l,c+d,r),t.setSelection(t.createRangeIn(r));const h=this.editor.plugins.get("TableUtils");Db(a.findAncestor("table"),h)})}_getMergeableCell(){const t=wb(this.editor.model.document.selection)[0];if(!t)return;const e=this.editor.plugins.get("TableUtils"),i=this.isHorizontal?function(t,e,i){const n=t.parent.parent,o="right"==e?t.nextSibling:t.previousSibling,r=(n.getAttribute("headingColumns")||0)>0;if(!o)return;const s="right"==e?t:o,a="right"==e?o:t,{column:l}=i.getCellLocation(s),{column:c}=i.getCellLocation(a),d=parseInt(s.getAttribute("colspan")||1),h=Xw(i,s),u=Xw(i,a);if(r&&h!=u)return;return l+d===c?o:void 0}(t,this.direction,e):function(t,e,i){const n=t.parent,o=n.parent,r=o.getChildIndex(n);if("down"==e&&r===i.getRows(o)-1||"up"==e&&0===r)return;const s=parseInt(t.getAttribute("rowspan")||1),a=o.getAttribute("headingRows")||0,l="down"==e&&r+s===a,c="up"==e&&r===a;if(a&&(l||c))return;const d=parseInt(t.getAttribute("rowspan")||1),h="down"==e?r+d:r,u=[...new nb(o,{endRow:h})],m=u.find(e=>e.cell===t).column,g=u.find(({row:t,cellHeight:i,column:n})=>n===m&&("down"==e?t===h:h===t+i));return g&&g.cell}(t,this.direction,e);if(!i)return;const n=this.isHorizontal?"rowspan":"colspan",o=parseInt(t.getAttribute(n)||1);return parseInt(i.getAttribute(n)||1)===o?i:void 0}}function Fb(t){return 1==t.childCount&&t.getChild(0).is("element","paragraph")&&t.getChild(0).isEmpty}class Hb extends Zt{refresh(){const t=bb(this.editor.model.document.selection),e=t[0];if(e){const i=e.findAncestor("table"),n=this.editor.plugins.get("TableUtils").getRows(i)-1,o=kb(t),r=0===o.first&&o.last===n;this.isEnabled=!r}else this.isEnabled=!1}execute(){const t=this.editor.model,e=this.editor.plugins.get("TableUtils"),i=bb(t.document.selection),n=kb(i),o=i[0],r=o.findAncestor("table"),s=e.getCellLocation(o).column;t.change(t=>{const i=n.last-n.first+1;e.removeRows(r,{at:n.first,rows:i});const o=function(t,e,i,n){const o=t.getChild(Math.min(e,n-1));let r=o.getChild(0),s=0;for(const t of o.getChildren()){if(s>i)return r;r=t,s+=parseInt(t.getAttribute("colspan")||1)}return r}(r,n.first,s,e.getRows(r));t.setSelection(t.createPositionAt(o,0))})}}class Ub extends Zt{refresh(){const t=bb(this.editor.model.document.selection),e=t[0];if(e){const i=e.findAncestor("table"),n=this.editor.plugins.get("TableUtils").getColumns(i),{first:o,last:r}=_b(t);this.isEnabled=r-o<n-1}else this.isEnabled=!1}execute(){const[t,e]=function(t){const e=bb(t),i=e[0],n=e.pop(),o=[i,n];return i.isBefore(n)?o:o.reverse()}(this.editor.model.document.selection),i=t.parent.parent,n=[...new nb(i)],o={first:n.find(e=>e.cell===t).column,last:n.find(t=>t.cell===e).column},r=function(t,e,i,n){return parseInt(i.getAttribute("colspan")||1)>1?i:e.previousSibling||i.nextSibling?i.nextSibling||e.previousSibling:n.first?t.reverse().find(({column:t})=>t<n.first).cell:t.reverse().find(({column:t})=>t>n.last).cell}(n,t,e,o);this.editor.model.change(t=>{const e=o.last-o.first+1;this.editor.plugins.get("TableUtils").removeColumns(i,{at:o.first,columns:e}),t.setSelection(t.createPositionAt(r,0))})}}class qb extends Zt{refresh(){const t=bb(this.editor.model.document.selection),e=t.length>0;this.isEnabled=e,this.value=e&&t.every(t=>this._isInHeading(t,t.parent.parent))}execute(t={}){if(t.forceValue===this.value)return;const e=this.editor.model,i=bb(e.document.selection),n=i[0].findAncestor("table"),{first:o,last:r}=kb(i),s=this.value?o:r+1,a=n.getAttribute("headingRows")||0;e.change(t=>{if(s){const e=Mb(n,s,s>a?a:0);for(const{cell:i}of e)Ib(i,s,t)}Jw("headingRows",s,n,t,0)})}_isInHeading(t,e){const i=parseInt(e.getAttribute("headingRows")||0);return!!i&&t.parent.index<i}}class Wb extends Zt{refresh(){const t=bb(this.editor.model.document.selection),e=this.editor.plugins.get("TableUtils"),i=t.length>0;this.isEnabled=i,this.value=i&&t.every(t=>Xw(e,t))}execute(t={}){if(t.forceValue===this.value)return;const e=this.editor.model,i=bb(e.document.selection),n=i[0].findAncestor("table"),{first:o,last:r}=_b(i),s=this.value?o:r+1;e.change(t=>{if(s){const e=Lb(n,s);for(const{cell:i,column:n}of e)Nb(i,n,s,t)}Jw("headingColumns",s,n,t,0)})}}class $b extends Qt{static get pluginName(){return"TableUtils"}init(){this.decorate("insertColumns"),this.decorate("insertRows")}getCellLocation(t){const e=t.parent,i=e.parent,n=i.getChildIndex(e),o=new nb(i,{row:n});for(const{cell:e,row:i,column:n}of o)if(e===t)return{row:i,column:n}}createTable(t,e){const i=t.createElement("table");return Gb(t,i,0,parseInt(e.rows)||2,parseInt(e.columns)||2),e.headingRows&&Jw("headingRows",e.headingRows,i,t,0),e.headingColumns&&Jw("headingColumns",e.headingColumns,i,t,0),i}insertRows(t,e={}){const i=this.editor.model,n=e.at||0,o=e.rows||1,r=void 0!==e.copyStructureFromAbove,s=e.copyStructureFromAbove?n-1:n,a=this.getRows(t),c=this.getColumns(t);if(n>a)throw new l.a("tableutils-insertrows-insert-out-of-range",this,{options:e});i.change(e=>{const i=t.getAttribute("headingRows")||0;if(i>n&&Jw("headingRows",i+o,t,e,0),!r&&(0===n||n===a))return void Gb(e,t,n,o,c);const l=r?Math.max(n,s):n,d=new nb(t,{endRow:l}),h=new Array(c).fill(1);for(const{row:t,column:i,cellHeight:a,cellWidth:l,cell:c}of d){const d=t+a-1,u=t<=s&&s<=d;t<n&&n<=d?(e.setAttribute("rowspan",a+o,c),h[i]=-l):r&&u&&(h[i]=l)}for(let i=0;i<o;i++){const i=e.createElement("tableRow");e.insert(i,t,n);for(let t=0;t<h.length;t++){const n=h[t],o=e.createPositionAt(i,"end");n>0&&Zw(e,o,n>1?{colspan:n}:null),t+=Math.abs(n)-1}}})}insertColumns(t,e={}){const i=this.editor.model,n=e.at||0,o=e.columns||1;i.change(e=>{const i=t.getAttribute("headingColumns");n<i&&e.setAttribute("headingColumns",i+o,t);const r=this.getColumns(t);if(0===n||r===n){for(const i of t.getChildren())i.is("element","tableRow")&&Yb(o,e,e.createPositionAt(i,n?"end":0));return}const s=new nb(t,{column:n,includeAllSlots:!0});for(const t of s){const{row:i,cell:r,cellAnchorColumn:a,cellAnchorRow:l,cellWidth:c,cellHeight:d}=t;if(a<n){e.setAttribute("colspan",c+o,r);const t=l+d-1;for(let e=i;e<=t;e++)s.skipRow(e)}else Yb(o,e,t.getPositionBefore())}})}removeRows(t,e){const i=this.editor.model,n=e.rows||1,o=this.getRows(t),r=e.at,s=r+n-1;if(s>o-1)throw new l.a("tableutils-removerows-row-index-out-of-range",this,{table:t,options:e});i.change(e=>{const{cellsToMove:i,cellsToTrim:n}=function(t,e,i){const n=new Map,o=[];for(const{row:r,column:s,cellHeight:a,cell:l}of new nb(t,{endRow:i})){const t=r+a-1;if(r>=e&&r<=i&&t>i){const t=a-(i-r+1);n.set(s,{cell:l,rowspan:t})}if(r<e&&t>=e){let n;n=t>=i?i-e+1:t-e+1,o.push({cell:l,rowspan:a-n})}}return{cellsToMove:n,cellsToTrim:o}}(t,r,s);if(i.size){!function(t,e,i,n){const o=[...new nb(t,{includeAllSlots:!0,row:e})],r=t.getChild(e);let s;for(const{column:t,cell:e,isAnchor:a}of o)if(i.has(t)){const{cell:e,rowspan:o}=i.get(t),a=s?n.createPositionAfter(s):n.createPositionAt(r,0);n.move(n.createRangeOn(e),a),Jw("rowspan",o,e,n),s=e}else a&&(s=e)}(t,s+1,i,e)}for(let i=s;i>=r;i--)e.remove(t.getChild(i));for(const{rowspan:t,cell:i}of n)Jw("rowspan",t,i,e);!function(t,e,i,n){const o=t.getAttribute("headingRows")||0;if(e<o){Jw("headingRows",i<o?o-(i-e+1):e,t,n,0)}}(t,r,s,e),Ob(t,this)||zb(t,this)})}removeColumns(t,e){const i=this.editor.model,n=e.at,o=e.columns||1,r=e.at+o-1;i.change(e=>{!function(t,e,i){const n=t.getAttribute("headingColumns")||0;if(n&&e.first<n){const o=Math.min(n-1,e.last)-e.first+1;i.setAttribute("headingColumns",n-o,t)}}(t,{first:n,last:r},e);for(let i=r;i>=n;i--)for(const{cell:n,column:o,cellWidth:r}of[...new nb(t)])o<=i&&r>1&&o+r>i?Jw("colspan",r-1,n,e):o===i&&e.remove(n);zb(t,this)||Ob(t,this)})}splitCellVertically(t,e=2){const i=this.editor.model,n=t.parent.parent,o=parseInt(t.getAttribute("rowspan")||1),r=parseInt(t.getAttribute("colspan")||1);i.change(i=>{if(r>1){const{newCellsSpan:n,updatedSpan:s}=Kb(r,e);Jw("colspan",s,t,i);const a={};n>1&&(a.colspan=n),o>1&&(a.rowspan=o);Yb(r>e?e-1:r-1,i,i.createPositionAfter(t),a)}if(r<e){const s=e-r,a=[...new nb(n)],{column:l}=a.find(({cell:e})=>e===t),c=a.filter(({cell:e,cellWidth:i,column:n})=>e!==t&&n===l||n<l&&n+i>l);for(const{cell:t,cellWidth:e}of c)i.setAttribute("colspan",e+s,t);const d={};o>1&&(d.rowspan=o),Yb(s,i,i.createPositionAfter(t),d);const h=n.getAttribute("headingColumns")||0;h>l&&Jw("headingColumns",h+s,n,i)}})}splitCellHorizontally(t,e=2){const i=this.editor.model,n=t.parent,o=n.parent,r=o.getChildIndex(n),s=parseInt(t.getAttribute("rowspan")||1),a=parseInt(t.getAttribute("colspan")||1);i.change(i=>{if(s>1){const n=[...new nb(o,{startRow:r,endRow:r+s-1,includeAllSlots:!0})],{newCellsSpan:l,updatedSpan:c}=Kb(s,e);Jw("rowspan",c,t,i);const{column:d}=n.find(({cell:e})=>e===t),h={};l>1&&(h.rowspan=l),a>1&&(h.colspan=a);for(const t of n){const{column:e,row:n}=t,o=e===d,s=(n+r+c)%l==0;n>=r+c&&o&&s&&Yb(1,i,t.getPositionBefore(),h)}}if(s<e){const n=e-s,l=[...new nb(o,{startRow:0,endRow:r})];for(const{cell:e,cellHeight:o,row:s}of l)if(e!==t&&s+o>r){const t=o+n;i.setAttribute("rowspan",t,e)}const c={};a>1&&(c.colspan=a),Gb(i,o,r+1,n,1,c);const d=o.getAttribute("headingRows")||0;d>r&&Jw("headingRows",d+n,o,i)}})}getColumns(t){return[...t.getChild(0).getChildren()].reduce((t,e)=>t+parseInt(e.getAttribute("colspan")||1),0)}getRows(t){return Array.from(t.getChildren()).reduce((t,e)=>e.is("element","tableRow")?t+1:t,0)}}function Gb(t,e,i,n,o,r={}){for(let s=0;s<n;s++){const n=t.createElement("tableRow");t.insert(n,e,i),Yb(o,t,t.createPositionAt(n,"end"),r)}}function Yb(t,e,i,n={}){for(let o=0;o<t;o++)Zw(e,i,n)}function Kb(t,e){if(t<e)return{newCellsSpan:1,updatedSpan:1};const i=Math.floor(t/e);return{newCellsSpan:i,updatedSpan:t-i*e+i}}class Qb extends Zt{refresh(){const t=pb(this.editor.model.document.selection);this.isEnabled=vb(t,this.editor.plugins.get($b))}execute(){const t=this.editor.model,e=this.editor.plugins.get($b);t.change(i=>{const n=pb(t.document.selection),o=n.shift(),{mergeWidth:r,mergeHeight:s}=function(t,e,i){let n=0,o=0;for(const t of e){const{row:e,column:r}=i.getCellLocation(t);n=Xb(t,r,n,"colspan"),o=Xb(t,e,o,"rowspan")}const{row:r,column:s}=i.getCellLocation(t);return{mergeWidth:n-s,mergeHeight:o-r}}(o,n,e);Jw("colspan",r,o,i),Jw("rowspan",s,o,i);for(const t of n)Jb(t,o,i);Db(o.findAncestor("table"),e),i.setSelection(o,"in")})}}function Jb(t,e,i){Zb(t)||(Zb(e)&&i.remove(i.createRangeIn(e)),i.move(i.createRangeIn(t),i.createPositionAt(e,"end"))),i.remove(t)}function Zb(t){return 1==t.childCount&&t.getChild(0).is("element","paragraph")&&t.getChild(0).isEmpty}function Xb(t,e,i,n){const o=parseInt(t.getAttribute(n)||1);return Math.max(i,e+o)}class tk extends Zt{refresh(){const t=bb(this.editor.model.document.selection);this.isEnabled=t.length>0}execute(){const t=this.editor.model,e=bb(t.document.selection),i=kb(e),n=e[0].findAncestor("table"),o=[];for(let e=i.first;e<=i.last;e++)for(const i of n.getChild(e).getChildren())o.push(t.createRangeOn(i));t.change(t=>{t.setSelection(o)})}}class ek extends Zt{refresh(){const t=bb(this.editor.model.document.selection);this.isEnabled=t.length>0}execute(){const t=this.editor.model,e=bb(t.document.selection),i=e[0],n=e.pop(),o=i.findAncestor("table"),r=this.editor.plugins.get("TableUtils"),s=r.getCellLocation(i),a=r.getCellLocation(n),l=Math.min(s.column,a.column),c=Math.max(s.column,a.column),d=[];for(const e of new nb(o,{startColumn:l,endColumn:c}))d.push(t.createRangeOn(e.cell));t.change(t=>{t.setSelection(d)})}}function ik(t){t.document.registerPostFixer(e=>function(t,e){const i=e.document.differ.getChanges();let n=!1;const o=new Set;for(const e of i){let i;"table"==e.name&&"insert"==e.type&&(i=e.position.nodeAfter),"tableRow"!=e.name&&"tableCell"!=e.name||(i=e.position.findAncestor("table")),rk(e)&&(i=e.range.start.findAncestor("table")),i&&!o.has(i)&&(n=nk(i,t)||n,n=ok(i,t)||n,o.add(i))}return n}(e,t))}function nk(t,e){let i=!1;const n=function(t){const e=parseInt(t.getAttribute("headingRows")||0),i=Array.from(t.getChildren()).reduce((t,e)=>e.is("element","tableRow")?t+1:t,0),n=[];for(const{row:o,cell:r,cellHeight:s}of new nb(t)){if(s<2)continue;const t=o<e?e:i;if(o+s>t){const e=t-o;n.push({cell:r,rowspan:e})}}return n}(t);if(n.length){i=!0;for(const t of n)Jw("rowspan",t.rowspan,t.cell,e,1)}return i}function ok(t,e){let i=!1;const n=function(t){const e=new Array(t.childCount).fill(0);for(const{rowIndex:i}of new nb(t,{includeAllSlots:!0}))e[i]++;return e}(t),o=[];for(const[e,i]of n.entries())!i&&t.getChild(e).is("element","tableRow")&&o.push(e);if(o.length){i=!0;for(const i of o.reverse())e.remove(t.getChild(i)),n.splice(i,1)}const r=n.filter((e,i)=>t.getChild(i).is("element","tableRow")),s=r[0];if(!r.every(t=>t===s)){const n=r.reduce((t,e)=>e>t?e:t,0);for(const[o,s]of r.entries()){const r=n-s;if(r){for(let i=0;i<r;i++)Zw(e,e.createPositionAt(t.getChild(o),"end"));i=!0}}}return i}function rk(t){const e="attribute"===t.type,i=t.attributeKey;return e&&("headingRows"===i||"colspan"===i||"rowspan"===i)}function sk(t){t.document.registerPostFixer(e=>function(t,e){const i=e.document.differ.getChanges();let n=!1;for(const e of i)"insert"==e.type&&"table"==e.name&&(n=ak(e.position.nodeAfter,t)||n),"insert"==e.type&&"tableRow"==e.name&&(n=lk(e.position.nodeAfter,t)||n),"insert"==e.type&&"tableCell"==e.name&&(n=ck(e.position.nodeAfter,t)||n),dk(e)&&(n=ck(e.position.parent,t)||n);return n}(e,t))}function ak(t,e){let i=!1;for(const n of t.getChildren())n.is("element","tableRow")&&(i=lk(n,e)||i);return i}function lk(t,e){let i=!1;for(const n of t.getChildren())i=ck(n,e)||i;return i}function ck(t,e){if(0==t.childCount)return e.insertElement("paragraph",t),!0;const i=Array.from(t.getChildren()).filter(t=>t.is("$text"));for(const t of i)e.wrap(e.createRangeOn(t),"paragraph");return!!i.length}function dk(t){return!(!t.position||!t.position.parent.is("element","tableCell"))&&("insert"==t.type&&"$text"==t.name||"remove"==t.type)}function hk(t,e){t.document.registerPostFixer(()=>function(t,e){const i=new Set;for(const e of t.getChanges()){const t="attribute"==e.type?e.range.start.parent:e.position.parent;t.is("element","tableCell")&&i.add(t)}for(const n of i.values())for(const i of[...n.getChildren()].filter(t=>uk(t,e)))t.refreshItem(i);return!1}(t.document.differ,e))}function uk(t,e){if(!t.is("element","paragraph"))return!1;const i=e.toViewElement(t);return!!i&&ab(t)!==i.is("element","span")}function mk(t){t.document.registerPostFixer(()=>function(t){const e=t.document.differ,i=new Set;for(const t of e.getChanges()){if("attribute"!=t.type)continue;const e=t.range.start.nodeAfter;e&&e.is("element","table")&&"headingRows"==t.attributeKey&&i.add(e)}if(i.size){for(const t of i.values())e.refreshItem(t);return!0}return!1}(t))}i(106);class gk extends Qt{static get pluginName(){return"TableEditing"}init(){const t=this.editor,e=t.model,i=e.schema,n=t.conversion;i.register("table",{allowWhere:"$block",allowAttributes:["headingRows","headingColumns"],isObject:!0,isBlock:!0}),i.register("tableRow",{allowIn:"table",isLimit:!0}),i.register("tableCell",{allowIn:"tableRow",allowChildren:"$block",allowAttributes:["colspan","rowspan"],isLimit:!0,isSelectable:!0}),n.for("upcast").add(t=>{t.on("element:figure",(t,e,i)=>{if(!i.consumable.test(e.viewItem,{name:!0,classes:"table"}))return;const n=function(t){for(const e of t.getChildren())if(e.is("element","table"))return e}(e.viewItem);if(!n||!i.consumable.test(n,{name:!0}))return;const o=Os(i.convertItem(n,e.modelCursor).modelRange.getItems());o&&(i.convertChildren(e.viewItem,i.writer.createPositionAt(o,"end")),i.updateConversionResult(o,e))})}),n.for("upcast").add(tb()),n.for("editingDowncast").add(rb({asWidget:!0})),n.for("dataDowncast").add(rb()),n.for("upcast").elementToElement({model:"tableRow",view:"tr"}),n.for("upcast").add(t=>{t.on("element:tr",(t,e)=>{e.viewItem.isEmpty&&0==e.modelCursor.index&&t.stop()},{priority:"high"})}),n.for("editingDowncast").add(t=>t.on("insert:tableRow",(t,e,i)=>{const n=e.item;if(!i.consumable.consume(n,"insert"))return;const o=n.parent,r=function(t){for(const e of t.getChildren())if("table"===e.name)return e}(i.mapper.toViewElement(o)),s=o.getChildIndex(n),a=new nb(o,{row:s}),l={headingRows:o.getAttribute("headingRows")||0,headingColumns:o.getAttribute("headingColumns")||0},c=new Map;for(const t of a){const e=c.get(s)||db(r,n,s,l,i);c.set(s,e),i.consumable.consume(t.cell,"insert"),cb(t,l,i.writer.createPositionAt(e,"end"),i,{asWidget:!0})}})),n.for("editingDowncast").add(t=>t.on("remove:tableRow",(t,e,i)=>{t.stop();const n=i.writer,o=i.mapper,r=o.toViewPosition(e.position).getLastMatchingPosition(t=>!t.item.is("element","tr")).nodeAfter,s=r.parent.parent,a=n.createRangeOn(r),l=n.remove(a);for(const t of n.createRangeIn(l).getItems())o.unbindViewElement(t);mb("thead",s,i),mb("tbody",s,i)},{priority:"higher"})),n.for("upcast").elementToElement({model:"tableCell",view:"td"}),n.for("upcast").elementToElement({model:"tableCell",view:"th"}),n.for("upcast").add(eb("td")),n.for("upcast").add(eb("th")),n.for("editingDowncast").add(t=>t.on("insert:tableCell",(t,e,i)=>{const n=e.item;if(!i.consumable.consume(n,"insert"))return;const o=n.parent,r=o.parent,s=r.getChildIndex(o),a=new nb(r,{row:s}),l={headingRows:r.getAttribute("headingRows")||0,headingColumns:r.getAttribute("headingColumns")||0};for(const t of a)if(t.cell===n){const e=i.mapper.toViewElement(o);return void cb(t,l,i.writer.createPositionAt(e,o.getChildIndex(n)),i,{asWidget:!0})}})),n.for("editingDowncast").elementToElement({model:"paragraph",view:sb,converterPriority:"high"}),n.attributeToAttribute({model:"colspan",view:"colspan"}),n.attributeToAttribute({model:"rowspan",view:"rowspan"}),n.for("editingDowncast").add(t=>t.on("attribute:headingColumns:table",(t,e,i)=>{const n=e.item;if(!i.consumable.consume(e.item,t.name))return;const o={headingRows:n.getAttribute("headingRows")||0,headingColumns:n.getAttribute("headingColumns")||0},r=e.attributeOldValue,s=e.attributeNewValue,a=(r>s?r:s)-1;for(const t of new nb(n,{endColumn:a}))lb(t,o,i)})),t.commands.add("insertTable",new fb(t)),t.commands.add("insertTableRowAbove",new Tb(t,{order:"above"})),t.commands.add("insertTableRowBelow",new Tb(t,{order:"below"})),t.commands.add("insertTableColumnLeft",new Eb(t,{order:"left"})),t.commands.add("insertTableColumnRight",new Eb(t,{order:"right"})),t.commands.add("removeTableRow",new Hb(t)),t.commands.add("removeTableColumn",new Ub(t)),t.commands.add("splitTableCellVertically",new Pb(t,{direction:"vertically"})),t.commands.add("splitTableCellHorizontally",new Pb(t,{direction:"horizontally"})),t.commands.add("mergeTableCells",new Qb(t)),t.commands.add("mergeTableCellRight",new Bb(t,{direction:"right"})),t.commands.add("mergeTableCellLeft",new Bb(t,{direction:"left"})),t.commands.add("mergeTableCellDown",new Bb(t,{direction:"down"})),t.commands.add("mergeTableCellUp",new Bb(t,{direction:"up"})),t.commands.add("setTableColumnHeader",new Wb(t)),t.commands.add("setTableRowHeader",new qb(t)),t.commands.add("selectTableRow",new tk(t)),t.commands.add("selectTableColumn",new ek(t)),mk(e),ik(e),hk(e,t.editing.mapper),sk(e)}static get requires(){return[$b]}}i(108);class fk extends ed{constructor(t){super(t);const e=this.bindTemplate;this.items=this._createGridCollection(),this.set("rows",0),this.set("columns",0),this.bind("label").to(this,"columns",this,"rows",(t,e)=>`${e} × ${t}`),this.setTemplate({tag:"div",attributes:{class:["ck"]},children:[{tag:"div",attributes:{class:["ck-insert-table-dropdown__grid"]},on:{"mouseover@.ck-insert-table-dropdown-grid-box":e.to("boxover")},children:this.items},{tag:"div",attributes:{class:["ck-insert-table-dropdown__label"]},children:[{text:e.to("label")}]}],on:{mousedown:e.to(t=>{t.preventDefault()}),click:e.to(()=>{this.fire("execute")})}}),this.on("boxover",(t,e)=>{const{row:i,column:n}=e.target.dataset;this.set({rows:parseInt(i),columns:parseInt(n)})}),this.on("change:columns",()=>{this._highlightGridBoxes()}),this.on("change:rows",()=>{this._highlightGridBoxes()})}focus(){}focusLast(){}_highlightGridBoxes(){const t=this.rows,e=this.columns;this.items.map((i,n)=>{const o=Math.floor(n/10)<t&&n%10<e;i.set("isOn",o)})}_createGridCollection(){const t=[];for(let e=0;e<100;e++){const i=Math.floor(e/10),n=e%10;t.push(new pk(this.locale,i+1,n+1))}return this.createCollection(t)}}class pk extends ed{constructor(t,e,i){super(t);const n=this.bindTemplate;this.set("isOn",!1),this.setTemplate({tag:"div",attributes:{class:["ck-insert-table-dropdown-grid-box",n.if("isOn","ck-on")],"data-row":e,"data-column":i}})}}class wk extends Qt{static get pluginName(){return"TableUI"}init(){const t=this.editor,e=this.editor.t,i="ltr"===t.locale.contentLanguageDirection;t.ui.componentFactory.add("insertTable",i=>{const n=t.commands.get("insertTable"),o=Qd(i);let r;return o.bind("isEnabled").to(n),o.buttonView.set({icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M3 6v3h4V6H3zm0 4v3h4v-3H3zm0 4v3h4v-3H3zm5 3h4v-3H8v3zm5 0h4v-3h-4v3zm4-4v-3h-4v3h4zm0-4V6h-4v3h4zm1.5 8a1.5 1.5 0 0 1-1.5 1.5H3A1.5 1.5 0 0 1 1.5 17V4c.222-.863 1.068-1.5 2-1.5h13c.932 0 1.778.637 2 1.5v13zM12 13v-3H8v3h4zm0-4V6H8v3h4z"/></svg>',label:e("Insert table"),tooltip:!0}),o.on("change:isOpen",()=>{r||(r=new fk(i),o.panelView.children.add(r),r.delegate("execute").to(o),o.buttonView.on("open",()=>{r.rows=0,r.columns=0}),o.on("execute",()=>{t.execute("insertTable",{rows:r.rows,columns:r.columns}),t.editing.view.focus()}))}),o}),t.ui.componentFactory.add("tableColumn",t=>{const n=[{type:"switchbutton",model:{commandName:"setTableColumnHeader",label:e("Header column"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:i?"insertTableColumnLeft":"insertTableColumnRight",label:e("Insert column left")}},{type:"button",model:{commandName:i?"insertTableColumnRight":"insertTableColumnLeft",label:e("Insert column right")}},{type:"button",model:{commandName:"removeTableColumn",label:e("Delete column")}},{type:"button",model:{commandName:"selectTableColumn",label:e("Select column")}}];return this._prepareDropdown(e("Column"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z" opacity=".6"/><path d="M18 7v1H2V7h16zm0 5v1H2v-1h16z" opacity=".6"/><path d="M14 1v18a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V1a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1zm-2 1H8v4h4V2zm0 6H8v4h4V8zm0 6H8v4h4v-4z"/></svg>',n,t)}),t.ui.componentFactory.add("tableRow",t=>{const i=[{type:"switchbutton",model:{commandName:"setTableRowHeader",label:e("Header row"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:"insertTableRowAbove",label:e("Insert row above")}},{type:"button",model:{commandName:"insertTableRowBelow",label:e("Insert row below")}},{type:"button",model:{commandName:"removeTableRow",label:e("Delete row")}},{type:"button",model:{commandName:"selectTableRow",label:e("Select row")}}];return this._prepareDropdown(e("Row"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z" opacity=".6"/><path d="M7 2h1v16H7V2zm5 0h1v16h-1V2z" opacity=".6"/><path d="M1 6h18a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm1 2v4h4V8H2zm6 0v4h4V8H8zm6 0v4h4V8h-4z"/></svg>',i,t)}),t.ui.componentFactory.add("mergeTableCells",t=>{const n=[{type:"button",model:{commandName:"mergeTableCellUp",label:e("Merge cell up")}},{type:"button",model:{commandName:i?"mergeTableCellRight":"mergeTableCellLeft",label:e("Merge cell right")}},{type:"button",model:{commandName:"mergeTableCellDown",label:e("Merge cell down")}},{type:"button",model:{commandName:i?"mergeTableCellLeft":"mergeTableCellRight",label:e("Merge cell left")}},{type:"separator"},{type:"button",model:{commandName:"splitTableCellVertically",label:e("Split cell vertically")}},{type:"button",model:{commandName:"splitTableCellHorizontally",label:e("Split cell horizontally")}}];return this._prepareMergeSplitButtonDropdown(e("Merge cells"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z" opacity=".6"/><path d="M7 2h1v16H7V2zm5 0h1v7h-1V2zm6 5v1H2V7h16zM8 12v1H2v-1h6z" opacity=".6"/><path d="M7 7h12a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1zm1 2v9h10V9H8z"/></svg>',n,t)})}_prepareDropdown(t,e,i,n){const o=this.editor,r=Qd(n),s=this._fillDropdownWithListOptions(r,i);return r.buttonView.set({label:t,icon:e,tooltip:!0}),r.bind("isEnabled").toMany(s,"isEnabled",(...t)=>t.some(t=>t)),this.listenTo(r,"execute",t=>{o.execute(t.source.commandName),o.editing.view.focus()}),r}_prepareMergeSplitButtonDropdown(t,e,i,n){const o=this.editor,r=Qd(n,Nd),s=o.commands.get("mergeTableCells"),a=this._fillDropdownWithListOptions(r,i);return r.buttonView.set({label:t,icon:e,tooltip:!0,isEnabled:!0}),r.bind("isEnabled").toMany([s,...a],"isEnabled",(...t)=>t.some(t=>t)),this.listenTo(r.buttonView,"execute",()=>{o.execute("mergeTableCells"),o.editing.view.focus()}),this.listenTo(r,"execute",t=>{o.execute(t.source.commandName),o.editing.view.focus()}),r}_fillDropdownWithListOptions(t,e){const i=this.editor,n=[],o=new Zi;for(const t of e)bk(t,i,n,o);return Zd(t,o,i.ui.componentFactory),n}}function bk(t,e,i,n){const o=t.model=new ch(t.model),{commandName:r,bindIsOn:s}=t.model;if("button"===t.type||"switchbutton"===t.type){const t=e.commands.get(r);i.push(t),o.set({commandName:r}),o.bind("isEnabled").to(t),s&&o.bind("isOn").to(t,"value")}o.set({withText:!0}),n.add(t)}i(110);class kk extends Qt{static get pluginName(){return"TableSelection"}static get requires(){return[$b]}init(){const t=this.editor.model;this.listenTo(t,"deleteContent",(t,e)=>this._handleDeleteContent(t,e),{priority:"high"}),this._defineSelectionConverter(),this._enablePluginDisabling()}getSelectedTableCells(){const t=pb(this.editor.model.document.selection);return 0==t.length?null:t}getSelectionAsFragment(){const t=this.getSelectedTableCells();return t?this.editor.model.change(e=>{const i=e.createDocumentFragment(),n=this.editor.plugins.get("TableUtils"),{first:o,last:r}=_b(t),{first:s,last:a}=kb(t),l=t[0].findAncestor("table");let c=a,d=r;if(vb(t,n)){const t={firstColumn:o,lastColumn:r,firstRow:s,lastRow:a};c=Vb(l,t),d=jb(l,t)}const h=Sb(l,{startRow:s,startColumn:o,endRow:c,endColumn:d},e);return e.insert(h,i,0),i}):null}setCellSelection(t,e){const i=this._getCellsToSelect(t,e);this.editor.model.change(t=>{t.setSelection(i.cells.map(e=>t.createRangeOn(e)),{backward:i.backward})})}getFocusCell(){const t=[...this.editor.model.document.selection.getRanges()].pop().getContainedElement();return t&&t.is("element","tableCell")?t:null}getAnchorCell(){const t=Os(this.editor.model.document.selection.getRanges()).getContainedElement();return t&&t.is("element","tableCell")?t:null}_defineSelectionConverter(){const t=this.editor,e=new Set;t.conversion.for("editingDowncast").add(t=>t.on("selection",(t,i,n)=>{const o=n.writer;!function(t){for(const i of e)t.removeClass("ck-editor__editable_selected",i);e.clear()}(o);const r=this.getSelectedTableCells();if(!r)return;for(const t of r){const i=n.mapper.toViewElement(t);o.addClass("ck-editor__editable_selected",i),e.add(i)}const s=n.mapper.toViewElement(r[r.length-1]);o.setSelection(s,0)},{priority:"lowest"}))}_enablePluginDisabling(){const t=this.editor;this.on("change:isEnabled",()=>{if(!this.isEnabled){const e=this.getSelectedTableCells();if(!e)return;t.model.change(i=>{const n=i.createPositionAt(e[0],0),o=t.model.schema.getNearestSelectionRange(n);i.setSelection(o)})}})}_handleDeleteContent(t,e){const[i,n]=e,o=this.editor.model,r=!n||"backward"==n.direction,s=pb(i);s.length&&(t.stop(),o.change(t=>{const e=s[r?s.length-1:0];o.change(t=>{for(const e of s)o.deleteContent(t.createSelection(e,"in"))});const n=o.schema.getNearestSelectionRange(t.createPositionAt(e,0));i.is("documentSelection")?t.setSelection(n):i.setTo(n)}))}_getCellsToSelect(t,e){const i=this.editor.plugins.get("TableUtils"),n=i.getCellLocation(t),o=i.getCellLocation(e),r=Math.min(n.row,o.row),s=Math.max(n.row,o.row),a=Math.min(n.column,o.column),l=Math.max(n.column,o.column),c=new Array(s-r+1).fill(null).map(()=>[]),d={startRow:r,endRow:s,startColumn:a,endColumn:l};for(const{row:e,cell:i}of new nb(t.findAncestor("table"),d))c[e-r].push(i);const h=o.row<n.row,u=o.column<n.column;return h&&c.reverse(),u&&c.forEach(t=>t.reverse()),{cells:c.flat(),backward:h||u}}}class _k extends Qt{static get pluginName(){return"TableClipboard"}static get requires(){return[kk,$b]}init(){const t=this.editor,e=t.editing.view.document;this.listenTo(e,"copy",(t,e)=>this._onCopyCut(t,e)),this.listenTo(e,"cut",(t,e)=>this._onCopyCut(t,e)),this.listenTo(t.model,"insertContent",(t,e)=>this._onInsertContent(t,...e),{priority:"high"}),this.decorate("_replaceTableSlotCell")}_onCopyCut(t,e){const i=this.editor.plugins.get(kk);if(!i.getSelectedTableCells())return;if("cut"==t.name&&this.editor.isReadOnly)return;e.preventDefault(),t.stop();const n=this.editor.data,o=this.editor.editing.view.document,r=n.toView(i.getSelectionAsFragment());o.fire("clipboardOutput",{dataTransfer:e.dataTransfer,content:r,method:t.name})}_onInsertContent(t,e,i){if(i&&!i.is("documentSelection"))return;const n=this.editor.model,o=this.editor.plugins.get($b);let r=function(t,e){if(!t.is("documentFragment")&&!t.is("element"))return null;if(t.is("element","table"))return t;if(1==t.childCount&&t.getChild(0).is("element","table"))return t.getChild(0);const i=e.createRangeIn(t);for(const t of i.getItems())if(t.is("element","table")){const n=e.createRange(i.start,e.createPositionBefore(t));if(e.hasContent(n,{ignoreWhitespaces:!0}))return null;const o=e.createRange(e.createPositionAfter(t),i.end);return e.hasContent(o,{ignoreWhitespaces:!0})?null:t}return null}(e,n);if(!r)return;const s=bb(n.document.selection);s.length?(t.stop(),n.change(t=>{const e={width:o.getColumns(r),height:o.getRows(r)},i=function(t,e,i,n){const o=t[0].findAncestor("table"),r=_b(t),s=kb(t),a={firstColumn:r.first,lastColumn:r.last,firstRow:s.first,lastRow:s.last},l=1===t.length;l&&(a.lastRow+=e.height-1,a.lastColumn+=e.width-1,function(t,e,i,n){const o=n.getColumns(t),r=n.getRows(t);i>o&&n.insertColumns(t,{at:o,columns:i-o});e>r&&n.insertRows(t,{at:r,rows:e-r})}(o,a.lastRow+1,a.lastColumn+1,n));l||!vb(t,n)?function(t,e,i){const{firstRow:n,lastRow:o,firstColumn:r,lastColumn:s}=e,a={first:n,last:o},l={first:r,last:s};yk(t,r,a,i),yk(t,s+1,a,i),vk(t,n,l,i),vk(t,o+1,l,i,n)}(o,a,i):(a.lastRow=Vb(o,a),a.lastColumn=jb(o,a));return a}(s,e,t,o),n=i.lastRow-i.firstRow+1,a=i.lastColumn-i.firstColumn+1,l={startRow:0,startColumn:0,endRow:Math.min(n,e.height)-1,endColumn:Math.min(a,e.width)-1};r=Sb(r,l,t);const c=s[0].findAncestor("table"),d=this._replaceSelectedCellsWithPasted(r,e,c,i,t);if(this.editor.plugins.get("TableSelection").isEnabled){const e=yb(d.map(e=>t.createRangeOn(e)));t.setSelection(e)}else t.setSelection(d[0],0)})):Db(r,o)}_replaceSelectedCellsWithPasted(t,e,i,n,o){const{width:r,height:s}=e,a=function(t,e,i){const n=new Array(i).fill(null).map(()=>new Array(e).fill(null));for(const{column:e,row:i,cell:o}of new nb(t))n[i][e]=o;return n}(t,r,s),l=[...new nb(i,{startRow:n.firstRow,endRow:n.lastRow,startColumn:n.firstColumn,endColumn:n.lastColumn,includeAllSlots:!0})],c=[];let d;for(const t of l){const{row:e,column:i}=t;i===n.firstColumn&&(d=t.getPositionBefore());const l=e-n.firstRow,h=i-n.firstColumn,u=a[l%s][h%r],m=u?o.cloneElement(u):null,g=this._replaceTableSlotCell(t,m,d,o);g&&(Rb(g,e,i,n.lastRow,n.lastColumn,o),c.push(g),d=o.createPositionAfter(g))}const h=parseInt(i.getAttribute("headingRows")||0),u=parseInt(i.getAttribute("headingColumns")||0),m=n.firstRow<h&&h<=n.lastRow,g=n.firstColumn<u&&u<=n.lastColumn;if(m){const t=vk(i,h,{first:n.firstColumn,last:n.lastColumn},o,n.firstRow);c.push(...t)}if(g){const t=yk(i,u,{first:n.firstRow,last:n.lastRow},o);c.push(...t)}return c}_replaceTableSlotCell(t,e,i,n){const{cell:o,isAnchor:r}=t;return r&&n.remove(o),e?(n.insert(e,i),e):null}}function vk(t,e,i,n,o=0){if(e<1)return;return Mb(t,e,o).filter(({column:t,cellWidth:e})=>xk(t,e,i)).map(({cell:t})=>Ib(t,e,n))}function yk(t,e,i,n){if(e<1)return;return Lb(t,e).filter(({row:t,cellHeight:e})=>xk(t,e,i)).map(({cell:t,column:i})=>Nb(t,i,e,n))}function xk(t,e,i){const n=t+e-1,{first:o,last:r}=i;return t>=o&&t<=r||t<o&&n>=o}class Ak extends Qt{static get pluginName(){return"TableKeyboard"}static get requires(){return[kk]}init(){const t=this.editor.editing.view.document;this.editor.keystrokes.set("Tab",(...t)=>this._handleTabOnSelectedTable(...t),{priority:"low"}),this.editor.keystrokes.set("Tab",this._getTabHandler(!0),{priority:"low"}),this.editor.keystrokes.set("Shift+Tab",this._getTabHandler(!1),{priority:"low"}),this.listenTo(t,"arrowKey",(...t)=>this._onArrowKey(...t),{context:"table"})}_handleTabOnSelectedTable(t,e){const i=this.editor,n=i.model.document.selection.getSelectedElement();n&&n.is("element","table")&&(e(),i.model.change(t=>{t.setSelection(t.createRangeIn(n.getChild(0).getChild(0)))}))}_getTabHandler(t){const e=this.editor;return(i,n)=>{let o=wb(e.model.document.selection)[0];if(o||(o=this.editor.plugins.get("TableSelection").getFocusCell()),!o)return;n();const r=o.parent,s=r.parent,a=s.getChildIndex(r),l=r.getChildIndex(o),c=0===l;if(!t&&c&&0===a)return void e.model.change(t=>{t.setSelection(t.createRangeOn(s))});const d=this.editor.plugins.get("TableUtils"),h=l===r.childCount-1,u=a===d.getRows(s)-1;if(t&&u&&h&&(e.execute("insertTableRowBelow"),a===d.getRows(s)-1))return void e.model.change(t=>{t.setSelection(t.createRangeOn(s))});let m;if(t&&h){const t=s.getChild(a+1);m=t.getChild(0)}else if(!t&&c){const t=s.getChild(a-1);m=t.getChild(t.childCount-1)}else m=r.getChild(l+(t?1:-1));e.model.change(t=>{t.setSelection(t.createRangeIn(m))})}}_onArrowKey(t,e){const i=this.editor,n=zo(e.keyCode,i.locale.contentLanguageDirection);this._handleArrowKeys(n,e.shiftKey)&&(e.preventDefault(),e.stopPropagation(),t.stop())}_handleArrowKeys(t,e){const i=this.editor.model.document.selection,n=["right","down"].includes(t),o=pb(i);if(o.length){let i;return i=e?this.editor.plugins.get("TableSelection").getFocusCell():n?o[o.length-1]:o[0],this._navigateFromCellInDirection(i,t,e),!0}const r=i.focus.findAncestor("tableCell");return!!r&&(!(e&&!i.isCollapsed&&i.isBackward==n)&&(!!this._isSelectionAtCellEdge(i,r,n)&&(this._navigateFromCellInDirection(r,t,e),!0)))}_isSelectionAtCellEdge(t,e,i){const n=this.editor.model,o=this.editor.model.schema,r=i?t.getLastPosition():t.getFirstPosition();if(!o.getLimitElement(r).is("element","tableCell")){return n.createPositionAt(e,i?"end":0).isTouching(r)}const s=n.createSelection(r);return n.modifySelection(s,{direction:i?"forward":"backward"}),r.isEqual(s.focus)}_navigateFromCellInDirection(t,e,i=!1){const n=this.editor.model,o=t.findAncestor("table"),r=[...new nb(o,{includeAllSlots:!0})],{row:s,column:a}=r[r.length-1],l=r.find(({cell:e})=>e==t);let{row:c,column:d}=l;switch(e){case"left":d--;break;case"up":c--;break;case"right":d+=l.cellWidth;break;case"down":c+=l.cellHeight}if(c<0||c>s||d<0&&c<=0||d>a&&c>=s)return void n.change(t=>{t.setSelection(t.createRangeOn(o))});d<0?(d=i?0:a,c--):d>a&&(d=i?a:0,c++);const h=r.find(t=>t.row==c&&t.column==d).cell,u=["right","down"].includes(e),m=this.editor.plugins.get("TableSelection");if(i&&m.isEnabled){const e=m.getAnchorCell()||t;m.setCellSelection(e,h)}else{const t=n.createPositionAt(h,u?0:"end");n.change(e=>{e.setSelection(t)})}}}class Ck extends es{constructor(t){super(t),this.domEventType=["mousemove","mouseleave"]}onDomEvent(t){this.fire(t.type,t)}}class Tk extends Qt{static get pluginName(){return"TableMouse"}static get requires(){return[kk]}init(){this.editor.editing.view.addObserver(Ck),this._enableShiftClickSelection(),this._enableMouseDragSelection()}_enableShiftClickSelection(){const t=this.editor;let e=!1;const i=t.plugins.get(kk);this.listenTo(t.editing.view.document,"mousedown",(n,o)=>{if(!this.isEnabled||!i.isEnabled)return;if(!o.domEvent.shiftKey)return;const r=i.getAnchorCell()||wb(t.model.document.selection)[0];if(!r)return;const s=this._getModelTableCellFromDomEvent(o);s&&Ek(r,s)&&(e=!0,i.setCellSelection(r,s),o.preventDefault())}),this.listenTo(t.editing.view.document,"mouseup",()=>{e=!1}),this.listenTo(t.editing.view.document,"selectionChange",t=>{e&&t.stop()},{priority:"highest"})}_enableMouseDragSelection(){const t=this.editor;let e,i,n=!1,o=!1;const r=t.plugins.get(kk);this.listenTo(t.editing.view.document,"mousedown",(t,i)=>{this.isEnabled&&r.isEnabled&&(i.domEvent.shiftKey||i.domEvent.ctrlKey||i.domEvent.altKey||(e=this._getModelTableCellFromDomEvent(i)))}),this.listenTo(t.editing.view.document,"mousemove",(t,s)=>{if(!s.domEvent.buttons)return;if(!e)return;const a=this._getModelTableCellFromDomEvent(s);a&&Ek(e,a)&&(i=a,n||i==e||(n=!0)),n&&(o=!0,r.setCellSelection(e,i),s.preventDefault())}),this.listenTo(t.editing.view.document,"mouseup",()=>{n=!1,o=!1,e=null,i=null}),this.listenTo(t.editing.view.document,"selectionChange",t=>{o&&t.stop()},{priority:"highest"})}_getModelTableCellFromDomEvent(t){const e=t.target,i=this.editor.editing.view.createPositionAt(e,0);return this.editor.editing.mapper.toModelPosition(i).parent.findAncestor("tableCell",{includeSelf:!0})}}function Ek(t,e){return t.parent.parent==e.parent.parent}i(112);function Pk(t){const e=t.getSelectedElement();return e&&Mk(e)?e:null}function Sk(t){let e=t.getFirstPosition().parent;for(;e;){if(e.is("element")&&Mk(e))return e;e=e.parent}return null}function Mk(t){return!!t.getCustomProperty("table")&&zu(t)}class Ik extends Qt{static get pluginName(){return"SuperscriptEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"superscript"}),t.model.schema.setAttributeProperties("superscript",{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:"superscript",view:"sup",upcastAlso:[{styles:{"vertical-align":"super"}}]}),t.commands.add("superscript",new wg(t,"superscript"))}}class Lk extends Qt{static get pluginName(){return"SuperscriptUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("superscript",i=>{const n=t.commands.get("superscript"),o=new Ad(i);return o.set({label:e("Superscript"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M15.677 8.678h2.549c.254 0 .447.05.58.152a.49.49 0 0 1 .201.413.54.54 0 0 1-.159.393c-.105.108-.266.162-.48.162h-3.594c-.245 0-.435-.066-.572-.197a.621.621 0 0 1-.205-.463c0-.114.044-.265.132-.453a1.62 1.62 0 0 1 .288-.444c.433-.436.824-.81 1.172-1.122.348-.312.597-.517.747-.615.267-.183.49-.368.667-.553.177-.185.312-.375.405-.57.093-.194.139-.384.139-.57a1.008 1.008 0 0 0-.554-.917 1.197 1.197 0 0 0-.56-.133c-.426 0-.761.182-1.005.546a2.332 2.332 0 0 0-.164.39 1.609 1.609 0 0 1-.258.488c-.096.114-.237.17-.423.17a.558.558 0 0 1-.405-.156.568.568 0 0 1-.161-.427c0-.218.05-.446.151-.683.101-.238.252-.453.452-.646s.454-.349.762-.467a2.998 2.998 0 0 1 1.081-.178c.498 0 .923.076 1.274.228a1.916 1.916 0 0 1 1.004 1.032 1.984 1.984 0 0 1-.156 1.794c-.2.32-.405.572-.613.754-.208.182-.558.468-1.048.857-.49.39-.826.691-1.008.906a2.703 2.703 0 0 0-.24.309zM7.03 10.349l3.818-3.819a.8.8 0 1 1 1.132 1.132L8.16 11.48l3.819 3.818a.8.8 0 1 1-1.132 1.132L7.03 12.61l-3.818 3.82a.8.8 0 1 1-1.132-1.132L5.9 11.48 2.08 7.662A.8.8 0 1 1 3.212 6.53l3.818 3.82z"/></svg>',tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(o,"execute",()=>{t.execute("superscript"),t.editing.view.focus()}),o})}}class Nk extends Qt{static get pluginName(){return"SubscriptEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"subscript"}),t.model.schema.setAttributeProperties("subscript",{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:"subscript",view:"sub",upcastAlso:[{styles:{"vertical-align":"sub"}}]}),t.commands.add("subscript",new wg(t,"subscript"))}}class Rk extends Qt{static get pluginName(){return"SubscriptUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("subscript",i=>{const n=t.commands.get("subscript"),o=new Ad(i);return o.set({label:e("Subscript"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m7.03 10.349 3.818-3.819a.8.8 0 1 1 1.132 1.132L8.16 11.48l3.819 3.818a.8.8 0 1 1-1.132 1.132L7.03 12.61l-3.818 3.82a.8.8 0 1 1-1.132-1.132L5.9 11.48 2.08 7.662A.8.8 0 1 1 3.212 6.53l3.818 3.82zm8.147 7.829h2.549c.254 0 .447.05.58.152a.49.49 0 0 1 .201.413.54.54 0 0 1-.159.393c-.105.108-.266.162-.48.162h-3.594c-.245 0-.435-.066-.572-.197a.621.621 0 0 1-.205-.463c0-.114.044-.265.132-.453a1.62 1.62 0 0 1 .288-.444c.433-.436.824-.81 1.172-1.122.348-.312.597-.517.747-.615.267-.183.49-.368.667-.553.177-.185.312-.375.405-.57.093-.194.139-.384.139-.57a1.008 1.008 0 0 0-.554-.917 1.197 1.197 0 0 0-.56-.133c-.426 0-.761.182-1.005.546a2.332 2.332 0 0 0-.164.39 1.609 1.609 0 0 1-.258.488c-.096.114-.237.17-.423.17a.558.558 0 0 1-.405-.156.568.568 0 0 1-.161-.427c0-.218.05-.446.151-.683.101-.238.252-.453.452-.646s.454-.349.762-.467a2.998 2.998 0 0 1 1.081-.178c.498 0 .923.076 1.274.228a1.916 1.916 0 0 1 1.004 1.032 1.984 1.984 0 0 1-.156 1.794c-.2.32-.405.572-.613.754-.208.182-.558.468-1.048.857-.49.39-.826.691-1.008.906a2.703 2.703 0 0 0-.24.309z"/></svg>',tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(o,"execute",()=>{t.execute("subscript"),t.editing.view.focus()}),o})}}class Ok extends Qt{static get pluginName(){return"StrikethroughEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"strikethrough"}),t.model.schema.setAttributeProperties("strikethrough",{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:"strikethrough",view:"s",upcastAlso:["del","strike",{styles:{"text-decoration":"line-through"}}]}),t.commands.add("strikethrough",new wg(t,"strikethrough")),t.keystrokes.set("CTRL+SHIFT+X","strikethrough")}}class zk extends Qt{static get pluginName(){return"StrikethroughUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("strikethrough",i=>{const n=t.commands.get("strikethrough"),o=new Ad(i);return o.set({label:e("Strikethrough"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M7 16.4c-.8-.4-1.5-.9-2.2-1.5a.6.6 0 0 1-.2-.5l.3-.6h1c1 1.2 2.1 1.7 3.7 1.7 1 0 1.8-.3 2.3-.6.6-.4.6-1.2.6-1.3.2-1.2-.9-2.1-.9-2.1h2.1c.3.7.4 1.2.4 1.7v.8l-.6 1.2c-.6.8-1.1 1-1.6 1.2a6 6 0 0 1-2.4.6c-1 0-1.8-.3-2.5-.6zM6.8 9 6 8.3c-.4-.5-.5-.8-.5-1.6 0-.7.1-1.3.5-1.8.4-.6 1-1 1.6-1.3a6.3 6.3 0 0 1 4.7 0 4 4 0 0 1 1.7 1l.3.7c0 .1.2.4-.2.7-.4.2-.9.1-1 0a3 3 0 0 0-1.2-1c-.4-.2-1-.3-2-.4-.7 0-1.4.2-2 .6-.8.6-1 .8-1 1.5 0 .8.5 1 1.2 1.5.6.4 1.1.7 1.9 1H6.8z"/><path d="M3 10.5V9h14v1.5z"/></svg>',keystroke:"CTRL+SHIFT+X",tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(o,"execute",()=>{t.execute("strikethrough"),t.editing.view.focus()}),o})}}class Dk extends Qt{static get pluginName(){return"UnderlineEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"underline"}),t.model.schema.setAttributeProperties("underline",{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:"underline",view:"u",upcastAlso:{styles:{"text-decoration":"underline"}}}),t.commands.add("underline",new wg(t,"underline")),t.keystrokes.set("CTRL+U","underline")}}class Vk extends Qt{static get pluginName(){return"UnderlineUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("underline",i=>{const n=t.commands.get("underline"),o=new Ad(i);return o.set({label:e("Underline"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M3 18v-1.5h14V18zm2.2-8V3.6c0-.4.4-.6.8-.6.3 0 .7.2.7.6v6.2c0 2 1.3 2.8 3.2 2.8 1.9 0 3.4-.9 3.4-2.9V3.6c0-.3.4-.5.8-.5.3 0 .7.2.7.5V10c0 2.7-2.2 4-4.9 4-2.6 0-4.7-1.2-4.7-4z"/></svg>',keystroke:"CTRL+U",tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(o,"execute",()=>{t.execute("underline"),t.editing.view.focus()}),o})}}class jk extends Zt{constructor(t,e){super(t),this.attributeKey=e}refresh(){const t=this.editor.model,e=t.document;this.value=e.selection.getAttribute(this.attributeKey),this.isEnabled=t.schema.checkAttributeInSelection(e.selection,this.attributeKey)}execute(t={}){const e=this.editor.model,i=e.document.selection,n=t.value;e.change(t=>{if(i.isCollapsed)n?t.setSelectionAttribute(this.attributeKey,n):t.removeSelectionAttribute(this.attributeKey);else{const o=e.schema.getValidRanges(i.getRanges(),this.attributeKey);for(const e of o)n?t.setAttribute(this.attributeKey,n,e):t.removeAttribute(this.attributeKey,e)}})}}class Bk extends Zi{constructor(t){super(t),this.set("isEmpty",!0),this.on("change",()=>{this.set("isEmpty",0===this.length)})}add(t,e){this.find(e=>e.color===t.color)||super.add(t,e)}hasColor(t){return!!this.find(e=>e.color===t)}}Kt(Bk,Ut);i(114);class Fk extends ed{constructor(t,{colors:e,columns:i,removeButtonLabel:n,documentColorsLabel:o,documentColorsCount:r}){super(t),this.items=this.createCollection(),this.colorDefinitions=e,this.focusTracker=new zs,this.keystrokes=new Ds,this.set("selectedColor"),this.removeButtonLabel=n,this.columns=i,this.documentColors=new Bk,this.documentColorsCount=r,this._focusCycler=new Pd({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowup",focusNext:"arrowdown"}}),this._documentColorsLabel=o,this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-table"]},children:this.items}),this.items.add(this._removeColorButton())}updateDocumentColors(t,e){const i=t.document,n=this.documentColorsCount;this.documentColors.clear();for(const o of i.getRootNames()){const r=i.getRoot(o),s=t.createRangeIn(r);for(const t of s.getItems())if(t.is("$textProxy")&&t.hasAttribute(e)&&(this._addColorToDocumentColors(t.getAttribute(e)),this.documentColors.length>=n))return}}updateSelectedColors(){const t=this.documentColorsGrid,e=this.staticColorsGrid,i=this.selectedColor;e.selectedColor=i,t&&(t.selectedColor=i)}render(){super.render();for(const t of this.items)this.focusTracker.add(t.element);this.keystrokes.listenTo(this.element)}appendGrids(){if(!this.staticColorsGrid&&(this.staticColorsGrid=this._createStaticColorsGrid(),this.items.add(this.staticColorsGrid),this.documentColorsCount)){const t=id.bind(this.documentColors,this.documentColors),e=new th(this.locale);e.text=this._documentColorsLabel,e.extendTemplate({attributes:{class:["ck","ck-color-grid__label",t.if("isEmpty","ck-hidden")]}}),this.items.add(e),this.documentColorsGrid=this._createDocumentColorsGrid(),this.items.add(this.documentColorsGrid)}}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}_removeColorButton(){const t=new Ad;return t.set({withText:!0,icon:Nc,tooltip:!0,label:this.removeButtonLabel}),t.class="ck-color-table__remove-color",t.on("execute",()=>{this.fire("execute",{value:null})}),t}_createStaticColorsGrid(){const t=new Md(this.locale,{colorDefinitions:this.colorDefinitions,columns:this.columns});return t.delegate("execute").to(this),t}_createDocumentColorsGrid(){const t=id.bind(this.documentColors,this.documentColors),e=new Md(this.locale,{columns:this.columns});return e.delegate("execute").to(this),e.extendTemplate({attributes:{class:t.if("isEmpty","ck-hidden")}}),e.items.bindTo(this.documentColors).using(t=>{const e=new Ed;return e.set({color:t.color,hasBorder:t.options&&t.options.hasBorder}),t.label&&e.set({label:t.label,tooltip:!0}),e.on("execute",()=>{this.fire("execute",{value:t.color})}),e}),this.documentColors.on("change:isEmpty",(t,i,n)=>{n&&(e.selectedColor=null)}),e}_addColorToDocumentColors(t){const e=this.colorDefinitions.find(e=>e.color===t);e?this.documentColors.add(Object.assign({},e)):this.documentColors.add({color:t,label:t,options:{hasBorder:!1}})}}function Hk(t){return e=>e.getStyle(t).replace(/\s/g,"")}function Uk(t){return(e,{writer:i})=>i.createAttributeElement("span",{style:`${t}:${e}`},{priority:7})}class qk extends jk{constructor(t){super(t,"fontColor")}}class Wk extends Qt{static get pluginName(){return"FontColorEditing"}constructor(t){super(t),t.config.define("fontColor",{colors:[{color:"hsl(0, 0%, 0%)",label:"Black"},{color:"hsl(0, 0%, 30%)",label:"Dim grey"},{color:"hsl(0, 0%, 60%)",label:"Grey"},{color:"hsl(0, 0%, 90%)",label:"Light grey"},{color:"hsl(0, 0%, 100%)",label:"White",hasBorder:!0},{color:"hsl(0, 75%, 60%)",label:"Red"},{color:"hsl(30, 75%, 60%)",label:"Orange"},{color:"hsl(60, 75%, 60%)",label:"Yellow"},{color:"hsl(90, 75%, 60%)",label:"Light green"},{color:"hsl(120, 75%, 60%)",label:"Green"},{color:"hsl(150, 75%, 60%)",label:"Aquamarine"},{color:"hsl(180, 75%, 60%)",label:"Turquoise"},{color:"hsl(210, 75%, 60%)",label:"Light blue"},{color:"hsl(240, 75%, 60%)",label:"Blue"},{color:"hsl(270, 75%, 60%)",label:"Purple"}],columns:5}),t.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{color:/[\s\S]+/}},model:{key:"fontColor",value:Hk("color")}}),t.conversion.for("upcast").elementToAttribute({view:{name:"font",attributes:{color:/^#?\w+$/}},model:{key:"fontColor",value:t=>t.getAttribute("color")}}),t.conversion.for("downcast").attributeToElement({model:"fontColor",view:Uk("color")}),t.commands.add("fontColor",new qk(t)),t.model.schema.extend("$text",{allowAttributes:"fontColor"}),t.model.schema.setAttributeProperties("fontColor",{isFormatting:!0,copyOnEnter:!0})}}class $k extends Qt{constructor(t,{commandName:e,icon:i,componentName:n,dropdownLabel:o}){super(t),this.commandName=e,this.componentName=n,this.icon=i,this.dropdownLabel=o,this.columns=t.config.get(this.componentName+".columns"),this.colorTableView=void 0}init(){const t=this.editor,e=t.locale,i=e.t,n=t.commands.get(this.commandName);const o=function(t,e){const i=t.t,n={Black:i("Black"),"Dim grey":i("Dim grey"),Grey:i("Grey"),"Light grey":i("Light grey"),White:i("White"),Red:i("Red"),Orange:i("Orange"),Yellow:i("Yellow"),"Light green":i("Light green"),Green:i("Green"),Aquamarine:i("Aquamarine"),Turquoise:i("Turquoise"),"Light blue":i("Light blue"),Blue:i("Blue"),Purple:i("Purple")};return e.map(t=>{const e=n[t.label];return e&&e!=t.label&&(t.label=e),t})}(e,t.config.get(this.componentName).colors.map(Td).filter(t=>!!t)),r=t.config.get(this.componentName+".documentColors");t.ui.componentFactory.add(this.componentName,e=>{const s=Qd(e);return this.colorTableView=function({dropdownView:t,colors:e,columns:i,removeButtonLabel:n,documentColorsLabel:o,documentColorsCount:r}){const s=t.locale,a=new Fk(s,{colors:e,columns:i,removeButtonLabel:n,documentColorsLabel:o,documentColorsCount:r});return t.colorTableView=a,t.panelView.children.add(a),a.delegate("execute").to(t,"execute"),a}({dropdownView:s,colors:o.map(t=>({label:t.label,color:t.model,options:{hasBorder:t.hasBorder}})),columns:this.columns,removeButtonLabel:i("Remove color"),documentColorsLabel:0!==r?i("Document colors"):void 0,documentColorsCount:void 0===r?this.columns:r}),this.colorTableView.bind("selectedColor").to(n,"value"),s.buttonView.set({label:this.dropdownLabel,icon:this.icon,tooltip:!0}),s.extendTemplate({attributes:{class:"ck-color-ui-dropdown"}}),s.bind("isEnabled").to(n),s.on("execute",(e,i)=>{t.execute(this.commandName,i),t.editing.view.focus()}),s.on("change:isOpen",(e,i,n)=>{s.colorTableView.appendGrids(),n&&(0!==r&&this.colorTableView.updateDocumentColors(t.model,this.componentName),this.colorTableView.updateSelectedColors())}),s})}}class Gk extends $k{constructor(t){super(t,{commandName:"fontColor",componentName:"fontColor",icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M12.4 10.3 10 4.5l-2.4 5.8h4.8zm.5 1.2H7.1L5.7 15H4.2l5-12h1.6l5 12h-1.5L13 11.5zm3.1 7H4a1 1 0 0 1 0-2h12a1 1 0 0 1 0 2z"/></svg>',dropdownLabel:(0,t.locale.t)("Font Color")})}static get pluginName(){return"FontColorUI"}}class Yk extends jk{constructor(t){super(t,"fontBackgroundColor")}}class Kk extends Qt{static get pluginName(){return"FontBackgroundColorEditing"}constructor(t){super(t),t.config.define("fontBackgroundColor",{colors:[{color:"hsl(0, 0%, 0%)",label:"Black"},{color:"hsl(0, 0%, 30%)",label:"Dim grey"},{color:"hsl(0, 0%, 60%)",label:"Grey"},{color:"hsl(0, 0%, 90%)",label:"Light grey"},{color:"hsl(0, 0%, 100%)",label:"White",hasBorder:!0},{color:"hsl(0, 75%, 60%)",label:"Red"},{color:"hsl(30, 75%, 60%)",label:"Orange"},{color:"hsl(60, 75%, 60%)",label:"Yellow"},{color:"hsl(90, 75%, 60%)",label:"Light green"},{color:"hsl(120, 75%, 60%)",label:"Green"},{color:"hsl(150, 75%, 60%)",label:"Aquamarine"},{color:"hsl(180, 75%, 60%)",label:"Turquoise"},{color:"hsl(210, 75%, 60%)",label:"Light blue"},{color:"hsl(240, 75%, 60%)",label:"Blue"},{color:"hsl(270, 75%, 60%)",label:"Purple"}],columns:5}),t.data.addStyleProcessorRules(au),t.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{"background-color":/[\s\S]+/}},model:{key:"fontBackgroundColor",value:Hk("background-color")}}),t.conversion.for("downcast").attributeToElement({model:"fontBackgroundColor",view:Uk("background-color")}),t.commands.add("fontBackgroundColor",new Yk(t)),t.model.schema.extend("$text",{allowAttributes:"fontBackgroundColor"}),t.model.schema.setAttributeProperties("fontBackgroundColor",{isFormatting:!0,copyOnEnter:!0})}}class Qk extends $k{constructor(t){super(t,{commandName:"fontBackgroundColor",componentName:"fontBackgroundColor",icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M4 2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zm8.38 9.262H7.62L10 5.506l2.38 5.756zm.532 1.285L14.34 16h1.426L10.804 4H9.196L4.234 16H5.66l1.428-3.453h5.824z"/></svg>',dropdownLabel:(0,t.locale.t)("Font Background Color")})}static get pluginName(){return"FontBackgroundColorUI"}}const Jk=["left","right","center","justify"];function Zk(t){return Jk.includes(t)}function Xk(t,e){return"rtl"==e.contentLanguageDirection?"right"===t:"left"===t}function t_(t){const e=t.map(t=>{let e;return e="string"==typeof t?{name:t}:t,e}).filter(t=>{const e=!!Jk.includes(t.name);return e||Object(l.b)("alignment-config-name-not-recognized",{option:t}),e}),i=e.filter(t=>!!t.className).length;if(i&&i<e.length)throw new l.a("alignment-config-classnames-are-missing",{configuredOptions:t});return e.forEach((e,i,n)=>{const o=n.slice(i+1);if(o.some(t=>t.name==e.name))throw new l.a("alignment-config-name-already-defined",{option:e,configuredOptions:t});if(e.className){if(o.some(t=>t.className==e.className))throw new l.a("alignment-config-classname-already-defined",{option:e,configuredOptions:t})}}),e}class e_ extends Zt{refresh(){const t=this.editor.locale,e=Os(this.editor.model.document.selection.getSelectedBlocks());this.isEnabled=!!e&&this._canBeAligned(e),this.isEnabled&&e.hasAttribute("alignment")?this.value=e.getAttribute("alignment"):this.value="rtl"===t.contentLanguageDirection?"right":"left"}execute(t={}){const e=this.editor,i=e.locale,n=e.model,o=n.document,r=t.value;n.change(t=>{const e=Array.from(o.selection.getSelectedBlocks()).filter(t=>this._canBeAligned(t)),n=e[0].getAttribute("alignment");Xk(r,i)||n===r||!r?function(t,e){for(const i of t)e.removeAttribute("alignment",i)}(e,t):function(t,e,i){for(const n of t)e.setAttribute("alignment",i,n)}(e,t,r)})}_canBeAligned(t){return this.editor.model.schema.checkAttribute(t,"alignment")}}class i_ extends Qt{static get pluginName(){return"AlignmentEditing"}constructor(t){super(t),t.config.define("alignment",{options:[...Jk.map(t=>({name:t}))]})}init(){const t=this.editor,e=t.locale,i=t.model.schema,n=t_(t.config.get("alignment.options")).filter(t=>Zk(t.name)&&!Xk(t.name,e)),o=n.some(t=>!!t.className);i.extend("$block",{allowAttributes:"alignment"}),t.model.schema.setAttributeProperties("alignment",{isFormatting:!0}),o?t.conversion.attributeToAttribute(function(t){const e={model:{key:"alignment",values:t.map(t=>t.name)},view:{}};for(const i of t)e.view[i.name]={key:"class",value:i.className};return e}(n)):t.conversion.for("downcast").attributeToAttribute(function(t){const e={model:{key:"alignment",values:t.map(t=>t.name)},view:{}};for(const{name:i}of t)e.view[i]={key:"style",value:{"text-align":i}};return e}(n));const r=function(t){const e=[];for(const{name:i}of t)e.push({view:{key:"style",value:{"text-align":i}},model:{key:"alignment",value:i}});return e}(n);for(const e of r)t.conversion.for("upcast").attributeToAttribute(e);const s=function(t){const e=[];for(const{name:i}of t)e.push({view:{key:"align",value:i},model:{key:"alignment",value:i}});return e}(n);for(const e of s)t.conversion.for("upcast").attributeToAttribute(e);t.commands.add("alignment",new e_(t))}}const n_=new Map([["left",zc],["right",Vc],["center",Dc],["justify",jc]]);class o_ extends Qt{get localizedOptionTitles(){const t=this.editor.t;return{left:t("Align left"),right:t("Align right"),center:t("Align center"),justify:t("Justify")}}static get pluginName(){return"AlignmentUI"}init(){const t=this.editor,e=t.ui.componentFactory,i=t.t,n=t_(t.config.get("alignment.options"));n.map(t=>t.name).filter(Zk).forEach(t=>this._addButton(t)),e.add("alignment",t=>{const o=Qd(t),r=n.map(t=>e.create("alignment:"+t.name));Jd(o,r),o.buttonView.set({label:i("Text alignment"),tooltip:!0}),o.toolbarView.isVertical=!0,o.toolbarView.ariaLabel=i("Text alignment toolbar"),o.extendTemplate({attributes:{class:"ck-alignment-dropdown"}});const s="rtl"===t.contentLanguageDirection?n_.get("right"):n_.get("left");return o.buttonView.bind("icon").toMany(r,"isOn",(...t)=>{const e=t.findIndex(t=>t);return e<0?s:r[e].icon}),o.bind("isEnabled").toMany(r,"isEnabled",(...t)=>t.some(t=>t)),o})}_addButton(t){const e=this.editor;e.ui.componentFactory.add("alignment:"+t,i=>{const n=e.commands.get("alignment"),o=new Ad(i);return o.set({label:this.localizedOptionTitles[t],icon:n_.get(t),tooltip:!0,isToggleable:!0}),o.bind("isEnabled").to(n),o.bind("isOn").to(n,"value",e=>e===t),this.listenTo(o,"execute",()=>{e.execute("alignment",{value:t}),e.editing.view.focus()}),o})}}class r_ extends oh{constructor(t,e){super(t);const i=t.t;this.set("class","ck-special-characters-navigation"),this.groupDropdownView=this._createGroupDropdown(e),this.groupDropdownView.panelPosition="rtl"===t.uiLanguageDirection?"se":"sw",this.label=i("Special characters"),this.children.add(this.groupDropdownView)}get currentGroupName(){return this.groupDropdownView.value}_createGroupDropdown(t){const e=this.locale,i=e.t,n=Qd(e),o=this._getCharacterGroupListItemDefinitions(n,t);return n.set("value",o.first.model.label),n.buttonView.bind("label").to(n,"value"),n.buttonView.set({isOn:!1,withText:!0,tooltip:i("Character categories"),class:["ck-dropdown__button_label-width_auto"]}),n.on("execute",t=>{n.value=t.source.label}),n.delegate("execute").to(this),Zd(n,o),n}_getCharacterGroupListItemDefinitions(t,e){const i=new Zi;for(const n of e){const e={type:"button",model:new ch({label:n,withText:!0})};e.model.bind("isOn").to(t,"value",t=>t===e.model.label),i.add(e)}return i}}i(116);class s_ extends ed{constructor(t){super(t),this.tiles=this.createCollection(),this.setTemplate({tag:"div",children:[{tag:"div",attributes:{class:["ck","ck-character-grid__tiles"]},children:this.tiles}],attributes:{class:["ck","ck-character-grid"]}})}createTile(t,e){const i=new Ad(this.locale);return i.set({label:t,withText:!0,class:"ck-character-grid__tile"}),i.extendTemplate({attributes:{title:e},on:{mouseover:i.bindTemplate.to("mouseover")}}),i.on("mouseover",()=>{this.fire("tileHover",{name:e,character:t})}),i.on("execute",()=>{this.fire("execute",{name:e,character:t})}),i}}i(118);class a_ extends ed{constructor(t){super(t);const e=this.bindTemplate;this.set("character",null),this.set("name",null),this.bind("code").to(this,"character",l_),this.setTemplate({tag:"div",children:[{tag:"span",attributes:{class:["ck-character-info__name"]},children:[{text:e.to("name",t=>t||"​")}]},{tag:"span",attributes:{class:["ck-character-info__code"]},children:[{text:e.to("code")}]}],attributes:{class:["ck","ck-character-info"]}})}}function l_(t){if(null===t)return"";return"U+"+("0000"+t.codePointAt(0).toString(16)).slice(-4)}i(120);class c_ extends Qt{static get pluginName(){return"SpecialCharactersCurrency"}init(){const t=this.editor,e=t.t;t.plugins.get("SpecialCharacters").addItems("Currency",[{character:"$",title:e("Dollar sign")},{character:"€",title:e("Euro sign")},{character:"¥",title:e("Yen sign")},{character:"£",title:e("Pound sign")},{character:"¢",title:e("Cent sign")},{character:"₠",title:e("Euro-currency sign")},{character:"₡",title:e("Colon sign")},{character:"₢",title:e("Cruzeiro sign")},{character:"₣",title:e("French franc sign")},{character:"₤",title:e("Lira sign")},{character:"¤",title:e("Currency sign")},{character:"₿",title:e("Bitcoin sign")},{character:"₥",title:e("Mill sign")},{character:"₦",title:e("Naira sign")},{character:"₧",title:e("Peseta sign")},{character:"₨",title:e("Rupee sign")},{character:"₩",title:e("Won sign")},{character:"₪",title:e("New sheqel sign")},{character:"₫",title:e("Dong sign")},{character:"₭",title:e("Kip sign")},{character:"₮",title:e("Tugrik sign")},{character:"₯",title:e("Drachma sign")},{character:"₰",title:e("German penny sign")},{character:"₱",title:e("Peso sign")},{character:"₲",title:e("Guarani sign")},{character:"₳",title:e("Austral sign")},{character:"₴",title:e("Hryvnia sign")},{character:"₵",title:e("Cedi sign")},{character:"₶",title:e("Livre tournois sign")},{character:"₷",title:e("Spesmilo sign")},{character:"₸",title:e("Tenge sign")},{character:"₹",title:e("Indian rupee sign")},{character:"₺",title:e("Turkish lira sign")},{character:"₻",title:e("Nordic mark sign")},{character:"₼",title:e("Manat sign")},{character:"₽",title:e("Ruble sign")}])}}class d_ extends Qt{static get pluginName(){return"SpecialCharactersMathematical"}init(){const t=this.editor,e=t.t;t.plugins.get("SpecialCharacters").addItems("Mathematical",[{character:"<",title:e("Less-than sign")},{character:">",title:e("Greater-than sign")},{character:"≤",title:e("Less-than or equal to")},{character:"≥",title:e("Greater-than or equal to")},{character:"–",title:e("En dash")},{character:"—",title:e("Em dash")},{character:"¯",title:e("Macron")},{character:"‾",title:e("Overline")},{character:"°",title:e("Degree sign")},{character:"−",title:e("Minus sign")},{character:"±",title:e("Plus-minus sign")},{character:"÷",title:e("Division sign")},{character:"⁄",title:e("Fraction slash")},{character:"×",title:e("Multiplication sign")},{character:"ƒ",title:e("Latin small letter f with hook")},{character:"∫",title:e("Integral")},{character:"∑",title:e("N-ary summation")},{character:"∞",title:e("Infinity")},{character:"√",title:e("Square root")},{character:"∼",title:e("Tilde operator")},{character:"≅",title:e("Approximately equal to")},{character:"≈",title:e("Almost equal to")},{character:"≠",title:e("Not equal to")},{character:"≡",title:e("Identical to")},{character:"∈",title:e("Element of")},{character:"∉",title:e("Not an element of")},{character:"∋",title:e("Contains as member")},{character:"∏",title:e("N-ary product")},{character:"∧",title:e("Logical and")},{character:"∨",title:e("Logical or")},{character:"¬",title:e("Not sign")},{character:"∩",title:e("Intersection")},{character:"∪",title:e("Union")},{character:"∂",title:e("Partial differential")},{character:"∀",title:e("For all")},{character:"∃",title:e("There exists")},{character:"∅",title:e("Empty set")},{character:"∇",title:e("Nabla")},{character:"∗",title:e("Asterisk operator")},{character:"∝",title:e("Proportional to")},{character:"∠",title:e("Angle")},{character:"¼",title:e("Vulgar fraction one quarter")},{character:"½",title:e("Vulgar fraction one half")},{character:"¾",title:e("Vulgar fraction three quarters")}])}}class h_ extends Qt{static get pluginName(){return"SpecialCharactersArrows"}init(){const t=this.editor,e=t.t;t.plugins.get("SpecialCharacters").addItems("Arrows",[{title:e("leftwards double arrow"),character:"⇐"},{title:e("rightwards double arrow"),character:"⇒"},{title:e("upwards double arrow"),character:"⇑"},{title:e("downwards double arrow"),character:"⇓"},{title:e("leftwards dashed arrow"),character:"⇠"},{title:e("rightwards dashed arrow"),character:"⇢"},{title:e("upwards dashed arrow"),character:"⇡"},{title:e("downwards dashed arrow"),character:"⇣"},{title:e("leftwards arrow to bar"),character:"⇤"},{title:e("rightwards arrow to bar"),character:"⇥"},{title:e("upwards arrow to bar"),character:"⤒"},{title:e("downwards arrow to bar"),character:"⤓"},{title:e("up down arrow with base"),character:"↨"},{title:e("back with leftwards arrow above"),character:"🔙"},{title:e("end with leftwards arrow above"),character:"🔚"},{title:e("on with exclamation mark with left right arrow above"),character:"🔛"},{title:e("soon with rightwards arrow above"),character:"🔜"},{title:e("top with upwards arrow above"),character:"🔝"}])}}class u_ extends Qt{static get pluginName(){return"SpecialCharactersLatin"}init(){const t=this.editor,e=t.t;t.plugins.get("SpecialCharacters").addItems("Latin",[{character:"Ā",title:e("Latin capital letter a with macron")},{character:"ā",title:e("Latin small letter a with macron")},{character:"Ă",title:e("Latin capital letter a with breve")},{character:"ă",title:e("Latin small letter a with breve")},{character:"Ą",title:e("Latin capital letter a with ogonek")},{character:"ą",title:e("Latin small letter a with ogonek")},{character:"Ć",title:e("Latin capital letter c with acute")},{character:"ć",title:e("Latin small letter c with acute")},{character:"Ĉ",title:e("Latin capital letter c with circumflex")},{character:"ĉ",title:e("Latin small letter c with circumflex")},{character:"Ċ",title:e("Latin capital letter c with dot above")},{character:"ċ",title:e("Latin small letter c with dot above")},{character:"Č",title:e("Latin capital letter c with caron")},{character:"č",title:e("Latin small letter c with caron")},{character:"Ď",title:e("Latin capital letter d with caron")},{character:"ď",title:e("Latin small letter d with caron")},{character:"Đ",title:e("Latin capital letter d with stroke")},{character:"đ",title:e("Latin small letter d with stroke")},{character:"Ē",title:e("Latin capital letter e with macron")},{character:"ē",title:e("Latin small letter e with macron")},{character:"Ĕ",title:e("Latin capital letter e with breve")},{character:"ĕ",title:e("Latin small letter e with breve")},{character:"Ė",title:e("Latin capital letter e with dot above")},{character:"ė",title:e("Latin small letter e with dot above")},{character:"Ę",title:e("Latin capital letter e with ogonek")},{character:"ę",title:e("Latin small letter e with ogonek")},{character:"Ě",title:e("Latin capital letter e with caron")},{character:"ě",title:e("Latin small letter e with caron")},{character:"Ĝ",title:e("Latin capital letter g with circumflex")},{character:"ĝ",title:e("Latin small letter g with circumflex")},{character:"Ğ",title:e("Latin capital letter g with breve")},{character:"ğ",title:e("Latin small letter g with breve")},{character:"Ġ",title:e("Latin capital letter g with dot above")},{character:"ġ",title:e("Latin small letter g with dot above")},{character:"Ģ",title:e("Latin capital letter g with cedilla")},{character:"ģ",title:e("Latin small letter g with cedilla")},{character:"Ĥ",title:e("Latin capital letter h with circumflex")},{character:"ĥ",title:e("Latin small letter h with circumflex")},{character:"Ħ",title:e("Latin capital letter h with stroke")},{character:"ħ",title:e("Latin small letter h with stroke")},{character:"Ĩ",title:e("Latin capital letter i with tilde")},{character:"ĩ",title:e("Latin small letter i with tilde")},{character:"Ī",title:e("Latin capital letter i with macron")},{character:"ī",title:e("Latin small letter i with macron")},{character:"Ĭ",title:e("Latin capital letter i with breve")},{character:"ĭ",title:e("Latin small letter i with breve")},{character:"Į",title:e("Latin capital letter i with ogonek")},{character:"į",title:e("Latin small letter i with ogonek")},{character:"İ",title:e("Latin capital letter i with dot above")},{character:"ı",title:e("Latin small letter dotless i")},{character:"IJ",title:e("Latin capital ligature ij")},{character:"ij",title:e("Latin small ligature ij")},{character:"Ĵ",title:e("Latin capital letter j with circumflex")},{character:"ĵ",title:e("Latin small letter j with circumflex")},{character:"Ķ",title:e("Latin capital letter k with cedilla")},{character:"ķ",title:e("Latin small letter k with cedilla")},{character:"ĸ",title:e("Latin small letter kra")},{character:"Ĺ",title:e("Latin capital letter l with acute")},{character:"ĺ",title:e("Latin small letter l with acute")},{character:"Ļ",title:e("Latin capital letter l with cedilla")},{character:"ļ",title:e("Latin small letter l with cedilla")},{character:"Ľ",title:e("Latin capital letter l with caron")},{character:"ľ",title:e("Latin small letter l with caron")},{character:"Ŀ",title:e("Latin capital letter l with middle dot")},{character:"ŀ",title:e("Latin small letter l with middle dot")},{character:"Ł",title:e("Latin capital letter l with stroke")},{character:"ł",title:e("Latin small letter l with stroke")},{character:"Ń",title:e("Latin capital letter n with acute")},{character:"ń",title:e("Latin small letter n with acute")},{character:"Ņ",title:e("Latin capital letter n with cedilla")},{character:"ņ",title:e("Latin small letter n with cedilla")},{character:"Ň",title:e("Latin capital letter n with caron")},{character:"ň",title:e("Latin small letter n with caron")},{character:"ʼn",title:e("Latin small letter n preceded by apostrophe")},{character:"Ŋ",title:e("Latin capital letter eng")},{character:"ŋ",title:e("Latin small letter eng")},{character:"Ō",title:e("Latin capital letter o with macron")},{character:"ō",title:e("Latin small letter o with macron")},{character:"Ŏ",title:e("Latin capital letter o with breve")},{character:"ŏ",title:e("Latin small letter o with breve")},{character:"Ő",title:e("Latin capital letter o with double acute")},{character:"ő",title:e("Latin small letter o with double acute")},{character:"Œ",title:e("Latin capital ligature oe")},{character:"œ",title:e("Latin small ligature oe")},{character:"Ŕ",title:e("Latin capital letter r with acute")},{character:"ŕ",title:e("Latin small letter r with acute")},{character:"Ŗ",title:e("Latin capital letter r with cedilla")},{character:"ŗ",title:e("Latin small letter r with cedilla")},{character:"Ř",title:e("Latin capital letter r with caron")},{character:"ř",title:e("Latin small letter r with caron")},{character:"Ś",title:e("Latin capital letter s with acute")},{character:"ś",title:e("Latin small letter s with acute")},{character:"Ŝ",title:e("Latin capital letter s with circumflex")},{character:"ŝ",title:e("Latin small letter s with circumflex")},{character:"Ş",title:e("Latin capital letter s with cedilla")},{character:"ş",title:e("Latin small letter s with cedilla")},{character:"Š",title:e("Latin capital letter s with caron")},{character:"š",title:e("Latin small letter s with caron")},{character:"Ţ",title:e("Latin capital letter t with cedilla")},{character:"ţ",title:e("Latin small letter t with cedilla")},{character:"Ť",title:e("Latin capital letter t with caron")},{character:"ť",title:e("Latin small letter t with caron")},{character:"Ŧ",title:e("Latin capital letter t with stroke")},{character:"ŧ",title:e("Latin small letter t with stroke")},{character:"Ũ",title:e("Latin capital letter u with tilde")},{character:"ũ",title:e("Latin small letter u with tilde")},{character:"Ū",title:e("Latin capital letter u with macron")},{character:"ū",title:e("Latin small letter u with macron")},{character:"Ŭ",title:e("Latin capital letter u with breve")},{character:"ŭ",title:e("Latin small letter u with breve")},{character:"Ů",title:e("Latin capital letter u with ring above")},{character:"ů",title:e("Latin small letter u with ring above")},{character:"Ű",title:e("Latin capital letter u with double acute")},{character:"ű",title:e("Latin small letter u with double acute")},{character:"Ų",title:e("Latin capital letter u with ogonek")},{character:"ų",title:e("Latin small letter u with ogonek")},{character:"Ŵ",title:e("Latin capital letter w with circumflex")},{character:"ŵ",title:e("Latin small letter w with circumflex")},{character:"Ŷ",title:e("Latin capital letter y with circumflex")},{character:"ŷ",title:e("Latin small letter y with circumflex")},{character:"Ÿ",title:e("Latin capital letter y with diaeresis")},{character:"Ź",title:e("Latin capital letter z with acute")},{character:"ź",title:e("Latin small letter z with acute")},{character:"Ż",title:e("Latin capital letter z with dot above")},{character:"ż",title:e("Latin small letter z with dot above")},{character:"Ž",title:e("Latin capital letter z with caron")},{character:"ž",title:e("Latin small letter z with caron")},{character:"ſ",title:e("Latin small letter long s")}])}}class m_ extends Qt{static get pluginName(){return"SpecialCharactersText"}init(){const t=this.editor,e=t.t;t.plugins.get("SpecialCharacters").addItems("Text",[{character:"‹",title:e("Single left-pointing angle quotation mark")},{character:"›",title:e("Single right-pointing angle quotation mark")},{character:"«",title:e("Left-pointing double angle quotation mark")},{character:"»",title:e("Right-pointing double angle quotation mark")},{character:"‘",title:e("Left single quotation mark")},{character:"’",title:e("Right single quotation mark")},{character:"“",title:e("Left double quotation mark")},{character:"”",title:e("Right double quotation mark")},{character:"‚",title:e("Single low-9 quotation mark")},{character:"„",title:e("Double low-9 quotation mark")},{character:"¡",title:e("Inverted exclamation mark")},{character:"¿",title:e("Inverted question mark")},{character:"‥",title:e("Two dot leader")},{character:"…",title:e("Horizontal ellipsis")},{character:"‡",title:e("Double dagger")},{character:"‰",title:e("Per mille sign")},{character:"‱",title:e("Per ten thousand sign")},{character:"‼",title:e("Double exclamation mark")},{character:"⁈",title:e("Question exclamation mark")},{character:"⁉",title:e("Exclamation question mark")},{character:"⁇",title:e("Double question mark")},{character:"©",title:e("Copyright sign")},{character:"®",title:e("Registered sign")},{character:"™",title:e("Trade mark sign")},{character:"§",title:e("Section sign")},{character:"¶",title:e("Paragraph sign")},{character:"⁋",title:e("Reversed paragraph sign")}])}}class g_ extends hu{}class f_ extends gu{}class p_ extends bu{}const w_=[class extends Qt{static get requires(){return[um,Eu,ym,pm,Mm,rg]}static get pluginName(){return"Essentials"}},class extends Qt{static get requires(){return[ag]}static get pluginName(){return"CKFinderUploadAdapter"}init(){const t=this.editor.config.get("ckfinder.uploadUrl");t&&(this.editor.plugins.get(ag).createUploadAdapter=e=>new ug(e,t,this.editor.t))}},class extends Qt{static get pluginName(){return"Autoformat"}afterInit(){this._addListAutoformats(),this._addBasicStylesAutoformats(),this._addHeadingAutoformats(),this._addBlockQuoteAutoformats(),this._addCodeBlockAutoformats(),this._addHorizontalLineAutoformats()}_addListAutoformats(){const t=this.editor.commands;t.get("bulletedList")&&mg(this.editor,this,/^[*-]\s$/,"bulletedList"),t.get("numberedList")&&mg(this.editor,this,/^1[.|)]\s$/,"numberedList"),t.get("todoList")&&mg(this.editor,this,/^\[\s?\]\s$/,"todoList"),t.get("checkTodoList")&&mg(this.editor,this,/^\[\s?x\s?\]\s$/,()=>{this.editor.execute("todoList"),this.editor.execute("checkTodoList")})}_addBasicStylesAutoformats(){const t=this.editor.commands;if(t.get("bold")){const t=pg(this.editor,"bold");gg(this.editor,this,/(?:^|\s)(\*\*)([^*]+)(\*\*)$/g,t),gg(this.editor,this,/(?:^|\s)(__)([^_]+)(__)$/g,t)}if(t.get("italic")){const t=pg(this.editor,"italic");gg(this.editor,this,/(?:^|\s)(\*)([^*_]+)(\*)$/g,t),gg(this.editor,this,/(?:^|\s)(_)([^_]+)(_)$/g,t)}if(t.get("code")){const t=pg(this.editor,"code");gg(this.editor,this,/(`)([^`]+)(`)$/g,t)}if(t.get("strikethrough")){const t=pg(this.editor,"strikethrough");gg(this.editor,this,/(~~)([^~]+)(~~)$/g,t)}}_addHeadingAutoformats(){const t=this.editor.commands.get("heading");t&&t.modelElements.filter(t=>t.match(/^heading[1-6]$/)).forEach(e=>{const i=e[7],n=new RegExp(`^(#{${i}})\\s$`);mg(this.editor,this,n,()=>{if(!t.isEnabled||t.value===e)return!1;this.editor.execute("heading",{value:e})})})}_addBlockQuoteAutoformats(){this.editor.commands.get("blockQuote")&&mg(this.editor,this,/^>\s$/,"blockQuote")}_addCodeBlockAutoformats(){this.editor.commands.get("codeBlock")&&mg(this.editor,this,/^```$/,"codeBlock")}_addHorizontalLineAutoformats(){this.editor.commands.get("horizontalLine")&&mg(this.editor,this,/^---$/,"horizontalLine")}},class extends Qt{static get requires(){return[bg,kg]}static get pluginName(){return"Bold"}},um,class extends Qt{static get requires(){return[_g,vg]}static get pluginName(){return"Italic"}},class extends Qt{static get requires(){return[Dk,Vk]}static get pluginName(){return"Underline"}},class extends Qt{static get requires(){return[Ok,zk]}static get pluginName(){return"Strikethrough"}},class extends Qt{static get requires(){return[Nk,Rk]}static get pluginName(){return"Subscript"}},class extends Qt{static get requires(){return[Ik,Lk]}static get pluginName(){return"Superscript"}},class extends Qt{static get requires(){return[Tg,Eg]}static get pluginName(){return"BlockQuote"}},class extends Qt{static get pluginName(){return"CKFinder"}static get requires(){return["Image","Link","CKFinderUploadAdapter",Ig,Pg]}},class extends Qt{static get requires(){return[Vg,jg]}static get pluginName(){return"Heading"}},class extends Qt{static get requires(){return[Qg,Zg,nm]}static get pluginName(){return"HtmlEmbed"}},class extends Qt{static get requires(){return[cf,nm,pf]}static get pluginName(){return"Image"}isImageWidget(t){return tf(t)}},class extends Qt{static get requires(){return[kf]}static get pluginName(){return"ImageCaption"}},class extends Qt{static get requires(){return[Mf,If]}static get pluginName(){return"ImageStyle"}},class extends Qt{static get requires(){return[Bg]}static get pluginName(){return"ImageToolbar"}afterInit(){const t=this.editor,e=t.t;t.plugins.get(Bg).register("image",{ariaLabel:e("Image toolbar"),items:t.config.get("image.toolbar")||[],getRelatedElement:ef})}},class extends Qt{static get pluginName(){return"ImageUpload"}static get requires(){return[qf,Of,zf]}},class extends Qt{static get requires(){return[Gf,Jf,Kf]}static get pluginName(){return"ImageResize"}},class extends Qt{static get requires(){return[Np,Hp]}static get pluginName(){return"LinkImage"}},class extends Qt{static get pluginName(){return"Indent"}static get requires(){return[qp,Gp]}},class extends Qt{static get requires(){return[Pp,Bp,Kp]}static get pluginName(){return"Link"}},class extends Qt{static get requires(){return[vw,xw]}static get pluginName(){return"List"}},class extends Qt{static get requires(){return[Iw,Ow,Nw,nm]}static get pluginName(){return"MediaEmbed"}},Og,class extends Qt{static get pluginName(){return"PasteFromOffice"}static get requires(){return[yu]}init(){const t=this.editor,e=t.editing.view.document,i=[];i.push(new Gw(e)),i.push(new Fw(e)),t.plugins.get("ClipboardPipeline").on("inputTransformation",(t,e)=>{if(e.isTransformedWithPasteFromOffice)return;const n=e.dataTransfer.getData("text/html"),o=i.find(t=>t.isActive(n));o&&(o.execute(e),e.isTransformedWithPasteFromOffice=!0)},{priority:"high"})}},class extends Qt{static get requires(){return[Qw,Yw]}static get pluginName(){return"RemoveFormat"}},class extends Qt{static get requires(){return[gk,wk,kk,Tk,Ak,_k,nm]}static get pluginName(){return"Table"}},class extends Qt{static get requires(){return[Bg]}static get pluginName(){return"TableToolbar"}afterInit(){const t=this.editor,e=t.t,i=t.plugins.get(Bg),n=t.config.get("table.contentToolbar"),o=t.config.get("table.tableToolbar");n&&i.register("tableContent",{ariaLabel:e("Table toolbar"),items:n,getRelatedElement:Sk}),o&&i.register("table",{ariaLabel:e("Table toolbar"),items:o,getRelatedElement:Pk})}},class extends Qt{static get pluginName(){return"TextTransformation"}constructor(t){super(t),t.config.define("typing",{transformations:{include:Um}})}init(){const t=this.editor.model.document.selection;t.on("change:range",()=>{this.isEnabled=!t.anchor.parent.is("element","codeBlock")}),this._enableTransformationWatchers()}_enableTransformationWatchers(){const t=this.editor,e=t.model,i=t.plugins.get("Input"),n=function(t){const e=t.extra||[],i=t.remove||[],n=t=>!i.includes(t);return function(t){const e=new Set;for(const i of t)if(Hm[i])for(const t of Hm[i])e.add(t);else e.add(i);return Array.from(e)}(t.include.concat(e).filter(n)).filter(n).map(t=>Fm[t]||t).map(t=>({from:qm(t.from),to:Wm(t.to)}))}(t.config.get("typing.transformations")),o=new Lm(t.model,t=>{for(const e of n){if(e.from.test(t))return{normalizedTransformation:e}}});o.on("matched:data",(t,n)=>{if(!i.isInput(n.batch))return;const{from:o,to:r}=n.normalizedTransformation,s=o.exec(n.text),a=r(s.slice(1)),l=n.range;let c=s.index;e.enqueueChange(t=>{for(let i=1;i<s.length;i++){const n=s[i],o=a[i-1];if(null==o){c+=n.length;continue}const r=l.start.getShiftedBy(c),d=e.createRange(r,r.getShiftedBy(n.length)),h=$m(r);e.insertContent(t.createText(o,h),d),c+=o.length}})}),o.bind("isEnabled").to(this)}},class extends Qt{static get requires(){return[Wk,Gk]}static get pluginName(){return"FontColor"}},class extends Qt{static get requires(){return[Kk,Qk]}static get pluginName(){return"FontBackgroundColor"}},class extends Qt{static get requires(){return[i_,o_]}static get pluginName(){return"Alignment"}},class extends Qt{static get requires(){return[Mm]}static get pluginName(){return"SpecialCharacters"}constructor(t){super(t),this._characters=new Map,this._groups=new Map}init(){const t=this.editor,e=t.t,i=t.commands.get("input");t.ui.componentFactory.add("specialCharacters",n=>{const o=Qd(n);let r;return o.buttonView.set({label:e("Special characters"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M10 2.5a7.47 7.47 0 0 1 4.231 1.31 7.268 7.268 0 0 1 2.703 3.454 7.128 7.128 0 0 1 .199 4.353c-.39 1.436-1.475 2.72-2.633 3.677h2.013c0-.226.092-.443.254-.603a.876.876 0 0 1 1.229 0c.163.16.254.377.254.603v.853c0 .209-.078.41-.22.567a.873.873 0 0 1-.547.28l-.101.006h-4.695a.517.517 0 0 1-.516-.518v-1.265c0-.21.128-.398.317-.489a5.601 5.601 0 0 0 2.492-2.371 5.459 5.459 0 0 0 .552-3.693 5.53 5.53 0 0 0-1.955-3.2A5.71 5.71 0 0 0 10 4.206 5.708 5.708 0 0 0 6.419 5.46 5.527 5.527 0 0 0 4.46 8.663a5.457 5.457 0 0 0 .554 3.695 5.6 5.6 0 0 0 2.497 2.37.55.55 0 0 1 .317.49v1.264c0 .286-.23.518-.516.518H2.618a.877.877 0 0 1-.614-.25.845.845 0 0 1-.254-.603v-.853c0-.226.091-.443.254-.603a.876.876 0 0 1 1.228 0c.163.16.255.377.255.603h1.925c-1.158-.958-2.155-2.241-2.545-3.678a7.128 7.128 0 0 1 .199-4.352 7.268 7.268 0 0 1 2.703-3.455A7.475 7.475 0 0 1 10 2.5z"/></svg>',tooltip:!0}),o.bind("isEnabled").to(i),o.on("execute",(e,i)=>{t.execute("input",{text:i.character}),t.editing.view.focus()}),o.on("change:isOpen",()=>{r||(r=this._createDropdownPanelContent(n,o),o.panelView.children.add(r.navigationView),o.panelView.children.add(r.gridView),o.panelView.children.add(r.infoView)),r.infoView.set({character:null,name:null})}),o})}addItems(t,e){if("All"===t)throw new l.a('special-character-invalid-group-name: The name "All" is reserved and cannot be used.');const i=this._getGroup(t);for(const t of e)i.add(t.title),this._characters.set(t.title,t.character)}getGroups(){return this._groups.keys()}getCharactersForGroup(t){return"All"===t?new Set(this._characters.keys()):this._groups.get(t)}getCharacter(t){return this._characters.get(t)}_getGroup(t){return this._groups.has(t)||this._groups.set(t,new Set),this._groups.get(t)}_updateGrid(t,e){e.tiles.clear();const i=this.getCharactersForGroup(t);for(const t of i){const i=this.getCharacter(t);e.tiles.add(e.createTile(i,t))}}_createDropdownPanelContent(t,e){const i=[...this.getGroups()];i.unshift("All");const n=new r_(t,i),o=new s_(t),r=new a_(t);return o.delegate("execute").to(e),o.on("tileHover",(t,e)=>{r.set(e)}),n.on("execute",()=>{this._updateGrid(n.currentGroupName,o)}),this._updateGrid(n.currentGroupName,o),{navigationView:n,gridView:o,infoView:r}}},class extends Qt{static get requires(){return[c_,m_,d_,h_,u_]}},function(t){t.plugins.get("SpecialCharacters").addItems("Emoji",[{title:"cool",character:"😎"},{title:"surprise",character:"😮"},{title:"confusion",character:"😕"},{title:"crying",character:"😢"},{character:"🙂",title:"Slightly smiling face"},{character:"😀",title:"Smiling face"},{character:"😃",title:"Smiling face with big eyes"},{character:"😄",title:"Smiling face with smiling eyes"},{character:"😁",title:"Beaming face with smiling eyes"},{character:"😅",title:"Smiling face with tears"},{character:"😆",title:"Grinning face"},{character:"🤣",title:"Rolling on the floor laughing"},{character:"😂",title:"Lauging with tears"},{character:"🙃",title:"Upside down face"},{character:"😉",title:"Winking face"},{character:"😊",title:"Smiling face with smiling eyes"},{character:"😇",title:"Smiling face with halo"},{character:"🤓",title:"Nerdy face"},{character:"🧐",title:"Face with monocle"},{character:"🥳",title:"Partying face"}])}];f_.builtinPlugins=w_,g_.builtinPlugins=w_,p_.builtinPlugins=w_;const b_={alignment:{options:["left","center","right","justify"]},toolbar:{items:["heading","|","bold","italic","underline","strikethrough","subscript","superscript","link","bulletedList","numberedList","|","fontColor","fontBackgroundColor","|","alignment","|","indent","outdent","|","imageUpload","blockQuote","insertTable","mediaEmbed","undo","redo","specialCharacters"]},image:{styles:["alignLeft","alignCenter","alignRight"],resizeOptions:[{name:"imageResize:original",label:"Original",value:null},{name:"imageResize:100",label:"100%",value:"100"},{name:"imageResize:75",label:"75%",value:"75"},{name:"imageResize:50",label:"50%",value:"50"}],toolbar:["imageStyle:alignCenter","imageStyle:alignLeft","imageStyle:alignRight","|","imageResize","|","imageTextAlternative"]},table:{contentToolbar:["tableColumn","tableRow","mergeTableCells"]},language:"en"};f_.defaultConfig=b_,g_.defaultConfig=b_,p_.defaultConfig=b_;e.default={BalloonEditor:f_,ClassicEditor:g_,InlineEditor:p_}}]).default}));
  6. //# sourceMappingURL=ckeditor.js.map