@ckeditor/ckeditor5-track-changes 34.0.0 → 34.1.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 +2 -2
- package/build/track-changes.js +2 -2
- package/build/translations/nl.js +1 -1
- package/build/translations/zh-cn.js +1 -1
- package/lang/translations/nl.po +9 -9
- package/lang/translations/zh-cn.po +4 -4
- 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/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/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/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/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 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_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'},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 s=t[o];if(void 0!==s)return s.exports;var i=t[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:()=>hr,TrackChanges:()=>jr,TrackChangesData:()=>Wr});var e=n(704),t=n(209),s=n(273),i=n(417),r=n(492),a=n(995);const c=["execute","value","_enabledCommands","clearForceDisabled","isEnabled","refresh","has","editor","_disableUnsupportedCommands","affectsData","forceDisabled","commands","TrackChangesCommand","_enableCommands"];var l,g;l=c,g=235,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("0x5")]=t,this[u("0x4")]=!1,this[u("0x8")]()}[u("0x8")](){this[u("0x7")]=!0}[u("0x3")](){this[u("0x4")]=!this[u("0x4")],this[u("0x4")]?this[u("0xb")]():this._enableCommands()}_disableUnsupportedCommands(){for(const e of this[u("0xa")][u("0x0")][u("0x0")]())e[u("0xc")]&&!this[u("0x5")][u("0x9")](e)&&e[u("0xd")](u("0x1"))}[u("0x2")](){for(const e of this[u("0xa")][u("0x0")][u("0x0")]())e[u("0xc")]&&!this[u("0x5")][u("0x9")](e)&&e[u("0x6")](u("0x1"))}}const m=["get","TrackChangesEditing","execute","acceptSuggestion","track-changes-accept-suggestion-not-found","isEnabled","_suggestions","refresh","plugins"];var h,f;h=m,f=414,function(e){for(;--e;)h.push(h.shift())}(++f);const p=function(e,t){return m[e-=0]};class b extends e.Command{constructor(e,t){super(e),this._suggestions=t,this[p("0x7")]()}[p("0x7")](){this[p("0x5")]=!0}[p("0x2")](e){const n=this[p("0x6")][p("0x0")](e);if(!n)throw new t.CKEditorError(p("0x4"),this);this.editor[p("0x8")][p("0x0")](p("0x1"))[p("0x3")](n)}}const x=["track-changes-discard-suggestion-not-found","isEnabled","execute","plugins","get","_suggestions","TrackChangesEditing","refresh"];var y,C;y=x,C=164,function(e){for(;--e;)y.push(y.shift())}(++C);const _=function(e,t){return x[e-=0]};class k extends e.Command{constructor(e,t){super(e),this[_("0x1")]=t,this.refresh()}[_("0x3")](){this[_("0x5")]=!0}[_("0x6")](e){const n=this[_("0x1")][_("0x0")](e);if(!n)throw new t.CKEditorError(_("0x4"),this);this.editor[_("0x7")].get(_("0x2")).discardSuggestion(n)}}var v,E,T=["deletion","type"];v=T,E=264,function(e){for(;--e;)v.push(v.shift())}(++E);var R=function(e,t){return T[e-=0]};function S(e){return e.sort(((e,t)=>R("0x0")==e[R("0x1")]&&R("0x0")!=t[R("0x1")]?-1:"deletion"!=e[R("0x1")]&&R("0x0")==t.type?1:0))}const w=["execute","editor","change","model","refresh","from","_acceptSuggestionCommand","_suggestions","isInContent","some","isEnabled","values"];var A,I;A=w,I=140,function(e){for(;--e;)A.push(A.shift())}(++I);const M=function(e,t){return w[e-=0]};class N extends e.Command{constructor(e,t,n){super(e),this[M("0xa")]=t,this[M("0xb")]=n,this[M("0x8")]()}[M("0x8")](){const e=this[M("0xa")];this[M("0x2")]=e[M("0x2")]&&Array.from(this[M("0xb")][M("0x3")]())[M("0x1")]((e=>e.isInContent))}[M("0x4")](){this[M("0x5")][M("0x7")][M("0x6")]((()=>{const e=S(Array[M("0x9")](this._suggestions[M("0x3")]()));for(const t of e)t[M("0x0")]&&this[M("0xa")][M("0x4")](t.id)}))}}const F=["getRange","from","isTouching","start","isCollapsed","add","isIntersecting","isInContent","getRanges","end"];var P,O;P=F,O=253,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("0x8")](e[L("0x5")]()),o=new Set;for(const s of t)if(s[L("0x4")])for(const t of n)for(const n of s.getMarkers()){const i=n[L("0x7")]();(t[L("0x3")](i)||e[L("0x1")]&&!s.isMultiRange&&s.next&&i[L("0x6")][L("0x9")](t[L("0x0")]))&&o[L("0x2")](s)}return o}const j=["refresh","change","_acceptSuggestionCommand","isEnabled","_selectedSuggestions","execute","model","editor","_suggestions","from","values"];var D,U;D=j,U=135,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("0xa")]=t,this[H("0x5")]=n,this[H("0x1")]=new Set,this[H("0x8")]()}[H("0x8")](){const e=this[H("0xa")],t=this.editor[H("0x3")].document.selection,n=Array[H("0x6")](this[H("0x5")][H("0x7")]());this[H("0x1")]=B(t,n),this.isEnabled=e[H("0x0")]&&!!this._selectedSuggestions.size}[H("0x2")](){this[H("0x4")][H("0x3")][H("0x9")]((()=>{const e=S(Array[H("0x6")](this[H("0x1")]));for(const t of e)this[H("0xa")][H("0x2")](t.id)}))}}const z=["model","change","some","_suggestions","isEnabled","isInContent","refresh","_discardSuggestionCommand","values","editor","execute"];var G,W;G=z,W=243,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("0x6")]=t,this[q("0x2")]=n,this[q("0x5")]()}[q("0x5")](){const e=this[q("0x6")];this[q("0x3")]=e[q("0x3")]&&Array.from(this[q("0x2")][q("0x7")]())[q("0x1")]((e=>e[q("0x4")]))}[q("0x9")](){this[q("0x8")][q("0xa")][q("0x0")]((()=>{for(const e of this[q("0x2")][q("0x7")]())e[q("0x4")]&&this[q("0x6")].execute(e.id)}))}}const K=["from","editor","model","_discardSuggestionCommand","_selectedSuggestions","refresh","_suggestions","isEnabled","selection","document","values","size","execute"];var X,Q;X=K,Q=231,function(e){for(;--e;)X.push(X.shift())}(++Q);const J=function(e,t){return K[e-=0]};class Y extends e.Command{constructor(e,t,n){super(e),this[J("0x6")]=t,this[J("0x9")]=n,this[J("0x7")]=new Set,this[J("0x8")]()}[J("0x8")](){const e=this[J("0x6")],t=this[J("0x4")][J("0x5")][J("0xc")][J("0xb")],n=Array[J("0x3")](this[J("0x9")][J("0x0")]());this[J("0x7")]=B(t,n),this.isEnabled=e[J("0xa")]&&!!this[J("0x7")][J("0x1")]}[J("0x2")](){this.editor[J("0x5")].change((()=>{for(const e of this[J("0x7")])this[J("0x6")][J("0x2")](e.id)}))}}const Z=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 se=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 re=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=Z,ae.prototype.delete=oe,ae.prototype.get=se,ae.prototype.has=ie,ae.prototype.set=re;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 he="object"==typeof self&&self&&self.Object===Object&&self;const fe=me||he||Function("return this")();const pe=fe.Symbol;var be=Object.prototype,xe=be.hasOwnProperty,ye=be.toString,Ce=pe?pe.toStringTag:void 0;const _e=function(e){var t=xe.call(e,Ce),n=e[Ce];try{e[Ce]=void 0;var o=!0}catch(e){}var s=ye.call(e);return o&&(t?e[Ce]=n:delete e[Ce]),s};var ke=Object.prototype.toString;const ve=function(e){return ke.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)?_e(e):ve(e)};const Re=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};const Se=function(e){if(!Re(e))return!1;var t=Te(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t};const we=fe["__core-js_shared__"];var Ae,Ie=(Ae=/[^.]+$/.exec(we&&we.keys&&we.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!(!Re(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(fe,"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 Xe=Object.prototype.hasOwnProperty;const Qe=function(e){var t=this.__data__;return Ge?void 0!==t[e]:Xe.call(t,e)};const Je=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 Ye(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])}}Ye.prototype.clear=We,Ye.prototype.delete=qe,Ye.prototype.get=Ke,Ye.prototype.has=Qe,Ye.prototype.set=Je;const Ze=Ye;const et=function(){this.size=0,this.__data__={hash:new Ze,map:new(ze||ce),string:new Ze}};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 st=function(e){return nt(this,e).get(e)};const it=function(e){return nt(this,e).has(e)};const rt=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=st,at.prototype.has=it,at.prototype.set=rt;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 ht=function(e,t,n){"__proto__"==t&&mt?mt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n};var ft=Object.prototype.hasOwnProperty;const pt=function(e,t,n){var o=e[t];ft.call(e,t)&&ee(o,n)&&(void 0!==n||t in e)||ht(e,t,n)};const bt=function(e,t,n,o){var s=!n;n||(n={});for(var i=-1,r=t.length;++i<r;){var a=t[i],c=o?o(n[a],e[a],a,n,e):void 0;void 0===c&&(c=e[a]),s?ht(n,a,c):pt(n,a,c)}return n};const xt=function(e,t){for(var n=-1,o=Array(e);++n<e;)o[n]=t(n);return o};const yt=function(e){return null!=e&&"object"==typeof e};const Ct=function(e){return yt(e)&&"[object Arguments]"==Te(e)};var _t=Object.prototype,kt=_t.hasOwnProperty,vt=_t.propertyIsEnumerable;const Et=Ct(function(){return arguments}())?Ct:function(e){return yt(e)&&kt.call(e,"callee")&&!vt.call(e,"callee")};const Tt=Array.isArray;const Rt=function(){return!1};var St="object"==typeof exports&&exports&&!exports.nodeType&&exports,wt=St&&"object"==typeof module&&module&&!module.nodeType&&module,At=wt&&wt.exports===St?fe.Buffer:void 0;const It=(At?At.isBuffer:void 0)||Rt;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 yt(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),s=!n&&!o&&It(e),i=!n&&!o&&!s&&Vt(e),r=n||o||s||i,a=r?xt(e.length,String):[],c=a.length;for(var l in e)!t&&!zt.call(e,l)||r&&("length"==l||s&&("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 Xt=Object.prototype.hasOwnProperty;const Qt=function(e){if(!qt(e))return Kt(e);var t=[];for(var n in Object(e))Xt.call(e,n)&&"constructor"!=n&&t.push(n);return t};const Jt=function(e){return null!=e&&Ft(e.length)&&!Se(e)};const Yt=function(e){return Jt(e)?Gt(e):Qt(e)};const Zt=function(e,t){return e&&bt(t,Yt(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(!Re(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 Jt(e)?Gt(e,!0):nn(e)};const sn=function(e,t){return e&&bt(t,on(t),e)};var rn="object"==typeof exports&&exports&&!exports.nodeType&&exports,an=rn&&"object"==typeof module&&module&&!module.nodeType&&module,cn=an&&an.exports===rn?fe.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,s=0,i=[];++n<o;){var r=e[n];t(r,n,e)&&(i[s++]=r)}return i};const mn=function(){return[]};var hn=Object.prototype.propertyIsEnumerable,fn=Object.getOwnPropertySymbols;const pn=fn?function(e){return null==e?[]:(e=Object(e),dn(fn(e),(function(t){return hn.call(e,t)})))}:mn;const bn=function(e,t){return bt(e,pn(e),t)};const xn=function(e,t){for(var n=-1,o=t.length,s=e.length;++n<o;)e[s+n]=t[n];return e};const yn=$t(Object.getPrototypeOf,Object);const Cn=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)xn(t,pn(e)),e=yn(e);return t}:mn;const _n=function(e,t){return bt(e,Cn(e),t)};const kn=function(e,t,n){var o=t(e);return Tt(e)?o:xn(o,n(e))};const vn=function(e){return kn(e,Yt,pn)};const En=function(e){return kn(e,on,Cn)};const Tn=Ve(fe,"DataView");const Rn=Ve(fe,"Promise");const Sn=Ve(fe,"Set");const wn=Ve(fe,"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(Rn),Bn=Fe(Sn),jn=Fe(wn),Dn=Te;(Tn&&Dn(new Tn(new ArrayBuffer(1)))!=Fn||ze&&Dn(new ze)!=An||Rn&&Dn(Rn.resolve())!=In||Sn&&Dn(new Sn)!=Mn||wn&&Dn(new wn)!=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=fe.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,Xn=Kn?Kn.valueOf:void 0;const Qn=function(e){return Xn?Object(Xn.call(e)):{}};const Jn=function(e,t){var n=t?Gn(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)};const Yn=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 Jn(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 Qn(e)}};var Zn=Object.create;const eo=function(){function e(){}return function(t){if(!Re(t))return{};if(Zn)return Zn(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(yn(e))};const no=function(e){return yt(e)&&"[object Map]"==Un(e)};var oo=Ut&&Ut.isMap;const so=oo?Lt(oo):no;const io=function(e){return yt(e)&&"[object Set]"==Un(e)};var ro=Ut&&Ut.isSet;const ao=ro?Lt(ro):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,s,i,r){var a,c=1&n,l=2&n,g=4&n;if(o&&(a=i?o(t,s,i,r):o(t)),void 0!==a)return a;if(!Re(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?_n(t,sn(a,t)):bn(t,Zt(a,t))}else{if(!uo[d])return i?t:{};a=Yn(t,d,c)}}r||(r=new ut);var h=r.get(t);if(h)return h;r.set(t,a),ao(t)?t.forEach((function(s){a.add(e(s,n,o,s,t,r))})):so(t)&&t.forEach((function(s,i){a.set(i,e(s,n,o,i,t,r))}));var f=u?void 0:(g?l?En:vn:l?on:Yt)(t);return dt(f||t,(function(s,i){f&&(s=t[i=s]),pt(a,i,e(s,n,o,i,t,r))})),a};const ho=function(e){return mo(e,5)};const fo=function(e){return"symbol"==typeof e||yt(e)&&"[object Symbol]"==Te(e)};var po=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,bo=/^\w*$/;const xo=function(e,t){if(Tt(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!fo(e))||(bo.test(e)||!po.test(e)||null!=t&&e in Object(t))};function yo(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var o=arguments,s=t?t.apply(this,o):o[0],i=n.cache;if(i.has(s))return i.get(s);var r=e.apply(this,o);return n.cache=i.set(s,r)||i,r};return n.cache=new(yo.Cache||ct),n}yo.Cache=ct;const Co=yo;var _o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ko=/\\(\\)?/g;const vo=function(e){var t=Co(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(_o,(function(e,n,o,s){t.push(o?s.replace(ko,"$1"):n||e)})),t}));const Eo=function(e,t){for(var n=-1,o=null==e?0:e.length,s=Array(o);++n<o;)s[n]=t(e[n],n,e);return s};var To=pe?pe.prototype:void 0,Ro=To?To.toString:void 0;const So=function e(t){if("string"==typeof t)return t;if(Tt(t))return Eo(t,e)+"";if(fo(t))return Ro?Ro.call(t):"";var n=t+"";return"0"==n&&1/t==-Infinity?"-0":n};const wo=function(e){return null==e?"":So(e)};const Ao=function(e,t){return Tt(e)?e:xo(e,t)?[e]:vo(wo(e))};const Io=function(e){if("string"==typeof e||fo(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t};const Mo=function(e,t,n,o){if(!Re(e))return e;for(var s=-1,i=(t=Ao(t,e)).length,r=i-1,a=e;null!=a&&++s<i;){var c=Io(t[s]),l=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(s!=r){var g=a[c];void 0===(l=o?o(g,c,a):void 0)&&(l=Re(g)?g:Nt(t[s+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,s,i){var r=1&n,a=e.length,c=t.length;if(a!=c&&!(r&&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 h=e[u],f=t[u];if(o)var p=r?o(f,h,u,t,e,i):o(h,f,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)&&(h===e||s(h,e,n,o,i)))return m.push(t)}))){d=!1;break}}else if(h!==f&&!s(h,f,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,s,i,r){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=r.get(e);if(l)return l==t;o|=2,r.set(e,t);var g=Do(a(e),a(t),o,s,i,r);return r.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,s,i){var r=1&n,a=vn(e),c=a.length;if(c!=vn(t).length&&!r)return!1;for(var l=c;l--;){var g=a[l];if(!(r?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 h=r;++l<c;){var f=e[g=a[l]],p=t[g];if(o)var b=r?o(p,f,g,t,e,i):o(f,p,g,e,t,i);if(!(void 0===b?f===p||s(f,p,n,o,i):b)){m=!1;break}h||(h="constructor"==g)}if(m&&!h){var x=e.constructor,y=t.constructor;x==y||!("constructor"in e)||!("constructor"in t)||"function"==typeof x&&x instanceof x&&"function"==typeof y&&y instanceof y||(m=!1)}return i.delete(e),i.delete(t),m};var $o="[object Arguments]",Ko="[object Array]",Xo="[object Object]",Qo=Object.prototype.hasOwnProperty;const Jo=function(e,t,n,o,s,i){var r=Tt(e),a=Tt(t),c=r?Ko:Un(e),l=a?Ko:Un(t),g=(c=c==$o?Xo:c)==Xo,u=(l=l==$o?Xo:l)==Xo,d=c==l;if(d&&It(e)){if(!It(t))return!1;r=!0,g=!1}if(d&&!g)return i||(i=new ut),r||Vt(e)?Do(e,t,n,o,s,i):Go(e,t,c,n,o,s,i);if(!(1&n)){var m=g&&Qo.call(e,"__wrapped__"),h=u&&Qo.call(t,"__wrapped__");if(m||h){var f=m?e.value():e,p=h?t.value():t;return i||(i=new ut),s(f,p,n,o,i)}}return!!d&&(i||(i=new ut),qo(e,t,n,o,s,i))};const Yo=function e(t,n,o,s,i){return t===n||(null==t||null==n||!yt(t)&&!yt(n)?t!=t&&n!=n:Jo(t,n,o,s,e,i))};const Zo=function(e,t){return Yo(e,t)};const es=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0};const ts=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 ns=function(e,t,n){var o=-1,s=e.length;t<0&&(t=-t>s?0:s+t),(n=n>s?s:n)<0&&(n+=s),s=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(s);++o<s;)i[o]=e[o+t];return i};const os=function(e,t){return t.length<2?e:ts(e,ns(t,0,-1))};const ss=function(e,t){return t=Ao(t,e),null==(e=os(e,t))||delete e[Io(es(t))]};const is=function(e,t){return null==e||ss(e,t)},rs=["subType","from","getAllAdjacentSuggestions","toJSON","removeMarker","next","accept","addMarkerName","head","type","removeAttribute","isMultiRange","nodeBefore","length","_onAttributesChange","data","clear","getContainedElement","previous","_model","onAccept","substr","getFirstRange","isIntersectingWithRange","getMarkerNames","isInContent","_onAccept","getRanges","commentThread","createdAt","removeMarkers","get","isIntersecting","onAttributesChange","setAttribute","set","hasComments","getFirstMarker","onDiscard","suggestion:","addMarker","map","start","author","addRange","_markerNames","_onDiscard","change","getItems","add","filter","split","getMultiRangeId","getMarkers","delete","attributes","push","getRange","nodeAfter","size"];var as,cs;as=rs,cs=210,function(e){for(;--e;)as.push(as.shift())}(++cs);const ls=function(e,t){return rs[e-=0]};class gs{constructor(e,t){this.id=t.id,this[ls("0x27")]=t[ls("0x27")],this.subType=t[ls("0x1e")]||null,this.author=t[ls("0xd")],this[ls("0x2d")]=null,this[ls("0x31")]=e,this[ls("0x38")]=t[ls("0x32")],this[ls("0x10")]=t[ls("0x8")],this._onAttributesChange=t[ls("0x3")],this._markerNames=new Set,this[ls("0x5")]("createdAt",null),this[ls("0x5")](ls("0x19"),t.attributes||{}),this[ls("0x5")](ls("0x30"),null),this[ls("0x5")](ls("0x23"),null),this.set(ls("0x3a"),null),this.set("_saved",!1),this.decorate(ls("0x24")),this.decorate("discard")}get[ls("0x26")](){let e=this;for(;e[ls("0x30")];)e=e[ls("0x30")];return e}get[ls("0x6")](){return!!this[ls("0x3a")]&&this.commentThread[ls("0x2b")]>0}get[ls("0x29")](){return 0!=this._markerNames[ls("0x1d")]&&6==Array[ls("0x1f")](this[ls("0xf")])[0][ls("0x15")](":")[ls("0x2b")]}get[ls("0x37")](){return null!==this.getFirstMarker()}addMarkerName(e){this[ls("0xf")][ls("0x13")](e)}[ls("0x36")](){return Array[ls("0x1f")](this[ls("0xf")])}[ls("0x17")](){return this[ls("0x36")]().map((e=>this[ls("0x31")].markers[ls("0x1")](e)))[ls("0x14")]((e=>e))}getFirstMarker(){return this.getMarkers()[0]||null}[ls("0x0")](){this._model[ls("0x11")]((e=>{for(const t of this[ls("0x17")]())e[ls("0x22")](t)})),this[ls("0xf")][ls("0x2e")]()}[ls("0x22")](e){this[ls("0x31")][ls("0x11")]((t=>{t.removeMarker(e)})),this._markerNames[ls("0x18")](e)}[ls("0xe")](e){const t=ls("0x9")+this[ls("0x27")]+":"+this.subType+":"+this.id+":"+this[ls("0xd")].id+":"+gs.getMultiRangeId();this[ls("0x25")](t),this._model[ls("0x11")]((n=>{n[ls("0xa")](t,{range:e,usingOperation:!0,affectsData:!0})}))}[ls("0x35")](e){for(const t of this[ls("0x39")]())if(t[ls("0x2")](e))return!0;return!1}getRanges(){return this.getMarkers()[ls("0xb")]((e=>e.getRange()))}[ls("0x12")](){return this[ls("0x39")]().reduce(((e,t)=>[...e,...t[ls("0x12")]()]),[])}[ls("0x34")](){return this[ls("0x7")]()[ls("0x1b")]()}[ls("0x2f")](){const e=this[ls("0x39")]();if(1!=e[ls("0x2b")])return null;const t=e[0],n=t[ls("0xc")][ls("0x1c")],o=t.end[ls("0x2a")];return n instanceof r.Element?n!=o?null:n:null}[ls("0x24")](){this._onAccept(this[ls("0x39")](),this[ls("0x2d")],this[ls("0x19")]),this[ls("0x0")]()}discard(){this[ls("0x10")](this[ls("0x39")](),this[ls("0x2d")],this.attributes),this[ls("0x0")]()}[ls("0x20")](){const e=[];let t=this.head;for(;t;)e[ls("0x1a")](t),t=t[ls("0x23")];return e}[ls("0x4")](e,t){const n=ho(this[ls("0x19")]);No(n,e,t),Zo(n,this[ls("0x19")])||(this[ls("0x19")]=n,this[ls("0x2c")](n))}[ls("0x28")](e){const t=ho(this[ls("0x19")]);is(t,e),Zo(t,this.attributes)||(this.attributes=t,this[ls("0x2c")](this[ls("0x19")]))}[ls("0x21")](){return{id:this.id,type:this[ls("0x1e")]?this[ls("0x27")]+":"+this.subType:this[ls("0x27")],authorId:this[ls("0xd")].id,createdAt:this[ls("0x3b")],hasComments:this[ls("0x6")],data:this[ls("0x2d")],attributes:this[ls("0x19")]}}static[ls("0x16")](){return(0,t.uid)()[ls("0x33")](1,5)}}(0,t.mix)(gs,t.ObservableMixin);class us{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 s=!1;for(const e of this._customCallbacks){const n=e(o);if(n){n.type&&t.push(n),s=!0;break}}if(!s){this._addDescriptionItems(t,o);const s=e[n+1];if(s&&!o.getFirstRange().end.isEqual(s.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 s=t.item,i=e[e.length-1];if(s.is("textProxy"))i&&i.type.indexOf("Container")>-1&&e.pop(),i&&"text"==i.type?i[o]+=s.data:e.push({type:"text",add:"add"==o?s.data:"",remove:"remove"==o?s.data:""});else if(this._schema.isObject(s)){if(i&&i.type.indexOf("Container")>-1&&e.pop(),"elementEnd"==t.type)continue;i&&i.type==o+"Object"&&i.name==s.name?i.quantity++:e.push({type:o+"Object",name:s.name,quantity:1}),n.skip((e=>!("elementEnd"==e.type&&e.item==s)))}else if(this._schema.checkChild(s,"$text")||s.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?s.nextSibling&&!this._schema.isObject(s.nextSibling)?s.nextSibling:null:s.previousSibling&&!this._schema.isObject(s.previousSibling)?s.previousSibling:null,s.isEmpty||n&&n.isEmpty){const t=n&&n.isEmpty?n.name:s.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:s.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}}class ds 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 s=o.value;o.value||(s="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,s)));e.model.change((()=>{for(const e of i)n.markBlockFormat(e,{commandName:"alignment",commandParams:[{value:s}]})}))})),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 ms=["isAtEnd","bindElementToMarker","writer","markerRange","toViewElement","type","push","isLimit","addClass","getAttribute","listItem","mapper","ck-suggestion-marker-","model","createUIElement","item","nextSibling","element","plugins","activeMarkers","addHighlight","markerName","getItems","getWalker","includes","toViewPosition","isContent","get","TrackChangesEditing","hasAttribute","insert","isBlock","span","elementEnd","test","schema","listIndent","previousPosition"];var hs,fs;hs=ms,fs=476,function(e){for(;--e;)hs.push(hs.shift())}(++fs);const ps=function(e,t){return ms[e-=0]};function bs(e,t,n){const o=[];for(const s of t[ps("0x2")]())s[ps("0x9")](e)&&o.push(n.createRangeOn(s));return o}function xs(e){const t=[];if(e.is(ps("0x23"),ps("0x1c"))){let n=e[ps("0x22")];for(;n&&n.is(ps("0x23"),ps("0x1c"))&&n[ps("0x1b")](ps("0x10"))>0;)t[ps("0x18")](n),n=n.nextSibling}return t}function ys(e,t,{showActiveMarker:n=!0}={}){const o=e[ps("0x24")][ps("0x7")](ps("0x8"));return(s,i,r)=>{if(!r.consumable[ps("0xe")](i[ps("0x15")],s.name))return;const a=i[ps("0x15")][ps("0x3")](),c=i.markerRange.start,l=e[ps("0x1f")][ps("0xf")];let g=null,u=null,d=!1,m=!1;for(const e of a){const t=e[ps("0x21")];d=d||l[ps("0x6")](t);const n=r[ps("0x1d")][ps("0x16")](t);if(n&&n.getCustomProperty(ps("0x0")))return;ps("0xd")==e[ps("0x17")]&&l[ps("0xb")](t)&&!l[ps("0x19")](t)&&(t.nextSibling||c[ps("0x12")]?g&&g.parent==t||(g=t,h(e[ps("0x11")]),m=!0):u=u||e[ps("0x11")])}function h(e){const s=r[ps("0x14")][ps("0x20")](ps("0xc"),{class:ps("0x1e")+t}),a=r[ps("0x1d")][ps("0x5")](e);n&&o[ps("0x25")][ps("0x4")](i.markerName)&&r[ps("0x14")][ps("0x1a")]("ck-suggestion-marker--active",s),r.writer[ps("0xa")](a,s),r[ps("0x1d")][ps("0x13")](s,i[ps("0x1")])}d||m||!u||h(u)}}const Cs=["BoldEditing","ItalicEditing","UnderlineEditing","CodeEditing","StrikethroughEditing","SubscriptEditing","SuperscriptEditing"];class _s extends e.Plugin{afterInit(){const e=this.editor,t=e.model,n=e.plugins.get("TrackChangesEditing"),{t:o}=e.locale;for(const o of Cs){if(!e.plugins.has(o))continue;const s=o.slice(0,-7).toLowerCase(),i=e.commands.get(s);n.enableCommand(s,((e,o={})=>{const r=t.document.selection;if(r.isCollapsed)return void e(o);const a=void 0!==o.forceValue?o.forceValue:!i.value;t.change((()=>{const e=Array.from(r.getRanges());for(const o of e){const e=a?[o]:bs(s,o,t);for(const t of e)n.markInlineFormat(t,{commandName:s,commandParams:[{forceValue:a}]})}}))}))}function s(e,t){n._descriptionFactory.registerDescriptionCallback((n=>{const{data:s}=n;if(s&&s.commandName===e)return s.commandParams[0].forceValue?{type:"format",content:o("*Format:* %0",t)}:{type:"format",content:o("*Remove format:* %0",t)}}))}s("bold",o({string:"bold",id:"FORMAT_BOLD"})),s("italic",o({string:"italic",id:"FORMAT_ITALIC"})),s("underline",o({string:"underline",id:"FORMAT_UNDERLINE"})),s("code",o({string:"code",id:"FORMAT_CODE"})),s("strikethrough",o({string:"strikethrough",id:"FORMAT_STRIKETHROUGH"})),s("subscript",o({string:"subscript",id:"FORMAT_SUBSCRIPT"})),s("superscript",o({string:"superscript",id:"FORMAT_SUPERSCRIPT"}))}}class ks 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,s={})=>{const i=this.editor.model.document.selection,r=s&&void 0!==s.forceValue?s.forceValue:!o.value;let a=[];if(r){const t=Array.from(i.getSelectedBlocks()).filter((e=>vs(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=Es(t,e.model)}else{const t=Array.from(i.getSelectedBlocks()).filter((e=>vs(e)));a=Es(t,e.model)}e.model.change((()=>{for(const e of a)n.markBlockFormat(e,{commandName:"blockQuote",commandParams:[{forceValue:r}]})}))})),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 vs(e){return"blockQuote"==e.parent.name}function Es(e,t){let n,o=0;const s=[],i=t.schema;for(;o<e.length;){const r=e[o],a=e[o+1];n||(n=t.createPositionBefore(r)),Ts(t,r,a)||(s.push(t.createRange(n,i.isObject(r)?t.createPositionAfter(r):t.createPositionAt(r,"end"))),n=null),o++}return s}function Ts(e,t,n){if(!n)return!1;const o=e.createPositionAfter(t),s=e.createPositionBefore(n),i=new r.TreeWalker({boundaries:e.createRange(o,s)});for(const t of i)if("text"==t.type||e.schema.isLimit(t.item))return!1;return!0}class Rs 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 Ss,ws,As=["enableCommand","CommentsEditing","get","plugins","requires","editor","addCommentThread","TrackChangesEditing"];Ss=As,ws=195,function(e){for(;--e;)Ss.push(Ss.shift())}(++ws);var Is=function(e,t){return As[e-=0]};class Ms extends e.Plugin{static get[Is("0x1")](){return[Is("0x6")]}init(){this[Is("0x2")][Is("0x0")][Is("0x7")](Is("0x4"))[Is("0x5")](Is("0x3"))}}var Ns=n(181);const Fs=["document","model","init","unlock","high","writer","addMarker:suggestion:deletion","mapper","start","get","markerNameToElements","forward","plugins","createSelection","setSelection","editing","fromRange","buffer","deleteForward","createRange","downcastDispatcher","detach","markerName","$graveyard","delete","removeMarker:suggestion:deletion","enableCommand","selection","batch","modifySelection","lock","getFirstRange","requires","data","options","end","unbindElementFromMarkerName","merge","uiElement"];var Ps,Os;Ps=Fs,Os=210,function(e){for(;--e;)Ps.push(Ps.shift())}(++Os);const Ls=function(e,t){return Fs[e-=0]};class Bs extends e.Plugin{static get[Ls("0x11")](){return[Ns.Delete]}[Ls("0x1a")](){const e=this.editor,t=e[Ls("0x24")][Ls("0x21")]("TrackChangesEditing");t[Ls("0xb")](Ls("0x9"));const n=e.commands[Ls("0x21")]("deleteForward");t[Ls("0xb")](Ls("0x3"),((t,o={})=>{const s=e[Ls("0x19")][Ls("0x25")](e[Ls("0x19")][Ls("0x18")][Ls("0xc")]);s.isCollapsed&&e.model[Ls("0xe")](s,{direction:Ls("0x23"),unit:o.unit});const i=s[Ls("0x10")](),a=r.LiveRange[Ls("0x1")](i);let c;t(o),c=Ls("0x8")==a.root.rootName?e.model[Ls("0x4")](i.start):e[Ls("0x19")].createRange(a[Ls("0x20")],a[Ls("0x14")]),a[Ls("0x6")](),e[Ls("0x19")].enqueueChange(n[Ls("0x2")][Ls("0xd")],(e=>{n[Ls("0x2")][Ls("0xf")](),e[Ls("0x26")](e[Ls("0x4")](c[Ls("0x14")])),n.buffer[Ls("0x1b")]()}))})),e[Ls("0x0")][Ls("0x5")].on(Ls("0x1e"),ys(e,Ls("0x16")),{priority:"high"}),e[Ls("0x12")][Ls("0x5")].on("addMarker:suggestion:deletion",((t,n,o)=>{o[Ls("0x13")].showSuggestionHighlights&&ys(e,Ls("0x16"),{showActiveMarker:!1})(t,n,o)}),{priority:"high"}),e[Ls("0x0")].downcastDispatcher.on(Ls("0xa"),((e,t,n)=>{const o=n[Ls("0x1f")][Ls("0x22")](t[Ls("0x7")]);if(o)for(const e of o)e.is(Ls("0x17"))&&(n.mapper[Ls("0x15")](e,t[Ls("0x7")]),n[Ls("0x1d")].remove(e))}),{priority:Ls("0x1c")})}}var js=n(331);const Ds=["enableCommand","editing","isAtEnd","showSuggestionHighlights","change","get","createRange","requires","isLimit","downcastDispatcher","data","selection","addMarker:suggestion:insertion","start","options","isCollapsed","high","removeMarker:suggestion:insertion","enter","init","end","ck-suggestion-marker-split","parent","model","setSelection","markerName","editor","split","getFirstRange","document","isAtStart","mapper","unbindElementFromMarkerName","schema","markerNameToElements","hasClass","nextSibling"];var Us,Hs;Us=Ds,Hs=336,function(e){for(;--e;)Us.push(Us.shift())}(++Hs);const Vs=function(e,t){return Ds[e-=0]};class zs extends e.Plugin{static get[Vs("0x4")](){return[js.Enter]}[Vs("0x10")](){const e=this[Vs("0x17")],t=e.plugins[Vs("0x2")]("TrackChangesEditing");t[Vs("0x22")](Vs("0xf"),(n=>{e[Vs("0x14")][Vs("0x1")]((o=>{const s=e[Vs("0x14")][Vs("0x1a")][Vs("0x8")],i=s.getFirstPosition(),a=s[Vs("0xc")],c=r.LiveRange.fromRange(s[Vs("0x19")]()),l=c[Vs("0xa")].parent,g=c[Vs("0x11")].parent,u=!(c[Vs("0xa")][Vs("0x1b")]&&c[Vs("0x11")][Vs("0x24")]),d=l==g,m=!(e[Vs("0x14")][Vs("0x1e")][Vs("0x5")](l)||e[Vs("0x14")][Vs("0x1e")][Vs("0x5")](g))&&(a||u&&d);if(n(),m){const n=e[Vs("0x14")].createPositionAt(i[Vs("0x13")][Vs("0x21")],0),s=o[Vs("0x3")](i,n);t.markInsertion(s)}else o[Vs("0x15")](o[Vs("0x3")](c[Vs("0x11")]));c.detach()}))})),e[Vs("0x23")][Vs("0x6")].on(Vs("0x9"),ys(e,Vs("0x18")),{priority:Vs("0xd")}),e[Vs("0x23")][Vs("0x6")].on(Vs("0xe"),((e,t,n)=>{const o=n[Vs("0x1c")][Vs("0x1f")](t[Vs("0x16")]);if(o)for(const e of o)e[Vs("0x20")](Vs("0x12"))&&(n[Vs("0x1c")][Vs("0x1d")](e,t[Vs("0x16")]),n.writer.remove(e))}),{priority:"high"}),e[Vs("0x7")][Vs("0x6")].on(Vs("0x9"),((t,n,o)=>{o[Vs("0xb")][Vs("0x0")]&&ys(e,Vs("0x18"),{showActiveMarker:!1})(t,n,o)}),{priority:"high"})}}const Gs=[{pluginName:"FontSizeEditing",commandName:"fontSize"},{pluginName:"FontFamilyEditing",commandName:"fontFamily"},{pluginName:"FontColorEditing",commandName:"fontColor"},{pluginName:"FontBackgroundColorEditing",commandName:"fontBackgroundColor"}];class Ws extends e.Plugin{afterInit(){const{t:e}=this.editor.locale;for(const{pluginName:e,commandName:t}of Gs)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,s.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,s.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 s=t.model.document.selection,i=o.value;s.isCollapsed?n(o):t.model.change((()=>{const n=Array.from(s.getRanges());for(const o of n){const n=i?[o]:bs(e,o,t.model);for(const o of n)t.plugins.get("TrackChangesEditing").markInlineFormat(o,{commandName:e,commandParams:[{value:i}]})}}))}))}}class qs 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 s=n.value,i=Array.from(this.editor.model.document.selection.getSelectedBlocks()).filter((e=>{return t=e,n=s,(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"},xs(e))}))}));for(const e of n)"paragraph"!=e.model&&o._descriptionFactory.registerElementLabel(e.model,(t=>{const n=$s(e.model);return null!==n?s(t,n):i(t,e.title)}));function s(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:r}=e;if("formatBlock"==o&&r&&"heading"==r.commandName){const e=r.commandParams[0].value,o=$s(e);if(null!==o)return{type:"format",content:t("*Change to:* %0",s(1,o))};const a=n.find((t=>t.model===e)).title;return{type:"format",content:t("*Change to:* %0",i(1,a))}}}))}}function $s(e){const t=e.match(/^heading(\d+)$/);return t?t[1]:null}class Ks 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 s=e.model.document.selection,i=s.getAttribute("highlight");let r=o.value,a=[];if(s.isCollapsed){const t=s.getFirstPosition();if(!s.hasAttribute("highlight"))return void n(o);{const n=e=>e.item.getAttribute("highlight")===i,o=t.getLastMatchingPosition(n,{direction:"backward"}),s=t.getLastMatchingPosition(n);a=[e.model.createRange(o,s)],r==i&&(r=null)}}else for(const t of s.getRanges())r?a.push(t):a.push(...bs("highlight",t,e.model));e.model.change((()=>{for(const e of a)t.markInlineFormat(e,{commandName:"highlight",commandParams:[{value:r}]})}))}));const{t:n}=e.locale;t._descriptionFactory.registerDescriptionCallback((t=>{const{type:o,data:s}=t;if("formatInline"==o&&s&&"highlight"==s.commandName){const t=s.commandParams[0].value;if(t){const o=e.config.get("highlight.options").find((e=>e.model==t)),s=e.locale._t(o.title).toLowerCase();return{type:"format",content:n("*Set highlight:* %0",s),color:{value:o.color,title:o.title}}}return{type:"format",content:n("*Remove highlight*",n({string:"highlight",id:"FORMAT_HIGHLIGHT"}))}}}))}}class Xs 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"),s=t.createEmptyElement("hr");return t.addClass("ck-horizontal-line",o),t.insert(t.createPositionAt(o,0),s),o},converterPriority:"high"})}}class Qs 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"),s={},{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,s)=>{const i=o.getClosestSelectedImageElement(e.model.document.selection);e.model.change((()=>{n.markBlockFormat(i,{commandName:"imageTypeInline",commandParams:[s]},[],"convertBlockImageToInline")}))})),n.enableCommand("imageTypeBlock",((t,s)=>{e.model.change((i=>{let a=o.getClosestSelectedImageElement(e.model.document.selection),c=i.createRangeOn(a);const l=r.LivePosition.fromPosition(c.start,"toPrevious"),g=r.LivePosition.fromPosition(c.end,"toNext");n.forceDefaultExecution((()=>t(s))),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 s=t.start,i=t.end;const r=e.model.schema.getNearestSelectionRange(s,"backward"),a=e.model.schema.getNearestSelectionRange(i,"forward");r.isCollapsed&&(s=r.start),a.isCollapsed&&(i=a.end),o([e.model.createRange(s,i)])})),n._suggestionFactory.registerCustomCallback("formatBlock","convertInlineImageToBlock","chain",l),n._suggestionFactory.registerCustomCallback("insertion","convertInlineImageToBlock","chain",l)),e.plugins.has("ImageCaptionEditing")&&(n.enableCommand("toggleImageCaption",((t,s)=>{const i=e.plugins.get("ImageCaptionUtils");let r=o.getClosestSelectedImageElement(e.model.document.selection),a=i.getCaptionFromImageModelElement(r);e.model.change((()=>{if(a)return void n.markDeletion(e.model.createRangeOn(a));const c=o.isBlockImage(r);t(s),r=o.getClosestSelectedImageElement(e.model.document.selection),a=i.getCaptionFromImageModelElement(r),n.markInsertion(e.model.createRangeOn(a),c?null:"imageCaption")}))})),n._suggestionFactory.registerCustomCallback("insertion","imageCaption","chain",l)),e.plugins.has("ImageStyleEditing")){n.enableCommand("imageStyle",((s,i)=>{const r=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&&r==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)?(s(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)s[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 s=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(s<0||i<0)return!1;const r=e.getFirstRange(),c=t.getFirstRange();if((0==s||1==s)&&2==i&&r.isIntersecting(c))return!0;if(2==s&&3==i){const e=n._findSuggestions(r,"insertion").filter((({suggestion:e,meta:t})=>t.isOwn&&"convertInlineImageToBlock"==e.subType));if(e.length>1&&c.end.isEqual(r.start))return!0;if(1==e.length&&(r.start.isEqual(c.end)||r.end.isEqual(c.start)))return!0}if(3==s&&3==i&&r.start.isBefore(c.start)){const e=r.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 s=Array.from(e.model.document.differ.getChangedMarkers());for(const{name:e,data:i}of s){const{group:s,type:r,subType:a,id:c}=n._splitMarkerName(e);if("suggestion"==s&&n.hasSuggestion(c)){if("formatBlock"==r&&("imageStylePreApply"==a||"imageStylePostApply"==a)){const e=n.getSuggestion(c);if(i.newRange){const s=e.getFirstRange().getContainedElement();if(o.isBlockImage(s))continue;n.discardSuggestion(e),t=!0}}if("insertion"==r&&"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,s)=>{const i=o.getClosestSelectedImageElement(e.model.document.selection);i.getAttribute("width")!=s.width&&e.model.change((()=>{n.markBlockFormat(i,{commandName:"resizeImage",commandParams:[s]})}))})),e.plugins.has("ImageTextAlternativeEditing")&&n.enableCommand("imageTextAlternative",((t,s)=>{const i=o.getClosestSelectedImageElement(e.model.document.selection);(i.hasAttribute("alt")?i.getAttribute("alt"):"")!=s.newValue&&e.model.change((()=>{n.markBlockFormat(i,{commandName:"imageTextAlternative",commandParams:[s]})}))})),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"}):s[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 Js 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 s=e.getItems()[0],i=t._descriptionFactory.getItemLabel(s.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 Ys,Zs,ei=["TrackChangesEditing","init","input","editor","plugins","enableCommand","get"];Ys=ei,Zs=250,function(e){for(;--e;)Ys.push(Ys.shift())}(++Zs);var ti=function(e,t){return ei[e-=0]};class ni extends e.Plugin{static get requires(){return[Ns.Input]}[ti("0x3")](){this[ti("0x5")][ti("0x6")][ti("0x1")](ti("0x2"))[ti("0x0")](ti("0x4"))}}class oi 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 s=e.model.document.selection;let i=[];if(s.isCollapsed){if(!s.hasAttribute("linkHref"))return void n(o);{const t=(0,Ns.findAttributeRange)(s.getFirstPosition(),"linkHref",s.getAttribute("linkHref"),e.model);i=[t]}}else i=Array.from(s.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,Ns.findAttributeRange)(o.getFirstPosition(),"linkHref",o.getAttribute("linkHref"),e.model)]:bs("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 si 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,s=e.commands.get(n);if(s.value)return void e.execute("paragraph",{});const i=n.slice(0,-4),r=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 s=new Set;for(const e of o)e.is("element","listItem")?s.add(ii(e)):s.add(e);return Array.from(s)}(o.getSelectedBlocks(),i,e.model.schema);e.model.change((()=>{for(const e of r)t.markBlockFormat(e,{commandName:n,commandParams:[{forceValue:!s.value}],formatGroupId:"blockName"},ri(e))}))}}function s(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()),s=e.model.createRange(e.model.createPositionAt(o[0],"before"),e.model.createPositionAt(o[o.length-1],"end"));e.model.change((()=>{t.markBlockFormat(s,{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",s("indentList")),t.enableCommand("outdentList",s("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 ii(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 ri(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}class ai 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 ci=["editor","afterInit","MentionEditing","TrackChangesEditing","plugins","has","mention","get"];var li,gi;li=ci,gi=215,function(e){for(;--e;)li.push(li.shift())}(++gi);const ui=function(e,t){return ci[e-=0]};class di extends e.Plugin{[ui("0x2")](){const e=this[ui("0x1")];e[ui("0x5")][ui("0x6")](ui("0x3"))&&e[ui("0x5")][ui("0x0")](ui("0x4")).enableCommand(ui("0x7"))}}class mi 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 hi 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 s=e.model.document,i=o.selection||s.selection,r=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 r)n.markBlockFormat(e,{commandName:"paragraph",commandParams:[],formatGroupId:"blockName"},xs(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",fi(e),{priority:"highest"}),e.data.downcastDispatcher.on("addMarker:suggestion:insertion",((t,n,o)=>{o.options.showSuggestionHighlights&&fi(e,{showActiveMarker:!1})(t,n,o)}),{priority:"highest"});const o=n._descriptionFactory;o.registerDescriptionCallback((n=>{if("insertion"!==n.type)return;const{start:s,end:i}=n.getFirstRange();if(!s.isTouching(i)||!s.nodeAfter)return;const r=e.model.schema,a=s.nodeAfter;return r.isBlock(a)&&!r.isLimit(a)&&r.checkChild(a,"$text")?{type:"insertion",content:t("*Insert:* %0",o.getItemLabel(a.name,1))}:void 0}))}}function fi(e,{showActiveMarker:t=!0}={}){return(n,o,s)=>{const i=e.plugins.get("TrackChangesEditing"),r=o.markerRange.start,a=o.markerRange.end,c=e.model.schema;if(!r.isTouching(a)||!r.nodeAfter)return;const l=r.nodeAfter;if(c.isBlock(l)&&!c.isLimit(l)&&c.checkChild(l,"$text")){if(!s.consumable.consume(o.markerRange,n.name))return;const e=s.writer.createUIElement("span",{class:"ck-suggestion-marker-split"}),r=s.mapper.toViewPosition(a);t&&i.activeMarkers.includes(o.markerName)&&s.writer.addClass("ck-suggestion-marker--active",e),s.writer.insert(r,e),s.mapper.bindElementToMarker(e,o.markerName)}}}class pi 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())bi(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 bi(e,t){for(const[n]of e.getAttributes()){const e=t.getAttributeProperties(n);if(e&&e.isFormatting)return!0}return!1}const xi=["discardSelectedSuggestions","TrackChangesEditing","goToPreviousRestrictedEditingException","editor","enableCommand","acceptSelectedSuggestions","acceptSuggestion","discardSuggestion","trackChanges","afterInit","acceptAllSuggestions","plugins","has","get","RestrictedEditingModeEditing"];var yi,Ci;yi=xi,Ci=139,function(e){for(;--e;)yi.push(yi.shift())}(++Ci);const _i=function(e,t){return xi[e-=0]};class ki extends e.Plugin{[_i("0x5")](){const e=this[_i("0xe")];if(!e[_i("0x7")][_i("0x8")](_i("0xa")))return;const t=e[_i("0x7")][_i("0x9")](_i("0xc"));t.enableCommand(_i("0xd")),t[_i("0x0")]("goToNextRestrictedEditingException");const n=e[_i("0x7")][_i("0x9")]("RestrictedEditingModeEditing");n[_i("0x0")](_i("0x4")),n[_i("0x0")](_i("0x2")),n[_i("0x0")](_i("0x3")),n.enableCommand(_i("0x6")),n.enableCommand("discardAllSuggestions"),n.enableCommand(_i("0x1")),n[_i("0x0")](_i("0xb"))}}class vi extends e.Plugin{static get requires(){return[js.ShiftEnter]}init(){const e=this.editor,t=e.plugins.get("TrackChangesEditing"),n=e.t;t.enableCommand("shiftEnter"),e.editing.downcastDispatcher.on("addMarker:suggestion:insertion",Ei(e),{priority:"high"}),e.editing.downcastDispatcher.on("addMarker:suggestion:deletion",Ei(e),{priority:"high"}),e.data.downcastDispatcher.on("addMarker:suggestion",((t,n,o)=>{o.options.showSuggestionHighlights&&Ei(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 Ei(e,{showActiveMarker:t=!0}={}){return(n,o,s)=>{const i=e.plugins.get("TrackChangesEditing");if(!s.consumable.test(o.markerRange,n.name))return;const r=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=s.writer.createUIElement("span",{class:"ck-suggestion-marker-"+n}),c=s.mapper.toViewPosition(r.createPositionBefore(e));t&&i.activeMarkers.includes(o.markerName)&&s.writer.addClass("ck-suggestion-marker--active",a),s.writer.insert(c,a),s.mapper.bindElementToMarker(a,o.markerName)}}}class Ti 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",s=e.commands.get(o);n.enableCommand(o,((e,i={})=>{const r=t.document.selection;if(r.isCollapsed)return void e(i);const a=void 0!==i.forceValue?i.forceValue:!s.value;t.change((()=>{const e=Array.from(r.getRanges());for(const s of e){const e=a?[s]:bs(o,s,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"})}}))}}class Ri 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"),s=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 r="above"===i.order,a=s.getSelectionAffectedTableCells(t),c=s.getRowIndexes(a),l=r?c.first-1:c.last+1,g=a[0].findAncestor("table"),u=s.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 r="left"===i.order,a=s.getSelectionAffectedTableCells(t),c=s.getColumnIndexes(a),l=r?c.first-1:c.last+1,g=a[0].findAncestor("table"),u=s.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),r=i.toLowerCase(),a=r.substr(0,3)+"span",c="table"+i,l="min"+i,g="max"+i;o.enableCommand(n,(()=>{e.model.change((e=>{const i=s.getSelectionAffectedTableCells(t),u=i[0].findAncestor("table");let d;if("removeTableRow"==n){const e=s.getRowIndexes(i);d={startRow:e.first,endRow:e.last,includeAllSlots:!0}}else{const e=s.getColumnIndexes(i);d={startColumn:e.first,endColumn:e.last,includeAllSlots:!0}}const m=s.createTableWalker(u,d),h=Array.from(m).map((({cell:e})=>e)),f=Si(h.filter((e=>e.hasAttribute(a)))),p=Si(h.filter((e=>!e.hasAttribute(a)))).map((t=>e.createRangeOn(t))),b=o.markMultiRangeDeletion(p,c);if(b&&("tableRow"==b.subType||"tableColumn"==b.subType)){const t=this._getSuggestionCoords(b);for(const n of f){const o=e.createRangeOn(n),i=s.getCellLocation(n),c=n.getAttribute(a)-1,u=t[l],d=t[g];u<=i[r]&&i[r]+c<=d&&b.addRange(o)}}}))}))}function i(n){const o=Array.from(t.getRanges()).map((e=>r.LiveRange.fromRange(e)));e.model.change((t=>{const s=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(s,(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 s=Array.from(t.getRanges()).map((e=>r.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=s.filter((e=>"$graveyard"!=e.root.rootName));a.length>0&&o.setSelection(a);for(const e of s)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 s=n.mapper.toViewElement(o);function i(e){return Array.isArray(e)?e:[e]}s&&"tableCell"===o.name&&(0,a.setHighlightHandling)(s,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),s=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"},[s,'"'+t.join(" ")+'"']))}:{type:"insertion",content:n("*Insert:* %0",n({string:"table row",plural:"%0 table rows",id:"ELEMENT_TABLE_ROW"},s))};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"},[s,'"'+t.join(" ")+'"']))}:{type:"deletion",content:n("*Remove:* %0",n({string:"table row",plural:"%0 table rows",id:"ELEMENT_TABLE_ROW"},s))}}if("tableColumn"==e.subType){const t=e.getItems().filter((e=>e.is("textProxy"))).map((e=>e.data)),o=this._getSuggestionCoords(e),s=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"},[s,'"'+t.join(" ")+'"']))}:{type:"insertion",content:n("*Insert:* %0",n({string:"table column",plural:"%0 table columns",id:"ELEMENT_TABLE_COLUMN"},s))};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"},[s,'"'+t.join(" ")+'"']))}:{type:"deletion",content:n("*Remove:* %0",n({string:"table column",plural:"%0 table columns",id:"ELEMENT_TABLE_COLUMN"},s))}}})),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((s=>{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=s.createRangeIn(c);if("$graveyard"==l.root.rootName)return;const g=Array.from(t.getRanges()).map((e=>r.LiveRange.fromRange(e)));s.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&&s.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,s=Number.MAX_SAFE_INTEGER,i=Number.MIN_SAFE_INTEGER;for(const r of e){if("$graveyard"==r.root.rootName)continue;const{row:e,column:a}=t.getCellLocation(r),c=r.hasAttribute("rowspan")?r.getAttribute("rowspan")-1:0,l=r.hasAttribute("colspan")?r.getAttribute("colspan")-1:0;n=e<n?e:n,o=e+c>o?e+c:o,s=a<s?a:s,i=a+l>i?a+l:i}return{minRow:n,maxRow:o,minColumn:s,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:s,subType:i}=t._splitMarkerName(e);if("suggestion"!=n)continue;if(null!=o.oldRange)continue;const r=t.getSuggestion(s);this._tablePostFixingSubtypes.includes(i)&&this._tableSuggestions.add(r)}}),{priority:"low"});const o=(e,t)=>{let o=!1;const s=t.createRangeOn(e),i=e.findAncestor("table"),r=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(s))continue;const m=e.hasAttribute(g)?e.getAttribute(g)-1:0,h=this._getSuggestionCoords(t),f=h[u],p=h[d];f<=r[l]&&r[l]+m<=p&&(t.addRange(s),o=!0)}return o};e.model.document.registerPostFixer((t=>{let n=!1;for(const s of e.model.document.differ.getChanges())if("insert"==s.type)if("tableRow"==s.name)for(const e of s.position.nodeAfter.getChildren())n=n||o(e,t);else"tableCell"==s.name&&(n=n||o(s.position.nodeAfter,t));return n}))}_getSuggestionCoords(e){return this._getCoordsForCells(e.getRanges().map((e=>e.start.nodeAfter)))}}function Si(e){return Array.from(new Set(e).values())}class wi extends e.Plugin{static get requires(){return[Ri]}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"),s=e.plugins.get("TableUtils"),i=e.plugins.get(Ri);i._tablePostFixingSubtypes.push("mergeTableCells"),o.enableCommand("mergeTableCells",(()=>{const t=s.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"))),s=n.value;e.model.change((()=>{o.markMultiRangeBlockFormat([t,s],{commandName:"mergeTableCells",commandParams:[]},[],"mergeTableCells")}))}))}for(const t of["splitTableCellVertically","splitTableCellHorizontally"]){const n=e.commands.get(t);o.enableCommand(t,(()=>{const i=s.getSelectionAffectedTableCells(e.model.document.selection)[0],r=i.findAncestor("table"),{column:a,row:c}=s.getCellLocation(i);let l=[];if("horizontally"==n.direction){const e=s.createTableWalker(r,{startRow:c,endRow:c,includeAllSlots:!0});l=Array.from(e).map((e=>e.cell))}else{const e=s.createTableWalker(r,{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 s=Array.from(t.getRanges()).map((e=>r.LiveRange.fromRange(e)));o.setSelection(n),e.commands.get("mergeTableCells").refresh(),e.execute("mergeTableCells",{forceDefaultExecution:!0});const i=s.filter((e=>"$graveyard"!=e.root.rootName));i.length>0&&o.setSelection(i);for(const e of s)e.detach()}))}));for(const t of["mergeTableCellUp","mergeTableCellDown","mergeTableCellLeft","mergeTableCellRight"]){const n=e.commands.get(t);n.on("set:isEnabled",((t,o,s)=>{if(s){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),s=this.editor.model.createRangeOn(t),i=new Set,r=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(s,!0)&&r.add(e.type+":"+e.author.id);if(i.size!=r.size)return!1;for(const e of i)if(!r.has(e))return!1;return!0}}class Ai extends e.Plugin{static get requires(){return[Ri]}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"),s=e.plugins.get(Ri);function i({showActiveMarker:e=!0,setDataAttribute:t=!0}={}){return(s,i,r)=>{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 s.stop();if(!r.consumable.consume(i.markerRange,s.name))return;const g=i.markerRange.start.nodeAfter,u=i.markerRange.end.nodeBefore,d=g.parent.parent,{column:m}=o.getCellLocation(g),{column:h}=o.getCellLocation(u);for(let s=m;s<=h;s++){const l=o.createTableWalker(d,{column:s,includeAllSlots:!1});for(const o of l){const s=o.cell,l=r.mapper.toViewElement(s);r.writer.addClass("ck-suggestion-marker-"+a,l),t&&r.writer.setAttribute("data-suggestion",c,l),r.mapper.bindElementToMarker(l,i.markerName),e&&(n.activeMarkers.includes(i.markerName)?r.writer.addClass("ck-suggestion-marker--active",l):r.writer.removeClass("ck-suggestion-marker--active",l))}}}}n.enableCommand("setTableRowHeader",((t,s)=>{const i=o.getSelectionAffectedTableCells(e.model.document.selection),r=o.getRowIndexes(i),a=i[0].findAncestor("table"),c=a.getAttribute("headingRows")||0,l=s&&null!==s.forceValue?s.forceValue:!e.commands.get("setTableRowHeader").value,g=l?r.last:r.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 s=e.plugins.get("TableUtils"),i=s.getSelectionAffectedTableCells(e.model.document.selection),r=s.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?r.last:r.first,m=s.createTableWalker(a,{startRow:0,column:d,includeAllSlots:!1}),h=Array.from(m)[0].cell;if(l){const t=u.getChild(c);if(h.isBefore(t))return;g=e.model.createRange(e.model.createPositionBefore(t),e.model.createPositionAfter(h))}else{const t=u.getChild(c-1);if(!t)return;g=e.model.createRange(e.model.createPositionBefore(h),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:s,id:i}=n._splitMarkerName(t.markerName),r=n.getSuggestion(i);if(!r.data||"setTableColumnHeader"!=r.data.commandName)return;const a=o.mapper.markerNameToElements(t.markerName);if(a)for(const e of a)o.writer.removeClass("ck-suggestion-marker-"+s,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 r=s._acceptFormatSuggestionCallbackFactory();n._suggestionFactory.registerCustomCallback("formatBlock","setTableRowHeader","accept",r),n._suggestionFactory.registerCustomCallback("formatBlock","setTableColumnHeader","accept",r)}}const Ii=["tableCellBorderWidth","tableCellBorderColor","tableCellBorderStyle","tableCellHorizontalAlignment","tableCellVerticalAlignment","tableCellBackgroundColor","tableCellPadding"],Mi=Object.fromEntries(Ii.map((e=>[e,null])));class Ni extends e.Plugin{static get requires(){return[Ri]}afterInit(){const e=this.editor;if(!e.plugins.has("TableClipboard"))return;const{t:n}=e.locale,o=e.plugins.get("TrackChangesEditing"),s=e.plugins.get("TableUtils"),i=e.plugins.get(Ri),r=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,s){if(t&&!t.is("documentSelection"))return!1;const i=s.getTableIfOnlyTableInContent(e,n);if(!i||!Pi(i,null,o))return!1;const r=o.getSelectionAffectedTableCells(n.document.selection);if(!r.length)return!1;const a=r[0].findAncestor("table"),c=o.getRowIndexes(r),l=o.getColumnIndexes(r),g={startRow:c.first,endRow:c.last,startColumn:l.first,endColumn:l.last};return 1==r.length&&(g.endRow+=o.getRows(i)-1,g.endColumn+=o.getColumns(i)-1),Pi(a,g,o)}(c,l,e.model,s,r)&&(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:s,columnInsertionRanges:r,insertionRanges:c,deletionRanges:l,cells:g}=a;s.length&&o.markMultiRangeInsertion(s,"tablePasteRow",{tablePasteChainId:n}),r.length&&o.markMultiRangeInsertion(r,"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:s}of g){if(!s)continue;const i=e.model.createRangeOn(o),r=t.find((e=>e.getRange().isEqual(i)));r&&n.push([r.name,s])}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,,s]=t;if(!a)return;e.stop();const i=n.cell,r=o,c=Fi(i),l=Fi(r);e.return=i;let g=null,u=null;if(l||c)if(c&&!l){s.remove(i.getChild(0));for(const e of Array.from(r.getChildren()))s.insert(e,i,"end");const e=a.rowInsertionIndexes.includes(n.row),t=a.columnInsertionIndexes.includes(n.column);e||t||(g=s.createRangeIn(i))}else l&&!c&&(u=s.createRangeIn(i));else{const e=s.createElement("tableCellSuggestion"),t=s.createElement("tableCellSuggestion");s.wrap(s.createRangeIn(i),t),s.insert(e,i,0);for(const t of Array.from(r.getChildren()))s.insert(t,e,"end");g=s.createRangeOn(e),u=s.createRangeOn(t)}const d=Array.from(r.getAttributes()).filter((([e])=>Ii.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"}),s.on("insertColumns",((t,n)=>{const[o,i={}]=n;if(!a)return;const r=i.at||0,c=i.columns||1;a.columnInsertionIndexes=new Array(c).fill(r).map(((e,t)=>e+t));for(const{cell:t}of s.createTableWalker(o,{startColumn:r,endColumn:r+c-1}))a.columnInsertionRanges.push(e.model.createRangeOn(t))}),{priority:"low"}),s.on("insertRows",((t,n)=>{const[o,i={}]=n;if(!a)return;const r=i.at||0,c=i.rows||1;a.rowInsertionIndexes=new Array(c).fill(r).map(((e,t)=>e+t));for(const{cell:t}of s.createTableWalker(o,{startRow:r,endRow:r+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 s=t.map((e=>e.getContainedElement())).filter((e=>e)),i=new Map(s.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),s=o?o.getRange().getContainedElement():null;s&&i.set(s,n)}e.model.change((e=>{for(const[t,n]of i)e.setAttributes({...Mi,...n},t)}))}));const l=(t,n)=>{o._suggestionFactory.registerCustomCallback(t,"tablePaste",n,((s,i,r)=>{e.model.change((e=>{const a=[];for(const e of s){const t=e.start.nodeAfter;t.is("element","tableCellSuggestion")&&a.push(t)}o._suggestionFactory.getSuggestionCallback(t,null,n)(s,i,r);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:r}=i._getCoordsForCells(t);s.removeRows(n,{at:o,rows:r-o+1})})),o._suggestionFactory.registerCustomCallback("insertion","tablePasteColumn","discard",(e=>{const t=e.map((e=>e.getContainedElement())),n=t[0].findAncestor("table"),{minColumn:o,maxColumn:r}=i._getCoordsForCells(t);s.removeColumns(n,{at:o,columns:r-o+1})}));const g=(e,t)=>{if(!t.subType||!t.subType.startsWith("tablePaste"))return;const n=t.attributes.tablePasteChainId,s=o.getSuggestions().filter((e=>e.isInContent&&e.attributes&&e.attributes.tablePasteChainId==n));s.length&&t.getAllAdjacentSuggestions().length!=s.length&&s.reduce(((e,t)=>(e.next=t,t.previous=e,t)))};function u(e,{showActiveMarker:t=!0}={}){const{id:n}=o._splitMarkerName(e.markerName),s=["ck-suggestion-marker","ck-suggestion-marker-insertion"],i=o.activeMarkers.includes(e.markerName);return i&&s.push("ck-suggestion-marker--active"),{classes:s,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:s,data:i}of n){const{group:n,type:r,id:a}=o._splitMarkerName(s);if("suggestion"!=n||"deletion"!=r||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 s=!1;const i=e.plugins.get("Users").me,r=e.model.document.differ.getChanges(),a=Array.from(e.model.document.differ.getChangedMarkers()).filter((({name:e,data:t})=>{const{group:n,subType:s,authorId:r}=o._splitMarkerName(e);return"suggestion"==n&&"tablePaste"==s&&r==i.id&&!t.oldRange}));for(const e of r){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}),s=!0;break}}return s})),e.model.document.registerPostFixer((t=>{let n=!1;const s=e.plugins.get("Users").me,i=o.getSuggestions().filter((e=>e.isInContent&&e.author==s)),r=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")&&Fi(o)){e.removeMarker(t.name),r.add(o),n=!0;const s=o.nextSibling,i=o.previousSibling,c=s&&s.is("element","tableCellSuggestion"),l=i&&i.is("element","tableCellSuggestion");c&&!r.has(s)&&a.add(s),l&&!r.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 s=!0,r=!0;for(const t of i)if(t.subType&&t.subType.startsWith("tablePaste")){if(!t.attributes.tablePasteChainId){r=!1;break}if(t.id!=e.id&&t.attributes.tablePasteChainId==o){s=!1;break}}r&&s&&(e.removeMarkers(),n=!0)}for(const e of r)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 Fi(e){if(e.isEmpty)return!0;const t=e.getChild(0);return t.is("element","paragraph")&&t.isEmpty}function Pi(e,t={},n){for(const{isAnchor:o,cellHeight:s,cellWidth:i}of n.createTableWalker(e,{includeAllSlots:!0,...t}))if(!o||1!=s||1!=i)return!1;return!0}class Oi 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 s=Array.from(e.model.document.differ.getChangedMarkers());for(const{name:i,data:r}of s){const{group:s}=n._splitMarkerName(i);if("suggestion"!==s||!r.newRange)continue;const a=r.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 Li=["has","undo","plugins","UndoEditing","get","redo","TrackChangesEditing","afterInit"];var Bi,ji;Bi=Li,ji=388,function(e){for(;--e;)Bi.push(Bi.shift())}(++ji);const Di=function(e,t){return Li[e-=0]};class Ui extends e.Plugin{[Di("0x3")](){const e=this.editor,t=e[Di("0x6")][Di("0x0")](Di("0x2"));e[Di("0x6")][Di("0x4")](Di("0x7"))&&(t.enableCommand(Di("0x5")),t.enableCommand(Di("0x1")))}}const Hi=["number","isArray","charCodeAt","sort","sign","keys","object","toString","string","boolean"];var Vi,zi;Vi=Hi,zi=219,function(e){for(;--e;)Vi.push(Vi.shift())}(++zi);const Gi=function(e,t){return Hi[e-=0]};function*Wi(e){e?Gi("0x0")==typeof e?yield 1:Array[Gi("0x2")](e)?yield*function*(e){for(const t of e)yield*Wi(t)}(e):Gi("0x7")==typeof e?yield*qi(e):Gi("0x9")==typeof e?yield*$i(e):Gi("0x1")==typeof e&&(yield e):yield 0}function*qi(e){if(yield Ki("{"),e){const t=Object[Gi("0x6")](e)[Gi("0x4")]();for(const n of t){yield*$i(n),yield Ki(":");const t=e[n];yield*Wi(t)}}yield Ki("}")}function*$i(e){yield Ki('"');for(const t of e)yield Ki(t);yield Ki('"')}function Ki(e){return e[Gi("0x3")](0)}function Xi(e){return(e*=Math[Gi("0x5")](e))[Gi("0x8")](36)}class Qi extends e.Plugin{static get requires(){return["CommentsRepository",i.Users,e.PendingActions,ds,_s,ks,Rs,Ms,Bs,zs,Ws,qs,Ks,Xs,Qs,Js,ni,oi,si,ai,di,mi,hi,pi,ki,vi,Ti,Ri,wi,Ai,Ni,Oi,Ui]}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,s)=>{this._model.change((()=>{for(const t of[...s,...o])this._model.markers.has(t)&&e.editing.reconvertMarker(t)}))})),this._descriptionFactory=new us(this.editor.model.schema,this.editor.locale),this._adapter=null,this._suggestionFactory=new Ji(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,56,50,52])}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 s=3e3;return this.activeMarkers.includes(e.markerName)&&(o.push("ck-suggestion-marker--active"),s=3010),"deletion"==n&&(s+=5),{classes:o,attributes:{"data-suggestion":t},priority:s}}}),e.conversion.for("dataDowncast").add((t=>{t.on("addMarker:suggestion",((t,n,o)=>{if(!o.options.showSuggestionHighlights)return;const s=n.item;if(!s)return;const i=o.mapper.toViewElement(s);e.model.schema.isObject(s)&&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,s)=>{if(!o.item)return;if(o.item.is("selection"))return void s.consumable.consume(o.item,n.name);const i=s.mapper.toViewElement(o.item);if(!o.item.is("element")||!e.model.schema.isBlock(o.item)||i.getCustomProperty("addHighlight"))return;const{id:r}=this._splitMarkerName(o.markerName);s.writer.addClass(["ck-suggestion-marker","ck-suggestion-marker-formatBlock"],i),s.writer.setAttribute("data-suggestion",r,i),s.mapper.bindElementToMarker(i,o.markerName),t&&(this.activeMarkers.includes(o.markerName)?s.writer.addClass("ck-suggestion-marker--active",i):s.writer.removeClass("ck-suggestion-marker--active",i));for(const t of e.model.createRangeIn(o.item).getItems())s.consumable.consume(t,n.name);s.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:r,data:a}of o){const{group:o,type:c,id:l}=this._splitMarkerName(r);if("suggestion"!==o)continue;const g=this._suggestions.get(l);if(null!=a.newRange)if("formatInline"==c&&(n=n||er(a.newRange,r,t,e.model.schema)),a.newRange.isCollapsed||"$graveyard"==a.newRange.root.rootName||"formatBlock"==c&&!nr(a.newRange)||"deletion"==c&&(Zi(i=a.newRange)||(s=i).start.parent==s.end.nodeBefore&&s.start.isAtEnd))t.removeMarker(r),n=!0;else{if(!g||!g.isInContent)continue;n=!!this._joinWithAdjacentSuggestions(g)||n}}var s,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 s=o.position.getShiftedBy(o.length);if(s.isAtEnd)for(const i of this._suggestions.values()){if(i.isMultiRange||!i.isInContent)continue;if("formatBlock"!=i.type)continue;const r=i.getFirstRange();if(r.start.parent!=r.end.parent&&r.end.isEqual(o.position)){const o=e.model.createRange(r.start,s);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:s}=this._splitMarkerName(e);if("suggestion"===t&&(null===o.oldRange&&this._handleNewSuggestionMarker(e),null===o.newRange)){const e=this._suggestions.get(s);e.isInContent?n.add(e):this._removeSuggestion(e)}}for(const{name:e,data:o}of t){const{group:t,id:s}=this._splitMarkerName(e);if("suggestion"!==t)continue;const i=this._suggestions.get(s);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 s,i;switch(o.type){case"insert":s=e.model.createPositionAt(o.position),i=s.getShiftedBy(o.howMany);break;case"split":s=e.model.createPositionAt(o.splitPosition),i=e.model.createPositionAt(o.moveTargetPosition);break;case"move":s=e.model.createPositionAt(o.targetPosition),i=s.getShiftedBy(o.howMany);break;default:return}const r=e.model.createRange(s,i);e.model.change((()=>{for(const{suggestion:e,meta:t}of this._findSuggestions(r)){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(r)&&this._breakSuggestionMarker(e,s,i))}}))}),{priority:"lowest"}),e.model.on("deleteContent",((t,n)=>{const o=n[0],s=n[1];if(s&&s.forceDefaultExecution)return;if(this._isForcedDefaultExecutionBlock)return;if(!this.trackChangesCommand.value)return;if(o.isCollapsed)return;const i=e.model.schema,{start:r,end:a}=o.getFirstRange(),c=r.nodeAfter&&i.isObject(r.nodeAfter)?null:i.getNearestSelectionRange(r,"forward"),l=a.nodeBefore&&i.isObject(a.nodeBefore)?null:i.getNearestSelectionRange(a,"backward"),g=e.model.createRange(c?c.start:r,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 s=o.end.nodeBefore,i=e.model.schema;s&&i.isBlock(s)&&!i.isObject(s)&&(o=e.model.createRange(o.start,e.model.createPositionAt(s,"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 b(e,this._suggestions);e.commands.add("acceptSuggestion",o),this.enableCommand("acceptSuggestion");const s=new k(e,this._suggestions);e.commands.add("discardSuggestion",s),this.enableCommand("discardSuggestion"),e.commands.add("acceptAllSuggestions",new N(e,o,this._suggestions)),this.enableCommand("acceptAllSuggestions"),e.commands.add("discardAllSuggestions",new $(e,s,this._suggestions)),this.enableCommand("discardAllSuggestions"),e.commands.add("acceptSelectedSuggestions",new V(e,o,this._suggestions)),this.enableCommand("acceptSelectedSuggestions"),e.commands.add("discardSelectedSuggestions",new Y(e,s,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,s]=e.type.split(":"),i=this._suggestions.get(t)||this._createSuggestion(o,s,t,n);switch(this._addThreadToSuggestion(i),this._checkSuggestionCorrectness(i,o,s||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 s=this._isForcedDefaultExecutionBlock;this._isForcedDefaultExecutionBlock=!0;try{n=e()}catch(e){o=e}return s||(this._isForcedDefaultExecutionBlock=!1),o&&t.CKEditorError.rethrowUnexpectedError(o,this),n}markInsertion(e,n=null,o={}){if(e.isCollapsed)return null;const s=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)(),r=s.id,a=n?"insertion:"+n:"insertion",c=this._setSuggestionData({id:i,type:a,createdAt:new Date,authorId:r,attributes:o});return this._addSuggestionMarker(a,i,r,e),c}markMultiRangeInsertion(e,n="multi",o={}){const s=this.editor.plugins.get("Users").me,i=this._suggestionFactory.getSuggestionCallback("insertion",n,"join");for(const t of this.getSuggestions())if(t.author.id==s.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 r=(0,t.uid)(),a=s.id,c="insertion:"+n,l=this._setSuggestionData({id:r,type:c,createdAt:new Date,authorId:a,attributes:o});for(const t of e)this._addSuggestionMarker(c,r,a,t,gs.getMultiRangeId());return l}markInlineFormat(e,n,o=null,s={}){if(o=o||tr(n),e.isCollapsed)return;const i=this.editor.plugins.get("Users").me,r=[];for(const{suggestion:t,meta:n}of this._findSuggestions(e,"insertion"))n.isOwn&&!n.isInsideObject&&r.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,r),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,r);a.length&&this._model.change((()=>{for(const e of a){const t=this._suggestionFactory.getSuggestionCallback("formatInline",o,"accept");this.forceDefaultExecution((()=>t([e],n,s)))}}));for(const e of c){let r=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 s=t.getFirstRange();if(s.containsRange(e,!0))return;a=a.isBefore(s.start)?a:s.start,c=c.isAfter(s.end)?c:s.end,r?s.start.isBefore(r.getFirstRange().start)?(r.removeMarkers(),r=t):t.removeMarkers():r=t}const l=this._model.createRange(a,c);if(r)this._setSuggestionRange(r,l);else{const e=(0,t.uid)(),r=i.id;this._setSuggestionData({id:e,type:"formatInline:"+o,data:n,createdAt:new Date,authorId:r,attributes:s}),this._addSuggestionMarker("formatInline:"+o,e,r,l)}}}markBlockFormat(e,n,o=[],s=null,i={}){n.formatGroupId||(n.formatGroupId=n.commandName),n.multipleBlocks=e.is("range"),s=s||tr(n);const r=o.map((e=>or(e,this._model))),a=e.is("range")?e:or(e,this._model);r.push(a);let c=!0;for(const e of r)if(!this._rangeIsInLocalUserInsertion(e)){c=!1;break}if(c){const e=this._suggestionFactory.getSuggestionCallback("formatBlock",s,"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==s){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)(),h=d.id;l?this._setSuggestionRange(l,this._model.createRange(g,u)):(this._setSuggestionData({id:m,type:"formatBlock:"+s,data:n,createdAt:new Date,authorId:h,attributes:i}),this._addSuggestionMarker("formatBlock:"+s,m,h,this._model.createRange(g,u)))}markMultiRangeBlockFormat(e,n,o=[],s=null,i={}){n.formatGroupId||(n.formatGroupId=n.commandName),n.multipleBlocks=!1,s=s||tr(n);const r=o.map((e=>or(e,this._model))),a=e.map((e=>or(e,this._model)));r.push(...a);let c=!0;for(const e of r)if(!this._rangeIsInLocalUserInsertion(e)){c=!1;break}if(c){const e=this._suggestionFactory.getSuggestionCallback("formatBlock",s,"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==s;for(let n=0;n<a.length;n++){const o=a[n];for(const s of e.getMarkers()){const i=s.getRange();if(o.isEqual(i)){t?(a.splice(n,1),n--):e.removeMarker(s.name);break}}}}if(0==a.length)return;const g=this._suggestionFactory.getSuggestionCallback("formatBlock",s,"join");for(const e of this.getSuggestions())if(e.author.id==l.id&&"formatBlock"==e.type&&e.data.formatGroupId==n.formatGroupId&&e.subType==s&&(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:"+s,h=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,gs.getMultiRangeId());return h}markDeletion(e,n=null,o={}){if(e.isCollapsed)return null;const s=this.editor.plugins.get("Users").me,i=new r.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),r=s.id,a=n?"deletion:"+n:"deletion",g=this._setSuggestionData({id:e,type:a,createdAt:new Date,authorId:r,attributes:o});return this._addSuggestionMarker(a,e,r,i),g}}markMultiRangeDeletion(e,n="multi",o={}){const s=this.editor.plugins.get("Users").me,i=e.map((e=>new r.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 s=t.getRanges();if((!t.attributes||!t.attributes.skipNestingCheck)&&s.every((e=>i.some((t=>t.containsRange(e,!0)))))&&t.discard(),i.every((e=>s.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==s.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=s.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,gs.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,s){if(e.type!=n||e.subType!=o||e.author.id!=s)throw this.editor.enableReadOnlyMode("track-changes-suggestion-data-mismatch"),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 s=this._model.createPositionAt(n.start.nodeBefore,"end");this._setSuggestionRange(e,this._model.createRange(o.start,s));const i=(0,t.uid)(),r=e.author.id,a=e.type+":"+e.subType;this._setSuggestionData({id:i,type:a,createdAt:new Date,authorId:r,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,r,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 s=this._getAuthorFromId(o),i=this._suggestionFactory.buildSuggestion(e,t,n,s,(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 s=e.getFirstRange(),i=s.start,r=s.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,r))}_findSuggestions(e,t=null){const n=[],o=this._model.schema,s=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 r=e.start.isEqual(t.end)||e.end.isEqual(t.start);if(r||e.getIntersection(t)){const a=e.containsRange(t)&&Yi(o,t.start,e),c=t.containsRange(e)&&Yi(o,e.start,t);n.push({suggestion:i,meta:{isOwn:s==i.author,isNextTo:r,isInsideObject:a,containsRangeInObject:c}});break}}return n}_addSuggestionMarker(e,t,n,o,s=null){this._model.change((i=>{let r="suggestion:"+e+":"+t+":"+n;s&&(r=r+":"+s),i.addMarker(r,{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"),s=n.hasComments,i=n.subType?n.type+":"+n.subType:n.type,r=this.editor.locale.t,a=o.add(r({string:"Unsaved change in suggestion.",id:"PENDING_ACTION_SUGGESTION"})),c={id:t,type:i,hasComments:s,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,s=n.add(o({string:"Unsaved change in suggestion.",id:"PENDING_ACTION_SUGGESTION"}));this._adapter.updateSuggestion(e,t).then((()=>{n.remove(s)}))}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:s}=this._splitMarkerName(e),i=this._suggestions.get(t)||this._createSuggestion(n,o,t,s);switch(this._checkSuggestionCorrectness(i,n,o,s),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 s=this._suggestionFactory.getSuggestionCallback(e.type,e.subType,"chain"),i=this._suggestionFactory.getSuggestionCallback(o.type,o.subType,"chain"),r=s(e,o),a=i(e,o);r&&a&&(r[1].commentThread&&r[1].commentThread.length||(r[0].next=r[1],r[1].previous=r[0],r[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)(Qi,t.EmitterMixin);class Ji{constructor(e){this._editor=e,this._model=e.model,this._customCallbacks=new Map,this._defaultCallbacks=new Map,this._registerDefaultCallbacks()}buildSuggestion(e,t,n,o,s){return new gs(this._model,{type:e,subType:t,id:n,author:o,onAttributesChange:s,onAccept:(...n)=>this.getSuggestionCallback(e,t,"accept")(...n),onDiscard:(...n)=>this.getSuggestionCallback(e,t,"discard")(...n)})}registerCustomCallback(e,t,n,o){const s=e+":"+t+":"+n;this._customCallbacks.set(s,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:s=[]}=t,i=e[0];if("$graveyard"==i.root.rootName)return;const a=Array.from(this._model.document.selection.getRanges()).map((e=>r.LiveRange.fromRange(e)));Zi(i)?n.setSelection(this._model.createRange(i.end)):n.setSelection(i);for(const e of this._editor.commands.commands())e.refresh();s.push({forceDefaultExecution:!0}),this._editor.execute(o,...s);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),s=(e,t)=>sr(e,t,this._model)?[e,t]:sr(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",s),this._defaultCallbacks.set("deletion:accept",t),this._defaultCallbacks.set("deletion:discard",e),this._defaultCallbacks.set("deletion:join",o),this._defaultCallbacks.set("deletion:chain",s),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 Yi(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 Zi(e){return e.end.parent==e.start.nodeAfter&&e.end.isAtStart}function er(e,t,n,o){const s=e=>!e.item.is("textProxy")&&!o.isObject(e.item),i=e.start.getLastMatchingPosition(s),r=e.end.getLastMatchingPosition(s,{direction:"backward"});return!(e.start.isEqual(i)&&e.end.isEqual(r)||(i.isBefore(r)?n.updateMarker(t,{range:n.createRange(i,r)}):n.removeMarker(t),0))}function tr(e){return function(e){let t=0,n=0;for(const o of qi(e))t=(t<<5)-t+o,t&=t,[t,n]=[n,t];return Xi(t)+Xi(n)}(e)}function nr(e){const t=e.start.nodeAfter;return t&&t.is("element")}function or(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 sr(e,t,n){const o=e.getFirstRange(),s=t.getFirstRange();if(o.end.isEqual(s.start))return!0;if(e.type!=t.type)return!1;if(!o.end.isTouching(s.start))return!1;const i=n.createRange(o.end,s.start).getWalker();for(const e of i)if(["elementStart","elementEnd"].includes(e.type)&&n.schema.isLimit(e.item))return!1;return!0}var ir,rr,ar=["commentThreadController","_acceptCommand","destroy","discardSuggestion","model","unbind","view","execute","isEnabled","acceptSuggestion","_discardCommand","bind"];ir=ar,rr=180,function(e){for(;--e;)ir.push(ir.shift())}(++rr);var cr=function(e,t){return ar[e-=0]};class lr{constructor(e,t,n,o,s){this[cr("0x4")]=e,this[cr("0x6")]=t,this[cr("0x0")]=s,this[cr("0x1")]=n,this._discardCommand=o,this[cr("0x6")][cr("0xb")](cr("0x8")).to(this[cr("0x1")]),this.listenTo(t,cr("0x9"),(()=>this[cr("0x9")]())),this.listenTo(t,cr("0x3"),(()=>this[cr("0x3")]()))}[cr("0x9")](){this[cr("0x1")][cr("0x7")](this[cr("0x4")].id)}[cr("0x3")](){this[cr("0xa")][cr("0x7")](this[cr("0x4")].id)}[cr("0x2")](){this[cr("0x6")][cr("0x5")](cr("0x8")),this.stopListening(),this[cr("0x0")][cr("0x2")]()}}(0,t.mix)(lr,t.ObservableMixin);const gr=["showInput","addComment","fire","_createCommentThreadInputView","commentInputView","delegate","commentThreadInputView","bind","disableComments","commentThread","_createCommentViews","isEnabled","submit","editorConfig","destroy","removeComment","_localUser","focus","_config","set","value","element","isReadOnly","descriptionParts","isDirty","isActive","disabledSubmit","length","assign","commentsListView","createdAt","_model","locale"];var ur,dr;ur=gr,dr=159,function(e){for(;--e;)ur.push(ur.shift())}(++dr);const mr=function(e,t){return gr[e-=0]};class hr extends s.View{constructor(e,t,n,o){super(e),this[mr("0x2")]=null,this[mr("0xc")]=null,this[mr("0x19")](mr("0x1f"),!1),this[mr("0x19")](mr("0x3"),t[mr("0x3")]),this[mr("0xd")](mr("0x3")).to(t),this[mr("0x19")](mr("0x1d"),[]),this[mr("0x19")](mr("0x1e"),!1),this[mr("0x19")](mr("0x11"),!1),this[mr("0x4")]=t,this[mr("0x16")]=n,this[mr("0x18")]=o,o[mr("0xe")]?this.set("length",1):this[mr("0x10")]()}[mr("0x17")](){this[mr("0x1b")][mr("0x17")]()}[mr("0x14")](){this[mr("0x1e")]=!1,this.commentsListView&&this[mr("0x2")][mr("0x14")](),this[mr("0xc")]&&this[mr("0xc")][mr("0x14")](),super[mr("0x14")]()}[mr("0x10")](){const{CommentsListView:e}=this[mr("0x18")];this.commentsListView=new e(this[mr("0x5")],this[mr("0x4")][mr("0xf")],Object[mr("0x1")]({CommentView:this[mr("0x18")].CommentView},this._config)),this[mr("0x2")][mr("0xb")]("removeComment").to(this),this.commentsListView.delegate("updateComment").to(this),this[mr("0x2")][mr("0xd")](mr("0x1f")).to(this),this.set(mr("0x0"),this.commentsListView.length+1),this.bind("length").to(this.commentsListView,mr("0x0"),(e=>e+1)),this[mr("0xc")]=this[mr("0x9")](),this.on(mr("0x15"),(()=>this[mr("0x17")]())),this.bind(mr("0x1e")).to(this[mr("0x2")],"hasDirtyComment",this[mr("0xc")][mr("0xa")],mr("0x1a"),((e,t)=>e||!!t))}[mr("0x9")](){const{CommentThreadInputView:e}=this._config,t=new e(this[mr("0x5")],this[mr("0x16")],this[mr("0x18")][mr("0x13")]),n=t[mr("0xa")];return t[mr("0xd")](mr("0x6")).to(this,"isActive",this[mr("0x4")][mr("0xf")],mr("0x1c"),n,"value",((e,t,n)=>!!n||e&&!t)),n.on(mr("0x12"),((e,t)=>{this[mr("0x8")](mr("0x7"),t),n.editor.setData("")})),n.on("cancel",(()=>this[mr("0x17")]())),n[mr("0xd")](mr("0x20")).to(this._model[mr("0xf")],mr("0x1c")),t}}class fr extends hr{constructor(t,n,o,s){super(t,n,o,s);const{t:r}=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>"+pr(t.content,t.color)+"</p>";return t?n:(0,i.trimHtml)(n,{limit:140})})),this._descriptionElement=null,this.acceptButton=this._createButton(r("Accept suggestion"),e.icons.check,"ck-suggestion--accept","acceptSuggestion"),this.discardButton=this._createButton(r("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 s.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 pr(e,t){let n="";return n+=e.split("*").map(((e,t)=>t%2!=0?'<span class="ck-suggestion-type">'+br(e)+"</span>":br(e))).join(""),t&&(n+='<span class="ck-suggestion-color" style="background-color: '+t.value+'" title="'+t.title+'"></span>'),n}function br(e){const t=document.createElement("span");return t.innerText=e,t.innerHTML}var xr=n(596),yr=n.n(xr);const Cr=function(){return fe.Date.now()};var _r=/\s/;const kr=function(e){for(var t=e.length;t--&&_r.test(e.charAt(t)););return t};var vr=/^\s+/;const Er=function(e){return e?e.slice(0,kr(e)+1).replace(vr,""):e};var Tr=/^[-+]0x[0-9a-f]+$/i,Rr=/^0b[01]+$/i,Sr=/^0o[0-7]+$/i,wr=parseInt;const Ar=function(e){if("number"==typeof e)return e;if(fo(e))return NaN;if(Re(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Re(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Er(e);var n=Rr.test(e);return n||Sr.test(e)?wr(e.slice(2),n?2:8):Tr.test(e)?NaN:+e};var Ir=Math.max,Mr=Math.min;const Nr=function(e,t,n){var o,s,i,r,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=s;return o=s=void 0,l=t,r=e.apply(i,n)}function h(e){return l=e,a=setTimeout(p,t),g?m(e):r}function f(e){var n=e-c;return void 0===c||n>=t||n<0||u&&e-l>=i}function p(){var e=Cr();if(f(e))return b(e);a=setTimeout(p,function(e){var n=t-(e-c);return u?Mr(n,i-(e-l)):n}(e))}function b(e){return a=void 0,d&&o?m(e):(o=s=void 0,r)}function x(){var e=Cr(),n=f(e);if(o=arguments,s=this,c=e,n){if(void 0===a)return h(c);if(u)return clearTimeout(a),a=setTimeout(p,t),m(c)}return void 0===a&&(a=setTimeout(p,t)),r}return t=Ar(t)||0,Re(n)&&(g=!!n.leading,i=(u="maxWait"in n)?Ir(Ar(n.maxWait)||0,t):i,d="trailing"in n?!!n.trailing:d),x.cancel=function(){void 0!==a&&clearTimeout(a),l=0,o=c=s=a=void 0},x.flush=function(){return void 0===a?r:b(Cr())},x};class Fr extends e.Plugin{static get requires(){return[Qi,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",fr),t.define("trackChanges.disableComments",!1),this._disableComments=t.get("trackChanges.disableComments")}init(){const e=this.editor,t=e.plugins.get(Qi),n=e.plugins.get("Annotations"),o=e.plugins.get("EditorAnnotations"),s=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(),s=[];for(const e of o){if(!e.isInContent)continue;if(e.isMultiRange){s.push(...e.getRanges());continue}const t=e.getFirstRange();if(s.length>0){const e=s[0].getJoined(t);if(e){s[0]=e;continue}}s.push(t)}e.push([n.view,s])}return e})),this.listenTo(t,"suggestionLoaded",((e,t)=>{let n=!1;const s=Nr((e=>{n||e?n&&e&&(this._destroyController(t),o.refreshSelectedViews(),n=!1):(this._initializeController(t),o.refreshSelectedViews(),n=!0)}),10);this._debouncedHandlers.set(t,s),this.listenTo(t,"change:previous",((e,n,o,i)=>{t.isInContent&&(null==o?(this._updateController(i.head),s(!1)):(this._updateController(o.head),s(!0)))})),null===t.previous?s(!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,s=this._suggestionToController.get(o);null!==n&&this._updateController(o),null===n&&s&&this._destroyController(t)})),this.listenTo(t,"suggestionChanged",((e,t)=>{this._updateController(t)})),this.listenTo(n,"change:activeAnnotations",((e,n,o)=>{const s=Array.from(o,(e=>e.innerView)).filter((e=>this._viewToController.has(e))),i=[];for(const e of s){const t=this._viewToController.get(e).model.getAllAdjacentSuggestions();i.push(...t.reduce(((e,t)=>[...e,...t.getMarkerNames()]),[]))}t.activeMarkers=i})),this.listenTo(s,"addComment",((e,{threadId:n,isFromAdapter:o})=>{if(o||!t.hasSuggestion(n))return;const s=t.getSuggestion(n);this._suggestionToController.get(s).view.focus()}),{priority:"lowest"})}_createUIButton(e){const n=(0,s.createDropdown)(e,s.SplitButtonView),o=this.editor.commands.get("trackChanges"),{t:i}=this.editor;n.buttonView.set({tooltip:i("Track changes"),label:i("Track changes"),icon:yr()}),n.buttonView.bind("isOn").to(o,"value"),n.buttonView.on("execute",(()=>o.execute()));const r=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 s.Model(e.model),o=this.editor.commands.get(n.commandName);n.bind("isOn","isEnabled").to(o,"value","isEnabled"),t.model=n}r.add(t)}(0,s.addListToDropdown)(n,r);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"),s=t.plugins.get("CommentsRepository"),r=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}),h=s.createCommentThreadController(e.commentThread,m),f=new lr(e,m,c,l,h);m.descriptionParts=t.plugins.get("TrackChangesEditing")._descriptionFactory.getDescriptions(r),this._suggestionToController.set(e,f),this._viewToController.set(m,f);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 b=o.createAnnotation({view:p,target:()=>{const e=r[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-"+f.view.type});o.add(b);const x=t.plugins.get("PendingActions");let y;m.on("change:isDirty",((e,t,n)=>{if(n){const e=this.editor.locale.t;y=x.add(e({string:"Unsaved change in suggestion.",id:"PENDING_ACTION_SUGGESTION"}))}else x.remove(y),y=null}))}_destroyController(e){const t=this.editor.plugins.get("Annotations"),n=this._suggestionToController.get(e),o=n.view,s=t.getByInnerView(o);s&&t.remove(s),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 Pr,Or,Lr=["getSuggestions","plugins","editor","Comments","getSuggestion","addSuggestion","addSuggestionData","get","adapter","requires"];Pr=Lr,Or=346,function(e){for(;--e;)Pr.push(Pr.shift())}(++Or);var Br=function(e,t){return Lr[e-=0]};class jr extends e.Plugin{static get[Br("0x3")](){return[Qi,Fr,Br("0x7")]}static get pluginName(){return"TrackChanges"}set adapter(e){this[Br("0x6")][Br("0x5")][Br("0x1")](Qi)[Br("0x2")]=e}get adapter(){return this.editor.plugins[Br("0x1")](Qi)[Br("0x2")]}[Br("0x9")](e){return this[Br("0x6")][Br("0x5")][Br("0x1")](Qi)[Br("0x0")](e)}[Br("0x4")](e){return this.editor[Br("0x5")][Br("0x1")](Qi)[Br("0x4")](e)}[Br("0x8")](e){return this[Br("0x6")][Br("0x5")].get(Qi)[Br("0x8")](e)}}const Dr=["add","string","extraPlugins","reduce","track-changes-data-invalid-editor-creator","data","names","toolbar","requires","trackChangesData.editorCreator","discardAllSuggestions","concat","has","find","getDataWithDiscardedSuggestions","init","getUser","push","plugins","context","document","config","CommentsRepository","div","result","addSuggestionData","editorCreator","users","RealTimeCollaborativeTrackChanges","model","pluginName","TrackChangesEditing","createDocumentFragment","appendChild","editor","createElement","execute","addUser","_adapter","getSuggestions","getRootNames","define","name","includes","get","TrackChangesData","Autosave","map","every","constructor","destroy","trackChangesData","Users","useAnonymousUser","function"];var Ur,Hr;Ur=Dr,Hr=250,function(e){for(;--e;)Ur.push(Ur.shift())}(++Hr);const Vr=function(e,t){return Dr[e-=0]},zr=["initialData",Vr("0x2c"),Vr("0x20")],Gr=["RealTimeCollaborativeEditing","RealTimeCollaborativeComments",Vr("0x35"),Vr("0x10")];class Wr extends e.Plugin{static get[Vr("0x21")](){return[Qi]}static get[Vr("0x0")](){return Vr("0xf")}[Vr("0x28")](){const e=this[Vr("0x4")];if(e[Vr("0x2e")][Vr("0xb")](Vr("0x22"),(t=>e[Vr("0x13")].create("",t))),Vr("0x18")!=typeof e[Vr("0x2e")].get(Vr("0x15"))[Vr("0x33")])throw new t.CKEditorError(Vr("0x1d"))}getDataWithAcceptedSuggestions(e){return $r(this[Vr("0x4")],!0,e)}[Vr("0x27")](e){return $r(this[Vr("0x4")],!1,e)}}class qr extends e.Plugin{static get[Vr("0x0")](){return"TrackChangesDataGetter"}[Vr("0x28")](){this[Vr("0x31")]="end",this.editor.plugins[Vr("0xe")](Vr("0x2f"))[Vr("0x8")]={getCommentThread:()=>new Promise((()=>{}))},this[Vr("0x4")][Vr("0x2b")].get(Vr("0x1"))[Vr("0x8")]=null}}async function $r(e,t,n){const o=function(e){const t={};for(const n of e[Vr("0x2e")][Vr("0x1f")]())zr[Vr("0xd")](n)||(t[n]=e[Vr("0x2e")][Vr("0xe")](n));const n=e[Vr("0x13")].builtinPlugins||[],o=t[Vr("0x1b")]||[];delete t.extraPlugins;const s=n.concat(t[Vr("0x2b")])[Vr("0x24")](o)[Vr("0x11")]((e=>Vr("0x1a")==typeof e?n[Vr("0x26")]((t=>t[Vr("0x0")]==e)):e)),i=Array.from(new Set(s));return t[Vr("0x2b")]=i.filter((e=>Kr(e,new Set))),t.plugins[Vr("0x2a")](qr),t.plugins[Vr("0x2a")](Qi),t}(e),s=document[Vr("0x2")](),i=e[Vr("0x2e")][Vr("0xe")](Vr("0x15")).editorCreator,r=await i(o,(()=>function(e){const t=document[Vr("0x5")](Vr("0x30"));return e[Vr("0x3")](t),t}(s)));!function(e,t){const n=e[Vr("0x36")][Vr("0x2d")][Vr("0xa")]()[Vr("0x1c")](((t,n)=>(t[n]=e[Vr("0x1e")][Vr("0xe")]({rootName:n}),t)),{}),o=e[Vr("0x2b")][Vr("0xe")]("Users")[Vr("0x34")][Vr("0x11")]((e=>({id:e.id}))),s=e.plugins[Vr("0xe")](Vr("0x1"))[Vr("0x9")]({skipNotAttached:!0,toJSON:!0}),i=t.plugins[Vr("0xe")](Vr("0x16")),r=t[Vr("0x2b")][Vr("0xe")]("TrackChangesEditing");for(const e of o)i[Vr("0x29")](e.id)||i[Vr("0x7")](e);i.me||i[Vr("0x17")]();for(const e of s)r[Vr("0x32")](e);t[Vr("0x1e")].set(n)}(e,r),r[Vr("0x6")](t?"acceptAllSuggestions":Vr("0x23"));const a=r[Vr("0x1e")][Vr("0xe")](n);return await r[Vr("0x14")](),a}function Kr(e,t){if(t[Vr("0x25")](e))return!0;t[Vr("0x19")](e);const n="function"==typeof e?e[Vr("0x0")]||e[Vr("0xc")]:e;return(!n||!Gr.includes(n))&&(!e[Vr("0x21")]||e[Vr("0x21")][Vr("0x12")]((e=>Kr(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:()=>_a,TrackChanges:()=>Ba,TrackChangesData:()=>Ka});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 x="object"==typeof global&&global&&global.Object===Object&&global;var a="object"==typeof self&&self&&self.Object===Object&&self;const c=x||a||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,I=/^0b[01]+$/i,S=/^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=I.test(t);return n||S.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,x,a,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,x=t.apply(s,n)}function h(t){return u=t,a=setTimeout(b,e),d?m(t):x}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);a=setTimeout(b,function(t){var n=e-(t-c);return g?L(n,s-(t-u)):n}(t))}function E(t){return a=void 0,f&&o?m(t):(o=r=void 0,x)}function _(){var t=l(),n=p(t);if(o=arguments,r=this,c=t,n){if(void 0===a)return h(c);if(g)return clearTimeout(a),a=setTimeout(b,e),m(c)}return void 0===a&&(a=setTimeout(b,e)),x}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!==a&&clearTimeout(a),u=0,o=c=r=a=void 0},_.flush=function(){return void 0===a?x:E(l())},_};var F=n(492),P=n(995);const D=["value","_disableUnsupportedCommands","_enableCommands","_enabledCommands","execute","clearForceDisabled","affectsData","commands","has","TrackChangesCommand"];var j,B;j=D,B=223,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[U("0x0")]=e,this[U("0x7")]=!1,this.refresh()}refresh(){this.isEnabled=!0}[U("0x1")](){this[U("0x7")]=!this[U("0x7")],this[U("0x7")]?this[U("0x8")]():this[U("0x9")]()}_disableUnsupportedCommands(){for(const t of this.editor.commands.commands())t[U("0x3")]&&!this[U("0x0")][U("0x5")](t)&&t.forceDisabled(U("0x6"))}[U("0x9")](){for(const t of this.editor[U("0x4")][U("0x4")]())t[U("0x3")]&&!this[U("0x0")][U("0x5")](t)&&t[U("0x2")](U("0x6"))}}const G=["track-changes-accept-suggestion-not-found","get","TrackChangesEditing","execute","plugins","_suggestions","refresh","editor"];var z,V;z=G,V=446,function(t){for(;--t;)z.push(z.shift())}(++V);const W=function(t,e){return G[t-=0]};class K extends t.Command{constructor(t,e){super(t),this[W("0x7")]=e,this[W("0x0")]()}[W("0x0")](){this.isEnabled=!0}[W("0x5")](t){const n=this[W("0x7")][W("0x3")](t);if(!n)throw new e.CKEditorError(W("0x2"),this);this[W("0x1")][W("0x6")][W("0x3")](W("0x4")).acceptSuggestion(n)}}const q=["TrackChangesEditing","discardSuggestion","execute","plugins","refresh","_suggestions","get","editor"];var $,X;$=q,X=458,function(t){for(;--t;)$.push($.shift())}(++X);const J=function(t,e){return q[t-=0]};class Q extends t.Command{constructor(t,e){super(t),this[J("0x3")]=e,this.refresh()}[J("0x2")](){this.isEnabled=!0}[J("0x0")](t){const n=this[J("0x3")].get(t);if(!n)throw new e.CKEditorError("track-changes-discard-suggestion-not-found",this);this[J("0x5")][J("0x1")][J("0x4")](J("0x6"))[J("0x7")](n)}}var Y,Z,tt=["deletion","type"];Y=tt,Z=220,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("0x1")]&&"deletion"!=e[et("0x1")]?-1:et("0x0")!=t[et("0x1")]&&et("0x0")==e.type?1:0))}const ot=["values","editor","isEnabled","_suggestions","from","isInContent","model","refresh","_acceptSuggestionCommand","some","execute"];var rt,st;rt=ot,st=487,function(t){for(;--t;)rt.push(rt.shift())}(++st);const it=function(t,e){return ot[t-=0]};class xt extends t.Command{constructor(t,e,n){super(t),this[it("0x5")]=e,this[it("0x0")]=n,this[it("0x4")]()}[it("0x4")](){const t=this[it("0x5")];this.isEnabled=t[it("0xa")]&&Array.from(this[it("0x0")].values())[it("0x6")]((t=>t.isInContent))}[it("0x7")](){this[it("0x9")][it("0x3")].change((()=>{const t=nt(Array[it("0x1")](this._suggestions[it("0x8")]()));for(const e of t)e[it("0x2")]&&this[it("0x5")][it("0x7")](e.id)}))}}const at=["isMultiRange","next","getRange","isCollapsed","end","from","isIntersecting","start","getMarkers","isInContent","isTouching","add"];var ct,lt;ct=at,lt=438,function(t){for(;--t;)ct.push(ct.shift())}(++lt);const ut=function(t,e){return at[t-=0]};function dt(t,e){const n=Array[ut("0xb")](t.getRanges()),o=new Set;for(const r of e)if(r[ut("0x3")])for(const e of n)for(const n of r[ut("0x2")]()){const s=n[ut("0x8")]();(e[ut("0x0")](s)||t[ut("0x9")]&&!r[ut("0x6")]&&r[ut("0x7")]&&s[ut("0xa")][ut("0x4")](e[ut("0x1")]))&&o[ut("0x5")](r)}return o}const gt=["execute","selection","size","_suggestions","document","isEnabled","model","editor","refresh","_selectedSuggestions","_acceptSuggestionCommand","values","from","change"];var ft,mt;ft=gt,mt=185,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("0x7")]=e,this[ht("0x0")]=n,this[ht("0x6")]=new Set,this.refresh()}[ht("0x5")](){const t=this._acceptSuggestionCommand,e=this[ht("0x4")][ht("0x3")][ht("0x1")][ht("0xc")],n=Array.from(this[ht("0x0")][ht("0x8")]());this[ht("0x6")]=dt(e,n),this.isEnabled=t[ht("0x2")]&&!!this[ht("0x6")][ht("0xd")]}[ht("0xb")](){this.editor.model[ht("0xa")]((()=>{const t=nt(Array[ht("0x9")](this[ht("0x6")]));for(const e of t)this[ht("0x7")].execute(e.id)}))}}const bt=["_discardSuggestionCommand","values","change","editor","from","execute","refresh","isInContent","isEnabled","model","some","_suggestions"];var Et,_t;Et=bt,_t=413,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("0x7")]=e,this[yt("0x6")]=n,this[yt("0x1")]()}[yt("0x1")](){const t=this._discardSuggestionCommand;this[yt("0x3")]=t[yt("0x3")]&&Array[yt("0xb")](this[yt("0x6")][yt("0x8")]())[yt("0x5")]((t=>t[yt("0x2")]))}[yt("0x0")](){this[yt("0xa")][yt("0x4")][yt("0x9")]((()=>{for(const t of this[yt("0x6")][yt("0x8")]())t[yt("0x2")]&&this[yt("0x7")][yt("0x0")](t.id)}))}}const Ct=["from","_suggestions","_discardSuggestionCommand","_selectedSuggestions","values","execute","document","size","model","refresh","editor","isEnabled","selection"];var kt,vt;kt=Ct,vt=486,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("0xa")]=e,this[At("0x9")]=n,this._selectedSuggestions=new Set,this.refresh()}[At("0x4")](){const t=this[At("0xa")],e=this.editor[At("0x3")][At("0x1")][At("0x7")],n=Array[At("0x8")](this[At("0x9")][At("0xc")]());this[At("0xb")]=dt(e,n),this[At("0x6")]=t.isEnabled&&!!this[At("0xb")][At("0x2")]}execute(){this[At("0x5")][At("0x3")].change((()=>{for(const t of this._selectedSuggestions)this[At("0xa")][At("0x0")](t.id)}))}}const It=function(){this.__data__=[],this.size=0};const St=function(t,e){return t===e||t!=t&&e!=e};const wt=function(t,e){for(var n=t.length;n--;)if(St(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=It,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 zt=c["__core-js_shared__"];var Vt,Wt=(Vt=/[^.]+$/.exec(zt&&zt.keys&&zt.keys.IE_PROTO||""))?"Symbol(src)_1."+Vt:"";const Kt=function(t){return!!Wt&&Wt in t};var qt=Function.prototype.toString;const $t=function(t){if(null!=t){try{return qt.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($t(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 xe=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e};var ae=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 ae.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=xe,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 Ie=function(){try{var t=oe(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();const Se=function(t,e,n){"__proto__"==e&&Ie?Ie(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)&&St(o,n)&&(void 0!==n||e in t)||Se(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 x=e[s],a=o?o(n[x],t[x],x,n,t):void 0;void 0===a&&(a=t[x]),r?Se(n,x,a):Me(n,x,a)}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,ze=Ge&&Ge.exports===He?c.Buffer:void 0;const Ve=(ze?ze.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 qe=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991};var $e={};$e["[object Float32Array]"]=$e["[object Float64Array]"]=$e["[object Int8Array]"]=$e["[object Int16Array]"]=$e["[object Int32Array]"]=$e["[object Uint8Array]"]=$e["[object Uint8ClampedArray]"]=$e["[object Uint16Array]"]=$e["[object Uint32Array]"]=!0,$e["[object Arguments]"]=$e["[object Array]"]=$e["[object ArrayBuffer]"]=$e["[object Boolean]"]=$e["[object DataView]"]=$e["[object Date]"]=$e["[object Error]"]=$e["[object Function]"]=$e["[object Map]"]=$e["[object Number]"]=$e["[object Object]"]=$e["[object RegExp]"]=$e["[object Set]"]=$e["[object String]"]=$e["[object WeakMap]"]=!1;const Xe=function(t){return v(t)&&qe(t.length)&&!!$e[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&&x.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&&Ve(t),s=!n&&!o&&!r&&nn(t),i=n||o||r||s,x=i?Le(t.length,String):[],a=x.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,a))||x.push(c);return x};var sn=Object.prototype;const xn=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||sn)};const an=function(t,e){return function(n){return t(e(n))}};const cn=an(Object.keys,Object);var ln=Object.prototype.hasOwnProperty;const un=function(t){if(!xn(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&&qe(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=xn(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 In=Object.prototype.propertyIsEnumerable,Sn=Object.getOwnPropertySymbols;const wn=Sn?function(t){return null==t?[]:(t=Object(t),An(Sn(t),(function(e){return In.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=an(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 zn="[object Map]",Vn="[object Promise]",Wn="[object Set]",Kn="[object WeakMap]",qn="[object DataView]",$n=$t(Bn),Xn=$t(re),Jn=$t(Un),Qn=$t(Hn),Yn=$t(Gn),Zn=k;(Bn&&Zn(new Bn(new ArrayBuffer(1)))!=qn||re&&Zn(new re)!=zn||Un&&Zn(Un.resolve())!=Vn||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?$t(n):"";if(o)switch(o){case $n:return qn;case Xn:return zn;case Jn:return Vn;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 xo=function(t){var e=new t.constructor(t.source,io.exec(t));return e.lastIndex=t.lastIndex,e};var ao=m?m.prototype:void 0,co=ao?ao.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 xo(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||xn(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,x){var a,c=1&n,l=2&n,u=4&n;if(o&&(a=s?o(e,r,s,x):o(e)),void 0!==a)return a;if(!i(e))return e;var d=Be(e);if(d){if(a=no(e),!c)return vn(e,a)}else{var g=to(e),f=g==ko||"[object GeneratorFunction]"==g;if(Ve(e))return kn(e,c);if(g==vo||g==Co||f&&!s){if(a=l||f?{}:ho(e),!c)return l?Fn(e,En(a,e)):Mn(e,fn(a,e))}else{if(!Ao[g])return s?e:{};a=go(e,g,c)}}x||(x=new Ae);var m=x.get(e);if(m)return m;x.set(e,a),To(e)?e.forEach((function(r){a.add(t(r,n,o,r,e,x))})):Eo(e)&&e.forEach((function(r,s){a.set(s,t(r,n,o,s,e,x))}));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(a,s,t(r,n,o,s,e,x))})),a};const Io=function(t){return Ro(t,5)};var So=/\.|\[(?:[^[\]]*|(["'])(?:(?!\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)||!So.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 zo=function(t){if("string"==typeof t||A(t))return t;var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e};const Vo=function(t,e,n,o){if(!i(t))return t;for(var r=-1,s=(e=Go(e,t)).length,x=s-1,a=t;null!=a&&++r<s;){var c=zo(e[r]),l=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return t;if(r!=x){var u=a[c];void 0===(l=o?o(u,c,a):void 0)&&(l=i(u)?u:Ke(e[r+1])?[]:{})}Me(a,c,l),a=a[c]}return t};const Wo=function(t,e,n){return null==t?t:Vo(t,e,n)};const Ko=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this};const qo=function(t){return this.__data__.has(t)};function $o(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Ce;++e<n;)this.add(t[e])}$o.prototype.add=$o.prototype.push=Ko,$o.prototype.has=qo;const Xo=$o;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,x=t.length,a=e.length;if(x!=a&&!(i&&a>x))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<x;){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 St(+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 x=Zo;case"[object Set]":var a=1&o;if(x||(x=tr),t.size!=e.size&&!a)return!1;var c=i.get(t);if(c)return c==e;o|=2,i.set(t,e);var l=Yo(x(t),x(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,x=Dn(t),a=x.length;if(a!=Dn(e).length&&!i)return!1;for(var c=a;c--;){var l=x[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<a;){var m=t[l=x[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]",xr="[object Array]",ar="[object Object]",cr=Object.prototype.hasOwnProperty;const lr=function(t,e,n,o,r,s){var i=Be(t),x=Be(e),a=i?xr:to(t),c=x?xr:to(e),l=(a=a==ir?ar:a)==ar,u=(c=c==ir?ar:c)==ar,d=a==c;if(d&&Ve(t)){if(!Ve(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,a,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[zo(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[zo(gr(e))]};const br=function(t,e){return null==t||pr(t,e)},Er=["removeMarker","accept","_onAttributesChange","_onAccept","addMarker","push","isInContent","decorate","end","getAllAdjacentSuggestions","getContainedElement","createdAt","isMultiRange","subType","markers","data","length","addMarkerName","getMarkerNames","isIntersectingWithRange","from","author","getRange","change","filter","onDiscard","attributes","set","onAccept","_saved","map","getMultiRangeId","getFirstRange","isIntersecting","discard","previous","suggestion:","commentThread","next","type","split","_markerNames","onAttributesChange","getRanges","_onDiscard","getMarkers","removeMarkers","toJSON","hasComments","clear","removeAttribute","getFirstMarker","_model","delete","getItems","head"];var _r,yr;_r=Er,yr=315,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("0x4")]=e[Tr("0x4")],this[Tr("0x22")]=e[Tr("0x22")]||null,this[Tr("0x2a")]=e[Tr("0x2a")],this.data=null,this[Tr("0x11")]=t,this._onAccept=e[Tr("0x31")],this[Tr("0x9")]=e[Tr("0x2e")],this[Tr("0x17")]=e[Tr("0x7")],this[Tr("0x6")]=new Set,this.set(Tr("0x20"),null),this[Tr("0x30")](Tr("0x2f"),e.attributes||{}),this.set(Tr("0x0"),null),this.set("next",null),this.set(Tr("0x2"),null),this[Tr("0x30")](Tr("0x32"),!1),this.decorate(Tr("0x16")),this[Tr("0x1c")]("discard")}get head(){let t=this;for(;t[Tr("0x0")];)t=t[Tr("0x0")];return t}get[Tr("0xd")](){return!!this[Tr("0x2")]&&this[Tr("0x2")][Tr("0x25")]>0}get[Tr("0x21")](){return 0!=this[Tr("0x6")].size&&6==Array.from(this[Tr("0x6")])[0][Tr("0x5")](":")[Tr("0x25")]}get[Tr("0x1b")](){return null!==this.getFirstMarker()}[Tr("0x26")](t){this[Tr("0x6")].add(t)}[Tr("0x27")](){return Array[Tr("0x29")](this._markerNames)}[Tr("0xa")](){return this[Tr("0x27")]()[Tr("0x33")]((t=>this[Tr("0x11")][Tr("0x23")].get(t)))[Tr("0x2d")]((t=>t))}getFirstMarker(){return this.getMarkers()[0]||null}[Tr("0xb")](){this._model[Tr("0x2c")]((t=>{for(const e of this.getMarkers())t[Tr("0x15")](e)})),this[Tr("0x6")][Tr("0xe")]()}removeMarker(t){this[Tr("0x11")][Tr("0x2c")]((e=>{e[Tr("0x15")](t)})),this[Tr("0x6")][Tr("0x12")](t)}addRange(t){const e=Tr("0x1")+this.type+":"+this[Tr("0x22")]+":"+this.id+":"+this.author.id+":"+Cr[Tr("0x34")]();this[Tr("0x26")](e),this[Tr("0x11")][Tr("0x2c")]((n=>{n[Tr("0x19")](e,{range:t,usingOperation:!0,affectsData:!0})}))}[Tr("0x28")](t){for(const e of this[Tr("0x8")]())if(e[Tr("0x36")](t))return!0;return!1}getRanges(){return this[Tr("0xa")]()[Tr("0x33")]((t=>t[Tr("0x2b")]()))}getItems(){return this[Tr("0x8")]().reduce(((t,e)=>[...t,...e[Tr("0x13")]()]),[])}[Tr("0x35")](){return this[Tr("0x10")]()[Tr("0x2b")]()}[Tr("0x1f")](){const t=this[Tr("0x8")]();if(1!=t[Tr("0x25")])return null;const e=t[0],n=e.start.nodeAfter,o=e[Tr("0x1d")].nodeBefore;return n instanceof F.Element?n!=o?null:n:null}[Tr("0x16")](){this[Tr("0x18")](this.getRanges(),this[Tr("0x24")],this[Tr("0x2f")]),this[Tr("0xb")]()}[Tr("0x37")](){this._onDiscard(this[Tr("0x8")](),this[Tr("0x24")],this[Tr("0x2f")]),this[Tr("0xb")]()}[Tr("0x1e")](){const t=[];let e=this[Tr("0x14")];for(;e;)t[Tr("0x1a")](e),e=e[Tr("0x3")];return t}setAttribute(t,e){const n=Io(this.attributes);Wo(n,t,e),dr(n,this[Tr("0x2f")])||(this[Tr("0x2f")]=n,this._onAttributesChange(n))}[Tr("0xf")](t){const e=Io(this[Tr("0x2f")]);br(e,t),dr(e,this[Tr("0x2f")])||(this[Tr("0x2f")]=e,this[Tr("0x17")](this.attributes))}[Tr("0xc")](){return{id:this.id,type:this[Tr("0x22")]?this.type+":"+this[Tr("0x22")]:this[Tr("0x4")],authorId:this.author.id,createdAt:this[Tr("0x20")],hasComments:this[Tr("0xd")],data:this.data,attributes:this.attributes}}static getMultiRangeId(){return(0,e.uid)().substr(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"*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_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=["start","getItemLabel","*Merge:* %0","indexOf","set","element","addEmptyContainer","remove","EmptyContainer","getFirstRange","_addDescriptionItems","name","addObject","deletion","length","insertion","replace","*Split:* %0","softBreak","end","data","_schema","$text","*Insert:* %0","removeContainer","_resolveDescriptionItems","text","addContainer","Container","*Remove:* %0","isEqual","checkChild","elementStart","isEmpty","getDescriptions","_itemLabels","pop","_locale","elementEnd","add","item","push","Object","isObject","skip","_customCallbacks","ELEMENT_SPACE","function","nextSibling","previousSibling","get","type","REPLACE_TEXT","$1 $2","removeEmptyContainer","quantity","isInContent"];var Ar,Rr;Ar=vr,Rr=281,function(t){for(;--t;)Ar.push(Ar.shift())}(++Rr);const Ir=function(t,e){return vr[t-=0]};class Sr{constructor(t,e){this[Ir("0x31")]=[],this[Ir("0x27")]=new Map,this[Ir("0x19")]=t,this._locale=e}[Ir("0x26")](t){const e=[];for(let n=0;n<t.length;n++){const o=t[n];if(!o[Ir("0x3")])continue;let r=!1;for(const t of this[Ir("0x31")]){const n=t(o);if(n){n[Ir("0x37")]&&e[Ir("0x2d")](n),r=!0;break}}if(!r){this[Ir("0xe")](e,o);const r=t[n+1];if(r&&!o[Ir("0xd")]()[Ir("0x17")][Ir("0x22")](r[Ir("0xd")]()[Ir("0x4")])){const t=e[e.length-1],n=Ir("0x13")==o[Ir("0x37")]?"add":Ir("0xb");t&&"text"==t.type&&(t[n]+="\n")}}}return this._resolveDescriptionItems(e)}registerDescriptionCallback(t){this._customCallbacks[Ir("0x2d")](t)}registerElementLabel(t,e){this[Ir("0x27")][Ir("0x8")](t,e)}[Ir("0x5")](t,e=1){const n=this[Ir("0x27")][Ir("0x36")](t)||t;return Ir("0x33")==typeof n?n(e):1!==e?e+" "+n+"s":""+n}[Ir("0xe")](t,e){const n=e.getFirstRange().getWalker(),o=Ir("0x13")==e.type?"add":Ir("0xb");for(const e of n){const r=e[Ir("0x2c")],s=t[t.length-1];if(r.is("textProxy"))s&&s.type[Ir("0x7")](Ir("0x20"))>-1&&t[Ir("0x28")](),s&&Ir("0x1e")==s[Ir("0x37")]?s[o]+=r[Ir("0x18")]:t[Ir("0x2d")]({type:Ir("0x1e"),add:Ir("0x2b")==o?r[Ir("0x18")]:"",remove:"remove"==o?r[Ir("0x18")]:""});else if(this._schema[Ir("0x2f")](r)){if(s&&s.type[Ir("0x7")](Ir("0x20"))>-1&&t[Ir("0x28")](),Ir("0x2a")==e[Ir("0x37")])continue;s&&s[Ir("0x37")]==o+Ir("0x2e")&&s[Ir("0xf")]==r[Ir("0xf")]?s[Ir("0x2")]++:t[Ir("0x2d")]({type:o+"Object",name:r[Ir("0xf")],quantity:1}),n[Ir("0x30")]((t=>!(Ir("0x2a")==t[Ir("0x37")]&&t[Ir("0x2c")]==r)))}else if(this._schema[Ir("0x23")](r,Ir("0x1a"))||r.is(Ir("0x9"),Ir("0x16"))){if(Ir("0x2b")==o&&Ir("0x24")==e[Ir("0x37")]||Ir("0xb")==o&&Ir("0x2a")==e[Ir("0x37")])continue;if(s&&-1==s[Ir("0x37")][Ir("0x7")](Ir("0x20"))){Ir("0x1e")==s.type&&(s[o]+="\n");continue}let n;if(n=Ir("0x2b")==o?r.nextSibling&&!this[Ir("0x19")][Ir("0x2f")](r[Ir("0x34")])?r[Ir("0x34")]:null:r[Ir("0x35")]&&!this[Ir("0x19")][Ir("0x2f")](r[Ir("0x35")])?r[Ir("0x35")]:null,r.isEmpty||n&&n[Ir("0x25")]){const e=n&&n.isEmpty?n.name:r[Ir("0xf")];s&&s[Ir("0x37")]==o+Ir("0xc")&&s[Ir("0xf")]==e?s[Ir("0x2")]++:t[Ir("0x2d")]({type:o+Ir("0xc"),name:e,quantity:1})}else t[Ir("0x2d")]({type:o+Ir("0x20"),name:r[Ir("0xf")]})}}}[Ir("0x1d")](t){const e=this[Ir("0x29")],n=[];for(const o of t){switch(o.type){case Ir("0x1e"):if(o[Ir("0x2b")]=o[Ir("0x2b")][Ir("0x14")](/(\S)\u000A+(\S)/g,"$1 $2").replace(/\u000A/g,""),o[Ir("0xb")]=o[Ir("0xb")].replace(/(\S)\u000A+(\S)/g,Ir("0x0"))[Ir("0x14")](/\u000A/g,""),""!=o.add&&""!=o[Ir("0xb")]){n[Ir("0x2d")]({type:Ir("0x14"),content:kr(e,Ir("0x38"),['"'+o[Ir("0xb")]+'"','"'+o[Ir("0x2b")]+'"'])});continue}if(null!=o[Ir("0x2b")].match(/^ +$/)){n.push({type:Ir("0x13"),content:kr(e,Ir("0x1b"),kr(e,Ir("0x32"),o[Ir("0x2b")][Ir("0x12")]))});continue}if(null!=o.remove.match(/^ +$/)){n[Ir("0x2d")]({type:Ir("0x11"),content:kr(e,Ir("0x21"),kr(e,Ir("0x32"),o[Ir("0xb")].length))});continue}if(""!=o[Ir("0x2b")]){n.push({type:Ir("0x13"),content:kr(e,"*Insert:* %0",'"'+o[Ir("0x2b")]+'"')});continue}n[Ir("0x2d")]({type:"deletion",content:kr(e,Ir("0x21"),'"'+o[Ir("0xb")]+'"')});continue;case Ir("0xa"):case Ir("0x10"):n.push({type:"insertion",content:kr(e,Ir("0x1b"),this[Ir("0x5")](o.name,o.quantity))});continue;case Ir("0x1"):case"removeObject":n.push({type:Ir("0x11"),content:kr(e,Ir("0x21"),this[Ir("0x5")](o.name,o.quantity))});continue;case Ir("0x1f"):n.push({type:"insertion",content:kr(e,Ir("0x15"),this[Ir("0x5")](o.name,o[Ir("0x2")]))});continue;case Ir("0x1c"):n[Ir("0x2d")]({type:"deletion",content:kr(e,Ir("0x6"),this.getItemLabel(o.name,o[Ir("0x2")]))});continue}n[Ir("0x2d")](o)}return n}}const wr=["alignment","right","editor","afterInit","getSelectedBlocks","left","model","FORMAT_ALIGN_TO_LEFT","has","FORMAT_ALIGN_TO_CENTER","value","plugins","checkAttribute","enableCommand","FORMAT_JUSTIFY_TEXT","TrackChangesEditing","FORMAT_ALIGN_TO_RIGHT","_descriptionFactory","change","ltr","get","document","selection","markBlockFormat","*Format:* %0","registerDescriptionCallback","locale","center"];var Mr,Nr;Mr=wr,Nr=339,function(t){for(;--t;)Mr.push(Mr.shift())}(++Nr);const Lr=function(t,e){return wr[t-=0]};class Or extends t.Plugin{[Lr("0x0")](){const t=this.editor,e=t[Lr("0x17")];if(!t[Lr("0x8")][Lr("0x5")]("AlignmentEditing"))return;const n=t[Lr("0x8")][Lr("0x11")](Lr("0xc"));n[Lr("0xa")]("alignment",((e,o={})=>{let r=o[Lr("0x7")];o[Lr("0x7")]||(r=Lr("0x10")===t.locale.contentLanguageDirection?Lr("0x2"):Lr("0x1a"));const s=Array.from(this[Lr("0x1b")][Lr("0x3")][Lr("0x12")][Lr("0x13")][Lr("0x1")]()).filter((t=>function(t,e,n){const o=t.getAttribute(Lr("0x19"))||null;return e[Lr("0x9")](t,"alignment")&&n!=o}(t,this[Lr("0x1b")][Lr("0x3")].schema,r)));t.model[Lr("0xf")]((()=>{for(const t of s)n[Lr("0x14")](t,{commandName:Lr("0x19"),commandParams:[{value:r}]})}))})),n[Lr("0xe")][Lr("0x16")]((t=>{const{data:n}=t;if(n&&"alignment"==n.commandName){const t=n.commandParams[0][Lr("0x7")];return{type:"format",content:kr(e,Lr("0x15"),function(t){switch(t){case Lr("0x2"):return kr(e,Lr("0x4"));case Lr("0x1a"):return kr(e,Lr("0xd"));case Lr("0x18"):return kr(e,Lr("0x6"));case"justify":return kr(e,Lr("0xb"))}}(t))}}}))}}const Fr=["listItem","activeMarkers","getWalker","elementEnd","isContent","plugins","push","isAtEnd","markerName","listIndent","isBlock","createRangeOn","TrackChangesEditing","hasAttribute","mapper","schema","writer","type","bindElementToMarker","test","getAttribute","createUIElement","getItems","toViewPosition","previousPosition","markerRange","ck-suggestion-marker-","getCustomProperty","name","nextSibling","toViewElement","element","consumable","parent","isLimit","span","item"];var Pr,Dr;Pr=Fr,Dr=201,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("0x6")]())r[jr("0x22")](t)&&o.push(n[jr("0x20")](r));return o}function Ur(t){const e=[];if(t.is(jr("0xf"),jr("0x15"))){let n=t.nextSibling;for(;n&&n.is(jr("0xf"),"listItem")&&n[jr("0x4")](jr("0x1e"))>0;)e[jr("0x1b")](n),n=n[jr("0xd")]}return e}function Hr(t,e,{showActiveMarker:n=!0}={}){const o=t[jr("0x1a")].get(jr("0x21"));return(r,s,i)=>{if(!i[jr("0x10")][jr("0x3")](s[jr("0x9")],r[jr("0xc")]))return;const x=s.markerRange[jr("0x17")](),a=s.markerRange.start,c=t.model[jr("0x24")];let l=null,u=null,d=!1,g=!1;for(const t of x){const e=t[jr("0x14")];d=d||c[jr("0x19")](e);const n=i[jr("0x23")][jr("0xe")](e);if(n&&n[jr("0xb")]("addHighlight"))return;jr("0x18")==t[jr("0x1")]&&c[jr("0x1f")](e)&&!c[jr("0x12")](e)&&(e[jr("0xd")]||a[jr("0x1c")]?l&&l[jr("0x11")]==e||(l=e,f(t[jr("0x8")]),g=!0):u=u||t[jr("0x8")])}function f(t){const r=i.writer[jr("0x5")](jr("0x13"),{class:jr("0xa")+e}),x=i[jr("0x23")][jr("0x7")](t);n&&o[jr("0x16")].includes(s[jr("0x1d")])&&i[jr("0x0")].addClass("ck-suggestion-marker--active",r),i.writer.insert(x,r),i[jr("0x23")][jr("0x2")](r,s.markerName)}d||g||!u||f(u)}}const Gr=["model","BoldEditing","subscript","*Remove format:* %0","underline","TrackChangesEditing","FORMAT_SUPERSCRIPT","SubscriptEditing","change","getRanges","FORMAT_BOLD","forceValue","registerDescriptionCallback","get","bold","FORMAT_STRIKETHROUGH","superscript","enableCommand","_descriptionFactory","from","FORMAT_SUBSCRIPT","slice","markInlineFormat","selection","format","toLowerCase","plugins","isCollapsed","value","editor","SuperscriptEditing","FORMAT_CODE","has","commands","document"];var zr,Vr;zr=Gr,Vr=109,function(t){for(;--t;)zr.push(zr.shift())}(++Vr);const Wr=function(t,e){return Gr[t-=0]},Kr=[Wr("0x20"),"ItalicEditing","UnderlineEditing","CodeEditing","StrikethroughEditing",Wr("0x3"),Wr("0x1a")];class qr extends t.Plugin{afterInit(){const t=this[Wr("0x19")],e=t[Wr("0x1f")],n=t[Wr("0x16")][Wr("0x9")](Wr("0x1")),o=t.locale;for(const o of Kr){if(!t[Wr("0x16")][Wr("0x1c")](o))continue;const r=o[Wr("0x11")](0,-7)[Wr("0x15")](),s=t[Wr("0x1d")].get(r);n[Wr("0xd")](r,((t,o={})=>{const i=e[Wr("0x1e")][Wr("0x13")];if(i[Wr("0x17")])return void t(o);const x=void 0!==o[Wr("0x7")]?o[Wr("0x7")]:!s[Wr("0x18")];e[Wr("0x4")]((()=>{const t=Array[Wr("0xf")](i[Wr("0x5")]());for(const o of t){const t=x?[o]:Br(r,o,e);for(const e of t)n[Wr("0x12")](e,{commandName:r,commandParams:[{forceValue:x}]})}}))}))}function r(t,e){n[Wr("0xe")][Wr("0x8")]((n=>{const{data:r}=n;if(r&&r.commandName===t)return r.commandParams[0][Wr("0x7")]?{type:"format",content:kr(o,"*Format:* %0",e)}:{type:Wr("0x14"),content:kr(o,Wr("0x22"),e)}}))}r(Wr("0xa"),kr(o,Wr("0x6"))),r("italic",kr(o,"FORMAT_ITALIC")),r(Wr("0x0"),kr(o,"FORMAT_UNDERLINE")),r("code",kr(o,Wr("0x1b"))),r("strikethrough",kr(o,Wr("0xb"))),r(Wr("0x21"),kr(o,Wr("0x10"))),r(Wr("0xc"),kr(o,Wr("0x2")))}}const $r=["change","length","name","forceValue","get","createRange","locale","$root","model","value","end","from","type","registerDescriptionCallback","schema","has","commandParams","afterInit","ELEMENT_BLOCK_QUOTE","markBlockFormat","parent","filter","*Remove format:* %0","checkChild","getSelectedBlocks","createPositionBefore","commands","commandName","createPositionAfter","push","*Format:* %0","isObject","BlockQuoteEditing","createPositionAt","isLimit","item","document","editor","enableCommand","blockQuote","_descriptionFactory"];var Xr,Jr;Xr=$r,Jr=405,function(t){for(;--t;)Xr.push(Xr.shift())}(++Jr);const Qr=function(t,e){return $r[t-=0]};class Yr extends t.Plugin{[Qr("0x16")](){const t=this.editor,e=t[Qr("0xb")];if(!t.plugins[Qr("0x14")](Qr("0x25")))return;const n=t.plugins[Qr("0x9")]("TrackChangesEditing"),o=this[Qr("0x1")][Qr("0x1f")][Qr("0x9")](Qr("0x3"));n[Qr("0x2")]("blockQuote",((e,r={})=>{const s=this[Qr("0x1")].model[Qr("0x0")].selection,i=r&&void 0!==r[Qr("0x8")]?r[Qr("0x8")]:!o[Qr("0xe")];let x=[];if(i){const e=Array.from(s[Qr("0x1d")]())[Qr("0x1a")]((t=>Zr(t)||function(t,e){const n=e[Qr("0x1c")](t[Qr("0x19")],Qr("0x3")),o=e[Qr("0x1c")]([Qr("0xc"),Qr("0x3")],t);return n&&o}(t,this.editor[Qr("0xd")].schema)));x=ts(e,t[Qr("0xd")])}else{const e=Array[Qr("0x10")](s[Qr("0x1d")]()).filter((t=>Zr(t)));x=ts(e,t[Qr("0xd")])}t[Qr("0xd")][Qr("0x5")]((()=>{for(const t of x)n[Qr("0x18")](t,{commandName:"blockQuote",commandParams:[{forceValue:i}]})}))})),n[Qr("0x4")][Qr("0x12")]((t=>{const{data:n}=t;if(n&&"blockQuote"==n[Qr("0x20")]){const t=kr(e,Qr("0x17"));return n[Qr("0x15")][0][Qr("0x8")]?{type:"format",content:kr(e,Qr("0x23"),t)}:{type:"format",content:kr(e,Qr("0x1b"),t)}}}))}}function Zr(t){return Qr("0x3")==t[Qr("0x19")][Qr("0x7")]}function ts(t,e){let n,o=0;const r=[],s=e[Qr("0x13")];for(;o<t[Qr("0x6")];){const i=t[o],x=t[o+1];n||(n=e[Qr("0x1e")](i)),es(e,i,x)||(r[Qr("0x22")](e[Qr("0xa")](n,s[Qr("0x24")](i)?e[Qr("0x21")](i):e[Qr("0x26")](i,Qr("0xf")))),n=null),o++}return r}function es(t,e,n){if(!n)return!1;const o=t[Qr("0x21")](e),r=t[Qr("0x1e")](n),s=new F.TreeWalker({boundaries:t.createRange(o,r)});for(const e of s)if("text"==e[Qr("0x11")]||t[Qr("0x13")][Qr("0x27")](e[Qr("0x28")]))return!1;return!0}const ns=["plugins","locale","TrackChangesEditing","CodeBlock","ELEMENT_CODE_BLOCK","afterInit","get","registerElementLabel"];var os,rs;os=ns,rs=439,function(t){for(;--t;)os.push(os.shift())}(++rs);const ss=function(t,e){return ns[t-=0]};class is extends t.Plugin{[ss("0x6")](){const t=this.editor,e=t[ss("0x2")];t[ss("0x1")].has(ss("0x4"))&&t[ss("0x1")][ss("0x7")](ss("0x3"))._descriptionFactory[ss("0x0")]("codeBlock",(t=>kr(e,ss("0x5"),t)))}}var xs,as,cs=["enableCommand","addCommentThread","init","get","TrackChangesEditing","editor","plugins","CommentsEditing"];xs=cs,as=114,function(t){for(;--t;)xs.push(xs.shift())}(++as);var ls=function(t,e){return cs[t-=0]};class us extends t.Plugin{static get requires(){return[ls("0x5")]}[ls("0x0")](){this[ls("0x3")][ls("0x4")][ls("0x1")](ls("0x2"))[ls("0x6")](ls("0x7"))}}var ds=n(181);const gs=["unit","options","$graveyard","markerName","enableCommand","plugins","createSelection","delete","start","TrackChangesEditing","data","root","deleteForward","editing","batch","getFirstRange","addMarker:suggestion:deletion","showSuggestionHighlights","downcastDispatcher","buffer","lock","high","detach","createRange","uiElement","fromRange","end","editor","mapper","commands","selection","unbindElementFromMarkerName","document","isCollapsed","get","model","writer","removeMarker:suggestion:deletion","requires","enqueueChange","setSelection"];var fs,ms;fs=gs,ms=245,function(t){for(;--t;)fs.push(fs.shift())}(++ms);const hs=function(t,e){return gs[t-=0]};class ps extends t.Plugin{static get[hs("0x27")](){return[ds.Delete]}init(){const t=this[hs("0x1c")],e=t[hs("0x6")][hs("0x23")](hs("0xa"));e[hs("0x5")](hs("0x8"));const n=t[hs("0x1e")][hs("0x23")](hs("0xd"));e[hs("0x5")](hs("0xd"),((e,o={})=>{const r=t[hs("0x24")][hs("0x7")](t[hs("0x24")][hs("0x21")][hs("0x1f")]);r[hs("0x22")]&&t[hs("0x24")].modifySelection(r,{direction:"forward",unit:o[hs("0x1")]});const s=r[hs("0x10")](),i=F.LiveRange[hs("0x1a")](s);let x;e(o),x=hs("0x3")==i[hs("0xc")].rootName?t[hs("0x24")][hs("0x18")](s[hs("0x9")]):t[hs("0x24")].createRange(i[hs("0x9")],i[hs("0x1b")]),i[hs("0x17")](),t.model[hs("0x28")](n[hs("0x14")][hs("0xf")],(t=>{n[hs("0x14")][hs("0x15")](),t[hs("0x0")](t[hs("0x18")](x[hs("0x1b")])),n[hs("0x14")].unlock()}))})),t[hs("0xe")][hs("0x13")].on(hs("0x11"),Hr(t,"merge"),{priority:hs("0x16")}),t[hs("0xb")][hs("0x13")].on(hs("0x11"),((e,n,o)=>{o[hs("0x2")][hs("0x12")]&&Hr(t,"merge",{showActiveMarker:!1})(e,n,o)}),{priority:hs("0x16")}),t[hs("0xe")][hs("0x13")].on(hs("0x26"),((t,e,n)=>{const o=n[hs("0x1d")].markerNameToElements(e[hs("0x4")]);if(o)for(const t of o)t.is(hs("0x19"))&&(n[hs("0x1d")][hs("0x20")](t,e[hs("0x4")]),n[hs("0x25")].remove(t))}),{priority:"high"})}}var bs=n(331);const Es=["writer","downcastDispatcher","end","plugins","isAtEnd","model","start","schema","fromRange","TrackChangesEditing","mapper","markerName","requires","editing","createPositionAt","init","nextSibling","enter","markInsertion","addMarker:suggestion:insertion","unbindElementFromMarkerName","markerNameToElements","options","createRange","isLimit","setSelection","parent","high","document","detach","removeMarker:suggestion:insertion","selection","getFirstRange","remove","get","data","isCollapsed","hasClass"];var _s,ys;_s=Es,ys=451,function(t){for(;--t;)_s.push(_s.shift())}(++ys);const Ts=function(t,e){return Es[t-=0]};class Cs extends t.Plugin{static get[Ts("0x11")](){return[bs.Enter]}[Ts("0x14")](){const t=this.editor,e=t[Ts("0x8")][Ts("0x1")](Ts("0xe"));e.enableCommand(Ts("0x16"),(n=>{t[Ts("0xa")].change((o=>{const r=t[Ts("0xa")][Ts("0x21")][Ts("0x24")],s=r.getFirstPosition(),i=r[Ts("0x3")],x=F.LiveRange[Ts("0xd")](r[Ts("0x25")]()),a=x[Ts("0xb")][Ts("0x1f")],c=x[Ts("0x7")][Ts("0x1f")],l=!(x.start.isAtStart&&x[Ts("0x7")][Ts("0x9")]),u=a==c,d=!(t[Ts("0xa")][Ts("0xc")][Ts("0x1d")](a)||t[Ts("0xa")].schema[Ts("0x1d")](c))&&(i||l&&u);if(n(),d){const n=t[Ts("0xa")][Ts("0x13")](s[Ts("0x1f")][Ts("0x15")],0),r=o[Ts("0x1c")](s,n);e[Ts("0x17")](r)}else o[Ts("0x1e")](o.createRange(x[Ts("0x7")]));x[Ts("0x22")]()}))})),t[Ts("0x12")][Ts("0x6")].on(Ts("0x18"),Hr(t,"split"),{priority:Ts("0x20")}),t[Ts("0x12")][Ts("0x6")].on(Ts("0x23"),((t,e,n)=>{const o=n[Ts("0xf")][Ts("0x1a")](e[Ts("0x10")]);if(o)for(const t of o)t[Ts("0x4")]("ck-suggestion-marker-split")&&(n[Ts("0xf")][Ts("0x19")](t,e.markerName),n[Ts("0x5")][Ts("0x0")](t))}),{priority:Ts("0x20")}),t[Ts("0x2")][Ts("0x6")].on(Ts("0x18"),((e,n,o)=>{o[Ts("0x1b")].showSuggestionHighlights&&Hr(t,"split",{showActiveMarker:!1})(e,n,o)}),{priority:Ts("0x20")})}}const ks=["TrackChangesEditing","FontSizeEditing","getRanges","_enableCommand","trim","*Reset font size*","normalizeSizeOptions","format","fontColor","toLowerCase","has","markInlineFormat","plugins","find","commandParams","*Reset font background color*","change","*Set font family:* %0","afterInit","*Set font color:* %0","_descriptionFactory","from","config","FontBackgroundColorEditing","fontBackgroundColor","registerDescriptionCallback","enableCommand","fontBackgroundColor.colors","value","model","get","commandName","FontFamilyEditing","title","*Set font background color:* %0","document","*Set font size:* %0","*Reset font family*","fontSize","fontSize.options","locale","FontColorEditing","editor","*Reset font color*","fontFamily"];var vs,As;vs=ks,As=128,function(t){for(;--t;)vs.push(vs.shift())}(++As);const Rs=function(t,e){return ks[t-=0]},Is=[{pluginName:Rs("0x8"),commandName:Rs("0x0")},{pluginName:Rs("0x27"),commandName:Rs("0x6")},{pluginName:Rs("0x3"),commandName:"fontColor"},{pluginName:Rs("0x1e"),commandName:"fontBackgroundColor"}];class Ss extends t.Plugin{[Rs("0x19")](){const t=this[Rs("0x4")][Rs("0x2")];for(const{pluginName:t,commandName:e}of Is)this[Rs("0x4")][Rs("0x13")][Rs("0x11")](t)&&this._enableCommand(e);this[Rs("0x4")].plugins[Rs("0x25")](Rs("0x7"))[Rs("0x1b")][Rs("0x20")]((e=>{const{data:n}=e;if(null!=n){if(Rs("0x0")==n[Rs("0x26")]){const e=n[Rs("0x15")][0][Rs("0x23")];if(e){const n=this[Rs("0x4")][Rs("0x13")][Rs("0x25")]("FontSize")[Rs("0xd")](this.editor[Rs("0x1d")][Rs("0x25")](Rs("0x1")))[Rs("0x14")]((t=>t.model==e))[Rs("0x28")],o=this[Rs("0x4")][Rs("0x2")]._t(n)[Rs("0x10")]();return{type:Rs("0xe"),content:kr(t,Rs("0x2b"),o)}}return{type:Rs("0xe"),content:kr(t,Rs("0xc"))}}if(Rs("0x6")==n.commandName){const e=n[Rs("0x15")][0][Rs("0x23")];return e?{type:Rs("0xe"),content:kr(t,Rs("0x18"),e)}:{type:Rs("0xe"),content:kr(t,Rs("0x2c"))}}if(Rs("0xf")==n[Rs("0x26")]){const e=n[Rs("0x15")][0].value;if(e){const n=(0,r.normalizeColorOptions)(this[Rs("0x4")].config.get("fontColor.colors"))[Rs("0x14")]((t=>t[Rs("0x24")]==e));let o=e,s="";return n&&(o=n.label,s=t._t(o)[Rs("0x10")]()),{type:Rs("0xe"),content:kr(t,Rs("0x1a"),s)[Rs("0xb")](),color:{value:e,title:s||o}}}return{type:Rs("0xe"),content:kr(t,Rs("0x5"))}}if(Rs("0x1f")==n[Rs("0x26")]){const e=n.commandParams[0][Rs("0x23")];if(e){const n=(0,r.normalizeColorOptions)(this[Rs("0x4")][Rs("0x1d")][Rs("0x25")](Rs("0x22")))[Rs("0x14")]((t=>t.model==e));let o=e,s="";return n&&(o=n.label,s=t._t(o)[Rs("0x10")]()),{type:"format",content:kr(t,Rs("0x29"),s)[Rs("0xb")](),color:{value:e,title:s||o}}}return{type:"format",content:kr(t,Rs("0x16"))}}}}))}[Rs("0xa")](t){const e=this.editor;e.plugins[Rs("0x25")](Rs("0x7"))[Rs("0x21")](t,((n,o={})=>{const r=e[Rs("0x24")][Rs("0x2a")].selection,s=o[Rs("0x23")];r.isCollapsed?n(o):e[Rs("0x24")][Rs("0x17")]((()=>{const n=Array[Rs("0x1c")](r[Rs("0x9")]());for(const o of n){const n=s?[o]:Br(t,o,e[Rs("0x24")]);for(const o of n)e.plugins.get(Rs("0x7"))[Rs("0x12")](o,{commandName:t,commandParams:[{value:s}]})}}))}))}}const ws=["ELEMENT_HEADING_CUSTOM","format","checkChild","config","blockName","value","has","*Change to:* %0","commandParams","match","parent","filter","heading","name","get","editor","markBlockFormat","heading.options","TrackChangesEditing","registerDescriptionCallback","registerElementLabel","plugins","_descriptionFactory","ELEMENT_HEADING","change","from","enableCommand","model","document","title","isObject","locale","commandName","find","HeadingEditing"];var Ms,Ns;Ms=ws,Ns=482,function(t){for(;--t;)Ms.push(Ms.shift())}(++Ns);const Ls=function(t,e){return ws[t-=0]};class Os extends t.Plugin{afterInit(){const t=this.editor,e=t[Ls("0x4")],n=t[Ls("0xb")][Ls("0x16")](Ls("0x19"));if(!t[Ls("0x1d")][Ls("0xe")](Ls("0x7")))return;const o=t[Ls("0x1d")][Ls("0x16")](Ls("0x1a"));o[Ls("0x22")](Ls("0x14"),((e,n)=>{const r=n.value,s=Array[Ls("0x21")](this.editor[Ls("0x0")][Ls("0x1")].selection.getSelectedBlocks())[Ls("0x13")]((t=>{return e=t,n=r,(o=this[Ls("0x17")].model.schema)[Ls("0xa")](e[Ls("0x12")],n)&&!o[Ls("0x3")](e)&&e[Ls("0x15")]!=n;var e,n,o}));t[Ls("0x0")][Ls("0x20")]((()=>{for(const t of s)o[Ls("0x18")](t,{commandName:Ls("0x14"),commandParams:[n],formatGroupId:Ls("0xc")},Ur(t))}))}));for(const t of n)"paragraph"!=t[Ls("0x0")]&&o[Ls("0x1e")][Ls("0x1c")](t[Ls("0x0")],(e=>{const n=Fs(t[Ls("0x0")]);return null!==n?r(e,n):s(e,t.title)}));function r(t,n){return kr(e,Ls("0x1f"),[t,n])}function s(t,n){return kr(e,Ls("0x8"),[t,n])}o[Ls("0x1e")][Ls("0x1b")]((t=>{const{type:o,data:i}=t;if("formatBlock"==o&&i&&"heading"==i[Ls("0x5")]){const t=i[Ls("0x10")][0][Ls("0xd")],o=Fs(t);if(null!==o)return{type:Ls("0x9"),content:kr(e,Ls("0xf"),r(1,o))};const x=n[Ls("0x6")]((e=>e.model===t))[Ls("0x2")];return{type:Ls("0x9"),content:kr(e,Ls("0xf"),s(1,x))}}}))}}function Fs(t){const e=t[Ls("0x11")](/^heading(\d+)$/);return e?e[1]:null}const Ps=["registerDescriptionCallback","getRanges","formatInline","commandName","backward","getFirstPosition","highlight.options","value","HighlightEditing","get","push","item","format","color","*Set highlight:* %0","getLastMatchingPosition","plugins","change","find","hasAttribute","config","model","getAttribute","document","highlight","commandParams","editor","title"];var Ds,js;Ds=Ps,js=446,function(t){for(;--t;)Ds.push(Ds.shift())}(++js);const Bs=function(t,e){return Ps[t-=0]};class Us extends t.Plugin{afterInit(){const t=this[Bs("0x0")];if(!t[Bs("0x12")].has(Bs("0xa")))return;const e=t[Bs("0x12")].get("TrackChangesEditing");e.enableCommand(Bs("0x1a"),((n,o={})=>{const r=t.model[Bs("0x19")].selection,s=r.getAttribute("highlight");let i=o[Bs("0x9")],x=[];if(r.isCollapsed){const e=r[Bs("0x7")]();if(!r[Bs("0x15")](Bs("0x1a")))return void n(o);{const n=t=>t[Bs("0xd")][Bs("0x18")](Bs("0x1a"))===s,o=e[Bs("0x11")](n,{direction:Bs("0x6")}),r=e[Bs("0x11")](n);x=[t[Bs("0x17")].createRange(o,r)],i==s&&(i=null)}}else for(const e of r[Bs("0x3")]())i?x[Bs("0xc")](e):x[Bs("0xc")](...Br(Bs("0x1a"),e,t[Bs("0x17")]));t.model[Bs("0x13")]((()=>{for(const t of x)e.markInlineFormat(t,{commandName:"highlight",commandParams:[{value:i}]})}))}));const n=t.locale;e._descriptionFactory[Bs("0x2")]((e=>{const{type:o,data:r}=e;if(Bs("0x4")==o&&r&&Bs("0x1a")==r[Bs("0x5")]){const e=r[Bs("0x1b")][0].value;if(e){const o=t[Bs("0x16")][Bs("0xb")](Bs("0x8"))[Bs("0x14")]((t=>t.model==e)),r=n._t(o[Bs("0x1")]).toLowerCase();return{type:Bs("0xe"),content:kr(n,Bs("0x10"),r),color:{value:o[Bs("0xf")],title:o[Bs("0x1")]}}}return{type:Bs("0xe"),content:kr(n,"*Remove highlight*",kr(n,"FORMAT_HIGHLIGHT"))}}}))}}const Hs=["plugins","insert","high","HorizontalLineEditing","conversion","dataDowncast","afterInit","createEmptyElement","elementToStructure","get","horizontalLine","createContainerElement","enableCommand","showSuggestionHighlights","locale","has","_descriptionFactory"];var Gs,zs;Gs=Hs,zs=151,function(t){for(;--t;)Gs.push(Gs.shift())}(++zs);const Vs=function(t,e){return Hs[t-=0]};class Ws extends t.Plugin{[Vs("0x8")](){const t=this.editor;if(!t.plugins[Vs("0x0")](Vs("0x5")))return;t[Vs("0x2")][Vs("0xb")]("TrackChangesEditing")[Vs("0xe")](Vs("0xc"));const e=t[Vs("0x2")].get("TrackChangesEditing"),n=t[Vs("0x10")];e[Vs("0x1")].registerElementLabel(Vs("0xc"),(t=>kr(n,"ELEMENT_HORIZONTAL_LINE",t))),t[Vs("0x6")].for(Vs("0x7"))[Vs("0xa")]({model:"horizontalLine",view:(t,{writer:e,options:n})=>{if(!n[Vs("0xf")])return;const o=e[Vs("0xd")]("div"),r=e[Vs("0x9")]("hr");return e.addClass("ck-horizontal-line",o),e[Vs("0x3")](e.createPositionAt(o,0),r),o},converterPriority:Vs("0x4")})}}const Ks=["isInlineImage","toggleImageCaption","TrackChangesEditing","filter","registerPostFixer","ImageBlockEditing","getContainedElement","findIndex","suggestion","isIntersecting","*Set image width:* %0","start","addObject","*Set image text alternative:* %0","markBlockFormat","selection","isBlockImage","nodeBefore","schema","find","nodeAfter","head","getAttribute","insertImage","document","ImageEditing","deletion","width","getClosestSelectedImageElement","hasAttribute","createRange","ImageUtils","commands","getChangedMarkers","from","imageStylePreApply","convertInlineImageToBlock","side","toNext","detach","getSuggestion","Users","plugins","imageStyle","_suggestionFactory","isInContent","ELEMENT_CAPTION","end","author","newValue","getCaptionFromImageModelElement","markDeletion","model","*Remove image text alternative*","get","uploadImage","name","chain","editor","removeObject","hasSuggestion","imageStylePostApply","differ","forward","refresh","commandReversedParams","enableCommand","next","isOwn","imageTypeInline","accept","markInsertion","subType","formatInline","imageBlock","type","commandParams","_descriptionFactory","has","ImageUploadEditing","forEach","Inline image to block image","discardSuggestion","resizeImage","ImageStyleEditing","imageCaption","forceDefaultExecution","registerCustomCallback","ELEMENT_INLINE_IMAGE","createRangeOn","isEqual","caption","getSuggestionCallback","formatBlock","isBefore","FORMAT_SIDE_IMAGE","length","registerDescriptionCallback","Block image to inline image","join","*Format:* %0","isCollapsed","getFirstRange","commandName","format","imageTextAlternative","registerElementLabel","alt","change","shouldConvertImageType","backward","imageTypeBlock","ImageResize","ImageInlineEditing","imageInline","fromPosition","element","ELEMENT_IMAGE","insertion","value","convertBlockImageToInline","discard"];var qs,$s;qs=Ks,$s=138,function(t){for(;--t;)qs.push(qs.shift())}(++$s);const Xs=function(t,e){return Ks[t-=0]};class Js extends t.Plugin{afterInit(){const t=this[Xs("0x2a")];if(!t.plugins.has(Xs("0x9")))return;const n=t[Xs("0x1a")][Xs("0x26")](Xs("0x6c")),o=t[Xs("0x1a")].get(Xs("0xf")),r={},s=t.locale;if(n.enableCommand(Xs("0x7")),n[Xs("0x3d")].registerElementLabel(Xs("0x3a"),(t=>kr(s,Xs("0x65"),t))),n._descriptionFactory[Xs("0x5a")](Xs("0x62"),(t=>kr(s,Xs("0x48"),t))),n[Xs("0x3d")].registerElementLabel(Xs("0x4b"),kr(s,Xs("0x1e"))),t[Xs("0x1a")][Xs("0x3e")](Xs("0x3f"))&&n.enableCommand(Xs("0x27")),t[Xs("0x1a")][Xs("0x3e")](Xs("0x6f"))&&t[Xs("0x1a")][Xs("0x3e")](Xs("0x61"))&&(n[Xs("0x32")](Xs("0x35"),((e,r)=>{const s=o[Xs("0xc")](t.model[Xs("0x8")].selection);t[Xs("0x24")][Xs("0x5c")]((()=>{n[Xs("0x78")](s,{commandName:Xs("0x35"),commandParams:[r]},[],Xs("0x68"))}))})),n[Xs("0x32")]("imageTypeBlock",((e,r)=>{t[Xs("0x24")][Xs("0x5c")]((s=>{let i=o[Xs("0xc")](t[Xs("0x24")][Xs("0x8")][Xs("0x79")]),x=s[Xs("0x49")](i);const a=F.LivePosition.fromPosition(x[Xs("0x75")],"toPrevious"),c=F.LivePosition[Xs("0x63")](x[Xs("0x1f")],Xs("0x16"));n[Xs("0x46")]((()=>e(r))),i=o[Xs("0xc")](t[Xs("0x24")].document[Xs("0x79")]),x=s[Xs("0x49")](i);const l=s.createRange(a,c);a[Xs("0x17")](),c[Xs("0x17")](),n[Xs("0x78")](i,{commandName:"imageTypeInline"},[],"convertInlineImageToBlock"),l.start[Xs("0x4e")](x[Xs("0x75")])&&n.markInsertion(s[Xs("0xe")](l[Xs("0x75")],x.start),Xs("0x14")),x.end[Xs("0x4e")](l[Xs("0x1f")])&&n[Xs("0x37")](s[Xs("0xe")](x.end,l.end),Xs("0x14"))}))})),n[Xs("0x1c")][Xs("0x47")]("formatBlock","convertInlineImageToBlock",Xs("0x53"),(()=>{})),n[Xs("0x1c")].registerCustomCallback(Xs("0x4d"),Xs("0x14"),Xs("0x36"),(()=>{})),n[Xs("0x1c")].registerCustomCallback(Xs("0x4d"),Xs("0x14"),Xs("0x69"),n[Xs("0x1c")][Xs("0x4c")](Xs("0x4d"),"",Xs("0x36"))),n[Xs("0x1c")].registerCustomCallback("insertion",Xs("0x14"),"join",(()=>{})),n[Xs("0x1c")][Xs("0x47")](Xs("0x66"),Xs("0x14"),Xs("0x69"),(([e])=>{const o=n[Xs("0x1c")][Xs("0x4c")](Xs("0x66"),"","discard");let r=e[Xs("0x75")],s=e[Xs("0x1f")];const i=t[Xs("0x24")][Xs("0x2")].getNearestSelectionRange(r,Xs("0x5e")),x=t.model.schema.getNearestSelectionRange(s,Xs("0x2f"));i.isCollapsed&&(r=i[Xs("0x75")]),x[Xs("0x55")]&&(s=x.end),o([t[Xs("0x24")][Xs("0xe")](r,s)])})),n[Xs("0x1c")][Xs("0x47")](Xs("0x4d"),"convertInlineImageToBlock",Xs("0x29"),a),n[Xs("0x1c")].registerCustomCallback(Xs("0x66"),Xs("0x14"),Xs("0x29"),a)),t.plugins[Xs("0x3e")]("ImageCaptionEditing")&&(n[Xs("0x32")](Xs("0x6b"),((e,r)=>{const s=t[Xs("0x1a")].get("ImageCaptionUtils");let i=o[Xs("0xc")](t[Xs("0x24")][Xs("0x8")][Xs("0x79")]),x=s[Xs("0x22")](i);t[Xs("0x24")][Xs("0x5c")]((()=>{if(x)return void n[Xs("0x23")](t.model[Xs("0x49")](x));const a=o[Xs("0x0")](i);e(r),i=o[Xs("0xc")](t[Xs("0x24")][Xs("0x8")][Xs("0x79")]),x=s[Xs("0x22")](i),n[Xs("0x37")](t[Xs("0x24")][Xs("0x49")](x),a?null:Xs("0x45"))}))})),n[Xs("0x1c")].registerCustomCallback("insertion",Xs("0x45"),"chain",a)),t.plugins.has(Xs("0x44"))){n[Xs("0x32")](Xs("0x1b"),((r,s)=>{const i=t[Xs("0x1a")][Xs("0x26")](Xs("0x19")).me,x=t[Xs("0x10")].get(Xs("0x1b"));let a=o[Xs("0xc")](t.model.document[Xs("0x79")]),c=t.model[Xs("0x49")](a),l=x[Xs("0x67")];if(l==s[Xs("0x67")])return;const u={commandName:"imageStyle",commandParams:[s],formatGroupId:(0,e.uid)()};t[Xs("0x24")][Xs("0x5c")]((()=>{if(n.getSuggestions()[Xs("0x6d")]((t=>t[Xs("0x1d")]&&i==t[Xs("0x20")]&&("formatBlock"==t.type||"formatInline"==t[Xs("0x3b")])&&(Xs("0x13")==t.subType||Xs("0x2d")==t[Xs("0x38")])&&t[Xs("0x56")]()[Xs("0x4a")](c)))[Xs("0x40")]((t=>n[Xs("0x42")](t[Xs("0x5")]))),a=o[Xs("0xc")](t[Xs("0x24")][Xs("0x8")].selection),c=t.model[Xs("0x49")](a),x[Xs("0x30")](),t[Xs("0x10")][Xs("0x26")](Xs("0x35"))[Xs("0x30")](),t.commands.get(Xs("0x5f"))[Xs("0x30")](),l=x[Xs("0x67")],l!=s[Xs("0x67")])return o[Xs("0x6a")](a)&&x[Xs("0x5d")](s[Xs("0x67")],a)?(r(s),a=o.getClosestSelectedImageElement(t[Xs("0x24")][Xs("0x8")][Xs("0x79")]),void n.markBlockFormat(a,{...u,commandReversedParams:[{value:l||null}]},[],"imageStylePreApply")):void(o.isBlockImage(a)?n[Xs("0x78")](a,u,[],Xs("0x2d")):n.markInlineFormat(c,u,"imageStylePostApply"))}))}));for(const e of t[Xs("0x1a")][Xs("0x26")](Xs("0x44")).normalizedStyles)r[e[Xs("0x28")]]=e.title.toLowerCase();n[Xs("0x1c")][Xs("0x47")](Xs("0x4d"),Xs("0x13"),Xs("0x53"),(()=>{})),n[Xs("0x1c")][Xs("0x47")](Xs("0x4d"),"imageStylePostApply",Xs("0x53"),(()=>{})),n._suggestionFactory.registerCustomCallback(Xs("0x39"),Xs("0x2d"),Xs("0x53"),(()=>{})),n._suggestionFactory[Xs("0x47")](Xs("0x4d"),Xs("0x13"),Xs("0x36"),(()=>{})),n._suggestionFactory.registerCustomCallback(Xs("0x4d"),Xs("0x13"),Xs("0x69"),((t,e)=>{n[Xs("0x1c")][Xs("0x4c")](Xs("0x4d"),"",Xs("0x36"))(t,{commandName:e.commandName,commandParams:e[Xs("0x31")]})})),n[Xs("0x1c")][Xs("0x47")]("formatBlock","imageStylePreApply",Xs("0x29"),a)}const i=[{type:Xs("0x4d"),subType:Xs("0x13")},{type:Xs("0x66"),subType:Xs("0x45")},{type:Xs("0x4d"),subType:Xs("0x14")},{type:Xs("0x66"),subType:Xs("0x14")}];function x(t,e){const r=i.findIndex((({type:e,subType:n})=>t[Xs("0x3b")]==e&&t[Xs("0x38")]==n)),s=i[Xs("0x71")]((({type:t,subType:n})=>e.type==t&&e[Xs("0x38")]==n));if(r<0||s<0)return!1;const x=t[Xs("0x56")](),a=e[Xs("0x56")]();if((0==r||1==r)&&2==s&&x[Xs("0x73")](a))return!0;if(2==r&&3==s){const t=n._findSuggestions(x,Xs("0x66"))[Xs("0x6d")]((({suggestion:t,meta:e})=>e[Xs("0x34")]&&Xs("0x14")==t[Xs("0x38")]));if(t.length>1&&a[Xs("0x1f")].isEqual(x[Xs("0x75")]))return!0;if(1==t[Xs("0x50")]&&(x[Xs("0x75")][Xs("0x4a")](a[Xs("0x1f")])||x[Xs("0x1f")][Xs("0x4a")](a[Xs("0x75")])))return!0}if(3==r&&3==s&&x[Xs("0x75")].isBefore(a[Xs("0x75")])){const t=x[Xs("0x1f")][Xs("0x4")],e=a[Xs("0x75")][Xs("0x1")];return o[Xs("0x0")](t)&&t===e}return!1}function a(t,e){return x(t,e)?[t,e]:x(e,t)?[e,t]:null}t[Xs("0x24")][Xs("0x8")][Xs("0x6e")]((()=>{let e=!1;const r=Array[Xs("0x12")](t[Xs("0x24")].document[Xs("0x2e")][Xs("0x11")]());for(const{name:t,data:s}of r){const{group:r,type:i,subType:x,id:a}=n._splitMarkerName(t);if(Xs("0x72")==r&&n[Xs("0x2c")](a)){if("formatBlock"==i&&(Xs("0x13")==x||Xs("0x2d")==x)){const t=n[Xs("0x18")](a);if(s.newRange){const r=t.getFirstRange()[Xs("0x70")]();if(o[Xs("0x0")](r))continue;n[Xs("0x42")](t),e=!0}}if("insertion"==i&&Xs("0x45")==x&&!s.newRange){const t=n.getSuggestion(a);t.next&&t[Xs("0x33")][Xs("0x1d")]&&(n[Xs("0x42")](t.next),e=!0)}}}return e})),t[Xs("0x1a")][Xs("0x3e")](Xs("0x60"))&&n[Xs("0x32")](Xs("0x43"),((e,r)=>{const s=o[Xs("0xc")](t[Xs("0x24")][Xs("0x8")].selection);s.getAttribute(Xs("0xb"))!=r.width&&t[Xs("0x24")][Xs("0x5c")]((()=>{n.markBlockFormat(s,{commandName:Xs("0x43"),commandParams:[r]})}))})),t.plugins[Xs("0x3e")]("ImageTextAlternativeEditing")&&n.enableCommand(Xs("0x59"),((e,r)=>{const s=o[Xs("0xc")](t[Xs("0x24")][Xs("0x8")][Xs("0x79")]);(s[Xs("0xd")]("alt")?s[Xs("0x6")](Xs("0x5b")):"")!=r.newValue&&t.model.change((()=>{n[Xs("0x78")](s,{commandName:Xs("0x59"),commandParams:[r]})}))})),n[Xs("0x3d")][Xs("0x51")]((t=>{if(i[Xs("0x3")]((({type:e,subType:n})=>t[Xs("0x3b")]==e&&t.subType==n)))return t.previous?{}:void 0})),n._descriptionFactory[Xs("0x51")]((t=>{if(Xs("0x66")==t[Xs("0x3b")]||Xs("0xa")==t.type){const e=t.getContainedElement();if(e&&e.is(Xs("0x64"),Xs("0x4b")))return{type:Xs("0x66")==t[Xs("0x3b")]?Xs("0x76"):Xs("0x2b"),name:e.name,quantity:1}}})),n[Xs("0x3d")][Xs("0x51")]((t=>Xs("0x4d")==t.type&&Xs("0x14")==t.subType?{type:Xs("0x58"),content:Xs("0x41")}:"formatBlock"==t.type&&Xs("0x68")==t.subType?{type:"format",content:Xs("0x52")}:void 0)),n._descriptionFactory[Xs("0x51")]((t=>{const{data:e}=t;if(e){if(Xs("0x1b")==e[Xs("0x57")]){const t=e[Xs("0x3c")][0][Xs("0x67")];return n=Xs("0x15")===t?kr(s,Xs("0x4f")):r[t]||t,{type:"format",content:kr(s,Xs("0x54"),n)}}if(Xs("0x59")==e[Xs("0x57")]){const t=e[Xs("0x3c")][0][Xs("0x21")];return t?{type:Xs("0x58"),content:kr(s,Xs("0x77"),'"'+t+'"')}:{type:Xs("0x58"),content:kr(s,Xs("0x25"))}}if(Xs("0x43")==e[Xs("0x57")]){const t=e[Xs("0x3c")][0][Xs("0xb")];return t?{type:Xs("0x58"),content:kr(s,Xs("0x74"),t)}:{type:"format",content:kr(s,"*Reset image width*")}}}var n}))}}const Qs=["from","document","registerDescriptionCallback","change","outdentBlock","plugins","getItems","indentBlock","IndentEditing","filter","checkAttribute","indent","format","selection","outdent","*Indent:* %0","getItemLabel","markBlockFormat","commandName","afterInit","IndentBlock","getSelectedBlocks","has","TrackChangesEditing","enableCommand","model","_descriptionFactory","editor","locale"];var Ys,Zs;Ys=Qs,Zs=437,function(t){for(;--t;)Ys.push(Ys.shift())}(++Zs);const ti=function(t,e){return Qs[t-=0]};class ei extends t.Plugin{[ti("0x11")](){const t=this[ti("0x19")],e=t[ti("0x3")].get(ti("0x15"));t.plugins[ti("0x14")](ti("0x6"))&&(e[ti("0x16")](ti("0x9")),e[ti("0x16")](ti("0xc")));const n=t[ti("0x1a")];if(t[ti("0x3")][ti("0x14")](ti("0x12"))){for(const n of["indentBlock",ti("0x2")])e[ti("0x16")](n,(()=>{const o=Array[ti("0x1b")](this[ti("0x19")][ti("0x17")][ti("0x1c")][ti("0xb")][ti("0x13")]())[ti("0x7")]((t=>this[ti("0x19")].model.schema[ti("0x8")](t,"blockIndent")));t[ti("0x17")][ti("0x1")]((()=>{for(const t of o)e[ti("0xf")](t,{commandName:n,commandParams:[{value:""}],formatGroupId:ti("0x5")})}))}));e[ti("0x18")][ti("0x0")]((t=>{const{data:o}=t;if(!o)return;if(ti("0x5")!=o[ti("0x10")]&&ti("0x2")!=o[ti("0x10")])return;const r=t[ti("0x4")]()[0],s=e[ti("0x18")][ti("0xe")](r.name);return ti("0x5")==o[ti("0x10")]?{type:ti("0xa"),content:kr(n,ti("0xd"),s)}:ti("0x2")==o[ti("0x10")]?{type:"format",content:kr(n,"*Outdent:* %0",s)}:void 0}))}}}var ni,oi,ri=["enableCommand","get","editor","init"];ni=ri,oi=256,function(t){for(;--t;)ni.push(ni.shift())}(++oi);var si=function(t,e){return ri[t-=0]};class ii extends t.Plugin{static get requires(){return[ds.Input]}[si("0x3")](){this[si("0x2")].plugins[si("0x1")]("TrackChangesEditing")[si("0x0")]("input")}}const xi=["hasAttribute","selection","isCollapsed","unlink","*Remove link*","registerDescriptionCallback","change","document","LinkEditing","model","commandParams","format","commandName","*Set link:* %0","getFirstRange","getFirstPosition","TrackChangesEditing","getAttribute","enableCommand","linkHref","link","editor","markInlineFormat"];var ai,ci;ai=xi,ci=126,function(t){for(;--t;)ai.push(ai.shift())}(++ci);const li=function(t,e){return xi[t-=0]};class ui extends t.Plugin{afterInit(){const t=this[li("0xa")];if(!t.plugins.has(li("0x14")))return;const e=t.plugins.get(li("0x5"));e.enableCommand("link",((n,o)=>{const r=t.model[li("0x13")][li("0xd")];let s=[];if(r.isCollapsed){if(!r[li("0xc")](li("0x8")))return void n(o);{const e=(0,ds.findAttributeRange)(r[li("0x4")](),li("0x8"),r[li("0x6")](li("0x8")),t[li("0x15")]);s=[e]}}else s=Array.from(r.getRanges());t.model.change((()=>{for(const t of s)e.markInlineFormat(t,{commandName:li("0x9"),commandParams:[o]})}))})),e[li("0x7")](li("0xf"),(()=>{const n=this[li("0xa")].model,o=n.document[li("0xd")];n[li("0x12")]((()=>{let n=[];n=o[li("0xe")]?[(0,ds.findAttributeRange)(o[li("0x4")](),li("0x8"),o.getAttribute(li("0x8")),t[li("0x15")])]:Br(li("0x8"),o[li("0x3")](),t.model);for(const t of n)e[li("0xb")](t,{commandName:li("0xf"),commandParams:[]})}))})),e._descriptionFactory[li("0x11")]((e=>{const{data:n}=e,o=t.locale;if(n){if(li("0x9")==n[li("0x1")]){const t=n[li("0x16")][0];return{type:li("0x0"),content:kr(o,li("0x2"),'"'+t+'"')}}return"unlink"==n[li("0x1")]?{type:li("0x0"),content:kr(o,li("0x10"))}:void 0}}))}}const di=["_selectedElements","bulletedList","*Outdent:* %0","todo","afterInit","format","slice","blockName","indentList","from","createRange","listIndent","TodoListEditing","*Change to:* %0","checkTodoList","parent","previousSibling","name","checkChild","outdentList","element","TrackChangesEditing","replace","document","*Indent:* %0","listItem","markBlockFormat","nextSibling","List","*Check item*","commands","numberedList","commandParams","todoList","filter","change","selection","findIndex","createPositionAt","ELEMENT_LIST_ITEM","enableCommand","getAttribute","paragraph","has","ELEMENT_NUMBERED_LIST","model","plugins","ListEditing","execute","commandName","listType","registerElementLabel","isObject","before","_descriptionFactory","get","schema","locale","getSelectedBlocks","numbered","value","add"];var gi,fi;gi=di,fi=367,function(t){for(;--t;)gi.push(gi.shift())}(++fi);const mi=function(t,e){return di[t-=0]};class hi extends t.Plugin{[mi("0x9")](){const t=this.editor,e=t[mi("0x0")];if(!t[mi("0x33")][mi("0x30")](mi("0x34")))return;const n=t.plugins[mi("0x3c")](mi("0x1a")),o=t[mi("0x33")].has(mi("0x11"));function r(e){return()=>{const o=t[mi("0x32")][mi("0x1c")][mi("0x29")],r=t[mi("0x23")][mi("0x3c")](e);if(r[mi("0x3")])return void t[mi("0x35")](mi("0x2f"),{});const s=e[mi("0xb")](0,-4),i=function(t,e,n){let o=Array.from(t)[mi("0x27")]((t=>{return e=t,(o=n)[mi("0x17")](e[mi("0x14")],mi("0x1e"))&&!o[mi("0x39")](e);var e,o}));o=o[mi("0x27")]((t=>!t.is(mi("0x19"),mi("0x1e"))||t[mi("0x2e")](mi("0x37"))!=e));const r=new Set;for(const t of o)t.is("element",mi("0x1e"))?r[mi("0x4")](pi(t)):r[mi("0x4")](t);return Array[mi("0xe")](r)}(o[mi("0x1")](),s,t[mi("0x32")][mi("0x3d")]);t[mi("0x32")][mi("0x28")]((()=>{for(const t of i)n[mi("0x1f")](t,{commandName:e,commandParams:[{forceValue:!r[mi("0x3")]}],formatGroupId:mi("0xc")},bi(t))}))}}function s(e){return()=>{const o=function(t){const e=(t=Array[mi("0xe")](t))[mi("0x2a")]((t=>"listItem"!=t.name));return e>-1&&(t=t[mi("0xb")](0,e)),t}(t[mi("0x32")].document.selection.getSelectedBlocks()),r=t[mi("0x32")][mi("0xf")](t.model[mi("0x2b")](o[0],mi("0x3a")),t[mi("0x32")][mi("0x2b")](o[o.length-1],"end"));t.model[mi("0x28")]((()=>{n.markBlockFormat(r,{commandName:e,commandParams:[],formatGroupId:mi("0x10")},function(t){const e=new Set;for(const n of t){let t=n[mi("0x20")];for(;t&&t[mi("0x2e")](mi("0x10"))>n[mi("0x2e")](mi("0x10"));)e[mi("0x4")](t),t=t[mi("0x20")]}return Array[mi("0xe")](e)}(o))}))}}n[mi("0x2d")](mi("0x24"),r(mi("0x24"))),n.enableCommand(mi("0x6"),r(mi("0x6"))),o&&n[mi("0x2d")](mi("0x26"),r(mi("0x26"))),n[mi("0x2d")](mi("0xd"),s("indentList")),n[mi("0x2d")](mi("0x18"),s(mi("0x18"))),o&&n.enableCommand("checkTodoList",(()=>{const e=t[mi("0x23")].get(mi("0x13")),o=Array.from(e[mi("0x5")]);o.filter((t=>t[mi("0x2e")]("todoListChecked")!=e.value)),t[mi("0x32")][mi("0x28")]((()=>{for(const t of o)n[mi("0x1f")](t,{commandName:mi("0x13"),commandParams:[{forceValue:!e[mi("0x3")]}]})}))})),n._descriptionFactory[mi("0x38")](mi("0x1e"),(t=>kr(e,mi("0x2c"),t))),n[mi("0x3b")].registerDescriptionCallback((t=>{const{data:n}=t;if(n){if("numberedList"==n.commandName||mi("0x6")==n.commandName||mi("0x26")==n[mi("0x36")])switch(n[mi("0x36")][mi("0x1b")](mi("0x21"),"")){case"bulleted":return o(kr(e,"ELEMENT_BULLETED_LIST"));case mi("0x2"):return o(kr(e,mi("0x31")));case mi("0x8"):return o(kr(e,"ELEMENT_TODO_LIST"))}if(mi("0xd")==n.commandName)return{type:"format",content:kr(e,mi("0x1d"),kr(e,mi("0x2c")))};if(mi("0x18")==n[mi("0x36")])return{type:"format",content:kr(e,mi("0x7"),kr(e,mi("0x2c")))};if(mi("0x13")==n[mi("0x36")])return n[mi("0x25")][0].forceValue?{type:mi("0xa"),content:kr(e,mi("0x22"))}:{type:mi("0xa"),content:kr(e,"*Uncheck item*")}}function o(t){return{type:mi("0xa"),content:kr(e,mi("0x12"),t)}}}))}}function pi(t){const e=t[mi("0x2e")](mi("0x10"));if(0==e)return t;let n=t;for(;t[mi("0x15")]&&t[mi("0x15")].is(mi("0x19"),"listItem");){const o=t[mi("0x15")].getAttribute("listIndent");if(o==e)n=t[mi("0x15")];else if(o<e)break;t=t[mi("0x15")]}return n}function bi(t){const e=[];if(t.is(mi("0x19"),mi("0x1e"))&&t[mi("0x2e")](mi("0x10"))>0){let n=t[mi("0x20")];for(;n&&"listItem"==n[mi("0x16")]&&n[mi("0x2e")](mi("0x10"))==t[mi("0x2e")]("listIndent");)e.push(n),n=n[mi("0x20")]}return e}const Ei=["conversion","_descriptionFactory","showSuggestionHighlights","locale","MediaEmbedEditing","dataDowncast","plugins","elementToElement","ELEMENT_MEDIA","high","mediaEmbed","afterInit","registerElementLabel","stop","div","get","enableCommand","TrackChangesEditing","downcastDispatcher","createEmptyElement","options","attribute:url:media","media"];var _i,yi;_i=Ei,yi=266,function(t){for(;--t;)_i.push(_i.shift())}(++yi);const Ti=function(t,e){return Ei[t-=0]};class Ci extends t.Plugin{[Ti("0x15")](){const t=this.editor;if(!t[Ti("0x10")].has(Ti("0xe")))return;const e=t[Ti("0x10")][Ti("0x2")](Ti("0x4")),n=t[Ti("0xd")];e[Ti("0x3")](Ti("0x14")),e[Ti("0xb")][Ti("0x16")](Ti("0x9"),(t=>kr(n,Ti("0x12"),t))),t[Ti("0xa")].for(Ti("0xf"))[Ti("0x11")]({model:Ti("0x9"),view:(t,{writer:e,options:n})=>{if(n[Ti("0xc")])return e[Ti("0x6")](Ti("0x1"))},converterPriority:"high"}),t.data[Ti("0x5")].on(Ti("0x8"),((t,e,n)=>{n[Ti("0x7")][Ti("0xc")]&&t[Ti("0x0")]()}),{priority:Ti("0x13")})}}const ki=["afterInit","has","MentionEditing","editor","plugins","mention","get"];var vi,Ai;vi=ki,Ai=371,function(t){for(;--t;)vi.push(vi.shift())}(++Ai);const Ri=function(t,e){return ki[t-=0]};class Ii extends t.Plugin{[Ri("0x0")](){const t=this[Ri("0x3")];t[Ri("0x4")][Ri("0x1")](Ri("0x2"))&&t[Ri("0x4")][Ri("0x6")]("TrackChangesEditing").enableCommand(Ri("0x5"))}}const Si=["registerElementLabel","afterInit","get","TrackChangesEditing","_descriptionFactory","ELEMENT_PAGE_BREAK","enableCommand","editor","pageBreak","PageBreakEditing","plugins"];var wi,Mi;wi=Si,Mi=134,function(t){for(;--t;)wi.push(wi.shift())}(++Mi);const Ni=function(t,e){return Si[t-=0]};class Li extends t.Plugin{[Ni("0xa")](){const t=this[Ni("0x5")];if(!t[Ni("0x8")].has(Ni("0x7")))return;t[Ni("0x8")][Ni("0x0")](Ni("0x1"))[Ni("0x4")](Ni("0x6"));const e=t[Ni("0x8")][Ni("0x0")](Ni("0x1")),n=t.locale;e[Ni("0x2")][Ni("0x9")](Ni("0x6"),(t=>kr(n,Ni("0x3"),t)))}}const Oi=["span","insertParagraph","isBlock","checkChild","addClass","ck-suggestion-marker-split","Paragraph","createUIElement","*Insert:* %0","markerName","highest","markBlockFormat","consume","markerRange","bindElementToMarker","addMarker:suggestion:insertion","afterInit","model","registerDescriptionCallback","document","registerElementLabel","TrackChangesEditing","toViewPosition","selection","isObject","data","change","commandName","isTouching","editing","parent","$text","start","format","insert","type","downcastDispatcher","insertion","ck-suggestion-marker--active","schema","mapper","isLimit","consumable","getSelectedBlocks","_descriptionFactory","locale","activeMarkers","writer","get","enableCommand","paragraph","options","has","plugins","end","nodeAfter"];var Fi,Pi;Fi=Oi,Pi=228,function(t){for(;--t;)Fi.push(Fi.shift())}(++Pi);const Di=function(t,e){return Oi[t-=0]};class ji extends t.Plugin{[Di("0xc")](){const t=this.editor;if(!t[Di("0x31")][Di("0x30")](Di("0x2")))return;const e=t[Di("0x29")],n=t[Di("0x31")][Di("0x2c")](Di("0x11"));n[Di("0x28")][Di("0x10")](Di("0x2e"),(t=>kr(e,"ELEMENT_PARAGRAPH",t))),n[Di("0x2d")](Di("0x2e"),((e,o={})=>{const r=t.model[Di("0xf")],s=o[Di("0x13")]||r[Di("0x13")],i=Array.from(s[Di("0x27")]()).filter((t=>{return e=t,(n=this.editor[Di("0xd")].schema)[Di("0x37")](e[Di("0x1a")],Di("0x2e"))&&!n[Di("0x14")](e)&&Di("0x2e")!=e.name;var e,n}));t[Di("0xd")][Di("0x16")]((()=>{for(const t of i)n[Di("0x7")](t,{commandName:Di("0x2e"),commandParams:[],formatGroupId:"blockName"},Ur(t))}))})),n[Di("0x28")][Di("0xe")]((t=>{const{data:n}=t;if(n&&Di("0x2e")==n[Di("0x17")])return{type:Di("0x1d"),content:kr(e,"*Change to:* %0",kr(e,"ELEMENT_PARAGRAPH"))}})),n[Di("0x2d")](Di("0x35")),t[Di("0x19")][Di("0x20")].on(Di("0xb"),Bi(t),{priority:Di("0x6")}),t[Di("0x15")][Di("0x20")].on(Di("0xb"),((e,n,o)=>{o[Di("0x2f")].showSuggestionHighlights&&Bi(t,{showActiveMarker:!1})(e,n,o)}),{priority:Di("0x6")});const o=n._descriptionFactory;o[Di("0xe")]((n=>{if(Di("0x21")!==n[Di("0x1f")])return;const{start:r,end:s}=n.getFirstRange();if(!r[Di("0x18")](s)||!r[Di("0x33")])return;const i=t.model[Di("0x23")],x=r[Di("0x33")];return i[Di("0x36")](x)&&!i.isLimit(x)&&i[Di("0x37")](x,"$text")?{type:Di("0x21"),content:kr(e,Di("0x4"),o.getItemLabel(x.name,1))}:void 0}))}}function Bi(t,{showActiveMarker:e=!0}={}){return(n,o,r)=>{const s=t[Di("0x31")].get(Di("0x11")),i=o[Di("0x9")][Di("0x1c")],x=o[Di("0x9")][Di("0x32")],a=t[Di("0xd")][Di("0x23")];if(!i.isTouching(x)||!i[Di("0x33")])return;const c=i[Di("0x33")];if(a[Di("0x36")](c)&&!a[Di("0x25")](c)&&a[Di("0x37")](c,Di("0x1b"))){if(!r[Di("0x26")][Di("0x8")](o[Di("0x9")],n.name))return;const t=r.writer[Di("0x3")](Di("0x34"),{class:Di("0x1")}),i=r[Di("0x24")][Di("0x12")](x);e&&s[Di("0x2a")].includes(o[Di("0x5")])&&r[Di("0x2b")][Di("0x0")](Di("0x22"),t),r[Di("0x2b")][Di("0x1e")](i,t),r[Di("0x24")][Di("0xa")](t,o[Di("0x5")])}}}const Ui=["getAttributes","locale","get","from","commandName","plugins","isCollapsed","getAttributeProperties","*Remove all formatting*","change","model","removeFormat","document","_descriptionFactory","editor","enableCommand","TrackChangesEditing","afterInit","schema","format","isFormatting"];var Hi,Gi;Hi=Ui,Gi=105,function(t){for(;--t;)Hi.push(Hi.shift())}(++Gi);const zi=function(t,e){return Ui[t-=0]};class Vi extends t.Plugin{[zi("0x11")](){const t=this[zi("0xe")];if(!t[zi("0x5")].has("RemoveFormatEditing"))return;const e=t.plugins[zi("0x2")](zi("0x10"));e[zi("0xf")](zi("0xb"),(n=>{const o=t.model[zi("0xc")].selection;o[zi("0x6")]?n():t.model[zi("0x9")]((()=>{const n=Array[zi("0x3")](o.getRanges());for(const o of n)for(const n of o.getItems())Wi(n,t[zi("0xa")][zi("0x12")])&&e.markInlineFormat(t[zi("0xa")].createRangeOn(n),{commandName:zi("0xb"),commandParams:[]})}))})),e[zi("0xd")].registerDescriptionCallback((e=>{const{data:n}=e;if(n&&zi("0xb")==n[zi("0x4")])return{type:zi("0x13"),content:kr(t[zi("0x1")],zi("0x8"))}}))}}function Wi(t,e){for(const[n]of t[zi("0x0")]()){const t=e[zi("0x7")](n);if(t&&t[zi("0x14")])return!0}return!1}const Ki=["enableCommand","RestrictedEditingModeEditing","goToNextRestrictedEditingException","trackChanges","goToPreviousRestrictedEditingException","editor","get","plugins","has","acceptSelectedSuggestions","acceptAllSuggestions","acceptSuggestion","discardSelectedSuggestions","discardSuggestion","afterInit"];var qi,$i;qi=Ki,$i=446,function(t){for(;--t;)qi.push(qi.shift())}(++$i);const Xi=function(t,e){return Ki[t-=0]};class Ji extends t.Plugin{[Xi("0x3")](){const t=this[Xi("0x9")];if(!t.plugins[Xi("0xc")](Xi("0x5")))return;const e=t[Xi("0xb")][Xi("0xa")]("TrackChangesEditing");e[Xi("0x4")](Xi("0x8")),e[Xi("0x4")](Xi("0x6"));const n=t.plugins[Xi("0xa")](Xi("0x5"));n[Xi("0x4")](Xi("0x7")),n[Xi("0x4")](Xi("0x0")),n[Xi("0x4")](Xi("0x2")),n.enableCommand(Xi("0xe")),n[Xi("0x4")]("discardAllSuggestions"),n[Xi("0x4")](Xi("0xd")),n[Xi("0x4")](Xi("0x1"))}}const Qi=["editing","registerElementLabel","writer","high","model","editor","bindElementToMarker","insert","deletion","markerName","data","addClass","addMarker:suggestion","addMarker:suggestion:deletion","mapper","element","split","name","plugins","markerRange","createUIElement","showSuggestionHighlights","ck-suggestion-marker--active","toViewPosition","options","activeMarkers","requires","TrackChangesEditing","test","enableCommand","init","_descriptionFactory","get","consumable","shiftEnter","downcastDispatcher","softBreak","span"];var Yi,Zi;Yi=Qi,Zi=288,function(t){for(;--t;)Yi.push(Yi.shift())}(++Zi);const tx=function(t,e){return Qi[t-=0]};class ex extends t.Plugin{static get[tx("0x4")](){return[bs.ShiftEnter]}[tx("0x8")](){const t=this[tx("0x15")],e=t[tx("0x22")][tx("0xa")](tx("0x5"));e[tx("0x7")](tx("0xc")),t[tx("0x10")][tx("0xd")].on("addMarker:suggestion:insertion",nx(t),{priority:tx("0x13")}),t[tx("0x10")][tx("0xd")].on(tx("0x1d"),nx(t),{priority:tx("0x13")}),t[tx("0x1a")].downcastDispatcher.on(tx("0x1c"),((e,n,o)=>{o[tx("0x2")][tx("0x25")]&&nx(t,{showActiveMarker:!1})(e,n,o)})),e[tx("0x9")][tx("0x11")](tx("0xe"),(e=>kr(t.locale,"ELEMENT_LINE_BREAK",e)))}}function nx(t,{showActiveMarker:e=!0}={}){return(n,o,r)=>{const s=t.plugins[tx("0xa")]("TrackChangesEditing");if(!r[tx("0xb")][tx("0x6")](o[tx("0x23")],n[tx("0x21")]))return;const i=t[tx("0x14")];for(const t of o[tx("0x23")].getItems()){if(!t.is(tx("0x1f"),tx("0xe")))continue;const n=tx("0x18")==o[tx("0x19")][tx("0x20")](":")[1]?"merge":tx("0x20"),x=r[tx("0x12")][tx("0x24")](tx("0xf"),{class:"ck-suggestion-marker-"+n}),a=r[tx("0x1e")][tx("0x1")](i.createPositionBefore(t));e&&s[tx("0x3")].includes(o[tx("0x19")])&&r[tx("0x12")][tx("0x1b")](tx("0x0"),x),r.writer[tx("0x17")](a,x),r.mapper[tx("0x16")](x,o.markerName)}}}const ox=["forceValue","_descriptionFactory","plugins","markInlineFormat","FORMAT_RESTRICTED_DISABLED","editor","getRanges","selection","format","StandardEditingModeEditing","get","locale","value","registerDescriptionCallback","restrictedEditingException","commands"];var rx,sx;rx=ox,sx=371,function(t){for(;--t;)rx.push(rx.shift())}(++sx);const ix=function(t,e){return ox[t-=0]};class xx extends t.Plugin{afterInit(){const t=this[ix("0x2")],e=t.model,n=t[ix("0x8")];if(!t[ix("0xf")].has(ix("0x6")))return;const o=t.plugins[ix("0x7")]("TrackChangesEditing"),r=ix("0xb"),s=t[ix("0xc")][ix("0x7")](r);o.enableCommand(r,((t,n={})=>{const i=e.document[ix("0x4")];if(i.isCollapsed)return void t(n);const x=void 0!==n.forceValue?n.forceValue:!s[ix("0x9")];e.change((()=>{const t=Array.from(i[ix("0x3")]());for(const n of t){const t=x?[n]:Br(r,n,e);for(const e of t)o[ix("0x0")](e,{commandName:r,commandParams:[{forceValue:x}]})}}))})),o[ix("0xe")][ix("0xa")]((t=>{const{data:e}=t;if(e&&e.commandName==r)return e.commandParams[0][ix("0xd")]?{type:ix("0x5"),content:kr(n,"FORMAT_RESTRICTED_ENABLED")}:{type:ix("0x5"),content:kr(n,ix("0x1"))}}))}}const ax=["selectTableRow","minColumn","refresh","isArray","markMultiRangeDeletion","model","order","above","filter","maxColumn","insertTableRowAbove","getSuggestion","hasAttribute","commands","colspan","showSuggestionHighlights","fromRange","getContainedElement","getItems","getFirstRange","maxRow","locale","tableCell","differ","insertTable","markMultiRangeInsertion","_setupColumnsRowsFixing","_suggestionFactory","plugins","end","last","insert","length","findAncestor","toLowerCase","isIntersectingWithRange","_getSuggestionCoords","getChildren","options","minRow","MIN_SAFE_INTEGER","_getCoordsForCells","TableEditing","root","ELEMENT_TABLE_COLUMN","selection","rowspan","mapper","getAttribute","_tablePostFixingSubtypes","ELEMENT_TABLE_COLUMN_WITH_TEXT","afterInit","editor","MAX_SAFE_INTEGER","name","*Remove:* %0","TableUtils","getSelectionAffectedTableCells","addMarker:suggestion","getChangedMarkers","removeClass","ELEMENT_TABLE_ROW_WITH_TEXT","document","deletion","_acceptFormatSuggestionCallbackFactory","add","registerCustomCallback","enqueueChange","low","registerDescriptionCallback","ELEMENT_TABLE","batch","getRanges","tableRow","nodeAfter","createTableWalker","execute","setSelection","table","accept","tableColumn","insertTableColumnLeft","detach","includes","addRange","type","change:data","span","map","removeTableRow","selectTableColumn","push","from","createPositionAt","TrackChangesEditing","ELEMENT_TABLE_WITH_TEXT","$graveyard","toViewElement","*Insert:* %0","startsWith","getChanges","isTouching","subType","textProxy","getCellLocation","registerElementLabel","nodeBefore","isInContent","left","max","getRowIndexes","createRangeOn","position","get","insertTableRowBelow","insertTableColumnRight","some","_descriptionFactory","data","isEqual","rootName","first","classes","change","substr","_tableSuggestions","getColumnIndexes","cell","_splitMarkerName","join","enableCommand","start","tablePaste","ELEMENT_TABLE_ROW","insertion","removeTableColumn","has","downcastDispatcher","min","values","discard"];var cx,lx;cx=ax,lx=412,function(t){for(;--t;)cx.push(cx.shift())}(++lx);const ux=function(t,e){return ax[t-=0]};class dx extends t.Plugin{constructor(t){super(t),this[ux("0x3c")]=[ux("0x54"),ux("0x5b")]}[ux("0x3e")](){const t=this[ux("0x3f")],e=t[ux("0x10")].document.selection;if(!t.plugins[ux("0x6")](ux("0x35")))return;const n=t[ux("0x20")],o=t[ux("0x27")][ux("0x7c")](ux("0x69")),r=t[ux("0x27")].get(ux("0x43"));o._descriptionFactory[ux("0x74")](ux("0x59"),(t=>kr(n,ux("0x51"),t))),this[ux("0x25")](),o.enableCommand(ux("0x23")),o[ux("0x0")](ux("0xb")),o[ux("0x0")](ux("0x65"));for(const n of[ux("0x15"),ux("0x7d")]){const s=t[ux("0x18")].get(n);o[ux("0x0")](n,(n=>{t[ux("0x10")].change((t=>{n();const i=ux("0x12")===s[ux("0x11")],x=r.getSelectionAffectedTableCells(e),a=r[ux("0x79")](x),c=i?a[ux("0x84")]-1:a[ux("0x29")]+1,l=x[0][ux("0x2c")](ux("0x59")),u=r[ux("0x56")](l,{startRow:c,endRow:c}),d=Array[ux("0x67")](u)[ux("0x63")]((e=>t[ux("0x7a")](e[ux("0x8a")])));o[ux("0x24")](d,"tableRow")}))}))}for(const n of[ux("0x5c"),ux("0x7e")]){const s=t[ux("0x18")][ux("0x7c")](n);o.enableCommand(n,(n=>{t[ux("0x10")][ux("0x86")]((t=>{n();const i=ux("0x77")===s[ux("0x11")],x=r[ux("0x44")](e),a=r[ux("0x89")](x),c=i?a[ux("0x84")]-1:a[ux("0x29")]+1,l=x[0].findAncestor(ux("0x59")),u=r.createTableWalker(l,{startRow:0,column:c,includeAllSlots:!1}),d=Array.from(u)[ux("0x63")]((e=>t[ux("0x7a")](e.cell)));o[ux("0x24")](d,ux("0x5b"))}))}))}for(const n of[ux("0x64"),"removeTableColumn"]){const s=n[ux("0x87")](11),i=s[ux("0x2d")](),x=i[ux("0x87")](0,3)+ux("0x62"),a=ux("0x59")+s,c=ux("0x8")+s,l=ux("0x78")+s;o.enableCommand(n,(()=>{t.model.change((t=>{const s=r[ux("0x44")](e),u=s[0][ux("0x2c")](ux("0x59"));let d;if(ux("0x64")==n){const t=r[ux("0x79")](s);d={startRow:t[ux("0x84")],endRow:t[ux("0x29")],includeAllSlots:!0}}else{const t=r.getColumnIndexes(s);d={startColumn:t[ux("0x84")],endColumn:t.last,includeAllSlots:!0}}const g=r[ux("0x56")](u,d),f=Array[ux("0x67")](g)[ux("0x63")]((({cell:t})=>t)),m=gx(f[ux("0x13")]((t=>t[ux("0x17")](x)))),h=gx(f.filter((t=>!t[ux("0x17")](x))))[ux("0x63")]((e=>t[ux("0x7a")](e))),p=o[ux("0xf")](h,a);if(p&&(ux("0x54")==p.subType||ux("0x5b")==p.subType)){const e=this._getSuggestionCoords(p);for(const n of m){const o=t.createRangeOn(n),s=r.getCellLocation(n),a=n[ux("0x3b")](x)-1,u=e[c],d=e[l];u<=s[i]&&s[i]+a<=d&&p[ux("0x5f")](o)}}}))}))}function s(n){const o=Array[ux("0x67")](e[ux("0x53")]())[ux("0x63")]((t=>F.LiveRange[ux("0x1b")](t)));t.model[ux("0x86")]((e=>{const r=e[ux("0x52")];n=n.filter((t=>ux("0x6b")!=t[ux("0x36")].rootName)),e[ux("0x58")](n),t[ux("0x18")].get(ux("0x64"))[ux("0xd")](),t.execute(ux("0x64"),{forceDefaultExecution:!0}),t[ux("0x10")][ux("0x4e")]((()=>{t[ux("0x10")][ux("0x4e")](r,(t=>{const e=o[ux("0x13")]((t=>"$graveyard"!=t[ux("0x36")].rootName));e[ux("0x2b")]>0&&t[ux("0x58")](e);for(const t of o)t[ux("0x5d")]()}))}))}))}function i(n){t[ux("0x10")][ux("0x86")]((o=>{const r=Array[ux("0x67")](e.getRanges()).map((t=>F.LiveRange[ux("0x1b")](t))),s=[];for(const t of n)for(const e of t[ux("0x1d")]({shallow:!0}))s[ux("0x66")](e);for(const e of s)ux("0x6b")!=e[ux("0x36")][ux("0x83")]&&(o[ux("0x58")](o[ux("0x68")](e,0)),t[ux("0x18")][ux("0x7c")](ux("0x5")).refresh(),t[ux("0x57")](ux("0x5"),{forceDefaultExecution:!0}));const i=r[ux("0x13")]((t=>ux("0x6b")!=t[ux("0x36")][ux("0x83")]));i.length>0&&o[ux("0x58")](i);for(const t of r)t[ux("0x5d")]()}))}function x(t,e){return e.every((e=>t[ux("0x7f")]((t=>t.end[ux("0x82")](e.start)||e[ux("0x28")][ux("0x82")](t[ux("0x1")])))))}function a(t,e){return t.some((t=>e[ux("0x7f")]((e=>t.end[ux("0x70")](e[ux("0x1")])))))}t.data[ux("0x7")].on(ux("0x45"),((t,e,n)=>{if(!n[ux("0x31")][ux("0x1a")])return;const o=e.item;if(!o)return;const r=n[ux("0x3a")][ux("0x6c")](o);function s(t){return Array[ux("0xe")](t)?t:[t]}r&&"tableCell"===o[ux("0x41")]&&(0,P.setHighlightHandling)(r,n.writer,((t,e,n)=>n.addClass(s(e[ux("0x85")]),t)),((t,e,n)=>n[ux("0x47")](s(e[ux("0x85")]),t)))}),{priority:"highest"}),o._descriptionFactory[ux("0x50")]((t=>{if(ux("0x4")!=t[ux("0x60")]&&"deletion"!=t[ux("0x60")])return;const e=t[ux("0x1c")]();if(null!=e&&e.is("element",ux("0x59"))){if("insertion"==t[ux("0x60")]){const e=t[ux("0x1d")]().filter((t=>t.is("textProxy")))[ux("0x63")]((t=>t[ux("0x81")]));if(e[ux("0x2b")])return{type:ux("0x4"),content:kr(n,ux("0x6d"),kr(n,"ELEMENT_TABLE_WITH_TEXT",'"'+e.join(" ")+'"'))}}if(ux("0x4a")==t.type){const e=t[ux("0x1d")]()[ux("0x13")]((t=>t.is(ux("0x72"))))[ux("0x63")]((t=>t[ux("0x81")]));if(e.length)return{type:ux("0x4a"),content:kr(n,ux("0x42"),kr(n,ux("0x6a"),'"'+e[ux("0x8c")](" ")+'"'))}}}})),o[ux("0x80")].registerDescriptionCallback((t=>{if(ux("0x54")==t[ux("0x71")]){const e=t[ux("0x1d")]()[ux("0x13")]((t=>t.is(ux("0x72"))))[ux("0x63")]((t=>t[ux("0x81")])),o=this[ux("0x2f")](t),r=o[ux("0x1f")]-o[ux("0x32")]+1;if(ux("0x4")==t[ux("0x60")])return e[ux("0x2b")]?{type:ux("0x4"),content:kr(n,ux("0x6d"),kr(n,ux("0x48"),[r,'"'+e.join(" ")+'"']))}:{type:"insertion",content:kr(n,ux("0x6d"),kr(n,ux("0x3"),r))};if(ux("0x4a")==t.type)return e[ux("0x2b")]?{type:ux("0x4a"),content:kr(n,ux("0x42"),kr(n,"ELEMENT_TABLE_ROW_WITH_TEXT",[r,'"'+e.join(" ")+'"']))}:{type:ux("0x4a"),content:kr(n,ux("0x42"),kr(n,ux("0x3"),r))}}if(ux("0x5b")==t[ux("0x71")]){const e=t[ux("0x1d")]()[ux("0x13")]((t=>t.is("textProxy"))).map((t=>t[ux("0x81")])),o=this[ux("0x2f")](t),r=o[ux("0x14")]-o[ux("0xc")]+1;if(ux("0x4")==t[ux("0x60")])return e[ux("0x2b")]?{type:ux("0x4"),content:kr(n,ux("0x6d"),kr(n,ux("0x3d"),[r,'"'+e[ux("0x8c")](" ")+'"']))}:{type:"insertion",content:kr(n,ux("0x6d"),kr(n,ux("0x37"),r))};if("deletion"==t[ux("0x60")])return e.length?{type:ux("0x4a"),content:kr(n,"*Remove:* %0",kr(n,ux("0x3d"),[r,'"'+e.join(" ")+'"']))}:{type:ux("0x4a"),content:kr(n,ux("0x42"),kr(n,ux("0x37"),r))}}})),o[ux("0x26")].registerCustomCallback(ux("0x4"),ux("0x54"),ux("0xa"),s),o[ux("0x26")].registerCustomCallback(ux("0x4a"),ux("0x54"),ux("0x5a"),s),o[ux("0x26")][ux("0x4d")](ux("0x4"),ux("0x5b"),ux("0xa"),i),o._suggestionFactory[ux("0x4d")](ux("0x4a"),"tableColumn",ux("0x5a"),i),o[ux("0x26")][ux("0x4d")](ux("0x4"),"tableColumn","join",x),o[ux("0x26")][ux("0x4d")]("deletion",ux("0x5b"),"join",x),o[ux("0x26")][ux("0x4d")](ux("0x4"),ux("0x54"),ux("0x8c"),a),o._suggestionFactory[ux("0x4d")](ux("0x4a"),ux("0x54"),ux("0x8c"),a)}[ux("0x4b")](){const t=this[ux("0x3f")],e=t[ux("0x10")][ux("0x49")][ux("0x38")];return(n,o)=>{t[ux("0x10")].change((r=>{const{commandName:s,commandParams:i}=o;let x=n[0][ux("0x28")][ux("0x75")];i&&i[0]&&!1===i[0].forceValue&&(x=n[0][ux("0x1")][ux("0x55")]);const a=r.createRangeIn(x);if("$graveyard"==a[ux("0x36")][ux("0x83")])return;const c=Array[ux("0x67")](e[ux("0x53")]())[ux("0x63")]((t=>F.LiveRange[ux("0x1b")](t)));r[ux("0x58")](a),t.commands[ux("0x7c")](s)[ux("0xd")](),i[ux("0x66")]({forceDefaultExecution:!0}),t[ux("0x57")](s,...i);const l=c[ux("0x13")]((t=>"$graveyard"!=t.root[ux("0x83")]));l[ux("0x2b")]>0&&r[ux("0x58")](l);for(const t of c)t[ux("0x5d")]()}))}}_getCoordsForCells(t){const e=this[ux("0x3f")][ux("0x27")][ux("0x7c")](ux("0x43"));let n=Number[ux("0x40")],o=Number[ux("0x33")],r=Number[ux("0x40")],s=Number.MIN_SAFE_INTEGER;for(const i of t){if(ux("0x6b")==i[ux("0x36")][ux("0x83")])continue;const{row:t,column:x}=e[ux("0x73")](i),a=i[ux("0x17")](ux("0x39"))?i[ux("0x3b")](ux("0x39"))-1:0,c=i[ux("0x17")]("colspan")?i[ux("0x3b")](ux("0x19"))-1:0;n=t<n?t:n,o=t+a>o?t+a:o,r=x<r?x:r,s=x+c>s?x+c:s}return{minRow:n,maxRow:o,minColumn:r,maxColumn:s}}[ux("0x25")](){const t=this[ux("0x3f")],e=t[ux("0x27")].get(ux("0x69")),n=t[ux("0x27")][ux("0x7c")](ux("0x43"));this[ux("0x88")]=new Set,t.model.document.on(ux("0x61"),(()=>{const n=Array[ux("0x67")](t.model[ux("0x49")][ux("0x22")][ux("0x46")]());for(const{name:t,data:o}of n){const{group:n,id:r,subType:s}=e[ux("0x8b")](t);if("suggestion"!=n)continue;if(null!=o.oldRange)continue;const i=e[ux("0x16")](r);this[ux("0x3c")][ux("0x5e")](s)&&this[ux("0x88")][ux("0x4c")](i)}}),{priority:ux("0x4f")});const o=(t,e)=>{let o=!1;const r=e[ux("0x7a")](t),s=t[ux("0x2c")]("table"),i=n[ux("0x73")](t);for(const e of this[ux("0x88")]){const n=e[ux("0x71")],x=n[ux("0x6e")](ux("0x2")),a=n.substr(x?10:5),c=a[ux("0x2d")](),l=c.substr(0,3)+"span",u=ux("0x8")+a,d=ux("0x78")+a;if(!e[ux("0x76")])continue;if(s!=e[ux("0x1e")]()[ux("0x1")].findAncestor(ux("0x59")))continue;if(e[ux("0x2e")](r))continue;const g=t[ux("0x17")](l)?t.getAttribute(l)-1:0,f=this._getSuggestionCoords(e),m=f[u],h=f[d];m<=i[c]&&i[c]+g<=h&&(e[ux("0x5f")](r),o=!0)}return o};t[ux("0x10")][ux("0x49")].registerPostFixer((e=>{let n=!1;for(const r of t.model[ux("0x49")][ux("0x22")][ux("0x6f")]())if(ux("0x2a")==r[ux("0x60")])if(ux("0x54")==r[ux("0x41")])for(const t of r[ux("0x7b")][ux("0x55")][ux("0x30")]())n=n||o(t,e);else ux("0x21")==r[ux("0x41")]&&(n=n||o(r[ux("0x7b")][ux("0x55")],e));return n}))}[ux("0x2f")](t){return this[ux("0x34")](t[ux("0x53")]()[ux("0x63")]((t=>t.start.nodeAfter)))}}function gx(t){return Array[ux("0x67")](new Set(t)[ux("0x9")]())}const fx=["afterInit","_suggestionFactory","getRanges","map","value","get","TableUtils","set:isEnabled","accept","splitTableCellVertically","subType","mergeTableCells","_isForcedDefaultExecutionBlock","table","cell","getSelectionAffectedTableCells","commands","highest","editor","_acceptFormatSuggestionCallbackFactory","fromRange","type","enableCommand","_areSelectedCellsMergable","isInContent","mergeTableCellLeft","locale","change","insertion","element","has","containsRange","root","mergeTableCellUp","formatBlock","add","return","getAncestors","length","model","execute","getCellLocation","$graveyard","setSelection","format","TableEditing","tableCell","selection","size","_areMergableCells","low","deletion","_tablePostFixingSubtypes","createTableWalker","getFirstPosition","from","TrackChangesEditing","*Split cell:* horizontally","commandName","*Merge cells*","mergeTableCellDown","markMultiRangeBlockFormat","registerDescriptionCallback","author","filter","document","find","detach","registerCustomCallback","mergeTableCellRight","stop","splitTableCellHorizontally","plugins","rootName","createRangeOn","_descriptionFactory","refresh"];var mx,hx;mx=fx,hx=183,function(t){for(;--t;)mx.push(mx.shift())}(++hx);const px=function(t,e){return fx[t-=0]};class bx extends t.Plugin{static get requires(){return[dx]}[px("0x30")](){const t=this.editor,e=t[px("0xa")][px("0x24")][px("0x12")],n=t[px("0x4a")];if(!t[px("0x2b")][px("0x1")](px("0x10")))return;const o=t[px("0x2b")][px("0x35")]("TrackChangesEditing"),r=t[px("0x2b")][px("0x35")]("TableUtils"),s=t.plugins[px("0x35")](dx);s[px("0x17")].push(px("0x3b")),o[px("0x46")](px("0x3b"),(()=>{const e=r.getSelectionAffectedTableCells(t[px("0xa")][px("0x24")].selection);t[px("0xa")][px("0x4b")]((()=>{o.markMultiRangeBlockFormat(e,{commandName:"mergeTableCells",commandParams:[]},[],px("0x3b"))}))})),t.commands.get("mergeTableCells").on(px("0xb"),((e,n)=>{t.commands[px("0x35")]("trackChanges").value&&(n[px("0x9")]>0&&n[n[px("0x9")]-1]&&n[n[px("0x9")]-1].forceDefaultExecution||o[px("0x3c")]||this[px("0x47")]()||e[px("0x29")]())}),{priority:px("0x41")});for(const e of["mergeTableCellUp","mergeTableCellRight",px("0x1f"),"mergeTableCellLeft"]){const n=t[px("0x40")][px("0x35")](e);o.enableCommand(e,(()=>{const e=t[px("0xa")].document[px("0x12")][px("0x19")]()[px("0x8")]()[px("0x25")]((t=>t.is("element",px("0x11")))),r=n[px("0x34")];t[px("0xa")][px("0x4b")]((()=>{o[px("0x20")]([e,r],{commandName:px("0x3b"),commandParams:[]},[],px("0x3b"))}))}))}for(const e of[px("0x39"),px("0x2a")]){const n=t[px("0x40")].get(e);o[px("0x46")](e,(()=>{const s=r[px("0x3f")](t[px("0xa")].document.selection)[0],i=s.findAncestor(px("0x3d")),{column:x,row:a}=r[px("0xc")](s);let c=[];if("horizontally"==n.direction){const t=r[px("0x18")](i,{startRow:a,endRow:a,includeAllSlots:!0});c=Array[px("0x1a")](t).map((t=>t[px("0x3e")]))}else{const t=r[px("0x18")](i,{column:x,includeAllSlots:!0});c=Array[px("0x1a")](t)[px("0x33")]((t=>t[px("0x3e")]))}t.model.change((t=>{o.markBlockFormat(t[px("0x2d")](s),{commandName:e,commandParams:[]},c,e)}))}))}o[px("0x2e")][px("0x21")]((t=>{const{data:e}=t;if(e)return"mergeTableCells"==e.commandName?{type:px("0xf"),content:kr(n,px("0x1e"))}:void 0})),o[px("0x2e")][px("0x21")]((t=>{const{data:e}=t;if(e)return"splitTableCellVertically"==e[px("0x1d")]?{type:px("0xf"),content:kr(n,"*Split cell:* vertically")}:px("0x2a")==e.commandName?{type:px("0xf"),content:kr(n,px("0x1c"))}:void 0}));const i=s[px("0x43")]();for(const t of["mergeTableCellUp",px("0x28"),"mergeTableCellDown",px("0x49")])o[px("0x31")][px("0x27")]("formatBlock",t,px("0x38"),i);for(const t of["splitTableCellVertically",px("0x2a")])o._suggestionFactory[px("0x27")]("formatBlock",t,"accept",i);o[px("0x31")].registerCustomCallback(px("0x5"),px("0x3b"),px("0x38"),(n=>{t[px("0xa")][px("0x4b")]((o=>{const r=Array[px("0x1a")](e.getRanges())[px("0x33")]((t=>F.LiveRange[px("0x44")](t)));o.setSelection(n),t[px("0x40")].get(px("0x3b"))[px("0x2f")](),t.execute(px("0x3b"),{forceDefaultExecution:!0});const s=r[px("0x23")]((t=>px("0xd")!=t[px("0x3")][px("0x2c")]));s.length>0&&o[px("0xe")](s);for(const t of r)t[px("0x26")]()}))}));for(const e of[px("0x4"),px("0x1f"),"mergeTableCellLeft",px("0x28")]){const n=t[px("0x40")][px("0x35")](e);n.on(px("0x37"),((e,o,r)=>{if(r){const o=t[px("0xa")][px("0x24")][px("0x12")].getFirstPosition()[px("0x8")]()[px("0x25")]((t=>t.is(px("0x0"),px("0x11"))));this[px("0x14")](n[px("0x34")],o)||(e[px("0x7")]=!1,e.stop())}}),{priority:px("0x15")})}}[px("0x47")](){const t=this[px("0x42")][px("0x40")][px("0x35")]("mergeTableCells"),e=this[px("0x42")][px("0x2b")][px("0x35")](px("0x36"));if(!t.isEnabled)return!1;const n=e[px("0x3f")](this[px("0x42")].model[px("0x24")].selection);for(const t of n)for(const e of n)if(t!=e&&!this[px("0x14")](t,e))return!1;return!0}[px("0x14")](t,e){const n=this[px("0x42")].plugins[px("0x35")](px("0x1b")),o=this[px("0x42")][px("0xa")][px("0x2d")](t),r=this[px("0x42")].model[px("0x2d")](e),s=new Set,i=new Set;for(const t of n.getSuggestions())if((px("0x4c")==t[px("0x45")]||px("0x16")==t.type||px("0x3b")==t[px("0x3a")])&&t[px("0x48")])for(const e of t[px("0x32")]())e[px("0x2")](o,!0)&&s[px("0x6")](t[px("0x45")]+":"+t[px("0x22")].id),e[px("0x2")](r,!0)&&i[px("0x6")](t.type+":"+t[px("0x22")].id);if(s.size!=i[px("0x13")])return!1;for(const t of s)if(!i[px("0x1")](t))return!1;return!0}}const Ex=["activeMarkers","createPositionAfter","getSuggestion","getColumnIndexes","stop","TableEditing","ck-suggestion-marker-","highest","removeMarker:suggestion","format","TableUtils","findAncestor","removeClass","selection","commandName","item","commands","addMarker:suggestion","*Format:* %0","end","mapper","showSuggestionHighlights","data-suggestion","nodeBefore","markerNameToElements","createTableWalker","addClass","registerDescriptionCallback","getSelectionAffectedTableCells","options","enableCommand","FORMAT_HEADER_COLUMN","getCellLocation","value","index","ck-suggestion-marker--active","markerRange","has","parent","afterInit","plugins","first","_splitMarkerName","consume","cell","setAttribute","includes","forceValue","createPositionBefore","document","isBefore","accept","TrackChangesEditing","editing","childCount","FORMAT_HEADER_ROW","registerCustomCallback","setTableRowHeader","locale","from","commandParams","formatBlock","get","markBlockFormat","markerName","writer","last","table","model","data","setTableColumnHeader","FORMAT_REGULAR_COLUMN","requires","_descriptionFactory","createRange","change","downcastDispatcher","getChild","_acceptFormatSuggestionCallbackFactory","getAttribute","name","FORMAT_REGULAR_ROW","removeAttribute"];var _x,yx;_x=Ex,yx=418,function(t){for(;--t;)_x.push(_x.shift())}(++yx);const Tx=function(t,e){return Ex[t-=0]};class Cx extends t.Plugin{static get[Tx("0x45")](){return[dx]}[Tx("0x24")](){const t=this.editor;if(!t.plugins[Tx("0x22")](Tx("0x2")))return;const e=t[Tx("0x37")],n=t[Tx("0x25")][Tx("0x3b")](Tx("0x31")),o=t[Tx("0x25")].get(Tx("0x7")),r=t.plugins[Tx("0x3b")](dx);function s({showActiveMarker:t=!0,setDataAttribute:e=!0}={}){return(r,s,i)=>{const{type:x,id:a}=n[Tx("0x27")](s[Tx("0x3d")]),c=n[Tx("0x52")](a);if(!c[Tx("0x42")]||Tx("0x43")!=c[Tx("0x42")][Tx("0xb")])return;if(s[Tx("0xc")])return void r[Tx("0x1")]();if(!i.consumable[Tx("0x28")](s.markerRange,r[Tx("0x4d")]))return;const l=s[Tx("0x21")].start.nodeAfter,u=s[Tx("0x21")][Tx("0x10")][Tx("0x14")],d=l.parent[Tx("0x23")],{column:g}=o.getCellLocation(l),{column:f}=o[Tx("0x1d")](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[Tx("0x29")],c=i[Tx("0x11")].toViewElement(r);i[Tx("0x3e")][Tx("0x17")](Tx("0x3")+x,c),e&&i[Tx("0x3e")][Tx("0x2a")](Tx("0x13"),a,c),i[Tx("0x11")].bindElementToMarker(c,s[Tx("0x3d")]),t&&(n[Tx("0x50")][Tx("0x2b")](s[Tx("0x3d")])?i.writer[Tx("0x17")](Tx("0x20"),c):i[Tx("0x3e")][Tx("0x9")](Tx("0x20"),c))}}}}n[Tx("0x1b")](Tx("0x36"),((e,r)=>{const s=o[Tx("0x19")](t[Tx("0x41")][Tx("0x2e")][Tx("0xa")]),i=o.getRowIndexes(s),x=s[0][Tx("0x8")](Tx("0x40")),a=x[Tx("0x4c")]("headingRows")||0,c=r&&null!==r.forceValue?r.forceValue:!t[Tx("0xd")][Tx("0x3b")](Tx("0x36"))[Tx("0x1e")],l=c?i[Tx("0x3f")]:i[Tx("0x26")],u=x[Tx("0x4a")](l);let d;if(c){const e=x[Tx("0x4a")](a);if(u[Tx("0x1f")]<e[Tx("0x1f")])return;d=t[Tx("0x41")][Tx("0x47")](t[Tx("0x41")][Tx("0x2d")](e[Tx("0x4a")](0)),t[Tx("0x41")][Tx("0x51")](u.getChild(u.childCount-1)))}else{const e=x[Tx("0x4a")](a-1);if(!e)return;d=t[Tx("0x41")][Tx("0x47")](t[Tx("0x41")].createPositionBefore(u[Tx("0x4a")](0)),t[Tx("0x41")][Tx("0x51")](e[Tx("0x4a")](e[Tx("0x33")]-1)))}t[Tx("0x41")][Tx("0x48")]((()=>{n[Tx("0x3c")](d,{commandName:"setTableRowHeader",commandParams:[{forceValue:c}]},[],Tx("0x36"))}))})),n.enableCommand(Tx("0x43"),((e,o)=>{const r=t[Tx("0x25")][Tx("0x3b")](Tx("0x7")),s=r[Tx("0x19")](t.model[Tx("0x2e")][Tx("0xa")]),i=r[Tx("0x0")](s),x=s[0][Tx("0x8")](Tx("0x40")),a=x[Tx("0x4c")]("headingColumns")||0,c=o&&null!==o[Tx("0x2c")]?o.forceValue:!t[Tx("0xd")][Tx("0x3b")](Tx("0x43"))[Tx("0x1e")];let l;const u=x.getChild(0),d=c?i[Tx("0x3f")]:i[Tx("0x26")],g=r[Tx("0x16")](x,{startRow:0,column:d,includeAllSlots:!1}),f=Array[Tx("0x38")](g)[0].cell;if(c){const e=u[Tx("0x4a")](a);if(f[Tx("0x2f")](e))return;l=t[Tx("0x41")][Tx("0x47")](t[Tx("0x41")][Tx("0x2d")](e),t[Tx("0x41")][Tx("0x51")](f))}else{const e=u.getChild(a-1);if(!e)return;l=t[Tx("0x41")][Tx("0x47")](t.model[Tx("0x2d")](f),t[Tx("0x41")][Tx("0x51")](e))}t[Tx("0x41")][Tx("0x48")]((()=>{n[Tx("0x3c")](l,{commandName:"setTableColumnHeader",commandParams:[{forceValue:c}]},[],Tx("0x43"))}))})),t[Tx("0x32")][Tx("0x49")].on(Tx("0xe"),s(),{priority:Tx("0x4")}),t[Tx("0x42")].downcastDispatcher.on("addMarker:suggestion",((t,e,n)=>{n[Tx("0x1a")][Tx("0x12")]&&s({showActiveMarker:!1,setDataAttribute:!1})(t,e,n)}),{priority:Tx("0x4")}),t[Tx("0x32")][Tx("0x49")].on(Tx("0x5"),((t,e,o)=>{const{type:r,id:s}=n[Tx("0x27")](e[Tx("0x3d")]),i=n[Tx("0x52")](s);if(!i[Tx("0x42")]||Tx("0x43")!=i[Tx("0x42")][Tx("0xb")])return;const x=o.mapper[Tx("0x15")](e.markerName);if(x)for(const t of x)o.writer[Tx("0x9")](Tx("0x3")+r,t),o[Tx("0x3e")][Tx("0x9")]("ck-suggestion-marker--active",t),o[Tx("0x3e")][Tx("0x4f")](Tx("0x13"),t),o[Tx("0x11")].unbindElementFromMarkerName(t,e[Tx("0x3d")])}),{priority:Tx("0x4")}),n[Tx("0x46")][Tx("0x18")]((t=>{const{data:n}=t;if(n){if("setTableRowHeader"==n[Tx("0xb")]){const t=n[Tx("0x39")][0][Tx("0x2c")];return o(kr(e,Tx(t?"0x34":"0x4e")))}if(Tx("0x43")==n[Tx("0xb")]){const t=n[Tx("0x39")][0][Tx("0x2c")];return o(kr(e,Tx(t?"0x1c":"0x44")))}}function o(t){return{type:Tx("0x6"),content:kr(e,Tx("0xf"),t)}}}));const i=r[Tx("0x4b")]();n._suggestionFactory[Tx("0x35")](Tx("0x3a"),Tx("0x36"),Tx("0x30"),i),n._suggestionFactory[Tx("0x35")](Tx("0x3a"),"setTableColumnHeader",Tx("0x30"),i)}}const kx=["hasSuggestion","getMarkers","_descriptionFactory","tablePasteCell","author","suggestion:formatBlock:tablePasteCell","tableCellBackgroundColor","suggestionUnloaded","subType","showSuggestionHighlights","createRangeOn","deletion","tableCellVerticalAlignment","remove","_createdBatches","column","find","type","containsRange","setAttribute","markMultiRangeInsertion","getChangedMarkers","endRow","change","oldRange","fill","tableCellBorderWidth","attributes","ck-suggestion-marker--active","formatBlock","endColumn","getColumnIndexes","selection","rowInsertionRanges","$graveyard","getSuggestions","removeMarkers","previousSibling","root","register","TrackChangesEditing","from","discard","element","editingDowncast","keys","redo","position","tablePaste","createRange","createRangeIn","suggestionLoaded","_splitMarkerName","insertColumns","join","has","TableClipboard","suggestion-td","markerToHighlight","isEqual","next","registerPostFixer","getSuggestion","requires","rootName","getChildren","tablePasteRow","removeRows","move","_getCoordsForCells","newRange","fromEntries","length","start","name","previous","unwrap","editor","options","isEmpty","tableCellBorderStyle","batch","markMultiRangeDeletion","deletionRanges","set","high","forceDefaultExecution","Users","conversion","markerAttributes","elementToElement","return","createPositionBefore","TableUtils","updateMarker","cell","includes","getRows","differ","paragraph","tableCellPadding","suggestion","insertion","nodeAfter","model","end","tableCell","map","table","ck-suggestion-marker-insertion","insertionRanges","commands","setAttributes","columns","dataDowncast","tablePasteColumn","insert","_isForcedDefaultExecutionBlock","getRange","startsWith","activeMarkers","_tablePostFixingSubtypes","getColumns","findAncestor","stop","removeMarker","tableCellBorderColor","some","document","tablePasteChainId","nextSibling","getItems","first","last","value","getRanges","createElement","rows","get","filter","locale","getContainedElement","registerCustomCallback","for","getAllAdjacentSuggestions","tableCellSuggestion","rowInsertionIndexes","getChild","plugins","markMultiRangeBlockFormat","view","registerDescriptionCallback","markerName","insertRows","markers","isInContent","insertContent","_suggestionFactory","push","columnInsertionIndexes","accept","getTableIfOnlyTableInContent","trackChanges","columnInsertionRanges","*Replace table cells*","cells","getSelectionAffectedTableCells","createTableWalker"];var vx,Ax;vx=kx,Ax=125,function(t){for(;--t;)vx.push(vx.shift())}(++Ax);const Rx=function(t,e){return kx[t-=0]},Ix=[Rx("0x45"),Rx("0x1"),Rx("0x7b"),"tableCellHorizontalAlignment",Rx("0x37"),Rx("0x31"),Rx("0x8f")],Sx=Object[Rx("0x72")](Ix[Rx("0x96")]((t=>[t,null])));class wx extends t.Plugin{static get[Rx("0x6a")](){return[dx]}afterInit(){const t=this[Rx("0x78")];if(!t[Rx("0x17")][Rx("0x62")](Rx("0x63")))return;const n=t.plugins.get(Rx("0x53")),o=t[Rx("0x17")][Rx("0xd")](Rx("0x88")),r=t[Rx("0x17")][Rx("0xd")](dx),s=t[Rx("0x17")][Rx("0xd")]("TableClipboard");r[Rx("0xa4")][Rx("0x21")](Rx("0x6d"),Rx("0x9e")),t[Rx("0x93")].schema[Rx("0x52")](Rx("0x14"),{allowIn:Rx("0x95"),allowContentOf:Rx("0x95"),isLimit:!0}),t.conversion[Rx("0x85")]({model:"tableCellSuggestion",view:Rx("0x64")});let i=null;t[Rx("0x93")].on("insertContent",((r,x)=>{const[a,c]=x,l=x[x[Rx("0x73")]-1];l&&l[Rx("0x81")]||n[Rx("0xa0")]||this[Rx("0x78")][Rx("0x9a")][Rx("0xd")](Rx("0x25"))[Rx("0x9")]&&function(t,e,n,o,r){if(e&&!e.is("documentSelection"))return!1;const s=r[Rx("0x24")](t,n);if(!s||!Nx(s,null,o))return!1;const i=o[Rx("0x29")](n[Rx("0x3")][Rx("0x4b")]);if(!i[Rx("0x73")])return!1;const x=i[0][Rx("0xa6")](Rx("0x97")),a=o.getRowIndexes(i),c=o[Rx("0x4a")](i),l={startRow:a[Rx("0x7")],endRow:a[Rx("0x8")],startColumn:c[Rx("0x7")],endColumn:c[Rx("0x8")]};return 1==i[Rx("0x73")]&&(l[Rx("0x41")]+=o[Rx("0x8c")](s)-1,l[Rx("0x49")]+=o[Rx("0xa5")](s)-1),Nx(x,l,o)}(a,c,t[Rx("0x93")],o,s)&&(r[Rx("0xa7")](),i={cells:[],insertionRanges:[],deletionRanges:[],rowInsertionRanges:[],rowInsertionIndexes:[],columnInsertionRanges:[],columnInsertionIndexes:[]},t[Rx("0x93")][Rx("0x42")]((()=>{t[Rx("0x93")][Rx("0x1f")](x[0],x[1],x[2],x[3],{forceDefaultExecution:!0});const o=(0,e.uid)(),{rowInsertionRanges:r,columnInsertionRanges:s,insertionRanges:a,deletionRanges:c,cells:l}=i;r[Rx("0x73")]&&n[Rx("0x3f")](r,Rx("0x6d"),{tablePasteChainId:o}),s[Rx("0x73")]&&n[Rx("0x3f")](s,Rx("0x9e"),{tablePasteChainId:o}),a[Rx("0x73")]&&n[Rx("0x3f")](a,"tablePaste",{tablePasteChainId:o,skipNestingCheck:!0}),c[Rx("0x73")]&&n[Rx("0x7d")](c,"tablePaste",{tablePasteChainId:o,skipNestingCheck:!0});const u=n[Rx("0x18")](l[Rx("0x96")]((({element:t})=>t)),{formatGroupId:(0,e.uid)()},[],"tablePasteCell",{tablePasteChainId:o});if(u){const e=u.getMarkers(),n=[];for(const{element:o,attributes:r}of l){if(!r)continue;const s=t[Rx("0x93")].createRangeOn(o),i=e[Rx("0x3b")]((t=>t[Rx("0xa1")]()[Rx("0x66")](s)));i&&n.push([i[Rx("0x75")],r])}n.length&&u[Rx("0x3e")](Rx("0x84"),Object.fromEntries(n))}i=null})))}),{priority:e.priorities[Rx("0x80")]+10}),t[Rx("0x17")].get("TableClipboard").on("_replaceTableSlotCell",((t,e)=>{const[n,o,,r]=e;if(!i)return;t[Rx("0xa7")]();const s=n[Rx("0x8a")],x=o,a=Mx(s),c=Mx(x);t[Rx("0x86")]=s;let l=null,u=null;if(c||a)if(a&&!c){r.remove(s[Rx("0x16")](0));for(const t of Array[Rx("0x54")](x[Rx("0x6c")]()))r[Rx("0x9f")](t,s,Rx("0x94"));const t=i.rowInsertionIndexes[Rx("0x8b")](n.row),e=i[Rx("0x22")][Rx("0x8b")](n[Rx("0x3a")]);t||e||(l=r[Rx("0x5d")](s))}else c&&!a&&(u=r[Rx("0x5d")](s));else{const t=r[Rx("0xb")](Rx("0x14")),e=r[Rx("0xb")](Rx("0x14"));r.wrap(r[Rx("0x5d")](s),e),r[Rx("0x9f")](t,s,0);for(const e of Array[Rx("0x54")](x[Rx("0x6c")]()))r[Rx("0x9f")](e,t,"end");l=r[Rx("0x35")](t),u=r.createRangeOn(e)}const d=Array[Rx("0x54")](x.getAttributes())[Rx("0xe")]((([t])=>Ix.includes(t)));i[Rx("0x28")][Rx("0x21")]({element:s,attributes:d[Rx("0x73")]?Object[Rx("0x72")](d):null}),l&&i[Rx("0x99")][Rx("0x21")](l),u&&i[Rx("0x7e")].push(u)}),{priority:Rx("0x80")}),o.on(Rx("0x60"),((e,n)=>{const[r,s={}]=n;if(!i)return;const x=s.at||0,a=s[Rx("0x9c")]||1;i[Rx("0x22")]=new Array(a)[Rx("0x44")](x)[Rx("0x96")](((t,e)=>t+e));for(const{cell:e}of o[Rx("0x2a")](r,{startColumn:x,endColumn:x+a-1}))i[Rx("0x26")][Rx("0x21")](t[Rx("0x93")].createRangeOn(e))}),{priority:"low"}),o.on(Rx("0x1c"),((e,n)=>{const[r,s={}]=n;if(!i)return;const x=s.at||0,a=s[Rx("0xc")]||1;i[Rx("0x15")]=new Array(a)[Rx("0x44")](x).map(((t,e)=>t+e));for(const{cell:e}of o.createTableWalker(r,{startRow:x,endRow:x+a-1}))i[Rx("0x4c")][Rx("0x21")](t[Rx("0x93")][Rx("0x35")](e))}),{priority:"low"}),n[Rx("0x2d")][Rx("0x1a")]((e=>{if(e[Rx("0x33")]&&e[Rx("0x33")].startsWith("tablePaste"))return e[Rx("0x76")]?{}:{type:Rx("0x91"),content:kr(t[Rx("0xf")],Rx("0x27"))}}));const x=()=>{};for(const t of["tablePaste",Rx("0x9e"),"tablePasteRow",Rx("0x2e")])n[Rx("0x20")].registerCustomCallback("insertion",t,Rx("0x61"),x),n[Rx("0x20")].registerCustomCallback(Rx("0x36"),t,"join",x);n[Rx("0x20")][Rx("0x11")](Rx("0x48"),Rx("0x2e"),Rx("0x55"),x),n[Rx("0x20")][Rx("0x11")](Rx("0x48"),"tablePasteCell",Rx("0x23"),((e,n,o)=>{const r=e.map((t=>t[Rx("0x10")]()))[Rx("0xe")]((t=>t)),s=new Map(r[Rx("0x96")]((t=>[t,null])));if(i)for(const{element:t,attributes:e}of i[Rx("0x28")])e&&s[Rx("0x7f")](t,e);else if(o&&o[Rx("0x84")])for(const[e,n]of Object.entries(o[Rx("0x84")])){const o=t[Rx("0x93")][Rx("0x1d")].get(e),r=o?o[Rx("0xa1")]().getContainedElement():null;r&&s[Rx("0x7f")](r,n)}t.model[Rx("0x42")]((t=>{for(const[e,n]of s)t[Rx("0x9b")]({...Sx,...n},e)}))}));const a=(e,o)=>{n[Rx("0x20")][Rx("0x11")](e,Rx("0x5b"),o,((r,s,i)=>{t[Rx("0x93")][Rx("0x42")]((t=>{const x=[];for(const t of r){const e=t[Rx("0x74")][Rx("0x92")];e.is(Rx("0x56"),"tableCellSuggestion")&&x[Rx("0x21")](e)}n[Rx("0x20")].getSuggestionCallback(e,null,o)(r,s,i);for(const e of x)Rx("0x4d")!=e[Rx("0x51")][Rx("0x6b")]&&t[Rx("0x77")](e)}))}))};a(Rx("0x91"),Rx("0x23")),a("insertion",Rx("0x55")),a(Rx("0x36"),"accept"),a(Rx("0x36"),Rx("0x55")),n[Rx("0x20")][Rx("0x11")](Rx("0x91"),"tablePasteRow",Rx("0x55"),(t=>{const e=t.map((t=>t.getContainedElement())),n=e[0].findAncestor(Rx("0x97")),{minRow:s,maxRow:i}=r[Rx("0x70")](e);o[Rx("0x6e")](n,{at:s,rows:i-s+1})})),n[Rx("0x20")][Rx("0x11")](Rx("0x91"),Rx("0x9e"),Rx("0x55"),(t=>{const e=t[Rx("0x96")]((t=>t.getContainedElement())),n=e[0][Rx("0xa6")]("table"),{minColumn:s,maxColumn:i}=r[Rx("0x70")](e);o.removeColumns(n,{at:s,columns:i-s+1})}));const c=(t,e)=>{if(!e[Rx("0x33")]||!e[Rx("0x33")][Rx("0xa2")](Rx("0x5b")))return;const o=e[Rx("0x46")][Rx("0x4")],r=n[Rx("0x4e")]()[Rx("0xe")]((t=>t[Rx("0x1e")]&&t[Rx("0x46")]&&t[Rx("0x46")][Rx("0x4")]==o));r[Rx("0x73")]&&e[Rx("0x13")]()[Rx("0x73")]!=r[Rx("0x73")]&&r.reduce(((t,e)=>(t[Rx("0x67")]=e,e[Rx("0x76")]=t,e)))};function l(t,{showActiveMarker:e=!0}={}){const{id:o}=n[Rx("0x5f")](t[Rx("0x1b")]),r=["ck-suggestion-marker",Rx("0x98")],s=n[Rx("0xa3")].includes(t[Rx("0x1b")]);return s&&r[Rx("0x21")](Rx("0x47")),{classes:r,attributes:{"data-suggestion":o},priority:s&&e?3010:3e3}}n.on(Rx("0x5e"),c,{priority:"high"}),n.on(Rx("0x32"),c,{priority:Rx("0x80")}),t[Rx("0x93")][Rx("0x3")][Rx("0x68")]((()=>{let e=!1;const o=Array[Rx("0x54")](t.model[Rx("0x3")][Rx("0x8d")].getChangedMarkers());for(const{name:r,data:s}of o){const{group:o,type:i,id:x}=n[Rx("0x5f")](r);if("suggestion"!=o||Rx("0x36")!=i||s[Rx("0x43")])continue;if(!n[Rx("0x2b")](x))continue;const a=n[Rx("0x69")](x).getRanges(),c=t[Rx("0x17")].get(Rx("0x82")).me;for(const t of n[Rx("0x4e")]())if(t[Rx("0x1e")]&&t[Rx("0x2f")]==c&&Rx("0x48")==t[Rx("0x3c")]&&Rx("0x2e")==t[Rx("0x33")]&&t[Rx("0xa")]().every((t=>a[Rx("0x2")]((e=>e[Rx("0x3d")](t,!0))))))for(const n of t[Rx("0x13")]())n[Rx("0x1e")]&&(n[Rx("0x55")](),e=!0)}return e})),t[Rx("0x93")].document[Rx("0x68")]((e=>{const o=t[Rx("0x9a")][Rx("0xd")](Rx("0x59"));if(!o||!o[Rx("0x39")].has(e[Rx("0x7c")]))return!1;let r=!1;const s=t.plugins[Rx("0xd")]("Users").me,i=t[Rx("0x93")][Rx("0x3")][Rx("0x8d")].getChanges(),x=Array[Rx("0x54")](t.model[Rx("0x3")].differ[Rx("0x40")]())[Rx("0xe")]((({name:t,data:e})=>{const{group:o,subType:r,authorId:i}=n[Rx("0x5f")](t);return Rx("0x90")==o&&"tablePaste"==r&&i==s.id&&!e.oldRange}));for(const t of i){if(Rx("0x9f")!=t[Rx("0x3c")]||"tableCellSuggestion"!=t.name||1!=t[Rx("0x73")])continue;const n=e[Rx("0x5c")](t.position,t[Rx("0x5a")].getShiftedBy(1));if(!x[Rx("0x3b")]((({data:t})=>t.newRange.isEqual(n))))for(const{name:t,data:o}of x)if(n.containsRange(o[Rx("0x71")])){e[Rx("0x89")](t,{range:n}),r=!0;break}}return r})),t.model[Rx("0x3")].registerPostFixer((e=>{let o=!1;const r=t[Rx("0x17")][Rx("0xd")](Rx("0x82")).me,s=n[Rx("0x4e")]()[Rx("0xe")]((t=>t[Rx("0x1e")]&&t[Rx("0x2f")]==r)),i=new Set,x=new Set;for(const t of s)if("tablePaste"==t[Rx("0x33")])for(const e of t[Rx("0x2c")]()){const n=e[Rx("0xa1")]().getContainedElement();if(n)if(n.is(Rx("0x56"),Rx("0x14"))&&Mx(n)){t[Rx("0x0")](e.name),i.add(n),o=!0;const r=n[Rx("0x5")],s=n[Rx("0x50")],a=r&&r.is(Rx("0x56"),Rx("0x14")),c=s&&s.is(Rx("0x56"),Rx("0x14"));a&&!i[Rx("0x62")](r)&&x.add(r),c&&!i.has(s)&&x.add(s)}else n.is("element","paragraph")&&n[Rx("0x7a")]&&(t[Rx("0x0")](e[Rx("0x75")]),o=!0)}else if(Rx("0x2e")==t[Rx("0x33")]){if(!t[Rx("0x46")]||!t[Rx("0x46")][Rx("0x4")])continue;const e=t.attributes.markerAttributes;if(e&&Object[Rx("0x58")](e)[Rx("0x73")])continue;const n=t.attributes.tablePasteChainId;let r=!0,i=!0;for(const e of s)if(e.subType&&e.subType[Rx("0xa2")](Rx("0x5b"))){if(!e[Rx("0x46")][Rx("0x4")]){i=!1;break}if(e.id!=t.id&&e[Rx("0x46")].tablePasteChainId==n){r=!1;break}}i&&r&&(t[Rx("0x4f")](),o=!0)}for(const t of i)e[Rx("0x38")](t);for(const t of x)e[Rx("0x77")](t);return o})),t[Rx("0x83")][Rx("0x12")](Rx("0x57"))[Rx("0x65")]({model:Rx("0x30"),view:l,converterPriority:Rx("0x80")}),t[Rx("0x83")][Rx("0x12")](Rx("0x9d")).markerToHighlight({model:Rx("0x30"),view:(t,e)=>{if(e[Rx("0x79")][Rx("0x34")])return l(t,{showActiveMarker:!1})},converterPriority:Rx("0x80")});const u=t.editing[Rx("0x19")];this.listenTo(u[Rx("0x3")],"clipboardOutput",((t,e)=>{const n=[];for(const t of u[Rx("0x5d")](e.content)[Rx("0x6")]())t.is("element",Rx("0x64"))&&n[Rx("0x21")](t);u.change((t=>{for(const e of n)t[Rx("0x6f")](t[Rx("0x5d")](e),t[Rx("0x87")](e)),t[Rx("0x38")](e)}))}))}}function Mx(t){if(t[Rx("0x7a")])return!0;const e=t[Rx("0x16")](0);return e.is(Rx("0x56"),Rx("0x8e"))&&e[Rx("0x7a")]}function Nx(t,e={},n){for(const{isAnchor:o,cellHeight:r,cellWidth:s}of n[Rx("0x2a")](t,{includeAllSlots:!0,...e}))if(!o||1!=r||1!=s)return!1;return!0}const Lx=["ELEMENT_TITLE","registerElementLabel","removeMarker","document","differ","_splitMarkerName","from","isEqual","getNearestSelectionRange","newRange","updateMarker","isCollapsed","isTouching","TrackChangesEditing","start","createRange","registerPostFixer","schema","title-content","element","model","plugins","nodeBefore","Title","end","afterInit","editor","locale"];var Ox,Fx;Ox=Lx,Fx=125,function(t){for(;--t;)Ox.push(Ox.shift())}(++Fx);const Px=function(t,e){return Lx[t-=0]};class Dx extends t.Plugin{[Px("0xc")](){const t=this[Px("0xd")];if(!t.plugins.has(Px("0xa")))return;const e=t[Px("0x8")].get(Px("0x0"));e._descriptionFactory[Px("0x10")]("title-content",(()=>kr(t[Px("0xe")],Px("0xf")))),t[Px("0x7")][Px("0x12")][Px("0x3")]((n=>{let o=!1;const r=Array[Px("0x15")](t[Px("0x7")].document[Px("0x13")].getChangedMarkers());for(const{name:s,data:i}of r){const{group:r}=e[Px("0x14")](s);if("suggestion"!==r||!i.newRange)continue;const x=i[Px("0x18")],a=x.end[Px("0x9")];if(!a||!a.is(Px("0x6"),Px("0x5")))continue;if(!x.start[Px("0x1b")](x[Px("0xb")]))continue;const c=t[Px("0x7")][Px("0x4")][Px("0x17")](x[Px("0xb")],"forward");if(c&&c[Px("0x1a")]){const t=n[Px("0x2")](x[Px("0x1")],c[Px("0x1")]);t[Px("0x16")](x)||(n[Px("0x19")](s,{range:t}),o=!0)}o||(n[Px("0x11")](s),o=!0)}return o}))}}const jx=["TrackChangesEditing","editor","undo","has","plugins","get","enableCommand"];var Bx,Ux;Bx=jx,Ux=410,function(t){for(;--t;)Bx.push(Bx.shift())}(++Ux);const Hx=function(t,e){return jx[t-=0]};class Gx extends t.Plugin{afterInit(){const t=this[Hx("0x4")],e=t.plugins[Hx("0x1")](Hx("0x3"));t[Hx("0x0")][Hx("0x6")]("UndoEditing")&&(e[Hx("0x2")](Hx("0x5")),e[Hx("0x2")]("redo"))}}const zx=["sign","isArray","number","boolean","keys","object","charCodeAt"];var Vx,Wx;Vx=zx,Wx=221,function(t){for(;--t;)Vx.push(Vx.shift())}(++Wx);const Kx=function(t,e){return zx[t-=0]};function*qx(t){t?Kx("0x6")==typeof t?yield 1:Array[Kx("0x4")](t)?yield*function*(t){for(const e of t)yield*qx(e)}(t):Kx("0x1")==typeof t?yield*$x(t):"string"==typeof t?yield*Xx(t):Kx("0x5")==typeof t&&(yield t):yield 0}function*$x(t){if(yield Jx("{"),t){const e=Object[Kx("0x0")](t).sort();for(const n of e){yield*Xx(n),yield Jx(":");const e=t[n];yield*qx(e)}}yield Jx("}")}function*Xx(t){yield Jx('"');for(const e of t)yield Jx(e);yield Jx('"')}function Jx(t){return t[Kx("0x2")](0)}function Qx(t){return(t*=Math[Kx("0x3")](t)).toString(36)}const Yx=["_updateSuggestionData","_joinWithAdjacentSuggestions","_addSuggestionMarker","insertContent","marker-count","getAllAdjacentSuggestions","formatBlock","isSelectable","fire","registerCustomCallback","hasComments","dataReady","isNextTo","execute","addSuggestion","editing","model","_joinSuggestions","getRanges","isObject","removeClass","data","filter","change:data","isLocal","notReady","addClass","originalSuggestionId","isCollapsed","markInlineFormat","getCustomProperty","skipNestingCheck","forceDefaultExecution","normal","stop","fetchCommentThread","detach","isInContent","elementToElement","isUndo","markDeletion","collaboration.channelId","_suggestionState","set","getWalker","toViewElement","splitPosition","newRange","containsRangeInObject","_createSuggestion","createPositionAt","listenTo","_setSuggestionRange","map","updateMarker","targetPosition","markBlockFormat","every","_defaultCallbacks","clear","deletion:discard","join","createdAt","_rangeIsInLocalUserInsertion","elementStart","suggestion:","isBefore","markers","getShiftedBy","createRangeIn","fromCharCode","ck-suggestion-marker","getUser","getSuggestion","some","getMultiRangeId","getSuggestionCallback","acceptSuggestion","commentThread","$graveyard","_suggestions","getNearestSelectionRange","add","schema","push","includes","track-changes-suggestion-data-mismatch","differ","return","pluginName","formatInline","reconvertMarker","formatBlock:chain","isInsideObject","markerReady","locale","removeAttribute","rootName","rejected","getAttribute","containsPosition","consumable","setSelection","values","_enabledCommands","formatInline:","elementEnd","containerElement","multi","formatBlock:","end","getFirstRange","createPositionBefore","config","formatInline:discard","removeComment","getIntersection","parent","deletion:join","track-changes-suggestion-not-found","suggestion","addHighlight","PENDING_ACTION_SUGGESTION","markMultiRangeInsertion","getFirstMarker","value","_registerDefaultCallbacks","insertion:accept","suggestionUnloaded","before","discard","for","remove","discardAllSuggestions","addMarkerName","selection","containsRange","isBlock","consume","_getSuggestionData","formatInline:join","requires","change:activeMarkers","nodeAfter","_model","plugins","conversion","size","_refreshSuggestionsChain","_editor","getAncestors","accept","getCommentThread","trackChanges","deletion","removeMarker","accepted","isIntersectingWithRange","element","CommentsRepository","createSelection","after","has","_cutOutSuggestionMarker","buildSuggestion","next","createPositionAfter","attributes","writer","low","isAfter","splice","item","addSuggestionData","addMarker:suggestion","hasSuggestion","insertion","ck-suggestion-marker-","deleteContent","insertion:","addMarker:suggestion:formatBlock","change:_saved","start","clone","suggestionChanged","_findSuggestions","fromRange","get","getChanges","textProxy","PendingActions","discardSelectedSuggestions","name","getSuggestions","then","getRange","type","lowest","commands","resolve","mapper","removeMarkers","Users","commandName","_setSuggestionData","_adapter","$marker","getDifference","range","insertion:chain","high","track-changes-adapter-already-set","rethrowUnexpectedError","chain","enableCommand","head","track-changes-command-not-found","unbind","suggestionLoaded","_customCallbacks","editingDowncast","howMany","TrackChangesEditing","isLimit","document","batch","insert","multipleBlocks","formatGroupId","deletion:accept","author","addMarker","length","isEqual","trackChangesCommand","_isForcedDefaultExecutionBlock","isDocumentOperation","_removeSuggestion","previous","track-changes-user-not-found","ready","nodeBefore","removed","markMultiRangeDeletion","_addThreadToSuggestion","formatBlock:join","root","addComment","position","removeMarker:suggestion:formatBlock","getItems","acceptSelectedSuggestions","upcast","markerToData","track-changes-adapter-missing-getsuggestion","_suggestionFactory","deletion:","_saved","adapter","init","enableReadOnlyMode","sort","markInsertion","subType","bindElementToMarker","activeMarkers","open","_checkSuggestionCorrectness","registerPostFixer","options","split","_commentsRepository","_breakSuggestionMarker","ck-suggestion-marker--active","createRange","isMultiRange","acceptAllSuggestions","markerToHighlight","updateSuggestion","addRange","markerName","isOwn","showSuggestionHighlights","getChangedMarkers","dataDowncast","from","oldRange","moveTargetPosition","backward","_handleNewSuggestionMarker","editor","change","isAtEnd","getLastMatchingPosition","deletion:chain","dataToMarker","formatBlock:discard","toJSON","_splitMarkerName"];var Zx,ta;Zx=Yx,ta=200,function(t){for(;--t;)Zx.push(Zx.shift())}(++ta);const ea=function(t,e){return Yx[t-=0]};class na extends t.Plugin{static get[ea("0xf0")](){return[ea("0x102"),s.Users,t.PendingActions,Or,qr,Yr,is,us,ps,Cs,Ss,Os,Us,Ws,Js,ei,ii,ui,hi,Ci,Ii,Li,ji,Vi,Ji,ex,xx,dx,bx,Cx,wx,Dx,Gx]}static get[ea("0xbc")](){return ea("0x16")}constructor(t){function e(t){return t[ea("0x98")]((t=>String[ea("0xa9")](t)))[ea("0xa0")]("")}super(t),this.set(ea("0x41"),[]),this.on(ea("0xf1"),((e,n,o,r)=>{this[ea("0xf3")].change((()=>{for(const e of[...r,...o])this[ea("0xf3")][ea("0xa6")][ea("0x105")](e)&&t[ea("0x72")][ea("0xbe")](e)}))})),this._descriptionFactory=new Sr(this[ea("0x5a")].model[ea("0xb6")],this[ea("0x5a")][ea("0xc2")]),this._adapter=null,this[ea("0x37")]=new oa(this.editor),this[ea("0xb3")]=new Map,this._commentsRepository=t[ea("0xf4")][ea("0x11e")](ea("0x102")),this[ea("0xcb")]=new Set,this[ea("0xf3")]=this[ea("0x5a")].model,this[ea("0x8d")]=new WeakMap,this[ea("0x23")]=!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,48,53,48])}[ea("0x3b")](){const t=this[ea("0x5a")];t.conversion.for(ea("0x14"))[ea("0x4d")]({model:ea("0xdb"),view:t=>{const{id:e,type:n}=this[ea("0x62")](t[ea("0x50")]),o=[ea("0xaa"),ea("0x114")+n];let r=3e3;return this.activeMarkers.includes(t.markerName)&&(o[ea("0xb7")]("ck-suggestion-marker--active"),r=3010),"deletion"==n&&(r+=5),{classes:o,attributes:{"data-suggestion":e},priority:r}}}),t[ea("0xf5")].for("dataDowncast").add((e=>{e.on(ea("0x111"),((e,n,o)=>{if(!o.options[ea("0x52")])return;const r=n[ea("0x10f")];if(!r)return;const s=o.mapper[ea("0x90")](r);t[ea("0x73")][ea("0xb6")][ea("0x76")](r)&&s&&!s.getCustomProperty("widget")&&s.is(ea("0xce"))&&(0,P.toWidget)(s,o.writer)}),{priority:ea("0xa")})})),t[ea("0xf5")].for(ea("0x54"))[ea("0x4d")]({model:ea("0xdb"),view:(t,e)=>{if(!e[ea("0x45")][ea("0x52")])return null;const{type:n}=this[ea("0x62")](t[ea("0x50")]);return{classes:["ck-suggestion-marker",ea("0x114")+n],priority:3e3}}});const n=({showActiveMarkers:e=!0}={})=>(n,o,r)=>{if(!o[ea("0x10f")])return;if(o.item.is(ea("0xea")))return void r[ea("0xc8")][ea("0xed")](o[ea("0x10f")],n[ea("0x123")]);const s=r[ea("0x0")][ea("0x90")](o.item);if(!o.item.is(ea("0x101"))||!t[ea("0x73")][ea("0xb6")][ea("0xec")](o[ea("0x10f")])||s[ea("0x81")](ea("0xdc")))return;const{id:i}=this._splitMarkerName(o[ea("0x50")]);r.writer[ea("0x7d")]([ea("0xaa"),"ck-suggestion-marker-formatBlock"],s),r.writer.setAttribute("data-suggestion",i,s),r.mapper[ea("0x40")](s,o[ea("0x50")]),e&&(this.activeMarkers.includes(o.markerName)?r[ea("0x10b")].addClass("ck-suggestion-marker--active",s):r[ea("0x10b")].removeClass(ea("0x49"),s));for(const e of t.model[ea("0xa8")](o[ea("0x10f")])[ea("0x32")]())r[ea("0xc8")][ea("0xed")](e,n[ea("0x123")]);r.consumable.consume(o[ea("0x10f")],n[ea("0x123")])};t[ea("0xf5")][ea("0xe6")]("dataDowncast").add((t=>{t.on(ea("0x117"),((t,e,o)=>{o[ea("0x45")].showSuggestionHighlights&&n({showActiveMarkers:!1})(t,e,o)}),{priority:"highest"})})),t.conversion[ea("0xe6")](ea("0x54"))[ea("0x35")]({model:"suggestion",view:(t,e)=>e[ea("0x45")][ea("0x52")]?null:{group:ea("0xdb"),name:t.substr("suggestion"[ea("0x20")]+1)}}),t[ea("0xf5")][ea("0xe6")](ea("0x34"))[ea("0x89")]({view:{name:ea("0xdb"),attribute:{id:/^\w/,suggestionType:/^\w/}},model:(t,{writer:e})=>{let n=ea("0xa4")+t[ea("0xc6")]("suggestion-type")+":"+t.getAttribute("id");return t[ea("0xc6")]("marker-count")&&(n+=":"+t.getAttribute(ea("0x67"))),e.createElement(ea("0x6"),{"data-name":n})}}),t[ea("0xf5")][ea("0xe6")]("upcast")[ea("0x5f")]({view:ea("0xdb")}),t[ea("0xf5")][ea("0xe6")](ea("0x14")).add((t=>{t.on(ea("0x117"),n(),{priority:ea("0xa")})})),t[ea("0xf5")].for(ea("0x14"))[ea("0xb5")]((t=>{t.on(ea("0x31"),((t,e,n)=>{const o=n.mapper.markerNameToElements(e.markerName);if(o)for(const t of o)t[ea("0x81")](ea("0xdc"))||(n[ea("0x10b")][ea("0x77")](["ck-suggestion-marker","ck-suggestion-marker-formatBlock",ea("0x49")],t),n[ea("0x10b")][ea("0xc3")]("data-suggestion",t),n[ea("0x0")].unbindElementFromMarkerName(t,e[ea("0x50")]))}),{priority:ea("0xa")})})),t.model.document[ea("0x44")]((e=>{let n=!1;const o=Array.from(t[ea("0x73")][ea("0x18")][ea("0xba")][ea("0x53")]());for(const{name:i,data:x}of o){const{group:o,type:a,id:c}=this[ea("0x62")](i);if(ea("0xdb")!==o)continue;const l=this[ea("0xb3")][ea("0x11e")](c);if(null!=x[ea("0x92")])if(ea("0xbd")==a&&(n=n||ia(x.newRange,i,e,t[ea("0x73")][ea("0xb6")])),x[ea("0x92")][ea("0x7f")]||ea("0xb2")==x[ea("0x92")][ea("0x2e")][ea("0xc4")]||ea("0x69")==a&&!aa(x.newRange)||ea("0xfd")==a&&(sa(s=x[ea("0x92")])||(r=s)[ea("0x119")].parent==r[ea("0xd1")][ea("0x29")]&&r[ea("0x119")][ea("0x5c")]))e.removeMarker(i),n=!0;else{if(!l||!l[ea("0x88")])continue;n=!!this._joinWithAdjacentSuggestions(l)||n}}var r,s;return n})),t[ea("0x73")][ea("0x18")][ea("0x44")]((e=>{let n=!1;for(const o of t[ea("0x73")][ea("0x18")].differ[ea("0x11f")]()){if(ea("0x1a")!=o[ea("0x127")])continue;const r=o[ea("0x30")].getShiftedBy(o[ea("0x20")]);if(r[ea("0x5c")])for(const s of this[ea("0xb3")][ea("0xca")]()){if(s[ea("0x4b")]||!s[ea("0x88")])continue;if("formatBlock"!=s.type)continue;const i=s[ea("0xd2")]();if(i.start[ea("0xd8")]!=i[ea("0xd1")][ea("0xd8")]&&i[ea("0xd1")][ea("0x21")](o[ea("0x30")])){const o=t[ea("0x73")].createRange(i[ea("0x119")],r);e[ea("0x99")](s[ea("0xdf")](),{range:o}),n=!0}}}return n})),t[ea("0x73")][ea("0xa6")].on("update:suggestion",((t,e,n)=>{if(null==n){const{id:t}=this._splitMarkerName(e[ea("0x123")]),n=this._suggestions[ea("0x11e")](t);n&&n[ea("0xe9")](e.name)}})),t.model[ea("0x18")].on(ea("0x7a"),(()=>{const e=Array[ea("0x55")](t[ea("0x73")][ea("0x18")][ea("0xba")][ea("0x53")]());e[ea("0x3d")](((t,e)=>{const n=t[ea("0x78")].oldRange,o=e[ea("0x78")][ea("0x56")];return null===n&&null===o?0:null===n&&null!==o?-1:null!==n&&null===o?1:n[ea("0x119")].isBefore(o[ea("0x119")])?-1:1}));const n=new Set;for(const{name:t,data:o}of e){const{group:e,id:r}=this[ea("0x62")](t);if(ea("0xdb")===e&&(null===o[ea("0x56")]&&this[ea("0x59")](t),null===o[ea("0x92")])){const t=this[ea("0xb3")][ea("0x11e")](r);t.isInContent?n[ea("0xb5")](t):this[ea("0x25")](t)}}for(const{name:t,data:o}of e){const{group:e,id:r}=this[ea("0x62")](t);if(ea("0xdb")!==e)continue;const s=this[ea("0xb3")][ea("0x11e")](r);null!=o[ea("0x92")]&&null!=o[ea("0x56")]&&(this[ea("0xf7")](s),n[ea("0xb5")](s[ea("0xf")]))}for(const t of n)this[ea("0x6b")](ea("0x11b"),t);n[ea("0x9e")]()})),t[ea("0x73")].on("applyOperation",((e,n)=>{const o=n[0];if(!this._suggestions[ea("0xf6")])return;if(!o[ea("0x24")])return;if(o[ea("0x19")][ea("0x8a")]||!o[ea("0x19")][ea("0x7b")])return;let r,s;switch(o[ea("0x127")]){case ea("0x1a"):r=t.model[ea("0x95")](o[ea("0x30")]),s=r[ea("0xa7")](o[ea("0x15")]);break;case"split":r=t.model[ea("0x95")](o[ea("0x91")]),s=t[ea("0x73")][ea("0x95")](o[ea("0x57")]);break;case"move":r=t[ea("0x73")].createPositionAt(o[ea("0x9a")]),s=r[ea("0xa7")](o[ea("0x15")]);break;default:return}const i=t[ea("0x73")][ea("0x4a")](r,s);t.model[ea("0x5b")]((()=>{for(const{suggestion:t,meta:e}of this[ea("0x11c")](i)){if(t[ea("0x4b")])continue;if(ea("0xbd")==t[ea("0x127")])continue;const n=t.data&&t[ea("0x78")][ea("0x1b")];(ea("0x69")!=t[ea("0x127")]||"split"==o[ea("0x127")]&&!n)&&(e[ea("0x93")]||ea("0x113")==t.type&&e[ea("0x51")]||t[ea("0xd2")]()[ea("0xeb")](i)&&this[ea("0x48")](t,r,s))}}))}),{priority:ea("0x128")}),t[ea("0x73")].on(ea("0x115"),((e,n)=>{const o=n[0],r=n[1];if(r&&r[ea("0x83")])return;if(this[ea("0x23")])return;if(!this[ea("0x22")][ea("0xe0")])return;if(o[ea("0x7f")])return;const s=t[ea("0x73")][ea("0xb6")],{start:i,end:x}=o[ea("0xd2")](),a=i[ea("0xf2")]&&s[ea("0x76")](i[ea("0xf2")])?null:s[ea("0xb4")](i,"forward"),c=x[ea("0x29")]&&s.isObject(x[ea("0x29")])?null:s[ea("0xb4")](x,ea("0x58")),l=t[ea("0x73")][ea("0x4a")](a?a.start:i,c?c[ea("0xd1")]:x);t[ea("0x73")][ea("0x5b")]((e=>{this[ea("0x8b")](l);const n=t[ea("0x73")][ea("0xb6")].getNearestSelectionRange(l[ea("0x119")]);o.is("documentSelection")?e.setSelection(n):o.setTo(n)})),e.stop()}),{priority:e.priorities[ea("0x84")]+10}),t[ea("0x73")].on(ea("0x66"),((e,n)=>{const o=n[n.length-1];o&&o[ea("0x83")]||this._isForcedDefaultExecutionBlock||this[ea("0x22")][ea("0xe0")]&&(t.model[ea("0x5b")]((()=>{let o=t[ea("0x73")][ea("0x66")](n[0],n[1],n[2],n[3],{forceDefaultExecution:!0});if(!o)return;e[ea("0xbb")]=o[ea("0x11a")]();const r=o[ea("0xd1")].nodeBefore,s=t[ea("0x73")].schema;r&&s.isBlock(r)&&!s[ea("0x76")](r)&&(o=t[ea("0x73")].createRange(o[ea("0x119")],t[ea("0x73")].createPositionAt(r,"end"))),this[ea("0x3e")](o)})),e[ea("0x85")]())}),{priority:ea("0xa")}),this[ea("0x22")]=new H(t,this[ea("0xcb")]),this[ea("0x5a")].commands.add("trackChanges",this[ea("0x22")]),this[ea("0xe")](ea("0xfc"));const o=new K(t,this[ea("0xb3")]);t.commands[ea("0xb5")](ea("0xb0"),o),this[ea("0xe")](ea("0xb0"));const r=new Q(t,this[ea("0xb3")]);t[ea("0x129")][ea("0xb5")]("discardSuggestion",r),this[ea("0xe")]("discardSuggestion"),t[ea("0x129")][ea("0xb5")]("acceptAllSuggestions",new xt(t,o,this._suggestions)),this.enableCommand(ea("0x4c")),t[ea("0x129")].add(ea("0xe8"),new Tt(t,r,this[ea("0xb3")])),this.enableCommand(ea("0xe8")),t[ea("0x129")][ea("0xb5")](ea("0x33"),new pt(t,o,this._suggestions)),this[ea("0xe")]("acceptSelectedSuggestions"),t[ea("0x129")][ea("0xb5")](ea("0x122"),new Rt(t,r,this[ea("0xb3")])),this[ea("0xe")](ea("0x122"));const s=t[ea("0xf4")][ea("0x11e")]("CommentsRepository");this[ea("0x96")](s,ea("0x2f"),((t,{threadId:e})=>{const n=this._suggestions[ea("0x11e")](e);n&&n[ea("0xb1")]&&1===n[ea("0xb1")][ea("0x20")]&&this._updateSuggestionData(e,{hasComments:!0})}),{priority:ea("0x10c")}),this[ea("0x96")](s,ea("0xd6"),((t,{threadId:e})=>{const n=this[ea("0xb3")][ea("0x11e")](e);n&&n[ea("0xb1")]&&!n[ea("0xb1")].length&&this[ea("0x63")](e,{hasComments:!1})}),{priority:ea("0x10c")})}set[ea("0x3a")](t){if(this._adapter)throw new e.CKEditorError(ea("0xb"),this);this[ea("0x5")]=t}get[ea("0x3a")](){return this._adapter}getSuggestions({skipNotAttached:t=!1,toJSON:e=!1}={}){const n=[];for(const e of this[ea("0xb3")][ea("0xca")]())t&&!e[ea("0x88")]||n.push(e);return e?n[ea("0x98")]((t=>t[ea("0x61")]())):n}[ea("0xac")](t){const n=this[ea("0xb3")].get(t);if(!n)throw new e.CKEditorError(ea("0xda"),this);return n}[ea("0x112")](t){return this._suggestions.has(t)}[ea("0x110")](t){const{id:e,authorId:n}=t,[o,r]=t[ea("0x127")][ea("0x46")](":"),s=this[ea("0xb3")][ea("0x11e")](e)||this[ea("0x94")](o,r,e,n);switch(this[ea("0x2c")](s),this._checkSuggestionCorrectness(s,o,r||null,n),s[ea("0xa1")]=t[ea("0xa1")],t.data&&(s.data=t[ea("0x78")]),t.attributes&&(s.attributes=t[ea("0x10a")]),this._adapter&&this[ea("0x5")].addSuggestion||(s[ea("0x39")]=!0),this[ea("0x8d")][ea("0x11e")](s)){case ea("0x7c"):this._suggestionState[ea("0x8e")](s,ea("0x6e"));break;case ea("0xc1"):s.isInContent?(this[ea("0x8d")].set(s,ea("0x28")),this[ea("0x6b")](ea("0x12"),s)):this[ea("0x8d")][ea("0x8e")](s,"removed")}return s}[ea("0xb0")](t){this[ea("0x83")]((()=>{this[ea("0x5a")].model.change((()=>{for(const e of t.getAllAdjacentSuggestions())e[ea("0xfa")]()}))}))}discardSuggestion(t){this.forceDefaultExecution((()=>{this[ea("0x5a")].model[ea("0x5b")]((()=>{for(const e of t[ea("0x68")]())e.discard()}))}))}[ea("0xe")](t,n){const o=this[ea("0x5a")][ea("0x129")][ea("0x11e")](t);if(!o)throw new e.CKEditorError(ea("0x10"),this,{commandName:t});this[ea("0xcb")].add(o),n&&o.on(ea("0x70"),((t,e)=>{this.trackChangesCommand[ea("0xe0")]&&(this[ea("0x23")]||e[ea("0x20")]>0&&e[e[ea("0x20")]-1]&&e[e.length-1][ea("0x83")]||(n(((...t)=>o[ea("0x70")](...t,{forceDefaultExecution:!0})),...e),t[ea("0x85")]()))}),{priority:ea("0xa")})}forceDefaultExecution(t){let n,o;const r=this[ea("0x23")];this._isForcedDefaultExecutionBlock=!0;try{n=t()}catch(t){o=t}return r||(this[ea("0x23")]=!1),o&&e.CKEditorError[ea("0xc")](o,this),n}[ea("0x3e")](t,n=null,o={}){if(t[ea("0x7f")])return null;const r=this[ea("0x5a")][ea("0xf4")][ea("0x11e")](ea("0x2")).me;for(const{suggestion:e,meta:o}of this[ea("0x11c")](t,ea("0x113")))if(o[ea("0x51")]){if(!o[ea("0x6f")])return e;if(n==e.subType){const n=e[ea("0xd2")]();return n[ea("0x119")][ea("0x21")](t[ea("0xd1")])?this[ea("0x97")](e,this[ea("0xf3")][ea("0x4a")](t[ea("0x119")],n[ea("0xd1")])):this[ea("0x97")](e,this[ea("0xf3")].createRange(n[ea("0x119")],t[ea("0xd1")])),e}}const s=(0,e.uid)(),i=r.id,x=n?ea("0x116")+n:ea("0x113"),a=this[ea("0x4")]({id:s,type:x,createdAt:new Date,authorId:i,attributes:o});return this[ea("0x65")](x,s,i,t),a}[ea("0xde")](t,n=ea("0xcf"),o={}){const r=this[ea("0x5a")][ea("0xf4")].get(ea("0x2")).me,s=this._suggestionFactory[ea("0xaf")](ea("0x113"),n,ea("0xa0"));for(const e of this[ea("0x124")]())if(e[ea("0x1e")].id==r.id&&ea("0x113")==e.type&&e[ea("0x3f")]==n&&(s(e[ea("0x75")](),t)||s(t,e[ea("0x75")]()))){for(const n of t)e[ea("0x4f")](n);return e}for(const e of t)for(const{suggestion:n,meta:o}of this._findSuggestions(e,ea("0x113"))){if(!o[ea("0x51")])continue;let e=!0;for(const o of n[ea("0x75")]())for(const n of t)if(!o[ea("0xeb")](n)){e=!1;break}if(e)return n}const i=(0,e.uid)(),x=r.id,a=ea("0x116")+n,c=this[ea("0x4")]({id:i,type:a,createdAt:new Date,authorId:x,attributes:o});for(const e of t)this[ea("0x65")](a,i,x,e,Cr[ea("0xae")]());return c}[ea("0x80")](t,n,o=null,r={}){if(o=o||xa(n),t[ea("0x7f")])return;const s=this[ea("0x5a")][ea("0xf4")][ea("0x11e")](ea("0x2")).me,i=[];for(const{suggestion:e,meta:n}of this[ea("0x11c")](t,ea("0x113")))n[ea("0x51")]&&!n.isInsideObject&&i.push(...e[ea("0x75")]());const x=function(t,e){const n=[];for(const o of e){const e=t[ea("0xd7")](o);e&&n[ea("0xb7")](e)}return n}(t,i),a=function(t,e){const n=[t];for(const t of e){let e=0;for(;e<n[ea("0x20")];){const o=n[e].getDifference(t);n[ea("0x10e")](e,1,...o),e+=o[ea("0x20")]}}return n}(t,i);x[ea("0x20")]&&this[ea("0xf3")][ea("0x5b")]((()=>{for(const t of x){const e=this._suggestionFactory[ea("0xaf")](ea("0xbd"),o,ea("0xfa"));this.forceDefaultExecution((()=>e([t],n,r)))}}));for(const t of a){let i=null,x=t[ea("0x119")],a=t.end;for(const{suggestion:e,meta:n}of this[ea("0x11c")](t,ea("0xbd"))){if(!n[ea("0x51")])continue;if(e[ea("0x3f")]!=o)continue;const r=e[ea("0xd2")]();if(r[ea("0xeb")](t,!0))return;x=x[ea("0xa5")](r[ea("0x119")])?x:r[ea("0x119")],a=a[ea("0x10d")](r[ea("0xd1")])?a:r[ea("0xd1")],i?r.start.isBefore(i[ea("0xd2")]().start)?(i[ea("0x1")](),i=e):e[ea("0x1")]():i=e}const c=this[ea("0xf3")][ea("0x4a")](x,a);if(i)this[ea("0x97")](i,c);else{const t=(0,e.uid)(),i=s.id;this._setSuggestionData({id:t,type:"formatInline:"+o,data:n,createdAt:new Date,authorId:i,attributes:r}),this._addSuggestionMarker(ea("0xcc")+o,t,i,c)}}}[ea("0x9b")](t,n,o=[],r=null,s={}){n[ea("0x1c")]||(n.formatGroupId=n[ea("0x3")]),n[ea("0x1b")]=t.is(ea("0x8")),r=r||xa(n);const i=o[ea("0x98")]((t=>ca(t,this[ea("0xf3")]))),x=t.is(ea("0x8"))?t:ca(t,this[ea("0xf3")]);i.push(x);let a=!0;for(const t of i)if(!this[ea("0xa2")](t)){a=!1;break}if(a){const t=this[ea("0x37")][ea("0xaf")](ea("0x69"),r,ea("0xfa"));return void this[ea("0x83")]((()=>t([x],n,s)))}let c=null,l=x[ea("0x119")],u=x[ea("0xd1")];for(const{suggestion:t,meta:e}of this[ea("0x11c")](x,ea("0x69"))){if(!e[ea("0x51")]||e[ea("0x6f")]||e[ea("0x93")]||e[ea("0xc0")])continue;if(t[ea("0x78")].formatGroupId!=n.formatGroupId)continue;const o=t[ea("0xd2")]();if(t[ea("0x3f")]==r){if(o[ea("0xeb")](x,!0))return;l=l.isBefore(o.start)?l:o[ea("0x119")],u=u[ea("0x10d")](o[ea("0xd1")])?u:o[ea("0xd1")],c?o[ea("0x119")][ea("0xa5")](c[ea("0xd2")]()[ea("0x119")])?(c.removeMarkers(),c=t):t.removeMarkers():c=t}else{const e=x[ea("0xd7")](o);this._cutOutSuggestionMarker(t,e)}}const d=this[ea("0x5a")][ea("0xf4")][ea("0x11e")](ea("0x2")).me,g=(0,e.uid)(),f=d.id;c?this._setSuggestionRange(c,this[ea("0xf3")][ea("0x4a")](l,u)):(this[ea("0x4")]({id:g,type:ea("0xd0")+r,data:n,createdAt:new Date,authorId:f,attributes:s}),this._addSuggestionMarker(ea("0xd0")+r,g,f,this._model[ea("0x4a")](l,u)))}markMultiRangeBlockFormat(t,n,o=[],r=null,s={}){n[ea("0x1c")]||(n.formatGroupId=n[ea("0x3")]),n[ea("0x1b")]=!1,r=r||xa(n);const i=o[ea("0x98")]((t=>ca(t,this[ea("0xf3")]))),x=t.map((t=>ca(t,this._model)));i[ea("0xb7")](...x);let a=!0;for(const t of i)if(!this._rangeIsInLocalUserInsertion(t)){a=!1;break}if(a){const t=this[ea("0x37")][ea("0xaf")](ea("0x69"),r,ea("0xfa"));return void this[ea("0x83")]((()=>t(x,n,s)))}const c=this[ea("0x5a")][ea("0xf4")][ea("0x11e")]("Users").me;for(const t of this[ea("0x124")]()){if(t[ea("0x1e")].id!=c.id)continue;if(ea("0x69")!=t[ea("0x127")]||t[ea("0x78")].formatGroupId!=n[ea("0x1c")])continue;const e=t.subType==r;for(let n=0;n<x[ea("0x20")];n++){const o=x[n];for(const r of t.getMarkers()){const s=r[ea("0x126")]();if(o[ea("0x21")](s)){e?(x[ea("0x10e")](n,1),n--):t[ea("0xfe")](r[ea("0x123")]);break}}}}if(0==x[ea("0x20")])return;const l=this[ea("0x37")][ea("0xaf")]("formatBlock",r,ea("0xa0"));for(const t of this.getSuggestions())if(t[ea("0x1e")].id==c.id&&ea("0x69")==t[ea("0x127")]&&t.data[ea("0x1c")]==n[ea("0x1c")]&&t[ea("0x3f")]==r&&(l(t.getRanges(),x)||l(x,t[ea("0x75")]()))){for(const e of x)t[ea("0x4f")](e);return t}const u=(0,e.uid)(),d=c.id,g=ea("0xd0")+r,f=this[ea("0x4")]({id:u,type:g,data:n,createdAt:new Date,authorId:d,attributes:s});for(const t of x)this._addSuggestionMarker(g,u,d,t,Cr[ea("0xae")]());return f}[ea("0x8b")](t,n=null,o={}){if(t[ea("0x7f")])return null;const r=this[ea("0x5a")][ea("0xf4")][ea("0x11e")](ea("0x2")).me,s=new F.LiveRange(t[ea("0x119")],t[ea("0xd1")]);for(const{suggestion:t,meta:e}of this[ea("0x11c")](s,ea("0x113")))if(e[ea("0x51")]&&!e[ea("0x6f")])if(t[ea("0x4b")]){const e=t[ea("0x75")]()[ea("0x79")]((t=>ea("0xb2")!=t[ea("0x2e")].rootName));if(e[ea("0x9c")]((t=>s[ea("0xeb")](t,!0)))&&t[ea("0xe5")](),e[ea("0xad")]((t=>t[ea("0xeb")](s,!0)))){const t=this._suggestionFactory.getSuggestionCallback("deletion",n,ea("0xfa"));return this[ea("0x83")]((()=>t([s],null,o))),null}}else{const e=s[ea("0xd7")](t[ea("0xd2")]());t._onDiscard([e],null,o)}if(s[ea("0x87")](),s[ea("0x7f")]||ea("0xb2")==s[ea("0x2e")].rootName)return null;let i=null,x=s[ea("0x119")],a=s[ea("0xd1")];for(const{suggestion:t,meta:e}of this[ea("0x11c")](s,ea("0xfd")))if(e[ea("0x51")])if(t[ea("0x4b")]){let e=!0;for(const n of t[ea("0x75")]()){if(n.containsRange(s,!0))return t;s[ea("0xeb")](n)||(e=!1)}e&&t[ea("0xe5")]()}else{const e=t.getFirstRange();if(e[ea("0xeb")](s,!0))return t;x=x[ea("0xa5")](e.start)?x:e.start,a=a[ea("0x10d")](e.end)?a:e[ea("0xd1")],i?e[ea("0x119")][ea("0xa5")](i[ea("0xd2")]()[ea("0x119")])?(i[ea("0x1")](),i=t):t[ea("0x1")]():i=t}if(i)return this[ea("0x97")](i,this[ea("0xf3")][ea("0x4a")](x,a)),i;{const t=(0,e.uid)(),s=this[ea("0xf3")][ea("0x4a")](x,a),i=r.id,c=n?ea("0x38")+n:ea("0xfd"),l=this._setSuggestionData({id:t,type:c,createdAt:new Date,authorId:i,attributes:o});return this[ea("0x65")](c,t,i,s),l}}[ea("0x2b")](t,n=ea("0xcf"),o={}){const r=this[ea("0x5a")][ea("0xf4")].get("Users").me,s=t[ea("0x98")]((t=>new F.LiveRange(t[ea("0x119")],t[ea("0xd1")]))),i=new Set;for(const t of s)for(const{suggestion:e,meta:n}of this[ea("0x11c")](t,ea("0x113")))n[ea("0x51")]&&!n.isNextTo&&i[ea("0xb5")](e);for(const e of i)if(e[ea("0x4b")]){const r=e[ea("0x75")]();if((!e[ea("0x10a")]||!e[ea("0x10a")][ea("0x82")])&&r.every((t=>s[ea("0xad")]((e=>e[ea("0xeb")](t,!0)))))&&e.discard(),s.every((t=>r.some((e=>e[ea("0xeb")](t,!0)))))){const e=this[ea("0x37")].getSuggestionCallback(ea("0xfd"),n,ea("0xfa"));return this[ea("0x83")]((()=>e(t,null,o))),null}}else{const t=e[ea("0xd2")]();if(s.some((e=>e[ea("0xeb")](t,!0)))&&e[ea("0xe5")](),s.every((e=>t[ea("0xeb")](e,!0)))){const t=this[ea("0x37")].getSuggestionCallback("deletion",n,ea("0xfa"));return this[ea("0x83")]((()=>t(s,null,o))),null}}const x=this[ea("0x37")][ea("0xaf")](ea("0xfd"),n,ea("0xa0"));let a=null;for(const t of this[ea("0x124")]())if(t.author.id==r.id&&t.isInContent&&ea("0xfd")==t[ea("0x127")]&&t.subType==n&&(x(t[ea("0x75")](),s)||x(s,t[ea("0x75")]())))if(a){if(t.commentThread&&t[ea("0xb1")][ea("0x20")])continue;for(const e of t[ea("0x75")]())a[ea("0x100")](e)||a[ea("0x4f")](e);t.removeMarkers()}else{a=t;for(const e of s)t[ea("0x100")](e)||t[ea("0x4f")](e)}if(a)return a;i[ea("0x9e")]();for(const t of s)for(const{suggestion:e,meta:n}of this._findSuggestions(t,ea("0xfd")))n.isOwn&&i[ea("0xb5")](e);for(const t of i){const e=t[ea("0x75")]();if((!o||!o[ea("0x82")])&&s[ea("0x9c")]((t=>e[ea("0xad")]((e=>e[ea("0xeb")](t,!0))))))return t;(!t[ea("0x10a")]||!t[ea("0x10a")][ea("0x82")])&&e[ea("0x9c")]((t=>s[ea("0xad")]((e=>e[ea("0xeb")](t,!0)))))&&t[ea("0xe5")]()}const c=(0,e.uid)(),l=r.id,u=ea("0x38")+n,d=this[ea("0x4")]({id:c,type:u,createdAt:new Date,authorId:l,attributes:o});for(const t of s)t[ea("0x87")](),t[ea("0x7f")]||ea("0xb2")==t[ea("0x2e")][ea("0xc4")]||this[ea("0x65")](u,c,l,t,Cr[ea("0xae")]());return d}[ea("0x97")](t,e){const n=t.getFirstMarker();this[ea("0xf3")][ea("0x5b")]((t=>{t[ea("0x99")](n,{range:e})}))}[ea("0x2c")](t){const e=t.id,n=this[ea("0x5a")][ea("0xd4")][ea("0x11e")]("collaboration.channelId");this._commentsRepository.hasCommentThread(e)||this[ea("0x47")].addCommentThread({channelId:n,threadId:e});const o=this._commentsRepository[ea("0xfb")](e);o[ea("0x11")]("isRemovable"),o.isRemovable=!1,t[ea("0xb1")]=o}_checkSuggestionCorrectness(t,n,o,r){if(t[ea("0x127")]!=n||t.subType!=o||t[ea("0x1e")].id!=r)throw this[ea("0x5a")][ea("0x3c")](ea("0xb9")),new e.CKEditorError("track-changes-suggestion-data-mismatch",this)}[ea("0x106")](t,n){const o=t.getFirstRange();if(n.isEqual(o))t[ea("0x1")]();else if(o[ea("0xeb")](n)){const r=this[ea("0xf3")][ea("0x95")](n[ea("0x119")][ea("0x29")],ea("0xd1"));this[ea("0x97")](t,this[ea("0xf3")].createRange(o[ea("0x119")],r));const s=(0,e.uid)(),i=t[ea("0x1e")].id,x=t[ea("0x127")]+":"+t[ea("0x3f")];this._setSuggestionData({id:s,type:x,createdAt:new Date,authorId:i,data:t[ea("0x78")],attributes:t[ea("0x10a")]});const a=this[ea("0xf3")].createPositionAt(n.end.parent,ea("0x104")),c=this[ea("0xf3")].createRange(a,o[ea("0xd1")]);this[ea("0x65")](x,s,i,c)}else if(o[ea("0xc7")](n[ea("0x119")])){const e=this[ea("0xf3")].createPositionAt(n[ea("0x119")][ea("0x29")],ea("0xd1"));this[ea("0x97")](t,this._model[ea("0x4a")](o[ea("0x119")],e))}else{const e=this._model[ea("0x95")](n[ea("0xd1")][ea("0xd8")],ea("0x104"));this[ea("0x97")](t,this._model.createRange(e,o[ea("0xd1")]))}}[ea("0xa2")](t){for(const{suggestion:e,meta:n}of this[ea("0x11c")](t,ea("0x113"))){if(!n[ea("0x51")])continue;const o=e[ea("0x75")]();for(const e of o)if(!t[ea("0x7")](e).length)return!0}return!1}_getAuthorFromId(t){const n=this[ea("0x5a")][ea("0xf4")][ea("0x11e")](ea("0x2"))[ea("0xab")](t);if(!n)throw new e.CKEditorError(ea("0x27"),this);return n}[ea("0x94")](t,e,n,o){const r=this._getAuthorFromId(o),s=this[ea("0x37")][ea("0x107")](t,e,n,r,(t=>this._updateSuggestionData(n,{attributes:t})));return this[ea("0x96")](s,ea("0xfa"),(()=>{this[ea("0x63")](n,{state:ea("0xff")})}),{priority:ea("0xa")}),this[ea("0x96")](s,ea("0xe5"),(()=>{this[ea("0x63")](n,{state:ea("0xc5")})}),{priority:"high"}),this[ea("0xb3")][ea("0x8e")](n,s),this[ea("0x8d")][ea("0x8e")](s,ea("0x7c")),s}_splitMarkerName(t){const e=t[ea("0x46")](":");return{group:e[0],type:e[1],subType:e[ea("0x20")]>=5?e[2]:null,id:e[ea("0x20")]<5?e[2]:e[3],authorId:e[ea("0x20")]<5?e[3]:e[4],markerCount:6==e[ea("0x20")]?e[5]:null}}[ea("0x48")](t,n,o){const r=t[ea("0xd2")](),s=r[ea("0x119")],i=r[ea("0xd1")];this._setSuggestionRange(t,this[ea("0xf3")].createRange(s,n));const x=(0,e.uid)(),a=t[ea("0x1e")].id,c=t[ea("0x127")]+(t[ea("0x3f")]?":"+t[ea("0x3f")]:"");this[ea("0x4")]({id:x,type:c,createdAt:new Date,authorId:a,originalSuggestionId:t.id,data:t[ea("0x78")]}),"formatBlock"==t[ea("0x127")]&&(o=this[ea("0xf3")][ea("0xd3")](o[ea("0xd8")])),this[ea("0x65")](c,x,a,this[ea("0xf3")].createRange(o,i))}[ea("0x11c")](t,e=null){const n=[],o=this[ea("0xf3")].schema,r=this[ea("0x5a")][ea("0xf4")][ea("0x11e")](ea("0x2")).me;for(const s of this[ea("0x124")]())if(s.isInContent&&(!e||s[ea("0x127")]==e))for(const e of s[ea("0x75")]()){const i=t[ea("0x119")][ea("0x21")](e[ea("0xd1")])||t[ea("0xd1")].isEqual(e[ea("0x119")]);if(i||t[ea("0xd7")](e)){const x=t[ea("0xeb")](e)&&ra(o,e.start,t),a=e[ea("0xeb")](t)&&ra(o,t[ea("0x119")],e);n[ea("0xb7")]({suggestion:s,meta:{isOwn:r==s[ea("0x1e")],isNextTo:i,isInsideObject:x,containsRangeInObject:a}});break}}return n}[ea("0x65")](t,e,n,o,r=null){this[ea("0xf3")][ea("0x5b")]((s=>{let i=ea("0xa4")+t+":"+e+":"+n;r&&(i=i+":"+r),s[ea("0x1f")](i,{range:o,usingOperation:!0,affectsData:!0})}))}_removeSuggestion(t){const e=t.previous,n=t[ea("0x108")];t[ea("0x26")]=null,null!=e&&(e[ea("0x108")]=null),t[ea("0x108")]=null,null!=n&&(n[ea("0x26")]=null),ea("0x28")==this[ea("0x8d")][ea("0x11e")](t)&&(this[ea("0x8d")][ea("0x8e")](t,"removed"),this[ea("0x6b")](ea("0xe3"),t,e,n))}[ea("0x4")](t){const e=t.id,n=this[ea("0x110")](t);if(this[ea("0x5")]&&this[ea("0x5")][ea("0x71")]){const o=this[ea("0x5a")][ea("0xf4")].get(ea("0x121")),r=n[ea("0x6d")],s=n[ea("0x3f")]?n.type+":"+n[ea("0x3f")]:n.type,i=this.editor[ea("0xc2")],x=o[ea("0xb5")](kr(i,ea("0xdd"))),a={id:e,type:s,hasComments:r,data:t[ea("0x78")]||null,originalSuggestionId:t[ea("0x7e")]||null,attributes:n[ea("0x10a")]};this._adapter[ea("0x71")](a)[ea("0x125")]((t=>{n._saved=!0,o[ea("0xe7")](x),t&&t[ea("0xa1")]&&(this[ea("0xb3")][ea("0x11e")](e)[ea("0xa1")]=t.createdAt)}))}return n}[ea("0x63")](t,e){const n=this[ea("0x5a")][ea("0xf4")][ea("0x11e")]("PendingActions"),o=this[ea("0xb3")][ea("0x11e")](t);if(this[ea("0x5")]&&this[ea("0x5")].updateSuggestion)if(o[ea("0x39")]){const o=n[ea("0xb5")](kr(this.editor[ea("0xc2")],"PENDING_ACTION_SUGGESTION"));this[ea("0x5")][ea("0x4e")](t,e).then((()=>{n.remove(o)}))}else o.on(ea("0x118"),(()=>{this[ea("0x63")](t,e)}))}_getSuggestionData(t){if(!this[ea("0x5")]||!this[ea("0x5")][ea("0xac")])throw new e.CKEditorError(ea("0x36"),this);return this._adapter.getSuggestion(t)}[ea("0x59")](t){const{id:e,type:n,subType:o,authorId:r}=this[ea("0x62")](t),s=this._suggestions.get(e)||this[ea("0x94")](n,o,e,r);switch(this[ea("0x43")](s,n,o,r),this[ea("0x8d")][ea("0x11e")](s)){case ea("0x7c"):this[ea("0xee")](e).then((t=>{let n=Promise[ea("0x12a")]();t[ea("0x6d")]&&(n=this[ea("0x47")][ea("0x86")]({channelId:this[ea("0x5a")][ea("0xd4")][ea("0x11e")](ea("0x8c")),threadId:e})),n[ea("0x125")]((()=>{this[ea("0x110")](t)[ea("0x39")]=!0}))})),this[ea("0x8d")].set(s,ea("0xc1"));break;case ea("0x2a"):this[ea("0x63")](e,{state:ea("0x42")});case ea("0x6e"):this[ea("0x8d")].set(s,ea("0x28")),this.fire("suggestionLoaded",s);break;case ea("0x28"):this.fire(ea("0x11b"),s)}s[ea("0xe9")](t),this[ea("0xf7")](s)}_refreshSuggestionsChain(t){if(t[ea("0x4b")])return;let e=!0,n=!0;for(const o of this.getSuggestions()){if(o[ea("0x4b")])continue;if(o==t||!o.isInContent)continue;if(o[ea("0x1e")].id!=t[ea("0x1e")].id)continue;const r=this[ea("0x37")].getSuggestionCallback(t[ea("0x127")],t[ea("0x3f")],ea("0xd")),s=this._suggestionFactory[ea("0xaf")](o[ea("0x127")],o[ea("0x3f")],ea("0xd")),i=r(t,o),x=s(t,o);i&&x&&(i[1][ea("0xb1")]&&i[1].commentThread[ea("0x20")]||(i[0][ea("0x108")]=i[1],i[1][ea("0x26")]=i[0],i[0]==t?n=!1:e=!1))}t[ea("0x26")]&&e&&(t[ea("0x26")].next=null,t[ea("0x26")]=null),t[ea("0x108")]&&n&&(t[ea("0x108")][ea("0x26")]=null,t[ea("0x108")]=null)}[ea("0x64")](t){for(const e of this._suggestions[ea("0xca")]()){if(e==t||!e.isInContent)continue;if(e[ea("0x127")]!=t[ea("0x127")]||e[ea("0x1e")].id!=t[ea("0x1e")].id||e[ea("0x3f")]!=t[ea("0x3f")])continue;const n=this[ea("0x37")][ea("0xaf")](t.type,t[ea("0x3f")],"join");if(n(e[ea("0x75")](),t[ea("0x75")]())){if(t[ea("0xb1")]&&t.commentThread[ea("0x20")])continue;return this._joinSuggestions(e,t),!0}if(n(t[ea("0x75")](),e.getRanges())){if(e[ea("0xb1")]&&e.commentThread[ea("0x20")])continue;return this._joinSuggestions(t,e),!0}}return!1}[ea("0x74")](t,e){if(t.isMultiRange)for(const n of e[ea("0x75")]())t[ea("0x4f")](n);else{const n=e[ea("0xd2")]()[ea("0xd1")];this._setSuggestionRange(t,this[ea("0xf3")][ea("0x4a")](t[ea("0xd2")]()[ea("0x119")],n))}e[ea("0x1")]()}}(0,e.mix)(na,e.EmitterMixin);class oa{constructor(t){this._editor=t,this._model=t[ea("0x73")],this[ea("0x13")]=new Map,this._defaultCallbacks=new Map,this[ea("0xe1")]()}[ea("0x107")](t,e,n,o,r){return new Cr(this[ea("0xf3")],{type:t,subType:e,id:n,author:o,onAttributesChange:r,onAccept:(...n)=>this[ea("0xaf")](t,e,ea("0xfa"))(...n),onDiscard:(...n)=>this.getSuggestionCallback(t,e,ea("0xe5"))(...n)})}[ea("0x6c")](t,e,n,o){const r=t+":"+e+":"+n;this[ea("0x13")][ea("0x8e")](r,o)}[ea("0xaf")](t,e,n){const o=t+":"+e+":"+n;return this._customCallbacks[ea("0x11e")](o)||this._defaultCallbacks[ea("0x11e")](t+":"+n)}[ea("0xe1")](){const t=()=>{},e=t=>{t[ea("0x3d")](((t,e)=>t[ea("0x119")][ea("0xa5")](e[ea("0x119")])?1:-1)),this[ea("0xf3")].change((e=>{for(const n of t){let t;t=n.end[ea("0x5c")]&&n[ea("0xd1")][ea("0xd8")]==n[ea("0x119")].nodeAfter?e[ea("0x103")](n[ea("0x119")][ea("0xf2")],"on"):e[ea("0x103")](n),this[ea("0xf3")][ea("0x115")](t,{forceDefaultExecution:!0,doNotAutoparagraph:!0})}}))},n=(t,e)=>{this[ea("0xf3")][ea("0x5b")]((n=>{const{commandName:o,commandParams:r=[]}=e,s=t[0];if(ea("0xb2")==s[ea("0x2e")].rootName)return;const i=Array[ea("0x55")](this._model[ea("0x18")][ea("0xea")][ea("0x75")]())[ea("0x98")]((t=>F.LiveRange[ea("0x11d")](t)));sa(s)?n[ea("0xc9")](this[ea("0xf3")].createRange(s[ea("0xd1")])):n[ea("0xc9")](s);for(const t of this[ea("0xf8")][ea("0x129")][ea("0x129")]())t.refresh();r[ea("0xb7")]({forceDefaultExecution:!0}),this._editor[ea("0x70")](o,...r);const x=i[ea("0x79")]((t=>ea("0xb2")!=t[ea("0x2e")][ea("0xc4")]));x[ea("0x20")]>0&&n.setSelection(x);for(const t of i)t[ea("0x87")]()}))},o=(t,e)=>1==t.length&&1==e[ea("0x20")]&&t[0].end[ea("0x21")](e[0][ea("0x119")]),r=(t,e)=>la(t,e,this[ea("0xf3")])?[t,e]:la(e,t,this._model)?[e,t]:null;this._defaultCallbacks.set(ea("0xe2"),t),this[ea("0x9d")][ea("0x8e")]("insertion:discard",e),this[ea("0x9d")].set("insertion:join",o),this[ea("0x9d")][ea("0x8e")](ea("0x9"),r),this[ea("0x9d")][ea("0x8e")](ea("0x1d"),e),this[ea("0x9d")][ea("0x8e")](ea("0x9f"),t),this[ea("0x9d")][ea("0x8e")](ea("0xd9"),o),this[ea("0x9d")].set(ea("0x5e"),r),this[ea("0x9d")][ea("0x8e")]("formatInline:accept",n),this._defaultCallbacks[ea("0x8e")](ea("0xd5"),t),this[ea("0x9d")].set(ea("0xef"),o),this._defaultCallbacks.set("formatInline:chain",t),this[ea("0x9d")][ea("0x8e")]("formatBlock:accept",n),this[ea("0x9d")][ea("0x8e")](ea("0x60"),t),this[ea("0x9d")][ea("0x8e")](ea("0x2d"),o),this._defaultCallbacks[ea("0x8e")](ea("0xbf"),t)}}function ra(t,e,n){for(const o of e.parent[ea("0xf9")]({includeSelf:!0,parentFirst:!0})){if(o[ea("0x2e")]==o)return!1;if(!n.containsItem(o))return!1;if(t[ea("0x76")](o)||t.isLimit(o))return!0}}function sa(t){return t.end[ea("0xd8")]==t[ea("0x119")][ea("0xf2")]&&t[ea("0xd1")].isAtStart}function ia(t,e,n,o){const r=t=>!t[ea("0x10f")].is(ea("0x120"))&&!o[ea("0x76")](t[ea("0x10f")]),s=t.start[ea("0x5d")](r),i=t[ea("0xd1")].getLastMatchingPosition(r,{direction:ea("0x58")});return!(t[ea("0x119")].isEqual(s)&&t[ea("0xd1")][ea("0x21")](i)||(s[ea("0xa5")](i)?n[ea("0x99")](e,{range:n.createRange(s,i)}):n[ea("0xfe")](e),0))}function xa(t){return function(t){let e=0,n=0;for(const o of $x(t))e=(e<<5)-e+o,e&=e,[e,n]=[n,e];return Qx(e)+Qx(n)}(t)}function aa(t){const e=t[ea("0x119")][ea("0xf2")];return e&&e.is("element")}function ca(t,e){const n=e.schema[ea("0x76")](t)||e.schema[ea("0x6a")](t);return e[ea("0x4a")](e[ea("0x95")](t,ea("0xe4")),n?e[ea("0x109")](t):e.createPositionAt(t,"end"))}function la(t,e,n){const o=t[ea("0xd2")](),r=e[ea("0xd2")]();if(o[ea("0xd1")].isEqual(r.start))return!0;if(t[ea("0x127")]!=e[ea("0x127")])return!1;if(!o[ea("0xd1")].isTouching(r[ea("0x119")]))return!1;const s=n[ea("0x4a")](o[ea("0xd1")],r[ea("0x119")])[ea("0x8f")]();for(const t of s)if([ea("0xa3"),ea("0xcd")][ea("0xb8")](t[ea("0x127")])&&n[ea("0xb6")][ea("0x17")](t[ea("0x10f")]))return!1;return!0}var ua,da,ga=["bind","execute","acceptSuggestion","_acceptCommand","discardSuggestion","unbind","commentThreadController","stopListening","destroy","listenTo","_discardCommand","view","isEnabled","model"];ua=ga,da=323,function(t){for(;--t;)ua.push(ua.shift())}(++da);var fa=function(t,e){return ga[t-=0]};class ma{constructor(t,e,n,o,r){this[fa("0xc")]=t,this[fa("0xa")]=e,this[fa("0x5")]=r,this._acceptCommand=n,this[fa("0x9")]=o,this[fa("0xa")][fa("0xd")](fa("0xb")).to(this[fa("0x2")]),this[fa("0x8")](e,fa("0x1"),(()=>this[fa("0x1")]())),this[fa("0x8")](e,fa("0x3"),(()=>this.discardSuggestion()))}acceptSuggestion(){this[fa("0x2")][fa("0x0")](this[fa("0xc")].id)}[fa("0x3")](){this[fa("0x9")][fa("0x0")](this[fa("0xc")].id)}[fa("0x7")](){this[fa("0xa")][fa("0x4")](fa("0xb")),this[fa("0x6")](),this[fa("0x5")][fa("0x7")]()}}(0,e.mix)(ma,e.ObservableMixin);const ha=["value","isDirty","editorConfig","focus","commentInputView","descriptionParts","editor","length","cancel","_model","commentsListView","delegate","destroy","addComment","bind","setData","hasDirtyComment","commentThread","isActive","isEnabled","fire","locale","_localUser","createdAt","CommentView","element","isReadOnly","removeComment","_config","_createCommentThreadInputView","set","disableComments","assign","commentThreadInputView"];var pa,ba;pa=ha,ba=110,function(t){for(;--t;)pa.push(pa.shift())}(++ba);const Ea=function(t,e){return ha[t-=0]};class _a extends r.View{constructor(t,e,n,o){super(t),this[Ea("0x2")]=null,this.commentThreadInputView=null,this.set("isActive",!1),this[Ea("0x16")](Ea("0xf"),e[Ea("0xf")]),this[Ea("0x6")](Ea("0xf")).to(e),this[Ea("0x16")](Ea("0x1f"),[]),this[Ea("0x16")]("isDirty",!1),this[Ea("0x16")](Ea("0xb"),!1),this[Ea("0x1")]=e,this[Ea("0xe")]=n,this._config=o,o[Ea("0x17")]?this[Ea("0x16")](Ea("0x21"),1):this._createCommentViews()}[Ea("0x1d")](){this[Ea("0x11")][Ea("0x1d")]()}[Ea("0x4")](){this.isDirty=!1,this[Ea("0x2")]&&this.commentsListView.destroy(),this[Ea("0x19")]&&this[Ea("0x19")][Ea("0x4")](),super[Ea("0x4")]()}_createCommentViews(){const{CommentsListView:t}=this[Ea("0x14")];this[Ea("0x2")]=new t(this[Ea("0xd")],this._model[Ea("0x9")],Object[Ea("0x18")]({CommentView:this[Ea("0x14")][Ea("0x10")]},this._config)),this[Ea("0x2")][Ea("0x3")](Ea("0x13")).to(this),this.commentsListView[Ea("0x3")]("updateComment").to(this),this[Ea("0x2")][Ea("0x6")](Ea("0xa")).to(this),this[Ea("0x16")](Ea("0x21"),this[Ea("0x2")].length+1),this[Ea("0x6")]("length").to(this[Ea("0x2")],Ea("0x21"),(t=>t+1)),this.commentThreadInputView=this[Ea("0x15")](),this.on(Ea("0x13"),(()=>this[Ea("0x1d")]())),this[Ea("0x6")](Ea("0x1b")).to(this[Ea("0x2")],Ea("0x8"),this[Ea("0x19")][Ea("0x1e")],Ea("0x1a"),((t,e)=>t||!!e))}[Ea("0x15")](){const{CommentThreadInputView:t}=this[Ea("0x14")],e=new t(this[Ea("0xd")],this[Ea("0xe")],this[Ea("0x14")][Ea("0x1c")]),n=e[Ea("0x1e")];return e[Ea("0x6")]("showInput").to(this,Ea("0xa"),this[Ea("0x1")].commentThread,Ea("0x12"),n,Ea("0x1a"),((t,e,n)=>!!n||t&&!e)),n.on("submit",((t,e)=>{this[Ea("0xc")](Ea("0x5"),e),n[Ea("0x20")][Ea("0x7")]("")})),n.on(Ea("0x0"),(()=>this.focus())),n[Ea("0x6")]("disabledSubmit").to(this[Ea("0x1")][Ea("0x9")],Ea("0x12")),e}}const ya=["push","description","acceptButton",'" title="',"</p>","_descriptionElement","ck-annotation__info-name","commentsListView","ck-suggestion__info-name","acceptSuggestion","descriptionParts","isActive","ck-suggestion__main","_createButton","createdAt","ck-annotation","bind","commentThreadInputView",'<span class="ck-suggestion-type">',"check","createElement","locale","content","div","innerHTML","map","discardButton","ck-suggestion--discard","_model","value","ck-suggestion__info","ck-comment__info-time","color","ck-suggestion--accept","formatDateTime","discardSuggestion","</span>","set","ck-suggestion-wrapper","render","ck-annotation__main","ck-suggestion-","userView",'<span class="ck-suggestion-color" style="background-color: ',"Accept suggestion","querySelector","ck-suggestion","author","ck-suggestion--disabled-comments","type","ck-annotation__actions","cancel","_config","getTemplate","innerText","execute","ck-annotation__info-time","ck-annotation__content-wrapper","ck-suggestion__actions",".ck-annotation__content-wrapper","name","commentThread","ck-suggestion-wrapper--active","span"];var Ta,Ca;Ta=ya,Ca=320,function(t){for(;--t;)Ta.push(Ta.shift())}(++Ca);const ka=function(t,e){return ya[t-=0]};class va extends _a{constructor(e,n,o,r){super(e,n,o,r),this[ka("0x25")](ka("0x31"),""),this[ka("0x10")](ka("0x31")).to(this,ka("0xa"),(t=>t&&t[0]?t[0][ka("0x31")]:"")),this[ka("0x10")](ka("0x1")).to(this,ka("0xa"),this,ka("0xb"),((t,e)=>{let n="";for(const e of t)n+="<p>"+Aa(e[ka("0x16")],e[ka("0x20")])+ka("0x4");return e?n:(0,s.trimHtml)(n,{limit:140})})),this[ka("0x5")]=null,this.acceptButton=this[ka("0xd")](kr(e,ka("0x2c")),t.icons[ka("0x13")],ka("0x21"),ka("0x9")),this[ka("0x1a")]=this[ka("0xd")](kr(e,"Discard suggestion"),t.icons[ka("0x33")],ka("0x1b"),ka("0x23")),this.userView=new s.UserView(e,this._model.author),this[ka("0x2a")].extendTemplate({attributes:{class:["ck-suggestion__user","ck-annotation__user"]}}),this.setTemplate(this[ka("0x35")]())}[ka("0x35")](){const t=this.bindTemplate,e={tag:"div",attributes:{class:[ka("0x26"),t.if(ka("0xb"),ka("0x3e")),t.to(ka("0x31"),(t=>ka("0x29")+t)),this._config.disableComments&&ka("0x30")],"data-suggestion-id":this[ka("0x1c")].id,"data-thread-id":this[ka("0x1c")][ka("0x3d")].id,"data-author-id":this[ka("0x1c")][ka("0x2f")].id,tabindex:-1},children:[{tag:ka("0x17"),attributes:{class:[ka("0x2e"),ka("0xf")]},children:[this[ka("0x2a")],{tag:ka("0x17"),attributes:{class:[ka("0xc"),ka("0x28")]},children:[{tag:ka("0x17"),attributes:{class:[ka("0x1e"),"ck-annotation__info"]},children:[{tag:ka("0x3f"),children:[{text:this[ka("0x2a")][ka("0x3c")]}],attributes:{class:[ka("0x8"),ka("0x6")]}},{tag:"time",attributes:{datetime:t.to(ka("0xe")),class:[ka("0x1f"),ka("0x38")]},children:[{text:t.to(ka("0xe"),(t=>this[ka("0x34")][ka("0x22")](t)))}]}]},{tag:ka("0x17"),attributes:{class:[ka("0x3a"),ka("0x32")]},children:[this[ka("0x2")],this[ka("0x1a")]]},{tag:ka("0x17"),attributes:{class:[ka("0x39")]}}]}]}]};return this[ka("0x7")]&&this[ka("0x11")]&&e.children[ka("0x0")](this[ka("0x7")],this[ka("0x11")]),e}[ka("0x27")](){super.render(),this[ka("0x5")]=this.element[ka("0x2d")](ka("0x3b")),this[ka("0x5")][ka("0x18")]=this[ka("0x1")],this.on("change:description",((t,e,n)=>{this[ka("0x5")][ka("0x18")]=n}))}[ka("0xd")](t,e,n,o){const s=new r.ButtonView(this[ka("0x15")]);return s[ka("0x25")]({label:t,icon:e,tooltip:!0}),s.extendTemplate({attributes:{class:n}}),s.on(ka("0x37"),(()=>{this.fire(o,this[ka("0x1c")].id)})),s[ka("0x10")]("isEnabled").to(this),s}}function Aa(t,e){let n="";return n+=t.split("*")[ka("0x19")](((t,e)=>e%2!=0?ka("0x12")+Ra(t)+ka("0x24"):Ra(t))).join(""),e&&(n+=ka("0x2b")+e[ka("0x1d")]+ka("0x3")+e.title+'"></span>'),n}function Ra(t){const e=document[ka("0x14")]("span");return e[ka("0x36")]=t,e[ka("0x18")]}var Ia=n(596),Sa=n.n(Ia);const wa=["remove","commands","execute","trackChanges","PendingActions","view","suggestionUnloaded","values","value","getAllAdjacentSuggestions","has","discardAllSuggestions","buttonView","trackChanges.SuggestionThreadView","switchbutton","type","comments.maxCommentCharsWhenCollapsed","CommentsUI","from","delete","define","commandName","source","unbind","actionView","filter","focus","cancel","listenTo","getMarkerNames","get","change:activeAnnotations","activeMarkers","innerView","change:previous","getJoined","_descriptionFactory","TrackChangesEditing","keys","locale","isOn","getDescriptions","discardSelectedSuggestions","_disableComments","_destroyController","separator","length","refreshSelectedViews","clear","destroy","model","Track changes","bind","plugins","push","some","Annotations","comments.maxCommentsWhenCollapsed","getFirstMarker","head","_debouncedHandlers","descriptionParts","Accept all suggestions","isEnabled","isMultiRange","isDirty","getRanges","suggestion-","getContainedElement","getRange","arrowView","config","EditorAnnotations","SuggestionThreadView","set","getSuggestion","pluginName","CommentsRepository","_suggestionToController","editing","add","trackChanges.disableComments","editor","comments.editorConfig","init","button","toMany","stopListening","previous","commentThread","acceptSelectedSuggestions","addSourceCollector","_viewToController","_createUIButton","map","PENDING_ACTION_SUGGESTION","getFirstRange","getByInnerView","_initializeController","_updateController","createAnnotationView","requires","reduce","toViewElement","Discard all selected suggestions","isInContent","discardSuggestion","comments"];var Ma,Na;Ma=wa,Na=212,function(t){for(;--t;)Ma.push(Ma.shift())}(++Na);const La=function(t,e){return wa[t-=0]};class Oa extends t.Plugin{static get[La("0x69")](){return[na,s.Users,La("0x51"),La("0x3c"),La("0x4c")]}static get[La("0x50")](){return"TrackChangesUI"}constructor(t){super(t),this._suggestionToController=new Map,this[La("0x60")]=new Map,this[La("0x40")]=new Map;const e=this[La("0x56")][La("0x4b")];e[La("0x18")](La("0x11"),va),e.define(La("0x55"),!1),this._disableComments=e.get("trackChanges.disableComments")}[La("0x58")](){const t=this.editor,e=t[La("0x39")][La("0x22")](na),n=t[La("0x39")][La("0x22")](La("0x3c")),o=t[La("0x39")].get(La("0x4c")),r=t[La("0x39")].get(La("0x51"));t.ui.componentFactory[La("0x54")](La("0x7"),(t=>this._createUIButton(t))),o[La("0x5f")]((()=>{const t=[];for(const[e,n]of Array[La("0x16")](this[La("0x52")])){const o=e[La("0xd")](),r=[];for(const t of o){if(!t.isInContent)continue;if(t[La("0x44")]){r[La("0x3a")](...t[La("0x46")]());continue}const e=t[La("0x64")]();if(r[La("0x32")]>0){const t=r[0][La("0x27")](e);if(t){r[0]=t;continue}}r[La("0x3a")](e)}t[La("0x3a")]([n[La("0x9")],r])}return t})),this[La("0x20")](e,"suggestionLoaded",((t,e)=>{let n=!1;const r=O((t=>{n||t?n&&t&&(this[La("0x30")](e),o[La("0x33")](),n=!1):(this[La("0x66")](e),o[La("0x33")](),n=!0)}),10);this[La("0x40")][La("0x4e")](e,r),this.listenTo(e,La("0x26"),((t,n,o,s)=>{e[La("0x1")]&&(null==o?(this[La("0x67")](s[La("0x3f")]),r(!1)):(this[La("0x67")](o[La("0x3f")]),r(!0)))})),null===e[La("0x5c")]?r(!1):this[La("0x67")](e[La("0x3f")])})),this[La("0x20")](e,La("0xa"),((t,e,n)=>{this[La("0x5b")](e,La("0x26")),this._debouncedHandlers.get(e)[La("0x1f")](),this[La("0x40")][La("0x17")](e);const o=n?n[La("0x3f")]:e,r=this[La("0x52")][La("0x22")](o);null!==n&&this[La("0x67")](o),null===n&&r&&this._destroyController(e)})),this[La("0x20")](e,"suggestionChanged",((t,e)=>{this[La("0x67")](e)})),this[La("0x20")](n,La("0x23"),((t,n,o)=>{const r=Array[La("0x16")](o,(t=>t[La("0x25")]))[La("0x1d")]((t=>this[La("0x60")][La("0xe")](t))),s=[];for(const t of r){const e=this[La("0x60")][La("0x22")](t)[La("0x36")][La("0xd")]();s.push(...e[La("0x6a")](((t,e)=>[...t,...e[La("0x21")]()]),[]))}e[La("0x24")]=s})),this[La("0x20")](r,"addComment",((t,{threadId:n,isFromAdapter:o})=>{if(o||!e.hasSuggestion(n))return;const r=e[La("0x4f")](n);this[La("0x52")][La("0x22")](r).view[La("0x1e")]()}),{priority:"lowest"})}[La("0x61")](t){const n=(0,r.createDropdown)(t,r.SplitButtonView),o=this[La("0x56")].commands[La("0x22")]("trackChanges"),s=kr(t,La("0x37"));n[La("0x10")][La("0x4e")]({tooltip:s,label:s,icon:Sa()}),n[La("0x10")][La("0x38")]("isOn").to(o,La("0xc")),n[La("0x10")].on("execute",(()=>o[La("0x6")]()));const i=new e.Collection,x=[{type:La("0x12"),model:{withText:!0,label:s,commandName:"trackChanges"}},{type:La("0x31")},{type:La("0x59"),model:{withText:!0,label:kr(t,La("0x42")),commandName:"acceptAllSuggestions"}},{type:La("0x59"),model:{withText:!0,label:kr(t,"Accept all selected suggestions"),commandName:La("0x5e")}},{type:La("0x59"),model:{withText:!0,label:kr(t,"Discard all suggestions"),commandName:La("0xf")}},{type:"button",model:{withText:!0,label:kr(t,La("0x0")),commandName:La("0x2e")}}];for(const t of x){const e={type:t[La("0x13")]};if(t[La("0x36")]){const n=new r.Model(t.model),o=this[La("0x56")][La("0x5")][La("0x22")](n[La("0x19")]);n.bind(La("0x2c"),"isEnabled").to(o,La("0xc"),La("0x43")),e.model=n}i.add(e)}(0,r.addListToDropdown)(n,i);const a=x[La("0x1d")]((t=>null!=t[La("0x36")]))[La("0x62")]((t=>this[La("0x56")][La("0x5")][La("0x22")](t[La("0x36")][La("0x19")])));return n[La("0x10")].actionView[La("0x1b")](La("0x43")),n[La("0x10")][La("0x4a")][La("0x1b")](La("0x43")),n[La("0x10")][La("0x1c")][La("0x38")](La("0x43")).to(o,La("0x43")),n[La("0x10")][La("0x4a")][La("0x38")](La("0x43"))[La("0x5a")](a,La("0x43"),((...t)=>t[La("0x3b")]((t=>t)))),n.on(La("0x6"),(t=>this.editor.execute(t[La("0x1a")][La("0x19")]))),n}[La("0x66")](t){const e=this[La("0x56")],n=e[La("0x4b")],o=e[La("0x39")][La("0x22")]("Annotations"),r=e[La("0x39")][La("0x22")](La("0x51")),i=t[La("0xd")]()[La("0x1d")]((t=>t[La("0x1")])),x=e[La("0x39")][La("0x22")](s.Users).me,a=e[La("0x5")].get("acceptSuggestion"),c=e.commands.get(La("0x2")),l=n[La("0x22")](La("0x7"))[La("0x4d")],{CommentsListView:u,CommentThreadInputView:d}=e[La("0x39")].get(La("0x15")),g=new l(e[La("0x2b")],t,x,{disableComments:this[La("0x2f")],editorConfig:n[La("0x22")](La("0x57")),maxCommentsWhenCollapsed:n.get(La("0x3d")),maxThreadTotalWeight:n[La("0x22")]("comments.maxThreadTotalWeight"),maxCommentCharsWhenCollapsed:n[La("0x22")](La("0x14")),formatDateTime:(0,s.getDateTimeFormatter)(n[La("0x22")](La("0x2b"))),CommentView:n.get(La("0x3")).CommentView,CommentsListView:u,CommentThreadInputView:d}),f=r.createCommentThreadController(t[La("0x5d")],g),m=new ma(t,g,a,c,f);g[La("0x41")]=e.plugins[La("0x22")](La("0x29"))[La("0x28")][La("0x2d")](i),this[La("0x52")][La("0x4e")](t,m),this[La("0x60")].set(g,m);const h=o[La("0x68")](this[La("0x56")][La("0x2b")],g);h[La("0x38")](La("0x45")).to(g,La("0x45")),h[La("0x38")](La("0x32")).to(g),h.bind(La("0x13")).to(g,La("0x13"),(t=>La("0x47")+t));const p=o.createAnnotation({view:h,target:()=>{const t=i[0][La("0x3e")]();if(!t)return null;const n=t[La("0x49")]()[La("0x48")]();return n&&!e[La("0x53")].mapper[La("0x6b")](n)?null:(0,s.getMarkerDomElement)(e[La("0x53")],t)||null},type:()=>La("0x47")+m[La("0x9")][La("0x13")]});o[La("0x54")](p);const b=e[La("0x39")][La("0x22")](La("0x8"));let E;g.on("change:isDirty",((t,e,n)=>{n?E=b.add(kr(this[La("0x56")][La("0x2b")],La("0x63"))):(b[La("0x4")](E),E=null)}))}[La("0x30")](t){const e=this[La("0x56")][La("0x39")][La("0x22")]("Annotations"),n=this[La("0x52")].get(t),o=n.view,r=e[La("0x65")](o);r&&e[La("0x4")](r),this[La("0x52")][La("0x17")](t),this[La("0x60")][La("0x17")](o),n.destroy(),o[La("0x35")]()}_updateController(t){if(!t[La("0x1")]||!this[La("0x52")][La("0xe")](t))return;const e=this[La("0x56")][La("0x39")][La("0x22")](La("0x29")),n=this._suggestionToController.get(t),o=t[La("0xd")]();n[La("0x9")][La("0x41")]=e[La("0x28")].getDescriptions(o)}destroy(){super.destroy();for(const t of this[La("0x52")][La("0x2a")]())this[La("0x30")](t);for(const t of this._debouncedHandlers[La("0xb")]())t[La("0x1f")]();this[La("0x40")][La("0x34")]()}}var Fa,Pa,Da=["addSuggestion","pluginName","adapter","getSuggestions","plugins","Comments","get","editor","getSuggestion","TrackChanges"];Fa=Da,Pa=492,function(t){for(;--t;)Fa.push(Fa.shift())}(++Pa);var ja=function(t,e){return Da[t-=0]};class Ba extends t.Plugin{static get requires(){return[na,Oa,ja("0x3")]}static get[ja("0x9")](){return ja("0x7")}set[ja("0x0")](t){this[ja("0x5")].plugins[ja("0x4")](na)[ja("0x0")]=t}get[ja("0x0")](){return this[ja("0x5")][ja("0x2")][ja("0x4")](na)[ja("0x0")]}[ja("0x8")](t){return this[ja("0x5")][ja("0x2")][ja("0x4")](na).addSuggestionData(t)}[ja("0x1")](t){return this.editor[ja("0x2")][ja("0x4")](na).getSuggestions(t)}[ja("0x6")](t){return this.editor[ja("0x2")][ja("0x4")](na).getSuggestion(t)}}const Ua=["config","getRootNames","createDocumentFragment","context","TrackChangesEditing","trackChangesData.editorCreator","extraPlugins","requires","div","data","getSuggestions","trackChangesData","editorCreator","string","map","TrackChangesDataGetter","add","Autosave","RealTimeCollaborativeEditing","CommentsRepository","discardAllSuggestions","get","plugins","execute","includes","every","end","acceptAllSuggestions","function","from","push","editor","create","concat","track-changes-data-invalid-editor-creator","toolbar","constructor","addSuggestionData","Users","destroy","model","pluginName","TrackChangesData","result","useAnonymousUser","RealTimeCollaborativeTrackChanges","document","users","has","createElement","getDataWithAcceptedSuggestions","_adapter"];var Ha,Ga;Ha=Ua,Ga=428,function(t){for(;--t;)Ha.push(Ha.shift())}(++Ga);const za=function(t,e){return Ua[t-=0]},Va=["initialData",za("0x2b"),za("0x17")],Wa=[za("0x6"),"RealTimeCollaborativeComments",za("0x21"),za("0x5")];class Ka extends t.Plugin{static get[za("0x2f")](){return[na]}static get[za("0x1d")](){return za("0x1e")}init(){const t=this[za("0x13")];if(t[za("0x28")].define(za("0x2d"),(e=>t[za("0x18")][za("0x14")]("",e))),za("0x10")!=typeof t[za("0x28")][za("0x9")](za("0x33"))[za("0x0")])throw new e.CKEditorError(za("0x16"))}[za("0x26")](t){return $a(this.editor,!0,t)}getDataWithDiscardedSuggestions(t){return $a(this[za("0x13")],!1,t)}}class qa extends t.Plugin{static get pluginName(){return za("0x3")}init(){this[za("0x1f")]=za("0xe"),this[za("0x13")][za("0xa")][za("0x9")](za("0x7"))._adapter={getCommentThread:()=>new Promise((()=>{}))},this[za("0x13")].plugins[za("0x9")](za("0x2c"))[za("0x27")]=null}}async function $a(t,e,n){const o=function(t){const e={};for(const n of t[za("0x28")].names())Va.includes(n)||(e[n]=t[za("0x28")][za("0x9")](n));const n=t[za("0x18")].builtinPlugins||[],o=e[za("0x2e")]||[];delete e[za("0x2e")];const r=n[za("0x15")](e.plugins)[za("0x15")](o)[za("0x2")]((t=>za("0x1")==typeof t?n.find((e=>e.pluginName==t)):t)),s=Array[za("0x11")](new Set(r));return e.plugins=s.filter((t=>Xa(t,new Set))),e[za("0xa")][za("0x12")](qa),e.plugins[za("0x12")](na),e}(t),r=document[za("0x2a")](),s=t[za("0x28")][za("0x9")](za("0x33"))[za("0x0")],i=await s(o,(()=>function(t){const e=document[za("0x25")](za("0x30"));return t.appendChild(e),e}(r)));!function(t,e){const n=t[za("0x1c")][za("0x22")][za("0x29")]().reduce(((e,n)=>(e[n]=t.data[za("0x9")]({rootName:n}),e)),{}),o=t.plugins[za("0x9")](za("0x1a"))[za("0x23")][za("0x2")]((t=>({id:t.id}))),r=t[za("0xa")][za("0x9")](za("0x2c"))[za("0x32")]({skipNotAttached:!0,toJSON:!0}),s=e.plugins[za("0x9")](za("0x1a")),i=e[za("0xa")][za("0x9")]("TrackChangesEditing");for(const t of o)s.getUser(t.id)||s.addUser(t);s.me||s[za("0x20")]();for(const t of r)i[za("0x19")](t);e.data.set(n)}(t,i),i[za("0xb")](za(e?"0xf":"0x8"));const x=i[za("0x31")][za("0x9")](n);return await i[za("0x1b")](),x}function Xa(t,e){if(e[za("0x24")](t))return!0;e[za("0x4")](t);const n=za("0x10")==typeof t?t[za("0x1d")]||t.name:t;return(!n||!Wa[za("0xc")](n))&&(!t[za("0x2f")]||t[za("0x2f")][za("0xd")]((t=>Xa(t,e))))}})(),(window.CKEditor5=window.CKEditor5||{}).trackChanges=o})();
|