@ckeditor/ckeditor5-list 45.2.1-alpha.10 → 45.2.1-alpha.3

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/build/list.js CHANGED
@@ -2,4 +2,4 @@
2
2
  /*!
3
3
  * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
4
4
  * For licensing, see LICENSE.md.
5
- */(()=>{var t={21:t=>{"use strict";t.exports=function(t,e){Object.keys(e).forEach(function(i){t.setAttribute(i,e[i])})}},51:t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},128:t=>{"use strict";var e={};t.exports=function(t,i){var n=function(t){if(void 0===e[t]){var i=document.querySelector(t);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(t){i=null}e[t]=i}return e[t]}(t);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");n.appendChild(i)}},137:(t,e,i)=>{"use strict";i.d(e,{A:()=>l});var n=i(758),s=i.n(n),r=i(935),o=i.n(r)()(s());o.push([t.id,".ck-content ol{list-style-type:decimal}.ck-content ol ol{list-style-type:lower-latin}.ck-content ol ol ol{list-style-type:lower-roman}.ck-content ol ol ol ol{list-style-type:upper-latin}.ck-content ol ol ol ol ol{list-style-type:upper-roman}.ck-content ul{list-style-type:disc}.ck-content ul ul{list-style-type:circle}.ck-content ul ul ul,.ck-content ul ul ul ul{list-style-type:square}",""]);const l=o},237:t=>{"use strict";t.exports=CKEditor5.dll},263:(t,e,i)=>{"use strict";i.d(e,{A:()=>l});var n=i(758),s=i.n(n),r=i(935),o=i.n(r)()(s());o.push([t.id,".ck.ck-list-styles-list{display:grid}:root{--ck-list-style-button-size:44px}.ck.ck-list-styles-list{column-gap:var(--ck-spacing-medium);grid-template-columns:repeat(3,auto);padding:var(--ck-spacing-large);row-gap:var(--ck-spacing-medium)}.ck.ck-list-styles-list .ck-button{box-sizing:content-box;margin:0;padding:0}.ck.ck-list-styles-list .ck-button,.ck.ck-list-styles-list .ck-button .ck-icon{height:var(--ck-list-style-button-size);width:var(--ck-list-style-button-size)}",""]);const l=o},266:(t,e,i)=>{"use strict";i.d(e,{A:()=>l});var n=i(758),s=i.n(n),r=i(935),o=i.n(r)()(s());o.push([t.id,".ck.ck-list-properties.ck-list-properties_without-styles{padding:var(--ck-spacing-large)}.ck.ck-list-properties.ck-list-properties_without-styles>*{min-width:14em}.ck.ck-list-properties.ck-list-properties_without-styles>*+*{margin-top:var(--ck-spacing-standard)}.ck.ck-list-properties.ck-list-properties_with-numbered-properties>.ck-list-styles-list{grid-template-columns:repeat(4,auto)}.ck.ck-list-properties.ck-list-properties_with-numbered-properties>.ck-collapsible{border-top:1px solid var(--ck-color-base-border)}.ck.ck-list-properties.ck-list-properties_with-numbered-properties>.ck-collapsible>.ck-collapsible__children>*{width:100%}.ck.ck-list-properties.ck-list-properties_with-numbered-properties>.ck-collapsible>.ck-collapsible__children>*+*{margin-top:var(--ck-spacing-standard)}.ck.ck-list-properties .ck.ck-numbered-list-properties__start-index .ck-input{min-width:auto;width:100%}.ck.ck-list-properties .ck.ck-numbered-list-properties__reversed-order{background:transparent;margin-bottom:calc(var(--ck-spacing-tiny)*-1);padding-left:0;padding-right:0}.ck.ck-list-properties .ck.ck-numbered-list-properties__reversed-order:active,.ck.ck-list-properties .ck.ck-numbered-list-properties__reversed-order:hover{background:none;border-color:transparent;box-shadow:none}",""]);const l=o},311:(t,e,i)=>{t.exports=i(237)("./src/ui.js")},331:(t,e,i)=>{t.exports=i(237)("./src/clipboard.js")},355:(t,e,i)=>{t.exports=i(237)("./src/icons.js")},358:(t,e,i)=>{"use strict";i.d(e,{A:()=>l});var n=i(758),s=i.n(n),r=i(935),o=i.n(r)()(s());o.push([t.id,".ck-editor__editable .ck-list-bogus-paragraph{display:block}",""]);const l=o},507:(t,e,i)=>{t.exports=i(237)("./src/enter.js")},584:(t,e,i)=>{t.exports=i(237)("./src/utils.js")},591:t=>{"use strict";var e=[];function i(t){for(var i=-1,n=0;n<e.length;n++)if(e[n].identifier===t){i=n;break}return i}function n(t,n){for(var r={},o=[],l=0;l<t.length;l++){var a=t[l],c=n.base?a[0]+n.base:a[0],d=r[c]||0,u="".concat(c," ").concat(d);r[c]=d+1;var m=i(u),p={css:a[1],media:a[2],sourceMap:a[3],supports:a[4],layer:a[5]};if(-1!==m)e[m].references++,e[m].updater(p);else{var f=s(p,n);n.byIndex=l,e.splice(l,0,{identifier:u,updater:f,references:1})}o.push(u)}return o}function s(t,e){var i=e.domAPI(e);i.update(t);return function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;i.update(t=e)}else i.remove()}}t.exports=function(t,s){var r=n(t=t||[],s=s||{});return function(t){t=t||[];for(var o=0;o<r.length;o++){var l=i(r[o]);e[l].references--}for(var a=n(t,s),c=0;c<r.length;c++){var d=i(r[c]);0===e[d].references&&(e[d].updater(),e.splice(d,1))}r=a}}},639:t=>{"use strict";var e,i=(e=[],function(t,i){return e[t]=i,e.filter(Boolean).join("\n")});function n(t,e,n,s){var r;if(n)r="";else{r="",s.supports&&(r+="@supports (".concat(s.supports,") {")),s.media&&(r+="@media ".concat(s.media," {"));var o=void 0!==s.layer;o&&(r+="@layer".concat(s.layer.length>0?" ".concat(s.layer):""," {")),r+=s.css,o&&(r+="}"),s.media&&(r+="}"),s.supports&&(r+="}")}if(t.styleSheet)t.styleSheet.cssText=i(e,r);else{var l=document.createTextNode(r),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(l,a[e]):t.appendChild(l)}}var s={singleton:null,singletonCounter:0};t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=s.singletonCounter++,i=s.singleton||(s.singleton=t.insertStyleElement(t));return{update:function(t){n(i,e,!1,t)},remove:function(t){n(i,e,!0,t)}}}},758:t=>{"use strict";t.exports=function(t){return t[1]}},782:(t,e,i)=>{t.exports=i(237)("./src/core.js")},783:(t,e,i)=>{t.exports=i(237)("./src/engine.js")},825:(t,e,i)=>{"use strict";i.d(e,{A:()=>l});var n=i(758),s=i.n(n),r=i(935),o=i.n(r)()(s());o.push([t.id,':root{--ck-todo-list-checkmark-size:16px}.ck-content .todo-list{list-style:none}.ck-content .todo-list li{margin-bottom:5px;position:relative}.ck-content .todo-list li .todo-list{margin-top:5px}.ck-content .todo-list .todo-list__label>input{-webkit-appearance:none;border:0;display:inline-block;height:var(--ck-todo-list-checkmark-size);left:-25px;margin-left:0;margin-right:-15px;position:relative;right:0;vertical-align:middle;width:var(--ck-todo-list-checkmark-size)}.ck-content[dir=rtl] .todo-list .todo-list__label>input{left:0;margin-left:-15px;margin-right:0;right:-25px}.ck-content .todo-list .todo-list__label>input:before{border:1px solid #333;border-radius:2px;box-sizing:border-box;content:"";display:block;height:100%;position:absolute;transition:box-shadow .25s ease-in-out;width:100%}@media (prefers-reduced-motion:reduce){.ck-content .todo-list .todo-list__label>input:before{transition:none}}.ck-content .todo-list .todo-list__label>input:after{border-color:transparent;border-style:solid;border-width:0 calc(var(--ck-todo-list-checkmark-size)/8) calc(var(--ck-todo-list-checkmark-size)/8) 0;box-sizing:content-box;content:"";display:block;height:calc(var(--ck-todo-list-checkmark-size)/2.6);left:calc(var(--ck-todo-list-checkmark-size)/3);pointer-events:none;position:absolute;top:calc(var(--ck-todo-list-checkmark-size)/5.3);transform:rotate(45deg);width:calc(var(--ck-todo-list-checkmark-size)/5.3)}.ck-content .todo-list .todo-list__label>input[checked]:before{background:#26ab33;border-color:#26ab33}.ck-content .todo-list .todo-list__label>input[checked]:after{border-color:#fff}.ck-content .todo-list .todo-list__label .todo-list__label__description{vertical-align:middle}.ck-content .todo-list .todo-list__label.todo-list__label_without-description input[type=checkbox]{position:absolute}.ck-editor__editable.ck-content .todo-list .todo-list__label>input,.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input{cursor:pointer}.ck-editor__editable.ck-content .todo-list .todo-list__label>input:hover:before,.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input:hover:before{box-shadow:0 0 0 5px rgba(0,0,0,.1)}.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input{-webkit-appearance:none;border:0;display:inline-block;height:var(--ck-todo-list-checkmark-size);left:-25px;margin-left:0;margin-right:-15px;position:relative;right:0;vertical-align:middle;width:var(--ck-todo-list-checkmark-size)}.ck-editor__editable.ck-content[dir=rtl] .todo-list .todo-list__label>span[contenteditable=false]>input{left:0;margin-left:-15px;margin-right:0;right:-25px}.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input:before{border:1px solid #333;border-radius:2px;box-sizing:border-box;content:"";display:block;height:100%;position:absolute;transition:box-shadow .25s ease-in-out;width:100%}@media (prefers-reduced-motion:reduce){.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input:before{transition:none}}.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input:after{border-color:transparent;border-style:solid;border-width:0 calc(var(--ck-todo-list-checkmark-size)/8) calc(var(--ck-todo-list-checkmark-size)/8) 0;box-sizing:content-box;content:"";display:block;height:calc(var(--ck-todo-list-checkmark-size)/2.6);left:calc(var(--ck-todo-list-checkmark-size)/3);pointer-events:none;position:absolute;top:calc(var(--ck-todo-list-checkmark-size)/5.3);transform:rotate(45deg);width:calc(var(--ck-todo-list-checkmark-size)/5.3)}.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input[checked]:before{background:#26ab33;border-color:#26ab33}.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input[checked]:after{border-color:#fff}.ck-editor__editable.ck-content .todo-list .todo-list__label.todo-list__label_without-description input[type=checkbox]{position:absolute}',""]);const l=o},834:(t,e,i)=>{t.exports=i(237)("./src/typing.js")},935:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var i="",n=void 0!==e[5];return e[4]&&(i+="@supports (".concat(e[4],") {")),e[2]&&(i+="@media ".concat(e[2]," {")),n&&(i+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),i+=t(e),n&&(i+="}"),e[2]&&(i+="}"),e[4]&&(i+="}"),i}).join("")},e.i=function(t,i,n,s,r){"string"==typeof t&&(t=[[null,t,void 0]]);var o={};if(n)for(var l=0;l<this.length;l++){var a=this[l][0];null!=a&&(o[a]=!0)}for(var c=0;c<t.length;c++){var d=[].concat(t[c]);n&&o[d[0]]||(void 0!==r&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=r),i&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=i):d[2]=i),s&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=s):d[4]="".concat(s)),e.push(d))}},e}}},e={};function i(n){var s=e[n];if(void 0!==s)return s.exports;var r=e[n]={id:n,exports:{}};return t[n](r,r.exports,i),r.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{"use strict";i.r(n),i.d(n,{AdjacentListsSupport:()=>si,DocumentList:()=>oi,DocumentListProperties:()=>li,LegacyIndentCommand:()=>le,LegacyList:()=>Re,LegacyListEditing:()=>Be,LegacyListProperties:()=>Ge,LegacyListPropertiesEditing:()=>je,LegacyListUtils:()=>we,LegacyTodoList:()=>ni,LegacyTodoListEditing:()=>ei,List:()=>gt,ListCommand:()=>P,ListEditing:()=>at,ListIndentCommand:()=>x,ListProperties:()=>qt,ListPropertiesEditing:()=>Nt,ListPropertiesUI:()=>Mt,ListPropertiesUtils:()=>Ct,ListUI:()=>ft,ListUtils:()=>N,TodoDocumentList:()=>ai,TodoList:()=>ne,TodoListEditing:()=>Yt,TodoListUI:()=>te});var t=i(782),e=i(834),s=i(507),r=i(584);class o{_startElement;_referenceIndent;_isForward;_includeSelf;_sameAttributes;_sameIndent;_lowerIndent;_higherIndent;constructor(t,e){this._startElement=t,this._referenceIndent=t.getAttribute("listIndent"),this._isForward="forward"==e.direction,this._includeSelf=!!e.includeSelf,this._sameAttributes=(0,r.toArray)(e.sameAttributes||[]),this._sameIndent=!!e.sameIndent,this._lowerIndent=!!e.lowerIndent,this._higherIndent=!!e.higherIndent}static first(t,e){const i=new this(t,e)[Symbol.iterator]();return(0,r.first)(i)}*[Symbol.iterator](){const t=[];for(const{node:e}of new l(this._getStartNode(),this._isForward?"forward":"backward")){const i=e.getAttribute("listIndent");if(i<this._referenceIndent){if(!this._lowerIndent)break;this._referenceIndent=i}else if(i>this._referenceIndent){if(!this._higherIndent)continue;if(!this._isForward){t.push(e);continue}}else{if(!this._sameIndent){if(this._higherIndent){t.length&&(yield*t,t.length=0);break}continue}if(this._sameAttributes.some(t=>e.getAttribute(t)!==this._startElement.getAttribute(t)))break}t.length&&(yield*t,t.length=0),yield e}}_getStartNode(){return this._includeSelf?this._startElement:this._isForward?this._startElement.nextSibling:this._startElement.previousSibling}}class l{_node;_isForward;_previousNodesByIndent=[];_previous=null;_previousNodeIndent=null;constructor(t,e="forward"){this._node=t,this._isForward="forward"===e}[Symbol.iterator](){return this}next(){if(!d(this._node))return{done:!0,value:void 0};const t=this._node.getAttribute("listIndent");let e=null;if(this._previous){const i=this._previousNodeIndent;t>i?this._previousNodesByIndent[i]=this._previous:t<i?(e=this._previousNodesByIndent[t]||null,this._previousNodesByIndent.length=t):e=this._previous}const i={node:this._node,previous:this._previous,previousNodeInList:e};return this._previous=this._node,this._previousNodeIndent=t,this._node=this._isForward?this._node.nextSibling:this._node.previousSibling,{value:i,done:!1}}}class a{_listHead;constructor(t){this._listHead=t}[Symbol.iterator](){return new l(this._listHead)}}class c{static next(){return(0,r.uid)()}}function d(t){return!!t&&t.is("element")&&t.hasAttribute("listItemId")}function u(t,e={}){return[...m(t,{...e,direction:"backward"}),...m(t,{...e,direction:"forward"})]}function m(t,e={}){const i="forward"==e.direction,n=Array.from(new o(t,{...e,includeSelf:i,sameIndent:!0,sameAttributes:"listItemId"}));return i?n:n.reverse()}function p(t,e){const i=new o(t,{sameIndent:!0,sameAttributes:"listType",...e}),n=new o(t,{sameIndent:!0,sameAttributes:"listType",includeSelf:!0,direction:"forward",...e});return[...Array.from(i).reverse(),...n]}function f(t){return!o.first(t,{sameIndent:!0,sameAttributes:"listItemId"})}function g(t){return!o.first(t,{direction:"forward",sameIndent:!0,sameAttributes:"listItemId"})}function b(t,e={}){t=(0,r.toArray)(t);const i=!1!==e.withNested,n=new Set;for(const e of t)for(const t of u(e,{higherIndent:i}))n.add(t);return v(n)}function h(t){t=(0,r.toArray)(t);const e=new Set;for(const i of t)for(const t of p(i))e.add(t);return v(e)}function y(t,e){const i=m(t,{direction:"forward"}),n=c.next();for(const t of i)e.setAttribute("listItemId",n,t);return i}function A(t,e,i){const n={};for(const[t,i]of e.getAttributes())t.startsWith("list")&&(n[t]=i);const s=m(t,{direction:"forward"});for(const t of s)i.setAttributes(n,t);return s}function w(t,e,{expand:i,indentBy:n=1}={}){t=(0,r.toArray)(t);const s=i?b(t):t;for(const t of s){const i=t.getAttribute("listIndent")+n;i<0?I(t,e):e.setAttribute("listIndent",i,t)}return s}function I(t,e){t=(0,r.toArray)(t);for(const i of t)i.is("element","listItem")&&e.rename(i,"paragraph");for(const i of t)for(const t of i.getAttributeKeys())t.startsWith("list")&&e.removeAttribute(t,i);return t}function k(t){if(!t.length)return!1;const e=t[0].getAttribute("listItemId");return!!e&&!t.some(t=>t.getAttribute("listItemId")!=e)}function v(t){return Array.from(t).filter(t=>"$graveyard"!==t.root.rootName).sort((t,e)=>t.index-e.index)}function _(t){const e=t.document.selection.getSelectedElement();return e&&t.schema.isObject(e)&&t.schema.isBlock(e)?e:null}function T(t,e){return e.checkChild(t.parent,"listItem")&&e.checkChild(t,"$text")&&!e.isObject(t)}function L(t){return"numbered"==t||"customNumbered"==t}function S(t,e,i){return m(e,{direction:"forward"}).pop().index>t.index?A(t,e,i):[]}class x extends t.Command{_direction;constructor(t,e){super(t),this._direction=e}refresh(){this.isEnabled=this._checkEnabled()}execute(){const t=this.editor.model,e=C(t.document.selection);t.change(t=>{const i=[];k(e)&&!f(e[0])?("forward"==this._direction&&i.push(...w(e,t)),i.push(...y(e[0],t))):"forward"==this._direction?i.push(...w(e,t,{expand:!0})):i.push(...function(t,e){const i=b(t=(0,r.toArray)(t)),n=new Set,s=Math.min(...i.map(t=>t.getAttribute("listIndent"))),l=new Map;for(const t of i)l.set(t,o.first(t,{lowerIndent:!0}));for(const t of i){if(n.has(t))continue;n.add(t);const i=t.getAttribute("listIndent")-1;if(i<0)I(t,e);else{if(t.getAttribute("listIndent")==s){const i=S(t,l.get(t),e);for(const t of i)n.add(t);if(i.length)continue}e.setAttribute("listIndent",i,t)}}return v(n)}(e,t));for(const e of i){if(!e.hasAttribute("listType"))continue;const i=o.first(e,{sameIndent:!0});i&&t.setAttribute("listType",i.getAttribute("listType"),e)}this._fireAfterExecute(i)})}_fireAfterExecute(t){this.fire("afterExecute",v(new Set(t)))}_checkEnabled(){let t=C(this.editor.model.document.selection),e=t[0];if(!e)return!1;if("backward"==this._direction)return!0;if(k(t)&&!f(t[0]))return!0;t=b(t),e=t[0];const i=o.first(e,{sameIndent:!0});return!!i&&i.getAttribute("listType")==e.getAttribute("listType")}}function C(t){const e=Array.from(t.getSelectedBlocks()),i=e.findIndex(t=>!d(t));return-1!=i&&(e.length=i),e}class P extends t.Command{type;_listWalkerOptions;constructor(t,e,i={}){super(t),this.type=e,this._listWalkerOptions=i.multiLevel?{higherIndent:!0,lowerIndent:!0,sameAttributes:[]}:void 0}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){const e=this.editor.model,i=e.document,n=_(e),s=Array.from(i.selection.getSelectedBlocks()).filter(t=>e.schema.checkAttribute(t,"listType")||T(t,e.schema)),r=void 0!==t.forceValue?!t.forceValue:this.value;e.change(o=>{if(r){const t=s[s.length-1],e=m(t,{direction:"forward"}),i=[];e.length>1&&i.push(...y(e[1],o)),i.push(...I(s,o)),i.push(...function(t,e){const i=[];let n=Number.POSITIVE_INFINITY;for(const{node:s}of new l(t.nextSibling)){const t=s.getAttribute("listIndent");if(0==t)break;t<n&&(n=t);const r=t-n;e.setAttribute("listIndent",r,s),i.push(s)}return i}(t,o)),this._fireAfterExecute(i)}else if((n||i.selection.isCollapsed)&&d(s[0])){const e=p(n||s[0],this._listWalkerOptions);for(const i of e)o.setAttributes({...t.additionalAttributes,listType:this.type},i);this._fireAfterExecute(e)}else{const i=[];for(const n of s)if(n.hasAttribute("listType"))for(const e of b(n,{withNested:!1}))e.getAttribute("listType")!=this.type&&(o.setAttributes({...t.additionalAttributes,listType:this.type},e),i.push(e));else!n.is("element","listItem")&&T(n,e.schema)&&o.rename(n,"listItem"),o.setAttributes({...t.additionalAttributes,listIndent:0,listItemId:c.next(),listType:this.type},n),i.push(n);this._fireAfterExecute(i)}})}_fireAfterExecute(t){this.fire("afterExecute",v(new Set(t)))}_getValue(){const t=this.editor.model.document.selection,e=Array.from(t.getSelectedBlocks());if(!e.length)return!1;for(const t of e)if(t.getAttribute("listType")!=this.type)return!1;return!0}_checkEnabled(){const t=this.editor.model,e=t.schema,i=t.document.selection,n=Array.from(i.getSelectedBlocks());if(!n.length)return!1;if(this.value)return!0;for(const t of n)if(e.checkAttribute(t,"listType")||T(t,e))return!0;return!1}}class E extends t.Command{_direction;constructor(t,e){super(t),this._direction=e}refresh(){this.isEnabled=this._checkEnabled()}execute({shouldMergeOnBlocksContentLevel:t=!1}={}){const e=this.editor.model,i=e.document.selection,n=[];e.change(s=>{const{firstElement:r,lastElement:l}=this._getMergeSubjectElements(i,t),a=r.getAttribute("listIndent")||0,c=l.getAttribute("listIndent"),d=l.getAttribute("listItemId");if(a!=c){const t=(u=l,Array.from(new o(u,{direction:"forward",higherIndent:!0})));n.push(...w([l,...t],s,{indentBy:a-c,expand:a<c}))}var u;if(t){let t=i;i.isCollapsed&&(t=s.createSelection(s.createRange(s.createPositionAt(r,"end"),s.createPositionAt(l,0)))),e.deleteContent(t,{doNotResetEntireContent:i.isCollapsed});const o=t.getLastPosition().parent,a=o.nextSibling;n.push(o),a&&a!==l&&a.getAttribute("listItemId")==d&&n.push(...A(a,o,s))}else n.push(...A(l,r,s));this._fireAfterExecute(n)})}_fireAfterExecute(t){this.fire("afterExecute",v(new Set(t)))}_checkEnabled(){const t=this.editor.model,e=t.document.selection,i=_(t);if(e.isCollapsed||i){const t=i||e.getFirstPosition().parent;if(!d(t))return!1;const n="backward"==this._direction?t.previousSibling:t.nextSibling;if(!n)return!1;if(k([t,n]))return!1}else{const t=e.getLastPosition(),i=e.getFirstPosition();if(t.parent===i.parent)return!1;if(!d(t.parent))return!1}return!0}_getMergeSubjectElements(t,e){const i=_(this.editor.model);let n,s;if(t.isCollapsed||i){const r=i||t.getFirstPosition().parent,l=f(r);"backward"==this._direction?(s=r,n=l&&!e?o.first(r,{sameIndent:!0,lowerIndent:!0}):r.previousSibling):(n=r,s=r.nextSibling)}else n=t.getFirstPosition().parent,s=t.getLastPosition().parent;return{firstElement:n,lastElement:s}}}class V extends t.Command{_direction;constructor(t,e){super(t),this._direction=e}refresh(){this.isEnabled=this._checkEnabled()}execute(){this.editor.model.change(t=>{const e=y(this._getStartBlock(),t);this._fireAfterExecute(e)})}_fireAfterExecute(t){this.fire("afterExecute",v(new Set(t)))}_checkEnabled(){const t=this.editor.model.document.selection,e=this._getStartBlock();return t.isCollapsed&&d(e)&&!f(e)}_getStartBlock(){const t=this.editor.model.document.selection.getFirstPosition().parent;return"before"==this._direction?t:t.nextSibling}}class N extends t.Plugin{static get pluginName(){return"ListUtils"}static get isOfficialPlugin(){return!0}expandListBlocksToCompleteList(t){return h(t)}isFirstBlockOfListItem(t){return f(t)}isListItemBlock(t){return d(t)}expandListBlocksToCompleteItems(t,e={}){return b(t,e)}isNumberedListType(t){return L(t)}}function B(t){return t.is("element","ol")||t.is("element","ul")}function O(t){return t.is("element","li")}function R(t,e,i,n=M(i,e)){return t.createAttributeElement(F(i),null,{priority:2*e/100-100,id:n})}function D(t,e,i){return t.createAttributeElement("li",null,{priority:(2*e+1)/100-100,id:i})}function F(t){return"numbered"==t||"customNumbered"==t?"ol":"ul"}function M(t,e){return`list-${t}-${e}`}function z(t,e,i){const n=t.nodeBefore;if(d(n)){let t=n;for(const{node:s}of new l(t,"backward")){if(t=s,i.has(t))return;if(i.add(t),e.has(n))return}e.add(t)}else{const i=t.nodeAfter;d(i)&&e.add(i)}}function j(){return(t,e,i)=>{const{writer:n,schema:s}=i;if(!e.modelRange)return;const r=Array.from(e.modelRange.getItems({shallow:!0})).filter(t=>s.checkAttribute(t,"listItemId"));if(!r.length)return;const o=c.next(),l=function(t){let e=0,i=t.parent;for(;i;){if(O(i))e++;else{const t=i.previousSibling;t&&O(t)&&e++}i=i.parent}return e}(e.viewItem);let a=e.viewItem.parent&&e.viewItem.parent.is("element","ol")?"numbered":"bulleted";const d=r[0].getAttribute("listType");d&&(a=d);const u={listItemId:o,listIndent:l,listType:a};for(const t of r)t.hasAttribute("listItemId")||n.setAttributes(u,t);r.length>1&&r[1].getAttribute("listItemId")!=u.listItemId&&i.keepEmptyElement(r[0])}}function K(t,e,i,{dataPipeline:n}={}){const s=function(t){return(e,i)=>{const n=[];for(const i of t)e.hasAttribute(i)&&n.push(`attribute:${i}`);return!!n.every(t=>!1!==i.test(e,t))&&(n.forEach(t=>i.consume(e,t)),!0)}}(t);return(r,l,a)=>{const{writer:c,mapper:d,consumable:u}=a,m=l.item;if(!t.includes(l.attributeKey))return;if(!s(m,u))return;const p=function(t,e,i){const n=i.createRangeOn(t),s=e.toViewRange(n).getTrimmed();return s.end.nodeBefore}(m,d,i);q(p,c,d),function(t,e){let i=t.parent;for(;i.is("attributeElement")&&["ul","ol","li"].includes(i.name);){const n=i.parent;e.unwrap(e.createRangeOn(t),i),i=n}}(p,c);const g=function(t,e,i,n,{dataPipeline:s}){let r=n.createRangeOn(e);if(!f(t))return r;for(const o of i){if("itemMarker"!=o.scope)continue;const i=o.createElement(n,t,{dataPipeline:s});if(!i)continue;if(n.setCustomProperty("listItemMarker",!0,i),o.canInjectMarkerIntoElement&&o.canInjectMarkerIntoElement(t)?n.insert(n.createPositionAt(e,0),i):(n.insert(r.start,i),r=n.createRange(n.createPositionBefore(i),n.createPositionAfter(e))),!o.createWrapperElement||!o.canWrapElement)continue;const l=o.createWrapperElement(n,t,{dataPipeline:s});n.setCustomProperty("listItemWrapper",!0,l),o.canWrapElement(t)?r=n.wrap(r,l):(r=n.wrap(n.createRangeOn(i),l),r=n.createRange(r.start,n.createPositionAfter(e)))}return r}(m,p,e,c,{dataPipeline:n});!function(t,e,i,n){if(!t.hasAttribute("listIndent"))return;const s=t.getAttribute("listIndent");let r=t;for(let t=s;t>=0;t--){const s=D(n,t,r.getAttribute("listItemId")),l=R(n,t,r.getAttribute("listType"));for(const t of i)"list"!=t.scope&&"item"!=t.scope||!r.hasAttribute(t.attributeName)||t.setAttributeOnDowncast(n,r.getAttribute(t.attributeName),"list"==t.scope?l:s);if(e=n.wrap(e,s),e=n.wrap(e,l),0==t)break;if(r=o.first(r,{lowerIndent:!0}),!r)break}}(m,g,e,c)}}function U(t,{dataPipeline:e}={}){return(i,{writer:n})=>{if(!$(i,t))return null;if(!e)return n.createContainerElement("span",{class:"ck-list-bogus-paragraph"});const s=n.createContainerElement("p");return n.setCustomProperty("dataPipeline:transparentRendering",!0,s),s}}function q(t,e,i){for(;t.parent.is("attributeElement")&&t.parent.getCustomProperty("listItemWrapper");)e.unwrap(e.createRangeOn(t),t.parent);const n=[];s(e.createPositionBefore(t).getWalker({direction:"backward"})),s(e.createRangeIn(t).getWalker());for(const t of n)e.remove(t);function s(t){for(const{item:e}of t){if(e.is("element")&&i.toModelElement(e))break;e.is("element")&&e.getCustomProperty("listItemMarker")&&n.push(e)}}}function $(t,e,i=u(t)){if(!d(t))return!1;for(const i of t.getAttributeKeys())if(!i.startsWith("selection:")&&"htmlEmptyBlock"!=i&&!e.includes(i))return!1;return i.length<2}var W=i(331),G=i(591),H=i.n(G),Y=i(639),Z=i.n(Y),J=i(128),Q=i.n(J),X=i(21),tt=i.n(X),et=i(51),it=i.n(et),nt=i(358),st={attributes:{"data-cke":!0}};st.setAttributes=tt(),st.insert=Q().bind(null,"head"),st.domAPI=Z(),st.insertStyleElement=it();H()(nt.A,st);nt.A&&nt.A.locals&&nt.A.locals;var rt=i(137),ot={attributes:{"data-cke":!0}};ot.setAttributes=tt(),ot.insert=Q().bind(null,"head"),ot.domAPI=Z(),ot.insertStyleElement=it();H()(rt.A,ot);rt.A&&rt.A.locals&&rt.A.locals;const lt=["listType","listIndent","listItemId"];class at extends t.Plugin{_downcastStrategies=[];static get pluginName(){return"ListEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[s.Enter,e.Delete,N,W.ClipboardPipeline]}constructor(t){super(t),t.config.define("list.multiBlock",!0)}init(){const t=this.editor,e=t.model,i=t.config.get("list.multiBlock");if(t.plugins.has("LegacyListEditing"))throw new r.CKEditorError("list-feature-conflict",this,{conflictPlugin:"LegacyListEditing"});e.schema.register("$listItem",{allowAttributes:lt}),i?(e.schema.extend("$container",{allowAttributesOf:"$listItem"}),e.schema.extend("$block",{allowAttributesOf:"$listItem"}),e.schema.extend("$blockObject",{allowAttributesOf:"$listItem"})):e.schema.register("listItem",{inheritAllFrom:"$block",allowAttributesOf:"$listItem"});for(const t of lt)e.schema.setAttributeProperties(t,{copyOnReplace:!0});t.commands.add("numberedList",new P(t,"numbered")),t.commands.add("bulletedList",new P(t,"bulleted")),t.commands.add("customNumberedList",new P(t,"customNumbered",{multiLevel:!0})),t.commands.add("customBulletedList",new P(t,"customBulleted",{multiLevel:!0})),t.commands.add("indentList",new x(t,"forward")),t.commands.add("outdentList",new x(t,"backward")),t.commands.add("splitListItemBefore",new V(t,"before")),t.commands.add("splitListItemAfter",new V(t,"after")),i&&(t.commands.add("mergeListItemBackward",new E(t,"backward")),t.commands.add("mergeListItemForward",new E(t,"forward"))),this._setupDeleteIntegration(),this._setupEnterIntegration(),this._setupTabIntegration(),this._setupClipboardIntegration(),this._setupAccessibilityIntegration()}afterInit(){const t=this.editor.commands,e=t.get("indent"),i=t.get("outdent");e&&e.registerChildCommand(t.get("indentList"),{priority:"high"}),i&&i.registerChildCommand(t.get("outdentList"),{priority:"lowest"}),this._setupModelPostFixing(),this._setupConversion()}registerDowncastStrategy(t){this._downcastStrategies.push(t)}getListAttributeNames(){return[...lt,...this._downcastStrategies.map(t=>t.attributeName)]}_setupDeleteIntegration(){const t=this.editor,e=t.commands.get("mergeListItemBackward"),i=t.commands.get("mergeListItemForward");this.listenTo(t.editing.view.document,"delete",(n,s)=>{const r=t.model.document.selection;_(t.model)||t.model.change(()=>{const l=r.getFirstPosition();if(r.isCollapsed&&"backward"==s.direction){if(!l.isAtStart)return;const i=l.parent;if(!d(i))return;if(o.first(i,{sameAttributes:"listType",sameIndent:!0})||0!==i.getAttribute("listIndent")){if(!e||!e.isEnabled)return;e.execute({shouldMergeOnBlocksContentLevel:ct(t.model,"backward")})}else g(i)||t.execute("splitListItemAfter"),t.execute("outdentList");s.preventDefault(),n.stop()}else{if(r.isCollapsed&&!r.getLastPosition().isAtEnd)return;if(!i||!i.isEnabled)return;i.execute({shouldMergeOnBlocksContentLevel:ct(t.model,"forward")}),s.preventDefault(),n.stop()}})},{context:"li"})}_setupEnterIntegration(){const t=this.editor,e=t.model,i=t.commands,n=i.get("enter");this.listenTo(t.editing.view.document,"enter",(i,n)=>{const s=e.document,r=s.selection.getFirstPosition().parent;if(s.selection.isCollapsed&&d(r)&&r.isEmpty&&!n.isSoft){const e=f(r),s=g(r);e&&s?(t.execute("outdentList"),n.preventDefault(),i.stop()):e&&!s?(t.execute("splitListItemAfter"),n.preventDefault(),i.stop()):s&&(t.execute("splitListItemBefore"),n.preventDefault(),i.stop())}},{context:"li"}),this.listenTo(n,"afterExecute",()=>{const e=i.get("splitListItemBefore");if(e.refresh(),!e.isEnabled)return;2===u(t.model.document.selection.getLastPosition().parent).length&&e.execute()})}_setupTabIntegration(){const t=this.editor;this.listenTo(t.editing.view.document,"tab",(e,i)=>{const n=i.shiftKey?"outdentList":"indentList";this.editor.commands.get(n).isEnabled&&(t.execute(n),i.stopPropagation(),i.preventDefault(),e.stop())},{context:"li"})}_setupConversion(){const t=this.editor,e=t.model,i=this.getListAttributeNames(),n=t.config.get("list.multiBlock"),s=n?"paragraph":"listItem";t.conversion.for("upcast").elementToElement({view:"li",model:(t,{writer:e})=>e.createElement(s,{listType:""})}).elementToElement({view:"p",model:(t,{writer:e})=>t.parent&&t.parent.is("element","li")?e.createElement(s,{listType:""}):null,converterPriority:"high"}).add(t=>{t.on("element:li",j())}),n||t.conversion.for("downcast").elementToElement({model:"listItem",view:"p"}),t.conversion.for("editingDowncast").elementToElement({model:s,view:U(i),converterPriority:"high"}).add(t=>{var n;t.on("attribute",K(i,this._downcastStrategies,e)),t.on("remove",(n=e.schema,(t,e,i)=>{const{writer:s,mapper:r}=i,o=t.name.split(":")[1];if(!n.checkAttribute(o,"listItemId"))return;const l=r.toViewPosition(e.position),a=e.position.getShiftedBy(e.length),c=r.toViewPosition(a,{isPhantom:!0}),d=s.createRange(l,c).getTrimmed().end.nodeBefore;d&&q(d,s,r)}))}),t.conversion.for("dataDowncast").elementToElement({model:s,view:U(i,{dataPipeline:!0}),converterPriority:"high"}).add(t=>{t.on("attribute",K(i,this._downcastStrategies,e,{dataPipeline:!0}))});const r=(o=this._downcastStrategies,a=t.editing.view,(t,e)=>{if(e.modelPosition.offset>0)return;const i=e.modelPosition.parent;if(!d(i))return;if(!o.some(t=>"itemMarker"==t.scope&&t.canInjectMarkerIntoElement&&t.canInjectMarkerIntoElement(i)))return;const n=e.mapper.toViewElement(i),s=a.createRangeIn(n),r=s.getWalker();let l=s.start;for(const{item:t}of r){if(t.is("element")&&e.mapper.toModelElement(t)||t.is("$textProxy"))break;t.is("element")&&t.getCustomProperty("listItemMarker")&&(l=a.createPositionAfter(t),r.skip(({previousPosition:t})=>!t.isEqual(l)))}e.viewPosition=l});var o,a;t.editing.mapper.on("modelToViewPosition",r),t.data.mapper.on("modelToViewPosition",r),this.listenTo(e.document,"change:data",function(t,e,i,n){return()=>{const n=t.document.differ.getChanges(),o=[],l=new Set,a=new Set,c=new Set;for(const t of n)if("insert"==t.type&&"$text"!=t.name)z(t.position,l,c),t.attributes.has("listItemId")?a.add(t.position.nodeAfter):z(t.position.getShiftedBy(t.length),l,c);else if("remove"==t.type&&t.attributes.has("listItemId"))z(t.position,l,c);else if("attribute"==t.type){const e=t.range.start.nodeAfter;i.includes(t.attributeKey)?(z(t.range.start,l,c),null===t.attributeNewValue?(z(t.range.start.getShiftedBy(1),l,c),r(e)&&o.push(e)):a.add(e)):d(e)&&r(e)&&o.push(e)}for(const t of l.values())o.push(...s(t,a));for(const t of new Set(o))e.reconvertItem(t)};function s(t,e){const n=[],s=new Set,a=[];for(const{node:c,previous:d}of new l(t)){if(s.has(c))continue;const t=c.getAttribute("listIndent");d&&t<d.getAttribute("listIndent")&&(a.length=t+1),a[t]=Object.fromEntries(Array.from(c.getAttributes()).filter(([t])=>i.includes(t)));const l=m(c,{direction:"forward"});for(const t of l)s.add(t),(r(t,l)||o(t,a,e))&&n.push(t)}return n}function r(t,s){const r=e.mapper.toViewElement(t);if(!r)return!1;if(n.fire("checkElement",{modelElement:t,viewElement:r}))return!0;if(!t.is("element","paragraph")&&!t.is("element","listItem"))return!1;const o=$(t,i,s);return!(!o||!r.is("element","p"))||!(o||!r.is("element","span"))}function o(t,i,s){if(s.has(t))return!1;const r=e.mapper.toViewElement(t);let o=i.length-1;for(let t=r.parent;!t.is("editableElement");t=t.parent){const e=O(t),s=B(t);if(!s&&!e)continue;const r="checkAttributes:"+(e?"item":"list");if(n.fire(r,{viewElement:t,modelAttributes:i[o]}))break;if(s&&(o--,o<0))return!1}return!0}}(e,t.editing,i,this),{priority:"high"}),this.on("checkAttributes:item",(t,{viewElement:e,modelAttributes:i})=>{e.id!=i.listItemId&&(t.return=!0,t.stop())}),this.on("checkAttributes:list",(t,{viewElement:e,modelAttributes:i})=>{e.name==F(i.listType)&&e.id==M(i.listType,i.listIndent)||(t.return=!0,t.stop())})}_setupModelPostFixing(){const t=this.editor.model,e=this.getListAttributeNames();t.document.registerPostFixer(i=>function(t,e,i,n){const s=t.document.differ.getChanges(),r=new Set,o=new Set,l=n.editor.config.get("list.multiBlock");let c=!1;for(const n of s){if("insert"==n.type&&"$text"!=n.name){const s=n.position.nodeAfter;if(!t.schema.checkAttribute(s,"listItemId"))for(const t of Array.from(s.getAttributeKeys()))i.includes(t)&&(e.removeAttribute(t,s),c=!0);z(n.position,o,r),n.attributes.has("listItemId")||z(n.position.getShiftedBy(n.length),o,r);for(const{item:e,previousPosition:i}of t.createRangeIn(s))d(e)&&z(i,o,r)}else"remove"==n.type?z(n.position,o,r):"attribute"==n.type&&i.includes(n.attributeKey)&&(z(n.range.start,o,r),null===n.attributeNewValue&&z(n.range.start.getShiftedBy(1),o,r));if(!l&&"attribute"==n.type&&lt.includes(n.attributeKey)){const t=n.range.start.nodeAfter;null===n.attributeNewValue&&t&&t.is("element","listItem")?(e.rename(t,"paragraph"),c=!0):null===n.attributeOldValue&&t&&t.is("element")&&"listItem"!=t.name&&(e.rename(t,"listItem"),c=!0)}}const u=new Set;for(const t of o.values())c=n.fire("postFixer",{listNodes:new a(t),listHead:t,writer:e,seenIds:u})||c;return c}(t,i,e,this)),this.on("postFixer",(t,{listNodes:e,writer:i})=>{t.return=function(t,e){let i=0,n=-1,s=null,r=!1;for(const{node:o}of t){const t=o.getAttribute("listIndent");if(t>i){let l;null===s?(s=t-i,l=i):(s>t&&(s=t),l=t-s),l>n+1&&(l=n+1),e.setAttribute("listIndent",l,o),r=!0,n=l}else s=null,i=t+1,n=t}return r}(e,i)||t.return},{priority:"high"}),this.on("postFixer",(t,{listNodes:e,writer:i,seenIds:n})=>{t.return=function(t,e,i){const n=new Set;let s=!1;for(const{node:r}of t){if(n.has(r))continue;let t=r.getAttribute("listType"),o=r.getAttribute("listItemId");if(e.has(o)&&(o=c.next()),e.add(o),r.is("element","listItem"))r.getAttribute("listItemId")!=o&&(i.setAttribute("listItemId",o,r),s=!0);else for(const e of m(r,{direction:"forward"}))n.add(e),e.getAttribute("listType")!=t&&(o=c.next(),t=e.getAttribute("listType")),e.getAttribute("listItemId")!=o&&(i.setAttribute("listItemId",o,e),s=!0)}return s}(e,n,i)||t.return},{priority:"high"})}_setupClipboardIntegration(){const t=this.editor.model,e=this.editor.plugins.get("ClipboardPipeline");this.listenTo(t,"insertContent",function(t){return(e,[i,n])=>{const s=i.is("documentFragment")?Array.from(i.getChildren()):[i];if(!s.length)return;const r=(n?t.createSelection(n):t.document.selection).getFirstPosition();let o;if(d(r.parent))o=r.parent;else{if(!d(r.nodeBefore)||!d(r.nodeAfter))return;o=r.nodeBefore}t.change(t=>{const e=o.getAttribute("listType"),i=o.getAttribute("listIndent"),n=s[0].getAttribute("listIndent")||0,r=Math.max(i-n,0);for(const i of s){const n=d(i);o.is("element","listItem")&&i.is("element","paragraph")&&t.rename(i,"listItem"),t.setAttributes({listIndent:(n?i.getAttribute("listIndent"):0)+r,listItemId:n?i.getAttribute("listItemId"):c.next(),listType:e},i)}})}}(t),{priority:"high"}),this.listenTo(e,"outputTransformation",(e,i)=>{t.change(t=>{const e=Array.from(i.content.getChildren()),n=e[e.length-1];if(e.length>1&&n.is("element")&&n.isEmpty){e.slice(0,-1).every(d)&&t.remove(n)}if("copy"==i.method||"cut"==i.method){const e=Array.from(i.content.getChildren());k(e)&&I(e,t)}})})}_setupAccessibilityIntegration(){const t=this.editor,e=t.t;t.accessibility.addKeystrokeInfoGroup({id:"list",label:e("Keystrokes that can be used in a list"),keystrokes:[{label:e("Increase list item indent"),keystroke:"Tab"},{label:e("Decrease list item indent"),keystroke:"Shift+Tab"}]})}}function ct(t,e){const i=t.document.selection;if(!i.isCollapsed)return!_(t);if("forward"===e)return!0;const n=i.getFirstPosition().parent,s=n.previousSibling;return!t.schema.isObject(s)&&(!!s.isEmpty||k([n,s]))}var dt=i(311);function ut(t,e,i,n){t.ui.componentFactory.add(e,()=>{const s=mt(dt.ButtonView,t,e,i,n);return s.set({tooltip:!0,isToggleable:!0}),s}),t.ui.componentFactory.add(`menuBar:${e}`,()=>{const s=mt(dt.MenuBarMenuListItemButtonView,t,e,i,n);return s.set({role:"menuitemcheckbox",isToggleable:!0}),s})}function mt(t,e,i,n,s){const r=e.commands.get(i),o=new t(e.locale);return o.set({label:n,icon:s}),o.bind("isOn","isEnabled").to(r,"value","isEnabled"),o.on("execute",()=>{e.execute(i),e.editing.view.focus()}),o}var pt=i(355);class ft extends t.Plugin{static get pluginName(){return"ListUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor.t;this.editor.ui.componentFactory.has("numberedList")||ut(this.editor,"numberedList",t("Numbered List"),pt.IconNumberedList),this.editor.ui.componentFactory.has("bulletedList")||ut(this.editor,"bulletedList",t("Bulleted List"),pt.IconBulletedList)}}class gt extends t.Plugin{static get requires(){return[at,ft]}static get pluginName(){return"List"}static get isOfficialPlugin(){return!0}}class bt extends t.Command{refresh(){const t=this._getValue();this.value=t,this.isEnabled=null!=t}execute({startIndex:t=1}={}){const e=this.editor.model,i=e.document;let n=Array.from(i.selection.getSelectedBlocks()).filter(t=>d(t)&&L(t.getAttribute("listType")));n=h(n),e.change(e=>{for(const i of n)e.setAttribute("listStart",t>=0?t:1,i)})}_getValue(){const t=this.editor.model.document,e=(0,r.first)(t.selection.getSelectedBlocks());return e&&d(e)&&L(e.getAttribute("listType"))?e.getAttribute("listStart"):null}}const ht={},yt={},At={},wt=[{listStyle:"disc",typeAttribute:"disc",listType:"bulleted"},{listStyle:"circle",typeAttribute:"circle",listType:"bulleted"},{listStyle:"square",typeAttribute:"square",listType:"bulleted"},{listStyle:"decimal",typeAttribute:"1",listType:"numbered"},{listStyle:"decimal-leading-zero",typeAttribute:null,listType:"numbered"},{listStyle:"lower-roman",typeAttribute:"i",listType:"numbered"},{listStyle:"upper-roman",typeAttribute:"I",listType:"numbered"},{listStyle:"lower-alpha",typeAttribute:"a",listType:"numbered"},{listStyle:"upper-alpha",typeAttribute:"A",listType:"numbered"},{listStyle:"lower-latin",typeAttribute:"a",listType:"numbered"},{listStyle:"upper-latin",typeAttribute:"A",listType:"numbered"}];for(const{listStyle:t,typeAttribute:e,listType:i}of wt)ht[t]=i,yt[t]=e,e&&(At[e]=t);function It(){return wt.map(t=>t.listStyle)}function kt(t){return ht[t]||null}function vt(t){return At[t]||null}function _t(t){return yt[t]||null}function Tt(t){switch(t){case"lower-alpha":return"lower-latin";case"upper-alpha":return"upper-latin";default:return t}}class Lt extends t.Command{defaultType;_supportedTypes;constructor(t,e,i){super(t),this.defaultType=e,this._supportedTypes=i}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){const e=this.editor.model,i=e.document;e.change(e=>{this._tryToConvertItemsToList(t);let n=Array.from(i.selection.getSelectedBlocks()).filter(t=>t.hasAttribute("listType"));if(n.length){n=h(n);for(const i of n)e.setAttribute("listStyle",t.type||this.defaultType,i)}})}isStyleTypeSupported(t){return!this._supportedTypes||this._supportedTypes.includes(t)}_getValue(){const t=(0,r.first)(this.editor.model.document.selection.getSelectedBlocks());return d(t)?t.getAttribute("listStyle"):null}_checkEnabled(){const t=this.editor,e=t.commands.get("numberedList"),i=t.commands.get("bulletedList");return e.isEnabled||i.isEnabled}_tryToConvertItemsToList(t){if(!t.type)return;const e=kt(t.type);if(!e)return;const i=this.editor,n=`${e}List`;i.commands.get(n).value||i.execute(n)}}class St extends t.Command{refresh(){const t=this._getValue();this.value=t,this.isEnabled=null!=t}execute(t={}){const e=this.editor.model,i=e.document;let n=Array.from(i.selection.getSelectedBlocks()).filter(t=>d(t)&&"numbered"==t.getAttribute("listType"));n=h(n),e.change(e=>{for(const i of n)e.setAttribute("listReversed",!!t.reversed,i)})}_getValue(){const t=this.editor.model.document,e=(0,r.first)(t.selection.getSelectedBlocks());return d(e)&&"numbered"==e.getAttribute("listType")?e.getAttribute("listReversed"):null}}function xt(t){return(e,i,n)=>{const{writer:s,schema:r,consumable:o}=n;if(!1===o.test(i.viewItem,t.viewConsumables))return;i.modelRange||Object.assign(i,n.convertChildren(i.viewItem,i.modelCursor));let l=!1;for(const e of i.modelRange.getItems({shallow:!0}))r.checkAttribute(e,t.attributeName)&&t.appliesToListItem(e)&&(e.hasAttribute(t.attributeName)||(s.setAttribute(t.attributeName,t.getAttributeOnUpcast(i.viewItem),e),l=!0));l&&o.consume(i.viewItem,t.viewConsumables)}}class Ct extends t.Plugin{static get pluginName(){return"ListPropertiesUtils"}static get isOfficialPlugin(){return!0}getAllSupportedStyleTypes(){return It()}getListTypeFromListStyleType(t){return kt(t)}getListStyleTypeFromTypeAttribute(t){return vt(t)}getTypeAttributeFromListStyleType(t){return _t(t)}}function Pt(t){const{startIndex:e,reversed:i,styles:n}=t;return{styles:Et(n),startIndex:e||!1,reversed:i||!1}}function Et(t){const e={listTypes:["bulleted","numbered"],useAttribute:!1};return!0===t||(t?Array.isArray(t)||"string"==typeof t?e.listTypes=(0,r.toArray)(t):(e.listTypes=t.listTypes?(0,r.toArray)(t.listTypes):e.listTypes,e.useAttribute=!!t.useAttribute,t.listStyleTypes&&(e.listStyleTypes=t.listStyleTypes)):e.listTypes=[]),e}const Vt="default";class Nt extends t.Plugin{static get requires(){return[at,Ct]}static get pluginName(){return"ListPropertiesEditing"}static get isOfficialPlugin(){return!0}constructor(t){super(t),t.config.define("list.properties",{styles:!0,startIndex:!1,reversed:!1})}init(){const t=this.editor,e=t.model,i=t.plugins.get(at),n=function(t){const e=[],i=Pt(t);if(t.styles){const t=i.styles.useAttribute;e.push({attributeName:"listStyle",defaultValue:Vt,viewConsumables:{styles:"list-style-type"},addCommand(e){let i=It();t&&(i=i.filter(t=>!!_t(t))),e.commands.add("listStyle",new Lt(e,Vt,i))},appliesToListItem:t=>"numbered"==t.getAttribute("listType")||"bulleted"==t.getAttribute("listType"),hasValidAttribute(t){if(!this.appliesToListItem(t))return!t.hasAttribute("listStyle");if(!t.hasAttribute("listStyle"))return!1;const e=t.getAttribute("listStyle");return e==Vt||kt(e)==t.getAttribute("listType")},setAttributeOnDowncast(e,i,n){if(i&&i!==Vt){if(!t)return void e.setStyle("list-style-type",i,n);{const t=_t(i);if(t)return void e.setAttribute("type",t,n)}}e.removeStyle("list-style-type",n),e.removeAttribute("type",n)},getAttributeOnUpcast(t){const e=t.getStyle("list-style-type");if(e)return Tt(e);const i=t.getAttribute("type");return i?vt(i):Vt}})}t.reversed&&e.push({attributeName:"listReversed",defaultValue:!1,viewConsumables:{attributes:"reversed"},addCommand(t){t.commands.add("listReversed",new St(t))},appliesToListItem:t=>"numbered"==t.getAttribute("listType"),hasValidAttribute(t){return this.appliesToListItem(t)==t.hasAttribute("listReversed")},setAttributeOnDowncast(t,e,i){e?t.setAttribute("reversed","reversed",i):t.removeAttribute("reversed",i)},getAttributeOnUpcast:t=>t.hasAttribute("reversed")});t.startIndex&&e.push({attributeName:"listStart",defaultValue:1,viewConsumables:{attributes:"start"},addCommand(t){t.commands.add("listStart",new bt(t))},appliesToListItem:t=>L(t.getAttribute("listType")),hasValidAttribute(t){return this.appliesToListItem(t)==t.hasAttribute("listStart")},setAttributeOnDowncast(t,e,i){0==e||e>1?t.setAttribute("start",e,i):t.removeAttribute("start",i)},getAttributeOnUpcast(t){const e=t.getAttribute("start");return e>=0?e:1}});return e}(t.config.get("list.properties"));for(const s of n)s.addCommand(t),e.schema.extend("$listItem",{allowAttributes:s.attributeName}),i.registerDowncastStrategy({scope:"list",attributeName:s.attributeName,setAttributeOnDowncast(t,e,i){s.setAttributeOnDowncast(t,e,i)}});t.conversion.for("upcast").add(t=>{for(const e of n)t.on("element:ol",xt(e)),t.on("element:ul",xt(e))}),i.on("checkAttributes:list",(t,{viewElement:e,modelAttributes:i})=>{for(const s of n)s.getAttributeOnUpcast(e)!=i[s.attributeName]&&(t.return=!0,t.stop())}),this.listenTo(t.commands.get("indentList"),"afterExecute",(t,i)=>{e.change(t=>{for(const e of i)for(const i of n)i.appliesToListItem(e)&&t.setAttribute(i.attributeName,i.defaultValue,e)})}),i.on("postFixer",(t,{listNodes:e,writer:i})=>{for(const{node:s}of e)for(const e of n)e.hasValidAttribute(s)||(e.appliesToListItem(s)?i.setAttribute(e.attributeName,e.defaultValue,s):i.removeAttribute(e.attributeName,s),t.return=!0)}),i.on("postFixer",(t,{listNodes:e,writer:i})=>{for(const{node:s,previousNodeInList:r}of e)if(r&&r.getAttribute("listType")==s.getAttribute("listType"))for(const e of n){const{attributeName:n}=e;if(!e.appliesToListItem(s))continue;const o=r.getAttribute(n);s.getAttribute(n)!=o&&(i.setAttribute(n,o,s),t.return=!0)}})}}var Bt=i(266),Ot={attributes:{"data-cke":!0}};Ot.setAttributes=tt(),Ot.insert=Q().bind(null,"head"),Ot.domAPI=Z(),Ot.insertStyleElement=it();H()(Bt.A,Ot);Bt.A&&Bt.A.locals&&Bt.A.locals;class Rt extends dt.View{children;stylesView=null;additionalPropertiesCollapsibleView=null;startIndexFieldView=null;reversedSwitchButtonView=null;focusTracker=new r.FocusTracker;keystrokes=new r.KeystrokeHandler;focusables=new dt.ViewCollection;focusCycler;constructor(t,{enabledProperties:e,styleButtonViews:i,styleGridAriaLabel:n}){super(t);const s=["ck","ck-list-properties"];this.children=this.createCollection(),this.focusCycler=new dt.FocusCycler({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),i&&i.length?(this.stylesView=this._createStylesView(i,n),this.children.add(this.stylesView)):s.push("ck-list-properties_without-styles"),(e.startIndex||e.reversed)&&(this._addNumberedListPropertyViews(e),s.push("ck-list-properties_with-numbered-properties")),this.setTemplate({tag:"div",attributes:{class:s},children:this.children})}render(){if(super.render(),this.stylesView){this.focusables.add(this.stylesView),this.focusTracker.add(this.stylesView.element),(this.startIndexFieldView||this.reversedSwitchButtonView)&&(this.focusables.add(this.children.last.buttonView),this.focusTracker.add(this.children.last.buttonView.element));for(const t of this.stylesView.children)this.stylesView.focusTracker.add(t.element);(0,dt.addKeyboardHandlingForGrid)({keystrokeHandler:this.stylesView.keystrokes,focusTracker:this.stylesView.focusTracker,gridItems:this.stylesView.children,numberOfColumns:()=>r.global.window.getComputedStyle(this.stylesView.element).getPropertyValue("grid-template-columns").split(" ").length,uiLanguageDirection:this.locale&&this.locale.uiLanguageDirection})}if(this.startIndexFieldView){this.focusables.add(this.startIndexFieldView),this.focusTracker.add(this.startIndexFieldView.element);const t=t=>t.stopPropagation();this.keystrokes.set("arrowright",t),this.keystrokes.set("arrowleft",t),this.keystrokes.set("arrowup",t),this.keystrokes.set("arrowdown",t)}this.reversedSwitchButtonView&&(this.focusables.add(this.reversedSwitchButtonView),this.focusTracker.add(this.reversedSwitchButtonView.element)),this.keystrokes.listenTo(this.element)}focus(){this.focusCycler.focusFirst()}focusLast(){this.focusCycler.focusLast()}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createStylesView(t,e){const i=new dt.View(this.locale);return i.children=i.createCollection(),i.children.addMany(t),i.setTemplate({tag:"div",attributes:{"aria-label":e,class:["ck","ck-list-styles-list"]},children:i.children}),i.children.delegate("execute").to(this),i.focus=function(){for(const t of this.children)if(t instanceof dt.ButtonView&&t.isOn)return void t.focus();this.children.first.focus()},i.focusTracker=new r.FocusTracker,i.keystrokes=new r.KeystrokeHandler,i.render(),i.keystrokes.listenTo(i.element),i}_addNumberedListPropertyViews(t){const e=this.locale.t,i=[];t.startIndex&&(this.startIndexFieldView=this._createStartIndexField(),i.push(this.startIndexFieldView)),t.reversed&&(this.reversedSwitchButtonView=this._createReversedSwitchButton(),i.push(this.reversedSwitchButtonView)),this.stylesView?(this.additionalPropertiesCollapsibleView=new dt.CollapsibleView(this.locale,i),this.additionalPropertiesCollapsibleView.set({label:e("List properties"),isCollapsed:!0}),this.additionalPropertiesCollapsibleView.buttonView.bind("isEnabled").toMany(i,"isEnabled",(...t)=>t.some(t=>t)),this.additionalPropertiesCollapsibleView.buttonView.on("change:isEnabled",(t,e,i)=>{i||(this.additionalPropertiesCollapsibleView.isCollapsed=!0)}),this.children.add(this.additionalPropertiesCollapsibleView)):this.children.addMany(i)}_createStartIndexField(){const t=this.locale.t,e=new dt.LabeledFieldView(this.locale,dt.createLabeledInputNumber);return e.set({label:t("Start at"),class:"ck-numbered-list-properties__start-index"}),e.fieldView.set({min:0,step:1,value:1,inputMode:"numeric"}),e.fieldView.on("input",()=>{const i=e.fieldView.element,n=i.valueAsNumber;Number.isNaN(n)?e.errorText=t("Invalid start index value."):i.checkValidity()?this.fire("listStart",{startIndex:n}):e.errorText=t("Start index must be greater than 0.")}),e}_createReversedSwitchButton(){const t=this.locale.t,e=new dt.SwitchButtonView(this.locale);return e.set({withText:!0,label:t("Reversed order"),class:"ck-numbered-list-properties__reversed-order"}),e.delegate("execute").to(this,"listReversed"),e}}var Dt=i(263),Ft={attributes:{"data-cke":!0}};Ft.setAttributes=tt(),Ft.insert=Q().bind(null,"head"),Ft.domAPI=Z(),Ft.insertStyleElement=it();H()(Dt.A,Ft);Dt.A&&Dt.A.locals&&Dt.A.locals;class Mt extends t.Plugin{static get pluginName(){return"ListPropertiesUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=t.locale.t,i=t.config.get("list.properties"),n=Pt(i),s=n.styles.listTypes;if(s.includes("bulleted")){const i=[{label:e("Toggle the disc list style"),tooltip:e("Disc"),type:"disc",icon:pt.IconListStyleDisc},{label:e("Toggle the circle list style"),tooltip:e("Circle"),type:"circle",icon:pt.IconListStyleCircle},{label:e("Toggle the square list style"),tooltip:e("Square"),type:"square",icon:pt.IconListStyleSquare}],s=e("Bulleted List"),r=e("Bulleted list styles toolbar"),o="bulletedList";t.ui.componentFactory.add(o,zt({editor:t,normalizedConfig:n,parentCommandName:o,buttonLabel:s,buttonIcon:pt.IconBulletedList,styleGridAriaLabel:r,styleDefinitions:i})),t.ui.componentFactory.add(`menuBar:${o}`,Kt({editor:t,normalizedConfig:n,parentCommandName:o,buttonLabel:s,styleGridAriaLabel:r,styleDefinitions:i}))}if(s.includes("numbered")||i.startIndex||i.reversed){const i=[{label:e("Toggle the decimal list style"),tooltip:e("Decimal"),type:"decimal",icon:pt.IconListStyleDecimal},{label:e("Toggle the decimal with leading zero list style"),tooltip:e("Decimal with leading zero"),type:"decimal-leading-zero",icon:pt.IconListStyleDecimalLeadingZero},{label:e("Toggle the lower–roman list style"),tooltip:e("Lower–roman"),type:"lower-roman",icon:pt.IconListStyleLowerRoman},{label:e("Toggle the upper–roman list style"),tooltip:e("Upper-roman"),type:"upper-roman",icon:pt.IconListStyleUpperRoman},{label:e("Toggle the lower–latin list style"),tooltip:e("Lower-latin"),type:"lower-latin",icon:pt.IconListStyleLowerLatin},{label:e("Toggle the upper–latin list style"),tooltip:e("Upper-latin"),type:"upper-latin",icon:pt.IconListStyleUpperLatin}],r=e("Numbered List"),o=e("Numbered list styles toolbar"),l="numberedList";t.ui.componentFactory.add(l,zt({editor:t,normalizedConfig:n,parentCommandName:l,buttonLabel:r,buttonIcon:pt.IconNumberedList,styleGridAriaLabel:o,styleDefinitions:i})),s.includes("numbered")&&t.ui.componentFactory.add(`menuBar:${l}`,Kt({editor:t,normalizedConfig:n,parentCommandName:l,buttonLabel:r,styleGridAriaLabel:o,styleDefinitions:i}))}}}function zt({editor:t,normalizedConfig:e,parentCommandName:i,buttonLabel:n,buttonIcon:s,styleGridAriaLabel:r,styleDefinitions:o}){const l=t.commands.get(i);return a=>{const c=(0,dt.createDropdown)(a,dt.SplitButtonView),d=c.buttonView;return c.bind("isEnabled").to(l),c.class="ck-list-styles-dropdown",d.on("execute",()=>{t.execute(i),t.editing.view.focus()}),d.set({label:n,icon:s,tooltip:!0,isToggleable:!0}),d.bind("isOn").to(l,"value",t=>!!t),c.once("change:isOpen",()=>{const n=function({editor:t,normalizedConfig:e,dropdownView:i,parentCommandName:n,styleDefinitions:s,styleGridAriaLabel:r}){const o=t.locale,l={...e,..."numberedList"!=n?{startIndex:!1,reversed:!1}:null},a=n.replace("List","");let c=null;if(e.styles.listTypes.includes(a)){const i=t.commands.get("listStyle"),r=jt({editor:t,parentCommandName:n,listStyleCommand:i}),o=e.styles.listStyleTypes;let l=s;if(o){const t=o[a];t&&(l=s.filter(e=>t.includes(e.type)))}const d=Ut(i);c=l.filter(d).map(r)}const d=new Rt(o,{styleGridAriaLabel:r,enabledProperties:l,styleButtonViews:c});e.styles.listTypes.includes(a)&&(0,dt.focusChildOnDropdownOpen)(i,()=>d.stylesView.children.find(t=>t.isOn));if(l.startIndex){const e=t.commands.get("listStart");d.startIndexFieldView.bind("isEnabled").to(e),d.startIndexFieldView.fieldView.bind("value").to(e),d.on("listStart",(e,i)=>t.execute("listStart",i))}if(l.reversed){const e=t.commands.get("listReversed");d.reversedSwitchButtonView.bind("isEnabled").to(e),d.reversedSwitchButtonView.bind("isOn").to(e,"value",t=>!!t),d.on("listReversed",()=>{const i=e.value;t.execute("listReversed",{reversed:!i})})}return d.delegate("execute").to(i),d}({editor:t,normalizedConfig:e,dropdownView:c,parentCommandName:i,styleGridAriaLabel:r,styleDefinitions:o});c.panelView.children.add(n)}),c.on("execute",()=>{t.editing.view.focus()}),c}}function jt({editor:t,listStyleCommand:e,parentCommandName:i}){const n=t.locale,s=t.commands.get(i);return({label:r,type:o,icon:l,tooltip:a})=>{const c=new dt.ButtonView(n);return c.set({label:r,icon:l,tooltip:a}),c.bind("isOn").to(e,"value",t=>t===o),c.on("execute",()=>{s.value?e.value===o?t.execute(i):e.value!==o&&t.execute("listStyle",{type:o}):t.model.change(()=>{t.execute("listStyle",{type:o})})}),c}}function Kt({editor:t,normalizedConfig:e,parentCommandName:i,buttonLabel:n,styleGridAriaLabel:s,styleDefinitions:r}){return o=>{const l=new dt.MenuBarMenuView(o),a=t.commands.get(i),c=t.commands.get("listStyle"),d=Ut(c),u=jt({editor:t,parentCommandName:i,listStyleCommand:c}),m=e.styles.listStyleTypes;let p=r;if(m){const t=m[a.type];t&&(p=r.filter(e=>t.includes(e.type)))}const f=p.filter(d).map(u),g=new Rt(o,{styleGridAriaLabel:s,enabledProperties:{...e,startIndex:!1,reversed:!1},styleButtonViews:f});return g.delegate("execute").to(l),l.buttonView.set({label:n,icon:"bulletedList"===i?pt.IconBulletedList:pt.IconNumberedList}),l.panelView.children.add(g),l.bind("isEnabled").to(a,"isEnabled"),l.on("execute",()=>{t.editing.view.focus()}),l}}function Ut(t){return"function"==typeof t.isStyleTypeSupported?e=>t.isStyleTypeSupported(e.type):()=>!0}class qt extends t.Plugin{static get requires(){return[Nt,Mt]}static get pluginName(){return"ListProperties"}static get isOfficialPlugin(){return!0}}var $t=i(783);class Wt extends t.Command{constructor(t){super(t),this.on("execute",()=>{this.refresh()},{priority:"highest"})}refresh(){const t=this._getSelectedItems();this.value=this._getValue(t),this.isEnabled=!!t.length}execute(t={}){this.editor.model.change(e=>{const i=this._getSelectedItems(),n=void 0===t.forceValue?!this._getValue(i):t.forceValue;for(const t of i)n?e.setAttribute("todoListChecked",!0,t):e.removeAttribute("todoListChecked",t)})}_getValue(t){return t.every(t=>t.getAttribute("todoListChecked"))}_getSelectedItems(){const t=this.editor.model,e=t.schema,i=t.document.selection.getFirstRange(),n=i.start.parent,s=[];e.checkAttribute(n,"todoListChecked")&&s.push(...u(n));for(const t of i.getItems({shallow:!0}))e.checkAttribute(t,"todoListChecked")&&!s.includes(t)&&s.push(...u(t));return s}}class Gt extends $t.DomEventObserver{domEventType=["change"];onDomEvent(t){if(t.target){const e=this.view.domConverter.mapDomToView(t.target);e&&e.is("element","input")&&"checkbox"==e.getAttribute("type")&&e.findAncestor({classes:"todo-list__label"})&&this.fire("todoCheckboxChange",t)}}}const Ht=(0,r.parseKeystroke)("Ctrl+Enter");class Yt extends t.Plugin{static get pluginName(){return"TodoListEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[at]}init(){const t=this.editor,e=t.model,i=t.editing,n=t.plugins.get(at),s=t.config.get("list.multiBlock")?"paragraph":"listItem";t.commands.add("todoList",new P(t,"todo")),t.commands.add("checkTodoList",new Wt(t)),i.view.addObserver(Gt),e.schema.extend("$listItem",{allowAttributes:"todoListChecked"}),e.schema.addAttributeCheck(t=>{const e=t.last;if(!e.getAttribute("listItemId")||"todo"!=e.getAttribute("listType"))return!1},"todoListChecked"),t.conversion.for("upcast").add(t=>{t.on("element:input",(t,e,i)=>{const n=e.modelCursor,s=n.parent,r=e.viewItem;if(!i.consumable.test(r,{name:!0}))return;if("checkbox"!=r.getAttribute("type")||!n.isAtStart||!s.hasAttribute("listType"))return;i.consumable.consume(r,{name:!0});const o=i.writer;o.setAttribute("listType","todo",s),e.viewItem.hasAttribute("checked")&&o.setAttribute("todoListChecked",!0,s),e.modelRange=o.createRange(n)}),t.on("element:li",(t,e,i)=>{const{writer:n,schema:s}=i;if(!e.modelRange)return;const r=Array.from(e.modelRange.getItems({shallow:!0})).filter(t=>"todo"===t.getAttribute("listType")&&s.checkAttribute(t,"listItemId")).reduce((t,e)=>{const i=e.getAttribute("listItemId");return t.has(i)||t.set(i,u(e)),t},new Map);for(const[,t]of r.entries())if(t.some(t=>t.getAttribute("todoListChecked")))for(const e of t)n.setAttribute("todoListChecked",!0,e)},{priority:"low"}),t.on("element:label",Zt({name:"label",classes:"todo-list__label"})),t.on("element:label",Zt({name:"label",classes:["todo-list__label","todo-list__label_without-description"]})),t.on("element:span",Zt({name:"span",classes:"todo-list__label__description"})),t.on("element:ul",function(t){const e=new $t.Matcher(t);return(t,i,n)=>{const s=e.match(i.viewItem);if(!s)return;const r=s.match;r.name=!1,n.consumable.consume(i.viewItem,r)}}({name:"ul",classes:"todo-list"}))}),t.conversion.for("downcast").elementToElement({model:s,view:(t,{writer:e})=>{if(Jt(t,n.getListAttributeNames()))return e.createContainerElement("span",{class:"todo-list__label__description"})},converterPriority:"highest"}),n.registerDowncastStrategy({scope:"list",attributeName:"listType",setAttributeOnDowncast(t,e,i){"todo"==e?t.addClass("todo-list",i):t.removeClass("todo-list",i)}}),n.registerDowncastStrategy({scope:"itemMarker",attributeName:"todoListChecked",createElement(t,e,{dataPipeline:i}){if("todo"!=e.getAttribute("listType"))return null;const n=t.createUIElement("input",{type:"checkbox",...e.getAttribute("todoListChecked")?{checked:"checked"}:null,...i?{disabled:"disabled"}:{tabindex:"-1"}});if(i)return n;const s=t.createContainerElement("span",{contenteditable:"false"},n);return s.getFillerOffset=()=>null,s},canWrapElement:t=>Jt(t,n.getListAttributeNames()),createWrapperElement(t,e,{dataPipeline:i}){const s=["todo-list__label"];return Jt(e,n.getListAttributeNames())||s.push("todo-list__label_without-description"),t.createAttributeElement(i?"label":"span",{class:s.join(" ")})}}),n.on("checkElement",(t,{modelElement:e,viewElement:i})=>{const s=Jt(e,n.getListAttributeNames());i.hasClass("todo-list__label__description")!=s&&(t.return=!0,t.stop())}),n.on("checkElement",(e,{modelElement:i,viewElement:n})=>{const s="todo"==i.getAttribute("listType")&&f(i);let r=!1;const o=t.editing.view.createPositionBefore(n).getWalker({direction:"backward"});for(const{item:e}of o){if(e.is("element")&&t.editing.mapper.toModelElement(e))break;e.is("element","input")&&"checkbox"==e.getAttribute("type")&&(r=!0)}r!=s&&(e.return=!0,e.stop())}),n.on("postFixer",(t,{listNodes:e,writer:i})=>{for(const{node:n,previousNodeInList:s}of e){if(!s)continue;if(s.getAttribute("listItemId")!=n.getAttribute("listItemId"))continue;const e=s.hasAttribute("todoListChecked"),r=n.hasAttribute("todoListChecked");r&&!e?(i.removeAttribute("todoListChecked",n),t.return=!0):!r&&e&&(i.setAttribute("todoListChecked",!0,n),t.return=!0)}}),e.document.registerPostFixer(t=>{const i=e.document.differ.getChanges();let n=!1;for(const e of i)if("attribute"==e.type&&"listType"==e.attributeKey){const i=e.range.start.nodeAfter;"todo"==e.attributeOldValue&&i.hasAttribute("todoListChecked")&&(t.removeAttribute("todoListChecked",i),n=!0)}else if("insert"==e.type&&"$text"!=e.name)for(const{item:i}of t.createRangeOn(e.position.nodeAfter))i.is("element")&&"todo"!=i.getAttribute("listType")&&i.hasAttribute("todoListChecked")&&(t.removeAttribute("todoListChecked",i),n=!0);return n}),this.listenTo(i.view.document,"keydown",(e,i)=>{(0,r.getCode)(i)===Ht&&(t.execute("checkTodoList"),e.stop())},{priority:"high"}),this.listenTo(i.view.document,"todoCheckboxChange",(t,e)=>{const n=e.target;if(!n||!n.is("element","input"))return;const s=i.view.createPositionAfter(n),r=i.mapper.toModelPosition(s).parent;r&&d(r)&&"todo"==r.getAttribute("listType")&&this._handleCheckmarkChange(r)}),this.listenTo(i.view.document,"arrowKey",function(t,e){return(i,n)=>{const s=(0,r.getLocalizedArrowKeyCodeDirection)(n.keyCode,e.contentLanguageDirection),o=t.schema,l=t.document.selection;if(!l.isCollapsed)return;const a=l.getFirstPosition(),c=a.parent;if("right"==s&&a.isAtEnd){const e=o.getNearestSelectionRange(t.createPositionAfter(c),"forward");if(!e)return;const s=e.start.parent;s&&d(s)&&"todo"==s.getAttribute("listType")&&(t.change(t=>t.setSelection(e)),n.preventDefault(),n.stopPropagation(),i.stop())}else if("left"==s&&a.isAtStart&&d(c)&&"todo"==c.getAttribute("listType")){const e=o.getNearestSelectionRange(t.createPositionBefore(c),"backward");if(!e)return;t.change(t=>t.setSelection(e)),n.preventDefault(),n.stopPropagation(),i.stop()}}}(e,t.locale),{context:"$text"}),this.listenTo(i.mapper,"viewToModelPosition",(t,i)=>{const n=i.viewPosition.parent,s=n.is("attributeElement","li")&&0==i.viewPosition.offset,r=Qt(n)&&i.viewPosition.offset<=1,o=n.is("element","span")&&"false"==n.getAttribute("contenteditable")&&Qt(n.parent);if(!s&&!r&&!o)return;const l=i.modelPosition.nodeAfter;l&&"todo"==l.getAttribute("listType")&&(i.modelPosition=e.createPositionAt(l,0))},{priority:"low"}),this._initAriaAnnouncements()}_handleCheckmarkChange(t){const e=this.editor,i=e.model,n=Array.from(i.document.selection.getRanges());i.change(i=>{i.setSelection(t,"end"),e.execute("checkTodoList"),i.setSelection(n)})}_initAriaAnnouncements(){const{model:t,ui:e,t:i}=this.editor;let n=null;e&&t.document.selection.on("change:range",()=>{const s=t.document.selection.focus.parent,r=Xt(n),o=Xt(s);r&&!o?e.ariaLiveAnnouncer.announce(i("Leaving a to-do list")):!r&&o&&e.ariaLiveAnnouncer.announce(i("Entering a to-do list")),n=s})}}function Zt(t){const e=new $t.Matcher(t);return(t,i,n)=>{const s=e.match(i.viewItem);s&&n.consumable.consume(i.viewItem,s.match)&&Object.assign(i,n.convertChildren(i.viewItem,i.modelCursor))}}function Jt(t,e){return(t.is("element","paragraph")||t.is("element","listItem"))&&"todo"==t.getAttribute("listType")&&f(t)&&function(t,e){for(const i of t.getAttributeKeys())if(!i.startsWith("selection:")&&!e.includes(i))return!1;return!0}(t,e)}function Qt(t){return!!t&&t.is("attributeElement")&&t.hasClass("todo-list__label")}function Xt(t){return!!t&&(!(!t.is("element","paragraph")&&!t.is("element","listItem"))&&"todo"==t.getAttribute("listType"))}class te extends t.Plugin{static get pluginName(){return"TodoListUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor.t;ut(this.editor,"todoList",t("To-do List"),pt.IconTodoList)}}var ee=i(825),ie={attributes:{"data-cke":!0}};ie.setAttributes=tt(),ie.insert=Q().bind(null,"head"),ie.domAPI=Z(),ie.insertStyleElement=it();H()(ee.A,ie);ee.A&&ee.A.locals&&ee.A.locals;class ne extends t.Plugin{static get requires(){return[Yt,te]}static get pluginName(){return"TodoList"}static get isOfficialPlugin(){return!0}}class se extends t.Command{type;constructor(t,e){super(t),this.type=e}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){const e=this.editor.model,i=e.document,n=Array.from(i.selection.getSelectedBlocks()).filter(t=>oe(t,e.schema)),s=void 0!==t.forceValue?!t.forceValue:this.value;e.change(t=>{if(s){let e=n[n.length-1].nextSibling,i=Number.POSITIVE_INFINITY,s=[];for(;e&&"listItem"==e.name&&0!==e.getAttribute("listIndent");){const t=e.getAttribute("listIndent");t<i&&(i=t);const n=t-i;s.push({element:e,listIndent:n}),e=e.nextSibling}s=s.reverse();for(const e of s)t.setAttribute("listIndent",e.listIndent,e.element)}if(!s){let t=Number.POSITIVE_INFINITY;for(const e of n)e.is("element","listItem")&&e.getAttribute("listIndent")<t&&(t=e.getAttribute("listIndent"));t=0===t?1:t,re(n,!0,t),re(n,!1,t)}for(const e of n.reverse())s&&"listItem"==e.name?t.rename(e,"paragraph"):s||"listItem"==e.name?s||"listItem"!=e.name||e.getAttribute("listType")==this.type||t.setAttribute("listType",this.type,e):(t.setAttributes({listType:this.type,listIndent:0},e),t.rename(e,"listItem"));this.fire("_executeCleanup",n)})}_getValue(){const t=(0,r.first)(this.editor.model.document.selection.getSelectedBlocks());return!!t&&t.is("element","listItem")&&t.getAttribute("listType")==this.type}_checkEnabled(){if(this.value)return!0;const t=this.editor.model.document.selection,e=this.editor.model.schema,i=(0,r.first)(t.getSelectedBlocks());return!!i&&oe(i,e)}}function re(t,e,i){const n=e?t[0]:t[t.length-1];if(n.is("element","listItem")){let s=n[e?"previousSibling":"nextSibling"],r=n.getAttribute("listIndent");for(;s&&s.is("element","listItem")&&s.getAttribute("listIndent")>=i;)r>s.getAttribute("listIndent")&&(r=s.getAttribute("listIndent")),s.getAttribute("listIndent")==r&&t[e?"unshift":"push"](s),s=s[e?"previousSibling":"nextSibling"]}}function oe(t,e){return e.checkChild(t.parent,"listItem")&&!e.isObject(t)}class le extends t.Command{_indentBy;constructor(t,e){super(t),this._indentBy="forward"==e?1:-1}refresh(){this.isEnabled=this._checkEnabled()}execute(){const t=this.editor.model,e=t.document;let i=Array.from(e.selection.getSelectedBlocks());t.change(t=>{const e=i[i.length-1];let n=e.nextSibling;for(;n&&"listItem"==n.name&&n.getAttribute("listIndent")>e.getAttribute("listIndent");)i.push(n),n=n.nextSibling;this._indentBy<0&&(i=i.reverse());for(const e of i){const i=e.getAttribute("listIndent")+this._indentBy;i<0?t.rename(e,"paragraph"):t.setAttribute("listIndent",i,e)}this.fire("_executeCleanup",i)})}_checkEnabled(){const t=(0,r.first)(this.editor.model.document.selection.getSelectedBlocks());if(!t||!t.is("element","listItem"))return!1;if(this._indentBy>0){const e=t.getAttribute("listIndent"),i=t.getAttribute("listType");let n=t.previousSibling;for(;n&&n.is("element","listItem")&&n.getAttribute("listIndent")>=e;){if(n.getAttribute("listIndent")==e)return n.getAttribute("listType")==i;n=n.previousSibling}return!1}return!0}}function ae(t,e){const i=e.mapper,n=e.writer,s="numbered"==t.getAttribute("listType")?"ol":"ul",r=function(t){const e=t.createContainerElement("li");return e.getFillerOffset=Ae,e}(n),o=n.createContainerElement(s,null);return n.insert(n.createPositionAt(o,0),r),i.bindElements(t,r),r}function ce(t,e,i,n){const s=e.parent,r=i.mapper,o=i.writer;let l=r.toViewPosition(n.createPositionBefore(t));const a=me(t.previousSibling,{sameIndent:!0,smallerIndent:!0,listIndent:t.getAttribute("listIndent")}),c=t.previousSibling;if(a&&a.getAttribute("listIndent")==t.getAttribute("listIndent")){const t=r.toViewElement(a);l=o.breakContainer(o.createPositionAfter(t))}else if(c&&"listItem"==c.name){l=r.toViewPosition(n.createPositionAt(c,"end"));const t=r.findMappedViewAncestor(l),e=pe(t);l=e?o.createPositionBefore(e):o.createPositionAt(t,"end")}else l=r.toViewPosition(n.createPositionBefore(t));if(l=ue(l),o.insert(l,s),c&&"listItem"==c.name){const t=r.toViewElement(c),i=o.createRange(o.createPositionAt(t,0),l).getWalker({ignoreElementEnd:!0});for(const t of i)if(t.item.is("element","li")){const n=o.breakContainer(o.createPositionBefore(t.item)),s=t.item.parent,r=o.createPositionAt(e,"end");de(o,r.nodeBefore,r.nodeAfter),o.move(o.createRangeOn(s),r),i._position=n}}else{const i=s.nextSibling;if(i&&(i.is("element","ul")||i.is("element","ol"))){let n=null;for(const e of i.getChildren()){const i=r.toModelElement(e);if(!(i&&i.getAttribute("listIndent")>t.getAttribute("listIndent")))break;n=e}n&&(o.breakContainer(o.createPositionAfter(n)),o.move(o.createRangeOn(n.parent),o.createPositionAt(e,"end")))}}de(o,s,s.nextSibling),de(o,s.previousSibling,s)}function de(t,e,i){return!e||!i||"ul"!=e.name&&"ol"!=e.name||e.name!=i.name||e.getAttribute("class")!==i.getAttribute("class")?null:t.mergeContainers(t.createPositionAfter(e))}function ue(t){return t.getLastMatchingPosition(t=>t.item.is("uiElement"))}function me(t,e){const i=!!e.sameIndent,n=!!e.smallerIndent,s=e.listIndent;let r=t;for(;r&&"listItem"==r.name;){const t=r.getAttribute("listIndent");if(i&&s==t||n&&s>t)return r;r="forward"===e.direction?r.nextSibling:r.previousSibling}return null}function pe(t){for(const e of t.getChildren())if("ul"==e.name||"ol"==e.name)return e;return null}function fe(t,e){const i=[],n=t.parent,s={ignoreElementEnd:!1,startPosition:t,shallow:!0,direction:e},r=n.getAttribute("listIndent"),o=[...new $t.TreeWalker(s)].filter(t=>t.item.is("element")).map(t=>t.item);for(const t of o){if(!t.is("element","listItem"))break;if(t.getAttribute("listIndent")<r)break;if(!(t.getAttribute("listIndent")>r)){if(t.getAttribute("listType")!==n.getAttribute("listType"))break;if(t.getAttribute("listStyle")!==n.getAttribute("listStyle"))break;if(t.getAttribute("listReversed")!==n.getAttribute("listReversed"))break;if(t.getAttribute("listStart")!==n.getAttribute("listStart"))break;"backward"===e?i.unshift(t):i.push(t)}}return i}function ge(t){let e=[...t.document.selection.getSelectedBlocks()].filter(t=>t.is("element","listItem")).map(e=>{const i=t.change(t=>t.createPositionAt(e,0));return[...fe(i,"backward"),...fe(i,"forward")]}).flat();return e=[...new Set(e)],e}const be=["disc","circle","square"],he=["decimal","decimal-leading-zero","lower-roman","upper-roman","lower-latin","upper-latin"];function ye(t){return be.includes(t)?"bulleted":he.includes(t)?"numbered":null}function Ae(){const t=!this.isEmpty&&("ul"==this.getChild(0).name||"ol"==this.getChild(0).name);return this.isEmpty||t?0:$t.getFillerOffset.call(this)}class we extends t.Plugin{static get pluginName(){return"LegacyListUtils"}static get isOfficialPlugin(){return!0}getListTypeFromListStyleType(t){return ye(t)}getSelectedListItems(t){return ge(t)}getSiblingNodes(t,e){return fe(t,e)}}function Ie(t){return(e,i,n)=>{const s=n.consumable;if(!s.test(i.item,"insert")||!s.test(i.item,"attribute:listType")||!s.test(i.item,"attribute:listIndent"))return;s.consume(i.item,"insert"),s.consume(i.item,"attribute:listType"),s.consume(i.item,"attribute:listIndent");const r=i.item;ce(r,ae(r,n),n,t)}}const ke=(t,e,i)=>{if(!i.consumable.test(e.item,t.name))return;const n=i.mapper.toViewElement(e.item),s=i.writer;s.breakContainer(s.createPositionBefore(n)),s.breakContainer(s.createPositionAfter(n));const r=n.parent,o="numbered"==e.attributeNewValue?"ol":"ul";s.rename(o,r)},ve=(t,e,i)=>{i.consumable.consume(e.item,t.name);const n=i.mapper.toViewElement(e.item).parent,s=i.writer;de(s,n,n.nextSibling),de(s,n.previousSibling,n)};const _e=(t,e,i)=>{if(i.consumable.test(e.item,t.name)&&"listItem"!=e.item.name){let t=i.mapper.toViewPosition(e.range.start);const n=i.writer,s=[];for(;("ul"==t.parent.name||"ol"==t.parent.name)&&(t=n.breakContainer(t),"li"==t.parent.name);){const e=t,i=n.createPositionAt(t.parent,"end");if(!e.isEqual(i)){const t=n.remove(n.createRange(e,i));s.push(t)}t=n.createPositionAfter(t.parent)}if(s.length>0){for(let e=0;e<s.length;e++){const i=t.nodeBefore;if(t=n.insert(t,s[e]).end,e>0){const e=de(n,i,i.nextSibling);e&&e.parent==i&&t.offset--}}de(n,t.nodeBefore,t.nodeAfter)}}},Te=(t,e,i)=>{const n=i.mapper.toViewPosition(e.position),s=n.nodeBefore,r=n.nodeAfter;de(i.writer,s,r)},Le=(t,e,i)=>{if(i.consumable.consume(e.viewItem,{name:!0})){const t=i.writer,n=t.createElement("listItem"),s=function(t){let e=0,i=t.parent;for(;i;){if(i.is("element","li"))e++;else{const t=i.previousSibling;t&&t.is("element","li")&&e++}i=i.parent}return e}(e.viewItem);t.setAttribute("listIndent",s,n);const r=e.viewItem.parent&&"ol"==e.viewItem.parent.name?"numbered":"bulleted";if(t.setAttribute("listType",r,n),!i.safeInsert(n,e.modelCursor))return;const o=function(t,e,i){const{writer:n,schema:s}=i;let r=n.createPositionAfter(t);for(const o of e)if("ul"==o.name||"ol"==o.name)r=i.convertItem(o,r).modelCursor;else{const e=i.convertItem(o,n.createPositionAt(t,"end")),l=e.modelRange.start.nodeAfter;l&&l.is("element")&&!s.checkChild(t,l.name)&&(t=e.modelCursor.parent.is("element","listItem")?e.modelCursor.parent:Ee(e.modelCursor),r=n.createPositionAfter(t))}return r}(n,e.viewItem.getChildren(),i);e.modelRange=t.createRange(e.modelCursor,o),i.updateConversionResult(n,e)}},Se=(t,e,i)=>{if(i.consumable.test(e.viewItem,{name:!0})){const t=Array.from(e.viewItem.getChildren());for(const e of t){!(e.is("element","li")||Ne(e))&&e._remove()}}},xe=(t,e,i)=>{if(i.consumable.test(e.viewItem,{name:!0})){if(0===e.viewItem.childCount)return;const t=[...e.viewItem.getChildren()];let i=!1;for(const e of t)i&&!Ne(e)&&e._remove(),Ne(e)&&(i=!0)}};function Ce(t){return(e,i)=>{if(i.isPhantom)return;const n=i.modelPosition.nodeBefore;if(n&&n.is("element","listItem")){const e=i.mapper.toViewElement(n),s=e.getAncestors().find(Ne),r=t.createPositionAt(e,0).getWalker();for(const t of r){if("elementStart"==t.type&&t.item.is("element","li")){i.viewPosition=t.previousPosition;break}if("elementEnd"==t.type&&t.item==s){i.viewPosition=t.nextPosition;break}}}}}const Pe=function(t,[e,i]){const n=this;let s,r=e.is("documentFragment")?e.getChild(0):e;if(s=i?n.createSelection(i):n.document.selection,r&&r.is("element","listItem")){const t=s.getFirstPosition();let e=null;if(t.parent.is("element","listItem")?e=t.parent:t.nodeBefore&&t.nodeBefore.is("element","listItem")&&(e=t.nodeBefore),e){const t=e.getAttribute("listIndent");if(t>0)for(;r&&r.is("element","listItem");)r._setAttribute("listIndent",r.getAttribute("listIndent")+t),r=r.nextSibling}}};function Ee(t){const e=new $t.TreeWalker({startPosition:t});let i;do{i=e.next()}while(!i.value.item.is("element","listItem"));return i.value.item}function Ve(t,e,i,n,s,r){const o=me(e.nodeBefore,{sameIndent:!0,smallerIndent:!0,listIndent:t}),l=s.mapper,a=s.writer,c=o?o.getAttribute("listIndent"):null;let d;if(o)if(c==t){const t=l.toViewElement(o).parent;d=a.createPositionAfter(t)}else{const t=r.createPositionAt(o,"end");d=l.toViewPosition(t)}else d=i;d=ue(d);for(const t of[...n.getChildren()])Ne(t)&&(d=a.move(a.createRangeOn(t),d).end,de(a,t,t.nextSibling),de(a,t.previousSibling,t))}function Ne(t){return t.is("element","ol")||t.is("element","ul")}class Be extends t.Plugin{static get pluginName(){return"LegacyListEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[s.Enter,e.Delete,we]}init(){const t=this.editor;t.model.schema.register("listItem",{inheritAllFrom:"$block",allowAttributes:["listType","listIndent"]});const e=t.data,i=t.editing;var n;t.model.document.registerPostFixer(e=>function(t,e){const i=t.document.differ.getChanges(),n=new Map;let s=!1;for(const n of i)if("insert"==n.type&&"listItem"==n.name)r(n.position);else if("insert"==n.type&&"listItem"!=n.name){if("$text"!=n.name){const i=n.position.nodeAfter;i.hasAttribute("listIndent")&&(e.removeAttribute("listIndent",i),s=!0),i.hasAttribute("listType")&&(e.removeAttribute("listType",i),s=!0),i.hasAttribute("listStyle")&&(e.removeAttribute("listStyle",i),s=!0),i.hasAttribute("listReversed")&&(e.removeAttribute("listReversed",i),s=!0),i.hasAttribute("listStart")&&(e.removeAttribute("listStart",i),s=!0);for(const e of Array.from(t.createRangeIn(i)).filter(t=>t.item.is("element","listItem")))r(e.previousPosition)}r(n.position.getShiftedBy(n.length))}else"remove"==n.type&&"listItem"==n.name?r(n.position):("attribute"==n.type&&"listIndent"==n.attributeKey||"attribute"==n.type&&"listType"==n.attributeKey)&&r(n.range.start);for(const t of n.values())o(t),l(t);return s;function r(t){const e=t.nodeBefore;if(e&&e.is("element","listItem")){let t=e;if(n.has(t))return;for(let e=t.previousSibling;e&&e.is("element","listItem");e=t.previousSibling)if(t=e,n.has(t))return;n.set(e,t)}else{const e=t.nodeAfter;e&&e.is("element","listItem")&&n.set(e,e)}}function o(t){let i=0,n=null;for(;t&&t.is("element","listItem");){const r=t.getAttribute("listIndent");if(r>i){let o;null===n?(n=r-i,o=i):(n>r&&(n=r),o=r-n),e.setAttribute("listIndent",o,t),s=!0}else n=null,i=t.getAttribute("listIndent")+1;t=t.nextSibling}}function l(t){let i=[],n=null;for(;t&&t.is("element","listItem");){const r=t.getAttribute("listIndent");if(n&&n.getAttribute("listIndent")>r&&(i=i.slice(0,r+1)),0!=r)if(i[r]){const n=i[r];t.getAttribute("listType")!=n&&(e.setAttribute("listType",n,t),s=!0)}else i[r]=t.getAttribute("listType");n=t,t=t.nextSibling}}}(t.model,e)),i.mapper.registerViewToModelLength("li",Oe),e.mapper.registerViewToModelLength("li",Oe),i.mapper.on("modelToViewPosition",Ce(i.view)),i.mapper.on("viewToModelPosition",(n=t.model,(t,e)=>{const i=e.viewPosition,s=i.parent,r=e.mapper;if("ul"==s.name||"ol"==s.name){if(i.isAtEnd){const t=r.toModelElement(i.nodeBefore),s=r.getModelLength(i.nodeBefore);e.modelPosition=n.createPositionBefore(t).getShiftedBy(s)}else{const t=r.toModelElement(i.nodeAfter);e.modelPosition=n.createPositionBefore(t)}t.stop()}else if("li"==s.name&&i.nodeBefore&&("ul"==i.nodeBefore.name||"ol"==i.nodeBefore.name)){const o=r.toModelElement(s);let l=1,a=i.nodeBefore;for(;a&&Ne(a);)l+=r.getModelLength(a),a=a.previousSibling;e.modelPosition=n.createPositionBefore(o).getShiftedBy(l),t.stop()}})),e.mapper.on("modelToViewPosition",Ce(i.view)),t.conversion.for("editingDowncast").add(e=>{e.on("insert",_e,{priority:"high"}),e.on("insert:listItem",Ie(t.model)),e.on("attribute:listType:listItem",ke,{priority:"high"}),e.on("attribute:listType:listItem",ve,{priority:"low"}),e.on("attribute:listIndent:listItem",function(t){return(e,i,n)=>{if(!n.consumable.consume(i.item,"attribute:listIndent"))return;const s=n.mapper.toViewElement(i.item),r=n.writer;r.breakContainer(r.createPositionBefore(s)),r.breakContainer(r.createPositionAfter(s));const o=s.parent,l=o.previousSibling,a=r.createRangeOn(o);r.remove(a),l&&l.nextSibling&&de(r,l,l.nextSibling),Ve(i.attributeOldValue+1,i.range.start,a.start,s,n,t),ce(i.item,s,n,t);for(const t of i.item.getChildren())n.consumable.consume(t,"insert")}}(t.model)),e.on("remove:listItem",function(t){return(e,i,n)=>{const s=n.mapper.toViewPosition(i.position).getLastMatchingPosition(t=>!t.item.is("element","li")).nodeAfter,r=n.writer;r.breakContainer(r.createPositionBefore(s)),r.breakContainer(r.createPositionAfter(s));const o=s.parent,l=o.previousSibling,a=r.createRangeOn(o),c=r.remove(a);l&&l.nextSibling&&de(r,l,l.nextSibling),Ve(n.mapper.toModelElement(s).getAttribute("listIndent")+1,i.position,a.start,s,n,t);for(const t of r.createRangeIn(c).getItems())n.mapper.unbindViewElement(t);e.stop()}}(t.model)),e.on("remove",Te,{priority:"low"})}),t.conversion.for("dataDowncast").add(e=>{e.on("insert",_e,{priority:"high"}),e.on("insert:listItem",Ie(t.model))}),t.conversion.for("upcast").add(t=>{t.on("element:ul",Se,{priority:"high"}),t.on("element:ol",Se,{priority:"high"}),t.on("element:li",xe,{priority:"high"}),t.on("element:li",Le)}),t.model.on("insertContent",Pe,{priority:"high"}),t.commands.add("numberedList",new se(t,"numbered")),t.commands.add("bulletedList",new se(t,"bulleted")),t.commands.add("indentList",new le(t,"forward")),t.commands.add("outdentList",new le(t,"backward"));const s=i.view.document;this.listenTo(s,"enter",(t,e)=>{const i=this.editor.model.document,n=i.selection.getLastPosition().parent;i.selection.isCollapsed&&"listItem"==n.name&&n.isEmpty&&(this.editor.execute("outdentList"),e.preventDefault(),t.stop())},{context:"li"}),this.listenTo(s,"delete",(t,e)=>{if("backward"!==e.direction)return;const i=this.editor.model.document.selection;if(!i.isCollapsed)return;const n=i.getFirstPosition();if(!n.isAtStart)return;const s=n.parent;if("listItem"!==s.name)return;s.previousSibling&&"listItem"===s.previousSibling.name||(this.editor.execute("outdentList"),e.preventDefault(),t.stop())},{context:"li"}),this.listenTo(t.editing.view.document,"tab",(e,i)=>{const n=i.shiftKey?"outdentList":"indentList";this.editor.commands.get(n).isEnabled&&(t.execute(n),i.stopPropagation(),i.preventDefault(),e.stop())},{context:"li"})}afterInit(){const t=this.editor.commands,e=t.get("indent"),i=t.get("outdent");e&&e.registerChildCommand(t.get("indentList")),i&&i.registerChildCommand(t.get("outdentList"))}}function Oe(t){let e=1;for(const i of t.getChildren())if("ul"==i.name||"ol"==i.name)for(const t of i.getChildren())e+=Oe(t);return e}class Re extends t.Plugin{static get requires(){return[Be,ft]}static get pluginName(){return"LegacyList"}static get isOfficialPlugin(){return!0}}class De extends t.Command{defaultType;constructor(t,e){super(t),this.defaultType=e}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){this._tryToConvertItemsToList(t);const e=this.editor.model,i=ge(e);i.length&&e.change(e=>{for(const n of i)e.setAttribute("listStyle",t.type||this.defaultType,n)})}_getValue(){const t=this.editor.model.document.selection.getFirstPosition().parent;return t&&t.is("element","listItem")?t.getAttribute("listStyle"):null}_checkEnabled(){const t=this.editor,e=t.commands.get("numberedList"),i=t.commands.get("bulletedList");return e.isEnabled||i.isEnabled}_tryToConvertItemsToList(t){if(!t.type)return;const e=ye(t.type);if(!e)return;const i=this.editor,n=`${e}List`;i.commands.get(n).value||i.execute(n)}}class Fe extends t.Command{refresh(){const t=this._getValue();this.value=t,this.isEnabled=null!=t}execute(t={}){const e=this.editor.model,i=ge(e).filter(t=>"numbered"==t.getAttribute("listType"));e.change(e=>{for(const n of i)e.setAttribute("listReversed",!!t.reversed,n)})}_getValue(){const t=this.editor.model.document.selection.getFirstPosition().parent;return t&&t.is("element","listItem")&&"numbered"==t.getAttribute("listType")?t.getAttribute("listReversed"):null}}class Me extends t.Command{refresh(){const t=this._getValue();this.value=t,this.isEnabled=null!=t}execute({startIndex:t=1}={}){const e=this.editor.model,i=ge(e).filter(t=>"numbered"==t.getAttribute("listType"));e.change(e=>{for(const n of i)e.setAttribute("listStart",t>=0?t:1,n)})}_getValue(){const t=this.editor.model.document.selection.getFirstPosition().parent;return t&&t.is("element","listItem")&&"numbered"==t.getAttribute("listType")?t.getAttribute("listStart"):null}}const ze="default";class je extends t.Plugin{static get requires(){return[Be]}static get pluginName(){return"LegacyListPropertiesEditing"}static get isOfficialPlugin(){return!0}constructor(t){super(t),t.config.define("list",{properties:{styles:!0,startIndex:!1,reversed:!1}})}init(){const t=this.editor,e=t.model,i=function(t){const e=[];t.styles&&e.push({attributeName:"listStyle",defaultValue:ze,addCommand(t){t.commands.add("listStyle",new De(t,ze))},appliesToListItem:()=>!0,setAttributeOnDowncast(t,e,i){e&&e!==ze?t.setStyle("list-style-type",e,i):t.removeStyle("list-style-type",i)},getAttributeOnUpcast:t=>Tt(t.getStyle("list-style-type"))||ze});t.reversed&&e.push({attributeName:"listReversed",defaultValue:!1,addCommand(t){t.commands.add("listReversed",new Fe(t))},appliesToListItem:t=>"numbered"==t.getAttribute("listType"),setAttributeOnDowncast(t,e,i){e?t.setAttribute("reversed","reversed",i):t.removeAttribute("reversed",i)},getAttributeOnUpcast:t=>t.hasAttribute("reversed")});t.startIndex&&e.push({attributeName:"listStart",defaultValue:1,addCommand(t){t.commands.add("listStart",new Me(t))},appliesToListItem:t=>"numbered"==t.getAttribute("listType"),setAttributeOnDowncast(t,e,i){0==e||e>1?t.setAttribute("start",e,i):t.removeAttribute("start",i)},getAttributeOnUpcast(t){const e=t.getAttribute("start");return e>=0?e:1}});return e}(t.config.get("list.properties"));e.schema.extend("listItem",{allowAttributes:i.map(t=>t.attributeName)});for(const e of i)e.addCommand(t);var n;this.listenTo(t.commands.get("indentList"),"_executeCleanup",function(t,e){return(i,n)=>{const s=n[0],r=s.getAttribute("listIndent"),o=n.filter(t=>t.getAttribute("listIndent")===r);let l=null;s.previousSibling.getAttribute("listIndent")+1!==r&&(l=me(s.previousSibling,{sameIndent:!0,direction:"backward",listIndent:r})),t.model.change(t=>{for(const i of o)for(const n of e)if(n.appliesToListItem(i)){const e=null==l?n.defaultValue:l.getAttribute(n.attributeName);t.setAttribute(n.attributeName,e,i)}})}}(t,i)),this.listenTo(t.commands.get("outdentList"),"_executeCleanup",function(t,e){return(i,n)=>{if(!(n=n.reverse().filter(t=>t.is("element","listItem"))).length)return;const s=n[0].getAttribute("listIndent"),r=n[0].getAttribute("listType");let o=n[0].previousSibling;if(o.is("element","listItem"))for(;o.getAttribute("listIndent")!==s;)o=o.previousSibling;else o=null;o||(o=n[n.length-1].nextSibling),o&&o.is("element","listItem")&&o.getAttribute("listType")===r&&t.model.change(t=>{const i=n.filter(t=>t.getAttribute("listIndent")===s);for(const n of i)for(const i of e)if(i.appliesToListItem(n)){const e=i.attributeName,s=o.getAttribute(e);t.setAttribute(e,s,n)}})}}(t,i)),this.listenTo(t.commands.get("bulletedList"),"_executeCleanup",qe(t)),this.listenTo(t.commands.get("numberedList"),"_executeCleanup",qe(t)),e.document.registerPostFixer(function(t,e){return i=>{let n=!1;const s=$e(t.model.document.differ.getChanges()).filter(t=>"todo"!==t.getAttribute("listType"));if(!s.length)return n;let r=s[s.length-1].nextSibling;if((!r||!r.is("element","listItem"))&&(r=s[0].previousSibling,r)){const t=s[0].getAttribute("listIndent");for(;r.is("element","listItem")&&r.getAttribute("listIndent")!==t&&(r=r.previousSibling,r););}for(const t of e){const e=t.attributeName;for(const o of s)if(t.appliesToListItem(o))if(o.hasAttribute(e)){const s=o.previousSibling;Ue(s,o,t.attributeName)&&(i.setAttribute(e,s.getAttribute(e),o),n=!0)}else Ke(r,o,t)?i.setAttribute(e,r.getAttribute(e),o):i.setAttribute(e,t.defaultValue,o),n=!0;else i.removeAttribute(e,o)}return n}}(t,i)),t.conversion.for("upcast").add((n=i,t=>{t.on("element:li",(t,e,i)=>{if(!e.modelRange)return;const s=e.viewItem.parent,r=e.modelRange.start.nodeAfter||e.modelRange.end.nodeBefore;for(const t of n)if(t.appliesToListItem(r)){const e=t.getAttributeOnUpcast(s);i.writer.setAttribute(t.attributeName,e,r)}},{priority:"low"})})),t.conversion.for("downcast").add(function(t){return i=>{for(const n of t)i.on(`attribute:${n.attributeName}:listItem`,(t,i,s)=>{const r=s.writer,o=i.item,l=me(o.previousSibling,{sameIndent:!0,listIndent:o.getAttribute("listIndent"),direction:"backward"}),a=s.mapper.toViewElement(o);e(o,l)||r.breakContainer(r.createPositionBefore(a)),n.setAttributeOnDowncast(r,i.attributeNewValue,a.parent)},{priority:"low"})};function e(t,e){return e&&t.getAttribute("listType")===e.getAttribute("listType")&&t.getAttribute("listIndent")===e.getAttribute("listIndent")&&t.getAttribute("listStyle")===e.getAttribute("listStyle")&&t.getAttribute("listReversed")===e.getAttribute("listReversed")&&t.getAttribute("listStart")===e.getAttribute("listStart")}}(i)),this._mergeListAttributesWhileMergingLists(i)}afterInit(){const t=this.editor;t.commands.get("todoList")&&t.model.document.registerPostFixer(function(t){return e=>{const i=$e(t.model.document.differ.getChanges()).filter(t=>"todo"===t.getAttribute("listType")&&(t.hasAttribute("listStyle")||t.hasAttribute("listReversed")||t.hasAttribute("listStart")));if(!i.length)return!1;for(const t of i)e.removeAttribute("listStyle",t),e.removeAttribute("listReversed",t),e.removeAttribute("listStart",t);return!0}}(t))}_mergeListAttributesWhileMergingLists(t){const e=this.editor.model;let i;this.listenTo(e,"deleteContent",(t,[e])=>{const n=e.getFirstPosition(),s=e.getLastPosition();if(n.parent===s.parent)return;if(!n.parent.is("element","listItem"))return;const r=s.parent.nextSibling;if(!r||!r.is("element","listItem"))return;const o=me(n.parent,{sameIndent:!0,listIndent:r.getAttribute("listIndent")});o&&o.getAttribute("listType")===r.getAttribute("listType")&&(i=o)},{priority:"high"}),this.listenTo(e,"deleteContent",()=>{i&&(e.change(e=>{const n=me(i.nextSibling,{sameIndent:!0,listIndent:i.getAttribute("listIndent"),direction:"forward"});if(!n)return void(i=null);const s=[n,...fe(e.createPositionAt(n,0),"forward")];for(const n of s)for(const s of t)if(s.appliesToListItem(n)){const t=s.attributeName,r=i.getAttribute(t);e.setAttribute(t,r,n)}}),i=null)},{priority:"low"})}}function Ke(t,e,i){if(!t)return!1;const n=t.getAttribute(i.attributeName);return!!n&&(n!=i.defaultValue&&t.getAttribute("listType")===e.getAttribute("listType"))}function Ue(t,e,i){if(!t||!t.is("element","listItem"))return!1;if(e.getAttribute("listType")!==t.getAttribute("listType"))return!1;const n=t.getAttribute("listIndent");if(n<1||n!==e.getAttribute("listIndent"))return!1;const s=t.getAttribute(i);return!(!s||s===e.getAttribute(i))}function qe(t){return(e,i)=>{i=i.filter(t=>t.is("element","listItem")),t.model.change(t=>{for(const e of i)t.removeAttribute("listStyle",e)})}}function $e(t){const e=[];for(const i of t){const t=We(i);t&&t.is("element","listItem")&&e.push(t)}return e}function We(t){return"attribute"===t.type?t.range.start.nodeAfter:"insert"===t.type?t.position.nodeAfter:null}class Ge extends t.Plugin{static get requires(){return[je,Mt]}static get pluginName(){return"LegacyListProperties"}static get isOfficialPlugin(){return!0}}const He="todoListChecked";class Ye extends t.Command{_selectedElements;constructor(t){super(t),this._selectedElements=[],this.on("execute",()=>{this.refresh()},{priority:"highest"})}refresh(){this._selectedElements=this._getSelectedItems(),this.value=this._selectedElements.every(t=>!!t.getAttribute(He)),this.isEnabled=!!this._selectedElements.length}_getSelectedItems(){const t=this.editor.model,e=t.schema,i=t.document.selection.getFirstRange(),n=i.start.parent,s=[];e.checkAttribute(n,He)&&s.push(n);for(const t of i.getItems())e.checkAttribute(t,He)&&!s.includes(t)&&s.push(t);return s}execute(t={}){this.editor.model.change(e=>{for(const i of this._selectedElements){(void 0===t.forceValue?!this.value:t.forceValue)?e.setAttribute(He,!0,i):e.removeAttribute(He,i)}})}}const Ze=(t,e,i)=>{const n=e.modelCursor,s=n.parent,r=e.viewItem;if("checkbox"!=r.getAttribute("type")||"listItem"!=s.name||!n.isAtStart)return;if(!i.consumable.consume(r,{name:!0}))return;const o=i.writer;o.setAttribute("listType","todo",s),e.viewItem.hasAttribute("checked")&&o.setAttribute("todoListChecked",!0,s),e.modelRange=o.createRange(n)};function Je(t){return(e,i)=>{const n=i.modelPosition,s=n.parent;if(!s.is("element","listItem")||"todo"!=s.getAttribute("listType"))return;const r=Xe(i.mapper.toViewElement(s),t);r&&(i.viewPosition=i.mapper.findPositionIn(r,n.offset))}}function Qe(t,e,i,n){return e.createUIElement("label",{class:"todo-list__label",contenteditable:!1},function(e){const s=(0,r.createElement)(document,"input",{type:"checkbox",tabindex:"-1"});i&&s.setAttribute("checked","checked"),s.addEventListener("change",()=>n(t));const o=this.toDomElement(e);return o.appendChild(s),o})}function Xe(t,e){const i=e.createRangeIn(t);for(const t of i)if(t.item.is("containerElement","span")&&t.item.hasClass("todo-list__label__description"))return t.item}const ti=(0,r.parseKeystroke)("Ctrl+Enter");class ei extends t.Plugin{static get pluginName(){return"LegacyTodoListEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[Be]}init(){const t=this.editor,{editing:e,data:i,model:n}=t;n.schema.extend("listItem",{allowAttributes:["todoListChecked"]}),n.schema.addAttributeCheck((t,e)=>{const i=t.last;if("todoListChecked"==e&&"listItem"==i.name&&"todo"!=i.getAttribute("listType"))return!1}),t.commands.add("todoList",new se(t,"todo"));const s=new Ye(t);var o,l;t.commands.add("checkTodoList",s),t.commands.add("todoListCheck",s),i.downcastDispatcher.on("insert:listItem",function(t){return(e,i,n)=>{const s=n.consumable;if(!s.test(i.item,"insert")||!s.test(i.item,"attribute:listType")||!s.test(i.item,"attribute:listIndent"))return;if("todo"!=i.item.getAttribute("listType"))return;const r=i.item;s.consume(r,"insert"),s.consume(r,"attribute:listType"),s.consume(r,"attribute:listIndent"),s.consume(r,"attribute:todoListChecked");const o=n.writer,l=ae(r,n);o.addClass("todo-list",l.parent);const a=o.createContainerElement("label",{class:"todo-list__label"}),c=o.createEmptyElement("input",{type:"checkbox",disabled:"disabled"}),d=o.createContainerElement("span",{class:"todo-list__label__description"});r.getAttribute("todoListChecked")&&o.setAttribute("checked","checked",c),o.insert(o.createPositionAt(l,0),a),o.insert(o.createPositionAt(a,0),c),o.insert(o.createPositionAfter(c),d),ce(r,l,n,t)}}(n),{priority:"high"}),i.upcastDispatcher.on("element:input",Ze,{priority:"high"}),e.downcastDispatcher.on("insert:listItem",function(t,e){return(i,n,s)=>{const r=s.consumable;if(!r.test(n.item,"insert")||!r.test(n.item,"attribute:listType")||!r.test(n.item,"attribute:listIndent"))return;if("todo"!=n.item.getAttribute("listType"))return;const o=n.item;r.consume(o,"insert"),r.consume(o,"attribute:listType"),r.consume(o,"attribute:listIndent"),r.consume(o,"attribute:todoListChecked");const l=s.writer,a=ae(o,s),c=!!o.getAttribute("todoListChecked"),d=Qe(o,l,c,e),u=l.createContainerElement("span",{class:"todo-list__label__description"});l.addClass("todo-list",a.parent),l.insert(l.createPositionAt(a,0),d),l.insert(l.createPositionAfter(d),u),ce(o,a,s,t)}}(n,t=>this._handleCheckmarkChange(t)),{priority:"high"}),e.downcastDispatcher.on("attribute:listType:listItem",(o=t=>this._handleCheckmarkChange(t),l=e.view,(t,e,i)=>{if(!i.consumable.consume(e.item,t.name))return;const n=i.mapper.toViewElement(e.item),s=i.writer,r=function(t,e){const i=e.createRangeIn(t);for(const t of i)if(t.item.is("uiElement","label"))return t.item}(n,l);if("todo"==e.attributeNewValue){const t=!!e.item.getAttribute("todoListChecked"),i=Qe(e.item,s,t,o),r=s.createContainerElement("span",{class:"todo-list__label__description"}),l=s.createRangeIn(n),a=pe(n),c=ue(l.start),d=a?s.createPositionBefore(a):l.end,u=s.createRange(c,d);s.addClass("todo-list",n.parent),s.move(u,s.createPositionAt(r,0)),s.insert(s.createPositionAt(n,0),i),s.insert(s.createPositionAfter(i),r)}else if("todo"==e.attributeOldValue){const t=Xe(n,l);s.removeClass("todo-list",n.parent),s.remove(r),s.move(s.createRangeIn(t),s.createPositionBefore(t)),s.remove(t)}})),e.downcastDispatcher.on("attribute:todoListChecked:listItem",function(t){return(e,i,n)=>{if("todo"!=i.item.getAttribute("listType"))return;if(!n.consumable.consume(i.item,"attribute:todoListChecked"))return;const{mapper:s,writer:r}=n,o=!!i.item.getAttribute("todoListChecked"),l=s.toViewElement(i.item).getChild(0),a=Qe(i.item,r,o,t);r.insert(r.createPositionAfter(l),a),r.remove(l)}}(t=>this._handleCheckmarkChange(t))),e.mapper.on("modelToViewPosition",Je(e.view)),i.mapper.on("modelToViewPosition",Je(e.view)),this.listenTo(e.view.document,"arrowKey",function(t,e){return(i,n)=>{if("left"!=(0,r.getLocalizedArrowKeyCodeDirection)(n.keyCode,e.contentLanguageDirection))return;const s=t.schema,o=t.document.selection;if(!o.isCollapsed)return;const l=o.getFirstPosition(),a=l.parent;if("listItem"===a.name&&"todo"==a.getAttribute("listType")&&l.isAtStart){const e=s.getNearestSelectionRange(t.createPositionBefore(a),"backward");e&&t.change(t=>t.setSelection(e)),n.preventDefault(),n.stopPropagation(),i.stop()}}}(n,t.locale),{context:"li"}),this.listenTo(e.view.document,"keydown",(e,i)=>{(0,r.getCode)(i)===ti&&(t.execute("checkTodoList"),e.stop())},{priority:"high"});const a=new Set;this.listenTo(n,"applyOperation",(t,e)=>{const i=e[0];if("rename"==i.type&&"listItem"==i.oldName){const t=i.position.nodeAfter;t.hasAttribute("todoListChecked")&&a.add(t)}else if("changeAttribute"==i.type&&"listType"==i.key&&"todo"===i.oldValue)for(const t of i.range.getItems())t.hasAttribute("todoListChecked")&&"todo"!==t.getAttribute("listType")&&a.add(t)}),n.document.registerPostFixer(t=>{let e=!1;for(const i of a)t.removeAttribute("todoListChecked",i),e=!0;return a.clear(),e}),this._initAriaAnnouncements()}_handleCheckmarkChange(t){const e=this.editor,i=e.model,n=Array.from(i.document.selection.getRanges());i.change(i=>{i.setSelection(t,"end"),e.execute("checkTodoList"),i.setSelection(n)})}_initAriaAnnouncements(){const{model:t,ui:e,t:i}=this.editor;let n=null;e&&t.document.selection.on("change:range",()=>{const s=t.document.selection.focus.parent,r=ii(n),o=ii(s);r&&!o?e.ariaLiveAnnouncer.announce(i("Leaving a to-do list")):!r&&o&&e.ariaLiveAnnouncer.announce(i("Entering a to-do list")),n=s})}}function ii(t){return!!t&&t.is("element","listItem")&&"todo"===t.getAttribute("listType")}class ni extends t.Plugin{static get requires(){return[ei,te]}static get pluginName(){return"LegacyTodoList"}static get isOfficialPlugin(){return!0}}class si extends t.Plugin{static get pluginName(){return"AdjacentListsSupport"}static get isOfficialPlugin(){return!0}init(){const t=this.editor;t.model.schema.register("listSeparator",{allowWhere:"$block",isBlock:!0}),t.conversion.for("upcast").add(t=>{t.on("element:ol",ri()),t.on("element:ul",ri())}).elementToElement({model:"listSeparator",view:"ck-list-separator"}),t.conversion.for("editingDowncast").elementToElement({model:"listSeparator",view:{name:"div",classes:["ck-list-separator","ck-hidden"]}}),t.conversion.for("dataDowncast").elementToElement({model:"listSeparator",view:(t,e)=>{const i=e.writer.createContainerElement("ck-list-separator");return e.writer.setCustomProperty("dataPipeline:transparentRendering",!0,i),i.getFillerOffset=()=>null,i}})}}function ri(){return(t,e,i)=>{const n=e.viewItem,s=n.nextSibling;if(!s)return;if(n.name!==s.name)return;e.modelRange||Object.assign(e,i.convertChildren(e.viewItem,e.modelCursor));const r=i.writer,o=r.createElement("listSeparator");if(!i.safeInsert(o,e.modelCursor))return;const l=i.getSplitParts(o);e.modelRange=r.createRange(e.modelRange.start,r.createPositionAfter(l[l.length-1])),i.updateConversionResult(o,e)}}class oi extends t.Plugin{static get requires(){return[gt]}static get pluginName(){return"DocumentList"}static get isOfficialPlugin(){return!0}constructor(t){super(t),(0,r.logWarning)("plugin-obsolete-documentlist",{pluginName:"DocumentList"})}}class li extends t.Plugin{static get requires(){return[qt]}static get pluginName(){return"DocumentListProperties"}static get isOfficialPlugin(){return!0}constructor(t){super(t),(0,r.logWarning)("plugin-obsolete-documentlistproperties",{pluginName:"DocumentListProperties"})}}class ai extends t.Plugin{static get requires(){return[ne]}static get pluginName(){return"TodoDocumentList"}static get isOfficialPlugin(){return!0}constructor(t){super(t),(0,r.logWarning)("plugin-obsolete-tododocumentlist",{pluginName:"TodoDocumentList"})}}})(),(window.CKEditor5=window.CKEditor5||{}).list=n})();
5
+ */(()=>{var t={21:t=>{"use strict";t.exports=function(t,e){Object.keys(e).forEach((function(i){t.setAttribute(i,e[i])}))}},51:t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},128:t=>{"use strict";var e={};t.exports=function(t,i){var n=function(t){if(void 0===e[t]){var i=document.querySelector(t);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(t){i=null}e[t]=i}return e[t]}(t);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");n.appendChild(i)}},137:(t,e,i)=>{"use strict";i.d(e,{A:()=>l});var n=i(758),s=i.n(n),r=i(935),o=i.n(r)()(s());o.push([t.id,".ck-content ol{list-style-type:decimal}.ck-content ol ol{list-style-type:lower-latin}.ck-content ol ol ol{list-style-type:lower-roman}.ck-content ol ol ol ol{list-style-type:upper-latin}.ck-content ol ol ol ol ol{list-style-type:upper-roman}.ck-content ul{list-style-type:disc}.ck-content ul ul{list-style-type:circle}.ck-content ul ul ul,.ck-content ul ul ul ul{list-style-type:square}",""]);const l=o},237:t=>{"use strict";t.exports=CKEditor5.dll},263:(t,e,i)=>{"use strict";i.d(e,{A:()=>l});var n=i(758),s=i.n(n),r=i(935),o=i.n(r)()(s());o.push([t.id,".ck.ck-list-styles-list{display:grid}:root{--ck-list-style-button-size:44px}.ck.ck-list-styles-list{column-gap:var(--ck-spacing-medium);grid-template-columns:repeat(3,auto);padding:var(--ck-spacing-large);row-gap:var(--ck-spacing-medium)}.ck.ck-list-styles-list .ck-button{box-sizing:content-box;margin:0;padding:0}.ck.ck-list-styles-list .ck-button,.ck.ck-list-styles-list .ck-button .ck-icon{height:var(--ck-list-style-button-size);width:var(--ck-list-style-button-size)}",""]);const l=o},266:(t,e,i)=>{"use strict";i.d(e,{A:()=>l});var n=i(758),s=i.n(n),r=i(935),o=i.n(r)()(s());o.push([t.id,".ck.ck-list-properties.ck-list-properties_without-styles{padding:var(--ck-spacing-large)}.ck.ck-list-properties.ck-list-properties_without-styles>*{min-width:14em}.ck.ck-list-properties.ck-list-properties_without-styles>*+*{margin-top:var(--ck-spacing-standard)}.ck.ck-list-properties.ck-list-properties_with-numbered-properties>.ck-list-styles-list{grid-template-columns:repeat(4,auto)}.ck.ck-list-properties.ck-list-properties_with-numbered-properties>.ck-collapsible{border-top:1px solid var(--ck-color-base-border)}.ck.ck-list-properties.ck-list-properties_with-numbered-properties>.ck-collapsible>.ck-collapsible__children>*{width:100%}.ck.ck-list-properties.ck-list-properties_with-numbered-properties>.ck-collapsible>.ck-collapsible__children>*+*{margin-top:var(--ck-spacing-standard)}.ck.ck-list-properties .ck.ck-numbered-list-properties__start-index .ck-input{min-width:auto;width:100%}.ck.ck-list-properties .ck.ck-numbered-list-properties__reversed-order{background:transparent;margin-bottom:calc(var(--ck-spacing-tiny)*-1);padding-left:0;padding-right:0}.ck.ck-list-properties .ck.ck-numbered-list-properties__reversed-order:active,.ck.ck-list-properties .ck.ck-numbered-list-properties__reversed-order:hover{background:none;border-color:transparent;box-shadow:none}",""]);const l=o},311:(t,e,i)=>{t.exports=i(237)("./src/ui.js")},331:(t,e,i)=>{t.exports=i(237)("./src/clipboard.js")},355:(t,e,i)=>{t.exports=i(237)("./src/icons.js")},358:(t,e,i)=>{"use strict";i.d(e,{A:()=>l});var n=i(758),s=i.n(n),r=i(935),o=i.n(r)()(s());o.push([t.id,".ck-editor__editable .ck-list-bogus-paragraph{display:block}",""]);const l=o},507:(t,e,i)=>{t.exports=i(237)("./src/enter.js")},584:(t,e,i)=>{t.exports=i(237)("./src/utils.js")},591:t=>{"use strict";var e=[];function i(t){for(var i=-1,n=0;n<e.length;n++)if(e[n].identifier===t){i=n;break}return i}function n(t,n){for(var r={},o=[],l=0;l<t.length;l++){var a=t[l],c=n.base?a[0]+n.base:a[0],d=r[c]||0,u="".concat(c," ").concat(d);r[c]=d+1;var m=i(u),p={css:a[1],media:a[2],sourceMap:a[3],supports:a[4],layer:a[5]};if(-1!==m)e[m].references++,e[m].updater(p);else{var f=s(p,n);n.byIndex=l,e.splice(l,0,{identifier:u,updater:f,references:1})}o.push(u)}return o}function s(t,e){var i=e.domAPI(e);i.update(t);return function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;i.update(t=e)}else i.remove()}}t.exports=function(t,s){var r=n(t=t||[],s=s||{});return function(t){t=t||[];for(var o=0;o<r.length;o++){var l=i(r[o]);e[l].references--}for(var a=n(t,s),c=0;c<r.length;c++){var d=i(r[c]);0===e[d].references&&(e[d].updater(),e.splice(d,1))}r=a}}},639:t=>{"use strict";var e,i=(e=[],function(t,i){return e[t]=i,e.filter(Boolean).join("\n")});function n(t,e,n,s){var r;if(n)r="";else{r="",s.supports&&(r+="@supports (".concat(s.supports,") {")),s.media&&(r+="@media ".concat(s.media," {"));var o=void 0!==s.layer;o&&(r+="@layer".concat(s.layer.length>0?" ".concat(s.layer):""," {")),r+=s.css,o&&(r+="}"),s.media&&(r+="}"),s.supports&&(r+="}")}if(t.styleSheet)t.styleSheet.cssText=i(e,r);else{var l=document.createTextNode(r),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(l,a[e]):t.appendChild(l)}}var s={singleton:null,singletonCounter:0};t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=s.singletonCounter++,i=s.singleton||(s.singleton=t.insertStyleElement(t));return{update:function(t){n(i,e,!1,t)},remove:function(t){n(i,e,!0,t)}}}},758:t=>{"use strict";t.exports=function(t){return t[1]}},782:(t,e,i)=>{t.exports=i(237)("./src/core.js")},783:(t,e,i)=>{t.exports=i(237)("./src/engine.js")},825:(t,e,i)=>{"use strict";i.d(e,{A:()=>l});var n=i(758),s=i.n(n),r=i(935),o=i.n(r)()(s());o.push([t.id,':root{--ck-todo-list-checkmark-size:16px}.ck-content .todo-list{list-style:none}.ck-content .todo-list li{margin-bottom:5px;position:relative}.ck-content .todo-list li .todo-list{margin-top:5px}.ck-content .todo-list .todo-list__label>input{-webkit-appearance:none;border:0;display:inline-block;height:var(--ck-todo-list-checkmark-size);left:-25px;margin-left:0;margin-right:-15px;position:relative;right:0;vertical-align:middle;width:var(--ck-todo-list-checkmark-size)}.ck-content[dir=rtl] .todo-list .todo-list__label>input{left:0;margin-left:-15px;margin-right:0;right:-25px}.ck-content .todo-list .todo-list__label>input:before{border:1px solid #333;border-radius:2px;box-sizing:border-box;content:"";display:block;height:100%;position:absolute;transition:box-shadow .25s ease-in-out;width:100%}@media (prefers-reduced-motion:reduce){.ck-content .todo-list .todo-list__label>input:before{transition:none}}.ck-content .todo-list .todo-list__label>input:after{border-color:transparent;border-style:solid;border-width:0 calc(var(--ck-todo-list-checkmark-size)/8) calc(var(--ck-todo-list-checkmark-size)/8) 0;box-sizing:content-box;content:"";display:block;height:calc(var(--ck-todo-list-checkmark-size)/2.6);left:calc(var(--ck-todo-list-checkmark-size)/3);pointer-events:none;position:absolute;top:calc(var(--ck-todo-list-checkmark-size)/5.3);transform:rotate(45deg);width:calc(var(--ck-todo-list-checkmark-size)/5.3)}.ck-content .todo-list .todo-list__label>input[checked]:before{background:#26ab33;border-color:#26ab33}.ck-content .todo-list .todo-list__label>input[checked]:after{border-color:#fff}.ck-content .todo-list .todo-list__label .todo-list__label__description{vertical-align:middle}.ck-content .todo-list .todo-list__label.todo-list__label_without-description input[type=checkbox]{position:absolute}.ck-editor__editable.ck-content .todo-list .todo-list__label>input,.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input{cursor:pointer}.ck-editor__editable.ck-content .todo-list .todo-list__label>input:hover:before,.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input:hover:before{box-shadow:0 0 0 5px rgba(0,0,0,.1)}.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input{-webkit-appearance:none;border:0;display:inline-block;height:var(--ck-todo-list-checkmark-size);left:-25px;margin-left:0;margin-right:-15px;position:relative;right:0;vertical-align:middle;width:var(--ck-todo-list-checkmark-size)}.ck-editor__editable.ck-content[dir=rtl] .todo-list .todo-list__label>span[contenteditable=false]>input{left:0;margin-left:-15px;margin-right:0;right:-25px}.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input:before{border:1px solid #333;border-radius:2px;box-sizing:border-box;content:"";display:block;height:100%;position:absolute;transition:box-shadow .25s ease-in-out;width:100%}@media (prefers-reduced-motion:reduce){.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input:before{transition:none}}.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input:after{border-color:transparent;border-style:solid;border-width:0 calc(var(--ck-todo-list-checkmark-size)/8) calc(var(--ck-todo-list-checkmark-size)/8) 0;box-sizing:content-box;content:"";display:block;height:calc(var(--ck-todo-list-checkmark-size)/2.6);left:calc(var(--ck-todo-list-checkmark-size)/3);pointer-events:none;position:absolute;top:calc(var(--ck-todo-list-checkmark-size)/5.3);transform:rotate(45deg);width:calc(var(--ck-todo-list-checkmark-size)/5.3)}.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input[checked]:before{background:#26ab33;border-color:#26ab33}.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input[checked]:after{border-color:#fff}.ck-editor__editable.ck-content .todo-list .todo-list__label.todo-list__label_without-description input[type=checkbox]{position:absolute}',""]);const l=o},834:(t,e,i)=>{t.exports=i(237)("./src/typing.js")},935:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var i="",n=void 0!==e[5];return e[4]&&(i+="@supports (".concat(e[4],") {")),e[2]&&(i+="@media ".concat(e[2]," {")),n&&(i+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),i+=t(e),n&&(i+="}"),e[2]&&(i+="}"),e[4]&&(i+="}"),i})).join("")},e.i=function(t,i,n,s,r){"string"==typeof t&&(t=[[null,t,void 0]]);var o={};if(n)for(var l=0;l<this.length;l++){var a=this[l][0];null!=a&&(o[a]=!0)}for(var c=0;c<t.length;c++){var d=[].concat(t[c]);n&&o[d[0]]||(void 0!==r&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=r),i&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=i):d[2]=i),s&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=s):d[4]="".concat(s)),e.push(d))}},e}}},e={};function i(n){var s=e[n];if(void 0!==s)return s.exports;var r=e[n]={id:n,exports:{}};return t[n](r,r.exports,i),r.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{"use strict";i.r(n),i.d(n,{AdjacentListsSupport:()=>si,DocumentList:()=>oi,DocumentListProperties:()=>li,LegacyIndentCommand:()=>le,LegacyList:()=>Re,LegacyListEditing:()=>Be,LegacyListProperties:()=>Ge,LegacyListPropertiesEditing:()=>je,LegacyListUtils:()=>we,LegacyTodoList:()=>ni,LegacyTodoListEditing:()=>ei,List:()=>gt,ListCommand:()=>P,ListEditing:()=>at,ListIndentCommand:()=>x,ListProperties:()=>qt,ListPropertiesEditing:()=>Nt,ListPropertiesUI:()=>Mt,ListPropertiesUtils:()=>Ct,ListUI:()=>ft,ListUtils:()=>N,TodoDocumentList:()=>ai,TodoList:()=>ne,TodoListEditing:()=>Yt,TodoListUI:()=>te});var t=i(782),e=i(834),s=i(507),r=i(584);class o{_startElement;_referenceIndent;_isForward;_includeSelf;_sameAttributes;_sameIndent;_lowerIndent;_higherIndent;constructor(t,e){this._startElement=t,this._referenceIndent=t.getAttribute("listIndent"),this._isForward="forward"==e.direction,this._includeSelf=!!e.includeSelf,this._sameAttributes=(0,r.toArray)(e.sameAttributes||[]),this._sameIndent=!!e.sameIndent,this._lowerIndent=!!e.lowerIndent,this._higherIndent=!!e.higherIndent}static first(t,e){const i=new this(t,e)[Symbol.iterator]();return(0,r.first)(i)}*[Symbol.iterator](){const t=[];for(const{node:e}of new l(this._getStartNode(),this._isForward?"forward":"backward")){const i=e.getAttribute("listIndent");if(i<this._referenceIndent){if(!this._lowerIndent)break;this._referenceIndent=i}else if(i>this._referenceIndent){if(!this._higherIndent)continue;if(!this._isForward){t.push(e);continue}}else{if(!this._sameIndent){if(this._higherIndent){t.length&&(yield*t,t.length=0);break}continue}if(this._sameAttributes.some((t=>e.getAttribute(t)!==this._startElement.getAttribute(t))))break}t.length&&(yield*t,t.length=0),yield e}}_getStartNode(){return this._includeSelf?this._startElement:this._isForward?this._startElement.nextSibling:this._startElement.previousSibling}}class l{_node;_isForward;_previousNodesByIndent=[];_previous=null;_previousNodeIndent=null;constructor(t,e="forward"){this._node=t,this._isForward="forward"===e}[Symbol.iterator](){return this}next(){if(!d(this._node))return{done:!0,value:void 0};const t=this._node.getAttribute("listIndent");let e=null;if(this._previous){const i=this._previousNodeIndent;t>i?this._previousNodesByIndent[i]=this._previous:t<i?(e=this._previousNodesByIndent[t]||null,this._previousNodesByIndent.length=t):e=this._previous}const i={node:this._node,previous:this._previous,previousNodeInList:e};return this._previous=this._node,this._previousNodeIndent=t,this._node=this._isForward?this._node.nextSibling:this._node.previousSibling,{value:i,done:!1}}}class a{_listHead;constructor(t){this._listHead=t}[Symbol.iterator](){return new l(this._listHead)}}class c{static next(){return(0,r.uid)()}}function d(t){return!!t&&t.is("element")&&t.hasAttribute("listItemId")}function u(t,e={}){return[...m(t,{...e,direction:"backward"}),...m(t,{...e,direction:"forward"})]}function m(t,e={}){const i="forward"==e.direction,n=Array.from(new o(t,{...e,includeSelf:i,sameIndent:!0,sameAttributes:"listItemId"}));return i?n:n.reverse()}function p(t,e){const i=new o(t,{sameIndent:!0,sameAttributes:"listType",...e}),n=new o(t,{sameIndent:!0,sameAttributes:"listType",includeSelf:!0,direction:"forward",...e});return[...Array.from(i).reverse(),...n]}function f(t){return!o.first(t,{sameIndent:!0,sameAttributes:"listItemId"})}function g(t){return!o.first(t,{direction:"forward",sameIndent:!0,sameAttributes:"listItemId"})}function b(t,e={}){t=(0,r.toArray)(t);const i=!1!==e.withNested,n=new Set;for(const e of t)for(const t of u(e,{higherIndent:i}))n.add(t);return v(n)}function h(t){t=(0,r.toArray)(t);const e=new Set;for(const i of t)for(const t of p(i))e.add(t);return v(e)}function y(t,e){const i=m(t,{direction:"forward"}),n=c.next();for(const t of i)e.setAttribute("listItemId",n,t);return i}function A(t,e,i){const n={};for(const[t,i]of e.getAttributes())t.startsWith("list")&&(n[t]=i);const s=m(t,{direction:"forward"});for(const t of s)i.setAttributes(n,t);return s}function w(t,e,{expand:i,indentBy:n=1}={}){t=(0,r.toArray)(t);const s=i?b(t):t;for(const t of s){const i=t.getAttribute("listIndent")+n;i<0?I(t,e):e.setAttribute("listIndent",i,t)}return s}function I(t,e){t=(0,r.toArray)(t);for(const i of t)i.is("element","listItem")&&e.rename(i,"paragraph");for(const i of t)for(const t of i.getAttributeKeys())t.startsWith("list")&&e.removeAttribute(t,i);return t}function k(t){if(!t.length)return!1;const e=t[0].getAttribute("listItemId");return!!e&&!t.some((t=>t.getAttribute("listItemId")!=e))}function v(t){return Array.from(t).filter((t=>"$graveyard"!==t.root.rootName)).sort(((t,e)=>t.index-e.index))}function _(t){const e=t.document.selection.getSelectedElement();return e&&t.schema.isObject(e)&&t.schema.isBlock(e)?e:null}function T(t,e){return e.checkChild(t.parent,"listItem")&&e.checkChild(t,"$text")&&!e.isObject(t)}function L(t){return"numbered"==t||"customNumbered"==t}function S(t,e,i){return m(e,{direction:"forward"}).pop().index>t.index?A(t,e,i):[]}class x extends t.Command{_direction;constructor(t,e){super(t),this._direction=e}refresh(){this.isEnabled=this._checkEnabled()}execute(){const t=this.editor.model,e=C(t.document.selection);t.change((t=>{const i=[];k(e)&&!f(e[0])?("forward"==this._direction&&i.push(...w(e,t)),i.push(...y(e[0],t))):"forward"==this._direction?i.push(...w(e,t,{expand:!0})):i.push(...function(t,e){const i=b(t=(0,r.toArray)(t)),n=new Set,s=Math.min(...i.map((t=>t.getAttribute("listIndent")))),l=new Map;for(const t of i)l.set(t,o.first(t,{lowerIndent:!0}));for(const t of i){if(n.has(t))continue;n.add(t);const i=t.getAttribute("listIndent")-1;if(i<0)I(t,e);else{if(t.getAttribute("listIndent")==s){const i=S(t,l.get(t),e);for(const t of i)n.add(t);if(i.length)continue}e.setAttribute("listIndent",i,t)}}return v(n)}(e,t));for(const e of i){if(!e.hasAttribute("listType"))continue;const i=o.first(e,{sameIndent:!0});i&&t.setAttribute("listType",i.getAttribute("listType"),e)}this._fireAfterExecute(i)}))}_fireAfterExecute(t){this.fire("afterExecute",v(new Set(t)))}_checkEnabled(){let t=C(this.editor.model.document.selection),e=t[0];if(!e)return!1;if("backward"==this._direction)return!0;if(k(t)&&!f(t[0]))return!0;t=b(t),e=t[0];const i=o.first(e,{sameIndent:!0});return!!i&&i.getAttribute("listType")==e.getAttribute("listType")}}function C(t){const e=Array.from(t.getSelectedBlocks()),i=e.findIndex((t=>!d(t)));return-1!=i&&(e.length=i),e}class P extends t.Command{type;_listWalkerOptions;constructor(t,e,i={}){super(t),this.type=e,this._listWalkerOptions=i.multiLevel?{higherIndent:!0,lowerIndent:!0,sameAttributes:[]}:void 0}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){const e=this.editor.model,i=e.document,n=_(e),s=Array.from(i.selection.getSelectedBlocks()).filter((t=>e.schema.checkAttribute(t,"listType")||T(t,e.schema))),r=void 0!==t.forceValue?!t.forceValue:this.value;e.change((o=>{if(r){const t=s[s.length-1],e=m(t,{direction:"forward"}),i=[];e.length>1&&i.push(...y(e[1],o)),i.push(...I(s,o)),i.push(...function(t,e){const i=[];let n=Number.POSITIVE_INFINITY;for(const{node:s}of new l(t.nextSibling)){const t=s.getAttribute("listIndent");if(0==t)break;t<n&&(n=t);const r=t-n;e.setAttribute("listIndent",r,s),i.push(s)}return i}(t,o)),this._fireAfterExecute(i)}else if((n||i.selection.isCollapsed)&&d(s[0])){const e=p(n||s[0],this._listWalkerOptions);for(const i of e)o.setAttributes({...t.additionalAttributes,listType:this.type},i);this._fireAfterExecute(e)}else{const i=[];for(const n of s)if(n.hasAttribute("listType"))for(const e of b(n,{withNested:!1}))e.getAttribute("listType")!=this.type&&(o.setAttributes({...t.additionalAttributes,listType:this.type},e),i.push(e));else!n.is("element","listItem")&&T(n,e.schema)&&o.rename(n,"listItem"),o.setAttributes({...t.additionalAttributes,listIndent:0,listItemId:c.next(),listType:this.type},n),i.push(n);this._fireAfterExecute(i)}}))}_fireAfterExecute(t){this.fire("afterExecute",v(new Set(t)))}_getValue(){const t=this.editor.model.document.selection,e=Array.from(t.getSelectedBlocks());if(!e.length)return!1;for(const t of e)if(t.getAttribute("listType")!=this.type)return!1;return!0}_checkEnabled(){const t=this.editor.model,e=t.schema,i=t.document.selection,n=Array.from(i.getSelectedBlocks());if(!n.length)return!1;if(this.value)return!0;for(const t of n)if(e.checkAttribute(t,"listType")||T(t,e))return!0;return!1}}class E extends t.Command{_direction;constructor(t,e){super(t),this._direction=e}refresh(){this.isEnabled=this._checkEnabled()}execute({shouldMergeOnBlocksContentLevel:t=!1}={}){const e=this.editor.model,i=e.document.selection,n=[];e.change((s=>{const{firstElement:r,lastElement:l}=this._getMergeSubjectElements(i,t),a=r.getAttribute("listIndent")||0,c=l.getAttribute("listIndent"),d=l.getAttribute("listItemId");if(a!=c){const t=(u=l,Array.from(new o(u,{direction:"forward",higherIndent:!0})));n.push(...w([l,...t],s,{indentBy:a-c,expand:a<c}))}var u;if(t){let t=i;i.isCollapsed&&(t=s.createSelection(s.createRange(s.createPositionAt(r,"end"),s.createPositionAt(l,0)))),e.deleteContent(t,{doNotResetEntireContent:i.isCollapsed});const o=t.getLastPosition().parent,a=o.nextSibling;n.push(o),a&&a!==l&&a.getAttribute("listItemId")==d&&n.push(...A(a,o,s))}else n.push(...A(l,r,s));this._fireAfterExecute(n)}))}_fireAfterExecute(t){this.fire("afterExecute",v(new Set(t)))}_checkEnabled(){const t=this.editor.model,e=t.document.selection,i=_(t);if(e.isCollapsed||i){const t=i||e.getFirstPosition().parent;if(!d(t))return!1;const n="backward"==this._direction?t.previousSibling:t.nextSibling;if(!n)return!1;if(k([t,n]))return!1}else{const t=e.getLastPosition(),i=e.getFirstPosition();if(t.parent===i.parent)return!1;if(!d(t.parent))return!1}return!0}_getMergeSubjectElements(t,e){const i=_(this.editor.model);let n,s;if(t.isCollapsed||i){const r=i||t.getFirstPosition().parent,l=f(r);"backward"==this._direction?(s=r,n=l&&!e?o.first(r,{sameIndent:!0,lowerIndent:!0}):r.previousSibling):(n=r,s=r.nextSibling)}else n=t.getFirstPosition().parent,s=t.getLastPosition().parent;return{firstElement:n,lastElement:s}}}class V extends t.Command{_direction;constructor(t,e){super(t),this._direction=e}refresh(){this.isEnabled=this._checkEnabled()}execute(){this.editor.model.change((t=>{const e=y(this._getStartBlock(),t);this._fireAfterExecute(e)}))}_fireAfterExecute(t){this.fire("afterExecute",v(new Set(t)))}_checkEnabled(){const t=this.editor.model.document.selection,e=this._getStartBlock();return t.isCollapsed&&d(e)&&!f(e)}_getStartBlock(){const t=this.editor.model.document.selection.getFirstPosition().parent;return"before"==this._direction?t:t.nextSibling}}class N extends t.Plugin{static get pluginName(){return"ListUtils"}static get isOfficialPlugin(){return!0}expandListBlocksToCompleteList(t){return h(t)}isFirstBlockOfListItem(t){return f(t)}isListItemBlock(t){return d(t)}expandListBlocksToCompleteItems(t,e={}){return b(t,e)}isNumberedListType(t){return L(t)}}function B(t){return t.is("element","ol")||t.is("element","ul")}function O(t){return t.is("element","li")}function R(t,e,i,n=M(i,e)){return t.createAttributeElement(F(i),null,{priority:2*e/100-100,id:n})}function D(t,e,i){return t.createAttributeElement("li",null,{priority:(2*e+1)/100-100,id:i})}function F(t){return"numbered"==t||"customNumbered"==t?"ol":"ul"}function M(t,e){return`list-${t}-${e}`}function z(t,e,i){const n=t.nodeBefore;if(d(n)){let t=n;for(const{node:s}of new l(t,"backward")){if(t=s,i.has(t))return;if(i.add(t),e.has(n))return}e.add(t)}else{const i=t.nodeAfter;d(i)&&e.add(i)}}function j(){return(t,e,i)=>{const{writer:n,schema:s}=i;if(!e.modelRange)return;const r=Array.from(e.modelRange.getItems({shallow:!0})).filter((t=>s.checkAttribute(t,"listItemId")));if(!r.length)return;const o=c.next(),l=function(t){let e=0,i=t.parent;for(;i;){if(O(i))e++;else{const t=i.previousSibling;t&&O(t)&&e++}i=i.parent}return e}(e.viewItem);let a=e.viewItem.parent&&e.viewItem.parent.is("element","ol")?"numbered":"bulleted";const d=r[0].getAttribute("listType");d&&(a=d);const u={listItemId:o,listIndent:l,listType:a};for(const t of r)t.hasAttribute("listItemId")||n.setAttributes(u,t);r.length>1&&r[1].getAttribute("listItemId")!=u.listItemId&&i.keepEmptyElement(r[0])}}function K(t,e,i,{dataPipeline:n}={}){const s=function(t){return(e,i)=>{const n=[];for(const i of t)e.hasAttribute(i)&&n.push(`attribute:${i}`);return!!n.every((t=>!1!==i.test(e,t)))&&(n.forEach((t=>i.consume(e,t))),!0)}}(t);return(r,l,a)=>{const{writer:c,mapper:d,consumable:u}=a,m=l.item;if(!t.includes(l.attributeKey))return;if(!s(m,u))return;const p=function(t,e,i){const n=i.createRangeOn(t),s=e.toViewRange(n).getTrimmed();return s.end.nodeBefore}(m,d,i);q(p,c,d),function(t,e){let i=t.parent;for(;i.is("attributeElement")&&["ul","ol","li"].includes(i.name);){const n=i.parent;e.unwrap(e.createRangeOn(t),i),i=n}}(p,c);const g=function(t,e,i,n,{dataPipeline:s}){let r=n.createRangeOn(e);if(!f(t))return r;for(const o of i){if("itemMarker"!=o.scope)continue;const i=o.createElement(n,t,{dataPipeline:s});if(!i)continue;if(n.setCustomProperty("listItemMarker",!0,i),o.canInjectMarkerIntoElement&&o.canInjectMarkerIntoElement(t)?n.insert(n.createPositionAt(e,0),i):(n.insert(r.start,i),r=n.createRange(n.createPositionBefore(i),n.createPositionAfter(e))),!o.createWrapperElement||!o.canWrapElement)continue;const l=o.createWrapperElement(n,t,{dataPipeline:s});n.setCustomProperty("listItemWrapper",!0,l),o.canWrapElement(t)?r=n.wrap(r,l):(r=n.wrap(n.createRangeOn(i),l),r=n.createRange(r.start,n.createPositionAfter(e)))}return r}(m,p,e,c,{dataPipeline:n});!function(t,e,i,n){if(!t.hasAttribute("listIndent"))return;const s=t.getAttribute("listIndent");let r=t;for(let t=s;t>=0;t--){const s=D(n,t,r.getAttribute("listItemId")),l=R(n,t,r.getAttribute("listType"));for(const t of i)"list"!=t.scope&&"item"!=t.scope||!r.hasAttribute(t.attributeName)||t.setAttributeOnDowncast(n,r.getAttribute(t.attributeName),"list"==t.scope?l:s);if(e=n.wrap(e,s),e=n.wrap(e,l),0==t)break;if(r=o.first(r,{lowerIndent:!0}),!r)break}}(m,g,e,c)}}function U(t,{dataPipeline:e}={}){return(i,{writer:n})=>{if(!$(i,t))return null;if(!e)return n.createContainerElement("span",{class:"ck-list-bogus-paragraph"});const s=n.createContainerElement("p");return n.setCustomProperty("dataPipeline:transparentRendering",!0,s),s}}function q(t,e,i){for(;t.parent.is("attributeElement")&&t.parent.getCustomProperty("listItemWrapper");)e.unwrap(e.createRangeOn(t),t.parent);const n=[];s(e.createPositionBefore(t).getWalker({direction:"backward"})),s(e.createRangeIn(t).getWalker());for(const t of n)e.remove(t);function s(t){for(const{item:e}of t){if(e.is("element")&&i.toModelElement(e))break;e.is("element")&&e.getCustomProperty("listItemMarker")&&n.push(e)}}}function $(t,e,i=u(t)){if(!d(t))return!1;for(const i of t.getAttributeKeys())if(!i.startsWith("selection:")&&"htmlEmptyBlock"!=i&&!e.includes(i))return!1;return i.length<2}var W=i(331),G=i(591),H=i.n(G),Y=i(639),Z=i.n(Y),J=i(128),Q=i.n(J),X=i(21),tt=i.n(X),et=i(51),it=i.n(et),nt=i(358),st={attributes:{"data-cke":!0}};st.setAttributes=tt(),st.insert=Q().bind(null,"head"),st.domAPI=Z(),st.insertStyleElement=it();H()(nt.A,st);nt.A&&nt.A.locals&&nt.A.locals;var rt=i(137),ot={attributes:{"data-cke":!0}};ot.setAttributes=tt(),ot.insert=Q().bind(null,"head"),ot.domAPI=Z(),ot.insertStyleElement=it();H()(rt.A,ot);rt.A&&rt.A.locals&&rt.A.locals;const lt=["listType","listIndent","listItemId"];class at extends t.Plugin{_downcastStrategies=[];static get pluginName(){return"ListEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[s.Enter,e.Delete,N,W.ClipboardPipeline]}constructor(t){super(t),t.config.define("list.multiBlock",!0)}init(){const t=this.editor,e=t.model,i=t.config.get("list.multiBlock");if(t.plugins.has("LegacyListEditing"))throw new r.CKEditorError("list-feature-conflict",this,{conflictPlugin:"LegacyListEditing"});e.schema.register("$listItem",{allowAttributes:lt}),i?(e.schema.extend("$container",{allowAttributesOf:"$listItem"}),e.schema.extend("$block",{allowAttributesOf:"$listItem"}),e.schema.extend("$blockObject",{allowAttributesOf:"$listItem"})):e.schema.register("listItem",{inheritAllFrom:"$block",allowAttributesOf:"$listItem"});for(const t of lt)e.schema.setAttributeProperties(t,{copyOnReplace:!0});t.commands.add("numberedList",new P(t,"numbered")),t.commands.add("bulletedList",new P(t,"bulleted")),t.commands.add("customNumberedList",new P(t,"customNumbered",{multiLevel:!0})),t.commands.add("customBulletedList",new P(t,"customBulleted",{multiLevel:!0})),t.commands.add("indentList",new x(t,"forward")),t.commands.add("outdentList",new x(t,"backward")),t.commands.add("splitListItemBefore",new V(t,"before")),t.commands.add("splitListItemAfter",new V(t,"after")),i&&(t.commands.add("mergeListItemBackward",new E(t,"backward")),t.commands.add("mergeListItemForward",new E(t,"forward"))),this._setupDeleteIntegration(),this._setupEnterIntegration(),this._setupTabIntegration(),this._setupClipboardIntegration(),this._setupAccessibilityIntegration()}afterInit(){const t=this.editor.commands,e=t.get("indent"),i=t.get("outdent");e&&e.registerChildCommand(t.get("indentList"),{priority:"high"}),i&&i.registerChildCommand(t.get("outdentList"),{priority:"lowest"}),this._setupModelPostFixing(),this._setupConversion()}registerDowncastStrategy(t){this._downcastStrategies.push(t)}getListAttributeNames(){return[...lt,...this._downcastStrategies.map((t=>t.attributeName))]}_setupDeleteIntegration(){const t=this.editor,e=t.commands.get("mergeListItemBackward"),i=t.commands.get("mergeListItemForward");this.listenTo(t.editing.view.document,"delete",((n,s)=>{const r=t.model.document.selection;_(t.model)||t.model.change((()=>{const l=r.getFirstPosition();if(r.isCollapsed&&"backward"==s.direction){if(!l.isAtStart)return;const i=l.parent;if(!d(i))return;if(o.first(i,{sameAttributes:"listType",sameIndent:!0})||0!==i.getAttribute("listIndent")){if(!e||!e.isEnabled)return;e.execute({shouldMergeOnBlocksContentLevel:ct(t.model,"backward")})}else g(i)||t.execute("splitListItemAfter"),t.execute("outdentList");s.preventDefault(),n.stop()}else{if(r.isCollapsed&&!r.getLastPosition().isAtEnd)return;if(!i||!i.isEnabled)return;i.execute({shouldMergeOnBlocksContentLevel:ct(t.model,"forward")}),s.preventDefault(),n.stop()}}))}),{context:"li"})}_setupEnterIntegration(){const t=this.editor,e=t.model,i=t.commands,n=i.get("enter");this.listenTo(t.editing.view.document,"enter",((i,n)=>{const s=e.document,r=s.selection.getFirstPosition().parent;if(s.selection.isCollapsed&&d(r)&&r.isEmpty&&!n.isSoft){const e=f(r),s=g(r);e&&s?(t.execute("outdentList"),n.preventDefault(),i.stop()):e&&!s?(t.execute("splitListItemAfter"),n.preventDefault(),i.stop()):s&&(t.execute("splitListItemBefore"),n.preventDefault(),i.stop())}}),{context:"li"}),this.listenTo(n,"afterExecute",(()=>{const e=i.get("splitListItemBefore");if(e.refresh(),!e.isEnabled)return;2===u(t.model.document.selection.getLastPosition().parent).length&&e.execute()}))}_setupTabIntegration(){const t=this.editor;this.listenTo(t.editing.view.document,"tab",((e,i)=>{const n=i.shiftKey?"outdentList":"indentList";this.editor.commands.get(n).isEnabled&&(t.execute(n),i.stopPropagation(),i.preventDefault(),e.stop())}),{context:"li"})}_setupConversion(){const t=this.editor,e=t.model,i=this.getListAttributeNames(),n=t.config.get("list.multiBlock"),s=n?"paragraph":"listItem";t.conversion.for("upcast").elementToElement({view:"li",model:(t,{writer:e})=>e.createElement(s,{listType:""})}).elementToElement({view:"p",model:(t,{writer:e})=>t.parent&&t.parent.is("element","li")?e.createElement(s,{listType:""}):null,converterPriority:"high"}).add((t=>{t.on("element:li",j())})),n||t.conversion.for("downcast").elementToElement({model:"listItem",view:"p"}),t.conversion.for("editingDowncast").elementToElement({model:s,view:U(i),converterPriority:"high"}).add((t=>{var n;t.on("attribute",K(i,this._downcastStrategies,e)),t.on("remove",(n=e.schema,(t,e,i)=>{const{writer:s,mapper:r}=i,o=t.name.split(":")[1];if(!n.checkAttribute(o,"listItemId"))return;const l=r.toViewPosition(e.position),a=e.position.getShiftedBy(e.length),c=r.toViewPosition(a,{isPhantom:!0}),d=s.createRange(l,c).getTrimmed().end.nodeBefore;d&&q(d,s,r)}))})),t.conversion.for("dataDowncast").elementToElement({model:s,view:U(i,{dataPipeline:!0}),converterPriority:"high"}).add((t=>{t.on("attribute",K(i,this._downcastStrategies,e,{dataPipeline:!0}))}));const r=(o=this._downcastStrategies,a=t.editing.view,(t,e)=>{if(e.modelPosition.offset>0)return;const i=e.modelPosition.parent;if(!d(i))return;if(!o.some((t=>"itemMarker"==t.scope&&t.canInjectMarkerIntoElement&&t.canInjectMarkerIntoElement(i))))return;const n=e.mapper.toViewElement(i),s=a.createRangeIn(n),r=s.getWalker();let l=s.start;for(const{item:t}of r){if(t.is("element")&&e.mapper.toModelElement(t)||t.is("$textProxy"))break;t.is("element")&&t.getCustomProperty("listItemMarker")&&(l=a.createPositionAfter(t),r.skip((({previousPosition:t})=>!t.isEqual(l))))}e.viewPosition=l});var o,a;t.editing.mapper.on("modelToViewPosition",r),t.data.mapper.on("modelToViewPosition",r),this.listenTo(e.document,"change:data",function(t,e,i,n){return()=>{const n=t.document.differ.getChanges(),o=[],l=new Set,a=new Set,c=new Set;for(const t of n)if("insert"==t.type&&"$text"!=t.name)z(t.position,l,c),t.attributes.has("listItemId")?a.add(t.position.nodeAfter):z(t.position.getShiftedBy(t.length),l,c);else if("remove"==t.type&&t.attributes.has("listItemId"))z(t.position,l,c);else if("attribute"==t.type){const e=t.range.start.nodeAfter;i.includes(t.attributeKey)?(z(t.range.start,l,c),null===t.attributeNewValue?(z(t.range.start.getShiftedBy(1),l,c),r(e)&&o.push(e)):a.add(e)):d(e)&&r(e)&&o.push(e)}for(const t of l.values())o.push(...s(t,a));for(const t of new Set(o))e.reconvertItem(t)};function s(t,e){const n=[],s=new Set,a=[];for(const{node:c,previous:d}of new l(t)){if(s.has(c))continue;const t=c.getAttribute("listIndent");d&&t<d.getAttribute("listIndent")&&(a.length=t+1),a[t]=Object.fromEntries(Array.from(c.getAttributes()).filter((([t])=>i.includes(t))));const l=m(c,{direction:"forward"});for(const t of l)s.add(t),(r(t,l)||o(t,a,e))&&n.push(t)}return n}function r(t,s){const r=e.mapper.toViewElement(t);if(!r)return!1;if(n.fire("checkElement",{modelElement:t,viewElement:r}))return!0;if(!t.is("element","paragraph")&&!t.is("element","listItem"))return!1;const o=$(t,i,s);return!(!o||!r.is("element","p"))||!(o||!r.is("element","span"))}function o(t,i,s){if(s.has(t))return!1;const r=e.mapper.toViewElement(t);let o=i.length-1;for(let t=r.parent;!t.is("editableElement");t=t.parent){const e=O(t),s=B(t);if(!s&&!e)continue;const r="checkAttributes:"+(e?"item":"list");if(n.fire(r,{viewElement:t,modelAttributes:i[o]}))break;if(s&&(o--,o<0))return!1}return!0}}(e,t.editing,i,this),{priority:"high"}),this.on("checkAttributes:item",((t,{viewElement:e,modelAttributes:i})=>{e.id!=i.listItemId&&(t.return=!0,t.stop())})),this.on("checkAttributes:list",((t,{viewElement:e,modelAttributes:i})=>{e.name==F(i.listType)&&e.id==M(i.listType,i.listIndent)||(t.return=!0,t.stop())}))}_setupModelPostFixing(){const t=this.editor.model,e=this.getListAttributeNames();t.document.registerPostFixer((i=>function(t,e,i,n){const s=t.document.differ.getChanges(),r=new Set,o=new Set,l=n.editor.config.get("list.multiBlock");let c=!1;for(const n of s){if("insert"==n.type&&"$text"!=n.name){const s=n.position.nodeAfter;if(!t.schema.checkAttribute(s,"listItemId"))for(const t of Array.from(s.getAttributeKeys()))i.includes(t)&&(e.removeAttribute(t,s),c=!0);z(n.position,o,r),n.attributes.has("listItemId")||z(n.position.getShiftedBy(n.length),o,r);for(const{item:e,previousPosition:i}of t.createRangeIn(s))d(e)&&z(i,o,r)}else"remove"==n.type?z(n.position,o,r):"attribute"==n.type&&i.includes(n.attributeKey)&&(z(n.range.start,o,r),null===n.attributeNewValue&&z(n.range.start.getShiftedBy(1),o,r));if(!l&&"attribute"==n.type&&lt.includes(n.attributeKey)){const t=n.range.start.nodeAfter;null===n.attributeNewValue&&t&&t.is("element","listItem")?(e.rename(t,"paragraph"),c=!0):null===n.attributeOldValue&&t&&t.is("element")&&"listItem"!=t.name&&(e.rename(t,"listItem"),c=!0)}}const u=new Set;for(const t of o.values())c=n.fire("postFixer",{listNodes:new a(t),listHead:t,writer:e,seenIds:u})||c;return c}(t,i,e,this))),this.on("postFixer",((t,{listNodes:e,writer:i})=>{t.return=function(t,e){let i=0,n=-1,s=null,r=!1;for(const{node:o}of t){const t=o.getAttribute("listIndent");if(t>i){let l;null===s?(s=t-i,l=i):(s>t&&(s=t),l=t-s),l>n+1&&(l=n+1),e.setAttribute("listIndent",l,o),r=!0,n=l}else s=null,i=t+1,n=t}return r}(e,i)||t.return}),{priority:"high"}),this.on("postFixer",((t,{listNodes:e,writer:i,seenIds:n})=>{t.return=function(t,e,i){const n=new Set;let s=!1;for(const{node:r}of t){if(n.has(r))continue;let t=r.getAttribute("listType"),o=r.getAttribute("listItemId");if(e.has(o)&&(o=c.next()),e.add(o),r.is("element","listItem"))r.getAttribute("listItemId")!=o&&(i.setAttribute("listItemId",o,r),s=!0);else for(const e of m(r,{direction:"forward"}))n.add(e),e.getAttribute("listType")!=t&&(o=c.next(),t=e.getAttribute("listType")),e.getAttribute("listItemId")!=o&&(i.setAttribute("listItemId",o,e),s=!0)}return s}(e,n,i)||t.return}),{priority:"high"})}_setupClipboardIntegration(){const t=this.editor.model,e=this.editor.plugins.get("ClipboardPipeline");this.listenTo(t,"insertContent",function(t){return(e,[i,n])=>{const s=i.is("documentFragment")?Array.from(i.getChildren()):[i];if(!s.length)return;const r=(n?t.createSelection(n):t.document.selection).getFirstPosition();let o;if(d(r.parent))o=r.parent;else{if(!d(r.nodeBefore)||!d(r.nodeAfter))return;o=r.nodeBefore}t.change((t=>{const e=o.getAttribute("listType"),i=o.getAttribute("listIndent"),n=s[0].getAttribute("listIndent")||0,r=Math.max(i-n,0);for(const i of s){const n=d(i);o.is("element","listItem")&&i.is("element","paragraph")&&t.rename(i,"listItem"),t.setAttributes({listIndent:(n?i.getAttribute("listIndent"):0)+r,listItemId:n?i.getAttribute("listItemId"):c.next(),listType:e},i)}}))}}(t),{priority:"high"}),this.listenTo(e,"outputTransformation",((e,i)=>{t.change((t=>{const e=Array.from(i.content.getChildren()),n=e[e.length-1];if(e.length>1&&n.is("element")&&n.isEmpty){e.slice(0,-1).every(d)&&t.remove(n)}if("copy"==i.method||"cut"==i.method){const e=Array.from(i.content.getChildren());k(e)&&I(e,t)}}))}))}_setupAccessibilityIntegration(){const t=this.editor,e=t.t;t.accessibility.addKeystrokeInfoGroup({id:"list",label:e("Keystrokes that can be used in a list"),keystrokes:[{label:e("Increase list item indent"),keystroke:"Tab"},{label:e("Decrease list item indent"),keystroke:"Shift+Tab"}]})}}function ct(t,e){const i=t.document.selection;if(!i.isCollapsed)return!_(t);if("forward"===e)return!0;const n=i.getFirstPosition().parent,s=n.previousSibling;return!t.schema.isObject(s)&&(!!s.isEmpty||k([n,s]))}var dt=i(311);function ut(t,e,i,n){t.ui.componentFactory.add(e,(()=>{const s=mt(dt.ButtonView,t,e,i,n);return s.set({tooltip:!0,isToggleable:!0}),s})),t.ui.componentFactory.add(`menuBar:${e}`,(()=>{const s=mt(dt.MenuBarMenuListItemButtonView,t,e,i,n);return s.set({role:"menuitemcheckbox",isToggleable:!0}),s}))}function mt(t,e,i,n,s){const r=e.commands.get(i),o=new t(e.locale);return o.set({label:n,icon:s}),o.bind("isOn","isEnabled").to(r,"value","isEnabled"),o.on("execute",(()=>{e.execute(i),e.editing.view.focus()})),o}var pt=i(355);class ft extends t.Plugin{static get pluginName(){return"ListUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor.t;this.editor.ui.componentFactory.has("numberedList")||ut(this.editor,"numberedList",t("Numbered List"),pt.IconNumberedList),this.editor.ui.componentFactory.has("bulletedList")||ut(this.editor,"bulletedList",t("Bulleted List"),pt.IconBulletedList)}}class gt extends t.Plugin{static get requires(){return[at,ft]}static get pluginName(){return"List"}static get isOfficialPlugin(){return!0}}class bt extends t.Command{refresh(){const t=this._getValue();this.value=t,this.isEnabled=null!=t}execute({startIndex:t=1}={}){const e=this.editor.model,i=e.document;let n=Array.from(i.selection.getSelectedBlocks()).filter((t=>d(t)&&L(t.getAttribute("listType"))));n=h(n),e.change((e=>{for(const i of n)e.setAttribute("listStart",t>=0?t:1,i)}))}_getValue(){const t=this.editor.model.document,e=(0,r.first)(t.selection.getSelectedBlocks());return e&&d(e)&&L(e.getAttribute("listType"))?e.getAttribute("listStart"):null}}const ht={},yt={},At={},wt=[{listStyle:"disc",typeAttribute:"disc",listType:"bulleted"},{listStyle:"circle",typeAttribute:"circle",listType:"bulleted"},{listStyle:"square",typeAttribute:"square",listType:"bulleted"},{listStyle:"decimal",typeAttribute:"1",listType:"numbered"},{listStyle:"decimal-leading-zero",typeAttribute:null,listType:"numbered"},{listStyle:"lower-roman",typeAttribute:"i",listType:"numbered"},{listStyle:"upper-roman",typeAttribute:"I",listType:"numbered"},{listStyle:"lower-alpha",typeAttribute:"a",listType:"numbered"},{listStyle:"upper-alpha",typeAttribute:"A",listType:"numbered"},{listStyle:"lower-latin",typeAttribute:"a",listType:"numbered"},{listStyle:"upper-latin",typeAttribute:"A",listType:"numbered"}];for(const{listStyle:t,typeAttribute:e,listType:i}of wt)ht[t]=i,yt[t]=e,e&&(At[e]=t);function It(){return wt.map((t=>t.listStyle))}function kt(t){return ht[t]||null}function vt(t){return At[t]||null}function _t(t){return yt[t]||null}function Tt(t){switch(t){case"lower-alpha":return"lower-latin";case"upper-alpha":return"upper-latin";default:return t}}class Lt extends t.Command{defaultType;_supportedTypes;constructor(t,e,i){super(t),this.defaultType=e,this._supportedTypes=i}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){const e=this.editor.model,i=e.document;e.change((e=>{this._tryToConvertItemsToList(t);let n=Array.from(i.selection.getSelectedBlocks()).filter((t=>t.hasAttribute("listType")));if(n.length){n=h(n);for(const i of n)e.setAttribute("listStyle",t.type||this.defaultType,i)}}))}isStyleTypeSupported(t){return!this._supportedTypes||this._supportedTypes.includes(t)}_getValue(){const t=(0,r.first)(this.editor.model.document.selection.getSelectedBlocks());return d(t)?t.getAttribute("listStyle"):null}_checkEnabled(){const t=this.editor,e=t.commands.get("numberedList"),i=t.commands.get("bulletedList");return e.isEnabled||i.isEnabled}_tryToConvertItemsToList(t){if(!t.type)return;const e=kt(t.type);if(!e)return;const i=this.editor,n=`${e}List`;i.commands.get(n).value||i.execute(n)}}class St extends t.Command{refresh(){const t=this._getValue();this.value=t,this.isEnabled=null!=t}execute(t={}){const e=this.editor.model,i=e.document;let n=Array.from(i.selection.getSelectedBlocks()).filter((t=>d(t)&&"numbered"==t.getAttribute("listType")));n=h(n),e.change((e=>{for(const i of n)e.setAttribute("listReversed",!!t.reversed,i)}))}_getValue(){const t=this.editor.model.document,e=(0,r.first)(t.selection.getSelectedBlocks());return d(e)&&"numbered"==e.getAttribute("listType")?e.getAttribute("listReversed"):null}}function xt(t){return(e,i,n)=>{const{writer:s,schema:r,consumable:o}=n;if(!1===o.test(i.viewItem,t.viewConsumables))return;i.modelRange||Object.assign(i,n.convertChildren(i.viewItem,i.modelCursor));let l=!1;for(const e of i.modelRange.getItems({shallow:!0}))r.checkAttribute(e,t.attributeName)&&t.appliesToListItem(e)&&(e.hasAttribute(t.attributeName)||(s.setAttribute(t.attributeName,t.getAttributeOnUpcast(i.viewItem),e),l=!0));l&&o.consume(i.viewItem,t.viewConsumables)}}class Ct extends t.Plugin{static get pluginName(){return"ListPropertiesUtils"}static get isOfficialPlugin(){return!0}getAllSupportedStyleTypes(){return It()}getListTypeFromListStyleType(t){return kt(t)}getListStyleTypeFromTypeAttribute(t){return vt(t)}getTypeAttributeFromListStyleType(t){return _t(t)}}function Pt(t){const{startIndex:e,reversed:i,styles:n}=t;return{styles:Et(n),startIndex:e||!1,reversed:i||!1}}function Et(t){const e={listTypes:["bulleted","numbered"],useAttribute:!1};return!0===t||(t?Array.isArray(t)||"string"==typeof t?e.listTypes=(0,r.toArray)(t):(e.listTypes=t.listTypes?(0,r.toArray)(t.listTypes):e.listTypes,e.useAttribute=!!t.useAttribute,t.listStyleTypes&&(e.listStyleTypes=t.listStyleTypes)):e.listTypes=[]),e}const Vt="default";class Nt extends t.Plugin{static get requires(){return[at,Ct]}static get pluginName(){return"ListPropertiesEditing"}static get isOfficialPlugin(){return!0}constructor(t){super(t),t.config.define("list.properties",{styles:!0,startIndex:!1,reversed:!1})}init(){const t=this.editor,e=t.model,i=t.plugins.get(at),n=function(t){const e=[],i=Pt(t);if(t.styles){const t=i.styles.useAttribute;e.push({attributeName:"listStyle",defaultValue:Vt,viewConsumables:{styles:"list-style-type"},addCommand(e){let i=It();t&&(i=i.filter((t=>!!_t(t)))),e.commands.add("listStyle",new Lt(e,Vt,i))},appliesToListItem:t=>"numbered"==t.getAttribute("listType")||"bulleted"==t.getAttribute("listType"),hasValidAttribute(t){if(!this.appliesToListItem(t))return!t.hasAttribute("listStyle");if(!t.hasAttribute("listStyle"))return!1;const e=t.getAttribute("listStyle");return e==Vt||kt(e)==t.getAttribute("listType")},setAttributeOnDowncast(e,i,n){if(i&&i!==Vt){if(!t)return void e.setStyle("list-style-type",i,n);{const t=_t(i);if(t)return void e.setAttribute("type",t,n)}}e.removeStyle("list-style-type",n),e.removeAttribute("type",n)},getAttributeOnUpcast(t){const e=t.getStyle("list-style-type");if(e)return Tt(e);const i=t.getAttribute("type");return i?vt(i):Vt}})}t.reversed&&e.push({attributeName:"listReversed",defaultValue:!1,viewConsumables:{attributes:"reversed"},addCommand(t){t.commands.add("listReversed",new St(t))},appliesToListItem:t=>"numbered"==t.getAttribute("listType"),hasValidAttribute(t){return this.appliesToListItem(t)==t.hasAttribute("listReversed")},setAttributeOnDowncast(t,e,i){e?t.setAttribute("reversed","reversed",i):t.removeAttribute("reversed",i)},getAttributeOnUpcast:t=>t.hasAttribute("reversed")});t.startIndex&&e.push({attributeName:"listStart",defaultValue:1,viewConsumables:{attributes:"start"},addCommand(t){t.commands.add("listStart",new bt(t))},appliesToListItem:t=>L(t.getAttribute("listType")),hasValidAttribute(t){return this.appliesToListItem(t)==t.hasAttribute("listStart")},setAttributeOnDowncast(t,e,i){0==e||e>1?t.setAttribute("start",e,i):t.removeAttribute("start",i)},getAttributeOnUpcast(t){const e=t.getAttribute("start");return e>=0?e:1}});return e}(t.config.get("list.properties"));for(const s of n)s.addCommand(t),e.schema.extend("$listItem",{allowAttributes:s.attributeName}),i.registerDowncastStrategy({scope:"list",attributeName:s.attributeName,setAttributeOnDowncast(t,e,i){s.setAttributeOnDowncast(t,e,i)}});t.conversion.for("upcast").add((t=>{for(const e of n)t.on("element:ol",xt(e)),t.on("element:ul",xt(e))})),i.on("checkAttributes:list",((t,{viewElement:e,modelAttributes:i})=>{for(const s of n)s.getAttributeOnUpcast(e)!=i[s.attributeName]&&(t.return=!0,t.stop())})),this.listenTo(t.commands.get("indentList"),"afterExecute",((t,i)=>{e.change((t=>{for(const e of i)for(const i of n)i.appliesToListItem(e)&&t.setAttribute(i.attributeName,i.defaultValue,e)}))})),i.on("postFixer",((t,{listNodes:e,writer:i})=>{for(const{node:s}of e)for(const e of n)e.hasValidAttribute(s)||(e.appliesToListItem(s)?i.setAttribute(e.attributeName,e.defaultValue,s):i.removeAttribute(e.attributeName,s),t.return=!0)})),i.on("postFixer",((t,{listNodes:e,writer:i})=>{for(const{node:s,previousNodeInList:r}of e)if(r&&r.getAttribute("listType")==s.getAttribute("listType"))for(const e of n){const{attributeName:n}=e;if(!e.appliesToListItem(s))continue;const o=r.getAttribute(n);s.getAttribute(n)!=o&&(i.setAttribute(n,o,s),t.return=!0)}}))}}var Bt=i(266),Ot={attributes:{"data-cke":!0}};Ot.setAttributes=tt(),Ot.insert=Q().bind(null,"head"),Ot.domAPI=Z(),Ot.insertStyleElement=it();H()(Bt.A,Ot);Bt.A&&Bt.A.locals&&Bt.A.locals;class Rt extends dt.View{children;stylesView=null;additionalPropertiesCollapsibleView=null;startIndexFieldView=null;reversedSwitchButtonView=null;focusTracker=new r.FocusTracker;keystrokes=new r.KeystrokeHandler;focusables=new dt.ViewCollection;focusCycler;constructor(t,{enabledProperties:e,styleButtonViews:i,styleGridAriaLabel:n}){super(t);const s=["ck","ck-list-properties"];this.children=this.createCollection(),this.focusCycler=new dt.FocusCycler({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),i&&i.length?(this.stylesView=this._createStylesView(i,n),this.children.add(this.stylesView)):s.push("ck-list-properties_without-styles"),(e.startIndex||e.reversed)&&(this._addNumberedListPropertyViews(e),s.push("ck-list-properties_with-numbered-properties")),this.setTemplate({tag:"div",attributes:{class:s},children:this.children})}render(){if(super.render(),this.stylesView){this.focusables.add(this.stylesView),this.focusTracker.add(this.stylesView.element),(this.startIndexFieldView||this.reversedSwitchButtonView)&&(this.focusables.add(this.children.last.buttonView),this.focusTracker.add(this.children.last.buttonView.element));for(const t of this.stylesView.children)this.stylesView.focusTracker.add(t.element);(0,dt.addKeyboardHandlingForGrid)({keystrokeHandler:this.stylesView.keystrokes,focusTracker:this.stylesView.focusTracker,gridItems:this.stylesView.children,numberOfColumns:()=>r.global.window.getComputedStyle(this.stylesView.element).getPropertyValue("grid-template-columns").split(" ").length,uiLanguageDirection:this.locale&&this.locale.uiLanguageDirection})}if(this.startIndexFieldView){this.focusables.add(this.startIndexFieldView),this.focusTracker.add(this.startIndexFieldView.element);const t=t=>t.stopPropagation();this.keystrokes.set("arrowright",t),this.keystrokes.set("arrowleft",t),this.keystrokes.set("arrowup",t),this.keystrokes.set("arrowdown",t)}this.reversedSwitchButtonView&&(this.focusables.add(this.reversedSwitchButtonView),this.focusTracker.add(this.reversedSwitchButtonView.element)),this.keystrokes.listenTo(this.element)}focus(){this.focusCycler.focusFirst()}focusLast(){this.focusCycler.focusLast()}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createStylesView(t,e){const i=new dt.View(this.locale);return i.children=i.createCollection(),i.children.addMany(t),i.setTemplate({tag:"div",attributes:{"aria-label":e,class:["ck","ck-list-styles-list"]},children:i.children}),i.children.delegate("execute").to(this),i.focus=function(){for(const t of this.children)if(t instanceof dt.ButtonView&&t.isOn)return void t.focus();this.children.first.focus()},i.focusTracker=new r.FocusTracker,i.keystrokes=new r.KeystrokeHandler,i.render(),i.keystrokes.listenTo(i.element),i}_addNumberedListPropertyViews(t){const e=this.locale.t,i=[];t.startIndex&&(this.startIndexFieldView=this._createStartIndexField(),i.push(this.startIndexFieldView)),t.reversed&&(this.reversedSwitchButtonView=this._createReversedSwitchButton(),i.push(this.reversedSwitchButtonView)),this.stylesView?(this.additionalPropertiesCollapsibleView=new dt.CollapsibleView(this.locale,i),this.additionalPropertiesCollapsibleView.set({label:e("List properties"),isCollapsed:!0}),this.additionalPropertiesCollapsibleView.buttonView.bind("isEnabled").toMany(i,"isEnabled",((...t)=>t.some((t=>t)))),this.additionalPropertiesCollapsibleView.buttonView.on("change:isEnabled",((t,e,i)=>{i||(this.additionalPropertiesCollapsibleView.isCollapsed=!0)})),this.children.add(this.additionalPropertiesCollapsibleView)):this.children.addMany(i)}_createStartIndexField(){const t=this.locale.t,e=new dt.LabeledFieldView(this.locale,dt.createLabeledInputNumber);return e.set({label:t("Start at"),class:"ck-numbered-list-properties__start-index"}),e.fieldView.set({min:0,step:1,value:1,inputMode:"numeric"}),e.fieldView.on("input",(()=>{const i=e.fieldView.element,n=i.valueAsNumber;Number.isNaN(n)?e.errorText=t("Invalid start index value."):i.checkValidity()?this.fire("listStart",{startIndex:n}):e.errorText=t("Start index must be greater than 0.")})),e}_createReversedSwitchButton(){const t=this.locale.t,e=new dt.SwitchButtonView(this.locale);return e.set({withText:!0,label:t("Reversed order"),class:"ck-numbered-list-properties__reversed-order"}),e.delegate("execute").to(this,"listReversed"),e}}var Dt=i(263),Ft={attributes:{"data-cke":!0}};Ft.setAttributes=tt(),Ft.insert=Q().bind(null,"head"),Ft.domAPI=Z(),Ft.insertStyleElement=it();H()(Dt.A,Ft);Dt.A&&Dt.A.locals&&Dt.A.locals;class Mt extends t.Plugin{static get pluginName(){return"ListPropertiesUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=t.locale.t,i=t.config.get("list.properties"),n=Pt(i),s=n.styles.listTypes;if(s.includes("bulleted")){const i=[{label:e("Toggle the disc list style"),tooltip:e("Disc"),type:"disc",icon:pt.IconListStyleDisc},{label:e("Toggle the circle list style"),tooltip:e("Circle"),type:"circle",icon:pt.IconListStyleCircle},{label:e("Toggle the square list style"),tooltip:e("Square"),type:"square",icon:pt.IconListStyleSquare}],s=e("Bulleted List"),r=e("Bulleted list styles toolbar"),o="bulletedList";t.ui.componentFactory.add(o,zt({editor:t,normalizedConfig:n,parentCommandName:o,buttonLabel:s,buttonIcon:pt.IconBulletedList,styleGridAriaLabel:r,styleDefinitions:i})),t.ui.componentFactory.add(`menuBar:${o}`,Kt({editor:t,normalizedConfig:n,parentCommandName:o,buttonLabel:s,styleGridAriaLabel:r,styleDefinitions:i}))}if(s.includes("numbered")||i.startIndex||i.reversed){const i=[{label:e("Toggle the decimal list style"),tooltip:e("Decimal"),type:"decimal",icon:pt.IconListStyleDecimal},{label:e("Toggle the decimal with leading zero list style"),tooltip:e("Decimal with leading zero"),type:"decimal-leading-zero",icon:pt.IconListStyleDecimalLeadingZero},{label:e("Toggle the lower–roman list style"),tooltip:e("Lower–roman"),type:"lower-roman",icon:pt.IconListStyleLowerRoman},{label:e("Toggle the upper–roman list style"),tooltip:e("Upper-roman"),type:"upper-roman",icon:pt.IconListStyleUpperRoman},{label:e("Toggle the lower–latin list style"),tooltip:e("Lower-latin"),type:"lower-latin",icon:pt.IconListStyleLowerLatin},{label:e("Toggle the upper–latin list style"),tooltip:e("Upper-latin"),type:"upper-latin",icon:pt.IconListStyleUpperLatin}],r=e("Numbered List"),o=e("Numbered list styles toolbar"),l="numberedList";t.ui.componentFactory.add(l,zt({editor:t,normalizedConfig:n,parentCommandName:l,buttonLabel:r,buttonIcon:pt.IconNumberedList,styleGridAriaLabel:o,styleDefinitions:i})),s.includes("numbered")&&t.ui.componentFactory.add(`menuBar:${l}`,Kt({editor:t,normalizedConfig:n,parentCommandName:l,buttonLabel:r,styleGridAriaLabel:o,styleDefinitions:i}))}}}function zt({editor:t,normalizedConfig:e,parentCommandName:i,buttonLabel:n,buttonIcon:s,styleGridAriaLabel:r,styleDefinitions:o}){const l=t.commands.get(i);return a=>{const c=(0,dt.createDropdown)(a,dt.SplitButtonView),d=c.buttonView;return c.bind("isEnabled").to(l),c.class="ck-list-styles-dropdown",d.on("execute",(()=>{t.execute(i),t.editing.view.focus()})),d.set({label:n,icon:s,tooltip:!0,isToggleable:!0}),d.bind("isOn").to(l,"value",(t=>!!t)),c.once("change:isOpen",(()=>{const n=function({editor:t,normalizedConfig:e,dropdownView:i,parentCommandName:n,styleDefinitions:s,styleGridAriaLabel:r}){const o=t.locale,l={...e,..."numberedList"!=n?{startIndex:!1,reversed:!1}:null},a=n.replace("List","");let c=null;if(e.styles.listTypes.includes(a)){const i=t.commands.get("listStyle"),r=jt({editor:t,parentCommandName:n,listStyleCommand:i}),o=e.styles.listStyleTypes;let l=s;if(o){const t=o[a];t&&(l=s.filter((e=>t.includes(e.type))))}const d=Ut(i);c=l.filter(d).map(r)}const d=new Rt(o,{styleGridAriaLabel:r,enabledProperties:l,styleButtonViews:c});e.styles.listTypes.includes(a)&&(0,dt.focusChildOnDropdownOpen)(i,(()=>d.stylesView.children.find((t=>t.isOn))));if(l.startIndex){const e=t.commands.get("listStart");d.startIndexFieldView.bind("isEnabled").to(e),d.startIndexFieldView.fieldView.bind("value").to(e),d.on("listStart",((e,i)=>t.execute("listStart",i)))}if(l.reversed){const e=t.commands.get("listReversed");d.reversedSwitchButtonView.bind("isEnabled").to(e),d.reversedSwitchButtonView.bind("isOn").to(e,"value",(t=>!!t)),d.on("listReversed",(()=>{const i=e.value;t.execute("listReversed",{reversed:!i})}))}return d.delegate("execute").to(i),d}({editor:t,normalizedConfig:e,dropdownView:c,parentCommandName:i,styleGridAriaLabel:r,styleDefinitions:o});c.panelView.children.add(n)})),c.on("execute",(()=>{t.editing.view.focus()})),c}}function jt({editor:t,listStyleCommand:e,parentCommandName:i}){const n=t.locale,s=t.commands.get(i);return({label:r,type:o,icon:l,tooltip:a})=>{const c=new dt.ButtonView(n);return c.set({label:r,icon:l,tooltip:a}),c.bind("isOn").to(e,"value",(t=>t===o)),c.on("execute",(()=>{s.value?e.value===o?t.execute(i):e.value!==o&&t.execute("listStyle",{type:o}):t.model.change((()=>{t.execute("listStyle",{type:o})}))})),c}}function Kt({editor:t,normalizedConfig:e,parentCommandName:i,buttonLabel:n,styleGridAriaLabel:s,styleDefinitions:r}){return o=>{const l=new dt.MenuBarMenuView(o),a=t.commands.get(i),c=t.commands.get("listStyle"),d=Ut(c),u=jt({editor:t,parentCommandName:i,listStyleCommand:c}),m=e.styles.listStyleTypes;let p=r;if(m){const t=m[a.type];t&&(p=r.filter((e=>t.includes(e.type))))}const f=p.filter(d).map(u),g=new Rt(o,{styleGridAriaLabel:s,enabledProperties:{...e,startIndex:!1,reversed:!1},styleButtonViews:f});return g.delegate("execute").to(l),l.buttonView.set({label:n,icon:"bulletedList"===i?pt.IconBulletedList:pt.IconNumberedList}),l.panelView.children.add(g),l.bind("isEnabled").to(a,"isEnabled"),l.on("execute",(()=>{t.editing.view.focus()})),l}}function Ut(t){return"function"==typeof t.isStyleTypeSupported?e=>t.isStyleTypeSupported(e.type):()=>!0}class qt extends t.Plugin{static get requires(){return[Nt,Mt]}static get pluginName(){return"ListProperties"}static get isOfficialPlugin(){return!0}}var $t=i(783);class Wt extends t.Command{constructor(t){super(t),this.on("execute",(()=>{this.refresh()}),{priority:"highest"})}refresh(){const t=this._getSelectedItems();this.value=this._getValue(t),this.isEnabled=!!t.length}execute(t={}){this.editor.model.change((e=>{const i=this._getSelectedItems(),n=void 0===t.forceValue?!this._getValue(i):t.forceValue;for(const t of i)n?e.setAttribute("todoListChecked",!0,t):e.removeAttribute("todoListChecked",t)}))}_getValue(t){return t.every((t=>t.getAttribute("todoListChecked")))}_getSelectedItems(){const t=this.editor.model,e=t.schema,i=t.document.selection.getFirstRange(),n=i.start.parent,s=[];e.checkAttribute(n,"todoListChecked")&&s.push(...u(n));for(const t of i.getItems({shallow:!0}))e.checkAttribute(t,"todoListChecked")&&!s.includes(t)&&s.push(...u(t));return s}}class Gt extends $t.DomEventObserver{domEventType=["change"];onDomEvent(t){if(t.target){const e=this.view.domConverter.mapDomToView(t.target);e&&e.is("element","input")&&"checkbox"==e.getAttribute("type")&&e.findAncestor({classes:"todo-list__label"})&&this.fire("todoCheckboxChange",t)}}}const Ht=(0,r.parseKeystroke)("Ctrl+Enter");class Yt extends t.Plugin{static get pluginName(){return"TodoListEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[at]}init(){const t=this.editor,e=t.model,i=t.editing,n=t.plugins.get(at),s=t.config.get("list.multiBlock")?"paragraph":"listItem";t.commands.add("todoList",new P(t,"todo")),t.commands.add("checkTodoList",new Wt(t)),i.view.addObserver(Gt),e.schema.extend("$listItem",{allowAttributes:"todoListChecked"}),e.schema.addAttributeCheck((t=>{const e=t.last;if(!e.getAttribute("listItemId")||"todo"!=e.getAttribute("listType"))return!1}),"todoListChecked"),t.conversion.for("upcast").add((t=>{t.on("element:input",((t,e,i)=>{const n=e.modelCursor,s=n.parent,r=e.viewItem;if(!i.consumable.test(r,{name:!0}))return;if("checkbox"!=r.getAttribute("type")||!n.isAtStart||!s.hasAttribute("listType"))return;i.consumable.consume(r,{name:!0});const o=i.writer;o.setAttribute("listType","todo",s),e.viewItem.hasAttribute("checked")&&o.setAttribute("todoListChecked",!0,s),e.modelRange=o.createRange(n)})),t.on("element:li",((t,e,i)=>{const{writer:n,schema:s}=i;if(!e.modelRange)return;const r=Array.from(e.modelRange.getItems({shallow:!0})).filter((t=>"todo"===t.getAttribute("listType")&&s.checkAttribute(t,"listItemId"))).reduce(((t,e)=>{const i=e.getAttribute("listItemId");return t.has(i)||t.set(i,u(e)),t}),new Map);for(const[,t]of r.entries())if(t.some((t=>t.getAttribute("todoListChecked"))))for(const e of t)n.setAttribute("todoListChecked",!0,e)}),{priority:"low"}),t.on("element:label",Zt({name:"label",classes:"todo-list__label"})),t.on("element:label",Zt({name:"label",classes:["todo-list__label","todo-list__label_without-description"]})),t.on("element:span",Zt({name:"span",classes:"todo-list__label__description"})),t.on("element:ul",function(t){const e=new $t.Matcher(t);return(t,i,n)=>{const s=e.match(i.viewItem);if(!s)return;const r=s.match;r.name=!1,n.consumable.consume(i.viewItem,r)}}({name:"ul",classes:"todo-list"}))})),t.conversion.for("downcast").elementToElement({model:s,view:(t,{writer:e})=>{if(Jt(t,n.getListAttributeNames()))return e.createContainerElement("span",{class:"todo-list__label__description"})},converterPriority:"highest"}),n.registerDowncastStrategy({scope:"list",attributeName:"listType",setAttributeOnDowncast(t,e,i){"todo"==e?t.addClass("todo-list",i):t.removeClass("todo-list",i)}}),n.registerDowncastStrategy({scope:"itemMarker",attributeName:"todoListChecked",createElement(t,e,{dataPipeline:i}){if("todo"!=e.getAttribute("listType"))return null;const n=t.createUIElement("input",{type:"checkbox",...e.getAttribute("todoListChecked")?{checked:"checked"}:null,...i?{disabled:"disabled"}:{tabindex:"-1"}});if(i)return n;const s=t.createContainerElement("span",{contenteditable:"false"},n);return s.getFillerOffset=()=>null,s},canWrapElement:t=>Jt(t,n.getListAttributeNames()),createWrapperElement(t,e,{dataPipeline:i}){const s=["todo-list__label"];return Jt(e,n.getListAttributeNames())||s.push("todo-list__label_without-description"),t.createAttributeElement(i?"label":"span",{class:s.join(" ")})}}),n.on("checkElement",((t,{modelElement:e,viewElement:i})=>{const s=Jt(e,n.getListAttributeNames());i.hasClass("todo-list__label__description")!=s&&(t.return=!0,t.stop())})),n.on("checkElement",((e,{modelElement:i,viewElement:n})=>{const s="todo"==i.getAttribute("listType")&&f(i);let r=!1;const o=t.editing.view.createPositionBefore(n).getWalker({direction:"backward"});for(const{item:e}of o){if(e.is("element")&&t.editing.mapper.toModelElement(e))break;e.is("element","input")&&"checkbox"==e.getAttribute("type")&&(r=!0)}r!=s&&(e.return=!0,e.stop())})),n.on("postFixer",((t,{listNodes:e,writer:i})=>{for(const{node:n,previousNodeInList:s}of e){if(!s)continue;if(s.getAttribute("listItemId")!=n.getAttribute("listItemId"))continue;const e=s.hasAttribute("todoListChecked"),r=n.hasAttribute("todoListChecked");r&&!e?(i.removeAttribute("todoListChecked",n),t.return=!0):!r&&e&&(i.setAttribute("todoListChecked",!0,n),t.return=!0)}})),e.document.registerPostFixer((t=>{const i=e.document.differ.getChanges();let n=!1;for(const e of i)if("attribute"==e.type&&"listType"==e.attributeKey){const i=e.range.start.nodeAfter;"todo"==e.attributeOldValue&&i.hasAttribute("todoListChecked")&&(t.removeAttribute("todoListChecked",i),n=!0)}else if("insert"==e.type&&"$text"!=e.name)for(const{item:i}of t.createRangeOn(e.position.nodeAfter))i.is("element")&&"todo"!=i.getAttribute("listType")&&i.hasAttribute("todoListChecked")&&(t.removeAttribute("todoListChecked",i),n=!0);return n})),this.listenTo(i.view.document,"keydown",((e,i)=>{(0,r.getCode)(i)===Ht&&(t.execute("checkTodoList"),e.stop())}),{priority:"high"}),this.listenTo(i.view.document,"todoCheckboxChange",((t,e)=>{const n=e.target;if(!n||!n.is("element","input"))return;const s=i.view.createPositionAfter(n),r=i.mapper.toModelPosition(s).parent;r&&d(r)&&"todo"==r.getAttribute("listType")&&this._handleCheckmarkChange(r)})),this.listenTo(i.view.document,"arrowKey",function(t,e){return(i,n)=>{const s=(0,r.getLocalizedArrowKeyCodeDirection)(n.keyCode,e.contentLanguageDirection),o=t.schema,l=t.document.selection;if(!l.isCollapsed)return;const a=l.getFirstPosition(),c=a.parent;if("right"==s&&a.isAtEnd){const e=o.getNearestSelectionRange(t.createPositionAfter(c),"forward");if(!e)return;const s=e.start.parent;s&&d(s)&&"todo"==s.getAttribute("listType")&&(t.change((t=>t.setSelection(e))),n.preventDefault(),n.stopPropagation(),i.stop())}else if("left"==s&&a.isAtStart&&d(c)&&"todo"==c.getAttribute("listType")){const e=o.getNearestSelectionRange(t.createPositionBefore(c),"backward");if(!e)return;t.change((t=>t.setSelection(e))),n.preventDefault(),n.stopPropagation(),i.stop()}}}(e,t.locale),{context:"$text"}),this.listenTo(i.mapper,"viewToModelPosition",((t,i)=>{const n=i.viewPosition.parent,s=n.is("attributeElement","li")&&0==i.viewPosition.offset,r=Qt(n)&&i.viewPosition.offset<=1,o=n.is("element","span")&&"false"==n.getAttribute("contenteditable")&&Qt(n.parent);if(!s&&!r&&!o)return;const l=i.modelPosition.nodeAfter;l&&"todo"==l.getAttribute("listType")&&(i.modelPosition=e.createPositionAt(l,0))}),{priority:"low"}),this._initAriaAnnouncements()}_handleCheckmarkChange(t){const e=this.editor,i=e.model,n=Array.from(i.document.selection.getRanges());i.change((i=>{i.setSelection(t,"end"),e.execute("checkTodoList"),i.setSelection(n)}))}_initAriaAnnouncements(){const{model:t,ui:e,t:i}=this.editor;let n=null;e&&t.document.selection.on("change:range",(()=>{const s=t.document.selection.focus.parent,r=Xt(n),o=Xt(s);r&&!o?e.ariaLiveAnnouncer.announce(i("Leaving a to-do list")):!r&&o&&e.ariaLiveAnnouncer.announce(i("Entering a to-do list")),n=s}))}}function Zt(t){const e=new $t.Matcher(t);return(t,i,n)=>{const s=e.match(i.viewItem);s&&n.consumable.consume(i.viewItem,s.match)&&Object.assign(i,n.convertChildren(i.viewItem,i.modelCursor))}}function Jt(t,e){return(t.is("element","paragraph")||t.is("element","listItem"))&&"todo"==t.getAttribute("listType")&&f(t)&&function(t,e){for(const i of t.getAttributeKeys())if(!i.startsWith("selection:")&&!e.includes(i))return!1;return!0}(t,e)}function Qt(t){return!!t&&t.is("attributeElement")&&t.hasClass("todo-list__label")}function Xt(t){return!!t&&(!(!t.is("element","paragraph")&&!t.is("element","listItem"))&&"todo"==t.getAttribute("listType"))}class te extends t.Plugin{static get pluginName(){return"TodoListUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor.t;ut(this.editor,"todoList",t("To-do List"),pt.IconTodoList)}}var ee=i(825),ie={attributes:{"data-cke":!0}};ie.setAttributes=tt(),ie.insert=Q().bind(null,"head"),ie.domAPI=Z(),ie.insertStyleElement=it();H()(ee.A,ie);ee.A&&ee.A.locals&&ee.A.locals;class ne extends t.Plugin{static get requires(){return[Yt,te]}static get pluginName(){return"TodoList"}static get isOfficialPlugin(){return!0}}class se extends t.Command{type;constructor(t,e){super(t),this.type=e}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){const e=this.editor.model,i=e.document,n=Array.from(i.selection.getSelectedBlocks()).filter((t=>oe(t,e.schema))),s=void 0!==t.forceValue?!t.forceValue:this.value;e.change((t=>{if(s){let e=n[n.length-1].nextSibling,i=Number.POSITIVE_INFINITY,s=[];for(;e&&"listItem"==e.name&&0!==e.getAttribute("listIndent");){const t=e.getAttribute("listIndent");t<i&&(i=t);const n=t-i;s.push({element:e,listIndent:n}),e=e.nextSibling}s=s.reverse();for(const e of s)t.setAttribute("listIndent",e.listIndent,e.element)}if(!s){let t=Number.POSITIVE_INFINITY;for(const e of n)e.is("element","listItem")&&e.getAttribute("listIndent")<t&&(t=e.getAttribute("listIndent"));t=0===t?1:t,re(n,!0,t),re(n,!1,t)}for(const e of n.reverse())s&&"listItem"==e.name?t.rename(e,"paragraph"):s||"listItem"==e.name?s||"listItem"!=e.name||e.getAttribute("listType")==this.type||t.setAttribute("listType",this.type,e):(t.setAttributes({listType:this.type,listIndent:0},e),t.rename(e,"listItem"));this.fire("_executeCleanup",n)}))}_getValue(){const t=(0,r.first)(this.editor.model.document.selection.getSelectedBlocks());return!!t&&t.is("element","listItem")&&t.getAttribute("listType")==this.type}_checkEnabled(){if(this.value)return!0;const t=this.editor.model.document.selection,e=this.editor.model.schema,i=(0,r.first)(t.getSelectedBlocks());return!!i&&oe(i,e)}}function re(t,e,i){const n=e?t[0]:t[t.length-1];if(n.is("element","listItem")){let s=n[e?"previousSibling":"nextSibling"],r=n.getAttribute("listIndent");for(;s&&s.is("element","listItem")&&s.getAttribute("listIndent")>=i;)r>s.getAttribute("listIndent")&&(r=s.getAttribute("listIndent")),s.getAttribute("listIndent")==r&&t[e?"unshift":"push"](s),s=s[e?"previousSibling":"nextSibling"]}}function oe(t,e){return e.checkChild(t.parent,"listItem")&&!e.isObject(t)}class le extends t.Command{_indentBy;constructor(t,e){super(t),this._indentBy="forward"==e?1:-1}refresh(){this.isEnabled=this._checkEnabled()}execute(){const t=this.editor.model,e=t.document;let i=Array.from(e.selection.getSelectedBlocks());t.change((t=>{const e=i[i.length-1];let n=e.nextSibling;for(;n&&"listItem"==n.name&&n.getAttribute("listIndent")>e.getAttribute("listIndent");)i.push(n),n=n.nextSibling;this._indentBy<0&&(i=i.reverse());for(const e of i){const i=e.getAttribute("listIndent")+this._indentBy;i<0?t.rename(e,"paragraph"):t.setAttribute("listIndent",i,e)}this.fire("_executeCleanup",i)}))}_checkEnabled(){const t=(0,r.first)(this.editor.model.document.selection.getSelectedBlocks());if(!t||!t.is("element","listItem"))return!1;if(this._indentBy>0){const e=t.getAttribute("listIndent"),i=t.getAttribute("listType");let n=t.previousSibling;for(;n&&n.is("element","listItem")&&n.getAttribute("listIndent")>=e;){if(n.getAttribute("listIndent")==e)return n.getAttribute("listType")==i;n=n.previousSibling}return!1}return!0}}function ae(t,e){const i=e.mapper,n=e.writer,s="numbered"==t.getAttribute("listType")?"ol":"ul",r=function(t){const e=t.createContainerElement("li");return e.getFillerOffset=Ae,e}(n),o=n.createContainerElement(s,null);return n.insert(n.createPositionAt(o,0),r),i.bindElements(t,r),r}function ce(t,e,i,n){const s=e.parent,r=i.mapper,o=i.writer;let l=r.toViewPosition(n.createPositionBefore(t));const a=me(t.previousSibling,{sameIndent:!0,smallerIndent:!0,listIndent:t.getAttribute("listIndent")}),c=t.previousSibling;if(a&&a.getAttribute("listIndent")==t.getAttribute("listIndent")){const t=r.toViewElement(a);l=o.breakContainer(o.createPositionAfter(t))}else if(c&&"listItem"==c.name){l=r.toViewPosition(n.createPositionAt(c,"end"));const t=r.findMappedViewAncestor(l),e=pe(t);l=e?o.createPositionBefore(e):o.createPositionAt(t,"end")}else l=r.toViewPosition(n.createPositionBefore(t));if(l=ue(l),o.insert(l,s),c&&"listItem"==c.name){const t=r.toViewElement(c),i=o.createRange(o.createPositionAt(t,0),l).getWalker({ignoreElementEnd:!0});for(const t of i)if(t.item.is("element","li")){const n=o.breakContainer(o.createPositionBefore(t.item)),s=t.item.parent,r=o.createPositionAt(e,"end");de(o,r.nodeBefore,r.nodeAfter),o.move(o.createRangeOn(s),r),i._position=n}}else{const i=s.nextSibling;if(i&&(i.is("element","ul")||i.is("element","ol"))){let n=null;for(const e of i.getChildren()){const i=r.toModelElement(e);if(!(i&&i.getAttribute("listIndent")>t.getAttribute("listIndent")))break;n=e}n&&(o.breakContainer(o.createPositionAfter(n)),o.move(o.createRangeOn(n.parent),o.createPositionAt(e,"end")))}}de(o,s,s.nextSibling),de(o,s.previousSibling,s)}function de(t,e,i){return!e||!i||"ul"!=e.name&&"ol"!=e.name||e.name!=i.name||e.getAttribute("class")!==i.getAttribute("class")?null:t.mergeContainers(t.createPositionAfter(e))}function ue(t){return t.getLastMatchingPosition((t=>t.item.is("uiElement")))}function me(t,e){const i=!!e.sameIndent,n=!!e.smallerIndent,s=e.listIndent;let r=t;for(;r&&"listItem"==r.name;){const t=r.getAttribute("listIndent");if(i&&s==t||n&&s>t)return r;r="forward"===e.direction?r.nextSibling:r.previousSibling}return null}function pe(t){for(const e of t.getChildren())if("ul"==e.name||"ol"==e.name)return e;return null}function fe(t,e){const i=[],n=t.parent,s={ignoreElementEnd:!1,startPosition:t,shallow:!0,direction:e},r=n.getAttribute("listIndent"),o=[...new $t.TreeWalker(s)].filter((t=>t.item.is("element"))).map((t=>t.item));for(const t of o){if(!t.is("element","listItem"))break;if(t.getAttribute("listIndent")<r)break;if(!(t.getAttribute("listIndent")>r)){if(t.getAttribute("listType")!==n.getAttribute("listType"))break;if(t.getAttribute("listStyle")!==n.getAttribute("listStyle"))break;if(t.getAttribute("listReversed")!==n.getAttribute("listReversed"))break;if(t.getAttribute("listStart")!==n.getAttribute("listStart"))break;"backward"===e?i.unshift(t):i.push(t)}}return i}function ge(t){let e=[...t.document.selection.getSelectedBlocks()].filter((t=>t.is("element","listItem"))).map((e=>{const i=t.change((t=>t.createPositionAt(e,0)));return[...fe(i,"backward"),...fe(i,"forward")]})).flat();return e=[...new Set(e)],e}const be=["disc","circle","square"],he=["decimal","decimal-leading-zero","lower-roman","upper-roman","lower-latin","upper-latin"];function ye(t){return be.includes(t)?"bulleted":he.includes(t)?"numbered":null}function Ae(){const t=!this.isEmpty&&("ul"==this.getChild(0).name||"ol"==this.getChild(0).name);return this.isEmpty||t?0:$t.getFillerOffset.call(this)}class we extends t.Plugin{static get pluginName(){return"LegacyListUtils"}static get isOfficialPlugin(){return!0}getListTypeFromListStyleType(t){return ye(t)}getSelectedListItems(t){return ge(t)}getSiblingNodes(t,e){return fe(t,e)}}function Ie(t){return(e,i,n)=>{const s=n.consumable;if(!s.test(i.item,"insert")||!s.test(i.item,"attribute:listType")||!s.test(i.item,"attribute:listIndent"))return;s.consume(i.item,"insert"),s.consume(i.item,"attribute:listType"),s.consume(i.item,"attribute:listIndent");const r=i.item;ce(r,ae(r,n),n,t)}}const ke=(t,e,i)=>{if(!i.consumable.test(e.item,t.name))return;const n=i.mapper.toViewElement(e.item),s=i.writer;s.breakContainer(s.createPositionBefore(n)),s.breakContainer(s.createPositionAfter(n));const r=n.parent,o="numbered"==e.attributeNewValue?"ol":"ul";s.rename(o,r)},ve=(t,e,i)=>{i.consumable.consume(e.item,t.name);const n=i.mapper.toViewElement(e.item).parent,s=i.writer;de(s,n,n.nextSibling),de(s,n.previousSibling,n)};const _e=(t,e,i)=>{if(i.consumable.test(e.item,t.name)&&"listItem"!=e.item.name){let t=i.mapper.toViewPosition(e.range.start);const n=i.writer,s=[];for(;("ul"==t.parent.name||"ol"==t.parent.name)&&(t=n.breakContainer(t),"li"==t.parent.name);){const e=t,i=n.createPositionAt(t.parent,"end");if(!e.isEqual(i)){const t=n.remove(n.createRange(e,i));s.push(t)}t=n.createPositionAfter(t.parent)}if(s.length>0){for(let e=0;e<s.length;e++){const i=t.nodeBefore;if(t=n.insert(t,s[e]).end,e>0){const e=de(n,i,i.nextSibling);e&&e.parent==i&&t.offset--}}de(n,t.nodeBefore,t.nodeAfter)}}},Te=(t,e,i)=>{const n=i.mapper.toViewPosition(e.position),s=n.nodeBefore,r=n.nodeAfter;de(i.writer,s,r)},Le=(t,e,i)=>{if(i.consumable.consume(e.viewItem,{name:!0})){const t=i.writer,n=t.createElement("listItem"),s=function(t){let e=0,i=t.parent;for(;i;){if(i.is("element","li"))e++;else{const t=i.previousSibling;t&&t.is("element","li")&&e++}i=i.parent}return e}(e.viewItem);t.setAttribute("listIndent",s,n);const r=e.viewItem.parent&&"ol"==e.viewItem.parent.name?"numbered":"bulleted";if(t.setAttribute("listType",r,n),!i.safeInsert(n,e.modelCursor))return;const o=function(t,e,i){const{writer:n,schema:s}=i;let r=n.createPositionAfter(t);for(const o of e)if("ul"==o.name||"ol"==o.name)r=i.convertItem(o,r).modelCursor;else{const e=i.convertItem(o,n.createPositionAt(t,"end")),l=e.modelRange.start.nodeAfter;l&&l.is("element")&&!s.checkChild(t,l.name)&&(t=e.modelCursor.parent.is("element","listItem")?e.modelCursor.parent:Ee(e.modelCursor),r=n.createPositionAfter(t))}return r}(n,e.viewItem.getChildren(),i);e.modelRange=t.createRange(e.modelCursor,o),i.updateConversionResult(n,e)}},Se=(t,e,i)=>{if(i.consumable.test(e.viewItem,{name:!0})){const t=Array.from(e.viewItem.getChildren());for(const e of t){!(e.is("element","li")||Ne(e))&&e._remove()}}},xe=(t,e,i)=>{if(i.consumable.test(e.viewItem,{name:!0})){if(0===e.viewItem.childCount)return;const t=[...e.viewItem.getChildren()];let i=!1;for(const e of t)i&&!Ne(e)&&e._remove(),Ne(e)&&(i=!0)}};function Ce(t){return(e,i)=>{if(i.isPhantom)return;const n=i.modelPosition.nodeBefore;if(n&&n.is("element","listItem")){const e=i.mapper.toViewElement(n),s=e.getAncestors().find(Ne),r=t.createPositionAt(e,0).getWalker();for(const t of r){if("elementStart"==t.type&&t.item.is("element","li")){i.viewPosition=t.previousPosition;break}if("elementEnd"==t.type&&t.item==s){i.viewPosition=t.nextPosition;break}}}}}const Pe=function(t,[e,i]){const n=this;let s,r=e.is("documentFragment")?e.getChild(0):e;if(s=i?n.createSelection(i):n.document.selection,r&&r.is("element","listItem")){const t=s.getFirstPosition();let e=null;if(t.parent.is("element","listItem")?e=t.parent:t.nodeBefore&&t.nodeBefore.is("element","listItem")&&(e=t.nodeBefore),e){const t=e.getAttribute("listIndent");if(t>0)for(;r&&r.is("element","listItem");)r._setAttribute("listIndent",r.getAttribute("listIndent")+t),r=r.nextSibling}}};function Ee(t){const e=new $t.TreeWalker({startPosition:t});let i;do{i=e.next()}while(!i.value.item.is("element","listItem"));return i.value.item}function Ve(t,e,i,n,s,r){const o=me(e.nodeBefore,{sameIndent:!0,smallerIndent:!0,listIndent:t}),l=s.mapper,a=s.writer,c=o?o.getAttribute("listIndent"):null;let d;if(o)if(c==t){const t=l.toViewElement(o).parent;d=a.createPositionAfter(t)}else{const t=r.createPositionAt(o,"end");d=l.toViewPosition(t)}else d=i;d=ue(d);for(const t of[...n.getChildren()])Ne(t)&&(d=a.move(a.createRangeOn(t),d).end,de(a,t,t.nextSibling),de(a,t.previousSibling,t))}function Ne(t){return t.is("element","ol")||t.is("element","ul")}class Be extends t.Plugin{static get pluginName(){return"LegacyListEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[s.Enter,e.Delete,we]}init(){const t=this.editor;t.model.schema.register("listItem",{inheritAllFrom:"$block",allowAttributes:["listType","listIndent"]});const e=t.data,i=t.editing;var n;t.model.document.registerPostFixer((e=>function(t,e){const i=t.document.differ.getChanges(),n=new Map;let s=!1;for(const n of i)if("insert"==n.type&&"listItem"==n.name)r(n.position);else if("insert"==n.type&&"listItem"!=n.name){if("$text"!=n.name){const i=n.position.nodeAfter;i.hasAttribute("listIndent")&&(e.removeAttribute("listIndent",i),s=!0),i.hasAttribute("listType")&&(e.removeAttribute("listType",i),s=!0),i.hasAttribute("listStyle")&&(e.removeAttribute("listStyle",i),s=!0),i.hasAttribute("listReversed")&&(e.removeAttribute("listReversed",i),s=!0),i.hasAttribute("listStart")&&(e.removeAttribute("listStart",i),s=!0);for(const e of Array.from(t.createRangeIn(i)).filter((t=>t.item.is("element","listItem"))))r(e.previousPosition)}r(n.position.getShiftedBy(n.length))}else"remove"==n.type&&"listItem"==n.name?r(n.position):("attribute"==n.type&&"listIndent"==n.attributeKey||"attribute"==n.type&&"listType"==n.attributeKey)&&r(n.range.start);for(const t of n.values())o(t),l(t);return s;function r(t){const e=t.nodeBefore;if(e&&e.is("element","listItem")){let t=e;if(n.has(t))return;for(let e=t.previousSibling;e&&e.is("element","listItem");e=t.previousSibling)if(t=e,n.has(t))return;n.set(e,t)}else{const e=t.nodeAfter;e&&e.is("element","listItem")&&n.set(e,e)}}function o(t){let i=0,n=null;for(;t&&t.is("element","listItem");){const r=t.getAttribute("listIndent");if(r>i){let o;null===n?(n=r-i,o=i):(n>r&&(n=r),o=r-n),e.setAttribute("listIndent",o,t),s=!0}else n=null,i=t.getAttribute("listIndent")+1;t=t.nextSibling}}function l(t){let i=[],n=null;for(;t&&t.is("element","listItem");){const r=t.getAttribute("listIndent");if(n&&n.getAttribute("listIndent")>r&&(i=i.slice(0,r+1)),0!=r)if(i[r]){const n=i[r];t.getAttribute("listType")!=n&&(e.setAttribute("listType",n,t),s=!0)}else i[r]=t.getAttribute("listType");n=t,t=t.nextSibling}}}(t.model,e))),i.mapper.registerViewToModelLength("li",Oe),e.mapper.registerViewToModelLength("li",Oe),i.mapper.on("modelToViewPosition",Ce(i.view)),i.mapper.on("viewToModelPosition",(n=t.model,(t,e)=>{const i=e.viewPosition,s=i.parent,r=e.mapper;if("ul"==s.name||"ol"==s.name){if(i.isAtEnd){const t=r.toModelElement(i.nodeBefore),s=r.getModelLength(i.nodeBefore);e.modelPosition=n.createPositionBefore(t).getShiftedBy(s)}else{const t=r.toModelElement(i.nodeAfter);e.modelPosition=n.createPositionBefore(t)}t.stop()}else if("li"==s.name&&i.nodeBefore&&("ul"==i.nodeBefore.name||"ol"==i.nodeBefore.name)){const o=r.toModelElement(s);let l=1,a=i.nodeBefore;for(;a&&Ne(a);)l+=r.getModelLength(a),a=a.previousSibling;e.modelPosition=n.createPositionBefore(o).getShiftedBy(l),t.stop()}})),e.mapper.on("modelToViewPosition",Ce(i.view)),t.conversion.for("editingDowncast").add((e=>{e.on("insert",_e,{priority:"high"}),e.on("insert:listItem",Ie(t.model)),e.on("attribute:listType:listItem",ke,{priority:"high"}),e.on("attribute:listType:listItem",ve,{priority:"low"}),e.on("attribute:listIndent:listItem",function(t){return(e,i,n)=>{if(!n.consumable.consume(i.item,"attribute:listIndent"))return;const s=n.mapper.toViewElement(i.item),r=n.writer;r.breakContainer(r.createPositionBefore(s)),r.breakContainer(r.createPositionAfter(s));const o=s.parent,l=o.previousSibling,a=r.createRangeOn(o);r.remove(a),l&&l.nextSibling&&de(r,l,l.nextSibling),Ve(i.attributeOldValue+1,i.range.start,a.start,s,n,t),ce(i.item,s,n,t);for(const t of i.item.getChildren())n.consumable.consume(t,"insert")}}(t.model)),e.on("remove:listItem",function(t){return(e,i,n)=>{const s=n.mapper.toViewPosition(i.position).getLastMatchingPosition((t=>!t.item.is("element","li"))).nodeAfter,r=n.writer;r.breakContainer(r.createPositionBefore(s)),r.breakContainer(r.createPositionAfter(s));const o=s.parent,l=o.previousSibling,a=r.createRangeOn(o),c=r.remove(a);l&&l.nextSibling&&de(r,l,l.nextSibling),Ve(n.mapper.toModelElement(s).getAttribute("listIndent")+1,i.position,a.start,s,n,t);for(const t of r.createRangeIn(c).getItems())n.mapper.unbindViewElement(t);e.stop()}}(t.model)),e.on("remove",Te,{priority:"low"})})),t.conversion.for("dataDowncast").add((e=>{e.on("insert",_e,{priority:"high"}),e.on("insert:listItem",Ie(t.model))})),t.conversion.for("upcast").add((t=>{t.on("element:ul",Se,{priority:"high"}),t.on("element:ol",Se,{priority:"high"}),t.on("element:li",xe,{priority:"high"}),t.on("element:li",Le)})),t.model.on("insertContent",Pe,{priority:"high"}),t.commands.add("numberedList",new se(t,"numbered")),t.commands.add("bulletedList",new se(t,"bulleted")),t.commands.add("indentList",new le(t,"forward")),t.commands.add("outdentList",new le(t,"backward"));const s=i.view.document;this.listenTo(s,"enter",((t,e)=>{const i=this.editor.model.document,n=i.selection.getLastPosition().parent;i.selection.isCollapsed&&"listItem"==n.name&&n.isEmpty&&(this.editor.execute("outdentList"),e.preventDefault(),t.stop())}),{context:"li"}),this.listenTo(s,"delete",((t,e)=>{if("backward"!==e.direction)return;const i=this.editor.model.document.selection;if(!i.isCollapsed)return;const n=i.getFirstPosition();if(!n.isAtStart)return;const s=n.parent;if("listItem"!==s.name)return;s.previousSibling&&"listItem"===s.previousSibling.name||(this.editor.execute("outdentList"),e.preventDefault(),t.stop())}),{context:"li"}),this.listenTo(t.editing.view.document,"tab",((e,i)=>{const n=i.shiftKey?"outdentList":"indentList";this.editor.commands.get(n).isEnabled&&(t.execute(n),i.stopPropagation(),i.preventDefault(),e.stop())}),{context:"li"})}afterInit(){const t=this.editor.commands,e=t.get("indent"),i=t.get("outdent");e&&e.registerChildCommand(t.get("indentList")),i&&i.registerChildCommand(t.get("outdentList"))}}function Oe(t){let e=1;for(const i of t.getChildren())if("ul"==i.name||"ol"==i.name)for(const t of i.getChildren())e+=Oe(t);return e}class Re extends t.Plugin{static get requires(){return[Be,ft]}static get pluginName(){return"LegacyList"}static get isOfficialPlugin(){return!0}}class De extends t.Command{defaultType;constructor(t,e){super(t),this.defaultType=e}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){this._tryToConvertItemsToList(t);const e=this.editor.model,i=ge(e);i.length&&e.change((e=>{for(const n of i)e.setAttribute("listStyle",t.type||this.defaultType,n)}))}_getValue(){const t=this.editor.model.document.selection.getFirstPosition().parent;return t&&t.is("element","listItem")?t.getAttribute("listStyle"):null}_checkEnabled(){const t=this.editor,e=t.commands.get("numberedList"),i=t.commands.get("bulletedList");return e.isEnabled||i.isEnabled}_tryToConvertItemsToList(t){if(!t.type)return;const e=ye(t.type);if(!e)return;const i=this.editor,n=`${e}List`;i.commands.get(n).value||i.execute(n)}}class Fe extends t.Command{refresh(){const t=this._getValue();this.value=t,this.isEnabled=null!=t}execute(t={}){const e=this.editor.model,i=ge(e).filter((t=>"numbered"==t.getAttribute("listType")));e.change((e=>{for(const n of i)e.setAttribute("listReversed",!!t.reversed,n)}))}_getValue(){const t=this.editor.model.document.selection.getFirstPosition().parent;return t&&t.is("element","listItem")&&"numbered"==t.getAttribute("listType")?t.getAttribute("listReversed"):null}}class Me extends t.Command{refresh(){const t=this._getValue();this.value=t,this.isEnabled=null!=t}execute({startIndex:t=1}={}){const e=this.editor.model,i=ge(e).filter((t=>"numbered"==t.getAttribute("listType")));e.change((e=>{for(const n of i)e.setAttribute("listStart",t>=0?t:1,n)}))}_getValue(){const t=this.editor.model.document.selection.getFirstPosition().parent;return t&&t.is("element","listItem")&&"numbered"==t.getAttribute("listType")?t.getAttribute("listStart"):null}}const ze="default";class je extends t.Plugin{static get requires(){return[Be]}static get pluginName(){return"LegacyListPropertiesEditing"}static get isOfficialPlugin(){return!0}constructor(t){super(t),t.config.define("list",{properties:{styles:!0,startIndex:!1,reversed:!1}})}init(){const t=this.editor,e=t.model,i=function(t){const e=[];t.styles&&e.push({attributeName:"listStyle",defaultValue:ze,addCommand(t){t.commands.add("listStyle",new De(t,ze))},appliesToListItem:()=>!0,setAttributeOnDowncast(t,e,i){e&&e!==ze?t.setStyle("list-style-type",e,i):t.removeStyle("list-style-type",i)},getAttributeOnUpcast:t=>Tt(t.getStyle("list-style-type"))||ze});t.reversed&&e.push({attributeName:"listReversed",defaultValue:!1,addCommand(t){t.commands.add("listReversed",new Fe(t))},appliesToListItem:t=>"numbered"==t.getAttribute("listType"),setAttributeOnDowncast(t,e,i){e?t.setAttribute("reversed","reversed",i):t.removeAttribute("reversed",i)},getAttributeOnUpcast:t=>t.hasAttribute("reversed")});t.startIndex&&e.push({attributeName:"listStart",defaultValue:1,addCommand(t){t.commands.add("listStart",new Me(t))},appliesToListItem:t=>"numbered"==t.getAttribute("listType"),setAttributeOnDowncast(t,e,i){0==e||e>1?t.setAttribute("start",e,i):t.removeAttribute("start",i)},getAttributeOnUpcast(t){const e=t.getAttribute("start");return e>=0?e:1}});return e}(t.config.get("list.properties"));e.schema.extend("listItem",{allowAttributes:i.map((t=>t.attributeName))});for(const e of i)e.addCommand(t);var n;this.listenTo(t.commands.get("indentList"),"_executeCleanup",function(t,e){return(i,n)=>{const s=n[0],r=s.getAttribute("listIndent"),o=n.filter((t=>t.getAttribute("listIndent")===r));let l=null;s.previousSibling.getAttribute("listIndent")+1!==r&&(l=me(s.previousSibling,{sameIndent:!0,direction:"backward",listIndent:r})),t.model.change((t=>{for(const i of o)for(const n of e)if(n.appliesToListItem(i)){const e=null==l?n.defaultValue:l.getAttribute(n.attributeName);t.setAttribute(n.attributeName,e,i)}}))}}(t,i)),this.listenTo(t.commands.get("outdentList"),"_executeCleanup",function(t,e){return(i,n)=>{if(!(n=n.reverse().filter((t=>t.is("element","listItem")))).length)return;const s=n[0].getAttribute("listIndent"),r=n[0].getAttribute("listType");let o=n[0].previousSibling;if(o.is("element","listItem"))for(;o.getAttribute("listIndent")!==s;)o=o.previousSibling;else o=null;o||(o=n[n.length-1].nextSibling),o&&o.is("element","listItem")&&o.getAttribute("listType")===r&&t.model.change((t=>{const i=n.filter((t=>t.getAttribute("listIndent")===s));for(const n of i)for(const i of e)if(i.appliesToListItem(n)){const e=i.attributeName,s=o.getAttribute(e);t.setAttribute(e,s,n)}}))}}(t,i)),this.listenTo(t.commands.get("bulletedList"),"_executeCleanup",qe(t)),this.listenTo(t.commands.get("numberedList"),"_executeCleanup",qe(t)),e.document.registerPostFixer(function(t,e){return i=>{let n=!1;const s=$e(t.model.document.differ.getChanges()).filter((t=>"todo"!==t.getAttribute("listType")));if(!s.length)return n;let r=s[s.length-1].nextSibling;if((!r||!r.is("element","listItem"))&&(r=s[0].previousSibling,r)){const t=s[0].getAttribute("listIndent");for(;r.is("element","listItem")&&r.getAttribute("listIndent")!==t&&(r=r.previousSibling,r););}for(const t of e){const e=t.attributeName;for(const o of s)if(t.appliesToListItem(o))if(o.hasAttribute(e)){const s=o.previousSibling;Ue(s,o,t.attributeName)&&(i.setAttribute(e,s.getAttribute(e),o),n=!0)}else Ke(r,o,t)?i.setAttribute(e,r.getAttribute(e),o):i.setAttribute(e,t.defaultValue,o),n=!0;else i.removeAttribute(e,o)}return n}}(t,i)),t.conversion.for("upcast").add((n=i,t=>{t.on("element:li",((t,e,i)=>{if(!e.modelRange)return;const s=e.viewItem.parent,r=e.modelRange.start.nodeAfter||e.modelRange.end.nodeBefore;for(const t of n)if(t.appliesToListItem(r)){const e=t.getAttributeOnUpcast(s);i.writer.setAttribute(t.attributeName,e,r)}}),{priority:"low"})})),t.conversion.for("downcast").add(function(t){return i=>{for(const n of t)i.on(`attribute:${n.attributeName}:listItem`,((t,i,s)=>{const r=s.writer,o=i.item,l=me(o.previousSibling,{sameIndent:!0,listIndent:o.getAttribute("listIndent"),direction:"backward"}),a=s.mapper.toViewElement(o);e(o,l)||r.breakContainer(r.createPositionBefore(a)),n.setAttributeOnDowncast(r,i.attributeNewValue,a.parent)}),{priority:"low"})};function e(t,e){return e&&t.getAttribute("listType")===e.getAttribute("listType")&&t.getAttribute("listIndent")===e.getAttribute("listIndent")&&t.getAttribute("listStyle")===e.getAttribute("listStyle")&&t.getAttribute("listReversed")===e.getAttribute("listReversed")&&t.getAttribute("listStart")===e.getAttribute("listStart")}}(i)),this._mergeListAttributesWhileMergingLists(i)}afterInit(){const t=this.editor;t.commands.get("todoList")&&t.model.document.registerPostFixer(function(t){return e=>{const i=$e(t.model.document.differ.getChanges()).filter((t=>"todo"===t.getAttribute("listType")&&(t.hasAttribute("listStyle")||t.hasAttribute("listReversed")||t.hasAttribute("listStart"))));if(!i.length)return!1;for(const t of i)e.removeAttribute("listStyle",t),e.removeAttribute("listReversed",t),e.removeAttribute("listStart",t);return!0}}(t))}_mergeListAttributesWhileMergingLists(t){const e=this.editor.model;let i;this.listenTo(e,"deleteContent",((t,[e])=>{const n=e.getFirstPosition(),s=e.getLastPosition();if(n.parent===s.parent)return;if(!n.parent.is("element","listItem"))return;const r=s.parent.nextSibling;if(!r||!r.is("element","listItem"))return;const o=me(n.parent,{sameIndent:!0,listIndent:r.getAttribute("listIndent")});o&&o.getAttribute("listType")===r.getAttribute("listType")&&(i=o)}),{priority:"high"}),this.listenTo(e,"deleteContent",(()=>{i&&(e.change((e=>{const n=me(i.nextSibling,{sameIndent:!0,listIndent:i.getAttribute("listIndent"),direction:"forward"});if(!n)return void(i=null);const s=[n,...fe(e.createPositionAt(n,0),"forward")];for(const n of s)for(const s of t)if(s.appliesToListItem(n)){const t=s.attributeName,r=i.getAttribute(t);e.setAttribute(t,r,n)}})),i=null)}),{priority:"low"})}}function Ke(t,e,i){if(!t)return!1;const n=t.getAttribute(i.attributeName);return!!n&&(n!=i.defaultValue&&t.getAttribute("listType")===e.getAttribute("listType"))}function Ue(t,e,i){if(!t||!t.is("element","listItem"))return!1;if(e.getAttribute("listType")!==t.getAttribute("listType"))return!1;const n=t.getAttribute("listIndent");if(n<1||n!==e.getAttribute("listIndent"))return!1;const s=t.getAttribute(i);return!(!s||s===e.getAttribute(i))}function qe(t){return(e,i)=>{i=i.filter((t=>t.is("element","listItem"))),t.model.change((t=>{for(const e of i)t.removeAttribute("listStyle",e)}))}}function $e(t){const e=[];for(const i of t){const t=We(i);t&&t.is("element","listItem")&&e.push(t)}return e}function We(t){return"attribute"===t.type?t.range.start.nodeAfter:"insert"===t.type?t.position.nodeAfter:null}class Ge extends t.Plugin{static get requires(){return[je,Mt]}static get pluginName(){return"LegacyListProperties"}static get isOfficialPlugin(){return!0}}const He="todoListChecked";class Ye extends t.Command{_selectedElements;constructor(t){super(t),this._selectedElements=[],this.on("execute",(()=>{this.refresh()}),{priority:"highest"})}refresh(){this._selectedElements=this._getSelectedItems(),this.value=this._selectedElements.every((t=>!!t.getAttribute(He))),this.isEnabled=!!this._selectedElements.length}_getSelectedItems(){const t=this.editor.model,e=t.schema,i=t.document.selection.getFirstRange(),n=i.start.parent,s=[];e.checkAttribute(n,He)&&s.push(n);for(const t of i.getItems())e.checkAttribute(t,He)&&!s.includes(t)&&s.push(t);return s}execute(t={}){this.editor.model.change((e=>{for(const i of this._selectedElements){(void 0===t.forceValue?!this.value:t.forceValue)?e.setAttribute(He,!0,i):e.removeAttribute(He,i)}}))}}const Ze=(t,e,i)=>{const n=e.modelCursor,s=n.parent,r=e.viewItem;if("checkbox"!=r.getAttribute("type")||"listItem"!=s.name||!n.isAtStart)return;if(!i.consumable.consume(r,{name:!0}))return;const o=i.writer;o.setAttribute("listType","todo",s),e.viewItem.hasAttribute("checked")&&o.setAttribute("todoListChecked",!0,s),e.modelRange=o.createRange(n)};function Je(t){return(e,i)=>{const n=i.modelPosition,s=n.parent;if(!s.is("element","listItem")||"todo"!=s.getAttribute("listType"))return;const r=Xe(i.mapper.toViewElement(s),t);r&&(i.viewPosition=i.mapper.findPositionIn(r,n.offset))}}function Qe(t,e,i,n){return e.createUIElement("label",{class:"todo-list__label",contenteditable:!1},(function(e){const s=(0,r.createElement)(document,"input",{type:"checkbox",tabindex:"-1"});i&&s.setAttribute("checked","checked"),s.addEventListener("change",(()=>n(t)));const o=this.toDomElement(e);return o.appendChild(s),o}))}function Xe(t,e){const i=e.createRangeIn(t);for(const t of i)if(t.item.is("containerElement","span")&&t.item.hasClass("todo-list__label__description"))return t.item}const ti=(0,r.parseKeystroke)("Ctrl+Enter");class ei extends t.Plugin{static get pluginName(){return"LegacyTodoListEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[Be]}init(){const t=this.editor,{editing:e,data:i,model:n}=t;n.schema.extend("listItem",{allowAttributes:["todoListChecked"]}),n.schema.addAttributeCheck(((t,e)=>{const i=t.last;if("todoListChecked"==e&&"listItem"==i.name&&"todo"!=i.getAttribute("listType"))return!1})),t.commands.add("todoList",new se(t,"todo"));const s=new Ye(t);var o,l;t.commands.add("checkTodoList",s),t.commands.add("todoListCheck",s),i.downcastDispatcher.on("insert:listItem",function(t){return(e,i,n)=>{const s=n.consumable;if(!s.test(i.item,"insert")||!s.test(i.item,"attribute:listType")||!s.test(i.item,"attribute:listIndent"))return;if("todo"!=i.item.getAttribute("listType"))return;const r=i.item;s.consume(r,"insert"),s.consume(r,"attribute:listType"),s.consume(r,"attribute:listIndent"),s.consume(r,"attribute:todoListChecked");const o=n.writer,l=ae(r,n);o.addClass("todo-list",l.parent);const a=o.createContainerElement("label",{class:"todo-list__label"}),c=o.createEmptyElement("input",{type:"checkbox",disabled:"disabled"}),d=o.createContainerElement("span",{class:"todo-list__label__description"});r.getAttribute("todoListChecked")&&o.setAttribute("checked","checked",c),o.insert(o.createPositionAt(l,0),a),o.insert(o.createPositionAt(a,0),c),o.insert(o.createPositionAfter(c),d),ce(r,l,n,t)}}(n),{priority:"high"}),i.upcastDispatcher.on("element:input",Ze,{priority:"high"}),e.downcastDispatcher.on("insert:listItem",function(t,e){return(i,n,s)=>{const r=s.consumable;if(!r.test(n.item,"insert")||!r.test(n.item,"attribute:listType")||!r.test(n.item,"attribute:listIndent"))return;if("todo"!=n.item.getAttribute("listType"))return;const o=n.item;r.consume(o,"insert"),r.consume(o,"attribute:listType"),r.consume(o,"attribute:listIndent"),r.consume(o,"attribute:todoListChecked");const l=s.writer,a=ae(o,s),c=!!o.getAttribute("todoListChecked"),d=Qe(o,l,c,e),u=l.createContainerElement("span",{class:"todo-list__label__description"});l.addClass("todo-list",a.parent),l.insert(l.createPositionAt(a,0),d),l.insert(l.createPositionAfter(d),u),ce(o,a,s,t)}}(n,(t=>this._handleCheckmarkChange(t))),{priority:"high"}),e.downcastDispatcher.on("attribute:listType:listItem",(o=t=>this._handleCheckmarkChange(t),l=e.view,(t,e,i)=>{if(!i.consumable.consume(e.item,t.name))return;const n=i.mapper.toViewElement(e.item),s=i.writer,r=function(t,e){const i=e.createRangeIn(t);for(const t of i)if(t.item.is("uiElement","label"))return t.item}(n,l);if("todo"==e.attributeNewValue){const t=!!e.item.getAttribute("todoListChecked"),i=Qe(e.item,s,t,o),r=s.createContainerElement("span",{class:"todo-list__label__description"}),l=s.createRangeIn(n),a=pe(n),c=ue(l.start),d=a?s.createPositionBefore(a):l.end,u=s.createRange(c,d);s.addClass("todo-list",n.parent),s.move(u,s.createPositionAt(r,0)),s.insert(s.createPositionAt(n,0),i),s.insert(s.createPositionAfter(i),r)}else if("todo"==e.attributeOldValue){const t=Xe(n,l);s.removeClass("todo-list",n.parent),s.remove(r),s.move(s.createRangeIn(t),s.createPositionBefore(t)),s.remove(t)}})),e.downcastDispatcher.on("attribute:todoListChecked:listItem",function(t){return(e,i,n)=>{if("todo"!=i.item.getAttribute("listType"))return;if(!n.consumable.consume(i.item,"attribute:todoListChecked"))return;const{mapper:s,writer:r}=n,o=!!i.item.getAttribute("todoListChecked"),l=s.toViewElement(i.item).getChild(0),a=Qe(i.item,r,o,t);r.insert(r.createPositionAfter(l),a),r.remove(l)}}((t=>this._handleCheckmarkChange(t)))),e.mapper.on("modelToViewPosition",Je(e.view)),i.mapper.on("modelToViewPosition",Je(e.view)),this.listenTo(e.view.document,"arrowKey",function(t,e){return(i,n)=>{if("left"!=(0,r.getLocalizedArrowKeyCodeDirection)(n.keyCode,e.contentLanguageDirection))return;const s=t.schema,o=t.document.selection;if(!o.isCollapsed)return;const l=o.getFirstPosition(),a=l.parent;if("listItem"===a.name&&"todo"==a.getAttribute("listType")&&l.isAtStart){const e=s.getNearestSelectionRange(t.createPositionBefore(a),"backward");e&&t.change((t=>t.setSelection(e))),n.preventDefault(),n.stopPropagation(),i.stop()}}}(n,t.locale),{context:"li"}),this.listenTo(e.view.document,"keydown",((e,i)=>{(0,r.getCode)(i)===ti&&(t.execute("checkTodoList"),e.stop())}),{priority:"high"});const a=new Set;this.listenTo(n,"applyOperation",((t,e)=>{const i=e[0];if("rename"==i.type&&"listItem"==i.oldName){const t=i.position.nodeAfter;t.hasAttribute("todoListChecked")&&a.add(t)}else if("changeAttribute"==i.type&&"listType"==i.key&&"todo"===i.oldValue)for(const t of i.range.getItems())t.hasAttribute("todoListChecked")&&"todo"!==t.getAttribute("listType")&&a.add(t)})),n.document.registerPostFixer((t=>{let e=!1;for(const i of a)t.removeAttribute("todoListChecked",i),e=!0;return a.clear(),e})),this._initAriaAnnouncements()}_handleCheckmarkChange(t){const e=this.editor,i=e.model,n=Array.from(i.document.selection.getRanges());i.change((i=>{i.setSelection(t,"end"),e.execute("checkTodoList"),i.setSelection(n)}))}_initAriaAnnouncements(){const{model:t,ui:e,t:i}=this.editor;let n=null;e&&t.document.selection.on("change:range",(()=>{const s=t.document.selection.focus.parent,r=ii(n),o=ii(s);r&&!o?e.ariaLiveAnnouncer.announce(i("Leaving a to-do list")):!r&&o&&e.ariaLiveAnnouncer.announce(i("Entering a to-do list")),n=s}))}}function ii(t){return!!t&&t.is("element","listItem")&&"todo"===t.getAttribute("listType")}class ni extends t.Plugin{static get requires(){return[ei,te]}static get pluginName(){return"LegacyTodoList"}static get isOfficialPlugin(){return!0}}class si extends t.Plugin{static get pluginName(){return"AdjacentListsSupport"}static get isOfficialPlugin(){return!0}init(){const t=this.editor;t.model.schema.register("listSeparator",{allowWhere:"$block",isBlock:!0}),t.conversion.for("upcast").add((t=>{t.on("element:ol",ri()),t.on("element:ul",ri())})).elementToElement({model:"listSeparator",view:"ck-list-separator"}),t.conversion.for("editingDowncast").elementToElement({model:"listSeparator",view:{name:"div",classes:["ck-list-separator","ck-hidden"]}}),t.conversion.for("dataDowncast").elementToElement({model:"listSeparator",view:(t,e)=>{const i=e.writer.createContainerElement("ck-list-separator");return e.writer.setCustomProperty("dataPipeline:transparentRendering",!0,i),i.getFillerOffset=()=>null,i}})}}function ri(){return(t,e,i)=>{const n=e.viewItem,s=n.nextSibling;if(!s)return;if(n.name!==s.name)return;e.modelRange||Object.assign(e,i.convertChildren(e.viewItem,e.modelCursor));const r=i.writer,o=r.createElement("listSeparator");if(!i.safeInsert(o,e.modelCursor))return;const l=i.getSplitParts(o);e.modelRange=r.createRange(e.modelRange.start,r.createPositionAfter(l[l.length-1])),i.updateConversionResult(o,e)}}class oi extends t.Plugin{static get requires(){return[gt]}static get pluginName(){return"DocumentList"}static get isOfficialPlugin(){return!0}constructor(t){super(t),(0,r.logWarning)("plugin-obsolete-documentlist",{pluginName:"DocumentList"})}}class li extends t.Plugin{static get requires(){return[qt]}static get pluginName(){return"DocumentListProperties"}static get isOfficialPlugin(){return!0}constructor(t){super(t),(0,r.logWarning)("plugin-obsolete-documentlistproperties",{pluginName:"DocumentListProperties"})}}class ai extends t.Plugin{static get requires(){return[ne]}static get pluginName(){return"TodoDocumentList"}static get isOfficialPlugin(){return!0}constructor(t){super(t),(0,r.logWarning)("plugin-obsolete-tododocumentlist",{pluginName:"TodoDocumentList"})}}})(),(window.CKEditor5=window.CKEditor5||{}).list=n})();