diff --git a/main.js b/main.js index 7b3bf3ecc8..70bd0103c9 100644 --- a/main.js +++ b/main.js @@ -1 +1 @@ -(self.webpackChunkmifosx_web_app=self.webpackChunkmifosx_web_app||[]).push([["main"],{96170:(K,j)=>{(function(_){const l=_.en=_.en||{};l.dictionary=Object.assign(l.dictionary||{},{"%0 of %1":"%0 of %1","Block quote":"Block quote",Bold:"Bold","Bulleted List":"Bulleted List",Cancel:"Cancel","Cannot upload file:":"Cannot upload file:","Centered image":"Centered image","Change image text alternative":"Change image text alternative","Choose heading":"Choose heading",Column:"Column","Could not insert image at the current position.":"Could not insert image at the current position.","Could not obtain resized image URL.":"Could not obtain resized image URL.","Decrease indent":"Decrease indent","Delete column":"Delete column","Delete row":"Delete row",Downloadable:"Downloadable","Dropdown toolbar":"Dropdown toolbar","Edit link":"Edit link","Editor toolbar":"Editor toolbar","Enter image caption":"Enter image caption","Full size image":"Full size image","Header column":"Header column","Header row":"Header row",Heading:"Heading","Heading 1":"Heading 1","Heading 2":"Heading 2","Heading 3":"Heading 3","Heading 4":"Heading 4","Heading 5":"Heading 5","Heading 6":"Heading 6","Image toolbar":"Image toolbar","image widget":"image widget","Increase indent":"Increase indent","Insert column left":"Insert column left","Insert column right":"Insert column right","Insert image":"Insert image","Insert image or file":"Insert image or file","Insert media":"Insert media","Insert paragraph after block":"Insert paragraph after block","Insert paragraph before block":"Insert paragraph before block","Insert row above":"Insert row above","Insert row below":"Insert row below","Insert table":"Insert table","Inserting image failed":"Inserting image failed",Italic:"Italic","Left aligned image":"Left aligned image",Link:"Link","Link URL":"Link URL","Media URL":"Media URL","media widget":"media widget","Merge cell down":"Merge cell down","Merge cell left":"Merge cell left","Merge cell right":"Merge cell right","Merge cell up":"Merge cell up","Merge cells":"Merge cells",Next:"Next","Numbered List":"Numbered List","Open in a new tab":"Open in a new tab","Open link in new tab":"Open link in new tab",Paragraph:"Paragraph","Paste the media URL in the input.":"Paste the media URL in the input.",Previous:"Previous",Redo:"Redo","Rich Text Editor":"Rich Text Editor","Rich Text Editor, %0":"Rich Text Editor, %0","Right aligned image":"Right aligned image",Row:"Row",Save:"Save","Select all":"Select all","Select column":"Select column","Select row":"Select row","Selecting resized image failed":"Selecting resized image failed","Show more items":"Show more items","Side image":"Side image","Split cell horizontally":"Split cell horizontally","Split cell vertically":"Split cell vertically","Table toolbar":"Table toolbar","Text alternative":"Text alternative","The URL must not be empty.":"The URL must not be empty.","This link has no URL":"This link has no URL","This media URL is not supported.":"This media URL is not supported.","Tip: Paste the URL into the content to embed faster.":"Tip: Paste the URL into the content to embed faster.",Undo:"Undo",Unlink:"Unlink","Upload failed":"Upload failed","Upload in progress":"Upload in progress","Widget toolbar":"Widget toolbar"})})(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})),window,K.exports=function(_){var l={};function u(g){if(l[g])return l[g].exports;var h=l[g]={i:g,l:!1,exports:{}};return _[g].call(h.exports,h,h.exports,u),h.l=!0,h.exports}return u.m=_,u.c=l,u.d=function(g,h,t){u.o(g,h)||Object.defineProperty(g,h,{enumerable:!0,get:t})},u.r=function(g){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(g,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(g,"__esModule",{value:!0})},u.t=function(g,h){if(1&h&&(g=u(g)),8&h||4&h&&"object"==typeof g&&g&&g.__esModule)return g;var t=Object.create(null);if(u.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:g}),2&h&&"string"!=typeof g)for(var x in g)u.d(t,x,function(A){return g[A]}.bind(null,x));return t},u.n=function(g){var h=g&&g.__esModule?function(){return g.default}:function(){return g};return u.d(h,"a",h),h},u.o=function(g,h){return Object.prototype.hasOwnProperty.call(g,h)},u.p="",u(u.s=96)}([function(_,l,u){"use strict";u.d(l,"b",function(){return g}),u.d(l,"a",function(){return h});class g extends Error{constructor(x,A,U){x=h(x),U&&(x+=" "+JSON.stringify(U)),super(x),this.name="CKEditorError",this.context=A,this.data=U}is(x){return"CKEditorError"===x}static rethrowUnexpectedError(x,A){if(x.is&&x.is("CKEditorError"))throw x;const U=new g(x.message,A);throw U.stack=x.stack,U}}function h(t){const x=t.match(/^([^:]+):/);return x?t+` Read more: https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html#error-${x[1]}\n`:t}},function(_,l,u){"use strict";var g,rt,t=(rt={},function(ft){if(void 0===rt[ft]){var Tt=document.querySelector(ft);if(window.HTMLIFrameElement&&Tt instanceof window.HTMLIFrameElement)try{Tt=Tt.contentDocument.head}catch{Tt=null}rt[ft]=Tt}return rt[ft]}),x=[];function A(rt){for(var ft=-1,Tt=0;Tt:first-child{margin-top:var(--ck-spacing-large)}.ck.ck-editor__editable_inline>:last-child{margin-bottom:var(--ck-spacing-large)}.ck.ck-editor__editable_inline.ck-blurred ::selection{background:var(--ck-color-editable-blur-selection)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_n]:after{border-bottom-color:var(--ck-color-base-foreground)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_s]:after{border-top-color:var(--ck-color-base-foreground)}"},function(_,l,u){var g=u(1),h=u(20);"string"==typeof(h=h.__esModule?h.default:h)&&(h=[[_.i,h,""]]),g(h,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),_.exports=h.locals||{}},function(_,l){_.exports=".ck.ck-label{display:block}.ck.ck-voice-label{display:none}.ck.ck-label{font-weight:700}"},function(_,l,u){var g=u(1),h=u(22);"string"==typeof(h=h.__esModule?h.default:h)&&(h=[[_.i,h,""]]),g(h,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),_.exports=h.locals||{}},function(_,l){_.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(_,l,u){var g=u(1),h=u(24);"string"==typeof(h=h.__esModule?h.default:h)&&(h=[[_.i,h,""]]),g(h,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),_.exports=h.locals||{}},function(_,l){_.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-standard)}[dir=rtl] .ck.ck-dropdown .ck-dropdown__arrow{left:var(--ck-spacing-standard);margin-right:var(--ck-spacing-small)}.ck.ck-dropdown.ck-disabled .ck-dropdown__arrow{opacity:var(--ck-disabled-opacity)}[dir=ltr] .ck.ck-dropdown .ck-button.ck-dropdown__button:not(.ck-button_with-text){padding-left:var(--ck-spacing-small)}[dir=rtl] .ck.ck-dropdown .ck-button.ck-dropdown__button:not(.ck-button_with-text){padding-right:var(--ck-spacing-small)}.ck.ck-dropdown .ck-button.ck-dropdown__button .ck-button__label{width:7em;overflow:hidden;text-overflow:ellipsis}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-disabled .ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on{border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-dropdown__button_label-width_auto .ck-button__label{width:auto}.ck.ck-dropdown__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(_,l,u){var g=u(1),h=u(26);"string"==typeof(h=h.__esModule?h.default:h)&&(h=[[_.i,h,""]]),g(h,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),_.exports=h.locals||{}},function(_,l){_.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(_,l,u){var g=u(1),h=u(28);"string"==typeof(h=h.__esModule?h.default:h)&&(h=[[_.i,h,""]]),g(h,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),_.exports=h.locals||{}},function(_,l){_.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(_,l,u){var g=u(1),h=u(30);"string"==typeof(h=h.__esModule?h.default:h)&&(h=[[_.i,h,""]]),g(h,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),_.exports=h.locals||{}},function(_,l){_.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(_,l,u){var g=u(1),h=u(32);"string"==typeof(h=h.__esModule?h.default:h)&&(h=[[_.i,h,""]]),g(h,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),_.exports=h.locals||{}},function(_,l){_.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(_,l,u){var g=u(1),h=u(34);"string"==typeof(h=h.__esModule?h.default:h)&&(h=[[_.i,h,""]]),g(h,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),_.exports=h.locals||{}},function(_,l){_.exports=".ck.ck-button.ck-switchbutton .ck-button__toggle,.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{display:block}:root{--ck-switch-button-toggle-width:2.6153846154em;--ck-switch-button-toggle-inner-size:1.0769230769em;--ck-switch-button-toggle-spacing:1px;--ck-switch-button-translation:calc(var(--ck-switch-button-toggle-width) - var(--ck-switch-button-toggle-inner-size) - 2*var(--ck-switch-button-toggle-spacing))}[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(_,l,u){var g=u(1),h=u(36);"string"==typeof(h=h.__esModule?h.default:h)&&(h=[[_.i,h,""]]),g(h,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),_.exports=h.locals||{}},function(_,l){_.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(_,l,u){var g=u(1),h=u(38);"string"==typeof(h=h.__esModule?h.default:h)&&(h=[[_.i,h,""]]),g(h,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),_.exports=h.locals||{}},function(_,l){_.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(_,l,u){var g=u(1),h=u(40);"string"==typeof(h=h.__esModule?h.default:h)&&(h=[[_.i,h,""]]),g(h,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),_.exports=h.locals||{}},function(_,l){_.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;background:var(--ck-color-toolbar-border);margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small)}.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(_,l,u){var g=u(1),h=u(42);"string"==typeof(h=h.__esModule?h.default:h)&&(h=[[_.i,h,""]]),g(h,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),_.exports=h.locals||{}},function(_,l){_.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(_,l,u){var g=u(1),h=u(44);"string"==typeof(h=h.__esModule?h.default:h)&&(h=[[_.i,h,""]]),g(h,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),_.exports=h.locals||{}},function(_,l){_.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(_,l,u){var g=u(1),h=u(46);"string"==typeof(h=h.__esModule?h.default:h)&&(h=[[_.i,h,""]]),g(h,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),_.exports=h.locals||{}},function(_,l){_.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(_,l,u){var g=u(1),h=u(48);"string"==typeof(h=h.__esModule?h.default:h)&&(h=[[_.i,h,""]]),g(h,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),_.exports=h.locals||{}},function(_,l){_.exports=".ck .ck-link_selected{background:var(--ck-color-link-selected-background)}.ck .ck-fake-link-selection{background:var(--ck-color-link-fake-selection)}.ck .ck-fake-link-selection_collapsed{height:100%;border-right:1px solid var(--ck-color-base-text);margin-right:-1px;outline:1px solid hsla(0,0%,100%,.5)}"},function(_,l,u){var g=u(1),h=u(50);"string"==typeof(h=h.__esModule?h.default:h)&&(h=[[_.i,h,""]]),g(h,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),_.exports=h.locals||{}},function(_,l){_.exports='.ck .ck-widget .ck-widget__type-around__button{display:block;position:absolute;overflow:hidden;z-index:var(--ck-z-default)}.ck .ck-widget .ck-widget__type-around__button svg{position:absolute;top:50%;left:50%;z-index:calc(var(--ck-z-default) + 2)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_before{top:calc(-0.5*var(--ck-widget-outline-thickness));left:min(10%,30px);transform:translateY(-50%)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_after{bottom:calc(-0.5*var(--ck-widget-outline-thickness));right:min(10%,30px);transform:translateY(50%)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:after,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover:after{content:"";display:block;position:absolute;top:1px;left:1px;z-index:calc(var(--ck-z-default) + 1)}.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__fake-caret{display:none;position:absolute;left:0;right:0}.ck .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__fake-caret{left:calc(-1*var(--ck-widget-outline-thickness));right:calc(-1*var(--ck-widget-outline-thickness))}.ck .ck-widget.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__fake-caret{top:calc(-1*var(--ck-widget-outline-thickness) - 1px);display:block}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after>.ck-widget__type-around>.ck-widget__type-around__fake-caret{bottom:calc(-1*var(--ck-widget-outline-thickness) - 1px);display:block}.ck.ck-editor__editable.ck-read-only .ck-widget__type-around,.ck.ck-editor__editable.ck-restricted-editing_mode_restricted .ck-widget__type-around,.ck.ck-editor__editable.ck-widget__type-around_disabled .ck-widget__type-around{display:none}:root{--ck-widget-type-around-button-size:20px;--ck-color-widget-type-around-button-active:var(--ck-color-focus-border);--ck-color-widget-type-around-button-hover:var(--ck-color-widget-hover-border);--ck-color-widget-type-around-button-blurred-editable:var(--ck-color-widget-blurred-border);--ck-color-widget-type-around-button-radar-start-alpha:0;--ck-color-widget-type-around-button-radar-end-alpha:.3;--ck-color-widget-type-around-button-icon:var(--ck-color-base-background)}.ck .ck-widget .ck-widget__type-around__button{width:var(--ck-widget-type-around-button-size);height:var(--ck-widget-type-around-button-size);background:var(--ck-color-widget-type-around-button);border-radius:100px;transition:opacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);opacity:0;pointer-events:none}.ck .ck-widget .ck-widget__type-around__button svg{width:10px;height:8px;transform:translate(-50%,-50%);transition:transform .5s ease;margin-top:1px}.ck .ck-widget .ck-widget__type-around__button svg *{stroke-dasharray:10;stroke-dashoffset:0;fill:none;stroke:var(--ck-color-widget-type-around-button-icon);stroke-width:1.5px;stroke-linecap:round;stroke-linejoin:round}.ck .ck-widget .ck-widget__type-around__button svg line{stroke-dasharray:7}.ck .ck-widget .ck-widget__type-around__button:hover{animation:ck-widget-type-around-button-sonar 1s ease infinite}.ck .ck-widget .ck-widget__type-around__button:hover svg polyline{animation:ck-widget-type-around-arrow-dash 2s linear}.ck .ck-widget .ck-widget__type-around__button:hover svg line{animation:ck-widget-type-around-arrow-tip-dash 2s linear}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__button{opacity:1;pointer-events:auto}.ck .ck-widget:not(.ck-widget_selected)>.ck-widget__type-around>.ck-widget__type-around__button{background:var(--ck-color-widget-type-around-button-hover)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover{background:var(--ck-color-widget-type-around-button-active)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:after,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover:after{width:calc(var(--ck-widget-type-around-button-size) - 2px);height:calc(var(--ck-widget-type-around-button-size) - 2px);border-radius:100px;background:linear-gradient(135deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3))}.ck .ck-widget.ck-widget_with-selection-handle>.ck-widget__type-around>.ck-widget__type-around__button_before{margin-left:20px}.ck .ck-widget .ck-widget__type-around__fake-caret{pointer-events:none;height:1px;animation:ck-widget-type-around-fake-caret-pulse 1s linear infinite normal forwards;outline:1px solid hsla(0,0%,100%,.5);background:var(--ck-color-base-text)}.ck .ck-widget.ck-widget_selected.ck-widget_type-around_show-fake-caret_after,.ck .ck-widget.ck-widget_selected.ck-widget_type-around_show-fake-caret_before{outline-color:transparent}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_selected:hover,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_selected:hover{outline-color:var(--ck-color-widget-hover-border)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__button{opacity:0;pointer-events:none}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle{opacity:0}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_selected.ck-widget_with-resizer>.ck-widget__resizer,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_selected.ck-widget_with-resizer>.ck-widget__resizer{opacity:0}.ck-editor__nested-editable.ck-editor__editable_selected .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck-editor__nested-editable.ck-editor__editable_selected .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__button{opacity:0;pointer-events:none}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:not(:hover){background:var(--ck-color-widget-type-around-button-blurred-editable)}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:not(:hover) svg *{stroke:#999}@keyframes ck-widget-type-around-arrow-dash{0%{stroke-dashoffset:10}20%,to{stroke-dashoffset:0}}@keyframes ck-widget-type-around-arrow-tip-dash{0%,20%{stroke-dashoffset:7}40%,to{stroke-dashoffset:0}}@keyframes ck-widget-type-around-button-sonar{0%{box-shadow:0 0 0 0 hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-start-alpha))}50%{box-shadow:0 0 0 5px hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-end-alpha))}to{box-shadow:0 0 0 5px hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-start-alpha))}}@keyframes ck-widget-type-around-fake-caret-pulse{0%{opacity:1}49%{opacity:1}50%{opacity:0}99%{opacity:0}to{opacity:1}}'},function(_,l,u){var g=u(1),h=u(52);"string"==typeof(h=h.__esModule?h.default:h)&&(h=[[_.i,h,""]]),g(h,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),_.exports=h.locals||{}},function(_,l){_.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 .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[dir=rtl] .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{left:auto;right:calc(0px - var(--ck-widget-outline-thickness))}.ck.ck-editor__editable.ck-read-only .ck-widget{transition:none}.ck.ck-editor__editable.ck-read-only .ck-widget:not(.ck-widget_selected){--ck-widget-outline-thickness:0px}.ck.ck-editor__editable.ck-read-only .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle,.ck.ck-editor__editable.ck-read-only .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle:hover{background:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover{outline-color:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle .ck-widget__selection-handle,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle .ck-widget__selection-handle:hover,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover.ck-widget_with-selection-handle .ck-widget__selection-handle,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover.ck-widget_with-selection-handle .ck-widget__selection-handle:hover{background:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable>.ck-widget.ck-widget_with-selection-handle:first-child,.ck.ck-editor__editable blockquote>.ck-widget.ck-widget_with-selection-handle:first-child{margin-top:calc(1em + var(--ck-widget-handler-icon-size))}"},function(_,l,u){var g=u(1),h=u(54);"string"==typeof(h=h.__esModule?h.default:h)&&(h=[[_.i,h,""]]),g(h,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),_.exports=h.locals||{}},function(_,l){_.exports=".ck.ck-labeled-field-view .ck-labeled-field-view__status{font-size:var(--ck-font-size-small);margin-top:var(--ck-spacing-small);white-space:normal}.ck.ck-labeled-field-view .ck-labeled-field-view__status_error{color:var(--ck-color-base-error)}.ck.ck-labeled-field-view>.ck.ck-label{width:100%;text-overflow:ellipsis;overflow:hidden}"},function(_,l,u){var g=u(1),h=u(56);"string"==typeof(h=h.__esModule?h.default:h)&&(h=[[_.i,h,""]]),g(h,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),_.exports=h.locals||{}},function(_,l){_.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(_,l,u){var g=u(1),h=u(58);"string"==typeof(h=h.__esModule?h.default:h)&&(h=[[_.i,h,""]]),g(h,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),_.exports=h.locals||{}},function(_,l){_.exports=".ck.ck-text-alternative-form{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-text-alternative-form .ck-labeled-field-view{display:inline-block}.ck.ck-text-alternative-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-text-alternative-form{flex-wrap:wrap}.ck.ck-text-alternative-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-text-alternative-form .ck-button{flex-basis:50%}}.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-field-view{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-text-alternative-form .ck-labeled-field-view .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(_,l,u){var g=u(1),h=u(60);"string"==typeof(h=h.__esModule?h.default:h)&&(h=[[_.i,h,""]]),g(h,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),_.exports=h.locals||{}},function(_,l){_.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(_,l,u){var g=u(1),h=u(62);"string"==typeof(h=h.__esModule?h.default:h)&&(h=[[_.i,h,""]]),g(h,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),_.exports=h.locals||{}},function(_,l){_.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(_,l,u){var g=u(1),h=u(64);"string"==typeof(h=h.__esModule?h.default:h)&&(h=[[_.i,h,""]]),g(h,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),_.exports=h.locals||{}},function(_,l){_.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(_,l,u){var g=u(1),h=u(66);"string"==typeof(h=h.__esModule?h.default:h)&&(h=[[_.i,h,""]]),g(h,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),_.exports=h.locals||{}},function(_,l){_.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(_,l,u){var g=u(1),h=u(68);"string"==typeof(h=h.__esModule?h.default:h)&&(h=[[_.i,h,""]]),g(h,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),_.exports=h.locals||{}},function(_,l){_.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(_,l,u){var g=u(1),h=u(70);"string"==typeof(h=h.__esModule?h.default:h)&&(h=[[_.i,h,""]]),g(h,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),_.exports=h.locals||{}},function(_,l){_.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(_,l){_.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(_,l,u){var g=u(1),h=u(73);"string"==typeof(h=h.__esModule?h.default:h)&&(h=[[_.i,h,""]]),g(h,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),_.exports=h.locals||{}},function(_,l){_.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(_,l,u){var g=u(1),h=u(75);"string"==typeof(h=h.__esModule?h.default:h)&&(h=[[_.i,h,""]]),g(h,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),_.exports=h.locals||{}},function(_,l){_.exports=":root{--ck-image-style-spacing:1.5em}.ck-content .image-style-side{float:right;margin-left:var(--ck-image-style-spacing);max-width:50%}.ck-content .image-style-align-left{float:left;margin-right:var(--ck-image-style-spacing)}.ck-content .image-style-align-center{margin-left:auto;margin-right:auto}.ck-content .image-style-align-right{float:right;margin-left:var(--ck-image-style-spacing)}"},function(_,l,u){var g=u(1),h=u(77);"string"==typeof(h=h.__esModule?h.default:h)&&(h=[[_.i,h,""]]),g(h,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),_.exports=h.locals||{}},function(_,l){_.exports=".ck.ck-link-form{display:flex}.ck.ck-link-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-link-form{flex-wrap:wrap}.ck.ck-link-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-link-form .ck-button{flex-basis:50%}}.ck.ck-link-form_layout-vertical{display:block}.ck.ck-link-form{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-field-view{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-link-form .ck-labeled-field-view .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-field-view{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) var(--ck-spacing-small)}.ck.ck-link-form_layout-vertical .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-link-form_layout-vertical .ck-button{padding:var(--ck-spacing-standard);margin:0;border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border);width:50%}[dir=ltr] .ck.ck-link-form_layout-vertical .ck-button{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(_,l,u){var g=u(1),h=u(79);"string"==typeof(h=h.__esModule?h.default:h)&&(h=[[_.i,h,""]]),g(h,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),_.exports=h.locals||{}},function(_,l){_.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(_,l,u){var g=u(1),h=u(81);"string"==typeof(h=h.__esModule?h.default:h)&&(h=[[_.i,h,""]]),g(h,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),_.exports=h.locals||{}},function(_,l){_.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,#1400c7,#b800b1,#f50000)}.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTA0IiBoZWlnaHQ9IjUwNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PGRlZnM+PHBhdGggaWQ9ImEiIGQ9Ik0wIC4xNTloNTAzLjg0MVY1MDMuOTRIMHoiLz48L2RlZnM+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48bWFzayBpZD0iYiIgZmlsbD0iI2ZmZiI+PHVzZSB4bGluazpocmVmPSIjYSIvPjwvbWFzaz48cGF0aCBkPSJNMjUxLjkyMS4xNTljLTY4LjQxOCAwLTc2Ljk5Ny4yOS0xMDMuODY3IDEuNTE2LTI2LjgxNCAxLjIyMy00NS4xMjcgNS40ODItNjEuMTUxIDExLjcxLTE2LjU2NiA2LjQzNy0zMC42MTUgMTUuMDUxLTQ0LjYyMSAyOS4wNTYtMTQuMDA1IDE0LjAwNi0yMi42MTkgMjguMDU1LTI5LjA1NiA0NC42MjEtNi4yMjggMTYuMDI0LTEwLjQ4NyAzNC4zMzctMTEuNzEgNjEuMTUxQy4yOSAxNzUuMDgzIDAgMTgzLjY2MiAwIDI1Mi4wOGMwIDY4LjQxNy4yOSA3Ni45OTYgMS41MTYgMTAzLjg2NiAxLjIyMyAyNi44MTQgNS40ODIgNDUuMTI3IDExLjcxIDYxLjE1MSA2LjQzNyAxNi41NjYgMTUuMDUxIDMwLjYxNSAyOS4wNTYgNDQuNjIxIDE0LjAwNiAxNC4wMDUgMjguMDU1IDIyLjYxOSA0NC42MjEgMjkuMDU3IDE2LjAyNCA2LjIyNyAzNC4zMzcgMTAuNDg2IDYxLjE1MSAxMS43MDkgMjYuODcgMS4yMjYgMzUuNDQ5IDEuNTE2IDEwMy44NjcgMS41MTYgNjguNDE3IDAgNzYuOTk2LS4yOSAxMDMuODY2LTEuNTE2IDI2LjgxNC0xLjIyMyA0NS4xMjctNS40ODIgNjEuMTUxLTExLjcwOSAxNi41NjYtNi40MzggMzAuNjE1LTE1LjA1MiA0NC42MjEtMjkuMDU3IDE0LjAwNS0xNC4wMDYgMjIuNjE5LTI4LjA1NSAyOS4wNTctNDQuNjIxIDYuMjI3LTE2LjAyNCAxMC40ODYtMzQuMzM3IDExLjcwOS02MS4xNTEgMS4yMjYtMjYuODcgMS41MTYtMzUuNDQ5IDEuNTE2LTEwMy44NjYgMC02OC40MTgtLjI5LTc2Ljk5Ny0xLjUxNi0xMDMuODY3LTEuMjIzLTI2LjgxNC01LjQ4Mi00NS4xMjctMTEuNzA5LTYxLjE1MS02LjQzOC0xNi41NjYtMTUuMDUyLTMwLjYxNS0yOS4wNTctNDQuNjIxLTE0LjAwNi0xNC4wMDUtMjguMDU1LTIyLjYxOS00NC42MjEtMjkuMDU2LTE2LjAyNC02LjIyOC0zNC4zMzctMTAuNDg3LTYxLjE1MS0xMS43MUMzMjguOTE3LjQ0OSAzMjAuMzM4LjE1OSAyNTEuOTIxLjE1OXptMCA0NS4zOTFjNjcuMjY1IDAgNzUuMjMzLjI1NyAxMDEuNzk3IDEuNDY5IDI0LjU2MiAxLjEyIDM3LjkwMSA1LjIyNCA0Ni43NzggOC42NzQgMTEuNzU5IDQuNTcgMjAuMTUxIDEwLjAyOSAyOC45NjYgMTguODQ1IDguODE2IDguODE1IDE0LjI3NSAxNy4yMDcgMTguODQ1IDI4Ljk2NiAzLjQ1IDguODc3IDcuNTU0IDIyLjIxNiA4LjY3NCA0Ni43NzggMS4yMTIgMjYuNTY0IDEuNDY5IDM0LjUzMiAxLjQ2OSAxMDEuNzk4IDAgNjcuMjY1LS4yNTcgNzUuMjMzLTEuNDY5IDEwMS43OTctMS4xMiAyNC41NjItNS4yMjQgMzcuOTAxLTguNjc0IDQ2Ljc3OC00LjU3IDExLjc1OS0xMC4wMjkgMjAuMTUxLTE4Ljg0NSAyOC45NjYtOC44MTUgOC44MTYtMTcuMjA3IDE0LjI3NS0yOC45NjYgMTguODQ1LTguODc3IDMuNDUtMjIuMjE2IDcuNTU0LTQ2Ljc3OCA4LjY3NC0yNi41NiAxLjIxMi0zNC41MjcgMS40NjktMTAxLjc5NyAxLjQ2OS02Ny4yNzEgMC03NS4yMzctLjI1Ny0xMDEuNzk4LTEuNDY5LTI0LjU2Mi0xLjEyLTM3LjkwMS01LjIyNC00Ni43NzgtOC42NzQtMTEuNzU5LTQuNTctMjAuMTUxLTEwLjAyOS0yOC45NjYtMTguODQ1LTguODE1LTguODE1LTE0LjI3NS0xNy4yMDctMTguODQ1LTI4Ljk2Ni0zLjQ1LTguODc3LTcuNTU0LTIyLjIxNi04LjY3NC00Ni43NzgtMS4yMTItMjYuNTY0LTEuNDY5LTM0LjUzMi0xLjQ2OS0xMDEuNzk3IDAtNjcuMjY2LjI1Ny03NS4yMzQgMS40NjktMTAxLjc5OCAxLjEyLTI0LjU2MiA1LjIyNC0zNy45MDEgOC42NzQtNDYuNzc4IDQuNTctMTEuNzU5IDEwLjAyOS0yMC4xNTEgMTguODQ1LTI4Ljk2NiA4LjgxNS04LjgxNiAxNy4yMDctMTQuMjc1IDI4Ljk2Ni0xOC44NDUgOC44NzctMy40NSAyMi4yMTYtNy41NTQgNDYuNzc4LTguNjc0IDI2LjU2NC0xLjIxMiAzNC41MzItMS40NjkgMTAxLjc5OC0xLjQ2OXoiIGZpbGw9IiNGRkYiIG1hc2s9InVybCgjYikiLz48cGF0aCBkPSJNMjUxLjkyMSAzMzYuMDUzYy00Ni4zNzggMC04My45NzQtMzcuNTk2LTgzLjk3NC04My45NzMgMC00Ni4zNzggMzcuNTk2LTgzLjk3NCA4My45NzQtODMuOTc0IDQ2LjM3NyAwIDgzLjk3MyAzNy41OTYgODMuOTczIDgzLjk3NCAwIDQ2LjM3Ny0zNy41OTYgODMuOTczLTgzLjk3MyA4My45NzN6bTAtMjEzLjMzOGMtNzEuNDQ3IDAtMTI5LjM2NSA1Ny45MTgtMTI5LjM2NSAxMjkuMzY1IDAgNzEuNDQ2IDU3LjkxOCAxMjkuMzY0IDEyOS4zNjUgMTI5LjM2NCA3MS40NDYgMCAxMjkuMzY0LTU3LjkxOCAxMjkuMzY0LTEyOS4zNjQgMC03MS40NDctNTcuOTE4LTEyOS4zNjUtMTI5LjM2NC0xMjkuMzY1ek00MTYuNjI3IDExNy42MDRjMCAxNi42OTYtMTMuNTM1IDMwLjIzLTMwLjIzMSAzMC4yMy0xNi42OTUgMC0zMC4yMy0xMy41MzQtMzAuMjMtMzAuMjMgMC0xNi42OTYgMTMuNTM1LTMwLjIzMSAzMC4yMy0zMC4yMzEgMTYuNjk2IDAgMzAuMjMxIDEzLjUzNSAzMC4yMzEgMzAuMjMxIiBmaWxsPSIjRkZGIi8+PC9nPjwvc3ZnPg==)}.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder .ck-media__placeholder__url__text{color:#ffe0fe}.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder .ck-media__placeholder__url__text:hover{color:#fff}.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck.ck-media__placeholder{background:linear-gradient(90deg,#71c6f4,#0d70a5)}.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck.ck-media__placeholder .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0MDAgNDAwIj48cGF0aCBkPSJNNDAwIDIwMGMwIDExMC41LTg5LjUgMjAwLTIwMCAyMDBTMCAzMTAuNSAwIDIwMCA4OS41IDAgMjAwIDBzMjAwIDg5LjUgMjAwIDIwMHpNMTYzLjQgMzA1LjVjODguNyAwIDEzNy4yLTczLjUgMTM3LjItMTM3LjIgMC0yLjEgMC00LjItLjEtNi4yIDkuNC02LjggMTcuNi0xNS4zIDI0LjEtMjUtOC42IDMuOC0xNy45IDYuNC0yNy43IDcuNiAxMC02IDE3LjYtMTUuNCAyMS4yLTI2LjctOS4zIDUuNS0xOS42IDkuNS0zMC42IDExLjctOC44LTkuNC0yMS4zLTE1LjItMzUuMi0xNS4yLTI2LjYgMC00OC4yIDIxLjYtNDguMiA0OC4yIDAgMy44LjQgNy41IDEuMyAxMS00MC4xLTItNzUuNi0yMS4yLTk5LjQtNTAuNC00LjEgNy4xLTYuNSAxNS40LTYuNSAyNC4yIDAgMTYuNyA4LjUgMzEuNSAyMS41IDQwLjEtNy45LS4yLTE1LjMtMi40LTIxLjgtNnYuNmMwIDIzLjQgMTYuNiA0Mi44IDM4LjcgNDcuMy00IDEuMS04LjMgMS43LTEyLjcgMS43LTMuMSAwLTYuMS0uMy05LjEtLjkgNi4xIDE5LjIgMjMuOSAzMy4xIDQ1IDMzLjUtMTYuNSAxMi45LTM3LjMgMjAuNi01OS45IDIwLjYtMy45IDAtNy43LS4yLTExLjUtLjcgMjEuMSAxMy44IDQ2LjUgMjEuOCA3My43IDIxLjgiIGZpbGw9IiNmZmYiLz48L3N2Zz4=)}.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck.ck-media__placeholder .ck-media__placeholder__url__text{color:#b8e6ff}.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck.ck-media__placeholder .ck-media__placeholder__url__text:hover{color:#fff}'},function(_,l,u){var g=u(1),h=u(83);"string"==typeof(h=h.__esModule?h.default:h)&&(h=[[_.i,h,""]]),g(h,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),_.exports=h.locals||{}},function(_,l){_.exports=".ck.ck-media-form{display:flex;align-items:flex-start;flex-direction:row;flex-wrap:nowrap}.ck.ck-media-form .ck-labeled-field-view{display:inline-block}.ck.ck-media-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-media-form{flex-wrap:wrap}.ck.ck-media-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-media-form .ck-button{flex-basis:50%}}.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-field-view{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-media-form .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-media-form .ck-labeled-field-view .ck-labeled-field-view__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(_,l,u){var g=u(1),h=u(85);"string"==typeof(h=h.__esModule?h.default:h)&&(h=[[_.i,h,""]]),g(h,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),_.exports=h.locals||{}},function(_,l){_.exports=".ck-content .media{clear:both;margin:1em 0;display:block;min-width:15em}"},function(_,l,u){var g=u(1),h=u(87);"string"==typeof(h=h.__esModule?h.default:h)&&(h=[[_.i,h,""]]),g(h,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),_.exports=h.locals||{}},function(_,l){_.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(_,l,u){var g=u(1),h=u(89);"string"==typeof(h=h.__esModule?h.default:h)&&(h=[[_.i,h,""]]),g(h,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),_.exports=h.locals||{}},function(_,l){_.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(_,l,u){var g=u(1),h=u(91);"string"==typeof(h=h.__esModule?h.default:h)&&(h=[[_.i,h,""]]),g(h,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),_.exports=h.locals||{}},function(_,l){_.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(_,l,u){var g=u(1),h=u(93);"string"==typeof(h=h.__esModule?h.default:h)&&(h=[[_.i,h,""]]),g(h,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),_.exports=h.locals||{}},function(_,l){_.exports=':root{--ck-table-selected-cell-background:rgba(158,207,250,0.3)}.ck.ck-editor__editable .table table td.ck-editor__editable_selected,.ck.ck-editor__editable .table table th.ck-editor__editable_selected{position:relative;caret-color:transparent;outline:unset;box-shadow:unset}.ck.ck-editor__editable .table table td.ck-editor__editable_selected:after,.ck.ck-editor__editable .table table th.ck-editor__editable_selected:after{content:"";pointer-events:none;background-color:var(--ck-table-selected-cell-background);position:absolute;top:0;left:0;right:0;bottom:0}.ck.ck-editor__editable .table table td.ck-editor__editable_selected ::selection,.ck.ck-editor__editable .table table td.ck-editor__editable_selected:focus,.ck.ck-editor__editable .table table th.ck-editor__editable_selected ::selection,.ck.ck-editor__editable .table table th.ck-editor__editable_selected:focus{background-color:transparent}.ck.ck-editor__editable .table table td.ck-editor__editable_selected .ck-widget_selected,.ck.ck-editor__editable .table table th.ck-editor__editable_selected .ck-widget_selected{outline:unset}'},function(_,l,u){var g=u(1),h=u(95);"string"==typeof(h=h.__esModule?h.default:h)&&(h=[[_.i,h,""]]),g(h,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),_.exports=h.locals||{}},function(_,l){_.exports=".ck-content .table{margin:1em auto;display:table}.ck-content .table table{border-collapse:collapse;border-spacing:0;width:100%;height:100%;border:1px double #b3b3b3}.ck-content .table table td,.ck-content .table table th{min-width:2em;padding:.4em;border:1px solid #bfbfbf}.ck-content .table table th{font-weight:700;background:hsla(0,0%,0%,5%)}.ck-content[dir=rtl] .table th{text-align:right}.ck-content[dir=ltr] .table th{text-align:left}"},function(_,l,u){"use strict";u.r(l),u.d(l,"default",function(){return Yf});var g=u(3),h=g.a.Symbol,t=Object.prototype,x=t.hasOwnProperty,A=t.toString,U=h?h.toStringTag:void 0,k=Object.prototype.toString,q=h?h.toStringTag:void 0,Y=function(b){return null==b?void 0===b?"[object Undefined]":"[object Null]":q&&q in Object(b)?function(b){var r=x.call(b,U),c=b[U];try{b[U]=void 0;var p=!0}catch{}var v=A.call(b);return p&&(r?b[U]=c:delete b[U]),v}(b):function(b){return k.call(b)}(b)},$=function(b,r){return function(c){return b(r(c))}},X=$(Object.getPrototypeOf,Object),at=function(b){return null!=b&&"object"==typeof b},Tt=Function.prototype.toString,Et=Object.prototype.hasOwnProperty,Vt=Tt.call(Object),Bt=function(b){if(!at(b)||"[object Object]"!=Y(b))return!1;var r=X(b);if(null===r)return!0;var c=Et.call(r,"constructor")&&r.constructor;return"function"==typeof c&&c instanceof c&&Tt.call(c)==Vt},Ct=function(b,r){return b===r||b!=b&&r!=r},ht=function(b,r){for(var c=b.length;c--;)if(Ct(b[c][0],r))return c;return-1},ut=Array.prototype.splice;function It(b){var r=-1,c=null==b?0:b.length;for(this.clear();++r-1},It.prototype.set=function(b,r){var c=this.__data__,p=ht(c,b);return p<0?(++this.size,c.push([b,r])):c[p][1]=r,this};var ge,_e=It,Ht=function(b){var r=typeof b;return null!=b&&("object"==r||"function"==r)},Kt=function(b){if(!Ht(b))return!1;var r=Y(b);return"[object Function]"==r||"[object GeneratorFunction]"==r||"[object AsyncFunction]"==r||"[object Proxy]"==r},ue=g.a["__core-js_shared__"],ce=(ge=/[^.]+$/.exec(ue&&ue.keys&&ue.keys.IE_PROTO||""))?"Symbol(src)_1."+ge:"",Te=Function.prototype.toString,ze=function(b){if(null!=b){try{return Te.call(b)}catch{}try{return b+""}catch{}}return""},fn=/^\[object .+?Constructor\]$/,_n=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Kn=function(b){return!(!Ht(b)||function(b){return!!ce&&ce in b}(b))&&(Kt(b)?_n:fn).test(ze(b))},oi=function(b,r){var c=function(b,r){return b?.[r]}(b,r);return Kn(c)?c:void 0},Cn=oi(g.a,"Map"),Me=oi(Object,"create"),Q=Object.prototype.hasOwnProperty,Pt=Object.prototype.hasOwnProperty;function oe(b){var r=-1,c=null==b?0:b.length;for(this.clear();++r-1&&b%1==0&&b-1&&b%1==0&&b<=9007199254740991},Be={};Be["[object Float32Array]"]=Be["[object Float64Array]"]=Be["[object Int8Array]"]=Be["[object Int16Array]"]=Be["[object Int32Array]"]=Be["[object Uint8Array]"]=Be["[object Uint8ClampedArray]"]=Be["[object Uint16Array]"]=Be["[object Uint32Array]"]=!0,Be["[object Arguments]"]=Be["[object Array]"]=Be["[object ArrayBuffer]"]=Be["[object Boolean]"]=Be["[object DataView]"]=Be["[object Date]"]=Be["[object Error]"]=Be["[object Function]"]=Be["[object Map]"]=Be["[object Number]"]=Be["[object Object]"]=Be["[object RegExp]"]=Be["[object Set]"]=Be["[object String]"]=Be["[object WeakMap]"]=!1;var Wn=function(b){return function(r){return b(r)}},ki=u(5),Hi=ki.a&&ki.a.isTypedArray,Ji=Hi?Wn(Hi):function(b){return at(b)&&an(b.length)&&!!Be[Y(b)]},Uo=Object.prototype.hasOwnProperty,qo=function(b,r){var c=yn(b),p=!c&&Oe(b),v=!c&&!p&&Object(pi.a)(b),Z=!c&&!p&&!v&&Ji(b),S=c||p||v||Z,I=S?function(b,r){for(var c=-1,p=Array(b);++c{this._setToTarget(r,v,c[v],p)})}}function Fa(b){return Ar(b,ps)}function ps(b){return Ur(b)?b:void 0}class Xo{constructor(r,c){this.source=r,this.name=c,this.path=[],this.stop=function b(){b.called=!0},this.off=function b(){b.called=!0}}}const qa=new Array(256).fill().map((b,r)=>("0"+r.toString(16)).slice(-2));function Pa(){const b=4294967296*Math.random()>>>0,r=4294967296*Math.random()>>>0,c=4294967296*Math.random()>>>0,p=4294967296*Math.random()>>>0;return"e"+qa[b>>0&255]+qa[b>>8&255]+qa[b>>16&255]+qa[b>>24&255]+qa[r>>0&255]+qa[r>>8&255]+qa[r>>16&255]+qa[r>>24&255]+qa[c>>0&255]+qa[c>>8&255]+qa[c>>16&255]+qa[c>>24&255]+qa[p>>0&255]+qa[p>>8&255]+qa[p>>16&255]+qa[p>>24&255]}var ar={get(b){return"number"!=typeof b?this[b]||this.normal:b},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5},En=(u(6),u(0));const Br=Symbol("listeningTo"),mr=Symbol("emitterId");var Fo={on(b,r,c={}){this.listenTo(this,b,r,c)},once(b,r,c){let p=!1;this.listenTo(this,b,function(v,...Z){p||(p=!0,v.off(),r.call(this,v,...Z))},c)},off(b,r){this.stopListening(this,b,r)},listenTo(b,r,c,p={}){let v,Z;this[Br]||(this[Br]={});const S=this[Br];Zr(b)||rr(b);const I=Zr(b);(v=S[I])||(v=S[I]={emitter:b,callbacks:{}}),(Z=v.callbacks[r])||(Z=v.callbacks[r]=[]),Z.push(c),function(xt,le){const Ie=wr(xt);if(Ie[le])return;let rn=le,vn=null;const wn=[];for(;""!==rn&&!Ie[rn];)Ie[rn]={callbacks:[],childEvents:[]},wn.push(Ie[rn]),vn&&Ie[rn].childEvents.push(vn),vn=rn,rn=rn.substr(0,rn.lastIndexOf(":"));if(""!==rn){for(const qn of wn)qn.callbacks=Ie[rn].callbacks.slice();Ie[rn].childEvents.push(vn)}}(b,r);const V=Or(b,r),it=ar.get(p.priority),dt={callback:c,priority:it};for(const xt of V){let le=!1;for(let Ie=0;Ie-1?Z(S,I.substr(0,I.lastIndexOf(":"))):null}(this,p);if(c.path.push(this),v){const Z=[c,...r];v=Array.from(v);for(let S=0;S{this._delegations||(this._delegations=new Map),b.forEach(p=>{const v=this._delegations.get(p);v?v.set(r,c):this._delegations.set(p,new Map([[r,c]]))})}}},stopDelegating(b,r){if(this._delegations)if(b)if(r){const c=this._delegations.get(b);c&&c.delete(r)}else this._delegations.delete(b);else this._delegations.clear()}};function rr(b,r){b[mr]||(b[mr]=r||Pa())}function Zr(b){return b[mr]}function wr(b){return b._events||Object.defineProperty(b,"_events",{value:{}}),b._events}function Or(b,r){const c=wr(b)[r];if(!c)return[];let p=[c.callbacks];for(let v=0;v{Object.getOwnPropertyNames(c).concat(Object.getOwnPropertySymbols(c)).forEach(p=>{if(p in b.prototype)return;const v=Object.getOwnPropertyDescriptor(c,p);v.enumerable=!1,Object.defineProperty(b.prototype,p,v)})})}class Ra{constructor(r={},c={}){const p=ta(r);if(p||(c=r),this._items=[],this._itemMap=new Map,this._idProperty=c.idProperty||"id",this._bindToExternalToInternalMap=new WeakMap,this._bindToInternalToExternalMap=new WeakMap,this._skippedIndexesFromExternal=[],p)for(const v of r)this._items.push(v),this._itemMap.set(this._getItemIdBeforeAdding(v),v)}get length(){return this._items.length}get first(){return this._items[0]||null}get last(){return this._items[this.length-1]||null}add(r,c){return this.addMany([r],c)}addMany(r,c){if(void 0===c)c=this._items.length;else if(c>this._items.length||c<0)throw new En.b("collection-add-item-invalid-index",this);for(let p=0;p{this._setUpBindToBinding(p=>new c(p))},using:c=>{this._setUpBindToBinding("function"==typeof c?p=>c(p):p=>p[c])}}}_setUpBindToBinding(r){const c=this._bindToCollection,p=(v,Z,S)=>{const I=c._bindToCollection==this,V=c._bindToInternalToExternalMap.get(Z);if(I&&V)this._bindToExternalToInternalMap.set(Z,V),this._bindToInternalToExternalMap.set(V,Z);else{const it=r(Z);if(!it)return void this._skippedIndexesFromExternal.push(S);let dt=S;for(const xt of this._skippedIndexesFromExternal)S>xt&&dt--;for(const xt of c._skippedIndexesFromExternal)dt>=xt&&dt++;this._bindToExternalToInternalMap.set(Z,it),this._bindToInternalToExternalMap.set(it,Z),this.add(it,dt);for(let xt=0;xt{const I=this._bindToExternalToInternalMap.get(Z);I&&this.remove(I),this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce((V,it)=>(Sit&&V.push(it),V),[])})}_getItemIdBeforeAdding(r){const c=this._idProperty;let p;if(c in r){if(p=r[c],"string"!=typeof p)throw new En.b("collection-add-invalid-id",this);if(this.get(p))throw new En.b("collection-add-item-already-exists",this)}else r[c]=p=Pa();return p}_remove(r){let c,p,v,Z=!1;const S=this._idProperty;if("string"==typeof r?(p=r,v=this._itemMap.get(p),Z=!v,v&&(c=this._items.indexOf(v))):"number"==typeof r?(c=r,v=this._items[c],Z=!v,v&&(p=v[S])):(v=r,p=v[S],c=this._items.indexOf(v),Z=-1==c||!this._itemMap.get(p)),Z)throw new En.b("collection-remove-404: Item not found.",this);this._items.splice(c,1),this._itemMap.delete(p);const I=this._bindToInternalToExternalMap.get(v);return this._bindToInternalToExternalMap.delete(v),this._bindToExternalToInternalMap.delete(I),this.fire("remove",v,c),[v,c]}[Symbol.iterator](){return this._items[Symbol.iterator]()}}Si(Ra,Fo);class va{constructor(r,c=[],p=[]){this._context=r,this._plugins=new Map,this._availablePlugins=new Map;for(const v of c)v.pluginName&&this._availablePlugins.set(v.pluginName,v);this._contextPlugins=new Map;for(const[v,Z]of p)this._contextPlugins.set(v,Z),this._contextPlugins.set(Z,v),v.pluginName&&this._availablePlugins.set(v.pluginName,v)}*[Symbol.iterator](){for(const r of this._plugins)"function"==typeof r[0]&&(yield r)}get(r){const c=this._plugins.get(r);if(!c){let v=r;throw"function"==typeof r&&(v=r.pluginName||r.name),new En.b("plugincollection-plugin-not-loaded: The requested plugin is not loaded.",this._context,{plugin:v})}return c}has(r){return this._plugins.has(r)}init(r,c=[]){const p=this,v=this._context,Z=new Set,S=[],I=Ie(r),V=Ie(c),it=function(rn){const vn=[];for(const wn of rn)le(wn)||vn.push(wn);return vn.length?vn:null}(r);if(it){const rn="plugincollection-plugin-not-found: Some plugins are not available and could not be loaded.";return console.error(Object(En.a)(rn),{plugins:it}),Promise.reject(new En.b(rn,v,{plugins:it}))}return Promise.all(I.map(function dt(rn){if(!V.includes(rn)&&!p._plugins.has(rn)&&!Z.has(rn))return(vn=rn,new Promise(wn=>{Z.add(vn),vn.requires&&vn.requires.forEach(mi=>{const xi=le(mi);if(vn.isContextPlugin&&!xi.isContextPlugin)throw new En.b("plugincollection-context-required: Context plugin can not require plugin which is not a context plugin",null,{plugin:xi.name,requiredBy:vn.name});if(c.includes(xi))throw new En.b("plugincollection-required: Cannot load a plugin because one of its dependencies is listed inthe `removePlugins` option.",v,{plugin:xi.name,requiredBy:vn.name});dt(xi)});const qn=p._contextPlugins.get(vn)||new vn(v);p._add(vn,qn),S.push(qn),wn()})).catch(vn=>{throw console.error(Object(En.a)("plugincollection-load: It was not possible to load the plugin."),{plugin:rn}),vn});var vn})).then(()=>xt(S,"init")).then(()=>xt(S,"afterInit")).then(()=>S);function xt(rn,vn){return rn.reduce((wn,qn)=>qn[vn]?p._contextPlugins.has(qn)?wn:wn.then(qn[vn].bind(qn)):wn,Promise.resolve())}function le(rn){return"function"==typeof rn?rn:p._availablePlugins.get(rn)}function Ie(rn){return rn.map(vn=>le(vn)).filter(vn=>!!vn)}}destroy(){const r=[];for(const[,c]of this)"function"!=typeof c.destroy||this._contextPlugins.has(c)||r.push(c.destroy());return Promise.all(r)}_add(r,c){this._plugins.set(r,c);const p=r.pluginName;if(p){if(this._plugins.has(p))throw new En.b("plugincollection-plugin-name-conflict: Two plugins with the same name were loaded.",null,{pluginName:p,plugin1:this._plugins.get(p).constructor,plugin2:r});this._plugins.set(p,c)}}}Si(va,Fo),window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={});const Ss=["ar","fa","he","ku","ug"];class oc{constructor(r={}){this.uiLanguage=r.uiLanguage||"en",this.contentLanguage=r.contentLanguage||this.uiLanguage,this.uiLanguageDirection=xs(this.uiLanguage),this.contentLanguageDirection=xs(this.contentLanguage),this.t=(c,p)=>this._t(c,p)}get language(){return console.warn("locale-deprecated-language-property: The Locale#language property has been deprecated and will be removed in the near future. Please use #uiLanguage and #contentLanguage properties instead."),this.uiLanguage}_t(r,c=[]){return Array.isArray(c)||(c=[c]),"string"==typeof r&&(r={string:r}),v=function Qa(b,r,c=1){if("number"!=typeof c)throw new En.b("translation-service-quantity-not-a-number: Expecting `quantity` to be a number.",null,{quantity:c});const p=Object.keys(window.CKEDITOR_TRANSLATIONS).length;1===p&&(b=Object.keys(window.CKEDITOR_TRANSLATIONS)[0]);const v=r.id||r.string;if(0===p||(V=b,!window.CKEDITOR_TRANSLATIONS[V]||!window.CKEDITOR_TRANSLATIONS[V].dictionary[v]))return 1!==c?r.plural:r.string;var V;const Z=window.CKEDITOR_TRANSLATIONS[b].dictionary,S=window.CKEDITOR_TRANSLATIONS[b].getPluralForm||(V=>1===V?0:1);if("string"==typeof Z[v])return Z[v];const I=Number(S(c));return Z[v][I]}(this.uiLanguage,r,r.plural?c[0]:1),Z=c,v.replace(/%(\d+)/g,(S,I)=>Ir.destroy())).then(()=>this.plugins.destroy())}_addEditor(r,c){if(this._contextOwner)throw new En.b("context-addEditor-private-context: Cannot add multiple editors to the context which is created by the editor.");this.editors.add(r),c&&(this._contextOwner=r)}_removeEditor(r){return this.editors.has(r)&&this.editors.remove(r),this._contextOwner===r?this.destroy():Promise.resolve()}_getEditorConfig(){const r={};for(const c of this.config.names())["plugins","removePlugins","extraPlugins"].includes(c)||(r[c]=this.config.get(c));return r}static create(r){return new Promise(c=>{const p=new this(r);c(p.initPlugins().then(()=>p))})}}function _r(b,r){const c=Math.min(b.length,r.length);for(let p=0;pr.data.length)throw new En.b("view-textproxy-wrong-offsetintext: Given offsetInText value is incorrect.",this);if(p<0||c+p>r.data.length)throw new En.b("view-textproxy-wrong-length: Given length value is incorrect.",this);this.data=r.data.substring(c,c+p),this.offsetInText=c}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(r){return"$textProxy"===r||"view:$textProxy"===r||"textProxy"===r||"view:textProxy"===r}getAncestors(r={includeSelf:!1,parentFirst:!1}){const c=[];let p=r.includeSelf?this.textNode:this.parent;for(;null!==p;)c[r.parentFirst?"push":"unshift"](p),p=p.parent;return c}}function aa(b){return ta(b)?new Map(b):function(r){const c=new Map;for(const p in r)c.set(p,r[p]);return c}(b)}class Xt{constructor(...r){this._patterns=[],this.add(...r)}add(...r){for(let c of r)("string"==typeof c||c instanceof RegExp)&&(c={name:c}),c.classes&&("string"==typeof c.classes||c.classes instanceof RegExp)&&(c.classes=[c.classes]),this._patterns.push(c)}match(...r){for(const c of r)for(const p of this._patterns){const v=Jt(c,p);if(v)return{element:c,pattern:p,match:v}}return null}matchAll(...r){const c=[];for(const p of r)for(const v of this._patterns){const Z=Jt(p,v);Z&&c.push({element:p,pattern:v,match:Z})}return c.length>0?c:null}getElementName(){if(1!==this._patterns.length)return null;const r=this._patterns[0],c=r.name;return"function"==typeof r||!c||c instanceof RegExp?null:c}}function Jt(b,r){if("function"==typeof r)return r(b);const c={};return r.name&&(c.name=(v=b.name,(p=r.name)instanceof RegExp?p.test(v):p===v),!c.name)||r.attributes&&(c.attributes=function(p,v){const Z=[];for(const S in p){const I=p[S];if(!v.hasAttribute(S))return null;{const V=v.getAttribute(S);if(!0===I)Z.push(S);else if(I instanceof RegExp){if(!I.test(V))return null;Z.push(S)}else{if(V!==I)return null;Z.push(S)}}}return Z}(r.attributes,b),!c.attributes)?null:!(r.classes&&(c.classes=function(p,v){const Z=[];for(const S of p)if(S instanceof RegExp){const I=v.getClassNames();for(const V of I)S.test(V)&&Z.push(V);if(0===Z.length)return null}else{if(!v.hasClass(S))return null;Z.push(S)}return Z}(r.classes,b),!c.classes))&&!(r.styles&&(c.styles=function(p,v){const Z=[];for(const S in p){const I=p[S];if(!v.hasStyle(S))return null;{const V=v.getStyle(S);if(I instanceof RegExp){if(!I.test(V))return null;Z.push(S)}else{if(V!==I)return null;Z.push(S)}}}return Z}(r.styles,b),!c.styles))&&c;var p,v}var kt=function(b){return"symbol"==typeof b||at(b)&&"[object Symbol]"==Y(b)},et=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ai=/^\w*$/;function Eo(b,r){if("function"!=typeof b||null!=r&&"function"!=typeof r)throw new TypeError("Expected a function");var c=function(){var p=arguments,v=r?r.apply(this,p):p[0],Z=c.cache;if(Z.has(v))return Z.get(v);var S=b.apply(this,p);return c.cache=Z.set(v,S)||Z,S};return c.cache=new(Eo.Cache||cn),c}Eo.Cache=cn;var b,r,c,ks=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ha=/\\(\\)?/g,Ya=(b=function(b){var r=[];return 46===b.charCodeAt(0)&&r.push(""),b.replace(ks,function(c,p,v,Z){r.push(v?Z.replace(Ha,"$1"):p||c)}),r},r=Eo(b,function(p){return 500===c.size&&c.clear(),p}),c=r.cache,r),ea=h?h.prototype:void 0,Bs=ea?ea.toString:void 0,rd=function b(r){if("string"==typeof r)return r;if(yn(r))return function(b,r){for(var c=-1,p=null==b?0:b.length,v=Array(p);++cv?0:v+r),(c=c>v?v:c)<0&&(c+=v),v=r>c?0:c-r>>>0,r>>>=0;for(var Z=Array(v);++p0){if(++r>=800)return arguments[0]}else r=0;return b.apply(void 0,arguments)}}(Ii),ui=function(b,r){return zn(function(b,r,c){return r=Yo(void 0===r?b.length-1:r,0),function(){for(var p=arguments,v=-1,Z=Yo(p.length-r,0),S=Array(Z);++v1?c[v-1]:void 0,S=v>2?c[2]:void 0;for(Z=b.length>3&&"function"==typeof Z?(v--,Z):void 0,S&&function(b,r,c){if(!Ht(c))return!1;var p=typeof r;return!!("number"==p?G(c)&&tn(r,c.length):"string"==p&&r in c)&&Ct(c[r],b)}(c[0],c[1],S)&&(Z=v<3?void 0:Z,v=1),r=Object(r);++pp===r);return Array.isArray(c)}set(r,c){if(Ht(r))for(const[p,v]of Object.entries(r))this._styleProcessor.toNormalizedForm(p,v,this._styles);else this._styleProcessor.toNormalizedForm(r,c,this._styles)}remove(r){const c=ul(r);(function(b,r){null==b||Md(b,r)})(this._styles,c),delete this._styles[r],this._cleanEmptyObjectsOnPath(c)}getNormalized(r){return this._styleProcessor.getNormalized(r,this._styles)}toString(){return this.isEmpty?"":this._getStylesEntries().map(r=>r.join(":")).sort().join(";")+";"}getAsString(r){if(this.isEmpty)return;if(this._styles[r]&&!Ht(this._styles[r]))return this._styles[r];const c=this._styleProcessor.getReducedForm(r,this._styles).find(([p])=>p===r);return Array.isArray(c)?c[1]:void 0}getStyleNames(){return this.isEmpty?[]:this._getStylesEntries().map(([r])=>r)}clear(){this._styles={}}_getStylesEntries(){const r=[],c=Object.keys(this._styles);for(const p of c)r.push(...this._styleProcessor.getReducedForm(p,this._styles));return r}_cleanEmptyObjectsOnPath(r){const c=r.split(".");if(!(c.length>1))return;const p=c.splice(0,c.length-1).join("."),v=ys(this._styles,p);!v||!Array.from(Object.keys(v)).length&&this.remove(p)}}class sc{constructor(){this._normalizers=new Map,this._extractors=new Map,this._reducers=new Map,this._consumables=new Map}toNormalizedForm(r,c,p){if(Ht(c))ua(p,ul(r),c);else if(this._normalizers.has(r)){const v=this._normalizers.get(r),{path:Z,value:S}=v(c);ua(p,Z,S)}else ua(p,r,c)}getNormalized(r,c){if(!r)return so({},c);if(void 0!==c[r])return c[r];if(this._extractors.has(r)){const p=this._extractors.get(r);if("string"==typeof p)return ys(c,p);const v=p(r,c);if(v)return v}return ys(c,ul(r))}getReducedForm(r,c){const p=this.getNormalized(r,c);return void 0===p?[]:this._reducers.has(r)?this._reducers.get(r)(p):[[r,p]]}getRelatedStyles(r){return this._consumables.get(r)||[]}setNormalizer(r,c){this._normalizers.set(r,c)}setExtractor(r,c){this._extractors.set(r,c)}setReducer(r,c){this._reducers.set(r,c)}setStyleRelation(r,c){this._mapStyleNames(r,c);for(const p of c)this._mapStyleNames(p,[r])}_mapStyleNames(r,c){this._consumables.has(r)||this._consumables.set(r,[]),this._consumables.get(r).push(...c)}}function ul(b){return b.replace("-",".")}function ua(b,r,c){let p=c;Ht(c)&&(p=so({},ys(b,r),c)),wa(b,r,p)}class ts extends xo{constructor(r,c,p,v){if(super(r),this.name=c,this._attrs=function(Z){Z=aa(Z);for(const[S,I]of Z)null===I?Z.delete(S):"string"!=typeof I&&Z.set(S,String(I));return Z}(p),this._children=[],v&&this._insertChild(0,v),this._classes=new Set,this._attrs.has("class")){const Z=this._attrs.get("class");dl(this._classes,Z),this._attrs.delete("class")}this._styles=new co(this.document.stylesProcessor),this._attrs.has("style")&&(this._styles.setTo(this._attrs.get("style")),this._attrs.delete("style")),this._customProperties=new Map}get childCount(){return this._children.length}get isEmpty(){return 0===this._children.length}is(r,c=null){return c?c===this.name&&("element"===r||"view:element"===r):"element"===r||"view:element"===r||"node"===r||"view:node"===r}getChild(r){return this._children[r]}getChildIndex(r){return this._children.indexOf(r)}getChildren(){return this._children[Symbol.iterator]()}*getAttributeKeys(){this._classes.size>0&&(yield"class"),this._styles.isEmpty||(yield"style"),yield*this._attrs.keys()}*getAttributes(){yield*this._attrs.entries(),this._classes.size>0&&(yield["class",this.getAttribute("class")]),this._styles.isEmpty||(yield["style",this.getAttribute("style")])}getAttribute(r){if("class"==r)return this._classes.size>0?[...this._classes].join(" "):void 0;if("style"==r){const c=this._styles.toString();return""==c?void 0:c}return this._attrs.get(r)}hasAttribute(r){return"class"==r?this._classes.size>0:"style"==r?!this._styles.isEmpty:this._attrs.has(r)}isSimilar(r){if(!(r instanceof ts))return!1;if(this===r)return!0;if(this.name!=r.name||this._attrs.size!==r._attrs.size||this._classes.size!==r._classes.size||this._styles.size!==r._styles.size)return!1;for(const[c,p]of this._attrs)if(!r._attrs.has(c)||r._attrs.get(c)!==p)return!1;for(const c of this._classes)if(!r._classes.has(c))return!1;for(const c of this._styles.getStyleNames())if(!r._styles.has(c)||r._styles.getAsString(c)!==this._styles.getAsString(c))return!1;return!0}hasClass(...r){for(const c of r)if(!this._classes.has(c))return!1;return!0}getClassNames(){return this._classes.keys()}getStyle(r){return this._styles.getAsString(r)}getNormalizedStyle(r){return this._styles.getNormalized(r)}getStyleNames(){return this._styles.getStyleNames()}hasStyle(...r){for(const c of r)if(!this._styles.has(c))return!1;return!0}findAncestor(...r){const c=new Xt(...r);let p=this.parent;for(;p;){if(c.match(p))return p;p=p.parent}return null}getCustomProperty(r){return this._customProperties.get(r)}*getCustomProperties(){yield*this._customProperties.entries()}getIdentity(){const r=Array.from(this._classes).sort().join(","),c=this._styles.toString(),p=Array.from(this._attrs).map(v=>`${v[0]}="${v[1]}"`).sort().join(" ");return this.name+(""==r?"":` class="${r}"`)+(c?` style="${c}"`:"")+(""==p?"":" "+p)}_clone(r=!1){const c=[];if(r)for(const v of this.getChildren())c.push(v._clone(r));const p=new this.constructor(this.document,this.name,this._attrs,c);return p._classes=new Set(this._classes),p._styles.set(this._styles.getNormalized()),p._customProperties=new Map(this._customProperties),p.getFillerOffset=this.getFillerOffset,p}_appendChild(r){return this._insertChild(this.childCount,r)}_insertChild(r,c){this._fireChange("children",this);let p=0;const v=(Z=this.document,"string"==typeof(S=c)?[new fa(Z,S)]:(ta(S)||(S=[S]),Array.from(S).map(I=>"string"==typeof I?new fa(Z,I):I instanceof tr?new fa(Z,I.data):I)));var Z,S;for(const Z of v)null!==Z.parent&&Z._remove(),Z.parent=this,Z.document=this.document,this._children.splice(r,0,Z),r++,p++;return p}_removeChildren(r,c=1){this._fireChange("children",this);for(let p=r;p0&&(this._classes.clear(),!0):"style"==r?!this._styles.isEmpty&&(this._styles.clear(),!0):this._attrs.delete(r)}_addClass(r){this._fireChange("attributes",this),(r=Array.isArray(r)?r:[r]).forEach(c=>this._classes.add(c))}_removeClass(r){this._fireChange("attributes",this),(r=Array.isArray(r)?r:[r]).forEach(c=>this._classes.delete(c))}_setStyle(r,c){this._fireChange("attributes",this),this._styles.set(r,c)}_removeStyle(r){this._fireChange("attributes",this),(r=Array.isArray(r)?r:[r]).forEach(c=>this._styles.remove(c))}_setCustomProperty(r,c){this._customProperties.set(r,c)}_removeCustomProperty(r){return this._customProperties.delete(r)}}function dl(b,r){const c=r.split(/\s+/);b.clear(),c.forEach(p=>b.add(p))}class ba extends ts{constructor(r,c,p,v){super(r,c,p,v),this.getFillerOffset=Fl}is(r,c=null){return c?c===this.name&&("containerElement"===r||"view:containerElement"===r||"element"===r||"view:element"===r):"containerElement"===r||"view:containerElement"===r||"element"===r||"view:element"===r||"node"===r||"view:node"===r}}function Fl(){const b=[...this.getChildren()],r=b[this.childCount-1];if(r&&r.is("element","br"))return this.childCount;for(const c of b)if(!c.is("uiElement"))return null;return this.childCount}var At=Qi(function(b,r){Xe(r,Zi(r),b)});const re=Symbol("observableProperties"),Nt=Symbol("boundObservables"),Fe=Symbol("boundProperties"),Un={set(b,r){if(Ht(b))return void Object.keys(b).forEach(p=>{this.set(p,b[p])},this);ae(this);const c=this[re];if(b in this&&!c.has(b))throw new En.b("observable-set-cannot-override: Cannot override an existing property.",this);Object.defineProperty(this,b,{enumerable:!0,configurable:!0,get:()=>c.get(b),set(p){const v=c.get(b);let Z=this.fire("set:"+b,b,p,v);void 0===Z&&(Z=p),v===Z&&c.has(b)||(c.set(b,Z),this.fire("change:"+b,b,Z,v))}}),this[b]=r},bind(...b){if(!b.length||!mn(b))throw new En.b("observable-bind-wrong-properties: All properties must be strings.",this);if(new Set(b).size!==b.length)throw new En.b("observable-bind-duplicate-properties: Properties must be unique.",this);ae(this);const r=this[Fe];b.forEach(p=>{if(r.has(p))throw new En.b("observable-bind-rebind: Cannot bind the same property more than once.",this)});const c=new Map;return b.forEach(p=>{const v={property:p,to:[]};r.set(p,v),c.set(p,v)}),{to:fe,toMany:Je,_observable:this,_bindProperties:b,_to:[],_bindings:c}},unbind(...b){if(!this[re])return;const r=this[Fe],c=this[Nt];if(b.length){if(!mn(b))throw new En.b("observable-unbind-wrong-properties: Properties must be strings.",this);b.forEach(p=>{const v=r.get(p);if(!v)return;let Z,S,I,V;v.to.forEach(it=>{Z=it[0],S=it[1],I=c.get(Z),V=I[S],V.delete(v),V.size||delete I[S],Object.keys(I).length||(c.delete(Z),this.stopListening(Z,"change"))}),r.delete(p)})}else c.forEach((p,v)=>{this.stopListening(v,"change")}),c.clear(),r.clear()},decorate(b){const r=this[b];if(!r)throw new En.b("observablemixin-cannot-decorate-undefined: Cannot decorate an undefined method.",this,{object:this,methodName:b});this.on(b,(c,p)=>{c.return=r.apply(this,p)}),this[b]=function(...c){return this.fire(b,c)}}};At(Un,Fo);var Ut=Un;function ae(b){b[re]||(Object.defineProperty(b,re,{value:new Map}),Object.defineProperty(b,Nt,{value:new Map}),Object.defineProperty(b,Fe,{value:new Map}))}function fe(...b){const r=function(...Z){if(!Z.length)throw new En.b("observable-bind-to-parse-error: Invalid argument syntax in `to()`.",null);const S={to:[]};let I;return"function"==typeof Z[Z.length-1]&&(S.callback=Z.pop()),Z.forEach(V=>{if("string"==typeof V)I.properties.push(V);else{if("object"!=typeof V)throw new En.b("observable-bind-to-parse-error: Invalid argument syntax in `to()`.",null);I={observable:V,properties:[]},S.to.push(I)}}),S}(...b),c=Array.from(this._bindings.keys()),p=c.length;if(!r.callback&&r.to.length>1)throw new En.b("observable-bind-to-no-callback: Binding multiple observables only possible with callback.",this);if(p>1&&r.callback)throw new En.b("observable-bind-to-extra-callback: Cannot bind multiple properties and use a callback in one binding.",this);var v;r.to.forEach(Z=>{if(Z.properties.length&&Z.properties.length!==p)throw new En.b("observable-bind-to-properties-length: The number of properties must match.",this);Z.properties.length||(Z.properties=this._bindProperties)}),this._to=r.to,r.callback&&(this._bindings.get(c[0]).callback=r.callback),v=this._observable,this._to.forEach(Z=>{const S=v[Nt];let I;S.get(Z.observable)||v.listenTo(Z.observable,"change",(V,it)=>{I=S.get(Z.observable)[it],I&&I.forEach(dt=>{Nn(v,dt.property)})})}),function(Z){let S;Z._bindings.forEach((I,V)=>{Z._to.forEach(it=>{S=it.properties[I.callback?0:Z._bindProperties.indexOf(V)],I.to.push([it.observable,S]),function(dt,xt,le,Ie){const rn=dt[Nt],vn=rn.get(le),wn=vn||{};wn[Ie]||(wn[Ie]=new Set),wn[Ie].add(xt),vn||rn.set(le,wn)}(Z._observable,I,it.observable,S)})})}(this),this._bindProperties.forEach(Z=>{Nn(this._observable,Z)})}function Je(b,r,c){if(this._bindings.size>1)throw new En.b("observable-bind-to-many-not-one-binding: Cannot bind multiple properties with toMany().",this);this.to(...function(p,v){const Z=p.map(S=>[S,v]);return Array.prototype.concat.apply([],Z)}(b,r),c)}function mn(b){return b.every(r=>"string"==typeof r)}function Nn(b,r){const c=b[Fe].get(r);let p;c.callback?p=c.callback.apply(b,c.to.map(v=>v[0][v[1]])):(p=c.to[0],p=p[0][p[1]]),Object.prototype.hasOwnProperty.call(b,r)?b[r]=p:b.set(r,p)}class Fn extends ba{constructor(r,c,p,v){super(r,c,p,v),this.set("isReadOnly",!1),this.set("isFocused",!1),this.bind("isReadOnly").to(r),this.bind("isFocused").to(r,"isFocused",Z=>Z&&r.selection.editableElement==this),this.listenTo(r.selection,"change",()=>{this.isFocused=r.isFocused&&r.selection.editableElement==this})}is(r,c=null){return c?c===this.name&&("editableElement"===r||"view:editableElement"===r||"containerElement"===r||"view:containerElement"===r||"element"===r||"view:element"===r):"editableElement"===r||"view:editableElement"===r||"containerElement"===r||"view:containerElement"===r||"element"===r||"view:element"===r||"node"===r||"view:node"===r}destroy(){this.stopListening()}}Si(Fn,Ut);const ti=Symbol("rootName");class ii extends Fn{constructor(r,c){super(r,c),this.rootName="main"}is(r,c=null){return c?c===this.name&&("rootElement"===r||"view:rootElement"===r||"editableElement"===r||"view:editableElement"===r||"containerElement"===r||"view:containerElement"===r||"element"===r||"view:element"===r):"rootElement"===r||"view:rootElement"===r||"editableElement"===r||"view:editableElement"===r||"containerElement"===r||"view:containerElement"===r||"element"===r||"view:element"===r||"node"===r||"view:node"===r}get rootName(){return this.getCustomProperty(ti)}set rootName(r){this._setCustomProperty(ti,r)}set _name(r){this.name=r}}class Ri{constructor(r={}){if(!r.boundaries&&!r.startPosition)throw new En.b("view-tree-walker-no-start-position: Neither boundaries nor starting position have been defined.",null);if(r.direction&&"forward"!=r.direction&&"backward"!=r.direction)throw new En.b("view-tree-walker-unknown-direction: Only `backward` and `forward` direction allowed.",r.startPosition,{direction:r.direction});this.boundaries=r.boundaries||null,this.position=jn._createAt(r.startPosition?r.startPosition:r.boundaries["backward"==r.direction?"end":"start"]),this.direction=r.direction||"forward",this.singleCharacters=!!r.singleCharacters,this.shallow=!!r.shallow,this.ignoreElementEnd=!!r.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null}[Symbol.iterator](){return this}skip(r){let c,p,v;do{v=this.position,({done:c,value:p}=this.next())}while(!c&&r(p));c||(this.position=v)}next(){return"forward"==this.direction?this._next():this._previous()}_next(){let r=this.position.clone();const c=this.position,p=r.parent;if(null===p.parent&&r.offset===p.childCount)return{done:!0};if(p===this._boundaryEndParent&&r.offset==this.boundaries.end.offset)return{done:!0};let v;if(p instanceof fa){if(r.isAtEnd)return this.position=jn._createAfter(p),this._next();v=p.data[r.offset]}else v=p.getChild(r.offset);if(v instanceof ts)return this.shallow?r.offset++:r=new jn(v,0),this.position=r,this._formatReturnValue("elementStart",v,c,r,1);if(v instanceof fa){if(this.singleCharacters)return r=new jn(v,0),this.position=r,this._next();{let Z,S=v.data.length;return v==this._boundaryEndParent?(S=this.boundaries.end.offset,Z=new tr(v,0,S),r=jn._createAfter(Z)):(Z=new tr(v,0,v.data.length),r.offset++),this.position=r,this._formatReturnValue("text",Z,c,r,S)}}if("string"==typeof v){let Z;Z=this.singleCharacters?1:(p===this._boundaryEndParent?this.boundaries.end.offset:p.data.length)-r.offset;const S=new tr(p,r.offset,Z);return r.offset+=Z,this.position=r,this._formatReturnValue("text",S,c,r,Z)}return r=jn._createAfter(p),this.position=r,this.ignoreElementEnd?this._next():this._formatReturnValue("elementEnd",p,c,r)}_previous(){let r=this.position.clone();const c=this.position,p=r.parent;if(null===p.parent&&0===r.offset)return{done:!0};if(p==this._boundaryStartParent&&r.offset==this.boundaries.start.offset)return{done:!0};let v;if(p instanceof fa){if(r.isAtStart)return this.position=jn._createBefore(p),this._previous();v=p.data[r.offset-1]}else v=p.getChild(r.offset-1);if(v instanceof ts)return this.shallow?(r.offset--,this.position=r,this._formatReturnValue("elementStart",v,c,r,1)):(r=new jn(v,v.childCount),this.position=r,this.ignoreElementEnd?this._previous():this._formatReturnValue("elementEnd",v,c,r));if(v instanceof fa){if(this.singleCharacters)return r=new jn(v,v.data.length),this.position=r,this._previous();{let Z,S=v.data.length;if(v==this._boundaryStartParent){const I=this.boundaries.start.offset;Z=new tr(v,I,v.data.length-I),S=Z.data.length,r=jn._createBefore(Z)}else Z=new tr(v,0,v.data.length),r.offset--;return this.position=r,this._formatReturnValue("text",Z,c,r,S)}}if("string"==typeof v){let Z;Z=this.singleCharacters?1:r.offset-(p===this._boundaryStartParent?this.boundaries.start.offset:0),r.offset-=Z;const S=new tr(p,r.offset,Z);return this.position=r,this._formatReturnValue("text",S,c,r,Z)}return r=jn._createBefore(p),this.position=r,this._formatReturnValue("elementStart",p,c,r,1)}_formatReturnValue(r,c,p,v,Z){return c instanceof tr&&(c.offsetInText+c.data.length==c.textNode.data.length&&("forward"!=this.direction||this.boundaries&&this.boundaries.end.isEqual(this.position)?p=jn._createAfter(c.textNode):(v=jn._createAfter(c.textNode),this.position=v)),0===c.offsetInText&&("backward"!=this.direction||this.boundaries&&this.boundaries.start.isEqual(this.position)?p=jn._createBefore(c.textNode):(v=jn._createBefore(c.textNode),this.position=v))),{done:!1,value:{type:r,item:c,previousPosition:p,nextPosition:v,length:Z}}}}class jn{constructor(r,c){this.parent=r,this.offset=c}get nodeAfter(){return this.parent.is("$text")?null:this.parent.getChild(this.offset)||null}get nodeBefore(){return this.parent.is("$text")?null:this.parent.getChild(this.offset-1)||null}get isAtStart(){return 0===this.offset}get isAtEnd(){const r=this.parent.is("$text")?this.parent.data.length:this.parent.childCount;return this.offset===r}get root(){return this.parent.root}get editableElement(){let r=this.parent;for(;!(r instanceof Fn);){if(!r.parent)return null;r=r.parent}return r}getShiftedBy(r){const c=jn._createAt(this),p=c.offset+r;return c.offset=p<0?0:p,c}getLastMatchingPosition(r,c={}){c.startPosition=this;const p=new Ri(c);return p.skip(r),p.position}getAncestors(){return this.parent.is("documentFragment")?[this.parent]:this.parent.getAncestors({includeSelf:!0})}getCommonAncestor(r){const c=this.getAncestors(),p=r.getAncestors();let v=0;for(;c[v]==p[v]&&c[v];)v++;return 0===v?null:c[v-1]}is(r){return"position"===r||"view:position"===r}isEqual(r){return this.parent==r.parent&&this.offset==r.offset}isBefore(r){return"before"==this.compareWith(r)}isAfter(r){return"after"==this.compareWith(r)}compareWith(r){if(this.root!==r.root)return"different";if(this.isEqual(r))return"same";const c=this.parent.is("node")?this.parent.getPath():[],p=r.parent.is("node")?r.parent.getPath():[];c.push(this.offset),p.push(r.offset);const v=_r(c,p);switch(v){case"prefix":return"before";case"extension":return"after";default:return c[v]0?new this(p,v):new this(v,p)}static _createIn(r){return this._createFromParentsAndOffsets(r,0,r,r.childCount)}static _createOn(r){const c=r.is("$textProxy")?r.offsetSize:1;return this._createFromPositionAndShift(jn._createBefore(r),c)}}function yo(b){return!(!b.item.is("attributeElement")&&!b.item.is("uiElement"))}function po(b){let r=0;for(const c of b)r++;return r}class Do{constructor(r=null,c,p){this._ranges=[],this._lastRangeBackward=!1,this._isFake=!1,this._fakeSelectionLabel="",this.setTo(r,c,p)}get isFake(){return this._isFake}get fakeSelectionLabel(){return this._fakeSelectionLabel}get anchor(){if(!this._ranges.length)return null;const r=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?r.end:r.start).clone()}get focus(){if(!this._ranges.length)return null;const r=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?r.start:r.end).clone()}get isCollapsed(){return 1===this.rangeCount&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}get editableElement(){return this.anchor?this.anchor.editableElement:null}*getRanges(){for(const r of this._ranges)yield r.clone()}getFirstRange(){let r=null;for(const c of this._ranges)r&&!c.start.isBefore(r.start)||(r=c);return r?r.clone():null}getLastRange(){let r=null;for(const c of this._ranges)r&&!c.end.isAfter(r.end)||(r=c);return r?r.clone():null}getFirstPosition(){const r=this.getFirstRange();return r?r.start.clone():null}getLastPosition(){const r=this.getLastRange();return r?r.end.clone():null}isEqual(r){if(this.isFake!=r.isFake||this.isFake&&this.fakeSelectionLabel!=r.fakeSelectionLabel||this.rangeCount!=r.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(r.anchor)||!this.focus.isEqual(r.focus))return!1;for(const c of this._ranges){let p=!1;for(const v of r._ranges)if(c.isEqual(v)){p=!0;break}if(!p)return!1}return!0}isSimilar(r){if(this.isBackward!=r.isBackward)return!1;const c=po(this.getRanges());if(c!=po(r.getRanges()))return!1;if(0==c)return!0;for(let p of this.getRanges()){p=p.getTrimmed();let v=!1;for(let Z of r.getRanges())if(Z=Z.getTrimmed(),p.start.isEqual(Z.start)&&p.end.isEqual(Z.end)){v=!0;break}if(!v)return!1}return!0}getSelectedElement(){return 1!==this.rangeCount?null:this.getFirstRange().getContainedElement()}setTo(r,c,p){if(null===r)this._setRanges([]),this._setFakeOptions(c);else if(r instanceof Do||r instanceof er)this._setRanges(r.getRanges(),r.isBackward),this._setFakeOptions({fake:r.isFake,label:r.fakeSelectionLabel});else if(r instanceof vi)this._setRanges([r],c&&c.backward),this._setFakeOptions(c);else if(r instanceof jn)this._setRanges([new vi(r)]),this._setFakeOptions(c);else if(r instanceof xo){const v=!!p&&!!p.backward;let Z;if(void 0===c)throw new En.b("view-selection-setTo-required-second-parameter: selection.setTo requires the second parameter when the first parameter is a node.",this);Z="in"==c?vi._createIn(r):"on"==c?vi._createOn(r):new vi(jn._createAt(r,c)),this._setRanges([Z],v),this._setFakeOptions(p)}else{if(!ta(r))throw new En.b("view-selection-setTo-not-selectable: Cannot set selection to given place.",this);this._setRanges(r,c&&c.backward),this._setFakeOptions(c)}this.fire("change")}setFocus(r,c){if(null===this.anchor)throw new En.b("view-selection-setFocus-no-ranges: Cannot set selection focus if there are no ranges in selection.",this);const p=jn._createAt(r,c);if("same"==p.compareWith(this.focus))return;const v=this.anchor;this._ranges.pop(),"before"==p.compareWith(v)?this._addRange(new vi(p,v),!0):this._addRange(new vi(v,p)),this.fire("change")}is(r){return"selection"===r||"view:selection"===r}_setRanges(r,c=!1){r=Array.from(r),this._ranges=[];for(const p of r)this._addRange(p);this._lastRangeBackward=!!c}_setFakeOptions(r={}){this._isFake=!!r.fake,this._fakeSelectionLabel=r.fake&&r.label||""}_addRange(r,c=!1){if(!(r instanceof vi))throw new En.b("view-selection-add-range-not-range: Selection range set to an object that is not an instance of view.Range",this);this._pushRange(r),this._lastRangeBackward=!!c}_pushRange(r){for(const c of this._ranges)if(r.isIntersecting(c))throw new En.b("view-selection-range-intersects: Trying to add a range that intersects with another range from selection.",this,{addedRange:r,intersectingRange:c});this._ranges.push(new vi(r.start,r.end))}}Si(Do,Fo);class er{constructor(r=null,c,p){this._selection=new Do,this._selection.delegate("change").to(this),this._selection.setTo(r,c,p)}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(r){return this._selection.isEqual(r)}isSimilar(r){return this._selection.isSimilar(r)}is(r){return"selection"===r||"documentSelection"==r||"view:selection"==r||"view:documentSelection"==r}_setTo(r,c,p){this._selection.setTo(r,c,p)}_setFocus(r,c){this._selection.setFocus(r,c)}}Si(er,Fo);class br{constructor(r){this.selection=new er,this.roots=new Ra({idProperty:"rootName"}),this.stylesProcessor=r,this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("isComposing",!1),this._postFixers=new Set}getRoot(r="main"){return this.roots.get(r)}registerPostFixer(r){this._postFixers.add(r)}destroy(){this.roots.map(r=>r.destroy()),this.stopListening()}_callPostFixers(r){let c=!1;do{for(const p of this._postFixers)if(c=p(r),c)break}while(c)}}Si(br,Ut);class Mr extends ts{constructor(r,c,p,v){super(r,c,p,v),this.getFillerOffset=nr,this._priority=10,this._id=null,this._clonesGroup=null}get priority(){return this._priority}get id(){return this._id}getElementsWithSameId(){if(null===this.id)throw new En.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(r,c=null){return c?c===this.name&&("attributeElement"===r||"view:attributeElement"===r||"element"===r||"view:element"===r):"attributeElement"===r||"view:attributeElement"===r||"element"===r||"view:element"===r||"node"===r||"view:node"===r}isSimilar(r){return null!==this.id||null!==r.id?this.id===r.id:super.isSimilar(r)&&this.priority==r.priority}_clone(r){const c=super._clone(r);return c._priority=this._priority,c._id=this._id,c}}function nr(){if(ja(this))return null;let b=this.parent;for(;b&&b.is("attributeElement");){if(ja(b)>1)return null;b=b.parent}return!b||ja(b)>1?null:this.childCount}function ja(b){return Array.from(b.getChildren()).filter(r=>!r.is("uiElement")).length}Mr.DEFAULT_PRIORITY=10;class sr extends ts{constructor(r,c,p,v){super(r,c,p,v),this.getFillerOffset=es}is(r,c=null){return c?c===this.name&&("emptyElement"===r||"view:emptyElement"===r||"element"===r||"view:element"===r):"emptyElement"===r||"view:emptyElement"===r||"element"===r||"view:element"===r||"node"===r||"view:node"===r}_insertChild(r,c){if(c&&(c instanceof xo||Array.from(c).length>0))throw new En.b("view-emptyelement-cannot-add: Cannot add child nodes to EmptyElement instance.",[this,c])}}function es(){return null}const ns=navigator.userAgent.toLowerCase();var Dr_isMac=function(b){return b.indexOf("macintosh")>-1}(ns),Dr_isGecko=function(b){return!!b.match(/gecko\/\d+/)}(ns),Dr_isSafari=function(b){return b.indexOf(" applewebkit/")>-1&&-1===b.indexOf("chrome")}(ns),Dr_isAndroid=function(b){return b.indexOf("android")>-1}(ns);!function(){let b=!1;try{b=0==="\u0107".search(new RegExp("[\\p{L}]","u"))}catch{}}();const Lu={"\u2318":"ctrl","\u21e7":"shift","\u2325":"alt"},ha={ctrl:"\u2318",shift:"\u21e7",alt:"\u2325"},mo=function(){const b={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 r=65;r<=90;r++)b[String.fromCharCode(r).toLowerCase()]=r;for(let r=48;r<=57;r++)b[r-48]=r;for(let r=112;r<=123;r++)b["f"+(r-111)]=r;return b}();function na(b){let r;if("string"==typeof b){if(r=mo[b.toLowerCase()],!r)throw new En.b("keyboard-unknown-key: Unknown key name.",null,{key:b})}else r=b.keyCode+(b.altKey?mo.alt:0)+(b.ctrlKey?mo.ctrl:0)+(b.shiftKey?mo.shift:0);return r}function Dd(b){return"string"==typeof b&&(b=Pd(b)),b.map(r=>"string"==typeof r?na(r):r).reduce((r,c)=>c+r,0)}function cd(b){return Dr_isMac?Pd(b).map(r=>ha[r.toLowerCase()]||r).reduce((r,c)=>r.slice(-1)in Lu?r+c:r+"+"+c):b}function Il(b){return b==mo.arrowright||b==mo.arrowleft||b==mo.arrowup||b==mo.arrowdown}function Js(b,r){const c="ltr"===r;switch(b){case mo.arrowleft:return c?"left":"right";case mo.arrowright:return c?"right":"left";case mo.arrowup:return"up";case mo.arrowdown:return"down"}}function qu(b,r){const c=Js(b,r);return"down"===c||"right"===c}function Pd(b){return b.split(/\s*\+\s*/)}class pl extends ts{constructor(r,c,p,v){super(r,c,p,v),this.getFillerOffset=Sd}is(r,c=null){return c?c===this.name&&("uiElement"===r||"view:uiElement"===r||"element"===r||"view:element"===r):"uiElement"===r||"view:uiElement"===r||"element"===r||"view:element"===r||"node"===r||"view:node"===r}_insertChild(r,c){if(c&&(c instanceof xo||Array.from(c).length>0))throw new En.b("view-uielement-cannot-add: Cannot add child nodes to UIElement instance.",this)}render(r){return this.toDomElement(r)}toDomElement(r){const c=r.createElement(this.name);for(const p of this.getAttributeKeys())c.setAttribute(p,this.getAttribute(p));return c}}function Sd(){return null}class _l extends ts{constructor(r,c,p,v){super(r,c,p,v),this.getFillerOffset=ms}is(r,c=null){return c?c===this.name&&("rawElement"===r||"view:rawElement"===r||"element"===r||"view:element"===r):"rawElement"===r||"view:rawElement"===r||r===this.name||r==="view:"+this.name||"element"===r||"view:element"===r||"node"===r||"view:node"===r}_insertChild(r,c){if(c&&(c instanceof xo||Array.from(c).length>0))throw new En.b("view-rawelement-cannot-add: Cannot add child nodes to a RawElement instance.",[this,c])}}function ms(){return null}class Ic{constructor(r,c){this.document=r,this._children=[],c&&this._insertChild(0,c)}[Symbol.iterator](){return this._children[Symbol.iterator]()}get childCount(){return this._children.length}get isEmpty(){return 0===this.childCount}get root(){return this}get parent(){return null}is(r){return"documentFragment"===r||"view:documentFragment"===r}_appendChild(r){return this._insertChild(this.childCount,r)}getChild(r){return this._children[r]}getChildIndex(r){return this._children.indexOf(r)}getChildren(){return this._children[Symbol.iterator]()}_insertChild(r,c){this._fireChange("children",this);let p=0;const v=(Z=this.document,"string"==typeof(S=c)?[new fa(Z,S)]:(ta(S)||(S=[S]),Array.from(S).map(I=>"string"==typeof I?new fa(Z,I):I instanceof tr?new fa(Z,I.data):I)));var Z,S;for(const Z of v)null!==Z.parent&&Z._remove(),Z.parent=this,this._children.splice(r,0,Z),r++,p++;return p}_removeChildren(r,c=1){this._fireChange("children",this);for(let p=r;p{}),v}setAttribute(r,c,p){p._setAttribute(r,c)}removeAttribute(r,c){c._removeAttribute(r)}addClass(r,c){c._addClass(r)}removeClass(r,c){c._removeClass(r)}setStyle(r,c,p){Bt(r)&&void 0===p&&(p=c),p._setStyle(r,c)}removeStyle(r,c){c._removeStyle(r)}setCustomProperty(r,c,p){p._setCustomProperty(r,c)}removeCustomProperty(r,c){return c._removeCustomProperty(r)}breakAttributes(r){return r instanceof jn?this._breakAttributes(r):this._breakAttributesRange(r)}breakContainer(r){const c=r.parent;if(!c.is("containerElement"))throw new En.b("view-writer-break-non-container-element: Trying to break an element which is not a container element.",this.document);if(!c.parent)throw new En.b("view-writer-break-root: Trying to break root element.",this.document);if(r.isAtStart)return jn._createBefore(c);if(!r.isAtEnd){const p=c._clone(!1);this.insert(jn._createAfter(c),p);const v=new vi(r,jn._createAt(c,"end")),Z=new jn(p,0);this.move(v,Z)}return jn._createAfter(c)}mergeAttributes(r){const c=r.offset,p=r.parent;if(p.is("$text"))return r;if(p.is("attributeElement")&&0===p.childCount){const S=p.parent,I=p.index;return p._remove(),this._removeFromClonedElementsGroup(p),this.mergeAttributes(new jn(S,I))}const v=p.getChild(c-1),Z=p.getChild(c);if(!v||!Z)return r;if(v.is("$text")&&Z.is("$text"))return Rl(v,Z);if(v.is("attributeElement")&&Z.is("attributeElement")&&v.isSimilar(Z)){const S=v.childCount;return v._appendChild(Z.getChildren()),Z._remove(),this._removeFromClonedElementsGroup(Z),this.mergeAttributes(new jn(v,S))}return r}mergeContainers(r){const c=r.nodeBefore,p=r.nodeAfter;if(!(c&&p&&c.is("containerElement")&&p.is("containerElement")))throw new En.b("view-writer-merge-containers-invalid-position: Element before and after given position cannot be merged.",this.document);const v=c.getChild(c.childCount-1),Z=jn._createAt(v instanceof fa?v:c,"end");return this.move(vi._createIn(p),jn._createAt(c,"end")),this.remove(vi._createOn(p)),Z}insert(r,c){!function V(it,dt){for(const xt of it){if(!Di.some(le=>xt instanceof le))throw new En.b("view-writer-insert-invalid-node",dt);xt.is("$text")||V(xt.getChildren(),dt)}}(c=ta(c)?[...c]:[c],this.document);const p=L1(r);if(!p)throw new En.b("view-writer-invalid-position-container",this.document);const v=this._breakAttributes(r,!0),Z=p._insertChild(v.offset,c);for(const V of c)this._addToClonedElementsGroup(V);const S=v.getShiftedBy(Z),I=this.mergeAttributes(v);if(0===Z)return new vi(I,I);{I.isEqual(v)||S.offset--;const V=this.mergeAttributes(S);return new vi(I,V)}}remove(r){const c=r instanceof vi?r:vi._createOn(r);if(R(c,this.document),c.isCollapsed)return new Ic(this.document);const{start:p,end:v}=this._breakAttributesRange(c,!0),I=p.parent._removeChildren(p.offset,v.offset-p.offset);for(const it of I)this._removeFromClonedElementsGroup(it);const V=this.mergeAttributes(p);return c.start=V,c.end=V.clone(),new Ic(this.document,I)}clear(r,c){R(r,this.document);const p=r.getWalker({direction:"backward",ignoreElementEnd:!0});for(const v of p){const Z=v.item;let S;if(Z.is("element")&&c.isSimilar(Z))S=vi._createOn(Z);else if(!v.nextPosition.isAfter(r.start)&&Z.is("$textProxy")){const I=Z.getAncestors().find(V=>V.is("element")&&c.isSimilar(V));I&&(S=vi._createIn(I))}S&&(S.end.isAfter(r.end)&&(S.end=r.end),S.start.isBefore(r.start)&&(S.start=r.start),this.remove(S))}}move(r,c){let p;if(c.isAfter(r.end)){const v=(c=this._breakAttributes(c,!0)).parent,Z=v.childCount;r=this._breakAttributesRange(r,!0),p=this.remove(r),c.offset+=v.childCount-Z}else p=this.remove(r);return this.insert(c,p)}wrap(r,c){if(!(c instanceof Mr))throw new En.b("view-writer-wrap-invalid-attribute",this.document);if(R(r,this.document),r.isCollapsed){let v=r.start;v.parent.is("element")&&!Array.from(v.parent.getChildren()).some(S=>!S.is("uiElement"))&&(v=v.getLastMatchingPosition(S=>S.item.is("uiElement"))),v=this._wrapPosition(v,c);const Z=this.document.selection;return Z.isCollapsed&&Z.getFirstPosition().isEqual(r.start)&&this.setSelection(v),new vi(v)}return this._wrapRange(r,c)}unwrap(r,c){if(!(c instanceof Mr))throw new En.b("view-writer-unwrap-invalid-attribute",this.document);if(R(r,this.document),r.isCollapsed)return r;const{start:p,end:v}=this._breakAttributesRange(r,!0),S=this._unwrapChildren(p.parent,p.offset,v.offset,c),I=this.mergeAttributes(S.start);I.isEqual(S.start)||S.end.offset--;const V=this.mergeAttributes(S.end);return new vi(I,V)}rename(r,c){const p=new ba(this.document,r,c.getAttributes());return this.insert(jn._createAfter(c),p),this.move(vi._createIn(c),jn._createAt(p,0)),this.remove(vi._createOn(c)),p}clearClonedElementsGroup(r){this._cloneGroups.delete(r)}createPositionAt(r,c){return jn._createAt(r,c)}createPositionAfter(r){return jn._createAfter(r)}createPositionBefore(r){return jn._createBefore(r)}createRange(r,c){return new vi(r,c)}createRangeOn(r){return vi._createOn(r)}createRangeIn(r){return vi._createIn(r)}createSelection(r,c,p){return new Do(r,c,p)}_wrapChildren(r,c,p,v){let Z=c;const S=[];for(;Z!1,r.parent._insertChild(r.offset,p);const v=new vi(r,r.getShiftedBy(1));this.wrap(v,c);const Z=new jn(p.parent,p.index);p._remove();const S=Z.nodeBefore,I=Z.nodeAfter;return S instanceof fa&&I instanceof fa?Rl(S,I):yc(Z)}_wrapAttributeElement(r,c){if(!fo(r,c)||r.name!==c.name||r.priority!==c.priority)return!1;for(const p of r.getAttributeKeys())if("class"!==p&&"style"!==p&&c.hasAttribute(p)&&c.getAttribute(p)!==r.getAttribute(p))return!1;for(const p of r.getStyleNames())if(c.hasStyle(p)&&c.getStyle(p)!==r.getStyle(p))return!1;for(const p of r.getAttributeKeys())"class"!==p&&"style"!==p&&(c.hasAttribute(p)||this.setAttribute(p,r.getAttribute(p),c));for(const p of r.getStyleNames())c.hasStyle(p)||this.setStyle(p,r.getStyle(p),c);for(const p of r.getClassNames())c.hasClass(p)||this.addClass(p,c);return!0}_unwrapAttributeElement(r,c){if(!fo(r,c)||r.name!==c.name||r.priority!==c.priority)return!1;for(const p of r.getAttributeKeys())if("class"!==p&&"style"!==p&&(!c.hasAttribute(p)||c.getAttribute(p)!==r.getAttribute(p)))return!1;if(!c.hasClass(...r.getClassNames()))return!1;for(const p of r.getStyleNames())if(!c.hasStyle(p)||c.getStyle(p)!==r.getStyle(p))return!1;for(const p of r.getAttributeKeys())"class"!==p&&"style"!==p&&this.removeAttribute(p,c);return this.removeClass(Array.from(r.getClassNames()),c),this.removeStyle(Array.from(r.getStyleNames()),c),!0}_breakAttributesRange(r,c=!1){const p=r.start,v=r.end;if(R(r,this.document),r.isCollapsed){const V=this._breakAttributes(r.start,c);return new vi(V,V)}const Z=this._breakAttributes(v,c),S=Z.parent.childCount,I=this._breakAttributes(p,c);return Z.offset+=Z.parent.childCount-S,new vi(I,Z)}_breakAttributes(r,c=!1){const p=r.offset,v=r.parent;if(r.parent.is("emptyElement"))throw new En.b("view-writer-cannot-break-empty-element",this.document);if(r.parent.is("uiElement"))throw new En.b("view-writer-cannot-break-ui-element",this.document);if(r.parent.is("rawElement"))throw new En.b("view-writer-cannot-break-raw-element: Cannot break inside a RawElement instance.",this.document);if(!c&&v.is("$text")&&Ke(v.parent)||Ke(v))return r.clone();if(v.is("$text"))return this._breakAttributes(Tn(r),c);if(p==v.childCount){const Z=new jn(v.parent,v.index+1);return this._breakAttributes(Z,c)}if(0===p){const Z=new jn(v.parent,v.index);return this._breakAttributes(Z,c)}{const Z=v.index+1,S=v._clone();v.parent._insertChild(Z,S),this._addToClonedElementsGroup(S);const V=v._removeChildren(p,v.childCount-p);S._appendChild(V);const it=new jn(v.parent,Z);return this._breakAttributes(it,c)}}_addToClonedElementsGroup(r){if(!r.root.is("rootElement"))return;if(r.is("element"))for(const v of r.getChildren())this._addToClonedElementsGroup(v);const c=r.id;if(!c)return;let p=this._cloneGroups.get(c);p||(p=new Set,this._cloneGroups.set(c,p)),p.add(r),r._clonesGroup=p}_removeFromClonedElementsGroup(r){if(r.is("element"))for(const v of r.getChildren())this._removeFromClonedElementsGroup(v);const c=r.id;if(!c)return;const p=this._cloneGroups.get(c);p&&p.delete(r)}}function L1(b){let r=b.parent;for(;!Ke(r);){if(!r)return;r=r.parent}return r}function Wa(b,r){return b.priorityr.priority)&&b.getIdentity()b.createTextNode("\xa0"),yp=b=>{const r=b.createElement("br");return r.dataset.ckeFiller=!0,r},$d=(()=>{let b="";for(let r=0;r<7;r++)b+="\u200b";return b})();function go(b){return Va(b)&&b.data.substr(0,7)===$d}function qr(b){return 7==b.data.length&&go(b)}function q1(b){return go(b)?b.data.slice(7):b.data}function Er(b,r){if(r.keyCode==mo.arrowleft){const c=r.domTarget.ownerDocument.defaultView.getSelection();if(1==c.rangeCount&&c.getRangeAt(0).collapsed){const p=c.getRangeAt(0).startContainer,v=c.getRangeAt(0).startOffset;go(p)&&v<=7&&c.collapse(p,0)}}}function Kd(b,r,c,p=!1){c=c||function(Z,S){return Z===S},Array.isArray(b)||(b=Array.prototype.slice.call(b)),Array.isArray(r)||(r=Array.prototype.slice.call(r));const v=function(Z,S,I){const V=ld(Z,S,I);if(-1===V)return{firstIndex:-1,lastIndexOld:-1,lastIndexNew:-1};const xt=ld(Tp(Z,V),Tp(S,V),I);return{firstIndex:V,lastIndexOld:Z.length-xt,lastIndexNew:S.length-xt}}(b,r,c);return p?function(Z,S){const{firstIndex:I,lastIndexOld:V,lastIndexNew:it}=Z;if(-1===I)return Array(S).fill("equal");let dt=[];return I>0&&(dt=dt.concat(Array(I).fill("equal"))),it-I>0&&(dt=dt.concat(Array(it-I).fill("insert"))),V-I>0&&(dt=dt.concat(Array(V-I).fill("delete"))),it0&&I.push({index:V,type:"insert",values:Z.slice(V,dt)}),it-V>0&&I.push({index:V+(dt-V),type:"delete",howMany:it-V}),I}(r,v)}function ld(b,r,c){for(let p=0;p200||v>200||p+v>300)return qs.fastDiff(b,r,c,!0);let Z,S;if(vqn?-1:1;dt[vn+mi]&&(dt[vn]=dt[vn+mi].slice(0)),dt[vn]||(dt[vn]=[]),dt[vn].push(wn>qn?Z:S);let xi=Math.max(wn,qn),Vi=xi-vn;for(;Viit;Ie--)xt[Ie]=le(Ie);xt[it]=le(it),rn++}while(xt[it]!==V);return dt[it].slice(1)}function _s(b,r,c){b.insertBefore(c,b.childNodes[r]||null)}function Ts(b){const r=b.parentNode;r&&r.removeChild(b)}function fl(b){if(b){if(b.defaultView)return b instanceof b.defaultView.Document;if(b.ownerDocument&&b.ownerDocument.defaultView)return b instanceof b.ownerDocument.defaultView.Node}return!1}qs.fastDiff=Kd;class Hl{constructor(r,c){this.domDocuments=new Set,this.domConverter=r,this.markedAttributes=new Set,this.markedChildren=new Set,this.markedTexts=new Set,this.selection=c,this.isFocused=!1,this._inlineFiller=null,this._fakeSelectionContainer=null}markToSync(r,c){if("text"===r)this.domConverter.mapViewToDom(c.parent)&&this.markedTexts.add(c);else{if(!this.domConverter.mapViewToDom(c))return;if("attributes"===r)this.markedAttributes.add(c);else{if("children"!==r)throw new En.b("view-renderer-unknown-type: Unknown type passed to Renderer.markToSync.",this);this.markedChildren.add(c)}}}render(){let r;for(const c of this.markedChildren)this._updateChildrenMappings(c);this._inlineFiller&&!this._isSelectionInInlineFiller()&&this._removeInlineFiller(),this._inlineFiller?r=this._getInlineFillerPosition():this._needsInlineFillerAtSelection()&&(r=this.selection.getFirstPosition(),this.markedChildren.add(r.parent));for(const c of this.markedAttributes)this._updateAttrs(c);for(const c of this.markedChildren)this._updateChildren(c,{inlineFillerPosition:r});for(const c of this.markedTexts)!this.markedChildren.has(c.parent)&&this.domConverter.mapViewToDom(c.parent)&&this._updateText(c,{inlineFillerPosition:r});if(r){const c=this.domConverter.viewPositionToDom(r),p=c.parent.ownerDocument;this._inlineFiller=go(c.parent)?c.parent:Yl(p,c.parent,c.offset)}else this._inlineFiller=null;this._updateSelection(),this._updateFocus(),this.markedTexts.clear(),this.markedAttributes.clear(),this.markedChildren.clear()}_updateChildrenMappings(r){const c=this.domConverter.mapViewToDom(r);if(!c)return;const p=this.domConverter.mapViewToDom(r).childNodes,v=Array.from(this.domConverter.viewChildrenToDom(r,c.ownerDocument,{withChildren:!1})),Z=this._diffNodeLists(p,v),S=this._findReplaceActions(Z,p,v);if(-1!==S.indexOf("replace")){const I={equal:0,insert:0,delete:0};for(const V of S)if("replace"===V){const it=I.equal+I.insert,dt=I.equal+I.delete,xt=r.getChild(it);!xt||xt.is("uiElement")||xt.is("rawElement")||this._updateElementMappings(xt,p[dt]),Ts(v[it]),I.equal++}else I[V]++}}_updateElementMappings(r,c){this.domConverter.unbindDomElement(c),this.domConverter.bindElements(c,r),this.markedChildren.add(r),this.markedAttributes.add(r)}_getInlineFillerPosition(){const r=this.selection.getFirstPosition();return r.parent.is("$text")?jn._createBefore(this.selection.getFirstPosition().parent):r}_isSelectionInInlineFiller(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const r=this.selection.getFirstPosition(),c=this.domConverter.viewPositionToDom(r);return!!(c&&Va(c.parent)&&go(c.parent))}_removeInlineFiller(){const r=this._inlineFiller;if(!go(r))throw new En.b("view-renderer-filler-was-lost: The inline filler node was lost.",this);qr(r)?r.parentNode.removeChild(r):r.data=r.data.substr(7),this._inlineFiller=null}_needsInlineFillerAtSelection(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const r=this.selection.getFirstPosition(),c=r.parent,p=r.offset;return!!(this.domConverter.mapViewToDom(c.root)&&c.is("element")&&function(S){if("false"==S.getAttribute("contenteditable"))return!1;const I=S.findAncestor(V=>V.hasAttribute("contenteditable"));return!I||"true"==I.getAttribute("contenteditable")}(c)&&p!==c.getFillerOffset())&&!(r.nodeBefore instanceof fa||r.nodeAfter instanceof fa)}_updateText(r,c){const p=this.domConverter.findCorrespondingDomText(r),v=this.domConverter.viewToDom(r,p.ownerDocument),Z=p.data;let S=v.data;const I=c.inlineFillerPosition;if(I&&I.parent==r.parent&&I.offset==r.index&&(S=$d+S),Z!=S){const V=Kd(Z,S);for(const it of V)"insert"===it.type?p.insertData(it.index,it.values.join("")):p.deleteData(it.index,it.howMany)}}_updateAttrs(r){const c=this.domConverter.mapViewToDom(r);if(!c)return;const p=Array.from(c.attributes).map(Z=>Z.name),v=r.getAttributeKeys();for(const Z of v)c.setAttribute(Z,r.getAttribute(Z));for(const Z of p)r.hasAttribute(Z)||c.removeAttribute(Z)}_updateChildren(r,c){const p=this.domConverter.mapViewToDom(r);if(!p)return;const v=c.inlineFillerPosition,Z=this.domConverter.mapViewToDom(r).childNodes,S=Array.from(this.domConverter.viewChildrenToDom(r,p.ownerDocument,{bind:!0,inlineFillerPosition:v}));v&&v.parent===r&&Yl(p.ownerDocument,S,v.offset);const I=this._diffNodeLists(Z,S);let V=0;const it=new Set;for(const dt of I)"delete"===dt?(it.add(Z[V]),Ts(Z[V])):"equal"===dt&&V++;V=0;for(const dt of I)"insert"===dt?(_s(p,V,S[V]),V++):"equal"===dt&&(this._markDescendantTextToSync(this.domConverter.domToView(S[V])),V++);for(const dt of it)dt.parentNode||this.domConverter.unbindDomElement(dt)}_diffNodeLists(r,c){return qs(r=function(p,v){const Z=Array.from(p);return 0==Z.length||!v||Z[Z.length-1]==v&&Z.pop(),Z}(r,this._fakeSelectionContainer),c,cm.bind(null,this.domConverter))}_findReplaceActions(r,c,p){if(-1===r.indexOf("insert")||-1===r.indexOf("delete"))return r;let v=[],Z=[],S=[];const I={equal:0,insert:0,delete:0};for(const V of r)"insert"===V?S.push(p[I.equal+I.insert]):"delete"===V?Z.push(c[I.equal+I.delete]):(v=v.concat(qs(Z,S,el).map(it=>"equal"===it?"replace":it)),v.push("equal"),Z=[],S=[]),I[V]++;return v.concat(qs(Z,S,el).map(V=>"equal"===V?"replace":V))}_markDescendantTextToSync(r){if(r)if(r.is("$text"))this.markedTexts.add(r);else if(r.is("element"))for(const c of r.getChildren())this._markDescendantTextToSync(c)}_updateSelection(){if(0===this.selection.rangeCount)return this._removeDomSelection(),void this._removeFakeSelection();const r=this.domConverter.mapViewToDom(this.selection.editableElement);this.isFocused&&r&&(this.selection.isFake?this._updateFakeSelection(r):(this._removeFakeSelection(),this._updateDomSelection(r)))}_updateFakeSelection(r){const c=r.ownerDocument;this._fakeSelectionContainer||(this._fakeSelectionContainer=function(S){const I=S.createElement("div");return Object.assign(I.style,{position:"fixed",top:0,left:"-9999px",width:"42px"}),I.textContent="\xa0",I}(c));const p=this._fakeSelectionContainer;if(this.domConverter.bindFakeSelection(p,this.selection),!this._fakeSelectionNeedsUpdate(r))return;p.parentElement&&p.parentElement==r||r.appendChild(p),p.textContent=this.selection.fakeSelectionLabel||"\xa0";const v=c.getSelection(),Z=c.createRange();v.removeAllRanges(),Z.selectNodeContents(p),v.addRange(Z)}_updateDomSelection(r){const c=r.ownerDocument.defaultView.getSelection();if(!this._domSelectionNeedsUpdate(c))return;const p=this.domConverter.viewPositionToDom(this.selection.anchor),v=this.domConverter.viewPositionToDom(this.selection.focus);r.focus(),c.collapse(p.parent,p.offset),c.extend(v.parent,v.offset),Dr_isGecko&&function(Z,S){const I=Z.parent;if(I.nodeType!=Node.ELEMENT_NODE||Z.offset!=I.childNodes.length-1)return;const V=I.childNodes[Z.offset];V&&"BR"==V.tagName&&S.addRange(S.getRangeAt(0))}(v,c)}_domSelectionNeedsUpdate(r){if(!this.domConverter.isDomSelectionCorrect(r))return!0;const c=r&&this.domConverter.domSelectionToView(r);return!(c&&this.selection.isEqual(c)||!this.selection.isCollapsed&&this.selection.isSimilar(c))}_fakeSelectionNeedsUpdate(r){const c=this._fakeSelectionContainer,p=r.ownerDocument.getSelection();return!c||c.parentElement!==r||p.anchorNode!==c&&!c.contains(p.anchorNode)||c.textContent!==this.selection.fakeSelectionLabel}_removeDomSelection(){for(const r of this.domDocuments)if(r.getSelection().rangeCount){const c=r.activeElement,p=this.domConverter.mapDomToView(c);c&&p&&r.getSelection().removeAllRanges()}}_removeFakeSelection(){const r=this._fakeSelectionContainer;r&&r.remove()}_updateFocus(){if(this.isFocused){const r=this.selection.editableElement;r&&this.domConverter.focus(r)}}}function Yl(b,r,c){const p=r instanceof Array?r:r.childNodes,v=p[c];if(Va(v))return v.data=$d+v.data,v;{const Z=b.createTextNode($d);return Array.isArray(r)?p.splice(c,0,Z):_s(r,c,Z),Z}}function el(b,r){return fl(b)&&fl(r)&&!Va(b)&&!Va(r)&&b.nodeType!==Node.COMMENT_NODE&&r.nodeType!==Node.COMMENT_NODE&&b.tagName.toLowerCase()===r.tagName.toLowerCase()}function cm(b,r,c){return r===c||(Va(r)&&Va(c)?r.data===c.data:!(!b.isBlockFiller(r)||!b.isBlockFiller(c)))}Si(Hl,Ut);var pt={window,document};function mt(b){let r=0;for(;b.previousSibling;)b=b.previousSibling,r++;return r}function ot(b){const r=[];for(;b&&b.nodeType!=Node.DOCUMENT_NODE;)r.unshift(b),b=b.parentNode;return r}const Zt=yp(document);class jt{constructor(r,c={}){this.document=r,this.blockFillerMode=c.blockFillerMode||"br",this.preElements=["pre"],this.blockElements=["p","div","h1","h2","h3","h4","h5","h6","li","dd","dt","figcaption","td","th"],this._blockFiller="br"==this.blockFillerMode?yp:Ca,this._domToViewMapping=new WeakMap,this._viewToDomMapping=new WeakMap,this._fakeSelectionMapping=new WeakMap}bindFakeSelection(r,c){this._fakeSelectionMapping.set(r,new Do(c))}fakeSelectionToView(r){return this._fakeSelectionMapping.get(r)}bindElements(r,c){this._domToViewMapping.set(r,c),this._viewToDomMapping.set(c,r)}unbindDomElement(r){const c=this._domToViewMapping.get(r);if(c){this._domToViewMapping.delete(r),this._viewToDomMapping.delete(c);for(const p of r.childNodes)this.unbindDomElement(p)}}bindDocumentFragments(r,c){this._domToViewMapping.set(r,c),this._viewToDomMapping.set(c,r)}viewToDom(r,c,p={}){if(r.is("$text")){const v=this._processDataFromViewText(r);return c.createTextNode(v)}{if(this.mapViewToDom(r))return this.mapViewToDom(r);let v;if(r.is("documentFragment"))v=c.createDocumentFragment(),p.bind&&this.bindDocumentFragments(v,r);else{if(r.is("uiElement"))return v=r.render(c),p.bind&&this.bindElements(v,r),v;v=r.hasAttribute("xmlns")?c.createElementNS(r.getAttribute("xmlns"),r.name):c.createElement(r.name),r.is("rawElement")&&r.render(v),p.bind&&this.bindElements(v,r);for(const Z of r.getAttributeKeys())v.setAttribute(Z,r.getAttribute(Z))}if(p.withChildren||void 0===p.withChildren)for(const Z of this.viewChildrenToDom(r,c,p))v.appendChild(Z);return v}}*viewChildrenToDom(r,c,p={}){const v=r.getFillerOffset&&r.getFillerOffset();let Z=0;for(const S of r.getChildren())v===Z&&(yield this._blockFiller(c)),yield this.viewToDom(S,c,p),Z++;v===Z&&(yield this._blockFiller(c))}viewRangeToDom(r){const c=this.viewPositionToDom(r.start),p=this.viewPositionToDom(r.end),v=document.createRange();return v.setStart(c.parent,c.offset),v.setEnd(p.parent,p.offset),v}viewPositionToDom(r){const c=r.parent;if(c.is("$text")){const p=this.findCorrespondingDomText(c);if(!p)return null;let v=r.offset;return go(p)&&(v+=7),{parent:p,offset:v}}{let p,v,Z;if(0===r.offset){if(p=this.mapViewToDom(c),!p)return null;Z=p.childNodes[0]}else{const S=r.nodeBefore;if(v=S.is("$text")?this.findCorrespondingDomText(S):this.mapViewToDom(r.nodeBefore),!v)return null;p=v.parentNode,Z=v.nextSibling}return Va(Z)&&go(Z)?{parent:Z,offset:7}:{parent:p,offset:v?mt(v)+1:0}}}domToView(r,c={}){if(this.isBlockFiller(r,this.blockFillerMode))return null;const p=this.getHostViewElement(r,this._domToViewMapping);if(p)return p;if(Va(r)){if(qr(r))return null;{const v=this._processDataFromDomText(r);return""===v?null:new fa(this.document,v)}}if(this.isComment(r))return null;{if(this.mapDomToView(r))return this.mapDomToView(r);let v;if(this.isDocumentFragment(r))v=new Ic(this.document),c.bind&&this.bindDocumentFragments(r,v);else{const Z=c.keepOriginalCase?r.tagName:r.tagName.toLowerCase();v=new ts(this.document,Z),c.bind&&this.bindElements(r,v);const S=r.attributes;for(let I=S.length-1;I>=0;I--)v._setAttribute(S[I].name,S[I].value)}if(c.withChildren||void 0===c.withChildren)for(const Z of this.domChildrenToView(r,c))v._appendChild(Z);return v}}*domChildrenToView(r,c={}){for(let p=0;p{const{scrollLeft:I,scrollTop:V}=S;Z.push([I,V])}),c.focus(),ne(c,S=>{const[I,V]=Z.shift();S.scrollLeft=I,S.scrollTop=V}),pt.window.scrollTo(p,v)}}isElement(r){return r&&r.nodeType==Node.ELEMENT_NODE}isDocumentFragment(r){return r&&r.nodeType==Node.DOCUMENT_FRAGMENT_NODE}isComment(r){return r&&r.nodeType==Node.COMMENT_NODE}isBlockFiller(r){return"br"==this.blockFillerMode?r.isEqualNode(Zt):!("BR"!==r.tagName||!Yt(r,this.blockElements)||1!==r.parentNode.childNodes.length)||function(c,p){return Va(c)&&"\xa0"==c.data&&Yt(c,p)&&1===c.parentNode.childNodes.length}(r,this.blockElements)}isDomSelectionBackward(r){if(r.isCollapsed)return!1;const c=document.createRange();c.setStart(r.anchorNode,r.anchorOffset),c.setEnd(r.focusNode,r.focusOffset);const p=c.collapsed;return c.detach(),p}getHostViewElement(r){const c=ot(r);for(c.pop();c.length;){const p=c.pop(),v=this._domToViewMapping.get(p);if(v&&(v.is("uiElement")||v.is("rawElement")))return v}return null}isDomSelectionCorrect(r){return this._isDomSelectionPositionCorrect(r.anchorNode,r.anchorOffset)&&this._isDomSelectionPositionCorrect(r.focusNode,r.focusOffset)}_isDomSelectionPositionCorrect(r,c){if(Va(r)&&go(r)&&c<7||this.isElement(r)&&go(r.childNodes[c]))return!1;const p=this.mapDomToView(r);return!p||!p.is("uiElement")&&!p.is("rawElement")}_processDataFromViewText(r){let c=r.data;if(r.getAncestors().some(p=>this.preElements.includes(p.name)))return c;if(" "==c.charAt(0)){const p=this._getTouchingViewTextNode(r,!1);(!p||!this._nodeEndsWithSpace(p))&&p||(c="\xa0"+c.substr(1))}if(" "==c.charAt(c.length-1)){const p=this._getTouchingViewTextNode(r,!0);" "!=c.charAt(c.length-2)&&p&&" "!=p.data.charAt(0)||(c=c.substr(0,c.length-1)+"\xa0")}return c.replace(/ {2}/g," \xa0")}_nodeEndsWithSpace(r){if(r.getAncestors().some(p=>this.preElements.includes(p.name)))return!1;const c=this._processDataFromViewText(r);return" "==c.charAt(c.length-1)}_processDataFromDomText(r){let c=r.data;if(se(r,this.preElements))return q1(r);c=c.replace(/[ \n\t\r]{1,}/g," ");const p=this._getTouchingInlineDomNode(r,!1),v=this._getTouchingInlineDomNode(r,!0),Z=this._checkShouldLeftTrimDomText(p),S=this._checkShouldRightTrimDomText(r,v);return Z&&(c=c.replace(/^ /,"")),S&&(c=c.replace(/ $/,"")),c=q1(new Text(c)),c=c.replace(/ \u00A0/g," "),(/( |\u00A0)\u00A0$/.test(c)||!v||v.data&&" "==v.data.charAt(0))&&(c=c.replace(/\u00A0$/," ")),Z&&(c=c.replace(/^\u00A0/," ")),c}_checkShouldLeftTrimDomText(r){return!r||!!Ur(r)||/[^\S\u00A0]/.test(r.data.charAt(r.data.length-1))}_checkShouldRightTrimDomText(r,c){return!c&&!go(r)}_getTouchingViewTextNode(r,c){const p=new Ri({startPosition:c?jn._createAfter(r):jn._createBefore(r),direction:c?"forward":"backward"});for(const v of p){if(v.item.is("containerElement")||v.item.is("element","br"))return null;if(v.item.is("$textProxy"))return v.item}return null}_getTouchingInlineDomNode(r,c){if(!r.parentNode)return null;const p=c?"nextNode":"previousNode",v=r.ownerDocument,Z=ot(r)[0],S=v.createTreeWalker(Z,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,{acceptNode:V=>Va(V)||"BR"==V.tagName?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});S.currentNode=r;const I=S[p]();if(null!==I){const V=function(it,dt){const xt=ot(it),le=ot(dt);let Ie=0;for(;xt[Ie]==le[Ie]&&xt[Ie];)Ie++;return 0===Ie?null:xt[Ie-1]}(r,I);if(V&&!se(r,this.blockElements,V)&&!se(I,this.blockElements,V))return I}return null}}function se(b,r,c){let p=ot(b);return c&&(p=p.slice(p.indexOf(c)+1)),p.some(v=>v.tagName&&r.includes(v.tagName.toLowerCase()))}function ne(b,r){for(;b&&b!=pt.document;)r(b),b=b.parentNode}function Yt(b,r){const c=b.parentNode;return c&&c.tagName&&r.includes(c.tagName.toLowerCase())}function pn(b){const r=Object.prototype.toString.apply(b);return"[object Window]"==r||"[object global]"==r}var gi=At({},Fo,{listenTo(b,...r){if(fl(b)||pn(b)){const c=this._getProxyEmitter(b)||new qi(b);c.attach(...r),b=c}Fo.listenTo.call(this,b,...r)},stopListening(b,r,c){if(fl(b)||pn(b)){const p=this._getProxyEmitter(b);if(!p)return;b=p}Fo.stopListening.call(this,b,r,c),b instanceof qi&&b.detach(r)},_getProxyEmitter(b){return r=this,c=ri(b),r[Br]&&r[Br][c]?r[Br][c].emitter:null;var r,c}});class qi{constructor(r){rr(this,ri(r)),this._domNode=r}}function ri(b){return b["data-ck-expando"]||(b["data-ck-expando"]=Pa())}At(qi.prototype,Fo,{attach(b,r,c={}){if(this._domListeners&&this._domListeners[b])return;const p=this._createDomListener(b,!!c.useCapture);this._domNode.addEventListener(b,p,!!c.useCapture),this._domListeners||(this._domListeners={}),this._domListeners[b]=p},detach(b){let r;!this._domListeners[b]||(r=this._events[b])&&r.callbacks.length||this._domListeners[b].removeListener()},_createDomListener(b,r){const c=p=>{this.fire(b,p)};return c.removeListener=()=>{this._domNode.removeEventListener(b,c,r),delete this._domListeners[b]},c}});class ra{constructor(r){this.view=r,this.document=r.document,this.isEnabled=!1}enable(){this.isEnabled=!0}disable(){this.isEnabled=!1}destroy(){this.disable(),this.stopListening()}}Si(ra,gi);function Qs(b){var r=-1,c=null==b?0:b.length;for(this.__data__=new cn;++rI))return!1;var it=Z.get(b);if(it&&Z.get(r))return it==r;var dt=-1,xt=!0,le=2&c?new cc:void 0;for(Z.set(b,r),Z.set(r,b);++dt{this.listenTo(r,c,(p,v)=>{this.isEnabled&&this.onDomEvent(v)},{useCapture:this.useCapture})})}fire(r,c,p){this.isEnabled&&this.document.fire(r,new ud(this.view,c,p))}}class kd extends dd{constructor(r){super(r),this.domEventType=["keydown","keyup"]}onDomEvent(r){this.fire(r.type,r,{keyCode:r.keyCode,altKey:r.altKey,ctrlKey:r.ctrlKey||r.metaKey,shiftKey:r.shiftKey,get keystroke(){return na(this)}})}}var lm=function(){return g.a.Date.now()},Up=/^\s+|\s+$/g,os=/^[-+]0x[0-9a-f]+$/i,Nu=/^0b[01]+$/i,e1=/^0o[0-7]+$/i,Vl=parseInt,Bl=function(b){if("number"==typeof b)return b;if(kt(b))return NaN;if(Ht(b)){var r="function"==typeof b.valueOf?b.valueOf():b;b=Ht(r)?r+"":r}if("string"!=typeof b)return 0===b?b:+b;b=b.replace(Up,"");var c=Nu.test(b);return c||e1.test(b)?Vl(b.slice(2),c?2:8):os.test(b)?NaN:+b},Fu=Math.max,cu=Math.min,Zp=function(b,r,c){var p,v,Z,S,I,V,it=0,dt=!1,xt=!1,le=!0;if("function"!=typeof b)throw new TypeError("Expected a function");function Ie(xi){var Vi=p,Po=v;return p=v=void 0,it=xi,S=b.apply(Po,Vi)}function rn(xi){return it=xi,I=setTimeout(wn,r),dt?Ie(xi):S}function vn(xi){var Vi=xi-V;return void 0===V||Vi>=r||Vi<0||xt&&xi-it>=Z}function wn(){var Vi,Po,xi=lm();if(vn(xi))return qn(xi);I=setTimeout(wn,(Po=r-((Vi=xi)-V),xt?cu(Po,Z-(Vi-it)):Po))}function qn(xi){return I=void 0,le&&p?Ie(xi):(p=v=void 0,S)}function mi(){var xi=lm(),Vi=vn(xi);if(p=arguments,v=this,V=xi,Vi){if(void 0===I)return rn(V);if(xt)return clearTimeout(I),I=setTimeout(wn,r),Ie(V)}return void 0===I&&(I=setTimeout(wn,r)),S}return r=Bl(r)||0,Ht(c)&&(dt=!!c.leading,Z=(xt="maxWait"in c)?Fu(Bl(c.maxWait)||0,r):Z,le="trailing"in c?!!c.trailing:le),mi.cancel=function(){void 0!==I&&clearTimeout(I),it=0,p=V=v=I=void 0},mi.flush=function(){return void 0===I?S:qn(lm())},mi};class lc extends ra{constructor(r){super(r),this._fireSelectionChangeDoneDebounced=Zp(c=>this.document.fire("selectionChangeDone",c),200)}observe(){const r=this.document;r.on("keydown",(c,p)=>{var v;r.selection.isFake&&((v=p.keyCode)==mo.arrowright||v==mo.arrowleft||v==mo.arrowup||v==mo.arrowdown)&&this.isEnabled&&(p.preventDefault(),this._handleSelectionMove(p.keyCode))},{priority:"lowest"})}destroy(){super.destroy(),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionMove(r){const c=this.document.selection,p=new Do(c.getRanges(),{backward:c.isBackward,fake:!1});r!=mo.arrowleft&&r!=mo.arrowup||p.setTo(p.getFirstPosition()),r!=mo.arrowright&&r!=mo.arrowdown||p.setTo(p.getLastPosition());const v={oldSelection:c,newSelection:p,domSelection:null};this.document.fire("selectionChange",v),this._fireSelectionChangeDoneDebounced(v)}}class um extends ra{constructor(r){super(r),this.mutationObserver=r.getObserver(zl),this.selection=this.document.selection,this.domConverter=r.domConverter,this._documents=new WeakSet,this._fireSelectionChangeDoneDebounced=Zp(c=>this.document.fire("selectionChangeDone",c),200),this._clearInfiniteLoopInterval=setInterval(()=>this._clearInfiniteLoop(),1e3),this._loopbackCounter=0}observe(r){const c=r.ownerDocument;this._documents.has(c)||(this.listenTo(c,"selectionchange",()=>{this._handleSelectionChange(c)}),this._documents.add(c))}destroy(){super.destroy(),clearInterval(this._clearInfiniteLoopInterval),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionChange(r){if(!this.isEnabled)return;this.mutationObserver.flush();const c=r.defaultView.getSelection(),p=this.domConverter.domSelectionToView(c);if(0!=p.rangeCount){if(this.view.hasDomSelection=!0,!(this.selection.isEqual(p)&&this.domConverter.isDomSelectionCorrect(c)||++this._loopbackCounter>60))if(this.selection.isSimilar(p))this.view.forceRender();else{const v={oldSelection:this.selection,newSelection:p,domSelection:c};this.document.fire("selectionChange",v),this._fireSelectionChangeDoneDebounced(v)}}else this.view.hasDomSelection=!1}_clearInfiniteLoop(){this._loopbackCounter=0}}class y extends dd{constructor(r){super(r),this.domEventType=["focus","blur"],this.useCapture=!0;const c=this.document;c.on("focus",()=>{c.isFocused=!0,this._renderTimeoutId=setTimeout(()=>r.forceRender(),50)}),c.on("blur",(p,v)=>{const Z=c.selection.editableElement;null!==Z&&Z!==v.target||(c.isFocused=!1,r.forceRender())})}onDomEvent(r){this.fire(r.type,r)}destroy(){this._renderTimeoutId&&clearTimeout(this._renderTimeoutId),super.destroy()}}class _t extends dd{constructor(r){super(r),this.domEventType=["compositionstart","compositionupdate","compositionend"];const c=this.document;c.on("compositionstart",()=>{c.isComposing=!0}),c.on("compositionend",()=>{c.isComposing=!1})}onDomEvent(r){this.fire(r.type,r)}}class di extends dd{constructor(r){super(r),this.domEventType=["beforeinput"]}onDomEvent(r){this.fire(r.type,r)}}function nl(b){return"[object Range]"==Object.prototype.toString.apply(b)}function Iu(b){const r=b.ownerDocument.defaultView.getComputedStyle(b);return{top:parseInt(r.borderTopWidth,10),right:parseInt(r.borderRightWidth,10),bottom:parseInt(r.borderBottomWidth,10),left:parseInt(r.borderLeftWidth,10)}}const lu=["top","right","bottom","left","width","height"];class cr{constructor(r){const c=nl(r);if(Object.defineProperty(this,"_source",{value:r._source||r,writable:!0,enumerable:!1}),Ur(r)||c)N1(this,c?cr.getDomRangeRects(r)[0]:r.getBoundingClientRect());else if(pn(r)){const{innerWidth:p,innerHeight:v}=r;N1(this,{top:0,right:p,bottom:v,left:0,width:p,height:v})}else N1(this,r)}clone(){return new cr(this)}moveTo(r,c){return this.top=c,this.right=r+this.width,this.bottom=c+this.height,this.left=r,this}moveBy(r,c){return this.top+=c,this.right+=r,this.left+=r,this.bottom+=c,this}getIntersection(r){const c={top:Math.max(this.top,r.top),right:Math.min(this.right,r.right),bottom:Math.min(this.bottom,r.bottom),left:Math.max(this.left,r.left)};return c.width=c.right-c.left,c.height=c.bottom-c.top,c.width<0||c.height<0?null:new cr(c)}getIntersectionArea(r){const c=this.getIntersection(r);return c?c.getArea():0}getArea(){return this.width*this.height}getVisible(){const r=this._source;let c=this.clone();if(!Jr(r)){let p=r.parentNode||r.commonAncestorContainer;for(;p&&!Jr(p);){const v=new cr(p),Z=c.getIntersection(v);if(!Z)return null;Z.getArea()Pe(b,p));const S=Pe(b,p);if(Ld(p,S,r),p.parent!=p){if(v=p.frameElement,p=p.parent,!v)return}else p=null}}function Ld(b,r,c){const p=r.clone().moveBy(0,c),v=r.clone().moveBy(0,-c),Z=new cr(b).excludeScrollbarsAndBorders();if(![v,p].every(S=>Z.contains(S))){let{scrollX:S,scrollY:I}=b;xa(v,Z)?I-=Z.top-r.top+c:qd(p,Z)&&(I+=r.bottom-Z.bottom+c),F(r,Z)?S-=Z.left-r.left+c:lt(r,Z)&&(S+=r.right-Z.right+c),b.scrollTo(S,I)}}function pd(b,r){const c=Gt(b);let p,v;for(;b!=c.document.body;)v=r(),p=new cr(b).excludeScrollbarsAndBorders(),p.contains(v)||(xa(v,p)?b.scrollTop-=p.top-v.top:qd(v,p)&&(b.scrollTop+=v.bottom-p.bottom),F(v,p)?b.scrollLeft-=p.left-v.left:lt(v,p)&&(b.scrollLeft+=v.right-p.right)),b=b.parentNode}function qd(b,r){return b.bottom>r.bottom}function xa(b,r){return b.topr.right}function Gt(b){return nl(b)?b.startContainer.ownerDocument.defaultView:b.ownerDocument.defaultView}function be(b){if(nl(b)){let r=b.commonAncestorContainer;return Va(r)&&(r=r.parentNode),r}return b.parentNode}function Pe(b,r){const c=Gt(b),p=new cr(b);if(c===r)return p;{let v=c;for(;v!=r;){const S=new cr(v.frameElement).excludeScrollbarsAndBorders();p.moveBy(S.left,S.top),v=v.parent}}return p}Object.assign({},{scrollViewportToShowTarget:Od,scrollAncestorsToShowTarget:function(b){pd(be(b),()=>new cr(b))}});class In{constructor(r){this.document=new br(r),this.domConverter=new jt(this.document),this.domRoots=new Map,this.set("isRenderingInProgress",!1),this.set("hasDomSelection",!1),this._renderer=new Hl(this.domConverter,this.document.selection),this._renderer.bind("isFocused").to(this.document),this._initialDomRootAttributes=new WeakMap,this._observers=new Map,this._ongoingChange=!1,this._postFixersInProgress=!1,this._renderingDisabled=!1,this._hasChangedSinceTheLastRendering=!1,this._writer=new tl(this.document),this.addObserver(zl),this.addObserver(um),this.addObserver(y),this.addObserver(kd),this.addObserver(lc),this.addObserver(_t),Dr_isAndroid&&this.addObserver(di),this.document.on("keydown",Er),function ml(b){b.document.on("keydown",(r,c)=>function(p,v,Z){if(v.keyCode==mo.arrowright){const S=v.domTarget.ownerDocument.defaultView.getSelection(),I=1==S.rangeCount&&S.getRangeAt(0).collapsed;if(I||v.shiftKey){const dt=Z.domPositionToView(S.focusNode,S.focusOffset);if(null===dt)return;let xt=!1;const le=dt.getLastMatchingPosition(Ie=>(Ie.item.is("uiElement")&&(xt=!0),!(!Ie.item.is("uiElement")&&!Ie.item.is("attributeElement"))));if(xt){const Ie=Z.viewPositionToDom(le);I?S.collapse(Ie.parent,Ie.offset):S.extend(Ie.parent,Ie.offset)}}}}(0,c,b.domConverter))}(this),this.on("render",()=>{this._render(),this.document.fire("layoutChanged"),this._hasChangedSinceTheLastRendering=!1}),this.listenTo(this.document.selection,"change",()=>{this._hasChangedSinceTheLastRendering=!0})}attachDomRoot(r,c="main"){const p=this.document.getRoot(c);p._name=r.tagName.toLowerCase();const v={};for(const{name:S,value:I}of Array.from(r.attributes))v[S]=I,"class"===S?this._writer.addClass(I.split(" "),p):this._writer.setAttribute(S,I,p);this._initialDomRootAttributes.set(r,v);const Z=()=>{this._writer.setAttribute("contenteditable",!p.isReadOnly,p),p.isReadOnly?this._writer.addClass("ck-read-only",p):this._writer.removeClass("ck-read-only",p)};Z(),this.domRoots.set(c,r),this.domConverter.bindElements(r,p),this._renderer.markToSync("children",p),this._renderer.markToSync("attributes",p),this._renderer.domDocuments.add(r.ownerDocument),p.on("change:children",(S,I)=>this._renderer.markToSync("children",I)),p.on("change:attributes",(S,I)=>this._renderer.markToSync("attributes",I)),p.on("change:text",(S,I)=>this._renderer.markToSync("text",I)),p.on("change:isReadOnly",()=>this.change(Z)),p.on("change",()=>{this._hasChangedSinceTheLastRendering=!0});for(const S of this._observers.values())S.observe(r,c)}detachDomRoot(r){const c=this.domRoots.get(r);Array.from(c.attributes).forEach(({name:v})=>c.removeAttribute(v));const p=this._initialDomRootAttributes.get(c);for(const v in p)c.setAttribute(v,p[v]);this.domRoots.delete(r),this.domConverter.unbindDomElement(c)}getDomRoot(r="main"){return this.domRoots.get(r)}addObserver(r){let c=this._observers.get(r);if(c)return c;c=new r(this),this._observers.set(r,c);for(const[p,v]of this.domRoots)c.observe(v,p);return c.enable(),c}getObserver(r){return this._observers.get(r)}disableObservers(){for(const r of this._observers.values())r.disable()}enableObservers(){for(const r of this._observers.values())r.enable()}scrollToTheSelection(){const r=this.document.selection.getFirstRange();r&&Od({target:this.domConverter.viewRangeToDom(r),viewportOffset:20})}focus(){if(!this.document.isFocused){const r=this.document.selection.editableElement;r&&(this.domConverter.focus(r),this.forceRender())}}change(r){if(this.isRenderingInProgress||this._postFixersInProgress)throw new En.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 r(this._writer);this._ongoingChange=!0;const c=r(this._writer);return this._ongoingChange=!1,!this._renderingDisabled&&this._hasChangedSinceTheLastRendering&&(this._postFixersInProgress=!0,this.document._callPostFixers(this._writer),this._postFixersInProgress=!1,this.fire("render")),c}catch(c){En.b.rethrowUnexpectedError(c,this)}}forceRender(){this._hasChangedSinceTheLastRendering=!0,this.change(()=>{})}destroy(){for(const r of this._observers.values())r.destroy();this.document.destroy(),this.stopListening()}createPositionAt(r,c){return jn._createAt(r,c)}createPositionAfter(r){return jn._createAfter(r)}createPositionBefore(r){return jn._createBefore(r)}createRange(r,c){return new vi(r,c)}createRangeOn(r){return vi._createOn(r)}createRangeIn(r){return vi._createIn(r)}createSelection(r,c,p){return new Do(r,c,p)}_disableRendering(r){this._renderingDisabled=r,0==r&&this.change(()=>{})}_render(){this.isRenderingInProgress=!0,this.disableObservers(),this._renderer.render(),this.enableObservers(),this.isRenderingInProgress=!1}}Si(In,Ut);class _i{constructor(r){this.parent=null,this._attrs=aa(r)}get index(){let r;if(!this.parent)return null;if(null===(r=this.parent.getChildIndex(this)))throw new En.b("model-node-not-found-in-parent: The node's parent does not contain this node.",this);return r}get startOffset(){let r;if(!this.parent)return null;if(null===(r=this.parent.getChildStartOffset(this)))throw new En.b("model-node-not-found-in-parent: The node's parent does not contain this node.",this);return r}get offsetSize(){return 1}get endOffset(){return this.parent?this.startOffset+this.offsetSize:null}get nextSibling(){const r=this.index;return null!==r&&this.parent.getChild(r+1)||null}get previousSibling(){const r=this.index;return null!==r&&this.parent.getChild(r-1)||null}get root(){let r=this;for(;r.parent;)r=r.parent;return r}isAttached(){return this.root.is("rootElement")}getPath(){const r=[];let c=this;for(;c.parent;)r.unshift(c.startOffset),c=c.parent;return r}getAncestors(r={includeSelf:!1,parentFirst:!1}){const c=[];let p=r.includeSelf?this:this.parent;for(;p;)c[r.parentFirst?"push":"unshift"](p),p=p.parent;return c}getCommonAncestor(r,c={}){const p=this.getAncestors(c),v=r.getAncestors(c);let Z=0;for(;p[Z]==v[Z]&&p[Z];)Z++;return 0===Z?null:p[Z-1]}isBefore(r){if(this==r||this.root!==r.root)return!1;const c=this.getPath(),p=r.getPath(),v=_r(c,p);switch(v){case"prefix":return!0;case"extension":return!1;default:return c[v](c[p[0]]=p[1],c),{})),r}is(r){return"node"===r||"model:node"===r}_clone(){return new _i(this._attrs)}_remove(){this.parent._removeChildren(this.index)}_setAttribute(r,c){this._attrs.set(r,c)}_setAttributesTo(r){this._attrs=aa(r)}_removeAttribute(r){return this._attrs.delete(r)}_clearAttributes(){this._attrs.clear()}}class Bi extends _i{constructor(r,c){super(c),this._data=r||""}get offsetSize(){return this.data.length}get data(){return this._data}is(r){return"$text"===r||"model:$text"===r||"text"===r||"model:text"===r||"node"===r||"model:node"===r}toJSON(){const r=super.toJSON();return r.data=this.data,r}_clone(){return new Bi(this.data,this.getAttributes())}static fromJSON(r){return new Bi(r.data,r.attributes)}}class Zo{constructor(r,c,p){if(this.textNode=r,c<0||c>r.offsetSize)throw new En.b("model-textproxy-wrong-offsetintext: Given offsetInText value is incorrect.",this);if(p<0||c+p>r.offsetSize)throw new En.b("model-textproxy-wrong-length: Given length value is incorrect.",this);this.data=r.data.substring(c,c+p),this.offsetInText=c}get startOffset(){return null!==this.textNode.startOffset?this.textNode.startOffset+this.offsetInText:null}get offsetSize(){return this.data.length}get endOffset(){return null!==this.startOffset?this.startOffset+this.offsetSize:null}get isPartial(){return this.offsetSize!==this.textNode.offsetSize}get parent(){return this.textNode.parent}get root(){return this.textNode.root}is(r){return"$textProxy"===r||"model:$textProxy"===r||"textProxy"===r||"model:textProxy"===r}getPath(){const r=this.textNode.getPath();return r.length>0&&(r[r.length-1]+=this.offsetInText),r}getAncestors(r={includeSelf:!1,parentFirst:!1}){const c=[];let p=r.includeSelf?this:this.parent;for(;p;)c[r.parentFirst?"push":"unshift"](p),p=p.parent;return c}hasAttribute(r){return this.textNode.hasAttribute(r)}getAttribute(r){return this.textNode.getAttribute(r)}getAttributes(){return this.textNode.getAttributes()}getAttributeKeys(){return this.textNode.getAttributeKeys()}}class Ea{constructor(r){this._nodes=[],r&&this._insertNodes(0,r)}[Symbol.iterator](){return this._nodes[Symbol.iterator]()}get length(){return this._nodes.length}get maxOffset(){return this._nodes.reduce((r,c)=>r+c.offsetSize,0)}getNode(r){return this._nodes[r]||null}getNodeIndex(r){const c=this._nodes.indexOf(r);return-1==c?null:c}getNodeStartOffset(r){const c=this.getNodeIndex(r);return null===c?null:this._nodes.slice(0,c).reduce((p,v)=>p+v.offsetSize,0)}indexToOffset(r){if(r==this._nodes.length)return this.maxOffset;const c=this._nodes[r];if(!c)throw new En.b("model-nodelist-index-out-of-bounds: Given index cannot be found in the node list.",this);return this.getNodeStartOffset(c)}offsetToIndex(r){let c=0;for(const p of this._nodes){if(r>=c&&rr.toJSON())}}class Wo extends _i{constructor(r,c,p){super(c),this.name=r,this._children=new Ea,p&&this._insertChild(0,p)}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}is(r,c=null){return c?c===this.name&&("element"===r||"model:element"===r):"element"===r||"model:element"===r||"node"===r||"model:node"===r}getChild(r){return this._children.getNode(r)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(r){return this._children.getNodeIndex(r)}getChildStartOffset(r){return this._children.getNodeStartOffset(r)}offsetToIndex(r){return this._children.offsetToIndex(r)}getNodeByPath(r){let c=this;for(const p of r)c=c.getChild(c.offsetToIndex(p));return c}findAncestor(r,c={includeSelf:!1}){let p=c.includeSelf?this:this.parent;for(;p;){if(p.name===r)return p;p=p.parent}return null}toJSON(){const r=super.toJSON();if(r.name=this.name,this._children.length>0){r.children=[];for(const c of this._children)r.children.push(c.toJSON())}return r}_clone(r=!1){const c=r?Array.from(this._children).map(p=>p._clone(!0)):null;return new Wo(this.name,this.getAttributes(),c)}_appendChild(r){this._insertChild(this.childCount,r)}_insertChild(r,c){const p="string"==typeof(v=c)?[new Bi(v)]:(ta(v)||(v=[v]),Array.from(v).map(Z=>"string"==typeof Z?new Bi(Z):Z instanceof Zo?new Bi(Z.data,Z.getAttributes()):Z));var v;for(const v of p)null!==v.parent&&v._remove(),v.parent=this;this._children._insertNodes(r,p)}_removeChildren(r,c=1){const p=this._children._removeNodes(r,c);for(const v of p)v.parent=null;return p}static fromJSON(r){let c=null;if(r.children){c=[];for(const p of r.children)c.push(p.name?Wo.fromJSON(p):Bi.fromJSON(p))}return new Wo(r.name,r.attributes,c)}}class js{constructor(r={}){if(!r.boundaries&&!r.startPosition)throw new En.b("model-tree-walker-no-start-position: Neither boundaries nor starting position have been defined.",null);const c=r.direction||"forward";if("forward"!=c&&"backward"!=c)throw new En.b("model-tree-walker-unknown-direction: Only `backward` and `forward` direction allowed.",r,{direction:c});this.direction=c,this.boundaries=r.boundaries||null,this.position=r.startPosition?r.startPosition.clone():Ei._createAt(this.boundaries["backward"==this.direction?"end":"start"]),this.position.stickiness="toNone",this.singleCharacters=!!r.singleCharacters,this.shallow=!!r.shallow,this.ignoreElementEnd=!!r.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(r){let c,p,v,Z;do{v=this.position,Z=this._visitedParent,({done:c,value:p}=this.next())}while(!c&&r(p));c||(this.position=v,this._visitedParent=Z)}next(){return"forward"==this.direction?this._next():this._previous()}_next(){const r=this.position,c=this.position.clone(),p=this._visitedParent;if(null===p.parent&&c.offset===p.maxOffset)return{done:!0};if(p===this._boundaryEndParent&&c.offset==this.boundaries.end.offset)return{done:!0};const v=c.parent,Z=wp(c,v),S=Z||l_(c,v,Z);if(S instanceof Wo)return this.shallow?c.offset++:(c.path.push(0),this._visitedParent=S),this.position=c,Rc("elementStart",S,r,c,1);if(S instanceof Bi){let I;if(this.singleCharacters)I=1;else{let dt=S.endOffset;this._boundaryEndParent==p&&this.boundaries.end.offsetdt&&(dt=this.boundaries.start.offset),I=c.offset-dt}const it=new Zo(S,c.offset-S.startOffset-I,I);return c.offset-=I,this.position=c,Rc("text",it,r,c,I)}return c.path.pop(),this.position=c,this._visitedParent=p.parent,Rc("elementStart",p,r,c,1)}}function Rc(b,r,c,p,v){return{done:!1,value:{type:b,item:r,previousPosition:c,nextPosition:p,length:v}}}class Ei{constructor(r,c,p="toNone"){if(!r.is("element")&&!r.is("documentFragment"))throw new En.b("model-position-root-invalid: Position root invalid.",r);if(!(c instanceof Array)||0===c.length)throw new En.b("model-position-path-incorrect-format: Position path must be an array with at least one item.",r,{path:c});r.is("rootElement")?c=c.slice():(c=[...r.getPath(),...c],r=r.root),this.root=r,this.path=c,this.stickiness=p}get offset(){return this.path[this.path.length-1]}set offset(r){this.path[this.path.length-1]=r}get parent(){let r=this.root;for(let c=0;cp.path.length){if(c.offset!==v.maxOffset)return!1;c.path=c.path.slice(0,-1),v=v.parent,c.offset++}else{if(0!==p.offset)return!1;p.path=p.path.slice(0,-1)}}}is(r){return"position"===r||"model:position"===r}hasSameParentAs(r){return this.root===r.root&&"same"==_r(this.getParentPath(),r.getParentPath())}getTransformedByOperation(r){let c;switch(r.type){case"insert":c=this._getTransformedByInsertOperation(r);break;case"move":case"remove":case"reinsert":c=this._getTransformedByMoveOperation(r);break;case"split":c=this._getTransformedBySplitOperation(r);break;case"merge":c=this._getTransformedByMergeOperation(r);break;default:c=Ei._createAt(this)}return c}_getTransformedByInsertOperation(r){return this._getTransformedByInsertion(r.position,r.howMany)}_getTransformedByMoveOperation(r){return this._getTransformedByMove(r.sourcePosition,r.targetPosition,r.howMany)}_getTransformedBySplitOperation(r){const c=r.movedRange;return c.containsPosition(this)||c.start.isEqual(this)&&"toNext"==this.stickiness?this._getCombined(r.splitPosition,r.moveTargetPosition):r.graveyardPosition?this._getTransformedByMove(r.graveyardPosition,r.insertionPosition,1):this._getTransformedByInsertion(r.insertionPosition,1)}_getTransformedByMergeOperation(r){const c=r.movedRange;let p;return c.containsPosition(this)||c.start.isEqual(this)?(p=this._getCombined(r.sourcePosition,r.targetPosition),r.sourcePosition.isBefore(r.targetPosition)&&(p=p._getTransformedByDeletion(r.deletionPosition,1))):p=this.isEqual(r.deletionPosition)?Ei._createAt(r.deletionPosition):this._getTransformedByMove(r.deletionPosition,r.graveyardPosition,1),p}_getTransformedByDeletion(r,c){const p=Ei._createAt(this);if(this.root!=r.root)return p;if("same"==_r(r.getParentPath(),this.getParentPath())){if(r.offsetthis.offset)return null;p.offset-=c}}else if("prefix"==_r(r.getParentPath(),this.getParentPath())){const v=r.path.length-1;if(r.offset<=this.path[v]){if(r.offset+c>this.path[v])return null;p.path[v]-=c}}return p}_getTransformedByInsertion(r,c){const p=Ei._createAt(this);if(this.root!=r.root)return p;if("same"==_r(r.getParentPath(),this.getParentPath()))(r.offsetc+1;){const Z=v.maxOffset-p.offset;0!==Z&&r.push(new bi(p,p.getShiftedBy(Z))),p.path=p.path.slice(0,-1),p.offset++,v=v.parent}for(;p.path.length<=this.end.path.length;){const Z=this.end.path[p.path.length-1],S=Z-p.offset;0!==S&&r.push(new bi(p,p.getShiftedBy(S))),p.offset=Z,p.path.push(0)}return r}getWalker(r={}){return r.boundaries=this,new js(r)}*getItems(r={}){r.boundaries=this,r.ignoreElementEnd=!0;const c=new js(r);for(const p of c)yield p.item}*getPositions(r={}){r.boundaries=this;const c=new js(r);yield c.position;for(const p of c)yield p.nextPosition}getTransformedByOperation(r){switch(r.type){case"insert":return this._getTransformedByInsertOperation(r);case"move":case"remove":case"reinsert":return this._getTransformedByMoveOperation(r);case"split":return[this._getTransformedBySplitOperation(r)];case"merge":return[this._getTransformedByMergeOperation(r)]}return[new bi(this.start,this.end)]}getTransformedByOperations(r){const c=[new bi(this.start,this.end)];for(const p of r)for(let v=0;v0?new this(p,v):new this(v,p)}static _createIn(r){return new this(Ei._createAt(r,0),Ei._createAt(r,r.maxOffset))}static _createOn(r){return this._createFromPositionAndShift(Ei._createBefore(r),r.offsetSize)}static _createFromRanges(r){if(0===r.length)throw new En.b("range-create-from-ranges-empty-array: At least one range has to be passed.",null);if(1==r.length)return r[0].clone();const c=r[0];r.sort((Z,S)=>Z.start.isAfter(S.start)?1:-1);const p=r.indexOf(c),v=new this(c.start,c.end);if(p>0)for(let Z=p-1;r[Z].end.isEqual(v.start);Z++)v.start=Ei._createAt(r[Z].start);for(let Z=p+1;Z{if(c.viewPosition)return;const p=this._modelToViewMapping.get(c.modelPosition.parent);c.viewPosition=this.findPositionIn(p,c.modelPosition.offset)},{priority:"low"}),this.on("viewToModelPosition",(r,c)=>{if(c.modelPosition)return;const p=this.findMappedViewAncestor(c.viewPosition),v=this._viewToModelMapping.get(p),Z=this._toModelOffset(c.viewPosition.parent,c.viewPosition.offset,p);c.modelPosition=Ei._createAt(v,Z)},{priority:"low"})}bindElements(r,c){this._modelToViewMapping.set(r,c),this._viewToModelMapping.set(c,r)}unbindViewElement(r){const c=this.toModelElement(r);if(this._viewToModelMapping.delete(r),this._elementToMarkerNames.has(r))for(const p of this._elementToMarkerNames.get(r))this._unboundMarkerNames.add(p);this._modelToViewMapping.get(c)==r&&this._modelToViewMapping.delete(c)}unbindModelElement(r){const c=this.toViewElement(r);this._modelToViewMapping.delete(r),this._viewToModelMapping.get(c)==r&&this._viewToModelMapping.delete(c)}bindElementToMarker(r,c){const p=this._markerNameToElements.get(c)||new Set;p.add(r);const v=this._elementToMarkerNames.get(r)||new Set;v.add(c),this._markerNameToElements.set(c,p),this._elementToMarkerNames.set(r,v)}unbindElementFromMarkerName(r,c){const p=this._markerNameToElements.get(c);p&&(p.delete(r),0==p.size&&this._markerNameToElements.delete(c));const v=this._elementToMarkerNames.get(r);v&&(v.delete(c),0==v.size&&this._elementToMarkerNames.delete(r))}flushUnboundMarkerNames(){const r=Array.from(this._unboundMarkerNames);return this._unboundMarkerNames.clear(),r}clearBindings(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._markerNameToElements=new Map,this._elementToMarkerNames=new Map,this._unboundMarkerNames=new Set}toModelElement(r){return this._viewToModelMapping.get(r)}toViewElement(r){return this._modelToViewMapping.get(r)}toModelRange(r){return new bi(this.toModelPosition(r.start),this.toModelPosition(r.end))}toViewRange(r){return new vi(this.toViewPosition(r.start),this.toViewPosition(r.end))}toModelPosition(r){const c={viewPosition:r,mapper:this};return this.fire("viewToModelPosition",c),c.modelPosition}toViewPosition(r,c={isPhantom:!1}){const p={modelPosition:r,mapper:this,isPhantom:c.isPhantom};return this.fire("modelToViewPosition",p),p.viewPosition}markerNameToElements(r){const c=this._markerNameToElements.get(r);if(!c)return null;const p=new Set;for(const v of c)if(v.is("attributeElement"))for(const Z of v.getElementsWithSameId())p.add(Z);else p.add(v);return p}registerViewToModelLength(r,c){this._viewToModelLengthCallbacks.set(r,c)}findMappedViewAncestor(r){let c=r.parent;for(;!this._viewToModelMapping.has(c);)c=c.parent;return c}_toModelOffset(r,c,p){if(p!=r)return this._toModelOffset(r.parent,r.index,p)+this._toModelOffset(r,c,r);if(r.is("$text"))return c;let v=0;for(let Z=0;Z1?r[0]+":"+r[1]:r[0]}class pm{constructor(r){this.conversionApi=At({dispatcher:this},r)}convertChanges(r,c,p){for(const v of r.getMarkersToRemove())this.convertMarkerRemove(v.name,v.range,p);for(const v of r.getChanges())"insert"==v.type?this.convertInsert(bi._createFromPositionAndShift(v.position,v.length),p):"remove"==v.type?this.convertRemove(v.position,v.length,v.name,p):this.convertAttribute(v.range,v.attributeKey,v.attributeOldValue,v.attributeNewValue,p);for(const v of this.conversionApi.mapper.flushUnboundMarkerNames()){const Z=c.get(v).getRange();this.convertMarkerRemove(v,Z,p),this.convertMarkerAdd(v,Z,p)}for(const v of r.getMarkersToAdd())this.convertMarkerAdd(v.name,v.range,p)}convertInsert(r,c){this.conversionApi.writer=c,this.conversionApi.consumable=this._createInsertConsumable(r);for(const p of r){const v=p.item,Z={item:v,range:bi._createFromPositionAndShift(p.previousPosition,p.length)};this._testAndFire("insert",Z);for(const S of v.getAttributeKeys())Z.attributeKey=S,Z.attributeOldValue=null,Z.attributeNewValue=v.getAttribute(S),this._testAndFire("attribute:"+S,Z)}this._clearConversionApi()}convertRemove(r,c,p,v){this.conversionApi.writer=v,this.fire("remove:"+p,{position:r,length:c},this.conversionApi),this._clearConversionApi()}convertAttribute(r,c,p,v,Z){this.conversionApi.writer=Z,this.conversionApi.consumable=this._createConsumableForRange(r,"attribute:"+c);for(const S of r){const I={item:S.item,range:bi._createFromPositionAndShift(S.previousPosition,S.length),attributeKey:c,attributeOldValue:p,attributeNewValue:v};this._testAndFire("attribute:"+c,I)}this._clearConversionApi()}convertSelection(r,c,p){const v=Array.from(c.getMarkersAtPosition(r.getFirstPosition()));if(this.conversionApi.writer=p,this.conversionApi.consumable=this._createSelectionConsumable(r,v),this.fire("selection",{selection:r},this.conversionApi),r.isCollapsed){for(const Z of v){const S=Z.getRange();if(!ya(r.getFirstPosition(),Z,this.conversionApi.mapper))continue;const I={item:r,markerName:Z.name,markerRange:S};this.conversionApi.consumable.test(r,"addMarker:"+Z.name)&&this.fire("addMarker:"+Z.name,I,this.conversionApi)}for(const Z of r.getAttributeKeys()){const S={item:r,range:r.getFirstRange(),attributeKey:Z,attributeOldValue:null,attributeNewValue:r.getAttribute(Z)};this.conversionApi.consumable.test(r,"attribute:"+S.attributeKey)&&this.fire("attribute:"+S.attributeKey+":$text",S,this.conversionApi)}this._clearConversionApi()}}convertMarkerAdd(r,c,p){if(!c.root.document||"$graveyard"==c.root.rootName)return;this.conversionApi.writer=p;const v="addMarker:"+r,Z=new F1;if(Z.add(c,v),this.conversionApi.consumable=Z,this.fire(v,{markerName:r,markerRange:c},this.conversionApi),Z.test(c,v)){this.conversionApi.consumable=this._createConsumableForRange(c,v);for(const S of c.getItems()){if(!this.conversionApi.consumable.test(S,v))continue;const I={item:S,range:bi._createOn(S),markerName:r,markerRange:c};this.fire(v,I,this.conversionApi)}this._clearConversionApi()}}convertMarkerRemove(r,c,p){c.root.document&&"$graveyard"!=c.root.rootName&&(this.conversionApi.writer=p,this.fire("removeMarker:"+r,{markerName:r,markerRange:c},this.conversionApi),this._clearConversionApi())}_createInsertConsumable(r){const c=new F1;for(const p of r){const v=p.item;c.add(v,"insert");for(const Z of v.getAttributeKeys())c.add(v,"attribute:"+Z)}return c}_createConsumableForRange(r,c){const p=new F1;for(const v of r.getItems())p.add(v,c);return p}_createSelectionConsumable(r,c){const p=new F1;p.add(r,"selection");for(const v of c)p.add(r,"addMarker:"+v.name);for(const v of r.getAttributeKeys())p.add(r,"attribute:"+v);return p}_testAndFire(r,c){this.conversionApi.consumable.test(c.item,r)&&this.fire(r+":"+(c.item.name||"$text"),c,this.conversionApi)}_clearConversionApi(){delete this.conversionApi.writer,delete this.conversionApi.consumable}}function ya(b,r,c){const p=r.getRange(),v=Array.from(b.getAncestors());return v.shift(),v.reverse(),!v.some(Z=>{if(p.containsItem(Z))return!!c.toViewElement(Z).getCustomProperty("addHighlight")})}Si(pm,Fo);class md{constructor(r,c,p){this._lastRangeBackward=!1,this._ranges=[],this._attrs=new Map,r&&this.setTo(r,c,p)}get anchor(){if(this._ranges.length>0){const r=this._ranges[this._ranges.length-1];return this._lastRangeBackward?r.end:r.start}return null}get focus(){if(this._ranges.length>0){const r=this._ranges[this._ranges.length-1];return this._lastRangeBackward?r.start:r.end}return null}get isCollapsed(){return 1===this._ranges.length&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}isEqual(r){if(this.rangeCount!=r.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(r.anchor)||!this.focus.isEqual(r.focus))return!1;for(const c of this._ranges){let p=!1;for(const v of r._ranges)if(c.isEqual(v)){p=!0;break}if(!p)return!1}return!0}*getRanges(){for(const r of this._ranges)yield new bi(r.start,r.end)}getFirstRange(){let r=null;for(const c of this._ranges)r&&!c.start.isBefore(r.start)||(r=c);return r?new bi(r.start,r.end):null}getLastRange(){let r=null;for(const c of this._ranges)r&&!c.end.isAfter(r.end)||(r=c);return r?new bi(r.start,r.end):null}getFirstPosition(){const r=this.getFirstRange();return r?r.start.clone():null}getLastPosition(){const r=this.getLastRange();return r?r.end.clone():null}setTo(r,c,p){if(null===r)this._setRanges([]);else if(r instanceof md)this._setRanges(r.getRanges(),r.isBackward);else if(r&&"function"==typeof r.getRanges)this._setRanges(r.getRanges(),r.isBackward);else if(r instanceof bi)this._setRanges([r],!!c&&!!c.backward);else if(r instanceof Ei)this._setRanges([new bi(r)]);else if(r instanceof _i){const v=!!p&&!!p.backward;let Z;if("in"==c)Z=bi._createIn(r);else if("on"==c)Z=bi._createOn(r);else{if(void 0===c)throw new En.b("model-selection-setTo-required-second-parameter: selection.setTo requires the second parameter when the first parameter is a node.",[this,r]);Z=new bi(Ei._createAt(r,c))}this._setRanges([Z],v)}else{if(!ta(r))throw new En.b("model-selection-setTo-not-selectable: Cannot set the selection to the given place.",[this,r]);this._setRanges(r,c&&!!c.backward)}}_setRanges(r,c=!1){const p=(r=Array.from(r)).some(v=>{if(!(v instanceof bi))throw new En.b("model-selection-set-ranges-not-range: Selection range set to an object that is not an instance of model.Range.",[this,r]);return this._ranges.every(Z=>!Z.isEqual(v))});if(r.length!==this._ranges.length||p){this._removeAllRanges();for(const v of r)this._pushRange(v);this._lastRangeBackward=!!c,this.fire("change:range",{directChange:!0})}}setFocus(r,c){if(null===this.anchor)throw new En.b("model-selection-setFocus-no-ranges: Cannot set selection focus if there are no ranges in selection.",[this,r]);const p=Ei._createAt(r,c);if("same"==p.compareWith(this.focus))return;const v=this.anchor;this._ranges.length&&this._popRange(),"before"==p.compareWith(v)?(this._pushRange(new bi(p,v)),this._lastRangeBackward=!0):(this._pushRange(new bi(v,p)),this._lastRangeBackward=!1),this.fire("change:range",{directChange:!0})}getAttribute(r){return this._attrs.get(r)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}hasAttribute(r){return this._attrs.has(r)}removeAttribute(r){this.hasAttribute(r)&&(this._attrs.delete(r),this.fire("change:attribute",{attributeKeys:[r],directChange:!0}))}setAttribute(r,c){this.getAttribute(r)!==c&&(this._attrs.set(r,c),this.fire("change:attribute",{attributeKeys:[r],directChange:!0}))}getSelectedElement(){return 1!==this.rangeCount?null:this.getFirstRange().getContainedElement()}is(r){return"selection"===r||"model:selection"===r}*getSelectedBlocks(){const r=new WeakSet;for(const c of this.getRanges()){const p=d_(c.start,r);p&&q2(p,c)&&(yield p);for(const Z of c.getWalker()){const S=Z.item;"elementEnd"==Z.type&&n1(S,r,c)&&(yield S)}const v=d_(c.end,r);v&&!c.end.isTouching(Ei._createAt(v,0))&&q2(v,c)&&(yield v)}}containsEntireContent(r=this.anchor.root){const c=Ei._createAt(r,0),p=Ei._createAt(r,"end");return c.isTouching(this.getFirstPosition())&&p.isTouching(this.getLastPosition())}_pushRange(r){this._checkRange(r),this._ranges.push(new bi(r.start,r.end))}_checkRange(r){for(let c=0;c0;)this._popRange()}_popRange(){this._ranges.pop()}}function L2(b,r){return!r.has(b)&&(r.add(b),b.root.document.model.schema.isBlock(b)&&b.parent)}function n1(b,r,c){return L2(b,r)&&q2(b,c)}function d_(b,r){const c=b.parent.root.document.model.schema,p=b.parent.getAncestors({parentFirst:!0,includeSelf:!0});let v=!1;const Z=p.find(S=>!v&&(v=c.isLimit(S),!v&&L2(S,r)));return p.forEach(S=>r.add(S)),Z}function q2(b,r){const c=function(p){const v=p.root.document.model.schema;let Z=p.parent;for(;Z;){if(v.isBlock(Z))return Z;Z=Z.parent}}(b);return!c||!r.containsRange(bi._createOn(c),!0)}Si(md,Fo);class i1 extends bi{constructor(r,c){super(r,c),Jl.call(this)}detach(){this.stopListening()}is(r){return"liveRange"===r||"model:liveRange"===r||"range"==r||"model:range"===r}toRange(){return new bi(this.start,this.end)}static fromRange(r){return new i1(r.start,r.end)}}function Jl(){this.listenTo(this.root.document.model,"applyOperation",(b,r)=>{const c=r[0];c.isDocumentOperation&&dg.call(this,c)},{priority:"low"})}function dg(b){const r=this.getTransformedByOperation(b),c=bi._createFromRanges(r),p=!c.isEqual(this),v=function(S,I){switch(I.type){case"insert":return S.containsPosition(I.position);case"move":case"remove":case"reinsert":case"merge":return S.containsPosition(I.sourcePosition)||S.start.isEqual(I.sourcePosition)||S.containsPosition(I.targetPosition);case"split":return S.containsPosition(I.splitPosition)||S.containsPosition(I.insertionPosition)}return!1}(this,b);let Z=null;if(p){"$graveyard"==c.root.rootName&&(Z="remove"==b.type?b.sourcePosition:b.deletionPosition);const S=this.toRange();this.start=c.start,this.end=c.end,this.fire("change:range",S,{deletionPosition:Z})}else v&&this.fire("change:content",this.toRange(),{deletionPosition:Z})}Si(i1,Fo);class xl{constructor(r){this._selection=new uc(r),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(r){return this._selection.containsEntireContent(r)}destroy(){this._selection.destroy()}getAttributeKeys(){return this._selection.getAttributeKeys()}getAttributes(){return this._selection.getAttributes()}getAttribute(r){return this._selection.getAttribute(r)}hasAttribute(r){return this._selection.hasAttribute(r)}refresh(){this._selection._updateMarkers(),this._selection._updateAttributes(!1)}is(r){return"selection"===r||"model:selection"==r||"documentSelection"==r||"model:documentSelection"==r}_setFocus(r,c){this._selection.setFocus(r,c)}_setTo(r,c,p){this._selection.setTo(r,c,p)}_setAttribute(r,c){this._selection.setAttribute(r,c)}_removeAttribute(r){this._selection.removeAttribute(r)}_getStoredAttributes(){return this._selection._getStoredAttributes()}_overrideGravity(){return this._selection.overrideGravity()}_restoreGravity(r){this._selection.restoreGravity(r)}static _getStoreAttributeKey(r){return"selection:"+r}static _isStoreAttributeKey(r){return r.startsWith("selection:")}}Si(xl,Fo);class uc extends md{constructor(r){super(),this.markers=new Ra({idProperty:"name"}),this._model=r.model,this._document=r,this._attributePriority=new Map,this._selectionRestorePosition=null,this._hasChangedRange=!1,this._overriddenGravityRegister=new Set,this.listenTo(this._model,"applyOperation",(c,p)=>{const v=p[0];v.isDocumentOperation&&"marker"!=v.type&&"rename"!=v.type&&"noop"!=v.type&&(0==this._ranges.length&&this._selectionRestorePosition&&this._fixGraveyardSelection(this._selectionRestorePosition),this._selectionRestorePosition=null,this._hasChangedRange&&(this._hasChangedRange=!1,this.fire("change:range",{directChange:!1})))},{priority:"lowest"}),this.on("change:range",()=>{for(const c of this.getRanges())if(!this._document._validateSelectionRange(c))throw new En.b("document-selection-wrong-position: Range from document selection starts or ends at incorrect position.",this,{range:c})}),this.listenTo(this._model.markers,"update",()=>this._updateMarkers()),this.listenTo(this._document,"change",(c,p)=>{!function(v,Z){const S=v.document.differ;for(const I of S.getChanges()){if("insert"!=I.type)continue;const V=I.position.parent;I.length===V.maxOffset&&v.enqueueChange(Z,it=>{const dt=Array.from(V.getAttributeKeys()).filter(xt=>xt.startsWith("selection:"));for(const xt of dt)it.removeAttribute(xt,V)})}}(this._model,p)})}get isCollapsed(){return 0===this._ranges.length?this._document._getDefaultRange().isCollapsed:super.isCollapsed}get anchor(){return super.anchor||this._document._getDefaultRange().start}get focus(){return super.focus||this._document._getDefaultRange().end}get rangeCount(){return this._ranges.length?this._ranges.length:1}get hasOwnRange(){return this._ranges.length>0}get isGravityOverridden(){return!!this._overriddenGravityRegister.size}destroy(){for(let r=0;r{if(this._hasChangedRange=!0,c.root==this._document.graveyard){this._selectionRestorePosition=Z.deletionPosition;const S=this._ranges.indexOf(c);this._ranges.splice(S,1),c.detach()}}),c}_updateMarkers(){const r=[];let c=!1;for(const v of this._model.markers){const Z=v.getRange();for(const S of this.getRanges())Z.containsRange(S,!S.isCollapsed)&&r.push(v)}const p=Array.from(this.markers);for(const v of r)this.markers.has(v)||(this.markers.add(v),c=!0);for(const v of Array.from(this.markers))r.includes(v)||(this.markers.remove(v),c=!0);c&&this.fire("change:marker",{oldMarkers:p,directChange:!1})}_updateAttributes(r){const c=aa(this._getSurroundingAttributes()),p=aa(this.getAttributes());if(r)this._attributePriority=new Map,this._attrs=new Map;else for(const[Z,S]of this._attributePriority)"low"==S&&(this._attrs.delete(Z),this._attributePriority.delete(Z));this._setAttributesTo(c);const v=[];for(const[Z,S]of this.getAttributes())p.has(Z)&&p.get(Z)===S||v.push(Z);for(const[Z]of p)this.hasAttribute(Z)||v.push(Z);v.length>0&&this.fire("change:attribute",{attributeKeys:v,directChange:!1})}_setAttribute(r,c,p=!0){const v=p?"normal":"low";return("low"!=v||"normal"!=this._attributePriority.get(r))&&super.getAttribute(r)!==c&&(this._attrs.set(r,c),this._attributePriority.set(r,v),!0)}_removeAttribute(r,c=!0){const p=c?"normal":"low";return!("low"==p&&"normal"==this._attributePriority.get(r)||(this._attributePriority.set(r,p),!super.hasAttribute(r)||(this._attrs.delete(r),0)))}_setAttributesTo(r){const c=new Set;for(const[p,v]of this.getAttributes())r.get(p)!==v&&this._removeAttribute(p,!1);for(const[p,v]of r)this._setAttribute(p,v,!1)&&c.add(p);return c}*_getStoredAttributes(){const r=this.getFirstPosition().parent;if(this.isCollapsed&&r.isEmpty)for(const c of r.getAttributeKeys())c.startsWith("selection:")&&(yield[c.substr(10),r.getAttribute(c)])}_getSurroundingAttributes(){const r=this.getFirstPosition(),c=this._model.schema;let p=null;if(this.isCollapsed){const v=r.textNode?r.textNode:r.nodeBefore,Z=r.textNode?r.textNode:r.nodeAfter;if(this.isGravityOverridden||(p=I1(v)),p||(p=I1(Z)),!this.isGravityOverridden&&!p){let S=v;for(;S&&!p;)S=S.previousSibling,p=I1(S)}if(!p){let S=Z;for(;S&&!p;)S=S.nextSibling,p=I1(S)}p||(p=this._getStoredAttributes())}else{const v=this.getFirstRange();for(const Z of v){if(Z.item.is("element")&&c.isObject(Z.item))break;if("text"==Z.type){p=Z.item.getAttributes();break}}}return p}_fixGraveyardSelection(r){const c=this._model.schema.getNearestSelectionRange(r);c&&this._pushRange(c)}}function I1(b){return b instanceof Zo||b instanceof Bi?b.getAttributes():null}class p_{constructor(r){this._dispatchers=r}add(r){for(const c of this._dispatchers)r(c);return this}}var Gr=function(b){return $c(b,5)};class Fr extends p_{elementToElement(r){return this.add(function(c){return(c=Gr(c)).view=a1(c.view,"container"),p=>{var v;p.on("insert:"+c.model,(v=c.view,(Z,S,I)=>{const V=v(S.item,I.writer);if(!V||!I.consumable.consume(S.item,"insert"))return;const it=I.mapper.toViewPosition(S.range.start);I.mapper.bindElements(S.item,V),I.writer.insert(it,V)}),{priority:c.converterPriority||"normal"})}}(r))}attributeToElement(r){return this.add(function(c){let p="attribute:"+((c=Gr(c)).model.key?c.model.key:c.model);if(c.model.name&&(p+=":"+c.model.name),c.model.values)for(const Z of c.model.values)c.view[Z]=a1(c.view[Z],"attribute");else c.view=a1(c.view,"attribute");const v=E2(c);return Z=>{var S;Z.on(p,(S=v,(I,V,it)=>{const dt=S(V.attributeOldValue,it.writer),xt=S(V.attributeNewValue,it.writer);if(!dt&&!xt||!it.consumable.consume(V.item,I.name))return;const le=it.writer;if(V.item instanceof md||V.item instanceof xl)le.wrap(le.document.selection.getFirstRange(),xt);else{let rn=it.mapper.toViewRange(V.range);null!==V.attributeOldValue&&dt&&(rn=le.unwrap(rn,dt)),null!==V.attributeNewValue&&xt&&le.wrap(rn,xt)}}),{priority:c.converterPriority||"normal"})}}(r))}attributeToAttribute(r){return this.add(function(c){let p="attribute:"+((c=Gr(c)).model.key?c.model.key:c.model);if(c.model.name&&(p+=":"+c.model.name),c.model.values)for(const Z of c.model.values)c.view[Z]=mm(c.view[Z]);else c.view=mm(c.view);const v=E2(c);return Z=>{var S;Z.on(p,(S=v,(I,V,it)=>{const dt=S(V.attributeOldValue,V),xt=S(V.attributeNewValue,V);if(!dt&&!xt||!it.consumable.consume(V.item,I.name))return;const le=it.mapper.toViewElement(V.item),Ie=it.writer;if(!le)throw new En.b("conversion-attribute-to-attribute-on-text: Trying to convert text node's attribute with attribute-to-attribute converter.",[V,it]);if(null!==V.attributeOldValue&&dt)if("class"==dt.key){const rn=Array.isArray(dt.value)?dt.value:[dt.value];for(const vn of rn)Ie.removeClass(vn,le)}else if("style"==dt.key){const rn=Object.keys(dt.value);for(const vn of rn)Ie.removeStyle(vn,le)}else Ie.removeAttribute(dt.key,le);if(null!==V.attributeNewValue&&xt)if("class"==xt.key){const rn=Array.isArray(xt.value)?xt.value:[xt.value];for(const vn of rn)Ie.addClass(vn,le)}else if("style"==xt.key){const rn=Object.keys(xt.value);for(const vn of rn)Ie.setStyle(vn,xt.value[vn],le)}else Ie.setAttribute(xt.key,xt.value,le)}),{priority:c.converterPriority||"normal"})}}(r))}markerToElement(r){return this.add(function(c){return(c=Gr(c)).view=a1(c.view,"ui"),p=>{var v;p.on("addMarker:"+c.model,(v=c.view,(Z,S,I)=>{S.isOpening=!0;const V=v(S,I.writer);S.isOpening=!1;const it=v(S,I.writer);if(!V||!it)return;const dt=S.markerRange;if(dt.isCollapsed&&!I.consumable.consume(dt,Z.name))return;for(const Ie of dt)if(!I.consumable.consume(Ie.item,Z.name))return;const xt=I.mapper,le=I.writer;le.insert(xt.toViewPosition(dt.start),V),I.mapper.bindElementToMarker(V,S.markerName),dt.isCollapsed||(le.insert(xt.toViewPosition(dt.end),it),I.mapper.bindElementToMarker(it,S.markerName)),Z.stop()}),{priority:c.converterPriority||"normal"}),p.on("removeMarker:"+c.model,(Z,S,I)=>{const V=I.mapper.markerNameToElements(S.markerName);if(V){for(const it of V)I.mapper.unbindElementFromMarkerName(it,S.markerName),I.writer.clear(I.writer.createRangeOn(it),it);I.writer.clearClonedElementsGroup(S.markerName),Z.stop()}},{priority:c.converterPriority||"normal"})}}(r))}markerToHighlight(r){return this.add(function(c){return p=>{var v,Z;p.on("addMarker:"+c.model,(v=c.view,(Z,S,I)=>{if(!S.item||!(S.item instanceof md||S.item instanceof xl||S.item.is("$textProxy")))return;const V=__(v,S,I);if(!V||!I.consumable.consume(S.item,Z.name))return;const it=I.writer,dt=o1(it,V),xt=it.document.selection;if(S.item instanceof md||S.item instanceof xl)it.wrap(xt.getFirstRange(),dt,xt);else{const le=I.mapper.toViewRange(S.range),Ie=it.wrap(le,dt);for(const rn of Ie.getItems())if(rn.is("attributeElement")&&rn.isSimilar(dt)){I.mapper.bindElementToMarker(rn,S.markerName);break}}}),{priority:c.converterPriority||"normal"}),p.on("addMarker:"+c.model,(Z=c.view,(S,I,V)=>{if(!(I.item&&I.item instanceof Wo))return;const it=__(Z,I,V);if(!it||!V.consumable.test(I.item,S.name))return;const dt=V.mapper.toViewElement(I.item);if(dt&&dt.getCustomProperty("addHighlight")){V.consumable.consume(I.item,S.name);for(const xt of bi._createIn(I.item))V.consumable.consume(xt.item,S.name);dt.getCustomProperty("addHighlight")(dt,it,V.writer),V.mapper.bindElementToMarker(dt,I.markerName)}}),{priority:c.converterPriority||"normal"}),p.on("removeMarker:"+c.model,function(Z){return(S,I,V)=>{if(I.markerRange.isCollapsed)return;const it=__(Z,I,V);if(!it)return;const dt=o1(V.writer,it),xt=V.mapper.markerNameToElements(I.markerName);if(xt){for(const le of xt)V.mapper.unbindElementFromMarkerName(le,I.markerName),le.is("attributeElement")?V.writer.unwrap(V.writer.createRangeOn(le),dt):le.getCustomProperty("removeHighlight")(le,it.id,V.writer);V.writer.clearClonedElementsGroup(I.markerName),S.stop()}}}(c.view),{priority:c.converterPriority||"normal"})}}(r))}markerToData(r){return this.add(function(c){const p=(c=Gr(c)).model;return c.view||(c.view=v=>({group:p,name:v.substr(c.model.length+1)})),v=>{var Z,S;v.on("addMarker:"+p,(Z=c.view,(S,I,V)=>{const it=Z(I.markerName);if(!it)return;const dt=I.markerRange;V.consumable.consume(dt,S.name)&&(m_(dt,!1,V,I,it),m_(dt,!0,V,I,it),S.stop())}),{priority:c.converterPriority||"normal"}),v.on("removeMarker:"+p,(S=c.view,(I,V,it)=>{const dt=S(V.markerName);if(!dt)return;const xt=it.mapper.markerNameToElements(V.markerName);if(xt){for(const Ie of xt)it.mapper.unbindElementFromMarkerName(Ie,V.markerName),Ie.is("containerElement")?(le(`data-${dt.group}-start-before`,Ie),le(`data-${dt.group}-start-after`,Ie),le(`data-${dt.group}-end-before`,Ie),le(`data-${dt.group}-end-after`,Ie)):it.writer.clear(it.writer.createRangeOn(Ie),Ie);it.writer.clearClonedElementsGroup(V.markerName),I.stop()}function le(Ie,rn){if(rn.hasAttribute(Ie)){const vn=new Set(rn.getAttribute(Ie).split(","));vn.delete(dt.name),0==vn.size?it.writer.removeAttribute(Ie,rn):it.writer.setAttribute(Ie,Array.from(vn).join(","),rn)}}}),{priority:c.converterPriority||"normal"})}}(r))}}function o1(b,r){const c=b.createAttributeElement("span",r.attributes);return r.classes&&c._addClass(r.classes),r.priority&&(c._priority=r.priority),c._id=r.id,c}function m_(b,r,c,p,v){const Z=r?b.start:b.end;if(c.schema.checkChild(Z,"$text"))!function(S,I,V,it,dt){const Ie=V.writer.createUIElement(`${dt.group}-${I?"start":"end"}`,dt.name?{name:dt.name}:null);V.writer.insert(S,Ie),V.mapper.bindElementToMarker(Ie,it.markerName)}(c.mapper.toViewPosition(Z),r,c,p,v);else{let S,I;r&&Z.nodeAfter||!r&&!Z.nodeBefore?(S=Z.nodeAfter,I=!0):(S=Z.nodeBefore,I=!1),function(V,it,dt,xt,le,Ie){const rn=`data-${Ie.group}-${it?"start":"end"}-${dt?"before":"after"}`,vn=V.hasAttribute(rn)?V.getAttribute(rn).split(","):[];vn.unshift(Ie.name),xt.writer.setAttribute(rn,vn.join(","),V),xt.mapper.bindElementToMarker(V,le.markerName)}(c.mapper.toViewElement(S),r,I,c,p,v)}}function a1(b,r){return"function"==typeof b?b:(c,p)=>function(v,Z,S){let I;"string"==typeof v&&(v={name:v});const V=Object.assign({},v.attributes);if(I="container"==S?Z.createContainerElement(v.name,V):"attribute"==S?Z.createAttributeElement(v.name,V,{priority:v.priority||Mr.DEFAULT_PRIORITY}):Z.createUIElement(v.name,V),v.styles){const it=Object.keys(v.styles);for(const dt of it)Z.setStyle(dt,v.styles[dt],I)}if(v.classes){const it=v.classes;if("string"==typeof it)Z.addClass(it,I);else for(const dt of it)Z.addClass(dt,I)}return I}(b,p,r)}function E2(b){return b.model.values?(r,c)=>{const p=b.view[r];return p?p(r,c):null}:b.view}function mm(b){return"string"==typeof b?r=>({key:b,value:r}):"object"==typeof b?b.value?()=>b:r=>({key:b.key,value:r}):b}function __(b,r,c){const p="function"==typeof b?b(r,c):b;return p?(p.priority||(p.priority=10),p.id||(p.id=r.markerName),p):null}class f_ extends p_{elementToElement(r){return this.add(h_(r))}elementToAttribute(r){return this.add(function(c){Ed(c=Gr(c));const p=Mp(c,!1),v=Ru(c.view),Z=v?"element:"+v:"element";return S=>{S.on(Z,p,{priority:c.converterPriority||"low"})}}(r))}attributeToAttribute(r){return this.add(function(c){let p=null;("string"==typeof(c=Gr(c)).view||c.view.key)&&(p=function(Z){"string"==typeof Z.view&&(Z.view={key:Z.view});const S=Z.view.key;let I;return I="class"==S||"style"==S?{["class"==S?"classes":"styles"]:Z.view.value}:{attributes:{[S]:void 0===Z.view.value?/[\s\S]*/:Z.view.value}},Z.view.name&&(I.name=Z.view.name),Z.view=I,S}(c)),Ed(c,p);const v=Mp(c,!0);return Z=>{Z.on("element",v,{priority:c.converterPriority||"low"})}}(r))}elementToMarker(r){return console.warn(Object(En.a)("upcast-helpers-element-to-marker-deprecated: The UpcastHelpers#elementToMarker() method has been deprecated and will be removed in the near future. Please use UpcastHelpers#dataToMarker() instead.")),this.add(function(c){return function(p){const v=p.model;p.model=(Z,S)=>{const I="string"==typeof v?v:v(Z);return S.createElement("$marker",{"data-name":I})}}(c=Gr(c)),h_(c)}(r))}dataToMarker(r){return this.add(function(c){(c=Gr(c)).model||(c.model=Z=>Z?c.view+":"+Z:c.view);const p=g_(_m(c,"start")),v=g_(_m(c,"end"));return Z=>{Z.on("element:"+c.view+"-start",p,{priority:c.converterPriority||"normal"}),Z.on("element:"+c.view+"-end",v,{priority:c.converterPriority||"normal"});const S=ar.get("low"),I=ar.get("highest"),V=ar.get(c.converterPriority)/I;var it;Z.on("element",(it=c,(dt,xt,le)=>{const Ie="data-"+it.view;function rn(vn,wn){for(const qn of wn){const mi=it.model(qn),xi=le.writer.createElement("$marker",{"data-name":mi});le.writer.insert(xi,vn),xt.modelCursor=xt.modelCursor.isEqual(vn)?xt.modelCursor.getShiftedBy(1):xt.modelCursor._getTransformedByInsertion(vn,1),xt.modelRange=xt.modelRange._getTransformedByInsertion(vn,1)[0]}}xt.modelRange||(xt=Object.assign(xt,le.convertChildren(xt.viewItem,xt.modelCursor))),le.consumable.consume(xt.viewItem,{attributes:Ie+"-end-after"})&&rn(xt.modelRange.end,xt.viewItem.getAttribute(Ie+"-end-after").split(",")),le.consumable.consume(xt.viewItem,{attributes:Ie+"-start-after"})&&rn(xt.modelRange.end,xt.viewItem.getAttribute(Ie+"-start-after").split(",")),le.consumable.consume(xt.viewItem,{attributes:Ie+"-end-before"})&&rn(xt.modelRange.start,xt.viewItem.getAttribute(Ie+"-end-before").split(",")),le.consumable.consume(xt.viewItem,{attributes:Ie+"-start-before"})&&rn(xt.modelRange.start,xt.viewItem.getAttribute(Ie+"-start-before").split(","))}),{priority:S+V})}}(r))}}function h_(b){const r=g_(b=Gr(b)),c=Ru(b.view),p=c?"element:"+c:"element";return v=>{v.on(p,r,{priority:b.converterPriority||"normal"})}}function Ru(b){return"string"==typeof b?b:"object"==typeof b&&"string"==typeof b.name?b.name:null}function g_(b){const r=b.view?new Xt(b.view):null;return(c,p,v)=>{let Z={};if(r){const le=r.match(p.viewItem);if(!le)return;Z=le.match}Z.name=!0;const S=(it=v.writer,(I=b.model)instanceof Function?I(p.viewItem,it):it.createElement(I));var I,it;if(!S||!v.consumable.test(p.viewItem,Z))return;const dt=v.splitToAllowedParent(S,p.modelCursor);if(!dt)return;v.writer.insert(S,dt.position),v.convertChildren(p.viewItem,v.writer.createPositionAt(S,0)),v.consumable.consume(p.viewItem,Z);const xt=v.getSplitParts(S);p.modelRange=new bi(v.writer.createPositionBefore(S),v.writer.createPositionAfter(xt[xt.length-1])),p.modelCursor=dt.cursorParent?v.writer.createPositionAt(dt.cursorParent,0):p.modelRange.end}}function Ed(b,r=null){b.model={key:"object"!=typeof b.model?b.model:b.model.key,value:"object"!=typeof b.model||void 0===b.model.value?null===r||(Z=>Z.getAttribute(r)):b.model.value}}function Mp(b,r){const c=new Xt(b.view);return(p,v,Z)=>{const S=c.match(v.viewItem);if(!S)return;const I=b.model.key,V="function"==typeof b.model.value?b.model.value(v.viewItem):b.model.value;null!==V&&(function(it,dt){const xt="function"==typeof it?it(dt):it;return!("object"==typeof xt&&!Ru(xt)||xt.classes||xt.attributes||xt.styles)}(b.view,v.viewItem)?S.match.name=!0:delete S.match.name,Z.consumable.test(v.viewItem,S.match)&&(v.modelRange||(v=Object.assign(v,Z.convertChildren(v.viewItem,v.modelCursor))),function(it,dt,xt,le){let Ie=!1;for(const rn of Array.from(it.getItems({shallow:xt})))le.schema.checkAttribute(rn,dt.key)&&(le.writer.setAttribute(dt.key,dt.value,rn),Ie=!0);return Ie}(v.modelRange,{key:I,value:V},r,Z)&&Z.consumable.consume(v.viewItem,S.match)))}}function _m(b,r){const c={};return c.view=b.view+"-"+r,c.model=(p,v)=>{const Z=p.getAttribute("name"),S=b.model(Z);return v.createElement("$marker",{"data-name":S})},c}class v_{constructor(r,c){this.model=r,this.view=new In(c),this.mapper=new dm,this.downcastDispatcher=new pm({mapper:this.mapper,schema:r.schema});const p=this.model.document,v=p.selection,Z=this.model.markers;var S,I;this.listenTo(this.model,"_beforeChanges",()=>{this.view._disableRendering(!0)},{priority:"highest"}),this.listenTo(this.model,"_afterChanges",()=>{this.view._disableRendering(!1)},{priority:"lowest"}),this.listenTo(p,"change",()=>{this.view.change(S=>{this.downcastDispatcher.convertChanges(p.differ,Z,S),this.downcastDispatcher.convertSelection(v,Z,S)})},{priority:"low"}),this.listenTo(this.view.document,"selectionChange",(S=this.model,I=this.mapper,(V,it)=>{const dt=it.newSelection,xt=new md,le=[];for(const Ie of dt.getRanges())le.push(I.toModelRange(Ie));xt.setTo(le,{backward:dt.isBackward}),xt.isEqual(S.document.selection)||S.change(Ie=>{Ie.setSelection(xt)})})),this.downcastDispatcher.on("insert:$text",(S,I,V)=>{if(!V.consumable.consume(I.item,"insert"))return;const it=V.writer,dt=V.mapper.toViewPosition(I.range.start),xt=it.createText(I.item.data);it.insert(dt,xt)},{priority:"lowest"}),this.downcastDispatcher.on("remove",(S,I,V)=>{const it=V.mapper.toViewPosition(I.position),dt=I.position.getShiftedBy(I.length),xt=V.mapper.toViewPosition(dt,{isPhantom:!0}),le=V.writer.createRange(it,xt),Ie=V.writer.remove(le.getTrimmed());for(const rn of V.writer.createRangeIn(Ie).getItems())V.mapper.unbindViewElement(rn)},{priority:"low"}),this.downcastDispatcher.on("selection",(S,I,V)=>{const it=V.writer,dt=it.document.selection;for(const xt of dt.getRanges())xt.isCollapsed&&xt.end.parent.isAttached()&&V.writer.mergeAttributes(xt.start);it.setSelection(null)},{priority:"low"}),this.downcastDispatcher.on("selection",(S,I,V)=>{const it=I.selection;if(it.isCollapsed||!V.consumable.consume(it,"selection"))return;const dt=[];for(const xt of it.getRanges()){const le=V.mapper.toViewRange(xt);dt.push(le)}V.writer.setSelection(dt,{backward:it.isBackward})},{priority:"low"}),this.downcastDispatcher.on("selection",(S,I,V)=>{const it=I.selection;if(!it.isCollapsed||!V.consumable.consume(it,"selection"))return;const dt=V.writer,xt=it.getFirstPosition(),le=V.mapper.toViewPosition(xt),Ie=dt.breakAttributes(le);dt.setSelection(Ie)},{priority:"low"}),this.view.document.roots.bindTo(this.model.document.roots).using(S=>{if("$graveyard"==S.rootName)return null;const I=new ii(this.view.document,S.name);return I.rootName=S.rootName,this.mapper.bindElements(S,I),I})}destroy(){this.view.destroy(),this.stopListening()}}Si(v_,Ut);class b_{constructor(){this._commands=new Map}add(r,c){this._commands.set(r,c)}get(r){return this._commands.get(r)}execute(r,...c){const p=this.get(r);if(!p)throw new En.b("commandcollection-command-not-found: Command does not exist.",this,{commandName:r});return p.execute(...c)}*names(){yield*this._commands.keys()}*commands(){yield*this._commands.values()}[Symbol.iterator](){return this._commands[Symbol.iterator]()}destroy(){for(const r of this.commands())r.destroy()}}class R1{constructor(){this._consumables=new Map}add(r,c){let p;r.is("$text")||r.is("documentFragment")?this._consumables.set(r,!0):(this._consumables.has(r)?p=this._consumables.get(r):(p=new r1(r),this._consumables.set(r,p)),p.add(c))}test(r,c){const p=this._consumables.get(r);return void 0===p?null:r.is("$text")||r.is("documentFragment")?p:p.test(c)}consume(r,c){return!!this.test(r,c)&&(r.is("$text")||r.is("documentFragment")?this._consumables.set(r,!1):this._consumables.get(r).consume(c),!0)}revert(r,c){const p=this._consumables.get(r);void 0!==p&&(r.is("$text")||r.is("documentFragment")?this._consumables.set(r,!0):p.revert(c))}static consumablesFromElement(r){const c={element:r,name:!0,attributes:[],classes:[],styles:[]},p=r.getAttributeKeys();for(const S of p)"style"!=S&&"class"!=S&&c.attributes.push(S);const v=r.getClassNames();for(const S of v)c.classes.push(S);const Z=r.getStyleNames();for(const S of Z)c.styles.push(S);return c}static createFrom(r,c){if(c||(c=new R1(r)),r.is("$text"))return c.add(r),c;r.is("element")&&c.add(r,R1.consumablesFromElement(r)),r.is("documentFragment")&&c.add(r);for(const p of r.getChildren())c=R1.createFrom(p,c);return c}}class r1{constructor(r){this.element=r,this._canConsumeName=null,this._consumables={attributes:new Map,styles:new Map,classes:new Map}}add(r){r.name&&(this._canConsumeName=!0);for(const c in this._consumables)c in r&&this._add(c,r[c])}test(r){if(r.name&&!this._canConsumeName)return this._canConsumeName;for(const c in this._consumables)if(c in r){const p=this._test(c,r[c]);if(!0!==p)return p}return!0}consume(r){r.name&&(this._canConsumeName=!1);for(const c in this._consumables)c in r&&this._consume(c,r[c])}revert(r){r.name&&(this._canConsumeName=!0);for(const c in this._consumables)c in r&&this._revert(c,r[c])}_add(r,c){const p=yn(c)?c:[c],v=this._consumables[r];for(const Z of p){if("attributes"===r&&("class"===Z||"style"===Z))throw new En.b("viewconsumable-invalid-attribute: Classes and styles should be handled separately.",this);if(v.set(Z,!0),"styles"===r)for(const S of this.element.document.stylesProcessor.getRelatedStyles(Z))v.set(S,!0)}}_test(r,c){const p=yn(c)?c:[c],v=this._consumables[r];for(const Z of p)if("attributes"!==r||"class"!==Z&&"style"!==Z){const S=v.get(Z);if(void 0===S)return null;if(!S)return!1}else{const S="class"==Z?"classes":"styles",I=this._test(S,[...this._consumables[S].keys()]);if(!0!==I)return I}return!0}_consume(r,c){const p=yn(c)?c:[c],v=this._consumables[r];for(const Z of p)if("attributes"!==r||"class"!==Z&&"style"!==Z){if(v.set(Z,!1),"styles"==r)for(const S of this.element.document.stylesProcessor.getRelatedStyles(Z))v.set(S,!1)}else{const S="class"==Z?"classes":"styles";this._consume(S,[...this._consumables[S].keys()])}}_revert(r,c){const p=yn(c)?c:[c],v=this._consumables[r];for(const Z of p)if("attributes"!==r||"class"!==Z&&"style"!==Z)!1===v.get(Z)&&v.set(Z,!0);else{const S="class"==Z?"classes":"styles";this._revert(S,[...this._consumables[S].keys()])}}}class fm{constructor(){this._sourceDefinitions={},this._attributeProperties={},this.decorate("checkChild"),this.decorate("checkAttribute"),this.on("checkAttribute",(r,c)=>{c[0]=new Nd(c[0])},{priority:"highest"}),this.on("checkChild",(r,c)=>{c[0]=new Nd(c[0]),c[1]=this.getDefinition(c[1])},{priority:"highest"})}register(r,c){if(this._sourceDefinitions[r])throw new En.b("schema-cannot-register-item-twice: A single item cannot be registered twice in the schema.",this,{itemName:r});this._sourceDefinitions[r]=[Object.assign({},c)],this._clearCache()}extend(r,c){if(!this._sourceDefinitions[r])throw new En.b("schema-cannot-extend-missing-item: Cannot extend an item which was not registered yet.",this,{itemName:r});this._sourceDefinitions[r].push(Object.assign({},c)),this._clearCache()}getDefinitions(){return this._compiledDefinitions||this._compile(),this._compiledDefinitions}getDefinition(r){let c;return c="string"==typeof r?r:r.is&&(r.is("$text")||r.is("$textProxy"))?"$text":r.name,this.getDefinitions()[c]}isRegistered(r){return!!this.getDefinition(r)}isBlock(r){const c=this.getDefinition(r);return!(!c||!c.isBlock)}isLimit(r){const c=this.getDefinition(r);return!(!c||!c.isLimit&&!c.isObject)}isObject(r){const c=this.getDefinition(r);return!(!c||!c.isObject)}isInline(r){const c=this.getDefinition(r);return!(!c||!c.isInline)}checkChild(r,c){return!!c&&this._checkContextMatch(c,r)}checkAttribute(r,c){const p=this.getDefinition(r.last);return!!p&&p.allowAttributes.includes(c)}checkMerge(r,c=null){if(r instanceof Ei){const p=r.nodeBefore,v=r.nodeAfter;if(!(p instanceof Wo))throw new En.b("schema-check-merge-no-element-before: The node before the merge position must be an element.",this);if(!(v instanceof Wo))throw new En.b("schema-check-merge-no-element-after: The node after the merge position must be an element.",this);return this.checkMerge(p,v)}for(const p of c.getChildren())if(!this.checkChild(r,p))return!1;return!0}addChildCheck(r){this.on("checkChild",(c,[p,v])=>{if(!v)return;const Z=r(p,v);"boolean"==typeof Z&&(c.stop(),c.return=Z)},{priority:"high"})}addAttributeCheck(r){this.on("checkAttribute",(c,[p,v])=>{const Z=r(p,v);"boolean"==typeof Z&&(c.stop(),c.return=Z)},{priority:"high"})}setAttributeProperties(r,c){this._attributeProperties[r]=Object.assign(this.getAttributeProperties(r),c)}getAttributeProperties(r){return this._attributeProperties[r]||{}}getLimitElement(r){let c;for(c=r instanceof Ei?r.parent:(r instanceof bi?[r]:Array.from(r.getRanges())).reduce((p,v)=>{const Z=v.getCommonAncestor();return p?p.getCommonAncestor(Z,{includeSelf:!0}):Z},null);!this.isLimit(c)&&c.parent;)c=c.parent;return c}checkAttributeInSelection(r,c){if(r.isCollapsed){const p=[...r.getFirstPosition().getAncestors(),new Bi("",r.getAttributes())];return this.checkAttribute(p,c)}{const p=r.getRanges();for(const v of p)for(const Z of v)if(this.checkAttribute(Z.item,c))return!0}return!1}*getValidRanges(r,c){r=function*(p){for(const v of p)yield*v.getMinimalFlatRanges()}(r);for(const p of r)yield*this._getValidRangesForRange(p,c)}getNearestSelectionRange(r,c="both"){if(this.checkChild(r,"$text"))return new bi(r);let p,v;const Z=r.getAncestors().reverse().find(S=>this.isLimit(S))||r.root;"both"!=c&&"backward"!=c||(p=new js({boundaries:bi._createIn(Z),startPosition:r,direction:"backward"})),"both"!=c&&"forward"!=c||(v=new js({boundaries:bi._createIn(Z),startPosition:r}));for(const S of function*(I,V){let it=!1;for(;!it;){if(it=!0,I){const dt=I.next();dt.done||(it=!1,yield{walker:I,value:dt.value})}if(V){const dt=V.next();dt.done||(it=!1,yield{walker:V,value:dt.value})}}}(p,v)){const V=S.value;if(V.type==(S.walker==p?"elementEnd":"elementStart")&&this.isObject(V.item))return bi._createOn(V.item);if(this.checkChild(V.nextPosition,"$text"))return new bi(V.nextPosition)}return null}findAllowedParent(r,c){let p=r.parent;for(;p;){if(this.checkChild(p,c))return p;if(this.isLimit(p))return null;p=p.parent}return null}removeDisallowedAttributes(r,c){for(const p of r)if(p.is("$text"))Qt(this,p,c);else{const v=bi._createIn(p).getPositions();for(const Z of v)Qt(this,Z.nodeBefore||Z.parent,c)}}createContext(r){return new Nd(r)}_clearCache(){this._compiledDefinitions=null}_compile(){const r={},c=this._sourceDefinitions,p=Object.keys(c);for(const v of p)r[v]=N2(c[v],v);for(const v of p)C_(r,v);for(const v of p)F2(r,v);for(const v of p)$a(r,v),il(r,v);for(const v of p)I2(r,v),eh(r,v);this._compiledDefinitions=r}_checkContextMatch(r,c,p=c.length-1){const v=c.getItem(p);if(r.allowIn.includes(v.name)){if(0==p)return!0;{const Z=this.getDefinition(v);return this._checkContextMatch(Z,c,p-1)}}return!1}*_getValidRangesForRange(r,c){let p=r.start,v=r.start;for(const Z of r.getItems({shallow:!0}))Z.is("element")&&(yield*this._getValidRangesForRange(bi._createIn(Z),c)),this.checkAttribute(Z,c)||(p.isEqual(v)||(yield new bi(p,v)),p=Ei._createAfter(Z)),v=Ei._createAfter(Z);p.isEqual(v)||(yield new bi(p,v))}}Si(fm,Ut);class Nd{constructor(r){if(r instanceof Nd)return r;"string"==typeof r?r=[r]:Array.isArray(r)||(r=r.getAncestors({includeSelf:!0})),r[0]&&"string"!=typeof r[0]&&r[0].is("documentFragment")&&r.shift(),this._items=r.map(Us)}get length(){return this._items.length}get last(){return this._items[this._items.length-1]}[Symbol.iterator](){return this._items[Symbol.iterator]()}push(r){const c=new Nd([r]);return c._items=[...this._items,...c._items],c}getItem(r){return this._items[r]}*getNames(){yield*this._items.map(r=>r.name)}endsWith(r){return Array.from(this.getNames()).join(" ").endsWith(r)}startsWith(r){return Array.from(this.getNames()).join(" ").startsWith(r)}}function N2(b,r){const c={name:r,allowIn:[],allowContentOf:[],allowWhere:[],allowAttributes:[],allowAttributesOf:[],inheritTypesFrom:[]};return function(p,v){for(const Z of p){const S=Object.keys(Z).filter(I=>I.startsWith("is"));for(const I of S)v[I]=Z[I]}}(b,c),Fd(b,c,"allowIn"),Fd(b,c,"allowContentOf"),Fd(b,c,"allowWhere"),Fd(b,c,"allowAttributes"),Fd(b,c,"allowAttributesOf"),Fd(b,c,"inheritTypesFrom"),function(p,v){for(const Z of p){const S=Z.inheritAllFrom;S&&(v.allowContentOf.push(S),v.allowWhere.push(S),v.allowAttributesOf.push(S),v.inheritTypesFrom.push(S))}}(b,c),c}function C_(b,r){for(const c of b[r].allowContentOf)b[c]&&uu(b,c).forEach(p=>{p.allowIn.push(r)});delete b[r].allowContentOf}function F2(b,r){for(const c of b[r].allowWhere){const p=b[c];p&&b[r].allowIn.push(...p.allowIn)}delete b[r].allowWhere}function $a(b,r){for(const c of b[r].allowAttributesOf){const p=b[c];p&&b[r].allowAttributes.push(...p.allowAttributes)}delete b[r].allowAttributesOf}function il(b,r){const c=b[r];for(const p of c.inheritTypesFrom){const v=b[p];if(v){const Z=Object.keys(v).filter(S=>S.startsWith("is"));for(const S of Z)S in c||(c[S]=v[S])}}delete c.inheritTypesFrom}function I2(b,r){const c=b[r],p=c.allowIn.filter(v=>b[v]);c.allowIn=Array.from(new Set(p))}function eh(b,r){const c=b[r];c.allowAttributes=Array.from(new Set(c.allowAttributes))}function Fd(b,r,c){for(const p of b)"string"==typeof p[c]?r[c].push(p[c]):Array.isArray(p[c])&&r[c].push(...p[c])}function uu(b,r){const c=b[r];return(p=b,Object.keys(p).map(v=>p[v])).filter(v=>v.allowIn.includes(c.name));var p}function Us(b){return"string"==typeof b?{name:b,*getAttributeKeys(){},getAttribute(){}}:{name:b.is("element")?b.name:"$text",*getAttributeKeys(){yield*b.getAttributeKeys()},getAttribute:r=>b.getAttribute(r)}}function Qt(b,r,c){for(const p of r.getAttributeKeys())b.checkAttribute(r,p)||c.removeAttribute(p,r)}class nh{constructor(r={}){this._splitParts=new Map,this._modelCursor=null,this.conversionApi=Object.assign({},r),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(r,c,p=["$root"]){this.fire("viewCleanup",r),this._modelCursor=function(S,I){let V;for(const it of new Nd(S)){const dt={};for(const le of it.getAttributeKeys())dt[le]=it.getAttribute(le);const xt=I.createElement(it.name,dt);V&&I.append(xt,V),V=Ei._createAt(xt,0)}return V}(p,c),this.conversionApi.writer=c,this.conversionApi.consumable=R1.createFrom(r),this.conversionApi.store={};const{modelRange:v}=this._convertItem(r,this._modelCursor),Z=c.createDocumentFragment();if(v){this._removeEmptyElements();for(const S of Array.from(this._modelCursor.parent.getChildren()))c.append(S,Z);Z.markers=function(S,I){const V=new Set,it=new Map,dt=bi._createIn(S).getItems();for(const xt of dt)"$marker"==xt.name&&V.add(xt);for(const xt of V){const le=xt.getAttribute("data-name"),Ie=I.createPositionBefore(xt);it.has(le)?it.get(le).end=Ie.clone():it.set(le,new bi(Ie.clone())),I.remove(xt)}return it}(Z,c)}return this._modelCursor=null,this._splitParts.clear(),this.conversionApi.writer=null,this.conversionApi.store=null,Z}_convertItem(r,c){const p=Object.assign({viewItem:r,modelCursor:c,modelRange:null});if(r.is("element")?this.fire("element:"+r.name,p,this.conversionApi):r.is("$text")?this.fire("text",p,this.conversionApi):this.fire("documentFragment",p,this.conversionApi),p.modelRange&&!(p.modelRange instanceof bi))throw new En.b("view-conversion-dispatcher-incorrect-result: Incorrect conversion result was dropped.",this);return{modelRange:p.modelRange,modelCursor:p.modelCursor}}_convertChildren(r,c){const p=new bi(c);let v=c;for(const Z of Array.from(r.getChildren())){const S=this._convertItem(Z,v);S.modelRange instanceof bi&&(p.end=S.modelRange.end,v=S.modelCursor)}return{modelRange:p,modelCursor:v}}_splitToAllowedParent(r,c){const p=this.conversionApi.schema.findAllowedParent(c,r);if(!p)return null;if(p===c.parent)return{position:c};if(this._modelCursor.parent.getAncestors().includes(p))return null;const v=this.conversionApi.writer.split(c,p),Z=[];for(const S of v.range.getWalker())if("elementEnd"==S.type)Z.push(S.item);else{const I=Z.pop();this._registerSplitPair(I,S.item)}return{position:v.position,cursorParent:v.range.end.parent}}_registerSplitPair(r,c){this._splitParts.has(r)||this._splitParts.set(r,[r]);const p=this._splitParts.get(r);this._splitParts.set(c,p),p.push(c)}_getSplitParts(r){let c;return c=this._splitParts.has(r)?this._splitParts.get(r):[r],c}_removeEmptyElements(){let r=!1;for(const c of this._splitParts.keys())c.isEmpty&&(this.conversionApi.writer.remove(c),this._splitParts.delete(c),r=!0);r&&this._removeEmptyElements()}}Si(nh,Fo);class x_{constructor(r,c){this.model=r,this.stylesProcessor=c,this.mapper=new dm,this.downcastDispatcher=new pm({mapper:this.mapper,schema:r.schema}),this.downcastDispatcher.on("insert:$text",(p,v,Z)=>{if(!Z.consumable.consume(v.item,"insert"))return;const S=Z.writer,I=Z.mapper.toViewPosition(v.range.start),V=S.createText(v.item.data);S.insert(I,V)},{priority:"lowest"}),this.upcastDispatcher=new nh({schema:r.schema}),this.viewDocument=new br(c),this._viewWriter=new tl(this.viewDocument),this.upcastDispatcher.on("text",(p,v,Z)=>{if(Z.schema.checkChild(v.modelCursor,"$text")&&Z.consumable.consume(v.viewItem)){const S=Z.writer.createText(v.viewItem.data);Z.writer.insert(S,v.modelCursor),v.modelRange=bi._createFromPositionAndShift(v.modelCursor,S.offsetSize),v.modelCursor=v.modelRange.end}},{priority:"lowest"}),this.upcastDispatcher.on("element",(p,v,Z)=>{if(!v.modelRange&&Z.consumable.consume(v.viewItem,{name:!0})){const{modelRange:S,modelCursor:I}=Z.convertChildren(v.viewItem,v.modelCursor);v.modelRange=S,v.modelCursor=I}},{priority:"lowest"}),this.upcastDispatcher.on("documentFragment",(p,v,Z)=>{if(!v.modelRange&&Z.consumable.consume(v.viewItem,{name:!0})){const{modelRange:S,modelCursor:I}=Z.convertChildren(v.viewItem,v.modelCursor);v.modelRange=S,v.modelCursor=I}},{priority:"lowest"}),this.decorate("init"),this.decorate("set"),this.on("init",()=>{this.fire("ready")},{priority:"lowest"})}get(r){const{rootName:c="main",trim:p="empty"}=r||{};if(!this._checkIfRootsExists([c]))throw new En.b("datacontroller-get-non-existent-root: Attempting to get data from a non-existing root.",this);const v=this.model.document.getRoot(c);return"empty"!==p||this.model.hasContent(v,{ignoreWhitespaces:!0})?this.stringify(v):""}stringify(r){const c=this.toView(r);return this.processor.toData(c)}toView(r){const c=this.viewDocument,p=this._viewWriter;this.mapper.clearBindings();const v=bi._createIn(r),Z=new Ic(c);if(this.mapper.bindElements(r,Z),this.downcastDispatcher.convertInsert(v,p),!r.is("documentFragment")){const S=function(I){const V=[],it=I.root.document;if(!it)return[];const dt=bi._createIn(I);for(const xt of it.model.markers){const le=dt.getIntersection(xt.getRange());le&&V.push([xt.name,le])}return V}(r);for(const[I,V]of S)this.downcastDispatcher.convertMarkerAdd(I,V,p)}return Z}init(r){if(this.model.document.version)throw new En.b("datacontroller-init-document-not-empty: Trying to set initial data to not empty document.",this);let c={};if("string"==typeof r?c.main=r:c=r,!this._checkIfRootsExists(Object.keys(c)))throw new En.b("datacontroller-init-non-existent-root: Attempting to init data on a non-existing root.",this);return this.model.enqueueChange("transparent",p=>{for(const v of Object.keys(c)){const Z=this.model.document.getRoot(v);p.insert(this.parse(c[v],Z),Z,0)}}),Promise.resolve()}set(r){let c={};if("string"==typeof r?c.main=r:c=r,!this._checkIfRootsExists(Object.keys(c)))throw new En.b("datacontroller-set-non-existent-root: Attempting to set data on a non-existing root.",this);this.model.enqueueChange("transparent",p=>{p.setSelection(null),p.removeSelectionAttribute(this.model.document.selection.getAttributeKeys());for(const v of Object.keys(c)){const Z=this.model.document.getRoot(v);p.remove(p.createRangeIn(Z)),p.insert(this.parse(c[v],Z),Z,0)}})}parse(r,c="$root"){const p=this.processor.toView(r);return this.toModel(p,c)}toModel(r,c="$root"){return this.model.change(p=>this.upcastDispatcher.convert(r,p,c))}addStyleProcessorRules(r){r(this.stylesProcessor)}destroy(){this.stopListening()}_checkIfRootsExists(r){for(const c of r)if(!this.model.document.getRootNames().includes(c))return!1;return!0}}Si(x_,Ut);class Dp{constructor(r,c){this._helpers=new Map,this._downcast=Array.isArray(r)?r:[r],this._createConversionHelpers({name:"downcast",dispatchers:this._downcast,isDowncast:!0}),this._upcast=Array.isArray(c)?c:[c],this._createConversionHelpers({name:"upcast",dispatchers:this._upcast,isDowncast:!1})}addAlias(r,c){const p=this._downcast.includes(c);if(!this._upcast.includes(c)&&!p)throw new En.b("conversion-add-alias-dispatcher-not-registered: Trying to register and alias for a dispatcher that nas not been registered.",this);this._createConversionHelpers({name:r,dispatchers:[c],isDowncast:p})}for(r){if(!this._helpers.has(r))throw new En.b("conversion-for-unknown-group: Trying to add a converter to an unknown dispatchers group.",this);return this._helpers.get(r)}elementToElement(r){this.for("downcast").elementToElement(r);for(const{model:c,view:p}of s1(r))this.for("upcast").elementToElement({model:c,view:p,converterPriority:r.converterPriority})}attributeToElement(r){this.for("downcast").attributeToElement(r);for(const{model:c,view:p}of s1(r))this.for("upcast").elementToAttribute({view:p,model:c,converterPriority:r.converterPriority})}attributeToAttribute(r){this.for("downcast").attributeToAttribute(r);for(const{model:c,view:p}of s1(r))this.for("upcast").attributeToAttribute({view:p,model:c})}_createConversionHelpers({name:r,dispatchers:c,isDowncast:p}){if(this._helpers.has(r))throw new En.b("conversion-group-exists: Trying to register a group name that has already been registered.",this);const v=p?new Fr(c):new f_(c);this._helpers.set(r,v)}}function*s1(b){if(b.model.values)for(const r of b.model.values){const c={key:b.model.key,value:r},p=b.view[r],v=b.upcastAlso?b.upcastAlso[r]:void 0;yield*R2(c,p,v)}else yield*R2(b.model,b.view,b.upcastAlso)}function*R2(b,r,c){if(yield{model:b,view:r},c){c=Array.isArray(c)?c:[c];for(const p of c)yield{model:b,view:p}}}class H1{constructor(r="default"){this.operations=[],this.type=r}get baseVersion(){for(const r of this.operations)if(null!==r.baseVersion)return r.baseVersion;return null}addOperation(r){return r.batch=this,this.operations.push(r),r}}class yl{constructor(r){this.baseVersion=r,this.isDocumentOperation=null!==this.baseVersion,this.batch=null}_validate(){}toJSON(){const r=Object.assign({},this);return r.__className=this.constructor.className,delete r.batch,delete r.isDocumentOperation,r}static get className(){return"Operation"}static fromJSON(r){return new this(r.baseVersion)}}class Tl{constructor(r){this.markers=new Map,this._children=new Ea,r&&this._insertChild(0,r)}[Symbol.iterator](){return this.getChildren()}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}get root(){return this}get parent(){return null}is(r){return"documentFragment"===r||"model:documentFragment"===r}getChild(r){return this._children.getNode(r)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(r){return this._children.getNodeIndex(r)}getChildStartOffset(r){return this._children.getNodeStartOffset(r)}getPath(){return[]}getNodeByPath(r){let c=this;for(const p of r)c=c.getChild(c.offsetToIndex(p));return c}offsetToIndex(r){return this._children.offsetToIndex(r)}toJSON(){const r=[];for(const c of this._children)r.push(c.toJSON());return r}static fromJSON(r){const c=[];for(const p of r)c.push(p.name?Wo.fromJSON(p):Bi.fromJSON(p));return new Tl(c)}_appendChild(r){this._insertChild(this.childCount,r)}_insertChild(r,c){const p="string"==typeof(v=c)?[new Bi(v)]:(ta(v)||(v=[v]),Array.from(v).map(Z=>"string"==typeof Z?new Bi(Z):Z instanceof Zo?new Bi(Z.data,Z.getAttributes()):Z));var v;for(const v of p)null!==v.parent&&v._remove(),v.parent=this;this._children._insertNodes(r,p)}_removeChildren(r,c=1){const p=this._children._removeNodes(r,c);for(const v of p)v.parent=null;return p}}function hm(b,r){const c=(r=Y1(r)).reduce((Z,S)=>Z+S.offsetSize,0),p=b.parent;_d(b);const v=b.index;return p._insertChild(v,r),Hu(p,v+r.length),Hu(p,v),new bi(b,b.getShiftedBy(c))}function as(b){if(!b.isFlat)throw new En.b("operation-utils-remove-range-not-flat: Trying to remove a range which starts and ends in different element.",this);const r=b.start.parent;_d(b.start),_d(b.end);const c=r._removeChildren(b.start.index,b.end.index-b.start.index);return Hu(r,b.start.index),c}function Sa(b,r){if(!b.isFlat)throw new En.b("operation-utils-move-range-not-flat: Trying to move a range which starts and ends in different element.",this);const c=as(b);return hm(r=r._getTransformedByDeletion(b.start,b.end.offset-b.start.offset),c)}function Y1(b){const r=[];b instanceof Array||(b=[b]);for(let c=0;cr.maxOffset)throw new En.b("move-operation-nodes-do-not-exist: The nodes which should be moved do not exist.",this);if(r===c&&p=p&&this.targetPosition.path[Z]p._clone(!0))),c=new ho(this.position,r,this.baseVersion);return c.shouldReceiveAttributes=this.shouldReceiveAttributes,c}getReversed(){const c=new Ei(this.position.root.document.graveyard,[0]);return new Jo(this.position,this.nodes.maxOffset,c,this.baseVersion+1)}_validate(){const r=this.position.parent;if(!r||r.maxOffsetc._clone(!0))),hm(this.position,r)}toJSON(){const r=super.toJSON();return r.position=this.position.toJSON(),r.nodes=this.nodes.toJSON(),r}static get className(){return"InsertOperation"}static fromJSON(r,c){const p=[];for(const Z of r.nodes)p.push(Z.name?Wo.fromJSON(Z):Bi.fromJSON(Z));const v=new ho(Ei.fromJSON(r.position,c),p,r.baseVersion);return v.shouldReceiveAttributes=r.shouldReceiveAttributes,v}}class Hc extends yl{constructor(r,c,p,v,Z,S){super(S),this.name=r,this.oldRange=c?c.clone():null,this.newRange=p?p.clone():null,this.affectsData=Z,this._markers=v}get type(){return"marker"}clone(){return new Hc(this.name,this.oldRange,this.newRange,this._markers,this.affectsData,this.baseVersion)}getReversed(){return new Hc(this.name,this.newRange,this.oldRange,this._markers,this.affectsData,this.baseVersion+1)}_execute(){this._markers[this.newRange?"_set":"_remove"](this.name,this.newRange,!0,this.affectsData)}toJSON(){const r=super.toJSON();return this.oldRange&&(r.oldRange=this.oldRange.toJSON()),this.newRange&&(r.newRange=this.newRange.toJSON()),delete r._markers,r}static get className(){return"MarkerOperation"}static fromJSON(r,c){return new Hc(r.name,r.oldRange?bi.fromJSON(r.oldRange,c):null,r.newRange?bi.fromJSON(r.newRange,c):null,c.model.markers,r.affectsData,r.baseVersion)}}class Ga extends yl{constructor(r,c,p,v){super(v),this.position=r,this.position.stickiness="toNext",this.oldName=c,this.newName=p}get type(){return"rename"}clone(){return new Ga(this.position.clone(),this.oldName,this.newName,this.baseVersion)}getReversed(){return new Ga(this.position.clone(),this.newName,this.oldName,this.baseVersion+1)}_validate(){const r=this.position.nodeAfter;if(!(r instanceof Wo))throw new En.b("rename-operation-wrong-position: Given position is invalid or node after it is not an instance of Element.",this);if(r.name!==this.oldName)throw new En.b("rename-operation-wrong-name: Element to change has different name than operation's old name.",this)}_execute(){this.position.nodeAfter.name=this.newName}toJSON(){const r=super.toJSON();return r.position=this.position.toJSON(),r}static get className(){return"RenameOperation"}static fromJSON(r,c){return new Ga(Ei.fromJSON(r.position,c),r.oldName,r.newName,r.baseVersion)}}class Al extends yl{constructor(r,c,p,v,Z){super(Z),this.root=r,this.key=c,this.oldValue=p,this.newValue=v}get type(){return null===this.oldValue?"addRootAttribute":null===this.newValue?"removeRootAttribute":"changeRootAttribute"}clone(){return new Al(this.root,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new Al(this.root,this.key,this.newValue,this.oldValue,this.baseVersion+1)}_validate(){if(this.root!=this.root.root||this.root.is("documentFragment"))throw new En.b("rootattribute-operation-not-a-root: The element to change is not a root element.",this,{root:this.root,key:this.key});if(null!==this.oldValue&&this.root.getAttribute(this.key)!==this.oldValue)throw new En.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(null===this.oldValue&&null!==this.newValue&&this.root.hasAttribute(this.key))throw new En.b("rootattribute-operation-attribute-exists: The attribute with given key already exists.",this,{root:this.root,key:this.key})}_execute(){null!==this.newValue?this.root._setAttribute(this.key,this.newValue):this.root._removeAttribute(this.key)}toJSON(){const r=super.toJSON();return r.root=this.root.toJSON(),r}static get className(){return"RootAttributeOperation"}static fromJSON(r,c){if(!c.getRoot(r.root))throw new En.b("rootattribute-operation-fromjson-no-root: Cannot create RootAttributeOperation. Root with specified name does not exist.",this,{rootName:r.root});return new Al(c.getRoot(r.root),r.key,r.oldValue,r.newValue,r.baseVersion)}}class rs extends yl{constructor(r,c,p,v,Z){super(Z),this.sourcePosition=r.clone(),this.sourcePosition.stickiness="toPrevious",this.howMany=c,this.targetPosition=p.clone(),this.targetPosition.stickiness="toNext",this.graveyardPosition=v.clone()}get type(){return"merge"}get deletionPosition(){return new Ei(this.sourcePosition.root,this.sourcePosition.path.slice(0,-1))}get movedRange(){const r=this.sourcePosition.getShiftedBy(Number.POSITIVE_INFINITY);return new bi(this.sourcePosition,r)}clone(){return new this.constructor(this.sourcePosition,this.howMany,this.targetPosition,this.graveyardPosition,this.baseVersion)}getReversed(){const r=this.targetPosition._getTransformedByMergeOperation(this),c=this.sourcePosition.path.slice(0,-1),p=new Ei(this.sourcePosition.root,c)._getTransformedByMergeOperation(this),v=new Ka(r,this.howMany,this.graveyardPosition,this.baseVersion+1);return v.insertionPosition=p,v}_validate(){const r=this.sourcePosition.parent,c=this.targetPosition.parent;if(!r.parent)throw new En.b("merge-operation-source-position-invalid: Merge source position is invalid.",this);if(!c.parent)throw new En.b("merge-operation-target-position-invalid: Merge target position is invalid.",this);if(this.howMany!=r.maxOffset)throw new En.b("merge-operation-how-many-invalid: Merge operation specifies wrong number of nodes to move.",this)}_execute(){const r=this.sourcePosition.parent;Sa(bi._createIn(r),this.targetPosition),Sa(bi._createOn(r),this.graveyardPosition)}toJSON(){const r=super.toJSON();return r.sourcePosition=r.sourcePosition.toJSON(),r.targetPosition=r.targetPosition.toJSON(),r.graveyardPosition=r.graveyardPosition.toJSON(),r}static get className(){return"MergeOperation"}static fromJSON(r,c){const p=Ei.fromJSON(r.sourcePosition,c),v=Ei.fromJSON(r.targetPosition,c),Z=Ei.fromJSON(r.graveyardPosition,c);return new this(p,r.howMany,v,Z,r.baseVersion)}}class Ka extends yl{constructor(r,c,p,v){super(v),this.splitPosition=r.clone(),this.splitPosition.stickiness="toNext",this.howMany=c,this.insertionPosition=Ka.getInsertionPosition(r),this.insertionPosition.stickiness="toNone",this.graveyardPosition=p?p.clone():null,this.graveyardPosition&&(this.graveyardPosition.stickiness="toNext")}get type(){return"split"}get moveTargetPosition(){const r=this.insertionPosition.path.slice();return r.push(0),new Ei(this.insertionPosition.root,r)}get movedRange(){const r=this.splitPosition.getShiftedBy(Number.POSITIVE_INFINITY);return new bi(this.splitPosition,r)}clone(){const r=new this.constructor(this.splitPosition,this.howMany,this.graveyardPosition,this.baseVersion);return r.insertionPosition=this.insertionPosition,r}getReversed(){const c=new Ei(this.splitPosition.root.document.graveyard,[0]);return new rs(this.moveTargetPosition,this.howMany,this.splitPosition,c,this.baseVersion+1)}_validate(){const r=this.splitPosition.parent;if(!r||r.maxOffset{for(const v of p.getAttributeKeys())this.removeAttribute(v,p)};if(r instanceof bi)for(const p of r.getItems())c(p);else c(r)}move(r,c,p){if(this._assertWriterUsedCorrectly(),!(r instanceof bi))throw new En.b("writer-move-invalid-range: Invalid range to move.",this);if(!r.isFlat)throw new En.b("writer-move-range-not-flat: Range to move is not flat.",this);const v=Ei._createAt(c,p);if(v.isEqual(r.start))return;if(this._addOperationForAffectedMarkers("move",r),!c1(r.root,v.root))throw new En.b("writer-move-different-document: Range is going to be moved between different documents.",this);const S=new Jo(r.start,r.end.offset-r.start.offset,v,r.root.document?r.root.document.version:null);this.batch.addOperation(S),this.model.applyOperation(S)}remove(r){this._assertWriterUsedCorrectly();const c=(r instanceof bi?r:bi._createOn(r)).getMinimalFlatRanges().reverse();for(const p of c)this._addOperationForAffectedMarkers("move",p),fd(p.start,p.end.offset-p.start.offset,this.batch,this.model)}merge(r){this._assertWriterUsedCorrectly();const c=r.nodeBefore,p=r.nodeAfter;if(this._addOperationForAffectedMarkers("merge",r),!(c instanceof Wo))throw new En.b("writer-merge-no-element-before: Node before merge position must be an element.",this);if(!(p instanceof Wo))throw new En.b("writer-merge-no-element-after: Node after merge position must be an element.",this);r.root.document?this._merge(r):this._mergeDetached(r)}createPositionFromPath(r,c,p){return this.model.createPositionFromPath(r,c,p)}createPositionAt(r,c){return this.model.createPositionAt(r,c)}createPositionAfter(r){return this.model.createPositionAfter(r)}createPositionBefore(r){return this.model.createPositionBefore(r)}createRange(r,c){return this.model.createRange(r,c)}createRangeIn(r){return this.model.createRangeIn(r)}createRangeOn(r){return this.model.createRangeOn(r)}createSelection(r,c,p){return this.model.createSelection(r,c,p)}_mergeDetached(r){const c=r.nodeBefore,p=r.nodeAfter;this.move(bi._createIn(p),Ei._createAt(c,"end")),this.remove(p)}_merge(r){const c=Ei._createAt(r.nodeBefore,"end"),p=Ei._createAt(r.nodeAfter,0),Z=new Ei(r.root.document.graveyard,[0]),I=new rs(p,r.nodeAfter.maxOffset,c,Z,r.root.document.version);this.batch.addOperation(I),this.model.applyOperation(I)}rename(r,c){if(this._assertWriterUsedCorrectly(),!(r instanceof Wo))throw new En.b("writer-rename-not-element-instance: Trying to rename an object which is not an instance of Element.",this);const p=r.root.document?r.root.document.version:null,v=new Ga(Ei._createBefore(r),r.name,c,p);this.batch.addOperation(v),this.model.applyOperation(v)}split(r,c){this._assertWriterUsedCorrectly();let p,v,Z=r.parent;if(!Z.parent)throw new En.b("writer-split-element-no-parent: Element with no parent can not be split.",this);if(c||(c=Z.parent),!r.parent.getAncestors({includeSelf:!0}).includes(c))throw new En.b("writer-split-invalid-limit-element: Limit element is not a position ancestor.",this);do{const V=new Ka(r,Z.maxOffset-r.offset,null,Z.root.document?Z.root.document.version:null);this.batch.addOperation(V),this.model.applyOperation(V),p||v||(p=Z,v=r.parent.nextSibling),Z=(r=this.createPositionAfter(r.parent)).parent}while(Z!==c);return{position:r,range:new bi(Ei._createAt(p,"end"),Ei._createAt(v,0))}}wrap(r,c){if(this._assertWriterUsedCorrectly(),!r.isFlat)throw new En.b("writer-wrap-range-not-flat: Range to wrap is not flat.",this);const p=c instanceof Wo?c:new Wo(c);if(p.childCount>0)throw new En.b("writer-wrap-element-not-empty: Element to wrap with is not empty.",this);if(null!==p.parent)throw new En.b("writer-wrap-element-attached: Element to wrap with is already attached to tree model.",this);this.insert(p,r.start);const v=new bi(r.start.getShiftedBy(1),r.end.getShiftedBy(1));this.move(v,Ei._createAt(p,0))}unwrap(r){if(this._assertWriterUsedCorrectly(),null===r.parent)throw new En.b("writer-unwrap-element-no-parent: Trying to unwrap an element which has no parent.",this);this.move(bi._createIn(r),this.createPositionAfter(r)),this.remove(r)}addMarker(r,c){if(this._assertWriterUsedCorrectly(),!c||"boolean"!=typeof c.usingOperation)throw new En.b("writer-addMarker-no-usingOperation: The options.usingOperation parameter is required when adding a new marker.",this);const p=c.usingOperation,v=c.range,Z=void 0!==c.affectsData&&c.affectsData;if(this.model.markers.has(r))throw new En.b("writer-addMarker-marker-exists: Marker with provided name already exists.",this);if(!v)throw new En.b("writer-addMarker-no-range: Range parameter is required when adding a new marker.",this);return p?(Vu(this,r,null,v,Z),this.model.markers.get(r)):this.model.markers._set(r,v,p,Z)}updateMarker(r,c){this._assertWriterUsedCorrectly();const p="string"==typeof r?r:r.name,v=this.model.markers.get(p);if(!v)throw new En.b("writer-updateMarker-marker-not-exists: Marker with provided name does not exists.",this);if(!c)return void this.model.markers._refresh(v);const Z="boolean"==typeof c.usingOperation,S="boolean"==typeof c.affectsData,I=S?c.affectsData:v.affectsData;if(!Z&&!c.range&&!S)throw new En.b("writer-updateMarker-wrong-options: One of the options is required - provide range, usingOperations or affectsData.",this);const V=v.getRange(),it=c.range?c.range:V;Z&&c.usingOperation!==v.managedUsingOperations?c.usingOperation?Vu(this,p,null,it,I):(Vu(this,p,V,null,I),this.model.markers._set(p,it,void 0,I)):v.managedUsingOperations?Vu(this,p,V,it,I):this.model.markers._set(p,it,void 0,I)}removeMarker(r){this._assertWriterUsedCorrectly();const c="string"==typeof r?r:r.name;if(!this.model.markers.has(c))throw new En.b("writer-removeMarker-no-marker: Trying to remove marker which does not exist.",this);const p=this.model.markers.get(c);p.managedUsingOperations?Vu(this,c,p.getRange(),null,p.affectsData):this.model.markers._remove(c)}setSelection(r,c,p){this._assertWriterUsedCorrectly(),this.model.document.selection._setTo(r,c,p)}setSelectionFocus(r,c){this._assertWriterUsedCorrectly(),this.model.document.selection._setFocus(r,c)}setSelectionAttribute(r,c){if(this._assertWriterUsedCorrectly(),"string"==typeof r)this._setSelectionAttribute(r,c);else for(const[p,v]of aa(r))this._setSelectionAttribute(p,v)}removeSelectionAttribute(r){if(this._assertWriterUsedCorrectly(),"string"==typeof r)this._removeSelectionAttribute(r);else for(const c of r)this._removeSelectionAttribute(c)}overrideSelectionGravity(){return this.model.document.selection._overrideGravity()}restoreSelectionGravity(r){this.model.document.selection._restoreGravity(r)}_setSelectionAttribute(r,c){const p=this.model.document.selection;if(p.isCollapsed&&p.anchor.parent.isEmpty){const v=xl._getStoreAttributeKey(r);this.setAttribute(v,c,p.anchor.parent)}p._setAttribute(r,c)}_removeSelectionAttribute(r){const c=this.model.document.selection;if(c.isCollapsed&&c.anchor.parent.isEmpty){const p=xl._getStoreAttributeKey(r);this.removeAttribute(p,c.anchor.parent)}c._removeAttribute(r)}_assertWriterUsedCorrectly(){if(this.model._currentWriter!==this)throw new En.b("writer-incorrect-use: Trying to use a writer outside the change() block.",this)}_addOperationForAffectedMarkers(r,c){for(const p of this.model.markers){if(!p.managedUsingOperations)continue;const v=p.getRange();let Z=!1;if("move"===r)Z=c.containsPosition(v.start)||c.start.isEqual(v.start)||c.containsPosition(v.end)||c.end.isEqual(v.end);else{const I=c.nodeAfter,it=v.end.parent==I&&0==v.end.offset,dt=v.end.nodeAfter==I,xt=v.start.nodeAfter==I;Z=v.start.parent==c.nodeBefore&&v.start.isAtEnd||it||dt||xt}Z&&this.updateMarker(p.name,{range:v})}}}function zu(b,r,c,p){const v=b.model,Z=v.document;let S,I,V,it=p.start;for(const xt of p.getWalker({shallow:!0}))V=xt.item.getAttribute(r),S&&I!=V&&(I!=c&&dt(),it=S),S=xt.nextPosition,I=V;function dt(){const xt=new bi(it,S),Ie=new ga(xt,r,I,c,xt.root.document?Z.version:null);b.batch.addOperation(Ie),v.applyOperation(Ie)}S instanceof Ei&&S!=it&&I!=c&&dt()}function Id(b,r,c,p){const v=b.model,Z=v.document,S=p.getAttribute(r);let I,V;S!=c&&(p.root===p?V=new Al(p,r,S,c,p.document?Z.version:null):(I=new bi(Ei._createBefore(p),b.createPositionAfter(p)),V=new ga(I,r,S,c,I.root.document?Z.version:null)),b.batch.addOperation(V),v.applyOperation(V))}function Vu(b,r,c,p,v){const Z=b.model,I=new Hc(r,c,p,Z.markers,v,Z.document.version);b.batch.addOperation(I),Z.applyOperation(I)}function fd(b,r,c,p){let v;if(b.root.document){const Z=p.document,S=new Ei(Z.graveyard,[0]);v=new Jo(b,r,S,Z.version)}else v=new hs(b,r);c.addOperation(v),p.applyOperation(v)}function c1(b,r){return b===r||b instanceof Gl&&r instanceof Gl}class ko{constructor(r){this._markerCollection=r,this._changesInElement=new Map,this._elementSnapshots=new Map,this._changedMarkers=new Map,this._changeCount=0,this._cachedChanges=null,this._cachedChangesWithGraveyard=null}get isEmpty(){return 0==this._changesInElement.size&&0==this._changedMarkers.size}refreshItem(r){if(this._isInInsertedElement(r.parent))return;this._markRemove(r.parent,r.startOffset,r.offsetSize),this._markInsert(r.parent,r.startOffset,r.offsetSize);const c=bi._createOn(r);for(const p of this._markerCollection.getMarkersIntersectingRange(c)){const v=p.getRange();this.bufferMarkerChange(p.name,v,v,p.affectsData)}this._cachedChanges=null}bufferOperation(r){switch(r.type){case"insert":if(this._isInInsertedElement(r.position.parent))return;this._markInsert(r.position.parent,r.position.offset,r.nodes.maxOffset);break;case"addAttribute":case"removeAttribute":case"changeAttribute":for(const c of r.range.getItems({shallow:!0}))this._isInInsertedElement(c.parent)||this._markAttribute(c);break;case"remove":case"move":case"reinsert":{if(r.sourcePosition.isEqual(r.targetPosition)||r.sourcePosition.getShiftedBy(r.howMany).isEqual(r.targetPosition))return;const c=this._isInInsertedElement(r.sourcePosition.parent),p=this._isInInsertedElement(r.targetPosition.parent);c||this._markRemove(r.sourcePosition.parent,r.sourcePosition.offset,r.howMany),p||this._markInsert(r.targetPosition.parent,r.getMovedRangeStart().offset,r.howMany);break}case"rename":{if(this._isInInsertedElement(r.position.parent))return;this._markRemove(r.position.parent,r.position.offset,1),this._markInsert(r.position.parent,r.position.offset,1);const c=bi._createFromPositionAndShift(r.position,1);for(const p of this._markerCollection.getMarkersIntersectingRange(c)){const v=p.getRange();this.bufferMarkerChange(p.name,v,v,p.affectsData)}break}case"split":{const c=r.splitPosition.parent;this._isInInsertedElement(c)||this._markRemove(c,r.splitPosition.offset,r.howMany),this._isInInsertedElement(r.insertionPosition.parent)||this._markInsert(r.insertionPosition.parent,r.insertionPosition.offset,1),r.graveyardPosition&&this._markRemove(r.graveyardPosition.parent,r.graveyardPosition.offset,1);break}case"merge":{const c=r.sourcePosition.parent;this._isInInsertedElement(c.parent)||this._markRemove(c.parent,c.startOffset,1),this._markInsert(r.graveyardPosition.parent,r.graveyardPosition.offset,1);const v=r.targetPosition.parent;this._isInInsertedElement(v)||this._markInsert(v,r.targetPosition.offset,c.maxOffset);break}}this._cachedChanges=null}bufferMarkerChange(r,c,p,v){const Z=this._changedMarkers.get(r);Z?(Z.newRange=p,Z.affectsData=v,null==Z.oldRange&&null==Z.newRange&&this._changedMarkers.delete(r)):this._changedMarkers.set(r,{oldRange:c,newRange:p,affectsData:v})}getMarkersToRemove(){const r=[];for(const[c,p]of this._changedMarkers)null!=p.oldRange&&r.push({name:c,range:p.oldRange});return r}getMarkersToAdd(){const r=[];for(const[c,p]of this._changedMarkers)null!=p.newRange&&r.push({name:c,range:p.newRange});return r}getChangedMarkers(){return Array.from(this._changedMarkers).map(r=>({name:r[0],data:{oldRange:r[1].oldRange,newRange:r[1].newRange}}))}hasDataChanges(){for(const[,r]of this._changedMarkers)if(r.affectsData)return!0;return this._changesInElement.size>0}getChanges(r={includeChangesInGraveyard:!1}){if(this._cachedChanges)return r.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice();const c=[];for(const p of this._changesInElement.keys()){const v=this._changesInElement.get(p).sort((dt,xt)=>dt.offset===xt.offset?dt.type!=xt.type?"remove"==dt.type?-1:1:0:dt.offsetp.position.root!=v.position.root?p.position.root.rootNamep.offset){if(v>Z){const S={type:"attribute",offset:Z,howMany:v-Z,count:this._changeCount++};this._handleChange(S,c),c.push(S)}r.nodesToHandle=p.offset-r.offset,r.howMany=r.nodesToHandle}else r.offset>=p.offset&&r.offsetZ?(r.nodesToHandle=v-Z,r.offset=Z):r.nodesToHandle=0);if("remove"==p.type&&r.offsetp.offset){const S={type:"attribute",offset:p.offset,howMany:v-p.offset,count:this._changeCount++};this._handleChange(S,c),c.push(S),r.nodesToHandle=p.offset-r.offset,r.howMany=r.nodesToHandle}"attribute"==p.type&&(r.offset>=p.offset&&v<=Z?(r.nodesToHandle=0,r.howMany=0,r.offset=0):r.offset<=p.offset&&v>=Z&&(p.howMany=0))}}r.howMany=r.nodesToHandle,delete r.nodesToHandle}_getInsertDiff(r,c,p){return{type:"insert",position:Ei._createAt(r,c),name:p,length:1,changeCount:this._changeCount++}}_getRemoveDiff(r,c,p){return{type:"remove",position:Ei._createAt(r,c),name:p,length:1,changeCount:this._changeCount++}}_getAttributesDiff(r,c,p){const v=[];p=new Map(p);for(const[Z,S]of c){const I=p.has(Z)?p.get(Z):null;I!==S&&v.push({type:"attribute",position:r.start,range:r.clone(),length:1,attributeKey:Z,attributeOldValue:S,attributeNewValue:I,changeCount:this._changeCount++}),p.delete(Z)}for(const[Z,S]of p)v.push({type:"attribute",position:r.start,range:r.clone(),length:1,attributeKey:Z,attributeOldValue:null,attributeNewValue:S,changeCount:this._changeCount++});return v}_isInInsertedElement(r){const c=r.parent;if(!c)return!1;const p=this._changesInElement.get(c),v=r.startOffset;if(p)for(const Z of p)if("insert"==Z.type&&v>=Z.offset&&vp){for(let S=0;S{const v=p[0];if(v.isDocumentOperation&&v.baseVersion!==this.version)throw new En.b("model-document-applyOperation-wrong-version: Only operations with matching versions can be applied.",this,{operation:v})},{priority:"highest"}),this.listenTo(r,"applyOperation",(c,p)=>{const v=p[0];v.isDocumentOperation&&this.differ.bufferOperation(v)},{priority:"high"}),this.listenTo(r,"applyOperation",(c,p)=>{const v=p[0];v.isDocumentOperation&&(this.version++,this.history.addOperation(v))},{priority:"low"}),this.listenTo(this.selection,"change",()=>{this._hasSelectionChangedFromTheLastChangeBlock=!0}),this.listenTo(r.markers,"update",(c,p,v,Z)=>{this.differ.bufferMarkerChange(p.name,v,Z,p.affectsData),null===v&&p.on("change",(S,I)=>{this.differ.bufferMarkerChange(p.name,I,p.getRange(),p.affectsData)})})}get graveyard(){return this.getRoot("$graveyard")}createRoot(r="$root",c="main"){if(this.roots.get(c))throw new En.b("model-document-createRoot-name-exists: Root with specified name already exists.",this,{name:c});const p=new Gl(this,r,c);return this.roots.add(p),p}destroy(){this.selection.destroy(),this.stopListening()}getRoot(r="main"){return this.roots.get(r)}getRootNames(){return Array.from(this.roots,r=>r.rootName).filter(r=>"$graveyard"!=r)}registerPostFixer(r){this._postFixers.add(r)}toJSON(){const r=Ti(this);return r.selection="[engine.model.DocumentSelection]",r.model="[engine.model.Model]",r}_handleChangeBlock(r){this._hasDocumentChangedFromTheLastChangeBlock()&&(this._callPostFixers(r),this.selection.refresh(),this.differ.hasDataChanges()?this.fire("change:data",r.batch):this.fire("change",r.batch),this.selection.refresh(),this.differ.reset()),this._hasSelectionChangedFromTheLastChangeBlock=!1}_hasDocumentChangedFromTheLastChangeBlock(){return!this.differ.isEmpty||this._hasSelectionChangedFromTheLastChangeBlock}_getDefaultRoot(){for(const r of this.roots)if(r!==this.graveyard)return r;return this.graveyard}_getDefaultRange(){const r=this._getDefaultRoot(),c=this.model,p=c.schema,v=c.createPositionFromPath(r,[0]);return p.getNearestSelectionRange(v)||c.createRange(v)}_validateSelectionRange(r){return T_(r.start)&&T_(r.end)}_callPostFixers(r){let c=!1;do{for(const p of this._postFixers)if(this.selection.refresh(),c=p(r),c)break}while(c)}}function T_(b){const r=b.textNode;if(r){const c=r.data,p=b.offset-r.startOffset;return!du(c,p)&&!kp(c,p)}return!0}Si(Cr,Fo);class u1{constructor(){this._markers=new Map}[Symbol.iterator](){return this._markers.values()}has(r){return this._markers.has(r)}get(r){return this._markers.get(r)||null}_set(r,c,p=!1,v=!1){const Z=r instanceof gm?r.name:r;if(Z.includes(","))throw new En.b('markercollection-incorrect-marker-name: Marker name cannot contain "," character.',this);const S=this._markers.get(Z);if(S){const it=S.getRange();let dt=!1;return it.isEqual(c)||(S._attachLiveRange(i1.fromRange(c)),dt=!0),p!=S.managedUsingOperations&&(S._managedUsingOperations=p,dt=!0),"boolean"==typeof v&&v!=S.affectsData&&(S._affectsData=v,dt=!0),dt&&this.fire("update:"+Z,S,it,c),S}const I=i1.fromRange(c),V=new gm(Z,I,p,v);return this._markers.set(Z,V),this.fire("update:"+Z,V,null,c),V}_remove(r){const c=r instanceof gm?r.name:r,p=this._markers.get(c);return!!p&&(this._markers.delete(c),this.fire("update:"+c,p,p.getRange(),null),this._destroyMarker(p),!0)}_refresh(r){const c=r instanceof gm?r.name:r,p=this._markers.get(c);if(!p)throw new En.b("markercollection-refresh-marker-not-exists: Marker with provided name does not exists.",this);const v=p.getRange();this.fire("update:"+c,p,v,v,p.managedUsingOperations,p.affectsData)}*getMarkersAtPosition(r){for(const c of this)c.getRange().containsPosition(r)&&(yield c)}*getMarkersIntersectingRange(r){for(const c of this)null!==c.getRange().getIntersection(r)&&(yield c)}destroy(){for(const r of this._markers.values())this._destroyMarker(r);this._markers=null,this.stopListening()}*getMarkersGroup(r){for(const c of this._markers.values())c.name.startsWith(r+":")&&(yield c)}_destroyMarker(r){r.stopListening(),r._detachLiveRange()}}Si(u1,Fo);class gm{constructor(r,c,p,v){this.name=r,this._liveRange=this._attachLiveRange(c),this._managedUsingOperations=p,this._affectsData=v}get managedUsingOperations(){if(!this._liveRange)throw new En.b("marker-destroyed: Cannot use a destroyed marker instance.",this);return this._managedUsingOperations}get affectsData(){if(!this._liveRange)throw new En.b("marker-destroyed: Cannot use a destroyed marker instance.",this);return this._affectsData}getStart(){if(!this._liveRange)throw new En.b("marker-destroyed: Cannot use a destroyed marker instance.",this);return this._liveRange.start.clone()}getEnd(){if(!this._liveRange)throw new En.b("marker-destroyed: Cannot use a destroyed marker instance.",this);return this._liveRange.end.clone()}getRange(){if(!this._liveRange)throw new En.b("marker-destroyed: Cannot use a destroyed marker instance.",this);return this._liveRange.toRange()}is(r){return"marker"===r||"model:marker"===r}_attachLiveRange(r){return this._liveRange&&this._detachLiveRange(),r.delegate("change:range").to(this),r.delegate("change:content").to(this),this._liveRange=r,r}_detachLiveRange(){this._liveRange.stopDelegating("change:range",this),this._liveRange.stopDelegating("change:content",this),this._liveRange.detach(),this._liveRange=null}}Si(gm,Fo);class Es extends yl{get type(){return"noop"}clone(){return new Es(this.baseVersion)}getReversed(){return new Es(this.baseVersion+1)}_execute(){}static get className(){return"NoOperation"}}const Zs={};Zs[ga.className]=ga,Zs[ho.className]=ho,Zs[Hc.className]=Hc,Zs[Jo.className]=Jo,Zs[Es.className]=Es,Zs[yl.className]=yl,Zs[Ga.className]=Ga,Zs[Al.className]=Al,Zs[Ka.className]=Ka,Zs[rs.className]=rs;class Ws extends Ei{constructor(r,c,p="toNone"){if(super(r,c,p),!this.root.is("rootElement"))throw new En.b("model-liveposition-root-not-rootelement: LivePosition's root has to be an instance of RootElement.",r);vm.call(this)}detach(){this.stopListening()}is(r){return"livePosition"===r||"model:livePosition"===r||"position"==r||"model:position"===r}toPosition(){return new Ei(this.root,this.path.slice(),this.stickiness)}static fromPosition(r,c){return new this(r.root,r.path.slice(),c||r.stickiness)}}function vm(){this.listenTo(this.root.document.model,"applyOperation",(b,r)=>{const c=r[0];c.isDocumentOperation&&bm.call(this,c)},{priority:"low"})}function bm(b){const r=this.getTransformedByOperation(b);if(!this.isEqual(r)){const c=this.toPosition();this.path=r.path,this.root=r.root,this.fire("change",c)}}Si(Ws,Fo);class Ql{constructor(r,c,p){this.model=r,this.writer=c,this.position=p,this.canMergeWith=new Set([this.position.parent]),this.schema=r.schema,this._filterAttributesOf=[],this._affectedStart=null,this._affectedEnd=null}handleNodes(r,c){r=Array.from(r);for(let p=0;p!0);if(b.schema.checkChild(r.nextPosition,"$text"))return r.nextPosition}}function Tc(b,r){const p=Ei._createAt(b.root,r?"end":0);return r?new bi(b,p):new bi(p,b)}function Rd(b,r,c){return' ,.?!:;"-()'.includes(b.charAt(r+(c?0:-1)))}function A_(b,r,c){return r===(c?b.endOffset:0)}function U_(b,r){const c=[];Array.from(b.getItems({direction:"backward"})).map(p=>r.createRangeOn(p)).filter(p=>(p.start.isAfter(b.start)||p.start.isEqual(b.start))&&(p.end.isBefore(b.end)||p.end.isEqual(b.end))).forEach(p=>{c.push(p.start.parent),r.remove(p)}),c.forEach(p=>{let v=p;for(;v.parent&&v.isEmpty;){const Z=r.createRangeOn(v);v=v.parent,r.remove(Z)}})}function mu(b,r){return b.isCollapsed?function(c,p){const v=c.start,Z=p.getNearestSelectionRange(v);if(!Z)return null;if(!Z.isCollapsed)return Z;const S=Z.start;return v.isEqual(S)?null:new bi(S)}(b,r):function(c,p){const v=c.start,Z=c.end,S=p.checkChild(v,"$text"),I=p.checkChild(Z,"$text"),V=p.getLimitElement(v),it=p.getLimitElement(Z);if(V===it){if(S&&I)return null;if(function(le,Ie,rn){const vn=le.nodeAfter&&!rn.isLimit(le.nodeAfter)||rn.checkChild(le,"$text"),wn=Ie.nodeBefore&&!rn.isLimit(Ie.nodeBefore)||rn.checkChild(Ie,"$text");return vn||wn}(v,Z,p)){const le=v.nodeAfter&&p.isObject(v.nodeAfter)?null:p.getNearestSelectionRange(v,"forward"),Ie=Z.nodeBefore&&p.isObject(Z.nodeBefore)?null:p.getNearestSelectionRange(Z,"backward");return new bi(le?le.start:v,Ie?Ie.start:Z)}}const dt=V&&!V.is("rootElement"),xt=it&&!it.is("rootElement");if(dt||xt){const le=v.nodeAfter&&Z.nodeBefore&&v.nodeAfter.parent===Z.nodeBefore.parent,Ie=dt&&(!le||!Cm(v.nodeAfter,p)),rn=xt&&(!le||!Cm(Z.nodeBefore,p));let vn=v,wn=Z;return Ie&&(vn=Ei._createBefore(p1(V,p))),rn&&(wn=Ei._createAfter(p1(it,p))),new bi(vn,wn)}return null}(b,r)}function p1(b,r){let c=b,p=c;for(;r.isLimit(p)&&p.parent;)c=p,p=p.parent;return c}function Cm(b,r){return b&&r.isObject(b)}class Z_{constructor(){this.markers=new u1,this.document=new Cr(this),this.schema=new fm,this._pendingChanges=[],this._currentWriter=null,["insertContent","deleteContent","modifySelection","getSelectedContent","applyOperation"].forEach(r=>this.decorate(r)),this.on("applyOperation",(r,c)=>{c[0]._validate()},{priority:"highest"}),this.schema.register("$root",{isLimit:!0}),this.schema.register("$block",{allowIn:"$root",isBlock:!0}),this.schema.register("$text",{allowIn:"$block",isInline:!0}),this.schema.register("$clipboardHolder",{allowContentOf:"$root",isLimit:!0}),this.schema.extend("$text",{allowIn:"$clipboardHolder"}),this.schema.register("$marker"),this.schema.addChildCheck((r,c)=>{if("$marker"===c.name)return!0}),function Ju(b){b.document.registerPostFixer(r=>function(c,p){const v=p.document.selection,Z=p.schema,S=[];let I=!1;for(const V of v.getRanges()){const it=mu(V,Z);it&&!it.isEqual(V)?(S.push(it),I=!0):S.push(V)}I&&c.setSelection(function(V){const it=[];it.push(V.shift());for(const dt of V){const xt=it.pop();if(dt.isIntersecting(xt)){const le=xt.start.isAfter(dt.start)?dt.start:xt.start,Ie=xt.end.isAfter(dt.end)?xt.end:dt.end,rn=new bi(le,Ie);it.push(rn)}else it.push(xt),it.push(dt)}return it}(S),{backward:v.isBackward})}(r,b))}(this)}change(r){try{return 0===this._pendingChanges.length?(this._pendingChanges.push({batch:new H1,callback:r}),this._runPendingChanges()[0]):r(this._currentWriter)}catch(c){En.b.rethrowUnexpectedError(c,this)}}enqueueChange(r,c){try{"string"==typeof r?r=new H1(r):"function"==typeof r&&(c=r,r=new H1),this._pendingChanges.push({batch:r,callback:c}),1==this._pendingChanges.length&&this._runPendingChanges()}catch(p){En.b.rethrowUnexpectedError(p,this)}}applyOperation(r){r._execute()}insertContent(r,c,p){return Z=r,S=c,I=p,(v=this).change(V=>{let it;it=S?S instanceof md||S instanceof xl?S:V.createSelection(S,I):v.document.selection,it.isCollapsed||v.deleteContent(it,{doNotAutoparagraph:!0});const dt=new Ql(v,V,it.anchor);let xt;xt=Z.is("documentFragment")?Z.getChildren():[Z],dt.handleNodes(xt,{isFirst:!0,isLast:!0});const le=dt.getSelectionRange();le&&(it instanceof xl?V.setSelection(le):it.setTo(le));const Ie=dt.getAffectedRange()||v.createRange(it.anchor);return dt.destroy(),Ie});var v,Z,S,I}deleteContent(r,c){!function Yc(b,r,c={}){if(r.isCollapsed)return;const p=r.getFirstRange();if("$graveyard"==p.root.rootName)return;const v=b.schema;b.change(Z=>{if(!c.doNotResetEntireContent&&function(V,it){const dt=V.getLimitElement(it);if(!it.containsEntireContent(dt))return!1;const xt=it.getFirstRange();return xt.start.parent!=xt.end.parent&&V.checkChild(dt,"paragraph")}(v,r))return void function(V,it){const dt=V.model.schema.getLimitElement(it);V.remove(V.createRangeIn(dt)),d1(V,V.createPositionAt(dt,0),it)}(Z,r);const[S,I]=function(V){const it=V.root.document.model,dt=V.start;let xt=V.end;if(it.hasContent(V,{ignoreMarkers:!0})){const le=function(Ie){const rn=Ie.parent,vn=rn.root.document.model.schema,wn=rn.getAncestors({parentFirst:!0,includeSelf:!0});for(const qn of wn){if(vn.isLimit(qn))return null;if(vn.isBlock(qn))return qn}}(xt);if(le&&xt.isTouching(it.createPositionAt(le,0))){const Ie=it.createSelection(V);it.modifySelection(Ie,{direction:"backward"}),xt=Ie.getLastPosition()}}return[Ws.fromPosition(dt,"toPrevious"),Ws.fromPosition(xt,"toNext")]}(p);p.start.isTouching(p.end)||Z.remove(p),c.leaveUnmerged||(function(V,it,dt){const xt=V.model;if(!pu(V.model.schema,it,dt))return;const[le,Ie]=function(rn,vn){const wn=rn.getAncestors(),qn=vn.getAncestors();let mi=0;for(;wn[mi]&&wn[mi]==qn[mi];)mi++;return[wn[mi],qn[mi]]}(it,dt);!xt.hasContent(le,{ignoreMarkers:!0})&&xt.hasContent(Ie,{ignoreMarkers:!0})?function rn(vn,wn,qn,mi){const xi=wn.parent,Vi=qn.parent;if(xi!=mi&&Vi!=mi){for(wn=vn.createPositionAfter(xi),(qn=vn.createPositionBefore(Vi)).isEqual(wn)||vn.insert(xi,qn);wn.parent.isEmpty;){const Po=wn.parent;wn=vn.createPositionBefore(Po),vn.remove(Po)}qn=vn.createPositionBefore(Vi),function(Po,Yr){const Ba=Yr.nodeBefore,$s=Yr.nodeAfter;Ba.name!=$s.name&&Po.rename(Ba,$s.name),Po.clearAttributes(Ba),Po.setAttributes(Object.fromEntries($s.getAttributes()),Ba),Po.merge(Yr)}(vn,qn),pu(vn.model.schema,wn,qn)&&rn(vn,wn,qn,mi)}}(V,it,dt,le.parent):function rn(vn,wn,qn,mi){const xi=wn.parent,Vi=qn.parent;if(xi!=mi&&Vi!=mi){for(wn=vn.createPositionAfter(xi),(qn=vn.createPositionBefore(Vi)).isEqual(wn)||vn.insert(Vi,wn),vn.merge(wn);qn.parent.isEmpty;){const Po=qn.parent;qn=vn.createPositionBefore(Po),vn.remove(Po)}!pu(vn.model.schema,wn,qn)||rn(vn,wn,qn,mi)}}(V,it,dt,le.parent)}(Z,S,I),v.removeDisallowedAttributes(S.parent.getChildren(),Z)),hd(Z,r,S),!c.doNotAutoparagraph&&function(V,it){const dt=V.checkChild(it,"$text"),xt=V.checkChild(it,"paragraph");return!dt&&xt}(v,S)&&d1(Z,S,r),S.detach(),I.detach()})}(this,r,c)}modifySelection(r,c){!function(p,v,Z={}){const S=p.schema,I="backward"!=Z.direction,V=Z.unit?Z.unit:"character",dt=new js({boundaries:Tc(v.focus,I),singleCharacters:!0,direction:I?"forward":"backward"}),xt={walker:dt,schema:S,isForward:I,unit:V};let le;for(;le=dt.next();){if(le.done)return;const Ie=ih(xt,le.value);if(Ie)return void(v instanceof xl?p.change(rn=>{rn.setSelectionFocus(Ie)}):v.setFocus(Ie))}}(this,r,c)}getSelectedContent(r){return function(c,p){return c.change(v=>{const Z=v.createDocumentFragment(),S=p.getFirstRange();if(!S||S.isCollapsed)return Z;const I=S.start.root,V=S.start.getCommonPath(S.end),it=I.getNodeByPath(V);let dt;dt=S.start.parent==S.end.parent?S:v.createRange(v.createPositionAt(it,S.start.path[V.length]),v.createPositionAt(it,S.end.path[V.length]+1));const xt=dt.end.offset-dt.start.offset;for(const le of dt.getItems({shallow:!0}))le.is("$textProxy")?v.appendText(le.data,le.getAttributes(),Z):v.append(v.cloneElement(le,!0),Z);if(dt!=S){const le=S._getTransformedByMove(dt.start,v.createPositionAt(Z,0),xt)[0],Ie=v.createRange(v.createPositionAt(Z,0),le.start);U_(v.createRange(le.end,v.createPositionAt(Z,"end")),v),U_(Ie,v)}return Z})}(this,r)}hasContent(r,c={}){const p=r instanceof Wo?bi._createIn(r):r;if(p.isCollapsed)return!1;const{ignoreWhitespaces:v=!1,ignoreMarkers:Z=!1}=c;if(!Z)for(const S of this.markers.getMarkersIntersectingRange(p))if(S.affectsData)return!0;for(const S of p.getItems())if(S.is("$textProxy")){if(!v||-1!==S.data.search(/\S/))return!0}else if(this.schema.isObject(S))return!0;return!1}createPositionFromPath(r,c,p){return new Ei(r,c,p)}createPositionAt(r,c){return Ei._createAt(r,c)}createPositionAfter(r){return Ei._createAfter(r)}createPositionBefore(r){return Ei._createBefore(r)}createRange(r,c){return new bi(r,c)}createRangeIn(r){return bi._createIn(r)}createRangeOn(r){return bi._createOn(r)}createSelection(r,c,p){return new md(r,c,p)}createBatch(r){return new H1(r)}createOperationFromJSON(r){return class{static fromJSON(c,p){return Zs[c.__className].fromJSON(c,p)}}.fromJSON(r,this.document)}destroy(){this.document.destroy(),this.stopListening()}_runPendingChanges(){const r=[];for(this.fire("_beforeChanges");this._pendingChanges.length;){this._currentWriter=new Yu(this,this._pendingChanges[0].batch);const p=this._pendingChanges[0].callback(this._currentWriter);r.push(p),this.document._handleChangeBlock(this._currentWriter),this._pendingChanges.shift(),this._currentWriter=null}return this.fire("_afterChanges"),r}}Si(Z_,Ut);class _u{constructor(){this._listener=Object.create(gi)}listenTo(r){this._listener.listenTo(r,"keydown",(c,p)=>{this._listener.fire("_keydown:"+na(p),p)})}set(r,c,p={}){const v=Dd(r);this._listener.listenTo(this._listener,"_keydown:"+v,(S,I)=>{c(I,()=>{I.preventDefault(),I.stopPropagation(),S.stop()}),S.return=!0},{priority:p.priority})}press(r){return!!this._listener.fire("_keydown:"+na(r),r)}destroy(){this._listener.stopListening()}}class pg extends _u{constructor(r){super(),this.editor=r}set(r,c,p={}){if("string"==typeof c){const v=c;c=(Z,S)=>{this.editor.execute(v),S()}}super.set(r,c,p)}}class Op{constructor(r={}){this._context=r.context||new ru({language:r.language}),this._context._addEditor(this,!r.context);const c=Array.from(this.constructor.builtinPlugins||[]);this.config=new Nc(r,this.constructor.defaultConfig),this.config.define("plugins",c),this.config.define(this._context._getEditorConfig()),this.plugins=new va(this,c,this._context.plugins),this.locale=this._context.locale,this.t=this.locale.t,this.commands=new b_,this.set("state","initializing"),this.once("ready",()=>this.state="ready",{priority:"high"}),this.once("destroy",()=>this.state="destroyed",{priority:"high"}),this.set("isReadOnly",!1),this.model=new Z_;const p=new sc;this.data=new x_(this.model,p),this.editing=new v_(this.model,p),this.editing.view.document.bind("isReadOnly").to(this),this.conversion=new Dp([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 pg(this),this.keystrokes.listenTo(this.editing.view.document)}initPlugins(){const r=this.config,c=r.get("plugins"),p=r.get("removePlugins")||[],v=r.get("extraPlugins")||[];return this.plugins.init(c.concat(v),p)}destroy(){let r=Promise.resolve();return"initializing"==this.state&&(r=new Promise(c=>this.once("ready",c))),r.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(...r){try{return this.commands.execute(...r)}catch(c){En.b.rethrowUnexpectedError(c,this)}}}Si(Op,Ut);var Ul={setData(b){this.data.set(b)},getData(b){return this.data.get(b)}},z1={updateSourceElement(){if(!this.sourceElement)throw new En.b("editor-missing-sourceelement: Cannot update the source element of a detached editor.",this);var b,r;b=this.sourceElement,r=this.data.get(),b instanceof HTMLTextAreaElement&&(b.value=r),b.innerHTML=r}};class w_{getHtml(r){const c=document.implementation.createHTMLDocument("").createElement("div");return c.appendChild(r),c.innerHTML}}class M_{constructor(r){this._domParser=new DOMParser,this._domConverter=new jt(r,{blockFillerMode:"nbsp"}),this._htmlWriter=new w_}toData(r){const c=this._domConverter.viewToDom(r,document);return this._htmlWriter.getHtml(c)}toView(r){const c=this._toDom(r);return this._domConverter.domToView(c)}_toDom(r){const c=this._domParser.parseFromString(r,"text/html"),p=c.createDocumentFragment(),v=c.body.childNodes;for(;v.length>0;)p.appendChild(v[0]);return p}}class H2{constructor(r){this.editor=r,this._components=new Map}*names(){for(const r of this._components.values())yield r.originalName}add(r,c){if(this.has(r))throw new En.b("componentfactory-item-exists: The item already exists in the component factory.",this,{name:r});this._components.set(fu(r),{callback:c,originalName:r})}create(r){if(!this.has(r))throw new En.b("componentfactory-item-missing: The required component is not registered in the factory.",this,{name:r});return this._components.get(fu(r)).callback(this.editor.locale)}has(r){return this._components.has(fu(r))}}function fu(b){return String(b).toLowerCase()}class ws{constructor(){this.set("isFocused",!1),this.set("focusedElement",null),this._elements=new Set,this._nextEventLoopTimeout=null}add(r){if(this._elements.has(r))throw new En.b("focusTracker-add-element-already-exist",this);this.listenTo(r,"focus",()=>this._focus(r),{useCapture:!0}),this.listenTo(r,"blur",()=>this._blur(),{useCapture:!0}),this._elements.add(r)}remove(r){r===this.focusedElement&&this._blur(r),this._elements.has(r)&&(this.stopListening(r),this._elements.delete(r))}destroy(){this.stopListening()}_focus(r){clearTimeout(this._nextEventLoopTimeout),this.focusedElement=r,this.isFocused=!0}_blur(){clearTimeout(this._nextEventLoopTimeout),this._nextEventLoopTimeout=setTimeout(()=>{this.focusedElement=null,this.isFocused=!1},0)}}Si(ws,gi),Si(ws,Ut);class dc{constructor(r){this.editor=r,this.componentFactory=new H2(r),this.focusTracker=new ws,this._editableElementsMap=new Map,this.listenTo(r.editing.view.document,"layoutChanged",()=>this.update())}get element(){return null}update(){this.fire("update")}destroy(){this.stopListening(),this.focusTracker.destroy();for(const r of this._editableElementsMap.values())r.ckeditorInstance=null;this._editableElementsMap=new Map}setEditableElement(r,c){this._editableElementsMap.set(r,c),c.ckeditorInstance||(c.ckeditorInstance=this.editor)}getEditableElement(r="main"){return this._editableElementsMap.get(r)}getEditableElementsNames(){return this._editableElementsMap.keys()}get _editableElements(){return console.warn("editor-ui-deprecated-editable-elements: The EditorUI#_editableElements property has been deprecated and will be removed in the near future.",{editorUI:this}),this._editableElementsMap}}Si(dc,Fo),u(13);const hu=new WeakMap;function D_(b){const{view:r,element:c,text:p,isDirectHost:v=!0}=b,Z=r.document;hu.has(Z)||(hu.set(Z,new Map),Z.registerPostFixer(S=>z2(Z,S))),hu.get(Z).set(c,{text:p,isDirectHost:v}),r.change(S=>z2(Z,S))}function z2(b,r){const c=hu.get(b);let p=!1;for(const[v,Z]of c)V1(r,v,Z)&&(p=!0);return p}function V1(b,r,c){const{text:p,isDirectHost:v}=c,Z=v?r:function(I){if(1===I.childCount){const V=I.getChild(0);if(V.is("element")&&!V.is("uiElement"))return V}return null}(r);let S=!1;return!!Z&&(c.hostElement=Z,Z.getAttribute("data-placeholder")!==p&&(b.setAttribute("data-placeholder",p,Z),S=!0),function(I){if(!I.isAttached())return!1;const V=!Array.from(I.getChildren()).some(xt=>!xt.is("uiElement")),it=I.document;if(!it.isFocused&&V)return!0;const dt=it.selection.anchor;return!(!V||!dt||dt.parent===I)}(Z)?(I=b,!(V=Z).hasClass("ck-placeholder")&&(I.addClass("ck-placeholder",V),!0)&&(S=!0)):function Y2(b,r){return!!r.hasClass("ck-placeholder")&&(b.removeClass("ck-placeholder",r),!0)}(b,Z)&&(S=!0),S);var I,V}class mg{constructor(){this._replacedElements=[]}replace(r,c){this._replacedElements.push({element:r,newElement:c}),r.style.display="none",c&&r.parentNode.insertBefore(c,r.nextSibling)}restore(){this._replacedElements.forEach(({element:r,newElement:c})=>{r.style.display="",c&&c.remove()}),this._replacedElements=[]}}class P_ extends dc{constructor(r,c){var p;super(r),this.view=c,this._toolbarConfig=(p=r.config.get("toolbar"),Array.isArray(p)?{items:p}:p?Object.assign({items:[]},p):{items:[]}),this._elementReplacer=new mg}get element(){return this.view.element}init(r){const p=this.view,v=this.editor.editing.view,Z=p.editable,S=v.document.getRoot();Z.name=S.rootName,p.render();const I=Z.element;this.setEditableElement(Z.name,I),this.focusTracker.add(I),p.editable.bind("isFocused").to(this.focusTracker),v.attachDomRoot(I),r&&this._elementReplacer.replace(r,this.element),this._initPlaceholder(),this._initToolbar(),this.fire("ready")}destroy(){const r=this.view,c=this.editor.editing.view;this._elementReplacer.restore(),c.detachDomRoot(r.editable.name),r.destroy(),super.destroy()}_initToolbar(){const r=this.editor,c=this.view,p=r.editing.view;c.stickyPanel.bind("isActive").to(this.focusTracker,"isFocused"),c.stickyPanel.limiterElement=c.element,this._toolbarConfig.viewportTopOffset&&(c.stickyPanel.viewportTopOffset=this._toolbarConfig.viewportTopOffset),c.toolbar.fillFromConfig(this._toolbarConfig.items,this.componentFactory),function({origin:v,originKeystrokeHandler:Z,originFocusTracker:S,toolbar:I,beforeFocus:V,afterBlur:it}){S.add(I.element),Z.set("Alt+F10",(dt,xt)=>{S.isFocused&&!I.focusTracker.isFocused&&(V&&V(),I.focus(),xt())}),I.keystrokes.set("Esc",(dt,xt)=>{I.focusTracker.isFocused&&(v.focus(),it&&it(),xt())})}({origin:p,originFocusTracker:this.focusTracker,originKeystrokeHandler:r.keystrokes,toolbar:c.toolbar})}_initPlaceholder(){const r=this.editor,c=r.editing.view,p=c.document.getRoot(),v=r.sourceElement,Z=r.config.get("placeholder")||v&&"textarea"===v.tagName.toLowerCase()&&v.getAttribute("placeholder");Z&&D_({view:c,element:p,text:Z,isDirectHost:!1})}}class Zl extends Ra{constructor(r=[]){super(r,{idProperty:"viewUid"}),this.on("add",(c,p,v)=>{this._renderViewIntoCollectionParent(p,v)}),this.on("remove",(c,p)=>{p.element&&this._parentElement&&p.element.remove()}),this._parentElement=null}destroy(){this.map(r=>r.destroy())}setParent(r){this._parentElement=r;for(const c of this)this._renderViewIntoCollectionParent(c)}delegate(...r){if(!r.length||!r.every(c=>"string"==typeof c))throw new En.b("ui-viewcollection-delegate-wrong-events: All event names must be strings.",this);return{to:c=>{for(const p of this)for(const v of r)p.delegate(v).to(c);this.on("add",(p,v)=>{for(const Z of r)v.delegate(Z).to(c)}),this.on("remove",(p,v)=>{for(const Z of r)v.stopDelegating(Z,c)})}}}_renderViewIntoCollectionParent(r,c){r.isRendered||r.render(),r.element&&this._parentElement&&this._parentElement.insertBefore(r.element,this._parentElement.children[c])}}class Gu{constructor(r){Object.assign(this,ro(k_(r))),this._isRendered=!1,this._revertData=null}render(){const r=this._renderNode({intoFragment:!0});return this._isRendered=!0,r}apply(r){return this._revertData={children:[],bindings:[],attributes:{}},this._renderNode({node:r,isApplying:!0,revertData:this._revertData}),r}revert(r){if(!this._revertData)throw new En.b("ui-template-revert-not-applied: Attempting to revert a template which has not been applied yet.",[this,r]);this._revertTemplateFromNode(r,this._revertData)}*getViews(){yield*function*r(c){if(c.children)for(const p of c.children)Rr(p)?yield p:ym(p)&&(yield*r(p))}(this)}static bind(r,c){return{to:(p,v)=>new xm({eventNameOrFunction:p,attribute:p,observable:r,emitter:c,callback:v}),if:(p,v,Z)=>new oh({observable:r,emitter:c,attribute:p,valueIfTrue:v,callback:Z})}}static extend(r,c){if(r._isRendered)throw new En.b("template-extend-render: Attempting to extend a template which has already been rendered.",[this,r]);!function p(v,Z){if(Z.attributes&&(v.attributes||(v.attributes={}),m1(v.attributes,Z.attributes)),Z.eventListeners&&(v.eventListeners||(v.eventListeners={}),m1(v.eventListeners,Z.eventListeners)),Z.text&&v.text.push(...Z.text),Z.children&&Z.children.length){if(v.children.length!=Z.children.length)throw new En.b("ui-template-extend-children-mismatch: The number of children in extended definition does not match.",v);let S=0;for(const I of Z.children)p(v.children[S++],I)}}(r,ro(k_(c)))}_renderNode(r){let c;if(c=r.node?this.tag&&this.text:this.tag?this.text:!this.text,c)throw new En.b('ui-template-wrong-syntax: Node definition must have either "tag" or "text" when rendering a new Node.',this);return this.text?this._renderText(r):this._renderElement(r)}_renderElement(r){let c=r.node;return c||(c=r.node=document.createElementNS(this.ns||"http://www.w3.org/1999/xhtml",this.tag)),this._renderAttributes(r),this._renderElementChildren(r),this._setUpListeners(r),c}_renderText(r){let c=r.node;return c?r.revertData.text=c.textContent:c=r.node=document.createTextNode(""),Lp(this.text)?this._bindToObservable({schema:this.text,updater:B2(c),data:r}):c.textContent=this.text.join(""),c}_renderAttributes(r){let c,p,v,Z;if(!this.attributes)return;const S=r.node,I=r.revertData;for(c in this.attributes)if(v=S.getAttribute(c),p=this.attributes[c],I&&(I.attributes[c]=v),Z=Ht(p[0])&&p[0].ns?p[0].ns:null,Lp(p)){const V=Z?p[0].value:p;I&&rh(c)&&V.unshift(v),this._bindToObservable({schema:V,updater:J2(S,c,Z),data:r})}else"style"==c&&"string"!=typeof p[0]?this._renderStyleAttribute(p[0],r):(I&&v&&rh(c)&&p.unshift(v),p=p.map(V=>V&&V.value||V).reduce((V,it)=>V.concat(it),[]).reduce(Ir,""),wl(p)||S.setAttributeNS(Z,c,p))}_renderStyleAttribute(r,c){const p=c.node;for(const v in r){const Z=r[v];Lp(Z)?this._bindToObservable({schema:[Z],updater:Hd(p,v),data:c}):p.style[v]=Z}}_renderElementChildren(r){const c=r.node,p=r.intoFragment?document.createDocumentFragment():c,v=r.isApplying;let Z=0;for(const S of this.children)if(G2(S)){if(!v){S.setParent(c);for(const I of S)p.appendChild(I.element)}}else if(Rr(S))v||(S.isRendered||S.render(),p.appendChild(S.element));else if(fl(S))p.appendChild(S);else if(v){const I={children:[],bindings:[],attributes:{}};r.revertData.children.push(I),S._renderNode({node:p.childNodes[Z++],isApplying:!0,revertData:I})}else p.appendChild(S.render());r.intoFragment&&c.appendChild(p)}_setUpListeners(r){if(this.eventListeners)for(const c in this.eventListeners){const p=this.eventListeners[c].map(v=>{const[Z,S]=c.split("@");return v.activateDomEventListener(Z,S,r)});r.revertData&&r.revertData.bindings.push(p)}}_bindToObservable({schema:r,updater:c,data:p}){const v=p.revertData;V2(r,c,p);const Z=r.filter(S=>!wl(S)).filter(S=>S.observable).map(S=>S.activateAttributeListener(r,c,p));v&&v.bindings.push(Z)}_revertTemplateFromNode(r,c){for(const p of c.bindings)for(const v of p)v();if(c.text)r.textContent=c.text;else{for(const p in c.attributes){const v=c.attributes[p];null===v?r.removeAttribute(p):r.setAttribute(p,v)}for(let p=0;pV2(r,c,p);return this.emitter.listenTo(this.observable,"change:"+this.attribute,v),()=>{this.emitter.stopListening(this.observable,"change:"+this.attribute,v)}}}class xm extends S_{activateDomEventListener(r,c,p){const v=(Z,S)=>{c&&!S.target.matches(c)||("function"==typeof this.eventNameOrFunction?this.eventNameOrFunction(S):this.observable.fire(this.eventNameOrFunction,S))};return this.emitter.listenTo(p.node,r,v),()=>{this.emitter.stopListening(p.node,r,v)}}}class oh extends S_{getValue(r){return!wl(super.getValue(r))&&(this.valueIfTrue||!0)}}function Lp(b){return!!b&&(b.value&&(b=b.value),Array.isArray(b)?b.some(Lp):b instanceof S_)}function V2(b,r,{node:c}){let p=(Z=c,b.map(S=>S instanceof S_?S.getValue(Z):S));var Z;p=1==b.length&&b[0]instanceof oh?p[0]:p.reduce(Ir,""),wl(p)?r.remove():r.set(p)}function B2(b){return{set(r){b.textContent=r},remove(){b.textContent=""}}}function J2(b,r,c){return{set(p){b.setAttributeNS(c,r,p)},remove(){b.removeAttributeNS(c,r)}}}function Hd(b,r){return{set(c){b.style[r]=c},remove(){b.style[r]=null}}}function k_(b){return Ar(b,r=>{if(r&&(r instanceof S_||ym(r)||Rr(r)||G2(r)))return r})}function ro(b){if("string"==typeof b?b=function(r){return{text:[r]}}(b):b.text&&function(r){Array.isArray(r.text)||(r.text=[r.text])}(b),b.on&&(b.eventListeners=function(r){for(const c in r)ah(r,c);return r}(b.on),delete b.on),!b.text){b.attributes&&function(c){for(const p in c)c[p].value&&(c[p].value=[].concat(c[p].value)),ah(c,p)}(b.attributes);const r=[];if(b.children)if(G2(b.children))r.push(b.children);else for(const c of b.children)ym(c)||Rr(c)||fl(c)?r.push(c):r.push(new Gu(c));b.children=r}return b}function ah(b,r){Array.isArray(b[r])||(b[r]=[b[r]])}function Ir(b,r){return wl(r)?b:wl(b)?r:`${b} ${r}`}function m1(b,r){for(const c in r)b[c]?b[c].push(...r[c]):b[c]=r[c]}function wl(b){return!b&&0!==b}function Rr(b){return b instanceof Oo}function ym(b){return b instanceof Gu}function G2(b){return b instanceof Zl}function rh(b){return"class"==b||"style"==b}u(15);class Oo{constructor(r){this.element=null,this.isRendered=!1,this.locale=r,this.t=r&&r.t,this._viewCollections=new Ra,this._unboundChildren=this.createCollection(),this._viewCollections.on("add",(c,p)=>{p.locale=r}),this.decorate("render")}get bindTemplate(){return this._bindTemplate?this._bindTemplate:this._bindTemplate=Gu.bind(this,this)}createCollection(r){const c=new Zl(r);return this._viewCollections.add(c),c}registerChild(r){ta(r)||(r=[r]);for(const c of r)this._unboundChildren.add(c)}deregisterChild(r){ta(r)||(r=[r]);for(const c of r)this._unboundChildren.remove(c)}setTemplate(r){this.template=new Gu(r)}extendTemplate(r){Gu.extend(this.template,r)}render(){if(this.isRendered)throw new En.b("ui-view-render-already-rendered: This View has already been rendered.",this);this.template&&(this.element=this.template.render(),this.registerChild(this.template.getViews())),this.isRendered=!0}destroy(){this.stopListening(),this._viewCollections.map(r=>r.destroy()),this.template&&this.template._revertData&&this.template.revert(this.element)}}Si(Oo,gi),Si(Oo,Ut);var Q2=function(b){return"string"==typeof b||!yn(b)&&at(b)&&"[object String]"==Y(b)};class j2 extends Zl{constructor(r,c=[]){super(c),this.locale=r}attachToDom(){this._bodyCollectionContainer=new Gu({tag:"div",attributes:{class:["ck","ck-reset_all","ck-body","ck-rounded-corners"],dir:this.locale.uiLanguageDirection},children:this}).render();let r=document.querySelector(".ck-body-wrapper");r||(r=function(c,p,v={},Z=[]){const S=v&&v.xmlns,I=S?c.createElementNS(S,p):c.createElement(p);for(const V in v)I.setAttribute(V,v[V]);!Q2(Z)&&ta(Z)||(Z=[Z]);for(let V of Z)Q2(V)&&(V=c.createTextNode(V)),I.appendChild(V);return I}(document,"div",{class:"ck-body-wrapper"}),document.body.appendChild(r)),r.appendChild(this._bodyCollectionContainer)}detachFromDom(){super.destroy(),this._bodyCollectionContainer&&this._bodyCollectionContainer.remove();const r=document.querySelector(".ck-body-wrapper");r&&0==r.childElementCount&&r.remove()}}u(17);class A3 extends Oo{constructor(r){super(r),this.body=new j2(r)}render(){super.render(),this.body.attachToDom()}destroy(){return this.body.detachFromDom(),super.destroy()}}u(19);class Ml extends Oo{constructor(r){super(r),this.set("text"),this.set("for"),this.id="ck-editor__label_"+Pa();const c=this.bindTemplate;this.setTemplate({tag:"label",attributes:{class:["ck","ck-label"],id:this.id,for:c.to("for")},children:[{text:c.to("text")}]})}}class B1 extends A3{constructor(r){super(r),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:r.uiLanguageDirection,lang:r.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 r=this.t,c=new Ml;return c.text=r("Rich Text Editor"),c.extendTemplate({attributes:{class:"ck-voice-label"}}),c}}class O_ extends Oo{constructor(r,c,p){super(r),this.setTemplate({tag:"div",attributes:{class:["ck","ck-content","ck-editor__editable","ck-rounded-corners"],lang:r.contentLanguage,dir:r.contentLanguageDirection}}),this.name=null,this.set("isFocused",!1),this._editableElement=p,this._hasExternalElement=!!this._editableElement,this._editingView=c}render(){super.render(),this._hasExternalElement?this.template.apply(this.element=this._editableElement):this._editableElement=this.element,this.on("change:isFocused",()=>this._updateIsFocusedClasses()),this._updateIsFocusedClasses()}destroy(){this._hasExternalElement&&this.template.revert(this._editableElement),super.destroy()}_updateIsFocusedClasses(){const r=this._editingView;function c(p){r.change(v=>{const Z=r.document.getRoot(p.name);v.addClass(p.isFocused?"ck-focused":"ck-blurred",Z),v.removeClass(p.isFocused?"ck-blurred":"ck-focused",Z)})}r.isRenderingInProgress?function p(v){r.once("change:isRenderingInProgress",(Z,S,I)=>{I?p(v):c(v)})}(this):c(this)}}class sh extends O_{constructor(r,c,p){super(r,c,p),this.extendTemplate({attributes:{role:"textbox",class:"ck-editor__editable_inline"}})}render(){super.render();const r=this._editingView,c=this.t;r.change(p=>{const v=r.document.getRoot(this.name);p.setAttribute("aria-label",c("Rich Text Editor, %0",[this.name]),v)})}}function J1(b){return r=>r+b}u(21);const gd=J1("px");class _g extends Oo{constructor(r){super(r);const c=this.bindTemplate;this.set("isActive",!1),this.set("isSticky",!1),this.set("limiterElement",null),this.set("limiterBottomOffset",50),this.set("viewportTopOffset",0),this.set("_marginLeft",null),this.set("_isStickyToTheLimiter",!1),this.set("_hasViewportTopOffset",!1),this.content=this.createCollection(),this._contentPanelPlaceholder=new Gu({tag:"div",attributes:{class:["ck","ck-sticky-panel__placeholder"],style:{display:c.to("isSticky",p=>p?"block":"none"),height:c.to("isSticky",p=>p?gd(this._panelRect.height):null)}}}).render(),this._contentPanel=new Gu({tag:"div",attributes:{class:["ck","ck-sticky-panel__content",c.if("isSticky","ck-sticky-panel__content_sticky"),c.if("_isStickyToTheLimiter","ck-sticky-panel__content_sticky_bottom-limit")],style:{width:c.to("isSticky",p=>p?gd(this._contentPanelPlaceholder.getBoundingClientRect().width):null),top:c.to("_hasViewportTopOffset",p=>p?gd(this.viewportTopOffset):null),bottom:c.to("_isStickyToTheLimiter",p=>p?gd(this.limiterBottomOffset):null),marginLeft:c.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(pt.window,"scroll",()=>{this._checkIfShouldBeSticky()}),this.listenTo(this,"change:isActive",()=>{this._checkIfShouldBeSticky()})}_checkIfShouldBeSticky(){const r=this._panelRect=this._contentPanel.getBoundingClientRect();let c;this.limiterElement?(c=this._limiterRect=this.limiterElement.getBoundingClientRect(),this.isSticky=this.isActive&&c.top{this[c](),S()})}}get first(){return this.focusables.find(f1)||null}get last(){return this.focusables.filter(f1).slice(-1)[0]||null}get next(){return this._getFocusableItem(1)}get previous(){return this._getFocusableItem(-1)}get current(){let r=null;return null===this.focusTracker.focusedElement?null:(this.focusables.find((c,p)=>{const v=c.element===this.focusTracker.focusedElement;return v&&(r=p),v}),r)}focusFirst(){this._focus(this.first)}focusLast(){this._focus(this.last)}focusNext(){this._focus(this.next)}focusPrevious(){this._focus(this.previous)}_focus(r){r&&r.focus()}_getFocusableItem(r){const c=this.current,p=this.focusables.length;if(!p)return null;if(null===c)return this[1===r?"first":"last"];let v=(c+p+r)%p;do{const Z=this.focusables.get(v);if(f1(Z))return Z;v=(v+p+r)%p}while(v!==c);return null}}function f1(b){return!(!b.focus||"none"==pt.window.getComputedStyle(b.element).display)}class G1 extends Oo{constructor(r){super(r),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__separator"]}})}}class xr{constructor(r,c){xr._observerInstance||xr._createObserver(),this._element=r,this._callback=c,xr._addElementCallback(r,c),xr._observerInstance.observe(r)}destroy(){xr._deleteElementCallback(this._element,this._callback)}static _addElementCallback(r,c){xr._elementCallbacks||(xr._elementCallbacks=new Map);let p=xr._elementCallbacks.get(r);p||(p=new Set,xr._elementCallbacks.set(r,p)),p.add(c)}static _deleteElementCallback(r,c){const p=xr._getElementCallbacks(r);p&&(p.delete(c),p.size||(xr._elementCallbacks.delete(r),xr._observerInstance.unobserve(r))),xr._elementCallbacks&&!xr._elementCallbacks.size&&(xr._observerInstance=null,xr._elementCallbacks=null)}static _getElementCallbacks(r){return xr._elementCallbacks?xr._elementCallbacks.get(r):null}static _createObserver(){let r;r="function"==typeof pt.window.ResizeObserver?pt.window.ResizeObserver:Q1,xr._observerInstance=new r(c=>{for(const p of c){if(!p.target.offsetParent)continue;const v=xr._getElementCallbacks(p.target);if(v)for(const Z of v)Z(p)}})}}xr._observerInstance=null,xr._elementCallbacks=null;class Q1{constructor(r){this._callback=r,this._elements=new Set,this._previousRects=new Map,this._periodicCheckTimeout=null}observe(r){this._elements.add(r),this._checkElementRectsAndExecuteCallback(),1===this._elements.size&&this._startPeriodicCheck()}unobserve(r){this._elements.delete(r),this._previousRects.delete(r),this._elements.size||this._stopPeriodicCheck()}_startPeriodicCheck(){const r=()=>{this._checkElementRectsAndExecuteCallback(),this._periodicCheckTimeout=setTimeout(r,100)};this.listenTo(pt.window,"resize",()=>{this._checkElementRectsAndExecuteCallback()}),this._periodicCheckTimeout=setTimeout(r,100)}_stopPeriodicCheck(){clearTimeout(this._periodicCheckTimeout),this.stopListening(),this._previousRects.clear()}_checkElementRectsAndExecuteCallback(){const r=[];for(const c of this._elements)this._hasRectChanged(c)&&r.push({target:c,contentRect:this._previousRects.get(c)});r.length&&this._callback(r)}_hasRectChanged(r){if(!r.ownerDocument.body.contains(r))return!1;const c=new cr(r),p=this._previousRects.get(r),v=!p||!p.isEqual(c);return this._previousRects.set(r,c),v}}Si(Q1,gi);class Tm extends Oo{constructor(r){super(r);const c=this.bindTemplate;this.set("isVisible",!1),this.set("position","se"),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-dropdown__panel",c.to("position",p=>"ck-dropdown__panel_"+p),c.if("isVisible","ck-dropdown__panel-visible")]},children:this.children,on:{selectstart:c.to(p=>p.preventDefault())}})}focus(){this.children.length&&this.children.first.focus()}focusLast(){if(this.children.length){const r=this.children.last;"function"==typeof r.focusLast?r.focusLast():r.focus()}}}function L_({element:b,target:r,positions:c,limiter:p,fitInViewport:v}){Kt(r)&&(r=r()),Kt(p)&&(p=p());const Z=(xt=b)&&xt.parentNode?xt.offsetParent===pt.document.body?null:xt.offsetParent:null,S=new cr(b),I=new cr(r);var xt;let V,it;[it,V]=(p||v)&&function(le,Ie){const{elementRect:rn,viewportRect:vn}=Ie,wn=rn.getArea(),qn=function(mi,{targetRect:xi,elementRect:Vi,limiterRect:Po,viewportRect:Yr}){const Ba=[],$s=Vi.getArea();for(const Za of mi){const jc=q_(Za,xi,Vi);if(!jc)continue;const[kl,Ks]=jc;let id=0,Zd=0;if(Po)if(Yr){const iu=Po.getIntersection(Yr);iu&&(id=iu.getIntersectionArea(Ks))}else id=Po.getIntersectionArea(Ks);Yr&&(Zd=Yr.getIntersectionArea(Ks));const nu={positionName:kl,positionRect:Ks,limiterIntersectArea:id,viewportIntersectArea:Zd};if(id===$s)return[nu];Ba.push(nu)}return Ba}(le,Ie);if(vn){const mi=h1(qn.filter(({viewportIntersectArea:xi})=>xi===wn),wn);if(mi)return mi}return h1(qn,wn)}(c,{targetRect:I,elementRect:S,limiterRect:p&&new cr(p).getVisible(),viewportRect:v&&new cr(pt.window)})||q_(c[0],I,S);let dt=W2(V);return Z&&(dt=function({left:xt,top:le},Ie){const rn=W2(new cr(Ie)),vn=Iu(Ie);return xt-=rn.left,le-=rn.top,xt+=Ie.scrollLeft,le+=Ie.scrollTop,{left:xt-=vn.left,top:le-=vn.top}}(dt,Z)),{left:dt.left,top:dt.top,name:it}}function q_(b,r,c){const p=b(r,c);if(!p)return null;const{left:v,top:Z,name:S}=p;return[S,c.clone().moveTo(v,Z)]}function h1(b,r){let c,p,v=0;for(const{positionName:Z,positionRect:S,limiterIntersectArea:I,viewportIntersectArea:V}of b){if(I===r)return[Z,S];const it=V**2+I**2;it>v&&(v=it,c=S,p=Z)}return c?[p,c]:null}function W2({left:b,top:r}){const{scrollX:c,scrollY:p}=pt.window;return{left:b+c,top:r+p}}u(23);class g1 extends Oo{constructor(r,c,p){super(r);const v=this.bindTemplate;this.buttonView=c,this.panelView=p,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("class"),this.set("id"),this.set("panelPosition","auto"),this.keystrokes=new _u,this.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown",v.to("class"),v.if("isEnabled","ck-disabled",Z=>!Z)],id:v.to("id"),"aria-describedby":v.to("ariaDescribedById")},children:[c,p]}),c.extendTemplate({attributes:{class:["ck-dropdown__button"]}})}render(){super.render(),this.listenTo(this.buttonView,"open",()=>{this.isOpen=!this.isOpen}),this.panelView.bind("isVisible").to(this,"isOpen"),this.on("change:isOpen",()=>{this.isOpen&&(this.panelView.position="auto"===this.panelPosition?g1._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions}).name:this.panelPosition)}),this.keystrokes.listenTo(this.element);const r=(c,p)=>{this.isOpen&&(this.buttonView.focus(),this.isOpen=!1,p())};this.keystrokes.set("arrowdown",(c,p)=>{this.buttonView.isEnabled&&!this.isOpen&&(this.isOpen=!0,p())}),this.keystrokes.set("arrowright",(c,p)=>{this.isOpen&&p()}),this.keystrokes.set("arrowleft",r),this.keystrokes.set("esc",r)}focus(){this.buttonView.focus()}get _panelPositions(){const{southEast:r,southWest:c,northEast:p,northWest:v}=g1.defaultPanelPositions;return"ltr"===this.locale.uiLanguageDirection?[r,c,p,v]:[c,r,v,p]}}g1.defaultPanelPositions={southEast:b=>({top:b.bottom,left:b.left,name:"se"}),southWest:(b,r)=>({top:b.bottom,left:b.left-r.width+b.width,name:"sw"}),northEast:(b,r)=>({top:b.top-r.height,left:b.left,name:"ne"}),northWest:(b,r)=>({top:b.bottom-r.height,left:b.left-r.width+b.width,name:"nw"})},g1._getOptimalPosition=L_,u(25);class v1 extends Oo{constructor(){super();const r=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:r.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 r=(new DOMParser).parseFromString(this.content.trim(),"image/svg+xml").querySelector("svg"),c=r.getAttribute("viewBox");for(c&&(this.viewBox=c),this.element.innerHTML="";r.childNodes.length>0;)this.element.appendChild(r.childNodes[0])}}_colorFillPaths(){this.fillColor&&this.element.querySelectorAll(".ck-icon__fill").forEach(r=>{r.style.fill=this.fillColor})}}u(27);class ch extends Oo{constructor(r){super(r),this.set("text",""),this.set("position","s");const c=this.bindTemplate;this.setTemplate({tag:"span",attributes:{class:["ck","ck-tooltip",c.to("position",p=>"ck-tooltip_"+p),c.if("text","ck-hidden",p=>!p.trim())]},children:[{tag:"span",attributes:{class:["ck","ck-tooltip__text"]},children:[{text:c.to("text")}]}]})}}u(29);class Hr extends Oo{constructor(r){super(r);const c=this.bindTemplate,p=Pa();this.set("class"),this.set("labelStyle"),this.set("icon"),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isVisible",!0),this.set("isToggleable",!1),this.set("keystroke"),this.set("label"),this.set("tabindex",-1),this.set("tooltip"),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.set("withKeystroke",!1),this.children=this.createCollection(),this.tooltipView=this._createTooltipView(),this.labelView=this._createLabelView(p),this.iconView=new v1,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",c.to("class"),c.if("isEnabled","ck-disabled",v=>!v),c.if("isVisible","ck-hidden",v=>!v),c.to("isOn",v=>v?"ck-on":"ck-off"),c.if("withText","ck-button_with-text"),c.if("withKeystroke","ck-button_with-keystroke")],type:c.to("type",v=>v||"button"),tabindex:c.to("tabindex"),"aria-labelledby":"ck-editor__aria-label_"+p,"aria-disabled":c.if("isEnabled",!0,v=>!v),"aria-pressed":c.to("isOn",v=>!!this.isToggleable&&String(v))},children:this.children,on:{mousedown:c.to(v=>{v.preventDefault()}),click:c.to(v=>{this.isEnabled?this.fire("execute"):v.preventDefault()})}})}render(){super.render(),this.icon&&(this.iconView.bind("content").to(this,"icon"),this.children.add(this.iconView)),this.children.add(this.tooltipView),this.children.add(this.labelView),this.withKeystroke&&this.children.add(this.keystrokeView)}focus(){this.element.focus()}_createTooltipView(){const r=new ch;return r.bind("text").to(this,"_tooltipString"),r.bind("position").to(this,"tooltipPosition"),r}_createLabelView(r){const c=new Oo;return c.setTemplate({tag:"span",attributes:{class:["ck","ck-button__label"],style:this.bindTemplate.to("labelStyle"),id:"ck-editor__aria-label_"+r},children:[{text:this.bindTemplate.to("label")}]}),c}_createKeystrokeView(){const r=new Oo;return r.setTemplate({tag:"span",attributes:{class:["ck","ck-button__keystroke"]},children:[{text:this.bindTemplate.to("keystroke",c=>cd(c))}]}),r}_getTooltipString(r,c,p){return r?"string"==typeof r?r:(p&&(p=cd(p)),r instanceof Function?r(c,p):`${c}${p?` (${p})`:""}`):""}}var j1='';class vd extends Hr{constructor(r){super(r),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{"aria-haspopup":!0}}),this.delegate("execute").to(this,"open")}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){const r=new v1;return r.content=j1,r.extendTemplate({attributes:{class:"ck-dropdown__arrow"}}),r}}u(31);class E_ extends Oo{constructor(){super(),this.items=this.createCollection(),this.focusTracker=new ws,this.keystrokes=new _u,this._focusCycler=new _1({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 r of this.items)this.focusTracker.add(r.element);this.items.on("add",(r,c)=>{this.focusTracker.add(c.element)}),this.items.on("remove",(r,c)=>{this.focusTracker.remove(c.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}}class $2 extends Oo{constructor(r){super(r),this.children=this.createCollection(),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__item"]},children:this.children})}focus(){this.children.first.focus()}}class fg extends Oo{constructor(r){super(r),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__separator"]}})}}u(33);class qp extends Hr{constructor(r){super(r),this.isToggleable=!0,this.toggleSwitchView=this._createToggleView(),this.extendTemplate({attributes:{class:"ck-switchbutton"}})}render(){super.render(),this.children.add(this.toggleSwitchView)}_createToggleView(){const r=new Oo;return r.setTemplate({tag:"span",attributes:{class:["ck","ck-button__toggle"]},children:[{tag:"span",attributes:{class:["ck","ck-button__toggle__inner"]}}]}),r}}function Am({emitter:b,activator:r,callback:c,contextElements:p}){b.listenTo(document,"mousedown",(v,{target:Z})=>{if(r()){for(const S of p)if(S.contains(Z))return;c()}})}function Qu(b,r=vd){const c=new r(b),p=new Tm(b),v=new g1(b,c,p);return c.bind("isEnabled").to(v),c instanceof vd?c.bind("isOn").to(v,"isOpen"):c.arrowView.bind("isOn").to(v,"isOpen"),(S=Z=v).on("render",()=>{Am({emitter:S,activator:()=>S.isOpen,callback:()=>{S.isOpen=!1},contextElements:[S.element]})}),function(S){S.on("execute",I=>{I.source instanceof qp||(S.isOpen=!1)})}(Z),function(S){S.keystrokes.set("arrowdown",(I,V)=>{S.isOpen&&(S.panelView.focus(),V())}),S.keystrokes.set("arrowup",(I,V)=>{S.isOpen&&(S.panelView.focusLast(),V())})}(Z),v;var Z,S}function lh(b,r){const c=b.locale,p=b.listView=new E_(c);p.items.bindTo(r).using(({type:v,model:Z})=>{if("separator"===v)return new fg(c);if("button"===v||"switchbutton"===v){const S=new $2(c);let I;return I="button"===v?new Hr(c):new qp(c),I.bind(...Object.keys(Z)).to(Z),I.delegate("execute").to(S),S.children.add(I),S}}),b.panelView.children.add(p),p.items.delegate("execute").to(b)}u(35),u(37),u(39);class Um extends Oo{constructor(r,c){super(r);const p=this.bindTemplate,v=this.t;var Z;this.options=c||{},this.set("ariaLabel",v("Editor toolbar")),this.set("maxWidth","auto"),this.items=this.createCollection(),this.focusTracker=new ws,this.keystrokes=new _u,this.set("class"),this.set("isCompact",!1),this.itemsView=new hg(r),this.children=this.createCollection(),this.children.add(this.itemsView),this.focusables=this.createCollection(),this._focusCycler=new _1({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",p.to("class"),p.if("isCompact","ck-toolbar_compact")],role:"toolbar","aria-label":p.to("ariaLabel"),style:{maxWidth:p.to("maxWidth")}},children:this.children,on:{mousedown:(Z=this,Z.bindTemplate.to(S=>{S.target===Z.element&&S.preventDefault()}))}}),this._behavior=this.options.shouldGroupWhenFull?new K2(this):new Zm(this)}render(){super.render();for(const r of this.items)this.focusTracker.add(r.element);this.items.on("add",(r,c)=>{this.focusTracker.add(c.element)}),this.items.on("remove",(r,c)=>{this.focusTracker.remove(c.element)}),this.keystrokes.listenTo(this.element),this._behavior.render(this)}destroy(){return this._behavior.destroy(),super.destroy()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}fillFromConfig(r,c){this.items.addMany(r.map(p=>"|"==p?new G1:c.has(p)?c.create(p):void console.warn(Object(En.a)("toolbarview-item-unavailable: The requested toolbar item is unavailable."),{name:p})).filter(p=>void 0!==p))}}class hg extends Oo{constructor(r){super(r),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar__items"]},children:this.children})}}class Zm{constructor(r){const c=r.bindTemplate;r.set("isVertical",!1),r.itemsView.children.bindTo(r.items).using(p=>p),r.focusables.bindTo(r.items).using(p=>p),r.extendTemplate({attributes:{class:[c.if("isVertical","ck-toolbar_vertical")]}})}render(){}destroy(){}}class K2{constructor(r){this.viewChildren=r.children,this.viewFocusables=r.focusables,this.viewItemsView=r.itemsView,this.viewFocusTracker=r.focusTracker,this.viewLocale=r.locale,this.ungroupedItems=r.createCollection(),this.groupedItems=r.createCollection(),this.groupedItemsDropdown=this._createGroupedItemsDropdown(),this.resizeObserver=null,this.cachedPadding=null,this.shouldUpdateGroupingOnNextResize=!1,r.itemsView.children.bindTo(this.ungroupedItems).using(c=>c),this.ungroupedItems.on("add",this._updateFocusCycleableItems.bind(this)),this.ungroupedItems.on("remove",this._updateFocusCycleableItems.bind(this)),r.children.on("add",this._updateFocusCycleableItems.bind(this)),r.children.on("remove",this._updateFocusCycleableItems.bind(this)),r.items.on("change",(c,p)=>{const v=p.index;for(const Z of p.removed)v>=this.ungroupedItems.length?this.groupedItems.remove(Z):this.ungroupedItems.remove(Z);for(let Z=v;Zthis.ungroupedItems.length?this.groupedItems.add(S,Z-this.ungroupedItems.length):this.ungroupedItems.add(S,Z)}this._updateGrouping()}),r.extendTemplate({attributes:{class:["ck-toolbar_grouping"]}})}render(r){this.viewElement=r.element,this._enableGroupingOnResize(),this._enableGroupingOnMaxWidthChange(r)}destroy(){this.groupedItemsDropdown.destroy(),this.resizeObserver.destroy()}_updateGrouping(){if(!this.viewElement.ownerDocument.body.contains(this.viewElement))return;if(!this.viewElement.offsetParent)return void(this.shouldUpdateGroupingOnNextResize=!0);let r;for(;this._areItemsOverflowing;)this._groupLastItem(),r=!0;if(!r&&this.groupedItems.length){for(;this.groupedItems.length&&!this._areItemsOverflowing;)this._ungroupFirstItem();this._areItemsOverflowing&&this._groupLastItem()}}get _areItemsOverflowing(){if(!this.ungroupedItems.length)return!1;const r=this.viewElement,c=this.viewLocale.uiLanguageDirection,p=new cr(r.lastChild),v=new cr(r);if(!this.cachedPadding){const Z=pt.window.getComputedStyle(r);this.cachedPadding=Number.parseInt(Z["ltr"===c?"paddingRight":"paddingLeft"])}return"ltr"===c?p.right>v.right-this.cachedPadding:p.left{r&&r===c.contentRect.width&&!this.shouldUpdateGroupingOnNextResize||(this.shouldUpdateGroupingOnNextResize=!1,this._updateGrouping(),r=c.contentRect.width)}),this._updateGrouping()}_enableGroupingOnMaxWidthChange(r){r.on("change:maxWidth",()=>{this._updateGrouping()})}_groupLastItem(){this.groupedItems.length||(this.viewChildren.add(new G1),this.viewChildren.add(this.groupedItemsDropdown),this.viewFocusTracker.add(this.groupedItemsDropdown.element)),this.groupedItems.add(this.ungroupedItems.remove(this.ungroupedItems.last),0)}_ungroupFirstItem(){this.ungroupedItems.add(this.groupedItems.remove(this.groupedItems.first)),this.groupedItems.length||(this.viewChildren.remove(this.groupedItemsDropdown),this.viewChildren.remove(this.viewChildren.last),this.viewFocusTracker.remove(this.groupedItemsDropdown.element))}_createGroupedItemsDropdown(){const r=this.viewLocale,c=r.t,p=Qu(r);return p.class="ck-toolbar__grouped-dropdown",p.panelPosition="ltr"===r.uiLanguageDirection?"sw":"se",function(v,Z){const S=v.locale,I=S.t,V=v.toolbarView=new Um(S);V.set("ariaLabel",I("Dropdown toolbar")),v.extendTemplate({attributes:{class:["ck-toolbar-dropdown"]}}),[].map(it=>V.items.add(it)),v.panelView.children.add(V),V.items.delegate("execute").to(v)}(p),p.buttonView.set({label:c("Show more items"),tooltip:!0,icon:''}),p.toolbarView.items.bindTo(this.groupedItems).using(v=>v),p}_updateFocusCycleableItems(){this.viewFocusables.clear(),this.ungroupedItems.map(r=>{this.viewFocusables.add(r)}),this.groupedItems.length&&this.viewFocusables.add(this.groupedItemsDropdown)}}u(41);class N_ extends B1{constructor(r,c,p={}){super(r),this.stickyPanel=new _g(r),this.toolbar=new Um(r,{shouldGroupWhenFull:p.shouldToolbarGroupWhenFull}),this.editable=new sh(r,c)}render(){super.render(),this.stickyPanel.content.add(this.toolbar),this.top.add(this.stickyPanel),this.main.add(this.editable)}}class wm extends Op{constructor(r,c){super(c),Ur(r)&&(this.sourceElement=r),this.data.processor=new M_(this.data.viewDocument),this.model.document.createRoot();const p=!this.config.get("toolbar.shouldNotGroupWhenFull"),v=new N_(this.locale,this.editing.view,{shouldToolbarGroupWhenFull:p});this.ui=new P_(this,v),function(Z){if(!Kt(Z.updateSourceElement))throw new En.b("attachtoform-missing-elementapi-interface: Editor passed to attachToForm() must implement ElementApi.",Z);const S=Z.sourceElement;if(S&&"textarea"===S.tagName.toLowerCase()&&S.form){let I;const V=S.form,it=()=>Z.updateSourceElement();Kt(V.submit)&&(I=V.submit,V.submit=()=>{it(),I.apply(V)}),V.addEventListener("submit",it),Z.on("destroy",()=>{V.removeEventListener("submit",it),I&&(V.submit=I)})}}(this)}destroy(){return this.sourceElement&&this.updateSourceElement(),this.ui.destroy(),super.destroy()}static create(r,c={}){return new Promise(p=>{const v=new this(r,c);p(v.initPlugins().then(()=>v.ui.init(Ur(r)?r:null)).then(()=>{if(!Ur(r)&&c.initialData)throw new En.b("editor-create-initial-data: The config.initialData option cannot be used together with initial data passed in Editor.create().",null);const Z=c.initialData||(Ur(S=r)?(I=S)instanceof HTMLTextAreaElement?I.value:I.innerHTML:S);var S,I;return v.data.init(Z)}).then(()=>v.fire("ready")).then(()=>v))})}}Si(wm,Ul),Si(wm,z1);class Gi{constructor(r){this.editor=r,this.set("isEnabled",!0),this._disableStack=new Set}forceDisabled(r){this._disableStack.add(r),1==this._disableStack.size&&(this.on("set:isEnabled",X2,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(r){this._disableStack.delete(r),0==this._disableStack.size&&(this.off("set:isEnabled",X2),this.isEnabled=!0)}destroy(){this.stopListening()}static get isContextPlugin(){return!1}}function X2(b){b.return=!1,b.stop()}Si(Gi,Ut);class Ep{constructor(r){this.files=function(c){const p=c.files?Array.from(c.files):[],v=c.items?Array.from(c.items):[];return p.length?p:v.filter(Z=>"file"===Z.kind).map(Z=>Z.getAsFile())}(r),this._native=r}get types(){return this._native.types}getData(r){return this._native.getData(r)}setData(r,c){this._native.setData(r,c)}}class uh extends dd{constructor(r){super(r);const c=this.document;function p(v,Z){Z.preventDefault();const S=Z.dropRange?[Z.dropRange]:Array.from(c.selection.getRanges()),I=new Xo(c,"clipboardInput");c.fire(I,{dataTransfer:Z.dataTransfer,targetRanges:S}),I.stop.called&&Z.stopPropagation()}this.domEventType=["paste","copy","cut","drop","dragover"],this.listenTo(c,"paste",p,{priority:"low"}),this.listenTo(c,"drop",p,{priority:"low"})}onDomEvent(r){const c={dataTransfer:new Ep(r.clipboardData?r.clipboardData:r.dataTransfer)};"drop"==r.type&&(c.dropRange=function(p,v){const Z=v.target.ownerDocument,S=v.clientX,I=v.clientY;let V;return Z.caretRangeFromPoint&&Z.caretRangeFromPoint(S,I)?V=Z.caretRangeFromPoint(S,I):v.rangeParent&&(V=Z.createRange(),V.setStart(v.rangeParent,v.rangeOffset),V.collapse(!0)),V?p.domConverter.domRangeToView(V):p.document.selection.getFirstRange()}(this.view,r)),this.fire(r.type,r,c)}}const W1=["figcaption","li"];class $1 extends Gi{static get pluginName(){return"Clipboard"}init(){const r=this.editor,c=r.model.document,p=r.editing.view,v=p.document;function Z(S,I){const V=I.dataTransfer;I.preventDefault();const it=r.data.toView(r.model.getSelectedContent(c.selection));v.fire("clipboardOutput",{dataTransfer:V,content:it,method:S.name})}this._htmlDataProcessor=new M_(v),p.addObserver(uh),this.listenTo(v,"clipboardInput",S=>{r.isReadOnly&&S.stop()},{priority:"highest"}),this.listenTo(v,"clipboardInput",(S,I)=>{const V=I.dataTransfer;let it="";var dt;V.getData("text/html")?it=V.getData("text/html").replace(/(\s+)<\/span>/g,(Ie,rn)=>1==rn.length?" ":rn):V.getData("text/plain")&&((dt=(dt=V.getData("text/plain")).replace(//g,">").replace(/\n/g,"

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

")>-1&&(dt=`

${dt}

`),it=dt),it=this._htmlDataProcessor.toView(it);const xt=new Xo(this,"inputTransformation");this.fire(xt,{content:it,dataTransfer:V}),xt.stop.called&&S.stop(),p.scrollToTheSelection()},{priority:"low"}),this.listenTo(this,"inputTransformation",(S,I)=>{if(!I.content.isEmpty){const it=this.editor.model,dt=this.editor.data.toModel(I.content,"$clipboardHolder");if(0==dt.childCount)return;it.insertContent(dt),S.stop()}},{priority:"low"}),this.listenTo(v,"copy",Z,{priority:"low"}),this.listenTo(v,"cut",(S,I)=>{r.isReadOnly?I.preventDefault():Z(S,I)},{priority:"low"}),this.listenTo(v,"clipboardOutput",(S,I)=>{I.content.isEmpty||(I.dataTransfer.setData("text/html",this._htmlDataProcessor.toData(I.content)),I.dataTransfer.setData("text/plain",function V(it){let dt="";if(it.is("$text")||it.is("$textProxy"))dt=it.data;else if(it.is("element","img")&&it.hasAttribute("alt"))dt=it.getAttribute("alt");else{let xt=null;for(const le of it.getChildren()){const Ie=V(le);xt&&(xt.is("containerElement")||le.is("containerElement"))&&(W1.includes(xt.name)||W1.includes(le.name)?dt+="\n":dt+="\n\n"),dt+=Ie,xt=le}}return dt}(I.content))),"cut"==I.method&&r.model.deleteContent(c.selection)},{priority:"low"})}}class da{constructor(r){this.editor=r,this.set("value",void 0),this.set("isEnabled",!1),this._disableStack=new Set,this.decorate("execute"),this.listenTo(this.editor.model.document,"change",()=>{this.refresh()}),this.on("execute",c=>{this.isEnabled||c.stop()},{priority:"high"}),this.listenTo(r,"change:isReadOnly",(c,p,v)=>{v?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")})}refresh(){this.isEnabled=!0}forceDisabled(r){this._disableStack.add(r),1==this._disableStack.size&&(this.on("set:isEnabled",Pi,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(r){this._disableStack.delete(r),0==this._disableStack.size&&(this.off("set:isEnabled",Pi),this.refresh())}execute(){}destroy(){this.stopListening()}}function Pi(b){b.return=!1,b.stop()}function*dh(b,r){for(const c of r)c&&b.getAttributeProperties(c[0]).copyOnEnter&&(yield c)}Si(da,Ut);class gg extends da{execute(){const r=this.editor.model,c=r.document;r.change(p=>{(function(v,Z,S,I){const V=S.isCollapsed,it=S.getFirstRange(),dt=it.start.parent,xt=it.end.parent;if(I.isLimit(dt)||I.isLimit(xt))V||dt!=xt||v.deleteContent(S);else if(V){const le=dh(Z.model.schema,S.getAttributes());ju(Z,it.start),Z.setSelectionAttribute(le)}else{const le=!(it.start.isAtStart&&it.end.isAtEnd),Ie=dt==xt;v.deleteContent(S,{leaveUnmerged:le}),le&&(Ie?ju(Z,S.focus):Z.setSelection(xt,0))}})(this.editor.model,p,c.selection,r.schema),this.fire("afterExecute",{writer:p})})}}function ju(b,r){b.split(r),b.setSelection(r.parent.nextSibling,0)}class tf extends ra{constructor(r){super(r);const c=this.document;c.on("keydown",(p,v)=>{if(this.isEnabled&&v.keyCode==mo.enter){let Z;c.once("enter",S=>Z=S,{priority:"highest"}),c.fire("enter",new ud(c,v.domEvent,{isSoft:v.shiftKey})),Z&&Z.stop.called&&p.stop()}})}observe(){}}class vg extends Gi{static get pluginName(){return"Enter"}init(){const r=this.editor,c=r.editing.view,p=c.document;c.addObserver(tf),r.commands.add("enter",new gg(r)),this.listenTo(p,"enter",(v,Z)=>{Z.preventDefault(),Z.isSoft||(r.execute("enter"),c.scrollToTheSelection())},{priority:"low"})}}class ef extends da{execute(){const r=this.editor.model,c=r.document;r.change(p=>{(function(v,Z,S){const I=S.isCollapsed,V=S.getFirstRange(),dt=V.end.parent,xt=V.start.parent==dt;if(I){const le=dh(v.schema,S.getAttributes());nf(v,Z,V.end),Z.removeSelectionAttribute(S.getAttributeKeys()),Z.setSelectionAttribute(le)}else{const le=!(V.start.isAtStart&&V.end.isAtEnd);v.deleteContent(S,{leaveUnmerged:le}),xt?nf(v,Z,S.focus):le&&Z.setSelection(dt,0)}})(r,p,c.selection),this.fire("afterExecute",{writer:p})})}refresh(){const r=this.editor.model;this.isEnabled=function(p,v){if(v.rangeCount>1)return!1;const Z=v.anchor;if(!Z||!p.checkChild(Z,"softBreak"))return!1;const S=v.getFirstRange(),I=S.start.parent,V=S.end.parent;return!((Mm(I,p)||Mm(V,p))&&I!==V)}(r.schema,r.document.selection)}}function nf(b,r,c){const p=r.createElement("softBreak");b.insertContent(p,c),r.setSelection(p,"after")}function Mm(b,r){return!b.is("rootElement")&&(r.isLimit(b)||Mm(b.parent,r))}class F_ extends Gi{static get pluginName(){return"ShiftEnter"}init(){const r=this.editor,p=r.conversion,v=r.editing.view,Z=v.document;r.model.schema.register("softBreak",{allowWhere:"$text",isInline:!0}),p.for("upcast").elementToElement({model:"softBreak",view:"br"}),p.for("downcast").elementToElement({model:"softBreak",view:(S,I)=>I.createEmptyElement("br")}),v.addObserver(tf),r.commands.add("shiftEnter",new ef(r)),this.listenTo(Z,"enter",(S,I)=>{I.preventDefault(),I.isSoft&&(r.execute("shiftEnter"),v.scrollToTheSelection())},{priority:"low"})}}class af extends da{execute(){const r=this.editor.model,c=r.document.selection;let p=r.schema.getLimitElement(c);if(c.containsEntireContent(p)||!I_(r.schema,p))do{if(p=p.parent,!p)return}while(!I_(r.schema,p));r.change(v=>{v.setSelection(p,"in")})}}function I_(b,r){return b.isLimit(r)&&(b.checkChild(r,"$text")||b.checkChild(r,"paragraph"))}const Yd=Dd("Ctrl+A");class zd extends Gi{static get pluginName(){return"SelectAllEditing"}init(){const r=this.editor,c=r.editing.view.document;r.commands.add("selectAll",new af(r)),this.listenTo(c,"keydown",(p,v)=>{na(v)===Yd&&(r.execute("selectAll"),v.preventDefault())})}}class bg extends Gi{static get pluginName(){return"SelectAllUI"}init(){const r=this.editor;r.ui.componentFactory.add("selectAll",c=>{const p=r.commands.get("selectAll"),v=new Hr(c);return v.set({label:(0,c.t)("Select all"),icon:'',keystroke:"Ctrl+A",tooltip:!0}),v.bind("isOn","isEnabled").to(p,"value","isEnabled"),this.listenTo(v,"execute",()=>{r.execute("selectAll"),r.editing.view.focus()}),v})}}class ph extends Gi{static get requires(){return[zd,bg]}static get pluginName(){return"SelectAll"}}class mh{constructor(r,c=20){this.model=r,this.size=0,this.limit=c,this.isLocked=!1,this._changeCallback=(p,v)=>{"transparent"!=v.type&&v!==this._batch&&this._reset(!0)},this._selectionChangeCallback=()=>{this._reset()},this.model.document.on("change",this._changeCallback),this.model.document.selection.on("change:range",this._selectionChangeCallback),this.model.document.selection.on("change:attribute",this._selectionChangeCallback)}get batch(){return this._batch||(this._batch=this.model.createBatch()),this._batch}input(r){this.size+=r,this.size>=this.limit&&this._reset(!0)}lock(){this.isLocked=!0}unlock(){this.isLocked=!1}destroy(){this.model.document.off("change",this._changeCallback),this.model.document.selection.off("change:range",this._selectionChangeCallback),this.model.document.selection.off("change:attribute",this._selectionChangeCallback)}_reset(r){this.isLocked&&!r||(this._batch=null,this.size=0)}}class _h extends da{constructor(r,c){super(r),this._buffer=new mh(r.model,c),this._batches=new WeakSet}get buffer(){return this._buffer}destroy(){super.destroy(),this._buffer.destroy()}execute(r={}){const c=this.editor.model,p=c.document,v=r.text||"",Z=v.length,S=r.range?c.createSelection(r.range):p.selection,I=r.resultRange;c.enqueueChange(this._buffer.batch,V=>{this._buffer.lock(),this._batches.add(this._buffer.batch),c.deleteContent(S),v&&c.insertContent(V.createText(v,p.selection.getAttributes()),S),I?V.setSelection(I):S.is("documentSelection")||V.setSelection(S),this._buffer.unlock(),this._buffer.input(Z)})}}const b1=[na("arrowUp"),na("arrowRight"),na("arrowDown"),na("arrowLeft"),9,16,17,18,19,20,27,33,34,35,36,45,91,93,144,145,173,174,175,176,177,178,179,255];for(let b=112;b<=135;b++)b1.push(b);function Dm(b){return!!b.ctrlKey||b1.includes(b.keyCode)}function rf(b){if(b.newChildren.length-b.oldChildren.length!=1)return;const r=function(p,v){const Z=[];let S,I=0;return p.forEach(dt=>{"equal"==dt?(V(),I++):"insert"==dt?(it("insert")?S.values.push(v[I]):(V(),S={type:"insert",index:I,values:[v[I]]}),I++):it("delete")?S.howMany++:(V(),S={type:"delete",index:I,howMany:1})}),V(),Z;function V(){S&&(Z.push(S),S=null)}function it(dt){return S&&S.type==dt}}(qs(b.oldChildren,b.newChildren,K1),b.newChildren);if(r.length>1)return;const c=r[0];return c.values[0]&&c.values[0].is("$text")?c:void 0}function K1(b,r){return b&&b.is("$text")&&r&&r.is("$text")?b.data===r.data:b===r}class bd{constructor(r){this.editor=r,this.editing=this.editor.editing}handle(r,c){if(function(p){if(0==p.length)return!1;for(const v of p)if("children"===v.type&&!rf(v))return!0;return!1}(r))this._handleContainerChildrenMutations(r,c);else for(const p of r)this._handleTextMutation(p,c),this._handleTextNodeInsertion(p)}_handleContainerChildrenMutations(r,c){const p=function($s){const Za=$s.map(jc=>jc.node).reduce((jc,kl)=>jc.getCommonAncestor(kl,{includeSelf:!0}));if(Za)return Za.getAncestors({includeSelf:!0,parentFirst:!0}).find(jc=>jc.is("containerElement")||jc.is("rootElement"))}(r);if(!p)return;const v=this.editor.editing.view.domConverter.mapViewToDom(p),Z=new jt(this.editor.editing.view.document),S=this.editor.data.toModel(Z.domToView(v)).getChild(0),I=this.editor.editing.mapper.toModelElement(p);if(!I)return;const V=Array.from(S.getChildren()),it=Array.from(I.getChildren()),dt=V[V.length-1],xt=it[it.length-1],le=dt&&dt.is("element","softBreak"),Ie=xt&&!xt.is("element","softBreak");le&&Ie&&V.pop();const rn=this.editor.model.schema;if(!fh(V,rn)||!fh(it,rn))return;const vn=V.map($s=>$s.is("$text")?$s.data:"@").join("").replace(/\u00A0/g," "),wn=it.map($s=>$s.is("$text")?$s.data:"@").join("").replace(/\u00A0/g," ");if(wn===vn)return;const qn=qs(wn,vn),{firstChangeAt:mi,insertions:xi,deletions:Vi}=hh(qn);let Po=null;c&&(Po=this.editing.mapper.toModelRange(c.getFirstRange()));const Yr=vn.substr(mi,xi),Ba=this.editor.model.createRange(this.editor.model.createPositionAt(I,mi),this.editor.model.createPositionAt(I,mi+Vi));this.editor.execute("input",{text:Yr,range:Ba,resultRange:Po})}_handleTextMutation(r,c){if("text"!=r.type)return;const p=r.newText.replace(/\u00A0/g," "),v=r.oldText.replace(/\u00A0/g," ");if(v===p)return;const Z=qs(v,p),{firstChangeAt:S,insertions:I,deletions:V}=hh(Z);let it=null;c&&(it=this.editing.mapper.toModelRange(c.getFirstRange()));const dt=this.editing.view.createPositionAt(r.node,S),xt=this.editing.mapper.toModelPosition(dt),le=this.editor.model.createRange(xt,xt.getShiftedBy(V)),Ie=p.substr(S,I);this.editor.execute("input",{text:Ie,range:le,resultRange:it})}_handleTextNodeInsertion(r){if("children"!=r.type)return;const c=rf(r),p=this.editing.view.createPositionAt(r.node,c.index),v=this.editing.mapper.toModelPosition(p);this.editor.execute("input",{text:c.values[0].data.replace(/\u00A0/g," "),range:this.editor.model.createRange(v)})}}function fh(b,r){return b.every(c=>r.isInline(c))}function hh(b){let r=null,c=null;for(let Z=0;Z{Z.deleteContent(Z.document.selection)}),dt.unlock()}S.document.on(Dr_isAndroid?"beforeinput":"keydown",(dt,xt)=>function V(dt){const xt=Z.document,le=S.document.isComposing,Ie=v&&v.isEqual(xt.selection);v=null,I.isEnabled&&(Dm(dt)||xt.selection.isCollapsed||le&&229===dt.keyCode||!le&&229===dt.keyCode&&Ie||it())}(xt),{priority:"lowest"}),S.document.on("compositionstart",function(){const dt=Z.document,xt=1!==dt.selection.rangeCount||dt.selection.getFirstRange().isFlat;dt.selection.isCollapsed||xt||it()},{priority:"lowest"}),S.document.on("compositionend",()=>{v=Z.createSelection(Z.document.selection)},{priority:"lowest"})}(r),(p=r).editing.view.document.on("mutations",(v,Z,S)=>{new bd(p).handle(Z,S)})}isInput(r){return this.editor.commands.get("input")._batches.has(r)}}class gh extends da{constructor(r,c){super(r),this.direction=c,this._buffer=new mh(r.model,r.config.get("typing.undoStep"))}get buffer(){return this._buffer}execute(r={}){const c=this.editor.model,p=c.document;c.enqueueChange(this._buffer.batch,v=>{this._buffer.lock();const Z=v.createSelection(r.selection||p.selection),S=Z.isCollapsed;if(Z.isCollapsed&&c.modifySelection(Z,{direction:this.direction,unit:r.unit}),this._shouldEntireContentBeReplacedWithParagraph(r.sequence||1))return void this._replaceEntireContentWithParagraph(v);if(Z.isCollapsed)return;let I=0;Z.getFirstRange().getMinimalFlatRanges().forEach(V=>{I+=po(V.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))}),c.deleteContent(Z,{doNotResetEntireContent:S,direction:this.direction}),this._buffer.input(I),v.setSelection(Z),this._buffer.unlock()})}_shouldEntireContentBeReplacedWithParagraph(r){if(r>1)return!1;const c=this.editor.model,p=c.document.selection,v=c.schema.getLimitElement(p);if(!p.isCollapsed||!p.containsEntireContent(v)||!c.schema.checkChild(v,"paragraph"))return!1;const Z=v.getChild(0);return!Z||"paragraph"!==Z.name}_replaceEntireContentWithParagraph(r){const c=this.editor.model,v=c.schema.getLimitElement(c.document.selection),Z=r.createElement("paragraph");r.remove(r.createRangeIn(v)),r.insert(Z,v),r.setSelection(Z,0)}}class Pm extends ra{constructor(r){super(r);const c=r.document;let p=0;function v(Z,S,I){let V;c.once("delete",it=>V=it,{priority:Number.POSITIVE_INFINITY}),c.fire("delete",new ud(c,S,I)),V&&V.stop.called&&Z.stop()}c.on("keyup",(Z,S)=>{S.keyCode!=mo.delete&&S.keyCode!=mo.backspace||(p=0)}),c.on("keydown",(Z,S)=>{const I={};if(S.keyCode==mo.delete)I.direction="forward",I.unit="character";else{if(S.keyCode!=mo.backspace)return;I.direction="backward",I.unit="codePoint"}I.unit=(Dr_isMac?S.altKey:S.ctrlKey)?"word":I.unit,I.sequence=++p,v(Z,S.domEvent,I)}),Dr_isAndroid&&c.on("beforeinput",(Z,S)=>{if("deleteContentBackward"!=S.domEvent.inputType)return;const I={unit:"codepoint",direction:"backward",sequence:1},V=S.domTarget.ownerDocument.defaultView.getSelection();V.anchorNode==V.focusNode&&V.anchorOffset+1!=V.focusOffset&&(I.selectionToRemove=r.domConverter.domSelectionToView(V)),v(Z,S.domEvent,I)})}observe(){}}class Wu extends Gi{static get pluginName(){return"Delete"}init(){const r=this.editor,c=r.editing.view,p=c.document;if(c.addObserver(Pm),r.commands.add("forwardDelete",new gh(r,"forward")),r.commands.add("delete",new gh(r,"backward")),this.listenTo(p,"delete",(v,Z)=>{const S={unit:Z.unit,sequence:Z.sequence};if(Z.selectionToRemove){const I=r.model.createSelection(),V=[];for(const it of Z.selectionToRemove.getRanges())V.push(r.editing.mapper.toModelRange(it));I.setTo(V),S.selection=I}r.execute("forward"==Z.direction?"forwardDelete":"delete",S),Z.preventDefault(),c.scrollToTheSelection()}),Dr_isAndroid){let v=null;this.listenTo(p,"delete",(Z,S)=>{const I=S.domTarget.ownerDocument.defaultView.getSelection();v={anchorNode:I.anchorNode,anchorOffset:I.anchorOffset,focusNode:I.focusNode,focusOffset:I.focusOffset}},{priority:"lowest"}),this.listenTo(p,"keyup",(Z,S)=>{if(v){const I=S.domTarget.ownerDocument.defaultView.getSelection();I.collapse(v.anchorNode,v.anchorOffset),I.extend(v.focusNode,v.focusOffset),v=null}})}}}class gu extends Gi{static get requires(){return[Cg,Wu]}static get pluginName(){return"Typing"}}const vu=new Map;function Na(b,r,c){let p=vu.get(b);p||(p=new Map,vu.set(b,p)),p.set(r,c)}function vh(b){return[b]}function Sm(b,r,c={}){const p=function(v,Z){const S=vu.get(v);return S&&S.has(Z)?S.get(Z):vh}(b.constructor,r.constructor);try{return p(b=b.clone(),r,c)}catch(v){throw v}}function Np(b,r,c){b=b.slice(),r=r.slice();const p=new C1(c.document,c.useRelations,c.forceWeakRemove);p.setOriginalOperations(b),p.setOriginalOperations(r);const v=p.originalOperations;if(0==b.length||0==r.length)return{operationsA:b,operationsB:r,originalOperations:v};const Z=new WeakMap;for(const V of b)Z.set(V,0);const S={nextBaseVersionA:b[b.length-1].baseVersion+1,nextBaseVersionB:r[r.length-1].baseVersion+1,originalOperationsACount:b.length,originalOperationsBCount:r.length};let I=0;for(;I{if(b.key===r.key&&b.range.start.hasSameParentAs(r.range.start)){const p=b.range.getDifference(r.range).map(Z=>new ga(Z,b.key,b.oldValue,b.newValue,0)),v=b.range.getIntersection(r.range);return v&&c.aIsStrong&&p.push(new ga(v,r.key,r.newValue,b.newValue,0)),0==p.length?[new Es(0)]:p}return[b]}),Na(ga,ho,(b,r)=>{if(b.range.start.hasSameParentAs(r.position)&&b.range.containsPosition(r.position)){const c=b.range._getTransformedByInsertion(r.position,r.howMany,!r.shouldReceiveAttributes).map(p=>new ga(p,b.key,b.oldValue,b.newValue,b.baseVersion));if(r.shouldReceiveAttributes){const p=X1(r,b.key,b.oldValue);p&&c.unshift(p)}return c}return b.range=b.range._getTransformedByInsertion(r.position,r.howMany,!1)[0],[b]}),Na(ga,rs,(b,r)=>{const c=[];b.range.start.hasSameParentAs(r.deletionPosition)&&(b.range.containsPosition(r.deletionPosition)||b.range.start.isEqual(r.deletionPosition))&&c.push(bi._createFromPositionAndShift(r.graveyardPosition,1));const p=b.range._getTransformedByMergeOperation(r);return p.isCollapsed||c.push(p),c.map(v=>new ga(v,b.key,b.oldValue,b.newValue,b.baseVersion))}),Na(ga,Jo,(b,r)=>function(c,p){const v=bi._createFromPositionAndShift(p.sourcePosition,p.howMany);let Z=null,S=[];v.containsRange(c,!0)?Z=c:c.start.hasSameParentAs(v.start)?(S=c.getDifference(v),Z=c.getIntersection(v)):S=[c];const I=[];for(let V of S){V=V._getTransformedByDeletion(p.sourcePosition,p.howMany);const it=p.getMovedRangeStart(),dt=V.start.hasSameParentAs(it);V=V._getTransformedByInsertion(it,p.howMany,dt),I.push(...V)}return Z&&I.push(Z._getTransformedByMove(p.sourcePosition,p.targetPosition,p.howMany,!1)[0]),I}(b.range,r).map(c=>new ga(c,b.key,b.oldValue,b.newValue,b.baseVersion))),Na(ga,Ka,(b,r)=>{if(b.range.end.isEqual(r.insertionPosition))return r.graveyardPosition||b.range.end.offset++,[b];if(b.range.start.hasSameParentAs(r.splitPosition)&&b.range.containsPosition(r.splitPosition)){const c=b.clone();return c.range=new bi(r.moveTargetPosition.clone(),b.range.end._getCombined(r.splitPosition,r.moveTargetPosition)),b.range.end=r.splitPosition.clone(),b.range.end.stickiness="toPrevious",[b,c]}return b.range=b.range._getTransformedBySplitOperation(r),[b]}),Na(ho,ga,(b,r)=>{const c=[b];if(b.shouldReceiveAttributes&&b.position.hasSameParentAs(r.range.start)&&r.range.containsPosition(b.position)){const p=X1(b,r.key,r.newValue);p&&c.push(p)}return c}),Na(ho,ho,(b,r,c)=>(b.position.isEqual(r.position)&&c.aIsStrong||(b.position=b.position._getTransformedByInsertOperation(r)),[b])),Na(ho,Jo,(b,r)=>(b.position=b.position._getTransformedByMoveOperation(r),[b])),Na(ho,Ka,(b,r)=>(b.position=b.position._getTransformedBySplitOperation(r),[b])),Na(ho,rs,(b,r)=>(b.position=b.position._getTransformedByMergeOperation(r),[b])),Na(Hc,ho,(b,r)=>(b.oldRange&&(b.oldRange=b.oldRange._getTransformedByInsertOperation(r)[0]),b.newRange&&(b.newRange=b.newRange._getTransformedByInsertOperation(r)[0]),[b])),Na(Hc,Hc,(b,r,c)=>{if(b.name==r.name){if(!c.aIsStrong)return[new Es(0)];b.oldRange=r.newRange?r.newRange.clone():null}return[b]}),Na(Hc,rs,(b,r)=>(b.oldRange&&(b.oldRange=b.oldRange._getTransformedByMergeOperation(r)),b.newRange&&(b.newRange=b.newRange._getTransformedByMergeOperation(r)),[b])),Na(Hc,Jo,(b,r,c)=>{if(b.oldRange&&(b.oldRange=bi._createFromRanges(b.oldRange._getTransformedByMoveOperation(r))),b.newRange){if(c.abRelation){const p=bi._createFromRanges(b.newRange._getTransformedByMoveOperation(r));if("left"==c.abRelation.side&&r.targetPosition.isEqual(b.newRange.start))return b.newRange.start.path=c.abRelation.path,b.newRange.end=p.end,[b];if("right"==c.abRelation.side&&r.targetPosition.isEqual(b.newRange.end))return b.newRange.start=p.start,b.newRange.end.path=c.abRelation.path,[b]}b.newRange=bi._createFromRanges(b.newRange._getTransformedByMoveOperation(r))}return[b]}),Na(Hc,Ka,(b,r,c)=>{if(b.oldRange&&(b.oldRange=b.oldRange._getTransformedBySplitOperation(r)),b.newRange){if(c.abRelation){const p=b.newRange._getTransformedBySplitOperation(r);return b.newRange.start.isEqual(r.splitPosition)&&c.abRelation.wasStartBeforeMergedElement?b.newRange.start=Ei._createAt(r.insertionPosition):b.newRange.start.isEqual(r.splitPosition)&&!c.abRelation.wasInLeftElement&&(b.newRange.start=Ei._createAt(r.moveTargetPosition)),b.newRange.end=b.newRange.end.isEqual(r.splitPosition)&&c.abRelation.wasInRightElement?Ei._createAt(r.moveTargetPosition):b.newRange.end.isEqual(r.splitPosition)&&c.abRelation.wasEndBeforeMergedElement?Ei._createAt(r.insertionPosition):p.end,[b]}b.newRange=b.newRange._getTransformedBySplitOperation(r)}return[b]}),Na(rs,ho,(b,r)=>(b.sourcePosition.hasSameParentAs(r.position)&&(b.howMany+=r.howMany),b.sourcePosition=b.sourcePosition._getTransformedByInsertOperation(r),b.targetPosition=b.targetPosition._getTransformedByInsertOperation(r),[b])),Na(rs,rs,(b,r,c)=>{if(b.sourcePosition.isEqual(r.sourcePosition)&&b.targetPosition.isEqual(r.targetPosition)){if(c.bWasUndone){const p=r.graveyardPosition.path.slice();return p.push(0),b.sourcePosition=new Ei(r.graveyardPosition.root,p),b.howMany=0,[b]}return[new Es(0)]}if(b.sourcePosition.isEqual(r.sourcePosition)&&!b.targetPosition.isEqual(r.targetPosition)&&!c.bWasUndone&&"splitAtSource"!=c.abRelation){const p="$graveyard"==b.targetPosition.root.rootName,v="$graveyard"==r.targetPosition.root.rootName;if(v&&!p||(!p||v)&&c.aIsStrong){const S=r.targetPosition._getTransformedByMergeOperation(r),I=b.targetPosition._getTransformedByMergeOperation(r);return[new Jo(S,b.howMany,I,0)]}return[new Es(0)]}return b.sourcePosition.hasSameParentAs(r.targetPosition)&&(b.howMany+=r.howMany),b.sourcePosition=b.sourcePosition._getTransformedByMergeOperation(r),b.targetPosition=b.targetPosition._getTransformedByMergeOperation(r),b.graveyardPosition.isEqual(r.graveyardPosition)&&c.aIsStrong||(b.graveyardPosition=b.graveyardPosition._getTransformedByMergeOperation(r)),[b]}),Na(rs,Jo,(b,r,c)=>{const p=bi._createFromPositionAndShift(r.sourcePosition,r.howMany);return"remove"==r.type&&!c.bWasUndone&&!c.forceWeakRemove&&b.deletionPosition.hasSameParentAs(r.sourcePosition)&&p.containsPosition(b.sourcePosition)?[new Es(0)]:(b.sourcePosition.hasSameParentAs(r.targetPosition)&&(b.howMany+=r.howMany),b.sourcePosition.hasSameParentAs(r.sourcePosition)&&(b.howMany-=r.howMany),b.sourcePosition=b.sourcePosition._getTransformedByMoveOperation(r),b.targetPosition=b.targetPosition._getTransformedByMoveOperation(r),b.graveyardPosition.isEqual(r.targetPosition)||(b.graveyardPosition=b.graveyardPosition._getTransformedByMoveOperation(r)),[b])}),Na(rs,Ka,(b,r,c)=>{if(r.graveyardPosition&&(b.graveyardPosition=b.graveyardPosition._getTransformedByDeletion(r.graveyardPosition,1),b.deletionPosition.isEqual(r.graveyardPosition)&&(b.howMany=r.howMany)),b.targetPosition.isEqual(r.splitPosition)){const p=0!=r.howMany,v=r.graveyardPosition&&b.deletionPosition.isEqual(r.graveyardPosition);if(p||v||"mergeTargetNotMoved"==c.abRelation)return b.sourcePosition=b.sourcePosition._getTransformedBySplitOperation(r),[b]}if(b.sourcePosition.isEqual(r.splitPosition)){if("mergeSourceNotMoved"==c.abRelation)return b.howMany=0,b.targetPosition=b.targetPosition._getTransformedBySplitOperation(r),[b];if("mergeSameElement"==c.abRelation||b.sourcePosition.offset>0)return b.sourcePosition=r.moveTargetPosition.clone(),b.targetPosition=b.targetPosition._getTransformedBySplitOperation(r),[b]}return b.sourcePosition.hasSameParentAs(r.splitPosition)&&(b.howMany=r.splitPosition.offset),b.sourcePosition=b.sourcePosition._getTransformedBySplitOperation(r),b.targetPosition=b.targetPosition._getTransformedBySplitOperation(r),[b]}),Na(Jo,ho,(b,r)=>{const c=bi._createFromPositionAndShift(b.sourcePosition,b.howMany)._getTransformedByInsertOperation(r,!1)[0];return b.sourcePosition=c.start,b.howMany=c.end.offset-c.start.offset,b.targetPosition.isEqual(r.position)||(b.targetPosition=b.targetPosition._getTransformedByInsertOperation(r)),[b]}),Na(Jo,Jo,(b,r,c)=>{const p=bi._createFromPositionAndShift(b.sourcePosition,b.howMany),v=bi._createFromPositionAndShift(r.sourcePosition,r.howMany);let Z,S=c.aIsStrong,I=!c.aIsStrong;if("insertBefore"==c.abRelation||"insertAfter"==c.baRelation?I=!0:"insertAfter"!=c.abRelation&&"insertBefore"!=c.baRelation||(I=!1),Z=b.targetPosition.isEqual(r.targetPosition)&&I?b.targetPosition._getTransformedByDeletion(r.sourcePosition,r.howMany):b.targetPosition._getTransformedByMove(r.sourcePosition,r.targetPosition,r.howMany),cf(b,r)&&cf(r,b))return[r.getReversed()];if(p.containsPosition(r.targetPosition)&&p.containsRange(v,!0))return p.start=p.start._getTransformedByMove(r.sourcePosition,r.targetPosition,r.howMany),p.end=p.end._getTransformedByMove(r.sourcePosition,r.targetPosition,r.howMany),Fp([p],Z);if(v.containsPosition(b.targetPosition)&&v.containsRange(p,!0))return p.start=p.start._getCombined(r.sourcePosition,r.getMovedRangeStart()),p.end=p.end._getCombined(r.sourcePosition,r.getMovedRangeStart()),Fp([p],Z);const V=_r(b.sourcePosition.getParentPath(),r.sourcePosition.getParentPath());if("prefix"==V||"extension"==V)return p.start=p.start._getTransformedByMove(r.sourcePosition,r.targetPosition,r.howMany),p.end=p.end._getTransformedByMove(r.sourcePosition,r.targetPosition,r.howMany),Fp([p],Z);"remove"!=b.type||"remove"==r.type||c.aWasUndone||c.forceWeakRemove?"remove"==b.type||"remove"!=r.type||c.bWasUndone||c.forceWeakRemove||(S=!1):S=!0;const it=[],dt=p.getDifference(v);for(const le of dt){le.start=le.start._getTransformedByDeletion(r.sourcePosition,r.howMany),le.end=le.end._getTransformedByDeletion(r.sourcePosition,r.howMany);const Ie="same"==_r(le.start.getParentPath(),r.getMovedRangeStart().getParentPath()),rn=le._getTransformedByInsertion(r.getMovedRangeStart(),r.howMany,Ie);it.push(...rn)}const xt=p.getIntersection(v);return null!==xt&&S&&(xt.start=xt.start._getCombined(r.sourcePosition,r.getMovedRangeStart()),xt.end=xt.end._getCombined(r.sourcePosition,r.getMovedRangeStart()),0===it.length?it.push(xt):1==it.length?v.start.isBefore(p.start)||v.start.isEqual(p.start)?it.unshift(xt):it.push(xt):it.splice(1,0,xt)),0===it.length?[new Es(b.baseVersion)]:Fp(it,Z)}),Na(Jo,Ka,(b,r,c)=>{let p=b.targetPosition.clone();b.targetPosition.isEqual(r.insertionPosition)&&r.graveyardPosition&&"moveTargetAfter"!=c.abRelation||(p=b.targetPosition._getTransformedBySplitOperation(r));const v=bi._createFromPositionAndShift(b.sourcePosition,b.howMany);if(v.end.isEqual(r.insertionPosition))return r.graveyardPosition||b.howMany++,b.targetPosition=p,[b];if(v.start.hasSameParentAs(r.splitPosition)&&v.containsPosition(r.splitPosition)){let S=new bi(r.splitPosition,v.end);return S=S._getTransformedBySplitOperation(r),Fp([new bi(v.start,r.splitPosition),S],p)}b.targetPosition.isEqual(r.splitPosition)&&"insertAtSource"==c.abRelation&&(p=r.moveTargetPosition),b.targetPosition.isEqual(r.insertionPosition)&&"insertBetween"==c.abRelation&&(p=b.targetPosition);const Z=[v._getTransformedBySplitOperation(r)];if(r.graveyardPosition){const S=v.start.isEqual(r.graveyardPosition)||v.containsPosition(r.graveyardPosition);b.howMany>1&&S&&!c.aWasUndone&&Z.push(bi._createFromPositionAndShift(r.insertionPosition,1))}return Fp(Z,p)}),Na(Jo,rs,(b,r,c)=>{const p=bi._createFromPositionAndShift(b.sourcePosition,b.howMany);if(r.deletionPosition.hasSameParentAs(b.sourcePosition)&&p.containsPosition(r.sourcePosition))if("remove"!=b.type||c.forceWeakRemove){if(1==b.howMany)return c.bWasUndone?(b.sourcePosition=r.graveyardPosition.clone(),b.targetPosition=b.targetPosition._getTransformedByMergeOperation(r),[b]):[new Es(0)]}else if(!c.aWasUndone){const Z=[];let S=r.graveyardPosition.clone(),I=r.targetPosition._getTransformedByMergeOperation(r);b.howMany>1&&(Z.push(new Jo(b.sourcePosition,b.howMany-1,b.targetPosition,0)),S=S._getTransformedByMove(b.sourcePosition,b.targetPosition,b.howMany-1),I=I._getTransformedByMove(b.sourcePosition,b.targetPosition,b.howMany-1));const V=r.deletionPosition._getCombined(b.sourcePosition,b.targetPosition),it=new Jo(S,1,V,0),dt=it.getMovedRangeStart().path.slice();dt.push(0);const xt=new Ei(it.targetPosition.root,dt);I=I._getTransformedByMove(S,V,1);const le=new Jo(I,r.howMany,xt,0);return Z.push(it),Z.push(le),Z}const v=bi._createFromPositionAndShift(b.sourcePosition,b.howMany)._getTransformedByMergeOperation(r);return b.sourcePosition=v.start,b.howMany=v.end.offset-v.start.offset,b.targetPosition=b.targetPosition._getTransformedByMergeOperation(r),[b]}),Na(Ga,ho,(b,r)=>(b.position=b.position._getTransformedByInsertOperation(r),[b])),Na(Ga,rs,(b,r)=>b.position.isEqual(r.deletionPosition)?(b.position=r.graveyardPosition.clone(),b.position.stickiness="toNext",[b]):(b.position=b.position._getTransformedByMergeOperation(r),[b])),Na(Ga,Jo,(b,r)=>(b.position=b.position._getTransformedByMoveOperation(r),[b])),Na(Ga,Ga,(b,r,c)=>{if(b.position.isEqual(r.position)){if(!c.aIsStrong)return[new Es(0)];b.oldName=r.newName}return[b]}),Na(Ga,Ka,(b,r)=>{if("same"==_r(b.position.path,r.splitPosition.getParentPath())&&!r.graveyardPosition){const c=new Ga(b.position.getShiftedBy(1),b.oldName,b.newName,0);return[b,c]}return b.position=b.position._getTransformedBySplitOperation(r),[b]}),Na(Al,Al,(b,r,c)=>{if(b.root===r.root&&b.key===r.key){if(!c.aIsStrong||b.newValue===r.newValue)return[new Es(0)];b.oldValue=r.newValue}return[b]}),Na(Ka,ho,(b,r)=>(b.splitPosition.hasSameParentAs(r.position)&&b.splitPosition.offset{if(!b.graveyardPosition&&!c.bWasUndone&&b.splitPosition.hasSameParentAs(r.sourcePosition)){const p=r.graveyardPosition.path.slice();p.push(0);const v=new Ei(r.graveyardPosition.root,p),Z=Ka.getInsertionPosition(new Ei(r.graveyardPosition.root,p)),S=new Ka(v,0,null,0);return S.insertionPosition=Z,b.splitPosition=b.splitPosition._getTransformedByMergeOperation(r),b.insertionPosition=Ka.getInsertionPosition(b.splitPosition),b.graveyardPosition=S.insertionPosition.clone(),b.graveyardPosition.stickiness="toNext",[S,b]}return b.splitPosition.hasSameParentAs(r.deletionPosition)&&!b.splitPosition.isAfter(r.deletionPosition)&&b.howMany--,b.splitPosition.hasSameParentAs(r.targetPosition)&&(b.howMany+=r.howMany),b.splitPosition=b.splitPosition._getTransformedByMergeOperation(r),b.insertionPosition=Ka.getInsertionPosition(b.splitPosition),b.graveyardPosition&&(b.graveyardPosition=b.graveyardPosition._getTransformedByMergeOperation(r)),[b]}),Na(Ka,Jo,(b,r,c)=>{const p=bi._createFromPositionAndShift(r.sourcePosition,r.howMany);if(b.graveyardPosition){const v=p.start.isEqual(b.graveyardPosition)||p.containsPosition(b.graveyardPosition);if(!c.bWasUndone&&v){const Z=b.splitPosition._getTransformedByMoveOperation(r),S=b.graveyardPosition._getTransformedByMoveOperation(r),I=S.path.slice();I.push(0);const V=new Ei(S.root,I);return[new Jo(Z,b.howMany,V,0)]}b.graveyardPosition=b.graveyardPosition._getTransformedByMoveOperation(r)}return b.splitPosition.hasSameParentAs(r.sourcePosition)&&p.containsPosition(b.splitPosition)?(b.howMany-=r.howMany-(b.splitPosition.offset-r.sourcePosition.offset),b.splitPosition.hasSameParentAs(r.targetPosition)&&b.splitPosition.offset{if(b.splitPosition.isEqual(r.splitPosition)){if(!b.graveyardPosition&&!r.graveyardPosition)return[new Es(0)];if(b.graveyardPosition&&r.graveyardPosition&&b.graveyardPosition.isEqual(r.graveyardPosition))return[new Es(0)];if("splitBefore"==c.abRelation)return b.howMany=0,b.graveyardPosition=b.graveyardPosition._getTransformedBySplitOperation(r),[b]}if(b.graveyardPosition&&r.graveyardPosition&&b.graveyardPosition.isEqual(r.graveyardPosition)){const p="$graveyard"==b.splitPosition.root.rootName,v="$graveyard"==r.splitPosition.root.rootName;if(v&&!p||(!p||v)&&c.aIsStrong){const S=[];return r.howMany&&S.push(new Jo(r.moveTargetPosition,r.howMany,r.splitPosition,0)),b.howMany&&S.push(new Jo(b.splitPosition,b.howMany,b.moveTargetPosition,0)),S}return[new Es(0)]}if(b.graveyardPosition&&(b.graveyardPosition=b.graveyardPosition._getTransformedBySplitOperation(r)),b.splitPosition.isEqual(r.insertionPosition)&&"splitBefore"==c.abRelation)return b.howMany++,[b];if(r.splitPosition.isEqual(b.insertionPosition)&&"splitBefore"==c.baRelation){const p=r.insertionPosition.path.slice();p.push(0);const v=new Ei(r.insertionPosition.root,p);return[b,new Jo(b.insertionPosition,1,v,0)]}return b.splitPosition.hasSameParentAs(r.splitPosition)&&b.splitPosition.offsetthis.clearStack())}refresh(){this.isEnabled=this._stack.length>0}addBatch(r){const c=this.editor.model.document.selection,p={ranges:c.hasOwnRange?Array.from(c.getRanges()):[],isBackward:c.isBackward};this._stack.push({batch:r,selection:p}),this.refresh()}clearStack(){this._stack=[],this.refresh()}_restoreSelection(r,c,p){const v=this.editor.model,Z=v.document,S=[],I=r.map(it=>it.getTransformedByOperations(p)),V=I.flat();for(const it of I){const dt=it.filter(le=>!Ip(le,V));km(dt);const xt=dt.find(le=>le.root!=Z.graveyard);xt&&S.push(xt)}S.length&&v.change(it=>{it.setSelection(S,{backward:c})})}_undo(r,c){const p=this.editor.model,v=p.document;this._createdBatches.add(c);const Z=r.operations.slice().filter(S=>S.isDocumentOperation);Z.reverse();for(const S of Z){const V=Array.from(v.history.getOperations(S.baseVersion+1)),it=Np([S.getReversed()],V,{useRelations:!0,document:this.editor.model.document,padWithNoOps:!1,forceWeakRemove:!0}).operationsA;for(const dt of it)c.addOperation(dt),p.applyOperation(dt),v.history.setOperationAsUndone(S,dt)}}}function km(b){b.sort((r,c)=>r.start.isBefore(c.start)?-1:1);for(let r=1;rc!==b&&c.containsRange(b,!0))}class bh extends lf{execute(r=null){const c=r?this._stack.findIndex(Z=>Z.batch==r):this._stack.length-1,p=this._stack.splice(c,1)[0],v=this.editor.model.createBatch("transparent");this.editor.model.enqueueChange(v,()=>{this._undo(p.batch,v);const Z=this.editor.model.document.history.getOperations(p.batch.baseVersion);this._restoreSelection(p.selection.ranges,p.selection.isBackward,Z),this.fire("revert",p.batch,v)}),this.refresh()}}class xg extends lf{execute(){const r=this._stack.pop(),c=this.editor.model.createBatch("transparent");this.editor.model.enqueueChange(c,()=>{const v=this.editor.model.document.history.getOperations(r.batch.operations[r.batch.operations.length-1].baseVersion+1);this._restoreSelection(r.selection.ranges,r.selection.isBackward,v),this._undo(r.batch,c)}),this.refresh()}}class R_ extends Gi{static get pluginName(){return"UndoEditing"}constructor(r){super(r),this._batchRegistry=new WeakSet}init(){const r=this.editor;this._undoCommand=new bh(r),this._redoCommand=new xg(r),r.commands.add("undo",this._undoCommand),r.commands.add("redo",this._redoCommand),this.listenTo(r.model,"applyOperation",(c,p)=>{const v=p[0];if(!v.isDocumentOperation)return;const Z=v.batch,S=this._redoCommand._createdBatches.has(Z),I=this._undoCommand._createdBatches.has(Z);this._batchRegistry.has(Z)||"transparent"==Z.type&&!S&&!I||(S?this._undoCommand.addBatch(Z):I||(this._undoCommand.addBatch(Z),this._redoCommand.clearStack()),this._batchRegistry.add(Z))},{priority:"highest"}),this.listenTo(this._undoCommand,"revert",(c,p,v)=>{this._redoCommand.addBatch(v)}),r.keystrokes.set("CTRL+Z","undo"),r.keystrokes.set("CTRL+Y","redo"),r.keystrokes.set("CTRL+SHIFT+Z","redo")}}var Go='',H_='';class Ch extends Gi{init(){const r=this.editor,c=r.locale,p=r.t,v="ltr"==c.uiLanguageDirection?Go:H_,Z="ltr"==c.uiLanguageDirection?H_:Go;this._addButton("undo",p("Undo"),"CTRL+Z",v),this._addButton("redo",p("Redo"),"CTRL+Y",Z)}_addButton(r,c,p,v){const Z=this.editor;Z.ui.componentFactory.add(r,S=>{const I=Z.commands.get(r),V=new Hr(S);return V.set({label:c,icon:v,keystroke:p,tooltip:!0}),V.bind("isEnabled").to(I,"isEnabled"),this.listenTo(V,"execute",()=>{Z.execute(r),Z.editing.view.focus()}),V})}}class uf extends Gi{static get requires(){return[R_,Ch]}static get pluginName(){return"Undo"}}class Om{constructor(r){this.context=r}destroy(){this.stopListening()}static get isContextPlugin(){return!0}}Si(Om,Ut);class df extends Om{static get pluginName(){return"PendingActions"}init(){this.set("hasAny",!1),this._actions=new Ra({idProperty:"_id"}),this._actions.delegate("add","remove").to(this)}add(r){if("string"!=typeof r)throw new En.b("pendingactions-add-invalid-message: The message must be a string.",this);const c=Object.create(Ut);return c.set("message",r),this._actions.add(c),this.hasAny=!0,c}remove(r){this._actions.remove(r),this.hasAny=!!this._actions.length}get first(){return this._actions.get(0)}[Symbol.iterator](){return this._actions[Symbol.iterator]()}}class Y_{constructor(){const r=new window.FileReader;this._reader=r,this._data=void 0,this.set("loaded",0),r.onprogress=c=>{this.loaded=c.loaded}}get error(){return this._reader.error}get data(){return this._data}read(r){const c=this._reader;return this.total=r.size,new Promise((p,v)=>{c.onload=()=>{const Z=c.result;this._data=Z,p(Z)},c.onerror=()=>{v("error")},c.onabort=()=>{v("aborted")},this._reader.readAsDataURL(r)})}abort(){this._reader.abort()}}Si(Y_,Ut);class ol extends Gi{static get pluginName(){return"FileRepository"}static get requires(){return[df]}init(){this.loaders=new Ra,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",(r,c)=>c?r/c*100:0)}getLoader(r){return this._loadersMap.get(r)||null}createLoader(r){if(!this.createUploadAdapter)return console.warn(Object(En.a)("filerepository-no-upload-adapter: Upload adapter is not defined.")),null;const c=new Lm(Promise.resolve(r),this.createUploadAdapter);return this.loaders.add(c),this._loadersMap.set(r,c),r instanceof Promise&&c.file.then(p=>{this._loadersMap.set(p,c)}).catch(()=>{}),c.on("change:uploaded",()=>{let p=0;for(const v of this.loaders)p+=v.uploaded;this.uploaded=p}),c.on("change:uploadTotal",()=>{let p=0;for(const v of this.loaders)v.uploadTotal&&(p+=v.uploadTotal);this.uploadTotal=p}),c}destroyLoader(r){const c=r instanceof Lm?r:this.getLoader(r);c._destroy(),this.loaders.remove(c),this._loadersMap.forEach((p,v)=>{p===c&&this._loadersMap.delete(v)})}_updatePendingAction(){const r=this.editor.plugins.get(df);if(this.loaders.length){if(!this._pendingAction){const c=this.editor.t,p=v=>`${c("Upload in progress")} ${parseInt(v)}%.`;this._pendingAction=r.add(p(this.uploadedPercent)),this._pendingAction.bind("message").to(this,"uploadedPercent",p)}}else r.remove(this._pendingAction),this._pendingAction=null}}Si(ol,Ut);class Lm{constructor(r,c){this.id=Pa(),this._filePromiseWrapper=this._createFilePromiseWrapper(r),this._adapter=c(this),this._reader=new Y_,this.set("status","idle"),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(p,v)=>v?p/v*100:0),this.set("uploadResponse",null)}get file(){return this._filePromiseWrapper?this._filePromiseWrapper.promise.then(r=>this._filePromiseWrapper?r:null):Promise.resolve(null)}get data(){return this._reader.data}read(){if("idle"!=this.status)throw new En.b("filerepository-read-wrong-status: You cannot call read if the status is different than idle.",this);return this.status="reading",this.file.then(r=>this._reader.read(r)).then(r=>{if("reading"!==this.status)throw this.status;return this.status="idle",r}).catch(r=>{throw"aborted"===r?(this.status="aborted","aborted"):(this.status="error",this._reader.error?this._reader.error:r)})}upload(){if("idle"!=this.status)throw new En.b("filerepository-upload-wrong-status: You cannot call upload if the status is different than idle.",this);return this.status="uploading",this.file.then(()=>this._adapter.upload()).then(r=>(this.uploadResponse=r,this.status="idle",r)).catch(r=>{throw"aborted"===this.status?"aborted":(this.status="error",r)})}abort(){const r=this.status;this.status="aborted",this._filePromiseWrapper.isFulfilled?"reading"==r?this._reader.abort():"uploading"==r&&this._adapter.abort&&this._adapter.abort():(this._filePromiseWrapper.promise.catch(()=>{}),this._filePromiseWrapper.rejecter("aborted")),this._destroy()}_destroy(){this._filePromiseWrapper=void 0,this._reader=void 0,this._adapter=void 0,this.uploadResponse=void 0}_createFilePromiseWrapper(r){const c={};return c.promise=new Promise((p,v)=>{c.rejecter=v,c.isFulfilled=!1,r.then(Z=>{c.isFulfilled=!0,p(Z)}).catch(Z=>{c.isFulfilled=!0,v(Z)})}),c}}Si(Lm,Ut);class pf extends Gi{static get requires(){return[ol]}static get pluginName(){return"CKFinderUploadAdapter"}init(){const r=this.editor.config.get("ckfinder.uploadUrl");r&&(this.editor.plugins.get(ol).createUploadAdapter=c=>new xh(c,r,this.editor.t))}}class xh{constructor(r,c,p){this.loader=r,this.url=c,this.t=p}upload(){return this.loader.file.then(r=>new Promise((c,p)=>{this._initRequest(),this._initListeners(c,p,r),this._sendRequest(r)}))}abort(){this.xhr&&this.xhr.abort()}_initRequest(){const r=this.xhr=new XMLHttpRequest;r.open("POST",this.url,!0),r.responseType="json"}_initListeners(r,c,p){const v=this.xhr,Z=this.loader,S=(0,this.t)("Cannot upload file:")+` ${p.name}.`;v.addEventListener("error",()=>c(S)),v.addEventListener("abort",()=>c()),v.addEventListener("load",()=>{const I=v.response;if(!I||!I.uploaded)return c(I&&I.error&&I.error.message?I.error.message:S);r({default:I.url})}),v.upload&&v.upload.addEventListener("progress",I=>{I.lengthComputable&&(Z.uploadTotal=I.total,Z.uploaded=I.loaded)})}_sendRequest(r){const c=new FormData;c.append("upload",r),c.append("ckCsrfToken",function Rp(){let b=function(p){p=p.toLowerCase();const v=document.cookie.split(";");for(const Z of v){const S=Z.split("=");if(decodeURIComponent(S[0].trim().toLowerCase())===p)return decodeURIComponent(S[1])}return null}("ckCsrfToken");var c;return b&&40==b.length||(b=function(p){let v="";const Z=new Uint8Array(40);window.crypto.getRandomValues(Z);for(let S=0;S.5?I.toUpperCase():I}return v}(),c=b,document.cookie=encodeURIComponent("ckCsrfToken")+"="+encodeURIComponent(c)+";path=/"),b}()),this.xhr.send(c)}}function zc(b){const r=b.next();return r.done?null:r.value}function Ac(b,r,c,p){let v,Z=null;"function"==typeof p?v=p:(Z=b.commands.get(p),v=()=>{b.execute(p)}),b.model.document.on("change:data",(S,I)=>{if(Z&&!Z.isEnabled||!r.isEnabled)return;const V=zc(b.model.document.selection.getRanges());if(!V.isCollapsed||"transparent"==I.type)return;const it=Array.from(b.model.document.differ.getChanges()),dt=it[0];if(1!=it.length||"insert"!==dt.type||"$text"!=dt.name||1!=dt.length)return;const xt=dt.position.parent;if(xt.is("element","codeBlock")||Z&&!0===Z.value)return;const le=xt.getChild(0),Ie=b.model.createRangeOn(le);if(!Ie.containsRange(V)&&!V.end.isEqual(Ie.end))return;const rn=c.exec(le.data.substr(0,V.end.offset));rn&&b.model.enqueueChange(vn=>{const wn=vn.createPositionAt(xt,0),qn=vn.createPositionAt(xt,rn[0].length),mi=new i1(wn,qn);!1!==v({match:rn})&&vn.remove(mi),mi.detach()})})}function al(b,r,c,p){let v,Z;c instanceof RegExp?v=c:Z=c,Z=Z||(S=>{let I;const V=[],it=[];for(;null!==(I=v.exec(S))&&!(I&&I.length<4);){let{index:dt,1:xt,2:le,3:Ie}=I;dt+=I[0].length-(xt+le+Ie).length;const wn=[dt+xt.length+le.length,dt+xt.length+le.length+Ie.length];V.push([dt,dt+xt.length]),V.push(wn),it.push([dt+xt.length,dt+xt.length+le.length])}return{remove:V,format:it}}),b.model.document.on("change:data",(S,I)=>{if("transparent"==I.type||!r.isEnabled)return;const V=b.model,it=V.document.selection;if(!it.isCollapsed)return;const dt=Array.from(V.document.differ.getChanges()),xt=dt[0];if(1!=dt.length||"insert"!==xt.type||"$text"!=xt.name||1!=xt.length)return;const le=it.focus,Ie=le.parent,{text:rn,range:vn}=function(xi,Vi){let Po=xi.start;return{text:Array.from(xi.getItems()).reduce((Yr,Ba)=>!Ba.is("$text")&&!Ba.is("$textProxy")||Ba.getAttribute("code")?(Po=Vi.createPositionAfter(Ba),""):Yr+Ba.data,""),range:Vi.createRange(Po,xi.end)}}(V.createRange(V.createPositionAt(Ie,0),le),V),wn=Z(rn),qn=yh(vn.start,wn.format,V),mi=yh(vn.start,wn.remove,V);qn.length&&mi.length&&V.enqueueChange(xi=>{if(!1!==p(xi,qn))for(const Vi of mi.reverse())xi.remove(Vi)})})}function yh(b,r,c){return r.filter(p=>void 0!==p[0]&&void 0!==p[1]).map(p=>c.createRange(b.getShiftedBy(p[0]),b.getShiftedBy(p[1])))}function bu(b,r){return(c,p)=>{if(!b.commands.get(r).isEnabled)return!1;const v=b.model.schema.getValidRanges(p,r);for(const Z of v)c.setAttribute(r,!0,Z);c.removeSelectionAttribute(r)}}class zo extends da{constructor(r,c){super(r),this.attributeKey=c}refresh(){const r=this.editor.model,c=r.document;this.value=this._getValueFromFirstAllowedNode(),this.isEnabled=r.schema.checkAttributeInSelection(c.selection,this.attributeKey)}execute(r={}){const c=this.editor.model,p=c.document.selection,v=void 0===r.forceValue?!this.value:r.forceValue;c.change(Z=>{if(p.isCollapsed)v?Z.setSelectionAttribute(this.attributeKey,!0):Z.removeSelectionAttribute(this.attributeKey);else{const S=c.schema.getValidRanges(p.getRanges(),this.attributeKey);for(const I of S)v?Z.setAttribute(this.attributeKey,v,I):Z.removeAttribute(this.attributeKey,I)}})}_getValueFromFirstAllowedNode(){const r=this.editor.model,c=r.schema,p=r.document.selection;if(p.isCollapsed)return p.hasAttribute(this.attributeKey);for(const v of p.getRanges())for(const Z of v.getItems())if(c.checkAttribute(Z,this.attributeKey))return Z.hasAttribute(this.attributeKey);return!1}}class mf extends Gi{static get pluginName(){return"BoldEditing"}init(){const r=this.editor;r.model.schema.extend("$text",{allowAttributes:"bold"}),r.model.schema.setAttributeProperties("bold",{isFormatting:!0,copyOnEnter:!0}),r.conversion.attributeToElement({model:"bold",view:"strong",upcastAlso:["b",c=>{const p=c.getStyle("font-weight");return p?"bold"==p||Number(p)>=600?{name:!0,styles:["font-weight"]}:void 0:null}]}),r.commands.add("bold",new zo(r,"bold")),r.keystrokes.set("CTRL+B","bold")}}class Wl extends Gi{init(){const r=this.editor,c=r.t;r.ui.componentFactory.add("bold",p=>{const v=r.commands.get("bold"),Z=new Hr(p);return Z.set({label:c("Bold"),icon:'',keystroke:"CTRL+B",tooltip:!0,isToggleable:!0}),Z.bind("isOn","isEnabled").to(v,"value","isEnabled"),this.listenTo(Z,"execute",()=>{r.execute("bold"),r.editing.view.focus()}),Z})}}class Ns extends Gi{static get pluginName(){return"ItalicEditing"}init(){const r=this.editor;r.model.schema.extend("$text",{allowAttributes:"italic"}),r.model.schema.setAttributeProperties("italic",{isFormatting:!0,copyOnEnter:!0}),r.conversion.attributeToElement({model:"italic",view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]}),r.commands.add("italic",new zo(r,"italic")),r.keystrokes.set("CTRL+I","italic")}}class _f extends Gi{init(){const r=this.editor,c=r.t;r.ui.componentFactory.add("italic",p=>{const v=r.commands.get("italic"),Z=new Hr(p);return Z.set({label:c("Italic"),icon:'',keystroke:"CTRL+I",tooltip:!0,isToggleable:!0}),Z.bind("isOn","isEnabled").to(v,"value","isEnabled"),this.listenTo(Z,"execute",()=>{r.execute("italic"),r.editing.view.focus()}),Z})}}class x1 extends da{refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(r={}){const c=this.editor.model,p=c.schema,Z=Array.from(c.document.selection.getSelectedBlocks()),S=void 0===r.forceValue?!this.value:r.forceValue;c.change(I=>{if(S){const V=Z.filter(it=>Hp(it)||ff(p,it));this._applyQuote(I,V)}else this._removeQuote(I,Z.filter(Hp))})}_getValue(){const r=zc(this.editor.model.document.selection.getSelectedBlocks());return!(!r||!Hp(r))}_checkEnabled(){if(this.value)return!0;const c=this.editor.model.schema,p=zc(this.editor.model.document.selection.getSelectedBlocks());return!!p&&ff(c,p)}_removeQuote(r,c){Th(r,c).reverse().forEach(p=>{if(p.start.isAtStart&&p.end.isAtEnd)return void r.unwrap(p.start.parent);if(p.start.isAtStart){const Z=r.createPositionBefore(p.start.parent);return void r.move(p,Z)}p.end.isAtEnd||r.split(p.end);const v=r.createPositionAfter(p.end.parent);r.move(p,v)})}_applyQuote(r,c){const p=[];Th(r,c).reverse().forEach(v=>{let Z=Hp(v.start);Z||(Z=r.createElement("blockQuote"),r.wrap(v,Z)),p.push(Z)}),p.reverse().reduce((v,Z)=>v.nextSibling==Z?(r.merge(r.createPositionAfter(v)),v):Z)}}function Hp(b){return"blockQuote"==b.parent.name?b.parent:null}function Th(b,r){let c,p=0;const v=[];for(;p{if(p.endsWith("blockQuote")&&"blockQuote"==v.name)return!1}),r.conversion.elementToElement({model:"blockQuote",view:"blockquote"}),r.model.document.registerPostFixer(p=>{const v=r.model.document.differ.getChanges();for(const Z of v)if("insert"==Z.type){const S=Z.position.nodeAfter;if(!S)continue;if(S.is("element","blockQuote")&&S.isEmpty)return p.remove(S),!0;if(S.is("element","blockQuote")&&!c.checkChild(Z.position,S))return p.unwrap(S),!0;if(S.is("element")){const I=p.createRangeIn(S);for(const V of I.getItems())if(V.is("element","blockQuote")&&!c.checkChild(p.createPositionBefore(V),V))return p.unwrap(V),!0}}else if("remove"==Z.type){const S=Z.position.parent;if(S.is("element","blockQuote")&&S.isEmpty)return p.remove(S),!0}return!1})}afterInit(){const r=this.editor.commands.get("blockQuote");this.listenTo(this.editor.editing.view.document,"enter",(c,p)=>{const v=this.editor.model.document,Z=v.selection.getLastPosition().parent;v.selection.isCollapsed&&Z.isEmpty&&r.value&&(this.editor.execute("blockQuote"),this.editor.editing.view.scrollToTheSelection(),p.preventDefault(),c.stop())})}}u(43);class Yp extends Gi{init(){const r=this.editor,c=r.t;r.ui.componentFactory.add("blockQuote",p=>{const v=r.commands.get("blockQuote"),Z=new Hr(p);return Z.set({label:c("Block quote"),icon:'',tooltip:!0,isToggleable:!0}),Z.bind("isOn","isEnabled").to(v,"value","isEnabled"),this.listenTo(Z,"execute",()=>{r.execute("blockQuote"),r.editing.view.focus()}),Z})}}class Cd extends Gi{static get pluginName(){return"CKFinderUI"}init(){const r=this.editor,p=r.t;r.ui.componentFactory.add("ckfinder",v=>{const Z=r.commands.get("ckfinder"),S=new Hr(v);return S.set({label:p("Insert image or file"),icon:'',tooltip:!0}),S.bind("isEnabled").to(Z),S.on("execute",()=>{r.execute("ckfinder"),r.editing.view.focus()}),S})}}class Cu extends ra{observe(r){this.listenTo(r,"load",(c,p)=>{"IMG"==p.target.tagName&&this._fireEvents(p)},{useCapture:!0})}_fireEvents(r){this.isEnabled&&(this.document.fire("layoutChanged"),this.document.fire("imageLoaded",r))}}class Uc{constructor(){this._stack=[]}add(r,c){const p=this._stack,v=p[0];this._insertDescriptor(r);const Z=p[0];v===Z||qm(v,Z)||this.fire("change:top",{oldDescriptor:v,newDescriptor:Z,writer:c})}remove(r,c){const p=this._stack,v=p[0];this._removeDescriptor(r);const Z=p[0];v===Z||qm(v,Z)||this.fire("change:top",{oldDescriptor:v,newDescriptor:Z,writer:c})}_insertDescriptor(r){const c=this._stack,p=c.findIndex(Z=>Z.id===r.id);if(qm(r,c[p]))return;p>-1&&c.splice(p,1);let v=0;for(;c[v]&&tp(c[v],r);)v++;c.splice(v,0,r)}_removeDescriptor(r){const c=this._stack,p=c.findIndex(v=>v.id===r);p>-1&&c.splice(p,1)}}function qm(b,r){return b&&r&&b.priority==r.priority&&yr(b.classes)==yr(r.classes)}function tp(b,r){return b.priority>r.priority||!(b.priorityyr(r.classes)}function yr(b){return Array.isArray(b)?b.sort().join(","):b}Si(Uc,Fo),u(45);const fr=J1("px"),hf=pt.document.body;class pa extends Oo{constructor(r){super(r);const c=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("position","arrow_nw"),this.set("isVisible",!1),this.set("withArrow",!0),this.set("class"),this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-panel",c.to("position",p=>"ck-balloon-panel_"+p),c.if("isVisible","ck-balloon-panel_visible"),c.if("withArrow","ck-balloon-panel_with-arrow"),c.to("class")],style:{top:c.to("top",fr),left:c.to("left",fr)}},children:this.content})}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(r){this.show();const c=pa.defaultPositions,p=Object.assign({},{element:this.element,positions:[c.southArrowNorth,c.southArrowNorthMiddleWest,c.southArrowNorthMiddleEast,c.southArrowNorthWest,c.southArrowNorthEast,c.northArrowSouth,c.northArrowSouthMiddleWest,c.northArrowSouthMiddleEast,c.northArrowSouthWest,c.northArrowSouthEast],limiter:hf,fitInViewport:!0},r),v=pa._getOptimalPosition(p),Z=parseInt(v.left),S=parseInt(v.top);Object.assign(this,{top:S,left:Z,position:v.name})}pin(r){this.unpin(),this._pinWhenIsVisibleCallback=()=>{this.isVisible?this._startPinning(r):this._stopPinning()},this._startPinning(r),this.listenTo(this,"change:isVisible",this._pinWhenIsVisibleCallback)}unpin(){this._pinWhenIsVisibleCallback&&(this._stopPinning(),this.stopListening(this,"change:isVisible",this._pinWhenIsVisibleCallback),this._pinWhenIsVisibleCallback=null,this.hide())}_startPinning(r){this.attachTo(r);const c=y1(r.target),p=r.limiter?y1(r.limiter):hf;this.listenTo(pt.document,"scroll",(v,Z)=>{const S=Z.target,I=c&&S.contains(c),V=p&&S.contains(p);!I&&!V&&c&&p||this.attachTo(r)},{useCapture:!0}),this.listenTo(pt.window,"resize",()=>{this.attachTo(r)})}_stopPinning(){this.stopListening(pt.document,"scroll"),this.stopListening(pt.window,"resize")}}function y1(b){return Ur(b)?b:nl(b)?b.commonAncestorContainer:"function"==typeof b?y1(b()):null}function Zc(b,r){return b.top-r.height-pa.arrowVerticalOffset}function Vc(b){return b.bottom+pa.arrowVerticalOffset}function T1(b,r,c){return b&&$l(b)&&!c.isInline(r)}function A1(b){return b.getAttribute("widget-type-around")}function $l(b){return!!b.is("element")&&!!b.getCustomProperty("widget")}function xu(b,r,c={}){if(!b.is("containerElement"))throw new En.b("widget-to-widget-wrong-element-type: The element passed to toWidget() must be a container element instance.",null,{element:b});return r.setAttribute("contenteditable","false",b),r.addClass("ck-widget",b),r.setCustomProperty("widget",!0,b),b.getFillerOffset=Dl,c.label&&r.setCustomProperty("widgetLabel",c.label,b),c.hasSelectionHandle&&function(v,Z){const S=Z.createUIElement("div",{class:"ck ck-widget__selection-handle"},function(I){const V=this.toDomElement(I),it=new v1;return it.set("content",''),it.render(),V.appendChild(it.element),V});Z.insert(Z.createPositionAt(v,0),S),Z.addClass(["ck-widget_with-selection-handle"],v)}(b,r),Em(b,r,(v,Z,S)=>S.addClass(p(Z.classes),v),(v,Z,S)=>S.removeClass(p(Z.classes),v)),b;function p(v){return Array.isArray(v)?v:[v]}}function Em(b,r,c,p){const v=new Uc;v.on("change:top",(Z,S)=>{S.oldDescriptor&&p(b,S.oldDescriptor,S.writer),S.newDescriptor&&c(b,S.newDescriptor,S.writer)}),r.setCustomProperty("addHighlight",(Z,S,I)=>v.add(S,I),b),r.setCustomProperty("removeHighlight",(Z,S,I)=>v.remove(S,I),b)}function yg(b){const r=b.getCustomProperty("widgetLabel");return r?"function"==typeof r?r():r:""}function $u(b,r){return r.addClass(["ck-editor__editable","ck-editor__nested-editable"],b),r.setAttribute("contenteditable",b.isReadOnly?"false":"true",b),b.on("change:isReadOnly",(c,p,v)=>{r.setAttribute("contenteditable",v?"false":"true",b)}),b.on("change:isFocused",(c,p,v)=>{v?r.addClass("ck-editor__nested-editable_focused",b):r.removeClass("ck-editor__nested-editable_focused",b)}),b}function xd(b,r){const c=b.getSelectedElement();if(c){const v=A1(b);if(v)return r.createPositionAt(c,v);if(r.schema.isBlock(c))return r.createPositionAfter(c)}const p=b.getSelectedBlocks().next().value;if(p){if(p.isEmpty)return r.createPositionAt(p,0);const v=r.createPositionAfter(p);return b.focus.isTouching(v)?v:r.createPositionBefore(p)}return b.focus}function wc(b,r){const c=new cr(pt.window),p=c.getIntersection(b),v=r.height+pa.arrowVerticalOffset;if(b.top-v>c.top||b.bottom+v!v.is("element","image"))}function Bc(b){const r=[];for(const c of b.getChildren())r.push(c),c.is("element")&&r.push(...c.getChildren());return r.find(c=>c.is("element","img"))}function Nm(b){return c=>{c.on(`attribute:${b}:image`,r)};function r(c,p,v){if(!v.consumable.consume(p.item,c.name))return;const Z=v.writer,S=Bc(v.mapper.toViewElement(p.item));Z.setAttribute(p.attributeKey,p.attributeNewValue||"",S)}}pa.arrowHorizontalOffset=25,pa.arrowVerticalOffset=10,pa._getOptimalPosition=L_,pa.defaultPositions={northWestArrowSouthWest:(b,r)=>({top:Zc(b,r),left:b.left-pa.arrowHorizontalOffset,name:"arrow_sw"}),northWestArrowSouthMiddleWest:(b,r)=>({top:Zc(b,r),left:b.left-.25*r.width-pa.arrowHorizontalOffset,name:"arrow_smw"}),northWestArrowSouth:(b,r)=>({top:Zc(b,r),left:b.left-r.width/2,name:"arrow_s"}),northWestArrowSouthMiddleEast:(b,r)=>({top:Zc(b,r),left:b.left-.75*r.width+pa.arrowHorizontalOffset,name:"arrow_sme"}),northWestArrowSouthEast:(b,r)=>({top:Zc(b,r),left:b.left-r.width+pa.arrowHorizontalOffset,name:"arrow_se"}),northArrowSouthWest:(b,r)=>({top:Zc(b,r),left:b.left+b.width/2-pa.arrowHorizontalOffset,name:"arrow_sw"}),northArrowSouthMiddleWest:(b,r)=>({top:Zc(b,r),left:b.left+b.width/2-.25*r.width-pa.arrowHorizontalOffset,name:"arrow_smw"}),northArrowSouth:(b,r)=>({top:Zc(b,r),left:b.left+b.width/2-r.width/2,name:"arrow_s"}),northArrowSouthMiddleEast:(b,r)=>({top:Zc(b,r),left:b.left+b.width/2-.75*r.width+pa.arrowHorizontalOffset,name:"arrow_sme"}),northArrowSouthEast:(b,r)=>({top:Zc(b,r),left:b.left+b.width/2-r.width+pa.arrowHorizontalOffset,name:"arrow_se"}),northEastArrowSouthWest:(b,r)=>({top:Zc(b,r),left:b.right-pa.arrowHorizontalOffset,name:"arrow_sw"}),northEastArrowSouthMiddleWest:(b,r)=>({top:Zc(b,r),left:b.right-.25*r.width-pa.arrowHorizontalOffset,name:"arrow_smw"}),northEastArrowSouth:(b,r)=>({top:Zc(b,r),left:b.right-r.width/2,name:"arrow_s"}),northEastArrowSouthMiddleEast:(b,r)=>({top:Zc(b,r),left:b.right-.75*r.width+pa.arrowHorizontalOffset,name:"arrow_sme"}),northEastArrowSouthEast:(b,r)=>({top:Zc(b,r),left:b.right-r.width+pa.arrowHorizontalOffset,name:"arrow_se"}),southWestArrowNorthWest:(b,r)=>({top:Vc(b),left:b.left-pa.arrowHorizontalOffset,name:"arrow_nw"}),southWestArrowNorthMiddleWest:(b,r)=>({top:Vc(b),left:b.left-.25*r.width-pa.arrowHorizontalOffset,name:"arrow_nmw"}),southWestArrowNorth:(b,r)=>({top:Vc(b),left:b.left-r.width/2,name:"arrow_n"}),southWestArrowNorthMiddleEast:(b,r)=>({top:Vc(b),left:b.left-.75*r.width+pa.arrowHorizontalOffset,name:"arrow_nme"}),southWestArrowNorthEast:(b,r)=>({top:Vc(b),left:b.left-r.width+pa.arrowHorizontalOffset,name:"arrow_ne"}),southArrowNorthWest:(b,r)=>({top:Vc(b),left:b.left+b.width/2-pa.arrowHorizontalOffset,name:"arrow_nw"}),southArrowNorthMiddleWest:(b,r)=>({top:Vc(b),left:b.left+b.width/2-.25*r.width-pa.arrowHorizontalOffset,name:"arrow_nmw"}),southArrowNorth:(b,r)=>({top:Vc(b),left:b.left+b.width/2-r.width/2,name:"arrow_n"}),southArrowNorthMiddleEast:(b,r)=>({top:Vc(b),left:b.left+b.width/2-.75*r.width+pa.arrowHorizontalOffset,name:"arrow_nme"}),southArrowNorthEast:(b,r)=>({top:Vc(b),left:b.left+b.width/2-r.width+pa.arrowHorizontalOffset,name:"arrow_ne"}),southEastArrowNorthWest:(b,r)=>({top:Vc(b),left:b.right-pa.arrowHorizontalOffset,name:"arrow_nw"}),southEastArrowNorthMiddleWest:(b,r)=>({top:Vc(b),left:b.right-.25*r.width-pa.arrowHorizontalOffset,name:"arrow_nmw"}),southEastArrowNorth:(b,r)=>({top:Vc(b),left:b.right-r.width/2,name:"arrow_n"}),southEastArrowNorthMiddleEast:(b,r)=>({top:Vc(b),left:b.right-.75*r.width+pa.arrowHorizontalOffset,name:"arrow_nme"}),southEastArrowNorthEast:(b,r)=>({top:Vc(b),left:b.right-r.width+pa.arrowHorizontalOffset,name:"arrow_ne"})};class Ku extends da{refresh(){this.isEnabled=ep(this.editor.model)}execute(r){const c=this.editor.model;c.change(p=>{const v=Array.isArray(r.source)?r.source:[r.source];for(const Z of v)gf(p,c,{src:Z})})}}class $o extends Gi{static get pluginName(){return"ImageEditing"}init(){const r=this.editor,c=r.model.schema,p=r.t,v=r.conversion;r.editing.view.addObserver(Cu),c.register("image",{isObject:!0,isBlock:!0,allowWhere:"$block",allowAttributes:["alt","src","srcset"]}),v.for("dataDowncast").elementToElement({model:"image",view:(Z,S)=>Ah(S)}),v.for("editingDowncast").elementToElement({model:"image",view:(Z,S)=>{return I=Ah(S),V=S,it=p("image widget"),V.setCustomProperty("image",!0,I),xu(I,V,{label:function(){const dt=Bc(I).getAttribute("alt");return dt?`${dt} ${it}`:it}});var I,V,it}}),v.for("downcast").add(Nm("src")).add(Nm("alt")).add(function(){return S=>{S.on("attribute:srcset:image",Z)};function Z(S,I,V){if(!V.consumable.consume(I.item,S.name))return;const it=V.writer,dt=Bc(V.mapper.toViewElement(I.item));if(null===I.attributeNewValue){const xt=I.attributeOldValue;xt.data&&(it.removeAttribute("srcset",dt),it.removeAttribute("sizes",dt),xt.width&&it.removeAttribute("width",dt))}else{const xt=I.attributeNewValue;xt.data&&(it.setAttribute("srcset",xt.data,dt),it.setAttribute("sizes","100vw",dt),xt.width&&it.setAttribute("width",xt.width,dt))}}}()),v.for("upcast").elementToElement({view:{name:"img",attributes:{src:!0}},model:(Z,S)=>S.createElement("image",{src:Z.getAttribute("src")})}).attributeToAttribute({view:{name:"img",key:"alt"},model:"alt"}).attributeToAttribute({view:{name:"img",key:"srcset"},model:{key:"srcset",value:Z=>{const S={data:Z.getAttribute("srcset")};return Z.hasAttribute("width")&&(S.width=Z.getAttribute("width")),S}}}).add(function(){return S=>{S.on("element:figure",Z)};function Z(S,I,V){if(!V.consumable.test(I.viewItem,{name:!0,classes:"image"}))return;const it=Bc(I.viewItem);if(!it||!it.hasAttribute("src")||!V.consumable.test(it,{name:!0}))return;const dt=V.convertItem(it,I.modelCursor),xt=zc(dt.modelRange.getItems());xt&&(V.convertChildren(I.viewItem,V.writer.createPositionAt(xt,0)),I.modelRange=dt.modelRange,I.modelCursor=dt.modelCursor)}}()),r.commands.add("imageInsert",new Ku(r))}}function Ah(b){const r=b.createEmptyElement("img"),c=b.createContainerElement("figure",{class:"image"});return b.insert(b.createPositionAt(c,0),r),c}class rl extends dd{constructor(r){super(r),this.domEventType="mousedown"}onDomEvent(r){this.fire(r.type,r)}}class Uh extends Gi{static get pluginName(){return"TwoStepCaretMovement"}constructor(r){super(r),this.attributes=new Set,this._overrideUid=null}init(){const r=this.editor,v=r.locale,Z=r.model.document.selection;this.listenTo(r.editing.view.document,"keydown",(S,I)=>{if(!Z.isCollapsed||I.shiftKey||I.altKey||I.ctrlKey)return;const V=I.keyCode==mo.arrowright,it=I.keyCode==mo.arrowleft;if(!V&&!it)return;const dt=v.contentLanguageDirection;let xt=!1;xt="ltr"===dt&&V||"rtl"===dt&&it?this._handleForwardMovement(I):this._handleBackwardMovement(I),!0===xt&&S.stop()},{priority:ar.get("high")+1}),this._isNextGravityRestorationSkipped=!1,this.listenTo(Z,"change:range",(S,I)=>{this._isNextGravityRestorationSkipped?this._isNextGravityRestorationSkipped=!1:this._isGravityOverridden&&(!I.directChange&&Xu(Z.getFirstPosition(),this.attributes)||this._restoreGravity())})}registerAttribute(r){this.attributes.add(r)}_handleForwardMovement(r){const c=this.attributes,p=this.editor.model.document.selection,v=p.getFirstPosition();return!this._isGravityOverridden&&(!v.isAtStart||!Jd(p,c))&&(Xu(v,c)?(Mc(r),this._overrideGravity(),!0):void 0)}_handleBackwardMovement(r){const c=this.attributes,p=this.editor.model,v=p.document.selection,Z=v.getFirstPosition();return this._isGravityOverridden?(Mc(r),this._restoreGravity(),ka(p,c,Z),!0):Z.isAtStart?!!Jd(v,c)&&(Mc(r),ka(p,c,Z),!0):(I=c,Xu(Z.getShiftedBy(-1),I)?Z.isAtEnd&&!Jd(v,c)&&Xu(Z,c)?(Mc(r),ka(p,c,Z),!0):(this._isNextGravityRestorationSkipped=!0,this._overrideGravity(),!1):void 0);var I}get _isGravityOverridden(){return!!this._overrideUid}_overrideGravity(){this._overrideUid=this.editor.model.change(r=>r.overrideSelectionGravity())}_restoreGravity(){this.editor.model.change(r=>{r.restoreSelectionGravity(this._overrideUid),this._overrideUid=null})}}function Jd(b,r){for(const c of r)if(b.hasAttribute(c))return!0;return!1}function ka(b,r,c){const p=c.nodeBefore;b.change(v=>{p?v.setSelectionAttribute(p.getAttributes()):v.removeSelectionAttribute(r)})}function Mc(b){b.preventDefault()}function Xu(b,r){const{nodeBefore:c,nodeAfter:p}=b;for(const v of r){const Z=c?c.getAttribute(v):void 0;if((p?p.getAttribute(v):void 0)!==Z)return!0}return!1}function yu(b,r,c,p){return p.createRange(Zh(b,r,c,!0,p),Zh(b,r,c,!1,p))}function Zh(b,r,c,p,v){let Z=b.textNode||(p?b.nodeBefore:b.nodeAfter),S=null;for(;Z&&Z.getAttribute(r)==c;)S=Z,Z=p?Z.previousSibling:Z.nextSibling;return S?v.createPositionAt(S,p?"before":"after"):b}class z_{constructor(){this._definitions=new Set}get length(){return this._definitions.size}add(r){Array.isArray(r)?r.forEach(c=>this._definitions.add(c)):this._definitions.add(r)}getDispatcher(){return r=>{r.on("attribute:linkHref",(c,p,v)=>{if(!v.consumable.test(p.item,"attribute:linkHref"))return;const Z=v.writer,S=Z.document.selection;for(const I of this._definitions){const V=Z.createAttributeElement("a",I.attributes,{priority:5});Z.setCustomProperty("link",!0,V),I.callback(p.attributeNewValue)?p.item.is("selection")?Z.wrap(S.getFirstRange(),V):Z.wrap(v.mapper.toViewRange(p.range),V):Z.unwrap(v.mapper.toViewRange(p.range),V)}},{priority:"high"})}}getDispatcherForLinkedImage(){return r=>{r.on("attribute:linkHref:image",(c,p,v)=>{const Z=v.mapper.toViewElement(p.item),S=Array.from(Z.getChildren()).find(I=>"a"===I.name);for(const I of this._definitions){const V=aa(I.attributes);if(I.callback(p.attributeNewValue))for(const[it,dt]of V)"class"===it?v.writer.addClass(dt,S):v.writer.setAttribute(it,dt,S);else for(const[it,dt]of V)"class"===it?v.writer.removeClass(dt,S):v.writer.removeAttribute(it,S)}})}}}var wh=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"),Mh=function(b){return wh.test(b)},B_="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Dh="\\ud83c[\\udffb-\\udfff]",J_="[^\\ud800-\\udfff]",G_="(?:\\ud83c[\\udde6-\\uddff]){2}",np="[\\ud800-\\udbff][\\udc00-\\udfff]",ip="(?:"+B_+"|"+Dh+")?",Fm="[\\ufe0e\\ufe0f]?"+ip+"(?:\\u200d(?:"+[J_,G_,np].join("|")+")[\\ufe0e\\ufe0f]?"+ip+")*",Ph="(?:"+[J_+B_+"?",B_,G_,np,"[\\ud800-\\udfff]"].join("|")+")",Sh=RegExp(Dh+"(?="+Dh+")|"+Ph+Fm,"g"),Z3=function(b){return Mh(b)?function(b){return b.match(Sh)||[]}(b):function(b){return b.split("")}(b)},Ag=function(r){r=su(r);var c=Mh(r)?Z3(r):void 0,p=c?c[0]:r.charAt(0),v=c?function(b,r,c){var p=b.length;return c=void 0===c?p:c,!r&&c>=p?b:Ls(b,r,c)}(c,1).join(""):r.slice(1);return p.toUpperCase()+v};const Dc=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,Xl=/^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i;function kh(b,r){const c=r.createAttributeElement("a",{href:b},{priority:5});return r.setCustomProperty("link",!0,c),c}function Q_(b){return function(r){return r.replace(Dc,"").match(Xl)}(b=String(b))?b:"#"}function yd(b,r){return!!b&&b.is("element","image")&&r.checkAttribute("image","linkHref")}class j_ extends da{constructor(r){super(r),this.manualDecorators=new Ra,this.automaticDecorators=new z_}restoreManualDecoratorStates(){for(const r of this.manualDecorators)r.value=this._getDecoratorStateFromModel(r.id)}refresh(){const r=this.editor.model,c=r.document,p=zc(c.selection.getSelectedBlocks());yd(p,r.schema)?(this.value=p.getAttribute("linkHref"),this.isEnabled=r.schema.checkAttribute(p,"linkHref")):(this.value=c.selection.getAttribute("linkHref"),this.isEnabled=r.schema.checkAttributeInSelection(c.selection,"linkHref"));for(const v of this.manualDecorators)v.value=this._getDecoratorStateFromModel(v.id)}execute(r,c={}){const p=this.editor.model,v=p.document.selection,Z=[],S=[];for(const I in c)c[I]?Z.push(I):S.push(I);p.change(I=>{if(v.isCollapsed){const V=v.getFirstPosition();if(v.hasAttribute("linkHref")){const it=yu(V,"linkHref",v.getAttribute("linkHref"),p);I.setAttribute("linkHref",r,it),Z.forEach(dt=>{I.setAttribute(dt,!0,it)}),S.forEach(dt=>{I.removeAttribute(dt,it)}),I.setSelection(I.createPositionAfter(it.end.nodeBefore))}else if(""!==r){const it=aa(v.getAttributes());it.set("linkHref",r),Z.forEach(xt=>{it.set(xt,!0)});const dt=I.createText(r,it);p.insertContent(dt,V),I.setSelection(I.createPositionAfter(dt))}["linkHref",...Z,...S].forEach(it=>{I.removeSelectionAttribute(it)})}else{const V=p.schema.getValidRanges(v.getRanges(),"linkHref"),it=[];for(const xt of v.getSelectedBlocks())p.schema.checkAttribute(xt,"linkHref")&&it.push(I.createRangeOn(xt));const dt=it.slice();for(const xt of V)this._isRangeToUpdate(xt,it)&&dt.push(xt);for(const xt of dt)I.setAttribute("linkHref",r,xt),Z.forEach(le=>{I.setAttribute(le,!0,xt)}),S.forEach(le=>{I.removeAttribute(le,xt)})}})}_getDecoratorStateFromModel(r){const c=this.editor.model,p=c.document,v=zc(p.selection.getSelectedBlocks());return yd(v,c.schema)?v.getAttribute(r):p.selection.getAttribute(r)}_isRangeToUpdate(r,c){for(const p of c)if(p.containsRange(r))return!1;return!0}}class bf extends da{refresh(){const r=this.editor.model,c=r.document,p=zc(c.selection.getSelectedBlocks());this.isEnabled=yd(p,r.schema)?r.schema.checkAttribute(p,"linkHref"):r.schema.checkAttributeInSelection(c.selection,"linkHref")}execute(){const c=this.editor.model,p=c.document.selection,v=this.editor.commands.get("link");c.change(Z=>{const S=p.isCollapsed?[yu(p.getFirstPosition(),"linkHref",p.getAttribute("linkHref"),c)]:p.getRanges();for(const I of S)if(Z.removeAttribute("linkHref",I),v)for(const V of v.manualDecorators)Z.removeAttribute(V.id,I)})}}class W_{constructor({id:r,label:c,attributes:p,defaultValue:v}){this.id=r,this.set("value"),this.defaultValue=v,this.label=c,this.attributes=p}}Si(W_,Ut),u(47);const Im=/^(https?:)?\/\//;class $_ extends Gi{static get pluginName(){return"LinkEditing"}static get requires(){return[Uh,Cg,$1]}constructor(r){super(r),r.config.define("link",{addTargetToExternalLinks:!1})}init(){const r=this.editor;r.model.schema.extend("$text",{allowAttributes:"linkHref"}),r.conversion.for("dataDowncast").attributeToElement({model:"linkHref",view:kh}),r.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(p,v)=>kh(Q_(p),v)}),r.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:!0}},model:{key:"linkHref",value:p=>p.getAttribute("href")}}),r.commands.add("link",new j_(r)),r.commands.add("unlink",new bf(r));const c=function(p,v){const Z={"Open in a new tab":p("Open in a new tab"),Downloadable:p("Downloadable")};return v.forEach(S=>(S.label&&Z[S.label]&&(S.label=Z[S.label]),S)),v}(r.t,function(p){const v=[];if(p)for(const[Z,S]of Object.entries(p)){const I=Object.assign({},S,{id:"link"+Ag(Z)});v.push(I)}return v}(r.config.get("link.decorators")));this._enableAutomaticDecorators(c.filter(p=>"automatic"===p.mode)),this._enableManualDecorators(c.filter(p=>"manual"===p.mode)),r.plugins.get(Uh).registerAttribute("linkHref"),function(p,v,Z,S){const I=p.editing.view,V=new Set;I.document.registerPostFixer(it=>{const dt=p.model.document.selection;let xt=!1;if(dt.hasAttribute(v)){const le=yu(dt.getFirstPosition(),v,dt.getAttribute(v),p.model),Ie=p.editing.mapper.toViewRange(le);for(const rn of Ie.getItems())rn.is("element","a")&&!rn.hasClass(S)&&(it.addClass(S,rn),V.add(rn),xt=!0)}return xt}),p.conversion.for("editingDowncast").add(it=>{function dt(){I.change(xt=>{for(const le of V.values())xt.removeClass(S,le),V.delete(le)})}it.on("insert",dt,{priority:"highest"}),it.on("remove",dt,{priority:"highest"}),it.on("attribute",dt,{priority:"highest"}),it.on("selection",dt,{priority:"highest"})})}(r,"linkHref",0,"ck-link_selected"),this._enableInsertContentSelectionAttributesFixer(),this._enableClickingAfterLink(),this._enableTypingOverLink(),this._handleDeleteContentAfterLink()}_enableAutomaticDecorators(r){const c=this.editor,p=c.commands.get("link").automaticDecorators;c.config.get("link.addTargetToExternalLinks")&&p.add({id:"linkIsExternal",mode:"automatic",callback:v=>Im.test(v),attributes:{target:"_blank",rel:"noopener noreferrer"}}),p.add(r),p.length&&c.conversion.for("downcast").add(p.getDispatcher())}_enableManualDecorators(r){if(!r.length)return;const c=this.editor,p=c.commands.get("link").manualDecorators;r.forEach(v=>{c.model.schema.extend("$text",{allowAttributes:v.id}),p.add(new W_(v)),c.conversion.for("downcast").attributeToElement({model:v.id,view:(Z,S)=>{if(Z){const I=p.get(v.id).attributes,V=S.createAttributeElement("a",I,{priority:5});return S.setCustomProperty("link",!0,V),V}}}),c.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:p.get(v.id).attributes},model:{key:v.id}})})}_enableInsertContentSelectionAttributesFixer(){const r=this.editor,c=r.model,p=c.document.selection,v=r.commands.get("link");this.listenTo(c,"insertContent",()=>{const Z=p.anchor.nodeBefore,S=p.anchor.nodeAfter;p.hasAttribute("linkHref")&&Z&&Z.hasAttribute("linkHref")&&(S&&S.hasAttribute("linkHref")||c.change(I=>{U1(I,v.manualDecorators)}))},{priority:"low"})}_enableClickingAfterLink(){const r=this.editor,c=r.commands.get("link");r.editing.view.addObserver(rl);let p=!1;this.listenTo(r.editing.view.document,"mousedown",()=>{p=!0}),this.listenTo(r.editing.view.document,"selectionChange",()=>{if(!p)return;p=!1;const v=r.model.document.selection;if(!v.isCollapsed||!v.hasAttribute("linkHref"))return;const Z=v.getFirstPosition(),S=yu(Z,"linkHref",v.getAttribute("linkHref"),r.model);(Z.isTouching(S.start)||Z.isTouching(S.end))&&r.model.change(I=>{U1(I,c.manualDecorators)})})}_enableTypingOverLink(){const r=this.editor;let p,v;this.listenTo(r.editing.view.document,"delete",()=>{v=!0},{priority:"high"}),this.listenTo(r.model,"deleteContent",()=>{const Z=r.model.document.selection;Z.isCollapsed||(v?v=!1:Oh(r)&&function(S){const I=S.document.selection,V=I.getFirstPosition(),it=I.getLastPosition(),dt=V.nodeAfter;return!!(dt&&dt.is("$text")&&dt.hasAttribute("linkHref"))&&(dt===(it.textNode||it.nodeBefore)||yu(V,"linkHref",dt.getAttribute("linkHref"),S).containsRange(S.createRange(V,it),!0))}(r.model)&&(p=Z.getAttributes()))},{priority:"high"}),this.listenTo(r.model,"insertContent",(Z,[S])=>{v=!1,Oh(r)&&p&&(r.model.change(I=>{for(const[V,it]of p)I.setAttribute(V,it,S)}),p=null)},{priority:"high"})}_handleDeleteContentAfterLink(){const r=this.editor,c=r.model,p=c.document.selection,v=r.editing.view,Z=r.commands.get("link");let S=!1,I=!1;this.listenTo(v.document,"delete",(V,it)=>{I=it.domEvent.keyCode===mo.backspace},{priority:"high"}),this.listenTo(c,"deleteContent",()=>{S=!1;const V=p.getFirstPosition(),it=p.getAttribute("linkHref");if(!it)return;const dt=yu(V,"linkHref",it,c);S=dt.containsPosition(V)||dt.end.isEqual(V)},{priority:"high"}),this.listenTo(c,"deleteContent",()=>{I&&(I=!1,S||r.model.enqueueChange(V=>{U1(V,Z.manualDecorators)}))},{priority:"low"})}}function U1(b,r){b.removeSelectionAttribute("linkHref");for(const c of r)b.removeSelectionAttribute(c.id)}function Oh(b){return b.plugins.get("Input").isInput(b.model.change(r=>r.batch))}class Tu extends Om{static get pluginName(){return"Notification"}init(){this.on("show:warning",(r,c)=>{window.alert(c.message)},{priority:"lowest"})}showSuccess(r,c={}){this._showNotification({message:r,type:"success",namespace:c.namespace,title:c.title})}showInfo(r,c={}){this._showNotification({message:r,type:"info",namespace:c.namespace,title:c.title})}showWarning(r,c={}){this._showNotification({message:r,type:"warning",namespace:c.namespace,title:c.title})}_showNotification(r){this.fire("show:"+r.type+(r.namespace?":"+r.namespace:""),{message:r.message,type:r.type,title:r.title||""})}}class K_ extends da{constructor(r){super(r),this.stopListening(this.editor.model.document,"change"),this.listenTo(this.editor.model.document,"change",()=>this.refresh(),{priority:"low"})}refresh(){const r=this.editor.commands.get("imageInsert"),c=this.editor.commands.get("link");this.isEnabled=r.isEnabled||c.isEnabled}execute(){const r=this.editor,c=this.editor.config.get("ckfinder.openerMethod")||"modal";if("popup"!=c&&"modal"!=c)throw new En.b('ckfinder-unknown-openerMethod: The openerMethod config option must by "popup" or "modal".',r);const p=this.editor.config.get("ckfinder.options")||{};p.chooseFiles=!0;const v=p.onInit;p.language||(p.language=r.locale.uiLanguage),p.onInit=Z=>{v&&v(Z),Z.on("files:choose",S=>{const I=S.data.files.toArray(),V=I.filter(xt=>!xt.isImage()),it=I.filter(xt=>xt.isImage());for(const xt of V)r.execute("link",xt.getUrl());const dt=[];for(const xt of it){const le=xt.getUrl();dt.push(le||Z.request("file:getProxyUrl",{file:xt}))}dt.length&&X_(r,dt)}),Z.on("file:choose:resizedImage",S=>{const I=S.data.resizedUrl;if(I)X_(r,[I]);else{const V=r.plugins.get("Notification"),it=r.locale.t;V.showWarning(it("Could not obtain resized image URL."),{title:it("Selecting resized image failed"),namespace:"ckfinder"})}})},window.CKFinder[c](p)}}function X_(b,r){if(b.commands.get("imageInsert").isEnabled)b.execute("imageInsert",{source:r});else{const c=b.plugins.get("Notification"),p=b.locale.t;c.showWarning(p("Could not insert image at the current position."),{title:p("Inserting image failed"),namespace:"ckfinder"})}}class Lh extends Gi{static get pluginName(){return"CKFinderEditing"}static get requires(){return[Tu,$o,$_]}init(){const r=this.editor;r.commands.add("ckfinder",new K_(r))}}const t2=/^data:(\S*?);base64,/;class qh{constructor(r,c,p){if(!r)throw new En.b("fileuploader-missing-file: File must be provided as the first argument",null);if(!c)throw new En.b("fileuploader-missing-token: Token must be provided as the second argument.",null);if(!p)throw new En.b("fileuploader-missing-api-address: Api address must be provided as the third argument.",null);this.file=function(v){if("string"!=typeof v)return!1;const Z=v.match(t2);return!(!Z||!Z.length)}(r)?function(v,Z=512){try{const S=v.match(t2)[1],I=atob(v.replace(t2,"")),V=[];for(let it=0;itr(p)),this}onError(r){return this.once("error",(c,p)=>r(p)),this}abort(){this.xhr.abort()}send(){return this._prepareRequest(),this._attachXHRListeners(),this._sendRequest()}_prepareRequest(){const r=new XMLHttpRequest;r.open("POST",this._apiAddress),r.setRequestHeader("Authorization",this._token.value),r.responseType="json",this.xhr=r}_attachXHRListeners(){const r=this,c=this.xhr;function p(v){return()=>r.fire("error",v)}c.addEventListener("error",p("Network Error")),c.addEventListener("abort",p("Abort")),c.upload&&c.upload.addEventListener("progress",v=>{v.lengthComputable&&this.fire("progress",{total:v.total,uploaded:v.loaded})}),c.addEventListener("load",()=>{const v=c.status,Z=c.response;if(v<200||v>299)return this.fire("error",Z.message||Z.error)})}_sendRequest(){const r=new FormData,c=this.xhr;return r.append("file",this.file),new Promise((p,v)=>{c.addEventListener("load",()=>{const Z=c.status,S=c.response;return Z<200||Z>299?v(S.message?new En.b("fileuploader-uploading-data-failed: Uploading file failed.",this,{message:S.message}):S.error):p(S)}),c.addEventListener("error",()=>v(new Error("Network Error"))),c.addEventListener("abort",()=>v(new Error("Abort"))),c.send(r)})}}Si(qh,Fo);const Cf={refreshInterval:36e5,autoRefresh:!0};class Au{constructor(r,c=Cf){if(!r)throw new En.b("token-missing-token-url: A `tokenUrl` must be provided as the first constructor argument.",this);this.set("value",c.initValue),this._refresh="function"==typeof r?r:()=>{return p=r,new Promise((v,Z)=>{const S=new XMLHttpRequest;S.open("GET",p),S.addEventListener("load",()=>{const I=S.status,V=S.response;return I<200||I>299?Z(new En.b("token-cannot-download-new-token: Cannot download new token from the provided url.",null)):v(V)}),S.addEventListener("error",()=>Z(new Error("Network Error"))),S.addEventListener("abort",()=>Z(new Error("Abort"))),S.send()});var p},this._options=Object.assign({},Cf,c)}init(){return new Promise((r,c)=>{this._options.autoRefresh&&this._startRefreshing(),this.value?r(this):this.refreshToken().then(r).catch(c)})}refreshToken(){return this._refresh().then(r=>this.set("value",r)).then(()=>this)}destroy(){this._stopRefreshing()}_startRefreshing(){this._refreshInterval=setInterval(()=>this.refreshToken(),this._options.refreshInterval)}_stopRefreshing(){clearInterval(this._refreshInterval)}static create(r,c=Cf){return new Au(r,c).init()}}Si(Au,Ut);var op=Au;let Rm=(()=>{class b extends Om{static get pluginName(){return"CloudServices"}init(){const c=this.context.config.get("cloudServices")||{};for(const p in c)this[p]=c[p];if(this.tokenUrl)return this.token=new b.Token(this.tokenUrl),this.token.init();this.token=null}destroy(){super.destroy(),this.token&&this.token.destroy()}}return b.Token=op,b})();class Td extends Gi{static get requires(){return[ol,Rm]}init(){const r=this.editor,c=r.plugins.get(Rm),p=c.token;p&&(this._uploadGateway=new Td._UploadGateway(p,c.uploadUrl),r.plugins.get(ol).createUploadAdapter=Z=>new e2(this._uploadGateway,Z))}}class e2{constructor(r,c){this.uploadGateway=r,this.loader=c}upload(){return this.loader.file.then(r=>(this.fileUploader=this.uploadGateway.upload(r),this.fileUploader.on("progress",(c,p)=>{this.loader.uploadTotal=p.total,this.loader.uploaded=p.uploaded}),this.fileUploader.send()))}abort(){this.fileUploader.abort()}}Td._UploadGateway=class{constructor(b,r){if(!b)throw new En.b("uploadgateway-missing-token: Token must be provided.",null);if(!r)throw new En.b("uploadgateway-missing-api-address: Api address must be provided.",null);this._token=b,this._apiAddress=r}upload(b){return new qh(b,this._token,this._apiAddress)}},u(49);const Gd=["before","after"],n2=(new DOMParser).parseFromString('\n',"image/svg+xml").firstChild;class o2 extends Gi{static get pluginName(){return"WidgetTypeAround"}constructor(r){super(r),this._currentFakeCaretModelElement=null}init(){const r=this.editor,c=r.editing.view;this.on("change:isEnabled",(p,v,Z)=>{c.change(S=>{for(const I of c.document.roots)Z?S.removeClass("ck-widget__type-around_disabled",I):S.addClass("ck-widget__type-around_disabled",I)}),Z||r.model.change(S=>{S.removeSelectionAttribute("widget-type-around")})}),this._enableTypeAroundUIInjection(),this._enableInsertingParagraphsOnButtonClick(),this._enableInsertingParagraphsOnEnterKeypress(),this._enableInsertingParagraphsOnTypingKeystroke(),this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows(),this._enableDeleteIntegration(),this._enableInsertContentIntegration()}destroy(){this._currentFakeCaretModelElement=null}_insertParagraph(r,c){const p=this.editor,v=p.editing.view;p.execute("insertParagraph",{position:p.model.createPositionAt(r,c)}),v.focus(),v.scrollToTheSelection()}_listenToIfEnabled(r,c,p,v){this.listenTo(r,c,(...Z)=>{this.isEnabled&&p(...Z)},v)}_insertParagraphAccordingToFakeCaretPosition(){const r=this.editor.model.document.selection,c=A1(r);if(!c)return!1;const p=r.getSelectedElement();return this._insertParagraph(p,c),!0}_enableTypeAroundUIInjection(){const r=this.editor,c=r.model.schema,p=r.locale.t,v={before:p("Insert paragraph before block"),after:p("Insert paragraph after block")};r.editing.downcastDispatcher.on("insert",(Z,S,I)=>{const V=I.mapper.toViewElement(S.item);T1(V,S.item,c)&&function(it,dt,xt){const le=it.createUIElement("div",{class:"ck ck-reset_all ck-widget__type-around"},function(Ie){const rn=this.toDomElement(Ie);return function(vn,wn){for(const qn of Gd){const mi=new Gu({tag:"div",attributes:{class:["ck","ck-widget__type-around__button","ck-widget__type-around__button_"+qn],title:wn[qn]},children:[vn.ownerDocument.importNode(n2,!0)]});vn.appendChild(mi.render())}}(rn,dt),function(vn){const wn=new Gu({tag:"div",attributes:{class:["ck","ck-widget__type-around__fake-caret"]}});vn.appendChild(wn.render())}(rn),rn});it.insert(it.createPositionAt(xt,"end"),le)}(I.writer,v,V)},{priority:"low"})}_enableTypeAroundFakeCaretActivationUsingKeyboardArrows(){const r=this.editor,c=r.model,p=c.document.selection,v=c.schema;function S(I){return"ck-widget_type-around_show-fake-caret_"+I}this._listenToIfEnabled(r.editing.view.document,"keydown",(I,V)=>{Il(V.keyCode)&&this._handleArrowKeyPress(I,V)},{priority:ar.get("high")+10}),this._listenToIfEnabled(p,"change:range",(I,V)=>{V.directChange&&r.model.change(it=>{it.removeSelectionAttribute("widget-type-around")})}),this._listenToIfEnabled(c.document,"change:data",()=>{const I=p.getSelectedElement();I&&T1(r.editing.mapper.toViewElement(I),I,v)||r.model.change(V=>{V.removeSelectionAttribute("widget-type-around")})}),this._listenToIfEnabled(r.editing.downcastDispatcher,"selection",(I,V,it)=>{const dt=it.writer;if(this._currentFakeCaretModelElement){const rn=it.mapper.toViewElement(this._currentFakeCaretModelElement);rn&&(dt.removeClass(Gd.map(S),rn),this._currentFakeCaretModelElement=null)}const xt=V.selection.getSelectedElement();if(!xt)return;const le=it.mapper.toViewElement(xt);if(!T1(le,xt,v))return;const Ie=A1(V.selection);Ie&&(dt.addClass(S(Ie),le),this._currentFakeCaretModelElement=xt)}),this._listenToIfEnabled(r.ui.focusTracker,"change:isFocused",(I,V,it)=>{it||r.model.change(dt=>{dt.removeSelectionAttribute("widget-type-around")})})}_handleArrowKeyPress(r,c){const p=this.editor,v=p.model,Z=v.document.selection,S=v.schema,I=p.editing.view,V=qu(c.keyCode,p.locale.contentLanguageDirection),it=I.document.selection.getSelectedElement();let dt;T1(it,p.editing.mapper.toModelElement(it),S)?dt=this._handleArrowKeyPressOnSelectedWidget(V):Z.isCollapsed&&(dt=this._handleArrowKeyPressWhenSelectionNextToAWidget(V)),dt&&(c.preventDefault(),r.stop())}_handleArrowKeyPressOnSelectedWidget(r){const c=this.editor.model,p=A1(c.document.selection);return c.change(v=>p?p!==(r?"after":"before")&&(v.removeSelectionAttribute("widget-type-around"),!0):(v.setSelectionAttribute("widget-type-around",r?"after":"before"),!0))}_handleArrowKeyPressWhenSelectionNextToAWidget(r){const c=this.editor,p=c.model,v=p.schema,Z=c.plugins.get("Widget"),S=Z._getObjectElementNextToSelection(r);return!!T1(c.editing.mapper.toViewElement(S),S,v)&&(p.change(I=>{Z._setSelectionOverElement(S),I.setSelectionAttribute("widget-type-around",r?"before":"after")}),!0)}_enableInsertingParagraphsOnButtonClick(){const r=this.editor,c=r.editing.view;this._listenToIfEnabled(c.document,"mousedown",(p,v)=>{const Z=v.domTarget.closest(".ck-widget__type-around__button");if(!Z)return;const S=Z.classList.contains("ck-widget__type-around__button_before")?"before":"after",I=function(it,dt){const xt=it.closest(".ck-widget");return dt.mapDomToView(xt)}(Z,c.domConverter),V=r.editing.mapper.toModelElement(I);this._insertParagraph(V,S),v.preventDefault(),p.stop()})}_enableInsertingParagraphsOnEnterKeypress(){const r=this.editor,c=r.editing.view;this._listenToIfEnabled(c.document,"enter",(p,v)=>{const Z=c.document.selection.getSelectedElement(),S=r.editing.mapper.toModelElement(Z),I=r.model.schema;let V;this._insertParagraphAccordingToFakeCaretPosition()?V=!0:T1(Z,S,I)&&(this._insertParagraph(S,v.isSoft?"before":"after"),V=!0),V&&(v.preventDefault(),p.stop())})}_enableInsertingParagraphsOnTypingKeystroke(){const c=[mo.enter,mo.delete,mo.backspace];this._listenToIfEnabled(this.editor.editing.view.document,"keydown",(p,v)=>{c.includes(v.keyCode)||Dm(v)||this._insertParagraphAccordingToFakeCaretPosition()},{priority:ar.get("high")+1})}_enableDeleteIntegration(){const r=this.editor,p=r.model,v=p.schema;this._listenToIfEnabled(r.editing.view.document,"delete",(Z,S)=>{const I=A1(p.document.selection);if(!I)return;const V=S.direction,it=p.document.selection.getSelectedElement(),dt="forward"==V;if("before"===I===dt)r.execute("delete",{selection:p.createSelection(it,"on")});else{const xt=v.getNearestSelectionRange(p.createPositionAt(it,I),V);if(xt)if(xt.isCollapsed){const le=p.createSelection(xt.start);if(p.modifySelection(le,{direction:V}),le.focus.isEqual(xt.start)){const Ie=function(rn,vn){let wn=vn;for(const qn of vn.getAncestors({parentFirst:!0})){if(qn.childCount>1||rn.isLimit(qn))break;wn=qn}return wn}(v,xt.start.parent);p.deleteContent(p.createSelection(Ie,"on"),{doNotAutoparagraph:!0})}else p.change(Ie=>{Ie.setSelection(xt),r.execute(dt?"forwardDelete":"delete")})}else p.change(le=>{le.setSelection(xt),r.execute(dt?"forwardDelete":"delete")})}S.preventDefault(),Z.stop()},{priority:ar.get("high")+1})}_enableInsertContentIntegration(){const c=this.editor.model,p=c.document.selection;this._listenToIfEnabled(this.editor.model,"insertContent",(v,[Z,S])=>{if(S&&!S.is("documentSelection"))return;const I=A1(p);return I?(v.stop(),c.change(V=>{const it=p.getSelectedElement(),dt=c.createPositionAt(it,I),xt=V.createSelection(dt),le=c.insertContent(Z,xt);return V.setSelection(xt),le})):void 0},{priority:"high"})}}u(51);class ap extends Gi{static get pluginName(){return"Widget"}static get requires(){return[o2]}init(){const r=this.editor.editing.view,c=r.document;this._previouslySelected=new Set,this.editor.editing.downcastDispatcher.on("selection",(p,v,Z)=>{this._clearPreviouslySelectedWidgets(Z.writer);const S=Z.writer,I=S.document.selection,V=I.getSelectedElement();let it=null;for(const dt of I.getRanges())for(const xt of dt){const le=xt.item;$l(le)&&!xf(le,it)&&(S.addClass("ck-widget_selected",le),this._previouslySelected.add(le),it=le,le==V&&S.setSelection(I.getRanges(),{fake:!0,label:yg(V)}))}},{priority:"low"}),r.addObserver(rl),this.listenTo(c,"mousedown",(...p)=>this._onMousedown(...p)),this.listenTo(c,"keydown",(...p)=>{this._handleSelectionChangeOnArrowKeyPress(...p)},{priority:"high"}),this.listenTo(c,"keydown",(...p)=>{this._preventDefaultOnArrowKeyPress(...p)},{priority:ar.get("high")-20}),this.listenTo(c,"delete",(p,v)=>{this._handleDelete("forward"==v.direction)&&(v.preventDefault(),p.stop())},{priority:"high"})}_onMousedown(r,c){const p=this.editor,v=p.editing.view,Z=v.document;let S=c.target;if(function(V){for(;V;){if(V.is("editableElement")&&!V.is("rootElement"))return!0;if($l(V))return!1;V=V.parent}return!1}(S)){if((Dr_isSafari||Dr_isGecko)&&c.domEvent.detail>=3){const V=p.editing.mapper,it=S.is("attributeElement")?S.findAncestor(xt=>!xt.is("attributeElement")):S,dt=V.toModelElement(it);c.preventDefault(),this.editor.model.change(xt=>{xt.setSelection(dt,"in")})}return}if(!$l(S)&&(S=S.findAncestor($l),!S))return;c.preventDefault(),Z.isFocused||v.focus();const I=p.editing.mapper.toModelElement(S);this._setSelectionOverElement(I)}_handleSelectionChangeOnArrowKeyPress(r,c){const p=c.keyCode;if(!Il(p))return;const v=this.editor.model,Z=v.schema,S=v.document.selection,I=S.getSelectedElement(),V=qu(p,this.editor.locale.contentLanguageDirection);if(I&&Z.isObject(I)){const dt=V?S.getLastPosition():S.getFirstPosition(),xt=Z.getNearestSelectionRange(dt,V?"forward":"backward");return void(xt&&(v.change(le=>{le.setSelection(xt)}),c.preventDefault(),r.stop()))}if(!S.isCollapsed)return;const it=this._getObjectElementNextToSelection(V);it&&Z.isObject(it)&&(this._setSelectionOverElement(it),c.preventDefault(),r.stop())}_preventDefaultOnArrowKeyPress(r,c){if(!Il(c.keyCode))return;const p=this.editor.model,v=p.schema,Z=p.document.selection.getSelectedElement();Z&&v.isObject(Z)&&(c.preventDefault(),r.stop())}_handleDelete(r){if(this.editor.isReadOnly)return;const c=this.editor.model.document.selection;if(!c.isCollapsed)return;const p=this._getObjectElementNextToSelection(r);return p?(this.editor.model.change(v=>{let Z=c.anchor.parent;for(;Z.isEmpty;){const S=Z;Z=S.parent,v.remove(S)}this._setSelectionOverElement(p)}),!0):void 0}_setSelectionOverElement(r){this.editor.model.change(c=>{c.setSelection(c.createRangeOn(r))})}_getObjectElementNextToSelection(r){const c=this.editor.model,p=c.schema,Z=c.createSelection(c.document.selection);c.modifySelection(Z,{direction:r?"forward":"backward"});const S=r?Z.focus.nodeBefore:Z.focus.nodeAfter;return S&&p.isObject(S)?S:null}_clearPreviouslySelectedWidgets(r){for(const c of this._previouslySelected)r.removeClass("ck-widget_selected",c);this._previouslySelected.clear()}}function xf(b,r){return!!r&&Array.from(b.getAncestors()).includes(r)}class Eh extends da{refresh(){const r=this.editor.model.document.selection.getSelectedElement();this.isEnabled=Bd(r),this.value=!(!Bd(r)||!r.hasAttribute("alt"))&&r.getAttribute("alt")}execute(r){const c=this.editor.model,p=c.document.selection.getSelectedElement();c.change(v=>{v.setAttribute("alt",r.newValue,p)})}}class ir extends Gi{static get pluginName(){return"ImageTextAlternativeEditing"}init(){this.editor.commands.add("imageTextAlternative",new Eh(this.editor))}}u(53);class zp extends Oo{constructor(r,c){super(r);const p="ck-labeled-field-view-"+Pa(),v="ck-labeled-field-view-status-"+Pa();this.fieldView=c(this,p,v),this.set("label"),this.set("isEnabled",!0),this.set("errorText",null),this.set("infoText",null),this.set("class"),this.labelView=this._createLabelView(p),this.statusView=this._createStatusView(v),this.bind("_statusText").to(this,"errorText",this,"infoText",(S,I)=>S||I);const Z=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view",Z.to("class"),Z.if("isEnabled","ck-disabled",S=>!S)]},children:[this.labelView,this.fieldView,this.statusView]})}_createLabelView(r){const c=new Ml(this.locale);return c.for=r,c.bind("text").to(this,"label"),c}_createStatusView(r){const c=new Oo(this.locale),p=this.bindTemplate;return c.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view__status",p.if("errorText","ck-labeled-field-view__status_error"),p.if("_statusText","ck-hidden",v=>!v)],id:r,role:p.if("errorText","alert")},children:[{text:p.to("_statusText")}]}),c}focus(){this.fieldView.focus()}}u(55);class w3 extends Oo{constructor(r){super(r),this.set("value"),this.set("id"),this.set("placeholder"),this.set("isReadOnly",!1),this.set("hasError",!1),this.set("ariaDescribedById");const c=this.bindTemplate;this.setTemplate({tag:"input",attributes:{type:"text",class:["ck","ck-input","ck-input-text",c.if("hasError","ck-error")],id:c.to("id"),placeholder:c.to("placeholder"),readonly:c.to("isReadOnly"),"aria-invalid":c.if("hasError",!0),"aria-describedby":c.to("ariaDescribedById")},on:{input:c.to("input")}})}render(){super.render();const r=c=>{this.element.value=c||0===c?c:""};r(this.value),this.on("change:value",(c,p,v)=>{r(v)})}select(){this.element.select()}focus(){this.element.focus()}}function yf(b,r,c){const p=new w3(b.locale);return p.set({id:r,ariaDescribedById:c}),p.bind("isReadOnly").to(b,"isEnabled",v=>!v),p.bind("hasError").to(b,"errorText",v=>!!v),p.on("input",()=>{b.errorText=null}),p}function Hm({view:b}){b.listenTo(b.element,"submit",(r,c)=>{c.preventDefault(),b.fire("submit")},{useCapture:!0})}var a2='',Ym='';u(57);class Nh extends Oo{constructor(r){super(r);const c=this.locale.t;this.focusTracker=new ws,this.keystrokes=new _u,this.labeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(c("Save"),a2,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(c("Cancel"),Ym,"ck-button-cancel","cancel"),this._focusables=new Zl,this._focusCycler=new _1({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),Hm({view:this}),[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach(r=>{this._focusables.add(r),this.focusTracker.add(r.element)})}_createButton(r,c,p,v){const Z=new Hr(this.locale);return Z.set({label:r,icon:c,tooltip:!0}),Z.extendTemplate({attributes:{class:p}}),v&&Z.delegate("execute").to(this,v),Z}_createLabeledInputView(){const r=this.locale.t,c=new zp(this.locale,yf);return c.label=r("Text alternative"),c.fieldView.placeholder=r("Text alternative"),c}}u(59),u(61);const r2=J1("px");class Jc extends Gi{static get pluginName(){return"ContextualBalloon"}constructor(r){super(r),this.positionLimiter=()=>{const c=this.editor.editing.view,p=c.document.selection.editableElement;return p?c.domConverter.mapViewToDom(p.root):null},this.set("visibleView",null),this.view=new pa(r.locale),r.ui.view.body.add(this.view),r.ui.focusTracker.add(this.view.element),this._viewToStack=new Map,this._idToStack=new Map,this.set("_numberOfStacks",0),this.set("_singleViewMode",!1),this._rotatorView=this._createRotatorView(),this._fakePanelsView=this._createFakePanelsView()}hasView(r){return Array.from(this._viewToStack.keys()).includes(r)}add(r){if(this.hasView(r.view))throw new En.b("contextualballoon-add-view-exist: Cannot add configuration of the same view twice.",[this,r]);const c=r.stackId||"main";if(!this._idToStack.has(c))return this._idToStack.set(c,new Map([[r.view,r]])),this._viewToStack.set(r.view,this._idToStack.get(c)),this._numberOfStacks=this._idToStack.size,void(this._visibleStack&&!r.singleViewMode||this.showStack(c));const p=this._idToStack.get(c);r.singleViewMode&&this.showStack(c),p.set(r.view,r),this._viewToStack.set(r.view,p),p===this._visibleStack&&this._showView(r)}remove(r){if(!this.hasView(r))throw new En.b("contextualballoon-remove-view-not-exist: Cannot remove the configuration of a non-existent view.",[this,r]);const c=this._viewToStack.get(r);this._singleViewMode&&this.visibleView===r&&(this._singleViewMode=!1),this.visibleView===r&&(1===c.size?this._idToStack.size>1?this._showNextStack():(this.view.hide(),this.visibleView=null,this._rotatorView.hideView()):this._showView(Array.from(c.values())[c.size-2])),1===c.size?(this._idToStack.delete(this._getStackId(c)),this._numberOfStacks=this._idToStack.size):c.delete(r),this._viewToStack.delete(r)}updatePosition(r){r&&(this._visibleStack.get(this.visibleView).position=r),this.view.pin(this._getBalloonPosition()),this._fakePanelsView.updatePosition()}showStack(r){this.visibleStack=r;const c=this._idToStack.get(r);if(!c)throw new En.b("contextualballoon-showstack-stack-not-exist: Cannot show a stack that does not exist.",this);this._visibleStack!==c&&this._showView(Array.from(c.values()).pop())}get _visibleStack(){return this._viewToStack.get(this.visibleView)}_getStackId(r){return Array.from(this._idToStack.entries()).find(c=>c[1]===r)[0]}_showNextStack(){const r=Array.from(this._idToStack.values());let c=r.indexOf(this._visibleStack)+1;r[c]||(c=0),this.showStack(this._getStackId(r[c]))}_showPrevStack(){const r=Array.from(this._idToStack.values());let c=r.indexOf(this._visibleStack)-1;r[c]||(c=r.length-1),this.showStack(this._getStackId(r[c]))}_createRotatorView(){const r=new s2(this.editor.locale),c=this.editor.locale.t;return this.view.content.add(r),r.bind("isNavigationVisible").to(this,"_numberOfStacks",this,"_singleViewMode",(p,v)=>!v&&p>1),r.on("change:isNavigationVisible",()=>this.updatePosition(),{priority:"low"}),r.bind("counter").to(this,"visibleView",this,"_numberOfStacks",(p,v)=>{if(v<2)return"";const Z=Array.from(this._idToStack.values()).indexOf(this._visibleStack)+1;return c("%0 of %1",[Z,v])}),r.buttonNextView.on("execute",()=>{r.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showNextStack()}),r.buttonPrevView.on("execute",()=>{r.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showPrevStack()}),r}_createFakePanelsView(){const r=new Fh(this.editor.locale,this.view);return r.bind("numberOfPanels").to(this,"_numberOfStacks",this,"_singleViewMode",(c,p)=>!p&&c>=2?Math.min(c-1,2):0),r.listenTo(this.view,"change:top",()=>r.updatePosition()),r.listenTo(this.view,"change:left",()=>r.updatePosition()),this.editor.ui.view.body.add(r),r}_showView({view:r,balloonClassName:c="",withArrow:p=!0,singleViewMode:v=!1}){this.view.class=c,this.view.withArrow=p,this._rotatorView.showView(r),this.visibleView=r,this.view.pin(this._getBalloonPosition()),this._fakePanelsView.updatePosition(),v&&(this._singleViewMode=!0)}_getBalloonPosition(){let r=Array.from(this._visibleStack.values()).pop().position;return r&&!r.limiter&&(r=Object.assign({},r,{limiter:this.positionLimiter})),r}}class s2 extends Oo{constructor(r){super(r);const c=r.t,p=this.bindTemplate;this.set("isNavigationVisible",!0),this.focusTracker=new ws,this.buttonPrevView=this._createButtonView(c("Previous"),''),this.buttonNextView=this._createButtonView(c("Next"),''),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",p.to("isNavigationVisible",v=>v?"":"ck-hidden")]},children:[this.buttonPrevView,{tag:"span",attributes:{class:["ck-balloon-rotator__counter"]},children:[{text:p.to("counter")}]},this.buttonNextView]},{tag:"div",attributes:{class:"ck-balloon-rotator__content"},children:this.content}]})}render(){super.render(),this.focusTracker.add(this.element)}showView(r){this.hideView(),this.content.add(r)}hideView(){this.content.clear()}_createButtonView(r,c){const p=new Hr(this.locale);return p.set({label:r,icon:c,tooltip:!0}),p}}class Fh extends Oo{constructor(r,c){super(r);const p=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=c,this.setTemplate({tag:"div",attributes:{class:["ck-fake-panel",p.to("numberOfPanels",v=>v?"":"ck-hidden")],style:{top:p.to("top",r2),left:p.to("left",r2),width:p.to("width",r2),height:p.to("height",r2)}},children:this.content}),this.on("change:numberOfPanels",(v,Z,S,I)=>{S>I?this._addPanels(S-I):this._removePanels(I-S),this.updatePosition()})}_addPanels(r){for(;r--;){const c=new Oo;c.setTemplate({tag:"div"}),this.content.add(c),this.registerChild(c)}}_removePanels(r){for(;r--;){const c=this.content.last;this.content.remove(c),this.deregisterChild(c),c.destroy()}}updatePosition(){if(this.numberOfPanels){const{top:r,left:c}=this._balloonPanelView,{width:p,height:v}=new cr(this._balloonPanelView.element);Object.assign(this,{top:r,left:c,width:p,height:v})}}}function Ih(b){const r=b.editing.view,c=pa.defaultPositions;return{target:r.domConverter.viewToDom(r.document.selection.getSelectedElement()),positions:[c.northArrowSouth,c.northArrowSouthWest,c.northArrowSouthEast,c.southArrowNorth,c.southArrowNorthWest,c.southArrowNorthEast]}}class Ug extends Gi{static get requires(){return[Jc]}static get pluginName(){return"ImageTextAlternativeUI"}init(){this._createButton(),this._createForm()}destroy(){super.destroy(),this._form.destroy()}_createButton(){const r=this.editor,c=r.t;r.ui.componentFactory.add("imageTextAlternative",p=>{const v=r.commands.get("imageTextAlternative"),Z=new Hr(p);return Z.set({label:c("Change image text alternative"),icon:'',tooltip:!0}),Z.bind("isEnabled").to(v,"isEnabled"),this.listenTo(Z,"execute",()=>{this._showForm()}),Z})}_createForm(){const r=this.editor,c=r.editing.view.document;this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new Nh(r.locale),this._form.render(),this.listenTo(this._form,"submit",()=>{r.execute("imageTextAlternative",{newValue:this._form.labeledInput.fieldView.element.value}),this._hideForm(!0)}),this.listenTo(this._form,"cancel",()=>{this._hideForm(!0)}),this._form.keystrokes.set("Esc",(p,v)=>{this._hideForm(!0),v()}),this.listenTo(r.ui,"update",()=>{Kl(c.selection)?this._isVisible&&function(p){const v=p.plugins.get("ContextualBalloon");if(Kl(p.editing.view.document.selection)){const Z=Ih(p);v.updatePosition(Z)}}(r):this._hideForm(!0)}),Am({emitter:this._form,activator:()=>this._isVisible,contextElements:[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible)return;const r=this.editor,c=r.commands.get("imageTextAlternative"),p=this._form.labeledInput;this._isInBalloon||this._balloon.add({view:this._form,position:Ih(r)}),p.fieldView.value=p.fieldView.element.value=c.value||"",this._form.labeledInput.fieldView.select()}_hideForm(r){this._isInBalloon&&(this._form.focusTracker.isFocused&&this._form.saveButtonView.focus(),this._balloon.remove(this._form),r&&this.editor.editing.view.focus())}get _isVisible(){return this._balloon.visibleView===this._form}get _isInBalloon(){return this._balloon.hasView(this._form)}}class c2 extends Gi{static get requires(){return[ir,Ug]}static get pluginName(){return"ImageTextAlternative"}}u(63);class Tf extends Gi{static get requires(){return[$o,ap,c2]}static get pluginName(){return"Image"}}class Pr extends Oo{constructor(r){super(r),this.buttonView=new Hr(r),this._fileInputView=new Z1(r),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 Z1 extends Oo{constructor(r){super(r),this.set("acceptedType"),this.set("allowMultipleFiles",!1);const c=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck-hidden"],type:"file",tabindex:"-1",accept:c.to("acceptedType"),multiple:c.to("allowMultipleFiles")},on:{change:c.to(()=>{this.element&&this.element.files&&this.element.files.length&&this.fire("done",this.element.files),this.element.value=""})}})}open(){this.element.click()}}function Zg(b){const r=b.map(c=>c.replace("+","\\+"));return new RegExp(`^image\\/(${r.join("|")})$`)}class l2 extends Gi{init(){const r=this.editor,c=r.t;r.ui.componentFactory.add("imageUpload",p=>{const v=new Pr(p),Z=r.commands.get("imageUpload"),S=r.config.get("image.upload.types"),I=Zg(S);return v.set({acceptedType:S.map(V=>"image/"+V).join(","),allowMultipleFiles:!0}),v.buttonView.set({label:c("Insert image"),icon:'',tooltip:!0}),v.buttonView.bind("isEnabled").to(Z),v.on("done",(V,it)=>{const dt=Array.from(it).filter(xt=>I.test(xt.type));dt.length&&r.execute("imageUpload",{file:dt})}),v})}}u(65),u(67),u(69);class zm extends Gi{constructor(r){super(r),this.placeholder="data:image/svg+xml;utf8,"+encodeURIComponent('')}init(){this.editor.editing.downcastDispatcher.on("attribute:uploadStatus:image",(...r)=>this.uploadStatusChange(...r))}uploadStatusChange(r,c,p){const v=this.editor,Z=c.item,S=Z.getAttribute("uploadId");if(!p.consumable.consume(c.item,r.name))return;const I=v.plugins.get(ol),V=S?c.attributeNewValue:null,it=this.placeholder,dt=v.editing.mapper.toViewElement(Z),xt=p.writer;if("reading"==V)return u2(dt,xt),void d2(it,dt,xt);if("uploading"==V){const le=I.loaders.get(S);return u2(dt,xt),void(le?(p2(dt,xt),function(Ie,rn,vn,wn){const qn=function(mi){const xi=mi.createUIElement("div",{class:"ck-progress-bar"});return mi.setCustomProperty("progressBar",!0,xi),xi}(rn);rn.insert(rn.createPositionAt(Ie,"end"),qn),vn.on("change:uploadedPercent",(mi,xi,Vi)=>{wn.change(Po=>{Po.setStyle("width",Vi+"%",qn)})})}(dt,xt,le,v.editing.view),function(Ie,rn,vn){if(vn.data){const wn=Bc(Ie);rn.setAttribute("src",vn.data,wn)}}(dt,xt,le)):d2(it,dt,xt))}"complete"==V&&I.loaders.get(S)&&function(le,Ie,rn){const vn=Ie.createUIElement("div",{class:"ck-image-upload-complete-icon"});Ie.insert(Ie.createPositionAt(le,"end"),vn),setTimeout(()=>{rn.change(wn=>wn.remove(wn.createRangeOn(vn)))},3e3)}(dt,xt,v.editing.view),rp(dt,xt,"progressBar"),p2(dt,xt),xt.removeClass("ck-appear",dt)}}function u2(b,r){b.hasClass("ck-appear")||r.addClass("ck-appear",b)}function d2(b,r,c){r.hasClass("ck-image-upload-placeholder")||c.addClass("ck-image-upload-placeholder",r);const p=Bc(r);p.getAttribute("src")!==b&&c.setAttribute("src",b,p),w1(r,"placeholder")||c.insert(c.createPositionAfter(p),function(v){const Z=v.createUIElement("div",{class:"ck-upload-placeholder-loader"});return v.setCustomProperty("placeholder",!0,Z),Z}(c))}function p2(b,r){b.hasClass("ck-image-upload-placeholder")&&r.removeClass("ck-image-upload-placeholder",b),rp(b,r,"placeholder")}function w1(b,r){for(const c of b.getChildren())if(c.getCustomProperty(r))return c}function rp(b,r,c){const p=w1(b,c);p&&r.remove(r.createRangeOn(p))}class m2{constructor(r){this.document=r}createDocumentFragment(r){return new Ic(this.document,r)}createElement(r,c,p){return new ts(this.document,r,c,p)}createText(r){return new fa(this.document,r)}clone(r,c=!1){return r._clone(c)}appendChild(r,c){return c._appendChild(r)}insertChild(r,c,p){return p._insertChild(r,c)}removeChildren(r,c,p){return p._removeChildren(r,c)}remove(r){const c=r.parent;return c?this.removeChildren(c.getChildIndex(r),1,c):[]}replace(r,c){const p=r.parent;if(p){const v=p.getChildIndex(r);return this.removeChildren(v,1,p),this.insertChild(v,c,p),!0}return!1}unwrapElement(r){const c=r.parent;if(c){const p=c.getChildIndex(r);this.remove(r),this.insertChild(p,r.getChildren(),c)}}rename(r,c){const p=new ts(this.document,r,c.getAttributes(),c.getChildren());return this.replace(c,p)?p:null}setAttribute(r,c,p){p._setAttribute(r,c)}removeAttribute(r,c){c._removeAttribute(r)}addClass(r,c){c._addClass(r)}removeClass(r,c){c._removeClass(r)}setStyle(r,c,p){Bt(r)&&void 0===p&&(p=c),p._setStyle(r,c)}removeStyle(r,c){c._removeStyle(r)}setCustomProperty(r,c,p){p._setCustomProperty(r,c)}removeCustomProperty(r,c){return c._removeCustomProperty(r)}createPositionAt(r,c){return jn._createAt(r,c)}createPositionAfter(r){return jn._createAfter(r)}createPositionBefore(r){return jn._createBefore(r)}createRange(r,c){return new vi(r,c)}createRangeOn(r){return vi._createOn(r)}createRangeIn(r){return vi._createIn(r)}createSelection(r,c,p){return new Do(r,c,p)}}class Ad extends da{refresh(){this.isEnabled=ep(this.editor.model)}execute(r){const c=this.editor,p=c.model,v=c.plugins.get(ol);p.change(Z=>{const S=Array.isArray(r.file)?r.file:[r.file];for(const I of S)Vm(Z,p,v,I)})}}function Vm(b,r,c,p){const v=c.createLoader(p);v&&gf(b,r,{uploadId:v.id})}class Rh extends Gi{static get requires(){return[ol,Tu,$1]}static get pluginName(){return"ImageUploadEditing"}constructor(r){super(r),r.config.define("image",{upload:{types:["jpeg","png","gif","bmp","webp","tiff"]}})}init(){const r=this.editor,c=r.model.document,p=r.model.schema,v=r.conversion,Z=r.plugins.get(ol),S=Zg(r.config.get("image.upload.types"));p.extend("image",{allowAttributes:["uploadId","uploadStatus"]}),r.commands.add("imageUpload",new Ad(r)),v.for("upcast").attributeToAttribute({view:{name:"img",key:"uploadId"},model:"uploadId"}),this.listenTo(r.editing.view.document,"clipboardInput",(I,V)=>{if(it=V.dataTransfer,Array.from(it.types).includes("text/html")&&""!==it.getData("text/html"))return;var it;const dt=Array.from(V.dataTransfer.files).filter(le=>!!le&&S.test(le.type)),xt=V.targetRanges.map(le=>r.editing.mapper.toModelRange(le));r.model.change(le=>{le.setSelection(xt),dt.length&&(I.stop(),r.model.enqueueChange("default",()=>{r.execute("imageUpload",{file:dt})}))})}),this.listenTo(r.plugins.get($1),"inputTransformation",(I,V)=>{const it=Array.from(r.editing.view.createRangeIn(V.content)).filter(xt=>{return!(!(le=xt.item).is("element","img")||!le.getAttribute("src"))&&(le.getAttribute("src").match(/^data:image\/\w+;base64,/g)||le.getAttribute("src").match(/^blob:/g))&&!xt.item.getAttribute("uploadProcessed");var le}).map(xt=>{return{promise:(le=xt.item,new Promise((Ie,rn)=>{const vn=le.getAttribute("src");fetch(vn).then(wn=>wn.blob()).then(wn=>{const qn=(Po=vn,(Vi=wn).type?Vi.type:Po.match(/data:(image\/\w+);base64/)?Po.match(/data:(image\/\w+);base64/)[1].toLowerCase():"image/jpeg"),mi=qn.replace("image/",""),xi=new File([wn],"image."+mi,{type:qn});var Vi,Po;Ie(xi)}).catch(rn)})),imageElement:xt.item};var le});if(!it.length)return;const dt=new m2(r.editing.view.document);for(const xt of it){dt.setAttribute("uploadProcessed",!0,xt.imageElement);const le=Z.createLoader(xt.promise);le&&(dt.setAttribute("src","",xt.imageElement),dt.setAttribute("uploadId",le.id,xt.imageElement))}}),r.editing.view.document.on("dragover",(I,V)=>{V.preventDefault()}),c.on("change",()=>{const I=c.differ.getChanges({includeChangesInGraveyard:!0});for(const V of I)if("insert"==V.type&&"$text"!=V.name){const it=V.position.nodeAfter,dt="$graveyard"==V.position.root.rootName;for(const xt of _2(r,it)){const le=xt.getAttribute("uploadId");if(!le)continue;const Ie=Z.loaders.get(le);Ie&&(dt?Ie.abort():"idle"==Ie.status&&this._readAndUpload(Ie,xt))}}})}_readAndUpload(r,c){const p=this.editor,v=p.model,Z=p.locale.t,S=p.plugins.get(ol),I=p.plugins.get(Tu);return v.enqueueChange("transparent",it=>{it.setAttribute("uploadStatus","reading",c)}),r.read().then(()=>{const it=r.upload();if(Dr_isSafari){const dt=Bc(p.editing.mapper.toViewElement(c));p.editing.view.once("render",()=>{if(!dt.parent)return;const xt=p.editing.view.domConverter.mapViewToDom(dt.parent);if(!xt)return;const le=xt.style.display;xt.style.display="none",xt._ckHack=xt.offsetHeight,xt.style.display=le})}return v.enqueueChange("transparent",dt=>{dt.setAttribute("uploadStatus","uploading",c)}),it}).then(it=>{v.enqueueChange("transparent",dt=>{dt.setAttributes({uploadStatus:"complete",src:it.default},c),this._parseAndSetSrcsetAttributeOnImage(it,c,dt)}),V()}).catch(it=>{if("error"!==r.status&&"aborted"!==r.status)throw it;"error"==r.status&&it&&I.showWarning(it,{title:Z("Upload failed"),namespace:"upload"}),V(),v.enqueueChange("transparent",dt=>{dt.remove(c)})});function V(){v.enqueueChange("transparent",it=>{it.removeAttribute("uploadId",c),it.removeAttribute("uploadStatus",c)}),S.destroyLoader(r)}}_parseAndSetSrcsetAttributeOnImage(r,c,p){let v=0;const Z=Object.keys(r).filter(S=>{const I=parseInt(S,10);if(!isNaN(I))return v=Math.max(v,I),!0}).map(S=>`${r[S]} ${S}w`).join(", ");""!=Z&&p.setAttribute("srcset",{data:Z,width:v},c)}}function _2(b,r){return Array.from(b.model.createRangeOn(r)).filter(c=>c.item.is("element","image")).map(c=>c.item)}class sp extends Gi{static get pluginName(){return"ImageUpload"}static get requires(){return[Rh,l2,zm]}}class sl extends da{refresh(){const r=this.editor.model,c=zc(r.document.selection.getSelectedBlocks());this.value=!!c&&c.is("element","paragraph"),this.isEnabled=!!c&&Vp(c,r.schema)}execute(r={}){const c=this.editor.model,p=c.document;c.change(v=>{const Z=(r.selection||p.selection).getSelectedBlocks();for(const S of Z)!S.is("element","paragraph")&&Vp(S,c.schema)&&v.rename(S,"paragraph")})}}function Vp(b,r){return r.checkChild(b.parent,"paragraph")&&!r.isObject(b)}class Af extends da{execute(r){const c=this.editor.model;let p=r.position;c.change(v=>{const Z=v.createElement("paragraph");if(!c.schema.checkChild(p.parent,Z)){const S=c.schema.findAllowedParent(p,Z);if(!S)return;p=v.split(p,S).position}c.insertContent(Z,p),v.setSelection(Z,"in")})}}class Bp extends Gi{static get pluginName(){return"Paragraph"}init(){const r=this.editor,c=r.model,p=r.data;r.commands.add("paragraph",new sl(r)),r.commands.add("insertParagraph",new Af(r)),c.schema.register("paragraph",{inheritAllFrom:"$block"}),r.conversion.elementToElement({model:"paragraph",view:"p"}),r.conversion.for("upcast").elementToElement({model:(v,Z)=>Bp.paragraphLikeElements.has(v.name)?v.isEmpty?null:Z.createElement("paragraph"):null,converterPriority:"low"}),p.upcastDispatcher.on("element",(v,Z,S)=>{S.consumable.test(Z.viewItem,{name:Z.viewItem.name})&&Hh(Z.viewItem,Z.modelCursor,S.schema)&&Object.assign(Z,cp(Z.viewItem,Z.modelCursor,S))},{priority:"low"}),p.upcastDispatcher.on("text",(v,Z,S)=>{Z.modelRange||Hh(Z.viewItem,Z.modelCursor,S.schema)&&Object.assign(Z,cp(Z.viewItem,Z.modelCursor,S))},{priority:"lowest"}),c.document.registerPostFixer(v=>this._autoparagraphEmptyRoots(v)),r.data.on("ready",()=>{c.enqueueChange("transparent",v=>this._autoparagraphEmptyRoots(v))},{priority:"lowest"})}_autoparagraphEmptyRoots(r){const c=this.editor.model;for(const p of c.document.getRootNames()){const v=c.document.getRoot(p);if(v.isEmpty&&"$graveyard"!=v.rootName&&c.schema.checkChild(v,"paragraph"))return r.insertElement("paragraph",v),!0}}}function cp(b,r,c){const p=c.writer.createElement("paragraph");return c.writer.insert(p,r),c.convertItem(b,c.writer.createPositionAt(p,0))}function Hh(b,r,c){const p=c.createContext(r);return!!c.checkChild(p,"paragraph")&&!!c.checkChild(p.push("paragraph"),b)}Bp.paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td"]);class Bm extends da{constructor(r,c){super(r),this.modelElements=c}refresh(){const r=zc(this.editor.model.document.selection.getSelectedBlocks());this.value=!!r&&this.modelElements.includes(r.name)&&r.name,this.isEnabled=!!r&&this.modelElements.some(c=>lp(r,c,this.editor.model.schema))}execute(r){const c=this.editor.model,p=c.document,v=r.value;c.change(Z=>{const S=Array.from(p.selection.getSelectedBlocks()).filter(I=>lp(I,v,c.schema));for(const I of S)I.is("element",v)||Z.rename(I,v)})}}function lp(b,r,c){return c.checkChild(b.parent,r)&&!c.isObject(b)}class Jp extends Gi{static get pluginName(){return"HeadingEditing"}constructor(r){super(r),r.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[Bp]}init(){const r=this.editor,c=r.config.get("heading.options"),p=[];for(const v of c)"paragraph"!==v.model&&(r.model.schema.register(v.model,{inheritAllFrom:"$block"}),r.conversion.elementToElement(v),p.push(v.model));this._addDefaultH1Conversion(r),r.commands.add("heading",new Bm(r,p))}afterInit(){const r=this.editor,c=r.commands.get("enter"),p=r.config.get("heading.options");c&&this.listenTo(c,"afterExecute",(v,Z)=>{const S=r.model.document.selection.getFirstPosition().parent;p.some(I=>S.is("element",I.model))&&!S.is("element","paragraph")&&0===S.childCount&&Z.writer.rename(S,"paragraph")})}_addDefaultH1Conversion(r){r.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:ar.get("low")+1})}}class Gp{constructor(r,c){c&&At(this,c),r&&this.set(r)}}Si(Gp,Ut),u(11);class M3 extends Gi{init(){const r=this.editor,c=r.t,p=function(S){const I=S.t,V={Paragraph:I("Paragraph"),"Heading 1":I("Heading 1"),"Heading 2":I("Heading 2"),"Heading 3":I("Heading 3"),"Heading 4":I("Heading 4"),"Heading 5":I("Heading 5"),"Heading 6":I("Heading 6")};return S.config.get("heading.options").map(it=>{const dt=V[it.title];return dt&&dt!=it.title&&(it.title=dt),it})}(r),v=c("Choose heading"),Z=c("Heading");r.ui.componentFactory.add("heading",S=>{const I={},V=new Ra,it=r.commands.get("heading"),dt=r.commands.get("paragraph"),xt=[it];for(const Ie of p){const rn={type:"button",model:new Gp({label:Ie.title,class:Ie.class,withText:!0})};"paragraph"===Ie.model?(rn.model.bind("isOn").to(dt,"value"),rn.model.set("commandName","paragraph"),xt.push(dt)):(rn.model.bind("isOn").to(it,"value",vn=>vn===Ie.model),rn.model.set({commandName:"heading",commandValue:Ie.model})),V.add(rn),I[Ie.model]=Ie.title}const le=Qu(S);return lh(le,V),le.buttonView.set({isOn:!1,withText:!0,tooltip:Z}),le.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),le.bind("isEnabled").toMany(xt,"isEnabled",(...Ie)=>Ie.some(rn=>rn)),le.buttonView.bind("label").to(it,"value",dt,"value",(Ie,rn)=>{const vn=Ie||rn&&"paragraph";return I[vn]?I[vn]:v}),this.listenTo(le,"execute",Ie=>{r.execute(Ie.source.commandName,Ie.source.commandValue?{value:Ie.source.commandValue}:void 0),r.editing.view.focus()}),le})}}function up(b){for(const r of b.getChildren())if(r&&r.is("element","caption"))return r;return null}function f2(b){const r=b.parent;return"figcaption"==b.name&&r&&"figure"==r.name&&r.hasClass("image")?{name:!0}:null}class Qp extends Gi{static get pluginName(){return"ImageCaptionEditing"}init(){const r=this.editor,c=r.editing.view,v=r.data,Z=r.editing,S=r.t;r.model.schema.register("caption",{allowIn:"image",allowContentOf:"$block",isLimit:!0}),r.model.document.registerPostFixer(V=>this._insertMissingModelCaptionElement(V)),r.conversion.for("upcast").elementToElement({view:f2,model:"caption"}),v.downcastDispatcher.on("insert:caption",h2(V=>V.createContainerElement("figcaption"),!1));const I=(V=c,it=S("Enter image caption"),dt=>{const xt=dt.createEditableElement("figcaption");return dt.setCustomProperty("imageCaption",!0,xt),D_({view:V,element:xt,text:it}),$u(xt,dt)});var V,it;Z.downcastDispatcher.on("insert:caption",h2(I)),Z.downcastDispatcher.on("insert",this._fixCaptionVisibility(V=>V.item),{priority:"high"}),Z.downcastDispatcher.on("remove",this._fixCaptionVisibility(V=>V.position.parent),{priority:"high"}),c.document.registerPostFixer(V=>this._updateCaptionVisibility(V))}_updateCaptionVisibility(r){const c=this.editor.editing.mapper,p=this._lastSelectedCaption;let v;const Z=this.editor.model.document.selection,S=Z.getSelectedElement();if(S&&S.is("element","image")){const V=up(S);v=c.toViewElement(V)}const I=Uf(Z.getFirstPosition().parent);if(I&&(v=c.toViewElement(I)),v)return p?(p===v||(jp(p,r),this._lastSelectedCaption=v),Wp(v,r)):(this._lastSelectedCaption=v,Wp(v,r));if(p){const V=jp(p,r);return this._lastSelectedCaption=null,V}return!1}_fixCaptionVisibility(r){return(c,p,v)=>{const Z=Uf(r(p)),I=v.writer;if(Z){const V=this.editor.editing.mapper.toViewElement(Z);V&&(Z.childCount?I.removeClass("ck-hidden",V):I.addClass("ck-hidden",V))}}}_insertMissingModelCaptionElement(r){const c=this.editor.model,p=c.document.differ.getChanges(),v=[];for(const Z of p)if("insert"==Z.type&&"$text"!=Z.name){const S=Z.position.nodeAfter;if(S.is("element","image")&&!up(S)&&v.push(S),!S.is("element","image")&&S.childCount)for(const I of c.createRangeIn(S).getItems())I.is("element","image")&&!up(I)&&v.push(I)}for(const Z of v)r.appendElement("caption",Z);return!!v.length}}function h2(b,r=!0){return(c,p,v)=>{const Z=p.item;if((Z.childCount||r)&&Bd(Z.parent)){if(!v.consumable.consume(p.item,"insert"))return;const S=v.mapper.toViewElement(p.range.start.parent),I=b(v.writer),V=v.writer;Z.childCount||V.addClass("ck-hidden",I),function(it,dt,xt,le){const Ie=le.writer.createPositionAt(xt,"end");le.writer.insert(Ie,it),le.mapper.bindElements(dt,it)}(I,p.item,S,v)}}}function Uf(b){const r=b.getAncestors({includeSelf:!0}).find(c=>"caption"==c.name);return r&&r.parent&&"image"==r.parent.name?r:null}function jp(b,r){return!b.childCount&&!b.hasClass("ck-hidden")&&(r.addClass("ck-hidden",b),!0)}function Wp(b,r){return!!b.hasClass("ck-hidden")&&(r.removeClass("ck-hidden",b),!0)}u(72);class Uu extends da{constructor(r,c){super(r),this.defaultStyle=!1,this.styles=c.reduce((p,v)=>(p[v.name]=v,v.isDefault&&(this.defaultStyle=v.name),p),{})}refresh(){const r=this.editor.model.document.selection.getSelectedElement();if(this.isEnabled=Bd(r),r)if(r.hasAttribute("imageStyle")){const c=r.getAttribute("imageStyle");this.value=!!this.styles[c]&&c}else this.value=this.defaultStyle;else this.value=!1}execute(r){const c=r.value,p=this.editor.model,v=p.document.selection.getSelectedElement();p.change(Z=>{this.styles[c].isDefault?Z.removeAttribute("imageStyle",v):Z.setAttribute("imageStyle",c,v)})}}function Jm(b,r){for(const c of r)if(c.name===b)return c}var $p='',Kp='',Yh='',dp='';const Gm={full:{name:"full",title:"Full size image",icon:$p,isDefault:!0},side:{name:"side",title:"Side image",icon:dp,className:"image-style-side"},alignLeft:{name:"alignLeft",title:"Left aligned image",icon:Kp,className:"image-style-align-left"},alignCenter:{name:"alignCenter",title:"Centered image",icon:Yh,className:"image-style-align-center"},alignRight:{name:"alignRight",title:"Right aligned image",icon:dp,className:"image-style-align-right"}},Qm={full:$p,left:Kp,right:dp,center:Yh};function g2(b=[]){return b.map(jm)}function jm(b){if("string"==typeof b){const r=b;Gm[r]?b=Object.assign({},Gm[r]):(console.warn(Object(En.a)("image-style-not-found: There is no such image style of given name."),{name:r}),b={name:r})}else if(Gm[b.name]){const r=Gm[b.name],c=Object.assign({},b);for(const p in r)Object.prototype.hasOwnProperty.call(b,p)||(c[p]=r[p]);b=c}return"string"==typeof b.icon&&Qm[b.icon]&&(b.icon=Qm[b.icon]),b}class v2 extends Gi{static get pluginName(){return"ImageStyleEditing"}init(){const r=this.editor,c=r.model.schema,p=r.data,v=r.editing;r.config.define("image.styles",["full","side"]);const Z=g2(r.config.get("image.styles"));c.extend("image",{allowAttributes:"imageStyle"});const S=(I=Z,(V,it,dt)=>{if(!dt.consumable.consume(it.item,V.name))return;const xt=Jm(it.attributeNewValue,I),le=Jm(it.attributeOldValue,I),Ie=dt.mapper.toViewElement(it.item),rn=dt.writer;le&&rn.removeClass(le.className,Ie),xt&&rn.addClass(xt.className,Ie)});var I;v.downcastDispatcher.on("attribute:imageStyle:image",S),p.downcastDispatcher.on("attribute:imageStyle:image",S),p.upcastDispatcher.on("element:figure",function(I){const V=I.filter(it=>!it.isDefault);return(it,dt,xt)=>{if(!dt.modelRange)return;const le=dt.viewItem,Ie=zc(dt.modelRange.getItems());if(xt.schema.checkAttribute(Ie,"imageStyle"))for(const rn of V)xt.consumable.consume(le,{classes:rn.className})&&xt.writer.setAttribute("imageStyle",rn.name,Ie)}}(Z),{priority:"low"}),r.commands.add("imageStyle",new Uu(r,Z))}}u(74);class tu extends Gi{static get pluginName(){return"ImageStyleUI"}get localizedDefaultStylesTitles(){const r=this.editor.t;return{"Full size image":r("Full size image"),"Side image":r("Side image"),"Left aligned image":r("Left aligned image"),"Centered image":r("Centered image"),"Right aligned image":r("Right aligned image")}}init(){const r=function(c,p){for(const v of c)p[v.title]&&(v.title=p[v.title]);return c}(g2(this.editor.config.get("image.styles")),this.localizedDefaultStylesTitles);for(const c of r)this._createButton(c)}_createButton(r){const c=this.editor;c.ui.componentFactory.add("imageStyle:"+r.name,v=>{const Z=c.commands.get("imageStyle"),S=new Hr(v);return S.set({label:r.title,icon:r.icon,tooltip:!0,isToggleable:!0}),S.bind("isEnabled").to(Z,"isEnabled"),S.bind("isOn").to(Z,"value",I=>I===r.name),this.listenTo(S,"execute",()=>{c.execute("imageStyle",{value:r.name}),c.editing.view.focus()}),S})}}class pp extends Gi{static get requires(){return[Jc]}static get pluginName(){return"WidgetToolbarRepository"}init(){const r=this.editor;if(r.plugins.has("BalloonToolbar")){const c=r.plugins.get("BalloonToolbar");this.listenTo(c,"show",p=>{(function(v){const Z=v.getSelectedElement();return!(!Z||!$l(Z))})(r.editing.view.document.selection)&&p.stop()},{priority:"high"})}this._toolbarDefinitions=new Map,this._balloon=this.editor.plugins.get("ContextualBalloon"),this.on("change:isEnabled",()=>{this._updateToolbarsVisibility()}),this.listenTo(r.ui,"update",()=>{this._updateToolbarsVisibility()}),this.listenTo(r.ui.focusTracker,"change:isFocused",()=>{this._updateToolbarsVisibility()},{priority:"low"})}destroy(){super.destroy();for(const r of this._toolbarDefinitions.values())r.view.destroy()}register(r,{ariaLabel:c,items:p,getRelatedElement:v,balloonClassName:Z="ck-toolbar-container"}){if(!p.length)return void console.warn(Object(En.a)("widget-toolbar-no-items: Trying to register a toolbar without items."),{toolbarId:r});const S=this.editor,I=S.t,V=new Um(S.locale);if(V.ariaLabel=c||I("Widget toolbar"),this._toolbarDefinitions.has(r))throw new En.b("widget-toolbar-duplicated: Toolbar with the given id was already added.",this,{toolbarId:r});V.fillFromConfig(p,S.ui.componentFactory),this._toolbarDefinitions.set(r,{view:V,getRelatedElement:v,balloonClassName:Z})}_updateToolbarsVisibility(){let r=0,c=null,p=null;for(const v of this._toolbarDefinitions.values()){const Z=v.getRelatedElement(this.editor.editing.view.document.selection);if(this.isEnabled&&Z)if(this.editor.ui.focusTracker.isFocused){const S=Z.getAncestors().length;S>r&&(r=S,c=Z,p=v)}else this._isToolbarVisible(v)&&this._hideToolbar(v);else this._isToolbarInBalloon(v)&&this._hideToolbar(v)}p&&this._showToolbar(p,c)}_hideToolbar(r){this._balloon.remove(r.view),this.stopListening(this._balloon,"change:visibleView")}_showToolbar(r,c){this._isToolbarVisible(r)?b2(this.editor,c):this._isToolbarInBalloon(r)||(this._balloon.add({view:r.view,position:Zf(this.editor,c),balloonClassName:r.balloonClassName}),this.listenTo(this._balloon,"change:visibleView",()=>{for(const p of this._toolbarDefinitions.values())if(this._isToolbarVisible(p)){const v=p.getRelatedElement(this.editor.editing.view.document.selection);b2(this.editor,v)}}))}_isToolbarVisible(r){return this._balloon.visibleView===r.view}_isToolbarInBalloon(r){return this._balloon.hasView(r.view)}}function b2(b,r){const c=b.plugins.get("ContextualBalloon"),p=Zf(b,r);c.updatePosition(p)}function Zf(b,r){const p=pa.defaultPositions;return{target:b.editing.view.domConverter.mapViewToDom(r),positions:[p.northArrowSouth,p.northArrowSouthWest,p.northArrowSouthEast,p.southArrowNorth,p.southArrowNorthWest,p.southArrowNorthEast,wc]}}class C2 extends da{constructor(r){super(r),this._childCommands=[]}refresh(){}execute(...r){return this._getFirstEnabledCommand().execute(r)}registerChildCommand(r){this._childCommands.push(r),r.on("change:isEnabled",()=>this._checkEnabled()),this._checkEnabled()}_checkEnabled(){this.isEnabled=!!this._getFirstEnabledCommand()}_getFirstEnabledCommand(){return this._childCommands.find(r=>r.isEnabled)}}class x2 extends Gi{static get pluginName(){return"IndentEditing"}init(){const r=this.editor;r.commands.add("indent",new C2(r)),r.commands.add("outdent",new C2(r))}}var wf='',y2='';class Xp extends Gi{static get pluginName(){return"IndentUI"}init(){const r=this.editor,c=r.locale,p=r.t,v="ltr"==c.uiLanguageDirection?wf:y2,Z="ltr"==c.uiLanguageDirection?y2:wf;this._defineButton("indent",p("Increase indent"),v),this._defineButton("outdent",p("Decrease indent"),Z)}_defineButton(r,c,p){const v=this.editor;v.ui.componentFactory.add(r,Z=>{const S=v.commands.get(r),I=new Hr(Z);return I.set({label:c,icon:p,tooltip:!0}),I.bind("isOn","isEnabled").to(S,"value","isEnabled"),this.listenTo(I,"execute",()=>{v.execute(r),v.editing.view.focus()}),I})}}class Wm extends dd{constructor(r){super(r),this.domEventType="click"}onDomEvent(r){this.fire(r.type,r)}}u(76);class wg extends Oo{constructor(r,c,p){super(r);const v=r.t;this.focusTracker=new ws,this.keystrokes=new _u,this.urlInputView=this._createUrlInput(p),this.saveButtonView=this._createButton(v("Save"),a2,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(v("Cancel"),Ym,"ck-button-cancel","cancel"),this._manualDecoratorSwitches=this._createManualDecoratorSwitches(c),this.children=this._createFormChildren(c.manualDecorators),this._focusables=new Zl,this._focusCycler=new _1({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});const Z=["ck","ck-link-form"];c.manualDecorators.length&&Z.push("ck-link-form_layout-vertical"),this.setTemplate({tag:"form",attributes:{class:Z,tabindex:"-1"},children:this.children})}getDecoratorSwitchesState(){return Array.from(this._manualDecoratorSwitches).reduce((r,c)=>(r[c.name]=c.isOn,r),{})}render(){super.render(),Hm({view:this}),[this.urlInputView,...this._manualDecoratorSwitches,this.saveButtonView,this.cancelButtonView].forEach(r=>{this._focusables.add(r),this.focusTracker.add(r.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}_createUrlInput(r="https://"){const c=this.locale.t,p=new zp(this.locale,yf);return p.label=c("Link URL"),p.fieldView.placeholder=r+"example.com",p}_createButton(r,c,p,v){const Z=new Hr(this.locale);return Z.set({label:r,icon:c,tooltip:!0}),Z.extendTemplate({attributes:{class:p}}),v&&Z.delegate("execute").to(this,v),Z}_createManualDecoratorSwitches(r){const c=this.createCollection();for(const p of r.manualDecorators){const v=new qp(this.locale);v.set({name:p.id,label:p.label,withText:!0}),v.bind("isOn").toMany([p,r],"value",(Z,S)=>void 0===S&&void 0===Z?p.defaultValue:Z),v.on("execute",()=>{p.set("value",!v.isOn)}),c.add(v)}return c}_createFormChildren(r){const c=this.createCollection();if(c.add(this.urlInputView),r.length){const p=new Oo;p.setTemplate({tag:"ul",children:this._manualDecoratorSwitches.map(v=>({tag:"li",children:[v],attributes:{class:["ck","ck-list__item"]}})),attributes:{class:["ck","ck-reset","ck-list"]}}),c.add(p)}return c.add(this.saveButtonView),c.add(this.cancelButtonView),c}}u(78);class w extends Oo{constructor(r){super(r);const c=r.t;this.focusTracker=new ws,this.keystrokes=new _u,this.previewButtonView=this._createPreviewButton(),this.unlinkButtonView=this._createButton(c("Unlink"),'',"unlink"),this.editButtonView=this._createButton(c("Edit link"),'',"edit"),this.set("href"),this._focusables=new Zl,this._focusCycler=new _1({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(),[this.previewButtonView,this.editButtonView,this.unlinkButtonView].forEach(r=>{this._focusables.add(r),this.focusTracker.add(r.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}_createButton(r,c,p){const v=new Hr(this.locale);return v.set({label:r,icon:c,tooltip:!0}),v.delegate("execute").to(this,p),v}_createPreviewButton(){const r=new Hr(this.locale),c=this.bindTemplate,p=this.t;return r.set({withText:!0,tooltip:p("Open link in new tab")}),r.extendTemplate({attributes:{class:["ck","ck-link-actions__preview"],href:c.to("href",v=>v&&Q_(v)),target:"_blank",rel:"noopener noreferrer"}}),r.bind("label").to(this,"href",v=>v||p("This link has no URL")),r.bind("isEnabled").to(this,"href",v=>!!v),r.template.tag="a",r.template.eventListeners={},r}}const E=/^((\w+:(\/{2,})?)|(\W))/i,tt=/[\w-]+@[\w-]+\.+[\w-]+/i;class zt extends Gi{static get requires(){return[Jc]}static get pluginName(){return"LinkUI"}init(){const r=this.editor;r.editing.view.addObserver(Wm),this.actionsView=this._createActionsView(),this.formView=this._createFormView(),this._balloon=r.plugins.get(Jc),this._createToolbarLinkButton(),this._enableUserBalloonInteractions(),r.conversion.for("editingDowncast").markerToHighlight({model:"link-ui",view:{classes:["ck-fake-link-selection"]}}),r.conversion.for("editingDowncast").markerToElement({model:"link-ui",view:{name:"span",classes:["ck-fake-link-selection","ck-fake-link-selection_collapsed"]}})}destroy(){super.destroy(),this.formView.destroy()}_createActionsView(){const r=this.editor,c=new w(r.locale),p=r.commands.get("link"),v=r.commands.get("unlink");return c.bind("href").to(p,"value"),c.editButtonView.bind("isEnabled").to(p),c.unlinkButtonView.bind("isEnabled").to(v),this.listenTo(c,"edit",()=>{this._addFormView()}),this.listenTo(c,"unlink",()=>{r.execute("unlink"),this._hideUI()}),c.keystrokes.set("Esc",(Z,S)=>{this._hideUI(),S()}),c.keystrokes.set("Ctrl+K",(Z,S)=>{this._addFormView(),S()}),c}_createFormView(){const r=this.editor,c=r.commands.get("link"),p=r.config.get("link.defaultProtocol"),v=new wg(r.locale,c,p);return v.urlInputView.fieldView.bind("value").to(c,"value"),v.urlInputView.bind("isReadOnly").to(c,"isEnabled",Z=>!Z),v.saveButtonView.bind("isEnabled").to(c),this.listenTo(v,"submit",()=>{const{value:Z}=v.urlInputView.fieldView.element,S=!!p&&!E.test(Z),I=tt.test(Z);r.execute("link",Z&&S?(I?"mailto:":p)+Z:Z,v.getDecoratorSwitchesState()),this._closeFormView()}),this.listenTo(v,"cancel",()=>{this._closeFormView()}),v.keystrokes.set("Esc",(Z,S)=>{this._closeFormView(),S()}),v}_createToolbarLinkButton(){const r=this.editor,c=r.commands.get("link"),p=r.t;r.keystrokes.set("Ctrl+K",(v,Z)=>{Z(),this._showUI(!0)}),r.ui.componentFactory.add("link",v=>{const Z=new Hr(v);return Z.isEnabled=!0,Z.label=p("Link"),Z.icon='',Z.keystroke="Ctrl+K",Z.tooltip=!0,Z.isToggleable=!0,Z.bind("isEnabled").to(c,"isEnabled"),Z.bind("isOn").to(c,"value",S=>!!S),this.listenTo(Z,"execute",()=>this._showUI(!0)),Z})}_enableUserBalloonInteractions(){this.listenTo(this.editor.editing.view.document,"click",()=>{this._getSelectedLinkElement()&&this._showUI()}),this.editor.keystrokes.set("Tab",(c,p)=>{this._areActionsVisible&&!this.actionsView.focusTracker.isFocused&&(this.actionsView.focus(),p())},{priority:"high"}),this.editor.keystrokes.set("Esc",(c,p)=>{this._isUIVisible&&(this._hideUI(),p())}),Am({emitter:this.formView,activator:()=>this._isUIInPanel,contextElements:[this._balloon.view.element],callback:()=>this._hideUI()})}_addActionsView(){this._areActionsInPanel||this._balloon.add({view:this.actionsView,position:this._getBalloonPositionData()})}_addFormView(){if(this._isFormInPanel)return;const r=this.editor.commands.get("link");this._balloon.add({view:this.formView,position:this._getBalloonPositionData()}),this._balloon.visibleView===this.formView&&this.formView.urlInputView.fieldView.select(),this.formView.urlInputView.fieldView.element.value=r.value||""}_closeFormView(){const r=this.editor.commands.get("link");r.restoreManualDecoratorStates(),void 0!==r.value?this._removeFormView():this._hideUI()}_removeFormView(){this._isFormInPanel&&(this.formView.saveButtonView.focus(),this._balloon.remove(this.formView),this.editor.editing.view.focus(),this._hideFakeVisualSelection())}_showUI(r=!1){this._getSelectedLinkElement()?(this._areActionsVisible?this._addFormView():this._addActionsView(),r&&this._balloon.showStack("main")):(this._addActionsView(),r&&this._balloon.showStack("main"),this._addFormView(),this._showFakeVisualSelection()),this._startUpdatingUI()}_hideUI(){if(!this._isUIInPanel)return;const r=this.editor;this.stopListening(r.ui,"update"),this.stopListening(this._balloon,"change:visibleView"),r.editing.view.focus(),this._removeFormView(),this._balloon.remove(this.actionsView),this._hideFakeVisualSelection()}_startUpdatingUI(){const r=this.editor,c=r.editing.view.document;let p=this._getSelectedLinkElement(),v=S();const Z=()=>{const I=this._getSelectedLinkElement(),V=S();p&&!I||!p&&V!==v?this._hideUI():this._isUIVisible&&this._balloon.updatePosition(this._getBalloonPositionData()),p=I,v=V};function S(){return c.selection.focus.getAncestors().reverse().find(I=>I.is("element"))}this.listenTo(r.ui,"update",Z),this.listenTo(this._balloon,"change:visibleView",Z)}get _isFormInPanel(){return this._balloon.hasView(this.formView)}get _areActionsInPanel(){return this._balloon.hasView(this.actionsView)}get _areActionsVisible(){return this._balloon.visibleView===this.actionsView}get _isUIInPanel(){return this._isFormInPanel||this._areActionsInPanel}get _isUIVisible(){return this._balloon.visibleView==this.formView||this._areActionsVisible}_getBalloonPositionData(){const r=this.editor.editing.view,c=r.document,p=this._getSelectedLinkElement();return{target:p?r.domConverter.mapViewToDom(p):r.domConverter.viewRangeToDom(c.selection.getFirstRange())}}_getSelectedLinkElement(){const r=this.editor.editing.view,c=r.document.selection;if(c.isCollapsed)return Ue(c.getFirstPosition());{const p=c.getFirstRange().getTrimmed(),v=Ue(p.start),Z=Ue(p.end);return v&&v==Z&&r.createRangeIn(v).getTrimmed().isEqual(p)?v:null}}_showFakeVisualSelection(){const r=this.editor.model;r.change(c=>{r.markers.has("link-ui")?c.updateMarker("link-ui",{range:r.document.selection.getFirstRange()}):c.addMarker("link-ui",{usingOperation:!1,affectsData:!1,range:r.document.selection.getFirstRange()})})}_hideFakeVisualSelection(){const r=this.editor.model;r.markers.has("link-ui")&&r.change(c=>{c.removeMarker("link-ui")})}}function Ue(b){return b.getAncestors().find(r=>{return(c=r).is("attributeElement")&&!!c.getCustomProperty("link");var c})}class nn extends da{constructor(r,c){super(r),this.type=c}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(){const r=this.editor.model,p=Array.from(r.document.selection.getSelectedBlocks()).filter(Z=>Yn(Z,r.schema)),v=!0===this.value;r.change(Z=>{if(v){let S=p[p.length-1].nextSibling,I=Number.POSITIVE_INFINITY,V=[];for(;S&&"listItem"==S.name&&0!==S.getAttribute("listIndent");){const it=S.getAttribute("listIndent");it=c;)Z>v.getAttribute("listIndent")&&(Z=v.getAttribute("listIndent")),v.getAttribute("listIndent")==Z&&b[r?"unshift":"push"](v),v=v[r?"previousSibling":"nextSibling"]}}function Yn(b,r){return r.checkChild(b.parent,"listItem")&&!r.isObject(b)}class Bn extends da{constructor(r,c){super(r),this._indentBy="forward"==c?1:-1}refresh(){this.isEnabled=this._checkEnabled()}execute(){const r=this.editor.model;let p=Array.from(r.document.selection.getSelectedBlocks());r.change(v=>{const Z=p[p.length-1];let S=Z.nextSibling;for(;S&&"listItem"==S.name&&S.getAttribute("listIndent")>Z.getAttribute("listIndent");)p.push(S),S=S.nextSibling;this._indentBy<0&&(p=p.reverse());for(const I of p){const V=I.getAttribute("listIndent")+this._indentBy;V<0?v.rename(I,"paragraph"):v.setAttribute("listIndent",V,I)}})}_checkEnabled(){const r=zc(this.editor.model.document.selection.getSelectedBlocks());if(!r||!r.is("element","listItem"))return!1;if(this._indentBy>0){const c=r.getAttribute("listIndent"),p=r.getAttribute("listType");let v=r.previousSibling;for(;v&&v.is("element","listItem")&&v.getAttribute("listIndent")>=c;){if(v.getAttribute("listIndent")==c)return v.getAttribute("listType")==p;v=v.previousSibling}return!1}return!0}}function wi(b,r,c,p){const v=r.parent,Z=c.mapper,S=c.writer;let I=Z.toViewPosition(p.createPositionBefore(b));const V=io(b.previousSibling,{sameIndent:!0,smallerIndent:!0,listIndent:b.getAttribute("listIndent")}),it=b.previousSibling;if(V&&V.getAttribute("listIndent")==b.getAttribute("listIndent")){const dt=Z.toViewElement(V);I=S.breakContainer(S.createPositionAfter(dt))}else if(it&&"listItem"==it.name){I=Z.toViewPosition(p.createPositionAt(it,"end"));const dt=Z.findMappedViewAncestor(I),xt=function(le){for(const Ie of le.getChildren())if("ul"==Ie.name||"ol"==Ie.name)return Ie;return null}(dt);I=xt?S.createPositionBefore(xt):S.createPositionAt(dt,"end")}else I=Z.toViewPosition(p.createPositionBefore(b));if(I=Wi(I),S.insert(I,v),it&&"listItem"==it.name){const dt=Z.toViewElement(it),xt=S.createRange(S.createPositionAt(dt,0),I).getWalker({ignoreElementEnd:!0});for(const le of xt)if(le.item.is("element","li")){const Ie=S.breakContainer(S.createPositionBefore(le.item)),rn=le.item.parent,vn=S.createPositionAt(r,"end");Ui(S,vn.nodeBefore,vn.nodeAfter),S.move(S.createRangeOn(rn),vn),xt.position=Ie}}else{const dt=v.nextSibling;if(dt&&(dt.is("element","ul")||dt.is("element","ol"))){let xt=null;for(const le of dt.getChildren()){const Ie=Z.toModelElement(le);if(!(Ie&&Ie.getAttribute("listIndent")>b.getAttribute("listIndent")))break;xt=le}xt&&(S.breakContainer(S.createPositionAfter(xt)),S.move(S.createRangeOn(xt.parent),S.createPositionAt(r,"end")))}}Ui(S,v,v.nextSibling),Ui(S,v.previousSibling,v)}function Ui(b,r,c){return!r||!c||"ul"!=r.name&&"ol"!=r.name||r.name!=c.name||r.getAttribute("class")!==c.getAttribute("class")?null:b.mergeContainers(b.createPositionAfter(r))}function Wi(b){return b.getLastMatchingPosition(r=>r.item.is("uiElement"))}function io(b,r){const c=!!r.sameIndent,p=!!r.smallerIndent,v=r.listIndent;let Z=b;for(;Z&&"listItem"==Z.name;){const S=Z.getAttribute("listIndent");if(c&&v==S||p&&v>S)return Z;Z=Z.previousSibling}return null}function To(b,r,c,p){b.ui.componentFactory.add(r,v=>{const Z=b.commands.get(r),S=new Hr(v);return S.set({label:c,icon:p,tooltip:!0,isToggleable:!0}),S.bind("isOn","isEnabled").to(Z,"value","isEnabled"),S.on("execute",()=>{b.execute(r),b.editing.view.focus()}),S})}function wo(){const b=!this.isEmpty&&("ul"==this.getChild(0).name||"ol"==this.getChild(0).name);return this.isEmpty||b?0:Fl.call(this)}function vo(b){return(r,c,p)=>{const v=p.consumable;if(!v.test(c.item,"insert")||!v.test(c.item,"attribute:listType")||!v.test(c.item,"attribute:listIndent"))return;v.consume(c.item,"insert"),v.consume(c.item,"attribute:listType"),v.consume(c.item,"attribute:listIndent");const Z=c.item;wi(Z,function Mi(b,r){const c=r.mapper,p=r.writer,v="numbered"==b.getAttribute("listType")?"ol":"ul",Z=function(I){const V=I.createContainerElement("li");return V.getFillerOffset=wo,V}(p),S=p.createContainerElement(v,null);return p.insert(p.createPositionAt(S,0),Z),c.bindElements(b,Z),Z}(Z,p),p,b)}}function sa(b,r,c){if(!c.consumable.consume(r.item,"attribute:listType"))return;const p=c.mapper.toViewElement(r.item),v=c.writer;v.breakContainer(v.createPositionBefore(p)),v.breakContainer(v.createPositionAfter(p)),v.rename("numbered"==r.attributeNewValue?"ol":"ul",p.parent)}function Qo(b,r,c){const p=c.mapper.toViewElement(r.item).parent,v=c.writer;Ui(v,p,p.nextSibling),Ui(v,p.previousSibling,p);for(const Z of r.item.getChildren())c.consumable.consume(Z,"insert")}function Gc(b,r,c){if("listItem"!=r.item.name){let p=c.mapper.toViewPosition(r.range.start);const v=c.writer,Z=[];for(;("ul"==p.parent.name||"ol"==p.parent.name)&&(p=v.breakContainer(p),"li"==p.parent.name);){const S=p,I=v.createPositionAt(p.parent,"end");if(!S.isEqual(I)){const V=v.remove(v.createRange(S,I));Z.push(V)}p=v.createPositionAfter(p.parent)}if(Z.length>0){for(let S=0;S0){const V=Ui(v,I,I.nextSibling);V&&V.parent==I&&p.offset--}}Ui(v,p.nodeBefore,p.nodeAfter)}}}function gs(b,r,c){const p=c.mapper.toViewPosition(r.position);Ui(c.writer,p.nodeBefore,p.nodeAfter)}function pc(b,r,c){if(c.consumable.consume(r.viewItem,{name:!0})){const p=c.writer,v=p.createElement("listItem"),Z=function(it){let dt=0,xt=it.parent;for(;xt;){if(xt.is("element","li"))dt++;else{const le=xt.previousSibling;le&&le.is("element","li")&&dt++}xt=xt.parent}return dt}(r.viewItem);p.setAttribute("listIndent",Z,v),p.setAttribute("listType",r.viewItem.parent&&"ol"==r.viewItem.parent.name?"numbered":"bulleted",v);const I=c.splitToAllowedParent(v,r.modelCursor);if(!I)return;p.insert(v,I.position);const V=function(it,dt,xt){const{writer:le,schema:Ie}=xt;let rn=le.createPositionAfter(it);for(const vn of dt)if("ul"==vn.name||"ol"==vn.name)rn=xt.convertItem(vn,rn).modelCursor;else{const wn=xt.convertItem(vn,le.createPositionAt(it,"end")),qn=wn.modelRange.start.nodeAfter;qn&&qn.is("element")&&!Ie.checkChild(it,qn.name)&&(it=wn.modelCursor.parent.is("element","listItem")?wn.modelCursor.parent:T2(wn.modelCursor),rn=le.createPositionAfter(it))}return rn}(v,r.viewItem.getChildren(),c);r.modelRange=p.createRange(r.modelCursor,V),r.modelCursor=I.cursorParent?p.createPositionAt(I.cursorParent,0):r.modelRange.end}}function Tr(b,r,c){if(c.consumable.test(r.viewItem,{name:!0})){const p=Array.from(r.viewItem.getChildren());for(const v of p)!v.is("element","li")&&!td(v)&&v._remove()}}function mc(b,r,c){if(c.consumable.test(r.viewItem,{name:!0})){if(0===r.viewItem.childCount)return;const p=[...r.viewItem.getChildren()];let v=!1,Z=!0;for(const S of p)v&&!td(S)&&S._remove(),S.is("$text")?(Z&&(S._data=S.data.replace(/^\s+/,"")),S.nextSibling&&!td(S.nextSibling)||(S._data=S.data.replace(/\s+$/,""))):td(S)&&(v=!0),Z=!1}}function _c(b){return(r,c)=>{if(c.isPhantom)return;const p=c.modelPosition.nodeBefore;if(p&&p.is("element","listItem")){const v=c.mapper.toViewElement(p),Z=v.getAncestors().find(td),S=b.createPositionAt(v,0).getWalker();for(const I of S){if("elementStart"==I.type&&I.item.is("element","li")){c.viewPosition=I.previousPosition;break}if("elementEnd"==I.type&&I.item==Z){c.viewPosition=I.nextPosition;break}}}}}function M1(b,[r,c]){let p,v=r.is("documentFragment")?r.getChild(0):r;if(p=c?this.createSelection(c):this.document.selection,v&&v.is("element","listItem")){const Z=p.getFirstPosition();let S=null;if(Z.parent.is("element","listItem")?S=Z.parent:Z.nodeBefore&&Z.nodeBefore.is("element","listItem")&&(S=Z.nodeBefore),S){const I=S.getAttribute("listIndent");if(I>0)for(;v&&v.is("element","listItem");)v._setAttribute("listIndent",v.getAttribute("listIndent")+I),v=v.nextSibling}}}function T2(b){const r=new js({startPosition:b});let c;do{c=r.next()}while(!c.value.item.is("element","listItem"));return c.value.item}function $m(b,r,c,p,v,Z){const S=io(r.nodeBefore,{sameIndent:!0,smallerIndent:!0,listIndent:b,foo:"b"}),I=v.mapper,V=v.writer,it=S?S.getAttribute("listIndent"):null;let dt;if(S)if(it==b){const xt=I.toViewElement(S).parent;dt=V.createPositionAfter(xt)}else{const xt=Z.createPositionAt(S,"end");dt=I.toViewPosition(xt)}else dt=c;dt=Wi(dt);for(const xt of[...p.getChildren()])td(xt)&&(dt=V.move(V.createRangeOn(xt),dt).end,Ui(V,xt,xt.nextSibling),Ui(V,xt.previousSibling,xt))}function td(b){return b.is("element","ol")||b.is("element","ul")}class Mg extends Gi{static get pluginName(){return"ListEditing"}static get requires(){return[Bp]}init(){const r=this.editor;r.model.schema.register("listItem",{inheritAllFrom:"$block",allowAttributes:["listType","listIndent"]});const c=r.data,p=r.editing;var v;r.model.document.registerPostFixer(I=>function(V,it){const dt=V.document.differ.getChanges(),xt=new Map;let le=!1;for(const wn of dt)if("insert"==wn.type&&"listItem"==wn.name)Ie(wn.position);else if("insert"==wn.type&&"listItem"!=wn.name){if("$text"!=wn.name){const qn=wn.position.nodeAfter;qn.hasAttribute("listIndent")&&(it.removeAttribute("listIndent",qn),le=!0),qn.hasAttribute("listType")&&(it.removeAttribute("listType",qn),le=!0);for(const mi of Array.from(V.createRangeIn(qn)).filter(xi=>xi.item.is("element","listItem")))Ie(mi.previousPosition)}Ie(wn.position.getShiftedBy(wn.length))}else"remove"==wn.type&&"listItem"==wn.name?Ie(wn.position):("attribute"==wn.type&&"listIndent"==wn.attributeKey||"attribute"==wn.type&&"listType"==wn.attributeKey)&&Ie(wn.range.start);for(const wn of xt.values())rn(wn),vn(wn);return le;function Ie(wn){const qn=wn.nodeBefore;if(qn&&qn.is("element","listItem")){let mi=qn;if(xt.has(mi))return;for(let xi=mi.previousSibling;xi&&xi.is("element","listItem");xi=mi.previousSibling)if(mi=xi,xt.has(mi))return;xt.set(qn,mi)}else{const mi=wn.nodeAfter;mi&&mi.is("element","listItem")&&xt.set(mi,mi)}}function rn(wn){let qn=0,mi=null;for(;wn&&wn.is("element","listItem");){const xi=wn.getAttribute("listIndent");if(xi>qn){let Vi;null===mi?(mi=xi-qn,Vi=qn):(mi>xi&&(mi=xi),Vi=xi-mi),it.setAttribute("listIndent",Vi,wn),le=!0}else mi=null,qn=wn.getAttribute("listIndent")+1;wn=wn.nextSibling}}function vn(wn){let qn=[],mi=null;for(;wn&&wn.is("element","listItem");){const xi=wn.getAttribute("listIndent");if(mi&&mi.getAttribute("listIndent")>xi&&(qn=qn.slice(0,xi+1)),0!=xi)if(qn[xi]){const Vi=qn[xi];wn.getAttribute("listType")!=Vi&&(it.setAttribute("listType",Vi,wn),le=!0)}else qn[xi]=wn.getAttribute("listType");mi=wn,wn=wn.nextSibling}}}(r.model,I)),p.mapper.registerViewToModelLength("li",Mf),c.mapper.registerViewToModelLength("li",Mf),p.mapper.on("modelToViewPosition",_c(p.view)),p.mapper.on("viewToModelPosition",(v=r.model,(I,V)=>{const it=V.viewPosition,dt=it.parent,xt=V.mapper;if("ul"==dt.name||"ol"==dt.name){if(it.isAtEnd){const le=xt.toModelElement(it.nodeBefore),Ie=xt.getModelLength(it.nodeBefore);V.modelPosition=v.createPositionBefore(le).getShiftedBy(Ie)}else{const le=xt.toModelElement(it.nodeAfter);V.modelPosition=v.createPositionBefore(le)}I.stop()}else if("li"==dt.name&&it.nodeBefore&&("ul"==it.nodeBefore.name||"ol"==it.nodeBefore.name)){const le=xt.toModelElement(dt);let Ie=1,rn=it.nodeBefore;for(;rn&&td(rn);)Ie+=xt.getModelLength(rn),rn=rn.previousSibling;V.modelPosition=v.createPositionBefore(le).getShiftedBy(Ie),I.stop()}})),c.mapper.on("modelToViewPosition",_c(p.view)),r.conversion.for("editingDowncast").add(I=>{var V;I.on("insert",Gc,{priority:"high"}),I.on("insert:listItem",vo(r.model)),I.on("attribute:listType:listItem",sa,{priority:"high"}),I.on("attribute:listType:listItem",Qo,{priority:"low"}),I.on("attribute:listIndent:listItem",(V=r.model,(it,dt,xt)=>{if(!xt.consumable.consume(dt.item,"attribute:listIndent"))return;const le=xt.mapper.toViewElement(dt.item),Ie=xt.writer;Ie.breakContainer(Ie.createPositionBefore(le)),Ie.breakContainer(Ie.createPositionAfter(le));const rn=le.parent,vn=rn.previousSibling,wn=Ie.createRangeOn(rn);Ie.remove(wn),vn&&vn.nextSibling&&Ui(Ie,vn,vn.nextSibling),$m(dt.attributeOldValue+1,dt.range.start,wn.start,le,xt,V),wi(dt.item,le,xt,V);for(const qn of dt.item.getChildren())xt.consumable.consume(qn,"insert")})),I.on("remove:listItem",function(V){return(it,dt,xt)=>{const le=xt.mapper.toViewPosition(dt.position).getLastMatchingPosition(mi=>!mi.item.is("element","li")).nodeAfter,Ie=xt.writer;Ie.breakContainer(Ie.createPositionBefore(le)),Ie.breakContainer(Ie.createPositionAfter(le));const rn=le.parent,vn=rn.previousSibling,wn=Ie.createRangeOn(rn),qn=Ie.remove(wn);vn&&vn.nextSibling&&Ui(Ie,vn,vn.nextSibling),$m(xt.mapper.toModelElement(le).getAttribute("listIndent")+1,dt.position,wn.start,le,xt,V);for(const mi of Ie.createRangeIn(qn).getItems())xt.mapper.unbindViewElement(mi);it.stop()}}(r.model)),I.on("remove",gs,{priority:"low"})}),r.conversion.for("dataDowncast").add(I=>{I.on("insert",Gc,{priority:"high"}),I.on("insert:listItem",vo(r.model))}),r.conversion.for("upcast").add(I=>{I.on("element:ul",Tr,{priority:"high"}),I.on("element:ol",Tr,{priority:"high"}),I.on("element:li",mc,{priority:"high"}),I.on("element:li",pc)}),r.model.on("insertContent",M1,{priority:"high"}),r.commands.add("numberedList",new nn(r,"numbered")),r.commands.add("bulletedList",new nn(r,"bulleted")),r.commands.add("indentList",new Bn(r,"forward")),r.commands.add("outdentList",new Bn(r,"backward"));const Z=p.view.document;this.listenTo(Z,"enter",(I,V)=>{const it=this.editor.model.document,dt=it.selection.getLastPosition().parent;it.selection.isCollapsed&&"listItem"==dt.name&&dt.isEmpty&&(this.editor.execute("outdentList"),V.preventDefault(),I.stop())}),this.listenTo(Z,"delete",(I,V)=>{if("backward"!==V.direction)return;const it=this.editor.model.document.selection;if(!it.isCollapsed)return;const dt=it.getFirstPosition();if(!dt.isAtStart)return;const xt=dt.parent;"listItem"===xt.name&&(xt.previousSibling&&"listItem"===xt.previousSibling.name||(this.editor.execute("outdentList"),V.preventDefault(),I.stop()))},{priority:"high"});const S=I=>(V,it)=>{this.editor.commands.get(I).isEnabled&&(this.editor.execute(I),it())};r.keystrokes.set("Tab",S("indentList")),r.keystrokes.set("Shift+Tab",S("outdentList"))}afterInit(){const r=this.editor.commands,c=r.get("indent"),p=r.get("outdent");c&&c.registerChildCommand(r.get("indentList")),p&&p.registerChildCommand(r.get("outdentList"))}}function Mf(b){let r=1;for(const c of b.getChildren())if("ul"==c.name||"ol"==c.name)for(const p of c.getChildren())r+=Mf(p);return r}class D3 extends Gi{init(){const r=this.editor.t;To(this.editor,"numberedList",r("Numbered List"),''),To(this.editor,"bulletedList",r("Bulleted List"),'')}}function Df(b,r){return p=>{p.on("attribute:url:media",c)};function c(p,v,Z){if(!Z.consumable.consume(v.item,p.name))return;const S=v.attributeNewValue,I=Z.writer,V=Z.mapper.toViewElement(v.item),it=[...V.getChildren()].find(xt=>xt.getCustomProperty("media-content"));I.remove(it);const dt=b.getMediaViewElement(I,S,r);I.insert(I.createPositionAt(V,0),dt)}}function zh(b,r,c,p){const v=b.createContainerElement("figure",{class:"media"});return b.insert(b.createPositionAt(v,0),r.getMediaViewElement(b,c,p)),v}function Vh(b){const r=b.getSelectedElement();return r&&r.is("element","media")?r:null}function Dg(b,r,c){b.change(p=>{const v=p.createElement("media",{url:r});b.insertContent(v,c),p.setSelection(v,"on")})}class Bh extends da{refresh(){const r=this.editor.model,c=r.document.selection,p=r.schema,v=c.getFirstPosition(),Z=Vh(c);let S=v.parent;S!=S.root&&(S=S.parent),this.value=Z?Z.getAttribute("url"):null,this.isEnabled=p.checkChild(S,"media")}execute(r){const c=this.editor.model,p=c.document.selection,v=Vh(p);if(v)c.change(Z=>{Z.setAttribute("url",r,v)});else{const Z=xd(p,c);Dg(c,r,Z)}}}class Pg{constructor(r,c){const p=c.providers,v=c.extraProviders||[],Z=new Set(c.removeProviders),S=p.concat(v).filter(I=>{const V=I.name;return V?!Z.has(V):(console.warn(Object(En.a)("media-embed-no-provider-name: The configured media provider has no name and cannot be used."),{provider:I}),!1)});this.locale=r,this.providerDefinitions=S}hasMedia(r){return!!this._getMedia(r)}getMediaViewElement(r,c,p){return this._getMedia(c).getViewElement(r,p)}_getMedia(r){if(!r)return new P3(this.locale);r=r.trim();for(const c of this.providerDefinitions){const p=c.html;let v=c.url;Array.isArray(v)||(v=[v]);for(const Z of v){const S=this._getUrlMatches(r,Z);if(S)return new P3(this.locale,r,S,p)}}return null}_getUrlMatches(r,c){let p=r.match(c);if(p)return p;let v=r.replace(/^https?:\/\//,"");return p=v.match(c),p||(v=v.replace(/^www\./,""),p=v.match(c),p||null)}}class P3{constructor(r,c,p,v){this.url=this._getValidUrl(c),this._t=r.t,this._match=p,this._previewRenderer=v}getViewElement(r,c){const p={};let v;if(c.renderForEditingView||c.renderMediaPreview&&this.url&&this._previewRenderer){this.url&&(p["data-oembed-url"]=this.url),c.renderForEditingView&&(p.class="ck-media__wrapper");const Z=this._getPreviewHtml(c);v=r.createRawElement("div",p,function(S){S.innerHTML=Z})}else this.url&&(p.url=this.url),v=r.createEmptyElement("oembed",p);return r.setCustomProperty("media-content",!0,v),v}_getPreviewHtml(r){return this._previewRenderer?this._previewRenderer(this._match):this.url&&r.renderForEditingView?this._getPlaceholderHtml():""}_getPlaceholderHtml(){const r=new ch,c=new v1;return r.text=this._t("Open media in new tab"),c.content='',c.viewBox="0 0 64 42",new Gu({tag:"div",attributes:{class:"ck ck-reset_all ck-media__placeholder"},children:[{tag:"div",attributes:{class:"ck-media__placeholder__icon"},children:[c]},{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]},r]}]}).render().outerHTML}_getValidUrl(r){return r?r.match(/^https?/)?r:"https://"+r:null}}u(80);class Zu extends Gi{static get pluginName(){return"MediaEmbedEditing"}constructor(r){super(r),r.config.define("mediaEmbed",{providers:[{name:"dailymotion",url:/^dailymotion\.com\/video\/(\w+)/,html:c=>`
`},{name:"spotify",url:[/^open\.spotify\.com\/(artist\/\w+)/,/^open\.spotify\.com\/(album\/\w+)/,/^open\.spotify\.com\/(track\/\w+)/],html:c=>`
`},{name:"youtube",url:[/^(?:m\.)?youtube\.com\/watch\?v=([\w-]+)/,/^(?:m\.)?youtube\.com\/v\/([\w-]+)/,/^youtube\.com\/embed\/([\w-]+)/,/^youtu\.be\/([\w-]+)/],html:c=>`
`},{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:c=>`
`},{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 Pg(r.locale,r.config.get("mediaEmbed"))}init(){const r=this.editor,c=r.model.schema,p=r.t,v=r.conversion,Z=r.config.get("mediaEmbed.previewsInData"),S=this.registry;r.commands.add("mediaEmbed",new Bh(r)),c.register("media",{isObject:!0,isBlock:!0,allowWhere:"$block",allowAttributes:["url"]}),v.for("dataDowncast").elementToElement({model:"media",view:(I,V)=>{const it=I.getAttribute("url");return zh(V,S,it,{renderMediaPreview:it&&Z})}}),v.for("dataDowncast").add(Df(S,{renderMediaPreview:Z})),v.for("editingDowncast").elementToElement({model:"media",view:(I,V)=>{const it=I.getAttribute("url");return xt=zh(V,S,it,{renderForEditingView:!0}),le=V,Ie=p("media widget"),le.setCustomProperty("media",!0,xt),xu(xt,le,{label:Ie});var xt,le,Ie}}),v.for("editingDowncast").add(Df(S,{renderForEditingView:!0})),v.for("upcast").elementToElement({view:{name:"oembed",attributes:{url:!0}},model:(I,V)=>{const it=I.getAttribute("url");if(S.hasMedia(it))return V.createElement("media",{url:it})}}).elementToElement({view:{name:"div",attributes:{"data-oembed-url":!0}},model:(I,V)=>{const it=I.getAttribute("data-oembed-url");if(S.hasMedia(it))return V.createElement("media",{url:it})}})}}const Pf=/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w.-]+)+[\w\-._~:/?#[\]@!$&'()*+,;=]+$/;class Jh extends Gi{static get requires(){return[$1,uf]}static get pluginName(){return"AutoMediaEmbed"}constructor(r){super(r),this._timeoutId=null,this._positionToInsert=null}init(){const r=this.editor,c=r.model.document;this.listenTo(r.plugins.get($1),"inputTransformation",()=>{const p=c.selection.getFirstRange(),v=Ws.fromPosition(p.start);v.stickiness="toPrevious";const Z=Ws.fromPosition(p.end);Z.stickiness="toNext",c.once("change:data",()=>{this._embedMediaBetweenPositions(v,Z),v.detach(),Z.detach()},{priority:"high"})}),r.commands.get("undo").on("execute",()=>{this._timeoutId&&(pt.window.clearTimeout(this._timeoutId),this._positionToInsert.detach(),this._timeoutId=null,this._positionToInsert=null)},{priority:"high"})}_embedMediaBetweenPositions(r,c){const p=this.editor,v=p.plugins.get(Zu).registry,Z=new i1(r,c),S=Z.getWalker({ignoreElementEnd:!0});let I="";for(const V of S)V.item.is("$textProxy")&&(I+=V.item.data);I=I.trim(),I.match(Pf)&&v.hasMedia(I)&&p.commands.get("mediaEmbed").isEnabled?(this._positionToInsert=Ws.fromPosition(r),this._timeoutId=pt.window.setTimeout(()=>{p.model.change(V=>{let it;this._timeoutId=null,V.remove(Z),Z.detach(),"$graveyard"!==this._positionToInsert.root.rootName&&(it=this._positionToInsert),Dg(p.model,I,it),this._positionToInsert.detach(),this._positionToInsert=null})},100)):Z.detach()}}u(82);class Ud extends Oo{constructor(r,c){super(c);const p=c.t;this.focusTracker=new ws,this.keystrokes=new _u,this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(p("Save"),a2,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(p("Cancel"),Ym,"ck-button-cancel","cancel"),this._focusables=new Zl,this._focusCycler=new _1({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this._validators=r,this.setTemplate({tag:"form",attributes:{class:["ck","ck-media-form"],tabindex:"-1"},children:[this.urlInputView,this.saveButtonView,this.cancelButtonView]})}render(){super.render(),Hm({view:this}),[this.urlInputView,this.saveButtonView,this.cancelButtonView].forEach(c=>{this._focusables.add(c),this.focusTracker.add(c.element)}),this.keystrokes.listenTo(this.element);const r=c=>c.stopPropagation();this.keystrokes.set("arrowright",r),this.keystrokes.set("arrowleft",r),this.keystrokes.set("arrowup",r),this.keystrokes.set("arrowdown",r),this.listenTo(this.urlInputView.element,"selectstart",(c,p)=>{p.stopPropagation()},{priority:"high"})}focus(){this._focusCycler.focusFirst()}get url(){return this.urlInputView.fieldView.element.value.trim()}set url(r){this.urlInputView.fieldView.element.value=r.trim()}isValid(){this.resetFormStatus();for(const r of this._validators){const c=r(this);if(c)return this.urlInputView.errorText=c,!1}return!0}resetFormStatus(){this.urlInputView.errorText=null,this.urlInputView.infoText=this._urlInputViewInfoDefault}_createUrlInput(){const r=this.locale.t,c=new zp(this.locale,yf),p=c.fieldView;return this._urlInputViewInfoDefault=r("Paste the media URL in the input."),this._urlInputViewInfoTip=r("Tip: Paste the URL into the content to embed faster."),c.label=r("Media URL"),c.infoText=this._urlInputViewInfoDefault,p.placeholder="https://example.com",p.on("input",()=>{c.infoText=p.element.value?this._urlInputViewInfoTip:this._urlInputViewInfoDefault}),c}_createButton(r,c,p,v){const Z=new Hr(this.locale);return Z.set({label:r,icon:c,tooltip:!0}),Z.extendTemplate({attributes:{class:p}}),v&&Z.delegate("execute").to(this,v),Z}}class Qd extends Gi{static get requires(){return[Zu]}static get pluginName(){return"MediaEmbedUI"}init(){const r=this.editor,c=r.commands.get("mediaEmbed"),p=r.plugins.get(Zu).registry;r.ui.componentFactory.add("mediaEmbed",v=>{const Z=Qu(v),S=new Ud((I=r.t,V=p,[it=>{if(!it.url.length)return I("The URL must not be empty.")},it=>{if(!V.hasMedia(it.url))return I("This media URL is not supported.")}]),r.locale);var I,V;return this._setUpDropdown(Z,S,c,r),this._setUpForm(Z,S,c),Z})}_setUpDropdown(r,c,p){const v=this.editor,Z=v.t,S=r.buttonView;function I(){v.editing.view.focus(),r.isOpen=!1}r.bind("isEnabled").to(p),r.panelView.children.add(c),S.set({label:Z("Insert media"),icon:'',tooltip:!0}),S.on("open",()=>{c.url=p.value||"",c.urlInputView.fieldView.select(),c.focus()},{priority:"low"}),r.on("submit",()=>{c.isValid()&&(v.execute("mediaEmbed",c.url),I())}),r.on("change:isOpen",()=>c.resetFormStatus()),r.on("cancel",()=>I())}_setUpForm(r,c,p){c.delegate("submit","cancel").to(r),c.urlInputView.bind("value").to(p,"value"),c.urlInputView.bind("isReadOnly").to(p,"isEnabled",v=>!v),c.saveButtonView.bind("isEnabled").to(p)}}function kg(b,r,c){const p=r.parent,v=c.createElement(b.type),Z=p.getChildIndex(r)+1;return c.insertChild(Z,v,p),v}function Sf(b){const r={},c=b.getStyle("mso-list");if(c){const p=c.match(/(^|\s+)l(\d+)/i),v=c.match(/\s*lfo(\d+)/i),Z=c.match(/\s*level(\d+)/i);p&&v&&Z&&(r.id=p[2],r.order=v[1],r.indent=Z[1])}return r}u(84);const kf=/id=("|')docs-internal-guid-[-0-9a-f]+("|')/i;class Gh{constructor(r){this.document=r}isActive(r){return kf.test(r)}execute(r){const c=new m2(this.document);(function(p,v){for(const Z of p.getChildren())if(Z.is("element","b")&&"normal"===Z.getStyle("font-weight")){const S=p.getChildIndex(Z);v.remove(Z),v.insertChild(S,Z.getChildren(),p)}})(r.content,c),function(p,v){for(const Z of v.createRangeIn(p)){const S=Z.item;if(S.is("element","li")){const I=S.getChild(0);I.is("element","p")&&v.unwrapElement(I)}}}(r.content,c)}}function S3(b){return b.replace(/(\s+)<\/span>/g,(r,c)=>1===c.length?" ":Array(c.length+1).join("\xa0 ").substr(0,c.length))}const Xm=//i,Og=/xmlns:o="urn:schemas-microsoft-com/i;class Lg{constructor(r){this.document=r}isActive(r){return Xm.test(r)||Og.test(r)}execute(r){const{body:c,stylesString:p}=function Of(b,r){const c=new DOMParser,p=S3(S3(function(V){const it=V.match(/<\/body>(.*?)(<\/html>|$)/);return it&&it[1]&&(V=V.slice(0,it.index)+V.slice(it.index).replace(it[1],"")),V}(b=b.replace(/