PageSourceSearch

https://www.nurses.co.uk/_next/static/chunks/9fe1a91f.0999c6054a1258c9.js

js nurses.co.uk collected 2026-10-01 12:40:22 UTC 97,410 bytes, 2 lines download raw bytes

1!function(){try{var t="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{},e=(new t.Error).stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="b52fc016-5910-4a1b-b140-5d224bae78e3",t._sentryDebugIdIdentifier="sentry-dbid-b52fc016-5910-4a1b-b140-5d224bae78e3")}catch(t){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4955],{37151:(t,e,i)=>{i.d(e,{$9:()=>tH,$I:()=>v,$X:()=>k,$i:()=>t0,Ap:()=>N,B8:()=>tw,Bl:()=>tI,C8:()=>eS,EL:()=>z,Fr:()=>ea,GX:()=>t$,Gb:()=>T,Hx:()=>td,I4:()=>F,If:()=>tv,Kn:()=>p,Lw:()=>tB,MD:()=>tU,Mq:()=>w,NB:()=>A,NV:()=>t2,Nj:()=>ti,Nu:()=>t3,Og:()=>V,P$:()=>te,Pb:()=>E,Pc:()=>C,Ph:()=>tl,Qo:()=>L,Qw:()=>e$,Qx:()=>K,Ro:()=>tO,S:()=>tc,Sf:()=>$,UX:()=>W,Up:()=>M,Ut:()=>tn,Wx:()=>Y,X_:()=>eE,Z1:()=>tL,ZM:()=>tC,Zl:()=>tt,Zr:()=>tF,Zu:()=>e_,_8:()=>tV,_k:()=>ts,a:()=>f,aO:()=>G,aQ:()=>J,an:()=>h,cX:()=>tr,cg:()=>H,e$:()=>ez,e8:()=>ty,gF:()=>j,gu:()=>O,iT:()=>_,if:()=>S,jG:()=>eq,jS:()=>B,jw:()=>I,jy:()=>P,kn:()=>y,kw:()=>ta,lH:()=>tP,lc:()=>eL,mJ:()=>tM,o:()=>Z,oH:()=>tD,oW:()=>x,pF:()=>tx,q9:()=>ew,qX:()=>tE,ry:()=>eV,sL:()=>g,sk:()=>ek,t0:()=>t1,tH:()=>tZ,tQ:()=>q,tT:()=>U,v8:()=>Q,vF:()=>tm,vw:()=>eT,wT:()=>R,x$:()=>tb,xd:()=>to,y4:()=>tK,yx:()=>tu,zP:()=>tN});var r=i(72494),s=i(10742),n=i(33915),l=i(18430),o=i(21508),a=i(2032),u=i(7717),d=i(33719),c=i(74021),m=i(53509);class f{_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,l.$r)(e.sameAttributes||[]),this._sameIndent=!!e.sameIndent,this._lowerIndent=!!e.lowerIndent,this._higherIndent=!!e.higherIndent}static first(t,e){let i=new this(t,e)[Symbol.iterator]();return(0,l.$1)(i)}*[Symbol.iterator](){let t=[];for(let{node:e}of new g(this._getStartNode(),this._isForward?"forward":"backward")){let 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 g{_node;_isForward;_previousNodesByIndent=[];_previous=null;_previousNodeIndent=null;constructor(t,e="forward"){this._node=t,this._isForward="forward"===e}[Symbol.iterator](){return this}next(){if(!h(this._node))return{done:!0,value:void 0};let t=this._node.getAttribute("listIndent"),e=null;if(this._previous){let i=this._previousNodeIndent;t>i?this._previousNodesByIndent[i]=this._previous:t<i?(e=this._previousNodesByIndent[t]||null,this._previousNodesByIndent.length=t):e=this._previous}let 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 p{_listHead;constructor(t){this._listHead=t}[Symbol.iterator](){return new g(this._listHead)}}class b{static next(){return(0,l.Ld)()}}function h(t){return!!t&&t.is("element")&&t.hasAttribute("listItemId")}function y(t,e={}){return[...A(t,{...e,direction:"backward"}),...A(t,{...e,direction:"forward"})]}function A(t,e={}){let i="forward"==e.direction,r=Array.from(new f(t,{...e,includeSelf:i,sameIndent:!0,sameAttributes:"listItemId"}));return i?r:r.reverse()}function I(t){return Array.from(new f(t,{direction:"forward",higherIndent:!0}))}function w(t,e){let i=new f(t,{sameIndent:!0,sameAttributes:"listType",...e}),r=new f(t,{sameIndent:!0,sameAttributes:"listType",includeSelf:!0,direction:"forward",...e});return[...Array.from(i).reverse(),...r]}function v(t){return!f.first(t,{sameIndent:!0,sameAttributes:"listItemId"})}function k(t){return!f.first(t,{direction:"forward",sameIndent:!0,sameAttributes:"listItemId"})}function S(t,e={}){t=(0,l.$r)(t);let i=!1!==e.withNested,r=new Set;for(let e of t)for(let t of y(e,{higherIndent:i}))r.add(t);return V(r)}function _(t){t=(0,l.$r)(t);let e=new Set;for(let i of t)for(let t of w(i))e.add(t);return V(e)}function T(t,e){let i=A(t,{direction:"forward"}),r=b.next();for(let t of i)e.setAttribute("listItemId",r,t);return i}function x(t,e,i){let r={};for(let[t,i]of e.getAttributes())t.startsWith("list")&&(r[t]=i);let s=A(t,{direction:"forward"});for(let t of s)i.setAttributes(r,t);return s}function L(t,e,{expand:i,indentBy:r=1,attributeNames:s}){t=(0,l.$r)(t);let n=i?S(t):t;for(let t of n){let i=t.getAttribute("listIndent")+r;i<0?P(t,e,s):e.setAttribute("listIndent",i,t)}return n}function C(t,e,{attributeNames:i}){let r=S(t=(0,l.$r)(t)),s=new Set,n=Math.min(...r.map(t=>t.getAttribute("listIndent"))),o=new Map;for(let t of r)o.set(t,f.first(t,{lowerIndent:!0}));for(let t of r){if(s.has(t))continue;s.add(t);let r=t.getAttribute("listIndent")-1;if(r<0){P(t,e,i);continue}if(t.getAttribute("listIndent")==n){var a,u,d;let i=(a=t,u=o.get(t),d=e,A(u,{direction:"forward"}).pop().index>a.index?x(a,u,d):[]);for(let t of i)s.add(t);if(i.length)continue}e.setAttribute("listIndent",r,t)}return V(s)}function P(t,e,i){for(let i of t=(0,l.$r)(t))i.is("element","listItem")&&e.rename(i,"paragraph");for(let r of t)for(let t of r.getAttributeKeys())i.includes(t)&&e.removeAttribute(t,r);return t}function E(t){if(!t.length)return!1;let e=t[0].getAttribute("listItemId");return!!e&&!t.some(t=>t.getAttribute("listItemId")!=e)}function F(t,e){let i=[],r=1/0;for(let{node:s}of new g(t.nextSibling)){let t=s.getAttribute("listIndent");if(0==t)break;t<r&&(r=t);let n=t-r;e.setAttribute("listIndent",n,s),i.push(s)}return i}function V(t){return Array.from(t).filter(t=>"$graveyard"!==t.root.rootName).sort((t,e)=>t.index-e.index)}function B(t){let e=t.document.selection.getSelectedElement();return e&&t.schema.isObject(e)&&t.schema.isBlock(e)?e:null}function N(t,e){return e.checkChild(t.parent,"listItem")&&e.checkChild(t,"$text")&&!e.isObject(t)}function O(t){return"numbered"==t||"customNumbered"==t}class R extends r.uB{_direction;constructor(t,e){super(t),this._direction=e}refresh(){this.isEnabled=this._checkEnabled()}execute(){let t=this.editor,e=t.model,i=D(e.document.selection),r=t.plugins.get("ListEditing").getListAttributeNames();e.change(t=>{let e=[];for(let s of(E(i)&&!v(i[0])?("forward"==this._direction&&e.push(...L(i,t,{attributeNames:r})),e.push(...T(i[0],t))):"forward"==this._direction?e.push(...L(i,t,{expand:!0,attributeNames:r})):e.push(...C(i,t,{attributeNames:r})),e)){if(!s.hasAttribute("listType"))continue;let e=f.first(s,{sameIndent:!0});e&&t.setAttribute("listType",e.getAttribute("listType"),s)}this._fireAfterExecute(e)})}_fireAfterExecute(t){this.fire("afterExecute",V(new Set(t)))}_checkEnabled(){let t=D(this.editor.model.document.selection),e=t[0];if(!e)return!1;if("backward"==this._direction||E(t)&&!v(t[0]))return!0;e=(t=S(t))[0];let i=f.first(e,{sameIndent:!0});return!!i&&i.getAttribute("listType")==e.getAttribute("listType")}}function D(t){let e=Array.from(t.getSelectedBlocks()),i=e.findIndex(t=>!h(t));return -1!=i&&(e.length=i),e}class $ extends r.uB{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={}){let e=this.editor.model,i=e.document,r=B(e),s=Array.from(i.selection.getSelectedBlocks()).filter(t=>e.schema.checkAttribute(t,"listType")||N(t,e.schema)),n=void 0!==t.forceValue?!t.forceValue:this.value;e.change(l=>{if(n){let t=s[s.length-1],e=this.editor.plugins.get("ListEditing").getListAttributeNames(),i=A(t,{direction:"forward"}),r=[];i.length>1&&r.push(...T(i[1],l)),r.push(...P(s,l,e)),r.push(...F(t,l)),this._fireAfterExecute(r)}else if((r||i.selection.isCollapsed)&&h(s[0])){let e=w(r||s[0],this._listWalkerOptions);for(let i of e)l.setAttributes({...t.additionalAttributes,listType:this.t
1ype},i);this._fireAfterExecute(e)}else{let i=[];for(let r of s)if(r.hasAttribute("listType"))for(let e of S(r,{withNested:!1}))e.getAttribute("listType")!=this.type&&(l.setAttributes({...t.additionalAttributes,listType:this.type},e),i.push(e));else!r.is("element","listItem")&&N(r,e.schema)&&l.rename(r,"listItem"),l.setAttributes({...t.additionalAttributes,listIndent:0,listItemId:b.next(),listType:this.type},r),i.push(r);this._fireAfterExecute(i)}})}_fireAfterExecute(t){this.fire("afterExecute",V(new Set(t)))}_getValue(){let t=Array.from(this.editor.model.document.selection.getSelectedBlocks());if(!t.length)return!1;for(let e of t)if(e.getAttribute("listType")!=this.type)return!1;return!0}_checkEnabled(){let t=this.editor.model,e=t.schema,i=Array.from(t.document.selection.getSelectedBlocks());if(!i.length)return!1;if(this.value)return!0;for(let t of i)if(e.checkAttribute(t,"listType")||N(t,e))return!0;return!1}}class M extends r.uB{_direction;constructor(t,e){super(t),this._direction=e}refresh(){this.isEnabled=this._checkEnabled()}execute({shouldMergeOnBlocksContentLevel:t=!1}={}){let e=this.editor,i=e.model,r=i.document.selection,s=[],n=e.plugins.get("ListEditing").getListAttributeNames();i.change(e=>{let{firstElement:l,lastElement:o}=this._getMergeSubjectElements(r,t),a=l.getAttribute("listIndent")||0,u=o.getAttribute("listIndent"),d=o.getAttribute("listItemId");if(a!=u){let t=I(o);s.push(...L([o,...t],e,{indentBy:a-u,expand:a<u,attributeNames:n}))}if(t){let t=r;r.isCollapsed&&(t=e.createSelection(e.createRange(e.createPositionAt(l,"end"),e.createPositionAt(o,0)))),i.deleteContent(t,{doNotResetEntireContent:r.isCollapsed});let n=t.getLastPosition().parent,a=n.nextSibling;s.push(n),a&&a!==o&&a.getAttribute("listItemId")==d&&s.push(...x(a,n,e))}else s.push(...x(o,l,e));this._fireAfterExecute(s)})}_fireAfterExecute(t){this.fire("afterExecute",V(new Set(t)))}_checkEnabled(){let t=this.editor.model,e=t.document.selection,i=B(t);if(e.isCollapsed||i){let t=i||e.getFirstPosition().parent;if(!h(t))return!1;let r="backward"==this._direction?t.previousSibling:t.nextSibling;if(!r||E([t,r]))return!1}else{let t=e.getLastPosition(),i=e.getFirstPosition();if(t.parent===i.parent||!h(t.parent))return!1}return!0}_getMergeSubjectElements(t,e){let i,r,s=B(this.editor.model);if(t.isCollapsed||s){let n=s||t.getFirstPosition().parent,l=v(n);"backward"==this._direction?(r=n,i=l&&!e?f.first(n,{sameIndent:!0,lowerIndent:!0}):n.previousSibling):(i=n,r=n.nextSibling)}else i=t.getFirstPosition().parent,r=t.getLastPosition().parent;return{firstElement:i,lastElement:r}}}class z extends r.uB{_direction;constructor(t,e){super(t),this._direction=e}refresh(){this.isEnabled=this._checkEnabled()}execute(){this.editor.model.change(t=>{let e=T(this._getStartBlock(),t);this._fireAfterExecute(e)})}_fireAfterExecute(t){this.fire("afterExecute",V(new Set(t)))}_checkEnabled(){let t=this.editor.model.document.selection,e=this._getStartBlock();return t.isCollapsed&&h(e)&&!v(e)}_getStartBlock(){let t=this.editor.model.document.selection.getFirstPosition().parent;return"before"==this._direction?t:t.nextSibling}}class q extends r.k_{static get pluginName(){return"ListItemBoldIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[tb]}init(){let t=this.editor,e=t.plugins.get("ListFormatting"),i=t.plugins.get(tb);t.plugins.has("BoldEditing")&&this.editor.config.get("list.enableListItemMarkerFormatting")&&(e.registerFormatAttribute("bold","listItemBold"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemBold",setAttributeOnDowncast(t,e,i,r){e&&(t.addClass("ck-list-marker-bold",i),l._K.isSafari&&!(r&&r.dataPipeline)&&t.setStyle("--ck-content-list-marker-dummy-bold","0",i))}}))}afterInit(){let t=this.editor,e=t.model;t.plugins.has("BoldEditing")&&this.editor.config.get("list.enableListItemMarkerFormatting")&&(e.schema.extend("$listItem",{allowAttributes:"listItemBold"}),e.schema.setAttributeProperties("listItemBold",{isFormatting:!0}),e.schema.addAttributeCheck(t=>{if(!t.last.getAttribute("listItemId"))return!1},"listItemBold"),t.conversion.for("upcast").attributeToAttribute({model:"listItemBold",view:{name:"li",classes:"ck-list-marker-bold"}}))}}class j extends r.k_{static get pluginName(){return"ListItemItalicIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[tb]}init(){let t=this.editor,e=t.plugins.get("ListFormatting"),i=t.plugins.get(tb);t.plugins.has("ItalicEditing")&&this.editor.config.get("list.enableListItemMarkerFormatting")&&(e.registerFormatAttribute("italic","listItemItalic"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemItalic",setAttributeOnDowncast(t,e,i,r){e&&(t.addClass("ck-list-marker-italic",i),l._K.isSafari&&!(r&&r.dataPipeline)&&t.setStyle("--ck-content-list-marker-dummy-italic","0",i))}}))}afterInit(){let t=this.editor,e=t.model;t.plugins.has("ItalicEditing")&&this.editor.config.get("list.enableListItemMarkerFormatting")&&(e.schema.extend("$listItem",{allowAttributes:"listItemItalic"}),e.schema.setAttributeProperties("listItemItalic",{isFormatting:!0}),e.schema.addAttributeCheck(t=>{if(!t.last.getAttribute("listItemId"))return!1},"listItemItalic"),t.conversion.for("upcast").attributeToAttribute({model:"listItemItalic",view:{name:"li",classes:"ck-list-marker-italic"}}))}}class W extends r.k_{static get pluginName(){return"ListItemFontSizeIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[tb]}init(){let t=this.editor,e=t.plugins.get("ListFormatting"),i=t.plugins.get(tb);
1if(!t.plugins.has("FontSizeEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting"))return;let r=(0,o.zJ)(t.config.get("fontSize.options"));e.registerFormatAttribute("fontSize","listItemFontSize"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemFontSize",setAttributeOnDowncast(t,e,i,s){if(e){let n=r.find(t=>t.model==e);n&&n.view&&"string"!=typeof n.view?n.view.styles?(t.addClass("ck-list-marker-font-size",i),t.setStyle("--ck-content-list-marker-font-size",n.view.styles["font-size"],i)):n.view.classes&&(t.addClass(`ck-list-marker-font-size-${e}`,i),l._K.isSafari&&!(s&&s.dataPipeline)&&t.setStyle("--ck-content-list-marker-dummy-font-size","0",i)):(t.addClass("ck-list-marker-font-size",i),t.setStyle("--ck-content-list-marker-font-size",e,i))}}})}afterInit(){let t=this.editor,e=t.model;if(t.plugins.has("FontSizeEditing")&&this.editor.config.get("list.enableListItemMarkerFormatting"))for(let i of(e.schema.extend("$listItem",{allowAttributes:"listItemFontSize"}),e.schema.setAttributeProperties("listItemFontSize",{isFormatting:!0}),e.schema.addAttributeCheck(t=>{if(!t.last.getAttribute("listItemId"))return!1},"listItemFontSize"),t.conversion.for("upcast").elementToAttribute({model:{key:"listItemFontSize",value:t=>t.getStyle("--ck-content-list-marker-font-size")},view:{name:"li",classes:"ck-list-marker-font-size",styles:{"--ck-content-list-marker-font-size":/.*/}}}),(0,o.zJ)(t.config.get("fontSize.options"))))i.model&&i.view&&t.conversion.for("upcast").elementToAttribute({model:{key:"listItemFontSize",value:i.model},view:{name:"li",classes:`ck-list-marker-font-size-${i.model}`}})}}class K extends r.k_{static get pluginName(){return"ListItemFontColorIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[tb]}init(){let t=this.editor,e=t.plugins.get("ListFormatting"),i=t.plugins.get(tb);t.plugins.has("FontColorEditing")&&this.editor.config.get("list.enableListItemMarkerFormatting")&&(e.registerFormatAttribute("fontColor","listItemFontColor"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemFontColor",setAttributeOnDowncast(t,e,i){e&&(t.addClass("ck-list-marker-color",i),t.setStyle("--ck-content-list-marker-color",e,i))}}))}afterInit(){let t=this.editor,e=t.model;t.plugins.has("FontColorEditing")&&this.editor.config.get("list.enableListItemMarkerFormatting")&&(e.schema.extend("$listItem",{allowAttributes:"listItemFontColor"}),e.schema.setAttributeProperties("listItemFontColor",{isFormatting:!0}),e.schema.addAttributeCheck(t=>{if(!t.last.getAttribute("listItemId"))return!1},"listItemFontColor"),t.conversion.for("upcast").attributeToAttribute({model:{key:"listItemFontColor",value:t=>t.getStyle("--ck-content-list-marker-color")},view:{name:"li",classes:"ck-list-marker-color",styles:{"--ck-content-list-marker-color":/.*/}}}))}}class U extends r.k_{static get pluginName(){return"ListItemFontFamilyIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[tb]}init(){let t=this.editor,e=t.plugins.get("ListFormatting"),i=t.plugins.get(tb);t.plugins.has("FontFamilyEditing")&&this.editor.config.get("list.enableListItemMarkerFormatting")&&(e.registerFormatAttribute("fontFamily","listItemFontFamily"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemFontFamily",setAttributeOnDowncast(t,e,i){e&&(t.addClass("ck-list-marker-font-family",i),t.setStyle("--ck-content-list-marker-font-family",e,i))}}))}afterInit(){let t=this.editor,e=t.model;t.plugins.has("FontFamilyEditing")&&this.editor.config.get("list.enableListItemMarkerFormatting")&&(e.schema.extend("$listItem",{allowAttributes:"listItemFontFamily"}),e.schema.setAttributeProperties("listItemFontFamily",{isFormatting:!0}),e.schema.addAttributeCheck(t=>{if(!t.last.getAttribute("listItemId"))return!1},"listItemFontFamily"),t.conversion.for("upcast").attributeToAttribute({model:{key:"listItemFontFamily",value:t=>t.getStyle("--ck-content-list-marker-font-family")},view:{name:"li",classes:"ck-list-marker-font-family",styles:{"--ck-content-list-marker-font-family":/.*/}}}))}}class H extends r.k_{_loadedFormatting={};static get pluginName(){return"ListFormatting"}static get isOfficialPlugin(){return!0}static get requires(){return[q,j,W,K,U]}constructor(t){super(t),t.config.define("list.enableListItemMarkerFormatting",!0)}afterInit(){this.editor.config.get("list.enableListItemMarkerFormatting")&&this._registerPostfixerForListItemFormatting()}_registerPostfixerForListItemFormatting(){let t=this.editor.model;t.document.registerPostFixer(e=>{let i=t.document.differ.getChanges(),r=new Set,s=!1;for(let t of i)if("attribute"===t.type)("listItemId"==t.attributeKey||"listType"==t.attributeKey||this._isInlineOrSelectionFormatting(t.attributeKey)||Object.values(this._loadedFormatting).includes(t.attributeKey))&&(h(t.range.start.nodeAfter)?r.add(t.range.start.nodeAfter):h(t.range.start.parent)&&r.add(t.range.start.parent));else if(h(t.position.nodeAfter)&&r.add(t.position.nodeAfter),h(t.position.nodeBefore)&&r.add(t.position.nodeBefore),h(t.position.parent)&&r.add(t.position.parent),"insert"==t.type&&"$text"!=t.name)for(let i of e.createRangeIn(t.position.nodeAfter).getItems())h(i)&&r.add(i);for(let i of r){var n,l,o;for(let[r,a]of Object.entries((n=t,l=i,o=Object.keys(this._loadedFormatting),v(l)?X(n,l,o):X(n,y(l)[0],o)))){let t=this._loadedFormatting[r];
1a&&function(t,e,i,r){let s=y(e),n=!1;for(let e of s)e.hasAttribute(i)&&e.getAttribute(i)===r||(t.setAttribute(i,r,e),n=!0);return n}(e,i,t,a)?s=!0:!a&&function(t,e,i){let r=y(e),s=!1;for(let e of r)e.hasAttribute(i)&&(t.removeAttribute(i,e),s=!0);return s}(e,i,t)&&(s=!0)}}return s})}registerFormatAttribute(t,e){this._loadedFormatting[t]=e}_isInlineOrSelectionFormatting(t){return t.replace(/^selection:/,"")in this._loadedFormatting}}function X(t,e,i){if(!["numbered","bulleted","customNumbered","customBulleted"].includes(e.getAttribute("listType"))||t.schema.isLimit(e))return Object.fromEntries(i.map(t=>[t]));if(e.isEmpty)return Object.fromEntries(i.map(t=>[t,e.getAttribute(`selection:${t}`)]));let r=new Set(i),s={},n=t.createRangeIn(e).getWalker({ignoreElementEnd:!0});for(let{item:e}of n){for(let i of r)if(t.schema.checkAttribute(e,i)){let t=e.getAttribute(i);void 0===t?(r.delete(i),s[i]=void 0):void 0===s[i]?s[i]=t:s[i]!==t&&(r.delete(i),s[i]=void 0)}else i in s||(s[i]=void 0);if(!r.size)break;t.schema.isLimit(e)&&n.jumpTo(t.createPositionAfter(e))}return s}class Z extends r.k_{static get pluginName(){return"ListUtils"}static get isOfficialPlugin(){return!0}expandListBlocksToCompleteList(t){return _(t)}isFirstBlockOfListItem(t){return v(t)}isListItemBlock(t){return h(t)}expandListBlocksToCompleteItems(t,e={}){return S(t,e)}isNumberedListType(t){return O(t)}isFirstListItemInList(t){return!f.first(t,{sameIndent:!0,sameAttributes:"listType"})}}function Q(t){return t.is("element","ol")||t.is("element","ul")}function G(t){return t.is("element","li")}function J(t){let e=0,i=t.parent;for(;i;){if(G(i))e++;else{let t=i.previousSibling;t&&G(t)&&e++}i=i.parent}return e}function Y(t,e,i,r=ti(i,e)){return t.createAttributeElement(te(i),null,{priority:2*e/100-100,id:r})}function tt(t,e,i){return t.createAttributeElement("li",null,{priority:(2*e+1)/100-100,id:i})}function te(t){return"numbered"==t||"customNumbered"==t?"ol":"ul"}function ti(t,e){return`list-${t}-${e}`}function tr(t,e,i){let r=t.nodeBefore;if(h(r)){let t=r;for(let{node:s}of new g(t,"backward"))if(t=s,i.has(t)||(i.add(t),e.has(r)))return;e.add(t)}else{let i=t.nodeAfter;h(i)&&e.add(i)}}function ts(t,e){let i=0,r=-1,s=null,n=!1;for(let{node:l}of t){let t=l.getAttribute("listIndent");if(t>i){let o;null===s?(s=t-i,o=i):(s>t&&(s=t),o=t-s),o>r+1&&(o=r+1),e.setAttribute("listIndent",o,l),n=!0,r=o}else s=null,i=t+1,r=t}return n}function tn(t,e,i){let r=new Set,s=!1;for(let{node:n}of t){if(r.has(n))continue;let t=n.getAttribute("listType"),l=n.getAttribute("listItemId");if(e.has(l)&&(l=b.next()),e.add(l),n.is("element","listItem")){n.getAttribute("listItemId")!=l&&(i.setAttribute("listItemId",l,n),s=!0);continue}for(let e of A(n,{direction:"forward"}))r.add(e),e.getAttribute("listType")!=t&&(l=b.next(),t=e.getAttribute("listType")),e.getAttribute("listItemId")!=l&&(i.setAttribute("listItemId",l,e),s=!0)}return s}function tl(){return(t,e,i)=>{let{writer:r,schema:s}=i;if(!e.modelRange)return;let n=Array.from(e.modelRange.getItems({shallow:!0})).filter(t=>s.checkAttribute(t,"listItemId"));if(!n.length)return;let l=e.viewItem.getAttribute("data-list-item-id")||b.next();i.consumable.consume(e.viewItem,{attributes:"data-list-item-id"});let o=J(e.viewItem),a=e.viewItem.parent&&e.viewItem.parent.is("element","ol")?"numbered":"bulleted",u=n[0].getAttribute("listType");u&&(a=u);let d={listItemId:l,listIndent:o,listType:a};for(let t of n)t.hasAttribute("listItemId")||r.setAttributes(d,t);n.length>1&&n[1].getAttribute("listItemId")!=d.listItemId&&i.keepEmptyElement(n[0])}}function to(t,e,i,r){return()=>{let n=t.document.differ.getChanges(),l=[],o=new Set,a=new Set,u=new Set;for(let t of n)if("insert"==t.type&&"$text"!=t.name)tr(t.position,o,u),t.attributes.has("listItemId")?a.add(t.position.nodeAfter):tr(t.position.getShiftedBy(t.length),o,u);else if("remove"==t.type&&t.attributes.has("listItemId"))tr(t.position,o,u);else if("attribute"==t.type){let e=t.range.start.nodeAfter;i.includes(t.attributeKey)?(tr(t.range.start,o,u),null===t.attributeNewValue?(tr(t.range.start.getShiftedBy(1),o,u),s(e)&&l.push(e)):a.add(e)):h(e)&&s(e)&&l.push(e)}for(let t of o.values())l.push(...function(t,n){let l=[],o=new Set,a=[];for(let{node:u,previous:d}of new g(t)){if(o.has(u))continue;let t=u.getAttribute("listIndent");d&&t<d.getAttribute("listIndent")&&(a.length=t+1),a[t]={modelAttributes:Object.fromEntries(Array.from(u.getAttributes()).filter(([t])=>i.includes(t))),modelElement:u};let c=A(u,{direction:"forward"});for(let t of c)o.add(t),s(t,c)?l.push(t):function(t,i,s){if(s.has(t))return!1;let n=e.mapper.toViewElement(t),l=i.length-1;for(let t=n.parent;!t.is("editableElement");t=t.parent){let e=G(t),s=Q(t);if(!s&&!e)continue;let n=`checkAttributes:${e?"item":"list"}`;if(r.fire(n,{viewElement:t,modelAttributes:i[l].modelAttributes,modelReferenceElement:i[l].modelElement}))break;if(s&&--l<0)return!1}return!0}(t,a,n)&&l.push(t)}return l}(t,a));for(let t of new Set(l))e.reconvertItem(t)};
1function s(t,s){let n=e.mapper.toViewElement(t);if(!n)return!1;if(function(t){for(t=t.parent;t.is("attributeElement")&&["ol","ul","li"].includes(t.name);)t=t.parent;return!(!t.getCustomProperty("$structureSlotParent")||e.mapper.toModelElement(t))}(n)||r.fire("checkElement",{modelElement:t,viewElement:n}))return!0;if(!t.is("element","paragraph")&&!t.is("element","listItem"))return!1;let l=tg(t,i,s);return!!(l&&n.is("element","p"))||!!(!l&&n.is("element","span"))}}function ta(t,e,i,{dataPipeline:r}={}){var s;let n,l=(s=t,n=e.filter(t=>!1===t.consume).map(t=>t.attributeName),(t,e)=>{let i=[];for(let e of s)t.hasAttribute(e)&&!n.includes(e)&&i.push(`attribute:${e}`);return!!i.every(i=>!1!==e.test(t,i))&&(i.forEach(i=>e.consume(t,i)),!0)});return(s,n,o)=>{let{writer:a,mapper:u,consumable:d}=o,c=n.item;if(!t.includes(n.attributeKey)||!l(c,d))return;let m={...o.options,dataPipeline:r},g=tc(c,u,i,a);tf(g,a,u),function(t,e){let i=t.parent;for(;i.is("attributeElement")&&["ul","ol","li"].includes(i.name);){let r=i.parent;e.unwrap(e.createRangeOn(t),i),i=r}}(g,a);let p=function(t,e,i,r,{dataPipeline:s}){let n=r.createRangeOn(e);if(!v(t))return n;for(let l of i){if("itemMarker"!=l.scope)continue;let i=l.createElement(r,t,{dataPipeline:s});if(!i||(r.setCustomProperty("listItemMarker",!0,i),l.canInjectMarkerIntoElement&&l.canInjectMarkerIntoElement(t)?r.insert(r.createPositionAt(e,0),i):(r.insert(n.start,i),n=r.createRange(r.createPositionBefore(i),r.createPositionAfter(e))),!l.createWrapperElement||!l.canWrapElement))continue;let o=l.createWrapperElement(r,t,{dataPipeline:s});r.setCustomProperty("listItemWrapper",!0,o),l.canWrapElement(t)?n=r.wrap(n,o):(n=r.wrap(r.createRangeOn(i),o),n=r.createRange(n.start,r.createPositionAfter(e)))}return n}(c,g,e,a,m);!function(t,e,i,r,s){if(!t.hasAttribute("listIndent"))return;let n=t.getAttribute("listIndent"),l=t;for(let t=n;t>=0;t--){let n=tt(r,t,l.getAttribute("listItemId")),o=Y(r,t,l.getAttribute("listType"));for(let t of i)("list"==t.scope||"item"==t.scope)&&l.hasAttribute(t.attributeName)&&t.setAttributeOnDowncast(r,l.getAttribute(t.attributeName),"list"==t.scope?o:n,s,l);if(e=r.wrap(e,n),e=r.wrap(e,o),0==t||!(l=f.first(l,{lowerIndent:!0})))break}}(c,p,e,a,m)}}function tu(t){return(e,i,r)=>{let{writer:s,mapper:n}=r,l=e.name.split(":")[1];if(!t.checkAttribute(l,"listItemId"))return;let o=n.toViewPosition(i.position),a=i.position.getShiftedBy(i.length),u=n.toViewPosition(a,{isPhantom:!0}),d=s.createRange(o,u).getTrimmed().end.nodeBefore;d&&tf(d,s,n)}}function td(t,{dataPipeline:e}={}){return(i,{writer:r})=>{if(!tg(i,t))return null;if(!e)return r.createContainerElement("span",{class:"ck-list-bogus-paragraph"});let s=r.createContainerElement("p");return r.setCustomProperty("dataPipeline:transparentRendering",!0,s),s}}function tc(t,e,i,r){let s=i.createRangeOn(t),n=e.toViewRange(s).getTrimmed().getWalker();for(let{item:t}of n)if(t.is("element")&&t.getCustomProperty("listItemMarker"))n.jumpTo(r.createPositionAfter(t));else if(t.is("element")&&!t.getCustomProperty("listItemWrapper"))return t}function tm(t,e){return(i,r)=>{if(r.modelPosition.offset>0)return;let s=r.modelPosition.parent;if(!h(s)||!t.some(t=>"itemMarker"==t.scope&&t.canInjectMarkerIntoElement&&t.canInjectMarkerIntoElement(s)))return;let n=r.mapper.toViewElement(s),l=e.createRangeIn(n),o=l.getWalker(),a=l.start;for(let{item:t}of o){if(t.is("element")&&r.mapper.toModelElement(t)||t.is("$textProxy"))break;t.is("element")&&t.getCustomProperty("listItemMarker")&&(a=e.createPositionAfter(t),o.skip(({previousPosition:t})=>!t.isEqual(a)))}r.viewPosition=a}}function tf(t,e,i){for(;t.parent.is("attributeElement")&&t.parent.getCustomProperty("listItemWrapper");)e.unwrap(e.createRangeOn(t),t.parent);let r=[];for(let i of(s(e.createPositionBefore(t).getWalker({direction:"backward"})),s(e.createRangeIn(t).getWalker()),r))e.remove(i);function s(t){for(let{item:e}of t){if(e.is("element")&&i.toModelElement(e))break;e.is("element")&&e.getCustomProperty("listItemMarker")&&r.push(e)}}}function tg(t,e,i=y(t)){if(!h(t))return!1;for(let i of t.getAttributeKeys())if(!i.startsWith("selection:")&&"htmlEmptyBlock"!=i&&!e.includes(i))return!1;return i.length<2}let tp=["listType","listIndent","listItemId"];class tb extends r.k_{_downcastStrategies=[];static get pluginName(){return"ListEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[n.xy,s.ep,Z,a.xz,H]}constructor(t){super(t),t.config.define("list.multiBlock",!0)}init(){let t=this.editor,e=t.model,i=t.config.get("list.multiBlock");if(t.plugins.has("LegacyListEditing"))throw new l.Yb("list-feature-conflict",this,{conflictPlugin:"LegacyListEditing"});for(let t of(e.schema.register("$listItem",{allowAttributes:tp}),i?(e.schema.extend("$container",{allowAttributesOf:"$listItem"}),e.schema.extend("$block",{allowAttributesOf:"$listItem"}),e.schema.extend("$blockObject",{allowAttributesOf:"$listItem"}
1)):e.schema.register("listItem",{inheritAllFrom:"$block",allowAttributesOf:"$listItem"}),tp))e.schema.setAttributeProperties(t,{copyOnReplace:!0});t.commands.add("numberedList",new $(t,"numbered")),t.commands.add("bulletedList",new $(t,"bulleted")),t.commands.add("customNumberedList",new $(t,"customNumbered",{multiLevel:!0})),t.commands.add("customBulletedList",new $(t,"customBulleted",{multiLevel:!0})),t.commands.add("indentList",new R(t,"forward")),t.commands.add("outdentList",new R(t,"backward")),t.commands.add("splitListItemBefore",new z(t,"before")),t.commands.add("splitListItemAfter",new z(t,"after")),i&&(t.commands.add("mergeListItemBackward",new M(t,"backward")),t.commands.add("mergeListItemForward",new M(t,"forward"))),this._setupDeleteIntegration(),this._setupEnterIntegration(),this._setupTabIntegration(),this._setupClipboardIntegration(),this._setupAccessibilityIntegration(),this._setupListItemIdConversionStrategy()}afterInit(){let 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[...tp,...this._downcastStrategies.map(t=>t.attributeName)]}_setupDeleteIntegration(){let t=this.editor,e=t.commands.get("mergeListItemBackward"),i=t.commands.get("mergeListItemForward");this.listenTo(t.editing.view.document,"delete",(r,s)=>{let n=t.model.document.selection;B(t.model)||t.model.change(()=>{let l=n.getFirstPosition();if(n.isCollapsed&&"backward"==s.direction){if(!l.isAtStart)return;let i=l.parent;if(!h(i))return;if(f.first(i,{sameAttributes:"listType",sameIndent:!0})||0!==i.getAttribute("listIndent")){if(!e||!e.isEnabled)return;e.execute({shouldMergeOnBlocksContentLevel:th(t.model,"backward")})}else k(i)||t.execute("splitListItemAfter"),t.execute("outdentList");s.preventDefault(),r.stop()}else{if(n.isCollapsed&&!n.getLastPosition().isAtEnd||!i||!i.isEnabled)return;i.execute({shouldMergeOnBlocksContentLevel:th(t.model,"forward")}),s.preventDefault(),r.stop()}})},{context:"li"})}_setupEnterIntegration(){let t=this.editor,e=t.model,i=t.commands,r=i.get("enter");this.listenTo(t.editing.view.document,"enter",(i,r)=>{let s=e.document,n=s.selection.getFirstPosition().parent;if(s.selection.isCollapsed&&h(n)&&n.isEmpty&&!r.isSoft){let e=v(n),s=k(n);e&&s?(t.execute("outdentList"),r.preventDefault(),i.stop()):e&&!s?(t.execute("splitListItemAfter"),r.preventDefault(),i.stop()):s&&(t.execute("splitListItemBefore"),r.preventDefault(),i.stop())}},{context:"li"}),this.listenTo(r,"afterExecute",()=>{let e=i.get("splitListItemBefore");e.refresh(),e.isEnabled&&2===y(t.model.document.selection.getLastPosition().parent).length&&e.execute()})}_setupTabIntegration(){let t=this.editor;this.listenTo(t.editing.view.document,"tab",(e,i)=>{let r=i.shiftKey?"outdentList":"indentList";this.editor.commands.get(r).isEnabled&&(t.execute(r),i.stopPropagation(),i.preventDefault(),e.stop())},{context:"li"})}_setupConversion(){let t=this.editor,e=t.model,i=this.getListAttributeNames(),r=t.config.get("list.multiBlock"),s=r?"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",tl())}),r||t.conversion.for("downcast").elementToElement({model:"listItem",view:"p"}),t.conversion.for("editingDowncast").elementToElement({model:s,view:td(i),converterPriority:"high"}).add(t=>{t.on("attribute",ta(i,this._downcastStrategies,e)),t.on("remove",tu(e.schema))}),t.conversion.for("dataDowncast").elementToElement({model:s,view:td(i,{dataPipeline:!0}),converterPriority:"high"}).add(t=>{t.on("attribute",ta(i,this._downcastStrategies,e,{dataPipeline:!0}))});let n=tm(this._downcastStrategies,t.editing.view);t.editing.mapper.on("modelToViewPosition",n),t.data.mapper.on("modelToViewPosition",n),this.listenTo(e.document,"change:data",to(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!=te(i.listType)||e.id!=ti(i.listType,i.listIndent))&&(t.return=!0,t.stop())})}_setupModelPostFixing(){let t=this.editor.model,e=this.getListAttributeNames();t.document.registerPostFixer(i=>
1(function(t,e,i,r){let s=t.document.differ.getChanges(),n=new Set,l=new Set,o=r.editor.config.get("list.multiBlock"),a=!1;for(let r of s){if("insert"==r.type&&"$text"!=r.name){let s=r.position.nodeAfter;if(!t.schema.checkAttribute(s,"listItemId"))for(let t of Array.from(s.getAttributeKeys()))i.includes(t)&&(e.removeAttribute(t,s),a=!0);for(let{item:e,previousPosition:i}of(tr(r.position,l,n),r.attributes.has("listItemId")||tr(r.position.getShiftedBy(r.length),l,n),t.createRangeIn(s)))h(e)&&tr(i,l,n)}else"remove"==r.type?tr(r.position,l,n):"attribute"==r.type&&i.includes(r.attributeKey)&&(tr(r.range.start,l,n),null===r.attributeNewValue&&tr(r.range.start.getShiftedBy(1),l,n));if(!o&&"attribute"==r.type&&tp.includes(r.attributeKey)){let t=r.range.start.nodeAfter;null===r.attributeNewValue&&t&&t.is("element","listItem")?(e.rename(t,"paragraph"),a=!0):null===r.attributeOldValue&&t&&t.is("element")&&"listItem"!=t.name&&(e.rename(t,"listItem"),a=!0)}}let u=new Set;for(let t of l.values())a=r.fire("postFixer",{listNodes:new p(t),listHead:t,writer:e,seenIds:u})||a;return a})(t,i,e,this)),this.on("postFixer",(t,{listNodes:e,writer:i})=>{t.return=ts(e,i)||t.return},{priority:"high"}),this.on("postFixer",(t,{listNodes:e,writer:i,seenIds:r})=>{t.return=tn(e,r,i)||t.return},{priority:"high"})}_setupClipboardIntegration(){var t;let e=this.editor.model,i=this.editor.plugins.get("ClipboardPipeline");this.listenTo(e,"insertContent",(t=e,(e,[i,r])=>{let s,n=i.is("documentFragment")?Array.from(i.getChildren()):[i];if(!n.length)return;let l=(r?t.createSelection(r):t.document.selection).getFirstPosition();if(h(l.parent))s=l.parent;else{if(!(h(l.nodeBefore)&&h(l.nodeAfter)))return;s=l.nodeBefore}t.change(t=>{let e=s.getAttribute("listType"),i=Math.max(s.getAttribute("listIndent")-(n[0].getAttribute("listIndent")||0),0);for(let r of n){let n=h(r);s.is("element","listItem")&&r.is("element","paragraph")&&t.rename(r,"listItem"),t.setAttributes({listIndent:(n?r.getAttribute("listIndent"):0)+i,listItemId:n?r.getAttribute("listItemId"):b.next(),listType:e},r)}})}),{priority:"high"}),this.listenTo(i,"outputTransformation",(t,i)=>{e.change(t=>{let e=Array.from(i.content.getChildren()),r=e[e.length-1];if(e.length>1&&r.is("element")&&r.isEmpty&&e.slice(0,-1).every(h)&&t.remove(r),"copy"==i.method||"cut"==i.method){let e=Array.from(i.content.getChildren());E(e)&&P(e,t,this.getListAttributeNames())}})})}_setupAccessibilityIntegration(){let 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"}]})}_setupListItemIdConversionStrategy(){this.registerDowncastStrategy({scope:"item",attributeName:"listItemId",setAttributeOnDowncast(t,e,i,r){r&&(r.skipListItemIds||r.isClipboardPipeline)||t.setAttribute("data-list-item-id",e,i)}})}}function th(t,e){let i=t.document.selection;if(!i.isCollapsed)return!B(t);if("forward"===e)return!0;let r=i.getFirstPosition().parent,s=r.previousSibling;return!t.schema.isObject(s)&&(!!s.isEmpty||E([r,s]))}
1function ty(t,e,i,r){t.ui.componentFactory.add(e,()=>{let s=tA(u._,t,e,i,r);return s.set({tooltip:!0,isToggleable:!0}),s}),t.ui.componentFactory.add(`menuBar:${e}`,()=>{let s=tA(u.kS,t,e,i,r);return s.set({role:"menuitemcheckbox",isToggleable:!0}),s})}function tA(t,e,i,r,s){let n=e.commands.get(i),l=new t(e.locale);return l.set({label:r,icon:s}),l.bind("isOn","isEnabled").to(n,"value","isEnabled"),l.on("execute",()=>{e.execute(i),e.editing.view.focus()}),l}class tI extends r.k_{static get pluginName(){return"ListUI"}static get isOfficialPlugin(){return!0}init(){let t=this.editor.t;this.editor.ui.componentFactory.has("numberedList")||ty(this.editor,"numberedList",t("Numbered List"),d.mgI),this.editor.ui.componentFactory.has("bulletedList")||ty(this.editor,"bulletedList",t("Bulleted List"),d.dwx)}}class tw extends r.k_{static get requires(){return[tb,tI]}static get pluginName(){return"List"}static get isOfficialPlugin(){return!0}}class tv extends r.uB{refresh(){let t=this._getValue();this.value=t,this.isEnabled=null!=t}execute({startIndex:t=1}={}){let e=this.editor.model,i=Array.from(e.document.selection.getSelectedBlocks()).filter(t=>h(t)&&O(t.getAttribute("listType")));i=_(i),e.change(e=>{for(let r of i)e.setAttribute("listStart",t>=0?t:1,r)})}_getValue(){let t=this.editor.model.document,e=(0,l.$1)(t.selection.getSelectedBlocks());return e&&h(e)&&O(e.getAttribute("listType"))?e.getAttribute("listStart"):null}}let tk={},tS={},t_={},tT=[{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"},{listStyle:"arabic-indic",typeAttribute:null,listType:"numbered"}];for(let{listStyle:t,typeAttribute:e,listType:i}of tT)tk[t]=i,tS[t]=e,e&&(t_[e]=t);function tx(){return tT.map(t=>t.listStyle)}function tL(t){return tk[t]||null}function tC(t){return t_[t]||null}function tP(t){return tS[t]||null}function tE(t){switch(t){case"lower-alpha":return"lower-latin";case"upper-alpha":return"upper-latin";default:return t}}class tF extends r.uB{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={}){let e=this.editor.model,i=e.document;e.change(e=>{this._tryToConvertItemsToList(t);let r=Array.from(i.selection.getSelectedBlocks()).filter(t=>t.hasAttribute("listType"));if(r.length)for(let i of r=_(r))e.setAttribute("listStyle",t.type||this.defaultType,i)})}isStyleTypeSupported(t){return!this._supportedTypes||this._supportedTypes.includes(t)}_getValue(){let t=(0,l.$1)(this.editor.model.document.selection.getSelectedBlocks());return h(t)?t.getAttribute("listStyle"):null}_checkEnabled(){let t=this.editor,e=t.commands.get("numberedList"),i=t.commands.get("bulletedList");return e.isEnabled||i.isEnabled}_tryToConvertItemsToList(t){if(!t.type)return;let e=tL(t.type);if(!e)return;let i=this.editor,r=`${e}List`;i.commands.get(r).value||i.execute(r)}}class tV extends r.uB{refresh(){let t=this._getValue();this.value=t,this.isEnabled=null!=t}execute(t={}){let e=this.editor.model,i=Array.from(e.document.selection.getSelectedBlocks()).filter(t=>h(t)&&"numbered"==t.getAttribute("listType"));i=_(i),e.change(e=>{for(let r of i)e.setAttribute("listReversed",!!t.reversed,r)})}_getValue(){let t=this.editor.model.document,e=(0,l.$1)(t.selection.getSelectedBlocks());return h(e)&&"numbered"==e.getAttribute("listType")?e.getAttribute("listReversed"):null}}function tB(t){return(e,i,r)=>{let{writer:s,schema:n,consumable:l}=r;if(!1===l.test(i.viewItem,t.viewConsumables))return;i.modelRange||Object.assign(i,r.convertChildren(i.viewItem,i.modelCursor));let o=!1;for(let e of i.modelRange.getItems({shallow:!0}))n.checkAttribute(e,t.attributeName)&&t.appliesToListItem(e)&&(e.hasAttribute(t.attributeName)||(s.setAttribute(t.attributeName,t.getAttributeOnUpcast(i.viewItem),e),o=!0));o&&l.consume(i.viewItem,t.viewConsumables)}}class tN extends r.k_{static get pluginName(){return"ListPropertiesUtils"}static get isOfficialPlugin(){return!0}getAllSupportedStyleTypes(){return tx()}getListTypeFromListStyleType(t){return tL(t)}getListStyleTypeFromTypeAttribute(t){return tC(t)}getTypeAttributeFromListStyleType(t){return tP(t)}}function tO(t){var e;let i,{startIndex:r,reversed:s,styles:n}=t;return{styles:(i={listTypes:["bulleted","numbered"],useAttribute:!1,listStyleTypes:{numbered:["decimal","decimal-leading-zero","lower-roman","upper-roman","lower-latin","upper-latin"],bulleted:["disc","circle","square"]}},!0===(e=n)||(e?Array.isArray(e)||"string"==typeof e?(i.listTypes=(0,l.$r)(e),i.listStyleTypes=(0,c.U)(i.listStyleTypes,i.listTypes)):(i.listTypes=e.listTypes?(0,l.$r)(e.listTypes):i.listTypes,i.useAttribute=!!e.useAttribute,e.listStyleTypes?i.listStyleTypes=e.listStyleTypes:i.listStyleTypes=(0,c.U)(i.listStyleTypes,i.listTypes)):(i.listTypes=[],i.listStyleTypes={})),i),startIndex:r||!1,reversed:s||!1}}let tR="default";class tD extends r.k_{static get requires(){return[tb,tN]}static get pluginName(){return"ListPropertiesEditing"}static get licenseFeatureCode(){return"LP"}static get isOfficialPlugin(){return!0}static get isPremiumPlugin(){return!0}constructor(t){super(t),t.config.define("list.properties",{styles:!0,startIndex:!1,reversed:!1})}init(){let t=this.editor,e=t.model,i=t.plugins.get(tb),r=function(t){let e=[],i=tO(t);if(t.styles){let t=i.styles.useAttribute;e.push({attributeName:"listStyle",defaultValue:tR,viewConsumables:{styles:"list-style-type"},addCommand(e){let i=tx();t&&(i=i.filter(t=>!!tP(t))),e.commands.add("listStyle",new tF(e,tR,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;let e=t.getAttribute("listStyle");return e==tR||tL(e)==t.getAttribute("listType")},setAttributeOnDowncast(e,i,r){if(i&&i!==tR)if(!t)return void e.setStyle("list-style-type",i,r);else{let t=tP(i);if(t)return void e.setAttribute("type",t,r)}e.removeStyle("list-style-type",r),e.removeAttribute("type",r)},getAttributeOnUpcast(t){let e=t.getStyle("list-style-type");if(e)return tE(e);let i=t.getAttribute("type");return i?tC(i):tR}})}return t.reversed&&e.push({attributeName:"listReversed",defaultValue:!1,viewConsumables:{attributes:"reversed"},addCommand(t){t.commands.add("listReversed",new tV(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 tv(t))},appliesToListItem:t=>O(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){let e=t.getAttribute("start");return e>=0?e:1}}),e}(t.config.get("list.properties"));for(let s of r)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(let e of r)t.on("element:ol",tB(e)),t.on("element:ul",tB(e))}),i.on("checkAttributes:list",(t,{viewElement:e,modelAttributes:i,modelReferenceElement:s})=>{for(let n of r)n.appliesToListItem(s)&&n.getAttributeOnUpcast(e)!=i[n.attributeName]&&(t.return=!0,t.stop())}),this.listenTo(t.commands.get("indentList"),"afterExecute",(t,i)=>{e.change(t=>{for(let e of i)for(let i of r)i.appliesToListItem(e)&&t.setAttribute(i.attributeName,i.defaultValue,e)})}),i.on("postFixer",(t,{listNodes:e,writer:i})=>{for(let{node:s}of e)for(let e of r)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(let{node:s,previousNodeInList:n}of e)if(n&&n.getAttribute("listType")==s.getAttribute("listType"))for(let e of r){let{attributeName:r}=e;if(!e.appliesToListItem(s))continue;let l=n.getAttribute(r);s.getAttribute(r)!=l&&(i.setAttribute(r,l,s),t.return=!0)}})}}class t$ extends u.Ss{children;stylesView=null;additionalPropertiesCollapsibleView=null;startIndexFieldView=null;reversedSwitchButtonView=null;focusTracker=new l.$x;keystrokes=new l.EP;focusables=new u.s3;focusCycler;constructor(t,{enabledProperties:e,styleButtonViews:i,styleGridAri
1aLabel:r}){super(t);const s=["ck","ck-list-properties"];this.children=this.createCollection(),this.focusCycler=new u.H({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),i&&i.length?(this.stylesView=this._createStylesView(i,r),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){for(let t of(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)),this.stylesView.children))this.stylesView.focusTracker.add(t.element);(0,u.l1)({keystrokeHandler:this.stylesView.keystrokes,focusTracker:this.stylesView.focusTracker,gridItems:this.stylesView.children,numberOfColumns:()=>l.Sf.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);let 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){let i=new u.Ss(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(let t of this.children)if(t instanceof u._&&t.isOn)return void t.focus();this.children.first.focus()},i.focusTracker=new l.$x,i.keystrokes=new l.EP,i.render(),i.keystrokes.listenTo(i.element),i}_addNumberedListPropertyViews(t){let 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 u.Kn(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(){let t=this.locale.t,e=new u.xE(this.locale,u.F_);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",()=>{let i=e.fieldView.element,r=i.valueAsNumber;if(Number.isNaN(r)){e.errorText=t("Invalid start index value.");return}i.checkValidity()?this.fire("listStart",{startIndex:r}):e.errorText=t("Start index must be greater than 0.")}),e}_createReversedSwitchButton(){let t=this.locale.t,e=new u.Wm(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}}class tM extends r.k_{static get pluginName(){return"ListPropertiesUI"}static get isOfficialPlugin(){return!0}init(){let t=this.editor,e=t.locale.t,i=t.config.get("list.properties"),r=tO(i),s=r.styles.listTypes;if(s.includes("bulleted")){let i=[{label:e("Toggle the disc list style"),tooltip:e("Disc"),type:"disc",icon:d.miM},{label:e("Toggle the circle list style"),tooltip:e("Circle"),type:"circle",icon:d.PF9},{label:e("Toggle the square list style"),tooltip:e("Square"),type:"square",icon:d.qpc}],s=e("Bulleted List"),n=e("Bulleted list styles toolbar"),l="bulletedList";t.ui.componentFactory.add(l,tz({editor:t,normalizedConfig:r,parentCommandName:l,buttonLabel:s,buttonIcon:d.dwx,styleGridAri
1aLabel:n,styleDefinitions:i})),t.ui.componentFactory.add(`menuBar:${l}`,tj({editor:t,normalizedConfig:r,parentCommandName:l,buttonLabel:s,styleGridAriaLabel:n,styleDefinitions:i}))}if(s.includes("numbered")||i.startIndex||i.reversed){let i=[{label:e("Toggle the decimal list style"),tooltip:e("Decimal"),type:"decimal",icon:d.g57},{label:e("Toggle the decimal with leading zero list style"),tooltip:e("Decimal with leading zero"),type:"decimal-leading-zero",icon:d.MLW},{label:e("Toggle the lower–roman list style"),tooltip:e("Lower–roman"),type:"lower-roman",icon:d.zcv},{label:e("Toggle the upper–roman list style"),tooltip:e("Upper-roman"),type:"upper-roman",icon:d.q_L},{label:e("Toggle the lower–latin list style"),tooltip:e("Lower-latin"),type:"lower-latin",icon:d.KCB},{label:e("Toggle the upper–latin list style"),tooltip:e("Upper-latin"),type:"upper-latin",icon:d.hFM},{label:e("Toggle the arabic-indic list style"),tooltip:e("Arabic-indic"),type:"arabic-indic",icon:d.cGF}],n=e("Numbered List"),l=e("Numbered list styles toolbar"),o="numberedList";t.ui.componentFactory.add(o,tz({editor:t,normalizedConfig:r,parentCommandName:o,buttonLabel:n,buttonIcon:d.mgI,styleGridAriaLabel:l,styleDefinitions:i})),s.includes("numbered")&&t.ui.componentFactory.add(`menuBar:${o}`,tj({editor:t,normalizedConfig:r,parentCommandName:o,buttonLabel:n,styleGridAriaLabel:l,styleDefinitions:i}))}}}function tz({editor:t,normalizedConfig:e,parentCommandName:i,buttonLabel:r,buttonIcon:s,styleGridAriaLabel:n,styleDefinitions:l}){let o=t.commands.get(i);return a=>{let d=(0,u.yu)(a,u.AO),c=d.buttonView;return d.bind("isEnabled").to(o),d.class="ck-list-styles-dropdown",c.on("execute",()=>{t.execute(i),t.editing.view.focus()}),c.set({label:r,icon:s,tooltip:!0,isToggleable:!0}),c.bind("isOn").to(o,"value",t=>!!t),d.once("change:isOpen",()=>{let r=function({editor:t,normalizedConfig:e,dropdownView:i,parentCommandName:r,styleDefinitions:s,styleGridAriaLabel:n}){let l=t.locale,o={...e,..."numberedList"!=r?{startIndex:!1,reversed:!1}:null},a=r.replace("List",""),d=null;if(e.styles.listTypes.includes(a)){let i=t.commands.get("listStyle"),n=tq({editor:t,parentCommandName:r,listStyleCommand:i}),l=e.styles.listStyleTypes,o=s;if(l){let t=l[a];t&&(o=s.filter(e=>t.includes(e.type)))}let u=tW(i);d=o.filter(u).map(n)}let c=new t$(l,{styleGridAriaLabel:n,enabledProperties:o,styleButtonViews:d});if(e.styles.listTypes.includes(a)&&(0,u.Zn)(i,()=>c.stylesView.children.find(t=>t.isOn)),o.startIndex){let e=t.commands.get("listStart");c.startIndexFieldView.bind("isEnabled").to(e),c.startIndexFieldView.fieldView.bind("value").to(e),c.on("listStart",(e,i)=>t.execute("listStart",i))}if(o.reversed){let e=t.commands.get("listReversed");c.reversedSwitchButtonView.bind("isEnabled").to(e),c.reversedSwitchButtonView.bind("isOn").to(e,"value",t=>!!t),c.on("listReversed",()=>{let i=e.value;t.execute("listReversed",{reversed:!i})})}return c.delegate("execute").to(i),c}({editor:t,normalizedConfig:e,dropdownView:d,parentCommandName:i,styleGridAriaLabel:n,styleDefinitions:l});d.panelView.children.add(r)}),d.on("execute",()=>{t.editing.view.focus()}),d}}function tq({editor:t,listStyleCommand:e,parentCommandName:i}){let r=t.locale,s=t.commands.get(i);return({label:n,type:l,icon:o,tooltip:a})=>{let d=new u._(r);return d.set({label:n,icon:o,tooltip:a}),d.bind("isOn").to(e,"value",t=>t===l),d.on("execute",()=>{s.value?e.value===l?t.execute(i):e.value!==l&&t.execute("listStyle",{type:l}):t.model.change(()=>{t.execute("listStyle",{type:l})})}),d}}function tj({editor:t,normalizedConfig:e,parentCommandName:i,buttonLabel:r,styleGridAriaLabel:s,styleDefinitions:n}){return l=>{let o=new u.zj(l),a=t.commands.get(i),c=t.commands.get("listStyle"),m=tW(c),f=tq({editor:t,parentCommandName:i,listStyleCommand:c}),g=e.styles.listStyleTypes,p=n;if(g){let t=g[a.type];t&&(p=n.filter(e=>t.includes(e.type)))}let b=p.filter(m).map(f),h=new t$(l,{styleGridAriaLabel:s,enabledProperties:{...e,startIndex:!1,reversed:!1},styleButtonViews:b});return h.delegate("execute").to(o),o.buttonView.set({label:r,icon:"bulletedList"===i?d.dwx:d.mgI}),o.panelView.children.add(h),o.bind("isEnabled").to(a,"isEnabled"),o.on("execute",()=>{t.editing.view.focus()}),o}}function tW(t){return"function"==typeof t.isStyleTypeSupported?e=>t.isStyleTypeSupported(e.type):()=>!0}class tK extends r.k_{static get requires(){return[tD,tM]}static get pluginName(){return"ListProperties"}static get isOfficialPlugin(){return!0}}class tU extends r.uB{constructor(t){super(t),this.on("execute",()=>{this.refresh()},{priority:"highest"})}refresh(){let t=this._getSelectedItems();this.value=this._getValue(t),this.isEnabled=!!t.length}execute(t={}){this.editor.model.change(e=>{let i=this._getSelectedItems(),r=void 0===t.forceValue?!this._getValue(i):t.forceValue;for(let t of i)r?e.setAttribute("todoListChecked",!0,t):e.removeAttribute("todoListChecked",t)})}_getValue(t){return t.every(t=>t.getAttribute("todoListChecked"))}_getSelectedItems(){let t=this.editor.model,e=t.schema,i=t.document.selection.getFirstRange(),r=i.start.parent,s=[];for(let t of(e.checkAttribute(r,"todoListChecked")&&s.push(...y(r)),i.getItems({shallow:!0})))e.checkAttribute(t,"todoListChecked")&&!s.includes(t)&&s.push(...y(t));return s}}class tH extends m.$AX{domEventType=["change"];onDomEvent(t){if(t.target){let e=this.view.domConverter.mapDomToView(t.target);e&&e.is("element","input")&&"checkbox"==e.getAttribute("type")&&e.findAnce
1stor({classes:"todo-list__label"})&&this.fire("todoCheckboxChange",t)}}}let tX=(0,l.ZX)("Ctrl+Enter");class tZ extends r.k_{static get pluginName(){return"TodoListEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[tb]}init(){var t,e;let i=this.editor,r=i.model,s=i.editing,n=i.plugins.get(tb),o=i.config.get("list.multiBlock");i.commands.add("todoList",new $(i,"todo")),i.commands.add("checkTodoList",new tU(i)),s.view.addObserver(tH),r.schema.extend("$listItem",{allowAttributes:"todoListChecked"}),r.schema.addAttributeCheck(t=>{let e=t.last;if(!e.getAttribute("listItemId")||"todo"!=e.getAttribute("listType"))return!1},"todoListChecked"),i.conversion.for("upcast").add(t=>{var e;let i;t.on("element:input",(t,e,i)=>{let r=e.modelCursor,s=r.parent,n=e.viewItem;if(!i.consumable.test(n,{name:!0})||"checkbox"!=n.getAttribute("type")||!r.isAtStart||!s.hasAttribute("listType"))return;i.consumable.consume(n,{name:!0});let l=i.writer;l.setAttribute("listType","todo",s),e.viewItem.hasAttribute("checked")&&l.setAttribute("todoListChecked",!0,s),e.modelRange=l.createRange(r)}),t.on("element:li",(t,e,i)=>{let{writer:r,schema:s}=i;if(e.modelRange){for(let[,t]of Array.from(e.modelRange.getItems({shallow:!0})).filter(t=>"todo"===t.getAttribute("listType")&&s.checkAttribute(t,"listItemId")).reduce((t,e)=>{let i=e.getAttribute("listItemId");return t.has(i)||t.set(i,y(e)),t},new Map).entries())if(t.some(t=>t.getAttribute("todoListChecked")))for(let e of t)r.setAttribute("todoListChecked",!0,e)}},{priority:"low"}),t.on("element:label",tQ({name:"label",classes:"todo-list__label"})),t.on("element:label",tQ({name:"label",classes:["todo-list__label","todo-list__label_without-description"]})),t.on("element:span",tQ({name:"span",classes:"todo-list__label__description"})),t.on("element:ul",(e={name:"ul",classes:"todo-list"},i=new m.PNe(e),(t,e,r)=>{let s=i.match(e.viewItem);if(!s)return;let n=s.match;n.name=!1,r.consumable.consume(e.viewItem,n)}))}),i.conversion.for("downcast").elementToElement({model:o?"paragraph":"listItem",view:(t,{writer:e})=>{if(tG(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;let r=t.createUIElement("input",{type:"checkbox",...e.getAttribute("todoListChecked")?{checked:"checked"}:null,...i?{disabled:"disabled"}:{tabindex:"-1"}});if(i)return r;let s=t.createContainerElement("span",{contenteditable:"false"},r);return s.getFillerOffset=()=>null,s},canWrapElement:t=>tG(t,n.getListAttributeNames()),createWrapperElement(t,e,{dataPipeline:i}){let r=["todo-list__label"];return tG(e,n.getListAttributeNames())||r.push("todo-list__label_without-description"),t.createAttributeElement(i?"label":"span",{class:r.join(" ")})}}),n.on("checkElement",(t,{modelElement:e,viewElement:i})=>{let r=tG(e,n.getListAttributeNames());i.hasClass("todo-list__label__description")!=r&&(t.return=!0,t.stop())}),n.on("checkElement",(t,{modelElement:e,viewElement:r})=>{let s="todo"==e.getAttribute("listType")&&v(e),n=!1;for(let{item:t}of i.editing.view.createPositionBefore(r).getWalker({direction:"backward"})){if(t.is("element")&&i.editing.mapper.toModelElement(t))break;t.is("element","input")&&"checkbox"==t.getAttribute("type")&&(n=!0)}n!=s&&(t.return=!0,t.stop())}),n.on("postFixer",(t,{listNodes:e,writer:i})=>{for(let{node:r,previousNodeInList:s}of e){if(!s||s.getAttribute("listItemId")!=r.getAttribute("listItemId"))continue;let e=s.hasAttribute("todoListChecked"),n=r.hasAttribute("todoListChecked");n&&!e?(i.removeAttribute("todoListChecked",r),t.return=!0):!n&&e&&(i.setAttribute("todoListChecked",!0,r),t.return=!0)}}),r.document.registerPostFixer(t=>{let e=r.document.differ.getChanges(),i=!1;for(let r of e)if("attribute"==r.type&&"listType"==r.attributeKey){let e=r.range.start.nodeAfter;"todo"==r.attributeOldValue&&e.hasAttribute("todoListChecked")&&(t.removeAttribute("todoListChecked",e),i=!0)}else if("insert"==r.type&&"$text"!=r.name)for(let{item:e}of t.createRangeOn(r.position.nodeAfter))e.is("element")&&"todo"!=e.getAttribute("listType")&&e.hasAttribute("todoListChecked")&&(t.removeAttribute("todoListChecked",e),i=!0);return i}),this.listenTo(s.view.document,"keydown",(t,e)=>{(0,l.QC)(e)===tX&&(i.execute("checkTodoList"),t.stop())},{priority:"high"}),this.listenTo(s.view.document,"todoCheckboxChange",(t,e)=>{let i=e.target;if(!i||!i.is("element","input"))return;let r=s.view.createPositionAfter(i),n=s.mapper.toModelPosition(r).parent;n&&h(n)&&"todo"==n.getAttribute("listType")&&this._handleCheckmarkChange(n)}),this.listenTo(s.view.document,"arrowKey",(t=r,e=i.locale,(i,r)=>{let s=(0,l.Kf)(r.keyCode,e.contentLanguageDirection),n=t.schema,o=t.document.selection;if(!o.isCollapsed)return;let a=o.getFirstPosition(),u=a.parent;
1if("right"==s&&a.isAtEnd){let e=n.getNearestSelectionRange(t.createPositionAfter(u),"forward");if(!e)return;let s=e.start.parent;s&&h(s)&&"todo"==s.getAttribute("listType")&&(t.change(t=>t.setSelection(e)),r.preventDefault(),r.stopPropagation(),i.stop())}else if("left"==s&&a.isAtStart&&h(u)&&"todo"==u.getAttribute("listType")){let e=n.getNearestSelectionRange(t.createPositionBefore(u),"backward");if(!e)return;t.change(t=>t.setSelection(e)),r.preventDefault(),r.stopPropagation(),i.stop()}}),{context:"$text"}),this.listenTo(s.mapper,"viewToModelPosition",(t,e)=>{let i=e.viewPosition.parent,s=i.is("attributeElement","li")&&0==e.viewPosition.offset,n=tJ(i)&&e.viewPosition.offset<=1,l=i.is("element","span")&&"false"==i.getAttribute("contenteditable")&&tJ(i.parent);if(!s&&!n&&!l)return;let o=e.modelPosition.nodeAfter;o&&"todo"==o.getAttribute("listType")&&(e.modelPosition=r.createPositionAt(o,0))},{priority:"low"}),this._initAriaAnnouncements()}_handleCheckmarkChange(t){let e=this.editor,i=e.model,r=Array.from(i.document.selection.getRanges());i.change(i=>{i.setSelection(t,"end"),e.execute("checkTodoList"),i.setSelection(r)})}_initAriaAnnouncements(){let{model:t,ui:e,t:i}=this.editor,r=null;e&&t.document.selection.on("change:range",()=>{let s=t.document.selection.focus.parent,n=tY(r),l=tY(s);n&&!l?e.ariaLiveAnnouncer.announce(i("Leaving a to-do list")):!n&&l&&e.ariaLiveAnnouncer.announce(i("Entering a to-do list")),r=s})}}function tQ(t){let e=new m.PNe(t);return(t,i,r)=>{let s=e.match(i.viewItem);!s||r.consumable.consume(i.viewItem,s.match)&&Object.assign(i,r.convertChildren(i.viewItem,i.modelCursor))}}function tG(t,e){return(t.is("element","paragraph")||t.is("element","listItem"))&&"todo"==t.getAttribute("listType")&&v(t)&&function(t,e){for(let i of t.getAttributeKeys())if(!i.startsWith("selection:")&&!e.includes(i))return!1;return!0}(t,e)}function tJ(t){return!!t&&t.is("attributeElement")&&t.hasClass("todo-list__label")}function tY(t){return!!t&&(!!t.is("element","paragraph")||!!t.is("element","listItem"))&&"todo"==t.getAttribute("listType")}class t0 extends r.k_{static get pluginName(){return"TodoListUI"}static get isOfficialPlugin(){return!0}init(){let t=this.editor.t;ty(this.editor,"todoList",t("To-do List"),d.ecv)}}class t1 extends r.k_{static get requires(){return[tZ,t0]}static get pluginName(){return"TodoList"}static get isOfficialPlugin(){return!0}}class t2 extends r.uB{type;constructor(t,e){super(t),this.type=e}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){let e=this.editor.model,i=Array.from(e.document.selection.getSelectedBlocks()).filter(t=>t5(t,e.schema)),r=void 0!==t.forceValue?!t.forceValue:this.value;e.change(t=>{if(r){let e=i[i.length-1].nextSibling,r=1/0,s=[];for(;e&&"listItem"==e.name&&0!==e.getAttribute("listIndent");){let t=e.getAttribute("listIndent");t<r&&(r=t);let i=t-r;s.push({element:e,listIndent:i}),e=e.nextSibling}for(let e of s=s.reverse())t.setAttribute("listIndent",e.listIndent,e.element)}if(!r){let t=1/0;for(let e of i)e.is("element","listItem")&&e.getAttribute("listIndent")<t&&(t=e.getAttribute("listIndent"));t4(i,!0,t=0===t?1:t),t4(i,!1,t)}for(let e of i.reverse())r&&"listItem"==e.name?t.rename(e,"paragraph"):r||"listItem"==e.name?r||"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",i)})}_getValue(){let t=(0,l.$1)(this.editor.model.document.selection.getSelectedBlocks());return!!t&&t.is("element","listItem")&&t.getAttribute("listType")==this.type}_checkEnabled(){if(this.value)return!0;let t=this.editor.model.document.selection,e=this.editor.model.schema,i=(0,l.$1)(t.getSelectedBlocks());return!!i&&t5(i,e)}}function t4(t,e,i){let r=e?t[0]:t[t.length-1];if(r.is("element","listItem")){let s=r[e?"previousSibling":"nextSibling"],n=r.getAttribute("listIndent");for(;s&&s.is("element","listItem")&&s.getAttribute("listIndent")>=i;)n>s.getAttribute("listIndent")&&(n=s.getAttribute("listIndent")),s.getAttribute("listIndent")==n&&t[e?"unshift":"push"](s),s=s[e?"previousSibling":"nextSibling"]}}function t5(t,e){return e.checkChild(t.parent,"listItem")&&!e.isObject(t)}class t3 extends r.uB{_indentBy;constructor(t,e){super(t),this._indentBy="forward"==e?1:-1}refresh(){this.isEnabled=this._checkEnabled()}execute(){let t=this.editor.model,e=Array.from(t.document.selection.getSelectedBlocks());t.change(t=>{let i=e[e.length-1],r=i.nextSibling;for(;r&&"listItem"==r.name&&r.getAttribute("listIndent")>i.getAttribute("listIndent");)e.push(r),r=r.nextSibling;for(let i of(this._indentBy<0&&(e=e.reverse()),e)){let e=i.getAttribute("listIndent")+this._indentBy;e<0?t.rename(i,"paragraph"):t.setAttribute("listIndent",e,i)}this.fire("_executeCleanup",e)})}_checkEnabled(){let t=(0,l.$1)(this.editor.model.document.selection.getSelectedBlocks());if(!t||!t.is("element","listItem"))return!1;if(this._indentBy>0){let e=t.getAttribute("listIndent"),i=t.getAttribute("listType"),r=t.previousSibling;for(;r&&r.is("element","listItem")&&r.getAttribute("listIndent")>=e;){if(r.getAttribute("listIndent")==e)return r.getAttribute("listType")==i;r=r.previousSibling}return!1}return!0}}function t7(t,e){let i,r=e.mapper,s=e.writer,n="numbered"==t.getAttribute("listType")?"ol":"ul",l=((i=s.createContainerElement("li")).getFillerOffset=eo,i),o=s.createContainerElement(n,null);return s.insert(s.createPositionAt(o,0),l),r.bindElements(t,l),l}function t9(t,e,i,r){let s=e.parent,n=i.mapper,l=i.writer,o=n.toViewPosition(r.createPositionBefore(t)),a=et(t.previousSibling,{sameIndent:!0,smallerIndent:!0,listIndent:t.getAttribute("listIndent")}),u=t.previousSibling;if(a&&a.getAttribute("listIndent")==t.getAttribute("listIndent")){let t=n.toViewElement(a);o=l.breakContainer(l.createPositionAfter(t))}else if(u&&"listItem"==u.name){o=n.toViewPosition(r.createPositionAt(u,"end"));let t=n.findMappedViewAncestor(o),e=ee(t);o=e?l.createPositionBefore(e):l.createPositionAt(t,"end")}else o=n.toViewPosition(r.createPositionBefore(t));if(o=t6(o),l.insert(o,s),u&&"listItem"==u.name){let t=n.toViewElement(u),i=l.createRange(l.createPositionAt(t,0),o).getWalker({ignoreElementEnd:!0});for(let t of i)if(t.item.is("element","li")){let r=l.breakContainer(l.createPositionBefore(t.item)),s=t.item.parent,n=l.createPositionAt(e,"end");t8(l,n.nodeBefore,n.nodeAfter),l.move(l.createRangeOn(s),n),i._position=r}}else{let i=s.nextSibling;if(i&&(i.is("element","ul")||i.is("element","ol"))){let r=null;for(let e of i.getChildren()){let i=n.toModelElement(e);
1if(i&&i.getAttribute("listIndent")>t.getAttribute("listIndent"))r=e;else break}r&&(l.breakContainer(l.createPositionAfter(r)),l.move(l.createRangeOn(r.parent),l.createPositionAt(e,"end")))}}t8(l,s,s.nextSibling),t8(l,s.previousSibling,s)}function t8(t,e,i){return e&&i&&("ul"==e.name||"ol"==e.name)&&e.name==i.name&&e.getAttribute("class")===i.getAttribute("class")?t.mergeContainers(t.createPositionAfter(e)):null}function t6(t){return t.getLastMatchingPosition(t=>t.item.is("uiElement"))}function et(t,e){let i=!!e.sameIndent,r=!!e.smallerIndent,s=e.listIndent,n=t;for(;n&&"listItem"==n.name;){let t=n.getAttribute("listIndent");if(i&&s==t||r&&s>t)return n;n="forward"===e.direction?n.nextSibling:n.previousSibling}return null}function ee(t){for(let e of t.getChildren())if("ul"==e.name||"ol"==e.name)return e;return null}function ei(t,e){let i=[],r=t.parent,s=r.getAttribute("listIndent");for(let n of[...new m.oDe({ignoreElementEnd:!1,startPosition:t,shallow:!0,direction:e})].filter(t=>t.item.is("element")).map(t=>t.item)){if(!n.is("element","listItem")||n.getAttribute("listIndent")<s)break;if(!(n.getAttribute("listIndent")>s)){if(n.getAttribute("listType")!==r.getAttribute("listType")||n.getAttribute("listStyle")!==r.getAttribute("listStyle")||n.getAttribute("listReversed")!==r.getAttribute("listReversed")||n.getAttribute("listStart")!==r.getAttribute("listStart"))break;"backward"===e?i.unshift(n):i.push(n)}}return i}function er(t){let e=[...t.document.selection.getSelectedBlocks()].filter(t=>t.is("element","listItem")).map(e=>{let i=t.change(t=>t.createPositionAt(e,0));return[...ei(i,"backward"),...ei(i,"forward")]}).flat();return[...new Set(e)]}let es=["disc","circle","square"],en=["decimal","decimal-leading-zero","lower-roman","upper-roman","lower-latin","upper-latin"];function el(t){return es.includes(t)?"bulleted":en.includes(t)?"numbered":null}function eo(){let t=!this.isEmpty&&("ul"==this.getChild(0).name||"ol"==this.getChild(0).name);return this.isEmpty||t?0:m.T4G.call(this)}class ea extends r.k_{static get pluginName(){return"LegacyListUtils"}static get isOfficialPlugin(){return!0}getListTypeFromListStyleType(t){return el(t)}getSelectedListItems(t){return er(t)}getSiblingNodes(t,e){return ei(t,e)}}function eu(t){return(e,i,r)=>{let s=r.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");let n=i.item,l=t7(n,r);t9(n,l,r,t)}}let ed=(t,e,i)=>{if(!i.consumable.test(e.item,t.name))return;let r=i.mapper.toViewElement(e.item),s=i.writer;s.breakContainer(s.createPositionBefore(r)),s.breakContainer(s.createPositionAfter(r));let n=r.parent,l="numbered"==e.attributeNewValue?"ol":"ul";s.rename(l,n)},ec=(t,e,i)=>{i.consumable.consume(e.item,t.name);let r=i.mapper.toViewElement(e.item).parent,s=i.writer;t8(s,r,r.nextSibling),t8(s,r.previousSibling,r)},em=(t,e,i)=>{if(i.consumable.test(e.item,t.name)&&"listItem"!=e.item.name){let t=i.mapper.toViewPosition(e.range.start),r=i.writer,s=[];for(;("ul"==t.parent.name||"ol"==t.parent.name)&&"li"==(t=r.breakContainer(t)).parent.name;){let e=t,i=r.createPositionAt(t.parent,"end");if(!e.isEqual(i)){let t=r.remove(r.createRange(e,i));s.push(t)}t=r.createPositionAfter(t.parent)}if(s.length>0){for(let e=0;e<s.length;e++){let i=t.nodeBefore;if(t=r.insert(t,s[e]).end,e>0){let e=t8(r,i,i.nextSibling);e&&e.parent==i&&t.offset--}}t8(r,t.nodeBefore,t.nodeAfter)}}},ef=(t,e,i)=>{let r=i.mapper.toViewPosition(e.position),s=r.nodeBefore,n=r.nodeAfter;t8(i.writer,s,n)},eg=(t,e,i)=>{if(i.consumable.consume(e.viewItem,{name:!0})){let t=i.writer,r=t.createElement("listItem"),s=function(t){let e=0,i=t.parent;for(;i;){if(i.is("element","li"))e++;else{let t=i.previousSibling;t&&t.is("element","li")&&e++}i=i.parent}return e}(e.viewItem);t.setAttribute("listIndent",s,r);let n=e.viewItem.parent&&"ol"==e.viewItem.parent.name?"numbered":"bulleted";if(t.setAttribute("listType",n,r),!i.safeInsert(r,e.modelCursor))return;
1let l=function(t,e,i){let{writer:r,schema:s}=i,n=r.createPositionAfter(t);for(let l of e)if("ul"==l.name||"ol"==l.name)n=i.convertItem(l,n).modelCursor;else{let e=i.convertItem(l,r.createPositionAt(t,"end")),o=e.modelRange.start.nodeAfter;o&&o.is("element")&&!s.checkChild(t,o.name)&&(t=e.modelCursor.parent.is("element","listItem")?e.modelCursor.parent:function(t){let e,i=new m.oDe({startPosition:t});do e=i.next();while(!e.value.item.is("element","listItem"));return e.value.item}(e.modelCursor),n=r.createPositionAfter(t))}return n}(r,e.viewItem.getChildren(),i);e.modelRange=t.createRange(e.modelCursor,l),i.updateConversionResult(r,e)}},ep=(t,e,i)=>{if(i.consumable.test(e.viewItem,{name:!0}))for(let t of Array.from(e.viewItem.getChildren()))t.is("element","li")||eI(t)||t._remove()},eb=(t,e,i)=>{if(i.consumable.test(e.viewItem,{name:!0})){if(0===e.viewItem.childCount)return;let t=[...e.viewItem.getChildren()],i=!1;for(let e of t)i&&!eI(e)&&e._remove(),eI(e)&&(i=!0)}};function eh(t){return(e,i)=>{if(i.isPhantom)return;let r=i.modelPosition.nodeBefore;if(r&&r.is("element","listItem")){let e=i.mapper.toViewElement(r),s=e.getAncestors().find(eI);for(let r of t.createPositionAt(e,0).getWalker())if("elementStart"==r.type&&r.item.is("element","li")){i.viewPosition=r.previousPosition;break}else if("elementEnd"==r.type&&r.item==s){i.viewPosition=r.nextPosition;break}}}}let ey=function(t,[e,i]){let r,s=e.is("documentFragment")?e.getChild(0):e;if(r=i?this.createSelection(i):this.document.selection,s&&s.is("element","listItem")){let t=r.getFirstPosition(),e=null;if(t.parent.is("element","listItem")?e=t.parent:t.nodeBefore&&t.nodeBefore.is("element","listItem")&&(e=t.nodeBefore),e){let t=e.getAttribute("listIndent");if(t>0)for(;s&&s.is("element","listItem");)s._setAttribute("listIndent",s.getAttribute("listIndent")+t),s=s.nextSibling}}};function eA(t,e,i,r,s,n){let l,o=et(e.nodeBefore,{sameIndent:!0,smallerIndent:!0,listIndent:t}),a=s.mapper,u=s.writer,d=o?o.getAttribute("listIndent"):null;if(o)if(d==t){let t=a.toViewElement(o).parent;l=u.createPositionAfter(t)}else{let t=n.createPositionAt(o,"end");l=a.toViewPosition(t)}else l=i;for(let t of(l=t6(l),[...r.getChildren()]))eI(t)&&(l=u.move(u.createRangeOn(t),l).end,t8(u,t,t.nextSibling),t8(u,t.previousSibling,t))}function eI(t){return t.is("element","ol")||t.is("element","ul")}class ew extends r.k_{static get pluginName(){return"LegacyListEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[n.xy,s.ep,ea]}init(){var t;let e=this.editor;e.model.schema.register("listItem",{inheritAllFrom:"$block",allowAttributes:["listType","listIndent"]});let i=e.data,r=e.editing;e.model.document.registerPostFixer(t=>(function(t,e){let i=t.document.differ.getChanges(),r=new Map,s=!1;for(let r of i)if("insert"==r.type&&"listItem"==r.name)n(r.position);else if("insert"==r.type&&"listItem"!=r.name){if("$text"!=r.name){let i=r.position.nodeAfter;for(let r of(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),Array.from(t.createRangeIn(i)).filter(t=>t.item.is("element","listItem"))))n(r.previousPosition)}n(r.position.getShiftedBy(r.length))}else"remove"==r.type&&"listItem"==r.name?n(r.position):"attribute"==r.type&&"listIndent"==r.attributeKey?n(r.range.start):"attribute"==r.type&&"listType"==r.attributeKey&&n(r.range.start);for(let t of r.values())(function(t){let i=0,r=null;for(;t&&t.is("element","listItem");){let n=t.getAttribute("listIndent");if(n>i){let l;null===r?(r=n-i,l=i):(r>n&&(r=n),l=n-r),e.setAttribute("listIndent",l,t),s=!0}else r=null,i=t.getAttribute("listIndent")+1;t=t.nextSibling}})(t),function(t){let i=[],r=null;for(;t&&t.is("element","listItem");){let n=t.getAttribute("listIndent");if(r&&r.getAttribute("listIndent")>n&&(i=i.slice(0,n+1)),0!=n)if(i[n]){let r=i[n];t.getAttribute("listType")!=r&&(e.setAttribute("listType",r,t),s=!0)}else i[n]=t.getAttribute("listType");r=t,t=t.nextSibling}}(t);return s;function n(t){let e=t.nodeBefore;if(e&&e.is("element","listItem")){let t=e;if(r.has(t))return;for(let e=t.previousSibling;e&&e.is("element","listItem");e=t.previousSibling)if(t=e,r.has(t))return;r.set(e,t)}else{let e=t.nodeAfter;e&&e.is("element","listItem")&&r.set(e,e)}}})(e.model,t)),r.mapper.registerViewToModelLength("li",ev),i.mapper.registerViewToModelLength("li",ev),r.mapper.on("modelToViewPosition",eh(r.view)),r.mapper.on("viewToModelPosition",(t=e.model,(e,i
1)=>{let r=i.viewPosition,s=r.parent,n=i.mapper;if("ul"==s.name||"ol"==s.name){if(r.isAtEnd){let e=n.toModelElement(r.nodeBefore),s=n.getModelLength(r.nodeBefore);i.modelPosition=t.createPositionBefore(e).getShiftedBy(s)}else{let e=n.toModelElement(r.nodeAfter);i.modelPosition=t.createPositionBefore(e)}e.stop()}else if("li"==s.name&&r.nodeBefore&&("ul"==r.nodeBefore.name||"ol"==r.nodeBefore.name)){let l=n.toModelElement(s),o=1,a=r.nodeBefore;for(;a&&eI(a);)o+=n.getModelLength(a),a=a.previousSibling;i.modelPosition=t.createPositionBefore(l).getShiftedBy(o),e.stop()}})),i.mapper.on("modelToViewPosition",eh(r.view)),e.conversion.for("editingDowncast").add(t=>{var i,r;t.on("insert",em,{priority:"high"}),t.on("insert:listItem",eu(e.model)),t.on("attribute:listType:listItem",ed,{priority:"high"}),t.on("attribute:listType:listItem",ec,{priority:"low"}),t.on("attribute:listIndent:listItem",(i=e.model,(t,e,r)=>{if(!r.consumable.consume(e.item,"attribute:listIndent"))return;let s=r.mapper.toViewElement(e.item),n=r.writer;n.breakContainer(n.createPositionBefore(s)),n.breakContainer(n.createPositionAfter(s));let l=s.parent,o=l.previousSibling,a=n.createRangeOn(l);for(let t of(n.remove(a),o&&o.nextSibling&&t8(n,o,o.nextSibling),eA(e.attributeOldValue+1,e.range.start,a.start,s,r,i),t9(e.item,s,r,i),e.item.getChildren()))r.consumable.consume(t,"insert")})),t.on("remove:listItem",(r=e.model,(t,e,i)=>{let s=i.mapper.toViewPosition(e.position).getLastMatchingPosition(t=>!t.item.is("element","li")).nodeAfter,n=i.writer;n.breakContainer(n.createPositionBefore(s)),n.breakContainer(n.createPositionAfter(s));let l=s.parent,o=l.previousSibling,a=n.createRangeOn(l),u=n.remove(a);for(let t of(o&&o.nextSibling&&t8(n,o,o.nextSibling),eA(i.mapper.toModelElement(s).getAttribute("listIndent")+1,e.position,a.start,s,i,r),n.createRangeIn(u).getItems()))i.mapper.unbindViewElement(t);t.stop()})),t.on("remove",ef,{priority:"low"})}),e.conversion.for("dataDowncast").add(t=>{t.on("insert",em,{priority:"high"}),t.on("insert:listItem",eu(e.model))}),e.conversion.for("upcast").add(t=>{t.on("element:ul",ep,{priority:"high"}),t.on("element:ol",ep,{priority:"high"}),t.on("element:li",eb,{priority:"high"}),t.on("element:li",eg)}),e.model.on("insertContent",ey,{priority:"high"}),e.commands.add("numberedList",new t2(e,"numbered")),e.commands.add("bulletedList",new t2(e,"bulleted")),e.commands.add("indentList",new t3(e,"forward")),e.commands.add("outdentList",new t3(e,"backward"));let s=r.view.document;this.listenTo(s,"enter",(t,e)=>{let i=this.editor.model.document,r=i.selection.getLastPosition().parent;i.selection.isCollapsed&&"listItem"==r.name&&r.isEmpty&&(this.editor.execute("outdentList"),e.preventDefault(),t.stop())},{context:"li"}),this.listenTo(s,"delete",(t,e)=>{if("backward"!==e.direction)return;let i=this.editor.model.document.selection;if(!i.isCollapsed)return;let r=i.getFirstPosition();if(!r.isAtStart)return;let s=r.parent;"listItem"!==s.name||s.previousSibling&&"listItem"===s.previousSibling.name||(this.editor.execute("outdentList"),e.preventDefault(),t.stop())},{context:"li"}),this.listenTo(e.editing.view.document,"tab",(t,i)=>{let r=i.shiftKey?"outdentList":"indentList";this.editor.commands.get(r).isEnabled&&(e.execute(r),i.stopPropagation(),i.preventDefault(),t.stop())},{context:"li"})}afterInit(){let 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 ev(t){let e=1;for(let i of t.getChildren())if("ul"==i.name||"ol"==i.name)for(let t of i.getChildren())e+=ev(t);return e}class ek extends r.k_{static get requires(){return[ew,tI]}static get pluginName(){return"LegacyList"}static get isOfficialPlugin(){return!0}}class eS extends r.uB{defaultType;constructor(t,e){super(t),this.defaultType=e}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){this._tryToConvertItemsToList(t);let e=this.editor.model,i=er(e);i.length&&e.change(e=>{for(let r of i)e.setAttribute("listStyle",t.type||this.defaultType,r)})}_getValue(){let t=this.editor.model.document.selection.getFirstPosition().parent;return t&&t.is("element","listItem")?t.getAttribute("listStyle"):null}_checkEnabled(){let t=this.editor,e=t.commands.get("numberedList"),i=t.commands.get("bulletedList");return e.isEnabled||i.isEnabled}_tryToConvertItemsToList(t){if(!t.type)return;let e=el(t.type);if(!e)return;let i=this.editor,r=`${e}List`;i.commands.get(r).value||i.execute(r)}}class e_ extends r.uB{refresh(){let t=this._getValue();this.value=t,this.isEnabled=null!=t}execute(t={}){let e=this.editor.model,i=er(e).filter(t=>"numbered"==t.getAttribute("listType"));e.change(e=>{for(let r of i)e.setAttribute("listReversed",!!t.reversed,r)})}_getValue(){let t=this.editor.model.document.selection.getFirstPosition().parent;return t&&t.is("element","listItem")&&"numbered"==t.getAttribute("listType")?t.getAttribute("listReversed"):null}}class eT extends r.uB{refresh(){let t=this._getValue();this.value=t,this.isEnabled=null!=t}execute({startIndex:t=1}={}){let e=this.editor.model,i=er(e).filter(t=>"numbered"==t.getAttribute("listType"));e.change(e=>{for(let r of i)e.setAttribute("listStart",t>=0?t:1,r)})}_getValue(){let t=this.editor.model.document.selection.getFirstPosition().parent;return t&&t.is("element","listItem")&&"numbered"==t.getAttribute("listType")?t.getAttribute("listStart"):null}}let ex="default";class eL extends r.k_{static get requires(){return[ew]}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(){var t,e,i,r,s,n,l,o,a;let u,d=this.editor,c=d.model,m=(t=d.config.get("list.properties"),u=[],t.styles&&u.push({attributeName:"listStyle",defaultValue:ex,addCommand(t){t.commands.add("listStyle",new eS(t,ex))},appliesToListItem:()=>!0,setAttributeOnDowncast(t,e,i){e&&e!==ex?t.setStyle("list-style-type",e,i):t.removeStyle("list-style-type",i)},getAttributeOnUpcast:t=>tE(t.getStyle("list-style-type"))||ex}),t.reversed&&u.push({attributeName:"listReversed",defaultValue:!1,addCommand(t){t.commands.add("listReversed",new e_(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&&u.push({attributeName:"listStart",defaultValue:1,addCommand(t){t.commands.add("listStart",new eT(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){let e=t.getAttribute("start");return e>=0?e:1}}),u);for(let t of(c.schema.extend("listItem",{allowAttributes:m.map(t=>t.attributeName)}),m))t.addCommand(d);this.listenTo(d.commands.get("indentList"),"_executeCleanup",(e=d,i=m,(t,r)=>{let s=r[0],n=s.getAttribute("listIndent"),l=r.filter(t=>t.getAttribute("listIndent")===n),o=null;s.previousSibling.getAttribute("listIndent")+1!==n&&(o=et(s.previousSibling,{sameIndent:!0,direction:"backward",listIndent:n})),e.model.change(t=>{for(let e of l)for(let r of i)if(r.appliesToListItem(e)){let i=null==o?r.defaultValue:o.getAttribute(r.attributeName);t.setAttribute(r.attributeName,i,e)}})})),this.listenTo(d.commands.get("outdentList"),"_executeCleanup",(r=d,s=m,(t,e)=>{if(!(e=e.reverse().filter(t=>t.is("element","listItem"))).length)return;let i=e[0].getAttribute("listIndent"),n=e[0].getAttribute("listType"),l=e[0].previousSibling;if(l.is("element","listItem"))for(;l.getAttribute("listIndent")!==i;)l=l.previousSibling;else l=null;l||(l=e[e.length-1].nextSibling),l&&l.is("element","listItem")&&l.getAttribute("listType")===n&&r.model.change(t=>{for(let r of e.filter(t=>t.getAttribute("listIndent")===i))for(let e of s)if(e.appliesToListItem(r)){let i=e.attributeName,s=l.getAttribute(i);t.setAttribute(i,s,r)}})})),this.listenTo(d.commands.get("bulletedList"),"_executeCleanup",eC(d)),this.listenTo(d.commands.get("numberedList"),"_executeCleanup",eC(d)),c.document.registerPostFixer((n=d,l=m,t=>{let e=!1,i=eP(n.model.document.differ.getChanges()).filter(t=>"todo"!==t.getAttribute("listType"));if(!i.length)return e;let r=i[i.length-1].nextSibling;if((!r||!r.is("element","listItem"))&&(r=i[0].previousSibling)){let t=i[0].getAttribute("listIndent");for(;r.is("element","listItem")&&r.getAttribute("listIndent")!==t&&(r=r.previousSibling););}for(let s of l){let n=s.attributeName;for(let l of i){if(!s.appliesToListItem(l)){t.removeAttribute(n,l);continue}if(l.hasAttribute(n)){let i=l.previousSibling;
1(function(t,e,i){if(!t||!t.is("element","listItem")||e.getAttribute("listType")!==t.getAttribute("listType"))return!1;let r=t.getAttribute("listIndent");if(r<1||r!==e.getAttribute("listIndent"))return!1;let s=t.getAttribute(i);return!!s&&s!==e.getAttribute(i)})(i,l,s.attributeName)&&(t.setAttribute(n,i.getAttribute(n),l),e=!0)}else!function(t,e,i){if(!t)return!1;let r=t.getAttribute(i.attributeName);return!!r&&r!=i.defaultValue&&t.getAttribute("listType")===e.getAttribute("listType")}(r,l,s)?t.setAttribute(n,s.defaultValue,l):t.setAttribute(n,r.getAttribute(n),l),e=!0}}return e})),d.conversion.for("upcast").add((o=m,t=>{t.on("element:li",(t,e,i)=>{if(!e.modelRange)return;let r=e.viewItem.parent,s=e.modelRange.start.nodeAfter||e.modelRange.end.nodeBefore;for(let t of o)if(t.appliesToListItem(s)){let e=t.getAttributeOnUpcast(r);i.writer.setAttribute(t.attributeName,e,s)}},{priority:"low"})})),d.conversion.for("downcast").add((a=m,t=>{for(let e of a)t.on(`attribute:${e.attributeName}:listItem`,(t,i,r)=>{var s,n;let l=r.writer,o=i.item,a=et(o.previousSibling,{sameIndent:!0,listIndent:o.getAttribute("listIndent"),direction:"backward"}),u=r.mapper.toViewElement(o);s=o,(n=a)&&s.getAttribute("listType")===n.getAttribute("listType")&&s.getAttribute("listIndent")===n.getAttribute("listIndent")&&s.getAttribute("listStyle")===n.getAttribute("listStyle")&&s.getAttribute("listReversed")===n.getAttribute("listReversed")&&s.getAttribute("listStart")===n.getAttribute("listStart")||l.breakContainer(l.createPositionBefore(u)),e.setAttributeOnDowncast(l,i.attributeNewValue,u.parent)},{priority:"low"})})),this._mergeListAttributesWhileMergingLists(m)}afterInit(){var t;let e=this.editor;e.commands.get("todoList")&&e.model.document.registerPostFixer((t=e,e=>{let i=eP(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(let t of i)e.removeAttribute("listStyle",t),e.removeAttribute("listReversed",t),e.removeAttribute("listStart",t);return!0}))}_mergeListAttributesWhileMergingLists(t){let e,i=this.editor.model;this.listenTo(i,"deleteContent",(t,[i])=>{let r=i.getFirstPosition(),s=i.getLastPosition();if(r.parent===s.parent||!r.parent.is("element","listItem"))return;let n=s.parent.nextSibling;if(!n||!n.is("element","listItem"))return;let l=et(r.parent,{sameIndent:!0,listIndent:n.getAttribute("listIndent")});l&&l.getAttribute("listType")===n.getAttribute("listType")&&(e=l)},{priority:"high"}),this.listenTo(i,"deleteContent",()=>{e&&(i.change(i=>{let r=et(e.nextSibling,{sameIndent:!0,listIndent:e.getAttribute("listIndent"),direction:"forward"});if(!r){e=null;return}for(let s of[r,...ei(i.createPositionAt(r,0),"forward")])for(let r of t)if(r.appliesToListItem(s)){let t=r.attributeName,n=e.getAttribute(t);i.setAttribute(t,n,s)}}),e=null)},{priority:"low"})}}function eC(t){return(e,i)=>{i=i.filter(t=>t.is("element","listItem")),t.model.change(t=>{for(let e of i)t.removeAttribute("listStyle",e)})}}function eP(t){let e=[];for(let r of t){var i;let t="attribute"===(i=r).type?i.range.start.nodeAfter:"insert"===i.type?i.position.nodeAfter:null;t&&t.is("element","listItem")&&e.push(t)}return e}class eE extends r.k_{static get requires(){return[eL,tM]}static get pluginName(){return"LegacyListProperties"}static get isOfficialPlugin(){return!0}}let eF="todoListChecked";class eV extends r.uB{_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(eF)),this.isEnabled=!!this._selectedElements.length}_getSelectedItems(){let t=this.editor.model,e=t.schema,i=t.document.selection.getFirstRange(),r=i.start.parent,s=[];for(let t of(e.checkAttribute(r,eF)&&s.push(r),i.getItems()))e.checkAttribute(t,eF)&&!s.includes(t)&&s.push(t);return s}execute(t={}){this.editor.model.change(e=>{for(let i of this._selectedElements)(void 0===t.forceValue?!this.value:t.forceValue)?e.setAttribute(eF,!0,i):e.removeAttribute(eF,i)})}}let eB=(t,e,i)=>{let r=e.modelCursor,s=r.parent,n=e.viewItem;if("checkbox"!=n.getAttribute("type")||"listItem"!=s.name||!r.isAtStart||!i.consumable.consume(n,{name:!0}))return;let l=i.writer;l.setAttribute("listType","todo",s),e.viewItem.hasAttribute("checked")&&l.setAttribute("todoListChecked",!0,s),e.modelRange=l.createRange(r)};function eN(t){return(e,i)=>{let r=i.modelPosition,s=r.parent;if(!s.is("element","listItem")||"todo"!=s.getAttribute("listType"))return;let n=eR(i.mapper.toViewElement(s),t);n&&(i.viewPosition=i.mapper.findPositionIn(n,r.offset))}}function eO(t,e,i,r){return e.createUIElement("label",{class:"todo-list__label",contenteditable:!1},function(e){let s=(0,l.n)(document,"input",{type:"checkbox",tabindex:"-1"});i&&s.setAttribute("checked","checked"),s.addEventListener("change",()=>r(t));let n=this.toDomElement(e);return n.appendChild(s),n})}function eR(t,e){for(let i of e.createRangeIn(t))if(i.item.is("containerElement","span")&&i.item.hasClass("todo-list__label__description"))return i.item}let eD=(0,l.ZX)("Ctrl+Enter");class e$ extends r.k_{static get pluginName(){return"LegacyTodoListEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[ew]}init(){var t,e,i,r,s,n;let o=this.editor,{editing:a,data:u,model:d}=o;d.schema.extend("listItem",{allowAttributes:["todoListChecked"]}),d.schema.addAttributeCheck((t,e)=>{let i=t.last;if("todoListChecked"==e&&"listItem"==i.name&&"todo"!=i.getAttribute("listType"))return!1}),o.commands.add("todoList",new t2(o,"todo"));let c=new eV(o);o.commands.add("checkTodoList",c),o.commands.add("todoListCheck",c),u.downcastDispatcher.on("insert:listItem",(t,e,i)=>{let r=i.consumable;if(!r.test(e.item,"insert")||!r.test(e.item,"attribute:listType")||!r.test(e.item,"attribute:listIndent")||"todo"!=e.item.getAttribute("listType"))return;let s=e.item;r.consume(s,"insert"),r.consume(s,"attribute:listType"),r.consume(s,"attribute:listIndent"),r.consume(s,"attribute:todoListChecked");let n=i.writer,l=t7(s,i);n.addClass("todo-list",l.parent);let o=n.createContainerElement("label",{class:"todo-list__label"}),a=n.createEmptyElement("input",{type:"checkbox",disabled:"disabled"}),u=n.createContainerElement("span",{class:"todo-list__label__description"});s.getAttribute("todoListChecked")&&n.setAttribute("checked","checked",a),n.insert(n.createPositionAt(l,0),o),n.insert(n.createPositionAt(o,0),a),n.insert(n.createPositionAfter(a),u),t9(s,l,i,d)},{priority:"high"}),u.upcastDispatcher.on("element:input",eB,{priority:"high"}),a.downcastDispatcher.on("insert:listItem",(t=t=>this._handleCheckmarkChange(t),(e,i,r)=>{let s=r.consumable;if(!s.test(i.item,"insert")||!s.test(i.item,"attribute:listType")||!s.test(i.item,"attribute:listIndent")||"todo"!=i.item.getAttribute("listType"))return;let n=i.item;s.consume(n,"insert"),s.consume(n,"attribute:listType"),s.consume(n,"attribute:listIndent"),s.consume(n,"attribute:todoListChecked");let l=r.writer,o=t7(n,r),a=!!n.getAttribute("todoListChecked"),u=eO(n,l,a,t),c=l.createContainerElement("span",{class:"todo-list__label__description"});l.addClass("todo-list",o.parent),l.insert(l.createPositionAt(o,0),u),l.insert(l.createPositionAfter(u),c),t9(n,o,r,d)}),{priority:"high"}),a.downcastDispatcher.on("attribute:listType:listItem",(e=t=>this._handleCheckmarkChange(t),i=a.view,(t,r,s)=>{if(!s.consumable.consume(r.item,t.name))return;let n=s.mapper.toViewElement(r.item),l=s.writer,o=function(t,e){for(let i of e.createRangeIn(t))if(i.item.is("uiElement","label"))return i.item}(n,i);if("todo"==r.attributeNewValue){let t=!!r.item.getAttribute("todoListChecked"),i=eO(r.item,l,t,e),s=l.createContainerElement("span",{class:"todo-list__label__description"}),o=l.createRangeIn(n),a=ee(n),u=t6(o.start),d=a?l.createPositionBefore(a):o.end,c=l.createRange(u,d);l.addClass("todo-list",n.parent),l.move(c,l.createPositionAt(s,0)),l.insert(l.createPositionAt(n,0),i),l.insert(l.createPositionAfter(i),s)}else if("todo"==r.attributeOldValue){let t=eR(n,i);l.removeClass("todo-list",n.parent),l.remove(o),l.move(l.createRangeIn(t),l.createPositionBefore(t)),l.remove(t)}})),a.downcastDispatcher.on("attribute:todoListChecked:listItem",(r=t=>this._handleCheckmarkChange(t),(t,e,i)=>{if("todo"!=e.item.getAttribute("listType")||!i.consumable.consume(e.item,"attribute:todoListChecked"))return;let{mapper:s,writer:n}=i,l=!!e.item.getAttribute("todoListChecked"),o=s.toViewElement(e.item).getChild(0),a=eO(e.item,n,l,r);
1n.insert(n.createPositionAfter(o),a),n.remove(o)})),a.mapper.on("modelToViewPosition",eN(a.view)),u.mapper.on("modelToViewPosition",eN(a.view)),this.listenTo(a.view.document,"arrowKey",(s=d,n=o.locale,(t,e)=>{if("left"!=(0,l.Kf)(e.keyCode,n.contentLanguageDirection))return;let i=s.schema,r=s.document.selection;if(!r.isCollapsed)return;let o=r.getFirstPosition(),a=o.parent;if("listItem"===a.name&&"todo"==a.getAttribute("listType")&&o.isAtStart){let r=i.getNearestSelectionRange(s.createPositionBefore(a),"backward");r&&s.change(t=>t.setSelection(r)),e.preventDefault(),e.stopPropagation(),t.stop()}}),{context:"li"}),this.listenTo(a.view.document,"keydown",(t,e)=>{(0,l.QC)(e)===eD&&(o.execute("checkTodoList"),t.stop())},{priority:"high"});let m=new Set;this.listenTo(d,"applyOperation",(t,e)=>{let i=e[0];if("rename"==i.type&&"listItem"==i.oldName){let t=i.position.nodeAfter;t.hasAttribute("todoListChecked")&&m.add(t)}else if("changeAttribute"==i.type&&"listType"==i.key&&"todo"===i.oldValue)for(let t of i.range.getItems())t.hasAttribute("todoListChecked")&&"todo"!==t.getAttribute("listType")&&m.add(t)}),d.document.registerPostFixer(t=>{let e=!1;for(let i of m)t.removeAttribute("todoListChecked",i),e=!0;return m.clear(),e}),this._initAriaAnnouncements()}_handleCheckmarkChange(t){let e=this.editor,i=e.model,r=Array.from(i.document.selection.getRanges());i.change(i=>{i.setSelection(t,"end"),e.execute("checkTodoList"),i.setSelection(r)})}_initAriaAnnouncements(){let{model:t,ui:e,t:i}=this.editor,r=null;e&&t.document.selection.on("change:range",()=>{let s=t.document.selection.focus.parent,n=eM(r),l=eM(s);n&&!l?e.ariaLiveAnnouncer.announce(i("Leaving a to-do list")):!n&&l&&e.ariaLiveAnnouncer.announce(i("Entering a to-do list")),r=s})}}function eM(t){return!!t&&t.is("element","listItem")&&"todo"===t.getAttribute("listType")}class ez extends r.k_{static get requires(){return[e$,t0]}static get pluginName(){return"LegacyTodoList"}static get isOfficialPlugin(){return!0}}class eq extends r.k_{static get pluginName(){return"AdjacentListsSupport"}static get isOfficialPlugin(){return!0}init(){let t=this.editor;t.model.schema.register("listSeparator",{allowWhere:"$block",isBlock:!0}),t.conversion.for("upcast").add(t=>{t.on("element:ol",ej()),t.on("element:ul",ej())}).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)=>{let i=e.writer.createContainerElement("ck-list-separator");return e.writer.setCustomProperty("dataPipeline:transparentRendering",!0,i),i.getFillerOffset=()=>null,i}})}}function ej(){return(t,e,i)=>{let r=e.viewItem,s=r.nextSibling;if(!s||r.name!==s.name)return;e.modelRange||Object.assign(e,i.convertChildren(e.viewItem,e.modelCursor));let n=i.writer,l=n.createElement("listSeparator");if(!i.safeInsert(l,e.modelCursor))return;let o=i.getSplitParts(l);e.modelRange=n.createRange(e.modelRange.start,n.createPositionAfter(o[o.length-1])),i.updateConversionResult(l,e)}}}}]);
2//# sourceMappingURL=9fe1a91f.0999c6054a1258c9.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.