@aatulwork/customform-renderer 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +653 -0
- package/dist/index.d.mts +352 -0
- package/dist/index.d.ts +352 -0
- package/dist/index.js +1840 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1796 -0
- package/dist/index.mjs.map +1 -0
- package/lib/ckeditor/README.md +56 -0
- package/lib/ckeditor/ckeditor.js +6 -0
- package/package.json +66 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
!function(e){const t=e.en=e.en||{};t.dictionary=Object.assign(t.dictionary||{},{"(may require <kbd>Fn</kbd>)":"(may require <kbd>Fn</kbd>)","%0 of %1":"%0 of %1",Accept:"Accept",Accessibility:"Accessibility","Accessibility help":"Accessibility help",Aquamarine:"Aquamarine",Back:"Back","Below, you can find a list of keyboard shortcuts that can be used in the editor.":"Below, you can find a list of keyboard shortcuts that can be used in the editor.",Big:"Big",Black:"Black","Block quote":"Block quote",Blue:"Blue","Blue marker":"Blue marker",Bold:"Bold","Bold text":"Bold text","Break text":"Break text","Bulleted List":"Bulleted List",Cancel:"Cancel","Cannot upload file:":"Cannot upload file:","Caption for image: %0":"Caption for image: %0","Caption for the image":"Caption for the image","Centered image":"Centered image","Change image text alternative":"Change image text alternative","Choose heading":"Choose heading",Clear:"Clear","Click to edit block":"Click to edit block",Close:"Close","Close contextual balloons, dropdowns, and dialogs":"Close contextual balloons, dropdowns, and dialogs","Color picker":"Color picker",Column:"Column","Content editing keystrokes":"Content editing keystrokes","Copy selected content":"Copy selected content","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.","Create link":"Create link",Custom:"Custom","Custom image size":"Custom image size","Decrease indent":"Decrease indent","Decrease list item indent":"Decrease list item indent",Default:"Default","Delete column":"Delete column","Delete row":"Delete row","Dim grey":"Dim grey","Displayed text":"Displayed text","Document colors":"Document colors",Downloadable:"Downloadable","Drag to move":"Drag to move","Dropdown menu":"Dropdown menu","Dropdown toolbar":"Dropdown toolbar","Edit block":"Edit block","Edit link":"Edit link","Editor block content toolbar":"Editor block content toolbar","Editor contextual toolbar":"Editor contextual toolbar","Editor dialog":"Editor dialog","Editor menu bar":"Editor menu bar","Editor toolbar":"Editor toolbar","Enter image caption":"Enter image caption","Error during image upload":"Error during image upload","Execute the currently focused button. Executing buttons that interact with the editor content moves the focus back to the content.":"Execute the currently focused button. Executing buttons that interact with the editor content moves the focus back to the content.",File:"File","Font Background Color":"Font Background Color","Font Color":"Font Color","Font Family":"Font Family","Font Size":"Font Size","From computer":"From computer","Full size image":"Full size image",Green:"Green","Green marker":"Green marker","Green pen":"Green pen",Grey:"Grey","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","Help Contents. To close this dialog press ESC.":"Help Contents. To close this dialog press ESC.",HEX:"HEX",Highlight:"Highlight",Huge:"Huge",Image:"Image","Image from computer":"Image from computer","Image Resize":"Image Resize","Image resize list":"Image resize list","Image toolbar":"Image toolbar","Image upload complete":"Image upload complete","Image via URL":"Image via URL","image widget":"image widget","In line":"In line","Increase indent":"Increase indent","Increase list item indent":"Increase list item indent",Insert:"Insert","Insert a hard break (a new paragraph)":"Insert a hard break (a new paragraph)","Insert a new paragraph directly after a widget":"Insert a new paragraph directly after a widget","Insert a new paragraph directly before a widget":"Insert a new paragraph directly before a widget","Insert a new table row (when in the last cell of a table)":"Insert a new table row (when in the last cell of a table)","Insert a soft break (a <code><br></code> element)":"Insert a soft break (a <code><br></code> element)","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 image via URL":"Insert image via URL","Insert image with file manager":"Insert image with file manager","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","Insert via URL":"Insert via URL","Insert with file manager":"Insert with file manager","Inserting image failed":"Inserting image failed",Italic:"Italic","Italic text":"Italic text","Keystrokes that can be used in a list":"Keystrokes that can be used in a list","Keystrokes that can be used in a table cell":"Keystrokes that can be used in a table cell","Keystrokes that can be used when a widget is selected (for example: image, table, etc.)":"Keystrokes that can be used when a widget is selected (for example: image, table, etc.)","Left aligned image":"Left aligned image","Light blue":"Light blue","Light green":"Light green","Light grey":"Light grey",Link:"Link","Link properties":"Link properties","Link URL":"Link URL","Link URL must not be empty.":"Link URL must not be empty.",Media:"Media","Media embed":"Media embed","Media URL":"Media URL","media widget":"media widget",MENU_BAR_MENU_EDIT:"Edit",MENU_BAR_MENU_FILE:"File",MENU_BAR_MENU_FONT:"Font",MENU_BAR_MENU_FORMAT:"Format",MENU_BAR_MENU_HELP:"Help",MENU_BAR_MENU_INSERT:"Insert",MENU_BAR_MENU_TEXT:"Text",MENU_BAR_MENU_TOOLS:"Tools",MENU_BAR_MENU_VIEW:"View","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","Move focus between form fields (inputs, buttons, etc.)":"Move focus between form fields (inputs, buttons, etc.)","Move focus from an editable area back to the parent widget":"Move focus from an editable area back to the parent widget","Move focus in and out of an active dialog window":"Move focus in and out of an active dialog window","Move focus to the menu bar, navigate between menu bars":"Move focus to the menu bar, navigate between menu bars","Move focus to the toolbar, navigate between toolbars":"Move focus to the toolbar, navigate between toolbars","Move out of a link":"Move out of a link","Move the caret to allow typing directly after a widget":"Move the caret to allow typing directly after a widget","Move the caret to allow typing directly before a widget":"Move the caret to allow typing directly before a widget","Move the selection to the next cell":"Move the selection to the next cell","Move the selection to the previous cell":"Move the selection to the previous cell","Navigate through the table":"Navigate through the table","Navigate through the toolbar or menu bar":"Navigate through the toolbar or menu bar",Next:"Next","No links available":"No links available","No results found":"No results found","No searchable items":"No searchable items","Numbered List":"Numbered List","Open in a new tab":"Open in a new tab","Open link in new tab":"Open link in new tab","Open media in new tab":"Open media in new tab","Open the accessibility help dialog":"Open the accessibility help dialog",Orange:"Orange",Original:"Original",Paragraph:"Paragraph","Paste content":"Paste content","Paste content as plain text":"Paste content as plain text","Paste the media URL in the input.":"Paste the media URL in the input.","Pink marker":"Pink marker",'Please enter a valid color (e.g. "ff0000").':'Please enter a valid color (e.g. "ff0000").',"Press %0 for help.":"Press %0 for help.","Press Enter to type after or press Shift + Enter to type before the widget":"Press Enter to type after or press Shift + Enter to type before the widget",Previous:"Previous",Purple:"Purple",Red:"Red","Red pen":"Red pen",Redo:"Redo","Remove color":"Remove color","Remove highlight":"Remove highlight","Replace from computer":"Replace from computer","Replace image":"Replace image","Replace image from computer":"Replace image from computer","Replace image with file manager":"Replace image with file manager","Replace with file manager":"Replace with file manager","Resize image":"Resize image","Resize image (in %0)":"Resize image (in %0)","Resize image to %0":"Resize image to %0","Resize image to the original size":"Resize image to the original size","Revert autoformatting action":"Revert autoformatting action","Rich Text Editor":"Rich Text Editor","Rich Text Editor. Editing area: %0":"Rich Text Editor. Editing area: %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","Show source":"Show source","Side image":"Side image",Small:"Small",Source:"Source","Split cell horizontally":"Split cell horizontally","Split cell vertically":"Split cell vertically",Table:"Table","Table toolbar":"Table toolbar","Text alternative":"Text alternative","Text Alternative":"Text Alternative","Text highlight toolbar":"Text highlight toolbar","The URL must not be empty.":"The URL must not be empty.","The value must not be empty.":"The value must not be empty.","The value should be a plain number.":"The value should be a plain number.","These keyboard shortcuts allow for quick access to content editing features.":"These keyboard shortcuts allow for quick access to content editing features.","This media URL is not supported.":"This media URL is not supported.",Tiny:"Tiny","Tip: Paste the URL into the content to embed faster.":"Tip: Paste the URL into the content to embed faster.","Toggle caption off":"Toggle caption off","Toggle caption on":"Toggle caption on",Turquoise:"Turquoise",Undo:"Undo",Unlink:"Unlink",Update:"Update","Update image URL":"Update image URL","Upload failed":"Upload failed","Upload from computer":"Upload from computer","Upload image from computer":"Upload image from computer","Upload in progress":"Upload in progress","Uploading image":"Uploading image","Use the following keystrokes for more efficient navigation in the CKEditor 5 user interface.":"Use the following keystrokes for more efficient navigation in the CKEditor 5 user interface.","User interface and content navigation keystrokes":"User interface and content navigation keystrokes","Via URL":"Via URL",White:"White","Widget toolbar":"Widget toolbar","With file manager":"With file manager","Wrap text":"Wrap text",Yellow:"Yellow","Yellow marker":"Yellow marker","You have no image upload permissions.":"You have no image upload permissions."}),t.getPluralForm=function(e){return 1!=e}}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})),
|
|
2
|
+
/*!
|
|
3
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
4
|
+
* For licensing, see LICENSE.md.
|
|
5
|
+
*/
|
|
6
|
+
function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ClassicEditor=t():e.ClassicEditor=t()}(self,()=>(()=>{var e={55(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,".ck.ck-menu-bar__menu{display:block;font-size:inherit;position:relative}.ck.ck-menu-bar__menu.ck-menu-bar__menu_top-level{max-width:100%}",""]);const r=o},66(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,".ck.ck-toolbar{align-items:center;display:flex;flex-flow:row nowrap;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ck.ck-toolbar>.ck-toolbar__items{align-items:center;display:flex;flex-flow:row wrap;flex-grow:1}.ck.ck-toolbar .ck.ck-toolbar__separator{display:inline-block}.ck.ck-toolbar .ck.ck-toolbar__separator:first-child,.ck.ck-toolbar .ck.ck-toolbar__separator:last-child{display:none}.ck.ck-toolbar .ck-toolbar__line-break{flex-basis:100%}.ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar.ck-toolbar_vertical>.ck-toolbar__items{flex-direction:column}.ck.ck-toolbar.ck-toolbar_floating>.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown>.ck-dropdown__button .ck-dropdown__arrow{display:none}.ck.ck-toolbar{background:var(--ck-color-toolbar-background);border:1px solid var(--ck-color-toolbar-border);border-radius:0;padding:0 var(--ck-spacing-small);&.ck-rounded-corners,.ck-rounded-corners &{border-radius:var(--ck-border-radius)}}.ck.ck-toolbar .ck.ck-toolbar__separator{background:var(--ck-color-toolbar-border);height:var(--ck-icon-size);margin-bottom:var(--ck-spacing-small);margin-top:var(--ck-spacing-small);min-width:1px;width:1px}.ck.ck-toolbar .ck-toolbar__line-break{height:0}.ck.ck-toolbar>.ck-toolbar__items>:not(.ck-toolbar__line-break){margin-right:var(--ck-spacing-small)}.ck.ck-toolbar>.ck-toolbar__items:empty+.ck.ck-toolbar__separator{display:none}.ck.ck-toolbar>.ck-toolbar__items>:not(.ck-toolbar__line-break),.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown{margin-bottom:var(--ck-spacing-small);margin-top:var(--ck-spacing-small)}.ck.ck-toolbar.ck-toolbar_vertical{padding:0}.ck.ck-toolbar.ck-toolbar_vertical>.ck-toolbar__items>.ck{border-radius:0;margin:0;width:100%}.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.ck-toolbar .ck-toolbar__nested-toolbar-dropdown>.ck-dropdown__panel{min-width:auto}.ck.ck-toolbar .ck-toolbar__nested-toolbar-dropdown>.ck-button>.ck-button__label{max-width:7em;width:auto}.ck.ck-toolbar:focus{outline:none}.ck.ck-toolbar{.ck-toolbar-container &{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.ck-toolbar_compact[dir=rtl]>.ck-toolbar__items>.ck:first-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-bottom-left-radius:0;border-top-left-radius:0}.ck.ck-toolbar.ck-toolbar_compact[dir=rtl]>.ck-toolbar__items>.ck:last-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-bottom-right-radius:0;border-top-right-radius:0}.ck.ck-toolbar.ck-toolbar_grouping[dir=rtl]>.ck-toolbar__items:not(:empty):not(:only-child),.ck.ck-toolbar[dir=rtl]>.ck.ck-toolbar__separator,[dir=rtl] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=rtl] .ck.ck-toolbar>.ck.ck-toolbar__separator{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.ck-toolbar_compact[dir=ltr]>.ck-toolbar__items>.ck:first-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-bottom-right-radius:0;border-top-right-radius:0}.ck.ck-toolbar.ck-toolbar_compact[dir=ltr]>.ck-toolbar__items>.ck:last-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-bottom-left-radius:0;border-top-left-radius:0}.ck.ck-toolbar.ck-toolbar_grouping[dir=ltr]>.ck-toolbar__items:not(:empty):not(:only-child),.ck.ck-toolbar[dir=ltr]>.ck.ck-toolbar__separator,[dir=ltr] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=ltr] .ck.ck-toolbar>.ck.ck-toolbar__separator{margin-right:var(--ck-spacing-small)}",""]);const r=o},178(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,":root{--ck-color-editable-blur-selection:#d9d9d9}.ck.ck-editor__editable:not(.ck-editor__nested-editable){border-radius:0;&.ck-rounded-corners,.ck-rounded-corners &{border-radius:var(--ck-border-radius)}}.ck.ck-editor__editable.ck-focused:not(.ck-editor__nested-editable){border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0;outline:none}.ck.ck-editor__editable_inline{border:1px solid transparent;overflow:auto;padding:0 var(--ck-spacing-standard)}.ck.ck-editor__editable_inline[dir=ltr]{text-align:left}.ck.ck-editor__editable_inline[dir=rtl]{text-align:right}.ck.ck-editor__editable_inline>:first-child{margin-top:var(--ck-spacing-large)}.ck.ck-editor__editable_inline>:last-child{margin-bottom:var(--ck-spacing-large)}.ck.ck-editor__editable_inline.ck-blurred ::selection{background:var(--ck-color-editable-blur-selection)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_n]:after{border-bottom-color:var(--ck-color-panel-background)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_s]:after{border-top-color:var(--ck-color-panel-background)}",""]);const r=o},263(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,".ck.ck-link-toolbar__preview{display:inline-block}.ck.ck-link-toolbar__preview .ck-button__label{overflow:hidden}:root{--ck-link-bookmark-icon-size:calc(var(--ck-icon-size)*0.7)}.ck.ck-toolbar.ck-link-toolbar>.ck-toolbar__items{flex-wrap:nowrap}a.ck.ck-button.ck-link-toolbar__preview{color:var(--ck-color-link-default);cursor:pointer;justify-content:center;padding:0 var(--ck-spacing-medium)}a.ck.ck-button.ck-link-toolbar__preview .ck.ck-button__label{max-width:var(--ck-input-width);text-overflow:ellipsis}a.ck.ck-button.ck-link-toolbar__preview,a.ck.ck-button.ck-link-toolbar__preview:active,a.ck.ck-button.ck-link-toolbar__preview:focus,a.ck.ck-button.ck-link-toolbar__preview:hover{background:none}a.ck.ck-button.ck-link-toolbar__preview:active{box-shadow:none}a.ck.ck-button.ck-link-toolbar__preview:focus,a.ck.ck-button.ck-link-toolbar__preview:hover{text-decoration:underline}a.ck.ck-button.ck-link-toolbar__preview.ck-button_with-text .ck.ck-icon.ck-button__icon{height:var(--ck-link-bookmark-icon-size);width:var(--ck-link-bookmark-icon-size);[dir=ltr] &{margin-left:var(--ck-spacing-small);margin-right:var(--ck-spacing-tiny)}[dir=rtl] &{margin-left:var(--ck-spacing-tiny);margin-right:var(--ck-spacing-small)}}a.ck.ck-button.ck-link-toolbar__preview:has(.ck-icon){padding-left:var(--ck-spacing-extra-tiny )}",""]);const r=o},426(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,":root{--ck-dropdown-max-width:75vw}.ck.ck-dropdown{display:inline-block;position:relative}.ck.ck-dropdown .ck-dropdown__arrow{pointer-events:none;z-index:var(--ck-z-default)}.ck.ck-dropdown .ck-button.ck-dropdown__button{width:100%}.ck.ck-dropdown .ck-dropdown__panel{display:none;max-width:var(--ck-dropdown-max-width);position:absolute;z-index:var(--ck-z-panel)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel-visible{display:inline-block}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_n,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nmw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw{bottom:100%}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_s,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_smw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{bottom:auto;top:100%}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se{left:0}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{right:0}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_n,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_s{left:50%;transform:translateX(-50%)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nmw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_smw{left:75%;transform:translateX(-75%)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sme{left:25%;transform:translateX(-25%)}.ck.ck-toolbar .ck-dropdown__panel{z-index:calc(var(--ck-z-panel) + 1)}:root{--ck-dropdown-arrow-size:calc(var(--ck-icon-size)*0.5)}.ck.ck-dropdown{font-size:inherit}.ck.ck-dropdown .ck-dropdown__arrow{width:var(--ck-dropdown-arrow-size)}.ck.ck-dropdown{[dir=ltr] & .ck-dropdown__arrow{margin-left:var(--ck-spacing-standard);right:var(--ck-spacing-standard)}[dir=rtl] & .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)}.ck.ck-dropdown .ck-button.ck-dropdown__button{[dir=ltr] &:not(.ck-button_with-text){padding-left:var(--ck-spacing-small)}[dir=rtl] &:not(.ck-button_with-text){padding-right:var(--ck-spacing-small)}}.ck.ck-dropdown .ck-button.ck-dropdown__button .ck-button__label{overflow:hidden;text-overflow:ellipsis;width:7em}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-disabled .ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on{border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-dropdown__button_label-width_auto .ck-button__label{width:auto}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-off:active,.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on:active{box-shadow:none}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-off:active:focus,.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on:active:focus{box-shadow:var(--ck-focus-outer-shadow),0 0}.ck.ck-dropdown__panel{background:var(--ck-color-dropdown-panel-background);border:1px solid var(--ck-color-dropdown-panel-border);border-radius:0;bottom:0;box-shadow:var(--ck-drop-shadow),0 0;min-width:100%;&.ck-rounded-corners,.ck-rounded-corners &{border-radius:var(--ck-border-radius)}}.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}.ck.ck-dropdown__panel:focus{outline:none}",""]);const r=o},532(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,".ck-content ol{list-style-type:decimal}.ck-content ol ol{list-style-type:lower-latin}.ck-content ol ol ol{list-style-type:lower-roman}.ck-content ol ol ol ol{list-style-type:upper-latin}.ck-content ol ol ol ol ol{list-style-type:upper-roman}.ck-content ul{list-style-type:disc}.ck-content ul ul{list-style-type:circle}.ck-content ul ul ul,.ck-content ul ul ul ul{list-style-type:square}",""]);const r=o},540(e){"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},601(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,".ck-hidden{display:none!important}:root{--ck-z-default:1;--ck-z-panel:calc(var(--ck-z-default) + 999);--ck-z-dialog:9999}.ck-transitions-disabled,.ck-transitions-disabled *{transition:none!important}:root{--ck-powered-by-font-size:calc(var(--ck-font-size-base)*7.5/13);--ck-powered-by-line-height:calc(var(--ck-font-size-base)*10/13);--ck-powered-by-letter-spacing:calc(var(--ck-font-size-base)*-0.2/13);--ck-powered-by-padding-vertical:2px;--ck-powered-by-padding-horizontal:4px;--ck-powered-by-text-color:#4f4f4f;--ck-powered-by-border-radius:var(--ck-border-radius);--ck-powered-by-background:#fff;--ck-powered-by-border-color:var(--ck-color-focus-border);--ck-powered-by-svg-width:53;--ck-powered-by-svg-height:10;--ck-powered-by-icon-width:calc(var(--ck-font-size-base)*var(--ck-powered-by-svg-width)/13);--ck-powered-by-icon-height:calc(var(--ck-font-size-base)*var(--ck-powered-by-svg-height)/13)}.ck.ck-balloon-panel.ck-powered-by-balloon{--ck-border-radius:var(--ck-powered-by-border-radius);background:var(--ck-powered-by-background);box-shadow:none;min-height:unset;z-index:calc(var(--ck-z-panel) - 1)}.ck.ck-balloon-panel.ck-powered-by-balloon .ck.ck-powered-by{line-height:var(--ck-powered-by-line-height)}.ck.ck-balloon-panel.ck-powered-by-balloon .ck.ck-powered-by a{align-items:center;cursor:pointer;display:flex;filter:grayscale(80%);line-height:var(--ck-powered-by-line-height);opacity:.66;padding:var(--ck-powered-by-padding-vertical) var(--ck-powered-by-padding-horizontal)}.ck.ck-balloon-panel.ck-powered-by-balloon .ck.ck-powered-by .ck-powered-by__label{color:var(--ck-powered-by-text-color);cursor:pointer;font-size:var(--ck-powered-by-font-size);font-weight:700;letter-spacing:var(--ck-powered-by-letter-spacing);line-height:normal;margin-right:4px;padding-left:2px;text-transform:uppercase}.ck.ck-balloon-panel.ck-powered-by-balloon .ck.ck-powered-by .ck-icon{cursor:pointer;display:block;height:var(--ck-powered-by-icon-height);width:var(--ck-powered-by-icon-width)}.ck.ck-balloon-panel.ck-powered-by-balloon .ck.ck-powered-by:hover a{filter:grayscale(0);opacity:1}.ck.ck-balloon-panel.ck-powered-by-balloon[class*=position_inside]{border-color:transparent}.ck.ck-balloon-panel.ck-powered-by-balloon[class*=position_border]{border:var(--ck-focus-ring);border-color:var(--ck-powered-by-border-color)}:root{--ck-evaluation-badge-font-size:calc(var(--ck-font-size-base)*7.5/13);--ck-evaluation-badge-line-height:calc(var(--ck-font-size-base)*7.5/13);--ck-evaluation-badge-letter-spacing:calc(var(--ck-font-size-base)*-0.2/13);--ck-evaluation-badge-padding-vertical:2px;--ck-evaluation-badge-padding-horizontal:4px;--ck-evaluation-badge-text-color:#4f4f4f;--ck-evaluation-badge-border-radius:var(--ck-border-radius);--ck-evaluation-badge-background:#fff;--ck-evaluation-badge-border-color:var(--ck-color-focus-border)}.ck.ck-balloon-panel.ck-evaluation-badge-balloon{--ck-border-radius:var(--ck-evaluation-badge-border-radius);background:var(--ck-evaluation-badge-background);box-shadow:none;min-height:unset;z-index:calc(var(--ck-z-panel) - 1)}.ck.ck-balloon-panel.ck-evaluation-badge-balloon .ck.ck-evaluation-badge{line-height:var(--ck-evaluation-badge-line-height);padding:var(--ck-evaluation-badge-padding-vertical) var(--ck-evaluation-badge-padding-horizontal)}.ck.ck-balloon-panel.ck-evaluation-badge-balloon .ck.ck-evaluation-badge .ck-evaluation-badge__label{color:var(--ck-evaluation-badge-text-color);display:block;font-size:var(--ck-evaluation-badge-font-size);font-weight:700;letter-spacing:var(--ck-evaluation-badge-letter-spacing);line-height:normal;padding:0 2px;text-transform:uppercase}.ck.ck-balloon-panel.ck-evaluation-badge-balloon[class*=position_inside]{border-color:transparent}.ck.ck-balloon-panel.ck-evaluation-badge-balloon[class*=position_border]{border:var(--ck-focus-ring);border-color:var(--ck-evaluation-badge-border-color)}:root{--ck-color-base-foreground:#fafafa;--ck-color-base-background:#fff;--ck-color-base-border:#ccced1;--ck-color-base-action:#53a336;--ck-color-base-focus:#6cb5f9;--ck-color-base-text:#333;--ck-color-base-active:#2977ff;--ck-color-base-active-focus:#0d65ff;--ck-color-base-error:#db3700;--ck-color-focus-border-coordinates:218,81.8%,56.9%;--ck-color-focus-border:hsl(var(--ck-color-focus-border-coordinates));--ck-color-focus-outer-shadow:#cae1fc;--ck-color-focus-disabled-shadow:rgba(119,186,248,.3);--ck-color-focus-error-shadow:rgba(255,64,31,.3);--ck-color-text:var(--ck-color-base-text);--ck-color-shadow-drop:rgba(0,0,0,.15);--ck-color-shadow-drop-active:rgba(0,0,0,.2);--ck-color-shadow-inner:rgba(0,0,0,.1);--ck-color-button-default-background:transparent;--ck-color-button-default-hover-background:#f0f0f0;--ck-color-button-default-active-background:#f0f0f0;--ck-color-button-default-disabled-background:transparent;--ck-color-button-on-background:#f0f7ff;--ck-color-button-on-hover-background:#dbecff;--ck-color-button-on-active-background:#dbecff;--ck-color-button-on-disabled-background:#f0f2f4;--ck-color-button-on-color:#2977ff;--ck-color-button-action-background:var(--ck-color-base-action);--ck-color-button-action-hover-background:#4d9d30;--ck-color-button-action-active-background:#4d9d30;--ck-color-button-action-disabled-background:#7ec365;--ck-color-button-action-text:var(--ck-color-base-background);--ck-color-button-save:#008a00;--ck-color-button-cancel:#db3700;--ck-color-switch-button-off-background:#939393;--ck-color-switch-button-off-hover-background:#7d7d7d;--ck-color-switch-button-on-background:var(--ck-color-button-action-background);--ck-color-switch-button-on-hover-background:#4d9d30;--ck-color-switch-button-inner-background:var(--ck-color-base-background);--ck-color-switch-button-inner-shadow:rgba(0,0,0,.1);--ck-color-dropdown-panel-background:var(--ck-color-base-background);--ck-color-dropdown-panel-border:var(--ck-color-base-border);--ck-color-dialog-background:var(--ck-custom-background);--ck-color-dialog-form-header-border:var(--ck-custom-border);--ck-color-input-background:var(--ck-color-base-background);--ck-color-input-border:var(--ck-color-base-border);--ck-color-input-error-border:var(--ck-color-base-error);--ck-color-input-text:var(--ck-color-base-text);--ck-color-input-disabled-background:#f2f2f2;--ck-color-input-disabled-border:var(--ck-color-base-border);--ck-color-input-disabled-text:#757575;--ck-color-list-background:var(--ck-color-base-background);--ck-color-list-button-hover-background:var(--ck-color-button-default-hover-background);--ck-color-list-button-on-background:var(--ck-color-button-on-color);--ck-color-list-button-on-background-focus:var(--ck-color-button-on-color);--ck-color-list-button-on-text:var(--ck-color-base-background);--ck-color-panel-background:var(--ck-color-base-background);--ck-color-panel-border:var(--ck-color-base-border);--ck-color-toolbar-background:var(--ck-color-base-background);--ck-color-toolbar-border:var(--ck-color-base-border);--ck-color-tooltip-background:var(--ck-color-base-text);--ck-color-tooltip-text:var(--ck-color-base-background);--ck-color-engine-placeholder-text:#707070;--ck-color-upload-bar-background:#6cb5f9;--ck-color-link-default:#0000f0;--ck-color-link-selected-background:rgba(31,176,255,.1);--ck-color-link-fake-selection:rgba(31,176,255,.3);--ck-color-highlight-background:#ff0;--ck-color-light-red:#fcc;--ck-disabled-opacity:.5;--ck-focus-outer-shadow-geometry:0 0 0 3px;--ck-focus-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-outer-shadow);--ck-focus-disabled-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-disabled-shadow);--ck-focus-error-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-error-shadow);--ck-focus-ring:1px solid var(--ck-color-focus-border);--ck-font-size-base:13px;--ck-line-height-base:1.84615;--ck-font-face:Helvetica,Arial,Tahoma,Verdana,Sans-Serif;--ck-font-size-tiny:0.7em;--ck-font-size-small:0.75em;--ck-font-size-normal:1em;--ck-font-size-big:1.4em;--ck-font-size-large:1.8em;--ck-ui-component-min-height:2.3em}.ck-reset_all :not(.ck-reset_all-excluded *),.ck.ck-reset,.ck.ck-reset_all{background:transparent;border:0;box-sizing:border-box;height:auto;margin:0;padding:0;position:static;text-decoration:none;transition:none;vertical-align:middle;width:auto;word-wrap:break-word}.ck-reset_all :not(.ck-reset_all-excluded *),.ck.ck-reset_all{border-collapse:collapse;color:var(--ck-color-text);cursor:auto;float:none;font:normal normal normal var(--ck-font-size-base)/var(--ck-line-height-base) var(--ck-font-face);text-align:left;white-space:nowrap}.ck-reset_all .ck-rtl :not(.ck-reset_all-excluded *){text-align:right}.ck-reset_all iframe:not(.ck-reset_all-excluded *){vertical-align:inherit}.ck-reset_all textarea:not(.ck-reset_all-excluded *){white-space:pre-wrap}.ck-reset_all input[type=password]:not(.ck-reset_all-excluded *),.ck-reset_all input[type=text]:not(.ck-reset_all-excluded *),.ck-reset_all textarea:not(.ck-reset_all-excluded *){cursor:text}.ck-reset_all input[type=password][disabled]:not(.ck-reset_all-excluded *),.ck-reset_all input[type=text][disabled]:not(.ck-reset_all-excluded *),.ck-reset_all textarea[disabled]:not(.ck-reset_all-excluded *){cursor:default}.ck-reset_all fieldset:not(.ck-reset_all-excluded *){border:2px groove #dfdee3;padding:10px}.ck-reset_all button:not(.ck-reset_all-excluded *)::-moz-focus-inner{border:0;padding:0}.ck[dir=rtl],.ck[dir=rtl] .ck{text-align:right}:root{--ck-border-radius:2px;--ck-inner-shadow:2px 2px 3px var(--ck-color-shadow-inner) inset;--ck-drop-shadow:0 1px 2px 1px var(--ck-color-shadow-drop);--ck-drop-shadow-active:0 3px 6px 1px var(--ck-color-shadow-drop-active);--ck-spacing-unit:0.6em;--ck-spacing-extra-large:calc(var(--ck-spacing-unit)*2);--ck-spacing-large:calc(var(--ck-spacing-unit)*1.5);--ck-spacing-standard:var(--ck-spacing-unit);--ck-spacing-medium:calc(var(--ck-spacing-unit)*0.8);--ck-spacing-medium-small:calc(var(--ck-spacing-unit)*0.667);--ck-spacing-small:calc(var(--ck-spacing-unit)*0.5);--ck-spacing-tiny:calc(var(--ck-spacing-unit)*0.3);--ck-spacing-extra-tiny:calc(var(--ck-spacing-unit)*0.16)}",""]);const r=o},871(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,'.ck-vertical-form .ck-button:after{bottom:-1px;content:"";position:absolute;right:-1px;top:-1px;width:0;z-index:1}.ck-vertical-form .ck-button:focus:after{display:none}@media screen and (max-width:600px){.ck.ck-responsive-form .ck-button:after{bottom:-1px;content:"";position:absolute;right:-1px;top:-1px;width:0;z-index:1}.ck.ck-responsive-form .ck-button:focus:after{display:none}}.ck-vertical-form>.ck-button:nth-last-child(2):after{border-right:1px solid var(--ck-color-base-border)}.ck.ck-responsive-form{padding:var(--ck-spacing-large)}.ck.ck-responsive-form:focus{outline:none}.ck.ck-responsive-form{[dir=ltr] &>:not(:first-child),[dir=rtl] &>:not(:last-child){margin-left:var(--ck-spacing-standard)}}@media screen and (max-width:600px){.ck.ck-responsive-form{padding:0;width:calc(var(--ck-input-width)*.8)}.ck.ck-responsive-form .ck-labeled-field-view{margin:var(--ck-spacing-large) var(--ck-spacing-large) 0}.ck.ck-responsive-form .ck-labeled-field-view .ck-input-number,.ck.ck-responsive-form .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-responsive-form .ck-labeled-field-view .ck-labeled-field-view__error{white-space:normal}.ck.ck-responsive-form>.ck-button:nth-last-child(2):after{border-right:1px solid var(--ck-color-base-border)}.ck.ck-responsive-form>.ck-button:last-child,.ck.ck-responsive-form>.ck-button:nth-last-child(2){border-radius:0;margin-top:var(--ck-spacing-large);padding:var(--ck-spacing-standard)}.ck.ck-responsive-form>.ck-button:last-child:not(:focus),.ck.ck-responsive-form>.ck-button:nth-last-child(2):not(:focus){border-top:1px solid var(--ck-color-base-border)}.ck.ck-responsive-form>.ck-button:last-child,.ck.ck-responsive-form>.ck-button:nth-last-child(2){[dir=ltr] &,[dir=rtl] &{margin-left:0}[dir=rtl] &:last-of-type{border-right:1px solid var(--ck-color-base-border)}}}',""]);const r=o},880(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,".ck.ck-dialog-overlay{bottom:0;left:0;overscroll-behavior:none;position:fixed;right:0;top:0;user-select:none}.ck.ck-dialog-overlay.ck-dialog-overlay__transparent{animation:none;background:none;pointer-events:none}.ck.ck-dialog{overscroll-behavior:none;position:absolute;width:fit-content}.ck.ck-dialog .ck.ck-form__header{flex-shrink:0}.ck.ck-dialog:not(.ck-dialog_modal) .ck.ck-form__header .ck-form__header__label{cursor:grab}.ck.ck-dialog{.ck.ck-dialog-overlay.ck-dialog-overlay__transparent &{pointer-events:all}}:root{--ck-dialog-overlay-background-color:rgba(0,0,0,.5);--ck-dialog-drop-shadow:0px 0px 6px 2px rgba(0,0,0,.15);--ck-dialog-max-width:100vw;--ck-dialog-max-height:90vh;--ck-color-dialog-background:var(--ck-color-base-background);--ck-color-dialog-form-header-border:var(--ck-color-base-border)}.ck.ck-dialog-overlay{animation:ck-dialog-fade-in .3s;background:var(--ck-dialog-overlay-background-color);z-index:var(--ck-z-dialog)}.ck.ck-dialog{border-radius:0;box-shadow:var(--ck-drop-shadow),0 0;--ck-drop-shadow:var(--ck-dialog-drop-shadow);background:var(--ck-color-dialog-background);border:1px solid var(--ck-color-base-border);max-height:var(--ck-dialog-max-height);max-width:var(--ck-dialog-max-width);overscroll-behavior:contain;&.ck-rounded-corners,.ck-rounded-corners &{border-radius:var(--ck-border-radius)}}.ck.ck-dialog .ck.ck-form__header{border-bottom:1px solid var(--ck-color-dialog-form-header-border)}.ck-dialog-scroll-locked{overflow:hidden}@keyframes ck-dialog-fade-in{0%{background:transparent}to{background:var(--ck-dialog-overlay-background-color)}}",""]);const r=o},993(e,t,i){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n=i(7074),o=i(6012),r=i(2049),s=i(9184),a=i(6761);function l(e,t,i,n,o,r,s){const a=s(e,t,i,n,o,r);if(void 0!==a)return a;if(typeof e==typeof t)switch(typeof e){case"bigint":case"string":case"boolean":case"symbol":case"undefined":case"function":return e===t;case"number":return e===t||Object.is(e,t);case"object":return c(e,t,r,s)}return c(e,t,r,s)}function c(e,t,i,d){if(Object.is(e,t))return!0;let u=r.getTag(e),h=r.getTag(t);if(u===s.argumentsTag&&(u=s.objectTag),h===s.argumentsTag&&(h=s.objectTag),u!==h)return!1;switch(u){case s.stringTag:return e.toString()===t.toString();case s.numberTag:{const i=e.valueOf(),n=t.valueOf();return a.eq(i,n)}case s.booleanTag:case s.dateTag:case s.symbolTag:return Object.is(e.valueOf(),t.valueOf());case s.regexpTag:return e.source===t.source&&e.flags===t.flags;case s.functionTag:return e===t}const m=(i=i??new Map).get(e),g=i.get(t);if(null!=m&&null!=g)return m===t;i.set(e,t),i.set(t,e);try{switch(u){case s.mapTag:if(e.size!==t.size)return!1;for(const[n,o]of e.entries())if(!t.has(n)||!l(o,t.get(n),n,e,t,i,d))return!1;return!0;case s.setTag:{if(e.size!==t.size)return!1;const n=Array.from(e.values()),o=Array.from(t.values());for(let r=0;r<n.length;r++){const s=n[r],a=o.findIndex(n=>l(s,n,void 0,e,t,i,d));if(-1===a)return!1;o.splice(a,1)}return!0}case s.arrayTag:case s.uint8ArrayTag:case s.uint8ClampedArrayTag:case s.uint16ArrayTag:case s.uint32ArrayTag:case s.bigUint64ArrayTag:case s.int8ArrayTag:case s.int16ArrayTag:case s.int32ArrayTag:case s.bigInt64ArrayTag:case s.float32ArrayTag:case s.float64ArrayTag:if("undefined"!=typeof Buffer&&Buffer.isBuffer(e)!==Buffer.isBuffer(t))return!1;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!l(e[n],t[n],n,e,t,i,d))return!1;return!0;case s.arrayBufferTag:return e.byteLength===t.byteLength&&c(new Uint8Array(e),new Uint8Array(t),i,d);case s.dataViewTag:return e.byteLength===t.byteLength&&e.byteOffset===t.byteOffset&&c(new Uint8Array(e),new Uint8Array(t),i,d);case s.errorTag:return e.name===t.name&&e.message===t.message;case s.objectTag:{if(!(c(e.constructor,t.constructor,i,d)||n.isPlainObject(e)&&n.isPlainObject(t)))return!1;const r=[...Object.keys(e),...o.getSymbols(e)],s=[...Object.keys(t),...o.getSymbols(t)];if(r.length!==s.length)return!1;for(let n=0;n<r.length;n++){const o=r[n],s=e[o];if(!Object.hasOwn(t,o))return!1;if(!l(s,t[o],o,e,t,i,d))return!1}return!0}default:return!1}}finally{i.delete(e),i.delete(t)}}t.isEqualWith=function(e,t,i){return l(e,t,void 0,void 0,void 0,void 0,i)}},1091(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,".ck.ck-editor__editable img.image_placeholder{background-size:100% 100%}",""]);const r=o},1111(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,".ck .ck-placeholder,.ck.ck-placeholder{position:relative}.ck .ck-placeholder:before,.ck.ck-placeholder:before{content:attr(data-placeholder);left:0;pointer-events:none;position:absolute;right:0}.ck.ck-read-only .ck-placeholder:before{display:none}.ck.ck-reset_all .ck-placeholder{position:relative}@media (forced-colors:active){.ck .ck-placeholder,.ck.ck-placeholder{forced-color-adjust:preserve-parent-color}}.ck .ck-placeholder:before,.ck.ck-placeholder:before{cursor:text}@media (forced-colors:none){.ck .ck-placeholder:before,.ck.ck-placeholder:before{color:var(--ck-color-engine-placeholder-text)}}@media (forced-colors:active){.ck .ck-placeholder:before,.ck.ck-placeholder:before{font-style:italic;margin-left:1px}}",""]);const r=o},1160(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,'.ck .ck-upload-placeholder-loader{align-items:center;display:flex;justify-content:center;left:0;position:absolute;top:0}.ck .ck-upload-placeholder-loader:before{content:"";position:relative}:root{--ck-color-upload-placeholder-loader:#b3b3b3;--ck-upload-placeholder-loader-size:32px;--ck-upload-placeholder-image-aspect-ratio:2.8}.ck .ck-image-upload-placeholder{margin:0;width:100%}.ck .ck-image-upload-placeholder.image-inline{width:calc(var(--ck-upload-placeholder-loader-size)*2*var(--ck-upload-placeholder-image-aspect-ratio))}.ck .ck-image-upload-placeholder img{aspect-ratio:var(--ck-upload-placeholder-image-aspect-ratio)}.ck .ck-upload-placeholder-loader{height:100%;width:100%}.ck .ck-upload-placeholder-loader:before{animation:ck-upload-placeholder-loader 1s linear infinite;border-radius:50%;border-right:2px solid transparent;border-top:3px solid var(--ck-color-upload-placeholder-loader);height:var(--ck-upload-placeholder-loader-size);width:var(--ck-upload-placeholder-loader-size)}@keyframes ck-upload-placeholder-loader{to{transform:rotate(1turn)}}',""]);const r=o},1173(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,":root{--ck-image-custom-resize-form-width:340px}@media screen and (max-width:600px){:root{--ck-image-custom-resize-form-width:300px}}.ck.ck-image-custom-resize-form.ck-responsive-form{width:var(--ck-image-custom-resize-form-width)}",""]);const r=o},1175(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,".ck.ck-link-providers>.ck-link-providers__list{overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain}.ck.ck-link-providers>.ck-link-providers__list .ck-button>.ck-icon{flex-shrink:0}:root{--ck-link-providers-width:340px;--ck-link-list-view-max-height:240px;--ck-link-list-view-icon-size:calc(var(--ck-icon-size)*0.8)}@media screen and (max-width:600px){:root{--ck-link-providers-width:300px}}.ck.ck-link-providers{width:var(--ck-link-providers-width)}.ck.ck-link-providers .ck-form__header__label{overflow:hidden;text-overflow:ellipsis}.ck.ck-link-providers>.ck-link-providers__list{max-height:min(var(--ck-link-list-view-max-height),40vh)}.ck.ck-link-providers>.ck-link-providers__list .ck-button>.ck-icon{height:var(--ck-link-list-view-icon-size);width:var(--ck-link-list-view-icon-size)}.ck.ck-link-providers>.ck-link-providers__list .ck-button>.ck-button__label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ck.ck-link-providers .ck-link__empty-list-info{font-style:italic;padding:calc(var(--ck-spacing-large)*2) var(--ck-spacing-medium);text-align:center}",""]);const r=o},1214(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,":root{--ck-menu-bar-menu-item-min-width:18em}.ck.ck-menu-bar__menu .ck.ck-menu-bar__menu__item{min-width:var(--ck-menu-bar-menu-item-min-width)}",""]);const r=o},1216(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,":root{--ck-color-resizer:var(--ck-color-focus-border);--ck-color-resizer-tooltip-background:#262626;--ck-color-resizer-tooltip-text:#f2f2f2;--ck-resizer-border-radius:var(--ck-border-radius);--ck-resizer-tooltip-offset:10px;--ck-resizer-tooltip-height:calc(var(--ck-spacing-small)*2 + 10px)}.ck .ck-widget,.ck .ck-widget.ck-widget_with-selection-handle{position:relative}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{position:absolute}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon{display:block}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_with-selection-handle:hover>.ck-widget__selection-handle{visibility:visible}.ck .ck-size-view{background:var(--ck-color-resizer-tooltip-background);border:1px solid var(--ck-color-resizer-tooltip-text);border-radius:var(--ck-resizer-border-radius);color:var(--ck-color-resizer-tooltip-text);display:block;font-size:var(--ck-font-size-tiny);height:var(--ck-resizer-tooltip-height);line-height:var(--ck-resizer-tooltip-height);padding:0 var(--ck-spacing-small)}.ck .ck-size-view.ck-orientation-above-center,.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{left:var(--ck-resizer-tooltip-offset);top:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-top-right{right:var(--ck-resizer-tooltip-offset);top: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)}.ck .ck-size-view.ck-orientation-above-center{left:50%;top:calc(var(--ck-resizer-tooltip-height)*-1);transform:translate(-50%)}: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-color:transparent;outline-style:solid;outline-width:var(--ck-widget-outline-thickness);transition:outline-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve)}@media (prefers-reduced-motion:reduce){.ck .ck-widget{transition:none}}.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{box-shadow:var(--ck-inner-shadow),0 0}@media (forced-colors:none){.ck .ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck .ck-editor__nested-editable:focus{background-color:var(--ck-color-widget-editable-focus-background)}}.ck .ck-editor__nested-editable.ck-editor__nested-editable_focused:not(td,th),.ck .ck-editor__nested-editable:focus:not(td,th){border:var(--ck-focus-ring);outline:none}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{background-color:transparent;border-radius:var(--ck-border-radius) var(--ck-border-radius) 0 0;box-sizing:border-box;left:calc(0px - var(--ck-widget-outline-thickness));opacity:0;padding:4px;top:0;transform:translateY(-100%);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)}@media (prefers-reduced-motion:reduce){.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{transition:none}}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon{color:var(--ck-color-widget-drag-handler-icon-color);height:var(--ck-widget-handler-icon-size);width:var(--ck-widget-handler-icon-size)}.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)}@media (prefers-reduced-motion:reduce){.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator{transition:none}}.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{background-color:var(--ck-color-widget-hover-border);opacity:1}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle{background-color:var(--ck-color-focus-border);opacity:1}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator{opacity:1}.ck[dir=rtl] .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{left:auto;right:calc(0px - var(--ck-widget-outline-thickness))}.ck.ck-editor__editable.ck-read-only .ck-widget{transition:none}.ck.ck-editor__editable.ck-read-only .ck-widget:not(.ck-widget_selected){--ck-widget-outline-thickness:0px}.ck.ck-editor__editable.ck-read-only .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle,.ck.ck-editor__editable.ck-read-only .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle:hover{background:var(--ck-color-widget-blurred-border)}.ck .ck-widget:has(.ck-widget.table:hover){outline-color:transparent}.ck .ck-widget.ck-widget_with-selection-handle:has(.ck-widget.table:hover)>.ck-widget__selection-handle{opacity:0;visibility:hidden}.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:hover>.ck-widget__selection-handle,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle:hover>.ck-widget__selection-handle:hover,.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{background:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable:not(.ck-pagination-view) blockquote>.ck-widget.ck-widget_with-selection-handle:first-child,.ck.ck-editor__editable:not(.ck-pagination-view)>.ck-widget.ck-widget_with-selection-handle:first-child{margin-top:calc(1em + var(--ck-widget-handler-icon-size))}",""]);const r=o},1230(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,'.ck-image-upload-complete-icon{border-radius:50%;display:block;position:absolute;right:min(var(--ck-spacing-medium),6%);top:min(var(--ck-spacing-medium),6%);z-index:1}.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:20;--ck-image-upload-icon-width:2px;--ck-image-upload-icon-is-visible:clamp(0px,100% - 50px,1px)}.ck-image-upload-complete-icon{animation-delay:0ms,3s;animation-duration:.5s,.5s;animation-fill-mode:forwards,forwards;animation-name:ck-upload-complete-icon-show,ck-upload-complete-icon-hide;background:var(--ck-color-image-upload-icon-background);font-size:calc(1px*var(--ck-image-upload-icon-size));height:calc(var(--ck-image-upload-icon-is-visible)*var(--ck-image-upload-icon-size));opacity:0;overflow:hidden;width:calc(var(--ck-image-upload-icon-is-visible)*var(--ck-image-upload-icon-size))}.ck-image-upload-complete-icon:after{animation-delay:.5s;animation-duration:.5s;animation-fill-mode:forwards;animation-name:ck-upload-complete-icon-check;border-right:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);border-top:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);box-sizing:border-box;height:0;left:25%;opacity:0;top:50%;transform:scaleX(-1) rotate(135deg);transform-origin:left top;width:0}@media (prefers-reduced-motion:reduce){.ck-image-upload-complete-icon{animation-duration:0ms}.ck-image-upload-complete-icon:after{animation:none;height:.45em;opacity:1;width:.3em}}@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%{height:0;opacity:1;width:0}33%{height:0;width:.3em}to{height:.45em;opacity:1;width:.3em}}',""]);const r=o},1501(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,".ck-content blockquote{border-left:5px solid #ccc;font-style:italic;margin-left:0;margin-right:0;overflow:hidden;padding-left:1.5em;padding-right:1.5em}.ck-content[dir=rtl] blockquote{border-left:0;border-right:5px solid #ccc}",""]);const r=o},1545(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,".ck.ck-image-insert-url{padding:var(--ck-spacing-large) var(--ck-spacing-large) 0;width:400px}.ck.ck-image-insert-url .ck-image-insert-url__action-row{display:grid;grid-template-columns:repeat(2,1fr)}:root{--ck-image-insert-insert-by-url-width:250px}.ck.ck-image-insert-url{--ck-input-width:100%}.ck.ck-image-insert-url .ck-image-insert-url__action-row{grid-column-gap:var(--ck-spacing-large);margin-top:var(--ck-spacing-large)}.ck.ck-image-insert-url .ck-image-insert-url__action-row .ck-button-cancel,.ck.ck-image-insert-url .ck-image-insert-url__action-row .ck-button-save{justify-content:center;min-width:auto}.ck.ck-image-insert-url .ck-image-insert-url__action-row .ck-button .ck-button__label{color:var(--ck-color-text)}.ck.ck-image-insert-form>.ck.ck-button{display:block;width:100%;[dir=ltr] &{text-align:left}[dir=rtl] &{text-align:right}}.ck.ck-image-insert-form>.ck.ck-collapsible:not(:first-child){border-top:1px solid var(--ck-color-base-border)}.ck.ck-image-insert-form>.ck.ck-collapsible:not(:last-child){border-bottom:1px solid var(--ck-color-base-border)}.ck.ck-image-insert-form>.ck.ck-collapsible,.ck.ck-image-insert-form>.ck.ck-image-insert-url{min-width:var(--ck-image-insert-insert-by-url-width)}.ck.ck-image-insert-form>.ck.ck-image-insert-url{padding:var(--ck-spacing-large)}.ck.ck-image-insert-form:focus{outline:none}",""]);const r=o},1546(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,":root{--ck-input-width:18em;--ck-input-text-width:var(--ck-input-width)}.ck.ck-input{background:var(--ck-color-input-background);border:1px solid var(--ck-color-input-border);border-radius:0;min-height:var(--ck-ui-component-min-height);min-width:var(--ck-input-width);padding:var(--ck-spacing-extra-tiny) var(--ck-spacing-medium);transition:box-shadow .1s ease-in-out,border .1s ease-in-out;&.ck-rounded-corners,.ck-rounded-corners &{border-radius:var(--ck-border-radius)}}@media (prefers-reduced-motion:reduce){.ck.ck-input{transition:none}}.ck.ck-input:focus{border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0;outline:none}.ck.ck-input[readonly]{background:var(--ck-color-input-disabled-background);border:1px solid var(--ck-color-input-disabled-border);color:var(--ck-color-input-disabled-text)}.ck.ck-input[readonly]:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),0 0}.ck.ck-input.ck-error{animation:ck-input-shake .3s ease both;border-color:var(--ck-color-input-error-border)}@media (prefers-reduced-motion:reduce){.ck.ck-input.ck-error{animation:none}}.ck.ck-input.ck-error:focus{box-shadow:var(--ck-focus-error-outer-shadow),0 0}@keyframes ck-input-shake{20%{transform:translateX(-2px)}40%{transform:translateX(2px)}60%{transform:translateX(-1px)}80%{transform:translateX(1px)}}",""]);const r=o},1710(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,".ck.ck-aria-live-announcer{left:-10000px;position:absolute;top:-10000px}.ck.ck-aria-live-region-list{list-style-type:none}",""]);const r=o},1750(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,".ck.ck-collapsible.ck-collapsible_collapsed>.ck-collapsible__children{display:none}:root{--ck-collapsible-arrow-size:calc(var(--ck-icon-size)*0.5)}.ck.ck-collapsible>.ck.ck-button{border-radius:0;color:inherit;font-weight:700;width:100%}.ck.ck-collapsible>.ck.ck-button:focus{background:transparent}.ck.ck-collapsible>.ck.ck-button:active,.ck.ck-collapsible>.ck.ck-button:hover:not(:focus),.ck.ck-collapsible>.ck.ck-button:not(:focus){background:transparent;border-color:transparent;box-shadow:none}.ck.ck-collapsible>.ck.ck-button>.ck-icon{margin-right:var(--ck-spacing-medium);width:var(--ck-collapsible-arrow-size)}.ck.ck-collapsible>.ck-collapsible__children{padding:var(--ck-spacing-medium) var(--ck-spacing-large) var(--ck-spacing-large)}.ck.ck-collapsible.ck-collapsible_collapsed>.ck.ck-button .ck-icon{transform:rotate(-90deg)}",""]);const r=o},1862(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,":root{--ck-content-highlight-marker-yellow:#fdfd77;--ck-content-highlight-marker-green:#62f962;--ck-content-highlight-marker-pink:#fc7899;--ck-content-highlight-marker-blue:#72ccfd;--ck-content-highlight-pen-red:#e71313;--ck-content-highlight-pen-green:#128a00}.ck-content .marker-yellow{background-color:var(--ck-content-highlight-marker-yellow)}.ck-content .marker-green{background-color:var(--ck-content-highlight-marker-green)}.ck-content .marker-pink{background-color:var(--ck-content-highlight-marker-pink)}.ck-content .marker-blue{background-color:var(--ck-content-highlight-marker-blue)}.ck-content .pen-red{background-color:transparent;color:var(--ck-content-highlight-pen-red)}.ck-content .pen-green{background-color:transparent;color:var(--ck-content-highlight-pen-green)}",""]);const r=o},2049(e,t){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.getTag=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}},2060(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,".ck .ck-widget_with-resizer{position:relative}.ck .ck-widget__resizer{display:none;left:0;pointer-events:none;position:absolute;top:0}.ck-focused .ck-widget_with-resizer.ck-widget_selected>.ck-widget__resizer{display:block}.ck .ck-widget__resizer__handle{pointer-events:all;position:absolute}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-right,.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-left{cursor:nwse-resize}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-left,.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-right{cursor:nesw-resize}:root{--ck-resizer-size:10px;--ck-resizer-offset:calc(var(--ck-resizer-size)/-2 - 2px);--ck-resizer-border-width:1px}.ck .ck-widget__resizer{outline:1px solid var(--ck-color-resizer)}.ck .ck-widget__resizer__handle{background:var(--ck-color-focus-border);border:var(--ck-resizer-border-width) solid #fff;border-radius:var(--ck-resizer-border-radius);height:var(--ck-resizer-size);width:var(--ck-resizer-size)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-left{left:var(--ck-resizer-offset);top:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-right{right:var(--ck-resizer-offset);top:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-right{bottom:var(--ck-resizer-offset);right:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-left{bottom:var(--ck-resizer-offset);left:var(--ck-resizer-offset)}",""]);const r=o},2350(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,".ck.ck-link-form .ck-link-form__providers-list{display:flex;flex-direction:column}.ck.ck-link-form .ck-link-form__providers-list .ck-link__button>.ck-button__label{flex-grow:1}.ck.ck-link-form .ck-link__items:empty{display:none}:root{--ck-link-panel-width:340px;--ck-link-provider-list-item-text-height:calc(var(--ck-line-height-base)*var(--ck-font-size-base));--ck-link-provider-list-item-height:calc(var(--ck-link-provider-list-item-text-height) + var(--ck-spacing-small) + var(--ck-spacing-small))}@media screen and (max-width:600px){:root{--ck-link-panel-width:300px}}.ck.ck-form.ck-link-form{padding-bottom:0;width:var(--ck-link-panel-width)}@media screen and (max-width:600px){.ck.ck-form.ck-link-form.ck-responsive-form .ck-labeled-field-view{margin:0}}.ck.ck-form.ck-link-form .ck-link-form__providers-list{border-top:1px solid var(--ck-color-base-border)}.ck.ck-form.ck-link-form .ck-link-form__providers-list:has(.ck-list__item:nth-child(n+5)){max-height:calc(var(--ck-link-provider-list-item-height)*4 + var(--ck-spacing-large) + 1px);overflow:auto}.ck.ck-form.ck-link-form .ck-link-form__providers-list .ck-link__button{border-radius:0;padding:var(--ck-spacing-small) var(--ck-spacing-large)}.ck.ck-form.ck-link-form .ck-link-form__providers-list .ck-link__button>.ck-button__label{overflow:hidden;text-overflow:ellipsis}",""]);const r=o},2454(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,".ck.ck-dropdown>.ck-dropdown__panel>.ck-list{border-radius:0;&.ck-rounded-corners,.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-rounded-corners &{border-radius:var(--ck-border-radius);border-bottom-left-radius:0;border-bottom-right-radius:0;border-top-left-radius:0}}.ck.ck-dropdown>.ck-dropdown__panel>.ck-list .ck-list__item:last-child>.ck-button{border-radius:0;&.ck-rounded-corners,.ck-rounded-corners &{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}}",""]);const r=o},2850(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,':root{--ck-table-selected-cell-background:rgba(158,207,250,.3)}.ck.ck-editor__editable .table table td.ck-editor__editable_selected,.ck.ck-editor__editable .table table th.ck-editor__editable_selected{box-shadow:unset;caret-color:transparent;position:relative}.ck.ck-editor__editable .table table td.ck-editor__editable_selected:after,.ck.ck-editor__editable .table table th.ck-editor__editable_selected:after{background-color:var(--ck-table-selected-cell-background);bottom:0;content:"";left:0;pointer-events:none;position:absolute;right:0;top: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,.ck.ck-editor__editable .table table th.ck-editor__editable_selected .ck-widget{outline:unset}.ck.ck-editor__editable .table table td.ck-editor__editable_selected .ck-widget>.ck-widget__selection-handle,.ck.ck-editor__editable .table table th.ck-editor__editable_selected .ck-widget>.ck-widget__selection-handle{display:none}',""]);const r=o},2922(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,".ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__color-picker,.ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__remove-color{align-items:center;display:flex;[dir=rtl] &{justify-content:flex-start}}.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-selector_action-bar{display:flex;flex-direction:row;justify-content:space-around}.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-selector_action-bar .ck-button-cancel,.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-selector_action-bar .ck-button-save{flex:1}.ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__color-picker,.ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__remove-color{width:100%}.ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__color-picker{border-bottom-left-radius:0;border-bottom-right-radius:0;padding:calc(var(--ck-spacing-standard)/2) var(--ck-spacing-standard)}.ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__color-picker:not(:focus){border-top:1px solid var(--ck-color-base-border)}.ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__color-picker .ck.ck-icon{[dir=ltr] &{margin-right:var(--ck-spacing-standard)}[dir=rtl] &{margin-left:var(--ck-spacing-standard)}}.ck.ck-color-selector .ck-color-grids-fragment label.ck.ck-color-grid__label{font-weight:unset}.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-picker{padding:8px}.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-picker .hex-color-picker{height:100px;min-width:180px}.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-picker .hex-color-picker::part(saturation){border-radius:var(--ck-border-radius) var(--ck-border-radius) 0 0}.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-picker .hex-color-picker::part(hue){border-radius:0 0 var(--ck-border-radius) var(--ck-border-radius)}.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-picker .hex-color-picker::part(hue-pointer),.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-picker .hex-color-picker::part(saturation-pointer){height:15px;width:15px}.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-selector_action-bar{padding:0 8px 8px}",""]);const r=o},3038(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,":root{--ck-content-color-image-caption-background:#f7f7f7;--ck-content-color-image-caption-text:#333;--ck-color-image-caption-highlighted-background:#fd0}.ck-content .image>figcaption{background-color:var(--ck-content-color-image-caption-background);break-before:avoid;caption-side:bottom;color:var(--ck-content-color-image-caption-text);display:table-caption;font-size:.75em;outline-offset:-1px;overflow-wrap:anywhere;padding:.6em;word-break:normal}@media (forced-colors:active){.ck-content .image>figcaption{background-color:unset;color:unset}}@media (forced-colors:none){.ck.ck-editor__editable .image>figcaption.image__caption_highlighted{animation:ck-image-caption-highlight .6s ease-out}}@media (prefers-reduced-motion:reduce){.ck.ck-editor__editable .image>figcaption.image__caption_highlighted{animation:none}}@keyframes ck-image-caption-highlight{0%{background-color:var(--ck-color-image-caption-highlighted-background)}to{background-color:var(--ck-content-color-image-caption-background)}}",""]);const r=o},3086(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,".color-picker-hex-input{width:max-content}.color-picker-hex-input .ck.ck-input{min-width:unset}.ck.ck-color-picker__row{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between;margin:var(--ck-spacing-large) 0 0;width:unset}.ck.ck-color-picker__row .ck.ck-labeled-field-view{padding-top:unset}.ck.ck-color-picker__row .ck.ck-input-text{width:unset}.ck.ck-color-picker__row .ck-color-picker__hash-view{padding-right:var(--ck-spacing-medium);padding-top:var(--ck-spacing-tiny)}",""]);const r=o},3155(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,".ck-content .media{clear:both;display:block;margin:.9em 0;min-width:15em}",""]);const r=o},3389(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,".ck.ck-list-item-button{border-radius:0;min-height:unset;width:100%;[dir=ltr] &{text-align:left}[dir=rtl] &{text-align:right}}.ck.ck-list-item-button.ck-list-item-button_toggleable{[dir=ltr] &{padding-left:var(--ck-spacing-small)}[dir=rtl] &{padding-right:var(--ck-spacing-small)}}.ck.ck-list-item-button .ck-list-item-button__check-holder{display:inline-flex;height:.9em;width:.9em;[dir=ltr] &{margin-right:var(--ck-spacing-small)}[dir=rtl] &{margin-left:var(--ck-spacing-small)}}.ck.ck-list-item-button .ck-list-item-button__check-icon{height:100%}.ck.ck-button.ck-list-item-button{padding:var(--ck-spacing-tiny) calc(var(--ck-spacing-standard)*2)}.ck.ck-button.ck-list-item-button,.ck.ck-button.ck-list-item-button.ck-on{background:var(--ck-color-list-background);color:var(--ck-color-text)}.ck.ck-button.ck-list-item-button:has(.ck-list-item-button__check-holder){[dir=ltr] &{padding-left:var(--ck-spacing-small)}[dir=rtl] &{padding-right:var(--ck-spacing-small)}}.ck.ck-button.ck-list-item-button.ck-button.ck-on:hover,.ck.ck-button.ck-list-item-button.ck-on:hover,.ck.ck-button.ck-list-item-button.ck-on:not(.ck-list-item-button_toggleable),.ck.ck-button.ck-list-item-button:hover:not(.ck-disabled){background:var(--ck-color-list-button-hover-background)}.ck.ck-button.ck-list-item-button.ck-button.ck-on:hover:not(.ck-disabled),.ck.ck-button.ck-list-item-button.ck-on:hover:not(.ck-disabled),.ck.ck-button.ck-list-item-button.ck-on:not(.ck-list-item-button_toggleable):not(.ck-disabled),.ck.ck-button.ck-list-item-button:hover:not(.ck-disabled):not(.ck-disabled){color:var(--ck-color-text)}",""]);const r=o},3579(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,".ck .ck-fake-panel{position:absolute;z-index:calc(var(--ck-z-panel) - 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{background:var(--ck-color-panel-background);border:1px solid var(--ck-color-panel-border);border-radius:var(--ck-border-radius);box-shadow:var(--ck-drop-shadow),0 0;height:100%;min-height:15px;width: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}",""]);const r=o},3790(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,".ck.ck-form__row{align-items:flex-start;display:flex;flex-direction:row;justify-content:space-between;padding:var(--ck-spacing-standard) var(--ck-spacing-large) 0}.ck.ck-form__row.ck-form__row_large-top-padding{padding-top:var(--ck-spacing-large)}.ck.ck-form__row.ck-form__row_large-bottom-padding{padding-bottom:var(--ck-spacing-large)}.ck.ck-form__row.ck-form__row_with-submit{flex-wrap:nowrap}.ck.ck-form__row.ck-form__row_with-submit>:not(:first-child){margin-inline-start:var(--ck-spacing-standard)}.ck.ck-form__row>.ck.ck-form__row{padding:0}",""]);const r=o},4106(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,".ck.ck-icon{vertical-align:middle}:root{--ck-icon-size:calc(var(--ck-line-height-base)*var(--ck-font-size-normal));--ck-icon-font-size:.8333350694em}.ck.ck-icon{font-size:var(--ck-icon-font-size);height:var(--ck-icon-size);width:var(--ck-icon-size)}.ck.ck-icon,.ck.ck-icon *{cursor:inherit}.ck.ck-icon.ck-icon_inherit-color,.ck.ck-icon.ck-icon_inherit-color *{color:inherit}.ck.ck-icon.ck-icon_inherit-color :not([fill]){fill:currentColor}",""]);const r=o},4214(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,".ck-content img.image_resized{height:auto}.ck-content .image.image_resized{box-sizing:border-box;display:block;max-width:100%}.ck-content .image.image_resized img{width:100%}.ck-content .image.image_resized>figcaption{display:block}.ck.ck-editor__editable td .image-inline.image_resized img,.ck.ck-editor__editable th .image-inline.image_resized img{max-width:100%}[dir=ltr] .ck.ck-button.ck-button_with-text.ck-resize-image-button .ck-button__icon{margin-right:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-button.ck-button_with-text.ck-resize-image-button .ck-button__icon{margin-left:var(--ck-spacing-standard)}.ck.ck-dropdown .ck-button.ck-resize-image-button .ck-button__label{width:4em}",""]);const r=o},4284(e){"use strict";var t,i=(t=[],function(e,i){return t[e]=i,t.filter(Boolean).join("\n")});function n(e,t,n,o){var r;if(n)r="";else{r="",o.supports&&(r+="@supports (".concat(o.supports,") {")),o.media&&(r+="@media ".concat(o.media," {"));var s=void 0!==o.layer;s&&(r+="@layer".concat(o.layer.length>0?" ".concat(o.layer):""," {")),r+=o.css,s&&(r+="}"),o.media&&(r+="}"),o.supports&&(r+="}")}if(e.styleSheet)e.styleSheet.cssText=i(t,r);else{var a=document.createTextNode(r),l=e.childNodes;l[t]&&e.removeChild(l[t]),l.length?e.insertBefore(a,l[t]):e.appendChild(a)}}var o={singleton:null,singletonCounter:0};e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=o.singletonCounter++,i=o.singleton||(o.singleton=e.insertStyleElement(e));return{update:function(e){n(i,t,!1,e)},remove:function(e){n(i,t,!0,e)}}}},4606(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,".ck.ck-label{display:block}.ck.ck-voice-label{display:none}.ck.ck-label{font-weight:700}",""]);const r=o},4650(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,".ck.ck-balloon-panel.ck-tooltip{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;z-index:calc(var(--ck-z-dialog) + 100);--ck-balloon-border-width:0px;--ck-balloon-arrow-offset:0px;--ck-balloon-arrow-half-width:4px;--ck-balloon-arrow-height:4px;--ck-tooltip-text-padding:4px;--ck-color-panel-background:var(--ck-color-tooltip-background);padding:0 var(--ck-spacing-medium)}.ck.ck-balloon-panel.ck-tooltip .ck-tooltip__text{color:var(--ck-color-tooltip-text);font-size:.9em;line-height:1.5}.ck.ck-balloon-panel.ck-tooltip.ck-tooltip_multi-line .ck-tooltip__text{display:inline-block;max-width:200px;padding:var(--ck-tooltip-text-padding) 0;white-space:break-spaces}.ck.ck-balloon-panel.ck-tooltip{box-shadow:none}.ck.ck-balloon-panel.ck-tooltip:before{display:none}",""]);const r=o},4782(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,".ck.ck-menu-bar{background:var(--ck-color-base-background);border:1px solid var(--ck-color-toolbar-border);display:flex;flex-wrap:wrap;gap:var(--ck-spacing-small);justify-content:flex-start;padding:var(--ck-spacing-small);width:100%}",""]);const r=o},4866(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,".ck.ck-form__header{align-items:center;display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between}.ck.ck-form__header h2.ck-form__header__label{flex-grow:1;overflow:hidden;text-overflow:ellipsis}:root{--ck-form-header-height:3.384em}.ck.ck-form__header{border-bottom:1px solid var(--ck-color-base-border);flex-shrink:0;height:var(--ck-form-header-height);line-height:var(--ck-form-header-height);padding:var(--ck-spacing-small) var(--ck-spacing-large)}.ck.ck-form__header>.ck-icon{flex-shrink:0;margin-inline-end:var(--ck-spacing-medium)}.ck.ck-form__header .ck-form__header__label{--ck-font-size-base:1.153em;font-weight:700}.ck.ck-form__header:has(.ck-button-back.ck-hidden){padding-inline:var(--ck-spacing-large) var(--ck-spacing-large)}.ck.ck-form__header:has(.ck-button-back:not(.ck-hidden)){padding-inline:var(--ck-spacing-small) var(--ck-spacing-small)}.ck.ck-form__header>.ck-button-back{margin-inline-end:var(--ck-spacing-small)}.ck.ck-form__header>.ck.ck-button{flex-shrink:0}",""]);const r=o},4868(e){"use strict";e.exports=function(e,t){Object.keys(t).forEach(function(i){e.setAttribute(i,t[i])})}},4873(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,":root{--ck-menu-bar-menu-max-width:75vw;--ck-menu-bar-nested-menu-horizontal-offset:5px}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel{max-width:var(--ck-menu-bar-menu-max-width);position:absolute;z-index:var(--ck-z-panel)}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_ne,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_nw{bottom:100%}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_se,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_sw{bottom:auto;top:100%}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_ne,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_se{left:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_nw,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_sw{right:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_en,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_es{left:calc(100% - var(--ck-menu-bar-nested-menu-horizontal-offset))}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_es{top:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_en{bottom:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_wn,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_ws{right:calc(100% - var(--ck-menu-bar-nested-menu-horizontal-offset))}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_ws{top:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_wn{bottom:0}:root{--ck-menu-bar-menu-panel-max-width:75vw}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel{background:var(--ck-color-dropdown-panel-background);border:1px solid var(--ck-color-dropdown-panel-border);border-radius:0;bottom:0;box-shadow:var(--ck-drop-shadow),0 0;height:fit-content;max-width:var(--ck-menu-bar-menu-panel-max-width);&.ck-rounded-corners,.ck-rounded-corners &{border-radius:var(--ck-border-radius)}}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_es,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_se{border-top-left-radius:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_sw,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_ws{border-top-right-radius:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_en,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_ne{border-bottom-left-radius:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_nw,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_wn{border-bottom-right-radius:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel:focus{outline:none}.ck.ck-menu-bar .ck-list-item-button:active,.ck.ck-menu-bar .ck-list-item-button:focus{border-color:transparent;box-shadow:none}.ck.ck-menu-bar.ck-menu-bar_focus-border-enabled .ck-list-item-button:active,.ck.ck-menu-bar.ck-menu-bar_focus-border-enabled .ck-list-item-button:focus{border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0;outline:none;position:relative;z-index:2}",""]);const r=o},5072(e){"use strict";var t=[];function i(e){for(var i=-1,n=0;n<t.length;n++)if(t[n].identifier===e){i=n;break}return i}function n(e,n){for(var r={},s=[],a=0;a<e.length;a++){var l=e[a],c=n.base?l[0]+n.base:l[0],d=r[c]||0,u="".concat(c," ").concat(d);r[c]=d+1;var h=i(u),m={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==h)t[h].references++,t[h].updater(m);else{var g=o(m,n);n.byIndex=a,t.splice(a,0,{identifier:u,updater:g,references:1})}s.push(u)}return s}function o(e,t){var i=t.domAPI(t);i.update(e);return function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;i.update(e=t)}else i.remove()}}e.exports=function(e,o){var r=n(e=e||[],o=o||{});return function(e){e=e||[];for(var s=0;s<r.length;s++){var a=i(r[s]);t[a].references--}for(var l=n(e,o),c=0;c<r.length;c++){var d=i(r[c]);0===t[d].references&&(t[d].updater(),t.splice(d,1))}r=l}}},5078(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,".ck.ck-menu-bar__menu .ck-button.ck-menu-bar__menu__item__button{border-radius:0}.ck.ck-menu-bar__menu .ck-button.ck-menu-bar__menu__item__button>.ck-spinner-container,.ck.ck-menu-bar__menu .ck-button.ck-menu-bar__menu__item__button>.ck-spinner-container .ck-spinner{--ck-toolbar-spinner-size:20px}.ck.ck-menu-bar__menu .ck-button.ck-menu-bar__menu__item__button>.ck-spinner-container{font-size:var(--ck-icon-font-size);[dir=ltr] &{margin-right:var(--ck-spacing-medium)}[dir=rtl] &{margin-left:var(--ck-spacing-medium)}}",""]);const r=o},5615(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,':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-panel)}.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-border-width:1px;--ck-balloon-arrow-offset:2px;--ck-balloon-arrow-height:10px;--ck-balloon-arrow-half-width:8px;--ck-balloon-arrow-drop-shadow:0 2px 2px var(--ck-color-shadow-drop)}.ck.ck-balloon-panel{background:var(--ck-color-panel-background);border:var(--ck-balloon-border-width) solid var(--ck-color-panel-border);border-radius:0;box-shadow:var(--ck-drop-shadow),0 0;min-height:15px;&.ck-rounded-corners,.ck-rounded-corners &{border-radius:var(--ck-border-radius)}}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{border-style:solid;height:0;width:0}.ck.ck-balloon-panel[class*=arrow_n]:after,.ck.ck-balloon-panel[class*=arrow_n]:before{border-width:0 var(--ck-balloon-arrow-half-width) var(--ck-balloon-arrow-height) var(--ck-balloon-arrow-half-width)}.ck.ck-balloon-panel[class*=arrow_n]:before{border-color:transparent transparent var(--ck-color-panel-border) transparent;margin-top:calc(var(--ck-balloon-border-width)*-1)}.ck.ck-balloon-panel[class*=arrow_n]:after{border-color:transparent transparent var(--ck-color-panel-background) transparent;margin-top:calc(var(--ck-balloon-arrow-offset) - var(--ck-balloon-border-width))}.ck.ck-balloon-panel[class*=arrow_s]:after,.ck.ck-balloon-panel[class*=arrow_s]:before{border-width:var(--ck-balloon-arrow-height) var(--ck-balloon-arrow-half-width) 0 var(--ck-balloon-arrow-half-width)}.ck.ck-balloon-panel[class*=arrow_s]:before{border-color:var(--ck-color-panel-border) transparent transparent;filter:drop-shadow(var(--ck-balloon-arrow-drop-shadow));margin-bottom:calc(var(--ck-balloon-border-width)*-1)}.ck.ck-balloon-panel[class*=arrow_s]:after{border-color:var(--ck-color-panel-background) transparent transparent transparent;margin-bottom:calc(var(--ck-balloon-arrow-offset) - var(--ck-balloon-border-width))}.ck.ck-balloon-panel[class*=arrow_e]:after,.ck.ck-balloon-panel[class*=arrow_e]:before{border-width:var(--ck-balloon-arrow-half-width) 0 var(--ck-balloon-arrow-half-width) var(--ck-balloon-arrow-height)}.ck.ck-balloon-panel[class*=arrow_e]:before{border-color:transparent transparent transparent var(--ck-color-panel-border);margin-right:calc(var(--ck-balloon-border-width)*-1)}.ck.ck-balloon-panel[class*=arrow_e]:after{border-color:transparent transparent transparent var(--ck-color-panel-background);margin-right:calc(var(--ck-balloon-arrow-offset) - var(--ck-balloon-border-width))}.ck.ck-balloon-panel[class*=arrow_w]:after,.ck.ck-balloon-panel[class*=arrow_w]:before{border-width:var(--ck-balloon-arrow-half-width) var(--ck-balloon-arrow-height) var(--ck-balloon-arrow-half-width) 0}.ck.ck-balloon-panel[class*=arrow_w]:before{border-color:transparent var(--ck-color-panel-border) transparent transparent;margin-left:calc(var(--ck-balloon-border-width)*-1)}.ck.ck-balloon-panel[class*=arrow_w]:after{border-color:transparent var(--ck-color-panel-background) transparent transparent;margin-left:calc(var(--ck-balloon-arrow-offset) - var(--ck-balloon-border-width))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:before{left:50%;margin-left:calc(var(--ck-balloon-arrow-half-width)*-1);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:before{left:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:before{right:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);left:50%;margin-left:calc(var(--ck-balloon-arrow-half-width)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);left:calc(var(--ck-balloon-arrow-half-width)*2)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);right:calc(var(--ck-balloon-arrow-half-width)*2)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sme:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sme:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);margin-right:calc(var(--ck-balloon-arrow-half-width)*2);right:25%}.ck.ck-balloon-panel.ck-balloon-panel_arrow_smw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_smw:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);left:25%;margin-left:calc(var(--ck-balloon-arrow-half-width)*2)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nme:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nme:before{margin-right:calc(var(--ck-balloon-arrow-half-width)*2);right:25%;top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nmw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nmw:before{left:25%;margin-left:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_e:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_e:before{margin-top:calc(var(--ck-balloon-arrow-half-width)*-1);right:calc(var(--ck-balloon-arrow-height)*-1);top:50%}.ck.ck-balloon-panel.ck-balloon-panel_arrow_w:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_w:before{left:calc(var(--ck-balloon-arrow-height)*-1);margin-top:calc(var(--ck-balloon-arrow-half-width)*-1);top:50%}',""]);const r=o},5667(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,".ck.ck-menu-bar__menu>.ck-menu-bar__menu__button>.ck-menu-bar__menu__button__arrow{pointer-events:none;z-index:var(--ck-z-default)}.ck.ck-menu-bar__menu>.ck-menu-bar__menu__button{width:100%}.ck.ck-menu-bar__menu>.ck-menu-bar__menu__button>.ck-button__label{flex-grow:1;overflow:hidden;text-overflow:ellipsis}.ck.ck-menu-bar__menu>.ck-menu-bar__menu__button.ck-disabled>.ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-menu-bar__menu>.ck-menu-bar__menu__button{[dir=ltr] &:not(.ck-button_with-text){padding-left:var(--ck-spacing-small)}[dir=rtl] &:not(.ck-button_with-text){padding-right:var(--ck-spacing-small)}}.ck.ck-menu-bar__menu.ck-menu-bar__menu_top-level>.ck-menu-bar__menu__button{min-height:unset;padding:var(--ck-spacing-small) var(--ck-spacing-medium)}.ck.ck-menu-bar__menu.ck-menu-bar__menu_top-level>.ck-menu-bar__menu__button .ck-button__label{line-height:unset;overflow:visible;width:unset}.ck.ck-menu-bar__menu.ck-menu-bar__menu_top-level>.ck-menu-bar__menu__button.ck-on{border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-menu-bar__menu.ck-menu-bar__menu_top-level>.ck-menu-bar__menu__button .ck-icon{display:none}.ck.ck-menu-bar__menu:not(.ck-menu-bar__menu_top-level) .ck-menu-bar__menu__button{border-radius:0}.ck.ck-menu-bar__menu:not(.ck-menu-bar__menu_top-level) .ck-menu-bar__menu__button>.ck-menu-bar__menu__button__arrow{width:var(--ck-dropdown-arrow-size);[dir=ltr] &{margin-left:var(--ck-spacing-standard);margin-right:calc(var(--ck-spacing-small)*-1);transform:rotate(-90deg)}[dir=rtl] &{left:var(--ck-spacing-standard);margin-left:calc(var(--ck-spacing-small)*-1);margin-right:var(--ck-spacing-small);transform:rotate(90deg)}}.ck.ck-menu-bar__menu:not(.ck-menu-bar__menu_top-level) .ck-menu-bar__menu__button.ck-disabled>.ck-menu-bar__menu__button__arrow{opacity:var(--ck-disabled-opacity)}",""]);const r=o},5767(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,'.ck-media__wrapper .ck-media__placeholder{align-items:center;display:flex;flex-direction:column}.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 .ck-media__placeholder__url__text{display:block;overflow:hidden}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="goo.gl/maps"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="google.com/maps"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="maps.app.goo.gl"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="maps.google.com"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck-media__placeholder__icon *{display:none}.ck-editor__editable:not(.ck-read-only) .ck-media__wrapper>:not(.ck-media__placeholder),.ck-editor__editable:not(.ck-read-only) .ck-widget:not(.ck-widget_selected) .ck-media__placeholder{pointer-events:none}:root{--ck-media-embed-placeholder-icon-size:3em;--ck-color-media-embed-placeholder-url-text:#757575;--ck-color-media-embed-placeholder-url-text-hover:var(--ck-color-base-text)}.ck-media__wrapper{margin:0 auto}.ck-media__wrapper .ck-media__placeholder{background:var(--ck-color-base-foreground);padding:calc(var(--ck-spacing-standard)*3)}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__icon{background-position:50%;background-size:cover;height:var(--ck-media-embed-placeholder-icon-size);margin-bottom:var(--ck-spacing-large);min-width:var(--ck-media-embed-placeholder-icon-size)}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__icon .ck-icon{height:100%;width:100%}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url__text{color:var(--ck-color-media-embed-placeholder-url-text);font-style:italic;text-align:center;text-overflow:ellipsis;white-space:nowrap}.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-height:380px;max-width:300px}.ck-media__wrapper[data-oembed-url*="goo.gl/maps"] .ck-media__placeholder__icon,.ck-media__wrapper[data-oembed-url*="google.com/maps"] .ck-media__placeholder__icon,.ck-media__wrapper[data-oembed-url*="maps.app.goo.gl"] .ck-media__placeholder__icon,.ck-media__wrapper[data-oembed-url*="maps.google.com"] .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNTAuMzc4IiBoZWlnaHQ9IjI1NC4xNjciIHZpZXdCb3g9IjAgMCA2Ni4yNDYgNjcuMjQ4Ij48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTcyLjUzMSAtMjE4LjQ1NSlzY2FsZSguOTgwMTIpIj48cmVjdCB3aWR0aD0iNjAuMDk5IiBoZWlnaHQ9IjYwLjA5OSIgeD0iMTc2LjAzMSIgeT0iMjMxLjM5OSIgZmlsbD0iIzM0YTY2OCIgcGFpbnQtb3JkZXI9Im1hcmtlcnMgc3Ryb2tlIGZpbGwiIHJ4PSI1LjIzOCIgcnk9IjUuMjM4Ii8+PHBhdGggZmlsbD0iIzVjODhjNSIgZD0ibTIwNi40NzcgMjYwLjktMjguOTg3IDI4Ljk4N2E1LjIyIDUuMjIgMCAwIDAgMy43OCAxLjYxaDQ5LjYyMWMxLjY5NCAwIDMuMTktLjc5OCA0LjE0Ni0yLjAzN3oiLz48cGF0aCBmaWxsPSIjZGQ0YjNlIiBkPSJNMjI2Ljc0MiAyMjIuOTg4Yy05LjI2NiAwLTE2Ljc3NyA3LjE3LTE2Ljc3NyAxNi4wMTQuMDA3IDIuNzYyLjY2MyA1LjQ3NCAyLjA5MyA3Ljg3NS40My43MDMuODMgMS40MDggMS4xOSAyLjEwN3EuNS43NTMuOTUgMS41MDguNTE1LjcxNS45ODggMS40NGMxLjMxIDEuNzY5IDIuNSAzLjUwMiAzLjYzNyA1LjE2OC43OTMgMS4yNzUgMS42ODMgMi42NCAyLjQ2NiAzLjk5IDIuMzYzIDQuMDk0IDQuMDA3IDguMDkyIDQuNiAxMy45MTR2LjAxMmMuMTgyLjQxMi41MTYuNjY2Ljg3OS42NjcuNDAzLS4wMDEuNzY4LS4zMTQuOTMtLjc5OS42MDMtNS43NTYgMi4yMzgtOS43MjkgNC41ODUtMTMuNzk0Ljc4Mi0xLjM1IDEuNjczLTIuNzE1IDIuNDY1LTMuOTkgMS4xMzctMS42NjYgMi4zMjgtMy40IDMuNjM4LTUuMTY5cS40NzMtLjcyMy45ODgtMS40MzkuNDUtLjc1NS45NS0xLjUwOGMuMzU5LS43Ljc2LTEuNDA0IDEuMTktMi4xMDcgMS40MjYtMi40MDIgMi01LjExNCAyLjAwNC03Ljg3NSAwLTguODQ0LTcuNTExLTE2LjAxNC0xNi43NzYtMTYuMDE0IiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjxlbGxpcHNlIGN4PSIyMjYuNzQyIiBjeT0iMjM5LjAwMiIgZmlsbD0iIzgwMmQyNyIgcGFpbnQtb3JkZXI9Im1hcmtlcnMgc3Ryb2tlIGZpbGwiIHJ4PSI1LjgyOCIgcnk9IjUuNTY0Ii8+PHBhdGggZmlsbD0iI2ZmZiIgZD0iTTE5MC4zMDEgMjM3LjI4M2MtNC42NyAwLTguNDU3IDMuODUzLTguNDU3IDguNjA2czMuNzg2IDguNjA3IDguNDU3IDguNjA3YzMuMDQzIDAgNC44MDYtLjk1OCA2LjMzNy0yLjUxNiAxLjUzLTEuNTU3IDIuMDg3LTMuOTEzIDIuMDg3LTYuMjlxLS4wMDEtLjU0My0uMDY0LTEuMDc5aC04LjI1N3YzLjA0M2g0Ljg1Yy0uMTk3Ljc1OS0uNTMxIDEuNDUtMS4wNTggMS45ODYtLjk0Mi45NTgtMi4wMjggMS41NDgtMy45MDEgMS41NDgtMi44NzYgMC01LjIwOC0yLjM3Mi01LjIwOC01LjI5OSAwLTIuOTI2IDIuMzMyLTUuMjk5IDUuMjA4LTUuMjk5IDEuMzk5IDAgMi42MTguNDA3IDMuNTg0IDEuMjkzbDIuMzgxLTIuMzhxLS4wMDEtLjAwMy0uMDA0LS4wMDVjLTEuNTg4LTEuNTI0LTMuNjItMi4yMTUtNS45NTUtMi4yMTVtNC40MyA1LjY2LjAwMy4wMDZ2LS4wMDN6IiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjxwYXRoIGZpbGw9IiNjM2MzYzMiIGQ9Im0yMTUuMTg0IDI1MS45MjktNy45OCA3Ljk3OSAyOC40NzcgMjguNDc1YTUuMiA1LjIgMCAwIDAgLjQ0OS0yLjEyM3YtMzEuMTY1Yy0uNDY5LjY3NS0uOTM0IDEuMzQ5LTEuMzgyIDIuMDA1LS43OTIgMS4yNzUtMS42ODIgMi42NC0yLjQ2NSAzLjk5LTIuMzQ3IDQuMDY1LTMuOTgyIDguMDM4LTQuNTg1IDEzLjc5NC0uMTYyLjQ4NS0uNTI3Ljc5OC0uOTMuNzk5LS4zNjMtLjAwMS0uNjk3LS4yNTUtLjg3OS0uNjY3di0uMDEyYy0uNTkzLTUuODIyLTIuMjM3LTkuODItNC42LTEzLjkxNC0uNzgzLTEuMzUtMS42NzMtMi43MTUtMi40NjYtMy45OS0xLjEzNy0xLjY2Ni0yLjMyNy0zLjQtMy42MzctNS4xNjl6Ii8+PHBhdGggZmlsbD0iI2ZkZGM0ZiIgZD0ibTIxMi45ODMgMjQ4LjQ5NS0zNi45NTIgMzYuOTUzdi44MTJhNS4yMjcgNS4yMjcgMCAwIDAgNS4yMzggNS4yMzhoMS4wMTVsMzUuNjY2LTM1LjY2NmExMzYgMTM2IDAgMCAwLTIuNzY0LTMuOSAzOCAzOCAwIDAgMC0uOTg5LTEuNDQgMzUgMzUgMCAwIDAtLjk1LTEuNTA4Yy0uMDgzLS4xNjItLjE3Ni0uMzI2LS4yNjQtLjQ4OSIgcGFpbnQtb3JkZXI9Im1hcmtlcnMgc3Ryb2tlIGZpbGwiLz48cGF0aCBmaWxsPSIjZmZmIiBkPSJtMjExLjk5OCAyNjEuMDgzLTYuMTUyIDYuMTUxIDI0LjI2NCAyNC4yNjRoLjc4MWE1LjIyNyA1LjIyNyAwIDAgMCA1LjIzOS01LjIzOHYtMS4wNDV6IiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjwvZz48L3N2Zz4=)}.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,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDI0IiBoZWlnaHQ9IjEwMjQiPjxwYXRoIGZpbGw9IiNGRkZGRkUiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTk2Ny40ODQgMEg1Ni41MTdDMjUuMzA0IDAgMCAyNS4zMDQgMCA1Ni41MTd2OTEwLjk2NkMwIDk5OC42OTQgMjUuMjk3IDEwMjQgNTYuNTIyIDEwMjRINTQ3VjYyOEg0MTRWNDczaDEzM1YzNTkuMDI5YzAtMTMyLjI2MiA4MC43NzMtMjA0LjI4MiAxOTguNzU2LTIwNC4yODIgNTYuNTEzIDAgMTA1LjA4NiA0LjIwOCAxMTkuMjQ0IDYuMDg5VjI5OWwtODEuNjE2LjAzN2MtNjMuOTkzIDAtNzYuMzg0IDMwLjQ5Mi03Ni4zODQgNzUuMjM2VjQ3M2gxNTMuNDg3bC0xOS45ODYgMTU1SDcwN3YzOTZoMjYwLjQ4NGMzMS4yMTMgMCA1Ni41MTYtMjUuMzAzIDU2LjUxNi01Ni41MTZWNTYuNTE1QzEwMjQgMjUuMzAzIDk5OC42OTcgMCA5NjcuNDg0IDAiLz48L3N2Zz4=)}.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,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iNTA0IiBoZWlnaHQ9IjUwNCI+PGRlZnM+PHBhdGggaWQ9ImEiIGQ9Ik0wIC4xNTloNTAzLjg0MVY1MDMuOTRIMHoiLz48L2RlZnM+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48bWFzayBpZD0iYiIgZmlsbD0iI2ZmZiI+PHVzZSB4bGluazpocmVmPSIjYSIvPjwvbWFzaz48cGF0aCBmaWxsPSIjRkZGIiBkPSJNMjUxLjkyMS4xNTljLTY4LjQxOCAwLTc2Ljk5Ny4yOS0xMDMuODY3IDEuNTE2LTI2LjgxNCAxLjIyMy00NS4xMjcgNS40ODItNjEuMTUxIDExLjcxLTE2LjU2NiA2LjQzNy0zMC42MTUgMTUuMDUxLTQ0LjYyMSAyOS4wNTYtMTQuMDA1IDE0LjAwNi0yMi42MTkgMjguMDU1LTI5LjA1NiA0NC42MjEtNi4yMjggMTYuMDI0LTEwLjQ4NyAzNC4zMzctMTEuNzEgNjEuMTUxQy4yOSAxNzUuMDgzIDAgMTgzLjY2MiAwIDI1Mi4wOGMwIDY4LjQxNy4yOSA3Ni45OTYgMS41MTYgMTAzLjg2NiAxLjIyMyAyNi44MTQgNS40ODIgNDUuMTI3IDExLjcxIDYxLjE1MSA2LjQzNyAxNi41NjYgMTUuMDUxIDMwLjYxNSAyOS4wNTYgNDQuNjIxIDE0LjAwNiAxNC4wMDUgMjguMDU1IDIyLjYxOSA0NC42MjEgMjkuMDU3IDE2LjAyNCA2LjIyNyAzNC4zMzcgMTAuNDg2IDYxLjE1MSAxMS43MDkgMjYuODcgMS4yMjYgMzUuNDQ5IDEuNTE2IDEwMy44NjcgMS41MTYgNjguNDE3IDAgNzYuOTk2LS4yOSAxMDMuODY2LTEuNTE2IDI2LjgxNC0xLjIyMyA0NS4xMjctNS40ODIgNjEuMTUxLTExLjcwOSAxNi41NjYtNi40MzggMzAuNjE1LTE1LjA1MiA0NC42MjEtMjkuMDU3IDE0LjAwNS0xNC4wMDYgMjIuNjE5LTI4LjA1NSAyOS4wNTctNDQuNjIxIDYuMjI3LTE2LjAyNCAxMC40ODYtMzQuMzM3IDExLjcwOS02MS4xNTEgMS4yMjYtMjYuODcgMS41MTYtMzUuNDQ5IDEuNTE2LTEwMy44NjYgMC02OC40MTgtLjI5LTc2Ljk5Ny0xLjUxNi0xMDMuODY3LTEuMjIzLTI2LjgxNC01LjQ4Mi00NS4xMjctMTEuNzA5LTYxLjE1MS02LjQzOC0xNi41NjYtMTUuMDUyLTMwLjYxNS0yOS4wNTctNDQuNjIxLTE0LjAwNi0xNC4wMDUtMjguMDU1LTIyLjYxOS00NC42MjEtMjkuMDU2LTE2LjAyNC02LjIyOC0zNC4zMzctMTAuNDg3LTYxLjE1MS0xMS43MUMzMjguOTE3LjQ0OSAzMjAuMzM4LjE1OSAyNTEuOTIxLjE1OW0wIDQ1LjM5MWM2Ny4yNjUgMCA3NS4yMzMuMjU3IDEwMS43OTcgMS40NjkgMjQuNTYyIDEuMTIgMzcuOTAxIDUuMjI0IDQ2Ljc3OCA4LjY3NCAxMS43NTkgNC41NyAyMC4xNTEgMTAuMDI5IDI4Ljk2NiAxOC44NDVzMTQuMjc1IDE3LjIwNyAxOC44NDUgMjguOTY2YzMuNDUgOC44NzcgNy41NTQgMjIuMjE2IDguNjc0IDQ2Ljc3OCAxLjIxMiAyNi41NjQgMS40NjkgMzQuNTMyIDEuNDY5IDEwMS43OTggMCA2Ny4yNjUtLjI1NyA3NS4yMzMtMS40NjkgMTAxLjc5Ny0xLjEyIDI0LjU2Mi01LjIyNCAzNy45MDEtOC42NzQgNDYuNzc4LTQuNTcgMTEuNzU5LTEwLjAyOSAyMC4xNTEtMTguODQ1IDI4Ljk2NnMtMTcuMjA3IDE0LjI3NS0yOC45NjYgMTguODQ1Yy04Ljg3NyAzLjQ1LTIyLjIxNiA3LjU1NC00Ni43NzggOC42NzQtMjYuNTYgMS4yMTItMzQuNTI3IDEuNDY5LTEwMS43OTcgMS40NjktNjcuMjcxIDAtNzUuMjM3LS4yNTctMTAxLjc5OC0xLjQ2OS0yNC41NjItMS4xMi0zNy45MDEtNS4yMjQtNDYuNzc4LTguNjc0LTExLjc1OS00LjU3LTIwLjE1MS0xMC4wMjktMjguOTY2LTE4Ljg0NXMtMTQuMjc1LTE3LjIwNy0xOC44NDUtMjguOTY2Yy0zLjQ1LTguODc3LTcuNTU0LTIyLjIxNi04LjY3NC00Ni43NzgtMS4yMTItMjYuNTY0LTEuNDY5LTM0LjUzMi0xLjQ2OS0xMDEuNzk3IDAtNjcuMjY2LjI1Ny03NS4yMzQgMS40NjktMTAxLjc5OCAxLjEyLTI0LjU2MiA1LjIyNC0zNy45MDEgOC42NzQtNDYuNzc4IDQuNTctMTEuNzU5IDEwLjAyOS0yMC4xNTEgMTguODQ1LTI4Ljk2NnMxNy4yMDctMTQuMjc1IDI4Ljk2Ni0xOC44NDVjOC44NzctMy40NSAyMi4yMTYtNy41NTQgNDYuNzc4LTguNjc0IDI2LjU2NC0xLjIxMiAzNC41MzItMS40NjkgMTAxLjc5OC0xLjQ2OSIgbWFzaz0idXJsKCNiKSIvPjxwYXRoIGZpbGw9IiNGRkYiIGQ9Ik0yNTEuOTIxIDMzNi4wNTNjLTQ2LjM3OCAwLTgzLjk3NC0zNy41OTYtODMuOTc0LTgzLjk3M3MzNy41OTYtODMuOTc0IDgzLjk3NC04My45NzRjNDYuMzc3IDAgODMuOTczIDM3LjU5NiA4My45NzMgODMuOTc0IDAgNDYuMzc3LTM3LjU5NiA4My45NzMtODMuOTczIDgzLjk3M20wLTIxMy4zMzhjLTcxLjQ0NyAwLTEyOS4zNjUgNTcuOTE4LTEyOS4zNjUgMTI5LjM2NSAwIDcxLjQ0NiA1Ny45MTggMTI5LjM2NCAxMjkuMzY1IDEyOS4zNjQgNzEuNDQ2IDAgMTI5LjM2NC01Ny45MTggMTI5LjM2NC0xMjkuMzY0IDAtNzEuNDQ3LTU3LjkxOC0xMjkuMzY1LTEyOS4zNjQtMTI5LjM2NU00MTYuNjI3IDExNy42MDRjMCAxNi42OTYtMTMuNTM1IDMwLjIzLTMwLjIzMSAzMC4yMy0xNi42OTUgMC0zMC4yMy0xMy41MzQtMzAuMjMtMzAuMjNzMTMuNTM1LTMwLjIzMSAzMC4yMy0zMC4yMzFjMTYuNjk2IDAgMzAuMjMxIDEzLjUzNSAzMC4yMzEgMzAuMjMxIi8+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,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbDpzcGFjZT0icHJlc2VydmUiIHZpZXdCb3g9IjAgMCA0MDAgNDAwIj48cGF0aCBkPSJNNDAwIDIwMGMwIDExMC41LTg5LjUgMjAwLTIwMCAyMDBTMCAzMTAuNSAwIDIwMCA4OS41IDAgMjAwIDBzMjAwIDg5LjUgMjAwIDIwME0xNjMuNCAzMDUuNWM4OC43IDAgMTM3LjItNzMuNSAxMzcuMi0xMzcuMiAwLTIuMSAwLTQuMi0uMS02LjIgOS40LTYuOCAxNy42LTE1LjMgMjQuMS0yNS04LjYgMy44LTE3LjkgNi40LTI3LjcgNy42IDEwLTYgMTcuNi0xNS40IDIxLjItMjYuNy05LjMgNS41LTE5LjYgOS41LTMwLjYgMTEuNy04LjgtOS40LTIxLjMtMTUuMi0zNS4yLTE1LjItMjYuNiAwLTQ4LjIgMjEuNi00OC4yIDQ4LjIgMCAzLjguNCA3LjUgMS4zIDExLTQwLjEtMi03NS42LTIxLjItOTkuNC01MC40LTQuMSA3LjEtNi41IDE1LjQtNi41IDI0LjIgMCAxNi43IDguNSAzMS41IDIxLjUgNDAuMS03LjktLjItMTUuMy0yLjQtMjEuOC02di42YzAgMjMuNCAxNi42IDQyLjggMzguNyA0Ny4zLTQgMS4xLTguMyAxLjctMTIuNyAxLjctMy4xIDAtNi4xLS4zLTkuMS0uOSA2LjEgMTkuMiAyMy45IDMzLjEgNDUgMzMuNS0xNi41IDEyLjktMzcuMyAyMC42LTU5LjkgMjAuNi0zLjkgMC03LjctLjItMTEuNS0uNyAyMS4xIDEzLjggNDYuNSAyMS44IDczLjcgMjEuOCIgc3R5bGU9ImZpbGw6I2ZmZiIvPjwvc3ZnPg==)}.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}',""]);const r=o},6004(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,".ck.ck-media-form{align-items:flex-start;display:flex;flex-direction:row;flex-wrap:nowrap;width:400px}.ck.ck-media-form .ck-labeled-field-view{display:inline-block;width:100%}.ck.ck-media-form .ck-label{display:none}.ck.ck-media-form .ck-input{width:100%}@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%}}",""]);const r=o},6012(e,t){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.getSymbols=function(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}},6048(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,".ck.ck-list{display:flex;flex-direction:column;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.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{background:var(--ck-color-list-background);border-radius:0;list-style-type:none;padding:var(--ck-spacing-small) 0;&.ck-rounded-corners,.ck-rounded-corners &{border-radius:var(--ck-border-radius)}}.ck.ck-list__item{cursor:default;min-width:15em}.ck.ck-list__item>.ck-button:not(.ck-list-item-button){border-radius:0;min-height:unset;padding:var(--ck-spacing-tiny) calc(var(--ck-spacing-standard)*2);width:100%;[dir=ltr] &{text-align:left}[dir=rtl] &{text-align:right}}.ck.ck-list__item>.ck-button:not(.ck-list-item-button) .ck-button__label{line-height:calc(var(--ck-line-height-base)*var(--ck-font-size-base))}.ck.ck-list__item>.ck-button:not(.ck-list-item-button):active{box-shadow:none}.ck.ck-list__item>.ck-button.ck-on:not(.ck-list-item-button){background:var(--ck-color-list-button-on-background);color:var(--ck-color-list-button-on-text)}.ck.ck-list__item>.ck-button.ck-on:not(.ck-list-item-button):active{box-shadow:none}.ck.ck-list__item>.ck-button.ck-on:not(.ck-list-item-button):hover:not(.ck-disabled){background:var(--ck-color-list-button-on-background-focus)}.ck.ck-list__item>.ck-button.ck-on:not(.ck-list-item-button):focus:not(.ck-disabled){border-color:var(--ck-color-base-background)}.ck.ck-list__item>.ck-button:not(.ck-list-item-button):hover:not(.ck-disabled){background:var(--ck-color-list-button-hover-background)}.ck.ck-list__item>.ck-button.ck-switchbutton.ck-on{background:var(--ck-color-list-background);color:inherit}.ck.ck-list__item>.ck-button.ck-switchbutton.ck-on:hover:not(.ck-disabled){background:var(--ck-color-list-button-hover-background);color:inherit}.ck-list .ck-list__group{padding-top:var(--ck-spacing-medium)}.ck-list .ck-list__group:first-child{padding-top:0}.ck-list .ck-list__group{:not(.ck-hidden)~&{border-top:1px solid var(--ck-color-base-border)}}.ck-list .ck-list__group>.ck-label{font-size:11px;font-weight:700;padding:var(--ck-spacing-medium) var(--ck-spacing-large) 0}.ck.ck-list__separator{background:var(--ck-color-base-border);height:1px;margin:var(--ck-spacing-small) 0;width:100%}",""]);const r=o},6154(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,":root{--ck-content-font-family:Helvetica,Arial,Tahoma,Verdana,Sans-Serif;--ck-content-font-size:medium;--ck-content-font-color:#000;--ck-content-line-height:1.5;--ck-content-word-break:break-word}.ck-content{color:var(--ck-content-font-color);font-family:var(--ck-content-font-family);font-size:var(--ck-content-font-size);line-height:var(--ck-content-line-height);word-break:var(--ck-content-word-break)}",""]);const r=o},6186(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,".ck.ck-heading_heading1 .ck-button__label{font-size:20px}.ck.ck-heading_heading2 .ck-button__label{font-size:17px}.ck.ck-heading_heading3 .ck-button__label{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}",""]);const r=o},6314(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var i=e(t);return t[2]?"@media ".concat(t[2]," {").concat(i,"}"):i}).join("")},t.i=function(e,i,n){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(n)for(var r=0;r<this.length;r++){var s=this[r][0];null!=s&&(o[s]=!0)}for(var a=0;a<e.length;a++){var l=[].concat(e[a]);n&&o[l[0]]||(i&&(l[2]?l[2]="".concat(i," and ").concat(l[2]):l[2]=i),t.push(l))}},t}},6365(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,".ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper{display:flex;position:relative}.ck.ck-labeled-field-view .ck.ck-label{display:block;position:absolute}:root{--ck-labeled-field-view-transition:.1s cubic-bezier(0,0,0.24,0.95);--ck-labeled-field-empty-unfocused-max-width:100% - 2 * var(--ck-spacing-medium);--ck-labeled-field-label-default-position-x:var(--ck-spacing-medium);--ck-labeled-field-label-default-position-y:calc(var(--ck-font-size-base)*0.6);--ck-color-labeled-field-label-background:var(--ck-color-base-background)}.ck.ck-labeled-field-view{border-radius:0;&.ck-rounded-corners,.ck-rounded-corners &{border-radius:var(--ck-border-radius)}}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper{width:100%}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{background:var(--ck-color-labeled-field-label-background);font-weight:400;line-height:normal;max-width:100%;overflow:hidden;padding:0 calc(var(--ck-font-size-tiny)*.5);pointer-events:none;text-overflow:ellipsis;top:0;transition:transform var(--ck-labeled-field-view-transition),padding var(--ck-labeled-field-view-transition),background var(--ck-labeled-field-view-transition);[dir=ltr] &{left:0;transform:translate(var(--ck-spacing-medium),-6px) scale(.75);transform-origin:0 0}[dir=rtl] &{right:0;transform:translate(calc(var(--ck-spacing-medium)*-1),-6px) scale(.75);transform-origin:100% 0}}@media (prefers-reduced-motion:reduce){.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transition:none}}.ck.ck-labeled-field-view.ck-error .ck-input:not([readonly])+.ck.ck-label,.ck.ck-labeled-field-view.ck-error>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{color:var(--ck-color-base-error)}.ck.ck-labeled-field-view .ck-labeled-field-view__status{font-size:var(--ck-font-size-small);margin-top:var(--ck-spacing-small);white-space:normal}.ck.ck-labeled-field-view .ck-labeled-field-view__status.ck-labeled-field-view__status_error{color:var(--ck-color-base-error)}.ck.ck-labeled-field-view.ck-disabled>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{color:var(--ck-color-input-disabled-text)}.ck.ck-labeled-field-view.ck-disabled.ck-labeled-field-view_empty:not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder):not(.ck-error)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{background:transparent;max-width:calc(var(--ck-labeled-field-empty-unfocused-max-width));padding:0;[dir=ltr] &{transform:translate(var(--ck-labeled-field-label-default-position-x),var(--ck-labeled-field-label-default-position-y)) scale(1)}[dir=rtl] &{transform:translate(calc(var(--ck-labeled-field-label-default-position-x)*-1),var(--ck-labeled-field-label-default-position-y)) scale(1)}}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown>.ck.ck-button{background:transparent}.ck.ck-labeled-field-view.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown>.ck-button>.ck-button__label{opacity:0}.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown+.ck-label{max-width:calc(var(--ck-labeled-field-empty-unfocused-max-width) - var(--ck-dropdown-arrow-size) - var(--ck-spacing-standard))}.ck.ck-labeled-field-view.ck-labeled-field-view_full-width{flex-grow:1}",""]);const r=o},6502(e,t){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.noop=function(){}},6531(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,".ck.ck-editor__editable span[data-ck-unsafe-element]{display:none}",""]);const r=o},6761(e,t){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.eq=function(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}},6779(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,'.ck .ck-widget .ck-widget__type-around__button{display:block;overflow:hidden;position:absolute;z-index:var(--ck-z-default)}.ck .ck-widget .ck-widget__type-around__button svg{left:50%;position:absolute;top:50%;z-index:calc(var(--ck-z-default) + 2)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_before{left:min(10%,30px);top:calc(var(--ck-widget-outline-thickness)*-.5);transform:translateY(-50%)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_after{bottom:calc(var(--ck-widget-outline-thickness)*-.5);right:min(10%,30px);transform:translateY(50%)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:after,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover:after{content:"";display:block;left:1px;position:absolute;top:1px;z-index:calc(var(--ck-z-default) + 1)}.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__fake-caret{display:none;left:0;position:absolute;right:0}.ck .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__fake-caret{left:calc(var(--ck-widget-outline-thickness)*-1);right:calc(var(--ck-widget-outline-thickness)*-1)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__fake-caret{display:block;top:calc(var(--ck-widget-outline-thickness)*-1 - 1px)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after>.ck-widget__type-around>.ck-widget__type-around__fake-caret{bottom:calc(var(--ck-widget-outline-thickness)*-1 - 1px);display:block}.ck.ck-editor__editable.ck-read-only .ck-widget__type-around,.ck.ck-editor__editable.ck-restricted-editing_mode_restricted .ck-widget__type-around,.ck.ck-editor__editable.ck-widget__type-around_disabled .ck-widget__type-around{display:none}.ck.ck-editor__editable.ck-restricted-editing_mode_restricted div.restricted-editing-exception .ck-widget__type-around{display:initial}: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{background:var(--ck-color-widget-type-around-button);border-radius:100px;height:var(--ck-widget-type-around-button-size);opacity:0;pointer-events:none;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);width:var(--ck-widget-type-around-button-size)}@media (prefers-reduced-motion:reduce){.ck .ck-widget .ck-widget__type-around__button{transition:none}}.ck .ck-widget .ck-widget__type-around__button svg{height:8px;margin-top:1px;transform:translate(-50%,-50%);transition:transform .5s ease;width:10px}@media (prefers-reduced-motion:reduce){.ck .ck-widget .ck-widget__type-around__button svg{transition:none}}.ck .ck-widget .ck-widget__type-around__button svg *{fill:none;stroke:var(--ck-color-widget-type-around-button-icon);stroke-dasharray:10;stroke-dashoffset:0;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.5px}.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}@media (prefers-reduced-motion:reduce){.ck .ck-widget .ck-widget__type-around__button:hover,.ck .ck-widget .ck-widget__type-around__button:hover svg line,.ck .ck-widget .ck-widget__type-around__button:hover svg polyline{animation:none}}.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{background:linear-gradient(135deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3));border-radius:100px;height:calc(var(--ck-widget-type-around-button-size) - 2px);width:calc(var(--ck-widget-type-around-button-size) - 2px)}.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_selected>.ck-widget__type-around>.ck-widget__type-around__button{opacity:1;pointer-events:auto}.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{animation:ck-widget-type-around-fake-caret-pulse 1s linear infinite normal forwards;background:var(--ck-color-base-text);height:1px;outline:1px solid hsla(0,0%,100%,.5);pointer-events:none}.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_selected.ck-widget_with-resizer>.ck-widget__resizer,.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_selected.ck-widget_with-resizer>.ck-widget__resizer,.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[dir=rtl] .ck-widget.ck-widget_with-selection-handle .ck-widget__type-around>.ck-widget__type-around__button_before{margin-left:0;margin-right:20px}.ck-editor__nested-editable.ck-editor__editable_selected .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck-editor__nested-editable.ck-editor__editable_selected .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__button{opacity:0;pointer-events:none}.ck .ck-widget:has(.ck-widget.table: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}}',""]);const r=o},7074(e,t){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.isPlainObject=function(e){if(!e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t))&&"[object Object]"===Object.prototype.toString.call(e)}},7133(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,'.ck.ck-splitbutton{font-size:inherit}.ck.ck-splitbutton .ck-splitbutton__action:focus{z-index:calc(var(--ck-z-default) + 1)}:root{--ck-color-split-button-hover-background:#ebebeb;--ck-color-split-button-hover-border:#b3b3b3}.ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__action,.ck.ck-splitbutton:hover>.ck-splitbutton__action{[dir=ltr] &{border-bottom-right-radius:unset;border-top-right-radius:unset}[dir=rtl] &{border-bottom-left-radius:unset;border-top-left-radius:unset}}.ck.ck-splitbutton>.ck-splitbutton__arrow{min-width:unset;[dir=ltr] &{border-bottom-left-radius:unset;border-top-left-radius:unset}[dir=rtl] &{border-bottom-right-radius:unset;border-top-right-radius:unset}}.ck.ck-splitbutton>.ck-splitbutton__arrow svg{width:var(--ck-dropdown-arrow-size)}.ck.ck-splitbutton>.ck-splitbutton__arrow:not(:focus){border-bottom-width:0;border-top-width:0}.ck.ck-splitbutton.ck-splitbutton_open{border-radius:0;&.ck-rounded-corners,.ck-rounded-corners &{border-radius:var(--ck-border-radius)}&.ck-rounded-corners>.ck-splitbutton__action,.ck-rounded-corners &>.ck-splitbutton__action{border-bottom-left-radius:0}&.ck-rounded-corners>.ck-splitbutton__arrow,.ck-rounded-corners &>.ck-splitbutton__arrow{border-bottom-right-radius:0}}.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)}.ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,.ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled):after{background-color:var(--ck-color-split-button-hover-border);content:"";height:100%;position:absolute;width:1px}.ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:focus:after,.ck.ck-splitbutton:hover>.ck-splitbutton__arrow:focus:after{--ck-color-split-button-hover-border:var(--ck-color-focus-border)}.ck.ck-splitbutton.ck-splitbutton_open,.ck.ck-splitbutton:hover{[dir=ltr] &>.ck-splitbutton__arrow:not(.ck-disabled):after{left:-1px}[dir=rtl] &>.ck-splitbutton__arrow:not(.ck-disabled):after{right:-1px}}',""]);const r=o},7229(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,":root{--ck-content-list-marker-color:var(--ck-content-font-color);--ck-content-list-marker-font-family:var(--ck-content-font-family);--ck-content-list-marker-font-size:var(--ck-content-font-size)}.ck-content li>p:first-of-type{margin-top:0}.ck-content li>p:only-of-type{margin-bottom:0;margin-top:0}.ck-content li.ck-list-marker-bold::marker{font-weight:700}.ck-content li.ck-list-marker-italic::marker{font-style:italic}.ck-content li.ck-list-marker-color::marker{color:var(--ck-content-list-marker-color)}.ck-content li.ck-list-marker-font-family::marker{font-family:var(--ck-content-list-marker-font-family)}.ck-content li.ck-list-marker-font-size::marker{font-size:var(--ck-content-list-marker-font-size)}.ck-content li.ck-list-marker-font-size-tiny::marker{font-size:var(--ck-content-font-size-tiny)}.ck-content li.ck-list-marker-font-size-small::marker{font-size:var(--ck-content-font-size-small)}.ck-content li.ck-list-marker-font-size-big::marker{font-size:var(--ck-content-font-size-big)}.ck-content li.ck-list-marker-font-size-huge::marker{font-size:var(--ck-content-font-size-huge)}",""]);const r=o},7289(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,".ck.ck-sticky-panel .ck-sticky-panel__content_sticky{position:fixed;top:0;z-index:var(--ck-z-panel)}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky_bottom-limit{position:absolute;top:auto}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky{border-top-left-radius:0;border-top-right-radius:0;border-width:0 1px 1px;box-shadow:var(--ck-drop-shadow),0 0}",""]);const r=o},7456(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,".ck .ck-link_selected{background:var(--ck-color-link-selected-background)}.ck .ck-link_selected span.image-inline{outline:var(--ck-widget-outline-thickness) solid var(--ck-color-link-selected-background)}.ck .ck-fake-link-selection{background:var(--ck-color-link-fake-selection)}.ck .ck-fake-link-selection_collapsed{border-right:1px solid var(--ck-color-base-text);height:100%;margin-right:-1px;outline:1px solid hsla(0,0%,100%,.5)}",""]);const r=o},7475(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,":root{--ck-toolbar-dropdown-max-width:60vw}.ck.ck-toolbar-dropdown>.ck-dropdown__panel{max-width:var(--ck-toolbar-dropdown-max-width);width:max-content}.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}",""]);const r=o},7504(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,".ck.ck-editor__editable .image,.ck.ck-editor__editable .image-inline{position:relative}.ck.ck-editor__editable .image .ck-progress-bar,.ck.ck-editor__editable .image-inline .ck-progress-bar{left:0;position:absolute;top:0}.ck.ck-editor__editable .image-inline.ck-appear,.ck.ck-editor__editable .image.ck-appear{animation:fadeIn .7s}@media (prefers-reduced-motion:reduce){.ck.ck-editor__editable .image-inline.ck-appear,.ck.ck-editor__editable .image.ck-appear{animation:none;opacity:1}}.ck.ck-editor__editable .image .ck-progress-bar,.ck.ck-editor__editable .image-inline .ck-progress-bar{background:var(--ck-color-upload-bar-background);height:2px;transition:width .1s;width:0}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}",""]);const r=o},7541(e,t,i){e.exports=i(9341).isEqual},7659(e){"use strict";var t={};e.exports=function(e,i){var n=function(e){if(void 0===t[e]){var i=document.querySelector(e);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(e){i=null}t[e]=i}return t[e]}(e);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");n.appendChild(i)}},7875(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,".ck-editor__editable .ck-list-bogus-paragraph{display:block}",""]);const r=o},7879(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,":root{--ck-content-image-style-spacing:1.5em;--ck-content-inline-image-style-spacing:calc(var(--ck-content-image-style-spacing)/2)}.ck-content .image.image-style-block-align-left,.ck-content .image.image-style-block-align-right{max-width:calc(100% - var(--ck-content-image-style-spacing))}.ck-content .image.image-style-align-left,.ck-content .image.image-style-align-right{clear:none}.ck-content .image.image-style-side{float:right;margin-left:var(--ck-content-image-style-spacing);max-width:50%}.ck-content .image.image-style-align-left{float:left;margin-right:var(--ck-content-image-style-spacing)}.ck-content .image.image-style-align-right{float:right;margin-left:var(--ck-content-image-style-spacing)}.ck-content .image.image-style-block-align-right{margin-left:auto;margin-right:0}.ck-content .image.image-style-block-align-left{margin-left:0;margin-right:auto}.ck-content .image-style-align-center{margin-left:auto;margin-right:auto}.ck-content .image-style-align-left{float:left;margin-right:var(--ck-content-image-style-spacing)}.ck-content .image-style-align-right{float:right;margin-left:var(--ck-content-image-style-spacing)}.ck-content p+.image.image-style-align-left,.ck-content p+.image.image-style-align-right,.ck-content p+.image.image-style-side{margin-top:0}.ck-content .image-inline.image-style-align-left,.ck-content .image-inline.image-style-align-right{margin-bottom:var(--ck-content-inline-image-style-spacing);margin-top:var(--ck-content-inline-image-style-spacing)}.ck-content .image-inline.image-style-align-left{margin-right:var(--ck-content-inline-image-style-spacing)}.ck-content .image-inline.image-style-align-right{margin-left:var(--ck-content-inline-image-style-spacing)}.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__action:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover),.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__action:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover){background-color:var(--ck-color-button-on-background)}.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__action:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover):after,.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__action:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover):after{display:none}.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open:hover>.ck-splitbutton__action:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open:hover>.ck-splitbutton__arrow:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open:hover>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover){background-color:var(--ck-color-button-on-hover-background)}",""]);const r=o},7962(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,".ck.ck-color-grid{display:grid}:root{--ck-color-grid-tile-size:24px;--ck-color-color-grid-check-icon:#166fd4}.ck.ck-color-grid{grid-gap:5px;padding:8px}.ck.ck-color-grid__tile{transition:box-shadow .2s ease}@media (forced-colors:none){.ck.ck-color-grid__tile{border:0;height:var(--ck-color-grid-tile-size);min-height:var(--ck-color-grid-tile-size);min-width:var(--ck-color-grid-tile-size);padding:0;width:var(--ck-color-grid-tile-size)}.ck.ck-color-grid__tile.ck-on,.ck.ck-color-grid__tile:focus:not(.ck-disabled),.ck.ck-color-grid__tile:hover:not(.ck-disabled){border:0}.ck.ck-color-grid__tile.ck-color-selector__color-tile_bordered{box-shadow:0 0 0 1px var(--ck-color-base-border)}.ck.ck-color-grid__tile.ck-on{box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-base-text)}.ck.ck-color-grid__tile:focus:not(.ck-disabled),.ck.ck-color-grid__tile:hover:not(.ck-disabled){box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-focus-border)}}@media (forced-colors:active){.ck.ck-color-grid__tile{height:unset;min-height:unset;min-width:unset;padding:0 var(--ck-spacing-small);width:unset}.ck.ck-color-grid__tile .ck-button__label{display:inline-block}}@media (prefers-reduced-motion:reduce){.ck.ck-color-grid__tile{transition:none}}.ck.ck-color-grid__tile.ck-disabled{cursor:unset;transition:unset}.ck.ck-color-grid__tile .ck.ck-icon{color:var(--ck-color-color-grid-check-icon);display:none}.ck.ck-color-grid__tile.ck-on .ck.ck-icon{display:block}.ck.ck-color-grid__label{padding:0 var(--ck-spacing-standard)}",""]);const r=o},8091(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,".ck.ck-dialog .ck.ck-dialog__actions{display:flex;justify-content:flex-end;padding:var(--ck-spacing-large)}.ck.ck-dialog .ck.ck-dialog__actions>*+*{margin-left:var(--ck-spacing-large)}",""]);const r=o},8163(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,":root{--ck-link-properties-width:340px}@media screen and (max-width:600px){:root{--ck-link-properties-width:300px}}.ck.ck-link-properties{width:var(--ck-link-properties-width)}",""]);const r=o},8429(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,":root{--ck-text-alternative-form-width:340px}@media screen and (max-width:600px){:root{--ck-text-alternative-form-width:300px}}.ck.ck-text-alternative-form.ck-responsive-form{width:var(--ck-text-alternative-form-width)}",""]);const r=o},8574(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,".ck-content .image{clear:both;display:table;margin:.9em auto;min-width:50px;text-align:center}.ck-content .image img{display:block;height:auto;margin:0 auto;max-width:100%;min-width:100%}.ck-content .image-inline{align-items:flex-start;display:inline-flex;max-width:100%}.ck-content .image-inline picture{display:flex}.ck-content .image-inline img,.ck-content .image-inline picture{flex-grow:1;flex-shrink:1;max-width:100%}.ck.ck-editor__editable .image>figcaption.ck-placeholder:before{overflow:hidden;padding-left:inherit;padding-right:inherit;text-overflow:ellipsis;white-space:nowrap}.ck.ck-editor__editable .image{z-index:1}.ck.ck-editor__editable .image.ck-widget_selected{z-index:2}.ck.ck-editor__editable .image-inline{z-index:1}.ck.ck-editor__editable .image-inline.ck-widget_selected{z-index:2}.ck.ck-editor__editable .image-inline.ck-widget_selected ::selection{display:none}.ck.ck-editor__editable .image-inline img{height:auto}.ck.ck-editor__editable td .image-inline img,.ck.ck-editor__editable th .image-inline img{max-width:none}",""]);const r=o},8603(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,".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{padding:var(--ck-insert-table-dropdown-padding) var(--ck-insert-table-dropdown-padding) 0;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)}.ck .ck-insert-table-dropdown__label,.ck[dir=rtl] .ck-insert-table-dropdown__label{text-align:center}.ck .ck-insert-table-dropdown-grid-box{border:1px solid var(--ck-color-base-border);border-radius:1px;margin:var(--ck-insert-table-dropdown-box-margin);min-height:var(--ck-insert-table-dropdown-box-height);min-width:var(--ck-insert-table-dropdown-box-width);outline:none;transition:none}@media (prefers-reduced-motion:reduce){.ck .ck-insert-table-dropdown-grid-box{transition:none}}.ck .ck-insert-table-dropdown-grid-box:focus{box-shadow:none}.ck .ck-insert-table-dropdown-grid-box.ck-on{background:var(--ck-color-focus-outer-shadow);border-color:var(--ck-color-focus-border)}",""]);const r=o},8864(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,':root{--ck-color-table-focused-cell-background:rgba(158,201,250,.3);--ck-table-content-default-border-color:#d4d4d4;--ck-table-border-none-helper-line-color:#d4d4d4;--ck-table-border-none-helper-line-style:dashed;--ck-table-border-none-helper-line-width:1px}.ck-widget.table table[style*="border-style:none"],.ck-widget.table table[style*="border:none"]{outline:var(--ck-table-content-default-border-color) 1px dashed}.ck-widget.table td.ck-editor__nested-editable,.ck-widget.table th.ck-editor__nested-editable{outline:unset}.ck-widget.table td.ck-editor__nested-editable.ck-editor__nested-editable_focused:not(.ck-editor__editable_selected),.ck-widget.table td.ck-editor__nested-editable:not(.ck-editor__editable_selected):focus,.ck-widget.table th.ck-editor__nested-editable.ck-editor__nested-editable_focused:not(.ck-editor__editable_selected),.ck-widget.table th.ck-editor__nested-editable:not(.ck-editor__editable_selected):focus{background:var(--ck-color-table-focused-cell-background);outline:1px solid var(--ck-color-focus-border);outline-offset:-1px}:where(.ck.ck-editor__editable.ck-table-show-hidden-borders .ck-widget.table) :where(td[style*="border:none"],td[style*="border-style:none"],th[style*="border:none"],th[style*="border-style:none"]){border:var(--ck-table-border-none-helper-line-style) var(--ck-table-border-none-helper-line-width) var(--ck-table-border-none-helper-line-color)!important}:where(.ck.ck-editor__editable.ck-table-show-hidden-borders .ck-widget.table) :where(td[style*="border-top-style:none"],th[style*="border-top-style:none"]),:where(.ck.ck-editor__editable.ck-table-show-hidden-borders .ck-widget.table)>:where(table[style*="border-top-style:none"]){border-top:var(--ck-table-border-none-helper-line-style) var(--ck-table-border-none-helper-line-width) var(--ck-table-border-none-helper-line-color)!important}:where(.ck.ck-editor__editable.ck-table-show-hidden-borders .ck-widget.table) :where(td[style*="border-right-style:none"],th[style*="border-right-style:none"]),:where(.ck.ck-editor__editable.ck-table-show-hidden-borders .ck-widget.table)>:where(table[style*="border-right-style:none"]){border-right:var(--ck-table-border-none-helper-line-style) var(--ck-table-border-none-helper-line-width) var(--ck-table-border-none-helper-line-color)!important}:where(.ck.ck-editor__editable.ck-table-show-hidden-borders .ck-widget.table) :where(td[style*="border-bottom-style:none"],th[style*="border-bottom-style:none"]),:where(.ck.ck-editor__editable.ck-table-show-hidden-borders .ck-widget.table)>:where(table[style*="border-bottom-style:none"]){border-bottom:var(--ck-table-border-none-helper-line-style) var(--ck-table-border-none-helper-line-width) var(--ck-table-border-none-helper-line-color)!important}:where(.ck.ck-editor__editable.ck-table-show-hidden-borders .ck-widget.table) :where(td[style*="border-left-style:none"],th[style*="border-left-style:none"]),:where(.ck.ck-editor__editable.ck-table-show-hidden-borders .ck-widget.table)>:where(table[style*="border-left-style:none"]){border-left:var(--ck-table-border-none-helper-line-style) var(--ck-table-border-none-helper-line-width) var(--ck-table-border-none-helper-line-color)!important}',""]);const r=o},8948(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,".ck.ck-button,a.ck.ck-button{align-items:center;display:inline-flex;position:relative;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;[dir=ltr] &{justify-content:left}[dir=rtl] &{justify-content:right}}.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,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)}.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{-webkit-appearance:none;border:1px solid transparent;border-radius:0;cursor:default;font-size:inherit;line-height:1;min-height:var(--ck-ui-component-min-height);min-width:var(--ck-ui-component-min-height);padding:var(--ck-spacing-tiny);text-align:center;transition:box-shadow .2s ease-in-out,border .2s ease-in-out;vertical-align:middle;white-space:nowrap;&.ck-rounded-corners,.ck-rounded-corners &{border-radius:var(--ck-border-radius)}}@media (prefers-reduced-motion:reduce){.ck.ck-button,a.ck.ck-button{transition:none}}.ck.ck-button:active,.ck.ck-button:focus,a.ck.ck-button:active,a.ck.ck-button:focus{border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0;outline:none}.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{color:inherit;cursor:inherit;font-size:inherit;font-weight:inherit;vertical-align:middle;[dir=ltr] &{text-align:left}[dir=rtl] &{text-align:right}}.ck.ck-button .ck-button__keystroke,a.ck.ck-button .ck-button__keystroke{color:inherit;opacity:.5;[dir=ltr] &{margin-left:var(--ck-spacing-large)}[dir=rtl] &{margin-right:var(--ck-spacing-large)}}.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,.ck.ck-button.ck-disabled .ck-button__label,a.ck.ck-button.ck-disabled .ck-button__icon,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)}.ck.ck-button.ck-button_with-text .ck-button__icon,a.ck.ck-button.ck-button_with-text .ck-button__icon{[dir=ltr] &{margin-right:var(--ck-spacing-medium)}[dir=rtl] &{margin-left:var(--ck-spacing-medium)}}.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)}.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-on,a.ck.ck-button.ck-on{color:var(--ck-color-button-on-color)}.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)}.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}",""]);const r=o},9184(e,t){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});t.argumentsTag="[object Arguments]",t.arrayBufferTag="[object ArrayBuffer]",t.arrayTag="[object Array]",t.bigInt64ArrayTag="[object BigInt64Array]",t.bigUint64ArrayTag="[object BigUint64Array]",t.booleanTag="[object Boolean]",t.dataViewTag="[object DataView]",t.dateTag="[object Date]",t.errorTag="[object Error]",t.float32ArrayTag="[object Float32Array]",t.float64ArrayTag="[object Float64Array]",t.functionTag="[object Function]",t.int16ArrayTag="[object Int16Array]",t.int32ArrayTag="[object Int32Array]",t.int8ArrayTag="[object Int8Array]",t.mapTag="[object Map]",t.numberTag="[object Number]",t.objectTag="[object Object]",t.regexpTag="[object RegExp]",t.setTag="[object Set]",t.stringTag="[object String]",t.symbolTag="[object Symbol]",t.uint16ArrayTag="[object Uint16Array]",t.uint32ArrayTag="[object Uint32Array]",t.uint8ArrayTag="[object Uint8Array]",t.uint8ClampedArrayTag="[object Uint8ClampedArray]"},9227(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,'.ck-source-editing-area{overflow:hidden;position:relative}.ck-source-editing-area textarea,.ck-source-editing-area:after{border:1px solid transparent;font-family:monospace;font-size:var(--ck-font-size-normal);line-height:var(--ck-line-height-base);margin:0;padding:var(--ck-spacing-large);white-space:pre-wrap}.ck-source-editing-area:after{content:attr(data-value) " ";display:block;visibility:hidden}.ck-source-editing-area textarea{border-color:var(--ck-color-base-border);border-radius:0;box-sizing:border-box;height:100%;outline:none;overflow:hidden;position:absolute;resize:none;width:100%;&.ck-rounded-corners,.ck-rounded-corners &{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}}.ck-source-editing-area textarea:not([readonly]):focus{border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0;outline:none}',""]);const r=o},9262(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,'.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position{display:inline;pointer-events:none;position:relative}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span{position:absolute;width:0}.ck.ck-editor__editable .ck-widget:-webkit-drag>.ck-widget__selection-handle,.ck.ck-editor__editable .ck-widget:-webkit-drag>.ck-widget__type-around{display:none}.ck.ck-clipboard-drop-target-line{pointer-events:none;position:absolute;z-index:var(--ck-z-default)}:root{--ck-clipboard-drop-target-dot-width:12px;--ck-clipboard-drop-target-dot-height:8px;--ck-clipboard-drop-target-color:var(--ck-color-focus-border)}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span{background:var(--ck-clipboard-drop-target-color);border:1px solid var(--ck-clipboard-drop-target-color);bottom:calc(var(--ck-clipboard-drop-target-dot-height)*-.5);margin-left:-1px;top:calc(var(--ck-clipboard-drop-target-dot-height)*-.5)}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span:after{border-color:var(--ck-clipboard-drop-target-color) transparent transparent transparent;border-style:solid;border-width:calc(var(--ck-clipboard-drop-target-dot-height)) calc(var(--ck-clipboard-drop-target-dot-width)*.5) 0 calc(var(--ck-clipboard-drop-target-dot-width)*.5);content:"";display:block;height:0;left:50%;position:absolute;top:calc(var(--ck-clipboard-drop-target-dot-height)*-.5);transform:translateX(-50%);width:0}.ck.ck-editor__editable .ck-widget.ck-clipboard-drop-target-range{outline:var(--ck-widget-outline-thickness) solid var(--ck-clipboard-drop-target-color)!important}.ck.ck-editor__editable .ck-widget:-webkit-drag{outline:none!important;zoom:.6}.ck.ck-clipboard-drop-target-line{background:var(--ck-clipboard-drop-target-color);border:1px solid var(--ck-clipboard-drop-target-color);height:0;margin-top:-1px}.ck.ck-clipboard-drop-target-line:before{border-style:solid;content:"";height:0;position:absolute;top:calc(var(--ck-clipboard-drop-target-dot-width)*-.5);width:0;[dir=ltr] &{border-color:transparent transparent transparent var(--ck-clipboard-drop-target-color);border-width:calc(var(--ck-clipboard-drop-target-dot-width)*.5) 0 calc(var(--ck-clipboard-drop-target-dot-width)*.5) var(--ck-clipboard-drop-target-dot-height);left:-1px}[dir=rtl] &{border-color:transparent var(--ck-clipboard-drop-target-color) transparent transparent;border-width:calc(var(--ck-clipboard-drop-target-dot-width)*.5) var(--ck-clipboard-drop-target-dot-height) calc(var(--ck-clipboard-drop-target-dot-width)*.5) 0;right:-1px}}',""]);const r=o},9341(e,t,i){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n=i(993),o=i(6502);t.isEqual=function(e,t){return n.isEqualWith(e,t,o.noop)}},9465(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,":root{--ck-content-font-size-tiny:0.7em;--ck-content-font-size-small:0.85em;--ck-content-font-size-big:1.4em;--ck-content-font-size-huge:1.8em}.ck-content .text-tiny{font-size:var(--ck-content-font-size-tiny)}.ck-content .text-small{font-size:var(--ck-content-font-size-small)}.ck-content .text-big{font-size:var(--ck-content-font-size-big)}.ck-content .text-huge{font-size:var(--ck-content-font-size-huge)}",""]);const r=o},9550(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,":root{--ck-accessibility-help-dialog-max-width:600px;--ck-accessibility-help-dialog-max-height:400px;--ck-accessibility-help-dialog-border-color:#ccced1;--ck-accessibility-help-dialog-code-background-color:#ededed;--ck-accessibility-help-dialog-kbd-shadow-color:#9c9c9c}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content{border:1px solid transparent;max-height:var(--ck-accessibility-help-dialog-max-height);max-width:var(--ck-accessibility-help-dialog-max-width);overflow:auto;padding:var(--ck-spacing-large);user-select:text}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content:focus{border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0;outline:none}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content{*{white-space:normal}}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content .ck-label{display:none}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content h3{font-size:1.2em;font-weight:700}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content h4{font-size:1em;font-weight:700}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content h3,.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content h4,.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content p,.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content table{margin:1em 0}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content dl{border-bottom:none;border-top:1px solid var(--ck-accessibility-help-dialog-border-color);display:grid;grid-template-columns:2fr 1fr}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content dl dd,.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content dl dt{border-bottom:1px solid var(--ck-accessibility-help-dialog-border-color);padding:.4em 0}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content dl dt{grid-column-start:1}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content dl dd{grid-column-start:2;text-align:right}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content code,.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content kbd{background:var(--ck-accessibility-help-dialog-code-background-color);border-radius:2px;display:inline-block;font-size:.9em;line-height:1;padding:.4em;text-align:center;vertical-align:middle}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content code{font-family:monospace}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content kbd{box-shadow:0 1px 1px var(--ck-accessibility-help-dialog-kbd-shadow-color);margin:0 1px;min-width:1.8em}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content kbd+kbd{margin-left:2px}",""]);const r=o},9624(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,".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:calc(1.07692em + 1px);--ck-switch-button-translation:calc(var(--ck-switch-button-toggle-width) - var(--ck-switch-button-toggle-inner-size) - 2px);--ck-switch-button-inner-hover-shadow:0 0 0 5px var(--ck-color-switch-button-inner-shadow)}.ck.ck-button.ck-switchbutton,.ck.ck-button.ck-switchbutton.ck-on:active,.ck.ck-button.ck-switchbutton.ck-on:focus,.ck.ck-button.ck-switchbutton.ck-on:hover,.ck.ck-button.ck-switchbutton:active,.ck.ck-button.ck-switchbutton:focus,.ck.ck-button.ck-switchbutton:hover{background:transparent;color:inherit}.ck.ck-button.ck-switchbutton .ck-button__label{[dir=ltr] &{margin-right:calc(var(--ck-spacing-large)*2)}[dir=rtl] &{margin-left:calc(var(--ck-spacing-large)*2)}}.ck.ck-button.ck-switchbutton .ck-button__toggle{background:var(--ck-color-switch-button-off-background);border:1px solid transparent;border-radius:0;transition:background .4s ease,box-shadow .2s ease-in-out,outline .2s ease-in-out;width:var(--ck-switch-button-toggle-width);&.ck-rounded-corners,.ck-rounded-corners &{border-radius:var(--ck-border-radius)}[dir=ltr] &{margin-left:auto}[dir=rtl] &{margin-right:auto}}.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{background:var(--ck-color-switch-button-inner-background);border-radius:0;height:var(--ck-switch-button-toggle-inner-size);transition:all .3s ease;width:var(--ck-switch-button-toggle-inner-size);&.ck-rounded-corners,.ck-rounded-corners &{border-radius:var(--ck-border-radius);border-radius:calc(var(--ck-border-radius)*.5)}}@media (prefers-reduced-motion:reduce){.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{transition:none}}.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:var(--ck-switch-button-inner-hover-shadow)}.ck.ck-button.ck-switchbutton.ck-disabled .ck-button__toggle{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-switchbutton:focus{border-color:transparent;box-shadow:none;outline:none}.ck.ck-button.ck-switchbutton:focus .ck-button__toggle{box-shadow:0 0 0 1px var(--ck-color-base-background),0 0 0 5px var(--ck-color-focus-outer-shadow);outline:var(--ck-focus-ring);outline-offset:1px}.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)}.ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle .ck-button__toggle__inner{[dir=ltr] &{transform:translateX(var( --ck-switch-button-translation ))}[dir=rtl] &{transform:translateX(calc(var( --ck-switch-button-translation )*-1))}}",""]);const r=o},9768(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,":root{--ck-form-default-width:340px}.ck.ck-form{padding:0 0 var(--ck-spacing-large)}.ck.ck-form.ck-form_default-width{width:var(--ck-form-default-width)}.ck.ck-form:focus{outline:none}.ck.ck-form .ck.ck-input-number,.ck.ck-form .ck.ck-input-text{min-width:100%;width:0}.ck.ck-form .ck.ck-dropdown{min-width:100%}.ck.ck-form .ck.ck-dropdown .ck-dropdown__button:not(:focus){border:1px solid var(--ck-color-base-border)}.ck.ck-form .ck.ck-dropdown .ck-dropdown__button .ck-button__label{width:100%}@media screen and (max-width:600px){.ck.ck-form.ck-responsive-form .ck.ck-form__row.ck-form__row_with-submit{align-items:stretch;flex-direction:column;padding:0}}.ck.ck-form.ck-responsive-form .ck.ck-form__row.ck-form__row_with-submit{@media screen and (max-width:600px){>.ck{margin:var(--ck-spacing-large) var(--ck-spacing-large) 0}.ck-button_with-text{justify-content:center}}}@media screen and (max-width:600px){.ck.ck-form.ck-responsive-form .ck.ck-form__row.ck-form__row_large-bottom-padding{padding-bottom:var(--ck-spacing-large)}}.ck.ck-form.ck-responsive-form{[dir=ltr] &>:not(:first-child),[dir=rtl] &>:not(:last-child){margin-left:0}}",""]);const r=o},9881(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,".ck.ck-editor{position:relative}.ck.ck-editor .ck-editor__top .ck-sticky-panel .ck-toolbar{z-index:var(--ck-z-panel)}.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content{border:solid var(--ck-color-base-border);border-radius:0;border-width:1px 1px 0;&.ck-rounded-corners,.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-sticky-panel__content.ck-sticky-panel__content_sticky{border-bottom-width:1px}.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content .ck-menu-bar{border:0;border-bottom:1px solid var(--ck-color-base-border)}.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content .ck-toolbar{border:0}.ck.ck-editor__main>.ck-editor__editable{background:var(--ck-color-base-background);border-radius:0;&.ck-rounded-corners,.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)}",""]);const r=o},9938(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,".ck .ck-balloon-rotator__navigation{align-items:center;display:flex;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-bottom:var(--ck-spacing-small);margin-right:var(--ck-spacing-small);margin-top:var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation .ck-balloon-rotator__counter{margin-left:var(--ck-spacing-small);margin-right:var(--ck-spacing-standard)}.ck .ck-balloon-rotator__content .ck.ck-annotation-wrapper{box-shadow:none}",""]);const r=o},9969(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(6314),o=i.n(n)()(function(e){return e[1]});o.push([e.id,".ck-content .table th{text-align:start}.ck-content[dir=rtl] .table th{text-align:right}.ck-content[dir=ltr] .table th{text-align:left}.ck-content figure.table:not(.layout-table){display:table}.ck-content figure.table:not(.layout-table)>table{height:100%;width:100%}.ck-content .table:not(.layout-table){margin:.9em auto}.ck-content figure.table:not(.layout-table)>table,.ck-content table.table:not(.layout-table){border:1px double #b3b3b3;border-collapse:collapse;border-spacing:0}.ck-content figure.table:not(.layout-table)>table>tbody>tr>th,.ck-content figure.table:not(.layout-table)>table>thead>tr>th,.ck-content table.table:not(.layout-table)>tbody>tr>th,.ck-content table.table:not(.layout-table)>thead>tr>th{background:rgba(0,0,0,.05);font-weight:700}.ck-content figure.table:not(.layout-table)>table>tbody>tr>td>p:first-of-type,.ck-content figure.table:not(.layout-table)>table>tbody>tr>th>p:first-of-type,.ck-content figure.table:not(.layout-table)>table>thead>tr>td>p:first-of-type,.ck-content figure.table:not(.layout-table)>table>thead>tr>th>p:first-of-type,.ck-content table.table:not(.layout-table)>tbody>tr>td>p:first-of-type,.ck-content table.table:not(.layout-table)>tbody>tr>th>p:first-of-type,.ck-content table.table:not(.layout-table)>thead>tr>td>p:first-of-type,.ck-content table.table:not(.layout-table)>thead>tr>th>p:first-of-type{margin-top:0}.ck-content figure.table:not(.layout-table)>table>tbody>tr>td>p:last-of-type,.ck-content figure.table:not(.layout-table)>table>tbody>tr>th>p:last-of-type,.ck-content figure.table:not(.layout-table)>table>thead>tr>td>p:last-of-type,.ck-content figure.table:not(.layout-table)>table>thead>tr>th>p:last-of-type,.ck-content table.table:not(.layout-table)>tbody>tr>td>p:last-of-type,.ck-content table.table:not(.layout-table)>tbody>tr>th>p:last-of-type,.ck-content table.table:not(.layout-table)>thead>tr>td>p:last-of-type,.ck-content table.table:not(.layout-table)>thead>tr>th>p:last-of-type{margin-bottom:0}.ck-content figure.table:not(.layout-table)>table>tbody>tr>td,.ck-content figure.table:not(.layout-table)>table>tbody>tr>th,.ck-content figure.table:not(.layout-table)>table>thead>tr>td,.ck-content figure.table:not(.layout-table)>table>thead>tr>th,.ck-content table.table:not(.layout-table)>tbody>tr>td,.ck-content table.table:not(.layout-table)>tbody>tr>th,.ck-content table.table:not(.layout-table)>thead>tr>td,.ck-content table.table:not(.layout-table)>thead>tr>th{border:1px solid #bfbfbf;min-width:2em;padding:.4em}@media print{.ck-content figure.table:not(.layout-table){height:fit-content;width:fit-content}.ck-content figure.table:not(.layout-table)>table{height:auto}}.ck-editor__editable .ck-table-bogus-paragraph{display:inline-block;width:100%}",""]);const r=o}},t={};function i(n){var o=t[n];if(void 0!==o)return o.exports;var r=t[n]={id:n,exports:{}};return e[n](r,r.exports,i),r.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var n={};return(()=>{"use strict";let e;i.d(n,{default:()=>xx});try{e={window,document}}catch{e={window:{},document:{}}}function t(){try{return navigator.userAgent.toLowerCase()}catch{return""}}const o=t(),r={isMac:s(o),isWindows:a(o),isGecko:l(o),isSafari:c(o),isiOS:d(o),isAndroid:u(o),isBlink:h(o),get isMediaForcedColors(){return!!e.window.matchMedia&&e.window.matchMedia("(forced-colors: active)").matches},get isMotionReduced(){return!!e.window.matchMedia&&e.window.matchMedia("(prefers-reduced-motion)").matches},features:{isRegExpUnicodePropertySupported:m()}};function s(e){return e.indexOf("macintosh")>-1}function a(e){return e.indexOf("windows")>-1}function l(e){return!!e.match(/gecko\/\d+/)}function c(e){return e.indexOf(" applewebkit/")>-1&&-1===e.indexOf("chrome")}function d(e){return!!e.match(/iphone|ipad/i)||s(e)&&navigator.maxTouchPoints>0}function u(e){return e.indexOf("android")>-1}function h(e){return e.indexOf("chrome/")>-1&&e.indexOf("edge/")<0}function m(){let e=!1;try{e=0==="ć".search(new RegExp("[\\p{L}]","u"))}catch{}return e}function g(e,t,i,n){i=i||function(e,t){return e===t};const o=Array.isArray(e)?e:Array.prototype.slice.call(e),r=Array.isArray(t)?t:Array.prototype.slice.call(t),s=function(e,t,i){const n=f(e,t,i);if(-1===n)return{firstIndex:-1,lastIndexOld:-1,lastIndexNew:-1};const o=p(e,n),r=p(t,n),s=f(o,r,i),a=e.length-s,l=t.length-s;return{firstIndex:n,lastIndexOld:a,lastIndexNew:l}}(o,r,i),a=n?function(e,t){const{firstIndex:i,lastIndexOld:n,lastIndexNew:o}=e;if(-1===i)return Array(t).fill("equal");let r=[];i>0&&(r=r.concat(Array(i).fill("equal")));o-i>0&&(r=r.concat(Array(o-i).fill("insert")));n-i>0&&(r=r.concat(Array(n-i).fill("delete")));o<t&&(r=r.concat(Array(t-o).fill("equal")));return r}(s,r.length):function(e,t){const i=[],{firstIndex:n,lastIndexOld:o,lastIndexNew:r}=t;r-n>0&&i.push({index:n,type:"insert",values:e.slice(n,r)});o-n>0&&i.push({index:n+(r-n),type:"delete",howMany:o-n});return i}(r,s);return a}function f(e,t,i){for(let n=0;n<Math.max(e.length,t.length);n++)if(void 0===e[n]||void 0===t[n]||!i(e[n],t[n]))return n;return-1}function p(e,t){return e.slice(t).reverse()}function b(e,t,i){i=i||function(e,t){return e===t};const n=e.length,o=t.length;if(n>200||o>200||n+o>300)return b.fastDiff(e,t,i,!0);let r,s;if(o<n){const i=e;e=t,t=i,r="delete",s="insert"}else r="insert",s="delete";const a=e.length,l=t.length,c=l-a,d={},u={};function h(n){const o=(void 0!==u[n-1]?u[n-1]:-1)+1,c=void 0!==u[n+1]?u[n+1]:-1,h=o>c?-1:1;d[n+h]&&(d[n]=d[n+h].slice(0)),d[n]||(d[n]=[]),d[n].push(o>c?r:s);let m=Math.max(o,c),g=m-n;for(;g<a&&m<l&&i(e[g],t[m]);)g++,m++,d[n].push("equal");return m}let m,g=0;do{for(m=-g;m<c;m++)u[m]=h(m);for(m=c+g;m>c;m--)u[m]=h(m);u[c]=h(c),g++}while(u[c]!==l);return d[c].slice(1)}b.fastDiff=g;class k{source;name;path;stop;off;return;constructor(e,t){this.source=e,this.name=t,this.path=[],this.stop=function e(){e.called=!0},this.off=function e(){e.called=!0}}}const w=new Array(256).fill("").map((e,t)=>("0"+t.toString(16)).slice(-2));function _(){const[e,t,i,n]=crypto.getRandomValues(new Uint32Array(4));return"e"+w[255&e]+w[e>>8&255]+w[e>>16&255]+w[e>>24&255]+w[255&t]+w[t>>8&255]+w[t>>16&255]+w[t>>24&255]+w[255&i]+w[i>>8&255]+w[i>>16&255]+w[i>>24&255]+w[255&n]+w[n>>8&255]+w[n>>16&255]+w[n>>24&255]}const v={get(e="normal"){return"number"!=typeof e?this[e]||this.normal:e},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5};function y(e,t){const i=v.get(t.priority);let n=0,o=e.length;for(;n<o;){const t=n+o>>1;v.get(e[t].priority)<i?o=t:n=t+1}e.splice(n,0,t)}class A extends Error{context;data;constructor(e,t,i,n){super(function(e,t,i){const n=new WeakSet,o=(e,t)=>{if("object"==typeof t&&null!==t){if(n.has(t))return`[object ${t.constructor.name}]`;n.add(t)}return t},r=t?` ${JSON.stringify(t,o)}`:"",s=C(e),a=i?`\nOriginal error: ${i.name}: ${i.message}`:"";return e+r+s+a}(e,i,n)),this.name="CKEditorError",this.context=t,this.data=i,n&&(this.stack=n.stack)}is(e){return"CKEditorError"===e}static rethrowUnexpectedError(e,t){if(e.is&&e.is("CKEditorError"))throw e;throw new A("unexpected-error",t,void 0,e)}}function x(e,t){console.warn(...T(e,t))}function C(e){return`\nRead more: https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html#error-${e}`}function T(e,t){const i=C(e);return t?[e,t,i]:[e,i]}const E=new Date(2026,0,14);if(globalThis.CKEDITOR_VERSION)throw new A("ckeditor-duplicated-modules",null);globalThis.CKEDITOR_VERSION="47.4.0";const I=Symbol("listeningTo"),S=Symbol("emitterId"),P=Symbol("delegations"),M=O(Object);function O(e){if(!e)return M;return class extends e{on(e,t,i){this.listenTo(this,e,t,i)}once(e,t,i){let n=!1;this.listenTo(this,e,(e,...i)=>{n||(n=!0,e.off(),t.call(this,e,...i))},i)}off(e,t){this.stopListening(this,e,t)}listenTo(e,t,i,n={}){let o,r;this[I]||(this[I]={});const s=this[I];N(e)||R(e);const a=N(e);(o=s[a])||(o=s[a]={emitter:e,callbacks:{}}),(r=o.callbacks[t])||(r=o.callbacks[t]=[]),r.push(i),function(e,t,i,n,o){t._addEventListener?t._addEventListener(i,n,o):e._addEventListener.call(t,i,n,o)}(this,e,t,i,n)}stopListening(e,t,i){const n=this[I];let o=e&&N(e);const r=n&&o?n[o]:void 0,s=r&&t?r.callbacks[t]:void 0;if(!(!n||e&&!r||t&&!s))if(i){z(this,e,t,i);-1!==s.indexOf(i)&&(1===s.length?delete r.callbacks[t]:z(this,e,t,i))}else if(s){for(;i=s.pop();)z(this,e,t,i);delete r.callbacks[t]}else if(r){for(t in r.callbacks)this.stopListening(e,t);delete n[o]}else{for(o in n)this.stopListening(n[o].emitter);delete this[I]}}fire(e,...t){try{const i=e instanceof k?e:new k(this,e),n=i.name;let o=function(e,t){if(!e._events)return null;let i=t;do{const t=e._events[i];if(t&&t.callbacks&&t.callbacks.length)return t.callbacks;const n=i.lastIndexOf(":");i=n>-1?i.substring(0,n):""}while(i);return null}(this,n);if(i.path.push(this),o){o=o.slice();for(let e=0;e<o.length;e++){const r=o[e].callback;if(r.call(this,i,...t),i.off.called&&(delete i.off.called,this._removeEventListener(n,r)),i.stop.called)break}}const r=this[P];if(r){const e=r.get(n),o=r.get("*");e&&B(e,i,t),o&&B(o,i,t)}return i.return}catch(e){A.rethrowUnexpectedError(e,this)}}delegate(...e){return{to:(t,i)=>{this[P]||(this[P]=new Map),e.forEach(e=>{const n=this[P].get(e);n?n.set(t,i):this[P].set(e,new Map([[t,i]]))})}}}stopDelegating(e,t){if(this[P])if(e)if(t){const i=this[P].get(e);i&&i.delete(t)}else this[P].delete(e);else this[P].clear()}_addEventListener(e,t,i){!function(e,t){const i=V(e);if(i[t])return;let n=t,o=null;const r=[];for(;""!==n&&!i[n];)i[n]=L(),r.push(i[n]),o&&i[n].childEvents.push(o),o=n,n=n.substr(0,n.lastIndexOf(":"));if(""!==n){for(const e of r)e.callbacks=i[n].callbacks.slice();i[n].childEvents.push(o)}}(this,e);const n=D(this,e),o={callback:t,priority:v.get(i.priority)};for(const e of n)y(e,o)}_removeEventListener(e,t){const i=D(this,e);for(const e of i)for(let i=0;i<e.length;i++)e[i].callback==t&&(e.splice(i,1),i--)}}}function R(e,t){e[S]||(e[S]=t||_())}function N(e){return e[S]}function V(e){return e._events||Object.defineProperty(e,"_events",{value:{}}),e._events}function L(){return{callbacks:[],childEvents:[]}}function D(e,t){const i=V(e)[t];if(!i)return[];let n=[i.callbacks];for(let t=0;t<i.childEvents.length;t++){const o=D(e,i.childEvents[t]);n=n.concat(o)}return n}function B(e,t,i){for(let[n,o]of e){o?"function"==typeof o&&(o=o(t.name)):o=t.name;const e=new k(t.source,o);e.path=[...t.path],n.fire(e,...i)}}function z(e,t,i,n){t._removeEventListener?t._removeEventListener(i,n):e._removeEventListener.call(t,i,n)}function F(e){return null!==e&&("object"==typeof e||"function"==typeof e)}const j=Symbol("observableProperties"),U=Symbol("boundObservables"),H=Symbol("boundProperties"),W=Symbol("decoratedMethods"),$=Symbol("decoratedOriginal"),q=K(O());function K(e){if(!e)return q;return class extends e{set(e,t){if(F(e))return void Object.keys(e).forEach(t=>{this.set(t,e[t])},this);G(this);const i=this[j];if(e in this&&!i.has(e))throw new A("observable-set-cannot-override",this);Object.defineProperty(this,e,{enumerable:!0,configurable:!0,get:()=>i.get(e),set(t){const n=i.get(e);let o=this.fire(`set:${e}`,e,t,n);void 0===o&&(o=t),n===o&&i.has(e)||(i.set(e,o),this.fire(`change:${e}`,e,o,n))}}),this[e]=t}bind(...e){if(!e.length||!Q(e))throw new A("observable-bind-wrong-properties",this);if(new Set(e).size!==e.length)throw new A("observable-bind-duplicate-properties",this);G(this);const t=this[H];e.forEach(e=>{if(t.has(e))throw new A("observable-bind-rebind",this)});const i=new Map;return e.forEach(e=>{const n={property:e,to:[]};t.set(e,n),i.set(e,n)}),{to:Y,toMany:J,_observable:this,_bindProperties:e,_to:[],_bindings:i}}unbind(...e){if(!this[j])return;const t=this[H],i=this[U];if(e.length){if(!Q(e))throw new A("observable-unbind-wrong-properties",this);e.forEach(e=>{const n=t.get(e);n&&(n.to.forEach(([e,t])=>{const o=i.get(e),r=o[t];r.delete(n),r.size||delete o[t],Object.keys(o).length||(i.delete(e),this.stopListening(e,"change"))}),t.delete(e))})}else i.forEach((e,t)=>{this.stopListening(t,"change")}),i.clear(),t.clear()}decorate(e){G(this);const t=this[e];if(!t)throw new A("observablemixin-cannot-decorate-undefined",this,{object:this,methodName:e});this.on(e,(e,i)=>{e.return=t.apply(this,i)}),this[e]=function(...t){return this.fire(e,t)},this[e][$]=t,this[W]||(this[W]=[]),this[W].push(e)}stopListening(e,t,i){if(!e&&this[W]){for(const e of this[W])this[e]=this[e][$];delete this[W]}super.stopListening(e,t,i)}[j];[W];[H];[U]}}function G(e){e[j]||(Object.defineProperty(e,j,{value:new Map}),Object.defineProperty(e,U,{value:new Map}),Object.defineProperty(e,H,{value:new Map}))}function Y(...e){const t=function(...e){if(!e.length)throw new A("observable-bind-to-parse-error",null);const t={to:[]};let i;"function"==typeof e[e.length-1]&&(t.callback=e.pop());return e.forEach(e=>{if("string"==typeof e)i.properties.push(e);else{if("object"!=typeof e)throw new A("observable-bind-to-parse-error",null);i={observable:e,properties:[]},t.to.push(i)}}),t}(...e),i=Array.from(this._bindings.keys()),n=i.length;if(!t.callback&&t.to.length>1)throw new A("observable-bind-to-no-callback",this);if(n>1&&t.callback)throw new A("observable-bind-to-extra-callback",this);var o;t.to.forEach(e=>{if(e.properties.length&&e.properties.length!==n)throw new A("observable-bind-to-properties-length",this);e.properties.length||(e.properties=this._bindProperties)}),this._to=t.to,t.callback&&(this._bindings.get(i[0]).callback=t.callback),o=this._observable,this._to.forEach(e=>{const t=o[U];let i;t.get(e.observable)||o.listenTo(e.observable,"change",(n,r)=>{i=t.get(e.observable)[r],i&&i.forEach(e=>{Z(o,e.property)})})}),function(e){let t;e._bindings.forEach((i,n)=>{e._to.forEach(o=>{t=o.properties[i.callback?0:e._bindProperties.indexOf(n)],i.to.push([o.observable,t]),function(e,t,i,n){const o=e[U],r=o.get(i),s=r||{};s[n]||(s[n]=new Set);s[n].add(t),r||o.set(i,s)}(e._observable,i,o.observable,t)})})}(this),this._bindProperties.forEach(e=>{Z(this._observable,e)})}function J(e,t,i){if(this._bindings.size>1)throw new A("observable-bind-to-many-not-one-binding",this);this.to(...function(e,t){const i=e.map(e=>[e,t]);return Array.prototype.concat.apply([],i)}(e,t),i)}function Q(e){return e.every(e=>"string"==typeof e)}function Z(e,t){const i=e[H].get(t);let n;i.callback?n=i.callback.apply(e,i.to.map(e=>e[0][e[1]])):(n=i.to[0],n=n[0][n[1]]),Object.prototype.hasOwnProperty.call(e,t)?e[t]=n:e.set(t,n)}class X{_replacedElements;constructor(){this._replacedElements=[]}replace(e,t){this._replacedElements.push({element:e,newElement:t}),e.style.display="none",t&&e.parentNode.insertBefore(t,e.nextSibling)}restore(){this._replacedElements.forEach(({element:e,newElement:t})=>{e.style.display="",t&&t.remove()}),this._replacedElements=[]}}function ee(e){let t=0;for(const i of e)t++;return t}function te(e,t){const i=Math.min(e.length,t.length);for(let n=0;n<i;n++)if(e[n]!=t[n])return n;return e.length==t.length?"same":e.length<t.length?"prefix":"extension"}function ie(e){return!(!e||!e[Symbol.iterator])}function ne(e){return"string"==typeof e||e instanceof String}function oe(e,t,i={},n=[]){const o=i&&i.xmlns,r=o?e.createElementNS(o,t):e.createElement(t);for(const e in i)r.setAttribute(e,i[e]);!ne(n)&&ie(n)||(n=[n]);for(let t of n)ne(t)&&(t=e.createTextNode(t)),r.appendChild(t);return r}function re(e){if("object"!=typeof e)return!1;if(null==e)return!1;if(null===Object.getPrototypeOf(e))return!0;if("[object Object]"!==Object.prototype.toString.call(e)){const t=e[Symbol.toStringTag];if(null==t)return!1;return!!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable&&e.toString()===`[object ${t}]`}let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function se(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function ae(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const le="[object RegExp]",ce="[object String]",de="[object Number]",ue="[object Boolean]",he="[object Arguments]",me="[object Symbol]",ge="[object Date]",fe="[object Map]",pe="[object Set]",be="[object Array]",ke="[object ArrayBuffer]",we="[object Object]",_e="[object DataView]",ve="[object Uint8Array]",ye="[object Uint8ClampedArray]",Ae="[object Uint16Array]",xe="[object Uint32Array]",Ce="[object Int8Array]",Te="[object Int16Array]",Ee="[object Int32Array]",Ie="[object Float32Array]",Se="[object Float64Array]";function Pe(e){return null==e||"object"!=typeof e&&"function"!=typeof e}function Me(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Oe(e,t,i,n=new Map,o=void 0){const r=o?.(e,t,i,n);if(null!=r)return r;if(Pe(e))return e;if(n.has(e))return n.get(e);if(Array.isArray(e)){const t=new Array(e.length);n.set(e,t);for(let r=0;r<e.length;r++)t[r]=Oe(e[r],r,i,n,o);return Object.hasOwn(e,"index")&&(t.index=e.index),Object.hasOwn(e,"input")&&(t.input=e.input),t}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const t=new RegExp(e.source,e.flags);return t.lastIndex=e.lastIndex,t}if(e instanceof Map){const t=new Map;n.set(e,t);for(const[r,s]of e)t.set(r,Oe(s,r,i,n,o));return t}if(e instanceof Set){const t=new Set;n.set(e,t);for(const r of e)t.add(Oe(r,void 0,i,n,o));return t}if("undefined"!=typeof Buffer&&Buffer.isBuffer(e))return e.subarray();if(Me(e)){const t=new(Object.getPrototypeOf(e).constructor)(e.length);n.set(e,t);for(let r=0;r<e.length;r++)t[r]=Oe(e[r],r,i,n,o);return t}if(e instanceof ArrayBuffer||"undefined"!=typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){const t=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return n.set(e,t),Re(t,e,i,n,o),t}if("undefined"!=typeof File&&e instanceof File){const t=new File([e],e.name,{type:e.type});return n.set(e,t),Re(t,e,i,n,o),t}if(e instanceof Blob){const t=new Blob([e],{type:e.type});return n.set(e,t),Re(t,e,i,n,o),t}if(e instanceof Error){const t=new e.constructor;return n.set(e,t),t.message=e.message,t.name=e.name,t.stack=e.stack,t.cause=e.cause,Re(t,e,i,n,o),t}if("object"==typeof e&&function(e){switch(ae(e)){case he:case be:case ke:case _e:case ue:case ge:case Ie:case Se:case Ce:case Te:case Ee:case fe:case de:case we:case le:case pe:case ce:case me:case ve:case ye:case Ae:case xe:return!0;default:return!1}}(e)){const t=Object.create(Object.getPrototypeOf(e));return n.set(e,t),Re(t,e,i,n,o),t}return e}function Re(e,t,i=e,n,o){const r=[...Object.keys(t),...se(t)];for(let s=0;s<r.length;s++){const a=r[s],l=Object.getOwnPropertyDescriptor(e,a);(null==l||l.writable)&&(e[a]=Oe(t[a],a,i,n,o))}}function Ne(e,t){return function(e,t){return Oe(e,void 0,e,new Map,t)}(e,(i,n,o,r)=>{const s=t?.(i,n,o,r);if(null!=s)return s;if("object"==typeof e)switch(Object.prototype.toString.call(e)){case de:case ce:case ue:{const t=new e.constructor(e?.valueOf());return Re(t,e),t}case he:{const t={};return Re(t,e),t.length=e.length,t[Symbol.iterator]=e[Symbol.iterator],t}default:return}})}function Ve(e){return"object"==typeof e&&null!==e}function Le(e){return Ve(e)&&1===e.nodeType&&!re(e)}class De{_config;constructor(e,t){this._config=Object.create(null),t&&this.define(Be(t)),e&&this._setObjectToTarget(this._config,e)}set(e,t){this._setToTarget(this._config,e,t)}define(e,t){this._setToTarget(this._config,e,t,!0)}get(e){return this._getFromSource(this._config,e)}*names(){for(const e of Object.keys(this._config))yield e}_setToTarget(e,t,i,n=!1){if(re(t))return void this._setObjectToTarget(e,t,n);const o=t.split(".");t=o.pop();for(const t of o)re(e[t])||(e[t]=Object.create(null)),e=e[t];if(re(i))return re(e[t])||(e[t]=Object.create(null)),e=e[t],void this._setObjectToTarget(e,i,n);n&&void 0!==e[t]||(e[t]=i)}_getFromSource(e,t){const i=t.split(".");t=i.pop();for(const t of i){if(!re(e[t])){e=null;break}e=e[t]}return e?Be(e[t]):void 0}_setObjectToTarget(e,t,i){Object.keys(t).forEach(n=>{this._setToTarget(e,n,t[n],i)})}}function Be(e){return Ne(e,ze)}function ze(e){return Le(e)||"function"==typeof e?e:void 0}function Fe(e){if(e){if(e.defaultView)return e instanceof e.defaultView.Document;if(e.ownerDocument&&e.ownerDocument.defaultView)return e instanceof e.ownerDocument.defaultView.Node}return!1}function je(e){const t=Object.prototype.toString.apply(e);return"[object Window]"==t||"[object global]"==t}const Ue=He(O());function He(t){if(!t)return Ue;return class extends t{listenTo(t,i,n,o={}){if(Fe(t)||je(t)||t instanceof e.window.EventTarget){const e={capture:!!o.useCapture,passive:!!o.usePassive},r=this._getProxyEmitter(t,e)||new We(t,e);this.listenTo(r,i,n,o)}else super.listenTo(t,i,n,o)}stopListening(t,i,n){if(Fe(t)||je(t)||t instanceof e.window.EventTarget){const e=this._getAllProxyEmitters(t);for(const t of e)this.stopListening(t,i,n)}else super.stopListening(t,i,n)}_getProxyEmitter(e,t){return function(e,t){const i=e[I];return i&&i[t]?i[t].emitter:null}(this,$e(e,t))}_getAllProxyEmitters(e){return[{capture:!1,passive:!1},{capture:!1,passive:!0},{capture:!0,passive:!1},{capture:!0,passive:!0}].map(t=>this._getProxyEmitter(e,t)).filter(e=>!!e)}}}class We extends(O()){_domNode;_options;constructor(e,t){super(),R(this,$e(e,t)),this._domNode=e,this._options=t}_domListeners;attach(e){if(this._domListeners&&this._domListeners[e])return;const t=this._createDomListener(e);this._domNode.addEventListener(e,t,this._options),this._domListeners||(this._domListeners={}),this._domListeners[e]=t}detach(e){let t;!this._domListeners[e]||(t=this._events[e])&&t.callbacks.length||this._domListeners[e].removeListener()}_addEventListener(e,t,i){this.attach(e),O().prototype._addEventListener.call(this,e,t,i)}_removeEventListener(e,t){O().prototype._removeEventListener.call(this,e,t),this.detach(e)}_createDomListener(e){const t=t=>{this.fire(e,t)};return t.removeListener=()=>{this._domNode.removeEventListener(e,t,this._options),delete this._domListeners[e]},t}}function $e(e,t){let i=function(e){return e["data-ck-expando"]||(e["data-ck-expando"]=_())}(e);for(const e of Object.keys(t).sort())t[e]&&(i+="-"+e);return i}function qe(e){if(!e.target)return null;const t=e.target.ownerDocument,i=e.clientX,n=e.clientY;let o=null;return t.caretRangeFromPoint&&t.caretRangeFromPoint(i,n)?o=t.caretRangeFromPoint(i,n):e.rangeParent&&(o=t.createRange(),o.setStart(e.rangeParent,e.rangeOffset),o.collapse(!0)),o}function Ke(t){return t&&t.parentNode?t.offsetParent===e.document.body?null:t.offsetParent:null}function Ge(e){return"[object Text]"==Object.prototype.toString.call(e)}function Ye(e){return"[object Range]"==Object.prototype.toString.apply(e)}function Je(e){const t=e.ownerDocument.defaultView.getComputedStyle(e);return{top:parseInt(t.borderTopWidth,10),right:parseInt(t.borderRightWidth,10),bottom:parseInt(t.borderBottomWidth,10),left:parseInt(t.borderLeftWidth,10)}}const Qe=["top","right","bottom","left","width","height"];class Ze{top;right;bottom;left;width;height;_source;constructor(e){const t=Ye(e);if(Object.defineProperty(this,"_source",{value:e._source||e,writable:!0,enumerable:!1}),tt(e)||t)if(t){const t=Ze.getDomRangeRects(e);Xe(this,Ze.getBoundingRect(t))}else Xe(this,e.getBoundingClientRect());else if(je(e)){const{innerWidth:t,innerHeight:i}=e;Xe(this,{top:0,right:t,bottom:i,left:0,width:t,height:i})}else Xe(this,e)}clone(){return new Ze(this)}moveTo(e,t){return this.top=t,this.right=e+this.width,this.bottom=t+this.height,this.left=e,this}moveBy(e,t){return this.top+=t,this.right+=e,this.left+=e,this.bottom+=t,this}getIntersection(e){const t={top:Math.max(this.top,e.top),right:Math.min(this.right,e.right),bottom:Math.min(this.bottom,e.bottom),left:Math.max(this.left,e.left),width:0,height:0};if(t.width=t.right-t.left,t.height=t.bottom-t.top,t.width<0||t.height<0)return null;{const e=new Ze(t);return e._source=this._source,e}}getIntersectionArea(e){const t=this.getIntersection(e);return t?t.getArea():0}getArea(){return this.width*this.height}getVisible(){const e=this._source;let t=this.clone();if(et(e))return t;let i,n=e,o=e.parentNode||e.commonAncestorContainer;for(;o&&!et(o);){const e="visible"===nt(o);n instanceof HTMLElement&&"absolute"===it(n)&&(i=n);const r=it(o);if(e||i&&("relative"===r&&e||"relative"!==r)){n=o,o=o.parentNode;continue}const s=new Ze(o),a=t.getIntersection(s);if(!a)return null;a.getArea()<t.getArea()&&(t=a),n=o,o=o.parentNode}return t}isEqual(e){for(const t of Qe)if(this[t]!==e[t])return!1;return!0}contains(e){const t=this.getIntersection(e);return!(!t||!t.isEqual(e))}toAbsoluteRect(){const{scrollX:t,scrollY:i}=e.window,n=this.clone().moveBy(t,i);if(tt(n._source)){const e=Ke(n._source);e&&function(e,t){const i=new Ze(t),n=Je(t);let o=0,r=0;o-=i.left,r-=i.top,o+=t.scrollLeft,r+=t.scrollTop,o-=n.left,r-=n.top,e.moveBy(o,r)}(n,e)}return n}excludeScrollbarsAndBorders(){const e=this._source;let t,i,n;if(je(e))t=e.innerWidth-e.document.documentElement.clientWidth,i=e.innerHeight-e.document.documentElement.clientHeight,n=e.getComputedStyle(e.document.documentElement).direction;else{const o=Je(e);t=e.offsetWidth-e.clientWidth-o.left-o.right,i=e.offsetHeight-e.clientHeight-o.top-o.bottom,n=e.ownerDocument.defaultView.getComputedStyle(e).direction,this.left+=o.left,this.top+=o.top,this.right-=o.right,this.bottom-=o.bottom,this.width=this.right-this.left,this.height=this.bottom-this.top}return this.width-=t,"ltr"===n?this.right-=t:this.left+=t,this.height-=i,this.bottom-=i,this}static getDomRangeRects(e){const t=[],i=Array.from(e.getClientRects());if(i.length)for(const e of i)t.push(new Ze(e));else{let i=e.startContainer;Ge(i)&&(i=i.parentNode);const n=new Ze(i.getBoundingClientRect());n.right=n.left,n.width=0,t.push(n)}return t}static getBoundingRect(e){const t={left:Number.POSITIVE_INFINITY,top:Number.POSITIVE_INFINITY,right:Number.NEGATIVE_INFINITY,bottom:Number.NEGATIVE_INFINITY,width:0,height:0};let i=0;for(const n of e)i++,t.left=Math.min(t.left,n.left),t.top=Math.min(t.top,n.top),t.right=Math.max(t.right,n.right),t.bottom=Math.max(t.bottom,n.bottom);return 0==i?null:(t.width=t.right-t.left,t.height=t.bottom-t.top,new Ze(t))}}function Xe(e,t){for(const i of Qe)e[i]=t[i]}function et(e){return!!tt(e)&&e===e.ownerDocument.body}function tt(e){return null!==e&&"object"==typeof e&&1===e.nodeType&&"function"==typeof e.getBoundingClientRect}function it(e){return e instanceof HTMLElement?e.ownerDocument.defaultView.getComputedStyle(e).position:"static"}function nt(e){return e instanceof HTMLElement?e.ownerDocument.defaultView.getComputedStyle(e).overflow:"visible"}class ot{_element;_callback;static _observerInstance=null;static _elementCallbacks=null;constructor(e,t){ot._observerInstance||ot._createObserver(),this._element=e,this._callback=t,ot._addElementCallback(e,t),ot._observerInstance.observe(e)}get element(){return this._element}destroy(){ot._deleteElementCallback(this._element,this._callback)}static _addElementCallback(e,t){ot._elementCallbacks||(ot._elementCallbacks=new Map);let i=ot._elementCallbacks.get(e);i||(i=new Set,ot._elementCallbacks.set(e,i)),i.add(t)}static _deleteElementCallback(e,t){const i=ot._getElementCallbacks(e);i&&(i.delete(t),i.size||(ot._elementCallbacks.delete(e),ot._observerInstance.unobserve(e))),ot._elementCallbacks&&!ot._elementCallbacks.size&&(ot._observerInstance=null,ot._elementCallbacks=null)}static _getElementCallbacks(e){return ot._elementCallbacks?ot._elementCallbacks.get(e):null}static _createObserver(){ot._observerInstance=new e.window.ResizeObserver(e=>{for(const t of e){const e=ot._getElementCallbacks(t.target);if(e)for(const i of e)i(t)}})}}function rt(e,t){e instanceof HTMLTextAreaElement&&(e.value=t),e.innerHTML=t}function st(e){return t=>t+e}function at(e){let t=0;for(;e.previousSibling;)e=e.previousSibling,t++;return t}function lt(e,t,i){e.insertBefore(i,e.childNodes[t]||null)}function ct(e){return e&&e.nodeType===Node.COMMENT_NODE}function dt(e){return!!e&&(Ge(e)?dt(e.parentElement):!!e.getClientRects&&!!e.getClientRects().length)}function ut(e){return"function"==typeof e}function ht({element:e,target:t,positions:i,limiter:n,fitInViewport:o,viewportOffsetConfig:r}){ut(t)&&(t=t()),ut(n)&&(n=n());const s=Ke(e),a=gt(r),l=new Ze(e),c=mt(t,a);let d;if(!c||!a.getIntersection(c))return null;const u={targetRect:c,elementRect:l,positionedElementAncestor:s,viewportRect:a};if(n||o){if(n){const e=mt(n,a);e&&(u.limiterRect=e)}d=function(e,t){const{elementRect:i}=t,n=i.getArea(),o=e.map(e=>new ft(e,t)).filter(e=>!!e.name);let r=0,s=null;for(const e of o){const{limiterIntersectionArea:t,viewportIntersectionArea:i}=e;if(t===n)return e;const o=i**2+t**2;o>r&&(r=o,s=e)}return s}(i,u)}else d=new ft(i[0],u);return d}function mt(e,t){const i=new Ze(e).getVisible();return i?i.getIntersection(t):null}function gt(t){t=Object.assign({top:0,bottom:0,left:0,right:0},t);const i=new Ze(e.window);return i.top+=t.top,i.height-=t.top,i.bottom-=t.bottom,i.height-=t.bottom,i.left+=t.left,i.right-=t.right,i.width-=t.left+t.right,i}class ft{name;config;_positioningFunctionCoordinates;_options;_cachedRect;_cachedAbsoluteRect;constructor(e,t){const i=e(t.targetRect,t.elementRect,t.viewportRect,t.limiterRect);if(!i)return;const{left:n,top:o,name:r,config:s}=i;this.name=r,this.config=s,this._positioningFunctionCoordinates={left:n,top:o},this._options=t}get left(){return this._absoluteRect.left}get top(){return this._absoluteRect.top}get limiterIntersectionArea(){const e=this._options.limiterRect;return e?e.getIntersectionArea(this._rect):0}get viewportIntersectionArea(){return this._options.viewportRect.getIntersectionArea(this._rect)}get _rect(){return this._cachedRect||(this._cachedRect=this._options.elementRect.clone().moveTo(this._positioningFunctionCoordinates.left,this._positioningFunctionCoordinates.top)),this._cachedRect}get _absoluteRect(){return this._cachedAbsoluteRect||(this._cachedAbsoluteRect=this._rect.toAbsoluteRect()),this._cachedAbsoluteRect}}function pt(e){const t=e.parentNode;t&&t.removeChild(e)}function bt(){const t=e.window.visualViewport;if(!t||!r.isiOS&&!r.isSafari)return{left:0,top:0};return{left:Math.max(Math.round(t.offsetLeft),0),top:Math.max(Math.round(t.offsetTop),0)}}function kt({window:e,rect:t,alignToTop:i,forceScroll:n,viewportOffset:o}){const r=t.clone().moveBy(0,o.bottom),s=t.clone().moveBy(0,-o.top),a=new Ze(e).excludeScrollbarsAndBorders(),l=i&&n,c=[s,r].every(e=>a.contains(e));let{scrollX:d,scrollY:u}=e;const h=d,m=u;l?u-=a.top-t.top+o.top:c||(vt(s,a)?u-=a.top-t.top+o.top:_t(r,a)&&(u+=i?t.top-a.top-o.top:t.bottom-a.bottom+o.bottom)),c||(yt(t,a)?d-=a.left-t.left+o.left:At(t,a)&&(d+=t.right-a.right+o.right)),d==h&&u===m||e.scrollTo(d,u)}function wt({parent:e,getRect:t,alignToTop:i,forceScroll:n,ancestorOffset:o=0,limiterElement:r}){const s=xt(e),a=i&&n;let l,c,d;const u=r||s.document.body;for(;e!=u;)c=t(),l=new Ze(e).excludeScrollbarsAndBorders(),d=l.contains(c),a?e.scrollTop-=l.top-c.top+o:d||(vt(c,l)?e.scrollTop-=l.top-c.top+o:_t(c,l)&&(e.scrollTop+=i?c.top-l.top-o:c.bottom-l.bottom+o)),d||(yt(c,l)?e.scrollLeft-=l.left-c.left+o:At(c,l)&&(e.scrollLeft+=c.right-l.right+o)),e=e.parentNode}function _t(e,t){return e.bottom>t.bottom}function vt(e,t){return e.top<t.top}function yt(e,t){return e.left<t.left}function At(e,t){return e.right>t.right}function xt(e){return Ye(e)?e.startContainer.ownerDocument.defaultView:e.ownerDocument.defaultView}function Ct(e){if(Ye(e)){let t=e.commonAncestorContainer;return Ge(t)&&(t=t.parentNode),t}return e.parentNode}function Tt(e,t){const i=xt(e),n=new Ze(e);if(i===t)return n;{let e=i;for(;e!=t;){const t=e.frameElement,i=new Ze(t).excludeScrollbarsAndBorders();n.moveBy(i.left,i.top),e=e.parent}}return n}const Et={ctrl:"⌃",cmd:"⌘",alt:"⌥",shift:"⇧"},It={ctrl:"Ctrl+",alt:"Alt+",shift:"Shift+"},St={37:"←",38:"↑",39:"→",40:"↓",9:"⇥",33:"Page Up",34:"Page Down"},Pt=Lt(),Mt=Object.fromEntries(Object.entries(Pt).map(([e,t])=>{let i;return i=t in St?St[t]:e.charAt(0).toUpperCase()+e.slice(1),[t,i]}));function Ot(e){let t;if("string"==typeof e){if(t=Pt[e.toLowerCase()],!t)throw new A("keyboard-unknown-key",null,{key:e})}else t=e.keyCode+(e.altKey?Pt.alt:0)+(e.ctrlKey?Pt.ctrl:0)+(e.shiftKey?Pt.shift:0)+(e.metaKey?Pt.cmd:0);return t}function Rt(e){return"string"==typeof e&&(e=function(e){return e.split("+").map(e=>e.trim())}(e)),e.map(e=>"string"==typeof e?function(e){if(e.endsWith("!"))return Ot(e.slice(0,-1));const t=Ot(e);return(r.isMac||r.isiOS)&&t==Pt.ctrl?Pt.cmd:t}(e):e).reduce((e,t)=>t+e,0)}function Nt(e,t){let i=Rt(e);const n=t?"Mac"===t:r.isMac||r.isiOS;return Object.entries(n?Et:It).reduce((e,[t,n])=>(0!=(i&Pt[t])&&(i&=~Pt[t],e+=n),e),"")+(i?Mt[i]:"")}function Vt(e,t){const i="ltr"===t;switch(e){case Pt.arrowleft:return i?"left":"right";case Pt.arrowright:return i?"right":"left";case Pt.arrowup:return"up";case Pt.arrowdown:return"down"}}function Lt(){const e={pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,backspace:8,delete:46,enter:13,space:32,esc:27,tab:9,ctrl:1114112,shift:2228224,alt:4456448,cmd:8912896};for(let t=65;t<=90;t++){e[String.fromCharCode(t).toLowerCase()]=t}for(let t=48;t<=57;t++)e[t-48]=t;for(let t=112;t<=123;t++)e["f"+(t-111)]=t;return Object.assign(e,{"'":222,",":108,"-":109,".":110,"/":111,";":186,"=":187,"[":219,"\\":220,"]":221,"`":223}),e}function Dt(e){return Array.isArray(e)?e:[e]}function Bt(e){return Ne(e)}function zt(e){return"__proto__"===e}function Ft(e){return null!==e&&"object"==typeof e&&"[object Arguments]"===ae(e)}function jt(e){return Me(e)}function Ut(e,t,i,n){if(Pe(e)&&(e=Object(e)),null==t||"object"!=typeof t)return e;if(n.has(t))return function(e){if(Pe(e))return e;if(Array.isArray(e)||Me(e)||e instanceof ArrayBuffer||"undefined"!=typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer)return e.slice(0);const t=Object.getPrototypeOf(e),i=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new i(e);if(e instanceof RegExp){const t=new i(e);return t.lastIndex=e.lastIndex,t}if(e instanceof DataView)return new i(e.buffer.slice(0));if(e instanceof Error){const t=new i(e.message);return t.stack=e.stack,t.name=e.name,t.cause=e.cause,t}if("undefined"!=typeof File&&e instanceof File)return new i([e],e.name,{type:e.type,lastModified:e.lastModified});if("object"==typeof e){const i=Object.create(t);return Object.assign(i,e)}return e}(n.get(t));if(n.set(t,e),Array.isArray(t)){t=t.slice();for(let e=0;e<t.length;e++)t[e]=t[e]??void 0}const o=[...Object.keys(t),...se(t)];for(let r=0;r<o.length;r++){const s=o[r];if(zt(s))continue;let a=t[s],l=e[s];if(Ft(a)&&(a={...a}),Ft(l)&&(l={...l}),"undefined"!=typeof Buffer&&Buffer.isBuffer(a)&&(a=Bt(a)),Array.isArray(a))if("object"==typeof l&&null!=l){const e=[],t=Reflect.ownKeys(l);for(let i=0;i<t.length;i++){const n=t[i];e[n]=l[n]}l=e}else l=[];const c=i(l,a,s,e,t,n);null!=c?e[s]=c:Array.isArray(a)||Ve(l)&&Ve(a)?e[s]=Ut(l,a,i,n):null==l&&re(a)?e[s]=Ut({},a,i,n):null==l&&jt(a)?e[s]=Bt(a):void 0!==l&&void 0===a||(e[s]=a)}return e}function Ht(){}function Wt(e,...t){return function(e,...t){const i=t.slice(0,-1),n=t[t.length-1];let o=e;for(let e=0;e<i.length;e++)o=Ut(o,i[e],n,new Map);return o}(e,...t,Ht)}function $t(t,i,n=1,o){if("number"!=typeof n)throw new A("translation-service-quantity-not-a-number",null,{quantity:n});const r=o||e.window.CKEDITOR_TRANSLATIONS,s=function(e){return Object.keys(e).length}(r);1===s&&(t=Object.keys(r)[0]);const a=i.id||i.string;if(0===s||!function(e,t,i){return!!i[e]&&!!i[e].dictionary[t]}(t,a,r))return 1!==n?i.plural:i.string;const l=r[t].dictionary,c=r[t].getPluralForm||(e=>1===e?0:1),d=l[a];if("string"==typeof d)return d;return d[Number(c(n))]}e.window.CKEDITOR_TRANSLATIONS||(e.window.CKEDITOR_TRANSLATIONS={});const qt=["ar","ara","dv","div","fa","per","fas","he","heb","ku","kur","ug","uig","ur","urd"];function Kt(e){return qt.includes(e)?"rtl":"ltr"}class Gt{uiLanguage;uiLanguageDirection;contentLanguage;contentLanguageDirection;t;translations;constructor({uiLanguage:e="en",contentLanguage:t,translations:i}={}){this.uiLanguage=e,this.contentLanguage=t||this.uiLanguage,this.uiLanguageDirection=Kt(this.uiLanguage),this.contentLanguageDirection=Kt(this.contentLanguage),this.translations=function(e){return Array.isArray(e)?e.reduce((e,t)=>Wt(e,t)):e}(i),this.t=(e,t)=>this._t(e,t)}_t(e,t=[]){t=Dt(t),"string"==typeof e&&(e={string:e});const i=!!e.plural?t[0]:1;return function(e,t){return e.replace(/%(\d+)/g,(e,i)=>i<t.length?t[i]:e)}($t(this.uiLanguage,e,i,this.translations),t)}}class Yt extends(O()){_items;_itemMap;_idProperty;_bindToCollection;_bindToExternalToInternalMap;_bindToInternalToExternalMap;_skippedIndexesFromExternal;constructor(e={},t={}){super();const i=ie(e);if(i||(t=e),this._items=[],this._itemMap=new Map,this._idProperty=t.idProperty||"id",this._bindToExternalToInternalMap=new WeakMap,this._bindToInternalToExternalMap=new WeakMap,this._skippedIndexesFromExternal=[],i)for(const t of e)this._items.push(t),this._itemMap.set(this._getItemIdBeforeAdding(t),t)}get length(){return this._items.length}get first(){return this._items[0]||null}get last(){return this._items[this.length-1]||null}add(e,t){return this.addMany([e],t)}addMany(e,t){if(void 0===t)t=this._items.length;else if(t>this._items.length||t<0)throw new A("collection-add-item-invalid-index",this);let i=0;for(const n of e){const e=this._getItemIdBeforeAdding(n),o=t+i;this._items.splice(o,0,n),this._itemMap.set(e,n),this.fire("add",n,o),i++}return this.fire("change",{added:e,removed:[],index:t}),this}get(e){let t;if("string"==typeof e)t=this._itemMap.get(e);else{if("number"!=typeof e)throw new A("collection-get-invalid-arg",this);t=this._items[e]}return t||null}has(e){if("string"==typeof e)return this._itemMap.has(e);{const t=e[this._idProperty];return t&&this._itemMap.has(t)}}getIndex(e){let t;return t="string"==typeof e?this._itemMap.get(e):e,t?this._items.indexOf(t):-1}remove(e){const[t,i]=this._remove(e);return this.fire("change",{added:[],removed:[t],index:i}),t}map(e,t){return this._items.map(e,t)}forEach(e,t){this._items.forEach(e,t)}find(e,t){return this._items.find(e,t)}filter(e,t){return this._items.filter(e,t)}clear(){this._bindToCollection&&(this.stopListening(this._bindToCollection),this._bindToCollection=null);const e=Array.from(this._items);for(;this.length;)this._remove(0);this.fire("change",{added:[],removed:e,index:0})}bindTo(e){if(this._bindToCollection)throw new A("collection-bind-to-rebind",this);return this._bindToCollection=e,{as:e=>{this._setUpBindToBinding(t=>new e(t))},using:e=>{"function"==typeof e?this._setUpBindToBinding(e):this._setUpBindToBinding(t=>t[e])}}}_setUpBindToBinding(e){const t=this._bindToCollection,i=(i,n,o)=>{const r=t._bindToCollection==this,s=t._bindToInternalToExternalMap.get(n);if(r&&s)this._bindToExternalToInternalMap.set(n,s),this._bindToInternalToExternalMap.set(s,n);else{const i=e(n);if(!i)return void this._skippedIndexesFromExternal.push(o);let r=o;for(const e of this._skippedIndexesFromExternal)o>e&&r--;for(const e of t._skippedIndexesFromExternal)r>=e&&r++;this._bindToExternalToInternalMap.set(n,i),this._bindToInternalToExternalMap.set(i,n),this.add(i,r);for(let e=0;e<t._skippedIndexesFromExternal.length;e++)r<=t._skippedIndexesFromExternal[e]&&t._skippedIndexesFromExternal[e]++}};for(const e of t)i(0,e,t.getIndex(e));this.listenTo(t,"add",i),this.listenTo(t,"remove",(e,t,i)=>{const n=this._bindToExternalToInternalMap.get(t);n&&this.remove(n),this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce((e,t)=>(i<t&&e.push(t-1),i>t&&e.push(t),e),[])})}_getItemIdBeforeAdding(e){const t=this._idProperty;let i;if(t in e){if(i=e[t],"string"!=typeof i)throw new A("collection-add-invalid-id",this);if(this.get(i))throw new A("collection-add-item-already-exists",this)}else e[t]=i=_();return i}_remove(e){let t,i,n,o=!1;const r=this._idProperty;if("string"==typeof e?(i=e,n=this._itemMap.get(i),o=!n,n&&(t=this._items.indexOf(n))):"number"==typeof e?(t=e,n=this._items[t],o=!n,n&&(i=n[r])):(n=e,i=n[r],t=this._items.indexOf(n),o=-1==t||!this._itemMap.get(i)),o)throw new A("collection-remove-404",this);this._items.splice(t,1),this._itemMap.delete(i);const s=this._bindToInternalToExternalMap.get(n);return this._bindToInternalToExternalMap.delete(n),this._bindToExternalToInternalMap.delete(s),this.fire("remove",n,t),[n,t]}[Symbol.iterator](){return this._items[Symbol.iterator]()}}function Jt(e){const t=e.next();return t.done?null:t.value}class Qt extends(He(K())){_elements=new Set;_externalViews=new Set;_blurTimeout=null;constructor(){super(),this.set("isFocused",!1),this.set("focusedElement",null)}get elements(){return Array.from(this._elements.values())}get externalViews(){return Array.from(this._externalViews.values())}add(e){if(Xt(e))this._addElement(e);else if(Zt(e))this._addView(e);else{if(!e.element)throw new A("focustracker-add-view-missing-element",{focusTracker:this,view:e});this._addElement(e.element)}}remove(e){Xt(e)?this._removeElement(e):Zt(e)?this._removeView(e):this._removeElement(e.element)}_addElement(e){if(this._elements.has(e))throw new A("focustracker-add-element-already-exist",this);this.listenTo(e,"focus",()=>{const t=this.externalViews.find(t=>function(e,t){if(ei(e,t))return!0;return!!t.focusTracker.externalViews.find(t=>ei(e,t))}(e,t));t?this._focus(t.element):this._focus(e)},{useCapture:!0}),this.listenTo(e,"blur",()=>{this._blur()},{useCapture:!0}),this._elements.add(e)}_removeElement(e){this._elements.has(e)&&(this.stopListening(e),this._elements.delete(e)),e===this.focusedElement&&this._blur()}_addView(e){e.element&&this._addElement(e.element),this.listenTo(e.focusTracker,"change:focusedElement",()=>{e.focusTracker.focusedElement?e.element&&this._focus(e.element):this._blur()}),this._externalViews.add(e)}_removeView(e){e.element&&this._removeElement(e.element),this.stopListening(e.focusTracker),this._externalViews.delete(e)}destroy(){this.stopListening(),this._elements.clear(),this._externalViews.clear(),this.isFocused=!1,this.focusedElement=null}_focus(e){this._clearBlurTimeout(),this.focusedElement=e,this.isFocused=!0}_blur(){if(this.elements.find(e=>e.contains(document.activeElement)))return;this.externalViews.find(e=>e.focusTracker.isFocused&&!e.focusTracker._blurTimeout)||(this._clearBlurTimeout(),this._blurTimeout=setTimeout(()=>{this.focusedElement=null,this.isFocused=!1},0))}_clearBlurTimeout(){clearTimeout(this._blurTimeout),this._blurTimeout=null}}function Zt(e){return"focusTracker"in e&&e.focusTracker instanceof Qt}function Xt(e){return Le(e)}function ei(e,t){return!!t.element&&t.element.contains(document.activeElement)&&e.contains(t.element)}class ti{_listener;constructor(){this._listener=new(He())}listenTo(e){this._listener.listenTo(e,"keydown",(e,t)=>{this._listener.fire("_keydown:"+Ot(t),t)})}set(e,t,i={}){const n=Rt(e),o=i.priority;this._listener.listenTo(this._listener,"_keydown:"+n,(e,n)=>{i.filter&&!i.filter(n)||(t(n,()=>{n.preventDefault(),n.stopPropagation(),e.stop()}),e.return=!0)},{priority:o})}press(e){return!!this._listener.fire("_keydown:"+Ot(e),e)}stopListening(e){this._listener.stopListening(e)}destroy(){this.stopListening()}}function ii(e){return ie(e)?new Map(e):function(e){const t=new Map;for(const i in e)t.set(i,e[i]);return t}(e)}function ni(e,t,i){const n=e.length,o=t.length;for(let t=n-1;t>=i;t--)e[t+o]=e[t];for(let n=0;n<o;n++)e[i+n]=t[n]}function oi(e,t){let i;function n(...o){n.cancel(),i=setTimeout(()=>e(...o),t)}return n.cancel=()=>{clearTimeout(i)},n}function ri(e){try{if(!e.startsWith("ey"))return null;const t=atob(e.replace(/-/g,"+").replace(/_/g,"/"));return JSON.parse(t)}catch{return null}}function si(e){const t=[{name:"address",isVoid:!1},{name:"article",isVoid:!1},{name:"aside",isVoid:!1},{name:"blockquote",isVoid:!1},{name:"details",isVoid:!1},{name:"dialog",isVoid:!1},{name:"dd",isVoid:!1},{name:"div",isVoid:!1},{name:"dl",isVoid:!1},{name:"dt",isVoid:!1},{name:"fieldset",isVoid:!1},{name:"figcaption",isVoid:!1},{name:"figure",isVoid:!1},{name:"footer",isVoid:!1},{name:"form",isVoid:!1},{name:"h1",isVoid:!1},{name:"h2",isVoid:!1},{name:"h3",isVoid:!1},{name:"h4",isVoid:!1},{name:"h5",isVoid:!1},{name:"h6",isVoid:!1},{name:"header",isVoid:!1},{name:"hgroup",isVoid:!1},{name:"hr",isVoid:!0},{name:"li",isVoid:!1},{name:"main",isVoid:!1},{name:"nav",isVoid:!1},{name:"ol",isVoid:!1},{name:"p",isVoid:!1},{name:"section",isVoid:!1},{name:"table",isVoid:!1},{name:"tbody",isVoid:!1},{name:"td",isVoid:!1},{name:"th",isVoid:!1},{name:"thead",isVoid:!1},{name:"tr",isVoid:!1},{name:"ul",isVoid:!1}],i=t.map(e=>e.name).join("|"),n=e.replace(new RegExp(`</?(${i})( .*?)?>`,"g"),"\n$&\n").replace(/<br[^>]*>/g,"$&\n").split("\n");let o=0,r=!1;return n.map(e=>(r=function(e,t){const i=/<pre( .*?)?>/.test(e),n=/<\/pre>/.test(e);return(!i||!n)&&(i?"first":n?"last":("first"===t||"middle"===t)&&"middle")}(e,r),e.length||r?function(e,t){return t.some(t=>!t.isVoid&&!!new RegExp(`<${t.name}( .*?)?>`).test(e))}(e,t)?ai(e,o++):function(e,t){return t.some(t=>new RegExp(`</${t.name}>`).test(e))}(e,t)?ai(e,--o):ai(e,"middle"===r||"last"===r?0:o):"")).join("").trimEnd()}function ai(e,t,i=" "){return`${i.repeat(Math.max(0,t))}${e}\n`}function li(e,t){return!!(i=e.charAt(t-1))&&1==i.length&&/[\ud800-\udbff]/.test(i)&&function(e){return!!e&&1==e.length&&/[\udc00-\udfff]/.test(e)}(e.charAt(t));var i}function ci(e,t){return!!(i=e.charAt(t))&&1==i.length&&/[\u0300-\u036f\u1ab0-\u1aff\u1dc0-\u1dff\u20d0-\u20ff\ufe20-\ufe2f]/.test(i);var i}const di=hi();function ui(e,t){const i=String(e).matchAll(di);return Array.from(i).some(e=>e.index<t&&t<e.index+e[0].length)}function hi(){const e=/\p{Regional_Indicator}{2}/u.source,t="(?:"+[/\p{Emoji}[\u{E0020}-\u{E007E}]+\u{E007F}/u,/\p{Emoji}\u{FE0F}?\u{20E3}/u,/\p{Emoji}\u{FE0F}/u,/(?=\p{General_Category=Other_Symbol})\p{Emoji}\p{Emoji_Modifier}*/u].map(e=>e.source).join("|")+")";return new RegExp(`${e}|${t}(?:${t})*`,"ug")}function mi(e){if(!e)return null;const t=function(e){const t=e.split(".");if(3!=t.length)return null;return t[1]}(e);return t?ri(t):null}class gi{editor;_components=new Map;constructor(e){this.editor=e}*names(){for(const e of this._components.values())yield e.originalName}add(e,t){this._components.set(fi(e),{callback:t,originalName:e})}create(e){if(!this.has(e))throw new A("componentfactory-item-missing",this,{name:e});return this._components.get(fi(e)).callback(this.editor.locale)}has(e){return this._components.has(fi(e))}}function fi(e){return String(e).toLowerCase()}class pi extends Yt{_parentElement;constructor(e=[]){super(e,{idProperty:"viewUid"}),this.on("add",(e,t,i)=>{this._renderViewIntoCollectionParent(t,i)}),this.on("remove",(e,t)=>{t.element&&this._parentElement&&t.element.remove()}),this._parentElement=null}destroy(){this.map(e=>e.destroy())}setParent(e){this._parentElement=e;for(const e of this)this._renderViewIntoCollectionParent(e)}delegate(...e){if(!e.length||!e.every(e=>"string"==typeof e))throw new A("ui-viewcollection-delegate-wrong-events",this);return{to:t=>{for(const i of this)for(const n of e)i.delegate(n).to(t);this.on("add",(i,n)=>{for(const i of e)n.delegate(i).to(t)}),this.on("remove",(i,n)=>{for(const i of e)n.stopDelegating(i,t)})}}}_renderViewIntoCollectionParent(e,t){e.isRendered||e.render(),e.element&&this._parentElement&&this._parentElement.insertBefore(e.element,this._parentElement.children[t])}remove(e){return super.remove(e)}}class bi extends(O()){ns;tag;text;attributes;children;eventListeners;_isRendered;_revertData;constructor(e){super(),Object.assign(this,Ii(Ei(e))),this._isRendered=!1,this._revertData=null}render(){const e=this._renderNode({intoFragment:!0});return this._isRendered=!0,e}apply(e){return this._revertData={children:[],bindings:[],attributes:{}},this._renderNode({node:e,intoFragment:!1,isApplying:!0,revertData:this._revertData}),e}revert(e){if(!this._revertData)throw new A("ui-template-revert-not-applied",[this,e]);this._revertTemplateFromNode(e,this._revertData)}*getViews(){yield*function*e(t){if(t.children)for(const i of t.children)Ni(i)?yield i:Vi(i)&&(yield*e(i))}(this)}static bind(e,t){return{to:(i,n)=>new wi({eventNameOrFunction:i,attribute:i,observable:e,emitter:t,callback:n}),if:(i,n,o)=>new _i({observable:e,emitter:t,attribute:i,valueIfTrue:n,callback:o})}}static extend(e,t){if(e._isRendered)throw new A("template-extend-render",[this,e]);Oi(e,Ii(Ei(t)))}_renderNode(e){let t;if(t=e.node?this.tag&&this.text:this.tag?this.text:!this.text,t)throw new A("ui-template-wrong-syntax",this);return this.text?this._renderText(e):this._renderElement(e)}_renderElement(e){let t=e.node;return t||(t=e.node=document.createElementNS(this.ns||"http://www.w3.org/1999/xhtml",this.tag)),this._renderAttributes(e),this._renderElementChildren(e),this._setUpListeners(e),t}_renderText(e){let t=e.node;return t?e.revertData.text=t.textContent:t=e.node=document.createTextNode(""),vi(this.text)?this._bindToObservable({schema:this.text,updater:xi(t),data:e}):t.textContent=this.text.join(""),t}_renderAttributes(e){if(!this.attributes)return;const t=e.node,i=e.revertData;for(const n in this.attributes){const o=t.getAttribute(n),r=this.attributes[n];i&&(i.attributes[n]=o);const s=Di(r)?r[0].ns:null;if(vi(r)){const a=Di(r)?r[0].value:r;i&&zi(n)&&a.unshift(o),this._bindToObservable({schema:a,updater:Ci(t,n,s),data:e})}else if("style"==n&&"string"!=typeof r[0])this._renderStyleAttribute(r[0],e);else{i&&o&&zi(n)&&r.unshift(o);const e=r.map(e=>e&&e.value||e).reduce((e,t)=>e.concat(t),[]).reduce(Pi,"");Ri(e)||t.setAttributeNS(s,n,e)}}}_renderStyleAttribute(e,t){const i=t.node;for(const n in e){const o=e[n];vi(o)?this._bindToObservable({schema:[o],updater:Ti(i,n),data:t}):yi(n)?i.style.setProperty(n,o):i.style[n]=o}}_renderElementChildren(e){const t=e.node,i=e.intoFragment?document.createDocumentFragment():t,n=e.isApplying;let o=0;for(const r of this.children)if(Li(r)){if(!n){r.setParent(t);for(const e of r)i.appendChild(e.element)}}else if(Ni(r))n||(r.isRendered||r.render(),i.appendChild(r.element));else if(Fe(r))i.appendChild(r);else if(n){const t=e.revertData,n=Bi();t.children.push(n),r._renderNode({intoFragment:!1,node:i.childNodes[o++],isApplying:!0,revertData:n})}else i.appendChild(r.render());e.intoFragment&&t.appendChild(i)}_setUpListeners(e){if(this.eventListeners)for(const t in this.eventListeners){const i=this.eventListeners[t].map(i=>{const[n,o]=t.split("@");return i.activateDomEventListener(n,o,e)});e.revertData&&e.revertData.bindings.push(i)}}_bindToObservable({schema:e,updater:t,data:i}){const n=i.revertData;Ai(e,t,i);const o=e.filter(e=>!Ri(e)).filter(e=>e.observable).map(n=>n.activateAttributeListener(e,t,i));n&&n.bindings.push(o)}_revertTemplateFromNode(e,t){for(const e of t.bindings)for(const t of e)t();if(t.text)return void(e.textContent=t.text);const i=e;for(const e in t.attributes){const n=t.attributes[e];null===n?i.removeAttribute(e):i.setAttribute(e,n)}for(let e=0;e<t.children.length;++e)this._revertTemplateFromNode(i.childNodes[e],t.children[e])}}class ki{attribute;observable;emitter;callback;constructor(e){this.attribute=e.attribute,this.observable=e.observable,this.emitter=e.emitter,this.callback=e.callback}getValue(e){const t=this.observable[this.attribute];return this.callback?this.callback(t,e):t}activateAttributeListener(e,t,i){const n=()=>Ai(e,t,i);return this.emitter.listenTo(this.observable,`change:${this.attribute}`,n),()=>{this.emitter.stopListening(this.observable,`change:${this.attribute}`,n)}}}class wi extends ki{eventNameOrFunction;constructor(e){super(e),this.eventNameOrFunction=e.eventNameOrFunction}activateDomEventListener(e,t,i){const n=(e,i)=>{t&&!i.target.matches(t)||("function"==typeof this.eventNameOrFunction?this.eventNameOrFunction(i):this.observable.fire(this.eventNameOrFunction,i))};return this.emitter.listenTo(i.node,e,n),()=>{this.emitter.stopListening(i.node,e,n)}}}class _i extends ki{valueIfTrue;constructor(e){super(e),this.valueIfTrue=e.valueIfTrue}getValue(e){return!Ri(super.getValue(e))&&(this.valueIfTrue||!0)}}function vi(e){return!!e&&(e.value&&(e=e.value),Array.isArray(e)?e.some(vi):e instanceof ki)}function yi(e){return/^--[a-zA-Z_-][\w-]*$/.test(e)}function Ai(e,t,{node:i}){const n=function(e,t){return e.map(e=>e instanceof ki?e.getValue(t):e)}(e,i);let o;o=1==e.length&&e[0]instanceof _i?n[0]:n.reduce(Pi,""),Ri(o)?t.remove():t.set(o)}function xi(e){return{set(t){e.textContent=t},remove(){e.textContent=""}}}function Ci(e,t,i){return{set(n){e.setAttributeNS(i,t,n)},remove(){e.removeAttributeNS(i,t)}}}function Ti(e,t){return{set(i){yi(t)?e.style.setProperty(t,i):e.style[t]=i},remove(){yi(t)?e.style.removeProperty(t):e.style[t]=null}}}function Ei(e){return Ne(e,e=>{if(e&&(e instanceof ki||Vi(e)||Ni(e)||Li(e)))return e})}function Ii(e){if("string"==typeof e?e=function(e){return{text:[e]}}(e):e.text&&function(e){e.text=Dt(e.text)}(e),e.on&&(e.eventListeners=function(e){for(const t in e)Si(e,t);return e}(e.on),delete e.on),!e.text){e.attributes&&function(e){for(const t in e)e[t].value&&(e[t].value=Dt(e[t].value)),Si(e,t)}(e.attributes);const t=[];if(e.children)if(Li(e.children))t.push(e.children);else for(const i of e.children)Vi(i)||Ni(i)||Fe(i)?t.push(i):t.push(new bi(i));e.children=t}return e}function Si(e,t){e[t]=Dt(e[t])}function Pi(e,t){return Ri(t)?e:Ri(e)?t:`${e} ${t}`}function Mi(e,t){for(const i in t)e[i]?e[i].push(...t[i]):e[i]=t[i]}function Oi(e,t){if(t.attributes&&(e.attributes||(e.attributes={}),Mi(e.attributes,t.attributes)),t.eventListeners&&(e.eventListeners||(e.eventListeners={}),Mi(e.eventListeners,t.eventListeners)),t.text&&e.text.push(...t.text),t.children&&t.children.length){if(e.children.length!=t.children.length)throw new A("ui-template-extend-children-mismatch",e);let i=0;for(const n of t.children)Oi(e.children[i++],n)}}function Ri(e){return!e&&0!==e}function Ni(e){return e instanceof Zi}function Vi(e){return e instanceof bi}function Li(e){return e instanceof pi}function Di(e){return F(e[0])&&e[0].ns}function Bi(){return{children:[],bindings:[],attributes:{}}}function zi(e){return"class"==e||"style"==e}var Fi=i(5072),ji=i.n(Fi),Ui=i(4284),Hi=i.n(Ui),Wi=i(7659),$i=i.n(Wi),qi=i(4868),Ki=i.n(qi),Gi=i(540),Yi=i.n(Gi),Ji=i(601),Qi={attributes:{"data-cke":!0}};Qi.setAttributes=Ki(),Qi.insert=$i().bind(null,"head"),Qi.domAPI=Hi(),Qi.insertStyleElement=Yi();ji()(Ji.A,Qi);Ji.A&&Ji.A.locals&&Ji.A.locals;class Zi extends(He(K())){element;isRendered;locale;t;template;_viewCollections;_unboundChildren;_bindTemplate;constructor(e){super(),this.element=null,this.isRendered=!1,this.locale=e,this.t=e&&e.t,this._viewCollections=new Yt,this._unboundChildren=this.createCollection(),this._viewCollections.on("add",(t,i)=>{i.locale=e,i.t=e&&e.t}),this.decorate("render")}get bindTemplate(){return this._bindTemplate?this._bindTemplate:this._bindTemplate=bi.bind(this,this)}createCollection(e){const t=new pi(e);return this._viewCollections.add(t),t}registerChild(e){ie(e)||(e=[e]);for(const t of e)this._unboundChildren.add(t)}deregisterChild(e){ie(e)||(e=[e]);for(const t of e)this._unboundChildren.remove(t)}setTemplate(e){this.template=new bi(e)}extendTemplate(e){bi.extend(this.template,e)}render(){if(this.isRendered)throw new A("ui-view-render-already-rendered",this);this.template&&(this.element=this.template.render(),this.registerChild(this.template.getViews())),this.isRendered=!0}destroy(){this.stopListening(),this._viewCollections.map(e=>e.destroy()),this.template&&this.template._revertData&&this.template.revert(this.element)}}var Xi=i(5615),en={attributes:{"data-cke":!0}};en.setAttributes=Ki(),en.insert=$i().bind(null,"head"),en.domAPI=Hi(),en.insertStyleElement=Yi();ji()(Xi.A,en);Xi.A&&Xi.A.locals&&Xi.A.locals;const tn=st("px"),nn={top:-99999,left:-99999,name:"arrowless",config:{withArrow:!1}};class on extends Zi{content;_pinWhenIsVisibleCallback;_resizeObserver;constructor(e){super(e);const t=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",void 0),this._pinWhenIsVisibleCallback=null,this._resizeObserver=null,this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-panel",t.to("position",e=>`ck-balloon-panel_${e}`),t.if("isVisible","ck-balloon-panel_visible"),t.if("withArrow","ck-balloon-panel_with-arrow"),t.to("class")],style:{top:t.to("top",tn),left:t.to("left",tn)}},children:this.content})}destroy(){this.hide(),super.destroy()}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(t){const i=rn(t.target);if(i&&!dt(i))return!1;this.show();const n=on.defaultPositions,o=Object.assign({},{element:this.element,positions:[n.southArrowNorth,n.southArrowNorthMiddleWest,n.southArrowNorthMiddleEast,n.southArrowNorthWest,n.southArrowNorthEast,n.northArrowSouth,n.northArrowSouthMiddleWest,n.northArrowSouthMiddleEast,n.northArrowSouthWest,n.northArrowSouthEast,n.viewportStickyNorth],limiter:e.document.body,fitInViewport:!0},t),r=on._getOptimalPosition(o)||nn,s=parseInt(r.left),a=parseInt(r.top),l=r.name,c=r.config||{},{withArrow:d=!0}=c;return this.top=a,this.left=s,this.position=l,this.withArrow=d,!0}pin(e){this.unpin(),this._startPinning(e)&&(this._pinWhenIsVisibleCallback=()=>{this.isVisible?this._startPinning(e):this._stopPinning()},this.listenTo(this,"change:isVisible",this._pinWhenIsVisibleCallback))}unpin(){this._pinWhenIsVisibleCallback&&(this._stopPinning(),this.stopListening(this,"change:isVisible",this._pinWhenIsVisibleCallback),this._pinWhenIsVisibleCallback=null,this.hide())}_startPinning(t){if(!this.attachTo(t))return!1;let i=rn(t.target);const n=t.limiter?rn(t.limiter):e.document.body;if(this.listenTo(e.document,"scroll",(e,o)=>{const r=o.target,s=i&&r.contains(i),a=n&&r.contains(n);!s&&!a&&i&&n||this.attachTo(t)},{useCapture:!0}),this.listenTo(e.window,"resize",()=>{this.attachTo(t)}),!this._resizeObserver&&(i&&Ge(i)&&(i=i.parentElement),i)){const e=()=>{dt(i)||this.unpin()};this._resizeObserver=new ot(i,e)}return!0}_stopPinning(){this.stopListening(e.document,"scroll"),this.stopListening(e.window,"resize"),this._resizeObserver&&(this._resizeObserver.destroy(),this._resizeObserver=null)}static generatePositions(t={}){const{sideOffset:i=on.arrowSideOffset,heightOffset:n=on.arrowHeightOffset,stickyVerticalOffset:o=on.stickyVerticalOffset,config:r}=t;return{northWestArrowSouthWest:(e,t)=>({top:s(e,t),left:e.left-i,name:"arrow_sw",...r&&{config:r}}),northWestArrowSouthMiddleWest:(e,t)=>({top:s(e,t),left:e.left-.25*t.width-i,name:"arrow_smw",...r&&{config:r}}),northWestArrowSouth:(e,t)=>({top:s(e,t),left:e.left-t.width/2,name:"arrow_s",...r&&{config:r}}),northWestArrowSouthMiddleEast:(e,t)=>({top:s(e,t),left:e.left-.75*t.width+i,name:"arrow_sme",...r&&{config:r}}),northWestArrowSouthEast:(e,t)=>({top:s(e,t),left:e.left-t.width+i,name:"arrow_se",...r&&{config:r}}),northArrowSouthWest:(e,t)=>({top:s(e,t),left:e.left+e.width/2-i,name:"arrow_sw",...r&&{config:r}}),northArrowSouthMiddleWest:(e,t)=>({top:s(e,t),left:e.left+e.width/2-.25*t.width-i,name:"arrow_smw",...r&&{config:r}}),northArrowSouth:(e,t)=>({top:s(e,t),left:e.left+e.width/2-t.width/2,name:"arrow_s",...r&&{config:r}}),northArrowSouthMiddleEast:(e,t)=>({top:s(e,t),left:e.left+e.width/2-.75*t.width+i,name:"arrow_sme",...r&&{config:r}}),northArrowSouthEast:(e,t)=>({top:s(e,t),left:e.left+e.width/2-t.width+i,name:"arrow_se",...r&&{config:r}}),northEastArrowSouthWest:(e,t)=>({top:s(e,t),left:e.right-i,name:"arrow_sw",...r&&{config:r}}),northEastArrowSouthMiddleWest:(e,t)=>({top:s(e,t),left:e.right-.25*t.width-i,name:"arrow_smw",...r&&{config:r}}),northEastArrowSouth:(e,t)=>({top:s(e,t),left:e.right-t.width/2,name:"arrow_s",...r&&{config:r}}),northEastArrowSouthMiddleEast:(e,t)=>({top:s(e,t),left:e.right-.75*t.width+i,name:"arrow_sme",...r&&{config:r}}),northEastArrowSouthEast:(e,t)=>({top:s(e,t),left:e.right-t.width+i,name:"arrow_se",...r&&{config:r}}),southWestArrowNorthWest:e=>({top:a(e),left:e.left-i,name:"arrow_nw",...r&&{config:r}}),southWestArrowNorthMiddleWest:(e,t)=>({top:a(e),left:e.left-.25*t.width-i,name:"arrow_nmw",...r&&{config:r}}),southWestArrowNorth:(e,t)=>({top:a(e),left:e.left-t.width/2,name:"arrow_n",...r&&{config:r}}),southWestArrowNorthMiddleEast:(e,t)=>({top:a(e),left:e.left-.75*t.width+i,name:"arrow_nme",...r&&{config:r}}),southWestArrowNorthEast:(e,t)=>({top:a(e),left:e.left-t.width+i,name:"arrow_ne",...r&&{config:r}}),southArrowNorthWest:e=>({top:a(e),left:e.left+e.width/2-i,name:"arrow_nw",...r&&{config:r}}),southArrowNorthMiddleWest:(e,t)=>({top:a(e),left:e.left+e.width/2-.25*t.width-i,name:"arrow_nmw",...r&&{config:r}}),southArrowNorth:(e,t)=>({top:a(e),left:e.left+e.width/2-t.width/2,name:"arrow_n",...r&&{config:r}}),southArrowNorthMiddleEast:(e,t)=>({top:a(e),left:e.left+e.width/2-.75*t.width+i,name:"arrow_nme",...r&&{config:r}}),southArrowNorthEast:(e,t)=>({top:a(e),left:e.left+e.width/2-t.width+i,name:"arrow_ne",...r&&{config:r}}),southEastArrowNorthWest:e=>({top:a(e),left:e.right-i,name:"arrow_nw",...r&&{config:r}}),southEastArrowNorthMiddleWest:(e,t)=>({top:a(e),left:e.right-.25*t.width-i,name:"arrow_nmw",...r&&{config:r}}),southEastArrowNorth:(e,t)=>({top:a(e),left:e.right-t.width/2,name:"arrow_n",...r&&{config:r}}),southEastArrowNorthMiddleEast:(e,t)=>({top:a(e),left:e.right-.75*t.width+i,name:"arrow_nme",...r&&{config:r}}),southEastArrowNorthEast:(e,t)=>({top:a(e),left:e.right-t.width+i,name:"arrow_ne",...r&&{config:r}}),westArrowEast:(e,t)=>({top:e.top+e.height/2-t.height/2,left:e.left-t.width-n,name:"arrow_e",...r&&{config:r}}),eastArrowWest:(e,t)=>({top:e.top+e.height/2-t.height/2,left:e.right+n,name:"arrow_w",...r&&{config:r}}),viewportStickyNorth:(t,i,n)=>{const s=new Ze(e.document.body).getIntersection(n.getVisible());if(!s)return null;const a=s.getVisible();return t.getIntersection(a)&&a.top-t.top-o<i.height&&a.bottom-t.bottom<i.height?{top:a.top+o,left:t.left+t.width/2-i.width/2,name:"arrowless",config:{withArrow:!1,...r}}:null}};function s(e,t){return e.top-t.height-n}function a(e){return e.bottom+n}}static arrowSideOffset=25;static arrowHeightOffset=10;static stickyVerticalOffset=20;static _getOptimalPosition=ht;static defaultPositions=on.generatePositions()}function rn(e){return Le(e)?e:Ye(e)?e.commonAncestorContainer:"function"==typeof e?rn(e()):null}function sn(e,t,{signal:i,edges:n}={}){let o,r=null;const s=null!=n&&n.includes("leading"),a=null==n||n.includes("trailing"),l=()=>{null!==r&&(e.apply(o,r),o=void 0,r=null)};let c=null;const d=()=>{null!=c&&clearTimeout(c),c=setTimeout(()=>{c=null,a&&l(),h()},t)},u=()=>{null!==c&&(clearTimeout(c),c=null)},h=()=>{u(),o=void 0,r=null},m=function(...e){if(i?.aborted)return;o=this,r=e;const t=null==c;d(),s&&t&&l()};return m.schedule=d,m.cancel=h,m.flush=()=>{u(),l()},i?.addEventListener("abort",h,{once:!0}),m}function an(e,t=0,i={}){"object"!=typeof i&&(i={});const{leading:n=!1,trailing:o=!0,maxWait:r}=i,s=Array(2);let a;n&&(s[0]="leading"),o&&(s[1]="trailing");let l=null;const c=sn(function(...t){a=e.apply(this,t),l=null},t,{edges:s}),d=function(...t){return null!=r&&(null===l&&(l=Date.now()),Date.now()-l>=r)?(a=e.apply(this,t),l=Date.now(),c.cancel(),c.schedule(),a):(c.apply(this,t),a)};return d.cancel=c.cancel,d.flush=()=>(c.flush(),a),d}var ln=i(4650),cn={attributes:{"data-cke":!0}};cn.setAttributes=Ki(),cn.insert=$i().bind(null,"head"),cn.domAPI=Hi(),cn.insertStyleElement=Yi();ji()(ln.A,cn);ln.A&&ln.A.locals&&ln.A.locals;const dn="ck-tooltip";class un extends(He()){tooltipTextView;balloonPanelView;static defaultBalloonPositions=on.generatePositions({heightOffset:5,sideOffset:13});_currentElementWithTooltip=null;_currentTooltipPosition=null;_mutationObserver=null;_pinTooltipDebounced;_unpinTooltipDebounced;_watchdogExcluded;static _editors=new Set;static _instance=null;constructor(t){if(super(),un._editors.add(t),un._instance)return un._instance;un._instance=this,this.tooltipTextView=new Zi(t.locale),this.tooltipTextView.set("text",""),this.tooltipTextView.setTemplate({tag:"span",attributes:{class:["ck","ck-tooltip__text"]},children:[{text:this.tooltipTextView.bindTemplate.to("text")}]}),this.balloonPanelView=new on(t.locale),this.balloonPanelView.class=dn,this.balloonPanelView.content.add(this.tooltipTextView),this._mutationObserver=function(e){const t=new MutationObserver(()=>{e()});return{attach(e){t.observe(e,{attributes:!0,attributeFilter:["data-cke-tooltip-text","data-cke-tooltip-position"]})},detach(){t.disconnect()}}}(()=>{this._updateTooltipPosition()}),this._pinTooltipDebounced=an(this._pinTooltip,600),this._unpinTooltipDebounced=an(this._unpinTooltip,400),this.listenTo(e.document,"keydown",this._onKeyDown.bind(this),{useCapture:!0}),this.listenTo(e.document,"mouseenter",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo(e.document,"mouseleave",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo(e.document,"focus",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo(e.document,"blur",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo(e.document,"scroll",this._onScroll.bind(this),{useCapture:!0}),this._watchdogExcluded=!0}destroy(e){const t=e.ui.view&&e.ui.view.body;un._editors.delete(e),this.stopListening(e.ui),t&&t.has(this.balloonPanelView)&&t.remove(this.balloonPanelView),un._editors.size||(this._unpinTooltip(),this.balloonPanelView.destroy(),this.stopListening(),un._instance=null)}static getPositioningFunctions(e){const t=un.defaultBalloonPositions;return{s:[t.southArrowNorth,t.southArrowNorthEast,t.southArrowNorthWest],n:[t.northArrowSouth],e:[t.eastArrowWest],w:[t.westArrowEast],sw:[t.southArrowNorthEast],se:[t.southArrowNorthWest]}[e]}_onKeyDown(e,t){"Escape"===t.key&&this._currentElementWithTooltip&&(this._unpinTooltip(),t.stopPropagation())}_onEnterOrFocus(e,{target:t}){const i=hn(t);i?i!==this._currentElementWithTooltip?(this._unpinTooltip(),"focus"===e.name&&!i.matches(":hover")||i.matches("[data-cke-tooltip-instant]")?this._pinTooltip(i,mn(i)):this._pinTooltipDebounced(i,mn(i))):this._unpinTooltipDebounced.cancel():"focus"===e.name&&this._unpinTooltip()}_onLeaveOrBlur(e,{target:t,relatedTarget:i}){if("mouseleave"===e.name){if(!Le(t))return;const e=this.balloonPanelView.element,n=e&&(e===i||e.contains(i)),o=!n&&t===e;if(n)return void this._unpinTooltipDebounced.cancel();if(!o&&this._currentElementWithTooltip&&t!==this._currentElementWithTooltip)return;const r=hn(t),s=hn(i);(o||r&&r!==s)&&(this._pinTooltipDebounced.cancel(),this._currentElementWithTooltip&&this._currentElementWithTooltip.matches("[data-cke-tooltip-instant]")||r&&r.matches("[data-cke-tooltip-instant]")?this._unpinTooltip():this._unpinTooltipDebounced())}else{if(this._currentElementWithTooltip&&t!==this._currentElementWithTooltip)return;this._pinTooltipDebounced.cancel(),this._unpinTooltipDebounced()}}_onScroll(e,{target:t}){this._currentElementWithTooltip&&(t.contains(this.balloonPanelView.element)&&t.contains(this._currentElementWithTooltip)||this._unpinTooltip())}_pinTooltip(e,{text:t,position:i,cssClass:n}){this._unpinTooltip();const o=Jt(un._editors.values()).ui.view.body;o.has(this.balloonPanelView)||o.add(this.balloonPanelView),this.tooltipTextView.text=t,this.balloonPanelView.class=[dn,n].filter(e=>e).join(" "),this.balloonPanelView.pin({target:e,positions:un.getPositioningFunctions(i)}),this._mutationObserver.attach(e);for(const e of un._editors)this.listenTo(e.ui,"update",this._updateTooltipPosition.bind(this),{priority:"low"});this._currentElementWithTooltip=e,this._currentTooltipPosition=i}_unpinTooltip(){this._unpinTooltipDebounced.cancel(),this._pinTooltipDebounced.cancel(),this.balloonPanelView.unpin();for(const e of un._editors)this.stopListening(e.ui,"update");this._currentElementWithTooltip=null,this._currentTooltipPosition=null,this.tooltipTextView.text="",this._mutationObserver.detach()}_updateTooltipPosition(){if(!this._currentElementWithTooltip)return;const e=mn(this._currentElementWithTooltip);dt(this._currentElementWithTooltip)&&e.text?this.balloonPanelView.pin({target:this._currentElementWithTooltip,positions:un.getPositioningFunctions(e.position)}):this._unpinTooltip()}}function hn(e){return Le(e)?e.closest("[data-cke-tooltip-text]:not([data-cke-tooltip-disabled])"):null}function mn(e){return{text:e.dataset.ckeTooltipText,position:e.dataset.ckeTooltipPosition||"s",cssClass:e.dataset.ckeTooltipClass||""}}function gn(e,t=0,i={}){"object"!=typeof i&&(i={});const{leading:n=!0,trailing:o=!0}=i;return an(e,t,{leading:n,trailing:o,maxWait:t})}class fn extends(He()){editor;_balloonView=null;_showBalloonThrottled=gn(()=>this._showBalloon(),50,{leading:!0});_lastFocusedEditableElement=null;_balloonClass;constructor(e,t={}){super(),this.editor=e,this._balloonClass=t.balloonClass,e.on("ready",()=>this._handleEditorReady())}destroy(){const e=this._balloonView;e&&(e.unpin(),this._balloonView=null),this._showBalloonThrottled.cancel(),this.stopListening()}_handleEditorReady(){const e=this.editor;this._isEnabled()&&e.ui.view&&(e.ui.focusTracker.on("change:isFocused",(e,t,i)=>{this._updateLastFocusedEditableElement(),i?this._showBalloon():this._hideBalloon()}),e.ui.focusTracker.on("change:focusedElement",(e,t,i)=>{this._updateLastFocusedEditableElement(),i&&this._showBalloon()}),e.ui.on("update",()=>{this._showBalloonThrottled()}))}_getNormalizedConfig(){return{side:"ltr"===this.editor.locale.contentLanguageDirection?"right":"left",position:"border",verticalOffset:0,horizontalOffset:5}}_showBalloon(){const e=this._getBalloonAttachOptions();e&&(this._balloonView||(this._balloonView=this._createBalloonView()),this._balloonView.pin(e))}_hideBalloon(){this._balloonView&&this._balloonView.unpin()}_createBalloonView(){const e=this.editor,t=new on,i=this._createBadgeContent();return t.content.add(i),this._balloonClass&&(t.class=this._balloonClass),e.ui.view.body.add(t),t}_getBalloonAttachOptions(){if(!this._lastFocusedEditableElement)return null;const e=this._getNormalizedConfig(),t="right"===e.side?pn(this._lastFocusedEditableElement,i=e,(e,t)=>e.left+e.width-t.width-i.horizontalOffset):function(e,t){return pn(e,t,e=>e.left+t.horizontalOffset)}(this._lastFocusedEditableElement,e);var i;return{target:this._lastFocusedEditableElement,positions:[t]}}_updateLastFocusedEditableElement(){const e=this.editor,t=e.ui.focusTracker.isFocused,i=e.ui.focusTracker.focusedElement;if(!t||!i)return void(this._lastFocusedEditableElement=null);const n=Array.from(e.ui.getEditableElementsNames()).map(t=>e.ui.getEditableElement(t));n.includes(i)?this._lastFocusedEditableElement=i:this._lastFocusedEditableElement=n[0]}}function pn(e,t,i){return(n,o)=>{const r=new Ze(e);if(r.width<350||r.height<50)return null;let s;s="inside"===t.position?r.bottom-o.height:r.bottom-o.height/2,s-=t.verticalOffset;const a=i(r,o),l=n.clone().moveTo(a,s).getIntersection(o.clone().moveTo(a,s)).getVisible();return!l||l.getArea()<o.getArea()?null:{top:s,left:a,name:`position_${t.position}-side_${t.side}`,config:{withArrow:!1}}}}var bn=i(4106),kn={attributes:{"data-cke":!0}};kn.setAttributes=Ki(),kn.insert=$i().bind(null,"head"),kn.domAPI=Hi(),kn.insertStyleElement=Yi();ji()(bn.A,kn);bn.A&&bn.A.locals&&bn.A.locals;class wn extends Zi{static presentationalAttributeNames=["alignment-baseline","baseline-shift","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-rendering","cursor","direction","display","dominant-baseline","fill","fill-opacity","fill-rule","filter","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","mask","opacity","overflow","paint-order","pointer-events","shape-rendering","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-overflow","text-rendering","transform","unicode-bidi","vector-effect","visibility","white-space","word-spacing","writing-mode"];constructor(){super();const e=this.bindTemplate;this.set("content",""),this.set("viewBox","0 0 20 20"),this.set("fillColor",""),this.set("isColorInherited",!0),this.set("isVisible",!0),this.setTemplate({tag:"svg",ns:"http://www.w3.org/2000/svg",attributes:{class:["ck","ck-icon",e.if("isVisible","ck-hidden",e=>!e),"ck-reset_all-excluded",e.if("isColorInherited","ck-icon_inherit-color")],viewBox:e.to("viewBox"),"aria-hidden":!0}})}render(){super.render(),this._updateXMLContent(),this._colorFillPaths(),this.on("change:content",()=>{this._updateXMLContent(),this._colorFillPaths()}),this.on("change:fillColor",()=>{this._colorFillPaths()})}_updateXMLContent(){if(this.content){const e=(new DOMParser).parseFromString(this.content.trim(),"image/svg+xml").querySelector("svg");if(!e)throw new A("ui-iconview-invalid-svg",this);const t=e.getAttribute("viewBox");t&&(this.viewBox=t);for(const{name:t,value:i}of Array.from(e.attributes))wn.presentationalAttributeNames.includes(t)&&this.element.setAttribute(t,i);for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);for(;e.childNodes.length>0;)this.element.appendChild(e.childNodes[0])}}_colorFillPaths(){this.fillColor&&this.element.querySelectorAll(".ck-icon__fill").forEach(e=>{e.style.fill=this.fillColor})}}class _n extends fn{constructor(e){super(e,{balloonClass:"ck-powered-by-balloon"})}_isEnabled(){const e=this.editor;if(e.config.get("ui.poweredBy.forceVisible"))return!0;const t=e.config.get("licenseKey");if("GPL"==t)return!0;const i=ri(t.split(".")[1]);return!i||!i.whiteLabel}_createBadgeContent(){return new vn(this.editor.locale,this._getNormalizedConfig().label)}_getNormalizedConfig(){const e=super._getNormalizedConfig(),t=this.editor.config.get("ui.poweredBy")||{},i=t.position||e.position,n="inside"===i?5:e.verticalOffset;return{position:i,side:t.side||e.side,label:void 0===t.label?"Powered by":t.label,verticalOffset:void 0!==t.verticalOffset?t.verticalOffset:n,horizontalOffset:void 0!==t.horizontalOffset?t.horizontalOffset:e.horizontalOffset,forceVisible:!!t.forceVisible}}}class vn extends Zi{constructor(e,t){super(e);const i=new wn,n=this.bindTemplate;i.set({content:'<svg xmlns="http://www.w3.org/2000/svg" width="53" height="10" viewBox="0 0 53 10"><path fill="#1C2331" d="M31.724 1.492a15.139 15.139 0 0 0 .045 1.16 2.434 2.434 0 0 0-.687-.34 3.68 3.68 0 0 0-1.103-.166 2.332 2.332 0 0 0-1.14.255 1.549 1.549 0 0 0-.686.87c-.15.41-.225.98-.225 1.712 0 .939.148 1.659.444 2.161.297.503.792.754 1.487.754.452.015.9-.094 1.294-.316.296-.174.557-.4.771-.669l.14.852h1.282V.007h-1.623v1.485ZM31 6.496a1.77 1.77 0 0 1-.494.061.964.964 0 0 1-.521-.127.758.758 0 0 1-.296-.466 3.984 3.984 0 0 1-.093-.992 4.208 4.208 0 0 1 .098-1.052.753.753 0 0 1 .307-.477 1.08 1.08 0 0 1 .55-.122c.233-.004.466.026.69.089l.483.144v2.553c-.11.076-.213.143-.307.2a1.73 1.73 0 0 1-.417.189ZM35.68 0l-.702.004c-.322.002-.482.168-.48.497l.004.581c.002.33.164.493.486.49l.702-.004c.322-.002.481-.167.48-.496L36.165.49c-.002-.33-.164-.493-.486-.491ZM36.145 2.313l-1.612.01.034 5.482 1.613-.01-.035-5.482ZM39.623.79 37.989.8 38 2.306l-.946.056.006 1.009.949-.006.024 2.983c.003.476.143.844.419 1.106.275.26.658.39 1.148.387.132 0 .293-.01.483-.03.19-.02.38-.046.57-.08.163-.028.324-.068.482-.119l-.183-1.095-.702.004a.664.664 0 0 1-.456-.123.553.553 0 0 1-.14-.422l-.016-2.621 1.513-.01-.006-1.064-1.514.01-.01-1.503ZM46.226 2.388c-.41-.184-.956-.274-1.636-.27-.673.004-1.215.101-1.627.29-.402.179-.72.505-.888.91-.18.419-.268.979-.264 1.68.004.688.1 1.24.285 1.655.172.404.495.724.9.894.414.18.957.268 1.63.264.68-.004 1.224-.099 1.632-.284.4-.176.714-.501.878-.905.176-.418.263-.971.258-1.658-.004-.702-.097-1.261-.28-1.677a1.696 1.696 0 0 0-.888-.9Zm-.613 3.607a.77.77 0 0 1-.337.501 1.649 1.649 0 0 1-1.317.009.776.776 0 0 1-.343-.497 4.066 4.066 0 0 1-.105-1.02 4.136 4.136 0 0 1 .092-1.03.786.786 0 0 1 .337-.507 1.59 1.59 0 0 1 1.316-.008.79.79 0 0 1 .344.502c.078.337.113.683.105 1.03.012.343-.019.685-.092 1.02ZM52.114 2.07a2.67 2.67 0 0 0-1.128.278c-.39.191-.752.437-1.072.73l-.157-.846-1.273.008.036 5.572 1.623-.01-.024-3.78c.35-.124.646-.22.887-.286.26-.075.53-.114.8-.118l.45-.003.144-1.546-.286.001ZM22.083 7.426l-1.576-2.532a2.137 2.137 0 0 0-.172-.253 1.95 1.95 0 0 0-.304-.29.138.138 0 0 1 .042-.04 1.7 1.7 0 0 0 .328-.374l1.75-2.71c.01-.015.025-.028.024-.048-.01-.01-.021-.007-.031-.007L20.49 1.17a.078.078 0 0 0-.075.045l-.868 1.384c-.23.366-.46.732-.688 1.099a.108.108 0 0 1-.112.06c-.098-.005-.196-.001-.294-.002-.018 0-.038.006-.055-.007.002-.02.002-.039.005-.058a4.6 4.6 0 0 0 .046-.701V1.203c0-.02-.009-.032-.03-.03h-.033L16.93 1.17c-.084 0-.073-.01-.073.076v6.491c-.001.018.006.028.025.027h1.494c.083 0 .072.007.072-.071v-2.19c0-.055-.003-.11-.004-.166a3.366 3.366 0 0 0-.05-.417h.06c.104 0 .209.002.313-.002a.082.082 0 0 1 .084.05c.535.913 1.07 1.824 1.607 2.736a.104.104 0 0 0 .103.062c.554-.003 1.107-.002 1.66-.002l.069-.003-.019-.032-.188-.304ZM27.112 6.555c-.005-.08-.004-.08-.082-.08h-2.414c-.053 0-.106-.003-.159-.011a.279.279 0 0 1-.246-.209.558.558 0 0 1-.022-.15c0-.382 0-.762-.002-1.143 0-.032.007-.049.042-.044h2.504c.029.003.037-.012.034-.038V3.814c0-.089.013-.078-.076-.078h-2.44c-.07 0-.062.003-.062-.06v-.837c0-.047.004-.093.013-.14a.283.283 0 0 1 .241-.246.717.717 0 0 1 .146-.011h2.484c.024.002.035-.009.036-.033l.003-.038.03-.496c.01-.183.024-.365.034-.548.005-.085.003-.087-.082-.094-.218-.018-.437-.038-.655-.05a17.845 17.845 0 0 0-.657-.026 72.994 72.994 0 0 0-1.756-.016 1.7 1.7 0 0 0-.471.064 1.286 1.286 0 0 0-.817.655c-.099.196-.149.413-.145.633v3.875c0 .072.003.144.011.216a1.27 1.27 0 0 0 .711 1.029c.228.113.48.167.734.158.757-.005 1.515.002 2.272-.042.274-.016.548-.034.82-.053.03-.002.043-.008.04-.041-.008-.104-.012-.208-.019-.312a69.964 69.964 0 0 1-.05-.768ZM16.14 7.415l-.127-1.075c-.004-.03-.014-.04-.044-.037a13.125 13.125 0 0 1-.998.073c-.336.01-.672.02-1.008.016-.116-.001-.233-.014-.347-.039a.746.746 0 0 1-.45-.262c-.075-.1-.132-.211-.167-.33a3.324 3.324 0 0 1-.126-.773 9.113 9.113 0 0 1-.015-.749c0-.285.022-.57.065-.852.023-.158.066-.312.127-.46a.728.728 0 0 1 .518-.443 1.64 1.64 0 0 1 .397-.048c.628-.001 1.255.003 1.882.05.022.001.033-.006.036-.026l.003-.031.06-.55c.019-.177.036-.355.057-.532.004-.034-.005-.046-.04-.056a5.595 5.595 0 0 0-1.213-.21 10.783 10.783 0 0 0-.708-.02c-.24-.003-.48.01-.719.041a3.477 3.477 0 0 0-.625.14 1.912 1.912 0 0 0-.807.497c-.185.2-.33.433-.424.688a4.311 4.311 0 0 0-.24 1.096c-.031.286-.045.572-.042.86-.006.43.024.86.091 1.286.04.25.104.497.193.734.098.279.26.53.473.734.214.205.473.358.756.446.344.11.702.17 1.063.177a8.505 8.505 0 0 0 1.578-.083 6.11 6.11 0 0 0 .766-.18c.03-.008.047-.023.037-.057a.157.157 0 0 1-.003-.025Z"/><path fill="#AFE229" d="M6.016 6.69a1.592 1.592 0 0 0-.614.21c-.23.132-.422.32-.56.546-.044.072-.287.539-.287.539l-.836 1.528.009.006c.038.025.08.046.123.063.127.046.26.07.395.073.505.023 1.011-.007 1.517-.003.29.009.58.002.869-.022a.886.886 0 0 0 .395-.116.962.962 0 0 0 .312-.286c.056-.083.114-.163.164-.249.24-.408.48-.816.718-1.226.075-.128.148-.257.222-.386l.112-.192a1.07 1.07 0 0 0 .153-.518l-1.304.023s-1.258-.005-1.388.01Z"/><path fill="#771BFF" d="m2.848 9.044.76-1.39.184-.352c-.124-.067-.245-.14-.367-.21-.346-.204-.706-.384-1.045-.6a.984.984 0 0 1-.244-.207c-.108-.134-.136-.294-.144-.46-.021-.409-.002-.818-.009-1.227-.003-.195 0-.39.003-.585.004-.322.153-.553.427-.713l.833-.488c.22-.13.44-.257.662-.385.05-.029.105-.052.158-.077.272-.128.519-.047.76.085l.044.028c.123.06.242.125.358.196.318.178.635.357.952.537.095.056.187.117.275.184.194.144.254.35.266.578.016.284.007.569.006.853-.001.28.004.558 0 .838.592-.003 1.259 0 1.259 0l.723-.013c-.003-.292-.007-.584-.007-.876 0-.524.015-1.048-.016-1.571-.024-.42-.135-.8-.492-1.067a5.02 5.02 0 0 0-.506-.339A400.52 400.52 0 0 0 5.94.787C5.722.664 5.513.524 5.282.423 5.255.406 5.228.388 5.2.373 4.758.126 4.305-.026 3.807.21c-.097.046-.197.087-.29.14A699.896 699.896 0 0 0 .783 1.948c-.501.294-.773.717-.778 1.31-.004.36-.009.718-.001 1.077.016.754-.017 1.508.024 2.261.016.304.07.6.269.848.127.15.279.28.448.382.622.4 1.283.734 1.92 1.11l.183.109Z"/></svg>\n',isColorInherited:!1}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-powered-by"],"aria-hidden":!0},children:[{tag:"a",attributes:{href:"https://ckeditor.com/powered-by-ckeditor/?utm_source=ckeditor&utm_medium=referral&utm_campaign=701Dn000000hVgmIAE_powered_by_ckeditor_logo",target:"_blank",tabindex:"-1"},children:[...t?[{tag:"span",attributes:{class:["ck","ck-powered-by__label"]},children:[t]}]:[],i],on:{dragstart:n.to(e=>e.preventDefault())}}]})}}class yn extends fn{licenseTypeMessage={evaluation:"For evaluation purposes only",trial:"For evaluation purposes only",development:"For development purposes only"};constructor(e){super(e,{balloonClass:"ck-evaluation-badge-balloon"})}_isEnabled(){const e=xn(this.editor.config.get("licenseKey"));return Boolean(e&&this.licenseTypeMessage[e])}_createBadgeContent(){const e=xn(this.editor.config.get("licenseKey"));return new An(this.editor.locale,this.licenseTypeMessage[e])}_getNormalizedConfig(){const e=super._getNormalizedConfig(),t=this.editor.config.get("ui.poweredBy")||{};return{position:t.position||e.position,side:"left"===(t.side||e.side)?"right":"left",verticalOffset:e.verticalOffset,horizontalOffset:e.horizontalOffset}}}class An extends Zi{constructor(e,t){super(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-evaluation-badge"],"aria-hidden":!0},children:[{tag:"span",attributes:{class:["ck","ck-evaluation-badge__label"]},children:[t]}]})}}function xn(e){if("GPL"==e)return"GPL";const t=ri(e.split(".")[1]);return t?t.licenseType||"production":null}var Cn=i(1710),Tn={attributes:{"data-cke":!0}};Tn.setAttributes=Ki(),Tn.insert=$i().bind(null,"head"),Tn.domAPI=Hi(),Tn.insertStyleElement=Yi();ji()(Cn.A,Tn);Cn.A&&Cn.A.locals&&Cn.A.locals;const En={POLITE:"polite",ASSERTIVE:"assertive"};class In{editor;view;constructor(e){this.editor=e,e.once("ready",()=>{for(const e of Object.values(En))this.announce("",e)})}announce(e,t=En.POLITE){const i=this.editor;if(!i.ui.view)return;this.view||(this.view=new Sn(i.locale),i.ui.view.body.add(this.view));const{politeness:n,isUnsafeHTML:o}="string"==typeof t?{politeness:t}:t;let r=this.view.regionViews.find(e=>e.politeness===n);r||(r=new Pn(i,n),this.view.regionViews.add(r)),r.announce({announcement:e,isUnsafeHTML:o})}}class Sn extends Zi{regionViews;constructor(e){super(e),this.regionViews=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-aria-live-announcer"]},children:this.regionViews})}}class Pn extends Zi{politeness;_domConverter;_pruneAnnouncementsInterval;constructor(e,t){super(e.locale),this.setTemplate({tag:"div",attributes:{"aria-live":t,"aria-relevant":"additions"},children:[{tag:"ul",attributes:{class:["ck","ck-aria-live-region-list"]}}]}),e.on("destroy",()=>{null!==this._pruneAnnouncementsInterval&&(clearInterval(this._pruneAnnouncementsInterval),this._pruneAnnouncementsInterval=null)}),this.politeness=t,this._domConverter=e.data.htmlProcessor.domConverter,this._pruneAnnouncementsInterval=setInterval(()=>{this.element&&this._listElement.firstChild&&this._listElement.firstChild.remove()},5e3)}announce({announcement:e,isUnsafeHTML:t}){if(!e.trim().length)return;const i=document.createElement("li");t?this._domConverter.setContentOf(i,e):i.innerText=e,this._listElement.appendChild(i)}get _listElement(){return this.element.querySelector("ul")}}class Mn extends Zi{children;constructor(e){super(e);const t=this.bindTemplate;this.set("isVisible",!0),this.children=this.createCollection(),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__item",t.if("isVisible","ck-hidden",e=>!e)],role:"presentation"},children:this.children})}focus(){this.children.first&&this.children.first.focus()}}var On=i(1214),Rn={attributes:{"data-cke":!0}};Rn.setAttributes=Ki(),Rn.insert=$i().bind(null,"head"),Rn.domAPI=Hi(),Rn.insertStyleElement=Yi();ji()(On.A,Rn);On.A&&On.A.locals&&On.A.locals;class Nn extends Mn{constructor(e,t){super(e);const i=this.bindTemplate;this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item"]},on:{mouseenter:i.to("mouseenter")}}),this.delegate("mouseenter").to(t)}}function Vn({emitter:e,activator:t,callback:i,contextElements:n,listenerOptions:o}){e.listenTo(document,"mousedown",(e,o)=>{if(!t())return;const r="function"==typeof o.composedPath?o.composedPath():[],s="function"==typeof n?n():n;for(const e of s)if(e.contains(o.target)||r.includes(e))return;i()},o)}const Ln={toggleMenusAndFocusItemsOnHover(e){e.on("menu:mouseenter",t=>{if(e.isFocusBorderEnabled||e.isOpen){if(e.isOpen)for(const i of e.menus){const e=t.path[0],n=e instanceof Nn&&e.children.first===i;i.isOpen=(t.path.includes(i)||n)&&i.isEnabled}t.source.focus()}})},focusCycleMenusOnArrows(e){const t="rtl"===e.locale.uiLanguageDirection;function i(t,i){const n=e.children.getIndex(t),o=t.isOpen,r=e.children.length,s=e.children.get((n+r+i)%r);t.isOpen=!1,o&&(s.isOpen=!0),s.buttonView.focus()}e.on("menu:arrowright",e=>{i(e.source,t?-1:1)}),e.on("menu:arrowleft",e=>{i(e.source,t?1:-1)})},closeMenusWhenTheBarCloses(e){e.on("change:isOpen",()=>{e.isOpen||e.menus.forEach(e=>{e.isOpen=!1})})},closeMenuWhenAnotherOnTheSameLevelOpens(e){e.on("menu:change:isOpen",(t,i,n)=>{n&&e.menus.filter(e=>t.source.parentMenuView===e.parentMenuView&&t.source!==e&&e.isOpen).forEach(e=>{e.isOpen=!1})})},closeOnClickOutside(e){Vn({emitter:e,activator:()=>e.isOpen,callback:()=>e.close(),contextElements:()=>e.children.map(e=>e.element)})},enableFocusHighlightOnInteraction(e){let t=!1;e.on("change:isOpen",(i,n,o)=>{o||(t||(e.isFocusBorderEnabled=!1),t=!1)}),e.listenTo(e.element,"keydown",()=>{t=!0},{useCapture:!0}),e.listenTo(e.element,"keyup",()=>{t=!1},{useCapture:!0}),e.listenTo(e.element,"focus",()=>{t&&(e.isFocusBorderEnabled=!0)},{useCapture:!0})}},Dn={openAndFocusPanelOnArrowDownKey(e){e.keystrokes.set("arrowdown",(t,i)=>{e.isEnabled&&e.focusTracker.focusedElement===e.buttonView.element&&(e.isOpen||(e.isOpen=!0),e.panelView.focus(),i())})},openOnArrowRightKey(e){const t="rtl"===e.locale.uiLanguageDirection?"arrowleft":"arrowright";e.keystrokes.set(t,(t,i)=>{e.focusTracker.focusedElement===e.buttonView.element&&e.isEnabled&&(e.isOpen||(e.isOpen=!0),e.panelView.focus(),i())})},openOnButtonClick(e){e.buttonView.on("execute",()=>{e.isOpen=!0})},toggleOnButtonClick(e){e.buttonView.on("execute",()=>{e.isOpen=!e.isOpen})},openAndFocusOnEnterKeyPress(e){e.keystrokes.set("enter",(t,i)=>{e.focusTracker.focusedElement===e.buttonView.element&&(e.isOpen=!0,e.panelView.focus(),i())})},closeOnArrowLeftKey(e){const t="rtl"===e.locale.uiLanguageDirection?"arrowright":"arrowleft";e.keystrokes.set(t,(t,i)=>{e.isOpen&&(e.isOpen=!1,e.focus(),i())})},closeOnEscKey(e){e.keystrokes.set("esc",(t,i)=>{e.isOpen&&(e.isOpen=!1,e.focus(),i())})},closeOnParentClose(e){e.parentMenuView.on("change:isOpen",(t,i,n)=>{n||t.source!==e.parentMenuView||(e.isOpen=!1)})}},Bn={southEast:e=>({top:e.bottom,left:e.left,name:"se"}),southWest:(e,t)=>({top:e.bottom,left:e.left-t.width+e.width,name:"sw"}),northEast:(e,t)=>({top:e.top-t.height,left:e.left,name:"ne"}),northWest:(e,t)=>({top:e.top-t.height,left:e.left-t.width+e.width,name:"nw"}),eastSouth:e=>({top:e.top,left:e.right-5,name:"es"}),eastNorth:(e,t)=>({top:e.top-t.height,left:e.right-5,name:"en"}),westSouth:(e,t)=>({top:e.top,left:e.left-t.width+5,name:"ws"}),westNorth:(e,t)=>({top:e.top-t.height,left:e.left-t.width+5,name:"wn"})},zn=[{menuId:"file",label:"File",groups:[{groupId:"export",items:["menuBar:exportPdf","menuBar:exportWord"]},{groupId:"import",items:["menuBar:importWord"]},{groupId:"revisionHistory",items:["menuBar:revisionHistory"]}]},{menuId:"edit",label:"Edit",groups:[{groupId:"undo",items:["menuBar:undo","menuBar:redo"]},{groupId:"selectAll",items:["menuBar:selectAll"]},{groupId:"findAndReplace",items:["menuBar:findAndReplace"]}]},{menuId:"view",label:"View",groups:[{groupId:"sourceEditingEnhanced",items:["menuBar:sourceEditingEnhanced"]},{groupId:"sourceEditing",items:["menuBar:sourceEditing"]},{groupId:"showBlocks",items:["menuBar:showBlocks"]},{groupId:"previewMergeFields",items:["menuBar:previewMergeFields"]},{groupId:"fullscreen",items:["menuBar:fullscreen"]},{groupId:"restrictedEditing",items:["menuBar:restrictedEditing"]}]},{menuId:"insert",label:"Insert",groups:[{groupId:"insertMainWidgets",items:["menuBar:insertImage","menuBar:ckbox","menuBar:ckfinder","menuBar:insertTable","menuBar:insertTableLayout"]},{groupId:"insertInline",items:["menuBar:link","menuBar:insertFootnote","menuBar:bookmark","menuBar:comment","menuBar:insertMergeField","menuBar:emoji"]},{groupId:"insertMinorWidgets",items:["menuBar:mediaEmbed","menuBar:insertTemplate","menuBar:specialCharacters","menuBar:blockQuote","menuBar:codeBlock","menuBar:htmlEmbed"]},{groupId:"insertStructureWidgets",items:["menuBar:horizontalLine","menuBar:pageBreak","menuBar:tableOfContents"]},{groupId:"restrictedEditingException",items:["menuBar:restrictedEditingException:inline","menuBar:restrictedEditingException:block"]}]},{menuId:"format",label:"Format",groups:[{groupId:"textAndFont",items:[{menuId:"text",label:"Text",groups:[{groupId:"basicStyles",items:["menuBar:bold","menuBar:italic","menuBar:underline","menuBar:strikethrough","menuBar:superscript","menuBar:subscript","menuBar:code"]},{groupId:"textPartLanguage",items:["menuBar:textPartLanguage"]}]},{menuId:"font",label:"Font",groups:[{groupId:"fontProperties",items:["menuBar:fontSize","menuBar:fontFamily"]},{groupId:"fontColors",items:["menuBar:fontColor","menuBar:fontBackgroundColor"]},{groupId:"highlight",items:["menuBar:highlight"]}]},"menuBar:heading"]},{groupId:"list",items:["menuBar:bulletedList","menuBar:numberedList","menuBar:multiLevelList","menuBar:todoList"]},{groupId:"indent",items:["menuBar:alignment","menuBar:lineHeight","menuBar:indent","menuBar:outdent"]},{groupId:"caseChange",items:["menuBar:caseChange"]},{groupId:"removeFormat",items:["menuBar:removeFormat"]}]},{menuId:"tools",label:"Tools",groups:[{groupId:"aiTools",items:["menuBar:aiAssistant","menuBar:aiCommands","menuBar:toggleAi","menuBar:aiQuickActions"]},{groupId:"tools",items:["menuBar:trackChanges","menuBar:commentsArchive"]}]},{menuId:"help",label:"Help",groups:[{groupId:"help",items:["menuBar:accessibilityHelp"]}]}];function Fn({normalizedConfig:e,locale:t,componentFactory:i,extraItems:n}){const o=Bt(e);return jn(e,o,n),function(e,t){const i=t.removeItems,n=[];t.items=t.items.filter(({menuId:e})=>!i.includes(e)||(n.push(e),!1)),$n(t.items,e=>{e.groups=e.groups.filter(({groupId:e})=>!i.includes(e)||(n.push(e),!1));for(const t of e.groups)t.items=t.items.filter(e=>{const t=Jn(e);return!i.includes(t)||(n.push(t),!1)})});for(const t of i)n.includes(t)||x("menu-bar-item-could-not-be-removed",{menuBarConfig:e,itemName:t})}(e,o),jn(e,o,o.addItems),function(e,t,i){$n(t.items,n=>{for(const o of n.groups)o.items=o.items.filter(o=>{const r="string"==typeof o&&!i.has(o);return r&&!t.isUsingDefaultConfig&&x("menu-bar-item-unavailable",{menuBarConfig:e,parentMenuConfig:Bt(n),componentName:o}),!r})})}(e,o,i),Hn(e,o),function(e,t){const i=t.t,n={File:i({string:"File",id:"MENU_BAR_MENU_FILE"}),Edit:i({string:"Edit",id:"MENU_BAR_MENU_EDIT"}),View:i({string:"View",id:"MENU_BAR_MENU_VIEW"}),Insert:i({string:"Insert",id:"MENU_BAR_MENU_INSERT"}),Format:i({string:"Format",id:"MENU_BAR_MENU_FORMAT"}),Tools:i({string:"Tools",id:"MENU_BAR_MENU_TOOLS"}),Help:i({string:"Help",id:"MENU_BAR_MENU_HELP"}),Text:i({string:"Text",id:"MENU_BAR_MENU_TEXT"}),Font:i({string:"Font",id:"MENU_BAR_MENU_FONT"})};$n(e.items,e=>{e.label in n&&(e.label=n[e.label])})}(o,t),o}function jn(e,t,i){const n=[];if(0!=i.length){for(const e of i){const i=Gn(e.position),o=Yn(e.position);if(qn(e))if(o){const r=t.items.findIndex(e=>e.menuId===o);if(-1!=r)"before"===i?(t.items.splice(r,0,e.menu),n.push(e)):"after"===i&&(t.items.splice(r+1,0,e.menu),n.push(e));else{Un(t,e.menu,o,i)&&n.push(e)}}else"start"===i?(t.items.unshift(e.menu),n.push(e)):"end"===i&&(t.items.push(e.menu),n.push(e));else if(Kn(e))$n(t.items,t=>{if(t.menuId===o)"start"===i?(t.groups.unshift(e.group),n.push(e)):"end"===i&&(t.groups.push(e.group),n.push(e));else{const r=t.groups.findIndex(e=>e.groupId===o);-1!==r&&("before"===i?(t.groups.splice(r,0,e.group),n.push(e)):"after"===i&&(t.groups.splice(r+1,0,e.group),n.push(e)))}});else{Un(t,e.item,o,i)&&n.push(e)}}for(const t of i)n.includes(t)||x("menu-bar-item-could-not-be-added",{menuBarConfig:e,addedItemConfig:t})}}function Un(e,t,i,n){let o=!1;return $n(e.items,e=>{for(const{groupId:r,items:s}of e.groups){if(o)return;if(r===i)"start"===n?(s.unshift(t),o=!0):"end"===n&&(s.push(t),o=!0);else{const e=s.findIndex(e=>Jn(e)===i);-1!==e&&("before"===n?(s.splice(e,0,t),o=!0):"after"===n&&(s.splice(e+1,0,t),o=!0))}}}),o}function Hn(e,t){const i=t.isUsingDefaultConfig;let n=!1;t.items=t.items.filter(t=>!!t.groups.length||(Wn(e,t,i),!1)),t.items.length?($n(t.items,t=>{t.groups=t.groups.filter(e=>!!e.items.length||(n=!0,!1));for(const o of t.groups)o.items=o.items.filter(t=>!(Qn(t)&&!t.groups.length)||(Wn(e,t,i),n=!0,!1))}),n&&Hn(e,t)):Wn(e,e,i)}function Wn(e,t,i){i||x("menu-bar-menu-empty",{menuBarConfig:e,emptyMenuConfig:t})}function $n(e,t){if(Array.isArray(e))for(const t of e)i(t);function i(e){t(e);for(const t of e.groups)for(const e of t.items)Qn(e)&&i(e)}}function qn(e){return"object"==typeof e&&"menu"in e}function Kn(e){return"object"==typeof e&&"group"in e}function Gn(e){return e.startsWith("start")?"start":e.startsWith("end")?"end":e.startsWith("after")?"after":"before"}function Yn(e){const t=e.match(/^[^:]+:(.+)/);return t?t[1]:null}function Jn(e){return"string"==typeof e?e:e.menuId}function Qn(e){return"object"==typeof e&&"menuId"in e}class Zn extends(K()){editor;componentFactory;focusTracker;tooltipManager;poweredBy;evaluationBadge;ariaLiveAnnouncer;isReady=!1;_editableElementsMap=new Map;_focusableToolbarDefinitions=[];_extraMenuBarElements=[];_lastFocusedForeignElement=null;_domEmitter;constructor(e){super();const t=e.editing.view;this.editor=e,this.componentFactory=new gi(e),this.focusTracker=new Qt,this.tooltipManager=new un(e),this.poweredBy=new _n(e),this.evaluationBadge=new yn(e),this.ariaLiveAnnouncer=new In(e),this._initViewportOffset(this._readViewportOffsetFromConfig()),this.once("ready",()=>{this._bindBodyCollectionWithFocusTracker(),this.isReady=!0}),this.listenTo(t.document,"layoutChanged",this.update.bind(this)),this.listenTo(t,"scrollToTheSelection",this._handleScrollToTheSelection.bind(this)),this._initFocusTracking(),this._initVisualViewportSupport()}get element(){return null}update(){this.fire("update")}destroy(){this.stopListening(),this.focusTracker.destroy(),this.tooltipManager.destroy(this.editor),this.poweredBy.destroy(),this.evaluationBadge.destroy();for(const e of this._editableElementsMap.values())e.ckeditorInstance=null,this.editor.keystrokes.stopListening(e);this._editableElementsMap=new Map,this._focusableToolbarDefinitions=[],this._domEmitter&&this._domEmitter.stopListening()}setEditableElement(e,t){this._editableElementsMap.set(e,t),t.ckeditorInstance||(t.ckeditorInstance=this.editor),this.focusTracker.add(t);const i=()=>{this.editor.editing.view.getDomRoot(e)||this.editor.keystrokes.listenTo(t)};this.isReady?i():this.once("ready",i)}removeEditableElement(e){const t=this._editableElementsMap.get(e);t&&(this._editableElementsMap.delete(e),this.editor.keystrokes.stopListening(t),this.focusTracker.remove(t),t.ckeditorInstance=null)}getEditableElement(e="main"){return this._editableElementsMap.get(e)}getEditableElementsNames(){return this._editableElementsMap.keys()}addToolbar(e,t={}){e.isRendered?(this.focusTracker.add(e),this.editor.keystrokes.listenTo(e.element)):e.once("render",()=>{this.focusTracker.add(e),this.editor.keystrokes.listenTo(e.element)}),this._focusableToolbarDefinitions.push({toolbarView:e,options:t})}extendMenuBar(e){this._extraMenuBarElements.push(e)}initMenuBar(e){const t=e.element;this.focusTracker.add(t),this.editor.keystrokes.listenTo(t);const i=function(e){let t;return t="items"in e&&e.items?{items:e.items,removeItems:[],addItems:[],isVisible:!0,isUsingDefaultConfig:!1,...e}:{items:Bt(zn),addItems:[],removeItems:[],isVisible:!0,isUsingDefaultConfig:!0,...e},t}(this.editor.config.get("menuBar")||{});e.fillFromConfig(i,this.componentFactory,this._extraMenuBarElements),this.editor.keystrokes.set("Esc",(e,i)=>{t.contains(this.editor.ui.focusTracker.focusedElement)&&(this._lastFocusedForeignElement?(this._lastFocusedForeignElement.focus(),this._lastFocusedForeignElement=null):this.editor.editing.view.focus(),i())}),this.editor.keystrokes.set("Alt+F9",(i,n)=>{t.contains(this.editor.ui.focusTracker.focusedElement)||(this._saveLastFocusedForeignElement(),e.isFocusBorderEnabled=!0,e.focus(),n())})}_readViewportOffsetFromConfig(){const e=this.editor,t=e.config.get("ui.viewportOffset");if(t)return t;const i=e.config.get("toolbar.viewportTopOffset");return i?(console.warn("editor-ui-deprecated-viewport-offset-config: The `toolbar.vieportTopOffset` configuration option is deprecated. It will be removed from future CKEditor versions. Use `ui.viewportOffset.top` instead."),{top:i}):{top:0}}_initFocusTracking(){const e=this.editor;let t;e.keystrokes.set("Alt+F10",(e,i)=>{this._saveLastFocusedForeignElement();const n=this._getCurrentFocusedToolbarDefinition();n&&t||(t=this._getFocusableCandidateToolbarDefinitions());for(let e=0;e<t.length;e++){const e=t.shift();if(t.push(e),e!==n&&this._focusFocusableCandidateToolbar(e)){n&&n.options.afterBlur&&n.options.afterBlur();break}}i()}),e.keystrokes.set("Esc",(t,i)=>{const n=this._getCurrentFocusedToolbarDefinition();n&&(this._lastFocusedForeignElement?(this._lastFocusedForeignElement.focus(),this._lastFocusedForeignElement=null):e.editing.view.focus(),n.options.afterBlur&&n.options.afterBlur(),i())})}_saveLastFocusedForeignElement(){const e=this.focusTracker.focusedElement;Array.from(this._editableElementsMap.values()).includes(e)&&!Array.from(this.editor.editing.view.domRoots.values()).includes(e)&&(this._lastFocusedForeignElement=e)}_getFocusableCandidateToolbarDefinitions(){const e=[];for(const t of this._focusableToolbarDefinitions){const{toolbarView:i,options:n}=t;(dt(i.element)||n.beforeFocus)&&e.push(t)}return e.sort((e,t)=>Xn(e)-Xn(t)),e}_getCurrentFocusedToolbarDefinition(){for(const e of this._focusableToolbarDefinitions)if(e.toolbarView.element&&e.toolbarView.element.contains(this.focusTracker.focusedElement))return e;return null}_focusFocusableCandidateToolbar(e){const{toolbarView:t,options:{beforeFocus:i}}=e;return i&&i(),!!dt(t.element)&&(t.focus(),!0)}_handleScrollToTheSelection(e,t){const i={top:0,bottom:0,left:0,right:0,...this.viewportOffset};t.viewportOffset.top+=i.top,t.viewportOffset.bottom+=i.bottom,t.viewportOffset.left+=i.left,t.viewportOffset.right+=i.right}_bindBodyCollectionWithFocusTracker(){const e=this.view.body;for(const t of e)this.focusTracker.add(t.element);e.on("add",(e,t)=>{this.focusTracker.add(t.element)}),e.on("remove",(e,t)=>{this.focusTracker.remove(t.element)})}_initViewportOffset(e){this.on("set:viewportOffset",(e,t,i)=>{const n=this._getVisualViewportTopOffset(i);i.visualTop!==n&&(e.return={...i,visualTop:n})}),this.set("viewportOffset",e)}_initVisualViewportSupport(){if(!e.window.visualViewport)return;const t=()=>{const e=this._getVisualViewportTopOffset(this.viewportOffset);this.viewportOffset.visualTop!==e&&(this.viewportOffset={...this.viewportOffset,visualTop:e})};this._domEmitter=new(He()),this._domEmitter.listenTo(e.window.visualViewport,"scroll",t),this._domEmitter.listenTo(e.window.visualViewport,"resize",t)}_getVisualViewportTopOffset(e){const t=bt().top,i=e.top||0;return t>i?0:i-t}}function Xn(e){const{toolbarView:t,options:i}=e;let n=10;return dt(t.element)&&n--,i.isContextual&&(n-=2),n}function eo(e){if(Array.isArray(e))return{items:e,removeItems:[]};const t={items:[],removeItems:[]};return e?{...t,...e}:t}const to='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="m11.591 10.177 4.243 4.242a1 1 0 0 1-1.415 1.415l-4.242-4.243-4.243 4.243a1 1 0 0 1-1.414-1.415l4.243-4.242L4.52 5.934A1 1 0 0 1 5.934 4.52l4.243 4.243 4.242-4.243a1 1 0 1 1 1.415 1.414z"/></svg>';var io=i(4866),no={attributes:{"data-cke":!0}};no.setAttributes=Ki(),no.insert=$i().bind(null,"head"),no.domAPI=Hi(),no.insertStyleElement=Yi();ji()(io.A,no);io.A&&io.A.locals&&io.A.locals;class oo extends Zi{children;iconView;constructor(e,t={}){super(e);const i=this.bindTemplate;this.set("label",t.label||""),this.set("class",t.class||null),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-form__header",i.to("class")]},children:this.children}),t.icon&&(this.iconView=new wn,this.iconView.content=t.icon,this.children.add(this.iconView));const n=new Zi(e);n.setTemplate({tag:"h2",attributes:{class:["ck","ck-form__header__label"],role:"presentation"},children:[{text:i.to("label")}]}),this.children.add(n)}}class ro extends Zi{constructor(){super(),this.set({style:void 0,text:void 0,id:void 0});const e=this.bindTemplate;this.setTemplate({tag:"span",attributes:{class:["ck","ck-button__label"],style:e.to("style"),id:e.to("id")},children:[{text:e.to("text")}]})}}var so=i(8948),ao={attributes:{"data-cke":!0}};ao.setAttributes=Ki(),ao.insert=$i().bind(null,"head"),ao.domAPI=Hi(),ao.insertStyleElement=Yi();ji()(so.A,ao);so.A&&so.A.locals&&so.A.locals;class lo extends Zi{children;labelView;iconView;keystrokeView;_focusDelayed=null;constructor(e,t=new ro){super(e);const i=this.bindTemplate,n=_();this.set("_ariaPressed",!1),this.set("_ariaChecked",!1),this.set("ariaLabel",void 0),this.set("ariaLabelledBy",`ck-editor__aria-label_${n}`),this.set("class",void 0),this.set("labelStyle",void 0),this.set("icon",void 0),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isVisible",!0),this.set("isToggleable",!1),this.set("keystroke",void 0),this.set("label",void 0),this.set("role",void 0),this.set("tabindex",-1),this.set("tooltip",!1),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.set("withKeystroke",!1),this.children=this.createCollection(),this.labelView=this._setupLabelView(t),this.iconView=new wn,this.iconView.extendTemplate({attributes:{class:"ck-button__icon"}}),this.iconView.bind("content").to(this,"icon"),this.keystrokeView=this._createKeystrokeView(),this.bind("_tooltipString").to(this,"tooltip",this,"label",this,"keystroke",this._getTooltipString.bind(this));const o={tag:"button",attributes:{class:["ck","ck-button",i.to("class"),i.if("isEnabled","ck-disabled",e=>!e),i.if("isVisible","ck-hidden",e=>!e),i.to("isOn",e=>e?"ck-on":"ck-off"),i.if("withText","ck-button_with-text"),i.if("withKeystroke","ck-button_with-keystroke")],role:i.to("role"),type:i.to("type",e=>e||"button"),tabindex:i.to("tabindex"),"aria-checked":i.to("_ariaChecked"),"aria-pressed":i.to("_ariaPressed"),"aria-label":i.to("ariaLabel"),"aria-labelledby":i.to("ariaLabelledBy"),"aria-disabled":i.if("isEnabled",!0,e=>!e),"data-cke-tooltip-text":i.to("_tooltipString"),"data-cke-tooltip-position":i.to("tooltipPosition")},children:this.children,on:{click:i.to(e=>{this.isEnabled?this.fire("execute"):e.preventDefault()})}};this.bind("_ariaPressed").to(this,"isOn",this,"isToggleable",this,"role",(e,t,i)=>!(!t||co(i))&&String(!!e)),this.bind("_ariaChecked").to(this,"isOn",this,"isToggleable",this,"role",(e,t,i)=>!(!t||!co(i))&&String(!!e)),r.isSafari&&(this._focusDelayed||(this._focusDelayed=oi(()=>this.focus(),0)),o.on.mousedown=i.to(()=>{this._focusDelayed()}),o.on.mouseup=i.to(()=>{this._focusDelayed.cancel()})),this.setTemplate(o)}render(){super.render(),this.icon&&this.children.add(this.iconView),this.on("change:icon",(e,t,i,n)=>{i&&!n?this.children.add(this.iconView,0):!i&&n&&this.children.remove(this.iconView)}),this.children.add(this.labelView),this.withKeystroke&&this.keystroke&&this.children.add(this.keystrokeView)}focus(){this.element.focus()}destroy(){this._focusDelayed&&this._focusDelayed.cancel(),super.destroy()}_setupLabelView(e){return e.bind("text","style","id").to(this,"label","labelStyle","ariaLabelledBy"),e}_createKeystrokeView(){const e=new Zi;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__keystroke"]},children:[{text:this.bindTemplate.to("keystroke",e=>Nt(e))}]}),e}_getTooltipString(e,t,i){return e?"string"==typeof e?e:(i&&(i=Nt(i)),e instanceof Function?e(t,i):`${t}${i?` (${i})`:""}`):""}}function co(e){switch(e){case"radio":case"checkbox":case"option":case"switch":case"menuitemcheckbox":case"menuitemradio":return!0;default:return!1}}class uo extends(O()){focusables;focusTracker;keystrokeHandler;actions;constructor(e){if(super(),this.focusables=e.focusables,this.focusTracker=e.focusTracker,this.keystrokeHandler=e.keystrokeHandler,this.actions=e.actions,e.actions&&e.keystrokeHandler)for(const t in e.actions){let i=e.actions[t];"string"==typeof i&&(i=[i]);for(const n of i)e.keystrokeHandler.set(n,(e,i)=>{this[t](),i()},e.keystrokeHandlerOptions)}this.on("forwardCycle",()=>this.focusFirst(),{priority:"low"}),this.on("backwardCycle",()=>this.focusLast(),{priority:"low"})}get first(){return this.focusables.find(ho)||null}get last(){return this.focusables.filter(ho).slice(-1)[0]||null}get next(){return this._getDomFocusableItem(1)}get previous(){return this._getDomFocusableItem(-1)}get current(){let e=null;return null===this.focusTracker.focusedElement?null:(this.focusables.find((t,i)=>{const n=t.element===this.focusTracker.focusedElement;return n&&(e=i),n}),e)}focusFirst(){this._focus(this.first,1)}focusLast(){this._focus(this.last,-1)}focusNext(){const e=this.next;e&&this.focusables.getIndex(e)===this.current||e===this.first?this.fire("forwardCycle"):this._focus(e,1)}focusPrevious(){const e=this.previous;e&&this.focusables.getIndex(e)===this.current||e===this.last?this.fire("backwardCycle"):this._focus(e,-1)}chain(e){const t=()=>null===this.current?null:this.focusables.get(this.current);this.listenTo(e,"forwardCycle",e=>{const i=t();this.focusNext(),i!==t()&&e.stop()},{priority:"low"}),this.listenTo(e,"backwardCycle",e=>{const i=t();this.focusPrevious(),i!==t()&&e.stop()},{priority:"low"})}unchain(e){this.stopListening(e)}_focus(e,t){e&&this.focusTracker.focusedElement!==e.element&&e.focus(t)}_getDomFocusableItem(e){const t=this.focusables.length;if(!t)return null;const i=this.current;if(null===i)return this[1===e?"first":"last"];let n=this.focusables.get(i),o=(i+t+e)%t;do{const i=this.focusables.get(o);if(ho(i)){n=i;break}o=(o+t+e)%t}while(o!==i);return n}}function ho(e){return mo(e)&&dt(e.element)}function mo(e){return!(!("focus"in e)||"function"!=typeof e.focus)}function go(t){return class extends t{_onDragBound=this._onDrag.bind(this);_onDragEndBound=this._onDragEnd.bind(this);_lastDraggingCoordinates={x:0,y:0};constructor(...e){super(...e),this.on("render",()=>{this._attachListeners()}),this.set("isDragging",!1)}_attachListeners(){this.listenTo(this.element,"mousedown",this._onDragStart.bind(this)),this.listenTo(this.element,"touchstart",this._onDragStart.bind(this))}_attachDragListeners(){this.listenTo(e.document,"mouseup",this._onDragEndBound),this.listenTo(e.document,"touchend",this._onDragEndBound),this.listenTo(e.document,"mousemove",this._onDragBound),this.listenTo(e.document,"touchmove",this._onDragBound)}_detachDragListeners(){this.stopListening(e.document,"mouseup",this._onDragEndBound),this.stopListening(e.document,"touchend",this._onDragEndBound),this.stopListening(e.document,"mousemove",this._onDragBound),this.stopListening(e.document,"touchmove",this._onDragBound)}_onDragStart(e,t){if(!this._isHandleElementPressed(t))return;this._attachDragListeners();let i=0,n=0;t instanceof MouseEvent?(i=t.clientX,n=t.clientY):(i=t.touches[0].clientX,n=t.touches[0].clientY),this._lastDraggingCoordinates={x:i,y:n},this.isDragging=!0}_onDrag(e,t){if(!this.isDragging)return void this._detachDragListeners();let i=0,n=0;t instanceof MouseEvent?(i=t.clientX,n=t.clientY):(i=t.touches[0].clientX,n=t.touches[0].clientY),t.preventDefault(),this.fire("drag",{deltaX:Math.round(i-this._lastDraggingCoordinates.x),deltaY:Math.round(n-this._lastDraggingCoordinates.y)}),this._lastDraggingCoordinates={x:i,y:n}}_onDragEnd(){this._detachDragListeners(),this.isDragging=!1}_isHandleElementPressed(e){return!!this.dragHandleElement&&(this.dragHandleElement===e.target||e.target instanceof HTMLElement&&this.dragHandleElement.contains(e.target))}}}var fo=i(8091),po={attributes:{"data-cke":!0}};po.setAttributes=Ki(),po.insert=$i().bind(null,"head"),po.domAPI=Hi(),po.insertStyleElement=Yi();ji()(fo.A,po);fo.A&&fo.A.locals&&fo.A.locals;class bo extends Zi{children;keystrokes;focusCycler;_focusTracker;_focusables;constructor(e){super(e),this.children=this.createCollection(),this.keystrokes=new ti,this._focusTracker=new Qt,this._focusables=new pi,this.focusCycler=new uo({focusables:this._focusables,focusTracker:this._focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog__actions"]},children:this.children})}render(){super.render(),this.keystrokes.listenTo(this.element)}setButtons(e){for(const t of e){const e=new lo(this.locale);let i;for(i in e.on("execute",()=>t.onExecute()),t.onCreate&&t.onCreate(e),t)"onExecute"!=i&&"onCreate"!=i&&e.set(i,t[i]);this.children.add(e)}this._updateFocusCyclableItems()}focus(e){-1===e?this.focusCycler.focusLast():this.focusCycler.focusFirst()}_updateFocusCyclableItems(){Array.from(this.children).forEach(e=>{this._focusables.add(e),this._focusTracker.add(e.element)})}}class ko extends Zi{children;constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog__content"]},children:this.children})}reset(){for(;this.children.length;)this.children.remove(0)}}var wo=i(880),_o={attributes:{"data-cke":!0}};_o.setAttributes=Ki(),_o.insert=$i().bind(null,"head"),_o.domAPI=Hi(),_o.insertStyleElement=Yi();ji()(wo.A,_o);wo.A&&wo.A.locals&&wo.A.locals;const vo="screen-center",yo="editor-center",Ao="editor-top-side",xo="editor-top-center",Co="editor-bottom-center",To="editor-above-center",Eo="editor-below-center",Io=st("px");class So extends(go(Zi)){parts;headerView;closeButtonView;actionsView;static defaultOffset=15;contentView;keystrokes;focusTracker;wasMoved=!1;_getCurrentDomRoot;_getViewportOffset;_focusables;_focusCycler;constructor(e,{getCurrentDomRoot:t,getViewportOffset:i,keystrokeHandlerOptions:n}){super(e);const o=this.bindTemplate,r=e.t;this.set("className",""),this.set("ariaLabel",r("Editor dialog")),this.set("isModal",!1),this.set("position",vo),this.set("_isVisible",!1),this.set("_isTransparent",!1),this.set("_top",0),this.set("_left",0),this._getCurrentDomRoot=t,this._getViewportOffset=i,this.decorate("moveTo"),this.parts=this.createCollection(),this.keystrokes=new ti,this.focusTracker=new Qt,this._focusables=new pi,this._focusCycler=new uo({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"},keystrokeHandlerOptions:n}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog-overlay",o.if("isModal","ck-dialog-overlay__transparent",e=>!e),o.if("_isVisible","ck-hidden",e=>!e)],tabindex:"-1"},children:[{tag:"div",attributes:{tabindex:"-1",class:["ck","ck-dialog",o.if("isModal","ck-dialog_modal"),o.to("className")],role:"dialog","aria-label":o.to("ariaLabel"),style:{top:o.to("_top",e=>Io(e)),left:o.to("_left",e=>Io(e)),visibility:o.if("_isTransparent","hidden")}},children:this.parts}]})}render(){super.render(),this.keystrokes.set("Esc",(e,t)=>{e.defaultPrevented||(this.fire("close",{source:"escKeyPress"}),t())}),this.on("drag",(e,{deltaX:t,deltaY:i})=>{this.wasMoved=!0,this.moveBy(t,i)}),this.listenTo(e.window,"resize",()=>{this._isVisible&&!this.wasMoved&&this.updatePosition()}),this.listenTo(e.document,"scroll",()=>{this._isVisible&&!this.wasMoved&&this.updatePosition()}),this.on("change:_isVisible",(e,t,i)=>{i&&(this._isTransparent=!0,setTimeout(()=>{this.updatePosition(),this._isTransparent=!1,this.focus()},10))}),this.keystrokes.listenTo(this.element)}get dragHandleElement(){return this.headerView&&!this.isModal?this.headerView.element:null}setupParts({icon:e,title:t,hasCloseButton:i=!0,content:n,actionButtons:o}){t&&(this.headerView=new oo(this.locale,{icon:e}),i&&(this.closeButtonView=this._createCloseButton(),this.headerView.children.add(this.closeButtonView)),this.headerView.label=t,this.ariaLabel=t,this.parts.add(this.headerView,0)),n&&(n instanceof Zi&&(n=[n]),this.contentView=new ko(this.locale),this.contentView.children.addMany(n),this.parts.add(this.contentView)),o&&(this.actionsView=new bo(this.locale),this.actionsView.setButtons(o),this.parts.add(this.actionsView)),this._updateFocusCyclableItems()}focus(){this._focusCycler.focusFirst()}moveTo(e,t){const i=this._getViewportRect(),n=this._getDialogRect();e+n.width>i.right&&(e=i.right-n.width),e<i.left&&(e=i.left),t<i.top&&(t=i.top),this._moveTo(e,t)}_moveTo(e,t){this._left=e,this._top=t}moveBy(e,t){this.moveTo(this._left+e,this._top+t)}_moveOffScreen(){this._moveTo(-9999,-9999)}updatePosition(){if(!this.element||!this.element.parentNode)return;const e=this._getViewportRect();let t,i=this.position;this._getCurrentDomRoot()?t=this._getVisibleDomRootRect(e):i=vo;const n=So.defaultOffset,o=this._getDialogRect();if(null!=this.position){if("function"==typeof this.position){const e=this.position(o,t);return null==e?void this._moveOffScreen():void this._moveTo(e.left,e.top)}switch(i){case Ao:if(t){const e="ltr"===this.locale.contentLanguageDirection?t.right-o.width-n:t.left+n;this.moveTo(e,t.top+n)}else this._moveOffScreen();break;case yo:t?this.moveTo(Math.round(t.left+t.width/2-o.width/2),Math.round(t.top+t.height/2-o.height/2)):this._moveOffScreen();break;case vo:this.moveTo(Math.round((e.width-o.width)/2),Math.round((e.height-o.height)/2));break;case xo:t?this.moveTo(Math.round(t.left+t.width/2-o.width/2),t.top+n):this._moveOffScreen();break;case Co:t?this.moveTo(Math.round(t.left+t.width/2-o.width/2),t.bottom-o.height-n):this._moveOffScreen();break;case To:t?this.moveTo(Math.round(t.left+t.width/2-o.width/2),t.top-o.height-n):this._moveOffScreen();break;case Eo:t?this.moveTo(Math.round(t.left+t.width/2-o.width/2),t.bottom+n):this._moveOffScreen()}}}_getVisibleDomRootRect(e){let t=new Ze(this._getCurrentDomRoot()).getVisible();return t?(t=e.getIntersection(t),t||null):null}_getDialogRect(){return new Ze(this.element.firstElementChild)}_getViewportRect(){const t=new Ze(e.window);return this.isModal?t:gt(this._getViewportOffset())}_updateFocusCyclableItems(){const e=[];if(this.contentView)for(const t of this.contentView.children)mo(t)&&e.push(t);this.actionsView&&e.push(this.actionsView),this.closeButtonView&&e.push(this.closeButtonView),e.forEach(e=>{var t;this._focusables.add(e),this.focusTracker.add(e.element),mo(t=e)&&"focusCycler"in t&&t.focusCycler instanceof uo&&this._focusCycler.chain(e.focusCycler)})}_createCloseButton(){const e=new lo(this.locale),t=this.locale.t;return e.set({label:t("Close"),tooltip:!0,icon:to}),e.on("execute",()=>this.fire("close",{source:"closeButton"})),e}}var Po=i(1111),Mo={attributes:{"data-cke":!0}};Mo.setAttributes=Ki(),Mo.insert=$i().bind(null,"head"),Mo.domAPI=Hi(),Mo.insertStyleElement=Yi();ji()(Po.A,Mo);Po.A&&Po.A.locals&&Po.A.locals;const Oo=new WeakMap;let Ro=!1;function No({view:e,element:t,text:i,isDirectHost:n=!0,keepOnFocus:o=!1}){const r=e.document;function s(i){const s={text:i,isDirectHost:n,keepOnFocus:o,hostElement:n?t:null};Oo.get(r).set(t,s),e.change(e=>Lo([[t,s]],e))}Oo.has(r)||(Oo.set(r,new Map),r.registerPostFixer(e=>Lo(Oo.get(r),e)),r.on("change:isComposing",()=>{e.change(e=>Lo(Oo.get(r),e))},{priority:"high"})),t.is("editableElement")&&t.on("change:placeholder",(e,t,i)=>s(i)),t.placeholder?s(t.placeholder):i&&s(i),i&&function(){Ro||x("enableViewPlaceholder-deprecated-text-option");Ro=!0}()}function Vo(e,t){return!!t.hasClass("ck-placeholder")&&(e.removeClass("ck-placeholder",t),!0)}function Lo(e,t){const i=[];let n=!1;for(const[o,r]of e)r.isDirectHost&&(i.push(o),Do(t,o,r)&&(n=!0));for(const[o,r]of e){if(r.isDirectHost)continue;const e=Bo(o);e!==r.hostElement&&r.hostElement&&(t.removeAttribute("data-placeholder",r.hostElement),Vo(t,r.hostElement),r.hostElement=null,n=!0),e&&(i.includes(e)||(r.hostElement=e,Do(t,o,r)&&(n=!0)))}return n}function Do(e,t,i){const{text:n,isDirectHost:o,hostElement:r}=i;let s=!1;r.getAttribute("data-placeholder")!==n&&(e.setAttribute("data-placeholder",n,r),s=!0);return(o||1==t.childCount)&&function(e,t){if(!e.isAttached())return!1;if(function(e){for(const t of e.getChildren())if(!t.is("uiElement"))return!0;return!1}(e))return!1;const i=e.document,n=i.selection.anchor;return!(i.isComposing&&n&&n.parent===e||!t&&i.isFocused&&(!n||n.parent===e))}(r,i.keepOnFocus)?function(e,t){return!t.hasClass("ck-placeholder")&&(e.addClass("ck-placeholder",t),!0)}(e,r)&&(s=!0):Vo(e,r)&&(s=!0),s}function Bo(e){if(e.childCount){const t=e.getChild(0);if(t.is("element")&&!t.is("uiElement")&&!t.is("attributeElement"))return t}return null}class zo{is(){throw new Error("is() method is abstract")}}class Fo extends(O(zo)){document;parent;constructor(e){super(),this.document=e,this.parent=null}get index(){let e;if(!this.parent)return null;if(-1==(e=this.parent.getChildIndex(this)))throw new A("view-node-not-found-in-parent",this);return e}get nextSibling(){const e=this.index;return null!==e&&this.parent.getChild(e+1)||null}get previousSibling(){const e=this.index;return null!==e&&this.parent.getChild(e-1)||null}get root(){let e=this;for(;e.parent;)e=e.parent;return e}isAttached(){return this.root.is("rootElement")}getPath(){const e=[];let t=this;for(;t.parent;)e.unshift(t.index),t=t.parent;return e}getAncestors(e={}){const t=[];let i=e.includeSelf?this:this.parent;for(;i;)t[e.parentFirst?"push":"unshift"](i),i=i.parent;return t}getCommonAncestor(e,t={}){const i=this.getAncestors(t),n=e.getAncestors(t);let o=0;for(;i[o]==n[o]&&i[o];)o++;return 0===o?null:i[o-1]}isBefore(e){if(this==e)return!1;if(this.root!==e.root)return!1;const t=this.getPath(),i=e.getPath(),n=te(t,i);switch(n){case"prefix":return!0;case"extension":return!1;default:return t[n]<i[n]}}isAfter(e){return this!=e&&(this.root===e.root&&!this.isBefore(e))}_remove(){this.parent._removeChildren(this.index)}_fireChange(e,t,i){this.fire(`change:${e}`,t,i),this.parent&&this.parent._fireChange(e,t,i)}toJSON(){const e={path:this.getPath(),type:"Node"};return this!==this.root&&this.root.is("rootElement")&&(e.root=this.root.toJSON()),e}}Fo.prototype.is=function(e){return"node"===e||"view:node"===e};class jo extends Fo{_textData;constructor(e,t){super(e),this._textData=t}get data(){return this._textData}get _data(){return this.data}set _data(e){this._fireChange("text",this),this._textData=e}isSimilar(e){return e instanceof jo&&(this===e||this.data===e.data)}toJSON(){const e=super.toJSON();return e.type="Text",e.data=this.data,e}_clone(){return new jo(this.document,this.data)}}jo.prototype.is=function(e){return"$text"===e||"view:$text"===e||"text"===e||"view:text"===e||"node"===e||"view:node"===e};class Uo extends zo{textNode;data;offsetInText;constructor(e,t,i){if(super(),this.textNode=e,t<0||t>e.data.length)throw new A("view-textproxy-wrong-offsetintext",this);if(i<0||t+i>e.data.length)throw new A("view-textproxy-wrong-length",this);this.data=e.data.substring(t,t+i),this.offsetInText=t}get offsetSize(){return this.data.length}get isPartial(){return this.data.length!==this.textNode.data.length}get parent(){return this.textNode.parent}get root(){return this.textNode.root}get document(){return this.textNode.document}getAncestors(e={}){const t=[];let i=e.includeSelf?this.textNode:this.parent;for(;null!==i;)t[e.parentFirst?"push":"unshift"](i),i=i.parent;return t}}Uo.prototype.is=function(e){return"$textProxy"===e||"view:$textProxy"===e||"textProxy"===e||"view:textProxy"===e};class Ho{_consumables=new Map;add(e,t){let i;e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!0):(this._consumables.has(e)?i=this._consumables.get(e):(i=new Wo(e),this._consumables.set(e,i)),i.add(t?$o(t):e._getConsumables()))}test(e,t){const i=this._consumables.get(e);return void 0===i?null:e.is("$text")||e.is("documentFragment")?i:i.test($o(t))}consume(e,t){if(e.is("$text")||e.is("documentFragment"))return!!this.test(e,t)&&(this._consumables.set(e,!1),!0);const i=this._consumables.get(e);return void 0!==i&&i.consume($o(t))}revert(e,t){const i=this._consumables.get(e);void 0!==i&&(e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!0):i.revert($o(t)))}static createFrom(e,t){if(t||(t=new Ho),e.is("$text"))t.add(e);else if(e.is("element")||e.is("documentFragment")){t.add(e);for(const i of e.getChildren())Ho.createFrom(i,t)}return t}}class Wo{element;_canConsumeName=null;_attributes=new Map;constructor(e){this.element=e}add(e){e.name&&(this._canConsumeName=!0);for(const[t,i]of e.attributes)if(i){let e=this._attributes.get(t);e&&"boolean"!=typeof e||(e=new Map,this._attributes.set(t,e)),e.set(i,!0)}else{if("style"==t||"class"==t)throw new A("viewconsumable-invalid-attribute",this);this._attributes.set(t,!0)}}test(e){if(e.name&&!this._canConsumeName)return this._canConsumeName;for(const[t,i]of e.attributes){const e=this._attributes.get(t);if(void 0===e)return null;if(!1===e)return!1;if(!0!==e)if(i){const t=e.get(i);if(void 0===t)return null;if(!t)return!1}else for(const t of e.values())if(!t)return!1}return!0}consume(e){if(!this.test(e))return!1;e.name&&(this._canConsumeName=!1);for(const[t,i]of e.attributes){const e=this._attributes.get(t);if("boolean"==typeof e)for(const[e]of this.element._getConsumables(t,i).attributes)this._attributes.set(e,!1);else if(i)for(const[,n]of this.element._getConsumables(t,i).attributes)e.set(n,!1);else for(const t of e.keys())e.set(t,!1)}return!0}revert(e){e.name&&(this._canConsumeName=!0);for(const[t,i]of e.attributes){const e=this._attributes.get(t);if(!1!==e){if(void 0!==e&&!0!==e)if(i){!1===e.get(i)&&e.set(i,!0)}else for(const t of e.keys())e.set(t,!0)}else this._attributes.set(t,!0)}}}function $o(e){const t=[];return"attributes"in e&&e.attributes&&qo(t,e.attributes),"classes"in e&&e.classes&&qo(t,e.classes,"class"),"styles"in e&&e.styles&&qo(t,e.styles,"style"),{name:e.name||!1,attributes:t}}function qo(e,t,i){if("string"!=typeof t)for(const n of t)Array.isArray(n)?e.push(n):e.push(i?[i,n]:[n]);else e.push(i?[i,t]:[t])}class Ko{_patterns=[];constructor(...e){this.add(...e)}add(...e){for(let t of e)("string"==typeof t||t instanceof RegExp)&&(t={name:t}),this._patterns.push(t)}match(...e){for(const t of e)for(const e of this._patterns){const i=this._isElementMatching(t,e);if(i)return{element:t,pattern:e,match:i}}return null}matchAll(...e){const t=[];for(const i of e)for(const e of this._patterns){const n=this._isElementMatching(i,e);n&&t.push({element:i,pattern:e,match:n})}return t.length>0?t:null}getElementName(){if(1!==this._patterns.length)return null;const e=this._patterns[0],t=e.name;return"function"==typeof e||!t||t instanceof RegExp?null:t}_isElementMatching(e,t){if("function"==typeof t){const i=t(e);return i&&"object"==typeof i?$o(i):i}const i={};if(t.name&&(i.name=function(e,t){if(e instanceof RegExp)return!!t.match(e);return e===t}(t.name,e.name),!i.name))return null;const n=[];return t.attributes&&!function(e,t,i){let n;"object"!=typeof e||e instanceof RegExp||Array.isArray(e)?n=["class","style"]:(void 0!==e.style&&x("matcher-pattern-deprecated-attributes-style-key",e),void 0!==e.class&&x("matcher-pattern-deprecated-attributes-class-key",e));return t._collectAttributesMatch(Yo(e),i,n)}(t.attributes,e,n)||t.classes&&!function(e,t,i){return t._collectAttributesMatch(Yo(e,"class"),i)}(t.classes,e,n)||t.styles&&!function(e,t,i){return t._collectAttributesMatch(Yo(e,"style"),i)}(t.styles,e,n)?null:(n.length&&(i.attributes=n),i)}}function Go(e,t){return!0===e||e===t||e instanceof RegExp&&!!String(t).match(e)}function Yo(e,t){if(Array.isArray(e))return e.map(e=>"object"!=typeof e||e instanceof RegExp?t?[t,e,!0]:[e,!0]:(void 0!==e.key&&void 0!==e.value||x("matcher-pattern-missing-key-or-value",e),t?[t,e.key,e.value]:[e.key,e.value]));if("object"!=typeof e||e instanceof RegExp)return[t?[t,e,!0]:[e,!0]];const i=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&i.push(t?[t,n,e[n]]:[n,e[n]]);return i}function Jo(e){switch(typeof e){case"number":case"symbol":return!1;case"string":return e.includes(".")||e.includes("[")||e.includes("]")}}function Qo(e){return"string"==typeof e||"symbol"==typeof e?e:Object.is(e?.valueOf?.(),-0)?"-0":String(e)}function Zo(e){const t=[],i=e.length;if(0===i)return t;let n=0,o="",r="",s=!1;for(46===e.charCodeAt(0)&&(t.push(""),n++);n<i;){const a=e[n];r?"\\"===a&&n+1<i?(n++,o+=e[n]):a===r?r="":o+=a:s?'"'===a||"'"===a?r=a:"]"===a?(s=!1,t.push(o),o=""):o+=a:"["===a?(s=!0,o&&(t.push(o),o="")):"."===a?o&&(t.push(o),o=""):o+=a,n++}return o&&t.push(o),t}function Xo(e,t,i){if(null==e)return i;switch(typeof t){case"string":{if(zt(t))return i;const n=e[t];return void 0===n?Jo(t)?Xo(e,Zo(t),i):i:n}case"number":case"symbol":{"number"==typeof t&&(t=Qo(t));const n=e[t];return void 0===n?i:n}default:{if(Array.isArray(t))return function(e,t,i){if(0===t.length)return i;let n=e;for(let e=0;e<t.length;e++){if(null==n)return i;if(zt(t[e]))return i;n=n[t[e]]}if(void 0===n)return i;return n}(e,t,i);if(zt(t=Object.is(t?.valueOf(),-0)?"-0":String(t)))return i;const n=e[t];return void 0===n?i:n}}}function er(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}const tr=(e,t,i)=>{const n=e[t];Object.hasOwn(e,t)&&er(n,i)&&(void 0!==i||t in e)||(e[t]=i)},ir=/^(?:0|[1-9]\d*)$/;function nr(e,t=Number.MAX_SAFE_INTEGER){switch(typeof e){case"number":return Number.isInteger(e)&&e>=0&&e<t;case"symbol":return!1;case"string":return ir.test(e)}}function or(e){return"symbol"==typeof e||e instanceof Symbol}const rr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,sr=/^\w*$/;function ar(e,t,i,n){if(null==e&&!F(e))return e;const o=(r=t,s=e,!Array.isArray(r)&&("number"==typeof r||"boolean"==typeof r||null==r||or(r)||"string"==typeof r&&(sr.test(r)||!rr.test(r))||null!=s&&Object.hasOwn(s,r))?[t]:Array.isArray(t)?t:"string"==typeof t?Zo(t):[t]);var r,s;let a=e;for(let t=0;t<o.length&&null!=a;t++){const r=Qo(o[t]);if(zt(r))continue;let s;if(t===o.length-1)s=i(a[r]);else{const i=a[r],l=n?.(i,r,e);s=void 0!==l?l:F(i)?i:nr(o[t+1])?[]:{}}tr(a,r,s),a=a[r]}return e}function lr(e,t,i){return ar(e,t,()=>i,()=>{})}class cr{_styles;_cachedStyleNames=null;_cachedExpandedStyleNames=null;_styleProcessor;constructor(e){this._styles={},this._styleProcessor=e}get isEmpty(){return!Object.entries(this._styles).length}get size(){return this.isEmpty?0:this.getStyleNames().length}setTo(e){this.clear();const t=function(e){let t=null,i=0,n=0,o=null;const r=new Map;if(""===e)return r;";"!=e.charAt(e.length-1)&&(e+=";");for(let s=0;s<e.length;s++){const a=e.charAt(s);if(null===t)switch(a){case":":o||(o=e.substr(i,s-i),n=s+1);break;case'"':case"'":t=a;break;case";":{const t=e.substr(n,s-n);o&&r.set(o.trim(),t.trim()),o=null,i=s+1;break}}else a===t&&(t=null)}return r}(e);for(const[e,i]of t)this._styleProcessor.toNormalizedForm(e,i,this._styles);return this}has(e){if(this.isEmpty)return!1;const t=this._styleProcessor.getReducedForm(e,this._styles).find(([t])=>t===e);return Array.isArray(t)}set(e,t){if(this._cachedStyleNames=null,this._cachedExpandedStyleNames=null,F(e))for(const[t,i]of Object.entries(e))this._styleProcessor.toNormalizedForm(t,i,this._styles);else this._styleProcessor.toNormalizedForm(e,t,this._styles)}remove(e){const t={};for(const i of Dt(e)){const e=ur(i),n=Xo(this._styles,e);if(n)hr(t,e,n);else{const e=this.getAsString(i);void 0!==e&&this._styleProcessor.toNormalizedForm(i,e,t)}}Object.keys(t).length&&(mr(this._styles,t),this._cachedStyleNames=null,this._cachedExpandedStyleNames=null)}getNormalized(e){return this._styleProcessor.getNormalized(e,this._styles)}toString(){return this.isEmpty?"":this.getStylesEntries().map(e=>e.join(":")).sort().join(";")+";"}getAsString(e){if(this.isEmpty)return;if(this._styles[e]&&!F(this._styles[e]))return this._styles[e];const t=this._styleProcessor.getReducedForm(e,this._styles).find(([t])=>t===e);return Array.isArray(t)?t[1]:void 0}getStyleNames(e=!1){return this.isEmpty?[]:e?(this._cachedExpandedStyleNames||=this._styleProcessor.getStyleNames(this._styles),this._cachedExpandedStyleNames):(this._cachedStyleNames||=this.getStylesEntries().map(([e])=>e),this._cachedStyleNames)}keys(){return this.getStyleNames()}clear(){this._styles={},this._cachedStyleNames=null,this._cachedExpandedStyleNames=null}isSimilar(e){if(this.size!==e.size)return!1;for(const t of this.getStyleNames())if(!e.has(t)||e.getAsString(t)!==this.getAsString(t))return!1;return!0}getStylesEntries(){const e=[],t=Object.keys(this._styles);for(const i of t)e.push(...this._styleProcessor.getReducedForm(i,this._styles));return e}_clone(){const e=new this.constructor(this._styleProcessor);return e.set(this.getNormalized()),e}_getTokensMatch(e,t){const i=[];for(const n of this.getStyleNames(!0))if(Go(e,n)){if(!0===t){i.push(n);continue}Go(t,this.getAsString(n))&&i.push(n)}return i.length?i:void 0}_getConsumables(e){const t=[];if(e){t.push(e);for(const i of this._styleProcessor.getRelatedStyles(e))t.push(i)}else for(const e of this.getStyleNames()){for(const i of this._styleProcessor.getRelatedStyles(e))t.push(i);t.push(e)}return t}_canMergeFrom(e){for(const t of e.getStyleNames())if(this.has(t)&&this.getAsString(t)!==e.getAsString(t))return!1;return!0}_mergeFrom(e){for(const t of e.getStyleNames())this.has(t)||this.set(t,e.getAsString(t))}_isMatching(e){for(const t of e.getStyleNames())if(!this.has(t)||this.getAsString(t)!==e.getAsString(t))return!1;return!0}}class dr{_normalizers;_extractors;_reducers;_consumables;constructor(){this._normalizers=new Map,this._extractors=new Map,this._reducers=new Map,this._consumables=new Map}toNormalizedForm(e,t,i){if(F(t))hr(i,ur(e),t);else if(this._normalizers.has(e)){const n=this._normalizers.get(e),{path:o,value:r}=n(t);hr(i,o,r)}else hr(i,e,t)}getNormalized(e,t){if(!e)return Wt({},t);if(void 0!==t[e])return t[e];if(this._extractors.has(e)){const i=this._extractors.get(e);if("string"==typeof i)return Xo(t,i);const n=i(e,t);if(n)return n}return Xo(t,ur(e))}getReducedForm(e,t){const i=this.getNormalized(e,t);if(void 0===i)return[];if(this._reducers.has(e)){return this._reducers.get(e)(i)}return[[e,i]]}getStyleNames(e){const t=new Set;for(const i of this._consumables.keys()){const n=this.getNormalized(i,e);n&&("object"!=typeof n||Object.keys(n).length)&&t.add(i)}for(const i of Object.keys(e))t.add(i);return Array.from(t)}getRelatedStyles(e){return this._consumables.get(e)||[]}setNormalizer(e,t){this._normalizers.set(e,t)}setExtractor(e,t){this._extractors.set(e,t)}setReducer(e,t){this._reducers.set(e,t)}setStyleRelation(e,t){this._mapStyleNames(e,t);for(const i of t)this._mapStyleNames(i,[e])}_mapStyleNames(e,t){this._consumables.has(e)||this._consumables.set(e,[]),this._consumables.get(e).push(...t)}}function ur(e){return e.replace("-",".")}function hr(e,t,i){let n=i;F(i)&&(n=Wt({},Xo(e,t),i)),lr(e,t,n)}function mr(e,t){for(const i of Object.keys(t))null===e[i]||Array.isArray(e[i])||"object"!=typeof e[i]||"object"!=typeof t[i]?delete e[i]:(mr(e[i],t[i]),Object.keys(e[i]).length||delete e[i])}class gr{_set=new Set;get isEmpty(){return 0==this._set.size}get size(){return this._set.size}has(e){return this._set.has(e)}keys(){return Array.from(this._set.keys())}setTo(e){this.clear();for(const t of e.split(/\s+/))t&&this._set.add(t);return this}set(e){for(const t of Dt(e))t&&this._set.add(t)}remove(e){for(const t of Dt(e))this._set.delete(t)}clear(){this._set.clear()}toString(){return Array.from(this._set).join(" ")}isSimilar(e){if(this.size!==e.size)return!1;for(const t of this.keys())if(!e.has(t))return!1;return!0}_clone(){const e=new this.constructor;return e._set=new Set(this._set),e}_getTokensMatch(e){const t=[];if(!0===e){for(const e of this._set.keys())t.push(e);return t}if("string"==typeof e){for(const i of e.split(/\s+/)){if(!this._set.has(i))return;t.push(i)}return t}for(const i of this._set.keys())i.match(e)&&t.push(i);return t.length?t:void 0}_getConsumables(e){return e?[e]:this.keys()}_canMergeFrom(){return!0}_mergeFrom(e){for(const t of e._set.keys())this._set.has(t)||this._set.add(t)}_isMatching(e){for(const t of e._set.keys())if(!this._set.has(t))return!1;return!0}}class fr extends Fo{name;_unsafeAttributesToRender=[];_attrs;_children;_customProperties=new Map;get _classes(){return this._attrs.get("class")}get _styles(){return this._attrs.get("style")}constructor(e,t,i,n){super(e),this.name=t,this._attrs=this._parseAttributes(i),this._children=[],n&&this._insertChild(0,n)}get childCount(){return this._children.length}get isEmpty(){return 0===this._children.length}getChild(e){return this._children[e]}getChildIndex(e){return this._children.indexOf(e)}getChildren(){return this._children[Symbol.iterator]()}*getAttributeKeys(){this._classes&&(yield"class"),this._styles&&(yield"style");for(const e of this._attrs.keys())"class"!=e&&"style"!=e&&(yield e)}*getAttributes(){for(const[e,t]of this._attrs.entries())yield[e,String(t)]}getAttribute(e){return this._attrs.has(e)?String(this._attrs.get(e)):void 0}hasAttribute(e,t){return!!this._attrs.has(e)&&(void 0===t||(br(this.name,e)||pr(this.name,e)?this._attrs.get(e).has(t):this._attrs.get(e)===t))}isSimilar(e){if(!(e instanceof fr))return!1;if(this===e)return!0;if(this.name!=e.name)return!1;if(this._attrs.size!==e._attrs.size)return!1;for(const[t,i]of this._attrs){const n=e._attrs.get(t);if(void 0===n)return!1;if("string"==typeof i||"string"==typeof n){if(n!==i)return!1}else if(!i.isSimilar(n))return!1}return!0}hasClass(...e){for(const t of e)if(!this._classes||!this._classes.has(t))return!1;return!0}getClassNames(){const e=this._classes?this._classes.keys():[],t=e[Symbol.iterator]();return Object.assign(e,{next:t.next.bind(t)})}getStyle(e){return this._styles&&this._styles.getAsString(e)}getNormalizedStyle(e){return this._styles&&this._styles.getNormalized(e)}getStyleNames(e){return this._styles?this._styles.getStyleNames(e):[]}hasStyle(...e){for(const t of e)if(!this._styles||!this._styles.has(t))return!1;return!0}findAncestor(...e){const t=new Ko(...e);let i=this.parent;for(;i&&!i.is("documentFragment");){if(t.match(i))return i;i=i.parent}return null}getCustomProperty(e){return this._customProperties.get(e)}*getCustomProperties(){yield*this._customProperties.entries()}getIdentity(){const e=this._classes?this._classes.keys().sort().join(","):"",t=this._styles&&String(this._styles),i=Array.from(this._attrs).filter(([e])=>"style"!=e&&"class"!=e).map(e=>`${e[0]}="${e[1]}"`).sort().join(" ");return this.name+(""==e?"":` class="${e}"`)+(t?` style="${t}"`:"")+(""==i?"":` ${i}`)}shouldRenderUnsafeAttribute(e){return this._unsafeAttributesToRender.includes(e)}toJSON(){const e=super.toJSON();if(e.name=this.name,e.type="Element",this._attrs.size&&(e.attributes=Object.fromEntries(this.getAttributes())),this._children.length>0){e.children=[];for(const t of this._children)e.children.push(t.toJSON())}return e}_clone(e=!1){const t=[];if(e)for(const i of this.getChildren())t.push(i._clone(e));const i=new this.constructor(this.document,this.name,this._attrs,t);return i._customProperties=new Map(this._customProperties),i.getFillerOffset=this.getFillerOffset,i._unsafeAttributesToRender=this._unsafeAttributesToRender,i}_appendChild(e){return this._insertChild(this.childCount,e)}_insertChild(e,t){this._fireChange("children",this,{index:e});let i=0;const n=function(e,t){if("string"==typeof t)return[new jo(e,t)];ie(t)||(t=[t]);const i=[];for(const n of t)"string"==typeof n?i.push(new jo(e,n)):n instanceof Uo?i.push(new jo(e,n.data)):i.push(n);return i}(this.document,t);for(const t of n)null!==t.parent&&t._remove(),t.parent=this,t.document=this.document,this._children.splice(e,0,t),e++,i++;return i}_removeChildren(e,t=1){this._fireChange("children",this,{index:e});for(let i=e;i<e+t;i++)this._children[i].parent=null;return this._children.splice(e,t)}_setAttribute(e,t,i=!0){if(this._fireChange("attributes",this),br(this.name,e)||pr(this.name,e)){let n=this._attrs.get(e);n||(n=br(this.name,e)?new cr(this.document.stylesProcessor):new gr,this._attrs.set(e,n)),i?n.setTo(String(t)):br(this.name,e)?Array.isArray(t)?n.set(t[0],t[1]):n.set(t):n.set("string"==typeof t?t.split(/\s+/):t)}else this._attrs.set(e,String(t))}_removeAttribute(e,t){if(this._fireChange("attributes",this),void 0!==t&&(br(this.name,e)||pr(this.name,e))){const i=this._attrs.get(e);return!!i&&(pr(this.name,e)&&"string"==typeof t&&(t=t.split(/\s+/)),i.remove(t),!!i.isEmpty&&this._attrs.delete(e))}return this._attrs.delete(e)}_addClass(e){this._setAttribute("class",e,!1)}_removeClass(e){this._removeAttribute("class",e)}_setStyle(e,t){"string"!=typeof e?this._setAttribute("style",e,!1):this._setAttribute("style",[e,t],!1)}_removeStyle(e){this._removeAttribute("style",e)}_collectAttributesMatch(e,t,i){for(const[n,o,r]of e){let e=!1,s=!1;for(const[a,l]of this._attrs)if(!(i&&i.includes(a)||!Go(n,a)))if(e=!0,"string"==typeof l){if(Go(o,l))t.push([a]),s=!0;else if(!(n instanceof RegExp))return!1}else{const e=l._getTokensMatch(o,r||!0);if(e){s=!0;for(const i of e)t.push([a,i])}else if(!(n instanceof RegExp))return!1}if(!e||!s)return!1}return!0}_getConsumables(e,t){const i=[];if(e){const n=this._attrs.get(e);if(void 0!==n)if("string"==typeof n)i.push([e]);else for(const o of n._getConsumables(t))i.push([e,o])}else for(const[e,t]of this._attrs)if("string"==typeof t)i.push([e]);else for(const n of t._getConsumables())i.push([e,n]);return{name:!e,attributes:i}}_canMergeAttributesFrom(e){if(this.name!=e.name)return!1;for(const[t,i]of e._attrs){const e=this._attrs.get(t);if(void 0!==e)if("string"==typeof e||"string"==typeof i){if(e!==i)return!1}else if(!e._canMergeFrom(i))return!1}return!0}_mergeAttributesFrom(e){this._fireChange("attributes",this);for(const[t,i]of e._attrs){const e=this._attrs.get(t);void 0===e||"string"==typeof e||"string"==typeof i?this._setAttribute(t,i):e._mergeFrom(i)}}_canSubtractAttributesOf(e){if(this.name!=e.name)return!1;for(const[t,i]of e._attrs){const e=this._attrs.get(t);if(void 0===e)return!1;if("string"==typeof e||"string"==typeof i){if(e!==i)return!1}else if(!e._isMatching(i))return!1}return!0}_subtractAttributesOf(e){this._fireChange("attributes",this);for(const[t,i]of e._attrs){const e=this._attrs.get(t);"string"==typeof e||"string"==typeof i?this._attrs.delete(t):(e.remove(i.keys()),e.isEmpty&&this._attrs.delete(t))}}_setCustomProperty(e,t){this._customProperties.set(e,t)}_removeCustomProperty(e){return this._customProperties.delete(e)}_parseAttributes(e){const t=ii(e);for(const[e,i]of t)if(null===i)t.delete(e);else if(br(this.name,e)){const n=i instanceof cr?i._clone():new cr(this.document.stylesProcessor).setTo(String(i));t.set(e,n)}else if(pr(this.name,e)){const n=i instanceof gr?i._clone():(new gr).setTo(String(i));t.set(e,n)}else"string"!=typeof i&&t.set(e,String(i));return t}}function pr(e,t){return"class"==t||"a"==e&&"rel"==t}function br(e,t){return"style"==t}fr.prototype.is=function(e,t){return t?t===this.name&&("element"===e||"view:element"===e):"element"===e||"view:element"===e||"node"===e||"view:node"===e};class kr extends fr{constructor(e,t,i,n){super(e,t,i,n),this.getFillerOffset=wr}toJSON(){const e=super.toJSON();return e.type="ContainerElement",e}}function wr(){const e=[...this.getChildren()],t=e[this.childCount-1];if(t&&t.is("element","br"))return this.childCount;for(const t of e)if(!t.is("uiElement"))return null;return this.childCount}kr.prototype.is=function(e,t){return t?t===this.name&&("containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e):"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e};class _r extends(K(kr)){constructor(e,t,i,n){super(e,t,i,n),this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("placeholder",void 0),this.bind("isReadOnly").to(e),this.bind("isFocused").to(e,"isFocused",t=>t&&e.selection.editableElement==this),this.listenTo(e.selection,"change",()=>{this.isFocused=e.isFocused&&e.selection.editableElement==this})}destroy(){this.stopListening()}toJSON(){const e=super.toJSON();return e.type="EditableElement",e.isReadOnly=this.isReadOnly,e.isFocused=this.isFocused,e}}_r.prototype.is=function(e,t){return t?t===this.name&&("editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e):"editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e};const vr=Symbol("rootName");class yr extends _r{constructor(e,t){super(e,t),this.rootName="main"}get rootName(){return this.getCustomProperty(vr)}set rootName(e){this._setCustomProperty(vr,e)}toJSON(){return this.rootName}set _name(e){this.name=e}}yr.prototype.is=function(e,t){return t?t===this.name&&("rootElement"===e||"view:rootElement"===e||"editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e):"rootElement"===e||"view:rootElement"===e||"editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e};class Ar{direction;boundaries;singleCharacters;shallow;ignoreElementEnd;_position;_boundaryStartParent;_boundaryEndParent;constructor(e={}){if(!e.boundaries&&!e.startPosition)throw new A("view-tree-walker-no-start-position",null);if(e.direction&&"forward"!=e.direction&&"backward"!=e.direction)throw new A("view-tree-walker-unknown-direction",e.startPosition,{direction:e.direction});this.boundaries=e.boundaries||null,e.startPosition?this._position=xr._createAt(e.startPosition):this._position=xr._createAt(e.boundaries["backward"==e.direction?"end":"start"]),this.direction=e.direction||"forward",this.singleCharacters=!!e.singleCharacters,this.shallow=!!e.shallow,this.ignoreElementEnd=!!e.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null}[Symbol.iterator](){return this}get position(){return this._position}skip(e){let t,i;do{i=this.position,t=this.next()}while(!t.done&&e(t.value));t.done||(this._position=i)}jumpTo(e){this._boundaryStartParent&&e.isBefore(this.boundaries.start)?e=this.boundaries.start:this._boundaryEndParent&&e.isAfter(this.boundaries.end)&&(e=this.boundaries.end),this._position=e.clone()}next(){return"forward"==this.direction?this._next():this._previous()}_next(){let e=this.position.clone();const t=this.position,i=e.parent;if(null===i.parent&&e.offset===i.childCount)return{done:!0,value:void 0};if(i===this._boundaryEndParent&&e.offset==this.boundaries.end.offset)return{done:!0,value:void 0};let n;if(i&&i.is("view:$text")){if(e.isAtEnd)return this._position=xr._createAfter(i),this._next();n=i.data[e.offset]}else n=i.getChild(e.offset);if("string"==typeof n){let n;if(this.singleCharacters)n=1;else{n=(i===this._boundaryEndParent?this.boundaries.end.offset:i.data.length)-e.offset}const o=new Uo(i,e.offset,n);return e.offset+=n,this._position=e,this._formatReturnValue("text",o,t,e,n)}if(n&&n.is("view:element")){if(this.shallow){if(this.boundaries&&this.boundaries.end.isBefore(e))return{done:!0,value:void 0};e.offset++}else e=new xr(n,0);return this._position=e,this._formatReturnValue("elementStart",n,t,e,1)}if(n&&n.is("view:$text")){if(this.singleCharacters)return e=new xr(n,0),this._position=e,this._next();let i,o=n.data.length;return n==this._boundaryEndParent?(o=this.boundaries.end.offset,i=new Uo(n,0,o),e=xr._createAfter(i)):(i=new Uo(n,0,n.data.length),e.offset++),this._position=e,this._formatReturnValue("text",i,t,e,o)}return e=xr._createAfter(i),this._position=e,this.ignoreElementEnd?this._next():this._formatReturnValue("elementEnd",i,t,e)}_previous(){let e=this.position.clone();const t=this.position,i=e.parent;if(null===i.parent&&0===e.offset)return{done:!0,value:void 0};if(i==this._boundaryStartParent&&e.offset==this.boundaries.start.offset)return{done:!0,value:void 0};let n;if(i.is("view:$text")){if(e.isAtStart)return this._position=xr._createBefore(i),this._previous();n=i.data[e.offset-1]}else n=i.getChild(e.offset-1);if("string"==typeof n){let n;if(this.singleCharacters)n=1;else{const t=i===this._boundaryStartParent?this.boundaries.start.offset:0;n=e.offset-t}e.offset-=n;const o=new Uo(i,e.offset,n);return this._position=e,this._formatReturnValue("text",o,t,e,n)}if(n&&n.is("view:element"))return this.shallow?(e.offset--,this._position=e,this._formatReturnValue("elementStart",n,t,e,1)):(e=new xr(n,n.childCount),this._position=e,this.ignoreElementEnd?this._previous():this._formatReturnValue("elementEnd",n,t,e));if(n&&n.is("view:$text")){if(this.singleCharacters)return e=new xr(n,n.data.length),this._position=e,this._previous();let i,o=n.data.length;if(n==this._boundaryStartParent){const t=this.boundaries.start.offset;i=new Uo(n,t,n.data.length-t),o=i.data.length,e=xr._createBefore(i)}else i=new Uo(n,0,n.data.length),e.offset--;return this._position=e,this._formatReturnValue("text",i,t,e,o)}return e=xr._createBefore(i),this._position=e,this._formatReturnValue("elementStart",i,t,e,1)}_formatReturnValue(e,t,i,n,o){return t.is("view:$textProxy")&&(t.offsetInText+t.data.length==t.textNode.data.length&&("forward"!=this.direction||this.boundaries&&this.boundaries.end.isEqual(this.position)?i=xr._createAfter(t.textNode):(n=xr._createAfter(t.textNode),this._position=n)),0===t.offsetInText&&("backward"!=this.direction||this.boundaries&&this.boundaries.start.isEqual(this.position)?i=xr._createBefore(t.textNode):(n=xr._createBefore(t.textNode),this._position=n))),{done:!1,value:{type:e,item:t,previousPosition:i,nextPosition:n,length:o}}}}class xr extends zo{parent;offset;constructor(e,t){super(),this.parent=e,this.offset=t}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 e=this.parent.is("$text")?this.parent.data.length:this.parent.childCount;return this.offset===e}get root(){return this.parent.root}get editableElement(){let e=this.parent;for(;!(e instanceof _r);){if(!e.parent)return null;e=e.parent}return e}getShiftedBy(e){const t=xr._createAt(this),i=t.offset+e;return t.offset=i<0?0:i,t}getLastMatchingPosition(e,t={}){t.startPosition=this;const i=new Ar(t);return i.skip(e),i.position}getAncestors(){return this.parent.is("documentFragment")?[this.parent]:this.parent.getAncestors({includeSelf:!0})}getCommonAncestor(e){const t=this.getAncestors(),i=e.getAncestors();let n=0;for(;t[n]==i[n]&&t[n];)n++;return 0===n?null:t[n-1]}isEqual(e){return this.parent==e.parent&&this.offset==e.offset}isBefore(e){return"before"==this.compareWith(e)}isAfter(e){return"after"==this.compareWith(e)}compareWith(e){if(this.root!==e.root)return"different";if(this.isEqual(e))return"same";const t=this.parent.is("node")?this.parent.getPath():[],i=e.parent.is("node")?e.parent.getPath():[];t.push(this.offset),i.push(e.offset);const n=te(t,i);switch(n){case"prefix":return"before";case"extension":return"after";default:return t[n]<i[n]?"before":"after"}}getWalker(e={}){return e.startPosition=this,new Ar(e)}clone(){return new xr(this.parent,this.offset)}toJSON(){return{parent:this.parent.toJSON(),offset:this.offset}}static _createAt(e,t){if(e instanceof xr)return new this(e.parent,e.offset);{const i=e;if("end"==t)t=i.is("$text")?i.data.length:i.childCount;else{if("before"==t)return this._createBefore(i);if("after"==t)return this._createAfter(i);if(0!==t&&!t)throw new A("view-createpositionat-offset-required",i)}return new xr(i,t)}}static _createAfter(e){if(e.is("$textProxy"))return new xr(e.textNode,e.offsetInText+e.data.length);if(!e.parent)throw new A("view-position-after-root",e,{root:e});return new xr(e.parent,e.index+1)}static _createBefore(e){if(e.is("$textProxy"))return new xr(e.textNode,e.offsetInText);if(!e.parent)throw new A("view-position-before-root",e,{root:e});return new xr(e.parent,e.index)}}xr.prototype.is=function(e){return"position"===e||"view:position"===e};class Cr extends zo{start;end;constructor(e,t=null){super(),this.start=e.clone(),this.end=t?t.clone():e.clone()}*[Symbol.iterator](){yield*new Ar({boundaries:this,ignoreElementEnd:!0})}get isCollapsed(){return this.start.isEqual(this.end)}get isFlat(){return this.start.parent===this.end.parent}get root(){return this.start.root}getEnlarged(){let e=this.start.getLastMatchingPosition(Tr,{direction:"backward"}),t=this.end.getLastMatchingPosition(Tr);return e.parent.is("$text")&&e.isAtStart&&(e=xr._createBefore(e.parent)),t.parent.is("$text")&&t.isAtEnd&&(t=xr._createAfter(t.parent)),new Cr(e,t)}getTrimmed(){let e=this.start.getLastMatchingPosition(Tr);if(e.isAfter(this.end)||e.isEqual(this.end))return new Cr(e,e);let t=this.end.getLastMatchingPosition(Tr,{direction:"backward"});const i=e.nodeAfter,n=t.nodeBefore;return i&&i.is("$text")&&(e=new xr(i,0)),n&&n.is("$text")&&(t=new xr(n,n.data.length)),new Cr(e,t)}isEqual(e){return this==e||this.start.isEqual(e.start)&&this.end.isEqual(e.end)}containsPosition(e){return e.isAfter(this.start)&&e.isBefore(this.end)}containsRange(e,t=!1){e.isCollapsed&&(t=!1);const i=this.containsPosition(e.start)||t&&this.start.isEqual(e.start),n=this.containsPosition(e.end)||t&&this.end.isEqual(e.end);return i&&n}getDifference(e){const t=[];return this.isIntersecting(e)?(this.containsPosition(e.start)&&t.push(new Cr(this.start,e.start)),this.containsPosition(e.end)&&t.push(new Cr(e.end,this.end))):t.push(this.clone()),t}getIntersection(e){if(this.isIntersecting(e)){let t=this.start,i=this.end;return this.containsPosition(e.start)&&(t=e.start),this.containsPosition(e.end)&&(i=e.end),new Cr(t,i)}return null}getWalker(e={}){return e.boundaries=this,new Ar(e)}getCommonAncestor(){return this.start.getCommonAncestor(this.end)}getContainedElement(){if(this.isCollapsed)return null;let e=this.start.nodeAfter,t=this.end.nodeBefore;return this.start.parent.is("$text")&&this.start.isAtEnd&&this.start.parent.nextSibling&&(e=this.start.parent.nextSibling),this.end.parent.is("$text")&&this.end.isAtStart&&this.end.parent.previousSibling&&(t=this.end.parent.previousSibling),e&&e.is("element")&&e===t?e:null}clone(){return new Cr(this.start,this.end)}*getItems(e={}){e.boundaries=this,e.ignoreElementEnd=!0;const t=new Ar(e);for(const e of t)yield e.item}*getPositions(e={}){e.boundaries=this;const t=new Ar(e);yield t.position;for(const e of t)yield e.nextPosition}isIntersecting(e){return this.start.isBefore(e.end)&&this.end.isAfter(e.start)}toJSON(){return{start:this.start.toJSON(),end:this.end.toJSON()}}static _createFromParentsAndOffsets(e,t,i,n){return new this(new xr(e,t),new xr(i,n))}static _createFromPositionAndShift(e,t){const i=e,n=e.getShiftedBy(t);return t>0?new this(i,n):new this(n,i)}static _createIn(e){return this._createFromParentsAndOffsets(e,0,e,e.childCount)}static _createOn(e){const t=e.is("$textProxy")?e.offsetSize:1;return this._createFromPositionAndShift(xr._createBefore(e),t)}}function Tr(e){return!(!e.item.is("attributeElement")&&!e.item.is("uiElement"))}Cr.prototype.is=function(e){return"range"===e||"view:range"===e};class Er extends(O(zo)){_ranges;_lastRangeBackward;_isFake;_fakeSelectionLabel;constructor(...e){super(),this._ranges=[],this._lastRangeBackward=!1,this._isFake=!1,this._fakeSelectionLabel="",e.length&&this.setTo(...e)}get isFake(){return this._isFake}get fakeSelectionLabel(){return this._fakeSelectionLabel}get anchor(){if(!this._ranges.length)return null;const e=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?e.end:e.start).clone()}get focus(){if(!this._ranges.length)return null;const e=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?e.start:e.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 e of this._ranges)yield e.clone()}getFirstRange(){let e=null;for(const t of this._ranges)e&&!t.start.isBefore(e.start)||(e=t);return e?e.clone():null}getLastRange(){let e=null;for(const t of this._ranges)e&&!t.end.isAfter(e.end)||(e=t);return e?e.clone():null}getFirstPosition(){const e=this.getFirstRange();return e?e.start.clone():null}getLastPosition(){const e=this.getLastRange();return e?e.end.clone():null}isEqual(e){if(this.isFake!=e.isFake)return!1;if(this.isFake&&this.fakeSelectionLabel!=e.fakeSelectionLabel)return!1;if(this.rangeCount!=e.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus))return!1;for(const t of this._ranges){let i=!1;for(const n of e._ranges)if(t.isEqual(n)){i=!0;break}if(!i)return!1}return!0}isSimilar(e){if(this.isBackward!=e.isBackward)return!1;const t=ee(this.getRanges());if(t!=ee(e.getRanges()))return!1;if(0==t)return!0;for(let t of this.getRanges()){t=t.getTrimmed();let i=!1;for(let n of e.getRanges())if(n=n.getTrimmed(),t.start.isEqual(n.start)&&t.end.isEqual(n.end)){i=!0;break}if(!i)return!1}return!0}getSelectedElement(){return 1!==this.rangeCount?null:this.getFirstRange().getContainedElement()}setTo(...e){let[t,i,n]=e;if("object"==typeof i&&(n=i,i=void 0),null===t)this._setRanges([]),this._setFakeOptions(n);else if(t instanceof Er||t instanceof Ir)this._setRanges(t.getRanges(),t.isBackward),this._setFakeOptions({fake:t.isFake,label:t.fakeSelectionLabel});else if(t instanceof Cr)this._setRanges([t],n&&n.backward),this._setFakeOptions(n);else if(t instanceof xr)this._setRanges([new Cr(t)]),this._setFakeOptions(n);else if(t instanceof Fo){const e=!!n&&!!n.backward;let o;if(void 0===i)throw new A("view-selection-setto-required-second-parameter",this);o="in"==i?Cr._createIn(t):"on"==i?Cr._createOn(t):new Cr(xr._createAt(t,i)),this._setRanges([o],e),this._setFakeOptions(n)}else{if(!ie(t))throw new A("view-selection-setto-not-selectable",this);this._setRanges(t,n&&n.backward),this._setFakeOptions(n)}this.fire("change")}setFocus(e,t){if(null===this.anchor)throw new A("view-selection-setfocus-no-ranges",this);const i=xr._createAt(e,t);if("same"==i.compareWith(this.focus))return;const n=this.anchor;this._ranges.pop(),"before"==i.compareWith(n)?this._addRange(new Cr(i,n),!0):this._addRange(new Cr(n,i)),this.fire("change")}toJSON(){const e={ranges:Array.from(this.getRanges()).map(e=>e.toJSON())};return this.isBackward&&(e.isBackward=!0),this.isFake&&(e.isFake=!0),e}_setRanges(e,t=!1){e=Array.from(e),this._ranges=[];for(const t of e)this._addRange(t);this._lastRangeBackward=!!t}_setFakeOptions(e={}){this._isFake=!!e.fake,this._fakeSelectionLabel=e.fake&&e.label||""}_addRange(e,t=!1){if(!(e instanceof Cr))throw new A("view-selection-add-range-not-range",this);this._pushRange(e),this._lastRangeBackward=!!t}_pushRange(e){for(const t of this._ranges)if(e.isIntersecting(t))throw new A("view-selection-range-intersects",this,{addedRange:e,intersectingRange:t});this._ranges.push(new Cr(e.start,e.end))}}Er.prototype.is=function(e){return"selection"===e||"view:selection"===e};class Ir extends(O(zo)){_selection;constructor(...e){super(),this._selection=new Er,this._selection.delegate("change").to(this),e.length&&this._selection.setTo(...e)}get isFake(){return this._selection.isFake}get fakeSelectionLabel(){return this._selection.fakeSelectionLabel}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get isCollapsed(){return this._selection.isCollapsed}get rangeCount(){return this._selection.rangeCount}get isBackward(){return this._selection.isBackward}get editableElement(){return this._selection.editableElement}get _ranges(){return this._selection._ranges}*getRanges(){yield*this._selection.getRanges()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getSelectedElement(){return this._selection.getSelectedElement()}isEqual(e){return this._selection.isEqual(e)}isSimilar(e){return this._selection.isSimilar(e)}toJSON(){return this._selection.toJSON()}_setTo(...e){this._selection.setTo(...e)}_setFocus(e,t){this._selection.setFocus(e,t)}}Ir.prototype.is=function(e){return"selection"===e||"documentSelection"==e||"view:selection"==e||"view:documentSelection"==e};class Sr extends k{startRange;_eventPhase;_currentTarget;constructor(e,t,i){super(e,t),this.startRange=i,this._eventPhase="none",this._currentTarget=null}get eventPhase(){return this._eventPhase}get currentTarget(){return this._currentTarget}}const Pr=Symbol("bubblingEmitter"),Mr=Symbol("bubblingCallbacks"),Or=Symbol("bubblingContexts");function Rr(e){return class extends e{fire(e,...t){try{const i=e instanceof k?e:new k(this,e),n=Lr(this),o=Br(this);if(Nr(i,"capturing",this),Vr(n,"$capture",i,...t))return i.return;const r=i.startRange||this.selection.getFirstRange(),s=r?r.getContainedElement():null,a=!!s&&function(e,t){for(const i of e)if(i(t))return!0;return!1}(o,s);let l=s||function(e){if(!e)return null;const t=e.start.parent,i=e.end.parent,n=t.getPath(),o=i.getPath();return n.length>o.length?t:i}(r);if(Nr(i,"atTarget",l),!a){if(Vr(n,"$text",i,...t))return i.return;Nr(i,"bubbling",l)}for(;l;){if(l.is("element")&&Vr(n,l,i,...t))return i.return;l=l.parent,Nr(i,"bubbling",l)}return Nr(i,"bubbling",this),Vr(n,"$document",i,...t),i.return}catch(e){A.rethrowUnexpectedError(e,this)}}_addEventListener(e,t,i){const n=Dt(i.context||"$document"),o=Lr(this),r=Dr(this);for(const e of n)"function"==typeof e&&Br(this).add(e);const s=function(e,t,i){return function(n,o){const{currentTarget:r,eventArgs:s}=o;if("string"!=typeof r){if(r.is("rootElement")&&t.includes("$root"))i.call(e,n,...s);else if(t.includes(r.name))i.call(e,n,...s);else for(const o of t)if("function"==typeof o&&o(r))return void i.call(e,n,...s)}else t.includes(r)&&i.call(e,n,...s)}}(this,n,t);r.set(t,s),this.listenTo(o,e,s,i)}_removeEventListener(e,t){const i=Lr(this),n=Dr(this),o=n.get(t);o&&(n.delete(t),this.stopListening(i,e,o))}}}function Nr(e,t,i){e instanceof Sr&&(e._eventPhase=t,e._currentTarget=i)}function Vr(e,t,i,...n){return e.fire(i,{currentTarget:t,eventArgs:n}),!!i.stop.called}function Lr(e){return e[Pr]||(e[Pr]=new(O())),e[Pr]}function Dr(e){return e[Mr]||(e[Mr]=new Map),e[Mr]}function Br(e){return e[Or]||(e[Or]=new Set),e[Or]}class zr extends(Rr(K())){selection;roots;stylesProcessor;_postFixers=new Set;constructor(e){super(),this.selection=new Ir,this.roots=new Yt({idProperty:"rootName"}),this.stylesProcessor=e,this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("isSelecting",!1),this.set("isComposing",!1)}getRoot(e="main"){return this.roots.get(e)}registerPostFixer(e){this._postFixers.add(e)}destroy(){this.roots.forEach(e=>e.destroy()),this.stopListening()}_callPostFixers(e){let t=!1;do{for(const i of this._postFixers)if(t=i(e),t)break}while(t)}}class Fr extends fr{static DEFAULT_PRIORITY=10;_priority=10;_id=null;_clonesGroup=null;constructor(e,t,i,n){super(e,t,i,n),this.getFillerOffset=jr}get priority(){return this._priority}get id(){return this._id}getElementsWithSameId(){if(null===this.id)throw new A("attribute-element-get-elements-with-same-id-no-id",this);return new Set(this._clonesGroup)}isSimilar(e){return null!==this.id||null!==e.id?this.id===e.id:super.isSimilar(e)&&this.priority==e.priority}toJSON(){const e=super.toJSON();return e.type="AttributeElement",e}_clone(e=!1){const t=super._clone(e);return t._priority=this._priority,t._id=this._id,t}_canMergeAttributesFrom(e){return null===this.id&&null===e.id&&this.priority===e.priority&&super._canMergeAttributesFrom(e)}_canSubtractAttributesOf(e){return null===this.id&&null===e.id&&this.priority===e.priority&&super._canSubtractAttributesOf(e)}}function jr(){if(Ur(this))return null;let e=this.parent;for(;e&&e.is("attributeElement");){if(Ur(e)>1)return null;e=e.parent}return!e||Ur(e)>1?null:this.childCount}function Ur(e){return Array.from(e.getChildren()).filter(e=>!e.is("uiElement")).length}Fr.prototype.is=function(e,t){return t?t===this.name&&("attributeElement"===e||"view:attributeElement"===e||"element"===e||"view:element"===e):"attributeElement"===e||"view:attributeElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e};class Hr extends fr{constructor(e,t,i,n){super(e,t,i,n),this.getFillerOffset=Wr}toJSON(){const e=super.toJSON();return e.type="EmptyElement",e}_insertChild(e,t){if(t&&(t instanceof Fo||Array.from(t).length>0))throw new A("view-emptyelement-cannot-add",[this,t]);return 0}}function Wr(){return null}Hr.prototype.is=function(e,t){return t?t===this.name&&("emptyElement"===e||"view:emptyElement"===e||"element"===e||"view:element"===e):"emptyElement"===e||"view:emptyElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e};class $r extends fr{constructor(e,t,i,n){super(e,t,i,n),this.getFillerOffset=Kr}_insertChild(e,t){if(t&&(t instanceof Fo||Array.from(t).length>0))throw new A("view-uielement-cannot-add",[this,t]);return 0}render(e,t){return this.toDomElement(e)}toDomElement(e){const t=e.createElement(this.name);for(const e of this.getAttributeKeys())t.setAttribute(e,this.getAttribute(e));return t}toJSON(){const e=super.toJSON();return e.type="UIElement",e}}function qr(e){e.document.on("arrowKey",(t,i)=>function(e,t,i){if(t.keyCode==Pt.arrowright){const e=t.domTarget.ownerDocument.defaultView.getSelection(),n=1==e.rangeCount&&e.getRangeAt(0).collapsed;if(n||t.shiftKey){const t=e.focusNode,o=e.focusOffset,r=i.domPositionToView(t,o);if(null===r)return;let s=!1;const a=r.getLastMatchingPosition(e=>(e.item.is("uiElement")&&(s=!0),!(!e.item.is("uiElement")&&!e.item.is("attributeElement"))));if(s){const t=i.viewPositionToDom(a);n?e.collapse(t.parent,t.offset):e.extend(t.parent,t.offset)}}}}(0,i,e.domConverter),{priority:"low"})}function Kr(){return null}$r.prototype.is=function(e,t){return t?t===this.name&&("uiElement"===e||"view:uiElement"===e||"element"===e||"view:element"===e):"uiElement"===e||"view:uiElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e};class Gr extends fr{constructor(e,t,i,n){super(e,t,i,n),this.getFillerOffset=Yr}toJSON(){const e=super.toJSON();return e.type="RawElement",e}_insertChild(e,t){if(t&&(t instanceof Fo||Array.from(t).length>0))throw new A("view-rawelement-cannot-add",[this,t]);return 0}render(e,t){}}function Yr(){return null}Gr.prototype.is=function(e,t){return t?t===this.name&&("rawElement"===e||"view:rawElement"===e||"element"===e||"view:element"===e):"rawElement"===e||"view:rawElement"===e||e===this.name||e==="view:"+this.name||"element"===e||"view:element"===e||"node"===e||"view:node"===e};class Jr extends(O(zo)){document;_children=[];_customProperties=new Map;constructor(e,t){super(),this.document=e,t&&this._insertChild(0,t)}[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}get name(){}get getFillerOffset(){}getCustomProperty(e){return this._customProperties.get(e)}*getCustomProperties(){yield*this._customProperties.entries()}toJSON(){const e=[];for(const t of this._children)e.push(t.toJSON());return e}_appendChild(e){return this._insertChild(this.childCount,e)}getChild(e){return this._children[e]}getChildIndex(e){return this._children.indexOf(e)}getChildren(){return this._children[Symbol.iterator]()}_insertChild(e,t){this._fireChange("children",this,{index:e});let i=0;const n=function(e,t){if("string"==typeof t)return[new jo(e,t)];ie(t)||(t=[t]);return Array.from(t).map(t=>"string"==typeof t?new jo(e,t):t instanceof Uo?new jo(e,t.data):t)}(this.document,t);for(const t of n)null!==t.parent&&t._remove(),t.parent=this,this._children.splice(e,0,t),e++,i++;return i}_removeChildren(e,t=1){this._fireChange("children",this,{index:e});for(let i=e;i<e+t;i++)this._children[i].parent=null;return this._children.splice(e,t)}_fireChange(e,t,i){this.fire(`change:${e}`,t,i)}_setCustomProperty(e,t){this._customProperties.set(e,t)}_removeCustomProperty(e){return this._customProperties.delete(e)}}Jr.prototype.is=function(e){return"documentFragment"===e||"view:documentFragment"===e};class Qr{document;_cloneGroups=new Map;_slotFactory=null;constructor(e){this.document=e}setSelection(...e){this.document.selection._setTo(...e)}setSelectionFocus(e,t){this.document.selection._setFocus(e,t)}createDocumentFragment(e){return new Jr(this.document,e)}createText(e){return new jo(this.document,e)}createAttributeElement(e,t,i={}){const n=new Fr(this.document,e,t);return"number"==typeof i.priority&&(n._priority=i.priority),i.id&&(n._id=i.id),i.renderUnsafeAttributes&&n._unsafeAttributesToRender.push(...i.renderUnsafeAttributes),n}createContainerElement(e,t,i={},n={}){let o;!function(e){return re(e)}(i)?o=i:n=i;const r=new kr(this.document,e,t,o);return n.renderUnsafeAttributes&&r._unsafeAttributesToRender.push(...n.renderUnsafeAttributes),r}createEditableElement(e,t,i={}){const n=new _r(this.document,e,t);return i.renderUnsafeAttributes&&n._unsafeAttributesToRender.push(...i.renderUnsafeAttributes),n}createEmptyElement(e,t,i={}){const n=new Hr(this.document,e,t);return i.renderUnsafeAttributes&&n._unsafeAttributesToRender.push(...i.renderUnsafeAttributes),n}createUIElement(e,t,i){const n=new $r(this.document,e,t);return i&&(n.render=i),n}createRawElement(e,t,i,n={}){const o=new Gr(this.document,e,t);return i&&(o.render=i),n.renderUnsafeAttributes&&o._unsafeAttributesToRender.push(...n.renderUnsafeAttributes),o}setAttribute(e,t,i,n){void 0!==n?n._setAttribute(e,t,i):i._setAttribute(e,t)}removeAttribute(e,t,i){void 0!==i?i._removeAttribute(e,t):t._removeAttribute(e)}addClass(e,t){t._addClass(e)}removeClass(e,t){t._removeClass(e)}setStyle(e,t,i){re(e)&&void 0===i?t._setStyle(e):i._setStyle(e,t)}removeStyle(e,t){t._removeStyle(e)}setCustomProperty(e,t,i){i._setCustomProperty(e,t)}removeCustomProperty(e,t){return t._removeCustomProperty(e)}breakAttributes(e){return e instanceof xr?this._breakAttributes(e):this._breakAttributesRange(e)}breakContainer(e){const t=e.parent;if(!t.is("containerElement"))throw new A("view-writer-break-non-container-element",this.document);if(!t.parent)throw new A("view-writer-break-root",this.document);if(e.isAtStart)return xr._createBefore(t);if(!e.isAtEnd){const i=t._clone(!1);this.insert(xr._createAfter(t),i);const n=new Cr(e,xr._createAt(t,"end")),o=new xr(i,0);this.move(n,o)}return xr._createAfter(t)}mergeAttributes(e){const t=e.offset,i=e.parent;if(i.is("$text"))return e;if(i.is("attributeElement")&&0===i.childCount){const e=i.parent,t=i.index;return i._remove(),this._removeFromClonedElementsGroup(i),this.mergeAttributes(new xr(e,t))}const n=i.getChild(t-1),o=i.getChild(t);if(!n||!o)return e;if(n.is("$text")&&o.is("$text"))return is(n,o);if(n.is("attributeElement")&&o.is("attributeElement")&&n.isSimilar(o)){const e=n.childCount;return n._appendChild(o.getChildren()),o._remove(),this._removeFromClonedElementsGroup(o),this.mergeAttributes(new xr(n,e))}return e}mergeContainers(e){const t=e.nodeBefore,i=e.nodeAfter;if(!(t&&i&&t.is("containerElement")&&i.is("containerElement")))throw new A("view-writer-merge-containers-invalid-position",this.document);const n=t.getChild(t.childCount-1),o=n instanceof jo?xr._createAt(n,"end"):xr._createAt(t,"end");return this.move(Cr._createIn(i),xr._createAt(t,"end")),this.remove(Cr._createOn(i)),o}insert(e,t){os(t=ie(t)?[...t]:[t],this.document);const i=t.reduce((e,t)=>{const i=e[e.length-1],n=!t.is("uiElement");return i&&i.breakAttributes==n?i.nodes.push(t):e.push({breakAttributes:n,nodes:[t]}),e},[]);let n=null,o=e;for(const{nodes:e,breakAttributes:t}of i){const i=this._insertNodes(o,e,t);n||(n=i.start),o=i.end}return n?new Cr(n,o):new Cr(e)}remove(e){const t=e instanceof Cr?e:Cr._createOn(e);if(ss(t,this.document),t.isCollapsed)return new Jr(this.document);const{start:i,end:n}=this._breakAttributesRange(t,!0),o=i.parent,r=n.offset-i.offset,s=o._removeChildren(i.offset,r);for(const e of s)this._removeFromClonedElementsGroup(e);const a=this.mergeAttributes(i);return t.start=a,t.end=a.clone(),new Jr(this.document,s)}clear(e,t){ss(e,this.document);const i=e.getWalker({direction:"backward",ignoreElementEnd:!0});for(const n of i){const i=n.item;let o;if(i.is("element")&&t.isSimilar(i))o=Cr._createOn(i);else if(!n.nextPosition.isAfter(e.start)&&i.is("$textProxy")){const e=i.getAncestors().find(e=>e.is("element")&&t.isSimilar(e));e&&(o=Cr._createIn(e))}o&&(o.end.isAfter(e.end)&&(o.end=e.end),o.start.isBefore(e.start)&&(o.start=e.start),this.remove(o))}}move(e,t){let i;if(t.isAfter(e.end)){const n=(t=this._breakAttributes(t,!0)).parent,o=n.childCount;e=this._breakAttributesRange(e,!0),i=this.remove(e),t.offset+=n.childCount-o}else i=this.remove(e);return this.insert(t,i)}wrap(e,t){if(!(t instanceof Fr))throw new A("view-writer-wrap-invalid-attribute",this.document);if(ss(e,this.document),e.isCollapsed){let n=e.start;n.parent.is("element")&&(i=n.parent,!Array.from(i.getChildren()).some(e=>!e.is("uiElement")))&&(n=n.getLastMatchingPosition(e=>e.item.is("uiElement"))),n=this._wrapPosition(n,t);const o=this.document.selection;return o.isCollapsed&&o.getFirstPosition().isEqual(e.start)&&this.setSelection(n),new Cr(n)}return this._wrapRange(e,t);var i}unwrap(e,t){if(!(t instanceof Fr))throw new A("view-writer-unwrap-invalid-attribute",this.document);if(ss(e,this.document),e.isCollapsed)return e;const{start:i,end:n}=this._breakAttributesRange(e,!0),o=i.parent,r=this._unwrapChildren(o,i.offset,n.offset,t),s=this.mergeAttributes(r.start);s.isEqual(r.start)||r.end.offset--;const a=this.mergeAttributes(r.end);return new Cr(s,a)}rename(e,t){const i=new kr(this.document,e,t.getAttributes());return this.insert(xr._createAfter(t),i),this.move(Cr._createIn(t),xr._createAt(i,0)),this.remove(Cr._createOn(t)),i}clearClonedElementsGroup(e){this._cloneGroups.delete(e)}createPositionAt(e,t){return xr._createAt(e,t)}createPositionAfter(e){return xr._createAfter(e)}createPositionBefore(e){return xr._createBefore(e)}createRange(e,t){return new Cr(e,t)}createRangeOn(e){return Cr._createOn(e)}createRangeIn(e){return Cr._createIn(e)}createSelection(...e){return new Er(...e)}createSlot(e="children"){if(!this._slotFactory)throw new A("view-writer-invalid-create-slot-context",this.document);return this._slotFactory(this,e)}_registerSlotFactory(e){this._slotFactory=e}_clearSlotFactory(){this._slotFactory=null}_insertNodes(e,t,i){let n,o;if(n=i?Zr(e):e.parent.is("$text")?e.parent.parent:e.parent,!n)throw new A("view-writer-invalid-position-container",this.document);o=i?this._breakAttributes(e,!0):e.parent.is("$text")?ts(e):e;const r=n._insertChild(o.offset,t);for(const e of t)this._addToClonedElementsGroup(e);const s=o.getShiftedBy(r),a=this.mergeAttributes(o);a.isEqual(o)||s.offset--;const l=this.mergeAttributes(s);return new Cr(a,l)}_wrapChildren(e,t,i,n){let o=t;const r=[];for(;o<i;){const t=e.getChild(o),i=t.is("$text"),s=t.is("attributeElement");if(s&&t._canMergeAttributesFrom(n))t._mergeAttributesFrom(n),r.push(new xr(e,o));else if(i||!s||Xr(n,t)){const i=n._clone();t._remove(),i._appendChild(t),e._insertChild(o,i),this._addToClonedElementsGroup(i),r.push(new xr(e,o))}else this._wrapChildren(t,0,t.childCount,n);o++}let s=0;for(const e of r){if(e.offset-=s,e.offset==t)continue;this.mergeAttributes(e).isEqual(e)||(s++,i--)}return Cr._createFromParentsAndOffsets(e,t,e,i)}_unwrapChildren(e,t,i,n){let o=t;const r=[];for(;o<i;){const t=e.getChild(o);if(t.is("attributeElement")){if(t.isSimilar(n)){const n=t.getChildren(),s=t.childCount;t._remove(),e._insertChild(o,n),this._removeFromClonedElementsGroup(t),r.push(new xr(e,o),new xr(e,o+s)),o+=s,i+=s-1;continue}t._canSubtractAttributesOf(n)?(t._subtractAttributesOf(n),r.push(new xr(e,o),new xr(e,o+1)),o++):(this._unwrapChildren(t,0,t.childCount,n),o++)}else o++}let s=0;for(const e of r){if(e.offset-=s,e.offset==t||e.offset==i)continue;this.mergeAttributes(e).isEqual(e)||(s++,i--)}return Cr._createFromParentsAndOffsets(e,t,e,i)}_wrapRange(e,t){const{start:i,end:n}=this._breakAttributesRange(e,!0),o=i.parent,r=this._wrapChildren(o,i.offset,n.offset,t),s=this.mergeAttributes(r.start);s.isEqual(r.start)||r.end.offset--;const a=this.mergeAttributes(r.end);return new Cr(s,a)}_wrapPosition(e,t){if(t.isSimilar(e.parent))return es(e.clone());e.parent.is("$text")&&(e=ts(e));const i=this.createAttributeElement("_wrapPosition-fake-element");i._priority=Number.POSITIVE_INFINITY,i.isSimilar=()=>!1,e.parent._insertChild(e.offset,i);const n=new Cr(e,e.getShiftedBy(1));this.wrap(n,t);const o=new xr(i.parent,i.index);i._remove();const r=o.nodeBefore,s=o.nodeAfter;return r&&r.is("view:$text")&&s&&s.is("view:$text")?is(r,s):es(o)}_breakAttributesRange(e,t=!1){const i=e.start,n=e.end;if(ss(e,this.document),e.isCollapsed){const i=this._breakAttributes(e.start,t);return new Cr(i,i)}const o=this._breakAttributes(n,t),r=o.parent.childCount,s=this._breakAttributes(i,t);return o.offset+=o.parent.childCount-r,new Cr(s,o)}_breakAttributes(e,t=!1){const i=e.offset,n=e.parent;if(e.parent.is("emptyElement"))throw new A("view-writer-cannot-break-empty-element",this.document);if(e.parent.is("uiElement"))throw new A("view-writer-cannot-break-ui-element",this.document);if(e.parent.is("rawElement"))throw new A("view-writer-cannot-break-raw-element",this.document);if(!t&&n.is("$text")&&rs(n.parent))return e.clone();if(rs(n))return e.clone();if(n.is("$text"))return this._breakAttributes(ts(e),t);if(i==n.childCount){const e=new xr(n.parent,n.index+1);return this._breakAttributes(e,t)}if(0===i){const e=new xr(n.parent,n.index);return this._breakAttributes(e,t)}{const e=n.index+1,o=n._clone();n.parent._insertChild(e,o),this._addToClonedElementsGroup(o);const r=n.childCount-i,s=n._removeChildren(i,r);o._appendChild(s);const a=new xr(n.parent,e);return this._breakAttributes(a,t)}}_addToClonedElementsGroup(e){if(!e.root.is("rootElement"))return;if(e.is("element"))for(const t of e.getChildren())this._addToClonedElementsGroup(t);const t=e.id;if(!t)return;let i=this._cloneGroups.get(t);i||(i=new Set,this._cloneGroups.set(t,i)),i.add(e),e._clonesGroup=i}_removeFromClonedElementsGroup(e){if(e.is("element"))for(const t of e.getChildren())this._removeFromClonedElementsGroup(t);const t=e.id;if(!t)return;const i=this._cloneGroups.get(t);i&&i.delete(e)}}function Zr(e){let t=e.parent;for(;!rs(t);){if(!t)return;t=t.parent}return t}function Xr(e,t){return e.priority<t.priority||!(e.priority>t.priority)&&e.getIdentity()<t.getIdentity()}function es(e){const t=e.nodeBefore;if(t&&t.is("$text"))return new xr(t,t.data.length);const i=e.nodeAfter;return i&&i.is("$text")?new xr(i,0):e}function ts(e){if(e.offset==e.parent.data.length)return new xr(e.parent.parent,e.parent.index+1);if(0===e.offset)return new xr(e.parent.parent,e.parent.index);const t=e.parent.data.slice(e.offset);return e.parent._data=e.parent.data.slice(0,e.offset),e.parent.parent._insertChild(e.parent.index+1,new jo(e.root.document,t)),new xr(e.parent.parent,e.parent.index+1)}function is(e,t){const i=e.data.length;return e._data+=t.data,t._remove(),new xr(e,i)}const ns=[jo,Fr,kr,Hr,Gr,$r];function os(e,t){for(const i of e){if(!ns.some(e=>i instanceof e))throw new A("view-writer-insert-invalid-node-type",t);i.is("$text")||os(i.getChildren(),t)}}function rs(e){return e&&(e.is("containerElement")||e.is("documentFragment"))}function ss(e,t){const i=Zr(e.start),n=Zr(e.end);if(!i||!n||i!==n)throw new A("view-writer-invalid-range-container",t)}const as=e=>e.createTextNode(" "),ls=e=>{const t=e.createElement("span");return t.dataset.ckeFiller="true",t.innerText=" ",t},cs=e=>{const t=e.createElement("br");return t.dataset.ckeFiller="true",t},ds="".repeat(7);function us(e){return"string"==typeof e?e.substr(0,7)===ds:Ge(e)&&e.data.substr(0,7)===ds}function hs(e){return 7==e.data.length&&us(e)}function ms(e){const t="string"==typeof e?e:e.data;return us(e)?t.slice(7):t}function gs(e,t){if(t.keyCode==Pt.arrowleft){const e=t.domTarget.ownerDocument.defaultView.getSelection();if(1==e.rangeCount&&e.getRangeAt(0).collapsed){const t=e.getRangeAt(0).startContainer,i=e.getRangeAt(0).startOffset;us(t)&&i<=7&&e.collapse(t,0)}}}var fs=i(6531),ps={attributes:{"data-cke":!0}};ps.setAttributes=Ki(),ps.insert=$i().bind(null,"head"),ps.domAPI=Hi(),ps.insertStyleElement=Yi();ji()(fs.A,ps);fs.A&&fs.A.locals&&fs.A.locals;class bs extends(K()){domDocuments=new Set;domConverter;markedAttributes=new Set;markedChildren=new Set;markedTexts=new Set;selection;_inlineFiller=null;_fakeSelectionContainer=null;constructor(e,t){super(),this.domConverter=e,this.selection=t,this.set("isFocused",!1),this.set("isSelecting",!1),this.set("isComposing",!1),r.isBlink&&!r.isAndroid&&this.on("change:isSelecting",()=>{this.isSelecting||this.render()})}markToSync(e,t){if("text"===e)this.domConverter.mapViewToDom(t.parent)&&this.markedTexts.add(t);else{if(!this.domConverter.mapViewToDom(t))return;if("attributes"===e)this.markedAttributes.add(t);else{if("children"!==e){throw new A("view-renderer-unknown-type",this)}this.markedChildren.add(t)}}}render(){if(this.isComposing&&!r.isAndroid)return;let e=null;const t=!(r.isBlink&&!r.isAndroid)||!this.isSelecting;for(const e of this.markedChildren)this._updateChildrenMappings(e);t?(this._inlineFiller&&!this._isSelectionInInlineFiller()&&this._removeInlineFiller(),this._inlineFiller?e=this._getInlineFillerPosition():this._needsInlineFillerAtSelection()&&(e=this.selection.getFirstPosition(),this.markedChildren.add(e.parent))):this._inlineFiller&&this._inlineFiller.parentNode&&(e=this.domConverter.domPositionToView(this._inlineFiller),e&&e.parent.is("$text")&&(e=xr._createBefore(e.parent)));for(const e of this.markedAttributes)this._updateAttrs(e);for(const t of this.markedChildren)this._updateChildren(t,{inlineFillerPosition:e});for(const t of this.markedTexts)!this.markedChildren.has(t.parent)&&this.domConverter.mapViewToDom(t.parent)&&this._updateText(t,{inlineFillerPosition:e});if(t)if(e){const t=this.domConverter.viewPositionToDom(e),i=t.parent.ownerDocument;us(t.parent)?this._inlineFiller=t.parent:this._inlineFiller=ks(i,t.parent,t.offset)}else this._inlineFiller=null;this._updateFocus(),this._updateSelection(),this.domConverter._clearTemporaryCustomProperties(),this.markedTexts.clear(),this.markedAttributes.clear(),this.markedChildren.clear()}_updateChildrenMappings(e){const t=this.domConverter.mapViewToDom(e);if(!t)return;const i=Array.from(t.childNodes),n=Array.from(this.domConverter.viewChildrenToDom(e,{withChildren:!1})),o=this._diffNodeLists(i,n),r=this._findUpdateActions(o,i,n,ws);if(-1!==r.indexOf("update")){const t={equal:0,insert:0,delete:0};for(const o of r)if("update"===o){const o=t.equal+t.insert,r=t.equal+t.delete,s=e.getChild(o);!s||s.is("uiElement")||s.is("rawElement")||this._updateElementMappings(s,i[r]),pt(n[o]),t.equal++}else t[o]++}}_updateElementMappings(e,t){this.domConverter.unbindDomElement(t),this.domConverter.bindElements(t,e),this.markedChildren.add(e),this.markedAttributes.add(e)}_getInlineFillerPosition(){const e=this.selection.getFirstPosition();return e.parent.is("$text")?xr._createBefore(e.parent):e}_isSelectionInInlineFiller(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const e=this.selection.getFirstPosition(),t=this.domConverter.viewPositionToDom(e);return!!(t&&Ge(t.parent)&&us(t.parent))}_removeInlineFiller(){const e=this._inlineFiller;if(!us(e))throw new A("view-renderer-filler-was-lost",this);hs(e)?e.remove():e.data=e.data.substr(7),this._inlineFiller=null}_needsInlineFillerAtSelection(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const e=this.selection.getFirstPosition(),t=e.parent,i=e.offset;if(!this.domConverter.mapViewToDom(t.root))return!1;if(!t.is("element"))return!1;if(!function(e){if("false"==e.getAttribute("contenteditable"))return!1;const t=e.findAncestor(e=>e.hasAttribute("contenteditable"));return!t||"true"==t.getAttribute("contenteditable")}(t))return!1;const n=e.nodeBefore,o=e.nodeAfter;return!(n instanceof jo||o instanceof jo)&&(!!(i!==t.getFillerOffset()||n&&n.is("element","br"))&&(!r.isAndroid||!n&&!o))}_updateText(e,t){const i=this.domConverter.findCorrespondingDomText(e);let n=this.domConverter.viewToDom(e).data;const o=t.inlineFillerPosition;o&&o.parent==e.parent&&o.offset==e.index&&(n=ds+n),this._updateTextNode(i,n)}_updateAttrs(e){const t=this.domConverter.mapViewToDom(e);if(t){for(const i of Array.from(t.attributes)){const n=i.name;e.hasAttribute(n)||this.domConverter.removeDomElementAttribute(t,n)}for(const i of e.getAttributeKeys())this.domConverter.setDomElementAttribute(t,i,e.getAttribute(i),e)}}_updateChildren(e,t){const i=this.domConverter.mapViewToDom(e);if(!i)return;if(r.isAndroid){let e=null;for(const t of Array.from(i.childNodes)){if(e&&Ge(e)&&Ge(t)){i.normalize();break}e=t}}const n=t.inlineFillerPosition,o=i.childNodes,s=Array.from(this.domConverter.viewChildrenToDom(e,{bind:!0}));n&&n.parent===e&&ks(i.ownerDocument,s,n.offset);const a=this._diffNodeLists(o,s),l=this._findUpdateActions(a,o,s,_s);let c=0;const d=new Set;for(const e of l)"delete"===e?(d.add(o[c]),pt(o[c])):"equal"!==e&&"update"!==e||c++;c=0;for(const e of l)"insert"===e?(lt(i,c,s[c]),c++):"update"===e?(this._updateTextNode(o[c],s[c].data),c++):"equal"===e&&(this._markDescendantTextToSync(this.domConverter.domToView(s[c])),c++);for(const e of d)e.parentNode||this.domConverter.unbindDomElement(e)}_diffNodeLists(e,t){return b(e=function(e,t){const i=Array.from(e);if(0==i.length||!t)return i;i[i.length-1]==t&&i.pop();return i}(e,this._fakeSelectionContainer),t,vs.bind(null,this.domConverter))}_findUpdateActions(e,t,i,n){if(-1===e.indexOf("insert")||-1===e.indexOf("delete"))return e;let o=[],r=[],s=[];const a={equal:0,insert:0,delete:0};for(const l of e)"insert"===l?s.push(i[a.equal+a.insert]):"delete"===l?r.push(t[a.equal+a.delete]):(o=o.concat(b(r,s,n).map(e=>"equal"===e?"update":e)),o.push("equal"),r=[],s=[]),a[l]++;return o.concat(b(r,s,n).map(e=>"equal"===e?"update":e))}_updateTextNode(e,t){const i=e.data;i!=t&&(r.isAndroid&&this.isComposing&&i.replace(/\u00A0/g," ")==t.replace(/\u00A0/g," ")||this._updateTextNodeInternal(e,t))}_updateTextNodeInternal(e,t){const i=g(e.data,t);for(const t of i)"insert"===t.type?e.insertData(t.index,t.values.join("")):e.deleteData(t.index,t.howMany)}_markDescendantTextToSync(e){if(e)if(e.is("$text"))this.markedTexts.add(e);else if(e.is("element"))for(const t of e.getChildren())this._markDescendantTextToSync(t)}_updateSelection(){if(r.isBlink&&!r.isAndroid&&this.isSelecting&&!this.markedChildren.size)return;if(0===this.selection.rangeCount)return this._removeDomSelection(),void this._removeFakeSelection();const e=this.domConverter.mapViewToDom(this.selection.editableElement);this.isFocused&&e?this.selection.isFake?this._updateFakeSelection(e):this._fakeSelectionContainer&&this._fakeSelectionContainer.isConnected?(this._removeFakeSelection(),this._updateDomSelection(e)):this.isComposing&&r.isAndroid||this._updateDomSelection(e):!this.selection.isFake&&this._fakeSelectionContainer&&this._fakeSelectionContainer.isConnected&&this._removeFakeSelection()}_updateFakeSelection(e){const t=e.ownerDocument;this._fakeSelectionContainer||(this._fakeSelectionContainer=function(e){const t=e.createElement("div");return t.className="ck-fake-selection-container",Object.assign(t.style,{position:"fixed",top:0,left:"-9999px",width:"42px"}),t.textContent=" ",t}(t));const i=this._fakeSelectionContainer;if(this.domConverter.bindFakeSelection(i,this.selection),!this._fakeSelectionNeedsUpdate(e))return;i.parentElement&&i.parentElement==e||e.appendChild(i),i.textContent=this.selection.fakeSelectionLabel||" ";const n=t.getSelection(),o=t.createRange();n.removeAllRanges(),o.selectNodeContents(i),n.addRange(o)}_updateDomSelection(e){const t=e.ownerDocument.defaultView.getSelection();if(!this._domSelectionNeedsUpdate(t))return;const i=this.domConverter.viewPositionToDom(this.selection.anchor),n=this.domConverter.viewPositionToDom(this.selection.focus);t.setBaseAndExtent(i.parent,i.offset,n.parent,n.offset),r.isGecko&&function(e,t){let i=e.parent,n=e.offset;Ge(i)&&hs(i)&&(n=at(i)+1,i=i.parentNode);if(i.nodeType!=Node.ELEMENT_NODE||n!=i.childNodes.length-1)return;const o=i.childNodes[n];o&&"BR"==o.tagName&&t.addRange(t.getRangeAt(0))}(n,t)}_domSelectionNeedsUpdate(e){if(!this.domConverter.isDomSelectionCorrect(e))return!0;const t=e&&this.domConverter.domSelectionToView(e);return(!t||!this.selection.isEqual(t))&&!(!this.selection.isCollapsed&&this.selection.isSimilar(t))}_fakeSelectionNeedsUpdate(e){const t=this._fakeSelectionContainer,i=e.ownerDocument.getSelection();return!t||t.parentElement!==e||(i.anchorNode!==t&&!t.contains(i.anchorNode)||t.textContent!==this.selection.fakeSelectionLabel)}_removeDomSelection(){for(const e of this.domDocuments){const t=e.getSelection();if(t.rangeCount){const i=e.activeElement,n=this.domConverter.mapDomToView(i);i&&n&&t.removeAllRanges()}}}_removeFakeSelection(){const e=this._fakeSelectionContainer;e&&e.remove()}_updateFocus(){if(this.isFocused){const e=this.selection.editableElement;e&&this.domConverter.focus(e)}}}function ks(e,t,i){const n=t instanceof Array?t:t.childNodes,o=n[i];if(Ge(o))return o.data=ds+o.data,o;{const o=e.createTextNode(ds);return Array.isArray(t)?n.splice(i,0,o):lt(t,i,o),o}}function ws(e,t){return Fe(e)&&Fe(t)&&!Ge(e)&&!Ge(t)&&!ct(e)&&!ct(t)&&e.tagName.toLowerCase()===t.tagName.toLowerCase()}function _s(e,t){return Fe(e)&&Fe(t)&&Ge(e)&&Ge(t)}function vs(e,t,i){return t===i||(Ge(t)&&Ge(i)?t.data===i.data:!(!e.isBlockFiller(t)||!e.isBlockFiller(i)))}const ys=cs(e.document),As=as(e.document),xs=ls(e.document),Cs="data-ck-unsafe-attribute-",Ts="data-ck-unsafe-element";class Es{document;renderingMode;blockFillerMode;preElements;blockElements;inlineObjectElements;unsafeElements;_domDocument;_domToViewMapping=new WeakMap;_viewToDomMapping=new WeakMap;_fakeSelectionMapping=new WeakMap;_rawContentElementMatcher=new Ko;_inlineObjectElementMatcher=new Ko;_elementsWithTemporaryCustomProperties=new Set;constructor(t,{blockFillerMode:i,renderingMode:n="editing"}={}){this.document=t,this.renderingMode=n,this.blockFillerMode=i||("editing"===n?"br":"nbsp"),this.preElements=["pre","textarea"],this.blockElements=["address","article","aside","blockquote","caption","center","dd","details","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","legend","li","main","menu","nav","ol","p","pre","section","summary","table","tbody","td","tfoot","th","thead","tr","ul"],this.inlineObjectElements=["object","iframe","input","button","textarea","select","option","video","embed","audio","img","canvas"],this.unsafeElements=["script","style"],this._domDocument="editing"===this.renderingMode?e.document:e.document.implementation.createHTMLDocument("")}get domDocument(){return this._domDocument}bindFakeSelection(e,t){this._fakeSelectionMapping.set(e,new Er(t))}fakeSelectionToView(e){return this._fakeSelectionMapping.get(e)}bindElements(e,t){this._domToViewMapping.set(e,t),this._viewToDomMapping.set(t,e)}unbindDomElement(e){const t=this._domToViewMapping.get(e);if(t){this._domToViewMapping.delete(e),this._viewToDomMapping.delete(t);for(const t of e.children)this.unbindDomElement(t)}}bindDocumentFragments(e,t){this._domToViewMapping.set(e,t),this._viewToDomMapping.set(t,e)}shouldRenderAttribute(e,t,i){return"data"===this.renderingMode||!(e=e.toLowerCase()).startsWith("on")&&(("srcdoc"!==e||!t.match(/\bon\S+\s*=|javascript:|<\s*\/*script/i))&&("img"===i&&("src"===e||"srcset"===e)||("source"===i&&"srcset"===e||!t.match(/^\s*(javascript:|data:(image\/svg|text\/x?html))/i))))}setContentOf(e,t){if("data"===this.renderingMode)return void(e.innerHTML=t);const i=(new DOMParser).parseFromString(t,"text/html"),n=i.createDocumentFragment(),o=i.body.childNodes;for(;o.length>0;)n.appendChild(o[0]);const r=i.createTreeWalker(n,NodeFilter.SHOW_ELEMENT),s=[];let a;for(;a=r.nextNode();)s.push(a);for(const e of s){for(const t of e.getAttributeNames())this.setDomElementAttribute(e,t,e.getAttribute(t));const t=e.tagName.toLowerCase();this._shouldRenameElement(t)&&(Ns(t),e.replaceWith(this._createReplacementDomElement(t,e)))}for(;e.firstChild;)e.firstChild.remove();e.append(n)}viewToDom(e,t={}){if(e.is("$text")){const t=this._processDataFromViewText(e);return this._domDocument.createTextNode(t)}{const i=e;if(this.mapViewToDom(i)){if(!i.getCustomProperty("editingPipeline:doNotReuseOnce"))return this.mapViewToDom(i);this._elementsWithTemporaryCustomProperties.add(i)}let n;if(i.is("documentFragment"))n=this._domDocument.createDocumentFragment(),t.bind&&this.bindDocumentFragments(n,i);else{if(i.is("uiElement"))return n="$comment"===i.name?this._domDocument.createComment(i.getCustomProperty("$rawContent")):i.render(this._domDocument,this),t.bind&&this.bindElements(n,i),n;this._shouldRenameElement(i.name)?(Ns(i.name),n=this._createReplacementDomElement(i.name)):n=i.hasAttribute("xmlns")?this._domDocument.createElementNS(i.getAttribute("xmlns"),i.name):this._domDocument.createElement(i.name),i.is("rawElement")&&i.render(n,this),t.bind&&this.bindElements(n,i);for(const e of i.getAttributeKeys())this.setDomElementAttribute(n,e,i.getAttribute(e),i)}if(!1!==t.withChildren)for(const e of this.viewChildrenToDom(i,t))n instanceof HTMLTemplateElement?n.content.appendChild(e):n.appendChild(e);return n}}setDomElementAttribute(t,i,n,o){const r=this.shouldRenderAttribute(i,n,t.tagName.toLowerCase())||o&&o.shouldRenderUnsafeAttribute(i);r||x("domconverter-unsafe-attribute-detected",{domElement:t,key:i,value:n}),function(t){try{e.document.createAttribute(t)}catch{return!1}return!0}(i)?(t.hasAttribute(i)&&!r?t.removeAttribute(i):t.hasAttribute(Cs+i)&&r&&t.removeAttribute(Cs+i),t.setAttribute(r?i:Cs+i,n)):x("domconverter-invalid-attribute-detected",{domElement:t,key:i,value:n})}removeDomElementAttribute(e,t){t!=Ts&&(e.removeAttribute(t),e.removeAttribute(Cs+t))}*viewChildrenToDom(e,t={}){const i=e.getFillerOffset&&e.getFillerOffset();let n=0;for(const o of e.getChildren()){i===n&&(yield this._getBlockFiller());const e=o.is("element")&&!!o.getCustomProperty("dataPipeline:transparentRendering")&&!Jt(o.getAttributes());if(e&&"data"==this.renderingMode)if(o.is("rawElement")){const e=this._domDocument.createElement(o.name);o.render(e,this),yield*[...e.childNodes]}else yield*this.viewChildrenToDom(o,t);else e&&x("domconverter-transparent-rendering-unsupported-in-editing-pipeline",{viewElement:o}),yield this.viewToDom(o,t);n++}i===n&&(yield this._getBlockFiller())}viewRangeToDom(e){const t=this.viewPositionToDom(e.start),i=this.viewPositionToDom(e.end),n=this._domDocument.createRange();return n.setStart(t.parent,t.offset),n.setEnd(i.parent,i.offset),n}viewPositionToDom(e){const t=e.parent;if(t.is("$text")){const i=this.findCorrespondingDomText(t);if(!i)return null;let n=e.offset;return us(i)&&(n+=7),i.data&&n>i.data.length&&(n=i.data.length),{parent:i,offset:n}}{let i,n,o;if(0===e.offset){if(i=this.mapViewToDom(t),!i)return null;o=i.childNodes[0]}else{const t=e.nodeBefore;if(n=t.is("$text")?this.findCorrespondingDomText(t):this.mapViewToDom(t),!n)return null;i=n.parentNode,o=n.nextSibling}if(Ge(o)&&us(o))return{parent:o,offset:7};return{parent:i,offset:n?at(n)+1:0}}}domToView(e,t={}){const i=[],n=this._domToView(e,t,i),o=n.next().value;return o?(n.next(),this._processDomInlineNodes(null,i,t),"br"==this.blockFillerMode&&Os(o)||o.is("$text")&&0==o.data.length?null:o):null}*domChildrenToView(e,t={},i=[]){let n=[];n=e instanceof HTMLTemplateElement?[...e.content.childNodes]:[...e.childNodes];for(let o=0;o<n.length;o++){const r=n[o],s=this._domToView(r,t,i),a=s.next().value;null!==a&&(this._isBlockViewElement(a)&&this._processDomInlineNodes(e,i,t),"br"==this.blockFillerMode&&Os(a)||(yield a),s.next())}this._processDomInlineNodes(e,i,t)}domSelectionToView(e){if(function(e){if(!r.isGecko)return!1;if(!e.rangeCount)return!1;const t=e.getRangeAt(0).startContainer;try{Object.prototype.toString.call(t)}catch{return!0}return!1}(e))return new Er([]);if(1===e.rangeCount){let t=e.getRangeAt(0).startContainer;Ge(t)&&(t=t.parentNode);const i=this.fakeSelectionToView(t);if(i)return i}const t=this.isDomSelectionBackward(e),i=[];for(let t=0;t<e.rangeCount;t++){const n=e.getRangeAt(t),o=this.domRangeToView(n);o&&i.push(o)}return new Er(i,{backward:t})}domRangeToView(e){const t=this.domPositionToView(e.startContainer,e.startOffset),i=this.domPositionToView(e.endContainer,e.endOffset);return t&&i?new Cr(t,i):null}domPositionToView(e,t=0){if(this.isBlockFiller(e))return this.domPositionToView(e.parentNode,at(e));const i=this.mapDomToView(e);if(i&&(i.is("uiElement")||i.is("rawElement")))return xr._createBefore(i);if(Ge(e)){if(hs(e))return this.domPositionToView(e.parentNode,at(e));const i=this.findCorrespondingViewText(e);let n=t;return i?(us(e)&&(n-=7,n=n<0?0:n),new xr(i,n)):null}if(0===t){const t=this.mapDomToView(e);if(t)return new xr(t,0)}else{const i=e.childNodes[t-1];if(Ge(i)&&hs(i)||i&&this.isBlockFiller(i))return this.domPositionToView(i.parentNode,at(i));const n=Ge(i)?this.findCorrespondingViewText(i):this.mapDomToView(i);if(n&&n.parent)return new xr(n.parent,n.index+1)}return null}mapDomToView(e){return this.getHostViewElement(e)||this._domToViewMapping.get(e)}findCorrespondingViewText(e){if(hs(e))return null;const t=this.getHostViewElement(e);if(t)return t;const i=e.previousSibling;if(i){if(!this.isElement(i))return null;const e=this.mapDomToView(i);if(e){const t=e.nextSibling;return t instanceof jo?t:null}}else{const t=this.mapDomToView(e.parentNode);if(t){const e=t.getChild(0);return e instanceof jo?e:null}}return null}mapViewToDom(e){return this._viewToDomMapping.get(e)}findCorrespondingDomText(e){const t=e.previousSibling;return t&&this.mapViewToDom(t)?this.mapViewToDom(t).nextSibling:!t&&e.parent&&this.mapViewToDom(e.parent)?this.mapViewToDom(e.parent).childNodes[0]:null}focus(t){const i=this.mapViewToDom(t);if(!i||i.ownerDocument.activeElement===i)return;const{scrollX:n,scrollY:o}=e.window,r=[];Is(i,e=>{const{scrollLeft:t,scrollTop:i}=e;r.push([t,i])}),i.focus({preventScroll:!0}),Is(i,e=>{const[t,i]=r.shift();e.scrollLeft=t,e.scrollTop=i}),e.window.scrollTo(n,o)}_clearDomSelection(){const e=this.mapViewToDom(this.document.selection.editableElement);if(!e)return;const t=e.ownerDocument.defaultView.getSelection(),i=this.domSelectionToView(t);i&&i.rangeCount>0&&t.removeAllRanges()}isElement(e){return e&&e.nodeType==Node.ELEMENT_NODE}isDocumentFragment(e){return e&&e.nodeType==Node.DOCUMENT_FRAGMENT_NODE}isBlockFiller(e){return"br"==this.blockFillerMode?e.isEqualNode(ys):!!Rs(e,this.blockElements)||(e.isEqualNode(xs)||function(e,t){const i=e.isEqualNode(As);return i&&Ss(e,t)&&1===e.parentNode.childNodes.length}(e,this.blockElements))}isDomSelectionBackward(e){if(e.isCollapsed)return!1;const t=this._domDocument.createRange();try{t.setStart(e.anchorNode,e.anchorOffset),t.setEnd(e.focusNode,e.focusOffset)}catch{return!1}const i=t.collapsed;return t.detach(),i}getHostViewElement(e){const t=function(e){const t=[];let i=e;for(;i&&i.nodeType!=Node.DOCUMENT_NODE;)t.unshift(i),i=i.parentNode;return t}(e);for(t.pop();t.length;){const e=t.pop(),i=this._domToViewMapping.get(e);if(i&&(i.is("uiElement")||i.is("rawElement")))return i}return null}isDomSelectionCorrect(e){return this._isDomSelectionPositionCorrect(e.anchorNode,e.anchorOffset)&&this._isDomSelectionPositionCorrect(e.focusNode,e.focusOffset)}registerRawContentMatcher(e){this._rawContentElementMatcher.add(e)}registerInlineObjectMatcher(e){this._inlineObjectElementMatcher.add(e)}_clearTemporaryCustomProperties(){for(const e of this._elementsWithTemporaryCustomProperties)e._removeCustomProperty("editingPipeline:doNotReuseOnce");this._elementsWithTemporaryCustomProperties.clear()}_getBlockFiller(){switch(this.blockFillerMode){case"nbsp":return as(this._domDocument);case"markedNbsp":return ls(this._domDocument);case"br":return cs(this._domDocument)}}_isDomSelectionPositionCorrect(e,t){if(Ge(e)&&us(e)&&t<7)return!1;if(this.isElement(e)&&us(e.childNodes[t]))return!1;const i=this.mapDomToView(e);return!i||!i.is("uiElement")&&!i.is("rawElement")}*_domToView(e,t,i){if("br"!=this.blockFillerMode&&Rs(e,this.blockElements))return null;const n=this.getHostViewElement(e);if(n)return n;if(ct(e)&&t.skipComments)return null;if(Ge(e)){if(hs(e))return null;{const t=e.data;if(""===t)return null;const n=new jo(this.document,t);return i.push(n),n}}{let n=this.mapDomToView(e);if(n)return this._isInlineObjectElement(n)&&i.push(n),n;if(this.isDocumentFragment(e))n=new Jr(this.document),t.bind&&this.bindDocumentFragments(e,n);else{n=this._createViewElement(e,t),t.bind&&this.bindElements(e,n);const o=e.attributes;if(o)for(let e=o.length,t=0;t<e;t++)n._setAttribute(o[t].name,o[t].value);if(this._isViewElementWithRawContent(n,t))return n._setCustomProperty("$rawContent",e.innerHTML),this._isBlockViewElement(n)||i.push(n),n;if(ct(e))return n._setCustomProperty("$rawContent",e.data),n}yield n;const o=[];if(!1!==t.withChildren)for(const i of this.domChildrenToView(e,t,o))n._appendChild(i);if(this._isInlineObjectElement(n))i.push(n),this._processDomInlineNodes(null,o,t);else for(const e of o)i.push(e)}}_processDomInlineNodes(e,t,i){if(!t.length)return;if(e&&!this.isDocumentFragment(e)&&!this._isBlockDomElement(e))return;let n=!1;for(let e=0;e<t.length;e++){const o=t[e];if(!o.is("$text")){n=!1;continue}let r,s=!1;if(this._isPreFormatted(o))r=ms(o.data);else{r=o.data.replace(/[ \n\t\r]{1,}/g," "),s=/[^\S\u00A0]/.test(r.charAt(r.length-1));const a=e>0?t[e-1]:null,l=e+1<t.length?t[e+1]:null,c=!a||a.is("element")&&"br"==a.name||n,d=!l&&!us(o.data);!1!==i.withChildren&&(c&&(r=r.replace(/^ /,"")),d&&(r=r.replace(/ $/,""))),r=ms(r),"br"!=this.blockFillerMode&&o.parent&&(Ms(o.parent,r)?(r="",o.parent.parent&&(o.parent.parent._setCustomProperty("$hasBlockFiller",!0),o.parent._remove())):Ps(o.parent,r,this.blockElements)&&(r="",o.parent._setCustomProperty("$hasBlockFiller",!0))),r=r.replace(/ \u00A0/g," ");const u=l&&l.is("element")&&"br"!=l.name,h=l&&l.is("$text")&&" "==l.data.charAt(0);(/[ \u00A0]\u00A0$/.test(r)||!l||u||h)&&(r=r.replace(/\u00A0$/," ")),(c||a&&a.is("element")&&"br"!=a.name)&&(r=r.replace(/^\u00A0/," "))}0==r.length&&o.parent?(o._remove(),t.splice(e,1),e--):(o._data=r,n=s)}t.length=0}_processDataFromViewText(e){let t=e.data;if(this._isPreFormatted(e))return t;if(" "==t.charAt(0)){const i=this._getTouchingInlineViewNode(e,!1);!(i&&i.is("$textProxy")&&this._nodeEndsWithSpace(i))&&i||(t=" "+t.substr(1))}if(" "==t.charAt(t.length-1)){const i=this._getTouchingInlineViewNode(e,!0),n=i&&i.is("$textProxy")&&" "==i.data.charAt(0);" "!=t.charAt(t.length-2)&&i&&!n||(t=t.substr(0,t.length-1)+" ")}return t.replace(/ {2}/g," ")}_nodeEndsWithSpace(e){if(this._isPreFormatted(e))return!1;const t=this._processDataFromViewText(e);return" "==t.charAt(t.length-1)}_isPreFormatted(e){if(function(e,t){return e.getAncestors().some(e=>e.is("element")&&t.includes(e.name))}(e,this.preElements))return!0;for(const t of e.getAncestors({parentFirst:!0}))if(t.is("element")&&t.hasStyle("white-space")&&"inherit"!==t.getStyle("white-space"))return["pre","pre-wrap","break-spaces"].includes(t.getStyle("white-space"));return!1}_getTouchingInlineViewNode(e,t){const i=new Ar({startPosition:t?xr._createAfter(e):xr._createBefore(e),direction:t?"forward":"backward"});for(const{item:e}of i){if(e.is("$textProxy"))return e;if(!e.is("element")||!e.getCustomProperty("dataPipeline:transparentRendering")){if(e.is("element","br"))return null;if(this._isInlineObjectElement(e))return e;if(e.is("containerElement")||this._isBlockViewElement(e))return null}}return null}_isBlockDomElement(e){return this.isElement(e)&&this.blockElements.includes(e.tagName.toLowerCase())}_isBlockViewElement(e){return e.is("element")&&this.blockElements.includes(e.name)}_isInlineObjectElement(e){return!!e.is("element")&&("br"==e.name||this.inlineObjectElements.includes(e.name)||!!this._inlineObjectElementMatcher.match(e))}_createViewElement(e,t){if(ct(e))return new $r(this.document,"$comment");const i=t.keepOriginalCase?e.tagName:e.tagName.toLowerCase();return new fr(this.document,i)}_isViewElementWithRawContent(e,t){return!1!==t.withChildren&&e.is("element")&&!!this._rawContentElementMatcher.match(e)}_shouldRenameElement(e){const t=e.toLowerCase();return"editing"===this.renderingMode&&this.unsafeElements.includes(t)}_createReplacementDomElement(e,t){const i=this._domDocument.createElement("span");if(i.setAttribute(Ts,e),t){for(;t.firstChild;)i.appendChild(t.firstChild);for(const e of t.getAttributeNames())i.setAttribute(e,t.getAttribute(e))}return i}}function Is(e,t){let i=e;for(;i;)t(i),i=i.parentElement}function Ss(e,t){const i=e.parentNode;return!!i&&!!i.tagName&&t.includes(i.tagName.toLowerCase())}function Ps(e,t,i){return" "==t&&e&&e.is("element")&&1==e.childCount&&i.includes(e.name)}function Ms(e,t){return" "==t&&e&&e.is("element","span")&&1==e.childCount&&e.hasAttribute("data-cke-filler")}function Os(e){return e.is("element","br")&&e.hasAttribute("data-cke-filler")}function Rs(e,t){return"BR"===e.tagName&&Ss(e,t)&&1===e.parentNode.childNodes.length}function Ns(e){"script"===e&&x("domconverter-unsafe-script-element-detected"),"style"===e&&x("domconverter-unsafe-style-element-detected")}class Vs extends(He()){view;document;_isEnabled=!1;constructor(e){super(),this.view=e,this.document=e.document}get isEnabled(){return this._isEnabled}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}destroy(){this.disable(),this.stopListening()}checkShouldIgnoreEventFromTarget(e){return e&&3===e.nodeType&&(e=e.parentNode),!(!e||1!==e.nodeType)&&e.matches("[data-cke-ignore-events], [data-cke-ignore-events] *")}}function Ls(e){return null!=e&&"function"!=typeof e&&function(e){return Number.isSafeInteger(e)&&e>=0}(e.length)}function Ds(e){if(!e)return 0===e?e:0;if((e=function(e){return or(e)?NaN:Number(e)}(e))===1/0||e===-1/0){return(e<0?-1:1)*Number.MAX_VALUE}return e==e?e:0}function Bs(e,t){if((e=function(e){const t=Ds(e),i=t%1;return i?t-i:t}(e))<1||!Number.isSafeInteger(e))return[];const i=new Array(e);for(let n=0;n<e;n++)i[n]="function"==typeof t?t(n):n;return i}function zs(e){if(null==e)return[];switch(typeof e){case"object":case"function":return Ls(e)?function(e){const t=Bs(e.length,e=>`${e}`),i=new Set(t);n=e,"undefined"!=typeof Buffer&&Buffer.isBuffer(n)&&(i.add("offset"),i.add("parent"));var n;jt(e)&&(i.add("buffer"),i.add("byteLength"),i.add("byteOffset"));return[...t,...Fs(e).filter(e=>!i.has(e))]}(e):function(e){const t=e?.constructor;return e===("function"==typeof t?t.prototype:Object.prototype)}(e)?function(e){const t=Fs(e);return t.filter(e=>"constructor"!==e)}(e):Fs(e);default:return Fs(Object(e))}}function Fs(e){const t=[];for(const i in e)t.push(i);return t}function js(e,...t){for(let i=0;i<t.length;i++)Us(e,t[i]);return e}function Us(e,t){const i=zs(t);for(let n=0;n<i.length;n++){const o=i[n];o in e&&er(e[o],t[o])||(e[o]=t[o])}}class Hs{view;document;domEvent;domTarget;constructor(e,t,i){this.view=e,this.document=e.document,this.domEvent=t,this.domTarget=t.target,js(this,i)}get target(){return this.view.domConverter.mapDomToView(this.domTarget)}preventDefault(){this.domEvent.preventDefault()}stopPropagation(){this.domEvent.stopPropagation()}}class Ws extends Vs{useCapture=!1;usePassive=!1;observe(e){("string"==typeof this.domEventType?[this.domEventType]:this.domEventType).forEach(t=>{this.listenTo(e,t,(e,t)=>{this.isEnabled&&!this.checkShouldIgnoreEventFromTarget(t.target)&&this.onDomEvent(t)},{useCapture:this.useCapture,usePassive:this.usePassive})})}stopObserving(e){this.stopListening(e)}fire(e,t,i){this.isEnabled&&this.document.fire(e,new Hs(this.view,t,i))}}class $s extends Ws{domEventType=["keydown","keyup"];onDomEvent(e){const t={keyCode:e.keyCode,altKey:e.altKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,metaKey:e.metaKey,get keystroke(){return Ot(this)}};this.fire(e.type,e,t)}}class qs extends Vs{_fireSelectionChangeDoneDebounced;constructor(e){super(e),this._fireSelectionChangeDoneDebounced=an(e=>{this.document.fire("selectionChangeDone",e)},200)}observe(){const e=this.document;e.on("arrowKey",(t,i)=>{e.selection.isFake&&this.isEnabled&&i.preventDefault()},{context:"$capture"}),e.on("arrowKey",(t,i)=>{e.selection.isFake&&this.isEnabled&&this._handleSelectionMove(i.keyCode)},{priority:"lowest"})}stopObserving(){}destroy(){super.destroy(),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionMove(e){const t=this.document.selection,i=new Er(t.getRanges(),{backward:t.isBackward,fake:!1});e!=Pt.arrowleft&&e!=Pt.arrowup||i.setTo(i.getFirstPosition()),e!=Pt.arrowright&&e!=Pt.arrowdown||i.setTo(i.getLastPosition());const n={oldSelection:t,newSelection:i,domSelection:null};this.document.fire("selectionChange",n),this._fireSelectionChangeDoneDebounced(n)}}function Ks(e,t){if(!Number.isInteger(e)||e<0)throw new Error("n must be a non-negative integer.");let i=0;return(...n)=>{if(++i>=e)return t(...n)}}function Gs(e){if(!e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t))&&"[object Object]"===Object.prototype.toString.call(e)}function Ys(e,t,i){return Js(e,t,void 0,void 0,void 0,void 0,i)}function Js(e,t,i,n,o,r,s){const a=s(e,t,i,n,o,r);if(void 0!==a)return a;if(typeof e==typeof t)switch(typeof e){case"bigint":case"string":case"boolean":case"symbol":case"undefined":case"function":return e===t;case"number":return e===t||Object.is(e,t);case"object":return Qs(e,t,r,s)}return Qs(e,t,r,s)}function Qs(e,t,i,n){if(Object.is(e,t))return!0;let o=ae(e),r=ae(t);if(o===he&&(o=we),r===he&&(r=we),o!==r)return!1;switch(o){case ce:return e.toString()===t.toString();case de:return er(e.valueOf(),t.valueOf());case ue:case ge:case me:return Object.is(e.valueOf(),t.valueOf());case le:return e.source===t.source&&e.flags===t.flags;case"[object Function]":return e===t}const s=(i=i??new Map).get(e),a=i.get(t);if(null!=s&&null!=a)return s===t;i.set(e,t),i.set(t,e);try{switch(o){case fe:if(e.size!==t.size)return!1;for(const[o,r]of e.entries())if(!t.has(o)||!Js(r,t.get(o),o,e,t,i,n))return!1;return!0;case pe:{if(e.size!==t.size)return!1;const o=Array.from(e.values()),r=Array.from(t.values());for(let s=0;s<o.length;s++){const a=o[s],l=r.findIndex(o=>Js(a,o,void 0,e,t,i,n));if(-1===l)return!1;r.splice(l,1)}return!0}case be:case ve:case ye:case Ae:case xe:case"[object BigUint64Array]":case Ce:case Te:case Ee:case"[object BigInt64Array]":case Ie:case Se:if("undefined"!=typeof Buffer&&Buffer.isBuffer(e)!==Buffer.isBuffer(t))return!1;if(e.length!==t.length)return!1;for(let o=0;o<e.length;o++)if(!Js(e[o],t[o],o,e,t,i,n))return!1;return!0;case ke:return e.byteLength===t.byteLength&&Qs(new Uint8Array(e),new Uint8Array(t),i,n);case _e:return e.byteLength===t.byteLength&&e.byteOffset===t.byteOffset&&Qs(new Uint8Array(e),new Uint8Array(t),i,n);case"[object Error]":return e.name===t.name&&e.message===t.message;case we:{if(!(Qs(e.constructor,t.constructor,i,n)||Gs(e)&&Gs(t)))return!1;const o=[...Object.keys(e),...se(e)],r=[...Object.keys(t),...se(t)];if(o.length!==r.length)return!1;for(let r=0;r<o.length;r++){const s=o[r],a=e[s];if(!Object.hasOwn(t,s))return!1;if(!Js(a,t[s],s,e,t,i,n))return!1}return!0}default:return!1}}finally{i.delete(e),i.delete(t)}}function Zs(e,t,i){return"function"!=typeof i&&(i=()=>{}),Ys(e,t,(...n)=>{const o=i(...n);return void 0!==o?Boolean(o):e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?Zs(Array.from(e),Array.from(t),Ks(2,i)):void 0})}class Xs extends Vs{domConverter;_config;_domElements;_mutationObserver;constructor(e){super(e),this._config={childList:!0,characterData:!0,subtree:!0},this.domConverter=e.domConverter,this._domElements=new Set,this._mutationObserver=new window.MutationObserver(this._onMutations.bind(this))}flush(){this._onMutations(this._mutationObserver.takeRecords())}observe(e){this._domElements.add(e),this.isEnabled&&this._mutationObserver.observe(e,this._config)}stopObserving(e){if(this._domElements.delete(e),this.isEnabled){this._mutationObserver.disconnect();for(const e of this._domElements)this._mutationObserver.observe(e,this._config)}}enable(){super.enable();for(const e of this._domElements)this._mutationObserver.observe(e,this._config)}disable(){super.disable(),this._mutationObserver.disconnect()}destroy(){super.destroy(),this._mutationObserver.disconnect()}_onMutations(e){if(0===e.length)return;const t=this.domConverter,i=new Set,n=new Set;for(const i of e){const e=t.mapDomToView(i.target);e&&(e.is("uiElement")||e.is("rawElement")||"childList"!==i.type||this._isBogusBrMutation(i)||n.add(e))}for(const o of e){const e=t.mapDomToView(o.target);if((!e||!e.is("uiElement")&&!e.is("rawElement"))&&"characterData"===o.type){const e=t.findCorrespondingViewText(o.target);e&&!n.has(e.parent)?i.add(e):!e&&us(o.target)&&n.add(t.mapDomToView(o.target.parentNode))}}const o=[];for(const e of i)o.push({type:"text",node:e});for(const e of n){const i=t.mapViewToDom(e);Zs(Array.from(e.getChildren()),Array.from(t.domChildrenToView(i,{withChildren:!1})),ea)||o.push({type:"children",node:e})}o.length&&this.document.fire("mutations",{mutations:o})}_isBogusBrMutation(e){let t=null;return null===e.nextSibling&&0===e.removedNodes.length&&1==e.addedNodes.length&&(t=this.domConverter.domToView(e.addedNodes[0],{withChildren:!1})),t&&t.is("element","br")}}function ea(e,t){if(!Array.isArray(e))return e===t||!(!e.is("$text")||!t.is("$text"))&&e.data===t.data}class ta extends Ws{_renderTimeoutId=null;_isFocusChanging=!1;domEventType=["focus","blur"];constructor(e){super(e),this.useCapture=!0;const t=this.document;t.on("focus",()=>this._handleFocus()),t.on("blur",(e,t)=>this._handleBlur(t)),t.on("beforeinput",()=>{t.isFocused||this._handleFocus()},{priority:"highest"})}flush(){this._isFocusChanging&&(this._isFocusChanging=!1,this.document.isFocused=!0)}onDomEvent(e){this.fire(e.type,e)}destroy(){this._clearTimeout(),super.destroy()}_handleFocus(){this._clearTimeout(),this._isFocusChanging=!0,this._renderTimeoutId=setTimeout(()=>{this._renderTimeoutId=null,this.flush(),this.view.change(()=>{})},50)}_handleBlur(e){const t=this.document.selection.editableElement;null!==t&&t!==e.target||(this.document.isFocused=!1,this._isFocusChanging=!1,this.view.change(()=>{}))}_clearTimeout(){this._renderTimeoutId&&(clearTimeout(this._renderTimeoutId),this._renderTimeoutId=null)}}class ia extends Vs{mutationObserver;focusObserver;selection;domConverter;_documents=new WeakSet;_fireSelectionChangeDoneDebounced;_clearInfiniteLoopInterval;_documentIsSelectingInactivityTimeoutDebounced;_loopbackCounter=0;_pendingSelectionChange=new Set;constructor(e){super(e),this.mutationObserver=e.getObserver(Xs),this.focusObserver=e.getObserver(ta),this.selection=this.document.selection,this.domConverter=e.domConverter,this._fireSelectionChangeDoneDebounced=an(e=>{this.document.fire("selectionChangeDone",e)},200),this._clearInfiniteLoopInterval=setInterval(()=>this._clearInfiniteLoop(),1e3),this._documentIsSelectingInactivityTimeoutDebounced=an(()=>this.document.isSelecting=!1,5e3),this.view.document.on("change:isFocused",(e,t,i)=>{if(i&&this._pendingSelectionChange.size){for(const e of Array.from(this._pendingSelectionChange))this._handleSelectionChange(e);this._pendingSelectionChange.clear()}})}observe(e){const t=e.ownerDocument,i=()=>{this.document.isSelecting&&(this._handleSelectionChange(t),this.document.isSelecting=!1,this._documentIsSelectingInactivityTimeoutDebounced.cancel())};this.listenTo(e,"selectstart",()=>{this.document.isSelecting=!0,this._documentIsSelectingInactivityTimeoutDebounced()},{priority:"highest"}),this.listenTo(e,"keydown",i,{priority:"highest",useCapture:!0}),this.listenTo(e,"keyup",i,{priority:"highest",useCapture:!0}),this._documents.has(t)||(this.listenTo(t,"mouseup",i,{priority:"highest",useCapture:!0}),this.listenTo(t,"selectionchange",()=>{this.document.isComposing&&!r.isAndroid||(this._handleSelectionChange(t),this._documentIsSelectingInactivityTimeoutDebounced())}),this.listenTo(this.view.document,"compositionstart",()=>{this._handleSelectionChange(t)},{priority:"lowest"}),this._documents.add(t))}stopObserving(e){this.stopListening(e)}destroy(){super.destroy(),clearInterval(this._clearInfiniteLoopInterval),this._fireSelectionChangeDoneDebounced.cancel(),this._documentIsSelectingInactivityTimeoutDebounced.cancel()}_reportInfiniteLoop(){}_handleSelectionChange(e){if(!this.isEnabled)return;const t=e.defaultView.getSelection();if(this.checkShouldIgnoreEventFromTarget(t.anchorNode))return;this.mutationObserver.flush();const i=this.domConverter.domSelectionToView(t);var n;if(0!=i.rangeCount)if(this.view.hasDomSelection=!0,this.focusObserver.flush(),this.view.document.isFocused||this.view.document.isReadOnly){if(this._pendingSelectionChange.delete(e),!this.selection.isEqual(i)||!this.domConverter.isDomSelectionCorrect(t))if(++this._loopbackCounter>60)this._reportInfiniteLoop();else if(n=i,Array.from(n.getRanges()).flatMap(e=>[e.start.root,e.end.root]).every(e=>e&&e.is("rootElement")))if(this.selection.isSimilar(i))this.view.forceRender();else{const e={oldSelection:this.selection,newSelection:i,domSelection:t};this.document.fire("selectionChange",e),this._fireSelectionChangeDoneDebounced(e)}else this.view.forceRender()}else this._pendingSelectionChange.add(e);else this.view.hasDomSelection=!1}_clearInfiniteLoop(){this._loopbackCounter=0}}class na extends Ws{domEventType=["compositionstart","compositionupdate","compositionend"];constructor(e){super(e);const t=this.document;t.on("compositionstart",()=>{t.isComposing=!0}),t.on("compositionend",()=>{t.isComposing=!1})}onDomEvent(e){this.fire(e.type,e,{data:e.data})}}class oa{_files;_native;constructor(e,t={}){this._files=t.cacheFiles?ra(e):null,this._native=e}get files(){return this._files||(this._files=ra(this._native)),this._files}get types(){return this._native.types}getData(e){return this._native.getData(e)}setData(e,t){this._native.setData(e,t)}set effectAllowed(e){this._native.effectAllowed=e}get effectAllowed(){return this._native.effectAllowed}set dropEffect(e){this._native.dropEffect=e}get dropEffect(){return this._native.dropEffect}setDragImage(e,t,i){this._native.setDragImage(e,t,i)}get isCanceled(){return"none"==this._native.dropEffect||!!this._native.mozUserCancelled}}function ra(e){const t=Array.from(e.files||[]),i=Array.from(e.items||[]);return t.length?t:i.filter(e=>"file"===e.kind).map(e=>e.getAsFile())}class sa extends Ws{domEventType="beforeinput";onDomEvent(e){const t=e.getTargetRanges(),i=this.view,n=i.document;let o=null,s=null,a=[];if(e.dataTransfer&&(o=new oa(e.dataTransfer)),null!==e.data?s=e.data:o&&(s=o.getData("text/plain")),n.selection.isFake)a=Array.from(n.selection.getRanges()),e.preventDefault();else if(t.length)a=t.map(t=>{let n=i.domConverter.domPositionToView(t.startContainer,t.startOffset);const o=i.domConverter.domPositionToView(t.endContainer,t.endOffset);if(n&&us(t.startContainer)&&t.startOffset<7){e.preventDefault();let i=7-t.startOffset;n=n.getLastMatchingPosition(e=>!(!e.item.is("attributeElement")&&!e.item.is("uiElement"))||!(!e.item.is("$textProxy")||!i--),{direction:"backward",singleCharacters:!0})}return function(e,t){for(;e.parentNode;){if(Ge(e)){if(t!=e.data.length)return!1}else if(t!=e.childNodes.length)return!1;if((t=at(e)+1)<(e=e.parentNode).childNodes.length&&us(e.childNodes[t]))return!0}return!1}(t.endContainer,t.endOffset)&&e.preventDefault(),n?i.createRange(n,o):o?i.createRange(o):void 0}).filter(e=>!!e);else if(r.isAndroid){const t=e.target.ownerDocument.defaultView.getSelection();a=Array.from(i.domConverter.domSelectionToView(t).getRanges())}if(r.isAndroid&&"insertCompositionText"==e.inputType&&s&&s.endsWith("\n"))this.fire(e.type,e,{inputType:"insertParagraph",targetRanges:[i.createRange(a[0].end)]});else{if(["insertText","insertReplacementText"].includes(e.inputType)&&s&&s.includes("\n")){const t=s.split(/\n{1,2}/g);let i=a;e.preventDefault();for(let r=0;r<t.length;r++){const s=t[r];""!=s&&(this.fire(e.type,e,{data:s,dataTransfer:o,targetRanges:i,inputType:e.inputType,isComposing:e.isComposing}),i=[n.selection.getFirstRange()]),r+1<t.length&&(this.fire(e.type,e,{inputType:"insertParagraph",targetRanges:i}),i=[n.selection.getFirstRange()])}return}this.fire(e.type,e,{data:s,dataTransfer:o,targetRanges:a,inputType:e.inputType,isComposing:e.isComposing})}}}class aa extends Vs{constructor(e){super(e),this.document.on("keydown",(e,t)=>{if(this.isEnabled&&((i=t.keyCode)==Pt.arrowright||i==Pt.arrowleft||i==Pt.arrowup||i==Pt.arrowdown)){const i=new Sr(this.document,"arrowKey",this.document.selection.getFirstRange());this.document.fire(i,t),i.stop.called&&e.stop()}var i})}observe(){}stopObserving(){}}class la extends Vs{constructor(e){super(e);const t=this.document;t.on("keydown",(e,i)=>{if(!this.isEnabled||i.keyCode!=Pt.tab||i.ctrlKey)return;const n=new Sr(t,"tab",t.selection.getFirstRange());t.fire(n,i),n.stop.called&&e.stop()})}observe(){}stopObserving(){}}class ca extends(K()){document;domConverter;domRoots=new Map;_renderer;_initialDomRootAttributes=new WeakMap;_observers=new Map;_writer;_ongoingChange=!1;_postFixersInProgress=!1;_renderingDisabled=!1;_hasChangedSinceTheLastRendering=!1;constructor(e){super(),this.document=new zr(e),this.domConverter=new Es(this.document),this.set("isRenderingInProgress",!1),this.set("hasDomSelection",!1),this._renderer=new bs(this.domConverter,this.document.selection),this._renderer.bind("isFocused","isSelecting","isComposing").to(this.document,"isFocused","isSelecting","isComposing"),this._writer=new Qr(this.document),this.addObserver(Xs),this.addObserver(ta),this.addObserver(ia),this.addObserver($s),this.addObserver(qs),this.addObserver(na),this.addObserver(aa),this.addObserver(sa),this.addObserver(la),this.document.on("arrowKey",gs,{priority:"low"}),qr(this),this.on("render",()=>{this._render(),this.document.fire("layoutChanged"),this._hasChangedSinceTheLastRendering=!1}),this.listenTo(this.document.selection,"change",()=>{this._hasChangedSinceTheLastRendering=!0}),this.listenTo(this.document,"change:isFocused",()=>{this._hasChangedSinceTheLastRendering=!0}),r.isiOS&&this.listenTo(this.document,"blur",(e,t)=>{this.domConverter.mapDomToView(t.domEvent.relatedTarget)||this.domConverter._clearDomSelection()}),this.listenTo(this.document,"mutations",(e,{mutations:t})=>{t.forEach(e=>this._renderer.markToSync(e.type,e.node))},{priority:"low"}),this.listenTo(this.document,"mutations",()=>{this.forceRender()},{priority:"lowest"})}attachDomRoot(e,t="main"){const i=this.document.getRoot(t);i._name=e.tagName.toLowerCase();const n={};for(const{name:t,value:o}of Array.from(e.attributes))n[t]=o,"class"===t?this._writer.addClass(o.split(" "),i):i.hasAttribute(t)||this._writer.setAttribute(t,o,i);this._initialDomRootAttributes.set(e,n);const o=()=>{this._writer.setAttribute("contenteditable",(!i.isReadOnly).toString(),i),i.isReadOnly?this._writer.addClass("ck-read-only",i):this._writer.removeClass("ck-read-only",i)};o(),this.domRoots.set(t,e),this.domConverter.bindElements(e,i),this._renderer.markToSync("children",i),this._renderer.markToSync("attributes",i),this._renderer.domDocuments.add(e.ownerDocument),i.on("change:children",(e,t)=>this._renderer.markToSync("children",t)),i.on("change:attributes",(e,t)=>this._renderer.markToSync("attributes",t)),i.on("change:text",(e,t)=>this._renderer.markToSync("text",t)),i.on("change:isReadOnly",()=>this.change(o)),i.on("change",()=>{this._hasChangedSinceTheLastRendering=!0});for(const i of this._observers.values())i.observe(e,t)}detachDomRoot(e){const t=this.domRoots.get(e);Array.from(t.attributes).forEach(({name:e})=>t.removeAttribute(e));const i=this._initialDomRootAttributes.get(t);for(const e in i)t.setAttribute(e,i[e]);this.domRoots.delete(e),this.domConverter.unbindDomElement(t);for(const e of this._observers.values())e.stopObserving(t)}getDomRoot(e="main"){return this.domRoots.get(e)}addObserver(e){let t=this._observers.get(e);if(t)return t;t=new e(this),this._observers.set(e,t);for(const[e,i]of this.domRoots)t.observe(i,e);return t.enable(),t}getObserver(e){return this._observers.get(e)}disableObservers(){for(const e of this._observers.values())e.disable()}enableObservers(){for(const e of this._observers.values())e.enable()}scrollToTheSelection({alignToTop:e,forceScroll:t,viewportOffset:i=20,ancestorOffset:n=20}={}){const o=this.document.selection.getFirstRange();if(!o)return;const r=Bt({alignToTop:e,forceScroll:t,viewportOffset:i,ancestorOffset:n});"number"==typeof i&&(i={top:i,bottom:i,left:i,right:i});const s={target:this.domConverter.viewRangeToDom(o),viewportOffset:i,ancestorOffset:n,alignToTop:e,forceScroll:t};this.fire("scrollToTheSelection",s,r),function({target:e,viewportOffset:t=0,ancestorOffset:i=0,alignToTop:n,forceScroll:o}){const r=xt(e);let s=r,a=null;for(t=function(e){return"number"==typeof e?{top:e,bottom:e,left:e,right:e}:e}(t);s;){let l;l=Ct(s==r?e:a),wt({parent:l,getRect:()=>Tt(e,s),alignToTop:n,ancestorOffset:i,forceScroll:o});let c=Tt(e,s);const d=Tt(l,s);if(c.height>d.height){const e=c.getIntersection(d);e&&(c=e)}if(kt({window:s,rect:c,viewportOffset:t,alignToTop:n,forceScroll:o}),s.parent!=s){if(a=s.frameElement,s=s.parent,!a)return}else s=null}}(s)}focus(){if(!this.document.isFocused){const e=this.document.selection.editableElement;e&&(this.domConverter.focus(e),this.forceRender())}}change(e){if(this.isRenderingInProgress||this._postFixersInProgress)throw new A("cannot-change-view-tree",this);try{if(this._ongoingChange)return e(this._writer);this._ongoingChange=!0;const t=e(this._writer);return this._ongoingChange=!1,!this._renderingDisabled&&this._hasChangedSinceTheLastRendering&&(this._postFixersInProgress=!0,this.document._callPostFixers(this._writer),this._postFixersInProgress=!1,this.fire("render")),t}catch(e){A.rethrowUnexpectedError(e,this)}}forceRender(){this._hasChangedSinceTheLastRendering=!0,this.getObserver(ta).flush(),this.change(()=>{})}destroy(){for(const e of this._observers.values())e.destroy();this.document.destroy(),this.stopListening()}createPositionAt(e,t){return xr._createAt(e,t)}createPositionAfter(e){return xr._createAfter(e)}createPositionBefore(e){return xr._createBefore(e)}createRange(e,t){return new Cr(e,t)}createRangeOn(e){return Cr._createOn(e)}createRangeIn(e){return Cr._createIn(e)}createSelection(...e){return new Er(...e)}_disableRendering(e){this._renderingDisabled=e,0==e&&this.change(()=>{})}_render(){this.isRenderingInProgress=!0,this.disableObservers(),this._renderer.render(),this.enableObservers(),this.isRenderingInProgress=!1}}class da{is(){throw new Error("is() method is abstract")}}class ua extends da{textNode;data;offsetInText;constructor(e,t,i){if(super(),this.textNode=e,t<0||t>e.offsetSize)throw new A("model-textproxy-wrong-offsetintext",this);if(i<0||t+i>e.offsetSize)throw new A("model-textproxy-wrong-length",this);this.data=e.data.substring(t,t+i),this.offsetInText=t}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}getPath(){const e=this.textNode.getPath();return e.length>0&&(e[e.length-1]+=this.offsetInText),e}getAncestors(e={}){const t=[];let i=e.includeSelf?this:this.parent;for(;i;)t[e.parentFirst?"push":"unshift"](i),i=i.parent;return t}hasAttribute(e){return this.textNode.hasAttribute(e)}getAttribute(e){return this.textNode.getAttribute(e)}getAttributes(){return this.textNode.getAttributes()}getAttributeKeys(){return this.textNode.getAttributeKeys()}}ua.prototype.is=function(e){return"$textProxy"===e||"model:$textProxy"===e||"textProxy"===e||"model:textProxy"===e};class ha{direction;boundaries;singleCharacters;shallow;ignoreElementEnd;_position;_boundaryStartParent;_boundaryEndParent;_visitedParent;constructor(e){if(!e||!e.boundaries&&!e.startPosition)throw new A("model-tree-walker-no-start-position",null);const t=e.direction||"forward";if("forward"!=t&&"backward"!=t)throw new A("model-tree-walker-unknown-direction",e,{direction:t});this.direction=t,this.boundaries=e.boundaries||null,e.startPosition?this._position=e.startPosition.clone():this._position=ga._createAt(this.boundaries["backward"==this.direction?"end":"start"]),this.position.stickiness="toNone",this.singleCharacters=!!e.singleCharacters,this.shallow=!!e.shallow,this.ignoreElementEnd=!!e.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null,this._visitedParent=this.position.parent}[Symbol.iterator](){return this}get position(){return this._position}skip(e){let t,i,n,o;do{n=this.position,o=this._visitedParent,({done:t,value:i}=this.next())}while(!t&&e(i));t||(this._position=n,this._visitedParent=o)}jumpTo(e){this._boundaryStartParent&&e.isBefore(this.boundaries.start)?e=this.boundaries.start:this._boundaryEndParent&&e.isAfter(this.boundaries.end)&&(e=this.boundaries.end),this._position=e.clone(),this._visitedParent=e.parent}next(){return"forward"==this.direction?this._next():this._previous()}_next(){const e=this.position,t=this.position.clone(),i=this._visitedParent;if(null===i.parent&&t.offset===i.maxOffset)return{done:!0,value:void 0};if(i===this._boundaryEndParent&&t.offset==this.boundaries.end.offset)return{done:!0,value:void 0};const n=fa(t,i),o=n||pa(t,i,n);if(o&&o.is("model:element")){if(this.shallow){if(this.boundaries&&this.boundaries.end.isBefore(t))return{done:!0,value:void 0};t.offset++}else t.path.push(0),this._visitedParent=o;return this._position=t,ma("elementStart",o,e,t,1)}if(o&&o.is("model:$text")){let n;if(this.singleCharacters)n=1;else{let e=o.endOffset;this._boundaryEndParent==i&&this.boundaries.end.offset<e&&(e=this.boundaries.end.offset),n=e-t.offset}const r=t.offset-o.startOffset,s=new ua(o,r,n);return t.offset+=n,this._position=t,ma("text",s,e,t,n)}return t.path.pop(),t.offset++,this._position=t,this._visitedParent=i.parent,this.ignoreElementEnd?this._next():ma("elementEnd",i,e,t)}_previous(){const e=this.position,t=this.position.clone(),i=this._visitedParent;if(null===i.parent&&0===t.offset)return{done:!0,value:void 0};if(i==this._boundaryStartParent&&t.offset==this.boundaries.start.offset)return{done:!0,value:void 0};const n=t.parent,o=fa(t,n),r=o||ba(t,n,o);if(r&&r.is("model:element"))return t.offset--,this.shallow?(this._position=t,ma("elementStart",r,e,t,1)):(t.path.push(r.maxOffset),this._position=t,this._visitedParent=r,this.ignoreElementEnd?this._previous():ma("elementEnd",r,e,t));if(r&&r.is("model:$text")){let n;if(this.singleCharacters)n=1;else{let e=r.startOffset;this._boundaryStartParent==i&&this.boundaries.start.offset>e&&(e=this.boundaries.start.offset),n=t.offset-e}const o=t.offset-r.startOffset,s=new ua(r,o-n,n);return t.offset-=n,this._position=t,ma("text",s,e,t,n)}return t.path.pop(),this._position=t,this._visitedParent=i.parent,ma("elementStart",i,e,t,1)}}function ma(e,t,i,n,o){return{done:!1,value:{type:e,item:t,previousPosition:i,nextPosition:n,length:o}}}class ga extends da{root;path;stickiness;constructor(e,t,i="toNone"){if(super(),!e.is("element")&&!e.is("documentFragment"))throw new A("model-position-root-invalid",e);if(!Array.isArray(t)||0===t.length)throw new A("model-position-path-incorrect-format",e,{path:t});e.is("rootElement")?t=t.slice():(t=[...e.getPath(),...t],e=e.root),this.root=e,this.path=t,this.stickiness=i}get offset(){return this.path[this.path.length-1]}set offset(e){this.path[this.path.length-1]=e}get parent(){let e=this.root;for(let t=0;t<this.path.length-1;t++)if(e=e.getChildAtOffset(this.path[t]),!e)throw new A("model-position-path-incorrect",this,{position:this});if(e.is("$text"))throw new A("model-position-path-incorrect",this,{position:this});return e}get index(){return this.parent.offsetToIndex(this.offset)}get textNode(){return fa(this,this.parent)}get nodeAfter(){const e=this.parent;return pa(this,e,fa(this,e))}get nodeBefore(){const e=this.parent;return ba(this,e,fa(this,e))}get isAtStart(){return 0===this.offset}get isAtEnd(){return this.offset==this.parent.maxOffset}isValid(){if(this.offset<0)return!1;let e=this.root;for(let t=0;t<this.path.length-1;t++)if(e=e.getChildAtOffset(this.path[t]),!e)return!1;return this.offset<=e.maxOffset}compareWith(e){if(this.root!=e.root)return"different";const t=te(this.path,e.path);switch(t){case"same":return"same";case"prefix":return"before";case"extension":return"after";default:return this.path[t]<e.path[t]?"before":"after"}}getLastMatchingPosition(e,t={}){t.startPosition=this;const i=new ha(t);return i.skip(e),i.position}getParentPath(){return this.path.slice(0,-1)}getAncestors(){const e=this.parent;return e.is("documentFragment")?[e]:e.getAncestors({includeSelf:!0})}findAncestor(e){const t=this.parent;return t.is("element")?t.findAncestor(e,{includeSelf:!0}):null}getCommonPath(e){if(this.root!=e.root)return[];const t=te(this.path,e.path),i="string"==typeof t?Math.min(this.path.length,e.path.length):t;return this.path.slice(0,i)}getCommonAncestor(e){const t=this.getAncestors(),i=e.getAncestors();let n=0;for(;t[n]==i[n]&&t[n];)n++;return 0===n?null:t[n-1]}getShiftedBy(e){const t=this.clone(),i=t.offset+e;return t.offset=i<0?0:i,t}isAfter(e){return"after"==this.compareWith(e)}isBefore(e){return"before"==this.compareWith(e)}isEqual(e){return"same"==this.compareWith(e)}isTouching(e){if(this.root!==e.root)return!1;const t=Math.min(this.path.length,e.path.length);for(let i=0;i<t;i++){const t=this.path[i]-e.path[i];if(t<-1||t>1)return!1;if(1===t)return ka(e,this,i);if(-1===t)return ka(this,e,i)}return this.path.length===e.path.length||(this.path.length>e.path.length?wa(this.path,t):wa(e.path,t))}hasSameParentAs(e){if(this.root!==e.root)return!1;return"same"==te(this.getParentPath(),e.getParentPath())}getTransformedByOperation(e){let t;switch(e.type){case"insert":t=this._getTransformedByInsertOperation(e);break;case"move":case"remove":case"reinsert":t=this._getTransformedByMoveOperation(e);break;case"split":t=this._getTransformedBySplitOperation(e);break;case"merge":t=this._getTransformedByMergeOperation(e);break;default:t=ga._createAt(this)}return t}_getTransformedByInsertOperation(e){return this._getTransformedByInsertion(e.position,e.howMany)}_getTransformedByMoveOperation(e){return this._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany)}_getTransformedBySplitOperation(e){const t=e.movedRange;return t.containsPosition(this)||t.start.isEqual(this)&&"toNext"==this.stickiness?this._getCombined(e.splitPosition,e.moveTargetPosition):e.graveyardPosition?this._getTransformedByMove(e.graveyardPosition,e.insertionPosition,1):this._getTransformedByInsertion(e.insertionPosition,1)}_getTransformedByMergeOperation(e){const t=e.movedRange;let i;return t.containsPosition(this)||t.start.isEqual(this)?(i=this._getCombined(e.sourcePosition,e.targetPosition),e.sourcePosition.isBefore(e.targetPosition)&&(i=i._getTransformedByDeletion(e.deletionPosition,1))):i=this.isEqual(e.deletionPosition)?ga._createAt(e.deletionPosition):this._getTransformedByMove(e.deletionPosition,e.graveyardPosition,1),i}_getTransformedByDeletion(e,t){const i=ga._createAt(this);if(this.root!=e.root)return i;if("same"==te(e.getParentPath(),this.getParentPath())){if(e.offset<this.offset){if(e.offset+t>this.offset)return null;i.offset-=t}}else if("prefix"==te(e.getParentPath(),this.getParentPath())){const n=e.path.length-1;if(e.offset<=this.path[n]){if(e.offset+t>this.path[n])return null;i.path[n]-=t}}return i}_getTransformedByInsertion(e,t){const i=ga._createAt(this);if(this.root!=e.root)return i;if("same"==te(e.getParentPath(),this.getParentPath()))(e.offset<this.offset||e.offset==this.offset&&"toPrevious"!=this.stickiness)&&(i.offset+=t);else if("prefix"==te(e.getParentPath(),this.getParentPath())){const n=e.path.length-1;e.offset<=this.path[n]&&(i.path[n]+=t)}return i}_getTransformedByMove(e,t,i){if(t=t._getTransformedByDeletion(e,i),e.isEqual(t))return ga._createAt(this);const n=this._getTransformedByDeletion(e,i);return null===n||e.isEqual(this)&&"toNext"==this.stickiness||e.getShiftedBy(i).isEqual(this)&&"toPrevious"==this.stickiness?this._getCombined(e,t):n._getTransformedByInsertion(t,i)}_getCombined(e,t){const i=e.path.length-1,n=ga._createAt(t);return n.stickiness=this.stickiness,n.offset=n.offset+this.path[i]-e.offset,n.path=[...n.path,...this.path.slice(i+1)],n}toJSON(){return{root:this.root.toJSON(),path:Array.from(this.path),stickiness:this.stickiness}}clone(){return new this.constructor(this.root,this.path,this.stickiness)}static _createAt(e,t,i="toNone"){if(e.is("model:position"))return new ga(e.root,e.path,e.stickiness);{const n=e;if("end"==t)t=n.maxOffset;else{if("before"==t)return this._createBefore(n,i);if("after"==t)return this._createAfter(n,i);if(0!==t&&!t)throw new A("model-createpositionat-offset-required",[this,e])}if(!n.is("element")&&!n.is("documentFragment"))throw new A("model-position-parent-incorrect",[this,e]);const o=n.getPath();return o.push(t),new this(n.root,o,i)}}static _createAfter(e,t){if(!e.parent)throw new A("model-position-after-root",[this,e],{root:e});return this._createAt(e.parent,e.endOffset,t)}static _createBefore(e,t){if(!e.parent)throw new A("model-position-before-root",e,{root:e});return this._createAt(e.parent,e.startOffset,t)}static fromJSON(e,t){if("$graveyard"===e.root){const i=new ga(t.graveyard,e.path);return i.stickiness=e.stickiness,i}if(!t.getRoot(e.root))throw new A("model-position-fromjson-no-root",t,{rootName:e.root});return new ga(t.getRoot(e.root),e.path,e.stickiness)}}function fa(e,t){const i=t.getChildAtOffset(e.offset);return i&&i.is("$text")&&i.startOffset<e.offset?i:null}function pa(e,t,i){return null!==i?null:t.getChildAtOffset(e.offset)}function ba(e,t,i){return null!==i?null:t.getChild(t.offsetToIndex(e.offset)-1)}function ka(e,t,i){return i+1!==e.path.length&&(!!wa(t.path,i+1)&&!!function(e,t){let i=e.parent,n=e.path.length-1,o=0;for(;n>=t;){if(e.path[n]+o!==i.maxOffset)return!1;o=1,n--,i=i.parent}return!0}(e,i+1))}function wa(e,t){for(;t<e.length;){if(0!==e[t])return!1;t++}return!0}ga.prototype.is=function(e){return"position"===e||"model:position"===e};class _a extends da{start;end;constructor(e,t){super(),this.start=ga._createAt(e),this.end=t?ga._createAt(t):ga._createAt(e),this.start.stickiness=this.isCollapsed?"toNone":"toNext",this.end.stickiness=this.isCollapsed?"toNone":"toPrevious"}*[Symbol.iterator](){yield*new ha({boundaries:this,ignoreElementEnd:!0})}get isCollapsed(){return this.start.isEqual(this.end)}get isFlat(){return"same"==te(this.start.getParentPath(),this.end.getParentPath())}get root(){return this.start.root}containsPosition(e){return e.isAfter(this.start)&&e.isBefore(this.end)}containsRange(e,t=!1){e.isCollapsed&&(t=!1);const i=this.containsPosition(e.start)||t&&this.start.isEqual(e.start),n=this.containsPosition(e.end)||t&&this.end.isEqual(e.end);return i&&n}containsItem(e){const t=ga._createBefore(e);return this.containsPosition(t)||this.start.isEqual(t)}isEqual(e){return this.start.isEqual(e.start)&&this.end.isEqual(e.end)}isIntersecting(e){return this.start.isBefore(e.end)&&this.end.isAfter(e.start)}getDifference(e){const t=[];return this.isIntersecting(e)?(this.containsPosition(e.start)&&t.push(new _a(this.start,e.start)),this.containsPosition(e.end)&&t.push(new _a(e.end,this.end))):t.push(new _a(this.start,this.end)),t}getIntersection(e){if(this.isIntersecting(e)){let t=this.start,i=this.end;return this.containsPosition(e.start)&&(t=e.start),this.containsPosition(e.end)&&(i=e.end),new _a(t,i)}return null}getJoined(e,t=!1){let i=this.isIntersecting(e);if(i||(i=this.start.isBefore(e.start)?t?this.end.isTouching(e.start):this.end.isEqual(e.start):t?e.end.isTouching(this.start):e.end.isEqual(this.start)),!i)return null;let n=this.start,o=this.end;return e.start.isBefore(n)&&(n=e.start),e.end.isAfter(o)&&(o=e.end),new _a(n,o)}getMinimalFlatRanges(){const e=[],t=this.start.getCommonPath(this.end).length,i=ga._createAt(this.start);let n=i.parent;for(;i.path.length>t+1;){const t=n.maxOffset-i.offset;0!==t&&e.push(new _a(i,i.getShiftedBy(t))),i.path=i.path.slice(0,-1),i.offset++,n=n.parent}for(;i.path.length<=this.end.path.length;){const t=this.end.path[i.path.length-1],n=t-i.offset;0!==n&&e.push(new _a(i,i.getShiftedBy(n))),i.offset=t,i.path.push(0)}return e}getWalker(e={}){return e.boundaries=this,new ha(e)}*getItems(e={}){e.boundaries=this,e.ignoreElementEnd=!0;const t=new ha(e);for(const e of t)yield e.item}*getPositions(e={}){e.boundaries=this;const t=new ha(e);yield t.position;for(const e of t)yield e.nextPosition}getTransformedByOperation(e){switch(e.type){case"insert":return this._getTransformedByInsertOperation(e);case"move":case"remove":case"reinsert":return this._getTransformedByMoveOperation(e);case"split":return[this._getTransformedBySplitOperation(e)];case"merge":return[this._getTransformedByMergeOperation(e)]}return[new _a(this.start,this.end)]}getTransformedByOperations(e){const t=[new _a(this.start,this.end)];for(const i of e)for(let e=0;e<t.length;e++){const n=t[e].getTransformedByOperation(i);t.splice(e,1,...n),e+=n.length-1}for(let e=0;e<t.length;e++){const i=t[e];for(let n=e+1;n<t.length;n++){const e=t[n];(i.containsRange(e)||e.containsRange(i)||i.isEqual(e))&&t.splice(n,1)}}return t}getCommonAncestor(){return this.start.getCommonAncestor(this.end)}getContainedElement(){if(this.isCollapsed)return null;const e=this.start.nodeAfter,t=this.end.nodeBefore;return e&&e.is("element")&&e===t?e:null}toJSON(){return{start:this.start.toJSON(),end:this.end.toJSON()}}clone(){return new this.constructor(this.start,this.end)}_getTransformedByInsertOperation(e,t=!1){return this._getTransformedByInsertion(e.position,e.howMany,t)}_getTransformedByMoveOperation(e,t=!1){const i=e.sourcePosition,n=e.howMany,o=e.targetPosition;return this._getTransformedByMove(i,o,n,t)}_getTransformedBySplitOperation(e){const t=this.start._getTransformedBySplitOperation(e);let i=this.end._getTransformedBySplitOperation(e);return this.end.isEqual(e.insertionPosition)&&(i=this.end.getShiftedBy(1)),t.root!=i.root&&(i=this.end.getShiftedBy(-1)),new _a(t,i)}_getTransformedByMergeOperation(e){if(this.start.isEqual(e.targetPosition)&&this.end.isEqual(e.deletionPosition))return new _a(this.start);let t=this.start._getTransformedByMergeOperation(e),i=this.end._getTransformedByMergeOperation(e);return t.root!=i.root&&(i=this.end.getShiftedBy(-1)),t.isAfter(i)?(e.sourcePosition.isBefore(e.targetPosition)?(t=ga._createAt(i),t.offset=0):(e.deletionPosition.isEqual(t)||(i=e.deletionPosition),t=e.targetPosition),new _a(t,i)):new _a(t,i)}_getTransformedByInsertion(e,t,i=!1){if(i&&this.containsPosition(e))return[new _a(this.start,e),new _a(e.getShiftedBy(t),this.end._getTransformedByInsertion(e,t))];{const i=new _a(this.start,this.end);return i.start=i.start._getTransformedByInsertion(e,t),i.end=i.end._getTransformedByInsertion(e,t),[i]}}_getTransformedByMove(e,t,i,n=!1){if(this.isCollapsed){const n=this.start._getTransformedByMove(e,t,i);return[new _a(n)]}const o=_a._createFromPositionAndShift(e,i),r=t._getTransformedByDeletion(e,i);if(this.containsPosition(t)&&!n&&(o.containsPosition(this.start)||o.containsPosition(this.end))){const n=this.start._getTransformedByMove(e,t,i),o=this.end._getTransformedByMove(e,t,i);return[new _a(n,o)]}let s;const a=this.getDifference(o);let l=null;const c=this.getIntersection(o);if(1==a.length?l=new _a(a[0].start._getTransformedByDeletion(e,i),a[0].end._getTransformedByDeletion(e,i)):2==a.length&&(l=new _a(this.start,this.end._getTransformedByDeletion(e,i))),s=l?l._getTransformedByInsertion(r,i,null!==c||n):[],c){const e=new _a(c.start._getCombined(o.start,r),c.end._getCombined(o.start,r));2==s.length?s.splice(1,0,e):s.push(e)}return s}_getTransformedByDeletion(e,t){let i=this.start._getTransformedByDeletion(e,t),n=this.end._getTransformedByDeletion(e,t);return null==i&&null==n?null:(null==i&&(i=e),null==n&&(n=e),new _a(i,n))}static _createFromPositionAndShift(e,t){const i=e,n=e.getShiftedBy(t);return t>0?new this(i,n):new this(n,i)}static _createIn(e){return new this(ga._createAt(e,0),ga._createAt(e,e.maxOffset))}static _createOn(e){return this._createFromPositionAndShift(ga._createBefore(e),e.offsetSize)}static _createFromRanges(e){if(0===e.length)throw new A("range-create-from-ranges-empty-array",null);if(1==e.length)return e[0].clone();const t=e[0];e.sort((e,t)=>e.start.isAfter(t.start)?1:-1);const i=e.indexOf(t),n=new this(t.start,t.end);for(let t=i-1;t>=0&&e[t].end.isEqual(n.start);t--)n.start=ga._createAt(e[t].start);for(let t=i+1;t<e.length&&e[t].start.isEqual(n.end);t++)n.end=ga._createAt(e[t].end);return n}static fromJSON(e,t){return new this(ga.fromJSON(e.start,t),ga.fromJSON(e.end,t))}}_a.prototype.is=function(e){return"range"===e||"model:range"===e};class va extends(O()){_modelToViewMapping=new WeakMap;_viewToModelMapping=new WeakMap;_viewToModelLengthCallbacks=new Map;_markerNameToElements=new Map;_elementToMarkerNames=new Map;_deferredBindingRemovals=new Map;_unboundMarkerNames=new Set;_cache=new ya;constructor(){super(),this.on("modelToViewPosition",(e,t)=>{if(t.viewPosition)return;const i=this._modelToViewMapping.get(t.modelPosition.parent);if(!i)throw new A("mapping-model-position-view-parent-not-found",this,{modelPosition:t.modelPosition});t.viewPosition=this.findPositionIn(i,t.modelPosition.offset)},{priority:"low"}),this.on("viewToModelPosition",(e,t)=>{if(t.modelPosition)return;const i=this.findMappedViewAncestor(t.viewPosition),n=this._viewToModelMapping.get(i),o=this._toModelOffset(t.viewPosition.parent,t.viewPosition.offset,i);t.modelPosition=ga._createAt(n,o)},{priority:"low"})}bindElements(e,t){this._modelToViewMapping.set(e,t),this._viewToModelMapping.set(t,e)}unbindViewElement(e,t={}){const i=this.toModelElement(e);if(this._elementToMarkerNames.has(e))for(const t of this._elementToMarkerNames.get(e))this._unboundMarkerNames.add(t);if(t.defer)this._deferredBindingRemovals.set(e,e.root);else{this._viewToModelMapping.delete(e)&&this._cache.stopTracking(e),this._modelToViewMapping.get(i)==e&&this._modelToViewMapping.delete(i)}}unbindModelElement(e){const t=this.toViewElement(e);if(this._modelToViewMapping.delete(e),this._viewToModelMapping.get(t)==e){this._viewToModelMapping.delete(t)&&this._cache.stopTracking(t)}}bindElementToMarker(e,t){const i=this._markerNameToElements.get(t)||new Set;i.add(e);const n=this._elementToMarkerNames.get(e)||new Set;n.add(t),this._markerNameToElements.set(t,i),this._elementToMarkerNames.set(e,n)}unbindElementFromMarkerName(e,t){const i=this._markerNameToElements.get(t);i&&(i.delete(e),0==i.size&&this._markerNameToElements.delete(t));const n=this._elementToMarkerNames.get(e);n&&(n.delete(t),0==n.size&&this._elementToMarkerNames.delete(e))}flushUnboundMarkerNames(){const e=Array.from(this._unboundMarkerNames);return this._unboundMarkerNames.clear(),e}flushDeferredBindings(){for(const[e,t]of this._deferredBindingRemovals)e.root==t&&this.unbindViewElement(e);this._deferredBindingRemovals=new Map}clearBindings(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._markerNameToElements=new Map,this._elementToMarkerNames=new Map,this._unboundMarkerNames=new Set,this._deferredBindingRemovals=new Map}toModelElement(e){return this._viewToModelMapping.get(e)}toViewElement(e){return this._modelToViewMapping.get(e)}toModelRange(e){return new _a(this.toModelPosition(e.start),this.toModelPosition(e.end))}toViewRange(e){return new Cr(this.toViewPosition(e.start),this.toViewPosition(e.end))}toModelPosition(e){const t={viewPosition:e,mapper:this};return this.fire("viewToModelPosition",t),t.modelPosition}toViewPosition(e,t={}){const i={modelPosition:e,mapper:this,isPhantom:t.isPhantom};return this.fire("modelToViewPosition",i),i.viewPosition}markerNameToElements(e){const t=this._markerNameToElements.get(e);if(!t)return null;const i=new Set;for(const e of t)if(e.is("attributeElement"))for(const t of e.getElementsWithSameId())i.add(t);else i.add(e);return i}registerViewToModelLength(e,t){this._viewToModelLengthCallbacks.set(e,t)}findMappedViewAncestor(e){let t=e.parent;for(;!this._viewToModelMapping.has(t);)t=t.parent;return t}_toModelOffset(e,t,i){if(i!=e){return this._toModelOffset(e.parent,e.index,i)+this._toModelOffset(e,t,e)}if(e.is("$text"))return t;let n=0;for(let i=0;i<t;i++)n+=this.getModelLength(e.getChild(i));return n}getModelLength(e){const t=[e];let i=0;for(;t.length>0;){const e=t.pop(),n=e.name&&this._viewToModelLengthCallbacks.size>0&&this._viewToModelLengthCallbacks.get(e.name);if(n)i+=n(e);else if(this._viewToModelMapping.has(e))i+=1;else if(e.is("$text"))i+=e.data.length;else{if(e.is("uiElement"))continue;for(const i of e.getChildren())t.push(i)}}return i}findPositionIn(e,t){if(0===t)return this._moveViewPositionToTextNode(new xr(e,0));if(0==this._viewToModelLengthCallbacks.size&&this._viewToModelMapping.has(e)){const i=this._cache.getClosest(e,t);return this._findPositionStartingFrom(i.viewPosition,i.modelOffset,t,e,!0)}return this._findPositionStartingFrom(new xr(e,0),0,t,e,!1)}_findPositionStartingFrom(e,t,i,n,o){let r,s=e.parent,a=e.offset;if(s.is("$text"))return new xr(s,i-t);let l=t,c=0;for(;l<i;)if(r=s.getChild(a),r)c=o?this._getModelLengthAndCache(r,n,l):this.getModelLength(r),l+=c,a++;else{if(s==n)throw new A("mapping-model-offset-not-found",this,{modelOffset:i,viewContainer:n});a=s.parent.getChildIndex(s)+1,s=s.parent,o&&this._cache.save(s,a,n,l)}let d=new xr(s,a);if(o)for(;d.isAtEnd&&d.parent!==n&&d.parent.parent;){const e=d.parent.parent,t=e.getChildIndex(d.parent)+1;this._cache.save(e,t,n,l),d=new xr(e,t)}return l==i?this._moveViewPositionToTextNode(d):this._findPositionStartingFrom(new xr(r,0),l-c,i,n,o)}_getModelLengthAndCache(e,t,i){let n=0;if(this._viewToModelMapping.has(e))n=1;else if(e.is("$text"))n=e.data.length;else if(!e.is("uiElement"))for(const o of e.getChildren())n+=this._getModelLengthAndCache(o,t,i+n);return this._cache.save(e.parent,e.index+1,t,i+n),n}_moveViewPositionToTextNode(e){const t=e.nodeBefore,i=e.nodeAfter;return t&&t.is("view:$text")?new xr(t,t.data.length):i&&i.is("view:$text")?new xr(i,0):e}}class ya extends(O()){_cachedMapping=new WeakMap;_nodeToCacheListIndex=new WeakMap;_invalidateOnChildrenChangeCallback=(e,t,i)=>{this._clearCacheInsideParent(t,i.index)};_invalidateOnTextChangeCallback=(e,t)=>{this._clearCacheAfter(t)};save(e,t,i,n){const o=this._cachedMapping.get(i),r=o.cacheMap.get(n);if(r){const i=e.getChild(t-1),n=r.viewPosition.nodeBefore?this._nodeToCacheListIndex.get(r.viewPosition.nodeBefore):0;return void this._nodeToCacheListIndex.set(i,n)}const s={viewPosition:new xr(e,t),modelOffset:n};o.maxModelOffset=n>o.maxModelOffset?n:o.maxModelOffset,o.cacheMap.set(n,s);let a=o.cacheList.length-1;for(;a>=0&&o.cacheList[a].modelOffset>n;)a--;if(o.cacheList.splice(a+1,0,s),t>0){const i=e.getChild(t-1);this._nodeToCacheListIndex.set(i,a+1)}}getClosest(e,t){const i=this._cachedMapping.get(e);let n;if(i)if(t>i.maxModelOffset)n=i.cacheList[i.cacheList.length-1];else{const e=i.cacheMap.get(t);n=e||this._findInCacheList(i.cacheList,t)}else n=this.startTracking(e);return{modelOffset:n.modelOffset,viewPosition:n.viewPosition.clone()}}startTracking(e){const t={viewPosition:new xr(e,0),modelOffset:0},i={maxModelOffset:0,cacheList:[t],cacheMap:new Map([[0,t]])};return this._cachedMapping.set(e,i),e.on("change:children",this._invalidateOnChildrenChangeCallback),e.on("change:text",this._invalidateOnTextChangeCallback),t}stopTracking(e){e.off("change:children",this._invalidateOnChildrenChangeCallback),e.off("change:text",this._invalidateOnTextChangeCallback),this._cachedMapping.delete(e)}_clearCacheInsideParent(e,t){if(0==t)this._cachedMapping.has(e)?this._clearCacheAll(e):this._clearCacheInsideParent(e.parent,e.index);else{const i=e.getChild(t-1);this._clearCacheAfter(i)}}_clearCacheAll(e){const t=this._cachedMapping.get(e);t.maxModelOffset>0&&(t.maxModelOffset=0,t.cacheList.length=1,t.cacheMap.clear(),t.cacheMap.set(0,t.cacheList[0]))}_clearCacheAfter(e){const t=this._nodeToCacheListIndex.get(e);if(void 0===t){const t=e.parent;return void(this._cachedMapping.has(t)||this._clearCacheInsideParent(t.parent,t.index))}let i=e.parent;for(;!this._cachedMapping.has(i);)i=i.parent;this._clearCacheFromCacheIndex(i,t)}_clearCacheFromCacheIndex(e,t){0===t&&(t=1);const i=this._cachedMapping.get(e),n=i.cacheList[t-1];if(!n)return;i.maxModelOffset=n.modelOffset;const o=i.cacheList.splice(t);for(const e of o){i.cacheMap.delete(e.modelOffset);const t=e.viewPosition.nodeBefore;this._nodeToCacheListIndex.delete(t)}}_findInCacheList(e,t){let i=0,n=e.length-1,o=n-i>>1,r=e[o];for(;i<n;)r.modelOffset<t?i=o+1:n=o-1,o=i+(n-i>>1),r=e[o];return r.modelOffset<=t?r:e[o-1]}}class Aa{_consumable=new Map;_textProxyRegistry=new Map;add(e,t){t=xa(t),e instanceof ua&&(e=this._getSymbolForTextProxy(e)),this._consumable.has(e)||this._consumable.set(e,new Map),this._consumable.get(e).set(t,!0)}consume(e,t){return t=xa(t),e instanceof ua&&(e=this._getSymbolForTextProxy(e)),!!this.test(e,t)&&(this._consumable.get(e).set(t,!1),!0)}test(e,t){t=xa(t),e instanceof ua&&(e=this._getSymbolForTextProxy(e));const i=this._consumable.get(e);if(void 0===i)return null;const n=i.get(t);return void 0===n?null:n}revert(e,t){t=xa(t),e instanceof ua&&(e=this._getSymbolForTextProxy(e));const i=this.test(e,t);return!1===i?(this._consumable.get(e).set(t,!0),!0):!0!==i&&null}verifyAllConsumed(e){const t=[];for(const[i,n]of this._consumable)for(const[o,r]of n){const n=o.split(":")[0];r&&e==n&&t.push({event:o,item:i.name||i.description})}if(t.length)throw new A("conversion-model-consumable-not-consumed",null,{items:t})}_getSymbolForTextProxy(e){let t=null;const i=this._textProxyRegistry.get(e.startOffset);if(i){const n=i.get(e.endOffset);n&&(t=n.get(e.parent))}return t||(t=this._addSymbolForTextProxy(e)),t}_addSymbolForTextProxy(e){const t=e.startOffset,i=e.endOffset,n=e.parent,o=Symbol("$textProxy:"+e.data);let r,s;return r=this._textProxyRegistry.get(t),r||(r=new Map,this._textProxyRegistry.set(t,r)),s=r.get(i),s||(s=new Map,r.set(i,s)),s.set(n,o),o}}function xa(e){const t=e.split(":");return"insert"==t[0]?t[0]:"addMarker"==t[0]||"removeMarker"==t[0]?e:t.length>1?t[0]+":"+t[1]:t[0]}class Ca extends(O()){_conversionApi;_firedEventsMap;constructor(e){super(),this._conversionApi={dispatcher:this,...e},this._firedEventsMap=new WeakMap}convertChanges(e,t,i){const n=e.getRefreshedItems(),o=this._createConversionApi(i,n);for(const t of e.getMarkersToRemove())this._convertMarkerRemove(t.name,t.range,o);const r=this._reduceChanges(e.getChanges(),n);for(const e of r)"insert"===e.type?this._convertInsert(_a._createFromPositionAndShift(e.position,e.length),o):"reinsert"===e.type?this._convertReinsert(_a._createFromPositionAndShift(e.position,e.length),o):"remove"===e.type?this._convertRemove(e.position,e.length,e.name,o):this._convertAttribute(e.range,e.attributeKey,e.attributeOldValue,e.attributeNewValue,o);o.mapper.flushDeferredBindings();for(const e of o.mapper.flushUnboundMarkerNames()){const i=t.get(e).getRange();this._convertMarkerRemove(e,i,o),this._convertMarkerAdd(e,i,o)}for(const t of e.getMarkersToAdd())this._convertMarkerAdd(t.name,t.range,o);o.consumable.verifyAllConsumed("insert")}convert(e,t,i,n={}){const o=this._createConversionApi(i,void 0,n);this._convertInsert(e,o);for(const[e,i]of t)this._convertMarkerAdd(e,i,o);o.consumable.verifyAllConsumed("insert")}convertSelection(e,t,i){const n=this._createConversionApi(i);this.fire("cleanSelection",{selection:e},n);const o=e.getFirstPosition().root;if(!n.mapper.toViewElement(o))return;const r=Array.from(t.getMarkersAtPosition(e.getFirstPosition()));if(this._addConsumablesForSelection(n.consumable,e,r),this.fire("selection",{selection:e},n),e.isCollapsed){for(const t of r)if(n.consumable.test(e,"addMarker:"+t.name)){const i=t.getRange();if(!Ta(e.getFirstPosition(),t,n.mapper))continue;const o={item:e,markerName:t.name,markerRange:i};this.fire(`addMarker:${t.name}`,o,n)}for(const t of e.getAttributeKeys())if(n.consumable.test(e,"attribute:"+t)){const i={item:e,range:e.getFirstRange(),attributeKey:t,attributeOldValue:null,attributeNewValue:e.getAttribute(t)};this.fire(`attribute:${t}:$text`,i,n)}}}_convertInsert(e,t,i={}){i.doNotAddConsumables||this._addConsumablesForInsert(t.consumable,e);for(const i of e.getWalker({shallow:!0}))this._testAndFire("insert",Ea(i),t)}_convertRemove(e,t,i,n){this.fire(`remove:${i}`,{position:e,length:t},n)}_convertAttribute(e,t,i,n,o){this._addConsumablesForRange(o.consumable,e,`attribute:${t}`);for(const r of e){const e={item:r.item,range:_a._createFromPositionAndShift(r.previousPosition,r.length),attributeKey:t,attributeOldValue:i,attributeNewValue:n};this._testAndFire(`attribute:${t}`,e,o)}}_convertReinsert(e,t){const i=Array.from(e.getWalker({shallow:!0}));this._addConsumablesForInsert(t.consumable,i);for(const e of i.map(Ea))this.fire(`remove:${e.item.is("element")?e.item.name:"$text"}`,{position:e.range.start,length:e.item.offsetSize,reconversion:!0},t),this._testAndFire("insert",{...e,reconversion:!0},t)}_convertMarkerAdd(e,t,i){if("$graveyard"==t.root.rootName)return;const n=`addMarker:${e}`;if(i.consumable.add(t,n),this.fire(n,{markerName:e,markerRange:t},i),i.consumable.consume(t,n)){this._addConsumablesForRange(i.consumable,t,n);for(const o of t.getItems()){if(!i.consumable.test(o,n))continue;const r={item:o,range:_a._createOn(o),markerName:e,markerRange:t};this.fire(n,r,i)}}}_convertMarkerRemove(e,t,i){"$graveyard"!=t.root.rootName&&this.fire(`removeMarker:${e}`,{markerName:e,markerRange:t},i)}_reduceChanges(e,t){const i={changes:e,refreshedItems:t};return this.fire("reduceChanges",i),i.changes}_addConsumablesForInsert(e,t){for(const i of t){const t=i.item;if(null===e.test(t,"insert")){e.add(t,"insert");for(const i of t.getAttributeKeys())e.add(t,"attribute:"+i)}}return e}_addConsumablesForRange(e,t,i){for(const n of t.getItems())e.add(n,i);return e}_addConsumablesForSelection(e,t,i){e.add(t,"selection");for(const n of i)e.add(t,"addMarker:"+n.name);for(const i of t.getAttributeKeys())e.add(t,"attribute:"+i);return e}_testAndFire(e,t,i){const n=function(e,t){const i=t.item.is("element")?t.item.name:"$text";return`${e}:${i}`}(e,t),o=t.item.is("$textProxy")?i.consumable._getSymbolForTextProxy(t.item):t.item,r=this._firedEventsMap.get(i),s=r.get(o);if(s){if(s.has(n))return;s.add(n)}else r.set(o,new Set([n]));this.fire(n,t,i)}_testAndFireAddAttributes(e,t){const i={item:e,range:_a._createOn(e)};for(const e of i.item.getAttributeKeys())i.attributeKey=e,i.attributeOldValue=null,i.attributeNewValue=i.item.getAttribute(e),this._testAndFire(`attribute:${e}`,i,t)}_createConversionApi(e,t=new Set,i={}){const n={...this._conversionApi,consumable:new Aa,writer:e,options:i,convertItem:e=>this._convertInsert(_a._createOn(e),n),convertChildren:e=>this._convertInsert(_a._createIn(e),n,{doNotAddConsumables:!0}),convertAttributes:e=>this._testAndFireAddAttributes(e,n),canReuseView:e=>!t.has(n.mapper.toModelElement(e))};return this._firedEventsMap.set(n,new Map),n}}function Ta(e,t,i){const n=t.getRange(),o=Array.from(e.getAncestors());o.shift(),o.reverse();return!o.some(e=>{if(n.containsItem(e)){return!!i.toViewElement(e).getCustomProperty("addHighlight")}})}function Ea(e){return{item:e.item,range:_a._createFromPositionAndShift(e.previousPosition,e.length)}}class Ia extends da{parent=null;_attrs;_index=null;_startOffset=null;constructor(e){super(),this._attrs=ii(e)}get document(){return null}get index(){return this._index}get startOffset(){return this._startOffset}get offsetSize(){return 1}get endOffset(){return null===this.startOffset?null:this.startOffset+this.offsetSize}get nextSibling(){const e=this.index;return null!==e&&this.parent.getChild(e+1)||null}get previousSibling(){const e=this.index;return null!==e&&this.parent.getChild(e-1)||null}get root(){let e=this;for(;e.parent;)e=e.parent;return e}isAttached(){return null!==this.parent&&this.root.isAttached()}getPath(){const e=[];let t=this;for(;t.parent;)e.unshift(t.startOffset),t=t.parent;return e}getAncestors(e={}){const t=[];let i=e.includeSelf?this:this.parent;for(;i;)t[e.parentFirst?"push":"unshift"](i),i=i.parent;return t}getCommonAncestor(e,t={}){const i=this.getAncestors(t),n=e.getAncestors(t);let o=0;for(;i[o]==n[o]&&i[o];)o++;return 0===o?null:i[o-1]}isBefore(e){if(this==e)return!1;if(this.root!==e.root)return!1;const t=this.getPath(),i=e.getPath(),n=te(t,i);switch(n){case"prefix":return!0;case"extension":return!1;default:return t[n]<i[n]}}isAfter(e){return this!=e&&(this.root===e.root&&!this.isBefore(e))}hasAttribute(e){return this._attrs.has(e)}getAttribute(e){return this._attrs.get(e)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}toJSON(){const e={};return this._attrs.size&&(e.attributes=Array.from(this._attrs).reduce((e,t)=>(e[t[0]]=t[1],e),{})),e}_clone(e){return new this.constructor(this._attrs)}_remove(){this.parent._removeChildren(this.index)}_setAttribute(e,t){this._attrs.set(e,t)}_setAttributesTo(e){this._attrs=ii(e)}_removeAttribute(e){return this._attrs.delete(e)}_clearAttributes(){this._attrs.clear()}}Ia.prototype.is=function(e){return"node"===e||"model:node"===e};class Sa extends(O(da)){_lastRangeBackward=!1;_attrs=new Map;_ranges=[];constructor(...e){super(),e.length&&this.setTo(...e)}get anchor(){if(this._ranges.length>0){const e=this._ranges[this._ranges.length-1];return this._lastRangeBackward?e.end:e.start}return null}get focus(){if(this._ranges.length>0){const e=this._ranges[this._ranges.length-1];return this._lastRangeBackward?e.start:e.end}return null}get isCollapsed(){return 1===this._ranges.length&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}isEqual(e){if(this.rangeCount!=e.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus))return!1;for(const t of this._ranges){let i=!1;for(const n of e._ranges)if(t.isEqual(n)){i=!0;break}if(!i)return!1}return!0}*getRanges(){for(const e of this._ranges)yield new _a(e.start,e.end)}getFirstRange(){let e=null;for(const t of this._ranges)e&&!t.start.isBefore(e.start)||(e=t);return e?new _a(e.start,e.end):null}getLastRange(){let e=null;for(const t of this._ranges)e&&!t.end.isAfter(e.end)||(e=t);return e?new _a(e.start,e.end):null}getFirstPosition(){const e=this.getFirstRange();return e?e.start.clone():null}getLastPosition(){const e=this.getLastRange();return e?e.end.clone():null}setTo(...e){let[t,i,n]=e;if("object"==typeof i&&(n=i,i=void 0),null===t)this._setRanges([]);else if(t instanceof Sa)this._setRanges(t.getRanges(),t.isBackward);else if(t&&"function"==typeof t.getRanges)this._setRanges(t.getRanges(),t.isBackward);else if(t instanceof _a)this._setRanges([t],!!n&&!!n.backward);else if(t instanceof ga)this._setRanges([new _a(t)]);else if(t instanceof Ia){const e=!!n&&!!n.backward;let o;if("in"==i)o=_a._createIn(t);else if("on"==i)o=_a._createOn(t);else{if(void 0===i)throw new A("model-selection-setto-required-second-parameter",[this,t]);o=new _a(ga._createAt(t,i))}this._setRanges([o],e)}else{if(!ie(t))throw new A("model-selection-setto-not-selectable",[this,t]);this._setRanges(t,n&&!!n.backward)}}_setRanges(e,t=!1){const i=Array.from(e),n=i.some(t=>{if(!(t instanceof _a))throw new A("model-selection-set-ranges-not-range",[this,e]);return this._ranges.every(e=>!e.isEqual(t))});(i.length!==this._ranges.length||n)&&(this._replaceAllRanges(i),this._lastRangeBackward=!!t,this.fire("change:range",{directChange:!0}))}setFocus(e,t){if(null===this.anchor)throw new A("model-selection-setfocus-no-ranges",[this,e]);const i=ga._createAt(e,t);if("same"==i.compareWith(this.focus))return;const n=this.anchor;this._ranges.length&&this._popRange(),"before"==i.compareWith(n)?(this._pushRange(new _a(i,n)),this._lastRangeBackward=!0):(this._pushRange(new _a(n,i)),this._lastRangeBackward=!1),this.fire("change:range",{directChange:!0})}getAttribute(e){return this._attrs.get(e)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}hasAttribute(e){return this._attrs.has(e)}removeAttribute(e){this.hasAttribute(e)&&(this._attrs.delete(e),this.fire("change:attribute",{attributeKeys:[e],directChange:!0}))}setAttribute(e,t){this.getAttribute(e)!==t&&(this._attrs.set(e,t),this.fire("change:attribute",{attributeKeys:[e],directChange:!0}))}getSelectedElement(){return 1!==this.rangeCount?null:this.getFirstRange().getContainedElement()}*getSelectedBlocks(){const e=new WeakSet;for(const t of this.getRanges()){const i=Oa(t.start,e);Na(i,t)&&(yield i);const n=t.getWalker();for(const i of n){const o=i.item;"elementEnd"==i.type&&Ma(o,e,t)?yield o:"elementStart"==i.type&&o.is("model:element")&&o.root.document.model.schema.isBlock(o)&&n.jumpTo(ga._createAt(o,"end"))}const o=Oa(t.end,e);Va(o,t)&&(yield o)}}containsEntireContent(e=this.anchor.root){const t=ga._createAt(e,0),i=ga._createAt(e,"end");return t.isTouching(this.getFirstPosition())&&i.isTouching(this.getLastPosition())}toJSON(){const e={ranges:Array.from(this.getRanges()).map(e=>e.toJSON())},t=Object.fromEntries(this.getAttributes());return Object.keys(t).length&&(e.attributes=t),this.isBackward&&(e.isBackward=!0),e}_pushRange(e){this._checkRange(e),this._ranges.push(new _a(e.start,e.end))}_checkRange(e){for(let t=0;t<this._ranges.length;t++)if(e.isIntersecting(this._ranges[t]))throw new A("model-selection-range-intersects",[this,e],{addedRange:e,intersectingRange:this._ranges[t]})}_replaceAllRanges(e){this._removeAllRanges();for(const t of e)this._pushRange(t)}_removeAllRanges(){for(;this._ranges.length>0;)this._popRange()}_popRange(){this._ranges.pop()}}function Pa(e,t){return!t.has(e)&&(t.add(e),e.root.document.model.schema.isBlock(e)&&!!e.parent)}function Ma(e,t,i){return Pa(e,t)&&Ra(e,i)}function Oa(e,t){const i=e.parent.root.document.model.schema,n=e.parent.getAncestors({parentFirst:!0,includeSelf:!0});let o=!1;const r=n.find(e=>!o&&(o=i.isLimit(e),!o&&Pa(e,t)));return n.forEach(e=>t.add(e)),r}function Ra(e,t){const i=function(e){const t=e.root.document.model.schema;let i=e.parent;for(;i;){if(t.isBlock(i))return i;i=i.parent}}(e);if(!i)return!0;return!t.containsRange(_a._createOn(i),!0)}function Na(e,t){return!!e&&(!(!t.isCollapsed&&!e.isEmpty)||!t.start.isTouching(ga._createAt(e,e.maxOffset))&&Ra(e,t))}function Va(e,t){return!!e&&(!(!t.isCollapsed&&!e.isEmpty)||!t.end.isTouching(ga._createAt(e,0))&&Ra(e,t))}Sa.prototype.is=function(e){return"selection"===e||"model:selection"===e};class La extends(O(_a)){constructor(e,t){super(e,t),Da.call(this)}detach(){this.stopListening()}toRange(){return new _a(this.start,this.end)}static fromRange(e){return new La(e.start,e.end)}}function Da(){this.listenTo(this.root.document.model,"applyOperation",(e,t)=>{const i=t[0];i.isDocumentOperation&&Ba.call(this,i)},{priority:"low"})}function Ba(e){const t=this.getTransformedByOperation(e),i=_a._createFromRanges(t),n=!i.isEqual(this),o=function(e,t){switch(t.type){case"insert":return e.containsPosition(t.position);case"move":case"remove":case"reinsert":case"merge":return e.containsPosition(t.sourcePosition)||e.start.isEqual(t.sourcePosition)||e.containsPosition(t.targetPosition);case"split":return e.containsPosition(t.splitPosition)||e.containsPosition(t.insertionPosition)}return!1}(this,e);let r=null;if(n){"$graveyard"==i.root.rootName&&(r="remove"==e.type?e.sourcePosition:e.deletionPosition);const t=this.toRange();this.start=i.start,this.end=i.end,this.fire("change:range",t,{deletionPosition:r})}else o&&this.fire("change:content",this.toRange(),{deletionPosition:r})}La.prototype.is=function(e){return"liveRange"===e||"model:liveRange"===e||"range"==e||"model:range"===e};class za extends Ia{_data;constructor(e,t){super(t),this._data=e||""}get offsetSize(){return this.data.length}get data(){return this._data}toJSON(){const e=super.toJSON();return e.data=this.data,e}_clone(){return new za(this.data,this.getAttributes())}static fromJSON(e){return new za(e.data,e.attributes)}}za.prototype.is=function(e){return"$text"===e||"model:$text"===e||"text"===e||"model:text"===e||"node"===e||"model:node"===e};const Fa="selection:";class ja extends(O(da)){_selection;constructor(e){super(),this._selection=new Ua(e),this._selection.delegate("change:range").to(this),this._selection.delegate("change:attribute").to(this),this._selection.delegate("change:marker").to(this)}get isCollapsed(){return this._selection.isCollapsed}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get rangeCount(){return this._selection.rangeCount}get hasOwnRange(){return this._selection.hasOwnRange}get isBackward(){return this._selection.isBackward}get isGravityOverridden(){return this._selection.isGravityOverridden}get markers(){return this._selection.markers}get _ranges(){return this._selection._ranges}getRanges(){return this._selection.getRanges()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getSelectedBlocks(){return this._selection.getSelectedBlocks()}getSelectedElement(){return this._selection.getSelectedElement()}containsEntireContent(e){return this._selection.containsEntireContent(e)}destroy(){this._selection.destroy()}getAttributeKeys(){return this._selection.getAttributeKeys()}getAttributes(){return this._selection.getAttributes()}getAttribute(e){return this._selection.getAttribute(e)}hasAttribute(e){return this._selection.hasAttribute(e)}refresh(){this._selection.updateMarkers(),this._selection._updateAttributes(!1)}observeMarkers(e){this._selection.observeMarkers(e)}toJSON(){return this._selection.toJSON()}_setFocus(e,t){this._selection.setFocus(e,t)}_setTo(...e){this._selection.setTo(...e)}_setAttribute(e,t){this._selection.setAttribute(e,t)}_removeAttribute(e){this._selection.removeAttribute(e)}_getStoredAttributes(){return this._selection.getStoredAttributes()}_overrideGravity(){return this._selection.overrideGravity()}_restoreGravity(e){this._selection.restoreGravity(e)}static _getStoreAttributeKey(e){return Fa+e}static _isStoreAttributeKey(e){return e.startsWith(Fa)}}ja.prototype.is=function(e){return"selection"===e||"model:selection"==e||"documentSelection"==e||"model:documentSelection"==e};class Ua extends Sa{markers=new Yt({idProperty:"name"});_model;_document;_attributePriority=new Map;_selectionRestorePosition=null;_hasChangedRange=!1;_overriddenGravityRegister=new Set;_observedMarkers=new Set;constructor(e){super(),this._model=e.model,this._document=e,this.listenTo(this._model,"applyOperation",(e,t)=>{const i=t[0];i.isDocumentOperation&&"marker"!=i.type&&"rename"!=i.type&&"noop"!=i.type&&(0==this._ranges.length&&this._selectionRestorePosition&&this._fixGraveyardSelection(this._selectionRestorePosition),this._selectionRestorePosition=null,this._hasChangedRange&&(this._hasChangedRange=!1,this.fire("change:range",{directChange:!1})))},{priority:"lowest"}),this.on("change:range",()=>{this._validateSelectionRanges(this.getRanges())}),this.listenTo(this._model.markers,"update",(e,t,i,n)=>{this._updateMarker(t,n)}),this.listenTo(this._document,"change",(e,t)=>{!function(e,t){const i=e.document.differ;for(const n of i.getChanges()){if("insert"!=n.type)continue;const i=n.position.parent;n.length===i.maxOffset&&e.enqueueChange(t,e=>{const t=Array.from(i.getAttributeKeys()).filter(e=>e.startsWith(Fa));for(const n of t)e.removeAttribute(n,i)})}}(this._model,t)})}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 e=0;e<this._ranges.length;e++)this._ranges[e].detach();this.stopListening()}*getRanges(){this._ranges.length?yield*super.getRanges():yield this._document._getDefaultRange()}getFirstRange(){return super.getFirstRange()||this._document._getDefaultRange()}getLastRange(){return super.getLastRange()||this._document._getDefaultRange()}setTo(...e){super.setTo(...e),this._updateAttributes(!0),this.updateMarkers()}setFocus(e,t){super.setFocus(e,t),this._updateAttributes(!0),this.updateMarkers()}setAttribute(e,t){if(this._setAttribute(e,t)){const t=[e];this.fire("change:attribute",{attributeKeys:t,directChange:!0})}}removeAttribute(e){if(this._removeAttribute(e)){const t=[e];this.fire("change:attribute",{attributeKeys:t,directChange:!0})}}overrideGravity(){const e=_();return this._overriddenGravityRegister.add(e),1===this._overriddenGravityRegister.size&&this._updateAttributes(!0),e}restoreGravity(e){if(!this._overriddenGravityRegister.has(e))throw new A("document-selection-gravity-wrong-restore",this,{uid:e});this._overriddenGravityRegister.delete(e),this.isGravityOverridden||this._updateAttributes(!0)}observeMarkers(e){this._observedMarkers.add(e),this.updateMarkers()}_replaceAllRanges(e){this._validateSelectionRanges(e),super._replaceAllRanges(e)}_popRange(){this._ranges.pop().detach()}_pushRange(e){const t=this._prepareRange(e);t&&this._ranges.push(t)}toJSON(){const e=super.toJSON();return this.markers.length&&(e.markers=this.markers.map(e=>e.toJSON())),e}_validateSelectionRanges(e){for(const t of e)if(!this._document._validateSelectionRange(t))throw new A("document-selection-wrong-position",this,{range:t})}_prepareRange(e){if(this._checkRange(e),e.root==this._document.graveyard)return;const t=La.fromRange(e);return t.on("change:range",(e,i,n)=>{if(this._hasChangedRange=!0,t.root==this._document.graveyard){this._selectionRestorePosition=n.deletionPosition;const e=this._ranges.indexOf(t);this._ranges.splice(e,1),t.detach()}}),t}updateMarkers(){if(!this._observedMarkers.size)return;const e=[];let t=!1;for(const t of this._model.markers){const i=t.name.split(":",1)[0];if(!this._observedMarkers.has(i))continue;const n=t.getRange();for(const i of this.getRanges())n.containsRange(i,!i.isCollapsed)&&e.push(t)}const i=Array.from(this.markers);for(const i of e)this.markers.has(i)||(this.markers.add(i),t=!0);for(const i of Array.from(this.markers))e.includes(i)||(this.markers.remove(i),t=!0);t&&this.fire("change:marker",{oldMarkers:i,directChange:!1})}_updateMarker(e,t){const i=e.name.split(":",1)[0];if(!this._observedMarkers.has(i))return;let n=!1;const o=Array.from(this.markers),r=this.markers.has(e);if(t){let i=!1;for(const e of this.getRanges())if(t.containsRange(e,!e.isCollapsed)){i=!0;break}i&&!r?(this.markers.add(e),n=!0):!i&&r&&(this.markers.remove(e),n=!0)}else r&&(this.markers.remove(e),n=!0);n&&this.fire("change:marker",{oldMarkers:o,directChange:!1})}_updateAttributes(e){const t=ii(this._getSurroundingAttributes()),i=ii(this.getAttributes());if(e)this._attributePriority=new Map,this._attrs=new Map;else for(const[e,t]of this._attributePriority)"low"==t&&(this._attrs.delete(e),this._attributePriority.delete(e));this._setAttributesTo(t);const n=[];for(const[e,t]of this.getAttributes())i.has(e)&&i.get(e)===t||n.push(e);for(const[e]of i)this.hasAttribute(e)||n.push(e);n.length>0&&this.fire("change:attribute",{attributeKeys:n,directChange:!1})}_setAttribute(e,t,i=!0){const n=i?"normal":"low";if("low"==n&&"normal"==this._attributePriority.get(e))return!1;return super.getAttribute(e)!==t&&(this._attrs.set(e,t),this._attributePriority.set(e,n),!0)}_removeAttribute(e,t=!0){const i=t?"normal":"low";return("low"!=i||"normal"!=this._attributePriority.get(e))&&(this._attributePriority.set(e,i),!!super.hasAttribute(e)&&(this._attrs.delete(e),!0))}_setAttributesTo(e){const t=new Set;for(const[t,i]of this.getAttributes())e.get(t)!==i&&this._removeAttribute(t,!1);for(const[i,n]of e){this._setAttribute(i,n,!1)&&t.add(i)}return t}*getStoredAttributes(){const e=this.getFirstPosition().parent;if(this.isCollapsed&&e.isEmpty)for(const t of e.getAttributeKeys())if(t.startsWith(Fa)){const i=t.substr(10);yield[i,e.getAttribute(t)]}}_getSurroundingAttributes(){const e=this.getFirstPosition(),t=this._model.schema;if("$graveyard"==e.root.rootName)return null;let i=null;if(this.isCollapsed){const n=e.textNode?e.textNode:e.nodeBefore,o=e.textNode?e.textNode:e.nodeAfter;if(this.isGravityOverridden||(i=Ha(n,t)),i||(i=Ha(o,t)),!this.isGravityOverridden&&!i){let e=n;for(;e&&!i;)e=e.previousSibling,i=Ha(e,t)}if(!i){let e=o;for(;e&&!i;)e=e.nextSibling,i=Ha(e,t)}i||(i=this.getStoredAttributes())}else{const e=this.getFirstRange();for(const n of e){if(n.item.is("element")&&t.isObject(n.item)){i=Ha(n.item,t);break}if("text"==n.type){i=n.item.getAttributes();break}}}return i}_fixGraveyardSelection(e){const t=this._model.schema.getNearestSelectionRange(e);t&&this._pushRange(t)}}function Ha(e,t){if(!e)return null;if(e instanceof ua||e instanceof za)return e.getAttributes();if(!t.isInline(e))return null;if(!t.isObject(e))return[];const i=[];for(const[n,o]of e.getAttributes())t.checkAttribute("$text",n)&&!1!==t.getAttributeProperties(n).copyFromObject&&i.push([n,o]);return i}class Wa{_nodes=[];_offsetToNode=[];constructor(e){e&&this._insertNodes(0,e)}[Symbol.iterator](){return this._nodes[Symbol.iterator]()}get length(){return this._nodes.length}get maxOffset(){return this._offsetToNode.length}getNode(e){return this._nodes[e]||null}getNodeAtOffset(e){return this._offsetToNode[e]||null}getNodeIndex(e){return e.index}getNodeStartOffset(e){return e.startOffset}indexToOffset(e){if(e==this._nodes.length)return this.maxOffset;const t=this._nodes[e];if(!t)throw new A("model-nodelist-index-out-of-bounds",this);return this.getNodeStartOffset(t)}offsetToIndex(e){if(e==this._offsetToNode.length)return this._nodes.length;const t=this._offsetToNode[e];if(!t)throw new A("model-nodelist-offset-out-of-bounds",this,{offset:e,nodeList:this});return this.getNodeIndex(t)}_insertNodes(e,t){const i=[];for(const e of t){if(!(e instanceof Ia))throw new A("model-nodelist-insertnodes-not-node",this);i.push(e)}let n=this.indexToOffset(e);ni(this._nodes,i,e),ni(this._offsetToNode,function(e){const t=[];let i=0;for(const n of e)for(let e=0;e<n.offsetSize;e++)t[i++]=n;return t}(i),n);for(let t=e;t<this._nodes.length;t++)this._nodes[t]._index=t,this._nodes[t]._startOffset=n,n+=this._nodes[t].offsetSize}_removeNodes(e,t=1){if(0==t)return[];let i=this.indexToOffset(e);const n=this._nodes.splice(e,t),o=n[n.length-1],r=o.startOffset+o.offsetSize-i;this._offsetToNode.splice(i,r);for(const e of n)e._index=null,e._startOffset=null;for(let t=e;t<this._nodes.length;t++)this._nodes[t]._index=t,this._nodes[t]._startOffset=i,i+=this._nodes[t].offsetSize;return n}_removeNodesArray(e){if(0==e.length)return;for(const t of e)t._index=null,t._startOffset=null;this._nodes=this._nodes.filter(e=>null!==e.index),this._offsetToNode=this._offsetToNode.filter(e=>null!==e.index);let t=0;for(let e=0;e<this._nodes.length;e++)this._nodes[e]._index=e,this._nodes[e]._startOffset=t,t+=this._nodes[e].offsetSize}toJSON(){return this._nodes.map(e=>e.toJSON())}}class $a extends Ia{name;_children=new Wa;constructor(e,t,i){super(t),this.name=e,i&&this._insertChild(0,i)}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}getChild(e){return this._children.getNode(e)}getChildAtOffset(e){return this._children.getNodeAtOffset(e)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(e){return this._children.getNodeIndex(e)}getChildStartOffset(e){return this._children.getNodeStartOffset(e)}offsetToIndex(e){return this._children.offsetToIndex(e)}getNodeByPath(e){let t=this;for(const i of e)t=t.getChildAtOffset(i);return t}findAncestor(e,t={}){let i=t.includeSelf?this:this.parent;for(;i;){if(i.name===e)return i;i=i.parent}return null}toJSON(){const e=super.toJSON();if(e.name=this.name,this._children.length>0){e.children=[];for(const t of this._children)e.children.push(t.toJSON())}return e}_clone(e=!1){const t=e?function(e){const t=[];for(const i of e)t.push(i._clone(!0));return t}(this._children):void 0;return new $a(this.name,this.getAttributes(),t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const i=function(e){if("string"==typeof e)return[new za(e)];ie(e)||(e=[e]);const t=[];for(const i of e)"string"==typeof i?t.push(new za(i)):i instanceof ua?t.push(new za(i.data,i.getAttributes())):t.push(i);return t}(t);for(const e of i)null!==e.parent&&e._remove(),e.parent=this;this._children._insertNodes(e,i)}_removeChildren(e,t=1){const i=this._children._removeNodes(e,t);for(const e of i)e.parent=null;return i}_removeChildrenArray(e){this._children._removeNodesArray(e);for(const t of e)t.parent=null}static fromJSON(e){let t;if(e.children){t=[];for(const i of e.children)i.name?t.push($a.fromJSON(i)):t.push(za.fromJSON(i))}return new $a(e.name,e.attributes,t)}}$a.prototype.is=function(e,t){return t?t===this.name&&("element"===e||"model:element"===e):"element"===e||"model:element"===e||"node"===e||"model:node"===e};class qa{_dispatchers;constructor(e){this._dispatchers=e}add(e){for(const t of this._dispatchers)e(t);return this}}class Ka extends qa{elementToElement(e){return this.add(function(e){const t=tl(e.model),i=il(e.view,"container");t.attributes.length&&(t.children=!0);return n=>{n.on(`insert:${t.name}`,Ja(i,al(t)),{priority:e.converterPriority||"normal"}),(t.children||t.attributes.length)&&n.on("reduceChanges",sl(t),{priority:"low"})}}(e))}elementToStructure(e){return this.add(function(e){const t=tl(e.model),i=il(e.view,"container");return t.children=!0,n=>{if(n._conversionApi.schema.checkChild(t.name,"$text"))throw new A("conversion-element-to-structure-disallowed-text",n,{elementName:t.name});var o,r;n.on(`insert:${t.name}`,(o=i,r=al(t),(e,t,i)=>{if(!r(t.item,i.consumable,{preflight:!0}))return;const n=new Map;i.writer._registerSlotFactory(function(e,t,i){return(n,o)=>{const r=n.createContainerElement("$slot");let s=null;if("children"===o)s=Array.from(e.getChildren());else{if("function"!=typeof o)throw new A("conversion-slot-mode-unknown",i.dispatcher,{modeOrFilter:o});s=Array.from(e.getChildren()).filter(e=>o(e))}return t.set(r,s),r}}(t.item,n,i));const s=o(t.item,i,t);if(i.writer._clearSlotFactory(),!s)return;!function(e,t,i){const n=Array.from(t.values()).flat(),o=new Set(n);if(o.size!=n.length)throw new A("conversion-slot-filter-overlap",i.dispatcher,{element:e});if(o.size!=e.childCount)throw new A("conversion-slot-filter-incomplete",i.dispatcher,{element:e})}(t.item,n,i),r(t.item,i.consumable);const a=t.reconversion&&Xa(t.item,i)||i.mapper.toViewPosition(t.range.start);i.mapper.bindElements(t.item,s),i.writer.insert(a,s),i.convertAttributes(t.item),function(e,t,i,n){i.mapper.on("modelToViewPosition",s,{priority:"highest"});let o=null,r=null;for([o,r]of t)ll(e,r,i,n),i.writer.setCustomProperty("$structureSlotParent",!0,o.parent),i.writer.move(i.writer.createRangeIn(o),i.writer.createPositionBefore(o)),i.writer.remove(o);function s(e,t){const i=t.modelPosition.nodeAfter,n=r.indexOf(i);n<0||(t.viewPosition=t.mapper.findPositionIn(o,n))}i.mapper.off("modelToViewPosition",s)}(s,n,i,{reconversion:t.reconversion})}),{priority:e.converterPriority||"normal"}),n.on("reduceChanges",sl(t),{priority:"low"})}}(e))}attributeToElement(e){return this.add(function(e){e=Bt(e);let t=e.model;"string"==typeof t&&(t={key:t});let i=`attribute:${t.key}`;t.name&&(i+=":"+t.name);if(t.values)for(const i of t.values)e.view[i]=il(e.view[i],"attribute");else e.view=il(e.view,"attribute");const n=nl(e);return t=>{t.on(i,Ya(n),{priority:e.converterPriority||"normal"})}}(e))}attributeToAttribute(e){return this.add(function(e){e=Bt(e);let t=e.model;"string"==typeof t&&(t={key:t});let i=`attribute:${t.key}`;t.name&&(i+=":"+t.name);if(t.values)for(const i of t.values)e.view[i]=ol(e.view[i]);else e.view=ol(e.view);const n=nl(e);return t=>{var o;t.on(i,(o=n,(e,t,i)=>{if(!i.consumable.test(t.item,e.name))return;const n=o(t.attributeOldValue,i,t),r=o(t.attributeNewValue,i,t);if(!n&&!r)return;i.consumable.consume(t.item,e.name);const s=i.mapper.toViewElement(t.item),a=i.writer;if(!s)throw new A("conversion-attribute-to-attribute-on-text",i.dispatcher,t);if(null!==t.attributeOldValue&&n){let e=n.value;"style"==n.key&&(e="string"==typeof n.value?new cr(a.document.stylesProcessor).setTo(n.value).getStylesEntries().map(([e])=>e):Object.keys(n.value)),a.removeAttribute(n.key,e,s)}if(null!==t.attributeNewValue&&r){let e=r.value;"style"==r.key&&"string"==typeof r.value&&(e=Object.fromEntries(new cr(a.document.stylesProcessor).setTo(r.value).getStylesEntries())),a.setAttribute(r.key,e,!1,s)}}),{priority:e.converterPriority||"normal"})}}(e))}markerToElement(e){return this.add(function(e){const t=il(e.view,"ui");return i=>{i.on(`addMarker:${e.model}`,Qa(t),{priority:e.converterPriority||"normal"}),i.on(`removeMarker:${e.model}`,(e,t,i)=>{const n=i.mapper.markerNameToElements(t.markerName);if(n){for(const e of n)i.mapper.unbindElementFromMarkerName(e,t.markerName),i.writer.clear(i.writer.createRangeOn(e),e);i.writer.clearClonedElementsGroup(t.markerName),e.stop()}},{priority:e.converterPriority||"normal"})}}(e))}markerToHighlight(e){return this.add(function(e){return t=>{var i;t.on(`addMarker:${e.model}`,(i=e.view,(e,t,n)=>{if(!t.item)return;if(!(t.item instanceof Sa||t.item instanceof ja||t.item.is("$textProxy")))return;const o=rl(i,t,n);if(!o)return;if(!n.consumable.consume(t.item,e.name))return;const r=n.writer,s=Ga(r,o),a=r.document.selection;if(t.item instanceof Sa||t.item instanceof ja)r.wrap(a.getFirstRange(),s);else{const e=n.mapper.toViewRange(t.range),i=r.wrap(e,s);for(const e of i.getItems())if(e.is("attributeElement")&&e.isSimilar(s)){n.mapper.bindElementToMarker(e,t.markerName);break}}}),{priority:e.converterPriority||"normal"}),t.on(`addMarker:${e.model}`,function(e){return(t,i,n)=>{if(!i.item)return;if(!(i.item instanceof $a))return;const o=rl(e,i,n);if(!o)return;if(!n.consumable.test(i.item,t.name))return;const r=n.mapper.toViewElement(i.item);if(r&&r.getCustomProperty("addHighlight")){n.consumable.consume(i.item,t.name);for(const e of _a._createIn(i.item))n.consumable.consume(e.item,t.name);r.getCustomProperty("addHighlight")(r,o,n.writer),n.mapper.bindElementToMarker(r,i.markerName)}}}(e.view),{priority:e.converterPriority||"normal"}),t.on(`removeMarker:${e.model}`,function(e){return(t,i,n)=>{if(i.markerRange.isCollapsed)return;const o=rl(e,i,n);if(!o)return;const r=Ga(n.writer,o),s=n.mapper.markerNameToElements(i.markerName);if(s){for(const e of s)if(n.mapper.unbindElementFromMarkerName(e,i.markerName),e.is("attributeElement"))n.writer.unwrap(n.writer.createRangeOn(e),r);else{e.getCustomProperty("removeHighlight")(e,o.id,n.writer)}n.writer.clearClonedElementsGroup(i.markerName),t.stop()}}}(e.view),{priority:e.converterPriority||"normal"})}}(e))}markerToData(e){return this.add(function(e){e=Bt(e);const t=e.model;let i=e.view;i||(i=i=>({group:t,name:i.substr(e.model.length+1)}));return n=>{var o;n.on(`addMarker:${t}`,(o=i,(e,t,i)=>{const n=o(t.markerName,i);if(!n)return;const r=t.markerRange;i.consumable.consume(r,e.name)&&(el(r,!1,i,t,n),el(r,!0,i,t,n),e.stop())}),{priority:e.converterPriority||"normal"}),n.on(`removeMarker:${t}`,function(e){return(t,i,n)=>{const o=e(i.markerName,n);if(!o)return;const r=n.mapper.markerNameToElements(i.markerName);if(r){for(const e of r)n.mapper.unbindElementFromMarkerName(e,i.markerName),e.is("containerElement")?(s(`data-${o.group}-start-before`,e),s(`data-${o.group}-start-after`,e),s(`data-${o.group}-end-before`,e),s(`data-${o.group}-end-after`,e)):n.writer.clear(n.writer.createRangeOn(e),e);n.writer.clearClonedElementsGroup(i.markerName),t.stop()}function s(e,t){if(t.hasAttribute(e)){const i=new Set(t.getAttribute(e).split(","));i.delete(o.name),0==i.size?n.writer.removeAttribute(e,t):n.writer.setAttribute(e,Array.from(i).join(","),t)}}}}(i),{priority:e.converterPriority||"normal"})}}(e))}}function Ga(e,t){const i=e.createAttributeElement("span",t.attributes);return t.classes&&i._addClass(t.classes),"number"==typeof t.priority&&(i._priority=t.priority),i._id=t.id,i}function Ya(e){return(t,i,n)=>{if(!n.consumable.test(i.item,t.name))return;const o=e(i.attributeOldValue,n,i),r=e(i.attributeNewValue,n,i);if(!o&&!r)return;n.consumable.consume(i.item,t.name);const s=n.writer,a=s.document.selection;if(i.item instanceof Sa||i.item instanceof ja)s.wrap(a.getFirstRange(),r);else{let e=n.mapper.toViewRange(i.range);null!==i.attributeOldValue&&o&&(e=s.unwrap(e,o)),null!==i.attributeNewValue&&r&&s.wrap(e,r)}}}function Ja(e,t=dl){return(i,n,o)=>{if(!t(n.item,o.consumable,{preflight:!0}))return;const r=e(n.item,o,n);if(!r)return;t(n.item,o.consumable);const s=n.reconversion&&Xa(n.item,o)||o.mapper.toViewPosition(n.range.start);o.mapper.bindElements(n.item,r),o.writer.insert(s,r),o.convertAttributes(n.item),ll(r,n.item.getChildren(),o,{reconversion:n.reconversion})}}function Qa(e){return(t,i,n)=>{i.isOpening=!0;const o=e(i,n);i.isOpening=!1;const r=e(i,n);if(!o||!r)return;const s=i.markerRange;if(s.isCollapsed&&!n.consumable.consume(s,t.name))return;for(const e of s)if(!n.consumable.consume(e.item,t.name))return;const a=n.mapper,l=n.writer;l.insert(a.toViewPosition(s.start),o),n.mapper.bindElementToMarker(o,i.markerName),s.isCollapsed||(l.insert(a.toViewPosition(s.end),r),n.mapper.bindElementToMarker(r,i.markerName)),t.stop()}}function Za(e,t){const i=t.writer.remove(e);for(const e of t.writer.createRangeIn(i).getItems())t.mapper.unbindViewElement(e,{defer:!0});return e.start}function Xa(e,t){const i=t.mapper.toViewElement(e);return i&&Za(t.writer.createRangeOn(i),t)}function el(e,t,i,n,o){const r=t?e.start:e.end,s=r.nodeAfter&&r.nodeAfter.is("element")?r.nodeAfter:null,a=r.nodeBefore&&r.nodeBefore.is("element")?r.nodeBefore:null;if(s||a){let e,r;t&&s||!t&&!a?(e=s,r=!0):(e=a,r=!1);const l=i.mapper.toViewElement(e);if(l)return void function(e,t,i,n,o,r){const s=`data-${r.group}-${t?"start":"end"}-${i?"before":"after"}`,a=e.hasAttribute(s)?e.getAttribute(s).split(","):[];a.unshift(r.name),n.writer.setAttribute(s,a.join(","),e),n.mapper.bindElementToMarker(e,o.markerName)}(l,t,r,i,n,o)}!function(e,t,i,n,o){const r=`${o.group}-${t?"start":"end"}`,s=o.name?{name:o.name}:null,a=i.writer.createUIElement(r,s);i.writer.insert(e,a),i.mapper.bindElementToMarker(a,n.markerName)}(i.mapper.toViewPosition(r),t,i,n,o)}function tl(e){return"string"==typeof e&&(e={name:e}),{name:e.name,attributes:e.attributes?Dt(e.attributes):[],children:!!e.children}}function il(e,t){return"function"==typeof e?e:(i,n)=>function(e,t,i){"string"==typeof e&&(e={name:e});let n;const o=t.writer,r=Object.assign({},e.attributes);if("container"==i)n=o.createContainerElement(e.name,r);else if("attribute"==i){const t={priority:e.priority||Fr.DEFAULT_PRIORITY};n=o.createAttributeElement(e.name,r,t)}else n=o.createUIElement(e.name,r);if(e.styles){const t=Object.keys(e.styles);for(const i of t)o.setStyle(i,e.styles[i],n)}if(e.classes){const t=e.classes;if("string"==typeof t)o.addClass(t,n);else for(const e of t)o.addClass(e,n)}return n}(e,n,t)}function nl(e){return e.model.values?(t,i,n)=>{const o=e.view[t];return o?o(t,i,n):null}:e.view}function ol(e){return"string"==typeof e?t=>({key:e,value:t}):"object"==typeof e?e.value?()=>e:t=>({key:e.key,value:t}):e}function rl(e,t,i){const n="function"==typeof e?e(t,i):{...e};return n?(n.priority||(n.priority=10),n.id||(n.id=t.markerName),n):null}function sl(e){const t=function(e){return(t,i)=>{if(!t.is("element",e.name))return!1;if("attribute"==i.type){if(e.attributes.includes(i.attributeKey))return!0}else if(e.children)return!0;return!1}}(e);return(e,i)=>{const n=[];i.reconvertedElements||(i.reconvertedElements=new Set);for(const e of i.changes){const o="attribute"==e.type?e.range.start.nodeAfter:e.position.parent;if(o&&t(o,e)&&"reinsert"!=e.type){if("insert"==e.type&&"rename"==e.action&&i.refreshedItems.add(e.position.nodeAfter),!i.reconvertedElements.has(o)){i.reconvertedElements.add(o);const e=ga._createBefore(o);let t=n.length;for(let i=n.length-1;i>=0;i--){const o=n[i],r=("attribute"==o.type?o.range.start:o.position).compareWith(e);if("before"==r||"remove"==o.type&&"same"==r)break;t=i}n.splice(t,0,{type:"reinsert",name:o.name,position:e,length:1})}}else n.push(e)}i.changes=n}}function al(e){return(t,i,n={})=>{const o=["insert"];for(const i of e.attributes)t.hasAttribute(i)&&o.push(`attribute:${i}`);return!!o.every(e=>i.test(t,e))&&(n.preflight||o.forEach(e=>i.consume(t,e)),!0)}}function ll(e,t,i,n){for(const o of t)cl(e.root,o,i,n)||i.convertItem(o)}function cl(e,t,i,n){const{writer:o,mapper:r}=i;if(!n.reconversion)return!1;const s=r.toViewElement(t);return!(!s||s.root==e)&&(!!i.canReuseView(s)&&(o.move(o.createRangeOn(s),r.toViewPosition(ga._createBefore(t))),!0))}function dl(e,t,{preflight:i}={}){return i?t.test(e,"insert"):t.consume(e,"insert")}function ul(e){const{schema:t,document:i}=e.model;for(const n of i.getRoots())if(n.isEmpty&&!t.checkChild(n,"$text")&&t.checkChild(n,"paragraph"))return e.insertElement("paragraph",n),!0;return!1}function hl(e,t,i){const n=i.createContext(e);return!!i.checkChild(n,"paragraph")&&!!i.checkChild(n.push("paragraph"),t)}function ml(e,t){const i=t.createElement("paragraph");return t.insert(i,e),t.createPositionAt(i,0)}class gl extends qa{elementToElement(e){return this.add(fl(e))}elementToAttribute(e){return this.add(function(e){e=Bt(e),kl(e);const t=wl(e,!1),i=pl(e.view),n=i?`element:${i}`:"element";return i=>{i.on(n,t,{priority:e.converterPriority||"low"})}}(e))}attributeToAttribute(e){return this.add(function(e){e=Bt(e);let t=null;("string"==typeof e.view||e.view.key)&&(t=function(e){"string"==typeof e.view&&(e.view={key:e.view});const t=e.view.key,i=void 0===e.view.value?/[\s\S]*/:e.view.value;let n;if("class"==t||"style"==t){const e="class"==t?"classes":"styles";n={[e]:i}}else n={attributes:{[t]:i}};e.view.name&&(n.name=e.view.name);return e.view=n,t}(e));kl(e,t);const i=wl(e,!0);return t=>{t.on("element",i,{priority:e.converterPriority||"low"})}}(e))}elementToMarker(e){return this.add(function(e){const t=function(e){return(t,i)=>{const n="string"==typeof e?e:e(t,i);return i.writer.createElement("$marker",{"data-name":n})}}(e.model);return fl({...e,model:t})}(e))}dataToMarker(e){return this.add(function(e){e=Bt(e),e.model||(e.model=t=>t?e.view+":"+t:e.view);const t={view:e.view,model:e.model},i=bl(_l(t,"start")),n=bl(_l(t,"end"));return o=>{o.on(`element:${e.view}-start`,i,{priority:e.converterPriority||"normal"}),o.on(`element:${e.view}-end`,n,{priority:e.converterPriority||"normal"});const r=v.low,s=v.highest,a=v.get(e.converterPriority)/s;o.on("element",function(e){return(t,i,n)=>{const o=`data-${e.view}`;function r(t,o){for(const r of o){const o=e.model(r,n),s=n.writer.createElement("$marker",{"data-name":o});n.writer.insert(s,t),i.modelCursor.isEqual(t)?i.modelCursor=i.modelCursor.getShiftedBy(1):i.modelCursor=i.modelCursor._getTransformedByInsertion(t,1),i.modelRange=i.modelRange._getTransformedByInsertion(t,1)[0]}}(n.consumable.test(i.viewItem,{attributes:o+"-end-after"})||n.consumable.test(i.viewItem,{attributes:o+"-start-after"})||n.consumable.test(i.viewItem,{attributes:o+"-end-before"})||n.consumable.test(i.viewItem,{attributes:o+"-start-before"}))&&(i.modelRange||Object.assign(i,n.convertChildren(i.viewItem,i.modelCursor)),n.consumable.consume(i.viewItem,{attributes:o+"-end-after"})&&r(i.modelRange.end,i.viewItem.getAttribute(o+"-end-after").split(",")),n.consumable.consume(i.viewItem,{attributes:o+"-start-after"})&&r(i.modelRange.end,i.viewItem.getAttribute(o+"-start-after").split(",")),n.consumable.consume(i.viewItem,{attributes:o+"-end-before"})&&r(i.modelRange.start,i.viewItem.getAttribute(o+"-end-before").split(",")),n.consumable.consume(i.viewItem,{attributes:o+"-start-before"})&&r(i.modelRange.start,i.viewItem.getAttribute(o+"-start-before").split(",")))}}(t),{priority:r+a})}}(e))}}function fl(e){const t=bl(e=Bt(e)),i=pl(e.view),n=i?`element:${i}`:"element";return i=>{i.on(n,t,{priority:e.converterPriority||"normal"})}}function pl(e){return"string"==typeof e?e:"object"==typeof e&&"string"==typeof e.name?e.name:null}function bl(e){const t=new Ko(e.view);return(i,n,o)=>{const r=t.match(n.viewItem);if(!r)return;const s=r.match;if(s.name=!0,!o.consumable.test(n.viewItem,s))return;const a=function(e,t,i){return e instanceof Function?e(t,i):i.writer.createElement(e)}(e.model,n.viewItem,o);a&&o.safeInsert(a,n.modelCursor)&&(o.consumable.consume(n.viewItem,s),o.convertChildren(n.viewItem,a),o.updateConversionResult(a,n))}}function kl(e,t=null){const i=null===t||(e=>e.getAttribute(t)),n="object"!=typeof e.model?e.model:e.model.key,o="object"!=typeof e.model||void 0===e.model.value?i:e.model.value;e.model={key:n,value:o}}function wl(e,t){const i=new Ko(e.view);return(n,o,r)=>{if(!o.modelRange&&t)return;const s=i.match(o.viewItem);if(!s)return;if(!function(e,t){const i="function"==typeof e?e(t):e;if("object"==typeof i&&!pl(i))return!1;return!i.classes&&!i.attributes&&!i.styles}(e.view,o.viewItem)?delete s.match.name:s.match.name=!0,!r.consumable.test(o.viewItem,s.match))return;const a=e.model.key,l="function"==typeof e.model.value?e.model.value(o.viewItem,r,o):e.model.value;if(null==l)return;o.modelRange||Object.assign(o,r.convertChildren(o.viewItem,o.modelCursor));const c=function(e,t,i,n){let o=!1;for(const r of Array.from(e.getItems({shallow:i})))n.schema.checkAttribute(r,t.key)&&(o=!0,r.hasAttribute(t.key)||n.writer.setAttribute(t.key,t.value,r));return o}(o.modelRange,{key:a,value:l},t,r);c&&(r.consumable.test(o.viewItem,{name:!0})&&(s.match.name=!0),r.consumable.consume(o.viewItem,s.match))}}function _l(e,t){return{view:`${e.view}-${t}`,model:(t,i)=>{const n=t.getAttribute("name"),o=e.model(n,i);return i.writer.createElement("$marker",{"data-name":o})}}}class vl extends(K()){model;view;mapper;downcastDispatcher;constructor(e,t){super(),this.model=e,this.view=new ca(t),this.mapper=new va,this.downcastDispatcher=new Ca({mapper:this.mapper,schema:e.schema});const i=this.model.document,n=i.selection,o=this.model.markers;this.listenTo(this.model,"_beforeChanges",()=>{this.view._disableRendering(!0)},{priority:"highest"}),this.listenTo(this.model,"_afterChanges",()=>{this.view._disableRendering(!1)},{priority:"lowest"}),this.listenTo(i,"change",()=>{this.view.change(e=>{this.downcastDispatcher.convertChanges(i.differ,o,e),this.downcastDispatcher.convertSelection(n,o,e)})},{priority:"low"}),this.listenTo(this.view.document,"selectionChange",function(e,t){return(i,n)=>{const o=n.newSelection,r=[];for(const e of o.getRanges())r.push(t.toModelRange(e));const s=e.createSelection(r,{backward:o.isBackward});s.isEqual(e.document.selection)||e.change(e=>{e.setSelection(s)})}}(this.model,this.mapper)),this.downcastDispatcher.on("insert:$text",(e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const n=i.writer,o=i.mapper.toViewPosition(t.range.start),r=n.createText(t.item.data);n.insert(o,r)},{priority:"lowest"}),this.downcastDispatcher.on("insert",(e,t,i)=>{i.convertAttributes(t.item),t.reconversion||!t.item.is("element")||t.item.isEmpty||i.convertChildren(t.item)},{priority:"lowest"}),this.downcastDispatcher.on("remove",(e,t,i)=>{if(t.reconversion)return;const n=i.mapper.toViewPosition(t.position),o=t.position.getShiftedBy(t.length),r=i.mapper.toViewPosition(o,{isPhantom:!0});Za(i.writer.createRange(n,r).getTrimmed(),i)},{priority:"low"}),this.downcastDispatcher.on("cleanSelection",(e,t,i)=>{const n=i.writer,o=n.document.selection;for(const e of o.getRanges())e.isCollapsed&&e.end.parent.isAttached()&&i.writer.mergeAttributes(e.start);n.setSelection(null)}),this.downcastDispatcher.on("selection",(e,t,i)=>{const n=t.selection;if(n.isCollapsed)return;if(!i.consumable.consume(n,"selection"))return;const o=[];for(const e of n.getRanges())o.push(i.mapper.toViewRange(e));i.writer.setSelection(o,{backward:n.isBackward})},{priority:"low"}),this.downcastDispatcher.on("selection",(e,t,i)=>{const n=t.selection;if(!n.isCollapsed)return;if(!i.consumable.consume(n,"selection"))return;const o=i.writer,r=n.getFirstPosition(),s=i.mapper.toViewPosition(r),a=o.breakAttributes(s);o.setSelection(a)},{priority:"low"}),this.view.document.roots.bindTo(this.model.document.roots).using(e=>{if("$graveyard"==e.rootName)return null;const t=new yr(this.view.document,e.name);return t.rootName=e.rootName,this.mapper.bindElements(e,t),t})}destroy(){this.view.destroy(),this.stopListening()}reconvertMarker(e){const t="string"==typeof e?e:e.name,i=this.model.markers.get(t);if(!i)throw new A("editingcontroller-reconvertmarker-marker-not-exist",this,{markerName:t});this.model.change(()=>{this.model.markers._refresh(i)})}reconvertItem(e){this.model.change(()=>{this.model.document.differ._refreshItem(e)})}}class yl extends(K()){_sourceDefinitions={};_attributeProperties=Object.create(null);_customChildChecks=new Map;_customAttributeChecks=new Map;_genericCheckSymbol=Symbol("$generic");_compiledDefinitions;constructor(){super(),this.decorate("checkChild"),this.decorate("checkAttribute"),this.on("checkAttribute",(e,t)=>{t[0]=new Al(t[0])},{priority:"highest"}),this.on("checkChild",(e,t)=>{t[0]=new Al(t[0]),t[1]=this.getDefinition(t[1])},{priority:"highest"})}register(e,t){if(this._sourceDefinitions[e])throw new A("schema-cannot-register-item-twice",this,{itemName:e});this._sourceDefinitions[e]=[Object.assign({},t)],this._clearCache()}extend(e,t){if(!this._sourceDefinitions[e])throw new A("schema-cannot-extend-missing-item",this,{itemName:e});this._sourceDefinitions[e].push(Object.assign({},t)),this._clearCache()}getDefinitions(){return this._compiledDefinitions||this._compile(),this._compiledDefinitions}getDefinition(e){let t;return t="string"==typeof e?e:"is"in e&&(e.is("$text")||e.is("$textProxy"))?"$text":e.name,this.getDefinitions()[t]}isRegistered(e){return!!this.getDefinition(e)}isBlock(e){const t=this.getDefinition(e);return!(!t||!t.isBlock)}isLimit(e){const t=this.getDefinition(e);return!!t&&!(!t.isLimit&&!t.isObject)}isObject(e){const t=this.getDefinition(e);return!!t&&!!(t.isObject||t.isLimit&&t.isSelectable&&t.isContent)}isInline(e){const t=this.getDefinition(e);return!(!t||!t.isInline)}isSelectable(e){const t=this.getDefinition(e);return!!t&&!(!t.isSelectable&&!t.isObject)}isContent(e){const t=this.getDefinition(e);return!!t&&!(!t.isContent&&!t.isObject)}checkChild(e,t){return!!t&&this._checkContextMatch(e,t)}checkAttribute(e,t){const i=this.getDefinition(e.last);if(!i)return!1;const n=this._evaluateAttributeChecks(e,t);return void 0!==n?n:i.allowAttributes.includes(t)}checkMerge(e,t){if(e instanceof ga){const t=e.nodeBefore,i=e.nodeAfter;if(!(t instanceof $a))throw new A("schema-check-merge-no-element-before",this);if(!(i instanceof $a))throw new A("schema-check-merge-no-element-after",this);return this.checkMerge(t,i)}if(this.isLimit(e)||this.isLimit(t))return!1;for(const i of t.getChildren())if(!this.checkChild(e,i))return!1;return!0}addChildCheck(e,t){const i=void 0!==t?t:this._genericCheckSymbol,n=this._customChildChecks.get(i)||[];n.push(e),this._customChildChecks.set(i,n)}addAttributeCheck(e,t){const i=void 0!==t?t:this._genericCheckSymbol,n=this._customAttributeChecks.get(i)||[];n.push(e),this._customAttributeChecks.set(i,n)}setAttributeProperties(e,t){this._attributeProperties[e]=Object.assign(this.getAttributeProperties(e),t)}getAttributeProperties(e){return this._attributeProperties[e]||Object.create(null)}getLimitElement(e){let t;if(e instanceof ga)t=e.parent;else{t=(e instanceof _a?[e]:Array.from(e.getRanges())).reduce((e,t)=>{const i=t.getCommonAncestor();return e?e.getCommonAncestor(i,{includeSelf:!0}):i},null)}for(;!this.isLimit(t)&&t.parent;)t=t.parent;return t}checkAttributeInSelection(e,t){if(e.isCollapsed){const i=[...e.getFirstPosition().getAncestors(),new za("",e.getAttributes())];return this.checkAttribute(i,t)}{const i=e.getRanges();for(const e of i)for(const i of e)if(this.checkAttribute(i.item,t))return!0}return!1}*getValidRanges(e,t){e=function*(e){for(const t of e)yield*t.getMinimalFlatRanges()}(e);for(const i of e)yield*this._getValidRangesForRange(i,t)}getNearestSelectionRange(e,t="both"){if("$graveyard"==e.root.rootName)return null;if(this.checkChild(e,"$text"))return new _a(e);let i,n;const o=e.getAncestors().reverse().find(e=>this.isLimit(e))||e.root;"both"!=t&&"backward"!=t||(i=new ha({boundaries:_a._createIn(o),startPosition:e,direction:"backward"})),"both"!=t&&"forward"!=t||(n=new ha({boundaries:_a._createIn(o),startPosition:e}));for(const e of function*(e,t){let i=!1;for(;!i;){if(i=!0,e){const t=e.next();t.done||(i=!1,yield{walker:e,value:t.value})}if(t){const e=t.next();e.done||(i=!1,yield{walker:t,value:e.value})}}}(i,n)){const t=e.walker==i?"elementEnd":"elementStart",n=e.value;if(n.type==t&&this.isObject(n.item))return _a._createOn(n.item);if(this.checkChild(n.nextPosition,"$text"))return new _a(n.nextPosition)}return null}findAllowedParent(e,t){let i=e.parent;for(;i;){if(this.checkChild(i,t))return i;if(this.isLimit(i))return null;i=i.parent}return null}setAllowedAttributes(e,t,i){const n=i.model;for(const[o,r]of Object.entries(t))n.schema.checkAttribute(e,o)&&i.setAttribute(o,r,e)}removeDisallowedAttributes(e,t){for(const i of e)if(i.is("$text"))Ll(this,i,t);else{const e=_a._createIn(i).getPositions();for(const i of e){Ll(this,i.nodeBefore||i.parent,t)}}}getAttributesWithProperty(e,t,i){const n={};for(const[o,r]of e.getAttributes()){const e=this.getAttributeProperties(o);void 0!==e[t]&&(void 0!==i&&i!==e[t]||(n[o]=r))}return n}createContext(e){return new Al(e)}_clearCache(){this._compiledDefinitions=null}_compile(){const e={},t=this._sourceDefinitions,i=Object.keys(t);for(const n of i)e[n]=xl(t[n],n);const n=Object.values(e);for(const t of n)Cl(e,t),Tl(e,t),El(e,t),Il(e,t);for(const t of n)Sl(e,t);for(const t of n)Pl(e,t);for(const t of n)Ml(e,t);for(const t of n)Ol(e,t);for(const t of n)Rl(e,t);this._compiledDefinitions=function(e){const t={};for(const i of Object.values(e))t[i.name]={name:i.name,isBlock:!!i.isBlock,isContent:!!i.isContent,isInline:!!i.isInline,isLimit:!!i.isLimit,isObject:!!i.isObject,isSelectable:!!i.isSelectable,allowIn:Array.from(i.allowIn).filter(t=>!!e[t]),allowChildren:Array.from(i.allowChildren).filter(t=>!!e[t]),allowAttributes:Array.from(i.allowAttributes)};return t}(e)}_checkContextMatch(e,t){const i=e.last;let n=this._evaluateChildChecks(e,t);if(n=void 0!==n?n:t.allowIn.includes(i.name),!n)return!1;const o=this.getDefinition(i),r=e.trimLast();return!!o&&(0==r.length||this._checkContextMatch(r,o))}_evaluateChildChecks(e,t){const i=this._customChildChecks.get(this._genericCheckSymbol)||[],n=this._customChildChecks.get(t.name)||[];for(const o of[...i,...n]){const i=o(e,t);if(void 0!==i)return i}}_evaluateAttributeChecks(e,t){const i=this._customAttributeChecks.get(this._genericCheckSymbol)||[],n=this._customAttributeChecks.get(t)||[];for(const o of[...i,...n]){const i=o(e,t);if(void 0!==i)return i}}*_getValidRangesForRange(e,t){let i=e.start,n=e.start;for(const o of e.getItems({shallow:!0}))o.is("element")&&(yield*this._getValidRangesForRange(_a._createIn(o),t)),this.checkAttribute(o,t)||(i.isEqual(n)||(yield new _a(i,n)),i=ga._createAfter(o)),n=ga._createAfter(o);i.isEqual(n)||(yield new _a(i,n))}findOptimalInsertionRange(e,t){const i=e.getSelectedElement();if(i&&this.isObject(i)&&!this.isInline(i))return"before"==t||"after"==t?new _a(ga._createAt(i,t)):_a._createOn(i);const n=Jt(e.getSelectedBlocks());if(!n)return new _a(e.focus);if(n.isEmpty)return new _a(ga._createAt(n,0));const o=ga._createAfter(n);return e.focus.isTouching(o)?new _a(o):new _a(ga._createBefore(n))}}class Al{_items;constructor(e){if(e instanceof Al)return e;let t;t="string"==typeof e?[e]:Array.isArray(e)?e:e.getAncestors({includeSelf:!0}),this._items=t.map(Vl)}get length(){return this._items.length}get last(){return this._items[this._items.length-1]}[Symbol.iterator](){return this._items[Symbol.iterator]()}push(e){const t=new Al([e]);return t._items=[...this._items,...t._items],t}trimLast(){const e=new Al([]);return e._items=this._items.slice(0,-1),e}getItem(e){return this._items[e]}*getNames(){yield*this._items.map(e=>e.name)}endsWith(e){return Array.from(this.getNames()).join(" ").endsWith(e)}startsWith(e){return Array.from(this.getNames()).join(" ").startsWith(e)}}function xl(e,t){const i={name:t,allowIn:new Set,allowChildren:new Set,disallowIn:new Set,disallowChildren:new Set,allowContentOf:new Set,allowWhere:new Set,allowAttributes:new Set,disallowAttributes:new Set,allowAttributesOf:new Set,inheritTypesFrom:new Set};return function(e,t){for(const i of e){const e=Object.keys(i).filter(e=>e.startsWith("is"));for(const n of e)t[n]=!!i[n]}}(e,i),Nl(e,i,"allowIn"),Nl(e,i,"allowChildren"),Nl(e,i,"disallowIn"),Nl(e,i,"disallowChildren"),Nl(e,i,"allowContentOf"),Nl(e,i,"allowWhere"),Nl(e,i,"allowAttributes"),Nl(e,i,"disallowAttributes"),Nl(e,i,"allowAttributesOf"),Nl(e,i,"inheritTypesFrom"),function(e,t){for(const i of e){const e=i.inheritAllFrom;e&&(t.allowContentOf.add(e),t.allowWhere.add(e),t.allowAttributesOf.add(e),t.inheritTypesFrom.add(e))}}(e,i),i}function Cl(e,t){for(const i of t.allowIn){const n=e[i];n?n.allowChildren.add(t.name):t.allowIn.delete(i)}}function Tl(e,t){for(const i of t.allowChildren){const n=e[i];n?n.allowIn.add(t.name):t.allowChildren.delete(i)}}function El(e,t){for(const i of t.disallowIn){const n=e[i];n?n.disallowChildren.add(t.name):t.disallowIn.delete(i)}}function Il(e,t){for(const i of t.disallowChildren){const n=e[i];n?n.disallowIn.add(t.name):t.disallowChildren.delete(i)}}function Sl(e,t){for(const e of t.disallowChildren)t.allowChildren.delete(e);for(const e of t.disallowIn)t.allowIn.delete(e);for(const e of t.disallowAttributes)t.allowAttributes.delete(e)}function Pl(e,t){for(const i of t.allowContentOf){const n=e[i];n&&(n.disallowChildren.forEach(i=>{t.allowChildren.has(i)||(t.disallowChildren.add(i),e[i].disallowIn.add(t.name))}),n.allowChildren.forEach(i=>{t.disallowChildren.has(i)||(t.allowChildren.add(i),e[i].allowIn.add(t.name))}))}}function Ml(e,t){for(const i of t.allowWhere){const n=e[i];n&&(n.disallowIn.forEach(i=>{t.allowIn.has(i)||(t.disallowIn.add(i),e[i].disallowChildren.add(t.name))}),n.allowIn.forEach(i=>{t.disallowIn.has(i)||(t.allowIn.add(i),e[i].allowChildren.add(t.name))}))}}function Ol(e,t){for(const i of t.allowAttributesOf){const n=e[i];if(!n)return;n.allowAttributes.forEach(e=>{t.disallowAttributes.has(e)||t.allowAttributes.add(e)})}}function Rl(e,t){for(const i of t.inheritTypesFrom){const n=e[i];if(n){const e=Object.keys(n).filter(e=>e.startsWith("is"));for(const i of e)i in t||(t[i]=n[i])}}}function Nl(e,t,i){for(const n of e){let e=n[i];"string"==typeof e&&(e=[e]),Array.isArray(e)&&e.forEach(e=>t[i].add(e))}}function Vl(e){return"string"==typeof e||e.is("documentFragment")?{name:"string"==typeof e?e:"$documentFragment",*getAttributeKeys(){},getAttribute(){}}:{name:e.is("element")?e.name:"$text",*getAttributeKeys(){yield*e.getAttributeKeys()},getAttribute:t=>e.getAttribute(t)}}function Ll(e,t,i){for(const n of t.getAttributeKeys())e.checkAttribute(t,n)||i.removeAttribute(n,t)}class Dl extends(O()){conversionApi;_splitParts=new Map;_cursorParents=new Map;_modelCursor=null;_emptyElementsToKeep=new Set;constructor(e){super(),this.conversionApi={...e,consumable:null,writer:null,store:null,convertItem:(e,t)=>this._convertItem(e,t),convertChildren:(e,t)=>this._convertChildren(e,t),safeInsert:(e,t)=>this._safeInsert(e,t),updateConversionResult:(e,t)=>this._updateConversionResult(e,t),splitToAllowedParent:(e,t)=>this._splitToAllowedParent(e,t),getSplitParts:e=>this._getSplitParts(e),keepEmptyElement:e=>this._keepEmptyElement(e)}}convert(e,t,i=["$root"]){this.fire("viewCleanup",e),this._modelCursor=function(e,t){let i;for(const n of new Al(e)){const e={};for(const t of n.getAttributeKeys())e[t]=n.getAttribute(t);const o=t.createElement(n.name,e);i&&t.insert(o,i),i=ga._createAt(o,0)}return i}(i,t),this.conversionApi.writer=t,this.conversionApi.consumable=Ho.createFrom(e),this.conversionApi.store={};const{modelRange:n}=this._convertItem(e,this._modelCursor),o=t.createDocumentFragment();if(n){this._removeEmptyElements();const e=this._modelCursor.parent,i=e._removeChildren(0,e.childCount);o._insertChild(0,i),o.markers=function(e,t){const i=new Set,n=new Map,o=_a._createIn(e).getItems();for(const e of o)e.is("element","$marker")&&i.add(e);for(const e of i){const i=e.getAttribute("data-name"),o=t.createPositionBefore(e);n.has(i)?n.get(i).end=o.clone():n.set(i,new _a(o.clone())),t.remove(e)}return n}(o,t)}return this._modelCursor=null,this._splitParts.clear(),this._cursorParents.clear(),this._emptyElementsToKeep.clear(),this.conversionApi.writer=null,this.conversionApi.store=null,o}_convertItem(e,t){const i={viewItem:e,modelCursor:t,modelRange:null};if(e.is("element")?this.fire(`element:${e.name}`,i,this.conversionApi):e.is("$text")?this.fire("text",i,this.conversionApi):this.fire("documentFragment",i,this.conversionApi),i.modelRange&&!(i.modelRange instanceof _a))throw new A("view-conversion-dispatcher-incorrect-result",this);return{modelRange:i.modelRange,modelCursor:i.modelCursor}}_convertChildren(e,t){let i=t.is("position")?t:ga._createAt(t,0);const n=new _a(i);for(const t of Array.from(e.getChildren())){const e=this._convertItem(t,i);e.modelRange instanceof _a&&(n.end=e.modelRange.end,i=e.modelCursor)}return{modelRange:n,modelCursor:i}}_safeInsert(e,t){const i=this._splitToAllowedParent(e,t);return!!i&&(this.conversionApi.writer.insert(e,i.position),!0)}_updateConversionResult(e,t){const i=this._getSplitParts(e),n=this.conversionApi.writer;t.modelRange||(t.modelRange=n.createRange(n.createPositionBefore(e),n.createPositionAfter(i[i.length-1])));const o=this._cursorParents.get(e);t.modelCursor=o?n.createPositionAt(o,0):t.modelRange.end}_splitToAllowedParent(e,t){const{schema:i,writer:n}=this.conversionApi;let o=i.findAllowedParent(t,e);if(o){if(o===t.parent)return{position:t};this._modelCursor.parent.getAncestors().includes(o)&&(o=null)}if(!o)return hl(t,e,i)?{position:ml(t,n)}:null;const r=this.conversionApi.writer.split(t,o),s=[];for(const e of r.range.getWalker())if("elementEnd"==e.type)s.push(e.item);else{const t=s.pop(),i=e.item;this._registerSplitPair(t,i)}const a=r.range.end.parent;return this._cursorParents.set(e,a),{position:r.position,cursorParent:a}}_registerSplitPair(e,t){this._splitParts.has(e)||this._splitParts.set(e,[e]);const i=this._splitParts.get(e);this._splitParts.set(t,i),i.push(t)}_getSplitParts(e){let t;return t=this._splitParts.has(e)?this._splitParts.get(e):[e],t}_keepEmptyElement(e){this._emptyElementsToKeep.add(e)}_removeEmptyElements(){const e=new Map;for(const t of this._splitParts.keys())if(t.isEmpty&&!this._emptyElementsToKeep.has(t)){const i=e.get(t.parent)||[];i.push(t),this._splitParts.delete(t),e.set(t.parent,i)}for(const[t,i]of e)t._removeChildrenArray(i);e.size&&this._removeEmptyElements()}}class Bl{getHtml(t){const i=e.document.implementation.createHTMLDocument("").createElement("div");return i.appendChild(t),i.innerHTML}}class zl{domParser;domConverter;htmlWriter;skipComments=!0;constructor(e){this.domParser=new DOMParser,this.domConverter=new Es(e,{renderingMode:"data"}),this.htmlWriter=new Bl}toData(e){const t=this.domConverter.viewToDom(e);return this.htmlWriter.getHtml(t)}toView(e){const t=this._toDom(e);return this.domConverter.domToView(t,{skipComments:this.skipComments})}registerRawContentMatcher(e){this.domConverter.registerRawContentMatcher(e)}useFillerType(e){this.domConverter.blockFillerMode="marked"==e?"markedNbsp":"nbsp"}_toDom(e){/<(?:html|body|head|meta)(?:\s[^>]*)?>/i.test(e.trim().slice(0,1e4))||(e=`<body>${e}</body>`);const t=this.domParser.parseFromString(e,"text/html"),i=t.createDocumentFragment(),n=t.body.childNodes;for(;n.length>0;)i.appendChild(n[0]);return i}}class Fl extends(O()){model;mapper;downcastDispatcher;upcastDispatcher;viewDocument;stylesProcessor;htmlProcessor;processor;_viewWriter;constructor(e,t){super(),this.model=e,this.mapper=new va,this.downcastDispatcher=new Ca({mapper:this.mapper,schema:e.schema}),this.downcastDispatcher.on("insert:$text",(e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const n=i.writer,o=i.mapper.toViewPosition(t.range.start),r=n.createText(t.item.data);n.insert(o,r)},{priority:"lowest"}),this.downcastDispatcher.on("insert",(e,t,i)=>{i.convertAttributes(t.item),t.reconversion||!t.item.is("element")||t.item.isEmpty||i.convertChildren(t.item)},{priority:"lowest"}),this.upcastDispatcher=new Dl({schema:e.schema}),this.viewDocument=new zr(t),this.stylesProcessor=t,this.htmlProcessor=new zl(this.viewDocument),this.processor=this.htmlProcessor,this._viewWriter=new Qr(this.viewDocument),this.upcastDispatcher.on("text",(e,t,{schema:i,consumable:n,writer:o})=>{let r=t.modelCursor;if(!n.test(t.viewItem))return;if(!i.checkChild(r,"$text")){if(!hl(r,"$text",i))return;if(0==t.viewItem.data.trim().length)return;r=ml(r,o)}n.consume(t.viewItem);const s=o.createText(t.viewItem.data);o.insert(s,r),t.modelRange=o.createRange(r,r.getShiftedBy(s.offsetSize)),t.modelCursor=t.modelRange.end},{priority:"lowest"}),this.upcastDispatcher.on("element",(e,t,i)=>{if(!t.modelRange&&i.consumable.consume(t.viewItem,{name:!0})){const{modelRange:e,modelCursor:n}=i.convertChildren(t.viewItem,t.modelCursor);t.modelRange=e,t.modelCursor=n}},{priority:"lowest"}),this.upcastDispatcher.on("documentFragment",(e,t,i)=>{if(!t.modelRange&&i.consumable.consume(t.viewItem,{name:!0})){const{modelRange:e,modelCursor:n}=i.convertChildren(t.viewItem,t.modelCursor);t.modelRange=e,t.modelCursor=n}},{priority:"lowest"}),K().prototype.decorate.call(this,"init"),K().prototype.decorate.call(this,"set"),K().prototype.decorate.call(this,"get"),K().prototype.decorate.call(this,"toView"),K().prototype.decorate.call(this,"toModel"),this.on("init",()=>{this.fire("ready")},{priority:"lowest"}),this.on("ready",()=>{this.model.enqueueChange({isUndoable:!1},ul)},{priority:"lowest"})}get(e={}){const{rootName:t="main",trim:i="empty"}=e;if(!this._checkIfRootsExists([t]))throw new A("datacontroller-get-non-existent-root",this);const n=this.model.document.getRoot(t);return n.isAttached()||x("datacontroller-get-detached-root",this),"empty"!==i||this.model.hasContent(n,{ignoreWhitespaces:!0})?this.stringify(n,e):""}stringify(e,t={}){const i=this.toView(e,t);return this.processor.toData(i)}toView(e,t={}){const i=this.viewDocument,n=this._viewWriter;this.mapper.clearBindings();const o=_a._createIn(e),r=new Jr(i);this.mapper.bindElements(e,r);const s=e.is("documentFragment")?e.markers:function(e){const t=[],i=e.root.document;if(!i)return new Map;const n=_a._createIn(e);for(const e of i.model.markers){const i=e.getRange(),o=i.isCollapsed,r=i.start.isEqual(n.start)||i.end.isEqual(n.end);if(o&&r)t.push([e.name,i]);else{const o=n.getIntersection(i);o&&t.push([e.name,o])}}return t.sort(([e,t],[i,n])=>{if("after"!==t.end.compareWith(n.start))return 1;if("before"!==t.start.compareWith(n.end))return-1;switch(t.start.compareWith(n.start)){case"before":return 1;case"after":return-1;default:switch(t.end.compareWith(n.end)){case"before":return 1;case"after":return-1;default:return i.localeCompare(e)}}}),new Map(t)}(e);return this.downcastDispatcher.convert(o,s,n,t),r}init(e){if(this.model.document.version)throw new A("datacontroller-init-document-not-empty",this);let t={};if("string"==typeof e?t.main=e:t=e,!this._checkIfRootsExists(Object.keys(t)))throw new A("datacontroller-init-non-existent-root",this);return this.model.enqueueChange({isUndoable:!1},e=>{for(const i of Object.keys(t)){const n=this.model.document.getRoot(i);e.insert(this.parse(t[i],n),n,0)}}),Promise.resolve()}set(e,t={}){let i={};if("string"==typeof e?i.main=e:i=e,!this._checkIfRootsExists(Object.keys(i)))throw new A("datacontroller-set-non-existent-root",this);this.model.enqueueChange(t.batchType||{},e=>{e.setSelection(null),e.removeSelectionAttribute(this.model.document.selection.getAttributeKeys());for(const t of Object.keys(i)){const n=this.model.document.getRoot(t);e.remove(e.createRangeIn(n)),e.insert(this.parse(i[t],n),n,0)}})}parse(e,t="$root"){const i=this.processor.toView(e);return this.toModel(i,t)}toModel(e,t="$root"){return this.model.change(i=>this.upcastDispatcher.convert(e,i,t))}addStyleProcessorRules(e){e(this.stylesProcessor)}registerRawContentMatcher(e){this.processor&&this.processor!==this.htmlProcessor&&this.processor.registerRawContentMatcher(e),this.htmlProcessor.registerRawContentMatcher(e)}destroy(){this.stopListening()}_checkIfRootsExists(e){for(const t of e)if(!this.model.document.getRoot(t))return!1;return!0}}class jl{_helpers=new Map;_downcast;_upcast;constructor(e,t){this._downcast=Dt(e),this._createConversionHelpers({name:"downcast",dispatchers:this._downcast,isDowncast:!0}),this._upcast=Dt(t),this._createConversionHelpers({name:"upcast",dispatchers:this._upcast,isDowncast:!1})}addAlias(e,t){const i=this._downcast.includes(t);if(!this._upcast.includes(t)&&!i)throw new A("conversion-add-alias-dispatcher-not-registered",this);this._createConversionHelpers({name:e,dispatchers:[t],isDowncast:i})}for(e){if(!this._helpers.has(e))throw new A("conversion-for-unknown-group",this);return this._helpers.get(e)}elementToElement(e){this.for("downcast").elementToElement(e);for(const{model:t,view:i}of Ul(e))this.for("upcast").elementToElement({model:t,view:i,converterPriority:e.converterPriority})}attributeToElement(e){this.for("downcast").attributeToElement(e);for(const{model:t,view:i}of Ul(e))this.for("upcast").elementToAttribute({view:i,model:t,converterPriority:e.converterPriority})}attributeToAttribute(e){this.for("downcast").attributeToAttribute(e);for(const{model:t,view:i}of Ul(e))this.for("upcast").attributeToAttribute({view:i,model:t})}_createConversionHelpers({name:e,dispatchers:t,isDowncast:i}){if(this._helpers.has(e))throw new A("conversion-group-exists",this);const n=i?new Ka(t):new gl(t);this._helpers.set(e,n)}}function*Ul(e){if(e.model.values)for(const t of e.model.values){const i={key:e.model.key,value:t},n=e.view[t],o=e.upcastAlso?e.upcastAlso[t]:void 0;yield*Hl(i,n,o)}else yield*Hl(e.model,e.view,e.upcastAlso)}function*Hl(e,t,i){if(yield{model:e,view:t},i)for(const t of Dt(i))yield{model:e,view:t}}class Wl{baseVersion;isDocumentOperation;batch;constructor(e){this.baseVersion=e,this.isDocumentOperation=null!==this.baseVersion,this.batch=null}_validate(){}toJSON(){const e=Object.assign({},this);return e.__className=this.constructor.className,delete e.batch,delete e.isDocumentOperation,e}static get className(){return"Operation"}static fromJSON(e,t){return new this(e.baseVersion)}}function $l(e,t){const i=Gl(t),n=i.reduce((e,t)=>e+t.offsetSize,0),o=e.parent;Jl(e);const r=e.index;return o._insertChild(r,i),Yl(o,r+i.length),Yl(o,r),new _a(e,e.getShiftedBy(n))}function ql(e){if(!e.isFlat)throw new A("operation-utils-remove-range-not-flat",this);const t=e.start.parent;Jl(e.start),Jl(e.end);const i=t._removeChildren(e.start.index,e.end.index-e.start.index);return Yl(t,e.start.index),i}function Kl(e,t){if(!e.isFlat)throw new A("operation-utils-move-range-not-flat",this);const i=ql(e);return $l(t=t._getTransformedByDeletion(e.start,e.end.offset-e.start.offset),i)}function Gl(e){const t=[];!function e(i){if("string"==typeof i)t.push(new za(i));else if(i instanceof ua)t.push(new za(i.data,i.getAttributes()));else if(i instanceof Ia)t.push(i);else if(ie(i))for(const t of i)e(t);else{}}(e);for(let e=1;e<t.length;e++){const i=t[e],n=t[e-1];i instanceof za&&n instanceof za&&Ql(i,n)&&(t.splice(e-1,2,new za(n.data+i.data,n.getAttributes())),e--)}return t}function Yl(e,t){const i=e.getChild(t-1),n=e.getChild(t);if(i&&n&&i.is("$text")&&n.is("$text")&&Ql(i,n)){const o=new za(i.data+n.data,i.getAttributes());e._removeChildren(t-1,2),e._insertChild(t-1,o)}}function Jl(e){const t=e.textNode,i=e.parent;if(t){const n=e.offset-t.startOffset,o=t.index;i._removeChildren(o,1);const r=new za(t.data.substr(0,n),t.getAttributes()),s=new za(t.data.substr(n),t.getAttributes());i._insertChild(o,[r,s])}}function Ql(e,t){const i=e.getAttributes(),n=t.getAttributes();for(const e of i){if(e[1]!==t.getAttribute(e[0]))return!1;n.next()}return n.next().done}class Zl extends Wl{sourcePosition;howMany;targetPosition;constructor(e,t,i,n){super(n),this.sourcePosition=e.clone(),this.sourcePosition.stickiness="toNext",this.howMany=t,this.targetPosition=i.clone(),this.targetPosition.stickiness="toNone"}get type(){return this.targetPosition.root.rootName==this.sourcePosition.root.rootName?"move":"$graveyard"==this.targetPosition.root.rootName?"remove":"$graveyard"==this.sourcePosition.root.rootName?"reinsert":"move"}get affectedSelectable(){return[_a._createFromPositionAndShift(this.sourcePosition,this.howMany),_a._createFromPositionAndShift(this.targetPosition,0)]}clone(){return new Zl(this.sourcePosition,this.howMany,this.targetPosition,this.baseVersion)}getMovedRangeStart(){return this.targetPosition._getTransformedByDeletion(this.sourcePosition,this.howMany)}getReversed(){const e=this.sourcePosition._getTransformedByInsertion(this.targetPosition,this.howMany);return new Zl(this.getMovedRangeStart(),this.howMany,e,this.baseVersion+1)}_validate(){const e=this.sourcePosition.parent,t=this.targetPosition.parent,i=this.sourcePosition.offset,n=this.targetPosition.offset;if(i+this.howMany>e.maxOffset)throw new A("move-operation-nodes-do-not-exist",this);if(e===t&&i<n&&n<i+this.howMany)throw new A("move-operation-range-into-itself",this);if(this.sourcePosition.root==this.targetPosition.root&&"prefix"==te(this.sourcePosition.getParentPath(),this.targetPosition.getParentPath())){const e=this.sourcePosition.path.length-1;if(this.targetPosition.path[e]>=i&&this.targetPosition.path[e]<i+this.howMany)throw new A("move-operation-node-into-itself",this)}}_execute(){Kl(_a._createFromPositionAndShift(this.sourcePosition,this.howMany),this.targetPosition)}toJSON(){const e=super.toJSON();return e.sourcePosition=this.sourcePosition.toJSON(),e.targetPosition=this.targetPosition.toJSON(),e}static get className(){return"MoveOperation"}static fromJSON(e,t){const i=ga.fromJSON(e.sourcePosition,t),n=ga.fromJSON(e.targetPosition,t);return new this(i,e.howMany,n,e.baseVersion)}}class Xl extends Wl{position;nodes;shouldReceiveAttributes;constructor(e,t,i){super(i),this.position=e.clone(),this.position.stickiness="toNone",this.nodes=new Wa(Gl(t)),this.shouldReceiveAttributes=!1}get type(){return"insert"}get howMany(){return this.nodes.maxOffset}get affectedSelectable(){return this.position.clone()}clone(){const e=new Wa([...this.nodes].map(e=>e._clone(!0))),t=new Xl(this.position,e,this.baseVersion);return t.shouldReceiveAttributes=this.shouldReceiveAttributes,t}getReversed(){const e=this.position.root.document.graveyard,t=new ga(e,[0]);return new Zl(this.position,this.nodes.maxOffset,t,this.baseVersion+1)}_validate(){const e=this.position.parent;if(!e||e.maxOffset<this.position.offset)throw new A("insert-operation-position-invalid",this)}_execute(){const e=this.nodes;this.nodes=new Wa([...e].map(e=>e._clone(!0))),$l(this.position,e)}toJSON(){const e=super.toJSON();return e.position=this.position.toJSON(),e.nodes=this.nodes.toJSON(),e}static get className(){return"InsertOperation"}static fromJSON(e,t){const i=[];for(const t of e.nodes)t.name?i.push($a.fromJSON(t)):i.push(za.fromJSON(t));const n=new Xl(ga.fromJSON(e.position,t),i,e.baseVersion);return n.shouldReceiveAttributes=e.shouldReceiveAttributes,n}}class ec extends Wl{splitPosition;howMany;insertionPosition;graveyardPosition;constructor(e,t,i,n,o){super(o),this.splitPosition=e.clone(),this.splitPosition.stickiness="toNext",this.howMany=t,this.insertionPosition=i,this.graveyardPosition=n?n.clone():null,this.graveyardPosition&&(this.graveyardPosition.stickiness="toNext")}get type(){return"split"}get moveTargetPosition(){const e=this.insertionPosition.path.slice();return e.push(0),new ga(this.insertionPosition.root,e)}get movedRange(){const e=this.splitPosition.getShiftedBy(Number.POSITIVE_INFINITY);return new _a(this.splitPosition,e)}get affectedSelectable(){const e=[_a._createFromPositionAndShift(this.splitPosition,0),_a._createFromPositionAndShift(this.insertionPosition,0)];return this.graveyardPosition&&e.push(_a._createFromPositionAndShift(this.graveyardPosition,0)),e}clone(){return new ec(this.splitPosition,this.howMany,this.insertionPosition,this.graveyardPosition,this.baseVersion)}getReversed(){const e=this.splitPosition.root.document.graveyard,t=new ga(e,[0]);return new tc(this.moveTargetPosition,this.howMany,this.splitPosition,t,this.baseVersion+1)}_validate(){const e=this.splitPosition.parent,t=this.splitPosition.offset;if(!e||e.maxOffset<t)throw new A("split-operation-position-invalid",this);if(!e.parent)throw new A("split-operation-split-in-root",this);if(this.howMany!==Number.NEGATIVE_INFINITY&&this.howMany!=e.maxOffset-this.splitPosition.offset)throw new A("split-operation-how-many-invalid",this);if(this.graveyardPosition&&!this.graveyardPosition.nodeAfter)throw new A("split-operation-graveyard-position-invalid",this);this.howMany=this.splitPosition.parent.maxOffset-this.splitPosition.offset}_execute(){const e=this.splitPosition.parent;if(this.graveyardPosition)Kl(_a._createFromPositionAndShift(this.graveyardPosition,1),this.insertionPosition);else{const t=e._clone();$l(this.insertionPosition,t)}Kl(new _a(ga._createAt(e,this.splitPosition.offset),ga._createAt(e,e.maxOffset)),this.moveTargetPosition)}toJSON(){const e=super.toJSON();return e.splitPosition=this.splitPosition.toJSON(),e.insertionPosition=this.insertionPosition.toJSON(),this.graveyardPosition&&(e.graveyardPosition=this.graveyardPosition.toJSON()),e}static get className(){return"SplitOperation"}static getInsertionPosition(e){const t=e.path.slice(0,-1);return t[t.length-1]++,new ga(e.root,t,"toPrevious")}static fromJSON(e,t){const i=ga.fromJSON(e.splitPosition,t),n=ga.fromJSON(e.insertionPosition,t),o=e.graveyardPosition?ga.fromJSON(e.graveyardPosition,t):null;return new this(i,e.howMany,n,o,e.baseVersion)}}class tc extends Wl{sourcePosition;howMany;targetPosition;graveyardPosition;constructor(e,t,i,n,o){super(o),this.sourcePosition=e.clone(),this.sourcePosition.stickiness="toPrevious",this.howMany=t,this.targetPosition=i.clone(),this.targetPosition.stickiness="toNext",this.graveyardPosition=n.clone()}get type(){return"merge"}get deletionPosition(){return new ga(this.sourcePosition.root,this.sourcePosition.path.slice(0,-1))}get movedRange(){const e=this.sourcePosition.getShiftedBy(Number.POSITIVE_INFINITY);return new _a(this.sourcePosition,e)}get affectedSelectable(){const e=this.sourcePosition.parent;return[_a._createOn(e),_a._createFromPositionAndShift(this.targetPosition,0),_a._createFromPositionAndShift(this.graveyardPosition,0)]}clone(){return new tc(this.sourcePosition,this.howMany,this.targetPosition,this.graveyardPosition,this.baseVersion)}getReversed(){const e=this.targetPosition._getTransformedByMergeOperation(this),t=this.sourcePosition.path.slice(0,-1),i=new ga(this.sourcePosition.root,t)._getTransformedByMergeOperation(this);return new ec(e,this.howMany,i,this.graveyardPosition,this.baseVersion+1)}_validate(){const e=this.sourcePosition.parent,t=this.targetPosition.parent;if(!e.parent)throw new A("merge-operation-source-position-invalid",this);if(!t.parent)throw new A("merge-operation-target-position-invalid",this);if(this.howMany!==Number.NEGATIVE_INFINITY&&this.howMany!=e.maxOffset)throw new A("merge-operation-how-many-invalid",this);this.howMany=this.sourcePosition.parent.maxOffset}_execute(){const e=this.sourcePosition.parent;Kl(_a._createIn(e),this.targetPosition),Kl(_a._createOn(e),this.graveyardPosition)}toJSON(){const e=super.toJSON();return e.sourcePosition=e.sourcePosition.toJSON(),e.targetPosition=e.targetPosition.toJSON(),e.graveyardPosition=e.graveyardPosition.toJSON(),e}static get className(){return"MergeOperation"}static fromJSON(e,t){const i=ga.fromJSON(e.sourcePosition,t),n=ga.fromJSON(e.targetPosition,t),o=ga.fromJSON(e.graveyardPosition,t);return new this(i,e.howMany,n,o,e.baseVersion)}}class ic extends Wl{name;oldRange;newRange;affectsData;_markers;constructor(e,t,i,n,o,r){super(r),this.name=e,this.oldRange=t?t.clone():null,this.newRange=i?i.clone():null,this.affectsData=o,this._markers=n}get type(){return"marker"}get affectedSelectable(){const e=[];return this.oldRange&&e.push(this.oldRange.clone()),this.newRange&&(this.oldRange?e.push(...this.newRange.getDifference(this.oldRange)):e.push(this.newRange.clone())),e}clone(){return new ic(this.name,this.oldRange,this.newRange,this._markers,this.affectsData,this.baseVersion)}getReversed(){return new ic(this.name,this.newRange,this.oldRange,this._markers,this.affectsData,this.baseVersion+1)}_execute(){this.newRange?this._markers._set(this.name,this.newRange,!0,this.affectsData):this._markers._remove(this.name)}toJSON(){const e=super.toJSON();return this.oldRange&&(e.oldRange=this.oldRange.toJSON()),this.newRange&&(e.newRange=this.newRange.toJSON()),delete e._markers,e}static get className(){return"MarkerOperation"}static fromJSON(e,t){return new ic(e.name,e.oldRange?_a.fromJSON(e.oldRange,t):null,e.newRange?_a.fromJSON(e.newRange,t):null,t.model.markers,e.affectsData,e.baseVersion)}}function nc(e,t){return Ys(e,t,Ht)}class oc extends Wl{range;key;oldValue;newValue;constructor(e,t,i,n,o){super(o),this.range=e.clone(),this.key=t,this.oldValue=void 0===i?null:i,this.newValue=void 0===n?null:n}get type(){return null===this.oldValue?"addAttribute":null===this.newValue?"removeAttribute":"changeAttribute"}get affectedSelectable(){return this.range.clone()}clone(){return new oc(this.range,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new oc(this.range,this.key,this.newValue,this.oldValue,this.baseVersion+1)}toJSON(){const e=super.toJSON();return e.range=this.range.toJSON(),e}_validate(){if(!this.range.isFlat)throw new A("attribute-operation-range-not-flat",this);for(const e of this.range.getItems({shallow:!0})){if(null!==this.oldValue&&!nc(e.getAttribute(this.key),this.oldValue))throw new A("attribute-operation-wrong-old-value",this,{item:e,key:this.key,value:this.oldValue});if(null===this.oldValue&&null!==this.newValue&&e.hasAttribute(this.key))throw new A("attribute-operation-attribute-exists",this,{node:e,key:this.key})}}_execute(){nc(this.oldValue,this.newValue)||function(e,t,i){Jl(e.start),Jl(e.end);for(const n of e.getItems({shallow:!0})){const e=n.is("$textProxy")?n.textNode:n;null!==i?e._setAttribute(t,i):e._removeAttribute(t),Yl(e.parent,e.index)}Yl(e.end.parent,e.end.index)}(this.range,this.key,this.newValue)}static get className(){return"AttributeOperation"}static fromJSON(e,t){return new oc(_a.fromJSON(e.range,t),e.key,e.oldValue,e.newValue,e.baseVersion)}}class rc extends Wl{get type(){return"noop"}get affectedSelectable(){return null}clone(){return new rc(this.baseVersion)}getReversed(){return new rc(this.baseVersion+1)}_execute(){}static get className(){return"NoOperation"}}class sc extends Wl{position;oldName;newName;constructor(e,t,i,n){super(n),this.position=e,this.position.stickiness="toNext",this.oldName=t,this.newName=i}get type(){return"rename"}get affectedSelectable(){return this.position.nodeAfter}clone(){return new sc(this.position.clone(),this.oldName,this.newName,this.baseVersion)}getReversed(){return new sc(this.position.clone(),this.newName,this.oldName,this.baseVersion+1)}_validate(){const e=this.position.nodeAfter;if(!(e instanceof $a))throw new A("rename-operation-wrong-position",this);if(""!==this.oldName&&e.name!==this.oldName)throw new A("rename-operation-wrong-name",this);this.oldName=e.name}_execute(){this.position.nodeAfter.name=this.newName}toJSON(){const e=super.toJSON();return e.position=this.position.toJSON(),e}static get className(){return"RenameOperation"}static fromJSON(e,t){return new sc(ga.fromJSON(e.position,t),e.oldName,e.newName,e.baseVersion)}}class ac extends Wl{root;key;oldValue;newValue;constructor(e,t,i,n,o){super(o),this.root=e,this.key=t,this.oldValue=void 0===i?null:i,this.newValue=void 0===n?null:n}get type(){return null===this.oldValue?"addRootAttribute":null===this.newValue?"removeRootAttribute":"changeRootAttribute"}get affectedSelectable(){return this.root}clone(){return new ac(this.root,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new ac(this.root,this.key,this.newValue,this.oldValue,this.baseVersion+1)}_validate(){if(this.root!=this.root.root||this.root.is("documentFragment"))throw new A("rootattribute-operation-not-a-root",this,{root:this.root,key:this.key});if(null!==this.oldValue&&this.root.getAttribute(this.key)!==this.oldValue)throw new A("rootattribute-operation-wrong-old-value",this,{root:this.root,key:this.key});if(null===this.oldValue&&null!==this.newValue&&this.root.hasAttribute(this.key))throw new A("rootattribute-operation-attribute-exists",this,{root:this.root,key:this.key})}_execute(){null!==this.newValue?this.root._setAttribute(this.key,this.newValue):this.root._removeAttribute(this.key)}toJSON(){const e=super.toJSON();return e.root=this.root.toJSON(),e}static get className(){return"RootAttributeOperation"}static fromJSON(e,t){if(!t.getRoot(e.root))throw new A("rootattribute-operation-fromjson-no-root",this,{rootName:e.root});return new ac(t.getRoot(e.root),e.key,e.oldValue,e.newValue,e.baseVersion)}}class lc extends Wl{rootName;elementName;isAdd;_document;constructor(e,t,i,n,o){if(super(o),this.rootName=e,this.elementName=t,this.isAdd=i,this._document=n,!this._document.getRoot(this.rootName)){this._document.createRoot(this.elementName,this.rootName)._isAttached=!1}}get type(){return this.isAdd?"addRoot":"detachRoot"}get affectedSelectable(){return this._document.getRoot(this.rootName)}clone(){return new lc(this.rootName,this.elementName,this.isAdd,this._document,this.baseVersion)}getReversed(){return new lc(this.rootName,this.elementName,!this.isAdd,this._document,this.baseVersion+1)}_execute(){this._document.getRoot(this.rootName)._isAttached=this.isAdd}toJSON(){const e=super.toJSON();return delete e._document,e}static get className(){return"RootOperation"}static fromJSON(e,t){return new lc(e.rootName,e.elementName,e.isAdd,t,e.baseVersion)}}const cc={};cc[oc.className]=oc,cc[Xl.className]=Xl,cc[ic.className]=ic,cc[Zl.className]=Zl,cc[rc.className]=rc,cc[Wl.className]=Wl,cc[sc.className]=sc,cc[ac.className]=ac,cc[lc.className]=lc,cc[ec.className]=ec,cc[tc.className]=tc;class dc{static fromJSON(e,t){return cc[e.__className].fromJSON(e,t)}}const uc=new Map;function hc(e,t,i){let n=uc.get(e);n||(n=new Map,uc.set(e,n)),n.set(t,i)}function mc(e){return[e]}function gc(e,t,i={}){const n=function(e,t){const i=uc.get(e);return i&&i.has(t)?i.get(t):mc}(e.constructor,t.constructor);try{return n(e=e.clone(),t,i)}catch(e){throw e}}function fc(e,t,i){e=e.slice(),t=t.slice();const n=new pc(i.document,i.useRelations,i.forceWeakRemove);n.setOriginalOperations(e),n.setOriginalOperations(t);const o=n.originalOperations;if(0==e.length||0==t.length)return{operationsA:e,operationsB:t,originalOperations:o};const r=new WeakMap;for(const t of e)r.set(t,0);const s={nextBaseVersionA:e[e.length-1].baseVersion+1,nextBaseVersionB:t[t.length-1].baseVersion+1,originalOperationsACount:e.length,originalOperationsBCount:t.length};let a=0;for(;a<e.length;){const i=e[a],o=r.get(i);if(o==t.length){a++;continue}const s=t[o],l=gc(i,s,n.getContext(i,s,!0)),c=gc(s,i,n.getContext(s,i,!1));n.updateRelation(i,s),n.setOriginalOperations(l,i),n.setOriginalOperations(c,s);for(const e of l)r.set(e,o+c.length);e.splice(a,1,...l),t.splice(o,1,...c)}if(wc(e),wc(t),i.padWithNoOps){const i=e.length-s.originalOperationsACount,n=t.length-s.originalOperationsBCount;kc(e,n-i),kc(t,i-n)}return bc(e,s.nextBaseVersionB),bc(t,s.nextBaseVersionA),{operationsA:e,operationsB:t,originalOperations:o}}class pc{originalOperations;_history;_useRelations;_forceWeakRemove;_relations;constructor(e,t,i=!1){this.originalOperations=new Map,this._history=e.history,this._useRelations=t,this._forceWeakRemove=!!i,this._relations=new Map}setOriginalOperations(e,t=null){const i=t?this.originalOperations.get(t):null;for(const t of e)this.originalOperations.set(t,i||t)}updateRelation(e,t){if(e instanceof Zl)t instanceof tc?e.targetPosition.isEqual(t.sourcePosition)||t.movedRange.containsPosition(e.targetPosition)?this._setRelation(e,t,"insertAtSource"):e.targetPosition.isEqual(t.deletionPosition)?this._setRelation(e,t,"insertBetween"):e.targetPosition.isAfter(t.sourcePosition)?this._setRelation(e,t,"moveTargetAfter"):e.howMany>1&&e.sourcePosition.isEqual(t.deletionPosition)?this._setRelation(e,t,"firstToMoveMerged"):e.howMany>1&&e.sourcePosition.getShiftedBy(e.howMany-1).isEqual(t.deletionPosition)&&this._setRelation(e,t,"lastToMoveMerged"):t instanceof Zl&&(e.targetPosition.isEqual(t.sourcePosition)||e.targetPosition.isBefore(t.sourcePosition)?this._setRelation(e,t,"insertBefore"):this._setRelation(e,t,"insertAfter"));else if(e instanceof ec){if(t instanceof tc)e.splitPosition.isBefore(t.sourcePosition)&&this._setRelation(e,t,"splitBefore");else if(t instanceof Zl)if(e.splitPosition.isEqual(t.sourcePosition)||e.splitPosition.isBefore(t.sourcePosition))this._setRelation(e,t,"splitBefore");else{const i=_a._createFromPositionAndShift(t.sourcePosition,t.howMany);if(e.splitPosition.hasSameParentAs(t.sourcePosition)&&i.containsPosition(e.splitPosition)){const n=i.end.offset-e.splitPosition.offset,o=e.splitPosition.offset-i.start.offset;this._setRelation(e,t,{howMany:n,offset:o})}}}else if(e instanceof tc)t instanceof tc?(e.targetPosition.isEqual(t.sourcePosition)||this._setRelation(e,t,"mergeTargetNotMoved"),e.sourcePosition.isEqual(t.targetPosition)&&this._setRelation(e,t,"mergeSourceNotMoved"),e.sourcePosition.isEqual(t.sourcePosition)&&this._setRelation(e,t,"mergeSameElement")):t instanceof ec?e.sourcePosition.isEqual(t.splitPosition)&&this._setRelation(e,t,"splitAtSource"):t instanceof Zl&&t.howMany>0&&(e.sourcePosition.isEqual(t.sourcePosition.getShiftedBy(t.howMany))&&this._setRelation(e,t,"mergeSourceAffected"),e.targetPosition.isEqual(t.sourcePosition)&&this._setRelation(e,t,"mergeTargetWasBefore"));else if(e instanceof ic){const i=e.newRange;if(!i)return;if(t instanceof tc){const n=i.start.isEqual(t.targetPosition),o=i.start.isEqual(t.deletionPosition),r=i.end.isEqual(t.deletionPosition),s=i.end.isEqual(t.sourcePosition);(n||o||r||s)&&this._setRelation(e,t,{wasInLeftElement:n,wasStartBeforeMergedElement:o,wasEndBeforeMergedElement:r,wasInRightElement:s})}}}getContext(e,t,i){return{aIsStrong:i,aWasUndone:this._wasUndone(e),bWasUndone:this._wasUndone(t),abRelation:this._useRelations?this._getRelation(e,t):null,baRelation:this._useRelations?this._getRelation(t,e):null,forceWeakRemove:this._forceWeakRemove}}_wasUndone(e){const t=this.originalOperations.get(e);return t.wasUndone||this._history.isUndoneOperation(t)}_getRelation(e,t){const i=this.originalOperations.get(t),n=this._history.getUndoneOperation(i);if(!n)return null;const o=this.originalOperations.get(e),r=this._relations.get(o);return r&&r.get(n)||null}_setRelation(e,t,i){const n=this.originalOperations.get(e),o=this.originalOperations.get(t);let r=this._relations.get(n);r||(r=new Map,this._relations.set(n,r)),r.set(o,i)}}function bc(e,t){for(const i of e)i.baseVersion=t++}function kc(e,t){for(let i=0;i<t;i++)e.push(new rc(0))}function wc(e){const t=new Map;for(let i=0;i<e.length;i++){const n=e[i];n instanceof ic&&(-1!==n.baseVersion?t.set(n.name,{op:n,ranges:n.newRange?[n.newRange]:[]}):(n.newRange&&t.get(n.name).ranges.push(n.newRange),e.splice(i,1),i--))}for(const{op:e,ranges:i}of t.values())i.length?e.newRange=_a._createFromRanges(i):e.newRange=null}function _c(e,t,i){const n=e.nodes.getNode(0).getAttribute(t);if(n==i)return null;const o=new _a(e.position,e.position.getShiftedBy(e.howMany));return new oc(o,t,n,i,0)}function vc(e,t){return null===e.targetPosition._getTransformedByDeletion(t.sourcePosition,t.howMany)}function yc(e,t){const i=[];for(let n=0;n<e.length;n++){const o=e[n],r=new Zl(o.start,o.end.offset-o.start.offset,t,0);i.push(r);for(let t=n+1;t<e.length;t++)e[t]=e[t]._getTransformedByMove(r.sourcePosition,r.targetPosition,r.howMany)[0];t=t._getTransformedByMove(r.sourcePosition,r.targetPosition,r.howMany)}return i}hc(oc,oc,(e,t,i)=>{if(e.key===t.key&&e.range.start.hasSameParentAs(t.range.start)){const n=e.range.getDifference(t.range).map(t=>new oc(t,e.key,e.oldValue,e.newValue,0)),o=e.range.getIntersection(t.range);return o&&i.aIsStrong&&n.push(new oc(o,t.key,t.newValue,e.newValue,0)),0==n.length?[new rc(0)]:n}return[e]}),hc(oc,Xl,(e,t)=>{if(e.range.start.hasSameParentAs(t.position)&&e.range.containsPosition(t.position)){const i=e.range._getTransformedByInsertion(t.position,t.howMany,!t.shouldReceiveAttributes).map(t=>new oc(t,e.key,e.oldValue,e.newValue,e.baseVersion));if(t.shouldReceiveAttributes){const n=_c(t,e.key,e.oldValue);n&&i.unshift(n)}return i}return e.range=e.range._getTransformedByInsertion(t.position,t.howMany,!1)[0],[e]}),hc(oc,tc,(e,t)=>{const i=[];e.range.start.hasSameParentAs(t.deletionPosition)&&(e.range.containsPosition(t.deletionPosition)||e.range.start.isEqual(t.deletionPosition))&&i.push(_a._createFromPositionAndShift(t.graveyardPosition,1));const n=e.range._getTransformedByMergeOperation(t);return n.isCollapsed||i.push(n),i.map(t=>new oc(t,e.key,e.oldValue,e.newValue,e.baseVersion))}),hc(oc,Zl,(e,t)=>{const i=function(e,t){const i=_a._createFromPositionAndShift(t.sourcePosition,t.howMany);let n=null,o=[];i.containsRange(e,!0)?n=e:e.start.hasSameParentAs(i.start)?(o=e.getDifference(i),n=e.getIntersection(i)):o=[e];const r=[];for(let e of o){e=e._getTransformedByDeletion(t.sourcePosition,t.howMany);const i=t.getMovedRangeStart(),n=e.start.hasSameParentAs(i),o=e._getTransformedByInsertion(i,t.howMany,n);r.push(...o)}n&&r.push(n._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany,!1)[0]);return r}(e.range,t);return i.map(t=>new oc(t,e.key,e.oldValue,e.newValue,e.baseVersion))}),hc(oc,ec,(e,t)=>{if(e.range.end.isEqual(t.insertionPosition))return t.graveyardPosition||e.range.end.offset++,[e];if(e.range.start.hasSameParentAs(t.splitPosition)&&e.range.containsPosition(t.splitPosition)){const i=e.clone();return i.range=new _a(t.moveTargetPosition.clone(),e.range.end._getCombined(t.splitPosition,t.moveTargetPosition)),e.range.end=t.splitPosition.clone(),e.range.end.stickiness="toPrevious",[e,i]}return e.range=e.range._getTransformedBySplitOperation(t),[e]}),hc(Xl,oc,(e,t)=>{const i=[e];if(e.shouldReceiveAttributes&&e.position.hasSameParentAs(t.range.start)&&t.range.containsPosition(e.position)){const n=_c(e,t.key,t.newValue);n&&i.push(n)}return i}),hc(Xl,Xl,(e,t,i)=>(e.position.isEqual(t.position)&&i.aIsStrong||(e.position=e.position._getTransformedByInsertOperation(t)),[e])),hc(Xl,Zl,(e,t)=>(e.position=e.position._getTransformedByMoveOperation(t),[e])),hc(Xl,ec,(e,t)=>(e.position=e.position._getTransformedBySplitOperation(t),[e])),hc(Xl,tc,(e,t)=>(e.position=e.position._getTransformedByMergeOperation(t),[e])),hc(ic,Xl,(e,t)=>(e.oldRange&&(e.oldRange=e.oldRange._getTransformedByInsertOperation(t)[0]),e.newRange&&(e.newRange=e.newRange._getTransformedByInsertOperation(t)[0]),[e])),hc(ic,ic,(e,t,i)=>{if(e.name==t.name){if(!i.aIsStrong)return[new rc(0)];e.oldRange=t.newRange?t.newRange.clone():null}return[e]}),hc(ic,tc,(e,t)=>(e.oldRange&&(e.oldRange=e.oldRange._getTransformedByMergeOperation(t)),e.newRange&&(e.newRange=e.newRange._getTransformedByMergeOperation(t)),[e])),hc(ic,Zl,(e,t)=>{const i=[e];if(e.oldRange&&(e.oldRange=_a._createFromRanges(e.oldRange._getTransformedByMoveOperation(t))),e.newRange){const n=e.newRange._getTransformedByMoveOperation(t);e.newRange=n[0];for(let t=1;t<n.length;t++){const o=e.clone();o.oldRange=null,o.newRange=n[t],o.baseVersion=-1,i.push(o)}}return i}),hc(ic,ec,(e,t,i)=>{if(e.oldRange&&(e.oldRange=e.oldRange._getTransformedBySplitOperation(t)),e.newRange){if(i.abRelation){const n=e.newRange._getTransformedBySplitOperation(t);return e.newRange.start.isEqual(t.splitPosition)?i.abRelation.wasStartBeforeMergedElement?e.newRange.start=ga._createAt(t.insertionPosition):i.abRelation.wasInLeftElement?e.newRange.start=ga._createAt(e.newRange.start):e.newRange.start=ga._createAt(t.moveTargetPosition):e.newRange.start=n.start,e.newRange.end.isEqual(t.splitPosition)?e.newRange.end.isEqual(t.splitPosition)&&i.abRelation.wasEndBeforeMergedElement?e.newRange.end=ga._createAt(t.insertionPosition):i.abRelation.wasInRightElement?e.newRange.end=ga._createAt(t.moveTargetPosition):e.newRange.end=ga._createAt(e.newRange.end):e.newRange.end=n.end,[e]}e.newRange=e.newRange._getTransformedBySplitOperation(t)}return[e]}),hc(tc,Xl,(e,t)=>(e.sourcePosition.hasSameParentAs(t.position)&&(e.howMany+=t.howMany),e.sourcePosition=e.sourcePosition._getTransformedByInsertOperation(t),e.targetPosition=e.targetPosition._getTransformedByInsertOperation(t),[e])),hc(tc,tc,(e,t,i)=>{if(e.sourcePosition.isEqual(t.sourcePosition)&&e.targetPosition.isEqual(t.targetPosition)){if(i.bWasUndone){const i=t.graveyardPosition.path.slice();return i.push(0),e.sourcePosition=new ga(t.graveyardPosition.root,i),e.howMany=0,[e]}return[new rc(0)]}if(e.sourcePosition.isEqual(t.sourcePosition)&&!e.targetPosition.isEqual(t.targetPosition)&&!i.bWasUndone&&"splitAtSource"!=i.abRelation){const n="$graveyard"==e.targetPosition.root.rootName,o="$graveyard"==t.targetPosition.root.rootName;if(o&&!n||!(n&&!o)&&i.aIsStrong){const i=t.targetPosition._getTransformedByMergeOperation(t),n=e.targetPosition._getTransformedByMergeOperation(t);return[new Zl(i,e.howMany,n,0)]}return[new rc(0)]}return e.sourcePosition.hasSameParentAs(t.targetPosition)&&(e.howMany+=t.howMany),e.sourcePosition=e.sourcePosition._getTransformedByMergeOperation(t),e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),e.graveyardPosition.isEqual(t.graveyardPosition)&&i.aIsStrong||(e.graveyardPosition=e.graveyardPosition._getTransformedByMergeOperation(t)),[e]}),hc(tc,Zl,(e,t,i)=>{const n=_a._createFromPositionAndShift(t.sourcePosition,t.howMany);return"remove"==t.type&&!i.bWasUndone&&e.deletionPosition.hasSameParentAs(t.sourcePosition)&&n.containsPosition(e.sourcePosition)?[new rc(0)]:(t.sourcePosition.getShiftedBy(t.howMany).isEqual(e.sourcePosition)?e.sourcePosition.stickiness="toNone":t.targetPosition.isEqual(e.sourcePosition)&&"mergeSourceAffected"==i.abRelation?e.sourcePosition.stickiness="toNext":t.sourcePosition.isEqual(e.targetPosition)?(e.targetPosition.stickiness="toNone",e.howMany-=t.howMany):t.targetPosition.isEqual(e.targetPosition)&&"mergeTargetWasBefore"==i.abRelation?(e.targetPosition.stickiness="toPrevious",e.howMany+=t.howMany):(e.sourcePosition.hasSameParentAs(t.targetPosition)&&(e.howMany+=t.howMany),e.sourcePosition.hasSameParentAs(t.sourcePosition)&&(e.howMany-=t.howMany)),e.sourcePosition=e.sourcePosition._getTransformedByMoveOperation(t),e.targetPosition=e.targetPosition._getTransformedByMoveOperation(t),e.sourcePosition.stickiness="toPrevious",e.targetPosition.stickiness="toNext",e.graveyardPosition.isEqual(t.targetPosition)||(e.graveyardPosition=e.graveyardPosition._getTransformedByMoveOperation(t)),[e])}),hc(tc,ec,(e,t,i)=>{if(t.graveyardPosition&&(e.graveyardPosition=e.graveyardPosition._getTransformedByDeletion(t.graveyardPosition,1),e.deletionPosition.isEqual(t.graveyardPosition)&&(e.howMany=t.howMany)),e.targetPosition.isEqual(t.splitPosition)){if(t.graveyardPosition&&e.deletionPosition.isEqual(t.graveyardPosition)||"mergeTargetNotMoved"==i.abRelation)return e.sourcePosition=e.sourcePosition._getTransformedBySplitOperation(t),[e]}if(e.sourcePosition.isEqual(t.splitPosition)){if("mergeSourceNotMoved"==i.abRelation)return e.howMany=0,e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e];if("mergeSameElement"==i.abRelation||e.sourcePosition.offset>0)return e.sourcePosition=t.moveTargetPosition.clone(),e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e]}return e.sourcePosition.hasSameParentAs(t.splitPosition)&&(e.howMany=t.splitPosition.offset),e.sourcePosition=e.sourcePosition._getTransformedBySplitOperation(t),e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e]}),hc(Zl,Xl,(e,t)=>{const i=_a._createFromPositionAndShift(e.sourcePosition,e.howMany)._getTransformedByInsertOperation(t,!1)[0];return e.sourcePosition=i.start,e.howMany=i.end.offset-i.start.offset,e.targetPosition.isEqual(t.position)||(e.targetPosition=e.targetPosition._getTransformedByInsertOperation(t)),[e]}),hc(Zl,Zl,(e,t,i)=>{const n=_a._createFromPositionAndShift(e.sourcePosition,e.howMany),o=_a._createFromPositionAndShift(t.sourcePosition,t.howMany);let r,s=i.aIsStrong,a=!i.aIsStrong;if("insertBefore"==i.abRelation||"insertAfter"==i.baRelation?a=!0:"insertAfter"!=i.abRelation&&"insertBefore"!=i.baRelation||(a=!1),r=e.targetPosition.isEqual(t.targetPosition)&&a?e.targetPosition._getTransformedByDeletion(t.sourcePosition,t.howMany):e.targetPosition._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),vc(e,t)&&vc(t,e))return[t.getReversed()];if(n.containsPosition(t.targetPosition)&&n.containsRange(o,!0))return n.start=n.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),n.end=n.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),yc([n],r);if(o.containsPosition(e.targetPosition)&&o.containsRange(n,!0))return n.start=n.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),n.end=n.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),yc([n],r);const l=te(e.sourcePosition.getParentPath(),t.sourcePosition.getParentPath());if("prefix"==l||"extension"==l)return n.start=n.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),n.end=n.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),yc([n],r);"remove"!=e.type||"remove"==t.type||i.aWasUndone||i.forceWeakRemove?"remove"==e.type||"remove"!=t.type||i.bWasUndone||i.forceWeakRemove||(s=!1):s=!0;const c=[],d=n.getDifference(o);for(const e of d){e.start=e.start._getTransformedByDeletion(t.sourcePosition,t.howMany),e.end=e.end._getTransformedByDeletion(t.sourcePosition,t.howMany);const i="same"==te(e.start.getParentPath(),t.getMovedRangeStart().getParentPath()),n=e._getTransformedByInsertion(t.getMovedRangeStart(),t.howMany,i);c.push(...n)}const u=n.getIntersection(o);return null!==u&&s&&(u.start=u.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),u.end=u.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),0===c.length?c.push(u):1==c.length?o.start.isBefore(n.start)||o.start.isEqual(n.start)?c.unshift(u):c.push(u):c.splice(1,0,u)),0===c.length?[new rc(e.baseVersion)]:yc(c,r)}),hc(Zl,ec,(e,t,i)=>{let n=e.targetPosition.clone();if(e.targetPosition.isEqual(t.insertionPosition)&&t.graveyardPosition&&"moveTargetAfter"!=i.abRelation||(n=e.targetPosition._getTransformedBySplitOperation(t)),e.sourcePosition.isEqual(t.insertionPosition)&&"firstToMoveMerged"==i.abRelation)return e.howMany++,e.targetPosition=n,[e];const o=_a._createFromPositionAndShift(e.sourcePosition,e.howMany);if(o.end.isEqual(t.insertionPosition))return t.graveyardPosition&&"lastToMoveMerged"!=i.abRelation||e.howMany++,e.targetPosition=n,[e];if(o.start.hasSameParentAs(t.splitPosition)&&o.containsPosition(t.splitPosition)){let e=new _a(t.splitPosition,o.end);e=e._getTransformedBySplitOperation(t);return yc([new _a(o.start,t.splitPosition),e],n)}e.targetPosition.isEqual(t.splitPosition)&&"insertAtSource"==i.abRelation&&(n=t.moveTargetPosition),e.targetPosition.isEqual(t.insertionPosition)&&"insertBetween"==i.abRelation&&(n=e.targetPosition);const r=[o._getTransformedBySplitOperation(t)];if(t.graveyardPosition){const n=o.start.isEqual(t.graveyardPosition)||o.containsPosition(t.graveyardPosition);e.howMany>1&&n&&!i.aWasUndone&&r.push(_a._createFromPositionAndShift(t.insertionPosition,1))}return yc(r,n)}),hc(Zl,tc,(e,t,i)=>{const n=_a._createFromPositionAndShift(e.sourcePosition,e.howMany);if(t.deletionPosition.hasSameParentAs(e.sourcePosition)&&n.containsPosition(t.sourcePosition))if("remove"!=e.type||i.forceWeakRemove){if(1==e.howMany)return i.bWasUndone?(e.sourcePosition=t.graveyardPosition.clone(),e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),[e]):[new rc(0)]}else if(!i.aWasUndone){const i=[];let n=t.graveyardPosition.clone(),o=t.targetPosition._getTransformedByMergeOperation(t);const r=e.targetPosition.getTransformedByOperation(t);e.howMany>1&&(i.push(new Zl(e.sourcePosition,e.howMany-1,r,0)),n=n._getTransformedByMove(e.sourcePosition,r,e.howMany-1),o=o._getTransformedByMove(e.sourcePosition,r,e.howMany-1));const s=t.deletionPosition._getCombined(e.sourcePosition,r),a=new Zl(n,1,s,0),l=a.getMovedRangeStart().path.slice();l.push(0);const c=new ga(a.targetPosition.root,l);o=o._getTransformedByMove(n,s,1);const d=new Zl(o,t.howMany,c,0);return i.push(a),i.push(d),i}const o=_a._createFromPositionAndShift(e.sourcePosition,e.howMany)._getTransformedByMergeOperation(t);return e.sourcePosition=o.start,e.howMany=o.end.offset-o.start.offset,e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),[e]}),hc(sc,Xl,(e,t)=>(e.position=e.position._getTransformedByInsertOperation(t),[e])),hc(sc,tc,(e,t)=>e.position.isEqual(t.deletionPosition)?(e.position=t.graveyardPosition.clone(),e.position.stickiness="toNext",[e]):(e.position=e.position._getTransformedByMergeOperation(t),[e])),hc(sc,Zl,(e,t)=>(e.position=e.position._getTransformedByMoveOperation(t),[e])),hc(sc,sc,(e,t,i)=>{if(e.position.isEqual(t.position)){if(!i.aIsStrong)return[new rc(0)];e.oldName=t.newName}return[e]}),hc(sc,ec,(e,t)=>{if("same"==te(e.position.path,t.splitPosition.getParentPath())&&!t.graveyardPosition){const t=new sc(e.position.getShiftedBy(1),e.oldName,e.newName,0);return[e,t]}return e.position=e.position._getTransformedBySplitOperation(t),[e]}),hc(ac,ac,(e,t,i)=>{if(e.root===t.root&&e.key===t.key){if(!i.aIsStrong)return[new rc(0)];e.oldValue=t.newValue}return[e]}),hc(lc,lc,(e,t)=>e.rootName===t.rootName&&e.isAdd===t.isAdd?[new rc(0)]:[e]),hc(ec,Xl,(e,t)=>(e.splitPosition.hasSameParentAs(t.position)&&e.splitPosition.offset<t.position.offset&&(e.howMany+=t.howMany),e.splitPosition=e.splitPosition._getTransformedByInsertOperation(t),e.insertionPosition=e.insertionPosition._getTransformedByInsertOperation(t),[e])),hc(ec,tc,(e,t,i)=>{if(!e.graveyardPosition&&!i.bWasUndone&&e.splitPosition.hasSameParentAs(t.sourcePosition)){const i=t.graveyardPosition.path.slice();i.push(0);const n=new ga(t.graveyardPosition.root,i),o=ec.getInsertionPosition(new ga(t.graveyardPosition.root,i)),r=new ec(n,0,o,null,0);return e.splitPosition=e.splitPosition._getTransformedByMergeOperation(t),e.insertionPosition=ec.getInsertionPosition(e.splitPosition),e.graveyardPosition=r.insertionPosition.clone(),e.graveyardPosition.stickiness="toNext",[r,e]}return e.splitPosition.hasSameParentAs(t.deletionPosition)&&!e.splitPosition.isAfter(t.deletionPosition)&&e.howMany--,e.splitPosition.hasSameParentAs(t.targetPosition)&&(e.howMany+=t.howMany),e.splitPosition=e.splitPosition._getTransformedByMergeOperation(t),e.insertionPosition=ec.getInsertionPosition(e.splitPosition),e.graveyardPosition&&(e.graveyardPosition=e.graveyardPosition._getTransformedByMergeOperation(t)),[e]}),hc(ec,Zl,(e,t,i)=>{const n=_a._createFromPositionAndShift(t.sourcePosition,t.howMany);if(e.graveyardPosition){const o=n.start.isEqual(e.graveyardPosition)||n.containsPosition(e.graveyardPosition);if(!i.bWasUndone&&o){const i=e.splitPosition._getTransformedByMoveOperation(t),n=e.graveyardPosition._getTransformedByMoveOperation(t),o=n.path.slice();o.push(0);const r=new ga(n.root,o);return[new Zl(i,e.howMany,r,0)]}e.graveyardPosition=e.graveyardPosition._getTransformedByMoveOperation(t)}const o=e.splitPosition.isEqual(t.targetPosition);if(o&&("insertAtSource"==i.baRelation||"splitBefore"==i.abRelation))return e.howMany+=t.howMany,e.splitPosition=e.splitPosition._getTransformedByDeletion(t.sourcePosition,t.howMany),e.insertionPosition=ec.getInsertionPosition(e.splitPosition),[e];if(o&&i.abRelation&&i.abRelation.howMany){const{howMany:t,offset:n}=i.abRelation;return e.howMany+=t,e.splitPosition=e.splitPosition.getShiftedBy(n),[e]}if(e.splitPosition.hasSameParentAs(t.sourcePosition)&&n.containsPosition(e.splitPosition)){const i=t.howMany-(e.splitPosition.offset-t.sourcePosition.offset);return e.howMany-=i,e.splitPosition.hasSameParentAs(t.targetPosition)&&e.splitPosition.offset<t.targetPosition.offset&&(e.howMany+=t.howMany),e.splitPosition=t.sourcePosition.clone(),e.insertionPosition=ec.getInsertionPosition(e.splitPosition),[e]}return t.sourcePosition.isEqual(t.targetPosition)||(e.splitPosition.hasSameParentAs(t.sourcePosition)&&e.splitPosition.offset<=t.sourcePosition.offset&&(e.howMany-=t.howMany),e.splitPosition.hasSameParentAs(t.targetPosition)&&e.splitPosition.offset<t.targetPosition.offset&&(e.howMany+=t.howMany)),e.splitPosition.stickiness="toNone",e.splitPosition=e.splitPosition._getTransformedByMoveOperation(t),e.splitPosition.stickiness="toNext",e.graveyardPosition?e.insertionPosition=e.insertionPosition._getTransformedByMoveOperation(t):e.insertionPosition=ec.getInsertionPosition(e.splitPosition),[e]}),hc(ec,ec,(e,t,i)=>{if(e.splitPosition.isEqual(t.splitPosition)){if(!e.graveyardPosition&&!t.graveyardPosition)return[new rc(0)];if(e.graveyardPosition&&t.graveyardPosition&&e.graveyardPosition.isEqual(t.graveyardPosition))return[new rc(0)];if("splitBefore"==i.abRelation)return e.howMany=0,e.graveyardPosition=e.graveyardPosition._getTransformedBySplitOperation(t),[e]}if(e.graveyardPosition&&t.graveyardPosition&&e.graveyardPosition.isEqual(t.graveyardPosition)){const n="$graveyard"==e.splitPosition.root.rootName,o="$graveyard"==t.splitPosition.root.rootName;if(o&&!n||!(n&&!o)&&i.aIsStrong){const i=[];return t.howMany&&i.push(new Zl(t.moveTargetPosition,t.howMany,t.splitPosition,0)),e.howMany&&i.push(new Zl(e.splitPosition,e.howMany,e.moveTargetPosition,0)),i}return[new rc(0)]}if(e.graveyardPosition&&(e.graveyardPosition=e.graveyardPosition._getTransformedBySplitOperation(t)),e.splitPosition.isEqual(t.insertionPosition)&&"splitBefore"==i.abRelation)return e.howMany++,[e];if(t.splitPosition.isEqual(e.insertionPosition)&&"splitBefore"==i.baRelation){const i=t.insertionPosition.path.slice();i.push(0);const n=new ga(t.insertionPosition.root,i);return[e,new Zl(e.insertionPosition,1,n,0)]}return e.splitPosition.hasSameParentAs(t.splitPosition)&&e.splitPosition.offset<t.splitPosition.offset&&(e.howMany-=t.howMany),e.splitPosition=e.splitPosition._getTransformedBySplitOperation(t),e.insertionPosition=ec.getInsertionPosition(e.splitPosition),[e]});class Ac extends(O(ga)){constructor(e,t,i="toNone"){if(super(e,t,i),!this.root.is("rootElement"))throw new A("model-liveposition-root-not-rootelement",e);xc.call(this)}detach(){this.stopListening()}toPosition(){return new ga(this.root,this.path.slice(),this.stickiness)}static fromPosition(e,t){return new this(e.root,e.path.slice(),t||e.stickiness)}}function xc(){this.listenTo(this.root.document.model,"applyOperation",(e,t)=>{const i=t[0];i.isDocumentOperation&&Cc.call(this,i)},{priority:"low"})}function Cc(e){const t=this.getTransformedByOperation(e);if(!this.isEqual(t)){const e=this.toPosition();this.path=t.path,this.root=t.root,this.fire("change",e)}}Ac.prototype.is=function(e){return"livePosition"===e||"model:livePosition"===e||"position"==e||"model:position"===e};class Tc{operations;isUndoable;isLocal;isUndo;isTyping;constructor(e={}){"string"==typeof e&&(e="transparent"===e?{isUndoable:!1}:{},x("batch-constructor-deprecated-string-type"));const{isUndoable:t=!0,isLocal:i=!0,isUndo:n=!1,isTyping:o=!1}=e;this.operations=[],this.isUndoable=t,this.isLocal=i,this.isUndo=n,this.isTyping=o}get baseVersion(){for(const e of this.operations)if(null!==e.baseVersion)return e.baseVersion;return null}addOperation(e){return e.isDocumentOperation&&(e.batch=this,this.operations.push(e)),e}}class Ec{static _statesPriority=[void 0,"refresh","rename","move"];_markerCollection;_changesInElement=new Map;_elementsSnapshots=new Map;_elementChildrenSnapshots=new Map;_elementState=new Map;_changedMarkers=new Map;_changedRoots=new Map;_changeCount=0;_cachedChanges=null;_cachedChangesWithGraveyard=null;_refreshedItems=new Set;constructor(e){this._markerCollection=e}get isEmpty(){return 0==this._changesInElement.size&&0==this._changedMarkers.size&&0==this._changedRoots.size}bufferOperation(e){const t=e;switch(t.type){case"insert":if(this._isInInsertedElement(t.position.parent))return;this._markInsert(t.position.parent,t.position.offset,t.nodes.maxOffset);break;case"addAttribute":case"removeAttribute":case"changeAttribute":for(const e of t.range.getItems({shallow:!0}))this._isInInsertedElement(e.parent)||this._markAttribute(e);break;case"remove":case"move":case"reinsert":{if(t.sourcePosition.isEqual(t.targetPosition)||t.sourcePosition.getShiftedBy(t.howMany).isEqual(t.targetPosition))return;const e=this._isInInsertedElement(t.sourcePosition.parent),i=this._isInInsertedElement(t.targetPosition.parent);e||this._markRemove(t.sourcePosition.parent,t.sourcePosition.offset,t.howMany),i||this._markInsert(t.targetPosition.parent,t.getMovedRangeStart().offset,t.howMany);const n=_a._createFromPositionAndShift(t.sourcePosition,t.howMany);for(const e of n.getItems({shallow:!0}))this._setElementState(e,"move");break}case"rename":{if(this._isInInsertedElement(t.position.parent))return;this._markRemove(t.position.parent,t.position.offset,1),this._markInsert(t.position.parent,t.position.offset,1);const e=_a._createFromPositionAndShift(t.position,1);for(const t of this._markerCollection.getMarkersIntersectingRange(e)){const e=t.getData();this.bufferMarkerChange(t.name,e,e)}this._setElementState(t.position.nodeAfter,"rename");break}case"split":{const e=t.splitPosition.parent;if(!this._isInInsertedElement(e)){this._markRemove(e,t.splitPosition.offset,t.howMany);const i=_a._createFromPositionAndShift(t.splitPosition,t.howMany);for(const e of i.getItems({shallow:!0}))this._setElementState(e,"move")}this._isInInsertedElement(t.insertionPosition.parent)||this._markInsert(t.insertionPosition.parent,t.insertionPosition.offset,1),t.graveyardPosition&&(this._markRemove(t.graveyardPosition.parent,t.graveyardPosition.offset,1),this._setElementState(t.graveyardPosition.nodeAfter,"move"));break}case"merge":{const e=t.sourcePosition.parent;this._isInInsertedElement(e.parent)||this._markRemove(e.parent,e.startOffset,1);const i=t.graveyardPosition.parent;this._markInsert(i,t.graveyardPosition.offset,1),this._setElementState(e,"move");const n=t.targetPosition.parent;if(!this._isInInsertedElement(n)){this._markInsert(n,t.targetPosition.offset,e.maxOffset);const i=_a._createFromPositionAndShift(t.sourcePosition,t.howMany);for(const e of i.getItems({shallow:!0}))this._setElementState(e,"move")}break}case"detachRoot":case"addRoot":{const e=t.affectedSelectable;if(!e._isLoaded)return;if(e.isAttached()==t.isAdd)return;this._bufferRootStateChange(t.rootName,t.isAdd);break}case"addRootAttribute":case"removeRootAttribute":case"changeRootAttribute":{if(!t.root._isLoaded)return;const e=t.root.rootName;this._bufferRootAttributeChange(e,t.key,t.oldValue,t.newValue);break}}this._cachedChanges=null}bufferMarkerChange(e,t,i){t.range&&t.range.root.is("rootElement")&&!t.range.root._isLoaded&&(t.range=null),i.range&&i.range.root.is("rootElement")&&!i.range.root._isLoaded&&(i.range=null);let n=this._changedMarkers.get(e);n?n.newMarkerData=i:(n={newMarkerData:i,oldMarkerData:t},this._changedMarkers.set(e,n)),null==n.oldMarkerData.range&&null==i.range&&this._changedMarkers.delete(e)}getMarkersToRemove(){const e=[];for(const[t,i]of this._changedMarkers)null!=i.oldMarkerData.range&&e.push({name:t,range:i.oldMarkerData.range});return e}getMarkersToAdd(){const e=[];for(const[t,i]of this._changedMarkers)null!=i.newMarkerData.range&&e.push({name:t,range:i.newMarkerData.range});return e}getChangedMarkers(){return Array.from(this._changedMarkers).map(([e,t])=>({name:e,data:{oldRange:t.oldMarkerData.range,newRange:t.newMarkerData.range}}))}hasDataChanges(){if(this.getChanges().length)return!0;if(this._changedRoots.size>0)return!0;for(const{newMarkerData:e,oldMarkerData:t}of this._changedMarkers.values()){if(e.affectsData!==t.affectsData)return!0;if(e.affectsData){const i=e.range&&!t.range,n=!e.range&&t.range,o=e.range&&t.range&&!e.range.isEqual(t.range);if(i||n||o)return!0}}return!1}getChanges(e={}){if(this._cachedChanges)return e.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice();let t=[];for(const e of this._changesInElement.keys()){const i=this._changesInElement.get(e).sort((e,t)=>e.offset===t.offset?e.type!=t.type?"remove"==e.type?-1:1:0:e.offset<t.offset?-1:1),n=this._elementChildrenSnapshots.get(e),o=Sc(e.getChildren()),r=Pc(n.length,i);let s=0,a=0;for(const i of r)if("i"===i){const i=this._getDiffActionForNode(o[s].node,"insert"),n=this._elementsSnapshots.get(o[s].node),r=this._getInsertDiff(e,s,i,o[s],n);t.push(r),s++}else if("r"===i){const i=this._getDiffActionForNode(n[a].node,"remove"),o=this._getRemoveDiff(e,s,i,n[a]);t.push(o),a++}else if("a"===i){const i=n[a].attributes,r=o[s].attributes;let l;if("$text"==o[s].name)l=new _a(ga._createAt(e,s),ga._createAt(e,s+1));else{const t=e.offsetToIndex(s);l=new _a(ga._createAt(e,s),ga._createAt(e.getChild(t),0))}const c=this._getAttributesDiff(l,i,r);t.push(...c),s++,a++}else s++,a++}t.sort((e,t)=>e.position.root!=t.position.root?e.position.root.rootName<t.position.root.rootName?-1:1:e.position.isEqual(t.position)?e.changeCount-t.changeCount:e.position.isBefore(t.position)?-1:1);for(let e=1,i=0;e<t.length;e++){const n=t[i],o=t[e],r="remove"==n.type&&"remove"==o.type&&"$text"==n.name&&"$text"==o.name&&n.position.isEqual(o.position),s="insert"==n.type&&"insert"==o.type&&"$text"==n.name&&"$text"==o.name&&n.position.parent==o.position.parent&&n.position.offset+n.length==o.position.offset,a="attribute"==n.type&&"attribute"==o.type&&n.position.parent==o.position.parent&&n.range.isFlat&&o.range.isFlat&&n.position.offset+n.length==o.position.offset&&n.attributeKey==o.attributeKey&&n.attributeOldValue==o.attributeOldValue&&n.attributeNewValue==o.attributeNewValue;r||s||a?(n.length++,a&&(n.range.end=n.range.end.getShiftedBy(1)),t[e]=null):i=e}t=t.filter(e=>e);for(const e of t)delete e.changeCount,"attribute"==e.type&&(delete e.position,delete e.length);return this._changeCount=0,this._cachedChangesWithGraveyard=t,this._cachedChanges=t.filter(Mc),e.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice()}getChangedRoots(){return Array.from(this._changedRoots.values()).map(e=>{const t={...e};return void 0!==t.state&&delete t.attributes,t})}getRefreshedItems(){return new Set(this._refreshedItems)}reset(){this._changesInElement.clear(),this._elementChildrenSnapshots.clear(),this._elementsSnapshots.clear(),this._elementState.clear(),this._changedMarkers.clear(),this._changedRoots.clear(),this._refreshedItems.clear(),this._cachedChanges=null}_refreshItem(e){if(this._isInInsertedElement(e.parent))return;this._markRemove(e.parent,e.startOffset,e.offsetSize),this._markInsert(e.parent,e.startOffset,e.offsetSize),this._refreshedItems.add(e),this._setElementState(e,"refresh");const t=_a._createOn(e);for(const e of this._markerCollection.getMarkersIntersectingRange(t)){const t=e.getData();this.bufferMarkerChange(e.name,t,t)}this._cachedChanges=null}_bufferRootLoad(e){if(e.isAttached()){this._bufferRootStateChange(e.rootName,!0),this._markInsert(e,0,e.maxOffset);for(const t of e.getAttributeKeys())this._bufferRootAttributeChange(e.rootName,t,null,e.getAttribute(t));for(const t of this._markerCollection)if(t.getRange().root==e){const e=t.getData();this.bufferMarkerChange(t.name,{...e,range:null},e)}}}_bufferRootStateChange(e,t){if(!this._changedRoots.has(e))return void this._changedRoots.set(e,{name:e,state:t?"attached":"detached"});const i=this._changedRoots.get(e);void 0!==i.state?(delete i.state,void 0===i.attributes&&this._changedRoots.delete(e)):i.state=t?"attached":"detached"}_bufferRootAttributeChange(e,t,i,n){const o=this._changedRoots.get(e)||{name:e},r=o.attributes||{};if(r[t]){const e=r[t];n===e.oldValue?delete r[t]:e.newValue=n}else r[t]={oldValue:i,newValue:n};0===Object.entries(r).length?(delete o.attributes,void 0===o.state&&this._changedRoots.delete(e)):(o.attributes=r,this._changedRoots.set(e,o))}_markInsert(e,t,i){if(e.root.is("rootElement")&&!e.root._isLoaded)return;const n={type:"insert",offset:t,howMany:i,count:this._changeCount++};this._markChange(e,n)}_markRemove(e,t,i){if(e.root.is("rootElement")&&!e.root._isLoaded)return;const n={type:"remove",offset:t,howMany:i,count:this._changeCount++};this._markChange(e,n),this._removeAllNestedChanges(e,t,i)}_markAttribute(e){if(e.root.is("rootElement")&&!e.root._isLoaded)return;const t={type:"attribute",offset:e.startOffset,howMany:e.offsetSize,count:this._changeCount++};this._markChange(e.parent,t)}_markChange(e,t){this._makeSnapshots(e);const i=this._getChangesForElement(e);this._handleChange(t,i),i.push(t);for(let e=0;e<i.length;e++)i[e].howMany<1&&(i.splice(e,1),e--)}_setElementState(e,t){if(!e.is("element"))return;const i=Ec._statesPriority.indexOf(this._elementState.get(e));Ec._statesPriority.indexOf(t)>i&&this._elementState.set(e,t)}_getDiffActionForNode(e,t){if(!e.is("element"))return t;if(!this._elementsSnapshots.has(e))return t;const i=this._elementState.get(e);return i&&"move"!=i?i:t}_getChangesForElement(e){let t;return this._changesInElement.has(e)?t=this._changesInElement.get(e):(t=[],this._changesInElement.set(e,t)),t}_makeSnapshots(e){if(this._elementChildrenSnapshots.has(e))return;const t=Sc(e.getChildren());this._elementChildrenSnapshots.set(e,t);for(const e of t)this._elementsSnapshots.set(e.node,e)}_handleChange(e,t){e.nodesToHandle=e.howMany;for(const i of t){const n=e.offset+e.howMany,o=i.offset+i.howMany;if("insert"==e.type&&("insert"==i.type&&(e.offset<=i.offset?i.offset+=e.howMany:e.offset<o&&(i.howMany+=e.nodesToHandle,e.nodesToHandle=0)),"remove"==i.type&&e.offset<i.offset&&(i.offset+=e.howMany),"attribute"==i.type))if(e.offset<=i.offset)i.offset+=e.howMany;else if(e.offset<o){const o=i.howMany;i.howMany=e.offset-i.offset,t.unshift({type:"attribute",offset:n,howMany:o-i.howMany,count:this._changeCount++})}if("remove"==e.type){if("insert"==i.type)if(n<=i.offset)i.offset-=e.howMany;else if(n<=o)if(e.offset<i.offset){const t=n-i.offset;i.offset=e.offset,i.howMany-=t,e.nodesToHandle-=t}else i.howMany-=e.nodesToHandle,e.nodesToHandle=0;else if(e.offset<=i.offset)e.nodesToHandle-=i.howMany,i.howMany=0;else if(e.offset<o){const t=o-e.offset;i.howMany-=t,e.nodesToHandle-=t}if("remove"==i.type&&(n<=i.offset?i.offset-=e.howMany:e.offset<i.offset&&(e.nodesToHandle+=i.howMany,i.howMany=0)),"attribute"==i.type)if(n<=i.offset)i.offset-=e.howMany;else if(e.offset<i.offset){const t=n-i.offset;i.offset=e.offset,i.howMany-=t}else if(e.offset<o)if(n<=o){const n=i.howMany;i.howMany=e.offset-i.offset;const o=n-i.howMany-e.nodesToHandle;t.unshift({type:"attribute",offset:e.offset,howMany:o,count:this._changeCount++})}else i.howMany-=o-e.offset}if("attribute"==e.type){if("insert"==i.type)if(e.offset<i.offset&&n>i.offset){if(n>o){const e={type:"attribute",offset:o,howMany:n-o,count:this._changeCount++};this._handleChange(e,t),t.push(e)}e.nodesToHandle=i.offset-e.offset,e.howMany=e.nodesToHandle}else e.offset>=i.offset&&e.offset<o&&(n>o?(e.nodesToHandle=n-o,e.offset=o):e.nodesToHandle=0);if("remove"==i.type&&e.offset<i.offset&&n>i.offset){const o={type:"attribute",offset:i.offset,howMany:n-i.offset,count:this._changeCount++};this._handleChange(o,t),t.push(o),e.nodesToHandle=i.offset-e.offset,e.howMany=e.nodesToHandle}"attribute"==i.type&&(e.offset>=i.offset&&n<=o?(e.nodesToHandle=0,e.howMany=0,e.offset=0):e.offset<=i.offset&&n>=o&&(i.howMany=0))}}e.howMany=e.nodesToHandle,delete e.nodesToHandle}_getInsertDiff(e,t,i,n,o){const r={type:"insert",position:ga._createAt(e,t),name:n.name,attributes:new Map(n.attributes),length:1,changeCount:this._changeCount++,action:i};return"insert"!=i&&o&&(r.before={name:o.name,attributes:new Map(o.attributes)}),r}_getRemoveDiff(e,t,i,n){return{type:"remove",action:i,position:ga._createAt(e,t),name:n.name,attributes:new Map(n.attributes),length:1,changeCount:this._changeCount++}}_getAttributesDiff(e,t,i){const n=[];i=new Map(i);for(const[o,r]of t){const t=i.has(o)?i.get(o):null;t!==r&&n.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:o,attributeOldValue:r,attributeNewValue:t,changeCount:this._changeCount++}),i.delete(o)}for(const[t,o]of i)n.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:t,attributeOldValue:null,attributeNewValue:o,changeCount:this._changeCount++});return n}_isInInsertedElement(e){const t=e.parent;if(!t)return!1;const i=this._changesInElement.get(t),n=e.startOffset;if(i)for(const e of i)if("insert"==e.type&&n>=e.offset&&n<e.offset+e.howMany)return!0;return this._isInInsertedElement(t)}_removeAllNestedChanges(e,t,i){const n=new _a(ga._createAt(e,t),ga._createAt(e,t+i));for(const e of n.getItems({shallow:!0}))e.is("element")&&(this._changesInElement.delete(e),this._removeAllNestedChanges(e,0,e.maxOffset))}}function Ic(e){return{node:e,name:e.is("$text")?"$text":e.name,attributes:new Map(e.getAttributes())}}function Sc(e){const t=[];for(const i of e)if(i.is("$text"))for(let e=0;e<i.data.length;++e)t.push(Ic(i));else t.push(Ic(i));return t}function Pc(e,t){const i=[];let n=0,o=0;for(const e of t){if(e.offset>n){for(let t=0;t<e.offset-n;t++)i.push("e");o+=e.offset-n}if("insert"==e.type){for(let t=0;t<e.howMany;t++)i.push("i");n=e.offset+e.howMany}else if("remove"==e.type){for(let t=0;t<e.howMany;t++)i.push("r");n=e.offset,o+=e.howMany}else{if(e.howMany>1500)for(let t=0;t<e.howMany;t++)i.push("a");else i.push(..."a".repeat(e.howMany).split(""));n=e.offset+e.howMany,o+=e.howMany}}if(o<e)for(let t=0;t<e-o-n;t++)i.push("e");return i}function Mc(e){const t="position"in e&&"$graveyard"==e.position.root.rootName,i="range"in e&&"$graveyard"==e.range.root.rootName;return!t&&!i}class Oc{_operations=[];_undoPairs=new Map;_undoneOperations=new Set;_baseVersionToOperationIndex=new Map;_version=0;_gaps=new Map;get version(){return this._version}set version(e){this._operations.length&&e>this._version+1&&this._gaps.set(this._version,e),this._version=e}get lastOperation(){return this._operations[this._operations.length-1]}addOperation(e){if(e.baseVersion!==this.version)throw new A("model-document-history-addoperation-incorrect-version",this,{operation:e,historyVersion:this.version});this._operations.push(e),this._version++,this._baseVersionToOperationIndex.set(e.baseVersion,this._operations.length-1)}getOperations(e,t=this.version){if(!this._operations.length)return[];const i=this._operations[0];void 0===e&&(e=i.baseVersion);let n=t-1;for(const[t,i]of this._gaps)e>t&&e<i&&(e=i),n>t&&n<i&&(n=t-1);if(n<i.baseVersion||e>this.lastOperation.baseVersion)return[];let o=this._baseVersionToOperationIndex.get(e);void 0===o&&(o=0);let r=this._baseVersionToOperationIndex.get(n);return void 0===r&&(r=this._operations.length-1),this._operations.slice(o,r+1)}getOperation(e){const t=this._baseVersionToOperationIndex.get(e);if(void 0!==t)return this._operations[t]}setOperationAsUndone(e,t){this._undoPairs.set(t,e),this._undoneOperations.add(e)}isUndoingOperation(e){return this._undoPairs.has(e)}isUndoneOperation(e){return this._undoneOperations.has(e)}getUndoneOperation(e){return this._undoPairs.get(e)}reset(){this._version=0,this._undoPairs=new Map,this._operations=[],this._undoneOperations=new Set,this._gaps=new Map,this._baseVersionToOperationIndex=new Map}}class Rc extends $a{rootName;_document;_isAttached=!0;_isLoaded=!0;constructor(e,t,i="main"){super(t),this._document=e,this.rootName=i}get document(){return this._document}isAttached(){return this._isAttached}toJSON(){return this.rootName}}function Nc(e){if(Pe(e))return e;const t=ae(e);if(!function(e){switch(ae(e)){case he:case be:case ke:case _e:case ue:case ge:case Ie:case Se:case Ce:case Te:case Ee:case fe:case de:case we:case le:case pe:case ce:case me:case ve:case ye:case Ae:case xe:return!0;default:return!1}}(e))return{};if(i=e,Array.isArray(i)){const t=Array.from(e);return e.length>0&&"string"==typeof e[0]&&Object.hasOwn(e,"index")&&(t.index=e.index,t.input=e.input),t}var i;if(jt(e)){const t=e;return new(0,t.constructor)(t.buffer,t.byteOffset,t.length)}if(t===ke)return new ArrayBuffer(e.byteLength);if(t===_e){const t=e,i=t.buffer,n=t.byteOffset,o=t.byteLength,r=new ArrayBuffer(o),s=new Uint8Array(i,n,o);return new Uint8Array(r).set(s),new DataView(r)}if(t===ue||t===de||t===ce){const i=new(0,e.constructor)(e.valueOf());return t===ce?function(e,t){const i=t.valueOf().length;for(const n in t)Object.hasOwn(t,n)&&(Number.isNaN(Number(n))||Number(n)>=i)&&(e[n]=t[n])}(i,e):Vc(i,e),i}if(t===ge)return new Date(Number(e));if(t===le){const t=e,i=new RegExp(t.source,t.flags);return i.lastIndex=t.lastIndex,i}if(t===me)return Object(Symbol.prototype.valueOf.call(e));if(t===fe){const t=e,i=new Map;return t.forEach((e,t)=>{i.set(t,e)}),i}if(t===pe){const t=e,i=new Set;return t.forEach(e=>{i.add(e)}),i}if(t===he){const t=e,i={};return Vc(i,t),i.length=t.length,i[Symbol.iterator]=t[Symbol.iterator],i}const n={};return function(e,t){const i=Object.getPrototypeOf(t);if(null!==i){"function"==typeof t.constructor&&Object.setPrototypeOf(e,i)}}(n,e),Vc(n,e),function(e,t){const i=Object.getOwnPropertySymbols(t);for(let n=0;n<i.length;n++){const o=i[n];Object.prototype.propertyIsEnumerable.call(t,o)&&(e[o]=t[o])}}(n,e),n}function Vc(e,t){for(const i in t)Object.hasOwn(t,i)&&(e[i]=t[i])}Rc.prototype.is=function(e,t){return t?t===this.name&&("rootElement"===e||"model:rootElement"===e||"element"===e||"model:element"===e):"rootElement"===e||"model:rootElement"===e||"element"===e||"model:element"===e||"node"===e||"model:node"===e};const Lc="$graveyard";class Dc extends(O()){model;history;selection;roots;differ;isReadOnly;_postFixers;_hasSelectionChangedFromTheLastChangeBlock;constructor(e){super(),this.model=e,this.history=new Oc,this.selection=new ja(this),this.roots=new Yt({idProperty:"rootName"}),this.differ=new Ec(e.markers),this.isReadOnly=!1,this._postFixers=new Set,this._hasSelectionChangedFromTheLastChangeBlock=!1,this.createRoot("$root",Lc),this.listenTo(e,"applyOperation",(e,t)=>{const i=t[0];i.isDocumentOperation&&this.differ.bufferOperation(i)},{priority:"high"}),this.listenTo(e,"applyOperation",(e,t)=>{const i=t[0];i.isDocumentOperation&&this.history.addOperation(i)},{priority:"low"}),this.listenTo(this.selection,"change",()=>{this._hasSelectionChangedFromTheLastChangeBlock=!0}),this.listenTo(e.markers,"update",(e,t,i,n,o)=>{const r={...t.getData(),range:n};this.differ.bufferMarkerChange(t.name,o,r),null===i&&t.on("change",(e,i)=>{const n=t.getData();this.differ.bufferMarkerChange(t.name,{...n,range:i},n)})}),this.registerPostFixer(e=>{let t=!1;for(const i of this.roots)i.isAttached()||i.isEmpty||(e.remove(e.createRangeIn(i)),t=!0);for(const i of this.model.markers)i.getRange().root.isAttached()||(e.removeMarker(i),t=!0);return t})}get version(){return this.history.version}set version(e){this.history.version=e}get graveyard(){return this.getRoot(Lc)}createRoot(e="$root",t="main"){if(this.roots.get(t))throw new A("model-document-createroot-name-exists",this,{name:t});const i=new Rc(this,e,t);return this.roots.add(i),i}destroy(){this.selection.destroy(),this.stopListening()}getRoot(e="main"){return this.roots.get(e)}getRootNames(e=!1){return this.getRoots(e).map(e=>e.rootName)}getRoots(e=!1){return this.roots.filter(t=>t!=this.graveyard&&(e||t.isAttached())&&t._isLoaded)}registerPostFixer(e){this._postFixers.add(e)}toJSON(){const e=Nc(this);return e.selection="[engine.model.DocumentSelection]",e.model="[engine.model.Model]",e}_handleChangeBlock(e){this._hasDocumentChangedFromTheLastChangeBlock()&&(this._callPostFixers(e),this.selection.refresh(),this.differ.hasDataChanges()?this.fire("change:data",e.batch):this.fire("change",e.batch),this.selection.refresh(),this.differ.reset()),this._hasSelectionChangedFromTheLastChangeBlock=!1}_hasDocumentChangedFromTheLastChangeBlock(){return!this.differ.isEmpty||this._hasSelectionChangedFromTheLastChangeBlock}_getDefaultRoot(){const e=this.getRoots();return e.length?e[0]:this.graveyard}_getDefaultRange(){const e=this._getDefaultRoot(),t=this.model,i=t.schema,n=t.createPositionFromPath(e,[0]);return i.getNearestSelectionRange(n)||t.createRange(n)}_validateSelectionRange(e){return e.start.isValid()&&e.end.isValid()&&Bc(e.start)&&Bc(e.end)}_callPostFixers(e){let t=!1;do{for(const i of this._postFixers)if(this.selection.refresh(),t=i(e),t)break}while(t)}}function Bc(e){const t=e.textNode;if(t){const i=t.data,n=e.offset-t.startOffset;return!li(i,n)&&!ci(i,n)}return!0}class zc extends(O()){_markers=new Map;[Symbol.iterator](){return this._markers.values()}has(e){const t=e instanceof Fc?e.name:e;return this._markers.has(t)}get(e){return this._markers.get(e)||null}_set(e,t,i=!1,n=!1){const o=e instanceof Fc?e.name:e;if(o.includes(","))throw new A("markercollection-incorrect-marker-name",this);const r=this._markers.get(o);if(r){const e=r.getData(),s=r.getRange();let a=!1;return s.isEqual(t)||(r._attachLiveRange(La.fromRange(t)),a=!0),i!=r.managedUsingOperations&&(r._managedUsingOperations=i,a=!0),"boolean"==typeof n&&n!=r.affectsData&&(r._affectsData=n,a=!0),a&&this.fire(`update:${o}`,r,s,t,e),r}const s=La.fromRange(t),a=new Fc(o,s,i,n);return this._markers.set(o,a),this.fire(`update:${o}`,a,null,t,{...a.getData(),range:null}),a}_remove(e){const t=e instanceof Fc?e.name:e,i=this._markers.get(t);return!!i&&(this._markers.delete(t),this.fire(`update:${t}`,i,i.getRange(),null,i.getData()),this._destroyMarker(i),!0)}_refresh(e){const t=e instanceof Fc?e.name:e,i=this._markers.get(t);if(!i)throw new A("markercollection-refresh-marker-not-exists",this);const n=i.getRange();this.fire(`update:${t}`,i,n,n,i.getData())}*getMarkersAtPosition(e){for(const t of this)t.getRange().containsPosition(e)&&(yield t)}*getMarkersIntersectingRange(e){for(const t of this)null!==t.getRange().getIntersection(e)&&(yield t)}destroy(){for(const e of this._markers.values())this._destroyMarker(e);this._markers=null,this.stopListening()}*getMarkersGroup(e){for(const t of this._markers.values())t.name.startsWith(e+":")&&(yield t)}_destroyMarker(e){e.stopListening(),e._detachLiveRange()}}class Fc extends(O(da)){name;_managedUsingOperations;_affectsData;_liveRange;constructor(e,t,i,n){super(),this.name=e,this._liveRange=this._attachLiveRange(t),this._managedUsingOperations=i,this._affectsData=n}get managedUsingOperations(){if(!this._liveRange)throw new A("marker-destroyed",this);return this._managedUsingOperations}get affectsData(){if(!this._liveRange)throw new A("marker-destroyed",this);return this._affectsData}getData(){return{range:this.getRange(),affectsData:this.affectsData,managedUsingOperations:this.managedUsingOperations}}getStart(){if(!this._liveRange)throw new A("marker-destroyed",this);return this._liveRange.start.clone()}getEnd(){if(!this._liveRange)throw new A("marker-destroyed",this);return this._liveRange.end.clone()}getRange(){if(!this._liveRange)throw new A("marker-destroyed",this);return this._liveRange.toRange()}toJSON(){return{name:this.name,range:this._liveRange?.toJSON(),usingOperations:this._managedUsingOperations,affectsData:this._affectsData}}_attachLiveRange(e){return this._liveRange&&this._detachLiveRange(),e.delegate("change:range").to(this),e.delegate("change:content").to(this),this._liveRange=e,e}_detachLiveRange(){this._liveRange.stopDelegating("change:range",this),this._liveRange.stopDelegating("change:content",this),this._liveRange.detach(),this._liveRange=null}}Fc.prototype.is=function(e){return"marker"===e||"model:marker"===e};class jc extends Wl{sourcePosition;howMany;constructor(e,t){super(null),this.sourcePosition=e.clone(),this.howMany=t}get type(){return"detach"}get affectedSelectable(){return null}toJSON(){const e=super.toJSON();return e.sourcePosition=this.sourcePosition.toJSON(),e}_validate(){if(this.sourcePosition.root.document)throw new A("detach-operation-on-document-node",this)}_execute(){ql(_a._createFromPositionAndShift(this.sourcePosition,this.howMany))}static get className(){return"DetachOperation"}}class Uc extends da{markers=new Map;_children=new Wa;constructor(e){super(),e&&this._insertChild(0,e)}[Symbol.iterator](){return this.getChildren()}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}get nextSibling(){return null}get previousSibling(){return null}get root(){return this}get parent(){return null}get document(){return null}isAttached(){return!1}getAncestors(){return[]}getChild(e){return this._children.getNode(e)}getChildAtOffset(e){return this._children.getNodeAtOffset(e)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(e){return this._children.getNodeIndex(e)}getChildStartOffset(e){return this._children.getNodeStartOffset(e)}getPath(){return[]}getNodeByPath(e){let t=this;for(const i of e)t=t.getChildAtOffset(i);return t}offsetToIndex(e){return this._children.offsetToIndex(e)}toJSON(){const e=[];for(const t of this._children)e.push(t.toJSON());return e}static fromJSON(e){const t=[];for(const i of e)i.name?t.push($a.fromJSON(i)):t.push(za.fromJSON(i));return new Uc(t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const i=function(e){if("string"==typeof e)return[new za(e)];ie(e)||(e=[e]);return Array.from(e).map(e=>"string"==typeof e?new za(e):e instanceof ua?new za(e.data,e.getAttributes()):e)}(t);for(const e of i)null!==e.parent&&e._remove(),e.parent=this;this._children._insertNodes(e,i)}_removeChildren(e,t=1){const i=this._children._removeNodes(e,t);for(const e of i)e.parent=null;return i}_removeChildrenArray(e){this._children._removeNodesArray(e);for(const t of e)t.parent=null}}Uc.prototype.is=function(e){return"documentFragment"===e||"model:documentFragment"===e};class Hc{model;batch;constructor(e,t){this.model=e,this.batch=t}createText(e,t){return new za(e,t)}createElement(e,t){return new $a(e,t)}createDocumentFragment(){return new Uc}cloneElement(e,t=!0){return e._clone(t)}insert(e,t,i=0){if(this._assertWriterUsedCorrectly(),e instanceof za&&""==e.data)return;const n=ga._createAt(t,i);if(e.parent){if(Gc(e.root,n.root))return void this.move(_a._createOn(e),n);if(e.root.document)throw new A("model-writer-insert-forbidden-move",this);this.remove(e)}const o=n.root.document?n.root.document.version:null,r=e instanceof Uc?e._removeChildren(0,e.childCount):e,s=new Xl(n,r,o);if(e instanceof za&&(s.shouldReceiveAttributes=!0),this.batch.addOperation(s),this.model.applyOperation(s),e instanceof Uc)for(const[t,i]of e.markers){const e=ga._createAt(i.root,0),o={range:new _a(i.start._getCombined(e,n),i.end._getCombined(e,n)),usingOperation:!0,affectsData:!0};this.model.markers.has(t)?this.updateMarker(t,o):this.addMarker(t,o)}}insertText(e,t,i,n){t instanceof Uc||t instanceof $a||t instanceof ga?this.insert(this.createText(e),t,i):this.insert(this.createText(e,t),i,n)}insertElement(e,t,i,n){t instanceof Uc||t instanceof $a||t instanceof ga?this.insert(this.createElement(e),t,i):this.insert(this.createElement(e,t),i,n)}append(e,t){this.insert(e,t,"end")}appendText(e,t,i){t instanceof Uc||t instanceof $a?this.insert(this.createText(e),t,"end"):this.insert(this.createText(e,t),i,"end")}appendElement(e,t,i){t instanceof Uc||t instanceof $a?this.insert(this.createElement(e),t,"end"):this.insert(this.createElement(e,t),i,"end")}setAttribute(e,t,i){if(this._assertWriterUsedCorrectly(),i instanceof _a){const n=i.getMinimalFlatRanges();for(const i of n)Wc(this,e,t,i)}else $c(this,e,t,i)}setAttributes(e,t){for(const[i,n]of ii(e))this.setAttribute(i,n,t)}removeAttribute(e,t){if(this._assertWriterUsedCorrectly(),t instanceof _a){const i=t.getMinimalFlatRanges();for(const t of i)Wc(this,e,null,t)}else $c(this,e,null,t)}clearAttributes(e){this._assertWriterUsedCorrectly();const t=e=>{for(const t of e.getAttributeKeys())this.removeAttribute(t,e)};if(e instanceof _a)for(const i of e.getItems())t(i);else t(e)}move(e,t,i){if(this._assertWriterUsedCorrectly(),!(e instanceof _a))throw new A("writer-move-invalid-range",this);if(!e.isFlat)throw new A("writer-move-range-not-flat",this);const n=ga._createAt(t,i);if(n.isEqual(e.start))return;if(this._addOperationForAffectedMarkers("move",e),!Gc(e.root,n.root))throw new A("writer-move-different-document",this);const o=e.root.document?e.root.document.version:null,r=new Zl(e.start,e.end.offset-e.start.offset,n,o);this.batch.addOperation(r),this.model.applyOperation(r)}remove(e){this._assertWriterUsedCorrectly();const t=(e instanceof _a?e:_a._createOn(e)).getMinimalFlatRanges().reverse();for(const e of t)this._addOperationForAffectedMarkers("move",e),Kc(e.start,e.end.offset-e.start.offset,this.batch,this.model)}merge(e){this._assertWriterUsedCorrectly();const t=e.nodeBefore,i=e.nodeAfter;if(this._addOperationForAffectedMarkers("merge",e),!(t instanceof $a))throw new A("writer-merge-no-element-before",this);if(!(i instanceof $a))throw new A("writer-merge-no-element-after",this);e.root.document?this._merge(e):this._mergeDetached(e)}createPositionFromPath(e,t,i){return this.model.createPositionFromPath(e,t,i)}createPositionAt(e,t){return this.model.createPositionAt(e,t)}createPositionAfter(e){return this.model.createPositionAfter(e)}createPositionBefore(e){return this.model.createPositionBefore(e)}createRange(e,t){return this.model.createRange(e,t)}createRangeIn(e){return this.model.createRangeIn(e)}createRangeOn(e){return this.model.createRangeOn(e)}createSelection(...e){return this.model.createSelection(...e)}_mergeDetached(e){const t=e.nodeBefore,i=e.nodeAfter;this.move(_a._createIn(i),ga._createAt(t,"end")),this.remove(i)}_merge(e){const t=ga._createAt(e.nodeBefore,"end"),i=ga._createAt(e.nodeAfter,0),n=e.root.document.graveyard,o=new ga(n,[0]),r=e.root.document.version,s=new tc(i,e.nodeAfter.maxOffset,t,o,r);this.batch.addOperation(s),this.model.applyOperation(s)}rename(e,t){if(this._assertWriterUsedCorrectly(),!(e instanceof $a))throw new A("writer-rename-not-element-instance",this);const i=e.root.document?e.root.document.version:null,n=new sc(ga._createBefore(e),e.name,t,i);this.batch.addOperation(n),this.model.applyOperation(n)}split(e,t){this._assertWriterUsedCorrectly();let i,n,o=e.parent;if(!o.parent)throw new A("writer-split-element-no-parent",this);if(t||(t=o.parent),!e.parent.getAncestors({includeSelf:!0}).includes(t))throw new A("writer-split-invalid-limit-element",this);do{const t=o.root.document?o.root.document.version:null,r=o.maxOffset-e.offset,s=ec.getInsertionPosition(e),a=new ec(e,r,s,null,t);this.batch.addOperation(a),this.model.applyOperation(a),i||n||(i=o,n=e.parent.nextSibling),o=(e=this.createPositionAfter(e.parent)).parent}while(o!==t);return{position:e,range:new _a(ga._createAt(i,"end"),ga._createAt(n,0))}}wrap(e,t){if(this._assertWriterUsedCorrectly(),!e.isFlat)throw new A("writer-wrap-range-not-flat",this);const i=t instanceof $a?t:new $a(t);if(i.childCount>0)throw new A("writer-wrap-element-not-empty",this);if(null!==i.parent)throw new A("writer-wrap-element-attached",this);this.insert(i,e.start);const n=new _a(e.start.getShiftedBy(1),e.end.getShiftedBy(1));this.move(n,ga._createAt(i,0))}unwrap(e){if(this._assertWriterUsedCorrectly(),null===e.parent)throw new A("writer-unwrap-element-no-parent",this);this.move(_a._createIn(e),this.createPositionAfter(e)),this.remove(e)}addMarker(e,t){if(this._assertWriterUsedCorrectly(),!t||"boolean"!=typeof t.usingOperation)throw new A("writer-addmarker-no-usingoperation",this);const i=t.usingOperation,n=t.range,o=void 0!==t.affectsData&&t.affectsData;if(this.model.markers.has(e))throw new A("writer-addmarker-marker-exists",this);if(!n)throw new A("writer-addmarker-no-range",this);return i?(qc(this,e,null,n,o),this.model.markers.get(e)):this.model.markers._set(e,n,i,o)}updateMarker(e,t){this._assertWriterUsedCorrectly();const i="string"==typeof e?e:e.name,n=this.model.markers.get(i);if(!n)throw new A("writer-updatemarker-marker-not-exists",this);if(!t)return x("writer-updatemarker-reconvert-using-editingcontroller",{markerName:i}),void this.model.markers._refresh(n);const o="boolean"==typeof t.usingOperation,r="boolean"==typeof t.affectsData,s=r?t.affectsData:n.affectsData;if(!o&&!t.range&&!r)throw new A("writer-updatemarker-wrong-options",this);const a=n.getRange(),l=t.range?t.range:a;o&&t.usingOperation!==n.managedUsingOperations?t.usingOperation?qc(this,i,null,l,s):(qc(this,i,a,null,s),this.model.markers._set(i,l,void 0,s)):n.managedUsingOperations?qc(this,i,a,l,s):this.model.markers._set(i,l,void 0,s)}removeMarker(e){this._assertWriterUsedCorrectly();const t="string"==typeof e?e:e.name;if(!this.model.markers.has(t))throw new A("writer-removemarker-no-marker",this);const i=this.model.markers.get(t);if(!i.managedUsingOperations)return void this.model.markers._remove(t);qc(this,t,i.getRange(),null,i.affectsData)}addRoot(e,t="$root"){this._assertWriterUsedCorrectly();const i=this.model.document.getRoot(e);if(i&&i.isAttached())throw new A("writer-addroot-root-exists",this);const n=this.model.document,o=new lc(e,t,!0,n,n.version);return this.batch.addOperation(o),this.model.applyOperation(o),this.model.document.getRoot(e)}detachRoot(e){this._assertWriterUsedCorrectly();const t="string"==typeof e?this.model.document.getRoot(e):e;if(!t||!t.isAttached())throw new A("writer-detachroot-no-root",this);for(const e of this.model.markers)e.getRange().root===t&&this.removeMarker(e);for(const e of t.getAttributeKeys())this.removeAttribute(e,t);this.remove(this.createRangeIn(t));const i=this.model.document,n=new lc(t.rootName,t.name,!1,i,i.version);this.batch.addOperation(n),this.model.applyOperation(n)}setSelection(...e){this._assertWriterUsedCorrectly(),this.model.document.selection._setTo(...e)}setSelectionFocus(e,t){this._assertWriterUsedCorrectly(),this.model.document.selection._setFocus(e,t)}setSelectionAttribute(e,t){if(this._assertWriterUsedCorrectly(),"string"==typeof e)this._setSelectionAttribute(e,t);else for(const[t,i]of ii(e))this._setSelectionAttribute(t,i)}removeSelectionAttribute(e){if(this._assertWriterUsedCorrectly(),"string"==typeof e)this._removeSelectionAttribute(e);else for(const t of e)this._removeSelectionAttribute(t)}overrideSelectionGravity(){return this.model.document.selection._overrideGravity()}restoreSelectionGravity(e){this.model.document.selection._restoreGravity(e)}_setSelectionAttribute(e,t){const i=this.model.document.selection;if(i.isCollapsed&&i.anchor.parent.isEmpty){const n=ja._getStoreAttributeKey(e);this.setAttribute(n,t,i.anchor.parent)}i._setAttribute(e,t)}_removeSelectionAttribute(e){const t=this.model.document.selection;if(t.isCollapsed&&t.anchor.parent.isEmpty){const i=ja._getStoreAttributeKey(e);this.removeAttribute(i,t.anchor.parent)}t._removeAttribute(e)}_assertWriterUsedCorrectly(){if(this.model._currentWriter!==this)throw new A("writer-incorrect-use",this)}_addOperationForAffectedMarkers(e,t){for(const i of this.model.markers){if(!i.managedUsingOperations)continue;const n=i.getRange();let o=!1;if("move"===e){const e=t;o=e.containsPosition(n.start)||e.start.isEqual(n.start)||e.containsPosition(n.end)||e.end.isEqual(n.end)}else{const e=t,i=e.nodeBefore,r=e.nodeAfter,s=n.start.parent==i&&n.start.isAtEnd,a=n.end.parent==r&&0==n.end.offset,l=n.end.nodeAfter==r,c=n.start.nodeAfter==r;o=s||a||l||c}o&&this.updateMarker(i.name,{range:n})}}}function Wc(e,t,i,n){const o=e.model,r=o.document;let s,a,l,c=n.start;for(const e of n.getWalker({shallow:!0}))l=e.item.getAttribute(t),s&&a!=l&&(a!=i&&d(),c=s),s=e.nextPosition,a=l;function d(){const n=new _a(c,s),l=n.root.document?r.version:null,d=new oc(n,t,a,i,l);e.batch.addOperation(d),o.applyOperation(d)}s instanceof ga&&s!=c&&a!=i&&d()}function $c(e,t,i,n){const o=e.model,r=o.document,s=n.getAttribute(t);let a,l;if(s!=i){if(n.root===n){const e=n.document?r.version:null;l=new ac(n,t,s,i,e)}else{a=new _a(ga._createBefore(n),e.createPositionAfter(n));const o=a.root.document?r.version:null;l=new oc(a,t,s,i,o)}e.batch.addOperation(l),o.applyOperation(l)}}function qc(e,t,i,n,o){const r=e.model,s=r.document,a=new ic(t,i,n,r.markers,!!o,s.version);e.batch.addOperation(a),r.applyOperation(a)}function Kc(e,t,i,n){let o;if(e.root.document){const i=n.document,r=new ga(i.graveyard,[0]);o=new Zl(e,t,r,i.version)}else o=new jc(e,t);i.addOperation(o),n.applyOperation(o)}function Gc(e,t){return e===t||e instanceof Rc&&t instanceof Rc}function Yc(e){e.document.registerPostFixer(t=>function(e,t){const i=t.document.selection,n=t.schema,o=[];let r=!1;for(const e of i.getRanges()){const t=Jc(e,n);t&&!t.isEqual(e)?(o.push(t),r=!0):o.push(e)}r&&e.setSelection(function(e){const t=[...e],i=new Set;let n=1;for(;n<t.length;){const e=t[n],o=t.slice(0,n);for(const[r,s]of o.entries())if(!i.has(r))if(e.isEqual(s))i.add(r);else if(e.isIntersecting(s)){i.add(r),i.add(n);const o=e.getJoined(s);t.push(o)}n++}return t.filter((e,t)=>!i.has(t))}(o),{backward:i.isBackward});return!1}(t,e))}function Jc(e,t){return e.isCollapsed?function(e,t){const i=e.start,n=t.getNearestSelectionRange(i);if(!n){const e=i.getAncestors().reverse().find(e=>t.isObject(e));return e?_a._createOn(e):null}if(!n.isCollapsed)return n;const o=n.start;if(i.isEqual(o))return null;return new _a(o)}(e,t):function(e,t){const{start:i,end:n}=e,o=t.checkChild(i,"$text"),r=t.checkChild(n,"$text"),s=t.getLimitElement(i),a=t.getLimitElement(n);if(s===a){if(o&&r)return null;if(function(e,t,i){const n=e.nodeAfter&&!i.isLimit(e.nodeAfter)||i.checkChild(e,"$text"),o=t.nodeBefore&&!i.isLimit(t.nodeBefore)||i.checkChild(t,"$text");return n||o}(i,n,t)){const e=i.nodeAfter&&t.isSelectable(i.nodeAfter)?null:t.getNearestSelectionRange(i,"forward"),o=n.nodeBefore&&t.isSelectable(n.nodeBefore)?null:t.getNearestSelectionRange(n,"backward"),r=e?e.start:i,s=o?o.end:n;return new _a(r,s)}}const l=s&&!s.is("rootElement"),c=a&&!a.is("rootElement");if(l||c){const e=i.nodeAfter&&n.nodeBefore&&i.nodeAfter.parent===n.nodeBefore.parent,o=l&&(!e||!Zc(i.nodeAfter,t)),r=c&&(!e||!Zc(n.nodeBefore,t));let d=i,u=n;return o&&(d=ga._createBefore(Qc(s,t))),r&&(u=ga._createAfter(Qc(a,t))),new _a(d,u)}return null}(e,t)}function Qc(e,t){let i=e,n=i;for(;t.isLimit(n)&&n.parent;)i=n,n=n.parent;return i}function Zc(e,t){return e&&t.isSelectable(e)}function Xc(e,t,i={}){if(t.isCollapsed)return;const n=t.getFirstRange();if("$graveyard"==n.root.rootName)return;const o=e.schema;e.change(e=>{if(!i.doNotResetEntireContent&&function(e,t){const i=e.getLimitElement(t);if(!t.containsEntireContent(i))return!1;const n=t.getFirstRange();if(n.start.parent==n.end.parent)return!1;return e.checkChild(i,"paragraph")}(o,t))return void function(e,t){const i=e.model.schema.getLimitElement(t);e.remove(e.createRangeIn(i)),nd(e,e.createPositionAt(i,0),t)}(e,t);const r={};if(!i.doNotAutoparagraph){const e=t.getSelectedElement();e&&Object.assign(r,o.getAttributesWithProperty(e,"copyOnReplace",!0))}let s,a;i.doNotFixSelection?(s=Ac.fromPosition(n.start,"toPrevious"),a=Ac.fromPosition(n.end,"toNext")):[s,a]=function(e){const t=e.root.document.model,i=e.start;let n=e.end;if(t.hasContent(e,{ignoreMarkers:!0})){const i=function(e){const t=e.parent,i=t.root.document.model.schema,n=t.getAncestors({parentFirst:!0,includeSelf:!0});for(const e of n){if(i.isLimit(e))return null;if(i.isBlock(e))return e}}(n);if(i&&n.isTouching(t.createPositionAt(i,0))){const i=t.createSelection(e);t.modifySelection(i,{direction:"backward"});const o=i.getLastPosition(),r=t.createRange(o,n);t.hasContent(r,{ignoreMarkers:!0})||(n=o)}}return[Ac.fromPosition(i,"toPrevious"),Ac.fromPosition(n,"toNext")]}(n),s.isTouching(a)||e.remove(e.createRange(s,a)),i.leaveUnmerged||(!function(e,t,i){const n=e.model;if(!id(e.model.schema,t,i))return;const[o,r]=function(e,t){const i=e.getAncestors(),n=t.getAncestors();let o=0;for(;i[o]&&i[o]==n[o];)o++;return[i[o],n[o]]}(t,i);if(!o||!r)return;!n.hasContent(o,{ignoreMarkers:!0})&&n.hasContent(r,{ignoreMarkers:!0})?td(e,t,i,o.parent):ed(e,t,i,o.parent)}(e,s,a),o.removeDisallowedAttributes(s.parent.getChildren(),e)),od(e,t,s),!i.doNotAutoparagraph&&function(e,t){const i=e.checkChild(t,"$text"),n=e.checkChild(t,"paragraph");return!i&&n}(o,s)&&nd(e,s,t,r),s.detach(),a.detach()})}function ed(e,t,i,n){const o=t.parent,r=i.parent;if(o!=n&&r!=n){for(t=e.createPositionAfter(o),(i=e.createPositionBefore(r)).isEqual(t)||e.insert(r,t),e.merge(t);i.parent.isEmpty;){const t=i.parent;i=e.createPositionBefore(t),e.remove(t)}id(e.model.schema,t,i)&&ed(e,t,i,n)}}function td(e,t,i,n){const o=t.parent,r=i.parent;if(o!=n&&r!=n){for(t=e.createPositionAfter(o),(i=e.createPositionBefore(r)).isEqual(t)||e.insert(o,i);t.parent.isEmpty;){const i=t.parent;t=e.createPositionBefore(i),e.remove(i)}i=e.createPositionBefore(r),function(e,t){const i=t.nodeBefore,n=t.nodeAfter;i.name!=n.name&&e.rename(i,n.name);e.clearAttributes(i),e.setAttributes(Object.fromEntries(n.getAttributes()),i),e.merge(t)}(e,i),id(e.model.schema,t,i)&&td(e,t,i,n)}}function id(e,t,i){const n=t.parent,o=i.parent;return n!=o&&(!e.isLimit(n)&&!e.isLimit(o)&&function(e,t,i){const n=new _a(e,t);for(const e of n.getWalker())if(i.isLimit(e.item))return!1;return!0}(t,i,e))}function nd(e,t,i,n={}){const o=e.createElement("paragraph");e.model.schema.setAllowedAttributes(o,n,e),e.insert(o,t),od(e,i,e.createPositionAt(o,0))}function od(e,t,i){t instanceof ja?e.setSelection(i):t.setTo(i)}function rd(e,t){const i=[];Array.from(e.getItems({direction:"backward"})).map(e=>t.createRangeOn(e)).filter(t=>(t.start.isAfter(e.start)||t.start.isEqual(e.start))&&(t.end.isBefore(e.end)||t.end.isEqual(e.end))).forEach(e=>{i.push(e.start.parent),t.remove(e)}),i.forEach(e=>{let i=e;for(;i.parent&&i.isEmpty;){const e=t.createRangeOn(i);i=i.parent,t.remove(e)}})}class sd{model;writer;position;canMergeWith;schema;_documentFragment;_documentFragmentPosition;_firstNode=null;_lastNode=null;_lastAutoParagraph=null;_filterAttributesAndChildrenOf=[];_affectedStart=null;_affectedEnd=null;_nodeToSelect=null;constructor(e,t,i){this.model=e,this.writer=t,this.position=i,this.canMergeWith=new Set([this.position.parent]),this.schema=e.schema,this._documentFragment=t.createDocumentFragment(),this._documentFragmentPosition=t.createPositionAt(this._documentFragment,0)}handleNodes(e){for(const t of Array.from(e))t.offsetSize>0&&this._handleNode(t);this._insertPartialFragment(),this._lastAutoParagraph&&this._updateLastNodeFromAutoParagraph(this._lastAutoParagraph),this._mergeOnRight(),this.schema.removeDisallowedAttributes(this._filterAttributesAndChildrenOf,this.writer),this.model._config?.get("experimentalFlags.modelInsertContentDeepSchemaVerification")&&this._removeDisallowedChildren(this._filterAttributesAndChildrenOf),this._filterAttributesAndChildrenOf=[]}_removeDisallowedChildren(e){const t=Array.from(e);for(const e of t){if(!e.is("element"))continue;const i=[],n=[],o=this.writer.createRangeIn(e).getWalker({ignoreElementEnd:!0});for(const{item:e}of o){const r=e.parent;this.schema.checkChild(r,e)||(e.is("element")&&!this.schema.isObject(e)?(n.push(e),t.push(r)):i.push(e),o.jumpTo(this.writer.createPositionAfter(e)))}for(const e of n)this.writer.unwrap(e);for(const e of i)this.writer.remove(e)}}_updateLastNodeFromAutoParagraph(e){const t=this.writer.createPositionAfter(this._lastNode),i=this.writer.createPositionAfter(e);if(i.isAfter(t)){if(this._lastNode=e,this.position.parent!=e||!this.position.isAtEnd)throw new A("insertcontent-invalid-insertion-position",this);this.position=i,this._setAffectedBoundaries(this.position)}}getSelectionRange(){return this._nodeToSelect?_a._createOn(this._nodeToSelect):this.model.schema.getNearestSelectionRange(this.position)}getAffectedRange(){return this._affectedStart?new _a(this._affectedStart,this._affectedEnd):null}destroy(){this._affectedStart&&this._affectedStart.detach(),this._affectedEnd&&this._affectedEnd.detach()}_handleNode(e){this._checkAndSplitToAllowedPosition(e)?(e=this._appendToFragment(e),this._firstNode||(this._firstNode=e),this._lastNode=e):this.schema.isObject(e)||this._handleDisallowedNode(e)}_insertPartialFragment(){if(this._documentFragment.isEmpty)return;const e=Ac.fromPosition(this.position,"toNext");this._setAffectedBoundaries(this.position),this._documentFragment.getChild(0)==this._firstNode&&(this.writer.insert(this._firstNode,this.position),this._mergeOnLeft(),this.position=e.toPosition()),this._documentFragment.isEmpty||this.writer.insert(this._documentFragment,this.position),this._documentFragmentPosition=this.writer.createPositionAt(this._documentFragment,0),this.position=e.toPosition(),e.detach()}_handleDisallowedNode(e){e.is("element")&&this.handleNodes(e.getChildren())}_appendToFragment(e){if(!this.schema.checkChild(this.position,e))throw new A("insertcontent-wrong-position",this,{node:e,position:this.position});return this.writer.insert(e,this._documentFragmentPosition),this._documentFragmentPosition=this._documentFragmentPosition.getShiftedBy(e.offsetSize),e.parent||(e=this._documentFragmentPosition.nodeBefore),this.schema.isObject(e)&&!this.schema.checkChild(this.position,"$text")?this._nodeToSelect=e:this._nodeToSelect=null,this._filterAttributesAndChildrenOf.push(e),e}_setAffectedBoundaries(e){this._affectedStart||(this._affectedStart=Ac.fromPosition(e,"toPrevious")),this._affectedEnd&&!this._affectedEnd.isBefore(e)||(this._affectedEnd&&this._affectedEnd.detach(),this._affectedEnd=Ac.fromPosition(e,"toNext"))}_mergeOnLeft(){const e=this._firstNode;if(!(e instanceof $a))return;if(!this._canMergeLeft(e))return;const t=Ac._createBefore(e);t.stickiness="toNext";const i=Ac.fromPosition(this.position,"toNext");this._affectedStart.isEqual(t)&&(this._affectedStart.detach(),this._affectedStart=Ac._createAt(t.nodeBefore,"end","toPrevious")),this._firstNode===this._lastNode&&(this._firstNode=t.nodeBefore,this._lastNode=t.nodeBefore),this.writer.merge(t),t.isEqual(this._affectedEnd)&&this._firstNode===this._lastNode&&(this._affectedEnd.detach(),this._affectedEnd=Ac._createAt(t.nodeBefore,"end","toNext")),this.position=i.toPosition(),i.detach(),this._filterAttributesAndChildrenOf.push(this.position.parent),t.detach()}_mergeOnRight(){const e=this._lastNode;if(!(e instanceof $a))return;if(!this._canMergeRight(e))return;const t=Ac._createAfter(e);if(t.stickiness="toNext",!this.position.isEqual(t))throw new A("insertcontent-invalid-insertion-position",this);this.position=ga._createAt(t.nodeBefore,"end");const i=Ac.fromPosition(this.position,"toPrevious");this._affectedEnd.isEqual(t)&&(this._affectedEnd.detach(),this._affectedEnd=Ac._createAt(t.nodeBefore,"end","toNext")),this._firstNode===this._lastNode&&(this._firstNode=t.nodeBefore,this._lastNode=t.nodeBefore),this.writer.merge(t),t.getShiftedBy(-1).isEqual(this._affectedStart)&&this._firstNode===this._lastNode&&(this._affectedStart.detach(),this._affectedStart=Ac._createAt(t.nodeBefore,0,"toPrevious")),this.position=i.toPosition(),i.detach(),this._filterAttributesAndChildrenOf.push(this.position.parent),t.detach()}_canMergeLeft(e){const t=e.previousSibling;return t instanceof $a&&this.canMergeWith.has(t)&&this.model.schema.checkMerge(t,e)}_canMergeRight(e){const t=e.nextSibling;return t instanceof $a&&this.canMergeWith.has(t)&&this.model.schema.checkMerge(e,t)}_insertAutoParagraph(){this._insertPartialFragment();const e=this.writer.createElement("paragraph");this.writer.insert(e,this.position),this._setAffectedBoundaries(this.position),this._lastAutoParagraph=e,this.position=this.writer.createPositionAt(e,0)}_checkAndSplitToAllowedPosition(e){const t=this._getAllowedIn(this.position.parent,e);if(!t)return!1;for(t!=this.position.parent&&this._insertPartialFragment();t!=this.position.parent;)if(this.position.isAtStart){const e=this.position.parent;this.position=this.writer.createPositionBefore(e),e.isEmpty&&e.parent===t&&this.writer.remove(e)}else if(this.position.isAtEnd)this.position=this.writer.createPositionAfter(this.position.parent);else{const e=this.writer.createPositionAfter(this.position.parent);this._setAffectedBoundaries(this.position),this.writer.split(this.position),this.position=e,this.canMergeWith.add(this.position.nodeAfter)}return this.schema.checkChild(this.position.parent,e)||this._insertAutoParagraph(),!0}_getAllowedIn(e,t){const i=this.schema.createContext(e);return this.schema.checkChild(i,t)||this.schema.checkChild(i,"paragraph")&&this.schema.checkChild(i.push("paragraph"),t)?e:this.schema.isLimit(e)?null:this._getAllowedIn(e.parent,t)}}function ad(e,t,i,n={}){if(!e.schema.isObject(t))throw new A("insertobject-element-not-an-object",e,{object:t});const o=i||e.document.selection;let r=o;n.findOptimalPosition&&e.schema.isBlock(t)&&(r=e.createSelection(e.schema.findOptimalInsertionRange(o,n.findOptimalPosition)));const s=Jt(o.getSelectedBlocks()),a={};return s&&Object.assign(a,e.schema.getAttributesWithProperty(s,"copyOnReplace",!0)),e.change(i=>{r.isCollapsed||e.deleteContent(r,{doNotAutoparagraph:!0});let o=t;const s=r.anchor.parent,l=e.schema.createContext(s);!e.schema.checkChild(l,t)&&e.schema.checkChild(l,"paragraph")&&e.schema.checkChild(l.push("paragraph"),t)&&(o=i.createElement("paragraph"),i.insert(t,o)),e.schema.setAllowedAttributes(o,a,i);const c=e.insertContent(o,r);return c.isCollapsed||n.setSelection&&function(e,t,i,n){const o=e.model;if("on"==i)return void e.setSelection(t,"on");if("after"!=i)throw new A("insertobject-invalid-place-parameter-value",o);let r=t.nextSibling;if(o.schema.isInline(t))return void e.setSelection(t,"after");const s=r&&o.schema.checkChild(r,"$text");!s&&o.schema.checkChild(t.parent,"paragraph")&&(r=e.createElement("paragraph"),o.schema.setAllowedAttributes(r,n,e),o.insertContent(r,e.createPositionAfter(t)));r&&e.setSelection(r,0)}(i,t,n.setSelection,a),c})}function ld(e,t){const{isForward:i,walker:n,unit:o,schema:r,treatEmojiAsSingleUnit:s}=e,{type:a,item:l,nextPosition:c}=t;if("text"==a)return"word"===e.unit?function(e,t){let i=e.position.textNode;i||(i=t?e.position.nodeAfter:e.position.nodeBefore);for(;i&&i.is("$text");){const n=e.position.offset-i.startOffset;if(ud(i,n,t))i=t?e.position.nodeAfter:e.position.nodeBefore;else{if(dd(i.data,n,t))break;e.next()}}return e.position}(n,i):function(e,t,i){const n=e.position.textNode;if(n){const o=n.data;let r=e.position.offset-n.startOffset;for(;li(o,r)||"character"==t&&ci(o,r)||i&&ui(o,r);)e.next(),r=e.position.offset-n.startOffset}return e.position}(n,o,s);if(a==(i?"elementStart":"elementEnd")){if(r.isSelectable(l))return ga._createAt(l,i?"after":"before");if(r.checkChild(c,"$text"))return c}else{if(r.isLimit(l))return void n.skip(()=>!0);if(r.checkChild(c,"$text"))return c}}function cd(e,t){const i=e.root,n=ga._createAt(i,t?"end":0);return t?new _a(e,n):new _a(n,e)}function dd(e,t,i){const n=t+(i?0:-1);return' ,.?!:;"-()'.includes(e.charAt(n))}function ud(e,t,i){return t===(i?e.offsetSize:0)}class hd extends(K()){markers;document;schema;_config;_pendingChanges;_currentWriter;constructor(e){super(),this.markers=new zc,this.document=new Dc(this),this.schema=new yl,this._config=e,this._pendingChanges=[],this._currentWriter=null,["deleteContent","modifySelection","getSelectedContent","applyOperation"].forEach(e=>this.decorate(e)),this.on("applyOperation",(e,t)=>{t[0]._validate()},{priority:"highest"}),this.schema.register("$root",{isLimit:!0}),this.schema.register("$container",{allowIn:["$root","$container"]}),this.schema.register("$block",{allowIn:["$root","$container"],isBlock:!0}),this.schema.register("$blockObject",{allowWhere:"$block",isBlock:!0,isObject:!0}),this.schema.register("$inlineObject",{allowWhere:"$text",allowAttributesOf:"$text",isInline:!0,isObject:!0}),this.schema.register("$text",{allowIn:"$block",isInline:!0,isContent:!0}),this.schema.register("$clipboardHolder",{allowContentOf:"$root",allowChildren:"$text",isLimit:!0}),this.schema.register("$documentFragment",{allowContentOf:"$root",allowChildren:"$text",isLimit:!0}),this.schema.register("$marker"),this.schema.addChildCheck(()=>!0,"$marker"),Yc(this),this.document.registerPostFixer(ul),this.on("insertContent",(e,[t,i])=>{e.return=function(e,t,i){return e.change(n=>{const o=i||e.document.selection;o.isCollapsed||e.deleteContent(o,{doNotAutoparagraph:!0});const r=new sd(e,n,o.anchor),s=[];let a;if(t.is("documentFragment")){if(t.markers.size){const e=[];for(const[i,n]of t.markers){const{start:t,end:o}=n,r=t.isEqual(o);e.push({position:t,name:i,isCollapsed:r},{position:o,name:i,isCollapsed:r})}e.sort(({position:e},{position:t})=>e.isBefore(t)?1:-1);for(const{position:i,name:o,isCollapsed:r}of e){let e=null,a=null;const l=i.parent===t&&i.isAtStart,c=i.parent===t&&i.isAtEnd;l||c?r&&(a=l?"start":"end"):(e=n.createElement("$marker"),n.insert(e,i)),s.push({name:o,element:e,collapsed:a})}}a=t.getChildren()}else a=[t];r.handleNodes(a);let l=r.getSelectionRange();if(t.is("documentFragment")&&s.length){const e=l?La.fromRange(l):null,t={};for(let e=s.length-1;e>=0;e--){const{name:i,element:o,collapsed:a}=s[e],l=!t[i];if(l&&(t[i]=[]),o){const e=n.createPositionAt(o,"before");t[i].push(e),n.remove(o)}else{const e=r.getAffectedRange();if(!e){a&&t[i].push(r.position);continue}a?t[i].push(e[a]):t[i].push(l?e.start:e.end)}}for(const[e,[i,o]]of Object.entries(t))i&&o&&i.root===o.root&&i.root.document&&!n.model.markers.has(e)&&n.addMarker(e,{usingOperation:!0,affectsData:!0,range:new _a(i,o)});e&&(l=e.toRange(),e.detach())}l&&(o instanceof ja?n.setSelection(l):o.setTo(l));const c=r.getAffectedRange()||e.createRange(o.anchor);return r.destroy(),c})}(this,t,i)}),this.on("insertObject",(e,[t,i,n])=>{e.return=ad(this,t,i,n)}),this.on("canEditAt",e=>{const t=!this.document.isReadOnly;e.return=t,t||e.stop()})}change(e){try{return 0===this._pendingChanges.length?(this._pendingChanges.push({batch:new Tc,callback:e}),this._runPendingChanges()[0]):e(this._currentWriter)}catch(e){A.rethrowUnexpectedError(e,this)}}enqueueChange(e,t){try{e?"function"==typeof e?(t=e,e=new Tc):e instanceof Tc||(e=new Tc(e)):e=new Tc,this._pendingChanges.push({batch:e,callback:t}),1==this._pendingChanges.length&&this._runPendingChanges()}catch(e){A.rethrowUnexpectedError(e,this)}}applyOperation(e){e._execute()}insertContent(e,t,i,...n){const o=md(t,i);return this.fire("insertContent",[e,o,i,...n])}insertObject(e,t,i,n,...o){const r=md(t,i);return this.fire("insertObject",[e,r,n,n,...o])}deleteContent(e,t){Xc(this,e,t)}modifySelection(e,t){!function(e,t,i={}){const n=e.schema,o="backward"!=i.direction,r=i.unit?i.unit:"character",s=!!i.treatEmojiAsSingleUnit,a=t.focus,l=new ha({boundaries:cd(a,o),singleCharacters:!0,direction:o?"forward":"backward"}),c={walker:l,schema:n,isForward:o,unit:r,treatEmojiAsSingleUnit:s};let d;for(;d=l.next();){if(d.done)return;const i=ld(c,d.value);if(i)return void(t instanceof ja?e.change(e=>{e.setSelectionFocus(i)}):t.setFocus(i))}}(this,e,t)}getSelectedContent(e){return function(e,t){return e.change(e=>{const i=e.createDocumentFragment(),n=t.getFirstRange();if(!n||n.isCollapsed)return i;const o=n.start.root,r=n.start.getCommonPath(n.end),s=o.getNodeByPath(r);let a;a=n.start.parent==n.end.parent?n:e.createRange(e.createPositionAt(s,n.start.path[r.length]),e.createPositionAt(s,n.end.path[r.length]+1));const l=a.end.offset-a.start.offset;for(const t of a.getItems({shallow:!0}))t.is("$textProxy")?e.appendText(t.data,t.getAttributes(),i):e.append(e.cloneElement(t,!0),i);if(a!=n){const t=n._getTransformedByMove(a.start,e.createPositionAt(i,0),l)[0],o=e.createRange(e.createPositionAt(i,0),t.start);rd(e.createRange(t.end,e.createPositionAt(i,"end")),e),rd(o,e)}return i})}(this,e)}hasContent(e,t={}){const i=e instanceof _a?e:_a._createIn(e);if(i.isCollapsed)return!1;const{ignoreWhitespaces:n=!1,ignoreMarkers:o=!1}=t;if(!o)for(const e of this.markers.getMarkersIntersectingRange(i))if(e.affectsData)return!0;for(const e of i.getItems())if(this.schema.isContent(e)){if(!e.is("$textProxy"))return!0;if(!n)return!0;if(-1!==e.data.search(/\S/))return!0}return!1}canEditAt(e){const t=md(e);return this.fire("canEditAt",[t])}createPositionFromPath(e,t,i){return new ga(e,t,i)}createPositionAt(e,t){return ga._createAt(e,t)}createPositionAfter(e){return ga._createAfter(e)}createPositionBefore(e){return ga._createBefore(e)}createRange(e,t){return new _a(e,t)}createRangeIn(e){return _a._createIn(e)}createRangeOn(e){return _a._createOn(e)}createSelection(...e){return new Sa(...e)}createBatch(e){return new Tc(e)}createOperationFromJSON(e){return dc.fromJSON(e,this.document)}destroy(){this.document.destroy(),this.stopListening()}_runPendingChanges(){const e=[];this.fire("_beforeChanges");try{for(;this._pendingChanges.length;){const t=this._pendingChanges[0].batch;this._currentWriter=new Hc(this,t);const i=this._pendingChanges[0].callback(this._currentWriter);e.push(i),this.document._handleChangeBlock(this._currentWriter),this._pendingChanges.shift(),this._currentWriter=null}}finally{this._pendingChanges.length=0,this._currentWriter=null,this.fire("_afterChanges")}return e}}function md(e,t){if(e)return e instanceof Sa||e instanceof ja?e:e instanceof Ia?t||0===t?new Sa(e,t):e.is("rootElement")?new Sa(e,"in"):new Sa(e,"on"):new Sa(e)}class gd extends Ws{domEventType="click";onDomEvent(e){this.fire(e.type,e)}}class fd extends Ws{domEventType=["mousedown","mouseup","mouseover","mouseout"];onDomEvent(e){this.fire(e.type,e)}}class pd extends Ws{domEventType=["touchstart","touchend","touchmove"];onDomEvent(e){this.fire(e.type,e)}}class bd extends Ws{domEventType=["pointerdown","pointerup","pointermove"];onDomEvent(e){this.fire(e.type,e)}}class kd{document;constructor(e){this.document=e}createDocumentFragment(e){return new Jr(this.document,e)}createElement(e,t,i){return new fr(this.document,e,t,i)}createText(e){return new jo(this.document,e)}clone(e,t=!1){return e._clone(t)}appendChild(e,t){return t._appendChild(e)}insertChild(e,t,i){return i._insertChild(e,t)}removeChildren(e,t,i){return i._removeChildren(e,t)}remove(e){const t=e.parent;return t?this.removeChildren(t.getChildIndex(e),1,t):[]}replace(e,t){const i=e.parent;if(i){const n=i.getChildIndex(e);return this.removeChildren(n,1,i),this.insertChild(n,t,i),!0}return!1}unwrapElement(e){const t=e.parent;if(t){const i=t.getChildIndex(e);this.remove(e),this.insertChild(i,e.getChildren(),t)}}rename(e,t){const i=new fr(this.document,e,t.getAttributes(),t.getChildren());return this.replace(t,i)?i:null}setAttribute(e,t,i){i._setAttribute(e,t)}removeAttribute(e,t){t._removeAttribute(e)}addClass(e,t){t._addClass(e)}removeClass(e,t){t._removeClass(e)}setStyle(e,t,i){re(e)&&void 0===i?t._setStyle(e):i._setStyle(e,t)}removeStyle(e,t){t._removeStyle(e)}setCustomProperty(e,t,i){i._setCustomProperty(e,t)}removeCustomProperty(e,t){return t._removeCustomProperty(e)}createPositionAt(e,t){return xr._createAt(e,t)}createPositionAfter(e){return xr._createAfter(e)}createPositionBefore(e){return xr._createBefore(e)}createRange(e,t){return new Cr(e,t)}createRangeOn(e){return Cr._createOn(e)}createRangeIn(e){return Cr._createIn(e)}createSelection(...e){return new Er(...e)}}new Set(["black","silver","gray","white","maroon","red","purple","fuchsia","green","lime","olive","yellow","navy","blue","teal","aqua","orange","aliceblue","antiquewhite","aquamarine","azure","beige","bisque","blanchedalmond","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","gainsboro","ghostwhite","gold","goldenrod","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","limegreen","linen","magenta","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","oldlace","olivedrab","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","thistle","tomato","turquoise","violet","wheat","whitesmoke","yellowgreen","activeborder","activecaption","appworkspace","background","buttonface","buttonhighlight","buttonshadow","buttontext","captiontext","graytext","highlight","highlighttext","inactiveborder","inactivecaption","inactivecaptiontext","infobackground","infotext","menu","menutext","scrollbar","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","window","windowframe","windowtext","rebeccapurple","currentcolor","transparent"]);Symbol("_treeDump");class wd extends Zn{view;_toolbarConfig;_elementReplacer;constructor(e,t){super(e),this.view=t,this._toolbarConfig=eo(e.config.get("toolbar")),this._elementReplacer=new X,this.listenTo(e.editing.view,"scrollToTheSelection",this._handleScrollToTheSelectionWithStickyPanel.bind(this))}get element(){return this.view.element}init(e){const t=this.editor,i=this.view,n=t.editing.view,o=i.editable,r=n.document.getRoot();o.name=r.rootName,i.render();const s=o.element;this.setEditableElement(o.name,s),i.editable.bind("isFocused").to(this.focusTracker),n.attachDomRoot(s),e&&this._elementReplacer.replace(e,this.element),this._initPlaceholder(),this._initToolbar(),i.menuBarView&&this.initMenuBar(i.menuBarView),this._initDialogPluginIntegration(),this._initContextualBalloonIntegration(),this.fire("ready")}destroy(){super.destroy();const e=this.view,t=this.editor.editing.view;this._elementReplacer.restore(),t.getDomRoot(e.editable.name)&&t.detachDomRoot(e.editable.name),e.destroy()}_initToolbar(){const e=this.view;e.stickyPanel.bind("isActive").to(this.focusTracker,"isFocused"),e.stickyPanel.limiterElement=e.element,e.stickyPanel.bind("viewportTopOffset").to(this,"viewportOffset",({visualTop:e})=>e||0),e.toolbar.fillFromConfig(this._toolbarConfig,this.componentFactory),this.addToolbar(e.toolbar)}_initPlaceholder(){const e=this.editor,t=e.editing.view,i=t.document.getRoot(),n=e.sourceElement;let o;const r=e.config.get("placeholder");r&&(o="string"==typeof r?r:r[this.view.editable.name]),!o&&n&&"textarea"===n.tagName.toLowerCase()&&(o=n.getAttribute("placeholder")),o&&(i.placeholder=o),No({view:t,element:i,isDirectHost:!1,keepOnFocus:!0})}_initContextualBalloonIntegration(){if(!this.editor.plugins.has("ContextualBalloon"))return;const{stickyPanel:e}=this.view,t=this.editor.plugins.get("ContextualBalloon");t.on("getPositionOptions",t=>{const i=t.return;if(!i||!e.isSticky||!e.element)return;const n=new Ze(e.element).height,o="function"==typeof i.target?i.target():i.target,r="function"==typeof i.limiter?i.limiter():i.limiter;if(o&&r&&new Ze(o).height>=new Ze(r).height-n)return;const s={...i.viewportOffsetConfig},a=(s.top||0)+n;t.return={...i,viewportOffsetConfig:{...s,top:a}}},{priority:"low"});const i=()=>{t.visibleView&&t.updatePosition()};this.listenTo(e,"change:isSticky",i),this.listenTo(this.editor.ui,"change:viewportOffset",i)}_handleScrollToTheSelectionWithStickyPanel(e,t,i){const n=this.view.stickyPanel;if(n.isSticky){const e=new Ze(n.element).height;t.viewportOffset.top+=e}else{const e=()=>{this.editor.editing.view.scrollToTheSelection(i)};this.listenTo(n,"change:isSticky",e),setTimeout(()=>{this.stopListening(n,"change:isSticky",e)},20)}}_initDialogPluginIntegration(){if(!this.editor.plugins.has("Dialog"))return;const e=this.view.stickyPanel,t=this.editor.plugins.get("Dialog");t.on("show",()=>{const i=t.view;i.on("moveTo",(t,n)=>{if(!e.isSticky||i.wasMoved||i.isModal)return;const o=new Ze(e.contentPanelElement);n[1]<o.bottom+So.defaultOffset&&(n[1]=o.bottom+So.defaultOffset)},{priority:"high"})},{priority:"low"})}}class _d extends pi{locale;_bodyCollectionContainer;static _bodyWrapper;constructor(e,t=[]){super(t),this.locale=e}get bodyCollectionContainer(){return this._bodyCollectionContainer}attachToDom(){this._bodyCollectionContainer=new bi({tag:"div",attributes:{class:["ck","ck-reset_all","ck-body","ck-rounded-corners"],dir:this.locale.uiLanguageDirection,role:"application"},children:this}).render(),_d._bodyWrapper&&_d._bodyWrapper.isConnected||(_d._bodyWrapper=oe(document,"div",{class:"ck-body-wrapper"}),document.body.appendChild(_d._bodyWrapper)),_d._bodyWrapper.appendChild(this._bodyCollectionContainer)}detachFromDom(){super.destroy(),this._bodyCollectionContainer&&this._bodyCollectionContainer.remove(),_d._bodyWrapper&&!_d._bodyWrapper.childElementCount&&(_d._bodyWrapper.remove(),delete _d._bodyWrapper)}}var vd=i(178),yd={attributes:{"data-cke":!0}};yd.setAttributes=Ki(),yd.insert=$i().bind(null,"head"),yd.domAPI=Hi(),yd.insertStyleElement=Yi();ji()(vd.A,yd);vd.A&&vd.A.locals&&vd.A.locals;class Ad extends Zi{body;menuBarView;toolbar;constructor(e){super(e),this.body=new _d(e)}render(){super.render(),this.body.attachToDom()}destroy(){return this.body.detachFromDom(),super.destroy()}}var xd=i(4606),Cd={attributes:{"data-cke":!0}};Cd.setAttributes=Ki(),Cd.insert=$i().bind(null,"head"),Cd.domAPI=Hi(),Cd.insertStyleElement=Yi();ji()(xd.A,Cd);xd.A&&xd.A.locals&&xd.A.locals;class Td extends Zi{id;constructor(e){super(e),this.set("text",void 0),this.set("for",void 0),this.id=`ck-editor__label_${_()}`;const t=this.bindTemplate;this.setTemplate({tag:"label",attributes:{class:["ck","ck-label"],id:this.id,for:t.to("for")},children:[{text:t.to("text")}]})}}class Ed extends Ad{top;main;_voiceLabelView;constructor(e){super(e),this.top=this.createCollection(),this.main=this.createCollection(),this._voiceLabelView=this._createVoiceLabel(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-editor","ck-rounded-corners"],role:"application",dir:e.uiLanguageDirection,lang:e.uiLanguage,"aria-labelledby":this._voiceLabelView.id},children:[this._voiceLabelView,{tag:"div",attributes:{class:["ck","ck-editor__top","ck-reset_all"],role:"presentation"},children:this.top},{tag:"div",attributes:{class:["ck","ck-editor__main"],role:"presentation"},children:this.main}]})}_createVoiceLabel(){const e=this.t,t=new Td;return t.text=e("Rich Text Editor"),t.extendTemplate({attributes:{class:"ck-voice-label"}}),t}}var Id=i(7289),Sd={attributes:{"data-cke":!0}};Sd.setAttributes=Ki(),Sd.insert=$i().bind(null,"head"),Sd.domAPI=Hi(),Sd.insertStyleElement=Yi();ji()(Id.A,Sd);Id.A&&Id.A.locals&&Id.A.locals;const Pd=st("px");class Md extends Zi{content;contentPanelElement;_contentPanelPlaceholder;constructor(e){super(e);const t=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("_isStickyToTheBottomOfLimiter",!1),this.set("_stickyTopOffset",null),this.set("_stickyBottomOffset",null),this.content=this.createCollection(),this._contentPanelPlaceholder=new bi({tag:"div",attributes:{class:["ck","ck-sticky-panel__placeholder"],style:{display:t.to("isSticky",e=>e?"block":"none"),height:t.to("isSticky",e=>e?Pd(this._contentPanelRect.height):null)}}}).render(),this.contentPanelElement=new bi({tag:"div",attributes:{class:["ck","ck-sticky-panel__content",t.if("isSticky","ck-sticky-panel__content_sticky"),t.if("_isStickyToTheBottomOfLimiter","ck-sticky-panel__content_sticky_bottom-limit")],style:{width:t.to("isSticky",e=>e?Pd(this._contentPanelPlaceholder.getBoundingClientRect().width):null),top:t.to("_stickyTopOffset",e=>e?Pd(e):e),bottom:t.to("_stickyBottomOffset",e=>e?Pd(e):e),marginLeft:t.to("_marginLeft")}},children:this.content}).render(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-sticky-panel"]},children:[this._contentPanelPlaceholder,this.contentPanelElement]})}render(){super.render(),this.checkIfShouldBeSticky(),this.listenTo(e.document,"scroll",()=>{this.checkIfShouldBeSticky()},{useCapture:!0}),this.listenTo(this,"change:isActive",()=>{this.checkIfShouldBeSticky()}),e.window.visualViewport&&(this.listenTo(e.window.visualViewport,"scroll",()=>{this.checkIfShouldBeSticky()}),this.listenTo(e.window.visualViewport,"resize",()=>{this.checkIfShouldBeSticky()}))}checkIfShouldBeSticky(){if(!this.limiterElement||!this.isActive)return void this._unstick();const t=new Ze(this.limiterElement);let i=t.getVisible();if(i){const t=new Ze(e.window);t.top+=this.viewportTopOffset,t.height-=this.viewportTopOffset,i=i.getIntersection(t)}const{left:n,top:o}=bt();if(t.moveBy(n,o),i&&i.moveBy(n,o),i&&t.top<i.top)if(this._contentPanelRect.height+this.limiterBottomOffset>i.height){const e=Math.max(t.bottom-i.bottom,0)+this.limiterBottomOffset;this._contentPanelRect.height+e+1<t.height?this._stickToBottomOfLimiter(e):this._unstick()}else this._contentPanelRect.height+this.limiterBottomOffset<t.height?this._stickToTopOfAncestors(i.top):this._unstick();else this._unstick()}_stickToTopOfAncestors(t){this.isSticky=!0,this._isStickyToTheBottomOfLimiter=!1,this._stickyTopOffset=t,this._stickyBottomOffset=null,this._marginLeft=Pd(-e.window.scrollX+bt().left)}_stickToBottomOfLimiter(t){this.isSticky=!0,this._isStickyToTheBottomOfLimiter=!0,this._stickyTopOffset=null,this._stickyBottomOffset=t,this._marginLeft=Pd(-e.window.scrollX+bt().left)}_unstick(){this.isSticky=!1,this._isStickyToTheBottomOfLimiter=!1,this._stickyTopOffset=null,this._stickyBottomOffset=null,this._marginLeft=null}get _contentPanelRect(){return new Ze(this.contentPanelElement)}}class Od extends Zi{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__separator"]}})}}class Rd extends Zi{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__line-break"]}})}}class Nd extends Zi{children;constructor(e){super(e);const t=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",t.to("position",e=>`ck-dropdown__panel_${e}`),t.if("isVisible","ck-dropdown__panel-visible")],tabindex:"-1"},children:this.children,on:{selectstart:t.to(e=>{const t=e.target;t instanceof Element&&"input"===t.tagName.toLocaleLowerCase()||e.preventDefault()})}})}focus(){if(this.children.length){const e=this.children.first;"function"==typeof e.focus?e.focus():x("ui-dropdown-panel-focus-child-missing-focus",{childView:this.children.first,dropdownPanel:this})}}focusLast(){if(this.children.length){const e=this.children.last;"function"==typeof e.focusLast?e.focusLast():e.focus()}}}var Vd=i(426),Ld={attributes:{"data-cke":!0}};Ld.setAttributes=Ki(),Ld.insert=$i().bind(null,"head"),Ld.domAPI=Hi(),Ld.insertStyleElement=Yi();ji()(Vd.A,Ld);Vd.A&&Vd.A.locals&&Vd.A.locals;class Dd extends Zi{buttonView;panelView;focusTracker;keystrokes;listView;toolbarView;menuView;constructor(e,t,i){super(e);const n=this.bindTemplate;this.buttonView=t,this.panelView=i,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("class",void 0),this.set("id",void 0),this.set("panelPosition","auto"),this.panelView.bind("isVisible").to(this,"isOpen"),this.keystrokes=new ti,this.focusTracker=new Qt,this.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown",n.to("class"),n.if("isEnabled","ck-disabled",e=>!e)],id:n.to("id"),"aria-describedby":n.to("ariaDescribedById")},children:[t,i]}),t.extendTemplate({attributes:{class:["ck-dropdown__button"],"data-cke-tooltip-disabled":n.to("isOpen")}})}render(){super.render(),this.focusTracker.add(this.buttonView.element),this.focusTracker.add(this.panelView.element),this.listenTo(this.buttonView,"open",()=>{this.isOpen=!this.isOpen}),this.on("change:isOpen",(e,t,i)=>{if(i)if("auto"===this.panelPosition){const e=Dd._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions});this.panelView.position=e?e.name:this._defaultPanelPositionName}else this.panelView.position=this.panelPosition}),this.keystrokes.listenTo(this.element);const e=(e,t)=>{this.isOpen&&(this.isOpen=!1,t())};this.keystrokes.set("arrowdown",(e,t)=>{this.buttonView.isEnabled&&!this.isOpen&&(this.isOpen=!0,t())}),this.keystrokes.set("arrowright",(e,t)=>{this.isOpen&&t()}),this.keystrokes.set("arrowleft",e),this.keystrokes.set("esc",e)}focus(){this.buttonView.focus()}get _panelPositions(){const{south:e,north:t,southEast:i,southWest:n,northEast:o,northWest:r,southMiddleEast:s,southMiddleWest:a,northMiddleEast:l,northMiddleWest:c}=Dd.defaultPanelPositions;return"rtl"!==this.locale.uiLanguageDirection?[i,n,s,a,e,o,r,l,c,t]:[n,i,a,s,e,r,o,c,l,t]}get _defaultPanelPositionName(){return"rtl"===this.locale.uiLanguageDirection?"sw":"se"}static defaultPanelPositions={south:(e,t)=>({top:e.bottom,left:e.left-(t.width-e.width)/2,name:"s"}),southEast:e=>({top:e.bottom,left:e.left,name:"se"}),southWest:(e,t)=>({top:e.bottom,left:e.left-t.width+e.width,name:"sw"}),southMiddleEast:(e,t)=>({top:e.bottom,left:e.left-(t.width-e.width)/4,name:"sme"}),southMiddleWest:(e,t)=>({top:e.bottom,left:e.left-3*(t.width-e.width)/4,name:"smw"}),north:(e,t)=>({top:e.top-t.height,left:e.left-(t.width-e.width)/2,name:"n"}),northEast:(e,t)=>({top:e.top-t.height,left:e.left,name:"ne"}),northWest:(e,t)=>({top:e.top-t.height,left:e.left-t.width+e.width,name:"nw"}),northMiddleEast:(e,t)=>({top:e.top-t.height,left:e.left-(t.width-e.width)/4,name:"nme"}),northMiddleWest:(e,t)=>({top:e.top-t.height,left:e.left-3*(t.width-e.width)/4,name:"nmw"})};static _getOptimalPosition=ht}const Bd='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10"><path d="M.941 4.523a.75.75 0 1 1 1.06-1.06l3.006 3.005 3.005-3.005a.75.75 0 1 1 1.06 1.06l-3.549 3.55a.75.75 0 0 1-1.168-.136z"/></svg>';class zd extends lo{arrowView;constructor(e){super(e),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{"aria-haspopup":!0,"aria-expanded":this.bindTemplate.to("isOn",e=>String(e))}}),this.delegate("execute").to(this,"open")}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){const e=new wn;return e.content=Bd,e.extendTemplate({attributes:{class:"ck-dropdown__arrow"}}),e}}class Fd extends Zi{constructor(e){super(e),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__separator"]}})}}class jd extends Zi{labelView;items;children;constructor(e,t=new Td){super(e);const i=this.bindTemplate,n=new Wd(e);this.set({label:"",isVisible:!0}),this.labelView=t,this.labelView.bind("text").to(this,"label"),this.children=this.createCollection(),this.children.addMany([this.labelView,n]),n.set({role:"group",ariaLabelledBy:t.id}),n.focusTracker.destroy(),n.keystrokes.destroy(),this.items=n.items,this.setTemplate({tag:"li",attributes:{role:"presentation",class:["ck","ck-list__group",i.if("isVisible","ck-hidden",e=>!e)]},children:this.children})}focus(){if(this.items){const e=this.items.find(e=>!(e instanceof Fd));e&&e.focus()}}}var Ud=i(6048),Hd={attributes:{"data-cke":!0}};Hd.setAttributes=Ki(),Hd.insert=$i().bind(null,"head"),Hd.domAPI=Hi(),Hd.insertStyleElement=Yi();ji()(Ud.A,Hd);Ud.A&&Ud.A.locals&&Ud.A.locals;class Wd extends Zi{focusables;items;focusTracker;keystrokes;_focusCycler;_listItemGroupToChangeListeners=new WeakMap;constructor(e){super(e);const t=this.bindTemplate;this.focusables=new pi,this.items=this.createCollection(),this.focusTracker=new Qt,this.keystrokes=new ti,this._focusCycler=new uo({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowup",focusNext:"arrowdown"}}),this.set("ariaLabel",void 0),this.set("ariaLabelledBy",void 0),this.set("role",void 0),this.setTemplate({tag:"ul",attributes:{class:["ck","ck-reset","ck-list"],role:t.to("role"),"aria-label":t.to("ariaLabel"),"aria-labelledby":t.to("ariaLabelledBy")},children:this.items})}render(){super.render();for(const e of this.items)e instanceof jd?this._registerFocusableItemsGroup(e):e instanceof Mn&&this._registerFocusableListItem(e);this.items.on("change",(e,t)=>{for(const e of t.removed)e instanceof jd?this._deregisterFocusableItemsGroup(e):e instanceof Mn&&this._deregisterFocusableListItem(e);for(const e of Array.from(t.added).reverse())e instanceof jd?this._registerFocusableItemsGroup(e,t.index):this._registerFocusableListItem(e,t.index)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}focusFirst(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}_registerFocusableListItem(e,t){this.focusTracker.add(e.element),this.focusables.add(e,t)}_deregisterFocusableListItem(e){this.focusTracker.remove(e.element),this.focusables.remove(e)}_getOnGroupItemsChangeCallback(e){return(t,i)=>{for(const e of i.removed)this._deregisterFocusableListItem(e);for(const t of Array.from(i.added).reverse())this._registerFocusableListItem(t,this.items.getIndex(e)+i.index)}}_registerFocusableItemsGroup(e,t){Array.from(e.items).forEach((e,i)=>{const n=void 0!==t?t+i:void 0;this._registerFocusableListItem(e,n)});const i=this._getOnGroupItemsChangeCallback(e);this._listItemGroupToChangeListeners.set(e,i),e.items.on("change",i)}_deregisterFocusableItemsGroup(e){for(const t of e.items)this._deregisterFocusableListItem(t);e.items.off("change",this._listItemGroupToChangeListeners.get(e)),this._listItemGroupToChangeListeners.delete(e)}}var $d=i(7133),qd={attributes:{"data-cke":!0}};qd.setAttributes=Ki(),qd.insert=$i().bind(null,"head"),qd.domAPI=Hi(),qd.insertStyleElement=Yi();ji()($d.A,qd);$d.A&&$d.A.locals&&$d.A.locals;class Kd extends Zi{children;actionView;arrowView;keystrokes;focusTracker;constructor(e,t){super(e);const i=this.bindTemplate;this.set("class",void 0),this.set("labelStyle",void 0),this.set("icon",void 0),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isToggleable",!1),this.set("isVisible",!0),this.set("keystroke",void 0),this.set("withKeystroke",!1),this.set("label",void 0),this.set("tabindex",-1),this.set("tooltip",!1),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.children=this.createCollection(),this.actionView=this._createActionView(t),this.arrowView=this._createArrowView(),this.keystrokes=new ti,this.focusTracker=new Qt,this.setTemplate({tag:"div",attributes:{class:["ck","ck-splitbutton",i.to("class"),i.if("isVisible","ck-hidden",e=>!e),this.arrowView.bindTemplate.if("isOn","ck-splitbutton_open")]},children:this.children})}render(){super.render(),this.children.add(this.actionView),this.children.add(this.arrowView),this.focusTracker.add(this.actionView.element),this.focusTracker.add(this.arrowView.element),this.keystrokes.listenTo(this.element),this.keystrokes.set("arrowright",(e,t)=>{this.focusTracker.focusedElement===this.actionView.element&&(this.arrowView.focus(),t())}),this.keystrokes.set("arrowleft",(e,t)=>{this.focusTracker.focusedElement===this.arrowView.element&&(this.actionView.focus(),t())})}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this.actionView.focus()}_createActionView(e){const t=e||new lo;return e||t.bind("icon","isEnabled","isOn","isToggleable","keystroke","label","tabindex","tooltip","tooltipPosition","type","withText").to(this),t.extendTemplate({attributes:{class:"ck-splitbutton__action"}}),t.delegate("execute").to(this),t}_createArrowView(){const e=new lo,t=e.bindTemplate;return e.icon=Bd,e.extendTemplate({attributes:{class:["ck-splitbutton__arrow"],"data-cke-tooltip-disabled":t.to("isOn"),"aria-haspopup":!0,"aria-expanded":t.to("isOn",e=>String(e))}}),e.bind("isEnabled").to(this),e.bind("label").to(this),e.bind("tooltip").to(this),e.delegate("execute").to(this,"open"),e}}var Gd=i(9624),Yd={attributes:{"data-cke":!0}};Yd.setAttributes=Ki(),Yd.insert=$i().bind(null,"head"),Yd.domAPI=Hi(),Yd.insertStyleElement=Yi();ji()(Gd.A,Yd);Gd.A&&Gd.A.locals&&Gd.A.locals;class Jd extends lo{toggleSwitchView;constructor(e){super(e),this.isToggleable=!0,this.toggleSwitchView=this._createToggleView(),this.extendTemplate({attributes:{class:"ck-switchbutton"}})}render(){super.render(),this.children.add(this.toggleSwitchView)}_createToggleView(){const e=new Zi;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__toggle"]},children:[{tag:"span",attributes:{class:["ck","ck-button__toggle__inner"]}}]}),e}}var Qd=i(7475),Zd={attributes:{"data-cke":!0}};Zd.setAttributes=Ki(),Zd.insert=$i().bind(null,"head"),Zd.domAPI=Hi(),Zd.insertStyleElement=Yi();ji()(Qd.A,Zd);Qd.A&&Qd.A.locals&&Qd.A.locals;var Xd=i(2454),eu={attributes:{"data-cke":!0}};eu.setAttributes=Ki(),eu.insert=$i().bind(null,"head"),eu.domAPI=Hi(),eu.insertStyleElement=Yi();ji()(Xd.A,eu);Xd.A&&Xd.A.locals&&Xd.A.locals;const tu='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M6.972 16.615a1 1 0 0 1-.744-.292l-4.596-4.596a1 1 0 1 1 1.414-1.414l3.926 3.926 9.937-9.937a1 1 0 0 1 1.414 1.415L7.717 16.323a1 1 0 0 1-.745.292"/></svg>';var iu=i(3389),nu={attributes:{"data-cke":!0}};nu.setAttributes=Ki(),nu.insert=$i().bind(null,"head"),nu.domAPI=Hi(),nu.insertStyleElement=Yi();ji()(iu.A,nu);iu.A&&iu.A.locals&&iu.A.locals;class ou extends lo{_checkIconHolderView=new ru;constructor(e,t=new ro){super(e,t),this.set({hasCheckSpace:!1,_hasCheck:this.isToggleable});const i=this.bindTemplate;this.extendTemplate({attributes:{class:["ck-list-item-button",i.if("isToggleable","ck-list-item-button_toggleable")]}}),this.bind("_hasCheck").to(this,"hasCheckSpace",this,"isToggleable",(e,t)=>e||t)}render(){super.render(),this._hasCheck&&this.children.add(this._checkIconHolderView,0),this._watchCheckIconHolderMount()}_watchCheckIconHolderMount(){this._checkIconHolderView.bind("isOn").to(this,"isOn",e=>this.isToggleable&&e),this.on("change:_hasCheck",(e,t,i)=>{const{children:n,_checkIconHolderView:o}=this;i?n.add(o,0):n.remove(o)})}}class ru extends Zi{children;_checkIconView=this._createCheckIconView();constructor(){super();const e=this.bindTemplate;this.children=this.createCollection(),this.set("isOn",!1),this.setTemplate({tag:"span",children:this.children,attributes:{class:["ck","ck-list-item-button__check-holder",e.to("isOn",e=>e?"ck-on":"ck-off")]}})}render(){super.render(),this.isOn&&this.children.add(this._checkIconView,0),this._watchCheckIconMount()}_watchCheckIconMount(){this.on("change:isOn",(e,t,i)=>{const{children:n,_checkIconView:o}=this;i&&!n.has(o)?n.add(o):!i&&n.has(o)&&n.remove(o)})}_createCheckIconView(){const e=new wn;return e.content=tu,e.extendTemplate({attributes:{class:"ck-list-item-button__check-icon"}}),e}}function su(t,i=zd){const n="function"==typeof i?new i(t):i,o=new Nd(t),r=new Dd(t,n,o);return n.bind("isEnabled").to(r),n instanceof Kd?n.arrowView.bind("isOn").to(r,"isOpen"):n.bind("isOn").to(r,"isOpen"),function(t){(function(e){Vn({emitter:e,activator:()=>e.isRendered&&e.isOpen,callback:()=>{e.isOpen=!1},contextElements:()=>[e.element,...hu(e.focusTracker).filter(t=>!e.element.contains(t))]})})(t),function(e){e.on("execute",t=>{t.source instanceof Jd||(e.isOpen=!1)})}(t),function(e){e.focusTracker.on("change:isFocused",(t,i,n)=>{!n&&e.isOpen&&(e.isOpen=!1)})}(t),function(e){e.keystrokes.set("arrowdown",(t,i)=>{e.isOpen&&(e.panelView.focus(),i())}),e.keystrokes.set("arrowup",(t,i)=>{e.isOpen&&(e.panelView.focusLast(),i())})}(t),function(t){t.on("change:isOpen",(i,n,o)=>{if(o)return;t.focusTracker.elements.some(t=>t.contains(e.document.activeElement))&&t.buttonView.focus()})}(t),function(e){e.on("change:isOpen",(t,i,n)=>{n&&e.panelView.focus()},{priority:"low"})}(t)}(r),r}function au(e,t,i={}){e.extendTemplate({attributes:{class:["ck-toolbar-dropdown"]}}),e.isOpen?lu(e,t,i):e.once("change:isOpen",()=>lu(e,t,i),{priority:"highest"}),i.enableActiveItemFocusOnDropdownOpen&&uu(e,()=>e.toolbarView.items.find(e=>e.isOn))}function lu(e,t,i){const n=e.locale,o=n.t,r=e.toolbarView=new wu(n),s="function"==typeof t?t():t;r.ariaLabel=i.ariaLabel||o("Dropdown toolbar"),i.maxWidth&&(r.maxWidth=i.maxWidth),i.class&&(r.class=i.class),i.isCompact&&(r.isCompact=i.isCompact),i.isVertical&&(r.isVertical=!0),s instanceof pi?r.items.bindTo(s).using(e=>e):r.items.addMany(s),e.panelView.children.add(r),e.focusTracker.add(r),r.items.delegate("execute").to(e)}function cu(e,t,i={}){e.isOpen?du(e,t,i):e.once("change:isOpen",()=>du(e,t,i),{priority:"highest"}),uu(e,()=>e.listView.items.find(e=>e instanceof Mn&&e.children.first.isOn))}function du(e,t,i){const n=e.locale,o=e.listView=new Wd(n),r="function"==typeof t?t():t;o.ariaLabel=i.ariaLabel,o.role=i.role,mu(e,o.items,r,n),e.panelView.children.add(o),o.items.delegate("execute").to(e)}function uu(e,t){e.on("change:isOpen",()=>{if(!e.isOpen)return;const i=t();i&&("function"==typeof i.focus?i.focus():x("ui-dropdown-focus-child-on-open-child-missing-focus",{view:i}))},{priority:v.low-10})}function hu(e){return[...e.elements,...e.externalViews.flatMap(e=>hu(e.focusTracker))]}function mu(e,t,i,n){!function(e){let t=0;const i=e=>e instanceof Mn&&e.children.first instanceof ou?e.children.first:null,n=e=>{const t=i(e);return t&&t.isToggleable?t:null},o=t=>{for(const n of e){const e=i(n);e&&(e.hasCheckSpace=t)}};e.on("change",(e,r)=>{const s=t>0;for(const e of r.removed)n(e)&&t--;for(const e of r.added){const n=i(e);n&&(n.isToggleable&&t++,n.hasCheckSpace=t>0)}const a=t>0;s!==a&&o(a)})}(t),t.bindTo(i).using(t=>{if("separator"===t.type)return new Fd(n);if("group"===t.type){const i=new jd(n);return i.set({label:t.label}),mu(e,i.items,t.items,n),i.items.delegate("execute").to(e),i}if("button"===t.type||"switchbutton"===t.type){const e="menuitemcheckbox"===t.model.role||"menuitemradio"===t.model.role,i=new Mn(n);let o;return"button"===t.type?(o=new ou(n,t.labelView),o.set({isToggleable:e})):o=new Jd(n),o.bind(...Object.keys(t.model)).to(t.model),o.delegate("execute").to(i),i.children.add(o),i}return null})}const gu='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M10.187 17H5.773q-.956 0-1.364-.415-.41-.416-.409-1.323V4.738q0-.926.419-1.332.418-.405 1.354-.406h4.68q1.035 0 1.793.124.76.124 1.36.478.512.296.906.75a3.26 3.26 0 0 1 .808 2.162q0 2.102-2.167 3.075 2.846.879 2.847 3.421a3.76 3.76 0 0 1-2.296 3.504 6 6 0 0 1-1.517.377q-.857.11-2 .11zm-.217-6.217H7v4.087h3.069q2.965 0 2.965-2.072 0-1.061-.768-1.537-.768-.478-2.296-.478M7 5.13v3.619h2.606q1.093 0 1.69-.2a1.6 1.6 0 0 0 .91-.765q.247-.4.247-.897 0-1.06-.778-1.409-.778-.348-2.375-.348z"/></svg>',fu='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><circle cx="9.5" cy="4.5" r="1.5"/><circle cx="9.5" cy="10.5" r="1.5"/><circle cx="9.5" cy="16.5" r="1.5"/></svg>';var pu=i(66),bu={attributes:{"data-cke":!0}};bu.setAttributes=Ki(),bu.insert=$i().bind(null,"head"),bu.domAPI=Hi(),bu.insertStyleElement=Yi();ji()(pu.A,bu);pu.A&&pu.A.locals&&pu.A.locals;const ku=(()=>({alignLeft:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75m0 8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75m0 4c0 .414.336.75.75.75h9.929a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75m0-8c0 .414.336.75.75.75h9.929a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75"/></svg>',bold:gu,importExport:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M19 4.5 14 0H3v12.673l.868-1.041c.185-.222.4-.402.632-.54V1.5h8v5h5v7.626a2.24 2.24 0 0 1 1.5.822zM14 5V2l3.3 3zm-3.692 12.5q.093.157.213.303L11.52 19H8v-.876a2.24 2.24 0 0 0 1.82-.624zm7.518-.657a.75.75 0 0 0-1.152-.96L15.5 17.29V12H14v5.29l-1.174-1.408a.75.75 0 0 0-1.152.96l2.346 2.816a.95.95 0 0 0 1.46 0zm-15.056-.38a.75.75 0 0 1-.096-1.056l2.346-2.815a.95.95 0 0 1 1.46 0l2.346 2.815a.75.75 0 1 1-1.152.96L6.5 14.96V20H5v-5.04l-1.174 1.408a.75.75 0 0 1-1.056.096Z"/></svg>',paragraph:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M10.5 5.5H7v5h3.5a2.5 2.5 0 1 0 0-5M5 3h6.5v.025a5 5 0 0 1 0 9.95V13H7v4a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1"/></svg>',plus:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M10 2a1 1 0 0 0-1 1v6H3a1 1 0 1 0 0 2h6v6a1 1 0 1 0 2 0v-6h6a1 1 0 1 0 0-2h-6V3a1 1 0 0 0-1-1"/></svg>',text:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M9.816 11.5 7.038 4.785 4.261 11.5zm.62 1.5H3.641l-1.666 4.028H.312l5.789-14h1.875l5.789 14h-1.663z"/><path d="m12.09 17-.534-1.292.848-1.971.545 1.319L12.113 17zm1.142-5.187.545 1.319L15.5 9.13l1.858 4.316h-3.45l.398.965h3.467L18.887 17H20l-3.873-9h-1.254z"/></svg>',threeVerticalDots:fu,pilcrow:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M6.999 2H15a1 1 0 0 1 0 2h-1.004v13a1 1 0 1 1-2 0V4H8.999v13a1 1 0 1 1-2 0v-7A4 4 0 0 1 3 6a4 4 0 0 1 3.999-4"/></svg>',dragIndicator:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M5 3.25a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0m7 0a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0M5 10a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0m7 0a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0m-7 6.75a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0m7 0a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0"/></svg>'}))();class wu extends Zi{options;items;focusTracker;keystrokes;itemsView;children;focusables;_focusCycler;_behavior;constructor(e,t){super(e);const i=this.bindTemplate,n=this.t;this.options=t||{},this.set("ariaLabel",n("Editor toolbar")),this.set("maxWidth","auto"),this.set("role","toolbar"),this.set("isGrouping",!!this.options.shouldGroupWhenFull),this.items=this.createCollection(),this.focusTracker=new Qt,this.keystrokes=new ti,this.set("class",void 0),this.set("isCompact",!1),this.set("isVertical",!1),this.itemsView=new _u(e),this.children=this.createCollection(),this.children.add(this.itemsView),this.focusables=this.createCollection();const o="rtl"===e.uiLanguageDirection;this._focusCycler=new uo({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:[o?"arrowright":"arrowleft","arrowup"],focusNext:[o?"arrowleft":"arrowright","arrowdown"]}});const r=["ck","ck-toolbar",i.to("class"),i.if("isCompact","ck-toolbar_compact"),i.if("isGrouping","ck-toolbar_grouping"),i.if("isVertical","ck-toolbar_vertical")];var s;this.options.shouldGroupWhenFull&&this.options.isFloating&&r.push("ck-toolbar_floating"),this.setTemplate({tag:"div",attributes:{class:r,role:i.to("role"),"aria-label":i.to("ariaLabel"),style:{maxWidth:i.to("maxWidth")},tabindex:-1},children:this.children,on:{mousedown:(s=this,s.bindTemplate.to(e=>{e.target===s.element&&e.preventDefault()}))}}),this._behavior=this.options.shouldGroupWhenFull?new yu(this):new vu(this)}render(){super.render(),this.focusTracker.add(this.element);for(const e of this.items)this.focusTracker.add(e);this.items.on("add",(e,t)=>{this.focusTracker.add(t)}),this.items.on("remove",(e,t)=>{this.focusTracker.remove(t)}),this.keystrokes.listenTo(this.element),this._behavior.render(this)}destroy(){return this._behavior.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy(),super.destroy()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}fillFromConfig(e,t,i){this.items.addMany(this._buildItemsFromConfig(e,t,i))}switchBehavior(e){this._behavior.type!==e&&(this._behavior.destroy(),this.itemsView.children.clear(),this.focusables.clear(),"dynamic"===e?(this._behavior=new yu(this),this._behavior.render(this),this._behavior.refreshItems()):(this._behavior=new vu(this),this._behavior.render(this)))}_buildItemsFromConfig(e,t,i){const n=eo(e),o=i||n.removeItems;return this._cleanItemsConfiguration(n.items,t,o).map(e=>F(e)?this._createNestedToolbarDropdown(e,t,o):"|"===e?new Od:"-"===e?new Rd:t.create(e)).filter(e=>!!e)}_cleanItemsConfiguration(e,t,i){const n=e.filter((e,n,o)=>"|"===e||-1===i.indexOf(e)&&("-"===e?!this.options.shouldGroupWhenFull||(x("toolbarview-line-break-ignored-when-grouping-items",o),!1):!(!F(e)&&!t.has(e))||(x("toolbarview-item-unavailable",{item:e}),!1)));return this._cleanSeparatorsAndLineBreaks(n)}_cleanSeparatorsAndLineBreaks(e){const t=e=>"-"!==e&&"|"!==e,i=e.length,n=e.findIndex(t);if(-1===n)return[];const o=i-e.slice().reverse().findIndex(t);return e.slice(n,o).filter((e,i,n)=>{if(t(e))return!0;return!(i>0&&n[i-1]===e)})}_createNestedToolbarDropdown(e,t,i){let{label:n,icon:o,items:r,tooltip:s=!0,withText:a=!1}=e;if(r=this._cleanItemsConfiguration(r,t,i),!r.length)return null;const l=su(this.locale);return n||x("toolbarview-nested-toolbar-dropdown-missing-label",e),l.class="ck-toolbar__nested-toolbar-dropdown",l.buttonView.set({label:n,tooltip:s,withText:!!a}),!1!==o?l.buttonView.icon=ku[o]||o||fu:l.buttonView.withText=!0,au(l,()=>l.toolbarView._buildItemsFromConfig(r,t,i)),l}}class _u extends Zi{children;constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar__items"]},children:this.children})}}class vu{type="static";constructor(e){e.isGrouping=!1,e.itemsView.children.bindTo(e.items).using(e=>e),e.focusables.bindTo(e.items).using(e=>mo(e)?e:null)}render(){}destroy(){}}class yu{type="dynamic";view;viewChildren;viewFocusables;viewItemsView;viewFocusTracker;viewLocale;ungroupedItems;groupedItems;groupedItemsDropdown;resizeObserver=null;cachedPadding=null;shouldUpdateGroupingOnNextResize=!1;viewElement;constructor(e){this.view=e,this.viewChildren=e.children,this.viewFocusables=e.focusables,this.viewItemsView=e.itemsView,this.viewFocusTracker=e.focusTracker,this.viewLocale=e.locale,this.view.isGrouping=!0,this.ungroupedItems=e.createCollection(),this.groupedItems=e.createCollection(),this.groupedItemsDropdown=this._createGroupedItemsDropdown(),e.itemsView.children.bindTo(this.ungroupedItems).using(e=>e),this.ungroupedItems.on("change",this._updateFocusCyclableItems.bind(this)),e.children.on("change",this._updateFocusCyclableItems.bind(this)),e.items.on("change",(e,t)=>{const i=t.index,n=Array.from(t.added);for(const e of t.removed)i>=this.ungroupedItems.length?this.groupedItems.remove(e):this.ungroupedItems.remove(e);for(let e=i;e<i+n.length;e++){const t=n[e-i];e>this.ungroupedItems.length?this.groupedItems.add(t,e-this.ungroupedItems.length):this.ungroupedItems.add(t,e)}this._updateGrouping()})}render(e){this.viewElement=e.element,this._enableGroupingOnResize(),this._enableGroupingOnMaxWidthChange(e)}destroy(){this.groupedItemsDropdown.destroy(),this.viewChildren.length>1&&(this.viewChildren.remove(this.groupedItemsDropdown),this.viewChildren.remove(this.viewChildren.last)),this.resizeObserver.destroy()}refreshItems(){const e=this.view;if(e.items.length){for(let t=0;t<e.items.length;t++){const i=[...e.items][t];this.ungroupedItems.add(i,t)}this._updateGrouping()}}_updateGrouping(){if(!this.viewElement.ownerDocument.body.contains(this.viewElement))return;if(!dt(this.viewElement))return void(this.shouldUpdateGroupingOnNextResize=!0);const e=this.groupedItems.length;let t;for(;this._areItemsOverflowing;)this._groupLastItem(),t=!0;if(!t&&this.groupedItems.length){for(;this.groupedItems.length&&!this._areItemsOverflowing;)this._ungroupFirstItem();this._areItemsOverflowing&&this._groupLastItem()}this.groupedItems.length!==e&&this.view.fire("groupedItemsUpdate")}get _areItemsOverflowing(){if(!this.ungroupedItems.length)return!1;const t=this.viewElement,i=this.viewLocale.uiLanguageDirection,n=new Ze(t.lastChild),o=new Ze(t);if(!this.cachedPadding){const n=e.window.getComputedStyle(t),o="ltr"===i?"paddingRight":"paddingLeft";this.cachedPadding=Number.parseInt(n[o])}return"ltr"===i?n.right>o.right-this.cachedPadding:n.left<o.left+this.cachedPadding}_enableGroupingOnResize(){let e;this.resizeObserver=new ot(this.viewElement,t=>{e&&e===t.contentRect.width&&!this.shouldUpdateGroupingOnNextResize||(this.shouldUpdateGroupingOnNextResize=!1,this._updateGrouping(),e=t.contentRect.width)}),this._updateGrouping()}_enableGroupingOnMaxWidthChange(e){e.on("change:maxWidth",()=>{this._updateGrouping()})}_groupLastItem(){this.groupedItems.length||(this.viewChildren.add(new Od),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 e=this.viewLocale,t=e.t,i=su(e);return i.class="ck-toolbar__grouped-dropdown",i.panelPosition="ltr"===e.uiLanguageDirection?"sw":"se",au(i,this.groupedItems),i.buttonView.set({label:t("Show more items"),tooltip:!0,tooltipPosition:"rtl"===e.uiLanguageDirection?"se":"sw",icon:fu}),i}_updateFocusCyclableItems(){this.viewFocusables.clear(),this.ungroupedItems.map(e=>{mo(e)&&this.viewFocusables.add(e)}),this.groupedItems.length&&this.viewFocusables.add(this.groupedItemsDropdown)}}var Au=i(5667),xu={attributes:{"data-cke":!0}};xu.setAttributes=Ki(),xu.insert=$i().bind(null,"head"),xu.domAPI=Hi(),xu.insertStyleElement=Yi();ji()(Au.A,xu);Au.A&&Au.A.locals&&Au.A.locals;class Cu extends ou{arrowView;constructor(e){super(e);const t=this.bindTemplate;this.set({withText:!0,role:"menuitem"}),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{class:["ck-menu-bar__menu__button"],"aria-haspopup":!0,"aria-expanded":this.bindTemplate.to("isOn",e=>String(e)),"data-cke-tooltip-disabled":t.to("isOn")},on:{mouseenter:t.to("mouseenter")}})}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){const e=new wn;return e.content=Bd,e.extendTemplate({attributes:{class:"ck-menu-bar__menu__button__arrow"}}),e}}var Tu=i(4873),Eu={attributes:{"data-cke":!0}};Eu.setAttributes=Ki(),Eu.insert=$i().bind(null,"head"),Eu.domAPI=Hi(),Eu.insertStyleElement=Yi();ji()(Tu.A,Eu);Tu.A&&Tu.A.locals&&Tu.A.locals;class Iu extends Zi{children;constructor(e){super(e);const t=this.bindTemplate;this.set("isVisible",!1),this.set("position","se"),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-menu-bar__menu__panel",t.to("position",e=>`ck-menu-bar__menu__panel_position_${e}`),t.if("isVisible","ck-hidden",e=>!e)],tabindex:"-1"},children:this.children,on:{selectstart:t.to(e=>{"input"!==e.target.tagName.toLocaleLowerCase()&&e.preventDefault()})}})}focus(e=1){this.children.length&&(1===e?this.children.first.focus():this.children.last.focus())}}var Su=i(55),Pu={attributes:{"data-cke":!0}};Pu.setAttributes=Ki(),Pu.insert=$i().bind(null,"head"),Pu.domAPI=Hi(),Pu.insertStyleElement=Yi();ji()(Su.A,Pu);Su.A&&Su.A.locals&&Su.A.locals;class Mu extends Zi{buttonView;panelView;focusTracker;keystrokes;constructor(e){super(e);const t=this.bindTemplate;this.buttonView=new Cu(e),this.buttonView.delegate("mouseenter").to(this),this.buttonView.bind("isOn","isEnabled").to(this,"isOpen","isEnabled"),this.panelView=new Iu(e),this.panelView.bind("isVisible").to(this,"isOpen"),this.keystrokes=new ti,this.focusTracker=new Qt,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("panelPosition","w"),this.set("class",void 0),this.set("parentMenuView",null),this.setTemplate({tag:"div",attributes:{class:["ck","ck-menu-bar__menu",t.to("class"),t.if("isEnabled","ck-disabled",e=>!e),t.if("parentMenuView","ck-menu-bar__menu_top-level",e=>!e)]},children:[this.buttonView,this.panelView]})}render(){super.render(),this.focusTracker.add(this.buttonView.element),this.focusTracker.add(this.panelView.element),this.keystrokes.listenTo(this.element),Dn.closeOnEscKey(this),this._repositionPanelOnOpen()}_attachBehaviors(){this.parentMenuView?(Dn.openOnButtonClick(this),Dn.openOnArrowRightKey(this),Dn.closeOnArrowLeftKey(this),Dn.openAndFocusOnEnterKeyPress(this),Dn.closeOnParentClose(this)):(this._propagateArrowKeystrokeEvents(),Dn.openAndFocusPanelOnArrowDownKey(this),Dn.toggleOnButtonClick(this))}_propagateArrowKeystrokeEvents(){this.keystrokes.set("arrowright",(e,t)=>{this.fire("arrowright"),t()}),this.keystrokes.set("arrowleft",(e,t)=>{this.fire("arrowleft"),t()})}_repositionPanelOnOpen(){this.on("change:isOpen",(e,t,i)=>{if(!i)return;const n=Mu._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions});this.panelView.position=n?n.name:this._defaultMenuPositionName})}focus(){this.buttonView.focus()}get _panelPositions(){const{southEast:e,southWest:t,northEast:i,northWest:n,westSouth:o,eastSouth:r,westNorth:s,eastNorth:a}=Bn;return"ltr"===this.locale.uiLanguageDirection?this.parentMenuView?[r,a,o,s]:[e,t,i,n]:this.parentMenuView?[o,s,r,a]:[t,e,n,i]}get _defaultMenuPositionName(){return"ltr"===this.locale.uiLanguageDirection?this.parentMenuView?"es":"se":this.parentMenuView?"ws":"sw"}static _getOptimalPosition=ht}class Ou extends Wd{constructor(e){super(e),this.role="menu",this.items.on("change",this._setItemsCheckSpace.bind(this))}_setItemsCheckSpace(){const e=Array.from(this.items).some(e=>{const t=Ru(e);return t&&t.isToggleable});this.items.forEach(t=>{const i=Ru(t);i&&(i.hasCheckSpace=e)})}}function Ru(e){return e instanceof Mn?e.children.map(e=>function(e){return"object"==typeof e&&"buttonView"in e&&e.buttonView instanceof lo}(e)?e.buttonView:e).find(e=>e instanceof ou):null}var Nu=i(5078),Vu={attributes:{"data-cke":!0}};Vu.setAttributes=Ki(),Vu.insert=$i().bind(null,"head"),Vu.domAPI=Hi(),Vu.insertStyleElement=Yi();ji()(Nu.A,Vu);Nu.A&&Nu.A.locals&&Nu.A.locals;class Lu extends ou{constructor(e){super(e),this.set({withText:!0,withKeystroke:!0,tooltip:!1,role:"menuitem"}),this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item__button"]}})}}class Du extends(zu(lo)){}class Bu extends(zu(ou)){}function zu(e){return class extends e{_fileInputView;constructor(...e){super(...e),this._fileInputView=new Fu(this.locale),this._fileInputView.bind("acceptedType").to(this),this._fileInputView.bind("allowMultipleFiles").to(this),this._fileInputView.delegate("done").to(this),this.on("execute",()=>{this._fileInputView.open()}),this.extendTemplate({attributes:{class:"ck-file-dialog-button"}})}render(){super.render(),this.children.add(this._fileInputView)}}}class Fu extends Zi{constructor(e){super(e),this.set("acceptedType",void 0),this.set("allowMultipleFiles",!1);const t=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck-hidden"],type:"file",tabindex:"-1",accept:t.to("acceptedType"),multiple:t.to("allowMultipleFiles")},on:{change:t.to(()=>{this.element?.files?.length&&this.fire("done",this.element.files),this.element.value=""})}})}open(){this.element.click()}}class ju extends Bu{constructor(e){super(e),this.set({withText:!0,withKeystroke:!0,tooltip:!1,role:"menuitem"}),this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item__button"]}})}}var Uu=i(4782),Hu={attributes:{"data-cke":!0}};Hu.setAttributes=Ki(),Hu.insert=$i().bind(null,"head"),Hu.domAPI=Hi(),Hu.insertStyleElement=Yi();ji()(Uu.A,Hu);Uu.A&&Uu.A.locals&&Uu.A.locals;const Wu=["mouseenter","arrowleft","arrowright","change:isOpen"];class $u extends Zi{children;menus=[];constructor(e){super(e);const t=e.t,i=this.bindTemplate;this.set({isOpen:!1,isFocusBorderEnabled:!1}),this._setupIsOpenUpdater(),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-menu-bar",i.if("isFocusBorderEnabled","ck-menu-bar_focus-border-enabled")],"aria-label":t("Editor menu bar"),role:"menubar"},children:this.children})}fillFromConfig(e,t,i=[]){const n=Fn({normalizedConfig:e,locale:this.locale,componentFactory:t,extraItems:i}).items.map(e=>this._createMenu({componentFactory:t,menuDefinition:e}));this.children.addMany(n)}render(){super.render(),Ln.toggleMenusAndFocusItemsOnHover(this),Ln.closeMenusWhenTheBarCloses(this),Ln.closeMenuWhenAnotherOnTheSameLevelOpens(this),Ln.focusCycleMenusOnArrows(this),Ln.closeOnClickOutside(this),Ln.enableFocusHighlightOnInteraction(this)}focus(){this.children.first&&this.children.first.focus()}close(){for(const e of this.children)e.isOpen=!1}disable(){for(const e of this.children)e.isEnabled=!1}enable(){for(const e of this.children)e.isEnabled=!0}registerMenu(e,t=null){t?(e.delegate(...Wu).to(t),e.parentMenuView=t):e.delegate(...Wu).to(this,e=>"menu:"+e),e._attachBehaviors(),this.menus.push(e)}_createMenu({componentFactory:e,menuDefinition:t,parentMenuView:i}){const n=this.locale,o=new Mu(n);return this.registerMenu(o,i),o.buttonView.set({label:t.label}),o.once("change:isOpen",()=>{const i=new Ou(n);i.ariaLabel=t.label,o.panelView.children.add(i),i.items.addMany(this._createMenuItems({menuDefinition:t,parentMenuView:o,componentFactory:e}))}),o}_createMenuItems({menuDefinition:e,parentMenuView:t,componentFactory:i}){const n=this.locale,o=[];for(const r of e.groups){for(const e of r.items){const r=new Nn(n,t);if(F(e))r.children.add(this._createMenu({componentFactory:i,menuDefinition:e,parentMenuView:t}));else{const n=this._createMenuItemContentFromFactory({componentName:e,componentFactory:i,parentMenuView:t});if(!n)continue;r.children.add(n)}o.push(r)}r!==e.groups[e.groups.length-1]&&o.push(new Fd(n))}return o}_createMenuItemContentFromFactory({componentName:e,parentMenuView:t,componentFactory:i}){const n=i.create(e);return n instanceof Mu||n instanceof Lu||n instanceof ju?(this._registerMenuTree(n,t),n.on("execute",()=>{this.close()}),n):(x("menu-bar-component-unsupported",{componentName:e,componentView:n}),null)}_registerMenuTree(e,t){if(!(e instanceof Mu))return void e.delegate("mouseenter").to(t);this.registerMenu(e,t);const i=e.panelView.children.filter(e=>e instanceof Ou)[0];if(!i)return void e.delegate("mouseenter").to(t);const n=i.items.filter(e=>e instanceof Mn);for(const t of n)this._registerMenuTree(t.children.get(0),e)}_setupIsOpenUpdater(){let e;this.on("menu:change:isOpen",(t,i,n)=>{clearTimeout(e),n?this.isOpen=!0:e=setTimeout(()=>{this.isOpen=Array.from(this.children).some(e=>e.isOpen)},0)})}}class qu extends Zi{name=null;_editingView;_editableElement;_hasExternalElement;constructor(e,t,i){super(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-content","ck-editor__editable","ck-rounded-corners"],lang:e.contentLanguage,dir:e.contentLanguageDirection}}),this.set("isFocused",!1),this._editableElement=i,this._hasExternalElement=!!this._editableElement,this._editingView=t}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()}get hasExternalElement(){return this._hasExternalElement}_updateIsFocusedClasses(){const e=this._editingView;function t(t){e.change(i=>{const n=e.document.getRoot(t.name);i.addClass(t.isFocused?"ck-focused":"ck-blurred",n),i.removeClass(t.isFocused?"ck-blurred":"ck-focused",n)})}e.isRenderingInProgress?function i(n){e.once("change:isRenderingInProgress",(e,o,r)=>{r?i(n):t(n)})}(this):t(this)}}class Ku extends qu{_options;constructor(e,t,i,n={}){super(e,t,i),this._options=n,this.extendTemplate({attributes:{role:"textbox",class:"ck-editor__editable_inline"}})}render(){super.render();const e=this._editingView;e.change(t=>{const i=e.document.getRoot(this.name);t.setAttribute("aria-label",this.getEditableAriaLabel(),i)})}getEditableAriaLabel(){const e=this.locale.t,t=this._options.label,i=this._editableElement,n=this.name;if("string"==typeof t)return t;if("object"==typeof t)return t[n];if("function"==typeof t)return t(this);if(i){const e=i.getAttribute("aria-label");if(e)return e}return e("Rich Text Editor. Editing area: %0",n)}}var Gu=i(9881),Yu={attributes:{"data-cke":!0}};Yu.setAttributes=Ki(),Yu.insert=$i().bind(null,"head"),Yu.domAPI=Hi(),Yu.insertStyleElement=Yi();ji()(Gu.A,Yu);Gu.A&&Gu.A.locals&&Gu.A.locals;class Ju extends Ed{stickyPanel;toolbar;editable;constructor(e,t,i={}){super(e),this.stickyPanel=new Md(e),this.toolbar=new wu(e,{shouldGroupWhenFull:i.shouldToolbarGroupWhenFull}),i.useMenuBar&&(this.menuBarView=new $u(e)),this.editable=new Ku(e,t,void 0,{label:i.label})}render(){super.render(),this.menuBarView?this.stickyPanel.content.addMany([this.menuBarView,this.toolbar]):this.stickyPanel.content.add(this.toolbar),this.top.add(this.stickyPanel),this.main.add(this.editable)}}class Qu extends(K()){editor;_disableStack=new Set;constructor(e){super(),this.editor=e,this.set("isEnabled",!0)}forceDisabled(e){this._disableStack.add(e),1==this._disableStack.size&&(this.on("set:isEnabled",Zu,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),0==this._disableStack.size&&(this.off("set:isEnabled",Zu),this.isEnabled=!0)}destroy(){this.stopListening()}static get isContextPlugin(){return!1}static get isOfficialPlugin(){return!1}static get isPremiumPlugin(){return!1}}function Zu(e){e.return=!1,e.stop()}class Xu extends(K()){editor;_isEnabledBasedOnSelection;_affectsData;_disableStack;static get _throwErrorWhenUsedAsAPlugin(){return!0}constructor(e){super(),this.editor=e,this.set("value",void 0),this.set("isEnabled",!1),this._affectsData=!0,this._isEnabledBasedOnSelection=!0,this._disableStack=new Set,this.decorate("execute"),this.listenTo(this.editor.model.document,"change",()=>{this.refresh()}),this.listenTo(e,"change:isReadOnly",()=>{this.refresh()}),this.on("set:isEnabled",t=>{if(!this.affectsData)return;const i=e.model.document.selection,n=!("$graveyard"==i.getFirstPosition().root.rootName)&&e.model.canEditAt(i);(e.isReadOnly||this._isEnabledBasedOnSelection&&!n)&&(t.return=!1,t.stop())},{priority:"highest"}),this.on("execute",e=>{this.isEnabled||e.stop()},{priority:"high"})}get affectsData(){return this._affectsData}set affectsData(e){this._affectsData=e}refresh(){this.isEnabled=!0}forceDisabled(e){this._disableStack.add(e),1==this._disableStack.size&&(this.on("set:isEnabled",eh,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),0==this._disableStack.size&&(this.off("set:isEnabled",eh),this.refresh())}execute(...e){}destroy(){this.stopListening()}}function eh(e){e.return=!1,e.stop()}class th extends Xu{_childCommandsDefinitions=[];refresh(){}execute(...e){const t=this._getFirstEnabledCommand();return!!t&&t.execute(e)}registerChildCommand(e,t={}){y(this._childCommandsDefinitions,{command:e,priority:t.priority||"normal"}),e.on("change:isEnabled",()=>this._checkEnabled()),this._checkEnabled()}_checkEnabled(){this.isEnabled=!!this._getFirstEnabledCommand()}_getFirstEnabledCommand(){const e=this._childCommandsDefinitions.find(({command:e})=>e.isEnabled);return e&&e.command}}class ih{_commands;constructor(){this._commands=new Map}add(e,t){this._commands.set(e,t)}get(e){return this._commands.get(e)}execute(e,...t){const i=this.get(e);if(!i)throw new A("commandcollection-command-not-found",this,{commandName:e});return i.execute(...t)}*names(){yield*this._commands.keys()}*commands(){yield*this._commands.values()}[Symbol.iterator](){return this._commands[Symbol.iterator]()}destroy(){for(const e of this.commands())e.destroy()}}class nh extends(O()){_context;_plugins=new Map;_availablePlugins;_contextPlugins;constructor(e,t=[],i=[]){super(),this._context=e,this._availablePlugins=new Map;for(const e of t)e.pluginName&&this._availablePlugins.set(e.pluginName,e);this._contextPlugins=new Map;for(const[e,t]of i)this._contextPlugins.set(e,t),this._contextPlugins.set(t,e),e.pluginName&&this._availablePlugins.set(e.pluginName,e)}*[Symbol.iterator](){for(const e of this._plugins)"function"==typeof e[0]&&(yield e)}get(e){const t=this._plugins.get(e);if(!t){let t=e;throw"function"==typeof e&&(t=e.pluginName||e.name),new A("plugincollection-plugin-not-loaded",this._context,{plugin:t})}return t}has(e){return this._plugins.has(e)}async init(e,t=[],i=[]){const n=this,o=this._context;!function e(t,i=new Set){t.forEach(t=>{a(t)&&(i.has(t)||(i.add(t),t.pluginName&&!n._availablePlugins.has(t.pluginName)&&n._availablePlugins.set(t.pluginName,t),t.requires&&e(t.requires,i)))})}(e),u(e);const r=[...function e(t,i=new Set){return t.map(e=>a(e)?e:n._availablePlugins.get(e)).reduce((t,n)=>i.has(n)?t:(i.add(n),n.requires&&(u(n.requires,n),e(n.requires,i).forEach(e=>t.add(e))),t.add(n)),new Set)}(e.filter(e=>!c(e,t)))];!function(e,t){for(const i of t){if("function"!=typeof i)throw new A("plugincollection-replace-plugin-invalid-type",null,{pluginItem:i});const t=i.pluginName;if(!t)throw new A("plugincollection-replace-plugin-missing-name",null,{pluginItem:i});if(i.requires&&i.requires.length)throw new A("plugincollection-plugin-for-replacing-cannot-have-dependencies",null,{pluginName:t});const o=n._availablePlugins.get(t);if(!o)throw new A("plugincollection-plugin-for-replacing-not-exist",null,{pluginName:t});const r=e.indexOf(o);if(-1===r){if(n._contextPlugins.has(o))return;throw new A("plugincollection-plugin-for-replacing-not-loaded",null,{pluginName:t})}if(o.requires&&o.requires.length)throw new A("plugincollection-replaced-plugin-cannot-have-dependencies",null,{pluginName:t});e.splice(r,1,i),n._availablePlugins.set(t,i)}}(r,i);const s=function(e){return e.map(e=>{let t=n._contextPlugins.get(e);return t=t||new e(o),n._add(e,t),t})}(r);return await h(s,"init"),await h(s,"afterInit"),s;function a(e){return"function"==typeof e}function l(e){return a(e)&&!!e.isContextPlugin}function c(e,t){return t.some(t=>t===e||(d(e)===t||d(t)===e))}function d(e){return a(e)?e.pluginName||e.name:e}function u(e,i=null){e.map(e=>a(e)?e:n._availablePlugins.get(e)||e).forEach(e=>{!function(e){if("function"!=typeof e)return;if(e._throwErrorWhenUsedAsAPlugin)throw new A("plugincollection-plugin-invalid-constructor",o,{name:e.name})}(e),function(e,t){if(a(e))return;if(t)throw new A("plugincollection-soft-required",o,{missingPlugin:e,requiredBy:d(t)});throw new A("plugincollection-plugin-not-found",o,{plugin:e})}(e,i),function(e,t){if(!l(t))return;if(l(e))return;throw new A("plugincollection-context-required",o,{plugin:d(e),requiredBy:d(t)})}(e,i),function(e,i){if(!i)return;if(!c(e,t))return;throw new A("plugincollection-required",o,{plugin:d(e),requiredBy:d(i)})}(e,i)})}function h(e,t){return e.reduce((e,i)=>i[t]?n._contextPlugins.has(i)?e:e.then(i[t].bind(i)):e,Promise.resolve())}}destroy(){const e=[];for(const[,t]of this)"function"!=typeof t.destroy||this._contextPlugins.has(t)||e.push(t.destroy());return Promise.all(e)}_add(e,t){this._plugins.set(e,t);const i=e.pluginName;if(i){if(this._plugins.has(i))throw new A("plugincollection-plugin-name-conflict",null,{pluginName:i,plugin1:this._plugins.get(i).constructor,plugin2:e});this._plugins.set(i,t)}}}class oh{config;plugins;locale;t;editors;static defaultConfig;static builtinPlugins;_contextOwner=null;constructor(e){const{translations:t,...i}=e||{};this.config=new De(i,this.constructor.defaultConfig);const n=this.constructor.builtinPlugins;this.config.define("plugins",n),this.plugins=new nh(this,n);const o=this.config.get("language")||{};this.locale=new Gt({uiLanguage:"string"==typeof o?o:o.ui,contentLanguage:this.config.get("language.content"),translations:t}),this.t=this.locale.t,this.editors=new Yt}initPlugins(){const e=this.config.get("plugins")||[],t=this.config.get("substitutePlugins")||[];for(const i of e.concat(t)){if("function"!=typeof i)throw new A("context-initplugins-constructor-only",null,{Plugin:i});if(!0!==i.isContextPlugin)throw new A("context-initplugins-invalid-plugin",null,{Plugin:i})}return this.plugins.init(e,[],t)}destroy(){return Promise.all(Array.from(this.editors,e=>e.destroy())).then(()=>this.plugins.destroy())}_addEditor(e,t){if(this._contextOwner)throw new A("context-addeditor-private-context");this.editors.add(e),t&&(this._contextOwner=e)}_removeEditor(e){return this.editors.has(e)&&this.editors.remove(e),this._contextOwner===e?this.destroy():Promise.resolve()}_getEditorConfig(){const e={};for(const t of this.config.names())["plugins","removePlugins","extraPlugins"].includes(t)||(e[t]=this.config.get(t));return e}static create(e){return new Promise(t=>{const i=new this(e);t(i.initPlugins().then(()=>i))})}static get _throwErrorWhenUsedAsAPlugin(){return!0}}class rh extends(K()){context;constructor(e){super(),this.context=e}destroy(){this.stopListening()}static get isContextPlugin(){return!0}static get isOfficialPlugin(){return!1}static get isPremiumPlugin(){return!1}}class sh extends ti{editor;constructor(e){super(),this.editor=e}set(e,t,i={}){if("string"==typeof t){const e=t;t=(t,i)=>{this.editor.execute(e),i()}}super.set(e,t,i)}}class ah{crashes=[];state="initializing";_crashNumberLimit;_now=Date.now;_minimumNonErrorTimePeriod;_boundErrorHandler;_listeners;constructor(e){if(this.crashes=[],this._crashNumberLimit="number"==typeof e.crashNumberLimit?e.crashNumberLimit:3,this._minimumNonErrorTimePeriod="number"==typeof e.minimumNonErrorTimePeriod?e.minimumNonErrorTimePeriod:5e3,this._boundErrorHandler=e=>{const t="error"in e?e.error:e.reason;t instanceof Error&&this._handleError(t,e)},this._listeners={},!this._restart)throw new Error("The Watchdog class was split into the abstract `Watchdog` class and the `EditorWatchdog` class. Please, use `EditorWatchdog` if you have used the `Watchdog` class previously.")}destroy(){this._stopErrorHandling(),this._listeners={}}on(e,t){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t)}off(e,t){this._listeners[e]=this._listeners[e].filter(e=>e!==t)}_fire(e,...t){const i=this._listeners[e]||[];for(const e of i)e.apply(this,[null,...t])}_startErrorHandling(){window.addEventListener("error",this._boundErrorHandler),window.addEventListener("unhandledrejection",this._boundErrorHandler)}_stopErrorHandling(){window.removeEventListener("error",this._boundErrorHandler),window.removeEventListener("unhandledrejection",this._boundErrorHandler)}_handleError(e,t){if(this._shouldReactToError(e)){this.crashes.push({message:e.message,stack:e.stack,filename:t instanceof ErrorEvent?t.filename:void 0,lineno:t instanceof ErrorEvent?t.lineno:void 0,colno:t instanceof ErrorEvent?t.colno:void 0,date:this._now()});const i=this._shouldRestart();this.state="crashed",this._fire("stateChange"),this._fire("error",{error:e,causesRestart:i}),i?this._restart():(this.state="crashedPermanently",this._fire("stateChange"))}}_shouldReactToError(e){return e.is&&e.is("CKEditorError")&&void 0!==e.context&&null!==e.context&&"ready"===this.state&&this._isErrorComingFromThisItem(e)}_shouldRestart(){if(this.crashes.length<=this._crashNumberLimit)return!0;return(this.crashes[this.crashes.length-1].date-this.crashes[this.crashes.length-1-this._crashNumberLimit].date)/this._crashNumberLimit>this._minimumNonErrorTimePeriod}}function lh(e,t=new Set){const i=[e],n=new Set;let o=0;for(;i.length>o;){const e=i[o++];if(!n.has(e)&&ch(e)&&!t.has(e))if(n.add(e),Symbol.iterator in e)try{for(const t of e)i.push(t)}catch{}else for(const t in e)"defaultValue"!==t&&i.push(e[t])}return n}function ch(e){const t=Object.prototype.toString.call(e),i=typeof e;return!("number"===i||"boolean"===i||"string"===i||"symbol"===i||"function"===i||"[object Date]"===t||"[object RegExp]"===t||"[object Module]"===t||null==e||e._watchdogExcluded||e instanceof EventTarget||e instanceof Event)}function dh(e,t,i=new Set){if(e===t&&("object"==typeof(n=e)&&null!==n))return!0;var n;const o=lh(e,i),r=lh(t,i);for(const e of o)if(r.has(e))return!0;return!1}class uh extends ah{_editor=null;_lifecyclePromise=null;_throttledSave;_data;_lastDocumentVersion;_elementOrData;_initUsingData=!0;_editables={};_config;_excludedProps;constructor(e,t={}){super(t),this._throttledSave=gn(this._save.bind(this),"number"==typeof t.saveInterval?t.saveInterval:5e3),e&&(this._creator=(t,i)=>e.create(t,i)),this._destructor=e=>e.destroy()}get editor(){return this._editor}get _item(){return this._editor}setCreator(e){this._creator=e}setDestructor(e){this._destructor=e}_restart(){return Promise.resolve().then(()=>(this.state="initializing",this._fire("stateChange"),this._destroy())).catch(e=>{console.error("An error happened during the editor destroying.",e)}).then(()=>{const e={},t=[],i=this._config.rootsAttributes||{},n={};for(const[o,r]of Object.entries(this._data.roots))r.isLoaded?(e[o]="",n[o]=i[o]||{}):t.push(o);const o={...this._config,extraPlugins:this._config.extraPlugins||[],lazyRoots:t,rootsAttributes:n,_watchdogInitialData:this._data};return delete o.initialData,o.extraPlugins.push(hh),this._initUsingData?this.create(e,o,o.context):Le(this._elementOrData)?this.create(this._elementOrData,o,o.context):this.create(this._editables,o,o.context)}).then(()=>{this._fire("restart")})}create(e=this._elementOrData,t=this._config,i){return this._lifecyclePromise=Promise.resolve(this._lifecyclePromise).then(()=>(super._startErrorHandling(),this._elementOrData=e,this._initUsingData="string"==typeof e||Object.keys(e).length>0&&"string"==typeof Object.values(e)[0],this._config=this._cloneEditorConfiguration(t)||{},this._config.context=i,this._creator(e,this._config))).then(e=>{this._editor=e,e.model.document.on("change:data",this._throttledSave),this._lastDocumentVersion=e.model.document.version,this._data=this._getData(),this._initUsingData||(this._editables=this._getEditables()),this.state="ready",this._fire("stateChange")}).finally(()=>{this._lifecyclePromise=null}),this._lifecyclePromise}destroy(){return this._lifecyclePromise=Promise.resolve(this._lifecyclePromise).then(()=>(this.state="destroyed",this._fire("stateChange"),super.destroy(),this._destroy())).finally(()=>{this._lifecyclePromise=null}),this._lifecyclePromise}_destroy(){return Promise.resolve().then(()=>{this._stopErrorHandling(),this._throttledSave.cancel();const e=this._editor;return this._editor=null,e.model.document.off("change:data",this._throttledSave),this._destructor(e)})}_save(){const e=this._editor.model.document.version;try{this._data=this._getData(),this._initUsingData||(this._editables=this._getEditables()),this._lastDocumentVersion=e}catch(e){console.error(e,"An error happened during restoring editor data. Editor will be restored from the previously saved data.")}}_setExcludedProperties(e){this._excludedProps=e}_getData(){const e=this._editor,t=e.model.document.roots.filter(e=>e.isAttached()&&"$graveyard"!=e.rootName),{plugins:i}=e,n=i.has("CommentsRepository")&&i.get("CommentsRepository"),o=i.has("TrackChanges")&&i.get("TrackChanges"),r={roots:{},markers:{},commentThreads:JSON.stringify([]),suggestions:JSON.stringify([])};t.forEach(e=>{r.roots[e.rootName]={content:JSON.stringify(Array.from(e.getChildren())),attributes:JSON.stringify(Array.from(e.getAttributes())),isLoaded:e._isLoaded}});for(const t of e.model.markers)t._affectsData&&(r.markers[t.name]={rangeJSON:t.getRange().toJSON(),usingOperation:t._managedUsingOperations,affectsData:t._affectsData});return n&&(r.commentThreads=JSON.stringify(n.getCommentThreads({toJSON:!0,skipNotAttached:!0}))),o&&(r.suggestions=JSON.stringify(o.getSuggestions({toJSON:!0,skipNotAttached:!0}))),r}_getEditables(){const e={};for(const t of this.editor.model.document.getRootNames()){const i=this.editor.ui.getEditableElement(t);i&&(e[t]=i)}return e}_isErrorComingFromThisItem(e){return dh(this._editor,e.context,this._excludedProps)}_cloneEditorConfiguration(e){return Ne(e,(e,t)=>Le(e)||"context"===t?e:void 0)}}class hh{editor;_data;constructor(e){this.editor=e,this._data=e.config.get("_watchdogInitialData")}init(){this.editor.data.on("init",e=>{e.stop(),this.editor.model.enqueueChange({isUndoable:!1},e=>{this._restoreCollaborationData(),this._restoreEditorData(e)}),this.editor.data.fire("ready")},{priority:999})}_createNode(e,t){if("name"in t){const i=e.createElement(t.name,t.attributes);if(t.children)for(const n of t.children)i._appendChild(this._createNode(e,n));return i}return e.createText(t.data,t.attributes)}_restoreEditorData(e){const t=this.editor;Object.entries(this._data.roots).forEach(([i,{content:n,attributes:o}])=>{const r=JSON.parse(n),s=JSON.parse(o),a=t.model.document.getRoot(i);for(const[t,i]of s)e.setAttribute(t,i,a);for(const t of r){const i=this._createNode(e,t);e.insert(i,a,"end")}}),Object.entries(this._data.markers).forEach(([i,n])=>{const{document:o}=t.model,{rangeJSON:{start:r,end:s},...a}=n,l=o.getRoot(r.root),c=e.createPositionFromPath(l,r.path,r.stickiness),d=e.createPositionFromPath(l,s.path,s.stickiness),u=e.createRange(c,d);e.addMarker(i,{range:u,...a})})}_restoreCollaborationData(){const e=JSON.parse(this._data.commentThreads),t=JSON.parse(this._data.suggestions);if(this.editor.plugins.has("CommentsRepository")){const t=this.editor.plugins.get("CommentsRepository");for(const e of t.getCommentThreads())t._removeCommentThread({threadId:e.id});e.forEach(e=>{const t=this.editor.config.get("collaboration.channelId");this.editor.plugins.get("CommentsRepository").addCommentThread({channelId:t,...e})})}if(this.editor.plugins.has("TrackChangesEditing")){const e=this.editor.plugins.get("TrackChangesEditing");for(const t of e.getSuggestions())e._removeSuggestion(t);t.forEach(t=>{e.addSuggestionData(t)})}}}const mh=Symbol("MainQueueId");class gh extends ah{_watchdogs=new Map;_watchdogConfig;_context=null;_contextProps=new Set;_actionQueues=new fh;_contextConfig;_item;constructor(e,t={}){super(t),this._watchdogConfig=t,this._creator=t=>e.create(t),this._destructor=e=>e.destroy(),this._actionQueues.onEmpty(()=>{"initializing"===this.state&&(this.state="ready",this._fire("stateChange"))})}setCreator(e){this._creator=e}setDestructor(e){this._destructor=e}get context(){return this._context}create(e={}){return this._actionQueues.enqueue(mh,()=>(this._contextConfig=e,this._create()))}getItem(e){return this._getWatchdog(e)._item}getItemState(e){return this._getWatchdog(e).state}add(e){const t=ph(e);return Promise.all(t.map(e=>this._actionQueues.enqueue(e.id,()=>{if("destroyed"===this.state)throw new Error("Cannot add items to destroyed watchdog.");if(!this._context)throw new Error("Context was not created yet. You should call the `ContextWatchdog#create()` method first.");let t;if(this._watchdogs.has(e.id))throw new Error(`Item with the given id is already added: '${e.id}'.`);if("editor"===e.type)return t=new uh(null,this._watchdogConfig),t.setCreator(e.creator),t._setExcludedProperties(this._contextProps),e.destructor&&t.setDestructor(e.destructor),this._watchdogs.set(e.id,t),t.on("error",(i,{error:n,causesRestart:o})=>{this._fire("itemError",{itemId:e.id,error:n}),o&&this._actionQueues.enqueue(e.id,()=>new Promise(i=>{const n=()=>{t.off("restart",n),this._fire("itemRestart",{itemId:e.id}),i()};t.on("restart",n)}))}),t.create(e.sourceElementOrData,e.config,this._context);throw new Error(`Not supported item type: '${e.type}'.`)})))}remove(e){const t=ph(e);return Promise.all(t.map(e=>this._actionQueues.enqueue(e,()=>{const t=this._getWatchdog(e);return this._watchdogs.delete(e),t.destroy()})))}destroy(){return this._actionQueues.enqueue(mh,()=>(this.state="destroyed",this._fire("stateChange"),super.destroy(),this._destroy()))}_restart(){return this._actionQueues.enqueue(mh,()=>(this.state="initializing",this._fire("stateChange"),this._destroy().catch(e=>{console.error("An error happened during destroying the context or items.",e)}).then(()=>this._create()).then(()=>this._fire("restart"))))}_create(){return Promise.resolve().then(()=>(this._startErrorHandling(),this._creator(this._contextConfig))).then(e=>(this._context=e,this._contextProps=lh(this._context),Promise.all(Array.from(this._watchdogs.values()).map(e=>(e._setExcludedProperties(this._contextProps),e.create(void 0,void 0,this._context))))))}_destroy(){return Promise.resolve().then(()=>{this._stopErrorHandling();const e=this._context;return this._context=null,this._contextProps=new Set,Promise.all(Array.from(this._watchdogs.values()).map(e=>e.destroy())).then(()=>this._destructor(e))})}_getWatchdog(e){const t=this._watchdogs.get(e);if(!t)throw new Error(`Item with the given id was not registered: ${e}.`);return t}_isErrorComingFromThisItem(e){for(const t of this._watchdogs.values())if(t._isErrorComingFromThisItem(e))return!1;return dh(this._context,e.context)}}class fh{_onEmptyCallbacks=[];_queues=new Map;_activeActions=0;onEmpty(e){this._onEmptyCallbacks.push(e)}enqueue(e,t){const i=e===mh;this._activeActions++,this._queues.get(e)||this._queues.set(e,Promise.resolve());const n=(i?Promise.all(this._queues.values()):Promise.all([this._queues.get(mh),this._queues.get(e)])).then(t),o=n.catch(()=>{});return this._queues.set(e,o),n.finally(()=>{this._activeActions--,this._queues.get(e)===o&&0===this._activeActions&&this._onEmptyCallbacks.forEach(e=>e())})}}function ph(e){return Array.isArray(e)?e:[e]}const bh="contentEditing",kh="common";class wh{keystrokeInfos=new Map;_editor;constructor(e){this._editor=e;const t=e.config.get("menuBar.isVisible"),i=e.locale.t;this.addKeystrokeInfoCategory({id:bh,label:i("Content editing keystrokes"),description:i("These keyboard shortcuts allow for quick access to content editing features.")});const n=[{label:i("Close contextual balloons, dropdowns, and dialogs"),keystroke:"Esc"},{label:i("Open the accessibility help dialog"),keystroke:"Alt+0"},{label:i("Move focus between form fields (inputs, buttons, etc.)"),keystroke:[["Tab"],["Shift+Tab"]]},{label:i("Move focus to the toolbar, navigate between toolbars"),keystroke:"Alt+F10",mayRequireFn:!0},{label:i("Navigate through the toolbar or menu bar"),keystroke:[["arrowup"],["arrowright"],["arrowdown"],["arrowleft"]]},{label:i("Execute the currently focused button. Executing buttons that interact with the editor content moves the focus back to the content."),keystroke:[["Enter"],["Space"]]}];t&&n.push({label:i("Move focus to the menu bar, navigate between menu bars"),keystroke:"Alt+F9",mayRequireFn:!0}),this.addKeystrokeInfoCategory({id:"navigation",label:i("User interface and content navigation keystrokes"),description:i("Use the following keystrokes for more efficient navigation in the CKEditor 5 user interface."),groups:[{id:"common",keystrokes:n}]})}addKeystrokeInfoCategory({id:e,label:t,description:i,groups:n}){this.keystrokeInfos.set(e,{id:e,label:t,description:i,groups:new Map}),this.addKeystrokeInfoGroup({categoryId:e,id:kh}),n&&n.forEach(t=>{this.addKeystrokeInfoGroup({categoryId:e,...t})})}addKeystrokeInfoGroup({categoryId:e=bh,id:t,label:i,keystrokes:n}){const o=this.keystrokeInfos.get(e);if(!o)throw new A("accessibility-unknown-keystroke-info-category",this._editor,{groupId:t,categoryId:e});o.groups.set(t,{id:t,label:i,keystrokes:n||[]})}addKeystrokeInfos({categoryId:e=bh,groupId:t=kh,keystrokes:i}){if(!this.keystrokeInfos.has(e))throw new A("accessibility-unknown-keystroke-info-category",this._editor,{categoryId:e,keystrokes:i});const n=this.keystrokeInfos.get(e);if(!n.groups.has(t))throw new A("accessibility-unknown-keystroke-info-group",this._editor,{groupId:t,categoryId:e,keystrokes:i});n.groups.get(t).keystrokes.push(...i)}}function _h(e){return Object.getPrototypeOf(e).constructor.editorName}function vh(e){if(!e)return;const t=Array.isArray(e)?{items:e}:e,i=function e(t){return t.flatMap(t=>"string"==typeof t?[t]:e(t.items))}(t.items||[]);return{isMultiline:i.includes("-"),shouldNotGroupWhenFull:!!t.shouldNotGroupWhenFull,items:(n=i,n.filter(e=>"|"!==e&&"-"!==e))};var n}function yh(){let e="unknown",t="unknown";return r.isMac?e="mac":r.isWindows?e="windows":r.isiOS?e="ios":r.isAndroid&&(e="android"),r.isGecko?t="gecko":r.isBlink?t="blink":r.isSafari&&(t="safari"),{os:e,browser:t}}function Ah(){return localStorage.getItem("__ckeditor-session-id")||localStorage.setItem("__ckeditor-session-id",_()),localStorage.getItem("__ckeditor-session-id")}function xh(){return e.window.CKEDITOR_PAGE_SESSION_ID=e.window.CKEDITOR_PAGE_SESSION_ID||_(),e.window.CKEDITOR_PAGE_SESSION_ID}var Ch=i(6154),Th={attributes:{"data-cke":!0}};Th.setAttributes=Ki(),Th.insert=$i().bind(null,"head"),Th.domAPI=Hi(),Th.insertStyleElement=Yi();ji()(Ch.A,Th);Ch.A&&Ch.A.locals&&Ch.A.locals;class Eh extends(K()){static get editorName(){return"Editor"}accessibility;commands;config;conversion;data;editing;locale;model;plugins;keystrokes;t;static defaultConfig;static builtinPlugins;_context;_readOnlyLocks;static get _throwErrorWhenUsedAsAPlugin(){return!0}constructor(e={}){if(super(),"object"!=typeof e||Array.isArray(e))throw new A("editor-config-invalid-type");if("sanitizeHtml"in e)throw new A("editor-config-sanitizehtml-not-supported");const t=this.constructor,{translations:i,...n}=t.defaultConfig||{},{translations:o=i,...r}=e,s=e.language||n.language;this._context=e.context||new oh({language:s,translations:o}),this._context._addEditor(this,!e.context);const a=Array.from(t.builtinPlugins||[]);this.config=new De(r,n),this.config.define("plugins",a),this.config.define(this._context._getEditorConfig()),function(e){let t=e.get("licenseKey");!t&&window.CKEDITOR_GLOBAL_LICENSE_KEY&&(t=window.CKEDITOR_GLOBAL_LICENSE_KEY,e.set("licenseKey",t));if(!t)throw new A("license-key-missing")}(this.config),this.plugins=new nh(this,a,this._context.plugins),this.locale=this._context.locale,this.t=this.locale.t,this._readOnlyLocks=new Set,this.commands=new ih,this.set("state","initializing"),this.once("ready",()=>this.state="ready",{priority:"high"}),this.once("destroy",()=>this.state="destroyed",{priority:"high"}),this.model=new hd(this.config),this.on("change:isReadOnly",()=>{this.model.document.isReadOnly=this.isReadOnly});const l=new dr;this.data=new Fl(this.model,l),this.editing=new vl(this.model,l),this.editing.view.document.bind("isReadOnly").to(this),this.conversion=new jl([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 sh(this),this.keystrokes.listenTo(this.editing.view.document),this.accessibility=new wh(this),function(e){const t=e.config.get("licenseKey"),i=window[Symbol.for("cke distribution")]||"sh";function n(t,i){e.enableReadOnlyMode(Symbol("invalidLicense")),e._showLicenseError(t,i)}if("GPL"==t)return void("cloud"==i&&n("distributionChannel"));const o=mi(t);if(!o)return void n("invalid");if(!function(e){return["exp","jti","vc"].every(t=>t in e)}(o))return void n("invalid");if(o.distributionChannel&&!Dt(o.distributionChannel).includes(i))return void n("distributionChannel");if(function(e){const t=Array.isArray(e)?e:[e],i=function(){const e=[];for(let t=0;t<256;t++){let i=t;for(let e=0;e<8;e++)1&i?i=3988292384^i>>>1:i>>>=1;e[t]=i}return e}();let n=-1;const o=t.map(e=>Array.isArray(e)?e.join(""):String(e)).join("");for(let e=0;e<o.length;e++)n=n>>>8^i[255&(n^o.charCodeAt(e))];return n=(-1^n)>>>0,n.toString(16).padStart(8,"0")}(function(e){return Object.getOwnPropertyNames(e).sort().filter(t=>"vc"!=t&&null!=e[t]).map(t=>e[t])}(o))!=o.vc.toLowerCase())return void n("invalid");if(new Date(1e3*o.exp)<E)return void n("expired");const r=o.licensedHosts;if(r&&r.length>0&&!function(e){const{hostname:t}=new URL(window.location.href);if(e.includes(t))return!0;const i=t.split(".");return e.filter(e=>e.includes("*")).map(e=>e.split(".")).filter(e=>e.length<=i.length).map(e=>Array(i.length-e.length).fill("*"===e[0]?"*":"").concat(e)).some(e=>i.every((t,i)=>e[i]===t||"*"===e[i]))}(r))return void n("domainLimit");if(["evaluation","trial"].includes(o.licenseType)&&1e3*o.exp<Date.now())return void n("expired");if(["development","evaluation","trial"].includes(o.licenseType)){const{licenseType:e}=o;window.CKEDITOR_WARNING_SUPPRESSIONS=window.CKEDITOR_WARNING_SUPPRESSIONS||{},window.CKEDITOR_WARNING_SUPPRESSIONS[e]||(!function(e){const t=e[0].toUpperCase()+e.slice(1),i="evaluation"===e?"an":"a";console.info(`%cCKEditor 5 ${t} License`,"color: #ffffff; background: #743CCD; font-size: 14px; padding: 4px 8px; border-radius: 4px;"),console.warn(`⚠️ You are using ${i} ${e} license of CKEditor 5`+("trial"===e?" which is for evaluation purposes only":"")+". For production usage, please obtain a production license at https://portal.ckeditor.com/")}(e),window.CKEDITOR_WARNING_SUPPRESSIONS[e]=!0)}if(["evaluation","trial"].includes(o.licenseType)){const t=o.licenseType,i=setTimeout(()=>{n(`${t}Limit`)},6e5);e.on("destroy",()=>{clearTimeout(i)})}o.usageEndpoint&&e.once("ready",()=>{const i={requestId:_(),requestTime:Math.round(Date.now()/1e3),license:t,editor:Ih(e)};e._sendUsageRequest(o.usageEndpoint,i).then(e=>{const{status:t,message:i}=e;i&&console.warn(i),"ok"!=t&&n("usageLimit")},()=>{var e,t;e="license-key-validation-endpoint-not-reachable",t={url:o.usageEndpoint},console.error(...T(e,t))})},{priority:"high"})}(this)}get isReadOnly(){return this._readOnlyLocks.size>0}set isReadOnly(e){throw new A("editor-isreadonly-has-no-setter")}enableReadOnlyMode(e){if("string"!=typeof e&&"symbol"!=typeof e)throw new A("editor-read-only-lock-id-invalid",null,{lockId:e});this._readOnlyLocks.has(e)||(this._readOnlyLocks.add(e),1===this._readOnlyLocks.size&&this.fire("change:isReadOnly","isReadOnly",!0,!1))}disableReadOnlyMode(e){if("string"!=typeof e&&"symbol"!=typeof e)throw new A("editor-read-only-lock-id-invalid",null,{lockId:e});this._readOnlyLocks.has(e)&&(this._readOnlyLocks.delete(e),0===this._readOnlyLocks.size&&this.fire("change:isReadOnly","isReadOnly",!1,!0))}setData(e){this.data.set(e)}getData(e){return this.data.get(e)}initPlugins(){const e=this.config,t=e.get("plugins"),i=e.get("removePlugins")||[],n=e.get("extraPlugins")||[],o=e.get("substitutePlugins")||[];return this.plugins.init(t.concat(n),i,o).then(e=>(function(e){const t=e.config.get("licenseKey");if("GPL"===t)return;const i=mi(t);if(!i)return;const n=[...e.plugins].map(([e])=>e).find(e=>{return!!e.pluginName&&(!!e.licenseFeatureCode&&(t=i,n=e.licenseFeatureCode,(t.removeFeatures||[]).includes(n)));var t,n});n&&(e.enableReadOnlyMode(Symbol("invalidLicense")),e._showLicenseError("pluginNotAllowed",n.pluginName))}(this),e))}destroy(){let e=Promise.resolve();return"initializing"==this.state&&(e=new Promise(e=>this.once("ready",e))),e.then(()=>{this.fire("destroy"),this.stopListening(),this.commands.destroy()}).then(()=>this.plugins.destroy()).then(()=>{this.model.destroy(),this.data.destroy(),this.editing.destroy(),this.keystrokes.destroy()}).then(()=>this._context._removeEditor(this))}execute(e,...t){try{return this.commands.execute(e,...t)}catch(e){A.rethrowUnexpectedError(e,this)}}focus(){this.editing.view.focus()}static create(...e){throw new Error("This is an abstract method.")}static Context=oh;static EditorWatchdog=uh;static ContextWatchdog=gh;_showLicenseError(e,t){setTimeout(()=>{if("invalid"==e)throw new A("invalid-license-key");if("expired"==e)throw new A("license-key-expired");if("domainLimit"==e)throw new A("license-key-domain-limit");if("pluginNotAllowed"==e){const e=t.replace(/(Editing|UI)$/,""),i=this.plugins.has(e);throw new A("license-key-plugin-not-allowed",null,{pluginName:i?e:t})}if("featureNotAllowed"==e)throw new A("license-key-feature-not-allowed",null,{featureName:t});if("evaluationLimit"==e)throw new A("license-key-evaluation-limit");if("trialLimit"==e)throw new A("license-key-trial-limit");if("developmentLimit"==e)throw new A("license-key-development-limit");if("usageLimit"==e)throw new A("license-key-usage-limit");if("distributionChannel"==e)throw new A("license-key-invalid-distribution-channel")},0),this._showLicenseError=()=>{}}async _sendUsageRequest(e,t){const i=new Headers({"Content-Type":"application/json"}),n=await fetch(new URL(e),{method:"POST",headers:i,body:JSON.stringify(t)});if(!n.ok)throw new Error(`HTTP Response: ${n.status}`);return n.json()}}function Ih(e){const t=function(e){return{sessionId:Ah(),pageSessionId:xh(),hostname:window.location.hostname,version:globalThis.CKEDITOR_VERSION,type:_h(e),plugins:(t=e.plugins,Array.from(t).filter(([e])=>!!e.pluginName).map(([e])=>{const{pluginName:t,isContextPlugin:i,isOfficialPlugin:n,isPremiumPlugin:o}=e;return{isContext:!!i,isOfficial:!!n,isPremium:!!o,name:t}})),distribution:{channel:window[Symbol.for("cke distribution")]||"sh"},env:yh(),integration:Object.create(null),menuBar:{isVisible:!!e.config.get("menuBar.isVisible")},language:{ui:e.locale.uiLanguage,content:e.locale.contentLanguage},toolbar:{main:vh(e.config.get("toolbar")),block:vh(e.config.get("blockToolbar")),balloon:vh(e.config.get("balloonToolbar"))}};var t}(e);return e.fire("collectUsageData",{setUsageData:function(e,i){if(void 0!==Xo(t,e))throw new A("editor-usage-data-path-already-set",{path:e});lr(t,e,i)}}),t}function Sh(e){return class extends e{sourceElement;updateSourceElement(e){if(!this.sourceElement)throw new A("editor-missing-sourceelement",this);const t=this.config.get("updateSourceElementOnDestroy"),i=this.sourceElement instanceof HTMLTextAreaElement;if(!t&&!i)return void rt(this.sourceElement,"");const n="string"==typeof e?e:this.data.get();rt(this.sourceElement,n)}}}class Ph extends rh{_actions;static get pluginName(){return"PendingActions"}static get isOfficialPlugin(){return!0}init(){this.set("hasAny",!1),this._actions=new Yt({idProperty:"_id"}),this._actions.delegate("add","remove").to(this)}add(e){if("string"!=typeof e)throw new A("pendingactions-add-invalid-message",this);const t=new(K());return t.set("message",e),this._actions.add(t),this.hasAny=!0,t}remove(e){this._actions.remove(e),this.hasAny=!!this._actions.length}get first(){return this._actions.get(0)}[Symbol.iterator](){return this._actions[Symbol.iterator]()}}class Mh extends(Sh(Eh)){static get editorName(){return"ClassicEditor"}ui;constructor(e,t={}){if(!Oh(e)&&void 0!==t.initialData)throw new A("editor-create-initial-data",null);super(t),this.config.define("menuBar.isVisible",!1),void 0===this.config.get("initialData")&&this.config.set("initialData",function(e){return Oh(e)?(t=e,t instanceof HTMLTextAreaElement?t.value:t.innerHTML):e;var t}(e)),Oh(e)&&(this.sourceElement=e),this.model.document.createRoot();const i=!this.config.get("toolbar.shouldNotGroupWhenFull"),n=this.config.get("menuBar"),o=new Ju(this.locale,this.editing.view,{shouldToolbarGroupWhenFull:i,useMenuBar:n.isVisible,label:this.config.get("label")});this.ui=new wd(this,o),function(e){if(!ut(e.updateSourceElement))throw new A("attachtoform-missing-elementapi-interface",e);const t=e.sourceElement;if(function(e){return!!e&&"textarea"===e.tagName.toLowerCase()}(t)&&t.form){let i;const n=t.form,o=()=>e.updateSourceElement();ut(n.submit)&&(i=n.submit,n.submit=()=>{o(),i.apply(n)}),n.addEventListener("submit",o),e.on("destroy",()=>{n.removeEventListener("submit",o),i&&(n.submit=i)})}}(this)}destroy(){return this.sourceElement&&this.updateSourceElement(),this.ui.destroy(),super.destroy()}static create(e,t={}){return new Promise(i=>{const n=new this(e,t);i(n.initPlugins().then(()=>n.ui.init(Oh(e)?e:null)).then(()=>n.data.init(n.config.get("initialData"))).then(()=>n.fire("ready")).then(()=>n))})}}function Oh(e){return Le(e)}class Rh extends Ws{domEventType=["paste","copy","cut","drop","dragover","dragstart","dragend","dragenter","dragleave"];constructor(e){super(e);const t=this.document;function i(e){return(i,n)=>{n.preventDefault();const o=n.dropRange?[n.dropRange]:null,r=new k(t,e);t.fire(r,{dataTransfer:n.dataTransfer,method:i.name,targetRanges:o,target:n.target,domEvent:n.domEvent}),r.stop.called&&n.stopPropagation()}}this.listenTo(t,"paste",i("clipboardInput"),{priority:"low"}),this.listenTo(t,"drop",i("clipboardInput"),{priority:"low"}),this.listenTo(t,"dragover",i("dragging"),{priority:"low"})}onDomEvent(e){const t="clipboardData"in e?e.clipboardData:e.dataTransfer,i="drop"==e.type||"paste"==e.type,n={dataTransfer:new oa(t,{cacheFiles:i})};if("drop"==e.type||"dragover"==e.type){const t=qe(e);n.dropRange=t&&this.view.domConverter.domRangeToView(t)}this.fire(e.type,e,n)}}const Nh=["figcaption","li"],Vh=["ol","ul"];function Lh(e,t){if(t.is("$text")||t.is("$textProxy"))return t.data;if(t.is("element","img")&&t.hasAttribute("alt"))return t.getAttribute("alt");if(t.is("element","br"))return"\n";let i="",n=null;for(const o of t.getChildren())i+=Bh(o,n)+Lh(e,o),n=o;if(t.is("rawElement")){const n=document.implementation.createHTMLDocument("").createElement("div");t.render(n,e),i+=Dh(n)}return i}function Dh(e){let t="";if(e.nodeType===Node.TEXT_NODE)return e.textContent;if("BR"===e.tagName)return"\n";for(const i of e.childNodes)t+=Dh(i);return t}function Bh(e,t){return t?e.is("element","li")&&!e.isEmpty&&e.getChild(0).is("containerElement")||Vh.includes(e.name)&&Vh.includes(t.name)?"\n\n":e.is("containerElement")||t.is("containerElement")?Nh.includes(e.name)||Nh.includes(t.name)?"\n":e.is("element")&&e.getCustomProperty("dataPipeline:transparentRendering")||t.is("element")&&t.getCustomProperty("dataPipeline:transparentRendering")?"":"\n\n":"":""}function zh(e){return e}function Fh(e,t,i,n){if(t===e)return!0;switch(typeof t){case"object":return function(e,t,i,n){if(null==t)return!0;if(Array.isArray(t))return jh(e,t,i,n);if(t instanceof Map)return function(e,t,i,n){if(0===t.size)return!0;if(!(e instanceof Map))return!1;for(const[o,r]of t.entries()){if(!1===i(e.get(o),r,o,e,t,n))return!1}return!0}(e,t,i,n);if(t instanceof Set)return function(e,t,i,n){if(0===t.size)return!0;if(!(e instanceof Set))return!1;return jh([...e],[...t],i,n)}(e,t,i,n);const o=Object.keys(t);if(null==e)return 0===o.length;if(0===o.length)return!0;if(n&&n.has(t))return n.get(t)===e;n&&n.set(t,e);try{for(let r=0;r<o.length;r++){const s=o[r];if(!Pe(e)&&!(s in e))return!1;if(void 0===t[s]&&void 0!==e[s])return!1;if(null===t[s]&&null!==e[s])return!1;if(!i(e[s],t[s],s,e,t,n))return!1}return!0}finally{n&&n.delete(t)}}(e,t,i,n);case"function":return Object.keys(t).length>0?Fh(e,{...t},i,n):er(e,t);default:return F(e)?"string"!=typeof t||""===t:er(e,t)}}function jh(e,t,i,n){if(0===t.length)return!0;if(!Array.isArray(e))return!1;const o=new Set;for(let r=0;r<t.length;r++){const s=t[r];let a=!1;for(let l=0;l<e.length;l++){if(o.has(l))continue;let c=!1;if(i(e[l],s,r,e,t,n)&&(c=!0),c){o.add(l),a=!0;break}}if(!a)return!1}return!0}function Uh(e,t){return function(e,t,i){return"function"!=typeof i?Uh(e,t):Fh(e,t,function e(t,n,o,r,s,a){const l=i(t,n,o,r,s,a);return void 0!==l?Boolean(l):Fh(t,n,e,a)},new Map)}(e,t,()=>{})}function Hh(e){var t;return e=Oe(t=e,void 0,t,new Map,void 0),t=>Uh(t,e)}function Wh(e,t){switch(typeof e){case"object":Object.is(e?.valueOf(),-0)&&(e="-0");break;case"number":e=Qo(e)}return t=Bt(t),function(i){const n=Xo(i,e);return void 0===n?function(e,t){let i;if(i=Array.isArray(t)?t:"string"==typeof t&&Jo(t)&&null==e?.[t]?Zo(t):[t],0===i.length)return!1;let n=e;for(let e=0;e<i.length;e++){const t=i[e];if(!(null!=n&&Object.hasOwn(n,t)||(Array.isArray(n)||Ft(n))&&nr(t)&&t<n.length))return!1;n=n[t]}return!0}(i,e):void 0===t?void 0===n:Uh(n,t)}}function $h(e){if(null==e)return zh;switch(typeof e){case"function":return e;case"object":return Array.isArray(e)&&2===e.length?Wh(e[0],e[1]):Hh(e);case"string":case"symbol":case"number":return t=e,function(e){return Xo(e,t)}}var t}function qh(e,t=zh){return null==e?{}:function(e,t){const i={},n=Object.keys(e);for(let o=0;o<n.length;o++){const r=n[o],s=e[r];i[r]=t(s,r,e)}return i}(e,$h(t))}class Kh extends Qu{_markersToCopy=new Map;static get pluginName(){return"ClipboardMarkersUtils"}static get isOfficialPlugin(){return!0}_registerMarkerToCopy(e,t){this._markersToCopy.set(e,t)}_copySelectedFragmentWithMarkers(e,t,i=e=>e.model.getSelectedContent(e.model.document.selection)){return this.editor.model.change(n=>{const o=n.model.document.selection;n.setSelection(t);const r=this._insertFakeMarkersIntoSelection(n,n.model.document.selection,e),s=i(n),a=this._removeFakeMarkersInsideElement(n,s);for(const[e,t]of Object.entries(r)){a[e]||=n.createRangeIn(s);for(const e of t)n.remove(e)}s.markers.clear();for(const[e,t]of Object.entries(a))s.markers.set(e,t);return n.setSelection(o),s})}_pasteMarkersIntoTransformedElement(e,t){const i=this._getPasteMarkersFromRangeMap(e);return this.editor.model.change(e=>{const n=this._insertFakeMarkersElements(e,i),o=t(e),r=this._removeFakeMarkersInsideElement(e,o);for(const t of Object.values(n).flat())e.remove(t);for(const[t,i]of Object.entries(r))e.model.markers.has(t)||e.addMarker(t,{usingOperation:!0,affectsData:!0,range:i});return o})}_pasteFragmentWithMarkers(e){const t=this._getPasteMarkersFromRangeMap(e.markers);e.markers.clear();for(const i of t)e.markers.set(i.name,i.range);return this.editor.model.insertContent(e)}_forceMarkersCopy(e,t,i={allowedActions:"all",copyPartiallySelected:!0,duplicateOnPaste:!0}){const n=this._markersToCopy.get(e);this._markersToCopy.set(e,i),t(),n?this._markersToCopy.set(e,n):this._markersToCopy.delete(e)}_isMarkerCopyable(e,t){const i=this._getMarkerClipboardConfig(e);if(!i)return!1;if(!t)return!0;const{allowedActions:n}=i;return"all"===n||n.includes(t)}_hasMarkerConfiguration(e){return!!this._getMarkerClipboardConfig(e)}_getMarkerClipboardConfig(e){const[t]=e.split(":");return this._markersToCopy.get(t)||null}_insertFakeMarkersIntoSelection(e,t,i){const n=this._getCopyableMarkersFromSelection(e,t,i);return this._insertFakeMarkersElements(e,n)}_getCopyableMarkersFromSelection(e,t,i){const n=Array.from(t.getRanges()),o=new Set(n.flatMap(t=>Array.from(e.model.markers.getMarkersIntersectingRange(t))));return Array.from(o).filter(e=>{if(!this._isMarkerCopyable(e.name,i))return!1;const{copyPartiallySelected:t}=this._getMarkerClipboardConfig(e.name);if(!t){const t=e.getRange();return n.some(e=>e.containsRange(t,!0))}return!0}).map(e=>({name:"dragstart"===i?this._getUniqueMarkerName(e.name):e.name,range:e.getRange()}))}_getPasteMarkersFromRangeMap(e,t=null){const{model:i}=this.editor;return(e instanceof Map?Array.from(e.entries()):Object.entries(e)).flatMap(([e,n])=>{if(!this._hasMarkerConfiguration(e))return[{name:e,range:n}];if(this._isMarkerCopyable(e,t)){const t=this._getMarkerClipboardConfig(e),o=i.markers.has(e)&&"$graveyard"===i.markers.get(e).getRange().root.rootName;return(t.duplicateOnPaste||o)&&(e=this._getUniqueMarkerName(e)),[{name:e,range:n}]}return[]})}_insertFakeMarkersElements(e,t){const i={},n=t.flatMap(e=>{const{start:t,end:i}=e.range;return[{position:t,marker:e,type:"start"},{position:i,marker:e,type:"end"}]}).sort(({position:e},{position:t})=>e.isBefore(t)?1:-1);for(const{position:t,marker:o,type:r}of n){const n=e.createElement("$marker",{"data-name":o.name,"data-type":r});i[o.name]||(i[o.name]=[]),i[o.name].push(n),e.insert(n,t)}return i}_removeFakeMarkersInsideElement(e,t){return qh(this._getAllFakeMarkersFromElement(e,t).reduce((t,i)=>{const n=i.markerElement&&e.createPositionBefore(i.markerElement);let o=t[i.name],r=!1;if(o?.start&&o?.end){this._getMarkerClipboardConfig(i.name).duplicateOnPaste?t[this._getUniqueMarkerName(i.name)]=t[i.name]:r=!0,o=null}return r||(t[i.name]={...o,[i.type]:n}),i.markerElement&&e.remove(i.markerElement),t},{}),i=>new _a(i.start||e.createPositionFromPath(t,[0]),i.end||e.createPositionAt(t,"end")))}_getAllFakeMarkersFromElement(e,t){const i=Array.from(e.createRangeIn(t)).flatMap(({item:e})=>{if(!e.is("element","$marker"))return[];const t=e.getAttribute("data-name"),i=e.getAttribute("data-type");return[{markerElement:e,name:t,type:i}]}),n=[],o=[];for(const e of i){if("end"===e.type){i.some(t=>t.name===e.name&&"start"===t.type)||n.push({markerElement:null,name:e.name,type:"start"})}if("start"===e.type){i.some(t=>t.name===e.name&&"end"===t.type)||o.unshift({markerElement:null,name:e.name,type:"end"})}}return[...n,...i,...o]}_getUniqueMarkerName(e){const t=e.split(":"),i=_().substring(1,6);return 3===t.length?`${t.slice(0,2).join(":")}:${i}`:`${t.join(":")}:${i}`}}class Gh extends Qu{static get pluginName(){return"ClipboardPipeline"}static get isOfficialPlugin(){return!0}static get requires(){return[Kh]}init(){this.editor.editing.view.addObserver(Rh),this._setupPasteDrop(),this._setupCopyCut()}_fireOutputTransformationEvent(e,t,i){const n=this.editor.plugins.get("ClipboardMarkersUtils");this.editor.model.enqueueChange({isUndoable:"cut"===i},()=>{const o=n._copySelectedFragmentWithMarkers(i,t);this.fire("outputTransformation",{dataTransfer:e,content:o,method:i})})}_setupPasteDrop(){const e=this.editor,t=e.model,i=e.editing.view,n=i.document,o=this.editor.plugins.get("ClipboardMarkersUtils");this.listenTo(n,"clipboardInput",(t,i)=>{"paste"!=i.method||e.model.canEditAt(e.model.document.selection)||t.stop()},{priority:"highest"}),this.listenTo(n,"clipboardInput",(e,t)=>{const n=t.dataTransfer;let o;if(t.content)o=t.content;else{let e="";n.getData("text/html")?e=function(e){return e.replace(/<span(?: class="Apple-converted-space"|)>(\s+)<\/span>/g,(e,t)=>1==t.length?" ":t).replace(/<!--[\s\S]*?-->/g,"")}(n.getData("text/html")):n.getData("text/plain")&&(((r=(r=n.getData("text/plain")).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\r?\n\r?\n/g,"</p><p>").replace(/\r?\n/g,"<br>").replace(/\t/g," ").replace(/^\s/," ").replace(/\s$/," ").replace(/\s\s/g," ")).includes("</p><p>")||r.includes("<br>"))&&(r=`<p>${r}</p>`),e=r),o=this.editor.data.htmlProcessor.toView(e)}var r;const s=new k(this,"inputTransformation"),a=n.getData("application/ckeditor5-editor-id")||null;this.fire(s,{content:o,dataTransfer:n,sourceEditorId:a,targetRanges:t.targetRanges,method:t.method}),s.stop.called&&e.stop(),i.scrollToTheSelection()},{priority:"low"}),this.listenTo(this,"inputTransformation",(e,i)=>{if(i.content.isEmpty)return;const n=this.editor.data.toModel(i.content,"$clipboardHolder");0!=n.childCount&&(e.stop(),t.change(()=>{this.fire("contentInsertion",{content:n,method:i.method,sourceEditorId:i.sourceEditorId,dataTransfer:i.dataTransfer,targetRanges:i.targetRanges})}))},{priority:"low"}),this.listenTo(this,"contentInsertion",(e,t)=>{t.resultRange=o._pasteFragmentWithMarkers(t.content)},{priority:"low"})}_setupCopyCut(){const e=this.editor,t=e.model.document,i=e.editing.view.document,n=(e,i)=>{const n=i.dataTransfer;i.preventDefault(),this._fireOutputTransformationEvent(n,t.selection,e.name)};this.listenTo(i,"copy",n,{priority:"low"}),this.listenTo(i,"cut",(t,i)=>{e.model.canEditAt(e.model.document.selection)?n(t,i):i.preventDefault()},{priority:"low"}),this.listenTo(this,"outputTransformation",(t,n)=>{const o=e.data.toView(n.content,{isClipboardPipeline:!0});i.fire("clipboardOutput",{dataTransfer:n.dataTransfer,content:o,method:n.method})},{priority:"low"}),this.listenTo(i,"clipboardOutput",(i,n)=>{n.content.isEmpty||(n.dataTransfer.setData("text/html",this.editor.data.htmlProcessor.toData(n.content)),n.dataTransfer.setData("text/plain",Lh(e.data.htmlProcessor.domConverter,n.content)),n.dataTransfer.setData("application/ckeditor5-editor-id",this.editor.id)),"cut"==n.method&&e.model.deleteContent(t.selection)},{priority:"low"})}}class Yh{model;limit;_isLocked;_size;_batch=null;_changeCallback;_selectionChangeCallback;constructor(e,t=20){this.model=e,this._size=0,this.limit=t,this._isLocked=!1,this._changeCallback=(e,t)=>{t.isLocal&&t.isUndoable&&t!==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({isTyping:!0})),this._batch}get size(){return this._size}input(e){this._size+=e,this._size>=this.limit&&this._reset(!0)}get isLocked(){return this._isLocked}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(e=!1){this.isLocked&&!e||(this._batch=null,this._size=0)}}class Jh extends Xu{_buffer;constructor(e,t){super(e),this._buffer=new Yh(e.model,t),this._isEnabledBasedOnSelection=!1}get buffer(){return this._buffer}destroy(){super.destroy(),this._buffer.destroy()}execute(e={}){const t=this.editor.model,i=t.document,n=e.text||"",o=n.length;let r=i.selection;if(e.selection?r=e.selection:e.range&&(r=t.createSelection(e.range)),!t.canEditAt(r))return;const s=e.resultRange;t.enqueueChange(this._buffer.batch,e=>{this._buffer.lock();const a=Array.from(i.selection.getAttributes());t.deleteContent(r),n&&t.insertContent(e.createText(n,a),r),s?e.setSelection(s):r.is("documentSelection")||e.setSelection(r),this._buffer.unlock(),this._buffer.input(o)})}}const Qh=["insertText","insertReplacementText"],Zh=[...Qh,"insertCompositionText"];class Xh extends Vs{focusObserver;constructor(e){super(e),this.focusObserver=e.getObserver(ta);const t=r.isAndroid?Zh:Qh,i=e.document;i.on("beforeinput",(n,o)=>{if(!this.isEnabled)return;const{data:r,targetRanges:s,inputType:a,domEvent:l,isComposing:c}=o;if(!t.includes(a))return;this.focusObserver.flush();const d=new k(i,"insertText");i.fire(d,new Hs(e,l,{text:r,selection:e.createSelection(s),isComposing:c})),d.stop.called&&n.stop()}),r.isAndroid||i.on("compositionend",(t,{data:n,domEvent:o})=>{this.isEnabled&&n&&i.fire("insertText",new Hs(e,o,{text:n,isComposing:!0}))},{priority:"low"})}observe(){}stopObserving(){}}class em extends Qu{_typingQueue;static get pluginName(){return"Input"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.model,i=e.editing.view,n=e.editing.mapper,o=t.document.selection;this._typingQueue=new tm(e),i.addObserver(Xh);const s=new Jh(e,e.config.get("typing.undoStep")||20);e.commands.add("insertText",s),e.commands.add("input",s),this.listenTo(i.document,"beforeinput",()=>{this._typingQueue.flush("next beforeinput")},{priority:"high"}),this.listenTo(i.document,"insertText",(e,a)=>{const{text:l,selection:c}=a;if(i.document.selection.isFake&&c&&i.document.selection.isSimilar(c)&&a.preventDefault(),c&&Array.from(c.getRanges()).some(e=>!e.isCollapsed)&&a.preventDefault(),!s.isEnabled)return void a.preventDefault();let d;c&&(d=Array.from(c.getRanges()).filter(e=>e.root.is("rootElement")).map(e=>n.toModelRange(e)).map(e=>Jc(e,t.schema)||e)),d&&d.length||(d=Array.from(o.getRanges()));let u=l;if(r.isAndroid){const e=Array.from(d[0].getItems()).reduce((e,t)=>e+(t.is("$textProxy")?t.data:""),"");if(e&&(e.length<=u.length?u.startsWith(e)&&(u=u.substring(e.length),d[0].start=d[0].start.getShiftedBy(e.length)):e.startsWith(u)&&(d[0].start=d[0].start.getShiftedBy(u.length),u="")),0==u.length&&d[0].isCollapsed)return}const h={text:u,selection:t.createSelection(d)};this._typingQueue.push(h,Boolean(a.isComposing)),a.domEvent.defaultPrevented&&this._typingQueue.flush("beforeinput default prevented")}),r.isAndroid?this.listenTo(i.document,"keydown",(e,n)=>{!o.isCollapsed&&229==n.keyCode&&i.document.isComposing&&im(t,s)}):this.listenTo(i.document,"compositionstart",()=>{o.isCollapsed||im(t,s)},{priority:"high"}),this.listenTo(i.document,"mutations",(e,{mutations:t})=>{if(this._typingQueue.hasAffectedElements())for(const{node:e}of t){const t=nm(e,n),i=n.toModelElement(t);if(this._typingQueue.isElementAffected(i))return void this._typingQueue.flush("mutations")}}),this.listenTo(i.document,"compositionend",()=>{this._typingQueue.flush("before composition end")},{priority:"high"}),this.listenTo(i.document,"compositionend",()=>{this._typingQueue.flush("after composition end");const e=[];if(this._typingQueue.hasAffectedElements())for(const t of this._typingQueue.flushAffectedElements()){const i=n.toViewElement(t);i&&e.push({type:"children",node:i})}!e.length&&r.isAndroid||i.document.fire("mutations",{mutations:e})},{priority:"lowest"})}destroy(){super.destroy(),this._typingQueue.destroy()}}class tm{editor;flushDebounced=an(()=>this.flush("timeout"),50);_queue=[];_isComposing=!1;_affectedElements=new Set;constructor(e){this.editor=e}destroy(){for(this.flushDebounced.cancel(),this._affectedElements.clear();this._queue.length;)this.shift()}get length(){return this._queue.length}push(e,t){const i={text:e.text};if(e.selection){i.selectionRanges=[];for(const t of e.selection.getRanges())i.selectionRanges.push(La.fromRange(t)),this._affectedElements.add(t.start.parent)}this._queue.push(i),this._isComposing||=t,this.flushDebounced()}shift(){const e=this._queue.shift(),t={text:e.text};if(e.selectionRanges){const i=e.selectionRanges.map(e=>function(e){const t=e.toRange();if(e.detach(),"$graveyard"==t.root.rootName)return null;return t}(e)).filter(e=>!!e);i.length&&(t.selection=this.editor.model.createSelection(i))}return t}flush(e){const t=this.editor,i=t.model,n=t.editing.view;if(this.flushDebounced.cancel(),!this._queue.length)return;const o=t.commands.get("insertText").buffer;i.enqueueChange(o.batch,()=>{for(o.lock();this._queue.length;){const e=this.shift();t.execute("insertText",e)}o.unlock(),this._isComposing||this._affectedElements.clear(),this._isComposing=!1}),n.scrollToTheSelection()}isElementAffected(e){return this._affectedElements.has(e)}hasAffectedElements(){return this._affectedElements.size>0}flushAffectedElements(){const e=Array.from(this._affectedElements);return this._affectedElements.clear(),e}}function im(e,t){if(!t.isEnabled)return;const i=t.buffer;i.lock(),e.enqueueChange(i.batch,()=>{e.deleteContent(e.document.selection)}),i.unlock()}function nm(e,t){let i=e.is("$text")?e.parent:e;for(;!t.toModelElement(i);)i=i.parent;return i}class om extends Xu{direction;_buffer;constructor(e,t){super(e),this.direction=t,this._buffer=new Yh(e.model,e.config.get("typing.undoStep")),this._isEnabledBasedOnSelection=!1}get buffer(){return this._buffer}execute(e={}){const t=this.editor.model,i=t.document;t.enqueueChange(this._buffer.batch,n=>{this._buffer.lock();const o=n.createSelection(e.selection||i.selection);if(!t.canEditAt(o))return;const r=e.sequence||1,s=o.isCollapsed;if(o.isCollapsed&&t.modifySelection(o,{direction:this.direction,unit:e.unit,treatEmojiAsSingleUnit:!0}),this._shouldEntireContentBeReplacedWithParagraph(r))return void this._replaceEntireContentWithParagraph(n);if(this._shouldReplaceFirstBlockWithParagraph(o,r))return void this.editor.execute("paragraph",{selection:o});if(o.isCollapsed)return;let a=0;o.getFirstRange().getMinimalFlatRanges().forEach(e=>{a+=ee(e.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))}),t.deleteContent(o,{doNotResetEntireContent:s,direction:this.direction}),this._buffer.input(a),n.setSelection(o),this._buffer.unlock()})}_shouldEntireContentBeReplacedWithParagraph(e){if(e>1)return!1;const t=this.editor.model,i=t.document.selection,n=t.schema.getLimitElement(i);if(!(i.isCollapsed&&i.containsEntireContent(n)))return!1;if(!t.schema.checkChild(n,"paragraph"))return!1;const o=n.getChild(0);return!o||!o.is("element","paragraph")}_replaceEntireContentWithParagraph(e){const t=this.editor.model,i=t.document.selection,n=t.schema.getLimitElement(i),o=e.createElement("paragraph");e.remove(e.createRangeIn(n)),e.insert(o,n),e.setSelection(o,0)}_shouldReplaceFirstBlockWithParagraph(e,t){const i=this.editor.model;if(t>1||"backward"!=this.direction)return!1;if(!e.isCollapsed)return!1;const n=e.getFirstPosition(),o=i.schema.getLimitElement(n),r=o.getChild(0);return n.parent==r&&(!!e.containsEntireContent(r)&&(!!i.schema.checkChild(o,"paragraph")&&"paragraph"!=r.name))}}const rm="word",sm="selection",am="backward",lm="forward",cm={deleteContent:{unit:sm,direction:am},deleteContentBackward:{unit:"codePoint",direction:am},deleteWordBackward:{unit:rm,direction:am},deleteHardLineBackward:{unit:sm,direction:am},deleteSoftLineBackward:{unit:sm,direction:am},deleteContentForward:{unit:"character",direction:lm},deleteWordForward:{unit:rm,direction:lm},deleteHardLineForward:{unit:sm,direction:lm},deleteSoftLineForward:{unit:sm,direction:lm}};class dm extends Vs{constructor(e){super(e);const t=e.document;let i=0;t.on("keydown",()=>{i++}),t.on("keyup",()=>{i=0}),t.on("beforeinput",(n,o)=>{if(!this.isEnabled)return;const{targetRanges:s,domEvent:a,inputType:l}=o,c=cm[l];if(!c)return;const d={direction:c.direction,unit:c.unit,sequence:i};d.unit==sm&&(d.selectionToRemove=e.createSelection(s[0])),"deleteContentBackward"===l&&(r.isAndroid&&(d.sequence=1),function(e){if(1!=e.length||e[0].isCollapsed)return!1;const t=e[0].getWalker({direction:"backward",singleCharacters:!0,ignoreElementEnd:!0});let i=0;for(const{nextPosition:e,item:n}of t){if(e.parent.is("$text")){const t=e.parent.data,n=e.offset;if(li(t,n)||ci(t,n)||ui(t,n))continue;i++}else(n.is("containerElement")||n.is("emptyElement"))&&i++;if(i>1)return!0}return!1}(s)&&(d.unit=sm,d.selectionToRemove=e.createSelection(s)));const u=new Sr(t,"delete",s[0]);t.fire(u,new Hs(e,a,d)),u.stop.called&&n.stop()}),r.isBlink&&function(e){const t=e.view,i=t.document;let n=null,o=!1;function r(e){return e==Pt.backspace||e==Pt.delete}function s(e){return e==Pt.backspace?am:lm}i.on("keydown",(e,{keyCode:t})=>{n=t,o=!1}),i.on("keyup",(a,{keyCode:l,domEvent:c})=>{const d=i.selection,u=e.isEnabled&&l==n&&r(l)&&!d.isCollapsed&&!o;if(n=null,u){const e=d.getFirstRange(),n=new Sr(i,"delete",e),o={unit:sm,direction:s(l),selectionToRemove:d};i.fire(n,new Hs(t,c,o))}}),i.on("beforeinput",(e,{inputType:t})=>{const i=cm[t];r(n)&&i&&i.direction==s(n)&&(o=!0)},{priority:"high"}),i.on("beforeinput",(e,{inputType:t,data:i})=>{n==Pt.delete&&"insertText"==t&&""==i&&e.stop()},{priority:"high"})}(this)}observe(){}stopObserving(){}}class um extends Qu{_undoOnBackspace;static get pluginName(){return"Delete"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.editing.view,i=t.document,n=e.model.document;t.addObserver(dm),this._undoOnBackspace=!1;const o=new om(e,"forward");e.commands.add("deleteForward",o),e.commands.add("forwardDelete",o),e.commands.add("delete",new om(e,"backward")),this.listenTo(i,"delete",(n,o)=>{i.isComposing||o.preventDefault();const{direction:r,sequence:s,selectionToRemove:a,unit:l}=o,c="forward"===r?"deleteForward":"delete",d={sequence:s};if("selection"==l){const t=Array.from(a.getRanges()).map(t=>e.editing.mapper.toModelRange(t)).map(t=>Jc(t,e.model.schema)||t);d.selection=e.model.createSelection(t)}else d.unit=l;e.execute(c,d),t.scrollToTheSelection()},{priority:"low"}),this.listenTo(i,"keydown",(o,r)=>{if(i.isComposing||r.keyCode!=Pt.backspace||!n.selection.isCollapsed)return;const s=e.model.schema.getLimitElement(n.selection),a=e.model.createPositionAt(s,0);if(a.isTouching(n.selection.getFirstPosition())){r.preventDefault();const n=e.model.schema.getNearestSelectionRange(a,"forward");if(!n)return;const o=t.createSelection(e.editing.mapper.toViewRange(n)),s=o.getFirstRange(),l=new Sr(document,"delete",s),c={unit:"selection",direction:"backward",selectionToRemove:o};i.fire(l,new Hs(t,r.domEvent,c))}}),this.editor.plugins.has("UndoEditing")&&(this.listenTo(i,"delete",(t,i)=>{this._undoOnBackspace&&"backward"==i.direction&&1==i.sequence&&"codePoint"==i.unit&&(this._undoOnBackspace=!1,e.execute("undo"),i.preventDefault(),t.stop())},{context:"$capture"}),this.listenTo(n,"change",()=>{this._undoOnBackspace=!1}))}requestUndoOnBackspace(){this.editor.plugins.has("UndoEditing")&&(this._undoOnBackspace=!0)}}class hm extends Qu{static get requires(){return[em,um]}static get pluginName(){return"Typing"}static get isOfficialPlugin(){return!0}}function mm(e,t){let i=e.start;return{text:Array.from(e.getWalker({ignoreElementEnd:!1})).reduce((e,{item:n})=>n.is("$text")||n.is("$textProxy")?e+n.data:(i=t.createPositionAfter(n),""),""),range:t.createRange(i,e.end)}}class gm extends(K()){model;testCallback;_hasMatch;constructor(e,t){super(),this.model=e,this.testCallback=t,this._hasMatch=!1,this.set("isEnabled",!0),this.on("change:isEnabled",()=>{this.isEnabled?this._startListening():(this.stopListening(e.document.selection),this.stopListening(e.document))}),this._startListening()}get hasMatch(){return this._hasMatch}_startListening(){const e=this.model.document;this.listenTo(e.selection,"change:range",(t,{directChange:i})=>{i&&(e.selection.isCollapsed?this._evaluateTextBeforeSelection("selection"):this.hasMatch&&(this.fire("unmatched"),this._hasMatch=!1))}),this.listenTo(e,"change:data",(e,t)=>{!t.isUndo&&t.isLocal&&this._evaluateTextBeforeSelection("data",{batch:t})})}_evaluateTextBeforeSelection(e,t={}){const i=this.model,n=i.document.selection,o=i.createRange(i.createPositionAt(n.focus.parent,0),n.focus),{text:r,range:s}=mm(o,i),a=this.testCallback(r);if(!a&&this.hasMatch&&this.fire("unmatched"),this._hasMatch=!!a,a){const i=Object.assign(t,{text:r,range:s});"object"==typeof a&&Object.assign(i,a),this.fire(`matched:${e}`,i)}}}class fm extends Qu{attributes;_overrideUid;_isNextGravityRestorationSkipped=!1;static get pluginName(){return"TwoStepCaretMovement"}static get isOfficialPlugin(){return!0}constructor(e){super(e),this.attributes=new Set,this._overrideUid=null}init(){const e=this.editor,t=e.model,i=e.editing.view,n=e.locale,o=t.document.selection;this.listenTo(i.document,"arrowKey",(e,t)=>{if(!o.isCollapsed)return;if(t.shiftKey||t.altKey||t.ctrlKey)return;const i=t.keyCode==Pt.arrowright,r=t.keyCode==Pt.arrowleft;if(!i&&!r)return;const s=n.contentLanguageDirection;let a=!1;a="ltr"===s&&i||"rtl"===s&&r?this._handleForwardMovement(t):this._handleBackwardMovement(t),!0===a&&e.stop()},{context:"$text",priority:"highest"}),this.listenTo(o,"change:range",(e,t)=>{this._isNextGravityRestorationSkipped?this._isNextGravityRestorationSkipped=!1:this._isGravityOverridden&&(!t.directChange&&vm(o.getFirstPosition(),this.attributes)||this._restoreGravity())}),this._enableClickingAfterNode(),this._enableInsertContentSelectionAttributesFixer(),this._handleDeleteContentAfterNode()}registerAttribute(e){this.attributes.add(e)}_handleForwardMovement(e){const t=this.attributes,i=this.editor.model,n=i.document.selection,o=n.getFirstPosition();return!this._isGravityOverridden&&((!o.isAtStart||!pm(n,t))&&(!!vm(o,t)&&(e&&wm(e),pm(n,t)&&vm(o,t,!0)?km(i,t):this._overrideGravity(),!0)))}_handleBackwardMovement(e){const t=this.attributes,i=this.editor.model,n=i.document.selection,o=n.getFirstPosition();return this._isGravityOverridden?(e&&wm(e),this._restoreGravity(),vm(o,t,!0)?km(i,t):bm(i,t,o),!0):o.isAtStart?!!pm(n,t)&&(e&&wm(e),bm(i,t,o),!0):!pm(n,t)&&vm(o,t,!0)?(e&&wm(e),bm(i,t,o),!0):!!_m(o,t)&&(o.isAtEnd&&!pm(n,t)&&vm(o,t)?(e&&wm(e),bm(i,t,o),!0):(this._isNextGravityRestorationSkipped=!0,this._overrideGravity(),!1))}_enableClickingAfterNode(){const e=this.editor,t=e.model,i=t.document.selection,n=e.editing.view.document;e.editing.view.addObserver(fd),e.editing.view.addObserver(pd);let o=!1,r=!1;this.listenTo(n,"touchstart",()=>{r=!1,o=!0}),this.listenTo(n,"mousedown",()=>{r=!0}),this.listenTo(n,"selectionChange",()=>{const e=this.attributes;if(!r&&!o)return;if(r=!1,o=!1,!i.isCollapsed)return;if(!pm(i,e))return;const n=i.getFirstPosition();vm(n,e)&&(n.isAtStart||vm(n,e,!0)?km(t,e):this._isGravityOverridden||this._overrideGravity())})}_enableInsertContentSelectionAttributesFixer(){const e=this.editor.model,t=e.document.selection,i=this.attributes;this.listenTo(e,"insertContent",()=>{const n=t.getFirstPosition();pm(t,i)&&vm(n,i)&&km(e,i)},{priority:"low"})}_handleDeleteContentAfterNode(){const e=this.editor,t=e.model,i=t.document.selection,n=e.editing.view;let o=!1,r=!1;this.listenTo(n.document,"delete",(e,t)=>{o="backward"===t.direction},{priority:"high"}),this.listenTo(t,"deleteContent",()=>{if(!o)return;const e=i.getFirstPosition();r=pm(i,this.attributes)&&!_m(e,this.attributes)},{priority:"high"}),this.listenTo(t,"deleteContent",()=>{o&&(o=!1,r||e.model.enqueueChange(()=>{const e=i.getFirstPosition();pm(i,this.attributes)&&vm(e,this.attributes)&&(e.isAtStart||vm(e,this.attributes,!0)?km(t,this.attributes):this._isGravityOverridden||this._overrideGravity())}))},{priority:"low"})}get _isGravityOverridden(){return!!this._overrideUid}_overrideGravity(){this._overrideUid=this.editor.model.change(e=>e.overrideSelectionGravity())}_restoreGravity(){this.editor.model.change(e=>{e.restoreSelectionGravity(this._overrideUid),this._overrideUid=null})}}function pm(e,t){for(const i of t)if(e.hasAttribute(i))return!0;return!1}function bm(e,t,i){const n=i.nodeBefore;e.change(i=>{if(n){const t=[],o=e.schema.isObject(n)&&e.schema.isInline(n);for(const[i,r]of n.getAttributes())!e.schema.checkAttribute("$text",i)||o&&!1===e.schema.getAttributeProperties(i).copyFromObject||t.push([i,r]);i.setSelectionAttribute(t)}else i.removeSelectionAttribute(t)})}function km(e,t){e.change(e=>{e.removeSelectionAttribute(t)})}function wm(e){e.preventDefault()}function _m(e,t){return vm(e.getShiftedBy(-1),t)}function vm(e,t,i=!1){const{nodeBefore:n,nodeAfter:o}=e;for(const e of t){const t=n?n.getAttribute(e):void 0,r=o?o.getAttribute(e):void 0;if((!i||void 0!==t&&void 0!==r)&&r!==t)return!0}return!1}function ym(e){if(null==e)return"";if("string"==typeof e)return e;if(Array.isArray(e))return e.map(ym).join(",");const t=String(e);return"0"===t&&Object.is(Number(e),-0)?"-0":t}const Am={copyright:{from:"(c)",to:"©"},registeredTrademark:{from:"(r)",to:"®"},trademark:{from:"(tm)",to:"™"},oneHalf:{from:/(^|[^/a-z0-9])(1\/2)([^/a-z0-9])$/i,to:[null,"½",null]},oneThird:{from:/(^|[^/a-z0-9])(1\/3)([^/a-z0-9])$/i,to:[null,"⅓",null]},twoThirds:{from:/(^|[^/a-z0-9])(2\/3)([^/a-z0-9])$/i,to:[null,"⅔",null]},oneForth:{from:/(^|[^/a-z0-9])(1\/4)([^/a-z0-9])$/i,to:[null,"¼",null]},threeQuarters:{from:/(^|[^/a-z0-9])(3\/4)([^/a-z0-9])$/i,to:[null,"¾",null]},lessThanOrEqual:{from:"<=",to:"≤"},greaterThanOrEqual:{from:">=",to:"≥"},notEqual:{from:"!=",to:"≠"},arrowLeft:{from:"<-",to:"←"},arrowRight:{from:"->",to:"→"},horizontalEllipsis:{from:"...",to:"…"},enDash:{from:/(^| )(--)( )$/,to:[null,"–",null]},emDash:{from:/(^| )(---)( )$/,to:[null,"—",null]},quotesPrimary:{from:Sm('"'),to:[null,"“",null,"”"]},quotesSecondary:{from:Sm("'"),to:[null,"‘",null,"’"]},quotesPrimaryEnGb:{from:Sm("'"),to:[null,"‘",null,"’"]},quotesSecondaryEnGb:{from:Sm('"'),to:[null,"“",null,"”"]},quotesPrimaryPl:{from:Sm('"'),to:[null,"„",null,"”"]},quotesSecondaryPl:{from:Sm("'"),to:[null,"‚",null,"’"]}},xm={symbols:["copyright","registeredTrademark","trademark"],mathematical:["oneHalf","oneThird","twoThirds","oneForth","threeQuarters","lessThanOrEqual","greaterThanOrEqual","notEqual","arrowLeft","arrowRight"],typography:["horizontalEllipsis","enDash","emDash"],quotes:["quotesPrimary","quotesSecondary"]},Cm=["symbols","mathematical","typography","quotes"];function Tm(e){return"string"==typeof e?new RegExp(`(${t=e,function(e){return e.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&")}(ym(t))})$`):e;var t}function Em(e){return"string"==typeof e?()=>[e]:e instanceof Array?()=>e:e}function Im(e){return(e.textNode?e.textNode:e.nodeAfter).getAttributes()}function Sm(e){return new RegExp(`(^|\\s)(${e})([^${e}]*)(${e})$`)}function Pm(e,t,i,n){return n.createRange(Mm(e,t,i,!0,n),Mm(e,t,i,!1,n))}function Mm(e,t,i,n,o){let r=e.textNode||(n?e.nodeBefore:e.nodeAfter),s=null;for(;r&&r.getAttribute(t)==i;)s=r,r=n?r.previousSibling:r.nextSibling;return s?o.createPositionAt(s,n?"before":"after"):e}function*Om(e,t){for(const i of t)i&&e.getAttributeProperties(i[0]).copyOnEnter&&(yield i)}class Rm extends Xu{execute(){this.editor.model.change(e=>{this.enterBlock(e),this.fire("afterExecute",{writer:e})})}enterBlock(e){const t=this.editor.model,i=t.document.selection,n=t.schema,o=i.isCollapsed,r=i.getFirstRange(),s=r.start.parent,a=r.end.parent;if(n.isLimit(s)||n.isLimit(a))return o||s!=a||t.deleteContent(i),!1;if(o){const t=Om(e.model.schema,i.getAttributes());return Nm(e,r.start),e.setSelectionAttribute(t),!0}{const n=!(r.start.isAtStart&&r.end.isAtEnd),o=s==a;if(t.deleteContent(i,{leaveUnmerged:n}),n){if(o)return Nm(e,i.focus),!0;e.setSelection(a,0)}}return!1}}function Nm(e,t){e.split(t),e.setSelection(t.parent.nextSibling,0)}const Vm={insertParagraph:{isSoft:!1},insertLineBreak:{isSoft:!0}};class Lm extends Vs{constructor(e){super(e);const t=this.document;let i=!1;t.on("keydown",(e,t)=>{i=t.shiftKey}),t.on("beforeinput",(n,o)=>{if(!this.isEnabled)return;let s=o.inputType;r.isSafari&&i&&"insertParagraph"==s&&(s="insertLineBreak");const a=o.domEvent,l=Vm[s];if(!l)return;const c=new Sr(t,"enter",o.targetRanges[0]);t.fire(c,new Hs(e,a,{isSoft:l.isSoft})),c.stop.called&&n.stop()})}observe(){}stopObserving(){}}class Dm extends Qu{static get pluginName(){return"Enter"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.editing.view,i=t.document,n=this.editor.t;t.addObserver(Lm),e.commands.add("enter",new Rm(e)),this.listenTo(i,"enter",(n,o)=>{i.isComposing||o.preventDefault(),o.isSoft||(e.execute("enter"),t.scrollToTheSelection())},{priority:"low"}),e.accessibility.addKeystrokeInfos({keystrokes:[{label:n("Insert a hard break (a new paragraph)"),keystroke:"Enter"}]})}}class Bm extends Xu{execute(){const e=this.editor.model,t=e.document;e.change(i=>{!function(e,t,i){const n=i.isCollapsed,o=i.getFirstRange(),r=o.start.parent,s=o.end.parent,a=r==s;if(n){const n=Om(e.schema,i.getAttributes());zm(e,t,o.end),t.removeSelectionAttribute(i.getAttributeKeys()),t.setSelectionAttribute(n)}else{const n=!(o.start.isAtStart&&o.end.isAtEnd);e.deleteContent(i,{leaveUnmerged:n}),a?zm(e,t,i.focus):n&&t.setSelection(s,0)}}(e,i,t.selection),this.fire("afterExecute",{writer:i})})}refresh(){const e=this.editor.model,t=e.document;this.isEnabled=function(e,t){if(t.rangeCount>1)return!1;const i=t.anchor;if(!i||!e.checkChild(i,"softBreak"))return!1;const n=t.getFirstRange(),o=n.start.parent,r=n.end.parent;if((Fm(o,e)||Fm(r,e))&&o!==r)return!1;return!0}(e.schema,t.selection)}}function zm(e,t,i){const n=t.createElement("softBreak");e.insertContent(n,i),t.setSelection(n,"after")}function Fm(e,t){return!e.is("rootElement")&&(t.isLimit(e)||Fm(e.parent,t))}class jm extends Qu{static get pluginName(){return"ShiftEnter"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.model.schema,i=e.conversion,n=e.editing.view,o=n.document,r=this.editor.t;t.register("softBreak",{allowWhere:"$text",isInline:!0}),i.for("upcast").elementToElement({model:"softBreak",view:"br"}),i.for("downcast").elementToElement({model:"softBreak",view:(e,{writer:t})=>t.createEmptyElement("br")}),n.addObserver(Lm),e.commands.add("shiftEnter",new Bm(e)),this.listenTo(o,"enter",(t,i)=>{o.isComposing||i.preventDefault(),i.isSoft&&(e.execute("shiftEnter"),n.scrollToTheSelection())},{priority:"low"}),e.accessibility.addKeystrokeInfos({keystrokes:[{label:r("Insert a soft break (a <code><br></code> element)"),keystroke:"Shift+Enter"}]})}}const Um='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M4 0v1H1v3H0V.5A.5.5 0 0 1 .5 0zm8 0h3.5a.5.5 0 0 1 .5.5V4h-1V1h-3zM4 16H.5a.5.5 0 0 1-.5-.5V12h1v3h3zm8 0v-1h3v-3h1v3.5a.5.5 0 0 1-.5.5z"/><path fill-opacity=".256" d="M1 1h14v14H1z"/><g class="ck-icon__selected-indicator"><path d="M7 0h2v1H7zM0 7h1v2H0zm15 0h1v2h-1zm-8 8h2v1H7z"/><path fill-opacity=".254" d="M1 1h14v14H1z"/></g></svg>';class Hm extends(O()){_stack=[];add(e,t){const i=this._stack,n=i[0];this._insertDescriptor(e);const o=i[0];n===o||Wm(n,o)||this.fire("change:top",{oldDescriptor:n,newDescriptor:o,writer:t})}remove(e,t){const i=this._stack,n=i[0];this._removeDescriptor(e);const o=i[0];n===o||Wm(n,o)||this.fire("change:top",{oldDescriptor:n,newDescriptor:o,writer:t})}_insertDescriptor(e){const t=this._stack,i=t.findIndex(t=>t.id===e.id);if(Wm(e,t[i]))return;i>-1&&t.splice(i,1);let n=0;for(;t[n]&&$m(t[n],e);)n++;t.splice(n,0,e)}_removeDescriptor(e){const t=this._stack,i=t.findIndex(t=>t.id===e);i>-1&&t.splice(i,1)}}function Wm(e,t){return e&&t&&e.priority==t.priority&&qm(e.classes)==qm(t.classes)}function $m(e,t){return e.priority>t.priority||!(e.priority<t.priority)&&qm(e.classes)>qm(t.classes)}function qm(e){return Array.isArray(e)?e.sort().join(","):e}const Km="ck-widget_selected";function Gm(e){return!!e.is("element")&&!!e.getCustomProperty("widget")}function Ym(e,t,i={}){if(!e.is("containerElement"))throw new A("widget-to-widget-wrong-element-type",null,{element:e});return t.setAttribute("contenteditable","false",e),t.addClass("ck-widget",e),t.setCustomProperty("widget",!0,e),e.getFillerOffset=tg,t.setCustomProperty("widgetLabel",[],e),i.label&&function(e,t){const i=e.getCustomProperty("widgetLabel");i.push(t)}(e,i.label),i.hasSelectionHandle&&function(e,t){const i=t.createUIElement("div",{class:"ck ck-widget__selection-handle"},function(e){const t=this.toDomElement(e),i=new wn;return i.set("content",Um),i.render(),t.appendChild(i.element),t});t.insert(t.createPositionAt(e,0),i),t.addClass(["ck-widget_with-selection-handle"],e)}(e,t),Zm(e,t),e}function Jm(e,t,i){if(t.classes&&i.addClass(Dt(t.classes),e),t.attributes)for(const n in t.attributes)i.setAttribute(n,t.attributes[n],e)}function Qm(e,t,i){if(t.classes&&i.removeClass(Dt(t.classes),e),t.attributes)for(const n in t.attributes)i.removeAttribute(n,e)}function Zm(e,t,i=Jm,n=Qm){const o=new Hm;o.on("change:top",(t,o)=>{o.oldDescriptor&&n(e,o.oldDescriptor,o.writer),o.newDescriptor&&i(e,o.newDescriptor,o.writer)});t.setCustomProperty("addHighlight",(e,t,i)=>o.add(t,i),e),t.setCustomProperty("removeHighlight",(e,t,i)=>o.remove(t,i),e)}function Xm(e,t,i={}){return t.addClass(["ck-editor__editable","ck-editor__nested-editable"],e),!1!==i.withAriaRole&&t.setAttribute("role","textbox",e),e.isReadOnly||t.setAttribute("tabindex","-1",e),i.label&&t.setAttribute("aria-label",i.label,e),t.setAttribute("contenteditable",e.isReadOnly?"false":"true",e),e.on("change:isReadOnly",(i,n,o)=>{t.setAttribute("contenteditable",o?"false":"true",e),o?t.removeAttribute("tabindex",e):t.setAttribute("tabindex","-1",e)}),e.on("change:isFocused",(i,n,o)=>{o?t.addClass("ck-editor__nested-editable_focused",e):t.removeClass("ck-editor__nested-editable_focused",e)}),Zm(e,t),e}function eg(e,t){const i=e.getSelectedElement();if(i){const n=rg(e);if(n)return t.createRange(t.createPositionAt(i,n))}return t.schema.findOptimalInsertionRange(e)}function tg(){return null}function ig(e){const t=e=>{const{width:t,paddingLeft:i,paddingRight:n}=e.ownerDocument.defaultView.getComputedStyle(e);return parseFloat(t)-(parseFloat(i)||0)-(parseFloat(n)||0)},i=e.parentElement;if(!i)return 0;let n=t(i);let o=0,r=i;for(;isNaN(n);){if(r=r.parentElement,++o>5)return 0;n=t(r)}return n}const ng="widget-type-around";function og(e,t,i){return!!e&&Gm(e)&&!i.isInline(t)}function rg(e){return e.getAttribute(ng)}var sg=i(6779),ag={attributes:{"data-cke":!0}};ag.setAttributes=Ki(),ag.insert=$i().bind(null,"head"),ag.domAPI=Hi(),ag.insertStyleElement=Yi();ji()(sg.A,ag);sg.A&&sg.A.locals&&sg.A.locals;const lg=["before","after"],cg=(new DOMParser).parseFromString('<svg viewBox="0 0 10 8" xmlns="http://www.w3.org/2000/svg"><path d="M9.055.263v3.972h-6.77M1 4.216l2-2.038m-2 2 2 2.038"/></svg>',"image/svg+xml").firstChild,dg="ck-widget__type-around_disabled";class ug extends Qu{_currentFakeCaretModelElement=null;static get pluginName(){return"WidgetTypeAround"}static get isOfficialPlugin(){return!0}static get requires(){return[Dm,um]}init(){const e=this.editor,t=e.editing.view;this.on("change:isEnabled",(i,n,o)=>{t.change(e=>{for(const i of t.document.roots)o?e.removeClass(dg,i):e.addClass(dg,i)}),o||e.model.change(e=>{e.removeSelectionAttribute(ng)})}),this._enableTypeAroundUIInjection(),this._enableInsertingParagraphsOnButtonClick(),this._enableInsertingParagraphsOnEnterKeypress(),this._enableInsertingParagraphsOnTypingKeystroke(),this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows(),this._enableDeleteIntegration(),this._enableInsertContentIntegration(),this._enableInsertObjectIntegration(),this._enableDeleteContentIntegration()}destroy(){super.destroy(),this._currentFakeCaretModelElement=null}_insertParagraph(e,t){const i=this.editor,n=i.editing.view,o=i.model.schema.getAttributesWithProperty(e,"copyOnReplace",!0);i.execute("insertParagraph",{position:i.model.createPositionAt(e,t),attributes:o}),n.focus(),n.scrollToTheSelection()}_listenToIfEnabled(e,t,i,n){this.listenTo(e,t,(...e)=>{this.isEnabled&&i(...e)},n)}_insertParagraphAccordingToFakeCaretPosition(){const e=this.editor.model.document.selection,t=rg(e);if(!t)return!1;const i=e.getSelectedElement();return this._insertParagraph(i,t),!0}_enableTypeAroundUIInjection(){const e=this.editor,t=e.model.schema,i=e.locale.t,n={before:i("Insert paragraph before block"),after:i("Insert paragraph after block")};e.editing.downcastDispatcher.on("insert",(e,o,r)=>{const s=r.mapper.toViewElement(o.item);if(s&&og(s,o.item,t)){!function(e,t,i){const n=e.createUIElement("div",{class:"ck ck-reset_all ck-widget__type-around"},function(e){const i=this.toDomElement(e);return function(e,t){for(const i of lg){const n=new bi({tag:"div",attributes:{class:["ck","ck-widget__type-around__button",`ck-widget__type-around__button_${i}`],title:t[i],"aria-hidden":"true"},children:[e.ownerDocument.importNode(cg,!0)]});e.appendChild(n.render())}}(i,t),function(e){const t=new bi({tag:"div",attributes:{class:["ck","ck-widget__type-around__fake-caret"]}});e.appendChild(t.render())}(i),i});e.insert(e.createPositionAt(i,"end"),n)}(r.writer,n,s);s.getCustomProperty("widgetLabel").push(()=>this.isEnabled?i("Press Enter to type after or press Shift + Enter to type before the widget"):"")}},{priority:"low"})}_enableTypeAroundFakeCaretActivationUsingKeyboardArrows(){const e=this.editor,t=e.model,i=t.document.selection,n=t.schema,o=e.editing.view;function r(e){return`ck-widget_type-around_show-fake-caret_${e}`}this._listenToIfEnabled(o.document,"arrowKey",(e,t)=>{this._handleArrowKeyPress(e,t)},{context:[Gm,"$text"],priority:"high"}),this._listenToIfEnabled(i,"change:range",(t,i)=>{i.directChange&&e.model.change(e=>{e.removeSelectionAttribute(ng)})}),this._listenToIfEnabled(t.document,"change:data",()=>{const t=i.getSelectedElement();if(t){if(og(e.editing.mapper.toViewElement(t),t,n))return}e.model.change(e=>{e.removeSelectionAttribute(ng)})}),this._listenToIfEnabled(e.editing.downcastDispatcher,"selection",(e,t,i)=>{const o=i.writer;if(this._currentFakeCaretModelElement){const e=i.mapper.toViewElement(this._currentFakeCaretModelElement);e&&(o.removeClass(lg.map(r),e),this._currentFakeCaretModelElement=null)}const s=t.selection.getSelectedElement();if(!s)return;const a=i.mapper.toViewElement(s);if(!og(a,s,n))return;const l=rg(t.selection);l&&(o.addClass(r(l),a),this._currentFakeCaretModelElement=s)}),this._listenToIfEnabled(e.ui.focusTracker,"change:isFocused",(t,i,n)=>{n||e.model.change(e=>{e.removeSelectionAttribute(ng)})})}_handleArrowKeyPress(e,t){const i=this.editor,n=i.model,o=n.document.selection,r=n.schema,s=i.editing.view;if(t.shiftKey)return;const a=function(e,t){const i=Vt(e,t);return"down"===i||"right"===i}(t.keyCode,i.locale.contentLanguageDirection),l=s.document.selection.getSelectedElement();let c;og(l,i.editing.mapper.toModelElement(l),r)?c=this._handleArrowKeyPressOnSelectedWidget(a):o.isCollapsed?c=this._handleArrowKeyPressWhenSelectionNextToAWidget(a):t.shiftKey||(c=this._handleArrowKeyPressWhenNonCollapsedSelection(a)),c&&(t.preventDefault(),e.stop())}_handleArrowKeyPressOnSelectedWidget(e){const t=this.editor.model,i=rg(t.document.selection);return t.change(t=>{if(!i)return t.setSelectionAttribute(ng,e?"after":"before"),!0;if(!(i===(e?"after":"before")))return t.removeSelectionAttribute(ng),!0;return!1})}_handleArrowKeyPressWhenSelectionNextToAWidget(e){const t=this.editor,i=t.model,n=i.schema,o=t.plugins.get("Widget"),r=o._getObjectElementNextToSelection(e);return!!og(t.editing.mapper.toViewElement(r),r,n)&&(i.change(t=>{o._setSelectionOverElement(r),t.setSelectionAttribute(ng,e?"before":"after")}),!0)}_handleArrowKeyPressWhenNonCollapsedSelection(e){const t=this.editor,i=t.model,n=i.schema,o=t.editing.mapper,r=i.document.selection,s=e?r.getLastPosition().nodeBefore:r.getFirstPosition().nodeAfter;return!!og(o.toViewElement(s),s,n)&&(i.change(t=>{t.setSelection(s,"on"),t.setSelectionAttribute(ng,e?"after":"before")}),!0)}_enableInsertingParagraphsOnButtonClick(){const e=this.editor,t=e.editing.view;this._listenToIfEnabled(t.document,"mousedown",(i,n)=>{const o=n.domTarget.closest(".ck-widget__type-around__button");if(!o)return;const r=function(e){return e.classList.contains("ck-widget__type-around__button_before")?"before":"after"}(o),s=function(e,t){const i=e.closest(".ck-widget");return t.mapDomToView(i)}(o,t.domConverter),a=e.editing.mapper.toModelElement(s);this._insertParagraph(a,r),n.preventDefault(),i.stop()})}_enableInsertingParagraphsOnEnterKeypress(){const e=this.editor,t=e.model.document.selection,i=e.editing.view;this._listenToIfEnabled(i.document,"enter",(i,n)=>{if("atTarget"!=i.eventPhase)return;const o=t.getSelectedElement(),r=e.editing.mapper.toViewElement(o),s=e.model.schema;let a;this._insertParagraphAccordingToFakeCaretPosition()?a=!0:og(r,o,s)&&(this._insertParagraph(o,n.isSoft?"before":"after"),a=!0),a&&(n.preventDefault(),i.stop())},{context:Gm})}_enableInsertingParagraphsOnTypingKeystroke(){const e=this.editor.editing.view.document;this._listenToIfEnabled(e,"insertText",(t,i)=>{this._insertParagraphAccordingToFakeCaretPosition()&&(i.selection=e.selection)},{priority:"high"}),r.isAndroid?this._listenToIfEnabled(e,"keydown",(e,t)=>{229==t.keyCode&&this._insertParagraphAccordingToFakeCaretPosition()}):this._listenToIfEnabled(e,"compositionstart",()=>{this._insertParagraphAccordingToFakeCaretPosition()},{priority:"highest"})}_enableDeleteIntegration(){const e=this.editor,t=e.editing.view,i=e.model,n=i.schema;this._listenToIfEnabled(t.document,"delete",(t,o)=>{if("atTarget"!=t.eventPhase)return;const r=rg(i.document.selection);if(!r)return;const s=o.direction,a=i.document.selection.getSelectedElement(),l="forward"==s;if("before"===r===l)e.execute("delete",{selection:i.createSelection(a,"on")});else{const t=n.getNearestSelectionRange(i.createPositionAt(a,r),s);if(t)if(t.isCollapsed){const o=i.createSelection(t.start);if(i.modifySelection(o,{direction:s}),o.focus.isEqual(t.start)){const e=function(e,t){let i=t;for(const n of t.getAncestors({parentFirst:!0})){if(n.childCount>1||e.isLimit(n))break;i=n}return i}(n,t.start.parent);i.deleteContent(i.createSelection(e,"on"),{doNotAutoparagraph:!0})}else i.change(i=>{i.setSelection(t),e.execute(l?"deleteForward":"delete")})}else i.change(i=>{i.setSelection(t),e.execute(l?"deleteForward":"delete")})}o.preventDefault(),t.stop()},{context:Gm})}_enableInsertContentIntegration(){const e=this.editor,t=this.editor.model,i=t.document.selection;this._listenToIfEnabled(e.model,"insertContent",(e,[n,o])=>{if(o&&!o.is("documentSelection"))return;const r=rg(i);return r?(e.stop(),t.change(e=>{const o=i.getSelectedElement(),s=t.createPositionAt(o,r),a=e.createSelection(s),l=t.insertContent(n,a);return e.setSelection(a),l})):void 0},{priority:"high"})}_enableInsertObjectIntegration(){const e=this.editor,t=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"insertObject",(e,i)=>{const[,n,o={}]=i;if(n&&!n.is("documentSelection"))return;const r=rg(t);r&&(o.findOptimalPosition=r,i[3]=o)},{priority:"high"})}_enableDeleteContentIntegration(){const e=this.editor,t=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"deleteContent",(e,[i])=>{if(i&&!i.is("documentSelection"))return;rg(t)&&e.stop()},{priority:"high"})}}function hg(e){const t=e.model;return(i,n)=>{const o=n.keyCode==Pt.arrowup,r=n.keyCode==Pt.arrowdown,s=n.shiftKey,a=t.document.selection;if(!o&&!r)return;const l=r,c=function(e,t,i){const n=e.model;if(i){const e=t.focus,i=mg(n,e,"forward");if(!i)return;const o=n.createRange(e,i),r=gg(n.schema,o,"backward");if(r)return n.createRange(e,r)}else{const e=t.focus,i=mg(n,e,"backward");if(!i)return;const o=n.createRange(i,e),r=gg(n.schema,o,"forward");if(r)return n.createRange(r,e)}}(e,a,l);if(c){if(c.isCollapsed){if(a.isCollapsed)return;if(s)return}(c.isCollapsed||function(e,t,i){const n=e.model,o=e.view.domConverter;if(i){const e=n.createSelection(t.start);n.modifySelection(e),e.focus.isAtEnd||t.start.isEqual(e.focus)||(t=n.createRange(e.focus,t.end))}const r=e.mapper.toViewRange(t),s=o.viewRangeToDom(r),a=Ze.getDomRangeRects(s);let l;for(const e of a)if(void 0!==l){if(Math.round(e.top)>=l)return!1;l=Math.max(l,Math.round(e.bottom))}else l=Math.round(e.bottom);return!0}(e,c,l))&&(t.change(e=>{const i=l?c.end:c.start;if(s){const n=t.createSelection(a.anchor);n.setFocus(i),e.setSelection(n)}else e.setSelection(i)}),i.stop(),n.preventDefault(),n.stopPropagation())}}}function mg(e,t,i){const n=e.schema,o=e.createRangeIn(t.root),r="forward"==i?"elementStart":"elementEnd";for(const{previousPosition:e,item:s,type:a}of o.getWalker({startPosition:t,direction:i})){if(n.isLimit(s)&&!n.isInline(s))return e;if(a==r&&n.isBlock(s))return null}return null}function gg(e,t,i){const n="backward"==i?t.end:t.start;if(e.checkChild(n,"$text"))return n;for(const{nextPosition:n}of t.getWalker({direction:i}))if(e.checkChild(n,"$text"))return n}var fg=i(1216),pg={attributes:{"data-cke":!0}};pg.setAttributes=Ki(),pg.insert=$i().bind(null,"head"),pg.domAPI=Hi(),pg.insertStyleElement=Yi();ji()(fg.A,pg);fg.A&&fg.A.locals&&fg.A.locals;class bg extends Qu{_previouslySelected=new Set;static get pluginName(){return"Widget"}static get isOfficialPlugin(){return!0}static get requires(){return[ug,um]}init(){const e=this.editor,t=e.editing.view,i=t.document,n=e.t;this.editor.editing.downcastDispatcher.on("selection",(t,i,n)=>{const o=n.writer,r=i.selection;if(r.isCollapsed)return;const s=r.getSelectedElement();if(!s)return;const a=e.editing.mapper.toViewElement(s);var l;Gm(a)&&(n.consumable.consume(r,"selection")&&o.setSelection(o.createRangeOn(a),{fake:!0,label:(l=a,l.getCustomProperty("widgetLabel").reduce((e,t)=>"function"==typeof t?e?e+". "+t():t():e?e+". "+t:t,""))}))}),this.editor.editing.downcastDispatcher.on("selection",(e,t,i)=>{this._clearPreviouslySelectedWidgets(i.writer);const n=i.writer,o=n.document.selection;let r=null;for(const e of o.getRanges())for(const t of e){const e=t.item;Gm(e)&&!kg(e,r)&&(n.addClass(Km,e),this._previouslySelected.add(e),r=e)}},{priority:"low"}),t.addObserver(fd),t.addObserver(bd),this.listenTo(i,"mousedown",(...e)=>this._onMousedown(...e)),this.listenTo(i,"pointerdown",(...e)=>this._onPointerdown(...e)),this.listenTo(i,"arrowKey",(...e)=>{this._handleSelectionChangeOnArrowKeyPress(...e)},{context:[Gm,"$text"]}),this.listenTo(i,"arrowKey",(...e)=>{this._preventDefaultOnArrowKeyPress(...e)},{context:"$root"}),this.listenTo(i,"arrowKey",hg(this.editor.editing),{context:"$text"}),this.listenTo(i,"delete",(e,t)=>{this._handleDelete("forward"==t.direction)&&(t.preventDefault(),e.stop())},{context:"$root"}),this.listenTo(i,"tab",(e,i)=>{this._selectNextEditable(i.shiftKey?"backward":"forward")&&(t.scrollToTheSelection(),i.preventDefault(),e.stop())},{context:e=>Gm(e)||e.is("editableElement"),priority:"low"}),this.listenTo(i,"keydown",(e,t)=>{t.keystroke==Pt.esc&&this._selectAncestorWidget()&&(t.preventDefault(),e.stop())},{context:e=>e.is("editableElement"),priority:"low"}),e.accessibility.addKeystrokeInfoGroup({id:"widget",label:n("Keystrokes that can be used when a widget is selected (for example: image, table, etc.)"),keystrokes:[{label:n("Move focus from an editable area back to the parent widget"),keystroke:"Esc"},{label:n("Insert a new paragraph directly after a widget"),keystroke:"Enter"},{label:n("Insert a new paragraph directly before a widget"),keystroke:"Shift+Enter"},{label:n("Move the caret to allow typing directly before a widget"),keystroke:[["arrowup"],["arrowleft"]]},{label:n("Move the caret to allow typing directly after a widget"),keystroke:[["arrowdown"],["arrowright"]]}]})}_onMousedown(e,t){const i=t.target;i&&t.domEvent.detail>=3&&this._selectBlockContent(i)&&t.preventDefault()}_onPointerdown(e,t){if(!t.domEvent.isPrimary)return;const i=this.editor,n=i.editing.view,o=n.document;let s=t.target;if(!s)return;if(!Gm(s)){const e=function(e){let t=e;for(;t;){if(t.is("editableElement")||Gm(t))return t;t=t.parent}return null}(s);if(!e)return;if(Gm(e))s=e;else{const e=function(e,t){const i=qe(t.domEvent);let n=null;n=i?e.domConverter.domRangeToView(i):e.createRange(e.createPositionAt(t.target,0));if(!n)return null;const o=n.start;if(!o.parent)return null;let r=o.parent;o.parent.is("editableElement")&&(o.isAtEnd&&o.nodeBefore?r=o.nodeBefore:o.isAtStart&&o.nodeAfter&&(r=o.nodeAfter));if(r.is("$text"))return r.parent;return r}(n,t);if(!e||!Gm(e))return;s=e}}(r.isAndroid||r.isiOS)&&t.preventDefault(),o.isFocused||n.focus();const a=i.editing.mapper.toModelElement(s);this._setSelectionOverElement(a)}_selectBlockContent(e){const t=this.editor,i=t.model,n=t.editing.mapper,o=i.schema,r=n.findMappedViewAncestor(this.editor.editing.view.createPositionAt(e,0)),s=function(e,t){for(const i of e.getAncestors({includeSelf:!0,parentFirst:!0})){if(t.checkChild(i,"$text"))return i;if(t.isLimit(i)&&!t.isObject(i))break}return null}(n.toModelElement(r),i.schema);return!!s&&(i.change(e=>{const t=o.isLimit(s)?null:function(e,t){const i=new ha({startPosition:e});for(const{item:e}of i){if(t.isLimit(e)||!e.is("element"))return null;if(t.checkChild(e,"$text"))return e}return null}(e.createPositionAfter(s),o),i=e.createPositionAt(s,0),n=t?e.createPositionAt(t,0):e.createPositionAt(s,"end");e.setSelection(e.createRange(i,n))}),!0)}_handleSelectionChangeOnArrowKeyPress(e,t){const i=t.keyCode,n=this.editor.model,o=n.schema,r=n.document.selection,s=r.getSelectedElement(),a=Vt(i,this.editor.locale.contentLanguageDirection),l="down"==a||"right"==a,c="up"==a||"down"==a;if(!t.shiftKey&&!r.isCollapsed){if(function(e,t){const i=e.getFirstPosition(),n=e.getLastPosition(),o=i.nodeAfter,r=n.nodeBefore;return!!o&&t.isObject(o)||!!r&&t.isObject(r)}(r,o)){const i=l?r.getLastPosition():r.getFirstPosition(),s=o.getNearestSelectionRange(i,l?"forward":"backward");s&&(n.change(e=>{e.setSelection(s)}),t.preventDefault(),e.stop())}return}const d=function(e,t){const i=e.document.selection,n=i.getSelectedElement(),o=rg(i);if(n&&"before"==o)return e.createSelection(n,"before");if(n&&"after"==o)return e.createSelection(n,"after");return e.createSelection(i.getRanges(),{backward:n&&e.schema.isObject(n)?!t:i.isBackward})}(n,l),u=n.createSelection(d);if(n.modifySelection(u,{direction:l?"forward":"backward"}),u.isEqual(d))return;u.focus.isTouching(d.focus)&&n.modifySelection(u,{direction:l?"forward":"backward"});const h=l?d.focus.nodeBefore:d.focus.nodeAfter,m=u.focus.nodeBefore,g=u.focus.nodeAfter,f=l?m:g;if(t.shiftKey)(s&&o.isObject(s)||f&&o.isObject(f)||h&&o.isObject(h))&&(n.change(e=>{e.setSelection(u)}),t.preventDefault(),e.stop());else if(f&&o.isObject(f)){if(o.isInline(f)&&c)return;n.change(e=>{e.setSelection(f,"on")}),t.preventDefault(),e.stop()}}_preventDefaultOnArrowKeyPress(e,t){const i=this.editor.model,n=i.schema,o=i.document.selection.getSelectedElement();o&&n.isObject(o)&&(t.preventDefault(),e.stop())}_handleDelete(e){const t=this.editor.model.document.selection;if(!this.editor.model.canEditAt(t))return;if(!t.isCollapsed)return;const i=this._getObjectElementNextToSelection(e);return i?(this.editor.model.change(e=>{let n=t.anchor.parent;for(;n.isEmpty;){const t=n;n=t.parent,e.remove(t)}this._setSelectionOverElement(i)}),!0):void 0}_setSelectionOverElement(e){this.editor.model.change(t=>{t.setSelection(t.createRangeOn(e))})}_getObjectElementNextToSelection(e){const t=this.editor.model,i=t.schema,n=t.document.selection,o=t.createSelection(n);if(t.modifySelection(o,{direction:e?"forward":"backward"}),o.isEqual(n))return null;const r=e?o.focus.nodeBefore:o.focus.nodeAfter;return r&&i.isObject(r)?r:null}_clearPreviouslySelectedWidgets(e){for(const t of this._previouslySelected)e.removeClass(Km,t);this._previouslySelected.clear()}_selectNextEditable(e){const t=this.editor.editing,i=t.view,n=this.editor.model,o=i.document.selection,r=n.document.selection;let s;if(r.rangeCount>1){const i=r.isBackward?r.getFirstRange():r.getLastRange();s=t.mapper.toViewPosition("forward"==e?i.end:i.start)}else s="forward"==e?o.getFirstPosition():o.getLastPosition();const a=this._findNextFocusRange(s,e);return!!a&&(n.change(e=>{e.setSelection(a)}),!0)}_findNextFocusRange(e,t){const i=this.editor.editing,n=i.view,o=this.editor.model,r=n.document.selection,s=r.editableElement,a=s.getPath();let l=r.getSelectedElement();l&&!Gm(l)&&(l=null);const c="forward"==t?n.createRange(e,n.createPositionAt(e.root,"end")):n.createRange(n.createPositionAt(e.root,0),e);for(const{nextPosition:e}of c.getWalker({direction:t})){const n=e.parent;if(Gm(n)&&n!=l){const e=i.mapper.toModelElement(n);if(!o.schema.isBlock(e))continue;if("extension"!=te(a,n.getPath()))return o.createRangeOn(e)}else if(n.is("editableElement")){if(n==s&&!l)continue;const r=i.mapper.toModelPosition(e),c=o.schema.getNearestSelectionRange(r,t);if(!c)continue;return n==s&&l?c:"extension"!=te(a,n.getPath())?o.createRangeIn(o.schema.getLimitElement(c)):c}}return null}_selectAncestorWidget(){const e=this.editor,t=e.editing.mapper,i=e.editing.view.document.selection.getFirstPosition().parent,n=(i.is("$text")?i.parent:i).findAncestor(Gm);if(!n)return!1;const o=t.toModelElement(n);return!!o&&(e.model.change(e=>{e.setSelection(o,"on")}),!0)}}function kg(e,t){return!!t&&Array.from(e.getAncestors()).includes(t)}const wg='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M11.463 5.187a.888.888 0 1 1 1.254 1.255L9.16 10l3.557 3.557a.888.888 0 1 1-1.254 1.255L7.26 10.61a.888.888 0 0 1 .16-1.382l4.043-4.042z"/></svg>',_g='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M8.537 14.813a.888.888 0 1 1-1.254-1.255L10.84 10 7.283 6.442a.888.888 0 1 1 1.254-1.255L12.74 9.39a.888.888 0 0 1-.16 1.382z"/></svg>';var vg=i(9938),yg={attributes:{"data-cke":!0}};yg.setAttributes=Ki(),yg.insert=$i().bind(null,"head"),yg.domAPI=Hi(),yg.insertStyleElement=Yi();ji()(vg.A,yg);vg.A&&vg.A.locals&&vg.A.locals;var Ag=i(3579),xg={attributes:{"data-cke":!0}};xg.setAttributes=Ki(),xg.insert=$i().bind(null,"head"),xg.domAPI=Hi(),xg.insertStyleElement=Yi();ji()(Ag.A,xg);Ag.A&&Ag.A.locals&&Ag.A.locals;const Cg=st("px");class Tg extends Qu{positionLimiter;visibleStack;_viewToStack=new Map;_idToStack=new Map;_view=null;_rotatorView=null;_fakePanelsView=null;static get pluginName(){return"ContextualBalloon"}static get isOfficialPlugin(){return!0}constructor(e){super(e),this.positionLimiter=()=>{const e=this.editor.editing.view,t=e.document.selection.editableElement;return t?e.domConverter.mapViewToDom(t.root):null},this.decorate("getPositionOptions"),this.set("visibleView",null),this.set("_numberOfStacks",0),this.set("_singleViewMode",!1)}destroy(){super.destroy(),this._view&&this._view.destroy(),this._rotatorView&&this._rotatorView.destroy(),this._fakePanelsView&&this._fakePanelsView.destroy()}get view(){return this._view||this._createPanelView(),this._view}hasView(e){return Array.from(this._viewToStack.keys()).includes(e)}add(e){if(this._view||this._createPanelView(),this.hasView(e.view))throw new A("contextualballoon-add-view-exist",[this,e]);const t=e.stackId||"main";if(!this._idToStack.has(t))return this._idToStack.set(t,new Map([[e.view,e]])),this._viewToStack.set(e.view,this._idToStack.get(t)),this._numberOfStacks=this._idToStack.size,void(this._visibleStack&&!e.singleViewMode||this.showStack(t));const i=this._idToStack.get(t);e.singleViewMode&&this.showStack(t),i.set(e.view,e),this._viewToStack.set(e.view,i),i===this._visibleStack&&this._showView(e)}remove(e){if(!this.hasView(e))throw new A("contextualballoon-remove-view-not-exist",[this,e]);const t=this._viewToStack.get(e);this._singleViewMode&&this.visibleView===e&&(this._singleViewMode=!1),this.visibleView===e&&(1===t.size?this._idToStack.size>1?this._showNextStack():(this.view.hide(),this.visibleView=null,this._rotatorView.hideView()):this._showView(Array.from(t.values())[t.size-2])),1===t.size?(this._idToStack.delete(this._getStackId(t)),this._numberOfStacks=this._idToStack.size):t.delete(e),this._viewToStack.delete(e)}updatePosition(e){e&&(this._visibleStack.get(this.visibleView).position=e),this.view.pin(this.getPositionOptions()),this._fakePanelsView.updatePosition()}getPositionOptions(){let e=Array.from(this._visibleStack.values()).pop().position;return e&&(e.limiter||(e=Object.assign({},e,{limiter:this.positionLimiter})),e=Object.assign({},e,{viewportOffsetConfig:{...this.editor.ui.viewportOffset,top:this.editor.ui.viewportOffset.visualTop}})),e}showStack(e){this.visibleStack=e;const t=this._idToStack.get(e);if(!t)throw new A("contextualballoon-showstack-stack-not-exist",this);this._visibleStack!==t&&this._showView(Array.from(t.values()).pop())}_createPanelView(){this._view=new on(this.editor.locale),this.editor.ui.view.body.add(this._view),this._rotatorView=this._createRotatorView(),this._fakePanelsView=this._createFakePanelsView()}get _visibleStack(){return this._viewToStack.get(this.visibleView)}_getStackId(e){return Array.from(this._idToStack.entries()).find(t=>t[1]===e)[0]}_showNextStack(){const e=Array.from(this._idToStack.values());let t=e.indexOf(this._visibleStack)+1;e[t]||(t=0),this.showStack(this._getStackId(e[t]))}_showPrevStack(){const e=Array.from(this._idToStack.values());let t=e.indexOf(this._visibleStack)-1;e[t]||(t=e.length-1),this.showStack(this._getStackId(e[t]))}_createRotatorView(){const e=new Eg(this.editor.locale),t=this.editor.locale.t;return this.view.content.add(e),e.bind("isNavigationVisible").to(this,"_numberOfStacks",this,"_singleViewMode",(e,t)=>!t&&e>1),e.on("change:isNavigationVisible",()=>this.updatePosition(),{priority:"low"}),e.bind("counter").to(this,"visibleView",this,"_numberOfStacks",(e,i)=>{if(i<2)return"";const n=Array.from(this._idToStack.values()).indexOf(this._visibleStack)+1;return t("%0 of %1",[n,i])}),e.buttonNextView.on("execute",()=>{e.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showNextStack()}),e.buttonPrevView.on("execute",()=>{e.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showPrevStack()}),e}_createFakePanelsView(){const e=new Ig(this.editor.locale,this.view);return e.bind("numberOfPanels").to(this,"_numberOfStacks",this,"_singleViewMode",(e,t)=>!t&&e>=2?Math.min(e-1,2):0),e.listenTo(this.view,"change:top",()=>e.updatePosition()),e.listenTo(this.view,"change:left",()=>e.updatePosition()),this.editor.ui.view.body.add(e),e}_showView({view:e,balloonClassName:t="",withArrow:i=!0,singleViewMode:n=!1}){this.view.class=t,this.view.withArrow=i,this._rotatorView.showView(e),this.visibleView=e,this.view.pin(this.getPositionOptions()),this._fakePanelsView.updatePosition(),n&&(this._singleViewMode=!0)}}class Eg extends Zi{focusTracker;buttonPrevView;buttonNextView;content;constructor(e){super(e);const t=e.t,i=this.bindTemplate;this.set("isNavigationVisible",!0),this.focusTracker=new Qt,this.buttonPrevView=this._createButtonView(t("Previous"),wg),this.buttonNextView=this._createButtonView(t("Next"),_g),this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-rotator"],"z-index":"-1"},children:[{tag:"div",attributes:{class:["ck-balloon-rotator__navigation",i.to("isNavigationVisible",e=>e?"":"ck-hidden")]},children:[this.buttonPrevView,{tag:"span",attributes:{class:["ck-balloon-rotator__counter"]},children:[{text:i.to("counter")}]},this.buttonNextView]},{tag:"div",attributes:{class:"ck-balloon-rotator__content"},children:this.content}]})}render(){super.render(),this.focusTracker.add(this.element)}destroy(){super.destroy(),this.focusTracker.destroy()}showView(e){this.hideView(),this.content.add(e)}hideView(){this.content.clear()}_createButtonView(e,t){const i=new lo(this.locale);return i.set({label:e,icon:t,tooltip:!0}),i}}class Ig extends Zi{content;_balloonPanelView;constructor(e,t){super(e);const i=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("height",0),this.set("width",0),this.set("numberOfPanels",0),this.content=this.createCollection(),this._balloonPanelView=t,this.setTemplate({tag:"div",attributes:{class:["ck-fake-panel",i.to("numberOfPanels",e=>e?"":"ck-hidden")],style:{top:i.to("top",Cg),left:i.to("left",Cg),width:i.to("width",Cg),height:i.to("height",Cg)}},children:this.content}),this.on("change:numberOfPanels",(e,t,i,n)=>{i>n?this._addPanels(i-n):this._removePanels(n-i),this.updatePosition()})}_addPanels(e){for(;e--;){const e=new Zi;e.setTemplate({tag:"div"}),this.content.add(e),this.registerChild(e)}}_removePanels(e){for(;e--;){const e=this.content.last;this.content.remove(e),this.deregisterChild(e),e.destroy()}}updatePosition(){if(this.numberOfPanels){const{top:e,left:t}=this._balloonPanelView,{width:i,height:n}=new Ze(this._balloonPanelView.element);Object.assign(this,{top:e,left:t,width:i,height:n})}}}class Sg extends Qu{_toolbarDefinitions=new Map;_balloon;static get requires(){return[Tg]}static get pluginName(){return"WidgetToolbarRepository"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(e.plugins.has("BalloonToolbar")){const t=e.plugins.get("BalloonToolbar");this.listenTo(t,"show",t=>{(function(e){const t=e.getSelectedElement();return!(!t||!Gm(t))})(e.editing.view.document.selection)&&t.stop()},{priority:"high"})}this._balloon=this.editor.plugins.get("ContextualBalloon"),this.on("change:isEnabled",()=>{this._updateToolbarsVisibility()}),this.listenTo(e.ui,"update",()=>{this._updateToolbarsVisibility()}),this.listenTo(e.ui.focusTracker,"change:isFocused",()=>{this._updateToolbarsVisibility()},{priority:"low"})}destroy(){super.destroy();for(const e of this._toolbarDefinitions.values())e.view.destroy()}register(e,{ariaLabel:t,items:i,getRelatedElement:n,balloonClassName:o="ck-toolbar-container",positions:r}){if(!i.length)return void x("widget-toolbar-no-items",{toolbarId:e});const s=this.editor,a=s.t,l=new wu(s.locale);if(l.ariaLabel=t||a("Widget toolbar"),this._toolbarDefinitions.has(e))throw new A("widget-toolbar-duplicated",this,{toolbarId:e});const c={view:l,getRelatedElement:n,balloonClassName:o,itemsConfig:i,positions:r,initialized:!1};s.ui.addToolbar(l,{isContextual:!0,beforeFocus:()=>{const e=n(s.editing.view.document.selection);e&&this._showToolbar(c,e)},afterBlur:()=>{this._hideToolbar(c)}}),this._toolbarDefinitions.set(e,c)}_updateToolbarsVisibility(){let e=0,t=null,i=null;for(const n of this._toolbarDefinitions.values()){const o=n.getRelatedElement(this.editor.editing.view.document.selection);if(this.isEnabled&&o)if(this.editor.ui.focusTracker.isFocused){const r=o.getAncestors().length;r>e&&(e=r,t=o,i=n)}else this._isToolbarVisible(n)&&this._hideToolbar(n);else this._isToolbarInBalloon(n)&&this._hideToolbar(n)}i&&this._showToolbar(i,t)}_hideToolbar(e){this._balloon.remove(e.view),this.stopListening(this._balloon,"change:visibleView")}_showToolbar(e,t){this._isToolbarVisible(e)?Pg(this.editor,t,e.positions):this._isToolbarInBalloon(e)||(e.initialized||(e.initialized=!0,e.view.fillFromConfig(e.itemsConfig,this.editor.ui.componentFactory)),this._balloon.add({view:e.view,position:Mg(this.editor,t,e.positions),balloonClassName:e.balloonClassName}),this.listenTo(this._balloon,"change:visibleView",()=>{for(const t of this._toolbarDefinitions.values())if(this._isToolbarVisible(t)){const i=t.getRelatedElement(this.editor.editing.view.document.selection);Pg(this.editor,i,e.positions)}}))}_isToolbarVisible(e){return this._balloon.visibleView===e.view}_isToolbarInBalloon(e){return this._balloon.hasView(e.view)}}function Pg(e,t,i){const n=e.plugins.get("ContextualBalloon"),o=Mg(e,t,i);n.updatePosition(o)}function Mg(e,t,i){const n=e.editing.view,o=on.defaultPositions;return{target:n.domConverter.mapViewToDom(t),positions:i||[o.northArrowSouth,o.northArrowSouthWest,o.northArrowSouthEast,o.southArrowNorth,o.southArrowNorthWest,o.southArrowNorthEast,o.viewportStickyNorth]}}class Og extends(K()){_referenceCoordinates;_options;_originalWidth;_originalHeight;_originalWidthPercents;_aspectRatio;constructor(e){super(),this.set("activeHandlePosition",null),this.set("proposedWidthPercents",null),this.set("proposedWidth",null),this.set("proposedHeight",null),this.set("proposedHandleHostWidth",null),this.set("proposedHandleHostHeight",null),this._options=e,this._referenceCoordinates=null}get originalWidth(){return this._originalWidth}get originalHeight(){return this._originalHeight}get originalWidthPercents(){return this._originalWidthPercents}get aspectRatio(){return this._aspectRatio}begin(e,t,i){const n=new Ze(t);this.activeHandlePosition=function(e){const t=["top-left","top-right","bottom-right","bottom-left"];for(const i of t)if(e.classList.contains(Rg(i)))return i}(e),this._referenceCoordinates=function(e,t){const i=new Ze(e),n=t.split("-"),o={x:"right"==n[1]?i.right:i.left,y:"bottom"==n[0]?i.bottom:i.top};return o.x+=e.ownerDocument.defaultView.scrollX,o.y+=e.ownerDocument.defaultView.scrollY,o}(t,function(e){const t=e.split("-"),i={top:"bottom",bottom:"top",left:"right",right:"left"};return`${i[t[0]]}-${i[t[1]]}`}(this.activeHandlePosition)),this._originalWidth=n.width,this._originalHeight=n.height,this._aspectRatio=n.width/n.height;const o=i.style.width;o&&o.match(/^\d+(\.\d*)?%$/)?this._originalWidthPercents=parseFloat(o):this._originalWidthPercents=function(e,t=new Ze(e)){const i=ig(e);return i?t.width/i*100:0}(i,n)}update(e){this.proposedWidth=e.width,this.proposedHeight=e.height,this.proposedWidthPercents=e.widthPercents,this.proposedHandleHostWidth=e.handleHostWidth,this.proposedHandleHostHeight=e.handleHostHeight}}function Rg(e){return`ck-widget__resizer__handle-${e}`}class Ng extends Zi{constructor(){super();const e=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-size-view",e.to("_viewPosition",e=>e?`ck-orientation-${e}`:"")],style:{display:e.if("_isVisible","none",e=>!e)}},children:[{text:e.to("_label")}]})}_bindToState(e,t){this.bind("_isVisible").to(t,"proposedWidth",t,"proposedHeight",(e,t)=>null!==e&&null!==t),this.bind("_label").to(t,"proposedHandleHostWidth",t,"proposedHandleHostHeight",t,"proposedWidthPercents",(t,i,n)=>"px"===e.unit?`${t}×${i}`:`${n}%`),this.bind("_viewPosition").to(t,"activeHandlePosition",t,"proposedHandleHostWidth",t,"proposedHandleHostHeight",(e,t,i)=>t<50||i<50?"above-center":e)}_dismiss(){this.unbind(),this._isVisible=!1}}class Vg extends(K()){_state;_sizeView;_options;_viewResizerWrapper=null;_initialViewWidth;constructor(e){super(),this._options=e,this.set("isEnabled",!0),this.set("isSelected",!1),this.bind("isVisible").to(this,"isEnabled",this,"isSelected",(e,t)=>e&&t),this.decorate("begin"),this.decorate("cancel"),this.decorate("commit"),this.decorate("updateSize"),this.on("commit",e=>{this.state.proposedWidth||this.state.proposedWidthPercents||(this._cleanup(),e.stop())},{priority:"high"})}get state(){return this._state}show(){this._options.editor.editing.view.change(e=>{e.removeClass("ck-hidden",this._viewResizerWrapper)})}hide(){this._options.editor.editing.view.change(e=>{e.addClass("ck-hidden",this._viewResizerWrapper)})}attach(){const e=this,t=this._options.viewElement;this._options.editor.editing.view.change(i=>{const n=i.createUIElement("div",{class:"ck ck-reset_all ck-widget__resizer"},function(t){const i=this.toDomElement(t);return e._appendHandles(i),e._appendSizeUI(i),i});i.insert(i.createPositionAt(t,"end"),n),i.addClass("ck-widget_with-resizer",t),this._viewResizerWrapper=n,this.isVisible||this.hide()}),this.on("change:isVisible",()=>{this.isVisible?(this.show(),this.redraw()):this.hide()})}begin(e){this._state=new Og(this._options),this._sizeView._bindToState(this._options,this.state),this._initialViewWidth=this._options.viewElement.getStyle("width"),this.state.begin(e,this._getHandleHost(),this._getResizeHost())}updateSize(e){const t=this._proposeNewSize(e);this._options.editor.editing.view.change(e=>{const i=this._options.unit||"%",n=("%"===i?t.widthPercents:t.width)+i;e.setStyle("width",n,this._options.viewElement)});const i=this._getHandleHost(),n=new Ze(i),o=Math.round(n.width),r=Math.round(n.height),s=new Ze(i);t.width=Math.round(s.width),t.height=Math.round(s.height),this.redraw(n),this.state.update({...t,handleHostWidth:o,handleHostHeight:r})}commit(){const e=this._options.unit||"%",t=("%"===e?this.state.proposedWidthPercents:this.state.proposedWidth)+e;this._options.editor.editing.view.change(()=>{this._cleanup(),this._options.onCommit(t)})}cancel(){this._cleanup()}destroy(){this.cancel()}redraw(e){const t=this._domResizerWrapper;if(!((i=t)&&i.ownerDocument&&i.ownerDocument.contains(i)))return;var i;const n=t.parentElement,o=this._getHandleHost(),r=this._viewResizerWrapper,s=[r.getStyle("width"),r.getStyle("height"),r.getStyle("left"),r.getStyle("top")];let a;if(n.isSameNode(o)){const t=e||new Ze(o);a=[t.width+"px",t.height+"px",void 0,void 0]}else a=[o.offsetWidth+"px",o.offsetHeight+"px",o.offsetLeft+"px",o.offsetTop+"px"];"same"!==te(s,a)&&this._options.editor.editing.view.change(e=>{e.setStyle({width:a[0],height:a[1],left:a[2],top:a[3]},r)})}containsHandle(e){return this._domResizerWrapper.contains(e)}static isResizeHandle(e){return e.classList.contains("ck-widget__resizer__handle")}_cleanup(){this._sizeView._dismiss();this._options.editor.editing.view.change(e=>{e.setStyle("width",this._initialViewWidth,this._options.viewElement)})}_proposeNewSize(e){const t=this.state,i={x:(n=e).pageX,y:n.pageY};var n;const o=!this._options.isCentered||this._options.isCentered(this),r={x:t._referenceCoordinates.x-(i.x+t.originalWidth),y:i.y-t.originalHeight-t._referenceCoordinates.y};o&&t.activeHandlePosition.endsWith("-right")&&(r.x=i.x-(t._referenceCoordinates.x+t.originalWidth)),o&&(r.x*=2);let s=Math.abs(t.originalWidth+r.x),a=Math.abs(t.originalHeight+r.y);return"width"==(s/t.aspectRatio>a?"width":"height")?a=s/t.aspectRatio:s=a*t.aspectRatio,{width:Math.round(s),height:Math.round(a),widthPercents:Math.min(Math.round(t.originalWidthPercents/t.originalWidth*s*100)/100,100)}}_getResizeHost(){const e=this._domResizerWrapper.parentElement;return this._options.getResizeHost(e)}_getHandleHost(){const e=this._domResizerWrapper.parentElement;return this._options.getHandleHost(e)}get _domResizerWrapper(){return this._options.editor.editing.view.domConverter.mapViewToDom(this._viewResizerWrapper)}_appendHandles(e){const t=["top-left","top-right","bottom-right","bottom-left"];for(const i of t)e.appendChild(new bi({tag:"div",attributes:{class:`ck-widget__resizer__handle ${Lg(i)}`}}).render())}_appendSizeUI(e){this._sizeView=new Ng,this._sizeView.render(),e.appendChild(this._sizeView.element)}}function Lg(e){return`ck-widget__resizer__handle-${e}`}var Dg=i(2060),Bg={attributes:{"data-cke":!0}};Bg.setAttributes=Ki(),Bg.insert=$i().bind(null,"head"),Bg.domAPI=Hi(),Bg.insertStyleElement=Yi();ji()(Dg.A,Bg);Dg.A&&Dg.A.locals&&Dg.A.locals;class zg extends Qu{_resizers=new Map;_observer;_redrawSelectedResizerThrottled;static get pluginName(){return"WidgetResize"}static get isOfficialPlugin(){return!0}init(){const t=this.editor.editing,i=e.window.document;this.set("selectedResizer",null),this.set("_activeResizer",null),t.view.addObserver(fd),this._observer=new(He()),this.listenTo(t.view.document,"mousedown",this._mouseDownListener.bind(this),{priority:"high"}),this._observer.listenTo(i,"mousemove",this._mouseMoveListener.bind(this)),this._observer.listenTo(i,"mouseup",this._mouseUpListener.bind(this)),this._redrawSelectedResizerThrottled=gn(()=>this.redrawSelectedResizer(),200),this.editor.ui.on("update",this._redrawSelectedResizerThrottled),this.editor.model.document.on("change",()=>{for(const[e,t]of this._resizers)e.isAttached()||(this._resizers.delete(e),t.destroy())},{priority:"lowest"}),this._observer.listenTo(e.window,"resize",this._redrawSelectedResizerThrottled);const n=this.editor.editing.view.document.selection;n.on("change",()=>{const e=n.getSelectedElement(),t=this.getResizerByViewElement(e)||null;t?this.select(t):this.deselect()})}redrawSelectedResizer(){this.selectedResizer&&this.selectedResizer.isVisible&&this.selectedResizer.redraw()}destroy(){super.destroy(),this._observer.stopListening();for(const e of this._resizers.values())e.destroy();this._redrawSelectedResizerThrottled.cancel()}select(e){this.deselect(),this.selectedResizer=e,this.selectedResizer.isSelected=!0}deselect(){this.selectedResizer&&(this.selectedResizer.isSelected=!1),this.selectedResizer=null}attachTo(e){const t=new Vg(e),i=this.editor.plugins;if(t.attach(),i.has("WidgetToolbarRepository")){const e=i.get("WidgetToolbarRepository");t.on("begin",()=>{e.forceDisabled("resize")},{priority:"lowest"}),t.on("cancel",()=>{e.clearForceDisabled("resize")},{priority:"highest"}),t.on("commit",()=>{e.clearForceDisabled("resize")},{priority:"highest"})}this._resizers.set(e.viewElement,t);const n=this.editor.editing.view.document.selection.getSelectedElement();return this.getResizerByViewElement(n)==t&&this.select(t),t}getResizerByViewElement(e){return this._resizers.get(e)}_getResizerByHandle(e){for(const t of this._resizers.values())if(t.containsHandle(e))return t}_mouseDownListener(e,t){const i=t.domTarget;Vg.isResizeHandle(i)&&(this._activeResizer=this._getResizerByHandle(i)||null,this._activeResizer&&(this._activeResizer.begin(i),e.stop(),t.preventDefault()))}_mouseMoveListener(e,t){this._activeResizer&&this._activeResizer.updateSize(t)}_mouseUpListener(){this._activeResizer&&(this._activeResizer.commit(),this._activeResizer=null)}}const Fg=st("px");class jg extends Zi{constructor(){super();const e=this.bindTemplate;this.set({isVisible:!1,left:null,top:null,width:null}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-clipboard-drop-target-line",e.if("isVisible","ck-hidden",e=>!e)],style:{left:e.to("left",e=>Fg(e)),top:e.to("top",e=>Fg(e)),width:e.to("width",e=>Fg(e))}}})}}class Ug extends Qu{removeDropMarkerDelayed=oi(()=>this.removeDropMarker(),40);_updateDropMarkerThrottled=gn(e=>this._updateDropMarker(e),40);_reconvertMarkerThrottled=gn(()=>{this.editor.model.markers.has("drop-target")&&this.editor.editing.reconvertMarker("drop-target")},0);_dropTargetLineView=new jg;_domEmitter=new(He());_scrollables=new Map;static get pluginName(){return"DragDropTarget"}static get isOfficialPlugin(){return!0}init(){this._setupDropMarker()}destroy(){this._domEmitter.stopListening();for(const{resizeObserver:e}of this._scrollables.values())e.destroy();return this._updateDropMarkerThrottled.cancel(),this.removeDropMarkerDelayed.cancel(),this._reconvertMarkerThrottled.cancel(),super.destroy()}updateDropMarker(e,t,i,n,o,r){this.removeDropMarkerDelayed.cancel();const s=Hg(this.editor,e,t,i,n,o,r);return s?r&&r.containsRange(s)||s&&!this.editor.model.canEditAt(s)?(this.removeDropMarker(),null):(this._updateDropMarkerThrottled(s),s):null}getFinalDropRange(e,t,i,n,o,r){const s=Hg(this.editor,e,t,i,n,o,r);return this.removeDropMarker(),s}removeDropMarker(){const e=this.editor.model;this.removeDropMarkerDelayed.cancel(),this._updateDropMarkerThrottled.cancel(),this._dropTargetLineView.isVisible=!1,e.markers.has("drop-target")&&e.change(e=>{e.removeMarker("drop-target")})}_setupDropMarker(){const e=this.editor;e.ui.view.body.add(this._dropTargetLineView),e.conversion.for("editingDowncast").markerToHighlight({model:"drop-target",view:{classes:["ck-clipboard-drop-target-range"]}}),e.conversion.for("editingDowncast").markerToElement({model:"drop-target",view:(t,{writer:i})=>{if(e.model.schema.checkChild(t.markerRange.start,"$text"))return this._dropTargetLineView.isVisible=!1,this._createDropTargetPosition(i);t.markerRange.isCollapsed?this._updateDropTargetLine(t.markerRange):this._dropTargetLineView.isVisible=!1}})}_updateDropMarker(e){const t=this.editor,i=t.model.markers;t.model.change(t=>{i.has("drop-target")?i.get("drop-target").getRange().isEqual(e)||t.updateMarker("drop-target",{range:e}):t.addMarker("drop-target",{range:e,usingOperation:!1,affectsData:!1})})}_createDropTargetPosition(e){return e.createUIElement("span",{class:"ck ck-clipboard-drop-target-position"},function(e){const t=this.toDomElement(e);return t.append("",e.createElement("span"),""),t})}_updateDropTargetLine(t){const i=this.editor.editing,n=t.start.nodeBefore,o=t.start.nodeAfter,r=t.start.parent,s=n?i.mapper.toViewElement(n):null,a=s?i.view.domConverter.mapViewToDom(s):null,l=o?i.mapper.toViewElement(o):null,c=l?i.view.domConverter.mapViewToDom(l):null,d=i.mapper.toViewElement(r);if(!d)return;const u=i.view.domConverter.mapViewToDom(d),h=this._getScrollableRect(d),{scrollX:m,scrollY:g}=e.window,f=a?new Ze(a):null,p=c?new Ze(c):null,b=new Ze(u).excludeScrollbarsAndBorders(),k=f?f.bottom:b.top,w=p?p.top:b.bottom,_=e.window.getComputedStyle(u),v=k<=w?(k+w)/2:w;if(h.top<v&&v<h.bottom){const e=b.left+parseFloat(_.paddingLeft),t=b.right-parseFloat(_.paddingRight),i=Math.max(e+m,h.left),n=Math.min(t+m,h.right);this._dropTargetLineView.set({isVisible:!0,left:i,top:v+g,width:n-i})}else this._dropTargetLineView.isVisible=!1}_getScrollableRect(t){const i=t.root.rootName;let n;if(this._scrollables.has(i))n=this._scrollables.get(i).domElement;else{n=function(t){let i=t;do{i=i.parentElement;const t=e.window.getComputedStyle(i).overflowY;if("auto"==t||"scroll"==t)break}while("BODY"!=i.tagName);return i}(this.editor.editing.view.domConverter.mapViewToDom(t)),this._domEmitter.listenTo(n,"scroll",this._reconvertMarkerThrottled,{usePassive:!0});const o=new ot(n,this._reconvertMarkerThrottled);this._scrollables.set(i,{domElement:n,resizeObserver:o})}return new Ze(n).excludeScrollbarsAndBorders()}}function Hg(e,t,i,n,o,r,s){const a=e.model,l=e.editing.mapper;let c=Kg(e,t);for(;c;){if(!r)if(a.schema.checkChild(c,"$text")){if(i){const t=i[0].start,r=l.toModelPosition(t);if(!s||Array.from(s.getItems({shallow:!0})).some(e=>a.schema.checkChild(r,e))){if(a.schema.checkChild(r,"$text"))return a.createRange(r);if(t)return $g(e,Kg(e,t.parent),n,o)}}}else if(a.schema.isInline(c))return $g(e,c,n,o);if(a.schema.isBlock(c))return $g(e,c,n,o);if(a.schema.checkChild(c,"$block")){const t=Array.from(c.getChildren()).filter(t=>t.is("element")&&!Wg(e,t));let i=0,r=t.length;if(0==r)return a.createRange(a.createPositionAt(c,"end"));for(;i<r-1;){const s=Math.floor((i+r)/2);"before"==qg(e,t[s],n,o)?r=s:i=s}return $g(e,t[i],n,o)}c=c.parent}return null}function Wg(t,i){const n=t.editing.mapper,o=t.editing.view.domConverter,r=n.toViewElement(i);if(!r)return!0;const s=o.mapViewToDom(r);return"none"!=e.window.getComputedStyle(s).float}function $g(e,t,i,n){const o=e.model;return o.createRange(o.createPositionAt(t,qg(e,t,i,n)))}function qg(e,t,i,n){const o=e.editing.mapper,r=e.editing.view.domConverter,s=o.toViewElement(t),a=r.mapViewToDom(s),l=new Ze(a);return e.model.schema.isInline(t)?i<(l.left+l.right)/2?"before":"after":n<(l.top+l.bottom)/2?"before":"after"}function Kg(e,t){const i=e.editing.mapper,n=e.editing.view,o=i.toModelElement(t);if(o)return o;const r=n.createPositionBefore(t),s=i.findMappedViewAncestor(r);return i.toModelElement(s)}class Gg extends Qu{_isBlockDragging=!1;_domEmitter=new(He());static get pluginName(){return"DragDropBlockToolbar"}static get isOfficialPlugin(){return!0}init(){const t=this.editor;if(this.listenTo(t,"change:isReadOnly",(e,t,i)=>{i?(this.forceDisabled("readOnlyMode"),this._isBlockDragging=!1):this.clearForceDisabled("readOnlyMode")}),r.isAndroid&&this.forceDisabled("noAndroidSupport"),t.plugins.has("BlockToolbar")){const i=t.plugins.get("BlockToolbar").buttonView.element;this._domEmitter.listenTo(i,"dragstart",(e,t)=>this._handleBlockDragStart(t)),this._domEmitter.listenTo(e.document,"dragover",(e,t)=>this._handleBlockDragging(t)),this._domEmitter.listenTo(e.document,"drop",(e,t)=>this._handleBlockDragging(t)),this._domEmitter.listenTo(e.document,"dragend",()=>this._handleBlockDragEnd(),{useCapture:!0}),this.isEnabled&&i.setAttribute("draggable","true"),this.on("change:isEnabled",(e,t,n)=>{i.setAttribute("draggable",n?"true":"false")})}}destroy(){return this._domEmitter.stopListening(),super.destroy()}_handleBlockDragStart(e){if(!this.isEnabled)return;const t=this.editor.model,i=t.document.selection,n=this.editor.editing.view,o=Array.from(i.getSelectedBlocks()),r=t.createRange(t.createPositionBefore(o[0]),t.createPositionAfter(o[o.length-1]));t.change(e=>e.setSelection(r)),this._isBlockDragging=!0,n.focus(),n.getObserver(Rh).onDomEvent(e)}_handleBlockDragging(e){if(!this.isEnabled||!this._isBlockDragging)return;const t=e.clientX+("ltr"==this.editor.locale.contentLanguageDirection?100:-100),i=e.clientY,n=document.elementFromPoint(t,i),o=this.editor.editing.view;n&&n.closest(".ck-editor__editable")&&o.getObserver(Rh).onDomEvent({...e,type:e.type,dataTransfer:e.dataTransfer,target:n,clientX:t,clientY:i,preventDefault:()=>e.preventDefault(),stopPropagation:()=>e.stopPropagation()})}_handleBlockDragEnd(){this._isBlockDragging=!1}}var Yg=i(9262),Jg={attributes:{"data-cke":!0}};Jg.setAttributes=Ki(),Jg.insert=$i().bind(null,"head"),Jg.domAPI=Hi(),Jg.insertStyleElement=Yi();ji()(Yg.A,Jg);Yg.A&&Yg.A.locals&&Yg.A.locals;class Qg extends Qu{_draggedRange;_draggingUid;_draggableElement;_clearDraggableAttributesDelayed=oi(()=>this._clearDraggableAttributes(),40);_blockMode=!1;_domEmitter=new(He());_previewContainer;static get pluginName(){return"DragDrop"}static get isOfficialPlugin(){return!0}static get requires(){return[Gh,bg,Ug,Gg]}init(){const e=this.editor,t=e.editing.view;this._draggedRange=null,this._draggingUid="",this._draggableElement=null,t.addObserver(Rh),t.addObserver(bd),this._setupDragging(),this._setupContentInsertionIntegration(),this._setupClipboardInputIntegration(),this._setupDraggableAttributeHandling(),this.listenTo(e,"change:isReadOnly",(e,t,i)=>{i?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")}),this.on("change:isEnabled",(e,t,i)=>{i||this._finalizeDragging(!1)}),r.isAndroid&&this.forceDisabled("noAndroidSupport")}destroy(){return this._draggedRange&&(this._draggedRange.detach(),this._draggedRange=null),this._previewContainer&&this._previewContainer.remove(),this._domEmitter.stopListening(),this._clearDraggableAttributesDelayed.cancel(),super.destroy()}_setupDragging(){const t=this.editor,i=t.model,n=t.editing.view,o=n.document,s=t.plugins.get(Ug);this.listenTo(o,"dragstart",(e,n)=>{if(n.target?.is("editableElement"))return void n.preventDefault();if(this._prepareDraggedRange(n.target),!this._draggedRange)return void n.preventDefault();this._draggingUid=_();const o=this.isEnabled&&t.model.canEditAt(this._draggedRange);n.dataTransfer.effectAllowed=o?"copyMove":"copy",n.dataTransfer.setData("application/ckeditor5-dragging-uid",this._draggingUid);const r=i.createSelection(this._draggedRange.toRange());this.editor.plugins.get("ClipboardPipeline")._fireOutputTransformationEvent(n.dataTransfer,r,"dragstart");const{dataTransfer:s,domTarget:a,domEvent:l}=n,{clientX:c}=l;this._updatePreview({dataTransfer:s,domTarget:a,clientX:c}),n.stopPropagation(),o||(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid="")},{priority:"low"}),this.listenTo(o,"dragend",(e,t)=>{this._finalizeDragging(!t.dataTransfer.isCanceled&&"move"==t.dataTransfer.dropEffect)},{priority:"low"}),this._domEmitter.listenTo(e.document,"dragend",()=>{this._blockMode=!1},{useCapture:!0}),this.listenTo(o,"dragenter",()=>{this.isEnabled&&n.focus()}),this.listenTo(o,"dragleave",()=>{s.removeDropMarkerDelayed()}),this.listenTo(o,"dragging",(e,t)=>{if(!this.isEnabled)return void(t.dataTransfer.dropEffect="none");const{clientX:i,clientY:n}=t.domEvent;s.updateDropMarker(t.target,t.targetRanges,i,n,this._blockMode,this._draggedRange)?(this._draggedRange||(t.dataTransfer.dropEffect="copy"),r.isGecko||("copy"==t.dataTransfer.effectAllowed?t.dataTransfer.dropEffect="copy":["all","copyMove"].includes(t.dataTransfer.effectAllowed)&&(t.dataTransfer.dropEffect="move")),e.stop()):t.dataTransfer.dropEffect="none"},{priority:"low"})}_setupClipboardInputIntegration(){const e=this.editor,t=e.editing.view.document,i=e.plugins.get(Ug);this.listenTo(t,"clipboardInput",(t,n)=>{if("drop"!=n.method)return;const{clientX:o,clientY:r}=n.domEvent,s=i.getFinalDropRange(n.target,n.targetRanges,o,r,this._blockMode,this._draggedRange);if(!s)return this._finalizeDragging(!1),void t.stop();this._draggedRange&&this._draggingUid!=n.dataTransfer.getData("application/ckeditor5-dragging-uid")&&(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid="");if("move"==Zg(n.dataTransfer)&&this._draggedRange&&this._draggedRange.containsRange(s,!0))return this._finalizeDragging(!1),void t.stop();n.targetRanges=[e.editing.mapper.toViewRange(s)]},{priority:"high"})}_setupContentInsertionIntegration(){const e=this.editor.plugins.get(Gh);e.on("contentInsertion",(e,t)=>{if(!this.isEnabled||"drop"!==t.method)return;const i=t.targetRanges.map(e=>this.editor.editing.mapper.toModelRange(e));this.editor.model.change(e=>e.setSelection(i))},{priority:"high"}),e.on("contentInsertion",(e,t)=>{if(!this.isEnabled||"drop"!==t.method)return;const i="move"==Zg(t.dataTransfer),n=!t.resultRange||!t.resultRange.isCollapsed;this._finalizeDragging(n&&i)},{priority:"lowest"})}_setupDraggableAttributeHandling(){const e=this.editor,t=e.editing.view,i=t.document;this.listenTo(i,"pointerdown",(n,o)=>{if(r.isAndroid||!o)return;this._clearDraggableAttributesDelayed.cancel();let s=Xg(o.target);if(r.isBlink&&!e.isReadOnly&&!s&&!i.selection.isCollapsed){const e=i.selection.getSelectedElement();e&&Gm(e)||(s=i.selection.editableElement)}s&&(t.change(e=>{e.setAttribute("draggable","true",s)}),this._draggableElement=e.editing.mapper.toModelElement(s))}),this.listenTo(i,"pointerup",()=>{r.isAndroid||this._clearDraggableAttributesDelayed()})}_clearDraggableAttributes(){const e=this.editor.editing;e.view.change(t=>{this._draggableElement&&"$graveyard"!=this._draggableElement.root.rootName&&t.removeAttribute("draggable",e.mapper.toViewElement(this._draggableElement)),this._draggableElement=null})}_finalizeDragging(e){const t=this.editor,i=t.model;if(t.plugins.get(Ug).removeDropMarker(),this._clearDraggableAttributes(),t.plugins.has("WidgetToolbarRepository")){t.plugins.get("WidgetToolbarRepository").clearForceDisabled("dragDrop")}this._draggingUid="",this._previewContainer&&(this._previewContainer.remove(),this._previewContainer=void 0),this._draggedRange&&(e&&this.isEnabled&&i.change(e=>{const t=i.createSelection(this._draggedRange);i.deleteContent(t,{doNotAutoparagraph:!0});const n=t.getFirstPosition().parent;n.isEmpty&&!i.schema.checkChild(n,"$text")&&i.schema.checkChild(n,"paragraph")&&e.insertElement("paragraph",n,0)}),this._draggedRange.detach(),this._draggedRange=null)}_prepareDraggedRange(e){const t=this.editor,i=t.model,n=i.document.selection,o=e?Xg(e):null;if(o){const e=t.editing.mapper.toModelElement(o);if(this._draggedRange=La.fromRange(i.createRangeOn(e)),this._blockMode=i.schema.isBlock(e),t.plugins.has("WidgetToolbarRepository")){t.plugins.get("WidgetToolbarRepository").forceDisabled("dragDrop")}return}if(n.isCollapsed&&!n.getFirstPosition().parent.isEmpty)return;const r=Array.from(n.getSelectedBlocks()),s=n.getFirstRange();if(0==r.length)return void(this._draggedRange=La.fromRange(s));const a=ef(i,r);if(r.length>1)this._draggedRange=La.fromRange(a),this._blockMode=!0;else if(1==r.length){const e=s.start.isTouching(a.start)&&s.end.isTouching(a.end);this._draggedRange=La.fromRange(e?a:s),this._blockMode=e}i.change(e=>e.setSelection(this._draggedRange.toRange()))}_updatePreview({dataTransfer:t,domTarget:i,clientX:n}){const o=this.editor.editing.view,s=o.document.selection.editableElement,a=o.domConverter.mapViewToDom(s),l=e.window.getComputedStyle(a);this._previewContainer?this._previewContainer.firstElementChild&&this._previewContainer.removeChild(this._previewContainer.firstElementChild):(this._previewContainer=oe(e.document,"div",{style:"position: fixed; left: -999999px;"}),e.document.body.appendChild(this._previewContainer));const c=oe(e.document,"div");c.className="ck ck-content ck-clipboard-preview";const d=new Ze(a),u=parseFloat(l.paddingLeft),h=parseFloat(l.paddingRight),m=parseFloat(l.width)-u-h;if(a.contains(i)){if(!r.isiOS)return;c.style.maxWidth=`${m}px`,c.style.padding="10px",c.style.minWidth="200px",c.style.minHeight="20px",c.style.boxSizing="border-box",c.style.backgroundColor="var(--ck-color-base-background)"}else if(r.isiOS)c.style.width=`${m}px`,c.style.backgroundColor="var(--ck-color-base-background)";else{const e=d.left-n+u;c.style.width=`${m+e}px`,c.style.paddingLeft=`${e}px`}o.domConverter.setContentOf(c,t.getData("text/html")),t.setDragImage(c,0,0),this._previewContainer.appendChild(c)}}function Zg(e){return r.isGecko?e.dropEffect:["all","copyMove"].includes(e.effectAllowed)?"move":"copy"}function Xg(e){if(e.is("editableElement"))return null;if(e.hasClass("ck-widget__selection-handle"))return e.findAncestor(Gm);if(Gm(e))return e;const t=e.findAncestor(e=>Gm(e)||e.is("editableElement"));return Gm(t)?t:null}function ef(e,t){const i=t[0],n=t[t.length-1],o=i.getCommonAncestor(n),r=e.createPositionBefore(i),s=e.createPositionAfter(n);if(o&&o.is("element")&&!e.schema.isLimit(o)){const t=e.createRangeOn(o),i=r.isTouching(t.start),n=s.isTouching(t.end);if(i&&n)return ef(e,[o])}return e.createRange(r,s)}class tf extends Qu{static get pluginName(){return"PastePlainText"}static get isOfficialPlugin(){return!0}static get requires(){return[Gh]}init(){const e=this.editor,t=e.model,i=e.editing.view,n=t.document.selection;i.addObserver(Rh),e.plugins.get(Gh).on("contentInsertion",(e,i)=>{(function(e,t){let i=t.createRangeIn(e);if(1==e.childCount){const n=e.getChild(0);n.is("element")&&t.schema.isBlock(n)&&!t.schema.isObject(n)&&!t.schema.isLimit(n)&&(i=t.createRangeIn(n))}for(const e of i.getItems()){if(!t.schema.isInline(e))return!1;if(Array.from(e.getAttributeKeys()).find(e=>t.schema.getAttributeProperties(e).isFormatting))return!1}return!0})(i.content,t)&&t.change(e=>{const o=Array.from(n.getAttributes()).filter(([e])=>t.schema.getAttributeProperties(e).isFormatting);n.isCollapsed||t.deleteContent(n,{doNotAutoparagraph:!0}),o.push(...n.getAttributes());const r=e.createRangeIn(i.content);for(const i of r.getItems())for(const n of o)t.schema.checkAttribute(i,n[0])&&e.setAttribute(n[0],n[1],i)})})}}class nf extends Qu{static get pluginName(){return"Clipboard"}static get isOfficialPlugin(){return!0}static get requires(){return[Kh,Gh,Qg,tf]}init(){const e=this.editor,t=this.editor.t;e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Copy selected content"),keystroke:"CTRL+C"},{label:t("Paste content"),keystroke:"CTRL+V"},{label:t("Paste content as plain text"),keystroke:"CTRL+SHIFT+V"}]})}}class of extends Xu{constructor(e){super(e),this.affectsData=!1}execute(){const e=this.editor.model,t=e.document.selection;let i=e.schema.getLimitElement(t);if(t.containsEntireContent(i)||!rf(e.schema,i))do{if(i=i.parent,!i)return}while(!rf(e.schema,i));e.change(e=>{e.setSelection(i,"in")})}}function rf(e,t){return e.isLimit(t)&&(e.checkChild(t,"$text")||e.checkChild(t,"paragraph"))}const sf=Rt("Ctrl+A");class af extends Qu{static get pluginName(){return"SelectAllEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.t,i=e.editing.view.document;e.commands.add("selectAll",new of(e)),this.listenTo(i,"keydown",(t,i)=>{Ot(i)===sf&&(e.execute("selectAll"),i.preventDefault())}),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Select all"),keystroke:"CTRL+A"}]})}}class lf extends Qu{static get pluginName(){return"SelectAllUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.ui.componentFactory.add("selectAll",()=>{const e=this._createButton(lo);return e.set({tooltip:!0}),e}),e.ui.componentFactory.add("menuBar:selectAll",()=>this._createButton(Lu))}_createButton(e){const t=this.editor,i=t.locale,n=t.commands.get("selectAll"),o=new e(t.locale),r=i.t;return o.set({label:r("Select all"),icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M.75 15.5a.75.75 0 0 1 .75.75V18l.008.09A.5.5 0 0 0 2 18.5h1.75a.75.75 0 1 1 0 1.5H1.5l-.144-.007a1.5 1.5 0 0 1-1.35-1.349L0 18.5v-2.25a.75.75 0 0 1 .75-.75m18.5 0a.75.75 0 0 1 .75.75v2.25l-.007.144a1.5 1.5 0 0 1-1.349 1.35L18.5 20h-2.25a.75.75 0 1 1 0-1.5H18a.5.5 0 0 0 .492-.41L18.5 18v-1.75a.75.75 0 0 1 .75-.75m-10.45 3c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2H7.2a.2.2 0 0 1-.2-.2v-1.1c0-.11.09-.2.2-.2zm4 0c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2h-1.6a.2.2 0 0 1-.2-.2v-1.1c0-.11.09-.2.2-.2zm.45-5.5a.75.75 0 1 1 0 1.5h-8.5a.75.75 0 1 1 0-1.5zM1.3 11c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2H.2a.2.2 0 0 1-.2-.2v-1.6c0-.11.09-.2.2-.2zm18.5 0c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2h-1.1a.2.2 0 0 1-.2-.2v-1.6c0-.11.09-.2.2-.2zm-4.55-2a.75.75 0 1 1 0 1.5H4.75a.75.75 0 1 1 0-1.5zM1.3 7c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2H.2a.2.2 0 0 1-.2-.2V7.2c0-.11.09-.2.2-.2zm18.5 0c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2h-1.1a.2.2 0 0 1-.2-.2V7.2c0-.11.09-.2.2-.2zm-4.55-2a.75.75 0 1 1 0 1.5h-2.5a.75.75 0 1 1 0-1.5zm-5 0a.75.75 0 1 1 0 1.5h-5.5a.75.75 0 0 1 0-1.5zm-6.5-5a.75.75 0 0 1 0 1.5H2a.5.5 0 0 0-.492.41L1.5 2v1.75a.75.75 0 0 1-1.5 0V1.5l.007-.144A1.5 1.5 0 0 1 1.356.006L1.5 0zM18.5 0l.144.007a1.5 1.5 0 0 1 1.35 1.349L20 1.5v2.25a.75.75 0 1 1-1.5 0V2l-.008-.09A.5.5 0 0 0 18 1.5h-1.75a.75.75 0 1 1 0-1.5zM8.8 0c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2H7.2a.2.2 0 0 1-.2-.2V.2c0-.11.09-.2.2-.2zm4 0c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2h-1.6a.2.2 0 0 1-.2-.2V.2c0-.11.09-.2.2-.2z"/></svg>',keystroke:"Ctrl+A"}),o.bind("isEnabled").to(n,"isEnabled"),this.listenTo(o,"execute",()=>{t.execute("selectAll"),t.editing.view.focus()}),o}}class cf extends Qu{static get requires(){return[af,lf]}static get pluginName(){return"SelectAll"}static get isOfficialPlugin(){return!0}}class df extends Xu{_stack=[];_createdBatches=new WeakSet;constructor(e){super(e),this.refresh(),this._isEnabledBasedOnSelection=!1,this.listenTo(e.data,"set",(e,t)=>{t[1]={...t[1]};const i=t[1];i.batchType||(i.batchType={isUndoable:!1})},{priority:"high"}),this.listenTo(e.data,"set",(e,t)=>{t[1].batchType.isUndoable||this.clearStack()})}refresh(){this.isEnabled=this._stack.length>0}get createdBatches(){return this._createdBatches}addBatch(e){const t=this.editor.model.document.selection,i={ranges:t.hasOwnRange?Array.from(t.getRanges()):[],isBackward:t.isBackward};this._stack.push({batch:e,selection:i}),this.refresh()}clearStack(){this._stack=[],this.refresh()}_restoreSelection(e,t,i){const n=this.editor.model,o=n.document,r=[],s=e.map(e=>e.getTransformedByOperations(i)),a=s.flat();for(const e of s){const t=e.filter(e=>e.root!=o.graveyard).filter(e=>!hf(e,a));t.length&&(uf(t),r.push(t[0]))}r.length&&n.change(e=>{e.setSelection(r,{backward:t})})}_undo(e,t){const i=this.editor.model,n=i.document;this._createdBatches.add(t);const o=e.operations.slice().filter(e=>e.isDocumentOperation);o.reverse();for(const e of o){const o=e.baseVersion+1,r=Array.from(n.history.getOperations(o)),s=fc([e.getReversed()],r,{useRelations:!0,document:this.editor.model.document,padWithNoOps:!1,forceWeakRemove:!0}).operationsA;for(let o of s){const r=o.affectedSelectable;r&&!i.canEditAt(r)&&(o=new rc(o.baseVersion)),t.addOperation(o),i.applyOperation(o),n.history.setOperationAsUndone(e,o)}}}}function uf(e){e.sort((e,t)=>e.start.isBefore(t.start)?-1:1);for(let t=1;t<e.length;t++){const i=e[t-1].getJoined(e[t],!0);i&&(t--,e.splice(t,2,i))}}function hf(e,t){return t.some(t=>t!==e&&t.containsRange(e,!0))}class mf extends df{execute(e=null){const t=e?this._stack.findIndex(t=>t.batch==e):this._stack.length-1,i=this._stack.splice(t,1)[0],n=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(n,()=>{this._undo(i.batch,n);const e=this.editor.model.document.history.getOperations(i.batch.baseVersion);this._restoreSelection(i.selection.ranges,i.selection.isBackward,e)}),this.fire("revert",i.batch,n),this.refresh()}}class gf extends df{execute(){const e=this._stack.pop(),t=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(t,()=>{const i=e.batch.operations[e.batch.operations.length-1].baseVersion+1,n=this.editor.model.document.history.getOperations(i);this._restoreSelection(e.selection.ranges,e.selection.isBackward,n),this._undo(e.batch,t)}),this.fire("revert",e.batch,t),this.refresh()}}class ff extends Qu{_undoCommand;_redoCommand;_batchRegistry=new WeakSet;static get pluginName(){return"UndoEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.t;this._undoCommand=new mf(e),this._redoCommand=new gf(e),e.commands.add("undo",this._undoCommand),e.commands.add("redo",this._redoCommand),this.listenTo(e.model,"applyOperation",(e,t)=>{const i=t[0];if(!i.isDocumentOperation)return;const n=i.batch,o=this._redoCommand.createdBatches.has(n),r=this._undoCommand.createdBatches.has(n);this._batchRegistry.has(n)||(this._batchRegistry.add(n),n.isUndoable&&(o?this._undoCommand.addBatch(n):r||(this._undoCommand.addBatch(n),this._redoCommand.clearStack())))},{priority:"highest"}),this.listenTo(this._undoCommand,"revert",(e,t,i)=>{this._redoCommand.addBatch(i)}),e.keystrokes.set("CTRL+Z","undo"),e.keystrokes.set("CTRL+Y","redo"),e.keystrokes.set("CTRL+SHIFT+Z","redo"),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Undo"),keystroke:"CTRL+Z"},{label:t("Redo"),keystroke:[["CTRL+Y"],["CTRL+SHIFT+Z"]]}]})}}const pf='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="m5.042 9.367 2.189 1.837a.75.75 0 0 1-.965 1.149l-3.788-3.18a.75.75 0 0 1-.21-.284.75.75 0 0 1 .17-.945L6.23 4.762a.75.75 0 1 1 .964 1.15L4.863 7.866h8.917A.8.8 0 0 1 14 7.9a4 4 0 1 1-1.477 7.718l.344-1.489a2.5 2.5 0 1 0 1.094-4.73l.008-.032z"/></svg>',bf='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="m14.958 9.367-2.189 1.837a.75.75 0 0 0 .965 1.149l3.788-3.18a.75.75 0 0 0 .21-.284.75.75 0 0 0-.17-.945L13.77 4.762a.75.75 0 1 0-.964 1.15l2.331 1.955H6.22A.8.8 0 0 0 6 7.9a4 4 0 1 0 1.477 7.718l-.344-1.489A2.5 2.5 0 1 1 6.039 9.4l-.008-.032z"/></svg>';class kf extends Qu{static get pluginName(){return"UndoUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.locale,i=e.t,n="ltr"==t.uiLanguageDirection?pf:bf,o="ltr"==t.uiLanguageDirection?bf:pf;this._addButtonsToFactory("undo",i("Undo"),"CTRL+Z",n),this._addButtonsToFactory("redo",i("Redo"),"CTRL+Y",o)}_addButtonsToFactory(e,t,i,n){const o=this.editor;o.ui.componentFactory.add(e,()=>{const o=this._createButton(lo,e,t,i,n);return o.set({tooltip:!0}),o}),o.ui.componentFactory.add("menuBar:"+e,()=>this._createButton(Lu,e,t,i,n))}_createButton(e,t,i,n,o){const r=this.editor,s=r.locale,a=r.commands.get(t),l=new e(s);return l.set({label:i,icon:o,keystroke:n}),l.bind("isEnabled").to(a,"isEnabled"),this.listenTo(l,"execute",()=>{r.execute(t),r.editing.view.focus()}),l}}class wf extends Qu{static get requires(){return[ff,kf]}static get pluginName(){return"Undo"}static get isOfficialPlugin(){return!0}}const _f='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M10 6.628a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3M8.5 9.125a.3.3 0 0 0-.253-.296L5.11 8.327a.75.75 0 1 1 .388-1.449l4.04.716c.267.072.624.08.893.009l4.066-.724a.75.75 0 1 1 .388 1.45l-3.132.5a.3.3 0 0 0-.253.296v1.357a.3.3 0 0 0 .018.102l1.615 4.438a.75.75 0 0 1-1.41.513l-1.35-3.71a.3.3 0 0 0-.281-.197h-.209a.3.3 0 0 0-.282.198l-1.35 3.711a.75.75 0 0 1-1.41-.513l1.64-4.509a.3.3 0 0 0 .019-.103z"/><path d="M10 18.5a8.5 8.5 0 1 1 0-17 8.5 8.5 0 0 1 0 17m0 1.5c5.523 0 10-4.477 10-10S15.523 0 10 0 0 4.477 0 10s4.477 10 10 10" clip-rule="evenodd"/></svg>';class vf extends Qu{view;static _visibleDialogPlugin;_onHide;static get pluginName(){return"Dialog"}static get isOfficialPlugin(){return!0}constructor(e){super(e);const t=e.t;this._initShowHideListeners(),this._initFocusToggler(),this._initMultiRootIntegration(),this.set({id:null,isOpen:!1}),e.accessibility.addKeystrokeInfos({categoryId:"navigation",keystrokes:[{label:t("Move focus in and out of an active dialog window"),keystroke:"Ctrl+F6",mayRequireFn:!0}]})}destroy(){super.destroy(),vf._visibleDialogPlugin===this&&this._unlockBodyScroll()}_initShowHideListeners(){this.on("show",(e,t)=>{this._show(t)}),this.on("show",(e,t)=>{t.onShow&&t.onShow(this)},{priority:"low"}),this.on("hide",()=>{vf._visibleDialogPlugin&&vf._visibleDialogPlugin._hide()}),this.on("hide",()=>{this._onHide&&(this._onHide(this),this._onHide=void 0)},{priority:"low"})}_initFocusToggler(){const e=this.editor;e.keystrokes.set("Ctrl+F6",(t,i)=>{this.isOpen&&!this.view.isModal&&(this.view.focusTracker.isFocused?e.editing.view.focus():this.view.focus(),i())})}_initMultiRootIntegration(){const e=this.editor.model;e.document.on("change:data",()=>{if(!this.view)return;const t=e.document.differ.getChangedRoots();for(const e of t)e.state&&this.view.updatePosition()})}show(e){this.hide(),this.fire(`show:${e.id}`,e)}_show({id:e,icon:t,title:i,hasCloseButton:n=!0,content:o,actionButtons:r,className:s,isModal:a,position:l,onHide:c,keystrokeHandlerOptions:d}){const u=this.editor;this.view=new So(u.locale,{getCurrentDomRoot:()=>u.editing.view.getDomRoot(u.model.document.selection.anchor.root.rootName),getViewportOffset:()=>u.ui.viewportOffset,keystrokeHandlerOptions:d});const h=this.view;h.on("close",()=>{this.hide()}),u.ui.view.body.add(h),u.keystrokes.listenTo(h.element),l||(l=a?vo:yo),a&&this._lockBodyScroll(),h.set({position:l,_isVisible:!0,className:s,isModal:a}),h.setupParts({icon:t,title:i,hasCloseButton:n,content:o,actionButtons:r}),this.id=e,c&&(this._onHide=c),this.isOpen=!0,vf._visibleDialogPlugin=this}hide(){vf._visibleDialogPlugin&&vf._visibleDialogPlugin.fire(`hide:${vf._visibleDialogPlugin.id}`)}_hide(){if(!this.view)return;const e=this.editor,t=this.view;t.isModal&&this._unlockBodyScroll(),t.contentView&&t.contentView.reset(),e.ui.view.body.remove(t),e.ui.focusTracker.remove(t.element),e.keystrokes.stopListening(t.element),t.destroy(),e.editing.view.focus(),this.id=null,this.isOpen=!1,vf._visibleDialogPlugin=null}_lockBodyScroll(){document.documentElement.classList.add("ck-dialog-scroll-locked")}_unlockBodyScroll(){document.documentElement.classList.remove("ck-dialog-scroll-locked")}}class yf extends Zi{constructor(e,t){super(e);const i=e.t,n=new Td;n.text=i("Help Contents. To close this dialog press ESC."),this.setTemplate({tag:"div",attributes:{class:["ck","ck-accessibility-help-dialog__content"],"aria-labelledby":n.id,role:"document",tabindex:-1},children:[oe(document,"p",{},i("Below, you can find a list of keyboard shortcuts that can be used in the editor.")),...this._createCategories(Array.from(t.values())),n]})}focus(){this.element.focus()}_createCategories(e){return e.map(e=>{const t=[oe(document,"h3",{},e.label),...Array.from(e.groups.values()).map(e=>this._createGroup(e)).flat()];return e.description&&t.splice(1,0,oe(document,"p",{},e.description)),oe(document,"section",{},t)})}_createGroup(e){const t=e.keystrokes.sort((e,t)=>e.label.localeCompare(t.label)).map(e=>this._createGroupRow(e)).flat(),i=[oe(document,"dl",{},t)];return e.label&&i.unshift(oe(document,"h4",{},e.label)),i}_createGroupRow(e){const t=this.locale.t,i=oe(document,"dt"),n=oe(document,"dd"),o=function(e){if("string"==typeof e)return[[e]];if("string"==typeof e[0])return[e];return e}(e.keystroke),s=[];for(const e of o)s.push(e.map(Af).join(""));return i.innerHTML=e.label,n.innerHTML=s.join(", ")+(e.mayRequireFn&&r.isMac?` ${t("(may require <kbd>Fn</kbd>)")}`:""),[i,n]}}function Af(e){return Nt(e).split("+").map(e=>`<kbd>${e}</kbd>`).join("+")}var xf=i(9550),Cf={attributes:{"data-cke":!0}};Cf.setAttributes=Ki(),Cf.insert=$i().bind(null,"head"),Cf.domAPI=Hi(),Cf.insertStyleElement=Yi();ji()(xf.A,Cf);xf.A&&xf.A.locals&&xf.A.locals;class Tf extends Qu{contentView=null;static get requires(){return[vf]}static get pluginName(){return"AccessibilityHelp"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.locale.t;e.ui.componentFactory.add("accessibilityHelp",()=>{const e=this._createButton(lo);return e.set({tooltip:!0,withText:!1,label:t("Accessibility help")}),e}),e.ui.componentFactory.add("menuBar:accessibilityHelp",()=>{const e=this._createButton(Lu);return e.label=t("Accessibility"),e}),e.keystrokes.set("Alt+0",(e,t)=>{this._toggleDialog(),t()}),this._setupRootLabels()}_createButton(e){const t=this.editor,i=t.plugins.get("Dialog"),n=new e(t.locale);return n.set({keystroke:"Alt+0",icon:_f,isToggleable:!0}),n.on("execute",()=>this._toggleDialog()),n.bind("isOn").to(i,"id",e=>"accessibilityHelp"===e),n}_setupRootLabels(){const e=this.editor,t=e.editing.view,i=e.t;function n(e,t){const n=[t.getAttribute("aria-label"),i("Press %0 for help.",[Nt("Alt+0")])].filter(e=>e).join(". ");e.setAttribute("aria-label",n,t)}e.ui.on("ready",()=>{t.change(e=>{for(const i of t.document.roots)n(e,i)}),e.on("addRoot",(i,o)=>{const r=e.editing.view.document.getRoot(o.rootName);t.change(e=>n(e,r))},{priority:"low"})})}_toggleDialog(){const e=this.editor,t=e.plugins.get("Dialog"),i=e.locale.t;this.contentView||(this.contentView=new yf(e.locale,e.accessibility.keystrokeInfos)),"accessibilityHelp"===t.id?t.hide():t.show({id:"accessibilityHelp",className:"ck-accessibility-help-dialog",title:i("Accessibility help"),icon:_f,hasCloseButton:!0,content:this.contentView})}}class Ef extends(K()){total;_reader;_data;constructor(){super();const e=new window.FileReader;this._reader=e,this._data=void 0,this.set("loaded",0),e.onprogress=e=>{this.loaded=e.loaded}}get error(){return this._reader.error}get data(){return this._data}read(e){const t=this._reader;return this.total=e.size,new Promise((i,n)=>{t.onload=()=>{const e=t.result;this._data=e,i(e)},t.onerror=()=>{n("error")},t.onabort=()=>{n("aborted")},this._reader.readAsDataURL(e)})}abort(){this._reader.abort()}}class If extends Qu{loaders=new Yt;_loadersMap=new Map;_pendingAction=null;static get pluginName(){return"FileRepository"}static get isOfficialPlugin(){return!0}static get requires(){return[Ph]}init(){this.loaders.on("change",()=>this._updatePendingAction()),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(e,t)=>t?e/t*100:0)}getLoader(e){return this._loadersMap.get(e)||null}createLoader(e){if(!this.createUploadAdapter)return x("filerepository-no-upload-adapter"),null;const t=new Sf(Promise.resolve(e),this.createUploadAdapter);return this.loaders.add(t),this._loadersMap.set(e,t),e instanceof Promise&&t.file.then(e=>{this._loadersMap.set(e,t)}).catch(()=>{}),t.on("change:uploaded",()=>{let e=0;for(const t of this.loaders)e+=t.uploaded;this.uploaded=e}),t.on("change:uploadTotal",()=>{let e=0;for(const t of this.loaders)t.uploadTotal&&(e+=t.uploadTotal);this.uploadTotal=e}),t}destroyLoader(e){const t=e instanceof Sf?e:this.getLoader(e);t._destroy(),this.loaders.remove(t),this._loadersMap.forEach((e,i)=>{e===t&&this._loadersMap.delete(i)})}_updatePendingAction(){const e=this.editor.plugins.get(Ph);if(this.loaders.length){if(!this._pendingAction){const t=this.editor.t,i=e=>`${t("Upload in progress")} ${parseInt(e)}%.`;this._pendingAction=e.add(i(this.uploadedPercent)),this._pendingAction.bind("message").to(this,"uploadedPercent",i)}}else e.remove(this._pendingAction),this._pendingAction=null}}class Sf extends(K()){id;_filePromiseWrapper;_adapter;_reader;constructor(e,t){super(),this.id=_(),this._filePromiseWrapper=this._createFilePromiseWrapper(e),this._adapter=t(this),this._reader=new Ef,this.set("status","idle"),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(e,t)=>t?e/t*100:0),this.set("uploadResponse",null)}get file(){return this._filePromiseWrapper?this._filePromiseWrapper.promise.then(e=>this._filePromiseWrapper?e:null):Promise.resolve(null)}get data(){return this._reader.data}read(){if("idle"!=this.status)throw new A("filerepository-read-wrong-status",this);return this.status="reading",this.file.then(e=>this._reader.read(e)).then(e=>{if("reading"!==this.status)throw this.status;return this.status="idle",e}).catch(e=>{if("aborted"===e)throw this.status="aborted","aborted";throw this.status="error",this._reader.error?this._reader.error:e})}upload(){if("idle"!=this.status)throw new A("filerepository-upload-wrong-status",this);return this.status="uploading",this.file.then(()=>this._adapter.upload()).then(e=>(this.uploadResponse=e,this.status="idle",e)).catch(e=>{if("aborted"===this.status)throw"aborted";throw this.status="error",e})}abort(){const e=this.status;this.status="aborted",this._filePromiseWrapper.isFulfilled?"reading"==e?this._reader.abort():"uploading"==e&&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(e){const t={};return t.promise=new Promise((i,n)=>{t.rejecter=n,t.isFulfilled=!1,e.then(e=>{t.isFulfilled=!0,i(e)}).catch(e=>{t.isFulfilled=!0,n(e)})}),t}}class Pf{loader;options;xhr;constructor(e,t){this.loader=e,this.options=t}upload(){return this.loader.file.then(e=>new Promise((t,i)=>{this._initRequest(),this._initListeners(t,i,e),this._sendRequest(e)}))}abort(){this.xhr&&this.xhr.abort()}_initRequest(){const e=this.xhr=new XMLHttpRequest;e.open("POST",this.options.uploadUrl,!0),e.responseType="json"}_initListeners(e,t,i){const n=this.xhr,o=this.loader,r=`Couldn't upload file: ${i.name}.`;n.addEventListener("error",()=>t(r)),n.addEventListener("abort",()=>t()),n.addEventListener("load",()=>{const i=n.response;if(!i||i.error)return t(i&&i.error&&i.error.message?i.error.message:r);const o=i.url?{default:i.url}:i.urls;e({...i,urls:o})}),n.upload&&n.upload.addEventListener("progress",e=>{e.lengthComputable&&(o.uploadTotal=e.total,o.uploaded=e.loaded)})}_sendRequest(e){let t=this.options.headers||{};"function"==typeof t&&(t=t(e));const i=this.options.withCredentials||!1;for(const e of Object.keys(t))this.xhr.setRequestHeader(e,t[e]);this.xhr.withCredentials=i;const n=new FormData;n.append("upload",e),this.xhr.send(n)}}const Mf="ckCsrfToken",Of="abcdefghijklmnopqrstuvwxyz0123456789";function Rf(){let e=function(e){e=e.toLowerCase();const t=document.cookie.split(";");for(const i of t){const t=i.split("=");if(decodeURIComponent(t[0].trim().toLowerCase())===e)return decodeURIComponent(t[1])}return null}(Mf);var t,i;return e&&40==e.length||(e=function(e){let t="";const i=new Uint8Array(e);window.crypto.getRandomValues(i);for(let e=0;e<i.length;e++){const n=Of.charAt(i[e]%36);t+=Math.random()>.5?n.toUpperCase():n}return t}(40),t=Mf,i=e,document.cookie=encodeURIComponent(t)+"="+encodeURIComponent(i)+";path=/"),e}class Nf{loader;url;t;xhr;constructor(e,t,i){this.loader=e,this.url=t,this.t=i}upload(){return this.loader.file.then(e=>new Promise((t,i)=>{this._initRequest(),this._initListeners(t,i,e),this._sendRequest(e)}))}abort(){this.xhr&&this.xhr.abort()}_initRequest(){const e=this.xhr=new XMLHttpRequest;e.open("POST",this.url,!0),e.responseType="json"}_initListeners(e,t,i){const n=this.xhr,o=this.loader,r=(0,this.t)("Cannot upload file:")+` ${i.name}.`;n.addEventListener("error",()=>t(r)),n.addEventListener("abort",()=>t()),n.addEventListener("load",()=>{const i=n.response;if(!i||!i.uploaded)return t(i&&i.error&&i.error.message?i.error.message:r);e({default:i.url})}),n.upload&&n.upload.addEventListener("progress",e=>{e.lengthComputable&&(o.uploadTotal=e.total,o.uploaded=e.loaded)})}_sendRequest(e){const t=new FormData;t.append("upload",e),t.append("ckCsrfToken",Rf()),this.xhr.send(t)}}function Vf(e,t,i,n){let o,r=null;"function"==typeof n?o=n:(r=e.commands.get(n),o=()=>{e.execute(n)}),e.model.document.on("change:data",(s,a)=>{if(r&&!r.isEnabled||!t.isEnabled)return;const l=Jt(e.model.document.selection.getRanges());if(!l.isCollapsed)return;if(a.isUndo||!a.isLocal)return;const c=Array.from(e.model.document.differ.getChanges()),d=c[0];if(1!=c.length||"insert"!==d.type||"$text"!=d.name||1!=d.length)return;const u=d.position.parent;if(u.is("element","codeBlock"))return;if(u.is("element","listItem")&&"function"!=typeof n&&!["numberedList","bulletedList","todoList"].includes(n))return;if(r&&!0===r.value)return;const h=u.getChild(0),m=e.model.createRangeOn(h);if(!m.containsRange(l)&&!l.end.isEqual(m.end))return;const g=i.exec(h.data.substr(0,l.end.offset));g&&e.model.enqueueChange(t=>{const i=e.model.document.selection,n=t.createPositionAt(u,0),r=t.createPositionAt(u,g[0].length),s=new La(n,r);if(!1!==o({match:g})){const e=Array.from(i.getAttributes());t.remove(s);const n=i.getFirstRange(),o=t.createRangeIn(u);!u.isEmpty||o.isEqual(n)||o.containsRange(n,!0)||t.remove(u),function(e,t,i){const n=e.model.schema,o=t.getFirstPosition();let r=new Al(o);n.checkChild(r,"$text")&&(r=r.push("$text"));for(const[t,o]of i)n.checkAttribute(r,t)&&e.setSelectionAttribute(t,o)}(t,i,e)}s.detach(),e.model.enqueueChange(()=>{e.plugins.get("Delete").requestUndoOnBackspace()})})})}function Lf(e,t,i,n){let o,r;i instanceof RegExp?o=i:r=i,r=r||(e=>{let t;const i=[],n=[];for(;null!==(t=o.exec(e))&&!(t&&t.length<4);){let{index:e,1:o,2:r,3:s}=t;const a=o+r+s;e+=t[0].length-a.length;const l=[e,e+o.length],c=[e+o.length+r.length,e+o.length+r.length+s.length];i.push(l),i.push(c),n.push([e+o.length,e+o.length+r.length])}return{remove:i,format:n}}),e.model.document.on("change:data",(i,o)=>{if(o.isUndo||!o.isLocal||!t.isEnabled)return;const s=e.model,a=s.document.selection;if(!a.isCollapsed)return;const l=Array.from(s.document.differ.getChanges()),c=l[0];if(1!=l.length||"insert"!==c.type||"$text"!=c.name||1!=c.length)return;const d=a.focus,u=d.parent,{text:h,range:m}=function(e,t){let i=e.start;const n=Array.from(e.getItems()).reduce((e,n)=>!n.is("$text")&&!n.is("$textProxy")||n.getAttribute("code")?(i=t.createPositionAfter(n),""):e+n.data,"");return{text:n,range:t.createRange(i,e.end)}}(s.createRange(s.createPositionAt(u,0),d),s),g=r(h),f=Df(m.start,g.format,s),p=Df(m.start,g.remove,s);f.length&&p.length&&s.enqueueChange(t=>{if(!1!==n(t,f)){for(const e of p.reverse())t.remove(e);s.enqueueChange(()=>{e.plugins.get("Delete").requestUndoOnBackspace()})}})})}function Df(e,t,i){return t.filter(e=>void 0!==e[0]&&void 0!==e[1]).map(t=>i.createRange(e.getShiftedBy(t[0]),e.getShiftedBy(t[1])))}function Bf(e,t){return(i,n)=>{if(!e.commands.get(t).isEnabled)return!1;const o=e.model.schema.getValidRanges(n,t);for(const e of o)i.setAttribute(t,!0,e);i.removeSelectionAttribute(t)}}class zf extends Xu{attributeKey;constructor(e,t){super(e),this.attributeKey=t}refresh(){const e=this.editor.model,t=e.document;this.value=this._getValueFromFirstAllowedNode(),this.isEnabled=e.schema.checkAttributeInSelection(t.selection,this.attributeKey)}execute(e={}){const t=this.editor.model,i=t.document.selection,n=void 0===e.forceValue?!this.value:e.forceValue;t.change(e=>{if(i.isCollapsed)n?e.setSelectionAttribute(this.attributeKey,!0):e.removeSelectionAttribute(this.attributeKey);else{const o=t.schema.getValidRanges(i.getRanges(),this.attributeKey);for(const t of o)n?e.setAttribute(this.attributeKey,n,t):e.removeAttribute(this.attributeKey,t)}})}_getValueFromFirstAllowedNode(){const e=this.editor.model,t=e.schema,i=e.document.selection;if(i.isCollapsed)return i.hasAttribute(this.attributeKey);for(const e of i.getRanges())for(const i of e.getItems())if(t.checkAttribute(i,this.attributeKey))return i.hasAttribute(this.attributeKey);return!1}}const Ff="bold";class jf extends Qu{static get pluginName(){return"BoldEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=this.editor.t;e.model.schema.extend("$text",{allowAttributes:Ff}),e.model.schema.setAttributeProperties(Ff,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:Ff,view:"strong",upcastAlso:["b",e=>{const t=e.getStyle("font-weight");return t&&("bold"==t||Number(t)>=600)?{name:!0,styles:["font-weight"]}:null}]}),e.commands.add(Ff,new zf(e,Ff)),e.keystrokes.set("CTRL+B",Ff),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Bold text"),keystroke:"CTRL+B"}]})}}function Uf({editor:e,commandName:t,plugin:i,icon:n,label:o,keystroke:r}){return s=>{const a=e.commands.get(t),l=new s(e.locale);return l.set({label:o,icon:n,keystroke:r,isToggleable:!0}),l.bind("isEnabled").to(a,"isEnabled"),l.bind("isOn").to(a,"value"),l instanceof Lu?l.set({role:"menuitemcheckbox"}):l.set({tooltip:!0}),i.listenTo(l,"execute",()=>{e.execute(t),e.editing.view.focus()}),l}}const Hf="bold";class Wf extends Qu{static get pluginName(){return"BoldUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.locale.t,i=Uf({editor:e,commandName:Hf,plugin:this,icon:gu,label:t("Bold"),keystroke:"CTRL+B"});e.ui.componentFactory.add(Hf,()=>i(lo)),e.ui.componentFactory.add("menuBar:"+Hf,()=>i(Lu))}}const $f="italic";class qf extends Qu{static get pluginName(){return"ItalicEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=this.editor.t;e.model.schema.extend("$text",{allowAttributes:$f}),e.model.schema.setAttributeProperties($f,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:$f,view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]}),e.commands.add($f,new zf(e,$f)),e.keystrokes.set("CTRL+I",$f),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Italic text"),keystroke:"CTRL+I"}]})}}const Kf="italic";class Gf extends Qu{static get pluginName(){return"ItalicUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.locale.t,i=Uf({editor:e,commandName:Kf,plugin:this,icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="m9.586 14.633.021.004q-.054.502.393.962.123.125.274.201h1.474a.6.6 0 1 1 0 1.2H5.304a.6.6 0 0 1 0-1.2h1.15q.711-.106 1.005-.334.235-.182.404-.597l2.416-9.55a1.05 1.05 0 0 0-.281-.823 1.1 1.1 0 0 0-.442-.296H8.15a.6.6 0 0 1 0-1.2h6.443a.6.6 0 1 1 0 1.2h-1.195q-.564.084-.823.296-.323.263-.623.79z"/></svg>',keystroke:"CTRL+I",label:t("Italic")});e.ui.componentFactory.add(Kf,()=>i(lo)),e.ui.componentFactory.add("menuBar:"+Kf,()=>i(Lu))}}class Yf extends Xu{refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor.model,i=t.schema,n=t.document.selection,o=Array.from(n.getSelectedBlocks()),r=void 0===e.forceValue?!this.value:e.forceValue;t.change(e=>{if(r){const t=o.filter(e=>Jf(e)||Zf(i,e));this._applyQuote(e,t)}else this._removeQuote(e,o.filter(Jf))})}_getValue(){const e=Jt(this.editor.model.document.selection.getSelectedBlocks());return!(!e||!Jf(e))}_checkEnabled(){if(this.value)return!0;const e=this.editor.model.document.selection,t=this.editor.model.schema,i=Jt(e.getSelectedBlocks());return!!i&&Zf(t,i)}_removeQuote(e,t){Qf(e,t).reverse().forEach(t=>{if(t.start.isAtStart&&t.end.isAtEnd)return void e.unwrap(t.start.parent);if(t.start.isAtStart){const i=e.createPositionBefore(t.start.parent);return void e.move(t,i)}t.end.isAtEnd||e.split(t.end);const i=e.createPositionAfter(t.end.parent);e.move(t,i)})}_applyQuote(e,t){const i=[];Qf(e,t).reverse().forEach(t=>{let n=Jf(t.start);n||(n=e.createElement("blockQuote"),e.wrap(t,n)),i.push(n)}),i.reverse().reduce((t,i)=>t.nextSibling==i?(e.merge(e.createPositionAfter(t)),t):i)}}function Jf(e){return"blockQuote"==e.parent.name?e.parent:null}function Qf(e,t){let i,n=0;const o=[];for(;n<t.length;){const r=t[n],s=t[n+1];i||(i=e.createPositionBefore(r)),s&&r.nextSibling==s||(o.push(e.createRange(i,e.createPositionAfter(r))),i=null),n++}return o}function Zf(e,t){const i=e.checkChild(t.parent,"blockQuote"),n=e.checkChild(["$root","blockQuote"],t);return i&&n}class Xf extends Qu{static get pluginName(){return"BlockQuoteEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[Dm,um]}init(){const e=this.editor,t=e.model.schema;e.commands.add("blockQuote",new Yf(e)),t.register("blockQuote",{inheritAllFrom:"$container"}),e.conversion.elementToElement({model:"blockQuote",view:"blockquote"}),e.model.document.registerPostFixer(i=>{const n=e.model.document.differ.getChanges();for(const e of n)if("insert"==e.type){const n=e.position.nodeAfter;if(!n)continue;if(n.is("element","blockQuote")&&n.isEmpty)return i.remove(n),!0;if(n.is("element","blockQuote")&&!t.checkChild(e.position,n))return i.unwrap(n),!0;if(n.is("element")){const e=i.createRangeIn(n);for(const n of e.getItems())if(n.is("element","blockQuote")&&!t.checkChild(i.createPositionBefore(n),n))return i.unwrap(n),!0}}else if("remove"==e.type){const t=e.position.parent;if(t.is("element","blockQuote")&&t.isEmpty)return i.remove(t),!0}return!1});const i=this.editor.editing.view.document,n=e.model.document.selection,o=e.commands.get("blockQuote");this.listenTo(i,"enter",(t,i)=>{if(!n.isCollapsed||!o.value)return;n.getLastPosition().parent.isEmpty&&(e.execute("blockQuote"),e.editing.view.scrollToTheSelection(),i.preventDefault(),t.stop())},{context:"blockquote"}),this.listenTo(i,"delete",(t,i)=>{if("backward"!=i.direction||!n.isCollapsed||!o.value)return;const r=n.getLastPosition().parent;r.isEmpty&&!r.previousSibling&&(e.execute("blockQuote"),e.editing.view.scrollToTheSelection(),i.preventDefault(),t.stop())},{context:"blockquote"})}}var ep=i(1501),tp={attributes:{"data-cke":!0}};tp.setAttributes=Ki(),tp.insert=$i().bind(null,"head"),tp.domAPI=Hi(),tp.insertStyleElement=Yi();ji()(ep.A,tp);ep.A&&ep.A.locals&&ep.A.locals;class ip extends Qu{static get pluginName(){return"BlockQuoteUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.ui.componentFactory.add("blockQuote",()=>{const e=this._createButton(lo);return e.set({tooltip:!0}),e}),e.ui.componentFactory.add("menuBar:blockQuote",()=>{const e=this._createButton(Lu);return e.set({role:"menuitemcheckbox"}),e})}_createButton(e){const t=this.editor,i=t.locale,n=t.commands.get("blockQuote"),o=new e(t.locale),r=i.t;return o.set({label:r("Block quote"),icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M3 10.423a6.5 6.5 0 0 1 6.056-6.408l.038.67C6.448 5.423 5.354 7.663 5.22 10H9c.552 0 .5.432.5.986v4.511c0 .554-.448.503-1 .503h-5c-.552 0-.5-.449-.5-1.003zm8 0a6.5 6.5 0 0 1 6.056-6.408l.038.67c-2.646.739-3.74 2.979-3.873 5.315H17c.552 0 .5.432.5.986v4.511c0 .554-.448.503-1 .503h-5c-.552 0-.5-.449-.5-1.003z"/></svg>',isToggleable:!0}),o.bind("isEnabled").to(n,"isEnabled"),o.bind("isOn").to(n,"value"),this.listenTo(o,"execute",()=>{t.execute("blockQuote"),t.editing.view.focus()}),o}}const np='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M17.5 9.303V8h-13v8.5h4.341c.191.54.457 1.044.785 1.5H2a1.5 1.5 0 0 1-1.5-1.5v-13A1.5 1.5 0 0 1 2 2h4.5a1.5 1.5 0 0 1 1.06.44L9.122 4H16a1.5 1.5 0 0 1 1.5 1.5v1A1.5 1.5 0 0 1 19 8v2.531a6 6 0 0 0-1.5-1.228M16 6.5v-1H8.5l-2-2H2v13h1V8a1.5 1.5 0 0 1 1.5-1.5z"/><path d="M14.5 19.5a5 5 0 1 1 0-10 5 5 0 0 1 0 10M15 14v-2h-1v2h-2v1h2v2h1v-2h2v-1z"/></svg>',op='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M1.201 1c-.662 0-1.2.47-1.2 1.1v14.248c0 .64.533 1.152 1.185 1.152h6.623v-7.236L6.617 9.15a.694.694 0 0 0-.957-.033L1.602 13.55V2.553l14.798.003V9.7H18V2.1c0-.63-.547-1.1-1.2-1.1zm11.723 2.805a2.1 2.1 0 0 0-1.621.832 2.127 2.127 0 0 0 1.136 3.357 2.13 2.13 0 0 0 2.611-1.506 2.13 2.13 0 0 0-.76-2.244 2.13 2.13 0 0 0-1.366-.44Z"/><path d="M19.898 12.369v6.187a.844.844 0 0 1-.844.844h-8.719a.844.844 0 0 1-.843-.844v-7.312a.844.844 0 0 1 .843-.844h2.531a.84.84 0 0 1 .597.248l.838.852h4.75c.223 0 .441.114.6.272a.84.84 0 0 1 .247.597m-1.52.654-4.377.02-1.1-1.143H11v6h7.4l-.023-4.877Z" clip-rule="evenodd"/></svg>';class rp extends Qu{static get pluginName(){return"CKFinderUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.ui.componentFactory.add("ckfinder",()=>this._createFileToolbarButton()),e.ui.componentFactory.add("menuBar:ckfinder",()=>this._createFileMenuBarButton()),e.plugins.has("ImageInsertUI")&&e.plugins.get("ImageInsertUI").registerIntegration({name:"assetManager",observable:()=>e.commands.get("ckfinder"),buttonViewCreator:()=>this._createImageToolbarButton(),formViewCreator:()=>this._createImageDropdownButton(),menuBarButtonViewCreator:e=>this._createImageMenuBarButton(e?"insertOnly":"insertNested")})}_createButton(e){const t=this.editor,i=new e(t.locale),n=t.commands.get("ckfinder");return i.bind("isEnabled").to(n),i.on("execute",()=>{t.execute("ckfinder"),t.editing.view.focus()}),i}_createFileToolbarButton(){const e=this.editor.locale.t,t=this._createButton(lo);return t.icon=np,t.label=e("Insert image or file"),t.tooltip=!0,t}_createImageToolbarButton(){const e=this.editor.locale.t,t=this.editor.plugins.get("ImageInsertUI"),i=this._createButton(lo);return i.icon=op,i.bind("label").to(t,"isImageSelected",t=>e(t?"Replace image with file manager":"Insert image with file manager")),i.tooltip=!0,i}_createImageDropdownButton(){const e=this.editor.locale.t,t=this.editor.plugins.get("ImageInsertUI"),i=this._createButton(lo);return i.icon=op,i.withText=!0,i.bind("label").to(t,"isImageSelected",t=>e(t?"Replace with file manager":"Insert with file manager")),i.on("execute",()=>{t.dropdownView.isOpen=!1}),i}_createFileMenuBarButton(){const e=this.editor.locale.t,t=this._createButton(Lu);return t.icon=np,t.withText=!0,t.label=e("File"),t}_createImageMenuBarButton(e){const t=this.editor.locale.t,i=this.editor.locale.t,n=this._createButton(Lu);switch(n.icon=op,n.withText=!0,e){case"insertOnly":n.label=t("Image");break;case"insertNested":n.label=i("With file manager")}return n}}class sp extends rh{static get pluginName(){return"Notification"}static get isOfficialPlugin(){return!0}init(){this.on("show:warning",(e,t)=>{window.alert(t.message)},{priority:"lowest"})}showSuccess(e,t={}){this._showNotification({message:e,type:"success",namespace:t.namespace,title:t.title})}showInfo(e,t={}){this._showNotification({message:e,type:"info",namespace:t.namespace,title:t.title})}showWarning(e,t={}){this._showNotification({message:e,type:"warning",namespace:t.namespace,title:t.title})}_showNotification(e){const t=e.namespace?`show:${e.type}:${e.namespace}`:`show:${e.type}`;this.fire(t,{message:e.message,type:e.type,title:e.title||""})}}class ap extends Xu{constructor(e){super(e),this.affectsData=!1,this.stopListening(this.editor.model.document,"change"),this.listenTo(this.editor.model.document,"change",()=>this.refresh(),{priority:"low"})}refresh(){const e=this.editor.commands.get("insertImage"),t=this.editor.commands.get("link");this.isEnabled=e.isEnabled||t.isEnabled}execute(){const e=this.editor,t=this.editor.config.get("ckfinder.openerMethod")||"modal";if("popup"!=t&&"modal"!=t)throw new A("ckfinder-unknown-openermethod",e);const i=this.editor.config.get("ckfinder.options")||{};i.chooseFiles=!0;const n=i.onInit;i.language||(i.language=e.locale.uiLanguage),i.onInit=t=>{n&&n(t),t.on("files:choose",i=>{const n=i.data.files.toArray(),o=n.filter(e=>!e.isImage()),r=n.filter(e=>e.isImage());for(const t of o)e.execute("link",t.getUrl());const s=[];for(const e of r){const i=e.getUrl();s.push(i||t.request("file:getProxyUrl",{file:e}))}s.length&&lp(e,s)}),t.on("file:choose:resizedImage",t=>{const i=t.data.resizedUrl;if(!i){const t=e.plugins.get("Notification"),i=e.locale.t;return void t.showWarning(i("Could not obtain resized image URL."),{title:i("Selecting resized image failed"),namespace:"ckfinder"})}lp(e,[i])})},window.CKFinder[t](i)}}function lp(e,t){if(!e.commands.get("insertImage").isEnabled){const t=e.plugins.get("Notification"),i=e.locale.t;return void t.showWarning(i("Could not insert image at the current position."),{title:i("Inserting image failed"),namespace:"ckfinder"})}e.execute("insertImage",{source:t})}class cp extends Qu{static get pluginName(){return"CKFinderEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[sp,"LinkEditing"]}init(){const e=this.editor;if(!e.plugins.has("ImageBlockEditing")&&!e.plugins.has("ImageInlineEditing"))throw new A("ckfinder-missing-image-plugin",e);e.commands.add("ckfinder",new ap(e))}}class dp extends Qu{_uploadGateway;static get pluginName(){return"CloudServicesUploadAdapter"}static get isOfficialPlugin(){return!0}static get requires(){return["CloudServices",If]}init(){const e=this.editor,t=e.plugins.get("CloudServices"),i=t.token,n=t.uploadUrl;if(!i)return;const o=e.plugins.get("CloudServicesCore");this._uploadGateway=o.createUploadGateway(i,n),e.plugins.get(If).createUploadAdapter=e=>new up(this._uploadGateway,e)}}class up{uploadGateway;loader;fileUploader;constructor(e,t){this.uploadGateway=e,this.loader=t}upload(){return this.loader.file.then(e=>(this.fileUploader=this.uploadGateway.upload(e),this.fileUploader.on("progress",(e,t)=>{this.loader.uploadTotal=t.total,this.loader.uploaded=t.uploaded}),this.fileUploader.send()))}abort(){this.fileUploader.abort()}}class hp extends Xu{constructor(e){super(e),this._isEnabledBasedOnSelection=!1}refresh(){const e=this.editor.model,t=Jt(e.document.selection.getSelectedBlocks());this.value=!!t&&t.is("element","paragraph"),this.isEnabled=!!t&&mp(t,e.schema)}execute(e={}){const t=this.editor.model,i=t.document,n=e.selection||i.selection;t.canEditAt(n)&&t.change(e=>{const i=n.getSelectedBlocks();for(const n of i)!n.is("element","paragraph")&&mp(n,t.schema)&&e.rename(n,"paragraph")})}}function mp(e,t){return t.checkChild(e.parent,"paragraph")&&!t.isObject(e)}class gp extends Xu{constructor(e){super(e),this._isEnabledBasedOnSelection=!1}execute(e){const t=this.editor.model,i=e.attributes;let n=e.position;return t.canEditAt(n)?t.change(e=>{if(n=this._findPositionToInsertParagraph(n,e),!n)return null;const o=e.createElement("paragraph");return i&&t.schema.setAllowedAttributes(o,i,e),t.insertContent(o,n),e.setSelection(o,"in"),e.createPositionAt(o,0)}):null}_findPositionToInsertParagraph(e,t){const i=this.editor.model;if(i.schema.checkChild(e,"paragraph"))return e;const n=i.schema.findAllowedParent(e,"paragraph");if(!n)return null;const o=e.parent,r=i.schema.checkChild(o,"$text");return o.isEmpty||r&&e.isAtEnd?i.createPositionAfter(o):!o.isEmpty&&r&&e.isAtStart?i.createPositionBefore(o):t.split(e,n).position}}class fp extends Qu{static get pluginName(){return"Paragraph"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.model;e.commands.add("paragraph",new hp(e)),e.commands.add("insertParagraph",new gp(e)),t.schema.register("paragraph",{inheritAllFrom:"$block"}),e.conversion.elementToElement({model:"paragraph",view:"p"}),e.conversion.for("upcast").elementToElement({model:(e,{writer:t})=>fp.paragraphLikeElements.has(e.name)?e.isEmpty?null:t.createElement("paragraph"):null,view:/.+/,converterPriority:"low"})}static paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td","th"])}class pp extends Xu{modelElements;constructor(e,t){super(e),this.modelElements=t}refresh(){const e=Jt(this.editor.model.document.selection.getSelectedBlocks());this.value=!!e&&this.modelElements.includes(e.name)&&e.name,this.isEnabled=!!e&&this.modelElements.some(t=>bp(e,t,this.editor.model.schema))}execute(e){const t=this.editor.model,i=t.document,n=e.value;t.change(e=>{const o=Array.from(i.selection.getSelectedBlocks()).filter(e=>bp(e,n,t.schema));for(const t of o)t.is("element",n)||e.rename(t,n)})}}function bp(e,t,i){return i.checkChild(e.parent,t)&&!i.isObject(e)}const kp="paragraph";class wp extends Qu{static get pluginName(){return"HeadingEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define("heading",{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h2",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h3",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h4",title:"Heading 3",class:"ck-heading_heading3"}]})}static get requires(){return[fp]}init(){const e=this.editor,t=e.config.get("heading.options"),i=[];for(const n of t)"paragraph"!==n.model&&(e.model.schema.register(n.model,{inheritAllFrom:"$block"}),e.conversion.elementToElement(n),i.push(n.model));this._addDefaultH1Conversion(e),e.commands.add("heading",new pp(e,i))}afterInit(){const e=this.editor,t=e.commands.get("enter"),i=e.config.get("heading.options");t&&this.listenTo(t,"afterExecute",(t,n)=>{const o=e.model.document.selection.getFirstPosition().parent;i.some(e=>o.is("element",e.model))&&!o.is("element",kp)&&0===o.childCount&&n.writer.rename(o,kp)})}_addDefaultH1Conversion(e){e.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:v.low+1})}}class _p extends(K()){constructor(e,t){super(),t&&js(this,t),e&&this.set(e)}}var vp=i(6186),yp={attributes:{"data-cke":!0}};yp.setAttributes=Ki(),yp.insert=$i().bind(null,"head"),yp.domAPI=Hi(),yp.insertStyleElement=Yi();ji()(vp.A,yp);vp.A&&vp.A.locals&&vp.A.locals;class Ap extends Qu{static get pluginName(){return"HeadingUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.t,i=function(e){const t=e.t,i={Paragraph:t("Paragraph"),"Heading 1":t("Heading 1"),"Heading 2":t("Heading 2"),"Heading 3":t("Heading 3"),"Heading 4":t("Heading 4"),"Heading 5":t("Heading 5"),"Heading 6":t("Heading 6")};return e.config.get("heading.options").map(e=>{const t=i[e.title];return t&&t!=e.title&&(e.title=t),e})}(e),n=t("Choose heading"),o=t("Heading");e.ui.componentFactory.add("heading",t=>{const r={},s=new Yt,a=e.commands.get("heading"),l=e.commands.get("paragraph"),c=[a];for(const e of i){const t={type:"button",model:new _p({label:e.title,class:e.class,role:"menuitemradio",withText:!0})};"paragraph"===e.model?(t.model.bind("isOn").to(l,"value"),t.model.set("commandName","paragraph"),c.push(l)):(t.model.bind("isOn").to(a,"value",t=>t===e.model),t.model.set({commandName:"heading",commandValue:e.model})),s.add(t),r[e.model]=e.title}const d=su(t);return cu(d,s,{ariaLabel:o,role:"menu"}),d.buttonView.set({ariaLabel:o,ariaLabelledBy:void 0,isOn:!1,withText:!0,tooltip:o}),d.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),d.bind("isEnabled").toMany(c,"isEnabled",(...e)=>e.some(e=>e)),d.buttonView.bind("label").to(a,"value",l,"value",(e,t)=>{const i=t?"paragraph":e;return"boolean"==typeof i?n:r[i]?r[i]:n}),d.buttonView.bind("ariaLabel").to(a,"value",l,"value",(e,t)=>{const i=t?"paragraph":e;return"boolean"==typeof i?o:r[i]?`${r[i]}, ${o}`:o}),this.listenTo(d,"execute",t=>{const{commandName:i,commandValue:n}=t.source;e.execute(i,n?{value:n}:void 0),e.editing.view.focus()}),d}),e.ui.componentFactory.add("menuBar:heading",n=>{const o=new Mu(n),r=e.commands.get("heading"),s=e.commands.get("paragraph"),a=[r],l=new Ou(n);o.set({class:"ck-heading-dropdown"}),l.set({ariaLabel:t("Heading"),role:"menu"}),o.buttonView.set({label:t("Heading")}),o.panelView.children.add(l);for(const t of i){const i=new Nn(n,o),c=new Lu(n);i.children.add(c),l.items.add(i),c.set({isToggleable:!0,label:t.title,role:"menuitemradio",class:t.class}),c.delegate("execute").to(o),c.on("execute",()=>{const i="paragraph"===t.model?"paragraph":"heading";e.execute(i,{value:t.model}),e.editing.view.focus()}),"paragraph"===t.model?(c.bind("isOn").to(s,"value"),a.push(s)):c.bind("isOn").to(r,"value",e=>e===t.model)}return o.bind("isEnabled").toMany(a,"isEnabled",(...e)=>e.some(e=>e)),o})}}function xp(e){return e.createContainerElement("figure",{class:"image"},[e.createEmptyElement("img"),e.createSlot("children")])}function Cp(e,t){const i=e.plugins.get("ImageUtils"),n=e.plugins.has("ImageInlineEditing")&&e.plugins.has("ImageBlockEditing");return e=>{if(!i.isInlineImageView(e))return null;if(!n)return o(e);return("block"==e.getStyle("display")||e.findAncestor(i.isBlockImageView)?"imageBlock":"imageInline")!==t?null:o(e)};function o(e){const t={name:!0};return e.hasAttribute("src")&&(t.attributes=["src"]),t}}function Tp(e,t){const i=Jt(t.getSelectedBlocks());return!i||e.isObject(i)||i.isEmpty&&"listItem"!=i.name?"imageBlock":"imageInline"}function Ep(e){return e&&e.endsWith("px")?parseInt(e):null}function Ip(e){const t=Ep(e.getStyle("width")),i=Ep(e.getStyle("height"));return!(!t||!i)}const Sp=/^(image|image-inline)$/;class Pp extends Qu{_domEmitter=new(He());static get pluginName(){return"ImageUtils"}static get isOfficialPlugin(){return!0}isImage(e){return this.isInlineImage(e)||this.isBlockImage(e)}isInlineImageView(e){return!!e&&e.is("element","img")}isBlockImageView(e){return!!e&&e.is("element","figure")&&e.hasClass("image")}insertImage(e={},t=null,i=null,n={}){const o=this.editor,r=o.model,s=r.document.selection,a=Mp(o,t||s,i);e={...Object.fromEntries(s.getAttributes()),...e};for(const t in e)r.schema.checkAttribute(a,t)||delete e[t];return r.change(i=>{const{setImageSizes:o=!0}=n,s=i.createElement(a,e);return r.insertObject(s,t,null,{setSelection:"on",findOptimalPosition:t||"imageInline"==a?void 0:"auto"}),s.parent?(o&&this.setImageNaturalSizeAttributes(s),s):null})}setImageNaturalSizeAttributes(t){const i=t.getAttribute("src");i&&(t.getAttribute("width")||t.getAttribute("height")||this.editor.model.change(n=>{const o=new e.window.Image;this._domEmitter.listenTo(o,"load",()=>{t.getAttribute("width")||t.getAttribute("height")||this.editor.model.enqueueChange(n.batch,e=>{e.setAttribute("width",o.naturalWidth,t),e.setAttribute("height",o.naturalHeight,t)}),this._domEmitter.stopListening(o,"load")}),o.src=i}))}getClosestSelectedImageWidget(e){const t=e.getFirstPosition();if(!t)return null;const i=e.getSelectedElement();if(i&&this.isImageWidget(i))return i;let n=t.parent;for(;n;){if(n.is("element")&&this.isImageWidget(n))return n;n=n.parent}return null}getClosestSelectedImageElement(e){const t=e.getSelectedElement();return this.isImage(t)?t:e.getFirstPosition().findAncestor("imageBlock")}getImageWidgetFromImageView(e){return e.findAncestor({classes:Sp})}isImageAllowed(){const e=this.editor.model.document.selection;return function(e,t){const i=Mp(e,t,null);if("imageBlock"==i){const i=function(e,t){const i=eg(e,t),n=i.start.parent;if(n.isEmpty&&!n.is("element","$root"))return n.parent;return n}(t,e.model);if(e.model.schema.checkChild(i,"imageBlock"))return!0}else if(e.model.schema.checkChild(t.focus,"imageInline"))return!0;return!1}(this.editor,e)&&function(e){return[...e.focus.getAncestors()].every(e=>!e.is("element","imageBlock"))}(e)}toImageWidget(e,t,i){t.setCustomProperty("image",!0,e);return Ym(e,t,{label:()=>{const t=this.findViewImgElement(e).getAttribute("alt");return t?`${t} ${i}`:i}})}isImageWidget(e){return!!e.getCustomProperty("image")&&Gm(e)}isBlockImage(e){return!!e&&e.is("element","imageBlock")}isInlineImage(e){return!!e&&e.is("element","imageInline")}findViewImgElement(e){if(this.isInlineImageView(e))return e;const t=this.editor.editing.view;for(const{item:i}of t.createRangeIn(e))if(this.isInlineImageView(i))return i}destroy(){return this._domEmitter.stopListening(),super.destroy()}}function Mp(e,t,i){const n=e.model.schema,o=e.config.get("image.insert.type");return e.plugins.has("ImageBlockEditing")?e.plugins.has("ImageInlineEditing")?i||("inline"===o?"imageInline":"auto"!==o?"imageBlock":t.is("selection")?Tp(n,t):n.checkChild(t,"imageInline")?"imageInline":"imageBlock"):"imageBlock":"imageInline"}const Op=new RegExp(String(/^(http(s)?:\/\/)?[\w-]+\.[\w.~:/[\]@!$&'()*+,;=%-]+/.source+/\.(jpg|jpeg|png|gif|ico|webp|JPG|JPEG|PNG|GIF|ICO|WEBP)/.source+/(\?[\w.~:/[\]@!$&'()*+,;=%-]*)?/.source+/(#[\w.~:/[\]@!$&'()*+,;=%-]*)?$/.source));class Rp extends Xu{refresh(){const e=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!e,this.isEnabled&&e.hasAttribute("alt")?this.value=e.getAttribute("alt"):this.value=!1}execute(e){const t=this.editor,i=t.plugins.get("ImageUtils"),n=t.model,o=i.getClosestSelectedImageElement(n.document.selection);n.change(t=>{t.setAttribute("alt",e.newValue,o)})}}class Np extends Qu{static get requires(){return[Pp]}static get pluginName(){return"ImageTextAlternativeEditing"}static get isOfficialPlugin(){return!0}init(){this.editor.commands.add("imageTextAlternative",new Rp(this.editor))}}function Vp(e){return class extends e{disableCssTransitions(){this._isCssTransitionsDisabled=!0}enableCssTransitions(){this._isCssTransitionsDisabled=!1}constructor(...e){super(...e),this.set("_isCssTransitionsDisabled",!1),this.initializeCssTransitionDisablerMixin()}initializeCssTransitionDisablerMixin(){this.template&&this.extendTemplate({attributes:{class:[this.bindTemplate.if("_isCssTransitionsDisabled","ck-transitions-disabled")]}})}}}var Lp=i(3790),Dp={attributes:{"data-cke":!0}};Dp.setAttributes=Ki(),Dp.insert=$i().bind(null,"head"),Dp.domAPI=Hi(),Dp.insertStyleElement=Yi();ji()(Lp.A,Dp);Lp.A&&Lp.A.locals&&Lp.A.locals;class Bp extends Zi{children;constructor(e,t={}){super(e);const i=this.bindTemplate;this.set("class",["ck","ck-form__row",...Dt(t.class||[])]),this.children=this.createCollection(),t.children&&t.children.forEach(e=>this.children.add(e)),this.set("_role",null),this.set("_ariaLabelledBy",null),t.labelView&&this.set({_role:"group",_ariaLabelledBy:t.labelView.id}),this.setTemplate({tag:"div",attributes:{class:i.to("class",e=>e.join(" ")),role:i.to("_role"),"aria-labelledby":i.to("_ariaLabelledBy")},children:this.children})}}function zp({view:e}){e.listenTo(e.element,"submit",(t,i)=>{i.preventDefault(),e.fire("submit")},{useCapture:!0})}var Fp=i(6365),jp={attributes:{"data-cke":!0}};jp.setAttributes=Ki(),jp.insert=$i().bind(null,"head"),jp.domAPI=Hi(),jp.insertStyleElement=Yi();ji()(Fp.A,jp);Fp.A&&Fp.A.locals&&Fp.A.locals;class Up extends Zi{fieldView;labelView;statusView;fieldWrapperChildren;constructor(e,t){super(e);const i=`ck-labeled-field-view-${_()}`,n=`ck-labeled-field-view-status-${_()}`;this.fieldView=t(this,i,n),this.set("label",void 0),this.set("isEnabled",!0),this.set("isEmpty",!0),this.set("isFocused",!1),this.set("errorText",null),this.set("infoText",null),this.set("class",void 0),this.set("placeholder",void 0),this.labelView=this._createLabelView(i),this.statusView=this._createStatusView(n),this.fieldWrapperChildren=this.createCollection([this.fieldView,this.labelView]),this.bind("_statusText").to(this,"errorText",this,"infoText",(e,t)=>e||t);const o=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view",o.to("class"),o.if("isEnabled","ck-disabled",e=>!e),o.if("isEmpty","ck-labeled-field-view_empty"),o.if("isFocused","ck-labeled-field-view_focused"),o.if("placeholder","ck-labeled-field-view_placeholder"),o.if("errorText","ck-error")]},children:[{tag:"div",attributes:{class:["ck","ck-labeled-field-view__input-wrapper"]},children:this.fieldWrapperChildren},this.statusView]})}_createLabelView(e){const t=new Td(this.locale);return t.for=e,t.bind("text").to(this,"label"),t}_createStatusView(e){const t=new Zi(this.locale),i=this.bindTemplate;return t.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view__status",i.if("errorText","ck-labeled-field-view__status_error"),i.if("_statusText","ck-hidden",e=>!e)],id:e,role:i.if("errorText","alert")},children:[{text:i.to("_statusText")}]}),t}focus(e){this.fieldView.focus(e)}}class Hp extends Zi{focusTracker;constructor(e){super(e),this.set("value",void 0),this.set("id",void 0),this.set("placeholder",void 0),this.set("tabIndex",void 0),this.set("isReadOnly",!1),this.set("hasError",!1),this.set("ariaDescribedById",void 0),this.set("ariaLabel",void 0),this.focusTracker=new Qt,this.bind("isFocused").to(this.focusTracker),this.set("isEmpty",!0);const t=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck","ck-input",t.if("isFocused","ck-input_focused"),t.if("isEmpty","ck-input-text_empty"),t.if("hasError","ck-error")],id:t.to("id"),placeholder:t.to("placeholder"),tabindex:t.to("tabIndex"),readonly:t.to("isReadOnly"),"aria-invalid":t.if("hasError",!0),"aria-describedby":t.to("ariaDescribedById"),"aria-label":t.to("ariaLabel")},on:{input:t.to((...e)=>{this.fire("input",...e),this._updateIsEmpty()}),change:t.to(this._updateIsEmpty.bind(this))}})}render(){super.render(),this.focusTracker.add(this.element),this._setDomElementValue(this.value),this._updateIsEmpty(),this.on("change:value",(e,t,i)=>{this._setDomElementValue(i),this._updateIsEmpty()})}destroy(){super.destroy(),this.focusTracker.destroy()}select(){this.element.select()}focus(){this.element.focus()}reset(){this.value=this.element.value="",this._updateIsEmpty()}_updateIsEmpty(){this.isEmpty=!this.element.value}_setDomElementValue(e){this.element.value=e||0===e?e:""}}var Wp=i(1546),$p={attributes:{"data-cke":!0}};$p.setAttributes=Ki(),$p.insert=$i().bind(null,"head"),$p.domAPI=Hi(),$p.insertStyleElement=Yi();ji()(Wp.A,$p);Wp.A&&Wp.A.locals&&Wp.A.locals;class qp extends Hp{constructor(e){super(e),this.set("inputMode","text");const t=this.bindTemplate;this.extendTemplate({attributes:{inputmode:t.to("inputMode")}})}}class Kp extends qp{constructor(e){super(e),this.extendTemplate({attributes:{type:"text",class:["ck-input-text"]}})}}class Gp extends qp{constructor(e,{min:t,max:i,step:n}={}){super(e);const o=this.bindTemplate;this.set("min",t),this.set("max",i),this.set("step",n),this.extendTemplate({attributes:{type:"number",class:["ck-input-number"],min:o.to("min"),max:o.to("max"),step:o.to("step")}})}}const Yp=(e,t,i)=>{const n=new Kp(e.locale);return n.set({id:t,ariaDescribedById:i}),n.bind("isReadOnly").to(e,"isEnabled",e=>!e),n.bind("hasError").to(e,"errorText",e=>!!e),n.on("input",()=>{e.errorText=null}),e.bind("isEmpty","isFocused","placeholder").to(n),n},Jp=(e,t,i)=>{const n=new Gp(e.locale);return n.set({id:t,ariaDescribedById:i,inputMode:"numeric"}),n.bind("isReadOnly").to(e,"isEnabled",e=>!e),n.bind("hasError").to(e,"errorText",e=>!!e),n.on("input",()=>{e.errorText=null}),e.bind("isEmpty","isFocused","placeholder").to(n),n};var Qp=i(8429),Zp={attributes:{"data-cke":!0}};Zp.setAttributes=Ki(),Zp.insert=$i().bind(null,"head"),Zp.domAPI=Hi(),Zp.insertStyleElement=Yi();ji()(Qp.A,Zp);Qp.A&&Qp.A.locals&&Qp.A.locals;var Xp=i(871),eb={attributes:{"data-cke":!0}};eb.setAttributes=Ki(),eb.insert=$i().bind(null,"head"),eb.domAPI=Hi(),eb.insertStyleElement=Yi();ji()(Xp.A,eb);Xp.A&&Xp.A.locals&&Xp.A.locals;var tb=i(9768),ib={attributes:{"data-cke":!0}};ib.setAttributes=Ki(),ib.insert=$i().bind(null,"head"),ib.domAPI=Hi(),ib.insertStyleElement=Yi();ji()(tb.A,ib);tb.A&&tb.A.locals&&tb.A.locals;class nb extends Zi{focusTracker;keystrokes;labeledInput;backButtonView;saveButtonView;children;_focusables;_focusCycler;constructor(e){super(e),this.focusTracker=new Qt,this.keystrokes=new ti,this.backButtonView=this._createBackButton(),this.saveButtonView=this._createSaveButton(),this.labeledInput=this._createLabeledInputView(),this.children=this.createCollection([this._createHeaderView()]),this.children.add(new Bp(e,{children:[this.labeledInput,this.saveButtonView],class:["ck-form__row_with-submit","ck-form__row_large-top-padding"]})),this._focusables=new pi,this.keystrokes.set("Esc",(e,t)=>{this.fire("cancel"),t()}),this._focusCycler=new uo({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-form","ck-text-alternative-form","ck-responsive-form"],tabindex:"-1"},children:this.children})}render(){super.render(),zp({view:this});[this.backButtonView,this.labeledInput,this.saveButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createBackButton(){const e=this.locale.t,t=new lo(this.locale);return t.set({class:"ck-button-back",label:e("Back"),icon:wg,tooltip:!0}),t.delegate("execute").to(this,"cancel"),t}_createSaveButton(){const e=this.locale.t,t=new lo(this.locale);return t.set({label:e("Save"),withText:!0,type:"submit",class:"ck-button-action ck-button-bold"}),t}_createHeaderView(){const e=this.locale.t,t=new oo(this.locale,{label:e("Text Alternative")});return t.children.add(this.backButtonView,0),t}_createLabeledInputView(){const e=this.locale.t,t=new Up(this.locale,Yp);return t.label=e("Text alternative"),t.class="ck-labeled-field-view_full-width",t}}function ob(e){const t=e.editing.view,i=on.defaultPositions,n=e.plugins.get("ImageUtils");return{target:t.domConverter.mapViewToDom(n.getClosestSelectedImageWidget(t.document.selection)),positions:[i.northArrowSouth,i.northArrowSouthWest,i.northArrowSouthEast,i.southArrowNorth,i.southArrowNorthWest,i.southArrowNorthEast,i.viewportStickyNorth]}}class rb extends Qu{_balloon;_form;static get requires(){return[Tg]}static get pluginName(){return"ImageTextAlternativeUI"}static get isOfficialPlugin(){return!0}init(){this._createButton()}destroy(){super.destroy(),this._form&&this._form.destroy()}_createButton(){const e=this.editor,t=e.t;e.ui.componentFactory.add("imageTextAlternative",i=>{const n=e.commands.get("imageTextAlternative"),o=new lo(i);return o.set({label:t("Change image text alternative"),icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M3.035 1C2.446 1 2 1.54 2 2.098V10.5h1.5v-8h13v8H18V2.098C18 1.539 17.48 1 16.9 1zm10.453 2.61a1.89 1.89 0 0 0-1.442.736 1.89 1.89 0 0 0 1.011 2.976 1.9 1.9 0 0 0 2.253-1.114 1.887 1.887 0 0 0-1.822-2.598M7.463 8.163a.6.6 0 0 0-.432.154L5.071 10.5h5.119L7.88 8.348a.63.63 0 0 0-.417-.185m6.236 1.059a.62.62 0 0 0-.42.164L12.07 10.5h2.969l-.92-1.113a.62.62 0 0 0-.42-.165M.91 11.5a.91.91 0 0 0-.91.912v6.877c0 .505.405.91.91.91h18.178a.91.91 0 0 0 .912-.91v-6.877a.91.91 0 0 0-.912-.912zM3.668 13h1.947l2.135 5.7H5.898l-.28-.946H3.601l-.278.945H1.516zm4.947 0h1.801v4.3h2.7v1.4h-4.5zm4.5 0h5.4v1.4h-1.798v4.3h-1.701v-4.3h-1.9zm-8.517 1.457-.614 2.059h1.262z"/></svg>',tooltip:!0}),o.bind("isEnabled").to(n,"isEnabled"),o.bind("isOn").to(n,"value",e=>!!e),this.listenTo(o,"execute",()=>{this._showForm()}),o})}_createForm(){const e=this.editor,t=e.editing.view.document,i=e.plugins.get("ImageUtils");this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new(Vp(nb))(e.locale),this._form.render(),this.listenTo(this._form,"submit",()=>{e.execute("imageTextAlternative",{newValue:this._form.labeledInput.fieldView.element.value}),this._hideForm(!0)}),this.listenTo(this._form,"cancel",()=>{this._hideForm(!0)}),this.listenTo(e.ui,"update",()=>{i.getClosestSelectedImageWidget(t.selection)?this._isVisible&&function(e){const t=e.plugins.get("ContextualBalloon");if(e.plugins.get("ImageUtils").getClosestSelectedImageWidget(e.editing.view.document.selection)){const i=ob(e);t.updatePosition(i)}}(e):this._hideForm(!0)}),Vn({emitter:this._form,activator:()=>this._isVisible,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible)return;this._form||this._createForm();const e=this.editor,t=e.commands.get("imageTextAlternative"),i=this._form.labeledInput;this._form.disableCssTransitions(),this._isInBalloon||this._balloon.add({view:this._form,position:ob(e)}),i.fieldView.value=i.fieldView.element.value=t.value||"",this._form.labeledInput.fieldView.select(),this._form.enableCssTransitions()}_hideForm(e=!1){this._isInBalloon&&(this._form.focusTracker.isFocused&&this._form.saveButtonView.focus(),this._balloon.remove(this._form),e&&this.editor.editing.view.focus())}get _isVisible(){return!!this._balloon&&this._balloon.visibleView===this._form}get _isInBalloon(){return!!this._balloon&&this._balloon.hasView(this._form)}}class sb extends Qu{static get requires(){return[Np,rb]}static get pluginName(){return"ImageTextAlternative"}static get isOfficialPlugin(){return!0}}function ab(e,t){const i=(t,i,n)=>{if(!n.consumable.consume(i.item,t.name))return;const o=n.writer,r=n.mapper.toViewElement(i.item),s=e.findViewImgElement(r);null===i.attributeNewValue?(o.removeAttribute("srcset",s),o.removeAttribute("sizes",s)):i.attributeNewValue&&(o.setAttribute("srcset",i.attributeNewValue,s),o.setAttribute("sizes","100vw",s))};return e=>{e.on(`attribute:srcset:${t}`,i)}}function lb(e,t,i){const n=(t,i,n)=>{if(!n.consumable.consume(i.item,t.name))return;const o=n.writer,r=n.mapper.toViewElement(i.item),s=e.findViewImgElement(r);o.setAttribute(i.attributeKey,i.attributeNewValue||"",s)};return e=>{e.on(`attribute:${i}:${t}`,n)}}class cb extends Vs{observe(e){this.listenTo(e,"load",(e,t)=>{const i=t.target;this.checkShouldIgnoreEventFromTarget(i)||"IMG"==i.tagName&&this._fireEvents(t)},{useCapture:!0})}stopObserving(e){this.stopListening(e)}_fireEvents(e){this.isEnabled&&(this.document.fire("layoutChanged"),this.document.fire("imageLoaded",e))}}class db extends Xu{constructor(e){super(e);const t=e.config.get("image.insert.type");e.plugins.has("ImageBlockEditing")||"block"===t&&x("image-block-plugin-required"),e.plugins.has("ImageInlineEditing")||"inline"===t&&x("image-inline-plugin-required")}refresh(){const e=this.editor.plugins.get("ImageUtils");this.isEnabled=e.isImageAllowed()}execute(e){const t=Dt(e.source),i=this.editor.model.document.selection,n=this.editor.plugins.get("ImageUtils"),o=Object.fromEntries(i.getAttributes());t.forEach((t,r)=>{const s=i.getSelectedElement();if("string"==typeof t&&(t={src:t}),r&&s&&n.isImage(s)){const i=this.editor.model.createPositionAfter(s);n.insertImage({...t,...o},i,e.imageType)}else e.breakBlock?n.insertImage({...t,...o},i.getFirstPosition(),e.imageType):n.insertImage({...t,...o},null,e.imageType)})}}class ub extends Xu{constructor(e){super(e),this.decorate("cleanupImage")}refresh(){const e=this.editor.plugins.get("ImageUtils"),t=this.editor.model.document.selection.getSelectedElement();this.isEnabled=e.isImage(t),this.value=this.isEnabled?t.getAttribute("src"):null}execute(e){const t=this.editor.model.document.selection.getSelectedElement(),i=this.editor.plugins.get("ImageUtils");this.editor.model.change(n=>{n.setAttribute("src",e.source,t),this.cleanupImage(n,t),i.setImageNaturalSizeAttributes(t)})}cleanupImage(e,t){e.removeAttribute("srcset",t),e.removeAttribute("sizes",t),e.removeAttribute("sources",t),e.removeAttribute("width",t),e.removeAttribute("height",t),e.removeAttribute("alt",t)}}class hb extends Qu{static get requires(){return[Pp]}static get pluginName(){return"ImageEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.conversion;e.editing.view.addObserver(cb),t.for("upcast").attributeToAttribute({view:{name:"img",key:"alt"},model:"alt"}).attributeToAttribute({view:{name:"img",key:"srcset"},model:"srcset"});const i=new db(e),n=new ub(e);e.commands.add("insertImage",i),e.commands.add("replaceImageSource",n),e.commands.add("imageInsert",i)}}class mb extends Qu{static get requires(){return[Pp]}static get pluginName(){return"ImageSizeAttributes"}static get isOfficialPlugin(){return!0}afterInit(){this._registerSchema(),this._registerConverters("imageBlock"),this._registerConverters("imageInline")}_registerSchema(){const e=this.editor.model.schema;this.editor.plugins.has("ImageBlockEditing")&&e.extend("imageBlock",{allowAttributes:["width","height"]}),this.editor.plugins.has("ImageInlineEditing")&&e.extend("imageInline",{allowAttributes:["width","height"]})}_registerConverters(e){const t=this.editor,i=t.plugins.get("ImageUtils"),n="imageBlock"===e?"figure":"img";function o(t,n,o,r,s=!1){t.on(`attribute:${n}:${e}`,(t,n,a)=>{if(!a.consumable.consume(n.item,t.name))return;const l=a.writer,c=a.mapper.toViewElement(n.item),d=i.findViewImgElement(c);null!==n.attributeNewValue?l.setAttribute(o,n.attributeNewValue,d):l.removeAttribute(o,d);const u=n.item.getAttribute("width"),h=n.item.getAttribute("height"),m=u&&h;if(m&&s&&l.setAttribute("loading","lazy",d),n.item.hasAttribute("sources"))return;const g=n.item.hasAttribute("resizedWidth");("imageInline"!==e||g||r)&&m&&l.setStyle("aspect-ratio",`${u}/${h}`,d)})}t.conversion.for("upcast").attributeToAttribute({view:{name:n,styles:{width:/.+/}},model:{key:"width",value:e=>Ip(e)?Ep(e.getStyle("width")):null}}).attributeToAttribute({view:{name:n,key:"width"},model:"width"}).attributeToAttribute({view:{name:n,styles:{height:/.+/}},model:{key:"height",value:e=>Ip(e)?Ep(e.getStyle("height")):null}}).attributeToAttribute({view:{name:n,key:"height"},model:"height"}),t.conversion.for("editingDowncast").add(e=>{o(e,"width","width",!0,!0),o(e,"height","height",!0,!0)}),t.conversion.for("dataDowncast").add(e=>{o(e,"width","width",!1),o(e,"height","height",!1)}),t.conversion.for("upcast").add(e=>{e.on("element:img",(e,t,i)=>{const n=t.viewItem.getAttribute("width"),o=t.viewItem.getAttribute("height");n&&o&&i.consumable.consume(t.viewItem,{styles:["aspect-ratio"]})})})}}class gb extends Xu{_modelElementName;constructor(e,t){super(e),this._modelElementName=t}refresh(){const e=this.editor.plugins.get("ImageUtils"),t=e.getClosestSelectedImageElement(this.editor.model.document.selection);"imageBlock"===this._modelElementName?this.isEnabled=e.isInlineImage(t):this.isEnabled=e.isBlockImage(t)}execute(e={}){const t=this.editor,i=this.editor.model,n=t.plugins.get("ImageUtils"),o=n.getClosestSelectedImageElement(i.document.selection),r=Object.fromEntries(o.getAttributes());return r.src||r.uploadId?i.change(t=>{const{setImageSizes:s=!0}=e,a=Array.from(i.markers).filter(e=>e.getRange().containsItem(o)),l=n.insertImage(r,i.createSelection(o,"on"),this._modelElementName,{setImageSizes:s});if(!l)return null;const c=t.createRangeOn(l);for(const e of a){const i=e.getRange(),n="$graveyard"!=i.root.rootName?i.getJoined(c,!0):c;t.updateMarker(e,{range:n})}return{oldElement:o,newElement:l}}):null}}var fb=i(1091),pb={attributes:{"data-cke":!0}};pb.setAttributes=Ki(),pb.insert=$i().bind(null,"head"),pb.domAPI=Hi(),pb.insertStyleElement=Yi();ji()(fb.A,pb);fb.A&&fb.A.locals&&fb.A.locals;class bb extends Qu{static get requires(){return[Pp]}static get pluginName(){return"ImagePlaceholder"}static get isOfficialPlugin(){return!0}afterInit(){this._setupSchema(),this._setupConversion(),this._setupLoadListener()}_setupSchema(){const e=this.editor.model.schema;e.isRegistered("imageBlock")&&e.extend("imageBlock",{allowAttributes:["placeholder"]}),e.isRegistered("imageInline")&&e.extend("imageInline",{allowAttributes:["placeholder"]})}_setupConversion(){const e=this.editor,t=e.conversion,i=e.plugins.get("ImageUtils");t.for("editingDowncast").add(e=>{e.on("attribute:placeholder",(e,t,n)=>{if(!n.consumable.test(t.item,e.name))return;if(!t.item.is("element","imageBlock")&&!t.item.is("element","imageInline"))return;n.consumable.consume(t.item,e.name);const o=n.writer,r=n.mapper.toViewElement(t.item),s=i.findViewImgElement(r);t.attributeNewValue?(o.addClass("image_placeholder",s),o.setStyle("background-image",`url(${t.attributeNewValue})`,s),o.setCustomProperty("editingPipeline:doNotReuseOnce",!0,s)):(o.removeClass("image_placeholder",s),o.removeStyle("background-image",s))})})}_setupLoadListener(){const e=this.editor,t=e.model,i=e.editing,n=i.view,o=e.plugins.get("ImageUtils");n.addObserver(cb),this.listenTo(n.document,"imageLoaded",(e,r)=>{const s=n.domConverter.mapDomToView(r.target);if(!s)return;const a=o.getImageWidgetFromImageView(s);if(!a)return;const l=i.mapper.toModelElement(a);l&&l.hasAttribute("placeholder")&&t.enqueueChange({isUndoable:!1},e=>{e.removeAttribute("placeholder",l)})})}}class kb extends Qu{static get requires(){return[hb,mb,Pp,bb,Gh]}static get pluginName(){return"ImageBlockEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.model.schema.register("imageBlock",{inheritAllFrom:"$blockObject",allowAttributes:["alt","src","srcset"]}),this._setupConversion(),e.plugins.has("ImageInlineEditing")&&(e.commands.add("imageTypeBlock",new gb(this.editor,"imageBlock")),this._setupClipboardIntegration())}_setupConversion(){const e=this.editor,t=e.t,i=e.conversion,n=e.plugins.get("ImageUtils");i.for("dataDowncast").elementToStructure({model:"imageBlock",view:(e,{writer:t})=>xp(t)}),i.for("editingDowncast").elementToStructure({model:"imageBlock",view:(e,{writer:i})=>n.toImageWidget(xp(i),i,t("image widget"))}),i.for("downcast").add(lb(n,"imageBlock","src")).add(lb(n,"imageBlock","alt")).add(ab(n,"imageBlock")),i.for("upcast").elementToElement({view:Cp(e,"imageBlock"),model:(e,{writer:t})=>t.createElement("imageBlock",e.hasAttribute("src")?{src:e.getAttribute("src")}:void 0)}).add(function(e){const t=(t,i,n)=>{if(!n.consumable.test(i.viewItem,{name:!0,classes:"image"}))return;const o=e.findViewImgElement(i.viewItem);if(!o||!n.consumable.test(o,{name:!0}))return;n.consumable.consume(i.viewItem,{name:!0,classes:"image"});const r=Jt(n.convertItem(o,i.modelCursor).modelRange.getItems());r?(n.convertChildren(i.viewItem,r),n.updateConversionResult(r,i)):n.consumable.revert(i.viewItem,{name:!0,classes:"image"})};return e=>{e.on("element:figure",t)}}(n))}_setupClipboardIntegration(){const e=this.editor,t=e.model,i=e.editing.view,n=e.plugins.get("ImageUtils"),o=e.plugins.get("ClipboardPipeline");this.listenTo(o,"inputTransformation",(o,r)=>{const s=Array.from(r.content.getChildren());let a;if(!s.every(n.isInlineImageView))return;a=r.targetRanges?e.editing.mapper.toModelRange(r.targetRanges[0]):t.document.selection.getFirstRange();const l=t.createSelection(a);if("imageBlock"===Tp(t.schema,l)){const e=new kd(i.document),t=s.map(t=>e.createElement("figure",{class:"image"},t));r.content=e.createDocumentFragment(t)}}),this.listenTo(o,"contentInsertion",(e,i)=>{"paste"===i.method&&t.change(e=>{const t=e.createRangeIn(i.content);for(const e of t.getItems())e.is("element","imageBlock")&&n.setImageNaturalSizeAttributes(e)})})}}var wb=i(1750),_b={attributes:{"data-cke":!0}};_b.setAttributes=Ki(),_b.insert=$i().bind(null,"head"),_b.domAPI=Hi(),_b.insertStyleElement=Yi();ji()(wb.A,_b);wb.A&&wb.A.locals&&wb.A.locals;class vb extends Zi{buttonView;children;constructor(e,t){super(e);const i=this.bindTemplate;this.set("isCollapsed",!1),this.set("label",""),this.buttonView=this._createButtonView(),this.children=this.createCollection(),this.set("_collapsibleAriaLabelUid",void 0),t&&this.children.addMany(t),this.setTemplate({tag:"div",attributes:{class:["ck","ck-collapsible",i.if("isCollapsed","ck-collapsible_collapsed")]},children:[this.buttonView,{tag:"div",attributes:{class:["ck","ck-collapsible__children"],role:"region",hidden:i.if("isCollapsed","hidden"),"aria-labelledby":i.to("_collapsibleAriaLabelUid")},children:this.children}]})}render(){super.render(),this._collapsibleAriaLabelUid=this.buttonView.labelView.element.id}focus(){this.buttonView.focus()}_createButtonView(){const e=new lo(this.locale),t=e.bindTemplate;return e.set({withText:!0,icon:Bd}),e.extendTemplate({attributes:{"aria-expanded":t.to("isOn",e=>String(e))}}),e.bind("label").to(this),e.bind("isOn").to(this,"isCollapsed",e=>!e),e.on("execute",()=>{this.isCollapsed=!this.isCollapsed}),e}}var yb=i(1545),Ab={attributes:{"data-cke":!0}};Ab.setAttributes=Ki(),Ab.insert=$i().bind(null,"head"),Ab.domAPI=Hi(),Ab.insertStyleElement=Yi();ji()(yb.A,Ab);yb.A&&yb.A.locals&&yb.A.locals;class xb extends Zi{focusTracker;keystrokes;_focusables;_focusCycler;children;constructor(e,t=[]){super(e),this.focusTracker=new Qt,this.keystrokes=new ti,this._focusables=new pi,this.children=this.createCollection(),this._focusCycler=new uo({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});for(const e of t)this.children.add(e),this._focusables.add(e),e instanceof vb&&this._focusables.addMany(e.children);this.setTemplate({tag:"form",attributes:{class:["ck","ck-image-insert-form"],tabindex:-1},children:this.children})}render(){super.render(),zp({view:this});for(const e of this._focusables)this.focusTracker.add(e.element);this.keystrokes.listenTo(this.element);const e=e=>e.stopPropagation();this.keystrokes.set("arrowright",e),this.keystrokes.set("arrowleft",e),this.keystrokes.set("arrowup",e),this.keystrokes.set("arrowdown",e)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}}class Cb extends Qu{static get pluginName(){return"ImageInsertUI"}static get isOfficialPlugin(){return!0}static get requires(){return[Pp]}dropdownView;_integrations=new Map;constructor(e){super(e),e.config.define("image.insert.integrations",["upload","assetManager","url"])}init(){const e=this.editor,t=e.model.document.selection,i=e.plugins.get("ImageUtils");this.set("isImageSelected",!1),this.listenTo(e.model.document,"change",()=>{this.isImageSelected=i.isImage(t.getSelectedElement())});const n=e=>this._createToolbarComponent(e);e.ui.componentFactory.add("insertImage",n),e.ui.componentFactory.add("imageInsert",n),e.ui.componentFactory.add("menuBar:insertImage",e=>this._createMenuBarComponent(e))}registerIntegration({name:e,observable:t,buttonViewCreator:i,formViewCreator:n,menuBarButtonViewCreator:o,requiresForm:r=!1,override:s=!1}){this._integrations.has(e)&&!s&&x("image-insert-integration-exists",{name:e}),this._integrations.set(e,{observable:t,buttonViewCreator:i,menuBarButtonViewCreator:o,formViewCreator:n,requiresForm:r})}_createToolbarComponent(e){const t=this.editor,i=e.t,n=this._prepareIntegrations();if(!n.length)return null;let o;const r=n[0];if(1==n.length){if(!r.requiresForm)return r.buttonViewCreator(!0);o=r.buttonViewCreator(!0)}else{const t=r.buttonViewCreator(!1);o=new Kd(e,t),o.tooltip=!0,o.bind("label").to(this,"isImageSelected",e=>i(e?"Replace image":"Insert image"))}const s=this.dropdownView=su(e,o),a=n.map(({observable:e})=>"function"==typeof e?e():e);return s.bind("isEnabled").toMany(a,"isEnabled",(...e)=>e.some(e=>e)),s.once("change:isOpen",()=>{const e=n.flatMap(({formViewCreator:e})=>e(1==n.length)),i=new xb(t.locale,e);s.panelView.children.add(i)}),s}_createMenuBarComponent(e){const t=e.t,i=this._prepareIntegrations();if(!i.length)return null;const n=i.flatMap(({menuBarButtonViewCreator:e})=>e(1==i.length)),o=new Mu(e),r=new Ou(e);o.panelView.children.add(r),o.buttonView.set({icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M6.66 9.118a.693.693 0 0 1 .956.032l3.65 3.411 2.422-2.238a.695.695 0 0 1 .945 0L17.5 13.6V2.5h-15v11.1zM17.8 1c.652 0 1.2.47 1.2 1.1v14.362c0 .64-.532 1.038-1.184 1.038H2.184C1.532 17.5 1 17.103 1 16.462V2.1C1 1.47 1.537 1 2.2 1zm-5.655 6a2.13 2.13 0 0 1 .157-2.364A2.133 2.133 0 1 1 12.145 7"/></svg>',label:t("Image")});for(const t of n){const i=new Nn(e,o);i.children.add(t),r.items.add(i),t.delegate("execute").to(o)}return o}_prepareIntegrations(){const e=this.editor.config.get("image.insert.integrations"),t=[];if(!e.length)return x("image-insert-integrations-not-specified"),t;for(const i of e)this._integrations.has(i)?t.push(this._integrations.get(i)):["upload","assetManager","url"].includes(i)||x("image-insert-unknown-integration",{item:i});return t.length||x("image-insert-integrations-not-registered"),t}}var Tb=i(8574),Eb={attributes:{"data-cke":!0}};Eb.setAttributes=Ki(),Eb.insert=$i().bind(null,"head"),Eb.domAPI=Hi(),Eb.insertStyleElement=Yi();ji()(Tb.A,Eb);Tb.A&&Tb.A.locals&&Tb.A.locals;class Ib extends Qu{static get requires(){return[kb,bg,sb,Cb]}static get pluginName(){return"ImageBlock"}static get isOfficialPlugin(){return!0}}class Sb extends Qu{static get requires(){return[hb,mb,Pp,bb,Gh]}static get pluginName(){return"ImageInlineEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.model.schema.register("imageInline",{inheritAllFrom:"$inlineObject",allowAttributes:["alt","src","srcset"],disallowIn:["caption"]}),this._setupConversion(),e.plugins.has("ImageBlockEditing")&&(e.commands.add("imageTypeInline",new gb(this.editor,"imageInline")),this._setupClipboardIntegration())}_setupConversion(){const e=this.editor,t=e.t,i=e.conversion,n=e.plugins.get("ImageUtils");i.for("dataDowncast").elementToElement({model:"imageInline",view:(e,{writer:t})=>t.createEmptyElement("img")}),i.for("editingDowncast").elementToStructure({model:"imageInline",view:(e,{writer:i})=>n.toImageWidget(function(e){return e.createContainerElement("span",{class:"image-inline"},e.createEmptyElement("img"))}(i),i,t("image widget"))}),i.for("downcast").add(lb(n,"imageInline","src")).add(lb(n,"imageInline","alt")).add(ab(n,"imageInline")),i.for("upcast").elementToElement({view:Cp(e,"imageInline"),model:(e,{writer:t})=>t.createElement("imageInline",e.hasAttribute("src")?{src:e.getAttribute("src")}:void 0)})}_setupClipboardIntegration(){const e=this.editor,t=e.model,i=e.editing.view,n=e.plugins.get("ImageUtils"),o=e.plugins.get("ClipboardPipeline");this.listenTo(o,"inputTransformation",(o,r)=>{const s=Array.from(r.content.getChildren());let a;if(!s.every(n.isBlockImageView))return;a=r.targetRanges?e.editing.mapper.toModelRange(r.targetRanges[0]):t.document.selection.getFirstRange();const l=t.createSelection(a);if("imageInline"===Tp(t.schema,l)){const e=new kd(i.document),t=s.map(t=>1===t.childCount?(Array.from(t.getAttributes()).forEach(i=>e.setAttribute(...i,n.findViewImgElement(t))),t.getChild(0)):t);r.content=e.createDocumentFragment(t)}}),this.listenTo(o,"contentInsertion",(e,i)=>{"paste"===i.method&&t.change(e=>{const t=e.createRangeIn(i.content);for(const e of t.getItems())e.is("element","imageInline")&&n.setImageNaturalSizeAttributes(e)})})}}class Pb extends Qu{static get requires(){return[Sb,bg,sb,Cb]}static get pluginName(){return"ImageInline"}static get isOfficialPlugin(){return!0}}class Mb extends Xu{refresh(){const e=this.editor,t=e.plugins.get("ImageUtils").getClosestSelectedImageElement(e.model.document.selection);this.isEnabled=!!t,t&&t.hasAttribute("resizedWidth")?this.value={width:t.getAttribute("resizedWidth"),height:null}:this.value=null}execute(e){const t=this.editor,i=t.model,n=t.plugins.get("ImageUtils"),o=n.getClosestSelectedImageElement(i.document.selection);this.value={width:e.width,height:null},o&&i.change(t=>{t.setAttribute("resizedWidth",e.width,o),t.removeAttribute("resizedHeight",o),n.setImageNaturalSizeAttributes(o)})}}class Ob extends Qu{static get requires(){return[Pp]}static get pluginName(){return"ImageResizeEditing"}static get licenseFeatureCode(){return"IR"}static get isOfficialPlugin(){return!0}static get isPremiumPlugin(){return!0}constructor(e){super(e),e.config.define("image",{resizeUnit:"%",resizeOptions:[{name:"resizeImage:original",value:null,icon:"original"},{name:"resizeImage:custom",value:"custom",icon:"custom"},{name:"resizeImage:25",value:"25",icon:"small"},{name:"resizeImage:50",value:"50",icon:"medium"},{name:"resizeImage:75",value:"75",icon:"large"}]})}init(){const e=this.editor,t=new Mb(e);this._registerConverters("imageBlock"),this._registerConverters("imageInline"),e.commands.add("resizeImage",t),e.commands.add("imageResize",t)}afterInit(){this._registerSchema()}_registerSchema(){const e=this.editor.model.schema;this.editor.plugins.has("ImageBlockEditing")&&(e.extend("imageBlock",{allowAttributes:["resizedWidth","resizedHeight"]}),e.setAttributeProperties("resizedWidth",{isFormatting:!0}),e.setAttributeProperties("resizedHeight",{isFormatting:!0})),this.editor.plugins.has("ImageInlineEditing")&&(e.extend("imageInline",{allowAttributes:["resizedWidth","resizedHeight"]}),e.setAttributeProperties("resizedWidth",{isFormatting:!0}),e.setAttributeProperties("resizedHeight",{isFormatting:!0}))}_registerConverters(e){const t=this.editor,i=t.plugins.get("ImageUtils");t.conversion.for("downcast").add(t=>t.on(`attribute:resizedWidth:${e}`,(e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const n=i.writer,o=i.mapper.toViewElement(t.item);null!==t.attributeNewValue?(n.setStyle("width",t.attributeNewValue,o),n.addClass("image_resized",o)):(n.removeStyle("width",o),n.removeClass("image_resized",o))})),t.conversion.for("dataDowncast").attributeToAttribute({model:{name:e,key:"resizedHeight"},view:e=>({key:"style",value:{height:e}})}),t.conversion.for("editingDowncast").add(t=>t.on(`attribute:resizedHeight:${e}`,(t,n,o)=>{if(!o.consumable.consume(n.item,t.name))return;const r=o.writer,s=o.mapper.toViewElement(n.item),a="imageInline"===e?i.findViewImgElement(s):s;null!==n.attributeNewValue?r.setStyle("height",n.attributeNewValue,a):r.removeStyle("height",a)})),t.conversion.for("upcast").attributeToAttribute({view:{name:"imageBlock"===e?"figure":"img",styles:{width:/.+/}},model:{key:"resizedWidth",value:e=>Ip(e)?null:e.getStyle("width")}}),t.conversion.for("upcast").attributeToAttribute({view:{name:"imageBlock"===e?"figure":"img",styles:{height:/.+/}},model:{key:"resizedHeight",value:e=>Ip(e)?null:e.getStyle("height")}}),t.conversion.for("upcast").add(t=>{t.on("element:"+("imageBlock"===e?"figure":"img"),(e,t,i)=>{i.consumable.consume(t.viewItem,{classes:["image_resized"]})})})}}const Rb=(()=>({small:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2.5 16.5v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zM1 15v1H0v-1zm19 0v1h-1v-1zM1 13v1H0v-1zm19 0v1h-1v-1zM1 11v1H0v-1zm19 0v1h-1v-1zM1 9v1H0V9zm19 0v1h-1V9zM1 7v1H0V7zm19 0v1h-1V7zM1 5v1H0V5zm19 0v1h-1V5zm0-2v1h-1V3zM1 3v1H0V3zm13.5-1.5v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm-8 0v1h-1v-1zm-2 0v1h-1v-1zm-2 0v1h-1v-1zm-2 0v1h-1v-1zm8 0v1h-1v-1zm-10 0v1h-1v-1z"/><path d="M7 9.5H2a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h5a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2M7 11a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5v-4A.5.5 0 0 1 2 11z"/></svg>',medium:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2.5 16.5v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zM1 15v1H0v-1zm19 0v1h-1v-1zM1 13v1H0v-1zm19 0v1h-1v-1zM1 11v1H0v-1zm19 0v1h-1v-1zM1 9v1H0V9zm19 0v1h-1V9zM1 7v1H0V7zm19 0v1h-1V7zM1 5v1H0V5zm19 0v1h-1V5zm0-2v1h-1V3zM1 3v1H0V3zm13.5-1.5v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm-8 0v1h-1v-1zm-2 0v1h-1v-1zm-2 0v1h-1v-1zm-2 0v1h-1v-1zm8 0v1h-1v-1zm-10 0v1h-1v-1z"/><path d="M10 7.5H2a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2v-6a2 2 0 0 0-2-2M10 9a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5v-6A.5.5 0 0 1 2 9z"/></svg>',large:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2.5 16.5v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zM1 15v1H0v-1zm19 0v1h-1v-1zM1 13v1H0v-1zm19 0v1h-1v-1zM1 11v1H0v-1zm19 0v1h-1v-1zM1 9v1H0V9zm19 0v1h-1V9zM1 7v1H0V7zm19 0v1h-1V7zM1 5v1H0V5zm19 0v1h-1V5zm0-2v1h-1V3zM1 3v1H0V3zm13.5-1.5v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm-8 0v1h-1v-1zm-2 0v1h-1v-1zm-2 0v1h-1v-1zm-2 0v1h-1v-1zm8 0v1h-1v-1zm-10 0v1h-1v-1z"/><path d="M13 5.5H2a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2v-8a2 2 0 0 0-2-2M13 7a.5.5 0 0 1 .5.5v8a.5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5v-8A.5.5 0 0 1 2 7z"/></svg>',custom:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M.95 1.43a.95.95 0 0 0-.95.95v3.1a.95.95 0 0 0 .95.95h.75v6.3H.95a.95.95 0 0 0-.95.95v3.1a.95.95 0 0 0 .95.95h3.1a.95.95 0 0 0 .95-.95v-.65h1.932l1.539-1.5H5v-.95a.95.95 0 0 0-.95-.95H3.2v-6.3h.85A.95.95 0 0 0 5 5.48v-.55h10v.55a.95.95 0 0 0 .95.95h3.1a.95.95 0 0 0 .95-.95v-3.1a.95.95 0 0 0-.95-.95h-3.1a.95.95 0 0 0-.95.95v1.05H5V2.38a.95.95 0 0 0-.95-.95zm.55 3.5v-2h2v2zm0 9.3v2h2v-2zm15-11.3v2h2v-2zM8.139 20.004v-2.388l7.045-7.048 2.391 2.391-7.046 7.046zm11.421-9.101a.6.6 0 0 1-.138.206l-1.165 1.168-2.391-2.391 1.167-1.163a.6.6 0 0 1 .206-.138.6.6 0 0 1 .243-.049.63.63 0 0 1 .449.187l1.491 1.488c.059.059.108.129.138.206s.049.16.049.243a.6.6 0 0 1-.049.243"/></svg>',original:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2.5 17v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zM1 15.5v1H0v-1zm19 0v1h-1v-1zm-19-2v1H0v-1zm19 0v1h-1v-1zm-19-2v1H0v-1zm19 0v1h-1v-1zm-19-2v1H0v-1zm19 0v1h-1v-1zm-19-2v1H0v-1zm19 0v1h-1v-1zm-19-2v1H0v-1zm19 0v1h-1v-1zm0-2v1h-1v-1zm-19 0v1H0v-1zM14.5 2v1h-1V2zm2 0v1h-1V2zm2 0v1h-1V2zm-8 0v1h-1V2zm-2 0v1h-1V2zm-2 0v1h-1V2zm-2 0v1h-1V2zm8 0v1h-1V2zm-10 0v1h-1V2z"/><path d="M18.095 2H1.905C.853 2 0 2.895 0 4v12c0 1.105.853 2 1.905 2h16.19C19.147 18 20 17.105 20 16V4c0-1.105-.853-2-1.905-2m0 1.5c.263 0 .476.224.476.5v12c0 .276-.213.5-.476.5H1.905a.49.49 0 0 1-.476-.5V4c0-.276.213-.5.476-.5z"/></svg>'}))();class Nb extends Qu{static get requires(){return[Ob]}static get pluginName(){return"ImageResizeButtons"}static get isOfficialPlugin(){return!0}_resizeUnit;constructor(e){super(e),this._resizeUnit=e.config.get("image.resizeUnit")}init(){const e=this.editor,t=e.config.get("image.resizeOptions"),i=e.commands.get("resizeImage");this.bind("isEnabled").to(i);for(const e of t)this._registerImageResizeButton(e);this._registerImageResizeDropdown(t)}_registerImageResizeButton(e){const t=this.editor,{name:i,value:n,icon:o}=e;t.ui.componentFactory.add(i,i=>{const r=new lo(i),s=t.commands.get("resizeImage"),a=this._getOptionLabelValue(e,!0);if(!Rb[o])throw new A("imageresizebuttons-missing-icon",t,e);if(r.set({label:a,icon:Rb[o],tooltip:a,isToggleable:!0}),r.bind("isEnabled").to(this),t.plugins.has("ImageCustomResizeUI")&&Vb(e)){const e=t.plugins.get("ImageCustomResizeUI");this.listenTo(r,"execute",()=>{e._showForm(this._resizeUnit)})}else{const e=n?n+this._resizeUnit:null;r.bind("isOn").to(s,"value",s,"isEnabled",Lb(e)),this.listenTo(r,"execute",()=>{t.execute("resizeImage",{width:e})})}return r})}_registerImageResizeDropdown(e){const t=this.editor,i=t.t,n=e.find(e=>!e.value),o=o=>{const r=t.commands.get("resizeImage"),s=su(o,zd),a=s.buttonView,l=i("Resize image");return a.set({tooltip:l,commandValue:n.value,icon:Rb.medium,isToggleable:!0,label:this._getOptionLabelValue(n),withText:!0,class:"ck-resize-image-button",ariaLabel:l,ariaLabelledBy:void 0}),a.bind("label").to(r,"value",e=>e&&e.width?e.width:this._getOptionLabelValue(n)),s.bind("isEnabled").to(this),cu(s,()=>this._getResizeDropdownListItemDefinitions(e,r),{ariaLabel:i("Image resize list"),role:"menu"}),this.listenTo(s,"execute",e=>{"onClick"in e.source?e.source.onClick():(t.execute(e.source.commandName,{width:e.source.commandValue}),t.editing.view.focus())}),s};t.ui.componentFactory.add("resizeImage",o),t.ui.componentFactory.add("imageResize",o)}_getOptionLabelValue(e,t=!1){const i=this.editor.t;return e.label?e.label:t?Vb(e)?i("Custom image size"):e.value?i("Resize image to %0",e.value+this._resizeUnit):i("Resize image to the original size"):Vb(e)?i("Custom"):e.value?e.value+this._resizeUnit:i("Original")}_getResizeDropdownListItemDefinitions(e,t){const{editor:i}=this,n=new Yt,o=e.map(e=>Vb(e)?{...e,valueWithUnits:"custom"}:e.value?{...e,valueWithUnits:`${e.value}${this._resizeUnit}`}:{...e,valueWithUnits:null});for(const e of o){let r=null;if(i.plugins.has("ImageCustomResizeUI")&&Vb(e)){const n=i.plugins.get("ImageCustomResizeUI");r={type:"button",model:new _p({label:this._getOptionLabelValue(e),role:"menuitemradio",withText:!0,icon:null,onClick:()=>{n._showForm(this._resizeUnit)}})};const s=Object.values(o).map(e=>e.valueWithUnits);r.model.bind("isOn").to(t,"value",t,"isEnabled",Db(s))}else r={type:"button",model:new _p({commandName:"resizeImage",commandValue:e.valueWithUnits,label:this._getOptionLabelValue(e),role:"menuitemradio",withText:!0,icon:null})},r.model.bind("isOn").to(t,"value",t,"isEnabled",Lb(e.valueWithUnits));r.model.bind("isEnabled").to(t,"isEnabled"),n.add(r)}return n}}function Vb(e){return"custom"===e.value}function Lb(e){return(t,i)=>!(void 0===t||!i)&&(null===e&&t===e||null!==t&&t.width===e)}function Db(e){return(t,i)=>!e.some(e=>Lb(e)(t,i))}const Bb="image_resized";class zb extends Qu{static get requires(){return[zg,Pp]}static get pluginName(){return"ImageResizeHandles"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.commands.get("resizeImage");this.bind("isEnabled").to(e),this._setupResizerCreator()}_setupResizerCreator(){const e=this.editor,t=e.editing.view,i=e.plugins.get("ImageUtils");t.addObserver(cb),this.listenTo(t.document,"imageLoaded",(n,o)=>{if(!o.target.matches("figure.image.ck-widget > img,figure.image.ck-widget > picture > img,figure.image.ck-widget > a > img,figure.image.ck-widget > a > picture > img,span.image-inline.ck-widget > img,span.image-inline.ck-widget > picture > img"))return;const r=e.editing.view.domConverter,s=r.domToView(o.target),a=i.getImageWidgetFromImageView(s);let l=this.editor.plugins.get(zg).getResizerByViewElement(a);if(l)return void l.redraw();const c=e.editing.mapper,d=c.toModelElement(a);l=e.plugins.get(zg).attachTo({unit:e.config.get("image.resizeUnit"),modelElement:d,viewElement:a,editor:e,getHandleHost:e=>e.querySelector("img"),getResizeHost:()=>r.mapViewToDom(c.toViewElement(d)),isCentered:()=>"alignCenter"==d.getAttribute("imageStyle"),onCommit(i){t.change(e=>{e.removeClass(Bb,a)}),e.execute("resizeImage",{width:i})}}),l.on("updateSize",()=>{a.hasClass(Bb)||t.change(e=>{e.addClass(Bb,a)});const e="imageInline"===d.name?s:a;e.getStyle("height")&&t.change(t=>{t.removeStyle("height",e)})}),l.bind("isEnabled").to(this)})}}function Fb(e){if(!e)return null;const[,t,i]=e.trim().match(/([.,\d]+)(%|px)$/)||[],n=Number.parseFloat(t);return Number.isNaN(n)?null:{value:n,unit:i}}function jb(e,t,i){return"px"===i?{value:t.value,unit:"px"}:{value:t.value/e*100,unit:"%"}}function Ub(e){const{editing:t}=e,i=e.plugins.get("ImageUtils").getClosestSelectedImageElement(e.model.document.selection);if(!i)return null;const n=t.mapper.toViewElement(i);return{model:i,view:n,dom:t.view.domConverter.mapViewToDom(n)}}var Hb=i(1173),Wb={attributes:{"data-cke":!0}};Wb.setAttributes=Ki(),Wb.insert=$i().bind(null,"head"),Wb.domAPI=Hi(),Wb.insertStyleElement=Yi();ji()(Hb.A,Wb);Hb.A&&Hb.A.locals&&Hb.A.locals;class $b extends Zi{focusTracker;keystrokes;unit;backButtonView;saveButtonView;labeledInput;children;_focusables;_focusCycler;_validators;constructor(e,t,i){super(e),this.focusTracker=new Qt,this.keystrokes=new ti,this.unit=t,this.backButtonView=this._createBackButton(),this.saveButtonView=this._createSaveButton(),this.labeledInput=this._createLabeledInputView(),this.children=this.createCollection([this._createHeaderView()]),this.children.add(new Bp(e,{children:[this.labeledInput,this.saveButtonView],class:["ck-form__row_with-submit","ck-form__row_large-top-padding"]})),this._focusables=new pi,this._validators=i,this.keystrokes.set("Esc",(e,t)=>{this.fire("cancel"),t()}),this._focusCycler=new uo({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-form","ck-image-custom-resize-form","ck-responsive-form"],tabindex:"-1"},children:this.children})}render(){super.render(),zp({view:this});[this.backButtonView,this.labeledInput,this.saveButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createBackButton(){const e=this.locale.t,t=new lo(this.locale);return t.set({class:"ck-button-back",label:e("Back"),icon:wg,tooltip:!0}),t.delegate("execute").to(this,"cancel"),t}_createSaveButton(){const e=this.locale.t,t=new lo(this.locale);return t.set({label:e("Save"),withText:!0,type:"submit",class:"ck-button-action ck-button-bold"}),t}_createHeaderView(){const e=this.locale.t,t=new oo(this.locale,{label:e("Image Resize")});return t.children.add(this.backButtonView,0),t}_createLabeledInputView(){const e=this.locale.t,t=new Up(this.locale,Jp);return t.label=e("Resize image (in %0)",this.unit),t.class="ck-labeled-field-view_full-width",t.fieldView.set({step:.1}),t}isValid(){this.resetFormStatus();for(const e of this._validators){const t=e(this);if(t)return this.labeledInput.errorText=t,!1}return!0}resetFormStatus(){this.labeledInput.errorText=null}get rawSize(){const{element:e}=this.labeledInput.fieldView;return e?e.value:null}get parsedSize(){const{rawSize:e}=this;if(null===e)return null;const t=Number.parseFloat(e);return Number.isNaN(t)?null:t}get sizeWithUnits(){const{parsedSize:e,unit:t}=this;return null===e?null:`${e}${t}`}}class qb extends Qu{_balloon;_form;static get requires(){return[Tg]}static get pluginName(){return"ImageCustomResizeUI"}static get isOfficialPlugin(){return!0}destroy(){super.destroy(),this._form&&this._form.destroy()}_createForm(e){const t=this.editor;this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new(Vp($b))(t.locale,e,function(e){const t=e.t;return[e=>""===e.rawSize.trim()?t("The value must not be empty."):null===e.parsedSize?t("The value should be a plain number."):void 0]}(t)),this._form.render(),this.listenTo(this._form,"submit",()=>{this._form.isValid()&&(t.execute("resizeImage",{width:this._form.sizeWithUnits}),this._hideForm(!0))}),this.listenTo(this._form.labeledInput,"change:errorText",()=>{t.ui.update()}),this.listenTo(this._form,"cancel",()=>{this._hideForm(!0)}),Vn({emitter:this._form,activator:()=>this._isVisible,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(e){if(this._isVisible)return;this._form||this._createForm(e);const t=this.editor,i=this._form.labeledInput;this._form.disableCssTransitions(),this._form.resetFormStatus(),this._isInBalloon||this._balloon.add({view:this._form,position:ob(t)});const n=function(e,t){const i=Ub(e);if(!i)return null;const n=Fb(i.model.getAttribute("resizedWidth")||null);return n?n.unit===t?n:jb(ig(i.dom),{unit:"px",value:new Ze(i.dom).width},t):null}(t,e),o=n?n.value.toFixed(1):"",r=function(e,t){const i=Ub(e);if(!i)return null;const n=ig(i.dom),o=Fb(window.getComputedStyle(i.dom).minWidth)||{value:1,unit:"px"};return{unit:t,lower:Math.max(.1,jb(n,o,t).value),upper:"px"===t?n:100}}(t,e);i.fieldView.value=i.fieldView.element.value=o,r&&Object.assign(i.fieldView,{min:r.lower.toFixed(1),max:Math.ceil(r.upper).toFixed(1)}),this._form.labeledInput.fieldView.select(),this._form.enableCssTransitions()}_hideForm(e=!1){this._isInBalloon&&(this._form.focusTracker.isFocused&&this._form.saveButtonView.focus(),this._balloon.remove(this._form),e&&this.editor.editing.view.focus())}get _isVisible(){return!!this._balloon&&this._balloon.visibleView===this._form}get _isInBalloon(){return!!this._balloon&&this._balloon.hasView(this._form)}}var Kb=i(4214),Gb={attributes:{"data-cke":!0}};Gb.setAttributes=Ki(),Gb.insert=$i().bind(null,"head"),Gb.domAPI=Hi(),Gb.insertStyleElement=Yi();ji()(Kb.A,Gb);Kb.A&&Kb.A.locals&&Kb.A.locals;function Yb(e){const t=e.map(e=>e.replace("+","\\+"));return new RegExp(`^image\\/(${t.join("|")})$`)}function Jb(t){return new Promise((i,n)=>{const o=t.getAttribute("src");fetch(o).then(e=>e.blob()).then(e=>{const t=Qb(e,o),n=t.replace("image/",""),r=new File([e],`image.${n}`,{type:t});i(r)}).catch(t=>t&&"TypeError"===t.name?function(t){return function(t){return new Promise((i,n)=>{const o=e.document.createElement("img");o.addEventListener("load",()=>{const t=e.document.createElement("canvas");t.width=o.width,t.height=o.height;t.getContext("2d").drawImage(o,0,0),t.toBlob(e=>e?i(e):n())}),o.addEventListener("error",()=>n()),o.src=t})}(t).then(e=>{const i=Qb(e,t),n=i.replace("image/","");return new File([e],`image.${n}`,{type:i})})}(o).then(i).catch(n):n(t))})}function Qb(e,t){return e.type?e.type:t.match(/data:(image\/\w+);base64/)?t.match(/data:(image\/\w+);base64/)[1].toLowerCase():"image/jpeg"}class Zb extends Qu{static get pluginName(){return"ImageUploadUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.ui.componentFactory.add("uploadImage",()=>this._createToolbarButton()),e.ui.componentFactory.add("imageUpload",()=>this._createToolbarButton()),e.ui.componentFactory.add("menuBar:uploadImage",()=>this._createMenuBarButton("standalone")),e.plugins.has("ImageInsertUI")&&e.plugins.get("ImageInsertUI").registerIntegration({name:"upload",observable:()=>e.commands.get("uploadImage"),buttonViewCreator:()=>this._createToolbarButton(),formViewCreator:()=>this._createDropdownButton(),menuBarButtonViewCreator:e=>this._createMenuBarButton(e?"insertOnly":"insertNested")})}_createButton(e){const t=this.editor,i=t.locale,n=t.commands.get("uploadImage"),o=t.config.get("image.upload.types"),r=Yb(o),s=new e(t.locale),a=i.t;return s.set({acceptedType:o.map(e=>`image/${e}`).join(","),allowMultipleFiles:!0,label:a("Upload from computer"),icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M1.201 1C.538 1 0 1.47 0 2.1v14.363c0 .64.534 1.037 1.186 1.037h9.494a3 3 0 0 1-.414-.287 3 3 0 0 1-1.055-2.03 3 3 0 0 1 .693-2.185l.383-.455-.02.018-3.65-3.41a.695.695 0 0 0-.957-.034L1.5 13.6V2.5h15v5.535a2.97 2.97 0 0 1 1.412.932l.088.105V2.1c0-.63-.547-1.1-1.2-1.1zm11.713 2.803a2.146 2.146 0 0 0-2.049 1.992 2.14 2.14 0 0 0 1.28 2.096 2.13 2.13 0 0 0 2.644-3.11 2.13 2.13 0 0 0-1.875-.978"/><path d="M15.522 19.1a.79.79 0 0 0 .79-.79v-5.373l2.059 2.455a.79.79 0 1 0 1.211-1.015l-3.352-3.995a.79.79 0 0 0-.995-.179.8.8 0 0 0-.299.221l-3.35 3.99a.79.79 0 1 0 1.21 1.017l1.936-2.306v5.185c0 .436.353.79.79.79"/><path d="M15.522 19.1a.79.79 0 0 0 .79-.79v-5.373l2.059 2.455a.79.79 0 1 0 1.211-1.015l-3.352-3.995a.79.79 0 0 0-.995-.179.8.8 0 0 0-.299.221l-3.35 3.99a.79.79 0 1 0 1.21 1.017l1.936-2.306v5.185c0 .436.353.79.79.79"/></svg>'}),s.bind("isEnabled").to(n),s.on("done",(e,i)=>{const n=Array.from(i).filter(e=>r.test(e.type));n.length&&(t.execute("uploadImage",{file:n}),t.editing.view.focus())}),s}_createToolbarButton(){const e=this.editor.locale.t,t=this.editor.plugins.get("ImageInsertUI"),i=this.editor.commands.get("uploadImage"),n=this._createButton(Du);return n.tooltip=!0,n.bind("label").to(t,"isImageSelected",i,"isAccessAllowed",(t,i)=>e(i?t?"Replace image from computer":"Upload image from computer":"You have no image upload permissions.")),n}_createDropdownButton(){const e=this.editor.locale.t,t=this.editor.plugins.get("ImageInsertUI"),i=this._createButton(Du);return i.withText=!0,i.bind("label").to(t,"isImageSelected",t=>e(t?"Replace from computer":"Upload from computer")),i.on("execute",()=>{t.dropdownView.isOpen=!1}),i}_createMenuBarButton(e){const t=this.editor.locale.t,i=this._createButton(ju);switch(i.withText=!0,e){case"standalone":i.label=t("Image from computer");break;case"insertOnly":i.label=t("Image");break;case"insertNested":i.label=t("From computer")}return i}}var Xb=i(7504),ek={attributes:{"data-cke":!0}};ek.setAttributes=Ki(),ek.insert=$i().bind(null,"head"),ek.domAPI=Hi(),ek.insertStyleElement=Yi();ji()(Xb.A,ek);Xb.A&&Xb.A.locals&&Xb.A.locals;var tk=i(1230),ik={attributes:{"data-cke":!0}};ik.setAttributes=Ki(),ik.insert=$i().bind(null,"head"),ik.domAPI=Hi(),ik.insertStyleElement=Yi();ji()(tk.A,ik);tk.A&&tk.A.locals&&tk.A.locals;var nk=i(1160),ok={attributes:{"data-cke":!0}};ok.setAttributes=Ki(),ok.insert=$i().bind(null,"head"),ok.domAPI=Hi(),ok.insertStyleElement=Yi();ji()(nk.A,ok);nk.A&&nk.A.locals&&nk.A.locals;class rk extends Qu{static get pluginName(){return"ImageUploadProgress"}static get isOfficialPlugin(){return!0}placeholder;constructor(e){super(e),this.placeholder="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="}init(){const e=this.editor;e.plugins.has("ImageBlockEditing")&&e.editing.downcastDispatcher.on("attribute:uploadStatus:imageBlock",this.uploadStatusChange),e.plugins.has("ImageInlineEditing")&&e.editing.downcastDispatcher.on("attribute:uploadStatus:imageInline",this.uploadStatusChange)}uploadStatusChange=(e,t,i)=>{const n=this.editor,o=t.item,r=o.getAttribute("uploadId");if(!i.consumable.consume(t.item,e.name))return;const s=n.plugins.get("ImageUtils"),a=n.plugins.get(If),l=r?t.attributeNewValue:null,c=this.placeholder,d=n.editing.mapper.toViewElement(o),u=i.writer;if("reading"==l)return sk(d,u),void ak(s,c,d,u);if("uploading"==l){const e=a.loaders.get(r);return sk(d,u),void(e?(lk(d,u),function(e,t,i,n){const o=function(e){const t=e.createUIElement("div",{class:"ck-progress-bar"});return e.setCustomProperty("progressBar",!0,t),t}(t);t.insert(t.createPositionAt(e,"end"),o),i.on("change:uploadedPercent",(e,t,i)=>{n.change(e=>{e.setStyle("width",i+"%",o)})})}(d,u,e,n.editing.view),function(e,t,i,n){if(n.data){const o=e.findViewImgElement(t);i.setAttribute("src",n.data,o)}}(s,d,u,e)):ak(s,c,d,u))}"complete"==l&&a.loaders.get(r)&&function(e,t,i){const n=t.createUIElement("div",{class:"ck-image-upload-complete-icon"});t.insert(t.createPositionAt(e,"end"),n),setTimeout(()=>{i.change(e=>e.remove(e.createRangeOn(n)))},3e3)}(d,u,n.editing.view),function(e,t){dk(e,t,"progressBar")}(d,u),lk(d,u),function(e,t){t.removeClass("ck-appear",e)}(d,u)}}function sk(e,t){e.hasClass("ck-appear")||t.addClass("ck-appear",e)}function ak(e,t,i,n){i.hasClass("ck-image-upload-placeholder")||n.addClass("ck-image-upload-placeholder",i);const o=e.findViewImgElement(i);o.getAttribute("src")!==t&&n.setAttribute("src",t,o),ck(i,"placeholder")||n.insert(n.createPositionAfter(o),function(e){const t=e.createUIElement("div",{class:"ck-upload-placeholder-loader"});return e.setCustomProperty("placeholder",!0,t),t}(n))}function lk(e,t){e.hasClass("ck-image-upload-placeholder")&&t.removeClass("ck-image-upload-placeholder",e),dk(e,t,"placeholder")}function ck(e,t){for(const i of e.getChildren())if(i.getCustomProperty(t))return i}function dk(e,t,i){const n=ck(e,i);n&&t.remove(t.createRangeOn(n))}class uk extends Xu{constructor(e){super(e),this.set("isAccessAllowed",!0)}refresh(){const e=this.editor,t=e.plugins.get("ImageUtils"),i=e.model.document.selection.getSelectedElement();this.isEnabled=t.isImageAllowed()||t.isImage(i)}execute(e){const t=Dt(e.file),i=this.editor.model.document.selection,n=this.editor.plugins.get("ImageUtils"),o=Object.fromEntries(i.getAttributes());t.forEach((e,t)=>{const r=i.getSelectedElement();if(t&&r&&n.isImage(r)){const t=this.editor.model.createPositionAfter(r);this._uploadImage(e,o,t)}else this._uploadImage(e,o)})}_uploadImage(e,t,i){const n=this.editor,o=n.plugins.get(If).createLoader(e),r=n.plugins.get("ImageUtils");o&&r.insertImage({...t,uploadId:o.id},i)}}class hk extends Qu{static get requires(){return[If,sp,Gh,Pp]}static get pluginName(){return"ImageUploadEditing"}static get isOfficialPlugin(){return!0}_uploadImageElements;_uploadedImages=new Map;constructor(e){super(e),e.config.define("image",{upload:{types:["jpeg","png","gif","bmp","webp","tiff"]}}),this._uploadImageElements=new Map}init(){const e=this.editor,t=e.model.document,i=e.conversion,n=e.plugins.get(If),o=e.plugins.get("ImageUtils"),r=e.plugins.get("ClipboardPipeline"),s=Yb(e.config.get("image.upload.types")),a=new uk(e);e.commands.add("uploadImage",a),e.commands.add("imageUpload",a),i.for("upcast").attributeToAttribute({view:{name:"img",key:"uploadId"},model:"uploadId"}).add(e=>e.on("element:img",(e,t,i)=>{if(!i.consumable.test(t.viewItem,{attributes:["data-ck-upload-id"]}))return;const o=t.viewItem.getAttribute("data-ck-upload-id");if(!o)return;const[r]=Array.from(t.modelRange.getItems({shallow:!0})),s=n.loaders.get(o);r&&(i.writer.setAttribute("uploadId",o,r),i.consumable.consume(t.viewItem,{attributes:["data-ck-upload-id"]}),s&&s.data&&i.writer.setAttribute("uploadStatus",s.status,r))},{priority:"low"})),this.listenTo(e.editing.view.document,"clipboardInput",(t,i)=>{if(n=i.dataTransfer,Array.from(n.types).includes("text/html")&&""!==n.getData("text/html"))return;var n;const o=Array.from(i.dataTransfer.files).filter(e=>!!e&&s.test(e.type));if(!o.length)return;t.stop(),e.model.change(t=>{i.targetRanges&&t.setSelection(i.targetRanges.map(t=>e.editing.mapper.toModelRange(t))),e.execute("uploadImage",{file:o})});if(!e.commands.get("uploadImage").isAccessAllowed){const t=e.plugins.get("Notification"),i=e.locale.t;t.showWarning(i("You have no image upload permissions."),{namespace:"image"})}}),this.listenTo(r,"inputTransformation",(t,i)=>{const r=Array.from(e.editing.view.createRangeIn(i.content)).map(e=>e.item).filter(e=>function(e,t){return!(!e.isInlineImageView(t)||!t.getAttribute("src")||!t.getAttribute("src").match(/^data:image\/\w+;base64,/g)&&!t.getAttribute("src").match(/^blob:/g))}(o,e)&&!e.getAttribute("uploadProcessed")).map(e=>({promise:Jb(e),imageElement:e}));if(!r.length)return;const s=new kd(e.editing.view.document);for(const e of r){s.setAttribute("uploadProcessed",!0,e.imageElement);const t=n.createLoader(e.promise);t&&(s.setAttribute("src","",e.imageElement),s.setAttribute("uploadId",t.id,e.imageElement))}}),e.editing.view.document.on("dragover",(e,t)=>{t.preventDefault()}),t.on("change",()=>{const i=t.differ.getChanges({includeChangesInGraveyard:!0}).reverse(),o=new Set;for(const t of i)if("insert"==t.type&&"$text"!=t.name){const i=t.position.nodeAfter,r="$graveyard"==t.position.root.rootName;for(const t of mk(e,i)){const i=t.getAttribute("uploadId"),s=t.getAttribute("uploadStatus");if(!i||"complete"==s)continue;const a=n.loaders.get(i);if(a)if(r){if(!o.has(i)){Array.from(this._uploadImageElements.get(i)).every(e=>"$graveyard"==e.root.rootName)&&a.abort()}}else o.add(i),this._uploadImageElements.has(i)?this._uploadImageElements.get(i).add(t):this._uploadImageElements.set(i,new Set([t])),"idle"==a.status&&this._readAndUpload(a);else!r&&this._uploadedImages.has(i)&&e.model.enqueueChange({isUndoable:!1},e=>{e.setAttribute("uploadStatus","complete",t),this.fire("uploadComplete",{data:this._uploadedImages.get(i),imageElement:t})})}}}),this.on("uploadComplete",(e,{imageElement:t,data:i})=>{const n=i.urls?i.urls:i;this.editor.model.change(e=>{e.setAttribute("src",n.default,t),this._parseAndSetSrcsetAttributeOnImage(n,t,e),o.setImageNaturalSizeAttributes(t)})},{priority:"low"})}afterInit(){const e=this.editor.model.schema;this.editor.plugins.has("ImageBlockEditing")&&(e.extend("imageBlock",{allowAttributes:["uploadId","uploadStatus"]}),this._registerConverters("imageBlock")),this.editor.plugins.has("ImageInlineEditing")&&(e.extend("imageInline",{allowAttributes:["uploadId","uploadStatus"]}),this._registerConverters("imageInline"))}_readAndUpload(e){const t=this.editor,i=t.model,n=t.locale.t,o=t.plugins.get(If),s=t.plugins.get(sp),a=t.plugins.get("ImageUtils"),l=this._uploadImageElements;return i.enqueueChange({isUndoable:!1},t=>{const i=l.get(e.id);for(const e of i)t.setAttribute("uploadStatus","reading",e)}),e.read().then(()=>{const o=e.upload();t.ui&&t.ui.ariaLiveAnnouncer.announce(n("Uploading image"));for(const n of l.get(e.id)){if(r.isSafari){const e=t.editing.mapper.toViewElement(n),i=a.findViewImgElement(e);t.editing.view.once("render",()=>{if(!i.parent)return;const e=t.editing.view.domConverter.mapViewToDom(i.parent);if(!e)return;const n=e.style.display;e.style.display="none",e._ckHack=e.offsetHeight,e.style.display=n})}i.enqueueChange({isUndoable:!1},e=>{e.setAttribute("uploadStatus","uploading",n)})}return o}).then(o=>{i.enqueueChange({isUndoable:!1},i=>{for(const t of l.get(e.id))i.setAttribute("uploadStatus","complete",t),this.fire("uploadComplete",{data:o,imageElement:t});t.ui&&t.ui.ariaLiveAnnouncer.announce(n("Image upload complete")),this._uploadedImages.set(e.id,o)}),c()}).catch(o=>{if(t.ui&&t.ui.ariaLiveAnnouncer.announce(n("Error during image upload")),"error"!==e.status&&"aborted"!==e.status)throw o;"error"==e.status&&o&&s.showWarning(o,{title:n("Upload failed"),namespace:"upload"}),i.enqueueChange({isUndoable:!1},t=>{for(const i of l.get(e.id))"$graveyard"!==i.root.rootName&&t.remove(i)}),c()});function c(){i.enqueueChange({isUndoable:!1},t=>{for(const i of l.get(e.id))t.removeAttribute("uploadId",i),t.removeAttribute("uploadStatus",i);l.delete(e.id)}),o.destroyLoader(e)}}_parseAndSetSrcsetAttributeOnImage(e,t,i){let n=0;const o=Object.keys(e).filter(e=>{const t=parseInt(e,10);if(!isNaN(t))return n=Math.max(n,t),!0}).map(t=>`${e[t]} ${t}w`).join(", ");if(""!=o){const e={srcset:o};t.hasAttribute("width")||t.hasAttribute("height")||(e.width=n),i.setAttributes(e,t)}}_registerConverters(e){const{conversion:t,plugins:i}=this.editor,n=i.get(If),o=i.get(Pp);t.for("dataDowncast").add(t=>{t.on(`attribute:uploadId:${e}`,(e,t,i)=>{if(!i.consumable.test(t.item,e.name))return;const r=n.loaders.get(t.attributeNewValue);if(!r||!r.data)return null;const s=i.mapper.toViewElement(t.item),a=o.findViewImgElement(s);a&&(i.consumable.consume(t.item,e.name),i.writer.setAttribute("data-ck-upload-id",r.id,a))})})}}function mk(e,t){const i=e.plugins.get("ImageUtils");return Array.from(e.model.createRangeOn(t)).filter(e=>i.isImage(e.item)).map(e=>e.item)}class gk extends Qu{static get pluginName(){return"ImageUpload"}static get isOfficialPlugin(){return!0}static get requires(){return[hk,Zb,rk]}}class fk extends Zi{urlInputView;keystrokes;constructor(e){super(e),this.set("imageURLInputValue",""),this.set("isImageSelected",!1),this.set("isEnabled",!0),this.keystrokes=new ti,this.urlInputView=this._createUrlInputView(),this.setTemplate({tag:"form",attributes:{class:["ck","ck-image-insert-url"],tabindex:"-1"},children:[this.urlInputView,{tag:"div",attributes:{class:["ck","ck-image-insert-url__action-row"]}}]})}render(){super.render(),zp({view:this}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.keystrokes.destroy()}_createUrlInputView(){const e=this.locale,t=e.t,i=new Up(e,Yp);return i.bind("label").to(this,"isImageSelected",e=>t(e?"Update image URL":"Insert image via URL")),i.bind("isEnabled").to(this),i.fieldView.inputMode="url",i.fieldView.placeholder="https://example.com/image.png",i.fieldView.bind("value").to(this,"imageURLInputValue",e=>e||""),i.fieldView.on("input",()=>{this.imageURLInputValue=i.fieldView.element.value.trim()}),i}focus(){this.urlInputView.focus()}}class pk extends Qu{_imageInsertUI;_formView;static get pluginName(){return"ImageInsertViaUrlUI"}static get isOfficialPlugin(){return!0}static get requires(){return[Cb,vf]}init(){this.editor.ui.componentFactory.add("insertImageViaUrl",()=>this._createToolbarButton()),this.editor.ui.componentFactory.add("menuBar:insertImageViaUrl",()=>this._createMenuBarButton("standalone"))}afterInit(){this._imageInsertUI=this.editor.plugins.get("ImageInsertUI"),this._imageInsertUI.registerIntegration({name:"url",observable:()=>this.editor.commands.get("insertImage"),buttonViewCreator:()=>this._createToolbarButton(),formViewCreator:()=>this._createDropdownButton(),menuBarButtonViewCreator:e=>this._createMenuBarButton(e?"insertOnly":"insertNested")})}_createInsertUrlButton(e){const t=new e(this.editor.locale);return t.icon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M1.201 1C.538 1 0 1.47 0 2.1v14.363c0 .64.534 1.037 1.186 1.037h7.029a5.4 5.4 0 0 1 .615-4.338l.762-1.232-2.975-2.78a.696.696 0 0 0-.957-.033L1.5 13.6V2.5h15v6.023q.675.195 1.307.573l.058.033q.068.042.135.086V2.1c0-.63-.547-1.1-1.2-1.1zm11.713 2.803a2.15 2.15 0 0 0-1.611.834 2.1 2.1 0 0 0-.438 1.158 2.14 2.14 0 0 0 1.277 2.096 2.132 2.132 0 0 0 2.645-3.11 2.13 2.13 0 0 0-1.873-.978"/><path d="M16.63 10.294a3.003 3.003 0 0 0-4.142.887l-.117.177a.65.65 0 0 0-.096.492.66.66 0 0 0 .278.418.7.7 0 0 0 .944-.234 1.74 1.74 0 0 1 2.478-.463 1.87 1.87 0 0 1 .476 2.55.64.64 0 0 0-.071.5.65.65 0 0 0 .309.396.627.627 0 0 0 .869-.19l.027-.041a3.226 3.226 0 0 0-.956-4.492Zm-6.061 3.78-.044.066a3.23 3.23 0 0 0 .82 4.403 3.005 3.005 0 0 0 4.275-.798l.13-.197a.63.63 0 0 0 .092-.475.64.64 0 0 0-.268-.402.713.713 0 0 0-.99.26l-.018.029a1.74 1.74 0 0 1-2.477.461 1.87 1.87 0 0 1-.475-2.55l.029-.047a.65.65 0 0 0 .086-.485.66.66 0 0 0-.275-.408l-.04-.027a.61.61 0 0 0-.845.17"/><path d="M15.312 13.925c.24-.36.154-.838-.19-1.067-.346-.23-.82-.124-1.059.236l-1.268 1.907c-.239.36-.153.838.192 1.067.345.23.818.123 1.057-.236z"/></svg>',t.on("execute",()=>{this._showModal()}),t}_createToolbarButton(){const e=this.editor.locale.t,t=this._createInsertUrlButton(lo);return t.tooltip=!0,t.bind("label").to(this._imageInsertUI,"isImageSelected",t=>e(t?"Update image URL":"Insert image via URL")),t}_createDropdownButton(){const e=this.editor.locale.t,t=this._createInsertUrlButton(lo);return t.withText=!0,t.bind("label").to(this._imageInsertUI,"isImageSelected",t=>e(t?"Update image URL":"Insert via URL")),t}_createMenuBarButton(e){const t=this.editor.locale.t,i=this._createInsertUrlButton(Lu);switch(i.withText=!0,e){case"standalone":i.label=t("Image via URL");break;case"insertOnly":i.label=t("Image");break;case"insertNested":i.label=t("Via URL")}return i}_createInsertUrlView(){const e=this.editor,t=e.locale,i=e.commands.get("replaceImageSource"),n=e.commands.get("insertImage"),o=new fk(t);return o.bind("isImageSelected").to(this._imageInsertUI),o.bind("isEnabled").toMany([n,i],"isEnabled",(...e)=>e.some(e=>e)),o}_showModal(){const e=this.editor,t=e.locale.t,i=e.plugins.get("Dialog");this._formView||(this._formView=this._createInsertUrlView(),this._formView.on("submit",()=>this._handleSave()));const n=e.commands.get("replaceImageSource");this._formView.imageURLInputValue=n.value||"",i.show({id:"insertImageViaUrl",title:t("Image via URL"),isModal:!0,content:this._formView,actionButtons:[{label:t("Cancel"),withText:!0,onExecute:()=>i.hide()},{label:this._imageInsertUI.isImageSelected?t("Save"):t("Insert"),class:"ck-button-action",withText:!0,onExecute:()=>this._handleSave()}]})}_handleSave(){this.editor.commands.get("replaceImageSource").isEnabled?this.editor.execute("replaceImageSource",{source:this._formView.imageURLInputValue}):this.editor.execute("insertImage",{source:this._formView.imageURLInputValue}),this.editor.plugins.get("Dialog").hide()}}class bk extends Qu{static get pluginName(){return"ImageInsertViaUrl"}static get isOfficialPlugin(){return!0}static get requires(){return[pk,Cb]}}class kk extends Xu{refresh(){const e=this.editor,t=e.plugins.get("ImageCaptionUtils"),i=e.plugins.get("ImageUtils");if(!e.plugins.has(kb))return this.isEnabled=!1,void(this.value=!1);const n=e.model.document.selection,o=n.getSelectedElement();if(!o){const e=t.getCaptionFromModelSelection(n);return this.isEnabled=!!e,void(this.value=!!e)}this.isEnabled=i.isImage(o),this.isEnabled?this.value=!!t.getCaptionFromImageModelElement(o):this.value=!1}execute(e={}){const{focusCaptionOnShow:t}=e;this.editor.model.change(e=>{this.value?this._hideImageCaption(e):this._showImageCaption(e,t)})}_showImageCaption(e,t){const i=this.editor.model.document.selection,n=this.editor.plugins.get("ImageCaptionEditing"),o=this.editor.plugins.get("ImageUtils");let r=i.getSelectedElement();const s=n._getSavedCaption(r);o.isInlineImage(r)&&(this.editor.execute("imageTypeBlock"),r=i.getSelectedElement());const a=s||e.createElement("caption");e.append(a,r),t&&e.setSelection(a,"in")}_hideImageCaption(e){const t=this.editor,i=t.model.document.selection,n=t.plugins.get("ImageCaptionEditing"),o=t.plugins.get("ImageCaptionUtils");let r,s=i.getSelectedElement();s?r=o.getCaptionFromImageModelElement(s):(r=o.getCaptionFromModelSelection(i),s=r.parent),n._saveCaption(s,r),e.setSelection(s,"on"),e.remove(r)}}class wk extends Qu{static get pluginName(){return"ImageCaptionUtils"}static get isOfficialPlugin(){return!0}static get requires(){return[Pp]}getCaptionFromImageModelElement(e){for(const t of e.getChildren())if(t&&t.is("element","caption"))return t;return null}getCaptionFromModelSelection(e){const t=this.editor.plugins.get("ImageUtils"),i=e.getFirstPosition().findAncestor("caption");return i&&t.isBlockImage(i.parent)?i:null}matchImageCaptionViewElement(e){const t=this.editor.plugins.get("ImageUtils");return"figcaption"==e.name&&t.isBlockImageView(e.parent)?{name:!0}:null}}class _k extends Qu{static get requires(){return[Pp,wk]}static get pluginName(){return"ImageCaptionEditing"}static get isOfficialPlugin(){return!0}_savedCaptionsMap;constructor(e){super(e),this._savedCaptionsMap=new WeakMap}init(){const e=this.editor,t=e.model.schema;t.isRegistered("caption")?t.extend("caption",{allowIn:"imageBlock"}):t.register("caption",{allowIn:"imageBlock",allowContentOf:"$block",isLimit:!0}),e.commands.add("toggleImageCaption",new kk(this.editor)),this._setupConversion(),this._setupImageTypeCommandsIntegration(),this._registerCaptionReconversion()}_setupConversion(){const e=this.editor,t=e.editing.view,i=e.plugins.get("ImageUtils"),n=e.plugins.get("ImageCaptionUtils"),o=e.t;e.conversion.for("upcast").elementToElement({view:e=>n.matchImageCaptionViewElement(e),model:"caption"}),e.conversion.for("dataDowncast").elementToElement({model:"caption",view:(e,{writer:t})=>i.isBlockImage(e.parent)?t.createContainerElement("figcaption"):null}),e.conversion.for("editingDowncast").elementToElement({model:"caption",view:(e,{writer:n})=>{if(!i.isBlockImage(e.parent))return null;const r=n.createEditableElement("figcaption");n.setCustomProperty("imageCaption",!0,r),r.placeholder=o("Enter image caption"),No({view:t,element:r,keepOnFocus:!0});const s=e.parent.getAttribute("alt");return Xm(r,n,{label:s?o("Caption for image: %0",[s]):o("Caption for the image")})}})}_setupImageTypeCommandsIntegration(){const e=this.editor,t=e.plugins.get("ImageUtils"),i=e.plugins.get("ImageCaptionUtils"),n=e.commands.get("imageTypeInline"),o=e.commands.get("imageTypeBlock"),r=e=>{if(!e.return)return;const{oldElement:n,newElement:o}=e.return;if(!n)return;if(t.isBlockImage(n)){const e=i.getCaptionFromImageModelElement(n);if(e)return void this._saveCaption(o,e)}const r=this._getSavedCaption(n);r&&this._saveCaption(o,r)};n&&this.listenTo(n,"execute",r,{priority:"low"}),o&&this.listenTo(o,"execute",r,{priority:"low"})}_getSavedCaption(e){const t=this._savedCaptionsMap.get(e);return t?$a.fromJSON(t):null}_saveCaption(e,t){this._savedCaptionsMap.set(e,t.toJSON())}_registerCaptionReconversion(){const e=this.editor,t=e.model,i=e.plugins.get("ImageUtils"),n=e.plugins.get("ImageCaptionUtils");t.document.on("change:data",()=>{const o=t.document.differ.getChanges();for(const t of o){if("alt"!==t.attributeKey)continue;const o=t.range.start.nodeAfter;if(i.isBlockImage(o)){const t=n.getCaptionFromImageModelElement(o);if(!t)return;e.editing.reconvertItem(t)}}})}}class vk extends Qu{static get requires(){return[wk]}static get pluginName(){return"ImageCaptionUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.editing.view,i=e.plugins.get("ImageCaptionUtils"),n=e.t;e.ui.componentFactory.add("toggleImageCaption",o=>{const r=e.commands.get("toggleImageCaption"),s=new lo(o);return s.set({icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2 16h9a1 1 0 0 1 0 2H2a1 1 0 0 1 0-2"/><path fill-opacity=".6" d="M17 1a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2zm0 1.5H3a.5.5 0 0 0-.492.41L2.5 3v9a.5.5 0 0 0 .41.492L3 12.5h14a.5.5 0 0 0 .492-.41L17.5 12V3a.5.5 0 0 0-.41-.492z"/></svg>',tooltip:!0,isToggleable:!0}),s.bind("isOn","isEnabled").to(r,"value","isEnabled"),s.bind("label").to(r,"value",e=>n(e?"Toggle caption off":"Toggle caption on")),this.listenTo(s,"execute",()=>{e.execute("toggleImageCaption",{focusCaptionOnShow:!0});const n=i.getCaptionFromModelSelection(e.model.document.selection);if(n){const i=e.editing.mapper.toViewElement(n);t.scrollToTheSelection(),t.change(e=>{e.addClass("image__caption_highlighted",i)})}e.editing.view.focus()}),s})}}var yk=i(3038),Ak={attributes:{"data-cke":!0}};Ak.setAttributes=Ki(),Ak.insert=$i().bind(null,"head"),Ak.domAPI=Hi(),Ak.insertStyleElement=Yi();ji()(yk.A,Ak);yk.A&&yk.A.locals&&yk.A.locals;class xk extends Qu{static get pluginName(){return"IndentEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.commands.add("indent",new th(e)),e.commands.add("outdent",new th(e))}}const Ck='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75m5 6c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75M2.75 16.5h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 1 0 0 1.5M1.632 6.95 5.02 9.358a.4.4 0 0 1-.013.661l-3.39 2.207A.4.4 0 0 1 1 11.892V7.275a.4.4 0 0 1 .632-.326z"/></svg>',Tk='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75m5 6c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75M2.75 16.5h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 1 0 0 1.5m1.618-9.55L.98 9.358a.4.4 0 0 0 .013.661l3.39 2.207A.4.4 0 0 0 5 11.892V7.275a.4.4 0 0 0-.632-.326z"/></svg>';class Ek extends Qu{static get pluginName(){return"IndentUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.locale,i=e.t,n="ltr"==t.uiLanguageDirection?Ck:Tk,o="ltr"==t.uiLanguageDirection?Tk:Ck;this._defineButton("indent",i("Increase indent"),n),this._defineButton("outdent",i("Decrease indent"),o)}_defineButton(e,t,i){const n=this.editor;n.ui.componentFactory.add(e,()=>{const n=this._createButton(lo,e,t,i);return n.set({tooltip:!0}),n}),n.ui.componentFactory.add("menuBar:"+e,()=>this._createButton(Lu,e,t,i))}_createButton(e,t,i,n){const o=this.editor,r=o.commands.get(t),s=new e(o.locale);return s.set({label:i,icon:n}),s.bind("isEnabled").to(r,"isEnabled"),this.listenTo(s,"execute",()=>{o.execute(t),o.editing.view.focus()}),s}}class Ik{_definitions=new Set;get length(){return this._definitions.size}add(e){Array.isArray(e)?e.forEach(e=>this._definitions.add(e)):this._definitions.add(e)}getDispatcher(){return e=>{e.on("attribute:linkHref",(e,t,i)=>{if(!i.consumable.test(t.item,"attribute:linkHref"))return;if(!t.item.is("selection")&&!i.schema.isInline(t.item))return;const n=i.writer,o=n.document.selection;for(const e of this._definitions){const r=n.createAttributeElement("a",e.attributes,{priority:5});e.classes&&n.addClass(e.classes,r);for(const t in e.styles)n.setStyle(t,e.styles[t],r);n.setCustomProperty("link",!0,r),e.callback(t.attributeNewValue)?t.item.is("selection")?n.wrap(o.getFirstRange(),r):n.wrap(i.mapper.toViewRange(t.range),r):n.unwrap(i.mapper.toViewRange(t.range),r)}},{priority:"high"})}}getDispatcherForLinkedImage(){return e=>{e.on("attribute:linkHref:imageBlock",(e,t,{writer:i,mapper:n})=>{const o=n.toViewElement(t.item),r=Array.from(o.getChildren()).find(e=>e.is("element","a"));if(r)for(const e of this._definitions){const n=ii(e.attributes);if(e.callback(t.attributeNewValue)){for(const[e,t]of n)"class"===e?i.addClass(t,r):i.setAttribute(e,t,r);e.classes&&i.addClass(e.classes,r);for(const t in e.styles)i.setStyle(t,e.styles[t],r)}else{for(const[e,t]of n)"class"===e?i.removeClass(t,r):i.removeAttribute(e,r);e.classes&&i.removeClass(e.classes,r);for(const t in e.styles)i.removeStyle(t,r)}}})}}}function Sk(e){return function(e){return e.substring(0,1).toUpperCase()+e.substring(1)}(ym(e))}const Pk=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,Mk=/^[\S]+@((?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.))+(?:[a-z\u00a1-\uffff]{2,})$/i,Ok=/^((\w+:(\/{2,})?)|(\W))/i,Rk=["https?","ftps?","mailto"],Nk="Ctrl+K";function Vk(e,{writer:t}){const i=t.createAttributeElement("a",{href:e},{priority:5});return t.setCustomProperty("link",!0,i),i}function Lk(e,t=Rk){const i=String(e),n=t.join("|");return function(e,t){const i=e.replace(Pk,"");return!!i.match(t)}(i,new RegExp(`${"^(?:(?:<protocols>):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))".replace("<protocols>",n)}`,"i"))?i:"#"}function Dk(e,t){return!!e&&t.checkAttribute(e.name,"linkHref")}function Bk(e,t){const i=(n=e,Mk.test(n)?"mailto:":t);var n;const o=!!i&&!zk(e);return e&&o?i+e:e}function zk(e){return Ok.test(e)}function Fk(e){let t="";for(const i of e.getItems()){if(!i.is("$text")&&!i.is("$textProxy"))return;t+=i.data}return t}class jk extends Xu{manualDecorators=new Yt;automaticDecorators=new Ik;restoreManualDecoratorStates(){for(const e of this.manualDecorators)e.value=this._getDecoratorStateFromModel(e.id)}refresh(){const e=this.editor.model,t=e.document.selection,i=t.getSelectedElement()||Jt(t.getSelectedBlocks());Dk(i,e.schema)?(this.value=i.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttribute(i,"linkHref")):(this.value=t.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttributeInSelection(t,"linkHref"));for(const e of this.manualDecorators)e.value=this._getDecoratorStateFromModel(e.id)}execute(e,t={},i){const n=this.editor.model,o=n.document.selection,r=[],s=[];for(const e in t)t[e]?r.push(e):s.push(e);n.change(t=>{const a=i=>{t.setAttribute("linkHref",e,i),r.forEach(e=>t.setAttribute(e,!0,i)),s.forEach(e=>t.removeAttribute(e,i))},l=(o,r)=>{const s=Fk(o);if(!s)return o;let l=i;if(l||(l=r&&r==s?e:s),l!=s){const e=t.createDocumentFragment();for(const i of o.getItems()){const n=i;t.append(t.createText(n.data,n.getAttributes()),e)}const i=t.createRangeIn(e),r=function(e,t){const i=b(e,t),n={equal:0,insert:0,delete:0},o=[];let r="",s="";for(const a of[...i,null])"insert"==a?s+=t[n.equal+n.insert]:"delete"==a?r+=e[n.equal+n.delete]:(r.length||s.length)&&(o.push({offset:n.equal,actual:r,expected:s}),r="",s=""),a&&n[a]++;return o}(s,l);let c=0;for(const{offset:e,actual:o,expected:s}of r){const r=e+c,l=t.createRange(i.start.getShiftedBy(r),i.start.getShiftedBy(r+o.length)),d=Uk(l,i).getAttributes(),u=Array.from(d).filter(([e])=>n.schema.getAttributeProperties(e).isFormatting),h=t.createText(s,u);a(h),t.remove(l),t.insert(h,l.start),c+=s.length}return n.insertContent(e,o),t.createRange(o.start,o.start.getShiftedBy(l.length))}},c=e=>{const{plugins:i}=this.editor;if(t.setSelection(e.end),i.has("TwoStepCaretMovement"))i.get("TwoStepCaretMovement")._handleForwardMovement();else for(const e of["linkHref",...r,...s])t.removeSelectionAttribute(e)};if(o.isCollapsed){const s=o.getFirstPosition();if(o.hasAttribute("linkHref")){const e=o.getAttribute("linkHref"),t=Pm(s,"linkHref",e,n),i=l(t,e);a(i||t),i&&c(i)}else if(""!==e){const a=ii(o.getAttributes());a.set("linkHref",e),r.forEach(e=>{a.set(e,!0)});c(n.insertContent(t.createText(i||e,a),s))}}else{const e=Array.from(o.getRanges()),i=n.schema.getValidRanges(e,"linkHref"),r=[];for(const e of o.getSelectedBlocks())n.schema.checkAttribute(e,"linkHref")&&r.push(t.createRangeOn(e));const s=r.slice();for(const e of i)this._isRangeToUpdate(e,r)&&s.push(e);const c=e.map(e=>({start:Ac.fromPosition(e.start,"toPrevious"),end:Ac.fromPosition(e.end,"toNext")}));for(let e of s){e=l(e,(e.start.textNode||e.start.nodeAfter).getAttribute("linkHref"))||e,a(e)}t.setSelection(c.map(e=>{const t=e.start.toPosition(),i=e.end.toPosition();return e.start.detach(),e.end.detach(),n.createRange(t,i)}))}})}_getDecoratorStateFromModel(e){const t=this.editor.model,i=t.document.selection,n=i.getSelectedElement();return Dk(n,t.schema)?n.getAttribute(e):i.getAttribute(e)}_isRangeToUpdate(e,t){for(const i of t)if(i.containsRange(e))return!1;return!0}}function Uk(e,t){if(!e.isCollapsed)return Jt(e.getItems());const i=e.start;return i.textNode?i.textNode:!i.nodeBefore||i.isEqual(t.start)?i.nodeAfter:i.nodeBefore}class Hk extends Xu{refresh(){const e=this.editor.model,t=e.document.selection,i=t.getSelectedElement();Dk(i,e.schema)?this.isEnabled=e.schema.checkAttribute(i,"linkHref"):this.isEnabled=e.schema.checkAttributeInSelection(t,"linkHref")}execute(){const e=this.editor,t=this.editor.model,i=t.document.selection,n=e.commands.get("link");t.change(e=>{const o=i.isCollapsed?[Pm(i.getFirstPosition(),"linkHref",i.getAttribute("linkHref"),t)]:t.schema.getValidRanges(i.getRanges(),"linkHref");for(const t of o)if(e.removeAttribute("linkHref",t),n)for(const i of n.manualDecorators)e.removeAttribute(i.id,t)})}}class Wk extends(K()){id;defaultValue;label;attributes;classes;styles;constructor({id:e,label:t,attributes:i,classes:n,styles:o,defaultValue:r}){super(),this.id=e,this.set("value",void 0),this.defaultValue=r,this.label=t,this.attributes=i,this.classes=n,this.styles=o}_createPattern(){return{attributes:this.attributes,classes:this.classes,styles:this.styles}}}var $k=i(7456),qk={attributes:{"data-cke":!0}};qk.setAttributes=Ki(),qk.insert=$i().bind(null,"head"),qk.domAPI=Hi(),qk.insertStyleElement=Yi();ji()($k.A,qk);$k.A&&$k.A.locals&&$k.A.locals;const Kk="automatic",Gk=/^(https?:)?\/\//;class Yk extends Qu{_linkOpeners=[];static get pluginName(){return"LinkEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[fm,em,Gh]}constructor(e){super(e),e.config.define("link",{allowCreatingEmptyLinks:!1,addTargetToExternalLinks:!1,toolbar:["linkPreview","|","editLink","linkProperties","unlink"]})}init(){const e=this.editor,t=this.editor.config.get("link.allowedProtocols");e.model.schema.extend("$text",{allowAttributes:"linkHref"}),e.conversion.for("dataDowncast").attributeToElement({model:"linkHref",view:Vk}),e.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(e,i)=>Vk(Lk(e,t),i)}),e.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:!0}},model:{key:"linkHref",value:e=>e.getAttribute("href")}}),e.commands.add("link",new jk(e)),e.commands.add("unlink",new Hk(e));const i=function(e,t){const i={"Open in a new tab":e("Open in a new tab"),Downloadable:e("Downloadable")};return t.forEach(e=>("label"in e&&i[e.label]&&(e.label=i[e.label]),e)),t}(e.t,function(e){const t=[];if(e)for(const[i,n]of Object.entries(e)){const e=Object.assign({},n,{id:`link${Sk(i)}`});t.push(e)}return t}(e.config.get("link.decorators")));this._enableAutomaticDecorators(i.filter(e=>e.mode===Kk)),this._enableManualDecorators(i.filter(e=>"manual"===e.mode));e.plugins.get(fm).registerAttribute("linkHref"),function(e,t,i,n){const o=e.editing.view,r=new Set;o.document.registerPostFixer(o=>{const s=e.model.document.selection;let a=!1;if(s.hasAttribute(t)){const l=Pm(s.getFirstPosition(),t,s.getAttribute(t),e.model),c=e.editing.mapper.toViewRange(l);for(const e of c.getItems())e.is("element",i)&&!e.hasClass(n)&&(o.addClass(n,e),r.add(e),a=!0)}return a}),e.conversion.for("editingDowncast").add(e=>{function t(){o.change(e=>{for(const t of r.values())e.removeClass(n,t),r.delete(t)})}e.on("insert",t,{priority:"highest"}),e.on("remove",t,{priority:"highest"}),e.on("attribute",t,{priority:"highest"}),e.on("selection",t,{priority:"highest"})})}(e,"linkHref","a","ck-link_selected"),this._enableLinkOpen(),this._enableSelectionAttributesFixer(),this._enableClipboardIntegration()}_registerLinkOpener(e){this._linkOpeners.push(e)}_enableAutomaticDecorators(e){const t=this.editor,i=t.commands.get("link").automaticDecorators;t.config.get("link.addTargetToExternalLinks")&&i.add({id:"linkIsExternal",mode:Kk,callback:e=>!!e&&Gk.test(e),attributes:{target:"_blank",rel:"noopener noreferrer"}}),i.add(e),i.length&&t.conversion.for("downcast").add(i.getDispatcher())}_enableManualDecorators(e){if(!e.length)return;const t=this.editor,i=t.commands.get("link").manualDecorators;e.forEach(e=>{t.model.schema.extend("$text",{allowAttributes:e.id});const n=new Wk(e);i.add(n),t.conversion.for("downcast").attributeToElement({model:n.id,view:(e,{writer:t,schema:i},{item:o})=>{if((o.is("selection")||i.isInline(o))&&e){const e=t.createAttributeElement("a",n.attributes,{priority:5});n.classes&&t.addClass(n.classes,e);for(const i in n.styles)t.setStyle(i,n.styles[i],e);return t.setCustomProperty("link",!0,e),e}}}),t.conversion.for("upcast").elementToAttribute({view:{name:"a",...n._createPattern()},model:{key:n.id}})})}_enableLinkOpen(){const e=this.editor,t=e.editing.view.document,i=e=>{var t;this._linkOpeners.some(t=>t(e))||(t=e,window.open(t,"_blank","noopener"))};this.listenTo(t,"click",(e,t)=>{if(!(r.isMac?t.domEvent.metaKey:t.domEvent.ctrlKey))return;let n=t.domTarget;if("a"!=n.tagName.toLowerCase()&&(n=n.closest("a")),!n)return;const o=n.getAttribute("href");o&&(e.stop(),t.preventDefault(),i(o))},{context:"$capture"}),this.listenTo(t,"keydown",(t,n)=>{const o=e.commands.get("link").value;!!o&&n.keyCode===Pt.enter&&n.altKey&&(t.stop(),i(o))})}_enableSelectionAttributesFixer(){const e=this.editor.model,t=e.document.selection;this.listenTo(t,"change:attribute",(i,{attributeKeys:n})=>{n.includes("linkHref")&&!t.hasAttribute("linkHref")&&e.change(t=>{var i;!function(e,t){e.removeSelectionAttribute("linkHref");for(const i of t)e.removeSelectionAttribute(i)}(t,(i=e.schema,i.getDefinition("$text").allowAttributes.filter(e=>e.startsWith("link"))))})})}_enableClipboardIntegration(){const e=this.editor,t=e.model,i=this.editor.config.get("link.defaultProtocol");i&&this.listenTo(e.plugins.get("ClipboardPipeline"),"contentInsertion",(e,n)=>{t.change(e=>{const t=e.createRangeIn(n.content);for(const n of t.getItems())if(n.hasAttribute("linkHref")){const t=Bk(n.getAttribute("linkHref"),i);e.setAttribute("linkHref",t,n)}})})}}class Jk extends lo{constructor(e){super(e);const t=this.bindTemplate;this.set({href:void 0,withText:!0}),this.extendTemplate({attributes:{class:["ck-link-toolbar__preview"],href:t.to("href"),target:"_blank",rel:"noopener noreferrer"},on:{click:t.to(e=>{if(this.href){const t=()=>e.preventDefault();this.fire("navigate",this.href,t)}})}}),this.template.tag="a"}}var Qk=i(2350),Zk={attributes:{"data-cke":!0}};Zk.setAttributes=Ki(),Zk.insert=$i().bind(null,"head"),Zk.domAPI=Hi(),Zk.insertStyleElement=Yi();ji()(Qk.A,Zk);Qk.A&&Qk.A.locals&&Qk.A.locals;class Xk extends Zi{focusTracker=new Qt;keystrokes=new ti;backButtonView;saveButtonView;displayedTextInputView;urlInputView;children;providersListChildren;_validators;_focusables=new pi;_focusCycler;constructor(e,t){super(e),this._validators=t,this.backButtonView=this._createBackButton(),this.saveButtonView=this._createSaveButton(),this.displayedTextInputView=this._createDisplayedTextInput(),this.urlInputView=this._createUrlInput(),this.providersListChildren=this.createCollection(),this.children=this.createCollection([this._createHeaderView()]),this._createFormChildren(),this.listenTo(this.providersListChildren,"add",()=>{this.stopListening(this.providersListChildren,"add"),this.children.add(this._createProvidersListView())}),this._focusCycler=new uo({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-form","ck-link-form","ck-responsive-form"],tabindex:"-1"},children:this.children})}render(){super.render(),zp({view:this});[this.urlInputView,this.saveButtonView,...this.providersListChildren,this.backButtonView,this.displayedTextInputView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}isValid(){this.resetFormStatus();for(const e of this._validators){const t=e(this);if(t)return this.urlInputView.errorText=t,!1}return!0}resetFormStatus(){this.urlInputView.errorText=null}_createBackButton(){const e=this.locale.t,t=new lo(this.locale);return t.set({class:"ck-button-back",label:e("Back"),icon:wg,tooltip:!0}),t.delegate("execute").to(this,"cancel"),t}_createSaveButton(){const e=this.locale.t,t=new lo(this.locale);return t.set({label:e("Insert"),tooltip:!1,withText:!0,type:"submit",class:"ck-button-action ck-button-bold"}),t}_createHeaderView(){const e=this.locale.t,t=new oo(this.locale,{label:e("Link")});return t.children.add(this.backButtonView,0),t}_createProvidersListView(){const e=new Wd(this.locale);return e.extendTemplate({attributes:{class:["ck-link-form__providers-list"]}}),e.items.bindTo(this.providersListChildren).using(e=>{const t=new Mn(this.locale);return t.children.add(e),t}),e}_createDisplayedTextInput(){const e=this.locale.t,t=new Up(this.locale,Yp);return t.label=e("Displayed text"),t.class="ck-labeled-field-view_full-width",t}_createUrlInput(){const e=this.locale.t,t=new Up(this.locale,Yp);return t.fieldView.inputMode="url",t.label=e("Link URL"),t.class="ck-labeled-field-view_full-width",t}_createFormChildren(){this.children.add(new Bp(this.locale,{children:[this.displayedTextInputView],class:["ck-form__row_large-top-padding"]})),this.children.add(new Bp(this.locale,{children:[this.urlInputView,this.saveButtonView],class:["ck-form__row_with-submit","ck-form__row_large-top-padding","ck-form__row_large-bottom-padding"]}))}get url(){const{element:e}=this.urlInputView.fieldView;return e?e.value.trim():null}}var ew=i(1175),tw={attributes:{"data-cke":!0}};tw.setAttributes=Ki(),tw.insert=$i().bind(null,"head"),tw.domAPI=Hi(),tw.insertStyleElement=Yi();ji()(ew.A,tw);ew.A&&ew.A.locals&&ew.A.locals;class iw extends Zi{focusTracker=new Qt;keystrokes=new ti;backButtonView;listView;listChildren;emptyListInformation;children;_focusables=new pi;_focusCycler;constructor(e){super(e),this.listChildren=this.createCollection(),this.backButtonView=this._createBackButton(),this.listView=this._createListView(),this.emptyListInformation=this._createEmptyLinksListItemView(),this.children=this.createCollection([this._createHeaderView(),this.emptyListInformation]),this.set("title",""),this.set("emptyListPlaceholder",""),this.set("hasItems",!1),this.listenTo(this.listChildren,"change",()=>{this.hasItems=this.listChildren.length>0}),this.on("change:hasItems",(e,t,i)=>{i?(this.children.remove(this.emptyListInformation),this.children.add(this.listView)):(this.children.remove(this.listView),this.children.add(this.emptyListInformation))}),this.keystrokes.set("Esc",(e,t)=>{this.fire("cancel"),t()}),this._focusCycler=new uo({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-link-providers"],tabindex:"-1"},children:this.children})}render(){super.render();[this.listView,this.backButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createListView(){const e=new Wd(this.locale);return e.extendTemplate({attributes:{class:["ck-link-providers__list"]}}),e.items.bindTo(this.listChildren).using(e=>{const t=new Mn(this.locale);return t.children.add(e),t}),e}_createBackButton(){const e=this.locale.t,t=new lo(this.locale);return t.set({class:"ck-button-back",label:e("Back"),icon:wg,tooltip:!0}),t.delegate("execute").to(this,"cancel"),t}_createHeaderView(){const e=new oo(this.locale);return e.bind("label").to(this,"title"),e.children.add(this.backButtonView,0),e}_createEmptyLinksListItemView(){const e=new Zi(this.locale);return e.setTemplate({tag:"p",attributes:{class:["ck","ck-link__empty-list-info"]},children:[{text:this.bindTemplate.to("emptyListPlaceholder")}]}),e}}var nw=i(8163),ow={attributes:{"data-cke":!0}};ow.setAttributes=Ki(),ow.insert=$i().bind(null,"head"),ow.domAPI=Hi(),ow.insertStyleElement=Yi();ji()(nw.A,ow);nw.A&&nw.A.locals&&nw.A.locals;class rw extends Zi{focusTracker=new Qt;keystrokes=new ti;backButtonView;children;listChildren;_focusables=new pi;_focusCycler;constructor(e){super(e),this.backButtonView=this._createBackButton(),this.listChildren=this.createCollection(),this.children=this.createCollection([this._createHeaderView(),this._createListView()]),this._focusCycler=new uo({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-link-properties"],tabindex:"-1"},children:this.children}),this.keystrokes.set("Esc",(e,t)=>{this.fire("back"),t()})}render(){super.render();[...this.listChildren,this.backButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createBackButton(){const e=this.locale.t,t=new lo(this.locale);return t.set({class:"ck-button-back",label:e("Back"),icon:wg,tooltip:!0}),t.delegate("execute").to(this,"back"),t}_createHeaderView(){const e=this.locale.t,t=new oo(this.locale,{label:e("Link properties")});return t.children.add(this.backButtonView,0),t}_createListView(){const e=new Wd(this.locale);return e.extendTemplate({attributes:{class:["ck-link__list"]}}),e.items.bindTo(this.listChildren).using(e=>{const t=new Mn(this.locale);return t.children.add(e),t}),e}}class sw extends lo{arrowView;constructor(e){super(e),this.set({withText:!0}),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{class:["ck-link__button"]}})}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){const e=new wn;return e.content=_g,e}}var aw=i(263),lw={attributes:{"data-cke":!0}};lw.setAttributes=Ki(),lw.insert=$i().bind(null,"head"),lw.domAPI=Hi(),lw.insertStyleElement=Yi();ji()(aw.A,lw);aw.A&&aw.A.locals&&aw.A.locals;const cw="link-ui";class dw extends Qu{toolbarView=null;formView=null;linkProviderItemsView=null;propertiesView=null;_balloon;_linksProviders=new Yt;static get requires(){return[Tg,Yk]}static get pluginName(){return"LinkUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=this.editor.t;this.set("selectedLinkableText",void 0),e.editing.view.addObserver(gd),this._balloon=e.plugins.get(Tg),this._registerComponents(),this._registerEditingOpeners(),this._enableBalloonActivators(),e.conversion.for("editingDowncast").markerToHighlight({model:cw,view:{classes:["ck-fake-link-selection"]}}),e.conversion.for("editingDowncast").markerToElement({model:cw,view:(e,{writer:t})=>{if(!e.markerRange.isCollapsed)return null;const i=t.createUIElement("span");return t.addClass(["ck-fake-link-selection","ck-fake-link-selection_collapsed"],i),i}}),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Create link"),keystroke:Nk},{label:t("Move out of a link"),keystroke:[["arrowleft","arrowleft"],["arrowright","arrowright"]]}]})}destroy(){super.destroy(),this.propertiesView&&this.propertiesView.destroy(),this.formView&&this.formView.destroy(),this.toolbarView&&this.toolbarView.destroy(),this.linkProviderItemsView&&this.linkProviderItemsView.destroy()}registerLinksListProvider(e){const t=this._linksProviders.filter(t=>(t.order||0)<=(e.order||0)).length;this._linksProviders.add(e,t)}_createViews(){const e=this.editor.commands.get("link");this.toolbarView=this._createToolbarView(),this.formView=this._createFormView(),e.manualDecorators.length&&(this.propertiesView=this._createPropertiesView()),this._enableUserBalloonInteractions()}_createToolbarView(){const e=this.editor,t=new wu(e.locale),i=e.commands.get("link");t.class="ck-link-toolbar";let n=e.config.get("link.toolbar");return i.manualDecorators.length||(n=n.filter(e=>"linkProperties"!==e)),t.fillFromConfig(n,e.ui.componentFactory),t.keystrokes.set("Esc",(e,t)=>{this._hideUI(),t()}),t.keystrokes.set(Nk,(e,t)=>{this._addFormView(),t()}),e.ui.addToolbar(t,{isContextual:!0,beforeFocus:()=>{this._getSelectedLinkElement()&&!this._isToolbarVisible&&this._showUI(!0)},afterBlur:()=>{this._hideUI(!1)}}),t}_createFormView(){const e=this.editor,t=e.locale.t,i=e.commands.get("link"),n=e.config.get("link.defaultProtocol"),o=new(Vp(Xk))(e.locale,function(e){const t=e.t,i=e.config.get("link.allowCreatingEmptyLinks");return[e=>{if(!i&&!e.url.length)return t("Link URL must not be empty.")}]}(e));return o.displayedTextInputView.bind("isEnabled").to(this,"selectedLinkableText",e=>void 0!==e),o.urlInputView.bind("isEnabled").to(i,"isEnabled"),o.saveButtonView.bind("isEnabled").to(i,"isEnabled"),o.saveButtonView.bind("label").to(i,"value",e=>t(e?"Update":"Insert")),this.listenTo(o,"submit",()=>{if(o.isValid()){const t=Bk(o.urlInputView.fieldView.element.value,n),i=o.displayedTextInputView.fieldView.element.value;e.execute("link",t,this._getDecoratorSwitchesState(),i!==this.selectedLinkableText?i:void 0),this._closeFormView()}}),this.listenTo(o.urlInputView,"change:errorText",()=>{e.ui.update()}),this.listenTo(o,"cancel",()=>{this._closeFormView()}),o.keystrokes.set("Esc",(e,t)=>{this._closeFormView(),t()}),o.providersListChildren.bindTo(this._linksProviders).using(e=>this._createLinksListProviderButton(e)),o}_createLinkProviderListView(e){return e.getListItems().map(({href:e,label:t,icon:i})=>{const n=new lo;return n.set({label:t,icon:i,tooltip:!1,withText:!0}),n.on("execute",()=>{this.formView.resetFormStatus(),this.formView.urlInputView.fieldView.value=e,this.editor.editing.view.focus(),this._removeLinksProviderView(),this.formView.focus()}),n})}_createLinkProviderItemsView(e){const t=this.editor,i=t.locale.t,n=new iw(t.locale),{emptyListPlaceholder:o,label:r}=e;return n.emptyListPlaceholder=o||i("No links available"),n.title=r,this.listenTo(n,"cancel",()=>{t.editing.view.focus(),this._removeLinksProviderView(),this.formView.focus()}),n}_createPropertiesView(){const e=this.editor,t=this.editor.commands.get("link"),i=new(Vp(rw))(e.locale);return this.listenTo(i,"back",()=>{e.editing.view.focus(),this._removePropertiesView()}),i.listChildren.bindTo(t.manualDecorators).using(i=>{const n=new Jd(e.locale);return n.set({label:i.label,withText:!0}),n.bind("isOn").toMany([i,t],"value",(e,t)=>void 0===t&&void 0===e?!!i.defaultValue:!!e),n.on("execute",()=>{i.set("value",!n.isOn),e.execute("link",t.value,this._getDecoratorSwitchesState())}),n}),i}_getDecoratorSwitchesState(){const e=this.editor.commands.get("link");return Array.from(e.manualDecorators).reduce((t,i)=>{const n=void 0===e.value&&void 0===i.value?i.defaultValue:i.value;return{...t,[i.id]:!!n}},{})}_registerEditingOpeners(){this.editor.plugins.get(Yk)._registerLinkOpener(e=>{const t=this._getLinkProviderLinkByHref(e);if(!t)return!1;const{item:i,provider:n}=t;return!!n.navigate&&n.navigate(i)})}_registerComponents(){const e=this.editor;e.ui.componentFactory.add("link",()=>{const e=this._createButton(lo);return e.set({tooltip:!0}),e}),e.ui.componentFactory.add("menuBar:link",()=>{const e=this._createButton(Lu);return e.set({role:"menuitemcheckbox"}),e}),e.ui.componentFactory.add("linkPreview",t=>{const i=new Jk(t),n=e.config.get("link.allowedProtocols"),o=e.commands.get("link"),r=t.t;i.bind("isEnabled").to(o,"value",e=>!!e),i.bind("href").to(o,"value",e=>e&&Lk(e,n));const s=e=>{if(!e)return i.label=void 0,i.icon=void 0,void(i.tooltip=r("Open link in new tab"));const t=this._getLinkProviderLinkByHref(e);if(t){const{label:e,tooltip:n,icon:o}=t.item;i.label=e,i.tooltip=n||!1,i.icon=o}else i.label=e,i.icon=void 0,i.tooltip=r("Open link in new tab")};return s(o.value),this.listenTo(o,"change:value",(e,t,i)=>{s(i)}),this.listenTo(i,"navigate",(e,t,i)=>{const n=this._getLinkProviderLinkByHref(t);if(!n)return;const{provider:o,item:r}=n,{navigate:s}=o;s&&s(r)&&(e.stop(),i())}),i}),e.ui.componentFactory.add("unlink",t=>{const i=e.commands.get("unlink"),n=new lo(t),o=t.t;return n.set({label:o("Unlink"),icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="m11.077 15 .991-1.416a.75.75 0 1 1 1.229.86l-1.148 1.64a.8.8 0 0 1-.217.206 5.251 5.251 0 0 1-8.503-5.955.7.7 0 0 1 .12-.274l1.147-1.639a.75.75 0 1 1 1.228.86L4.933 10.7l.006.003a3.75 3.75 0 0 0 6.132 4.294zm5.494-5.335a.8.8 0 0 1-.12.274l-1.147 1.639a.75.75 0 1 1-1.228-.86l.86-1.23a3.75 3.75 0 0 0-6.144-4.301l-.86 1.229a.75.75 0 0 1-1.229-.86l1.148-1.64a.8.8 0 0 1 .217-.206 5.251 5.251 0 0 1 8.503 5.955m-4.563-2.532a.75.75 0 0 1 .184 1.045l-3.155 4.505a.75.75 0 1 1-1.229-.86l3.155-4.506a.75.75 0 0 1 1.045-.184m4.919 10.562-1.414 1.414a.75.75 0 1 1-1.06-1.06l1.414-1.415-1.415-1.414a.75.75 0 0 1 1.061-1.06l1.414 1.414 1.414-1.415a.75.75 0 0 1 1.061 1.061l-1.414 1.414 1.414 1.415a.75.75 0 0 1-1.06 1.06z"/></svg>',tooltip:!0}),n.bind("isEnabled").to(i),this.listenTo(n,"execute",()=>{e.execute("unlink"),this._hideUI()}),n}),e.ui.componentFactory.add("editLink",t=>{const i=e.commands.get("link"),n=new lo(t),o=t.t;return n.set({label:o("Edit link"),icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="m7.3 17.37-.061.088a1.52 1.52 0 0 1-.934.535l-4.178.663-.806-4.153a1.5 1.5 0 0 1 .187-1.058l.056-.086L8.77 2.639c.958-1.351 2.803-1.076 4.296-.03 1.497 1.047 2.387 2.693 1.433 4.055zM9.14 4.728l-5.545 8.346 3.277 2.294 5.544-8.346zM6.07 16.512l-3.276-2.295.53 2.73zM9.994 3.506 13.271 5.8c.316-.452-.16-1.333-1.065-1.966-.905-.634-1.895-.78-2.212-.328M8 18.5 9.375 17H19v1.5z"/></svg>',tooltip:!0}),n.bind("isEnabled").to(i),this.listenTo(n,"execute",()=>{this._addFormView()}),n}),e.ui.componentFactory.add("linkProperties",t=>{const i=e.commands.get("link"),n=new lo(t),o=t.t;return n.set({label:o("Link properties"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M3.734 6.375H1.75a.75.75 0 0 1 0-1.5h1.984a2.626 2.626 0 0 1 5.032 0h9.48a.75.75 0 0 1 0 1.5h-9.48a2.626 2.626 0 0 1-5.032 0Zm1.141-.75a1.375 1.375 0 1 1 2.75 0 1.375 1.375 0 0 1-2.75 0ZM16.263 14.625h1.983a.75.75 0 0 1 0 1.5h-1.983a2.626 2.626 0 0 1-5.033 0H1.75a.75.75 0 0 1 0-1.5h9.48a2.626 2.626 0 0 1 5.033 0Zm-1.142.75a1.375 1.375 0 1 1-2.75 0 1.375 1.375 0 0 1 2.75 0Z"/></svg>\n',tooltip:!0}),n.bind("isEnabled").to(i,"isEnabled",i,"value",i,"manualDecorators",(e,t,i)=>e&&!!t&&i.length>0),this.listenTo(n,"execute",()=>{this._addPropertiesView()}),n})}_createLinksListProviderButton(e){const t=this.editor.locale,i=new sw(t);return i.set({label:e.label}),this.listenTo(i,"execute",()=>{this._showLinksProviderView(e)}),i}_createButton(e){const t=this.editor,i=t.locale,n=t.commands.get("link"),o=new e(t.locale),r=i.t;return o.set({label:r("Link"),icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="m11.077 15 .991-1.416a.75.75 0 1 1 1.229.86l-1.148 1.64a.8.8 0 0 1-.217.206 5.251 5.251 0 0 1-8.503-5.955.7.7 0 0 1 .12-.274l1.147-1.639a.75.75 0 1 1 1.228.86L4.933 10.7l.006.003a3.75 3.75 0 0 0 6.132 4.294zm5.494-5.335a.8.8 0 0 1-.12.274l-1.147 1.639a.75.75 0 1 1-1.228-.86l.86-1.23a3.75 3.75 0 0 0-6.144-4.301l-.86 1.229a.75.75 0 0 1-1.229-.86l1.148-1.64a.8.8 0 0 1 .217-.206 5.251 5.251 0 0 1 8.503 5.955m-4.563-2.532a.75.75 0 0 1 .184 1.045l-3.155 4.505a.75.75 0 1 1-1.229-.86l3.155-4.506a.75.75 0 0 1 1.045-.184"/></svg>',keystroke:Nk,isToggleable:!0}),o.bind("isEnabled").to(n,"isEnabled"),o.bind("isOn").to(n,"value",e=>!!e),this.listenTo(o,"execute",()=>{t.editing.view.scrollToTheSelection(),this._showUI(!0),this._getSelectedLinkElement()&&this._addFormView()}),o}_enableBalloonActivators(){const e=this.editor,t=e.editing.view.document;this.listenTo(t,"click",()=>{this._getSelectedLinkElement()&&this._showUI()}),e.keystrokes.set(Nk,(t,i)=>{i(),e.commands.get("link").isEnabled&&(e.editing.view.scrollToTheSelection(),this._showUI(!0))})}_enableUserBalloonInteractions(){this.editor.keystrokes.set("Tab",(e,t)=>{this._isToolbarVisible&&!this.toolbarView.focusTracker.isFocused&&(this.toolbarView.focus(),t())},{priority:"high"}),this.editor.keystrokes.set("Esc",(e,t)=>{this._isUIVisible&&(this._hideUI(),t())}),Vn({emitter:this.formView,activator:()=>this._isUIInPanel,contextElements:()=>[this._balloon.view.element],callback:()=>{this._hideUI(!1)}})}_addToolbarView(){this.toolbarView||this._createViews(),this._isToolbarInPanel||this._balloon.add({view:this.toolbarView,position:this._getBalloonPositionData(),balloonClassName:"ck-toolbar-container"})}_addFormView(){if(this.formView||this._createViews(),this._isFormInPanel)return;const e=this.editor.commands.get("link");this.formView.disableCssTransitions(),this.formView.resetFormStatus(),this.formView.backButtonView.isVisible=e.isEnabled&&!!e.value,this._balloon.add({view:this.formView,position:this._getBalloonPositionData()}),this.selectedLinkableText=this._getSelectedLinkableText(),this.formView.displayedTextInputView.fieldView.value=this.selectedLinkableText||"",this.formView.urlInputView.fieldView.value=e.value||"",this._balloon.visibleView===this.formView&&this.formView.urlInputView.fieldView.select(),this.formView.enableCssTransitions()}_addPropertiesView(){this.propertiesView||this._createViews(),this._arePropertiesInPanel||(this.propertiesView.disableCssTransitions(),this._balloon.add({view:this.propertiesView,position:this._getBalloonPositionData()}),this.propertiesView.enableCssTransitions(),this.propertiesView.focus())}_showLinksProviderView(e){this.linkProviderItemsView&&this._removeLinksProviderView(),this.linkProviderItemsView=this._createLinkProviderItemsView(e),this._addLinkProviderItemsView(e)}_addLinkProviderItemsView(e){this.linkProviderItemsView.listChildren.clear(),this.linkProviderItemsView.listChildren.addMany(this._createLinkProviderListView(e)),this._balloon.add({view:this.linkProviderItemsView,position:this._getBalloonPositionData()}),this.linkProviderItemsView.focus()}_closeFormView(){const e=this.editor.commands.get("link");this.selectedLinkableText=void 0,void 0!==e.value?this._removeFormView():this._hideUI()}_removePropertiesView(){this._arePropertiesInPanel&&this._balloon.remove(this.propertiesView)}_removeLinksProviderView(){this._isLinksListInPanel&&this._balloon.remove(this.linkProviderItemsView)}_removeFormView(e=!0){this._isFormInPanel&&(this.formView.saveButtonView.focus(),this.formView.displayedTextInputView.fieldView.reset(),this.formView.urlInputView.fieldView.reset(),this._balloon.remove(this.formView),e&&this.editor.editing.view.focus(),this._hideFakeVisualSelection())}_showUI(e=!1){this.formView||this._createViews(),this._getSelectedLinkElement()?(this._isToolbarVisible?this._addFormView():this._addToolbarView(),e&&this._balloon.showStack("main")):(this._showFakeVisualSelection(),this._addToolbarView(),e&&this._balloon.showStack("main"),this._addFormView()),this._startUpdatingUI()}_hideUI(e=!0){const t=this.editor;this._isUIInPanel&&(this.stopListening(t.ui,"update"),this.stopListening(this._balloon,"change:visibleView"),e&&t.editing.view.focus(),this._removeLinksProviderView(),this._removePropertiesView(),this._removeFormView(e),this._isToolbarInPanel&&this._balloon.remove(this.toolbarView),this._hideFakeVisualSelection())}_startUpdatingUI(){const e=this.editor,t=e.editing.view.document;let i=this._getSelectedLinkElement(),n=r();const o=()=>{const e=this._getSelectedLinkElement(),t=r();i&&!e||!i&&t!==n?this._hideUI():this._isUIVisible&&this._balloon.updatePosition(this._getBalloonPositionData()),i=e,n=t};function r(){return t.selection.focus.getAncestors().reverse().find(e=>e.is("element"))}this.listenTo(e.ui,"update",o),this.listenTo(this._balloon,"change:visibleView",o)}get _arePropertiesInPanel(){return!!this.propertiesView&&this._balloon.hasView(this.propertiesView)}get _isLinksListInPanel(){return!!this.linkProviderItemsView&&this._balloon.hasView(this.linkProviderItemsView)}get _isFormInPanel(){return!!this.formView&&this._balloon.hasView(this.formView)}get _isToolbarInPanel(){return!!this.toolbarView&&this._balloon.hasView(this.toolbarView)}get _isPropertiesVisible(){return!!this.propertiesView&&this._balloon.visibleView===this.propertiesView}get _isFormVisible(){return!!this.formView&&this._balloon.visibleView==this.formView}get _isToolbarVisible(){return!!this.toolbarView&&this._balloon.visibleView===this.toolbarView}get _isUIInPanel(){return this._arePropertiesInPanel||this._isLinksListInPanel||this._isFormInPanel||this._isToolbarInPanel}get _isUIVisible(){return this._isPropertiesVisible||this._isLinksListInPanel||this._isFormVisible||this._isToolbarVisible}_getBalloonPositionData(){const e=this.editor.editing.view,t=e.document;if(this.editor.model.markers.has(cw)){const t=this.editor.editing.mapper.markerNameToElements(cw);if(t){const i=Array.from(t),n=e.createRange(e.createPositionBefore(i[0]),e.createPositionAfter(i[i.length-1]));return{target:e.domConverter.viewRangeToDom(n)}}}return{target:()=>{const i=this._getSelectedLinkElement();return i?e.domConverter.mapViewToDom(i):e.domConverter.viewRangeToDom(t.selection.getFirstRange())}}}_getSelectedLinkElement(){const e=this.editor.editing.view,t=e.document.selection,i=t.getSelectedElement();if(t.isCollapsed||i&&Gm(i))return uw(t.getFirstPosition());{const i=t.getFirstRange().getTrimmed(),n=uw(i.start),o=uw(i.end);return n&&n==o&&e.createRangeIn(n).getTrimmed().isEqual(i)?n:null}}_getSelectedLinkableText(){const e=this.editor.model,t=this.editor.editing,i=this._getSelectedLinkElement();if(!i)return Fk(e.document.selection.getFirstRange());const n=t.view.createRangeOn(i);return Fk(t.mapper.toModelRange(n))}_getLinkProviderLinkByHref(e){if(!e)return null;for(const t of this._linksProviders){const i=t.getItem?t.getItem(e):t.getListItems().find(t=>t.href===e);if(i)return{provider:t,item:i}}return null}_showFakeVisualSelection(){const e=this.editor.model;e.change(t=>{const i=e.document.selection.getFirstRange();if(e.markers.has(cw))t.updateMarker(cw,{range:i});else if(i.start.isAtEnd){const n=i.start.getLastMatchingPosition(({item:t})=>!e.schema.isContent(t),{boundaries:i});t.addMarker(cw,{usingOperation:!1,affectsData:!1,range:t.createRange(n,i.end)})}else t.addMarker(cw,{usingOperation:!1,affectsData:!1,range:i})})}_hideFakeVisualSelection(){const e=this.editor.model;e.markers.has(cw)&&e.change(e=>{e.removeMarker(cw)})}}function uw(e){return e.getAncestors().find(e=>{return(t=e).is("attributeElement")&&!!t.getCustomProperty("link");var t})||null}const hw=new RegExp("(^|\\s)(((?:(?:(?:https?|ftp):)?\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(((?!www\\.)|(www\\.))(?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.)+(?:[a-z\\u00a1-\\uffff]{2,63}))|localhost)(?::\\d{2,5})?(?:[/?#]\\S*)?)|((www.|(\\S+@))((?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.))+(?:[a-z\\u00a1-\\uffff]{2,63})))$","i");class mw extends Qu{static get requires(){return[um,Yk]}static get pluginName(){return"AutoLink"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.model.document.selection;e.on("change:range",()=>{this.isEnabled=!e.anchor.parent.is("element","codeBlock")}),this._enableTypingHandling()}afterInit(){this._enableEnterHandling(),this._enableShiftEnterHandling(),this._enablePasteLinking()}_expandLinkRange(e,t){return t.textNode&&t.textNode.hasAttribute("linkHref")?Pm(t,"linkHref",t.textNode.getAttribute("linkHref"),e):null}_selectEntireLinks(e,t){const i=this.editor.model,n=i.document.selection,o=n.getFirstPosition(),r=n.getLastPosition();let s=t.getJoined(this._expandLinkRange(i,o)||t);s&&(s=s.getJoined(this._expandLinkRange(i,r)||t)),s&&(s.start.isBefore(o)||s.end.isAfter(r))&&e.setSelection(s)}_enablePasteLinking(){const e=this.editor,t=e.model,i=t.document.selection,n=e.plugins.get("ClipboardPipeline"),o=e.commands.get("link");n.on("inputTransformation",(e,n)=>{if(!this.isEnabled||!o.isEnabled||i.isCollapsed||"paste"!==n.method)return;if(i.rangeCount>1)return;const r=i.getFirstRange(),s=n.dataTransfer.getData("text/plain");if(!s)return;const a=s.match(hw);a&&a[2]===s&&(t.change(e=>{this._selectEntireLinks(e,r),o.execute(s)}),e.stop())},{priority:"high"})}_enableTypingHandling(){const e=this.editor,t=new gm(e.model,e=>{let t=e;if(!function(e){return e.length>4&&" "===e[e.length-1]&&" "!==e[e.length-2]}(t))return;t=t.slice(0,-1),"!.:,;?".includes(t[t.length-1])&&(t=t.slice(0,-1));const i=gw(t);return i?{url:i,removedTrailingCharacters:e.length-t.length}:void 0});t.on("matched:data",(t,i)=>{const{batch:n,range:o,url:r,removedTrailingCharacters:s}=i;if(!n.isTyping)return;const a=o.end.getShiftedBy(-s),l=a.getShiftedBy(-r.length),c=e.model.createRange(l,a);this._applyAutoLink(r,c)}),t.bind("isEnabled").to(this)}_enableEnterHandling(){const e=this.editor,t=e.model,i=e.commands.get("enter");i&&i.on("execute",()=>{const e=t.document.selection.getFirstPosition();let i;i=e.parent.previousSibling?.is("element")?t.createRangeIn(e.parent.previousSibling):t.createRange(t.createPositionAt(e.parent,0),e),this._checkAndApplyAutoLinkOnRange(i)})}_enableShiftEnterHandling(){const e=this.editor,t=e.model,i=e.commands.get("shiftEnter");i&&i.on("execute",()=>{const e=t.document.selection.getFirstPosition(),i=t.createRange(t.createPositionAt(e.parent,0),e.getShiftedBy(-1));this._checkAndApplyAutoLinkOnRange(i)})}_checkAndApplyAutoLinkOnRange(e){const t=this.editor.model,{text:i,range:n}=mm(e,t),o=gw(i);if(o){const e=t.createRange(n.end.getShiftedBy(-o.length),n.end);this._applyAutoLink(o,e)}}_applyAutoLink(e,t){const i=this.editor.model,n=Bk(e,this.editor.config.get("link.defaultProtocol"));this.isEnabled&&function(e,t){return t.schema.checkAttributeInSelection(t.createSelection(e),"linkHref")}(t,i)&&zk(n)&&!function(e){const t=e.start.nodeAfter;return!!t&&t.hasAttribute("linkHref")}(t)&&this._persistAutoLink(n,t)}_persistAutoLink(e,t){const i=this.editor.model,n=this.editor.plugins.get("Delete");i.enqueueChange(o=>{o.setAttribute("linkHref",e,t),i.enqueueChange(()=>{n.requestUndoOnBackspace()})})}}function gw(e){const t=hw.exec(e);return t?t[2]:null}class fw{_startElement;_referenceIndent;_isForward;_includeSelf;_sameAttributes;_sameIndent;_lowerIndent;_higherIndent;constructor(e,t){this._startElement=e,this._referenceIndent=e.getAttribute("listIndent"),this._isForward="forward"==t.direction,this._includeSelf=!!t.includeSelf,this._sameAttributes=Dt(t.sameAttributes||[]),this._sameIndent=!!t.sameIndent,this._lowerIndent=!!t.lowerIndent,this._higherIndent=!!t.higherIndent}static first(e,t){return Jt(new this(e,t)[Symbol.iterator]())}*[Symbol.iterator](){const e=[];for(const{node:t}of new pw(this._getStartNode(),this._isForward?"forward":"backward")){const i=t.getAttribute("listIndent");if(i<this._referenceIndent){if(!this._lowerIndent)break;this._referenceIndent=i}else if(i>this._referenceIndent){if(!this._higherIndent)continue;if(!this._isForward){e.push(t);continue}}else{if(!this._sameIndent){if(this._higherIndent){e.length&&(yield*e,e.length=0);break}continue}if(this._sameAttributes.some(e=>t.getAttribute(e)!==this._startElement.getAttribute(e)))break}e.length&&(yield*e,e.length=0),yield t}}_getStartNode(){return this._includeSelf?this._startElement:this._isForward?this._startElement.nextSibling:this._startElement.previousSibling}}class pw{_node;_isForward;_previousNodesByIndent=[];_previous=null;_previousNodeIndent=null;constructor(e,t="forward"){this._node=e,this._isForward="forward"===t}[Symbol.iterator](){return this}next(){if(!ww(this._node))return{done:!0,value:void 0};const e=this._node.getAttribute("listIndent");let t=null;if(this._previous){const i=this._previousNodeIndent;e>i?this._previousNodesByIndent[i]=this._previous:e<i?(t=this._previousNodesByIndent[e]||null,this._previousNodesByIndent.length=e):t=this._previous}const i={node:this._node,previous:this._previous,previousNodeInList:t};return this._previous=this._node,this._previousNodeIndent=e,this._node=this._isForward?this._node.nextSibling:this._node.previousSibling,{value:i,done:!1}}}class bw{_listHead;constructor(e){this._listHead=e}[Symbol.iterator](){return new pw(this._listHead)}}class kw{static next(){return _()}}function ww(e){return!!e&&e.is("element")&&e.hasAttribute("listItemId")}function _w(e,t={}){return[...vw(e,{...t,direction:"backward"}),...vw(e,{...t,direction:"forward"})]}function vw(e,t={}){const i="forward"==t.direction,n=Array.from(new fw(e,{...t,includeSelf:i,sameIndent:!0,sameAttributes:"listItemId"}));return i?n:n.reverse()}function yw(e,t){const i=new fw(e,{sameIndent:!0,sameAttributes:"listType",...t}),n=new fw(e,{sameIndent:!0,sameAttributes:"listType",includeSelf:!0,direction:"forward",...t});return[...Array.from(i).reverse(),...n]}function Aw(e){return!fw.first(e,{sameIndent:!0,sameAttributes:"listItemId"})}function xw(e){return!fw.first(e,{direction:"forward",sameIndent:!0,sameAttributes:"listItemId"})}function Cw(e,t={}){e=Dt(e);const i=!1!==t.withNested,n=new Set;for(const t of e)for(const e of _w(t,{higherIndent:i}))n.add(e);return Mw(n)}function Tw(e,t){const i=vw(e,{direction:"forward"}),n=kw.next();for(const e of i)t.setAttribute("listItemId",n,e);return i}function Ew(e,t,i){const n={};for(const[e,i]of t.getAttributes())e.startsWith("list")&&(n[e]=i);const o=vw(e,{direction:"forward"});for(const e of o)i.setAttributes(n,e);return o}function Iw(e,t,{expand:i,indentBy:n=1}={}){e=Dt(e);const o=i?Cw(e):e;for(const e of o){const i=e.getAttribute("listIndent")+n;i<0?Sw(e,t):t.setAttribute("listIndent",i,e)}return o}function Sw(e,t){e=Dt(e);for(const i of e)i.is("element","listItem")&&t.rename(i,"paragraph");for(const i of e)for(const e of i.getAttributeKeys())e.startsWith("list")&&t.removeAttribute(e,i);return e}function Pw(e){if(!e.length)return!1;const t=e[0].getAttribute("listItemId");return!!t&&!e.some(e=>e.getAttribute("listItemId")!=t)}function Mw(e){return Array.from(e).filter(e=>"$graveyard"!==e.root.rootName).sort((e,t)=>e.index-t.index)}function Ow(e){const t=e.document.selection.getSelectedElement();return t&&e.schema.isObject(t)&&e.schema.isBlock(t)?t:null}function Rw(e,t){return t.checkChild(e.parent,"listItem")&&t.checkChild(e,"$text")&&!t.isObject(e)}function Nw(e,t,i){return vw(t,{direction:"forward"}).pop().index>e.index?Ew(e,t,i):[]}class Vw extends Xu{_direction;constructor(e,t){super(e),this._direction=t}refresh(){this.isEnabled=this._checkEnabled()}execute(){const e=this.editor.model,t=Lw(e.document.selection);e.change(e=>{const i=[];Pw(t)&&!Aw(t[0])?("forward"==this._direction&&i.push(...Iw(t,e)),i.push(...Tw(t[0],e))):"forward"==this._direction?i.push(...Iw(t,e,{expand:!0})):i.push(...function(e,t){const i=Cw(e=Dt(e)),n=new Set,o=Math.min(...i.map(e=>e.getAttribute("listIndent"))),r=new Map;for(const e of i)r.set(e,fw.first(e,{lowerIndent:!0}));for(const e of i){if(n.has(e))continue;n.add(e);const i=e.getAttribute("listIndent")-1;if(i<0)Sw(e,t);else{if(e.getAttribute("listIndent")==o){const i=Nw(e,r.get(e),t);for(const e of i)n.add(e);if(i.length)continue}t.setAttribute("listIndent",i,e)}}return Mw(n)}(t,e));for(const t of i){if(!t.hasAttribute("listType"))continue;const i=fw.first(t,{sameIndent:!0});i&&e.setAttribute("listType",i.getAttribute("listType"),t)}this._fireAfterExecute(i)})}_fireAfterExecute(e){this.fire("afterExecute",Mw(new Set(e)))}_checkEnabled(){let e=Lw(this.editor.model.document.selection),t=e[0];if(!t)return!1;if("backward"==this._direction)return!0;if(Pw(e)&&!Aw(e[0]))return!0;e=Cw(e),t=e[0];const i=fw.first(t,{sameIndent:!0});return!!i&&i.getAttribute("listType")==t.getAttribute("listType")}}function Lw(e){const t=Array.from(e.getSelectedBlocks()),i=t.findIndex(e=>!ww(e));return-1!=i&&(t.length=i),t}class Dw extends Xu{type;_listWalkerOptions;constructor(e,t,i={}){super(e),this.type=t,this._listWalkerOptions=i.multiLevel?{higherIndent:!0,lowerIndent:!0,sameAttributes:[]}:void 0}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor.model,i=t.document,n=Ow(t),o=Array.from(i.selection.getSelectedBlocks()).filter(e=>t.schema.checkAttribute(e,"listType")||Rw(e,t.schema)),r=void 0!==e.forceValue?!e.forceValue:this.value;t.change(s=>{if(r){const e=o[o.length-1],t=vw(e,{direction:"forward"}),i=[];t.length>1&&i.push(...Tw(t[1],s)),i.push(...Sw(o,s)),i.push(...function(e,t){const i=[];let n=Number.POSITIVE_INFINITY;for(const{node:o}of new pw(e.nextSibling)){const e=o.getAttribute("listIndent");if(0==e)break;e<n&&(n=e);const r=e-n;t.setAttribute("listIndent",r,o),i.push(o)}return i}(e,s)),this._fireAfterExecute(i)}else if((n||i.selection.isCollapsed)&&ww(o[0])){const t=yw(n||o[0],this._listWalkerOptions);for(const i of t)s.setAttributes({...e.additionalAttributes,listType:this.type},i);this._fireAfterExecute(t)}else{const i=[];for(const n of o)if(n.hasAttribute("listType"))for(const t of Cw(n,{withNested:!1}))t.getAttribute("listType")!=this.type&&(s.setAttributes({...e.additionalAttributes,listType:this.type},t),i.push(t));else!n.is("element","listItem")&&Rw(n,t.schema)&&s.rename(n,"listItem"),s.setAttributes({...e.additionalAttributes,listIndent:0,listItemId:kw.next(),listType:this.type},n),i.push(n);this._fireAfterExecute(i)}})}_fireAfterExecute(e){this.fire("afterExecute",Mw(new Set(e)))}_getValue(){const e=this.editor.model.document.selection,t=Array.from(e.getSelectedBlocks());if(!t.length)return!1;for(const e of t)if(e.getAttribute("listType")!=this.type)return!1;return!0}_checkEnabled(){const e=this.editor.model,t=e.schema,i=e.document.selection,n=Array.from(i.getSelectedBlocks());if(!n.length)return!1;if(this.value)return!0;for(const e of n)if(t.checkAttribute(e,"listType")||Rw(e,t))return!0;return!1}}class Bw extends Xu{_direction;constructor(e,t){super(e),this._direction=t}refresh(){this.isEnabled=this._checkEnabled()}execute({shouldMergeOnBlocksContentLevel:e=!1}={}){const t=this.editor.model,i=t.document.selection,n=[];t.change(o=>{const{firstElement:r,lastElement:s}=this._getMergeSubjectElements(i,e),a=r.getAttribute("listIndent")||0,l=s.getAttribute("listIndent"),c=s.getAttribute("listItemId");if(a!=l){const e=(d=s,Array.from(new fw(d,{direction:"forward",higherIndent:!0})));n.push(...Iw([s,...e],o,{indentBy:a-l,expand:a<l}))}var d;if(e){let e=i;i.isCollapsed&&(e=o.createSelection(o.createRange(o.createPositionAt(r,"end"),o.createPositionAt(s,0)))),t.deleteContent(e,{doNotResetEntireContent:i.isCollapsed});const a=e.getLastPosition().parent,l=a.nextSibling;n.push(a),l&&l!==s&&l.getAttribute("listItemId")==c&&n.push(...Ew(l,a,o))}else n.push(...Ew(s,r,o));this._fireAfterExecute(n)})}_fireAfterExecute(e){this.fire("afterExecute",Mw(new Set(e)))}_checkEnabled(){const e=this.editor.model,t=e.document.selection,i=Ow(e);if(t.isCollapsed||i){const e=i||t.getFirstPosition().parent;if(!ww(e))return!1;const n="backward"==this._direction?e.previousSibling:e.nextSibling;if(!n)return!1;if(Pw([e,n]))return!1}else{const e=t.getLastPosition(),i=t.getFirstPosition();if(e.parent===i.parent)return!1;if(!ww(e.parent))return!1}return!0}_getMergeSubjectElements(e,t){const i=Ow(this.editor.model);let n,o;if(e.isCollapsed||i){const r=i||e.getFirstPosition().parent,s=Aw(r);"backward"==this._direction?(o=r,n=s&&!t?fw.first(r,{sameIndent:!0,lowerIndent:!0}):r.previousSibling):(n=r,o=r.nextSibling)}else n=e.getFirstPosition().parent,o=e.getLastPosition().parent;return{firstElement:n,lastElement:o}}}class zw extends Xu{_direction;constructor(e,t){super(e),this._direction=t}refresh(){this.isEnabled=this._checkEnabled()}execute(){this.editor.model.change(e=>{const t=Tw(this._getStartBlock(),e);this._fireAfterExecute(t)})}_fireAfterExecute(e){this.fire("afterExecute",Mw(new Set(e)))}_checkEnabled(){const e=this.editor.model.document.selection,t=this._getStartBlock();return e.isCollapsed&&ww(t)&&!Aw(t)}_getStartBlock(){const e=this.editor.model.document.selection.getFirstPosition().parent;return"before"==this._direction?e:e.nextSibling}}class Fw extends Qu{static get pluginName(){return"ListItemBoldIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[Z_]}init(){const e=this.editor,t=e.plugins.get("ListFormatting"),i=e.plugins.get(Z_);e.plugins.has("BoldEditing")&&this.editor.config.get("list.enableListItemMarkerFormatting")&&(t.registerFormatAttribute("bold","listItemBold"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemBold",setAttributeOnDowncast(e,t,i,n){t&&(e.addClass("ck-list-marker-bold",i),!r.isSafari||n&&n.dataPipeline||e.setStyle("--ck-content-list-marker-dummy-bold","0",i))}}))}afterInit(){const e=this.editor,t=e.model;e.plugins.has("BoldEditing")&&this.editor.config.get("list.enableListItemMarkerFormatting")&&(t.schema.extend("$listItem",{allowAttributes:"listItemBold"}),t.schema.setAttributeProperties("listItemBold",{isFormatting:!0}),t.schema.addAttributeCheck(e=>{if(!e.last.getAttribute("listItemId"))return!1},"listItemBold"),e.conversion.for("upcast").attributeToAttribute({model:"listItemBold",view:{name:"li",classes:"ck-list-marker-bold"}}))}}class jw extends Qu{static get pluginName(){return"ListItemItalicIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[Z_]}init(){const e=this.editor,t=e.plugins.get("ListFormatting"),i=e.plugins.get(Z_);e.plugins.has("ItalicEditing")&&this.editor.config.get("list.enableListItemMarkerFormatting")&&(t.registerFormatAttribute("italic","listItemItalic"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemItalic",setAttributeOnDowncast(e,t,i,n){t&&(e.addClass("ck-list-marker-italic",i),!r.isSafari||n&&n.dataPipeline||e.setStyle("--ck-content-list-marker-dummy-italic","0",i))}}))}afterInit(){const e=this.editor,t=e.model;e.plugins.has("ItalicEditing")&&this.editor.config.get("list.enableListItemMarkerFormatting")&&(t.schema.extend("$listItem",{allowAttributes:"listItemItalic"}),t.schema.setAttributeProperties("listItemItalic",{isFormatting:!0}),t.schema.addAttributeCheck(e=>{if(!e.last.getAttribute("listItemId"))return!1},"listItemItalic"),e.conversion.for("upcast").attributeToAttribute({model:"listItemItalic",view:{name:"li",classes:"ck-list-marker-italic"}}))}}function Uw({keystrokeHandler:e,focusTracker:t,gridItems:i,numberOfColumns:n,uiLanguageDirection:o}){const r="number"==typeof n?()=>n:n;function s(e){return n=>{const o=i.find(e=>e.element===t.focusedElement),r=i.getIndex(o),s=e(r,i);i.get(s).focus(),n.stopPropagation(),n.preventDefault()}}function a(e,t){return e===t-1?0:e+1}function l(e,t){return 0===e?t-1:e-1}e.set("arrowright",s((e,t)=>"rtl"===o?l(e,t.length):a(e,t.length))),e.set("arrowleft",s((e,t)=>"rtl"===o?a(e,t.length):l(e,t.length))),e.set("arrowup",s((e,t)=>{let i=e-r();return i<0&&(i=e+r()*Math.floor(t.length/r()),i>t.length-1&&(i-=r())),i})),e.set("arrowdown",s((e,t)=>{let i=e+r();return i>t.length-1&&(i=e%r()),i}))}var Hw=i(7962),Ww={attributes:{"data-cke":!0}};Ww.setAttributes=Ki(),Ww.insert=$i().bind(null,"head"),Ww.domAPI=Hi(),Ww.insertStyleElement=Yi();ji()(Hw.A,Ww);Hw.A&&Hw.A.locals&&Hw.A.locals;const $w='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="m8.636 9.531-2.758 3.94a.5.5 0 0 0 .122.696l3.224 2.284h1.314l2.636-3.736L8.636 9.53zm.288 8.451L5.14 15.396a2 2 0 0 1-.491-2.786l6.673-9.53a2 2 0 0 1 2.785-.49l3.742 2.62a2 2 0 0 1 .491 2.785l-7.269 10.053z"/><path d="M4 18h5.523v-1H4zm-2 0h1v-1H2z"/></svg>';const qw={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(const e in qw)Object.freeze(qw[e]);Object.freeze(qw);const Kw={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(const e in Kw)Object.freeze(Kw[e]);const Gw=Object.freeze(Kw),Yw={};for(const e of Object.keys(Gw))Yw[Gw[e]]=e;const Jw={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},Qw=Jw,Zw=(6/29)**3;function Xw(e){const t=e>.0031308?1.055*e**(1/2.4)-.055:12.92*e;return Math.min(Math.max(0,t),1)}function e_(e){return e>.04045?((e+.055)/1.055)**2.4:e/12.92}for(const e of Object.keys(Jw)){if(!("channels"in Jw[e]))throw new Error("missing channels property: "+e);if(!("labels"in Jw[e]))throw new Error("missing channel labels property: "+e);if(Jw[e].labels.length!==Jw[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:i}=Jw[e];delete Jw[e].channels,delete Jw[e].labels,Object.defineProperty(Jw[e],"channels",{value:t}),Object.defineProperty(Jw[e],"labels",{value:i})}function t_(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}function i_(e){const t=function(){const e={},t=Object.keys(Qw);for(let{length:i}=t,n=0;n<i;n++)e[t[n]]={distance:-1,parent:null};return e}(),i=[e];for(t[e].distance=0;i.length>0;){const e=i.pop(),n=Object.keys(Qw[e]);for(let{length:o}=n,r=0;r<o;r++){const o=n[r],s=t[o];-1===s.distance&&(s.distance=t[e].distance+1,s.parent=e,i.unshift(o))}}return t}function n_(e,t){return function(i){return t(e(i))}}function o_(e,t){const i=[t[e].parent,e];let n=Qw[t[e].parent][e],o=t[e].parent;for(;t[o].parent;)i.unshift(t[o].parent),n=n_(Qw[t[o].parent][o],n),o=t[o].parent;return n.conversion=i,n}Jw.rgb.hsl=function(e){const t=e[0]/255,i=e[1]/255,n=e[2]/255,o=Math.min(t,i,n),r=Math.max(t,i,n),s=r-o;let a,l;switch(r){case o:a=0;break;case t:a=(i-n)/s;break;case i:a=2+(n-t)/s;break;case n:a=4+(t-i)/s}a=Math.min(60*a,360),a<0&&(a+=360);const c=(o+r)/2;return l=r===o?0:c<=.5?s/(r+o):s/(2-r-o),[a,100*l,100*c]},Jw.rgb.hsv=function(e){let t,i,n,o,r;const s=e[0]/255,a=e[1]/255,l=e[2]/255,c=Math.max(s,a,l),d=c-Math.min(s,a,l),u=function(e){return(c-e)/6/d+.5};if(0===d)o=0,r=0;else{switch(r=d/c,t=u(s),i=u(a),n=u(l),c){case s:o=n-i;break;case a:o=1/3+t-n;break;case l:o=2/3+i-t}o<0?o+=1:o>1&&(o-=1)}return[360*o,100*r,100*c]},Jw.rgb.hwb=function(e){const t=e[0],i=e[1];let n=e[2];const o=Jw.rgb.hsl(e)[0],r=1/255*Math.min(t,Math.min(i,n));return n=1-1/255*Math.max(t,Math.max(i,n)),[o,100*r,100*n]},Jw.rgb.oklab=function(e){const t=e_(e[0]/255),i=e_(e[1]/255),n=e_(e[2]/255),o=Math.cbrt(.4122214708*t+.5363325363*i+.0514459929*n),r=Math.cbrt(.2119034982*t+.6806995451*i+.1073969566*n),s=Math.cbrt(.0883024619*t+.2817188376*i+.6299787005*n);return[100*(.2104542553*o+.793617785*r-.0040720468*s),100*(1.9779984951*o-2.428592205*r+.4505937099*s),100*(.0259040371*o+.7827717662*r-.808675766*s)]},Jw.rgb.cmyk=function(e){const t=e[0]/255,i=e[1]/255,n=e[2]/255,o=Math.min(1-t,1-i,1-n);return[100*((1-t-o)/(1-o)||0),100*((1-i-o)/(1-o)||0),100*((1-n-o)/(1-o)||0),100*o]},Jw.rgb.keyword=function(e){const t=Yw[e];if(t)return t;let i,n=Number.POSITIVE_INFINITY;for(const t of Object.keys(Gw)){const o=t_(e,Gw[t]);o<n&&(n=o,i=t)}return i},Jw.keyword.rgb=function(e){return Gw[e]},Jw.rgb.xyz=function(e){const t=e_(e[0]/255),i=e_(e[1]/255),n=e_(e[2]/255);return[100*(.4124564*t+.3575761*i+.1804375*n),100*(.2126729*t+.7151522*i+.072175*n),100*(.0193339*t+.119192*i+.9503041*n)]},Jw.rgb.lab=function(e){const t=Jw.rgb.xyz(e);let i=t[0],n=t[1],o=t[2];i/=95.047,n/=100,o/=108.883,i=i>Zw?i**(1/3):7.787*i+16/116,n=n>Zw?n**(1/3):7.787*n+16/116,o=o>Zw?o**(1/3):7.787*o+16/116;return[116*n-16,500*(i-n),200*(n-o)]},Jw.hsl.rgb=function(e){const t=e[0]/360,i=e[1]/100,n=e[2]/100;let o,r;if(0===i)return r=255*n,[r,r,r];const s=n<.5?n*(1+i):n+i-n*i,a=2*n-s,l=[0,0,0];for(let e=0;e<3;e++)o=t+1/3*-(e-1),o<0&&o++,o>1&&o--,r=6*o<1?a+6*(s-a)*o:2*o<1?s:3*o<2?a+(s-a)*(2/3-o)*6:a,l[e]=255*r;return l},Jw.hsl.hsv=function(e){const t=e[0];let i=e[1]/100,n=e[2]/100,o=i;const r=Math.max(n,.01);n*=2,i*=n<=1?n:2-n,o*=r<=1?r:2-r;return[t,100*(0===n?2*o/(r+o):2*i/(n+i)),100*((n+i)/2)]},Jw.hsv.rgb=function(e){const t=e[0]/60,i=e[1]/100;let n=e[2]/100;const o=Math.floor(t)%6,r=t-Math.floor(t),s=255*n*(1-i),a=255*n*(1-i*r),l=255*n*(1-i*(1-r));switch(n*=255,o){case 0:return[n,l,s];case 1:return[a,n,s];case 2:return[s,n,l];case 3:return[s,a,n];case 4:return[l,s,n];case 5:return[n,s,a]}},Jw.hsv.hsl=function(e){const t=e[0],i=e[1]/100,n=e[2]/100,o=Math.max(n,.01);let r,s;s=(2-i)*n;const a=(2-i)*o;return r=i*o,r/=a<=1?a:2-a,r=r||0,s/=2,[t,100*r,100*s]},Jw.hwb.rgb=function(e){const t=e[0]/360;let i=e[1]/100,n=e[2]/100;const o=i+n;let r;o>1&&(i/=o,n/=o);const s=Math.floor(6*t),a=1-n;r=6*t-s,1&s&&(r=1-r);const l=i+r*(a-i);let c,d,u;switch(s){default:case 6:case 0:c=a,d=l,u=i;break;case 1:c=l,d=a,u=i;break;case 2:c=i,d=a,u=l;break;case 3:c=i,d=l,u=a;break;case 4:c=l,d=i,u=a;break;case 5:c=a,d=i,u=l}return[255*c,255*d,255*u]},Jw.cmyk.rgb=function(e){const t=e[0]/100,i=e[1]/100,n=e[2]/100,o=e[3]/100;return[255*(1-Math.min(1,t*(1-o)+o)),255*(1-Math.min(1,i*(1-o)+o)),255*(1-Math.min(1,n*(1-o)+o))]},Jw.xyz.rgb=function(e){const t=e[0]/100,i=e[1]/100,n=e[2]/100;let o,r,s;return o=3.2404542*t+-1.5371385*i+-.4985314*n,r=-.969266*t+1.8760108*i+.041556*n,s=.0556434*t+-.2040259*i+1.0572252*n,o=Xw(o),r=Xw(r),s=Xw(s),[255*o,255*r,255*s]},Jw.xyz.lab=function(e){let t=e[0],i=e[1],n=e[2];t/=95.047,i/=100,n/=108.883,t=t>Zw?t**(1/3):7.787*t+16/116,i=i>Zw?i**(1/3):7.787*i+16/116,n=n>Zw?n**(1/3):7.787*n+16/116;return[116*i-16,500*(t-i),200*(i-n)]},Jw.xyz.oklab=function(e){const t=e[0]/100,i=e[1]/100,n=e[2]/100,o=Math.cbrt(.8189330101*t+.3618667424*i-.1288597137*n),r=Math.cbrt(.0329845436*t+.9293118715*i+.0361456387*n),s=Math.cbrt(.0482003018*t+.2643662691*i+.633851707*n);return[100*(.2104542553*o+.793617785*r-.0040720468*s),100*(1.9779984951*o-2.428592205*r+.4505937099*s),100*(.0259040371*o+.7827717662*r-.808675766*s)]},Jw.oklab.oklch=function(e){return Jw.lab.lch(e)},Jw.oklab.xyz=function(e){const t=e[0]/100,i=e[1]/100,n=e[2]/100,o=(.999999998*t+.396337792*i+.215803758*n)**3,r=(1.000000008*t-.105561342*i-.063854175*n)**3,s=(1.000000055*t-.089484182*i-1.291485538*n)**3;return[100*(1.227013851*o-.55779998*r+.281256149*s),100*(-.040580178*o+1.11225687*r-.071676679*s),100*(-.076381285*o-.421481978*r+1.58616322*s)]},Jw.oklab.rgb=function(e){const t=e[0]/100,i=e[1]/100,n=e[2]/100,o=(t+.3963377774*i+.2158037573*n)**3,r=(t-.1055613458*i-.0638541728*n)**3,s=(t-.0894841775*i-1.291485548*n)**3;return[255*Xw(4.0767416621*o-3.3077115913*r+.2309699292*s),255*Xw(-1.2684380046*o+2.6097574011*r-.3413193965*s),255*Xw(-.0041960863*o-.7034186147*r+1.707614701*s)]},Jw.oklch.oklab=function(e){return Jw.lch.lab(e)},Jw.lab.xyz=function(e){let t,i,n;i=(e[0]+16)/116,t=e[1]/500+i,n=i-e[2]/200;const o=i**3,r=t**3,s=n**3;return i=o>Zw?o:(i-16/116)/7.787,t=r>Zw?r:(t-16/116)/7.787,n=s>Zw?s:(n-16/116)/7.787,t*=95.047,i*=100,n*=108.883,[t,i,n]},Jw.lab.lch=function(e){const t=e[0],i=e[1],n=e[2];let o;o=360*Math.atan2(n,i)/2/Math.PI,o<0&&(o+=360);return[t,Math.sqrt(i*i+n*n),o]},Jw.lch.lab=function(e){const t=e[0],i=e[1],n=e[2]/360*2*Math.PI;return[t,i*Math.cos(n),i*Math.sin(n)]},Jw.rgb.ansi16=function(e,t=null){const[i,n,o]=e;let r=null===t?Jw.rgb.hsv(e)[2]:t;if(r=Math.round(r/50),0===r)return 30;let s=30+(Math.round(o/255)<<2|Math.round(n/255)<<1|Math.round(i/255));return 2===r&&(s+=60),s},Jw.hsv.ansi16=function(e){return Jw.rgb.ansi16(Jw.hsv.rgb(e),e[2])},Jw.rgb.ansi256=function(e){const t=e[0],i=e[1],n=e[2];if(t>>4==i>>4&&i>>4==n>>4)return t<8?16:t>248?231:Math.round((t-8)/247*24)+232;return 16+36*Math.round(t/255*5)+6*Math.round(i/255*5)+Math.round(n/255*5)},Jw.ansi16.rgb=function(e){let t=(e=e[0])%10;if(0===t||7===t)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const i=.5*(Math.trunc(e>50)+1);return[(1&t)*i*255,(t>>1&1)*i*255,(t>>2&1)*i*255]},Jw.ansi256.rgb=function(e){if((e=e[0])>=232){const t=10*(e-232)+8;return[t,t,t]}let t;e-=16;return[Math.floor(e/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},Jw.rgb.hex=function(e){const t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".slice(t.length)+t},Jw.hex.rgb=function(e){const t=e.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!t)return[0,0,0];let i=t[0];3===t[0].length&&(i=[...i].map(e=>e+e).join(""));const n=Number.parseInt(i,16);return[n>>16&255,n>>8&255,255&n]},Jw.rgb.hcg=function(e){const t=e[0]/255,i=e[1]/255,n=e[2]/255,o=Math.max(Math.max(t,i),n),r=Math.min(Math.min(t,i),n),s=o-r;let a;return a=s<=0?0:o===t?(i-n)/s%6:o===i?2+(n-t)/s:4+(t-i)/s,a/=6,a%=1,[360*a,100*s,100*(s<1?r/(1-s):0)]},Jw.hsl.hcg=function(e){const t=e[1]/100,i=e[2]/100,n=i<.5?2*t*i:2*t*(1-i);let o=0;return n<1&&(o=(i-.5*n)/(1-n)),[e[0],100*n,100*o]},Jw.hsv.hcg=function(e){const t=e[1]/100,i=e[2]/100,n=t*i;let o=0;return n<1&&(o=(i-n)/(1-n)),[e[0],100*n,100*o]},Jw.hcg.rgb=function(e){const t=e[0]/360,i=e[1]/100,n=e[2]/100;if(0===i)return[255*n,255*n,255*n];const o=[0,0,0],r=t%1*6,s=r%1,a=1-s;let l=0;switch(Math.floor(r)){case 0:o[0]=1,o[1]=s,o[2]=0;break;case 1:o[0]=a,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=s;break;case 3:o[0]=0,o[1]=a,o[2]=1;break;case 4:o[0]=s,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=a}return l=(1-i)*n,[255*(i*o[0]+l),255*(i*o[1]+l),255*(i*o[2]+l)]},Jw.hcg.hsv=function(e){const t=e[1]/100,i=t+e[2]/100*(1-t);let n=0;return i>0&&(n=t/i),[e[0],100*n,100*i]},Jw.hcg.hsl=function(e){const t=e[1]/100,i=e[2]/100*(1-t)+.5*t;let n=0;return i>0&&i<.5?n=t/(2*i):i>=.5&&i<1&&(n=t/(2*(1-i))),[e[0],100*n,100*i]},Jw.hcg.hwb=function(e){const t=e[1]/100,i=t+e[2]/100*(1-t);return[e[0],100*(i-t),100*(1-i)]},Jw.hwb.hcg=function(e){const t=e[1]/100,i=1-e[2]/100,n=i-t;let o=0;return n<1&&(o=(i-n)/(1-n)),[e[0],100*n,100*o]},Jw.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},Jw.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},Jw.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},Jw.gray.hsl=function(e){return[0,0,e[0]]},Jw.gray.hsv=Jw.gray.hsl,Jw.gray.hwb=function(e){return[0,100,e[0]]},Jw.gray.cmyk=function(e){return[0,0,0,e[0]]},Jw.gray.lab=function(e){return[e[0],0,0]},Jw.gray.hex=function(e){const t=255&Math.round(e[0]/100*255),i=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".slice(i.length)+i},Jw.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};const r_=function(e){const t=i_(e),i={},n=Object.keys(t);for(let{length:e}=n,o=0;o<e;o++){const e=n[o];null!==t[e].parent&&(i[e]=o_(e,t))}return i},s_={},a_=Object.keys(Qw);function l_(e){const t=function(...t){const i=t[0];return null==i?i:(i.length>1&&(t=i),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}function c_(e){const t=function(...t){const i=t[0];if(null==i)return i;i.length>1&&(t=i);const n=e(t);if("object"==typeof n)for(let{length:e}=n,t=0;t<e;t++)n[t]=Math.round(n[t]);return n};return"conversion"in e&&(t.conversion=e.conversion),t}for(const e of a_){s_[e]={},Object.defineProperty(s_[e],"channels",{value:Qw[e].channels}),Object.defineProperty(s_[e],"labels",{value:Qw[e].labels});const t=r_(e),i=Object.keys(t);for(const n of i){const i=t[n];s_[e][n]=c_(i),s_[e][n].raw=l_(i)}}Math.PI;const d_=Symbol("same"),u_=(Symbol("color"),Symbol("hsva"),Symbol("update")),h_=(Symbol("parts"),Symbol("css")),m_=Symbol("sliders");HTMLElement;var g_=i(3086),f_={attributes:{"data-cke":!0}};f_.setAttributes=Ki(),f_.insert=$i().bind(null,"head"),f_.domAPI=Hi(),f_.insertStyleElement=Yi();ji()(g_.A,f_);g_.A&&g_.A.locals&&g_.A.locals;var p_=i(2922),b_={attributes:{"data-cke":!0}};b_.setAttributes=Ki(),b_.insert=$i().bind(null,"head"),b_.domAPI=Hi(),b_.insertStyleElement=Yi();ji()(p_.A,b_);p_.A&&p_.A.locals&&p_.A.locals;function k_(e){return e.map(e=>function(e){"number"==typeof e&&(e=String(e));if("object"==typeof e&&(t=e,t.title&&t.model&&t.view))return __(e);var t;const i=function(e){return"string"==typeof e?w_[e]:w_[e.model]}(e);if(i)return __(i);if("default"===e)return{model:void 0,title:"Default"};if(function(e){let t;if("object"==typeof e){if(!e.model)throw new A("font-size-invalid-definition",null,e);t=parseFloat(e.model)}else t=parseFloat(e);return isNaN(t)}(e))return;return function(e){"string"==typeof e&&(e={title:e,model:`${parseFloat(e)}px`});return e.view={name:"span",styles:{"font-size":e.model}},__(e)}(e)}(e)).filter(e=>void 0!==e)}const w_={get tiny(){return{title:"Tiny",model:"tiny",view:{name:"span",classes:"text-tiny",priority:7}}},get small(){return{title:"Small",model:"small",view:{name:"span",classes:"text-small",priority:7}}},get big(){return{title:"Big",model:"big",view:{name:"span",classes:"text-big",priority:7}}},get huge(){return{title:"Huge",model:"huge",view:{name:"span",classes:"text-huge",priority:7}}}};function __(e){return e.view&&"string"!=typeof e.view&&!e.view.priority&&(e.view.priority=7),e}var v_=i(9465),y_={attributes:{"data-cke":!0}};y_.setAttributes=Ki(),y_.insert=$i().bind(null,"head"),y_.domAPI=Hi(),y_.insertStyleElement=Yi();ji()(v_.A,y_);v_.A&&v_.A.locals&&v_.A.locals;class A_ extends Qu{static get pluginName(){return"ListItemFontSizeIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[Z_]}init(){const e=this.editor,t=e.plugins.get("ListFormatting"),i=e.plugins.get(Z_);if(!e.plugins.has("FontSizeEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting"))return;const n=k_(e.config.get("fontSize.options"));t.registerFormatAttribute("fontSize","listItemFontSize"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemFontSize",setAttributeOnDowncast(e,t,i,o){if(t){const s=n.find(e=>e.model==t);s&&s.view&&"string"!=typeof s.view?s.view.styles?(e.addClass("ck-list-marker-font-size",i),e.setStyle("--ck-content-list-marker-font-size",s.view.styles["font-size"],i)):s.view.classes&&(e.addClass(`ck-list-marker-font-size-${t}`,i),!r.isSafari||o&&o.dataPipeline||e.setStyle("--ck-content-list-marker-dummy-font-size","0",i)):(e.addClass("ck-list-marker-font-size",i),e.setStyle("--ck-content-list-marker-font-size",t,i))}}})}afterInit(){const e=this.editor,t=e.model;if(!e.plugins.has("FontSizeEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting"))return;t.schema.extend("$listItem",{allowAttributes:"listItemFontSize"}),t.schema.setAttributeProperties("listItemFontSize",{isFormatting:!0}),t.schema.addAttributeCheck(e=>{if(!e.last.getAttribute("listItemId"))return!1},"listItemFontSize"),e.conversion.for("upcast").elementToAttribute({model:{key:"listItemFontSize",value:e=>e.getStyle("--ck-content-list-marker-font-size")},view:{name:"li",classes:"ck-list-marker-font-size",styles:{"--ck-content-list-marker-font-size":/.*/}}});const i=k_(e.config.get("fontSize.options"));for(const t of i)t.model&&t.view&&e.conversion.for("upcast").elementToAttribute({model:{key:"listItemFontSize",value:t.model},view:{name:"li",classes:`ck-list-marker-font-size-${t.model}`}})}}class x_ extends Qu{static get pluginName(){return"ListItemFontColorIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[Z_]}init(){const e=this.editor,t=e.plugins.get("ListFormatting"),i=e.plugins.get(Z_);e.plugins.has("FontColorEditing")&&this.editor.config.get("list.enableListItemMarkerFormatting")&&(t.registerFormatAttribute("fontColor","listItemFontColor"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemFontColor",setAttributeOnDowncast(e,t,i){t&&(e.addClass("ck-list-marker-color",i),e.setStyle("--ck-content-list-marker-color",t,i))}}))}afterInit(){const e=this.editor,t=e.model;e.plugins.has("FontColorEditing")&&this.editor.config.get("list.enableListItemMarkerFormatting")&&(t.schema.extend("$listItem",{allowAttributes:"listItemFontColor"}),t.schema.setAttributeProperties("listItemFontColor",{isFormatting:!0}),t.schema.addAttributeCheck(e=>{if(!e.last.getAttribute("listItemId"))return!1},"listItemFontColor"),e.conversion.for("upcast").attributeToAttribute({model:{key:"listItemFontColor",value:e=>e.getStyle("--ck-content-list-marker-color")},view:{name:"li",classes:"ck-list-marker-color",styles:{"--ck-content-list-marker-color":/.*/}}}))}}class C_ extends Qu{static get pluginName(){return"ListItemFontFamilyIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[Z_]}init(){const e=this.editor,t=e.plugins.get("ListFormatting"),i=e.plugins.get(Z_);e.plugins.has("FontFamilyEditing")&&this.editor.config.get("list.enableListItemMarkerFormatting")&&(t.registerFormatAttribute("fontFamily","listItemFontFamily"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemFontFamily",setAttributeOnDowncast(e,t,i){t&&(e.addClass("ck-list-marker-font-family",i),e.setStyle("--ck-content-list-marker-font-family",t,i))}}))}afterInit(){const e=this.editor,t=e.model;e.plugins.has("FontFamilyEditing")&&this.editor.config.get("list.enableListItemMarkerFormatting")&&(t.schema.extend("$listItem",{allowAttributes:"listItemFontFamily"}),t.schema.setAttributeProperties("listItemFontFamily",{isFormatting:!0}),t.schema.addAttributeCheck(e=>{if(!e.last.getAttribute("listItemId"))return!1},"listItemFontFamily"),e.conversion.for("upcast").attributeToAttribute({model:{key:"listItemFontFamily",value:e=>e.getStyle("--ck-content-list-marker-font-family")},view:{name:"li",classes:"ck-list-marker-font-family",styles:{"--ck-content-list-marker-font-family":/.*/}}}))}}var T_=i(7229),E_={attributes:{"data-cke":!0}};E_.setAttributes=Ki(),E_.insert=$i().bind(null,"head"),E_.domAPI=Hi(),E_.insertStyleElement=Yi();ji()(T_.A,E_);T_.A&&T_.A.locals&&T_.A.locals;class I_ extends Qu{_loadedFormatting={};static get pluginName(){return"ListFormatting"}static get isOfficialPlugin(){return!0}static get requires(){return[Fw,jw,A_,x_,C_]}constructor(e){super(e),e.config.define("list.enableListItemMarkerFormatting",!0)}afterInit(){this.editor.config.get("list.enableListItemMarkerFormatting")&&this._registerPostfixerForListItemFormatting()}_registerPostfixerForListItemFormatting(){const e=this.editor.model;e.document.registerPostFixer(t=>{const i=e.document.differ.getChanges(),n=new Set;let o=!1;for(const e of i)if("attribute"===e.type)("listItemId"==e.attributeKey||"listType"==e.attributeKey||this._isInlineOrSelectionFormatting(e.attributeKey)||Object.values(this._loadedFormatting).includes(e.attributeKey))&&(ww(e.range.start.nodeAfter)?n.add(e.range.start.nodeAfter):ww(e.range.start.parent)&&n.add(e.range.start.parent));else if(ww(e.position.nodeAfter)&&n.add(e.position.nodeAfter),ww(e.position.nodeBefore)&&n.add(e.position.nodeBefore),ww(e.position.parent)&&n.add(e.position.parent),"insert"==e.type&&"$text"!=e.name){const i=t.createRangeIn(e.position.nodeAfter);for(const e of i.getItems())ww(e)&&n.add(e)}for(const i of n){const n=S_(e,i,Object.keys(this._loadedFormatting));for(const[e,r]of Object.entries(n)){const n=this._loadedFormatting[e];(r&&M_(t,i,n,r)||!r&&O_(t,i,n))&&(o=!0)}}return o})}registerFormatAttribute(e,t){this._loadedFormatting[e]=t}_isInlineOrSelectionFormatting(e){return e.replace(/^selection:/,"")in this._loadedFormatting}}function S_(e,t,i){if(Aw(t))return P_(e,t,i);return P_(e,_w(t)[0],i)}function P_(e,t,i){if(!function(e){return["numbered","bulleted","customNumbered","customBulleted"].includes(e.getAttribute("listType"))}(t)||e.schema.isLimit(t))return Object.fromEntries(i.map(e=>[e]));if(t.isEmpty)return Object.fromEntries(i.map(e=>[e,t.getAttribute(`selection:${e}`)]));const n=new Set(i),o={},r=e.createRangeIn(t).getWalker({ignoreElementEnd:!0});for(const{item:t}of r){for(const i of n)if(e.schema.checkAttribute(t,i)){const e=t.getAttribute(i);void 0===e?(n.delete(i),o[i]=void 0):void 0===o[i]?o[i]=e:o[i]!==e&&(n.delete(i),o[i]=void 0)}else i in o||(o[i]=void 0);if(!n.size)break;e.schema.isLimit(t)&&r.jumpTo(e.createPositionAfter(t))}return o}function M_(e,t,i,n){const o=_w(t);let r=!1;for(const t of o)t.hasAttribute(i)&&t.getAttribute(i)===n||(e.setAttribute(i,n,t),r=!0);return r}function O_(e,t,i){const n=_w(t);let o=!1;for(const t of n)t.hasAttribute(i)&&(e.removeAttribute(i,t),o=!0);return o}class R_ extends Qu{static get pluginName(){return"ListUtils"}static get isOfficialPlugin(){return!0}expandListBlocksToCompleteList(e){return function(e){e=Dt(e);const t=new Set;for(const i of e)for(const e of yw(i))t.add(e);return Mw(t)}(e)}isFirstBlockOfListItem(e){return Aw(e)}isListItemBlock(e){return ww(e)}expandListBlocksToCompleteItems(e,t={}){return Cw(e,t)}isNumberedListType(e){return function(e){return"numbered"==e||"customNumbered"==e}(e)}}function N_(e){return e.is("element","ol")||e.is("element","ul")}function V_(e){return e.is("element","li")}function L_(e,t,i,n=z_(i,t)){return e.createAttributeElement(B_(i),null,{priority:2*t/100-100,id:n})}function D_(e,t,i){return e.createAttributeElement("li",null,{priority:(2*t+1)/100-100,id:i})}function B_(e){return"numbered"==e||"customNumbered"==e?"ol":"ul"}function z_(e,t){return`list-${e}-${t}`}function F_(e,t,i){const n=e.nodeBefore;if(ww(n)){let e=n;for(const{node:o}of new pw(e,"backward")){if(e=o,i.has(e))return;if(i.add(e),t.has(n))return}t.add(e)}else{const i=e.nodeAfter;ww(i)&&t.add(i)}}function j_(){return(e,t,i)=>{const{writer:n,schema:o}=i;if(!t.modelRange)return;const r=Array.from(t.modelRange.getItems({shallow:!0})).filter(e=>o.checkAttribute(e,"listItemId"));if(!r.length)return;const s=t.viewItem.getAttribute("data-list-item-id")||kw.next();i.consumable.consume(t.viewItem,{attributes:"data-list-item-id"});const a=function(e){let t=0,i=e.parent;for(;i;){if(V_(i))t++;else{const e=i.previousSibling;e&&V_(e)&&t++}i=i.parent}return t}(t.viewItem);let l=t.viewItem.parent&&t.viewItem.parent.is("element","ol")?"numbered":"bulleted";const c=r[0].getAttribute("listType");c&&(l=c);const d={listItemId:s,listIndent:a,listType:l};for(const e of r)e.hasAttribute("listItemId")||n.setAttributes(d,e);r.length>1&&r[1].getAttribute("listItemId")!=d.listItemId&&i.keepEmptyElement(r[0])}}function U_(e,t,i,n){return()=>{const n=e.document.differ.getChanges(),s=[],a=new Set,l=new Set,c=new Set;for(const e of n)if("insert"==e.type&&"$text"!=e.name)F_(e.position,a,c),e.attributes.has("listItemId")?l.add(e.position.nodeAfter):F_(e.position.getShiftedBy(e.length),a,c);else if("remove"==e.type&&e.attributes.has("listItemId"))F_(e.position,a,c);else if("attribute"==e.type){const t=e.range.start.nodeAfter;i.includes(e.attributeKey)?(F_(e.range.start,a,c),null===e.attributeNewValue?(F_(e.range.start.getShiftedBy(1),a,c),r(t)&&s.push(t)):l.add(t)):ww(t)&&r(t)&&s.push(t)}for(const e of a.values())s.push(...o(e,l));for(const e of new Set(s))t.reconvertItem(e)};function o(e,t){const n=[],o=new Set,a=[];for(const{node:l,previous:c}of new pw(e)){if(o.has(l))continue;const e=l.getAttribute("listIndent");c&&e<c.getAttribute("listIndent")&&(a.length=e+1),a[e]={modelAttributes:Object.fromEntries(Array.from(l.getAttributes()).filter(([e])=>i.includes(e))),modelElement:l};const d=vw(l,{direction:"forward"});for(const e of d)o.add(e),(r(e,d)||s(e,a,t))&&n.push(e)}return n}function r(e,o){const r=t.mapper.toViewElement(e);if(!r)return!1;if(function(e){e=e.parent;for(;e.is("attributeElement")&&["ol","ul","li"].includes(e.name);)e=e.parent;if(e.getCustomProperty("$structureSlotParent")&&!t.mapper.toModelElement(e))return!0;return!1}(r))return!0;if(n.fire("checkElement",{modelElement:e,viewElement:r}))return!0;if(!e.is("element","paragraph")&&!e.is("element","listItem"))return!1;const s=q_(e,i,o);return!(!s||!r.is("element","p"))||!(s||!r.is("element","span"))}function s(e,i,o){if(o.has(e))return!1;const r=t.mapper.toViewElement(e);let s=i.length-1;for(let e=r.parent;!e.is("editableElement");e=e.parent){const t=V_(e),o=N_(e);if(!o&&!t)continue;const r="checkAttributes:"+(t?"item":"list");if(n.fire(r,{viewElement:e,modelAttributes:i[s].modelAttributes,modelReferenceElement:i[s].modelElement}))break;if(o&&(s--,s<0))return!1}return!0}}function H_(e,t,i,{dataPipeline:n}={}){const o=function(e,t){const i=t.filter(e=>!1===e.consume).map(e=>e.attributeName);return(t,n)=>{const o=[];for(const n of e)t.hasAttribute(n)&&!i.includes(n)&&o.push(`attribute:${n}`);return!!o.every(e=>!1!==n.test(t,e))&&(o.forEach(e=>n.consume(t,e)),!0)}}(e,t);return(r,s,a)=>{const{writer:l,mapper:c,consumable:d}=a,u=s.item;if(!e.includes(s.attributeKey))return;if(!o(u,d))return;const h={...a.options,dataPipeline:n},m=function(e,t,i,n){const o=i.createRangeOn(e),r=t.toViewRange(o).getTrimmed(),s=r.getWalker();for(const{item:e}of s)if(e.is("element")&&e.getCustomProperty("listItemMarker"))s.jumpTo(n.createPositionAfter(e));else if(e.is("element")&&!e.getCustomProperty("listItemWrapper"))return e}(u,c,i,l);$_(m,l,c),function(e,t){let i=e.parent;for(;i.is("attributeElement")&&["ul","ol","li"].includes(i.name);){const n=i.parent;t.unwrap(t.createRangeOn(e),i),i=n}}(m,l);const g=function(e,t,i,n,{dataPipeline:o}){let r=n.createRangeOn(t);if(!Aw(e))return r;for(const s of i){if("itemMarker"!=s.scope)continue;const i=s.createElement(n,e,{dataPipeline:o});if(!i)continue;if(n.setCustomProperty("listItemMarker",!0,i),s.canInjectMarkerIntoElement&&s.canInjectMarkerIntoElement(e)?n.insert(n.createPositionAt(t,0),i):(n.insert(r.start,i),r=n.createRange(n.createPositionBefore(i),n.createPositionAfter(t))),!s.createWrapperElement||!s.canWrapElement)continue;const a=s.createWrapperElement(n,e,{dataPipeline:o});n.setCustomProperty("listItemWrapper",!0,a),s.canWrapElement(e)?r=n.wrap(r,a):(r=n.wrap(n.createRangeOn(i),a),r=n.createRange(r.start,n.createPositionAfter(t)))}return r}(u,m,t,l,h);!function(e,t,i,n,o){if(!e.hasAttribute("listIndent"))return;const r=e.getAttribute("listIndent");let s=e;for(let e=r;e>=0;e--){const r=D_(n,e,s.getAttribute("listItemId")),a=L_(n,e,s.getAttribute("listType"));for(const e of i)"list"!=e.scope&&"item"!=e.scope||!s.hasAttribute(e.attributeName)||e.setAttributeOnDowncast(n,s.getAttribute(e.attributeName),"list"==e.scope?a:r,o,s);if(t=n.wrap(t,r),t=n.wrap(t,a),0==e)break;if(s=fw.first(s,{lowerIndent:!0}),!s)break}}(u,g,t,l,h)}}function W_(e,{dataPipeline:t}={}){return(i,{writer:n})=>{if(!q_(i,e))return null;if(!t)return n.createContainerElement("span",{class:"ck-list-bogus-paragraph"});const o=n.createContainerElement("p");return n.setCustomProperty("dataPipeline:transparentRendering",!0,o),o}}function $_(e,t,i){for(;e.parent.is("attributeElement")&&e.parent.getCustomProperty("listItemWrapper");)t.unwrap(t.createRangeOn(e),e.parent);const n=[];o(t.createPositionBefore(e).getWalker({direction:"backward"})),o(t.createRangeIn(e).getWalker());for(const e of n)t.remove(e);function o(e){for(const{item:t}of e){if(t.is("element")&&i.toModelElement(t))break;t.is("element")&&t.getCustomProperty("listItemMarker")&&n.push(t)}}}function q_(e,t,i=_w(e)){if(!ww(e))return!1;for(const i of e.getAttributeKeys())if(!i.startsWith("selection:")&&"htmlEmptyBlock"!=i&&!t.includes(i))return!1;return i.length<2}var K_=i(7875),G_={attributes:{"data-cke":!0}};G_.setAttributes=Ki(),G_.insert=$i().bind(null,"head"),G_.domAPI=Hi(),G_.insertStyleElement=Yi();ji()(K_.A,G_);K_.A&&K_.A.locals&&K_.A.locals;var Y_=i(532),J_={attributes:{"data-cke":!0}};J_.setAttributes=Ki(),J_.insert=$i().bind(null,"head"),J_.domAPI=Hi(),J_.insertStyleElement=Yi();ji()(Y_.A,J_);Y_.A&&Y_.A.locals&&Y_.A.locals;const Q_=["listType","listIndent","listItemId"];class Z_ extends Qu{_downcastStrategies=[];static get pluginName(){return"ListEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[Dm,um,R_,Gh,I_]}constructor(e){super(e),e.config.define("list.multiBlock",!0)}init(){const e=this.editor,t=e.model,i=e.config.get("list.multiBlock");if(e.plugins.has("LegacyListEditing"))throw new A("list-feature-conflict",this,{conflictPlugin:"LegacyListEditing"});t.schema.register("$listItem",{allowAttributes:Q_}),i?(t.schema.extend("$container",{allowAttributesOf:"$listItem"}),t.schema.extend("$block",{allowAttributesOf:"$listItem"}),t.schema.extend("$blockObject",{allowAttributesOf:"$listItem"})):t.schema.register("listItem",{inheritAllFrom:"$block",allowAttributesOf:"$listItem"});for(const e of Q_)t.schema.setAttributeProperties(e,{copyOnReplace:!0});e.commands.add("numberedList",new Dw(e,"numbered")),e.commands.add("bulletedList",new Dw(e,"bulleted")),e.commands.add("customNumberedList",new Dw(e,"customNumbered",{multiLevel:!0})),e.commands.add("customBulletedList",new Dw(e,"customBulleted",{multiLevel:!0})),e.commands.add("indentList",new Vw(e,"forward")),e.commands.add("outdentList",new Vw(e,"backward")),e.commands.add("splitListItemBefore",new zw(e,"before")),e.commands.add("splitListItemAfter",new zw(e,"after")),i&&(e.commands.add("mergeListItemBackward",new Bw(e,"backward")),e.commands.add("mergeListItemForward",new Bw(e,"forward"))),this._setupDeleteIntegration(),this._setupEnterIntegration(),this._setupTabIntegration(),this._setupClipboardIntegration(),this._setupAccessibilityIntegration(),this._setupListItemIdConversionStrategy()}afterInit(){const e=this.editor.commands,t=e.get("indent"),i=e.get("outdent");t&&t.registerChildCommand(e.get("indentList"),{priority:"high"}),i&&i.registerChildCommand(e.get("outdentList"),{priority:"lowest"}),this._setupModelPostFixing(),this._setupConversion()}registerDowncastStrategy(e){this._downcastStrategies.push(e)}getListAttributeNames(){return[...Q_,...this._downcastStrategies.map(e=>e.attributeName)]}_setupDeleteIntegration(){const e=this.editor,t=e.commands.get("mergeListItemBackward"),i=e.commands.get("mergeListItemForward");this.listenTo(e.editing.view.document,"delete",(n,o)=>{const r=e.model.document.selection;Ow(e.model)||e.model.change(()=>{const s=r.getFirstPosition();if(r.isCollapsed&&"backward"==o.direction){if(!s.isAtStart)return;const i=s.parent;if(!ww(i))return;if(fw.first(i,{sameAttributes:"listType",sameIndent:!0})||0!==i.getAttribute("listIndent")){if(!t||!t.isEnabled)return;t.execute({shouldMergeOnBlocksContentLevel:X_(e.model,"backward")})}else xw(i)||e.execute("splitListItemAfter"),e.execute("outdentList");o.preventDefault(),n.stop()}else{if(r.isCollapsed&&!r.getLastPosition().isAtEnd)return;if(!i||!i.isEnabled)return;i.execute({shouldMergeOnBlocksContentLevel:X_(e.model,"forward")}),o.preventDefault(),n.stop()}})},{context:"li"})}_setupEnterIntegration(){const e=this.editor,t=e.model,i=e.commands,n=i.get("enter");this.listenTo(e.editing.view.document,"enter",(i,n)=>{const o=t.document,r=o.selection.getFirstPosition().parent;if(o.selection.isCollapsed&&ww(r)&&r.isEmpty&&!n.isSoft){const t=Aw(r),o=xw(r);t&&o?(e.execute("outdentList"),n.preventDefault(),i.stop()):t&&!o?(e.execute("splitListItemAfter"),n.preventDefault(),i.stop()):o&&(e.execute("splitListItemBefore"),n.preventDefault(),i.stop())}},{context:"li"}),this.listenTo(n,"afterExecute",()=>{const t=i.get("splitListItemBefore");if(t.refresh(),!t.isEnabled)return;2===_w(e.model.document.selection.getLastPosition().parent).length&&t.execute()})}_setupTabIntegration(){const e=this.editor;this.listenTo(e.editing.view.document,"tab",(t,i)=>{const n=i.shiftKey?"outdentList":"indentList";this.editor.commands.get(n).isEnabled&&(e.execute(n),i.stopPropagation(),i.preventDefault(),t.stop())},{context:"li"})}_setupConversion(){const e=this.editor,t=e.model,i=this.getListAttributeNames(),n=e.config.get("list.multiBlock"),o=n?"paragraph":"listItem";e.conversion.for("upcast").elementToElement({view:"li",model:(e,{writer:t})=>t.createElement(o,{listType:""})}).elementToElement({view:"p",model:(e,{writer:t})=>e.parent&&e.parent.is("element","li")?t.createElement(o,{listType:""}):null,converterPriority:"high"}).add(e=>{e.on("element:li",j_())}),n||e.conversion.for("downcast").elementToElement({model:"listItem",view:"p"}),e.conversion.for("editingDowncast").elementToElement({model:o,view:W_(i),converterPriority:"high"}).add(e=>{var n;e.on("attribute",H_(i,this._downcastStrategies,t)),e.on("remove",(n=t.schema,(e,t,i)=>{const{writer:o,mapper:r}=i,s=e.name.split(":")[1];if(!n.checkAttribute(s,"listItemId"))return;const a=r.toViewPosition(t.position),l=t.position.getShiftedBy(t.length),c=r.toViewPosition(l,{isPhantom:!0}),d=o.createRange(a,c).getTrimmed().end.nodeBefore;d&&$_(d,o,r)}))}),e.conversion.for("dataDowncast").elementToElement({model:o,view:W_(i,{dataPipeline:!0}),converterPriority:"high"}).add(e=>{e.on("attribute",H_(i,this._downcastStrategies,t,{dataPipeline:!0}))});const r=(s=this._downcastStrategies,a=e.editing.view,(e,t)=>{if(t.modelPosition.offset>0)return;const i=t.modelPosition.parent;if(!ww(i))return;if(!s.some(e=>"itemMarker"==e.scope&&e.canInjectMarkerIntoElement&&e.canInjectMarkerIntoElement(i)))return;const n=t.mapper.toViewElement(i),o=a.createRangeIn(n),r=o.getWalker();let l=o.start;for(const{item:e}of r){if(e.is("element")&&t.mapper.toModelElement(e)||e.is("$textProxy"))break;e.is("element")&&e.getCustomProperty("listItemMarker")&&(l=a.createPositionAfter(e),r.skip(({previousPosition:e})=>!e.isEqual(l)))}t.viewPosition=l});var s,a;e.editing.mapper.on("modelToViewPosition",r),e.data.mapper.on("modelToViewPosition",r),this.listenTo(t.document,"change:data",U_(t,e.editing,i,this),{priority:"high"}),this.on("checkAttributes:item",(e,{viewElement:t,modelAttributes:i})=>{t.id!=i.listItemId&&(e.return=!0,e.stop())}),this.on("checkAttributes:list",(e,{viewElement:t,modelAttributes:i})=>{t.name==B_(i.listType)&&t.id==z_(i.listType,i.listIndent)||(e.return=!0,e.stop())})}_setupModelPostFixing(){const e=this.editor.model,t=this.getListAttributeNames();e.document.registerPostFixer(i=>function(e,t,i,n){const o=e.document.differ.getChanges(),r=new Set,s=new Set,a=n.editor.config.get("list.multiBlock");let l=!1;for(const n of o){if("insert"==n.type&&"$text"!=n.name){const o=n.position.nodeAfter;if(!e.schema.checkAttribute(o,"listItemId"))for(const e of Array.from(o.getAttributeKeys()))i.includes(e)&&(t.removeAttribute(e,o),l=!0);F_(n.position,s,r),n.attributes.has("listItemId")||F_(n.position.getShiftedBy(n.length),s,r);for(const{item:t,previousPosition:i}of e.createRangeIn(o))ww(t)&&F_(i,s,r)}else"remove"==n.type?F_(n.position,s,r):"attribute"==n.type&&i.includes(n.attributeKey)&&(F_(n.range.start,s,r),null===n.attributeNewValue&&F_(n.range.start.getShiftedBy(1),s,r));if(!a&&"attribute"==n.type&&Q_.includes(n.attributeKey)){const e=n.range.start.nodeAfter;null===n.attributeNewValue&&e&&e.is("element","listItem")?(t.rename(e,"paragraph"),l=!0):null===n.attributeOldValue&&e&&e.is("element")&&"listItem"!=e.name&&(t.rename(e,"listItem"),l=!0)}}const c=new Set;for(const e of s.values())l=n.fire("postFixer",{listNodes:new bw(e),listHead:e,writer:t,seenIds:c})||l;return l}(e,i,t,this)),this.on("postFixer",(e,{listNodes:t,writer:i})=>{e.return=function(e,t){let i=0,n=-1,o=null,r=!1;for(const{node:s}of e){const e=s.getAttribute("listIndent");if(e>i){let a;null===o?(o=e-i,a=i):(o>e&&(o=e),a=e-o),a>n+1&&(a=n+1),t.setAttribute("listIndent",a,s),r=!0,n=a}else o=null,i=e+1,n=e}return r}(t,i)||e.return},{priority:"high"}),this.on("postFixer",(e,{listNodes:t,writer:i,seenIds:n})=>{e.return=function(e,t,i){const n=new Set;let o=!1;for(const{node:r}of e){if(n.has(r))continue;let e=r.getAttribute("listType"),s=r.getAttribute("listItemId");if(t.has(s)&&(s=kw.next()),t.add(s),r.is("element","listItem"))r.getAttribute("listItemId")!=s&&(i.setAttribute("listItemId",s,r),o=!0);else for(const t of vw(r,{direction:"forward"}))n.add(t),t.getAttribute("listType")!=e&&(s=kw.next(),e=t.getAttribute("listType")),t.getAttribute("listItemId")!=s&&(i.setAttribute("listItemId",s,t),o=!0)}return o}(t,n,i)||e.return},{priority:"high"})}_setupClipboardIntegration(){const e=this.editor.model,t=this.editor.plugins.get("ClipboardPipeline");this.listenTo(e,"insertContent",function(e){return(t,[i,n])=>{const o=i.is("documentFragment")?Array.from(i.getChildren()):[i];if(!o.length)return;const r=(n?e.createSelection(n):e.document.selection).getFirstPosition();let s;if(ww(r.parent))s=r.parent;else{if(!ww(r.nodeBefore)||!ww(r.nodeAfter))return;s=r.nodeBefore}e.change(e=>{const t=s.getAttribute("listType"),i=s.getAttribute("listIndent"),n=o[0].getAttribute("listIndent")||0,r=Math.max(i-n,0);for(const i of o){const n=ww(i);s.is("element","listItem")&&i.is("element","paragraph")&&e.rename(i,"listItem"),e.setAttributes({listIndent:(n?i.getAttribute("listIndent"):0)+r,listItemId:n?i.getAttribute("listItemId"):kw.next(),listType:t},i)}})}}(e),{priority:"high"}),this.listenTo(t,"outputTransformation",(t,i)=>{e.change(e=>{const t=Array.from(i.content.getChildren()),n=t[t.length-1];if(t.length>1&&n.is("element")&&n.isEmpty){t.slice(0,-1).every(ww)&&e.remove(n)}if("copy"==i.method||"cut"==i.method){const t=Array.from(i.content.getChildren());Pw(t)&&Sw(t,e)}})})}_setupAccessibilityIntegration(){const e=this.editor,t=e.t;e.accessibility.addKeystrokeInfoGroup({id:"list",label:t("Keystrokes that can be used in a list"),keystrokes:[{label:t("Increase list item indent"),keystroke:"Tab"},{label:t("Decrease list item indent"),keystroke:"Shift+Tab"}]})}_setupListItemIdConversionStrategy(){this.registerDowncastStrategy({scope:"item",attributeName:"listItemId",setAttributeOnDowncast(e,t,i,n){n&&(n.skipListItemIds||n.isClipboardPipeline)||e.setAttribute("data-list-item-id",t,i)}})}}function X_(e,t){const i=e.document.selection;if(!i.isCollapsed)return!Ow(e);if("forward"===t)return!0;const n=i.getFirstPosition().parent,o=n.previousSibling;return!e.schema.isObject(o)&&(!!o.isEmpty||Pw([n,o]))}function ev(e,t,i,n){e.ui.componentFactory.add(t,()=>{const o=tv(lo,e,t,i,n);return o.set({tooltip:!0,isToggleable:!0}),o}),e.ui.componentFactory.add(`menuBar:${t}`,()=>{const o=tv(Lu,e,t,i,n);return o.set({role:"menuitemcheckbox",isToggleable:!0}),o})}function tv(e,t,i,n,o){const r=t.commands.get(i),s=new e(t.locale);return s.set({label:n,icon:o}),s.bind("isOn","isEnabled").to(r,"value","isEnabled"),s.on("execute",()=>{t.execute(i),t.editing.view.focus()}),s}class iv extends Qu{static get pluginName(){return"ListUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.t;this.editor.ui.componentFactory.has("numberedList")||ev(this.editor,"numberedList",e("Numbered List"),'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M7 5.75c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75M3.5 3v5H2V3.7H1v-1h2.5zM.343 17.857l2.59-3.257H2.92a.6.6 0 1 0-1.04 0H.302a2 2 0 1 1 3.995 0h-.001q-.073.607-.333.988-.263.381-1.244 1.312H4.3v1h-4zM7 14.75a.75.75 0 0 1 .75-.75h9.5a.75.75 0 1 1 0 1.5h-9.5a.75.75 0 0 1-.75-.75"/></svg>'),this.editor.ui.componentFactory.has("bulletedList")||ev(this.editor,"bulletedList",e("Bulleted List"),'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M7 5.75c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75m-6 0C1 4.784 1.777 4 2.75 4c.966 0 1.75.777 1.75 1.75 0 .966-.777 1.75-1.75 1.75C1.784 7.5 1 6.723 1 5.75m6 9c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75m-6 0c0-.966.777-1.75 1.75-1.75.966 0 1.75.777 1.75 1.75 0 .966-.777 1.75-1.75 1.75-.966 0-1.75-.777-1.75-1.75"/></svg>')}}function nv(e,t){const i=(i,n,o)=>{if(!o.consumable.consume(n.item,i.name))return;const r=n.attributeNewValue,s=o.writer,a=o.mapper.toViewElement(n.item),l=[...a.getChildren()].find(e=>e.getCustomProperty("media-content"));s.remove(l);const c=e.getMediaViewElement(s,r,t);s.insert(s.createPositionAt(a,0),c)};return e=>{e.on("attribute:url:media",i)}}function ov(e,t,i,n){return e.createContainerElement("figure",{class:"media"},[t.getMediaViewElement(e,i,n),e.createSlot()])}function rv(e){const t=e.getSelectedElement();return t&&t.is("element","media")?t:null}function sv(e,t,i,n){e.change(o=>{const r=o.createElement("media",{url:t});e.insertObject(r,i,null,{setSelection:"on",findOptimalPosition:n?"auto":void 0})})}class av extends Xu{refresh(){const e=this.editor.model,t=e.document.selection,i=rv(t);this.value=i?i.getAttribute("url"):void 0,this.isEnabled=function(e){const t=e.getSelectedElement();return!!t&&"media"===t.name}(t)||function(e,t){const i=eg(e,t);let n=i.start.parent;n.isEmpty&&!t.schema.isLimit(n)&&(n=n.parent);return t.schema.checkChild(n,"media")}(t,e)}execute(e){const t=this.editor.model,i=t.document.selection,n=rv(i);n?t.change(t=>{t.setAttribute("url",e,n)}):sv(t,e,i,!0)}}class lv{locale;providerDefinitions;constructor(e,t){const i=t.providers,n=t.extraProviders||[],o=new Set(t.removeProviders),r=i.concat(n).filter(e=>{const t=e.name;return t?!o.has(t):(x("media-embed-no-provider-name",{provider:e}),!1)});this.locale=e,this.providerDefinitions=r}hasMedia(e){return!!this._getMedia(e)}getMediaViewElement(e,t,i){return this._getMedia(t).getViewElement(e,i)}_getMedia(e){if(!e)return new cv(this.locale);e=e.trim();for(const t of this.providerDefinitions){const i=t.html,n=Dt(t.url);for(const t of n){const n=this._getUrlMatches(e,t);if(n)return new cv(this.locale,e,n,i)}}return null}_getUrlMatches(e,t){let i=e.match(t);if(i)return i;let n=e.replace(/^https?:\/\//,"");return i=n.match(t),i||(n=n.replace(/^www\./,""),i=n.match(t),i||null)}}class cv{url;_locale;_match;_previewRenderer;constructor(e,t,i,n){this.url=this._getValidUrl(t),this._locale=e,this._match=i,this._previewRenderer=n}getViewElement(e,t){const i={};let n;if(t.renderForEditingView||t.renderMediaPreview&&this.url&&this._previewRenderer){this.url&&(i["data-oembed-url"]=this.url),t.renderForEditingView&&(i.class="ck-media__wrapper");const o=this._getPreviewHtml(t);n=e.createRawElement("div",i,(e,t)=>{t.setContentOf(e,o)})}else this.url&&(i.url=this.url),n=e.createEmptyElement(t.elementName,i);return e.setCustomProperty("media-content",!0,n),n}_getPreviewHtml(e){return this._previewRenderer?this._previewRenderer(this._match):this.url&&e.renderForEditingView?this._getPlaceholderHtml():""}_getPlaceholderHtml(){const e=new wn,t=this._locale.t;e.content='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 42"><path d="M47.426 17V3.713L63.102 0v19.389h-.001l.001.272c0 1.595-2.032 3.43-4.538 4.098s-4.538-.083-4.538-1.678 2.032-3.43 4.538-4.098c.914-.244 2.032-.565 2.888-.603V4.516L49.076 7.447v9.556L49 17zM29.5 17h-8.343a7.073 7.073 0 1 0-4.657 4.06v3.781H3.3a2.803 2.803 0 0 1-2.8-2.804V8.63a2.803 2.803 0 0 1 2.8-2.805h4.082L8.58 2.768A1.99 1.99 0 0 1 10.435 1.5h8.985c.773 0 1.477.448 1.805 1.149l1.488 3.177H26.7c1.546 0 2.8 1.256 2.8 2.805zm-11.637 0H17.5a1 1 0 0 0-1 1v.05A4.244 4.244 0 1 1 17.863 17m29.684 2c.97 0 .953-.048.953.889v20.743c0 .953.016.905-.953.905H19.453c-.97 0-.953.048-.953-.905V19.89c0-.937-.016-.889.97-.889h28.077zm-4.701 19.338V22.183H24.154v16.155zM20.6 21.375v1.616h1.616v-1.616zm0 3.231v1.616h1.616v-1.616zm0 3.231v1.616h1.616v-1.616zm0 3.231v1.616h1.616v-1.616zm0 3.231v1.616h1.616v-1.616zm0 3.231v1.616h1.616V37.53zm24.233-16.155v1.616h1.615v-1.616zm0 3.231v1.616h1.615v-1.616zm0 3.231v1.616h1.615v-1.616zm0 3.231v1.616h1.615v-1.616zm0 3.231v1.616h1.615v-1.616zm0 3.231v1.616h1.615V37.53zM29.485 25.283a.4.4 0 0 1 .593-.35l9.05 4.977a.4.4 0 0 1 0 .701l-9.05 4.978a.4.4 0 0 1-.593-.35z"/></svg>',e.viewBox="0 0 64 42";return new bi({tag:"div",attributes:{class:"ck ck-reset_all ck-media__placeholder"},children:[{tag:"div",attributes:{class:"ck-media__placeholder__icon"},children:[e]},{tag:"a",attributes:{class:"ck-media__placeholder__url",target:"_blank",rel:"noopener noreferrer",href:this.url,"data-cke-tooltip-text":t("Open media in new tab")},children:[{tag:"span",attributes:{class:"ck-media__placeholder__url__text"},children:[this.url]}]}]}).render().outerHTML}_getValidUrl(e){return e?e.match(/^https?/)?e:"https://"+e:null}}var dv=i(5767),uv={attributes:{"data-cke":!0}};uv.setAttributes=Ki(),uv.insert=$i().bind(null,"head"),uv.domAPI=Hi(),uv.insertStyleElement=Yi();ji()(dv.A,uv);dv.A&&dv.A.locals&&dv.A.locals;class hv extends Qu{static get pluginName(){return"MediaEmbedEditing"}static get isOfficialPlugin(){return!0}registry;constructor(e){super(e),e.config.define("mediaEmbed",{elementName:"oembed",providers:[{name:"dailymotion",url:[/^dailymotion\.com\/video\/(\w+)/,/^dai.ly\/(\w+)/],html:e=>`<div style="position: relative; padding-bottom: 100%; height: 0; "><iframe src="https://www.dailymotion.com/embed/video/${e[1]}" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" frameborder="0" width="480" height="270" allowfullscreen allow="autoplay"></iframe></div>`},{name:"spotify",url:[/^open\.spotify\.com\/(artist\/\w+)/,/^open\.spotify\.com\/(album\/\w+)/,/^open\.spotify\.com\/(track\/\w+)/],html:e=>`<div style="position: relative; padding-bottom: 100%; height: 0; padding-bottom: 126%;"><iframe src="https://open.spotify.com/embed/${e[1]}" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" frameborder="0" allowtransparency="true" allow="encrypted-media"></iframe></div>`},{name:"youtube",url:[/^(?:m\.)?youtube\.com\/watch\?v=([\w-]+)(?:&t=(\d+))?/,/^(?:m\.)?youtube\.com\/shorts\/([\w-]+)(?:\?t=(\d+))?/,/^(?:m\.)?youtube\.com\/v\/([\w-]+)(?:\?t=(\d+))?/,/^youtube\.com\/embed\/([\w-]+)(?:\?start=(\d+))?/,/^youtu\.be\/([\w-]+)(?:\?t=(\d+))?/],html:e=>{const t=e[1],i=e[2];return`<div style="position: relative; padding-bottom: 100%; height: 0; padding-bottom: 56.2493%;"><iframe src="https://www.youtube.com/embed/${t}${i?`?start=${i}`:""}" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" frameborder="0" allow="autoplay; encrypted-media" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe></div>`}},{name:"vimeo",url:[/^vimeo\.com\/(\d+)/,/^vimeo\.com\/[^/]+\/[^/]+\/video\/(\d+)/,/^vimeo\.com\/album\/[^/]+\/video\/(\d+)/,/^vimeo\.com\/channels\/[^/]+\/(\d+)/,/^vimeo\.com\/groups\/[^/]+\/videos\/(\d+)/,/^vimeo\.com\/ondemand\/[^/]+\/(\d+)/,/^player\.vimeo\.com\/video\/(\d+)/],html:e=>`<div style="position: relative; padding-bottom: 100%; height: 0; padding-bottom: 56.2493%;"><iframe src="https://player.vimeo.com/video/${e[1]}" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div>`},{name:"instagram",url:[/^instagram\.com\/p\/(\w+)/,/^instagram\.com\/reel\/(\w+)/]},{name:"twitter",url:[/^twitter\.com/,/^x\.com/]},{name:"googleMaps",url:[/^google\.com\/maps/,/^goo\.gl\/maps/,/^maps\.google\.com/,/^maps\.app\.goo\.gl/]},{name:"flickr",url:/^flickr\.com/},{name:"facebook",url:/^facebook\.com/}]}),this.registry=new lv(e.locale,e.config.get("mediaEmbed"))}init(){const e=this.editor,t=e.model.schema,i=e.t,n=e.conversion,o=e.config.get("mediaEmbed.previewsInData"),r=e.config.get("mediaEmbed.elementName"),s=this.registry;e.commands.add("mediaEmbed",new av(e)),t.register("media",{inheritAllFrom:"$blockObject",allowAttributes:["url"]}),n.for("dataDowncast").elementToStructure({model:"media",view:(e,{writer:t})=>{const i=e.getAttribute("url");return ov(t,s,i,{elementName:r,renderMediaPreview:!!i&&o})}}),n.for("dataDowncast").add(nv(s,{elementName:r,renderMediaPreview:o})),n.for("editingDowncast").elementToStructure({model:"media",view:(e,{writer:t})=>{const n=e.getAttribute("url");return function(e,t,i){return t.setCustomProperty("media",!0,e),Ym(e,t,{label:i})}(ov(t,s,n,{elementName:r,renderForEditingView:!0}),t,i("media widget"))}}),n.for("editingDowncast").add(nv(s,{elementName:r,renderForEditingView:!0})),n.for("upcast").elementToElement({view:e=>["oembed",r].includes(e.name)&&e.getAttribute("url")?{name:!0}:null,model:(e,{writer:t})=>{const i=e.getAttribute("url");return s.hasMedia(i)?t.createElement("media",{url:i}):null}}).elementToElement({view:{name:"div",attributes:{"data-oembed-url":!0}},model:(e,{writer:t})=>{const i=e.getAttribute("data-oembed-url");return s.hasMedia(i)?t.createElement("media",{url:i}):null}}).add(e=>{e.on("element:figure",(e,t,i)=>{if(!i.consumable.consume(t.viewItem,{name:!0,classes:"media"}))return;const{modelRange:n,modelCursor:o}=i.convertChildren(t.viewItem,t.modelCursor);t.modelRange=n,t.modelCursor=o;Jt(n.getItems())||i.consumable.revert(t.viewItem,{name:!0,classes:"media"})})})}}const mv=/^(?:http(s)?:\/\/)?[\w-]+\.[\w-.~:/?#[\]@!$&'()*+,;=%]+$/;class gv extends Qu{static get requires(){return[nf,um,wf]}static get pluginName(){return"AutoMediaEmbed"}static get isOfficialPlugin(){return!0}_timeoutId;_positionToInsert;constructor(e){super(e),this._timeoutId=null,this._positionToInsert=null}init(){const t=this.editor,i=t.model.document,n=t.plugins.get("ClipboardPipeline");this.listenTo(n,"inputTransformation",()=>{const e=i.selection.getFirstRange(),t=Ac.fromPosition(e.start);t.stickiness="toPrevious";const n=Ac.fromPosition(e.end);n.stickiness="toNext",i.once("change:data",()=>{this._embedMediaBetweenPositions(t,n),t.detach(),n.detach()},{priority:"high"})});t.commands.get("undo").on("execute",()=>{this._timeoutId&&(e.window.clearTimeout(this._timeoutId),this._positionToInsert.detach(),this._timeoutId=null,this._positionToInsert=null)},{priority:"high"})}_embedMediaBetweenPositions(t,i){const n=this.editor,o=n.plugins.get(hv).registry,r=new La(t,i),s=r.getWalker({ignoreElementEnd:!0});let a="";for(const e of s)e.item.is("$textProxy")&&(a+=e.item.data);if(a=a.trim(),!a.match(mv))return void r.detach();if(!o.hasMedia(a))return void r.detach();n.commands.get("mediaEmbed").isEnabled?(this._positionToInsert=Ac.fromPosition(t),this._timeoutId=e.window.setTimeout(()=>{n.model.change(e=>{this._timeoutId=null,e.remove(r),r.detach();let t=null;"$graveyard"!==this._positionToInsert.root.rootName&&(t=this._positionToInsert),sv(n.model,a,t,!1),this._positionToInsert.detach(),this._positionToInsert=null}),n.plugins.get(um).requestUndoOnBackspace()},100)):r.detach()}}var fv=i(6004),pv={attributes:{"data-cke":!0}};pv.setAttributes=Ki(),pv.insert=$i().bind(null,"head"),pv.domAPI=Hi(),pv.insertStyleElement=Yi();ji()(fv.A,pv);fv.A&&fv.A.locals&&fv.A.locals;class bv extends Zi{focusTracker;keystrokes;urlInputView;_validators;_urlInputViewInfoDefault;_urlInputViewInfoTip;constructor(e,t){super(t),this.focusTracker=new Qt,this.keystrokes=new ti,this.set("mediaURLInputValue",""),this.urlInputView=this._createUrlInput(),this._validators=e,this.setTemplate({tag:"form",attributes:{class:["ck","ck-media-form","ck-responsive-form"],tabindex:"-1"},children:[this.urlInputView]})}render(){super.render(),zp({view:this}),this.focusTracker.add(this.urlInputView.element),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this.urlInputView.focus()}get url(){return this.urlInputView.fieldView.element.value.trim()}set url(e){this.urlInputView.fieldView.value=e.trim()}isValid(){this.resetFormStatus();for(const e of this._validators){const t=e(this);if(t)return this.urlInputView.errorText=t,!1}return!0}resetFormStatus(){this.urlInputView.errorText=null,this.urlInputView.infoText=this._urlInputViewInfoDefault}_createUrlInput(){const e=this.locale.t,t=new Up(this.locale,Yp),i=t.fieldView;return this._urlInputViewInfoDefault=e("Paste the media URL in the input."),this._urlInputViewInfoTip=e("Tip: Paste the URL into the content to embed faster."),t.label=e("Media URL"),t.infoText=this._urlInputViewInfoDefault,i.inputMode="url",i.on("input",()=>{t.infoText=i.element.value?this._urlInputViewInfoTip:this._urlInputViewInfoDefault,this.mediaURLInputValue=i.element.value.trim()}),t}}class kv extends Qu{static get requires(){return[hv,vf]}static get pluginName(){return"MediaEmbedUI"}static get isOfficialPlugin(){return!0}_formView;init(){const e=this.editor;e.ui.componentFactory.add("mediaEmbed",()=>{const e=this.editor.locale.t,t=this._createDialogButton(lo);return t.tooltip=!0,t.label=e("Insert media"),t}),e.ui.componentFactory.add("menuBar:mediaEmbed",()=>{const e=this.editor.locale.t,t=this._createDialogButton(Lu);return t.label=e("Media"),t})}_createDialogButton(e){const t=this.editor,i=new e(t.locale),n=t.commands.get("mediaEmbed"),o=this.editor.plugins.get("Dialog");return i.icon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 20"><path d="M1.587 1.5c-.612 0-.601-.029-.601.551v14.84c0 .59-.01.559.591.559h18.846c.602 0 .591.03.591-.56V2.052c0-.58.01-.55-.591-.55H1.587Zm.701.971h1.003v1H2.288zm16.448 0h1.003v1h-1.003zm-14.24 1h13.008v12H4.467zm-2.208 1h1.003v1H2.288zm16.448 0h1.003v1h-1.003zm-16.448 2h1.003v1H2.288zm16.448 0h1.003v1h-1.003zm-16.448 2h1.003v1H2.288zm16.448 0h1.003v1h-1.003zm-16.448 2h1.003v1H2.288zm16.448 0h1.003v1h-1.003zm-16.448 2h1.003l-.029 1h-.974zm16.448 0h1.003v1h-1.003zm-16.448 2h.974v1h-.974zm16.448 0h1.003v1h-1.003z"/><path d="M8.374 6.648a.4.4 0 0 1 .395-.4.4.4 0 0 1 .2.049l5.148 2.824a.4.4 0 0 1 0 .7l-5.148 2.824a.403.403 0 0 1-.595-.35z"/></svg>',i.bind("isEnabled").to(n,"isEnabled"),i.on("execute",()=>{"mediaEmbed"===o.id?o.hide():this._showDialog()}),i}_showDialog(){const e=this.editor,t=e.plugins.get("Dialog"),i=e.commands.get("mediaEmbed"),n=e.locale.t,o=void 0!==i.value;if(!this._formView){const t=e.plugins.get(hv).registry;this._formView=new(Vp(bv))(function(e,t){return[t=>{if(!t.url.length)return e("The URL must not be empty.")},i=>{if(!t.hasMedia(i.url))return e("This media URL is not supported.")}]}(e.t,t),e.locale),this._formView.on("submit",()=>this._handleSubmitForm())}t.show({id:"mediaEmbed",title:n("Media embed"),content:this._formView,isModal:!0,onShow:()=>{this._formView.url=i.value||"",this._formView.resetFormStatus(),this._formView.urlInputView.fieldView.select()},actionButtons:[{label:n("Cancel"),withText:!0,onExecute:()=>t.hide()},{label:n(o?"Save":"Insert"),class:"ck-button-action",withText:!0,onExecute:()=>this._handleSubmitForm()}]})}_handleSubmitForm(){const e=this.editor,t=e.plugins.get("Dialog");this._formView.isValid()&&(e.execute("mediaEmbed",this._formView.url),t.hide(),e.editing.view.focus())}}var wv=i(3155),_v={attributes:{"data-cke":!0}};_v.setAttributes=Ki(),_v.insert=$i().bind(null,"head"),_v.domAPI=Hi(),_v.insertStyleElement=Yi();ji()(wv.A,_v);wv.A&&wv.A.locals&&wv.A.locals;function vv(e){const t=parseFloat(e);return e.endsWith("pt")?Av(96*t/72):e.endsWith("pc")?Av(12*t*96/72):e.endsWith("in")?Av(96*t):e.endsWith("cm")?Av(96*t/2.54):e.endsWith("mm")?Av(t/10*96/2.54):e}function yv(e){return void 0!==e&&e.endsWith("px")}function Av(e){return Math.round(e)+"px"}function xv(e,t,i){if(!e.childCount)return;const n=new kd(e.document),o=function(e,t){const i=t.createRangeIn(e),n=[],o=new Set;for(const e of i.getItems()){if(!e.is("element")||!e.name.match(/^(p|h\d+|li|div)$/))continue;let t=Ov(e);if(void 0===t||0!=parseFloat(t)||Array.from(e.getClassNames()).find(e=>e.startsWith("MsoList"))||(t=void 0),e.hasStyle("mso-list")&&"none"!==e.getStyle("mso-list")||void 0!==t&&o.has(t)){const i=Pv(e);n.push({element:e,id:i.id,order:i.order,indent:i.indent,marginLeft:t}),void 0!==t&&o.add(t)}else o.clear()}return n}(e,n);if(!o.length)return;const r={},s=[];for(const e of o)if(void 0!==e.indent){Cv(e)||(s.length=0);const o=`${e.id}:${e.indent}`,a=Math.min(e.indent-1,s.length);if(a<s.length&&s[a].id!==e.id&&(s.length=a),a<s.length-1)s.length=a+1;else{const l=Ev(e,t);if(a>s.length-1||s[a].listElement.name!=l.type){0==a&&"ol"==l.type&&void 0!==e.id&&r[o]&&(l.startIndex=r[o]);const t=Sv(l,n,i);if(yv(e.marginLeft)&&(0==a||yv(s[a-1].marginLeft))){let i=e.marginLeft;a>0&&(i=Av(parseFloat(i)-parseFloat(s[a-1].marginLeft))),n.setStyle("padding-left",i,t)}if(0==s.length){const i=e.element.parent,o=i.getChildIndex(e.element)+1;n.insertChild(o,t,i)}else{const e=s[a-1].listItemElements;n.appendChild(t,e[e.length-1])}s[a]={...e,listElement:t,listItemElements:[]},0==a&&void 0!==e.id&&(r[o]=l.startIndex||1)}}const l="li"==e.element.name?e.element:n.createElement("li");n.appendChild(l,s[a].listElement),s[a].listItemElements.push(l),0==a&&void 0!==e.id&&r[o]++,e.element!=l&&n.appendChild(e.element,l),Mv(e.element,n),n.removeStyle("text-indent",e.element),n.removeStyle("margin-left",e.element)}else{const t=s.find(t=>t.marginLeft==e.marginLeft);if(t){const i=t.listItemElements;n.appendChild(e.element,i[i.length-1]),n.removeStyle("margin-left",e.element)}else s.length=0}}function Cv(e){const t=e.element.previousSibling;if(!t){const t=e.element.parent;return Tv(t)&&(!t.previousSibling||Tv(t.previousSibling))}return Tv(t)}function Tv(e){return e.is("element","ol")||e.is("element","ul")}function Ev(e,t){const i=new RegExp(`@list l${e.id}:level${e.indent}\\s*({[^}]*)`,"gi"),n=/mso-level-number-format:([^;]{0,100});/gi,o=/mso-level-start-at:\s{0,100}([0-9]{0,10})\s{0,100};/gi,r=new RegExp(`@list\\s+l${e.id}:level\\d\\s*{[^{]*mso-level-text:"%\\d\\\\.`,"gi"),s=new RegExp(`@list l${e.id}:level\\d\\s*{[^{]*mso-level-number-format:`,"gi"),a=r.exec(t),l=s.exec(t),c=a&&!l,d=i.exec(t);let u="decimal",h="ol",m=null;if(d&&d[1]){const t=n.exec(d[1]);if(t&&t[1]&&(u=t[1].trim(),h="bullet"!==u&&"image"!==u?"ol":"ul"),"bullet"===u){const t=function(e){if("li"==e.name&&"ul"==e.parent.name&&e.parent.hasAttribute("type"))return e.parent.getAttribute("type");const t=function(e){if(e.getChild(0).is("$text"))return null;for(const t of e.getChildren()){if(!t.is("element","span"))continue;const e=t.getChild(0);if(e)return e.is("$text")?e:e.getChild(0)}return null}(e);if(!t)return null;const i=t._data;if("o"===i)return"circle";if("·"===i)return"disc";if("§"===i)return"square";return null}(e.element);t&&(u=t)}else{const e=o.exec(d[1]);e&&e[1]&&(m=parseInt(e[1]))}c&&(h="ol")}return{type:h,startIndex:m,style:Iv(u),isLegalStyleList:c}}function Iv(e){if(e.startsWith("arabic-leading-zero"))return"decimal-leading-zero";switch(e){case"alpha-upper":return"upper-alpha";case"alpha-lower":return"lower-alpha";case"roman-upper":return"upper-roman";case"roman-lower":return"lower-roman";case"circle":case"disc":case"square":return e;default:return null}}function Sv(e,t,i){const n=t.createElement(e.type);return e.style&&t.setStyle("list-style-type",e.style,n),e.startIndex&&e.startIndex>1&&t.setAttribute("start",e.startIndex,n),e.isLegalStyleList&&i&&t.addClass("legal-list",n),n}function Pv(e){const t=e.getStyle("mso-list");if(void 0===t)return{};const i=t.match(/(^|\s{1,100})l(\d+)/i),n=t.match(/\s{0,100}lfo(\d+)/i),o=t.match(/\s{0,100}level(\d+)/i);return i&&n&&o?{id:i[2],order:n[1],indent:parseInt(o[1])}:{indent:1}}function Mv(e,t){const i=new Ko({name:"span",styles:{"mso-list":"Ignore"}}),n=t.createRangeIn(e);for(const e of n)"elementStart"===e.type&&i.match(e.item)&&t.remove(e.item)}function Ov(e){const t=e.getStyle("margin-left");return void 0===t||t.endsWith("px")?t:vv(t)}function Rv(e,t){if(!e.childCount)return;const i=new kd(e.document),n=function(e,t){const i=t.createRangeIn(e),n=new Ko({name:/v:(.+)/}),o=[];for(const e of i){if("elementStart"!=e.type)continue;const t=e.item,i=t.previousSibling,r=i&&i.is("element")?i.name:null,s=["Chart"],a=n.match(t),l=t.getAttribute("o:gfxdata"),c="v:shapetype"===r,d=l&&s.some(e=>t.getAttribute("id").includes(e));a&&l&&!c&&!d&&o.push(e.item.getAttribute("id"))}return o}(e,i);!function(e,t,i){const n=i.createRangeIn(t),o=new Ko({name:"img"}),r=[];for(const t of n)if(t.item.is("element")&&o.match(t.item)){const i=t.item,n=i.getAttribute("v:shapes")?i.getAttribute("v:shapes").split(" "):[];n.length&&n.every(t=>e.indexOf(t)>-1)?r.push(i):i.getAttribute("src")||r.push(i)}for(const e of r)i.remove(e)}(n,e,i),function(e,t,i){const n=i.createRangeIn(t),o=[];for(const t of n)if("elementStart"==t.type&&t.item.is("element","v:shape")){const i=t.item.getAttribute("id");if(e.includes(i))continue;r(t.item.parent.getChildren(),i)||o.push(t.item)}for(const e of o){const t={src:s(e)};e.hasAttribute("alt")&&(t.alt=e.getAttribute("alt"));const n=i.createElement("img",t);i.insertChild(e.index+1,n,e.parent)}function r(e,t){for(const i of e)if(i.is("element")){if("img"==i.name&&i.getAttribute("v:shapes")==t)return!0;if(r(i.getChildren(),t))return!0}return!1}function s(e){for(const t of e.getChildren())if(t.is("element")&&t.getAttribute("src"))return t.getAttribute("src")}}(n,e,i),function(e,t){const i=t.createRangeIn(e),n=new Ko({name:/v:(.+)/}),o=[];for(const e of i)"elementStart"==e.type&&n.match(e.item)&&o.push(e.item);for(const e of o)t.remove(e)}(e,i);const o=function(e,t){const i=t.createRangeIn(e),n=new Ko({name:"img"}),o=[];let r=0;for(const e of i)e.item.is("element")&&n.match(e.item)&&(e.item.getAttribute("src").startsWith("file://")&&o.push({element:e.item,imageIndex:r}),r++);return o}(e,i);o.length&&function(e,t,i){for(let n=0;n<e.length;n++){const{element:o,imageIndex:r}=e[n],s=t[r];if(s){const e=`data:${s.type};base64,${Nv(s.hex)}`;i.setAttribute("src",e,o)}}}(o,function(e){if(!e)return[];const t=/{\\pict[\s\S]+?\\bliptag-?\d+(\\blipupi-?\d+)?({\\\*\\blipuid\s?[\da-fA-F]+)?[\s}]*?/,i=new RegExp("(?:("+t.source+"))([\\da-fA-F\\s]+)\\}","g"),n=e.match(i),o=[];if(n)for(const e of n){let i=!1;e.includes("\\pngblip")?i="image/png":e.includes("\\jpegblip")&&(i="image/jpeg"),i&&o.push({hex:e.replace(t,"").replace(/[^\da-fA-F]/g,""),type:i})}return o}(t),i)}function Nv(e){return btoa(e.match(/\w{2}/g).map(e=>String.fromCharCode(parseInt(e,16))).join(""))}function Vv(e,t){for(const i of t.createRangeIn(e).getItems())i.is("element","table")&&("0px"===i.getStyle("width")&&t.removeStyle("width",i),"0"===i.getAttribute("width")&&t.removeAttribute("width",i))}function Lv(e,t){const i=[],n=[];for(const{item:o}of e.createRangeIn(t))if(o.is("element")&&o.getStyle("mso-footnote-id")){i.unshift(o);const{nextSibling:e}=o;e?.is("$text")&&e.data.startsWith(" ")&&n.unshift(e)}for(const t of i)e.remove(t);for(const t of n){const i=t.data.substring(1);if(i.length>0){const n=t.parent,o=n.getChildIndex(t),r=e.createText(i);e.remove(t),e.insertChild(o,r,n)}else e.remove(t)}return t}function Dv(e,t){const i=e.createElement("sup",{class:"footnote"}),n=e.createElement("a",{id:`ref-${t}`,href:`#${t}`});return e.appendChild(n,i),i}function Bv(e,t){const i=e.createElement("li",{id:t,class:"footnote-definition"}),n=e.createElement("a",{href:`#ref-${t}`,class:"footnote-backlink"}),o=e.createElement("div",{class:"footnote-content"});return e.appendChild(e.createText("^"),n),e.appendChild(n,i),e.appendChild(o,i),{listItem:i,content:o}}const zv=/<meta\s*name="?generator"?\s*content="?microsoft\s*word\s*\d+"?\/?>/i,Fv=/xmlns:o="urn:schemas-microsoft-com/i;class jv{document;hasMultiLevelListPlugin;hasTablePropertiesPlugin;hasExtendedTableBlockAlignment;constructor(e,t=!1,i=!1,n=!1){this.document=e,this.hasMultiLevelListPlugin=t,this.hasTablePropertiesPlugin=i,this.hasExtendedTableBlockAlignment=n}isActive(e){return zv.test(e)||Fv.test(e)}execute(e){const t=new kd(this.document),{body:i,stylesString:n}=e._parsedData;!function(e,t){const i=[];for(const n of t.createRangeIn(e)){const e=n.item;e.is("element","a")&&!e.hasAttribute("href")&&(e.hasAttribute("id")||e.hasAttribute("name"))&&i.push(e)}for(const e of i){const i=e.parent.getChildIndex(e)+1,n=e.getChildren();t.insertChild(i,n,e.parent)}}(i,t),xv(i,n,this.hasMultiLevelListPlugin),Rv(i,e.dataTransfer.getData("text/rtf")),function(e,t,i=!1,n=!1){for(const o of t.createRangeIn(e).getItems()){if(!o.is("element","table")&&!o.is("element","td")&&!o.is("element","th"))continue;if(i&&n&&o.is("element","table")){const e=o.parent?.is("element","div")?o.parent:null,i=o.parent?.parent?.is("element","div")?o.parent.parent:null,n=e??i;n&&"center"===n.getAttribute("align")&&!o.getAttribute("align")?(t.setStyle("margin-left","auto",o),t.setStyle("margin-right","auto",o)):n&&"right"===n.getAttribute("align")&&!o.getAttribute("align")?(t.setStyle("margin-left","auto",o),t.setStyle("margin-right","0",o)):n||o.getAttribute("align")||(t.setStyle("margin-left","0",o),t.setStyle("margin-right","auto",o))}const e=["left","top","right","bottom"];if(e.every(e=>!o.hasStyle(`border-${e}-style`)))t.setStyle("border-style","none",o);else for(const i of e)o.hasStyle(`border-${i}-style`)||t.setStyle(`border-${i}-style`,"none",o);const r=["width","height",...e.map(e=>`border-${e}-width`),...e.map(e=>`padding-${e}`)];for(const e of r)o.hasStyle(e)&&t.setStyle(e,vv(o.getStyle(e)),o)}}(i,t,this.hasTablePropertiesPlugin,this.hasExtendedTableBlockAlignment),Vv(i,t),function(e,t){const i=new Map,n=new Map;let o=null;for(const{item:r}of t.createRangeIn(e))if(r.is("element"))if("footnote-list"!==r.getStyle("mso-element")){if(r.hasStyle("mso-footnote-id")){const e=r.findAncestor("element",e=>"footnote"===e.getStyle("mso-element"));if(e){const t=e.getAttribute("id");n.set(t,e)}else{const e=r.getStyle("mso-footnote-id");i.set(e,r)}continue}}else o=r;if(!i.size||!o)return;const r=function(e){return e.createElement("ol",{class:"footnotes"})}(t);t.replace(o,r);for(const[e,o]of i){const i=n.get(e);if(!i)continue;t.replace(o,Dv(t,e));const s=Bv(t,e);Lv(t,i);for(const e of i.getChildren()){let i=e;e.is("element")&&(i=t.clone(e,!0)),t.appendChild(i,s.content)}t.appendChild(s.listItem,r)}}(i,t),function(e){const t=[],i=new kd(e.document);for(const{item:n}of i.createRangeIn(e))if(n.is("element")){for(const e of n.getClassNames())/\bmso/gi.exec(e)&&i.removeClass(e,n);for(const e of n.getStyleNames())/\bmso/gi.exec(e)&&i.removeStyle(e,n);(n.is("element","w:sdt")||n.is("element","w:sdtpr")&&n.isEmpty||n.is("element","o:p")&&n.isEmpty)&&t.push(n)}for(const e of t){const t=e.parent,n=t.getChildIndex(e);i.insertChild(n,e.getChildren(),t),i.remove(e)}}(i),e.content=i}}function Uv(e,t,i,{blockElements:n,inlineObjectElements:o}){let r=i.createPositionAt(e,"forward"==t?"after":"before");return r=r.getLastMatchingPosition(({item:e})=>e.is("element")&&!n.includes(e.name)&&!o.includes(e.name),{direction:t}),"forward"==t?r.nodeAfter:r.nodeBefore}function Hv(e,t){return!!e&&e.is("element")&&t.includes(e.name)}function Wv(e){let t=e;for(;t;){if(t.is("element")){const e=t.getStyle?.("white-space");if("pre-wrap"===e)return!0}t=t.parent}return!1}function $v(e,t,i){const{parent:n,data:o}=e,r=o.replaceAll("\t"," ".repeat(i)),s=n.getChildIndex(e);t.remove(e),t.insertChild(s,t.createText(r),n)}const qv=/id=("|')docs-internal-guid-[-0-9a-f]+("|')/i;class Kv{document;constructor(e){this.document=e}isActive(e){return qv.test(e)}execute(e){const t=new kd(this.document),{body:i}=e._parsedData;!function(e,t){for(const i of e.getChildren())if(i.is("element","b")&&"normal"===i.getStyle("font-weight")){const n=e.getChildIndex(i);t.remove(i),t.insertChild(n,i.getChildren(),e)}}(i,t),function(e,t){for(const i of t.createRangeIn(e)){const e=i.item;if(e.is("element","li")){const i=e.getChild(0);i&&i.is("element","p")&&t.unwrapElement(i)}}}(i,t),function(e,t){const i=new zr(t.document.stylesProcessor),n=new Es(i,{renderingMode:"data"}),o=n.blockElements,r=n.inlineObjectElements,s=[];for(const i of t.createRangeIn(e)){const e=i.item;if(e.is("element","br")){const i=Uv(e,"forward",t,{blockElements:o,inlineObjectElements:r}),n=Uv(e,"backward",t,{blockElements:o,inlineObjectElements:r}),a=Hv(i,o);(Hv(n,o)||a)&&s.push(e)}}for(const e of s)e.hasClass("Apple-interchange-newline")?t.remove(e):t.replace(e,t.createElement("p"))}(i,t),function(e,t,i){const n=new Set;for(const i of t.createRangeIn(e).getItems())i.is("view:$textProxy")&&i.data.includes("\t")&&Wv(i.parent)&&n.add(i.textNode);for(const e of n)$v(e,t,i)}(i,t,8),e.content=i}}const Gv=/<google-sheets-html-origin/i;class Yv{document;constructor(e){this.document=e}isActive(e){return Gv.test(e)}execute(e){const t=new kd(this.document),{body:i}=e._parsedData;!function(e,t){for(const i of e.getChildren())if(i.is("element","google-sheets-html-origin")){const n=e.getChildIndex(i);t.remove(i),t.insertChild(n,i.getChildren(),e)}}(i,t),function(e,t){for(const i of e.getChildren())i.is("element","table")&&i.hasAttribute("xmlns")&&t.removeAttribute("xmlns",i)}(i,t),Vv(i,t),function(e,t){for(const i of Array.from(e.getChildren()))i.is("element","style")&&t.remove(i)}(i,t),e.content=i}}function Jv(e){return e.replace(/<span(?: class="Apple-converted-space"|)>(\s+)<\/span>/g,(e,t)=>1===t.length?" ":Array(t.length+1).join(" ").substr(0,t.length))}function Qv(e,t){const i=new DOMParser,n=function(e){return Jv(Jv(e)).replace(/(<span\s+style=['"]mso-spacerun:yes['"]>[^\S\r\n]*?)[\r\n]+([^\S\r\n]*<\/span>)/g,"$1$2").replace(/<span\s+style=['"]mso-spacerun:yes['"]><\/span>/g,"").replace(/(<span\s+style=['"]letter-spacing:[^'"]+?['"]>)[\r\n]+(<\/span>)/g,"$1 $2").replace(/ <\//g," </").replace(/ <o:p><\/o:p>/g," <o:p></o:p>").replace(/<o:p>( |\u00A0)<\/o:p>/g,"").replace(/>([^\S\r\n]*[\r\n]\s*)</g,"><")}(function(e){const t="</body>",i="</html>",n=e.indexOf(t);if(n<0)return e;const o=e.indexOf(i,n+t.length);return e.substring(0,n+t.length)+(o>=0?e.substring(o):"")}(e=(e=e.replace(/<!--\[if gte vml 1]>/g,"")).replace(/<o:SmartTagType(?:\s+[^\s>=]+(?:="[^"]*")?)*\s*\/?>/gi,""))),o=i.parseFromString(n,"text/html");!function(e){e.querySelectorAll("span[style*=spacerun]").forEach(e=>{const t=e,i=t.innerText.length||0;t.innerText=Array(i+1).join(" ").substr(0,i)})}(o);const r=o.body.innerHTML,s=function(e,t){const i=new zr(t),n=new Es(i,{renderingMode:"data"}),o=e.createDocumentFragment(),r=e.body.childNodes;for(;r.length>0;)o.appendChild(r[0]);return n.domToView(o,{skipComments:!0})}(o,t),a=function(e){const t=[],i=[],n=Array.from(e.getElementsByTagName("style"));for(const e of n)e.sheet&&e.sheet.cssRules&&e.sheet.cssRules.length&&(t.push(e.sheet),i.push(e.innerHTML));return{styles:t,stylesString:i.join(" ")}}(o);return{body:s,bodyString:r,styles:a.styles,stylesString:a.stylesString}}const Zv={className:"table-style-align-left"},Xv={className:"table-style-align-center"},ey={className:"table-style-align-right"},ty={className:"table-style-block-align-left"},iy={className:"table-style-block-align-right"},ny=(ey.className,Xv.className,ty.className,iy.className,{center:{align:"center",style:"margin-left: auto; margin-right: auto;",className:"table-style-align-center"},left:{align:"left",style:"float: left;",className:"table-style-align-left"},right:{align:"right",style:"float: right;",className:"table-style-align-right"},blockLeft:{align:void 0,style:"margin-left: 0; margin-right: auto;",className:ty.className},blockRight:{align:void 0,style:"margin-left: auto; margin-right: 0;",className:iy.className}});class oy{_table;_startRow;_endRow;_startColumn;_endColumn;_includeAllSlots;_skipRows;_row;_rowIndex;_column;_cellIndex;_spannedCells;_nextCellAtColumn;_jumpedToStartRow=!1;constructor(e,t={}){this._table=e,this._startRow=void 0!==t.row?t.row:t.startRow||0,this._endRow=void 0!==t.row?t.row:t.endRow,this._startColumn=void 0!==t.column?t.column:t.startColumn||0,this._endColumn=void 0!==t.column?t.column:t.endColumn,this._includeAllSlots=!!t.includeAllSlots,this._skipRows=new Set,this._row=0,this._rowIndex=0,this._column=0,this._cellIndex=0,this._spannedCells=new Map,this._nextCellAtColumn=-1}[Symbol.iterator](){return this}next(){this._canJumpToStartRow()&&this._jumpToNonSpannedRowClosestToStartRow();const e=this._table.getChild(this._rowIndex);if(!e||this._isOverEndRow())return{done:!0,value:void 0};if(!e.is("element","tableRow"))return this._rowIndex++,this.next();if(this._isOverEndColumn())return this._advanceToNextRow();let t=null;const i=this._getSpanned();if(i)this._includeAllSlots&&!this._shouldSkipSlot()&&(t=this._formatOutValue(i.cell,i.row,i.column));else{const i=e.getChild(this._cellIndex);if(!i)return this._advanceToNextRow();const n=parseInt(i.getAttribute("colspan")||"1"),o=parseInt(i.getAttribute("rowspan")||"1");(n>1||o>1)&&this._recordSpans(i,o,n),this._shouldSkipSlot()||(t=this._formatOutValue(i)),this._nextCellAtColumn=this._column+n}return this._column++,this._column==this._nextCellAtColumn&&this._cellIndex++,t||this.next()}skipRow(e){this._skipRows.add(e)}_advanceToNextRow(){return this._row++,this._rowIndex++,this._column=0,this._cellIndex=0,this._nextCellAtColumn=-1,this.next()}_isOverEndRow(){return void 0!==this._endRow&&this._row>this._endRow}_isOverEndColumn(){return void 0!==this._endColumn&&this._column>this._endColumn}_formatOutValue(e,t=this._row,i=this._column){return{done:!1,value:new ry(this,e,t,i)}}_shouldSkipSlot(){const e=this._skipRows.has(this._row),t=this._row<this._startRow,i=this._column<this._startColumn,n=void 0!==this._endColumn&&this._column>this._endColumn;return e||t||i||n}_getSpanned(){const e=this._spannedCells.get(this._row);return e&&e.get(this._column)||null}_recordSpans(e,t,i){const n={cell:e,row:this._row,column:this._column};for(let e=this._row;e<this._row+t;e++)for(let t=this._column;t<this._column+i;t++)e==this._row&&t==this._column||this._markSpannedCell(e,t,n)}_markSpannedCell(e,t,i){this._spannedCells.has(e)||this._spannedCells.set(e,new Map);this._spannedCells.get(e).set(t,i)}_canJumpToStartRow(){return!!this._startRow&&this._startRow>0&&!this._jumpedToStartRow}_jumpToNonSpannedRowClosestToStartRow(){const e=this._getRowLength(0);for(let t=this._startRow;!this._jumpedToStartRow;t--)e===this._getRowLength(t)&&(this._row=t,this._rowIndex=t,this._jumpedToStartRow=!0)}_getRowLength(e){return[...this._table.getChild(e).getChildren()].reduce((e,t)=>e+parseInt(t.getAttribute("colspan")||"1"),0)}}class ry{cell;row;column;cellAnchorRow;cellAnchorColumn;_cellIndex;_rowIndex;_table;constructor(e,t,i,n){this.cell=t,this.row=e._row,this.column=e._column,this.cellAnchorRow=i,this.cellAnchorColumn=n,this._cellIndex=e._cellIndex,this._rowIndex=e._rowIndex,this._table=e._table}get isAnchor(){return this.row===this.cellAnchorRow&&this.column===this.cellAnchorColumn}get cellWidth(){return parseInt(this.cell.getAttribute("colspan")||"1")}get cellHeight(){return parseInt(this.cell.getAttribute("rowspan")||"1")}get rowIndex(){return this._rowIndex}getPositionBefore(){return this._table.root.document.model.createPositionAt(this._table.getChild(this.row),this._cellIndex)}}function sy(e,t,i,n,o=1){null!=t&&null!=o&&t>o?n.setAttribute(e,t,i):n.removeAttribute(e,i)}function ay(e,t,i={}){const n=e.createElement("tableCell",i);return e.insertElement("paragraph",n),e.insert(n,t),n}function ly(e,t){const i=t.parent.parent,n=parseInt(i.getAttribute("headingColumns")||"0"),{column:o}=e.getCellLocation(t);return!!n&&o<n}function cy({table:e,row:t,column:i}){const n=new oy(e,{row:t,column:i});for(const{cell:e}of n){if("header"!==e.getAttribute("tableCellType"))return!1}return!0}function dy(e){const{model:t,config:i}=e;return t.schema.checkAttribute("tableCell","tableCellType")&&!0===i.get("experimentalFlags.tableCellTypeSupport")}function uy(e,t,i){const{startRow:n,startColumn:o,endRow:r,endColumn:s}=t,a=i.createElement("table"),l=e.getAttribute("tableType");l&&i.setAttribute("tableType",l,a);const c=r-n+1;for(let e=0;e<c;e++)i.insertElement("tableRow",a,"end");const d=[...new oy(e,{startRow:n,endRow:r,startColumn:o,endColumn:s,includeAllSlots:!0})];for(const{row:e,column:t,cell:l,isAnchor:c,cellAnchorRow:u,cellAnchorColumn:h}of d){const d=e-n,m=a.getChild(d);if(c){const n=i.cloneElement(l);i.append(n,m),py(n,e,t,r,s,i)}else(u<n||h<o)&&ay(i,i.createPositionAt(m,"end"))}return function(e,t,i,n,o){const r=parseInt(t.getAttribute("headingRows")||"0");if(r>0){sy("headingRows",r-i,e,o,0)}const s=parseInt(t.getAttribute("headingColumns")||"0");if(s>0){sy("headingColumns",s-n,e,o,0)}}(a,e,n,o,i),a}function hy(e,t,i=0){const n=[],o=new oy(e,{startRow:i,endRow:t-1});for(const e of o){const{row:i,cellHeight:o}=e;i<t&&t<=i+o-1&&n.push(e)}return n}function my(e,t,i){const n=e.parent,o=n.parent,r=n.index,s=t-r,a={},l=parseInt(e.getAttribute("rowspan"))-s;l>1&&(a.rowspan=l);const c=parseInt(e.getAttribute("colspan")||"1");c>1&&(a.colspan=c);const d=r+s,u=[...new oy(o,{startRow:r,endRow:d,includeAllSlots:!0})];let h,m=null;for(const t of u){const{row:n,column:o,cell:r}=t;r===e&&void 0===h&&(h=o),void 0!==h&&h===o&&n===d&&(m=ay(i,t.getPositionBefore(),a))}return sy("rowspan",s,e,i),m}function gy(e,t){const i=[],n=new oy(e);for(const e of n){const{column:n,cellWidth:o}=e;n<t&&t<=n+o-1&&i.push(e)}return i}function fy(e,t,i,n){const o=i-t,r={},s=parseInt(e.getAttribute("colspan"))-o;s>1&&(r.colspan=s);const a=parseInt(e.getAttribute("rowspan")||"1");a>1&&(r.rowspan=a);const l=ay(n,n.createPositionAfter(e),r);return sy("colspan",o,e,n),l}function py(e,t,i,n,o,r){const s=parseInt(e.getAttribute("colspan")||"1"),a=parseInt(e.getAttribute("rowspan")||"1");if(i+s-1>o){sy("colspan",o-i+1,e,r,1)}if(t+a-1>n){sy("rowspan",n-t+1,e,r,1)}}function by(e,t){const i=t.getColumns(e),n=new Array(i).fill(0);for(const{column:t}of new oy(e))n[t]++;const o=n.reduce((e,t,i)=>t?e:[...e,i],[]);if(o.length>0){const i=o[o.length-1];return t.removeColumns(e,{at:i}),!0}return!1}function ky(e,t){const i=[],n=t.getRows(e);for(let t=0;t<n;t++){e.getChild(t).isEmpty&&i.push(t)}if(i.length>0){const n=i[i.length-1];return t.removeRows(e,{at:n}),!0}return!1}function wy(e,t){by(e,t)||ky(e,t)}function _y(e,t){const i=Array.from(new oy(e,{startColumn:t.firstColumn,endColumn:t.lastColumn,row:t.lastRow}));if(i.every(({cellHeight:e})=>1===e))return t.lastRow;const n=i[0].cellHeight-1;return t.lastRow+n}function vy(e,t){const i=Array.from(new oy(e,{startRow:t.firstRow,endRow:t.lastRow,column:t.lastColumn}));if(i.every(({cellWidth:e})=>1===e))return t.lastColumn;const n=i[0].cellWidth-1;return t.lastColumn+n}function yy(){return e=>{e.on("element:table",(e,t,i)=>{const n=t.viewItem;if(!i.consumable.test(n,{name:!0}))return;const{rows:o,headingRows:r,headingColumns:s}=function(e){let t,i=!0;const n=[],o=[];let r;for(const t of Array.from(e.getChildren())){if("tbody"!==t.name&&"thead"!==t.name&&"tfoot"!==t.name)continue;"thead"!==t.name||r||(i=!0,r=t);const e=Array.from(t.getChildren()).filter(e=>e.is("element","tr"));let s=null;for(const a of e){const e=Array.from(a.getChildren()).filter(e=>e.is("element","td")||e.is("element","th"));r&&t===r||"tbody"===t.name&&e.length>0&&(null===s||e.length===s)&&e.every(e=>e.is("element","th"))&&i?(n.push(a),i=!0):(o.push(a),i=!1),s=Math.max(s||0,e.length)}}const s=function(e){let t=new Map,i=0;const n=e.map(e=>{const n=[],o=Array.from(e.getChildren()).filter(e=>"th"===e.name||"td"===e.name),r=new Map;for(;o.length||n.length<i;){const e=t.get(n.length);if(e&&e.remaining>0)n.push(e.cell);else{const e=o.shift();if(!e){n.push(null);continue}{const t=parseInt(e.getAttribute("colspan")||"1"),i=parseInt(e.getAttribute("rowspan")||"1");for(let o=0;o<t;o++)i>1&&r.set(n.length,{cell:e,remaining:i-1}),n.push(e)}}}for(const[e,i]of t.entries())i.remaining-=1,i.remaining>0&&!r.has(e)&&r.set(e,i);return t=r,i=Math.max(i,n.length),n});for(const e of n)for(;e.length<i;)e.push(null);return n}(o);for(const e of s){let i=0;for(;i<e.length&&"th"===e[i]?.name;)i+=1;(void 0===t||i<t)&&(t=i)}return{headingRows:n.length,headingColumns:t||0,rows:[...n,...o]}}(n),a={};s&&(a.headingColumns=s),r&&(a.headingRows=r);const l=i.writer.createElement("table",a);if(i.safeInsert(l,t.modelCursor)){if(i.consumable.consume(n,{name:!0}),o.forEach(e=>i.convertItem(e,i.writer.createPositionAt(l,"end"))),i.convertChildren(n,i.writer.createPositionAt(l,"end")),l.isEmpty){const e=i.writer.createElement("tableRow");i.writer.insert(e,i.writer.createPositionAt(l,"end")),ay(i.writer,i.writer.createPositionAt(e,"end"))}i.updateConversionResult(l,t)}})}}function Ay(e){return t=>{t.on(`element:${e}`,(e,t,{writer:i})=>{if(!t.modelRange)return;const n=t.modelRange.start.nodeAfter,o=i.createPositionAt(n,0);if(t.viewItem.isEmpty)return void i.insertElement("paragraph",o);const r=Array.from(n.getChildren());if(r.every(e=>e.is("element","$marker"))){const e=i.createElement("paragraph");i.insert(e,i.createPositionAt(n,0));for(const t of r)i.move(i.createRangeOn(t),i.createPositionAt(e,"end"))}},{priority:"low"})}}function xy(e,t={}){const i={borderStyle:"none",borderWidth:"",borderColor:"",backgroundColor:"",width:"",height:"",...e};return t.includeAlignmentProperty&&!i.alignment&&(i.alignment="center"),t.includePaddingProperty&&!i.padding&&(i.padding=""),t.includeVerticalAlignmentProperty&&!i.verticalAlignment&&(i.verticalAlignment="middle"),t.includeHorizontalAlignmentProperty&&!i.horizontalAlignment&&(i.horizontalAlignment=t.isRightToLeftContent?"right":"left"),i}function Cy(e,t){return(i,{writer:n})=>{const o=i.getAttribute("headingRows")||0,r=n.createContainerElement("table",null,[]),s=n.createContainerElement("figure",{class:"table"},r);o>0&&n.insert(n.createPositionAt(r,"end"),n.createContainerElement("thead",null,n.createSlot(e=>e.is("element","tableRow")&&e.index<o))),o<e.getRows(i)&&n.insert(n.createPositionAt(r,"end"),n.createContainerElement("tbody",null,n.createSlot(e=>e.is("element","tableRow")&&e.index>=o)));for(const{positionOffset:e,filter:i}of t.additionalSlots)n.insert(n.createPositionAt(r,e),n.createSlot(i));return n.insert(n.createPositionAt(r,"after"),n.createSlot(e=>!e.is("element","tableRow")&&!t.additionalSlots.some(({filter:t})=>t(e)))),t.asWidget?function(e,t){return t.setCustomProperty("table",!0,e),Ym(e,t,{hasSelectionHandle:!0})}(s,n):s}}function Ty(e){return(i,{writer:n})=>{if(e.cellTypeEnabled?.()){return t(n,"header"===i.getAttribute("tableCellType")?"th":"td")}const o=i.parent,r=o.parent,s=r.getChildIndex(o),a=new oy(r,{row:s}),l=r.getAttribute("headingRows")||0,c=r.getAttribute("headingColumns")||0;let d=null;for(const e of a)if(e.cell==i){d=t(n,e.row<l||e.column<c?"th":"td");break}return d};function t(t,i){return e.asWidget?Xm(t.createEditableElement(i),t,{withAriaRole:!1}):t.createContainerElement(i)}}function Ey(e={}){return(t,{writer:i})=>{if(!t.parent.is("element","tableCell"))return null;if(!Iy(t))return null;if(e.asWidget)return i.createContainerElement("span",{class:"ck-table-bogus-paragraph"});{const e=i.createContainerElement("p");return i.setCustomProperty("dataPipeline:transparentRendering",!0,e),e}}}function Iy(e){return 1==e.parent.childCount&&!function(e){for(const t of e.getAttributeKeys())if(!t.startsWith("selection:")&&"htmlEmptyBlock"!=t)return!0;return!1}(e)}function Sy(e){return(t,i)=>{const n=e.plugins.has("PlainTableOutput"),o=i.options.isClipboardPipeline,r=e.config.get("experimentalFlags.useExtendedTableBlockAlignment");return n||r&&o?function(e,t,i){const n=t.writer,o=e.getAttribute("headingRows")||0,r=n.createSlot(e=>e.is("element","tableRow")&&e.index<o),s=n.createSlot(e=>e.is("element","tableRow")&&e.index>=o),a=n.createSlot(e=>!e.is("element","tableRow")),l=n.createContainerElement("thead",null,r),c=n.createContainerElement("tbody",null,s),d=[];o&&d.push(l);o<e.childCount&&d.push(c);const u={class:"table"};if(i.plugins.has("TablePropertiesEditing")&&t.options.isClipboardPipeline){const t=function(e,t){return xy({borderStyle:"double",borderColor:"hsl(0, 0%, 70%)",borderWidth:"1px",...e},t)}(i.config.get("table.tableProperties.defaultProperties"),{includeAlignmentProperty:!0}),n=e.getAttribute("tableAlignment");let o=t.alignment;"layout"===e.getAttribute("tableType")&&(o="");const r=n||o;r&&(u.class+=" "+ny[r].className,u.style=ny[r].style,void 0!==ny[r].align&&(u.align=ny[r].align))}return n.createContainerElement("table",u,[a,...d])}(t,i,e):null}}function Py(e){return(t,{writer:i,options:n})=>{const o=e.plugins.has("PlainTableOutput"),r=n.isClipboardPipeline,s=e.config.get("experimentalFlags.useExtendedTableBlockAlignment");return(o||s&&r)&&"table"===t.parent.name?i.createContainerElement("caption"):null}}class My extends Xu{refresh(){const e=this.editor.model,t=e.document.selection,i=e.schema;this.isEnabled=function(e,t){const i=e.getFirstPosition().parent,n=i===i.root?i:i.parent;return t.checkChild(n,"table")}(t,i)}execute(e={}){const t=this.editor,i=t.model,n=t.plugins.get("TableUtils"),o=t.config.get("table.defaultHeadings.rows"),r=t.config.get("table.defaultHeadings.columns");void 0===e.headingRows&&o&&(e.headingRows=o),void 0===e.headingColumns&&r&&(e.headingColumns=r),i.change(t=>{const o=n.createTable(t,e);i.insertObject(o,null,null,{findOptimalPosition:"auto"}),t.setSelection(t.createPositionAt(o.getNodeByPath([0,0,0]),0))})}}class Oy extends Xu{order;constructor(e,t={}){super(e),this.order=t.order||"below"}refresh(){const e=this.editor.model.document.selection,t=!!this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(e).length;this.isEnabled=t}execute(){const e=this.editor,t=e.model.document.selection,i=e.plugins.get("TableUtils"),n="above"===this.order,o=i.getSelectionAffectedTableCells(t),r=i.getRowIndexes(o),s=n?r.first:r.last,a=o[0].findAncestor("table");i.insertRows(a,{at:n?s:s+1,copyStructureFromAbove:!n})}}class Ry extends Xu{order;constructor(e,t={}){super(e),this.order=t.order||"right"}refresh(){const e=this.editor.model.document.selection,t=!!this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(e).length;this.isEnabled=t}execute(){const e=this.editor,t=e.model.document.selection,i=e.plugins.get("TableUtils"),n="left"===this.order,o=i.getSelectionAffectedTableCells(t),r=i.getColumnIndexes(o),s=n?r.first:r.last,a=o[0].findAncestor("table");i.insertColumns(a,{columns:1,at:n?s:s+1})}}class Ny extends Xu{direction;constructor(e,t={}){super(e),this.direction=t.direction||"horizontally"}refresh(){const e=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(this.editor.model.document.selection);this.isEnabled=1===e.length}execute(){const e=this.editor.plugins.get("TableUtils"),t=e.getSelectionAffectedTableCells(this.editor.model.document.selection)[0];"horizontally"===this.direction?e.splitCellHorizontally(t,2):e.splitCellVertically(t,2)}}class Vy extends Xu{direction;isHorizontal;constructor(e,t){super(e),this.direction=t.direction,this.isHorizontal="right"==this.direction||"left"==this.direction}refresh(){const e=this._getMergeableCell();this.value=e,this.isEnabled=!!e}execute(){const e=this.editor.model,t=e.document,i=this.editor.plugins.get("TableUtils").getTableCellsContainingSelection(t.selection)[0],n=this.value,o=this.direction;e.change(e=>{const t="right"==o||"down"==o,r=t?i:n,s=t?n:i,a=s.parent;!function(e,t,i){Ly(e)||(Ly(t)&&i.remove(i.createRangeIn(t)),i.move(i.createRangeIn(e),i.createPositionAt(t,"end")));i.remove(e)}(s,r,e);const l=this.isHorizontal?"colspan":"rowspan",c=parseInt(i.getAttribute(l)||"1"),d=parseInt(n.getAttribute(l)||"1");e.setAttribute(l,c+d,r),e.setSelection(e.createRangeIn(r));const u=this.editor.plugins.get("TableUtils");wy(a.findAncestor("table"),u)})}_getMergeableCell(){const e=this.editor.model.document,t=this.editor.plugins.get("TableUtils"),i=t.getTableCellsContainingSelection(e.selection)[0];if(!i)return;const n=this.isHorizontal?function(e,t,i){const n=e.parent,o=n.parent,r="right"==t?e.nextSibling:e.previousSibling,s=(o.getAttribute("headingColumns")||0)>0;if(!r)return;const a="right"==t?e:r,l="right"==t?r:e,{column:c}=i.getCellLocation(a),{column:d}=i.getCellLocation(l),u=parseInt(a.getAttribute("colspan")||"1"),h=ly(i,a),m=ly(i,l);if(s&&h!=m)return;return c+u===d?r:void 0}(i,this.direction,t):function(e,t,i){const n=e.parent,o=n.parent,r=o.getChildIndex(n);if("down"==t&&r===i.getRows(o)-1||"up"==t&&0===r)return null;const s=parseInt(e.getAttribute("rowspan")||"1"),a=o.getAttribute("headingRows")||0,l="down"==t&&r+s===a,c="up"==t&&r===a;if(a&&(l||c))return null;const d=parseInt(e.getAttribute("rowspan")||"1"),u="down"==t?r+d:r,h=[...new oy(o,{endRow:u})],m=h.find(t=>t.cell===e),g=m.column,f=h.find(({row:e,cellHeight:i,column:n})=>n===g&&("down"==t?e===u:u===e+i));return f&&f.cell?f.cell:null}(i,this.direction,t);if(!n)return;const o=this.isHorizontal?"rowspan":"colspan",r=parseInt(i.getAttribute(o)||"1");return parseInt(n.getAttribute(o)||"1")===r?n:void 0}}function Ly(e){const t=e.getChild(0);return 1==e.childCount&&t.is("element","paragraph")&&t.isEmpty}class Dy extends Xu{refresh(){const e=this.editor.plugins.get("TableUtils"),t=e.getSelectionAffectedTableCells(this.editor.model.document.selection),i=t[0];if(i){const n=i.findAncestor("table"),o=e.getRows(n)-1,r=e.getRowIndexes(t),s=0===r.first&&r.last===o;this.isEnabled=!s}else this.isEnabled=!1}execute(){const e=this.editor.model,t=this.editor.plugins.get("TableUtils"),i=t.getSelectionAffectedTableCells(e.document.selection),n=t.getRowIndexes(i),o=i[0],r=o.findAncestor("table"),s=t.getCellLocation(o).column;e.change(e=>{const i=n.last-n.first+1;t.removeRows(r,{at:n.first,rows:i});const o=function(e,t,i,n){const o=e.getChild(Math.min(t,n-1));let r=o.getChild(0),s=0;for(const e of o.getChildren()){if(s>i)return r;r=e,s+=parseInt(e.getAttribute("colspan")||"1")}return r}(r,n.first,s,t.getRows(r));e.setSelection(e.createPositionAt(o,0))})}}class By extends Xu{refresh(){const e=this.editor.plugins.get("TableUtils"),t=e.getSelectionAffectedTableCells(this.editor.model.document.selection),i=t[0];if(i){const n=i.findAncestor("table"),o=e.getColumns(n),{first:r,last:s}=e.getColumnIndexes(t);this.isEnabled=s-r<o-1}else this.isEnabled=!1}execute(){const e=this.editor.plugins.get("TableUtils"),[t,i]=function(e,t){const i=t.getSelectionAffectedTableCells(e),n=i[0],o=i.pop(),r=[n,o];return n.isBefore(o)?r:r.reverse()}(this.editor.model.document.selection,e),n=t.parent.parent,o=[...new oy(n)],r={first:o.find(e=>e.cell===t).column,last:o.find(e=>e.cell===i).column},s=function(e,t,i,n){const o=parseInt(i.getAttribute("colspan")||"1");return o>1?i:t.previousSibling||i.nextSibling?i.nextSibling||t.previousSibling:n.first?e.reverse().find(({column:e})=>e<n.first).cell:e.reverse().find(({column:e})=>e>n.last).cell}(o,t,i,r);this.editor.model.change(t=>{const i=r.last-r.first+1;e.removeColumns(n,{at:r.first,columns:i}),t.setSelection(t.createPositionAt(s,0))})}}class zy extends Xu{refresh(){const e=this.editor.plugins.get("TableUtils"),t=this.editor.model,i=e.getSelectionAffectedTableCells(t.document.selection);if(0===i.length)return this.isEnabled=!1,void(this.value=!1);const n=i[0].findAncestor("table");this.isEnabled=t.schema.checkAttribute(n,"headingRows"),this.value=i.every(e=>this._isInHeading(e,e.parent.parent))}execute(e={}){if(e.forceValue===this.value)return;const t=this.editor.plugins.get("TableUtils"),i=this.editor.model,n=t.getSelectionAffectedTableCells(i.document.selection),o=n[0].findAncestor("table"),{first:r,last:s}=t.getRowIndexes(n),a=this.value?r:s+1,l=o.getAttribute("headingRows")||0;i.change(e=>{if(a){const t=hy(o,a,a>l?l:0);for(const{cell:i}of t)my(i,a,e)}t.setHeadingRowsCount(e,o,a)})}_isInHeading(e,t){const i=parseInt(t.getAttribute("headingRows")||"0");return!!i&&e.parent.index<i}}class Fy extends Xu{refresh(){const e=this.editor.plugins.get("TableUtils"),t=this.editor.model,i=e.getSelectionAffectedTableCells(t.document.selection);if(0===i.length)return this.isEnabled=!1,void(this.value=!1);const n=i[0].findAncestor("table");this.isEnabled=t.schema.checkAttribute(n,"headingColumns"),this.value=i.every(t=>ly(e,t))}execute(e={}){if(e.forceValue===this.value)return;const t=this.editor.plugins.get("TableUtils"),i=this.editor.model,n=t.getSelectionAffectedTableCells(i.document.selection),o=n[0].findAncestor("table"),{first:r,last:s}=t.getColumnIndexes(n),a=this.value?r:s+1;i.change(e=>{if(a){const t=gy(o,a);for(const{cell:i,column:n}of t)fy(i,n,a,e)}t.setHeadingColumnsCount(e,o,a)})}}function jy(e){if(e.is("element","tableColumnGroup"))return e;const t=e.getChildren();return Array.from(t).find(e=>e.is("element","tableColumnGroup"))}function Uy(e){const t=jy(e);return t?Array.from(t.getChildren()):[]}class Hy extends Qu{static get pluginName(){return"TableUtils"}static get isOfficialPlugin(){return!0}init(){this.decorate("insertColumns"),this.decorate("insertRows")}getCellLocation(e){const t=e.parent,i=t.parent,n=i.getChildIndex(t),o=new oy(i,{row:n});for(const{cell:t,row:i,column:n}of o)if(t===e)return{row:i,column:n}}createTable(e,t){const i=e.createElement("table"),n=t.rows||2,o=t.columns||2;return Wy(e,i,0,n,o),t.headingRows&&this.setHeadingRowsCount(e,i,Math.min(t.headingRows,n)),t.headingColumns&&this.setHeadingColumnsCount(e,i,Math.min(t.headingColumns,o)),i}insertRows(e,t={}){const i=this.editor.model,n=t.at||0,o=t.rows||1,r=void 0!==t.copyStructureFromAbove,s=t.copyStructureFromAbove?n-1:n,a=dy(this.editor),l=this.getRows(e),c=this.getColumns(e);if(n>l)throw new A("tableutils-insertrows-insert-out-of-range",this,{options:t});i.change(t=>{let i=e.getAttribute("headingRows")||0;const d=e.getAttribute("headingColumns")||0;if(i>n&&(i+=o,this.setHeadingRowsCount(t,e,i,{shallow:!0})),!r&&(0===n||n===l)){const r=Wy(t,e,n,o,c);if(a)for(let e=0;e<r.length;e++){const o=r[e];for(let r=0;r<c;r++){const s=o[r];(n+e<i||r<d)&&t.setAttribute("tableCellType","header",s)}}return}const u=r?Math.max(n,s):n,h=new oy(e,{endRow:u}),m=new Array(c).fill(1);for(const{row:e,column:i,cellHeight:a,cellWidth:l,cell:c}of h){const d=e+a-1,u=e<=s&&s<=d;e<n&&n<=d?(t.setAttribute("rowspan",a+o,c),m[i]=-l):r&&u&&(m[i]=l)}for(let r=0;r<o;r++){const o=t.createElement("tableRow");t.insert(o,e,n);for(let e=0;e<m.length;e++){const s=m[e],l=t.createPositionAt(o,"end");if(s>0){const o=ay(t,l,s>1?{colspan:s}:void 0);a&&(n+r<i||e<d)&&t.setAttribute("tableCellType","header",o)}e+=Math.abs(s)-1}}})}insertColumns(e,t={}){const i=this.editor.model,n=t.at||0,o=t.columns||1,r=dy(this.editor);i.change(t=>{const i=e.getAttribute("headingRows")||0;let s=e.getAttribute("headingColumns");n<s&&(s+=o,this.setHeadingColumnsCount(t,e,s,{shallow:!0}));const a=this.getColumns(e);if(0===n||a===n){let a=0;for(const l of e.getChildren()){if(!l.is("element","tableRow"))continue;const e=$y(o,t,t.createPositionAt(l,n?"end":0));if(r)for(let o=0;o<e.length;o++)(n+o<s||a<i)&&t.setAttribute("tableCellType","header",e[o]);a++}return}const l=new oy(e,{column:n,includeAllSlots:!0});for(const e of l){const{row:a,cell:c,cellAnchorColumn:d,cellAnchorRow:u,cellWidth:h,cellHeight:m}=e;if(d<n){t.setAttribute("colspan",h+o,c);const e=u+m-1;for(let t=a;t<=e;t++)l.skipRow(t)}else{const l=$y(o,t,e.getPositionBefore());if(r)for(let e=0;e<l.length;e++)(n+e<s||a<i)&&t.setAttribute("tableCellType","header",l[e])}}})}removeRows(e,t){const i=this.editor.model,n=t.rows||1,o=this.getRows(e),r=t.at,s=r+n-1;if(s>o-1)throw new A("tableutils-removerows-row-index-out-of-range",this,{table:e,options:t});i.change(t=>{const i={first:r,last:s},{cellsToMove:n,cellsToTrim:o}=function(e,{first:t,last:i}){const n=new Map,o=[];for(const{row:r,column:s,cellHeight:a,cell:l}of new oy(e,{endRow:i})){const e=r+a-1;if(r>=t&&r<=i&&e>i){const e=a-(i-r+1);n.set(s,{cell:l,rowspan:e})}if(r<t&&e>=t){let n;n=e>=i?i-t+1:e-t+1,o.push({cell:l,rowspan:a-n})}}return{cellsToMove:n,cellsToTrim:o}}(e,i);if(n.size){!function(e,t,i,n){const o=new oy(e,{includeAllSlots:!0,row:t}),r=[...o],s=e.getChild(t);let a;for(const{column:e,cell:t,isAnchor:o}of r)if(i.has(e)){const{cell:t,rowspan:o}=i.get(e),r=a?n.createPositionAfter(a):n.createPositionAt(s,0);n.move(n.createRangeOn(t),r),sy("rowspan",o,t,n),a=t}else o&&(a=t)}(e,s+1,n,t)}for(let i=s;i>=r;i--)t.remove(e.getChild(i));for(const{rowspan:e,cell:i}of o)sy("rowspan",e,i,t);if(function(e,{first:t,last:i},n){const o=e.getAttribute("headingRows")||0;if(t<o){sy("headingRows",i<o?o-(i-t+1):t,e,n,0)}}(e,i,t),by(e,this)||ky(e,this),dy(this.editor)){let i=e.getAttribute("headingRows")||0;const n=this.getRows(e);for(;i<n&&cy({table:e,row:i});)i++;this.setHeadingRowsCount(t,e,i,{shallow:!0})}})}removeColumns(e,t){const i=this.editor.model,n=t.at,o=t.columns||1,r=t.at+o-1;i.change(t=>{!function(e,t,i){const n=e.getAttribute("headingColumns")||0;if(n&&t.first<n){const o=Math.min(n-1,t.last)-t.first+1;i.setAttribute("headingColumns",n-o,e)}}(e,{first:n,last:r},t);const i=Uy(e);for(let o=r;o>=n;o--){for(const{cell:i,column:n,cellWidth:r}of[...new oy(e)])n<=o&&r>1&&n+r>o?sy("colspan",r-1,i,t):n===o&&t.remove(i);if(i[o]){const e=0===o?i[1]:i[o-1],n=parseFloat(i[o].getAttribute("columnWidth")),r=parseFloat(e.getAttribute("columnWidth"));t.remove(i[o]),t.setAttribute("columnWidth",n+r+"%",e)}}if(ky(e,this)||by(e,this),dy(this.editor)){let i=e.getAttribute("headingColumns")||0;const n=this.getColumns(e);for(;i<n&&cy({table:e,column:i});)i++;this.setHeadingColumnsCount(t,e,i,{shallow:!0})}})}splitCellVertically(e,t=2){const i=this.editor.model,n=e.parent.parent,o=parseInt(e.getAttribute("rowspan")||"1"),r=parseInt(e.getAttribute("colspan")||"1");i.change(i=>{if(r>1){const{newCellsSpan:n,updatedSpan:s}=qy(r,t);sy("colspan",s,e,i);const a={};n>1&&(a.colspan=n),o>1&&(a.rowspan=o);$y(r>t?t-1:r-1,i,i.createPositionAfter(e),a)}if(r<t){const s=t-r,a=[...new oy(n)],{column:l}=a.find(({cell:t})=>t===e),c=a.filter(({cell:t,cellWidth:i,column:n})=>t!==e&&n===l||n<l&&n+i>l);for(const{cell:e,cellWidth:t}of c)i.setAttribute("colspan",t+s,e);const d={};o>1&&(d.rowspan=o),$y(s,i,i.createPositionAfter(e),d);const u=n.getAttribute("headingColumns")||0;u>l&&sy("headingColumns",u+s,n,i)}})}splitCellHorizontally(e,t=2){const i=this.editor.model,n=e.parent,o=n.parent,r=o.getChildIndex(n),s=parseInt(e.getAttribute("rowspan")||"1"),a=parseInt(e.getAttribute("colspan")||"1");i.change(i=>{if(s>1){const n=[...new oy(o,{startRow:r,endRow:r+s-1,includeAllSlots:!0})],{newCellsSpan:l,updatedSpan:c}=qy(s,t);sy("rowspan",c,e,i);const{column:d}=n.find(({cell:t})=>t===e),u={};l>1&&(u.rowspan=l),a>1&&(u.colspan=a);let h=0;for(const e of n){const{column:t,row:n}=e,o=t===d;h>=l&&o&&(h=0),n>=r+c&&o&&(h||$y(1,i,e.getPositionBefore(),u),h++)}}if(s<t){const n=t-s,l=[...new oy(o,{startRow:0,endRow:r})];for(const{cell:t,cellHeight:o,row:s}of l)if(t!==e&&s+o>r){const e=o+n;i.setAttribute("rowspan",e,t)}const c={};a>1&&(c.colspan=a),Wy(i,o,r+1,n,1,c);const d=o.getAttribute("headingRows")||0;d>r&&sy("headingRows",d+n,o,i)}})}getColumns(e){return[...e.getChild(0).getChildren()].filter(e=>e.is("element","tableCell")).reduce((e,t)=>e+parseInt(t.getAttribute("colspan")||"1"),0)}getRows(e){return Array.from(e.getChildren()).reduce((e,t)=>t.is("element","tableRow")?e+1:e,0)}createTableWalker(e,t={}){return new oy(e,t)}getSelectedTableCells(e){const t=[];for(const i of this.sortRanges(e.getRanges())){const e=i.getContainedElement();e&&e.is("element","tableCell")&&t.push(e)}return t}setHeadingRowsCount(e,t,i,n={}){const{shallow:o,resetFormerHeadingCells:r=!0,autoExpand:s=!0}=n,a=t.getAttribute("headingRows")||0;if(i!==a&&(sy("headingRows",i,t,e,0),!o&&dy(this.editor))){for(const{cell:n,row:o,column:r}of new oy(t,{endRow:i-1}))Gy({table:t,writer:e,cell:n,row:o,column:r});if(r&&i<a)for(let n=i;n<a&&cy({table:t,row:n});n++)for(const{cell:i,row:o,column:r}of new oy(t,{row:n}))Gy({table:t,writer:e,cell:i,row:o,column:r});if(s&&i>a){const n=this.getRows(t);for(;i<n&&cy({table:t,row:i});)i++;sy("headingRows",i,t,e,0)}}}setHeadingColumnsCount(e,t,i,n={}){const{shallow:o,resetFormerHeadingCells:r=!0,autoExpand:s=!0}=n,a=t.getAttribute("headingColumns")||0;if(i!==a&&(sy("headingColumns",i,t,e,0),!o&&dy(this.editor))){for(const{cell:n,row:o,column:r}of new oy(t,{endColumn:i-1}))Gy({table:t,writer:e,cell:n,row:o,column:r});if(r&&i<a)for(let n=i;n<a&&cy({table:t,column:n});n++)for(const{cell:i,row:o,column:r}of new oy(t,{column:n}))Gy({table:t,writer:e,cell:i,row:o,column:r});if(s&&i>a){const n=this.getColumns(t);for(;i<n&&cy({table:t,column:i});)i++;sy("headingColumns",i,t,e,0)}}}getTableCellsContainingSelection(e){const t=[];for(const i of e.getRanges()){const e=i.start.findAncestor("tableCell");e&&t.push(e)}return t}getSelectionAffectedTableCells(e){const t=this.getSelectedTableCells(e);return t.length?t:this.getTableCellsContainingSelection(e)}getRowIndexes(e){const t=e.map(e=>e.parent.index);return this._getFirstLastIndexesObject(t)}getColumnIndexes(e){const t=e[0].findAncestor("table"),i=[...new oy(t)].filter(t=>e.includes(t.cell)).map(e=>e.column);return this._getFirstLastIndexesObject(i)}isSelectionRectangular(e){if(e.length<2||!this._areCellInTheSameTableSection(e))return!1;const t=new Set,i=new Set;let n=0;for(const o of e){const{row:e,column:r}=this.getCellLocation(o),s=parseInt(o.getAttribute("rowspan"))||1,a=parseInt(o.getAttribute("colspan"))||1;t.add(e),i.add(r),s>1&&t.add(e+s-1),a>1&&i.add(r+a-1),n+=s*a}const o=function(e,t){const i=Array.from(e.values()),n=Array.from(t.values()),o=Math.max(...i),r=Math.min(...i),s=Math.max(...n),a=Math.min(...n);return(o-r+1)*(s-a+1)}(t,i);return o==n}sortRanges(e){return Array.from(e).sort(Ky)}_getFirstLastIndexesObject(e){const t=e.sort((e,t)=>e-t);return{first:t[0],last:t[t.length-1]}}_areCellInTheSameTableSection(e){const t=e[0].findAncestor("table"),i=this.getRowIndexes(e),n=parseInt(t.getAttribute("headingRows"))||0;if(!this._areIndexesInSameSection(i,n))return!1;const o=this.getColumnIndexes(e),r=parseInt(t.getAttribute("headingColumns"))||0;return this._areIndexesInSameSection(o,r)}_areIndexesInSameSection({first:e,last:t},i){return e<i===t<i}}function Wy(e,t,i,n,o,r={}){const s=[];for(let a=0;a<n;a++){const n=e.createElement("tableRow");e.insert(n,t,i),s.push($y(o,e,e.createPositionAt(n,"end"),r))}return s}function $y(e,t,i,n={}){const o=[];let r=i;for(let i=0;i<e;i++){const e=ay(t,r,n);o.push(e),r=t.createPositionAfter(e)}return o}function qy(e,t){if(e<t)return{newCellsSpan:1,updatedSpan:1};const i=Math.floor(e/t);return{newCellsSpan:i,updatedSpan:e-i*t+i}}function Ky(e,t){const i=e.start,n=t.start;return i.isBefore(n)?-1:1}function Gy({writer:e,table:t,row:i,column:n,cell:o}){const r=t.getAttribute("headingRows")||0,s=t.getAttribute("headingColumns")||0;i>=r&&n>=s?e.removeAttribute("tableCellType",o):e.setAttribute("tableCellType","header",o)}class Yy extends Xu{refresh(){const e=this.editor.plugins.get(Hy),t=e.getSelectedTableCells(this.editor.model.document.selection);this.isEnabled=e.isSelectionRectangular(t)}execute(){const e=this.editor.model,t=this.editor.plugins.get(Hy);e.change(i=>{const n=t.getSelectedTableCells(e.document.selection),o=n.shift(),{mergeWidth:r,mergeHeight:s}=function(e,t,i){let n=0,o=0;for(const e of t){const{row:t,column:r}=i.getCellLocation(e);n=Zy(e,r,n,"colspan"),o=Zy(e,t,o,"rowspan")}const{row:r,column:s}=i.getCellLocation(e),a=n-s,l=o-r;return{mergeWidth:a,mergeHeight:l}}(o,n,t);sy("colspan",r,o,i),sy("rowspan",s,o,i);for(const e of n)Jy(e,o,i);wy(o.findAncestor("table"),t),i.setSelection(o,"in")})}}function Jy(e,t,i){Qy(e)||(Qy(t)&&i.remove(i.createRangeIn(t)),i.move(i.createRangeIn(e),i.createPositionAt(t,"end"))),i.remove(e)}function Qy(e){const t=e.getChild(0);return 1==e.childCount&&t.is("element","paragraph")&&t.isEmpty}function Zy(e,t,i,n){const o=parseInt(e.getAttribute(n)||"1");return Math.max(i,t+o)}class Xy extends Xu{constructor(e){super(e),this.affectsData=!1}refresh(){const e=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(this.editor.model.document.selection);this.isEnabled=e.length>0}execute(){const e=this.editor.model,t=this.editor.plugins.get("TableUtils"),i=t.getSelectionAffectedTableCells(e.document.selection),n=t.getRowIndexes(i),o=i[0].findAncestor("table"),r=[];for(let t=n.first;t<=n.last;t++)for(const i of o.getChild(t).getChildren())r.push(e.createRangeOn(i));e.change(e=>{e.setSelection(r)})}}class eA extends Xu{constructor(e){super(e),this.affectsData=!1}refresh(){const e=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(this.editor.model.document.selection);this.isEnabled=e.length>0}execute(){const e=this.editor.plugins.get("TableUtils"),t=this.editor.model,i=e.getSelectionAffectedTableCells(t.document.selection),n=i[0],o=i.pop(),r=n.findAncestor("table"),s=e.getCellLocation(n),a=e.getCellLocation(o),l=Math.min(s.column,a.column),c=Math.max(s.column,a.column),d=[];for(const e of new oy(r,{startColumn:l,endColumn:c}))d.push(t.createRangeOn(e.cell));t.change(e=>{e.setSelection(d)})}}function tA(e){e.document.registerPostFixer(t=>function(e,t){const i=t.document.differ.getChanges();let n=!1;const o=new Set;for(const t of i){let i=null;"insert"==t.type&&"table"==t.name&&(i=t.position.nodeAfter),"insert"!=t.type&&"remove"!=t.type||"tableRow"!=t.name&&"tableCell"!=t.name||(i=t.position.findAncestor("table")),oA(t)&&(i=t.range.start.findAncestor("table")),i&&!o.has(i)&&(n=iA(i,e)||n,n=nA(i,e)||n,o.add(i))}return n}(t,e))}function iA(e,t){let i=!1;const n=function(e){const t=parseInt(e.getAttribute("headingRows")||"0"),i=Array.from(e.getChildren()).reduce((e,t)=>t.is("element","tableRow")?e+1:e,0),n=[];for(const{row:o,cell:r,cellHeight:s}of new oy(e)){if(s<2)continue;const e=o<t?t:i;if(o+s>e){const t=e-o;n.push({cell:r,rowspan:t})}}return n}(e);if(n.length){i=!0;for(const e of n)sy("rowspan",e.rowspan,e.cell,t,1)}return i}function nA(e,t){let i=!1;const n=function(e){const t=new Array(e.childCount).fill(0);for(const{rowIndex:i}of new oy(e,{includeAllSlots:!0}))t[i]++;return t}(e),o=[];for(const[t,i]of n.entries())!i&&e.getChild(t).is("element","tableRow")&&o.push(t);if(o.length){i=!0;for(const i of o.reverse())t.remove(e.getChild(i)),n.splice(i,1)}const r=n.filter((t,i)=>e.getChild(i).is("element","tableRow")),s=r[0];if(!r.every(e=>e===s)){const n=r.reduce((e,t)=>t>e?t:e,0);for(const[o,s]of r.entries()){const r=n-s;if(r){for(let i=0;i<r;i++)ay(t,t.createPositionAt(e.getChild(o),"end"));i=!0}}}return i}function oA(e){if("attribute"!==e.type)return!1;const t=e.attributeKey;return"headingRows"===t||"colspan"===t||"rowspan"===t}function rA(e){e.document.registerPostFixer(t=>function(e,t){const i=t.document.differ.getChanges();let n=!1;for(const t of i)"insert"==t.type&&"table"==t.name&&(n=sA(t.position.nodeAfter,e)||n),"insert"==t.type&&"tableRow"==t.name&&(n=aA(t.position.nodeAfter,e)||n),"insert"==t.type&&"tableCell"==t.name&&(n=lA(t.position.nodeAfter,e)||n),"remove"!=t.type&&"insert"!=t.type||!cA(t)||(n=lA(t.position.parent,e)||n);return n}(t,e))}function sA(e,t){let i=!1;for(const n of e.getChildren())n.is("element","tableRow")&&(i=aA(n,t)||i);return i}function aA(e,t){let i=!1;for(const n of e.getChildren())i=lA(n,t)||i;return i}function lA(e,t){if(0==e.childCount)return t.insertElement("paragraph",e),!0;const i=Array.from(e.getChildren()).filter(e=>e.is("$text"));for(const e of i)t.wrap(t.createRangeOn(e),"paragraph");return!!i.length}function cA(e){return!!e.position.parent.is("element","tableCell")&&("insert"==e.type&&"$text"==e.name||"remove"==e.type)}function dA(e,t){if(!e.is("element","paragraph"))return!1;const i=t.toViewElement(e);return!!i&&Iy(e)!==i.is("element","span")}var uA=i(8864),hA={attributes:{"data-cke":!0}};hA.setAttributes=Ki(),hA.insert=$i().bind(null,"head"),hA.domAPI=Hi(),hA.insertStyleElement=Yi();ji()(uA.A,hA);uA.A&&uA.A.locals&&uA.A.locals;class mA extends Qu{_additionalSlots;static get pluginName(){return"TableEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[Hy]}constructor(e){super(e),this._additionalSlots=[]}init(){const e=this.editor,t=e.model,i=t.schema,n=e.conversion,o=e.plugins.get(Hy);i.register("table",{inheritAllFrom:"$blockObject",allowAttributes:["headingRows","headingColumns"]}),i.register("tableRow",{allowIn:"table",isLimit:!0}),i.register("tableCell",{allowContentOf:"$container",allowIn:"tableRow",allowAttributes:["colspan","rowspan"],isLimit:!0,isSelectable:!0}),n.for("upcast").add(e=>{e.on("element:figure",(e,t,i)=>{if(!i.consumable.test(t.viewItem,{name:!0,classes:"table"}))return;const n=function(e){for(const t of e.getChildren())if(t.is("element","table"))return t}(t.viewItem);if(!n||!i.consumable.test(n,{name:!0}))return;i.consumable.consume(t.viewItem,{name:!0,classes:"table"});const o=i.convertItem(n,t.modelCursor),r=Jt(o.modelRange.getItems());if(!r||!r.is("element","table"))return i.consumable.revert(t.viewItem,{name:!0,classes:"table"}),void(o.modelRange&&!o.modelRange.isCollapsed&&(t.modelRange=o.modelRange,t.modelCursor=o.modelCursor));i.convertChildren(t.viewItem,i.writer.createPositionAt(r,"end")),i.updateConversionResult(r,t)})}),n.for("upcast").add(yy()),n.for("editingDowncast").elementToStructure({model:{name:"table",attributes:["headingRows"]},view:Cy(o,{asWidget:!0,additionalSlots:this._additionalSlots})}),n.for("dataDowncast").elementToStructure({model:{name:"table",attributes:["headingRows"]},view:Cy(o,{additionalSlots:this._additionalSlots})}),n.for("upcast").elementToElement({model:"tableRow",view:"tr"}),n.for("upcast").add(e=>{e.on("element:tr",(e,t)=>{t.viewItem.isEmpty&&0==t.modelCursor.index&&e.stop()},{priority:"high"})}),n.for("downcast").elementToElement({model:"tableRow",view:(e,{writer:t})=>e.isEmpty?t.createEmptyElement("tr"):t.createContainerElement("tr")}),n.for("upcast").elementToElement({model:"tableCell",view:"td"}),n.for("upcast").elementToElement({model:"tableCell",view:"th"}),n.for("upcast").add(Ay("td")),n.for("upcast").add(Ay("th")),n.for("editingDowncast").elementToElement({model:"tableCell",view:Ty({asWidget:!0,cellTypeEnabled:()=>dy(this.editor)})}),n.for("dataDowncast").elementToElement({model:"tableCell",view:Ty({cellTypeEnabled:()=>dy(this.editor)})}),n.for("editingDowncast").elementToElement({model:"paragraph",view:Ey({asWidget:!0}),converterPriority:"high"}),n.for("dataDowncast").elementToElement({model:"paragraph",view:Ey(),converterPriority:"high"}),n.for("downcast").attributeToAttribute({model:"colspan",view:"colspan"}),n.for("upcast").attributeToAttribute({model:{key:"colspan",value:gA("colspan")},view:"colspan"}),n.for("downcast").attributeToAttribute({model:"rowspan",view:"rowspan"}),n.for("upcast").attributeToAttribute({model:{key:"rowspan",value:gA("rowspan")},view:"rowspan"}),this._addPlainTableOutputConverters(),e.config.define("table.defaultHeadings.rows",0),e.config.define("table.defaultHeadings.columns",0),e.config.define("table.showHiddenBorders",!0),e.config.get("table.showHiddenBorders")&&e.editing.view.change(t=>{for(const i of e.editing.view.document.roots)t.addClass("ck-table-show-hidden-borders",i)}),e.commands.add("insertTable",new My(e)),e.commands.add("insertTableRowAbove",new Oy(e,{order:"above"})),e.commands.add("insertTableRowBelow",new Oy(e,{order:"below"})),e.commands.add("insertTableColumnLeft",new Ry(e,{order:"left"})),e.commands.add("insertTableColumnRight",new Ry(e,{order:"right"})),e.commands.add("removeTableRow",new Dy(e)),e.commands.add("removeTableColumn",new By(e)),e.commands.add("splitTableCellVertically",new Ny(e,{direction:"vertically"})),e.commands.add("splitTableCellHorizontally",new Ny(e,{direction:"horizontally"})),e.commands.add("mergeTableCells",new Yy(e)),e.commands.add("mergeTableCellRight",new Vy(e,{direction:"right"})),e.commands.add("mergeTableCellLeft",new Vy(e,{direction:"left"})),e.commands.add("mergeTableCellDown",new Vy(e,{direction:"down"})),e.commands.add("mergeTableCellUp",new Vy(e,{direction:"up"})),e.commands.add("setTableColumnHeader",new Fy(e)),e.commands.add("setTableRowHeader",new zy(e)),e.commands.add("selectTableRow",new Xy(e)),e.commands.add("selectTableColumn",new eA(e)),tA(t),rA(t),this.listenTo(t.document,"change:data",()=>{dy(e)||function(e,t){const i=e.document.differ;for(const e of i.getChanges()){let i,n=!1;if("attribute"==e.type){const t=e.range.start.nodeAfter;if(!t||!t.is("element","table"))continue;if("headingRows"!=e.attributeKey&&"headingColumns"!=e.attributeKey)continue;i=t,n="headingRows"==e.attributeKey}else"tableRow"!=e.name&&"tableCell"!=e.name||(i=e.position.findAncestor("table"),n="tableRow"==e.name);if(!i)continue;const o=i.getAttribute("headingRows")||0,r=i.getAttribute("headingColumns")||0,s=new oy(i);for(const e of s){const i=e.row<o||e.column<r?"th":"td",s=t.mapper.toViewElement(e.cell);s&&s.is("element")&&s.name!=i&&t.reconvertItem(n?e.cell.parent:e.cell)}}}(t,e.editing),function(e,t){const i=e.document.differ,n=new Set;for(const e of i.getChanges()){const t="attribute"==e.type?e.range.start.parent:e.position.parent;t.is("element","tableCell")&&n.add(t)}for(const e of n.values()){const i=Array.from(e.getChildren()).filter(e=>dA(e,t.mapper));for(const e of i)t.reconvertItem(e)}}(t,e.editing)})}registerAdditionalSlot(e){this._additionalSlots.push(e)}_addPlainTableOutputConverters(){const e=this.editor;e.conversion.for("dataDowncast").elementToStructure({model:"table",view:Sy(e),converterPriority:"high"}),e.plugins.has("TableCaptionEditing")&&e.conversion.for("dataDowncast").elementToElement({model:"caption",view:Py(e),converterPriority:"high"}),e.plugins.has("TablePropertiesEditing")&&function(e){const t={"border-width":"tableBorderWidth","border-color":"tableBorderColor","border-style":"tableBorderStyle","background-color":"tableBackgroundColor"};for(const[i,n]of Object.entries(t))e.conversion.for("dataDowncast").add(t=>t.on(`attribute:${n}:table`,(t,n,o)=>{const{item:r,attributeNewValue:s}=n,{mapper:a,writer:l}=o,c=e.plugins.has("PlainTableOutput"),d=o.options.isClipboardPipeline,u=e.config.get("experimentalFlags.useExtendedTableBlockAlignment");if(!(c||u&&d))return;if(!o.consumable.consume(r,t.name))return;const h=a.toViewElement(r);s?l.setStyle(i,s,h):l.removeStyle(i,h)},{priority:"high"}))}(e)}}function gA(e){return t=>{const i=parseInt(t.getAttribute(e));return Number.isNaN(i)||i<=0?null:i}}const fA='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M3 5.5v3h4v-3zm0 4v3h4v-3zm0 4v3h4v-3zm5 3h4v-3H8zm5 0h4v-3h-4zm4-4v-3h-4v3zm0-4v-3h-4v3zm1.5 8A1.5 1.5 0 0 1 17 18H3a1.5 1.5 0 0 1-1.5-1.5V3c.222-.863 1.068-1.5 2-1.5h13c.932 0 1.778.637 2 1.5zm-6.5-4v-3H8v3zm0-4v-3H8v3z"/></svg>';var pA=i(8603),bA={attributes:{"data-cke":!0}};bA.setAttributes=Ki(),bA.insert=$i().bind(null,"head"),bA.domAPI=Hi(),bA.insertStyleElement=Yi();ji()(pA.A,bA);pA.A&&pA.A.locals&&pA.A.locals;class kA extends Zi{items;keystrokes;focusTracker;constructor(e){super(e);const t=this.bindTemplate;this.items=this._createGridCollection(),this.keystrokes=new ti,this.focusTracker=new Qt,this.set("rows",0),this.set("columns",0),this.bind("label").to(this,"columns",this,"rows",(e,t)=>`${t} × ${e}`),this.setTemplate({tag:"div",attributes:{class:["ck"]},children:[{tag:"div",attributes:{class:["ck-insert-table-dropdown__grid"]},on:{"mouseover@.ck-insert-table-dropdown-grid-box":t.to("boxover")},children:this.items},{tag:"div",attributes:{class:["ck","ck-insert-table-dropdown__label"],"aria-hidden":!0},children:[{text:t.to("label")}]}],on:{mousedown:t.to(e=>{e.preventDefault()}),click:t.to(()=>{this.fire("execute")})}}),this.on("boxover",(e,t)=>{const{row:i,column:n}=t.target.dataset;this.items.get(10*(parseInt(i,10)-1)+(parseInt(n,10)-1)).focus()}),this.focusTracker.on("change:focusedElement",(e,t,i)=>{if(!i)return;const{row:n,column:o}=i.dataset;this.set({rows:parseInt(n),columns:parseInt(o)})}),this.on("change:columns",()=>this._highlightGridBoxes()),this.on("change:rows",()=>this._highlightGridBoxes())}render(){super.render(),Uw({keystrokeHandler:this.keystrokes,focusTracker:this.focusTracker,gridItems:this.items,numberOfColumns:10,uiLanguageDirection:this.locale&&this.locale.uiLanguageDirection});for(const e of this.items)this.focusTracker.add(e.element);this.keystrokes.listenTo(this.element)}reset(){this.set({rows:1,columns:1})}focus(){this.items.get(0).focus()}focusLast(){this.items.get(0).focus()}_highlightGridBoxes(){const e=this.rows,t=this.columns;this.items.map((i,n)=>{const o=Math.floor(n/10)<e&&n%10<t;i.set("isOn",o)})}_createGridButton(e,t,i,n){const o=new lo(e);return o.set({label:n,class:"ck-insert-table-dropdown-grid-box"}),o.extendTemplate({attributes:{"data-row":t,"data-column":i}}),o}_createGridCollection(){const e=[];for(let t=0;t<100;t++){const i=Math.floor(t/10),n=t%10,o=`${i+1} × ${n+1}`;e.push(this._createGridButton(this.locale,i+1,n+1,o))}return this.createCollection(e)}}class wA extends Qu{static get pluginName(){return"TableUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=this.editor.t,i="ltr"===e.locale.contentLanguageDirection;e.ui.componentFactory.add("insertTable",i=>{const n=e.commands.get("insertTable"),o=su(i);let r;return o.bind("isEnabled").to(n),o.buttonView.set({icon:fA,label:t("Insert table"),tooltip:!0}),o.on("change:isOpen",()=>{r||(r=new kA(i),o.panelView.children.add(r),r.delegate("execute").to(o),o.on("execute",()=>{e.execute("insertTable",{rows:r.rows,columns:r.columns}),e.editing.view.focus()}))}),o}),e.ui.componentFactory.add("menuBar:insertTable",i=>{const n=e.commands.get("insertTable"),o=new Mu(i),r=new kA(i);return r.delegate("execute").to(o),o.on("change:isOpen",(e,t,i)=>{i||r.reset()}),r.on("execute",()=>{e.execute("insertTable",{rows:r.rows,columns:r.columns}),e.editing.view.focus()}),o.buttonView.set({label:t("Table"),icon:fA}),o.panelView.children.add(r),o.bind("isEnabled").to(n),o}),e.ui.componentFactory.add("tableColumn",e=>{const n=[{type:"switchbutton",model:{commandName:"setTableColumnHeader",label:t("Header column"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:i?"insertTableColumnLeft":"insertTableColumnRight",label:t("Insert column left")}},{type:"button",model:{commandName:i?"insertTableColumnRight":"insertTableColumnLeft",label:t("Insert column right")}},{type:"button",model:{commandName:"removeTableColumn",label:t("Delete column")}},{type:"button",model:{commandName:"selectTableColumn",label:t("Select column")}}];return this._prepareDropdown(t("Column"),'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1M2 2v16h16V2z" opacity=".6"/><path d="M18 7v1H2V7zm0 5v1H2v-1z" opacity=".6"/><path d="M14 1v18a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V1a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1m-2 1H8v4h4zm0 6H8v4h4zm0 6H8v4h4z"/></svg>',n,e)}),e.ui.componentFactory.add("tableRow",e=>{const i=[{type:"switchbutton",model:{commandName:"setTableRowHeader",label:t("Header row"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:"insertTableRowAbove",label:t("Insert row above")}},{type:"button",model:{commandName:"insertTableRowBelow",label:t("Insert row below")}},{type:"button",model:{commandName:"removeTableRow",label:t("Delete row")}},{type:"button",model:{commandName:"selectTableRow",label:t("Select row")}}];return this._prepareDropdown(t("Row"),'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1M2 2v16h16V2z" opacity=".6"/><path d="M7 2h1v16H7zm5 0h1v16h-1z" opacity=".6"/><path d="M1 6h18a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1m1 2v4h4V8zm6 0v4h4V8zm6 0v4h4V8z"/></svg>',i,e)}),e.ui.componentFactory.add("mergeTableCells",e=>{const n=[{type:"button",model:{commandName:"mergeTableCellUp",label:t("Merge cell up")}},{type:"button",model:{commandName:i?"mergeTableCellRight":"mergeTableCellLeft",label:t("Merge cell right")}},{type:"button",model:{commandName:"mergeTableCellDown",label:t("Merge cell down")}},{type:"button",model:{commandName:i?"mergeTableCellLeft":"mergeTableCellRight",label:t("Merge cell left")}},{type:"separator"},{type:"button",model:{commandName:"splitTableCellVertically",label:t("Split cell vertically")}},{type:"button",model:{commandName:"splitTableCellHorizontally",label:t("Split cell horizontally")}}];return this._prepareMergeSplitButtonDropdown(t("Merge cells"),'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1M2 2v16h16V2z" opacity=".6"/><path d="M7 2h1v16H7zm5 0h1v7h-1zm6 5v1H2V7zM8 12v1H2v-1z" opacity=".6"/><path d="M7 7h12a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1m1 2v9h10V9z"/></svg>',n,e)})}_prepareDropdown(e,t,i,n){const o=this.editor,r=su(n),s=this._fillDropdownWithListOptions(r,i);return r.buttonView.set({label:e,icon:t,tooltip:!0}),r.bind("isEnabled").toMany(s,"isEnabled",(...e)=>e.some(e=>e)),this.listenTo(r,"execute",e=>{o.execute(e.source.commandName),e.source instanceof Jd||o.editing.view.focus()}),r}_prepareMergeSplitButtonDropdown(e,t,i,n){const o=this.editor,r=su(n,Kd),s="mergeTableCells",a=o.commands.get(s),l=this._fillDropdownWithListOptions(r,i);return r.buttonView.set({label:e,icon:t,tooltip:!0,isEnabled:!0}),r.bind("isEnabled").toMany([a,...l],"isEnabled",(...e)=>e.some(e=>e)),this.listenTo(r.buttonView,"execute",()=>{o.execute(s),o.editing.view.focus()}),this.listenTo(r,"execute",e=>{o.execute(e.source.commandName),o.editing.view.focus()}),r}_fillDropdownWithListOptions(e,t){const i=this.editor,n=[],o=new Yt;for(const e of t)_A(e,i,n,o);return cu(e,o),n}}function _A(e,t,i,n){if("button"===e.type||"switchbutton"===e.type){const n=e.model=new _p(e.model),{commandName:o,bindIsOn:r}=e.model,s=t.commands.get(o);i.push(s),n.set({commandName:o}),n.bind("isEnabled").to(s),r&&n.bind("isOn").to(s,"value"),n.set({withText:!0})}n.add(e)}var vA=i(2850),yA={attributes:{"data-cke":!0}};yA.setAttributes=Ki(),yA.insert=$i().bind(null,"head"),yA.domAPI=Hi(),yA.insertStyleElement=Yi();ji()(vA.A,yA);vA.A&&vA.A.locals&&vA.A.locals;class AA extends Qu{static get pluginName(){return"TableSelection"}static get isOfficialPlugin(){return!0}static get requires(){return[Hy,Hy]}init(){const e=this.editor,t=e.model,i=e.editing.view;this.listenTo(t,"deleteContent",(e,t)=>this._handleDeleteContent(e,t),{priority:"high"}),this.listenTo(i.document,"insertText",(e,t)=>this._handleInsertTextEvent(e,t),{priority:"high"}),this._defineSelectionConverter(),this._enablePluginDisabling()}getSelectedTableCells(){const e=this.editor.plugins.get(Hy),t=this.editor.model.document.selection,i=e.getSelectedTableCells(t);return 0==i.length?null:i}getSelectionAsFragment(){const e=this.editor.plugins.get(Hy),t=this.getSelectedTableCells();return t?this.editor.model.change(i=>{const n=i.createDocumentFragment(),{first:o,last:r}=e.getColumnIndexes(t),{first:s,last:a}=e.getRowIndexes(t),l=t[0].findAncestor("table");let c=a,d=r;if(e.isSelectionRectangular(t)){const e={firstColumn:o,lastColumn:r,firstRow:s,lastRow:a};c=_y(l,e),d=vy(l,e)}const u=uy(l,{startRow:s,startColumn:o,endRow:c,endColumn:d},i);return i.insert(u,n,0),n}):null}setCellSelection(e,t){const i=this._getCellsToSelect(e,t);this.editor.model.change(e=>{e.setSelection(i.cells.map(t=>e.createRangeOn(t)),{backward:i.backward})})}getFocusCell(){const e=[...this.editor.model.document.selection.getRanges()].pop().getContainedElement();return e&&e.is("element","tableCell")?e:null}getAnchorCell(){const e=Jt(this.editor.model.document.selection.getRanges()).getContainedElement();return e&&e.is("element","tableCell")?e:null}_defineSelectionConverter(){const e=this.editor,t=new Set;e.conversion.for("editingDowncast").add(e=>e.on("selection",(e,i,n)=>{const o=n.writer;!function(e){for(const i of t)e.removeClass("ck-editor__editable_selected",i);t.clear()}(o);const r=this.getSelectedTableCells();if(!r)return;for(const e of r){const i=n.mapper.toViewElement(e);o.addClass("ck-editor__editable_selected",i),t.add(i)}const s=n.mapper.toViewElement(r[r.length-1]);o.setSelection(s,0)},{priority:"lowest"}))}_enablePluginDisabling(){const e=this.editor;this.on("change:isEnabled",()=>{if(!this.isEnabled){const t=this.getSelectedTableCells();if(!t)return;e.model.change(i=>{const n=i.createPositionAt(t[0],0),o=e.model.schema.getNearestSelectionRange(n);i.setSelection(o)})}})}_handleDeleteContent(e,t){const i=this.editor.plugins.get(Hy),n=t[0],o=t[1],r=this.editor.model,s=!o||"backward"==o.direction,a=i.getSelectedTableCells(n);a.length&&(e.stop(),r.change(e=>{const t=a[s?a.length-1:0];r.change(e=>{for(const t of a)r.deleteContent(e.createSelection(t,"in"))});const i=r.schema.getNearestSelectionRange(e.createPositionAt(t,0));n.is("documentSelection")?e.setSelection(i):n.setTo(i)}))}_handleInsertTextEvent(e,t){const i=this.editor,n=this.getSelectedTableCells();if(!n)return;const o=i.editing.view,r=i.editing.mapper,s=n.map(e=>o.createRangeOn(r.toViewElement(e)));t.selection=o.createSelection(s),t.preventDefault()}_getCellsToSelect(e,t){const i=this.editor.plugins.get("TableUtils"),n=i.getCellLocation(e),o=i.getCellLocation(t),r=Math.min(n.row,o.row),s=Math.max(n.row,o.row),a=Math.min(n.column,o.column),l=parseInt(t.getAttribute("colspan")||"1")-1,c=Math.max(n.column,o.column+l),d=new Array(s-r+1).fill(null).map(()=>[]),u={startRow:r,endRow:s,startColumn:a,endColumn:c};for(const{row:t,cell:i}of new oy(e.findAncestor("table"),u))d[t-r].push(i);const h=o.row<n.row,m=o.column<n.column;return h&&d.reverse(),m&&d.forEach(e=>e.reverse()),{cells:d.flat(),backward:h||m}}}class xA extends Qu{static get pluginName(){return"TableClipboard"}static get isOfficialPlugin(){return!0}static get requires(){return[Kh,Gh,AA,Hy]}init(){const e=this.editor.editing.view.document;this.listenTo(e,"copy",(e,t)=>this._onCopyCut(e,t)),this.listenTo(e,"cut",(e,t)=>this._onCopyCut(e,t)),this._listenToContentInsertion(),this.decorate("_replaceTableSlotCell")}_listenToContentInsertion(){const{editor:e}=this,t=e.plugins.get(Gh),i=e.plugins.get(AA);let n=!1;t.on("contentInsertion",(e,t)=>{n="paste"===t.method}),this.listenTo(e.model,"insertContent",(e,[t,o])=>{(n||null!==i.getSelectedTableCells())&&this._onInsertContent(e,t,o)},{priority:"high"}),t.on("contentInsertion",()=>{n=!1},{priority:"lowest"})}_onCopyCut(e,t){const i=this.editor.editing.view,n=this.editor.plugins.get(AA),o=this.editor.plugins.get(Kh);n.getSelectedTableCells()&&("cut"!=e.name||this.editor.model.canEditAt(this.editor.model.document.selection))&&(t.preventDefault(),e.stop(),this.editor.model.enqueueChange({isUndoable:"cut"===e.name},()=>{const r=o._copySelectedFragmentWithMarkers(e.name,this.editor.model.document.selection,()=>n.getSelectionAsFragment());i.document.fire("clipboardOutput",{dataTransfer:t.dataTransfer,content:this.editor.data.toView(r),method:e.name})}))}_onInsertContent(e,t,i){if(i&&!i.is("documentSelection"))return;const n=this.editor.model,o=this.editor.plugins.get(Hy),r=this.editor.plugins.get(Kh),s=this.getTableIfOnlyTableInContent(t,n);if(!s)return;const a=o.getSelectionAffectedTableCells(n.document.selection);a.length?(e.stop(),t.is("documentFragment")?r._pasteMarkersIntoTransformedElement(t.markers,e=>this._replaceSelectedCells(s,a,e)):this.editor.model.change(e=>{this._replaceSelectedCells(s,a,e)})):wy(s,o)}_replaceSelectedCells(e,t,i){const n=this.editor.plugins.get(Hy),o={width:n.getColumns(e),height:n.getRows(e)},r=function(e,t,i,n){const o=e[0].findAncestor("table"),r=n.getColumnIndexes(e),s=n.getRowIndexes(e),a={firstColumn:r.first,lastColumn:r.last,firstRow:s.first,lastRow:s.last},l=1===e.length;l&&(a.lastRow+=t.height-1,a.lastColumn+=t.width-1,function(e,t,i,n){const o=n.getColumns(e),r=n.getRows(e);i>o&&n.insertColumns(e,{at:o,columns:i-o});t>r&&n.insertRows(e,{at:r,rows:t-r})}(o,a.lastRow+1,a.lastColumn+1,n));l||!n.isSelectionRectangular(e)?function(e,t,i){const{firstRow:n,lastRow:o,firstColumn:r,lastColumn:s}=t,a={first:n,last:o},l={first:r,last:s};TA(e,r,a,i),TA(e,s+1,a,i),CA(e,n,l,i),CA(e,o+1,l,i,n)}(o,a,i):(a.lastRow=_y(o,a),a.lastColumn=vy(o,a));return a}(t,o,i,n),s=r.lastRow-r.firstRow+1,a=r.lastColumn-r.firstColumn+1;e=uy(e,{startRow:0,startColumn:0,endRow:Math.min(s,o.height)-1,endColumn:Math.min(a,o.width)-1},i);const l=t[0].findAncestor("table"),c=this._replaceSelectedCellsWithPasted(e,o,l,r,i);if(this.editor.plugins.get("TableSelection").isEnabled){const e=n.sortRanges(c.map(e=>i.createRangeOn(e)));i.setSelection(e)}else i.setSelection(c[0],0);return l}_replaceSelectedCellsWithPasted(e,t,i,n,o){const{width:r,height:s}=t,a=function(e,t,i){const n=new Array(i).fill(null).map(()=>new Array(t).fill(null));for(const{column:t,row:i,cell:o}of new oy(e))n[i][t]=o;return n}(e,r,s),l=[...new oy(i,{startRow:n.firstRow,endRow:n.lastRow,startColumn:n.firstColumn,endColumn:n.lastColumn,includeAllSlots:!0})],c=[];let d;for(const e of l){const{row:t,column:i}=e;i===n.firstColumn&&(d=e.getPositionBefore());const l=t-n.firstRow,u=i-n.firstColumn,h=a[l%s][u%r],m=h?o.cloneElement(h):null,g=this._replaceTableSlotCell(e,m,d,o);g&&(py(g,t,i,n.lastRow,n.lastColumn,o),c.push(g),d=o.createPositionAfter(g))}const u=parseInt(i.getAttribute("headingRows")||"0"),h=parseInt(i.getAttribute("headingColumns")||"0"),m=n.firstRow<u&&u<=n.lastRow,g=n.firstColumn<h&&h<=n.lastColumn;if(m){const e=CA(i,u,{first:n.firstColumn,last:n.lastColumn},o,n.firstRow);c.push(...e)}if(g){const e=TA(i,h,{first:n.firstRow,last:n.lastRow},o);c.push(...e)}return c}_replaceTableSlotCell(e,t,i,n){const{cell:o,isAnchor:r}=e;return r&&n.remove(o),t?(n.insert(t,i),t):null}getTableIfOnlyTableInContent(e,t){if(!e.is("documentFragment")&&!e.is("element"))return null;if(e.is("element","table"))return e;if(1==e.childCount&&e.getChild(0).is("element","table"))return e.getChild(0);const i=t.createRangeIn(e);for(const e of i.getItems())if(e.is("element","table")){const n=t.createRange(i.start,t.createPositionBefore(e));if(t.hasContent(n,{ignoreWhitespaces:!0}))return null;const o=t.createRange(t.createPositionAfter(e),i.end);return t.hasContent(o,{ignoreWhitespaces:!0})?null:e}return null}}function CA(e,t,i,n,o=0){if(t<1)return;return hy(e,t,o).filter(({column:e,cellWidth:t})=>EA(e,t,i)).map(({cell:e})=>my(e,t,n))}function TA(e,t,i,n){if(t<1)return;return gy(e,t).filter(({row:e,cellHeight:t})=>EA(e,t,i)).map(({cell:e,column:i})=>fy(e,i,t,n))}function EA(e,t,i){const n=e+t-1,{first:o,last:r}=i;return e>=o&&e<=r||e<o&&n>=o}class IA extends Qu{static get pluginName(){return"TableKeyboard"}static get isOfficialPlugin(){return!0}static get requires(){return[AA,Hy]}init(){const e=this.editor,t=e.editing.view.document,i=e.t;this.listenTo(t,"arrowKey",(...e)=>this._onArrowKey(...e),{context:"table"}),this.listenTo(t,"tab",(...e)=>this._handleTabOnSelectedTable(...e),{context:"figure"}),this.listenTo(t,"tab",(...e)=>this._handleTab(...e),{context:["th","td"]}),e.accessibility.addKeystrokeInfoGroup({id:"table",label:i("Keystrokes that can be used in a table cell"),keystrokes:[{label:i("Move the selection to the next cell"),keystroke:"Tab"},{label:i("Move the selection to the previous cell"),keystroke:"Shift+Tab"},{label:i("Insert a new table row (when in the last cell of a table)"),keystroke:"Tab"},{label:i("Navigate through the table"),keystroke:[["arrowup"],["arrowright"],["arrowdown"],["arrowleft"]]}]})}_handleTabOnSelectedTable(e,t){const i=this.editor.model.document.selection.getSelectedElement();i&&i.is("element","table")&&t.stopPropagation()}_handleTab(e,t){const i=this.editor,n=this.editor.plugins.get(Hy),o=this.editor.plugins.get("TableSelection"),r=i.model.document.selection,s=!t.shiftKey;let a=n.getTableCellsContainingSelection(r)[0];if(a||(a=o.getFocusCell()),!a)return;t.stopPropagation();const l=a.parent,c=l.parent,d=c.getChildIndex(l),u=l.getChildIndex(a)===l.childCount-1,h=d===n.getRows(c)-1;s&&h&&u&&i.execute("insertTableRowBelow")}_onArrowKey(e,t){const i=this.editor,n=Vt(t.keyCode,i.locale.contentLanguageDirection);this._handleArrowKeys(n,t.shiftKey)&&(t.preventDefault(),t.stopPropagation(),e.stop())}_handleArrowKeys(e,t){const i=this.editor.plugins.get(Hy),n=this.editor.plugins.get("TableSelection"),o=this.editor.model,r=o.document.selection,s=["right","down"].includes(e),a=i.getSelectedTableCells(r);if(a.length){let i;return i=t?n.getFocusCell():s?a[a.length-1]:a[0],this._navigateFromCellInDirection(i,e,t),!0}const l=r.focus.findAncestor("tableCell");if(!l)return!1;if(!r.isCollapsed)if(t){if(r.isBackward==s&&!r.containsEntireContent(l))return!1}else{const e=r.getSelectedElement();if(!e||!o.schema.isObject(e))return!1}return!!this._isSelectionAtCellEdge(r,l,s)&&(this._navigateFromCellInDirection(l,e,t),!0)}_isSelectionAtCellEdge(e,t,i){const n=this.editor.model,o=this.editor.model.schema,r=i?e.getLastPosition():e.getFirstPosition();if(!o.getLimitElement(r).is("element","tableCell")){return n.createPositionAt(t,i?"end":0).isTouching(r)}const s=n.createSelection(r);return n.modifySelection(s,{direction:i?"forward":"backward"}),r.isEqual(s.focus)}_navigateFromCellInDirection(e,t,i=!1){const n=this.editor.model,o=e.findAncestor("table"),r=[...new oy(o,{includeAllSlots:!0})],{row:s,column:a}=r[r.length-1],l=r.find(({cell:t})=>t==e);let{row:c,column:d}=l;switch(t){case"left":d--;break;case"up":c--;break;case"right":d+=l.cellWidth;break;case"down":c+=l.cellHeight}if(c<0||c>s||d<0&&c<=0||d>a&&c>=s)return void n.change(e=>{e.setSelection(e.createRangeOn(o))});d<0?(d=i?0:a,c--):d>a&&(d=i?a:0,c++);const u=r.find(e=>e.row==c&&e.column==d).cell,h=["right","down"].includes(t),m=this.editor.plugins.get("TableSelection");if(i&&m.isEnabled){const t=m.getAnchorCell()||e;m.setCellSelection(t,u)}else{const e=n.createPositionAt(u,h?0:"end");n.change(t=>{t.setSelection(e)})}}}class SA extends Ws{domEventType=["mousemove","mouseleave"];onDomEvent(e){this.fire(e.type,e)}}class PA extends Qu{static get pluginName(){return"TableMouse"}static get isOfficialPlugin(){return!0}static get requires(){return[AA,Hy]}init(){this.editor.editing.view.addObserver(SA),this._enableShiftClickSelection(),this._enableMouseDragSelection()}_enableShiftClickSelection(){const e=this.editor,t=e.plugins.get(Hy);let i=!1;const n=e.plugins.get(AA);this.listenTo(e.editing.view.document,"mousedown",(o,r)=>{const s=e.model.document.selection;if(!this.isEnabled||!n.isEnabled)return;if(!r.domEvent.shiftKey)return;const a=n.getAnchorCell()||t.getTableCellsContainingSelection(s)[0];if(!a)return;const l=this._getModelTableCellFromDomEvent(r);l&&MA(a,l)&&(i=!0,n.setCellSelection(a,l),r.preventDefault())}),this.listenTo(e.editing.view.document,"mouseup",()=>{i=!1}),this.listenTo(e.editing.view.document,"selectionChange",e=>{i&&e.stop()},{priority:"highest"})}_enableMouseDragSelection(){const e=this.editor;let t,i,n=!1,o=!1;const r=e.plugins.get(AA);this.listenTo(e.editing.view.document,"mousedown",(e,i)=>{this.isEnabled&&r.isEnabled&&(i.domEvent.shiftKey||i.domEvent.ctrlKey||i.domEvent.altKey||(t=this._getModelTableCellFromDomEvent(i)))}),this.listenTo(e.editing.view.document,"mousemove",(e,s)=>{if(!s.domEvent.buttons)return;if(!t)return;const a=this._getModelTableCellFromDomEvent(s);a&&MA(t,a)&&(i=a,n||i==t||(n=!0)),n&&(o=!0,r.setCellSelection(t,i),s.preventDefault())}),this.listenTo(e.editing.view.document,"mouseup",()=>{n=!1,o=!1,t=null,i=null}),this.listenTo(e.editing.view.document,"selectionChange",e=>{o&&e.stop()},{priority:"highest"})}_getModelTableCellFromDomEvent(e){const t=e.target,i=this.editor.editing.view.createPositionAt(t,0);return this.editor.editing.mapper.toModelPosition(i).parent.findAncestor("tableCell",{includeSelf:!0})}}function MA(e,t){return e.parent.parent==t.parent.parent}var OA=i(9969),RA={attributes:{"data-cke":!0}};RA.setAttributes=Ki(),RA.insert=$i().bind(null,"head"),RA.domAPI=Hi(),RA.insertStyleElement=Yi();ji()(OA.A,RA);OA.A&&OA.A.locals&&OA.A.locals;function NA(e){const t=e.getSelectedElement();return t&&LA(t)?t:null}function VA(e){const t=e.getFirstPosition();if(!t)return null;let i=t.parent;for(;i;){if(i.is("element")&&LA(i))return i;i=i.parent}return null}function LA(e){return e.is("element")&&!!e.getCustomProperty("table")&&Gm(e)}var DA=i(9227),BA={attributes:{"data-cke":!0}};BA.setAttributes=Ki(),BA.insert=$i().bind(null,"head"),BA.domAPI=Hi(),BA.insertStyleElement=Yi();ji()(DA.A,BA);DA.A&&DA.A.locals&&DA.A.locals;const zA="SourceEditingMode";function FA(e){return function(e){return e.startsWith("<")}(e)?si(e):e}const jA={autoRefresh:!0},UA=36e5;class HA extends(K()){_refresh;_options;_tokenRefreshTimeout;_isDestroyed=!1;constructor(e,t={}){if(super(),!e)throw new A("token-missing-token-url",this);t.initValue&&this._validateTokenValue(t.initValue),this.set("value",t.initValue),this._refresh="function"==typeof e?e:()=>{return t=e,new Promise((e,i)=>{const n=new XMLHttpRequest;n.open("GET",t),n.addEventListener("load",()=>{const t=n.status,o=n.response;return t<200||t>299?i(new A("token-cannot-download-new-token",null)):e(o)}),n.addEventListener("error",()=>i(new Error("Network Error"))),n.addEventListener("abort",()=>i(new Error("Abort"))),n.send()});var t},this._options={...jA,...t}}init(){return new Promise((e,t)=>{this.value?(this._options.autoRefresh&&this._registerRefreshTokenTimeout(),e(this)):this.refreshToken().then(e).catch(t)})}refreshToken(){const e=this._options.autoRefresh;return this._refresh().then(t=>(this._validateTokenValue(t),this.set("value",t),e&&this._registerRefreshTokenTimeout(),this)).catch(t=>{throw x("token-refresh-failed",{autoRefresh:e}),e&&this._registerRefreshTokenTimeout(5e3),t})}destroy(){this._isDestroyed=!0,clearTimeout(this._tokenRefreshTimeout)}_validateTokenValue(e){const t="string"==typeof e,i=!/^".*"$/.test(e),n=t&&3===e.split(".").length;if(!i||!n)throw new A("token-not-in-jwt-format",this)}_registerRefreshTokenTimeout(e){if(clearTimeout(this._tokenRefreshTimeout),this._isDestroyed)return;const t=e||this._getTokenRefreshTimeoutTime();this._tokenRefreshTimeout=setTimeout(()=>{this.refreshToken()},t)}_getTokenRefreshTimeoutTime(){try{const[,e]=this.value.split("."),{exp:t}=JSON.parse(atob(e));if(!t)return UA;t>2147483647&&console.warn("Token expiration time exceeds 32-bit integer range. This might cause unpredictable token refresh timing. Token expiration time should always be provided in seconds.",{tokenExpireTime:t});return Math.floor((1e3*t-Date.now())/2)}catch{return UA}}static create(e,t={}){return new HA(e,t).init()}}const WA=/^data:(\S*?);base64,/;class $A extends(O()){file;xhr;_token;_apiAddress;constructor(e,t,i){if(super(),!e)throw new A("fileuploader-missing-file",null);if(!t)throw new A("fileuploader-missing-token",null);if(!i)throw new A("fileuploader-missing-api-address",null);this.file=function(e){if("string"!=typeof e)return!1;return!!e.match(WA)?.length}(e)?function(e,t=512){try{const i=e.match(WA)[1],n=atob(e.replace(WA,"")),o=[];for(let e=0;e<n.length;e+=t){const i=n.slice(e,e+t),r=new Array(i.length);for(let e=0;e<i.length;e++)r[e]=i.charCodeAt(e);o.push(new Uint8Array(r))}return new Blob(o,{type:i})}catch{throw new A("fileuploader-decoding-image-data-error",null)}}(e):e,this._token=t,this._apiAddress=i}onProgress(e){return this.on("progress",(t,i)=>e(i)),this}onError(e){return this.once("error",(t,i)=>e(i)),this}abort(){this.xhr.abort()}send(){return this._prepareRequest(),this._attachXHRListeners(),this._sendRequest()}_prepareRequest(){const e=new XMLHttpRequest;e.open("POST",this._apiAddress),e.setRequestHeader("Authorization",this._token.value),e.responseType="json",this.xhr=e}_attachXHRListeners(){const e=this.xhr,t=e=>()=>this.fire("error",e);e.addEventListener("error",t("Network Error")),e.addEventListener("abort",t("Abort")),e.upload&&e.upload.addEventListener("progress",e=>{e.lengthComputable&&this.fire("progress",{total:e.total,uploaded:e.loaded})}),e.addEventListener("load",()=>{const t=e.status,i=e.response;if(t<200||t>299)return this.fire("error",i.message||i.error)})}_sendRequest(){const e=new FormData,t=this.xhr;return e.append("file",this.file),new Promise((i,n)=>{t.addEventListener("load",()=>{const e=t.status,o=t.response;return e<200||e>299?o.message?n(new A("fileuploader-uploading-data-failed",this,{message:o.message})):n(o.error):i(o)}),t.addEventListener("error",()=>n(new Error("Network Error"))),t.addEventListener("abort",()=>n(new Error("Abort"))),t.send(e)})}}class qA{_token;_apiAddress;constructor(e,t){if(!e)throw new A("uploadgateway-missing-token",null);if(!t)throw new A("uploadgateway-missing-api-address",null);this._token=e,this._apiAddress=t}upload(e){return new $A(e,this._token,this._apiAddress)}}class KA extends rh{static get pluginName(){return"CloudServicesCore"}static get isOfficialPlugin(){return!0}createToken(e,t){return new HA(e,t)}createUploadGateway(e,t){return new qA(e,t)}}class GA extends Xu{_defaultStyles;_styles;constructor(e,t){super(e),this._defaultStyles={imageBlock:!1,imageInline:!1},this._styles=new Map(t.map(e=>{if(e.isDefault)for(const t of e.modelElements)this._defaultStyles[t]=e.name;return[e.name,e]}))}refresh(){const e=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!e,this.isEnabled?e.hasAttribute("imageStyle")?this.value=e.getAttribute("imageStyle"):this.value=this._defaultStyles[e.name]:this.value=!1}execute(e={}){const t=this.editor,i=t.model,n=t.plugins.get("ImageUtils");i.change(t=>{const o=e.value,{setImageSizes:r=!0}=e;let s=n.getClosestSelectedImageElement(i.document.selection);o&&this.shouldConvertImageType(o,s)&&(this.editor.execute(n.isBlockImage(s)?"imageTypeInline":"imageTypeBlock",{setImageSizes:r}),s=n.getClosestSelectedImageElement(i.document.selection)),!o||this._styles.get(o).isDefault?t.removeAttribute("imageStyle",s):t.setAttribute("imageStyle",o,s),r&&n.setImageNaturalSizeAttributes(s)})}shouldConvertImageType(e,t){return!this._styles.get(e).modelElements.includes(t.name)}}const YA='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2 3h16v1.5H2zm11.5 9H18v1.5h-4.5zM2 15h16v1.5H2z" opacity=".5"/><path d="M12.003 7v5.5a1 1 0 0 1-1 1H2.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1m-1.506.5H3.5V12h6.997z"/></svg>',JA='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2 3h16v1.5H2zm11.5 9H18v1.5h-4.5zm0-3H18v1.5h-4.5zm0-3H18v1.5h-4.5zM2 15h16v1.5H2z" opacity=".5"/><path d="M12.003 7v5.5a1 1 0 0 1-1 1H2.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1m-1.506.5H3.5V12h6.997z"/></svg>',QA='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2 3h16v1.5H2zm0 12h16v1.5H2z" opacity=".5"/><path d="M12.003 7v5.5a1 1 0 0 1-1 1H2.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1m-1.506.5H3.5V12h6.997z"/></svg>',ZA='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2 3h16v1.5H2zm0 12h16v1.5H2z" opacity=".5"/><path d="M15.003 7v5.5a1 1 0 0 1-1 1H5.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1m-1.506.5H6.5V12h6.997z"/></svg>',XA='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2 3h16v1.5H2zm0 12h16v1.5H2zm0-9h5v1.5H2zm0 3h5v1.5H2zm0 3h5v1.5H2z" opacity=".5"/><path d="M18.003 7v5.5a1 1 0 0 1-1 1H8.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1m-1.506.5H9.5V12h6.997z"/></svg>',ex='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2 3h16v1.5H2zm0 12h16v1.5H2z" opacity=".5"/><path d="M18.003 7v5.5a1 1 0 0 1-1 1H8.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1m-1.506.5H9.5V12h6.997z"/></svg>',tx={get inline(){return{name:"inline",title:"In line",icon:YA,modelElements:["imageInline"],isDefault:!0}},get alignLeft(){return{name:"alignLeft",title:"Left aligned image",icon:JA,modelElements:["imageBlock","imageInline"],className:"image-style-align-left"}},get alignBlockLeft(){return{name:"alignBlockLeft",title:"Left aligned image",icon:QA,modelElements:["imageBlock"],className:"image-style-block-align-left"}},get alignCenter(){return{name:"alignCenter",title:"Centered image",icon:ZA,modelElements:["imageBlock"],className:"image-style-align-center"}},get alignRight(){return{name:"alignRight",title:"Right aligned image",icon:XA,modelElements:["imageBlock","imageInline"],className:"image-style-align-right"}},get alignBlockRight(){return{name:"alignBlockRight",title:"Right aligned image",icon:ex,modelElements:["imageBlock"],className:"image-style-block-align-right"}},get block(){return{name:"block",title:"Centered image",icon:ZA,modelElements:["imageBlock"],isDefault:!0}},get side(){return{name:"side",title:"Side image",icon:XA,modelElements:["imageBlock"],className:"image-style-side"}}},ix=(()=>({full:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2 3h16v1.5H2zm0 12h16v1.5H2z" opacity=".5"/><path d="M18 7v5.5a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1m-1.505.5H3.504V12h12.991z"/></svg>',left:QA,right:ex,center:ZA,inlineLeft:JA,inlineRight:XA,inline:YA}))(),nx=[{name:"imageStyle:wrapText",title:"Wrap text",defaultItem:"imageStyle:alignLeft",items:["imageStyle:alignLeft","imageStyle:alignRight"]},{name:"imageStyle:breakText",title:"Break text",defaultItem:"imageStyle:block",items:["imageStyle:alignBlockLeft","imageStyle:block","imageStyle:alignBlockRight"]}];function ox(e){x("image-style-configuration-definition-invalid",e)}const rx={normalizeStyles:function(e){const t=(e.configuredStyles.options||[]).map(e=>function(e){e="string"==typeof e?tx[e]?{...tx[e]}:{name:e}:function(e,t){const i={...t};for(const n in e)Object.prototype.hasOwnProperty.call(t,n)||(i[n]=e[n]);return i}(tx[e.name],e);"string"==typeof e.icon&&(e.icon=ix[e.icon]||e.icon);return e}(e)).filter(t=>function(e,{isBlockPluginLoaded:t,isInlinePluginLoaded:i}){const{modelElements:n,name:o}=e;if(!(n&&n.length&&o))return ox({style:e}),!1;{const o=[t?"imageBlock":null,i?"imageInline":null];if(!n.some(e=>o.includes(e)))return x("image-style-missing-dependency",{style:e,missingPlugins:n.map(e=>"imageBlock"===e?"ImageBlockEditing":"ImageInlineEditing")}),!1}return!0}(t,e));return t},getDefaultStylesConfiguration:function(e,t){return e&&t?{options:["inline","alignLeft","alignRight","alignCenter","alignBlockLeft","alignBlockRight","block","side"]}:e?{options:["block","side"]}:t?{options:["inline","alignLeft","alignRight"]}:{}},getDefaultDropdownDefinitions:function(e){return e.has("ImageBlockEditing")&&e.has("ImageInlineEditing")?[...nx]:[]},warnInvalidStyle:ox};var sx=i(7541);function ax(e){const t={imageInline:e.filter(e=>!e.isDefault&&e.modelElements.includes("imageInline")),imageBlock:e.filter(e=>!e.isDefault&&e.modelElements.includes("imageBlock"))};return(i,n,o)=>{if(!n.modelRange)return;const r=n.viewItem,s=Jt(n.modelRange.getItems());if(s&&o.schema.checkAttribute(s,"imageStyle")){for(const e of t[s.name])o.consumable.consume(r,{classes:e.className})&&o.writer.setAttribute("imageStyle",e.name,s);!function(e,t,i,n){if(!e.consumable.test(t,{styles:["float"]}))return;let o=null;const r=i.is("element","imageBlock")?"Block":"";switch(t.getStyle("float")){case"left":o=`align${r}Left`;break;case"right":o=`align${r}Right`}if(!o)return;const s=lx(o,n);if(!s)return;const a=tx[s.name];if(!sx(s,a))return;e.writer.setAttribute("imageStyle",o,i),e.consumable.consume(t,{styles:["float"]})}(o,r,s,e)}}}function lx(e,t){for(const i of t)if(i.name===e)return i}class cx extends Qu{static get pluginName(){return"ImageStyleEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[Pp]}normalizedStyles;init(){const e=this.editor,t=e.plugins.has("ImageBlockEditing"),i=e.plugins.has("ImageInlineEditing");e.config.define("image.styles",rx.getDefaultStylesConfiguration(t,i)),this.normalizedStyles=rx.normalizeStyles({configuredStyles:e.config.get("image.styles"),isBlockPluginLoaded:t,isInlinePluginLoaded:i}),this._setupConversion(t,i),this._setupPostFixer(),e.commands.add("imageStyle",new GA(e,this.normalizedStyles))}_setupConversion(e,t){const i=this.editor,n=i.model.schema,o=(r=this.normalizedStyles,(e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const n=lx(t.attributeNewValue,r),o=lx(t.attributeOldValue,r),s=i.mapper.toViewElement(t.item),a=i.writer;o&&a.removeClass(o.className,s),n&&a.addClass(n.className,s)});var r;const s=ax(this.normalizedStyles);i.editing.downcastDispatcher.on("attribute:imageStyle",o),i.data.downcastDispatcher.on("attribute:imageStyle",o),e&&(n.extend("imageBlock",{allowAttributes:"imageStyle"}),n.setAttributeProperties("imageStyle",{isFormatting:!0}),i.data.upcastDispatcher.on("element:figure",s,{priority:"low"})),t&&(n.extend("imageInline",{allowAttributes:"imageStyle"}),n.setAttributeProperties("imageStyle",{isFormatting:!0}),i.data.upcastDispatcher.on("element:img",s,{priority:"low"}))}_setupPostFixer(){const e=this.editor,t=e.model.document,i=e.plugins.get(Pp),n=new Map(this.normalizedStyles.map(e=>[e.name,e]));t.registerPostFixer(e=>{let o=!1;for(const r of t.differ.getChanges())if("insert"==r.type||"attribute"==r.type&&"imageStyle"==r.attributeKey){let t="insert"==r.type?r.position.nodeAfter:r.range.start.nodeAfter;if(t&&t.is("element","paragraph")&&t.childCount>0&&(t=t.getChild(0)),!i.isImage(t))continue;const s=t.getAttribute("imageStyle");if(!s)continue;const a=n.get(s);a&&a.modelElements.includes(t.name)||(e.removeAttribute("imageStyle",t),o=!0)}return o})}}function dx(e){return e}var ux=i(7879),hx={attributes:{"data-cke":!0}};hx.setAttributes=Ki(),hx.insert=$i().bind(null,"head"),hx.domAPI=Hi(),hx.insertStyleElement=Yi();ji()(ux.A,hx);ux.A&&ux.A.locals&&ux.A.locals;class mx extends Qu{static get requires(){return[cx]}static get pluginName(){return"ImageStyleUI"}static get isOfficialPlugin(){return!0}get localizedDefaultStylesTitles(){const e=this.editor.t;return{"Wrap text":e("Wrap text"),"Break text":e("Break text"),"In line":e("In line"),"Full size image":e("Full size image"),"Side image":e("Side image"),"Left aligned image":e("Left aligned image"),"Centered image":e("Centered image"),"Right aligned image":e("Right aligned image")}}init(){const e=this.editor.plugins,t=this.editor.config.get("image.toolbar")||[],i=gx(e.get("ImageStyleEditing").normalizedStyles,this.localizedDefaultStylesTitles);for(const e of i)this._createButton(e);const n=gx([...t.filter(F),...rx.getDefaultDropdownDefinitions(e)],this.localizedDefaultStylesTitles);for(const e of n)this._createDropdown(e,i)}_createDropdown(e,t){const i=this.editor.ui.componentFactory;i.add(e.name,n=>{let o;const{defaultItem:r,items:s,title:a}=e,l=s.filter(e=>t.find(({name:t})=>fx(t)===e)).map(e=>{const t=i.create(e);return e===r&&(o=t),t});s.length!==l.length&&rx.warnInvalidStyle({dropdown:e});const c=su(n,Kd),d=c.buttonView,u=d.arrowView;return au(c,l,{enableActiveItemFocusOnDropdownOpen:!0}),d.set({label:px(a,o.label),class:null,tooltip:!0}),u.unbind("label"),u.set({label:a}),d.bind("icon").toMany(l,"isOn",(...e)=>{const t=e.findIndex(dx);return t<0?o.icon:l[t].icon}),d.bind("label").toMany(l,"isOn",(...e)=>{const t=e.findIndex(dx);return px(a,t<0?o.label:l[t].label)}),d.bind("isOn").toMany(l,"isOn",(...e)=>e.some(dx)),d.bind("class").toMany(l,"isOn",(...e)=>e.some(dx)?"ck-splitbutton_flatten":void 0),d.on("execute",()=>{l.some(({isOn:e})=>e)?c.isOpen=!c.isOpen:o.fire("execute")}),c.bind("isEnabled").toMany(l,"isEnabled",(...e)=>e.some(dx)),this.listenTo(c,"execute",()=>{this.editor.editing.view.focus()}),c})}_createButton(e){const t=e.name;this.editor.ui.componentFactory.add(fx(t),i=>{const n=this.editor.commands.get("imageStyle"),o=new lo(i);return o.set({label:e.title,icon:e.icon,tooltip:!0,isToggleable:!0}),o.bind("isEnabled").to(n,"isEnabled"),o.bind("isOn").to(n,"value",e=>e===t),o.on("execute",this._executeCommand.bind(this,t)),o})}_executeCommand(e){this.editor.execute("imageStyle",{value:e}),this.editor.editing.view.focus()}}function gx(e,t){for(const i of e)t[i.title]&&(i.title=t[i.title]);return e}function fx(e){return`imageStyle:${e}`}function px(e,t){return(e?e+": ":"")+t}class bx extends Xu{refresh(){const e=this.editor.model,t=e.document;this.value=t.selection.getAttribute("highlight"),this.isEnabled=e.schema.checkAttributeInSelection(t.selection,"highlight")}execute(e={}){const t=this.editor.model,i=t.document.selection,n=e.value;t.change(e=>{if(i.isCollapsed){const t=i.getFirstPosition();if(i.hasAttribute("highlight")){const i=e=>e.item.hasAttribute("highlight")&&e.item.getAttribute("highlight")===this.value,o=t.getLastMatchingPosition(i,{direction:"backward"}),r=t.getLastMatchingPosition(i),s=e.createRange(o,r);n&&this.value!==n?(t.isEqual(r)||e.setAttribute("highlight",n,s),e.setSelectionAttribute("highlight",n)):(t.isEqual(r)||e.removeAttribute("highlight",s),e.removeSelectionAttribute("highlight"))}else n&&e.setSelectionAttribute("highlight",n)}else{const o=t.schema.getValidRanges(i.getRanges(),"highlight");for(const t of o)n?e.setAttribute("highlight",n,t):e.removeAttribute("highlight",t)}})}}class kx extends Qu{static get pluginName(){return"HighlightEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define("highlight",{options:[{model:"yellowMarker",class:"marker-yellow",title:"Yellow marker",color:"var(--ck-content-highlight-marker-yellow)",type:"marker"},{model:"greenMarker",class:"marker-green",title:"Green marker",color:"var(--ck-content-highlight-marker-green)",type:"marker"},{model:"pinkMarker",class:"marker-pink",title:"Pink marker",color:"var(--ck-content-highlight-marker-pink)",type:"marker"},{model:"blueMarker",class:"marker-blue",title:"Blue marker",color:"var(--ck-content-highlight-marker-blue)",type:"marker"},{model:"redPen",class:"pen-red",title:"Red pen",color:"var(--ck-content-highlight-pen-red)",type:"pen"},{model:"greenPen",class:"pen-green",title:"Green pen",color:"var(--ck-content-highlight-pen-green)",type:"pen"}]})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:"highlight"});const t=e.config.get("highlight.options");e.conversion.attributeToElement(function(e){const t={model:{key:"highlight",values:[]},view:{}};for(const i of e)t.model.values.push(i.model),t.view[i.model]={name:"mark",classes:i.class};return t}(t)),e.commands.add("highlight",new bx(e))}}var wx=i(1862),_x={attributes:{"data-cke":!0}};_x.setAttributes=Ki(),_x.insert=$i().bind(null,"head"),_x.domAPI=Hi(),_x.insertStyleElement=Yi();ji()(wx.A,_x);wx.A&&wx.A.locals&&wx.A.locals;class vx extends Qu{get localizedOptionTitles(){const e=this.editor.t;return{"Yellow marker":e("Yellow marker"),"Green marker":e("Green marker"),"Pink marker":e("Pink marker"),"Blue marker":e("Blue marker"),"Red pen":e("Red pen"),"Green pen":e("Green pen")}}static get pluginName(){return"HighlightUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.config.get("highlight.options");for(const t of e)this._addHighlighterButton(t);this._addRemoveHighlightButton(),this._addDropdown(e),this._addMenuBarButton(e)}_addRemoveHighlightButton(){const e=this.editor.t,t=this.editor.commands.get("highlight");this._addButton("removeHighlight",e("Remove highlight"),$w,null,e=>{e.bind("isEnabled").to(t,"isEnabled")})}_addHighlighterButton(e){const t=this.editor.commands.get("highlight");this._addButton("highlight:"+e.model,e.title,yx(e.type),e.model,function(i){i.bind("isEnabled").to(t,"isEnabled"),i.bind("isOn").to(t,"value",t=>t===e.model),i.iconView.fillColor=e.color,i.isToggleable=!0})}_addButton(e,t,i,n,o){const r=this.editor;r.ui.componentFactory.add(e,e=>{const s=new lo(e),a=this.localizedOptionTitles[t]?this.localizedOptionTitles[t]:t;return s.set({label:a,icon:i,tooltip:!0}),s.on("execute",()=>{r.execute("highlight",{value:n}),r.editing.view.focus()}),o(s),s})}_addDropdown(e){const t=this.editor,i=t.t,n=t.ui.componentFactory,o=e[0],r=e.reduce((e,t)=>(e[t.model]=t,e),{});n.add("highlight",s=>{const a=t.commands.get("highlight"),l=su(s,Kd),c=l.buttonView;c.set({label:i("Highlight"),tooltip:!0,lastExecuted:o.model,commandValue:o.model,isToggleable:!0}),c.bind("icon").to(a,"value",e=>yx(d(e,"type"))),c.bind("color").to(a,"value",e=>d(e,"color")),c.bind("commandValue").to(a,"value",e=>d(e,"model")),c.bind("isOn").to(a,"value",e=>!!e),c.delegate("execute").to(l);function d(e,t){const i=e&&e!==c.lastExecuted?e:c.lastExecuted;return r[i][t]}return l.bind("isEnabled").to(a,"isEnabled"),au(l,()=>{const t=e.map(e=>{const t=n.create("highlight:"+e.model);return this.listenTo(t,"execute",()=>{l.buttonView.set({lastExecuted:e.model})}),t});return t.push(new Od),t.push(n.create("removeHighlight")),t},{enableActiveItemFocusOnDropdownOpen:!0,ariaLabel:i("Text highlight toolbar")}),function(e){const t=e.buttonView.actionView;t.iconView.bind("fillColor").to(e.buttonView,"color")}(l),c.on("execute",()=>{t.execute("highlight",{value:c.commandValue})}),this.listenTo(l,"execute",()=>{t.editing.view.focus()}),l})}_addMenuBarButton(e){const t=this.editor,i=t.t,n=t.commands.get("highlight");t.ui.componentFactory.add("menuBar:highlight",o=>{const r=new Mu(o);r.buttonView.set({label:i("Highlight"),icon:yx("marker")}),r.bind("isEnabled").to(n),r.buttonView.iconView.fillColor="transparent";const s=new Ou(o);for(const i of e){const e=new Nn(o,r),a=new Lu(o);a.set({label:i.title,icon:yx(i.type),role:"menuitemradio",isToggleable:!0}),a.iconView.fillColor=i.color,a.delegate("execute").to(r),a.bind("isOn").to(n,"value",e=>e===i.model),a.on("execute",()=>{t.execute("highlight",{value:i.model}),t.editing.view.focus()}),e.children.add(a),s.items.add(e)}s.items.add(new Fd(o));const a=new Nn(o,r),l=new Lu(o);return l.set({label:i("Remove highlight"),icon:$w}),l.delegate("execute").to(r),l.on("execute",()=>{t.execute("highlight",{value:null}),t.editing.view.focus()}),a.children.add(l),s.items.add(a),r.panelView.children.add(s),r})}}function yx(e){return"marker"===e?'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M10.798 1.59 3.002 12.875l1.895 1.852 2.521 1.402 6.997-12.194z" class="ck-icon__fill"/><path d="m2.556 16.727.234-.348q-.445-.226-.498-.426-.054-.206.115-.837.14-.375.169-.595a4.5 4.5 0 0 0 0-.725q-.313-.931-.284-1.26.03-.327.475-.862l6.77-9.414q.808-1.365 3.199.18 2.39 1.549 1.784 2.686l-5.877 10.36q-.237.618-.526.782-.29.163-1.232.21-.543.196-.738.318t-.526.47q-.44.397-.632.397-.143 0-.524-.226l-.31.41zm-.279.415 1.575 1.103-.392.515H1.19zm8.1-13.656-4.953 6.9L8.75 12.57l4.247-7.574q.263-.375-1.092-1.192-1.354-.819-1.528-.32zM8.244 18.5 9.59 17h9.406v1.5z"/></svg>':'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M10.126 2.268 2.002 13.874l1.895 1.852 2.521 1.402L14.47 5.481l-1.543-2.568z" class="ck-icon__fill"/><path d="m4.5 18.088-2.645-1.852-.04-2.95-.006-.005.006-.008v-.025l.011.008L8.73 2.97q.249-.348.567-.557l-1.212.308L4.604 7.9l-.83-.558 3.694-5.495 2.708-.69 1.65 1.145.046.018.85-1.216 2.16 1.512-.856 1.222c.828.967 1.144 2.141.432 3.158L7.55 17.286l.006.005zm-.634.166-1.976.516-.026-1.918zM9.968 3.817l-.006-.004-6.123 9.184 3.277 2.294 6.108-9.162.005.003c.317-.452-.16-1.332-1.064-1.966-.891-.624-1.865-.776-2.197-.349M8.245 18.5 9.59 17h9.406v1.5z"/></svg>'}class Ax extends Xu{refresh(){const e=Jt(this.editor.model.document.selection.getSelectedBlocks());this.value=e.getAttribute("lineHeight"),this.isEnabled=!0}execute({value:e}){const t=this.editor.model,i=t.document;t.change(t=>{Array.from(i.selection.getSelectedBlocks()).forEach(i=>{e?t.setAttribute("lineHeight",e,i):t.removeAttribute("lineHeight",i)})})}}class xx extends Mh{}xx.builtinPlugins=[class extends Qu{static get requires(){return[Tf,nf,Dm,cf,jm,hm,wf]}static get pluginName(){return"Essentials"}static get isOfficialPlugin(){return!0}},class extends Qu{static get requires(){return[If]}static get pluginName(){return"CKFinderUploadAdapter"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.config.get("ckfinder.uploadUrl");e&&(this.editor.plugins.get(If).createUploadAdapter=t=>new Nf(t,e,this.editor.t))}},class extends Qu{static get requires(){return[um]}static get pluginName(){return"Autoformat"}static get isOfficialPlugin(){return!0}afterInit(){const e=this.editor,t=this.editor.t;this._addListAutoformats(),this._addBasicStylesAutoformats(),this._addHeadingAutoformats(),this._addBlockQuoteAutoformats(),this._addCodeBlockAutoformats(),this._addHorizontalLineAutoformats(),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Revert autoformatting action"),keystroke:"Backspace"}]})}_addListAutoformats(){const e=this.editor.commands;e.get("bulletedList")&&Vf(this.editor,this,/^[*-]\s$/,"bulletedList"),e.get("numberedList")&&Vf(this.editor,this,/^1[.|)]\s$/,"numberedList"),e.get("todoList")&&Vf(this.editor,this,/^\[\s?\]\s$/,"todoList"),e.get("checkTodoList")&&Vf(this.editor,this,/^\[\s?x\s?\]\s$/,()=>{this.editor.execute("todoList"),this.editor.execute("checkTodoList")})}_addBasicStylesAutoformats(){const e=this.editor.commands;if(e.get("bold")){const e=Bf(this.editor,"bold");Lf(this.editor,this,/(?:^|\s)(\*\*)([^*]+)(\*\*)$/g,e),Lf(this.editor,this,/(?:^|\s)(__)([^_]+)(__)$/g,e)}if(e.get("italic")){const e=Bf(this.editor,"italic");Lf(this.editor,this,/(?:^|\s)(\*)([^*_]+)(\*)$/g,e),Lf(this.editor,this,/(?:^|\s)(_)([^_]+)(_)$/g,e)}if(e.get("code")){const e=Bf(this.editor,"code");Lf(this.editor,this,/(`)([^`]+)(`)$/g,e)}if(e.get("strikethrough")){const e=Bf(this.editor,"strikethrough");Lf(this.editor,this,/(~~)([^~]+)(~~)$/g,e)}}_addHeadingAutoformats(){const e=this.editor.commands.get("heading");e&&e.modelElements.filter(e=>e.match(/^heading[1-6]$/)).forEach(t=>{const i=t[7],n=new RegExp(`^(#{${i}})\\s$`);Vf(this.editor,this,n,()=>{if(!e.isEnabled||e.value===t)return!1;this.editor.execute("heading",{value:t})})})}_addBlockQuoteAutoformats(){this.editor.commands.get("blockQuote")&&Vf(this.editor,this,/^>\s$/,"blockQuote")}_addCodeBlockAutoformats(){const e=this.editor,t=e.model.document.selection;e.commands.get("codeBlock")&&Vf(e,this,/^```$/,()=>{if(t.getFirstPosition().parent.is("element","listItem"))return!1;this.editor.execute("codeBlock",{usePreviousLanguageChoice:!0})})}_addHorizontalLineAutoformats(){this.editor.commands.get("horizontalLine")&&Vf(this.editor,this,/^---$/,"horizontalLine")}},class extends Qu{static get requires(){return[jf,Wf]}static get pluginName(){return"Bold"}static get isOfficialPlugin(){return!0}},class extends Qu{static get requires(){return[qf,Gf]}static get pluginName(){return"Italic"}static get isOfficialPlugin(){return!0}},class extends Qu{static get requires(){return[Xf,ip]}static get pluginName(){return"BlockQuote"}static get isOfficialPlugin(){return!0}},class extends Qu{static get pluginName(){return"CKFinder"}static get isOfficialPlugin(){return!0}static get requires(){return["Link","CKFinderUploadAdapter",cp,rp]}},class extends Qu{static get pluginName(){return"EasyImage"}static get isOfficialPlugin(){return!0}static get requires(){return[dp,"ImageUpload"]}init(){const e=this.editor;e.plugins.has("ImageBlockEditing")||e.plugins.has("ImageInlineEditing")||x("easy-image-image-feature-missing",e)}},class extends Qu{static get requires(){return[wp,Ap]}static get pluginName(){return"Heading"}static get isOfficialPlugin(){return!0}},class extends Qu{static get requires(){return[Ib,Pb]}static get pluginName(){return"Image"}static get isOfficialPlugin(){return!0}},class extends Qu{static get requires(){return[_k,vk]}static get pluginName(){return"ImageCaption"}static get isOfficialPlugin(){return!0}},class extends Qu{static get requires(){return[Sg,Pp]}static get pluginName(){return"ImageToolbar"}static get isOfficialPlugin(){return!0}afterInit(){const e=this.editor,t=e.t,i=e.plugins.get(Sg),n=e.plugins.get("ImageUtils");var o;i.register("image",{ariaLabel:t("Image toolbar"),items:(o=e.config.get("image.toolbar")||[],o.map(e=>F(e)?e.name:e)),getRelatedElement:e=>n.getClosestSelectedImageWidget(e)})}},gk,class extends Qu{static get requires(){return[Ob,zb,qb,Nb]}static get pluginName(){return"ImageResize"}static get isOfficialPlugin(){return!0}},Ob,class extends Qu{static get requires(){return[cx,mx]}static get pluginName(){return"ImageStyle"}static get isOfficialPlugin(){return!0}},class extends Qu{static get pluginName(){return"Indent"}static get isOfficialPlugin(){return!0}static get requires(){return[xk,Ek]}},class extends Qu{static get requires(){return[Yk,dw,mw]}static get pluginName(){return"Link"}static get isOfficialPlugin(){return!0}},class extends Qu{static get requires(){return[Z_,iv]}static get pluginName(){return"List"}static get isOfficialPlugin(){return!0}},class extends Qu{static get requires(){return[hv,kv,gv,bg]}static get pluginName(){return"MediaEmbed"}static get isOfficialPlugin(){return!0}},fp,class extends Qu{static get pluginName(){return"PasteFromOffice"}static get licenseFeatureCode(){return"PFO"}static get isOfficialPlugin(){return!0}static get isPremiumPlugin(){return!0}static get requires(){return[Gh]}init(){const e=this.editor,t=e.plugins.get("ClipboardPipeline"),i=e.editing.view.document,n=[],o=this.editor.plugins.has("MultiLevelListEditing"),r=this.editor.plugins.has("TablePropertiesEditing"),s=!!this.editor.config.get("experimentalFlags.useExtendedTableBlockAlignment");n.push(new jv(i,o,r,s)),n.push(new Kv(i)),n.push(new Yv(i)),t.on("inputTransformation",(t,o)=>{if(o._isTransformedWithPasteFromOffice)return;if(e.model.document.selection.getFirstPosition().parent.is("element","codeBlock"))return;const r=o.dataTransfer.getData("text/html"),s=n.find(e=>e.isActive(r));s&&(o._parsedData||(o._parsedData=Qv(r,i.stylesProcessor)),s.execute(o),o._isTransformedWithPasteFromOffice=!0)},{priority:"high"})}},class extends Qu{static get requires(){return[mA,wA,AA,PA,IA,xA,bg]}static get pluginName(){return"Table"}static get isOfficialPlugin(){return!0}},class extends Qu{static get requires(){return[Sg]}static get pluginName(){return"TableToolbar"}static get isOfficialPlugin(){return!0}afterInit(){const e=this.editor,t=e.t,i=e.plugins.get(Sg),n=e.config.get("table.contentToolbar"),o=e.config.get("table.tableToolbar");n&&i.register("tableContent",{ariaLabel:t("Table toolbar"),items:n,getRelatedElement:VA}),o&&i.register("table",{ariaLabel:t("Table toolbar"),items:o,getRelatedElement:NA})}},class extends Qu{static get requires(){return["Delete","Input"]}static get pluginName(){return"TextTransformation"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define("typing",{transformations:{include:Cm}})}init(){const e=this.editor.model.document.selection;e.on("change:range",()=>{const t=e.anchor,i=!!t&&t.parent.is("element","codeBlock"),n=e.hasAttribute("code");this.isEnabled=!(i||n)}),this._enableTransformationWatchers()}_enableTransformationWatchers(){const e=this.editor,t=e.model,i=e.plugins.get("Delete"),n=function(e){const t=e.extra||[],i=e.remove||[],n=e=>!i.includes(e);return function(e){const t=new Set;for(const i of e)if("string"==typeof i&&xm[i])for(const e of xm[i])t.add(e);else t.add(i);return Array.from(t)}(e.include.concat(t).filter(n)).filter(n).map(e=>"string"==typeof e&&Am[e]?Am[e]:e).filter(e=>"object"==typeof e).map(e=>({from:Tm(e.from),to:Em(e.to)}))}(e.config.get("typing.transformations")),o=new gm(e.model,e=>{for(const t of n){if(t.from.test(e))return{normalizedTransformation:t}}});o.on("matched:data",(e,n)=>{if(!n.batch.isTyping)return;const{from:o,to:r}=n.normalizedTransformation,s=o.exec(n.text),a=r(s.slice(1)),l=n.range;let c=s.index;t.enqueueChange(e=>{for(let i=1;i<s.length;i++){const n=s[i],o=a[i-1];if(null==o){c+=n.length;continue}const r=l.start.getShiftedBy(c),d=t.createRange(r,r.getShiftedBy(n.length)),u=Im(r);t.insertContent(e.createText(o,u),d),c+=o.length}t.enqueueChange(()=>{i.requestUndoOnBackspace()})})}),o.bind("isEnabled").to(this)}},class extends Qu{static get pluginName(){return"SourceEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[Ph]}_elementReplacer;_replacedRoots;_dataFromRoots;constructor(e){super(e),this.set("isSourceEditingMode",!1),this._elementReplacer=new X,this._replacedRoots=new Map,this._dataFromRoots=new Map,e.config.define("sourceEditing.allowCollaborationFeatures",!1)}init(){this._checkCompatibility();const e=this.editor,t=e.locale.t;e.ui.componentFactory.add("sourceEditing",()=>{const e=this._createButton(lo);return e.set({label:t("Source"),icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="m12.5 0 5 4.5v15.003h-16V0zM3 1.5v3.25l-1.497 1-.003 8 1.5 1v3.254L7.685 18l-.001 1.504H17.5V8.002L16 9.428l-.004-4.22-4.222-3.692z"/><path d="M4.06 6.64a.75.75 0 0 1 .958 1.15l-.085.07L2.29 9.75l2.646 1.89c.302.216.4.62.232.951l-.058.095a.75.75 0 0 1-.951.232l-.095-.058-3.5-2.5V9.14zm4.194 6.22a.75.75 0 0 1-.958-1.149l.085-.07 2.643-1.89-2.646-1.89a.75.75 0 0 1-.232-.952l.058-.095a.75.75 0 0 1 .95-.232l.096.058 3.5 2.5v1.22zm7.644-.836 2.122 2.122-5.825 5.809-2.125-.005.003-2.116zm2.539-1.847 1.414 1.414a.5.5 0 0 1 0 .707l-1.06 1.06-2.122-2.12 1.061-1.061a.5.5 0 0 1 .707 0"/></svg>',tooltip:!0,class:"ck-source-editing-button"}),e}),e.ui.componentFactory.add("menuBar:sourceEditing",()=>{const e=this._createButton(Lu);return e.set({label:t("Show source"),role:"menuitemcheckbox"}),e}),this._isAllowedToHandleSourceEditingMode()&&(this.on("change:isSourceEditingMode",(e,t,i)=>{i?(this._hideVisibleDialog(),this._showSourceEditing(),this._disableCommands()):(this._hideSourceEditing(),this._enableCommands())}),this.on("change:isEnabled",(e,t,i)=>this._handleReadOnlyMode(!i)),this.listenTo(e,"change:isReadOnly",(e,t,i)=>this._handleReadOnlyMode(i))),e.data.on("get",()=>{this.isSourceEditingMode&&this.updateEditorData()},{priority:"high"})}updateEditorData(){const e=this.editor,t={};for(const[e,i]of this._replacedRoots){const n=this._dataFromRoots.get(e),o=i.dataset.value;n!==o&&(t[e]=o,this._dataFromRoots.set(e,o))}Object.keys(t).length&&e.data.set(t,{batchType:{isUndoable:!0},suppressErrorInCollaboration:!0})}_checkCompatibility(){const e=this.editor,t=e.config.get("sourceEditing.allowCollaborationFeatures");if(!t&&e.plugins.has("RealTimeCollaborativeEditing"))throw new A("source-editing-incompatible-with-real-time-collaboration",null);!t&&["CommentsEditing","TrackChangesEditing","RevisionHistory"].some(t=>e.plugins.has(t))&&console.warn("You initialized the editor with the source editing feature and at least one of the collaboration features. Please be advised that the source editing feature may not work, and be careful when editing document source that contains markers created by the collaboration features."),e.plugins.has("RestrictedEditingModeEditing")&&console.warn("You initialized the editor with the source editing feature and restricted editing feature. Please be advised that the source editing feature may not work, and be careful when editing document source that contains markers created by the restricted editing feature.")}_showSourceEditing(){const e=this.editor,t=e.editing.view,i=e.model;i.change(e=>{e.setSelection(null),e.removeSelectionAttribute(i.document.selection.getAttributeKeys())});for(const[i,n]of t.domRoots){const o=FA(e.data.get({rootName:i})),r=oe(n.ownerDocument,"textarea",{rows:"1","aria-label":"Source code editing area"}),s=oe(n.ownerDocument,"div",{class:"ck-source-editing-area","data-value":o},[r]);r.value=o,r.setSelectionRange(0,0),r.addEventListener("input",()=>{s.dataset.value=r.value,e.ui.update()}),t.change(e=>{const n=t.document.getRoot(i);e.addClass("ck-hidden",n)}),e.ui.setEditableElement("sourceEditing:"+i,r),this._replacedRoots.set(i,s),this._elementReplacer.replace(n,s),this._dataFromRoots.set(i,o)}this._hideDocumentOutline(),this._refreshAnnotationsVisibility(),this._focusSourceEditing()}_hideSourceEditing(){const e=this.editor.editing.view;this.updateEditorData(),e.change(t=>{for(const[i]of this._replacedRoots)t.removeClass("ck-hidden",e.document.getRoot(i))}),this._elementReplacer.restore(),this._replacedRoots.clear(),this._dataFromRoots.clear(),this._showDocumentOutline(),this._refreshAnnotationsVisibility(),e.focus()}_hideDocumentOutline(){this.editor.plugins.has("DocumentOutlineUI")&&(this.editor.plugins.get("DocumentOutlineUI").view.element.style.display="none")}_showDocumentOutline(){this.editor.plugins.has("DocumentOutlineUI")&&(this.editor.plugins.get("DocumentOutlineUI").view.element.style.display="")}_refreshAnnotationsVisibility(){this.editor.plugins.has("Annotations")&&this.editor.plugins.get("Annotations").refreshVisibility()}_focusSourceEditing(){const e=this.editor,[t]=this._replacedRoots.values(),i=t.querySelector("textarea");e.editing.view.document.isFocused=!1,i.focus()}_disableCommands(){const e=this.editor;for(const t of e.commands.commands())t.forceDisabled(zA);e.plugins.has("CommentsArchiveUI")&&e.plugins.get("CommentsArchiveUI").forceDisabled(zA)}_enableCommands(){const e=this.editor;for(const t of e.commands.commands())t.clearForceDisabled(zA);e.plugins.has("CommentsArchiveUI")&&e.plugins.get("CommentsArchiveUI").clearForceDisabled(zA)}_handleReadOnlyMode(e){if(this.isSourceEditingMode)for(const[,t]of this._replacedRoots)t.querySelector("textarea").readOnly=e}_isAllowedToHandleSourceEditingMode(){const e=this.editor.ui.view.editable;return e&&!e.hasExternalElement}_hideVisibleDialog(){if(this.editor.plugins.has("Dialog")){const e=this.editor.plugins.get("Dialog");e.isOpen&&e.hide()}}_createButton(e){const t=this.editor,i=new e(t.locale);return i.set({withText:!0,isToggleable:!0}),i.bind("isOn").to(this,"isSourceEditingMode"),i.bind("isEnabled").to(this,"isEnabled",t,"isReadOnly",t.plugins.get(Ph),"hasAny",(e,t,i)=>!!e&&(!t&&!i)),this.listenTo(i,"execute",()=>{this.isSourceEditingMode=!this.isSourceEditingMode}),i}},class extends Qu{static get requires(){return[If]}static get pluginName(){return"SimpleUploadAdapter"}static get licenseFeatureCode(){return"SUA"}static get isOfficialPlugin(){return!0}static get isPremiumPlugin(){return!0}init(){const e=this.editor.config.get("simpleUpload");e&&(e.uploadUrl?this.editor.plugins.get(If).createUploadAdapter=t=>new Pf(t,e):x("simple-upload-adapter-missing-uploadurl"))}},class extends rh{tokenUrl;uploadUrl;webSocketUrl;bundleVersion;autoRefresh=!0;token=null;_tokens=new Map;static get pluginName(){return"CloudServices"}static get isOfficialPlugin(){return!0}static get requires(){return[KA]}async init(){const e=this.context.config.get("cloudServices")||{};for(const[t,i]of Object.entries(e))this[t]=i;if(!this.tokenUrl)return void(this.token=null);const t=this.context.plugins.get("CloudServicesCore").createToken(this.tokenUrl,{autoRefresh:this.autoRefresh});try{this.token=await t.init(),this._tokens.set(this.tokenUrl,this.token)}catch(e){throw t.destroy(),e}}async registerTokenUrl(e){if(this._tokens.has(e))return this.getTokenFor(e);const t=this.context.plugins.get("CloudServicesCore"),i=await t.createToken(e,{autoRefresh:this.autoRefresh}).init();return this._tokens.set(e,i),i}getTokenFor(e){const t=this._tokens.get(e);if(!t)throw new A("cloudservices-token-not-registered",this);return t}destroy(){super.destroy();for(const e of this._tokens.values())e.destroy()}},class extends Qu{static get pluginName(){return"ImageInsert"}static get isOfficialPlugin(){return!0}static get requires(){return[gk,bk,Cb]}},class extends Qu{static get requires(){return[nf,Pp,wf,um]}static get pluginName(){return"AutoImage"}static get isOfficialPlugin(){return!0}_timeoutId;_positionToInsert;constructor(e){super(e),this._timeoutId=null,this._positionToInsert=null}init(){const t=this.editor,i=t.model.document,n=t.plugins.get("ClipboardPipeline");this.listenTo(n,"inputTransformation",()=>{const e=i.selection.getFirstRange(),t=Ac.fromPosition(e.start);t.stickiness="toPrevious";const n=Ac.fromPosition(e.end);n.stickiness="toNext",i.once("change:data",()=>{this._embedImageBetweenPositions(t,n),t.detach(),n.detach()},{priority:"high"})}),t.commands.get("undo").on("execute",()=>{this._timeoutId&&(e.window.clearTimeout(this._timeoutId),this._positionToInsert.detach(),this._timeoutId=null,this._positionToInsert=null)},{priority:"high"})}_embedImageBetweenPositions(e,t){const i=this.editor,n=new La(e,t),o=n.getWalker({ignoreElementEnd:!0}),r=Object.fromEntries(i.model.document.selection.getAttributes()),s=this.editor.plugins.get("ImageUtils");let a="";for(const e of o)e.item.is("$textProxy")&&(a+=e.item.data);a=a.trim(),a.match(Op)?(this._positionToInsert=Ac.fromPosition(e),this._timeoutId=setTimeout(()=>{if(!i.commands.get("insertImage").isEnabled)return void n.detach();i.model.change(e=>{let t;this._timeoutId=null,e.remove(n),n.detach(),"$graveyard"!==this._positionToInsert.root.rootName&&(t=this._positionToInsert.toPosition()),s.insertImage({...r,src:a},t),this._positionToInsert.detach(),this._positionToInsert=null});i.plugins.get("Delete").requestUndoOnBackspace()},100)):n.detach()}},Ib,kb,Pb,class extends Qu{static get pluginName(){return"LineHeight"}init(){const e=this.editor,t=e.config.get("lineHeight.options")||[{commandValue:"0",label:"None"},{commandValue:"1",label:"1"},{commandValue:"2",label:"2"},{commandValue:"3",label:"3"},{commandValue:"4",label:"4"},{commandValue:"5",label:"5"},{commandValue:"6",label:"6"}];e.model.schema.extend("$block",{allowAttributes:"lineHeight"}),e.conversion.for("downcast").attributeToAttribute({model:"lineHeight",view:e=>({key:"style",value:{"line-height":e}})}),e.conversion.for("upcast").attributeToAttribute({view:{name:"p",styles:{"line-height":/[\s\S]+/}},model:{key:"lineHeight",value:e=>e.getStyle("line-height")}}),e.ui.componentFactory.add("lineHeight",i=>{const n=su(i);n.buttonView.set({label:"Line Spacing",withText:!0,tooltip:!0});const o=new Yt;for(const e of t){const t={type:"button",model:new _p({commandValue:e.commandValue,label:e.label,withText:!0})};o.add(t)}return cu(n,o),this.listenTo(n,"execute",t=>{console.log("evt.source.commandValue",t.source.commandValue),e.execute("lineHeight",{value:t.source.commandValue})}),n}),e.commands.add("lineHeight",new Ax(e))}},class extends Qu{static get requires(){return[kx,vx]}static get pluginName(){return"Highlight"}static get isOfficialPlugin(){return!0}}],xx.defaultConfig={toolbar:{items:["imageStyle","heading","|","bold","italic","link","highlight","bulletedList","numberedList","|","lineHeight","indent","outdent","|","insertImage","insertImageViaUrl","imageUpload","sourceEditing","blockQuote","insertTable","mediaEmbed","undo","redo"]},highlight:{options:[{model:"yellowMarker",class:"marker-yellow",title:"Yellow highlight",color:"var(--ck-highlight-marker-yellow)",type:"marker"}]},image:{toolbar:["imageStyle:side","imageStyle:inline","imageStyle:alignLeft","imageStyle:alignCenter","imageStyle:alignRight","|","toggleImageCaption","imageTextAlternative"],resizeUnit:"px",stylesAttributes:{width:"width",height:"height"}},table:{contentToolbar:["tableColumn","tableRow","mergeTableCells"]},language:"en"}})(),n=n.default})());
|