{"version":3,"file":"ckeditor.js","sources":["webpack://ClassicEditor/ckeditor.js"],"sourcesContent":["/*!\n * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n(function(e){e[\"en\"]=Object.assign(e[\"en\"]||{},{a:\"Image toolbar\",b:\"Media toolbar\",c:\"Table toolbar\",d:\"Dollar sign\",e:\"Euro sign\",f:\"Yen sign\",g:\"Pound sign\",h:\"Cent sign\",i:\"Euro-currency sign\",j:\"Colon sign\",k:\"Cruzeiro sign\",l:\"French franc sign\",m:\"Lira sign\",n:\"Currency sign\",o:\"Bitcoin sign\",p:\"Mill sign\",q:\"Naira sign\",r:\"Peseta sign\",s:\"Rupee sign\",t:\"Won sign\",u:\"New sheqel sign\",v:\"Dong sign\",w:\"Kip sign\",x:\"Tugrik sign\",y:\"Drachma sign\",z:\"German penny sign\",aa:\"Peso sign\",ab:\"Guarani sign\",ac:\"Austral sign\",ad:\"Hryvnia sign\",ae:\"Cedi sign\",af:\"Livre tournois sign\",ag:\"Spesmilo sign\",ah:\"Tenge sign\",ai:\"Indian rupee sign\",aj:\"Turkish lira sign\",ak:\"Nordic mark sign\",al:\"Manat sign\",am:\"Ruble sign\",an:\"Special characters\",ao:\"leftwards double arrow\",ap:\"rightwards double arrow\",aq:\"upwards double arrow\",ar:\"downwards double arrow\",as:\"leftwards dashed arrow\",at:\"rightwards dashed arrow\",au:\"upwards dashed arrow\",av:\"downwards dashed arrow\",aw:\"leftwards arrow to bar\",ax:\"rightwards arrow to bar\",ay:\"upwards arrow to bar\",az:\"downwards arrow to bar\",ba:\"up down arrow with base\",bb:\"back with leftwards arrow above\",bc:\"end with leftwards arrow above\",bd:\"on with exclamation mark with left right arrow above\",be:\"soon with rightwards arrow above\",bf:\"top with upwards arrow above\",bg:\"Block quote\",bh:\"Choose heading\",bi:\"Heading\",bj:\"Increase indent\",bk:\"Decrease indent\",bl:\"Link\",bm:\"Numbered List\",bn:\"Bulleted List\",bo:\"media widget\",bp:\"Insert media\",bq:\"The URL must not be empty.\",br:\"This media URL is not supported.\",bs:\"Bold\",bt:\"Italic\",bu:\"Underline\",bv:\"Code\",bw:\"image widget\",bx:\"Enter image caption\",by:\"Full size image\",bz:\"Side image\",ca:\"Left aligned image\",cb:\"Centered image\",cc:\"Right aligned image\",cd:\"Insert image\",ce:\"Upload failed\",cf:\"Widget toolbar\",cg:\"Table properties\",ch:\"Cell properties\",ci:\"Horizontal line\",cj:\"Disable editing\",ck:\"Enable editing\",cl:\"Remove Format\",cm:\"Yellow marker\",cn:\"Green marker\",co:\"Pink marker\",cp:\"Blue marker\",cq:\"Red pen\",cr:\"Green pen\",cs:\"Remove highlight\",ct:\"Highlight\",cu:\"Text highlight toolbar\",cv:\"Upload in progress\",cw:\"Character categories\",cx:\"Font Family\",cy:\"Default\",cz:\"Font Size\",da:\"Tiny\",db:\"Small\",dc:\"Big\",dd:\"Huge\",de:\"Font Color\",df:\"Font Background Color\",dg:\"Change image text alternative\",dh:\"Dropdown toolbar\",di:\"Rich Text Editor\",dj:\"Black\",dk:\"Dim grey\",dl:\"Grey\",dm:\"Light grey\",dn:\"White\",do:\"Red\",dp:\"Orange\",dq:\"Yellow\",dr:\"Light green\",ds:\"Green\",dt:\"Aquamarine\",du:\"Turquoise\",dv:\"Light blue\",dw:\"Blue\",dx:\"Purple\",dy:\"Remove color\",dz:\"Document colors\",ea:\"Save\",eb:\"Cancel\",ec:\"Text alternative\",ed:\"Undo\",ee:\"Redo\",ef:\"%0 of %1\",eg:\"Previous\",eh:\"Next\",ei:\"Editor toolbar\",ej:\"Show more items\",ek:\"None\",el:\"Solid\",em:\"Dotted\",en:\"Dashed\",eo:\"Double\",ep:\"Groove\",eq:\"Ridge\",er:\"Inset\",es:\"Outset\",et:'The color is invalid. Try \"#FF0000\" or \"rgb(255,0,0)\" or \"red\".',eu:'The value is invalid. Try \"10px\" or \"2em\" or simply \"2\".',ev:\"Border\",ew:\"Style\",ex:\"Width\",ey:\"Color\",ez:\"Background\",fa:\"Dimensions\",fb:\"Height\",fc:\"Padding\",fd:\"Table cell text alignment\",fe:\"Horizontal text alignment toolbar\",ff:\"Vertical text alignment toolbar\",fg:\"Align cell text to the left\",fh:\"Align cell text to the center\",fi:\"Align cell text to the right\",fj:\"Justify cell text\",fk:\"Align cell text to the top\",fl:\"Align cell text to the middle\",fm:\"Align cell text to the bottom\",fn:\"Alignment\",fo:\"Table alignment toolbar\",fp:\"Align table to the left\",fq:\"Center table\",fr:\"Align table to the right\",fs:\"Paste the media URL in the input.\",ft:\"Tip: Paste the URL into the content to embed faster.\",fu:\"Media URL\",fv:\"Open in a new tab\",fw:\"Downloadable\",fx:\"Unlink\",fy:\"Edit link\",fz:\"Open link in new tab\",ga:\"This link has no URL\",gb:\"Link URL\",gc:\"Paragraph\",gd:\"Heading 1\",ge:\"Heading 2\",gf:\"Heading 3\",gg:\"Heading 4\",gh:\"Heading 5\",gi:\"Heading 6\",gj:\"Rich Text Editor, %0\",gk:\"Insert code block\",gl:\"Align left\",gm:\"Align right\",gn:\"Align center\",go:\"Justify\",gp:\"Text alignment\",gq:\"Text alignment toolbar\",gr:\"Insert table\",gs:\"Header column\",gt:\"Insert column left\",gu:\"Insert column right\",gv:\"Delete column\",gw:\"Column\",gx:\"Header row\",gy:\"Insert row below\",gz:\"Insert row above\",ha:\"Delete row\",hb:\"Row\",hc:\"Merge cell up\",hd:\"Merge cell right\",he:\"Merge cell down\",hf:\"Merge cell left\",hg:\"Split cell vertically\",hh:\"Split cell horizontally\",hi:\"Merge cells\",hj:\"Plain text\"})})(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));(function e(t,i){if(typeof exports===\"object\"&&typeof module===\"object\")module.exports=i();else if(typeof define===\"function\"&&define.amd)define([],i);else if(typeof exports===\"object\")exports[\"ClassicEditor\"]=i();else t[\"ClassicEditor\"]=i()})(window,(function(){return function(e){var t={};function i(n){if(t[n]){return t[n].exports}var o=t[n]={i:n,l:false,exports:{}};e[n].call(o.exports,o,o.exports,i);o.l=true;return o.exports}i.m=e;i.c=t;i.d=function(e,t,n){if(!i.o(e,t)){Object.defineProperty(e,t,{enumerable:true,get:n})}};i.r=function(e){if(typeof Symbol!==\"undefined\"&&Symbol.toStringTag){Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"})}Object.defineProperty(e,\"__esModule\",{value:true})};i.t=function(e,t){if(t&1)e=i(e);if(t&8)return e;if(t&4&&typeof e===\"object\"&&e&&e.__esModule)return e;var n=Object.create(null);i.r(n);Object.defineProperty(n,\"default\",{enumerable:true,value:e});if(t&2&&typeof e!=\"string\")for(var o in e)i.d(n,o,function(t){return e[t]}.bind(null,o));return n};i.n=function(e){var t=e&&e.__esModule?function t(){return e[\"default\"]}:function t(){return e};i.d(t,\"a\",t);return t};i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};i.p=\"\";return i(i.s=140)}([function(e,t,i){\"use strict\";i.d(t,\"b\",(function(){return o}));i.d(t,\"a\",(function(){return r}));const n=\"https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html\";class o extends Error{constructor(e,t,i){e=r(e);if(i){e+=\" \"+JSON.stringify(i)}super(e);this.name=\"CKEditorError\";this.context=t;this.data=i}is(e){return e===\"CKEditorError\"}static rethrowUnexpectedError(e,t){if(e.is&&e.is(\"CKEditorError\")){throw e}const i=new o(e.message,t);i.stack=e.stack;throw i}}function r(e){const t=e.match(/^([^:]+):/);if(!t){return e}return e+` Read more: ${n}#error-${t[1]}\\n`}},function(e,t,i){\"use strict\";var n=function e(){var t;return function e(){if(typeof t===\"undefined\"){t=Boolean(window&&document&&document.all&&!window.atob)}return t}}();var o=function e(){var t={};return function e(i){if(typeof t[i]===\"undefined\"){var n=document.querySelector(i);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement){try{n=n.contentDocument.head}catch(e){n=null}}t[i]=n}return t[i]}}();var r=[];function s(e){var t=-1;for(var i=0;i:first-child{margin-top:var(--ck-spacing-large)}.ck.ck-editor__editable_inline>:last-child{margin-bottom:var(--ck-spacing-large)}.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(e,t,i){var n=i(1);var o=i(24);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.exports=\".ck.ck-label{display:block}.ck.ck-voice-label{display:none}.ck.ck-label{font-weight:700}\"},function(e,t,i){var n=i(1);var o=i(26);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.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(e,t,i){var n=i(1);var o=i(28);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.exports=\".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);position:absolute}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel-visible{display:inline-block}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw{bottom:100%}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se,.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}:root{--ck-dropdown-arrow-size:calc(0.5*var(--ck-icon-size))}.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-small)}[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__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(e,t,i){var n=i(1);var o=i(30);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.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(e,t,i){var n=i(1);var o=i(32);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.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{bottom:calc(-1*var(--ck-tooltip-arrow-size));transform:translateY(100%)}.ck.ck-tooltip.ck-tooltip_s .ck-tooltip__text:after{top:calc(-1*var(--ck-tooltip-arrow-size));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_n{top:calc(-1*var(--ck-tooltip-arrow-size));transform:translateY(-100%)}.ck.ck-tooltip.ck-tooltip_n .ck-tooltip__text:after{bottom:calc(-1*var(--ck-tooltip-arrow-size));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)}'},function(e,t,i){var n=i(1);var o=i(34);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.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(-1*var(--ck-spacing-small));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(-1*var(--ck-spacing-small));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(e,t,i){var n=i(1);var o=i(36);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.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(0.2*var(--ck-line-height-base)*var(--ck-font-size-base)) calc(0.4*var(--ck-line-height-base)*var(--ck-font-size-base))}.ck.ck-list__item .ck-button .ck-button__label{line-height:calc(1.2*var(--ck-line-height-base)*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(e,t,i){var n=i(1);var o=i(38);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.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:1.3846153847em}[dir=ltr] .ck.ck-button.ck-switchbutton .ck-button__label{margin-right:calc(2*var(--ck-spacing-large))}[dir=rtl] .ck.ck-button.ck-switchbutton .ck-button__label{margin-left:calc(2*var(--ck-spacing-large))}.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(0.5*var(--ck-border-radius))}.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(-1*var(--ck-switch-button-translation)))}\"},function(e,t,i){var n=i(1);var o=i(40);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.exports=\".ck.ck-toolbar-dropdown .ck.ck-toolbar .ck.ck-toolbar__items{flex-wrap:nowrap}.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(e,t,i){var n=i(1);var o=i(42);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.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(e,t,i){var n=i(1);var o=i(44);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.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_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;margin-top:0;margin-bottom:0;background:var(--ck-color-toolbar-border)}.ck.ck-toolbar>.ck-toolbar__items>*{margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small);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>*,.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(e,t,i){var n=i(1);var o=i(46);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.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(e,t,i){var n=i(1);var o=i(48);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.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(e,t){e.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(e,t,i){var n=i(1);var o=i(51);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.exports=\":root{--ck-color-resizer:var(--ck-color-focus-border);--ck-resizer-size:10px;--ck-resizer-border-width:1px;--ck-resizer-border-radius:2px;--ck-resizer-offset:calc(var(--ck-resizer-size)/-2 - 2px);--ck-resizer-tooltip-offset:10px;--ck-color-resizer-tooltip-background:#262626;--ck-color-resizer-tooltip-text:#f2f2f2}.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))}.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 .ck-widget__selection-handle,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover .ck-widget__selection-handle{opacity:1;background-color:var(--ck-color-focus-border)}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected .ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover .ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator{opacity:1}.ck-editor__editable>.ck-widget.ck-widget_with-selection-handle:first-child,.ck-editor__editable blockquote>.ck-widget.ck-widget_with-selection-handle:first-child{margin-top:calc(1em + var(--ck-widget-handler-icon-size))}.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-editor__editable.ck-blurred .ck-widget.ck-widget_selected,.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover{outline-color:var(--ck-color-widget-blurred-border)}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle .ck-widget__selection-handle,.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle .ck-widget__selection-handle:hover,.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover.ck-widget_with-selection-handle .ck-widget__selection-handle,.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-editor__editable.ck-read-only .ck-widget{--ck-widget-outline-thickness:0}\"},function(e,t,i){var n=i(1);var o=i(53);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.exports=\".ck.ck-labeled-input .ck-labeled-input__status{font-size:var(--ck-font-size-small);margin-top:var(--ck-spacing-small);white-space:normal}.ck.ck-labeled-input .ck-labeled-input__status_error{color:var(--ck-color-base-error)}\"},function(e,t,i){var n=i(1);var o=i(55);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.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{box-shadow:var(--ck-inner-shadow),0 0;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 .2s ease-in-out,border .2s ease-in-out}.ck.ck-input-text:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),var(--ck-inner-shadow)}.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),var(--ck-inner-shadow)}.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),var(--ck-inner-shadow)}@keyframes ck-text-input-shake{20%{transform:translateX(-2px)}40%{transform:translateX(2px)}60%{transform:translateX(-1px)}80%{transform:translateX(1px)}}\"},function(e,t,i){var n=i(1);var o=i(57);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.exports=\".ck.ck-text-alternative-form{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-text-alternative-form .ck-labeled-input{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-input{flex-basis:100%}.ck.ck-text-alternative-form .ck-button{flex-basis:50%}}.ck.ck-text-alternative-form{padding:var(--ck-spacing-standard)}.ck.ck-text-alternative-form:focus{outline:none}[dir=ltr] .ck.ck-text-alternative-form>:not(:first-child),[dir=rtl] .ck.ck-text-alternative-form>:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-text-alternative-form{padding:0;width:calc(0.8*var(--ck-input-text-width))}.ck.ck-text-alternative-form .ck-labeled-input{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-text-alternative-form .ck-labeled-input .ck-input-text{min-width:0;width:100%}.ck.ck-text-alternative-form .ck-button{padding:var(--ck-spacing-standard);margin-top:var(--ck-spacing-standard);border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-text-alternative-form .ck-button{margin-left:0}[dir=ltr] .ck.ck-text-alternative-form .ck-button:first-of-type{border-right:1px solid var(--ck-color-base-border)}[dir=rtl] .ck.ck-text-alternative-form .ck-button{margin-left:0}[dir=rtl] .ck.ck-text-alternative-form .ck-button:last-of-type{border-right:1px solid var(--ck-color-base-border)}}\"},function(e,t,i){var n=i(1);var o=i(59);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.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.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)}.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(-1*var(--ck-balloon-arrow-half-width));top:calc(-1*var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:before{left:calc(2*var(--ck-balloon-arrow-half-width));top:calc(-1*var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:before{right:calc(2*var(--ck-balloon-arrow-half-width));top:calc(-1*var(--ck-balloon-arrow-height))}.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(-1*var(--ck-balloon-arrow-half-width));bottom:calc(-1*var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:before{left:calc(2*var(--ck-balloon-arrow-half-width));bottom:calc(-1*var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:before{right:calc(2*var(--ck-balloon-arrow-half-width));bottom:calc(-1*var(--ck-balloon-arrow-height))}.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(2*var(--ck-balloon-arrow-half-width));bottom:calc(-1*var(--ck-balloon-arrow-height))}.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(2*var(--ck-balloon-arrow-half-width));bottom:calc(-1*var(--ck-balloon-arrow-height))}.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(2*var(--ck-balloon-arrow-half-width));top:calc(-1*var(--ck-balloon-arrow-height))}.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(2*var(--ck-balloon-arrow-half-width));top:calc(-1*var(--ck-balloon-arrow-height))}'},function(e,t,i){var n=i(1);var o=i(61);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.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(e,t,i){var n=i(1);var o=i(63);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.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(e,t,i){var n=i(1);var o=i(65);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.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}\"},function(e,t,i){var n=i(1);var o=i(67);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.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(e,t,i){var n=i(1);var o=i(69);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.exports=\":root{--ck-image-style-spacing:1.5em}.ck-content .image-style-align-center,.ck-content .image-style-align-left,.ck-content .image-style-align-right,.ck-content .image-style-side{max-width:50%}.ck-content .image-style-side{float:right;margin-left:var(--ck-image-style-spacing)}.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(e,t,i){var n=i(1);var o=i(71);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.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(e,t,i){var n=i(1);var o=i(73);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.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(e,t,i){var n=i(1);var o=i(75);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.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(e,t,i){var n=i(1);var o=i(77);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.exports=\".ck .ck-link_selected{background:var(--ck-color-link-selected-background)}\"},function(e,t,i){var n=i(1);var o=i(79);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.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-input{flex-basis:100%}.ck.ck-link-form .ck-button{flex-basis:50%}}.ck.ck-link-form_layout-vertical{display:block}.ck.ck-link-form{padding:var(--ck-spacing-standard)}.ck.ck-link-form:focus{outline:none}[dir=ltr] .ck.ck-link-form>:not(:first-child),[dir=rtl] .ck.ck-link-form>:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-link-form{padding:0;width:calc(0.8*var(--ck-input-text-width))}.ck.ck-link-form .ck-labeled-input{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-link-form .ck-labeled-input .ck-input-text{min-width:0;width:100%}.ck.ck-link-form .ck-button{padding:var(--ck-spacing-standard);margin-top:var(--ck-spacing-standard);border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-link-form .ck-button{margin-left:0}[dir=ltr] .ck.ck-link-form .ck-button:first-of-type{border-right:1px solid var(--ck-color-base-border)}[dir=rtl] .ck.ck-link-form .ck-button{margin-left:0}[dir=rtl] .ck.ck-link-form .ck-button:last-of-type{border-right:1px solid var(--ck-color-base-border)}}.ck.ck-link-form_layout-vertical{padding:0;min-width:var(--ck-input-text-width)}.ck.ck-link-form_layout-vertical .ck-labeled-input{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) var(--ck-spacing-small)}.ck.ck-link-form_layout-vertical .ck-labeled-input .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{margin-left:0}[dir=ltr] .ck.ck-link-form_layout-vertical .ck-button:first-of-type{border-right:1px solid var(--ck-color-base-border)}[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-left:0}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton{border:0;width:100%}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton:hover{background:none}\"},function(e,t,i){var n=i(1);var o=i(81);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.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{padding:var(--ck-spacing-standard)}.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}.ck.ck-link-actions:focus{outline:none}[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{padding:0;width:calc(0.8*var(--ck-input-text-width))}.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%}.ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){padding:var(--ck-spacing-standard);margin-top:var(--ck-spacing-standard);border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){margin-left:0}[dir=ltr] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview):first-of-type{border-right:1px solid var(--ck-color-base-border)}[dir=rtl] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){margin-left:0}[dir=rtl] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview):last-of-type{border-right:1px solid var(--ck-color-base-border)}}\"},function(e,t,i){var n=i(1);var o=i(83);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.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*=\"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*=\"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(3*var(--ck-spacing-standard));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*=\"google.com/maps\"] .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,#1400c8,#b900b4,#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(e,t,i){var n=i(1);var o=i(85);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.exports=\".ck.ck-media-form{display:flex;align-items:flex-start;flex-direction:row;flex-wrap:nowrap}.ck.ck-media-form .ck-labeled-input{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-input{flex-basis:100%}.ck.ck-media-form .ck-button{flex-basis:50%}}.ck.ck-media-form{padding:var(--ck-spacing-standard)}.ck.ck-media-form:focus{outline:none}[dir=ltr] .ck.ck-media-form>:not(:first-child),[dir=rtl] .ck.ck-media-form>:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-media-form{padding:0;width:calc(0.8*var(--ck-input-text-width))}.ck.ck-media-form .ck-labeled-input{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-media-form .ck-labeled-input .ck-input-text{min-width:0;width:100%}.ck.ck-media-form .ck-labeled-input .ck-labeled-input__error{white-space:normal}.ck.ck-media-form .ck-button{padding:var(--ck-spacing-standard);margin-top:var(--ck-spacing-standard);border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-media-form .ck-button{margin-left:0}[dir=ltr] .ck.ck-media-form .ck-button:first-of-type{border-right:1px solid var(--ck-color-base-border)}[dir=rtl] .ck.ck-media-form .ck-button{margin-left:0}[dir=rtl] .ck.ck-media-form .ck-button:last-of-type{border-right:1px solid var(--ck-color-base-border)}}\"},function(e,t,i){var n=i(1);var o=i(87);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.exports=\".ck-content .media{clear:both;margin:1em 0;display:block;min-width:15em}\"},function(e,t,i){var n=i(1);var o=i(89);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.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(e,t,i){var n=i(1);var o=i(91);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.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(e,t,i){var n=i(1);var o=i(93);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.exports=\":root{--ck-table-selected-cell-background:#cee5fd}.ck.ck-editor__editable .table table td.ck-editor__editable_selected,.ck.ck-editor__editable .table table th.ck-editor__editable_selected{background-color:var(--ck-table-selected-cell-background)!important;caret-color:transparent;outline:unset;box-shadow:unset}.ck.ck-editor__editable .table table td.ck-editor__editable_selected ::selection,.ck.ck-editor__editable .table table th.ck-editor__editable_selected ::selection{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(e,t,i){var n=i(1);var o=i(95);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.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-color:#bfbfbf}.ck-content .table table th{font-weight:700;background:hsla(0,0%,0%,5%)}\"},function(e,t,i){var n=i(1);var o=i(97);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.exports=\".ck .ck-widget_with-resizer{position:relative}.ck .ck-widget__resizer{display:none;position:absolute;pointer-events:none;left:0;top:0;outline:1px solid var(--ck-color-resizer)}.ck-focused .ck-widget_with-resizer.ck-widget_selected>.ck-widget__resizer{display:block}.ck .ck-widget__resizer__handle{position:absolute;pointer-events:all;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);cursor:nwse-resize}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-right{top:var(--ck-resizer-offset);right:var(--ck-resizer-offset);cursor:nesw-resize}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-right{bottom:var(--ck-resizer-offset);right:var(--ck-resizer-offset);cursor:nwse-resize}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-left{bottom:var(--ck-resizer-offset);left:var(--ck-resizer-offset);cursor:nesw-resize}\"},function(e,t,i){var n=i(1);var o=i(99);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.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}\"},function(e,t,i){var n=i(1);var o=i(101);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.exports=\".ck.ck-labeled-view .ck-labeled-view__status{font-size:var(--ck-font-size-small);margin-top:var(--ck-spacing-small);white-space:normal}.ck.ck-labeled-view .ck-labeled-view__status_error{color:var(--ck-color-base-error)}.ck.ck-labeled-view>.ck.ck-label{width:100%;text-overflow:ellipsis;overflow:hidden}\"},function(e,t,i){var n=i(1);var o=i(103);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.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(e,t,i){var n=i(1);var o=i(105);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.exports=\".ck.ck-input-color{width:100%;display:flex}.ck.ck-input-color>input.ck.ck-input-text{min-width:auto;flex-grow:1}.ck.ck-input-color>input.ck.ck-input-text:active,.ck.ck-input-color>input.ck.ck-input-text:focus{z-index:var(--ck-z-default)}.ck.ck-input-color>div.ck.ck-dropdown{min-width:auto}.ck.ck-input-color>div.ck.ck-dropdown>.ck-input-color__button .ck-dropdown__arrow{display:none}.ck.ck-input-color .ck.ck-input-color__button .ck.ck-input-color__button__preview{position:relative;overflow:hidden}.ck.ck-input-color .ck.ck-input-color__button .ck.ck-input-color__button__preview>.ck.ck-input-color__button__preview__no-color-indicator{position:absolute;display:block}[dir=ltr] .ck.ck-input-color>.ck.ck-input-text{border-top-right-radius:0;border-bottom-right-radius:0}[dir=rtl] .ck.ck-input-color>.ck.ck-input-text{border-top-left-radius:0;border-bottom-left-radius:0}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-input-color__button{padding:0}[dir=ltr] .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-input-color__button{border-top-left-radius:0;border-bottom-left-radius:0;margin-left:-1px}[dir=rtl] .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-input-color__button{border-top-right-radius:0;border-bottom-right-radius:0;margin-right:-1px}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-input-color__button.ck-disabled{background:var(--ck-color-input-disabled-background)}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-input-color__button>.ck.ck-input-color__button__preview{border-radius:0}.ck-rounded-corners .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-input-color__button>.ck.ck-input-color__button__preview,.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-input-color__button>.ck.ck-input-color__button__preview.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-input-color__button>.ck.ck-input-color__button__preview{width:20px;height:20px;border:1px solid var(--ck-color-input-border)}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-input-color__button>.ck.ck-input-color__button__preview>.ck.ck-input-color__button__preview__no-color-indicator{top:-30%;left:50%;height:150%;width:8%;background:red;border-radius:2px;transform:rotate(45deg);transform-origin:50%}.ck.ck-input-color .ck.ck-input-color__remove-color{width:100%;border-bottom:1px solid var(--ck-color-input-border);padding:calc(var(--ck-spacing-standard)/2) var(--ck-spacing-standard);border-bottom-left-radius:0;border-bottom-right-radius:0}[dir=ltr] .ck.ck-input-color .ck.ck-input-color__remove-color{border-top-right-radius:0}[dir=rtl] .ck.ck-input-color .ck.ck-input-color__remove-color{border-top-left-radius:0}.ck.ck-input-color .ck.ck-input-color__remove-color .ck.ck-icon{margin-right:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-input-color .ck.ck-input-color__remove-color .ck.ck-icon{margin-right:0;margin-left:var(--ck-spacing-standard)}\"},function(e,t,i){var n=i(1);var o=i(107);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.exports=\".ck.ck-form__row{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between}.ck.ck-form__row>:not(.ck-label){flex-grow:1}.ck.ck-form__row.ck-table-form__action-row .ck-button-cancel,.ck.ck-form__row.ck-table-form__action-row .ck-button-save{justify-content:center}.ck.ck-form__row{padding:var(--ck-spacing-standard) var(--ck-spacing-large) 0}[dir=ltr] .ck.ck-form__row>:not(.ck-label)+*{margin-left:var(--ck-spacing-large)}[dir=rtl] .ck.ck-form__row>:not(.ck-label)+*{margin-right:var(--ck-spacing-large)}.ck.ck-form__row>.ck-label{width:100%;min-width:100%}.ck.ck-form__row.ck-table-form__action-row{margin-top:var(--ck-spacing-large)}.ck.ck-form__row.ck-table-form__action-row .ck-button .ck-button__label{color:var(--ck-color-text)}\"},function(e,t,i){var n=i(1);var o=i(109);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.exports=\":root{--ck-table-form-header-height:38px}.ck.ck-form__header{padding:0 var(--ck-spacing-large);height:var(--ck-table-form-header-height);line-height:var(--ck-table-form-header-height);border-bottom:1px solid var(--ck-color-base-border)}.ck.ck-form__header .ck-form__header__label{font-weight:700}\"},function(e,t){e.exports=\".ck.ck-form{padding:0 0 var(--ck-spacing-large)}.ck.ck-form:focus{outline:none}.ck.ck-form .ck.ck-input-text{min-width:100%;width:0}.ck.ck-form .ck.ck-dropdown{min-width:100%}.ck.ck-form .ck.ck-dropdown .ck-dropdown__button:not(:focus){border:1px solid var(--ck-color-base-border)}.ck.ck-form .ck.ck-dropdown .ck-dropdown__button .ck-button__label{width:100%}\"},function(e,t){e.exports='.ck.ck-table-form .ck-form__row.ck-table-form__border-row{flex-wrap:wrap}.ck.ck-table-form .ck-form__row.ck-table-form__border-row .ck-labeled-view{display:flex;flex-direction:column-reverse}.ck.ck-table-form .ck-form__row.ck-table-form__border-row .ck-labeled-view .ck.ck-dropdown,.ck.ck-table-form .ck-form__row.ck-table-form__border-row .ck-table-form__border-style,.ck.ck-table-form .ck-form__row.ck-table-form__border-row .ck-table-form__border-width{flex-grow:0}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row{flex-wrap:wrap;align-items:center}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-labeled-view{display:flex;flex-direction:column-reverse;align-items:center}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-labeled-view .ck.ck-dropdown,.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-table-form__dimension-operator{flex-grow:0}.ck.ck-table-form .ck.ck-labeled-view{position:relative}.ck.ck-table-form .ck.ck-labeled-view .ck.ck-labeled-view__status{position:absolute;left:50%;bottom:calc(-1*var(--ck-table-properties-error-arrow-size));transform:translate(-50%,100%);z-index:1}.ck.ck-table-form .ck.ck-labeled-view .ck.ck-labeled-view__status:after{content:\"\";position:absolute;top:calc(-1*var(--ck-table-properties-error-arrow-size));left:50%;transform:translateX(-50%)}:root{--ck-table-properties-error-arrow-size:6px;--ck-table-properties-min-error-width:150px}.ck.ck-table-form .ck-form__row.ck-table-form__border-row .ck-labeled-view>.ck-label{font-size:var(--ck-font-size-tiny);text-align:center}.ck.ck-table-form .ck-form__row.ck-table-form__border-row .ck-table-form__border-style{width:80px;min-width:80px}.ck.ck-table-form .ck-form__row.ck-table-form__border-row .ck-table-form__border-width{width:50px;min-width:50px}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row{padding:0}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-labeled-view>.ck-label{font-size:10px;text-align:center}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-table-form__dimensions-row__height,.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-table-form__dimensions-row__width{margin:0}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-table-form__dimension-operator{align-self:start;display:inline-block;height:var(--ck-ui-component-min-height);line-height:var(--ck-ui-component-min-height);margin:0 var(--ck-spacing-small)}.ck.ck-table-form .ck.ck-labeled-view .ck.ck-labeled-view__status{border-radius:0}.ck-rounded-corners .ck.ck-table-form .ck.ck-labeled-view .ck.ck-labeled-view__status,.ck.ck-table-form .ck.ck-labeled-view .ck.ck-labeled-view__status.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-table-form .ck.ck-labeled-view .ck.ck-labeled-view__status{background:var(--ck-color-base-error);color:var(--ck-color-base-background);padding:var(--ck-spacing-small) var(--ck-spacing-medium);min-width:var(--ck-table-properties-min-error-width);text-align:center}.ck.ck-table-form .ck.ck-labeled-view .ck.ck-labeled-view__status:after{border-left:var(--ck-table-properties-error-arrow-size) solid transparent;border-bottom:var(--ck-table-properties-error-arrow-size) solid var(--ck-color-base-error);border-right:var(--ck-table-properties-error-arrow-size) solid transparent;border-top:0 solid transparent}.ck.ck-table-form .ck.ck-labeled-view .ck.ck-labeled-view__status{animation:ck-table-form-labeled-view-status-appear .15s ease both}.ck.ck-table-form .ck.ck-labeled-view .ck-input.ck-error:not(:focus)+.ck.ck-labeled-view__status{display:none}@keyframes ck-table-form-labeled-view-status-appear{0%{opacity:0}to{opacity:1}}'},function(e,t,i){var n=i(1);var o=i(113);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.exports=\".ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row{flex-wrap:wrap}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row .ck.ck-toolbar{flex-grow:0}.ck.ck-table-cell-properties-form{width:320px}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__padding-row{padding:0;width:35%}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row .ck.ck-toolbar{background:none}\"},function(e,t,i){var n=i(1);var o=i(115);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.exports=\".ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row{flex-wrap:wrap;flex-basis:0;align-content:baseline}.ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row .ck.ck-toolbar .ck-toolbar__items{flex-wrap:nowrap}.ck.ck-table-properties-form{width:320px}.ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row{padding:0}.ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row .ck.ck-toolbar{background:none}.ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row .ck.ck-toolbar .ck-toolbar__items>*{width:40px}\"},function(e,t){e.exports=\".ck-content code{background-color:hsla(0,0%,78%,.3);padding:.15em;border-radius:2px}\"},function(e,t,i){var n=i(1);var o=i(118);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.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(e,t,i){var n=i(1);var o=i(120);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.exports=\".ck-content pre{padding:1em;color:#353535;background:hsla(0,0%,78%,.3);border:1px solid #c4c4c4;border-radius:2px;text-align:left;direction:ltr;tab-size:4;white-space:pre-wrap;font-style:normal;min-width:200px}.ck-content pre code{background:unset;padding:0;border-radius:0}.ck.ck-editor__editable pre{position:relative}.ck.ck-editor__editable pre[data-language]:after{content:attr(data-language);position:absolute}:root{--ck-color-code-block-label-background:#757575}.ck.ck-editor__editable pre[data-language]:after{top:-1px;right:10px;background:var(--ck-color-code-block-label-background);font-size:10px;font-family:var(--ck-font-face);line-height:16px;padding:var(--ck-spacing-tiny) var(--ck-spacing-medium);color:#fff;white-space:nowrap}.ck.ck-code-block-dropdown .ck-dropdown__panel{max-height:250px;overflow-y:auto;overflow-x:hidden}\"},function(e,t,i){var n=i(1);var o=i(122);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.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(e,t,i){var n=i(1);var o=i(124);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.exports=\".text-tiny{font-size:.7em}.text-small{font-size:.85em}.text-big{font-size:1.4em}.text-huge{font-size:1.8em}\"},function(e,t,i){var n=i(1);var o=i(126);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.exports=\":root{--ck-highlight-marker-yellow:#fdfd77;--ck-highlight-marker-green:#63f963;--ck-highlight-marker-pink:#fc7999;--ck-highlight-marker-blue:#72cdfd;--ck-highlight-pen-red:#e91313;--ck-highlight-pen-green:#180}.ck-content .marker-yellow{background-color:var(--ck-highlight-marker-yellow)}.ck-content .marker-green{background-color:var(--ck-highlight-marker-green)}.ck-content .marker-pink{background-color:var(--ck-highlight-marker-pink)}.ck-content .marker-blue{background-color:var(--ck-highlight-marker-blue)}.ck-content .pen-red{color:var(--ck-highlight-pen-red);background-color:transparent}.ck-content .pen-green{color:var(--ck-highlight-pen-green);background-color:transparent}\"},function(module,__webpack_exports__,__webpack_require__){\"use strict\";var md5;var _unused_webpack_default_export=md5;(function(){var HxOverrides=function(){};HxOverrides.__name__=true;HxOverrides.dateStr=function(e){var t=e.getMonth()+1;var i=e.getDate();var n=e.getHours();var o=e.getMinutes();var r=e.getSeconds();return e.getFullYear()+\"-\"+(t<10?\"0\"+t:\"\"+t)+\"-\"+(i<10?\"0\"+i:\"\"+i)+\" \"+(n<10?\"0\"+n:\"\"+n)+\":\"+(o<10?\"0\"+o:\"\"+o)+\":\"+(r<10?\"0\"+r:\"\"+r)};HxOverrides.strDate=function(e){switch(e.length){case 8:var t=e.split(\":\");var i=new Date;i.setTime(0);i.setUTCHours(t[0]);i.setUTCMinutes(t[1]);i.setUTCSeconds(t[2]);return i;case 10:var t=e.split(\"-\");return new Date(t[0],t[1]-1,t[2],0,0,0);case 19:var t=e.split(\" \");var n=t[0].split(\"-\");var o=t[1].split(\":\");return new Date(n[0],n[1]-1,n[2],o[0],o[1],o[2]);default:throw\"Invalid date format : \"+e}};HxOverrides.cca=function(e,t){var i=e.charCodeAt(t);if(i!=i)return undefined;return i};HxOverrides.substr=function(e,t,i){if(t!=null&&t!=0&&i!=null&&i<0)return\"\";if(i==null)i=e.length;if(t<0){t=e.length+t;if(t<0)t=0}else if(i<0)i=e.length+i-t;return e.substr(t,i)};HxOverrides.remove=function(e,t){var i=0;var n=e.length;while(i>>32-t},str2blks:function(e){var t=(e.length+8>>6)+1;var i=new Array;var n=0,o=t*16;while(n>2]|=HxOverrides.cca(e,r)<<(e.length*8+r)%4*8;r++}i[r>>2]|=128<<(e.length*8+r)%4*8;var s=e.length*8;var a=t*16-2;i[a]=s&255;i[a]|=(s>>>8&255)<<8;i[a]|=(s>>>16&255)<<16;i[a]|=(s>>>24&255)<<24;return i},rhex:function(e){var t=\"\";var i=\"0123456789abcdef\";var n=0;while(n<4){var o=n++;t+=i.charAt(e>>o*8+4&15)+i.charAt(e>>o*8&15)}return t},addme:function(e,t){var i=(e&65535)+(t&65535);var n=(e>>16)+(t>>16)+(i>>16);return n<<16|i&65535},bitAND:function(e,t){var i=e&1&(t&1);var n=e>>>1&t>>>1;return n<<1|i},bitXOR:function(e,t){var i=e&1^t&1;var n=e>>>1^t>>>1;return n<<1|i},bitOR:function(e,t){var i=e&1|t&1;var n=e>>>1|t>>>1;return n<<1|i},__class__:haxe.Md5};haxe.Timer=function(e){var t=this;this.id=window.setInterval((function(){t.run()}),e)};haxe.Timer.__name__=true;haxe.Timer.delay=function(e,t){var i=new haxe.Timer(t);i.run=function(){i.stop();e()};return i};haxe.Timer.measure=function(e,t){var i=haxe.Timer.stamp();var n=e();haxe.Log.trace(haxe.Timer.stamp()-i+\"s\",t);return n};haxe.Timer.stamp=function(){return(new Date).getTime()/1e3};haxe.Timer.prototype={run:function(){},stop:function(){if(this.id==null)return;window.clearInterval(this.id);this.id=null},__class__:haxe.Timer};var js=js||{};js.Boot=function(){};js.Boot.__name__=true;js.Boot.__unhtml=function(e){return e.split(\"&\").join(\"&\").split(\"<\").join(\"<\").split(\">\").join(\">\")};js.Boot.__trace=function(e,t){var i=t!=null?t.fileName+\":\"+t.lineNumber+\": \":\"\";i+=js.Boot.__string_rec(e,\"\");var n;if(typeof document!=\"undefined\"&&(n=document.getElementById(\"haxe:trace\"))!=null)n.innerHTML+=js.Boot.__unhtml(i)+\"
\";else if(typeof console!=\"undefined\"&&console.log!=null)console.log(i)};js.Boot.__clear_trace=function(){var e=document.getElementById(\"haxe:trace\");if(e!=null)e.innerHTML=\"\"};js.Boot.isClass=function(e){return e.__name__};js.Boot.isEnum=function(e){return e.__ename__};js.Boot.getClass=function(e){return e.__class__};js.Boot.__string_rec=function(e,t){if(e==null)return\"null\";if(t.length>=5)return\"<...>\";var i=typeof e;if(i==\"function\"&&(e.__name__||e.__ename__))i=\"object\";switch(i){case\"object\":if(e instanceof Array){if(e.__enum__){if(e.length==2)return e[0];var n=e[0]+\"(\";t+=\"\\t\";var o=2,r=e.length;while(o0?\",\":\"\")+js.Boot.__string_rec(e[c],t)}n+=\"]\";return n}var l;try{l=e.toString}catch(e){return\"???\"}if(l!=null&&l!=Object.toString){var d=e.toString();if(d!=\"[object Object]\")return d}var u=null;var n=\"{\\n\";t+=\"\\t\";var h=e.hasOwnProperty!=null;for(var u in e){if(h&&!e.hasOwnProperty(u)){continue}if(u==\"prototype\"||u==\"__class__\"||u==\"__super__\"||u==\"__interfaces__\"||u==\"__properties__\"){continue}if(n.length!=2)n+=\", \\n\";n+=t+u+\" : \"+js.Boot.__string_rec(e[u],t)}t=t.substring(1);n+=\"\\n\"+t+\"}\";return n;case\"function\":return\"\";case\"string\":return e;default:return String(e)}};js.Boot.__interfLoop=function(e,t){if(e==null)return false;if(e==t)return true;var i=e.__interfaces__;if(i!=null){var n=0,o=i.length;while(n>>32-t},str2blks:function(e){var t=(e.length+8>>6)+1;var i=new Array;var n=0,o=t*16;while(n>2]|=HxOverrides.cca(e,r)<<(e.length*8+r)%4*8;r++}i[r>>2]|=128<<(e.length*8+r)%4*8;var s=e.length*8;var a=t*16-2;i[a]=s&255;i[a]|=(s>>>8&255)<<8;i[a]|=(s>>>16&255)<<16;i[a]|=(s>>>24&255)<<24;return i},rhex:function(e){var t=\"\";var i=\"0123456789abcdef\";var n=0;while(n<4){var o=n++;t+=i.charAt(e>>o*8+4&15)+i.charAt(e>>o*8&15)}return t},addme:function(e,t){var i=(e&65535)+(t&65535);var n=(e>>16)+(t>>16)+(i>>16);return n<<16|i&65535},bitAND:function(e,t){var i=e&1&(t&1);var n=e>>>1&t>>>1;return n<<1|i},bitXOR:function(e,t){var i=e&1^t&1;var n=e>>>1^t>>>1;return n<<1|i},bitOR:function(e,t){var i=e&1|t&1;var n=e>>>1|t>>>1;return n<<1|i},__class__:haxe.Md5};haxe.Timer=function(e){var t=this;this.id=window.setInterval((function(){t.run()}),e)};haxe.Timer.__name__=true;haxe.Timer.delay=function(e,t){var i=new haxe.Timer(t);i.run=function(){i.stop();e()};return i};haxe.Timer.measure=function(e,t){var i=haxe.Timer.stamp();var n=e();haxe.Log.trace(haxe.Timer.stamp()-i+\"s\",t);return n};haxe.Timer.stamp=function(){return(new Date).getTime()/1e3};haxe.Timer.prototype={run:function(){},stop:function(){if(this.id==null)return;window.clearInterval(this.id);this.id=null},__class__:haxe.Timer};var js=js||{};js.Boot=function(){};js.Boot.__name__=true;js.Boot.__unhtml=function(e){return e.split(\"&\").join(\"&\").split(\"<\").join(\"<\").split(\">\").join(\">\")};js.Boot.__trace=function(e,t){var i=t!=null?t.fileName+\":\"+t.lineNumber+\": \":\"\";i+=js.Boot.__string_rec(e,\"\");var n;if(typeof document!=\"undefined\"&&(n=document.getElementById(\"haxe:trace\"))!=null)n.innerHTML+=js.Boot.__unhtml(i)+\"
\";else if(typeof console!=\"undefined\"&&console.log!=null)console.log(i)};js.Boot.__clear_trace=function(){var e=document.getElementById(\"haxe:trace\");if(e!=null)e.innerHTML=\"\"};js.Boot.isClass=function(e){return e.__name__};js.Boot.isEnum=function(e){return e.__ename__};js.Boot.getClass=function(e){return e.__class__};js.Boot.__string_rec=function(e,t){if(e==null)return\"null\";if(t.length>=5)return\"<...>\";var i=typeof e;if(i==\"function\"&&(e.__name__||e.__ename__))i=\"object\";switch(i){case\"object\":if(e instanceof Array){if(e.__enum__){if(e.length==2)return e[0];var n=e[0]+\"(\";t+=\"\\t\";var o=2,r=e.length;while(o0?\",\":\"\")+js.Boot.__string_rec(e[c],t)}n+=\"]\";return n}var l;try{l=e.toString}catch(e){return\"???\"}if(l!=null&&l!=Object.toString){var d=e.toString();if(d!=\"[object Object]\")return d}var u=null;var n=\"{\\n\";t+=\"\\t\";var h=e.hasOwnProperty!=null;for(var u in e){if(h&&!e.hasOwnProperty(u)){continue}if(u==\"prototype\"||u==\"__class__\"||u==\"__super__\"||u==\"__interfaces__\"||u==\"__properties__\"){continue}if(n.length!=2)n+=\", \\n\";n+=t+u+\" : \"+js.Boot.__string_rec(e[u],t)}t=t.substring(1);n+=\"\\n\"+t+\"}\";return n;case\"function\":return\"\";case\"string\":return e;default:return String(e)}};js.Boot.__interfLoop=function(e,t){if(e==null)return false;if(e==t)return true;var i=e.__interfaces__;if(i!=null){var n=0,o=i.length;while(ndiv:first-child,.wrs_content_container.wrs_modal_desktop>div:first-child,.wrs_content_container.wrs_modal_ios>div:first-child{flex-grow:1}.wrs_modal_wrapper.wrs_modal_android{margin:auto;display:flex;flex-direction:column;height:100%;width:100%}.wrs_content_container.wrs_modal_desktop,.wrs_content_container.wrs_modal_ios{width:100%;flex-grow:1;display:flex;flex-direction:column}.wrs_modal_wrapper.wrs_modal_ios{margin:auto;display:flex;flex-direction:column;height:100%;width:100%}.wrs_virtual_keyboard{height:100%;width:100%;top:0;left:50%;transform:translate(-50%)}@media (orientation:portrait){.wrs_modal_dialogContainer.wrs_modal_mobile{width:100vmin;height:100vmin;margin:auto;border-width:0}.wrs_modal_wrapper.wrs_modal_mobile{width:100vmin;height:100vmin;margin:auto}}@media (orientation:landscape){.wrs_modal_dialogContainer.wrs_modal_mobile{width:100vmin;height:100vmin;margin:auto;border-width:0}.wrs_modal_wrapper.wrs_modal_mobile{width:100vmin;height:100vmin;margin:auto}}.wrs_modal_dialogContainer.wrs_modal_badStock,.wrs_modal_wrapper.wrs_modal_badStock{width:100%;height:280px;margin:0 auto;border-width:0}.wrs_noselect{-khtml-user-select:none}.wrs_bottom_right_resizer,.wrs_noselect{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.wrs_bottom_right_resizer{width:10px;height:10px;color:#778e9a;position:absolute;right:4px;bottom:8px;cursor:se-resize}.wrs_bottom_left_resizer{width:15px;height:15px;color:#778e9a;position:absolute;left:0;top:0;cursor:se-resize}.wrs_modal_controls{height:42px;margin:3px 0;overflow:hidden;line-height:normal}.wrs_modal_links{margin:10px auto 0;font-family:arial,sans-serif;padding:6px;display:inline;float:right;text-align:right}.wrs_modal_links>a{text-decoration:none;color:#778e9a;font-size:16px}.wrs_modal_button_cancel,.wrs_modal_button_cancel:active,.wrs_modal_button_cancel:focus,.wrs_modal_button_cancel:hover,.wrs_modal_button_cancel:visited{min-width:80px;font-size:14px;border-radius:3px;border:1px solid #778e9a;padding:6px 8px;margin:10px auto 0 5px;cursor:pointer;font-family:arial,sans-serif;background-color:#ddd;height:32px}.wrs_modal_button_accept,.wrs_modal_button_accept:active,.wrs_modal_button_accept:focus,.wrs_modal_button_accept:hover,.wrs_modal_button_accept:visited{min-width:80px;font-size:14px;border-radius:3px;border:1px solid #778e9a;padding:6px 8px;margin:10px 5px 0 auto;color:#fff;background:#778e9a;cursor:pointer;font-family:arial,sans-serif;height:32px}.wrs_editor_vertical_bar{height:20px;float:right;background:none;width:20px;cursor:pointer}.wrs_modal_buttons_container{display:inline;float:left}.wrs_modal_buttons_container.wrs_modalAndroid{padding-left:6px}.wrs_modal_buttons_container.wrs_modalDesktop{padding-left:0}.wrs_modal_buttons_container>button{line-height:normal;background-image:none}.wrs_modal_wrapper{margin:6px;display:flex;flex-direction:column}.wrs_modal_wrapper.wrs_modal_desktop.wrs_minimized{display:none}@media only screen and (max-device-width:480px) and (orientation:portrait){#wrs_modal_wrapper{width:140%}}.wrs_popupmessage_overlay_envolture{display:none;width:100%}.wrs_popupmessage_overlay{position:absolute;width:100%;height:100%;top:0;left:0;right:0;bottom:0;background-color:rgba(0,0,0,.5);z-index:4;cursor:pointer}.wrs_popupmessage_panel{top:50%;left:50%;transform:translate(-50%,-50%);position:absolute;background:#fff;max-width:500px;width:75%;border-radius:2px;padding:20px;font-family:sans-serif;font-size:15px;text-align:left;color:#2e2e2e;z-index:5;max-height:75%;overflow:auto}.wrs_popupmessage_button_area{margin:10px 0 0}.wrs_panelContainer *{border:0}.wrs_button_cancel,.wrs_button_cancel:active,.wrs_button_cancel:focus,.wrs_button_cancel:hover,.wrs_button_cancel:visited{min-width:80px;font-size:14px;border-radius:3px;border:1px solid #778e9a;padding:6px 8px;margin:10px auto 0 5px;cursor:pointer;font-family:arial,sans-serif;background-color:#ddd;background-image:none;height:32px}.wrs_button_accept,.wrs_button_accept:active,.wrs_button_accept:focus,.wrs_button_accept:hover,.wrs_button_accept:visited{min-width:80px;font-size:14px;border-radius:3px;border:1px solid #778e9a;padding:6px 8px;margin:10px 5px 0 auto;color:#fff;background:#778e9a;cursor:pointer;font-family:arial,sans-serif;height:32px}.wrs_editor button{box-shadow:none}.wrs_editor .wrs_header button{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.wrs_modal_overlay.wrs_modal_desktop.wrs_stack.wrs_overlay_active{display:block}.wrs_toolbar tr:focus,.wrs_toolbar tr:hover{background:none}.wrs_modal_rtl .wrs_modal_button_cancel{margin-right:5px;margin-left:0}.wrs_modal_rtl .wrs_modal_button_accept{margin-right:0;margin-left:5px}.wrs_modal_rtl .wrs_button_cancel{margin-right:5px;margin-left:0}.wrs_modal_rtl .wrs_button_accept{margin-right:0;margin-left:5px}\"},function(e,t,i){var n=i(1);var o=i(131);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.exports=\".ck.ck-character-grid .ck-character-grid__tiles{display:grid;grid-template-columns:repeat(10,1fr)}: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{margin:var(--ck-spacing-standard);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(e,t,i){var n=i(1);var o=i(133);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.exports=\".ck.ck-character-info{display:flex;justify-content:space-between;padding:var(--ck-spacing-small) var(--ck-spacing-standard);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(e,t,i){var n=i(1);var o=i(135);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.exports=\".ck.ck-special-characters-navigation{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;justify-content:space-between;border-bottom:1px solid var(--ck-color-base-border);padding:var(--ck-spacing-standard)}[dir=ltr] .ck.ck-special-characters-navigation{padding-left:var(--ck-spacing-large)}[dir=rtl] .ck.ck-special-characters-navigation{padding-right:var(--ck-spacing-large)}.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(e,t,i){var n=i(1);var o=i(137);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.exports=\":root{--ck-color-restricted-editing-exception-background:rgba(255,169,77,0.2);--ck-color-restricted-editing-exception-hover-background:rgba(255,169,77,0.35);--ck-color-restricted-editing-exception-brackets:rgba(204,105,0,0.4);--ck-color-restricted-editing-selected-exception-background:rgba(255,169,77,0.5);--ck-color-restricted-editing-selected-exception-brackets:rgba(204,105,0,0.6)}.ck-editor__editable .restricted-editing-exception{transition:background .2s ease-in-out;background-color:var(--ck-color-restricted-editing-exception-background);border:1px solid;border-image:linear-gradient(90deg,var(--ck-color-restricted-editing-exception-brackets) 0,var(--ck-color-restricted-editing-exception-brackets) 5px,transparent 6px,transparent calc(100% - 6px),var(--ck-color-restricted-editing-exception-brackets) calc(100% - 5px),var(--ck-color-restricted-editing-exception-brackets)) 1}.ck-editor__editable .restricted-editing-exception.restricted-editing-exception_selected{background-color:var(--ck-color-restricted-editing-selected-exception-background);border-image:linear-gradient(90deg,var(--ck-color-restricted-editing-selected-exception-brackets) 0,var(--ck-color-restricted-editing-selected-exception-brackets) 5px,var(--ck-color-restricted-editing-selected-exception-brackets) calc(100% - 5px),var(--ck-color-restricted-editing-selected-exception-brackets)) 1}.ck-editor__editable .restricted-editing-exception.restricted-editing-exception_collapsed{padding-left:1ch}.ck-restricted-editing_mode_restricted,.ck-restricted-editing_mode_restricted *{cursor:default}.ck-restricted-editing_mode_restricted .restricted-editing-exception,.ck-restricted-editing_mode_restricted .restricted-editing-exception *{cursor:text}.ck-restricted-editing_mode_restricted .restricted-editing-exception:hover{background:var(--ck-color-restricted-editing-exception-hover-background)}\"},function(e,t,i){var n=i(1);var o=i(139);o=o.__esModule?o.default:o;if(typeof o===\"string\"){o=[[e.i,o,\"\"]]}var r={injectType:\"singletonStyleTag\"};r.insert=\"head\";r.singleton=true;var s=n(o,r);var a=o.locals?o.locals:{};e.exports=a},function(e,t){e.exports=\".ck-editor__editable .ck-horizontal-line{overflow:hidden}.ck-content hr{border:solid #5e5e5e;border-width:1px 0 0;margin:0}.ck-editor__editable .ck-horizontal-line{padding:5px 0}\"},function(e,t,i){\"use strict\";i.r(t);i.d(t,\"default\",(function(){return lR}));var n=i(3);var o=n[\"a\"].Symbol;var r=o;var s=Object.prototype;var a=s.hasOwnProperty;var c=s.toString;var l=r?r.toStringTag:undefined;function d(e){var t=a.call(e,l),i=e[l];try{e[l]=undefined;var n=true}catch(e){}var o=c.call(e);if(n){if(t){e[l]=i}else{delete e[l]}}return o}var u=d;var h=Object.prototype;var f=h.toString;function m(e){return f.call(e)}var g=m;var p=\"[object Null]\",b=\"[object Undefined]\";var w=r?r.toStringTag:undefined;function _(e){if(e==null){return e===undefined?b:p}return w&&w in Object(e)?u(e):g(e)}var v=_;function k(e,t){return function(i){return e(t(i))}}var y=k;var x=y(Object.getPrototypeOf,Object);var A=x;function C(e){return e!=null&&typeof e==\"object\"}var T=C;var E=\"[object Object]\";var M=Function.prototype,P=Object.prototype;var S=M.toString;var I=P.hasOwnProperty;var N=S.call(Object);function O(e){if(!T(e)||v(e)!=E){return false}var t=A(e);if(t===null){return true}var i=I.call(t,\"constructor\")&&t.constructor;return typeof i==\"function\"&&i instanceof i&&S.call(i)==N}var L=O;function R(){this.__data__=[];this.size=0}var z=R;function j(e,t){return e===t||e!==e&&t!==t}var D=j;function B(e,t){var i=e.length;while(i--){if(D(e[i][0],t)){return i}}return-1}var V=B;var F=Array.prototype;var H=F.splice;function W(e){var t=this.__data__,i=V(t,e);if(i<0){return false}var n=t.length-1;if(i==n){t.pop()}else{H.call(t,i,1)}--this.size;return true}var U=W;function $(e){var t=this.__data__,i=V(t,e);return i<0?undefined:t[i][1]}var q=$;function Y(e){return V(this.__data__,e)>-1}var G=Y;function J(e,t){var i=this.__data__,n=V(i,e);if(n<0){++this.size;i.push([e,t])}else{i[n][1]=t}return this}var X=J;function Q(e){var t=-1,i=e==null?0:e.length;this.clear();while(++t-1&&e%1==0&&e-1&&e%1==0&&e<=ti}var ni=ii;var oi=\"[object Arguments]\",ri=\"[object Array]\",si=\"[object Boolean]\",ai=\"[object Date]\",ci=\"[object Error]\",li=\"[object Function]\",di=\"[object Map]\",ui=\"[object Number]\",hi=\"[object Object]\",fi=\"[object RegExp]\",mi=\"[object Set]\",gi=\"[object String]\",pi=\"[object WeakMap]\";var bi=\"[object ArrayBuffer]\",wi=\"[object DataView]\",_i=\"[object Float32Array]\",vi=\"[object Float64Array]\",ki=\"[object Int8Array]\",yi=\"[object Int16Array]\",xi=\"[object Int32Array]\",Ai=\"[object Uint8Array]\",Ci=\"[object Uint8ClampedArray]\",Ti=\"[object Uint16Array]\",Ei=\"[object Uint32Array]\";var Mi={};Mi[_i]=Mi[vi]=Mi[ki]=Mi[yi]=Mi[xi]=Mi[Ai]=Mi[Ci]=Mi[Ti]=Mi[Ei]=true;Mi[oi]=Mi[ri]=Mi[bi]=Mi[si]=Mi[wi]=Mi[ai]=Mi[ci]=Mi[li]=Mi[di]=Mi[ui]=Mi[hi]=Mi[fi]=Mi[mi]=Mi[gi]=Mi[pi]=false;function Pi(e){return T(e)&&ni(e.length)&&!!Mi[v(e)]}var Si=Pi;function Ii(e){return function(t){return e(t)}}var Ni=Ii;var Oi=i(5);var Li=Oi[\"a\"]&&Oi[\"a\"].isTypedArray;var Ri=Li?Ni(Li):Si;var zi=Ri;var ji=Object.prototype;var Di=ji.hasOwnProperty;function Bi(e,t){var i=Jt(e),n=!i&&Yt(e),o=!i&&!n&&Object(Xt[\"a\"])(e),r=!i&&!n&&!o&&zi(e),s=i||n||o||r,a=s?Bt(e.length,String):[],c=a.length;for(var l in e){if((t||Di.call(e,l))&&!(s&&(l==\"length\"||o&&(l==\"offset\"||l==\"parent\")||r&&(l==\"buffer\"||l==\"byteLength\"||l==\"byteOffset\")||ei(l,c)))){a.push(l)}}return a}var Vi=Bi;var Fi=Object.prototype;function Hi(e){var t=e&&e.constructor,i=typeof t==\"function\"&&t.prototype||Fi;return e===i}var Wi=Hi;var Ui=y(Object.keys,Object);var $i=Ui;var qi=Object.prototype;var Yi=qi.hasOwnProperty;function Gi(e){if(!Wi(e)){return $i(e)}var t=[];for(var i in Object(e)){if(Yi.call(e,i)&&i!=\"constructor\"){t.push(i)}}return t}var Ji=Gi;function Xi(e){return e!=null&&ni(e.length)&&!me(e)}var Qi=Xi;function Ki(e){return Qi(e)?Vi(e):Ji(e)}var Zi=Ki;function en(e,t){return e&&jt(t,Zi(t),e)}var tn=en;function nn(e){var t=[];if(e!=null){for(var i in Object(e)){t.push(i)}}return t}var on=nn;var rn=Object.prototype;var sn=rn.hasOwnProperty;function an(e){if(!ce(e)){return on(e)}var t=Wi(e),i=[];for(var n in e){if(!(n==\"constructor\"&&(t||!sn.call(e,n)))){i.push(n)}}return i}var cn=an;function ln(e){return Qi(e)?Vi(e,true):cn(e)}var dn=ln;function un(e,t){return e&&jt(t,dn(t),e)}var hn=un;var fn=i(8);function mn(e,t){var i=-1,n=e.length;t||(t=Array(n));while(++i{this._setToTarget(e,n,t[n],i)})}}function Xr(e){return qr(e,Qr)}function Qr(e){return Gr(e)?e:undefined}function Kr(){return function e(){e.called=true}}var Zr=Kr;class es{constructor(e,t){this.source=e;this.name=t;this.path=[];this.stop=Zr();this.off=Zr()}}const ts=new Array(256).fill().map((e,t)=>(\"0\"+t.toString(16)).slice(-2));function is(){const e=Math.random()*4294967296>>>0;const t=Math.random()*4294967296>>>0;const i=Math.random()*4294967296>>>0;const n=Math.random()*4294967296>>>0;return\"e\"+ts[e>>0&255]+ts[e>>8&255]+ts[e>>16&255]+ts[e>>24&255]+ts[t>>0&255]+ts[t>>8&255]+ts[t>>16&255]+ts[t>>24&255]+ts[i>>0&255]+ts[i>>8&255]+ts[i>>16&255]+ts[i>>24&255]+ts[n>>0&255]+ts[n>>8&255]+ts[n>>16&255]+ts[n>>24&255]}const ns={get(e){if(typeof e!=\"number\"){return this[e]||this.normal}else{return e}},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5};var os=ns;var rs=i(6);var ss=i(0);const as=Symbol(\"listeningTo\");const cs=Symbol(\"emitterId\");const ls={on(e,t,i={}){this.listenTo(this,e,t,i)},once(e,t,i){let n=false;const o=function(e,...i){if(!n){n=true;e.off();t.call(this,e,...i)}};this.listenTo(this,e,o,i)},off(e,t){this.stopListening(this,e,t)},listenTo(e,t,i,n={}){let o,r;if(!this[as]){this[as]={}}const s=this[as];if(!fs(e)){hs(e)}const a=fs(e);if(!(o=s[a])){o=s[a]={emitter:e,callbacks:{}}}if(!(r=o.callbacks[t])){r=o.callbacks[t]=[]}r.push(i);ps(e,t);const c=bs(e,t);const l=os.get(n.priority);const d={callback:i,priority:l};for(const e of c){let t=false;for(let i=0;i{if(!this._delegations){this._delegations=new Map}e.forEach(e=>{const n=this._delegations.get(e);if(!n){this._delegations.set(e,new Map([[t,i]]))}else{n.set(t,i)}})}}},stopDelegating(e,t){if(!this._delegations){return}if(!e){this._delegations.clear()}else if(!t){this._delegations.delete(e)}else{const i=this._delegations.get(e);if(i){i.delete(t)}}}};var ds=ls;function us(e,t){if(e[as]&&e[as][t]){return e[as][t].emitter}return null}function hs(e,t){if(!e[cs]){e[cs]=t||is()}}function fs(e){return e[cs]}function ms(e){if(!e._events){Object.defineProperty(e,\"_events\",{value:{}})}return e._events}function gs(){return{callbacks:[],childEvents:[]}}function ps(e,t){const i=ms(e);if(i[t]){return}let n=t;let o=null;const r=[];while(n!==\"\"){if(i[n]){break}i[n]=gs();r.push(i[n]);if(o){i[n].childEvents.push(o)}o=n;n=n.substr(0,n.lastIndexOf(\":\"))}if(n!==\"\"){for(const e of r){e.callbacks=i[n].callbacks.slice()}i[n].childEvents.push(o)}}function bs(e,t){const i=ms(e)[t];if(!i){return[]}let n=[i.callbacks];for(let t=0;t-1){return ws(e,t.substr(0,t.lastIndexOf(\":\")))}else{return null}}return i.callbacks}function _s(e,t,i){for(let[n,o]of e){if(!o){o=t.name}else if(typeof o==\"function\"){o=o(t.name)}const e=new es(t.source,o);e.path=[...t.path];n.fire(e,...i)}}function vs(e,t,i){const n=bs(e,t);for(const e of n){for(let t=0;t{Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t)).forEach(i=>{if(i in e.prototype){return}const n=Object.getOwnPropertyDescriptor(t,i);n.enumerable=false;Object.defineProperty(e.prototype,i,n)})})}class ys{constructor(e={}){this._items=[];this._itemMap=new Map;this._idProperty=e.idProperty||\"id\";this._bindToExternalToInternalMap=new WeakMap;this._bindToInternalToExternalMap=new WeakMap;this._skippedIndexesFromExternal=[]}get length(){return this._items.length}get first(){return this._items[0]||null}get last(){return this._items[this.length-1]||null}add(e,t){let i;const n=this._idProperty;if(n in e){i=e[n];if(typeof i!=\"string\"){throw new ss[\"b\"](\"collection-add-invalid-id\",this)}if(this.get(i)){throw new ss[\"b\"](\"collection-add-item-already-exists\",this)}}else{e[n]=i=is()}if(t===undefined){t=this._items.length}else if(t>this._items.length||t<0){throw new ss[\"b\"](\"collection-add-item-invalid-index\",this)}this._items.splice(t,0,e);this._itemMap.set(i,e);this.fire(\"add\",e,t);return this}get(e){let t;if(typeof e==\"string\"){t=this._itemMap.get(e)}else if(typeof e==\"number\"){t=this._items[e]}else{throw new ss[\"b\"](\"collection-get-invalid-arg: Index or id must be given.\",this)}return t||null}has(e){if(typeof e==\"string\"){return this._itemMap.has(e)}else{const t=this._idProperty;const i=e[t];return this._itemMap.has(i)}}getIndex(e){let t;if(typeof e==\"string\"){t=this._itemMap.get(e)}else{t=e}return this._items.indexOf(t)}remove(e){let t,i,n;let o=false;const r=this._idProperty;if(typeof e==\"string\"){i=e;n=this._itemMap.get(i);o=!n;if(n){t=this._items.indexOf(n)}}else if(typeof e==\"number\"){t=e;n=this._items[t];o=!n;if(n){i=n[r]}}else{n=e;i=n[r];t=this._items.indexOf(n);o=t==-1||!this._itemMap.get(i)}if(o){throw new ss[\"b\"](\"collection-remove-404: Item not found.\",this)}this._items.splice(t,1);this._itemMap.delete(i);const s=this._bindToInternalToExternalMap.get(n);this._bindToInternalToExternalMap.delete(n);this._bindToExternalToInternalMap.delete(s);this.fire(\"remove\",n,t);return n}map(e,t){return this._items.map(e,t)}find(e,t){return this._items.find(e,t)}filter(e,t){return this._items.filter(e,t)}clear(){if(this._bindToCollection){this.stopListening(this._bindToCollection);this._bindToCollection=null}while(this.length){this.remove(0)}}bindTo(e){if(this._bindToCollection){throw new ss[\"b\"](\"collection-bind-to-rebind: The collection cannot be bound more than once.\",this)}this._bindToCollection=e;return{as:e=>{this._setUpBindToBinding(t=>new e(t))},using:e=>{if(typeof e==\"function\"){this._setUpBindToBinding(t=>e(t))}else{this._setUpBindToBinding(t=>t[e])}}}}_setUpBindToBinding(e){const t=this._bindToCollection;const i=(i,n,o)=>{const r=t._bindToCollection==this;const s=t._bindToInternalToExternalMap.get(n);if(r&&s){this._bindToExternalToInternalMap.set(n,s);this._bindToInternalToExternalMap.set(s,n)}else{const i=e(n);if(!i){this._skippedIndexesFromExternal.push(o);return}let r=o;for(const e of this._skippedIndexesFromExternal){if(o>e){r--}}for(const e of t._skippedIndexesFromExternal){if(r>=e){r++}}this._bindToExternalToInternalMap.set(n,i);this._bindToInternalToExternalMap.set(i,n);this.add(i,r);for(let e=0;e{const n=this._bindToExternalToInternalMap.get(t);if(n){this.remove(n)}this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce((e,t)=>{if(it){e.push(t)}return e},[])})}[Symbol.iterator](){return this._items[Symbol.iterator]()}}ks(ys,ds);class xs{constructor(e,t=[],i=[]){this._context=e;this._plugins=new Map;this._availablePlugins=new Map;for(const e of t){if(e.pluginName){this._availablePlugins.set(e.pluginName,e)}}this._contextPlugins=new Map;for(const[e,t]of i){this._contextPlugins.set(e,t);this._contextPlugins.set(t,e);if(e.pluginName){this._availablePlugins.set(e.pluginName,e)}}}*[Symbol.iterator](){for(const e of this._plugins){if(typeof e[0]==\"function\"){yield e}}}get(e){const t=this._plugins.get(e);if(!t){const t=\"plugincollection-plugin-not-loaded: The requested plugin is not loaded.\";let i=e;if(typeof e==\"function\"){i=e.pluginName||e.name}throw new ss[\"b\"](t,this._context,{plugin:i})}return t}has(e){return this._plugins.has(e)}init(e,t=[]){const i=this;const n=this._context;const o=new Set;const r=[];const s=m(e);const a=m(t);const c=f(e);if(c){const e=\"plugincollection-plugin-not-found: Some plugins are not available and could not be loaded.\";console.error(Object(ss[\"a\"])(e),{plugins:c});return Promise.reject(new ss[\"b\"](e,n,{plugins:c}))}return Promise.all(s.map(l)).then(()=>d(r,\"init\")).then(()=>d(r,\"afterInit\")).then(()=>r);function l(e){if(a.includes(e)){return}if(i._plugins.has(e)||o.has(e)){return}return u(e).catch(t=>{console.error(Object(ss[\"a\"])(\"plugincollection-load: It was not possible to load the plugin.\"),{plugin:e});throw t})}function d(e,t){return e.reduce((e,n)=>{if(!n[t]){return e}if(i._contextPlugins.has(n)){return e}return e.then(n[t].bind(n))},Promise.resolve())}function u(e){return new Promise(s=>{o.add(e);if(e.requires){e.requires.forEach(i=>{const o=h(i);if(e.isContextPlugin&&!o.isContextPlugin){throw new ss[\"b\"](\"plugincollection-context-required: Context plugin can not require plugin which is not a context plugin\",null,{plugin:o.name,requiredBy:e.name})}if(t.includes(o)){throw new ss[\"b\"](\"plugincollection-required: Cannot load a plugin because one of its dependencies is listed in\"+\"the `removePlugins` option.\",n,{plugin:o.name,requiredBy:e.name})}l(o)})}const a=i._contextPlugins.get(e)||new e(n);i._add(e,a);r.push(a);s()})}function h(e){if(typeof e==\"function\"){return e}return i._availablePlugins.get(e)}function f(e){const t=[];for(const i of e){if(!h(i)){t.push(i)}}return t.length?t:null}function m(e){return e.map(e=>h(e)).filter(e=>!!e)}}destroy(){const e=[];for(const[,t]of this){if(typeof t.destroy==\"function\"&&!this._contextPlugins.has(t)){e.push(t.destroy())}}return Promise.all(e)}_add(e,t){this._plugins.set(e,t);const i=e.pluginName;if(!i){return}if(this._plugins.has(i)){throw new ss[\"b\"](\"plugincollection-plugin-name-conflict: Two plugins with the same name were loaded.\",null,{pluginName:i,plugin1:this._plugins.get(i).constructor,plugin2:e})}this._plugins.set(i,t)}}ks(xs,ds);if(!window.CKEDITOR_TRANSLATIONS){window.CKEDITOR_TRANSLATIONS={}}function As(e,t){const i=window.CKEDITOR_TRANSLATIONS[e]||(window.CKEDITOR_TRANSLATIONS[e]={});Object.assign(i,t)}function Cs(e,t){const i=Ms();if(i===1){e=Object.keys(window.CKEDITOR_TRANSLATIONS)[0]}if(i===0||!Es(e,t)){return t.replace(/ \\[context: [^\\]]+\\]$/,\"\")}const n=window.CKEDITOR_TRANSLATIONS[e];return n[t].replace(/ \\[context: [^\\]]+\\]$/,\"\")}function Ts(){window.CKEDITOR_TRANSLATIONS={}}function Es(e,t){return e in window.CKEDITOR_TRANSLATIONS&&t in window.CKEDITOR_TRANSLATIONS[e]}function Ms(){return Object.keys(window.CKEDITOR_TRANSLATIONS).length}const Ps=[\"ar\",\"fa\",\"he\",\"ku\",\"ug\"];class Ss{constructor(e={}){this.uiLanguage=e.uiLanguage||\"en\";this.contentLanguage=e.contentLanguage||this.uiLanguage;this.uiLanguageDirection=Is(this.uiLanguage);this.contentLanguageDirection=Is(this.contentLanguage);this.t=(...e)=>this._t(...e)}get language(){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.\");return this.uiLanguage}_t(e,t){let i=Cs(this.uiLanguage,e);if(t){i=i.replace(/%(\\d+)/g,(e,i)=>ie.destroy())).then(()=>this.plugins.destroy())}_addEditor(e,t){if(this._contextOwner){throw new ss[\"b\"](\"context-addEditor-private-context: Cannot add multiple editors to the context which is created by the editor.\")}this.editors.add(e);if(t){this._contextOwner=e}}_removeEditor(e){if(this.editors.has(e)){this.editors.remove(e)}if(this._contextOwner===e){return this.destroy()}return Promise.resolve()}_getEditorConfig(){const e={};for(const t of this.config.names()){if(![\"plugins\",\"removePlugins\",\"extraPlugins\"].includes(t)){e[t]=this.config.get(t)}}return e}static create(e){return new Promise(t=>{const i=new this(e);t(i.initPlugins().then(()=>i))})}}function Os(e,t){const i=Math.min(e.length,t.length);for(let n=0;ne.data.length){throw new ss[\"b\"](\"view-textproxy-wrong-offsetintext: Given offsetInText value is incorrect.\",this)}if(i<0||t+i>e.data.length){throw new ss[\"b\"](\"view-textproxy-wrong-length: Given length value is incorrect.\",this)}this.data=e.data.substring(t,t+i);this.offsetInText=t}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(e){return e==\"textProxy\"||e==\"view:textProxy\"}getAncestors(e={includeSelf:false,parentFirst:false}){const t=[];let i=e.includeSelf?this.textNode:this.parent;while(i!==null){t[e.parentFirst?\"push\":\"unshift\"](i);i=i.parent}return t}}function Vs(e){const t=new Map;for(const i in e){t.set(i,e[i])}return t}function Fs(e){return!!(e&&e[Symbol.iterator])}function Hs(e){if(Fs(e)){return new Map(e)}else{return Vs(e)}}class Ws{constructor(...e){this._patterns=[];this.add(...e)}add(...e){for(let t of e){if(typeof t==\"string\"||t instanceof RegExp){t={name:t}}if(t.classes&&(typeof t.classes==\"string\"||t.classes instanceof RegExp)){t.classes=[t.classes]}this._patterns.push(t)}}match(...e){for(const t of e){for(const e of this._patterns){const i=Us(t,e);if(i){return{element:t,pattern:e,match:i}}}}return null}matchAll(...e){const t=[];for(const i of e){for(const e of this._patterns){const n=Us(i,e);if(n){t.push({element:i,pattern:e,match:n})}}}return t.length>0?t:null}getElementName(){if(this._patterns.length!==1){return null}const e=this._patterns[0];const t=e.name;return typeof e!=\"function\"&&t&&!(t instanceof RegExp)?t:null}}function Us(e,t){if(typeof t==\"function\"){return t(e)}const i={};if(t.name){i.name=$s(t.name,e.name);if(!i.name){return null}}if(t.attributes){i.attributes=qs(t.attributes,e);if(!i.attributes){return null}}if(t.classes){i.classes=Ys(t.classes,e);if(!i.classes){return false}}if(t.styles){i.styles=Gs(t.styles,e);if(!i.styles){return false}}return i}function $s(e,t){if(e instanceof RegExp){return e.test(t)}return e===t}function qs(e,t){const i=[];for(const n in e){const o=e[n];if(t.hasAttribute(n)){const e=t.getAttribute(n);if(o===true){i.push(n)}else if(o instanceof RegExp){if(o.test(e)){i.push(n)}else{return null}}else if(e===o){i.push(n)}else{return null}}else{return null}}return i}function Ys(e,t){const i=[];for(const n of e){if(n instanceof RegExp){const e=t.getClassNames();for(const t of e){if(n.test(t)){i.push(t)}}if(i.length===0){return null}}else if(t.hasClass(n)){i.push(n)}else{return null}}return i}function Gs(e,t){const i=[];for(const n in e){const o=e[n];if(t.hasStyle(n)){const e=t.getStyle(n);if(o instanceof RegExp){if(o.test(e)){i.push(n)}else{return null}}else if(e===o){i.push(n)}else{return null}}else{return null}}return i}var Js=\"[object Symbol]\";function Xs(e){return typeof e==\"symbol\"||T(e)&&v(e)==Js}var Qs=Xs;var Ks=/\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,Zs=/^\\w*$/;function ea(e,t){if(Jt(e)){return false}var i=typeof e;if(i==\"number\"||i==\"symbol\"||i==\"boolean\"||e==null||Qs(e)){return true}return Zs.test(e)||!Ks.test(e)||t!=null&&e in Object(t)}var ta=ea;var ia=\"Expected a function\";function na(e,t){if(typeof e!=\"function\"||t!=null&&typeof t!=\"function\"){throw new TypeError(ia)}var i=function(){var n=arguments,o=t?t.apply(this,n):n[0],r=i.cache;if(r.has(o)){return r.get(o)}var s=e.apply(this,n);i.cache=r.set(o,s)||r;return s};i.cache=new(na.Cache||vt);return i}na.Cache=vt;var oa=na;var ra=500;function sa(e){var t=oa(e,(function(e){if(i.size===ra){i.clear()}return e}));var i=t.cache;return t}var aa=sa;var ca=/[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;var la=/\\\\(\\\\)?/g;var da=aa((function(e){var t=[];if(e.charCodeAt(0)===46){t.push(\"\")}e.replace(ca,(function(e,i,n,o){t.push(n?o.replace(la,\"$1\"):i||e)}));return t}));var ua=da;function ha(e,t){var i=-1,n=e==null?0:e.length,o=Array(n);while(++io?0:o+t}i=i>o?o:i;if(i<0){i+=o}o=t>i?0:i-t>>>0;t>>>=0;var r=Array(o);while(++n0){if(++t>=fc){return arguments[0]}}else{t=0}return e.apply(undefined,arguments)}}var bc=pc;var wc=bc(hc);var _c=wc;function vc(e,t){return _c(cc(e,t,nc),e+\"\")}var kc=vc;function yc(e,t,i){if(!ce(i)){return false}var n=typeof t;if(n==\"number\"?Qi(i)&&ei(t,i.length):n==\"string\"&&t in i){return D(i[t],e)}return false}var xc=yc;function Ac(e){return kc((function(t,i){var n=-1,o=i.length,r=o>1?i[o-1]:undefined,s=o>2?i[2]:undefined;r=e.length>3&&typeof r==\"function\"?(o--,r):undefined;if(s&&xc(i[0],i[1],s)){r=o<3?undefined:r;o=1}t=Object(t);while(++nt===e);return Array.isArray(i)}set(e,t){if(ce(e)){for(const[t,i]of Object.entries(e)){this._styleProcessor.toNormalizedForm(t,i,this._styles)}}else{this._styleProcessor.toNormalizedForm(e,t,this._styles)}}remove(e){const t=Rc(e);ja(this._styles,t);delete this._styles[e];this._cleanEmptyObjectsOnPath(t)}getNormalized(e){return this._styleProcessor.getNormalized(e,this._styles)}toString(){if(this.isEmpty){return\"\"}return this._getStylesEntries().map(e=>e.join(\":\")).sort().join(\";\")+\";\"}getAsString(e){if(this.isEmpty){return}if(this._styles[e]&&!ce(this._styles[e])){return this._styles[e]}const t=this._styleProcessor.getReducedForm(e,this._styles);const i=t.find(([t])=>t===e);if(Array.isArray(i)){return i[1]}}getStyleNames(){if(this.isEmpty){return[]}const e=this._getStylesEntries();return e.map(([e])=>e)}clear(){this._styles={}}_getStylesEntries(){const e=[];const t=Object.keys(this._styles);for(const i of t){e.push(...this._styleProcessor.getReducedForm(i,this._styles))}return e}_cleanEmptyObjectsOnPath(e){const t=e.split(\".\");const i=t.length>1;if(!i){return}const n=t.splice(0,t.length-1).join(\".\");const o=Ba(this._styles,n);if(!o){return}const r=!Array.from(Object.keys(o)).length;if(r){this.remove(n)}}}class Oc{constructor(){this._normalizers=new Map;this._extractors=new Map;this._reducers=new Map;this._consumables=new Map}toNormalizedForm(e,t,i){if(ce(t)){zc(i,Rc(e),t);return}if(this._normalizers.has(e)){const n=this._normalizers.get(e);const{path:o,value:r}=n(t);zc(i,o,r)}else{zc(i,e,t)}}getNormalized(e,t){if(!e){return Ec({},t)}if(t[e]!==undefined){return t[e]}if(this._extractors.has(e)){const i=this._extractors.get(e);if(typeof i===\"string\"){return Ba(t,i)}const n=i(e,t);if(n){return n}}return Ba(t,Rc(e))}getReducedForm(e,t){const i=this.getNormalized(e,t);if(i===undefined){return[]}if(this._reducers.has(e)){const t=this._reducers.get(e);return t(i)}return[[e,i]]}getRelatedStyles(e){return this._consumables.get(e)||[]}setNormalizer(e,t){this._normalizers.set(e,t)}setExtractor(e,t){this._extractors.set(e,t)}setReducer(e,t){this._reducers.set(e,t)}setStyleRelation(e,t){this._mapStyleNames(e,t);for(const i of t){this._mapStyleNames(i,[e])}}_mapStyleNames(e,t){if(!this._consumables.has(e)){this._consumables.set(e,[])}this._consumables.get(e).push(...t)}}function Lc(e){let t=null;let i=0;let n=0;let o=null;const r=new Map;if(e===\"\"){return r}if(e.charAt(e.length-1)!=\";\"){e=e+\";\"}for(let s=0;s0){yield\"class\"}if(!this._styles.isEmpty){yield\"style\"}yield*this._attrs.keys()}*getAttributes(){yield*this._attrs.entries();if(this._classes.size>0){yield[\"class\",this.getAttribute(\"class\")]}if(!this._styles.isEmpty){yield[\"style\",this.getAttribute(\"style\")]}}getAttribute(e){if(e==\"class\"){if(this._classes.size>0){return[...this._classes].join(\" \")}return undefined}if(e==\"style\"){const e=this._styles.toString();return e==\"\"?undefined:e}return this._attrs.get(e)}hasAttribute(e){if(e==\"class\"){return this._classes.size>0}if(e==\"style\"){return!this._styles.isEmpty}return this._attrs.has(e)}isSimilar(e){if(!(e instanceof jc)){return false}if(this===e){return true}if(this.name!=e.name){return false}if(this._attrs.size!==e._attrs.size||this._classes.size!==e._classes.size||this._styles.size!==e._styles.size){return false}for(const[t,i]of this._attrs){if(!e._attrs.has(t)||e._attrs.get(t)!==i){return false}}for(const t of this._classes){if(!e._classes.has(t)){return false}}for(const t of this._styles.getStyleNames()){if(!e._styles.has(t)||e._styles.getAsString(t)!==this._styles.getAsString(t)){return false}}return true}hasClass(...e){for(const t of e){if(!this._classes.has(t)){return false}}return true}getClassNames(){return this._classes.keys()}getStyle(e){return this._styles.getAsString(e)}getNormalizedStyle(e){return this._styles.getNormalized(e)}getStyleNames(){return this._styles.getStyleNames()}hasStyle(...e){for(const t of e){if(!this._styles.has(t)){return false}}return true}findAncestor(...e){const t=new Ws(...e);let i=this.parent;while(i){if(t.match(i)){return i}i=i.parent}return null}getCustomProperty(e){return this._customProperties.get(e)}*getCustomProperties(){yield*this._customProperties.entries()}getIdentity(){const e=Array.from(this._classes).sort().join(\",\");const t=this._styles.toString();const i=Array.from(this._attrs).map(e=>`${e[0]}=\"${e[1]}\"`).sort().join(\" \");return this.name+(e==\"\"?\"\":` class=\"${e}\"`)+(!t?\"\":` style=\"${t}\"`)+(i==\"\"?\"\":` ${i}`)}_clone(e=false){const t=[];if(e){for(const i of this.getChildren()){t.push(i._clone(e))}}const i=new this.constructor(this.document,this.name,this._attrs,t);i._classes=new Set(this._classes);i._styles.set(this._styles.getNormalized());i._customProperties=new Map(this._customProperties);i.getFillerOffset=this.getFillerOffset;return i}_appendChild(e){return this._insertChild(this.childCount,e)}_insertChild(e,t){this._fireChange(\"children\",this);let i=0;const n=Vc(this.document,t);for(const t of n){if(t.parent!==null){t._remove()}t.parent=this;t.document=this.document;this._children.splice(e,0,t);e++;i++}return i}_removeChildren(e,t=1){this._fireChange(\"children\",this);for(let i=e;i0){this._classes.clear();return true}return false}if(e==\"style\"){if(!this._styles.isEmpty){this._styles.clear();return true}return false}return this._attrs.delete(e)}_addClass(e){this._fireChange(\"attributes\",this);e=Array.isArray(e)?e:[e];e.forEach(e=>this._classes.add(e))}_removeClass(e){this._fireChange(\"attributes\",this);e=Array.isArray(e)?e:[e];e.forEach(e=>this._classes.delete(e))}_setStyle(e,t){this._fireChange(\"attributes\",this);this._styles.set(e,t)}_removeStyle(e){this._fireChange(\"attributes\",this);e=Array.isArray(e)?e:[e];e.forEach(e=>this._styles.remove(e))}_setCustomProperty(e,t){this._customProperties.set(e,t)}_removeCustomProperty(e){return this._customProperties.delete(e)}}function Dc(e){e=Hs(e);for(const[t,i]of e){if(i===null){e.delete(t)}else if(typeof i!=\"string\"){e.set(t,String(i))}}return e}function Bc(e,t){const i=t.split(/\\s+/);e.clear();i.forEach(t=>e.add(t))}function Vc(e,t){if(typeof t==\"string\"){return[new Ds(e,t)]}if(!Fs(t)){t=[t]}return Array.from(t).map(t=>{if(typeof t==\"string\"){return new Ds(e,t)}if(t instanceof Bs){return new Ds(e,t.data)}return t})}class Fc extends jc{constructor(e,t,i,n){super(e,t,i,n);this.getFillerOffset=Hc}is(e,t=null){const i=e&&e.replace(/^view:/,\"\");if(!t){return i==\"containerElement\"||super.is(e)}else{return i==\"containerElement\"&&t==this.name||super.is(e,t)}}}function Hc(){const e=[...this.getChildren()];const t=e[this.childCount-1];if(t&&t.is(\"element\",\"br\")){return this.childCount}for(const t of e){if(!t.is(\"uiElement\")){return null}}return this.childCount}var Wc=Cc((function(e,t){jt(t,dn(t),e)}));var Uc=Wc;const $c=Symbol(\"observableProperties\");const qc=Symbol(\"boundObservables\");const Yc=Symbol(\"boundProperties\");const Gc={set(e,t){if(ce(e)){Object.keys(e).forEach(t=>{this.set(t,e[t])},this);return}Xc(this);const i=this[$c];if(e in this&&!i.has(e)){throw new ss[\"b\"](\"observable-set-cannot-override: Cannot override an existing property.\",this)}Object.defineProperty(this,e,{enumerable:true,configurable:true,get(){return i.get(e)},set(t){const n=i.get(e);let o=this.fire(\"set:\"+e,e,t,n);if(o===undefined){o=t}if(n!==o||!i.has(e)){i.set(e,o);this.fire(\"change:\"+e,e,o,n)}}});this[e]=t},bind(...e){if(!e.length||!el(e)){throw new ss[\"b\"](\"observable-bind-wrong-properties: All properties must be strings.\",this)}if(new Set(e).size!==e.length){throw new ss[\"b\"](\"observable-bind-duplicate-properties: Properties must be unique.\",this)}Xc(this);const t=this[Yc];e.forEach(e=>{if(t.has(e)){throw new ss[\"b\"](\"observable-bind-rebind: Cannot bind the same property more than once.\",this)}});const i=new Map;e.forEach(e=>{const n={property:e,to:[]};t.set(e,n);i.set(e,n)});return{to:Qc,toMany:Kc,_observable:this,_bindProperties:e,_to:[],_bindings:i}},unbind(...e){if(!($c in this)){return}const t=this[Yc];const i=this[qc];if(e.length){if(!el(e)){throw new ss[\"b\"](\"observable-unbind-wrong-properties: Properties must be strings.\",this)}e.forEach(e=>{const n=t.get(e);if(!n){return}let o,r,s,a;n.to.forEach(e=>{o=e[0];r=e[1];s=i.get(o);a=s[r];a.delete(n);if(!a.size){delete s[r]}if(!Object.keys(s).length){i.delete(o);this.stopListening(o,\"change\")}});t.delete(e)})}else{i.forEach((e,t)=>{this.stopListening(t,\"change\")});i.clear();t.clear()}},decorate(e){const t=this[e];if(!t){throw new ss[\"b\"](\"observablemixin-cannot-decorate-undefined: Cannot decorate an undefined method.\",this,{object:this,methodName:e})}this.on(e,(e,i)=>{e.return=t.apply(this,i)});this[e]=function(...t){return this.fire(e,t)}}};Uc(Gc,ds);var Jc=Gc;function Xc(e){if($c in e){return}Object.defineProperty(e,$c,{value:new Map});Object.defineProperty(e,qc,{value:new Map});Object.defineProperty(e,Yc,{value:new Map})}function Qc(...e){const t=tl(...e);const i=Array.from(this._bindings.keys());const n=i.length;if(!t.callback&&t.to.length>1){throw new ss[\"b\"](\"observable-bind-to-no-callback: Binding multiple observables only possible with callback.\",this)}if(n>1&&t.callback){throw new ss[\"b\"](\"observable-bind-to-extra-callback: Cannot bind multiple properties and use a callback in one binding.\",this)}t.to.forEach(e=>{if(e.properties.length&&e.properties.length!==n){throw new ss[\"b\"](\"observable-bind-to-properties-length: The number of properties must match.\",this)}if(!e.properties.length){e.properties=this._bindProperties}});this._to=t.to;if(t.callback){this._bindings.get(i[0]).callback=t.callback}rl(this._observable,this._to);nl(this);this._bindProperties.forEach(e=>{ol(this._observable,e)})}function Kc(e,t,i){if(this._bindings.size>1){throw new ss[\"b\"](\"observable-bind-to-many-not-one-binding: Cannot bind multiple properties with toMany().\",this)}this.to(...Zc(e,t),i)}function Zc(e,t){const i=e.map(e=>[e,t]);return Array.prototype.concat.apply([],i)}function el(e){return e.every(e=>typeof e==\"string\")}function tl(...e){if(!e.length){throw new ss[\"b\"](\"observable-bind-to-parse-error: Invalid argument syntax in `to()`.\",null)}const t={to:[]};let i;if(typeof e[e.length-1]==\"function\"){t.callback=e.pop()}e.forEach(e=>{if(typeof e==\"string\"){i.properties.push(e)}else if(typeof e==\"object\"){i={observable:e,properties:[]};t.to.push(i)}else{throw new ss[\"b\"](\"observable-bind-to-parse-error: Invalid argument syntax in `to()`.\",null)}});return t}function il(e,t,i,n){const o=e[qc];const r=o.get(i);const s=r||{};if(!s[n]){s[n]=new Set}s[n].add(t);if(!r){o.set(i,s)}}function nl(e){let t;e._bindings.forEach((i,n)=>{e._to.forEach(o=>{t=o.properties[i.callback?0:e._bindProperties.indexOf(n)];i.to.push([o.observable,t]);il(e._observable,i,o.observable,t)})})}function ol(e,t){const i=e[Yc];const n=i.get(t);let o;if(n.callback){o=n.callback.apply(e,n.to.map(e=>e[0][e[1]]))}else{o=n.to[0];o=o[0][o[1]]}if(e.hasOwnProperty(t)){e[t]=o}else{e.set(t,o)}}function rl(e,t){t.forEach(t=>{const i=e[qc];let n;if(!i.get(t.observable)){e.listenTo(t.observable,\"change\",(o,r)=>{n=i.get(t.observable)[r];if(n){n.forEach(t=>{ol(e,t.property)})}})}})}class sl extends Fc{constructor(e,t,i,n){super(e,t,i,n);this.set(\"isReadOnly\",false);this.set(\"isFocused\",false);this.bind(\"isReadOnly\").to(e);this.bind(\"isFocused\").to(e,\"isFocused\",t=>t&&e.selection.editableElement==this);this.listenTo(e.selection,\"change\",()=>{this.isFocused=e.isFocused&&e.selection.editableElement==this})}is(e,t=null){const i=e&&e.replace(/^view:/,\"\");if(!t){return i==\"editableElement\"||super.is(e)}else{return i==\"editableElement\"&&t==this.name||super.is(e,t)}}destroy(){this.stopListening()}}ks(sl,Jc);const al=Symbol(\"rootName\");class cl extends sl{constructor(e,t){super(e,t);this.rootName=\"main\"}is(e,t=null){const i=e.replace(/^view:/,\"\");if(!t){return i==\"rootElement\"||super.is(e)}else{return i==\"rootElement\"&&t==this.name||super.is(e,t)}}get rootName(){return this.getCustomProperty(al)}set rootName(e){this._setCustomProperty(al,e)}set _name(e){this.name=e}}class ll{constructor(e={}){if(!e.boundaries&&!e.startPosition){throw new ss[\"b\"](\"view-tree-walker-no-start-position: Neither boundaries nor starting position have been defined.\",null)}if(e.direction&&e.direction!=\"forward\"&&e.direction!=\"backward\"){throw new ss[\"b\"](\"view-tree-walker-unknown-direction: Only `backward` and `forward` direction allowed.\",e.startPosition,{direction:e.direction})}this.boundaries=e.boundaries||null;if(e.startPosition){this.position=dl._createAt(e.startPosition)}else{this.position=dl._createAt(e.boundaries[e.direction==\"backward\"?\"end\":\"start\"])}this.direction=e.direction||\"forward\";this.singleCharacters=!!e.singleCharacters;this.shallow=!!e.shallow;this.ignoreElementEnd=!!e.ignoreElementEnd;this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null;this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null}[Symbol.iterator](){return this}skip(e){let t,i,n;do{n=this.position;({done:t,value:i}=this.next())}while(!t&&e(i));if(!t){this.position=n}}next(){if(this.direction==\"forward\"){return this._next()}else{return this._previous()}}_next(){let e=this.position.clone();const t=this.position;const i=e.parent;if(i.parent===null&&e.offset===i.childCount){return{done:true}}if(i===this._boundaryEndParent&&e.offset==this.boundaries.end.offset){return{done:true}}let n;if(i instanceof Ds){if(e.isAtEnd){this.position=dl._createAfter(i);return this._next()}n=i.data[e.offset]}else{n=i.getChild(e.offset)}if(n instanceof jc){if(!this.shallow){e=new dl(n,0)}else{e.offset++}this.position=e;return this._formatReturnValue(\"elementStart\",n,t,e,1)}else if(n instanceof Ds){if(this.singleCharacters){e=new dl(n,0);this.position=e;return this._next()}else{let i=n.data.length;let o;if(n==this._boundaryEndParent){i=this.boundaries.end.offset;o=new Bs(n,0,i);e=dl._createAfter(o)}else{o=new Bs(n,0,n.data.length);e.offset++}this.position=e;return this._formatReturnValue(\"text\",o,t,e,i)}}else if(typeof n==\"string\"){let n;if(this.singleCharacters){n=1}else{const t=i===this._boundaryEndParent?this.boundaries.end.offset:i.data.length;n=t-e.offset}const o=new Bs(i,e.offset,n);e.offset+=n;this.position=e;return this._formatReturnValue(\"text\",o,t,e,n)}else{e=dl._createAfter(i);this.position=e;if(this.ignoreElementEnd){return this._next()}else{return this._formatReturnValue(\"elementEnd\",i,t,e)}}}_previous(){let e=this.position.clone();const t=this.position;const i=e.parent;if(i.parent===null&&e.offset===0){return{done:true}}if(i==this._boundaryStartParent&&e.offset==this.boundaries.start.offset){return{done:true}}let n;if(i instanceof Ds){if(e.isAtStart){this.position=dl._createBefore(i);return this._previous()}n=i.data[e.offset-1]}else{n=i.getChild(e.offset-1)}if(n instanceof jc){if(!this.shallow){e=new dl(n,n.childCount);this.position=e;if(this.ignoreElementEnd){return this._previous()}else{return this._formatReturnValue(\"elementEnd\",n,t,e)}}else{e.offset--;this.position=e;return this._formatReturnValue(\"elementStart\",n,t,e,1)}}else if(n instanceof Ds){if(this.singleCharacters){e=new dl(n,n.data.length);this.position=e;return this._previous()}else{let i=n.data.length;let o;if(n==this._boundaryStartParent){const t=this.boundaries.start.offset;o=new Bs(n,t,n.data.length-t);i=o.data.length;e=dl._createBefore(o)}else{o=new Bs(n,0,n.data.length);e.offset--}this.position=e;return this._formatReturnValue(\"text\",o,t,e,i)}}else if(typeof n==\"string\"){let n;if(!this.singleCharacters){const t=i===this._boundaryStartParent?this.boundaries.start.offset:0;n=e.offset-t}else{n=1}e.offset-=n;const o=new Bs(i,e.offset,n);this.position=e;return this._formatReturnValue(\"text\",o,t,e,n)}else{e=dl._createBefore(i);this.position=e;return this._formatReturnValue(\"elementStart\",i,t,e,1)}}_formatReturnValue(e,t,i,n,o){if(t instanceof Bs){if(t.offsetInText+t.data.length==t.textNode.data.length){if(this.direction==\"forward\"&&!(this.boundaries&&this.boundaries.end.isEqual(this.position))){n=dl._createAfter(t.textNode);this.position=n}else{i=dl._createAfter(t.textNode)}}if(t.offsetInText===0){if(this.direction==\"backward\"&&!(this.boundaries&&this.boundaries.start.isEqual(this.position))){n=dl._createBefore(t.textNode);this.position=n}else{i=dl._createBefore(t.textNode)}}}return{done:false,value:{type:e,item:t,previousPosition:i,nextPosition:n,length:o}}}}class dl{constructor(e,t){this.parent=e;this.offset=t}get nodeAfter(){if(this.parent.is(\"text\")){return null}return this.parent.getChild(this.offset)||null}get nodeBefore(){if(this.parent.is(\"text\")){return null}return this.parent.getChild(this.offset-1)||null}get isAtStart(){return this.offset===0}get isAtEnd(){const e=this.parent.is(\"text\")?this.parent.data.length:this.parent.childCount;return this.offset===e}get root(){return this.parent.root}get editableElement(){let e=this.parent;while(!(e instanceof sl)){if(e.parent){e=e.parent}else{return null}}return e}getShiftedBy(e){const t=dl._createAt(this);const i=t.offset+e;t.offset=i<0?0:i;return t}getLastMatchingPosition(e,t={}){t.startPosition=this;const i=new ll(t);i.skip(e);return i.position}getAncestors(){if(this.parent.is(\"documentFragment\")){return[this.parent]}else{return this.parent.getAncestors({includeSelf:true})}}getCommonAncestor(e){const t=this.getAncestors();const i=e.getAncestors();let n=0;while(t[n]==i[n]&&t[n]){n++}return n===0?null:t[n-1]}is(e){return e==\"position\"||e==\"view:position\"}isEqual(e){return this.parent==e.parent&&this.offset==e.offset}isBefore(e){return this.compareWith(e)==\"before\"}isAfter(e){return this.compareWith(e)==\"after\"}compareWith(e){if(this.root!==e.root){return\"different\"}if(this.isEqual(e)){return\"same\"}const t=this.parent.is(\"node\")?this.parent.getPath():[];const i=e.parent.is(\"node\")?e.parent.getPath():[];t.push(this.offset);i.push(e.offset);const n=Os(t,i);switch(n){case\"prefix\":return\"before\";case\"extension\":return\"after\";default:return t[n]0?new this(i,n):new this(n,i)}static _createIn(e){return this._createFromParentsAndOffsets(e,0,e,e.childCount)}static _createOn(e){const t=e.is(\"textProxy\")?e.offsetSize:1;return this._createFromPositionAndShift(dl._createBefore(e),t)}}function hl(e){if(e.item.is(\"attributeElement\")||e.item.is(\"uiElement\")){return true}return false}function fl(e){let t=0;for(const i of e){t++}return t}class ml{constructor(e=null,t,i){this._ranges=[];this._lastRangeBackward=false;this._isFake=false;this._fakeSelectionLabel=\"\";this.setTo(e,t,i)}get isFake(){return this._isFake}get fakeSelectionLabel(){return this._fakeSelectionLabel}get anchor(){if(!this._ranges.length){return null}const e=this._ranges[this._ranges.length-1];const t=this._lastRangeBackward?e.end:e.start;return t.clone()}get focus(){if(!this._ranges.length){return null}const e=this._ranges[this._ranges.length-1];const t=this._lastRangeBackward?e.start:e.end;return t.clone()}get isCollapsed(){return this.rangeCount===1&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}get editableElement(){if(this.anchor){return this.anchor.editableElement}return null}*getRanges(){for(const e of this._ranges){yield e.clone()}}getFirstRange(){let e=null;for(const t of this._ranges){if(!e||t.start.isBefore(e.start)){e=t}}return e?e.clone():null}getLastRange(){let e=null;for(const t of this._ranges){if(!e||t.end.isAfter(e.end)){e=t}}return e?e.clone():null}getFirstPosition(){const e=this.getFirstRange();return e?e.start.clone():null}getLastPosition(){const e=this.getLastRange();return e?e.end.clone():null}isEqual(e){if(this.isFake!=e.isFake){return false}if(this.isFake&&this.fakeSelectionLabel!=e.fakeSelectionLabel){return false}if(this.rangeCount!=e.rangeCount){return false}else if(this.rangeCount===0){return true}if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus)){return false}for(const t of this._ranges){let i=false;for(const n of e._ranges){if(t.isEqual(n)){i=true;break}}if(!i){return false}}return true}isSimilar(e){if(this.isBackward!=e.isBackward){return false}const t=fl(this.getRanges());const i=fl(e.getRanges());if(t!=i){return false}if(t==0){return true}for(let t of this.getRanges()){t=t.getTrimmed();let i=false;for(let n of e.getRanges()){n=n.getTrimmed();if(t.start.isEqual(n.start)&&t.end.isEqual(n.end)){i=true;break}}if(!i){return false}}return true}getSelectedElement(){if(this.rangeCount!==1){return null}return this.getFirstRange().getContainedElement()}setTo(e,t,i){if(e===null){this._setRanges([]);this._setFakeOptions(t)}else if(e instanceof ml||e instanceof gl){this._setRanges(e.getRanges(),e.isBackward);this._setFakeOptions({fake:e.isFake,label:e.fakeSelectionLabel})}else if(e instanceof ul){this._setRanges([e],t&&t.backward);this._setFakeOptions(t)}else if(e instanceof dl){this._setRanges([new ul(e)]);this._setFakeOptions(t)}else if(e instanceof js){const n=!!i&&!!i.backward;let o;if(t===undefined){throw new ss[\"b\"](\"view-selection-setTo-required-second-parameter: \"+\"selection.setTo requires the second parameter when the first parameter is a node.\",this)}else if(t==\"in\"){o=ul._createIn(e)}else if(t==\"on\"){o=ul._createOn(e)}else{o=new ul(dl._createAt(e,t))}this._setRanges([o],n);this._setFakeOptions(i)}else if(Fs(e)){this._setRanges(e,t&&t.backward);this._setFakeOptions(t)}else{throw new ss[\"b\"](\"view-selection-setTo-not-selectable: Cannot set selection to given place.\",this)}this.fire(\"change\")}setFocus(e,t){if(this.anchor===null){throw new ss[\"b\"](\"view-selection-setFocus-no-ranges: Cannot set selection focus if there are no ranges in selection.\",this)}const i=dl._createAt(e,t);if(i.compareWith(this.focus)==\"same\"){return}const n=this.anchor;this._ranges.pop();if(i.compareWith(n)==\"before\"){this._addRange(new ul(i,n),true)}else{this._addRange(new ul(n,i))}this.fire(\"change\")}is(e){return e==\"selection\"||e==\"view:selection\"}_setRanges(e,t=false){e=Array.from(e);this._ranges=[];for(const t of e){this._addRange(t)}this._lastRangeBackward=!!t}_setFakeOptions(e={}){this._isFake=!!e.fake;this._fakeSelectionLabel=e.fake?e.label||\"\":\"\"}_addRange(e,t=false){if(!(e instanceof ul)){throw new ss[\"b\"](\"view-selection-add-range-not-range: \"+\"Selection range set to an object that is not an instance of view.Range\",this)}this._pushRange(e);this._lastRangeBackward=!!t}_pushRange(e){for(const t of this._ranges){if(e.isIntersecting(t)){throw new ss[\"b\"](\"view-selection-range-intersects: Trying to add a range that intersects with another range from selection.\",this,{addedRange:e,intersectingRange:t})}}this._ranges.push(new ul(e.start,e.end))}}ks(ml,ds);class gl{constructor(e=null,t,i){this._selection=new ml;this._selection.delegate(\"change\").to(this);this._selection.setTo(e,t,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(e){return this._selection.isEqual(e)}isSimilar(e){return this._selection.isSimilar(e)}is(e){return e==\"selection\"||e==\"documentSelection\"||e==\"view:selection\"||e==\"view:documentSelection\"}_setTo(e,t,i){this._selection.setTo(e,t,i)}_setFocus(e,t){this._selection.setFocus(e,t)}}ks(gl,ds);class pl{constructor(e){this.selection=new gl;this.roots=new ys({idProperty:\"rootName\"});this.stylesProcessor=e;this.set(\"isReadOnly\",false);this.set(\"isFocused\",false);this.set(\"isComposing\",false);this._postFixers=new Set}getRoot(e=\"main\"){return this.roots.get(e)}registerPostFixer(e){this._postFixers.add(e)}destroy(){this.roots.map(e=>e.destroy());this.stopListening()}_callPostFixers(e){let t=false;do{for(const i of this._postFixers){t=i(e);if(t){break}}}while(t)}}ks(pl,Jc);const bl=10;class wl extends jc{constructor(e,t,i,n){super(e,t,i,n);this.getFillerOffset=_l;this._priority=bl;this._id=null;this._clonesGroup=null}get priority(){return this._priority}get id(){return this._id}getElementsWithSameId(){if(this.id===null){throw new ss[\"b\"](\"attribute-element-get-elements-with-same-id-no-id: \"+\"Cannot get elements with the same id for an attribute element without id.\",this)}return new Set(this._clonesGroup)}is(e,t=null){const i=e&&e.replace(/^view:/,\"\");if(!t){return i==\"attributeElement\"||super.is(e)}else{return i==\"attributeElement\"&&t==this.name||super.is(e,t)}}isSimilar(e){if(this.id!==null||e.id!==null){return this.id===e.id}return super.isSimilar(e)&&this.priority==e.priority}_clone(e){const t=super._clone(e);t._priority=this._priority;t._id=this._id;return t}}wl.DEFAULT_PRIORITY=bl;function _l(){if(vl(this)){return null}let e=this.parent;while(e&&e.is(\"attributeElement\")){if(vl(e)>1){return null}e=e.parent}if(!e||vl(e)>1){return null}return this.childCount}function vl(e){return Array.from(e.getChildren()).filter(e=>!e.is(\"uiElement\")).length}class kl extends jc{constructor(e,t,i,n){super(e,t,i,n);this.getFillerOffset=yl}is(e,t=null){const i=e.replace(/^view:/,\"\");if(!t){return i==\"emptyElement\"||super.is(e)}else{return i==\"emptyElement\"&&t==this.name||super.is(e,t)}}_insertChild(e,t){if(t&&(t instanceof js||Array.from(t).length>0)){throw new ss[\"b\"](\"view-emptyelement-cannot-add: Cannot add child nodes to EmptyElement instance.\",[this,t])}}}function yl(){return null}const xl=navigator.userAgent.toLowerCase();const Al={isMac:Tl(xl),isEdge:El(xl),isGecko:Ml(xl),isSafari:Pl(xl),isAndroid:Sl(xl),features:{isRegExpUnicodePropertySupported:Il()}};var Cl=Al;function Tl(e){return e.indexOf(\"macintosh\")>-1}function El(e){return!!e.match(/edge\\/(\\d+.?\\d*)/)}function Ml(e){return!!e.match(/gecko\\/\\d+/)}function Pl(e){return e.indexOf(\" applewebkit/\")>-1&&e.indexOf(\"chrome\")===-1}function Sl(e){return e.indexOf(\"android\")>-1}function Il(){let e=false;try{e=\"ć\".search(new RegExp(\"[\\\\p{L}]\",\"u\"))===0}catch(e){}return e}const Nl={\"⌘\":\"ctrl\",\"⇧\":\"shift\",\"⌥\":\"alt\"};const Ol={ctrl:\"⌘\",shift:\"⇧\",alt:\"⌥\"};const Ll=Dl();function Rl(e){let t;if(typeof e==\"string\"){t=Ll[e.toLowerCase()];if(!t){throw new ss[\"b\"](\"keyboard-unknown-key: Unknown key name.\",null,{key:e})}}else{t=e.keyCode+(e.altKey?Ll.alt:0)+(e.ctrlKey?Ll.ctrl:0)+(e.shiftKey?Ll.shift:0)}return t}function zl(e){if(typeof e==\"string\"){e=Bl(e)}return e.map(e=>typeof e==\"string\"?Rl(e):e).reduce((e,t)=>t+e,0)}function jl(e){if(!Cl.isMac){return e}return Bl(e).map(e=>Ol[e.toLowerCase()]||e).reduce((e,t)=>{if(e.slice(-1)in Nl){return e+t}else{return e+\"+\"+t}})}function Dl(){const e={arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,backspace:8,delete:46,enter:13,space:32,esc:27,tab:9,ctrl:1114112,cmd:1114112,shift:2228224,alt:4456448};for(let t=65;t<=90;t++){const i=String.fromCharCode(t);e[i.toLowerCase()]=t}for(let t=48;t<=57;t++){e[t-48]=t}for(let t=112;t<=123;t++){e[\"f\"+(t-111)]=t}return e}function Bl(e){return e.split(/\\s*\\+\\s*/)}class Vl extends jc{constructor(e,t,i,n){super(e,t,i,n);this.getFillerOffset=Hl}is(e,t=null){const i=e.replace(/^view:/,\"\");if(!t){return i==\"uiElement\"||super.is(e)}else{return i==\"uiElement\"&&t==this.name||super.is(e,t)}}_insertChild(e,t){if(t&&(t instanceof js||Array.from(t).length>0)){throw new ss[\"b\"](\"view-uielement-cannot-add: Cannot add child nodes to UIElement instance.\",this)}}render(e){return this.toDomElement(e)}toDomElement(e){const t=e.createElement(this.name);for(const e of this.getAttributeKeys()){t.setAttribute(e,this.getAttribute(e))}return t}}function Fl(e){e.document.on(\"keydown\",(t,i)=>Wl(t,i,e.domConverter))}function Hl(){return null}function Wl(e,t,i){if(t.keyCode==Ll.arrowright){const e=t.domTarget.ownerDocument.defaultView.getSelection();const n=e.rangeCount==1&&e.getRangeAt(0).collapsed;if(n||t.shiftKey){const t=e.focusNode;const o=e.focusOffset;const r=i.domPositionToView(t,o);if(r===null){return}let s=false;const a=r.getLastMatchingPosition(e=>{if(e.item.is(\"uiElement\")){s=true}if(e.item.is(\"uiElement\")||e.item.is(\"attributeElement\")){return true}return false});if(s){const t=i.viewPositionToDom(a);if(n){e.collapse(t.parent,t.offset)}else{e.extend(t.parent,t.offset)}}}}}class Ul{constructor(e,t){this.document=e;this._children=[];if(t){this._insertChild(0,t)}}[Symbol.iterator](){return this._children[Symbol.iterator]()}get childCount(){return this._children.length}get isEmpty(){return this.childCount===0}get root(){return this}get parent(){return null}is(e){return e==\"documentFragment\"||e==\"view:documentFragment\"}_appendChild(e){return this._insertChild(this.childCount,e)}getChild(e){return this._children[e]}getChildIndex(e){return this._children.indexOf(e)}getChildren(){return this._children[Symbol.iterator]()}_insertChild(e,t){this._fireChange(\"children\",this);let i=0;const n=$l(this.document,t);for(const t of n){if(t.parent!==null){t._remove()}t.parent=this;this._children.splice(e,0,t);e++;i++}return i}_removeChildren(e,t=1){this._fireChange(\"children\",this);for(let i=e;i{if(typeof t==\"string\"){return new Ds(e,t)}if(t instanceof Bs){return new Ds(e,t.data)}return t})}class ql{constructor(e){this.document=e;this._cloneGroups=new Map}setSelection(e,t,i){this.document.selection._setTo(e,t,i)}setSelectionFocus(e,t){this.document.selection._setFocus(e,t)}createText(e){return new Ds(this.document,e)}createAttributeElement(e,t,i={}){const n=new wl(this.document,e,t);if(i.priority){n._priority=i.priority}if(i.id){n._id=i.id}return n}createContainerElement(e,t){return new Fc(this.document,e,t)}createEditableElement(e,t){const i=new sl(this.document,e,t);i._document=this.document;return i}createEmptyElement(e,t){return new kl(this.document,e,t)}createUIElement(e,t,i){const n=new Vl(this.document,e,t);if(i){n.render=i}return n}setAttribute(e,t,i){i._setAttribute(e,t)}removeAttribute(e,t){t._removeAttribute(e)}addClass(e,t){t._addClass(e)}removeClass(e,t){t._removeClass(e)}setStyle(e,t,i){if(L(e)&&i===undefined){i=t}i._setStyle(e,t)}removeStyle(e,t){t._removeStyle(e)}setCustomProperty(e,t,i){i._setCustomProperty(e,t)}removeCustomProperty(e,t){return t._removeCustomProperty(e)}breakAttributes(e){if(e instanceof dl){return this._breakAttributes(e)}else{return this._breakAttributesRange(e)}}breakContainer(e){const t=e.parent;if(!t.is(\"containerElement\")){throw new ss[\"b\"](\"view-writer-break-non-container-element: Trying to break an element which is not a container element.\",this.document)}if(!t.parent){throw new ss[\"b\"](\"view-writer-break-root: Trying to break root element.\",this.document)}if(e.isAtStart){return dl._createBefore(t)}else if(!e.isAtEnd){const i=t._clone(false);this.insert(dl._createAfter(t),i);const n=new ul(e,dl._createAt(t,\"end\"));const o=new dl(i,0);this.move(n,o)}return dl._createAfter(t)}mergeAttributes(e){const t=e.offset;const i=e.parent;if(i.is(\"text\")){return e}if(i.is(\"attributeElement\")&&i.childCount===0){const e=i.parent;const t=i.index;i._remove();this._removeFromClonedElementsGroup(i);return this.mergeAttributes(new dl(e,t))}const n=i.getChild(t-1);const o=i.getChild(t);if(!n||!o){return e}if(n.is(\"text\")&&o.is(\"text\")){return Kl(n,o)}else if(n.is(\"attributeElement\")&&o.is(\"attributeElement\")&&n.isSimilar(o)){const e=n.childCount;n._appendChild(o.getChildren());o._remove();this._removeFromClonedElementsGroup(o);return this.mergeAttributes(new dl(n,e))}return e}mergeContainers(e){const t=e.nodeBefore;const i=e.nodeAfter;if(!t||!i||!t.is(\"containerElement\")||!i.is(\"containerElement\")){throw new ss[\"b\"](\"view-writer-merge-containers-invalid-position: \"+\"Element before and after given position cannot be merged.\",this.document)}const n=t.getChild(t.childCount-1);const o=n instanceof Ds?dl._createAt(n,\"end\"):dl._createAt(t,\"end\");this.move(ul._createIn(i),dl._createAt(t,\"end\"));this.remove(ul._createOn(i));return o}insert(e,t){t=Fs(t)?[...t]:[t];Zl(t,this.document);const i=Gl(e);if(!i){throw new ss[\"b\"](\"view-writer-invalid-position-container\",this.document)}const n=this._breakAttributes(e,true);const o=i._insertChild(n.offset,t);for(const e of t){this._addToClonedElementsGroup(e)}const r=n.getShiftedBy(o);const s=this.mergeAttributes(n);if(o===0){return new ul(s,s)}else{if(!s.isEqual(n)){r.offset--}const e=this.mergeAttributes(r);return new ul(s,e)}}remove(e){const t=e instanceof ul?e:ul._createOn(e);id(t,this.document);if(t.isCollapsed){return new Ul(this.document)}const{start:i,end:n}=this._breakAttributesRange(t,true);const o=i.parent;const r=n.offset-i.offset;const s=o._removeChildren(i.offset,r);for(const e of s){this._removeFromClonedElementsGroup(e)}const a=this.mergeAttributes(i);t.start=a;t.end=a.clone();return new Ul(this.document,s)}clear(e,t){id(e,this.document);const i=e.getWalker({direction:\"backward\",ignoreElementEnd:true});for(const n of i){const i=n.item;let o;if(i.is(\"element\")&&t.isSimilar(i)){o=ul._createOn(i)}else if(!n.nextPosition.isAfter(e.start)&&i.is(\"textProxy\")){const e=i.getAncestors().find(e=>e.is(\"element\")&&t.isSimilar(e));if(e){o=ul._createIn(e)}}if(o){if(o.end.isAfter(e.end)){o.end=e.end}if(o.start.isBefore(e.start)){o.start=e.start}this.remove(o)}}}move(e,t){let i;if(t.isAfter(e.end)){t=this._breakAttributes(t,true);const n=t.parent;const o=n.childCount;e=this._breakAttributesRange(e,true);i=this.remove(e);t.offset+=n.childCount-o}else{i=this.remove(e)}return this.insert(t,i)}wrap(e,t){if(!(t instanceof wl)){throw new ss[\"b\"](\"view-writer-wrap-invalid-attribute\",this.document)}id(e,this.document);if(!e.isCollapsed){return this._wrapRange(e,t)}else{let i=e.start;if(i.parent.is(\"element\")&&!Yl(i.parent)){i=i.getLastMatchingPosition(e=>e.item.is(\"uiElement\"))}i=this._wrapPosition(i,t);const n=this.document.selection;if(n.isCollapsed&&n.getFirstPosition().isEqual(e.start)){this.setSelection(i)}return new ul(i)}}unwrap(e,t){if(!(t instanceof wl)){throw new ss[\"b\"](\"view-writer-unwrap-invalid-attribute\",this.document)}id(e,this.document);if(e.isCollapsed){return e}const{start:i,end:n}=this._breakAttributesRange(e,true);const o=i.parent;const r=this._unwrapChildren(o,i.offset,n.offset,t);const s=this.mergeAttributes(r.start);if(!s.isEqual(r.start)){r.end.offset--}const a=this.mergeAttributes(r.end);return new ul(s,a)}rename(e,t){const i=new Fc(this.document,e,t.getAttributes());this.insert(dl._createAfter(t),i);this.move(ul._createIn(t),dl._createAt(i,0));this.remove(ul._createOn(t));return i}clearClonedElementsGroup(e){this._cloneGroups.delete(e)}createPositionAt(e,t){return dl._createAt(e,t)}createPositionAfter(e){return dl._createAfter(e)}createPositionBefore(e){return dl._createBefore(e)}createRange(e,t){return new ul(e,t)}createRangeOn(e){return ul._createOn(e)}createRangeIn(e){return ul._createIn(e)}createSelection(e,t,i){return new ml(e,t,i)}_wrapChildren(e,t,i,n){let o=t;const r=[];while(ofalse;e.parent._insertChild(e.offset,i);const n=new ul(e,e.getShiftedBy(1));this.wrap(n,t);const o=new dl(i.parent,i.index);i._remove();const r=o.nodeBefore;const s=o.nodeAfter;if(r instanceof Ds&&s instanceof Ds){return Kl(r,s)}return Xl(o)}_wrapAttributeElement(e,t){if(!nd(e,t)){return false}if(e.name!==t.name||e.priority!==t.priority){return false}for(const i of e.getAttributeKeys()){if(i===\"class\"||i===\"style\"){continue}if(t.hasAttribute(i)&&t.getAttribute(i)!==e.getAttribute(i)){return false}}for(const i of e.getStyleNames()){if(t.hasStyle(i)&&t.getStyle(i)!==e.getStyle(i)){return false}}for(const i of e.getAttributeKeys()){if(i===\"class\"||i===\"style\"){continue}if(!t.hasAttribute(i)){this.setAttribute(i,e.getAttribute(i),t)}}for(const i of e.getStyleNames()){if(!t.hasStyle(i)){this.setStyle(i,e.getStyle(i),t)}}for(const i of e.getClassNames()){if(!t.hasClass(i)){this.addClass(i,t)}}return true}_unwrapAttributeElement(e,t){if(!nd(e,t)){return false}if(e.name!==t.name||e.priority!==t.priority){return false}for(const i of e.getAttributeKeys()){if(i===\"class\"||i===\"style\"){continue}if(!t.hasAttribute(i)||t.getAttribute(i)!==e.getAttribute(i)){return false}}if(!t.hasClass(...e.getClassNames())){return false}for(const i of e.getStyleNames()){if(!t.hasStyle(i)||t.getStyle(i)!==e.getStyle(i)){return false}}for(const i of e.getAttributeKeys()){if(i===\"class\"||i===\"style\"){continue}this.removeAttribute(i,t)}this.removeClass(Array.from(e.getClassNames()),t);this.removeStyle(Array.from(e.getStyleNames()),t);return true}_breakAttributesRange(e,t=false){const i=e.start;const n=e.end;id(e,this.document);if(e.isCollapsed){const i=this._breakAttributes(e.start,t);return new ul(i,i)}const o=this._breakAttributes(n,t);const r=o.parent.childCount;const s=this._breakAttributes(i,t);o.offset+=o.parent.childCount-r;return new ul(s,o)}_breakAttributes(e,t=false){const i=e.offset;const n=e.parent;if(e.parent.is(\"emptyElement\")){throw new ss[\"b\"](\"view-writer-cannot-break-empty-element\",this.document)}if(e.parent.is(\"uiElement\")){throw new ss[\"b\"](\"view-writer-cannot-break-ui-element\",this.document)}if(!t&&n.is(\"text\")&&td(n.parent)){return e.clone()}if(td(n)){return e.clone()}if(n.is(\"text\")){return this._breakAttributes(Ql(e),t)}const o=n.childCount;if(i==o){const e=new dl(n.parent,n.index+1);return this._breakAttributes(e,t)}else{if(i===0){const e=new dl(n.parent,n.index);return this._breakAttributes(e,t)}else{const e=n.index+1;const o=n._clone();n.parent._insertChild(e,o);this._addToClonedElementsGroup(o);const r=n.childCount-i;const s=n._removeChildren(i,r);o._appendChild(s);const a=new dl(n.parent,e);return this._breakAttributes(a,t)}}}_addToClonedElementsGroup(e){if(!e.root.is(\"rootElement\")){return}if(e.is(\"element\")){for(const t of e.getChildren()){this._addToClonedElementsGroup(t)}}const t=e.id;if(!t){return}let i=this._cloneGroups.get(t);if(!i){i=new Set;this._cloneGroups.set(t,i)}i.add(e);e._clonesGroup=i}_removeFromClonedElementsGroup(e){if(e.is(\"element\")){for(const t of e.getChildren()){this._removeFromClonedElementsGroup(t)}}const t=e.id;if(!t){return}const i=this._cloneGroups.get(t);if(!i){return}i.delete(e)}}function Yl(e){return Array.from(e.getChildren()).some(e=>!e.is(\"uiElement\"))}function Gl(e){let t=e.parent;while(!td(t)){if(!t){return undefined}t=t.parent}return t}function Jl(e,t){if(e.priorityt.priority){return false}return e.getIdentity()i instanceof e)){throw new ss[\"b\"](\"view-writer-insert-invalid-node\",t)}if(!i.is(\"text\")){Zl(i.getChildren(),t)}}}const ed=[Ds,wl,Fc,kl,Vl];function td(e){return e&&(e.is(\"containerElement\")||e.is(\"documentFragment\"))}function id(e,t){const i=Gl(e.start);const n=Gl(e.end);if(!i||!n||i!==n){throw new ss[\"b\"](\"view-writer-invalid-range-container\",t)}}function nd(e,t){return e.id===null&&t.id===null}function od(e){return Object.prototype.toString.call(e)==\"[object Text]\"}const rd=e=>e.createTextNode(\" \");const sd=e=>{const t=e.createElement(\"br\");t.dataset.ckeFiller=true;return t};const ad=7;const cd=(()=>{let e=\"\";for(let t=0;t0){i.push({index:n,type:\"insert\",values:e.slice(n,r)})}if(o-n>0){i.push({index:n+(r-n),type:\"delete\",howMany:o-n})}return i}function _d(e,t){const{firstIndex:i,lastIndexOld:n,lastIndexNew:o}=e;if(i===-1){return Array(t).fill(\"equal\")}let r=[];if(i>0){r=r.concat(Array(i).fill(\"equal\"))}if(o-i>0){r=r.concat(Array(o-i).fill(\"insert\"))}if(n-i>0){r=r.concat(Array(n-i).fill(\"delete\"))}if(o200||o>200||n+o>300){return vd.fastDiff(e,t,i,true)}let r,s;if(ol?-1:1;if(d[n+h]){d[n]=d[n+h].slice(0)}if(!d[n]){d[n]=[]}d[n].push(o>l?r:s);let f=Math.max(o,l);let m=f-n;while(ml;m--){u[m]=h(m)}u[l]=h(l);f++}while(u[l]!==c);return d[l].slice(1)}vd.fastDiff=md;function kd(e,t,i){e.insertBefore(i,e.childNodes[t]||null)}function yd(e){const t=e.parentNode;if(t){t.removeChild(e)}}function xd(e){if(e){if(e.defaultView){return e instanceof e.defaultView.Document}else if(e.ownerDocument&&e.ownerDocument.defaultView){return e instanceof e.ownerDocument.defaultView.Node}}return false}class Ad{constructor(e,t){this.domDocuments=new Set;this.domConverter=e;this.markedAttributes=new Set;this.markedChildren=new Set;this.markedTexts=new Set;this.selection=t;this.isFocused=false;this._inlineFiller=null;this._fakeSelectionContainer=null}markToSync(e,t){if(e===\"text\"){if(this.domConverter.mapViewToDom(t.parent)){this.markedTexts.add(t)}}else{if(!this.domConverter.mapViewToDom(t)){return}if(e===\"attributes\"){this.markedAttributes.add(t)}else if(e===\"children\"){this.markedChildren.add(t)}else{throw new ss[\"b\"](\"view-renderer-unknown-type: Unknown type passed to Renderer.markToSync.\",this)}}}render(){let e;for(const e of this.markedChildren){this._updateChildrenMappings(e)}if(this._inlineFiller&&!this._isSelectionInInlineFiller()){this._removeInlineFiller()}if(this._inlineFiller){e=this._getInlineFillerPosition()}else if(this._needsInlineFillerAtSelection()){e=this.selection.getFirstPosition();this.markedChildren.add(e.parent)}for(const e of this.markedAttributes){this._updateAttrs(e)}for(const t of this.markedChildren){this._updateChildren(t,{inlineFillerPosition:e})}for(const t of this.markedTexts){if(!this.markedChildren.has(t.parent)&&this.domConverter.mapViewToDom(t.parent)){this._updateText(t,{inlineFillerPosition:e})}}if(e){const t=this.domConverter.viewPositionToDom(e);const i=t.parent.ownerDocument;if(!ld(t.parent)){this._inlineFiller=Td(i,t.parent,t.offset)}else{this._inlineFiller=t.parent}}else{this._inlineFiller=null}this._updateSelection();this._updateFocus();this.markedTexts.clear();this.markedAttributes.clear();this.markedChildren.clear()}_updateChildrenMappings(e){const t=this.domConverter.mapViewToDom(e);if(!t){return}const i=this.domConverter.mapViewToDom(e).childNodes;const n=Array.from(this.domConverter.viewChildrenToDom(e,t.ownerDocument,{withChildren:false}));const o=this._diffNodeLists(i,n);const r=this._findReplaceActions(o,i,n);if(r.indexOf(\"replace\")!==-1){const t={equal:0,insert:0,delete:0};for(const o of r){if(o===\"replace\"){const o=t.equal+t.insert;const r=t.equal+t.delete;const s=e.getChild(o);if(s&&!s.is(\"uiElement\")){this._updateElementMappings(s,i[r])}yd(n[o]);t.equal++}else{t[o]++}}}}_updateElementMappings(e,t){this.domConverter.unbindDomElement(t);this.domConverter.bindElements(t,e);this.markedChildren.add(e);this.markedAttributes.add(e)}_getInlineFillerPosition(){const e=this.selection.getFirstPosition();if(e.parent.is(\"text\")){return dl._createBefore(this.selection.getFirstPosition().parent)}else{return e}}_isSelectionInInlineFiller(){if(this.selection.rangeCount!=1||!this.selection.isCollapsed){return false}const e=this.selection.getFirstPosition();const t=this.domConverter.viewPositionToDom(e);if(t&&od(t.parent)&&ld(t.parent)){return true}return false}_removeInlineFiller(){const e=this._inlineFiller;if(!ld(e)){throw new ss[\"b\"](\"view-renderer-filler-was-lost: The inline filler node was lost.\",this)}if(dd(e)){e.parentNode.removeChild(e)}else{e.data=e.data.substr(ad)}this._inlineFiller=null}_needsInlineFillerAtSelection(){if(this.selection.rangeCount!=1||!this.selection.isCollapsed){return false}const e=this.selection.getFirstPosition();const t=e.parent;const i=e.offset;if(!this.domConverter.mapViewToDom(t.root)){return false}if(!t.is(\"element\")){return false}if(!Cd(t)){return false}if(i===t.getFillerOffset()){return false}const n=e.nodeBefore;const o=e.nodeAfter;if(n instanceof Ds||o instanceof Ds){return false}return true}_updateText(e,t){const i=this.domConverter.findCorrespondingDomText(e);const n=this.domConverter.viewToDom(e,i.ownerDocument);const o=i.data;let r=n.data;const s=t.inlineFillerPosition;if(s&&s.parent==e.parent&&s.offset==e.index){r=cd+r}if(o!=r){const e=md(o,r);for(const t of e){if(t.type===\"insert\"){i.insertData(t.index,t.values.join(\"\"))}else{i.deleteData(t.index,t.howMany)}}}}_updateAttrs(e){const t=this.domConverter.mapViewToDom(e);if(!t){return}const i=Array.from(t.attributes).map(e=>e.name);const n=e.getAttributeKeys();for(const i of n){t.setAttribute(i,e.getAttribute(i))}for(const n of i){if(!e.hasAttribute(n)){t.removeAttribute(n)}}}_updateChildren(e,t){const i=this.domConverter.mapViewToDom(e);if(!i){return}const n=t.inlineFillerPosition;const o=this.domConverter.mapViewToDom(e).childNodes;const r=Array.from(this.domConverter.viewChildrenToDom(e,i.ownerDocument,{bind:true,inlineFillerPosition:n}));if(n&&n.parent===e){Td(i.ownerDocument,r,n.offset)}const s=this._diffNodeLists(o,r);let a=0;const c=new Set;for(const e of s){if(e===\"delete\"){c.add(o[a]);yd(o[a])}else if(e===\"equal\"){a++}}a=0;for(const e of s){if(e===\"insert\"){kd(i,a,r[a]);a++}else if(e===\"equal\"){this._markDescendantTextToSync(this.domConverter.domToView(r[a]));a++}}for(const e of c){if(!e.parentNode){this.domConverter.unbindDomElement(e)}}}_diffNodeLists(e,t){e=Sd(e,this._fakeSelectionContainer);return vd(e,t,Md.bind(null,this.domConverter))}_findReplaceActions(e,t,i){if(e.indexOf(\"insert\")===-1||e.indexOf(\"delete\")===-1){return e}let n=[];let o=[];let r=[];const s={equal:0,insert:0,delete:0};for(const a of e){if(a===\"insert\"){r.push(i[s.equal+s.insert])}else if(a===\"delete\"){o.push(t[s.equal+s.delete])}else{n=n.concat(vd(o,r,Ed).map(e=>e===\"equal\"?\"replace\":e));n.push(\"equal\");o=[];r=[]}s[a]++}return n.concat(vd(o,r,Ed).map(e=>e===\"equal\"?\"replace\":e))}_markDescendantTextToSync(e){if(!e){return}if(e.is(\"text\")){this.markedTexts.add(e)}else if(e.is(\"element\")){for(const t of e.getChildren()){this._markDescendantTextToSync(t)}}}_updateSelection(){if(this.selection.rangeCount===0){this._removeDomSelection();this._removeFakeSelection();return}const e=this.domConverter.mapViewToDom(this.selection.editableElement);if(!this.isFocused||!e){return}if(this.selection.isFake){this._updateFakeSelection(e)}else{this._removeFakeSelection();this._updateDomSelection(e)}}_updateFakeSelection(e){const t=e.ownerDocument;if(!this._fakeSelectionContainer){this._fakeSelectionContainer=Id(t)}const i=this._fakeSelectionContainer;this.domConverter.bindFakeSelection(i,this.selection);if(!this._fakeSelectionNeedsUpdate(e)){return}if(!i.parentElement||i.parentElement!=e){e.appendChild(i)}i.textContent=this.selection.fakeSelectionLabel||\" \";const n=t.getSelection();const o=t.createRange();n.removeAllRanges();o.selectNodeContents(i);n.addRange(o)}_updateDomSelection(e){const t=e.ownerDocument.defaultView.getSelection();if(!this._domSelectionNeedsUpdate(t)){return}const i=this.domConverter.viewPositionToDom(this.selection.anchor);const n=this.domConverter.viewPositionToDom(this.selection.focus);e.focus();t.collapse(i.parent,i.offset);t.extend(n.parent,n.offset);if(Cl.isGecko){Pd(n,t)}}_domSelectionNeedsUpdate(e){if(!this.domConverter.isDomSelectionCorrect(e)){return true}const t=e&&this.domConverter.domSelectionToView(e);if(t&&this.selection.isEqual(t)){return false}if(!this.selection.isCollapsed&&this.selection.isSimilar(t)){return false}return true}_fakeSelectionNeedsUpdate(e){const t=this._fakeSelectionContainer;const i=e.ownerDocument.getSelection();if(!t||t.parentElement!==e){return true}if(i.anchorNode!==t&&!t.contains(i.anchorNode)){return true}return t.textContent!==this.selection.fakeSelectionLabel}_removeDomSelection(){for(const e of this.domDocuments){const t=e.getSelection();if(t.rangeCount){const t=e.activeElement;const i=this.domConverter.mapDomToView(t);if(t&&i){e.getSelection().removeAllRanges()}}}}_removeFakeSelection(){const e=this._fakeSelectionContainer;if(e){e.remove()}}_updateFocus(){if(this.isFocused){const e=this.selection.editableElement;if(e){this.domConverter.focus(e)}}}}ks(Ad,Jc);function Cd(e){if(e.getAttribute(\"contenteditable\")==\"false\"){return false}const t=e.findAncestor(e=>e.hasAttribute(\"contenteditable\"));return!t||t.getAttribute(\"contenteditable\")==\"true\"}function Td(e,t,i){const n=t instanceof Array?t:t.childNodes;const o=n[i];if(od(o)){o.data=cd+o.data;return o}else{const o=e.createTextNode(cd);if(Array.isArray(t)){n.splice(i,0,o)}else{kd(t,i,o)}return o}}function Ed(e,t){return xd(e)&&xd(t)&&!od(e)&&!od(t)&&e.tagName.toLowerCase()===t.tagName.toLowerCase()}function Md(e,t,i){if(t===i){return true}else if(od(t)&&od(i)){return t.data===i.data}else if(e.isBlockFiller(t)&&e.isBlockFiller(i)){return true}return false}function Pd(e,t){const i=e.parent;if(i.nodeType!=Node.ELEMENT_NODE||e.offset!=i.childNodes.length-1){return}const n=i.childNodes[e.offset];if(n&&n.tagName==\"BR\"){t.addRange(t.getRangeAt(0))}}function Sd(e,t){const i=Array.from(e);if(i.length==0||!t){return i}const n=i[i.length-1];if(n==t){i.pop()}return i}function Id(e){const t=e.createElement(\"div\");Object.assign(t.style,{position:\"fixed\",top:0,left:\"-9999px\",width:\"42px\"});t.textContent=\" \";return t}var Nd={window:window,document:document};function Od(e){let t=0;while(e.previousSibling){e=e.previousSibling;t++}return t}function Ld(e){const t=[];while(e&&e.nodeType!=Node.DOCUMENT_NODE){t.unshift(e);e=e.parentNode}return t}function Rd(e,t){const i=Ld(e);const n=Ld(t);let o=0;while(i[o]==n[o]&&i[o]){o++}return o===0?null:i[o-1]}const zd=sd(document);class jd{constructor(e,t={}){this.document=e;this.blockFillerMode=t.blockFillerMode||\"br\";this.preElements=[\"pre\"];this.blockElements=[\"p\",\"div\",\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\",\"li\",\"dd\",\"dt\",\"figcaption\"];this._blockFiller=this.blockFillerMode==\"br\"?sd:rd;this._domToViewMapping=new WeakMap;this._viewToDomMapping=new WeakMap;this._fakeSelectionMapping=new WeakMap}bindFakeSelection(e,t){this._fakeSelectionMapping.set(e,new ml(t))}fakeSelectionToView(e){return this._fakeSelectionMapping.get(e)}bindElements(e,t){this._domToViewMapping.set(e,t);this._viewToDomMapping.set(t,e)}unbindDomElement(e){const t=this._domToViewMapping.get(e);if(t){this._domToViewMapping.delete(e);this._viewToDomMapping.delete(t);for(const t of Array.from(e.childNodes)){this.unbindDomElement(t)}}}bindDocumentFragments(e,t){this._domToViewMapping.set(e,t);this._viewToDomMapping.set(t,e)}viewToDom(e,t,i={}){if(e.is(\"text\")){const i=this._processDataFromViewText(e);return t.createTextNode(i)}else{if(this.mapViewToDom(e)){return this.mapViewToDom(e)}let n;if(e.is(\"documentFragment\")){n=t.createDocumentFragment();if(i.bind){this.bindDocumentFragments(n,e)}}else if(e.is(\"uiElement\")){n=e.render(t);if(i.bind){this.bindElements(n,e)}return n}else{if(e.hasAttribute(\"xmlns\")){n=t.createElementNS(e.getAttribute(\"xmlns\"),e.name)}else{n=t.createElement(e.name)}if(i.bind){this.bindElements(n,e)}for(const t of e.getAttributeKeys()){n.setAttribute(t,e.getAttribute(t))}}if(i.withChildren||i.withChildren===undefined){for(const o of this.viewChildrenToDom(e,t,i)){n.appendChild(o)}}return n}}*viewChildrenToDom(e,t,i={}){const n=e.getFillerOffset&&e.getFillerOffset();let o=0;for(const r of e.getChildren()){if(n===o){yield this._blockFiller(t)}yield this.viewToDom(r,t,i);o++}if(n===o){yield this._blockFiller(t)}}viewRangeToDom(e){const t=this.viewPositionToDom(e.start);const i=this.viewPositionToDom(e.end);const n=document.createRange();n.setStart(t.parent,t.offset);n.setEnd(i.parent,i.offset);return n}viewPositionToDom(e){const t=e.parent;if(t.is(\"text\")){const i=this.findCorrespondingDomText(t);if(!i){return null}let n=e.offset;if(ld(i)){n+=ad}return{parent:i,offset:n}}else{let i,n,o;if(e.offset===0){i=this.mapViewToDom(t);if(!i){return null}o=i.childNodes[0]}else{const t=e.nodeBefore;n=t.is(\"text\")?this.findCorrespondingDomText(t):this.mapViewToDom(e.nodeBefore);if(!n){return null}i=n.parentNode;o=n.nextSibling}if(od(o)&&ld(o)){return{parent:o,offset:ad}}const r=n?Od(n)+1:0;return{parent:i,offset:r}}}domToView(e,t={}){if(this.isBlockFiller(e,this.blockFillerMode)){return null}const i=this.getParentUIElement(e,this._domToViewMapping);if(i){return i}if(od(e)){if(dd(e)){return null}else{const t=this._processDataFromDomText(e);return t===\"\"?null:new Ds(this.document,t)}}else if(this.isComment(e)){return null}else{if(this.mapDomToView(e)){return this.mapDomToView(e)}let i;if(this.isDocumentFragment(e)){i=new Ul(this.document);if(t.bind){this.bindDocumentFragments(e,i)}}else{const n=t.keepOriginalCase?e.tagName:e.tagName.toLowerCase();i=new jc(this.document,n);if(t.bind){this.bindElements(e,i)}const o=e.attributes;for(let e=o.length-1;e>=0;e--){i._setAttribute(o[e].name,o[e].value)}}if(t.withChildren||t.withChildren===undefined){for(const n of this.domChildrenToView(e,t)){i._appendChild(n)}}return i}}*domChildrenToView(e,t={}){for(let i=0;i{const{scrollLeft:t,scrollTop:i}=e;n.push([t,i])});t.focus();Bd(t,e=>{const[t,i]=n.shift();e.scrollLeft=t;e.scrollTop=i});Nd.window.scrollTo(e,i)}}isElement(e){return e&&e.nodeType==Node.ELEMENT_NODE}isDocumentFragment(e){return e&&e.nodeType==Node.DOCUMENT_FRAGMENT_NODE}isComment(e){return e&&e.nodeType==Node.COMMENT_NODE}isBlockFiller(e){if(this.blockFillerMode==\"br\"){return e.isEqualNode(zd)}if(e.tagName===\"BR\"&&Fd(e,this.blockElements)&&e.parentNode.childNodes.length===1){return true}return Vd(e,this.blockElements)}isDomSelectionBackward(e){if(e.isCollapsed){return false}const t=document.createRange();t.setStart(e.anchorNode,e.anchorOffset);t.setEnd(e.focusNode,e.focusOffset);const i=t.collapsed;t.detach();return i}getParentUIElement(e){const t=Ld(e);t.pop();while(t.length){const e=t.pop();const i=this._domToViewMapping.get(e);if(i&&i.is(\"uiElement\")){return i}}return null}isDomSelectionCorrect(e){return this._isDomSelectionPositionCorrect(e.anchorNode,e.anchorOffset)&&this._isDomSelectionPositionCorrect(e.focusNode,e.focusOffset)}_isDomSelectionPositionCorrect(e,t){if(od(e)&&ld(e)&&tthis.preElements.includes(e.name))){return t}if(t.charAt(0)==\" \"){const i=this._getTouchingViewTextNode(e,false);const n=i&&this._nodeEndsWithSpace(i);if(n||!i){t=\" \"+t.substr(1)}}if(t.charAt(t.length-1)==\" \"){const i=this._getTouchingViewTextNode(e,true);if(t.charAt(t.length-2)==\" \"||!i||i.data.charAt(0)==\" \"){t=t.substr(0,t.length-1)+\" \"}}return t.replace(/ {2}/g,\"  \")}_nodeEndsWithSpace(e){if(e.getAncestors().some(e=>this.preElements.includes(e.name))){return false}const t=this._processDataFromViewText(e);return t.charAt(t.length-1)==\" \"}_processDataFromDomText(e){let t=e.data;if(Dd(e,this.preElements)){return ud(e)}t=t.replace(/[ \\n\\t\\r]{1,}/g,\" \");const i=this._getTouchingInlineDomNode(e,false);const n=this._getTouchingInlineDomNode(e,true);const o=this._checkShouldLeftTrimDomText(i);const r=this._checkShouldRightTrimDomText(e,n);if(o){t=t.replace(/^ /,\"\")}if(r){t=t.replace(/ $/,\"\")}t=ud(new Text(t));t=t.replace(/ \\u00A0/g,\" \");if(/( |\\u00A0)\\u00A0$/.test(t)||!n||n.data&&n.data.charAt(0)==\" \"){t=t.replace(/\\u00A0$/,\" \")}if(o){t=t.replace(/^\\u00A0/,\" \")}return t}_checkShouldLeftTrimDomText(e){if(!e){return true}if(Gr(e)){return true}return/[^\\S\\u00A0]/.test(e.data.charAt(e.data.length-1))}_checkShouldRightTrimDomText(e,t){if(t){return false}return!ld(e)}_getTouchingViewTextNode(e,t){const i=new ll({startPosition:t?dl._createAfter(e):dl._createBefore(e),direction:t?\"forward\":\"backward\"});for(const e of i){if(e.item.is(\"containerElement\")){return null}else if(e.item.is(\"br\")){return null}else if(e.item.is(\"textProxy\")){return e.item}}return null}_getTouchingInlineDomNode(e,t){if(!e.parentNode){return null}const i=t?\"nextNode\":\"previousNode\";const n=e.ownerDocument;const o=Ld(e)[0];const r=n.createTreeWalker(o,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,{acceptNode(e){if(od(e)){return NodeFilter.FILTER_ACCEPT}if(e.tagName==\"BR\"){return NodeFilter.FILTER_ACCEPT}return NodeFilter.FILTER_SKIP}});r.currentNode=e;const s=r[i]();if(s!==null){const t=Rd(e,s);if(t&&!Dd(e,this.blockElements,t)&&!Dd(s,this.blockElements,t)){return s}}return null}}function Dd(e,t,i){let n=Ld(e);if(i){n=n.slice(n.indexOf(i)+1)}return n.some(e=>e.tagName&&t.includes(e.tagName.toLowerCase()))}function Bd(e,t){while(e&&e!=Nd.document){t(e);e=e.parentNode}}function Vd(e,t){const i=od(e)&&e.data==\" \";return i&&Fd(e,t)&&e.parentNode.childNodes.length===1}function Fd(e,t){const i=e.parentNode;return i&&i.tagName&&t.includes(i.tagName.toLowerCase())}function Hd(e){const t=Object.prototype.toString.apply(e);if(t==\"[object Window]\"){return true}if(t==\"[object global]\"){return true}return false}const Wd=Uc({},ds,{listenTo(e,...t){if(xd(e)||Hd(e)){const i=this._getProxyEmitter(e)||new $d(e);i.attach(...t);e=i}ds.listenTo.call(this,e,...t)},stopListening(e,t,i){if(xd(e)||Hd(e)){const t=this._getProxyEmitter(e);if(!t){return}e=t}ds.stopListening.call(this,e,t,i);if(e instanceof $d){e.detach(t)}},_getProxyEmitter(e){return us(this,qd(e))}});var Ud=Wd;class $d{constructor(e){hs(this,qd(e));this._domNode=e}}Uc($d.prototype,ds,{attach(e,t,i={}){if(this._domListeners&&this._domListeners[e]){return}const n=this._createDomListener(e,!!i.useCapture);this._domNode.addEventListener(e,n,!!i.useCapture);if(!this._domListeners){this._domListeners={}}this._domListeners[e]=n},detach(e){let t;if(this._domListeners[e]&&(!(t=this._events[e])||!t.callbacks.length)){this._domListeners[e].removeListener()}},_createDomListener(e,t){const i=t=>{this.fire(e,t)};i.removeListener=()=>{this._domNode.removeEventListener(e,i,t);delete this._domListeners[e]};return i}});function qd(e){return e[\"data-ck-expando\"]||(e[\"data-ck-expando\"]=is())}class Yd{constructor(e){this.view=e;this.document=e.document;this.isEnabled=false}enable(){this.isEnabled=true}disable(){this.isEnabled=false}destroy(){this.disable();this.stopListening()}}ks(Yd,Ud);var Gd=\"__lodash_hash_undefined__\";function Jd(e){this.__data__.set(e,Gd);return this}var Xd=Jd;function Qd(e){return this.__data__.has(e)}var Kd=Qd;function Zd(e){var t=-1,i=e==null?0:e.length;this.__data__=new vt;while(++ta)){return false}var l=r.get(e);if(l&&r.get(t)){return l==t}var d=-1,u=true,h=i&su?new eu:undefined;r.set(e,t);r.set(t,e);while(++d{this.listenTo(e,t,(e,t)=>{if(this.isEnabled){this.onDomEvent(t)}},{useCapture:this.useCapture})})}fire(e,t,i){if(this.isEnabled){this.document.fire(e,new Gu(this.view,t,i))}}}class Xu extends Ju{constructor(e){super(e);this.domEventType=[\"keydown\",\"keyup\"]}onDomEvent(e){this.fire(e.type,e,{keyCode:e.keyCode,altKey:e.altKey,ctrlKey:e.ctrlKey||e.metaKey,shiftKey:e.shiftKey,get keystroke(){return Rl(this)}})}}var Qu=function(){return n[\"a\"].Date.now()};var Ku=Qu;var Zu=0/0;var eh=/^\\s+|\\s+$/g;var th=/^[-+]0x[0-9a-f]+$/i;var ih=/^0b[01]+$/i;var nh=/^0o[0-7]+$/i;var oh=parseInt;function rh(e){if(typeof e==\"number\"){return e}if(Qs(e)){return Zu}if(ce(e)){var t=typeof e.valueOf==\"function\"?e.valueOf():e;e=ce(t)?t+\"\":t}if(typeof e!=\"string\"){return e===0?e:+e}e=e.replace(eh,\"\");var i=ih.test(e);return i||nh.test(e)?oh(e.slice(2),i?2:8):th.test(e)?Zu:+e}var sh=rh;var ah=\"Expected a function\";var ch=Math.max,lh=Math.min;function dh(e,t,i){var n,o,r,s,a,c,l=0,d=false,u=false,h=true;if(typeof e!=\"function\"){throw new TypeError(ah)}t=sh(t)||0;if(ce(i)){d=!!i.leading;u=\"maxWait\"in i;r=u?ch(sh(i.maxWait)||0,t):r;h=\"trailing\"in i?!!i.trailing:h}function f(t){var i=n,r=o;n=o=undefined;l=t;s=e.apply(r,i);return s}function m(e){l=e;a=setTimeout(b,t);return d?f(e):s}function g(e){var i=e-c,n=e-l,o=t-i;return u?lh(o,r-n):o}function p(e){var i=e-c,n=e-l;return c===undefined||i>=t||i<0||u&&n>=r}function b(){var e=Ku();if(p(e)){return w(e)}a=setTimeout(b,g(e))}function w(e){a=undefined;if(h&&n){return f(e)}n=o=undefined;return s}function _(){if(a!==undefined){clearTimeout(a)}l=0;n=c=o=a=undefined}function v(){return a===undefined?s:w(Ku())}function k(){var e=Ku(),i=p(e);n=arguments;o=this;c=e;if(i){if(a===undefined){return m(c)}if(u){clearTimeout(a);a=setTimeout(b,t);return f(c)}}if(a===undefined){a=setTimeout(b,t)}return s}k.cancel=_;k.flush=v;return k}var uh=dh;class hh extends Yd{constructor(e){super(e);this._fireSelectionChangeDoneDebounced=uh(e=>this.document.fire(\"selectionChangeDone\",e),200)}observe(){const e=this.document;e.on(\"keydown\",(t,i)=>{const n=e.selection;if(n.isFake&&fh(i.keyCode)&&this.isEnabled){i.preventDefault();this._handleSelectionMove(i.keyCode)}},{priority:\"lowest\"})}destroy(){super.destroy();this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionMove(e){const t=this.document.selection;const i=new ml(t.getRanges(),{backward:t.isBackward,fake:false});if(e==Ll.arrowleft||e==Ll.arrowup){i.setTo(i.getFirstPosition())}if(e==Ll.arrowright||e==Ll.arrowdown){i.setTo(i.getLastPosition())}const n={oldSelection:t,newSelection:i,domSelection:null};this.document.fire(\"selectionChange\",n);this._fireSelectionChangeDoneDebounced(n)}}function fh(e){return e==Ll.arrowright||e==Ll.arrowleft||e==Ll.arrowup||e==Ll.arrowdown}class mh extends Yd{constructor(e){super(e);this.mutationObserver=e.getObserver(Yu);this.selection=this.document.selection;this.domConverter=e.domConverter;this._documents=new WeakSet;this._fireSelectionChangeDoneDebounced=uh(e=>this.document.fire(\"selectionChangeDone\",e),200);this._clearInfiniteLoopInterval=setInterval(()=>this._clearInfiniteLoop(),1e3);this._loopbackCounter=0}observe(e){const t=e.ownerDocument;if(this._documents.has(t)){return}this.listenTo(t,\"selectionchange\",()=>{this._handleSelectionChange(t)});this._documents.add(t)}destroy(){super.destroy();clearInterval(this._clearInfiniteLoopInterval);this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionChange(e){if(!this.isEnabled){return}this.mutationObserver.flush();const t=e.defaultView.getSelection();const i=this.domConverter.domSelectionToView(t);if(i.rangeCount==0){return}if(this.selection.isEqual(i)&&this.domConverter.isDomSelectionCorrect(t)){return}if(++this._loopbackCounter>60){return}if(this.selection.isSimilar(i)){this.view.forceRender()}else{const e={oldSelection:this.selection,newSelection:i,domSelection:t};this.document.fire(\"selectionChange\",e);this._fireSelectionChangeDoneDebounced(e)}}_clearInfiniteLoop(){this._loopbackCounter=0}}class gh extends Ju{constructor(e){super(e);this.domEventType=[\"focus\",\"blur\"];this.useCapture=true;const t=this.document;t.on(\"focus\",()=>{t.isFocused=true;this._renderTimeoutId=setTimeout(()=>e.forceRender(),50)});t.on(\"blur\",(i,n)=>{const o=t.selection.editableElement;if(o===null||o===n.target){t.isFocused=false;e.forceRender()}})}onDomEvent(e){this.fire(e.type,e)}destroy(){if(this._renderTimeoutId){clearTimeout(this._renderTimeoutId)}super.destroy()}}class ph extends Ju{constructor(e){super(e);this.domEventType=[\"compositionstart\",\"compositionupdate\",\"compositionend\"];const t=this.document;t.on(\"compositionstart\",()=>{t.isComposing=true});t.on(\"compositionend\",()=>{t.isComposing=false})}onDomEvent(e){this.fire(e.type,e)}}class bh extends Ju{constructor(e){super(e);this.domEventType=[\"beforeinput\"]}onDomEvent(e){this.fire(e.type,e)}}function wh(e){return Object.prototype.toString.apply(e)==\"[object Range]\"}function _h(e){const t=e.ownerDocument.defaultView.getComputedStyle(e);return{top:parseInt(t.borderTopWidth,10),right:parseInt(t.borderRightWidth,10),bottom:parseInt(t.borderBottomWidth,10),left:parseInt(t.borderLeftWidth,10)}}const vh=[\"top\",\"right\",\"bottom\",\"left\",\"width\",\"height\"];class kh{constructor(e){const t=wh(e);Object.defineProperty(this,\"_source\",{value:e._source||e,writable:true,enumerable:false});if(Gr(e)||t){if(t){yh(this,kh.getDomRangeRects(e)[0])}else{yh(this,e.getBoundingClientRect())}}else if(Hd(e)){const{innerWidth:t,innerHeight:i}=e;yh(this,{top:0,right:t,bottom:i,left:0,width:t,height:i})}else{yh(this,e)}}clone(){return new kh(this)}moveTo(e,t){this.top=t;this.right=e+this.width;this.bottom=t+this.height;this.left=e;return this}moveBy(e,t){this.top+=t;this.right+=e;this.left+=e;this.bottom+=t;return this}getIntersection(e){const t={top:Math.max(this.top,e.top),right:Math.min(this.right,e.right),bottom:Math.min(this.bottom,e.bottom),left:Math.max(this.left,e.left)};t.width=t.right-t.left;t.height=t.bottom-t.top;if(t.width<0||t.height<0){return null}else{return new kh(t)}}getIntersectionArea(e){const t=this.getIntersection(e);if(t){return t.getArea()}else{return 0}}getArea(){return this.width*this.height}getVisible(){const e=this._source;let t=this.clone();if(!xh(e)){let i=e.parentNode||e.commonAncestorContainer;while(i&&!xh(i)){const e=new kh(i);const n=t.getIntersection(e);if(n){if(n.getArea()Rh(e,n));const s=Rh(e,n);Eh(n,s,t);if(n.parent!=n){o=n.frameElement;n=n.parent;if(!o){return}}else{n=null}}}function Th(e){const t=Lh(e);Mh(t,()=>new kh(e))}Object.assign(Ah,{scrollViewportToShowTarget:Ch,scrollAncestorsToShowTarget:Th});function Eh(e,t,i){const n=t.clone().moveBy(0,i);const o=t.clone().moveBy(0,-i);const r=new kh(e).excludeScrollbarsAndBorders();const s=[o,n];if(!s.every(e=>r.contains(e))){let{scrollX:s,scrollY:a}=e;if(Sh(o,r)){a-=r.top-t.top+i}else if(Ph(n,r)){a+=t.bottom-r.bottom+i}if(Ih(t,r)){s-=r.left-t.left+i}else if(Nh(t,r)){s+=t.right-r.right+i}e.scrollTo(s,a)}}function Mh(e,t){const i=Oh(e);let n,o;while(e!=i.document.body){o=t();n=new kh(e).excludeScrollbarsAndBorders();if(!n.contains(o)){if(Sh(o,n)){e.scrollTop-=n.top-o.top}else if(Ph(o,n)){e.scrollTop+=o.bottom-n.bottom}if(Ih(o,n)){e.scrollLeft-=n.left-o.left}else if(Nh(o,n)){e.scrollLeft+=o.right-n.right}}e=e.parentNode}}function Ph(e,t){return e.bottom>t.bottom}function Sh(e,t){return e.topt.right}function Oh(e){if(wh(e)){return e.startContainer.ownerDocument.defaultView}else{return e.ownerDocument.defaultView}}function Lh(e){if(wh(e)){let t=e.commonAncestorContainer;if(od(t)){t=t.parentNode}return t}else{return e.parentNode}}function Rh(e,t){const i=Oh(e);const n=new kh(e);if(i===t){return n}else{let e=i;while(e!=t){const t=e.frameElement;const i=new kh(t).excludeScrollbarsAndBorders();n.moveBy(i.left,i.top);e=e.parent}}return n}class zh{constructor(e){this.document=new pl(e);this.domConverter=new jd(this.document);this.domRoots=new Map;this.set(\"isRenderingInProgress\",false);this._renderer=new Ad(this.domConverter,this.document.selection);this._renderer.bind(\"isFocused\").to(this.document);this._initialDomRootAttributes=new WeakMap;this._observers=new Map;this._ongoingChange=false;this._postFixersInProgress=false;this._renderingDisabled=false;this._hasChangedSinceTheLastRendering=false;this._writer=new ql(this.document);this.addObserver(Yu);this.addObserver(mh);this.addObserver(gh);this.addObserver(Xu);this.addObserver(hh);this.addObserver(ph);if(Cl.isAndroid){this.addObserver(bh)}hd(this);Fl(this);this.on(\"render\",()=>{this._render();this.document.fire(\"layoutChanged\");this._hasChangedSinceTheLastRendering=false});this.listenTo(this.document.selection,\"change\",()=>{this._hasChangedSinceTheLastRendering=true})}attachDomRoot(e,t=\"main\"){const i=this.document.getRoot(t);i._name=e.tagName.toLowerCase();const n={};for(const{name:t,value:o}of Array.from(e.attributes)){n[t]=o;if(t===\"class\"){this._writer.addClass(o.split(\" \"),i)}else{this._writer.setAttribute(t,o,i)}}this._initialDomRootAttributes.set(e,n);const o=()=>{this._writer.setAttribute(\"contenteditable\",!i.isReadOnly,i);if(i.isReadOnly){this._writer.addClass(\"ck-read-only\",i)}else{this._writer.removeClass(\"ck-read-only\",i)}};o();this.domRoots.set(t,e);this.domConverter.bindElements(e,i);this._renderer.markToSync(\"children\",i);this._renderer.markToSync(\"attributes\",i);this._renderer.domDocuments.add(e.ownerDocument);i.on(\"change:children\",(e,t)=>this._renderer.markToSync(\"children\",t));i.on(\"change:attributes\",(e,t)=>this._renderer.markToSync(\"attributes\",t));i.on(\"change:text\",(e,t)=>this._renderer.markToSync(\"text\",t));i.on(\"change:isReadOnly\",()=>this.change(o));i.on(\"change\",()=>{this._hasChangedSinceTheLastRendering=true});for(const i of this._observers.values()){i.observe(e,t)}}detachDomRoot(e){const t=this.domRoots.get(e);Array.from(t.attributes).forEach(({name:e})=>t.removeAttribute(e));const i=this._initialDomRootAttributes.get(t);for(const e in i){t.setAttribute(e,i[e])}this.domRoots.delete(e);this.domConverter.unbindDomElement(t)}getDomRoot(e=\"main\"){return this.domRoots.get(e)}addObserver(e){let t=this._observers.get(e);if(t){return t}t=new e(this);this._observers.set(e,t);for(const[e,i]of this.domRoots){t.observe(i,e)}t.enable();return t}getObserver(e){return this._observers.get(e)}disableObservers(){for(const e of this._observers.values()){e.disable()}}enableObservers(){for(const e of this._observers.values()){e.enable()}}scrollToTheSelection(){const e=this.document.selection.getFirstRange();if(e){Ch({target:this.domConverter.viewRangeToDom(e),viewportOffset:20})}}focus(){if(!this.document.isFocused){const e=this.document.selection.editableElement;if(e){this.domConverter.focus(e);this.forceRender()}else{}}}change(e){if(this.isRenderingInProgress||this._postFixersInProgress){throw new ss[\"b\"](\"cannot-change-view-tree: \"+\"Attempting to make changes to the view when it is in an incorrect state: rendering or post-fixers are in progress. \"+\"This may cause some unexpected behavior and inconsistency between the DOM and the view.\",this)}try{if(this._ongoingChange){return e(this._writer)}this._ongoingChange=true;const t=e(this._writer);this._ongoingChange=false;if(!this._renderingDisabled&&this._hasChangedSinceTheLastRendering){this._postFixersInProgress=true;this.document._callPostFixers(this._writer);this._postFixersInProgress=false;this.fire(\"render\")}return t}catch(e){ss[\"b\"].rethrowUnexpectedError(e,this)}}forceRender(){this._hasChangedSinceTheLastRendering=true;this.change(()=>{})}destroy(){for(const e of this._observers.values()){e.destroy()}this.document.destroy();this.stopListening()}createPositionAt(e,t){return dl._createAt(e,t)}createPositionAfter(e){return dl._createAfter(e)}createPositionBefore(e){return dl._createBefore(e)}createRange(e,t){return new ul(e,t)}createRangeOn(e){return ul._createOn(e)}createRangeIn(e){return ul._createIn(e)}createSelection(e,t,i){return new ml(e,t,i)}_disableRendering(e){this._renderingDisabled=e;if(e==false){this.change(()=>{})}}_render(){this.isRenderingInProgress=true;this.disableObservers();this._renderer.render();this.enableObservers();this.isRenderingInProgress=false}}ks(zh,Jc);class jh{constructor(e){this.parent=null;this._attrs=Hs(e)}get index(){let e;if(!this.parent){return null}if((e=this.parent.getChildIndex(this))===null){throw new ss[\"b\"](\"model-node-not-found-in-parent: The node's parent does not contain this node.\",this)}return e}get startOffset(){let e;if(!this.parent){return null}if((e=this.parent.getChildStartOffset(this))===null){throw new ss[\"b\"](\"model-node-not-found-in-parent: The node's parent does not contain this node.\",this)}return e}get offsetSize(){return 1}get endOffset(){if(!this.parent){return null}return this.startOffset+this.offsetSize}get nextSibling(){const e=this.index;return e!==null&&this.parent.getChild(e+1)||null}get previousSibling(){const e=this.index;return e!==null&&this.parent.getChild(e-1)||null}get root(){let e=this;while(e.parent){e=e.parent}return e}isAttached(){return this.root.is(\"rootElement\")}getPath(){const e=[];let t=this;while(t.parent){e.unshift(t.startOffset);t=t.parent}return e}getAncestors(e={includeSelf:false,parentFirst:false}){const t=[];let i=e.includeSelf?this:this.parent;while(i){t[e.parentFirst?\"push\":\"unshift\"](i);i=i.parent}return t}getCommonAncestor(e,t={}){const i=this.getAncestors(t);const n=e.getAncestors(t);let o=0;while(i[o]==n[o]&&i[o]){o++}return o===0?null:i[o-1]}isBefore(e){if(this==e){return false}if(this.root!==e.root){return false}const t=this.getPath();const i=e.getPath();const n=Os(t,i);switch(n){case\"prefix\":return true;case\"extension\":return false;default:return t[n]{e[t[0]]=t[1];return e},{})}return e}is(e){return e==\"node\"||e==\"model:node\"}_clone(){return new jh(this._attrs)}_remove(){this.parent._removeChildren(this.index)}_setAttribute(e,t){this._attrs.set(e,t)}_setAttributesTo(e){this._attrs=Hs(e)}_removeAttribute(e){return this._attrs.delete(e)}_clearAttributes(){this._attrs.clear()}}class Dh extends jh{constructor(e,t){super(t);this._data=e||\"\"}get offsetSize(){return this.data.length}get data(){return this._data}is(e){return e==\"text\"||e==\"model:text\"||super.is(e)}toJSON(){const e=super.toJSON();e.data=this.data;return e}_clone(){return new Dh(this.data,this.getAttributes())}static fromJSON(e){return new Dh(e.data,e.attributes)}}class Bh{constructor(e,t,i){this.textNode=e;if(t<0||t>e.offsetSize){throw new ss[\"b\"](\"model-textproxy-wrong-offsetintext: Given offsetInText value is incorrect.\",this)}if(i<0||t+i>e.offsetSize){throw new ss[\"b\"](\"model-textproxy-wrong-length: Given length value is incorrect.\",this)}this.data=e.data.substring(t,t+i);this.offsetInText=t}get startOffset(){return this.textNode.startOffset!==null?this.textNode.startOffset+this.offsetInText:null}get offsetSize(){return this.data.length}get endOffset(){return this.startOffset!==null?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(e){return e==\"textProxy\"||e==\"model:textProxy\"}getPath(){const e=this.textNode.getPath();if(e.length>0){e[e.length-1]+=this.offsetInText}return e}getAncestors(e={includeSelf:false,parentFirst:false}){const t=[];let i=e.includeSelf?this:this.parent;while(i){t[e.parentFirst?\"push\":\"unshift\"](i);i=i.parent}return t}hasAttribute(e){return this.textNode.hasAttribute(e)}getAttribute(e){return this.textNode.getAttribute(e)}getAttributes(){return this.textNode.getAttributes()}getAttributeKeys(){return this.textNode.getAttributeKeys()}}class Vh{constructor(e){this._nodes=[];if(e){this._insertNodes(0,e)}}[Symbol.iterator](){return this._nodes[Symbol.iterator]()}get length(){return this._nodes.length}get maxOffset(){return this._nodes.reduce((e,t)=>e+t.offsetSize,0)}getNode(e){return this._nodes[e]||null}getNodeIndex(e){const t=this._nodes.indexOf(e);return t==-1?null:t}getNodeStartOffset(e){const t=this.getNodeIndex(e);return t===null?null:this._nodes.slice(0,t).reduce((e,t)=>e+t.offsetSize,0)}indexToOffset(e){if(e==this._nodes.length){return this.maxOffset}const t=this._nodes[e];if(!t){throw new ss[\"b\"](\"model-nodelist-index-out-of-bounds: Given index cannot be found in the node list.\",this)}return this.getNodeStartOffset(t)}offsetToIndex(e){let t=0;for(const i of this._nodes){if(e>=t&&ee.toJSON())}}class Fh extends jh{constructor(e,t,i){super(t);this.name=e;this._children=new Vh;if(i){this._insertChild(0,i)}}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return this.childCount===0}is(e,t=null){const i=e.replace(/^model:/,\"\");if(!t){return i==\"element\"||i==this.name||super.is(e)}else{return i==\"element\"&&t==this.name}}getChild(e){return this._children.getNode(e)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(e){return this._children.getNodeIndex(e)}getChildStartOffset(e){return this._children.getNodeStartOffset(e)}offsetToIndex(e){return this._children.offsetToIndex(e)}getNodeByPath(e){let t=this;for(const i of e){t=t.getChild(t.offsetToIndex(i))}return t}toJSON(){const e=super.toJSON();e.name=this.name;if(this._children.length>0){e.children=[];for(const t of this._children){e.children.push(t.toJSON())}}return e}_clone(e=false){const t=e?Array.from(this._children).map(e=>e._clone(true)):null;return new Fh(this.name,this.getAttributes(),t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const i=Hh(t);for(const e of i){if(e.parent!==null){e._remove()}e.parent=this}this._children._insertNodes(e,i)}_removeChildren(e,t=1){const i=this._children._removeNodes(e,t);for(const e of i){e.parent=null}return i}static fromJSON(e){let t=null;if(e.children){t=[];for(const i of e.children){if(i.name){t.push(Fh.fromJSON(i))}else{t.push(Dh.fromJSON(i))}}}return new Fh(e.name,e.attributes,t)}}function Hh(e){if(typeof e==\"string\"){return[new Dh(e)]}if(!Fs(e)){e=[e]}return Array.from(e).map(e=>{if(typeof e==\"string\"){return new Dh(e)}if(e instanceof Bh){return new Dh(e.data,e.getAttributes())}return e})}class Wh{constructor(e={}){if(!e.boundaries&&!e.startPosition){throw new ss[\"b\"](\"model-tree-walker-no-start-position: Neither boundaries nor starting position have been defined.\",null)}const t=e.direction||\"forward\";if(t!=\"forward\"&&t!=\"backward\"){throw new ss[\"b\"](\"model-tree-walker-unknown-direction: Only `backward` and `forward` direction allowed.\",e,{direction:t})}this.direction=t;this.boundaries=e.boundaries||null;if(e.startPosition){this.position=e.startPosition.clone()}else{this.position=$h._createAt(this.boundaries[this.direction==\"backward\"?\"end\":\"start\"])}this.position.stickiness=\"toNone\";this.singleCharacters=!!e.singleCharacters;this.shallow=!!e.shallow;this.ignoreElementEnd=!!e.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(e){let t,i,n,o;do{n=this.position;o=this._visitedParent;({done:t,value:i}=this.next())}while(!t&&e(i));if(!t){this.position=n;this._visitedParent=o}}next(){if(this.direction==\"forward\"){return this._next()}else{return this._previous()}}_next(){const e=this.position;const t=this.position.clone();const i=this._visitedParent;if(i.parent===null&&t.offset===i.maxOffset){return{done:true}}if(i===this._boundaryEndParent&&t.offset==this.boundaries.end.offset){return{done:true}}const n=t.textNode?t.textNode:t.nodeAfter;if(n instanceof Fh){if(!this.shallow){t.path.push(0);this._visitedParent=n}else{t.offset++}this.position=t;return Uh(\"elementStart\",n,e,t,1)}else if(n instanceof Dh){let o;if(this.singleCharacters){o=1}else{let e=n.endOffset;if(this._boundaryEndParent==i&&this.boundaries.end.offsete){e=this.boundaries.start.offset}o=t.offset-e}const r=t.offset-n.startOffset;const s=new Bh(n,r-o,o);t.offset-=o;this.position=t;return Uh(\"text\",s,e,t,o)}else{t.path.pop();this.position=t;this._visitedParent=i.parent;return Uh(\"elementStart\",i,e,t,1)}}}function Uh(e,t,i,n,o){return{done:false,value:{type:e,item:t,previousPosition:i,nextPosition:n,length:o}}}class $h{constructor(e,t,i=\"toNone\"){if(!e.is(\"element\")&&!e.is(\"documentFragment\")){throw new ss[\"b\"](\"model-position-root-invalid: Position root invalid.\",e)}if(!(t instanceof Array)||t.length===0){throw new ss[\"b\"](\"model-position-path-incorrect-format: Position path must be an array with at least one item.\",e,{path:t})}t=e.getPath().concat(t);e=e.root;this.root=e;this.path=t;this.stickiness=i}get offset(){return Aa(this.path)}set offset(e){this.path[this.path.length-1]=e}get parent(){let e=this.root;for(let t=0;ti.path.length){if(t.offset!==o.maxOffset){return false}t.path=t.path.slice(0,-1);o=o.parent;t.offset++}else{if(i.offset!==0){return false}i.path=i.path.slice(0,-1)}}}is(e){return e==\"position\"||e==\"model:position\"}hasSameParentAs(e){if(this.root!==e.root){return false}const t=this.getParentPath();const i=e.getParentPath();return Os(t,i)==\"same\"}getTransformedByOperation(e){let t;switch(e.type){case\"insert\":t=this._getTransformedByInsertOperation(e);break;case\"move\":case\"remove\":case\"reinsert\":t=this._getTransformedByMoveOperation(e);break;case\"split\":t=this._getTransformedBySplitOperation(e);break;case\"merge\":t=this._getTransformedByMergeOperation(e);break;default:t=$h._createAt(this);break}return t}_getTransformedByInsertOperation(e){return this._getTransformedByInsertion(e.position,e.howMany)}_getTransformedByMoveOperation(e){return this._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany)}_getTransformedBySplitOperation(e){const t=e.movedRange;const i=t.containsPosition(this)||t.start.isEqual(this)&&this.stickiness==\"toNext\";if(i){return this._getCombined(e.splitPosition,e.moveTargetPosition)}else{if(e.graveyardPosition){return this._getTransformedByMove(e.graveyardPosition,e.insertionPosition,1)}else{return this._getTransformedByInsertion(e.insertionPosition,1)}}}_getTransformedByMergeOperation(e){const t=e.movedRange;const i=t.containsPosition(this)||t.start.isEqual(this);let n;if(i){n=this._getCombined(e.sourcePosition,e.targetPosition);if(e.sourcePosition.isBefore(e.targetPosition)){n=n._getTransformedByDeletion(e.deletionPosition,1)}}else if(this.isEqual(e.deletionPosition)){n=$h._createAt(e.deletionPosition)}else{n=this._getTransformedByMove(e.deletionPosition,e.graveyardPosition,1)}return n}_getTransformedByDeletion(e,t){const i=$h._createAt(this);if(this.root!=e.root){return i}if(Os(e.getParentPath(),this.getParentPath())==\"same\"){if(e.offsetthis.offset){return null}else{i.offset-=t}}}else if(Os(e.getParentPath(),this.getParentPath())==\"prefix\"){const n=e.path.length-1;if(e.offset<=this.path[n]){if(e.offset+t>this.path[n]){return null}else{i.path[n]-=t}}}return i}_getTransformedByInsertion(e,t){const i=$h._createAt(this);if(this.root!=e.root){return i}if(Os(e.getParentPath(),this.getParentPath())==\"same\"){if(e.offsett+1){const t=n.maxOffset-i.offset;if(t!==0){e.push(new qh(i,i.getShiftedBy(t)))}i.path=i.path.slice(0,-1);i.offset++;n=n.parent}while(i.path.length<=this.end.path.length){const t=this.end.path[i.path.length-1];const n=t-i.offset;if(n!==0){e.push(new qh(i,i.getShiftedBy(n)))}i.offset=t;i.path.push(0)}return e}getWalker(e={}){e.boundaries=this;return new Wh(e)}*getItems(e={}){e.boundaries=this;e.ignoreElementEnd=true;const t=new Wh(e);for(const e of t){yield e.item}}*getPositions(e={}){e.boundaries=this;const t=new Wh(e);yield t.position;for(const e of t){yield e.nextPosition}}getTransformedByOperation(e){switch(e.type){case\"insert\":return this._getTransformedByInsertOperation(e);case\"move\":case\"remove\":case\"reinsert\":return this._getTransformedByMoveOperation(e);case\"split\":return[this._getTransformedBySplitOperation(e)];case\"merge\":return[this._getTransformedByMergeOperation(e)]}return[new qh(this.start,this.end)]}getTransformedByOperations(e){const t=[new qh(this.start,this.end)];for(const i of e){for(let e=0;e0?new this(i,n):new this(n,i)}static _createIn(e){return new this($h._createAt(e,0),$h._createAt(e,e.maxOffset))}static _createOn(e){return this._createFromPositionAndShift($h._createBefore(e),e.offsetSize)}static _createFromRanges(e){if(e.length===0){throw new ss[\"b\"](\"range-create-from-ranges-empty-array: At least one range has to be passed.\",null)}else if(e.length==1){return e[0].clone()}const t=e[0];e.sort((e,t)=>e.start.isAfter(t.start)?1:-1);const i=e.indexOf(t);const n=new this(t.start,t.end);if(i>0){for(let t=i-1;true;t++){if(e[t].end.isEqual(n.start)){n.start=$h._createAt(e[t].start)}else{break}}}for(let t=i+1;t{if(t.viewPosition){return}const i=this._modelToViewMapping.get(t.modelPosition.parent);t.viewPosition=this._findPositionIn(i,t.modelPosition.offset)},{priority:\"low\"});this.on(\"viewToModelPosition\",(e,t)=>{if(t.modelPosition){return}const i=this.findMappedViewAncestor(t.viewPosition);const n=this._viewToModelMapping.get(i);const o=this._toModelOffset(t.viewPosition.parent,t.viewPosition.offset,i);t.modelPosition=$h._createAt(n,o)},{priority:\"low\"})}bindElements(e,t){this._modelToViewMapping.set(e,t);this._viewToModelMapping.set(t,e)}unbindViewElement(e){const t=this.toModelElement(e);this._viewToModelMapping.delete(e);if(this._elementToMarkerNames.has(e)){for(const t of this._elementToMarkerNames.get(e)){this._unboundMarkerNames.add(t)}}if(this._modelToViewMapping.get(t)==e){this._modelToViewMapping.delete(t)}}unbindModelElement(e){const t=this.toViewElement(e);this._modelToViewMapping.delete(e);if(this._viewToModelMapping.get(t)==e){this._viewToModelMapping.delete(t)}}bindElementToMarker(e,t){const i=this._markerNameToElements.get(t)||new Set;i.add(e);const n=this._elementToMarkerNames.get(e)||new Set;n.add(t);this._markerNameToElements.set(t,i);this._elementToMarkerNames.set(e,n)}unbindElementFromMarkerName(e,t){const i=this._markerNameToElements.get(t);if(i){i.delete(e);if(i.size==0){this._markerNameToElements.delete(t)}}const n=this._elementToMarkerNames.get(e);if(n){n.delete(t);if(n.size==0){this._elementToMarkerNames.delete(e)}}}flushUnboundMarkerNames(){const e=Array.from(this._unboundMarkerNames);this._unboundMarkerNames.clear();return e}clearBindings(){this._modelToViewMapping=new WeakMap;this._viewToModelMapping=new WeakMap;this._markerNameToElements=new Map;this._elementToMarkerNames=new Map;this._unboundMarkerNames=new Set}toModelElement(e){return this._viewToModelMapping.get(e)}toViewElement(e){return this._modelToViewMapping.get(e)}toModelRange(e){return new qh(this.toModelPosition(e.start),this.toModelPosition(e.end))}toViewRange(e){return new ul(this.toViewPosition(e.start),this.toViewPosition(e.end))}toModelPosition(e){const t={viewPosition:e,mapper:this};this.fire(\"viewToModelPosition\",t);return t.modelPosition}toViewPosition(e,t={isPhantom:false}){const i={modelPosition:e,mapper:this,isPhantom:t.isPhantom};this.fire(\"modelToViewPosition\",i);return i.viewPosition}markerNameToElements(e){const t=this._markerNameToElements.get(e);if(!t){return null}const i=new Set;for(const e of t){if(e.is(\"attributeElement\")){for(const t of e.getElementsWithSameId()){i.add(t)}}else{i.add(e)}}return i}registerViewToModelLength(e,t){this._viewToModelLengthCallbacks.set(e,t)}findMappedViewAncestor(e){let t=e.parent;while(!this._viewToModelMapping.has(t)){t=t.parent}return t}_toModelOffset(e,t,i){if(i!=e){const n=this._toModelOffset(e.parent,e.index,i);const o=this._toModelOffset(e,t,e);return n+o}if(e.is(\"text\")){return t}let n=0;for(let i=0;i1?t[0]+\":\"+t[1]:t[0]}class Xh{constructor(e){this.conversionApi=Uc({dispatcher:this},e)}convertChanges(e,t,i){for(const t of e.getMarkersToRemove()){this.convertMarkerRemove(t.name,t.range,i)}for(const t of e.getChanges()){if(t.type==\"insert\"){this.convertInsert(qh._createFromPositionAndShift(t.position,t.length),i)}else if(t.type==\"remove\"){this.convertRemove(t.position,t.length,t.name,i)}else{this.convertAttribute(t.range,t.attributeKey,t.attributeOldValue,t.attributeNewValue,i)}}for(const e of this.conversionApi.mapper.flushUnboundMarkerNames()){const n=t.get(e).getRange();this.convertMarkerRemove(e,n,i);this.convertMarkerAdd(e,n,i)}for(const t of e.getMarkersToAdd()){this.convertMarkerAdd(t.name,t.range,i)}}convertInsert(e,t){this.conversionApi.writer=t;this.conversionApi.consumable=this._createInsertConsumable(e);for(const t of e){const e=t.item;const i=qh._createFromPositionAndShift(t.previousPosition,t.length);const n={item:e,range:i};this._testAndFire(\"insert\",n);for(const t of e.getAttributeKeys()){n.attributeKey=t;n.attributeOldValue=null;n.attributeNewValue=e.getAttribute(t);this._testAndFire(`attribute:${t}`,n)}}this._clearConversionApi()}convertRemove(e,t,i,n){this.conversionApi.writer=n;this.fire(\"remove:\"+i,{position:e,length:t},this.conversionApi);this._clearConversionApi()}convertAttribute(e,t,i,n,o){this.conversionApi.writer=o;this.conversionApi.consumable=this._createConsumableForRange(e,`attribute:${t}`);for(const o of e){const e=o.item;const r=qh._createFromPositionAndShift(o.previousPosition,o.length);const s={item:e,range:r,attributeKey:t,attributeOldValue:i,attributeNewValue:n};this._testAndFire(`attribute:${t}`,s)}this._clearConversionApi()}convertSelection(e,t,i){const n=Array.from(t.getMarkersAtPosition(e.getFirstPosition()));this.conversionApi.writer=i;this.conversionApi.consumable=this._createSelectionConsumable(e,n);this.fire(\"selection\",{selection:e},this.conversionApi);if(!e.isCollapsed){return}for(const t of n){const i=t.getRange();if(!Qh(e.getFirstPosition(),t,this.conversionApi.mapper)){continue}const n={item:e,markerName:t.name,markerRange:i};if(this.conversionApi.consumable.test(e,\"addMarker:\"+t.name)){this.fire(\"addMarker:\"+t.name,n,this.conversionApi)}}for(const t of e.getAttributeKeys()){const i={item:e,range:e.getFirstRange(),attributeKey:t,attributeOldValue:null,attributeNewValue:e.getAttribute(t)};if(this.conversionApi.consumable.test(e,\"attribute:\"+i.attributeKey)){this.fire(\"attribute:\"+i.attributeKey+\":$text\",i,this.conversionApi)}}this._clearConversionApi()}convertMarkerAdd(e,t,i){if(!t.root.document||t.root.rootName==\"$graveyard\"){return}this.conversionApi.writer=i;const n=\"addMarker:\"+e;const o=new Gh;o.add(t,n);this.conversionApi.consumable=o;this.fire(n,{markerName:e,markerRange:t},this.conversionApi);if(!o.test(t,n)){return}this.conversionApi.consumable=this._createConsumableForRange(t,n);for(const i of t.getItems()){if(!this.conversionApi.consumable.test(i,n)){continue}const o={item:i,range:qh._createOn(i),markerName:e,markerRange:t};this.fire(n,o,this.conversionApi)}this._clearConversionApi()}convertMarkerRemove(e,t,i){if(!t.root.document||t.root.rootName==\"$graveyard\"){return}this.conversionApi.writer=i;this.fire(\"removeMarker:\"+e,{markerName:e,markerRange:t},this.conversionApi);this._clearConversionApi()}_createInsertConsumable(e){const t=new Gh;for(const i of e){const e=i.item;t.add(e,\"insert\");for(const i of e.getAttributeKeys()){t.add(e,\"attribute:\"+i)}}return t}_createConsumableForRange(e,t){const i=new Gh;for(const n of e.getItems()){i.add(n,t)}return i}_createSelectionConsumable(e,t){const i=new Gh;i.add(e,\"selection\");for(const n of t){i.add(e,\"addMarker:\"+n.name)}for(const t of e.getAttributeKeys()){i.add(e,\"attribute:\"+t)}return i}_testAndFire(e,t){if(!this.conversionApi.consumable.test(t.item,e)){return}const i=t.item.name||\"$text\";this.fire(e+\":\"+i,t,this.conversionApi)}_clearConversionApi(){delete this.conversionApi.writer;delete this.conversionApi.consumable}}ks(Xh,ds);function Qh(e,t,i){const n=t.getRange();const o=Array.from(e.getAncestors());o.shift();o.reverse();const r=o.some(e=>{if(n.containsItem(e)){const t=i.toViewElement(e);return!!t.getCustomProperty(\"addHighlight\")}});return!r}class Kh{constructor(e,t,i){this._lastRangeBackward=false;this._ranges=[];this._attrs=new Map;if(e){this.setTo(e,t,i)}}get anchor(){if(this._ranges.length>0){const e=this._ranges[this._ranges.length-1];return this._lastRangeBackward?e.end:e.start}return null}get focus(){if(this._ranges.length>0){const e=this._ranges[this._ranges.length-1];return this._lastRangeBackward?e.start:e.end}return null}get isCollapsed(){const e=this._ranges.length;if(e===1){return this._ranges[0].isCollapsed}else{return false}}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}isEqual(e){if(this.rangeCount!=e.rangeCount){return false}else if(this.rangeCount===0){return true}if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus)){return false}for(const t of this._ranges){let i=false;for(const n of e._ranges){if(t.isEqual(n)){i=true;break}}if(!i){return false}}return true}*getRanges(){for(const e of this._ranges){yield new qh(e.start,e.end)}}getFirstRange(){let e=null;for(const t of this._ranges){if(!e||t.start.isBefore(e.start)){e=t}}return e?new qh(e.start,e.end):null}getLastRange(){let e=null;for(const t of this._ranges){if(!e||t.end.isAfter(e.end)){e=t}}return e?new qh(e.start,e.end):null}getFirstPosition(){const e=this.getFirstRange();return e?e.start.clone():null}getLastPosition(){const e=this.getLastRange();return e?e.end.clone():null}setTo(e,t,i){if(e===null){this._setRanges([])}else if(e instanceof Kh){this._setRanges(e.getRanges(),e.isBackward)}else if(e&&typeof e.getRanges==\"function\"){this._setRanges(e.getRanges(),e.isBackward)}else if(e instanceof qh){this._setRanges([e],!!t&&!!t.backward)}else if(e instanceof $h){this._setRanges([new qh(e)])}else if(e instanceof jh){const n=!!i&&!!i.backward;let o;if(t==\"in\"){o=qh._createIn(e)}else if(t==\"on\"){o=qh._createOn(e)}else if(t!==undefined){o=new qh($h._createAt(e,t))}else{throw new ss[\"b\"](\"model-selection-setTo-required-second-parameter: \"+\"selection.setTo requires the second parameter when the first parameter is a node.\",[this,e])}this._setRanges([o],n)}else if(Fs(e)){this._setRanges(e,t&&!!t.backward)}else{throw new ss[\"b\"](\"model-selection-setTo-not-selectable: Cannot set the selection to the given place.\",[this,e])}}_setRanges(e,t=false){e=Array.from(e);const i=e.some(t=>{if(!(t instanceof qh)){throw new ss[\"b\"](\"model-selection-set-ranges-not-range: \"+\"Selection range set to an object that is not an instance of model.Range.\",[this,e])}return this._ranges.every(e=>!e.isEqual(t))});if(e.length===this._ranges.length&&!i){return}this._removeAllRanges();for(const t of e){this._pushRange(t)}this._lastRangeBackward=!!t;this.fire(\"change:range\",{directChange:true})}setFocus(e,t){if(this.anchor===null){throw new ss[\"b\"](\"model-selection-setFocus-no-ranges: Cannot set selection focus if there are no ranges in selection.\",[this,e])}const i=$h._createAt(e,t);if(i.compareWith(this.focus)==\"same\"){return}const n=this.anchor;if(this._ranges.length){this._popRange()}if(i.compareWith(n)==\"before\"){this._pushRange(new qh(i,n));this._lastRangeBackward=true}else{this._pushRange(new qh(n,i));this._lastRangeBackward=false}this.fire(\"change:range\",{directChange:true})}getAttribute(e){return this._attrs.get(e)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}hasAttribute(e){return this._attrs.has(e)}removeAttribute(e){if(this.hasAttribute(e)){this._attrs.delete(e);this.fire(\"change:attribute\",{attributeKeys:[e],directChange:true})}}setAttribute(e,t){if(this.getAttribute(e)!==t){this._attrs.set(e,t);this.fire(\"change:attribute\",{attributeKeys:[e],directChange:true})}}getSelectedElement(){if(this.rangeCount!==1){return null}return this.getFirstRange().getContainedElement()}is(e){return e==\"selection\"||e==\"model:selection\"}*getSelectedBlocks(){const e=new WeakSet;for(const t of this.getRanges()){const i=tf(t.start,e);if(i&&nf(i,t)){yield i}for(const i of t.getWalker()){const n=i.item;if(i.type==\"elementEnd\"&&ef(n,e,t)){yield n}}const n=tf(t.end,e);if(n&&!t.end.isTouching($h._createAt(n,0))&&nf(n,t)){yield n}}}containsEntireContent(e=this.anchor.root){const t=$h._createAt(e,0);const i=$h._createAt(e,\"end\");return t.isTouching(this.getFirstPosition())&&i.isTouching(this.getLastPosition())}_pushRange(e){this._checkRange(e);this._ranges.push(new qh(e.start,e.end))}_checkRange(e){for(let t=0;t0){this._popRange()}}_popRange(){this._ranges.pop()}}ks(Kh,ds);function Zh(e,t){if(t.has(e)){return false}t.add(e);return e.root.document.model.schema.isBlock(e)&&e.parent}function ef(e,t,i){return Zh(e,t)&&nf(e,i)}function tf(e,t){const i=e.parent;const n=i.root.document.model.schema;const o=e.parent.getAncestors({parentFirst:true,includeSelf:true});let r=false;const s=o.find(e=>{if(r){return false}r=n.isLimit(e);return!r&&Zh(e,t)});o.forEach(e=>t.add(e));return s}function nf(e,t){const i=of(e);if(!i){return true}const n=t.containsRange(qh._createOn(i),true);return!n}function of(e){const t=e.root.document.model.schema;let i=e.parent;while(i){if(t.isBlock(i)){return i}i=i.parent}}class rf extends qh{constructor(e,t){super(e,t);sf.call(this)}detach(){this.stopListening()}is(e){return e==\"liveRange\"||e==\"model:liveRange\"||super.is(e)}toRange(){return new qh(this.start,this.end)}static fromRange(e){return new rf(e.start,e.end)}}function sf(){this.listenTo(this.root.document.model,\"applyOperation\",(e,t)=>{const i=t[0];if(!i.isDocumentOperation){return}af.call(this,i)},{priority:\"low\"})}function af(e){const t=this.getTransformedByOperation(e);const i=qh._createFromRanges(t);const n=!i.isEqual(this);const o=cf(this,e);let r=null;if(n){if(i.root.rootName==\"$graveyard\"){if(e.type==\"remove\"){r=e.sourcePosition}else{r=e.deletionPosition}}const t=this.toRange();this.start=i.start;this.end=i.end;this.fire(\"change:range\",t,{deletionPosition:r})}else if(o){this.fire(\"change:content\",this.toRange(),{deletionPosition:r})}}function cf(e,t){switch(t.type){case\"insert\":return e.containsPosition(t.position);case\"move\":case\"remove\":case\"reinsert\":case\"merge\":return e.containsPosition(t.sourcePosition)||e.start.isEqual(t.sourcePosition)||e.containsPosition(t.targetPosition);case\"split\":return e.containsPosition(t.splitPosition)||e.containsPosition(t.insertionPosition)}return false}ks(rf,ds);const lf=\"selection:\";class df{constructor(e){this._selection=new uf(e);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(e){return this._selection.containsEntireContent(e)}destroy(){this._selection.destroy()}getAttributeKeys(){return this._selection.getAttributeKeys()}getAttributes(){return this._selection.getAttributes()}getAttribute(e){return this._selection.getAttribute(e)}hasAttribute(e){return this._selection.hasAttribute(e)}refresh(){this._selection._updateMarkers();this._selection._updateAttributes(false)}is(e){return e==\"selection\"||e==\"model:selection\"||e==\"documentSelection\"||e==\"model:documentSelection\"}_setFocus(e,t){this._selection.setFocus(e,t)}_setTo(e,t,i){this._selection.setTo(e,t,i)}_setAttribute(e,t){this._selection.setAttribute(e,t)}_removeAttribute(e){this._selection.removeAttribute(e)}_getStoredAttributes(){return this._selection._getStoredAttributes()}_overrideGravity(){return this._selection.overrideGravity()}_restoreGravity(e){this._selection.restoreGravity(e)}static _getStoreAttributeKey(e){return lf+e}static _isStoreAttributeKey(e){return e.startsWith(lf)}}ks(df,ds);class uf extends Kh{constructor(e){super();this.markers=new ys({idProperty:\"name\"});this._model=e.model;this._document=e;this._attributePriority=new Map;this._fixGraveyardRangesData=[];this._hasChangedRange=false;this._overriddenGravityRegister=new Set;this.listenTo(this._model,\"applyOperation\",(e,t)=>{const i=t[0];if(!i.isDocumentOperation||i.type==\"marker\"||i.type==\"rename\"||i.type==\"noop\"){return}while(this._fixGraveyardRangesData.length){const{liveRange:e,sourcePosition:t}=this._fixGraveyardRangesData.shift();this._fixGraveyardSelection(e,t)}if(this._hasChangedRange){this._hasChangedRange=false;this.fire(\"change:range\",{directChange:false})}},{priority:\"lowest\"});this.on(\"change:range\",()=>{for(const e of this.getRanges()){if(!this._document._validateSelectionRange(e)){throw new ss[\"b\"](\"document-selection-wrong-position: Range from document selection starts or ends at incorrect position.\",this,{range:e})}}});this.listenTo(this._model.markers,\"update\",()=>this._updateMarkers());this.listenTo(this._document,\"change\",(e,t)=>{ff(this._model,t)})}get isCollapsed(){const e=this._ranges.length;return e===0?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 e=0;e{this._hasChangedRange=true;if(t.root==this._document.graveyard){this._fixGraveyardRangesData.push({liveRange:t,sourcePosition:n.deletionPosition})}});return t}_updateMarkers(){const e=[];let t=false;for(const t of this._model.markers){const i=t.getRange();for(const n of this.getRanges()){if(i.containsRange(n,!n.isCollapsed)){e.push(t)}}}const i=Array.from(this.markers);for(const i of e){if(!this.markers.has(i)){this.markers.add(i);t=true}}for(const i of Array.from(this.markers)){if(!e.includes(i)){this.markers.remove(i);t=true}}if(t){this.fire(\"change:marker\",{oldMarkers:i,directChange:false})}}_updateAttributes(e){const t=Hs(this._getSurroundingAttributes());const i=Hs(this.getAttributes());if(e){this._attributePriority=new Map;this._attrs=new Map}else{for(const[e,t]of this._attributePriority){if(t==\"low\"){this._attrs.delete(e);this._attributePriority.delete(e)}}}this._setAttributesTo(t);const n=[];for(const[e,t]of this.getAttributes()){if(!i.has(e)||i.get(e)!==t){n.push(e)}}for(const[e]of i){if(!this.hasAttribute(e)){n.push(e)}}if(n.length>0){this.fire(\"change:attribute\",{attributeKeys:n,directChange:false})}}_setAttribute(e,t,i=true){const n=i?\"normal\":\"low\";if(n==\"low\"&&this._attributePriority.get(e)==\"normal\"){return false}const o=super.getAttribute(e);if(o===t){return false}this._attrs.set(e,t);this._attributePriority.set(e,n);return true}_removeAttribute(e,t=true){const i=t?\"normal\":\"low\";if(i==\"low\"&&this._attributePriority.get(e)==\"normal\"){return false}this._attributePriority.set(e,i);if(!super.hasAttribute(e)){return false}this._attrs.delete(e);return true}_setAttributesTo(e){const t=new Set;for(const[t,i]of this.getAttributes()){if(e.get(t)===i){continue}this._removeAttribute(t,false)}for(const[i,n]of e){const e=this._setAttribute(i,n,false);if(e){t.add(i)}}return t}*_getStoredAttributes(){const e=this.getFirstPosition().parent;if(this.isCollapsed&&e.isEmpty){for(const t of e.getAttributeKeys()){if(t.startsWith(lf)){const i=t.substr(lf.length);yield[i,e.getAttribute(t)]}}}}_getSurroundingAttributes(){const e=this.getFirstPosition();const t=this._model.schema;let i=null;if(!this.isCollapsed){const e=this.getFirstRange();for(const n of e){if(n.item.is(\"element\")&&t.isObject(n.item)){break}if(n.type==\"text\"){i=n.item.getAttributes();break}}}else{const t=e.textNode?e.textNode:e.nodeBefore;const n=e.textNode?e.textNode:e.nodeAfter;if(!this.isGravityOverridden){i=hf(t)}if(!i){i=hf(n)}if(!this.isGravityOverridden&&!i){let e=t;while(e&&!i){e=e.previousSibling;i=hf(e)}}if(!i){let e=n;while(e&&!i){e=e.nextSibling;i=hf(e)}}if(!i){i=this._getStoredAttributes()}}return i}_fixGraveyardSelection(e,t){const i=t.clone();const n=this._model.schema.getNearestSelectionRange(i);const o=this._ranges.indexOf(e);this._ranges.splice(o,1);e.detach();if(n){const e=this._prepareRange(n);this._ranges.splice(o,0,e)}}}function hf(e){if(e instanceof Bh||e instanceof Dh){return e.getAttributes()}return null}function ff(e,t){const i=e.document.differ;for(const n of i.getChanges()){if(n.type!=\"insert\"){continue}const i=n.position.parent;const o=n.length===i.maxOffset;if(o){e.enqueueChange(t,e=>{const t=Array.from(i.getAttributeKeys()).filter(e=>e.startsWith(lf));for(const n of t){e.removeAttribute(n,i)}})}}}class mf{constructor(e){this._dispatchers=e}add(e){for(const t of this._dispatchers){e(t)}return this}}var gf=1,pf=4;function bf(e){return Hr(e,gf|pf)}var wf=bf;class _f extends mf{elementToElement(e){return this.add(Lf(e))}attributeToElement(e){return this.add(Rf(e))}attributeToAttribute(e){return this.add(zf(e))}markerToElement(e){return this.add(jf(e))}markerToHighlight(e){return this.add(Df(e))}}function vf(){return(e,t,i)=>{if(!i.consumable.consume(t.item,\"insert\")){return}const n=i.writer;const o=i.mapper.toViewPosition(t.range.start);const r=n.createText(t.item.data);n.insert(o,r)}}function kf(){return(e,t,i)=>{const n=i.mapper.toViewPosition(t.position);const o=t.position.getShiftedBy(t.length);const r=i.mapper.toViewPosition(o,{isPhantom:true});const s=i.writer.createRange(n,r);const a=i.writer.remove(s.getTrimmed());for(const e of i.writer.createRangeIn(a).getItems()){i.mapper.unbindViewElement(e)}}}function yf(e,t){const i=e.createAttributeElement(\"span\",t.attributes);if(t.classes){i._addClass(t.classes)}if(t.priority){i._priority=t.priority}i._id=t.id;return i}function xf(){return(e,t,i)=>{const n=t.selection;if(n.isCollapsed){return}if(!i.consumable.consume(n,\"selection\")){return}const o=[];for(const e of n.getRanges()){const t=i.mapper.toViewRange(e);o.push(t)}i.writer.setSelection(o,{backward:n.isBackward})}}function Af(){return(e,t,i)=>{const n=t.selection;if(!n.isCollapsed){return}if(!i.consumable.consume(n,\"selection\")){return}const o=i.writer;const r=n.getFirstPosition();const s=i.mapper.toViewPosition(r);const a=o.breakAttributes(s);o.setSelection(a)}}function Cf(){return(e,t,i)=>{const n=i.writer;const o=n.document.selection;for(const e of o.getRanges()){if(e.isCollapsed){if(e.end.parent.isAttached()){i.writer.mergeAttributes(e.start)}}}n.setSelection(null)}}function Tf(e){return(t,i,n)=>{const o=e(i.attributeOldValue,n.writer);const r=e(i.attributeNewValue,n.writer);if(!o&&!r){return}if(!n.consumable.consume(i.item,t.name)){return}const s=n.writer;const a=s.document.selection;if(i.item instanceof Kh||i.item instanceof df){s.wrap(a.getFirstRange(),r)}else{let e=n.mapper.toViewRange(i.range);if(i.attributeOldValue!==null&&o){e=s.unwrap(e,o)}if(i.attributeNewValue!==null&&r){s.wrap(e,r)}}}}function Ef(e){return(t,i,n)=>{const o=e(i.item,n.writer);if(!o){return}if(!n.consumable.consume(i.item,\"insert\")){return}const r=n.mapper.toViewPosition(i.range.start);n.mapper.bindElements(i.item,o);n.writer.insert(r,o)}}function Mf(e){return(t,i,n)=>{i.isOpening=true;const o=e(i,n.writer);i.isOpening=false;const r=e(i,n.writer);if(!o||!r){return}const s=i.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;const c=n.writer;c.insert(a.toViewPosition(s.start),o);n.mapper.bindElementToMarker(o,i.markerName);if(!s.isCollapsed){c.insert(a.toViewPosition(s.end),r);n.mapper.bindElementToMarker(r,i.markerName)}t.stop()}}function Pf(){return(e,t,i)=>{const n=i.mapper.markerNameToElements(t.markerName);if(!n){return}for(const e of n){i.mapper.unbindElementFromMarkerName(e,t.markerName);i.writer.clear(i.writer.createRangeOn(e),e)}i.writer.clearClonedElementsGroup(t.markerName);e.stop()}}function Sf(e){return(t,i,n)=>{const o=e(i.attributeOldValue,i);const r=e(i.attributeNewValue,i);if(!o&&!r){return}if(!n.consumable.consume(i.item,t.name)){return}const s=n.mapper.toViewElement(i.item);const a=n.writer;if(!s){throw new ss[\"b\"](\"conversion-attribute-to-attribute-on-text: \"+\"Trying to convert text node's attribute with attribute-to-attribute converter.\",[i,n])}if(i.attributeOldValue!==null&&o){if(o.key==\"class\"){const e=Array.isArray(o.value)?o.value:[o.value];for(const t of e){a.removeClass(t,s)}}else if(o.key==\"style\"){const e=Object.keys(o.value);for(const t of e){a.removeStyle(t,s)}}else{a.removeAttribute(o.key,s)}}if(i.attributeNewValue!==null&&r){if(r.key==\"class\"){const e=Array.isArray(r.value)?r.value:[r.value];for(const t of e){a.addClass(t,s)}}else if(r.key==\"style\"){const e=Object.keys(r.value);for(const t of e){a.setStyle(t,r.value[t],s)}}else{a.setAttribute(r.key,r.value,s)}}}}function If(e){return(t,i,n)=>{if(!i.item){return}if(!(i.item instanceof Kh||i.item instanceof df)&&!i.item.is(\"textProxy\")){return}const o=Wf(e,i,n);if(!o){return}if(!n.consumable.consume(i.item,t.name)){return}const r=n.writer;const s=yf(r,o);const a=r.document.selection;if(i.item instanceof Kh||i.item instanceof df){r.wrap(a.getFirstRange(),s,a)}else{const e=n.mapper.toViewRange(i.range);const t=r.wrap(e,s);for(const e of t.getItems()){if(e.is(\"attributeElement\")&&e.isSimilar(s)){n.mapper.bindElementToMarker(e,i.markerName);break}}}}}function Nf(e){return(t,i,n)=>{if(!i.item){return}if(!(i.item instanceof Fh)){return}const o=Wf(e,i,n);if(!o){return}if(!n.consumable.test(i.item,t.name)){return}const r=n.mapper.toViewElement(i.item);if(r&&r.getCustomProperty(\"addHighlight\")){n.consumable.consume(i.item,t.name);for(const e of qh._createIn(i.item)){n.consumable.consume(e.item,t.name)}r.getCustomProperty(\"addHighlight\")(r,o,n.writer);n.mapper.bindElementToMarker(r,i.markerName)}}}function Of(e){return(t,i,n)=>{if(i.markerRange.isCollapsed){return}const o=Wf(e,i,n);if(!o){return}const r=yf(n.writer,o);const s=n.mapper.markerNameToElements(i.markerName);if(!s){return}for(const e of s){n.mapper.unbindElementFromMarkerName(e,i.markerName);if(e.is(\"attributeElement\")){n.writer.unwrap(n.writer.createRangeOn(e),r)}else{e.getCustomProperty(\"removeHighlight\")(e,o.id,n.writer)}}n.writer.clearClonedElementsGroup(i.markerName);t.stop()}}function Lf(e){e=wf(e);e.view=Bf(e.view,\"container\");return t=>{t.on(\"insert:\"+e.model,Ef(e.view),{priority:e.converterPriority||\"normal\"})}}function Rf(e){e=wf(e);const t=e.model.key?e.model.key:e.model;let i=\"attribute:\"+t;if(e.model.name){i+=\":\"+e.model.name}if(e.model.values){for(const t of e.model.values){e.view[t]=Bf(e.view[t],\"attribute\")}}else{e.view=Bf(e.view,\"attribute\")}const n=Ff(e);return t=>{t.on(i,Tf(n),{priority:e.converterPriority||\"normal\"})}}function zf(e){e=wf(e);const t=e.model.key?e.model.key:e.model;let i=\"attribute:\"+t;if(e.model.name){i+=\":\"+e.model.name}if(e.model.values){for(const t of e.model.values){e.view[t]=Hf(e.view[t])}}else{e.view=Hf(e.view)}const n=Ff(e);return t=>{t.on(i,Sf(n),{priority:e.converterPriority||\"normal\"})}}function jf(e){e=wf(e);e.view=Bf(e.view,\"ui\");return t=>{t.on(\"addMarker:\"+e.model,Mf(e.view),{priority:e.converterPriority||\"normal\"});t.on(\"removeMarker:\"+e.model,Pf(e.view),{priority:e.converterPriority||\"normal\"})}}function Df(e){return t=>{t.on(\"addMarker:\"+e.model,If(e.view),{priority:e.converterPriority||\"normal\"});t.on(\"addMarker:\"+e.model,Nf(e.view),{priority:e.converterPriority||\"normal\"});t.on(\"removeMarker:\"+e.model,Of(e.view),{priority:e.converterPriority||\"normal\"})}}function Bf(e,t){if(typeof e==\"function\"){return e}return(i,n)=>Vf(e,n,t)}function Vf(e,t,i){if(typeof e==\"string\"){e={name:e}}let n;const o=Object.assign({},e.attributes);if(i==\"container\"){n=t.createContainerElement(e.name,o)}else if(i==\"attribute\"){const i={priority:e.priority||wl.DEFAULT_PRIORITY};n=t.createAttributeElement(e.name,o,i)}else{n=t.createUIElement(e.name,o)}if(e.styles){const i=Object.keys(e.styles);for(const o of i){t.setStyle(o,e.styles[o],n)}}if(e.classes){const i=e.classes;if(typeof i==\"string\"){t.addClass(i,n)}else{for(const e of i){t.addClass(e,n)}}}return n}function Ff(e){if(e.model.values){return(t,i)=>{const n=e.view[t];if(n){return n(t,i)}return null}}else{return e.view}}function Hf(e){if(typeof e==\"string\"){return t=>({key:e,value:t})}else if(typeof e==\"object\"){if(e.value){return()=>e}else{return t=>({key:e.key,value:t})}}else{return e}}function Wf(e,t,i){const n=typeof e==\"function\"?e(t,i):e;if(!n){return null}if(!n.priority){n.priority=10}if(!n.id){n.id=t.markerName}return n}class Uf extends mf{elementToElement(e){return this.add(Gf(e))}elementToAttribute(e){return this.add(Jf(e))}attributeToAttribute(e){return this.add(Xf(e))}elementToMarker(e){return this.add(Qf(e))}}function $f(){return(e,t,i)=>{if(!t.modelRange&&i.consumable.consume(t.viewItem,{name:true})){const{modelRange:e,modelCursor:n}=i.convertChildren(t.viewItem,t.modelCursor);t.modelRange=e;t.modelCursor=n}}}function qf(){return(e,t,i)=>{if(i.schema.checkChild(t.modelCursor,\"$text\")){if(i.consumable.consume(t.viewItem)){const e=i.writer.createText(t.viewItem.data);i.writer.insert(e,t.modelCursor);t.modelRange=qh._createFromPositionAndShift(t.modelCursor,e.offsetSize);t.modelCursor=t.modelRange.end}}}}function Yf(e,t){return(i,n)=>{const o=n.newSelection;const r=new Kh;const s=[];for(const e of o.getRanges()){s.push(t.toModelRange(e))}r.setTo(s,{backward:o.isBackward});if(!r.isEqual(e.document.selection)){e.change(e=>{e.setSelection(r)})}}}function Gf(e){e=wf(e);const t=Zf(e);const i=Kf(e.view);const n=i?\"element:\"+i:\"element\";return i=>{i.on(n,t,{priority:e.converterPriority||\"normal\"})}}function Jf(e){e=wf(e);im(e);const t=nm(e,false);const i=Kf(e.view);const n=i?\"element:\"+i:\"element\";return i=>{i.on(n,t,{priority:e.converterPriority||\"low\"})}}function Xf(e){e=wf(e);let t=null;if(typeof e.view==\"string\"||e.view.key){t=tm(e)}im(e,t);const i=nm(e,true);return t=>{t.on(\"element\",i,{priority:e.converterPriority||\"low\"})}}function Qf(e){e=wf(e);sm(e);return Gf(e)}function Kf(e){if(typeof e==\"string\"){return e}if(typeof e==\"object\"&&typeof e.name==\"string\"){return e.name}return null}function Zf(e){const t=e.view?new Ws(e.view):null;return(i,n,o)=>{let r={};if(t){const e=t.match(n.viewItem);if(!e){return}r=e.match}r.name=true;const s=em(e.model,n.viewItem,o.writer);if(!s){return}if(!o.consumable.test(n.viewItem,r)){return}const a=o.splitToAllowedParent(s,n.modelCursor);if(!a){return}o.writer.insert(s,a.position);o.convertChildren(n.viewItem,o.writer.createPositionAt(s,0));o.consumable.consume(n.viewItem,r);const c=o.getSplitParts(s);n.modelRange=new qh(o.writer.createPositionBefore(s),o.writer.createPositionAfter(c[c.length-1]));if(a.cursorParent){n.modelCursor=o.writer.createPositionAt(a.cursorParent,0)}else{n.modelCursor=n.modelRange.end}}}function em(e,t,i){if(e instanceof Function){return e(t,i)}else{return i.createElement(e)}}function tm(e){if(typeof e.view==\"string\"){e.view={key:e.view}}const t=e.view.key;let i;if(t==\"class\"||t==\"style\"){const n=t==\"class\"?\"classes\":\"styles\";i={[n]:e.view.value}}else{const n=typeof e.view.value==\"undefined\"?/[\\s\\S]*/:e.view.value;i={attributes:{[t]:n}}}if(e.view.name){i.name=e.view.name}e.view=i;return t}function im(e,t=null){const i=t===null?true:e=>e.getAttribute(t);const n=typeof e.model!=\"object\"?e.model:e.model.key;const o=typeof e.model!=\"object\"||typeof e.model.value==\"undefined\"?i:e.model.value;e.model={key:n,value:o}}function nm(e,t){const i=new Ws(e.view);return(n,o,r)=>{const s=i.match(o.viewItem);if(!s){return}const a=e.model.key;const c=typeof e.model.value==\"function\"?e.model.value(o.viewItem):e.model.value;if(c===null){return}if(om(e.view,o.viewItem)){s.match.name=true}else{delete s.match.name}if(!r.consumable.test(o.viewItem,s.match)){return}if(!o.modelRange){o=Object.assign(o,r.convertChildren(o.viewItem,o.modelCursor))}const l=rm(o.modelRange,{key:a,value:c},t,r);if(l){r.consumable.consume(o.viewItem,s.match)}}}function om(e,t){const i=typeof e==\"function\"?e(t):e;if(typeof i==\"object\"&&!Kf(i)){return false}return!i.classes&&!i.attributes&&!i.styles}function rm(e,t,i,n){let o=false;for(const r of Array.from(e.getItems({shallow:i}))){if(n.schema.checkAttribute(r,t.key)){n.writer.setAttribute(t.key,t.value,r);o=true}}return o}function sm(e){const t=e.model;e.model=(e,i)=>{const n=typeof t==\"string\"?t:t(e);return i.createElement(\"$marker\",{\"data-name\":n})}}class am{constructor(e,t){this.model=e;this.view=new zh(t);this.mapper=new Yh;this.downcastDispatcher=new Xh({mapper:this.mapper});const i=this.model.document;const n=i.selection;const o=this.model.markers;this.listenTo(this.model,\"_beforeChanges\",()=>{this.view._disableRendering(true)},{priority:\"highest\"});this.listenTo(this.model,\"_afterChanges\",()=>{this.view._disableRendering(false)},{priority:\"lowest\"});this.listenTo(i,\"change\",()=>{this.view.change(e=>{this.downcastDispatcher.convertChanges(i.differ,o,e);this.downcastDispatcher.convertSelection(n,o,e)})},{priority:\"low\"});this.listenTo(this.view.document,\"selectionChange\",Yf(this.model,this.mapper));this.downcastDispatcher.on(\"insert:$text\",vf(),{priority:\"lowest\"});this.downcastDispatcher.on(\"remove\",kf(),{priority:\"low\"});this.downcastDispatcher.on(\"selection\",Cf(),{priority:\"low\"});this.downcastDispatcher.on(\"selection\",xf(),{priority:\"low\"});this.downcastDispatcher.on(\"selection\",Af(),{priority:\"low\"});this.view.document.roots.bindTo(this.model.document.roots).using(e=>{if(e.rootName==\"$graveyard\"){return null}const t=new cl(this.view.document,e.name);t.rootName=e.rootName;this.mapper.bindElements(e,t);return t})}destroy(){this.view.destroy();this.stopListening()}}ks(am,Jc);class cm{constructor(){this._commands=new Map}add(e,t){this._commands.set(e,t)}get(e){return this._commands.get(e)}execute(e,...t){const i=this.get(e);if(!i){throw new ss[\"b\"](\"commandcollection-command-not-found: Command does not exist.\",this,{commandName:e})}i.execute(...t)}*names(){yield*this._commands.keys()}*commands(){yield*this._commands.values()}[Symbol.iterator](){return this._commands[Symbol.iterator]()}destroy(){for(const e of this.commands()){e.destroy()}}}class lm{constructor(){this._consumables=new Map}add(e,t){let i;if(e.is(\"text\")||e.is(\"documentFragment\")){this._consumables.set(e,true);return}if(!this._consumables.has(e)){i=new dm(e);this._consumables.set(e,i)}else{i=this._consumables.get(e)}i.add(t)}test(e,t){const i=this._consumables.get(e);if(i===undefined){return null}if(e.is(\"text\")||e.is(\"documentFragment\")){return i}return i.test(t)}consume(e,t){if(this.test(e,t)){if(e.is(\"text\")||e.is(\"documentFragment\")){this._consumables.set(e,false)}else{this._consumables.get(e).consume(t)}return true}return false}revert(e,t){const i=this._consumables.get(e);if(i!==undefined){if(e.is(\"text\")||e.is(\"documentFragment\")){this._consumables.set(e,true)}else{i.revert(t)}}}static consumablesFromElement(e){const t={element:e,name:true,attributes:[],classes:[],styles:[]};const i=e.getAttributeKeys();for(const e of i){if(e==\"style\"||e==\"class\"){continue}t.attributes.push(e)}const n=e.getClassNames();for(const e of n){t.classes.push(e)}const o=e.getStyleNames();for(const e of o){t.styles.push(e)}return t}static createFrom(e,t){if(!t){t=new lm(e)}if(e.is(\"text\")){t.add(e);return t}if(e.is(\"element\")){t.add(e,lm.consumablesFromElement(e))}if(e.is(\"documentFragment\")){t.add(e)}for(const i of e.getChildren()){t=lm.createFrom(i,t)}return t}}class dm{constructor(e){this.element=e;this._canConsumeName=null;this._consumables={attributes:new Map,styles:new Map,classes:new Map}}add(e){if(e.name){this._canConsumeName=true}for(const t in this._consumables){if(t in e){this._add(t,e[t])}}}test(e){if(e.name&&!this._canConsumeName){return this._canConsumeName}for(const t in this._consumables){if(t in e){const i=this._test(t,e[t]);if(i!==true){return i}}}return true}consume(e){if(e.name){this._canConsumeName=false}for(const t in this._consumables){if(t in e){this._consume(t,e[t])}}}revert(e){if(e.name){this._canConsumeName=true}for(const t in this._consumables){if(t in e){this._revert(t,e[t])}}}_add(e,t){const i=Jt(t)?t:[t];const n=this._consumables[e];for(const t of i){if(e===\"attributes\"&&(t===\"class\"||t===\"style\")){throw new ss[\"b\"](\"viewconsumable-invalid-attribute: Classes and styles should be handled separately.\",this)}n.set(t,true);if(e===\"styles\"){for(const e of this.element.document.stylesProcessor.getRelatedStyles(t)){n.set(e,true)}}}}_test(e,t){const i=Jt(t)?t:[t];const n=this._consumables[e];for(const t of i){if(e===\"attributes\"&&(t===\"class\"||t===\"style\")){const e=t==\"class\"?\"classes\":\"styles\";const i=this._test(e,[...this._consumables[e].keys()]);if(i!==true){return i}}else{const e=n.get(t);if(e===undefined){return null}if(!e){return false}}}return true}_consume(e,t){const i=Jt(t)?t:[t];const n=this._consumables[e];for(const t of i){if(e===\"attributes\"&&(t===\"class\"||t===\"style\")){const e=t==\"class\"?\"classes\":\"styles\";this._consume(e,[...this._consumables[e].keys()])}else{n.set(t,false);if(e==\"styles\"){for(const e of this.element.document.stylesProcessor.getRelatedStyles(t)){n.set(e,false)}}}}}_revert(e,t){const i=Jt(t)?t:[t];const n=this._consumables[e];for(const t of i){if(e===\"attributes\"&&(t===\"class\"||t===\"style\")){const e=t==\"class\"?\"classes\":\"styles\";this._revert(e,[...this._consumables[e].keys()])}else{const e=n.get(t);if(e===false){n.set(t,true)}}}}}class um{constructor(){this._sourceDefinitions={};this._attributeProperties={};this.decorate(\"checkChild\");this.decorate(\"checkAttribute\");this.on(\"checkAttribute\",(e,t)=>{t[0]=new hm(t[0])},{priority:\"highest\"});this.on(\"checkChild\",(e,t)=>{t[0]=new hm(t[0]);t[1]=this.getDefinition(t[1])},{priority:\"highest\"})}register(e,t){if(this._sourceDefinitions[e]){throw new ss[\"b\"](\"schema-cannot-register-item-twice: A single item cannot be registered twice in the schema.\",this,{itemName:e})}this._sourceDefinitions[e]=[Object.assign({},t)];this._clearCache()}extend(e,t){if(!this._sourceDefinitions[e]){throw new ss[\"b\"](\"schema-cannot-extend-missing-item: Cannot extend an item which was not registered yet.\",this,{itemName:e})}this._sourceDefinitions[e].push(Object.assign({},t));this._clearCache()}getDefinitions(){if(!this._compiledDefinitions){this._compile()}return this._compiledDefinitions}getDefinition(e){let t;if(typeof e==\"string\"){t=e}else if(e.is&&(e.is(\"text\")||e.is(\"textProxy\"))){t=\"$text\"}else{t=e.name}return this.getDefinitions()[t]}isRegistered(e){return!!this.getDefinition(e)}isBlock(e){const t=this.getDefinition(e);return!!(t&&t.isBlock)}isLimit(e){const t=this.getDefinition(e);if(!t){return false}return!!(t.isLimit||t.isObject)}isObject(e){const t=this.getDefinition(e);return!!(t&&t.isObject)}isInline(e){const t=this.getDefinition(e);return!!(t&&t.isInline)}checkChild(e,t){if(!t){return false}return this._checkContextMatch(t,e)}checkAttribute(e,t){const i=this.getDefinition(e.last);if(!i){return false}return i.allowAttributes.includes(t)}checkMerge(e,t=null){if(e instanceof $h){const t=e.nodeBefore;const i=e.nodeAfter;if(!(t instanceof Fh)){throw new ss[\"b\"](\"schema-check-merge-no-element-before: The node before the merge position must be an element.\",this)}if(!(i instanceof Fh)){throw new ss[\"b\"](\"schema-check-merge-no-element-after: The node after the merge position must be an element.\",this)}return this.checkMerge(t,i)}for(const i of t.getChildren()){if(!this.checkChild(e,i)){return false}}return true}addChildCheck(e){this.on(\"checkChild\",(t,[i,n])=>{if(!n){return}const o=e(i,n);if(typeof o==\"boolean\"){t.stop();t.return=o}},{priority:\"high\"})}addAttributeCheck(e){this.on(\"checkAttribute\",(t,[i,n])=>{const o=e(i,n);if(typeof o==\"boolean\"){t.stop();t.return=o}},{priority:\"high\"})}setAttributeProperties(e,t){this._attributeProperties[e]=Object.assign(this.getAttributeProperties(e),t)}getAttributeProperties(e){return this._attributeProperties[e]||{}}getLimitElement(e){let t;if(e instanceof $h){t=e.parent}else{const i=e instanceof qh?[e]:Array.from(e.getRanges());t=i.reduce((e,t)=>{const i=t.getCommonAncestor();if(!e){return i}return e.getCommonAncestor(i,{includeSelf:true})},null)}while(!this.isLimit(t)){if(t.parent){t=t.parent}else{break}}return t}checkAttributeInSelection(e,t){if(e.isCollapsed){const i=e.getFirstPosition();const n=[...i.getAncestors(),new Dh(\"\",e.getAttributes())];return this.checkAttribute(n,t)}else{const i=e.getRanges();for(const e of i){for(const i of e){if(this.checkAttribute(i.item,t)){return true}}}}return false}*getValidRanges(e,t){e=Em(e);for(const i of e){yield*this._getValidRangesForRange(i,t)}}getNearestSelectionRange(e,t=\"both\"){if(this.checkChild(e,\"$text\")){return new qh(e)}let i,n;const o=e.getAncestors().reverse().find(e=>this.isLimit(e))||e.root;if(t==\"both\"||t==\"backward\"){i=new Wh({boundaries:qh._createIn(o),startPosition:e,direction:\"backward\"})}if(t==\"both\"||t==\"forward\"){n=new Wh({boundaries:qh._createIn(o),startPosition:e})}for(const e of Tm(i,n)){const t=e.walker==i?\"elementEnd\":\"elementStart\";const n=e.value;if(n.type==t&&this.isObject(n.item)){return qh._createOn(n.item)}if(this.checkChild(n.nextPosition,\"$text\")){return new qh(n.nextPosition)}}return null}findAllowedParent(e,t){let i=e.parent;while(i){if(this.checkChild(i,t)){return i}if(this.isLimit(i)){return null}i=i.parent}return null}removeDisallowedAttributes(e,t){for(const i of e){if(i.is(\"text\")){Mm(this,i,t)}else{const e=qh._createIn(i);const n=e.getPositions();for(const e of n){const i=e.nodeBefore||e.parent;Mm(this,i,t)}}}}createContext(e){return new hm(e)}_clearCache(){this._compiledDefinitions=null}_compile(){const e={};const t=this._sourceDefinitions;const i=Object.keys(t);for(const n of i){e[n]=fm(t[n],n)}for(const t of i){mm(e,t)}for(const t of i){gm(e,t)}for(const t of i){pm(e,t);bm(e,t)}for(const t of i){wm(e,t);_m(e,t)}this._compiledDefinitions=e}_checkContextMatch(e,t,i=t.length-1){const n=t.getItem(i);if(e.allowIn.includes(n.name)){if(i==0){return true}else{const e=this.getDefinition(n);return this._checkContextMatch(e,t,i-1)}}else{return false}}*_getValidRangesForRange(e,t){let i=e.start;let n=e.start;for(const o of e.getItems({shallow:true})){if(o.is(\"element\")){yield*this._getValidRangesForRange(qh._createIn(o),t)}if(!this.checkAttribute(o,t)){if(!i.isEqual(n)){yield new qh(i,n)}i=$h._createAfter(o)}n=$h._createAfter(o)}if(!i.isEqual(n)){yield new qh(i,n)}}}ks(um,Jc);class hm{constructor(e){if(e instanceof hm){return e}if(typeof e==\"string\"){e=[e]}else if(!Array.isArray(e)){e=e.getAncestors({includeSelf:true})}if(e[0]&&typeof e[0]!=\"string\"&&e[0].is(\"documentFragment\")){e.shift()}this._items=e.map(Cm)}get length(){return this._items.length}get last(){return this._items[this._items.length-1]}[Symbol.iterator](){return this._items[Symbol.iterator]()}push(e){const t=new hm([e]);t._items=[...this._items,...t._items];return t}getItem(e){return this._items[e]}*getNames(){yield*this._items.map(e=>e.name)}endsWith(e){return Array.from(this.getNames()).join(\" \").endsWith(e)}startsWith(e){return Array.from(this.getNames()).join(\" \").startsWith(e)}}function fm(e,t){const i={name:t,allowIn:[],allowContentOf:[],allowWhere:[],allowAttributes:[],allowAttributesOf:[],inheritTypesFrom:[]};vm(e,i);km(e,i,\"allowIn\");km(e,i,\"allowContentOf\");km(e,i,\"allowWhere\");km(e,i,\"allowAttributes\");km(e,i,\"allowAttributesOf\");km(e,i,\"inheritTypesFrom\");ym(e,i);return i}function mm(e,t){for(const i of e[t].allowContentOf){if(e[i]){const n=xm(e,i);n.forEach(e=>{e.allowIn.push(t)})}}delete e[t].allowContentOf}function gm(e,t){for(const i of e[t].allowWhere){const n=e[i];if(n){const i=n.allowIn;e[t].allowIn.push(...i)}}delete e[t].allowWhere}function pm(e,t){for(const i of e[t].allowAttributesOf){const n=e[i];if(n){const i=n.allowAttributes;e[t].allowAttributes.push(...i)}}delete e[t].allowAttributesOf}function bm(e,t){const i=e[t];for(const t of i.inheritTypesFrom){const n=e[t];if(n){const e=Object.keys(n).filter(e=>e.startsWith(\"is\"));for(const t of e){if(!(t in i)){i[t]=n[t]}}}}delete i.inheritTypesFrom}function wm(e,t){const i=e[t];const n=i.allowIn.filter(t=>e[t]);i.allowIn=Array.from(new Set(n))}function _m(e,t){const i=e[t];i.allowAttributes=Array.from(new Set(i.allowAttributes))}function vm(e,t){for(const i of e){const e=Object.keys(i).filter(e=>e.startsWith(\"is\"));for(const n of e){t[n]=i[n]}}}function km(e,t,i){for(const n of e){if(typeof n[i]==\"string\"){t[i].push(n[i])}else if(Array.isArray(n[i])){t[i].push(...n[i])}}}function ym(e,t){for(const i of e){const e=i.inheritAllFrom;if(e){t.allowContentOf.push(e);t.allowWhere.push(e);t.allowAttributesOf.push(e);t.inheritTypesFrom.push(e)}}}function xm(e,t){const i=e[t];return Am(e).filter(e=>e.allowIn.includes(i.name))}function Am(e){return Object.keys(e).map(t=>e[t])}function Cm(e){if(typeof e==\"string\"){return{name:e,*getAttributeKeys(){},getAttribute(){}}}else{return{name:e.is(\"element\")?e.name:\"$text\",*getAttributeKeys(){yield*e.getAttributeKeys()},getAttribute(t){return e.getAttribute(t)}}}}function*Tm(e,t){let i=false;while(!i){i=true;if(e){const t=e.next();if(!t.done){i=false;yield{walker:e,value:t.value}}}if(t){const e=t.next();if(!e.done){i=false;yield{walker:t,value:e.value}}}}}function*Em(e){for(const t of e){yield*t.getMinimalFlatRanges()}}function Mm(e,t,i){for(const n of t.getAttributeKeys()){if(!e.checkAttribute(t,n)){i.removeAttribute(n,t)}}}class Pm{constructor(e={}){this._splitParts=new Map;this._modelCursor=null;this.conversionApi=Object.assign({},e);this.conversionApi.convertItem=this._convertItem.bind(this);this.conversionApi.convertChildren=this._convertChildren.bind(this);this.conversionApi.splitToAllowedParent=this._splitToAllowedParent.bind(this);this.conversionApi.getSplitParts=this._getSplitParts.bind(this)}convert(e,t,i=[\"$root\"]){this.fire(\"viewCleanup\",e);this._modelCursor=Im(i,t);this.conversionApi.writer=t;this.conversionApi.consumable=lm.createFrom(e);this.conversionApi.store={};const{modelRange:n}=this._convertItem(e,this._modelCursor);const o=t.createDocumentFragment();if(n){this._removeEmptyElements();for(const e of Array.from(this._modelCursor.parent.getChildren())){t.append(e,o)}o.markers=Sm(o,t)}this._modelCursor=null;this._splitParts.clear();this.conversionApi.writer=null;this.conversionApi.store=null;return o}_convertItem(e,t){const i=Object.assign({viewItem:e,modelCursor:t,modelRange:null});if(e.is(\"element\")){this.fire(\"element:\"+e.name,i,this.conversionApi)}else if(e.is(\"text\")){this.fire(\"text\",i,this.conversionApi)}else{this.fire(\"documentFragment\",i,this.conversionApi)}if(i.modelRange&&!(i.modelRange instanceof qh)){throw new ss[\"b\"](\"view-conversion-dispatcher-incorrect-result: Incorrect conversion result was dropped.\",this)}return{modelRange:i.modelRange,modelCursor:i.modelCursor}}_convertChildren(e,t){const i=new qh(t);let n=t;for(const t of Array.from(e.getChildren())){const e=this._convertItem(t,n);if(e.modelRange instanceof qh){i.end=e.modelRange.end;n=e.modelCursor}}return{modelRange:i,modelCursor:n}}_splitToAllowedParent(e,t){const i=this.conversionApi.schema.findAllowedParent(t,e);if(!i){return null}if(i===t.parent){return{position:t}}if(this._modelCursor.parent.getAncestors().includes(i)){return null}const n=this.conversionApi.writer.split(t,i);const o=[];for(const e of n.range.getWalker()){if(e.type==\"elementEnd\"){o.push(e.item)}else{const t=o.pop();const i=e.item;this._registerSplitPair(t,i)}}return{position:n.position,cursorParent:n.range.end.parent}}_registerSplitPair(e,t){if(!this._splitParts.has(e)){this._splitParts.set(e,[e])}const i=this._splitParts.get(e);this._splitParts.set(t,i);i.push(t)}_getSplitParts(e){let t;if(!this._splitParts.has(e)){t=[e]}else{t=this._splitParts.get(e)}return t}_removeEmptyElements(){let e=false;for(const t of this._splitParts.keys()){if(t.isEmpty){this.conversionApi.writer.remove(t);this._splitParts.delete(t);e=true}}if(e){this._removeEmptyElements()}}}ks(Pm,ds);function Sm(e,t){const i=new Set;const n=new Map;const o=qh._createIn(e).getItems();for(const e of o){if(e.name==\"$marker\"){i.add(e)}}for(const e of i){const i=e.getAttribute(\"data-name\");const o=t.createPositionBefore(e);if(!n.has(i)){n.set(i,new qh(o.clone()))}else{n.get(i).end=o.clone()}t.remove(e)}return n}function Im(e,t){let i;for(const n of new hm(e)){const e={};for(const t of n.getAttributeKeys()){e[t]=n.getAttribute(t)}const o=t.createElement(n.name,e);if(i){t.append(o,i)}i=$h._createAt(o,0)}return i}class Nm{constructor(e,t){this.model=e;this.stylesProcessor=t;this.processor;this.mapper=new Yh;this.downcastDispatcher=new Xh({mapper:this.mapper});this.downcastDispatcher.on(\"insert:$text\",vf(),{priority:\"lowest\"});this.upcastDispatcher=new Pm({schema:e.schema});this.viewDocument=new pl(t);this._viewWriter=new ql(this.viewDocument);this.upcastDispatcher.on(\"text\",qf(),{priority:\"lowest\"});this.upcastDispatcher.on(\"element\",$f(),{priority:\"lowest\"});this.upcastDispatcher.on(\"documentFragment\",$f(),{priority:\"lowest\"});this.decorate(\"init\");this.on(\"init\",()=>{this.fire(\"ready\")},{priority:\"lowest\"})}get(e){const{rootName:t=\"main\",trim:i=\"empty\"}=e||{};if(!this._checkIfRootsExists([t])){throw new ss[\"b\"](\"datacontroller-get-non-existent-root: Attempting to get data from a non-existing root.\",this)}const n=this.model.document.getRoot(t);if(i===\"empty\"&&!this.model.hasContent(n,{ignoreWhitespaces:true})){return\"\"}return this.stringify(n)}stringify(e){const t=this.toView(e);return this.processor.toData(t)}toView(e){const t=this.viewDocument;const i=this._viewWriter;this.mapper.clearBindings();const n=qh._createIn(e);const o=new Ul(t);this.mapper.bindElements(e,o);this.downcastDispatcher.convertInsert(n,i);if(!e.is(\"documentFragment\")){const t=Om(e);for(const[e,n]of t){this.downcastDispatcher.convertMarkerAdd(e,n,i)}}return o}init(e){if(this.model.document.version){throw new ss[\"b\"](\"datacontroller-init-document-not-empty: Trying to set initial data to not empty document.\",this)}let t={};if(typeof e===\"string\"){t.main=e}else{t=e}if(!this._checkIfRootsExists(Object.keys(t))){throw new ss[\"b\"](\"datacontroller-init-non-existent-root: Attempting to init data on a non-existing root.\",this)}this.model.enqueueChange(\"transparent\",e=>{for(const i of Object.keys(t)){const n=this.model.document.getRoot(i);e.insert(this.parse(t[i],n),n,0)}});return Promise.resolve()}set(e){let t={};if(typeof e===\"string\"){t.main=e}else{t=e}if(!this._checkIfRootsExists(Object.keys(t))){throw new ss[\"b\"](\"datacontroller-set-non-existent-root: Attempting to set data on a non-existing root.\",this)}this.model.enqueueChange(\"transparent\",e=>{e.setSelection(null);e.removeSelectionAttribute(this.model.document.selection.getAttributeKeys());for(const i of Object.keys(t)){const n=this.model.document.getRoot(i);e.remove(e.createRangeIn(n));e.insert(this.parse(t[i],n),n,0)}})}parse(e,t=\"$root\"){const i=this.processor.toView(e);return this.toModel(i,t)}toModel(e,t=\"$root\"){return this.model.change(i=>this.upcastDispatcher.convert(e,i,t))}addStyleProcessorRules(e){e(this.stylesProcessor)}destroy(){this.stopListening()}_checkIfRootsExists(e){for(const t of e){if(!this.model.document.getRootNames().includes(t)){return false}}return true}}ks(Nm,Jc);function Om(e){const t=[];const i=e.root.document;if(!i){return[]}const n=qh._createIn(e);for(const e of i.model.markers){const i=n.getIntersection(e.getRange());if(i){t.push([e.name,i])}}return t}class Lm{constructor(e,t){this._helpers=new Map;this._downcast=Array.isArray(e)?e:[e];this._createConversionHelpers({name:\"downcast\",dispatchers:this._downcast,isDowncast:true});this._upcast=Array.isArray(t)?t:[t];this._createConversionHelpers({name:\"upcast\",dispatchers:this._upcast,isDowncast:false})}addAlias(e,t){const i=this._downcast.includes(t);const n=this._upcast.includes(t);if(!n&&!i){throw new ss[\"b\"](\"conversion-add-alias-dispatcher-not-registered: \"+\"Trying to register and alias for a dispatcher that nas not been registered.\",this)}this._createConversionHelpers({name:e,dispatchers:[t],isDowncast:i})}for(e){if(!this._helpers.has(e)){throw new ss[\"b\"](\"conversion-for-unknown-group: Trying to add a converter to an unknown dispatchers group.\",this)}return this._helpers.get(e)}elementToElement(e){this.for(\"downcast\").elementToElement(e);for(const{model:t,view:i}of Rm(e)){this.for(\"upcast\").elementToElement({model:t,view:i,converterPriority:e.converterPriority})}}attributeToElement(e){this.for(\"downcast\").attributeToElement(e);for(const{model:t,view:i}of Rm(e)){this.for(\"upcast\").elementToAttribute({view:i,model:t,converterPriority:e.converterPriority})}}attributeToAttribute(e){this.for(\"downcast\").attributeToAttribute(e);for(const{model:t,view:i}of Rm(e)){this.for(\"upcast\").attributeToAttribute({view:i,model:t})}}_createConversionHelpers({name:e,dispatchers:t,isDowncast:i}){if(this._helpers.has(e)){throw new ss[\"b\"](\"conversion-group-exists: Trying to register a group name that has already been registered.\",this)}const n=i?new _f(t):new Uf(t);this._helpers.set(e,n)}}function*Rm(e){if(e.model.values){for(const t of e.model.values){const i={key:e.model.key,value:t};const n=e.view[t];const o=e.upcastAlso?e.upcastAlso[t]:undefined;yield*zm(i,n,o)}}else{yield*zm(e.model,e.view,e.upcastAlso)}}function*zm(e,t,i){yield{model:e,view:t};if(i){i=Array.isArray(i)?i:[i];for(const t of i){yield{model:e,view:t}}}}class jm{constructor(e=\"default\"){this.operations=[];this.type=e}get baseVersion(){for(const e of this.operations){if(e.baseVersion!==null){return e.baseVersion}}return null}addOperation(e){e.batch=this;this.operations.push(e);return e}}class Dm{constructor(e){this.baseVersion=e;this.isDocumentOperation=this.baseVersion!==null;this.batch=null}_validate(){}toJSON(){const e=Object.assign({},this);e.__className=this.constructor.className;delete e.batch;delete e.isDocumentOperation;return e}static get className(){return\"Operation\"}static fromJSON(e){return new this(e.baseVersion)}}class Bm{constructor(e){this.markers=new Map;this._children=new Vh;if(e){this._insertChild(0,e)}}[Symbol.iterator](){return this.getChildren()}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return this.childCount===0}get root(){return this}get parent(){return null}is(e){return e==\"documentFragment\"||e==\"model:documentFragment\"}getChild(e){return this._children.getNode(e)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(e){return this._children.getNodeIndex(e)}getChildStartOffset(e){return this._children.getNodeStartOffset(e)}getPath(){return[]}getNodeByPath(e){let t=this;for(const i of e){t=t.getChild(t.offsetToIndex(i))}return t}offsetToIndex(e){return this._children.offsetToIndex(e)}toJSON(){const e=[];for(const t of this._children){e.push(t.toJSON())}return e}static fromJSON(e){const t=[];for(const i of e){if(i.name){t.push(Fh.fromJSON(i))}else{t.push(Dh.fromJSON(i))}}return new Bm(t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const i=Vm(t);for(const e of i){if(e.parent!==null){e._remove()}e.parent=this}this._children._insertNodes(e,i)}_removeChildren(e,t=1){const i=this._children._removeNodes(e,t);for(const e of i){e.parent=null}return i}}function Vm(e){if(typeof e==\"string\"){return[new Dh(e)]}if(!Fs(e)){e=[e]}return Array.from(e).map(e=>{if(typeof e==\"string\"){return new Dh(e)}if(e instanceof Bh){return new Dh(e.data,e.getAttributes())}return e})}function Fm(e,t){t=$m(t);const i=t.reduce((e,t)=>e+t.offsetSize,0);const n=e.parent;Ym(e);const o=e.index;n._insertChild(o,t);qm(n,o+t.length);qm(n,o);return new qh(e,e.getShiftedBy(i))}function Hm(e){if(!e.isFlat){throw new ss[\"b\"](\"operation-utils-remove-range-not-flat: \"+\"Trying to remove a range which starts and ends in different element.\",this)}const t=e.start.parent;Ym(e.start);Ym(e.end);const i=t._removeChildren(e.start.index,e.end.index-e.start.index);qm(t,e.start.index);return i}function Wm(e,t){if(!e.isFlat){throw new ss[\"b\"](\"operation-utils-move-range-not-flat: \"+\"Trying to move a range which starts and ends in different element.\",this)}const i=Hm(e);t=t._getTransformedByDeletion(e.start,e.end.offset-e.start.offset);return Fm(t,i)}function Um(e,t,i){Ym(e.start);Ym(e.end);for(const n of e.getItems({shallow:true})){const e=n.is(\"textProxy\")?n.textNode:n;if(i!==null){e._setAttribute(t,i)}else{e._removeAttribute(t)}qm(e.parent,e.index)}qm(e.end.parent,e.end.index)}function $m(e){const t=[];if(!(e instanceof Array)){e=[e]}for(let i=0;ie.maxOffset){throw new ss[\"b\"](\"move-operation-nodes-do-not-exist: The nodes which should be moved do not exist.\",this)}else if(e===t&&i=i&&this.targetPosition.path[e]e._clone(true)));const t=new eg(this.position,e,this.baseVersion);t.shouldReceiveAttributes=this.shouldReceiveAttributes;return t}getReversed(){const e=this.position.root.document.graveyard;const t=new $h(e,[0]);return new Zm(this.position,this.nodes.maxOffset,t,this.baseVersion+1)}_validate(){const e=this.position.parent;if(!e||e.maxOffsete._clone(true)));Fm(this.position,e)}toJSON(){const e=super.toJSON();e.position=this.position.toJSON();e.nodes=this.nodes.toJSON();return e}static get className(){return\"InsertOperation\"}static fromJSON(e,t){const i=[];for(const t of e.nodes){if(t.name){i.push(Fh.fromJSON(t))}else{i.push(Dh.fromJSON(t))}}const n=new eg($h.fromJSON(e.position,t),i,e.baseVersion);n.shouldReceiveAttributes=e.shouldReceiveAttributes;return n}}class tg extends Dm{constructor(e,t,i,n,o,r){super(r);this.name=e;this.oldRange=t?t.clone():null;this.newRange=i?i.clone():null;this.affectsData=o;this._markers=n}get type(){return\"marker\"}clone(){return new tg(this.name,this.oldRange,this.newRange,this._markers,this.affectsData,this.baseVersion)}getReversed(){return new tg(this.name,this.newRange,this.oldRange,this._markers,this.affectsData,this.baseVersion+1)}_execute(){const e=this.newRange?\"_set\":\"_remove\";this._markers[e](this.name,this.newRange,true,this.affectsData)}toJSON(){const e=super.toJSON();if(this.oldRange){e.oldRange=this.oldRange.toJSON()}if(this.newRange){e.newRange=this.newRange.toJSON()}delete e._markers;return e}static get className(){return\"MarkerOperation\"}static fromJSON(e,t){return new tg(e.name,e.oldRange?qh.fromJSON(e.oldRange,t):null,e.newRange?qh.fromJSON(e.newRange,t):null,t.model.markers,e.affectsData,e.baseVersion)}}class ig extends Dm{constructor(e,t,i,n){super(n);this.position=e;this.position.stickiness=\"toNext\";this.oldName=t;this.newName=i}get type(){return\"rename\"}clone(){return new ig(this.position.clone(),this.oldName,this.newName,this.baseVersion)}getReversed(){return new ig(this.position.clone(),this.newName,this.oldName,this.baseVersion+1)}_validate(){const e=this.position.nodeAfter;if(!(e instanceof Fh)){throw new ss[\"b\"](\"rename-operation-wrong-position: Given position is invalid or node after it is not an instance of Element.\",this)}else if(e.name!==this.oldName){throw new ss[\"b\"](\"rename-operation-wrong-name: Element to change has different name than operation's old name.\",this)}}_execute(){const e=this.position.nodeAfter;e.name=this.newName}toJSON(){const e=super.toJSON();e.position=this.position.toJSON();return e}static get className(){return\"RenameOperation\"}static fromJSON(e,t){return new ig($h.fromJSON(e.position,t),e.oldName,e.newName,e.baseVersion)}}class ng extends Dm{constructor(e,t,i,n,o){super(o);this.root=e;this.key=t;this.oldValue=i;this.newValue=n}get type(){if(this.oldValue===null){return\"addRootAttribute\"}else if(this.newValue===null){return\"removeRootAttribute\"}else{return\"changeRootAttribute\"}}clone(){return new ng(this.root,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new ng(this.root,this.key,this.newValue,this.oldValue,this.baseVersion+1)}_validate(){if(this.root!=this.root.root||this.root.is(\"documentFragment\")){throw new ss[\"b\"](\"rootattribute-operation-not-a-root: The element to change is not a root element.\",this,{root:this.root,key:this.key})}if(this.oldValue!==null&&this.root.getAttribute(this.key)!==this.oldValue){throw new ss[\"b\"](\"rootattribute-operation-wrong-old-value: Changed node has different attribute value than operation's \"+\"old attribute value.\",this,{root:this.root,key:this.key})}if(this.oldValue===null&&this.newValue!==null&&this.root.hasAttribute(this.key)){throw new ss[\"b\"](\"rootattribute-operation-attribute-exists: The attribute with given key already exists.\",this,{root:this.root,key:this.key})}}_execute(){if(this.newValue!==null){this.root._setAttribute(this.key,this.newValue)}else{this.root._removeAttribute(this.key)}}toJSON(){const e=super.toJSON();e.root=this.root.toJSON();return e}static get className(){return\"RootAttributeOperation\"}static fromJSON(e,t){if(!t.getRoot(e.root)){throw new ss[\"b\"](\"rootattribute-operation-fromjson-no-root: Cannot create RootAttributeOperation. Root with specified name does not exist.\",this,{rootName:e.root})}return new ng(t.getRoot(e.root),e.key,e.oldValue,e.newValue,e.baseVersion)}}class og extends Dm{constructor(e,t,i,n,o){super(o);this.sourcePosition=e.clone();this.sourcePosition.stickiness=\"toPrevious\";this.howMany=t;this.targetPosition=i.clone();this.targetPosition.stickiness=\"toNext\";this.graveyardPosition=n.clone()}get type(){return\"merge\"}get deletionPosition(){return new $h(this.sourcePosition.root,this.sourcePosition.path.slice(0,-1))}get movedRange(){const e=this.sourcePosition.getShiftedBy(Number.POSITIVE_INFINITY);return new qh(this.sourcePosition,e)}clone(){return new this.constructor(this.sourcePosition,this.howMany,this.targetPosition,this.graveyardPosition,this.baseVersion)}getReversed(){const e=this.targetPosition._getTransformedByMergeOperation(this);const t=this.sourcePosition.path.slice(0,-1);const i=new $h(this.sourcePosition.root,t)._getTransformedByMergeOperation(this);const n=new rg(e,this.howMany,this.graveyardPosition,this.baseVersion+1);n.insertionPosition=i;return n}_validate(){const e=this.sourcePosition.parent;const t=this.targetPosition.parent;if(!e.parent){throw new ss[\"b\"](\"merge-operation-source-position-invalid: Merge source position is invalid.\",this)}else if(!t.parent){throw new ss[\"b\"](\"merge-operation-target-position-invalid: Merge target position is invalid.\",this)}else if(this.howMany!=e.maxOffset){throw new ss[\"b\"](\"merge-operation-how-many-invalid: Merge operation specifies wrong number of nodes to move.\",this)}}_execute(){const e=this.sourcePosition.parent;const t=qh._createIn(e);Wm(t,this.targetPosition);Wm(qh._createOn(e),this.graveyardPosition)}toJSON(){const e=super.toJSON();e.sourcePosition=e.sourcePosition.toJSON();e.targetPosition=e.targetPosition.toJSON();e.graveyardPosition=e.graveyardPosition.toJSON();return e}static get className(){return\"MergeOperation\"}static fromJSON(e,t){const i=$h.fromJSON(e.sourcePosition,t);const n=$h.fromJSON(e.targetPosition,t);const o=$h.fromJSON(e.graveyardPosition,t);return new this(i,e.howMany,n,o,e.baseVersion)}}class rg extends Dm{constructor(e,t,i,n){super(n);this.splitPosition=e.clone();this.splitPosition.stickiness=\"toNext\";this.howMany=t;this.insertionPosition=rg.getInsertionPosition(e);this.insertionPosition.stickiness=\"toNone\";this.graveyardPosition=i?i.clone():null;if(this.graveyardPosition){this.graveyardPosition.stickiness=\"toNext\"}}get type(){return\"split\"}get moveTargetPosition(){const e=this.insertionPosition.path.slice();e.push(0);return new $h(this.insertionPosition.root,e)}get movedRange(){const e=this.splitPosition.getShiftedBy(Number.POSITIVE_INFINITY);return new qh(this.splitPosition,e)}clone(){const e=new this.constructor(this.splitPosition,this.howMany,this.graveyardPosition,this.baseVersion);e.insertionPosition=this.insertionPosition;return e}getReversed(){const e=this.splitPosition.root.document.graveyard;const t=new $h(e,[0]);return new og(this.moveTargetPosition,this.howMany,this.splitPosition,t,this.baseVersion+1)}_validate(){const e=this.splitPosition.parent;const t=this.splitPosition.offset;if(!e||e.maxOffset{for(const t of e.getAttributeKeys()){this.removeAttribute(t,e)}};if(!(e instanceof qh)){t(e)}else{for(const i of e.getItems()){t(i)}}}move(e,t,i){this._assertWriterUsedCorrectly();if(!(e instanceof qh)){throw new ss[\"b\"](\"writer-move-invalid-range: Invalid range to move.\",this)}if(!e.isFlat){throw new ss[\"b\"](\"writer-move-range-not-flat: Range to move is not flat.\",this)}const n=$h._createAt(t,i);if(n.isEqual(e.start)){return}this._addOperationForAffectedMarkers(\"move\",e);if(!hg(e.root,n.root)){throw new ss[\"b\"](\"writer-move-different-document: Range is going to be moved between different documents.\",this)}const o=e.root.document?e.root.document.version:null;const r=new Zm(e.start,e.end.offset-e.start.offset,n,o);this.batch.addOperation(r);this.model.applyOperation(r)}remove(e){this._assertWriterUsedCorrectly();const t=e instanceof qh?e:qh._createOn(e);const i=t.getMinimalFlatRanges().reverse();for(const e of i){this._addOperationForAffectedMarkers(\"move\",e);ug(e.start,e.end.offset-e.start.offset,this.batch,this.model)}}merge(e){this._assertWriterUsedCorrectly();const t=e.nodeBefore;const i=e.nodeAfter;this._addOperationForAffectedMarkers(\"merge\",e);if(!(t instanceof Fh)){throw new ss[\"b\"](\"writer-merge-no-element-before: Node before merge position must be an element.\",this)}if(!(i instanceof Fh)){throw new ss[\"b\"](\"writer-merge-no-element-after: Node after merge position must be an element.\",this)}if(!e.root.document){this._mergeDetached(e)}else{this._merge(e)}}createPositionFromPath(e,t,i){return this.model.createPositionFromPath(e,t,i)}createPositionAt(e,t){return this.model.createPositionAt(e,t)}createPositionAfter(e){return this.model.createPositionAfter(e)}createPositionBefore(e){return this.model.createPositionBefore(e)}createRange(e,t){return this.model.createRange(e,t)}createRangeIn(e){return this.model.createRangeIn(e)}createRangeOn(e){return this.model.createRangeOn(e)}createSelection(e,t,i){return this.model.createSelection(e,t,i)}_mergeDetached(e){const t=e.nodeBefore;const i=e.nodeAfter;this.move(qh._createIn(i),$h._createAt(t,\"end\"));this.remove(i)}_merge(e){const t=$h._createAt(e.nodeBefore,\"end\");const i=$h._createAt(e.nodeAfter,0);const n=e.root.document.graveyard;const o=new $h(n,[0]);const r=e.root.document.version;const s=new og(i,e.nodeAfter.maxOffset,t,o,r);this.batch.addOperation(s);this.model.applyOperation(s)}rename(e,t){this._assertWriterUsedCorrectly();if(!(e instanceof Fh)){throw new ss[\"b\"](\"writer-rename-not-element-instance: Trying to rename an object which is not an instance of Element.\",this)}const i=e.root.document?e.root.document.version:null;const n=new ig($h._createBefore(e),e.name,t,i);this.batch.addOperation(n);this.model.applyOperation(n)}split(e,t){this._assertWriterUsedCorrectly();let i=e.parent;if(!i.parent){throw new ss[\"b\"](\"writer-split-element-no-parent: Element with no parent can not be split.\",this)}if(!t){t=i.parent}if(!e.parent.getAncestors({includeSelf:true}).includes(t)){throw new ss[\"b\"](\"writer-split-invalid-limit-element: Limit element is not a position ancestor.\",this)}let n,o;do{const t=i.root.document?i.root.document.version:null;const r=i.maxOffset-e.offset;const s=new rg(e,r,null,t);this.batch.addOperation(s);this.model.applyOperation(s);if(!n&&!o){n=i;o=e.parent.nextSibling}e=this.createPositionAfter(e.parent);i=e.parent}while(i!==t);return{position:e,range:new qh($h._createAt(n,\"end\"),$h._createAt(o,0))}}wrap(e,t){this._assertWriterUsedCorrectly();if(!e.isFlat){throw new ss[\"b\"](\"writer-wrap-range-not-flat: Range to wrap is not flat.\",this)}const i=t instanceof Fh?t:new Fh(t);if(i.childCount>0){throw new ss[\"b\"](\"writer-wrap-element-not-empty: Element to wrap with is not empty.\",this)}if(i.parent!==null){throw new ss[\"b\"](\"writer-wrap-element-attached: Element to wrap with is already attached to tree model.\",this)}this.insert(i,e.start);const n=new qh(e.start.getShiftedBy(1),e.end.getShiftedBy(1));this.move(n,$h._createAt(i,0))}unwrap(e){this._assertWriterUsedCorrectly();if(e.parent===null){throw new ss[\"b\"](\"writer-unwrap-element-no-parent: Trying to unwrap an element which has no parent.\",this)}this.move(qh._createIn(e),this.createPositionAfter(e));this.remove(e)}addMarker(e,t){this._assertWriterUsedCorrectly();if(!t||typeof t.usingOperation!=\"boolean\"){throw new ss[\"b\"](\"writer-addMarker-no-usingOperation: The options.usingOperation parameter is required when adding a new marker.\",this)}const i=t.usingOperation;const n=t.range;const o=t.affectsData===undefined?false:t.affectsData;if(this.model.markers.has(e)){throw new ss[\"b\"](\"writer-addMarker-marker-exists: Marker with provided name already exists.\",this)}if(!n){throw new ss[\"b\"](\"writer-addMarker-no-range: Range parameter is required when adding a new marker.\",this)}if(!i){return this.model.markers._set(e,n,i,o)}dg(this,e,null,n,o);return this.model.markers.get(e)}updateMarker(e,t){this._assertWriterUsedCorrectly();const i=typeof e==\"string\"?e:e.name;const n=this.model.markers.get(i);if(!n){throw new ss[\"b\"](\"writer-updateMarker-marker-not-exists: Marker with provided name does not exists.\",this)}if(!t){this.model.markers._refresh(n);return}const o=typeof t.usingOperation==\"boolean\";const r=typeof t.affectsData==\"boolean\";const s=r?t.affectsData:n.affectsData;if(!o&&!t.range&&!r){throw new ss[\"b\"](\"writer-updateMarker-wrong-options: One of the options is required - provide range, usingOperations or affectsData.\",this)}const a=n.getRange();const c=t.range?t.range:a;if(o&&t.usingOperation!==n.managedUsingOperations){if(t.usingOperation){dg(this,i,null,c,s)}else{dg(this,i,a,null,s);this.model.markers._set(i,c,undefined,s)}return}if(n.managedUsingOperations){dg(this,i,a,c,s)}else{this.model.markers._set(i,c,undefined,s)}}removeMarker(e){this._assertWriterUsedCorrectly();const t=typeof e==\"string\"?e:e.name;if(!this.model.markers.has(t)){throw new ss[\"b\"](\"writer-removeMarker-no-marker: Trying to remove marker which does not exist.\",this)}const i=this.model.markers.get(t);if(!i.managedUsingOperations){this.model.markers._remove(t);return}const n=i.getRange();dg(this,t,n,null,i.affectsData)}setSelection(e,t,i){this._assertWriterUsedCorrectly();this.model.document.selection._setTo(e,t,i)}setSelectionFocus(e,t){this._assertWriterUsedCorrectly();this.model.document.selection._setFocus(e,t)}setSelectionAttribute(e,t){this._assertWriterUsedCorrectly();if(typeof e===\"string\"){this._setSelectionAttribute(e,t)}else{for(const[t,i]of Hs(e)){this._setSelectionAttribute(t,i)}}}removeSelectionAttribute(e){this._assertWriterUsedCorrectly();if(typeof e===\"string\"){this._removeSelectionAttribute(e)}else{for(const t of e){this._removeSelectionAttribute(t)}}}overrideSelectionGravity(){return this.model.document.selection._overrideGravity()}restoreSelectionGravity(e){this.model.document.selection._restoreGravity(e)}_setSelectionAttribute(e,t){const i=this.model.document.selection;if(i.isCollapsed&&i.anchor.parent.isEmpty){const n=df._getStoreAttributeKey(e);this.setAttribute(n,t,i.anchor.parent)}i._setAttribute(e,t)}_removeSelectionAttribute(e){const t=this.model.document.selection;if(t.isCollapsed&&t.anchor.parent.isEmpty){const i=df._getStoreAttributeKey(e);this.removeAttribute(i,t.anchor.parent)}t._removeAttribute(e)}_assertWriterUsedCorrectly(){if(this.model._currentWriter!==this){throw new ss[\"b\"](\"writer-incorrect-use: Trying to use a writer outside the change() block.\",this)}}_addOperationForAffectedMarkers(e,t){for(const i of this.model.markers){if(!i.managedUsingOperations){continue}const n=i.getRange();let o=false;if(e==\"move\"){o=t.containsPosition(n.start)||t.start.isEqual(n.start)||t.containsPosition(n.end)||t.end.isEqual(n.end)}else{const e=t.nodeBefore;const i=t.nodeAfter;const r=n.start.parent==e&&n.start.isAtEnd;const s=n.end.parent==i&&n.end.offset==0;const a=n.end.nodeAfter==i;const c=n.start.nodeAfter==i;o=r||s||a||c}if(o){this.updateMarker(i.name,{range:n})}}}}function cg(e,t,i,n){const o=e.model;const r=o.document;let s=n.start;let a;let c;let l;for(const e of n.getWalker({shallow:true})){l=e.item.getAttribute(t);if(a&&c!=l){if(c!=i){d()}s=a}a=e.nextPosition;c=l}if(a instanceof $h&&a!=s&&c!=i){d()}function d(){const n=new qh(s,a);const l=n.root.document?r.version:null;const d=new Qm(n,t,c,i,l);e.batch.addOperation(d);o.applyOperation(d)}}function lg(e,t,i,n){const o=e.model;const r=o.document;const s=n.getAttribute(t);let a,c;if(s!=i){const l=n.root===n;if(l){const e=n.document?r.version:null;c=new ng(n,t,s,i,e)}else{a=new qh($h._createBefore(n),e.createPositionAfter(n));const o=a.root.document?r.version:null;c=new Qm(a,t,s,i,o)}e.batch.addOperation(c);o.applyOperation(c)}}function dg(e,t,i,n,o){const r=e.model;const s=r.document;const a=new tg(t,i,n,r.markers,o,s.version);e.batch.addOperation(a);r.applyOperation(a)}function ug(e,t,i,n){let o;if(e.root.document){const i=n.document;const r=new $h(i.graveyard,[0]);o=new Zm(e,t,r,i.version)}else{o=new Km(e,t)}i.addOperation(o);n.applyOperation(o)}function hg(e,t){if(e===t){return true}if(e instanceof sg&&t instanceof sg){return true}return false}class fg{constructor(e){this._markerCollection=e;this._changesInElement=new Map;this._elementSnapshots=new Map;this._changedMarkers=new Map;this._changeCount=0;this._cachedChanges=null;this._cachedChangesWithGraveyard=null}get isEmpty(){return this._changesInElement.size==0&&this._changedMarkers.size==0}refreshItem(e){if(this._isInInsertedElement(e.parent)){return}this._markRemove(e.parent,e.startOffset,e.offsetSize);this._markInsert(e.parent,e.startOffset,e.offsetSize);const t=qh._createOn(e);for(const e of this._markerCollection.getMarkersIntersectingRange(t)){const t=e.getRange();this.bufferMarkerChange(e.name,t,t,e.affectsData)}this._cachedChanges=null}bufferOperation(e){switch(e.type){case\"insert\":{if(this._isInInsertedElement(e.position.parent)){return}this._markInsert(e.position.parent,e.position.offset,e.nodes.maxOffset);break}case\"addAttribute\":case\"removeAttribute\":case\"changeAttribute\":{for(const t of e.range.getItems({shallow:true})){if(this._isInInsertedElement(t.parent)){continue}this._markAttribute(t)}break}case\"remove\":case\"move\":case\"reinsert\":{if(e.sourcePosition.isEqual(e.targetPosition)||e.sourcePosition.getShiftedBy(e.howMany).isEqual(e.targetPosition)){return}const t=this._isInInsertedElement(e.sourcePosition.parent);const i=this._isInInsertedElement(e.targetPosition.parent);if(!t){this._markRemove(e.sourcePosition.parent,e.sourcePosition.offset,e.howMany)}if(!i){this._markInsert(e.targetPosition.parent,e.getMovedRangeStart().offset,e.howMany)}break}case\"rename\":{if(this._isInInsertedElement(e.position.parent)){return}this._markRemove(e.position.parent,e.position.offset,1);this._markInsert(e.position.parent,e.position.offset,1);const t=qh._createFromPositionAndShift(e.position,1);for(const e of this._markerCollection.getMarkersIntersectingRange(t)){const t=e.getRange();this.bufferMarkerChange(e.name,t,t,e.affectsData)}break}case\"split\":{const t=e.splitPosition.parent;if(!this._isInInsertedElement(t)){this._markRemove(t,e.splitPosition.offset,e.howMany)}if(!this._isInInsertedElement(e.insertionPosition.parent)){this._markInsert(e.insertionPosition.parent,e.insertionPosition.offset,1)}if(e.graveyardPosition){this._markRemove(e.graveyardPosition.parent,e.graveyardPosition.offset,1)}break}case\"merge\":{const t=e.sourcePosition.parent;if(!this._isInInsertedElement(t.parent)){this._markRemove(t.parent,t.startOffset,1)}const i=e.graveyardPosition.parent;this._markInsert(i,e.graveyardPosition.offset,1);const n=e.targetPosition.parent;if(!this._isInInsertedElement(n)){this._markInsert(n,e.targetPosition.offset,t.maxOffset)}break}}this._cachedChanges=null}bufferMarkerChange(e,t,i,n){const o=this._changedMarkers.get(e);if(!o){this._changedMarkers.set(e,{oldRange:t,newRange:i,affectsData:n})}else{o.newRange=i;o.affectsData=n;if(o.oldRange==null&&o.newRange==null){this._changedMarkers.delete(e)}}}getMarkersToRemove(){const e=[];for(const[t,i]of this._changedMarkers){if(i.oldRange!=null){e.push({name:t,range:i.oldRange})}}return e}getMarkersToAdd(){const e=[];for(const[t,i]of this._changedMarkers){if(i.newRange!=null){e.push({name:t,range:i.newRange})}}return e}getChangedMarkers(){return Array.from(this._changedMarkers).map(e=>({name:e[0],data:{oldRange:e[1].oldRange,newRange:e[1].newRange}}))}hasDataChanges(){for(const[,e]of this._changedMarkers){if(e.affectsData){return true}}return this._changesInElement.size>0}getChanges(e={includeChangesInGraveyard:false}){if(this._cachedChanges){if(e.includeChangesInGraveyard){return this._cachedChangesWithGraveyard.slice()}else{return this._cachedChanges.slice()}}const t=[];for(const e of this._changesInElement.keys()){const i=this._changesInElement.get(e).sort((e,t)=>{if(e.offset===t.offset){if(e.type!=t.type){return e.type==\"remove\"?-1:1}return 0}return e.offset{if(e.position.root!=t.position.root){return e.position.root.rootNamei.offset){if(n>o){const e={type:\"attribute\",offset:o,howMany:n-o,count:this._changeCount++};this._handleChange(e,t);t.push(e)}e.nodesToHandle=i.offset-e.offset;e.howMany=e.nodesToHandle}else if(e.offset>=i.offset&&e.offseto){e.nodesToHandle=n-o;e.offset=o}else{e.nodesToHandle=0}}}if(i.type==\"remove\"){if(e.offseti.offset){const o={type:\"attribute\",offset:i.offset,howMany:n-i.offset,count:this._changeCount++};this._handleChange(o,t);t.push(o);e.nodesToHandle=i.offset-e.offset;e.howMany=e.nodesToHandle}}if(i.type==\"attribute\"){if(e.offset>=i.offset&&n<=o){e.nodesToHandle=0;e.howMany=0;e.offset=0}else if(e.offset<=i.offset&&n>=o){i.howMany=0}}}}e.howMany=e.nodesToHandle;delete e.nodesToHandle}_getInsertDiff(e,t,i){return{type:\"insert\",position:$h._createAt(e,t),name:i,length:1,changeCount:this._changeCount++}}_getRemoveDiff(e,t,i){return{type:\"remove\",position:$h._createAt(e,t),name:i,length:1,changeCount:this._changeCount++}}_getAttributesDiff(e,t,i){const n=[];i=new Map(i);for(const[o,r]of t){const t=i.has(o)?i.get(o):null;if(t!==r){n.push({type:\"attribute\",position:e.start,range:e.clone(),length:1,attributeKey:o,attributeOldValue:r,attributeNewValue:t,changeCount:this._changeCount++})}i.delete(o)}for(const[t,o]of i){n.push({type:\"attribute\",position:e.start,range:e.clone(),length:1,attributeKey:t,attributeOldValue:null,attributeNewValue:o,changeCount:this._changeCount++})}return n}_isInInsertedElement(e){const t=e.parent;if(!t){return false}const i=this._changesInElement.get(t);const n=e.startOffset;if(i){for(const e of i){if(e.type==\"insert\"&&n>=e.offset&&nn){for(let t=0;t{const i=t[0];if(i.isDocumentOperation&&i.baseVersion!==this.version){throw new ss[\"b\"](\"model-document-applyOperation-wrong-version: Only operations with matching versions can be applied.\",this,{operation:i})}},{priority:\"highest\"});this.listenTo(e,\"applyOperation\",(e,t)=>{const i=t[0];if(i.isDocumentOperation){this.differ.bufferOperation(i)}},{priority:\"high\"});this.listenTo(e,\"applyOperation\",(e,t)=>{const i=t[0];if(i.isDocumentOperation){this.version++;this.history.addOperation(i)}},{priority:\"low\"});this.listenTo(this.selection,\"change\",()=>{this._hasSelectionChangedFromTheLastChangeBlock=true});this.listenTo(e.markers,\"update\",(e,t,i,n)=>{this.differ.bufferMarkerChange(t.name,i,n,t.affectsData);if(i===null){t.on(\"change\",(e,i)=>{this.differ.bufferMarkerChange(t.name,i,t.getRange(),t.affectsData)})}})}get graveyard(){return this.getRoot(xg)}createRoot(e=\"$root\",t=\"main\"){if(this.roots.get(t)){throw new ss[\"b\"](\"model-document-createRoot-name-exists: Root with specified name already exists.\",this,{name:t})}const i=new sg(this,e,t);this.roots.add(i);return i}destroy(){this.selection.destroy();this.stopListening()}getRoot(e=\"main\"){return this.roots.get(e)}getRootNames(){return Array.from(this.roots,e=>e.rootName).filter(e=>e!=xg)}registerPostFixer(e){this._postFixers.add(e)}toJSON(){const e=zs(this);e.selection=\"[engine.model.DocumentSelection]\";e.model=\"[engine.model.Model]\";return e}_handleChangeBlock(e){if(this._hasDocumentChangedFromTheLastChangeBlock()){this._callPostFixers(e);this.selection.refresh();if(this.differ.hasDataChanges()){this.fire(\"change:data\",e.batch)}else{this.fire(\"change\",e.batch)}this.selection.refresh();this.differ.reset()}this._hasSelectionChangedFromTheLastChangeBlock=false}_hasDocumentChangedFromTheLastChangeBlock(){return!this.differ.isEmpty||this._hasSelectionChangedFromTheLastChangeBlock}_getDefaultRoot(){for(const e of this.roots){if(e!==this.graveyard){return e}}return this.graveyard}_getDefaultRange(){const e=this._getDefaultRoot();const t=this.model;const i=t.schema;const n=t.createPositionFromPath(e,[0]);const o=i.getNearestSelectionRange(n);return o||t.createRange(n)}_validateSelectionRange(e){return Cg(e.start)&&Cg(e.end)}_callPostFixers(e){let t=false;do{for(const i of this._postFixers){this.selection.refresh();t=i(e);if(t){break}}}while(t)}}ks(Ag,ds);function Cg(e){const t=e.textNode;if(t){const i=t.data;const n=e.offset-t.startOffset;return!kg(i,n)&&!yg(i,n)}return true}class Tg{constructor(){this._markers=new Map}[Symbol.iterator](){return this._markers.values()}has(e){return this._markers.has(e)}get(e){return this._markers.get(e)||null}_set(e,t,i=false,n=false){const o=e instanceof Eg?e.name:e;const r=this._markers.get(o);if(r){const e=r.getRange();let s=false;if(!e.isEqual(t)){r._attachLiveRange(rf.fromRange(t));s=true}if(i!=r.managedUsingOperations){r._managedUsingOperations=i;s=true}if(typeof n===\"boolean\"&&n!=r.affectsData){r._affectsData=n;s=true}if(s){this.fire(\"update:\"+o,r,e,t)}return r}const s=rf.fromRange(t);const a=new Eg(o,s,i,n);this._markers.set(o,a);this.fire(\"update:\"+o,a,null,t);return a}_remove(e){const t=e instanceof Eg?e.name:e;const i=this._markers.get(t);if(i){this._markers.delete(t);this.fire(\"update:\"+t,i,i.getRange(),null);this._destroyMarker(i);return true}return false}_refresh(e){const t=e instanceof Eg?e.name:e;const i=this._markers.get(t);if(!i){throw new ss[\"b\"](\"markercollection-refresh-marker-not-exists: Marker with provided name does not exists.\",this)}const n=i.getRange();this.fire(\"update:\"+t,i,n,n,i.managedUsingOperations,i.affectsData)}*getMarkersAtPosition(e){for(const t of this){if(t.getRange().containsPosition(e)){yield t}}}*getMarkersIntersectingRange(e){for(const t of this){if(t.getRange().getIntersection(e)!==null){yield t}}}destroy(){for(const e of this._markers.values()){this._destroyMarker(e)}this._markers=null;this.stopListening()}*getMarkersGroup(e){for(const t of this._markers.values()){if(t.name.startsWith(e+\":\")){yield t}}}_destroyMarker(e){e.stopListening();e._detachLiveRange()}}ks(Tg,ds);class Eg{constructor(e,t,i,n){this.name=e;this._liveRange=this._attachLiveRange(t);this._managedUsingOperations=i;this._affectsData=n}get managedUsingOperations(){if(!this._liveRange){throw new ss[\"b\"](\"marker-destroyed: Cannot use a destroyed marker instance.\",this)}return this._managedUsingOperations}get affectsData(){if(!this._liveRange){throw new ss[\"b\"](\"marker-destroyed: Cannot use a destroyed marker instance.\",this)}return this._affectsData}getStart(){if(!this._liveRange){throw new ss[\"b\"](\"marker-destroyed: Cannot use a destroyed marker instance.\",this)}return this._liveRange.start.clone()}getEnd(){if(!this._liveRange){throw new ss[\"b\"](\"marker-destroyed: Cannot use a destroyed marker instance.\",this)}return this._liveRange.end.clone()}getRange(){if(!this._liveRange){throw new ss[\"b\"](\"marker-destroyed: Cannot use a destroyed marker instance.\",this)}return this._liveRange.toRange()}is(e){return e==\"marker\"||e==\"model:marker\"}_attachLiveRange(e){if(this._liveRange){this._detachLiveRange()}e.delegate(\"change:range\").to(this);e.delegate(\"change:content\").to(this);this._liveRange=e;return e}_detachLiveRange(){this._liveRange.stopDelegating(\"change:range\",this);this._liveRange.stopDelegating(\"change:content\",this);this._liveRange.detach();this._liveRange=null}}ks(Eg,ds);class Mg extends Dm{get type(){return\"noop\"}clone(){return new Mg(this.baseVersion)}getReversed(){return new Mg(this.baseVersion+1)}_execute(){}static get className(){return\"NoOperation\"}}const Pg={};Pg[Qm.className]=Qm;Pg[eg.className]=eg;Pg[tg.className]=tg;Pg[Zm.className]=Zm;Pg[Mg.className]=Mg;Pg[Dm.className]=Dm;Pg[ig.className]=ig;Pg[ng.className]=ng;Pg[rg.className]=rg;Pg[og.className]=og;class Sg{static fromJSON(e,t){return Pg[e.__className].fromJSON(e,t)}}class Ig extends $h{constructor(e,t,i=\"toNone\"){super(e,t,i);if(!this.root.is(\"rootElement\")){throw new ss[\"b\"](\"model-liveposition-root-not-rootelement: LivePosition's root has to be an instance of RootElement.\",e)}Ng.call(this)}detach(){this.stopListening()}is(e){return e==\"livePosition\"||e==\"model:livePosition\"||super.is(e)}toPosition(){return new $h(this.root,this.path.slice(),this.stickiness)}static fromPosition(e,t){return new this(e.root,e.path.slice(),t?t:e.stickiness)}}function Ng(){this.listenTo(this.root.document.model,\"applyOperation\",(e,t)=>{const i=t[0];if(!i.isDocumentOperation){return}Og.call(this,i)},{priority:\"low\"})}function Og(e){const t=this.getTransformedByOperation(e);if(!this.isEqual(t)){const e=this.toPosition();this.path=t.path;this.root=t.root;this.fire(\"change\",e)}}ks(Ig,ds);function Lg(e,t,i,n){return e.change(o=>{let r;if(!i){r=e.document.selection}else if(i instanceof Kh||i instanceof df){r=i}else{r=o.createSelection(i,n)}if(!r.isCollapsed){e.deleteContent(r,{doNotAutoparagraph:true})}const s=new Rg(e,o,r.anchor);let a;if(t.is(\"documentFragment\")){a=t.getChildren()}else{a=[t]}s.handleNodes(a,{isFirst:true,isLast:true});const c=s.getSelectionRange();if(c){if(r instanceof df){o.setSelection(c)}else{r.setTo(c)}}else{}const l=s.getAffectedRange()||e.createRange(r.anchor);s.destroy();return l})}class Rg{constructor(e,t,i){this.model=e;this.writer=t;this.position=i;this.canMergeWith=new Set([this.position.parent]);this.schema=e.schema;this._filterAttributesOf=[];this._affectedStart=null;this._affectedEnd=null}handleNodes(e,t){e=Array.from(e);for(let i=0;i{if(!i.doNotResetEntireContent&&Hg(o,t)){Fg(e,t,o);return}const r=n.start;const s=Ig.fromPosition(n.end,\"toNext\");if(!n.start.isTouching(n.end)){e.remove(n)}if(!i.leaveUnmerged){jg(e,r,s);o.removeDisallowedAttributes(r.parent.getChildren(),e)}Wg(e,t,r);if(!i.doNotAutoparagraph&&Dg(o,r)){Vg(e,r,t)}s.detach()})}function jg(e,t,i){const n=t.parent;const o=i.parent;if(n==o){return}if(e.model.schema.isLimit(n)||e.model.schema.isLimit(o)){return}if(!Bg(t,i,e.model.schema)){return}t=e.createPositionAfter(n);i=e.createPositionBefore(o);if(!i.isEqual(t)){e.insert(o,t)}e.merge(t);while(i.parent.isEmpty){const t=i.parent;i=e.createPositionBefore(t);e.remove(t)}jg(e,t,i)}function Dg(e,t){const i=e.checkChild(t,\"$text\");const n=e.checkChild(t,\"paragraph\");return!i&&n}function Bg(e,t,i){const n=new qh(e,t);for(const e of n.getWalker()){if(i.isLimit(e.item)){return false}}return true}function Vg(e,t,i){const n=e.createElement(\"paragraph\");e.insert(n,t);Wg(e,i,e.createPositionAt(n,0))}function Fg(e,t){const i=e.model.schema.getLimitElement(t);e.remove(e.createRangeIn(i));Vg(e,e.createPositionAt(i,0),t)}function Hg(e,t){const i=e.getLimitElement(t);if(!t.containsEntireContent(i)){return false}const n=t.getFirstRange();if(n.start.parent==n.end.parent){return false}return e.checkChild(i,\"paragraph\")}function Wg(e,t,i){if(t instanceof df){e.setSelection(i)}else{t.setTo(i)}}const Ug=' ,.?!:;\"-()';function $g(e,t,i={}){const n=e.schema;const o=i.direction!=\"backward\";const r=i.unit?i.unit:\"character\";const s=t.focus;const a=new Wh({boundaries:Jg(s,o),singleCharacters:true,direction:o?\"forward\":\"backward\"});const c={walker:a,schema:n,isForward:o,unit:r};let l;while(l=a.next()){if(l.done){return}const i=qg(c,l.value);if(i){if(t instanceof df){e.change(e=>{e.setSelectionFocus(i)})}else{t.setFocus(i)}return}}}function qg(e,t){if(t.type==\"text\"){if(e.unit===\"word\"){return Gg(e.walker,e.isForward)}return Yg(e.walker,e.unit,e.isForward)}if(t.type==(e.isForward?\"elementStart\":\"elementEnd\")){if(e.schema.isObject(t.item)){return $h._createAt(t.item,e.isForward?\"after\":\"before\")}if(e.schema.checkChild(t.nextPosition,\"$text\")){return t.nextPosition}}else{if(e.schema.isLimit(t.item)){e.walker.skip(()=>true);return}if(e.schema.checkChild(t.nextPosition,\"$text\")){return t.nextPosition}}}function Yg(e,t){const i=e.position.textNode;if(i){const n=i.data;let o=e.position.offset-i.startOffset;while(kg(n,o)||t==\"character\"&&yg(n,o)){e.next();o=e.position.offset-i.startOffset}}return e.position}function Gg(e,t){let i=e.position.textNode;if(i){let n=e.position.offset-i.startOffset;while(!Xg(i.data,n,t)&&!Qg(i,n,t)){e.next();const o=t?e.position.nodeAfter:e.position.nodeBefore;if(o&&o.is(\"text\")){const n=o.data.charAt(t?0:o.data.length-1);if(!Ug.includes(n)){e.next();i=e.position.textNode}}n=e.position.offset-i.startOffset}}return e.position}function Jg(e,t){const i=e.root;const n=$h._createAt(i,t?\"end\":0);if(t){return new qh(e,n)}else{return new qh(n,e)}}function Xg(e,t,i){const n=t+(i?0:-1);return Ug.includes(e.charAt(n))}function Qg(e,t,i){return t===(i?e.endOffset:0)}function Kg(e,t){return e.change(e=>{const i=e.createDocumentFragment();const n=t.getFirstRange();if(!n||n.isCollapsed){return i}const o=n.start.root;const r=n.start.getCommonPath(n.end);const s=o.getNodeByPath(r);let a;if(n.start.parent==n.end.parent){a=n}else{a=e.createRange(e.createPositionAt(s,n.start.path[r.length]),e.createPositionAt(s,n.end.path[r.length]+1))}const c=a.end.offset-a.start.offset;for(const t of a.getItems({shallow:true})){if(t.is(\"textProxy\")){e.appendText(t.data,t.getAttributes(),i)}else{e.append(t._clone(true),i)}}if(a!=n){const t=n._getTransformedByMove(a.start,e.createPositionAt(i,0),c)[0];const o=e.createRange(e.createPositionAt(i,0),t.start);const r=e.createRange(t.end,e.createPositionAt(i,\"end\"));Zg(r,e);Zg(o,e)}return i})}function Zg(e,t){const i=[];Array.from(e.getItems({direction:\"backward\"})).map(e=>t.createRangeOn(e)).filter(t=>{const i=(t.start.isAfter(e.start)||t.start.isEqual(e.start))&&(t.end.isBefore(e.end)||t.end.isEqual(e.end));return i}).forEach(e=>{i.push(e.start.parent);t.remove(e)});i.forEach(e=>{let i=e;while(i.parent&&i.isEmpty){const e=t.createRangeOn(i);i=i.parent;t.remove(e)}})}function ep(e){e.document.registerPostFixer(t=>tp(t,e))}function tp(e,t){const i=t.document.selection;const n=t.schema;const o=[];let r=false;for(const e of i.getRanges()){const t=ip(e,n);if(t){o.push(t);r=true}else{o.push(e)}}if(r){e.setSelection(ap(o),{backward:i.isBackward})}}function ip(e,t){if(e.isCollapsed){return np(e,t)}return op(e,t)}function np(e,t){const i=e.start;const n=t.getNearestSelectionRange(i);if(!n){return null}if(!n.isCollapsed){return n}const o=n.start;if(i.isEqual(o)){return null}return new qh(o)}function op(e,t){const i=e.start;const n=e.end;const o=t.checkChild(i,\"$text\");const r=t.checkChild(n,\"$text\");const s=t.getLimitElement(i);const a=t.getLimitElement(n);if(s===a){if(o&&r){return null}if(sp(i,n,t)){const e=i.nodeAfter&&t.isObject(i.nodeAfter);const o=e?null:t.getNearestSelectionRange(i,\"forward\");const r=n.nodeBefore&&t.isObject(n.nodeBefore);const s=r?null:t.getNearestSelectionRange(n,\"backward\");const a=o?o.start:i;const c=s?s.start:n;return new qh(a,c)}}const c=s&&!s.is(\"rootElement\");const l=a&&!a.is(\"rootElement\");if(c||l){const e=i.nodeAfter&&n.nodeBefore&&i.nodeAfter.parent===n.nodeBefore.parent;const o=c&&(!e||!cp(i.nodeAfter,t));const r=l&&(!e||!cp(n.nodeBefore,t));let d=i;let u=n;if(o){d=$h._createBefore(rp(s,t))}if(r){u=$h._createAfter(rp(a,t))}return new qh(d,u)}return null}function rp(e,t){let i=e;let n=i;while(t.isLimit(n)&&n.parent){i=n;n=n.parent}return i}function sp(e,t,i){const n=e.nodeAfter&&!i.isLimit(e.nodeAfter)||i.checkChild(e,\"$text\");const o=t.nodeBefore&&!i.isLimit(t.nodeBefore)||i.checkChild(t,\"$text\");return n||o}function ap(e){const t=[];t.push(e.shift());for(const i of e){const e=t.pop();if(i.isIntersecting(e)){const n=e.start.isAfter(i.start)?i.start:e.start;const o=e.end.isAfter(i.end)?e.end:i.end;const r=new qh(n,o);t.push(r)}else{t.push(e);t.push(i)}}return t}function cp(e,t){return e&&t.isObject(e)}class lp{constructor(){this.markers=new Tg;this.document=new Ag(this);this.schema=new um;this._pendingChanges=[];this._currentWriter=null;[\"insertContent\",\"deleteContent\",\"modifySelection\",\"getSelectedContent\",\"applyOperation\"].forEach(e=>this.decorate(e));this.on(\"applyOperation\",(e,t)=>{const i=t[0];i._validate()},{priority:\"highest\"});this.schema.register(\"$root\",{isLimit:true});this.schema.register(\"$block\",{allowIn:\"$root\",isBlock:true});this.schema.register(\"$text\",{allowIn:\"$block\",isInline:true});this.schema.register(\"$clipboardHolder\",{allowContentOf:\"$root\",isLimit:true});this.schema.extend(\"$text\",{allowIn:\"$clipboardHolder\"});this.schema.register(\"$marker\");this.schema.addChildCheck((e,t)=>{if(t.name===\"$marker\"){return true}});ep(this)}change(e){try{if(this._pendingChanges.length===0){this._pendingChanges.push({batch:new jm,callback:e});return this._runPendingChanges()[0]}else{return e(this._currentWriter)}}catch(e){ss[\"b\"].rethrowUnexpectedError(e,this)}}enqueueChange(e,t){try{if(typeof e===\"string\"){e=new jm(e)}else if(typeof e==\"function\"){t=e;e=new jm}this._pendingChanges.push({batch:e,callback:t});if(this._pendingChanges.length==1){this._runPendingChanges()}}catch(e){ss[\"b\"].rethrowUnexpectedError(e,this)}}applyOperation(e){e._execute()}insertContent(e,t,i){return Lg(this,e,t,i)}deleteContent(e,t){zg(this,e,t)}modifySelection(e,t){$g(this,e,t)}getSelectedContent(e){return Kg(this,e)}hasContent(e,t){const i=e instanceof Fh?qh._createIn(e):e;if(i.isCollapsed){return false}for(const e of this.markers.getMarkersIntersectingRange(i)){if(e.affectsData){return true}}const{ignoreWhitespaces:n=false}=t||{};for(const e of i.getItems()){if(e.is(\"textProxy\")){if(!n){return true}else if(e.data.search(/\\S/)!==-1){return true}}else if(this.schema.isObject(e)){return true}}return false}createPositionFromPath(e,t,i){return new $h(e,t,i)}createPositionAt(e,t){return $h._createAt(e,t)}createPositionAfter(e){return $h._createAfter(e)}createPositionBefore(e){return $h._createBefore(e)}createRange(e,t){return new qh(e,t)}createRangeIn(e){return qh._createIn(e)}createRangeOn(e){return qh._createOn(e)}createSelection(e,t,i){return new Kh(e,t,i)}createBatch(e){return new jm(e)}createOperationFromJSON(e){return Sg.fromJSON(e,this.document)}destroy(){this.document.destroy();this.stopListening()}_runPendingChanges(){const e=[];this.fire(\"_beforeChanges\");while(this._pendingChanges.length){const t=this._pendingChanges[0].batch;this._currentWriter=new ag(this,t);const i=this._pendingChanges[0].callback(this._currentWriter);e.push(i);this.document._handleChangeBlock(this._currentWriter);this._pendingChanges.shift();this._currentWriter=null}this.fire(\"_afterChanges\");return e}}ks(lp,Jc);class dp{constructor(){this._listener=Object.create(Ud)}listenTo(e){this._listener.listenTo(e,\"keydown\",(e,t)=>{this._listener.fire(\"_keydown:\"+Rl(t),t)})}set(e,t,i={}){const n=zl(e);const o=i.priority;this._listener.listenTo(this._listener,\"_keydown:\"+n,(e,i)=>{t(i,()=>{i.preventDefault();i.stopPropagation();e.stop()});e.return=true},{priority:o})}press(e){return!!this._listener.fire(\"_keydown:\"+Rl(e),e)}destroy(){this._listener.stopListening()}}class up extends dp{constructor(e){super();this.editor=e}set(e,t,i={}){if(typeof t==\"string\"){const e=t;t=(t,i)=>{this.editor.execute(e);i()}}super.set(e,t,i)}}class hp{constructor(e={}){this._context=e.context||new Ns({language:e.language});this._context._addEditor(this,!e.context);const t=Array.from(this.constructor.builtinPlugins||[]);this.config=new Jr(e,this.constructor.defaultConfig);this.config.define(\"plugins\",t);this.config.define(this._context._getEditorConfig());this.plugins=new xs(this,t,this._context.plugins);this.locale=this._context.locale;this.t=this.locale.t;this.commands=new cm;this.set(\"state\",\"initializing\");this.once(\"ready\",()=>this.state=\"ready\",{priority:\"high\"});this.once(\"destroy\",()=>this.state=\"destroyed\",{priority:\"high\"});this.set(\"isReadOnly\",false);this.model=new lp;const i=new Oc;this.data=new Nm(this.model,i);this.editing=new am(this.model,i);this.editing.view.document.bind(\"isReadOnly\").to(this);this.conversion=new Lm([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 up(this);this.keystrokes.listenTo(this.editing.view.document)}initPlugins(){const e=this.config;const t=e.get(\"plugins\");const i=e.get(\"removePlugins\")||[];const n=e.get(\"extraPlugins\")||[];return this.plugins.init(t.concat(n),i)}destroy(){let e=Promise.resolve();if(this.state==\"initializing\"){e=new Promise(e=>this.once(\"ready\",e))}return e.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(...e){try{this.commands.execute(...e)}catch(e){ss[\"b\"].rethrowUnexpectedError(e,this)}}}ks(hp,Jc);const fp={setData(e){this.data.set(e)},getData(e){return this.data.get(e)}};var mp=fp;function gp(e,t){if(e instanceof HTMLTextAreaElement){e.value=t}e.innerHTML=t}const pp={updateSourceElement(){if(!this.sourceElement){throw new ss[\"b\"](\"editor-missing-sourceelement: Cannot update the source element of a detached editor.\",this)}gp(this.sourceElement,this.data.get())}};var bp=pp;function wp(e){if(!me(e.updateSourceElement)){throw new ss[\"b\"](\"attachtoform-missing-elementapi-interface: Editor passed to attachToForm() must implement ElementApi.\",e)}const t=e.sourceElement;if(t&&t.tagName.toLowerCase()===\"textarea\"&&t.form){let i;const n=t.form;const o=()=>e.updateSourceElement();if(me(n.submit)){i=n.submit;n.submit=()=>{o();i.apply(n)}}n.addEventListener(\"submit\",o);e.on(\"destroy\",()=>{n.removeEventListener(\"submit\",o);if(i){n.submit=i}})}}class _p{getHtml(e){const t=document.implementation.createHTMLDocument(\"\");const i=t.createElement(\"div\");i.appendChild(e);return i.innerHTML}}class vp{constructor(e){this._domParser=new DOMParser;this._domConverter=new jd(e,{blockFillerMode:\"nbsp\"});this._htmlWriter=new _p}toData(e){const t=this._domConverter.viewToDom(e,document);return this._htmlWriter.getHtml(t)}toView(e){const t=this._toDom(e);return this._domConverter.domToView(t)}_toDom(e){const t=this._domParser.parseFromString(e,\"text/html\");const i=t.createDocumentFragment();const n=t.body.childNodes;while(n.length>0){i.appendChild(n[0])}return i}}class kp{constructor(e){this.editor=e;this._components=new Map}*names(){for(const e of this._components.values()){yield e.originalName}}add(e,t){if(this.has(e)){throw new ss[\"b\"](\"componentfactory-item-exists: The item already exists in the component factory.\",this,{name:e})}this._components.set(yp(e),{callback:t,originalName:e})}create(e){if(!this.has(e)){throw new ss[\"b\"](\"componentfactory-item-missing: The required component is not registered in the factory.\",this,{name:e})}return this._components.get(yp(e)).callback(this.editor.locale)}has(e){return this._components.has(yp(e))}}function yp(e){return String(e).toLowerCase()}class xp{constructor(){this.set(\"isFocused\",false);this.set(\"focusedElement\",null);this._elements=new Set;this._nextEventLoopTimeout=null}add(e){if(this._elements.has(e)){throw new ss[\"b\"](\"focusTracker-add-element-already-exist\",this)}this.listenTo(e,\"focus\",()=>this._focus(e),{useCapture:true});this.listenTo(e,\"blur\",()=>this._blur(),{useCapture:true});this._elements.add(e)}remove(e){if(e===this.focusedElement){this._blur(e)}if(this._elements.has(e)){this.stopListening(e);this._elements.delete(e)}}destroy(){this.stopListening()}_focus(e){clearTimeout(this._nextEventLoopTimeout);this.focusedElement=e;this.isFocused=true}_blur(){clearTimeout(this._nextEventLoopTimeout);this._nextEventLoopTimeout=setTimeout(()=>{this.focusedElement=null;this.isFocused=false},0)}}ks(xp,Ud);ks(xp,Jc);class Ap{constructor(e){this.editor=e;this.componentFactory=new kp(e);this.focusTracker=new xp;this._editableElementsMap=new Map;this.listenTo(e.editing.view.document,\"layoutChanged\",()=>this.update())}get element(){return null}update(){this.fire(\"update\")}destroy(){this.stopListening();this.focusTracker.destroy();for(const e of this._editableElementsMap.values()){e.ckeditorInstance=null}this._editableElementsMap=new Map}setEditableElement(e,t){this._editableElementsMap.set(e,t);if(!t.ckeditorInstance){t.ckeditorInstance=this.editor}}getEditableElement(e=\"main\"){return this._editableElementsMap.get(e)}getEditableElementsNames(){return this._editableElementsMap.keys()}get _editableElements(){console.warn(\"editor-ui-deprecated-editable-elements: \"+\"The EditorUI#_editableElements property has been deprecated and will be removed in the near future.\",{editorUI:this});return this._editableElementsMap}}ks(Ap,ds);function Cp({origin:e,originKeystrokeHandler:t,originFocusTracker:i,toolbar:n,beforeFocus:o,afterBlur:r}){i.add(n.element);t.set(\"Alt+F10\",(e,t)=>{if(i.isFocused&&!n.focusTracker.isFocused){if(o){o()}n.focus();t()}});n.keystrokes.set(\"Esc\",(t,i)=>{if(n.focusTracker.isFocused){e.focus();if(r){r()}i()}})}function Tp(e){if(Array.isArray(e)){return{items:e}}if(!e){return{items:[]}}return Object.assign({items:[]},e)}var Ep=i(17);const Mp=new WeakMap;function Pp(e){const{view:t,element:i,text:n,isDirectHost:o=true}=e;const r=t.document;if(!Mp.has(r)){Mp.set(r,new Map);r.registerPostFixer(e=>Lp(r,e))}Mp.get(r).set(i,{text:n,isDirectHost:o});t.change(e=>Lp(r,e))}function Sp(e,t){const i=t.document;e.change(e=>{if(!Mp.has(i)){return}const n=Mp.get(i);const o=n.get(t);e.removeAttribute(\"data-placeholder\",o.hostElement);Np(e,o.hostElement);n.delete(t)})}function Ip(e,t){if(!t.hasClass(\"ck-placeholder\")){e.addClass(\"ck-placeholder\",t);return true}return false}function Np(e,t){if(t.hasClass(\"ck-placeholder\")){e.removeClass(\"ck-placeholder\",t);return true}return false}function Op(e){if(!e.isAttached()){return false}const t=!Array.from(e.getChildren()).some(e=>!e.is(\"uiElement\"));const i=e.document;if(!i.isFocused&&t){return true}const n=i.selection;const o=n.anchor;if(t&&o&&o.parent!==e){return true}return false}function Lp(e,t){const i=Mp.get(e);let n=false;for(const[e,o]of i){if(Rp(t,e,o)){n=true}}return n}function Rp(e,t,i){const{text:n,isDirectHost:o}=i;const r=o?t:zp(t);let s=false;if(!r){return false}i.hostElement=r;if(r.getAttribute(\"data-placeholder\")!==n){e.setAttribute(\"data-placeholder\",n,r);s=true}if(Op(r)){if(Ip(e,r)){s=true}}else if(Np(e,r)){s=true}return s}function zp(e){if(e.childCount===1){const t=e.getChild(0);if(t.is(\"element\")&&!t.is(\"uiElement\")){return t}}return null}class jp{constructor(){this._replacedElements=[]}replace(e,t){this._replacedElements.push({element:e,newElement:t});e.style.display=\"none\";if(t){e.parentNode.insertBefore(t,e.nextSibling)}}restore(){this._replacedElements.forEach(({element:e,newElement:t})=>{e.style.display=\"\";if(t){t.remove()}});this._replacedElements=[]}}class Dp extends Ap{constructor(e,t){super(e);this.view=t;this._toolbarConfig=Tp(e.config.get(\"toolbar\"));this._elementReplacer=new jp}get element(){return this.view.element}init(e){const t=this.editor;const i=this.view;const n=t.editing.view;const o=i.editable;const 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);if(e){this._elementReplacer.replace(e,this.element)}this._initPlaceholder();this._initToolbar();this.fire(\"ready\")}destroy(){const e=this.view;const t=this.editor.editing.view;this._elementReplacer.restore();t.detachDomRoot(e.editable.name);e.destroy();super.destroy()}_initToolbar(){const e=this.editor;const t=this.view;const i=e.editing.view;t.stickyPanel.bind(\"isActive\").to(this.focusTracker,\"isFocused\");t.stickyPanel.limiterElement=t.element;if(this._toolbarConfig.viewportTopOffset){t.stickyPanel.viewportTopOffset=this._toolbarConfig.viewportTopOffset}t.toolbar.fillFromConfig(this._toolbarConfig.items,this.componentFactory);Cp({origin:i,originFocusTracker:this.focusTracker,originKeystrokeHandler:e.keystrokes,toolbar:t.toolbar})}_initPlaceholder(){const e=this.editor;const t=e.editing.view;const i=t.document.getRoot();const n=e.sourceElement;const o=e.config.get(\"placeholder\")||n&&n.tagName.toLowerCase()===\"textarea\"&&n.getAttribute(\"placeholder\");if(o){Pp({view:t,element:i,text:o,isDirectHost:false})}}}class Bp extends ys{constructor(e){super({idProperty:\"viewUid\"});this.on(\"add\",(e,t,i)=>{if(!t.isRendered){t.render()}if(t.element&&this._parentElement){this._parentElement.insertBefore(t.element,this._parentElement.children[i])}});this.on(\"remove\",(e,t)=>{if(t.element&&this._parentElement){t.element.remove()}});this.locale=e;this._parentElement=null}destroy(){this.map(e=>e.destroy())}setParent(e){this._parentElement=e}delegate(...e){if(!e.length||!Vp(e)){throw new ss[\"b\"](\"ui-viewcollection-delegate-wrong-events: All event names must be strings.\",this)}return{to:t=>{for(const i of this){for(const n of e){i.delegate(n).to(t)}}this.on(\"add\",(i,n)=>{for(const i of e){n.delegate(i).to(t)}});this.on(\"remove\",(i,n)=>{for(const i of e){n.stopDelegating(i,t)}})}}}}function Vp(e){return e.every(e=>typeof e==\"string\")}const Fp=\"http://www.w3.org/1999/xhtml\";class Hp{constructor(e){Object.assign(this,Zp(Kp(e)));this._isRendered=false;this._revertData=null}render(){const e=this._renderNode({intoFragment:true});this._isRendered=true;return e}apply(e){this._revertData=hb();this._renderNode({node:e,isApplying:true,revertData:this._revertData});return e}revert(e){if(!this._revertData){throw new ss[\"b\"](\"ui-template-revert-not-applied: Attempting to revert a template which has not been applied yet.\",[this,e])}this._revertTemplateFromNode(e,this._revertData)}*getViews(){function*e(t){if(t.children){for(const i of t.children){if(lb(i)){yield i}else if(db(i)){yield*e(i)}}}}yield*e(this)}static bind(e,t){return{to(i,n){return new Up({eventNameOrFunction:i,attribute:i,observable:e,emitter:t,callback:n})},if(i,n,o){return new $p({observable:e,emitter:t,attribute:i,valueIfTrue:n,callback:o})}}}static extend(e,t){if(e._isRendered){throw new ss[\"b\"](\"template-extend-render: Attempting to extend a template which has already been rendered.\",[this,e])}ab(e,Zp(Kp(t)))}_renderNode(e){let t;if(e.node){t=this.tag&&this.text}else{t=this.tag?this.text:!this.text}if(t){throw new ss[\"b\"]('ui-template-wrong-syntax: Node definition must have either \"tag\" or \"text\" when rendering a new Node.',this)}if(this.text){return this._renderText(e)}else{return this._renderElement(e)}}_renderElement(e){let t=e.node;if(!t){t=e.node=document.createElementNS(this.ns||Fp,this.tag)}this._renderAttributes(e);this._renderElementChildren(e);this._setUpListeners(e);return t}_renderText(e){let t=e.node;if(t){e.revertData.text=t.textContent}else{t=e.node=document.createTextNode(\"\")}if(qp(this.text)){this._bindToObservable({schema:this.text,updater:Jp(t),data:e})}else{t.textContent=this.text.join(\"\")}return t}_renderAttributes(e){let t,i,n,o;if(!this.attributes){return}const r=e.node;const s=e.revertData;for(t in this.attributes){n=r.getAttribute(t);i=this.attributes[t];if(s){s.attributes[t]=n}o=ce(i[0])&&i[0].ns?i[0].ns:null;if(qp(i)){const a=o?i[0].value:i;if(s&&fb(t)){a.unshift(n)}this._bindToObservable({schema:a,updater:Xp(r,t,o),data:e})}else if(t==\"style\"&&typeof i[0]!==\"string\"){this._renderStyleAttribute(i[0],e)}else{if(s&&n&&fb(t)){i.unshift(n)}i=i.map(e=>e?e.value||e:e).reduce((e,t)=>e.concat(t),[]).reduce(rb,\"\");if(!cb(i)){r.setAttributeNS(o,t,i)}}}}_renderStyleAttribute(e,t){const i=t.node;for(const n in e){const o=e[n];if(qp(o)){this._bindToObservable({schema:[o],updater:Qp(i,n),data:t})}else{i.style[n]=o}}}_renderElementChildren(e){const t=e.node;const i=e.intoFragment?document.createDocumentFragment():t;const n=e.isApplying;let o=0;for(const r of this.children){if(ub(r)){if(!n){r.setParent(t);for(const e of r){i.appendChild(e.element)}}}else if(lb(r)){if(!n){if(!r.isRendered){r.render()}i.appendChild(r.element)}}else if(xd(r)){i.appendChild(r)}else{if(n){const t=e.revertData;const n=hb();t.children.push(n);r._renderNode({node:i.childNodes[o++],isApplying:true,revertData:n})}else{i.appendChild(r.render())}}}if(e.intoFragment){t.appendChild(i)}}_setUpListeners(e){if(!this.eventListeners){return}for(const t in this.eventListeners){const i=this.eventListeners[t].map(i=>{const[n,o]=t.split(\"@\");return i.activateDomEventListener(n,o,e)});if(e.revertData){e.revertData.bindings.push(i)}}}_bindToObservable({schema:e,updater:t,data:i}){const n=i.revertData;Gp(e,t,i);const o=e.filter(e=>!cb(e)).filter(e=>e.observable).map(n=>n.activateAttributeListener(e,t,i));if(n){n.bindings.push(o)}}_revertTemplateFromNode(e,t){for(const e of t.bindings){for(const t of e){t()}}if(t.text){e.textContent=t.text;return}for(const i in t.attributes){const n=t.attributes[i];if(n===null){e.removeAttribute(i)}else{e.setAttribute(i,n)}}for(let i=0;iGp(e,t,i);this.emitter.listenTo(this.observable,\"change:\"+this.attribute,n);return()=>{this.emitter.stopListening(this.observable,\"change:\"+this.attribute,n)}}}class Up extends Wp{activateDomEventListener(e,t,i){const n=(e,i)=>{if(!t||i.target.matches(t)){if(typeof this.eventNameOrFunction==\"function\"){this.eventNameOrFunction(i)}else{this.observable.fire(this.eventNameOrFunction,i)}}};this.emitter.listenTo(i.node,e,n);return()=>{this.emitter.stopListening(i.node,e,n)}}}class $p extends Wp{getValue(e){const t=super.getValue(e);return cb(t)?false:this.valueIfTrue||true}}function qp(e){if(!e){return false}if(e.value){e=e.value}if(Array.isArray(e)){return e.some(qp)}else if(e instanceof Wp){return true}return false}function Yp(e,t){return e.map(e=>{if(e instanceof Wp){return e.getValue(t)}return e})}function Gp(e,t,{node:i}){let n=Yp(e,i);if(e.length==1&&e[0]instanceof $p){n=n[0]}else{n=n.reduce(rb,\"\")}if(cb(n)){t.remove()}else{t.set(n)}}function Jp(e){return{set(t){e.textContent=t},remove(){e.textContent=\"\"}}}function Xp(e,t,i){return{set(n){e.setAttributeNS(i,t,n)},remove(){e.removeAttributeNS(i,t)}}}function Qp(e,t){return{set(i){e.style[t]=i},remove(){e.style[t]=null}}}function Kp(e){const t=qr(e,e=>{if(e&&(e instanceof Wp||db(e)||lb(e)||ub(e))){return e}});return t}function Zp(e){if(typeof e==\"string\"){e=ib(e)}else if(e.text){nb(e)}if(e.on){e.eventListeners=tb(e.on);delete e.on}if(!e.text){if(e.attributes){eb(e.attributes)}const t=[];if(e.children){if(ub(e.children)){t.push(e.children)}else{for(const i of e.children){if(db(i)||lb(i)||xd(i)){t.push(i)}else{t.push(new Hp(i))}}}}e.children=t}return e}function eb(e){for(const t in e){if(e[t].value){e[t].value=[].concat(e[t].value)}ob(e,t)}}function tb(e){for(const t in e){ob(e,t)}return e}function ib(e){return{text:[e]}}function nb(e){if(!Array.isArray(e.text)){e.text=[e.text]}}function ob(e,t){if(!Array.isArray(e[t])){e[t]=[e[t]]}}function rb(e,t){if(cb(t)){return e}else if(cb(e)){return t}else{return`${e} ${t}`}}function sb(e,t){for(const i in t){if(e[i]){e[i].push(...t[i])}else{e[i]=t[i]}}}function ab(e,t){if(t.attributes){if(!e.attributes){e.attributes={}}sb(e.attributes,t.attributes)}if(t.eventListeners){if(!e.eventListeners){e.eventListeners={}}sb(e.eventListeners,t.eventListeners)}if(t.text){e.text.push(...t.text)}if(t.children&&t.children.length){if(e.children.length!=t.children.length){throw new ss[\"b\"](\"ui-template-extend-children-mismatch: The number of children in extended definition does not match.\",e)}let i=0;for(const n of t.children){ab(e.children[i++],n)}}}function cb(e){return!e&&e!==0}function lb(e){return e instanceof gb}function db(e){return e instanceof Hp}function ub(e){return e instanceof Bp}function hb(){return{children:[],bindings:[],attributes:{}}}function fb(e){return e==\"class\"||e==\"style\"}var mb=i(19);class gb{constructor(e){this.element=null;this.isRendered=false;this.locale=e;this.t=e&&e.t;this._viewCollections=new ys;this._unboundChildren=this.createCollection();this._viewCollections.on(\"add\",(t,i)=>{i.locale=e});this.decorate(\"render\")}get bindTemplate(){if(this._bindTemplate){return this._bindTemplate}return this._bindTemplate=Hp.bind(this,this)}createCollection(){const e=new Bp;this._viewCollections.add(e);return e}registerChild(e){if(!Fs(e)){e=[e]}for(const t of e){this._unboundChildren.add(t)}}deregisterChild(e){if(!Fs(e)){e=[e]}for(const t of e){this._unboundChildren.remove(t)}}setTemplate(e){this.template=new Hp(e)}extendTemplate(e){Hp.extend(this.template,e)}render(){if(this.isRendered){throw new ss[\"b\"](\"ui-view-render-already-rendered: This View has already been rendered.\",this)}if(this.template){this.element=this.template.render();this.registerChild(this.template.getViews())}this.isRendered=true}destroy(){this.stopListening();this._viewCollections.map(e=>e.destroy());if(this.template&&this.template._revertData){this.template.revert(this.element)}}}ks(gb,Ud);ks(gb,Jc);var pb=\"[object String]\";function bb(e){return typeof e==\"string\"||!Jt(e)&&T(e)&&v(e)==pb}var wb=bb;function _b(e,t,i={},n=[]){const o=i&&i.xmlns;const r=o?e.createElementNS(o,t):e.createElement(t);for(const e in i){r.setAttribute(e,i[e])}if(wb(n)||!Fs(n)){n=[n]}for(let t of n){if(wb(t)){t=e.createTextNode(t)}r.appendChild(t)}return r}class vb extends Bp{attachToDom(){this._bodyCollectionContainer=new Hp({tag:\"div\",attributes:{class:[\"ck\",\"ck-reset_all\",\"ck-body\",\"ck-rounded-corners\"],dir:this.locale.uiLanguageDirection},children:this}).render();let e=document.querySelector(\".ck-body-wrapper\");if(!e){e=_b(document,\"div\",{class:\"ck-body-wrapper\"});document.body.appendChild(e)}e.appendChild(this._bodyCollectionContainer)}detachFromDom(){super.destroy();if(this._bodyCollectionContainer){this._bodyCollectionContainer.remove()}const e=document.querySelector(\".ck-body-wrapper\");if(e&&e.childElementCount==0){e.remove()}}}var kb=i(21);class yb extends gb{constructor(e){super(e);this.body=new vb(e)}render(){super.render();this.body.attachToDom()}destroy(){this.body.detachFromDom();return super.destroy()}}var xb=i(23);class Ab extends gb{constructor(e){super(e);this.set(\"text\");this.set(\"for\");this.id=`ck-editor__label_${is()}`;const t=this.bindTemplate;this.setTemplate({tag:\"label\",attributes:{class:[\"ck\",\"ck-label\"],id:this.id,for:t.to(\"for\")},children:[{text:t.to(\"text\")}]})}}class Cb extends yb{constructor(e){super(e);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:e.uiLanguageDirection,lang:e.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 e=this.t;const t=new Ab;t.text=e(\"di\");t.extendTemplate({attributes:{class:\"ck-voice-label\"}});return t}}class Tb extends gb{constructor(e,t,i){super(e);this.setTemplate({tag:\"div\",attributes:{class:[\"ck\",\"ck-content\",\"ck-editor__editable\",\"ck-rounded-corners\"],lang:e.contentLanguage,dir:e.contentLanguageDirection}});this.name=null;this.set(\"isFocused\",false);this._editableElement=i;this._hasExternalElement=!!this._editableElement;this._editingView=t}render(){super.render();if(this._hasExternalElement){this.template.apply(this.element=this._editableElement)}else{this._editableElement=this.element}this.on(\"change:isFocused\",()=>this._updateIsFocusedClasses());this._updateIsFocusedClasses()}destroy(){if(this._hasExternalElement){this.template.revert(this._editableElement)}super.destroy()}_updateIsFocusedClasses(){const e=this._editingView;if(e.isRenderingInProgress){i(this)}else{t(this)}function t(t){e.change(i=>{const n=e.document.getRoot(t.name);i.addClass(t.isFocused?\"ck-focused\":\"ck-blurred\",n);i.removeClass(t.isFocused?\"ck-blurred\":\"ck-focused\",n)})}function i(n){e.once(\"change:isRenderingInProgress\",(e,o,r)=>{if(!r){t(n)}else{i(n)}})}}}class Eb extends Tb{constructor(e,t,i){super(e,t,i);this.extendTemplate({attributes:{role:\"textbox\",class:\"ck-editor__editable_inline\"}})}render(){super.render();const e=this._editingView;const t=this.t;e.change(i=>{const n=e.document.getRoot(this.name);i.setAttribute(\"aria-label\",t(\"gj\",[this.name]),n)})}}function Mb(e){return t=>t+e}var Pb=i(25);const Sb=Mb(\"px\");class Ib extends gb{constructor(e){super(e);const t=this.bindTemplate;this.set(\"isActive\",false);this.set(\"isSticky\",false);this.set(\"limiterElement\",null);this.set(\"limiterBottomOffset\",50);this.set(\"viewportTopOffset\",0);this.set(\"_marginLeft\",null);this.set(\"_isStickyToTheLimiter\",false);this.set(\"_hasViewportTopOffset\",false);this.content=this.createCollection();this._contentPanelPlaceholder=new Hp({tag:\"div\",attributes:{class:[\"ck\",\"ck-sticky-panel__placeholder\"],style:{display:t.to(\"isSticky\",e=>e?\"block\":\"none\"),height:t.to(\"isSticky\",e=>e?Sb(this._panelRect.height):null)}}}).render();this._contentPanel=new Hp({tag:\"div\",attributes:{class:[\"ck\",\"ck-sticky-panel__content\",t.if(\"isSticky\",\"ck-sticky-panel__content_sticky\"),t.if(\"_isStickyToTheLimiter\",\"ck-sticky-panel__content_sticky_bottom-limit\")],style:{width:t.to(\"isSticky\",e=>e?Sb(this._contentPanelPlaceholder.getBoundingClientRect().width):null),top:t.to(\"_hasViewportTopOffset\",e=>e?Sb(this.viewportTopOffset):null),bottom:t.to(\"_isStickyToTheLimiter\",e=>e?Sb(this.limiterBottomOffset):null),marginLeft:t.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(Nd.window,\"scroll\",()=>{this._checkIfShouldBeSticky()});this.listenTo(this,\"change:isActive\",()=>{this._checkIfShouldBeSticky()})}_checkIfShouldBeSticky(){const e=this._panelRect=this._contentPanel.getBoundingClientRect();let t;if(!this.limiterElement){this.isSticky=false}else{t=this._limiterRect=this.limiterElement.getBoundingClientRect();this.isSticky=this.isActive&&t.top{this[t]();i()})}}}}get first(){return this.focusables.find(Ob)||null}get last(){return this.focusables.filter(Ob).slice(-1)[0]||null}get next(){return this._getFocusableItem(1)}get previous(){return this._getFocusableItem(-1)}get current(){let e=null;if(this.focusTracker.focusedElement===null){return null}this.focusables.find((t,i)=>{const n=t.element===this.focusTracker.focusedElement;if(n){e=i}return n});return e}focusFirst(){this._focus(this.first)}focusLast(){this._focus(this.last)}focusNext(){this._focus(this.next)}focusPrevious(){this._focus(this.previous)}_focus(e){if(e){e.focus()}}_getFocusableItem(e){const t=this.current;const i=this.focusables.length;if(!i){return null}if(t===null){return this[e===1?\"first\":\"last\"]}let n=(t+i+e)%i;do{const t=this.focusables.get(n);if(Ob(t)){return t}n=(n+i+e)%i}while(n!==t);return null}}function Ob(e){return!!(e.focus&&Nd.window.getComputedStyle(e.element).display!=\"none\")}class Lb extends gb{constructor(e){super(e);this.setTemplate({tag:\"span\",attributes:{class:[\"ck\",\"ck-toolbar__separator\"]}})}}const Rb=100;class zb{constructor(e,t){if(!zb._observerInstance){zb._createObserver()}this._element=e;this._callback=t;zb._addElementCallback(e,t);zb._observerInstance.observe(e)}destroy(){zb._deleteElementCallback(this._element,this._callback)}static _addElementCallback(e,t){if(!zb._elementCallbacks){zb._elementCallbacks=new Map}let i=zb._elementCallbacks.get(e);if(!i){i=new Set;zb._elementCallbacks.set(e,i)}i.add(t)}static _deleteElementCallback(e,t){const i=zb._getElementCallbacks(e);if(i){i.delete(t);if(!i.size){zb._elementCallbacks.delete(e);zb._observerInstance.unobserve(e)}}if(zb._elementCallbacks&&!zb._elementCallbacks.size){zb._observerInstance=null;zb._elementCallbacks=null}}static _getElementCallbacks(e){if(!zb._elementCallbacks){return null}return zb._elementCallbacks.get(e)}static _createObserver(){let e;if(typeof Nd.window.ResizeObserver===\"function\"){e=Nd.window.ResizeObserver}else{e=jb}zb._observerInstance=new e(e=>{for(const t of e){const e=zb._getElementCallbacks(t.target);if(e){for(const i of e){i(t)}}}})}}zb._observerInstance=null;zb._elementCallbacks=null;class jb{constructor(e){this._callback=e;this._elements=new Set;this._previousRects=new Map;this._periodicCheckTimeout=null}observe(e){this._elements.add(e);this._checkElementRectsAndExecuteCallback();if(this._elements.size===1){this._startPeriodicCheck()}}unobserve(e){this._elements.delete(e);this._previousRects.delete(e);if(!this._elements.size){this._stopPeriodicCheck()}}_startPeriodicCheck(){const e=()=>{this._checkElementRectsAndExecuteCallback();this._periodicCheckTimeout=setTimeout(e,Rb)};this.listenTo(Nd.window,\"resize\",()=>{this._checkElementRectsAndExecuteCallback()});this._periodicCheckTimeout=setTimeout(e,Rb)}_stopPeriodicCheck(){clearTimeout(this._periodicCheckTimeout);this.stopListening();this._previousRects.clear()}_checkElementRectsAndExecuteCallback(){const e=[];for(const t of this._elements){if(this._hasRectChanged(t)){e.push({target:t,contentRect:this._previousRects.get(t)})}}if(e.length){this._callback(e)}}_hasRectChanged(e){if(!e.ownerDocument.body.contains(e)){return false}const t=new kh(e);const i=this._previousRects.get(e);const n=!i||!i.isEqual(t);this._previousRects.set(e,t);return n}}ks(jb,Ud);function Db(e){return e.bindTemplate.to(t=>{if(t.target===e.element){t.preventDefault()}})}class Bb extends gb{constructor(e){super(e);const t=this.bindTemplate;this.set(\"isVisible\",false);this.set(\"position\",\"se\");this.children=this.createCollection();this.setTemplate({tag:\"div\",attributes:{class:[\"ck\",\"ck-reset\",\"ck-dropdown__panel\",t.to(\"position\",e=>`ck-dropdown__panel_${e}`),t.if(\"isVisible\",\"ck-dropdown__panel-visible\")]},children:this.children,on:{selectstart:t.to(e=>e.preventDefault())}})}focus(){if(this.children.length){this.children.first.focus()}}focusLast(){if(this.children.length){const e=this.children.last;if(typeof e.focusLast===\"function\"){e.focusLast()}else{e.focus()}}}}var Vb=i(27);function Fb(e){while(e&&e.tagName.toLowerCase()!=\"html\"){if(Nd.window.getComputedStyle(e).position!=\"static\"){return e}e=e.parentElement}return null}function Hb({element:e,target:t,positions:i,limiter:n,fitInViewport:o}){if(me(t)){t=t()}if(me(n)){n=n()}const r=Fb(e.parentElement);const s=new kh(e);const a=new kh(t);let c;let l;if(!n&&!o){[l,c]=Wb(i[0],a,s)}else{const e=n&&new kh(n).getVisible();const t=o&&new kh(Nd.window);[l,c]=Ub(i,a,s,e,t)||Wb(i[0],a,s)}let{left:d,top:u}=$b(c);if(r){const e=$b(new kh(r));const t=_h(r);d-=e.left;u-=e.top;d+=r.scrollLeft;u+=r.scrollTop;d-=t.left;u-=t.top}return{left:d,top:u,name:l}}function Wb(e,t,i){const{left:n,top:o,name:r}=e(t,i);return[r,i.clone().moveTo(n,o)]}function Ub(e,t,i,n,o){let r=0;let s=0;let a;let c;const l=i.getArea();e.some(e=>{const[d,u]=Wb(e,t,i);let h;let f;if(n){if(o){const e=n.getIntersection(o);if(e){h=e.getIntersectionArea(u)}else{h=0}}else{h=n.getIntersectionArea(u)}}if(o){f=o.getIntersectionArea(u)}if(o&&!n){if(f>s){m()}}else if(!o&&n){if(h>r){m()}}else{if(f>s&&h>=r){m()}else if(f>=s&&h>r){m()}}function m(){s=f;r=h;a=u;c=d}return h===l});return a?[c,a]:null}function $b({left:e,top:t}){const{scrollX:i,scrollY:n}=Nd.window;return{left:e+i,top:t+n}}class qb extends gb{constructor(e,t,i){super(e);const n=this.bindTemplate;this.buttonView=t;this.panelView=i;this.set(\"isOpen\",false);this.set(\"isEnabled\",true);this.set(\"class\");this.set(\"id\");this.set(\"panelPosition\",\"auto\");this.focusTracker=new xp;this.keystrokes=new dp;this.setTemplate({tag:\"div\",attributes:{class:[\"ck\",\"ck-dropdown\",n.to(\"class\"),n.if(\"isEnabled\",\"ck-disabled\",e=>!e)],id:n.to(\"id\"),\"aria-describedby\":n.to(\"ariaDescribedById\")},children:[t,i]});t.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\",()=>{if(!this.isOpen){return}if(this.panelPosition===\"auto\"){this.panelView.position=qb._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:true,positions:this._panelPositions}).name}else{this.panelView.position=this.panelPosition}});this.keystrokes.listenTo(this.element);this.focusTracker.add(this.element);const e=(e,t)=>{if(this.isOpen){this.buttonView.focus();this.isOpen=false;t()}};this.keystrokes.set(\"arrowdown\",(e,t)=>{if(this.buttonView.isEnabled&&!this.isOpen){this.isOpen=true;t()}});this.keystrokes.set(\"arrowright\",(e,t)=>{if(this.isOpen){t()}});this.keystrokes.set(\"arrowleft\",e);this.keystrokes.set(\"esc\",e)}focus(){this.buttonView.focus()}get _panelPositions(){const{southEast:e,southWest:t,northEast:i,northWest:n}=qb.defaultPanelPositions;if(this.locale.uiLanguageDirection===\"ltr\"){return[e,t,i,n]}else{return[t,e,n,i]}}}qb.defaultPanelPositions={southEast:e=>({top:e.bottom,left:e.left,name:\"se\"}),southWest:(e,t)=>({top:e.bottom,left:e.left-t.width+e.width,name:\"sw\"}),northEast:(e,t)=>({top:e.top-t.height,left:e.left,name:\"ne\"}),northWest:(e,t)=>({top:e.bottom-t.height,left:e.left-t.width+e.width,name:\"nw\"})};qb._getOptimalPosition=Hb;var Yb=i(29);class Gb extends gb{constructor(){super();const e=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:e.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 e=(new DOMParser).parseFromString(this.content.trim(),\"image/svg+xml\");const t=e.querySelector(\"svg\");const i=t.getAttribute(\"viewBox\");if(i){this.viewBox=i}this.element.innerHTML=\"\";while(t.childNodes.length>0){this.element.appendChild(t.childNodes[0])}}}_colorFillPaths(){if(this.fillColor){this.element.querySelectorAll(\".ck-icon__fill\").forEach(e=>{e.style.fill=this.fillColor})}}}var Jb=i(31);class Xb extends gb{constructor(e){super(e);this.set(\"text\",\"\");this.set(\"position\",\"s\");const t=this.bindTemplate;this.setTemplate({tag:\"span\",attributes:{class:[\"ck\",\"ck-tooltip\",t.to(\"position\",e=>\"ck-tooltip_\"+e),t.if(\"text\",\"ck-hidden\",e=>!e.trim())]},children:[{tag:\"span\",attributes:{class:[\"ck\",\"ck-tooltip__text\"]},children:[{text:t.to(\"text\")}]}]})}}var Qb=i(33);class Kb extends gb{constructor(e){super(e);const t=this.bindTemplate;const i=is();this.set(\"class\");this.set(\"labelStyle\");this.set(\"icon\");this.set(\"isEnabled\",true);this.set(\"isOn\",false);this.set(\"isVisible\",true);this.set(\"isToggleable\",false);this.set(\"keystroke\");this.set(\"label\");this.set(\"tabindex\",-1);this.set(\"tooltip\");this.set(\"tooltipPosition\",\"s\");this.set(\"type\",\"button\");this.set(\"withText\",false);this.set(\"withKeystroke\",false);this.children=this.createCollection();this.tooltipView=this._createTooltipView();this.labelView=this._createLabelView(i);this.iconView=new Gb;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\",t.to(\"class\"),t.if(\"isEnabled\",\"ck-disabled\",e=>!e),t.if(\"isVisible\",\"ck-hidden\",e=>!e),t.to(\"isOn\",e=>e?\"ck-on\":\"ck-off\"),t.if(\"withText\",\"ck-button_with-text\"),t.if(\"withKeystroke\",\"ck-button_with-keystroke\")],type:t.to(\"type\",e=>e?e:\"button\"),tabindex:t.to(\"tabindex\"),\"aria-labelledby\":`ck-editor__aria-label_${i}`,\"aria-disabled\":t.if(\"isEnabled\",true,e=>!e),\"aria-pressed\":t.to(\"isOn\",e=>this.isToggleable?String(e):false)},children:this.children,on:{mousedown:t.to(e=>{e.preventDefault()}),click:t.to(e=>{if(this.isEnabled){this.fire(\"execute\")}else{e.preventDefault()}})}})}render(){super.render();if(this.icon){this.iconView.bind(\"content\").to(this,\"icon\");this.children.add(this.iconView)}this.children.add(this.tooltipView);this.children.add(this.labelView);if(this.withKeystroke){this.children.add(this.keystrokeView)}}focus(){this.element.focus()}_createTooltipView(){const e=new Xb;e.bind(\"text\").to(this,\"_tooltipString\");e.bind(\"position\").to(this,\"tooltipPosition\");return e}_createLabelView(e){const t=new gb;const i=this.bindTemplate;t.setTemplate({tag:\"span\",attributes:{class:[\"ck\",\"ck-button__label\"],style:i.to(\"labelStyle\"),id:`ck-editor__aria-label_${e}`},children:[{text:this.bindTemplate.to(\"label\")}]});return t}_createKeystrokeView(){const e=new gb;e.setTemplate({tag:\"span\",attributes:{class:[\"ck\",\"ck-button__keystroke\"]},children:[{text:this.bindTemplate.to(\"keystroke\",e=>jl(e))}]});return e}_getTooltipString(e,t,i){if(e){if(typeof e==\"string\"){return e}else{if(i){i=jl(i)}if(e instanceof Function){return e(t,i)}else{return`${t}${i?` (${i})`:\"\"}`}}}return\"\"}}var Zb='';class ew extends Kb{constructor(e){super(e);this.arrowView=this._createArrowView();this.extendTemplate({attributes:{\"aria-haspopup\":true}});this.delegate(\"execute\").to(this,\"open\")}render(){super.render();this.children.add(this.arrowView)}_createArrowView(){const e=new Gb;e.content=Zb;e.extendTemplate({attributes:{class:\"ck-dropdown__arrow\"}});return e}}var tw=i(35);class iw extends gb{constructor(){super();this.items=this.createCollection();this.focusTracker=new xp;this.keystrokes=new dp;this._focusCycler=new Nb({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 e of this.items){this.focusTracker.add(e.element)}this.items.on(\"add\",(e,t)=>{this.focusTracker.add(t.element)});this.items.on(\"remove\",(e,t)=>{this.focusTracker.remove(t.element)});this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}}class nw extends gb{constructor(e){super(e);this.children=this.createCollection();this.setTemplate({tag:\"li\",attributes:{class:[\"ck\",\"ck-list__item\"]},children:this.children})}focus(){this.children.first.focus()}}class ow extends gb{constructor(e){super(e);this.setTemplate({tag:\"li\",attributes:{class:[\"ck\",\"ck-list__separator\"]}})}}var rw=i(37);class sw extends Kb{constructor(e){super(e);this.isToggleable=true;this.toggleSwitchView=this._createToggleView();this.extendTemplate({attributes:{class:\"ck-switchbutton\"}})}render(){super.render();this.children.add(this.toggleSwitchView)}_createToggleView(){const e=new gb;e.setTemplate({tag:\"span\",attributes:{class:[\"ck\",\"ck-button__toggle\"]},children:[{tag:\"span\",attributes:{class:[\"ck\",\"ck-button__toggle__inner\"]}}]});return e}}function aw({emitter:e,activator:t,callback:i,contextElements:n}){e.listenTo(document,\"mousedown\",(e,{target:o})=>{if(!t()){return}for(const e of n){if(e.contains(o)){return}}i()})}var cw=i(39);var lw=i(41);function dw(e,t=ew){const i=new t(e);const n=new Bb(e);const o=new qb(e,i,n);i.bind(\"isEnabled\").to(o);if(i instanceof ew){i.bind(\"isOn\").to(o,\"isOpen\")}else{i.arrowView.bind(\"isOn\").to(o,\"isOpen\")}fw(o);return o}function uw(e,t){const i=e.locale;const n=i.t;const o=e.toolbarView=new _w(i);o.set(\"ariaLabel\",n(\"dh\"));e.extendTemplate({attributes:{class:[\"ck-toolbar-dropdown\"]}});t.map(e=>o.items.add(e));e.panelView.children.add(o);o.items.delegate(\"execute\").to(e)}function hw(e,t){const i=e.locale;const n=e.listView=new iw(i);n.items.bindTo(t).using(({type:e,model:t})=>{if(e===\"separator\"){return new ow(i)}else if(e===\"button\"||e===\"switchbutton\"){const n=new nw(i);let o;if(e===\"button\"){o=new Kb(i)}else{o=new sw(i)}o.bind(...Object.keys(t)).to(t);o.delegate(\"execute\").to(n);n.children.add(o);return n}});e.panelView.children.add(n);n.items.delegate(\"execute\").to(e)}function fw(e){mw(e);gw(e);pw(e)}function mw(e){e.on(\"render\",()=>{aw({emitter:e,activator:()=>e.isOpen,callback:()=>{e.isOpen=false},contextElements:[e.element]})})}function gw(e){e.on(\"execute\",t=>{if(t.source instanceof sw){return}e.isOpen=false})}function pw(e){e.keystrokes.set(\"arrowdown\",(t,i)=>{if(e.isOpen){e.panelView.focus();i()}});e.keystrokes.set(\"arrowup\",(t,i)=>{if(e.isOpen){e.panelView.focusLast();i()}})}var bw='';var ww=i(43);class _w extends gb{constructor(e,t){super(e);const i=this.bindTemplate;const n=this.t;this.options=t||{};this.set(\"ariaLabel\",n(\"ei\"));this.set(\"maxWidth\",\"auto\");this.items=this.createCollection();this.focusTracker=new xp;this.keystrokes=new dp;this.set(\"class\");this.set(\"isCompact\",false);this.itemsView=new vw(e);this.children=this.createCollection();this.children.add(this.itemsView);this.focusables=this.createCollection();this._focusCycler=new Nb({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:[\"arrowleft\",\"arrowup\"],focusNext:[\"arrowright\",\"arrowdown\"]}});this.setTemplate({tag:\"div\",attributes:{class:[\"ck\",\"ck-toolbar\",i.to(\"class\"),i.if(\"isCompact\",\"ck-toolbar_compact\")],role:\"toolbar\",\"aria-label\":i.to(\"ariaLabel\"),style:{maxWidth:i.to(\"maxWidth\")}},children:this.children,on:{mousedown:Db(this)}});this._behavior=this.options.shouldGroupWhenFull?new yw(this):new kw(this)}render(){super.render();for(const e of this.items){this.focusTracker.add(e.element)}this.items.on(\"add\",(e,t)=>{this.focusTracker.add(t.element)});this.items.on(\"remove\",(e,t)=>{this.focusTracker.remove(t.element)});this.keystrokes.listenTo(this.element);this._behavior.render(this)}destroy(){this._behavior.destroy();return super.destroy()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}fillFromConfig(e,t){e.map(e=>{if(e==\"|\"){this.items.add(new Lb)}else if(t.has(e)){this.items.add(t.create(e))}else{console.warn(Object(ss[\"a\"])(\"toolbarview-item-unavailable: The requested toolbar item is unavailable.\"),{name:e})}})}}class vw extends gb{constructor(e){super(e);this.children=this.createCollection();this.setTemplate({tag:\"div\",attributes:{class:[\"ck\",\"ck-toolbar__items\"]},children:this.children})}}class kw{constructor(e){const t=e.bindTemplate;e.set(\"isVertical\",false);e.itemsView.children.bindTo(e.items).using(e=>e);e.focusables.bindTo(e.items).using(e=>e);e.extendTemplate({attributes:{class:[t.if(\"isVertical\",\"ck-toolbar_vertical\")]}})}render(){}destroy(){}}class yw{constructor(e){this.viewChildren=e.children;this.viewFocusables=e.focusables;this.viewItemsView=e.itemsView;this.viewFocusTracker=e.focusTracker;this.viewLocale=e.locale;this.ungroupedItems=e.createCollection();this.groupedItems=e.createCollection();this.groupedItemsDropdown=this._createGroupedItemsDropdown();this.resizeObserver=null;this.cachedPadding=null;e.itemsView.children.bindTo(this.ungroupedItems).using(e=>e);this.ungroupedItems.on(\"add\",this._updateFocusCycleableItems.bind(this));this.ungroupedItems.on(\"remove\",this._updateFocusCycleableItems.bind(this));e.children.on(\"add\",this._updateFocusCycleableItems.bind(this));e.children.on(\"remove\",this._updateFocusCycleableItems.bind(this));e.items.on(\"add\",(e,t,i)=>{if(i>this.ungroupedItems.length){this.groupedItems.add(t,i-this.ungroupedItems.length)}else{this.ungroupedItems.add(t,i)}this._updateGrouping()});e.items.on(\"remove\",(e,t,i)=>{if(i>this.ungroupedItems.length){this.groupedItems.remove(t)}else{this.ungroupedItems.remove(t)}this._updateGrouping()});e.extendTemplate({attributes:{class:[\"ck-toolbar_grouping\"]}})}render(e){this.viewElement=e.element;this._enableGroupingOnResize();this._enableGroupingOnMaxWidthChange(e)}destroy(){this.groupedItemsDropdown.destroy();this.resizeObserver.destroy()}_updateGrouping(){if(!this.viewElement.ownerDocument.body.contains(this.viewElement)){return}let e;while(this._areItemsOverflowing){this._groupLastItem();e=true}if(!e&&this.groupedItems.length){while(this.groupedItems.length&&!this._areItemsOverflowing){this._ungroupFirstItem()}if(this._areItemsOverflowing){this._groupLastItem()}}}get _areItemsOverflowing(){if(!this.ungroupedItems.length){return false}const e=this.viewElement;const t=this.viewLocale.uiLanguageDirection;const i=new kh(e.lastChild);const n=new kh(e);if(!this.cachedPadding){const i=Nd.window.getComputedStyle(e);const n=t===\"ltr\"?\"paddingRight\":\"paddingLeft\";this.cachedPadding=Number.parseInt(i[n])}if(t===\"ltr\"){return i.right>n.right-this.cachedPadding}else{return i.left{if(!e||e!==t.contentRect.width){this._updateGrouping();e=t.contentRect.width}});this._updateGrouping()}_enableGroupingOnMaxWidthChange(e){e.on(\"change:maxWidth\",()=>{this._updateGrouping()})}_groupLastItem(){if(!this.groupedItems.length){this.viewChildren.add(new Lb);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));if(!this.groupedItems.length){this.viewChildren.remove(this.groupedItemsDropdown);this.viewChildren.remove(this.viewChildren.last);this.viewFocusTracker.remove(this.groupedItemsDropdown.element)}}_createGroupedItemsDropdown(){const e=this.viewLocale;const t=e.t;const i=dw(e);i.class=\"ck-toolbar__grouped-dropdown\";i.panelPosition=e.uiLanguageDirection===\"ltr\"?\"sw\":\"se\";uw(i,[]);i.buttonView.set({label:t(\"ej\"),tooltip:true,icon:bw});i.toolbarView.items.bindTo(this.groupedItems).using(e=>e);return i}_updateFocusCycleableItems(){this.viewFocusables.clear();this.ungroupedItems.map(e=>{this.viewFocusables.add(e)});if(this.groupedItems.length){this.viewFocusables.add(this.groupedItemsDropdown)}}}var xw=i(45);class Aw extends Cb{constructor(e,t,i={}){super(e);this.stickyPanel=new Ib(e);this.toolbar=new _w(e,{shouldGroupWhenFull:i.shouldToolbarGroupWhenFull});this.editable=new Eb(e,t)}render(){super.render();this.stickyPanel.content.add(this.toolbar);this.top.add(this.stickyPanel);this.main.add(this.editable)}}function Cw(e){if(e instanceof HTMLTextAreaElement){return e.value}return e.innerHTML}class Tw extends hp{constructor(e,t){super(t);if(Gr(e)){this.sourceElement=e}this.data.processor=new vp(this.data.viewDocument);this.model.document.createRoot();const i=!this.config.get(\"toolbar.shouldNotGroupWhenFull\");const n=new Aw(this.locale,this.editing.view,{shouldToolbarGroupWhenFull:i});this.ui=new Dp(this,n);wp(this)}destroy(){if(this.sourceElement){this.updateSourceElement()}this.ui.destroy();return super.destroy()}static create(e,t={}){return new Promise(i=>{const n=new this(e,t);i(n.initPlugins().then(()=>n.ui.init(Gr(e)?e:null)).then(()=>{if(!Gr(e)&&t.initialData){throw new ss[\"b\"](\"editor-create-initial-data: \"+\"The config.initialData option cannot be used together with initial data passed in Editor.create().\",null)}const i=t.initialData||Ew(e);return n.data.init(i)}).then(()=>n.fire(\"ready\")).then(()=>n))})}}ks(Tw,mp);ks(Tw,bp);function Ew(e){return Gr(e)?Cw(e):e}class Mw{static get pluginName(){return\"BlockAutoformatEditing\"}constructor(e,t,i){let n;let o=null;if(typeof i==\"function\"){n=i}else{o=e.commands.get(i);n=()=>{e.execute(i)}}e.model.document.on(\"change\",(i,r)=>{if(o&&!o.isEnabled){return}if(r.type==\"transparent\"){return}const s=Array.from(e.model.document.differ.getChanges());const a=s[0];if(s.length!=1||a.type!==\"insert\"||a.name!=\"$text\"||a.length!=1){return}const c=a.position.parent;if(!c.is(\"paragraph\")||c.childCount!==1){return}const l=t.exec(c.getChild(0).data);if(!l){return}e.model.enqueueChange(e=>{const t=e.createPositionAt(c,0);const i=e.createPositionAt(c,l[0].length);const o=new rf(t,i);const r=n({match:l});if(r!==false){e.remove(o)}o.detach()})})}}function Pw(e,t){let i=e.start;const n=Array.from(e.getItems()).reduce((e,n)=>{if(!(n.is(\"text\")||n.is(\"textProxy\"))){i=t.createPositionAfter(n);return\"\"}return e+n.data},\"\");return{text:n,range:t.createRange(i,e.end)}}class Sw{static get pluginName(){return\"InlineAutoformatEditing\"}constructor(e,t,i){let n;let o;let r;let s;if(t instanceof RegExp){n=t}else{r=t}if(typeof i==\"string\"){o=i}else{s=i}r=r||(e=>{let t;const i=[];const o=[];while((t=n.exec(e))!==null){if(t&&t.length<4){break}let{index:e,1:n,2:r,3:s}=t;const a=n+r+s;e+=t[0].length-a.length;const c=[e,e+n.length];const l=[e+n.length+r.length,e+n.length+r.length+s.length];i.push(c);i.push(l);o.push([e+n.length,e+n.length+r.length])}return{remove:i,format:o}});s=s||((t,i)=>{const n=e.model.schema.getValidRanges(i,o);for(const e of n){t.setAttribute(o,true,e)}t.removeSelectionAttribute(o)});e.model.document.on(\"change\",(t,i)=>{if(i.type==\"transparent\"){return}const n=e.model;const o=n.document.selection;if(!o.isCollapsed){return}const a=Array.from(n.document.differ.getChanges());const c=a[0];if(a.length!=1||c.type!==\"insert\"||c.name!=\"$text\"||c.length!=1){return}const l=o.focus;const d=l.parent;const{text:u,range:h}=Pw(n.createRange(n.createPositionAt(d,0),l),n);const f=r(u);const m=Iw(h.start,f.format,n);const g=Iw(h.start,f.remove,n);if(!(m.length&&g.length)){return}n.enqueueChange(e=>{const t=s(e,m);if(t===false){return}for(const t of g.reverse()){e.remove(t)}})})}}function Iw(e,t,i){return t.filter(e=>e[0]!==undefined&&e[1]!==undefined).map(t=>i.createRange(e.getShiftedBy(t[0]),e.getShiftedBy(t[1])))}class Nw{constructor(e){this.editor=e;this.set(\"isEnabled\",true);this._disableStack=new Set}forceDisabled(e){this._disableStack.add(e);if(this._disableStack.size==1){this.on(\"set:isEnabled\",Ow,{priority:\"highest\"});this.isEnabled=false}}clearForceDisabled(e){this._disableStack.delete(e);if(this._disableStack.size==0){this.off(\"set:isEnabled\",Ow);this.isEnabled=true}}destroy(){this.stopListening()}static get isContextPlugin(){return false}}ks(Nw,Jc);function Ow(e){e.return=false;e.stop()}class Lw extends Nw{static get pluginName(){return\"Autoformat\"}afterInit(){this._addListAutoformats();this._addBasicStylesAutoformats();this._addHeadingAutoformats();this._addBlockQuoteAutoformats();this._addCodeBlockAutoformats()}_addListAutoformats(){const e=this.editor.commands;if(e.get(\"bulletedList\")){new Mw(this.editor,/^[*-]\\s$/,\"bulletedList\")}if(e.get(\"numberedList\")){new Mw(this.editor,/^1[.|)]\\s$/,\"numberedList\")}}_addBasicStylesAutoformats(){const e=this.editor.commands;if(e.get(\"bold\")){const e=Rw(this.editor,\"bold\");new Sw(this.editor,/(\\*\\*)([^*]+)(\\*\\*)$/g,e);new Sw(this.editor,/(__)([^_]+)(__)$/g,e)}if(e.get(\"italic\")){const e=Rw(this.editor,\"italic\");new Sw(this.editor,/(?:^|[^*])(\\*)([^*_]+)(\\*)$/g,e);new Sw(this.editor,/(?:^|[^_])(_)([^_]+)(_)$/g,e)}if(e.get(\"code\")){const e=Rw(this.editor,\"code\");new Sw(this.editor,/(`)([^`]+)(`)$/g,e)}}_addHeadingAutoformats(){const e=this.editor.commands.get(\"heading\");if(e){e.modelElements.filter(e=>e.match(/^heading[1-6]$/)).forEach(t=>{const i=t[7];const n=new RegExp(`^(#{${i}})\\\\s$`);new Mw(this.editor,n,()=>{if(!e.isEnabled){return false}this.editor.execute(\"heading\",{value:t})})})}}_addBlockQuoteAutoformats(){if(this.editor.commands.get(\"blockQuote\")){new Mw(this.editor,/^>\\s$/,\"blockQuote\")}}_addCodeBlockAutoformats(){if(this.editor.commands.get(\"codeBlock\")){new Mw(this.editor,/^```$/,\"codeBlock\")}}}function Rw(e,t){return(i,n)=>{const o=e.commands.get(t);if(!o.isEnabled){return false}const r=e.model.schema.getValidRanges(n,t);for(const e of r){i.setAttribute(t,true,e)}i.removeSelectionAttribute(t)}}class zw{constructor(e){this.editor=e;this.set(\"value\",undefined);this.set(\"isEnabled\",false);this._disableStack=new Set;this.decorate(\"execute\");this.listenTo(this.editor.model.document,\"change\",()=>{this.refresh()});this.on(\"execute\",e=>{if(!this.isEnabled){e.stop()}},{priority:\"high\"});this.listenTo(e,\"change:isReadOnly\",(e,t,i)=>{if(i){this.forceDisabled(\"readOnlyMode\")}else{this.clearForceDisabled(\"readOnlyMode\")}})}refresh(){this.isEnabled=true}forceDisabled(e){this._disableStack.add(e);if(this._disableStack.size==1){this.on(\"set:isEnabled\",jw,{priority:\"highest\"});this.isEnabled=false}}clearForceDisabled(e){this._disableStack.delete(e);if(this._disableStack.size==0){this.off(\"set:isEnabled\",jw);this.refresh()}}execute(){}destroy(){this.stopListening()}}ks(zw,Jc);function jw(e){e.return=false;e.stop()}function Dw(e){const t=e.next();if(t.done){return null}return t.value}class Bw extends zw{refresh(){this.value=this._getValue();this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor.model;const i=t.schema;const n=t.document.selection;const o=Array.from(n.getSelectedBlocks());const r=e.forceValue===undefined?!this.value:e.forceValue;t.change(e=>{if(!r){this._removeQuote(e,o.filter(Vw))}else{const t=o.filter(e=>Vw(e)||Hw(i,e));this._applyQuote(e,t)}})}_getValue(){const e=this.editor.model.document.selection;const t=Dw(e.getSelectedBlocks());return!!(t&&Vw(t))}_checkEnabled(){if(this.value){return true}const e=this.editor.model.document.selection;const t=this.editor.model.schema;const i=Dw(e.getSelectedBlocks());if(!i){return false}return Hw(t,i)}_removeQuote(e,t){Fw(e,t).reverse().forEach(t=>{if(t.start.isAtStart&&t.end.isAtEnd){e.unwrap(t.start.parent);return}if(t.start.isAtStart){const i=e.createPositionBefore(t.start.parent);e.move(t,i);return}if(!t.end.isAtEnd){e.split(t.end)}const i=e.createPositionAfter(t.end.parent);e.move(t,i)})}_applyQuote(e,t){const i=[];Fw(e,t).reverse().forEach(t=>{let n=Vw(t.start);if(!n){n=e.createElement(\"blockQuote\");e.wrap(t,n)}i.push(n)});i.reverse().reduce((t,i)=>{if(t.nextSibling==i){e.merge(e.createPositionAfter(t));return t}return i})}}function Vw(e){return e.parent.name==\"blockQuote\"?e.parent:null}function Fw(e,t){let i;let n=0;const o=[];while(n{if(e.endsWith(\"blockQuote\")&&t.name==\"blockQuote\"){return false}});e.conversion.elementToElement({model:\"blockQuote\",view:\"blockquote\"});e.model.document.registerPostFixer(i=>{const n=e.model.document.differ.getChanges();for(const e of n){if(e.type==\"insert\"){const n=e.position.nodeAfter;if(!n){continue}if(n.is(\"blockQuote\")&&n.isEmpty){i.remove(n);return true}else if(n.is(\"blockQuote\")&&!t.checkChild(e.position,n)){i.unwrap(n);return true}else if(n.is(\"element\")){const e=i.createRangeIn(n);for(const n of e.getItems()){if(n.is(\"blockQuote\")&&!t.checkChild(i.createPositionBefore(n),n)){i.unwrap(n);return true}}}}else if(e.type==\"remove\"){const t=e.position.parent;if(t.is(\"blockQuote\")&&t.isEmpty){i.remove(t);return true}}}return false})}afterInit(){const e=this.editor;const t=e.commands.get(\"blockQuote\");this.listenTo(this.editor.editing.view.document,\"enter\",(e,i)=>{const n=this.editor.model.document;const o=n.selection.getLastPosition().parent;if(n.selection.isCollapsed&&o.isEmpty&&t.value){this.editor.execute(\"blockQuote\");this.editor.editing.view.scrollToTheSelection();i.preventDefault();e.stop()}})}}var Uw='';var $w=i(47);class qw extends Nw{init(){const e=this.editor;const t=e.t;e.ui.componentFactory.add(\"blockQuote\",i=>{const n=e.commands.get(\"blockQuote\");const o=new Kb(i);o.set({label:t(\"bg\"),icon:Uw,tooltip:true,isToggleable:true});o.bind(\"isOn\",\"isEnabled\").to(n,\"value\",\"isEnabled\");this.listenTo(o,\"execute\",()=>{e.execute(\"blockQuote\");e.editing.view.focus()});return o})}}class Yw extends Nw{static get requires(){return[Ww,qw]}static get pluginName(){return\"BlockQuote\"}}class Gw extends zw{constructor(e,t){super(e);this.attributeKey=t}refresh(){const e=this.editor.model;const t=e.document;this.value=this._getValueFromFirstAllowedNode();this.isEnabled=e.schema.checkAttributeInSelection(t.selection,this.attributeKey)}execute(e={}){const t=this.editor.model;const i=t.document;const n=i.selection;const o=e.forceValue===undefined?!this.value:e.forceValue;t.change(e=>{if(n.isCollapsed){if(o){e.setSelectionAttribute(this.attributeKey,true)}else{e.removeSelectionAttribute(this.attributeKey)}}else{const i=t.schema.getValidRanges(n.getRanges(),this.attributeKey);for(const t of i){if(o){e.setAttribute(this.attributeKey,o,t)}else{e.removeAttribute(this.attributeKey,t)}}}})}_getValueFromFirstAllowedNode(){const e=this.editor.model;const t=e.schema;const i=e.document.selection;if(i.isCollapsed){return i.hasAttribute(this.attributeKey)}for(const e of i.getRanges()){for(const i of e.getItems()){if(t.checkAttribute(i,this.attributeKey)){return i.hasAttribute(this.attributeKey)}}}return false}}const Jw=\"bold\";class Xw extends Nw{static get pluginName(){return\"BoldEditing\"}init(){const e=this.editor;e.model.schema.extend(\"$text\",{allowAttributes:Jw});e.model.schema.setAttributeProperties(Jw,{isFormatting:true,copyOnEnter:true});e.conversion.attributeToElement({model:Jw,view:\"strong\",upcastAlso:[\"b\",e=>{const t=e.getStyle(\"font-weight\");if(!t){return null}if(t==\"bold\"||Number(t)>=600){return{name:true,styles:[\"font-weight\"]}}}]});e.commands.add(Jw,new Gw(e,Jw));e.keystrokes.set(\"CTRL+B\",Jw)}}var Qw='';const Kw=\"bold\";class Zw extends Nw{init(){const e=this.editor;const t=e.t;e.ui.componentFactory.add(Kw,i=>{const n=e.commands.get(Kw);const o=new Kb(i);o.set({label:t(\"bs\"),icon:Qw,keystroke:\"CTRL+B\",tooltip:true,isToggleable:true});o.bind(\"isOn\",\"isEnabled\").to(n,\"value\",\"isEnabled\");this.listenTo(o,\"execute\",()=>{e.execute(Kw);e.editing.view.focus()});return o})}}class e_ extends Nw{static get requires(){return[Xw,Zw]}static get pluginName(){return\"Bold\"}}class t_ extends zw{refresh(){const e=this.editor.model;const t=e.document;const i=Dw(t.selection.getSelectedBlocks());this.value=!!i&&i.is(\"paragraph\");this.isEnabled=!!i&&i_(i,e.schema)}execute(e={}){const t=this.editor.model;const i=t.document;t.change(n=>{const o=(e.selection||i.selection).getSelectedBlocks();for(const e of o){if(!e.is(\"paragraph\")&&i_(e,t.schema)){n.rename(e,\"paragraph\")}}})}}function i_(e,t){return t.checkChild(e.parent,\"paragraph\")&&!t.isObject(e)}class n_ extends Nw{static get pluginName(){return\"Paragraph\"}init(){const e=this.editor;const t=e.model;const i=e.data;e.commands.add(\"paragraph\",new t_(e));t.schema.register(\"paragraph\",{inheritAllFrom:\"$block\"});e.conversion.elementToElement({model:\"paragraph\",view:\"p\"});e.conversion.for(\"upcast\").elementToElement({model:(e,t)=>{if(!n_.paragraphLikeElements.has(e.name)){return null}if(e.isEmpty){return null}return t.createElement(\"paragraph\")},converterPriority:\"low\"});i.upcastDispatcher.on(\"element\",(e,t,i)=>{if(!i.consumable.test(t.viewItem,{name:t.viewItem.name})){return}if(r_(t.viewItem,t.modelCursor,i.schema)){Object.assign(t,o_(t.viewItem,t.modelCursor,i))}},{priority:\"low\"});i.upcastDispatcher.on(\"text\",(e,t,i)=>{if(t.modelRange){return}if(r_(t.viewItem,t.modelCursor,i.schema)){Object.assign(t,o_(t.viewItem,t.modelCursor,i))}},{priority:\"lowest\"});t.document.registerPostFixer(e=>this._autoparagraphEmptyRoots(e));e.data.on(\"ready\",()=>{t.enqueueChange(\"transparent\",e=>this._autoparagraphEmptyRoots(e))},{priority:\"lowest\"})}_autoparagraphEmptyRoots(e){const t=this.editor.model;for(const i of t.document.getRootNames()){const n=t.document.getRoot(i);if(n.isEmpty&&n.rootName!=\"$graveyard\"){if(t.schema.checkChild(n,\"paragraph\")){e.insertElement(\"paragraph\",n);return true}}}}}n_.paragraphLikeElements=new Set([\"blockquote\",\"dd\",\"div\",\"dt\",\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\",\"li\",\"p\",\"td\"]);function o_(e,t,i){const n=i.writer.createElement(\"paragraph\");i.writer.insert(n,t);return i.convertItem(e,i.writer.createPositionAt(n,0))}function r_(e,t,i){const n=i.createContext(t);if(!i.checkChild(n,\"paragraph\")){return false}if(!i.checkChild(n.push(\"paragraph\"),e)){return false}return true}class s_ extends zw{constructor(e,t){super(e);this.modelElements=t}refresh(){const e=Dw(this.editor.model.document.selection.getSelectedBlocks());this.value=!!e&&this.modelElements.includes(e.name)&&e.name;this.isEnabled=!!e&&this.modelElements.some(t=>a_(e,t,this.editor.model.schema))}execute(e){const t=this.editor.model;const i=t.document;const n=e.value;t.change(e=>{const o=Array.from(i.selection.getSelectedBlocks()).filter(e=>a_(e,n,t.schema));for(const t of o){if(!t.is(n)){e.rename(t,n)}}})}}function a_(e,t,i){return i.checkChild(e.parent,t)&&!i.isObject(e)}const c_=\"paragraph\";class l_ extends Nw{static get pluginName(){return\"HeadingEditing\"}constructor(e){super(e);e.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[n_]}init(){const e=this.editor;const t=e.config.get(\"heading.options\");const i=[];for(const n of t){if(n.model!==c_){e.model.schema.register(n.model,{inheritAllFrom:\"$block\"});e.conversion.elementToElement(n);i.push(n.model)}}this._addDefaultH1Conversion(e);e.commands.add(\"heading\",new s_(e,i))}afterInit(){const e=this.editor;const t=e.commands.get(\"enter\");const i=e.config.get(\"heading.options\");if(t){this.listenTo(t,\"afterExecute\",(t,n)=>{const o=e.model.document.selection.getFirstPosition().parent;const r=i.some(e=>o.is(e.model));if(r&&!o.is(c_)&&o.childCount===0){n.writer.rename(o,c_)}})}}_addDefaultH1Conversion(e){e.conversion.for(\"upcast\").elementToElement({model:\"heading1\",view:\"h1\",converterPriority:os.get(\"low\")+1})}}class d_{constructor(e,t){if(t){Uc(this,t)}if(e){this.set(e)}}}ks(d_,Jc);function u_(e){const t=e.t;const i={Paragraph:t(\"gc\"),\"Heading 1\":t(\"gd\"),\"Heading 2\":t(\"ge\"),\"Heading 3\":t(\"gf\"),\"Heading 4\":t(\"gg\"),\"Heading 5\":t(\"gh\"),\"Heading 6\":t(\"gi\")};return e.config.get(\"heading.options\").map(e=>{const t=i[e.title];if(t&&t!=e.title){e.title=t}return e})}var h_=i(11);class f_ extends Nw{init(){const e=this.editor;const t=e.t;const i=u_(e);const n=t(\"bh\");const o=t(\"bi\");e.ui.componentFactory.add(\"heading\",t=>{const r={};const s=new ys;const a=e.commands.get(\"heading\");const c=e.commands.get(\"paragraph\");const l=[a];for(const e of i){const t={type:\"button\",model:new d_({label:e.title,class:e.class,withText:true})};if(e.model===\"paragraph\"){t.model.bind(\"isOn\").to(c,\"value\");t.model.set(\"commandName\",\"paragraph\");l.push(c)}else{t.model.bind(\"isOn\").to(a,\"value\",t=>t===e.model);t.model.set({commandName:\"heading\",commandValue:e.model})}s.add(t);r[e.model]=e.title}const d=dw(t);hw(d,s);d.buttonView.set({isOn:false,withText:true,tooltip:o});d.extendTemplate({attributes:{class:[\"ck-heading-dropdown\"]}});d.bind(\"isEnabled\").toMany(l,\"isEnabled\",(...e)=>e.some(e=>e));d.buttonView.bind(\"label\").to(a,\"value\",c,\"value\",(e,t)=>{const i=e||t&&\"paragraph\";return r[i]?r[i]:n});this.listenTo(d,\"execute\",t=>{e.execute(t.source.commandName,t.source.commandValue?{value:t.source.commandValue}:undefined);e.editing.view.focus()});return d})}}class m_ extends Nw{static get requires(){return[l_,f_]}static get pluginName(){return\"Heading\"}}class g_ extends Yd{observe(e){this.listenTo(e,\"load\",(e,t)=>{const i=t.target;if(i.tagName==\"IMG\"){this._fireEvents(t)}},{useCapture:true})}_fireEvents(e){if(this.isEnabled){this.document.fire(\"layoutChanged\");this.document.fire(\"imageLoaded\",e)}}}class p_{constructor(){this._stack=[]}add(e,t){const i=this._stack;const n=i[0];this._insertDescriptor(e);const o=i[0];if(n!==o&&!b_(n,o)){this.fire(\"change:top\",{oldDescriptor:n,newDescriptor:o,writer:t})}}remove(e,t){const i=this._stack;const n=i[0];this._removeDescriptor(e);const o=i[0];if(n!==o&&!b_(n,o)){this.fire(\"change:top\",{oldDescriptor:n,newDescriptor:o,writer:t})}}_insertDescriptor(e){const t=this._stack;const i=t.findIndex(t=>t.id===e.id);if(b_(e,t[i])){return}if(i>-1){t.splice(i,1)}let n=0;while(t[n]&&w_(t[n],e)){n++}t.splice(n,0,e)}_removeDescriptor(e){const t=this._stack;const i=t.findIndex(t=>t.id===e);if(i>-1){t.splice(i,1)}}}ks(p_,ds);function b_(e,t){return e&&t&&e.priority==t.priority&&__(e.classes)==__(t.classes)}function w_(e,t){if(e.priority>t.priority){return true}else if(e.priority__(t.classes)}function __(e){return Array.isArray(e)?e.sort().join(\",\"):e}var v_='';const k_=\"ck-widget\";const y_=\"ck-widget_selected\";function x_(e){if(!e.is(\"element\")){return false}return!!e.getCustomProperty(\"widget\")}function A_(e,t,i={}){if(!Cl.isEdge){t.setAttribute(\"contenteditable\",\"false\",e)}t.addClass(k_,e);t.setCustomProperty(\"widget\",true,e);e.getFillerOffset=I_;if(i.label){T_(e,i.label,t)}if(i.hasSelectionHandle){N_(e,t)}C_(e,t,(e,t,i)=>i.addClass(n(t.classes),e),(e,t,i)=>i.removeClass(n(t.classes),e));return e;function n(e){return Array.isArray(e)?e:[e]}}function C_(e,t,i,n){const o=new p_;o.on(\"change:top\",(t,o)=>{if(o.oldDescriptor){n(e,o.oldDescriptor,o.writer)}if(o.newDescriptor){i(e,o.newDescriptor,o.writer)}});t.setCustomProperty(\"addHighlight\",(e,t,i)=>o.add(t,i),e);t.setCustomProperty(\"removeHighlight\",(e,t,i)=>o.remove(t,i),e)}function T_(e,t,i){i.setCustomProperty(\"widgetLabel\",t,e)}function E_(e){const t=e.getCustomProperty(\"widgetLabel\");if(!t){return\"\"}return typeof t==\"function\"?t():t}function M_(e,t){t.addClass([\"ck-editor__editable\",\"ck-editor__nested-editable\"],e);if(!Cl.isEdge){t.setAttribute(\"contenteditable\",e.isReadOnly?\"false\":\"true\",e);e.on(\"change:isReadOnly\",(i,n,o)=>{t.setAttribute(\"contenteditable\",o?\"false\":\"true\",e)})}e.on(\"change:isFocused\",(i,n,o)=>{if(o){t.addClass(\"ck-editor__nested-editable_focused\",e)}else{t.removeClass(\"ck-editor__nested-editable_focused\",e)}});return e}function P_(e,t){const i=e.getSelectedElement();if(i&&t.schema.isBlock(i)){return t.createPositionAfter(i)}const n=e.getSelectedBlocks().next().value;if(n){if(n.isEmpty){return t.createPositionAt(n,0)}const i=t.createPositionAfter(n);if(e.focus.isTouching(i)){return i}return t.createPositionBefore(n)}return e.focus}function S_(e,t){return(i,n)=>{const{mapper:o,viewPosition:r}=n;const s=o.findMappedViewAncestor(r);if(!t(s)){return}const a=o.toModelElement(s);n.modelPosition=e.createPositionAt(a,r.isAtStart?\"before\":\"after\")}}function I_(){return null}function N_(e,t){const i=t.createUIElement(\"div\",{class:\"ck ck-widget__selection-handle\"},(function(e){const t=this.toDomElement(e);const i=new Gb;i.set(\"content\",v_);i.render();t.appendChild(i.element);return t}));t.insert(t.createPositionAt(e,0),i);t.addClass([\"ck-widget_with-selection-handle\"],e)}function O_(e,t,i){t.setCustomProperty(\"image\",true,e);return A_(e,t,{label:n});function n(){const t=B_(e);const n=t.getAttribute(\"alt\");return n?`${n} ${i}`:i}}function L_(e){return!!e.getCustomProperty(\"image\")&&x_(e)}function R_(e){const t=e.getSelectedElement();if(t&&L_(t)){return t}return null}function z_(e){return!!e&&e.is(\"image\")}function j_(e,t,i={}){const n=e.createElement(\"image\",i);const o=P_(t.document.selection,t);t.insertContent(n,o);if(n.parent){e.setSelection(n,\"on\")}}function D_(e){const t=e.schema;const i=e.document.selection;return V_(i,t,e)&&!F_(i,t)&&H_(i)}function B_(e){return Array.from(e.getChildren()).find(e=>e.is(\"img\"))}function V_(e,t,i){const n=W_(e,i);return t.checkChild(n,\"image\")}function F_(e,t){const i=e.getSelectedElement();return i&&t.isObject(i)}function H_(e){return[...e.focus.getAncestors()].every(e=>!e.is(\"image\"))}function W_(e,t){const i=P_(e,t);const n=i.parent;if(n.isEmpty&&!n.is(\"$root\")){return n.parent}return n}function U_(){return t=>{t.on(\"element:figure\",e)};function e(e,t,i){if(!i.consumable.test(t.viewItem,{name:true,classes:\"image\"})){return}const n=B_(t.viewItem);if(!n||!n.hasAttribute(\"src\")||!i.consumable.test(n,{name:true})){return}const o=i.convertItem(n,t.modelCursor);const r=Dw(o.modelRange.getItems());if(!r){return}i.convertChildren(t.viewItem,i.writer.createPositionAt(r,0));t.modelRange=o.modelRange;t.modelCursor=o.modelCursor}}function $_(){return t=>{t.on(\"attribute:srcset:image\",e)};function e(e,t,i){if(!i.consumable.consume(t.item,e.name)){return}const n=i.writer;const o=i.mapper.toViewElement(t.item);const r=B_(o);if(t.attributeNewValue===null){const e=t.attributeOldValue;if(e.data){n.removeAttribute(\"srcset\",r);n.removeAttribute(\"sizes\",r);if(e.width){n.removeAttribute(\"width\",r)}}}else{const e=t.attributeNewValue;if(e.data){n.setAttribute(\"srcset\",e.data,r);n.setAttribute(\"sizes\",\"100vw\",r);if(e.width){n.setAttribute(\"width\",e.width,r)}}}}}function q_(e){return i=>{i.on(`attribute:${e}:image`,t)};function t(e,t,i){if(!i.consumable.consume(t.item,e.name)){return}const n=i.writer;const o=i.mapper.toViewElement(t.item);const r=B_(o);if(t.attributeNewValue!==null){n.setAttribute(t.attributeKey,t.attributeNewValue,r)}else{n.removeAttribute(t.attributeKey,r)}}}class Y_ extends zw{refresh(){this.isEnabled=D_(this.editor.model)}execute(e){const t=this.editor.model;t.change(i=>{const n=Array.isArray(e.source)?e.source:[e.source];for(const e of n){j_(i,t,{src:e})}})}}class G_ extends Nw{static get pluginName(){return\"ImageEditing\"}init(){const e=this.editor;const t=e.model.schema;const i=e.t;const n=e.conversion;e.editing.view.addObserver(g_);t.register(\"image\",{isObject:true,isBlock:true,allowWhere:\"$block\",allowAttributes:[\"alt\",\"src\",\"srcset\"]});n.for(\"dataDowncast\").elementToElement({model:\"image\",view:(e,t)=>J_(t)});n.for(\"editingDowncast\").elementToElement({model:\"image\",view:(e,t)=>O_(J_(t),t,i(\"bw\"))});n.for(\"downcast\").add(q_(\"src\")).add(q_(\"alt\")).add($_());n.for(\"upcast\").elementToElement({view:{name:\"img\",attributes:{src:true}},model:(e,t)=>t.createElement(\"image\",{src:e.getAttribute(\"src\")})}).attributeToAttribute({view:{name:\"img\",key:\"alt\"},model:\"alt\"}).attributeToAttribute({view:{name:\"img\",key:\"srcset\"},model:{key:\"srcset\",value:e=>{const t={data:e.getAttribute(\"srcset\")};if(e.hasAttribute(\"width\")){t.width=e.getAttribute(\"width\")}return t}}}).add(U_());e.commands.add(\"imageInsert\",new Y_(e))}}function J_(e){const t=e.createEmptyElement(\"img\");const i=e.createContainerElement(\"figure\",{class:\"image\"});e.insert(e.createPositionAt(i,0),t);return i}class X_ extends Ju{constructor(e){super(e);this.domEventType=\"mousedown\"}onDomEvent(e){this.fire(e.type,e)}}var Q_=i(50);const K_=zl(\"Ctrl+A\");class Z_ extends Nw{static get pluginName(){return\"Widget\"}init(){const e=this.editor.editing.view;const t=e.document;this._previouslySelected=new Set;this.editor.editing.downcastDispatcher.on(\"selection\",(e,t,i)=>{this._clearPreviouslySelectedWidgets(i.writer);const n=i.writer;const o=n.document.selection;const r=o.getSelectedElement();let s=null;for(const e of o.getRanges()){for(const t of e){const e=t.item;if(x_(e)&&!nv(e,s)){n.addClass(y_,e);this._previouslySelected.add(e);s=e;if(e==r){n.setSelection(o.getRanges(),{fake:true,label:E_(r)})}}}}},{priority:\"low\"});e.addObserver(X_);this.listenTo(t,\"mousedown\",(...e)=>this._onMousedown(...e));this.listenTo(t,\"keydown\",(...e)=>this._onKeydown(...e),{priority:\"high\"});this.listenTo(t,\"delete\",(e,t)=>{if(this._handleDelete(t.direction==\"forward\")){t.preventDefault();e.stop()}},{priority:\"high\"})}_onMousedown(e,t){const i=this.editor;const n=i.editing.view;const o=n.document;let r=t.target;if(iv(r)){if(Cl.isSafari&&t.domEvent.detail>=3){const e=i.editing.mapper;const n=e.toModelElement(r);this.editor.model.change(e=>{t.preventDefault();e.setSelection(n,\"in\")})}return}if(!x_(r)){r=r.findAncestor(x_);if(!r){return}}t.preventDefault();if(!o.isFocused){n.focus()}const s=i.editing.mapper.toModelElement(r);this._setSelectionOverElement(s)}_onKeydown(e,t){const i=t.keyCode;const n=this.editor.locale.contentLanguageDirection===\"ltr\";const o=i==Ll.arrowdown||i==Ll[n?\"arrowright\":\"arrowleft\"];let r=false;if(ev(i)){r=this._handleArrowKeys(o)}else if(tv(t)){r=this._selectAllNestedEditableContent()||this._selectAllContent()}else if(i===Ll.enter){r=this._handleEnterKey(t.shiftKey)}if(r){t.preventDefault();e.stop()}}_handleDelete(e){if(this.editor.isReadOnly){return}const t=this.editor.model.document;const i=t.selection;if(!i.isCollapsed){return}const n=this._getObjectElementNextToSelection(e);if(n){this.editor.model.change(e=>{let t=i.anchor.parent;while(t.isEmpty){const i=t;t=i.parent;e.remove(i)}this._setSelectionOverElement(n)});return true}}_handleArrowKeys(e){const t=this.editor.model;const i=t.schema;const n=t.document;const o=n.selection;const r=o.getSelectedElement();if(r&&i.isObject(r)){const n=e?o.getLastPosition():o.getFirstPosition();const r=i.getNearestSelectionRange(n,e?\"forward\":\"backward\");if(r){t.change(e=>{e.setSelection(r)})}return true}if(!o.isCollapsed){return}const s=this._getObjectElementNextToSelection(e);if(!!s&&i.isObject(s)){this._setSelectionOverElement(s);return true}}_handleEnterKey(e){const t=this.editor.model;const i=t.document.selection;const n=i.getSelectedElement();if(ov(n,t.schema)){t.change(i=>{let o=i.createPositionAt(n,e?\"before\":\"after\");const r=i.createElement(\"paragraph\");if(t.schema.isBlock(n.parent)){const e=t.schema.findAllowedParent(o,r);o=i.split(o,e).position}i.insert(r,o);i.setSelection(r,\"in\")});return true}}_selectAllNestedEditableContent(){const e=this.editor.model;const t=e.document.selection;const i=e.schema.getLimitElement(t);if(t.getFirstRange().root==i){return false}e.change(e=>{e.setSelection(e.createRangeIn(i))});return true}_selectAllContent(){const e=this.editor.model;const t=this.editor.editing;const i=t.view;const n=i.document;const o=n.selection;const r=o.getSelectedElement();if(r&&x_(r)){const i=t.mapper.toModelElement(r.parent);e.change(e=>{e.setSelection(e.createRangeIn(i))});return true}return false}_setSelectionOverElement(e){this.editor.model.change(t=>{t.setSelection(t.createRangeOn(e))})}_getObjectElementNextToSelection(e){const t=this.editor.model;const i=t.schema;const n=t.document.selection;const o=t.createSelection(n);t.modifySelection(o,{direction:e?\"forward\":\"backward\"});const r=e?o.focus.nodeBefore:o.focus.nodeAfter;if(!!r&&i.isObject(r)){return r}return null}_clearPreviouslySelectedWidgets(e){for(const t of this._previouslySelected){e.removeClass(y_,t)}this._previouslySelected.clear()}}function ev(e){return e==Ll.arrowright||e==Ll.arrowleft||e==Ll.arrowup||e==Ll.arrowdown}function tv(e){return Rl(e)==K_}function iv(e){while(e){if(e.is(\"editableElement\")&&!e.is(\"rootElement\")){return true}if(x_(e)){return false}e=e.parent}return false}function nv(e,t){if(!t){return false}return Array.from(e.getAncestors()).includes(t)}function ov(e,t){return e&&t.isObject(e)&&!t.isInline(e)}class rv extends zw{refresh(){const e=this.editor.model.document.selection.getSelectedElement();this.isEnabled=z_(e);if(z_(e)&&e.hasAttribute(\"alt\")){this.value=e.getAttribute(\"alt\")}else{this.value=false}}execute(e){const t=this.editor.model;const i=t.document.selection.getSelectedElement();t.change(t=>{t.setAttribute(\"alt\",e.newValue,i)})}}class sv extends Nw{static get pluginName(){return\"ImageTextAlternativeEditing\"}init(){this.editor.commands.add(\"imageTextAlternative\",new rv(this.editor))}}var av=i(52);class cv extends gb{constructor(e,t){super(e);const i=`ck-input-${is()}`;const n=`ck-status-${is()}`;this.set(\"label\");this.set(\"value\");this.set(\"isReadOnly\",false);this.set(\"errorText\",null);this.set(\"infoText\",null);this.labelView=this._createLabelView(i);this.inputView=this._createInputView(t,i,n);this.statusView=this._createStatusView(n);this.bind(\"_statusText\").to(this,\"errorText\",this,\"infoText\",(e,t)=>e||t);const o=this.bindTemplate;this.setTemplate({tag:\"div\",attributes:{class:[\"ck\",\"ck-labeled-input\",o.if(\"isReadOnly\",\"ck-disabled\")]},children:[this.labelView,this.inputView,this.statusView]})}_createLabelView(e){const t=new Ab(this.locale);t.for=e;t.bind(\"text\").to(this,\"label\");return t}_createInputView(e,t,i){const n=new e(this.locale,i);n.id=t;n.ariaDescribedById=i;n.bind(\"value\").to(this);n.bind(\"isReadOnly\").to(this);n.bind(\"hasError\").to(this,\"errorText\",e=>!!e);n.on(\"input\",()=>{this.errorText=null});return n}_createStatusView(e){const t=new gb(this.locale);const i=this.bindTemplate;t.setTemplate({tag:\"div\",attributes:{class:[\"ck\",\"ck-labeled-input__status\",i.if(\"errorText\",\"ck-labeled-input__status_error\"),i.if(\"_statusText\",\"ck-hidden\",e=>!e)],id:e,role:i.if(\"errorText\",\"alert\")},children:[{text:i.to(\"_statusText\")}]});return t}select(){this.inputView.select()}focus(){this.inputView.focus()}}var lv=i(54);class dv extends gb{constructor(e){super(e);this.set(\"value\");this.set(\"id\");this.set(\"placeholder\");this.set(\"isReadOnly\",false);this.set(\"hasError\",false);this.set(\"ariaDescribedById\");const t=this.bindTemplate;this.setTemplate({tag:\"input\",attributes:{type:\"text\",class:[\"ck\",\"ck-input\",\"ck-input-text\",t.if(\"hasError\",\"ck-error\")],id:t.to(\"id\"),placeholder:t.to(\"placeholder\"),readonly:t.to(\"isReadOnly\"),\"aria-invalid\":t.if(\"hasError\",true),\"aria-describedby\":t.to(\"ariaDescribedById\")},on:{input:t.to(\"input\")}})}render(){super.render();const e=e=>{this.element.value=!e&&e!==0?\"\":e};e(this.value);this.on(\"change:value\",(t,i,n)=>{e(n)})}select(){this.element.select()}focus(){this.element.focus()}}function uv({view:e}){e.listenTo(e.element,\"submit\",(t,i)=>{i.preventDefault();e.fire(\"submit\")},{useCapture:true})}var hv='';var fv='';var mv=i(56);class gv extends gb{constructor(e){super(e);const t=this.locale.t;this.focusTracker=new xp;this.keystrokes=new dp;this.labeledInput=this._createLabeledInputView();this.saveButtonView=this._createButton(t(\"ea\"),hv,\"ck-button-save\");this.saveButtonView.type=\"submit\";this.cancelButtonView=this._createButton(t(\"eb\"),fv,\"ck-button-cancel\",\"cancel\");this._focusables=new Bp;this._focusCycler=new Nb({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\"],tabindex:\"-1\"},children:[this.labeledInput,this.saveButtonView,this.cancelButtonView]})}render(){super.render();this.keystrokes.listenTo(this.element);uv({view:this});[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach(e=>{this._focusables.add(e);this.focusTracker.add(e.element)})}_createButton(e,t,i,n){const o=new Kb(this.locale);o.set({label:e,icon:t,tooltip:true});o.extendTemplate({attributes:{class:i}});if(n){o.delegate(\"execute\").to(this,n)}return o}_createLabeledInputView(){const e=this.locale.t;const t=new cv(this.locale,dv);t.label=e(\"ec\");t.inputView.placeholder=e(\"ec\");return t}}var pv=i(58);const bv=Mb(\"px\");const wv=Nd.document.body;class _v extends gb{constructor(e){super(e);const t=this.bindTemplate;this.set(\"top\",0);this.set(\"left\",0);this.set(\"position\",\"arrow_nw\");this.set(\"isVisible\",false);this.set(\"withArrow\",true);this.set(\"class\");this.content=this.createCollection();this.setTemplate({tag:\"div\",attributes:{class:[\"ck\",\"ck-balloon-panel\",t.to(\"position\",e=>`ck-balloon-panel_${e}`),t.if(\"isVisible\",\"ck-balloon-panel_visible\"),t.if(\"withArrow\",\"ck-balloon-panel_with-arrow\"),t.to(\"class\")],style:{top:t.to(\"top\",bv),left:t.to(\"left\",bv)}},children:this.content})}show(){this.isVisible=true}hide(){this.isVisible=false}attachTo(e){this.show();const t=_v.defaultPositions;const i=Object.assign({},{element:this.element,positions:[t.southArrowNorth,t.southArrowNorthMiddleWest,t.southArrowNorthMiddleEast,t.southArrowNorthWest,t.southArrowNorthEast,t.northArrowSouth,t.northArrowSouthMiddleWest,t.northArrowSouthMiddleEast,t.northArrowSouthWest,t.northArrowSouthEast],limiter:wv,fitInViewport:true},e);const n=_v._getOptimalPosition(i);const o=parseInt(n.left);const r=parseInt(n.top);const s=n.name;Object.assign(this,{top:r,left:o,position:s})}pin(e){this.unpin();this._pinWhenIsVisibleCallback=()=>{if(this.isVisible){this._startPinning(e)}else{this._stopPinning()}};this._startPinning(e);this.listenTo(this,\"change:isVisible\",this._pinWhenIsVisibleCallback)}unpin(){if(this._pinWhenIsVisibleCallback){this._stopPinning();this.stopListening(this,\"change:isVisible\",this._pinWhenIsVisibleCallback);this._pinWhenIsVisibleCallback=null;this.hide()}}_startPinning(e){this.attachTo(e);const t=vv(e.target);const i=e.limiter?vv(e.limiter):wv;this.listenTo(Nd.document,\"scroll\",(n,o)=>{const r=o.target;const s=t&&r.contains(t);const a=i&&r.contains(i);if(s||a||!t||!i){this.attachTo(e)}},{useCapture:true});this.listenTo(Nd.window,\"resize\",()=>{this.attachTo(e)})}_stopPinning(){this.stopListening(Nd.document,\"scroll\");this.stopListening(Nd.window,\"resize\")}}function vv(e){if(Gr(e)){return e}if(wh(e)){return e.commonAncestorContainer}if(typeof e==\"function\"){return vv(e())}return null}_v.arrowHorizontalOffset=25;_v.arrowVerticalOffset=10;_v._getOptimalPosition=Hb;_v.defaultPositions={northWestArrowSouthWest:(e,t)=>({top:kv(e,t),left:e.left-_v.arrowHorizontalOffset,name:\"arrow_sw\"}),northWestArrowSouthMiddleWest:(e,t)=>({top:kv(e,t),left:e.left-t.width*.25-_v.arrowHorizontalOffset,name:\"arrow_smw\"}),northWestArrowSouth:(e,t)=>({top:kv(e,t),left:e.left-t.width/2,name:\"arrow_s\"}),northWestArrowSouthMiddleEast:(e,t)=>({top:kv(e,t),left:e.left-t.width*.75+_v.arrowHorizontalOffset,name:\"arrow_sme\"}),northWestArrowSouthEast:(e,t)=>({top:kv(e,t),left:e.left-t.width+_v.arrowHorizontalOffset,name:\"arrow_se\"}),northArrowSouthWest:(e,t)=>({top:kv(e,t),left:e.left+e.width/2-_v.arrowHorizontalOffset,name:\"arrow_sw\"}),northArrowSouthMiddleWest:(e,t)=>({top:kv(e,t),left:e.left+e.width/2-t.width*.25-_v.arrowHorizontalOffset,name:\"arrow_smw\"}),northArrowSouth:(e,t)=>({top:kv(e,t),left:e.left+e.width/2-t.width/2,name:\"arrow_s\"}),northArrowSouthMiddleEast:(e,t)=>({top:kv(e,t),left:e.left+e.width/2-t.width*.75+_v.arrowHorizontalOffset,name:\"arrow_sme\"}),northArrowSouthEast:(e,t)=>({top:kv(e,t),left:e.left+e.width/2-t.width+_v.arrowHorizontalOffset,name:\"arrow_se\"}),northEastArrowSouthWest:(e,t)=>({top:kv(e,t),left:e.right-_v.arrowHorizontalOffset,name:\"arrow_sw\"}),northEastArrowSouthMiddleWest:(e,t)=>({top:kv(e,t),left:e.right-t.width*.25-_v.arrowHorizontalOffset,name:\"arrow_smw\"}),northEastArrowSouth:(e,t)=>({top:kv(e,t),left:e.right-t.width/2,name:\"arrow_s\"}),northEastArrowSouthMiddleEast:(e,t)=>({top:kv(e,t),left:e.right-t.width*.75+_v.arrowHorizontalOffset,name:\"arrow_sme\"}),northEastArrowSouthEast:(e,t)=>({top:kv(e,t),left:e.right-t.width+_v.arrowHorizontalOffset,name:\"arrow_se\"}),southWestArrowNorthWest:(e,t)=>({top:yv(e,t),left:e.left-_v.arrowHorizontalOffset,name:\"arrow_nw\"}),southWestArrowNorthMiddleWest:(e,t)=>({top:yv(e,t),left:e.left-t.width*.25-_v.arrowHorizontalOffset,name:\"arrow_nmw\"}),southWestArrowNorth:(e,t)=>({top:yv(e,t),left:e.left-t.width/2,name:\"arrow_n\"}),southWestArrowNorthMiddleEast:(e,t)=>({top:yv(e,t),left:e.left-t.width*.75+_v.arrowHorizontalOffset,name:\"arrow_nme\"}),southWestArrowNorthEast:(e,t)=>({top:yv(e,t),left:e.left-t.width+_v.arrowHorizontalOffset,name:\"arrow_ne\"}),southArrowNorthWest:(e,t)=>({top:yv(e,t),left:e.left+e.width/2-_v.arrowHorizontalOffset,name:\"arrow_nw\"}),southArrowNorthMiddleWest:(e,t)=>({top:yv(e,t),left:e.left+e.width/2-t.width*.25-_v.arrowHorizontalOffset,name:\"arrow_nmw\"}),southArrowNorth:(e,t)=>({top:yv(e,t),left:e.left+e.width/2-t.width/2,name:\"arrow_n\"}),southArrowNorthMiddleEast:(e,t)=>({top:yv(e,t),left:e.left+e.width/2-t.width*.75+_v.arrowHorizontalOffset,name:\"arrow_nme\"}),southArrowNorthEast:(e,t)=>({top:yv(e,t),left:e.left+e.width/2-t.width+_v.arrowHorizontalOffset,name:\"arrow_ne\"}),southEastArrowNorthWest:(e,t)=>({top:yv(e,t),left:e.right-_v.arrowHorizontalOffset,name:\"arrow_nw\"}),southEastArrowNorthMiddleWest:(e,t)=>({top:yv(e,t),left:e.right-t.width*.25-_v.arrowHorizontalOffset,name:\"arrow_nmw\"}),southEastArrowNorth:(e,t)=>({top:yv(e,t),left:e.right-t.width/2,name:\"arrow_n\"}),southEastArrowNorthMiddleEast:(e,t)=>({top:yv(e,t),left:e.right-t.width*.75+_v.arrowHorizontalOffset,name:\"arrow_nme\"}),southEastArrowNorthEast:(e,t)=>({top:yv(e,t),left:e.right-t.width+_v.arrowHorizontalOffset,name:\"arrow_ne\"})};function kv(e,t){return e.top-t.height-_v.arrowVerticalOffset}function yv(e){return e.bottom+_v.arrowVerticalOffset}var xv='';var Av='';var Cv=i(60);var Tv=i(62);const Ev=Mb(\"px\");class Mv extends Nw{static get pluginName(){return\"ContextualBalloon\"}constructor(e){super(e);this.positionLimiter=()=>{const e=this.editor.editing.view;const t=e.document;const i=t.selection.editableElement;if(i){return e.domConverter.mapViewToDom(i.root)}return null};this.set(\"visibleView\",null);this.view=new _v(e.locale);e.ui.view.body.add(this.view);e.ui.focusTracker.add(this.view.element);this._viewToStack=new Map;this._idToStack=new Map;this.set(\"_numberOfStacks\",0);this.set(\"_singleViewMode\",false);this._rotatorView=this._createRotatorView();this._fakePanelsView=this._createFakePanelsView()}hasView(e){return Array.from(this._viewToStack.keys()).includes(e)}add(e){if(this.hasView(e.view)){throw new ss[\"b\"](\"contextualballoon-add-view-exist: Cannot add configuration of the same view twice.\",[this,e])}const t=e.stackId||\"main\";if(!this._idToStack.has(t)){this._idToStack.set(t,new Map([[e.view,e]]));this._viewToStack.set(e.view,this._idToStack.get(t));this._numberOfStacks=this._idToStack.size;if(!this._visibleStack||e.singleViewMode){this.showStack(t)}return}const i=this._idToStack.get(t);if(e.singleViewMode){this.showStack(t)}i.set(e.view,e);this._viewToStack.set(e.view,i);if(i===this._visibleStack){this._showView(e)}}remove(e){if(!this.hasView(e)){throw new ss[\"b\"](\"contextualballoon-remove-view-not-exist: Cannot remove the configuration of a non-existent view.\",[this,e])}const t=this._viewToStack.get(e);if(this._singleViewMode&&this.visibleView===e){this._singleViewMode=false}if(this.visibleView===e){if(t.size===1){if(this._idToStack.size>1){this._showNextStack()}else{this.view.hide();this.visibleView=null;this._rotatorView.hideView()}}else{this._showView(Array.from(t.values())[t.size-2])}}if(t.size===1){this._idToStack.delete(this._getStackId(t));this._numberOfStacks=this._idToStack.size}else{t.delete(e)}this._viewToStack.delete(e)}updatePosition(e){if(e){this._visibleStack.get(this.visibleView).position=e}this.view.pin(this._getBalloonPosition());this._fakePanelsView.updatePosition()}showStack(e){this.visibleStack=e;const t=this._idToStack.get(e);if(!t){throw new ss[\"b\"](\"contextualballoon-showstack-stack-not-exist: Cannot show a stack that does not exist.\",this)}if(this._visibleStack===t){return}this._showView(Array.from(t.values()).pop())}get _visibleStack(){return this._viewToStack.get(this.visibleView)}_getStackId(e){const t=Array.from(this._idToStack.entries()).find(t=>t[1]===e);return t[0]}_showNextStack(){const e=Array.from(this._idToStack.values());let t=e.indexOf(this._visibleStack)+1;if(!e[t]){t=0}this.showStack(this._getStackId(e[t]))}_showPrevStack(){const e=Array.from(this._idToStack.values());let t=e.indexOf(this._visibleStack)-1;if(!e[t]){t=e.length-1}this.showStack(this._getStackId(e[t]))}_createRotatorView(){const e=new Pv(this.editor.locale);const t=this.editor.locale.t;this.view.content.add(e);e.bind(\"isNavigationVisible\").to(this,\"_numberOfStacks\",this,\"_singleViewMode\",(e,t)=>!t&&e>1);e.on(\"change:isNavigationVisible\",()=>this.updatePosition(),{priority:\"low\"});e.bind(\"counter\").to(this,\"visibleView\",this,\"_numberOfStacks\",(e,i)=>{if(i<2){return\"\"}const n=Array.from(this._idToStack.values()).indexOf(this._visibleStack)+1;return t(\"ef\",[n,i])});e.buttonNextView.on(\"execute\",()=>{if(e.focusTracker.isFocused){this.editor.editing.view.focus()}this._showNextStack()});e.buttonPrevView.on(\"execute\",()=>{if(e.focusTracker.isFocused){this.editor.editing.view.focus()}this._showPrevStack()});return e}_createFakePanelsView(){const e=new Sv(this.editor.locale,this.view);e.bind(\"numberOfPanels\").to(this,\"_numberOfStacks\",this,\"_singleViewMode\",(e,t)=>{const i=!t&&e>=2;return i?Math.min(e-1,2):0});e.listenTo(this.view,\"change:top\",()=>e.updatePosition());e.listenTo(this.view,\"change:left\",()=>e.updatePosition());this.editor.ui.view.body.add(e);return e}_showView({view:e,balloonClassName:t=\"\",withArrow:i=true,singleViewMode:n=false}){this.view.class=t;this.view.withArrow=i;this._rotatorView.showView(e);this.visibleView=e;this.view.pin(this._getBalloonPosition());this._fakePanelsView.updatePosition();if(n){this._singleViewMode=true}}_getBalloonPosition(){let e=Array.from(this._visibleStack.values()).pop().position;if(e&&!e.limiter){e=Object.assign({},e,{limiter:this.positionLimiter})}return e}}class Pv extends gb{constructor(e){super(e);const t=e.t;const i=this.bindTemplate;this.set(\"isNavigationVisible\",true);this.focusTracker=new xp;this.buttonPrevView=this._createButtonView(t(\"eg\"),xv);this.buttonNextView=this._createButtonView(t(\"eh\"),Av);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\",e=>e?\"\":\"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(e){this.hideView();this.content.add(e)}hideView(){this.content.clear()}_createButtonView(e,t){const i=new Kb(this.locale);i.set({label:e,icon:t,tooltip:true});return i}}class Sv extends gb{constructor(e,t){super(e);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=t;this.setTemplate({tag:\"div\",attributes:{class:[\"ck-fake-panel\",i.to(\"numberOfPanels\",e=>e?\"\":\"ck-hidden\")],style:{top:i.to(\"top\",Ev),left:i.to(\"left\",Ev),width:i.to(\"width\",Ev),height:i.to(\"height\",Ev)}},children:this.content});this.on(\"change:numberOfPanels\",(e,t,i,n)=>{if(i>n){this._addPanels(i-n)}else{this._removePanels(n-i)}this.updatePosition()})}_addPanels(e){while(e--){const e=new gb;e.setTemplate({tag:\"div\"});this.content.add(e);this.registerChild(e)}}_removePanels(e){while(e--){const e=this.content.last;this.content.remove(e);this.deregisterChild(e);e.destroy()}}updatePosition(){if(this.numberOfPanels){const{top:e,left:t}=this._balloonPanelView;const{width:i,height:n}=new kh(this._balloonPanelView.element);Object.assign(this,{top:e,left:t,width:i,height:n})}}}var Iv='';function Nv(e){const t=e.plugins.get(\"ContextualBalloon\");if(R_(e.editing.view.document.selection)){const i=Ov(e);t.updatePosition(i)}}function Ov(e){const t=e.editing.view;const i=_v.defaultPositions;return{target:t.domConverter.viewToDom(t.document.selection.getSelectedElement()),positions:[i.northArrowSouth,i.northArrowSouthWest,i.northArrowSouthEast,i.southArrowNorth,i.southArrowNorthWest,i.southArrowNorthEast]}}class Lv extends Nw{static get requires(){return[Mv]}static get pluginName(){return\"ImageTextAlternativeUI\"}init(){this._createButton();this._createForm()}destroy(){super.destroy();this._form.destroy()}_createButton(){const e=this.editor;const t=e.t;e.ui.componentFactory.add(\"imageTextAlternative\",i=>{const n=e.commands.get(\"imageTextAlternative\");const o=new Kb(i);o.set({label:t(\"dg\"),icon:Iv,tooltip:true});o.bind(\"isEnabled\").to(n,\"isEnabled\");this.listenTo(o,\"execute\",()=>{this._showForm()});return o})}_createForm(){const e=this.editor;const t=e.editing.view;const i=t.document;this._balloon=this.editor.plugins.get(\"ContextualBalloon\");this._form=new gv(e.locale);this._form.render();this.listenTo(this._form,\"submit\",()=>{e.execute(\"imageTextAlternative\",{newValue:this._form.labeledInput.inputView.element.value});this._hideForm(true)});this.listenTo(this._form,\"cancel\",()=>{this._hideForm(true)});this._form.keystrokes.set(\"Esc\",(e,t)=>{this._hideForm(true);t()});this.listenTo(e.ui,\"update\",()=>{if(!R_(i.selection)){this._hideForm(true)}else if(this._isVisible){Nv(e)}});aw({emitter:this._form,activator:()=>this._isVisible,contextElements:[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible){return}const e=this.editor;const t=e.commands.get(\"imageTextAlternative\");const i=this._form.labeledInput;if(!this._isInBalloon){this._balloon.add({view:this._form,position:Ov(e)})}i.value=i.inputView.element.value=t.value||\"\";this._form.labeledInput.select()}_hideForm(e){if(!this._isInBalloon){return}if(this._form.focusTracker.isFocused){this._form.saveButtonView.focus()}this._balloon.remove(this._form);if(e){this.editor.editing.view.focus()}}get _isVisible(){return this._balloon.visibleView===this._form}get _isInBalloon(){return this._balloon.hasView(this._form)}}class Rv extends Nw{static get requires(){return[sv,Lv]}static get pluginName(){return\"ImageTextAlternative\"}}var zv=i(64);class jv extends Nw{static get requires(){return[G_,Z_,Rv]}static get pluginName(){return\"Image\"}}function Dv(e,t){return i=>{const n=i.createEditableElement(\"figcaption\");i.setCustomProperty(\"imageCaption\",true,n);Pp({view:e,element:n,text:t});return M_(n,i)}}function Bv(e){return!!e.getCustomProperty(\"imageCaption\")}function Vv(e){for(const t of e.getChildren()){if(!!t&&t.is(\"caption\")){return t}}return null}function Fv(e){const t=e.parent;if(e.name==\"figcaption\"&&t&&t.name==\"figure\"&&t.hasClass(\"image\")){return{name:true}}return null}class Hv extends Nw{static get pluginName(){return\"ImageCaptionEditing\"}init(){const e=this.editor;const t=e.editing.view;const i=e.model.schema;const n=e.data;const o=e.editing;const r=e.t;i.register(\"caption\",{allowIn:\"image\",allowContentOf:\"$block\",isLimit:true});e.model.document.registerPostFixer(e=>this._insertMissingModelCaptionElement(e));e.conversion.for(\"upcast\").elementToElement({view:Fv,model:\"caption\"});const s=e=>e.createContainerElement(\"figcaption\");n.downcastDispatcher.on(\"insert:caption\",Wv(s,false));const a=Dv(t,r(\"bx\"));o.downcastDispatcher.on(\"insert:caption\",Wv(a));o.downcastDispatcher.on(\"insert\",this._fixCaptionVisibility(e=>e.item),{priority:\"high\"});o.downcastDispatcher.on(\"remove\",this._fixCaptionVisibility(e=>e.position.parent),{priority:\"high\"});t.document.registerPostFixer(e=>this._updateCaptionVisibility(e))}_updateCaptionVisibility(e){const t=this.editor.editing.mapper;const i=this._lastSelectedCaption;let n;const o=this.editor.model.document.selection;const r=o.getSelectedElement();if(r&&r.is(\"image\")){const e=Vv(r);n=t.toViewElement(e)}const s=o.getFirstPosition();const a=$v(s.parent);if(a){n=t.toViewElement(a)}if(n){if(i){if(i===n){return Yv(n,e)}else{qv(i,e);this._lastSelectedCaption=n;return Yv(n,e)}}else{this._lastSelectedCaption=n;return Yv(n,e)}}else{if(i){const t=qv(i,e);this._lastSelectedCaption=null;return t}else{return false}}}_fixCaptionVisibility(e){return(t,i,n)=>{const o=e(i);const r=$v(o);const s=this.editor.editing.mapper;const a=n.writer;if(r){const e=s.toViewElement(r);if(e){if(r.childCount){a.removeClass(\"ck-hidden\",e)}else{a.addClass(\"ck-hidden\",e)}}}}}_insertMissingModelCaptionElement(e){const t=this.editor.model;const i=t.document.differ.getChanges();const n=[];for(const e of i){if(e.type==\"insert\"&&e.name!=\"$text\"){const i=e.position.nodeAfter;if(i.is(\"image\")&&!Vv(i)){n.push(i)}if(!i.is(\"image\")&&i.childCount){for(const e of t.createRangeIn(i).getItems()){if(e.is(\"image\")&&!Vv(e)){n.push(e)}}}}}for(const t of n){e.appendElement(\"caption\",t)}return!!n.length}}function Wv(e,t=true){return(i,n,o)=>{const r=n.item;if(!r.childCount&&!t){return}if(z_(r.parent)){if(!o.consumable.consume(n.item,\"insert\")){return}const t=o.mapper.toViewElement(n.range.start.parent);const i=e(o.writer);const s=o.writer;if(!r.childCount){s.addClass(\"ck-hidden\",i)}Uv(i,n.item,t,o)}}}function Uv(e,t,i,n){const o=n.writer.createPositionAt(i,\"end\");n.writer.insert(o,e);n.mapper.bindElements(t,e)}function $v(e){const t=e.getAncestors({includeSelf:true});const i=t.find(e=>e.name==\"caption\");if(i&&i.parent&&i.parent.name==\"image\"){return i}return null}function qv(e,t){if(!e.childCount&&!e.hasClass(\"ck-hidden\")){t.addClass(\"ck-hidden\",e);return true}return false}function Yv(e,t){if(e.hasClass(\"ck-hidden\")){t.removeClass(\"ck-hidden\",e);return true}return false}var Gv=i(66);class Jv extends Nw{static get requires(){return[Hv]}static get pluginName(){return\"ImageCaption\"}}class Xv extends zw{constructor(e,t){super(e);this.defaultStyle=false;this.styles=t.reduce((e,t)=>{e[t.name]=t;if(t.isDefault){this.defaultStyle=t.name}return e},{})}refresh(){const e=this.editor.model.document.selection.getSelectedElement();this.isEnabled=z_(e);if(!e){this.value=false}else if(e.hasAttribute(\"imageStyle\")){const t=e.getAttribute(\"imageStyle\");this.value=this.styles[t]?t:false}else{this.value=this.defaultStyle}}execute(e){const t=e.value;const i=this.editor.model;const n=i.document.selection.getSelectedElement();i.change(e=>{if(this.styles[t].isDefault){e.removeAttribute(\"imageStyle\",n)}else{e.setAttribute(\"imageStyle\",t,n)}})}}function Qv(e){return(t,i,n)=>{if(!n.consumable.consume(i.item,t.name)){return}const o=Zv(i.attributeNewValue,e);const r=Zv(i.attributeOldValue,e);const s=n.mapper.toViewElement(i.item);const a=n.writer;if(r){a.removeClass(r.className,s)}if(o){a.addClass(o.className,s)}}}function Kv(e){const t=e.filter(e=>!e.isDefault);return(e,i,n)=>{if(!i.modelRange){return}const o=i.viewItem;const r=Dw(i.modelRange.getItems());if(!n.schema.checkAttribute(r,\"imageStyle\")){return}for(const e of t){if(n.consumable.consume(o,{classes:e.className})){n.writer.setAttribute(\"imageStyle\",e.name,r)}}}}function Zv(e,t){for(const i of t){if(i.name===e){return i}}}var ek='';var tk='';var ik='';var nk='';const ok={full:{name:\"full\",title:\"Full size image\",icon:ek,isDefault:true},side:{name:\"side\",title:\"Side image\",icon:nk,className:\"image-style-side\"},alignLeft:{name:\"alignLeft\",title:\"Left aligned image\",icon:tk,className:\"image-style-align-left\"},alignCenter:{name:\"alignCenter\",title:\"Centered image\",icon:ik,className:\"image-style-align-center\"},alignRight:{name:\"alignRight\",title:\"Right aligned image\",icon:nk,className:\"image-style-align-right\"}};const rk={full:ek,left:tk,right:nk,center:ik};function sk(e=[]){return e.map(ak)}function ak(e){if(typeof e==\"string\"){const t=e;if(ok[t]){e=Object.assign({},ok[t])}else{console.warn(Object(ss[\"a\"])(\"image-style-not-found: There is no such image style of given name.\"),{name:t});e={name:t}}}else if(ok[e.name]){const t=ok[e.name];const i=Object.assign({},e);for(const n in t){if(!e.hasOwnProperty(n)){i[n]=t[n]}}e=i}if(typeof e.icon==\"string\"&&rk[e.icon]){e.icon=rk[e.icon]}return e}class ck extends Nw{static get pluginName(){return\"ImageStyleEditing\"}init(){const e=this.editor;const t=e.model.schema;const i=e.data;const n=e.editing;e.config.define(\"image.styles\",[\"full\",\"side\"]);const o=sk(e.config.get(\"image.styles\"));t.extend(\"image\",{allowAttributes:\"imageStyle\"});const r=Qv(o);n.downcastDispatcher.on(\"attribute:imageStyle:image\",r);i.downcastDispatcher.on(\"attribute:imageStyle:image\",r);i.upcastDispatcher.on(\"element:figure\",Kv(o),{priority:\"low\"});e.commands.add(\"imageStyle\",new Xv(e,o))}}var lk=i(68);class dk extends Nw{static get pluginName(){return\"ImageStyleUI\"}get localizedDefaultStylesTitles(){const e=this.editor.t;return{\"Full size image\":e(\"by\"),\"Side image\":e(\"bz\"),\"Left aligned image\":e(\"ca\"),\"Centered image\":e(\"cb\"),\"Right aligned image\":e(\"cc\")}}init(){const e=this.editor;const t=e.config.get(\"image.styles\");const i=uk(sk(t),this.localizedDefaultStylesTitles);for(const e of i){this._createButton(e)}}_createButton(e){const t=this.editor;const i=`imageStyle:${e.name}`;t.ui.componentFactory.add(i,i=>{const n=t.commands.get(\"imageStyle\");const o=new Kb(i);o.set({label:e.title,icon:e.icon,tooltip:true,isToggleable:true});o.bind(\"isEnabled\").to(n,\"isEnabled\");o.bind(\"isOn\").to(n,\"value\",t=>t===e.name);this.listenTo(o,\"execute\",()=>{t.execute(\"imageStyle\",{value:e.name});t.editing.view.focus()});return o})}}function uk(e,t){for(const i of e){if(t[i.title]){i.title=t[i.title]}}return e}class hk extends Nw{static get requires(){return[ck,dk]}static get pluginName(){return\"ImageStyle\"}}class fk extends Nw{static get requires(){return[Mv]}static get pluginName(){return\"WidgetToolbarRepository\"}init(){const e=this.editor;if(e.plugins.has(\"BalloonToolbar\")){const t=e.plugins.get(\"BalloonToolbar\");this.listenTo(t,\"show\",t=>{if(pk(e.editing.view.document.selection)){t.stop()}},{priority:\"high\"})}this._toolbarDefinitions=new Map;this._balloon=this.editor.plugins.get(\"ContextualBalloon\");this.on(\"change:isEnabled\",()=>{this._updateToolbarsVisibility()});this.listenTo(e.ui,\"update\",()=>{this._updateToolbarsVisibility()});this.listenTo(e.ui.focusTracker,\"change:isFocused\",()=>{this._updateToolbarsVisibility()},{priority:\"low\"})}destroy(){super.destroy();for(const e of this._toolbarDefinitions.values()){e.view.destroy()}}register(e,{ariaLabel:t,items:i,getRelatedElement:n,balloonClassName:o=\"ck-toolbar-container\"}){const r=this.editor;const s=r.t;const a=new _w(r.locale);a.ariaLabel=t||s(\"cf\");if(this._toolbarDefinitions.has(e)){throw new ss[\"b\"](\"widget-toolbar-duplicated: Toolbar with the given id was already added.\",this,{toolbarId:e})}a.fillFromConfig(i,r.ui.componentFactory);this._toolbarDefinitions.set(e,{view:a,getRelatedElement:n,balloonClassName:o})}_updateToolbarsVisibility(){let e=0;let t=null;let 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._isToolbarInBalloon(n)){this._hideToolbar(n)}}else if(!this.editor.ui.focusTracker.isFocused){if(this._isToolbarVisible(n)){this._hideToolbar(n)}}else{const r=o.getAncestors().length;if(r>e){e=r;t=o;i=n}}}if(i){this._showToolbar(i,t)}}_hideToolbar(e){this._balloon.remove(e.view);this.stopListening(this._balloon,\"change:visibleView\")}_showToolbar(e,t){if(this._isToolbarVisible(e)){mk(this.editor,t)}else if(!this._isToolbarInBalloon(e)){this._balloon.add({view:e.view,position:gk(this.editor,t),balloonClassName:e.balloonClassName});this.listenTo(this._balloon,\"change:visibleView\",()=>{for(const e of this._toolbarDefinitions.values()){if(this._isToolbarVisible(e)){const t=e.getRelatedElement(this.editor.editing.view.document.selection);mk(this.editor,t)}}})}}_isToolbarVisible(e){return this._balloon.visibleView===e.view}_isToolbarInBalloon(e){return this._balloon.hasView(e.view)}}function mk(e,t){const i=e.plugins.get(\"ContextualBalloon\");const n=gk(e,t);i.updatePosition(n)}function gk(e,t){const i=e.editing.view;const n=_v.defaultPositions;return{target:i.domConverter.mapViewToDom(t),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast]}}function pk(e){const t=e.getSelectedElement();return!!(t&&x_(t))}class bk extends Nw{static get requires(){return[fk]}static get pluginName(){return\"ImageToolbar\"}afterInit(){const e=this.editor;const t=e.t;const i=e.plugins.get(fk);i.register(\"image\",{ariaLabel:t(\"a\"),items:e.config.get(\"image.toolbar\")||[],getRelatedElement:R_})}}class wk extends gb{constructor(e){super(e);this.buttonView=new Kb(e);this._fileInputView=new _k(e);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 _k extends gb{constructor(e){super(e);this.set(\"acceptedType\");this.set(\"allowMultipleFiles\",false);const t=this.bindTemplate;this.setTemplate({tag:\"input\",attributes:{class:[\"ck-hidden\"],type:\"file\",tabindex:\"-1\",accept:t.to(\"acceptedType\"),multiple:t.to(\"allowMultipleFiles\")},on:{change:t.to(()=>{if(this.element&&this.element.files&&this.element.files.length){this.fire(\"done\",this.element.files)}this.element.value=\"\"})}})}open(){this.element.click()}}var vk='';function kk(e){const t=e.map(e=>e.replace(\"+\",\"\\\\+\"));return new RegExp(`^image\\\\/(${t.join(\"|\")})$`)}function yk(e){return new Promise((t,i)=>{const n=e.getAttribute(\"src\");fetch(n).then(e=>e.blob()).then(e=>{const o=Ak(e,n);const r=o.replace(\"image/\",\"\");const s=`image.${r}`;const a=Ck(e,s,o);a?t(a):i()}).catch(i)})}function xk(e){if(!e.is(\"element\",\"img\")||!e.getAttribute(\"src\")){return false}return e.getAttribute(\"src\").match(/^data:image\\/\\w+;base64,/g)||e.getAttribute(\"src\").match(/^blob:/g)}function Ak(e,t){if(e.type){return e.type}else if(t.match(/data:(image\\/\\w+);base64/)){return t.match(/data:(image\\/\\w+);base64/)[1].toLowerCase()}else{return\"image/jpeg\"}}function Ck(e,t,i){try{return new File([e],t,{type:i})}catch(e){return null}}class Tk extends Nw{init(){const e=this.editor;const t=e.t;e.ui.componentFactory.add(\"imageUpload\",i=>{const n=new wk(i);const o=e.commands.get(\"imageUpload\");const r=e.config.get(\"image.upload.types\");const s=kk(r);n.set({acceptedType:r.map(e=>`image/${e}`).join(\",\"),allowMultipleFiles:true});n.buttonView.set({label:t(\"cd\"),icon:vk,tooltip:true});n.buttonView.bind(\"isEnabled\").to(o);n.on(\"done\",(t,i)=>{const n=Array.from(i).filter(e=>s.test(e.type));if(n.length){e.execute(\"imageUpload\",{file:n})}});return n})}}class Ek{constructor(e){this.context=e}destroy(){this.stopListening()}static get isContextPlugin(){return true}}ks(Ek,Jc);class Mk extends Ek{static get pluginName(){return\"PendingActions\"}init(){this.set(\"hasAny\",false);this._actions=new ys({idProperty:\"_id\"});this._actions.delegate(\"add\",\"remove\").to(this)}add(e){if(typeof e!==\"string\"){throw new ss[\"b\"](\"pendingactions-add-invalid-message: The message must be a string.\",this)}const t=Object.create(Jc);t.set(\"message\",e);this._actions.add(t);this.hasAny=true;return t}remove(e){this._actions.remove(e);this.hasAny=!!this._actions.length}get first(){return this._actions.get(0)}[Symbol.iterator](){return this._actions[Symbol.iterator]()}}class Pk{constructor(){const e=new window.FileReader;this._reader=e;this._data=undefined;this.set(\"loaded\",0);e.onprogress=e=>{this.loaded=e.loaded}}get error(){return this._reader.error}get data(){return this._data}read(e){const t=this._reader;this.total=e.size;return new Promise((i,n)=>{t.onload=()=>{const e=t.result;this._data=e;i(e)};t.onerror=()=>{n(\"error\")};t.onabort=()=>{n(\"aborted\")};this._reader.readAsDataURL(e)})}abort(){this._reader.abort()}}ks(Pk,Jc);class Sk extends Nw{static get pluginName(){return\"FileRepository\"}static get requires(){return[Mk]}init(){this.loaders=new ys;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\",(e,t)=>t?e/t*100:0)}getLoader(e){return this._loadersMap.get(e)||null}createLoader(e){if(!this.createUploadAdapter){console.warn(Object(ss[\"a\"])(\"filerepository-no-upload-adapter: Upload adapter is not defined.\"));return null}const t=new Ik(Promise.resolve(e),this.createUploadAdapter);this.loaders.add(t);this._loadersMap.set(e,t);if(e instanceof Promise){t.file.then(e=>{this._loadersMap.set(e,t)}).catch(()=>{})}t.on(\"change:uploaded\",()=>{let e=0;for(const t of this.loaders){e+=t.uploaded}this.uploaded=e});t.on(\"change:uploadTotal\",()=>{let e=0;for(const t of this.loaders){if(t.uploadTotal){e+=t.uploadTotal}}this.uploadTotal=e});return t}destroyLoader(e){const t=e instanceof Ik?e:this.getLoader(e);t._destroy();this.loaders.remove(t);this._loadersMap.forEach((e,i)=>{if(e===t){this._loadersMap.delete(i)}})}_updatePendingAction(){const e=this.editor.plugins.get(Mk);if(this.loaders.length){if(!this._pendingAction){const t=this.editor.t;const i=e=>`${t(\"cv\")} ${parseInt(e)}%.`;this._pendingAction=e.add(i(this.uploadedPercent));this._pendingAction.bind(\"message\").to(this,\"uploadedPercent\",i)}}else{e.remove(this._pendingAction);this._pendingAction=null}}}ks(Sk,Jc);class Ik{constructor(e,t){this.id=is();this._filePromiseWrapper=this._createFilePromiseWrapper(e);this._adapter=t(this);this._reader=new Pk;this.set(\"status\",\"idle\");this.set(\"uploaded\",0);this.set(\"uploadTotal\",null);this.bind(\"uploadedPercent\").to(this,\"uploaded\",this,\"uploadTotal\",(e,t)=>t?e/t*100:0);this.set(\"uploadResponse\",null)}get file(){if(!this._filePromiseWrapper){return Promise.resolve(null)}else{return this._filePromiseWrapper.promise.then(e=>this._filePromiseWrapper?e:null)}}get data(){return this._reader.data}read(){if(this.status!=\"idle\"){throw new ss[\"b\"](\"filerepository-read-wrong-status: You cannot call read if the status is different than idle.\",this)}this.status=\"reading\";return this.file.then(e=>this._reader.read(e)).then(e=>{this.status=\"idle\";return e}).catch(e=>{if(e===\"aborted\"){this.status=\"aborted\";throw\"aborted\"}this.status=\"error\";throw this._reader.error?this._reader.error:e})}upload(){if(this.status!=\"idle\"){throw new ss[\"b\"](\"filerepository-upload-wrong-status: You cannot call upload if the status is different than idle.\",this)}this.status=\"uploading\";return this.file.then(()=>this._adapter.upload()).then(e=>{this.uploadResponse=e;this.status=\"idle\";return e}).catch(e=>{if(this.status===\"aborted\"){throw\"aborted\"}this.status=\"error\";throw e})}abort(){const e=this.status;this.status=\"aborted\";if(!this._filePromiseWrapper.isFulfilled){this._filePromiseWrapper.promise.catch(()=>{});this._filePromiseWrapper.rejecter(\"aborted\")}else if(e==\"reading\"){this._reader.abort()}else if(e==\"uploading\"&&this._adapter.abort){this._adapter.abort()}this._destroy()}_destroy(){this._filePromiseWrapper=undefined;this._reader=undefined;this._adapter=undefined;this.uploadResponse=undefined}_createFilePromiseWrapper(e){const t={};t.promise=new Promise((i,n)=>{t.rejecter=n;t.isFulfilled=false;e.then(e=>{t.isFulfilled=true;i(e)}).catch(e=>{t.isFulfilled=true;n(e)})});return t}}ks(Ik,Jc);var Nk='';var Ok=i(70);var Lk=i(72);var Rk=i(74);class zk extends Nw{constructor(e){super(e);this.placeholder=\"data:image/svg+xml;utf8,\"+encodeURIComponent(Nk)}init(){const e=this.editor;e.editing.downcastDispatcher.on(\"attribute:uploadStatus:image\",(...e)=>this.uploadStatusChange(...e))}uploadStatusChange(e,t,i){const n=this.editor;const o=t.item;const r=o.getAttribute(\"uploadId\");if(!i.consumable.consume(t.item,e.name)){return}const s=n.plugins.get(Sk);const a=r?t.attributeNewValue:null;const c=this.placeholder;const l=n.editing.mapper.toViewElement(o);const d=i.writer;if(a==\"reading\"){jk(l,d);Bk(c,l,d);return}if(a==\"uploading\"){const e=s.loaders.get(r);jk(l,d);if(!e){Bk(c,l,d)}else{Vk(l,d);Fk(l,d,e,n.editing.view);Gk(l,d,e)}return}if(a==\"complete\"&&s.loaders.get(r)&&!Cl.isEdge){Wk(l,d,n.editing.view)}Hk(l,d);Vk(l,d);Dk(l,d)}}function jk(e,t){if(!e.hasClass(\"ck-appear\")){t.addClass(\"ck-appear\",e)}}function Dk(e,t){t.removeClass(\"ck-appear\",e)}function Bk(e,t,i){if(!t.hasClass(\"ck-image-upload-placeholder\")){i.addClass(\"ck-image-upload-placeholder\",t)}const n=B_(t);if(n.getAttribute(\"src\")!==e){i.setAttribute(\"src\",e,n)}if(!qk(t,\"placeholder\")){i.insert(i.createPositionAfter(n),$k(i))}}function Vk(e,t){if(e.hasClass(\"ck-image-upload-placeholder\")){t.removeClass(\"ck-image-upload-placeholder\",e)}Yk(e,t,\"placeholder\")}function Fk(e,t,i,n){const o=Uk(t);t.insert(t.createPositionAt(e,\"end\"),o);i.on(\"change:uploadedPercent\",(e,t,i)=>{n.change(e=>{e.setStyle(\"width\",i+\"%\",o)})})}function Hk(e,t){Yk(e,t,\"progressBar\")}function Wk(e,t,i){const n=t.createUIElement(\"div\",{class:\"ck-image-upload-complete-icon\"});t.insert(t.createPositionAt(e,\"end\"),n);setTimeout(()=>{i.change(e=>e.remove(e.createRangeOn(n)))},3e3)}function Uk(e){const t=e.createUIElement(\"div\",{class:\"ck-progress-bar\"});e.setCustomProperty(\"progressBar\",true,t);return t}function $k(e){const t=e.createUIElement(\"div\",{class:\"ck-upload-placeholder-loader\"});e.setCustomProperty(\"placeholder\",true,t);return t}function qk(e,t){for(const i of e.getChildren()){if(i.getCustomProperty(t)){return i}}}function Yk(e,t,i){const n=qk(e,i);if(n){t.remove(t.createRangeOn(n))}}function Gk(e,t,i){if(i.data){const n=B_(e);t.setAttribute(\"src\",i.data,n)}}class Jk extends Ek{static get pluginName(){return\"Notification\"}init(){this.on(\"show:warning\",(e,t)=>{window.alert(t.message)},{priority:\"lowest\"})}showSuccess(e,t={}){this._showNotification({message:e,type:\"success\",namespace:t.namespace,title:t.title})}showInfo(e,t={}){this._showNotification({message:e,type:\"info\",namespace:t.namespace,title:t.title})}showWarning(e,t={}){this._showNotification({message:e,type:\"warning\",namespace:t.namespace,title:t.title})}_showNotification(e){const t=`show:${e.type}`+(e.namespace?`:${e.namespace}`:\"\");this.fire(t,{message:e.message,type:e.type,title:e.title||\"\"})}}class Xk{constructor(e){this.files=Qk(e);this._native=e}get types(){return this._native.types}getData(e){return this._native.getData(e)}setData(e,t){this._native.setData(e,t)}}function Qk(e){const t=e.files?Array.from(e.files):[];const i=e.items?Array.from(e.items):[];if(t.length){return t}return i.filter(e=>e.kind===\"file\").map(e=>e.getAsFile())}class Kk extends Ju{constructor(e){super(e);const t=this.document;this.domEventType=[\"paste\",\"copy\",\"cut\",\"drop\",\"dragover\"];this.listenTo(t,\"paste\",i,{priority:\"low\"});this.listenTo(t,\"drop\",i,{priority:\"low\"});function i(e,i){i.preventDefault();const n=i.dropRange?[i.dropRange]:Array.from(t.selection.getRanges());const o=new es(t,\"clipboardInput\");t.fire(o,{dataTransfer:i.dataTransfer,targetRanges:n});if(o.stop.called){i.stopPropagation()}}}onDomEvent(e){const t={dataTransfer:new Xk(e.clipboardData?e.clipboardData:e.dataTransfer)};if(e.type==\"drop\"){t.dropRange=Zk(this.view,e)}this.fire(e.type,e,t)}}function Zk(e,t){const i=t.target.ownerDocument;const n=t.clientX;const o=t.clientY;let r;if(i.caretRangeFromPoint&&i.caretRangeFromPoint(n,o)){r=i.caretRangeFromPoint(n,o)}else if(t.rangeParent){r=i.createRange();r.setStart(t.rangeParent,t.rangeOffset);r.collapse(true)}if(r){return e.domConverter.domRangeToView(r)}else{return e.document.selection.getFirstRange()}}function ey(e){e=e.replace(//g,\">\").replace(/\\n/g,\"

\").replace(/^\\s/,\" \").replace(/\\s$/,\" \").replace(/\\s\\s/g,\"  \");if(e.indexOf(\"

\")>-1){e=`

${e}

`}return e}function ty(e){return e.replace(/(\\s+)<\\/span>/g,(e,t)=>{if(t.length==1){return\" \"}return t})}const iy=[\"figcaption\",\"li\"];function ny(e){let t=\"\";if(e.is(\"text\")||e.is(\"textProxy\")){t=e.data}else if(e.is(\"img\")&&e.hasAttribute(\"alt\")){t=e.getAttribute(\"alt\")}else{let i=null;for(const n of e.getChildren()){const e=ny(n);if(i&&(i.is(\"containerElement\")||n.is(\"containerElement\"))){if(iy.includes(i.name)||iy.includes(n.name)){t+=\"\\n\"}else{t+=\"\\n\\n\"}}t+=e;i=n}}return t}class oy extends Nw{static get pluginName(){return\"Clipboard\"}init(){const e=this.editor;const t=e.model.document;const i=e.editing.view;const n=i.document;this._htmlDataProcessor=new vp(n);i.addObserver(Kk);this.listenTo(n,\"clipboardInput\",t=>{if(e.isReadOnly){t.stop()}},{priority:\"highest\"});this.listenTo(n,\"clipboardInput\",(e,t)=>{const n=t.dataTransfer;let o=\"\";if(n.getData(\"text/html\")){o=ty(n.getData(\"text/html\"))}else if(n.getData(\"text/plain\")){o=ey(n.getData(\"text/plain\"))}o=this._htmlDataProcessor.toView(o);this.fire(\"inputTransformation\",{content:o,dataTransfer:n});i.scrollToTheSelection()},{priority:\"low\"});this.listenTo(this,\"inputTransformation\",(e,t)=>{if(!t.content.isEmpty){const e=this.editor.data;const i=this.editor.model;const n=e.toModel(t.content,\"$clipboardHolder\");if(n.childCount==0){return}i.insertContent(n)}},{priority:\"low\"});function o(i,o){const r=o.dataTransfer;o.preventDefault();const s=e.data.toView(e.model.getSelectedContent(t.selection));n.fire(\"clipboardOutput\",{dataTransfer:r,content:s,method:i.name})}this.listenTo(n,\"copy\",o,{priority:\"low\"});this.listenTo(n,\"cut\",(t,i)=>{if(e.isReadOnly){i.preventDefault()}else{o(t,i)}},{priority:\"low\"});this.listenTo(n,\"clipboardOutput\",(i,n)=>{if(!n.content.isEmpty){n.dataTransfer.setData(\"text/html\",this._htmlDataProcessor.toData(n.content));n.dataTransfer.setData(\"text/plain\",ny(n.content))}if(n.method==\"cut\"){e.model.deleteContent(t.selection)}},{priority:\"low\"})}}class ry{constructor(e){this.document=e}createDocumentFragment(e){return new Ul(this.document,e)}createElement(e,t,i){return new jc(this.document,e,t,i)}createText(e){return new Ds(this.document,e)}clone(e,t=false){return e._clone(t)}appendChild(e,t){return t._appendChild(e)}insertChild(e,t,i){return i._insertChild(e,t)}removeChildren(e,t,i){return i._removeChildren(e,t)}remove(e){const t=e.parent;if(t){return this.removeChildren(t.getChildIndex(e),1,t)}return[]}replace(e,t){const i=e.parent;if(i){const n=i.getChildIndex(e);this.removeChildren(n,1,i);this.insertChild(n,t,i);return true}return false}unwrapElement(e){const t=e.parent;if(t){const i=t.getChildIndex(e);this.remove(e);this.insertChild(i,e.getChildren(),t)}}rename(e,t){const i=new jc(this.document,e,t.getAttributes(),t.getChildren());return this.replace(t,i)?i:null}setAttribute(e,t,i){i._setAttribute(e,t)}removeAttribute(e,t){t._removeAttribute(e)}addClass(e,t){t._addClass(e)}removeClass(e,t){t._removeClass(e)}setStyle(e,t,i){if(L(e)&&i===undefined){i=t}i._setStyle(e,t)}removeStyle(e,t){t._removeStyle(e)}setCustomProperty(e,t,i){i._setCustomProperty(e,t)}removeCustomProperty(e,t){return t._removeCustomProperty(e)}createPositionAt(e,t){return dl._createAt(e,t)}createPositionAfter(e){return dl._createAfter(e)}createPositionBefore(e){return dl._createBefore(e)}createRange(e,t){return new ul(e,t)}createRangeOn(e){return ul._createOn(e)}createRangeIn(e){return ul._createIn(e)}createSelection(e,t,i){return new ml(e,t,i)}}class sy extends zw{refresh(){this.isEnabled=D_(this.editor.model)}execute(e){const t=this.editor;const i=t.model;const n=t.plugins.get(Sk);i.change(t=>{const o=Array.isArray(e.file)?e.file:[e.file];for(const e of o){ay(t,i,n,e)}})}}function ay(e,t,i,n){const o=i.createLoader(n);if(!o){return}j_(e,t,{uploadId:o.id})}class cy extends Nw{static get requires(){return[Sk,Jk,oy]}static get pluginName(){return\"ImageUploadEditing\"}constructor(e){super(e);e.config.define(\"image\",{upload:{types:[\"jpeg\",\"png\",\"gif\",\"bmp\",\"webp\",\"tiff\"]}})}init(){const e=this.editor;const t=e.model.document;const i=e.model.schema;const n=e.conversion;const o=e.plugins.get(Sk);const r=kk(e.config.get(\"image.upload.types\"));i.extend(\"image\",{allowAttributes:[\"uploadId\",\"uploadStatus\"]});e.commands.add(\"imageUpload\",new sy(e));n.for(\"upcast\").attributeToAttribute({view:{name:\"img\",key:\"uploadId\"},model:\"uploadId\"});this.listenTo(e.editing.view.document,\"clipboardInput\",(t,i)=>{if(ly(i.dataTransfer)){return}const n=Array.from(i.dataTransfer.files).filter(e=>{if(!e){return false}return r.test(e.type)});const o=i.targetRanges.map(t=>e.editing.mapper.toModelRange(t));e.model.change(i=>{i.setSelection(o);if(n.length){t.stop();e.model.enqueueChange(\"default\",()=>{e.execute(\"imageUpload\",{file:n})})}})});this.listenTo(e.plugins.get(oy),\"inputTransformation\",(t,i)=>{const n=Array.from(e.editing.view.createRangeIn(i.content)).filter(e=>xk(e.item)&&!e.item.getAttribute(\"uploadProcessed\")).map(e=>({promise:yk(e.item),imageElement:e.item}));if(!n.length){return}const r=new ry(e.editing.view.document);for(const e of n){r.setAttribute(\"uploadProcessed\",true,e.imageElement);const t=o.createLoader(e.promise);if(t){r.setAttribute(\"src\",\"\",e.imageElement);r.setAttribute(\"uploadId\",t.id,e.imageElement)}}});e.editing.view.document.on(\"dragover\",(e,t)=>{t.preventDefault()});t.on(\"change\",()=>{const i=t.differ.getChanges({includeChangesInGraveyard:true});for(const t of i){if(t.type==\"insert\"&&t.name!=\"$text\"){const i=t.position.nodeAfter;const n=t.position.root.rootName==\"$graveyard\";for(const t of dy(e,i)){const e=t.getAttribute(\"uploadId\");if(!e){continue}const i=o.loaders.get(e);if(!i){continue}if(n){i.abort()}else if(i.status==\"idle\"){this._readAndUpload(i,t)}}}}})}_readAndUpload(e,t){const i=this.editor;const n=i.model;const o=i.locale.t;const r=i.plugins.get(Sk);const s=i.plugins.get(Jk);n.enqueueChange(\"transparent\",e=>{e.setAttribute(\"uploadStatus\",\"reading\",t)});return e.read().then(()=>{const o=e.upload();if(Cl.isSafari){const e=i.editing.mapper.toViewElement(t);const n=B_(e);i.editing.view.once(\"render\",()=>{if(!n.parent){return}const e=i.editing.view.domConverter.mapViewToDom(n.parent);if(!e){return}const t=e.style.display;e.style.display=\"none\";e._ckHack=e.offsetHeight;e.style.display=t})}n.enqueueChange(\"transparent\",e=>{e.setAttribute(\"uploadStatus\",\"uploading\",t)});return o}).then(e=>{n.enqueueChange(\"transparent\",i=>{i.setAttributes({uploadStatus:\"complete\",src:e.default},t);this._parseAndSetSrcsetAttributeOnImage(e,t,i)});a()}).catch(i=>{if(e.status!==\"error\"&&e.status!==\"aborted\"){throw i}if(e.status==\"error\"&&i){s.showWarning(i,{title:o(\"ce\"),namespace:\"upload\"})}a();n.enqueueChange(\"transparent\",e=>{e.remove(t)})});function a(){n.enqueueChange(\"transparent\",e=>{e.removeAttribute(\"uploadId\",t);e.removeAttribute(\"uploadStatus\",t)});r.destroyLoader(e)}}_parseAndSetSrcsetAttributeOnImage(e,t,i){let n=0;const o=Object.keys(e).filter(e=>{const t=parseInt(e,10);if(!isNaN(t)){n=Math.max(n,t);return true}}).map(t=>`${e[t]} ${t}w`).join(\", \");if(o!=\"\"){i.setAttribute(\"srcset\",{data:o,width:n},t)}}}function ly(e){return Array.from(e.types).includes(\"text/html\")&&e.getData(\"text/html\")!==\"\"}function dy(e,t){return Array.from(e.model.createRangeOn(t)).filter(e=>e.item.is(\"image\")).map(e=>e.item)}class uy extends Nw{static get pluginName(){return\"ImageUpload\"}static get requires(){return[cy,Tk,zk]}}class hy extends zw{constructor(e){super(e);this._childCommands=[]}refresh(){}execute(...e){const t=this._getFirstEnabledCommand();t.execute(e)}registerChildCommand(e){this._childCommands.push(e);e.on(\"change:isEnabled\",()=>this._checkEnabled());this._checkEnabled()}_checkEnabled(){this.isEnabled=!!this._getFirstEnabledCommand()}_getFirstEnabledCommand(){return this._childCommands.find(e=>e.isEnabled)}}class fy extends Nw{static get pluginName(){return\"IndentEditing\"}init(){const e=this.editor;e.commands.add(\"indent\",new hy(e));e.commands.add(\"outdent\",new hy(e))}}var my='';var gy='';class py extends Nw{static get pluginName(){return\"IndentUI\"}init(){const e=this.editor;const t=e.locale;const i=e.t;const n=t.uiLanguageDirection==\"ltr\"?my:gy;const o=t.uiLanguageDirection==\"ltr\"?gy:my;this._defineButton(\"indent\",i(\"bj\"),n);this._defineButton(\"outdent\",i(\"bk\"),o)}_defineButton(e,t,i){const n=this.editor;n.ui.componentFactory.add(e,o=>{const r=n.commands.get(e);const s=new Kb(o);s.set({label:t,icon:i,tooltip:true});s.bind(\"isOn\",\"isEnabled\").to(r,\"value\",\"isEnabled\");this.listenTo(s,\"execute\",()=>{n.execute(e);n.editing.view.focus()});return s})}}class by extends Nw{static get pluginName(){return\"Indent\"}static get requires(){return[fy,py]}}const wy=\"italic\";class _y extends Nw{static get pluginName(){return\"ItalicEditing\"}init(){const e=this.editor;e.model.schema.extend(\"$text\",{allowAttributes:wy});e.model.schema.setAttributeProperties(wy,{isFormatting:true,copyOnEnter:true});e.conversion.attributeToElement({model:wy,view:\"i\",upcastAlso:[\"em\",{styles:{\"font-style\":\"italic\"}}]});e.commands.add(wy,new Gw(e,wy));e.keystrokes.set(\"CTRL+I\",wy)}}var vy='';const ky=\"italic\";class yy extends Nw{init(){const e=this.editor;const t=e.t;e.ui.componentFactory.add(ky,i=>{const n=e.commands.get(ky);const o=new Kb(i);o.set({label:t(\"bt\"),icon:vy,keystroke:\"CTRL+I\",tooltip:true,isToggleable:true});o.bind(\"isOn\",\"isEnabled\").to(n,\"value\",\"isEnabled\");this.listenTo(o,\"execute\",()=>{e.execute(ky);e.editing.view.focus()});return o})}}class xy extends Nw{static get requires(){return[_y,yy]}static get pluginName(){return\"Italic\"}}function Ay(e,t,i){return i.createRange(Cy(e,t,true,i),Cy(e,t,false,i))}function Cy(e,t,i,n){let o=e.textNode||(i?e.nodeBefore:e.nodeAfter);let r=null;while(o&&o.getAttribute(\"linkHref\")==t){r=o;o=i?o.previousSibling:o.nextSibling}return r?n.createPositionAt(r,i?\"before\":\"after\"):e}class Ty extends zw{constructor(e){super(e);this.manualDecorators=new ys}restoreManualDecoratorStates(){for(const e of this.manualDecorators){e.value=this._getDecoratorStateFromModel(e.id)}}refresh(){const e=this.editor.model;const t=e.document;this.value=t.selection.getAttribute(\"linkHref\");for(const e of this.manualDecorators){e.value=this._getDecoratorStateFromModel(e.id)}this.isEnabled=e.schema.checkAttributeInSelection(t.selection,\"linkHref\")}execute(e,t={}){const i=this.editor.model;const n=i.document.selection;const o=[];const r=[];for(const e in t){if(t[e]){o.push(e)}else{r.push(e)}}i.change(t=>{if(n.isCollapsed){const s=n.getFirstPosition();if(n.hasAttribute(\"linkHref\")){const a=Ay(s,n.getAttribute(\"linkHref\"),i);t.setAttribute(\"linkHref\",e,a);o.forEach(e=>{t.setAttribute(e,true,a)});r.forEach(e=>{t.removeAttribute(e,a)});t.setSelection(a)}else if(e!==\"\"){const r=Hs(n.getAttributes());r.set(\"linkHref\",e);o.forEach(e=>{r.set(e,true)});const a=t.createText(e,r);i.insertContent(a,s);t.setSelection(t.createRangeOn(a))}}else{const s=i.schema.getValidRanges(n.getRanges(),\"linkHref\");for(const i of s){t.setAttribute(\"linkHref\",e,i);o.forEach(e=>{t.setAttribute(e,true,i)});r.forEach(e=>{t.removeAttribute(e,i)})}}})}_getDecoratorStateFromModel(e){const t=this.editor.model.document;return t.selection.getAttribute(e)||false}}class Ey extends zw{refresh(){this.isEnabled=this.editor.model.document.selection.hasAttribute(\"linkHref\")}execute(){const e=this.editor;const t=this.editor.model;const i=t.document.selection;const n=e.commands.get(\"link\");t.change(e=>{const o=i.isCollapsed?[Ay(i.getFirstPosition(),i.getAttribute(\"linkHref\"),t)]:i.getRanges();for(const t of o){e.removeAttribute(\"linkHref\",t);if(n){for(const i of n.manualDecorators){e.removeAttribute(i.id,t)}}}})}}function My(e,t,i){var n=e.length;i=i===undefined?n:i;return!t&&i>=n?e:Ia(e,t,i)}var Py=My;var Sy=\"\\\\ud800-\\\\udfff\",Iy=\"\\\\u0300-\\\\u036f\",Ny=\"\\\\ufe20-\\\\ufe2f\",Oy=\"\\\\u20d0-\\\\u20ff\",Ly=Iy+Ny+Oy,Ry=\"\\\\ufe0e\\\\ufe0f\";var zy=\"\\\\u200d\";var jy=RegExp(\"[\"+zy+Sy+Ly+Ry+\"]\");function Dy(e){return jy.test(e)}var By=Dy;function Vy(e){return e.split(\"\")}var Fy=Vy;var Hy=\"\\\\ud800-\\\\udfff\",Wy=\"\\\\u0300-\\\\u036f\",Uy=\"\\\\ufe20-\\\\ufe2f\",$y=\"\\\\u20d0-\\\\u20ff\",qy=Wy+Uy+$y,Yy=\"\\\\ufe0e\\\\ufe0f\";var Gy=\"[\"+Hy+\"]\",Jy=\"[\"+qy+\"]\",Xy=\"\\\\ud83c[\\\\udffb-\\\\udfff]\",Qy=\"(?:\"+Jy+\"|\"+Xy+\")\",Ky=\"[^\"+Hy+\"]\",Zy=\"(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}\",ex=\"[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]\",tx=\"\\\\u200d\";var ix=Qy+\"?\",nx=\"[\"+Yy+\"]?\",ox=\"(?:\"+tx+\"(?:\"+[Ky,Zy,ex].join(\"|\")+\")\"+nx+ix+\")*\",rx=nx+ix+ox,sx=\"(?:\"+[Ky+Jy+\"?\",Jy,Zy,ex,Gy].join(\"|\")+\")\";var ax=RegExp(Xy+\"(?=\"+Xy+\")|\"+sx+rx,\"g\");function cx(e){return e.match(ax)||[]}var lx=cx;function dx(e){return By(e)?lx(e):Fy(e)}var ux=dx;function hx(e){return function(t){t=va(t);var i=By(t)?ux(t):undefined;var n=i?i[0]:t.charAt(0);var o=i?Py(i,1).join(\"\"):t.slice(1);return n[e]()+o}}var fx=hx;var mx=fx(\"toUpperCase\");var gx=mx;const px=/[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205f\\u3000]/g;const bx=/^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i;function wx(e){return e.is(\"attributeElement\")&&!!e.getCustomProperty(\"link\")}function _x(e,t){const i=t.createAttributeElement(\"a\",{href:e},{priority:5});t.setCustomProperty(\"link\",true,i);return i}function vx(e){e=String(e);return kx(e)?e:\"#\"}function kx(e){const t=e.replace(px,\"\");return t.match(bx)}function yx(e,t){const i={\"Open in a new tab\":e(\"fv\"),Downloadable:e(\"fw\")};t.forEach(e=>{if(e.label&&i[e.label]){e.label=i[e.label]}return e});return t}function xx(e){const t=[];if(e){for(const[i,n]of Object.entries(e)){const e=Object.assign({},n,{id:`link${gx(i)}`});t.push(e)}}return t}class Ax{constructor(){this._definitions=new Set}get length(){return this._definitions.size}add(e){if(Array.isArray(e)){e.forEach(e=>this._definitions.add(e))}else{this._definitions.add(e)}}getDispatcher(){return e=>{e.on(\"attribute:linkHref\",(e,t,i)=>{if(!i.consumable.test(t.item,\"attribute:linkHref\")){return}const n=i.writer;const o=n.document.selection;for(const e of this._definitions){const r=n.createAttributeElement(\"a\",e.attributes,{priority:5});n.setCustomProperty(\"link\",true,r);if(e.callback(t.attributeNewValue)){if(t.item.is(\"selection\")){n.wrap(o.getFirstRange(),r)}else{n.wrap(i.mapper.toViewRange(t.range),r)}}else{n.unwrap(i.mapper.toViewRange(t.range),r)}}},{priority:\"high\"})}}}class Cx{constructor({id:e,label:t,attributes:i}){this.id=e;this.set(\"value\");this.label=t;this.attributes=i}}ks(Cx,Jc);function Tx({view:e,model:t,emitter:i,attribute:n,locale:o}){const r=new Ex(t,i,n);const s=t.document.selection;i.listenTo(e.document,\"keydown\",(e,t)=>{if(!s.isCollapsed){return}if(t.shiftKey||t.altKey||t.ctrlKey){return}const i=t.keyCode==Ll.arrowright;const n=t.keyCode==Ll.arrowleft;if(!i&&!n){return}const a=s.getFirstPosition();const c=o.contentLanguageDirection;let l;if(c===\"ltr\"&&i||c===\"rtl\"&&n){l=r.handleForwardMovement(a,t)}else{l=r.handleBackwardMovement(a,t)}if(l){e.stop()}},{priority:os.get(\"high\")+1})}class Ex{constructor(e,t,i){this.model=e;this.attribute=i;this._modelSelection=e.document.selection;this._overrideUid=null;this._isNextGravityRestorationSkipped=false;t.listenTo(this._modelSelection,\"change:range\",(e,t)=>{if(this._isNextGravityRestorationSkipped){this._isNextGravityRestorationSkipped=false;return}if(!this._isGravityOverridden){return}if(!t.directChange&&Mx(this._modelSelection.getFirstPosition(),i)){return}this._restoreGravity()})}handleForwardMovement(e,t){const i=this.attribute;if(this._isGravityOverridden){return}if(e.isAtStart&&this._hasSelectionAttribute){return}if(Ix(e,i)&&this._hasSelectionAttribute){this._preventCaretMovement(t);this._removeSelectionAttribute();return true}if(Px(e,i)){this._preventCaretMovement(t);this._overrideGravity();return true}if(Sx(e,i)&&this._hasSelectionAttribute){this._preventCaretMovement(t);this._overrideGravity();return true}}handleBackwardMovement(e,t){const i=this.attribute;if(this._isGravityOverridden){if(Ix(e,i)&&this._hasSelectionAttribute){this._preventCaretMovement(t);this._restoreGravity();this._removeSelectionAttribute();return true}else{this._preventCaretMovement(t);this._restoreGravity();if(e.isAtStart){this._removeSelectionAttribute()}return true}}else{if(Ix(e,i)&&!this._hasSelectionAttribute){this._preventCaretMovement(t);this._setSelectionAttributeFromTheNodeBefore(e);return true}if(e.isAtEnd&&Sx(e,i)){if(this._hasSelectionAttribute){if(Nx(e,i)){this._skipNextAutomaticGravityRestoration();this._overrideGravity()}return}else{this._preventCaretMovement(t);this._setSelectionAttributeFromTheNodeBefore(e);return true}}if(e.isAtStart){if(this._hasSelectionAttribute){this._removeSelectionAttribute();this._preventCaretMovement(t);return true}return}if(Nx(e,i)){this._skipNextAutomaticGravityRestoration();this._overrideGravity()}}}get _isGravityOverridden(){return!!this._overrideUid}get _hasSelectionAttribute(){return this._modelSelection.hasAttribute(this.attribute)}_overrideGravity(){this._overrideUid=this.model.change(e=>e.overrideSelectionGravity())}_restoreGravity(){this.model.change(e=>{e.restoreSelectionGravity(this._overrideUid);this._overrideUid=null})}_preventCaretMovement(e){e.preventDefault()}_removeSelectionAttribute(){this.model.change(e=>{e.removeSelectionAttribute(this.attribute)})}_setSelectionAttributeFromTheNodeBefore(e){const t=this.attribute;this.model.change(i=>{i.setSelectionAttribute(this.attribute,e.nodeBefore.getAttribute(t))})}_skipNextAutomaticGravityRestoration(){this._isNextGravityRestorationSkipped=true}}function Mx(e,t){return Px(e,t)||Sx(e,t)}function Px(e,t){const{nodeBefore:i,nodeAfter:n}=e;const o=i?i.hasAttribute(t):false;const r=n?n.hasAttribute(t):false;return r&&(!o||i.getAttribute(t)!==n.getAttribute(t))}function Sx(e,t){const{nodeBefore:i,nodeAfter:n}=e;const o=i?i.hasAttribute(t):false;const r=n?n.hasAttribute(t):false;return o&&(!r||i.getAttribute(t)!==n.getAttribute(t))}function Ix(e,t){const{nodeBefore:i,nodeAfter:n}=e;const o=i?i.hasAttribute(t):false;const r=n?n.hasAttribute(t):false;if(!r||!o){return}return n.getAttribute(t)!==i.getAttribute(t)}function Nx(e,t){return Mx(e.getShiftedBy(-1),t)}var Ox=i(76);const Lx=\"ck-link_selected\";const Rx=\"automatic\";const zx=\"manual\";const jx=/^(https?:)?\\/\\//;class Dx extends Nw{static get pluginName(){return\"LinkEditing\"}constructor(e){super(e);e.config.define(\"link\",{addTargetToExternalLinks:false})}init(){const e=this.editor;const t=e.locale;e.model.schema.extend(\"$text\",{allowAttributes:\"linkHref\"});e.conversion.for(\"dataDowncast\").attributeToElement({model:\"linkHref\",view:_x});e.conversion.for(\"editingDowncast\").attributeToElement({model:\"linkHref\",view:(e,t)=>_x(vx(e),t)});e.conversion.for(\"upcast\").elementToAttribute({view:{name:\"a\",attributes:{href:true}},model:{key:\"linkHref\",value:e=>e.getAttribute(\"href\")}});e.commands.add(\"link\",new Ty(e));e.commands.add(\"unlink\",new Ey(e));const i=yx(e.t,xx(e.config.get(\"link.decorators\")));this._enableAutomaticDecorators(i.filter(e=>e.mode===Rx));this._enableManualDecorators(i.filter(e=>e.mode===zx));Tx({view:e.editing.view,model:e.model,emitter:this,attribute:\"linkHref\",locale:t});this._setupLinkHighlight()}_enableAutomaticDecorators(e){const t=this.editor;const i=new Ax;if(t.config.get(\"link.addTargetToExternalLinks\")){i.add({id:\"linkIsExternal\",mode:Rx,callback:e=>jx.test(e),attributes:{target:\"_blank\",rel:\"noopener noreferrer\"}})}i.add(e);if(i.length){t.conversion.for(\"downcast\").add(i.getDispatcher())}}_enableManualDecorators(e){if(!e.length){return}const t=this.editor;const i=t.commands.get(\"link\");const n=i.manualDecorators;e.forEach(e=>{t.model.schema.extend(\"$text\",{allowAttributes:e.id});n.add(new Cx(e));t.conversion.for(\"downcast\").attributeToElement({model:e.id,view:(t,i)=>{if(t){const t=n.get(e.id).attributes;const o=i.createAttributeElement(\"a\",t,{priority:5});i.setCustomProperty(\"link\",true,o);return o}}});t.conversion.for(\"upcast\").elementToAttribute({view:{name:\"a\",attributes:n.get(e.id).attributes},model:{key:e.id}})})}_setupLinkHighlight(){const e=this.editor;const t=e.editing.view;const i=new Set;t.document.registerPostFixer(t=>{const n=e.model.document.selection;let o=false;if(n.hasAttribute(\"linkHref\")){const r=Ay(n.getFirstPosition(),n.getAttribute(\"linkHref\"),e.model);const s=e.editing.mapper.toViewRange(r);for(const e of s.getItems()){if(e.is(\"a\")&&!e.hasClass(Lx)){t.addClass(Lx,e);i.add(e);o=true}}}return o});e.conversion.for(\"editingDowncast\").add(e=>{e.on(\"insert\",n,{priority:\"highest\"});e.on(\"remove\",n,{priority:\"highest\"});e.on(\"attribute\",n,{priority:\"highest\"});e.on(\"selection\",n,{priority:\"highest\"});function n(){t.change(e=>{for(const t of i.values()){e.removeClass(Lx,t);i.delete(t)}})}})}}class Bx extends Ju{constructor(e){super(e);this.domEventType=\"click\"}onDomEvent(e){this.fire(e.type,e)}}var Vx=i(78);class Fx extends gb{constructor(e,t=[]){super(e);const i=e.t;this.focusTracker=new xp;this.keystrokes=new dp;this.urlInputView=this._createUrlInput();this.saveButtonView=this._createButton(i(\"ea\"),hv,\"ck-button-save\");this.saveButtonView.type=\"submit\";this.cancelButtonView=this._createButton(i(\"eb\"),fv,\"ck-button-cancel\",\"cancel\");this._manualDecoratorSwitches=this._createManualDecoratorSwitches(t);this.children=this._createFormChildren(t);this._focusables=new Bp;this._focusCycler=new Nb({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:\"shift + tab\",focusNext:\"tab\"}});const n=[\"ck\",\"ck-link-form\"];if(t.length){n.push(\"ck-link-form_layout-vertical\")}this.setTemplate({tag:\"form\",attributes:{class:n,tabindex:\"-1\"},children:this.children})}getDecoratorSwitchesState(){return Array.from(this._manualDecoratorSwitches).reduce((e,t)=>{e[t.name]=t.isOn;return e},{})}render(){super.render();uv({view:this});const e=[this.urlInputView,...this._manualDecoratorSwitches,this.saveButtonView,this.cancelButtonView];e.forEach(e=>{this._focusables.add(e);this.focusTracker.add(e.element)});this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}_createUrlInput(){const e=this.locale.t;const t=new cv(this.locale,dv);t.label=e(\"gb\");t.inputView.placeholder=\"https://example.com\";return t}_createButton(e,t,i,n){const o=new Kb(this.locale);o.set({label:e,icon:t,tooltip:true});o.extendTemplate({attributes:{class:i}});if(n){o.delegate(\"execute\").to(this,n)}return o}_createManualDecoratorSwitches(e){const t=this.createCollection();for(const i of e){const e=new sw(this.locale);e.set({name:i.id,label:i.label,withText:true});e.bind(\"isOn\").to(i,\"value\");e.on(\"execute\",()=>{i.set(\"value\",!e.isOn)});t.add(e)}return t}_createFormChildren(e){const t=this.createCollection();t.add(this.urlInputView);if(e.length){const e=new gb;e.setTemplate({tag:\"ul\",children:this._manualDecoratorSwitches.map(e=>({tag:\"li\",children:[e],attributes:{class:[\"ck\",\"ck-list__item\"]}})),attributes:{class:[\"ck\",\"ck-reset\",\"ck-list\"]}});t.add(e)}t.add(this.saveButtonView);t.add(this.cancelButtonView);return t}}var Hx='';var Wx='';var Ux=i(80);class $x extends gb{constructor(e){super(e);const t=e.t;this.focusTracker=new xp;this.keystrokes=new dp;this.previewButtonView=this._createPreviewButton();this.unlinkButtonView=this._createButton(t(\"fx\"),Hx,\"unlink\");this.editButtonView=this._createButton(t(\"fy\"),Wx,\"edit\");this.set(\"href\");this._focusables=new Bp;this._focusCycler=new Nb({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\"],tabindex:\"-1\"},children:[this.previewButtonView,this.editButtonView,this.unlinkButtonView]})}render(){super.render();const e=[this.previewButtonView,this.editButtonView,this.unlinkButtonView];e.forEach(e=>{this._focusables.add(e);this.focusTracker.add(e.element)});this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}_createButton(e,t,i){const n=new Kb(this.locale);n.set({label:e,icon:t,tooltip:true});n.delegate(\"execute\").to(this,i);return n}_createPreviewButton(){const e=new Kb(this.locale);const t=this.bindTemplate;const i=this.t;e.set({withText:true,tooltip:i(\"fz\")});e.extendTemplate({attributes:{class:[\"ck\",\"ck-link-actions__preview\"],href:t.to(\"href\",e=>e&&vx(e)),target:\"_blank\",rel:\"noopener noreferrer\"}});e.bind(\"label\").to(this,\"href\",e=>e||i(\"ga\"));e.bind(\"isEnabled\").to(this,\"href\",e=>!!e);e.template.tag=\"a\";e.template.eventListeners={};return e}}var qx='';const Yx=\"Ctrl+K\";class Gx extends Nw{static get requires(){return[Mv]}static get pluginName(){return\"LinkUI\"}init(){const e=this.editor;e.editing.view.addObserver(Bx);this.actionsView=this._createActionsView();this.formView=this._createFormView();this._balloon=e.plugins.get(Mv);this._createToolbarLinkButton();this._enableUserBalloonInteractions()}destroy(){super.destroy();this.formView.destroy()}_createActionsView(){const e=this.editor;const t=new $x(e.locale);const i=e.commands.get(\"link\");const n=e.commands.get(\"unlink\");t.bind(\"href\").to(i,\"value\");t.editButtonView.bind(\"isEnabled\").to(i);t.unlinkButtonView.bind(\"isEnabled\").to(n);this.listenTo(t,\"edit\",()=>{this._addFormView()});this.listenTo(t,\"unlink\",()=>{e.execute(\"unlink\");this._hideUI()});t.keystrokes.set(\"Esc\",(e,t)=>{this._hideUI();t()});t.keystrokes.set(Yx,(e,t)=>{this._addFormView();t()});return t}_createFormView(){const e=this.editor;const t=e.commands.get(\"link\");const i=new Fx(e.locale,t.manualDecorators);i.urlInputView.bind(\"value\").to(t,\"value\");i.urlInputView.bind(\"isReadOnly\").to(t,\"isEnabled\",e=>!e);i.saveButtonView.bind(\"isEnabled\").to(t);this.listenTo(i,\"submit\",()=>{e.execute(\"link\",i.urlInputView.inputView.element.value,i.getDecoratorSwitchesState());this._closeFormView()});this.listenTo(i,\"cancel\",()=>{this._closeFormView()});i.keystrokes.set(\"Esc\",(e,t)=>{this._closeFormView();t()});return i}_createToolbarLinkButton(){const e=this.editor;const t=e.commands.get(\"link\");const i=e.t;e.keystrokes.set(Yx,(e,t)=>{t();this._showUI(true)});e.ui.componentFactory.add(\"link\",e=>{const n=new Kb(e);n.isEnabled=true;n.label=i(\"bl\");n.icon=qx;n.keystroke=Yx;n.tooltip=true;n.isToggleable=true;n.bind(\"isEnabled\").to(t,\"isEnabled\");n.bind(\"isOn\").to(t,\"value\",e=>!!e);this.listenTo(n,\"execute\",()=>this._showUI(true));return n})}_enableUserBalloonInteractions(){const e=this.editor.editing.view.document;this.listenTo(e,\"click\",()=>{const e=this._getSelectedLinkElement();if(e){this._showUI()}});this.editor.keystrokes.set(\"Tab\",(e,t)=>{if(this._areActionsVisible&&!this.actionsView.focusTracker.isFocused){this.actionsView.focus();t()}},{priority:\"high\"});this.editor.keystrokes.set(\"Esc\",(e,t)=>{if(this._isUIVisible){this._hideUI();t()}});aw({emitter:this.formView,activator:()=>this._isUIInPanel,contextElements:[this._balloon.view.element],callback:()=>this._hideUI()})}_addActionsView(){if(this._areActionsInPanel){return}this._balloon.add({view:this.actionsView,position:this._getBalloonPositionData()})}_addFormView(){if(this._isFormInPanel){return}const e=this.editor;const t=e.commands.get(\"link\");this._balloon.add({view:this.formView,position:this._getBalloonPositionData()});if(this._balloon.visibleView===this.formView){this.formView.urlInputView.select()}this.formView.urlInputView.inputView.element.value=t.value||\"\"}_closeFormView(){const e=this.editor.commands.get(\"link\");e.restoreManualDecoratorStates();if(e.value!==undefined){this._removeFormView()}else{this._hideUI()}}_removeFormView(){if(this._isFormInPanel){this.formView.saveButtonView.focus();this._balloon.remove(this.formView);this.editor.editing.view.focus()}}_showUI(e=false){if(!this._getSelectedLinkElement()){this._addActionsView();if(e){this._balloon.showStack(\"main\")}this._addFormView()}else{if(this._areActionsVisible){this._addFormView()}else{this._addActionsView()}if(e){this._balloon.showStack(\"main\")}}this._startUpdatingUI()}_hideUI(){if(!this._isUIInPanel){return}const e=this.editor;this.stopListening(e.ui,\"update\");this.stopListening(this._balloon,\"change:visibleView\");e.editing.view.focus();this._removeFormView();this._balloon.remove(this.actionsView)}_startUpdatingUI(){const e=this.editor;const t=e.editing.view.document;let i=this._getSelectedLinkElement();let n=r();const o=()=>{const e=this._getSelectedLinkElement();const t=r();if(i&&!e||!i&&t!==n){this._hideUI()}else if(this._isUIVisible){this._balloon.updatePosition(this._getBalloonPositionData())}i=e;n=t};function r(){return t.selection.focus.getAncestors().reverse().find(e=>e.is(\"element\"))}this.listenTo(e.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(){const e=this._balloon.visibleView;return e==this.formView||this._areActionsVisible}_getBalloonPositionData(){const e=this.editor.editing.view;const t=e.document;const i=this._getSelectedLinkElement();const n=i?e.domConverter.mapViewToDom(i):e.domConverter.viewRangeToDom(t.selection.getFirstRange());return{target:n}}_getSelectedLinkElement(){const e=this.editor.editing.view;const t=e.document.selection;if(t.isCollapsed){return Jx(t.getFirstPosition())}else{const i=t.getFirstRange().getTrimmed();const n=Jx(i.start);const o=Jx(i.end);if(!n||n!=o){return null}if(e.createRangeIn(n).getTrimmed().isEqual(i)){return n}else{return null}}}}function Jx(e){return e.getAncestors().find(e=>wx(e))}class Xx extends Nw{static get requires(){return[Dx,Gx]}static get pluginName(){return\"Link\"}}class Qx extends zw{constructor(e,t){super(e);this.type=t}refresh(){this.value=this._getValue();this.isEnabled=this._checkEnabled()}execute(){const e=this.editor.model;const t=e.document;const i=Array.from(t.selection.getSelectedBlocks()).filter(t=>Zx(t,e.schema));const n=this.value===true;e.change(e=>{if(n){let t=i[i.length-1].nextSibling;let n=Number.POSITIVE_INFINITY;let o=[];while(t&&t.name==\"listItem\"&&t.getAttribute(\"listIndent\")!==0){const e=t.getAttribute(\"listIndent\");if(e=i){if(r>o.getAttribute(\"listIndent\")){r=o.getAttribute(\"listIndent\")}if(o.getAttribute(\"listIndent\")==r){e[t?\"unshift\":\"push\"](o)}o=o[t?\"previousSibling\":\"nextSibling\"]}}}function Zx(e,t){return t.checkChild(e.parent,\"listItem\")&&!t.isObject(e)}class eA extends zw{constructor(e,t){super(e);this._indentBy=t==\"forward\"?1:-1}refresh(){this.isEnabled=this._checkEnabled()}execute(){const e=this.editor.model;const t=e.document;let i=Array.from(t.selection.getSelectedBlocks());e.change(e=>{const t=i[i.length-1];let n=t.nextSibling;while(n&&n.name==\"listItem\"&&n.getAttribute(\"listIndent\")>t.getAttribute(\"listIndent\")){i.push(n);n=n.nextSibling}if(this._indentBy<0){i=i.reverse()}for(const t of i){const i=t.getAttribute(\"listIndent\")+this._indentBy;if(i<0){e.rename(t,\"paragraph\")}else{e.setAttribute(\"listIndent\",i,t)}}})}_checkEnabled(){const e=Dw(this.editor.model.document.selection.getSelectedBlocks());if(!e||!e.is(\"listItem\")){return false}if(this._indentBy>0){const t=e.getAttribute(\"listIndent\");const i=e.getAttribute(\"listType\");let n=e.previousSibling;while(n&&n.is(\"listItem\")&&n.getAttribute(\"listIndent\")>=t){if(n.getAttribute(\"listIndent\")==t){return n.getAttribute(\"listType\")==i}n=n.previousSibling}return false}return true}}function tA(e){const t=e.createContainerElement(\"li\");t.getFillerOffset=cA;return t}function iA(e,t){const i=t.mapper;const n=t.writer;const o=e.getAttribute(\"listType\")==\"numbered\"?\"ol\":\"ul\";const r=tA(n);const s=n.createContainerElement(o,null);n.insert(n.createPositionAt(s,0),r);i.bindElements(e,r);return r}function nA(e,t,i,n){const o=t.parent;const r=i.mapper;const s=i.writer;let a=r.toViewPosition(n.createPositionBefore(e));const c=sA(e.previousSibling,{sameIndent:true,smallerIndent:true,listIndent:e.getAttribute(\"listIndent\")});const l=e.previousSibling;if(c&&c.getAttribute(\"listIndent\")==e.getAttribute(\"listIndent\")){const e=r.toViewElement(c);a=s.breakContainer(s.createPositionAfter(e))}else{if(l&&l.name==\"listItem\"){a=r.toViewPosition(n.createPositionAt(l,\"end\"))}else{a=r.toViewPosition(n.createPositionBefore(e))}}a=rA(a);s.insert(a,o);if(l&&l.name==\"listItem\"){const e=r.toViewElement(l);const i=s.createRange(s.createPositionAt(e,0),a);const n=i.getWalker({ignoreElementEnd:true});for(const e of n){if(e.item.is(\"li\")){const i=s.breakContainer(s.createPositionBefore(e.item));const o=e.item.parent;const r=s.createPositionAt(t,\"end\");oA(s,r.nodeBefore,r.nodeAfter);s.move(s.createRangeOn(o),r);n.position=i}}}else{const i=o.nextSibling;if(i&&(i.is(\"ul\")||i.is(\"ol\"))){let n=null;for(const t of i.getChildren()){const i=r.toModelElement(t);if(i&&i.getAttribute(\"listIndent\")>e.getAttribute(\"listIndent\")){n=t}else{break}}if(n){s.breakContainer(s.createPositionAfter(n));s.move(s.createRangeOn(n.parent),s.createPositionAt(t,\"end\"))}}}oA(s,o,o.nextSibling);oA(s,o.previousSibling,o)}function oA(e,t,i){if(!t||!i||t.name!=\"ul\"&&t.name!=\"ol\"){return null}if(t.name!=i.name||t.getAttribute(\"class\")!==i.getAttribute(\"class\")){return null}return e.mergeContainers(e.createPositionAfter(t))}function rA(e){return e.getLastMatchingPosition(e=>e.item.is(\"uiElement\"))}function sA(e,t){const i=!!t.sameIndent;const n=!!t.smallerIndent;const o=t.listIndent;let r=e;while(r&&r.name==\"listItem\"){const e=r.getAttribute(\"listIndent\");if(i&&o==e||n&&o>e){return r}r=r.previousSibling}return null}function aA(e,t,i,n){e.ui.componentFactory.add(t,o=>{const r=e.commands.get(t);const s=new Kb(o);s.set({label:i,icon:n,tooltip:true,isToggleable:true});s.bind(\"isOn\",\"isEnabled\").to(r,\"value\",\"isEnabled\");s.on(\"execute\",()=>{e.execute(t);e.editing.view.focus()});return s})}function cA(){const e=!this.isEmpty&&(this.getChild(0).name==\"ul\"||this.getChild(0).name==\"ol\");if(this.isEmpty||e){return 0}return Hc.call(this)}function lA(e){return(t,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;const s=iA(r,n);nA(r,s,n,e)}}function dA(e){return(t,i,n)=>{const o=n.mapper.toViewPosition(i.position).getLastMatchingPosition(e=>!e.item.is(\"li\"));const r=o.nodeAfter;const s=n.writer;s.breakContainer(s.createPositionBefore(r));s.breakContainer(s.createPositionAfter(r));const a=r.parent;const c=a.previousSibling;const l=s.createRangeOn(a);const d=s.remove(l);if(c&&c.nextSibling){oA(s,c,c.nextSibling)}const u=n.mapper.toModelElement(r);CA(u.getAttribute(\"listIndent\")+1,i.position,l.start,r,n,e);for(const e of s.createRangeIn(d).getItems()){n.mapper.unbindViewElement(e)}t.stop()}}function uA(e,t,i){if(!i.consumable.consume(t.item,\"attribute:listType\")){return}const n=i.mapper.toViewElement(t.item);const o=i.writer;o.breakContainer(o.createPositionBefore(n));o.breakContainer(o.createPositionAfter(n));const r=n.parent;const s=t.attributeNewValue==\"numbered\"?\"ol\":\"ul\";o.rename(s,r)}function hA(e,t,i){const n=i.mapper.toViewElement(t.item);const o=n.parent;const r=i.writer;oA(r,o,o.nextSibling);oA(r,o.previousSibling,o);for(const e of t.item.getChildren()){i.consumable.consume(e,\"insert\")}}function fA(e){return(t,i,n)=>{if(!n.consumable.consume(i.item,\"attribute:listIndent\")){return}const o=n.mapper.toViewElement(i.item);const r=n.writer;r.breakContainer(r.createPositionBefore(o));r.breakContainer(r.createPositionAfter(o));const s=o.parent;const a=s.previousSibling;const c=r.createRangeOn(s);r.remove(c);if(a&&a.nextSibling){oA(r,a,a.nextSibling)}CA(i.attributeOldValue+1,i.range.start,c.start,o,n,e);nA(i.item,o,n,e);for(const e of i.item.getChildren()){n.consumable.consume(e,\"insert\")}}}function mA(e,t,i){if(t.item.name!=\"listItem\"){let e=i.mapper.toViewPosition(t.range.start);const n=i.writer;const o=[];while(e.parent.name==\"ul\"||e.parent.name==\"ol\"){e=n.breakContainer(e);if(e.parent.name!=\"li\"){break}const t=e;const i=n.createPositionAt(e.parent,\"end\");if(!t.isEqual(i)){const e=n.remove(n.createRange(t,i));o.push(e)}e=n.createPositionAfter(e.parent)}if(o.length>0){for(let t=0;t0){const t=oA(n,i,i.nextSibling);if(t&&t.parent==i){e.offset--}}}oA(n,e.nodeBefore,e.nodeAfter)}}}function gA(e,t,i){const n=i.mapper.toViewPosition(t.position);const o=n.nodeBefore;const r=n.nodeAfter;oA(i.writer,o,r)}function pA(e,t,i){if(i.consumable.consume(t.viewItem,{name:true})){const e=i.writer;const n=e.createElement(\"listItem\");const o=EA(t.viewItem);e.setAttribute(\"listIndent\",o,n);const r=t.viewItem.parent&&t.viewItem.parent.name==\"ol\"?\"numbered\":\"bulleted\";e.setAttribute(\"listType\",r,n);const s=i.splitToAllowedParent(n,t.modelCursor);if(!s){return}e.insert(n,s.position);const a=xA(n,t.viewItem.getChildren(),i);t.modelRange=e.createRange(t.modelCursor,a);if(s.cursorParent){t.modelCursor=e.createPositionAt(s.cursorParent,0)}else{t.modelCursor=t.modelRange.end}}}function bA(e,t,i){if(i.consumable.test(t.viewItem,{name:true})){const e=Array.from(t.viewItem.getChildren());for(const t of e){const e=!(t.is(\"li\")||TA(t));if(e){t._remove()}}}}function wA(e,t,i){if(i.consumable.test(t.viewItem,{name:true})){if(t.viewItem.childCount===0){return}const e=[...t.viewItem.getChildren()];let i=false;let n=true;for(const t of e){if(i&&!TA(t)){t._remove()}if(t.is(\"text\")){if(n){t._data=t.data.replace(/^\\s+/,\"\")}if(!t.nextSibling||TA(t.nextSibling)){t._data=t.data.replace(/\\s+$/,\"\")}}else if(TA(t)){i=true}n=false}}}function _A(e){return(t,i)=>{if(i.isPhantom){return}const n=i.modelPosition.nodeBefore;if(n&&n.is(\"listItem\")){const t=i.mapper.toViewElement(n);const o=t.getAncestors().find(TA);const r=e.createPositionAt(t,0).getWalker();for(const e of r){if(e.type==\"elementStart\"&&e.item.is(\"li\")){i.viewPosition=e.previousPosition;break}else if(e.type==\"elementEnd\"&&e.item==o){i.viewPosition=e.nextPosition;break}}}}}function vA(e){return(t,i)=>{const n=i.viewPosition;const o=n.parent;const r=i.mapper;if(o.name==\"ul\"||o.name==\"ol\"){if(!n.isAtEnd){const t=r.toModelElement(n.nodeAfter);i.modelPosition=e.createPositionBefore(t)}else{const t=r.toModelElement(n.nodeBefore);const o=r.getModelLength(n.nodeBefore);i.modelPosition=e.createPositionBefore(t).getShiftedBy(o)}t.stop()}else if(o.name==\"li\"&&n.nodeBefore&&(n.nodeBefore.name==\"ul\"||n.nodeBefore.name==\"ol\")){const s=r.toModelElement(o);let a=1;let c=n.nodeBefore;while(c&&TA(c)){a+=r.getModelLength(c);c=c.previousSibling}i.modelPosition=e.createPositionBefore(s).getShiftedBy(a);t.stop()}}}function kA(e,t){const i=e.document.differ.getChanges();const n=new Map;let o=false;for(const n of i){if(n.type==\"insert\"&&n.name==\"listItem\"){r(n.position)}else if(n.type==\"insert\"&&n.name!=\"listItem\"){if(n.name!=\"$text\"){const i=n.position.nodeAfter;if(i.hasAttribute(\"listIndent\")){t.removeAttribute(\"listIndent\",i);o=true}if(i.hasAttribute(\"listType\")){t.removeAttribute(\"listType\",i);o=true}for(const t of Array.from(e.createRangeIn(i)).filter(e=>e.item.is(\"listItem\"))){r(t.previousPosition)}}const i=n.position.getShiftedBy(n.length);r(i)}else if(n.type==\"remove\"&&n.name==\"listItem\"){r(n.position)}else if(n.type==\"attribute\"&&n.attributeKey==\"listIndent\"){r(n.range.start)}else if(n.type==\"attribute\"&&n.attributeKey==\"listType\"){r(n.range.start)}}for(const e of n.values()){s(e);a(e)}return o;function r(e){const t=e.nodeBefore;if(!t||!t.is(\"listItem\")){const t=e.nodeAfter;if(t&&t.is(\"listItem\")){n.set(t,t)}}else{let i=t;if(n.has(i)){return}while(i.previousSibling&&i.previousSibling.is(\"listItem\")){i=i.previousSibling;if(n.has(i)){return}}n.set(e.nodeBefore,i)}}function s(e){let i=0;let n=null;while(e&&e.is(\"listItem\")){const r=e.getAttribute(\"listIndent\");if(r>i){let s;if(n===null){n=r-i;s=i}else{if(n>r){n=r}s=r-n}t.setAttribute(\"listIndent\",s,e);o=true}else{n=null;i=e.getAttribute(\"listIndent\")+1}e=e.nextSibling}}function a(e){let i=[];let n=null;while(e&&e.is(\"listItem\")){const r=e.getAttribute(\"listIndent\");if(n&&n.getAttribute(\"listIndent\")>r){i=i.slice(0,r+1)}if(r!=0){if(i[r]){const n=i[r];if(e.getAttribute(\"listType\")!=n){t.setAttribute(\"listType\",n,e);o=true}}else{i[r]=e.getAttribute(\"listType\")}}n=e;e=e.nextSibling}}}function yA(e,[t,i]){let n=t.is(\"documentFragment\")?t.getChild(0):t;let o;if(!i){o=this.document.selection}else{o=this.createSelection(i)}if(n&&n.is(\"listItem\")){const e=o.getFirstPosition();let t=null;if(e.parent.is(\"listItem\")){t=e.parent}else if(e.nodeBefore&&e.nodeBefore.is(\"listItem\")){t=e.nodeBefore}if(t){const e=t.getAttribute(\"listIndent\");if(e>0){while(n&&n.is(\"listItem\")){n._setAttribute(\"listIndent\",n.getAttribute(\"listIndent\")+e);n=n.nextSibling}}}}}function xA(e,t,i){const{writer:n,schema:o}=i;let r=n.createPositionAfter(e);for(const s of t){if(s.name==\"ul\"||s.name==\"ol\"){r=i.convertItem(s,r).modelCursor}else{const t=i.convertItem(s,n.createPositionAt(e,\"end\"));const a=t.modelRange.start.nodeAfter;const c=a&&a.is(\"element\")&&!o.checkChild(e,a.name);if(c){if(t.modelCursor.parent.is(\"listItem\")){e=t.modelCursor.parent}else{e=AA(t.modelCursor)}r=n.createPositionAfter(e)}}}return r}function AA(e){const t=new Wh({startPosition:e});let i;do{i=t.next()}while(!i.value.item.is(\"listItem\"));return i.value.item}function CA(e,t,i,n,o,r){const s=sA(t.nodeBefore,{sameIndent:true,smallerIndent:true,listIndent:e,foo:\"b\"});const a=o.mapper;const c=o.writer;const l=s?s.getAttribute(\"listIndent\"):null;let d;if(!s){d=i}else if(l==e){const e=a.toViewElement(s).parent;d=c.createPositionAfter(e)}else{const e=r.createPositionAt(s,\"end\");d=a.toViewPosition(e)}d=rA(d);for(const e of[...n.getChildren()]){if(TA(e)){d=c.move(c.createRangeOn(e),d).end;oA(c,e,e.nextSibling);oA(c,e.previousSibling,e)}}}function TA(e){return e.is(\"ol\")||e.is(\"ul\")}function EA(e){let t=0;let i=e.parent;while(i){if(i.is(\"li\")){t++}else{const e=i.previousSibling;if(e&&e.is(\"li\")){t++}}i=i.parent}return t}class MA extends Nw{static get pluginName(){return\"ListEditing\"}static get requires(){return[n_]}init(){const e=this.editor;e.model.schema.register(\"listItem\",{inheritAllFrom:\"$block\",allowAttributes:[\"listType\",\"listIndent\"]});const t=e.data;const i=e.editing;e.model.document.registerPostFixer(t=>kA(e.model,t));i.mapper.registerViewToModelLength(\"li\",PA);t.mapper.registerViewToModelLength(\"li\",PA);i.mapper.on(\"modelToViewPosition\",_A(i.view));i.mapper.on(\"viewToModelPosition\",vA(e.model));t.mapper.on(\"modelToViewPosition\",_A(i.view));e.conversion.for(\"editingDowncast\").add(t=>{t.on(\"insert\",mA,{priority:\"high\"});t.on(\"insert:listItem\",lA(e.model));t.on(\"attribute:listType:listItem\",uA,{priority:\"high\"});t.on(\"attribute:listType:listItem\",hA,{priority:\"low\"});t.on(\"attribute:listIndent:listItem\",fA(e.model));t.on(\"remove:listItem\",dA(e.model));t.on(\"remove\",gA,{priority:\"low\"})});e.conversion.for(\"dataDowncast\").add(t=>{t.on(\"insert\",mA,{priority:\"high\"});t.on(\"insert:listItem\",lA(e.model))});e.conversion.for(\"upcast\").add(e=>{e.on(\"element:ul\",bA,{priority:\"high\"});e.on(\"element:ol\",bA,{priority:\"high\"});e.on(\"element:li\",wA,{priority:\"high\"});e.on(\"element:li\",pA)});e.model.on(\"insertContent\",yA,{priority:\"high\"});e.commands.add(\"numberedList\",new Qx(e,\"numbered\"));e.commands.add(\"bulletedList\",new Qx(e,\"bulleted\"));e.commands.add(\"indentList\",new eA(e,\"forward\"));e.commands.add(\"outdentList\",new eA(e,\"backward\"));const n=i.view.document;this.listenTo(n,\"enter\",(e,t)=>{const i=this.editor.model.document;const n=i.selection.getLastPosition().parent;if(i.selection.isCollapsed&&n.name==\"listItem\"&&n.isEmpty){this.editor.execute(\"outdentList\");t.preventDefault();e.stop()}});this.listenTo(n,\"delete\",(e,t)=>{if(t.direction!==\"backward\"){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(o.name!==\"listItem\"){return}const r=o.previousSibling&&o.previousSibling.name===\"listItem\";if(r){return}this.editor.execute(\"outdentList\");t.preventDefault();e.stop()},{priority:\"high\"});const o=e=>(t,i)=>{const n=this.editor.commands.get(e);if(n.isEnabled){this.editor.execute(e);i()}};e.keystrokes.set(\"Tab\",o(\"indentList\"));e.keystrokes.set(\"Shift+Tab\",o(\"outdentList\"))}afterInit(){const e=this.editor.commands;const t=e.get(\"indent\");const i=e.get(\"outdent\");if(t){t.registerChildCommand(e.get(\"indentList\"))}if(i){i.registerChildCommand(e.get(\"outdentList\"))}}}function PA(e){let t=1;for(const i of e.getChildren()){if(i.name==\"ul\"||i.name==\"ol\"){for(const e of i.getChildren()){t+=PA(e)}}}return t}var SA='';var IA='';class NA extends Nw{init(){const e=this.editor.t;aA(this.editor,\"numberedList\",e(\"bm\"),SA);aA(this.editor,\"bulletedList\",e(\"bn\"),IA)}}class OA extends Nw{static get requires(){return[MA,NA]}static get pluginName(){return\"List\"}}function LA(e,t){return e=>{e.on(\"attribute:url:media\",i)};function i(i,n,o){if(!o.consumable.consume(n.item,i.name)){return}const r=n.attributeNewValue;const s=o.writer;const a=o.mapper.toViewElement(n.item);s.remove(s.createRangeIn(a));const c=e.getMediaViewElement(s,r,t);s.insert(s.createPositionAt(a,0),c)}}function RA(e,t,i){t.setCustomProperty(\"media\",true,e);return A_(e,t,{label:i})}function zA(e){const t=e.getSelectedElement();if(t&&jA(t)){return t}return null}function jA(e){return!!e.getCustomProperty(\"media\")&&x_(e)}function DA(e,t,i,n){const o=e.createContainerElement(\"figure\",{class:\"media\"});o.getFillerOffset=FA;e.insert(e.createPositionAt(o,0),t.getMediaViewElement(e,i,n));return o}function BA(e){const t=e.getSelectedElement();if(t&&t.is(\"media\")){return t}return null}function VA(e,t,i){e.change(n=>{const o=n.createElement(\"media\",{url:t});e.insertContent(o,i);n.setSelection(o,\"on\")})}function FA(){return null}class HA extends zw{refresh(){const e=this.editor.model;const t=e.document.selection;const i=e.schema;const n=t.getFirstPosition();const o=BA(t);let r=n.parent;if(r!=r.root){r=r.parent}this.value=o?o.getAttribute(\"url\"):null;this.isEnabled=i.checkChild(r,\"media\")}execute(e){const t=this.editor.model;const i=t.document.selection;const n=BA(i);if(n){t.change(t=>{t.setAttribute(\"url\",e,n)})}else{const n=P_(i,t);VA(t,e,n)}}}var WA='';const UA=\"0 0 64 42\";class $A{constructor(e,t){const i=t.providers;const n=t.extraProviders||[];const o=new Set(t.removeProviders);const r=i.concat(n).filter(e=>{const t=e.name;if(!t){console.warn(Object(ss[\"a\"])(\"media-embed-no-provider-name: The configured media provider has no name and cannot be used.\"),{provider:e});return false}return!o.has(t)});this.locale=e;this.providerDefinitions=r}hasMedia(e){return!!this._getMedia(e)}getMediaViewElement(e,t,i){return this._getMedia(t).getViewElement(e,i)}_getMedia(e){if(!e){return new qA(this.locale)}e=e.trim();for(const t of this.providerDefinitions){const i=t.html;let n=t.url;if(!Array.isArray(n)){n=[n]}for(const t of n){const n=this._getUrlMatches(e,t);if(n){return new qA(this.locale,e,n,i)}}}return null}_getUrlMatches(e,t){let i=e.match(t);if(i){return i}let n=e.replace(/^https?:\\/\\//,\"\");i=n.match(t);if(i){return i}n=n.replace(/^www\\./,\"\");i=n.match(t);if(i){return i}return null}}class qA{constructor(e,t,i,n){this.url=this._getValidUrl(t);this._t=e.t;this._match=i;this._previewRenderer=n}getViewElement(e,t){const i={};if(t.renderForEditingView||t.renderMediaPreview&&this.url&&this._previewRenderer){if(this.url){i[\"data-oembed-url\"]=this.url}if(t.renderForEditingView){i.class=\"ck-media__wrapper\"}const n=this._getPreviewHtml(t);return e.createUIElement(\"div\",i,(function(e){const t=this.toDomElement(e);t.innerHTML=n;return t}))}else{if(this.url){i.url=this.url}return e.createEmptyElement(\"oembed\",i)}}_getPreviewHtml(e){if(this._previewRenderer){return this._previewRenderer(this._match)}else{if(this.url&&e.renderForEditingView){return this._getPlaceholderHtml()}return\"\"}}_getPlaceholderHtml(){const e=new Xb;const t=new Gb;e.text=this._t(\"Open media in new tab\");t.content=WA;t.viewBox=UA;const i=new Hp({tag:\"div\",attributes:{class:\"ck ck-reset_all ck-media__placeholder\"},children:[{tag:\"div\",attributes:{class:\"ck-media__placeholder__icon\"},children:[t]},{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]},e]}]}).render();return i.outerHTML}_getValidUrl(e){if(!e){return null}if(e.match(/^https?/)){return e}return\"https://\"+e}}var YA=i(82);class GA extends Nw{static get pluginName(){return\"MediaEmbedEditing\"}constructor(e){super(e);e.config.define(\"mediaEmbed\",{providers:[{name:\"dailymotion\",url:/^dailymotion\\.com\\/video\\/(\\w+)/,html:e=>{const t=e[1];return'
'+`\"+\"
\"}},{name:\"spotify\",url:[/^open\\.spotify\\.com\\/(artist\\/\\w+)/,/^open\\.spotify\\.com\\/(album\\/\\w+)/,/^open\\.spotify\\.com\\/(track\\/\\w+)/],html:e=>{const t=e[1];return'
'+`\"+\"
\"}},{name:\"youtube\",url:[/^(?:m\\.)?youtube\\.com\\/watch\\?v=([\\w-]+)/,/^(?:m\\.)?youtube\\.com\\/v\\/([\\w-]+)/,/^youtube\\.com\\/embed\\/([\\w-]+)/,/^youtu\\.be\\/([\\w-]+)/],html:e=>{const t=e[1];return'
'+`\"+\"
\"}},{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:e=>{const t=e[1];return'
'+`\"+\"
\"}},{name:\"instagram\",url:/^instagram\\.com\\/p\\/(\\w+)/},{name:\"twitter\",url:/^twitter\\.com/},{name:\"googleMaps\",url:/^google\\.com\\/maps/},{name:\"flickr\",url:/^flickr\\.com/},{name:\"facebook\",url:/^facebook\\.com/}]});this.registry=new $A(e.locale,e.config.get(\"mediaEmbed\"))}init(){const e=this.editor;const t=e.model.schema;const i=e.t;const n=e.conversion;const o=e.config.get(\"mediaEmbed.previewsInData\");const r=this.registry;e.commands.add(\"mediaEmbed\",new HA(e));t.register(\"media\",{isObject:true,isBlock:true,allowWhere:\"$block\",allowAttributes:[\"url\"]});n.for(\"dataDowncast\").elementToElement({model:\"media\",view:(e,t)=>{const i=e.getAttribute(\"url\");return DA(t,r,i,{renderMediaPreview:i&&o})}});n.for(\"dataDowncast\").add(LA(r,{renderMediaPreview:o}));n.for(\"editingDowncast\").elementToElement({model:\"media\",view:(e,t)=>{const n=e.getAttribute(\"url\");const o=DA(t,r,n,{renderForEditingView:true});return RA(o,t,i(\"bo\"))}});n.for(\"editingDowncast\").add(LA(r,{renderForEditingView:true}));n.for(\"upcast\").elementToElement({view:{name:\"oembed\",attributes:{url:true}},model:(e,t)=>{const i=e.getAttribute(\"url\");if(r.hasMedia(i)){return t.createElement(\"media\",{url:i})}}}).elementToElement({view:{name:\"div\",attributes:{\"data-oembed-url\":true}},model:(e,t)=>{const i=e.getAttribute(\"data-oembed-url\");if(r.hasMedia(i)){return t.createElement(\"media\",{url:i})}}})}}const JA=new Map;function XA(e,t,i){let n=JA.get(e);if(!n){n=new Map;JA.set(e,n)}n.set(t,i)}function QA(e,t){const i=JA.get(e);if(i&&i.has(t)){return i.get(t)}return KA}function KA(e){return[e]}function ZA(e,t,i={}){const n=QA(e.constructor,t.constructor);try{e=e.clone();return n(e,t,i)}catch(e){throw e}}function eC(e,t,i){e=e.slice();t=t.slice();const n=new tC(i.document,i.useRelations,i.forceWeakRemove);n.setOriginalOperations(e);n.setOriginalOperations(t);const o=n.originalOperations;if(e.length==0||t.length==0){return{operationsA:e,operationsB:t,originalOperations:o}}const r=new WeakMap;for(const t of e){r.set(t,0)}const s={nextBaseVersionA:e[e.length-1].baseVersion+1,nextBaseVersionB:t[t.length-1].baseVersion+1,originalOperationsACount:e.length,originalOperationsBCount:t.length};let a=0;while(a{if(e.key===t.key){const n=e.range.getDifference(t.range).map(t=>new Qm(t,e.key,e.oldValue,e.newValue,0));const o=e.range.getIntersection(t.range);if(o){if(i.aIsStrong){n.push(new Qm(o,t.key,t.newValue,e.newValue,0))}}if(n.length==0){return[new Mg(0)]}return n}else{return[e]}});XA(Qm,eg,(e,t)=>{if(e.range.start.hasSameParentAs(t.position)&&e.range.containsPosition(t.position)){const i=e.range._getTransformedByInsertion(t.position,t.howMany,!t.shouldReceiveAttributes);const n=i.map(t=>new Qm(t,e.key,e.oldValue,e.newValue,e.baseVersion));if(t.shouldReceiveAttributes){const i=oC(t,e.key,e.oldValue);if(i){n.unshift(i)}}return n}e.range=e.range._getTransformedByInsertion(t.position,t.howMany,false)[0];return[e]});function oC(e,t,i){const n=e.nodes;const o=n.getNode(0).getAttribute(t);if(o==i){return null}const r=new qh(e.position,e.position.getShiftedBy(e.howMany));return new Qm(r,t,o,i,0)}XA(Qm,og,(e,t)=>{const i=[];if(e.range.start.hasSameParentAs(t.deletionPosition)){if(e.range.containsPosition(t.deletionPosition)||e.range.start.isEqual(t.deletionPosition)){i.push(qh._createFromPositionAndShift(t.graveyardPosition,1))}}const n=e.range._getTransformedByMergeOperation(t);if(!n.isCollapsed){i.push(n)}return i.map(t=>new Qm(t,e.key,e.oldValue,e.newValue,e.baseVersion))});XA(Qm,Zm,(e,t)=>{const i=rC(e.range,t);return i.map(t=>new Qm(t,e.key,e.oldValue,e.newValue,e.baseVersion))});function rC(e,t){const i=qh._createFromPositionAndShift(t.sourcePosition,t.howMany);let n=null;let o=[];if(i.containsRange(e,true)){n=e}else if(e.start.hasSameParentAs(i.start)){o=e.getDifference(i);n=e.getIntersection(i)}else{o=[e]}const r=[];for(let e of o){e=e._getTransformedByDeletion(t.sourcePosition,t.howMany);const i=t.getMovedRangeStart();const n=e.start.hasSameParentAs(i);e=e._getTransformedByInsertion(i,t.howMany,n);r.push(...e)}if(n){r.push(n._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany,false)[0])}return r}XA(Qm,rg,(e,t)=>{if(e.range.end.isEqual(t.insertionPosition)){if(!t.graveyardPosition){e.range.end.offset++}return[e]}if(e.range.start.hasSameParentAs(t.splitPosition)&&e.range.containsPosition(t.splitPosition)){const i=e.clone();i.range=new qh(t.moveTargetPosition.clone(),e.range.end._getCombined(t.splitPosition,t.moveTargetPosition));e.range.end=t.splitPosition.clone();e.range.end.stickiness=\"toPrevious\";return[e,i]}e.range=e.range._getTransformedBySplitOperation(t);return[e]});XA(eg,Qm,(e,t)=>{const i=[e];if(e.shouldReceiveAttributes&&e.position.hasSameParentAs(t.range.start)&&t.range.containsPosition(e.position)){const n=oC(e,t.key,t.newValue);if(n){i.push(n)}}return i});XA(eg,eg,(e,t,i)=>{if(e.position.isEqual(t.position)&&i.aIsStrong){return[e]}e.position=e.position._getTransformedByInsertOperation(t);return[e]});XA(eg,Zm,(e,t)=>{e.position=e.position._getTransformedByMoveOperation(t);return[e]});XA(eg,rg,(e,t)=>{e.position=e.position._getTransformedBySplitOperation(t);return[e]});XA(eg,og,(e,t)=>{e.position=e.position._getTransformedByMergeOperation(t);return[e]});XA(tg,eg,(e,t)=>{if(e.oldRange){e.oldRange=e.oldRange._getTransformedByInsertOperation(t)[0]}if(e.newRange){e.newRange=e.newRange._getTransformedByInsertOperation(t)[0]}return[e]});XA(tg,tg,(e,t,i)=>{if(e.name==t.name){if(i.aIsStrong){e.oldRange=t.newRange?t.newRange.clone():null}else{return[new Mg(0)]}}return[e]});XA(tg,og,(e,t)=>{if(e.oldRange){e.oldRange=e.oldRange._getTransformedByMergeOperation(t)}if(e.newRange){e.newRange=e.newRange._getTransformedByMergeOperation(t)}return[e]});XA(tg,Zm,(e,t,i)=>{if(e.oldRange){e.oldRange=qh._createFromRanges(e.oldRange._getTransformedByMoveOperation(t))}if(e.newRange){if(i.abRelation){const n=qh._createFromRanges(e.newRange._getTransformedByMoveOperation(t));if(i.abRelation.side==\"left\"&&t.targetPosition.isEqual(e.newRange.start)){e.newRange.start.path=i.abRelation.path;e.newRange.end=n.end;return[e]}else if(i.abRelation.side==\"right\"&&t.targetPosition.isEqual(e.newRange.end)){e.newRange.start=n.start;e.newRange.end.path=i.abRelation.path;return[e]}}e.newRange=qh._createFromRanges(e.newRange._getTransformedByMoveOperation(t))}return[e]});XA(tg,rg,(e,t,i)=>{if(e.oldRange){e.oldRange=e.oldRange._getTransformedBySplitOperation(t)}if(e.newRange){if(i.abRelation){const n=e.newRange._getTransformedBySplitOperation(t);if(e.newRange.start.isEqual(t.splitPosition)&&i.abRelation.wasStartBeforeMergedElement){e.newRange.start=$h._createAt(t.insertionPosition)}else if(e.newRange.start.isEqual(t.splitPosition)&&!i.abRelation.wasInLeftElement){e.newRange.start=$h._createAt(t.moveTargetPosition)}if(e.newRange.end.isEqual(t.splitPosition)&&i.abRelation.wasInRightElement){e.newRange.end=$h._createAt(t.moveTargetPosition)}else if(e.newRange.end.isEqual(t.splitPosition)&&i.abRelation.wasEndBeforeMergedElement){e.newRange.end=$h._createAt(t.insertionPosition)}else{e.newRange.end=n.end}return[e]}e.newRange=e.newRange._getTransformedBySplitOperation(t)}return[e]});XA(og,eg,(e,t)=>{if(e.sourcePosition.hasSameParentAs(t.position)){e.howMany+=t.howMany}e.sourcePosition=e.sourcePosition._getTransformedByInsertOperation(t);e.targetPosition=e.targetPosition._getTransformedByInsertOperation(t);return[e]});XA(og,og,(e,t,i)=>{if(e.sourcePosition.isEqual(t.sourcePosition)&&e.targetPosition.isEqual(t.targetPosition)){if(!i.bWasUndone){return[new Mg(0)]}else{const i=t.graveyardPosition.path.slice();i.push(0);e.sourcePosition=new $h(t.graveyardPosition.root,i);e.howMany=0;return[e]}}if(e.sourcePosition.isEqual(t.sourcePosition)&&!e.targetPosition.isEqual(t.targetPosition)&&!i.bWasUndone&&i.abRelation!=\"splitAtSource\"){const n=e.targetPosition.root.rootName==\"$graveyard\";const o=t.targetPosition.root.rootName==\"$graveyard\";const r=n&&!o;const s=o&&!n;const a=s||!r&&i.aIsStrong;if(a){const i=t.targetPosition._getTransformedByMergeOperation(t);const n=e.targetPosition._getTransformedByMergeOperation(t);return[new Zm(i,e.howMany,n,0)]}else{return[new Mg(0)]}}if(e.sourcePosition.hasSameParentAs(t.targetPosition)){e.howMany+=t.howMany}e.sourcePosition=e.sourcePosition._getTransformedByMergeOperation(t);e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t);if(!e.graveyardPosition.isEqual(t.graveyardPosition)||!i.aIsStrong){e.graveyardPosition=e.graveyardPosition._getTransformedByMergeOperation(t)}return[e]});XA(og,Zm,(e,t,i)=>{const n=qh._createFromPositionAndShift(t.sourcePosition,t.howMany);if(t.type==\"remove\"&&!i.bWasUndone&&!i.forceWeakRemove){if(e.deletionPosition.hasSameParentAs(t.sourcePosition)&&n.containsPosition(e.sourcePosition)){return[new Mg(0)]}}if(e.sourcePosition.hasSameParentAs(t.targetPosition)){e.howMany+=t.howMany}if(e.sourcePosition.hasSameParentAs(t.sourcePosition)){e.howMany-=t.howMany}e.sourcePosition=e.sourcePosition._getTransformedByMoveOperation(t);e.targetPosition=e.targetPosition._getTransformedByMoveOperation(t);if(!e.graveyardPosition.isEqual(t.targetPosition)){e.graveyardPosition=e.graveyardPosition._getTransformedByMoveOperation(t)}return[e]});XA(og,rg,(e,t,i)=>{if(t.graveyardPosition){e.graveyardPosition=e.graveyardPosition._getTransformedByDeletion(t.graveyardPosition,1);if(e.deletionPosition.isEqual(t.graveyardPosition)){e.howMany=t.howMany}}if(e.targetPosition.isEqual(t.splitPosition)){const n=t.howMany!=0;const o=t.graveyardPosition&&e.deletionPosition.isEqual(t.graveyardPosition);if(n||o||i.abRelation==\"mergeTargetNotMoved\"){e.sourcePosition=e.sourcePosition._getTransformedBySplitOperation(t);return[e]}}if(e.sourcePosition.isEqual(t.splitPosition)){if(i.abRelation==\"mergeSourceNotMoved\"){e.howMany=0;e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t);return[e]}if(i.abRelation==\"mergeSameElement\"||e.sourcePosition.offset>0){e.sourcePosition=t.moveTargetPosition.clone();e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t);return[e]}}if(e.sourcePosition.hasSameParentAs(t.splitPosition)){e.howMany=t.splitPosition.offset}e.sourcePosition=e.sourcePosition._getTransformedBySplitOperation(t);e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t);return[e]});XA(Zm,eg,(e,t)=>{const i=qh._createFromPositionAndShift(e.sourcePosition,e.howMany);const n=i._getTransformedByInsertOperation(t,false)[0];e.sourcePosition=n.start;e.howMany=n.end.offset-n.start.offset;if(!e.targetPosition.isEqual(t.position)){e.targetPosition=e.targetPosition._getTransformedByInsertOperation(t)}return[e]});XA(Zm,Zm,(e,t,i)=>{const n=qh._createFromPositionAndShift(e.sourcePosition,e.howMany);const o=qh._createFromPositionAndShift(t.sourcePosition,t.howMany);let r=i.aIsStrong;let s=!i.aIsStrong;if(i.abRelation==\"insertBefore\"||i.baRelation==\"insertAfter\"){s=true}else if(i.abRelation==\"insertAfter\"||i.baRelation==\"insertBefore\"){s=false}let a;if(e.targetPosition.isEqual(t.targetPosition)&&s){a=e.targetPosition._getTransformedByDeletion(t.sourcePosition,t.howMany)}else{a=e.targetPosition._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany)}if(sC(e,t)&&sC(t,e)){return[t.getReversed()]}const c=n.containsPosition(t.targetPosition);if(c&&n.containsRange(o,true)){n.start=n.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany);n.end=n.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany);return aC([n],a)}const l=o.containsPosition(e.targetPosition);if(l&&o.containsRange(n,true)){n.start=n.start._getCombined(t.sourcePosition,t.getMovedRangeStart());n.end=n.end._getCombined(t.sourcePosition,t.getMovedRangeStart());return aC([n],a)}const d=Os(e.sourcePosition.getParentPath(),t.sourcePosition.getParentPath());if(d==\"prefix\"||d==\"extension\"){n.start=n.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany);n.end=n.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany);return aC([n],a)}if(e.type==\"remove\"&&t.type!=\"remove\"&&!i.aWasUndone&&!i.forceWeakRemove){r=true}else if(e.type!=\"remove\"&&t.type==\"remove\"&&!i.bWasUndone&&!i.forceWeakRemove){r=false}const u=[];const h=n.getDifference(o);for(const e of h){e.start=e.start._getTransformedByDeletion(t.sourcePosition,t.howMany);e.end=e.end._getTransformedByDeletion(t.sourcePosition,t.howMany);const i=Os(e.start.getParentPath(),t.getMovedRangeStart().getParentPath())==\"same\";const n=e._getTransformedByInsertion(t.getMovedRangeStart(),t.howMany,i);u.push(...n)}const f=n.getIntersection(o);if(f!==null&&r){f.start=f.start._getCombined(t.sourcePosition,t.getMovedRangeStart());f.end=f.end._getCombined(t.sourcePosition,t.getMovedRangeStart());if(u.length===0){u.push(f)}else if(u.length==1){if(o.start.isBefore(n.start)||o.start.isEqual(n.start)){u.unshift(f)}else{u.push(f)}}else{u.splice(1,0,f)}}if(u.length===0){return[new Mg(e.baseVersion)]}return aC(u,a)});XA(Zm,rg,(e,t,i)=>{let n=e.targetPosition.clone();if(!e.targetPosition.isEqual(t.insertionPosition)||!t.graveyardPosition||i.abRelation==\"moveTargetAfter\"){n=e.targetPosition._getTransformedBySplitOperation(t)}const o=qh._createFromPositionAndShift(e.sourcePosition,e.howMany);if(o.end.isEqual(t.insertionPosition)){if(!t.graveyardPosition){e.howMany++}e.targetPosition=n;return[e]}if(o.start.hasSameParentAs(t.splitPosition)&&o.containsPosition(t.splitPosition)){let e=new qh(t.splitPosition,o.end);e=e._getTransformedBySplitOperation(t);const i=[new qh(o.start,t.splitPosition),e];return aC(i,n)}if(e.targetPosition.isEqual(t.splitPosition)&&i.abRelation==\"insertAtSource\"){n=t.moveTargetPosition}if(e.targetPosition.isEqual(t.insertionPosition)&&i.abRelation==\"insertBetween\"){n=e.targetPosition}const r=o._getTransformedBySplitOperation(t);const s=[r];if(t.graveyardPosition){const n=o.start.isEqual(t.graveyardPosition)||o.containsPosition(t.graveyardPosition);if(e.howMany>1&&n&&!i.aWasUndone){s.push(qh._createFromPositionAndShift(t.insertionPosition,1))}}return aC(s,n)});XA(Zm,og,(e,t,i)=>{const n=qh._createFromPositionAndShift(e.sourcePosition,e.howMany);if(t.deletionPosition.hasSameParentAs(e.sourcePosition)&&n.containsPosition(t.sourcePosition)){if(e.type==\"remove\"&&!i.forceWeakRemove){if(!i.aWasUndone){const i=[];let n=t.graveyardPosition.clone();let o=t.targetPosition._getTransformedByMergeOperation(t);if(e.howMany>1){i.push(new Zm(e.sourcePosition,e.howMany-1,e.targetPosition,0));n=n._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany-1);o=o._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany-1)}const r=t.deletionPosition._getCombined(e.sourcePosition,e.targetPosition);const s=new Zm(n,1,r,0);const a=s.getMovedRangeStart().path.slice();a.push(0);const c=new $h(s.targetPosition.root,a);o=o._getTransformedByMove(n,r,1);const l=new Zm(o,t.howMany,c,0);i.push(s);i.push(l);return i}}else{if(e.howMany==1){if(!i.bWasUndone){return[new Mg(0)]}else{e.sourcePosition=t.graveyardPosition.clone();e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t);return[e]}}}}const o=qh._createFromPositionAndShift(e.sourcePosition,e.howMany);const r=o._getTransformedByMergeOperation(t);e.sourcePosition=r.start;e.howMany=r.end.offset-r.start.offset;e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t);return[e]});XA(ig,eg,(e,t)=>{e.position=e.position._getTransformedByInsertOperation(t);return[e]});XA(ig,og,(e,t)=>{if(e.position.isEqual(t.deletionPosition)){e.position=t.graveyardPosition.clone();e.position.stickiness=\"toNext\";return[e]}e.position=e.position._getTransformedByMergeOperation(t);return[e]});XA(ig,Zm,(e,t)=>{e.position=e.position._getTransformedByMoveOperation(t);return[e]});XA(ig,ig,(e,t,i)=>{if(e.position.isEqual(t.position)){if(i.aIsStrong){e.oldName=t.newName}else{return[new Mg(0)]}}return[e]});XA(ig,rg,(e,t)=>{const i=e.position.path;const n=t.splitPosition.getParentPath();if(Os(i,n)==\"same\"&&!t.graveyardPosition){const t=new ig(e.position.getShiftedBy(1),e.oldName,e.newName,0);return[e,t]}e.position=e.position._getTransformedBySplitOperation(t);return[e]});XA(ng,ng,(e,t,i)=>{if(e.root===t.root&&e.key===t.key){if(!i.aIsStrong||e.newValue===t.newValue){return[new Mg(0)]}else{e.oldValue=t.newValue}}return[e]});XA(rg,eg,(e,t)=>{if(e.splitPosition.hasSameParentAs(t.position)&&e.splitPosition.offset{if(!e.graveyardPosition&&!i.bWasUndone&&e.splitPosition.hasSameParentAs(t.sourcePosition)){const i=t.graveyardPosition.path.slice();i.push(0);const n=new $h(t.graveyardPosition.root,i);const o=rg.getInsertionPosition(new $h(t.graveyardPosition.root,i));const r=new rg(n,0,null,0);r.insertionPosition=o;e.splitPosition=e.splitPosition._getTransformedByMergeOperation(t);e.insertionPosition=rg.getInsertionPosition(e.splitPosition);e.graveyardPosition=r.insertionPosition.clone();e.graveyardPosition.stickiness=\"toNext\";return[r,e]}if(e.splitPosition.hasSameParentAs(t.deletionPosition)&&!e.splitPosition.isAfter(t.deletionPosition)){e.howMany--}if(e.splitPosition.hasSameParentAs(t.targetPosition)){e.howMany+=t.howMany}e.splitPosition=e.splitPosition._getTransformedByMergeOperation(t);e.insertionPosition=rg.getInsertionPosition(e.splitPosition);if(e.graveyardPosition){e.graveyardPosition=e.graveyardPosition._getTransformedByMergeOperation(t)}return[e]});XA(rg,Zm,(e,t,i)=>{const n=qh._createFromPositionAndShift(t.sourcePosition,t.howMany);if(e.graveyardPosition){const o=n.start.isEqual(e.graveyardPosition)||n.containsPosition(e.graveyardPosition);if(!i.bWasUndone&&o){const i=e.splitPosition._getTransformedByMoveOperation(t);const n=e.graveyardPosition._getTransformedByMoveOperation(t);const o=n.path.slice();o.push(0);const r=new $h(n.root,o);const s=new Zm(i,e.howMany,r,0);return[s]}e.graveyardPosition=e.graveyardPosition._getTransformedByMoveOperation(t)}if(e.splitPosition.hasSameParentAs(t.sourcePosition)&&n.containsPosition(e.splitPosition)){const i=t.howMany-(e.splitPosition.offset-t.sourcePosition.offset);e.howMany-=i;if(e.splitPosition.hasSameParentAs(t.targetPosition)&&e.splitPosition.offset{if(e.splitPosition.isEqual(t.splitPosition)){if(!e.graveyardPosition&&!t.graveyardPosition){return[new Mg(0)]}if(e.graveyardPosition&&t.graveyardPosition&&e.graveyardPosition.isEqual(t.graveyardPosition)){return[new Mg(0)]}if(i.abRelation==\"splitBefore\"){e.howMany=0;e.graveyardPosition=e.graveyardPosition._getTransformedBySplitOperation(t);return[e]}}if(e.graveyardPosition&&t.graveyardPosition&&e.graveyardPosition.isEqual(t.graveyardPosition)){const n=e.splitPosition.root.rootName==\"$graveyard\";const o=t.splitPosition.root.rootName==\"$graveyard\";const r=n&&!o;const s=o&&!n;const a=s||!r&&i.aIsStrong;if(a){const i=[];if(t.howMany){i.push(new Zm(t.moveTargetPosition,t.howMany,t.splitPosition,0))}if(e.howMany){i.push(new Zm(e.splitPosition,e.howMany,e.moveTargetPosition,0))}return i}else{return[new Mg(0)]}}if(e.graveyardPosition){e.graveyardPosition=e.graveyardPosition._getTransformedBySplitOperation(t)}if(e.splitPosition.isEqual(t.insertionPosition)&&i.abRelation==\"splitBefore\"){e.howMany++;return[e]}if(t.splitPosition.isEqual(e.insertionPosition)&&i.baRelation==\"splitBefore\"){const i=t.insertionPosition.path.slice();i.push(0);const n=new $h(t.insertionPosition.root,i);const o=new Zm(e.insertionPosition,1,n,0);return[e,o]}if(e.splitPosition.hasSameParentAs(t.splitPosition)&&e.splitPosition.offset0}addBatch(e){const t=this.editor.model.document.selection;const i={ranges:t.hasOwnRange?Array.from(t.getRanges()):[],isBackward:t.isBackward};this._stack.push({batch:e,selection:i});this.refresh()}clearStack(){this._stack=[];this.refresh()}_restoreSelection(e,t,i){const n=this.editor.model;const o=n.document;const r=[];for(const t of e){const e=lC(t,i);const n=e.find(e=>e.start.root!=o.graveyard);if(n){r.push(n)}}if(r.length){n.change(e=>{e.setSelection(r,{backward:t})})}}_undo(e,t){const i=this.editor.model;const n=i.document;this._createdBatches.add(t);const o=e.operations.slice().filter(e=>e.isDocumentOperation);o.reverse();for(const e of o){const o=e.baseVersion+1;const r=Array.from(n.history.getOperations(o));const s=eC([e.getReversed()],r,{useRelations:true,document:this.editor.model.document,padWithNoOps:false,forceWeakRemove:true});const a=s.operationsA;for(const o of a){t.addOperation(o);i.applyOperation(o);n.history.setOperationAsUndone(e,o)}}}}function lC(e,t){const i=e.getTransformedByOperations(t);i.sort((e,t)=>e.start.isBefore(t.start)?-1:1);for(let e=1;et.batch==e):this._stack.length-1;const i=this._stack.splice(t,1)[0];const n=this.editor.model.createBatch(\"transparent\");this.editor.model.enqueueChange(n,()=>{this._undo(i.batch,n);const e=this.editor.model.document.history.getOperations(i.batch.baseVersion);this._restoreSelection(i.selection.ranges,i.selection.isBackward,e);this.fire(\"revert\",i.batch,n)});this.refresh()}}class uC extends cC{execute(){const e=this._stack.pop();const t=this.editor.model.createBatch(\"transparent\");this.editor.model.enqueueChange(t,()=>{const i=e.batch.operations[e.batch.operations.length-1];const n=i.baseVersion+1;const o=this.editor.model.document.history.getOperations(n);this._restoreSelection(e.selection.ranges,e.selection.isBackward,o);this._undo(e.batch,t)});this.refresh()}}class hC extends Nw{static get pluginName(){return\"UndoEditing\"}constructor(e){super(e);this._batchRegistry=new WeakSet}init(){const e=this.editor;this._undoCommand=new dC(e);this._redoCommand=new uC(e);e.commands.add(\"undo\",this._undoCommand);e.commands.add(\"redo\",this._redoCommand);this.listenTo(e.model,\"applyOperation\",(e,t)=>{const i=t[0];if(!i.isDocumentOperation){return}const n=i.batch;const o=this._redoCommand._createdBatches.has(n);const r=this._undoCommand._createdBatches.has(n);const s=this._batchRegistry.has(n);if(s||n.type==\"transparent\"&&!o&&!r){return}else{if(o){this._undoCommand.addBatch(n)}else if(!r){this._undoCommand.addBatch(n);this._redoCommand.clearStack()}}this._batchRegistry.add(n)},{priority:\"highest\"});this.listenTo(this._undoCommand,\"revert\",(e,t,i)=>{this._redoCommand.addBatch(i)});e.keystrokes.set(\"CTRL+Z\",\"undo\");e.keystrokes.set(\"CTRL+Y\",\"redo\");e.keystrokes.set(\"CTRL+SHIFT+Z\",\"redo\")}}var fC='';var mC='';class gC extends Nw{init(){const e=this.editor;const t=e.locale;const i=e.t;const n=t.uiLanguageDirection==\"ltr\"?fC:mC;const o=t.uiLanguageDirection==\"ltr\"?mC:fC;this._addButton(\"undo\",i(\"ed\"),\"CTRL+Z\",n);this._addButton(\"redo\",i(\"ee\"),\"CTRL+Y\",o)}_addButton(e,t,i,n){const o=this.editor;o.ui.componentFactory.add(e,r=>{const s=o.commands.get(e);const a=new Kb(r);a.set({label:t,icon:n,keystroke:i,tooltip:true});a.bind(\"isEnabled\").to(s,\"isEnabled\");this.listenTo(a,\"execute\",()=>{o.execute(e);o.editing.view.focus()});return a})}}class pC extends Nw{static get requires(){return[hC,gC]}static get pluginName(){return\"Undo\"}}const bC=/^(?:http(s)?:\\/\\/)?[\\w.-]+(?:\\.[\\w.-]+)+[\\w\\-._~:/?#[\\]@!$&'()*+,;=]+$/;class wC extends Nw{static get requires(){return[oy,pC]}static get pluginName(){return\"AutoMediaEmbed\"}constructor(e){super(e);this._timeoutId=null;this._positionToInsert=null}init(){const e=this.editor;const t=e.model.document;this.listenTo(e.plugins.get(oy),\"inputTransformation\",()=>{const e=t.selection.getFirstRange();const i=Ig.fromPosition(e.start);i.stickiness=\"toPrevious\";const n=Ig.fromPosition(e.end);n.stickiness=\"toNext\";t.once(\"change:data\",()=>{this._embedMediaBetweenPositions(i,n);i.detach();n.detach()},{priority:\"high\"})});e.commands.get(\"undo\").on(\"execute\",()=>{if(this._timeoutId){Nd.window.clearTimeout(this._timeoutId);this._positionToInsert.detach();this._timeoutId=null;this._positionToInsert=null}},{priority:\"high\"})}_embedMediaBetweenPositions(e,t){const i=this.editor;const n=i.plugins.get(GA).registry;const o=new rf(e,t);const r=o.getWalker({ignoreElementEnd:true});let s=\"\";for(const e of r){if(e.item.is(\"textProxy\")){s+=e.item.data}}s=s.trim();if(!s.match(bC)){return}if(!n.hasMedia(s)){return}const a=i.commands.get(\"mediaEmbed\");if(!a.isEnabled){return}this._positionToInsert=Ig.fromPosition(e);this._timeoutId=Nd.window.setTimeout(()=>{i.model.change(e=>{this._timeoutId=null;e.remove(o);let t;if(this._positionToInsert.root.rootName!==\"$graveyard\"){t=this._positionToInsert}VA(i.model,s,t);this._positionToInsert.detach();this._positionToInsert=null})},100)}}var _C=i(84);class vC extends gb{constructor(e,t){super(t);const i=t.t;this.focusTracker=new xp;this.keystrokes=new dp;this.urlInputView=this._createUrlInput();this.saveButtonView=this._createButton(i(\"ea\"),hv,\"ck-button-save\");this.saveButtonView.type=\"submit\";this.cancelButtonView=this._createButton(i(\"eb\"),fv,\"ck-button-cancel\",\"cancel\");this._focusables=new Bp;this._focusCycler=new Nb({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:\"shift + tab\",focusNext:\"tab\"}});this._validators=e;this.setTemplate({tag:\"form\",attributes:{class:[\"ck\",\"ck-media-form\"],tabindex:\"-1\"},children:[this.urlInputView,this.saveButtonView,this.cancelButtonView]})}render(){super.render();uv({view:this});const e=[this.urlInputView,this.saveButtonView,this.cancelButtonView];e.forEach(e=>{this._focusables.add(e);this.focusTracker.add(e.element)});this.keystrokes.listenTo(this.element);const t=e=>e.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\",(e,t)=>{t.stopPropagation()},{priority:\"high\"})}focus(){this._focusCycler.focusFirst()}get url(){return this.urlInputView.inputView.element.value.trim()}set url(e){this.urlInputView.inputView.element.value=e.trim()}isValid(){this.resetFormStatus();for(const e of this._validators){const t=e(this);if(t){this.urlInputView.errorText=t;return false}}return true}resetFormStatus(){this.urlInputView.errorText=null;this.urlInputView.infoText=this._urlInputViewInfoDefault}_createUrlInput(){const e=this.locale.t;const t=new cv(this.locale,dv);const i=t.inputView;this._urlInputViewInfoDefault=e(\"fs\");this._urlInputViewInfoTip=e(\"ft\");t.label=e(\"fu\");t.infoText=this._urlInputViewInfoDefault;i.placeholder=\"https://example.com\";i.on(\"input\",()=>{t.infoText=i.element.value?this._urlInputViewInfoTip:this._urlInputViewInfoDefault});return t}_createButton(e,t,i,n){const o=new Kb(this.locale);o.set({label:e,icon:t,tooltip:true});o.extendTemplate({attributes:{class:i}});if(n){o.delegate(\"execute\").to(this,n)}return o}}var kC='\\n';class yC extends Nw{static get requires(){return[GA]}static get pluginName(){return\"MediaEmbedUI\"}init(){const e=this.editor;const t=e.commands.get(\"mediaEmbed\");const i=e.plugins.get(GA).registry;this.form=new vC(xC(e.t,i),e.locale);e.ui.componentFactory.add(\"mediaEmbed\",i=>{const n=dw(i);this._setUpDropdown(n,this.form,t,e);this._setUpForm(this.form,n,t);return n})}_setUpDropdown(e,t,i){const n=this.editor;const o=n.t;const r=e.buttonView;e.bind(\"isEnabled\").to(i);e.panelView.children.add(t);r.set({label:o(\"bp\"),icon:kC,tooltip:true});r.on(\"open\",()=>{t.url=i.value||\"\";t.urlInputView.select();t.focus()},{priority:\"low\"});e.on(\"submit\",()=>{if(t.isValid()){n.execute(\"mediaEmbed\",t.url);s()}});e.on(\"change:isOpen\",()=>t.resetFormStatus());e.on(\"cancel\",()=>s());function s(){n.editing.view.focus();e.isOpen=false}}_setUpForm(e,t,i){e.delegate(\"submit\",\"cancel\").to(t);e.urlInputView.bind(\"value\").to(i,\"value\");e.urlInputView.bind(\"isReadOnly\").to(i,\"isEnabled\",e=>!e);e.saveButtonView.bind(\"isEnabled\").to(i)}}function xC(e,t){return[t=>{if(!t.url.length){return e(\"bq\")}},i=>{if(!t.hasMedia(i.url)){return e(\"br\")}}]}var AC=i(86);class CC extends Nw{static get requires(){return[GA,yC,wC,Z_]}static get pluginName(){return\"MediaEmbed\"}}function TC(e,t){let i=t.parent;while(i){if(i.name===e){return i}i=i.parent}}function EC(e,t,i,n,o=1){if(t>o){n.setAttribute(e,t,i)}else{n.removeAttribute(e,i)}}function MC(e,t,i={}){const n=e.createElement(\"tableCell\",i);e.insertElement(\"paragraph\",n);e.insert(n,t)}function PC(e){if(!e||!ce(e)){return e}const{top:t,right:i,bottom:n,left:o}=e;if(t==i&&i==n&&n==o){return t}}function SC(e,t){const i=parseFloat(e);if(Number.isNaN(i)){return e}if(String(i)!==String(e)){return e}return`${i}${t}`}function IC(e,t){const i=t.parent.parent;const n=parseInt(i.getAttribute(\"headingColumns\")||0);const{column:o}=e.getCellLocation(t);return!!n&&o{e.on(\"element:table\",(e,t,i)=>{const n=t.viewItem;if(!i.consumable.test(n,{name:true})){return}const{rows:o,headingRows:r,headingColumns:s}=LC(n);const a={};if(s){a.headingColumns=s}if(r){a.headingRows=r}const c=i.writer.createElement(\"table\",a);const l=i.splitToAllowedParent(c,t.modelCursor);if(!l){return}i.writer.insert(c,l.position);i.consumable.consume(n,{name:true});if(o.length){o.forEach(e=>i.convertItem(e,i.writer.createPositionAt(c,\"end\")))}else{const e=i.writer.createElement(\"tableRow\");i.writer.insert(e,i.writer.createPositionAt(c,\"end\"));MC(i.writer,i.writer.createPositionAt(e,\"end\"))}t.modelRange=i.writer.createRange(i.writer.createPositionBefore(c),i.writer.createPositionAfter(c));if(l.cursorParent){t.modelCursor=i.writer.createPositionAt(l.cursorParent,0)}else{t.modelCursor=t.modelRange.end}})}}function OC(e){return t=>{t.on(`element:${e}`,(e,t,i)=>{const n=t.viewItem;if(!i.consumable.test(n,{name:true})){return}const o=i.writer.createElement(\"tableCell\");const r=i.splitToAllowedParent(o,t.modelCursor);if(!r){return}i.writer.insert(o,r.position);i.consumable.consume(n,{name:true});const s=i.writer.createPositionAt(o,0);i.convertChildren(n,s);if(!o.childCount){i.writer.insertElement(\"paragraph\",s)}t.modelRange=i.writer.createRange(i.writer.createPositionBefore(o),i.writer.createPositionAfter(o));t.modelCursor=t.modelRange.end})}}function LC(e){const t={headingRows:0,headingColumns:0};const i=[];const n=[];let o;for(const r of Array.from(e.getChildren())){if(r.name===\"tbody\"||r.name===\"thead\"||r.name===\"tfoot\"){if(r.name===\"thead\"&&!o){o=r}const e=Array.from(r.getChildren()).filter(e=>e.is(\"element\",\"tr\"));for(const r of e){if(r.parent.name===\"thead\"&&r.parent===o){t.headingRows++;i.push(r)}else{n.push(r);const e=RC(r,t,o);if(e>t.headingColumns){t.headingColumns=e}}}}}t.rows=[...i,...n];return t}function RC(e){let t=0;let i=0;const n=Array.from(e.getChildren()).filter(e=>e.name===\"th\"||e.name===\"td\");while(i1||r>1){this._recordSpans(this._row,this._column,r,o,t)}this._nextCellAtColumn=this._column+o;i=this._shouldSkipRow()||this._shouldSkipColumn();n=this._formatOutValue(t,this._column,false,r,o)}this._column++;if(this._column==this._nextCellAtColumn){this._cellIndex++}return i?this.next():n}skipRow(e){this._skipRows.add(e)}_isOverEndRow(){return this.endRow!==undefined&&this._row>this.endRow}_formatOutValue(e,t,i,n=1,o=1){return{done:false,value:{cell:e,row:this._row,column:t,isSpanned:i,rowspan:n,colspan:o,cellIndex:this._cellIndex}}}_shouldSkipRow(){const e=this._rowt.on(\"insert:table\",(t,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=e&&e.asWidget;const s=n.writer.createContainerElement(\"figure\",{class:\"table\"});const a=n.writer.createContainerElement(\"table\");n.writer.insert(n.writer.createPositionAt(s,0),a);let c;if(r){c=jC(s,n.writer)}const l=new zC(o);const d={headingRows:o.getAttribute(\"headingRows\")||0,headingColumns:o.getAttribute(\"headingColumns\")||0};const u=new Map;for(const t of l){const{row:i,cell:r}=t;const s=oT(nT(i,d),a,n);const c=o.getChild(i);const l=u.get(i)||tT(c,i,s,n);u.set(i,l);n.consumable.consume(r,\"insert\");const h=n.writer.createPositionAt(l,\"end\");eT(t,d,h,n,e)}const h=n.mapper.toViewPosition(i.range.start);n.mapper.bindElements(o,r?c:s);n.writer.insert(h,r?c:s)})}function YC(e={}){return t=>t.on(\"insert:tableRow\",(t,i,n)=>{const o=i.item;if(!n.consumable.consume(o,\"insert\")){return}const r=o.parent;const s=n.mapper.toViewElement(r);const a=lT(s);const c=r.getChildIndex(o);const l=new zC(r,{startRow:c,endRow:c});const d={headingRows:r.getAttribute(\"headingRows\")||0,headingColumns:r.getAttribute(\"headingColumns\")||0};const u=new Map;for(const t of l){const i=oT(nT(c,d),a,n);const r=u.get(c)||tT(o,c,i,n);u.set(c,r);n.consumable.consume(t.cell,\"insert\");const s=n.writer.createPositionAt(r,\"end\");eT(t,d,s,n,e)}})}function GC(e={}){return t=>t.on(\"insert:tableCell\",(t,i,n)=>{const o=i.item;if(!n.consumable.consume(o,\"insert\")){return}const r=o.parent;const s=r.parent;const a=s.getChildIndex(r);const c=new zC(s,{startRow:a,endRow:a});const l={headingRows:s.getAttribute(\"headingRows\")||0,headingColumns:s.getAttribute(\"headingColumns\")||0};for(const t of c){if(t.cell===o){const i=n.mapper.toViewElement(r);const s=n.writer.createPositionAt(i,r.getChildIndex(o));eT(t,l,s,n,e);return}}})}function JC(e={}){const t=!!e.asWidget;return e=>e.on(\"attribute:headingRows:table\",(e,i,n)=>{const o=i.item;if(!n.consumable.consume(i.item,e.name)){return}const r=n.mapper.toViewElement(o);const s=lT(r);const a=i.attributeOldValue;const c=i.attributeNewValue;if(c>a){const e=Array.from(o.getChildren()).filter(({index:e})=>l(e,a-1,c));const i=oT(\"thead\",s,n);cT(e,i,n,\"end\");for(const i of e){for(const e of i.getChildren()){KC(e,\"th\",n,t)}}aT(\"tbody\",s,n)}else{const e=Array.from(o.getChildren()).filter(({index:e})=>l(e,c-1,a)).reverse();const i=oT(\"tbody\",s,n);cT(e,i,n,0);const r=new zC(o,{startRow:c?c-1:c,endRow:a-1});const d={headingRows:o.getAttribute(\"headingRows\")||0,headingColumns:o.getAttribute(\"headingColumns\")||0};for(const e of r){ZC(e,d,n,t)}aT(\"thead\",s,n)}function l(e,t,i){return e>t&&ee.on(\"attribute:headingColumns:table\",(e,i,n)=>{const o=i.item;if(!n.consumable.consume(i.item,e.name)){return}const r={headingRows:o.getAttribute(\"headingRows\")||0,headingColumns:o.getAttribute(\"headingColumns\")||0};const s=i.attributeOldValue;const a=i.attributeNewValue;const c=(s>a?s:a)-1;for(const e of new zC(o)){if(e.column>c){continue}ZC(e,r,n,t)}})}function QC(){return e=>e.on(\"remove:tableRow\",(e,t,i)=>{e.stop();const n=i.writer;const o=i.mapper;const r=o.toViewPosition(t.position).getLastMatchingPosition(e=>!e.item.is(\"tr\"));const s=r.nodeAfter;const a=s.parent;const c=n.createRangeOn(s);const l=n.remove(c);for(const e of n.createRangeIn(l).getItems()){o.unbindViewElement(e)}if(!a.childCount){n.remove(n.createRangeOn(a))}},{priority:\"higher\"})}function KC(e,t,i,n){const o=i.writer;const r=i.mapper.toViewElement(e);if(!r){return}let s;if(n){const e=o.createEditableElement(t,r.getAttributes());s=M_(e,o);o.insert(o.createPositionAfter(r),s);o.move(o.createRangeIn(r),o.createPositionAt(s,0));o.remove(o.createRangeOn(r))}else{s=o.rename(t,r)}i.mapper.unbindViewElement(r);i.mapper.bindElements(e,s)}function ZC(e,t,i,n){const{cell:o}=e;const r=iT(e,t);const s=i.mapper.toViewElement(o);if(s&&s.name!==r){KC(o,r,i,n)}}function eT(e,t,i,n,o){const r=o&&o.asWidget;const s=iT(e,t);const a=r?M_(n.writer.createEditableElement(s),n.writer):n.writer.createContainerElement(s);const c=e.cell;const l=c.getChild(0);const d=c.childCount===1&&l.name===\"paragraph\";n.writer.insert(i,a);if(d&&!dT(l)){const e=c.getChild(0);const t=n.writer.createPositionAt(a,\"end\");n.consumable.consume(e,\"insert\");if(o.asWidget){const i=n.writer.createContainerElement(\"span\",{style:\"display:inline-block\"});n.mapper.bindElements(e,i);n.writer.insert(t,i);n.mapper.bindElements(c,a)}else{n.mapper.bindElements(c,a);n.mapper.bindElements(e,a)}}else{n.mapper.bindElements(c,a)}}function tT(e,t,i,n){n.consumable.consume(e,\"insert\");const o=n.writer.createContainerElement(\"tr\");n.mapper.bindElements(e,o);const r=e.parent.getAttribute(\"headingRows\")||0;const s=r>0&&t>=r?t-r:t;const a=n.writer.createPositionAt(i,s);n.writer.insert(a,o);return o}function iT(e,t){const{row:i,column:n}=e;const{headingColumns:o,headingRows:r}=t;const s=r&&r>i;if(s){return\"th\"}const a=o&&o>n;return a?\"th\":\"td\"}function nT(e,t){return e{const i=n.createTable(e,o,r);t.insertContent(i,s);e.setSelection(e.createPositionAt(i.getNodeByPath([0,0,0]),0))})}}function hT(e){const t=e.parent;return t===t.root?t:t.parent}class fT extends zw{constructor(e,t={}){super(e);this.order=t.order||\"below\"}refresh(){const e=this.editor.model.document.selection;const t=TC(\"table\",e.getFirstPosition());this.isEnabled=!!t}execute(){const e=this.editor;const t=e.model.document.selection;const i=e.plugins.get(\"TableUtils\");const n=this.order===\"above\";const o=n?t.getFirstPosition():t.getLastPosition();const r=n?t.getFirstRange():t.getLastRange();const s=r.getContainedElement()||TC(\"tableCell\",o);const a=s.parent;const c=a.parent;const l=c.getChildIndex(a);i.insertRows(c,{rows:1,at:this.order===\"below\"?l+1:l})}}class mT extends zw{constructor(e,t={}){super(e);this.order=t.order||\"right\"}refresh(){const e=this.editor.model.document.selection;const t=TC(\"table\",e.getFirstPosition());this.isEnabled=!!t}execute(){const e=this.editor;const t=e.model.document.selection;const i=e.plugins.get(\"TableUtils\");const n=this.order===\"left\";const o=n?t.getFirstPosition():t.getLastPosition();const r=n?t.getFirstRange():t.getLastRange();const s=r.getContainedElement()||TC(\"tableCell\",o);const a=s.parent.parent;const{column:c}=i.getCellLocation(s);i.insertColumns(a,{columns:1,at:n?c:c+1})}}class gT extends zw{constructor(e,t={}){super(e);this.direction=t.direction||\"horizontally\"}refresh(){const e=WC(this.editor.model.document.selection);this.isEnabled=e.length===1}execute(){const e=WC(this.editor.model.document.selection)[0];const t=this.direction===\"horizontally\";const i=this.editor.plugins.get(\"TableUtils\");if(t){i.splitCellHorizontally(e,2)}else{i.splitCellVertically(e,2)}}}class pT extends zw{constructor(e,t){super(e);this.direction=t.direction;this.isHorizontal=this.direction==\"right\"||this.direction==\"left\"}refresh(){const e=this._getMergeableCell();this.value=e;this.isEnabled=!!e}execute(){const e=this.editor.model;const t=e.document;const i=HC(t.selection)[0];const n=this.value;const o=this.direction;e.change(e=>{const t=o==\"right\"||o==\"down\";const r=t?i:n;const s=t?n:i;const a=s.parent;vT(s,r,e);const c=this.isHorizontal?\"colspan\":\"rowspan\";const l=parseInt(i.getAttribute(c)||1);const d=parseInt(n.getAttribute(c)||1);e.setAttribute(c,l+d,r);e.setSelection(e.createRangeIn(r));if(!a.childCount){_T(a,e)}})}_getMergeableCell(){const e=this.editor.model;const t=e.document;const i=HC(t.selection)[0];if(!i){return}const n=this.editor.plugins.get(\"TableUtils\");const o=this.isHorizontal?bT(i,this.direction,n):wT(i,this.direction);if(!o){return}const r=this.isHorizontal?\"rowspan\":\"colspan\";const s=parseInt(i.getAttribute(r)||1);const a=parseInt(o.getAttribute(r)||1);if(a===s){return o}}}function bT(e,t,i){const n=e.parent;const o=n.parent;const r=t==\"right\"?e.nextSibling:e.previousSibling;const s=(o.getAttribute(\"headingColumns\")||0)>0;if(!r){return}const a=t==\"right\"?e:r;const c=t==\"right\"?r:e;const{column:l}=i.getCellLocation(a);const{column:d}=i.getCellLocation(c);const u=parseInt(a.getAttribute(\"colspan\")||1);const h=IC(i,a,o);const f=IC(i,c,o);if(s&&h!=f){return}const m=l+u===d;return m?r:undefined}function wT(e,t){const i=e.parent;const n=i.parent;const o=n.getChildIndex(i);if(t==\"down\"&&o===n.childCount-1||t==\"up\"&&o===0){return}const r=parseInt(e.getAttribute(\"rowspan\")||1);const s=n.getAttribute(\"headingRows\")||0;const a=t==\"down\"&&o+r===s;const c=t==\"up\"&&o===s;if(s&&(a||c)){return}const l=parseInt(e.getAttribute(\"rowspan\")||1);const d=t==\"down\"?o+l:o;const u=[...new zC(n,{endRow:d})];const h=u.find(t=>t.cell===e);const f=h.column;const m=u.find(({row:e,rowspan:i,column:n})=>{if(n!==f){return false}if(t==\"down\"){return e===d}else{return d===e+i}});return m&&m.cell}function _T(e,t){const i=e.parent;const n=i.getChildIndex(e);for(const{cell:e,row:o,rowspan:r}of new zC(i,{endRow:n})){const i=o+r-1>=n;if(i){EC(\"rowspan\",r-1,e,t)}}t.remove(e)}function vT(e,t,i){if(!kT(e)){if(kT(t)){i.remove(i.createRangeIn(t))}i.move(i.createRangeIn(e),i.createPositionAt(t,\"end\"))}i.remove(e)}function kT(e){return e.childCount==1&&e.getChild(0).is(\"paragraph\")&&e.getChild(0).isEmpty}class yT extends zw{refresh(){const e=WC(this.editor.model.document.selection);const t=e[0];if(t){const i=t.parent.parent;const n=this.editor.plugins.get(\"TableUtils\").getRows(i);const o=[...new zC(i)];const r=o.filter(t=>e.includes(t.cell)).map(e=>e.row);const s=r[0];const a=r[r.length-1];this.isEnabled=a-s{e.setSelection(e.createSelection(n,\"on\"))});let a;for(let e=t.last;e>=t.first;e--){this.editor.model.enqueueChange(r,t=>{const i=e;this._removeRow(i,n,t,o);a=AT(n,i,s)})}this.editor.model.enqueueChange(r,e=>{e.setSelection(e.createPositionAt(a,0))})}_removeRow(e,t,i,n){const o=new Map;const r=t.getChild(e);const s=t.getAttribute(\"headingRows\")||0;if(s&&et===e&&i>1).forEach(({column:e,cell:t,rowspan:i})=>o.set(e,{cell:t,rowspanToSet:i-1}));n.filter(({row:t,rowspan:i})=>t<=e-1&&t+i>e).forEach(({cell:e,rowspan:t})=>EC(\"rowspan\",t-1,e,i));const a=e+1;const c=new zC(t,{includeSpanned:true,startRow:a,endRow:a});let l;for(const{row:e,column:n,cell:r}of[...c]){if(o.has(n)){const{cell:r,rowspanToSet:s}=o.get(n);const a=l?i.createPositionAfter(l):i.createPositionAt(t.getChild(e),0);i.move(i.createRangeOn(r),a);EC(\"rowspan\",s,r,i);l=r}else{l=r}}i.remove(r)}}function xT(e){const t=e.map(e=>e.parent.index).sort();return{first:t[0],last:t[t.length-1]}}function AT(e,t,i){const n=e.getChild(t)||e.getChild(e.childCount-1);let o=n.getChild(0);let r=0;for(const e of n.getChildren()){if(r>i){return o}o=e;r+=parseInt(e.getAttribute(\"colspan\")||1)}return o}function CT(e,t){const i=e.find(e=>e.cell===t);return i.column}class TT extends zw{refresh(){const e=WC(this.editor.model.document.selection);const t=e[0];if(t){const i=t.parent.parent;const n=this.editor.plugins.get(\"TableUtils\").getColumns(i);const o=[...new zC(i)];const r=o.filter(t=>e.includes(t.cell)).map(e=>e.column).sort();const s=r[0];const a=r[r.length-1];this.isEnabled=a-st.cell===e).column,last:n.find(e=>e.cell===t).column};const r=MT(n,e,t,o);this.editor.model.change(e=>{e.setSelection(e.createRangeOn(i));ET(i,o,e);for(let t=o.last;t>=o.first;t--){for(const{cell:i,column:o,colspan:r}of n){if(o<=t&&r>1&&o+r>t){EC(\"colspan\",r-1,i,e)}else if(o===t){const t=i.parent;e.remove(i);if(!t.childCount){e.remove(t)}}}}e.setSelection(e.createPositionAt(r,0))})}}function ET(e,t,i){const n=e.getAttribute(\"headingColumns\")||0;if(n&&t.first<=n){const o=Math.min(n-1,t.last)-t.first+1;i.setAttribute(\"headingColumns\",n-o,e)}}function MT(e,t,i,n){const o=parseInt(i.getAttribute(\"colspan\")||1);if(o>1){return i}else if(t.previousSibling||i.nextSibling){return i.nextSibling||t.previousSibling}else{if(n.first){return e.reverse().find(({column:e})=>ee>n.last).cell}}}function PT(e){const t=WC(e);const i=t[0];const n=t.pop();const o=[i,n];return i.isBefore(n)?o:o.reverse()}class ST extends zw{refresh(){const e=this.editor.model;const t=WC(e.document.selection);const i=t.length>0;this.isEnabled=i;this.value=i&&t.every(e=>this._isInHeading(e,e.parent.parent))}execute(e={}){const t=this.editor.model;const i=WC(t.document.selection);const n=i[0];const o=i[i.length-1];const r=n.parent.parent;const s=r.getAttribute(\"headingRows\")||0;const[a,c]=[n.parent.index,o.parent.index].sort();if(e.forceValue===this.value){return}const l=this.value?a:c+1;t.change(e=>{if(l){const t=IT(r,l,s);for(const i of t){NT(i,l,e)}}EC(\"headingRows\",l,r,e,0)})}_isInHeading(e,t){const i=parseInt(t.getAttribute(\"headingRows\")||0);return!!i&&e.parent.indexi?i:0;const r=t-1;const s=new zC(e,{startRow:o,endRow:r});for(const{row:e,rowspan:i,cell:o}of s){if(i>1&&e+i>t){n.push(o)}}return n}function NT(e,t,i){const n=e.parent;const o=n.parent;const r=n.index;const s=parseInt(e.getAttribute(\"rowspan\"));const a=t-r;const c={};const l=s-a;if(l>1){c.rowspan=l}const d=parseInt(e.getAttribute(\"colspan\")||1);if(d>1){c.colspan=d}const u=o.getChildIndex(n);const h=u+a;const f=[...new zC(o,{startRow:u,endRow:h,includeSpanned:true})];let m;for(const{row:t,column:n,cell:r,cellIndex:s}of f){if(r===e&&m===undefined){m=n}if(m!==undefined&&m===n&&t===h){const e=o.getChild(t);const n=i.createPositionAt(e,s);MC(i,n,c)}}EC(\"rowspan\",a,e,i)}class OT extends zw{refresh(){const e=this.editor.model;const t=WC(e.document.selection);const i=this.editor.plugins.get(\"TableUtils\");const n=t.length>0;this.isEnabled=n;this.value=n&&t.every(e=>IC(i,e))}execute(e={}){const t=this.editor.model;const i=this.editor.plugins.get(\"TableUtils\");const n=WC(t.document.selection);const o=n[0];const r=n[n.length-1];const s=o.parent;const a=s.parent;const[c,l]=[i.getCellLocation(o).column,i.getCellLocation(r).column].sort();if(e.forceValue===this.value){return}const d=this.value?c:l+1;t.change(e=>{EC(\"headingColumns\",d,a,e,0)})}}class LT extends Nw{static get pluginName(){return\"TableUtils\"}getCellLocation(e){const t=e.parent;const i=t.parent;const n=i.getChildIndex(t);const o=new zC(i,{startRow:n,endRow:n});for(const{cell:t,row:i,column:n}of o){if(t===e){return{row:i,column:n}}}}createTable(e,t,i){const n=e.createElement(\"table\");RT(e,n,0,t,i);return n}insertRows(e,t={}){const i=this.editor.model;const n=t.at||0;const o=t.rows||1;i.change(t=>{const i=e.getAttribute(\"headingRows\")||0;if(i>n){t.setAttribute(\"headingRows\",i+o,e)}if(n===0||n===e.childCount){RT(t,e,n,o,this.getColumns(e));return}const r=new zC(e,{endRow:n});let s=0;for(const{row:e,rowspan:i,colspan:a,cell:c}of r){const r=en;if(r&&l){t.setAttribute(\"rowspan\",i+o,c)}if(e===n){s+=a}}RT(t,e,n,o,s)})}insertColumns(e,t={}){const i=this.editor.model;const n=t.at||0;const o=t.columns||1;i.change(t=>{const i=e.getAttribute(\"headingColumns\");if(n1){t.setAttribute(\"colspan\",l+o,r);s.skipRow(i);if(c>1){for(let e=i+1;e{if(s>1){const{newCellsSpan:n,updatedSpan:o}=jT(s,t);EC(\"colspan\",o,e,i);const a={};if(n>1){a.colspan=n}if(r>1){a.rowspan=r}const c=s>t?t-1:s-1;zT(c,i,i.createPositionAfter(e),a)}if(st===e);const l=a.filter(({cell:t,colspan:i,column:n})=>{const o=t!==e&&n===c;const r=nc;return o||r});for(const{cell:e,colspan:t}of l){i.setAttribute(\"colspan\",t+n,e)}const d={};if(r>1){d.rowspan=r}zT(n,i,i.createPositionAfter(e),d);const u=o.getAttribute(\"headingColumns\")||0;if(u>c){EC(\"headingColumns\",u+n,o,i)}}})}splitCellHorizontally(e,t=2){const i=this.editor.model;const n=e.parent;const o=n.parent;const r=o.getChildIndex(n);const s=parseInt(e.getAttribute(\"rowspan\")||1);const a=parseInt(e.getAttribute(\"colspan\")||1);i.change(i=>{if(s>1){const n=[...new zC(o,{startRow:r,endRow:r+s-1,includeSpanned:true})];const{newCellsSpan:c,updatedSpan:l}=jT(s,t);EC(\"rowspan\",l,e,i);const{column:d}=n.find(({cell:t})=>t===e);const u={};if(c>1){u.rowspan=c}if(a>1){u.colspan=a}for(const{column:e,row:t,cellIndex:s}of n){const n=t>=r+l;const a=e===d;const h=(t+r+l)%c===0;if(n&&a&&h){const e=i.createPositionAt(o.getChild(t),s);zT(1,i,e,u)}}}if(sr){const e=o+n;i.setAttribute(\"rowspan\",e,t)}}const l={};if(a>1){l.colspan=a}RT(i,o,r+1,n,1,l);const d=o.getAttribute(\"headingRows\")||0;if(d>r){EC(\"headingRows\",d+n,o,i)}}})}getColumns(e){const t=e.getChild(0);return[...t.getChildren()].reduce((e,t)=>{const i=parseInt(t.getAttribute(\"colspan\")||1);return e+i},0)}getRows(e){return e.childCount}}function RT(e,t,i,n,o,r={}){for(let s=0;sBT(t,e))}function BT(e,t){const i=t.document.differ.getChanges();let n=false;const o=new Set;for(const t of i){let i;if(t.name==\"table\"&&t.type==\"insert\"){i=t.position.nodeAfter}if(t.name==\"tableRow\"||t.name==\"tableCell\"){i=TC(\"table\",t.position)}if(UT(t)){i=TC(\"table\",t.range.start)}if(i&&!o.has(i)){n=VT(i,e)||n;n=FT(i,e)||n;o.add(i)}}return n}function VT(e,t){let i=false;const n=HT(e);if(n.length){i=true;for(const e of n){EC(\"rowspan\",e.rowspan,e.cell,t,1)}}return i}function FT(e,t){let i=false;const n=WT(e);const o=n[0];const r=Object.values(n).every(e=>e===o);if(!r){const o=Object.values(n).reduce((e,t)=>t>e?t:e,0);for(const[r,s]of Object.entries(n)){const n=o-s;if(n){for(let i=0;ia){const e=a-o;n.push({cell:s,rowspan:e})}}return n}function WT(e){const t={};for(const{row:i}of new zC(e,{includeSpanned:true})){if(!t[i]){t[i]=0}t[i]+=1}return t}function UT(e){const t=e.type===\"attribute\";const i=e.attributeKey;return t&&(i===\"headingRows\"||i===\"colspan\"||i===\"rowspan\")}function $T(e){e.document.registerPostFixer(t=>qT(t,e))}function qT(e,t){const i=t.document.differ.getChanges();let n=false;for(const t of i){if(t.type==\"insert\"&&t.name==\"table\"){n=YT(t.position.nodeAfter,e)||n}if(t.type==\"insert\"&&t.name==\"tableRow\"){n=GT(t.position.nodeAfter,e)||n}if(t.type==\"insert\"&&t.name==\"tableCell\"){n=JT(t.position.nodeAfter,e)||n}if(XT(t)){n=JT(t.position.parent,e)||n}}return n}function YT(e,t){let i=false;for(const n of e.getChildren()){i=GT(n,t)||i}return i}function GT(e,t){let i=false;for(const n of e.getChildren()){i=JT(n,t)||i}return i}function JT(e,t){if(e.childCount==0){t.insertElement(\"paragraph\",e);return true}const i=Array.from(e.getChildren()).filter(e=>e.is(\"text\"));for(const e of i){t.wrap(t.createRangeOn(e),\"paragraph\")}return!!i.length}function XT(e){if(!e.position||!e.position.parent.is(\"tableCell\")){return false}return e.type==\"insert\"&&e.name==\"$text\"||e.type==\"remove\"}function QT(e){e.document.registerPostFixer(()=>KT(e))}function KT(e){const t=e.document.differ;const i=new Set;for(const e of t.getChanges()){const t=e.type==\"insert\"||e.type==\"remove\"?e.position.parent:e.range.start.parent;if(t.is(\"tableCell\")&&ZT(t,e.type)){i.add(t)}}if(i.size){for(const e of i.values()){t.refreshItem(e)}return true}return false}function ZT(e,t){const i=Array.from(e.getChildren()).some(e=>e.is(\"paragraph\"));if(!i){return false}if(t==\"attribute\"){const t=Array.from(e.getChild(0).getAttributeKeys()).length;return e.childCount===1&&t<2}return e.childCount<=(t==\"insert\"?2:1)}var eE=i(88);class tE extends Nw{static get pluginName(){return\"TableEditing\"}init(){const e=this.editor;const t=e.model;const i=t.schema;const n=e.conversion;i.register(\"table\",{allowWhere:\"$block\",allowAttributes:[\"headingRows\",\"headingColumns\"],isLimit:true,isObject:true,isBlock:true});i.register(\"tableRow\",{allowIn:\"table\",isLimit:true});i.register(\"tableCell\",{allowIn:\"tableRow\",allowAttributes:[\"colspan\",\"rowspan\"],isObject:true});i.extend(\"$block\",{allowIn:\"tableCell\"});i.addChildCheck((e,t)=>{if(t.name==\"table\"&&Array.from(e.getNames()).includes(\"table\")){return false}});n.for(\"upcast\").add(NC());n.for(\"editingDowncast\").add(qC({asWidget:true}));n.for(\"dataDowncast\").add(qC());n.for(\"upcast\").elementToElement({model:\"tableRow\",view:\"tr\"});n.for(\"editingDowncast\").add(YC({asWidget:true}));n.for(\"dataDowncast\").add(YC());n.for(\"downcast\").add(QC());n.for(\"upcast\").add(OC(\"td\"));n.for(\"upcast\").add(OC(\"th\"));n.for(\"editingDowncast\").add(GC({asWidget:true}));n.for(\"dataDowncast\").add(GC());n.attributeToAttribute({model:\"colspan\",view:\"colspan\"});n.attributeToAttribute({model:\"rowspan\",view:\"rowspan\"});n.for(\"editingDowncast\").add(XC({asWidget:true}));n.for(\"dataDowncast\").add(XC());n.for(\"editingDowncast\").add(JC({asWidget:true}));n.for(\"dataDowncast\").add(JC());e.commands.add(\"insertTable\",new uT(e));e.commands.add(\"insertTableRowAbove\",new fT(e,{order:\"above\"}));e.commands.add(\"insertTableRowBelow\",new fT(e,{order:\"below\"}));e.commands.add(\"insertTableColumnLeft\",new mT(e,{order:\"left\"}));e.commands.add(\"insertTableColumnRight\",new mT(e,{order:\"right\"}));e.commands.add(\"removeTableRow\",new yT(e));e.commands.add(\"removeTableColumn\",new TT(e));e.commands.add(\"splitTableCellVertically\",new gT(e,{direction:\"vertically\"}));e.commands.add(\"splitTableCellHorizontally\",new gT(e,{direction:\"horizontally\"}));e.commands.add(\"mergeTableCellRight\",new pT(e,{direction:\"right\"}));e.commands.add(\"mergeTableCellLeft\",new pT(e,{direction:\"left\"}));e.commands.add(\"mergeTableCellDown\",new pT(e,{direction:\"down\"}));e.commands.add(\"mergeTableCellUp\",new pT(e,{direction:\"up\"}));e.commands.add(\"setTableColumnHeader\",new OT(e));e.commands.add(\"setTableRowHeader\",new ST(e));DT(t);QT(t);$T(t);this.editor.keystrokes.set(\"Tab\",(...e)=>this._handleTabOnSelectedTable(...e),{priority:\"low\"});this.editor.keystrokes.set(\"Tab\",this._getTabHandler(true),{priority:\"low\"});this.editor.keystrokes.set(\"Shift+Tab\",this._getTabHandler(false),{priority:\"low\"})}static get requires(){return[LT]}_handleTabOnSelectedTable(e,t){const i=this.editor;const n=i.model.document.selection;if(!n.isCollapsed&&n.rangeCount===1&&n.getFirstRange().isFlat){const e=n.getSelectedElement();if(!e||!e.is(\"table\")){return}t();i.model.change(t=>{t.setSelection(t.createRangeIn(e.getChild(0).getChild(0)))})}}_getTabHandler(e){const t=this.editor;return(i,n)=>{const o=t.model.document.selection;const r=HC(o)[0];if(!r){return}n();const s=r.parent;const a=s.parent;const c=a.getChildIndex(s);const l=s.getChildIndex(r);const d=l===0;if(!e&&d&&c===0){return}const u=l===s.childCount-1;const h=c===a.childCount-1;if(e&&h&&u){t.execute(\"insertTableRowBelow\");if(c===a.childCount-1){return}}let f;if(e&&u){const e=a.getChild(c+1);f=e.getChild(0)}else if(!e&&d){const e=a.getChild(c-1);f=e.getChild(e.childCount-1)}else{f=s.getChild(l+(e?1:-1))}t.model.change(e=>{e.setSelection(e.createRangeIn(f))})}}}var iE=i(90);class nE extends gb{constructor(e){super(e);const t=this.bindTemplate;this.items=this.createCollection();this.set(\"rows\",0);this.set(\"columns\",0);this.bind(\"label\").to(this,\"columns\",this,\"rows\",(e,t)=>`${t} × ${e}`);this.setTemplate({tag:\"div\",attributes:{class:[\"ck\"]},children:[{tag:\"div\",attributes:{class:[\"ck-insert-table-dropdown__grid\"]},children:this.items},{tag:\"div\",attributes:{class:[\"ck-insert-table-dropdown__label\"]},children:[{text:t.to(\"label\")}]}],on:{mousedown:t.to(e=>{e.preventDefault()}),click:t.to(()=>{this.fire(\"execute\")})}});for(let e=0;e<100;e++){const t=new oE;t.on(\"over\",()=>{const t=Math.floor(e/10);const i=e%10;this.set(\"rows\",t+1);this.set(\"columns\",i+1)});this.items.add(t)}this.on(\"change:columns\",()=>{this._highlightGridBoxes()});this.on(\"change:rows\",()=>{this._highlightGridBoxes()})}focus(){}focusLast(){}_highlightGridBoxes(){const e=this.rows;const t=this.columns;this.items.map((i,n)=>{const o=Math.floor(n/10);const r=n%10;const s=o{const n=e.commands.get(\"insertTable\");const o=dw(i);o.bind(\"isEnabled\").to(n);o.buttonView.set({icon:rE,label:t(\"gr\"),tooltip:true});let r;o.on(\"change:isOpen\",()=>{if(r){return}r=new nE(i);o.panelView.children.add(r);r.delegate(\"execute\").to(o);o.buttonView.on(\"open\",()=>{r.rows=0;r.columns=0});o.on(\"execute\",()=>{e.execute(\"insertTable\",{rows:r.rows,columns:r.columns});e.editing.view.focus()})});return o});e.ui.componentFactory.add(\"tableColumn\",e=>{const i=[{type:\"switchbutton\",model:{commandName:\"setTableColumnHeader\",label:t(\"gs\"),bindIsOn:true}},{type:\"separator\"},{type:\"button\",model:{commandName:n?\"insertTableColumnLeft\":\"insertTableColumnRight\",label:t(\"gt\")}},{type:\"button\",model:{commandName:n?\"insertTableColumnRight\":\"insertTableColumnLeft\",label:t(\"gu\")}},{type:\"button\",model:{commandName:\"removeTableColumn\",label:t(\"gv\")}}];return this._prepareDropdown(t(\"gw\"),sE,i,e)});e.ui.componentFactory.add(\"tableRow\",e=>{const i=[{type:\"switchbutton\",model:{commandName:\"setTableRowHeader\",label:t(\"gx\"),bindIsOn:true}},{type:\"separator\"},{type:\"button\",model:{commandName:\"insertTableRowBelow\",label:t(\"gy\")}},{type:\"button\",model:{commandName:\"insertTableRowAbove\",label:t(\"gz\")}},{type:\"button\",model:{commandName:\"removeTableRow\",label:t(\"ha\")}}];return this._prepareDropdown(t(\"hb\"),aE,i,e)});e.ui.componentFactory.add(\"mergeTableCells\",e=>{const i=[{type:\"button\",model:{commandName:\"mergeTableCellUp\",label:t(\"hc\")}},{type:\"button\",model:{commandName:n?\"mergeTableCellRight\":\"mergeTableCellLeft\",label:t(\"hd\")}},{type:\"button\",model:{commandName:\"mergeTableCellDown\",label:t(\"he\")}},{type:\"button\",model:{commandName:n?\"mergeTableCellLeft\":\"mergeTableCellRight\",label:t(\"hf\")}},{type:\"separator\"},{type:\"button\",model:{commandName:\"splitTableCellVertically\",label:t(\"hg\")}},{type:\"button\",model:{commandName:\"splitTableCellHorizontally\",label:t(\"hh\")}}];return this._prepareDropdown(t(\"hi\"),cE,i,e)})}_prepareDropdown(e,t,i,n){const o=this.editor;const r=dw(n);const s=[];const a=new ys;for(const e of i){dE(e,o,s,a)}hw(r,a,o.ui.componentFactory);r.buttonView.set({label:e,icon:t,tooltip:true});r.bind(\"isEnabled\").toMany(s,\"isEnabled\",(...e)=>e.some(e=>e));this.listenTo(r,\"execute\",e=>{o.execute(e.source.commandName);o.editing.view.focus()});return r}}function dE(e,t,i,n){const o=e.model=new d_(e.model);const{commandName:r,bindIsOn:s}=e.model;if(e.type===\"button\"||e.type===\"switchbutton\"){const e=t.commands.get(r);i.push(e);o.set({commandName:r});o.bind(\"isEnabled\").to(e);if(s){o.bind(\"isOn\").to(e,\"value\")}}o.set({withText:true});n.add(e)}class uE extends Ju{constructor(e){super(e);this.domEventType=[\"mousemove\",\"mouseup\",\"mouseleave\"]}onDomEvent(e){this.fire(e.type,e)}}function hE(e,t,i){const n=Array.from(e);const o=n[0];const r=n[n.length-1];const{row:s,column:a}=t.getCellLocation(o);const c=fE(n,a,i,t);const{row:l,column:d}=t.getCellLocation(r);const u=d-a+1;const h=l-s+1;gE(c,u,h,i,t);const f=TC(\"table\",o);pE(c,f,s,a,i);return c}function fE(e,t,i,n){const o=i.createElement(\"table\");const r=new Map;const s=new Map;for(const t of e){const e=TC(\"tableRow\",t);if(!r.has(e)){const t=e._clone();i.append(t,o);r.set(e,t)}const a=t._clone(true);const{column:c}=n.getCellLocation(t);s.set(a,c);i.append(a,r.get(e))}mE(o,t,s,i,n);return o}function mE(e,t,i,n,o){for(const r of e.getChildren()){for(const e of Array.from(r.getChildren())){const{column:r}=o.getCellLocation(e);const s=i.get(e);const a=s-t;if(r!==a){for(let t=0;tt){const i=t-c;if(i>1){n.setAttribute(\"colspan\",i,e)}else{n.removeAttribute(\"colspan\",e)}}if(a+s>i){const t=i-a;if(t>1){n.setAttribute(\"rowspan\",t,e)}else{n.removeAttribute(\"rowspan\",e)}}}}}function pE(e,t,i,n,o){const r=parseInt(t.getAttribute(\"headingRows\")||0);if(r>0){const t=r-i;o.setAttribute(\"headingRows\",t,e)}const s=parseInt(t.getAttribute(\"headingColumns\")||0);if(s>0){const t=s-n;o.setAttribute(\"headingColumns\",t,e)}}var bE=i(92);class wE extends Nw{static get pluginName(){return\"TableSelection\"}static get requires(){return[LT]}init(){const e=this.editor;const t=e.model;this.listenTo(t,\"deleteContent\",(e,t)=>this._handleDeleteContent(e,t),{priority:\"high\"});e.editing.view.addObserver(uE);this._defineSelectionConverter();this._enableShiftClickSelection();this._enableMouseDragSelection()}getSelectedTableCells(){const e=this.editor.model.document.selection;const t=FC(e);if(t.length==0){return null}return t}getSelectionAsFragment(){const e=this.getSelectedTableCells();if(!e){return null}return this.editor.model.change(t=>{const i=t.createDocumentFragment();const n=hE(e,this.editor.plugins.get(\"TableUtils\"),t);t.insert(n,i,0);return i})}_defineSelectionConverter(){const e=this.editor;const t=new Set;e.conversion.for(\"editingDowncast\").add(e=>e.on(\"selection\",(e,n,o)=>{const r=o.writer;i(r);const s=this.getSelectedTableCells();if(!s){return}for(const e of s){const i=o.mapper.toViewElement(e);r.addClass(\"ck-editor__editable_selected\",i);t.add(i)}const a=o.mapper.toViewElement(s[s.length-1]);r.setSelection(a,0)},{priority:\"lowest\"}));function i(e){for(const i of t){e.removeClass(\"ck-editor__editable_selected\",i)}t.clear()}}_enableShiftClickSelection(){const e=this.editor;let t=false;this.listenTo(e.editing.view.document,\"mousedown\",(i,n)=>{if(!this.isEnabled){return}if(!n.domEvent.shiftKey){return}const o=HC(e.model.document.selection)[0];if(!o){return}const r=this._getModelTableCellFromDomEvent(n);if(r&&vE(o,r)){t=true;this._setCellSelection(o,r);n.preventDefault()}});this.listenTo(e.editing.view.document,\"mouseup\",()=>{t=false});this.listenTo(e.editing.view.document,\"selectionChange\",e=>{if(t){e.stop()}},{priority:\"highest\"})}_enableMouseDragSelection(){const e=this.editor;let t,i;let n=false;let o=false;this.listenTo(e.editing.view.document,\"mousedown\",(e,i)=>{if(!this.isEnabled){return}if(i.domEvent.shiftKey||i.domEvent.ctrlKey||i.domEvent.altKey){return}t=this._getModelTableCellFromDomEvent(i)});this.listenTo(e.editing.view.document,\"mousemove\",(e,r)=>{if(!r.domEvent.buttons){return}if(!t){return}const s=this._getModelTableCellFromDomEvent(r);if(s&&vE(t,s)){i=s;if(!n&&i!=t){n=true}}if(!n){return}o=true;this._setCellSelection(t,i);r.preventDefault()});this.listenTo(e.editing.view.document,\"mouseup\",()=>{n=false;o=false;t=null;i=null});this.listenTo(e.editing.view.document,\"selectionChange\",e=>{if(o){e.stop()}},{priority:\"highest\"})}_handleDeleteContent(e,t){const[i,n]=t;const o=this.editor.model;const r=!n||n.direction==\"backward\";const s=FC(i);if(!s.length){return}e.stop();o.change(e=>{const t=s[r?s.length-1:0];o.change(e=>{for(const t of s){o.deleteContent(e.createSelection(t,\"in\"))}});const n=o.schema.getNearestSelectionRange(e.createPositionAt(t,0));if(n){if(i.is(\"documentSelection\")){e.setSelection(n)}else{i.setTo(n)}}})}_setCellSelection(e,t){const i=this._getCellsToSelect(e,t);this.editor.model.change(e=>{e.setSelection(i.cells.map(t=>e.createRangeOn(t)),{backward:i.backward})})}_getModelTableCellFromDomEvent(e){const t=e.target;const i=this.editor.editing.view.createPositionAt(t,0);const n=this.editor.editing.mapper.toModelPosition(i);const o=n.parent;if(!o){return}if(o.is(\"tableCell\")){return o}return TC(\"tableCell\",o)}_getCellsToSelect(e,t){const i=this.editor.plugins.get(\"TableUtils\");const n=i.getCellLocation(e);const o=i.getCellLocation(t);const r=Math.min(n.row,o.row);const s=Math.max(n.row,o.row);const a=Math.min(n.column,o.column);const c=Math.max(n.column,o.column);const l=[];for(const t of new zC(TC(\"table\",e),{startRow:r,endRow:s})){if(t.column>=a&&t.column<=c){l.push(t.cell)}}if(_E(n,o)){return{cells:l.reverse(),backward:true}}return{cells:l,backward:false}}}function _E(e,t){if(e.row>t.row){return true}if(e.row==t.row&&e.column>t.column){return true}return false}function vE(e,t){return e.parent.parent==t.parent.parent}class kE extends Nw{static get pluginName(){return\"TableClipboard\"}static get requires(){return[wE]}init(){const e=this.editor;const t=e.editing.view.document;this.listenTo(t,\"copy\",(e,t)=>this._onCopyCut(e,t));this.listenTo(t,\"cut\",(e,t)=>this._onCopyCut(e,t))}_onCopyCut(e,t){const i=this.editor.plugins.get(\"TableSelection\");if(!i.getSelectedTableCells()){return}if(e.name==\"cut\"&&this.editor.isReadOnly){return}t.preventDefault();e.stop();const n=this.editor.data;const o=this.editor.editing.view.document;const r=n.toView(i.getSelectionAsFragment());o.fire(\"clipboardOutput\",{dataTransfer:t.dataTransfer,content:r,method:e.name})}}var yE=i(94);class xE extends Nw{static get requires(){return[tE,lE,wE,kE,Z_]}static get pluginName(){return\"Table\"}}class AE extends Nw{static get requires(){return[fk]}static get pluginName(){return\"TableToolbar\"}afterInit(){const e=this.editor;const t=e.t;const i=e.plugins.get(fk);const n=e.config.get(\"table.contentToolbar\");const o=e.config.get(\"table.tableToolbar\");if(n){i.register(\"tableContent\",{ariaLabel:t(\"c\"),items:n,getRelatedElement:VC})}if(o){i.register(\"table\",{ariaLabel:t(\"c\"),items:o,getRelatedElement:BC})}}}class CE extends Nw{static get requires(){return[Sk]}static get pluginName(){return\"Base64UploadAdapter\"}init(){this.editor.plugins.get(Sk).createUploadAdapter=e=>new TE(e)}}class TE{constructor(e){this.loader=e}upload(){return new Promise((e,t)=>{const i=this.reader=new window.FileReader;i.addEventListener(\"load\",()=>{e({default:i.result})});i.addEventListener(\"error\",e=>{t(e)});i.addEventListener(\"abort\",()=>{t()});this.loader.file.then(e=>{i.readAsDataURL(e)})})}abort(){this.reader.abort()}}class EE{constructor(e){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=e;this._referenceCoordinates=null}begin(e,t,i){const n=new kh(t);this.activeHandlePosition=IE(e);this._referenceCoordinates=PE(t,NE(this.activeHandlePosition));this.originalWidth=n.width;this.originalHeight=n.height;this.aspectRatio=n.width/n.height;const o=i.style.width;if(o&&o.match(/^\\d+\\.?\\d*%$/)){this.originalWidthPercents=parseFloat(o)}else{this.originalWidthPercents=ME(i,n)}}update(e){this.proposedWidth=e.width;this.proposedHeight=e.height;this.proposedWidthPercents=e.widthPercents;this.proposedHandleHostWidth=e.handleHostWidth;this.proposedHandleHostHeight=e.handleHostHeight}}ks(EE,Jc);function ME(e,t){const i=e.parentElement;const n=parseFloat(i.ownerDocument.defaultView.getComputedStyle(i).width);return t.width/n*100}function PE(e,t){const i=new kh(e);const n=t.split(\"-\");const o={x:n[1]==\"right\"?i.right:i.left,y:n[0]==\"bottom\"?i.bottom:i.top};o.x+=e.ownerDocument.defaultView.scrollX;o.y+=e.ownerDocument.defaultView.scrollY;return o}function SE(e){return`ck-widget__resizer__handle-${e}`}function IE(e){const t=[\"top-left\",\"top-right\",\"bottom-right\",\"bottom-left\"];for(const i of t){if(e.classList.contains(SE(i))){return i}}}function NE(e){const t=e.split(\"-\");const i={top:\"bottom\",bottom:\"top\",left:\"right\",right:\"left\"};return`${i[t[0]]}-${i[t[1]]}`}class OE{constructor(e){this._options=e;this._domResizerWrapper=null;this._viewResizerWrapper=null;this.set(\"isEnabled\",true);this.decorate(\"begin\");this.decorate(\"cancel\");this.decorate(\"commit\");this.decorate(\"updateSize\");this.on(\"commit\",e=>{if(!this.state.proposedWidth&&!this.state.proposedWidthPercents){this._cleanup();e.stop()}},{priority:\"high\"})}attach(){const e=this;const t=this._options.viewElement;const i=this._options.editor.editing.view;i.change(i=>{const n=i.createUIElement(\"div\",{class:\"ck ck-reset_all ck-widget__resizer\"},(function(t){const i=this.toDomElement(t);e._appendHandles(i);e._appendSizeUI(i);e._domResizerWrapper=i;e.on(\"change:isEnabled\",(e,t,n)=>{i.style.display=n?\"\":\"none\"});i.style.display=e.isEnabled?\"\":\"none\";return i}));i.insert(i.createPositionAt(t,\"end\"),n);i.addClass(\"ck-widget_with-resizer\",t);this._viewResizerWrapper=n})}begin(e){this.state=new EE(this._options);this._sizeUI.bindToState(this._options,this.state);this.state.begin(e,this._getHandleHost(),this._getResizeHost())}updateSize(e){const t=this._proposeNewSize(e);const i=this._options.editor.editing.view;i.change(e=>{const i=this._options.unit||\"%\";const n=(i===\"%\"?t.widthPercents:t.width)+i;e.setStyle(\"width\",n,this._options.viewElement)});const n=this._getHandleHost();const o=new kh(n);t.handleHostWidth=Math.round(o.width);t.handleHostHeight=Math.round(o.height);const r=new kh(n);t.width=Math.round(r.width);t.height=Math.round(r.height);this.redraw(o);this.state.update(t)}commit(){const e=this._options.unit||\"%\";const t=(e===\"%\"?this.state.proposedWidthPercents:this.state.proposedWidth)+e;this._options.onCommit(t);this._cleanup()}cancel(){this._cleanup()}destroy(){this.cancel()}redraw(e){const t=this._domResizerWrapper;if(i(t)){this._options.editor.editing.view.change(i=>{const n=t.parentElement;const o=this._getHandleHost();const r=e||new kh(o);i.setStyle(\"width\",r.width+\"px\",this._viewResizerWrapper);i.setStyle(\"height\",r.height+\"px\",this._viewResizerWrapper);const s={left:o.offsetLeft,top:o.offsetTop,height:o.offsetHeight,width:o.offsetWidth};if(!n.isSameNode(o)){i.setStyle(\"left\",s.left+\"px\",this._viewResizerWrapper);i.setStyle(\"top\",s.top+\"px\",this._viewResizerWrapper);i.setStyle(\"height\",s.height+\"px\",this._viewResizerWrapper);i.setStyle(\"width\",s.width+\"px\",this._viewResizerWrapper)}})}function i(e){return e&&e.ownerDocument&&e.ownerDocument.contains(e)}}containsHandle(e){return this._domResizerWrapper.contains(e)}static isResizeHandle(e){return e.classList.contains(\"ck-widget__resizer__handle\")}_cleanup(){this._sizeUI.dismiss();this._sizeUI.isVisible=false}_proposeNewSize(e){const t=this.state;const i=zE(e);const n=this._options.isCentered?this._options.isCentered(this):true;const o={x:t._referenceCoordinates.x-(i.x+t.originalWidth),y:i.y-t.originalHeight-t._referenceCoordinates.y};if(n&&t.activeHandlePosition.endsWith(\"-right\")){o.x=i.x-(t._referenceCoordinates.x+t.originalWidth)}if(n){o.x*=2}const r={width:Math.abs(t.originalWidth+o.x),height:Math.abs(t.originalHeight+o.y)};r.dominant=r.width/t.aspectRatio>r.height?\"width\":\"height\";r.max=r[r.dominant];const s={width:r.width,height:r.height};if(r.dominant==\"width\"){s.height=s.width/t.aspectRatio}else{s.width=s.height*t.aspectRatio}return{width:Math.round(s.width),height:Math.round(s.height),widthPercents:Math.min(Math.round(t.originalWidthPercents/t.originalWidth*s.width*100)/100,100)}}_getResizeHost(){const e=this._domResizerWrapper.parentElement;return this._options.getResizeHost(e)}_getHandleHost(){const e=this._domResizerWrapper.parentElement;return this._options.getHandleHost(e)}_appendHandles(e){const t=[\"top-left\",\"top-right\",\"bottom-right\",\"bottom-left\"];for(const i of t){e.appendChild(new Hp({tag:\"div\",attributes:{class:`ck-widget__resizer__handle ${RE(i)}`}}).render())}}_appendSizeUI(e){const t=new LE;t.render();this._sizeUI=t;e.appendChild(t.element)}}ks(OE,Jc);class LE extends gb{constructor(){super();const e=this.bindTemplate;this.setTemplate({tag:\"div\",attributes:{class:[\"ck\",\"ck-size-view\",e.to(\"activeHandlePosition\",e=>e?`ck-orientation-${e}`:\"\")],style:{display:e.if(\"isVisible\",\"none\",e=>!e)}},children:[{text:e.to(\"label\")}]})}bindToState(e,t){this.bind(\"isVisible\").to(t,\"proposedWidth\",t,\"proposedHeight\",(e,t)=>e!==null&&t!==null);this.bind(\"label\").to(t,\"proposedHandleHostWidth\",t,\"proposedHandleHostHeight\",t,\"proposedWidthPercents\",(t,i,n)=>{if(e.unit===\"px\"){return`${t}×${i}`}else{return`${n}%`}});this.bind(\"activeHandlePosition\").to(t)}dismiss(){this.unbind();this.isVisible=false}}function RE(e){return`ck-widget__resizer__handle-${e}`}function zE(e){return{x:e.pageX,y:e.pageY}}var jE=\"Expected a function\";function DE(e,t,i){var n=true,o=true;if(typeof e!=\"function\"){throw new TypeError(jE)}if(ce(i)){n=\"leading\"in i?!!i.leading:n;o=\"trailing\"in i?!!i.trailing:o}return uh(e,t,{leading:n,maxWait:t,trailing:o})}var BE=DE;var VE=i(96);class FE extends Nw{static get pluginName(){return\"WidgetResize\"}init(){this.set(\"_visibleResizer\",null);this.set(\"_activeResizer\",null);this._resizers=new Map;const e=Nd.window.document;this.editor.model.schema.setAttributeProperties(\"width\",{isFormatting:true});this._observer=Object.create(Ud);this._observer.listenTo(e,\"mousedown\",this._mouseDownListener.bind(this));this._observer.listenTo(e,\"mousemove\",this._mouseMoveListener.bind(this));this._observer.listenTo(e,\"mouseup\",this._mouseUpListener.bind(this));const t=()=>{if(this._visibleResizer){this._visibleResizer.redraw()}};const i=BE(t,200);this.on(\"change:_visibleResizer\",t);this.editor.ui.on(\"update\",i);this._observer.listenTo(Nd.window,\"resize\",i);const n=this.editor.editing.view.document.selection;n.on(\"change\",()=>{const e=n.getSelectedElement();this._visibleResizer=this._getResizerByViewElement(e)||null})}destroy(){this._observer.stopListening();for(const e of this._resizers.values()){e.destroy()}}attachTo(e){const t=new OE(e);const i=this.editor.plugins;t.attach();if(i.has(\"WidgetToolbarRepository\")){const e=i.get(\"WidgetToolbarRepository\");t.on(\"begin\",()=>{e.forceDisabled(\"resize\")},{priority:\"lowest\"});t.on(\"cancel\",()=>{e.clearForceDisabled(\"resize\")},{priority:\"highest\"});t.on(\"commit\",()=>{e.clearForceDisabled(\"resize\")},{priority:\"highest\"})}this._resizers.set(e.viewElement,t);return t}_getResizerByHandle(e){for(const t of this._resizers.values()){if(t.containsHandle(e)){return t}}}_getResizerByViewElement(e){return this._resizers.get(e)}_mouseDownListener(e,t){if(!OE.isResizeHandle(t.target)){return}const i=t.target;this._activeResizer=this._getResizerByHandle(i);if(this._activeResizer){this._activeResizer.begin(i)}}_mouseMoveListener(e,t){if(this._activeResizer){this._activeResizer.updateSize(t)}}_mouseUpListener(){if(this._activeResizer){this._activeResizer.commit();this._activeResizer=null}}}ks(FE,Jc);class HE extends zw{refresh(){const e=this.editor.model.document.selection.getSelectedElement();this.isEnabled=z_(e);if(!e||!e.hasAttribute(\"width\")){this.value=null}else{this.value={width:e.getAttribute(\"width\"),height:null}}}execute(e){const t=this.editor.model;const i=t.document.selection.getSelectedElement();t.change(t=>{t.setAttribute(\"width\",e.width,i)})}}var WE=i(98);class UE extends Nw{static get requires(){return[FE]}static get pluginName(){return\"ImageResize\"}init(){const e=this.editor;const t=new HE(e);this._registerSchema();this._registerConverters();e.commands.add(\"imageResize\",t);e.editing.downcastDispatcher.on(\"insert:image\",(i,n,o)=>{const r=o.mapper.toViewElement(n.item);const s=e.plugins.get(FE).attachTo({unit:e.config.get(\"image.resizeUnit\")||\"%\",modelElement:n.item,viewElement:r,editor:e,getHandleHost(e){return e.querySelector(\"img\")},getResizeHost(e){return e},isCentered(){const e=n.item.getAttribute(\"imageStyle\");return!e||e==\"full\"||e==\"alignCenter\"},onCommit(t){e.execute(\"imageResize\",{width:t})}});s.on(\"updateSize\",()=>{if(!r.hasClass(\"image_resized\")){e.editing.view.change(e=>{e.addClass(\"image_resized\",r)})}});s.bind(\"isEnabled\").to(t)},{priority:\"low\"})}_registerSchema(){this.editor.model.schema.extend(\"image\",{allowAttributes:\"width\"})}_registerConverters(){const e=this.editor;e.conversion.for(\"downcast\").add(e=>e.on(\"attribute:width:image\",(e,t,i)=>{if(!i.consumable.consume(t.item,e.name)){return}const n=i.writer;const o=i.mapper.toViewElement(t.item);if(t.attributeNewValue!==null){n.setStyle(\"width\",t.attributeNewValue,o);n.addClass(\"image_resized\",o)}else{n.removeStyle(\"width\",o);n.removeClass(\"image_resized\",o)}}));e.conversion.for(\"upcast\").attributeToAttribute({view:{name:\"figure\",styles:{width:/.+/}},model:{key:\"width\",value:e=>e.getStyle(\"width\")}})}}function $E(e,t){for(const i of e.getChildren()){if(i.is(\"b\")&&i.getStyle(\"font-weight\")===\"normal\"){const n=e.getChildIndex(i);t.remove(i);t.insertChild(n,i.getChildren(),e)}}}function qE(e,t){if(!e.childCount){return}const i=new ry(e.document);const n=GE(e,i);if(!n.length){return}let o=null;let r=1;n.forEach((e,s)=>{const a=eM(n[s-1],e);const c=a?null:n[s-1];const l=iM(c,e);if(a){o=null;r=1}if(!o||l!==0){const n=JE(e,t);if(!o){o=XE(n,e.element,i)}else if(e.indent>r){const e=o.getChild(o.childCount-1);const t=e.getChild(e.childCount-1);o=XE(n,t,i);r+=1}else if(e.indent[\\s]*?)[\\r\\n]+(\\s*<\\/span>)/g,\"$1$2\").replace(/<\\/span>/g,\"\").replace(/ <\\//g,\" <\\/o:p>/g,\" \").replace(/( |\\u00A0)<\\/o:p>/g,\"\").replace(/>(\\s*[\\r\\n]\\s*)<\")}function aM(e){e.querySelectorAll(\"span[style*=spacerun]\").forEach(e=>{const t=e.childNodes&&e.childNodes[0]&&e.childNodes[0].data&&e.childNodes[0].data.length||0;e.innerHTML=Array(t+1).join(\"  \").substr(0,t)})}function cM(e){return e.replace(/(\\s+)<\\/span>/g,(e,t)=>t.length===1?\" \":Array(t.length+1).join(\"  \").substr(0,t.length))}function lM(e){const t=new DOMParser;e=e.replace(/