@ckeditor/ckeditor5-track-changes 33.0.0 → 34.2.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/LICENSE.md +2 -2
- package/README.md +5 -2
- package/build/track-changes.js +2 -2
- package/build/translations/az.js +1 -0
- package/build/translations/cs.js +1 -1
- package/build/translations/da.js +1 -1
- package/build/translations/de.js +1 -1
- package/build/translations/el.js +1 -1
- package/build/translations/en-au.js +1 -1
- package/build/translations/es.js +1 -1
- package/build/translations/et.js +1 -1
- package/build/translations/fr.js +1 -1
- package/build/translations/gl.js +1 -1
- package/build/translations/hi.js +1 -1
- package/build/translations/hr.js +1 -1
- package/build/translations/id.js +1 -0
- package/build/translations/it.js +1 -1
- package/build/translations/lv.js +1 -0
- package/build/translations/nl.js +1 -1
- package/build/translations/pl.js +1 -1
- package/build/translations/pt-br.js +1 -1
- package/build/translations/sk.js +1 -1
- package/build/translations/sr-latn.js +1 -1
- package/build/translations/sr.js +1 -1
- package/build/translations/tk.js +1 -1
- package/build/translations/tr.js +1 -1
- package/build/translations/zh-cn.js +1 -1
- package/build/translations/zh.js +1 -1
- package/lang/contexts.json +2 -0
- package/lang/translations/az.po +397 -0
- package/lang/translations/cs.po +40 -28
- package/lang/translations/da.po +10 -0
- package/lang/translations/de.po +10 -0
- package/lang/translations/el.po +10 -0
- package/lang/translations/en-au.po +15 -5
- package/lang/translations/en.po +10 -0
- package/lang/translations/es.po +29 -1
- package/lang/translations/et.po +10 -0
- package/lang/translations/fr.po +29 -1
- package/lang/translations/gl.po +13 -3
- package/lang/translations/hi.po +10 -0
- package/lang/translations/hr.po +24 -13
- package/lang/translations/id.po +379 -0
- package/lang/translations/it.po +29 -1
- package/lang/translations/lv.po +415 -0
- package/lang/translations/nl.po +19 -9
- package/lang/translations/pl.po +12 -0
- package/lang/translations/pt-br.po +29 -1
- package/lang/translations/sk.po +69 -57
- package/lang/translations/sr-latn.po +11 -0
- package/lang/translations/sr.po +11 -0
- package/lang/translations/tk.po +10 -0
- package/lang/translations/tr.po +10 -0
- package/lang/translations/zh-cn.po +13 -4
- package/lang/translations/zh.po +9 -0
- package/package.json +3 -3
- package/src/commands/acceptallsuggestionscommand.js +1 -1
- package/src/commands/acceptselectedsuggestionscommand.js +1 -1
- package/src/commands/acceptsuggestioncommand.js +1 -1
- package/src/commands/discardallsuggestionscommand.js +1 -1
- package/src/commands/discardselectedsuggestionscommand.js +1 -1
- package/src/commands/discardsuggestioncommand.js +1 -1
- package/src/commands/trackchangescommand.js +1 -1
- package/src/integrations/alignment.js +1 -1
- package/src/integrations/basicstyles.js +1 -1
- package/src/integrations/blockquote.js +1 -1
- package/src/integrations/ckbox.js +23 -0
- package/src/integrations/codeblock.js +1 -1
- package/src/integrations/comments.js +1 -1
- package/src/integrations/deletecommand.js +1 -1
- package/src/integrations/entercommand.js +1 -1
- package/src/integrations/font.js +1 -1
- package/src/integrations/heading.js +1 -1
- package/src/integrations/highlight.js +1 -1
- package/src/integrations/horizontalline.js +1 -1
- package/src/integrations/htmlembed.js +23 -0
- package/src/integrations/image.js +1 -1
- package/src/integrations/indent.js +1 -1
- package/src/integrations/inputcommand.js +1 -1
- package/src/integrations/link.js +1 -1
- package/src/integrations/list.js +1 -1
- package/src/integrations/mediaembed.js +1 -1
- package/src/integrations/mention.js +1 -1
- package/src/integrations/pagebreak.js +1 -1
- package/src/integrations/paragraph.js +1 -1
- package/src/integrations/removeformat.js +1 -1
- package/src/integrations/restrictededitingmode.js +1 -1
- package/src/integrations/shiftentercommand.js +1 -1
- package/src/integrations/standardeditingmode.js +1 -1
- package/src/integrations/table.js +1 -1
- package/src/integrations/tableclipboard.js +1 -1
- package/src/integrations/tableheadings.js +1 -1
- package/src/integrations/tablemergesplit.js +1 -1
- package/src/integrations/title.js +1 -1
- package/src/integrations/undo.js +1 -1
- package/src/integrations/utils.js +1 -1
- package/src/suggestion.js +1 -1
- package/src/suggestiondescriptionfactory.js +1 -1
- package/src/trackchanges.js +1 -1
- package/src/trackchangesdata.js +1 -1
- package/src/trackchangesediting.js +1 -1
- package/src/trackchangesui.js +1 -1
- package/src/ui/suggestioncontroller.js +1 -1
- package/src/ui/view/basesuggestionthreadview.js +1 -1
- package/src/ui/view/suggestionthreadview.js +1 -1
- package/src/utils/common-translations.js +23 -0
- package/src/utils/getrangesofblockgroups.js +23 -0
- package/src/utils/getselectedsuggestions.js +1 -1
- package/src/utils/hashobject.js +1 -1
- package/src/utils/normalizedescription.js +1 -1
- package/src/utils/sortsuggestions.js +1 -1
- package/theme/integrations/horizontalline.css +0 -15
- package/theme/integrations/image.css +0 -55
- package/theme/integrations/mediaembed.css +0 -19
- package/theme/integrations/pagebreak.css +0 -15
- package/theme/integrations/table.css +0 -147
- package/theme/suggestion.css +0 -87
- package/theme/suggestionmarker.css +0 -161
package/build/track-changes.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
!function(
|
|
1
|
+
!function(t){const e=t.en=t.en||{};e.dictionary=Object.assign(e.dictionary||{},{"*Change %0 content*":"*Change %0 content*","*Change to:* %0":"*Change to:* %0","*Check item*":"*Check item*","*Format:* %0":"*Format:* %0","*Indent:* %0":"*Indent:* %0","*Insert:* %0":"*Insert:* %0","*Merge cells*":"*Merge cells*","*Merge:* %0":"*Merge:* %0","*Outdent:* %0":"*Outdent:* %0","*Remove all formatting*":"*Remove all formatting*","*Remove format:* %0":"*Remove format:* %0","*Remove highlight*":"*Remove highlight*","*Remove image text alternative*":"*Remove image text alternative*","*Remove link*":"*Remove link*","*Remove:* %0":"*Remove:* %0","*Replace table cells*":"*Replace table cells*","*Reset font background color*":"*Reset font background color*","*Reset font color*":"*Reset font color*","*Reset font family*":"*Reset font family*","*Reset font size*":"*Reset font size*","*Reset image width*":"*Reset image width*","*Set font background color:* %0":"*Set font background color:* %0","*Set font color:* %0":"*Set font color:* %0","*Set font family:* %0":"*Set font family:* %0","*Set font size:* %0":"*Set font size:* %0","*Set highlight:* %0":"*Set highlight:* %0","*Set image text alternative:* %0":"*Set image text alternative:* %0","*Set image width:* %0":"*Set image width:* %0","*Set link:* %0":"*Set link:* %0","*Split cell:* horizontally":"*Split cell:* horizontally","*Split cell:* vertically":"*Split cell:* vertically","*Split:* %0":"*Split:* %0","*Uncheck item*":"*Uncheck item*","Accept all selected suggestions":"Accept all selected suggestions","Accept all suggestions":"Accept all suggestions","Accept suggestion":"Accept suggestion","Discard all selected suggestions":"Discard all selected suggestions","Discard all suggestions":"Discard all suggestions","Discard suggestion":"Discard suggestion",ELEMENT_BLOCK_QUOTE:"block quote",ELEMENT_BULLETED_LIST:"bulleted list",ELEMENT_CAPTION:"caption",ELEMENT_CODE_BLOCK:["code block","%0 code blocks"],ELEMENT_HEADING:["heading (level %1)","%0 headings (level %1)"],ELEMENT_HEADING_CUSTOM:["heading (%1)","%0 headings (%1)"],ELEMENT_HORIZONTAL_LINE:["horizontal line","%0 horizontal lines"],ELEMENT_HTML_EMBED:["HTML embed","%0 HTML embeds"],ELEMENT_IMAGE:["image","%0 images"],ELEMENT_INLINE_IMAGE:["image","%0 images"],ELEMENT_LINE_BREAK:["line break","%0 line breaks"],ELEMENT_LIST_ITEM:["list item","%0 list items"],ELEMENT_MEDIA:["media item","%0 media items"],ELEMENT_NUMBERED_LIST:"numbered list",ELEMENT_PAGE_BREAK:["page break","%0 page breaks"],ELEMENT_PARAGRAPH:["paragraph","%0 paragraphs"],ELEMENT_SPACE:["space","%0 spaces"],ELEMENT_TABLE:["table","%0 tables"],ELEMENT_TABLE_COLUMN:["table column","%0 table columns"],ELEMENT_TABLE_COLUMN_WITH_TEXT:["table column *with text* %1","%0 table columns *with text* %1"],ELEMENT_TABLE_ROW:["table row","%0 table rows"],ELEMENT_TABLE_ROW_WITH_TEXT:["table row *with text* %1","%0 table rows *with text* %1"],ELEMENT_TABLE_WITH_TEXT:"table *with text* %0",ELEMENT_TITLE:"title",ELEMENT_TODO_LIST:"to-do list",FORMAT_ALIGN_TO_CENTER:"align to center",FORMAT_ALIGN_TO_LEFT:"align to left",FORMAT_ALIGN_TO_RIGHT:"align to right",FORMAT_BOLD:"bold",FORMAT_CODE:"code",FORMAT_HEADER_COLUMN:"header column",FORMAT_HEADER_ROW:"header row",FORMAT_HIGHLIGHT:"highlight",FORMAT_ITALIC:"italic",FORMAT_JUSTIFY_TEXT:"justify",FORMAT_REGULAR_COLUMN:"regular column",FORMAT_REGULAR_ROW:"regular row",FORMAT_RESTRICTED_DISABLED:"*Disable in restricted editing mode*",FORMAT_RESTRICTED_ENABLED:"*Enable in restricted editing mode*",FORMAT_SIDE_IMAGE:"side image",FORMAT_STRIKETHROUGH:"strikethrough",FORMAT_SUBSCRIPT:"subscript",FORMAT_SUPERSCRIPT:"superscript",FORMAT_UNDERLINE:"underline",PENDING_ACTION_SUGGESTION:"Unsaved change in suggestion.",REPLACE_TEXT:"*Replace:* %0 *with* %1","Track changes":"Track changes"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})),
|
|
2
2
|
/*!
|
|
3
3
|
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
|
|
4
4
|
* For licensing, see LICENSE.md.
|
|
5
|
-
*/(()=>{var e={596:e=>{e.exports='\x3c!--\n\n What you\'re currently looking at is the source code of a legally protected, proprietary software.\n CKEditor 5 Collaboration is licensed under a commercial license and protected by copyright law. Where not otherwise indicated,\n all CKEditor 5 Collaboration content is authored by CKSource engineers and consists of CKSource-owned intellectual property.\n\n Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n\n!--\x3e\n\n<svg viewBox="0 0 20 20" width="20" height="20" xmlns="http://www.w3.org/2000/svg"><g fill="#000" fill-rule="nonzero"><path d="M1 3.28C1 2.574 1.574 2 2.272 2h10.23c.703 0 1.272.573 1.272 1.28v12.768c0 .708-.574 1.281-1.271 1.281H2.272A1.276 1.276 0 0 1 1 16.049V3.28zm11.503 12.954c-.008 0-.006-12.77-.006-12.77 0-.003-10.225-.004-10.225-.004.007 0 .005 12.77.005 12.77 0 .003 10.226.004 10.226.004zm-8.31-9.58c0-.353.292-.64.636-.64h5.116c.351 0 .636.284.636.64a.641.641 0 0 1-.636.638H4.829a.636.636 0 0 1-.635-.639zm0 2.554c0-.352.292-.638.636-.638h5.116c.351 0 .636.283.636.638a.641.641 0 0 1-.636.639H4.829a.636.636 0 0 1-.635-.639zm0 2.555c0-.353.289-.639.633-.639h2.567c.35 0 .633.284.633.64a.639.639 0 0 1-.633.638H4.826a.634.634 0 0 1-.632-.639z"/><path d="M10.515 17.958l.154-.23c-.195-.099-.304-.193-.328-.28-.024-.09.001-.275.076-.552.062-.165.099-.296.111-.393.013-.159.013-.319 0-.478-.138-.41-.2-.686-.187-.83.013-.145.117-.335.313-.57l4.465-6.208c.356-.6 1.059-.56 2.11.119 1.051.68 1.443 1.271 1.177 1.771L14.53 17.14c-.105.271-.22.444-.347.516-.128.07-.399.118-.813.138a2.954 2.954 0 0 0-.487.21 2.044 2.044 0 0 0-.347.31c-.193.174-.332.262-.416.262-.064 0-.178-.05-.346-.15l-.204.27-1.056-.738h.001zm-.184.274l1.039.727-.259.34H9.614l.717-1.067z"/></g></svg>\n'},152:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var o=n(758),r=n.n(o)()((function(e){return e[1]}));r.push([e.id,".ck-content .ck-suggestion-marker-deletion.ck-widget.ck-horizontal-line{background-color:var(--ck-color-suggestion-widget-deletion-background)}.ck-content .ck-suggestion-marker-deletion.ck-widget.ck-horizontal-line.ck-suggestion-marker--active{background-color:var(--ck-color-suggestion-widget-deletion-background-active)}.ck-content .ck-suggestion-marker-insertion.ck-widget.ck-horizontal-line{background-color:var(--ck-color-suggestion-widget-insertion-background)}.ck-content .ck-suggestion-marker-insertion.ck-widget.ck-horizontal-line.ck-suggestion-marker--active{background-color:var(--ck-color-suggestion-widget-insertion-background-active)}",""]);const i=r},413:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var o=n(758),r=n.n(o)()((function(e){return e[1]}));r.push([e.id,".ck-content .ck-suggestion-marker-deletion.ck-widget.image{background-color:var(--ck-color-suggestion-widget-deletion-background)}.ck-content .ck-suggestion-marker-deletion.ck-widget.image img{opacity:.6}.ck-content .ck-suggestion-marker-deletion.ck-widget.image figcaption{background-color:var(--ck-color-suggestion-widget-deletion-background)}.ck-content .ck-suggestion-marker-deletion.ck-widget.image.ck-suggestion-marker--active,.ck-content .ck-suggestion-marker-deletion.ck-widget.image.ck-suggestion-marker--active figcaption{background-color:var(--ck-color-suggestion-widget-deletion-background-active)}.ck-content .ck-suggestion-marker-insertion.ck-widget.image,.ck-content .ck-suggestion-marker-insertion.ck-widget.image figcaption{background-color:var(--ck-color-suggestion-widget-insertion-background)}.ck-content .ck-suggestion-marker-insertion.ck-widget.image.ck-suggestion-marker--active,.ck-content .ck-suggestion-marker-insertion.ck-widget.image.ck-suggestion-marker--active figcaption{background-color:var(--ck-color-suggestion-widget-insertion-background-active)}.ck-content .ck-widget.image>figcaption.ck-suggestion-marker-deletion{background-color:var(--ck-color-suggestion-widget-deletion-background);border:none}.ck-content .ck-widget.image>figcaption.ck-suggestion-marker-deletion.ck-suggestion-marker--active{background-color:var(--ck-color-suggestion-widget-deletion-background-active)}.ck-content .ck-widget.image>figcaption.ck-suggestion-marker-insertion{background-color:var(--ck-color-suggestion-widget-insertion-background);border:none}.ck-content .ck-widget.image>figcaption.ck-suggestion-marker-insertion.ck-suggestion-marker--active{background-color:var(--ck-color-suggestion-widget-insertion-background-active)}",""]);const i=r},943:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var o=n(758),r=n.n(o)()((function(e){return e[1]}));r.push([e.id,".ck-content .ck-suggestion-marker-deletion.ck-widget.media{background-color:var(--ck-color-suggestion-widget-deletion-background)}.ck-content .ck-suggestion-marker-deletion.ck-widget.media .ck-media__wrapper{opacity:.6}.ck-content .ck-suggestion-marker-deletion.ck-widget.media.ck-suggestion-marker--active{background-color:var(--ck-color-suggestion-widget-deletion-background-active)}.ck-content .ck-suggestion-marker-insertion.ck-widget.media{background-color:var(--ck-color-suggestion-widget-insertion-background)}.ck-content .ck-suggestion-marker-insertion.ck-widget.media.ck-suggestion-marker--active{background-color:var(--ck-color-suggestion-widget-insertion-background-active)}",""]);const i=r},137:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var o=n(758),r=n.n(o)()((function(e){return e[1]}));r.push([e.id,".ck-content .ck-suggestion-marker-deletion.ck-widget.page-break{background-color:var(--ck-color-suggestion-widget-deletion-background)}.ck-content .ck-suggestion-marker-deletion.ck-widget.page-break.ck-suggestion-marker--active{background-color:var(--ck-color-suggestion-widget-deletion-background-active)}.ck-content .ck-suggestion-marker-insertion.ck-widget.page-break{background-color:var(--ck-color-suggestion-widget-insertion-background)}.ck-content .ck-suggestion-marker-insertion.ck-widget.page-break.ck-suggestion-marker--active{background-color:var(--ck-color-suggestion-widget-insertion-background-active)}",""]);const i=r},399:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var o=n(758),r=n.n(o)()((function(e){return e[1]}));r.push([e.id,":root{--ck-color-suggestion-widget-th-insertion-background:rgba(102,229,119,0.12);--ck-color-suggestion-widget-th-insertion-background-active:rgba(37,218,61,0.14);--ck-color-suggestion-widget-th-deletion-background:rgba(229,102,134,0.14);--ck-color-suggestion-widget-th-deletion-background-active:rgba(196,33,74,0.16)}.ck-content figure.table .ck-suggestion-marker-formatBlock{box-shadow:-3px 0 0 0 var(--ck-color-suggestion-marker-format-border)}.ck-content figure.table .ck-suggestion-marker-formatBlock.ck-suggestion-marker--active{box-shadow:-3px 0 0 0 var(--ck-color-suggestion-marker-format-border-active)}.ck-content .ck-suggestion-marker-insertion.table>table{border-color:var(--ck-color-suggestion-marker-insertion-border)}.ck-content .ck-suggestion-marker-insertion.table>table>tbody>tr>th,.ck-content .ck-suggestion-marker-insertion.table>table>thead>tr>th{background-color:var(--ck-color-suggestion-widget-th-insertion-background);border-color:var(--ck-color-suggestion-marker-insertion-border)}.ck-content .ck-suggestion-marker-insertion.table>table>tbody>tr>td{background-color:var(--ck-color-suggestion-widget-insertion-background);border-color:var(--ck-color-suggestion-marker-insertion-border)}.ck-content .ck-suggestion-marker-insertion.ck-suggestion-marker--active.table>table{border-color:var(--ck-color-suggestion-marker-insertion-border-active)}.ck-content .ck-suggestion-marker-insertion.ck-suggestion-marker--active.table>table>tbody>tr>th,.ck-content .ck-suggestion-marker-insertion.ck-suggestion-marker--active.table>table>thead>tr>th{background-color:var(--ck-color-suggestion-widget-th-insertion-background-active);border-color:var(--ck-color-suggestion-marker-insertion-border-active)}.ck-content .ck-suggestion-marker-insertion.ck-suggestion-marker--active.table>table>tbody>tr>td{background-color:var(--ck-color-suggestion-widget-insertion-background-active);border-color:var(--ck-color-suggestion-marker-insertion-border-active)}.ck-content .ck-suggestion-marker-deletion.table>table{border-color:var(--ck-color-suggestion-marker-deletion-border)}.ck-content .ck-suggestion-marker-deletion.table>table>tbody>tr>th,.ck-content .ck-suggestion-marker-deletion.table>table>thead>tr>th{background-color:var(--ck-color-suggestion-widget-th-deletion-background);border-color:var(--ck-color-suggestion-marker-deletion-border);text-decoration:none}.ck-content .ck-suggestion-marker-deletion.table>table>tbody>tr>td{background-color:var(--ck-color-suggestion-widget-deletion-background);border-color:var(--ck-color-suggestion-marker-deletion-border);text-decoration:none}.ck-content .ck-suggestion-marker-deletion.ck-suggestion-marker--active.table>table{border-color:var(--ck-color-suggestion-marker-deletion-border-active)}.ck-content .ck-suggestion-marker-deletion.ck-suggestion-marker--active.table>table>tbody>tr>th,.ck-content .ck-suggestion-marker-deletion.ck-suggestion-marker--active.table>table>thead>tr>th{background-color:var(--ck-color-suggestion-widget-th-deletion-background-active);border-color:var(--ck-color-suggestion-marker-deletion-border-active)}.ck-content .ck-suggestion-marker-deletion.ck-suggestion-marker--active.table>table>tbody>tr>td{background-color:var(--ck-color-suggestion-widget-deletion-background-active);border-color:var(--ck-color-suggestion-marker-deletion-border-active)}.ck-content .table th.ck-suggestion-marker-insertion{background-color:var(--ck-color-suggestion-widget-th-insertion-background)}.ck-content .table th.ck-suggestion-marker-insertion.ck-suggestion-marker--active{background-color:var(--ck-color-suggestion-widget-th-insertion-background-active)}.ck-content .table th.ck-suggestion-marker-deletion{background-color:var(--ck-color-suggestion-widget-th-deletion-background);text-decoration:none}.ck-content .table th.ck-suggestion-marker-deletion.ck-suggestion-marker--active{background-color:var(--ck-color-suggestion-widget-th-deletion-background-active)}.ck-content .table td.ck-suggestion-marker-insertion{background-color:var(--ck-color-suggestion-widget-insertion-background)}.ck-content .table td.ck-suggestion-marker-insertion.ck-suggestion-marker--active{background-color:var(--ck-color-suggestion-widget-insertion-background-active)}.ck-content .table td.ck-suggestion-marker-deletion{background-color:var(--ck-color-suggestion-widget-deletion-background);text-decoration:none}.ck-content .table td.ck-suggestion-marker-deletion.ck-suggestion-marker--active{background-color:var(--ck-color-suggestion-widget-deletion-background-active)}.ck-content .table td.ck-suggestion-marker-formatBlock,.ck-content .table td.ck-suggestion-marker-formatInline,.ck-content .table th.ck-suggestion-marker-formatBlock,.ck-content .table th.ck-suggestion-marker-formatInline{background-color:var(--ck-color-suggestion-widget-format-background);box-shadow:none}.ck-content .table td.ck-suggestion-marker-formatBlock.ck-suggestion-marker--active,.ck-content .table td.ck-suggestion-marker-formatInline.ck-suggestion-marker--active,.ck-content .table th.ck-suggestion-marker-formatBlock.ck-suggestion-marker--active,.ck-content .table th.ck-suggestion-marker-formatInline.ck-suggestion-marker--active{background-color:var(--ck-color-suggestion-widget-format-background-active);box-shadow:none}",""]);const i=r},477:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var o=n(758),r=n.n(o)()((function(e){return e[1]}));r.push([e.id,":root{--ck-color-comment-box-border:#f2de02;--ck-color-suggestion-box-deletion-border:#d85a79;--ck-color-suggestion-box-insertion-border:#5ad86b;--ck-color-suggestion-box-format-border:#5ac1d8}.ck .ck-suggestion{border-top-left-radius:var(--ck-border-radius)}.ck .ck-annotation{border-left:3px solid transparent}.ck .ck-suggestion--disabled-comments .ck-annotation{min-height:80px}.ck .ck-comment,.ck .ck-comment__input-container,.ck .ck-thread__comment-count{border-left:3px solid var(--ck-color-comment-box-border)}.ck .ck-suggestion-insertion .ck-suggestion{border-left-color:var(--ck-color-suggestion-box-insertion-border)}.ck .ck-suggestion-deletion .ck-suggestion{border-left-color:var(--ck-color-suggestion-box-deletion-border)}.ck .ck-suggestion-replace .ck-suggestion{border-left-color:var(--ck-color-suggestion-box-insertion-border)}.ck .ck-suggestion-format .ck-suggestion{border-left-color:var(--ck-color-suggestion-box-format-border)}.ck .ck-suggestion-wrapper{outline:0}.ck .ck-suggestion-type{font-weight:700}.ck .ck-suggestion-color{display:inline-block;width:14px;height:14px;border-radius:14px;vertical-align:text-bottom;margin:0 5px;box-shadow:0 0 0 1px #444}.ck .ck-suggestion-insertion .ck-comment,.ck .ck-suggestion-insertion .ck-comment__input-container,.ck .ck-suggestion-insertion .ck-thread__comment-count,.ck .ck-suggestion-replace .ck-comment,.ck .ck-suggestion-replace .ck-comment__input-container,.ck .ck-suggestion-replace .ck-thread__comment-count{border-left-color:var(--ck-color-suggestion-box-insertion-border)}.ck .ck-suggestion-deletion .ck-comment,.ck .ck-suggestion-deletion .ck-comment__input-container,.ck .ck-suggestion-deletion .ck-thread__comment-count{border-left-color:var(--ck-color-suggestion-box-deletion-border)}.ck .ck-suggestion-format .ck-comment,.ck .ck-suggestion-format .ck-comment__input-container,.ck .ck-suggestion-format .ck-thread__comment-count{border-left-color:var(--ck-color-suggestion-box-format-border)}",""]);const i=r},588:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var o=n(758),r=n.n(o)()((function(e){return e[1]}));r.push([e.id,':root{--ck-color-suggestion-marker-insertion-border:rgba(30,174,49,0.35);--ck-color-suggestion-marker-insertion-border-active:rgba(19,109,31,0.5);--ck-color-suggestion-marker-insertion-background:rgba(102,229,119,0.35);--ck-color-suggestion-marker-insertion-background-active:rgba(37,218,61,0.5);--ck-color-suggestion-marker-deletion-border:rgba(174,30,66,0.35);--ck-color-suggestion-marker-deletion-border-active:rgba(109,19,41,0.5);--ck-color-suggestion-marker-deletion-background:rgba(229,102,134,0.35);--ck-color-suggestion-marker-deletion-background-active:rgba(218,37,82,0.5);--ck-color-suggestion-marker-deletion-stroke:rgba(87,15,33,0.5);--ck-color-suggestion-marker-format-border:rgba(10,160,194,0.4);--ck-color-suggestion-marker-format-border-active:rgba(10,160,194,0.65);--ck-color-suggestion-widget-insertion-background:rgba(102,229,119,0.05);--ck-color-suggestion-widget-insertion-background-active:rgba(37,218,61,0.07);--ck-color-suggestion-widget-deletion-background:rgba(229,102,134,0.05);--ck-color-suggestion-widget-deletion-background-active:rgba(196,33,74,0.07);--ck-color-suggestion-widget-format-background:rgba(10,160,194,0.09);--ck-color-suggestion-widget-format-background-active:rgba(10,160,194,0.16)}.ck-content .ck-suggestion-marker-insertion{border-top:3px solid var(--ck-color-suggestion-marker-insertion-border);border-bottom:3px solid var(--ck-color-suggestion-marker-insertion-border);background:var(--ck-color-suggestion-marker-insertion-background)}.ck-content .ck-suggestion-marker-insertion.ck-suggestion-marker--active{border-color:var(--ck-color-suggestion-marker-insertion-border-active);background:var(--ck-color-suggestion-marker-insertion-background-active)}.ck-content .ck-suggestion-marker-insertion.ck-widget{background:none;text-decoration:none;border:3px solid var(--ck-color-suggestion-marker-insertion-border)}.ck-content .ck-suggestion-marker-insertion.ck-widget.ck-suggestion-marker--active{border-color:var(--ck-color-suggestion-marker-insertion-border-active)}.ck-content .ck-suggestion-marker-deletion{border-top:3px solid var(--ck-color-suggestion-marker-deletion-border);border-bottom:3px solid var(--ck-color-suggestion-marker-deletion-border);text-decoration:line-through;text-decoration-color:var(--ck-color-suggestion-marker-deletion-stroke);text-decoration-thickness:3px;background:var(--ck-color-suggestion-marker-deletion-background)}.ck-content .ck-suggestion-marker-deletion.ck-suggestion-marker--active{border-color:var(--ck-color-suggestion-marker-deletion-border-active);background:var(--ck-color-suggestion-marker-deletion-background-active)}.ck-content .ck-suggestion-marker-deletion.ck-widget{background:none;text-decoration:none;border:3px solid var(--ck-color-suggestion-marker-deletion-border)}.ck-content .ck-suggestion-marker-deletion.ck-widget.ck-suggestion-marker--active{border-color:var(--ck-color-suggestion-marker-deletion-border-active)}.ck-content .ck-suggestion-marker-merge:after{border-top:3px solid var(--ck-color-suggestion-marker-deletion-border);border-bottom:3px solid var(--ck-color-suggestion-marker-deletion-border);text-decoration:line-through;text-decoration-color:var(--ck-color-suggestion-marker-deletion-stroke);background:var(--ck-color-suggestion-marker-deletion-background);color:var(--ck-color-suggestion-marker-deletion-stroke);content:"¶"}.ck-content .ck-suggestion-marker-merge.ck-suggestion-marker--active:after{border-color:var(--ck-color-suggestion-marker-deletion-border-active);background:var(--ck-color-suggestion-marker-deletion-background-active)}.ck-content .ck-suggestion-marker-split:after{border-top:3px solid var(--ck-color-suggestion-marker-insertion-border);border-bottom:3px solid var(--ck-color-suggestion-marker-insertion-border);background:var(--ck-color-suggestion-marker-insertion-background);color:var(--ck-color-suggestion-marker-insertion-border);content:"¶"}.ck-content .ck-suggestion-marker-split.ck-suggestion-marker--active:after{border-color:var(--ck-color-suggestion-marker-insertion-border-active);background:var(--ck-color-suggestion-marker-insertion-background-active)}.ck-content .ck-suggestion-marker-formatInline{border-top:3px solid var(--ck-color-suggestion-marker-format-border);border-bottom:3px solid var(--ck-color-suggestion-marker-format-border)}.ck-content .ck-suggestion-marker-formatInline.ck-suggestion-marker--active{border-color:var(--ck-color-suggestion-marker-format-border-active)}.ck-content .ck-suggestion-marker-formatInline.ck-widget{background:none;border:3px solid var(--ck-color-suggestion-marker-format-border)}.ck-content .ck-suggestion-marker-formatInline.ck-widget.ck-suggestion-marker--active{border-color:var(--ck-color-suggestion-marker-format-border-active)}.ck-content .ck-suggestion-marker-formatBlock{border:0;background:none;box-shadow:-7px 0 0 0 var(--ck-color-base-background),-10px 0 0 0 var(--ck-color-suggestion-marker-format-border)}.ck-content .ck-suggestion-marker-formatBlock.ck-suggestion-marker--active{box-shadow:-5px 0 0 0 var(--ck-color-base-background),-8px 0 0 0 var(--ck-color-suggestion-marker-format-border-active)}.ck-content ol .ck-suggestion-marker-formatBlock,.ck-content ul .ck-suggestion-marker-formatBlock{box-shadow:-2px 0 0 0 var(--ck-color-base-background),-5px 0 0 0 var(--ck-color-suggestion-marker-format-border)}.ck-content ol .ck-suggestion-marker-formatBlock.ck-suggestion-marker--active,.ck-content ul .ck-suggestion-marker-formatBlock.ck-suggestion-marker--active{box-shadow:-2px 0 0 0 var(--ck-color-base-background),-5px 0 0 0 var(--ck-color-suggestion-marker-format-border-active)}',""]);const i=r},758:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,o){"string"==typeof e&&(e=[[null,e,""]]);var r={};if(o)for(var i=0;i<this.length;i++){var s=this[i][0];null!=s&&(r[s]=!0)}for(var a=0;a<e.length;a++){var c=[].concat(e[a]);o&&r[c[0]]||(n&&(c[2]?c[2]="".concat(n," and ").concat(c[2]):c[2]=n),t.push(c))}},t}},278:(e,t,n)=>{"use strict";var o,r=function(){return void 0===o&&(o=Boolean(window&&document&&document.all&&!window.atob)),o},i=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),s=[];function a(e){for(var t=-1,n=0;n<s.length;n++)if(s[n].identifier===e){t=n;break}return t}function c(e,t){for(var n={},o=[],r=0;r<e.length;r++){var i=e[r],c=t.base?i[0]+t.base:i[0],l=n[c]||0,g="".concat(c," ").concat(l);n[c]=l+1;var u=a(g),d={css:i[1],media:i[2],sourceMap:i[3]};-1!==u?(s[u].references++,s[u].updater(d)):s.push({identifier:g,updater:p(d,t),references:1}),o.push(g)}return o}function l(e){var t=document.createElement("style"),o=e.attributes||{};if(void 0===o.nonce){var r=n.nc;r&&(o.nonce=r)}if(Object.keys(o).forEach((function(e){t.setAttribute(e,o[e])})),"function"==typeof e.insert)e.insert(t);else{var s=i(e.insert||"head");if(!s)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");s.appendChild(t)}return t}var g,u=(g=[],function(e,t){return g[e]=t,g.filter(Boolean).join("\n")});function d(e,t,n,o){var r=n?"":o.media?"@media ".concat(o.media," {").concat(o.css,"}"):o.css;if(e.styleSheet)e.styleSheet.cssText=u(t,r);else{var i=document.createTextNode(r),s=e.childNodes;s[t]&&e.removeChild(s[t]),s.length?e.insertBefore(i,s[t]):e.appendChild(i)}}function m(e,t,n){var o=n.css,r=n.media,i=n.sourceMap;if(r?e.setAttribute("media",r):e.removeAttribute("media"),i&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleSheet)e.styleSheet.cssText=o;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(o))}}var f=null,h=0;function p(e,t){var n,o,r;if(t.singleton){var i=h++;n=f||(f=l(t)),o=d.bind(null,n,i,!1),r=d.bind(null,n,i,!0)}else n=l(t),o=m.bind(null,n,t),r=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)};return o(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;o(e=t)}else r()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=r());var n=c(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var o=0;o<n.length;o++){var r=a(n[o]);s[r].references--}for(var i=c(e,t),l=0;l<n.length;l++){var g=a(n[l]);0===s[g].references&&(s[g].updater(),s.splice(g,1))}n=i}}}},417:(e,t,n)=>{e.exports=n(720)("./src/collaboration-core.js")},704:(e,t,n)=>{e.exports=n(79)("./src/core.js")},492:(e,t,n)=>{e.exports=n(79)("./src/engine.js")},331:(e,t,n)=>{e.exports=n(79)("./src/enter.js")},181:(e,t,n)=>{e.exports=n(79)("./src/typing.js")},273:(e,t,n)=>{e.exports=n(79)("./src/ui.js")},209:(e,t,n)=>{e.exports=n(79)("./src/utils.js")},995:(e,t,n)=>{e.exports=n(79)("./src/widget.js")},720:e=>{"use strict";e.exports=CKEditor5.collaborationDll},79:e=>{"use strict";e.exports=CKEditor5.dll}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={id:o,exports:{}};return e[o](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};(()=>{"use strict";n.r(o),n.d(o,{BaseSuggestionThreadView:()=>Is,TrackChanges:()=>ea,TrackChangesData:()=>aa});var e=n(704),t=n(209),r=n(273),i=n(417),s=n(492),a=n(995);const c=["affectsData","refresh","_enabledCommands","value","forceDisabled","execute","TrackChangesCommand","isEnabled","_disableUnsupportedCommands","commands","editor","has"];var l,g;l=c,g=142,function(e){for(;--e;)l.push(l.shift())}(++g);const u=function(e,t){return c[e-=0]};class d extends e.Command{constructor(e,t){super(e),this[u("0x4")]=t,this.value=!1,this.refresh()}[u("0x3")](){this[u("0x9")]=!0}[u("0x7")](){this.value=!this[u("0x5")],this.value?this[u("0xa")]():this._enableCommands()}[u("0xa")](){for(const e of this[u("0x0")].commands[u("0xb")]())e[u("0x2")]&&!this[u("0x4")][u("0x1")](e)&&e[u("0x6")](u("0x8"))}_enableCommands(){for(const e of this[u("0x0")][u("0xb")][u("0xb")]())e[u("0x2")]&&!this[u("0x4")][u("0x1")](e)&&e.clearForceDisabled("TrackChangesCommand")}}const m=["refresh","isEnabled","get","TrackChangesEditing","acceptSuggestion","_suggestions","track-changes-accept-suggestion-not-found","plugins","execute"];var f,h;f=m,h=408,function(e){for(;--e;)f.push(f.shift())}(++h);const p=function(e,t){return m[e-=0]};class k extends e.Command{constructor(e,t){super(e),this[p("0x2")]=t,this.refresh()}[p("0x6")](){this[p("0x7")]=!0}[p("0x5")](e){const n=this[p("0x2")].get(e);if(!n)throw new t.CKEditorError(p("0x3"),this);this.editor[p("0x4")][p("0x8")](p("0x0"))[p("0x1")](n)}}const b=["refresh","discardSuggestion","get","_suggestions","plugins","TrackChangesEditing","isEnabled"];var x,y;x=b,y=276,function(e){for(;--e;)x.push(x.shift())}(++y);const v=function(e,t){return b[e-=0]};class C extends e.Command{constructor(e,t){super(e),this[v("0x0")]=t,this[v("0x4")]()}[v("0x4")](){this[v("0x3")]=!0}execute(e){const n=this[v("0x0")][v("0x6")](e);if(!n)throw new t.CKEditorError("track-changes-discard-suggestion-not-found",this);this.editor[v("0x1")][v("0x6")](v("0x2"))[v("0x5")](n)}}var _,E,T=["sort","deletion","type"];_=T,E=390,function(e){for(;--e;)_.push(_.shift())}(++E);var w=function(e,t){return T[e-=0]};function S(e){return e[w("0x0")](((e,t)=>w("0x1")==e[w("0x2")]&&w("0x1")!=t[w("0x2")]?-1:"deletion"!=e.type&&w("0x1")==t[w("0x2")]?1:0))}const R=["isEnabled","editor","change","refresh","model","_acceptSuggestionCommand","isInContent","execute","_suggestions","from","some","values"];var A,I;A=R,I=448,function(e){for(;--e;)A.push(A.shift())}(++I);const M=function(e,t){return R[e-=0]};class N extends e.Command{constructor(e,t,n){super(e),this[M("0x1")]=t,this[M("0x4")]=n,this.refresh()}[M("0xb")](){const e=this[M("0x1")];this.isEnabled=e[M("0x8")]&&Array[M("0x5")](this[M("0x4")][M("0x7")]())[M("0x6")]((e=>e[M("0x2")]))}[M("0x3")](){this[M("0x9")][M("0x0")][M("0xa")]((()=>{const e=S(Array[M("0x5")](this._suggestions[M("0x7")]()));for(const t of e)t.isInContent&&this[M("0x1")][M("0x3")](t.id)}))}}const F=["getRanges","getRange","add","isInContent","isCollapsed","isIntersecting","from","start","next","isTouching","getMarkers"];var P,O;P=F,O=355,function(e){for(;--e;)P.push(P.shift())}(++O);const L=function(e,t){return F[e-=0]};function B(e,t){const n=Array[L("0x3")](e[L("0x8")]()),o=new Set;for(const r of t)if(r[L("0x0")])for(const t of n)for(const n of r[L("0x7")]()){const i=n[L("0x9")]();(t[L("0x2")](i)||e[L("0x1")]&&!r.isMultiRange&&r[L("0x5")]&&i.end[L("0x6")](t[L("0x4")]))&&o[L("0xa")](r)}return o}const j=["editor","_suggestions","from","execute","size","selection","isEnabled","model","document","_acceptSuggestionCommand","_selectedSuggestions","refresh","change","values"];var D,U;D=j,U=410,function(e){for(;--e;)D.push(D.shift())}(++U);const H=function(e,t){return j[e-=0]};class V extends e.Command{constructor(e,t,n){super(e),this[H("0x5")]=t,this[H("0xb")]=n,this._selectedSuggestions=new Set,this[H("0x7")]()}[H("0x7")](){const e=this[H("0x5")],t=this[H("0xa")].model[H("0x4")][H("0x1")],n=Array.from(this[H("0xb")][H("0x9")]());this[H("0x6")]=B(t,n),this.isEnabled=e[H("0x2")]&&!!this[H("0x6")][H("0x0")]}[H("0xd")](){this[H("0xa")][H("0x3")][H("0x8")]((()=>{const e=S(Array[H("0xc")](this[H("0x6")]));for(const t of e)this._acceptSuggestionCommand[H("0xd")](t.id)}))}}const z=["some","from","editor","refresh","change","isEnabled","_suggestions","_discardSuggestionCommand","isInContent","values","execute"];var G,W;G=z,W=258,function(e){for(;--e;)G.push(G.shift())}(++W);const q=function(e,t){return z[e-=0]};class $ extends e.Command{constructor(e,t,n){super(e),this[q("0x2")]=t,this[q("0x1")]=n,this[q("0x9")]()}refresh(){const e=this[q("0x2")];this.isEnabled=e[q("0x0")]&&Array[q("0x7")](this._suggestions[q("0x4")]())[q("0x6")]((e=>e[q("0x3")]))}execute(){this[q("0x8")].model[q("0xa")]((()=>{for(const e of this[q("0x1")][q("0x4")]())e[q("0x3")]&&this._discardSuggestionCommand[q("0x5")](e.id)}))}}const K=["_discardSuggestionCommand","values","isEnabled","editor","_selectedSuggestions","model","refresh","change","size","from","_suggestions","execute"];var Z,X;Z=K,X=126,function(e){for(;--e;)Z.push(Z.shift())}(++X);const Q=function(e,t){return K[e-=0]};class J extends e.Command{constructor(e,t,n){super(e),this[Q("0x6")]=t,this[Q("0x4")]=n,this._selectedSuggestions=new Set,this.refresh()}[Q("0x0")](){const e=this._discardSuggestionCommand,t=this[Q("0x9")][Q("0xb")].document.selection,n=Array[Q("0x3")](this[Q("0x4")][Q("0x7")]());this[Q("0xa")]=B(t,n),this[Q("0x8")]=e.isEnabled&&!!this[Q("0xa")][Q("0x2")]}[Q("0x5")](){this[Q("0x9")][Q("0xb")][Q("0x1")]((()=>{for(const e of this[Q("0xa")])this[Q("0x6")][Q("0x5")](e.id)}))}}const Y=function(){this.__data__=[],this.size=0};const ee=function(e,t){return e===t||e!=e&&t!=t};const te=function(e,t){for(var n=e.length;n--;)if(ee(e[n][0],t))return n;return-1};var ne=Array.prototype.splice;const oe=function(e){var t=this.__data__,n=te(t,e);return!(n<0)&&(n==t.length-1?t.pop():ne.call(t,n,1),--this.size,!0)};const re=function(e){var t=this.__data__,n=te(t,e);return n<0?void 0:t[n][1]};const ie=function(e){return te(this.__data__,e)>-1};const se=function(e,t){var n=this.__data__,o=te(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this};function ae(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}ae.prototype.clear=Y,ae.prototype.delete=oe,ae.prototype.get=re,ae.prototype.has=ie,ae.prototype.set=se;const ce=ae;const le=function(){this.__data__=new ce,this.size=0};const ge=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n};const ue=function(e){return this.__data__.get(e)};const de=function(e){return this.__data__.has(e)};const me="object"==typeof global&&global&&global.Object===Object&&global;var fe="object"==typeof self&&self&&self.Object===Object&&self;const he=me||fe||Function("return this")();const pe=he.Symbol;var ke=Object.prototype,be=ke.hasOwnProperty,xe=ke.toString,ye=pe?pe.toStringTag:void 0;const ve=function(e){var t=be.call(e,ye),n=e[ye];try{e[ye]=void 0;var o=!0}catch(e){}var r=xe.call(e);return o&&(t?e[ye]=n:delete e[ye]),r};var Ce=Object.prototype.toString;const _e=function(e){return Ce.call(e)};var Ee=pe?pe.toStringTag:void 0;const Te=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Ee&&Ee in Object(e)?ve(e):_e(e)};const we=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};const Se=function(e){if(!we(e))return!1;var t=Te(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t};const Re=he["__core-js_shared__"];var Ae,Ie=(Ae=/[^.]+$/.exec(Re&&Re.keys&&Re.keys.IE_PROTO||""))?"Symbol(src)_1."+Ae:"";const Me=function(e){return!!Ie&&Ie in e};var Ne=Function.prototype.toString;const Fe=function(e){if(null!=e){try{return Ne.call(e)}catch(e){}try{return e+""}catch(e){}}return""};var Pe=/^\[object .+?Constructor\]$/,Oe=Function.prototype,Le=Object.prototype,Be=Oe.toString,je=Le.hasOwnProperty,De=RegExp("^"+Be.call(je).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const Ue=function(e){return!(!we(e)||Me(e))&&(Se(e)?De:Pe).test(Fe(e))};const He=function(e,t){return null==e?void 0:e[t]};const Ve=function(e,t){var n=He(e,t);return Ue(n)?n:void 0};const ze=Ve(he,"Map");const Ge=Ve(Object,"create");const We=function(){this.__data__=Ge?Ge(null):{},this.size=0};const qe=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t};var $e=Object.prototype.hasOwnProperty;const Ke=function(e){var t=this.__data__;if(Ge){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return $e.call(t,e)?t[e]:void 0};var Ze=Object.prototype.hasOwnProperty;const Xe=function(e){var t=this.__data__;return Ge?void 0!==t[e]:Ze.call(t,e)};const Qe=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ge&&void 0===t?"__lodash_hash_undefined__":t,this};function Je(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}Je.prototype.clear=We,Je.prototype.delete=qe,Je.prototype.get=Ke,Je.prototype.has=Xe,Je.prototype.set=Qe;const Ye=Je;const et=function(){this.size=0,this.__data__={hash:new Ye,map:new(ze||ce),string:new Ye}};const tt=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};const nt=function(e,t){var n=e.__data__;return tt(t)?n["string"==typeof t?"string":"hash"]:n.map};const ot=function(e){var t=nt(this,e).delete(e);return this.size-=t?1:0,t};const rt=function(e){return nt(this,e).get(e)};const it=function(e){return nt(this,e).has(e)};const st=function(e,t){var n=nt(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this};function at(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}at.prototype.clear=et,at.prototype.delete=ot,at.prototype.get=rt,at.prototype.has=it,at.prototype.set=st;const ct=at;const lt=function(e,t){var n=this.__data__;if(n instanceof ce){var o=n.__data__;if(!ze||o.length<199)return o.push([e,t]),this.size=++n.size,this;n=this.__data__=new ct(o)}return n.set(e,t),this.size=n.size,this};function gt(e){var t=this.__data__=new ce(e);this.size=t.size}gt.prototype.clear=le,gt.prototype.delete=ge,gt.prototype.get=ue,gt.prototype.has=de,gt.prototype.set=lt;const ut=gt;const dt=function(e,t){for(var n=-1,o=null==e?0:e.length;++n<o&&!1!==t(e[n],n,e););return e};const mt=function(){try{var e=Ve(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();const ft=function(e,t,n){"__proto__"==t&&mt?mt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n};var ht=Object.prototype.hasOwnProperty;const pt=function(e,t,n){var o=e[t];ht.call(e,t)&&ee(o,n)&&(void 0!==n||t in e)||ft(e,t,n)};const kt=function(e,t,n,o){var r=!n;n||(n={});for(var i=-1,s=t.length;++i<s;){var a=t[i],c=o?o(n[a],e[a],a,n,e):void 0;void 0===c&&(c=e[a]),r?ft(n,a,c):pt(n,a,c)}return n};const bt=function(e,t){for(var n=-1,o=Array(e);++n<e;)o[n]=t(n);return o};const xt=function(e){return null!=e&&"object"==typeof e};const yt=function(e){return xt(e)&&"[object Arguments]"==Te(e)};var vt=Object.prototype,Ct=vt.hasOwnProperty,_t=vt.propertyIsEnumerable;const Et=yt(function(){return arguments}())?yt:function(e){return xt(e)&&Ct.call(e,"callee")&&!_t.call(e,"callee")};const Tt=Array.isArray;const wt=function(){return!1};var St="object"==typeof exports&&exports&&!exports.nodeType&&exports,Rt=St&&"object"==typeof module&&module&&!module.nodeType&&module,At=Rt&&Rt.exports===St?he.Buffer:void 0;const It=(At?At.isBuffer:void 0)||wt;var Mt=/^(?:0|[1-9]\d*)$/;const Nt=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&Mt.test(e))&&e>-1&&e%1==0&&e<t};const Ft=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var Pt={};Pt["[object Float32Array]"]=Pt["[object Float64Array]"]=Pt["[object Int8Array]"]=Pt["[object Int16Array]"]=Pt["[object Int32Array]"]=Pt["[object Uint8Array]"]=Pt["[object Uint8ClampedArray]"]=Pt["[object Uint16Array]"]=Pt["[object Uint32Array]"]=!0,Pt["[object Arguments]"]=Pt["[object Array]"]=Pt["[object ArrayBuffer]"]=Pt["[object Boolean]"]=Pt["[object DataView]"]=Pt["[object Date]"]=Pt["[object Error]"]=Pt["[object Function]"]=Pt["[object Map]"]=Pt["[object Number]"]=Pt["[object Object]"]=Pt["[object RegExp]"]=Pt["[object Set]"]=Pt["[object String]"]=Pt["[object WeakMap]"]=!1;const Ot=function(e){return xt(e)&&Ft(e.length)&&!!Pt[Te(e)]};const Lt=function(e){return function(t){return e(t)}};var Bt="object"==typeof exports&&exports&&!exports.nodeType&&exports,jt=Bt&&"object"==typeof module&&module&&!module.nodeType&&module,Dt=jt&&jt.exports===Bt&&me.process;const Ut=function(){try{var e=jt&&jt.require&&jt.require("util").types;return e||Dt&&Dt.binding&&Dt.binding("util")}catch(e){}}();var Ht=Ut&&Ut.isTypedArray;const Vt=Ht?Lt(Ht):Ot;var zt=Object.prototype.hasOwnProperty;const Gt=function(e,t){var n=Tt(e),o=!n&&Et(e),r=!n&&!o&&It(e),i=!n&&!o&&!r&&Vt(e),s=n||o||r||i,a=s?bt(e.length,String):[],c=a.length;for(var l in e)!t&&!zt.call(e,l)||s&&("length"==l||r&&("offset"==l||"parent"==l)||i&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||Nt(l,c))||a.push(l);return a};var Wt=Object.prototype;const qt=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Wt)};const $t=function(e,t){return function(n){return e(t(n))}};const Kt=$t(Object.keys,Object);var Zt=Object.prototype.hasOwnProperty;const Xt=function(e){if(!qt(e))return Kt(e);var t=[];for(var n in Object(e))Zt.call(e,n)&&"constructor"!=n&&t.push(n);return t};const Qt=function(e){return null!=e&&Ft(e.length)&&!Se(e)};const Jt=function(e){return Qt(e)?Gt(e):Xt(e)};const Yt=function(e,t){return e&&kt(t,Jt(t),e)};const en=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t};var tn=Object.prototype.hasOwnProperty;const nn=function(e){if(!we(e))return en(e);var t=qt(e),n=[];for(var o in e)("constructor"!=o||!t&&tn.call(e,o))&&n.push(o);return n};const on=function(e){return Qt(e)?Gt(e,!0):nn(e)};const rn=function(e,t){return e&&kt(t,on(t),e)};var sn="object"==typeof exports&&exports&&!exports.nodeType&&exports,an=sn&&"object"==typeof module&&module&&!module.nodeType&&module,cn=an&&an.exports===sn?he.Buffer:void 0,ln=cn?cn.allocUnsafe:void 0;const gn=function(e,t){if(t)return e.slice();var n=e.length,o=ln?ln(n):new e.constructor(n);return e.copy(o),o};const un=function(e,t){var n=-1,o=e.length;for(t||(t=Array(o));++n<o;)t[n]=e[n];return t};const dn=function(e,t){for(var n=-1,o=null==e?0:e.length,r=0,i=[];++n<o;){var s=e[n];t(s,n,e)&&(i[r++]=s)}return i};const mn=function(){return[]};var fn=Object.prototype.propertyIsEnumerable,hn=Object.getOwnPropertySymbols;const pn=hn?function(e){return null==e?[]:(e=Object(e),dn(hn(e),(function(t){return fn.call(e,t)})))}:mn;const kn=function(e,t){return kt(e,pn(e),t)};const bn=function(e,t){for(var n=-1,o=t.length,r=e.length;++n<o;)e[r+n]=t[n];return e};const xn=$t(Object.getPrototypeOf,Object);const yn=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)bn(t,pn(e)),e=xn(e);return t}:mn;const vn=function(e,t){return kt(e,yn(e),t)};const Cn=function(e,t,n){var o=t(e);return Tt(e)?o:bn(o,n(e))};const _n=function(e){return Cn(e,Jt,pn)};const En=function(e){return Cn(e,on,yn)};const Tn=Ve(he,"DataView");const wn=Ve(he,"Promise");const Sn=Ve(he,"Set");const Rn=Ve(he,"WeakMap");var An="[object Map]",In="[object Promise]",Mn="[object Set]",Nn="[object WeakMap]",Fn="[object DataView]",Pn=Fe(Tn),On=Fe(ze),Ln=Fe(wn),Bn=Fe(Sn),jn=Fe(Rn),Dn=Te;(Tn&&Dn(new Tn(new ArrayBuffer(1)))!=Fn||ze&&Dn(new ze)!=An||wn&&Dn(wn.resolve())!=In||Sn&&Dn(new Sn)!=Mn||Rn&&Dn(new Rn)!=Nn)&&(Dn=function(e){var t=Te(e),n="[object Object]"==t?e.constructor:void 0,o=n?Fe(n):"";if(o)switch(o){case Pn:return Fn;case On:return An;case Ln:return In;case Bn:return Mn;case jn:return Nn}return t});const Un=Dn;var Hn=Object.prototype.hasOwnProperty;const Vn=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Hn.call(e,"index")&&(n.index=e.index,n.input=e.input),n};const zn=he.Uint8Array;const Gn=function(e){var t=new e.constructor(e.byteLength);return new zn(t).set(new zn(e)),t};const Wn=function(e,t){var n=t?Gn(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)};var qn=/\w*$/;const $n=function(e){var t=new e.constructor(e.source,qn.exec(e));return t.lastIndex=e.lastIndex,t};var Kn=pe?pe.prototype:void 0,Zn=Kn?Kn.valueOf:void 0;const Xn=function(e){return Zn?Object(Zn.call(e)):{}};const Qn=function(e,t){var n=t?Gn(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)};const Jn=function(e,t,n){var o=e.constructor;switch(t){case"[object ArrayBuffer]":return Gn(e);case"[object Boolean]":case"[object Date]":return new o(+e);case"[object DataView]":return Wn(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return Qn(e,n);case"[object Map]":case"[object Set]":return new o;case"[object Number]":case"[object String]":return new o(e);case"[object RegExp]":return $n(e);case"[object Symbol]":return Xn(e)}};var Yn=Object.create;const eo=function(){function e(){}return function(t){if(!we(t))return{};if(Yn)return Yn(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const to=function(e){return"function"!=typeof e.constructor||qt(e)?{}:eo(xn(e))};const no=function(e){return xt(e)&&"[object Map]"==Un(e)};var oo=Ut&&Ut.isMap;const ro=oo?Lt(oo):no;const io=function(e){return xt(e)&&"[object Set]"==Un(e)};var so=Ut&&Ut.isSet;const ao=so?Lt(so):io;var co="[object Arguments]",lo="[object Function]",go="[object Object]",uo={};uo[co]=uo["[object Array]"]=uo["[object ArrayBuffer]"]=uo["[object DataView]"]=uo["[object Boolean]"]=uo["[object Date]"]=uo["[object Float32Array]"]=uo["[object Float64Array]"]=uo["[object Int8Array]"]=uo["[object Int16Array]"]=uo["[object Int32Array]"]=uo["[object Map]"]=uo["[object Number]"]=uo["[object Object]"]=uo["[object RegExp]"]=uo["[object Set]"]=uo["[object String]"]=uo["[object Symbol]"]=uo["[object Uint8Array]"]=uo["[object Uint8ClampedArray]"]=uo["[object Uint16Array]"]=uo["[object Uint32Array]"]=!0,uo["[object Error]"]=uo[lo]=uo["[object WeakMap]"]=!1;const mo=function e(t,n,o,r,i,s){var a,c=1&n,l=2&n,g=4&n;if(o&&(a=i?o(t,r,i,s):o(t)),void 0!==a)return a;if(!we(t))return t;var u=Tt(t);if(u){if(a=Vn(t),!c)return un(t,a)}else{var d=Un(t),m=d==lo||"[object GeneratorFunction]"==d;if(It(t))return gn(t,c);if(d==go||d==co||m&&!i){if(a=l||m?{}:to(t),!c)return l?vn(t,rn(a,t)):kn(t,Yt(a,t))}else{if(!uo[d])return i?t:{};a=Jn(t,d,c)}}s||(s=new ut);var f=s.get(t);if(f)return f;s.set(t,a),ao(t)?t.forEach((function(r){a.add(e(r,n,o,r,t,s))})):ro(t)&&t.forEach((function(r,i){a.set(i,e(r,n,o,i,t,s))}));var h=u?void 0:(g?l?En:_n:l?on:Jt)(t);return dt(h||t,(function(r,i){h&&(r=t[i=r]),pt(a,i,e(r,n,o,i,t,s))})),a};const fo=function(e){return mo(e,5)};const ho=function(e){return"symbol"==typeof e||xt(e)&&"[object Symbol]"==Te(e)};var po=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ko=/^\w*$/;const bo=function(e,t){if(Tt(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!ho(e))||(ko.test(e)||!po.test(e)||null!=t&&e in Object(t))};function xo(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var o=arguments,r=t?t.apply(this,o):o[0],i=n.cache;if(i.has(r))return i.get(r);var s=e.apply(this,o);return n.cache=i.set(r,s)||i,s};return n.cache=new(xo.Cache||ct),n}xo.Cache=ct;const yo=xo;var vo=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Co=/\\(\\)?/g;const _o=function(e){var t=yo(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(vo,(function(e,n,o,r){t.push(o?r.replace(Co,"$1"):n||e)})),t}));const Eo=function(e,t){for(var n=-1,o=null==e?0:e.length,r=Array(o);++n<o;)r[n]=t(e[n],n,e);return r};var To=pe?pe.prototype:void 0,wo=To?To.toString:void 0;const So=function e(t){if("string"==typeof t)return t;if(Tt(t))return Eo(t,e)+"";if(ho(t))return wo?wo.call(t):"";var n=t+"";return"0"==n&&1/t==-Infinity?"-0":n};const Ro=function(e){return null==e?"":So(e)};const Ao=function(e,t){return Tt(e)?e:bo(e,t)?[e]:_o(Ro(e))};const Io=function(e){if("string"==typeof e||ho(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t};const Mo=function(e,t,n,o){if(!we(e))return e;for(var r=-1,i=(t=Ao(t,e)).length,s=i-1,a=e;null!=a&&++r<i;){var c=Io(t[r]),l=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(r!=s){var g=a[c];void 0===(l=o?o(g,c,a):void 0)&&(l=we(g)?g:Nt(t[r+1])?[]:{})}pt(a,c,l),a=a[c]}return e};const No=function(e,t,n){return null==e?e:Mo(e,t,n)};const Fo=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this};const Po=function(e){return this.__data__.has(e)};function Oo(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new ct;++t<n;)this.add(e[t])}Oo.prototype.add=Oo.prototype.push=Fo,Oo.prototype.has=Po;const Lo=Oo;const Bo=function(e,t){for(var n=-1,o=null==e?0:e.length;++n<o;)if(t(e[n],n,e))return!0;return!1};const jo=function(e,t){return e.has(t)};const Do=function(e,t,n,o,r,i){var s=1&n,a=e.length,c=t.length;if(a!=c&&!(s&&c>a))return!1;var l=i.get(e),g=i.get(t);if(l&&g)return l==t&&g==e;var u=-1,d=!0,m=2&n?new Lo:void 0;for(i.set(e,t),i.set(t,e);++u<a;){var f=e[u],h=t[u];if(o)var p=s?o(h,f,u,t,e,i):o(f,h,u,e,t,i);if(void 0!==p){if(p)continue;d=!1;break}if(m){if(!Bo(t,(function(e,t){if(!jo(m,t)&&(f===e||r(f,e,n,o,i)))return m.push(t)}))){d=!1;break}}else if(f!==h&&!r(f,h,n,o,i)){d=!1;break}}return i.delete(e),i.delete(t),d};const Uo=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,o){n[++t]=[o,e]})),n};const Ho=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n};var Vo=pe?pe.prototype:void 0,zo=Vo?Vo.valueOf:void 0;const Go=function(e,t,n,o,r,i,s){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!i(new zn(e),new zn(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return ee(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var a=Uo;case"[object Set]":var c=1&o;if(a||(a=Ho),e.size!=t.size&&!c)return!1;var l=s.get(e);if(l)return l==t;o|=2,s.set(e,t);var g=Do(a(e),a(t),o,r,i,s);return s.delete(e),g;case"[object Symbol]":if(zo)return zo.call(e)==zo.call(t)}return!1};var Wo=Object.prototype.hasOwnProperty;const qo=function(e,t,n,o,r,i){var s=1&n,a=_n(e),c=a.length;if(c!=_n(t).length&&!s)return!1;for(var l=c;l--;){var g=a[l];if(!(s?g in t:Wo.call(t,g)))return!1}var u=i.get(e),d=i.get(t);if(u&&d)return u==t&&d==e;var m=!0;i.set(e,t),i.set(t,e);for(var f=s;++l<c;){var h=e[g=a[l]],p=t[g];if(o)var k=s?o(p,h,g,t,e,i):o(h,p,g,e,t,i);if(!(void 0===k?h===p||r(h,p,n,o,i):k)){m=!1;break}f||(f="constructor"==g)}if(m&&!f){var b=e.constructor,x=t.constructor;b==x||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof x&&x instanceof x||(m=!1)}return i.delete(e),i.delete(t),m};var $o="[object Arguments]",Ko="[object Array]",Zo="[object Object]",Xo=Object.prototype.hasOwnProperty;const Qo=function(e,t,n,o,r,i){var s=Tt(e),a=Tt(t),c=s?Ko:Un(e),l=a?Ko:Un(t),g=(c=c==$o?Zo:c)==Zo,u=(l=l==$o?Zo:l)==Zo,d=c==l;if(d&&It(e)){if(!It(t))return!1;s=!0,g=!1}if(d&&!g)return i||(i=new ut),s||Vt(e)?Do(e,t,n,o,r,i):Go(e,t,c,n,o,r,i);if(!(1&n)){var m=g&&Xo.call(e,"__wrapped__"),f=u&&Xo.call(t,"__wrapped__");if(m||f){var h=m?e.value():e,p=f?t.value():t;return i||(i=new ut),r(h,p,n,o,i)}}return!!d&&(i||(i=new ut),qo(e,t,n,o,r,i))};const Jo=function e(t,n,o,r,i){return t===n||(null==t||null==n||!xt(t)&&!xt(n)?t!=t&&n!=n:Qo(t,n,o,r,e,i))};const Yo=function(e,t){return Jo(e,t)};const er=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0};const tr=function(e,t){for(var n=0,o=(t=Ao(t,e)).length;null!=e&&n<o;)e=e[Io(t[n++])];return n&&n==o?e:void 0};const nr=function(e,t,n){var o=-1,r=e.length;t<0&&(t=-t>r?0:r+t),(n=n>r?r:n)<0&&(n+=r),r=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(r);++o<r;)i[o]=e[o+t];return i};const or=function(e,t){return t.length<2?e:tr(e,nr(t,0,-1))};const rr=function(e,t){return t=Ao(t,e),null==(e=or(e,t))||delete e[Io(er(t))]};const ir=function(e,t){return null==e||rr(e,t)},sr=["push","from","clear","head","getItems","next","getMarkerNames","_onAccept","removeMarkers","previous","hasComments","isIntersectingWithRange","getContainedElement","onDiscard","delete","nodeBefore","set","nodeAfter","discard","map","_markerNames","add","getMarkers","isIntersecting","commentThread","setAttribute","getFirstRange","addMarkerName","change","getRange","substr","markers","type","subType","removeMarker","_onDiscard","getFirstMarker","_model","author","addRange","addMarker","getRanges","createdAt","filter","data","getMultiRangeId","length","_onAttributesChange","removeAttribute","size","attributes"];var ar,cr;ar=sr,cr=199,function(e){for(;--e;)ar.push(ar.shift())}(++cr);const lr=function(e,t){return sr[e-=0]};class gr{constructor(e,t){this.id=t.id,this[lr("0x25")]=t[lr("0x25")],this[lr("0x26")]=t[lr("0x26")]||null,this[lr("0x2b")]=t[lr("0x2b")],this[lr("0x31")]=null,this[lr("0x2a")]=e,this[lr("0xc")]=t.onAccept,this[lr("0x28")]=t[lr("0x12")],this._onAttributesChange=t.onAttributesChange,this[lr("0x19")]=new Set,this[lr("0x15")](lr("0x2f"),null),this[lr("0x15")](lr("0x4"),t[lr("0x4")]||{}),this.set(lr("0xe"),null),this[lr("0x15")](lr("0xa"),null),this[lr("0x15")]("commentThread",null),this[lr("0x15")]("_saved",!1),this.decorate("accept"),this.decorate("discard")}get[lr("0x8")](){let e=this;for(;e[lr("0xe")];)e=e[lr("0xe")];return e}get[lr("0xf")](){return!!this[lr("0x1d")]&&this[lr("0x1d")][lr("0x0")]>0}get isMultiRange(){return 0!=this[lr("0x19")][lr("0x3")]&&6==Array[lr("0x6")](this[lr("0x19")])[0].split(":")[lr("0x0")]}get isInContent(){return null!==this.getFirstMarker()}addMarkerName(e){this[lr("0x19")][lr("0x1a")](e)}[lr("0xb")](){return Array.from(this._markerNames)}getMarkers(){return this[lr("0xb")]()[lr("0x18")]((e=>this[lr("0x2a")][lr("0x24")].get(e)))[lr("0x30")]((e=>e))}[lr("0x29")](){return this.getMarkers()[0]||null}[lr("0xd")](){this[lr("0x2a")][lr("0x21")]((e=>{for(const t of this[lr("0x1b")]())e[lr("0x27")](t)})),this._markerNames[lr("0x7")]()}removeMarker(e){this._model[lr("0x21")]((t=>{t[lr("0x27")](e)})),this[lr("0x19")][lr("0x13")](e)}[lr("0x2c")](e){const t="suggestion:"+this[lr("0x25")]+":"+this[lr("0x26")]+":"+this.id+":"+this[lr("0x2b")].id+":"+gr[lr("0x32")]();this[lr("0x20")](t),this[lr("0x2a")].change((n=>{n[lr("0x2d")](t,{range:e,usingOperation:!0,affectsData:!0})}))}[lr("0x10")](e){for(const t of this[lr("0x2e")]())if(t[lr("0x1c")](e))return!0;return!1}getRanges(){return this[lr("0x1b")]().map((e=>e.getRange()))}[lr("0x9")](){return this[lr("0x2e")]().reduce(((e,t)=>[...e,...t[lr("0x9")]()]),[])}[lr("0x1f")](){return this.getFirstMarker()[lr("0x22")]()}[lr("0x11")](){const e=this.getRanges();if(1!=e.length)return null;const t=e[0],n=t.start[lr("0x16")],o=t.end[lr("0x14")];return n instanceof s.Element?n!=o?null:n:null}accept(){this._onAccept(this[lr("0x2e")](),this[lr("0x31")],this[lr("0x4")]),this[lr("0xd")]()}[lr("0x17")](){this[lr("0x28")](this.getRanges(),this[lr("0x31")],this[lr("0x4")]),this[lr("0xd")]()}getAllAdjacentSuggestions(){const e=[];let t=this[lr("0x8")];for(;t;)e[lr("0x5")](t),t=t[lr("0xa")];return e}[lr("0x1e")](e,t){const n=fo(this.attributes);No(n,e,t),Yo(n,this.attributes)||(this[lr("0x4")]=n,this._onAttributesChange(n))}[lr("0x2")](e){const t=fo(this[lr("0x4")]);ir(t,e),Yo(t,this.attributes)||(this[lr("0x4")]=t,this[lr("0x1")](this[lr("0x4")]))}toJSON(){return{id:this.id,type:this[lr("0x26")]?this[lr("0x25")]+":"+this[lr("0x26")]:this.type,authorId:this[lr("0x2b")].id,createdAt:this.createdAt,hasComments:this[lr("0xf")],data:this[lr("0x31")],attributes:this[lr("0x4")]}}static[lr("0x32")](){return(0,t.uid)()[lr("0x23")](1,5)}}(0,t.mix)(gr,t.ObservableMixin);class ur{constructor(e,t){this._customCallbacks=[],this._itemLabels=new Map,this._schema=e,this._locale=t}getDescriptions(e){const t=[];for(let n=0;n<e.length;n++){const o=e[n];if(!o.isInContent)continue;let r=!1;for(const e of this._customCallbacks){const n=e(o);if(n){n.type&&t.push(n),r=!0;break}}if(!r){this._addDescriptionItems(t,o);const r=e[n+1];if(r&&!o.getFirstRange().end.isEqual(r.getFirstRange().start)){const e=t[t.length-1],n="insertion"==o.type?"add":"remove";e&&"text"==e.type&&(e[n]+="\n")}}}return this._resolveDescriptionItems(t)}registerDescriptionCallback(e){this._customCallbacks.push(e)}registerElementLabel(e,t){this._itemLabels.set(e,t)}getItemLabel(e,t=1){const n=this._itemLabels.get(e)||e;return"function"==typeof n?n(t):1!==t?t+" "+n+"s":""+n}_addDescriptionItems(e,t){const n=t.getFirstRange().getWalker(),o="insertion"==t.type?"add":"remove";for(const t of n){const r=t.item,i=e[e.length-1];if(r.is("textProxy"))i&&i.type.indexOf("Container")>-1&&e.pop(),i&&"text"==i.type?i[o]+=r.data:e.push({type:"text",add:"add"==o?r.data:"",remove:"remove"==o?r.data:""});else if(this._schema.isObject(r)){if(i&&i.type.indexOf("Container")>-1&&e.pop(),"elementEnd"==t.type)continue;i&&i.type==o+"Object"&&i.name==r.name?i.quantity++:e.push({type:o+"Object",name:r.name,quantity:1}),n.skip((e=>!("elementEnd"==e.type&&e.item==r)))}else if(this._schema.checkChild(r,"$text")||r.is("element","softBreak")){if("add"==o&&"elementStart"==t.type||"remove"==o&&"elementEnd"==t.type)continue;if(i&&-1==i.type.indexOf("Container")){"text"==i.type&&(i[o]+="\n");continue}let n;if(n="add"==o?r.nextSibling&&!this._schema.isObject(r.nextSibling)?r.nextSibling:null:r.previousSibling&&!this._schema.isObject(r.previousSibling)?r.previousSibling:null,r.isEmpty||n&&n.isEmpty){const t=n&&n.isEmpty?n.name:r.name;i&&i.type==o+"EmptyContainer"&&i.name==t?i.quantity++:e.push({type:o+"EmptyContainer",name:t,quantity:1})}else e.push({type:o+"Container",name:r.name})}}}_resolveDescriptionItems(e){const{t}=this._locale,n=[];for(const o of e){switch(o.type){case"text":if(o.add=o.add.replace(/(\S)\u000A+(\S)/g,"$1 $2").replace(/\u000A/g,""),o.remove=o.remove.replace(/(\S)\u000A+(\S)/g,"$1 $2").replace(/\u000A/g,""),""!=o.add&&""!=o.remove){n.push({type:"replace",content:t({string:"*Replace:* %0 *with* %1",id:"REPLACE_TEXT"},['"'+o.remove+'"','"'+o.add+'"'])});continue}if(null!=o.add.match(/^ +$/)){n.push({type:"insertion",content:t("*Insert:* %0",t({string:"space",plural:"%0 spaces",id:"ELEMENT_SPACE"},o.add.length))});continue}if(null!=o.remove.match(/^ +$/)){n.push({type:"deletion",content:t("*Remove:* %0",t({string:"space",plural:"%0 spaces",id:"ELEMENT_SPACE"},o.remove.length))});continue}if(""!=o.add){n.push({type:"insertion",content:t("*Insert:* %0",'"'+o.add+'"')});continue}n.push({type:"deletion",content:t("*Remove:* %0",'"'+o.remove+'"')});continue;case"addEmptyContainer":case"addObject":n.push({type:"insertion",content:t("*Insert:* %0",this.getItemLabel(o.name,o.quantity))});continue;case"removeEmptyContainer":case"removeObject":n.push({type:"deletion",content:t("*Remove:* %0",this.getItemLabel(o.name,o.quantity))});continue;case"addContainer":n.push({type:"insertion",content:t("*Split:* %0",this.getItemLabel(o.name,o.quantity))});continue;case"removeContainer":n.push({type:"deletion",content:t("*Merge:* %0",this.getItemLabel(o.name,o.quantity))});continue}n.push(o)}return n}}var dr=n(278),mr=n.n(dr),fr=n(477),hr={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};mr()(fr.Z,hr);fr.Z.locals;var pr=n(588),kr={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};mr()(pr.Z,kr);pr.Z.locals;class br extends e.Plugin{afterInit(){const e=this.editor,{t}=e.locale;if(!e.plugins.has("AlignmentEditing"))return;const n=e.plugins.get("TrackChangesEditing");n.enableCommand("alignment",((t,o={})=>{let r=o.value;o.value||(r="ltr"===e.locale.contentLanguageDirection?"left":"right");const i=Array.from(this.editor.model.document.selection.getSelectedBlocks()).filter((e=>function(e,t,n){const o=e.getAttribute("alignment")||null;return t.checkAttribute(e,"alignment")&&n!=o}(e,this.editor.model.schema,r)));e.model.change((()=>{for(const e of i)n.markBlockFormat(e,{commandName:"alignment",commandParams:[{value:r}]})}))})),n._descriptionFactory.registerDescriptionCallback((e=>{const{data:n}=e;if(n&&"alignment"==n.commandName){const e=n.commandParams[0].value;return{type:"format",content:t("*Format:* %0",function(e){switch(e){case"left":return t({string:"align to left",id:"FORMAT_ALIGN_TO_LEFT"});case"right":return t({string:"align to right",id:"FORMAT_ALIGN_TO_RIGHT"});case"center":return t({string:"align to center",id:"FORMAT_ALIGN_TO_CENTER"});case"justify":return t({string:"justify",id:"FORMAT_JUSTIFY_TEXT"})}}(e))}}}))}}const xr=["getItems","model","writer","markerName","elementEnd","item","isContent","type","name","get","insert","listItem","push","TrackChangesEditing","isAtEnd","markerRange","toViewElement","createUIElement","hasAttribute","nextSibling","addClass","ck-suggestion-marker--active","consumable","bindElementToMarker","getCustomProperty","activeMarkers"];var yr,vr;yr=xr,vr=181,function(e){for(;--e;)yr.push(yr.shift())}(++vr);const Cr=function(e,t){return xr[e-=0]};function _r(e,t,n){const o=[];for(const r of t[Cr("0x1")]())r[Cr("0x13")](e)&&o[Cr("0xd")](n.createRangeOn(r));return o}function Er(e){const t=[];if(e.is("element",Cr("0xc"))){let n=e[Cr("0x14")];for(;n&&n.is("element","listItem")&&n.getAttribute("listIndent")>0;)t[Cr("0xd")](n),n=n[Cr("0x14")]}return t}function Tr(e,t,{showActiveMarker:n=!0}={}){const o=e.plugins[Cr("0xa")](Cr("0xe"));return(r,i,s)=>{if(!s[Cr("0x17")].test(i[Cr("0x10")],r[Cr("0x9")]))return;const a=i[Cr("0x10")].getWalker(),c=i[Cr("0x10")].start,l=e[Cr("0x2")].schema;let g=null,u=null,d=!1,m=!1;for(const e of a){const t=e[Cr("0x6")];d=d||l[Cr("0x7")](t);const n=s.mapper[Cr("0x11")](t);if(n&&n[Cr("0x19")]("addHighlight"))return;Cr("0x5")==e[Cr("0x8")]&&l.isBlock(t)&&!l.isLimit(t)&&(t[Cr("0x14")]||c[Cr("0xf")]?g&&g.parent==t||(g=t,f(e.previousPosition),m=!0):u=u||e.previousPosition)}function f(e){const r=s[Cr("0x3")][Cr("0x12")]("span",{class:"ck-suggestion-marker-"+t}),a=s.mapper.toViewPosition(e);n&&o[Cr("0x0")].includes(i[Cr("0x4")])&&s[Cr("0x3")][Cr("0x15")](Cr("0x16"),r),s[Cr("0x3")][Cr("0xb")](a,r),s.mapper[Cr("0x18")](r,i[Cr("0x4")])}d||m||!u||f(u)}}const wr=["BoldEditing","ItalicEditing","UnderlineEditing","CodeEditing","StrikethroughEditing","SubscriptEditing","SuperscriptEditing"];class Sr extends e.Plugin{afterInit(){const e=this.editor,t=e.model,n=e.plugins.get("TrackChangesEditing"),{t:o}=e.locale;for(const o of wr){if(!e.plugins.has(o))continue;const r=o.slice(0,-7).toLowerCase(),i=e.commands.get(r);n.enableCommand(r,((e,o={})=>{const s=t.document.selection;if(s.isCollapsed)return void e(o);const a=void 0!==o.forceValue?o.forceValue:!i.value;t.change((()=>{const e=Array.from(s.getRanges());for(const o of e){const e=a?[o]:_r(r,o,t);for(const t of e)n.markInlineFormat(t,{commandName:r,commandParams:[{forceValue:a}]})}}))}))}function r(e,t){n._descriptionFactory.registerDescriptionCallback((n=>{const{data:r}=n;if(r&&r.commandName===e)return r.commandParams[0].forceValue?{type:"format",content:o("*Format:* %0",t)}:{type:"format",content:o("*Remove format:* %0",t)}}))}r("bold",o({string:"bold",id:"FORMAT_BOLD"})),r("italic",o({string:"italic",id:"FORMAT_ITALIC"})),r("underline",o({string:"underline",id:"FORMAT_UNDERLINE"})),r("code",o({string:"code",id:"FORMAT_CODE"})),r("strikethrough",o({string:"strikethrough",id:"FORMAT_STRIKETHROUGH"})),r("subscript",o({string:"subscript",id:"FORMAT_SUBSCRIPT"})),r("superscript",o({string:"superscript",id:"FORMAT_SUPERSCRIPT"}))}}class Rr extends e.Plugin{afterInit(){const e=this.editor,{t}=e.locale;if(!e.plugins.has("BlockQuoteEditing"))return;const n=e.plugins.get("TrackChangesEditing"),o=this.editor.commands.get("blockQuote");n.enableCommand("blockQuote",((t,r={})=>{const i=this.editor.model.document.selection,s=r&&void 0!==r.forceValue?r.forceValue:!o.value;let a=[];if(s){const t=Array.from(i.getSelectedBlocks()).filter((e=>Ar(e)||function(e,t){const n=t.checkChild(e.parent,"blockQuote"),o=t.checkChild(["$root","blockQuote"],e);return n&&o}(e,this.editor.model.schema)));a=Ir(t,e.model)}else{const t=Array.from(i.getSelectedBlocks()).filter((e=>Ar(e)));a=Ir(t,e.model)}e.model.change((()=>{for(const e of a)n.markBlockFormat(e,{commandName:"blockQuote",commandParams:[{forceValue:s}]})}))})),n._descriptionFactory.registerDescriptionCallback((e=>{const{data:n}=e;if(n&&"blockQuote"==n.commandName){const e=t({string:"block quote",id:"ELEMENT_BLOCK_QUOTE"});return n.commandParams[0].forceValue?{type:"format",content:t("*Format:* %0",e)}:{type:"format",content:t("*Remove format:* %0",e)}}}))}}function Ar(e){return"blockQuote"==e.parent.name}function Ir(e,t){let n,o=0;const r=[],i=t.schema;for(;o<e.length;){const s=e[o],a=e[o+1];n||(n=t.createPositionBefore(s)),Mr(t,s,a)||(r.push(t.createRange(n,i.isObject(s)?t.createPositionAfter(s):t.createPositionAt(s,"end"))),n=null),o++}return r}function Mr(e,t,n){if(!n)return!1;const o=e.createPositionAfter(t),r=e.createPositionBefore(n),i=new s.TreeWalker({boundaries:e.createRange(o,r)});for(const t of i)if("text"==t.type||e.schema.isLimit(t.item))return!1;return!0}class Nr extends e.Plugin{afterInit(){const e=this.editor,{t}=e.locale;e.plugins.has("CodeBlock")&&e.plugins.get("TrackChangesEditing")._descriptionFactory.registerElementLabel("codeBlock",(e=>t({string:"code block",plural:"%0 code blocks",id:"ELEMENT_CODE_BLOCK"},e)))}}var Fr,Pr,Or=["enableCommand","get","requires","addCommentThread","editor","init","TrackChangesEditing"];Fr=Or,Pr=173,function(e){for(;--e;)Fr.push(Fr.shift())}(++Pr);var Lr=function(e,t){return Or[e-=0]};class Br extends e.Plugin{static get[Lr("0x4")](){return["CommentsEditing"]}[Lr("0x0")](){this[Lr("0x6")].plugins[Lr("0x3")](Lr("0x1"))[Lr("0x2")](Lr("0x5"))}}var jr=n(181);const Dr=["unbindElementFromMarkerName","markerName","downcastDispatcher","requires","lock","buffer","init","plugins","editing","rootName","writer","forward","createRange","batch","end","high","fromRange","start","detach","addMarker:suggestion:deletion","showSuggestionHighlights","unit","editor","getFirstRange","isCollapsed","selection","mapper","document","remove","merge","root","removeMarker:suggestion:deletion","unlock","enableCommand","setSelection","get","$graveyard","deleteForward","data","modifySelection","createSelection","model","uiElement","markerNameToElements","enqueueChange","options"];var Ur,Hr;Ur=Dr,Hr=196,function(e){for(;--e;)Ur.push(Ur.shift())}(++Hr);const Vr=function(e,t){return Dr[e-=0]};class zr extends e.Plugin{static get[Vr("0x25")](){return[jr.Delete]}[Vr("0x28")](){const e=this[Vr("0xa")],t=e[Vr("0x29")][Vr("0x17")]("TrackChangesEditing");t[Vr("0x15")]("delete");const n=e.commands[Vr("0x17")](Vr("0x19"));t.enableCommand(Vr("0x19"),((t,o={})=>{const r=e[Vr("0x1d")][Vr("0x1c")](e.model[Vr("0xf")][Vr("0xd")]);r[Vr("0xc")]&&e.model[Vr("0x1b")](r,{direction:Vr("0x2d"),unit:o[Vr("0x9")]});const i=r[Vr("0xb")](),a=s.LiveRange[Vr("0x4")](i);let c;t(o),c=Vr("0x18")==a[Vr("0x12")][Vr("0x2b")]?e[Vr("0x1d")][Vr("0x0")](i.start):e.model[Vr("0x0")](a[Vr("0x5")],a[Vr("0x2")]),a[Vr("0x6")](),e[Vr("0x1d")][Vr("0x20")](n.buffer[Vr("0x1")],(e=>{n[Vr("0x27")][Vr("0x26")](),e[Vr("0x16")](e.createRange(c[Vr("0x2")])),n.buffer[Vr("0x14")]()}))})),e[Vr("0x2a")][Vr("0x24")].on(Vr("0x7"),Tr(e,Vr("0x11")),{priority:Vr("0x3")}),e[Vr("0x1a")][Vr("0x24")].on(Vr("0x7"),((t,n,o)=>{o[Vr("0x21")][Vr("0x8")]&&Tr(e,Vr("0x11"),{showActiveMarker:!1})(t,n,o)}),{priority:"high"}),e[Vr("0x2a")][Vr("0x24")].on(Vr("0x13"),((e,t,n)=>{const o=n[Vr("0xe")][Vr("0x1f")](t[Vr("0x23")]);if(o)for(const e of o)e.is(Vr("0x1e"))&&(n.mapper[Vr("0x22")](e,t[Vr("0x23")]),n[Vr("0x2c")][Vr("0x10")](e))}),{priority:Vr("0x3")})}}var Gr=n(331);const Wr=["selection","split","ck-suggestion-marker-split","downcastDispatcher","schema","options","parent","get","model","enter","setSelection","editing","fromRange","high","detach","showSuggestionHighlights","unbindElementFromMarkerName","end","plugins","isAtEnd","isLimit","addMarker:suggestion:insertion","getFirstRange","createRange","mapper","start","enableCommand","TrackChangesEditing","requires","hasClass","change","markInsertion"];var qr,$r;qr=Wr,$r=412,function(e){for(;--e;)qr.push(qr.shift())}(++$r);const Kr=function(e,t){return Wr[e-=0]};class Zr extends e.Plugin{static get[Kr("0x0")](){return[Gr.Enter]}init(){const e=this.editor,t=e[Kr("0x16")][Kr("0xb")](Kr("0x1f"));t[Kr("0x1e")](Kr("0xd"),(n=>{e[Kr("0xc")][Kr("0x2")]((o=>{const r=e[Kr("0xc")].document[Kr("0x4")],i=r.getFirstPosition(),a=r.isCollapsed,c=s.LiveRange[Kr("0x10")](r[Kr("0x1a")]()),l=c.start[Kr("0xa")],g=c.end[Kr("0xa")],u=!(c[Kr("0x1d")].isAtStart&&c[Kr("0x15")][Kr("0x17")]),d=l==g,m=!(e[Kr("0xc")][Kr("0x8")].isLimit(l)||e[Kr("0xc")][Kr("0x8")][Kr("0x18")](g))&&(a||u&&d);if(n(),m){const n=e[Kr("0xc")].createPositionAt(i.parent.nextSibling,0),r=o.createRange(i,n);t[Kr("0x3")](r)}else o[Kr("0xe")](o[Kr("0x1b")](c[Kr("0x15")]));c[Kr("0x12")]()}))})),e[Kr("0xf")][Kr("0x7")].on(Kr("0x19"),Tr(e,Kr("0x5")),{priority:Kr("0x11")}),e[Kr("0xf")][Kr("0x7")].on("removeMarker:suggestion:insertion",((e,t,n)=>{const o=n.mapper.markerNameToElements(t.markerName);if(o)for(const e of o)e[Kr("0x1")](Kr("0x6"))&&(n[Kr("0x1c")][Kr("0x14")](e,t.markerName),n.writer.remove(e))}),{priority:Kr("0x11")}),e.data[Kr("0x7")].on("addMarker:suggestion:insertion",((t,n,o)=>{o[Kr("0x9")][Kr("0x13")]&&Tr(e,Kr("0x5"),{showActiveMarker:!1})(t,n,o)}),{priority:"high"})}}const Xr=[{pluginName:"FontSizeEditing",commandName:"fontSize"},{pluginName:"FontFamilyEditing",commandName:"fontFamily"},{pluginName:"FontColorEditing",commandName:"fontColor"},{pluginName:"FontBackgroundColorEditing",commandName:"fontBackgroundColor"}];class Qr extends e.Plugin{afterInit(){const{t:e}=this.editor.locale;for(const{pluginName:e,commandName:t}of Xr)this.editor.plugins.has(e)&&this._enableCommand(t);this.editor.plugins.get("TrackChangesEditing")._descriptionFactory.registerDescriptionCallback((t=>{const{data:n}=t;if(null!=n){if("fontSize"==n.commandName){const t=n.commandParams[0].value;if(t){const n=this.editor.plugins.get("FontSize").normalizeSizeOptions(this.editor.config.get("fontSize.options")).find((e=>e.model==t)).title,o=this.editor.locale._t(n).toLowerCase();return{type:"format",content:e("*Set font size:* %0",o)}}return{type:"format",content:e("*Reset font size*")}}if("fontFamily"==n.commandName){const t=n.commandParams[0].value;return t?{type:"format",content:e("*Set font family:* %0",t)}:{type:"format",content:e("*Reset font family*")}}if("fontColor"==n.commandName){const t=n.commandParams[0].value;if(t){const n=(0,r.normalizeColorOptions)(this.editor.config.get("fontColor.colors")).find((e=>e.model==t));let o=t,i="";return n&&(o=n.label,i=this.editor.locale._t(o).toLowerCase()),{type:"format",content:e("*Set font color:* %0",i).trim(),color:{value:t,title:i||o}}}return{type:"format",content:e("*Reset font color*")}}if("fontBackgroundColor"==n.commandName){const t=n.commandParams[0].value;if(t){const n=(0,r.normalizeColorOptions)(this.editor.config.get("fontBackgroundColor.colors")).find((e=>e.model==t));let o=t,i="";return n&&(o=n.label,i=this.editor.locale._t(o).toLowerCase()),{type:"format",content:e("*Set font background color:* %0",i).trim(),color:{value:t,title:i||o}}}return{type:"format",content:e("*Reset font background color*")}}}}))}_enableCommand(e){const t=this.editor;t.plugins.get("TrackChangesEditing").enableCommand(e,((n,o={})=>{const r=t.model.document.selection,i=o.value;r.isCollapsed?n(o):t.model.change((()=>{const n=Array.from(r.getRanges());for(const o of n){const n=i?[o]:_r(e,o,t.model);for(const o of n)t.plugins.get("TrackChangesEditing").markInlineFormat(o,{commandName:e,commandParams:[{value:i}]})}}))}))}}class Jr extends e.Plugin{afterInit(){const e=this.editor,{t}=e.locale,n=e.config.get("heading.options");if(!e.plugins.has("HeadingEditing"))return;const o=e.plugins.get("TrackChangesEditing");o.enableCommand("heading",((t,n)=>{const r=n.value,i=Array.from(this.editor.model.document.selection.getSelectedBlocks()).filter((e=>{return t=e,n=r,(o=this.editor.model.schema).checkChild(t.parent,n)&&!o.isObject(t)&&t.name!=n;var t,n,o}));e.model.change((()=>{for(const e of i)o.markBlockFormat(e,{commandName:"heading",commandParams:[n],formatGroupId:"blockName"},Er(e))}))}));for(const e of n)"paragraph"!=e.model&&o._descriptionFactory.registerElementLabel(e.model,(t=>{const n=Yr(e.model);return null!==n?r(t,n):i(t,e.title)}));function r(e,n){return t({string:"heading (level %1)",plural:"%0 headings (level %1)",id:"ELEMENT_HEADING"},[e,n])}function i(e,n){return t({string:"heading (%1)",plural:"%0 headings (%1)",id:"ELEMENT_HEADING_CUSTOM"},[e,n])}o._descriptionFactory.registerDescriptionCallback((e=>{const{type:o,data:s}=e;if("formatBlock"==o&&s&&"heading"==s.commandName){const e=s.commandParams[0].value,o=Yr(e);if(null!==o)return{type:"format",content:t("*Change to:* %0",r(1,o))};const a=n.find((t=>t.model===e)).title;return{type:"format",content:t("*Change to:* %0",i(1,a))}}}))}}function Yr(e){const t=e.match(/^heading(\d+)$/);return t?t[1]:null}class ei extends e.Plugin{afterInit(){const e=this.editor;if(!e.plugins.has("HighlightEditing"))return;const t=e.plugins.get("TrackChangesEditing");t.enableCommand("highlight",((n,o={})=>{const r=e.model.document.selection,i=r.getAttribute("highlight");let s=o.value,a=[];if(r.isCollapsed){const t=r.getFirstPosition();if(!r.hasAttribute("highlight"))return void n(o);{const n=e=>e.item.getAttribute("highlight")===i,o=t.getLastMatchingPosition(n,{direction:"backward"}),r=t.getLastMatchingPosition(n);a=[e.model.createRange(o,r)],s==i&&(s=null)}}else for(const t of r.getRanges())s?a.push(t):a.push(..._r("highlight",t,e.model));e.model.change((()=>{for(const e of a)t.markInlineFormat(e,{commandName:"highlight",commandParams:[{value:s}]})}))}));const{t:n}=e.locale;t._descriptionFactory.registerDescriptionCallback((t=>{const{type:o,data:r}=t;if("formatInline"==o&&r&&"highlight"==r.commandName){const t=r.commandParams[0].value;if(t){const o=e.config.get("highlight.options").find((e=>e.model==t)),r=e.locale._t(o.title).toLowerCase();return{type:"format",content:n("*Set highlight:* %0",r),color:{value:o.color,title:o.title}}}return{type:"format",content:n("*Remove highlight*",n({string:"highlight",id:"FORMAT_HIGHLIGHT"}))}}}))}}var ti=n(152),ni={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};mr()(ti.Z,ni);ti.Z.locals;class oi extends e.Plugin{afterInit(){const e=this.editor;if(!e.plugins.has("HorizontalLineEditing"))return;e.plugins.get("TrackChangesEditing").enableCommand("horizontalLine");const t=e.plugins.get("TrackChangesEditing"),{t:n}=e.locale;t._descriptionFactory.registerElementLabel("horizontalLine",(e=>n({string:"horizontal line",plural:"%0 horizontal lines",id:"ELEMENT_HORIZONTAL_LINE"},e))),e.conversion.for("dataDowncast").elementToStructure({model:"horizontalLine",view:(e,{writer:t,options:n})=>{if(!n.showSuggestionHighlights)return;const o=t.createContainerElement("div"),r=t.createEmptyElement("hr");return t.addClass("ck-horizontal-line",o),t.insert(t.createPositionAt(o,0),r),o},converterPriority:"high"})}}var ri=n(413),ii={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};mr()(ri.Z,ii);ri.Z.locals;class si extends e.Plugin{afterInit(){const e=this.editor;if(!e.plugins.has("ImageEditing"))return;const n=e.plugins.get("TrackChangesEditing"),o=e.plugins.get("ImageUtils"),r={},{t:i}=e.locale;if(n.enableCommand("insertImage"),n._descriptionFactory.registerElementLabel("imageBlock",(e=>i({string:"image",plural:"%0 images",id:"ELEMENT_IMAGE"},e))),n._descriptionFactory.registerElementLabel("imageInline",(e=>i({string:"image",plural:"%0 images",id:"ELEMENT_INLINE_IMAGE"},e))),n._descriptionFactory.registerElementLabel("caption",i({string:"caption",id:"ELEMENT_CAPTION"})),e.plugins.has("ImageUploadEditing")&&n.enableCommand("uploadImage"),e.plugins.has("ImageBlockEditing")&&e.plugins.has("ImageInlineEditing")&&(n.enableCommand("imageTypeInline",((t,r)=>{const i=o.getClosestSelectedImageElement(e.model.document.selection);e.model.change((()=>{n.markBlockFormat(i,{commandName:"imageTypeInline",commandParams:[r]},[],"convertBlockImageToInline")}))})),n.enableCommand("imageTypeBlock",((t,r)=>{e.model.change((i=>{let a=o.getClosestSelectedImageElement(e.model.document.selection),c=i.createRangeOn(a);const l=s.LivePosition.fromPosition(c.start,"toPrevious"),g=s.LivePosition.fromPosition(c.end,"toNext");n.forceDefaultExecution((()=>t(r))),a=o.getClosestSelectedImageElement(e.model.document.selection),c=i.createRangeOn(a);const u=i.createRange(l,g);l.detach(),g.detach(),n.markBlockFormat(a,{commandName:"imageTypeInline"},[],"convertInlineImageToBlock"),u.start.isBefore(c.start)&&n.markInsertion(i.createRange(u.start,c.start),"convertInlineImageToBlock"),c.end.isBefore(u.end)&&n.markInsertion(i.createRange(c.end,u.end),"convertInlineImageToBlock")}))})),n._suggestionFactory.registerCustomCallback("formatBlock","convertInlineImageToBlock","join",(()=>{})),n._suggestionFactory.registerCustomCallback("formatBlock","convertInlineImageToBlock","accept",(()=>{})),n._suggestionFactory.registerCustomCallback("formatBlock","convertInlineImageToBlock","discard",n._suggestionFactory.getSuggestionCallback("formatBlock","","accept")),n._suggestionFactory.registerCustomCallback("insertion","convertInlineImageToBlock","join",(()=>{})),n._suggestionFactory.registerCustomCallback("insertion","convertInlineImageToBlock","discard",(([t])=>{const o=n._suggestionFactory.getSuggestionCallback("insertion","","discard");let r=t.start,i=t.end;const s=e.model.schema.getNearestSelectionRange(r,"backward"),a=e.model.schema.getNearestSelectionRange(i,"forward");s.isCollapsed&&(r=s.start),a.isCollapsed&&(i=a.end),o([e.model.createRange(r,i)])})),n._suggestionFactory.registerCustomCallback("formatBlock","convertInlineImageToBlock","chain",l),n._suggestionFactory.registerCustomCallback("insertion","convertInlineImageToBlock","chain",l)),e.plugins.has("ImageCaptionEditing")&&(n.enableCommand("toggleImageCaption",((t,r)=>{const i=e.plugins.get("ImageCaptionUtils");let s=o.getClosestSelectedImageElement(e.model.document.selection),a=i.getCaptionFromImageModelElement(s);e.model.change((()=>{if(a)return void n.markDeletion(e.model.createRangeOn(a));const c=o.isBlockImage(s);t(r),s=o.getClosestSelectedImageElement(e.model.document.selection),a=i.getCaptionFromImageModelElement(s),n.markInsertion(e.model.createRangeOn(a),c?null:"imageCaption")}))})),n._suggestionFactory.registerCustomCallback("insertion","imageCaption","chain",l)),e.plugins.has("ImageStyleEditing")){n.enableCommand("imageStyle",((r,i)=>{const s=e.plugins.get("Users").me,a=e.commands.get("imageStyle");let c=o.getClosestSelectedImageElement(e.model.document.selection),l=e.model.createRangeOn(c),g=a.value;if(g==i.value)return;const u={commandName:"imageStyle",commandParams:[i],formatGroupId:(0,t.uid)()};e.model.change((()=>{if(n.getSuggestions().filter((e=>e.isInContent&&s==e.author&&("formatBlock"==e.type||"formatInline"==e.type)&&("imageStylePreApply"==e.subType||"imageStylePostApply"==e.subType)&&e.getFirstRange().isEqual(l))).forEach((e=>n.discardSuggestion(e.head))),c=o.getClosestSelectedImageElement(e.model.document.selection),l=e.model.createRangeOn(c),a.refresh(),e.commands.get("imageTypeInline").refresh(),e.commands.get("imageTypeBlock").refresh(),g=a.value,g!=i.value)return o.isInlineImage(c)&&a.shouldConvertImageType(i.value,c)?(r(i),c=o.getClosestSelectedImageElement(e.model.document.selection),void n.markBlockFormat(c,{...u,commandReversedParams:[{value:g||null}]},[],"imageStylePreApply")):void(o.isBlockImage(c)?n.markBlockFormat(c,u,[],"imageStylePostApply"):n.markInlineFormat(l,u,"imageStylePostApply"))}))}));for(const t of e.plugins.get("ImageStyleEditing").normalizedStyles)r[t.name]=t.title.toLowerCase();n._suggestionFactory.registerCustomCallback("formatBlock","imageStylePreApply","join",(()=>{})),n._suggestionFactory.registerCustomCallback("formatBlock","imageStylePostApply","join",(()=>{})),n._suggestionFactory.registerCustomCallback("formatInline","imageStylePostApply","join",(()=>{})),n._suggestionFactory.registerCustomCallback("formatBlock","imageStylePreApply","accept",(()=>{})),n._suggestionFactory.registerCustomCallback("formatBlock","imageStylePreApply","discard",((e,t)=>{n._suggestionFactory.getSuggestionCallback("formatBlock","","accept")(e,{commandName:t.commandName,commandParams:t.commandReversedParams})})),n._suggestionFactory.registerCustomCallback("formatBlock","imageStylePreApply","chain",l)}const a=[{type:"formatBlock",subType:"imageStylePreApply"},{type:"insertion",subType:"imageCaption"},{type:"formatBlock",subType:"convertInlineImageToBlock"},{type:"insertion",subType:"convertInlineImageToBlock"}];function c(e,t){const r=a.findIndex((({type:t,subType:n})=>e.type==t&&e.subType==n)),i=a.findIndex((({type:e,subType:n})=>t.type==e&&t.subType==n));if(r<0||i<0)return!1;const s=e.getFirstRange(),c=t.getFirstRange();if((0==r||1==r)&&2==i&&s.isIntersecting(c))return!0;if(2==r&&3==i){const e=n._findSuggestions(s,"insertion").filter((({suggestion:e,meta:t})=>t.isOwn&&"convertInlineImageToBlock"==e.subType));if(e.length>1&&c.end.isEqual(s.start))return!0;if(1==e.length&&(s.start.isEqual(c.end)||s.end.isEqual(c.start)))return!0}if(3==r&&3==i&&s.start.isBefore(c.start)){const e=s.end.nodeAfter,t=c.start.nodeBefore;return o.isBlockImage(e)&&e===t}return!1}function l(e,t){return c(e,t)?[e,t]:c(t,e)?[t,e]:null}e.model.document.registerPostFixer((()=>{let t=!1;const r=Array.from(e.model.document.differ.getChangedMarkers());for(const{name:e,data:i}of r){const{group:r,type:s,subType:a,id:c}=n._splitMarkerName(e);if("suggestion"==r&&n.hasSuggestion(c)){if("formatBlock"==s&&("imageStylePreApply"==a||"imageStylePostApply"==a)){const e=n.getSuggestion(c);if(i.newRange){const r=e.getFirstRange().getContainedElement();if(o.isBlockImage(r))continue;n.discardSuggestion(e),t=!0}}if("insertion"==s&&"imageCaption"==a&&!i.newRange){const e=n.getSuggestion(c);e.next&&e.next.isInContent&&(n.discardSuggestion(e.next),t=!0)}}}return t})),e.plugins.has("ImageResize")&&n.enableCommand("resizeImage",((t,r)=>{const i=o.getClosestSelectedImageElement(e.model.document.selection);i.getAttribute("width")!=r.width&&e.model.change((()=>{n.markBlockFormat(i,{commandName:"resizeImage",commandParams:[r]})}))})),e.plugins.has("ImageTextAlternativeEditing")&&n.enableCommand("imageTextAlternative",((t,r)=>{const i=o.getClosestSelectedImageElement(e.model.document.selection);(i.hasAttribute("alt")?i.getAttribute("alt"):"")!=r.newValue&&e.model.change((()=>{n.markBlockFormat(i,{commandName:"imageTextAlternative",commandParams:[r]})}))})),n._descriptionFactory.registerDescriptionCallback((e=>{if(a.find((({type:t,subType:n})=>e.type==t&&e.subType==n)))return e.previous?{}:void 0})),n._descriptionFactory.registerDescriptionCallback((e=>{if("insertion"==e.type||"deletion"==e.type){const t=e.getContainedElement();if(t&&t.is("element","caption"))return{type:"insertion"==e.type?"addObject":"removeObject",name:t.name,quantity:1}}})),n._descriptionFactory.registerDescriptionCallback((e=>"formatBlock"==e.type&&"convertInlineImageToBlock"==e.subType?{type:"format",content:"Inline image to block image"}:"formatBlock"==e.type&&"convertBlockImageToInline"==e.subType?{type:"format",content:"Block image to inline image"}:void 0)),n._descriptionFactory.registerDescriptionCallback((e=>{const{data:t}=e;if(t){if("imageStyle"==t.commandName){const e=t.commandParams[0].value;return n="side"===e?i({string:"side image",id:"FORMAT_SIDE_IMAGE"}):r[e]||e,{type:"format",content:i("*Format:* %0",n)}}if("imageTextAlternative"==t.commandName){const e=t.commandParams[0].newValue;return e?{type:"format",content:i("*Set image text alternative:* %0",'"'+e+'"')}:{type:"format",content:i("*Remove image text alternative*")}}if("resizeImage"==t.commandName){const e=t.commandParams[0].width;return e?{type:"format",content:i("*Set image width:* %0",e)}:{type:"format",content:i("*Reset image width*")}}}var n}))}}class ai extends e.Plugin{afterInit(){const e=this.editor,t=e.plugins.get("TrackChangesEditing");e.plugins.has("IndentEditing")&&(t.enableCommand("indent"),t.enableCommand("outdent"));const{t:n}=e.locale;if(e.plugins.has("IndentBlock")){for(const n of["indentBlock","outdentBlock"])t.enableCommand(n,(()=>{const o=Array.from(this.editor.model.document.selection.getSelectedBlocks()).filter((e=>this.editor.model.schema.checkAttribute(e,"blockIndent")));e.model.change((()=>{for(const e of o)t.markBlockFormat(e,{commandName:n,commandParams:[{value:""}],formatGroupId:"indentBlock"})}))}));t._descriptionFactory.registerDescriptionCallback((e=>{const{data:o}=e;if(!o)return;if("indentBlock"!=o.commandName&&"outdentBlock"!=o.commandName)return;const r=e.getItems()[0],i=t._descriptionFactory.getItemLabel(r.name);return"indentBlock"==o.commandName?{type:"format",content:n("*Indent:* %0",i)}:"outdentBlock"==o.commandName?{type:"format",content:n("*Outdent:* %0",i)}:void 0}))}}}var ci,li,gi=["requires","TrackChangesEditing","get","enableCommand","editor","plugins"];ci=gi,li=473,function(e){for(;--e;)ci.push(ci.shift())}(++li);var ui=function(e,t){return gi[e-=0]};class di extends e.Plugin{static get[ui("0x1")](){return[jr.Input]}init(){this[ui("0x5")][ui("0x0")][ui("0x3")](ui("0x2"))[ui("0x4")]("input")}}class mi extends e.Plugin{afterInit(){const e=this.editor;if(!e.plugins.has("LinkEditing"))return;const t=e.plugins.get("TrackChangesEditing");t.enableCommand("link",((n,o)=>{const r=e.model.document.selection;let i=[];if(r.isCollapsed){if(!r.hasAttribute("linkHref"))return void n(o);{const t=(0,jr.findAttributeRange)(r.getFirstPosition(),"linkHref",r.getAttribute("linkHref"),e.model);i=[t]}}else i=Array.from(r.getRanges());e.model.change((()=>{for(const e of i)t.markInlineFormat(e,{commandName:"link",commandParams:[o]})}))})),t.enableCommand("unlink",(()=>{const n=this.editor.model,o=n.document.selection;n.change((()=>{let n=[];n=o.isCollapsed?[(0,jr.findAttributeRange)(o.getFirstPosition(),"linkHref",o.getAttribute("linkHref"),e.model)]:_r("linkHref",o.getFirstRange(),e.model);for(const e of n)t.markInlineFormat(e,{commandName:"unlink",commandParams:[]})}))})),t._descriptionFactory.registerDescriptionCallback((t=>{const{data:n}=t,{t:o}=e.locale;if(n)return"link"==n.commandName?{type:"format",content:o("*Set link:* %0",'"'+n.commandParams[0]+'"')}:"unlink"==n.commandName?{type:"format",content:o("*Remove link*")}:void 0}))}}class fi extends e.Plugin{afterInit(){const e=this.editor;if(!e.plugins.has("ListEditing"))return;const t=e.plugins.get("TrackChangesEditing"),n=e.plugins.has("TodoListEditing");function o(n){return()=>{const o=e.model.document.selection,r=e.commands.get(n);if(r.value)return void e.execute("paragraph",{});const i=n.slice(0,-4),s=function(e,t,n){let o=Array.from(e).filter((e=>{return t=e,(o=n).checkChild(t.parent,"listItem")&&!o.isObject(t);var t,o}));o=o.filter((e=>!e.is("element","listItem")||e.getAttribute("listType")!=t));const r=new Set;for(const e of o)e.is("element","listItem")?r.add(hi(e)):r.add(e);return Array.from(r)}(o.getSelectedBlocks(),i,e.model.schema);e.model.change((()=>{for(const e of s)t.markBlockFormat(e,{commandName:n,commandParams:[{forceValue:!r.value}],formatGroupId:"blockName"},pi(e))}))}}function r(n){return()=>{const o=function(e){const t=(e=Array.from(e)).findIndex((e=>"listItem"!=e.name));return t>-1&&(e=e.slice(0,t)),e}(e.model.document.selection.getSelectedBlocks()),r=e.model.createRange(e.model.createPositionAt(o[0],"before"),e.model.createPositionAt(o[o.length-1],"end"));e.model.change((()=>{t.markBlockFormat(r,{commandName:n,commandParams:[],formatGroupId:"listIndent"},function(e){const t=new Set;for(const n of e){let e=n.nextSibling;for(;e&&e.getAttribute("listIndent")>n.getAttribute("listIndent");)t.add(e),e=e.nextSibling}return Array.from(t)}(o))}))}}t.enableCommand("numberedList",o("numberedList")),t.enableCommand("bulletedList",o("bulletedList")),n&&t.enableCommand("todoList",o("todoList")),t.enableCommand("indentList",r("indentList")),t.enableCommand("outdentList",r("outdentList")),n&&t.enableCommand("checkTodoList",(()=>{const n=e.commands.get("checkTodoList"),o=Array.from(n._selectedElements);o.filter((e=>e.getAttribute("todoListChecked")!=n.value)),e.model.change((()=>{for(const e of o)t.markBlockFormat(e,{commandName:"checkTodoList",commandParams:[{forceValue:!n.value}]})}))}));const{t:i}=e.locale;t._descriptionFactory.registerElementLabel("listItem",(e=>i({string:"list item",plural:"%0 list items",id:"ELEMENT_LIST_ITEM"},e))),t._descriptionFactory.registerDescriptionCallback((e=>{const{data:t}=e;if(t){if("numberedList"==t.commandName||"bulletedList"==t.commandName||"todoList"==t.commandName)switch(t.commandName.replace("List","")){case"bulleted":return n(i({string:"bulleted list",id:"ELEMENT_BULLETED_LIST"}));case"numbered":return n(i({string:"numbered list",id:"ELEMENT_NUMBERED_LIST"}));case"todo":return n(i({string:"to-do list",id:"ELEMENT_TODO_LIST"}))}if("indentList"==t.commandName)return{type:"format",content:i("*Indent:* %0",i({string:"list item",id:"ELEMENT_LIST_ITEM"}))};if("outdentList"==t.commandName)return{type:"format",content:i("*Outdent:* %0",i({string:"list item",id:"ELEMENT_LIST_ITEM"}))};if("checkTodoList"==t.commandName)return t.commandParams[0].forceValue?{type:"format",content:i("*Check item*")}:{type:"format",content:i("*Uncheck item*")}}function n(e){return{type:"format",content:i("*Change to:* %0",e)}}}))}}function hi(e){const t=e.getAttribute("listIndent");if(0==t)return e;let n=e;for(;e.previousSibling&&e.previousSibling.is("element","listItem");){const o=e.previousSibling.getAttribute("listIndent");if(o==t)n=e.previousSibling;else if(o<t)break;e=e.previousSibling}return n}function pi(e){const t=[];if(e.is("element","listItem")&&e.getAttribute("listIndent")>0){let n=e.nextSibling;for(;n&&"listItem"==n.name&&n.getAttribute("listIndent")==e.getAttribute("listIndent");)t.push(n),n=n.nextSibling}return t}var ki=n(943),bi={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};mr()(ki.Z,bi);ki.Z.locals;class xi extends e.Plugin{afterInit(){const e=this.editor;if(!e.plugins.has("MediaEmbedEditing"))return;const t=e.plugins.get("TrackChangesEditing"),{t:n}=e.locale;t.enableCommand("mediaEmbed"),t._descriptionFactory.registerElementLabel("media",(e=>n({string:"media item",plural:"%0 media items",id:"ELEMENT_MEDIA"},e))),e.conversion.for("dataDowncast").elementToElement({model:"media",view:(e,{writer:t,options:n})=>{if(n.showSuggestionHighlights)return t.createEmptyElement("div")},converterPriority:"high"}),e.data.downcastDispatcher.on("attribute:url:media",((e,t,n)=>{n.options.showSuggestionHighlights&&e.stop()}),{priority:"high"})}}const yi=["MentionEditing","mention","get","plugins","has","afterInit"];var vi,Ci;vi=yi,Ci=336,function(e){for(;--e;)vi.push(vi.shift())}(++Ci);const _i=function(e,t){return yi[e-=0]};class Ei extends e.Plugin{[_i("0x5")](){const e=this.editor;e[_i("0x3")][_i("0x4")](_i("0x0"))&&e.plugins[_i("0x2")]("TrackChangesEditing").enableCommand(_i("0x1"))}}var Ti=n(137),wi={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};mr()(Ti.Z,wi);Ti.Z.locals;class Si extends e.Plugin{afterInit(){const e=this.editor;if(!e.plugins.has("PageBreakEditing"))return;e.plugins.get("TrackChangesEditing").enableCommand("pageBreak");const t=e.plugins.get("TrackChangesEditing"),{t:n}=e.locale;t._descriptionFactory.registerElementLabel("pageBreak",(e=>n({string:"page break",plural:"%0 page breaks",id:"ELEMENT_PAGE_BREAK"},e)))}}class Ri extends e.Plugin{afterInit(){const e=this.editor;if(!e.plugins.has("Paragraph"))return;const{t}=e.locale,n=e.plugins.get("TrackChangesEditing");n._descriptionFactory.registerElementLabel("paragraph",(e=>t({string:"paragraph",plural:"%0 paragraphs",id:"ELEMENT_PARAGRAPH"},e))),n.enableCommand("paragraph",((t,o={})=>{const r=e.model.document,i=o.selection||r.selection,s=Array.from(i.getSelectedBlocks()).filter((e=>{return t=e,(n=this.editor.model.schema).checkChild(t.parent,"paragraph")&&!n.isObject(t)&&"paragraph"!=t.name;var t,n}));e.model.change((()=>{for(const e of s)n.markBlockFormat(e,{commandName:"paragraph",commandParams:[],formatGroupId:"blockName"},Er(e))}))})),n._descriptionFactory.registerDescriptionCallback((e=>{const{data:n}=e;if(n&&"paragraph"==n.commandName)return{type:"format",content:t("*Change to:* %0",t({string:"paragraph",plural:"%0 paragraphs",id:"ELEMENT_PARAGRAPH"}))}})),n.enableCommand("insertParagraph"),e.editing.downcastDispatcher.on("addMarker:suggestion:insertion",Ai(e),{priority:"highest"}),e.data.downcastDispatcher.on("addMarker:suggestion:insertion",((t,n,o)=>{o.options.showSuggestionHighlights&&Ai(e,{showActiveMarker:!1})(t,n,o)}),{priority:"highest"});const o=n._descriptionFactory;o.registerDescriptionCallback((n=>{if("insertion"!==n.type)return;const{start:r,end:i}=n.getFirstRange();if(!r.isTouching(i)||!r.nodeAfter)return;const s=e.model.schema,a=r.nodeAfter;return s.isBlock(a)&&!s.isLimit(a)&&s.checkChild(a,"$text")?{type:"insertion",content:t("*Insert:* %0",o.getItemLabel(a.name,1))}:void 0}))}}function Ai(e,{showActiveMarker:t=!0}={}){return(n,o,r)=>{const i=e.plugins.get("TrackChangesEditing"),s=o.markerRange.start,a=o.markerRange.end,c=e.model.schema;if(!s.isTouching(a)||!s.nodeAfter)return;const l=s.nodeAfter;if(c.isBlock(l)&&!c.isLimit(l)&&c.checkChild(l,"$text")){if(!r.consumable.consume(o.markerRange,n.name))return;const e=r.writer.createUIElement("span",{class:"ck-suggestion-marker-split"}),s=r.mapper.toViewPosition(a);t&&i.activeMarkers.includes(o.markerName)&&r.writer.addClass("ck-suggestion-marker--active",e),r.writer.insert(s,e),r.mapper.bindElementToMarker(e,o.markerName)}}}class Ii extends e.Plugin{afterInit(){const e=this.editor;if(!e.plugins.has("RemoveFormatEditing"))return;const t=e.plugins.get("TrackChangesEditing");t.enableCommand("removeFormat",(n=>{const o=e.model.document.selection;o.isCollapsed?n():e.model.change((()=>{const n=Array.from(o.getRanges());for(const o of n)for(const n of o.getItems())Mi(n,e.model.schema)&&t.markInlineFormat(e.model.createRangeOn(n),{commandName:"removeFormat",commandParams:[]})}))}));const{t:n}=e.locale;t._descriptionFactory.registerDescriptionCallback((e=>{const{data:t}=e;if(t&&"removeFormat"==t.commandName)return{type:"format",content:n("*Remove all formatting*")}}))}}function Mi(e,t){for(const[n]of e.getAttributes()){const e=t.getAttributeProperties(n);if(e&&e.isFormatting)return!0}return!1}const Ni=["discardAllSuggestions","goToPreviousRestrictedEditingException","acceptAllSuggestions","discardSuggestion","discardSelectedSuggestions","get","goToNextRestrictedEditingException","trackChanges","enableCommand","plugins","RestrictedEditingModeEditing","editor"];var Fi,Pi;Fi=Ni,Pi=228,function(e){for(;--e;)Fi.push(Fi.shift())}(++Pi);const Oi=function(e,t){return Ni[e-=0]};class Li extends e.Plugin{afterInit(){const e=this[Oi("0xb")];if(!e[Oi("0x9")].has(Oi("0xa")))return;const t=e[Oi("0x9")][Oi("0x5")]("TrackChangesEditing");t.enableCommand(Oi("0x1")),t[Oi("0x8")](Oi("0x6"));const n=e.plugins[Oi("0x5")]("RestrictedEditingModeEditing");n[Oi("0x8")](Oi("0x7")),n.enableCommand("acceptSuggestion"),n[Oi("0x8")](Oi("0x3")),n[Oi("0x8")](Oi("0x2")),n.enableCommand(Oi("0x0")),n[Oi("0x8")]("acceptSelectedSuggestions"),n.enableCommand(Oi("0x4"))}}class Bi extends e.Plugin{static get requires(){return[Gr.ShiftEnter]}init(){const e=this.editor,t=e.plugins.get("TrackChangesEditing"),n=e.t;t.enableCommand("shiftEnter"),e.editing.downcastDispatcher.on("addMarker:suggestion:insertion",ji(e),{priority:"high"}),e.editing.downcastDispatcher.on("addMarker:suggestion:deletion",ji(e),{priority:"high"}),e.data.downcastDispatcher.on("addMarker:suggestion",((t,n,o)=>{o.options.showSuggestionHighlights&&ji(e,{showActiveMarker:!1})(t,n,o)})),t._descriptionFactory.registerElementLabel("softBreak",(e=>n({id:"ELEMENT_LINE_BREAK",string:"line break",plural:"%0 line breaks"},e)))}}function ji(e,{showActiveMarker:t=!0}={}){return(n,o,r)=>{const i=e.plugins.get("TrackChangesEditing");if(!r.consumable.test(o.markerRange,n.name))return;const s=e.model;for(const e of o.markerRange.getItems()){if(!e.is("element","softBreak"))continue;const n="deletion"==o.markerName.split(":")[1]?"merge":"split",a=r.writer.createUIElement("span",{class:"ck-suggestion-marker-"+n}),c=r.mapper.toViewPosition(s.createPositionBefore(e));t&&i.activeMarkers.includes(o.markerName)&&r.writer.addClass("ck-suggestion-marker--active",a),r.writer.insert(c,a),r.mapper.bindElementToMarker(a,o.markerName)}}}class Di extends e.Plugin{afterInit(){const e=this.editor,t=e.model;if(!e.plugins.has("StandardEditingModeEditing"))return;const n=e.plugins.get("TrackChangesEditing"),o="restrictedEditingException",r=e.commands.get(o);n.enableCommand(o,((e,i={})=>{const s=t.document.selection;if(s.isCollapsed)return void e(i);const a=void 0!==i.forceValue?i.forceValue:!r.value;t.change((()=>{const e=Array.from(s.getRanges());for(const r of e){const e=a?[r]:_r(o,r,t);for(const t of e)n.markInlineFormat(t,{commandName:o,commandParams:[{forceValue:a}]})}}))}));const i=e.t;n._descriptionFactory.registerDescriptionCallback((e=>{const{data:t}=e;if(t&&t.commandName==o)return t.commandParams[0].forceValue?{type:"format",content:i({string:"*Enable in restricted editing mode*",id:"FORMAT_RESTRICTED_ENABLED"})}:{type:"format",content:i({string:"*Disable in restricted editing mode*",id:"FORMAT_RESTRICTED_DISABLED"})}}))}}var Ui=n(399),Hi={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};mr()(Ui.Z,Hi);Ui.Z.locals;class Vi extends e.Plugin{constructor(e){super(e),this._tablePostFixingSubtypes=["tableRow","tableColumn"]}afterInit(){const e=this.editor,t=e.model.document.selection;if(!e.plugins.has("TableEditing"))return;const{t:n}=e.locale,o=e.plugins.get("TrackChangesEditing"),r=e.plugins.get("TableUtils");o._descriptionFactory.registerElementLabel("table",(e=>n({string:"table",plural:"%0 tables",id:"ELEMENT_TABLE"},e))),this._setupColumnsRowsFixing(),o.enableCommand("insertTable"),o.enableCommand("selectTableRow"),o.enableCommand("selectTableColumn");for(const n of["insertTableRowAbove","insertTableRowBelow"]){const i=e.commands.get(n);o.enableCommand(n,(n=>{e.model.change((e=>{n();const s="above"===i.order,a=r.getSelectionAffectedTableCells(t),c=r.getRowIndexes(a),l=s?c.first-1:c.last+1,g=a[0].findAncestor("table"),u=r.createTableWalker(g,{startRow:l,endRow:l}),d=Array.from(u).map((t=>e.createRangeOn(t.cell)));o.markMultiRangeInsertion(d,"tableRow")}))}))}for(const n of["insertTableColumnLeft","insertTableColumnRight"]){const i=e.commands.get(n);o.enableCommand(n,(n=>{e.model.change((e=>{n();const s="left"===i.order,a=r.getSelectionAffectedTableCells(t),c=r.getColumnIndexes(a),l=s?c.first-1:c.last+1,g=a[0].findAncestor("table"),u=r.createTableWalker(g,{startRow:0,column:l,includeAllSlots:!1}),d=Array.from(u).map((t=>e.createRangeOn(t.cell)));o.markMultiRangeInsertion(d,"tableColumn")}))}))}for(const n of["removeTableRow","removeTableColumn"]){const i=n.substr(11),s=i.toLowerCase(),a=s.substr(0,3)+"span",c="table"+i,l="min"+i,g="max"+i;o.enableCommand(n,(()=>{e.model.change((e=>{const i=r.getSelectionAffectedTableCells(t),u=i[0].findAncestor("table");let d;if("removeTableRow"==n){const e=r.getRowIndexes(i);d={startRow:e.first,endRow:e.last,includeAllSlots:!0}}else{const e=r.getColumnIndexes(i);d={startColumn:e.first,endColumn:e.last,includeAllSlots:!0}}const m=r.createTableWalker(u,d),f=Array.from(m).map((({cell:e})=>e)),h=zi(f.filter((e=>e.hasAttribute(a)))),p=zi(f.filter((e=>!e.hasAttribute(a)))).map((t=>e.createRangeOn(t))),k=o.markMultiRangeDeletion(p,c);if(k&&("tableRow"==k.subType||"tableColumn"==k.subType)){const t=this._getSuggestionCoords(k);for(const n of h){const o=e.createRangeOn(n),i=r.getCellLocation(n),c=n.getAttribute(a)-1,u=t[l],d=t[g];u<=i[s]&&i[s]+c<=d&&k.addRange(o)}}}))}))}function i(n){const o=Array.from(t.getRanges()).map((e=>s.LiveRange.fromRange(e)));e.model.change((t=>{const r=t.batch;n=n.filter((e=>"$graveyard"!=e.root.rootName)),t.setSelection(n),e.commands.get("removeTableRow").refresh(),e.execute("removeTableRow",{forceDefaultExecution:!0}),e.model.enqueueChange((()=>{e.model.enqueueChange(r,(e=>{const t=o.filter((e=>"$graveyard"!=e.root.rootName));t.length>0&&e.setSelection(t);for(const e of o)e.detach()}))}))}))}function c(n){e.model.change((o=>{const r=Array.from(t.getRanges()).map((e=>s.LiveRange.fromRange(e))),i=[];for(const e of n)for(const t of e.getItems({shallow:!0}))i.push(t);for(const t of i)"$graveyard"!=t.root.rootName&&(o.setSelection(o.createPositionAt(t,0)),e.commands.get("removeTableColumn").refresh(),e.execute("removeTableColumn",{forceDefaultExecution:!0}));const a=r.filter((e=>"$graveyard"!=e.root.rootName));a.length>0&&o.setSelection(a);for(const e of r)e.detach()}))}function l(e,t){return t.every((t=>e.some((e=>e.end.isEqual(t.start)||t.end.isEqual(e.start)))))}function g(e,t){return e.some((e=>t.some((t=>e.end.isTouching(t.start)))))}e.data.downcastDispatcher.on("addMarker:suggestion",((e,t,n)=>{if(!n.options.showSuggestionHighlights)return;const o=t.item;if(!o)return;const r=n.mapper.toViewElement(o);function i(e){return Array.isArray(e)?e:[e]}r&&"tableCell"===o.name&&(0,a.setHighlightHandling)(r,n.writer,((e,t,n)=>n.addClass(i(t.classes),e)),((e,t,n)=>n.removeClass(i(t.classes),e)))}),{priority:"highest"}),o._descriptionFactory.registerDescriptionCallback((e=>{if("insertion"!=e.type&&"deletion"!=e.type)return;const t=e.getContainedElement();if(null!=t&&t.is("element","table")){if("insertion"==e.type){const t=e.getItems().filter((e=>e.is("textProxy"))).map((e=>e.data));if(t.length)return{type:"insertion",content:n("*Insert:* %0",n({string:"table *with text* %0",id:"ELEMENT_TABLE_WITH_TEXT"},'"'+t.join(" ")+'"'))}}if("deletion"==e.type){const t=e.getItems().filter((e=>e.is("textProxy"))).map((e=>e.data));if(t.length)return{type:"deletion",content:n("*Remove:* %0",n({string:"table *with text* %0",id:"ELEMENT_TABLE_WITH_TEXT"},'"'+t.join(" ")+'"'))}}}})),o._descriptionFactory.registerDescriptionCallback((e=>{if("tableRow"==e.subType){const t=e.getItems().filter((e=>e.is("textProxy"))).map((e=>e.data)),o=this._getSuggestionCoords(e),r=o.maxRow-o.minRow+1;if("insertion"==e.type)return t.length?{type:"insertion",content:n("*Insert:* %0",n({string:"table row *with text* %1",plural:"%0 table rows *with text* %1",id:"ELEMENT_TABLE_ROW_WITH_TEXT"},[r,'"'+t.join(" ")+'"']))}:{type:"insertion",content:n("*Insert:* %0",n({string:"table row",plural:"%0 table rows",id:"ELEMENT_TABLE_ROW"},r))};if("deletion"==e.type)return t.length?{type:"deletion",content:n("*Remove:* %0",n({string:"table row *with text* %1",plural:"%0 table rows *with text* %1",id:"ELEMENT_TABLE_ROW_WITH_TEXT"},[r,'"'+t.join(" ")+'"']))}:{type:"deletion",content:n("*Remove:* %0",n({string:"table row",plural:"%0 table rows",id:"ELEMENT_TABLE_ROW"},r))}}if("tableColumn"==e.subType){const t=e.getItems().filter((e=>e.is("textProxy"))).map((e=>e.data)),o=this._getSuggestionCoords(e),r=o.maxColumn-o.minColumn+1;if("insertion"==e.type)return t.length?{type:"insertion",content:n("*Insert:* %0",n({string:"table column *with text* %1",plural:"%0 table columns *with text* %1",id:"ELEMENT_TABLE_COLUMN_WITH_TEXT"},[r,'"'+t.join(" ")+'"']))}:{type:"insertion",content:n("*Insert:* %0",n({string:"table column",plural:"%0 table columns",id:"ELEMENT_TABLE_COLUMN"},r))};if("deletion"==e.type)return t.length?{type:"deletion",content:n("*Remove:* %0",n({string:"table column *with text* %1",plural:"%0 table columns *with text* %1",id:"ELEMENT_TABLE_COLUMN_WITH_TEXT"},[r,'"'+t.join(" ")+'"']))}:{type:"deletion",content:n("*Remove:* %0",n({string:"table column",plural:"%0 table columns",id:"ELEMENT_TABLE_COLUMN"},r))}}})),o._suggestionFactory.registerCustomCallback("insertion","tableRow","discard",i),o._suggestionFactory.registerCustomCallback("deletion","tableRow","accept",i),o._suggestionFactory.registerCustomCallback("insertion","tableColumn","discard",c),o._suggestionFactory.registerCustomCallback("deletion","tableColumn","accept",c),o._suggestionFactory.registerCustomCallback("insertion","tableColumn","join",l),o._suggestionFactory.registerCustomCallback("deletion","tableColumn","join",l),o._suggestionFactory.registerCustomCallback("insertion","tableRow","join",g),o._suggestionFactory.registerCustomCallback("deletion","tableRow","join",g)}_acceptFormatSuggestionCallbackFactory(){const e=this.editor,t=e.model.document.selection;return(n,o)=>{e.model.change((r=>{const{commandName:i,commandParams:a}=o;let c=n[0].end.nodeBefore;a&&a[0]&&!1===a[0].forceValue&&(c=n[0].start.nodeAfter);const l=r.createRangeIn(c);if("$graveyard"==l.root.rootName)return;const g=Array.from(t.getRanges()).map((e=>s.LiveRange.fromRange(e)));r.setSelection(l),e.commands.get(i).refresh(),a.push({forceDefaultExecution:!0}),e.execute(i,...a);const u=g.filter((e=>"$graveyard"!=e.root.rootName));u.length>0&&r.setSelection(u);for(const e of g)e.detach()}))}}_getCoordsForCells(e){const t=this.editor.plugins.get("TableUtils");let n=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER,r=Number.MAX_SAFE_INTEGER,i=Number.MIN_SAFE_INTEGER;for(const s of e){if("$graveyard"==s.root.rootName)continue;const{row:e,column:a}=t.getCellLocation(s),c=s.hasAttribute("rowspan")?s.getAttribute("rowspan")-1:0,l=s.hasAttribute("colspan")?s.getAttribute("colspan")-1:0;n=e<n?e:n,o=e+c>o?e+c:o,r=a<r?a:r,i=a+l>i?a+l:i}return{minRow:n,maxRow:o,minColumn:r,maxColumn:i}}_setupColumnsRowsFixing(){const e=this.editor,t=e.plugins.get("TrackChangesEditing"),n=e.plugins.get("TableUtils");this._tableSuggestions=new Set,e.model.document.on("change:data",(()=>{const n=Array.from(e.model.document.differ.getChangedMarkers());for(const{name:e,data:o}of n){const{group:n,id:r,subType:i}=t._splitMarkerName(e);if("suggestion"!=n)continue;if(null!=o.oldRange)continue;const s=t.getSuggestion(r);this._tablePostFixingSubtypes.includes(i)&&this._tableSuggestions.add(s)}}),{priority:"low"});const o=(e,t)=>{let o=!1;const r=t.createRangeOn(e),i=e.findAncestor("table"),s=n.getCellLocation(e);for(const t of this._tableSuggestions){const n=t.subType,a=n.startsWith("tablePaste"),c=n.substr(a?10:5),l=c.toLowerCase(),g=l.substr(0,3)+"span",u="min"+c,d="max"+c;if(!t.isInContent)continue;if(i!=t.getFirstRange().start.findAncestor("table"))continue;if(t.isIntersectingWithRange(r))continue;const m=e.hasAttribute(g)?e.getAttribute(g)-1:0,f=this._getSuggestionCoords(t),h=f[u],p=f[d];h<=s[l]&&s[l]+m<=p&&(t.addRange(r),o=!0)}return o};e.model.document.registerPostFixer((t=>{let n=!1;for(const r of e.model.document.differ.getChanges())if("insert"==r.type)if("tableRow"==r.name)for(const e of r.position.nodeAfter.getChildren())n=n||o(e,t);else"tableCell"==r.name&&(n=n||o(r.position.nodeAfter,t));return n}))}_getSuggestionCoords(e){return this._getCoordsForCells(e.getRanges().map((e=>e.start.nodeAfter)))}}function zi(e){return Array.from(new Set(e).values())}class Gi extends e.Plugin{static get requires(){return[Vi]}afterInit(){const e=this.editor,t=e.model.document.selection;if(!e.plugins.has("TableEditing"))return;const{t:n}=e.locale,o=e.plugins.get("TrackChangesEditing"),r=e.plugins.get("TableUtils"),i=e.plugins.get(Vi);i._tablePostFixingSubtypes.push("mergeTableCells"),o.enableCommand("mergeTableCells",(()=>{const t=r.getSelectionAffectedTableCells(e.model.document.selection);e.model.change((()=>{o.markMultiRangeBlockFormat(t,{commandName:"mergeTableCells",commandParams:[]},[],"mergeTableCells")}))})),e.commands.get("mergeTableCells").on("execute",((t,n)=>{e.commands.get("trackChanges").value&&(n.length>0&&n[n.length-1]&&n[n.length-1].forceDefaultExecution||o._isForcedDefaultExecutionBlock||this._areSelectedCellsMergable()||t.stop())}),{priority:"highest"});for(const t of["mergeTableCellUp","mergeTableCellRight","mergeTableCellDown","mergeTableCellLeft"]){const n=e.commands.get(t);o.enableCommand(t,(()=>{const t=e.model.document.selection.getFirstPosition().getAncestors().find((e=>e.is("element","tableCell"))),r=n.value;e.model.change((()=>{o.markMultiRangeBlockFormat([t,r],{commandName:"mergeTableCells",commandParams:[]},[],"mergeTableCells")}))}))}for(const t of["splitTableCellVertically","splitTableCellHorizontally"]){const n=e.commands.get(t);o.enableCommand(t,(()=>{const i=r.getSelectionAffectedTableCells(e.model.document.selection)[0],s=i.findAncestor("table"),{column:a,row:c}=r.getCellLocation(i);let l=[];if("horizontally"==n.direction){const e=r.createTableWalker(s,{startRow:c,endRow:c,includeAllSlots:!0});l=Array.from(e).map((e=>e.cell))}else{const e=r.createTableWalker(s,{column:a,includeAllSlots:!0});l=Array.from(e).map((e=>e.cell))}e.model.change((e=>{o.markBlockFormat(e.createRangeOn(i),{commandName:t,commandParams:[]},l,t)}))}))}o._descriptionFactory.registerDescriptionCallback((e=>{const{data:t}=e;if(t)return"mergeTableCells"==t.commandName?{type:"format",content:n("*Merge cells*")}:void 0})),o._descriptionFactory.registerDescriptionCallback((e=>{const{data:t}=e;if(t)return"splitTableCellVertically"==t.commandName?{type:"format",content:n("*Split cell:* vertically")}:"splitTableCellHorizontally"==t.commandName?{type:"format",content:n("*Split cell:* horizontally")}:void 0}));const a=i._acceptFormatSuggestionCallbackFactory();for(const e of["mergeTableCellUp","mergeTableCellRight","mergeTableCellDown","mergeTableCellLeft"])o._suggestionFactory.registerCustomCallback("formatBlock",e,"accept",a);for(const e of["splitTableCellVertically","splitTableCellHorizontally"])o._suggestionFactory.registerCustomCallback("formatBlock",e,"accept",a);o._suggestionFactory.registerCustomCallback("formatBlock","mergeTableCells","accept",(n=>{e.model.change((o=>{const r=Array.from(t.getRanges()).map((e=>s.LiveRange.fromRange(e)));o.setSelection(n),e.commands.get("mergeTableCells").refresh(),e.execute("mergeTableCells",{forceDefaultExecution:!0});const i=r.filter((e=>"$graveyard"!=e.root.rootName));i.length>0&&o.setSelection(i);for(const e of r)e.detach()}))}));for(const t of["mergeTableCellUp","mergeTableCellDown","mergeTableCellLeft","mergeTableCellRight"]){const n=e.commands.get(t);n.on("set:isEnabled",((t,o,r)=>{if(r){const o=e.model.document.selection.getFirstPosition().getAncestors().find((e=>e.is("element","tableCell")));this._areMergableCells(n.value,o)||(t.return=!1,t.stop())}}),{priority:"low"})}}_areSelectedCellsMergable(){const e=this.editor.commands.get("mergeTableCells"),t=this.editor.plugins.get("TableUtils");if(!e.isEnabled)return!1;const n=t.getSelectionAffectedTableCells(this.editor.model.document.selection);for(const e of n)for(const t of n)if(e!=t&&!this._areMergableCells(e,t))return!1;return!0}_areMergableCells(e,t){const n=this.editor.plugins.get("TrackChangesEditing"),o=this.editor.model.createRangeOn(e),r=this.editor.model.createRangeOn(t),i=new Set,s=new Set;for(const e of n.getSuggestions())if(("insertion"==e.type||"deletion"==e.type||"mergeTableCells"==e.subType)&&e.isInContent)for(const t of e.getRanges())t.containsRange(o,!0)&&i.add(e.type+":"+e.author.id),t.containsRange(r,!0)&&s.add(e.type+":"+e.author.id);if(i.size!=s.size)return!1;for(const e of i)if(!s.has(e))return!1;return!0}}class Wi extends e.Plugin{static get requires(){return[Vi]}afterInit(){const e=this.editor;if(!e.plugins.has("TableEditing"))return;const{t}=e.locale,n=e.plugins.get("TrackChangesEditing"),o=e.plugins.get("TableUtils"),r=e.plugins.get(Vi);function i({showActiveMarker:e=!0,setDataAttribute:t=!0}={}){return(r,i,s)=>{const{type:a,id:c}=n._splitMarkerName(i.markerName),l=n.getSuggestion(c);if(!l.data||"setTableColumnHeader"!=l.data.commandName)return;if(i.item)return void r.stop();if(!s.consumable.consume(i.markerRange,r.name))return;const g=i.markerRange.start.nodeAfter,u=i.markerRange.end.nodeBefore,d=g.parent.parent,{column:m}=o.getCellLocation(g),{column:f}=o.getCellLocation(u);for(let r=m;r<=f;r++){const l=o.createTableWalker(d,{column:r,includeAllSlots:!1});for(const o of l){const r=o.cell,l=s.mapper.toViewElement(r);s.writer.addClass("ck-suggestion-marker-"+a,l),t&&s.writer.setAttribute("data-suggestion",c,l),s.mapper.bindElementToMarker(l,i.markerName),e&&(n.activeMarkers.includes(i.markerName)?s.writer.addClass("ck-suggestion-marker--active",l):s.writer.removeClass("ck-suggestion-marker--active",l))}}}}n.enableCommand("setTableRowHeader",((t,r)=>{const i=o.getSelectionAffectedTableCells(e.model.document.selection),s=o.getRowIndexes(i),a=i[0].findAncestor("table"),c=a.getAttribute("headingRows")||0,l=r&&null!==r.forceValue?r.forceValue:!e.commands.get("setTableRowHeader").value,g=l?s.last:s.first,u=a.getChild(g);let d;if(l){const t=a.getChild(c);if(u.index<t.index)return;d=e.model.createRange(e.model.createPositionBefore(t.getChild(0)),e.model.createPositionAfter(u.getChild(u.childCount-1)))}else{const t=a.getChild(c-1);if(!t)return;d=e.model.createRange(e.model.createPositionBefore(u.getChild(0)),e.model.createPositionAfter(t.getChild(t.childCount-1)))}e.model.change((()=>{n.markBlockFormat(d,{commandName:"setTableRowHeader",commandParams:[{forceValue:l}]},[],"setTableRowHeader")}))})),n.enableCommand("setTableColumnHeader",((t,o)=>{const r=e.plugins.get("TableUtils"),i=r.getSelectionAffectedTableCells(e.model.document.selection),s=r.getColumnIndexes(i),a=i[0].findAncestor("table"),c=a.getAttribute("headingColumns")||0,l=o&&null!==o.forceValue?o.forceValue:!e.commands.get("setTableColumnHeader").value;let g;const u=a.getChild(0),d=l?s.last:s.first,m=r.createTableWalker(a,{startRow:0,column:d,includeAllSlots:!1}),f=Array.from(m)[0].cell;if(l){const t=u.getChild(c);if(f.isBefore(t))return;g=e.model.createRange(e.model.createPositionBefore(t),e.model.createPositionAfter(f))}else{const t=u.getChild(c-1);if(!t)return;g=e.model.createRange(e.model.createPositionBefore(f),e.model.createPositionAfter(t))}e.model.change((()=>{n.markBlockFormat(g,{commandName:"setTableColumnHeader",commandParams:[{forceValue:l}]},[],"setTableColumnHeader")}))})),e.editing.downcastDispatcher.on("addMarker:suggestion",i(),{priority:"highest"}),e.data.downcastDispatcher.on("addMarker:suggestion",((e,t,n)=>{n.options.showSuggestionHighlights&&i({showActiveMarker:!1,setDataAttribute:!1})(e,t,n)}),{priority:"highest"}),e.editing.downcastDispatcher.on("removeMarker:suggestion",((e,t,o)=>{const{type:r,id:i}=n._splitMarkerName(t.markerName),s=n.getSuggestion(i);if(!s.data||"setTableColumnHeader"!=s.data.commandName)return;const a=o.mapper.markerNameToElements(t.markerName);if(a)for(const e of a)o.writer.removeClass("ck-suggestion-marker-"+r,e),o.writer.removeClass("ck-suggestion-marker--active",e),o.writer.removeAttribute("data-suggestion",e),o.mapper.unbindElementFromMarkerName(e,t.markerName)}),{priority:"highest"}),n._descriptionFactory.registerDescriptionCallback((e=>{const{data:n}=e;if(n){if("setTableRowHeader"==n.commandName){const e=n.commandParams[0].forceValue;return o(t(e?{string:"header row",id:"FORMAT_HEADER_ROW"}:{string:"regular row",id:"FORMAT_REGULAR_ROW"}))}if("setTableColumnHeader"==n.commandName){const e=n.commandParams[0].forceValue;return o(t(e?{string:"header column",id:"FORMAT_HEADER_COLUMN"}:{string:"regular column",id:"FORMAT_REGULAR_COLUMN"}))}}function o(e){return{type:"format",content:t("*Format:* %0",e)}}}));const s=r._acceptFormatSuggestionCallbackFactory();n._suggestionFactory.registerCustomCallback("formatBlock","setTableRowHeader","accept",s),n._suggestionFactory.registerCustomCallback("formatBlock","setTableColumnHeader","accept",s)}}const qi=["tableCellBorderWidth","tableCellBorderColor","tableCellBorderStyle","tableCellHorizontalAlignment","tableCellVerticalAlignment","tableCellBackgroundColor","tableCellPadding"],$i=Object.fromEntries(qi.map((e=>[e,null])));class Ki extends e.Plugin{static get requires(){return[Vi]}afterInit(){const e=this.editor;if(!e.plugins.has("TableClipboard"))return;const{t:n}=e.locale,o=e.plugins.get("TrackChangesEditing"),r=e.plugins.get("TableUtils"),i=e.plugins.get(Vi),s=e.plugins.get("TableClipboard");i._tablePostFixingSubtypes.push("tablePasteRow","tablePasteColumn"),e.model.schema.register("tableCellSuggestion",{allowIn:"tableCell",allowContentOf:"tableCell",isLimit:!0}),e.conversion.elementToElement({model:"tableCellSuggestion",view:"suggestion-td"});let a=null;e.model.on("insertContent",((n,i)=>{const[c,l]=i,g=i[i.length-1];g&&g.forceDefaultExecution||o._isForcedDefaultExecutionBlock||this.editor.commands.get("trackChanges").value&&function(e,t,n,o,r){if(t&&!t.is("documentSelection"))return!1;const i=r.getTableIfOnlyTableInContent(e,n);if(!i||!Xi(i,null,o))return!1;const s=o.getSelectionAffectedTableCells(n.document.selection);if(!s.length)return!1;const a=s[0].findAncestor("table"),c=o.getRowIndexes(s),l=o.getColumnIndexes(s),g={startRow:c.first,endRow:c.last,startColumn:l.first,endColumn:l.last};return 1==s.length&&(g.endRow+=o.getRows(i)-1,g.endColumn+=o.getColumns(i)-1),Xi(a,g,o)}(c,l,e.model,r,s)&&(n.stop(),a={cells:[],insertionRanges:[],deletionRanges:[],rowInsertionRanges:[],rowInsertionIndexes:[],columnInsertionRanges:[],columnInsertionIndexes:[]},e.model.change((()=>{e.model.insertContent(i[0],i[1],i[2],i[3],{forceDefaultExecution:!0});const n=(0,t.uid)(),{rowInsertionRanges:r,columnInsertionRanges:s,insertionRanges:c,deletionRanges:l,cells:g}=a;r.length&&o.markMultiRangeInsertion(r,"tablePasteRow",{tablePasteChainId:n}),s.length&&o.markMultiRangeInsertion(s,"tablePasteColumn",{tablePasteChainId:n}),c.length&&o.markMultiRangeInsertion(c,"tablePaste",{tablePasteChainId:n,skipNestingCheck:!0}),l.length&&o.markMultiRangeDeletion(l,"tablePaste",{tablePasteChainId:n,skipNestingCheck:!0});const u=o.markMultiRangeBlockFormat(g.map((({element:e})=>e)),{formatGroupId:(0,t.uid)()},[],"tablePasteCell",{tablePasteChainId:n});if(u){const t=u.getMarkers(),n=[];for(const{element:o,attributes:r}of g){if(!r)continue;const i=e.model.createRangeOn(o),s=t.find((e=>e.getRange().isEqual(i)));s&&n.push([s.name,r])}n.length&&u.setAttribute("markerAttributes",Object.fromEntries(n))}a=null})))}),{priority:t.priorities.high+10}),e.plugins.get("TableClipboard").on("_replaceTableSlotCell",((e,t)=>{const[n,o,,r]=t;if(!a)return;e.stop();const i=n.cell,s=o,c=Zi(i),l=Zi(s);e.return=i;let g=null,u=null;if(l||c)if(c&&!l){r.remove(i.getChild(0));for(const e of Array.from(s.getChildren()))r.insert(e,i,"end");const e=a.rowInsertionIndexes.includes(n.row),t=a.columnInsertionIndexes.includes(n.column);e||t||(g=r.createRangeIn(i))}else l&&!c&&(u=r.createRangeIn(i));else{const e=r.createElement("tableCellSuggestion"),t=r.createElement("tableCellSuggestion");r.wrap(r.createRangeIn(i),t),r.insert(e,i,0);for(const t of Array.from(s.getChildren()))r.insert(t,e,"end");g=r.createRangeOn(e),u=r.createRangeOn(t)}const d=Array.from(s.getAttributes()).filter((([e])=>qi.includes(e)));a.cells.push({element:i,attributes:d.length?Object.fromEntries(d):null}),g&&a.insertionRanges.push(g),u&&a.deletionRanges.push(u)}),{priority:"high"}),r.on("insertColumns",((t,n)=>{const[o,i={}]=n;if(!a)return;const s=i.at||0,c=i.columns||1;a.columnInsertionIndexes=new Array(c).fill(s).map(((e,t)=>e+t));for(const{cell:t}of r.createTableWalker(o,{startColumn:s,endColumn:s+c-1}))a.columnInsertionRanges.push(e.model.createRangeOn(t))}),{priority:"low"}),r.on("insertRows",((t,n)=>{const[o,i={}]=n;if(!a)return;const s=i.at||0,c=i.rows||1;a.rowInsertionIndexes=new Array(c).fill(s).map(((e,t)=>e+t));for(const{cell:t}of r.createTableWalker(o,{startRow:s,endRow:s+c-1}))a.rowInsertionRanges.push(e.model.createRangeOn(t))}),{priority:"low"}),o._descriptionFactory.registerDescriptionCallback((e=>{if(e.subType&&e.subType.startsWith("tablePaste"))return e.previous?{}:{type:"insertion",content:n("*Replace table cells*")}}));const c=()=>{};for(const e of["tablePaste","tablePasteColumn","tablePasteRow","tablePasteCell"])o._suggestionFactory.registerCustomCallback("insertion",e,"join",c),o._suggestionFactory.registerCustomCallback("deletion",e,"join",c);o._suggestionFactory.registerCustomCallback("formatBlock","tablePasteCell","discard",c),o._suggestionFactory.registerCustomCallback("formatBlock","tablePasteCell","accept",((t,n,o)=>{const r=t.map((e=>e.getContainedElement())).filter((e=>e)),i=new Map(r.map((e=>[e,null])));if(a)for(const{element:e,attributes:t}of a.cells)t&&i.set(e,t);else if(o&&o.markerAttributes)for(const[t,n]of Object.entries(o.markerAttributes)){const o=e.model.markers.get(t),r=o?o.getRange().getContainedElement():null;r&&i.set(r,n)}e.model.change((e=>{for(const[t,n]of i)e.setAttributes({...$i,...n},t)}))}));const l=(t,n)=>{o._suggestionFactory.registerCustomCallback(t,"tablePaste",n,((r,i,s)=>{e.model.change((e=>{const a=[];for(const e of r){const t=e.start.nodeAfter;t.is("element","tableCellSuggestion")&&a.push(t)}o._suggestionFactory.getSuggestionCallback(t,null,n)(r,i,s);for(const t of a)"$graveyard"!=t.root.rootName&&e.unwrap(t)}))}))};l("insertion","accept"),l("insertion","discard"),l("deletion","accept"),l("deletion","discard"),o._suggestionFactory.registerCustomCallback("insertion","tablePasteRow","discard",(e=>{const t=e.map((e=>e.getContainedElement())),n=t[0].findAncestor("table"),{minRow:o,maxRow:s}=i._getCoordsForCells(t);r.removeRows(n,{at:o,rows:s-o+1})})),o._suggestionFactory.registerCustomCallback("insertion","tablePasteColumn","discard",(e=>{const t=e.map((e=>e.getContainedElement())),n=t[0].findAncestor("table"),{minColumn:o,maxColumn:s}=i._getCoordsForCells(t);r.removeColumns(n,{at:o,columns:s-o+1})}));const g=(e,t)=>{if(!t.subType||!t.subType.startsWith("tablePaste"))return;const n=t.attributes.tablePasteChainId,r=o.getSuggestions().filter((e=>e.isInContent&&e.attributes&&e.attributes.tablePasteChainId==n));r.length&&t.getAllAdjacentSuggestions().length!=r.length&&r.reduce(((e,t)=>(e.next=t,t.previous=e,t)))};function u(e,{showActiveMarker:t=!0}={}){const{id:n}=o._splitMarkerName(e.markerName),r=["ck-suggestion-marker","ck-suggestion-marker-insertion"],i=o.activeMarkers.includes(e.markerName);return i&&r.push("ck-suggestion-marker--active"),{classes:r,attributes:{"data-suggestion":n},priority:i&&t?3010:3e3}}o.on("suggestionLoaded",g,{priority:"high"}),o.on("suggestionUnloaded",g,{priority:"high"}),e.model.document.registerPostFixer((()=>{let t=!1;const n=Array.from(e.model.document.differ.getChangedMarkers());for(const{name:r,data:i}of n){const{group:n,type:s,id:a}=o._splitMarkerName(r);if("suggestion"!=n||"deletion"!=s||i.oldRange)continue;if(!o.hasSuggestion(a))continue;const c=o.getSuggestion(a).getRanges(),l=e.plugins.get("Users").me;for(const e of o.getSuggestions())if(e.isInContent&&e.author==l&&"formatBlock"==e.type&&"tablePasteCell"==e.subType&&e.getRanges().every((e=>c.some((t=>t.containsRange(e,!0))))))for(const n of e.getAllAdjacentSuggestions())n.isInContent&&(n.discard(),t=!0)}return t})),e.model.document.registerPostFixer((t=>{const n=e.commands.get("redo");if(!n||!n._createdBatches.has(t.batch))return!1;let r=!1;const i=e.plugins.get("Users").me,s=e.model.document.differ.getChanges(),a=Array.from(e.model.document.differ.getChangedMarkers()).filter((({name:e,data:t})=>{const{group:n,subType:r,authorId:s}=o._splitMarkerName(e);return"suggestion"==n&&"tablePaste"==r&&s==i.id&&!t.oldRange}));for(const e of s){if("insert"!=e.type||"tableCellSuggestion"!=e.name||1!=e.length)continue;const n=t.createRange(e.position,e.position.getShiftedBy(1));if(!a.find((({data:e})=>e.newRange.isEqual(n))))for(const{name:e,data:o}of a)if(n.containsRange(o.newRange)){t.updateMarker(e,{range:n}),r=!0;break}}return r})),e.model.document.registerPostFixer((t=>{let n=!1;const r=e.plugins.get("Users").me,i=o.getSuggestions().filter((e=>e.isInContent&&e.author==r)),s=new Set,a=new Set;for(const e of i)if("tablePaste"==e.subType)for(const t of e.getMarkers()){const o=t.getRange().getContainedElement();if(o)if(o.is("element","tableCellSuggestion")&&Zi(o)){e.removeMarker(t.name),s.add(o),n=!0;const r=o.nextSibling,i=o.previousSibling,c=r&&r.is("element","tableCellSuggestion"),l=i&&i.is("element","tableCellSuggestion");c&&!s.has(r)&&a.add(r),l&&!s.has(i)&&a.add(i)}else o.is("element","paragraph")&&o.isEmpty&&(e.removeMarker(t.name),n=!0)}else if("tablePasteCell"==e.subType){if(!e.attributes||!e.attributes.tablePasteChainId)continue;const t=e.attributes.markerAttributes;if(t&&Object.keys(t).length)continue;const o=e.attributes.tablePasteChainId;let r=!0,s=!0;for(const t of i)if(t.subType&&t.subType.startsWith("tablePaste")){if(!t.attributes.tablePasteChainId){s=!1;break}if(t.id!=e.id&&t.attributes.tablePasteChainId==o){r=!1;break}}s&&r&&(e.removeMarkers(),n=!0)}for(const e of s)t.remove(e);for(const e of a)t.unwrap(e);return n})),e.conversion.for("editingDowncast").markerToHighlight({model:"suggestion:formatBlock:tablePasteCell",view:u,converterPriority:"high"}),e.conversion.for("dataDowncast").markerToHighlight({model:"suggestion:formatBlock:tablePasteCell",view:(e,t)=>{if(t.options.showSuggestionHighlights)return u(e,{showActiveMarker:!1})},converterPriority:"high"});const d=e.editing.view;this.listenTo(d.document,"clipboardOutput",((e,t)=>{const n=[];for(const e of d.createRangeIn(t.content).getItems())e.is("element","suggestion-td")&&n.push(e);d.change((e=>{for(const t of n)e.move(e.createRangeIn(t),e.createPositionBefore(t)),e.remove(t)}))}))}}function Zi(e){if(e.isEmpty)return!0;const t=e.getChild(0);return t.is("element","paragraph")&&t.isEmpty}function Xi(e,t={},n){for(const{isAnchor:o,cellHeight:r,cellWidth:i}of n.createTableWalker(e,{includeAllSlots:!0,...t}))if(!o||1!=r||1!=i)return!1;return!0}class Qi extends e.Plugin{afterInit(){const e=this.editor,t=e.t;if(!e.plugins.has("Title"))return;const n=e.plugins.get("TrackChangesEditing");n._descriptionFactory.registerElementLabel("title-content",(()=>t({id:"ELEMENT_TITLE",string:"title"}))),e.model.document.registerPostFixer((t=>{let o=!1;const r=Array.from(e.model.document.differ.getChangedMarkers());for(const{name:i,data:s}of r){const{group:r}=n._splitMarkerName(i);if("suggestion"!==r||!s.newRange)continue;const a=s.newRange,c=a.end.nodeBefore;if(!c||!c.is("element","title-content"))continue;if(!a.start.isTouching(a.end))continue;const l=e.model.schema.getNearestSelectionRange(a.end,"forward");if(l&&l.isCollapsed){const e=t.createRange(a.start,l.start);e.isEqual(a)||(t.updateMarker(i,{range:e}),o=!0)}o||(t.removeMarker(i),o=!0)}return o}))}}const Ji=["afterInit","get","enableCommand","editor","redo","plugins","TrackChangesEditing","UndoEditing"];var Yi,es;Yi=Ji,es=344,function(e){for(;--e;)Yi.push(Yi.shift())}(++es);const ts=function(e,t){return Ji[e-=0]};class ns extends e.Plugin{[ts("0x0")](){const e=this[ts("0x3")],t=e[ts("0x5")][ts("0x1")](ts("0x6"));e[ts("0x5")].has(ts("0x7"))&&(t.enableCommand("undo"),t[ts("0x2")](ts("0x4")))}}const os=["object","charCodeAt","sign","keys","number","sort","isArray"];var rs,is;rs=os,is=205,function(e){for(;--e;)rs.push(rs.shift())}(++is);const ss=function(e,t){return os[e-=0]};function*as(e){e?"boolean"==typeof e?yield 1:Array[ss("0x4")](e)?yield*function*(e){for(const t of e)yield*as(t)}(e):ss("0x5")==typeof e?yield*cs(e):"string"==typeof e?yield*ls(e):ss("0x2")==typeof e&&(yield e):yield 0}function*cs(e){if(yield gs("{"),e){const t=Object[ss("0x1")](e)[ss("0x3")]();for(const n of t){yield*ls(n),yield gs(":");const t=e[n];yield*as(t)}}yield gs("}")}function*ls(e){yield gs('"');for(const t of e)yield gs(t);yield gs('"')}function gs(e){return e[ss("0x6")](0)}function us(e){return(e*=Math[ss("0x0")](e)).toString(36)}class ds extends e.Plugin{static get requires(){return["CommentsRepository",i.Users,e.PendingActions,br,Sr,Rr,Nr,Br,zr,Zr,Qr,Jr,ei,oi,si,ai,di,mi,fi,xi,Ei,Si,Ri,Ii,Li,Bi,Di,Vi,Gi,Wi,Ki,Qi,ns]}static get pluginName(){return"TrackChangesEditing"}constructor(e){function t(e){return e.map((e=>String.fromCharCode(e))).join("")}super(e),this.set("activeMarkers",[]),this.on("change:activeMarkers",((t,n,o,r)=>{this._model.change((()=>{for(const t of[...r,...o])this._model.markers.has(t)&&e.editing.reconvertMarker(t)}))})),this._descriptionFactory=new ur(this.editor.model.schema,this.editor.locale),this._adapter=null,this._suggestionFactory=new ms(this.editor),this._suggestions=new Map,this._commentsRepository=e.plugins.get("CommentsRepository"),this._enabledCommands=new Set,this._model=this.editor.model,this._suggestionState=new WeakMap,this._isForcedDefaultExecutionBlock=!1,this[t([95,101,120,101,99,117,116,101,83,117,103,103,101,115,116,105,111,110])]=t([52,48,52,52,48,54,49,56])}init(){const e=this.editor;e.conversion.for("editingDowncast").markerToHighlight({model:"suggestion",view:e=>{const{id:t,type:n}=this._splitMarkerName(e.markerName),o=["ck-suggestion-marker","ck-suggestion-marker-"+n];let r=3e3;return this.activeMarkers.includes(e.markerName)&&(o.push("ck-suggestion-marker--active"),r=3010),"deletion"==n&&(r+=5),{classes:o,attributes:{"data-suggestion":t},priority:r}}}),e.conversion.for("dataDowncast").add((t=>{t.on("addMarker:suggestion",((t,n,o)=>{if(!o.options.showSuggestionHighlights)return;const r=n.item;if(!r)return;const i=o.mapper.toViewElement(r);e.model.schema.isObject(r)&&i&&!i.getCustomProperty("widget")&&i.is("containerElement")&&(0,a.toWidget)(i,o.writer)}),{priority:"high"})})),e.conversion.for("dataDowncast").markerToHighlight({model:"suggestion",view:(e,t)=>{if(!t.options.showSuggestionHighlights)return null;const{type:n}=this._splitMarkerName(e.markerName);return{classes:["ck-suggestion-marker","ck-suggestion-marker-"+n],priority:3e3}}});const n=({showActiveMarkers:t=!0}={})=>(n,o,r)=>{if(!o.item)return;if(o.item.is("selection"))return void r.consumable.consume(o.item,n.name);const i=r.mapper.toViewElement(o.item);if(!o.item.is("element")||!e.model.schema.isBlock(o.item)||i.getCustomProperty("addHighlight"))return;const{id:s}=this._splitMarkerName(o.markerName);r.writer.addClass(["ck-suggestion-marker","ck-suggestion-marker-formatBlock"],i),r.writer.setAttribute("data-suggestion",s,i),r.mapper.bindElementToMarker(i,o.markerName),t&&(this.activeMarkers.includes(o.markerName)?r.writer.addClass("ck-suggestion-marker--active",i):r.writer.removeClass("ck-suggestion-marker--active",i));for(const t of e.model.createRangeIn(o.item).getItems())r.consumable.consume(t,n.name);r.consumable.consume(o.item,n.name)};e.conversion.for("dataDowncast").add((e=>{e.on("addMarker:suggestion:formatBlock",((e,t,o)=>{o.options.showSuggestionHighlights&&n({showActiveMarkers:!1})(e,t,o)}),{priority:"highest"})})),e.conversion.for("dataDowncast").markerToData({model:"suggestion",view:(e,t)=>t.options.showSuggestionHighlights?null:{group:"suggestion",name:e.substr("suggestion".length+1)}}),e.conversion.for("upcast").elementToElement({view:{name:"suggestion",attribute:{id:/^\w/,suggestionType:/^\w/}},model:(e,{writer:t})=>{let n="suggestion:"+e.getAttribute("suggestion-type")+":"+e.getAttribute("id");return e.getAttribute("marker-count")&&(n+=":"+e.getAttribute("marker-count")),t.createElement("$marker",{"data-name":n})}}),e.conversion.for("upcast").dataToMarker({view:"suggestion"}),e.conversion.for("editingDowncast").add((e=>{e.on("addMarker:suggestion:formatBlock",n(),{priority:"high"})})),e.conversion.for("editingDowncast").add((e=>{e.on("removeMarker:suggestion:formatBlock",((e,t,n)=>{const o=n.mapper.markerNameToElements(t.markerName);if(o)for(const e of o)e.getCustomProperty("addHighlight")||(n.writer.removeClass(["ck-suggestion-marker","ck-suggestion-marker-formatBlock","ck-suggestion-marker--active"],e),n.writer.removeAttribute("data-suggestion",e),n.mapper.unbindElementFromMarkerName(e,t.markerName))}),{priority:"high"})})),e.model.document.registerPostFixer((t=>{let n=!1;const o=Array.from(e.model.document.differ.getChangedMarkers());for(const{name:s,data:a}of o){const{group:o,type:c,id:l}=this._splitMarkerName(s);if("suggestion"!==o)continue;const g=this._suggestions.get(l);if(null!=a.newRange)if("formatInline"==c&&(n=n||ps(a.newRange,s,t,e.model.schema)),a.newRange.isCollapsed||"$graveyard"==a.newRange.root.rootName||"formatBlock"==c&&!bs(a.newRange)||"deletion"==c&&(hs(i=a.newRange)||(r=i).start.parent==r.end.nodeBefore&&r.start.isAtEnd))t.removeMarker(s),n=!0;else{if(!g||!g.isInContent)continue;n=!!this._joinWithAdjacentSuggestions(g)||n}}var r,i;return n})),e.model.document.registerPostFixer((t=>{let n=!1;for(const o of e.model.document.differ.getChanges()){if("insert"!=o.type)continue;const r=o.position.getShiftedBy(o.length);if(r.isAtEnd)for(const i of this._suggestions.values()){if(i.isMultiRange||!i.isInContent)continue;if("formatBlock"!=i.type)continue;const s=i.getFirstRange();if(s.start.parent!=s.end.parent&&s.end.isEqual(o.position)){const o=e.model.createRange(s.start,r);t.updateMarker(i.getFirstMarker(),{range:o}),n=!0}}}return n})),e.model.markers.on("update:suggestion",((e,t,n)=>{if(null==n){const{id:e}=this._splitMarkerName(t.name),n=this._suggestions.get(e);n&&n.addMarkerName(t.name)}})),e.model.document.on("change:data",(()=>{const t=Array.from(e.model.document.differ.getChangedMarkers());t.sort(((e,t)=>{const n=e.data.oldRange,o=t.data.oldRange;return null===n&&null===o?0:null===n&&null!==o?-1:null!==n&&null===o?1:n.start.isBefore(o.start)?-1:1}));const n=new Set;for(const{name:e,data:o}of t){const{group:t,id:r}=this._splitMarkerName(e);if("suggestion"===t&&(null===o.oldRange&&this._handleNewSuggestionMarker(e),null===o.newRange)){const e=this._suggestions.get(r);e.isInContent?n.add(e):this._removeSuggestion(e)}}for(const{name:e,data:o}of t){const{group:t,id:r}=this._splitMarkerName(e);if("suggestion"!==t)continue;const i=this._suggestions.get(r);null!=o.newRange&&null!=o.oldRange&&(this._refreshSuggestionsChain(i),n.add(i.head))}for(const e of n)this.fire("suggestionChanged",e);n.clear()})),e.model.on("applyOperation",((t,n)=>{const o=n[0];if(!this._suggestions.size)return;if(!o.isDocumentOperation)return;if(o.batch.isUndo||!o.batch.isLocal)return;let r,i;switch(o.type){case"insert":r=e.model.createPositionAt(o.position),i=r.getShiftedBy(o.howMany);break;case"split":r=e.model.createPositionAt(o.splitPosition),i=e.model.createPositionAt(o.moveTargetPosition);break;case"move":r=e.model.createPositionAt(o.targetPosition),i=r.getShiftedBy(o.howMany);break;default:return}const s=e.model.createRange(r,i);e.model.change((()=>{for(const{suggestion:e,meta:t}of this._findSuggestions(s)){if(e.isMultiRange)continue;if("formatInline"==e.type)continue;const n=e.data&&e.data.multipleBlocks;("formatBlock"!=e.type||"split"==o.type&&!n)&&(t.containsRangeInObject||"insertion"==e.type&&t.isOwn||e.getFirstRange().containsRange(s)&&this._breakSuggestionMarker(e,r,i))}}))}),{priority:"lowest"}),e.model.on("deleteContent",((t,n)=>{const o=n[0],r=n[1];if(r&&r.forceDefaultExecution)return;if(this._isForcedDefaultExecutionBlock)return;if(!this.trackChangesCommand.value)return;if(o.isCollapsed)return;const i=e.model.schema,{start:s,end:a}=o.getFirstRange(),c=s.nodeAfter&&i.isObject(s.nodeAfter)?null:i.getNearestSelectionRange(s,"forward"),l=a.nodeBefore&&i.isObject(a.nodeBefore)?null:i.getNearestSelectionRange(a,"backward"),g=e.model.createRange(c?c.start:s,l?l.end:a);e.model.change((t=>{this.markDeletion(g);const n=e.model.schema.getNearestSelectionRange(g.start);o.is("documentSelection")?t.setSelection(n):o.setTo(n)})),t.stop()}),{priority:t.priorities.normal+10}),e.model.on("insertContent",((t,n)=>{const o=n[n.length-1];o&&o.forceDefaultExecution||this._isForcedDefaultExecutionBlock||this.trackChangesCommand.value&&(e.model.change((()=>{let o=e.model.insertContent(n[0],n[1],n[2],n[3],{forceDefaultExecution:!0});if(!o)return;t.return=o.clone();const r=o.end.nodeBefore,i=e.model.schema;r&&i.isBlock(r)&&!i.isObject(r)&&(o=e.model.createRange(o.start,e.model.createPositionAt(r,"end"))),this.markInsertion(o)})),t.stop())}),{priority:"high"}),this.trackChangesCommand=new d(e,this._enabledCommands),this.editor.commands.add("trackChanges",this.trackChangesCommand),this.enableCommand("trackChanges");const o=new k(e,this._suggestions);e.commands.add("acceptSuggestion",o),this.enableCommand("acceptSuggestion");const r=new C(e,this._suggestions);e.commands.add("discardSuggestion",r),this.enableCommand("discardSuggestion"),e.commands.add("acceptAllSuggestions",new N(e,o,this._suggestions)),this.enableCommand("acceptAllSuggestions"),e.commands.add("discardAllSuggestions",new $(e,r,this._suggestions)),this.enableCommand("discardAllSuggestions"),e.commands.add("acceptSelectedSuggestions",new V(e,o,this._suggestions)),this.enableCommand("acceptSelectedSuggestions"),e.commands.add("discardSelectedSuggestions",new J(e,r,this._suggestions)),this.enableCommand("discardSelectedSuggestions");const i=e.plugins.get("CommentsRepository");this.listenTo(i,"addComment",((e,{threadId:t})=>{const n=this._suggestions.get(t);n&&n.commentThread&&1===n.commentThread.length&&this._updateSuggestionData(t,{hasComments:!0})}),{priority:"low"}),this.listenTo(i,"removeComment",((e,{threadId:t})=>{const n=this._suggestions.get(t);n&&n.commentThread&&!n.commentThread.length&&this._updateSuggestionData(t,{hasComments:!1})}),{priority:"low"})}set adapter(e){if(this._adapter)throw new t.CKEditorError("track-changes-adapter-already-set",this);this._adapter=e}get adapter(){return this._adapter}getSuggestions({skipNotAttached:e=!1,toJSON:t=!1}={}){const n=[];for(const t of this._suggestions.values())e&&!t.isInContent||n.push(t);return t?n.map((e=>e.toJSON())):n}getSuggestion(e){const n=this._suggestions.get(e);if(!n)throw new t.CKEditorError("track-changes-suggestion-not-found",this);return n}hasSuggestion(e){return this._suggestions.has(e)}addSuggestionData(e){const{id:t,authorId:n}=e,[o,r]=e.type.split(":"),i=this._suggestions.get(t)||this._createSuggestion(o,r,t,n);switch(this._addThreadToSuggestion(i),this._checkSuggestionCorrectness(i,o,r||null,n),i.createdAt=e.createdAt,e.data&&(i.data=e.data),e.attributes&&(i.attributes=e.attributes),this._adapter&&this._adapter.addSuggestion||(i._saved=!0),this._suggestionState.get(i)){case"notReady":this._suggestionState.set(i,"dataReady");break;case"markerReady":i.isInContent?(this._suggestionState.set(i,"ready"),this.fire("suggestionLoaded",i)):this._suggestionState.set(i,"removed")}return i}acceptSuggestion(e){this.forceDefaultExecution((()=>{this.editor.model.change((()=>{for(const t of e.getAllAdjacentSuggestions())t.accept()}))}))}discardSuggestion(e){this.forceDefaultExecution((()=>{this.editor.model.change((()=>{for(const t of e.getAllAdjacentSuggestions())t.discard()}))}))}enableCommand(e,n){const o=this.editor.commands.get(e);if(!o)throw new t.CKEditorError("track-changes-command-not-found",this,{commandName:e});this._enabledCommands.add(o),n&&o.on("execute",((e,t)=>{this.trackChangesCommand.value&&(this._isForcedDefaultExecutionBlock||t.length>0&&t[t.length-1]&&t[t.length-1].forceDefaultExecution||(n(((...e)=>o.execute(...e,{forceDefaultExecution:!0})),...t),e.stop()))}),{priority:"high"})}forceDefaultExecution(e){let n,o;const r=this._isForcedDefaultExecutionBlock;this._isForcedDefaultExecutionBlock=!0;try{n=e()}catch(e){o=e}return r||(this._isForcedDefaultExecutionBlock=!1),o&&t.CKEditorError.rethrowUnexpectedError(o,this),n}markInsertion(e,n=null,o={}){if(e.isCollapsed)return null;const r=this.editor.plugins.get("Users").me;for(const{suggestion:t,meta:o}of this._findSuggestions(e,"insertion"))if(o.isOwn){if(!o.isNextTo)return t;if(n==t.subType){const n=t.getFirstRange();return n.start.isEqual(e.end)?this._setSuggestionRange(t,this._model.createRange(e.start,n.end)):this._setSuggestionRange(t,this._model.createRange(n.start,e.end)),t}}const i=(0,t.uid)(),s=r.id,a=n?"insertion:"+n:"insertion",c=this._setSuggestionData({id:i,type:a,createdAt:new Date,authorId:s,attributes:o});return this._addSuggestionMarker(a,i,s,e),c}markMultiRangeInsertion(e,n="multi",o={}){const r=this.editor.plugins.get("Users").me,i=this._suggestionFactory.getSuggestionCallback("insertion",n,"join");for(const t of this.getSuggestions())if(t.author.id==r.id&&"insertion"==t.type&&t.subType==n&&(i(t.getRanges(),e)||i(e,t.getRanges()))){for(const n of e)t.addRange(n);return t}for(const t of e)for(const{suggestion:n,meta:o}of this._findSuggestions(t,"insertion")){if(!o.isOwn)continue;let t=!0;for(const o of n.getRanges())for(const n of e)if(!o.containsRange(n)){t=!1;break}if(t)return n}const s=(0,t.uid)(),a=r.id,c="insertion:"+n,l=this._setSuggestionData({id:s,type:c,createdAt:new Date,authorId:a,attributes:o});for(const t of e)this._addSuggestionMarker(c,s,a,t,gr.getMultiRangeId());return l}markInlineFormat(e,n,o=null,r={}){if(o=o||ks(n),e.isCollapsed)return;const i=this.editor.plugins.get("Users").me,s=[];for(const{suggestion:t,meta:n}of this._findSuggestions(e,"insertion"))n.isOwn&&!n.isInsideObject&&s.push(...t.getRanges());const a=function(e,t){const n=[];for(const o of t){const t=e.getIntersection(o);t&&n.push(t)}return n}(e,s),c=function(e,t){const n=[e];for(const e of t){let t=0;for(;t<n.length;){const o=n[t].getDifference(e);n.splice(t,1,...o),t+=o.length}}return n}(e,s);a.length&&this._model.change((()=>{for(const e of a){const t=this._suggestionFactory.getSuggestionCallback("formatInline",o,"accept");this.forceDefaultExecution((()=>t([e],n,r)))}}));for(const e of c){let s=null,a=e.start,c=e.end;for(const{suggestion:t,meta:n}of this._findSuggestions(e,"formatInline")){if(!n.isOwn)continue;if(t.subType!=o)continue;const r=t.getFirstRange();if(r.containsRange(e,!0))return;a=a.isBefore(r.start)?a:r.start,c=c.isAfter(r.end)?c:r.end,s?r.start.isBefore(s.getFirstRange().start)?(s.removeMarkers(),s=t):t.removeMarkers():s=t}const l=this._model.createRange(a,c);if(s)this._setSuggestionRange(s,l);else{const e=(0,t.uid)(),s=i.id;this._setSuggestionData({id:e,type:"formatInline:"+o,data:n,createdAt:new Date,authorId:s,attributes:r}),this._addSuggestionMarker("formatInline:"+o,e,s,l)}}}markBlockFormat(e,n,o=[],r=null,i={}){n.formatGroupId||(n.formatGroupId=n.commandName),n.multipleBlocks=e.is("range"),r=r||ks(n);const s=o.map((e=>xs(e,this._model))),a=e.is("range")?e:xs(e,this._model);s.push(a);let c=!0;for(const e of s)if(!this._rangeIsInLocalUserInsertion(e)){c=!1;break}if(c){const e=this._suggestionFactory.getSuggestionCallback("formatBlock",r,"accept");return void this.forceDefaultExecution((()=>e([a],n,i)))}let l=null,g=a.start,u=a.end;for(const{suggestion:e,meta:t}of this._findSuggestions(a,"formatBlock")){if(!t.isOwn||t.isNextTo||t.containsRangeInObject||t.isInsideObject)continue;if(e.data.formatGroupId!=n.formatGroupId)continue;const o=e.getFirstRange();if(e.subType==r){if(o.containsRange(a,!0))return;g=g.isBefore(o.start)?g:o.start,u=u.isAfter(o.end)?u:o.end,l?o.start.isBefore(l.getFirstRange().start)?(l.removeMarkers(),l=e):e.removeMarkers():l=e}else{const t=a.getIntersection(o);this._cutOutSuggestionMarker(e,t)}}const d=this.editor.plugins.get("Users").me,m=(0,t.uid)(),f=d.id;l?this._setSuggestionRange(l,this._model.createRange(g,u)):(this._setSuggestionData({id:m,type:"formatBlock:"+r,data:n,createdAt:new Date,authorId:f,attributes:i}),this._addSuggestionMarker("formatBlock:"+r,m,f,this._model.createRange(g,u)))}markMultiRangeBlockFormat(e,n,o=[],r=null,i={}){n.formatGroupId||(n.formatGroupId=n.commandName),n.multipleBlocks=!1,r=r||ks(n);const s=o.map((e=>xs(e,this._model))),a=e.map((e=>xs(e,this._model)));s.push(...a);let c=!0;for(const e of s)if(!this._rangeIsInLocalUserInsertion(e)){c=!1;break}if(c){const e=this._suggestionFactory.getSuggestionCallback("formatBlock",r,"accept");return void this.forceDefaultExecution((()=>e(a,n,i)))}const l=this.editor.plugins.get("Users").me;for(const e of this.getSuggestions()){if(e.author.id!=l.id)continue;if("formatBlock"!=e.type||e.data.formatGroupId!=n.formatGroupId)continue;const t=e.subType==r;for(let n=0;n<a.length;n++){const o=a[n];for(const r of e.getMarkers()){const i=r.getRange();if(o.isEqual(i)){t?(a.splice(n,1),n--):e.removeMarker(r.name);break}}}}if(0==a.length)return;const g=this._suggestionFactory.getSuggestionCallback("formatBlock",r,"join");for(const e of this.getSuggestions())if(e.author.id==l.id&&"formatBlock"==e.type&&e.data.formatGroupId==n.formatGroupId&&e.subType==r&&(g(e.getRanges(),a)||g(a,e.getRanges()))){for(const t of a)e.addRange(t);return e}const u=(0,t.uid)(),d=l.id,m="formatBlock:"+r,f=this._setSuggestionData({id:u,type:m,data:n,createdAt:new Date,authorId:d,attributes:i});for(const e of a)this._addSuggestionMarker(m,u,d,e,gr.getMultiRangeId());return f}markDeletion(e,n=null,o={}){if(e.isCollapsed)return null;const r=this.editor.plugins.get("Users").me,i=new s.LiveRange(e.start,e.end);for(const{suggestion:e,meta:t}of this._findSuggestions(i,"insertion"))if(t.isOwn&&!t.isNextTo)if(e.isMultiRange){const t=e.getRanges().filter((e=>"$graveyard"!=e.root.rootName));if(t.every((e=>i.containsRange(e,!0)))&&e.discard(),t.some((e=>e.containsRange(i,!0)))){const e=this._suggestionFactory.getSuggestionCallback("deletion",n,"accept");return this.forceDefaultExecution((()=>e([i],null,o))),null}}else{const t=i.getIntersection(e.getFirstRange());e._onDiscard([t],null,o)}if(i.detach(),i.isCollapsed||"$graveyard"==i.root.rootName)return null;let a=null,c=i.start,l=i.end;for(const{suggestion:e,meta:t}of this._findSuggestions(i,"deletion"))if(t.isOwn)if(e.isMultiRange){let t=!0;for(const n of e.getRanges()){if(n.containsRange(i,!0))return e;i.containsRange(n)||(t=!1)}t&&e.discard()}else{const t=e.getFirstRange();if(t.containsRange(i,!0))return e;c=c.isBefore(t.start)?c:t.start,l=l.isAfter(t.end)?l:t.end,a?t.start.isBefore(a.getFirstRange().start)?(a.removeMarkers(),a=e):e.removeMarkers():a=e}if(a)return this._setSuggestionRange(a,this._model.createRange(c,l)),a;{const e=(0,t.uid)(),i=this._model.createRange(c,l),s=r.id,a=n?"deletion:"+n:"deletion",g=this._setSuggestionData({id:e,type:a,createdAt:new Date,authorId:s,attributes:o});return this._addSuggestionMarker(a,e,s,i),g}}markMultiRangeDeletion(e,n="multi",o={}){const r=this.editor.plugins.get("Users").me,i=e.map((e=>new s.LiveRange(e.start,e.end))),a=new Set;for(const e of i)for(const{suggestion:t,meta:n}of this._findSuggestions(e,"insertion"))n.isOwn&&!n.isNextTo&&a.add(t);for(const t of a)if(t.isMultiRange){const r=t.getRanges();if((!t.attributes||!t.attributes.skipNestingCheck)&&r.every((e=>i.some((t=>t.containsRange(e,!0)))))&&t.discard(),i.every((e=>r.some((t=>t.containsRange(e,!0)))))){const t=this._suggestionFactory.getSuggestionCallback("deletion",n,"accept");return this.forceDefaultExecution((()=>t(e,null,o))),null}}else{const e=t.getFirstRange();if(i.some((t=>t.containsRange(e,!0)))&&t.discard(),i.every((t=>e.containsRange(t,!0)))){const e=this._suggestionFactory.getSuggestionCallback("deletion",n,"accept");return this.forceDefaultExecution((()=>e(i,null,o))),null}}const c=this._suggestionFactory.getSuggestionCallback("deletion",n,"join");let l=null;for(const e of this.getSuggestions())if(e.author.id==r.id&&e.isInContent&&"deletion"==e.type&&e.subType==n&&(c(e.getRanges(),i)||c(i,e.getRanges())))if(l){if(e.commentThread&&e.commentThread.length)continue;for(const t of e.getRanges())l.isIntersectingWithRange(t)||l.addRange(t);e.removeMarkers()}else{l=e;for(const t of i)e.isIntersectingWithRange(t)||e.addRange(t)}if(l)return l;a.clear();for(const e of i)for(const{suggestion:t,meta:n}of this._findSuggestions(e,"deletion"))n.isOwn&&a.add(t);for(const e of a){const t=e.getRanges();if((!o||!o.skipNestingCheck)&&i.every((e=>t.some((t=>t.containsRange(e,!0))))))return e;(!e.attributes||!e.attributes.skipNestingCheck)&&t.every((e=>i.some((t=>t.containsRange(e,!0)))))&&e.discard()}const g=(0,t.uid)(),u=r.id,d="deletion:"+n,m=this._setSuggestionData({id:g,type:d,createdAt:new Date,authorId:u,attributes:o});for(const e of i)e.detach(),e.isCollapsed||"$graveyard"==e.root.rootName||this._addSuggestionMarker(d,g,u,e,gr.getMultiRangeId());return m}_setSuggestionRange(e,t){const n=e.getFirstMarker();this._model.change((e=>{e.updateMarker(n,{range:t})}))}_addThreadToSuggestion(e){const t=e.id,n=this.editor.config.get("collaboration.channelId");this._commentsRepository.hasCommentThread(t)||this._commentsRepository.addCommentThread({channelId:n,threadId:t});const o=this._commentsRepository.getCommentThread(t);o.unbind("isRemovable"),o.isRemovable=!1,e.commentThread=o}_checkSuggestionCorrectness(e,n,o,r){if(e.type!=n||e.subType!=o||e.author.id!=r)throw this.editor.isReadOnly=!0,new t.CKEditorError("track-changes-suggestion-data-mismatch",this)}_cutOutSuggestionMarker(e,n){const o=e.getFirstRange();if(n.isEqual(o))e.removeMarkers();else if(o.containsRange(n)){const r=this._model.createPositionAt(n.start.nodeBefore,"end");this._setSuggestionRange(e,this._model.createRange(o.start,r));const i=(0,t.uid)(),s=e.author.id,a=e.type+":"+e.subType;this._setSuggestionData({id:i,type:a,createdAt:new Date,authorId:s,data:e.data,attributes:e.attributes});const c=this._model.createPositionAt(n.end.parent,"after"),l=this._model.createRange(c,o.end);this._addSuggestionMarker(a,i,s,l)}else if(o.containsPosition(n.start)){const t=this._model.createPositionAt(n.start.nodeBefore,"end");this._setSuggestionRange(e,this._model.createRange(o.start,t))}else{const t=this._model.createPositionAt(n.end.parent,"after");this._setSuggestionRange(e,this._model.createRange(t,o.end))}}_rangeIsInLocalUserInsertion(e){for(const{suggestion:t,meta:n}of this._findSuggestions(e,"insertion")){if(!n.isOwn)continue;const o=t.getRanges();for(const t of o)if(!e.getDifference(t).length)return!0}return!1}_getAuthorFromId(e){const n=this.editor.plugins.get("Users").getUser(e);if(!n)throw new t.CKEditorError("track-changes-user-not-found",this);return n}_createSuggestion(e,t,n,o){const r=this._getAuthorFromId(o),i=this._suggestionFactory.buildSuggestion(e,t,n,r,(e=>this._updateSuggestionData(n,{attributes:e})));return this.listenTo(i,"accept",(()=>{this._updateSuggestionData(n,{state:"accepted"})}),{priority:"high"}),this.listenTo(i,"discard",(()=>{this._updateSuggestionData(n,{state:"rejected"})}),{priority:"high"}),this._suggestions.set(n,i),this._suggestionState.set(i,"notReady"),i}_splitMarkerName(e){const t=e.split(":");return{group:t[0],type:t[1],subType:t.length>=5?t[2]:null,id:t.length<5?t[2]:t[3],authorId:t.length<5?t[3]:t[4],markerCount:6==t.length?t[5]:null}}_breakSuggestionMarker(e,n,o){const r=e.getFirstRange(),i=r.start,s=r.end;this._setSuggestionRange(e,this._model.createRange(i,n));const a=(0,t.uid)(),c=e.author.id,l=e.type+(e.subType?":"+e.subType:"");this._setSuggestionData({id:a,type:l,createdAt:new Date,authorId:c,originalSuggestionId:e.id,data:e.data}),"formatBlock"==e.type&&(o=this._model.createPositionBefore(o.parent)),this._addSuggestionMarker(l,a,c,this._model.createRange(o,s))}_findSuggestions(e,t=null){const n=[],o=this._model.schema,r=this.editor.plugins.get("Users").me;for(const i of this.getSuggestions())if(i.isInContent&&(!t||i.type==t))for(const t of i.getRanges()){const s=e.start.isEqual(t.end)||e.end.isEqual(t.start);if(s||e.getIntersection(t)){const a=e.containsRange(t)&&fs(o,t.start,e),c=t.containsRange(e)&&fs(o,e.start,t);n.push({suggestion:i,meta:{isOwn:r==i.author,isNextTo:s,isInsideObject:a,containsRangeInObject:c}});break}}return n}_addSuggestionMarker(e,t,n,o,r=null){this._model.change((i=>{let s="suggestion:"+e+":"+t+":"+n;r&&(s=s+":"+r),i.addMarker(s,{range:o,usingOperation:!0,affectsData:!0})}))}_removeSuggestion(e){const t=e.previous,n=e.next;e.previous=null,null!=t&&(t.next=null),e.next=null,null!=n&&(n.previous=null),"ready"==this._suggestionState.get(e)&&(this._suggestionState.set(e,"removed"),this.fire("suggestionUnloaded",e,t,n))}_setSuggestionData(e){const t=e.id,n=this.addSuggestionData(e);if(this._adapter&&this._adapter.addSuggestion){const o=this.editor.plugins.get("PendingActions"),r=n.hasComments,i=n.subType?n.type+":"+n.subType:n.type,s=this.editor.locale.t,a=o.add(s({string:"Unsaved change in suggestion.",id:"PENDING_ACTION_SUGGESTION"})),c={id:t,type:i,hasComments:r,data:e.data||null,originalSuggestionId:e.originalSuggestionId||null,attributes:n.attributes};this._adapter.addSuggestion(c).then((e=>{n._saved=!0,o.remove(a),e&&e.createdAt&&(this._suggestions.get(t).createdAt=e.createdAt)}))}return n}_updateSuggestionData(e,t){const n=this.editor.plugins.get("PendingActions"),o=this._suggestions.get(e);if(this._adapter&&this._adapter.updateSuggestion)if(o._saved){const o=this.editor.locale.t,r=n.add(o({string:"Unsaved change in suggestion.",id:"PENDING_ACTION_SUGGESTION"}));this._adapter.updateSuggestion(e,t).then((()=>{n.remove(r)}))}else o.on("change:_saved",(()=>{this._updateSuggestionData(e,t)}))}_getSuggestionData(e){if(!this._adapter||!this._adapter.getSuggestion)throw new t.CKEditorError("track-changes-adapter-missing-getsuggestion",this);return this._adapter.getSuggestion(e)}_handleNewSuggestionMarker(e){const{id:t,type:n,subType:o,authorId:r}=this._splitMarkerName(e),i=this._suggestions.get(t)||this._createSuggestion(n,o,t,r);switch(this._checkSuggestionCorrectness(i,n,o,r),this._suggestionState.get(i)){case"notReady":this._getSuggestionData(t).then((e=>{let n=Promise.resolve();e.hasComments&&(n=this._commentsRepository.fetchCommentThread({channelId:this.editor.config.get("collaboration.channelId"),threadId:t})),n.then((()=>{this.addSuggestionData(e)._saved=!0}))})),this._suggestionState.set(i,"markerReady");break;case"removed":this._updateSuggestionData(t,{state:"open"});case"dataReady":this._suggestionState.set(i,"ready"),this.fire("suggestionLoaded",i);break;case"ready":this.fire("suggestionChanged",i)}i.addMarkerName(e),this._refreshSuggestionsChain(i)}_refreshSuggestionsChain(e){if(e.isMultiRange)return;let t=!0,n=!0;for(const o of this.getSuggestions()){if(o.isMultiRange)continue;if(o==e||!o.isInContent)continue;if(o.author.id!=e.author.id)continue;const r=this._suggestionFactory.getSuggestionCallback(e.type,e.subType,"chain"),i=this._suggestionFactory.getSuggestionCallback(o.type,o.subType,"chain"),s=r(e,o),a=i(e,o);s&&a&&(s[1].commentThread&&s[1].commentThread.length||(s[0].next=s[1],s[1].previous=s[0],s[0]==e?n=!1:t=!1))}e.previous&&t&&(e.previous.next=null,e.previous=null),e.next&&n&&(e.next.previous=null,e.next=null)}_joinWithAdjacentSuggestions(e){for(const t of this._suggestions.values()){if(t==e||!t.isInContent)continue;if(t.type!=e.type||t.author.id!=e.author.id||t.subType!=e.subType)continue;const n=this._suggestionFactory.getSuggestionCallback(e.type,e.subType,"join");if(n(t.getRanges(),e.getRanges())){if(e.commentThread&&e.commentThread.length)continue;return this._joinSuggestions(t,e),!0}if(n(e.getRanges(),t.getRanges())){if(t.commentThread&&t.commentThread.length)continue;return this._joinSuggestions(e,t),!0}}return!1}_joinSuggestions(e,t){if(e.isMultiRange)for(const n of t.getRanges())e.addRange(n);else{const n=t.getFirstRange().end;this._setSuggestionRange(e,this._model.createRange(e.getFirstRange().start,n))}t.removeMarkers()}}(0,t.mix)(ds,t.EmitterMixin);class ms{constructor(e){this._editor=e,this._model=e.model,this._customCallbacks=new Map,this._defaultCallbacks=new Map,this._registerDefaultCallbacks()}buildSuggestion(e,t,n,o,r){return new gr(this._model,{type:e,subType:t,id:n,author:o,onAttributesChange:r,onAccept:(...n)=>this.getSuggestionCallback(e,t,"accept")(...n),onDiscard:(...n)=>this.getSuggestionCallback(e,t,"discard")(...n)})}registerCustomCallback(e,t,n,o){const r=e+":"+t+":"+n;this._customCallbacks.set(r,o)}getSuggestionCallback(e,t,n){const o=e+":"+t+":"+n;return this._customCallbacks.get(o)||this._defaultCallbacks.get(e+":"+n)}_registerDefaultCallbacks(){const e=()=>{},t=e=>{e.sort(((e,t)=>e.start.isBefore(t.start)?1:-1)),this._model.change((t=>{for(const n of e){let e;e=n.end.isAtEnd&&n.end.parent==n.start.nodeAfter?t.createSelection(n.start.nodeAfter,"on"):t.createSelection(n),this._model.deleteContent(e,{forceDefaultExecution:!0,doNotAutoparagraph:!0})}}))},n=(e,t)=>{this._model.change((n=>{const{commandName:o,commandParams:r=[]}=t,i=e[0];if("$graveyard"==i.root.rootName)return;const a=Array.from(this._model.document.selection.getRanges()).map((e=>s.LiveRange.fromRange(e)));hs(i)?n.setSelection(this._model.createRange(i.end)):n.setSelection(i);for(const e of this._editor.commands.commands())e.refresh();r.push({forceDefaultExecution:!0}),this._editor.execute(o,...r);const c=a.filter((e=>"$graveyard"!=e.root.rootName));c.length>0&&n.setSelection(c);for(const e of a)e.detach()}))},o=(e,t)=>1==e.length&&1==t.length&&e[0].end.isEqual(t[0].start),r=(e,t)=>ys(e,t,this._model)?[e,t]:ys(t,e,this._model)?[t,e]:null;this._defaultCallbacks.set("insertion:accept",e),this._defaultCallbacks.set("insertion:discard",t),this._defaultCallbacks.set("insertion:join",o),this._defaultCallbacks.set("insertion:chain",r),this._defaultCallbacks.set("deletion:accept",t),this._defaultCallbacks.set("deletion:discard",e),this._defaultCallbacks.set("deletion:join",o),this._defaultCallbacks.set("deletion:chain",r),this._defaultCallbacks.set("formatInline:accept",n),this._defaultCallbacks.set("formatInline:discard",e),this._defaultCallbacks.set("formatInline:join",o),this._defaultCallbacks.set("formatInline:chain",e),this._defaultCallbacks.set("formatBlock:accept",n),this._defaultCallbacks.set("formatBlock:discard",e),this._defaultCallbacks.set("formatBlock:join",o),this._defaultCallbacks.set("formatBlock:chain",e)}}function fs(e,t,n){for(const o of t.parent.getAncestors({includeSelf:!0,parentFirst:!0})){if(o.root==o)return!1;if(!n.containsItem(o))return!1;if(e.isObject(o)||e.isLimit(o))return!0}}function hs(e){return e.end.parent==e.start.nodeAfter&&e.end.isAtStart}function ps(e,t,n,o){const r=e=>!e.item.is("textProxy")&&!o.isObject(e.item),i=e.start.getLastMatchingPosition(r),s=e.end.getLastMatchingPosition(r,{direction:"backward"});return!(e.start.isEqual(i)&&e.end.isEqual(s)||(i.isBefore(s)?n.updateMarker(t,{range:n.createRange(i,s)}):n.removeMarker(t),0))}function ks(e){return function(e){let t=0,n=0;for(const o of cs(e))t=(t<<5)-t+o,t&=t,[t,n]=[n,t];return us(t)+us(n)}(e)}function bs(e){const t=e.start.nodeAfter;return t&&t.is("element")}function xs(e,t){const n=t.schema.isObject(e)||t.schema.isSelectable(e);return t.createRange(t.createPositionAt(e,"before"),n?t.createPositionAfter(e):t.createPositionAt(e,"end"))}function ys(e,t,n){const o=e.getFirstRange(),r=t.getFirstRange();if(o.end.isEqual(r.start))return!0;if(e.type!=t.type)return!1;if(!o.end.isTouching(r.start))return!1;const i=n.createRange(o.end,r.start).getWalker();for(const e of i)if(["elementStart","elementEnd"].includes(e.type)&&n.schema.isLimit(e.item))return!1;return!0}var vs,Cs,_s=["isEnabled","unbind","destroy","listenTo","_acceptCommand","_discardCommand","discardSuggestion","model","execute","acceptSuggestion","commentThreadController","bind","view","stopListening"];vs=_s,Cs=158,function(e){for(;--e;)vs.push(vs.shift())}(++Cs);var Es=function(e,t){return _s[e-=0]};class Ts{constructor(e,t,n,o,r){this[Es("0x3")]=e,this[Es("0x8")]=t,this[Es("0x6")]=r,this[Es("0x0")]=n,this._discardCommand=o,this[Es("0x8")][Es("0x7")](Es("0xa")).to(this._acceptCommand),this.listenTo(t,Es("0x5"),(()=>this[Es("0x5")]())),this[Es("0xd")](t,"discardSuggestion",(()=>this[Es("0x2")]()))}acceptSuggestion(){this[Es("0x0")][Es("0x4")](this[Es("0x3")].id)}[Es("0x2")](){this[Es("0x1")].execute(this.model.id)}[Es("0xc")](){this[Es("0x8")][Es("0xb")](Es("0xa")),this[Es("0x9")](),this[Es("0x6")][Es("0xc")]()}}(0,t.mix)(Ts,t.ObservableMixin);const ws=["element","locale","_localUser","_createCommentViews","isReadOnly","delegate","isActive","fire","editor","destroy","isDirty","CommentView","addComment","cancel","focus","_config","commentsListView","commentThread","showInput","updateComment","set","value","length","disabledSubmit","assign","bind","_createCommentThreadInputView","isEnabled","commentThreadInputView","disableComments","removeComment","_model","createdAt","hasDirtyComment","editorConfig"];var Ss,Rs;Ss=ws,Rs=328,function(e){for(;--e;)Ss.push(Ss.shift())}(++Rs);const As=function(e,t){return ws[e-=0]};class Is extends r.View{constructor(e,t,n,o){super(e),this[As("0x3")]=null,this[As("0xf")]=null,this[As("0x7")](As("0x1c"),!1),this[As("0x7")](As("0x13"),t.createdAt),this[As("0xc")](As("0x13")).to(t),this[As("0x7")]("descriptionParts",[]),this.set(As("0x20"),!1),this.set(As("0xe"),!1),this._model=t,this[As("0x18")]=n,this[As("0x2")]=o,o[As("0x10")]?this[As("0x7")](As("0x9"),1):this[As("0x19")]()}focus(){this[As("0x16")][As("0x1")]()}[As("0x1f")](){this[As("0x20")]=!1,this[As("0x3")]&&this[As("0x3")][As("0x1f")](),this[As("0xf")]&&this[As("0xf")][As("0x1f")](),super[As("0x1f")]()}[As("0x19")](){const{CommentsListView:e}=this._config;this[As("0x3")]=new e(this[As("0x17")],this[As("0x12")][As("0x4")],Object[As("0xb")]({CommentView:this[As("0x2")][As("0x21")]},this[As("0x2")])),this.commentsListView[As("0x1b")](As("0x11")).to(this),this[As("0x3")][As("0x1b")](As("0x6")).to(this),this[As("0x3")][As("0xc")](As("0x1c")).to(this),this[As("0x7")](As("0x9"),this[As("0x3")].length+1),this[As("0xc")](As("0x9")).to(this[As("0x3")],As("0x9"),(e=>e+1)),this[As("0xf")]=this[As("0xd")](),this.on(As("0x11"),(()=>this[As("0x1")]())),this[As("0xc")]("isDirty").to(this[As("0x3")],As("0x14"),this.commentThreadInputView.commentInputView,As("0x8"),((e,t)=>e||!!t))}[As("0xd")](){const{CommentThreadInputView:e}=this[As("0x2")],t=new e(this[As("0x17")],this[As("0x18")],this._config[As("0x15")]),n=t.commentInputView;return t[As("0xc")](As("0x5")).to(this,"isActive",this[As("0x12")][As("0x4")],As("0x1a"),n,As("0x8"),((e,t,n)=>!!n||e&&!t)),n.on("submit",((e,t)=>{this[As("0x1d")](As("0x22"),t),n[As("0x1e")].setData("")})),n.on(As("0x0"),(()=>this[As("0x1")]())),n[As("0xc")](As("0xa")).to(this[As("0x12")][As("0x4")],As("0x1a")),t}}class Ms extends Is{constructor(t,n,o,r){super(t,n,o,r);const{t:s}=t;this.set("type",""),this.bind("type").to(this,"descriptionParts",(e=>e&&e[0]?e[0].type:"")),this.bind("description").to(this,"descriptionParts",this,"isActive",((e,t)=>{let n="";for(const t of e)n+="<p>"+Ns(t.content,t.color)+"</p>";return t?n:(0,i.trimHtml)(n,{limit:140})})),this._descriptionElement=null,this.acceptButton=this._createButton(s("Accept suggestion"),e.icons.check,"ck-suggestion--accept","acceptSuggestion"),this.discardButton=this._createButton(s("Discard suggestion"),e.icons.cancel,"ck-suggestion--discard","discardSuggestion"),this.userView=new i.UserView(t,this._model.author),this.userView.extendTemplate({attributes:{class:["ck-suggestion__user","ck-annotation__user"]}}),this.setTemplate(this.getTemplate())}getTemplate(){const e=this.bindTemplate,t={tag:"div",attributes:{class:["ck-suggestion-wrapper",e.if("isActive","ck-suggestion-wrapper--active"),e.to("type",(e=>"ck-suggestion-"+e)),this._config.disableComments&&"ck-suggestion--disabled-comments"],"data-suggestion-id":this._model.id,"data-thread-id":this._model.commentThread.id,"data-author-id":this._model.author.id,tabindex:-1},children:[{tag:"div",attributes:{class:["ck-suggestion","ck-annotation"]},children:[this.userView,{tag:"div",attributes:{class:["ck-suggestion__main","ck-annotation__main"]},children:[{tag:"div",attributes:{class:["ck-suggestion__info","ck-annotation__info"]},children:[{tag:"span",children:[{text:this.userView.name}],attributes:{class:["ck-suggestion__info-name","ck-annotation__info-name"]}},{tag:"time",attributes:{datetime:e.to("createdAt"),class:["ck-comment__info-time","ck-annotation__info-time"]},children:[{text:e.to("createdAt",(e=>this._config.formatDateTime(e)))}]}]},{tag:"div",attributes:{class:["ck-suggestion__actions","ck-annotation__actions"]},children:[this.acceptButton,this.discardButton]},{tag:"div",attributes:{class:["ck-annotation__content-wrapper"]}}]}]}]};return this.commentsListView&&this.commentThreadInputView&&t.children.push(this.commentsListView,this.commentThreadInputView),t}render(){super.render(),this._descriptionElement=this.element.querySelector(".ck-annotation__content-wrapper"),this._descriptionElement.innerHTML=this.description,this.on("change:description",((e,t,n)=>{this._descriptionElement.innerHTML=n}))}_createButton(e,t,n,o){const i=new r.ButtonView(this.locale);return i.set({label:e,icon:t,tooltip:!0}),i.extendTemplate({attributes:{class:n}}),i.on("execute",(()=>{this.fire(o,this._model.id)})),i.bind("isEnabled").to(this),i}}function Ns(e,t){let n="";return n+=e.split("*").map(((e,t)=>t%2!=0?'<span class="ck-suggestion-type">'+Fs(e)+"</span>":Fs(e))).join(""),t&&(n+='<span class="ck-suggestion-color" style="background-color: '+t.value+'" title="'+t.title+'"></span>'),n}function Fs(e){const t=document.createElement("span");return t.innerText=e,t.innerHTML}var Ps=n(596),Os=n.n(Ps);const Ls=function(){return he.Date.now()};var Bs=/\s/;const js=function(e){for(var t=e.length;t--&&Bs.test(e.charAt(t)););return t};var Ds=/^\s+/;const Us=function(e){return e?e.slice(0,js(e)+1).replace(Ds,""):e};var Hs=/^[-+]0x[0-9a-f]+$/i,Vs=/^0b[01]+$/i,zs=/^0o[0-7]+$/i,Gs=parseInt;const Ws=function(e){if("number"==typeof e)return e;if(ho(e))return NaN;if(we(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=we(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Us(e);var n=Vs.test(e);return n||zs.test(e)?Gs(e.slice(2),n?2:8):Hs.test(e)?NaN:+e};var qs=Math.max,$s=Math.min;const Ks=function(e,t,n){var o,r,i,s,a,c,l=0,g=!1,u=!1,d=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function m(t){var n=o,i=r;return o=r=void 0,l=t,s=e.apply(i,n)}function f(e){return l=e,a=setTimeout(p,t),g?m(e):s}function h(e){var n=e-c;return void 0===c||n>=t||n<0||u&&e-l>=i}function p(){var e=Ls();if(h(e))return k(e);a=setTimeout(p,function(e){var n=t-(e-c);return u?$s(n,i-(e-l)):n}(e))}function k(e){return a=void 0,d&&o?m(e):(o=r=void 0,s)}function b(){var e=Ls(),n=h(e);if(o=arguments,r=this,c=e,n){if(void 0===a)return f(c);if(u)return clearTimeout(a),a=setTimeout(p,t),m(c)}return void 0===a&&(a=setTimeout(p,t)),s}return t=Ws(t)||0,we(n)&&(g=!!n.leading,i=(u="maxWait"in n)?qs(Ws(n.maxWait)||0,t):i,d="trailing"in n?!!n.trailing:d),b.cancel=function(){void 0!==a&&clearTimeout(a),l=0,o=c=r=a=void 0},b.flush=function(){return void 0===a?s:k(Ls())},b};class Zs extends e.Plugin{static get requires(){return[ds,i.Users,"CommentsRepository","Annotations","EditorAnnotations"]}static get pluginName(){return"TrackChangesUI"}constructor(e){super(e),this._suggestionToController=new Map,this._viewToController=new Map,this._debouncedHandlers=new Map;const t=this.editor.config;t.define("trackChanges.SuggestionThreadView",Ms),t.define("trackChanges.disableComments",!1),this._disableComments=t.get("trackChanges.disableComments")}init(){const e=this.editor,t=e.plugins.get(ds),n=e.plugins.get("Annotations"),o=e.plugins.get("EditorAnnotations"),r=e.plugins.get("CommentsRepository");e.ui.componentFactory.add("trackChanges",(e=>this._createUIButton(e))),o.addSourceCollector((()=>{const e=[];for(const[t,n]of Array.from(this._suggestionToController)){const o=t.getAllAdjacentSuggestions(),r=[];for(const e of o){if(!e.isInContent)continue;if(e.isMultiRange){r.push(...e.getRanges());continue}const t=e.getFirstRange();if(r.length>0){const e=r[0].getJoined(t);if(e){r[0]=e;continue}}r.push(t)}e.push([n.view,r])}return e})),this.listenTo(t,"suggestionLoaded",((e,t)=>{let n=!1;const r=Ks((e=>{n||e?n&&e&&(this._destroyController(t),o.refreshSelectedViews(),n=!1):(this._initializeController(t),o.refreshSelectedViews(),n=!0)}),10);this._debouncedHandlers.set(t,r),this.listenTo(t,"change:previous",((e,n,o,i)=>{t.isInContent&&(null==o?(this._updateController(i.head),r(!1)):(this._updateController(o.head),r(!0)))})),null===t.previous?r(!1):this._updateController(t.head)})),this.listenTo(t,"suggestionUnloaded",((e,t,n)=>{this.stopListening(t,"change:previous"),this._debouncedHandlers.get(t).cancel(),this._debouncedHandlers.delete(t);const o=n?n.head:t,r=this._suggestionToController.get(o);null!==n&&this._updateController(o),null===n&&r&&this._destroyController(t)})),this.listenTo(t,"suggestionChanged",((e,t)=>{this._updateController(t)})),this.listenTo(n,"change:activeAnnotations",((e,n,o)=>{const r=Array.from(o,(e=>e.innerView)).filter((e=>this._viewToController.has(e))),i=[];for(const e of r){const t=this._viewToController.get(e).model.getAllAdjacentSuggestions();i.push(...t.reduce(((e,t)=>[...e,...t.getMarkerNames()]),[]))}t.activeMarkers=i})),this.listenTo(r,"addComment",((e,{threadId:n,isFromAdapter:o})=>{if(o||!t.hasSuggestion(n))return;const r=t.getSuggestion(n);this._suggestionToController.get(r).view.focus()}),{priority:"lowest"})}_createUIButton(e){const n=(0,r.createDropdown)(e,r.SplitButtonView),o=this.editor.commands.get("trackChanges"),{t:i}=this.editor;n.buttonView.set({tooltip:i("Track changes"),label:i("Track changes"),icon:Os()}),n.buttonView.bind("isOn").to(o,"value"),n.buttonView.on("execute",(()=>o.execute()));const s=new t.Collection,a=[{type:"switchbutton",model:{withText:!0,label:i("Track changes"),commandName:"trackChanges"}},{type:"separator"},{type:"button",model:{withText:!0,label:i("Accept all suggestions"),commandName:"acceptAllSuggestions"}},{type:"button",model:{withText:!0,label:i("Accept all selected suggestions"),commandName:"acceptSelectedSuggestions"}},{type:"button",model:{withText:!0,label:i("Discard all suggestions"),commandName:"discardAllSuggestions"}},{type:"button",model:{withText:!0,label:i("Discard all selected suggestions"),commandName:"discardSelectedSuggestions"}}];for(const e of a){const t={type:e.type};if(e.model){const n=new r.Model(e.model),o=this.editor.commands.get(n.commandName);n.bind("isOn","isEnabled").to(o,"value","isEnabled"),t.model=n}s.add(t)}(0,r.addListToDropdown)(n,s);const c=a.filter((e=>null!=e.model)).map((e=>this.editor.commands.get(e.model.commandName)));return n.buttonView.actionView.unbind("isEnabled"),n.buttonView.arrowView.unbind("isEnabled"),n.buttonView.actionView.bind("isEnabled").to(o,"isEnabled"),n.buttonView.arrowView.bind("isEnabled").toMany(c,"isEnabled",((...e)=>e.some((e=>e)))),n.on("execute",(e=>this.editor.execute(e.source.commandName))),n}_initializeController(e){const t=this.editor,n=t.config,o=t.plugins.get("Annotations"),r=t.plugins.get("CommentsRepository"),s=e.getAllAdjacentSuggestions().filter((e=>e.isInContent)),a=t.plugins.get(i.Users).me,c=t.commands.get("acceptSuggestion"),l=t.commands.get("discardSuggestion"),g=n.get("trackChanges").SuggestionThreadView,{CommentsListView:u,CommentThreadInputView:d}=t.plugins.get("CommentsUI"),m=new g(t.locale,e,a,{disableComments:this._disableComments,editorConfig:n.get("comments.editorConfig"),maxCommentsWhenCollapsed:n.get("comments.maxCommentsWhenCollapsed"),maxThreadTotalWeight:n.get("comments.maxThreadTotalWeight"),maxCommentCharsWhenCollapsed:n.get("comments.maxCommentCharsWhenCollapsed"),formatDateTime:(0,i.getDateTimeFormatter)(n.get("locale")),CommentView:n.get("comments").CommentView,CommentsListView:u,CommentThreadInputView:d}),f=r.createCommentThreadController(e.commentThread,m),h=new Ts(e,m,c,l,f);m.descriptionParts=t.plugins.get("TrackChangesEditing")._descriptionFactory.getDescriptions(s),this._suggestionToController.set(e,h),this._viewToController.set(m,h);const p=o.createAnnotationView(this.editor.locale,m);p.bind("isDirty").to(m,"isDirty"),p.bind("length").to(m),p.bind("type").to(m,"type",(e=>"suggestion-"+e));const k=o.createAnnotation({view:p,target:()=>{const e=s[0].getFirstMarker();if(!e)return null;const n=e.getRange().getContainedElement();return n&&!t.editing.mapper.toViewElement(n)?null:(0,i.getMarkerDomElement)(t.editing,e)||null},type:()=>"suggestion-"+h.view.type});o.add(k);const b=t.plugins.get("PendingActions");let x;m.on("change:isDirty",((e,t,n)=>{if(n){const e=this.editor.locale.t;x=b.add(e({string:"Unsaved change in suggestion.",id:"PENDING_ACTION_SUGGESTION"}))}else b.remove(x),x=null}))}_destroyController(e){const t=this.editor.plugins.get("Annotations"),n=this._suggestionToController.get(e),o=n.view,r=t.getByInnerView(o);r&&t.remove(r),this._suggestionToController.delete(e),this._viewToController.delete(o),n.destroy(),o.destroy()}_updateController(e){if(!e.isInContent||!this._suggestionToController.has(e))return;const t=this.editor.plugins.get("TrackChangesEditing"),n=this._suggestionToController.get(e),o=e.getAllAdjacentSuggestions();n.view.descriptionParts=t._descriptionFactory.getDescriptions(o)}destroy(){super.destroy();for(const e of this._suggestionToController.keys())this._destroyController(e);for(const e of this._debouncedHandlers.values())e.cancel();this._debouncedHandlers.clear()}}var Xs,Qs,Js=["editor","addSuggestionData","adapter","pluginName","get","Comments","getSuggestion","plugins","getSuggestions"];Xs=Js,Qs=253,function(e){for(;--e;)Xs.push(Xs.shift())}(++Qs);var Ys=function(e,t){return Js[e-=0]};class ea extends e.Plugin{static get requires(){return[ds,Zs,Ys("0x4")]}static get[Ys("0x2")](){return"TrackChanges"}set adapter(e){this[Ys("0x8")][Ys("0x6")][Ys("0x3")](ds)[Ys("0x1")]=e}get adapter(){return this[Ys("0x8")][Ys("0x6")][Ys("0x3")](ds)[Ys("0x1")]}addSuggestion(e){return this[Ys("0x8")][Ys("0x6")].get(ds)[Ys("0x0")](e)}getSuggestions(e){return this.editor.plugins.get(ds)[Ys("0x7")](e)}[Ys("0x5")](e){return this[Ys("0x8")][Ys("0x6")][Ys("0x3")](ds)[Ys("0x5")](e)}}const ta=["useAnonymousUser","plugins","toolbar","set","TrackChangesDataGetter","Users","div","discardAllSuggestions","map","from","addSuggestionData","addUser","trackChangesData.editorCreator","createElement","destroy","requires","result","config","_adapter","pluginName","every","builtinPlugins","CommentsRepository","end","concat","getDataWithDiscardedSuggestions","find","initialData","getUser","function","getRootNames","RealTimeCollaborativeEditing","name","has","add","data","init","editorCreator","model","reduce","names","string","push","TrackChangesEditing","getSuggestions","extraPlugins","create","filter","trackChangesData","appendChild","TrackChangesData","execute","define","editor","constructor","get"];var na,oa;na=ta,oa=258,function(e){for(;--e;)na.push(na.shift())}(++oa);const ra=function(e,t){return ta[e-=0]},ia=[ra("0x31"),"context",ra("0x18")],sa=[ra("0x35"),"RealTimeCollaborativeComments","RealTimeCollaborativeTrackChanges","Autosave"];class aa extends e.Plugin{static get[ra("0x25")](){return[ds]}static get[ra("0x29")](){return ra("0x10")}init(){const e=this[ra("0x13")];if(e.config[ra("0x12")](ra("0x22"),(t=>e.constructor[ra("0xc")]("",t))),"function"!=typeof e[ra("0x27")][ra("0x15")](ra("0xe"))[ra("0x3")])throw new t.CKEditorError("track-changes-data-invalid-editor-creator")}getDataWithAcceptedSuggestions(e){return la(this[ra("0x13")],!0,e)}[ra("0x2f")](e){return la(this[ra("0x13")],!1,e)}}class ca extends e.Plugin{static get[ra("0x29")](){return ra("0x1a")}[ra("0x2")](){this[ra("0x26")]=ra("0x2d"),this[ra("0x13")][ra("0x17")][ra("0x15")](ra("0x2c"))[ra("0x28")]={getCommentThread:()=>new Promise((()=>{}))},this[ra("0x13")].plugins[ra("0x15")](ra("0x9"))[ra("0x28")]=null}}async function la(e,t,n){const o=function(e){const t={};for(const n of e[ra("0x27")][ra("0x6")]())ia.includes(n)||(t[n]=e[ra("0x27")][ra("0x15")](n));const n=e[ra("0x14")][ra("0x2b")]||[],o=t[ra("0xb")]||[];delete t[ra("0xb")];const r=n[ra("0x2e")](t.plugins).concat(o).map((e=>ra("0x7")==typeof e?n[ra("0x30")]((t=>t.pluginName==e)):e)),i=Array[ra("0x1f")](new Set(r));return t[ra("0x17")]=i[ra("0xd")]((e=>ga(e,new Set))),t[ra("0x17")].push(ca),t.plugins[ra("0x8")](ds),t}(e),r=document.createDocumentFragment(),i=e[ra("0x27")][ra("0x15")]("trackChangesData")[ra("0x3")],s=await i(o,(()=>function(e){const t=document[ra("0x23")](ra("0x1c"));return e[ra("0xf")](t),t}(r)));!function(e,t){const n=e[ra("0x4")].document[ra("0x34")]()[ra("0x5")](((t,n)=>(t[n]=e[ra("0x1")][ra("0x15")]({rootName:n}),t)),{}),o=e[ra("0x17")][ra("0x15")](ra("0x1b")).users[ra("0x1e")]((e=>({id:e.id}))),r=e[ra("0x17")][ra("0x15")](ra("0x9"))[ra("0xa")]({skipNotAttached:!0,toJSON:!0}),i=t[ra("0x17")][ra("0x15")]("Users"),s=t[ra("0x17")][ra("0x15")](ra("0x9"));for(const e of o)i[ra("0x32")](e.id)||i[ra("0x21")](e);i.me||i[ra("0x16")]();for(const e of r)s[ra("0x20")](e);t.data[ra("0x19")](n)}(e,s),s[ra("0x11")](t?"acceptAllSuggestions":ra("0x1d"));const a=s[ra("0x1")][ra("0x15")](n);return await s[ra("0x24")](),a}function ga(e,t){if(t[ra("0x37")](e))return!0;t[ra("0x0")](e);const n=ra("0x33")==typeof e?e.pluginName||e[ra("0x36")]:e;return(!n||!sa.includes(n))&&(!e.requires||e.requires[ra("0x2a")]((e=>ga(e,t))))}})(),(window.CKEditor5=window.CKEditor5||{}).trackChanges=o})();
|
|
5
|
+
*/(()=>{var t={596:t=>{t.exports='\x3c!--\n\n What you\'re currently looking at is the source code of a legally protected, proprietary software.\n CKEditor 5 Collaboration is licensed under a commercial license and protected by copyright law. Where not otherwise indicated,\n all CKEditor 5 Collaboration content is authored by CKSource engineers and consists of CKSource-owned intellectual property.\n\n Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n\n!--\x3e\n\n<svg viewBox="0 0 20 20" width="20" height="20" xmlns="http://www.w3.org/2000/svg"><g fill="#000" fill-rule="nonzero"><path d="M1 3.28C1 2.574 1.574 2 2.272 2h10.23c.703 0 1.272.573 1.272 1.28v12.768c0 .708-.574 1.281-1.271 1.281H2.272A1.276 1.276 0 0 1 1 16.049V3.28zm11.503 12.954c-.008 0-.006-12.77-.006-12.77 0-.003-10.225-.004-10.225-.004.007 0 .005 12.77.005 12.77 0 .003 10.226.004 10.226.004zm-8.31-9.58c0-.353.292-.64.636-.64h5.116c.351 0 .636.284.636.64a.641.641 0 0 1-.636.638H4.829a.636.636 0 0 1-.635-.639zm0 2.554c0-.352.292-.638.636-.638h5.116c.351 0 .636.283.636.638a.641.641 0 0 1-.636.639H4.829a.636.636 0 0 1-.635-.639zm0 2.555c0-.353.289-.639.633-.639h2.567c.35 0 .633.284.633.64a.639.639 0 0 1-.633.638H4.826a.634.634 0 0 1-.632-.639z"/><path d="M10.515 17.958l.154-.23c-.195-.099-.304-.193-.328-.28-.024-.09.001-.275.076-.552.062-.165.099-.296.111-.393.013-.159.013-.319 0-.478-.138-.41-.2-.686-.187-.83.013-.145.117-.335.313-.57l4.465-6.208c.356-.6 1.059-.56 2.11.119 1.051.68 1.443 1.271 1.177 1.771L14.53 17.14c-.105.271-.22.444-.347.516-.128.07-.399.118-.813.138a2.954 2.954 0 0 0-.487.21 2.044 2.044 0 0 0-.347.31c-.193.174-.332.262-.416.262-.064 0-.178-.05-.346-.15l-.204.27-1.056-.738h.001zm-.184.274l1.039.727-.259.34H9.614l.717-1.067z"/></g></svg>\n'},417:(t,e,n)=>{t.exports=n(720)("./src/collaboration-core.js")},704:(t,e,n)=>{t.exports=n(79)("./src/core.js")},492:(t,e,n)=>{t.exports=n(79)("./src/engine.js")},331:(t,e,n)=>{t.exports=n(79)("./src/enter.js")},181:(t,e,n)=>{t.exports=n(79)("./src/typing.js")},273:(t,e,n)=>{t.exports=n(79)("./src/ui.js")},209:(t,e,n)=>{t.exports=n(79)("./src/utils.js")},995:(t,e,n)=>{t.exports=n(79)("./src/widget.js")},720:t=>{"use strict";t.exports=CKEditor5.collaborationDll},79:t=>{"use strict";t.exports=CKEditor5.dll}},e={};function n(o){var r=e[o];if(void 0!==r)return r.exports;var s=e[o]={exports:{}};return t[o](s,s.exports,n),s.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};(()=>{"use strict";n.r(o),n.d(o,{BaseSuggestionThreadView:()=>Fx,TrackChanges:()=>tc,TrackChangesData:()=>ac});var t=n(704),e=n(209),r=n(273),s=n(417);const i=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)};const a="object"==typeof global&&global&&global.Object===Object&&global;var x="object"==typeof self&&self&&self.Object===Object&&self;const c=a||x||Function("return this")();const l=function(){return c.Date.now()};var u=/\s/;const d=function(t){for(var e=t.length;e--&&u.test(t.charAt(e)););return e};var g=/^\s+/;const f=function(t){return t?t.slice(0,d(t)+1).replace(g,""):t};const m=c.Symbol;var h=Object.prototype,p=h.hasOwnProperty,b=h.toString,E=m?m.toStringTag:void 0;const _=function(t){var e=p.call(t,E),n=t[E];try{t[E]=void 0;var o=!0}catch(t){}var r=b.call(t);return o&&(e?t[E]=n:delete t[E]),r};var y=Object.prototype.toString;const T=function(t){return y.call(t)};var C=m?m.toStringTag:void 0;const k=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":C&&C in Object(t)?_(t):T(t)};const v=function(t){return null!=t&&"object"==typeof t};const A=function(t){return"symbol"==typeof t||v(t)&&"[object Symbol]"==k(t)};var R=/^[-+]0x[0-9a-f]+$/i,S=/^0b[01]+$/i,I=/^0o[0-7]+$/i,w=parseInt;const M=function(t){if("number"==typeof t)return t;if(A(t))return NaN;if(i(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=i(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=f(t);var n=S.test(t);return n||I.test(t)?w(t.slice(2),n?2:8):R.test(t)?NaN:+t};var N=Math.max,L=Math.min;const O=function(t,e,n){var o,r,s,a,x,c,u=0,d=!1,g=!1,f=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function m(e){var n=o,s=r;return o=r=void 0,u=e,a=t.apply(s,n)}function h(t){return u=t,x=setTimeout(b,e),d?m(t):a}function p(t){var n=t-c;return void 0===c||n>=e||n<0||g&&t-u>=s}function b(){var t=l();if(p(t))return E(t);x=setTimeout(b,function(t){var n=e-(t-c);return g?L(n,s-(t-u)):n}(t))}function E(t){return x=void 0,f&&o?m(t):(o=r=void 0,a)}function _(){var t=l(),n=p(t);if(o=arguments,r=this,c=t,n){if(void 0===x)return h(c);if(g)return clearTimeout(x),x=setTimeout(b,e),m(c)}return void 0===x&&(x=setTimeout(b,e)),a}return e=M(e)||0,i(n)&&(d=!!n.leading,s=(g="maxWait"in n)?N(M(n.maxWait)||0,e):s,f="trailing"in n?!!n.trailing:f),_.cancel=function(){void 0!==x&&clearTimeout(x),u=0,o=c=r=x=void 0},_.flush=function(){return void 0===x?a:E(l())},_};var F=n(492),P=n(995);const D=["has","_disableUnsupportedCommands","_enabledCommands","refresh","_enableCommands","commands","clearForceDisabled","editor","forceDisabled","isEnabled"];var j,B;j=D,B=197,function(t){for(;--t;)j.push(j.shift())}(++B);const U=function(t,e){return D[t-=0]};class H extends t.Command{constructor(t,e){super(t),this._enabledCommands=e,this.value=!1,this[U("0x6")]()}refresh(){this[U("0x2")]=!0}execute(){this.value=!this.value,this.value?this[U("0x4")]():this[U("0x7")]()}_disableUnsupportedCommands(){for(const t of this[U("0x0")][U("0x8")].commands())t.affectsData&&!this[U("0x5")][U("0x3")](t)&&t[U("0x1")]("TrackChangesCommand")}[U("0x7")](){for(const t of this[U("0x0")][U("0x8")][U("0x8")]())t.affectsData&&!this[U("0x5")].has(t)&&t[U("0x9")]("TrackChangesCommand")}}const G=["_suggestions","plugins","track-changes-accept-suggestion-not-found","refresh","editor","get"];var V,z;V=G,z=359,function(t){for(;--t;)V.push(V.shift())}(++z);const W=function(t,e){return G[t-=0]};class K extends t.Command{constructor(t,e){super(t),this[W("0x1")]=e,this[W("0x4")]()}[W("0x4")](){this.isEnabled=!0}execute(t){const n=this._suggestions[W("0x0")](t);if(!n)throw new e.CKEditorError(W("0x3"),this);this[W("0x5")][W("0x2")][W("0x0")]("TrackChangesEditing").acceptSuggestion(n)}}const $=["editor","track-changes-discard-suggestion-not-found","execute","get","discardSuggestion","TrackChangesEditing","isEnabled","refresh","_suggestions","plugins"];var q,X;q=$,X=267,function(t){for(;--t;)q.push(q.shift())}(++X);const J=function(t,e){return $[t-=0]};class Q extends t.Command{constructor(t,e){super(t),this._suggestions=e,this[J("0x0")]()}[J("0x0")](){this[J("0x9")]=!0}[J("0x5")](t){const n=this[J("0x1")][J("0x6")](t);if(!n)throw new e.CKEditorError(J("0x4"),this);this[J("0x3")][J("0x2")][J("0x6")](J("0x8"))[J("0x7")](n)}}var Y,Z,tt=["type","deletion"];Y=tt,Z=364,function(t){for(;--t;)Y.push(Y.shift())}(++Z);var et=function(t,e){return tt[t-=0]};function nt(t){return t.sort(((t,e)=>"deletion"==t[et("0x0")]&&et("0x1")!=e.type?-1:et("0x1")!=t.type&&"deletion"==e[et("0x0")]?1:0))}const ot=["model","isInContent","editor","change","values","from","refresh","_suggestions","isEnabled","execute","_acceptSuggestionCommand","some"];var rt,st;rt=ot,st=158,function(t){for(;--t;)rt.push(rt.shift())}(++st);const it=function(t,e){return ot[t-=0]};class at extends t.Command{constructor(t,e,n){super(t),this[it("0x8")]=e,this[it("0x5")]=n,this[it("0x4")]()}[it("0x4")](){const t=this[it("0x8")];this.isEnabled=t[it("0x6")]&&Array[it("0x3")](this[it("0x5")].values())[it("0x9")]((t=>t[it("0xb")]))}[it("0x7")](){this[it("0x0")][it("0xa")][it("0x1")]((()=>{const t=nt(Array.from(this[it("0x5")][it("0x2")]()));for(const e of t)e[it("0xb")]&&this[it("0x8")][it("0x7")](e.id)}))}}const xt=["getMarkers","start","getRange","isMultiRange","isTouching","isIntersecting","end","isCollapsed","add","from"];var ct,lt;ct=xt,lt=381,function(t){for(;--t;)ct.push(ct.shift())}(++lt);const ut=function(t,e){return xt[t-=0]};function dt(t,e){const n=Array[ut("0x8")](t.getRanges()),o=new Set;for(const r of e)if(r.isInContent)for(const e of n)for(const n of r[ut("0x9")]()){const s=n[ut("0x1")]();(e[ut("0x4")](s)||t[ut("0x6")]&&!r[ut("0x2")]&&r.next&&s[ut("0x5")][ut("0x3")](e[ut("0x0")]))&&o[ut("0x7")](r)}return o}const gt=["editor","from","refresh","size","selection","execute","_suggestions","_selectedSuggestions","isEnabled","model","_acceptSuggestionCommand"];var ft,mt;ft=gt,mt=441,function(t){for(;--t;)ft.push(ft.shift())}(++mt);const ht=function(t,e){return gt[t-=0]};class pt extends t.Command{constructor(t,e,n){super(t),this[ht("0x9")]=e,this[ht("0x5")]=n,this[ht("0x6")]=new Set,this[ht("0x1")]()}[ht("0x1")](){const t=this._acceptSuggestionCommand,e=this[ht("0xa")][ht("0x8")].document[ht("0x3")],n=Array[ht("0x0")](this[ht("0x5")].values());this[ht("0x6")]=dt(e,n),this[ht("0x7")]=t[ht("0x7")]&&!!this[ht("0x6")][ht("0x2")]}[ht("0x4")](){this[ht("0xa")][ht("0x8")].change((()=>{const t=nt(Array[ht("0x0")](this[ht("0x6")]));for(const e of t)this[ht("0x9")][ht("0x4")](e.id)}))}}const bt=["editor","execute","model","isInContent","_suggestions","change","from","_discardSuggestionCommand","values","isEnabled","refresh","some"];var Et,_t;Et=bt,_t=163,function(t){for(;--t;)Et.push(Et.shift())}(++_t);const yt=function(t,e){return bt[t-=0]};class Tt extends t.Command{constructor(t,e,n){super(t),this[yt("0x0")]=e,this._suggestions=n,this[yt("0x3")]()}[yt("0x3")](){const t=this[yt("0x0")];this.isEnabled=t[yt("0x2")]&&Array[yt("0xb")](this[yt("0x9")][yt("0x1")]())[yt("0x4")]((t=>t[yt("0x8")]))}[yt("0x6")](){this[yt("0x5")][yt("0x7")][yt("0xa")]((()=>{for(const t of this[yt("0x9")][yt("0x1")]())t[yt("0x8")]&&this._discardSuggestionCommand[yt("0x6")](t.id)}))}}const Ct=["isEnabled","_suggestions","execute","change","editor","model","size","_discardSuggestionCommand","refresh","selection","values","_selectedSuggestions"];var kt,vt;kt=Ct,vt=447,function(t){for(;--t;)kt.push(kt.shift())}(++vt);const At=function(t,e){return Ct[t-=0]};class Rt extends t.Command{constructor(t,e,n){super(t),this[At("0x4")]=e,this._suggestions=n,this[At("0x8")]=new Set,this[At("0x5")]()}[At("0x5")](){const t=this._discardSuggestionCommand,e=this[At("0x1")].model.document[At("0x6")],n=Array.from(this[At("0xa")][At("0x7")]());this[At("0x8")]=dt(e,n),this[At("0x9")]=t.isEnabled&&!!this._selectedSuggestions[At("0x3")]}[At("0xb")](){this[At("0x1")][At("0x2")][At("0x0")]((()=>{for(const t of this[At("0x8")])this._discardSuggestionCommand[At("0xb")](t.id)}))}}const St=function(){this.__data__=[],this.size=0};const It=function(t,e){return t===e||t!=t&&e!=e};const wt=function(t,e){for(var n=t.length;n--;)if(It(t[n][0],e))return n;return-1};var Mt=Array.prototype.splice;const Nt=function(t){var e=this.__data__,n=wt(e,t);return!(n<0)&&(n==e.length-1?e.pop():Mt.call(e,n,1),--this.size,!0)};const Lt=function(t){var e=this.__data__,n=wt(e,t);return n<0?void 0:e[n][1]};const Ot=function(t){return wt(this.__data__,t)>-1};const Ft=function(t,e){var n=this.__data__,o=wt(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this};function Pt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}Pt.prototype.clear=St,Pt.prototype.delete=Nt,Pt.prototype.get=Lt,Pt.prototype.has=Ot,Pt.prototype.set=Ft;const Dt=Pt;const jt=function(){this.__data__=new Dt,this.size=0};const Bt=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n};const Ut=function(t){return this.__data__.get(t)};const Ht=function(t){return this.__data__.has(t)};const Gt=function(t){if(!i(t))return!1;var e=k(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e};const Vt=c["__core-js_shared__"];var zt,Wt=(zt=/[^.]+$/.exec(Vt&&Vt.keys&&Vt.keys.IE_PROTO||""))?"Symbol(src)_1."+zt:"";const Kt=function(t){return!!Wt&&Wt in t};var $t=Function.prototype.toString;const qt=function(t){if(null!=t){try{return $t.call(t)}catch(t){}try{return t+""}catch(t){}}return""};var Xt=/^\[object .+?Constructor\]$/,Jt=Function.prototype,Qt=Object.prototype,Yt=Jt.toString,Zt=Qt.hasOwnProperty,te=RegExp("^"+Yt.call(Zt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const ee=function(t){return!(!i(t)||Kt(t))&&(Gt(t)?te:Xt).test(qt(t))};const ne=function(t,e){return null==t?void 0:t[e]};const oe=function(t,e){var n=ne(t,e);return ee(n)?n:void 0};const re=oe(c,"Map");const se=oe(Object,"create");const ie=function(){this.__data__=se?se(null):{},this.size=0};const ae=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e};var xe=Object.prototype.hasOwnProperty;const ce=function(t){var e=this.__data__;if(se){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return xe.call(e,t)?e[t]:void 0};var le=Object.prototype.hasOwnProperty;const ue=function(t){var e=this.__data__;return se?void 0!==e[t]:le.call(e,t)};const de=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=se&&void 0===e?"__lodash_hash_undefined__":e,this};function ge(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}ge.prototype.clear=ie,ge.prototype.delete=ae,ge.prototype.get=ce,ge.prototype.has=ue,ge.prototype.set=de;const fe=ge;const me=function(){this.size=0,this.__data__={hash:new fe,map:new(re||Dt),string:new fe}};const he=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};const pe=function(t,e){var n=t.__data__;return he(e)?n["string"==typeof e?"string":"hash"]:n.map};const be=function(t){var e=pe(this,t).delete(t);return this.size-=e?1:0,e};const Ee=function(t){return pe(this,t).get(t)};const _e=function(t){return pe(this,t).has(t)};const ye=function(t,e){var n=pe(this,t),o=n.size;return n.set(t,e),this.size+=n.size==o?0:1,this};function Te(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}Te.prototype.clear=me,Te.prototype.delete=be,Te.prototype.get=Ee,Te.prototype.has=_e,Te.prototype.set=ye;const Ce=Te;const ke=function(t,e){var n=this.__data__;if(n instanceof Dt){var o=n.__data__;if(!re||o.length<199)return o.push([t,e]),this.size=++n.size,this;n=this.__data__=new Ce(o)}return n.set(t,e),this.size=n.size,this};function ve(t){var e=this.__data__=new Dt(t);this.size=e.size}ve.prototype.clear=jt,ve.prototype.delete=Bt,ve.prototype.get=Ut,ve.prototype.has=Ht,ve.prototype.set=ke;const Ae=ve;const Re=function(t,e){for(var n=-1,o=null==t?0:t.length;++n<o&&!1!==e(t[n],n,t););return t};const Se=function(){try{var t=oe(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();const Ie=function(t,e,n){"__proto__"==e&&Se?Se(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n};var we=Object.prototype.hasOwnProperty;const Me=function(t,e,n){var o=t[e];we.call(t,e)&&It(o,n)&&(void 0!==n||e in t)||Ie(t,e,n)};const Ne=function(t,e,n,o){var r=!n;n||(n={});for(var s=-1,i=e.length;++s<i;){var a=e[s],x=o?o(n[a],t[a],a,n,t):void 0;void 0===x&&(x=t[a]),r?Ie(n,a,x):Me(n,a,x)}return n};const Le=function(t,e){for(var n=-1,o=Array(t);++n<t;)o[n]=e(n);return o};const Oe=function(t){return v(t)&&"[object Arguments]"==k(t)};var Fe=Object.prototype,Pe=Fe.hasOwnProperty,De=Fe.propertyIsEnumerable;const je=Oe(function(){return arguments}())?Oe:function(t){return v(t)&&Pe.call(t,"callee")&&!De.call(t,"callee")};const Be=Array.isArray;const Ue=function(){return!1};var He="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ge=He&&"object"==typeof module&&module&&!module.nodeType&&module,Ve=Ge&&Ge.exports===He?c.Buffer:void 0;const ze=(Ve?Ve.isBuffer:void 0)||Ue;var We=/^(?:0|[1-9]\d*)$/;const Ke=function(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&We.test(t))&&t>-1&&t%1==0&&t<e};const $e=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991};var qe={};qe["[object Float32Array]"]=qe["[object Float64Array]"]=qe["[object Int8Array]"]=qe["[object Int16Array]"]=qe["[object Int32Array]"]=qe["[object Uint8Array]"]=qe["[object Uint8ClampedArray]"]=qe["[object Uint16Array]"]=qe["[object Uint32Array]"]=!0,qe["[object Arguments]"]=qe["[object Array]"]=qe["[object ArrayBuffer]"]=qe["[object Boolean]"]=qe["[object DataView]"]=qe["[object Date]"]=qe["[object Error]"]=qe["[object Function]"]=qe["[object Map]"]=qe["[object Number]"]=qe["[object Object]"]=qe["[object RegExp]"]=qe["[object Set]"]=qe["[object String]"]=qe["[object WeakMap]"]=!1;const Xe=function(t){return v(t)&&$e(t.length)&&!!qe[k(t)]};const Je=function(t){return function(e){return t(e)}};var Qe="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ye=Qe&&"object"==typeof module&&module&&!module.nodeType&&module,Ze=Ye&&Ye.exports===Qe&&a.process;const tn=function(){try{var t=Ye&&Ye.require&&Ye.require("util").types;return t||Ze&&Ze.binding&&Ze.binding("util")}catch(t){}}();var en=tn&&tn.isTypedArray;const nn=en?Je(en):Xe;var on=Object.prototype.hasOwnProperty;const rn=function(t,e){var n=Be(t),o=!n&&je(t),r=!n&&!o&&ze(t),s=!n&&!o&&!r&&nn(t),i=n||o||r||s,a=i?Le(t.length,String):[],x=a.length;for(var c in t)!e&&!on.call(t,c)||i&&("length"==c||r&&("offset"==c||"parent"==c)||s&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Ke(c,x))||a.push(c);return a};var sn=Object.prototype;const an=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||sn)};const xn=function(t,e){return function(n){return t(e(n))}};const cn=xn(Object.keys,Object);var ln=Object.prototype.hasOwnProperty;const un=function(t){if(!an(t))return cn(t);var e=[];for(var n in Object(t))ln.call(t,n)&&"constructor"!=n&&e.push(n);return e};const dn=function(t){return null!=t&&$e(t.length)&&!Gt(t)};const gn=function(t){return dn(t)?rn(t):un(t)};const fn=function(t,e){return t&&Ne(e,gn(e),t)};const mn=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e};var hn=Object.prototype.hasOwnProperty;const pn=function(t){if(!i(t))return mn(t);var e=an(t),n=[];for(var o in t)("constructor"!=o||!e&&hn.call(t,o))&&n.push(o);return n};const bn=function(t){return dn(t)?rn(t,!0):pn(t)};const En=function(t,e){return t&&Ne(e,bn(e),t)};var _n="object"==typeof exports&&exports&&!exports.nodeType&&exports,yn=_n&&"object"==typeof module&&module&&!module.nodeType&&module,Tn=yn&&yn.exports===_n?c.Buffer:void 0,Cn=Tn?Tn.allocUnsafe:void 0;const kn=function(t,e){if(e)return t.slice();var n=t.length,o=Cn?Cn(n):new t.constructor(n);return t.copy(o),o};const vn=function(t,e){var n=-1,o=t.length;for(e||(e=Array(o));++n<o;)e[n]=t[n];return e};const An=function(t,e){for(var n=-1,o=null==t?0:t.length,r=0,s=[];++n<o;){var i=t[n];e(i,n,t)&&(s[r++]=i)}return s};const Rn=function(){return[]};var Sn=Object.prototype.propertyIsEnumerable,In=Object.getOwnPropertySymbols;const wn=In?function(t){return null==t?[]:(t=Object(t),An(In(t),(function(e){return Sn.call(t,e)})))}:Rn;const Mn=function(t,e){return Ne(t,wn(t),e)};const Nn=function(t,e){for(var n=-1,o=e.length,r=t.length;++n<o;)t[r+n]=e[n];return t};const Ln=xn(Object.getPrototypeOf,Object);const On=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)Nn(e,wn(t)),t=Ln(t);return e}:Rn;const Fn=function(t,e){return Ne(t,On(t),e)};const Pn=function(t,e,n){var o=e(t);return Be(t)?o:Nn(o,n(t))};const Dn=function(t){return Pn(t,gn,wn)};const jn=function(t){return Pn(t,bn,On)};const Bn=oe(c,"DataView");const Un=oe(c,"Promise");const Hn=oe(c,"Set");const Gn=oe(c,"WeakMap");var Vn="[object Map]",zn="[object Promise]",Wn="[object Set]",Kn="[object WeakMap]",$n="[object DataView]",qn=qt(Bn),Xn=qt(re),Jn=qt(Un),Qn=qt(Hn),Yn=qt(Gn),Zn=k;(Bn&&Zn(new Bn(new ArrayBuffer(1)))!=$n||re&&Zn(new re)!=Vn||Un&&Zn(Un.resolve())!=zn||Hn&&Zn(new Hn)!=Wn||Gn&&Zn(new Gn)!=Kn)&&(Zn=function(t){var e=k(t),n="[object Object]"==e?t.constructor:void 0,o=n?qt(n):"";if(o)switch(o){case qn:return $n;case Xn:return Vn;case Jn:return zn;case Qn:return Wn;case Yn:return Kn}return e});const to=Zn;var eo=Object.prototype.hasOwnProperty;const no=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&eo.call(t,"index")&&(n.index=t.index,n.input=t.input),n};const oo=c.Uint8Array;const ro=function(t){var e=new t.constructor(t.byteLength);return new oo(e).set(new oo(t)),e};const so=function(t,e){var n=e?ro(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)};var io=/\w*$/;const ao=function(t){var e=new t.constructor(t.source,io.exec(t));return e.lastIndex=t.lastIndex,e};var xo=m?m.prototype:void 0,co=xo?xo.valueOf:void 0;const lo=function(t){return co?Object(co.call(t)):{}};const uo=function(t,e){var n=e?ro(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)};const go=function(t,e,n){var o=t.constructor;switch(e){case"[object ArrayBuffer]":return ro(t);case"[object Boolean]":case"[object Date]":return new o(+t);case"[object DataView]":return so(t,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return uo(t,n);case"[object Map]":case"[object Set]":return new o;case"[object Number]":case"[object String]":return new o(t);case"[object RegExp]":return ao(t);case"[object Symbol]":return lo(t)}};var fo=Object.create;const mo=function(){function t(){}return function(e){if(!i(e))return{};if(fo)return fo(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();const ho=function(t){return"function"!=typeof t.constructor||an(t)?{}:mo(Ln(t))};const po=function(t){return v(t)&&"[object Map]"==to(t)};var bo=tn&&tn.isMap;const Eo=bo?Je(bo):po;const _o=function(t){return v(t)&&"[object Set]"==to(t)};var yo=tn&&tn.isSet;const To=yo?Je(yo):_o;var Co="[object Arguments]",ko="[object Function]",vo="[object Object]",Ao={};Ao[Co]=Ao["[object Array]"]=Ao["[object ArrayBuffer]"]=Ao["[object DataView]"]=Ao["[object Boolean]"]=Ao["[object Date]"]=Ao["[object Float32Array]"]=Ao["[object Float64Array]"]=Ao["[object Int8Array]"]=Ao["[object Int16Array]"]=Ao["[object Int32Array]"]=Ao["[object Map]"]=Ao["[object Number]"]=Ao["[object Object]"]=Ao["[object RegExp]"]=Ao["[object Set]"]=Ao["[object String]"]=Ao["[object Symbol]"]=Ao["[object Uint8Array]"]=Ao["[object Uint8ClampedArray]"]=Ao["[object Uint16Array]"]=Ao["[object Uint32Array]"]=!0,Ao["[object Error]"]=Ao[ko]=Ao["[object WeakMap]"]=!1;const Ro=function t(e,n,o,r,s,a){var x,c=1&n,l=2&n,u=4&n;if(o&&(x=s?o(e,r,s,a):o(e)),void 0!==x)return x;if(!i(e))return e;var d=Be(e);if(d){if(x=no(e),!c)return vn(e,x)}else{var g=to(e),f=g==ko||"[object GeneratorFunction]"==g;if(ze(e))return kn(e,c);if(g==vo||g==Co||f&&!s){if(x=l||f?{}:ho(e),!c)return l?Fn(e,En(x,e)):Mn(e,fn(x,e))}else{if(!Ao[g])return s?e:{};x=go(e,g,c)}}a||(a=new Ae);var m=a.get(e);if(m)return m;a.set(e,x),To(e)?e.forEach((function(r){x.add(t(r,n,o,r,e,a))})):Eo(e)&&e.forEach((function(r,s){x.set(s,t(r,n,o,s,e,a))}));var h=d?void 0:(u?l?jn:Dn:l?bn:gn)(e);return Re(h||e,(function(r,s){h&&(r=e[s=r]),Me(x,s,t(r,n,o,s,e,a))})),x};const So=function(t){return Ro(t,5)};var Io=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,wo=/^\w*$/;const Mo=function(t,e){if(Be(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!A(t))||(wo.test(t)||!Io.test(t)||null!=e&&t in Object(e))};function No(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){var o=arguments,r=e?e.apply(this,o):o[0],s=n.cache;if(s.has(r))return s.get(r);var i=t.apply(this,o);return n.cache=s.set(r,i)||s,i};return n.cache=new(No.Cache||Ce),n}No.Cache=Ce;const Lo=No;var Oo=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Fo=/\\(\\)?/g;const Po=function(t){var e=Lo(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Oo,(function(t,n,o,r){e.push(o?r.replace(Fo,"$1"):n||t)})),e}));const Do=function(t,e){for(var n=-1,o=null==t?0:t.length,r=Array(o);++n<o;)r[n]=e(t[n],n,t);return r};var jo=m?m.prototype:void 0,Bo=jo?jo.toString:void 0;const Uo=function t(e){if("string"==typeof e)return e;if(Be(e))return Do(e,t)+"";if(A(e))return Bo?Bo.call(e):"";var n=e+"";return"0"==n&&1/e==-Infinity?"-0":n};const Ho=function(t){return null==t?"":Uo(t)};const Go=function(t,e){return Be(t)?t:Mo(t,e)?[t]:Po(Ho(t))};const Vo=function(t){if("string"==typeof t||A(t))return t;var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e};const zo=function(t,e,n,o){if(!i(t))return t;for(var r=-1,s=(e=Go(e,t)).length,a=s-1,x=t;null!=x&&++r<s;){var c=Vo(e[r]),l=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return t;if(r!=a){var u=x[c];void 0===(l=o?o(u,c,x):void 0)&&(l=i(u)?u:Ke(e[r+1])?[]:{})}Me(x,c,l),x=x[c]}return t};const Wo=function(t,e,n){return null==t?t:zo(t,e,n)};const Ko=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this};const $o=function(t){return this.__data__.has(t)};function qo(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Ce;++e<n;)this.add(t[e])}qo.prototype.add=qo.prototype.push=Ko,qo.prototype.has=$o;const Xo=qo;const Jo=function(t,e){for(var n=-1,o=null==t?0:t.length;++n<o;)if(e(t[n],n,t))return!0;return!1};const Qo=function(t,e){return t.has(e)};const Yo=function(t,e,n,o,r,s){var i=1&n,a=t.length,x=e.length;if(a!=x&&!(i&&x>a))return!1;var c=s.get(t),l=s.get(e);if(c&&l)return c==e&&l==t;var u=-1,d=!0,g=2&n?new Xo:void 0;for(s.set(t,e),s.set(e,t);++u<a;){var f=t[u],m=e[u];if(o)var h=i?o(m,f,u,e,t,s):o(f,m,u,t,e,s);if(void 0!==h){if(h)continue;d=!1;break}if(g){if(!Jo(e,(function(t,e){if(!Qo(g,e)&&(f===t||r(f,t,n,o,s)))return g.push(e)}))){d=!1;break}}else if(f!==m&&!r(f,m,n,o,s)){d=!1;break}}return s.delete(t),s.delete(e),d};const Zo=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t,o){n[++e]=[o,t]})),n};const tr=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n};var er=m?m.prototype:void 0,nr=er?er.valueOf:void 0;const or=function(t,e,n,o,r,s,i){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!s(new oo(t),new oo(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return It(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var a=Zo;case"[object Set]":var x=1&o;if(a||(a=tr),t.size!=e.size&&!x)return!1;var c=i.get(t);if(c)return c==e;o|=2,i.set(t,e);var l=Yo(a(t),a(e),o,r,s,i);return i.delete(t),l;case"[object Symbol]":if(nr)return nr.call(t)==nr.call(e)}return!1};var rr=Object.prototype.hasOwnProperty;const sr=function(t,e,n,o,r,s){var i=1&n,a=Dn(t),x=a.length;if(x!=Dn(e).length&&!i)return!1;for(var c=x;c--;){var l=a[c];if(!(i?l in e:rr.call(e,l)))return!1}var u=s.get(t),d=s.get(e);if(u&&d)return u==e&&d==t;var g=!0;s.set(t,e),s.set(e,t);for(var f=i;++c<x;){var m=t[l=a[c]],h=e[l];if(o)var p=i?o(h,m,l,e,t,s):o(m,h,l,t,e,s);if(!(void 0===p?m===h||r(m,h,n,o,s):p)){g=!1;break}f||(f="constructor"==l)}if(g&&!f){var b=t.constructor,E=e.constructor;b==E||!("constructor"in t)||!("constructor"in e)||"function"==typeof b&&b instanceof b&&"function"==typeof E&&E instanceof E||(g=!1)}return s.delete(t),s.delete(e),g};var ir="[object Arguments]",ar="[object Array]",xr="[object Object]",cr=Object.prototype.hasOwnProperty;const lr=function(t,e,n,o,r,s){var i=Be(t),a=Be(e),x=i?ar:to(t),c=a?ar:to(e),l=(x=x==ir?xr:x)==xr,u=(c=c==ir?xr:c)==xr,d=x==c;if(d&&ze(t)){if(!ze(e))return!1;i=!0,l=!1}if(d&&!l)return s||(s=new Ae),i||nn(t)?Yo(t,e,n,o,r,s):or(t,e,x,n,o,r,s);if(!(1&n)){var g=l&&cr.call(t,"__wrapped__"),f=u&&cr.call(e,"__wrapped__");if(g||f){var m=g?t.value():t,h=f?e.value():e;return s||(s=new Ae),r(m,h,n,o,s)}}return!!d&&(s||(s=new Ae),sr(t,e,n,o,r,s))};const ur=function t(e,n,o,r,s){return e===n||(null==e||null==n||!v(e)&&!v(n)?e!=e&&n!=n:lr(e,n,o,r,t,s))};const dr=function(t,e){return ur(t,e)};const gr=function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0};const fr=function(t,e){for(var n=0,o=(e=Go(e,t)).length;null!=t&&n<o;)t=t[Vo(e[n++])];return n&&n==o?t:void 0};const mr=function(t,e,n){var o=-1,r=t.length;e<0&&(e=-e>r?0:r+e),(n=n>r?r:n)<0&&(n+=r),r=e>n?0:n-e>>>0,e>>>=0;for(var s=Array(r);++o<r;)s[o]=t[o+e];return s};const hr=function(t,e){return e.length<2?t:fr(t,mr(e,0,-1))};const pr=function(t,e){return e=Go(e,t),null==(t=hr(t,e))||delete t[Vo(gr(e))]};const br=function(t,e){return null==t||pr(t,e)},Er=["nodeAfter","onDiscard","removeMarkers","suggestion:","removeMarker","get","substr","push","removeAttribute","map","_onDiscard","getRange","hasComments","from","commentThread","next","getMarkerNames","getMarkers","head","type","addRange","addMarker","length","createdAt","clear","discard","author","isIntersecting","getAllAdjacentSuggestions","change","decorate","end","_onAccept","isInContent","onAttributesChange","getFirstRange","_onAttributesChange","addMarkerName","setAttribute","_markerNames","previous","getFirstMarker","filter","accept","getMultiRangeId","getItems","delete","subType","getRanges","start","set","data","split","isMultiRange","attributes","_saved","_model","toJSON"];var _r,yr;_r=Er,yr=138,function(t){for(;--t;)_r.push(_r.shift())}(++yr);const Tr=function(t,e){return Er[t-=0]};class Cr{constructor(t,e){this.id=e.id,this[Tr("0x37")]=e[Tr("0x37")],this.subType=e.subType||null,this[Tr("0x4")]=e[Tr("0x4")],this[Tr("0x1d")]=null,this[Tr("0x22")]=t,this._onAccept=e.onAccept,this[Tr("0x2e")]=e[Tr("0x25")],this[Tr("0xe")]=e[Tr("0xc")],this._markerNames=new Set,this.set(Tr("0x1"),null),this[Tr("0x1c")]("attributes",e.attributes||{}),this.set(Tr("0x12"),null),this[Tr("0x1c")](Tr("0x33"),null),this[Tr("0x1c")](Tr("0x32"),null),this[Tr("0x1c")](Tr("0x21"),!1),this[Tr("0x8")](Tr("0x15")),this.decorate("discard")}get head(){let t=this;for(;t.previous;)t=t.previous;return t}get[Tr("0x30")](){return!!this[Tr("0x32")]&&this[Tr("0x32")][Tr("0x0")]>0}get[Tr("0x1f")](){return 0!=this._markerNames.size&&6==Array[Tr("0x31")](this[Tr("0x11")])[0][Tr("0x1e")](":").length}get[Tr("0xb")](){return null!==this[Tr("0x13")]()}[Tr("0xf")](t){this._markerNames.add(t)}[Tr("0x34")](){return Array.from(this[Tr("0x11")])}[Tr("0x35")](){return this[Tr("0x34")]().map((t=>this[Tr("0x22")].markers[Tr("0x29")](t)))[Tr("0x14")]((t=>t))}[Tr("0x13")](){return this[Tr("0x35")]()[0]||null}[Tr("0x26")](){this[Tr("0x22")][Tr("0x7")]((t=>{for(const e of this[Tr("0x35")]())t[Tr("0x28")](e)})),this._markerNames[Tr("0x2")]()}[Tr("0x28")](t){this._model[Tr("0x7")]((e=>{e.removeMarker(t)})),this._markerNames[Tr("0x18")](t)}[Tr("0x38")](t){const e=Tr("0x27")+this[Tr("0x37")]+":"+this[Tr("0x19")]+":"+this.id+":"+this.author.id+":"+Cr[Tr("0x16")]();this[Tr("0xf")](e),this[Tr("0x22")].change((n=>{n[Tr("0x39")](e,{range:t,usingOperation:!0,affectsData:!0})}))}isIntersectingWithRange(t){for(const e of this[Tr("0x1a")]())if(e[Tr("0x5")](t))return!0;return!1}[Tr("0x1a")](){return this[Tr("0x35")]()[Tr("0x2d")]((t=>t[Tr("0x2f")]()))}[Tr("0x17")](){return this[Tr("0x1a")]().reduce(((t,e)=>[...t,...e[Tr("0x17")]()]),[])}[Tr("0xd")](){return this.getFirstMarker().getRange()}getContainedElement(){const t=this[Tr("0x1a")]();if(1!=t[Tr("0x0")])return null;const e=t[0],n=e[Tr("0x1b")][Tr("0x24")],o=e[Tr("0x9")].nodeBefore;return n instanceof F.Element?n!=o?null:n:null}[Tr("0x15")](){this[Tr("0xa")](this[Tr("0x1a")](),this[Tr("0x1d")],this[Tr("0x20")]),this.removeMarkers()}[Tr("0x3")](){this[Tr("0x2e")](this[Tr("0x1a")](),this.data,this[Tr("0x20")]),this.removeMarkers()}[Tr("0x6")](){const t=[];let e=this[Tr("0x36")];for(;e;)t[Tr("0x2b")](e),e=e[Tr("0x33")];return t}[Tr("0x10")](t,e){const n=So(this[Tr("0x20")]);Wo(n,t,e),dr(n,this[Tr("0x20")])||(this[Tr("0x20")]=n,this[Tr("0xe")](n))}[Tr("0x2c")](t){const e=So(this[Tr("0x20")]);br(e,t),dr(e,this[Tr("0x20")])||(this[Tr("0x20")]=e,this[Tr("0xe")](this.attributes))}[Tr("0x23")](){return{id:this.id,type:this[Tr("0x19")]?this.type+":"+this[Tr("0x19")]:this.type,authorId:this[Tr("0x4")].id,createdAt:this.createdAt,hasComments:this.hasComments,data:this[Tr("0x1d")],attributes:this[Tr("0x20")]}}static[Tr("0x16")](){return(0,e.uid)()[Tr("0x2a")](1,5)}}function kr(t,e,n){const o=t.t;switch(e){case"Track changes":return o("Track changes");case"Accept suggestion":return o("Accept suggestion");case"Discard suggestion":return o("Discard suggestion");case"Accept all suggestions":return o("Accept all suggestions");case"Accept all selected suggestions":return o("Accept all selected suggestions");case"Discard all suggestions":return o("Discard all suggestions");case"Discard all selected suggestions":return o("Discard all selected suggestions");case"*Reset font size*":return o("*Reset font size*");case"*Reset font family*":return o("*Reset font family*");case"*Reset font color*":return o("*Reset font color*");case"*Reset font background color*":return o("*Reset font background color*");case"*Remove image text alternative*":return o("*Remove image text alternative*");case"*Reset image width*":return o("*Reset image width*");case"*Remove link*":return o("*Remove link*");case"*Check item*":return o("*Check item*");case"*Uncheck item*":return o("*Uncheck item*");case"*Remove all formatting*":return o("*Remove all formatting*");case"*Replace table cells*":return o("*Replace table cells*");case"*Merge cells*":return o("*Merge cells*");case"*Split cell:* vertically":return o("*Split cell:* vertically");case"*Split cell:* horizontally":return o("*Split cell:* horizontally");case"*Indent:* %0":return o("*Indent:* %0",n);case"*Outdent:* %0":return o("*Outdent:* %0",n);case"*Change to:* %0":return o("*Change to:* %0",n);case"*Insert:* %0":return o("*Insert:* %0",n);case"*Format:* %0":return o("*Format:* %0",n);case"*Change %0 content*":return o("*Change %0 content*",n);case"*Remove:* %0":return o("*Remove:* %0",n);case"*Merge:* %0":return o("*Merge:* %0",n);case"*Split:* %0":return o("*Split:* %0",n);case"*Remove format:* %0":return o("*Remove format:* %0",n);case"*Set font size:* %0":return o("*Set font size:* %0",n);case"*Set font family:* %0":return o("*Set font family:* %0",n);case"*Set font color:* %0":return o("*Set font color:* %0",n);case"*Set font background color:* %0":return o("*Set font background color:* %0",n);case"*Set image text alternative:* %0":return o("*Set image text alternative:* %0",n);case"*Set image width:* %0":return o("*Set image width:* %0",n);case"*Set link:* %0":return o("*Set link:* %0",n);case"*Set highlight:* %0":return o("*Set highlight:* %0",n);case"*Remove highlight*":return o("*Remove highlight*");case"FORMAT_HIGHLIGHT":return o({string:"highlight",id:"FORMAT_HIGHLIGHT"});case"FORMAT_RESTRICTED_ENABLED":return o({string:"*Enable in restricted editing mode*",id:"FORMAT_RESTRICTED_ENABLED"});case"FORMAT_RESTRICTED_DISABLED":return o({string:"*Disable in restricted editing mode*",id:"FORMAT_RESTRICTED_DISABLED"});case"ELEMENT_TABLE":return o({string:"table",plural:"%0 tables",id:"ELEMENT_TABLE"},n);case"ELEMENT_PARAGRAPH":return o({string:"paragraph",plural:"%0 paragraphs",id:"ELEMENT_PARAGRAPH"},n);case"ELEMENT_PAGE_BREAK":return o({string:"page break",plural:"%0 page breaks",id:"ELEMENT_PAGE_BREAK"},n);case"ELEMENT_MEDIA":return o({string:"media item",plural:"%0 media items",id:"ELEMENT_MEDIA"},n);case"ELEMENT_IMAGE":return o({string:"image",plural:"%0 images",id:"ELEMENT_IMAGE"},n);case"ELEMENT_INLINE_IMAGE":return o({string:"image",plural:"%0 images",id:"ELEMENT_INLINE_IMAGE"},n);case"FORMAT_SIDE_IMAGE":return o({string:"side image",id:"FORMAT_SIDE_IMAGE"});case"ELEMENT_CAPTION":return o({string:"caption",id:"ELEMENT_CAPTION"});case"ELEMENT_HORIZONTAL_LINE":return o({string:"horizontal line",plural:"%0 horizontal lines",id:"ELEMENT_HORIZONTAL_LINE"},n);case"ELEMENT_HTML_EMBED":return o({string:"HTML embed",plural:"%0 HTML embeds",id:"ELEMENT_HTML_EMBED"},n);case"ELEMENT_HEADING":return o({string:"heading (level %1)",plural:"%0 headings (level %1)",id:"ELEMENT_HEADING"},n);case"ELEMENT_HEADING_CUSTOM":return o({string:"heading (%1)",plural:"%0 headings (%1)",id:"ELEMENT_HEADING_CUSTOM"},n);case"ELEMENT_LIST_ITEM":return o({string:"list item",plural:"%0 list items",id:"ELEMENT_LIST_ITEM"},n);case"ELEMENT_BULLETED_LIST":return o({string:"bulleted list",id:"ELEMENT_BULLETED_LIST"});case"ELEMENT_NUMBERED_LIST":return o({string:"numbered list",id:"ELEMENT_NUMBERED_LIST"});case"ELEMENT_TODO_LIST":return o({string:"to-do list",id:"ELEMENT_TODO_LIST"});case"REPLACE_TEXT":return o({string:"*Replace:* %0 *with* %1",id:"REPLACE_TEXT"},n);case"ELEMENT_SPACE":return o({string:"space",plural:"%0 spaces",id:"ELEMENT_SPACE"},n);case"FORMAT_ALIGN_TO_LEFT":return o({string:"align to left",id:"FORMAT_ALIGN_TO_LEFT"});case"FORMAT_ALIGN_TO_RIGHT":return o({string:"align to right",id:"FORMAT_ALIGN_TO_RIGHT"});case"FORMAT_ALIGN_TO_CENTER":return o({string:"align to center",id:"FORMAT_ALIGN_TO_CENTER"});case"FORMAT_JUSTIFY_TEXT":return o({string:"justify",id:"FORMAT_JUSTIFY_TEXT"});case"FORMAT_BOLD":return o({string:"bold",id:"FORMAT_BOLD"});case"FORMAT_ITALIC":return o({string:"italic",id:"FORMAT_ITALIC"});case"FORMAT_UNDERLINE":return o({string:"underline",id:"FORMAT_UNDERLINE"});case"FORMAT_CODE":return o({string:"code",id:"FORMAT_CODE"});case"FORMAT_STRIKETHROUGH":return o({string:"strikethrough",id:"FORMAT_STRIKETHROUGH"});case"FORMAT_SUBSCRIPT":return o({string:"subscript",id:"FORMAT_SUBSCRIPT"});case"FORMAT_SUPERSCRIPT":return o({string:"superscript",id:"FORMAT_SUPERSCRIPT"});case"ELEMENT_BLOCK_QUOTE":return o({string:"block quote",id:"ELEMENT_BLOCK_QUOTE"});case"ELEMENT_CODE_BLOCK":return o({string:"code block",plural:"%0 code blocks",id:"ELEMENT_CODE_BLOCK"},n);case"FORMAT_HEADER_COLUMN":return o({string:"header column",id:"FORMAT_HEADER_COLUMN"});case"FORMAT_REGULAR_COLUMN":return o({string:"regular column",id:"FORMAT_REGULAR_COLUMN"});case"FORMAT_HEADER_ROW":return o({string:"header row",id:"FORMAT_HEADER_ROW"});case"FORMAT_REGULAR_ROW":return o({string:"regular row",id:"FORMAT_REGULAR_ROW"});case"PENDING_ACTION_SUGGESTION":return o({string:"Unsaved change in suggestion.",id:"PENDING_ACTION_SUGGESTION"});case"ELEMENT_TABLE_WITH_TEXT":return o({string:"table *with text* %0",id:"ELEMENT_TABLE_WITH_TEXT"},n);case"ELEMENT_TABLE_ROW":return o({string:"table row",plural:"%0 table rows",id:"ELEMENT_TABLE_ROW"},n);case"ELEMENT_TABLE_ROW_WITH_TEXT":return o({string:"table row *with text* %1",plural:"%0 table rows *with text* %1",id:"ELEMENT_TABLE_ROW_WITH_TEXT"},n);case"ELEMENT_TABLE_COLUMN":return o({string:"table column",plural:"%0 table columns",id:"ELEMENT_TABLE_COLUMN"},n);case"ELEMENT_TABLE_COLUMN_WITH_TEXT":return o({string:"table column *with text* %1",plural:"%0 table columns *with text* %1",id:"ELEMENT_TABLE_COLUMN_WITH_TEXT"},n);case"ELEMENT_LINE_BREAK":return o({id:"ELEMENT_LINE_BREAK",string:"line break",plural:"%0 line breaks"},n);case"ELEMENT_TITLE":return o({id:"ELEMENT_TITLE",string:"title"})}}(0,e.mix)(Cr,e.ObservableMixin);const vr=["item","*Merge:* %0","addEmptyContainer","EmptyContainer","nextSibling","deletion","removeContainer","removeEmptyContainer","*Insert:* %0","*Remove:* %0","getWalker","quantity","isObject","element","type","data","registerDescriptionCallback","_locale","replace","$1 $2","textProxy","match","removeObject","ELEMENT_SPACE","previousSibling","end","isEmpty","_resolveDescriptionItems","pop","length","addObject","_addDescriptionItems","checkChild","softBreak","addContainer","REPLACE_TEXT","_schema","registerElementLabel","indexOf","name","elementEnd","start","Container","set","getItemLabel","add","function","push","Object","insertion","text","remove","isInContent","$text","_itemLabels","getFirstRange"];var Ar,Rr;Ar=vr,Rr=345,function(t){for(;--t;)Ar.push(Ar.shift())}(++Rr);const Sr=function(t,e){return vr[t-=0]};class Ir{constructor(t,e){this._customCallbacks=[],this._itemLabels=new Map,this._schema=t,this._locale=e}getDescriptions(t){const e=[];for(let n=0;n<t[Sr("0x14")];n++){const o=t[n];if(!o[Sr("0x2b")])continue;let r=!1;for(const t of this._customCallbacks){const n=t(o);if(n){n[Sr("0x5")]&&e[Sr("0x26")](n),r=!0;break}}if(!r){this[Sr("0x16")](e,o);const r=t[n+1];if(r&&!o[Sr("0x2e")]()[Sr("0x10")].isEqual(r[Sr("0x2e")]()[Sr("0x20")])){const t=e[e[Sr("0x14")]-1],n=Sr("0x28")==o.type?Sr("0x24"):Sr("0x2a");t&&Sr("0x29")==t.type&&(t[n]+="\n")}}}return this._resolveDescriptionItems(e)}[Sr("0x7")](t){this._customCallbacks[Sr("0x26")](t)}[Sr("0x1c")](t,e){this[Sr("0x2d")][Sr("0x22")](t,e)}[Sr("0x23")](t,e=1){const n=this[Sr("0x2d")].get(t)||t;return Sr("0x25")==typeof n?n(e):1!==e?e+" "+n+"s":""+n}[Sr("0x16")](t,e){const n=e[Sr("0x2e")]()[Sr("0x1")](),o=Sr("0x28")==e.type?Sr("0x24"):Sr("0x2a");for(const e of n){const r=e[Sr("0x2f")],s=t[t.length-1];if(r.is(Sr("0xb")))s&&s[Sr("0x5")].indexOf(Sr("0x21"))>-1&&t[Sr("0x13")](),s&&Sr("0x29")==s[Sr("0x5")]?s[o]+=r[Sr("0x6")]:t[Sr("0x26")]({type:"text",add:"add"==o?r.data:"",remove:Sr("0x2a")==o?r[Sr("0x6")]:""});else if(this[Sr("0x1b")].isObject(r)){if(s&&s[Sr("0x5")][Sr("0x1d")](Sr("0x21"))>-1&&t[Sr("0x13")](),Sr("0x1f")==e[Sr("0x5")])continue;s&&s[Sr("0x5")]==o+Sr("0x27")&&s[Sr("0x1e")]==r.name?s[Sr("0x2")]++:t[Sr("0x26")]({type:o+Sr("0x27"),name:r[Sr("0x1e")],quantity:1}),n.skip((t=>!("elementEnd"==t[Sr("0x5")]&&t[Sr("0x2f")]==r)))}else if(this[Sr("0x1b")][Sr("0x17")](r,Sr("0x2c"))||r.is(Sr("0x4"),Sr("0x18"))){if("add"==o&&"elementStart"==e[Sr("0x5")]||Sr("0x2a")==o&&Sr("0x1f")==e[Sr("0x5")])continue;if(s&&-1==s[Sr("0x5")][Sr("0x1d")](Sr("0x21"))){"text"==s[Sr("0x5")]&&(s[o]+="\n");continue}let n;if(n=Sr("0x24")==o?r[Sr("0x33")]&&!this[Sr("0x1b")][Sr("0x3")](r.nextSibling)?r[Sr("0x33")]:null:r[Sr("0xf")]&&!this[Sr("0x1b")].isObject(r[Sr("0xf")])?r.previousSibling:null,r[Sr("0x11")]||n&&n.isEmpty){const e=n&&n[Sr("0x11")]?n.name:r[Sr("0x1e")];s&&s[Sr("0x5")]==o+Sr("0x32")&&s.name==e?s.quantity++:t[Sr("0x26")]({type:o+Sr("0x32"),name:e,quantity:1})}else t[Sr("0x26")]({type:o+Sr("0x21"),name:r.name})}}}[Sr("0x12")](t){const e=this[Sr("0x8")],n=[];for(const o of t){switch(o[Sr("0x5")]){case Sr("0x29"):if(o.add=o[Sr("0x24")].replace(/(\S)\u000A+(\S)/g,Sr("0xa"))[Sr("0x9")](/\u000A/g,""),o[Sr("0x2a")]=o[Sr("0x2a")][Sr("0x9")](/(\S)\u000A+(\S)/g,Sr("0xa"))[Sr("0x9")](/\u000A/g,""),""!=o[Sr("0x24")]&&""!=o[Sr("0x2a")]){n[Sr("0x26")]({type:Sr("0x9"),content:kr(e,Sr("0x1a"),['"'+o[Sr("0x2a")]+'"','"'+o.add+'"'])});continue}if(null!=o.add[Sr("0xc")](/^ +$/)){n[Sr("0x26")]({type:Sr("0x28"),content:kr(e,Sr("0x37"),kr(e,"ELEMENT_SPACE",o[Sr("0x24")][Sr("0x14")]))});continue}if(null!=o.remove[Sr("0xc")](/^ +$/)){n[Sr("0x26")]({type:Sr("0x34"),content:kr(e,Sr("0x0"),kr(e,Sr("0xe"),o[Sr("0x2a")][Sr("0x14")]))});continue}if(""!=o.add){n.push({type:Sr("0x28"),content:kr(e,Sr("0x37"),'"'+o[Sr("0x24")]+'"')});continue}n.push({type:Sr("0x34"),content:kr(e,Sr("0x0"),'"'+o.remove+'"')});continue;case Sr("0x31"):case Sr("0x15"):n.push({type:Sr("0x28"),content:kr(e,Sr("0x37"),this[Sr("0x23")](o[Sr("0x1e")],o[Sr("0x2")]))});continue;case Sr("0x36"):case Sr("0xd"):n.push({type:Sr("0x34"),content:kr(e,"*Remove:* %0",this.getItemLabel(o.name,o[Sr("0x2")]))});continue;case Sr("0x19"):n[Sr("0x26")]({type:Sr("0x28"),content:kr(e,"*Split:* %0",this.getItemLabel(o[Sr("0x1e")],o.quantity))});continue;case Sr("0x35"):n[Sr("0x26")]({type:Sr("0x34"),content:kr(e,Sr("0x30"),this[Sr("0x23")](o[Sr("0x1e")],o[Sr("0x2")]))});continue}n[Sr("0x26")](o)}return n}}const wr=["right","getSelectedBlocks","registerDescriptionCallback","center","FORMAT_ALIGN_TO_LEFT","from","TrackChangesEditing","format","commandName","_descriptionFactory","commandParams","enableCommand","locale","checkAttribute","alignment","editor","justify","FORMAT_ALIGN_TO_RIGHT","value","document","get","schema","has","plugins","ltr","afterInit","AlignmentEditing","model","contentLanguageDirection"];var Mr,Nr;Mr=wr,Nr=479,function(t){for(;--t;)Mr.push(Mr.shift())}(++Nr);const Lr=function(t,e){return wr[t-=0]};class Or extends t.Plugin{[Lr("0xa")](){const t=this[Lr("0x0")],e=t[Lr("0x1a")];if(!t[Lr("0x8")][Lr("0x7")](Lr("0xb")))return;const n=t[Lr("0x8")][Lr("0x5")](Lr("0x14"));n[Lr("0x19")]("alignment",((e,o={})=>{let r=o.value;o.value||(r=Lr("0x9")===t.locale[Lr("0xd")]?"left":Lr("0xe"));const s=Array[Lr("0x13")](this[Lr("0x0")][Lr("0xc")][Lr("0x4")].selection[Lr("0xf")]()).filter((t=>function(t,e,n){const o=t.getAttribute(Lr("0x1c"))||null;return e[Lr("0x1b")](t,"alignment")&&n!=o}(t,this[Lr("0x0")].model[Lr("0x6")],r)));t[Lr("0xc")].change((()=>{for(const t of s)n.markBlockFormat(t,{commandName:Lr("0x1c"),commandParams:[{value:r}]})}))})),n[Lr("0x17")][Lr("0x10")]((t=>{const{data:n}=t;if(n&&Lr("0x1c")==n[Lr("0x16")]){const t=n[Lr("0x18")][0][Lr("0x3")];return{type:Lr("0x15"),content:kr(e,"*Format:* %0",function(t){switch(t){case"left":return kr(e,Lr("0x12"));case Lr("0xe"):return kr(e,Lr("0x2"));case Lr("0x11"):return kr(e,"FORMAT_ALIGN_TO_CENTER");case Lr("0x1"):return kr(e,"FORMAT_JUSTIFY_TEXT")}}(t))}}}))}}const Fr=["getItems","parent","bindElementToMarker","getCustomProperty","push","model","item","type","mapper","isLimit","addHighlight","schema","previousPosition","activeMarkers","element","isContent","markerRange","ck-suggestion-marker--active","hasAttribute","elementEnd","insert","name","includes","ck-suggestion-marker-","listItem","start","nextSibling","span","isAtEnd","toViewPosition","createRangeOn","toViewElement","listIndent","writer"];var Pr,Dr;Pr=Fr,Dr=212,function(t){for(;--t;)Pr.push(Pr.shift())}(++Dr);const jr=function(t,e){return Fr[t-=0]};function Br(t,e,n){const o=[];for(const r of e[jr("0x1a")]())r[jr("0xa")](t)&&o.push(n[jr("0x16")](r));return o}function Ur(t){const e=[];if(t.is(jr("0x6"),jr("0x10"))){let n=t[jr("0x12")];for(;n&&n.is(jr("0x6"),jr("0x10"))&&n.getAttribute(jr("0x18"))>0;)e[jr("0x1e")](n),n=n[jr("0x12")]}return e}function Hr(t,e,{showActiveMarker:n=!0}={}){const o=t.plugins.get("TrackChangesEditing");return(r,s,i)=>{if(!i.consumable.test(s.markerRange,r[jr("0xd")]))return;const a=s[jr("0x8")].getWalker(),x=s.markerRange[jr("0x11")],c=t[jr("0x1f")][jr("0x3")];let l=null,u=null,d=!1,g=!1;for(const t of a){const e=t[jr("0x20")];d=d||c[jr("0x7")](e);const n=i[jr("0x0")][jr("0x17")](e);if(n&&n[jr("0x1d")](jr("0x2")))return;jr("0xb")==t[jr("0x21")]&&c.isBlock(e)&&!c[jr("0x1")](e)&&(e[jr("0x12")]||x[jr("0x14")]?l&&l[jr("0x1b")]==e||(l=e,f(t[jr("0x4")]),g=!0):u=u||t.previousPosition)}function f(t){const r=i[jr("0x19")].createUIElement(jr("0x13"),{class:jr("0xf")+e}),a=i[jr("0x0")][jr("0x15")](t);n&&o[jr("0x5")][jr("0xe")](s.markerName)&&i.writer.addClass(jr("0x9"),r),i[jr("0x19")][jr("0xc")](a,r),i[jr("0x0")][jr("0x1c")](r,s.markerName)}d||g||!u||f(u)}}const Gr=["format","editor","commandParams","commandName","toLowerCase","model","plugins","FORMAT_SUBSCRIPT","bold","_descriptionFactory","StrikethroughEditing","*Format:* %0","ItalicEditing","SubscriptEditing","strikethrough","enableCommand","FORMAT_ITALIC","BoldEditing","FORMAT_SUPERSCRIPT","get","has","FORMAT_STRIKETHROUGH","underline","isCollapsed","UnderlineEditing","*Remove format:* %0","FORMAT_UNDERLINE","getRanges","FORMAT_BOLD","document","italic","code","from","forceValue","value"];var Vr,zr;Vr=Gr,zr=150,function(t){for(;--t;)Vr.push(Vr.shift())}(++zr);const Wr=function(t,e){return Gr[t-=0]},Kr=[Wr("0x7"),Wr("0x2"),Wr("0xe"),"CodeEditing",Wr("0x0"),Wr("0x3"),"SuperscriptEditing"];class $r extends t.Plugin{afterInit(){const t=this[Wr("0x1a")],e=t[Wr("0x1e")],n=t[Wr("0x1f")][Wr("0x9")]("TrackChangesEditing"),o=t.locale;for(const o of Kr){if(!t[Wr("0x1f")][Wr("0xa")](o))continue;const r=o.slice(0,-7)[Wr("0x1d")](),s=t.commands.get(r);n[Wr("0x5")](r,((t,o={})=>{const i=e[Wr("0x13")].selection;if(i[Wr("0xd")])return void t(o);const a=void 0!==o.forceValue?o[Wr("0x17")]:!s[Wr("0x18")];e.change((()=>{const t=Array[Wr("0x16")](i[Wr("0x11")]());for(const o of t){const t=a?[o]:Br(r,o,e);for(const e of t)n.markInlineFormat(e,{commandName:r,commandParams:[{forceValue:a}]})}}))}))}function r(t,e){n[Wr("0x22")].registerDescriptionCallback((n=>{const{data:r}=n;if(r&&r[Wr("0x1c")]===t)return r[Wr("0x1b")][0].forceValue?{type:Wr("0x19"),content:kr(o,Wr("0x1"),e)}:{type:Wr("0x19"),content:kr(o,Wr("0xf"),e)}}))}r(Wr("0x21"),kr(o,Wr("0x12"))),r(Wr("0x14"),kr(o,Wr("0x6"))),r(Wr("0xc"),kr(o,Wr("0x10"))),r(Wr("0x15"),kr(o,"FORMAT_CODE")),r(Wr("0x4"),kr(o,Wr("0xb"))),r("subscript",kr(o,Wr("0x20"))),r("superscript",kr(o,Wr("0x8")))}}const qr=["createPositionAfter","createPositionBefore","isObject","end","isTouching","push","createPositionAt","createRange"];var Xr,Jr;Xr=qr,Jr=314,function(t){for(;--t;)Xr.push(Xr.shift())}(++Jr);const Qr=function(t,e){return qr[t-=0]};function Yr(t,e){let n,o=0;const r=[],s=e.schema;for(;o<t.length;){const i=t[o],a=t[o+1];n||(n=e[Qr("0x7")](i)),Zr(e,i,a)||(r[Qr("0x3")](e[Qr("0x5")](n,s[Qr("0x0")](i)?e[Qr("0x6")](i):e[Qr("0x4")](i,Qr("0x1")))),n=null),o++}return r}function Zr(t,e,n){if(!n)return!1;const o=t[Qr("0x6")](e),r=t[Qr("0x7")](n);return o[Qr("0x2")](r)}const ts=["has","_descriptionFactory","registerDescriptionCallback","commandParams","*Format:* %0","from","model","editor","format","change","blockQuote","filter","checkChild","TrackChangesEditing","schema","$root","BlockQuoteEditing","getSelectedBlocks","name","afterInit","plugins","commands","get","forceValue","selection","value","parent"];var es,ns;es=ts,ns=469,function(t){for(;--t;)es.push(es.shift())}(++ns);const os=function(t,e){return ts[t-=0]};class rs extends t.Plugin{[os("0x9")](){const t=this[os("0x18")],e=t.locale;if(!t[os("0xa")][os("0x11")](os("0x6")))return;const n=t[os("0xa")][os("0xc")](os("0x3")),o=this[os("0x18")][os("0xb")].get(os("0x0"));n.enableCommand(os("0x0"),((e,r={})=>{const s=this[os("0x18")][os("0x17")].document[os("0xe")],i=r&&void 0!==r[os("0xd")]?r[os("0xd")]:!o[os("0xf")];let a=[];if(i){const e=Array[os("0x16")](s.getSelectedBlocks()).filter((t=>ss(t)||function(t,e){const n=e[os("0x2")](t[os("0x10")],os("0x0")),o=e[os("0x2")]([os("0x5"),os("0x0")],t);return n&&o}(t,this[os("0x18")][os("0x17")][os("0x4")])));a=Yr(e,t[os("0x17")])}else{const e=Array[os("0x16")](s[os("0x7")]())[os("0x1")]((t=>ss(t)));a=Yr(e,t[os("0x17")])}t.model[os("0x1a")]((()=>{for(const t of a)n.markBlockFormat(t,{commandName:os("0x0"),commandParams:[{forceValue:i}]})}))})),n[os("0x12")][os("0x13")]((t=>{const{data:n}=t;if(n&&os("0x0")==n.commandName){const t=kr(e,"ELEMENT_BLOCK_QUOTE");return n[os("0x14")][0][os("0xd")]?{type:os("0x19"),content:kr(e,os("0x15"),t)}:{type:os("0x19"),content:kr(e,"*Remove format:* %0",t)}}}))}}function ss(t){return os("0x0")==t.parent[os("0x8")]}const is=["enableCommand","editor","ckbox","get","commands","afterInit"];var as,xs;as=is,xs=461,function(t){for(;--t;)as.push(as.shift())}(++xs);const cs=function(t,e){return is[t-=0]};class ls extends t.Plugin{[cs("0x0")](){const t=this[cs("0x2")];t[cs("0x5")][cs("0x4")](cs("0x3"))&&t.plugins[cs("0x4")]("TrackChangesEditing")[cs("0x1")](cs("0x3"))}}const us=["has","checkChild","label","codeBlock","from","outdentCodeBlock","markBlockFormat","locale","language","plugins","getSelectedBlocks","registerDescriptionCallback","blockName","*Format:* %0","formatBlock","name","get","model","schema","config","commands","ELEMENT_CODE_BLOCK","rootElement","TrackChangesEditing","*Remove format:* %0","_descriptionFactory","parent","commandName","CodeBlock","document","selection","forceValue","change","languages","commandParams","enableCommand","filter","format","isLimit","afterInit"];var ds,gs;ds=us,gs=195,function(t){for(;--t;)ds.push(ds.shift())}(++gs);const fs=function(t,e){return us[t-=0]};class ms extends t.Plugin{[fs("0x4")](){const t=this.editor;if(!t[fs("0xe")][fs("0x5")](fs("0x21")))return;const e=t[fs("0xe")][fs("0x15")](fs("0x1c")),n=t[fs("0xc")],o=t[fs("0x18")][fs("0x15")]("codeBlock")[fs("0x26")],r=t[fs("0x19")].get(fs("0x8"));e[fs("0x0")]("indentCodeBlock"),e[fs("0x0")](fs("0xa")),e[fs("0x0")](fs("0x8"),((n,s={})=>{const i=t[fs("0x16")],a=t[fs("0x16")][fs("0x22")][fs("0x23")],x=s&&void 0!==s.forceValue?s[fs("0x24")]:!r.value;let c;s[fs("0xd")]||(s[fs("0xd")]=o[0].language),c=x?Array[fs("0x9")](a[fs("0xf")]())[fs("0x1")]((t=>{return hs(t)||(e=t,n=i[fs("0x17")],!e.is(fs("0x1b"))&&!n[fs("0x3")](e)&&n[fs("0x6")](e[fs("0x1f")],fs("0x8")));var e,n})):Array[fs("0x9")](a[fs("0xf")]())[fs("0x1")]((t=>hs(t)));const l=Yr(c,i);i[fs("0x25")]((()=>{for(const t of l)e[fs("0xb")](t,{commandName:fs("0x8"),commandParams:[{...s,forceValue:x}],formatGroupId:fs("0x11")})}))})),e[fs("0x1e")].registerElementLabel("codeBlock",(t=>kr(n,fs("0x1a"),t))),e._descriptionFactory[fs("0x10")]((t=>{const{type:e,data:r}=t;if(fs("0x13")==e&&r&&fs("0x8")==r[fs("0x20")]){const t=r.commandParams[0][fs("0xd")],e=o.find((e=>e.language===t))[fs("0x7")],s=n._t(e);return r[fs("0x27")][0].forceValue?{type:fs("0x2"),content:kr(n,fs("0x12"),kr(n,"ELEMENT_CODE_BLOCK",1)+" ("+s+")")}:{type:fs("0x2"),content:kr(n,fs("0x1d"),kr(n,fs("0x1a"),1))}}}))}}function hs(t){return fs("0x8")==t[fs("0x14")]}var ps,bs,Es=["get","plugins","addCommentThread","editor","TrackChangesEditing","init","requires","enableCommand"];ps=Es,bs=254,function(t){for(;--t;)ps.push(ps.shift())}(++bs);var _s=function(t,e){return Es[t-=0]};class ys extends t.Plugin{static get[_s("0x0")](){return["CommentsEditing"]}[_s("0x7")](){this[_s("0x5")][_s("0x3")][_s("0x2")](_s("0x6"))[_s("0x1")](_s("0x4"))}}var Ts=n(181);const Cs=["detach","markerName","createRange","markerNameToElements","selection","root","rootName","requires","document","model","downcastDispatcher","$graveyard","lock","batch","enqueueChange","getFirstRange","delete","start","end","modifySelection","high","options","removeMarker:suggestion:deletion","editor","buffer","unlock","addMarker:suggestion:deletion","createSelection","forward","fromRange","editing","unbindElementFromMarkerName","writer","deleteForward","init","uiElement","remove"];var ks,vs;ks=Cs,vs=349,function(t){for(;--t;)ks.push(ks.shift())}(++vs);const As=function(t,e){return Cs[t-=0]};class Rs extends t.Plugin{static get[As("0x1c")](){return[Ts.Delete]}[As("0x12")](){const t=this[As("0x7")],e=t.plugins.get("TrackChangesEditing");e.enableCommand(As("0x0"));const n=t.commands.get("deleteForward");e.enableCommand(As("0x11"),((e,o={})=>{const r=t[As("0x1e")][As("0xb")](t[As("0x1e")][As("0x1d")][As("0x19")]);r.isCollapsed&&t.model[As("0x3")](r,{direction:As("0xc"),unit:o.unit});const s=r[As("0x24")](),i=F.LiveRange[As("0xd")](s);let a;e(o),a=As("0x20")==i[As("0x1a")][As("0x1b")]?t[As("0x1e")][As("0x17")](s[As("0x1")]):t[As("0x1e")][As("0x17")](i[As("0x1")],i[As("0x2")]),i[As("0x15")](),t.model[As("0x23")](n[As("0x8")][As("0x22")],(t=>{n.buffer[As("0x21")](),t.setSelection(t[As("0x17")](a.end)),n[As("0x8")][As("0x9")]()}))})),t[As("0xe")][As("0x1f")].on(As("0xa"),Hr(t,"merge"),{priority:As("0x4")}),t.data[As("0x1f")].on(As("0xa"),((e,n,o)=>{o[As("0x5")].showSuggestionHighlights&&Hr(t,"merge",{showActiveMarker:!1})(e,n,o)}),{priority:As("0x4")}),t[As("0xe")][As("0x1f")].on(As("0x6"),((t,e,n)=>{const o=n.mapper[As("0x18")](e[As("0x16")]);if(o)for(const t of o)t.is(As("0x13"))&&(n.mapper[As("0xf")](t,e[As("0x16")]),n[As("0x10")][As("0x14")](t))}),{priority:"high"})}}var Ss=n(331);const Is=["ck-suggestion-marker-split","high","TrackChangesEditing","plugins","start","hasClass","detach","init","createRange","change","model","enter","selection","end","nextSibling","split","downcastDispatcher","writer","parent","setSelection","mapper","fromRange","get","schema","showSuggestionHighlights","document","getFirstPosition","markInsertion","editing","removeMarker:suggestion:insertion","editor","createPositionAt","remove","addMarker:suggestion:insertion","data"];var ws,Ms;ws=Is,Ms=154,function(t){for(;--t;)ws.push(ws.shift())}(++Ms);const Ns=function(t,e){return Is[t-=0]};class Ls extends t.Plugin{static get requires(){return[Ss.Enter]}[Ns("0x1c")](){const t=this[Ns("0x10")],e=t[Ns("0x18")][Ns("0x8")](Ns("0x17"));e.enableCommand(Ns("0x20"),(n=>{t[Ns("0x1f")][Ns("0x1e")]((o=>{const r=t[Ns("0x1f")][Ns("0xb")][Ns("0x21")],s=r[Ns("0xc")](),i=r.isCollapsed,a=F.LiveRange[Ns("0x7")](r.getFirstRange()),x=a[Ns("0x19")][Ns("0x4")],c=a.end[Ns("0x4")],l=!(a[Ns("0x19")].isAtStart&&a[Ns("0x22")].isAtEnd),u=x==c,d=!(t.model.schema.isLimit(x)||t[Ns("0x1f")][Ns("0x9")].isLimit(c))&&(i||l&&u);if(n(),d){const n=t[Ns("0x1f")][Ns("0x11")](s[Ns("0x4")][Ns("0x0")],0),r=o[Ns("0x1d")](s,n);e[Ns("0xd")](r)}else o[Ns("0x5")](o[Ns("0x1d")](a[Ns("0x22")]));a[Ns("0x1b")]()}))})),t[Ns("0xe")].downcastDispatcher.on(Ns("0x13"),Hr(t,Ns("0x1")),{priority:"high"}),t[Ns("0xe")][Ns("0x2")].on(Ns("0xf"),((t,e,n)=>{const o=n[Ns("0x6")].markerNameToElements(e.markerName);if(o)for(const t of o)t[Ns("0x1a")](Ns("0x15"))&&(n.mapper.unbindElementFromMarkerName(t,e.markerName),n[Ns("0x3")][Ns("0x12")](t))}),{priority:Ns("0x16")}),t[Ns("0x14")][Ns("0x2")].on("addMarker:suggestion:insertion",((e,n,o)=>{o.options[Ns("0xa")]&&Hr(t,Ns("0x1"),{showActiveMarker:!1})(e,n,o)}),{priority:Ns("0x16")})}}const Os=["title","FontBackgroundColorEditing","editor","afterInit","plugins","FontFamilyEditing","*Reset font color*","fontSize","label","format","get","model","fontColor","registerDescriptionCallback","*Reset font family*","find","config","fontBackgroundColor.colors","document","toLowerCase","*Reset font size*","_enableCommand","TrackChangesEditing","fontFamily","value","markInlineFormat","fontBackgroundColor","selection","FontColorEditing","commandName","FontSizeEditing","commandParams","fontSize.options","*Reset font background color*","*Set font background color:* %0","trim","change","*Set font size:* %0","enableCommand","*Set font color:* %0","has","normalizeSizeOptions","locale","getRanges"];var Fs,Ps;Fs=Os,Ps=199,function(t){for(;--t;)Fs.push(Fs.shift())}(++Ps);const Ds=function(t,e){return Os[t-=0]},js=[{pluginName:Ds("0x7"),commandName:Ds("0x1c")},{pluginName:Ds("0x1a"),commandName:Ds("0x0")},{pluginName:Ds("0x5"),commandName:Ds("0x21")},{pluginName:Ds("0x16"),commandName:Ds("0x3")}];class Bs extends t.Plugin{[Ds("0x18")](){const t=this[Ds("0x17")].locale;for(const{pluginName:t,commandName:e}of js)this[Ds("0x17")][Ds("0x19")][Ds("0x11")](t)&&this[Ds("0x2a")](e);this[Ds("0x17")][Ds("0x19")][Ds("0x1f")](Ds("0x2b"))._descriptionFactory[Ds("0x22")]((e=>{const{data:n}=e;if(null!=n){if("fontSize"==n[Ds("0x6")]){const e=n[Ds("0x8")][0][Ds("0x1")];if(e){const n=this[Ds("0x17")].plugins[Ds("0x1f")]("FontSize")[Ds("0x12")](this.editor.config[Ds("0x1f")](Ds("0x9")))[Ds("0x24")]((t=>t[Ds("0x20")]==e))[Ds("0x15")],o=this[Ds("0x17")][Ds("0x13")]._t(n)[Ds("0x28")]();return{type:Ds("0x1e"),content:kr(t,Ds("0xe"),o)}}return{type:Ds("0x1e"),content:kr(t,Ds("0x29"))}}if(Ds("0x0")==n[Ds("0x6")]){const e=n[Ds("0x8")][0][Ds("0x1")];return e?{type:"format",content:kr(t,"*Set font family:* %0",e)}:{type:"format",content:kr(t,Ds("0x23"))}}if("fontColor"==n[Ds("0x6")]){const e=n[Ds("0x8")][0].value;if(e){const n=(0,r.normalizeColorOptions)(this[Ds("0x17")][Ds("0x25")][Ds("0x1f")]("fontColor.colors"))[Ds("0x24")]((t=>t.model==e));let o=e,s="";return n&&(o=n[Ds("0x1d")],s=t._t(o).toLowerCase()),{type:Ds("0x1e"),content:kr(t,Ds("0x10"),s)[Ds("0xc")](),color:{value:e,title:s||o}}}return{type:Ds("0x1e"),content:kr(t,Ds("0x1b"))}}if("fontBackgroundColor"==n[Ds("0x6")]){const e=n.commandParams[0][Ds("0x1")];if(e){const n=(0,r.normalizeColorOptions)(this[Ds("0x17")][Ds("0x25")][Ds("0x1f")](Ds("0x26"))).find((t=>t[Ds("0x20")]==e));let o=e,s="";return n&&(o=n[Ds("0x1d")],s=t._t(o)[Ds("0x28")]()),{type:Ds("0x1e"),content:kr(t,Ds("0xb"),s)[Ds("0xc")](),color:{value:e,title:s||o}}}return{type:Ds("0x1e"),content:kr(t,Ds("0xa"))}}}}))}_enableCommand(t){const e=this[Ds("0x17")];e.plugins.get(Ds("0x2b"))[Ds("0xf")](t,((n,o={})=>{const r=e[Ds("0x20")][Ds("0x27")][Ds("0x4")],s=o[Ds("0x1")];r.isCollapsed?n(o):e[Ds("0x20")][Ds("0xd")]((()=>{const n=Array.from(r[Ds("0x14")]());for(const o of n){const n=s?[o]:Br(t,o,e.model);for(const o of n)e[Ds("0x19")][Ds("0x1f")](Ds("0x2b"))[Ds("0x2")](o,{commandName:t,commandParams:[{value:s}]})}}))}))}}const Us=["selection","isObject","heading.options","filter","enableCommand","format","heading","document","markBlockFormat","*Change to:* %0","title","schema","from","TrackChangesEditing","formatBlock","blockName","locale","match","value","paragraph","_descriptionFactory","config","registerElementLabel","model","editor","change","parent","registerDescriptionCallback","get","commandName","ELEMENT_HEADING_CUSTOM","plugins","name"];var Hs,Gs;Hs=Us,Gs=300,function(t){for(;--t;)Hs.push(Hs.shift())}(++Gs);const Vs=function(t,e){return Us[t-=0]};class zs extends t.Plugin{afterInit(){const t=this[Vs("0x15")],e=t[Vs("0xd")],n=t[Vs("0x12")][Vs("0x19")](Vs("0x20"));if(!t[Vs("0x1c")].has("HeadingEditing"))return;const o=t[Vs("0x1c")].get(Vs("0xa"));o[Vs("0x1")](Vs("0x3"),((e,n)=>{const r=n[Vs("0xf")],s=Array[Vs("0x9")](this[Vs("0x15")][Vs("0x14")][Vs("0x4")][Vs("0x1e")].getSelectedBlocks())[Vs("0x0")]((t=>{return e=t,n=r,(o=this.editor.model[Vs("0x8")]).checkChild(e[Vs("0x17")],n)&&!o[Vs("0x1f")](e)&&e[Vs("0x1d")]!=n;var e,n,o}));t.model[Vs("0x16")]((()=>{for(const t of s)o[Vs("0x5")](t,{commandName:Vs("0x3"),commandParams:[n],formatGroupId:Vs("0xc")},Ur(t))}))}));for(const t of n)Vs("0x10")!=t[Vs("0x14")]&&o[Vs("0x11")][Vs("0x13")](t.model,(e=>{const n=Ws(t.model);return null!==n?r(e,n):s(e,t[Vs("0x7")])}));function r(t,n){return kr(e,"ELEMENT_HEADING",[t,n])}function s(t,n){return kr(e,Vs("0x1b"),[t,n])}o[Vs("0x11")][Vs("0x18")]((t=>{const{type:o,data:i}=t;if(Vs("0xb")==o&&i&&Vs("0x3")==i[Vs("0x1a")]){const t=i.commandParams[0][Vs("0xf")],o=Ws(t);if(null!==o)return{type:Vs("0x2"),content:kr(e,"*Change to:* %0",r(1,o))};const a=n.find((e=>e.model===t)).title;return{type:Vs("0x2"),content:kr(e,Vs("0x6"),s(1,a))}}}))}}function Ws(t){const e=t[Vs("0xe")](/^heading(\d+)$/);return e?e[1]:null}const Ks=["item","*Set highlight:* %0","toLowerCase","commandName","find","FORMAT_HIGHLIGHT","getRanges","color","_descriptionFactory","document","title","TrackChangesEditing","value","backward","getLastMatchingPosition","has","config","HighlightEditing","change","formatInline","locale","getFirstPosition","model","isCollapsed","plugins","highlight","editor","*Remove highlight*","createRange","selection","getAttribute","format"];var $s,qs;$s=Ks,qs=311,function(t){for(;--t;)$s.push($s.shift())}(++qs);const Xs=function(t,e){return Ks[t-=0]};class Js extends t.Plugin{afterInit(){const t=this[Xs("0x3")];if(!t.plugins[Xs("0x18")](Xs("0x1a")))return;const e=t[Xs("0x1")].get(Xs("0x14"));e.enableCommand("highlight",((n,o={})=>{const r=t[Xs("0x1f")][Xs("0x12")][Xs("0x6")],s=r[Xs("0x7")](Xs("0x2"));let i=o[Xs("0x15")],a=[];if(r[Xs("0x0")]){const e=r[Xs("0x1e")]();if(!r.hasAttribute("highlight"))return void n(o);{const n=t=>t[Xs("0x9")].getAttribute("highlight")===s,o=e.getLastMatchingPosition(n,{direction:Xs("0x16")}),r=e[Xs("0x17")](n);a=[t[Xs("0x1f")][Xs("0x5")](o,r)],i==s&&(i=null)}}else for(const e of r[Xs("0xf")]())i?a.push(e):a.push(...Br(Xs("0x2"),e,t[Xs("0x1f")]));t.model[Xs("0x1b")]((()=>{for(const t of a)e.markInlineFormat(t,{commandName:Xs("0x2"),commandParams:[{value:i}]})}))}));const n=t[Xs("0x1d")];e[Xs("0x11")].registerDescriptionCallback((e=>{const{type:o,data:r}=e;if(Xs("0x1c")==o&&r&&Xs("0x2")==r[Xs("0xc")]){const e=r.commandParams[0][Xs("0x15")];if(e){const o=t[Xs("0x19")].get("highlight.options")[Xs("0xd")]((t=>t[Xs("0x1f")]==e)),r=n._t(o[Xs("0x13")])[Xs("0xb")]();return{type:Xs("0x8"),content:kr(n,Xs("0xa"),r),color:{value:o[Xs("0x10")],title:o[Xs("0x13")]}}}return{type:Xs("0x8"),content:kr(n,Xs("0x4"),kr(n,Xs("0xe")))}}}))}}const Qs=["div","get","createPositionAt","plugins","ELEMENT_HORIZONTAL_LINE","locale","insert","horizontalLine","for","elementToStructure","addClass","has","registerElementLabel","createContainerElement","enableCommand","editor","dataDowncast","TrackChangesEditing","ck-horizontal-line","HorizontalLineEditing"];var Ys,Zs;Ys=Qs,Zs=169,function(t){for(;--t;)Ys.push(Ys.shift())}(++Zs);const ti=function(t,e){return Qs[t-=0]};class ei extends t.Plugin{afterInit(){const t=this[ti("0x6")];if(!t[ti("0xe")][ti("0x2")](ti("0xa")))return;t.plugins[ti("0xc")]("TrackChangesEditing")[ti("0x5")](ti("0x12"));const e=t[ti("0xe")][ti("0xc")](ti("0x8")),n=t[ti("0x10")];e._descriptionFactory[ti("0x3")](ti("0x12"),(t=>kr(n,ti("0xf"),t))),t.conversion[ti("0x13")](ti("0x7"))[ti("0x0")]({model:ti("0x12"),view:(t,{writer:e,options:n})=>{if(!n.showSuggestionHighlights)return;const o=e[ti("0x4")](ti("0xb")),r=e.createEmptyElement("hr");return e[ti("0x1")](ti("0x9"),o),e[ti("0x11")](e[ti("0xd")](o,0),r),o},converterPriority:"high"})}}const ni=["commandName","HtmlEmbed","*Change %0 content*","registerDescriptionCallback","markBlockFormat","format","rawHtml","cancel","document","ELEMENT_HTML_EMBED","value","htmlEmbed","enableCommand","getCustomProperty","element","rawHtmlApi","getSelectedElement","get","locale","has","model","_descriptionFactory","editor","TrackChangesEditing","selection","plugins","view","registerElementLabel"];var oi,ri;oi=ni,ri=397,function(t){for(;--t;)oi.push(oi.shift())}(++ri);const si=function(t,e){return ni[t-=0]};class ii extends t.Plugin{afterInit(){const t=this[si("0x11")];if(!t[si("0x14")][si("0xe")](si("0x18")))return;const e=t.plugins.get(si("0x12")),n=t[si("0xd")],o=t.editing[si("0x15")].document.selection;e[si("0x10")][si("0x16")](si("0x1"),(t=>kr(n,si("0x4"),t))),t[si("0x14")][si("0xc")](si("0x12"))[si("0x7")]("htmlEmbed",((n,r)=>{const s=t[si("0xf")],i=s[si("0x3")][si("0x13")];s.change((()=>{const t=function(t){const e=t[si("0xb")]();return e&&e.is(si("0x9"),si("0x1"))?t[si("0xb")]():null}(i);if(!t)return void n(null);const s=t.getAttribute(si("0x5"))||"";void 0!==r&&r!==s&&(e[si("0x1b")](t,{commandName:si("0x6"),commandParams:[r]}),o[si("0xb")]()[si("0x8")](si("0xa"))[si("0x2")]())}))})),e[si("0x10")][si("0x1a")]((t=>{const{data:e}=t;if(e&&si("0x6")==e[si("0x17")]){const t=kr(n,"ELEMENT_HTML_EMBED");return{type:si("0x0"),content:kr(n,si("0x19"),t)}}}))}}const ai=["registerCustomCallback","getNearestSelectionRange","getContainedElement","width","plugins","hasAttribute","resizeImage","join","toPrevious","ImageCaptionUtils","imageTypeInline","formatBlock","enableCommand","getAttribute","subType","discardSuggestion","newRange","locale","removeObject","shouldConvertImageType","getFirstRange","start","getChangedMarkers","imageBlock","end","imageTextAlternative","accept","change","ImageStyleEditing","previous","getCaptionFromImageModelElement","schema","filter","*Set image text alternative:* %0","registerDescriptionCallback","nodeAfter","createRangeOn","imageStyle","formatInline","registerElementLabel","imageCaption","author","getSuggestions","isCollapsed","ELEMENT_IMAGE","toLowerCase","Block image to inline image","caption","*Set image width:* %0","fromPosition","*Remove image text alternative*","ImageTextAlternativeEditing","normalizedStyles","getSuggestion","format","refresh","name","forEach","toggleImageCaption","imageStylePostApply","imageStylePreApply","_descriptionFactory","forward","commandReversedParams","*Format:* %0","commands","isBlockImage","title","imageTypeBlock","chain","insertion","side","value","markBlockFormat","find","_splitMarkerName","ELEMENT_INLINE_IMAGE","isIntersecting","getClosestSelectedImageElement","detach","Inline image to block image","uploadImage","getSuggestionCallback","discard","get","findIndex","isInlineImage","length","isBefore","next","afterInit","selection","FORMAT_SIDE_IMAGE","newValue","hasSuggestion","document","isInContent","has","ImageUtils","nodeBefore","head","isEqual","toNext","markInlineFormat","from","deletion","editor","ImageBlockEditing","ImageInlineEditing","type","_findSuggestions","model","element","commandParams","createRange","commandName","convertBlockImageToInline","_suggestionFactory","convertInlineImageToBlock"];var xi,ci;xi=ai,ci=445,function(t){for(;--t;)xi.push(xi.shift())}(++ci);const li=function(t,e){return ai[t-=0]};class ui extends t.Plugin{[li("0x2")](){const t=this[li("0x12")];if(!t[li("0x23")][li("0x9")]("ImageEditing"))return;const n=t[li("0x23")].get("TrackChangesEditing"),o=t[li("0x23")][li("0x73")](li("0xa")),r={},s=t[li("0x30")];if(n[li("0x2b")]("insertImage"),n[li("0x5c")][li("0x46")](li("0x36"),(t=>kr(s,li("0x4b"),t))),n[li("0x5c")][li("0x46")]("imageInline",(t=>kr(s,li("0x6b"),t))),n[li("0x5c")].registerElementLabel("caption",kr(s,"ELEMENT_CAPTION")),t[li("0x23")].has("ImageUploadEditing")&&n[li("0x2b")](li("0x70")),t[li("0x23")][li("0x9")](li("0x13"))&&t[li("0x23")][li("0x9")](li("0x14"))&&(n[li("0x2b")](li("0x29"),((e,r)=>{const s=o[li("0x6d")](t[li("0x17")][li("0x7")][li("0x3")]);t.model[li("0x3a")]((()=>{n[li("0x68")](s,{commandName:li("0x29"),commandParams:[r]},[],li("0x1c"))}))})),n[li("0x2b")]("imageTypeBlock",((e,r)=>{t[li("0x17")][li("0x3a")]((s=>{let i=o.getClosestSelectedImageElement(t[li("0x17")].document[li("0x3")]),a=s[li("0x43")](i);const x=F.LivePosition[li("0x50")](a.start,li("0x27")),c=F.LivePosition[li("0x50")](a[li("0x37")],li("0xe"));n.forceDefaultExecution((()=>e(r))),i=o[li("0x6d")](t.model[li("0x7")][li("0x3")]),a=s[li("0x43")](i);const l=s.createRange(x,c);x.detach(),c[li("0x6e")](),n[li("0x68")](i,{commandName:li("0x29")},[],li("0x1e")),l.start[li("0x0")](a[li("0x34")])&&n.markInsertion(s[li("0x1a")](l.start,a.start),"convertInlineImageToBlock"),a[li("0x37")][li("0x0")](l[li("0x37")])&&n.markInsertion(s[li("0x1a")](a.end,l[li("0x37")]),li("0x1e"))}))})),n._suggestionFactory[li("0x1f")](li("0x2a"),li("0x1e"),li("0x26"),(()=>{})),n[li("0x1d")][li("0x1f")](li("0x2a"),li("0x1e"),li("0x39"),(()=>{})),n[li("0x1d")][li("0x1f")](li("0x2a"),li("0x1e"),li("0x72"),n._suggestionFactory.getSuggestionCallback(li("0x2a"),"",li("0x39"))),n._suggestionFactory[li("0x1f")]("insertion",li("0x1e"),li("0x26"),(()=>{})),n[li("0x1d")].registerCustomCallback(li("0x65"),"convertInlineImageToBlock",li("0x72"),(([e])=>{const o=n[li("0x1d")][li("0x71")](li("0x65"),"",li("0x72"));let r=e[li("0x34")],s=e[li("0x37")];const i=t[li("0x17")][li("0x3e")][li("0x20")](r,"backward"),a=t[li("0x17")][li("0x3e")][li("0x20")](s,li("0x5d"));i[li("0x4a")]&&(r=i[li("0x34")]),a[li("0x4a")]&&(s=a[li("0x37")]),o([t[li("0x17")].createRange(r,s)])})),n[li("0x1d")].registerCustomCallback(li("0x2a"),li("0x1e"),li("0x64"),x),n._suggestionFactory.registerCustomCallback(li("0x65"),li("0x1e"),li("0x64"),x)),t.plugins.has("ImageCaptionEditing")&&(n[li("0x2b")](li("0x59"),((e,r)=>{const s=t[li("0x23")].get(li("0x28"));let i=o[li("0x6d")](t.model[li("0x7")][li("0x3")]),a=s[li("0x3d")](i);t.model[li("0x3a")]((()=>{if(a)return void n.markDeletion(t[li("0x17")][li("0x43")](a));const x=o[li("0x61")](i);e(r),i=o[li("0x6d")](t[li("0x17")].document.selection),a=s.getCaptionFromImageModelElement(i),n.markInsertion(t[li("0x17")].createRangeOn(a),x?null:li("0x47"))}))})),n[li("0x1d")][li("0x1f")]("insertion",li("0x47"),"chain",x)),t.plugins[li("0x9")]("ImageStyleEditing")){n.enableCommand(li("0x44"),((r,s)=>{const i=t[li("0x23")][li("0x73")]("Users").me,a=t[li("0x60")][li("0x73")](li("0x44"));let x=o.getClosestSelectedImageElement(t[li("0x17")].document.selection),c=t.model[li("0x43")](x),l=a.value;if(l==s.value)return;const u={commandName:"imageStyle",commandParams:[s],formatGroupId:(0,e.uid)()};t[li("0x17")][li("0x3a")]((()=>{if(n[li("0x49")]()[li("0x3f")]((t=>t[li("0x8")]&&i==t[li("0x48")]&&("formatBlock"==t[li("0x15")]||li("0x45")==t[li("0x15")])&&("imageStylePreApply"==t[li("0x2d")]||"imageStylePostApply"==t[li("0x2d")])&&t[li("0x33")]()[li("0xd")](c)))[li("0x58")]((t=>n[li("0x2e")](t[li("0xc")]))),x=o[li("0x6d")](t[li("0x17")][li("0x7")][li("0x3")]),c=t[li("0x17")].createRangeOn(x),a[li("0x56")](),t[li("0x60")][li("0x73")](li("0x29"))[li("0x56")](),t.commands[li("0x73")](li("0x63"))[li("0x56")](),l=a[li("0x67")],l!=s[li("0x67")])return o[li("0x75")](x)&&a[li("0x32")](s[li("0x67")],x)?(r(s),x=o[li("0x6d")](t[li("0x17")][li("0x7")][li("0x3")]),void n[li("0x68")](x,{...u,commandReversedParams:[{value:l||null}]},[],li("0x5b"))):void(o[li("0x61")](x)?n[li("0x68")](x,u,[],li("0x5a")):n[li("0xf")](c,u,"imageStylePostApply"))}))}));for(const e of t[li("0x23")].get(li("0x3b"))[li("0x53")])r[e[li("0x57")]]=e[li("0x62")][li("0x4c")]();n[li("0x1d")].registerCustomCallback(li("0x2a"),"imageStylePreApply",li("0x26"),(()=>{})),n._suggestionFactory[li("0x1f")]("formatBlock","imageStylePostApply",li("0x26"),(()=>{})),n[li("0x1d")][li("0x1f")](li("0x45"),li("0x5a"),li("0x26"),(()=>{})),n[li("0x1d")][li("0x1f")]("formatBlock",li("0x5b"),li("0x39"),(()=>{})),n[li("0x1d")].registerCustomCallback(li("0x2a"),li("0x5b"),li("0x72"),((t,e)=>{n[li("0x1d")][li("0x71")](li("0x2a"),"",li("0x39"))(t,{commandName:e.commandName,commandParams:e[li("0x5e")]})})),n[li("0x1d")][li("0x1f")](li("0x2a"),li("0x5b"),li("0x64"),x)}const i=[{type:li("0x2a"),subType:"imageStylePreApply"},{type:li("0x65"),subType:"imageCaption"},{type:li("0x2a"),subType:li("0x1e")},{type:"insertion",subType:li("0x1e")}];function a(t,e){const r=i.findIndex((({type:e,subType:n})=>t[li("0x15")]==e&&t[li("0x2d")]==n)),s=i[li("0x74")]((({type:t,subType:n})=>e.type==t&&e[li("0x2d")]==n));if(r<0||s<0)return!1;const a=t[li("0x33")](),x=e[li("0x33")]();if((0==r||1==r)&&2==s&&a[li("0x6c")](x))return!0;if(2==r&&3==s){const t=n[li("0x16")](a,li("0x65"))[li("0x3f")]((({suggestion:t,meta:e})=>e.isOwn&&"convertInlineImageToBlock"==t[li("0x2d")]));if(t[li("0x76")]>1&&x.end[li("0xd")](a.start))return!0;if(1==t[li("0x76")]&&(a[li("0x34")][li("0xd")](x[li("0x37")])||a[li("0x37")][li("0xd")](x[li("0x34")])))return!0}if(3==r&&3==s&&a[li("0x34")][li("0x0")](x.start)){const t=a[li("0x37")][li("0x42")],e=x.start[li("0xb")];return o[li("0x61")](t)&&t===e}return!1}function x(t,e){return a(t,e)?[t,e]:a(e,t)?[e,t]:null}t[li("0x17")][li("0x7")].registerPostFixer((()=>{let e=!1;const r=Array[li("0x10")](t[li("0x17")][li("0x7")].differ[li("0x35")]());for(const{name:t,data:s}of r){const{group:r,type:i,subType:a,id:x}=n[li("0x6a")](t);if("suggestion"==r&&n[li("0x6")](x)){if(li("0x2a")==i&&(li("0x5b")==a||li("0x5a")==a)){const t=n[li("0x54")](x);if(s[li("0x2f")]){const r=t.getFirstRange()[li("0x21")]();if(o[li("0x61")](r))continue;n[li("0x2e")](t),e=!0}}if(li("0x65")==i&&li("0x47")==a&&!s[li("0x2f")]){const t=n[li("0x54")](x);t[li("0x1")]&&t[li("0x1")][li("0x8")]&&(n[li("0x2e")](t[li("0x1")]),e=!0)}}}return e})),t[li("0x23")][li("0x9")]("ImageResize")&&n.enableCommand(li("0x25"),((e,r)=>{const s=o.getClosestSelectedImageElement(t[li("0x17")].document[li("0x3")]);s[li("0x2c")](li("0x22"))!=r.width&&t.model.change((()=>{n[li("0x68")](s,{commandName:li("0x25"),commandParams:[r]})}))})),t[li("0x23")][li("0x9")](li("0x52"))&&n[li("0x2b")](li("0x38"),((e,r)=>{const s=o.getClosestSelectedImageElement(t.model[li("0x7")].selection);(s[li("0x24")]("alt")?s[li("0x2c")]("alt"):"")!=r[li("0x5")]&&t[li("0x17")][li("0x3a")]((()=>{n[li("0x68")](s,{commandName:li("0x38"),commandParams:[r]})}))})),n[li("0x5c")][li("0x41")]((t=>{if(i[li("0x69")]((({type:e,subType:n})=>t[li("0x15")]==e&&t.subType==n)))return t[li("0x3c")]?{}:void 0})),n._descriptionFactory[li("0x41")]((t=>{if(li("0x65")==t.type||li("0x11")==t.type){const e=t.getContainedElement();if(e&&e.is(li("0x18"),li("0x4e")))return{type:li("0x65")==t.type?"addObject":li("0x31"),name:e.name,quantity:1}}})),n[li("0x5c")][li("0x41")]((t=>li("0x2a")==t[li("0x15")]&&li("0x1e")==t[li("0x2d")]?{type:li("0x55"),content:li("0x6f")}:li("0x2a")==t[li("0x15")]&&li("0x1c")==t[li("0x2d")]?{type:li("0x55"),content:li("0x4d")}:void 0)),n[li("0x5c")][li("0x41")]((t=>{const{data:e}=t;if(e){if(li("0x44")==e[li("0x1b")]){const t=e[li("0x19")][0][li("0x67")];return n=li("0x66")===t?kr(s,li("0x4")):r[t]||t,{type:"format",content:kr(s,li("0x5f"),n)}}if(li("0x38")==e.commandName){const t=e[li("0x19")][0][li("0x5")];return t?{type:"format",content:kr(s,li("0x40"),'"'+t+'"')}:{type:li("0x55"),content:kr(s,li("0x51"))}}if(li("0x25")==e.commandName){const t=e[li("0x19")][0].width;return t?{type:li("0x55"),content:kr(s,li("0x4f"),t)}:{type:"format",content:kr(s,"*Reset image width*")}}}var n}))}}const di=["getSelectedBlocks","outdent","IndentBlock","getItems","model","has","filter","name","format","checkAttribute","getItemLabel","indentBlock","from","editor","enableCommand","change","locale","commandName","plugins","document","_descriptionFactory","registerDescriptionCallback","indent","blockIndent","afterInit","outdentBlock"];var gi,fi;gi=di,fi=142,function(t){for(;--t;)gi.push(gi.shift())}(++fi);const mi=function(t,e){return di[t-=0]};class hi extends t.Plugin{[mi("0xc")](){const t=this[mi("0x1")],e=t[mi("0x6")].get("TrackChangesEditing");t[mi("0x6")].has("IndentEditing")&&(e[mi("0x2")](mi("0xa")),e[mi("0x2")](mi("0xf")));const n=t[mi("0x4")];if(t[mi("0x6")][mi("0x13")](mi("0x10"))){for(const n of[mi("0x19"),mi("0xd")])e[mi("0x2")](n,(()=>{const o=Array[mi("0x0")](this[mi("0x1")][mi("0x12")][mi("0x7")].selection[mi("0xe")]())[mi("0x14")]((t=>this[mi("0x1")][mi("0x12")].schema[mi("0x17")](t,mi("0xb"))));t[mi("0x12")][mi("0x3")]((()=>{for(const t of o)e.markBlockFormat(t,{commandName:n,commandParams:[{value:""}],formatGroupId:mi("0x19")})}))}));e[mi("0x8")][mi("0x9")]((t=>{const{data:o}=t;if(!o)return;if(mi("0x19")!=o[mi("0x5")]&&mi("0xd")!=o[mi("0x5")])return;const r=t[mi("0x11")]()[0],s=e._descriptionFactory[mi("0x18")](r[mi("0x15")]);return mi("0x19")==o.commandName?{type:mi("0x16"),content:kr(n,"*Indent:* %0",s)}:mi("0xd")==o[mi("0x5")]?{type:"format",content:kr(n,"*Outdent:* %0",s)}:void 0}))}}}var pi,bi,Ei=["get","input","editor","init","enableCommand","requires"];pi=Ei,bi=371,function(t){for(;--t;)pi.push(pi.shift())}(++bi);var _i=function(t,e){return Ei[t-=0]};class yi extends t.Plugin{static get[_i("0x0")](){return[Ts.Input]}[_i("0x4")](){this[_i("0x3")].plugins[_i("0x1")]("TrackChangesEditing")[_i("0x5")](_i("0x2"))}}const Ti=["from","get","markInlineFormat","change","format","afterInit","getFirstRange","unlink","enableCommand","selection","hasAttribute","commandParams","getRanges","*Set link:* %0","registerDescriptionCallback","TrackChangesEditing","commandName","_descriptionFactory","isCollapsed","model","link","editor","locale","getAttribute","getFirstPosition","linkHref","has","document"];var Ci,ki;Ci=Ti,ki=311,function(t){for(;--t;)Ci.push(Ci.shift())}(++ki);const vi=function(t,e){return Ti[t-=0]};class Ai extends t.Plugin{[vi("0x2")](){const t=this[vi("0x12")];if(!t.plugins[vi("0x17")]("LinkEditing"))return;const e=t.plugins[vi("0x1a")](vi("0xc"));e.enableCommand("link",((n,o)=>{const r=t[vi("0x10")][vi("0x18")][vi("0x6")];let s=[];if(r[vi("0xf")]){if(!r[vi("0x7")]("linkHref"))return void n(o);{const e=(0,Ts.findAttributeRange)(r[vi("0x15")](),vi("0x16"),r[vi("0x14")]("linkHref"),t.model);s=[e]}}else s=Array[vi("0x19")](r[vi("0x9")]());t.model[vi("0x0")]((()=>{for(const t of s)e[vi("0x1b")](t,{commandName:vi("0x11"),commandParams:[o]})}))})),e[vi("0x5")](vi("0x4"),(()=>{const n=this[vi("0x12")][vi("0x10")],o=n[vi("0x18")][vi("0x6")];n[vi("0x0")]((()=>{let n=[];n=o[vi("0xf")]?[(0,Ts.findAttributeRange)(o[vi("0x15")](),vi("0x16"),o.getAttribute("linkHref"),t[vi("0x10")])]:Br(vi("0x16"),o[vi("0x3")](),t[vi("0x10")]);for(const t of n)e[vi("0x1b")](t,{commandName:vi("0x4"),commandParams:[]})}))})),e[vi("0xe")][vi("0xb")]((e=>{const{data:n}=e,o=t[vi("0x13")];if(n){if("link"==n[vi("0xd")]){const t=n[vi("0x8")][0];return{type:vi("0x1"),content:kr(o,vi("0xa"),'"'+t+'"')}}return vi("0x4")==n[vi("0xd")]?{type:vi("0x1"),content:kr(o,"*Remove link*")}:void 0}}))}}const Ri=["editor","model","previousSibling","bulletedList","has","afterInit","getAttribute","markBlockFormat","forceValue","nextSibling","filter","numbered","checkTodoList","commands","document","add","blockName","numberedList","*Uncheck item*","List","createRange","todoList","plugins","change","registerDescriptionCallback","isObject","get","value","length","createPositionAt","bulleted","end","TrackChangesEditing","paragraph","ELEMENT_NUMBERED_LIST","checkChild","listItem","before","_selectedElements","slice","enableCommand","getSelectedBlocks","name","*Change to:* %0","_descriptionFactory","from","schema","indentList","TodoListEditing","commandParams","*Check item*","element","todoListChecked","ELEMENT_LIST_ITEM","*Indent:* %0","listIndent","push","format","commandName","*Outdent:* %0","ListEditing","outdentList"];var Si,Ii;Si=Ri,Ii=464,function(t){for(;--t;)Si.push(Si.shift())}(++Ii);const wi=function(t,e){return Ri[t-=0]};class Mi extends t.Plugin{[wi("0x25")](){const t=this[wi("0x20")],e=t.locale;if(!t.plugins[wi("0x24")](wi("0x1e")))return;const n=t.plugins.get(wi("0x2")),o=t[wi("0x36")][wi("0x24")](wi("0x12"));function r(e){return()=>{const o=t[wi("0x21")].document.selection,r=t[wi("0x2d")][wi("0x3a")](e);if(r[wi("0x3b")])return void t.execute(wi("0x3"),{});const s=e.slice(0,-4),i=function(t,e,n){let o=Array[wi("0xf")](t).filter((t=>{return e=t,(o=n)[wi("0x5")](e.parent,"listItem")&&!o[wi("0x39")](e);var e,o}));o=o[wi("0x2a")]((t=>!t.is(wi("0x15"),wi("0x6"))||t[wi("0x26")]("listType")!=e));const r=new Set;for(const t of o)t.is("element",wi("0x6"))?r.add(Ni(t)):r[wi("0x2f")](t);return Array[wi("0xf")](r)}(o[wi("0xb")](),s,t.model[wi("0x10")]);t[wi("0x21")][wi("0x37")]((()=>{for(const t of i)n[wi("0x27")](t,{commandName:e,commandParams:[{forceValue:!r[wi("0x3b")]}],formatGroupId:wi("0x30")},Li(t))}))}}function s(e){return()=>{const o=function(t){const e=(t=Array.from(t)).findIndex((t=>wi("0x6")!=t.name));return e>-1&&(t=t[wi("0x9")](0,e)),t}(t[wi("0x21")][wi("0x2e")].selection[wi("0xb")]()),r=t[wi("0x21")][wi("0x34")](t[wi("0x21")][wi("0x3d")](o[0],wi("0x7")),t.model[wi("0x3d")](o[o[wi("0x3c")]-1],wi("0x1")));t[wi("0x21")].change((()=>{n[wi("0x27")](r,{commandName:e,commandParams:[],formatGroupId:wi("0x19")},function(t){const e=new Set;for(const n of t){let t=n[wi("0x29")];for(;t&&t[wi("0x26")](wi("0x19"))>n[wi("0x26")](wi("0x19"));)e[wi("0x2f")](t),t=t[wi("0x29")]}return Array.from(e)}(o))}))}}n[wi("0xa")](wi("0x31"),r(wi("0x31"))),n[wi("0xa")](wi("0x23"),r(wi("0x23"))),o&&n[wi("0xa")](wi("0x35"),r("todoList")),n.enableCommand(wi("0x11"),s(wi("0x11"))),n[wi("0xa")](wi("0x1f"),s(wi("0x1f"))),o&&n.enableCommand("checkTodoList",(()=>{const e=t.commands[wi("0x3a")]("checkTodoList"),o=Array[wi("0xf")](e[wi("0x8")]);o.filter((t=>t[wi("0x26")](wi("0x16"))!=e[wi("0x3b")])),t.model.change((()=>{for(const t of o)n[wi("0x27")](t,{commandName:wi("0x2c"),commandParams:[{forceValue:!e[wi("0x3b")]}]})}))})),n[wi("0xe")].registerElementLabel("listItem",(t=>kr(e,wi("0x17"),t))),n[wi("0xe")][wi("0x38")]((t=>{const{data:n}=t;if(n){if(wi("0x31")==n[wi("0x1c")]||"bulletedList"==n[wi("0x1c")]||wi("0x35")==n[wi("0x1c")])switch(n[wi("0x1c")].replace(wi("0x33"),"")){case wi("0x0"):return o(kr(e,"ELEMENT_BULLETED_LIST"));case wi("0x2b"):return o(kr(e,wi("0x4")));case"todo":return o(kr(e,"ELEMENT_TODO_LIST"))}if("indentList"==n[wi("0x1c")])return{type:wi("0x1b"),content:kr(e,wi("0x18"),kr(e,"ELEMENT_LIST_ITEM"))};if(wi("0x1f")==n[wi("0x1c")])return{type:wi("0x1b"),content:kr(e,wi("0x1d"),kr(e,"ELEMENT_LIST_ITEM"))};if("checkTodoList"==n[wi("0x1c")])return n[wi("0x13")][0][wi("0x28")]?{type:wi("0x1b"),content:kr(e,wi("0x14"))}:{type:"format",content:kr(e,wi("0x32"))}}function o(t){return{type:wi("0x1b"),content:kr(e,wi("0xd"),t)}}}))}}function Ni(t){const e=t[wi("0x26")](wi("0x19"));if(0==e)return t;let n=t;for(;t[wi("0x22")]&&t[wi("0x22")].is(wi("0x15"),wi("0x6"));){const o=t.previousSibling[wi("0x26")](wi("0x19"));if(o==e)n=t.previousSibling;else if(o<e)break;t=t[wi("0x22")]}return n}function Li(t){const e=[];if(t.is(wi("0x15"),wi("0x6"))&&t[wi("0x26")](wi("0x19"))>0){let n=t[wi("0x29")];for(;n&&wi("0x6")==n[wi("0xc")]&&n[wi("0x26")](wi("0x19"))==t[wi("0x26")](wi("0x19"));)e[wi("0x1a")](n),n=n[wi("0x29")]}return e}const Oi=["attribute:url:media","get","elementToElement","high","afterInit","enableCommand","conversion","dataDowncast","MediaEmbedEditing","locale","div","data","plugins","options","stop","createEmptyElement","has","editor","for","showSuggestionHighlights","media","_descriptionFactory","downcastDispatcher","TrackChangesEditing"];var Fi,Pi;Fi=Oi,Pi=470,function(t){for(;--t;)Fi.push(Fi.shift())}(++Pi);const Di=function(t,e){return Oi[t-=0]};class ji extends t.Plugin{[Di("0xe")](){const t=this[Di("0x3")];if(!t[Di("0x16")][Di("0x2")](Di("0x12")))return;const e=t.plugins[Di("0xb")](Di("0x9")),n=t[Di("0x13")];e[Di("0xf")]("mediaEmbed"),e[Di("0x7")].registerElementLabel(Di("0x6"),(t=>kr(n,"ELEMENT_MEDIA",t))),t[Di("0x10")][Di("0x4")](Di("0x11"))[Di("0xc")]({model:Di("0x6"),view:(t,{writer:e,options:n})=>{if(n[Di("0x5")])return e[Di("0x1")](Di("0x14"))},converterPriority:Di("0xd")}),t[Di("0x15")][Di("0x8")].on(Di("0xa"),((t,e,n)=>{n[Di("0x17")][Di("0x5")]&&t[Di("0x0")]()}),{priority:"high"})}}const Bi=["mention","plugins","enableCommand","TrackChangesEditing","editor","afterInit"];var Ui,Hi;Ui=Bi,Hi=375,function(t){for(;--t;)Ui.push(Ui.shift())}(++Hi);const Gi=function(t,e){return Bi[t-=0]};class Vi extends t.Plugin{[Gi("0x2")](){const t=this[Gi("0x1")];t[Gi("0x4")].has("MentionEditing")&&t[Gi("0x4")].get(Gi("0x0"))[Gi("0x5")](Gi("0x3"))}}const zi=["locale","PageBreakEditing","get","enableCommand","editor","has","pageBreak","_descriptionFactory","TrackChangesEditing","registerElementLabel","ELEMENT_PAGE_BREAK","plugins"];var Wi,Ki;Wi=zi,Ki=453,function(t){for(;--t;)Wi.push(Wi.shift())}(++Ki);const $i=function(t,e){return zi[t-=0]};class qi extends t.Plugin{afterInit(){const t=this[$i("0x7")];if(!t.plugins[$i("0x8")]($i("0x4")))return;t[$i("0x2")][$i("0x5")]("TrackChangesEditing")[$i("0x6")]($i("0x9"));const e=t[$i("0x2")][$i("0x5")]($i("0xb")),n=t[$i("0x3")];e[$i("0xa")][$i("0x0")]("pageBreak",(t=>kr(n,$i("0x1"),t)))}}const Xi=["toViewPosition","showSuggestionHighlights","ELEMENT_PARAGRAPH","afterInit","document","options","model","writer","registerElementLabel","TrackChangesEditing","isObject","end","locale","editing","editor","isBlock","nodeAfter","getItemLabel","mapper","parent","filter","span","registerDescriptionCallback","_descriptionFactory","has","paragraph","from","data","*Change to:* %0","ck-suggestion-marker--active","*Insert:* %0","addMarker:suggestion:insertion","blockName","selection","name","consumable","commandName","bindElementToMarker","change","markerRange","consume","$text","markerName","type","includes","markBlockFormat","checkChild","plugins","insertion","schema","isLimit","get"];var Ji,Qi;Ji=Xi,Qi=408,function(t){for(;--t;)Ji.push(Ji.shift())}(++Qi);const Yi=function(t,e){return Xi[t-=0]};class Zi extends t.Plugin{[Yi("0xb")](){const t=this[Yi("0x16")];if(!t[Yi("0x3")][Yi("0x20")]("Paragraph"))return;const e=t[Yi("0x14")],n=t[Yi("0x3")][Yi("0x7")](Yi("0x11"));n[Yi("0x1f")][Yi("0x10")](Yi("0x21"),(t=>kr(e,"ELEMENT_PARAGRAPH",t))),n.enableCommand(Yi("0x21"),((e,o={})=>{const r=t[Yi("0xe")][Yi("0xc")],s=o[Yi("0x29")]||r[Yi("0x29")],i=Array[Yi("0x22")](s.getSelectedBlocks())[Yi("0x1c")]((t=>{return e=t,(n=this[Yi("0x16")].model[Yi("0x5")])[Yi("0x2")](e[Yi("0x1b")],"paragraph")&&!n[Yi("0x12")](e)&&Yi("0x21")!=e[Yi("0x2a")];var e,n}));t[Yi("0xe")][Yi("0x2e")]((()=>{for(const t of i)n[Yi("0x1")](t,{commandName:Yi("0x21"),commandParams:[],formatGroupId:Yi("0x28")},Ur(t))}))})),n._descriptionFactory[Yi("0x1e")]((t=>{const{data:n}=t;if(n&&Yi("0x21")==n[Yi("0x2c")])return{type:"format",content:kr(e,Yi("0x24"),kr(e,Yi("0xa")))}})),n.enableCommand("insertParagraph"),t[Yi("0x15")].downcastDispatcher.on(Yi("0x27"),ta(t),{priority:"highest"}),t[Yi("0x23")].downcastDispatcher.on(Yi("0x27"),((e,n,o)=>{o[Yi("0xd")][Yi("0x9")]&&ta(t,{showActiveMarker:!1})(e,n,o)}),{priority:"highest"});const o=n[Yi("0x1f")];o.registerDescriptionCallback((n=>{if(Yi("0x4")!==n[Yi("0x33")])return;const{start:r,end:s}=n.getFirstRange();if(!r.isTouching(s)||!r[Yi("0x18")])return;const i=t[Yi("0xe")].schema,a=r[Yi("0x18")];return i[Yi("0x17")](a)&&!i.isLimit(a)&&i[Yi("0x2")](a,Yi("0x31"))?{type:"insertion",content:kr(e,Yi("0x26"),o[Yi("0x19")](a[Yi("0x2a")],1))}:void 0}))}}function ta(t,{showActiveMarker:e=!0}={}){return(n,o,r)=>{const s=t[Yi("0x3")].get(Yi("0x11")),i=o[Yi("0x2f")].start,a=o[Yi("0x2f")][Yi("0x13")],x=t.model[Yi("0x5")];if(!i.isTouching(a)||!i[Yi("0x18")])return;const c=i[Yi("0x18")];if(x[Yi("0x17")](c)&&!x[Yi("0x6")](c)&&x[Yi("0x2")](c,Yi("0x31"))){if(!r[Yi("0x2b")][Yi("0x30")](o[Yi("0x2f")],n[Yi("0x2a")]))return;const t=r[Yi("0xf")].createUIElement(Yi("0x1d"),{class:"ck-suggestion-marker-split"}),i=r[Yi("0x1a")][Yi("0x8")](a);e&&s.activeMarkers[Yi("0x0")](o[Yi("0x32")])&&r.writer.addClass(Yi("0x25"),t),r[Yi("0xf")].insert(i,t),r.mapper[Yi("0x2d")](t,o[Yi("0x32")])}}}const ea=["locale","change","model","plugins","isCollapsed","commandName","*Remove all formatting*","_descriptionFactory","createRangeOn","from","TrackChangesEditing","registerDescriptionCallback","document","getRanges","getAttributes","removeFormat","isFormatting","getItems","get","markInlineFormat","schema","getAttributeProperties","afterInit"];var na,oa;na=ea,oa=275,function(t){for(;--t;)na.push(na.shift())}(++oa);const ra=function(t,e){return ea[t-=0]};class sa extends t.Plugin{[ra("0x0")](){const t=this.editor;if(!t[ra("0x4")].has("RemoveFormatEditing"))return;const e=t[ra("0x4")][ra("0x13")](ra("0xb"));e.enableCommand(ra("0x10"),(n=>{const o=t[ra("0x3")][ra("0xd")].selection;o[ra("0x5")]?n():t[ra("0x3")][ra("0x2")]((()=>{const n=Array[ra("0xa")](o[ra("0xe")]());for(const o of n)for(const n of o[ra("0x12")]())ia(n,t[ra("0x3")][ra("0x15")])&&e[ra("0x14")](t[ra("0x3")][ra("0x9")](n),{commandName:ra("0x10"),commandParams:[]})}))})),e[ra("0x8")][ra("0xc")]((e=>{const{data:n}=e;if(n&&"removeFormat"==n[ra("0x6")])return{type:"format",content:kr(t[ra("0x1")],ra("0x7"))}}))}}function ia(t,e){for(const[n]of t[ra("0xf")]()){const t=e[ra("0x16")](n);if(t&&t[ra("0x11")])return!0}return!1}const aa=["acceptSelectedSuggestions","RestrictedEditingModeEditing","trackChanges","editor","TrackChangesEditing","plugins","discardSuggestion","discardSelectedSuggestions","discardAllSuggestions","enableCommand","goToPreviousRestrictedEditingException","afterInit","acceptAllSuggestions","has","goToNextRestrictedEditingException"];var xa,ca;xa=aa,ca=141,function(t){for(;--t;)xa.push(xa.shift())}(++ca);const la=function(t,e){return aa[t-=0]};class ua extends t.Plugin{[la("0x5")](){const t=this[la("0xc")];if(!t[la("0xe")][la("0x7")](la("0xa")))return;const e=t[la("0xe")].get(la("0xd"));e.enableCommand(la("0x4")),e[la("0x3")](la("0x8"));const n=t[la("0xe")].get(la("0xa"));n[la("0x3")](la("0xb")),n[la("0x3")]("acceptSuggestion"),n[la("0x3")](la("0x0")),n[la("0x3")](la("0x6")),n[la("0x3")](la("0x2")),n[la("0x3")](la("0x9")),n[la("0x3")](la("0x1"))}}const da=["element","markerName","addMarker:suggestion:deletion","softBreak","getItems","showSuggestionHighlights","editing","insert","split","addMarker:suggestion:insertion","editor","addClass","test","options","ck-suggestion-marker--active","consumable","init","_descriptionFactory","mapper","name","addMarker:suggestion","locale","ELEMENT_LINE_BREAK","model","get","markerRange","TrackChangesEditing","plugins","registerElementLabel","activeMarkers","deletion","createPositionBefore","writer","merge","downcastDispatcher","bindElementToMarker","high","span"];var ga,fa;ga=da,fa=338,function(t){for(;--t;)ga.push(ga.shift())}(++fa);const ma=function(t,e){return da[t-=0]};class ha extends t.Plugin{static get requires(){return[Ss.ShiftEnter]}[ma("0x14")](){const t=this[ma("0xe")],e=t[ma("0x1f")][ma("0x1c")](ma("0x1e"));e.enableCommand("shiftEnter"),t.editing[ma("0x0")].on(ma("0xd"),pa(t),{priority:ma("0x2")}),t[ma("0xa")][ma("0x0")].on(ma("0x6"),pa(t),{priority:ma("0x2")}),t.data[ma("0x0")].on(ma("0x18"),((e,n,o)=>{o[ma("0x11")][ma("0x9")]&&pa(t,{showActiveMarker:!1})(e,n,o)})),e[ma("0x15")][ma("0x20")](ma("0x7"),(e=>kr(t[ma("0x19")],ma("0x1a"),e)))}}function pa(t,{showActiveMarker:e=!0}={}){return(n,o,r)=>{const s=t.plugins[ma("0x1c")](ma("0x1e"));if(!r[ma("0x13")][ma("0x10")](o[ma("0x1d")],n[ma("0x17")]))return;const i=t[ma("0x1b")];for(const t of o.markerRange[ma("0x8")]()){if(!t.is(ma("0x4"),ma("0x7")))continue;const n=ma("0x22")==o[ma("0x5")][ma("0xc")](":")[1]?ma("0x25"):ma("0xc"),a=r[ma("0x24")].createUIElement(ma("0x3"),{class:"ck-suggestion-marker-"+n}),x=r[ma("0x16")].toViewPosition(i[ma("0x23")](t));e&&s[ma("0x21")].includes(o.markerName)&&r[ma("0x24")][ma("0xf")](ma("0x12"),a),r.writer[ma("0xb")](x,a),r[ma("0x16")][ma("0x1")](a,o[ma("0x5")])}}}const ba=["value","has","document","restrictedEditingException","FORMAT_RESTRICTED_ENABLED","getRanges","editor","FORMAT_RESTRICTED_DISABLED","locale","forceValue","selection","format","plugins","model","registerDescriptionCallback","enableCommand","_descriptionFactory","markInlineFormat","get","afterInit"];var Ea,_a;Ea=ba,_a=492,function(t){for(;--t;)Ea.push(Ea.shift())}(++_a);const ya=function(t,e){return ba[t-=0]};class Ta extends t.Plugin{[ya("0x7")](){const t=this[ya("0xe")],e=t[ya("0x1")],n=t[ya("0x10")];if(!t[ya("0x0")][ya("0x9")]("StandardEditingModeEditing"))return;const o=t[ya("0x0")][ya("0x6")]("TrackChangesEditing"),r=ya("0xb"),s=t.commands.get(r);o[ya("0x3")](r,((t,n={})=>{const i=e[ya("0xa")][ya("0x12")];if(i.isCollapsed)return void t(n);const a=void 0!==n[ya("0x11")]?n[ya("0x11")]:!s[ya("0x8")];e.change((()=>{const t=Array.from(i[ya("0xd")]());for(const n of t){const t=a?[n]:Br(r,n,e);for(const e of t)o[ya("0x5")](e,{commandName:r,commandParams:[{forceValue:a}]})}}))})),o[ya("0x4")][ya("0x2")]((t=>{const{data:e}=t;if(e&&e.commandName==r)return e.commandParams[0][ya("0x11")]?{type:"format",content:kr(n,ya("0xc"))}:{type:ya("0x13"),content:kr(n,ya("0xf"))}}))}}const Ca=["showSuggestionHighlights","table","left","getRanges","getSuggestion","insertTableColumnLeft","accept","textProxy","createTableWalker","has","enqueueChange","colspan","getChanges","_getCoordsForCells","TrackChangesEditing","isArray","plugins","minColumn","rootName","filter","position","_setupColumnsRowsFixing","join","refresh","length","_getSuggestionCoords","getAttribute","toLowerCase","tableCell","writer","getColumnIndexes","maxRow","item","low","start","isTouching","tablePaste","TableUtils","element","markMultiRangeInsertion","_descriptionFactory","batch","selectTableColumn","map","getChangedMarkers","createRangeOn","insert","_suggestionFactory","addRange","values","execute","getItems","createRangeIn","name","tableColumn","removeTableColumn","end","tableRow","discard","findAncestor","deletion","MAX_SAFE_INTEGER","ELEMENT_TABLE","change","ELEMENT_TABLE_COLUMN","insertion","_tableSuggestions","detach","ELEMENT_TABLE_WITH_TEXT","getRowIndexes","hasAttribute","min","isEqual","MIN_SAFE_INTEGER","removeTableRow","commands","isIntersectingWithRange","$graveyard","locale","data","cell","rowspan","getFirstRange","max","afterInit","*Insert:* %0","suggestion","from","*Remove:* %0","ELEMENT_TABLE_ROW_WITH_TEXT","highest","setSelection","above","model","_tablePostFixingSubtypes","fromRange","root","nodeBefore","getCellLocation","get","getSelectionAffectedTableCells","enableCommand","mapper","registerPostFixer","registerDescriptionCallback","markMultiRangeDeletion","removeClass","nodeAfter","insertTableColumnRight","last","downcastDispatcher","substr","forceValue","ELEMENT_TABLE_ROW","getChildren","differ","subType","span","options","editor","includes","registerCustomCallback","order","document","createPositionAt","type","toViewElement","first","addClass","selectTableRow"];var ka,va;ka=Ca,va=309,function(t){for(;--t;)ka.push(ka.shift())}(++va);const Aa=function(t,e){return Ca[t-=0]};class Ra extends t.Plugin{constructor(t){super(t),this._tablePostFixingSubtypes=[Aa("0x8"),Aa("0x5")]}[Aa("0x23")](){const t=this[Aa("0x46")],e=t[Aa("0x2c")][Aa("0x4a")].selection;if(!t.plugins[Aa("0x5a")]("TableEditing"))return;const n=t[Aa("0x1d")],o=t.plugins[Aa("0x32")](Aa("0x5f")),r=t[Aa("0x61")][Aa("0x32")](Aa("0x76"));o[Aa("0x79")].registerElementLabel(Aa("0x52"),(t=>kr(n,Aa("0xd"),t))),this[Aa("0x66")](),o[Aa("0x34")]("insertTable"),o[Aa("0x34")](Aa("0x50")),o[Aa("0x34")](Aa("0x7b"));for(const n of["insertTableRowAbove","insertTableRowBelow"]){const s=t[Aa("0x1a")][Aa("0x32")](n);o[Aa("0x34")](n,(n=>{t[Aa("0x2c")][Aa("0xe")]((t=>{n();const i=Aa("0x2b")===s[Aa("0x49")],a=r[Aa("0x33")](e),x=r[Aa("0x14")](a),c=i?x[Aa("0x4e")]-1:x[Aa("0x3c")]+1,l=a[0][Aa("0xa")](Aa("0x52")),u=r[Aa("0x59")](l,{startRow:c,endRow:c}),d=Array[Aa("0x26")](u).map((e=>t[Aa("0x7e")](e.cell)));o[Aa("0x78")](d,Aa("0x8"))}))}))}for(const n of[Aa("0x56"),Aa("0x3b")]){const s=t[Aa("0x1a")][Aa("0x32")](n);o[Aa("0x34")](n,(n=>{t.model[Aa("0xe")]((t=>{n();const i=Aa("0x53")===s.order,a=r.getSelectionAffectedTableCells(e),x=r[Aa("0x6f")](a),c=i?x.first-1:x[Aa("0x3c")]+1,l=a[0].findAncestor("table"),u=r.createTableWalker(l,{startRow:0,column:c,includeAllSlots:!1}),d=Array[Aa("0x26")](u)[Aa("0x7c")]((e=>t[Aa("0x7e")](e[Aa("0x1f")])));o[Aa("0x78")](d,"tableColumn")}))}))}for(const n of["removeTableRow",Aa("0x6")]){const s=n[Aa("0x3e")](11),i=s[Aa("0x6c")](),a=i[Aa("0x3e")](0,3)+"span",x="table"+s,c="min"+s,l=Aa("0x22")+s;o[Aa("0x34")](n,(()=>{t[Aa("0x2c")][Aa("0xe")]((t=>{const s=r.getSelectionAffectedTableCells(e),u=s[0][Aa("0xa")](Aa("0x52"));let d;if(Aa("0x19")==n){const t=r[Aa("0x14")](s);d={startRow:t.first,endRow:t[Aa("0x3c")],includeAllSlots:!0}}else{const t=r[Aa("0x6f")](s);d={startColumn:t[Aa("0x4e")],endColumn:t[Aa("0x3c")],includeAllSlots:!0}}const g=r.createTableWalker(u,d),f=Array[Aa("0x26")](g)[Aa("0x7c")]((({cell:t})=>t)),m=Sa(f[Aa("0x64")]((t=>t.hasAttribute(a)))),h=Sa(f[Aa("0x64")]((t=>!t[Aa("0x15")](a))))[Aa("0x7c")]((e=>t[Aa("0x7e")](e))),p=o[Aa("0x38")](h,x);if(p&&(Aa("0x8")==p.subType||"tableColumn"==p[Aa("0x43")])){const e=this[Aa("0x6a")](p);for(const n of m){const o=t[Aa("0x7e")](n),s=r[Aa("0x31")](n),x=n[Aa("0x6b")](a)-1,u=e[c],d=e[l];u<=s[i]&&s[i]+x<=d&&p[Aa("0x81")](o)}}}))}))}function s(n){const o=Array.from(e[Aa("0x54")]())[Aa("0x7c")]((t=>F.LiveRange[Aa("0x2e")](t)));t.model[Aa("0xe")]((e=>{const r=e[Aa("0x7a")];n=n[Aa("0x64")]((t=>"$graveyard"!=t[Aa("0x2f")][Aa("0x63")])),e[Aa("0x2a")](n),t.commands[Aa("0x32")](Aa("0x19"))[Aa("0x68")](),t[Aa("0x1")]("removeTableRow",{forceDefaultExecution:!0}),t[Aa("0x2c")][Aa("0x5b")]((()=>{t[Aa("0x2c")][Aa("0x5b")](r,(t=>{const e=o.filter((t=>Aa("0x1c")!=t[Aa("0x2f")][Aa("0x63")]));e[Aa("0x69")]>0&&t[Aa("0x2a")](e);for(const t of o)t[Aa("0x12")]()}))}))}))}function i(n){t[Aa("0x2c")][Aa("0xe")]((o=>{const r=Array[Aa("0x26")](e[Aa("0x54")]())[Aa("0x7c")]((t=>F.LiveRange.fromRange(t))),s=[];for(const t of n)for(const e of t[Aa("0x2")]({shallow:!0}))s.push(e);for(const e of s)Aa("0x1c")!=e[Aa("0x2f")][Aa("0x63")]&&(o[Aa("0x2a")](o[Aa("0x4b")](e,0)),t[Aa("0x1a")][Aa("0x32")](Aa("0x6"))[Aa("0x68")](),t.execute(Aa("0x6"),{forceDefaultExecution:!0}));const i=r.filter((t=>Aa("0x1c")!=t[Aa("0x2f")].rootName));i[Aa("0x69")]>0&&o[Aa("0x2a")](i);for(const t of r)t[Aa("0x12")]()}))}function a(t,e){return e.every((e=>t.some((t=>t[Aa("0x7")][Aa("0x17")](e[Aa("0x73")])||e[Aa("0x7")].isEqual(t.start)))))}function x(t,e){return t.some((t=>e.some((e=>t.end[Aa("0x74")](e[Aa("0x73")])))))}t.data[Aa("0x3d")].on("addMarker:suggestion",((t,e,n)=>{if(!n[Aa("0x45")][Aa("0x51")])return;const o=e[Aa("0x71")];if(!o)return;const r=n[Aa("0x35")][Aa("0x4d")](o);function s(t){return Array[Aa("0x60")](t)?t:[t]}r&&Aa("0x6d")===o.name&&(0,P.setHighlightHandling)(r,n[Aa("0x6e")],((t,e,n)=>n[Aa("0x4f")](s(e.classes),t)),((t,e,n)=>n[Aa("0x39")](s(e.classes),t)))}),{priority:Aa("0x29")}),o._descriptionFactory[Aa("0x37")]((t=>{if(Aa("0x10")!=t[Aa("0x4c")]&&Aa("0xb")!=t[Aa("0x4c")])return;const e=t.getContainedElement();if(null!=e&&e.is(Aa("0x77"),Aa("0x52"))){if("insertion"==t[Aa("0x4c")]){const e=t[Aa("0x2")]()[Aa("0x64")]((t=>t.is(Aa("0x58")))).map((t=>t[Aa("0x1e")]));if(e[Aa("0x69")])return{type:Aa("0x10"),content:kr(n,"*Insert:* %0",kr(n,Aa("0x13"),'"'+e.join(" ")+'"'))}}if(Aa("0xb")==t[Aa("0x4c")]){const e=t[Aa("0x2")]().filter((t=>t.is(Aa("0x58"))))[Aa("0x7c")]((t=>t[Aa("0x1e")]));if(e.length)return{type:"deletion",content:kr(n,Aa("0x27"),kr(n,Aa("0x13"),'"'+e[Aa("0x67")](" ")+'"'))}}}})),o[Aa("0x79")].registerDescriptionCallback((t=>{if(Aa("0x8")==t.subType){const e=t[Aa("0x2")]().filter((t=>t.is("textProxy")))[Aa("0x7c")]((t=>t[Aa("0x1e")])),o=this._getSuggestionCoords(t),r=o[Aa("0x70")]-o.minRow+1;if("insertion"==t[Aa("0x4c")])return e[Aa("0x69")]?{type:"insertion",content:kr(n,"*Insert:* %0",kr(n,Aa("0x28"),[r,'"'+e[Aa("0x67")](" ")+'"']))}:{type:Aa("0x10"),content:kr(n,Aa("0x24"),kr(n,Aa("0x40"),r))};if(Aa("0xb")==t[Aa("0x4c")])return e.length?{type:"deletion",content:kr(n,Aa("0x27"),kr(n,Aa("0x28"),[r,'"'+e[Aa("0x67")](" ")+'"']))}:{type:Aa("0xb"),content:kr(n,Aa("0x27"),kr(n,Aa("0x40"),r))}}if(Aa("0x5")==t[Aa("0x43")]){const e=t[Aa("0x2")]()[Aa("0x64")]((t=>t.is(Aa("0x58"))))[Aa("0x7c")]((t=>t[Aa("0x1e")])),o=this[Aa("0x6a")](t),r=o.maxColumn-o[Aa("0x62")]+1;if(Aa("0x10")==t[Aa("0x4c")])return e[Aa("0x69")]?{type:"insertion",content:kr(n,"*Insert:* %0",kr(n,"ELEMENT_TABLE_COLUMN_WITH_TEXT",[r,'"'+e.join(" ")+'"']))}:{type:Aa("0x10"),content:kr(n,Aa("0x24"),kr(n,Aa("0xf"),r))};if("deletion"==t.type)return e[Aa("0x69")]?{type:Aa("0xb"),content:kr(n,Aa("0x27"),kr(n,"ELEMENT_TABLE_COLUMN_WITH_TEXT",[r,'"'+e.join(" ")+'"']))}:{type:"deletion",content:kr(n,Aa("0x27"),kr(n,Aa("0xf"),r))}}})),o[Aa("0x80")][Aa("0x48")](Aa("0x10"),Aa("0x8"),Aa("0x9"),s),o[Aa("0x80")].registerCustomCallback(Aa("0xb"),"tableRow",Aa("0x57"),s),o[Aa("0x80")][Aa("0x48")](Aa("0x10"),"tableColumn",Aa("0x9"),i),o[Aa("0x80")][Aa("0x48")]("deletion",Aa("0x5"),Aa("0x57"),i),o[Aa("0x80")][Aa("0x48")](Aa("0x10"),Aa("0x5"),Aa("0x67"),a),o[Aa("0x80")][Aa("0x48")]("deletion",Aa("0x5"),"join",a),o[Aa("0x80")][Aa("0x48")](Aa("0x10"),Aa("0x8"),"join",x),o[Aa("0x80")].registerCustomCallback(Aa("0xb"),Aa("0x8"),Aa("0x67"),x)}_acceptFormatSuggestionCallbackFactory(){const t=this[Aa("0x46")],e=t.model.document.selection;return(n,o)=>{t[Aa("0x2c")][Aa("0xe")]((r=>{const{commandName:s,commandParams:i}=o;let a=n[0][Aa("0x7")][Aa("0x30")];i&&i[0]&&!1===i[0][Aa("0x3f")]&&(a=n[0].start[Aa("0x3a")]);const x=r[Aa("0x3")](a);if("$graveyard"==x[Aa("0x2f")][Aa("0x63")])return;const c=Array.from(e.getRanges())[Aa("0x7c")]((t=>F.LiveRange[Aa("0x2e")](t)));r.setSelection(x),t.commands[Aa("0x32")](s)[Aa("0x68")](),i.push({forceDefaultExecution:!0}),t[Aa("0x1")](s,...i);const l=c[Aa("0x64")]((t=>"$graveyard"!=t[Aa("0x2f")][Aa("0x63")]));l.length>0&&r.setSelection(l);for(const t of c)t.detach()}))}}[Aa("0x5e")](t){const e=this.editor.plugins[Aa("0x32")]("TableUtils");let n=Number[Aa("0xc")],o=Number[Aa("0x18")],r=Number[Aa("0xc")],s=Number[Aa("0x18")];for(const i of t){if("$graveyard"==i[Aa("0x2f")][Aa("0x63")])continue;const{row:t,column:a}=e[Aa("0x31")](i),x=i.hasAttribute(Aa("0x20"))?i[Aa("0x6b")](Aa("0x20"))-1:0,c=i[Aa("0x15")](Aa("0x5c"))?i[Aa("0x6b")](Aa("0x5c"))-1:0;n=t<n?t:n,o=t+x>o?t+x:o,r=a<r?a:r,s=a+c>s?a+c:s}return{minRow:n,maxRow:o,minColumn:r,maxColumn:s}}[Aa("0x66")](){const t=this[Aa("0x46")],e=t[Aa("0x61")][Aa("0x32")](Aa("0x5f")),n=t[Aa("0x61")][Aa("0x32")](Aa("0x76"));this[Aa("0x11")]=new Set,t[Aa("0x2c")][Aa("0x4a")].on("change:data",(()=>{const n=Array[Aa("0x26")](t[Aa("0x2c")][Aa("0x4a")][Aa("0x42")][Aa("0x7d")]());for(const{name:t,data:o}of n){const{group:n,id:r,subType:s}=e._splitMarkerName(t);if(Aa("0x25")!=n)continue;if(null!=o.oldRange)continue;const i=e[Aa("0x55")](r);this[Aa("0x2d")][Aa("0x47")](s)&&this[Aa("0x11")].add(i)}}),{priority:Aa("0x72")});const o=(t,e)=>{let o=!1;const r=e[Aa("0x7e")](t),s=t[Aa("0xa")](Aa("0x52")),i=n[Aa("0x31")](t);for(const e of this[Aa("0x11")]){const n=e[Aa("0x43")],a=n.startsWith(Aa("0x75")),x=n.substr(a?10:5),c=x[Aa("0x6c")](),l=c.substr(0,3)+Aa("0x44"),u=Aa("0x16")+x,d=Aa("0x22")+x;if(!e.isInContent)continue;if(s!=e[Aa("0x21")]()[Aa("0x73")].findAncestor(Aa("0x52")))continue;if(e[Aa("0x1b")](r))continue;const g=t.hasAttribute(l)?t[Aa("0x6b")](l)-1:0,f=this[Aa("0x6a")](e),m=f[u],h=f[d];m<=i[c]&&i[c]+g<=h&&(e[Aa("0x81")](r),o=!0)}return o};t[Aa("0x2c")][Aa("0x4a")][Aa("0x36")]((e=>{let n=!1;for(const r of t[Aa("0x2c")].document.differ[Aa("0x5d")]())if(Aa("0x7f")==r.type)if(Aa("0x8")==r[Aa("0x4")])for(const t of r[Aa("0x65")][Aa("0x3a")][Aa("0x41")]())n=n||o(t,e);else Aa("0x6d")==r[Aa("0x4")]&&(n=n||o(r.position[Aa("0x3a")],e));return n}))}[Aa("0x6a")](t){return this[Aa("0x5e")](t.getRanges()[Aa("0x7c")]((t=>t[Aa("0x73")][Aa("0x3a")])))}}function Sa(t){return Array[Aa("0x26")](new Set(t)[Aa("0x0")]())}const Ia=["registerDescriptionCallback","markMultiRangeBlockFormat","subType","mergeTableCellDown","$graveyard","change","markBlockFormat","from","accept","TableEditing","*Split cell:* vertically","isInContent","enableCommand","length","commands","value","document","createRangeOn","map","_suggestionFactory","trackChanges","size","containsRange","_areMergableCells","getAncestors","execute","splitTableCellVertically","*Merge cells*","selection","push","fromRange","return","element","findAncestor","forceDefaultExecution","splitTableCellHorizontally","createTableWalker","_tablePostFixingSubtypes","stop","mergeTableCellLeft","model","refresh","plugins","isEnabled","mergeTableCellUp","rootName","mergeTableCells","registerCustomCallback","editor","tableCell","insertion","format","highest","TableUtils","mergeTableCellRight","cell","has","_areSelectedCellsMergable","type","low","commandName","getFirstPosition","author","get","add","_descriptionFactory","locale","TrackChangesEditing","setSelection","getSelectionAffectedTableCells","detach","formatBlock","find","getRanges"];var wa,Ma;wa=Ia,Ma=239,function(t){for(;--t;)wa.push(wa.shift())}(++Ma);const Na=function(t,e){return Ia[t-=0]};class La extends t.Plugin{static get requires(){return[Ra]}afterInit(){const t=this[Na("0x1f")],e=t[Na("0x17")].document[Na("0xb")],n=t[Na("0x31")];if(!t.plugins[Na("0x27")](Na("0x42")))return;const o=t[Na("0x19")].get(Na("0x32")),r=t[Na("0x19")][Na("0x2e")](Na("0x24")),s=t[Na("0x19")].get(Ra);s[Na("0x14")][Na("0xc")](Na("0x1d")),o[Na("0x45")](Na("0x1d"),(()=>{const e=r[Na("0x34")](t[Na("0x17")][Na("0x49")].selection);t.model.change((()=>{o[Na("0x3a")](e,{commandName:"mergeTableCells",commandParams:[]},[],Na("0x1d"))}))})),t.commands[Na("0x2e")]("mergeTableCells").on(Na("0x8"),((e,n)=>{t[Na("0x47")].get(Na("0x3")).value&&(n[Na("0x46")]>0&&n[n.length-1]&&n[n[Na("0x46")]-1][Na("0x11")]||o._isForcedDefaultExecutionBlock||this[Na("0x28")]()||e[Na("0x15")]())}),{priority:Na("0x23")});for(const e of[Na("0x1b"),Na("0x25"),Na("0x3c"),Na("0x16")]){const n=t.commands.get(e);o[Na("0x45")](e,(()=>{const e=t[Na("0x17")][Na("0x49")][Na("0xb")][Na("0x2c")]().getAncestors()[Na("0x37")]((t=>t.is(Na("0xf"),Na("0x20")))),r=n.value;t.model[Na("0x3e")]((()=>{o[Na("0x3a")]([e,r],{commandName:Na("0x1d"),commandParams:[]},[],"mergeTableCells")}))}))}for(const e of[Na("0x9"),Na("0x12")]){const n=t[Na("0x47")][Na("0x2e")](e);o[Na("0x45")](e,(()=>{const s=r[Na("0x34")](t[Na("0x17")][Na("0x49")][Na("0xb")])[0],i=s[Na("0x10")]("table"),{column:a,row:x}=r.getCellLocation(s);let c=[];if("horizontally"==n.direction){const t=r.createTableWalker(i,{startRow:x,endRow:x,includeAllSlots:!0});c=Array[Na("0x40")](t)[Na("0x1")]((t=>t[Na("0x26")]))}else{const t=r[Na("0x13")](i,{column:a,includeAllSlots:!0});c=Array[Na("0x40")](t).map((t=>t[Na("0x26")]))}t[Na("0x17")][Na("0x3e")]((t=>{o[Na("0x3f")](t[Na("0x0")](s),{commandName:e,commandParams:[]},c,e)}))}))}o[Na("0x30")][Na("0x39")]((t=>{const{data:e}=t;if(e)return Na("0x1d")==e[Na("0x2b")]?{type:Na("0x22"),content:kr(n,Na("0xa"))}:void 0})),o[Na("0x30")][Na("0x39")]((t=>{const{data:e}=t;if(e)return"splitTableCellVertically"==e[Na("0x2b")]?{type:Na("0x22"),content:kr(n,Na("0x43"))}:Na("0x12")==e[Na("0x2b")]?{type:"format",content:kr(n,"*Split cell:* horizontally")}:void 0}));const i=s._acceptFormatSuggestionCallbackFactory();for(const t of[Na("0x1b"),Na("0x25"),Na("0x3c"),"mergeTableCellLeft"])o._suggestionFactory[Na("0x1e")](Na("0x36"),t,"accept",i);for(const t of[Na("0x9"),"splitTableCellHorizontally"])o[Na("0x2")][Na("0x1e")](Na("0x36"),t,Na("0x41"),i);o[Na("0x2")][Na("0x1e")](Na("0x36"),Na("0x1d"),Na("0x41"),(n=>{t.model[Na("0x3e")]((o=>{const r=Array[Na("0x40")](e[Na("0x38")]())[Na("0x1")]((t=>F.LiveRange[Na("0xd")](t)));o[Na("0x33")](n),t[Na("0x47")][Na("0x2e")](Na("0x1d"))[Na("0x18")](),t[Na("0x8")](Na("0x1d"),{forceDefaultExecution:!0});const s=r.filter((t=>Na("0x3d")!=t.root[Na("0x1c")]));s[Na("0x46")]>0&&o.setSelection(s);for(const t of r)t[Na("0x35")]()}))}));for(const e of[Na("0x1b"),"mergeTableCellDown",Na("0x16"),Na("0x25")]){const n=t[Na("0x47")][Na("0x2e")](e);n.on("set:isEnabled",((e,o,r)=>{if(r){const o=t[Na("0x17")][Na("0x49")][Na("0xb")][Na("0x2c")]()[Na("0x7")]().find((t=>t.is(Na("0xf"),Na("0x20"))));this._areMergableCells(n[Na("0x48")],o)||(e[Na("0xe")]=!1,e[Na("0x15")]())}}),{priority:Na("0x2a")})}}[Na("0x28")](){const t=this[Na("0x1f")][Na("0x47")][Na("0x2e")]("mergeTableCells"),e=this[Na("0x1f")].plugins[Na("0x2e")]("TableUtils");if(!t[Na("0x1a")])return!1;const n=e[Na("0x34")](this.editor[Na("0x17")][Na("0x49")][Na("0xb")]);for(const t of n)for(const e of n)if(t!=e&&!this[Na("0x6")](t,e))return!1;return!0}[Na("0x6")](t,e){const n=this[Na("0x1f")].plugins[Na("0x2e")](Na("0x32")),o=this[Na("0x1f")][Na("0x17")][Na("0x0")](t),r=this.editor[Na("0x17")][Na("0x0")](e),s=new Set,i=new Set;for(const t of n.getSuggestions())if((Na("0x21")==t[Na("0x29")]||"deletion"==t[Na("0x29")]||Na("0x1d")==t[Na("0x3b")])&&t[Na("0x44")])for(const e of t[Na("0x38")]())e[Na("0x5")](o,!0)&&s[Na("0x2f")](t[Na("0x29")]+":"+t[Na("0x2d")].id),e[Na("0x5")](r,!0)&&i[Na("0x2f")](t[Na("0x29")]+":"+t[Na("0x2d")].id);if(s[Na("0x4")]!=i[Na("0x4")])return!1;for(const t of s)if(!i[Na("0x27")](t))return!1;return!0}}const Oa=["start","forceValue","requires","commandParams","markerRange","change","addClass","value","data","highest","FORMAT_HEADER_COLUMN","item","selection","isBefore","document","stop","_splitMarkerName","options","name","registerDescriptionCallback","headingRows","formatBlock","FORMAT_HEADER_ROW","TableUtils","createRange","getChild","end","markerNameToElements","showSuggestionHighlights","last","locale","setTableRowHeader","unbindElementFromMarkerName","nodeAfter","toViewElement","first","downcastDispatcher","ck-suggestion-marker-","editing","createPositionBefore","commandName","_acceptFormatSuggestionCallbackFactory","_suggestionFactory","enableCommand","createTableWalker","markBlockFormat","mapper","FORMAT_REGULAR_ROW","*Format:* %0","TrackChangesEditing","setAttribute","cell","commands","has","markerName","createPositionAfter","writer","accept","findAncestor","headingColumns","parent","childCount","getSuggestion","ck-suggestion-marker--active","get","getCellLocation","setTableColumnHeader","model","registerCustomCallback","removeClass","getSelectionAffectedTableCells","consumable","bindElementToMarker","plugins","format"];var Fa,Pa;Fa=Oa,Pa=260,function(t){for(;--t;)Fa.push(Fa.shift())}(++Pa);const Da=function(t,e){return Oa[t-=0]};class ja extends t.Plugin{static get[Da("0x2a")](){return[Ra]}afterInit(){const t=this.editor;if(!t.plugins[Da("0x12")]("TableEditing"))return;const e=t[Da("0x46")],n=t[Da("0x26")][Da("0x1d")](Da("0xe")),o=t.plugins.get(Da("0x3f")),r=t.plugins.get(Ra);function s({showActiveMarker:t=!0,setDataAttribute:e=!0}={}){return(r,s,i)=>{const{type:a,id:x}=n[Da("0x38")](s[Da("0x13")]),c=n.getSuggestion(x);if(!c[Da("0x30")]||Da("0x1f")!=c[Da("0x30")][Da("0x5")])return;if(s[Da("0x33")])return void r[Da("0x37")]();if(!i[Da("0x24")].consume(s[Da("0x2c")],r[Da("0x3a")]))return;const l=s[Da("0x2c")][Da("0x28")][Da("0x49")],u=s[Da("0x2c")][Da("0x42")].nodeBefore,d=l[Da("0x19")].parent,{column:g}=o[Da("0x1e")](l),{column:f}=o[Da("0x1e")](u);for(let r=g;r<=f;r++){const c=o.createTableWalker(d,{column:r,includeAllSlots:!1});for(const o of c){const r=o[Da("0x10")],c=i.mapper[Da("0x4a")](r);i[Da("0x15")][Da("0x2e")](Da("0x2")+a,c),e&&i[Da("0x15")][Da("0xf")]("data-suggestion",x,c),i[Da("0xb")][Da("0x25")](c,s[Da("0x13")]),t&&(n.activeMarkers.includes(s.markerName)?i.writer[Da("0x2e")](Da("0x1c"),c):i[Da("0x15")][Da("0x22")]("ck-suggestion-marker--active",c))}}}}n[Da("0x8")]("setTableRowHeader",((e,r)=>{const s=o[Da("0x23")](t[Da("0x20")][Da("0x36")][Da("0x34")]),i=o.getRowIndexes(s),a=s[0][Da("0x17")]("table"),x=a.getAttribute(Da("0x3c"))||0,c=r&&null!==r.forceValue?r.forceValue:!t[Da("0x11")][Da("0x1d")](Da("0x47"))[Da("0x2f")],l=c?i[Da("0x45")]:i[Da("0x0")],u=a[Da("0x41")](l);let d;if(c){const e=a[Da("0x41")](x);if(u.index<e.index)return;d=t[Da("0x20")][Da("0x40")](t.model[Da("0x4")](e[Da("0x41")](0)),t[Da("0x20")][Da("0x14")](u[Da("0x41")](u[Da("0x1a")]-1)))}else{const e=a[Da("0x41")](x-1);if(!e)return;d=t.model[Da("0x40")](t[Da("0x20")][Da("0x4")](u.getChild(0)),t[Da("0x20")][Da("0x14")](e[Da("0x41")](e.childCount-1)))}t[Da("0x20")][Da("0x2d")]((()=>{n[Da("0xa")](d,{commandName:Da("0x47"),commandParams:[{forceValue:c}]},[],Da("0x47"))}))})),n[Da("0x8")](Da("0x1f"),((e,o)=>{const r=t[Da("0x26")][Da("0x1d")](Da("0x3f")),s=r.getSelectionAffectedTableCells(t[Da("0x20")][Da("0x36")][Da("0x34")]),i=r.getColumnIndexes(s),a=s[0].findAncestor("table"),x=a.getAttribute(Da("0x18"))||0,c=o&&null!==o.forceValue?o[Da("0x29")]:!t[Da("0x11")][Da("0x1d")]("setTableColumnHeader")[Da("0x2f")];let l;const u=a.getChild(0),d=c?i[Da("0x45")]:i[Da("0x0")],g=r[Da("0x9")](a,{startRow:0,column:d,includeAllSlots:!1}),f=Array.from(g)[0].cell;if(c){const e=u[Da("0x41")](x);if(f[Da("0x35")](e))return;l=t[Da("0x20")][Da("0x40")](t[Da("0x20")].createPositionBefore(e),t[Da("0x20")][Da("0x14")](f))}else{const e=u[Da("0x41")](x-1);if(!e)return;l=t[Da("0x20")][Da("0x40")](t.model.createPositionBefore(f),t[Da("0x20")].createPositionAfter(e))}t.model[Da("0x2d")]((()=>{n.markBlockFormat(l,{commandName:Da("0x1f"),commandParams:[{forceValue:c}]},[],"setTableColumnHeader")}))})),t[Da("0x3")][Da("0x1")].on("addMarker:suggestion",s(),{priority:Da("0x31")}),t.data[Da("0x1")].on("addMarker:suggestion",((t,e,n)=>{n[Da("0x39")][Da("0x44")]&&s({showActiveMarker:!1,setDataAttribute:!1})(t,e,n)}),{priority:Da("0x31")}),t[Da("0x3")][Da("0x1")].on("removeMarker:suggestion",((t,e,o)=>{const{type:r,id:s}=n[Da("0x38")](e[Da("0x13")]),i=n[Da("0x1b")](s);if(!i.data||"setTableColumnHeader"!=i[Da("0x30")][Da("0x5")])return;const a=o.mapper[Da("0x43")](e.markerName);if(a)for(const t of a)o[Da("0x15")][Da("0x22")]("ck-suggestion-marker-"+r,t),o[Da("0x15")][Da("0x22")](Da("0x1c"),t),o.writer.removeAttribute("data-suggestion",t),o[Da("0xb")][Da("0x48")](t,e[Da("0x13")])}),{priority:Da("0x31")}),n._descriptionFactory[Da("0x3b")]((t=>{const{data:n}=t;if(n){if(Da("0x47")==n[Da("0x5")]){const t=n.commandParams[0][Da("0x29")];return o(kr(e,Da(t?"0x3e":"0xc")))}if(Da("0x1f")==n[Da("0x5")]){const t=n[Da("0x2b")][0].forceValue;return o(kr(e,t?Da("0x32"):"FORMAT_REGULAR_COLUMN"))}}function o(t){return{type:Da("0x27"),content:kr(e,Da("0xd"),t)}}}));const i=r[Da("0x6")]();n[Da("0x7")][Da("0x21")](Da("0x3d"),Da("0x47"),"accept",i),n._suggestionFactory.registerCustomCallback("formatBlock",Da("0x1f"),Da("0x16"),i)}}const Ba=["tablePasteCell","containsRange","oldRange","table","remove","columnInsertionIndexes","showSuggestionHighlights","requires","editor","TableUtils","tableCellBorderStyle","batch","first","findAncestor","change","stop","tablePasteRow","tableCellPadding","differ","last","from","wrap","suggestionUnloaded","Users","createRange","root","editingDowncast","get","ck-suggestion-marker-insertion","plugins","add","has","tablePaste","setAttribute","createRangeIn","formatBlock","getMarkers","activeMarkers","insertionRanges","set","markers","_suggestionFactory","includes","column","rowInsertionIndexes","registerDescriptionCallback","cell","afterInit","listenTo","move","tableCellHorizontalAlignment","find","ck-suggestion-marker","content","_descriptionFactory","fromEntries","insertContent","fill","registerCustomCallback","tableCell","updateMarker","endRow","getChildren","getContainedElement","tableCellSuggestion","commands","TableClipboard","previous","newRange","cells","markMultiRangeDeletion","isInContent","elementToElement","_isForcedDefaultExecutionBlock","row","_splitMarkerName","getRanges","setAttributes","getSuggestions","getAllAdjacentSuggestions","options","insertRows","removeMarker","tableCellBorderWidth","rootName","removeMarkers","join","removeRows","accept","dataDowncast","tablePasteChainId","suggestion","element","map","createPositionBefore","startsWith","attributes","markerToHighlight","locale","deletion","*Replace table cells*","markerAttributes","isEqual","markMultiRangeInsertion","filter","insert","TrackChangesEditing","getRows","_getCoordsForCells","discard","length","tableCellBorderColor","selection","type","getRange","getChangedMarkers","createTableWalker","unwrap","low","deletionRanges","registerPostFixer","insertion","_createdBatches","conversion","markerName","nextSibling","subType","model","suggestion-td","columnInsertionRanges","createElement","hasSuggestion","push","end","tablePasteColumn","rows","getTableIfOnlyTableInContent","insertColumns","_replaceTableSlotCell","getColumns","paragraph","getChild","isEmpty","register","high","getShiftedBy","document","redo","getItems","view","markMultiRangeBlockFormat","next","$graveyard","getAttributes","position","createRangeOn","nodeAfter","name","getColumnIndexes"];var Ua,Ha;Ua=Ba,Ha=355,function(t){for(;--t;)Ua.push(Ua.shift())}(++Ha);const Ga=function(t,e){return Ba[t-=0]},Va=[Ga("0x2e"),Ga("0x4a"),Ga("0x84"),Ga("0xd"),"tableCellVerticalAlignment","tableCellBackgroundColor",Ga("0x8b")],za=Object[Ga("0x12")](Va[Ga("0x38")]((t=>[t,null])));class Wa extends t.Plugin{static get[Ga("0x81")](){return[Ra]}[Ga("0xa")](){const t=this[Ga("0x82")];if(!t[Ga("0x97")][Ga("0x99")](Ga("0x1d")))return;const n=t[Ga("0x97")][Ga("0x95")](Ga("0x45")),o=t[Ga("0x97")][Ga("0x95")](Ga("0x83")),r=t.plugins[Ga("0x95")](Ra),s=t.plugins[Ga("0x95")](Ga("0x1d"));r._tablePostFixingSubtypes[Ga("0x5f")](Ga("0x8a"),"tablePasteColumn"),t[Ga("0x5a")].schema[Ga("0x6a")](Ga("0x1b"),{allowIn:"tableCell",allowContentOf:Ga("0x16"),isLimit:!0}),t[Ga("0x56")][Ga("0x23")]({model:Ga("0x1b"),view:Ga("0x5b")});let i=null;t[Ga("0x5a")].on(Ga("0x13"),((r,a)=>{const[x,c]=a,l=a[a[Ga("0x49")]-1];l&&l.forceDefaultExecution||n[Ga("0x24")]||this[Ga("0x82")][Ga("0x1c")][Ga("0x95")]("trackChanges").value&&function(t,e,n,o,r){if(e&&!e.is("documentSelection"))return!1;const s=r[Ga("0x63")](t,n);if(!s||!$a(s,null,o))return!1;const i=o.getSelectionAffectedTableCells(n[Ga("0x6d")][Ga("0x4b")]);if(!i.length)return!1;const a=i[0][Ga("0x87")]("table"),x=o.getRowIndexes(i),c=o[Ga("0x79")](i),l={startRow:x[Ga("0x86")],endRow:x.last,startColumn:c[Ga("0x86")],endColumn:c[Ga("0x8d")]};return 1==i.length&&(l[Ga("0x18")]+=o[Ga("0x46")](s)-1,l.endColumn+=o[Ga("0x66")](s)-1),$a(a,l,o)}(x,c,t[Ga("0x5a")],o,s)&&(r[Ga("0x89")](),i={cells:[],insertionRanges:[],deletionRanges:[],rowInsertionRanges:[],rowInsertionIndexes:[],columnInsertionRanges:[],columnInsertionIndexes:[]},t[Ga("0x5a")].change((()=>{t[Ga("0x5a")].insertContent(a[0],a[1],a[2],a[3],{forceDefaultExecution:!0});const o=(0,e.uid)(),{rowInsertionRanges:r,columnInsertionRanges:s,insertionRanges:x,deletionRanges:c,cells:l}=i;r[Ga("0x49")]&&n.markMultiRangeInsertion(r,Ga("0x8a"),{tablePasteChainId:o}),s.length&&n[Ga("0x42")](s,"tablePasteColumn",{tablePasteChainId:o}),x[Ga("0x49")]&&n[Ga("0x42")](x,Ga("0x9a"),{tablePasteChainId:o,skipNestingCheck:!0}),c[Ga("0x49")]&&n[Ga("0x21")](c,Ga("0x9a"),{tablePasteChainId:o,skipNestingCheck:!0});const u=n[Ga("0x71")](l.map((({element:t})=>t)),{formatGroupId:(0,e.uid)()},[],Ga("0x7a"),{tablePasteChainId:o});if(u){const e=u[Ga("0x9e")](),n=[];for(const{element:o,attributes:r}of l){if(!r)continue;const s=t.model.createRangeOn(o),i=e[Ga("0xe")]((t=>t[Ga("0x4d")]()[Ga("0x41")](s)));i&&n[Ga("0x5f")]([i.name,r])}n[Ga("0x49")]&&u[Ga("0x9b")](Ga("0x40"),Object[Ga("0x12")](n))}i=null})))}),{priority:e.priorities[Ga("0x6b")]+10}),t[Ga("0x97")].get(Ga("0x1d")).on(Ga("0x65"),((t,e)=>{const[n,o,,r]=e;if(!i)return;t[Ga("0x89")]();const s=n[Ga("0x9")],a=o,x=Ka(s),c=Ka(a);t.return=s;let l=null,u=null;if(c||x)if(x&&!c){r.remove(s[Ga("0x68")](0));for(const t of Array[Ga("0x8e")](a[Ga("0x19")]()))r[Ga("0x44")](t,s,"end");const t=i[Ga("0x7")][Ga("0x5")](n[Ga("0x25")]),e=i[Ga("0x7f")][Ga("0x5")](n[Ga("0x6")]);t||e||(l=r[Ga("0x9c")](s))}else c&&!x&&(u=r[Ga("0x9c")](s));else{const t=r[Ga("0x5d")](Ga("0x1b")),e=r[Ga("0x5d")]("tableCellSuggestion");r[Ga("0x8f")](r.createRangeIn(s),e),r[Ga("0x44")](t,s,0);for(const e of Array[Ga("0x8e")](a[Ga("0x19")]()))r[Ga("0x44")](e,t,Ga("0x60"));l=r[Ga("0x76")](t),u=r[Ga("0x76")](e)}const d=Array[Ga("0x8e")](a[Ga("0x74")]()).filter((([t])=>Va[Ga("0x5")](t)));i[Ga("0x20")][Ga("0x5f")]({element:s,attributes:d.length?Object.fromEntries(d):null}),l&&i[Ga("0x1")][Ga("0x5f")](l),u&&i[Ga("0x52")].push(u)}),{priority:Ga("0x6b")}),o.on(Ga("0x64"),((e,n)=>{const[r,s={}]=n;if(!i)return;const a=s.at||0,x=s.columns||1;i[Ga("0x7f")]=new Array(x)[Ga("0x14")](a)[Ga("0x38")](((t,e)=>t+e));for(const{cell:e}of o[Ga("0x4f")](r,{startColumn:a,endColumn:a+x-1}))i[Ga("0x5c")][Ga("0x5f")](t[Ga("0x5a")].createRangeOn(e))}),{priority:Ga("0x51")}),o.on(Ga("0x2c"),((e,n)=>{const[r,s={}]=n;if(!i)return;const a=s.at||0,x=s[Ga("0x62")]||1;i[Ga("0x7")]=new Array(x)[Ga("0x14")](a)[Ga("0x38")](((t,e)=>t+e));for(const{cell:e}of o[Ga("0x4f")](r,{startRow:a,endRow:a+x-1}))i.rowInsertionRanges[Ga("0x5f")](t[Ga("0x5a")].createRangeOn(e))}),{priority:Ga("0x51")}),n[Ga("0x11")][Ga("0x8")]((e=>{if(e[Ga("0x59")]&&e[Ga("0x59")].startsWith(Ga("0x9a")))return e[Ga("0x1e")]?{}:{type:"insertion",content:kr(t[Ga("0x3d")],Ga("0x3f"))}}));const a=()=>{};for(const t of["tablePaste",Ga("0x61"),Ga("0x8a"),"tablePasteCell"])n._suggestionFactory[Ga("0x15")](Ga("0x54"),t,Ga("0x31"),a),n[Ga("0x4")][Ga("0x15")](Ga("0x3e"),t,Ga("0x31"),a);n[Ga("0x4")][Ga("0x15")](Ga("0x9d"),Ga("0x7a"),Ga("0x48"),a),n._suggestionFactory[Ga("0x15")](Ga("0x9d"),Ga("0x7a"),Ga("0x33"),((e,n,o)=>{const r=e[Ga("0x38")]((t=>t[Ga("0x1a")]())).filter((t=>t)),s=new Map(r.map((t=>[t,null])));if(i)for(const{element:t,attributes:e}of i[Ga("0x20")])e&&s[Ga("0x2")](t,e);else if(o&&o[Ga("0x40")])for(const[e,n]of Object.entries(o.markerAttributes)){const o=t[Ga("0x5a")][Ga("0x3")][Ga("0x95")](e),r=o?o[Ga("0x4d")]()[Ga("0x1a")]():null;r&&s[Ga("0x2")](r,n)}t[Ga("0x5a")][Ga("0x88")]((t=>{for(const[e,n]of s)t[Ga("0x28")]({...za,...n},e)}))}));const x=(e,o)=>{n[Ga("0x4")][Ga("0x15")](e,Ga("0x9a"),o,((r,s,i)=>{t.model[Ga("0x88")]((t=>{const a=[];for(const t of r){const e=t.start[Ga("0x77")];e.is("element",Ga("0x1b"))&&a.push(e)}n[Ga("0x4")].getSuggestionCallback(e,null,o)(r,s,i);for(const e of a)Ga("0x73")!=e[Ga("0x93")][Ga("0x2f")]&&t[Ga("0x50")](e)}))}))};x("insertion",Ga("0x33")),x(Ga("0x54"),"discard"),x("deletion",Ga("0x33")),x(Ga("0x3e"),Ga("0x48")),n._suggestionFactory[Ga("0x15")](Ga("0x54"),Ga("0x8a"),Ga("0x48"),(t=>{const e=t.map((t=>t.getContainedElement())),n=e[0].findAncestor(Ga("0x7d")),{minRow:s,maxRow:i}=r[Ga("0x47")](e);o[Ga("0x32")](n,{at:s,rows:i-s+1})})),n._suggestionFactory[Ga("0x15")](Ga("0x54"),"tablePasteColumn",Ga("0x48"),(t=>{const e=t[Ga("0x38")]((t=>t[Ga("0x1a")]())),n=e[0][Ga("0x87")](Ga("0x7d")),{minColumn:s,maxColumn:i}=r._getCoordsForCells(e);o.removeColumns(n,{at:s,columns:i-s+1})}));const c=(t,e)=>{if(!e[Ga("0x59")]||!e[Ga("0x59")][Ga("0x3a")](Ga("0x9a")))return;const o=e.attributes.tablePasteChainId,r=n.getSuggestions()[Ga("0x43")]((t=>t[Ga("0x22")]&&t[Ga("0x3b")]&&t.attributes.tablePasteChainId==o));r.length&&e[Ga("0x2a")]()[Ga("0x49")]!=r[Ga("0x49")]&&r.reduce(((t,e)=>(t[Ga("0x72")]=e,e[Ga("0x1e")]=t,e)))};function l(t,{showActiveMarker:e=!0}={}){const{id:o}=n[Ga("0x26")](t[Ga("0x57")]),r=[Ga("0xf"),Ga("0x96")],s=n[Ga("0x0")][Ga("0x5")](t[Ga("0x57")]);return s&&r.push("ck-suggestion-marker--active"),{classes:r,attributes:{"data-suggestion":o},priority:s&&e?3010:3e3}}n.on("suggestionLoaded",c,{priority:Ga("0x6b")}),n.on(Ga("0x90"),c,{priority:Ga("0x6b")}),t.model[Ga("0x6d")][Ga("0x53")]((()=>{let e=!1;const o=Array[Ga("0x8e")](t.model[Ga("0x6d")][Ga("0x8c")][Ga("0x4e")]());for(const{name:r,data:s}of o){const{group:o,type:i,id:a}=n[Ga("0x26")](r);if(Ga("0x36")!=o||"deletion"!=i||s[Ga("0x7c")])continue;if(!n[Ga("0x5e")](a))continue;const x=n.getSuggestion(a)[Ga("0x27")](),c=t[Ga("0x97")][Ga("0x95")](Ga("0x91")).me;for(const t of n.getSuggestions())if(t[Ga("0x22")]&&t.author==c&&Ga("0x9d")==t[Ga("0x4c")]&&Ga("0x7a")==t[Ga("0x59")]&&t[Ga("0x27")]().every((t=>x.some((e=>e[Ga("0x7b")](t,!0))))))for(const n of t.getAllAdjacentSuggestions())n[Ga("0x22")]&&(n[Ga("0x48")](),e=!0)}return e})),t[Ga("0x5a")][Ga("0x6d")].registerPostFixer((e=>{const o=t[Ga("0x1c")].get(Ga("0x6e"));if(!o||!o[Ga("0x55")][Ga("0x99")](e[Ga("0x85")]))return!1;let r=!1;const s=t[Ga("0x97")].get("Users").me,i=t[Ga("0x5a")].document[Ga("0x8c")].getChanges(),a=Array[Ga("0x8e")](t[Ga("0x5a")][Ga("0x6d")][Ga("0x8c")][Ga("0x4e")]())[Ga("0x43")]((({name:t,data:e})=>{const{group:o,subType:r,authorId:i}=n._splitMarkerName(t);return Ga("0x36")==o&&Ga("0x9a")==r&&i==s.id&&!e[Ga("0x7c")]}));for(const t of i){if(Ga("0x44")!=t[Ga("0x4c")]||Ga("0x1b")!=t[Ga("0x78")]||1!=t[Ga("0x49")])continue;const n=e[Ga("0x92")](t[Ga("0x75")],t.position[Ga("0x6c")](1));if(!a[Ga("0xe")]((({data:t})=>t[Ga("0x1f")][Ga("0x41")](n))))for(const{name:t,data:o}of a)if(n[Ga("0x7b")](o[Ga("0x1f")])){e[Ga("0x17")](t,{range:n}),r=!0;break}}return r})),t[Ga("0x5a")][Ga("0x6d")][Ga("0x53")]((e=>{let o=!1;const r=t[Ga("0x97")][Ga("0x95")]("Users").me,s=n[Ga("0x29")]()[Ga("0x43")]((t=>t.isInContent&&t.author==r)),i=new Set,a=new Set;for(const t of s)if(Ga("0x9a")==t[Ga("0x59")])for(const e of t[Ga("0x9e")]()){const n=e.getRange()[Ga("0x1a")]();if(n)if(n.is(Ga("0x37"),Ga("0x1b"))&&Ka(n)){t[Ga("0x2d")](e[Ga("0x78")]),i[Ga("0x98")](n),o=!0;const r=n[Ga("0x58")],s=n.previousSibling,x=r&&r.is("element",Ga("0x1b")),c=s&&s.is(Ga("0x37"),Ga("0x1b"));x&&!i[Ga("0x99")](r)&&a[Ga("0x98")](r),c&&!i[Ga("0x99")](s)&&a.add(s)}else n.is(Ga("0x37"),Ga("0x67"))&&n[Ga("0x69")]&&(t[Ga("0x2d")](e[Ga("0x78")]),o=!0)}else if(Ga("0x7a")==t.subType){if(!t[Ga("0x3b")]||!t.attributes[Ga("0x35")])continue;const e=t.attributes[Ga("0x40")];if(e&&Object.keys(e)[Ga("0x49")])continue;const n=t.attributes[Ga("0x35")];let r=!0,i=!0;for(const e of s)if(e[Ga("0x59")]&&e[Ga("0x59")][Ga("0x3a")](Ga("0x9a"))){if(!e[Ga("0x3b")][Ga("0x35")]){i=!1;break}if(e.id!=t.id&&e.attributes[Ga("0x35")]==n){r=!1;break}}i&&r&&(t[Ga("0x30")](),o=!0)}for(const t of i)e[Ga("0x7e")](t);for(const t of a)e[Ga("0x50")](t);return o})),t.conversion.for(Ga("0x94")).markerToHighlight({model:"suggestion:formatBlock:tablePasteCell",view:l,converterPriority:Ga("0x6b")}),t.conversion.for(Ga("0x34"))[Ga("0x3c")]({model:"suggestion:formatBlock:tablePasteCell",view:(t,e)=>{if(e[Ga("0x2b")][Ga("0x80")])return l(t,{showActiveMarker:!1})},converterPriority:Ga("0x6b")});const u=t.editing[Ga("0x70")];this[Ga("0xb")](u[Ga("0x6d")],"clipboardOutput",((t,e)=>{const n=[];for(const t of u[Ga("0x9c")](e[Ga("0x10")])[Ga("0x6f")]())t.is(Ga("0x37"),"suggestion-td")&&n.push(t);u[Ga("0x88")]((t=>{for(const e of n)t[Ga("0xc")](t[Ga("0x9c")](e),t[Ga("0x39")](e)),t[Ga("0x7e")](e)}))}))}}function Ka(t){if(t[Ga("0x69")])return!0;const e=t[Ga("0x68")](0);return e.is(Ga("0x37"),Ga("0x67"))&&e[Ga("0x69")]}function $a(t,e={},n){for(const{isAnchor:o,cellHeight:r,cellWidth:s}of n[Ga("0x4f")](t,{includeAllSlots:!0,...e}))if(!o||1!=r||1!=s)return!1;return!0}const qa=["createRange","ELEMENT_TITLE","editor","schema","nodeBefore","start","isCollapsed","TrackChangesEditing","title-content","model","plugins","Title","_descriptionFactory","registerPostFixer","getChangedMarkers","_splitMarkerName","updateMarker","forward","suggestion","document","element","from","end","newRange","has","afterInit","getNearestSelectionRange","isTouching"];var Xa,Ja;Xa=qa,Ja=219,function(t){for(;--t;)Xa.push(Xa.shift())}(++Ja);const Qa=function(t,e){return qa[t-=0]};class Ya extends t.Plugin{[Qa("0x2")](){const t=this[Qa("0x7")];if(!t[Qa("0xf")][Qa("0x1")](Qa("0x10")))return;const e=t[Qa("0xf")].get(Qa("0xc"));e[Qa("0x11")].registerElementLabel(Qa("0xd"),(()=>kr(t.locale,Qa("0x6")))),t[Qa("0xe")][Qa("0x18")][Qa("0x12")]((n=>{let o=!1;const r=Array[Qa("0x1a")](t[Qa("0xe")][Qa("0x18")].differ[Qa("0x13")]());for(const{name:s,data:i}of r){const{group:r}=e[Qa("0x14")](s);if(Qa("0x17")!==r||!i[Qa("0x0")])continue;const a=i[Qa("0x0")],x=a.end[Qa("0x9")];if(!x||!x.is(Qa("0x19"),Qa("0xd")))continue;if(!a[Qa("0xa")][Qa("0x4")](a[Qa("0x1b")]))continue;const c=t[Qa("0xe")][Qa("0x8")][Qa("0x3")](a[Qa("0x1b")],Qa("0x16"));if(c&&c[Qa("0xb")]){const t=n[Qa("0x5")](a[Qa("0xa")],c[Qa("0xa")]);t.isEqual(a)||(n[Qa("0x15")](s,{range:t}),o=!0)}o||(n.removeMarker(s),o=!0)}return o}))}}const Za=["editor","enableCommand","UndoEditing","afterInit","get","redo","plugins","has"];var tx,ex;tx=Za,ex=266,function(t){for(;--t;)tx.push(tx.shift())}(++ex);const nx=function(t,e){return Za[t-=0]};class ox extends t.Plugin{[nx("0x1")](){const t=this[nx("0x6")],e=t[nx("0x4")][nx("0x2")]("TrackChangesEditing");t[nx("0x4")][nx("0x5")](nx("0x0"))&&(e[nx("0x7")]("undo"),e[nx("0x7")](nx("0x3")))}}const rx=["keys","sign","string","charCodeAt","isArray","boolean"];var sx,ix;sx=rx,ix=350,function(t){for(;--t;)sx.push(sx.shift())}(++ix);const ax=function(t,e){return rx[t-=0]};function*xx(t){t?ax("0x3")==typeof t?yield 1:Array[ax("0x2")](t)?yield*function*(t){for(const e of t)yield*xx(e)}(t):"object"==typeof t?yield*cx(t):ax("0x0")==typeof t?yield*lx(t):"number"==typeof t&&(yield t):yield 0}function*cx(t){if(yield ux("{"),t){const e=Object[ax("0x4")](t).sort();for(const n of e){yield*lx(n),yield ux(":");const e=t[n];yield*xx(e)}}yield ux("}")}function*lx(t){yield ux('"');for(const e of t)yield ux(e);yield ux('"')}function ux(t){return t[ax("0x1")](0)}function dx(t){return(t*=Math[ax("0x5")](t)).toString(36)}const gx=["_setSuggestionData","length","refresh","plugins","markerReady","_getSuggestionData","buildSuggestion","track-changes-user-not-found","commandName","isOwn","createPositionAt","includes","PENDING_ACTION_SUGGESTION","marker-count","isBefore","_editor","markBlockFormat","isIntersectingWithRange","formatBlock:accept","_rangeIsInLocalUserInsertion","dataReady","low","skipNestingCheck","addSuggestionData","suggestion","selection","addHighlight","formatInline","deletion:","root","return","trackChanges","getMarkers","subType","type","updateMarker","insertion:","createPositionAfter","unbind","containsRangeInObject","element","values","mapper","_getAuthorFromId","getCustomProperty","deletion","markMultiRangeInsertion","_suggestions","registerCustomCallback","change","then","editing","showSuggestionHighlights","isNextTo","notReady","fromCharCode","init","conversion","markInsertion","setTo","head","createSelection","isObject","markMultiRangeBlockFormat","ready","discardAllSuggestions","splice","_handleNewSuggestionMarker","stop","containsRange","name","_findSuggestions","ck-suggestion-marker--active","clear","removed","howMany","markerToData","adapter","formatBlock","position","suggestionChanged","_refreshSuggestionsChain","isTouching","insert","removeClass","join","push","addSuggestion","range","editingDowncast","PendingActions","fromRange","data","getCommentThread","editor","isAtStart","getItems","formatGroupId","clone","rejected","getChangedMarkers","getIntersection","_descriptionFactory","getSuggestions","markInlineFormat","createRange","isLocal","hasComments","isAfter","_customCallbacks","_createSuggestion","deletion:join","config","suggestion:","getAttribute","originalSuggestionId","collaboration.channelId","parent","discard","_joinWithAdjacentSuggestions","getFirstRange","markDeletion","suggestionUnloaded","isRemovable","open","getNearestSelectionRange","enableCommand","addMarker:suggestion:formatBlock","createRangeIn","track-changes-adapter-missing-getsuggestion","discardSelectedSuggestions","removeMarker:suggestion:formatBlock","accept","model","after","batch","ck-suggestion-marker","map","track-changes-adapter-already-set","createdAt","elementToElement","TrackChangesEditing","formatInline:","split","track-changes-suggestion-data-mismatch","activeMarkers","end","markerToHighlight","_setSuggestionRange","_suggestionState","document","acceptSuggestion","getAncestors","for","before","_commentsRepository","containsItem","add","_checkSuggestionCorrectness","fetchCommentThread","containsPosition","elementStart","markers","Users","forceDefaultExecution","applyOperation","createPositionBefore","isInContent","track-changes-command-not-found","commentThread","_onDiscard","_addSuggestionMarker","acceptSelectedSuggestions","insertion:discard","fire","suggestion-type","CommentsRepository","execute","pluginName","nodeBefore","_updateSuggestionData","isCollapsed","addClass","_cutOutSuggestionMarker","getSuggestion","markMultiRangeDeletion","removeAttribute","updateSuggestion","getRanges","oldRange","formatBlock:chain","value","next","previous","_enabledCommands","addComment","some","targetPosition","formatBlock:","schema","writer","hasCommentThread","multi","_saved","isEqual","_removeSuggestion","removeMarker","data-suggestion","isDocumentOperation","_adapter","dataToMarker","options","change:data","track-changes-suggestion-not-found","nodeAfter","createElement","commands","consume","addMarkerName","isLimit","detach","listenTo","from","filter","markerNameToElements","enableReadOnlyMode","get","high","addMarker","start","differ","getShiftedBy","getFirstMarker","setSelection","_isForcedDefaultExecutionBlock","requires","discardSuggestion","getAllAdjacentSuggestions","getMultiRangeId","isInsideObject","insertContent","isUndo","consumable","_defaultCallbacks","getDifference","insertion:chain","attributes","getWalker","_suggestionFactory","change:activeMarkers","acceptAllSuggestions","newRange","every","_registerDefaultCallbacks","toJSON","removeComment","registerPostFixer","multipleBlocks","remove","addRange","item","author","suggestionLoaded","deletion:accept","textProxy","getSuggestionCallback","markerName","dataDowncast","rootName","sort","trackChangesCommand","_joinSuggestions","formatBlock:discard","removeMarkers","bindElementToMarker","upcast","hasSuggestion","$graveyard","isMultiRange","move","isSelectable","rethrowUnexpectedError","change:_saved","_model","insertion","ck-suggestion-marker-formatBlock","size","documentSelection","has","formatInline:join","deleteContent","locale","toViewElement","_breakSuggestionMarker","isAtEnd","_splitMarkerName","getChanges","moveTargetPosition","highest","set","forward","formatInline:accept"];var fx,mx;fx=gx,mx=368,function(t){for(;--t;)fx.push(fx.shift())}(++mx);const hx=function(t,e){return gx[t-=0]};class px extends t.Plugin{static get[hx("0xa9")](){return[hx("0x6e"),s.Users,t.PendingActions,Or,$r,rs,ls,ms,ys,Rs,Ls,Bs,zs,Js,ei,ii,ui,hi,yi,Ai,Mi,ji,Vi,qi,Zi,sa,ua,ha,Ta,Ra,La,ja,Wa,Ya,ox]}static get[hx("0x70")](){return hx("0x4b")}constructor(t){function e(t){return t[hx("0x47")]((t=>String[hx("0x123")](t)))[hx("0x13")]("")}super(t),this[hx("0xe9")]("activeMarkers",[]),this.on(hx("0xb7"),((e,n,o,r)=>{this._model[hx("0x11d")]((()=>{for(const e of[...r,...o])this[hx("0xd9")][hx("0x60")].has(e)&&t[hx("0x11f")].reconvertMarker(e)}))})),this[hx("0x24")]=new Ir(this[hx("0x1c")].model[hx("0x85")],this[hx("0x1c")][hx("0xe1")]),this[hx("0x8f")]=null,this._suggestionFactory=new bx(this[hx("0x1c")]),this[hx("0x11b")]=new Map,this[hx("0x59")]=t.plugins[hx("0xa0")]("CommentsRepository"),this[hx("0x80")]=new Set,this[hx("0xd9")]=this[hx("0x1c")][hx("0x43")],this[hx("0x53")]=new WeakMap,this[hx("0xa8")]=!1,this[e([95,101,120,101,99,117,116,101,83,117,103,103,101,115,116,105,111,110])]=e([52,48,52,52,49,50,53,56])}[hx("0x124")](){const t=this.editor;t[hx("0x125")][hx("0x57")](hx("0x17"))[hx("0x51")]({model:hx("0x104"),view:t=>{const{id:e,type:n}=this[hx("0xe5")](t[hx("0xc8")]),o=[hx("0x46"),"ck-suggestion-marker-"+n];let r=3e3;return this[hx("0x4f")][hx("0xf7")](t[hx("0xc8")])&&(o[hx("0x14")](hx("0x6")),r=3010),hx("0x119")==n&&(r+=5),{classes:o,attributes:{"data-suggestion":e},priority:r}}}),t[hx("0x125")][hx("0x57")](hx("0xc9"))[hx("0x5b")]((e=>{e.on("addMarker:suggestion",((e,n,o)=>{if(!o.options[hx("0x120")])return;const r=n[hx("0xc2")];if(!r)return;const s=o[hx("0x116")][hx("0xe2")](r);t[hx("0x43")][hx("0x85")].isObject(r)&&s&&!s[hx("0x118")]("widget")&&s.is("containerElement")&&(0,P.toWidget)(s,o.writer)}),{priority:hx("0xa1")})})),t.conversion.for(hx("0xc9"))[hx("0x51")]({model:hx("0x104"),view:(t,e)=>{if(!e.options[hx("0x120")])return null;const{type:n}=this[hx("0xe5")](t.markerName);return{classes:[hx("0x46"),"ck-suggestion-marker-"+n],priority:3e3}}});const n=({showActiveMarkers:e=!0}={})=>(n,o,r)=>{if(!o.item)return;if(o.item.is(hx("0x105")))return void r[hx("0xb0")][hx("0x97")](o[hx("0xc2")],n[hx("0x4")]);const s=r[hx("0x116")][hx("0xe2")](o[hx("0xc2")]);if(!o.item.is(hx("0x114"))||!t.model.schema.isBlock(o[hx("0xc2")])||s.getCustomProperty(hx("0x106")))return;const{id:i}=this._splitMarkerName(o[hx("0xc8")]);r[hx("0x86")][hx("0x74")](["ck-suggestion-marker","ck-suggestion-marker-formatBlock"],s),r[hx("0x86")].setAttribute(hx("0x8d"),i,s),r[hx("0x116")][hx("0xd0")](s,o[hx("0xc8")]),e&&(this.activeMarkers[hx("0xf7")](o[hx("0xc8")])?r[hx("0x86")].addClass("ck-suggestion-marker--active",s):r[hx("0x86")][hx("0x12")](hx("0x6"),s));for(const e of t[hx("0x43")][hx("0x3e")](o[hx("0xc2")])[hx("0x1e")]())r[hx("0xb0")][hx("0x97")](e,n.name);r[hx("0xb0")][hx("0x97")](o[hx("0xc2")],n[hx("0x4")])};t[hx("0x125")][hx("0x57")](hx("0xc9"))[hx("0x5b")]((t=>{t.on(hx("0x3d"),((t,e,o)=>{o[hx("0x91")][hx("0x120")]&&n({showActiveMarkers:!1})(t,e,o)}),{priority:hx("0xe8")})})),t[hx("0x125")][hx("0x57")]("dataDowncast")[hx("0xa")]({model:hx("0x104"),view:(t,e)=>e[hx("0x91")][hx("0x120")]?null:{group:hx("0x104"),name:t.substr(hx("0x104")[hx("0xed")]+1)}}),t[hx("0x125")][hx("0x57")](hx("0xd1"))[hx("0x4a")]({view:{name:hx("0x104"),attribute:{id:/^\w/,suggestionType:/^\w/}},model:(t,{writer:e})=>{let n="suggestion:"+t.getAttribute(hx("0x6d"))+":"+t[hx("0x30")]("id");return t[hx("0x30")](hx("0xf9"))&&(n+=":"+t[hx("0x30")](hx("0xf9"))),e[hx("0x95")]("$marker",{"data-name":n})}}),t[hx("0x125")].for(hx("0xd1"))[hx("0x90")]({view:hx("0x104")}),t.conversion[hx("0x57")](hx("0x17")).add((t=>{t.on(hx("0x3d"),n(),{priority:hx("0xa1")})})),t.conversion.for(hx("0x17")).add((t=>{t.on(hx("0x41"),((t,e,n)=>{const o=n[hx("0x116")][hx("0x9e")](e[hx("0xc8")]);if(o)for(const t of o)t.getCustomProperty(hx("0x106"))||(n[hx("0x86")][hx("0x12")](["ck-suggestion-marker",hx("0xdb"),hx("0x6")],t),n[hx("0x86")][hx("0x78")](hx("0x8d"),t),n.mapper.unbindElementFromMarkerName(t,e.markerName))}),{priority:"high"})})),t.model[hx("0x54")][hx("0xbe")]((e=>{let n=!1;const o=Array.from(t[hx("0x43")].document.differ.getChangedMarkers());for(const{name:i,data:a}of o){const{group:o,type:x,id:c}=this[hx("0xe5")](i);if(hx("0x104")!==o)continue;const l=this._suggestions.get(c);if(null!=a[hx("0xb9")])if(hx("0x107")==x&&(n=n||yx(a.newRange,i,e,t[hx("0x43")][hx("0x85")])),a.newRange[hx("0x73")]||hx("0xd3")==a[hx("0xb9")][hx("0x109")][hx("0xca")]||"formatBlock"==x&&!Cx(a[hx("0xb9")])||hx("0x119")==x&&(_x(s=a[hx("0xb9")])||(r=s)[hx("0xa3")][hx("0x33")]==r[hx("0x50")][hx("0x71")]&&r.start[hx("0xe4")]))e[hx("0x8c")](i),n=!0;else{if(!l||!l[hx("0x65")])continue;n=!!this[hx("0x35")](l)||n}}var r,s;return n})),t.model.document[hx("0xbe")]((e=>{let n=!1;for(const o of t[hx("0x43")][hx("0x54")][hx("0xa4")][hx("0xe6")]()){if(hx("0x11")!=o[hx("0x10e")])continue;const r=o[hx("0xd")][hx("0xa5")](o.length);if(r[hx("0xe4")])for(const s of this[hx("0x11b")].values()){if(s[hx("0xd4")]||!s.isInContent)continue;if(hx("0xc")!=s[hx("0x10e")])continue;const i=s[hx("0x36")]();if(i[hx("0xa3")].parent!=i[hx("0x50")][hx("0x33")]&&i[hx("0x50")][hx("0x8a")](o[hx("0xd")])){const o=t[hx("0x43")][hx("0x27")](i[hx("0xa3")],r);e[hx("0x10f")](s.getFirstMarker(),{range:o}),n=!0}}}return n})),t[hx("0x43")].markers.on("update:suggestion",((t,e,n)=>{if(null==n){const{id:t}=this[hx("0xe5")](e[hx("0x4")]),n=this._suggestions[hx("0xa0")](t);n&&n[hx("0x98")](e.name)}})),t.model.document.on(hx("0x92"),(()=>{const e=Array[hx("0x9c")](t.model.document[hx("0xa4")][hx("0x22")]());e[hx("0xcb")](((t,e)=>{const n=t.data.oldRange,o=e.data.oldRange;return null===n&&null===o?0:null===n&&null!==o?-1:null!==n&&null===o?1:n[hx("0xa3")][hx("0xfa")](o[hx("0xa3")])?-1:1}));const n=new Set;for(const{name:t,data:o}of e){const{group:e,id:r}=this._splitMarkerName(t);if(hx("0x104")===e&&(null===o[hx("0x7b")]&&this[hx("0x1")](t),null===o[hx("0xb9")])){const t=this._suggestions[hx("0xa0")](r);t[hx("0x65")]?n[hx("0x5b")](t):this[hx("0x8b")](t)}}for(const{name:t,data:o}of e){const{group:e,id:r}=this[hx("0xe5")](t);if(hx("0x104")!==e)continue;const s=this[hx("0x11b")][hx("0xa0")](r);null!=o[hx("0xb9")]&&null!=o[hx("0x7b")]&&(this[hx("0xf")](s),n[hx("0x5b")](s[hx("0x128")]))}for(const t of n)this[hx("0x6c")](hx("0xe"),t);n.clear()})),t[hx("0x43")].on(hx("0x63"),((e,n)=>{const o=n[0];if(!this[hx("0x11b")][hx("0xdc")])return;if(!o[hx("0x8e")])return;if(o.batch[hx("0xaf")]||!o[hx("0x45")][hx("0x28")])return;let r,s;switch(o[hx("0x10e")]){case hx("0x11"):r=t[hx("0x43")].createPositionAt(o[hx("0xd")]),s=r[hx("0xa5")](o[hx("0x9")]);break;case hx("0x4d"):r=t[hx("0x43")][hx("0xf6")](o.splitPosition),s=t[hx("0x43")][hx("0xf6")](o[hx("0xe7")]);break;case hx("0xd5"):r=t.model.createPositionAt(o[hx("0x83")]),s=r[hx("0xa5")](o[hx("0x9")]);break;default:return}const i=t[hx("0x43")][hx("0x27")](r,s);t[hx("0x43")][hx("0x11d")]((()=>{for(const{suggestion:t,meta:e}of this[hx("0x5")](i)){if(t[hx("0xd4")])continue;if(hx("0x107")==t[hx("0x10e")])continue;const n=t[hx("0x1a")]&&t[hx("0x1a")][hx("0xbf")];(hx("0xc")!=t[hx("0x10e")]||hx("0x4d")==o.type&&!n)&&(e[hx("0x113")]||"insertion"==t.type&&e[hx("0xf5")]||t.getFirstRange()[hx("0x3")](i)&&this[hx("0xe3")](t,r,s))}}))}),{priority:"lowest"}),t.model.on(hx("0xe0"),((e,n)=>{const o=n[0],r=n[1];if(r&&r.forceDefaultExecution)return;if(this._isForcedDefaultExecutionBlock)return;if(!this[hx("0xcc")][hx("0x7d")])return;if(o[hx("0x73")])return;const s=t[hx("0x43")][hx("0x85")],{start:i,end:a}=o[hx("0x36")](),x=i[hx("0x94")]&&s[hx("0x12a")](i[hx("0x94")])?null:s[hx("0x3b")](i,hx("0xea")),c=a[hx("0x71")]&&s[hx("0x12a")](a[hx("0x71")])?null:s[hx("0x3b")](a,"backward"),l=t[hx("0x43")][hx("0x27")](x?x[hx("0xa3")]:i,c?c[hx("0x50")]:a);t[hx("0x43")][hx("0x11d")]((e=>{this[hx("0x37")](l);const n=t.model.schema[hx("0x3b")](l[hx("0xa3")]);o.is(hx("0xdd"))?e.setSelection(n):o[hx("0x127")](n)})),e[hx("0x2")]()}),{priority:e.priorities.normal+10}),t[hx("0x43")].on(hx("0xae"),((e,n)=>{const o=n[n.length-1];o&&o[hx("0x62")]||this._isForcedDefaultExecutionBlock||this.trackChangesCommand[hx("0x7d")]&&(t[hx("0x43")][hx("0x11d")]((()=>{let o=t[hx("0x43")].insertContent(n[0],n[1],n[2],n[3],{forceDefaultExecution:!0});if(!o)return;e[hx("0x10a")]=o[hx("0x20")]();const r=o[hx("0x50")].nodeBefore,s=t.model.schema;r&&s.isBlock(r)&&!s[hx("0x12a")](r)&&(o=t[hx("0x43")][hx("0x27")](o[hx("0xa3")],t[hx("0x43")][hx("0xf6")](r,hx("0x50")))),this.markInsertion(o)})),e[hx("0x2")]())}),{priority:hx("0xa1")}),this[hx("0xcc")]=new H(t,this[hx("0x80")]),this[hx("0x1c")][hx("0x96")][hx("0x5b")]("trackChanges",this.trackChangesCommand),this[hx("0x3c")](hx("0x10b"));const o=new K(t,this[hx("0x11b")]);t[hx("0x96")][hx("0x5b")](hx("0x55"),o),this[hx("0x3c")]("acceptSuggestion");const r=new Q(t,this._suggestions);t[hx("0x96")][hx("0x5b")]("discardSuggestion",r),this.enableCommand("discardSuggestion"),t[hx("0x96")][hx("0x5b")](hx("0xb8"),new at(t,o,this[hx("0x11b")])),this[hx("0x3c")](hx("0xb8")),t[hx("0x96")].add(hx("0x12d"),new Tt(t,r,this[hx("0x11b")])),this.enableCommand(hx("0x12d")),t.commands[hx("0x5b")]("acceptSelectedSuggestions",new pt(t,o,this[hx("0x11b")])),this[hx("0x3c")](hx("0x6a")),t.commands[hx("0x5b")](hx("0x40"),new Rt(t,r,this[hx("0x11b")])),this.enableCommand(hx("0x40"));const s=t.plugins[hx("0xa0")](hx("0x6e"));this[hx("0x9b")](s,hx("0x81"),((t,{threadId:e})=>{const n=this[hx("0x11b")][hx("0xa0")](e);n&&n[hx("0x67")]&&1===n[hx("0x67")].length&&this._updateSuggestionData(e,{hasComments:!0})}),{priority:"low"}),this[hx("0x9b")](s,hx("0xbd"),((t,{threadId:e})=>{const n=this[hx("0x11b")][hx("0xa0")](e);n&&n[hx("0x67")]&&!n[hx("0x67")].length&&this[hx("0x72")](e,{hasComments:!1})}),{priority:hx("0x101")})}set[hx("0xb")](t){if(this[hx("0x8f")])throw new e.CKEditorError(hx("0x48"),this);this._adapter=t}get[hx("0xb")](){return this[hx("0x8f")]}[hx("0x25")]({skipNotAttached:t=!1,toJSON:e=!1}={}){const n=[];for(const e of this[hx("0x11b")][hx("0x115")]())t&&!e.isInContent||n[hx("0x14")](e);return e?n.map((t=>t[hx("0xbc")]())):n}[hx("0x76")](t){const n=this[hx("0x11b")].get(t);if(!n)throw new e.CKEditorError(hx("0x93"),this);return n}[hx("0xd2")](t){return this[hx("0x11b")][hx("0xde")](t)}[hx("0x103")](t){const{id:e,authorId:n}=t,[o,r]=t.type.split(":"),s=this[hx("0x11b")][hx("0xa0")](e)||this[hx("0x2c")](o,r,e,n);switch(this._addThreadToSuggestion(s),this[hx("0x5c")](s,o,r||null,n),s[hx("0x49")]=t[hx("0x49")],t[hx("0x1a")]&&(s[hx("0x1a")]=t.data),t[hx("0xb4")]&&(s[hx("0xb4")]=t[hx("0xb4")]),this[hx("0x8f")]&&this[hx("0x8f")][hx("0x15")]||(s[hx("0x89")]=!0),this._suggestionState[hx("0xa0")](s)){case hx("0x122"):this[hx("0x53")][hx("0xe9")](s,hx("0x100"));break;case hx("0xf0"):s[hx("0x65")]?(this[hx("0x53")].set(s,hx("0x12c")),this[hx("0x6c")]("suggestionLoaded",s)):this._suggestionState.set(s,hx("0x8"))}return s}[hx("0x55")](t){this[hx("0x62")]((()=>{this[hx("0x1c")][hx("0x43")][hx("0x11d")]((()=>{for(const e of t[hx("0xab")]())e[hx("0x42")]()}))}))}[hx("0xaa")](t){this[hx("0x62")]((()=>{this[hx("0x1c")][hx("0x43")][hx("0x11d")]((()=>{for(const e of t[hx("0xab")]())e[hx("0x34")]()}))}))}[hx("0x3c")](t,n){const o=this[hx("0x1c")][hx("0x96")][hx("0xa0")](t);if(!o)throw new e.CKEditorError(hx("0x66"),this,{commandName:t});this[hx("0x80")][hx("0x5b")](o),n&&o.on(hx("0x6f"),((t,e)=>{this.trackChangesCommand[hx("0x7d")]&&(this[hx("0xa8")]||e.length>0&&e[e.length-1]&&e[e[hx("0xed")]-1].forceDefaultExecution||(n(((...t)=>o.execute(...t,{forceDefaultExecution:!0})),...e),t[hx("0x2")]()))}),{priority:"high"})}[hx("0x62")](t){let n,o;const r=this[hx("0xa8")];this[hx("0xa8")]=!0;try{n=t()}catch(t){o=t}return r||(this._isForcedDefaultExecutionBlock=!1),o&&e.CKEditorError[hx("0xd7")](o,this),n}[hx("0x126")](t,n=null,o={}){if(t[hx("0x73")])return null;const r=this[hx("0x1c")][hx("0xef")].get(hx("0x61")).me;for(const{suggestion:e,meta:o}of this._findSuggestions(t,hx("0xda")))if(o.isOwn){if(!o[hx("0x121")])return e;if(n==e[hx("0x10d")]){const n=e[hx("0x36")]();return n[hx("0xa3")][hx("0x8a")](t.end)?this[hx("0x52")](e,this[hx("0xd9")][hx("0x27")](t[hx("0xa3")],n[hx("0x50")])):this._setSuggestionRange(e,this[hx("0xd9")].createRange(n.start,t[hx("0x50")])),e}}const s=(0,e.uid)(),i=r.id,a=n?hx("0x110")+n:"insertion",x=this[hx("0xec")]({id:s,type:a,createdAt:new Date,authorId:i,attributes:o});return this[hx("0x69")](a,s,i,t),x}[hx("0x11a")](t,n="multi",o={}){const r=this[hx("0x1c")][hx("0xef")][hx("0xa0")](hx("0x61")).me,s=this[hx("0xb6")].getSuggestionCallback("insertion",n,hx("0x13"));for(const e of this[hx("0x25")]())if(e[hx("0xc3")].id==r.id&&hx("0xda")==e.type&&e.subType==n&&(s(e[hx("0x7a")](),t)||s(t,e[hx("0x7a")]()))){for(const n of t)e[hx("0xc1")](n);return e}for(const e of t)for(const{suggestion:n,meta:o}of this._findSuggestions(e,hx("0xda"))){if(!o[hx("0xf5")])continue;let e=!0;for(const o of n[hx("0x7a")]())for(const n of t)if(!o.containsRange(n)){e=!1;break}if(e)return n}const i=(0,e.uid)(),a=r.id,x=hx("0x110")+n,c=this[hx("0xec")]({id:i,type:x,createdAt:new Date,authorId:a,attributes:o});for(const e of t)this[hx("0x69")](x,i,a,e,Cr[hx("0xac")]());return c}[hx("0x26")](t,n,o=null,r={}){if(o=o||Tx(n),t[hx("0x73")])return;const s=this[hx("0x1c")][hx("0xef")].get(hx("0x61")).me,i=[];for(const{suggestion:e,meta:n}of this[hx("0x5")](t,hx("0xda")))n[hx("0xf5")]&&!n.isInsideObject&&i[hx("0x14")](...e[hx("0x7a")]());const a=function(t,e){const n=[];for(const o of e){const e=t.getIntersection(o);e&&n.push(e)}return n}(t,i),x=function(t,e){const n=[t];for(const t of e){let e=0;for(;e<n[hx("0xed")];){const o=n[e][hx("0xb2")](t);n[hx("0x0")](e,1,...o),e+=o[hx("0xed")]}}return n}(t,i);a[hx("0xed")]&&this[hx("0xd9")][hx("0x11d")]((()=>{for(const t of a){const e=this._suggestionFactory.getSuggestionCallback(hx("0x107"),o,hx("0x42"));this[hx("0x62")]((()=>e([t],n,r)))}}));for(const t of x){let i=null,a=t[hx("0xa3")],x=t.end;for(const{suggestion:e,meta:n}of this[hx("0x5")](t,hx("0x107"))){if(!n[hx("0xf5")])continue;if(e.subType!=o)continue;const r=e[hx("0x36")]();if(r[hx("0x3")](t,!0))return;a=a[hx("0xfa")](r.start)?a:r[hx("0xa3")],x=x[hx("0x2a")](r[hx("0x50")])?x:r[hx("0x50")],i?r[hx("0xa3")].isBefore(i.getFirstRange()[hx("0xa3")])?(i[hx("0xcf")](),i=e):e[hx("0xcf")]():i=e}const c=this[hx("0xd9")][hx("0x27")](a,x);if(i)this[hx("0x52")](i,c);else{const t=(0,e.uid)(),i=s.id;this[hx("0xec")]({id:t,type:hx("0x4c")+o,data:n,createdAt:new Date,authorId:i,attributes:r}),this[hx("0x69")](hx("0x4c")+o,t,i,c)}}}[hx("0xfc")](t,n,o=[],r=null,s={}){n[hx("0x1f")]||(n[hx("0x1f")]=n[hx("0xf4")]),n[hx("0xbf")]=t.is(hx("0x16")),r=r||Tx(n);const i=o[hx("0x47")]((t=>kx(t,this[hx("0xd9")]))),a=t.is("range")?t:kx(t,this[hx("0xd9")]);i[hx("0x14")](a);let x=!0;for(const t of i)if(!this[hx("0xff")](t)){x=!1;break}if(x){const t=this[hx("0xb6")].getSuggestionCallback(hx("0xc"),r,hx("0x42"));return void this.forceDefaultExecution((()=>t([a],n,s)))}let c=null,l=a[hx("0xa3")],u=a[hx("0x50")];for(const{suggestion:t,meta:e}of this[hx("0x5")](a,hx("0xc"))){if(!e[hx("0xf5")]||e.isNextTo||e.containsRangeInObject||e[hx("0xad")])continue;if(t.data[hx("0x1f")]!=n[hx("0x1f")])continue;const o=t[hx("0x36")]();if(t[hx("0x10d")]==r){if(o[hx("0x3")](a,!0))return;l=l.isBefore(o[hx("0xa3")])?l:o.start,u=u[hx("0x2a")](o[hx("0x50")])?u:o[hx("0x50")],c?o[hx("0xa3")][hx("0xfa")](c[hx("0x36")]().start)?(c[hx("0xcf")](),c=t):t[hx("0xcf")]():c=t}else{const e=a[hx("0x23")](o);this[hx("0x75")](t,e)}}const d=this[hx("0x1c")][hx("0xef")][hx("0xa0")](hx("0x61")).me,g=(0,e.uid)(),f=d.id;c?this[hx("0x52")](c,this[hx("0xd9")].createRange(l,u)):(this[hx("0xec")]({id:g,type:hx("0x84")+r,data:n,createdAt:new Date,authorId:f,attributes:s}),this[hx("0x69")]("formatBlock:"+r,g,f,this[hx("0xd9")][hx("0x27")](l,u)))}[hx("0x12b")](t,n,o=[],r=null,s={}){n.formatGroupId||(n[hx("0x1f")]=n[hx("0xf4")]),n[hx("0xbf")]=!1,r=r||Tx(n);const i=o[hx("0x47")]((t=>kx(t,this[hx("0xd9")]))),a=t[hx("0x47")]((t=>kx(t,this[hx("0xd9")])));i[hx("0x14")](...a);let x=!0;for(const t of i)if(!this[hx("0xff")](t)){x=!1;break}if(x){const t=this[hx("0xb6")].getSuggestionCallback("formatBlock",r,hx("0x42"));return void this.forceDefaultExecution((()=>t(a,n,s)))}const c=this.editor[hx("0xef")][hx("0xa0")](hx("0x61")).me;for(const t of this[hx("0x25")]()){if(t[hx("0xc3")].id!=c.id)continue;if(hx("0xc")!=t[hx("0x10e")]||t.data[hx("0x1f")]!=n.formatGroupId)continue;const e=t.subType==r;for(let n=0;n<a[hx("0xed")];n++){const o=a[n];for(const r of t[hx("0x10c")]()){const s=r.getRange();if(o[hx("0x8a")](s)){e?(a[hx("0x0")](n,1),n--):t[hx("0x8c")](r.name);break}}}}if(0==a[hx("0xed")])return;const l=this._suggestionFactory[hx("0xc7")](hx("0xc"),r,"join");for(const t of this.getSuggestions())if(t[hx("0xc3")].id==c.id&&hx("0xc")==t[hx("0x10e")]&&t[hx("0x1a")][hx("0x1f")]==n[hx("0x1f")]&&t[hx("0x10d")]==r&&(l(t[hx("0x7a")](),a)||l(a,t[hx("0x7a")]()))){for(const e of a)t[hx("0xc1")](e);return t}const u=(0,e.uid)(),d=c.id,g=hx("0x84")+r,f=this[hx("0xec")]({id:u,type:g,data:n,createdAt:new Date,authorId:d,attributes:s});for(const t of a)this[hx("0x69")](g,u,d,t,Cr[hx("0xac")]());return f}[hx("0x37")](t,n=null,o={}){if(t[hx("0x73")])return null;const r=this.editor.plugins[hx("0xa0")](hx("0x61")).me,s=new F.LiveRange(t[hx("0xa3")],t[hx("0x50")]);for(const{suggestion:t,meta:e}of this[hx("0x5")](s,hx("0xda")))if(e[hx("0xf5")]&&!e[hx("0x121")])if(t[hx("0xd4")]){const e=t[hx("0x7a")]()[hx("0x9d")]((t=>"$graveyard"!=t[hx("0x109")][hx("0xca")]));if(e[hx("0xba")]((t=>s[hx("0x3")](t,!0)))&&t[hx("0x34")](),e[hx("0x82")]((t=>t.containsRange(s,!0)))){const t=this[hx("0xb6")].getSuggestionCallback(hx("0x119"),n,hx("0x42"));return this[hx("0x62")]((()=>t([s],null,o))),null}}else{const e=s[hx("0x23")](t.getFirstRange());t[hx("0x68")]([e],null,o)}if(s[hx("0x9a")](),s.isCollapsed||hx("0xd3")==s.root[hx("0xca")])return null;let i=null,a=s[hx("0xa3")],x=s[hx("0x50")];for(const{suggestion:t,meta:e}of this[hx("0x5")](s,hx("0x119")))if(e[hx("0xf5")])if(t[hx("0xd4")]){let e=!0;for(const n of t[hx("0x7a")]()){if(n[hx("0x3")](s,!0))return t;s[hx("0x3")](n)||(e=!1)}e&&t[hx("0x34")]()}else{const e=t[hx("0x36")]();if(e[hx("0x3")](s,!0))return t;a=a.isBefore(e.start)?a:e[hx("0xa3")],x=x[hx("0x2a")](e[hx("0x50")])?x:e[hx("0x50")],i?e.start.isBefore(i.getFirstRange()[hx("0xa3")])?(i[hx("0xcf")](),i=t):t[hx("0xcf")]():i=t}if(i)return this[hx("0x52")](i,this[hx("0xd9")][hx("0x27")](a,x)),i;{const t=(0,e.uid)(),s=this[hx("0xd9")][hx("0x27")](a,x),i=r.id,c=n?hx("0x108")+n:hx("0x119"),l=this[hx("0xec")]({id:t,type:c,createdAt:new Date,authorId:i,attributes:o});return this[hx("0x69")](c,t,i,s),l}}[hx("0x77")](t,n=hx("0x88"),o={}){const r=this[hx("0x1c")][hx("0xef")][hx("0xa0")](hx("0x61")).me,s=t[hx("0x47")]((t=>new F.LiveRange(t.start,t[hx("0x50")]))),i=new Set;for(const t of s)for(const{suggestion:e,meta:n}of this._findSuggestions(t,hx("0xda")))n.isOwn&&!n[hx("0x121")]&&i[hx("0x5b")](e);for(const e of i)if(e.isMultiRange){const r=e[hx("0x7a")]();if((!e[hx("0xb4")]||!e.attributes.skipNestingCheck)&&r[hx("0xba")]((t=>s.some((e=>e.containsRange(t,!0)))))&&e.discard(),s[hx("0xba")]((t=>r[hx("0x82")]((e=>e[hx("0x3")](t,!0)))))){const e=this[hx("0xb6")].getSuggestionCallback(hx("0x119"),n,"accept");return this[hx("0x62")]((()=>e(t,null,o))),null}}else{const t=e[hx("0x36")]();if(s[hx("0x82")]((e=>e.containsRange(t,!0)))&&e[hx("0x34")](),s.every((e=>t[hx("0x3")](e,!0)))){const t=this[hx("0xb6")].getSuggestionCallback(hx("0x119"),n,"accept");return this[hx("0x62")]((()=>t(s,null,o))),null}}const a=this._suggestionFactory[hx("0xc7")](hx("0x119"),n,hx("0x13"));let x=null;for(const t of this.getSuggestions())if(t[hx("0xc3")].id==r.id&&t.isInContent&&"deletion"==t[hx("0x10e")]&&t.subType==n&&(a(t[hx("0x7a")](),s)||a(s,t[hx("0x7a")]())))if(x){if(t.commentThread&&t[hx("0x67")].length)continue;for(const e of t[hx("0x7a")]())x[hx("0xfd")](e)||x[hx("0xc1")](e);t[hx("0xcf")]()}else{x=t;for(const e of s)t[hx("0xfd")](e)||t[hx("0xc1")](e)}if(x)return x;i[hx("0x7")]();for(const t of s)for(const{suggestion:e,meta:n}of this[hx("0x5")](t,hx("0x119")))n[hx("0xf5")]&&i[hx("0x5b")](e);for(const t of i){const e=t[hx("0x7a")]();if((!o||!o[hx("0x102")])&&s[hx("0xba")]((t=>e[hx("0x82")]((e=>e.containsRange(t,!0))))))return t;(!t[hx("0xb4")]||!t[hx("0xb4")][hx("0x102")])&&e.every((t=>s[hx("0x82")]((e=>e[hx("0x3")](t,!0)))))&&t[hx("0x34")]()}const c=(0,e.uid)(),l=r.id,u="deletion:"+n,d=this[hx("0xec")]({id:c,type:u,createdAt:new Date,authorId:l,attributes:o});for(const t of s)t.detach(),t.isCollapsed||hx("0xd3")==t[hx("0x109")][hx("0xca")]||this[hx("0x69")](u,c,l,t,Cr.getMultiRangeId());return d}[hx("0x52")](t,e){const n=t[hx("0xa6")]();this[hx("0xd9")][hx("0x11d")]((t=>{t[hx("0x10f")](n,{range:e})}))}_addThreadToSuggestion(t){const e=t.id,n=this[hx("0x1c")][hx("0x2e")][hx("0xa0")](hx("0x32"));this._commentsRepository[hx("0x87")](e)||this[hx("0x59")].addCommentThread({channelId:n,threadId:e});const o=this[hx("0x59")][hx("0x1b")](e);o[hx("0x112")](hx("0x39")),o[hx("0x39")]=!1,t[hx("0x67")]=o}[hx("0x5c")](t,n,o,r){if(t[hx("0x10e")]!=n||t[hx("0x10d")]!=o||t[hx("0xc3")].id!=r)throw this[hx("0x1c")][hx("0x9f")](hx("0x4e")),new e.CKEditorError("track-changes-suggestion-data-mismatch",this)}[hx("0x75")](t,n){const o=t[hx("0x36")]();if(n[hx("0x8a")](o))t.removeMarkers();else if(o[hx("0x3")](n)){const r=this[hx("0xd9")].createPositionAt(n.start[hx("0x71")],hx("0x50"));this[hx("0x52")](t,this[hx("0xd9")][hx("0x27")](o[hx("0xa3")],r));const s=(0,e.uid)(),i=t[hx("0xc3")].id,a=t[hx("0x10e")]+":"+t.subType;this._setSuggestionData({id:s,type:a,createdAt:new Date,authorId:i,data:t[hx("0x1a")],attributes:t[hx("0xb4")]});const x=this[hx("0xd9")][hx("0xf6")](n[hx("0x50")].parent,hx("0x44")),c=this[hx("0xd9")].createRange(x,o[hx("0x50")]);this._addSuggestionMarker(a,s,i,c)}else if(o[hx("0x5e")](n.start)){const e=this[hx("0xd9")][hx("0xf6")](n.start[hx("0x71")],hx("0x50"));this[hx("0x52")](t,this[hx("0xd9")][hx("0x27")](o[hx("0xa3")],e))}else{const e=this[hx("0xd9")].createPositionAt(n[hx("0x50")][hx("0x33")],hx("0x44"));this[hx("0x52")](t,this[hx("0xd9")][hx("0x27")](e,o[hx("0x50")]))}}[hx("0xff")](t){for(const{suggestion:e,meta:n}of this[hx("0x5")](t,hx("0xda"))){if(!n.isOwn)continue;const o=e[hx("0x7a")]();for(const e of o)if(!t.getDifference(e).length)return!0}return!1}[hx("0x117")](t){const n=this[hx("0x1c")][hx("0xef")].get(hx("0x61")).getUser(t);if(!n)throw new e.CKEditorError(hx("0xf3"),this);return n}[hx("0x2c")](t,e,n,o){const r=this[hx("0x117")](o),s=this._suggestionFactory.buildSuggestion(t,e,n,r,(t=>this[hx("0x72")](n,{attributes:t})));return this[hx("0x9b")](s,"accept",(()=>{this[hx("0x72")](n,{state:"accepted"})}),{priority:hx("0xa1")}),this.listenTo(s,"discard",(()=>{this._updateSuggestionData(n,{state:hx("0x21")})}),{priority:hx("0xa1")}),this[hx("0x11b")][hx("0xe9")](n,s),this._suggestionState[hx("0xe9")](s,hx("0x122")),s}_splitMarkerName(t){const e=t[hx("0x4d")](":");return{group:e[0],type:e[1],subType:e[hx("0xed")]>=5?e[2]:null,id:e.length<5?e[2]:e[3],authorId:e[hx("0xed")]<5?e[3]:e[4],markerCount:6==e[hx("0xed")]?e[5]:null}}[hx("0xe3")](t,n,o){const r=t.getFirstRange(),s=r[hx("0xa3")],i=r.end;this[hx("0x52")](t,this[hx("0xd9")][hx("0x27")](s,n));const a=(0,e.uid)(),x=t[hx("0xc3")].id,c=t[hx("0x10e")]+(t[hx("0x10d")]?":"+t[hx("0x10d")]:"");this[hx("0xec")]({id:a,type:c,createdAt:new Date,authorId:x,originalSuggestionId:t.id,data:t[hx("0x1a")]}),hx("0xc")==t.type&&(o=this[hx("0xd9")][hx("0x64")](o.parent)),this._addSuggestionMarker(c,a,x,this._model.createRange(o,i))}_findSuggestions(t,e=null){const n=[],o=this[hx("0xd9")][hx("0x85")],r=this[hx("0x1c")][hx("0xef")].get(hx("0x61")).me;for(const s of this[hx("0x25")]())if(s.isInContent&&(!e||s.type==e))for(const e of s[hx("0x7a")]()){const i=t[hx("0xa3")][hx("0x8a")](e[hx("0x50")])||t[hx("0x50")][hx("0x8a")](e[hx("0xa3")]);if(i||t[hx("0x23")](e)){const a=t[hx("0x3")](e)&&Ex(o,e[hx("0xa3")],t),x=e[hx("0x3")](t)&&Ex(o,t[hx("0xa3")],e);n[hx("0x14")]({suggestion:s,meta:{isOwn:r==s.author,isNextTo:i,isInsideObject:a,containsRangeInObject:x}});break}}return n}[hx("0x69")](t,e,n,o,r=null){this[hx("0xd9")][hx("0x11d")]((s=>{let i=hx("0x2f")+t+":"+e+":"+n;r&&(i=i+":"+r),s[hx("0xa2")](i,{range:o,usingOperation:!0,affectsData:!0})}))}_removeSuggestion(t){const e=t[hx("0x7f")],n=t[hx("0x7e")];t.previous=null,null!=e&&(e[hx("0x7e")]=null),t[hx("0x7e")]=null,null!=n&&(n[hx("0x7f")]=null),hx("0x12c")==this[hx("0x53")][hx("0xa0")](t)&&(this[hx("0x53")].set(t,"removed"),this[hx("0x6c")](hx("0x38"),t,e,n))}[hx("0xec")](t){const e=t.id,n=this.addSuggestionData(t);if(this[hx("0x8f")]&&this._adapter.addSuggestion){const o=this[hx("0x1c")][hx("0xef")][hx("0xa0")](hx("0x18")),r=n[hx("0x29")],s=n[hx("0x10d")]?n[hx("0x10e")]+":"+n[hx("0x10d")]:n[hx("0x10e")],i=this.editor[hx("0xe1")],a=o.add(kr(i,"PENDING_ACTION_SUGGESTION")),x={id:e,type:s,hasComments:r,data:t.data||null,originalSuggestionId:t[hx("0x31")]||null,attributes:n[hx("0xb4")]};this[hx("0x8f")].addSuggestion(x)[hx("0x11e")]((t=>{n[hx("0x89")]=!0,o[hx("0xc0")](a),t&&t[hx("0x49")]&&(this[hx("0x11b")][hx("0xa0")](e)[hx("0x49")]=t[hx("0x49")])}))}return n}[hx("0x72")](t,e){const n=this[hx("0x1c")][hx("0xef")][hx("0xa0")]("PendingActions"),o=this[hx("0x11b")][hx("0xa0")](t);if(this[hx("0x8f")]&&this[hx("0x8f")].updateSuggestion)if(o._saved){const o=n[hx("0x5b")](kr(this[hx("0x1c")][hx("0xe1")],hx("0xf8")));this[hx("0x8f")][hx("0x79")](t,e).then((()=>{n[hx("0xc0")](o)}))}else o.on(hx("0xd8"),(()=>{this[hx("0x72")](t,e)}))}[hx("0xf1")](t){if(!this[hx("0x8f")]||!this._adapter.getSuggestion)throw new e.CKEditorError(hx("0x3f"),this);return this[hx("0x8f")].getSuggestion(t)}[hx("0x1")](t){const{id:e,type:n,subType:o,authorId:r}=this._splitMarkerName(t),s=this[hx("0x11b")][hx("0xa0")](e)||this[hx("0x2c")](n,o,e,r);switch(this[hx("0x5c")](s,n,o,r),this[hx("0x53")].get(s)){case hx("0x122"):this[hx("0xf1")](e)[hx("0x11e")]((t=>{let n=Promise.resolve();t[hx("0x29")]&&(n=this[hx("0x59")][hx("0x5d")]({channelId:this[hx("0x1c")][hx("0x2e")][hx("0xa0")]("collaboration.channelId"),threadId:e})),n[hx("0x11e")]((()=>{this[hx("0x103")](t)[hx("0x89")]=!0}))})),this[hx("0x53")][hx("0xe9")](s,hx("0xf0"));break;case"removed":this[hx("0x72")](e,{state:hx("0x3a")});case hx("0x100"):this[hx("0x53")][hx("0xe9")](s,hx("0x12c")),this[hx("0x6c")](hx("0xc4"),s);break;case hx("0x12c"):this[hx("0x6c")]("suggestionChanged",s)}s.addMarkerName(t),this[hx("0xf")](s)}_refreshSuggestionsChain(t){if(t[hx("0xd4")])return;let e=!0,n=!0;for(const o of this[hx("0x25")]()){if(o.isMultiRange)continue;if(o==t||!o[hx("0x65")])continue;if(o[hx("0xc3")].id!=t[hx("0xc3")].id)continue;const r=this._suggestionFactory[hx("0xc7")](t[hx("0x10e")],t[hx("0x10d")],"chain"),s=this._suggestionFactory.getSuggestionCallback(o[hx("0x10e")],o[hx("0x10d")],"chain"),i=r(t,o),a=s(t,o);i&&a&&(i[1].commentThread&&i[1][hx("0x67")][hx("0xed")]||(i[0][hx("0x7e")]=i[1],i[1].previous=i[0],i[0]==t?n=!1:e=!1))}t[hx("0x7f")]&&e&&(t[hx("0x7f")][hx("0x7e")]=null,t[hx("0x7f")]=null),t[hx("0x7e")]&&n&&(t[hx("0x7e")][hx("0x7f")]=null,t[hx("0x7e")]=null)}[hx("0x35")](t){for(const e of this[hx("0x11b")][hx("0x115")]()){if(e==t||!e.isInContent)continue;if(e[hx("0x10e")]!=t[hx("0x10e")]||e[hx("0xc3")].id!=t[hx("0xc3")].id||e[hx("0x10d")]!=t[hx("0x10d")])continue;const n=this[hx("0xb6")][hx("0xc7")](t[hx("0x10e")],t[hx("0x10d")],"join");if(n(e[hx("0x7a")](),t[hx("0x7a")]())){if(t[hx("0x67")]&&t[hx("0x67")][hx("0xed")])continue;return this[hx("0xcd")](e,t),!0}if(n(t[hx("0x7a")](),e[hx("0x7a")]())){if(e[hx("0x67")]&&e[hx("0x67")][hx("0xed")])continue;return this[hx("0xcd")](t,e),!0}}return!1}[hx("0xcd")](t,e){if(t[hx("0xd4")])for(const n of e[hx("0x7a")]())t.addRange(n);else{const n=e[hx("0x36")]()[hx("0x50")];this[hx("0x52")](t,this[hx("0xd9")][hx("0x27")](t[hx("0x36")]()[hx("0xa3")],n))}e[hx("0xcf")]()}}(0,e.mix)(px,e.EmitterMixin);class bx{constructor(t){this[hx("0xfb")]=t,this._model=t[hx("0x43")],this[hx("0x2b")]=new Map,this._defaultCallbacks=new Map,this._registerDefaultCallbacks()}[hx("0xf2")](t,e,n,o,r){return new Cr(this._model,{type:t,subType:e,id:n,author:o,onAttributesChange:r,onAccept:(...n)=>this[hx("0xc7")](t,e,hx("0x42"))(...n),onDiscard:(...n)=>this[hx("0xc7")](t,e,hx("0x34"))(...n)})}[hx("0x11c")](t,e,n,o){const r=t+":"+e+":"+n;this._customCallbacks[hx("0xe9")](r,o)}[hx("0xc7")](t,e,n){const o=t+":"+e+":"+n;return this[hx("0x2b")].get(o)||this[hx("0xb1")].get(t+":"+n)}[hx("0xbb")](){const t=()=>{},e=t=>{t[hx("0xcb")](((t,e)=>t[hx("0xa3")][hx("0xfa")](e[hx("0xa3")])?1:-1)),this._model[hx("0x11d")]((e=>{for(const n of t){let t;t=n[hx("0x50")][hx("0xe4")]&&n[hx("0x50")][hx("0x33")]==n[hx("0xa3")][hx("0x94")]?e[hx("0x129")](n[hx("0xa3")].nodeAfter,"on"):e.createSelection(n),this[hx("0xd9")][hx("0xe0")](t,{forceDefaultExecution:!0,doNotAutoparagraph:!0})}}))},n=(t,e)=>{this[hx("0xd9")][hx("0x11d")]((n=>{const{commandName:o,commandParams:r=[]}=e,s=t[0];if(hx("0xd3")==s.root[hx("0xca")])return;const i=Array[hx("0x9c")](this[hx("0xd9")][hx("0x54")].selection[hx("0x7a")]()).map((t=>F.LiveRange[hx("0x19")](t)));_x(s)?n.setSelection(this[hx("0xd9")][hx("0x27")](s[hx("0x50")])):n[hx("0xa7")](s);for(const t of this[hx("0xfb")][hx("0x96")][hx("0x96")]())t[hx("0xee")]();r.push({forceDefaultExecution:!0}),this[hx("0xfb")][hx("0x6f")](o,...r);const a=i.filter((t=>"$graveyard"!=t[hx("0x109")][hx("0xca")]));a.length>0&&n[hx("0xa7")](a);for(const t of i)t[hx("0x9a")]()}))},o=(t,e)=>1==t.length&&1==e[hx("0xed")]&&t[0][hx("0x50")][hx("0x8a")](e[0][hx("0xa3")]),r=(t,e)=>vx(t,e,this[hx("0xd9")])?[t,e]:vx(e,t,this[hx("0xd9")])?[e,t]:null;this._defaultCallbacks.set("insertion:accept",t),this[hx("0xb1")][hx("0xe9")](hx("0x6b"),e),this[hx("0xb1")][hx("0xe9")]("insertion:join",o),this._defaultCallbacks[hx("0xe9")](hx("0xb3"),r),this[hx("0xb1")][hx("0xe9")](hx("0xc5"),e),this._defaultCallbacks[hx("0xe9")]("deletion:discard",t),this._defaultCallbacks[hx("0xe9")](hx("0x2d"),o),this[hx("0xb1")][hx("0xe9")]("deletion:chain",r),this[hx("0xb1")][hx("0xe9")](hx("0xeb"),n),this[hx("0xb1")][hx("0xe9")]("formatInline:discard",t),this[hx("0xb1")].set(hx("0xdf"),o),this[hx("0xb1")][hx("0xe9")]("formatInline:chain",t),this[hx("0xb1")][hx("0xe9")](hx("0xfe"),n),this[hx("0xb1")][hx("0xe9")](hx("0xce"),t),this[hx("0xb1")][hx("0xe9")]("formatBlock:join",o),this[hx("0xb1")][hx("0xe9")](hx("0x7c"),t)}}function Ex(t,e,n){for(const o of e[hx("0x33")][hx("0x56")]({includeSelf:!0,parentFirst:!0})){if(o[hx("0x109")]==o)return!1;if(!n[hx("0x5a")](o))return!1;if(t.isObject(o)||t[hx("0x99")](o))return!0}}function _x(t){return t[hx("0x50")][hx("0x33")]==t[hx("0xa3")].nodeAfter&&t.end[hx("0x1d")]}function yx(t,e,n,o){const r=t=>!t[hx("0xc2")].is(hx("0xc6"))&&!o[hx("0x12a")](t[hx("0xc2")]),s=t[hx("0xa3")].getLastMatchingPosition(r),i=t[hx("0x50")].getLastMatchingPosition(r,{direction:"backward"});return!(t.start[hx("0x8a")](s)&&t[hx("0x50")][hx("0x8a")](i)||(s[hx("0xfa")](i)?n[hx("0x10f")](e,{range:n[hx("0x27")](s,i)}):n.removeMarker(e),0))}function Tx(t){return function(t){let e=0,n=0;for(const o of cx(t))e=(e<<5)-e+o,e&=e,[e,n]=[n,e];return dx(e)+dx(n)}(t)}function Cx(t){const e=t[hx("0xa3")][hx("0x94")];return e&&e.is(hx("0x114"))}function kx(t,e){const n=e[hx("0x85")].isObject(t)||e[hx("0x85")][hx("0xd6")](t);return e[hx("0x27")](e[hx("0xf6")](t,hx("0x58")),n?e[hx("0x111")](t):e[hx("0xf6")](t,"end"))}function vx(t,e,n){const o=t[hx("0x36")](),r=e[hx("0x36")]();if(o[hx("0x50")][hx("0x8a")](r[hx("0xa3")]))return!0;if(t[hx("0x10e")]!=e[hx("0x10e")])return!1;if(!o[hx("0x50")][hx("0x10")](r[hx("0xa3")]))return!1;const s=n[hx("0x27")](o[hx("0x50")],r[hx("0xa3")])[hx("0xb5")]();for(const t of s)if([hx("0x5f"),"elementEnd"][hx("0xf7")](t.type)&&n[hx("0x85")].isLimit(t.item))return!1;return!0}var Ax,Rx,Sx=["unbind","destroy","bind","model","discardSuggestion","listenTo","acceptSuggestion","_discardCommand","isEnabled","execute","_acceptCommand","view","commentThreadController"];Ax=Sx,Rx=194,function(t){for(;--t;)Ax.push(Ax.shift())}(++Rx);var Ix=function(t,e){return Sx[t-=0]};class wx{constructor(t,e,n,o,r){this[Ix("0x4")]=t,this[Ix("0xc")]=e,this[Ix("0x0")]=r,this[Ix("0xb")]=n,this[Ix("0x8")]=o,this[Ix("0xc")][Ix("0x3")](Ix("0x9")).to(this[Ix("0xb")]),this[Ix("0x6")](e,"acceptSuggestion",(()=>this[Ix("0x7")]())),this.listenTo(e,Ix("0x5"),(()=>this[Ix("0x5")]()))}[Ix("0x7")](){this[Ix("0xb")][Ix("0xa")](this[Ix("0x4")].id)}discardSuggestion(){this[Ix("0x8")][Ix("0xa")](this[Ix("0x4")].id)}[Ix("0x2")](){this.view[Ix("0x1")](Ix("0x9")),this.stopListening(),this[Ix("0x0")][Ix("0x2")]()}}(0,e.mix)(wx,e.ObservableMixin);const Mx=["_createCommentThreadInputView","commentInputView","_config","descriptionParts","updateComment","_model","length","isActive","hasDirtyComment","set","fire","editor","addComment","commentThread","element","commentsListView","bind","destroy","value","showInput","isDirty","focus","delegate","submit","locale","_localUser","isReadOnly","_createCommentViews","setData","createdAt","commentThreadInputView","disabledSubmit","assign"];var Nx,Lx;Nx=Mx,Lx=409,function(t){for(;--t;)Nx.push(Nx.shift())}(++Lx);const Ox=function(t,e){return Mx[t-=0]};class Fx extends r.View{constructor(t,e,n,o){super(t),this[Ox("0x2")]=null,this[Ox("0x11")]=null,this[Ox("0x1d")](Ox("0x1b"),!1),this[Ox("0x1d")](Ox("0x10"),e.createdAt),this.bind(Ox("0x10")).to(e),this[Ox("0x1d")](Ox("0x17"),[]),this[Ox("0x1d")](Ox("0x7"),!1),this.set("isEnabled",!1),this._model=e,this[Ox("0xc")]=n,this[Ox("0x16")]=o,o.disableComments?this.set(Ox("0x1a"),1):this[Ox("0xe")]()}[Ox("0x8")](){this[Ox("0x1")].focus()}[Ox("0x4")](){this[Ox("0x7")]=!1,this[Ox("0x2")]&&this[Ox("0x2")][Ox("0x4")](),this[Ox("0x11")]&&this.commentThreadInputView.destroy(),super.destroy()}[Ox("0xe")](){const{CommentsListView:t}=this[Ox("0x16")];this[Ox("0x2")]=new t(this.locale,this._model[Ox("0x0")],Object[Ox("0x13")]({CommentView:this[Ox("0x16")].CommentView},this._config)),this.commentsListView.delegate("removeComment").to(this),this.commentsListView[Ox("0x9")](Ox("0x18")).to(this),this[Ox("0x2")].bind(Ox("0x1b")).to(this),this[Ox("0x1d")](Ox("0x1a"),this[Ox("0x2")][Ox("0x1a")]+1),this.bind(Ox("0x1a")).to(this[Ox("0x2")],"length",(t=>t+1)),this.commentThreadInputView=this._createCommentThreadInputView(),this.on("removeComment",(()=>this[Ox("0x8")]())),this[Ox("0x3")](Ox("0x7")).to(this[Ox("0x2")],Ox("0x1c"),this[Ox("0x11")].commentInputView,"value",((t,e)=>t||!!e))}[Ox("0x14")](){const{CommentThreadInputView:t}=this[Ox("0x16")],e=new t(this[Ox("0xb")],this[Ox("0xc")],this[Ox("0x16")].editorConfig),n=e[Ox("0x15")];return e[Ox("0x3")](Ox("0x6")).to(this,Ox("0x1b"),this[Ox("0x19")].commentThread,"isReadOnly",n,Ox("0x5"),((t,e,n)=>!!n||t&&!e)),n.on(Ox("0xa"),((t,e)=>{this[Ox("0x1e")](Ox("0x20"),e),n[Ox("0x1f")][Ox("0xf")]("")})),n.on("cancel",(()=>this[Ox("0x8")]())),n[Ox("0x3")](Ox("0x12")).to(this[Ox("0x19")][Ox("0x0")],Ox("0xd")),e}}const Px=["acceptButton","element","ck-suggestion__info-name","isEnabled","ck-suggestion-","discardButton","set","_createButton",'<span class="ck-suggestion-color" style="background-color: ',"Accept suggestion","description","join","ck-annotation__info-time","type","innerText",'<span class="ck-suggestion-type">',"time","ck-suggestion--accept","getTemplate","isActive","innerHTML","title","ck-annotation__info-name","ck-suggestion__main","Discard suggestion","ck-annotation__info","push","commentsListView","extendTemplate","bind","</span>","value","span","commentThreadInputView","fire","ck-suggestion__actions","ck-annotation__actions","_descriptionElement","ck-suggestion--disabled-comments","check","userView","createElement","cancel","disableComments","author","color","setTemplate","ck-suggestion-wrapper--active",'"></span>',"ck-suggestion__info","formatDateTime","execute","ck-suggestion--discard","change:description","querySelector","div","map","render","content","</p>","commentThread","_model","ck-annotation","<p>","ck-suggestion-wrapper","ck-comment__info-time","children","ck-annotation__user","ck-annotation__content-wrapper","split","ck-suggestion__user","descriptionParts"];var Dx,jx;Dx=Px,jx=195,function(t){for(;--t;)Dx.push(Dx.shift())}(++jx);const Bx=function(t,e){return Px[t-=0]};class Ux extends Fx{constructor(e,n,o,r){super(e,n,o,r),this[Bx("0x1b")](Bx("0x22"),""),this[Bx("0x32")]("type").to(this,Bx("0x14"),(t=>t&&t[0]?t[0][Bx("0x22")]:"")),this[Bx("0x32")](Bx("0x1f")).to(this,"descriptionParts",this,Bx("0x28"),((t,e)=>{let n="";for(const e of t)n+=Bx("0xc")+Hx(e[Bx("0x7")],e[Bx("0x42")])+Bx("0x8");return e?n:(0,s.trimHtml)(n,{limit:140})})),this[Bx("0x3a")]=null,this.acceptButton=this[Bx("0x1c")](kr(e,Bx("0x1e")),t.icons[Bx("0x3c")],Bx("0x26"),"acceptSuggestion"),this[Bx("0x1a")]=this[Bx("0x1c")](kr(e,Bx("0x2d")),t.icons[Bx("0x3f")],Bx("0x1"),"discardSuggestion"),this[Bx("0x3d")]=new s.UserView(e,this[Bx("0xa")][Bx("0x41")]),this[Bx("0x3d")][Bx("0x31")]({attributes:{class:[Bx("0x13"),Bx("0x10")]}}),this[Bx("0x43")](this[Bx("0x27")]())}getTemplate(){const t=this.bindTemplate,e={tag:Bx("0x4"),attributes:{class:[Bx("0xd"),t.if(Bx("0x28"),Bx("0x44")),t.to("type",(t=>Bx("0x19")+t)),this._config[Bx("0x40")]&&Bx("0x3b")],"data-suggestion-id":this[Bx("0xa")].id,"data-thread-id":this[Bx("0xa")][Bx("0x9")].id,"data-author-id":this[Bx("0xa")][Bx("0x41")].id,tabindex:-1},children:[{tag:Bx("0x4"),attributes:{class:["ck-suggestion",Bx("0xb")]},children:[this[Bx("0x3d")],{tag:Bx("0x4"),attributes:{class:[Bx("0x2c"),"ck-annotation__main"]},children:[{tag:"div",attributes:{class:[Bx("0x46"),Bx("0x2e")]},children:[{tag:Bx("0x35"),children:[{text:this[Bx("0x3d")].name}],attributes:{class:[Bx("0x17"),Bx("0x2b")]}},{tag:Bx("0x25"),attributes:{datetime:t.to("createdAt"),class:[Bx("0xe"),Bx("0x21")]},children:[{text:t.to("createdAt",(t=>this._config[Bx("0x47")](t)))}]}]},{tag:Bx("0x4"),attributes:{class:[Bx("0x38"),Bx("0x39")]},children:[this[Bx("0x15")],this[Bx("0x1a")]]},{tag:"div",attributes:{class:[Bx("0x11")]}}]}]}]};return this[Bx("0x30")]&&this[Bx("0x36")]&&e[Bx("0xf")][Bx("0x2f")](this[Bx("0x30")],this[Bx("0x36")]),e}[Bx("0x6")](){super[Bx("0x6")](),this[Bx("0x3a")]=this[Bx("0x16")][Bx("0x3")](".ck-annotation__content-wrapper"),this[Bx("0x3a")][Bx("0x29")]=this[Bx("0x1f")],this.on(Bx("0x2"),((t,e,n)=>{this[Bx("0x3a")][Bx("0x29")]=n}))}[Bx("0x1c")](t,e,n,o){const s=new r.ButtonView(this.locale);return s[Bx("0x1b")]({label:t,icon:e,tooltip:!0}),s.extendTemplate({attributes:{class:n}}),s.on(Bx("0x0"),(()=>{this[Bx("0x37")](o,this[Bx("0xa")].id)})),s[Bx("0x32")](Bx("0x18")).to(this),s}}function Hx(t,e){let n="";return n+=t[Bx("0x12")]("*")[Bx("0x5")](((t,e)=>e%2!=0?Bx("0x24")+Gx(t)+Bx("0x33"):Gx(t)))[Bx("0x20")](""),e&&(n+=Bx("0x1d")+e[Bx("0x34")]+'" title="'+e[Bx("0x2a")]+Bx("0x45")),n}function Gx(t){const e=document[Bx("0x3e")](Bx("0x35"));return e[Bx("0x23")]=t,e[Bx("0x29")]}var Vx=n(596),zx=n.n(Vx);const Wx=["_createUIButton","change:previous","getRange","_disableComments","_viewToController","discardSuggestion","comments.maxThreadTotalWeight","reduce","actionView","PENDING_ACTION_SUGGESTION","PendingActions","isMultiRange","toMany","values","buttonView","head","getSuggestion","commands","source","destroy","Discard all suggestions","config","getAllAdjacentSuggestions","locale","createCommentThreadController","push","trackChanges.disableComments","_debouncedHandlers","getContainedElement","get","_updateController","requires","commentThread","unbind","change:isDirty","define","plugins","_destroyController","TrackChangesEditing","comments","filter","acceptAllSuggestions","some","from","_suggestionToController","suggestionUnloaded","set","acceptSuggestion","hasSuggestion","arrowView","suggestion-","discardSelectedSuggestions","remove","length","Accept all selected suggestions","descriptionParts","model","Annotations","_descriptionFactory","map","SuggestionThreadView","type","CommentView","change:activeAnnotations","getJoined","componentFactory","view","addSourceCollector","CommentsRepository","getByInnerView","isInContent","comments.maxCommentCharsWhenCollapsed","lowest","clear","acceptSelectedSuggestions","bind","isOn","TrackChangesUI","getRanges","cancel","comments.maxCommentsWhenCollapsed","switchbutton","keys","createAnnotation","_initializeController","separator","add","refreshSelectedViews","trackChanges.SuggestionThreadView","value","editing","listenTo","Discard all selected suggestions","isEnabled","trackChanges","Track changes","editor","pluginName","toViewElement","focus","EditorAnnotations","suggestionLoaded","delete","button","has","activeMarkers","commandName","previous"];var Kx,$x;Kx=Wx,$x=352,function(t){for(;--t;)Kx.push(Kx.shift())}(++$x);const qx=function(t,e){return Wx[t-=0]};class Xx extends t.Plugin{static get[qx("0x3")](){return[px,s.Users,qx("0x28"),"Annotations",qx("0x48")]}static get[qx("0x45")](){return qx("0x31")}constructor(t){super(t),this._suggestionToController=new Map,this[qx("0x54")]=new Map,this._debouncedHandlers=new Map;const e=this.editor.config;e.define(qx("0x3c"),Ux),e[qx("0x7")](qx("0x6a"),!1),this[qx("0x53")]=e[qx("0x1")]("trackChanges.disableComments")}init(){const t=this[qx("0x44")],e=t[qx("0x8")][qx("0x1")](px),n=t[qx("0x8")][qx("0x1")]("Annotations"),o=t[qx("0x8")][qx("0x1")]("EditorAnnotations"),r=t[qx("0x8")][qx("0x1")](qx("0x28"));t.ui[qx("0x25")][qx("0x3a")](qx("0x42"),(t=>this[qx("0x50")](t))),o[qx("0x27")]((()=>{const t=[];for(const[e,n]of Array[qx("0xf")](this[qx("0x10")])){const o=e[qx("0x66")](),r=[];for(const t of o){if(!t[qx("0x2a")])continue;if(t[qx("0x5b")]){r.push(...t[qx("0x32")]());continue}const e=t.getFirstRange();if(r.length>0){const t=r[0][qx("0x24")](e);if(t){r[0]=t;continue}}r.push(e)}t.push([n.view,r])}return t})),this[qx("0x3f")](e,qx("0x49"),((t,e)=>{let n=!1;const r=O((t=>{n||t?n&&t&&(this._destroyController(e),o[qx("0x3b")](),n=!1):(this[qx("0x38")](e),o[qx("0x3b")](),n=!0)}),10);this[qx("0x6b")][qx("0x12")](e,r),this[qx("0x3f")](e,qx("0x51"),((t,n,o,s)=>{e[qx("0x2a")]&&(null==o?(this[qx("0x2")](s.head),r(!1)):(this[qx("0x2")](o[qx("0x5f")]),r(!0)))})),null===e[qx("0x4f")]?r(!1):this[qx("0x2")](e[qx("0x5f")])})),this[qx("0x3f")](e,qx("0x11"),((t,e,n)=>{this.stopListening(e,qx("0x51")),this._debouncedHandlers[qx("0x1")](e).cancel(),this._debouncedHandlers.delete(e);const o=n?n[qx("0x5f")]:e,r=this[qx("0x10")][qx("0x1")](o);null!==n&&this[qx("0x2")](o),null===n&&r&&this._destroyController(e)})),this[qx("0x3f")](e,"suggestionChanged",((t,e)=>{this[qx("0x2")](e)})),this.listenTo(n,qx("0x23"),((t,n,o)=>{const r=Array[qx("0xf")](o,(t=>t.innerView))[qx("0xc")]((t=>this[qx("0x54")][qx("0x4c")](t))),s=[];for(const t of r){const e=this[qx("0x54")][qx("0x1")](t)[qx("0x1c")][qx("0x66")]();s[qx("0x69")](...e[qx("0x57")](((t,e)=>[...t,...e.getMarkerNames()]),[]))}e[qx("0x4d")]=s})),this.listenTo(r,"addComment",((t,{threadId:n,isFromAdapter:o})=>{if(o||!e[qx("0x14")](n))return;const r=e[qx("0x60")](n);this[qx("0x10")].get(r)[qx("0x26")][qx("0x47")]()}),{priority:qx("0x2c")})}[qx("0x50")](t){const n=(0,r.createDropdown)(t,r.SplitButtonView),o=this.editor[qx("0x61")][qx("0x1")](qx("0x42")),s=kr(t,qx("0x43"));n[qx("0x5e")][qx("0x12")]({tooltip:s,label:s,icon:zx()}),n[qx("0x5e")][qx("0x2f")](qx("0x30")).to(o,qx("0x3d")),n[qx("0x5e")].on("execute",(()=>o.execute()));const i=new e.Collection,a=[{type:qx("0x35"),model:{withText:!0,label:s,commandName:"trackChanges"}},{type:qx("0x39")},{type:qx("0x4b"),model:{withText:!0,label:kr(t,"Accept all suggestions"),commandName:qx("0xd")}},{type:qx("0x4b"),model:{withText:!0,label:kr(t,qx("0x1a")),commandName:qx("0x2e")}},{type:qx("0x4b"),model:{withText:!0,label:kr(t,qx("0x64")),commandName:"discardAllSuggestions"}},{type:qx("0x4b"),model:{withText:!0,label:kr(t,qx("0x40")),commandName:qx("0x17")}}];for(const t of a){const e={type:t.type};if(t[qx("0x1c")]){const n=new r.Model(t[qx("0x1c")]),o=this[qx("0x44")].commands[qx("0x1")](n[qx("0x4e")]);n.bind("isOn",qx("0x41")).to(o,qx("0x3d"),qx("0x41")),e.model=n}i[qx("0x3a")](e)}(0,r.addListToDropdown)(n,i);const x=a[qx("0xc")]((t=>null!=t[qx("0x1c")]))[qx("0x1f")]((t=>this[qx("0x44")][qx("0x61")][qx("0x1")](t[qx("0x1c")][qx("0x4e")])));return n[qx("0x5e")].actionView[qx("0x5")](qx("0x41")),n[qx("0x5e")][qx("0x15")][qx("0x5")](qx("0x41")),n[qx("0x5e")][qx("0x58")].bind(qx("0x41")).to(o,"isEnabled"),n.buttonView.arrowView[qx("0x2f")](qx("0x41"))[qx("0x5c")](x,qx("0x41"),((...t)=>t[qx("0xe")]((t=>t)))),n.on("execute",(t=>this[qx("0x44")].execute(t[qx("0x62")][qx("0x4e")]))),n}_initializeController(t){const e=this[qx("0x44")],n=e[qx("0x65")],o=e.plugins[qx("0x1")](qx("0x1d")),r=e[qx("0x8")][qx("0x1")](qx("0x28")),i=t[qx("0x66")]().filter((t=>t.isInContent)),a=e.plugins[qx("0x1")](s.Users).me,x=e[qx("0x61")][qx("0x1")](qx("0x13")),c=e.commands[qx("0x1")](qx("0x55")),l=n[qx("0x1")](qx("0x42"))[qx("0x20")],{CommentsListView:u,CommentThreadInputView:d}=e[qx("0x8")][qx("0x1")]("CommentsUI"),g=new l(e[qx("0x67")],t,a,{disableComments:this[qx("0x53")],editorConfig:n[qx("0x1")]("comments.editorConfig"),maxCommentsWhenCollapsed:n[qx("0x1")](qx("0x34")),maxThreadTotalWeight:n[qx("0x1")](qx("0x56")),maxCommentCharsWhenCollapsed:n[qx("0x1")](qx("0x2b")),formatDateTime:(0,s.getDateTimeFormatter)(n.get(qx("0x67"))),CommentView:n.get(qx("0xb"))[qx("0x22")],CommentsListView:u,CommentThreadInputView:d}),f=r[qx("0x68")](t[qx("0x4")],g),m=new wx(t,g,x,c,f);g[qx("0x1b")]=e[qx("0x8")].get(qx("0xa"))[qx("0x1e")].getDescriptions(i),this._suggestionToController[qx("0x12")](t,m),this._viewToController[qx("0x12")](g,m);const h=o.createAnnotationView(this[qx("0x44")][qx("0x67")],g);h[qx("0x2f")]("isDirty").to(g,"isDirty"),h.bind(qx("0x19")).to(g),h[qx("0x2f")](qx("0x21")).to(g,qx("0x21"),(t=>"suggestion-"+t));const p=o[qx("0x37")]({view:h,target:()=>{const t=i[0].getFirstMarker();if(!t)return null;const n=t[qx("0x52")]()[qx("0x0")]();return n&&!e[qx("0x3e")].mapper[qx("0x46")](n)?null:(0,s.getMarkerDomElement)(e.editing,t)||null},type:()=>qx("0x16")+m.view[qx("0x21")]});o[qx("0x3a")](p);const b=e.plugins[qx("0x1")](qx("0x5a"));let E;g.on(qx("0x6"),((t,e,n)=>{n?E=b[qx("0x3a")](kr(this[qx("0x44")][qx("0x67")],qx("0x59"))):(b[qx("0x18")](E),E=null)}))}_destroyController(t){const e=this.editor[qx("0x8")].get("Annotations"),n=this[qx("0x10")][qx("0x1")](t),o=n.view,r=e[qx("0x29")](o);r&&e[qx("0x18")](r),this[qx("0x10")][qx("0x4a")](t),this[qx("0x54")].delete(o),n[qx("0x63")](),o[qx("0x63")]()}[qx("0x2")](t){if(!t[qx("0x2a")]||!this[qx("0x10")][qx("0x4c")](t))return;const e=this[qx("0x44")][qx("0x8")].get(qx("0xa")),n=this[qx("0x10")][qx("0x1")](t),o=t[qx("0x66")]();n[qx("0x26")][qx("0x1b")]=e[qx("0x1e")].getDescriptions(o)}[qx("0x63")](){super[qx("0x63")]();for(const t of this[qx("0x10")][qx("0x36")]())this[qx("0x9")](t);for(const t of this[qx("0x6b")][qx("0x5d")]())t[qx("0x33")]();this[qx("0x6b")][qx("0x2d")]()}}var Jx,Qx,Yx=["addSuggestion","get","getSuggestion","editor","plugins","getSuggestions","requires","pluginName","TrackChanges","Comments","addSuggestionData","adapter"];Jx=Yx,Qx=170,function(t){for(;--t;)Jx.push(Jx.shift())}(++Qx);var Zx=function(t,e){return Yx[t-=0]};class tc extends t.Plugin{static get[Zx("0x4")](){return[px,Xx,Zx("0x7")]}static get[Zx("0x5")](){return Zx("0x6")}set[Zx("0x9")](t){this.editor[Zx("0x2")][Zx("0xb")](px)[Zx("0x9")]=t}get adapter(){return this[Zx("0x1")][Zx("0x2")][Zx("0xb")](px)[Zx("0x9")]}[Zx("0xa")](t){return this.editor[Zx("0x2")][Zx("0xb")](px)[Zx("0x8")](t)}[Zx("0x3")](t){return this[Zx("0x1")][Zx("0x2")][Zx("0xb")](px)[Zx("0x3")](t)}[Zx("0x0")](t){return this.editor[Zx("0x2")].get(px)[Zx("0x0")](t)}}const ec=["name","discardAllSuggestions","execute","push","addSuggestionData","editorCreator","Users","data","getUser","reduce","getDataWithDiscardedSuggestions","builtinPlugins","trackChangesData","init","useAnonymousUser","pluginName","Autosave","_adapter","acceptAllSuggestions","define","includes","plugins","initialData","RealTimeCollaborativeComments","editor","get","getSuggestions","names","constructor","users","getRootNames","track-changes-data-invalid-editor-creator","TrackChangesEditing","every","config","toolbar","function","trackChangesData.editorCreator","has","TrackChangesDataGetter","add","destroy","create","RealTimeCollaborativeEditing","CommentsRepository","string","set","document","TrackChangesData","from","requires","filter","concat"];var nc,oc;nc=ec,oc=494,function(t){for(;--t;)nc.push(nc.shift())}(++oc);const rc=function(t,e){return ec[t-=0]},sc=[rc("0x5"),"context",rc("0x12")],ic=[rc("0x1a"),rc("0x6"),"RealTimeCollaborativeTrackChanges",rc("0x34")];class ac extends t.Plugin{static get[rc("0x21")](){return[px]}static get[rc("0x33")](){return rc("0x1f")}[rc("0x31")](){const t=this[rc("0x7")];if(t[rc("0x11")][rc("0x2")](rc("0x14"),(e=>t[rc("0xb")][rc("0x19")]("",e))),rc("0x13")!=typeof t[rc("0x11")].get(rc("0x30"))[rc("0x29")])throw new e.CKEditorError(rc("0xe"))}getDataWithAcceptedSuggestions(t){return cc(this[rc("0x7")],!0,t)}[rc("0x2e")](t){return cc(this[rc("0x7")],!1,t)}}class xc extends t.Plugin{static get pluginName(){return rc("0x16")}[rc("0x31")](){this.result="end",this[rc("0x7")][rc("0x4")].get(rc("0x1b"))[rc("0x0")]={getCommentThread:()=>new Promise((()=>{}))},this[rc("0x7")][rc("0x4")].get(rc("0xf"))[rc("0x0")]=null}}async function cc(t,e,n){const o=function(t){const e={};for(const n of t.config[rc("0xa")]())sc[rc("0x3")](n)||(e[n]=t[rc("0x11")].get(n));const n=t[rc("0xb")][rc("0x2f")]||[],o=e.extraPlugins||[];delete e.extraPlugins;const r=n[rc("0x23")](e[rc("0x4")])[rc("0x23")](o).map((t=>rc("0x1c")==typeof t?n.find((e=>e.pluginName==t)):t)),s=Array[rc("0x20")](new Set(r));return e[rc("0x4")]=s[rc("0x22")]((t=>lc(t,new Set))),e[rc("0x4")][rc("0x27")](xc),e.plugins[rc("0x27")](px),e}(t),r=document.createDocumentFragment(),s=t[rc("0x11")][rc("0x8")](rc("0x30"))[rc("0x29")],i=await s(o,(()=>function(t){const e=document.createElement("div");return t.appendChild(e),e}(r)));!function(t,e){const n=t.model[rc("0x1e")][rc("0xd")]()[rc("0x2d")](((e,n)=>(e[n]=t.data.get({rootName:n}),e)),{}),o=t[rc("0x4")].get(rc("0x2a"))[rc("0xc")].map((t=>({id:t.id}))),r=t[rc("0x4")].get(rc("0xf"))[rc("0x9")]({skipNotAttached:!0,toJSON:!0}),s=e[rc("0x4")][rc("0x8")]("Users"),i=e[rc("0x4")][rc("0x8")](rc("0xf"));for(const t of o)s[rc("0x2c")](t.id)||s.addUser(t);s.me||s[rc("0x32")]();for(const t of r)i[rc("0x28")](t);e[rc("0x2b")][rc("0x1d")](n)}(t,i),i[rc("0x26")](rc(e?"0x1":"0x25"));const a=i[rc("0x2b")][rc("0x8")](n);return await i[rc("0x18")](),a}function lc(t,e){if(e[rc("0x15")](t))return!0;e[rc("0x17")](t);const n=rc("0x13")==typeof t?t.pluginName||t[rc("0x24")]:t;return(!n||!ic[rc("0x3")](n))&&(!t[rc("0x21")]||t.requires[rc("0x10")]((t=>lc(t,e))))}})(),(window.CKEditor5=window.CKEditor5||{}).trackChanges=o})();
|