@ckeditor/ckeditor5-html-support 45.2.1-alpha.3 → 45.2.1-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,4 +2,4 @@
2
2
  /*!
3
3
  * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
4
4
  * For licensing, see LICENSE.md.
5
- */(()=>{var e={21:e=>{"use strict";e.exports=function(e,t){Object.keys(t).forEach((function(i){e.setAttribute(i,t[i])}))}},51:e=>{"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},128:e=>{"use strict";var t={};e.exports=function(e,i){var r=function(e){if(void 0===t[e]){var i=document.querySelector(e);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(e){i=null}t[e]=i}return t[e]}(e);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(i)}},237:e=>{"use strict";e.exports=CKEditor5.dll},275:(e,t,i)=>{"use strict";i.d(t,{A:()=>s});var r=i(758),o=i.n(r),n=i(935),l=i.n(n)()(o());l.push([e.id,":root{--ck-html-object-embed-unfocused-outline-width:1px}.ck-widget.html-object-embed{background-color:var(--ck-color-base-foreground);font-size:var(--ck-font-size-base);min-width:calc(76px + var(--ck-spacing-standard));padding:var(--ck-spacing-small);padding-top:calc(var(--ck-font-size-tiny) + var(--ck-spacing-large))}.ck-widget.html-object-embed:not(.ck-widget_selected):not(:hover){outline:var(--ck-html-object-embed-unfocused-outline-width) dashed var(--ck-color-widget-blurred-border)}.ck-widget.html-object-embed:before{background:#999;border-radius:0 0 var(--ck-border-radius) var(--ck-border-radius);color:var(--ck-color-base-background);content:attr(data-html-object-embed-label);font-family:var(--ck-font-face);font-size:var(--ck-font-size-tiny);font-style:normal;font-weight:400;left:var(--ck-spacing-standard);padding:calc(var(--ck-spacing-tiny) + var(--ck-html-object-embed-unfocused-outline-width)) var(--ck-spacing-small) var(--ck-spacing-tiny);position:absolute;top:0;transition:background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve)}.ck-widget.html-object-embed .ck-widget__type-around .ck-widget__type-around__button.ck-widget__type-around__button_before{margin-left:50px}.ck-widget.html-object-embed .html-object-embed__content{pointer-events:none}div.ck-widget.html-object-embed{margin:1em auto}span.ck-widget.html-object-embed{display:inline-block}",""]);const s=l},507:(e,t,i)=>{e.exports=i(237)("./src/enter.js")},584:(e,t,i)=>{e.exports=i(237)("./src/utils.js")},591:e=>{"use strict";var t=[];function i(e){for(var i=-1,r=0;r<t.length;r++)if(t[r].identifier===e){i=r;break}return i}function r(e,r){for(var n={},l=[],s=0;s<e.length;s++){var a=e[s],m=r.base?a[0]+r.base:a[0],c=n[m]||0,u="".concat(m," ").concat(c);n[m]=c+1;var d=i(u),h={css:a[1],media:a[2],sourceMap:a[3],supports:a[4],layer:a[5]};if(-1!==d)t[d].references++,t[d].updater(h);else{var f=o(h,r);r.byIndex=s,t.splice(s,0,{identifier:u,updater:f,references:1})}l.push(u)}return l}function o(e,t){var i=t.domAPI(t);i.update(e);return function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;i.update(e=t)}else i.remove()}}e.exports=function(e,o){var n=r(e=e||[],o=o||{});return function(e){e=e||[];for(var l=0;l<n.length;l++){var s=i(n[l]);t[s].references--}for(var a=r(e,o),m=0;m<n.length;m++){var c=i(n[m]);0===t[c].references&&(t[c].updater(),t.splice(c,1))}n=a}}},639:e=>{"use strict";var t,i=(t=[],function(e,i){return t[e]=i,t.filter(Boolean).join("\n")});function r(e,t,r,o){var n;if(r)n="";else{n="",o.supports&&(n+="@supports (".concat(o.supports,") {")),o.media&&(n+="@media ".concat(o.media," {"));var l=void 0!==o.layer;l&&(n+="@layer".concat(o.layer.length>0?" ".concat(o.layer):""," {")),n+=o.css,l&&(n+="}"),o.media&&(n+="}"),o.supports&&(n+="}")}if(e.styleSheet)e.styleSheet.cssText=i(t,n);else{var s=document.createTextNode(n),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(s,a[t]):e.appendChild(s)}}var o={singleton:null,singletonCounter:0};e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=o.singletonCounter++,i=o.singleton||(o.singleton=e.insertStyleElement(e));return{update:function(e){r(i,t,!1,e)},remove:function(e){r(i,t,!0,e)}}}},758:e=>{"use strict";e.exports=function(e){return e[1]}},782:(e,t,i)=>{e.exports=i(237)("./src/core.js")},783:(e,t,i)=>{e.exports=i(237)("./src/engine.js")},901:(e,t,i)=>{e.exports=i(237)("./src/widget.js")},935:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var i="",r=void 0!==t[5];return t[4]&&(i+="@supports (".concat(t[4],") {")),t[2]&&(i+="@media ".concat(t[2]," {")),r&&(i+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),i+=e(t),r&&(i+="}"),t[2]&&(i+="}"),t[4]&&(i+="}"),i})).join("")},t.i=function(e,i,r,o,n){"string"==typeof e&&(e=[[null,e,void 0]]);var l={};if(r)for(var s=0;s<this.length;s++){var a=this[s][0];null!=a&&(l[a]=!0)}for(var m=0;m<e.length;m++){var c=[].concat(e[m]);r&&l[c[0]]||(void 0!==n&&(void 0===c[5]||(c[1]="@layer".concat(c[5].length>0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=n),i&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=i):c[2]=i),o&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=o):c[4]="".concat(o)),t.push(c))}},t}}},t={};function i(r){var o=t[r];if(void 0!==o)return o.exports;var n=t[r]={id:r,exports:{}};return e[r](n,n.exports,i),n.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{"use strict";i.r(r),i.d(r,{DataFilter:()=>pe,DataSchema:()=>oe,EmptyBlock:()=>Je,FullPage:()=>Xe,GeneralHtmlSupport:()=>We,HtmlComment:()=>Ke,HtmlPageDataProcessor:()=>Ge});var e=i(782),t=i(584),o=i(783),n=i(901);function l(e){return Object.getOwnPropertySymbols(e).filter((t=>Object.prototype.propertyIsEnumerable.call(e,t)))}function s(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const a="[object RegExp]",m="[object String]",c="[object Number]",u="[object Boolean]",d="[object Arguments]",h="[object Symbol]",f="[object Date]",g="[object Map]",b="[object Set]",p="[object Array]",w="[object ArrayBuffer]",A="[object Object]",y="[object DataView]",v="[object Uint8Array]",E="[object Uint8ClampedArray]",S="[object Uint16Array]",k="[object Uint32Array]",O="[object Int8Array]",C="[object Int16Array]",j="[object Int32Array]",P="[object Float32Array]",F="[object Float64Array]";function I(e){return null==e||"object"!=typeof e&&"function"!=typeof e}function $(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function _(e,t,i,r=new Map,o=void 0){const n=o?.(e,t,i,r);if(null!=n)return n;if(I(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){const t=new Array(e.length);r.set(e,t);for(let n=0;n<e.length;n++)t[n]=_(e[n],n,i,r,o);return Object.hasOwn(e,"index")&&(t.index=e.index),Object.hasOwn(e,"input")&&(t.input=e.input),t}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const t=new RegExp(e.source,e.flags);return t.lastIndex=e.lastIndex,t}if(e instanceof Map){const t=new Map;r.set(e,t);for(const[n,l]of e)t.set(n,_(l,n,i,r,o));return t}if(e instanceof Set){const t=new Set;r.set(e,t);for(const n of e)t.add(_(n,void 0,i,r,o));return t}if("undefined"!=typeof Buffer&&Buffer.isBuffer(e))return e.subarray();if($(e)){const t=new(Object.getPrototypeOf(e).constructor)(e.length);r.set(e,t);for(let n=0;n<e.length;n++)t[n]=_(e[n],n,i,r,o);return t}if(e instanceof ArrayBuffer||"undefined"!=typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){const t=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return r.set(e,t),B(t,e,i,r,o),t}if("undefined"!=typeof File&&e instanceof File){const t=new File([e],e.name,{type:e.type});return r.set(e,t),B(t,e,i,r,o),t}if(e instanceof Blob){const t=new Blob([e],{type:e.type});return r.set(e,t),B(t,e,i,r,o),t}if(e instanceof Error){const t=new e.constructor;return r.set(e,t),t.message=e.message,t.name=e.name,t.stack=e.stack,t.cause=e.cause,B(t,e,i,r,o),t}if("object"==typeof e&&function(e){switch(s(e)){case d:case p:case w:case y:case u:case f:case P:case F:case O:case C:case j:case g:case c:case A:case a:case b:case m:case h:case v:case E:case S:case k:return!0;default:return!1}}(e)){const t=Object.create(Object.getPrototypeOf(e));return r.set(e,t),B(t,e,i,r,o),t}return e}function B(e,t,i=e,r,o){const n=[...Object.keys(t),...l(t)];for(let l=0;l<n.length;l++){const s=n[l],a=Object.getOwnPropertyDescriptor(e,s);(null==a||a.writable)&&(e[s]=_(t[s],s,i,r,o))}}function x(e,t){return function(e,t){return _(e,void 0,e,new Map,t)}(e,((i,r,o,n)=>{const l=t?.(i,r,o,n);if(null!=l)return l;if("object"==typeof e)switch(Object.prototype.toString.call(e)){case c:case m:case u:{const t=new e.constructor(e?.valueOf());return B(t,e),t}case d:{const t={};return B(t,e),t.length=e.length,t[Symbol.iterator]=e[Symbol.iterator],t}default:return}}))}function T(e){return x(e)}const D=/\p{Lu}?\p{Ll}+|[0-9]+|\p{Lu}+(?!\p{Ll})|\p{Emoji_Presentation}|\p{Extended_Pictographic}|\p{L}+/gu;function R(e){if(null==e)return"";if(Array.isArray(e))return e.map(R).join(",");const t=String(e);return"0"===t&&Object.is(Number(e),-0)?"-0":t}function N(e){const t=function(e){return Array.from(e.match(D)??[])}(function(e){return"string"!=typeof e&&(e=R(e)),e.replace(/['\u2019]/g,"")}(e).trim());let i="";for(let e=0;e<t.length;e++){const r=t[e];i&&(i+=" "),r===r.toUpperCase()?i+=r:i+=r[0].toUpperCase()+r.slice(1).toLowerCase()}return i}function H(e,t,i,r){t&&function(e,t,i){if(t.attributes)for(const[r]of Object.entries(t.attributes))e.removeAttribute(r,i);if(t.styles)for(const r of Object.keys(t.styles))e.removeStyle(r,i);t.classes&&e.removeClass(t.classes,i)}(e,t,r),i&&V(e,i,r)}function V(e,t,i){if(t.attributes)for(const[r,o]of Object.entries(t.attributes))e.setAttribute(r,o,i);t.styles&&e.setStyle(t.styles,i),t.classes&&e.addClass(t.classes,i)}function L(e,t,i,r,o){const n=t.getAttribute(i),l={};for(const e of["attributes","styles","classes"]){if(e!=r){n&&n[e]&&(l[e]=n[e]);continue}if("classes"==r){const t=new Set(n&&n.classes||[]);o(t),t.size&&(l[e]=Array.from(t));continue}const t=new Map(Object.entries(n&&n[e]||{}));o(t),t.size&&(l[e]=Object.fromEntries(t))}Object.keys(l).length?t.is("documentSelection")?e.setSelectionAttribute(i,l):e.setAttribute(i,l,t):n&&(t.is("documentSelection")?e.removeSelectionAttribute(i):e.removeAttribute(i,t))}function M(e){return`html${t=e,N(t).replace(/ /g,"")}Attributes`;var t}function U({model:e}){return(t,i)=>i.writer.createElement(e,{htmlContent:t.getCustomProperty("$rawContent")})}function z(e,{view:t,isInline:i}){const r=e.t;return(e,{writer:o})=>{const l=r("HTML object"),s=W(t,e,o),a=e.getAttribute(M(t));o.addClass("html-object-embed__content",s),a&&V(o,a,s);const m=o.createContainerElement(i?"span":"div",{class:"html-object-embed","data-html-object-embed-label":l},s);return(0,n.toWidget)(m,o,{label:l})}}function W(e,t,i){return i.createRawElement(e,null,((e,i)=>{i.setContentOf(e,t.getAttribute("htmlContent"))}))}function q({view:e,model:t,allowEmpty:i},r){return t=>{t.on(`element:${e}`,((e,t,n)=>{let l=r.processViewAttributes(t.viewItem,n);if(l||n.consumable.test(t.viewItem,{name:!0})){if(l=l||{},n.consumable.consume(t.viewItem,{name:!0}),t.modelRange||(t=Object.assign(t,n.convertChildren(t.viewItem,t.modelCursor))),i&&t.modelRange.isCollapsed&&Object.keys(l).length){const e=n.writer.createElement("htmlEmptyElement");if(!n.safeInsert(e,t.modelCursor))return;const i=n.getSplitParts(e);return t.modelRange=n.writer.createRange(t.modelRange.start,n.writer.createPositionAfter(i[i.length-1])),n.updateConversionResult(e,t),void o(e,l,n)}for(const e of t.modelRange.getItems())o(e,l,n)}}),{priority:"low"})};function o(e,i,r){if(r.schema.checkAttribute(e,t)){const o=function(e,t){const i=T(e);let r="attributes";for(r in t)i[r]="classes"==r?Array.from(new Set([...e[r]||[],...t[r]])):{...e[r],...t[r]};return i}(i,e.getAttribute(t)||{});r.writer.setAttribute(t,o,e)}}}function K({model:e,view:t},i){return(r,{writer:o,consumable:l})=>{if(!r.hasAttribute(e))return null;const s=o.createContainerElement(t),a=r.getAttribute(e);return l.consume(r,`attribute:${e}`),V(o,a,s),s.getFillerOffset=()=>null,i?(0,n.toWidget)(s,o):s}}function G({priority:e,view:t}){return(i,r)=>{if(!i)return;const{writer:o}=r,n=o.createAttributeElement(t,null,{priority:e});return V(o,i,n),n}}function X({view:e},t){return i=>{i.on(`element:${e}`,((e,i,r)=>{if(!i.modelRange||i.modelRange.isCollapsed)return;const o=t.processViewAttributes(i.viewItem,r);o&&r.writer.setAttribute(M(i.viewItem.name),o,i.modelRange)}),{priority:"low"})}}function Q({view:e,model:t}){return i=>{i.on(`attribute:${M(e)}:${t}`,((e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const{attributeOldValue:r,attributeNewValue:o}=t;H(i.writer,r,o,i.mapper.toViewElement(t.item))}))}}const Y=[{model:"codeBlock",view:"pre"},{model:"paragraph",view:"p"},{model:"blockQuote",view:"blockquote"},{model:"listItem",view:"li"},{model:"pageBreak",view:"div"},{model:"rawHtml",view:"div"},{model:"table",view:"table"},{model:"tableRow",view:"tr"},{model:"tableCell",view:"td"},{model:"tableCell",view:"th"},{model:"tableColumnGroup",view:"colgroup"},{model:"tableColumn",view:"col"},{model:"caption",view:"caption"},{model:"caption",view:"figcaption"},{model:"imageBlock",view:"img"},{model:"imageInline",view:"img"},{model:"horizontalLine",view:"hr"},{model:"htmlP",view:"p",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlBlockquote",view:"blockquote",modelSchema:{inheritAllFrom:"$container"}},{model:"htmlTable",view:"table",modelSchema:{allowWhere:"$block",isBlock:!0}},{model:"htmlTbody",view:"tbody",modelSchema:{allowIn:"htmlTable",isBlock:!1}},{model:"htmlThead",view:"thead",modelSchema:{allowIn:"htmlTable",isBlock:!1}},{model:"htmlTfoot",view:"tfoot",modelSchema:{allowIn:"htmlTable",isBlock:!1}},{model:"htmlCaption",view:"caption",modelSchema:{allowIn:"htmlTable",allowChildren:"$text",isBlock:!1}},{model:"htmlColgroup",view:"colgroup",modelSchema:{allowIn:"htmlTable",allowChildren:"col",isBlock:!1}},{model:"htmlCol",view:"col",modelSchema:{allowIn:"htmlColgroup",isBlock:!1}},{model:"htmlTr",view:"tr",modelSchema:{allowIn:["htmlTable","htmlThead","htmlTbody"],isLimit:!0}},{model:"htmlTd",view:"td",modelSchema:{allowIn:"htmlTr",allowContentOf:"$container",isLimit:!0,isBlock:!1}},{model:"htmlTh",view:"th",modelSchema:{allowIn:"htmlTr",allowContentOf:"$container",isLimit:!0,isBlock:!1}},{model:"htmlFigure",view:"figure",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlFigcaption",view:"figcaption",modelSchema:{allowIn:"htmlFigure",allowChildren:"$text",isBlock:!1}},{model:"htmlAddress",view:"address",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlAside",view:"aside",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlMain",view:"main",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlDetails",view:"details",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlSummary",view:"summary",modelSchema:{allowChildren:["htmlH1","htmlH2","htmlH3","htmlH4","htmlH5","htmlH6","$text"],allowIn:"htmlDetails",isBlock:!1}},{model:"htmlDiv",view:"div",paragraphLikeModel:"htmlDivParagraph",modelSchema:{inheritAllFrom:"$container"}},{model:"htmlFieldset",view:"fieldset",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlLegend",view:"legend",modelSchema:{allowIn:"htmlFieldset",allowChildren:"$text"}},{model:"htmlHeader",view:"header",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlFooter",view:"footer",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlForm",view:"form",modelSchema:{inheritAllFrom:"$container",isBlock:!0}},{model:"htmlHgroup",view:"hgroup",modelSchema:{allowIn:["$root","$container"],allowChildren:["paragraph","htmlP","htmlH1","htmlH2","htmlH3","htmlH4","htmlH5","htmlH6"],isBlock:!1}},{model:"htmlH1",view:"h1",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH2",view:"h2",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH3",view:"h3",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH4",view:"h4",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH5",view:"h5",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH6",view:"h6",modelSchema:{inheritAllFrom:"$block"}},{model:"$htmlList",modelSchema:{allowWhere:"$container",allowChildren:["$htmlList","htmlLi"],isBlock:!1}},{model:"htmlDir",view:"dir",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlMenu",view:"menu",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlUl",view:"ul",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlOl",view:"ol",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlLi",view:"li",modelSchema:{allowIn:"$htmlList",allowChildren:"$text",isBlock:!1}},{model:"htmlPre",view:"pre",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlArticle",view:"article",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlSection",view:"section",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlNav",view:"nav",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlDivDl",view:"div",modelSchema:{allowChildren:["htmlDt","htmlDd"],allowIn:"htmlDl"}},{model:"htmlDl",view:"dl",modelSchema:{allowWhere:"$container",allowChildren:["htmlDt","htmlDd","htmlDivDl"],isBlock:!1}},{model:"htmlDt",view:"dt",modelSchema:{allowChildren:"$block",isBlock:!1}},{model:"htmlDd",view:"dd",modelSchema:{allowChildren:"$block",isBlock:!1}},{model:"htmlCenter",view:"center",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlHr",view:"hr",isEmpty:!0,modelSchema:{inheritAllFrom:"$blockObject"}}],J=[{model:"htmlLiAttributes",view:"li",appliesToBlock:!0,coupledAttribute:"listItemId"},{model:"htmlOlAttributes",view:"ol",appliesToBlock:!0,coupledAttribute:"listItemId"},{model:"htmlUlAttributes",view:"ul",appliesToBlock:!0,coupledAttribute:"listItemId"},{model:"htmlFigureAttributes",view:"figure",appliesToBlock:"table"},{model:"htmlTheadAttributes",view:"thead",appliesToBlock:"table"},{model:"htmlTbodyAttributes",view:"tbody",appliesToBlock:"table"},{model:"htmlFigureAttributes",view:"figure",appliesToBlock:"imageBlock"},{model:"htmlAcronym",view:"acronym",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlTt",view:"tt",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlFont",view:"font",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlTime",view:"time",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlVar",view:"var",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlBig",view:"big",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSmall",view:"small",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSamp",view:"samp",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlQ",view:"q",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlOutput",view:"output",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlKbd",view:"kbd",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlBdi",view:"bdi",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlBdo",view:"bdo",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlAbbr",view:"abbr",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlA",view:"a",priority:5,coupledAttribute:"linkHref"},{model:"htmlStrong",view:"strong",coupledAttribute:"bold",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlB",view:"b",coupledAttribute:"bold",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlI",view:"i",coupledAttribute:"italic",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlEm",view:"em",coupledAttribute:"italic",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlS",view:"s",coupledAttribute:"strikethrough",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlDel",view:"del",coupledAttribute:"strikethrough",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlIns",view:"ins",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlU",view:"u",coupledAttribute:"underline",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSub",view:"sub",coupledAttribute:"subscript",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSup",view:"sup",coupledAttribute:"superscript",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlCode",view:"code",coupledAttribute:"code",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlMark",view:"mark",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSpan",view:"span",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlCite",view:"cite",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlLabel",view:"label",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlDfn",view:"dfn",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlObject",view:"object",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlIframe",view:"iframe",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlInput",view:"input",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlButton",view:"button",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlTextarea",view:"textarea",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlSelect",view:"select",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlVideo",view:"video",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlEmbed",view:"embed",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlOembed",view:"oembed",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlAudio",view:"audio",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlImg",view:"img",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlCanvas",view:"canvas",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlMeter",view:"meter",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlProgress",view:"progress",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlScript",view:"script",modelSchema:{allowWhere:["$text","$block"],isInline:!0}},{model:"htmlStyle",view:"style",modelSchema:{allowWhere:["$text","$block"],isInline:!0}},{model:"htmlCustomElement",view:"$customElement",modelSchema:{allowWhere:["$text","$block"],allowAttributesOf:"$inlineObject",isInline:!0}}];function Z(e){return null!==e&&"object"==typeof e&&"[object Arguments]"===s(e)}function ee(e){return"object"==typeof e&&null!==e}function te(e){if("object"!=typeof e)return!1;if(null==e)return!1;if(null===Object.getPrototypeOf(e))return!0;if("[object Object]"!==Object.prototype.toString.call(e)){const t=e[Symbol.toStringTag];if(null==t)return!1;return!!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable&&e.toString()===`[object ${t}]`}let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function ie(e,...t){const i=t.slice(0,-1),r=t[t.length-1];let o=e;for(let e=0;e<i.length;e++){o=re(o,i[e],r,new Map)}return o}function re(e,t,i,r){if(I(e)&&(e=Object(e)),null==t||"object"!=typeof t)return e;if(r.has(t))return function(e){if(I(e))return e;if(Array.isArray(e)||$(e)||e instanceof ArrayBuffer||"undefined"!=typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer)return e.slice(0);const t=Object.getPrototypeOf(e),i=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new i(e);if(e instanceof RegExp){const t=new i(e);return t.lastIndex=e.lastIndex,t}if(e instanceof DataView)return new i(e.buffer.slice(0));if(e instanceof Error){const t=new i(e.message);return t.stack=e.stack,t.name=e.name,t.cause=e.cause,t}if("undefined"!=typeof File&&e instanceof File)return new i([e],e.name,{type:e.type,lastModified:e.lastModified});if("object"==typeof e){const i=Object.create(t);return Object.assign(i,e)}return e}(r.get(t));if(r.set(t,e),Array.isArray(t)){t=t.slice();for(let e=0;e<t.length;e++)t[e]=t[e]??void 0}const o=[...Object.keys(t),...l(t)];for(let n=0;n<o.length;n++){const l=o[n];let s=t[l],a=e[l];if(Z(s)&&(s={...s}),Z(a)&&(a={...a}),"undefined"!=typeof Buffer&&Buffer.isBuffer(s)&&(s=T(s)),Array.isArray(s))if("object"==typeof a&&null!=a){const e=[],t=Reflect.ownKeys(a);for(let i=0;i<t.length;i++){const r=t[i];e[r]=a[r]}a=e}else a=[];const m=i(a,s,l,e,t,r);null!=m?e[l]=m:Array.isArray(s)||ee(a)&&ee(s)?e[l]=re(a,s,i,r):null==a&&te(s)?e[l]=re({},s,i,r):null==a&&$(s)?e[l]=T(s):void 0!==a&&void 0===s||(e[l]=s)}return e}class oe extends e.Plugin{_definitions=[];static get pluginName(){return"DataSchema"}static get isOfficialPlugin(){return!0}init(){for(const e of Y)this.registerBlockElement(e);for(const e of J)this.registerInlineElement(e)}registerBlockElement(e){this._definitions.push({...e,isBlock:!0})}registerInlineElement(e){this._definitions.push({...e,isInline:!0})}extendBlockElement(e){this._extendDefinition({...e,isBlock:!0})}extendInlineElement(e){this._extendDefinition({...e,isInline:!0})}getDefinitionsForView(e,t=!1){const i=new Set;for(const r of this._getMatchingViewDefinitions(e)){if(t)for(const e of this._getReferences(r.model))i.add(e);i.add(r)}return i}getDefinitionsForModel(e){return this._definitions.filter((t=>t.model==e))}_getMatchingViewDefinitions(e){return this._definitions.filter((t=>t.view&&function(e,t){if("string"==typeof e)return e===t;if(e instanceof RegExp)return e.test(t);return!1}(e,t.view)))}*_getReferences(e){const i=["inheritAllFrom","inheritTypesFrom","allowWhere","allowContentOf","allowAttributesOf"],r=this._definitions.filter((t=>t.model==e));for(const{modelSchema:o}of r)if(o)for(const r of i)for(const i of(0,t.toArray)(o[r]||[])){const t=this._definitions.filter((e=>e.model==i));for(const r of t)i!==e&&(yield*this._getReferences(r.model),yield r)}}_extendDefinition(e){const t=Array.from(this._definitions.entries()).filter((([,t])=>t.model==e.model));if(0!=t.length)for(const[i,r]of t)this._definitions[i]=ie({},r,e,((e,t)=>Array.isArray(e)?e.concat(t):void 0));else this._definitions.push(e)}}var ne=i(591),le=i.n(ne),se=i(639),ae=i.n(se),me=i(128),ce=i.n(me),ue=i(21),de=i.n(ue),he=i(51),fe=i.n(he),ge=i(275),be={attributes:{"data-cke":!0}};be.setAttributes=de(),be.insert=ce().bind(null,"head"),be.domAPI=ae(),be.insertStyleElement=fe();le()(ge.A,be);ge.A&&ge.A.locals&&ge.A.locals;class pe extends e.Plugin{_dataSchema;_allowedAttributes;_disallowedAttributes;_allowedElements;_disallowedElements;_dataInitialized;_coupledAttributes;constructor(e){super(e),this._dataSchema=e.plugins.get("DataSchema"),this._allowedAttributes=new o.Matcher,this._disallowedAttributes=new o.Matcher,this._allowedElements=new Set,this._disallowedElements=new Set,this._dataInitialized=!1,this._coupledAttributes=null,this._registerElementsAfterInit(),this._registerElementHandlers(),this._registerCoupledAttributesPostFixer(),this._registerAssociatedHtmlAttributesPostFixer()}static get pluginName(){return"DataFilter"}static get isOfficialPlugin(){return!0}static get requires(){return[oe,n.Widget]}loadAllowedConfig(e){for(const t of e){const e=t.name||/[\s\S]+/,i=Ee(t);this.allowElement(e),i.forEach((e=>this.allowAttributes(e)))}}loadDisallowedConfig(e){for(const t of e){const e=t.name||/[\s\S]+/,i=Ee(t);0==i.length?this.disallowElement(e):i.forEach((e=>this.disallowAttributes(e)))}}loadAllowedEmptyElementsConfig(e){for(const t of e)this.allowEmptyElement(t)}allowElement(e){for(const t of this._dataSchema.getDefinitionsForView(e,!0))this._addAllowedElement(t),this._coupledAttributes=null}disallowElement(e){for(const t of this._dataSchema.getDefinitionsForView(e,!1))this._disallowedElements.add(t.view)}allowEmptyElement(e){for(const t of this._dataSchema.getDefinitionsForView(e,!0))t.isInline&&this._dataSchema.extendInlineElement({...t,allowEmpty:!0})}allowAttributes(e){this._allowedAttributes.add(e)}disallowAttributes(e){this._disallowedAttributes.add(e)}processViewAttributes(e,t){const{consumable:i}=t;return we(e,this._disallowedAttributes,i),function(e,{attributes:t,classes:i,styles:r}){if(!t.length&&!i.length&&!r.length)return null;return{...t.length&&{attributes:Ae(e,t)},...r.length&&{styles:ye(e,r)},...i.length&&{classes:i}}}(e,we(e,this._allowedAttributes,i))}_addAllowedElement(e){if(!this._allowedElements.has(e)){if(this._allowedElements.add(e),"appliesToBlock"in e&&"string"==typeof e.appliesToBlock)for(const t of this._dataSchema.getDefinitionsForModel(e.appliesToBlock))t.isBlock&&this._addAllowedElement(t);this._dataInitialized&&this.editor.data.once("set",(()=>{this._fireRegisterEvent(e)}),{priority:t.priorities.highest+1})}}_registerElementsAfterInit(){this.editor.data.on("init",(()=>{this._dataInitialized=!0;for(const e of this._allowedElements)this._fireRegisterEvent(e)}),{priority:t.priorities.highest+1})}_registerElementHandlers(){this.on("register",((e,i)=>{const r=this.editor.model.schema;if(i.isObject&&!r.isRegistered(i.model))this._registerObjectElement(i);else if(i.isBlock)this._registerBlockElement(i);else{if(!i.isInline)throw new t.CKEditorError("data-filter-invalid-definition",null,i);this._registerInlineElement(i)}e.stop()}),{priority:"lowest"})}_registerCoupledAttributesPostFixer(){const e=this.editor.model,t=e.document.selection;e.document.registerPostFixer((t=>{const i=e.document.differ.getChanges();let r=!1;const o=this._getCoupledAttributesMap();for(const e of i){if("attribute"!=e.type||null!==e.attributeNewValue)continue;const i=o.get(e.attributeKey);if(i)for(const{item:o}of e.range.getWalker())for(const e of i)o.hasAttribute(e)&&(t.removeAttribute(e,o),r=!0)}return r})),this.listenTo(t,"change:attribute",((i,{attributeKeys:r})=>{const o=new Set,n=this._getCoupledAttributesMap();for(const e of r){if(t.hasAttribute(e))continue;const i=n.get(e);if(i)for(const e of i)t.hasAttribute(e)&&o.add(e)}0!=o.size&&e.change((e=>{for(const t of o)e.removeSelectionAttribute(t)}))}))}_registerAssociatedHtmlAttributesPostFixer(){const e=this.editor.model;e.document.registerPostFixer((t=>{const i=e.document.differ.getChanges();let r=!1;for(const o of i)if("insert"===o.type&&"$text"!==o.name)for(const i of o.attributes.keys())i.startsWith("html")&&i.endsWith("Attributes")&&(e.schema.checkAttribute(o.name,i)||(t.removeAttribute(i,o.position.nodeAfter),r=!0));return r}))}_getCoupledAttributesMap(){if(this._coupledAttributes)return this._coupledAttributes;this._coupledAttributes=new Map;for(const e of this._allowedElements)if(e.coupledAttribute&&e.model){const t=this._coupledAttributes.get(e.coupledAttribute);t?t.push(e.model):this._coupledAttributes.set(e.coupledAttribute,[e.model])}return this._coupledAttributes}_fireRegisterEvent(e){e.view&&this._disallowedElements.has(e.view)||this.fire(e.view?`register:${e.view}`:"register",e)}_registerObjectElement(e){const i=this.editor,r=i.model.schema,o=i.conversion,{view:n,model:l}=e;r.register(l,e.modelSchema),n&&(r.extend(e.model,{allowAttributes:[M(n),"htmlContent"]}),i.data.registerRawContentMatcher({name:n}),o.for("upcast").elementToElement({view:n,model:U(e),converterPriority:t.priorities.low+2}),o.for("upcast").add(X(e,this)),o.for("editingDowncast").elementToStructure({model:{name:l,attributes:[M(n)]},view:z(i,e)}),o.for("dataDowncast").elementToElement({model:l,view:(e,{writer:t})=>W(n,e,t)}),o.for("dataDowncast").add(Q(e)))}_registerBlockElement(e){const i=this.editor,r=i.model.schema,o=i.conversion,{view:n,model:l}=e;if(!r.isRegistered(e.model)){if(!e.modelSchema)return;if(r.register(e.model,e.modelSchema),!n)return;o.for("upcast").elementToElement({model:l,view:n,converterPriority:t.priorities.low+2}),o.for("downcast").elementToElement({model:l,view:(t,{writer:i})=>e.isEmpty?i.createEmptyElement(n):i.createContainerElement(n)})}n&&(r.extend(e.model,{allowAttributes:M(n)}),o.for("upcast").add(X(e,this)),o.for("downcast").add(Q(e)))}_registerInlineElement(e){const t=this.editor,i=t.model.schema,r=t.conversion,o=e.model;if(!e.appliesToBlock&&(i.extend("$text",{allowAttributes:o}),e.attributeProperties&&i.setAttributeProperties(o,e.attributeProperties),r.for("upcast").add(q(e,this)),r.for("downcast").attributeToElement({model:o,view:G(e)}),e.allowEmpty)){if(i.setAttributeProperties(o,{copyFromObject:!1}),!i.isRegistered("htmlEmptyElement")){i.register("htmlEmptyElement",{inheritAllFrom:"$inlineObject"});const e=e=>Array.from(e.getAttributeKeys()).some((e=>e.startsWith("html")));t.model.document.registerPostFixer((i=>{const r=t.model.document.differ.getChanges(),o=new Set;for(const t of r)if("remove"!==t.type){if("attribute"===t.type&&null===t.attributeNewValue)for(const{item:i}of t.range)i.is("element","htmlEmptyElement")&&!e(i)&&o.add(i);if("insert"===t.type&&t.position.nodeAfter){const r=t.position.nodeAfter;for(const{item:t}of i.createRangeOn(r))t.is("element","htmlEmptyElement")&&!e(t)&&o.add(t)}}for(const e of o)i.remove(e);return o.size>0}))}t.data.htmlProcessor.domConverter.registerInlineObjectMatcher((t=>t.name==e.view&&t.isEmpty&&Array.from(t.getAttributeKeys()).length?{name:!0}:null)),r.for("editingDowncast").elementToElement({model:"htmlEmptyElement",view:K(e,!0)}),r.for("dataDowncast").elementToElement({model:"htmlEmptyElement",view:K(e)})}}}function we(e,t,i){const r=t.matchAll(e)||[],o=e.document.stylesProcessor;return r.reduce(((t,{match:r})=>{for(const[n,l]of r.attributes||[])if("style"==n){const r=l,n=o.getRelatedStyles(r).filter((e=>e.split("-").length>r.split("-").length)).sort(((e,t)=>t.split("-").length-e.split("-").length));for(const r of n)i.consume(e,{styles:[r]})&&t.styles.push(r);i.consume(e,{styles:[r]})&&t.styles.push(r)}else if("class"==n){const r=l;i.consume(e,{classes:[r]})&&t.classes.push(r)}else i.consume(e,{attributes:[n]})&&t.attributes.push(n);return t}),{attributes:[],classes:[],styles:[]})}function Ae(e,i){const r={};for(const o of i){const i=e.getAttribute(o);void 0!==i&&(0,t.isValidAttributeName)(o)&&(r[o]=i)}return r}function ye(e,t){const i=new o.StylesMap(e.document.stylesProcessor);for(const r of t){const t=e.getStyle(r);void 0!==t&&i.set(r,t)}return Object.fromEntries(i.getStylesEntries())}function ve(e,t){const{name:i}=e,r=e[t];return te(r)?Object.entries(r).map((([e,r])=>({name:i,[t]:{[e]:r}}))):Array.isArray(r)?r.map((e=>({name:i,[t]:[e]}))):[e]}function Ee(e){const{name:t,attributes:i,classes:r,styles:o}=e,n=[];return i&&n.push(...ve({name:t,attributes:i},"attributes")),r&&n.push(...ve({name:t,classes:r},"classes")),o&&n.push(...ve({name:t,styles:o},"styles")),n}class Se extends e.Plugin{static get requires(){return[pe]}static get pluginName(){return"CodeBlockElementSupport"}static get isOfficialPlugin(){return!0}init(){if(!this.editor.plugins.has("CodeBlockEditing"))return;const e=this.editor.plugins.get(pe);e.on("register:pre",((t,i)=>{if("codeBlock"!==i.model)return;const r=this.editor,o=r.model.schema,n=r.conversion;o.extend("codeBlock",{allowAttributes:["htmlPreAttributes","htmlContentAttributes"]}),n.for("upcast").add(function(e){return t=>{t.on("element:code",((t,i,r)=>{const o=i.viewItem,n=o.parent;function l(t,o){const n=e.processViewAttributes(t,r);n&&r.writer.setAttribute(o,n,i.modelRange)}n&&n.is("element","pre")&&(l(n,"htmlPreAttributes"),l(o,"htmlContentAttributes"))}),{priority:"low"})}}(e)),n.for("downcast").add((e=>{e.on("attribute:htmlPreAttributes:codeBlock",((e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const{attributeOldValue:r,attributeNewValue:o}=t,n=i.mapper.toViewElement(t.item).parent;H(i.writer,r,o,n)})),e.on("attribute:htmlContentAttributes:codeBlock",((e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const{attributeOldValue:r,attributeNewValue:o}=t,n=i.mapper.toViewElement(t.item);H(i.writer,r,o,n)}))})),t.stop()}))}}class ke extends e.Plugin{static get requires(){return[pe]}static get pluginName(){return"DualContentModelElementSupport"}static get isOfficialPlugin(){return!0}init(){this.editor.plugins.get(pe).on("register",((e,i)=>{const r=i,o=this.editor,n=o.model.schema,l=o.conversion;if(!r.paragraphLikeModel)return;if(n.isRegistered(r.model)||n.isRegistered(r.paragraphLikeModel))return;const s={model:r.paragraphLikeModel,view:r.view};n.register(r.model,r.modelSchema),n.register(s.model,{inheritAllFrom:"$block"}),l.for("upcast").elementToElement({view:r.view,model:(e,{writer:t})=>this._hasBlockContent(e)?t.createElement(r.model):t.createElement(s.model),converterPriority:t.priorities.low+.5}),l.for("downcast").elementToElement({view:r.view,model:r.model}),this._addAttributeConversion(r),l.for("downcast").elementToElement({view:s.view,model:s.model}),this._addAttributeConversion(s),e.stop()}))}_hasBlockContent(e){const t=this.editor.editing.view,i=t.domConverter.blockElements;for(const r of t.createRangeIn(e).getItems())if(r.is("element")&&i.includes(r.name))return!0;return!1}_addAttributeConversion(e){const t=this.editor,i=t.conversion,r=t.plugins.get(pe);t.model.schema.extend(e.model,{allowAttributes:M(e.view)}),i.for("upcast").add(X(e,r)),i.for("downcast").add(Q(e))}}var Oe=i(507);class Ce extends e.Plugin{static get requires(){return[oe,Oe.Enter]}static get pluginName(){return"HeadingElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(!e.plugins.has("HeadingEditing"))return;const t=e.config.get("heading.options");this.registerHeadingElements(e,t)}registerHeadingElements(e,t){const i=e.plugins.get(oe),r=[];for(const e of t)"model"in e&&"view"in e&&(i.registerBlockElement({view:e.view,model:e.model}),r.push(e.model));i.extendBlockElement({model:"htmlHgroup",modelSchema:{allowChildren:r}}),i.extendBlockElement({model:"htmlSummary",modelSchema:{allowChildren:r}})}}function je(e,t,i){const r=e.createRangeOn(t);for(const{item:e}of r.getWalker())if(e.is("element",i))return e}class Pe extends e.Plugin{static get requires(){return[pe]}static get pluginName(){return"ImageElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(!e.plugins.has("ImageInlineEditing")&&!e.plugins.has("ImageBlockEditing"))return;const t=e.model.schema,i=e.conversion,r=e.plugins.get(pe);r.on("register:figure",(()=>{i.for("upcast").add(function(e){return t=>{t.on("element:figure",((t,i,r)=>{const o=i.viewItem;if(!i.modelRange||!o.hasClass("image"))return;const n=e.processViewAttributes(o,r);n&&r.writer.setAttribute("htmlFigureAttributes",n,i.modelRange)}),{priority:"low"})}}(r))})),r.on("register:img",((o,n)=>{"imageBlock"!==n.model&&"imageInline"!==n.model||(t.isRegistered("imageBlock")&&t.extend("imageBlock",{allowAttributes:["htmlImgAttributes","htmlFigureAttributes","htmlLinkAttributes"]}),t.isRegistered("imageInline")&&t.extend("imageInline",{allowAttributes:["htmlA","htmlImgAttributes"]}),i.for("upcast").add(function(e){return t=>{t.on("element:img",((t,i,r)=>{if(!i.modelRange)return;const o=i.viewItem,n=e.processViewAttributes(o,r);n&&r.writer.setAttribute("htmlImgAttributes",n,i.modelRange)}),{priority:"low"})}}(r)),i.for("downcast").add((e=>{function t(t){e.on(`attribute:${t}:imageInline`,((e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const{attributeOldValue:r,attributeNewValue:o}=t,n=i.mapper.toViewElement(t.item);H(i.writer,r,o,n)}),{priority:"low"})}function i(t,i){e.on(`attribute:${i}:imageBlock`,((e,i,r)=>{if(!r.consumable.test(i.item,e.name))return;const{attributeOldValue:o,attributeNewValue:n}=i,l=r.mapper.toViewElement(i.item),s=je(r.writer,l,t);s&&(H(r.writer,o,n,s),r.consumable.consume(i.item,e.name))}),{priority:"low"}),"a"===t&&e.on("attribute:linkHref:imageBlock",((e,t,i)=>{if(!i.consumable.consume(t.item,"attribute:htmlLinkAttributes:imageBlock"))return;const r=i.mapper.toViewElement(t.item),o=je(i.writer,r,"a");V(i.writer,t.item.getAttribute("htmlLinkAttributes"),o)}),{priority:"low"})}t("htmlImgAttributes"),i("img","htmlImgAttributes"),i("figure","htmlFigureAttributes"),i("a","htmlLinkAttributes")})),e.plugins.has("LinkImage")&&i.for("upcast").add(function(e,t){const i=t.plugins.get("ImageUtils");return t=>{t.on("element:a",((t,r,o)=>{const n=r.viewItem;if(!i.findViewImgElement(n))return;const l=r.modelCursor.parent;if(!l.is("element","imageBlock"))return;const s=e.processViewAttributes(n,o);s&&o.writer.setAttribute("htmlLinkAttributes",s,l)}),{priority:"low"})}}(r,e)),o.stop())}))}}class Fe extends e.Plugin{static get requires(){return[pe]}static get pluginName(){return"MediaEmbedElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(!e.plugins.has("MediaEmbed")||e.config.get("mediaEmbed.previewsInData"))return;const t=e.model.schema,i=e.conversion,r=this.editor.plugins.get(pe),o=this.editor.plugins.get(oe),n=e.config.get("mediaEmbed.elementName");o.registerBlockElement({model:"media",view:n}),r.on("register:figure",(()=>{i.for("upcast").add(function(e){return t=>{t.on("element:figure",((t,i,r)=>{const o=i.viewItem;if(!i.modelRange||!o.hasClass("media"))return;const n=e.processViewAttributes(o,r);n&&r.writer.setAttribute("htmlFigureAttributes",n,i.modelRange)}),{priority:"low"})}}(r))})),r.on(`register:${n}`,((e,o)=>{"media"===o.model&&(t.extend("media",{allowAttributes:[M(n),"htmlFigureAttributes"]}),i.for("upcast").add(function(e,t){const i=(i,r,o)=>{function n(t,i){const n=e.processViewAttributes(t,o);n&&o.writer.setAttribute(i,n,r.modelRange)}n(r.viewItem,M(t))};return e=>{e.on(`element:${t}`,i,{priority:"low"})}}(r,n)),i.for("dataDowncast").add(function(e){return t=>{function i(e,i){t.on(`attribute:${i}:media`,((t,i,r)=>{if(!r.consumable.consume(i.item,t.name))return;const{attributeOldValue:o,attributeNewValue:n}=i,l=r.mapper.toViewElement(i.item),s=je(r.writer,l,e);H(r.writer,o,n,s)}))}i(e,M(e)),i("figure","htmlFigureAttributes")}}(n)),e.stop())}))}}class Ie extends e.Plugin{static get requires(){return[pe]}static get pluginName(){return"ScriptElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.plugins.get(pe);e.on("register:script",((t,i)=>{const r=this.editor,o=r.model.schema,n=r.conversion;o.register("htmlScript",i.modelSchema),o.extend("htmlScript",{allowAttributes:["htmlScriptAttributes","htmlContent"],isContent:!0}),r.data.registerRawContentMatcher({name:"script"}),n.for("upcast").elementToElement({view:"script",model:U(i)}),n.for("upcast").add(X(i,e)),n.for("downcast").elementToElement({model:"htmlScript",view:(e,{writer:t})=>W("script",e,t)}),n.for("downcast").add(Q(i)),t.stop()}))}}const $e=["width","max-width","min-width","height","min-height","max-height"];class _e extends e.Plugin{static get requires(){return[pe]}static get pluginName(){return"TableElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(!e.plugins.has("TableEditing"))return;const t=e.model.schema,i=e.conversion,r=e.plugins.get(pe),o=e.plugins.get("TableUtils");r.on("register:figure",(()=>{i.for("upcast").add(function(e){return t=>{t.on("element:figure",((t,i,r)=>{const o=i.viewItem;if(!i.modelRange||!o.hasClass("table"))return;const n=e.processViewAttributes(o,r);n&&r.writer.setAttribute("htmlFigureAttributes",n,i.modelRange)}),{priority:"low"})}}(r))})),r.on("register:table",((n,l)=>{"table"===l.model&&(t.extend("table",{allowAttributes:["htmlTableAttributes","htmlFigureAttributes","htmlTheadAttributes","htmlTbodyAttributes"]}),i.for("upcast").add(function(e){return t=>{t.on("element:table",((t,i,r)=>{if(!i.modelRange)return;const o=i.viewItem;n(o,"htmlTableAttributes");for(const e of o.getChildren())e.is("element","thead")&&n(e,"htmlTheadAttributes"),e.is("element","tbody")&&n(e,"htmlTbodyAttributes");function n(t,o){const n=e.processViewAttributes(t,r);n&&r.writer.setAttribute(o,n,i.modelRange)}}),{priority:"low"})}}(r)),i.for("downcast").add((e=>{function t(t,i){e.on(`attribute:${i}:table`,((e,r,o)=>{if(!o.consumable.test(r.item,e.name))return;const n=o.mapper.toViewElement(r.item),l=je(o.writer,n,t);if(l)if(o.consumable.consume(r.item,e.name),"htmlTableAttributes"===i&&n!==l){const e=Be(r.attributeOldValue),t=Be(r.attributeNewValue);H(o.writer,e.tableAttributes,t.tableAttributes,l),H(o.writer,e.figureAttributes,t.figureAttributes,n)}else H(o.writer,r.attributeOldValue,r.attributeNewValue,l)}))}t("table","htmlTableAttributes"),t("figure","htmlFigureAttributes"),t("thead","htmlTheadAttributes"),t("tbody","htmlTbodyAttributes")})),e.model.document.registerPostFixer(function(e,t){return i=>{const r=e.document.differ.getChanges();let o=!1;for(const e of r){if("attribute"!=e.type||"headingRows"!=e.attributeKey)continue;const r=e.range.start.nodeAfter,n=r.getAttribute("htmlTheadAttributes"),l=r.getAttribute("htmlTbodyAttributes");n&&!e.attributeNewValue?(i.removeAttribute("htmlTheadAttributes",r),o=!0):l&&e.attributeNewValue==t.getRows(r)&&(i.removeAttribute("htmlTbodyAttributes",r),o=!0)}return o}}(e.model,o)),n.stop())}))}}function Be(e){const t={},i={...e};if(!e||!("styles"in e))return{figureAttributes:t,tableAttributes:i};i.styles={};for(const[r,o]of Object.entries(e.styles))$e.includes(r)?t.styles={...t.styles,[r]:o}:i.styles={...i.styles,[r]:o};return{figureAttributes:t,tableAttributes:i}}class xe extends e.Plugin{static get requires(){return[pe]}static get pluginName(){return"StyleElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.plugins.get(pe);e.on("register:style",((t,i)=>{const r=this.editor,o=r.model.schema,n=r.conversion;o.register("htmlStyle",i.modelSchema),o.extend("htmlStyle",{allowAttributes:["htmlStyleAttributes","htmlContent"],isContent:!0}),r.data.registerRawContentMatcher({name:"style"}),n.for("upcast").elementToElement({view:"style",model:U(i)}),n.for("upcast").add(X(i,e)),n.for("downcast").elementToElement({model:"htmlStyle",view:(e,{writer:t})=>W("style",e,t)}),n.for("downcast").add(Q(i)),t.stop()}))}}function Te(e){if(!e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t))&&"[object Object]"===Object.prototype.toString.call(e)}function De(e,t,i,r,o,n,l){const s=l(e,t,i,r,o,n);if(void 0!==s)return s;if(typeof e==typeof t)switch(typeof e){case"bigint":case"string":case"boolean":case"symbol":case"undefined":case"function":return e===t;case"number":return e===t||Object.is(e,t);case"object":return Re(e,t,n,l)}return Re(e,t,n,l)}function Re(e,t,i,r){if(Object.is(e,t))return!0;let o=s(e),n=s(t);if(o===d&&(o=A),n===d&&(n=A),o!==n)return!1;switch(o){case m:return e.toString()===t.toString();case c:{const i=e.valueOf(),r=t.valueOf();return(I=i)===($=r)||Number.isNaN(I)&&Number.isNaN($)}case u:case f:case h:return Object.is(e.valueOf(),t.valueOf());case a:return e.source===t.source&&e.flags===t.flags;case"[object Function]":return e===t}var I,$;const _=(i=i??new Map).get(e),B=i.get(t);if(null!=_&&null!=B)return _===t;i.set(e,t),i.set(t,e);try{switch(o){case g:if(e.size!==t.size)return!1;for(const[o,n]of e.entries())if(!t.has(o)||!De(n,t.get(o),o,e,t,i,r))return!1;return!0;case b:{if(e.size!==t.size)return!1;const o=Array.from(e.values()),n=Array.from(t.values());for(let l=0;l<o.length;l++){const s=o[l],a=n.findIndex((o=>De(s,o,void 0,e,t,i,r)));if(-1===a)return!1;n.splice(a,1)}return!0}case p:case v:case E:case S:case k:case"[object BigUint64Array]":case O:case C:case j:case"[object BigInt64Array]":case P:case F:if("undefined"!=typeof Buffer&&Buffer.isBuffer(e)!==Buffer.isBuffer(t))return!1;if(e.length!==t.length)return!1;for(let o=0;o<e.length;o++)if(!De(e[o],t[o],o,e,t,i,r))return!1;return!0;case w:return e.byteLength===t.byteLength&&Re(new Uint8Array(e),new Uint8Array(t),i,r);case y:return e.byteLength===t.byteLength&&e.byteOffset===t.byteOffset&&Re(new Uint8Array(e),new Uint8Array(t),i,r);case"[object Error]":return e.name===t.name&&e.message===t.message;case A:{if(!(Re(e.constructor,t.constructor,i,r)||Te(e)&&Te(t)))return!1;const o=[...Object.keys(e),...l(e)],n=[...Object.keys(t),...l(t)];if(o.length!==n.length)return!1;for(let n=0;n<o.length;n++){const l=o[n],s=e[l];if(!Object.hasOwn(t,l))return!1;if(!De(s,t[l],l,e,t,i,r))return!1}return!0}default:return!1}}finally{i.delete(e),i.delete(t)}}function Ne(){}function He(e,t){return function(e,t,i){return De(e,t,void 0,void 0,void 0,void 0,i)}(e,t,Ne)}class Ve extends e.Plugin{static get requires(){return[pe]}static get pluginName(){return"ListElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(!e.plugins.has("ListEditing"))return;const t=e.model.schema,i=e.conversion,r=e.plugins.get(pe),o=e.plugins.get("ListEditing"),n=e.plugins.get("ListUtils"),l=["ul","ol","li"];o.registerDowncastStrategy({scope:"item",attributeName:"htmlLiAttributes",setAttributeOnDowncast:V}),o.registerDowncastStrategy({scope:"list",attributeName:"htmlUlAttributes",setAttributeOnDowncast:V}),o.registerDowncastStrategy({scope:"list",attributeName:"htmlOlAttributes",setAttributeOnDowncast:V}),r.on("register",((e,o)=>{if(!l.includes(o.view))return;if(e.stop(),t.checkAttribute("$block","htmlLiAttributes"))return;const n=l.map((e=>M(e)));t.extend("$listItem",{allowAttributes:n}),i.for("upcast").add((e=>{e.on("element:ul",Le("htmlUlAttributes",r),{priority:"low"}),e.on("element:ol",Le("htmlOlAttributes",r),{priority:"low"}),e.on("element:li",Le("htmlLiAttributes",r),{priority:"low"})}))})),o.on("postFixer",((e,{listNodes:t,writer:i})=>{for(const{node:r,previousNodeInList:o}of t)if(o){if(o.getAttribute("listType")==r.getAttribute("listType")){const t=Me(o.getAttribute("listType")),n=o.getAttribute(t);!He(r.getAttribute(t),n)&&i.model.schema.checkAttribute(r,t)&&(i.setAttribute(t,n,r),e.return=!0)}if(o.getAttribute("listItemId")==r.getAttribute("listItemId")){const t=o.getAttribute("htmlLiAttributes");!He(r.getAttribute("htmlLiAttributes"),t)&&i.model.schema.checkAttribute(r,"htmlLiAttributes")&&(i.setAttribute("htmlLiAttributes",t,r),e.return=!0)}}})),o.on("postFixer",((e,{listNodes:t,writer:i})=>{for(const{node:r}of t){const t=r.getAttribute("listType");!n.isNumberedListType(t)&&r.getAttribute("htmlOlAttributes")&&(i.removeAttribute("htmlOlAttributes",r),e.return=!0),n.isNumberedListType(t)&&r.getAttribute("htmlUlAttributes")&&(i.removeAttribute("htmlUlAttributes",r),e.return=!0)}}))}afterInit(){const e=this.editor;if(!e.commands.get("indentList"))return;const t=e.commands.get("indentList");this.listenTo(t,"afterExecute",((t,i)=>{e.model.change((t=>{for(const r of i){const i=Me(r.getAttribute("listType"));e.model.schema.checkAttribute(r,i)&&t.setAttribute(i,{},r)}}))}))}}function Le(e,t){return(i,r,o)=>{const n=r.viewItem;r.modelRange||Object.assign(r,o.convertChildren(r.viewItem,r.modelCursor));const l=t.processViewAttributes(n,o);for(const t of r.modelRange.getItems({shallow:!0}))t.hasAttribute("listItemId")&&(t.hasAttribute("htmlUlAttributes")||t.hasAttribute("htmlOlAttributes")||o.writer.model.schema.checkAttribute(t,e)&&o.writer.setAttribute(e,l||{},t))}}function Me(e){return"numbered"===e||"customNumbered"==e?"htmlOlAttributes":"htmlUlAttributes"}class Ue extends e.Plugin{static get requires(){return[pe]}static get pluginName(){return"HorizontalLineElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(!e.plugins.has("HorizontalLineEditing"))return;const t=e.model.schema,i=e.conversion,r=e.plugins.get(pe);r.on("register:hr",((e,o)=>{"horizontalLine"===o.model&&(t.extend("horizontalLine",{allowAttributes:["htmlHrAttributes"]}),i.for("upcast").add(X(o,r)),i.for("downcast").add((e=>{e.on("attribute:htmlHrAttributes:horizontalLine",((e,t,i)=>{if(!i.consumable.test(t.item,e.name))return;const{attributeOldValue:r,attributeNewValue:o}=t,n=i.mapper.toViewElement(t.item),l=je(i.writer,n,"hr");l&&(H(i.writer,r,o,l),i.consumable.consume(t.item,e.name))}),{priority:"low"})})),e.stop())}))}}class ze extends e.Plugin{static get requires(){return[pe,oe]}static get pluginName(){return"CustomElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.plugins.get(pe),t=this.editor.plugins.get(oe);e.on("register:$customElement",((i,r)=>{i.stop();const n=this.editor,l=n.model.schema,s=n.conversion,a=n.editing.view.domConverter.unsafeElements,m=n.data.htmlProcessor.domConverter.preElements;l.register(r.model,r.modelSchema),l.extend(r.model,{allowAttributes:["htmlElementName","htmlCustomElementAttributes","htmlContent"],isContent:!0}),n.data.htmlProcessor.domConverter.registerRawContentMatcher({name:"template"}),s.for("upcast").elementToElement({view:/.*/,model:(i,l)=>{if("$comment"==i.name)return null;if(!function(e){try{document.createElement(e)}catch{return!1}return!0}(i.name))return null;if(t.getDefinitionsForView(i.name).size)return null;a.includes(i.name)||a.push(i.name),m.includes(i.name)||m.push(i.name);const s=l.writer.createElement(r.model,{htmlElementName:i.name}),c=e.processViewAttributes(i,l);let u;if(c&&l.writer.setAttribute("htmlCustomElementAttributes",c,s),i.is("element","template")&&i.getCustomProperty("$rawContent"))u=i.getCustomProperty("$rawContent");else{const e=new o.UpcastWriter(i.document).createDocumentFragment(i),t=n.data.htmlProcessor.domConverter.viewToDom(e),r=t.firstChild;for(;r.firstChild;)t.appendChild(r.firstChild);r.remove(),u=n.data.htmlProcessor.htmlWriter.getHtml(t)}l.writer.setAttribute("htmlContent",u,s);for(const{item:e}of n.editing.view.createRangeIn(i))l.consumable.consume(e,{name:!0});return s},converterPriority:"low"}),s.for("editingDowncast").elementToElement({model:{name:r.model,attributes:["htmlElementName","htmlCustomElementAttributes","htmlContent"]},view:(e,{writer:t})=>{const i=e.getAttribute("htmlElementName"),r=t.createRawElement(i);return e.hasAttribute("htmlCustomElementAttributes")&&V(t,e.getAttribute("htmlCustomElementAttributes"),r),r}}),s.for("dataDowncast").elementToElement({model:{name:r.model,attributes:["htmlElementName","htmlCustomElementAttributes","htmlContent"]},view:(e,{writer:t})=>{const i=e.getAttribute("htmlElementName"),r=e.getAttribute("htmlContent"),o=t.createRawElement(i,null,((e,t)=>{t.setContentOf(e,r)}));return e.hasAttribute("htmlCustomElementAttributes")&&V(t,e.getAttribute("htmlCustomElementAttributes"),o),o}})}))}}class We extends e.Plugin{static get pluginName(){return"GeneralHtmlSupport"}static get isOfficialPlugin(){return!0}static get requires(){return[pe,Se,ke,Ce,Pe,Fe,Ie,_e,xe,Ve,Ue,ze]}init(){const e=this.editor,t=e.plugins.get(pe);t.loadAllowedEmptyElementsConfig(e.config.get("htmlSupport.allowEmpty")||[]),t.loadAllowedConfig(e.config.get("htmlSupport.allow")||[]),t.loadDisallowedConfig(e.config.get("htmlSupport.disallow")||[])}getGhsAttributeNameForElement(e){const t=this.editor.plugins.get("DataSchema"),i=Array.from(t.getDefinitionsForView(e,!1)),r=i.find((e=>e.isInline&&!i[0].isObject));return r?r.model:M(e)}addModelHtmlClass(e,i,r){const o=this.editor.model,n=this.getGhsAttributeNameForElement(e);o.change((e=>{for(const l of qe(o,r,n))L(e,l,n,"classes",(e=>{for(const r of(0,t.toArray)(i))e.add(r)}))}))}removeModelHtmlClass(e,i,r){const o=this.editor.model,n=this.getGhsAttributeNameForElement(e);o.change((e=>{for(const l of qe(o,r,n))L(e,l,n,"classes",(e=>{for(const r of(0,t.toArray)(i))e.delete(r)}))}))}setModelHtmlAttributes(e,t,i){const r=this.editor.model,o=this.getGhsAttributeNameForElement(e);r.change((e=>{for(const n of qe(r,i,o))L(e,n,o,"attributes",(e=>{for(const[i,r]of Object.entries(t))e.set(i,r)}))}))}removeModelHtmlAttributes(e,i,r){const o=this.editor.model,n=this.getGhsAttributeNameForElement(e);o.change((e=>{for(const l of qe(o,r,n))L(e,l,n,"attributes",(e=>{for(const r of(0,t.toArray)(i))e.delete(r)}))}))}setModelHtmlStyles(e,t,i){const r=this.editor.model,o=this.getGhsAttributeNameForElement(e);r.change((e=>{for(const n of qe(r,i,o))L(e,n,o,"styles",(e=>{for(const[i,r]of Object.entries(t))e.set(i,r)}))}))}removeModelHtmlStyles(e,i,r){const o=this.editor.model,n=this.getGhsAttributeNameForElement(e);o.change((e=>{for(const l of qe(o,r,n))L(e,l,n,"styles",(e=>{for(const r of(0,t.toArray)(i))e.delete(r)}))}))}}function*qe(e,t,i){if(t)if(!(Symbol.iterator in t)&&t.is("documentSelection")&&t.isCollapsed)e.schema.checkAttributeInSelection(t,i)&&(yield t);else for(const r of function(e,t,i){return!(Symbol.iterator in t)&&(t.is("node")||t.is("$text")||t.is("$textProxy"))?e.schema.checkAttribute(t,i)?[e.createRangeOn(t)]:[]:e.schema.getValidRanges(e.createSelection(t).getRanges(),i)}(e,t,i))yield*r.getItems({shallow:!0})}class Ke extends e.Plugin{static get pluginName(){return"HtmlComment"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,i=new Map;e.data.processor.skipComments=!1,e.model.schema.addAttributeCheck(((e,t)=>{if(e.endsWith("$root")&&t.startsWith("$comment"))return!0})),e.conversion.for("upcast").elementToMarker({view:"$comment",model:e=>{const r=`$comment:${(0,t.uid)()}`,o=e.getCustomProperty("$rawContent");return i.set(r,o),r}}),e.conversion.for("dataDowncast").markerToElement({model:"$comment",view:(e,{writer:t})=>{let i;for(const t of this.editor.model.document.getRootNames())if(i=this.editor.model.document.getRoot(t),i.hasAttribute(e.markerName))break;const r=e.markerName,o=i.getAttribute(r),n=t.createUIElement("$comment");return t.setCustomProperty("$rawContent",o,n),n}}),e.model.document.registerPostFixer((t=>{let r=!1;const o=e.model.document.differ.getChangedMarkers().filter((e=>e.name.startsWith("$comment:")));for(const e of o){const{oldRange:o,newRange:n}=e.data;if(!o||!n||o.root!=n.root){if(o){const i=o.root;i.hasAttribute(e.name)&&(t.removeAttribute(e.name,i),r=!0)}if(n){const o=n.root;"$graveyard"==o.rootName?(t.removeMarker(e.name),r=!0):o.hasAttribute(e.name)||(t.setAttribute(e.name,i.get(e.name)||"",o),r=!0)}}}return r})),e.data.on("set",(()=>{for(const t of e.model.markers.getMarkersGroup("$comment"))this.removeHtmlComment(t.name)}),{priority:"high"}),e.model.on("deleteContent",((t,[i])=>{for(const t of i.getRanges()){const i=e.model.schema.getLimitElement(t),r=e.model.createPositionAt(i,0),o=e.model.createPositionAt(i,"end");let n;n=r.isTouching(t.start)&&o.isTouching(t.end)?this.getHtmlCommentsInRange(e.model.createRange(r,o)):this.getHtmlCommentsInRange(t,{skipBoundaries:!0});for(const e of n)this.removeHtmlComment(e)}}),{priority:"high"})}createHtmlComment(e,i){const r=(0,t.uid)(),o=this.editor.model,n=o.document.getRoot(e.root.rootName),l=`$comment:${r}`;return o.change((t=>{const r=t.createRange(e);return t.addMarker(l,{usingOperation:!0,affectsData:!0,range:r}),t.setAttribute(l,i,n),l}))}removeHtmlComment(e){const t=this.editor,i=t.model.markers.get(e);return!!i&&(t.model.change((e=>{e.removeMarker(i)})),!0)}getHtmlCommentData(e){const t=this.editor.model.markers.get(e);if(!t)return null;let i="";for(const t of this.editor.model.document.getRoots())if(t.hasAttribute(e)){i=t.getAttribute(e);break}return{content:i,position:t.getStart()}}getHtmlCommentsInRange(e,{skipBoundaries:t=!1}={}){const i=!t;return Array.from(this.editor.model.markers.getMarkersGroup("$comment")).filter((t=>function(e,t){const r=e.getRange().start;return(r.isAfter(t.start)||i&&r.isEqual(t.start))&&(r.isBefore(t.end)||i&&r.isEqual(t.end))}(t,e))).map((e=>e.name))}}class Ge extends o.HtmlDataProcessor{toView(e){if(!/<(?:html|body|head|meta)(?:\s[^>]*)?>/i.test(e.trim().slice(0,1e4)))return super.toView(e);let t="",i="";e=(e=e.trim().replace(/<\?xml\s[^?]*\?>/i,(e=>(i=e,"")))).trim().replace(/^<!DOCTYPE\s[^>]*?>/i,(e=>(t=e,"")));const r=this._toDom(e),n=this.domConverter.domToView(r,{skipComments:this.skipComments}),l=new o.UpcastWriter(n.document);l.setCustomProperty("$fullPageDocument",r.ownerDocument.documentElement.outerHTML,n);const s=Array.from(r.ownerDocument.querySelectorAll("head style"));return l.setCustomProperty("$fullPageHeadStyles",s,n),t&&l.setCustomProperty("$fullPageDocType",t,n),i&&l.setCustomProperty("$fullPageXmlDeclaration",i,n),n}toData(e){let t=super.toData(e);const i=e.getCustomProperty("$fullPageDocument"),r=e.getCustomProperty("$fullPageDocType"),o=e.getCustomProperty("$fullPageXmlDeclaration");return i&&(t=i.replace(/<\/body\s*>/,t+"$&"),r&&(t=r+"\n"+t),o&&(t=o+"\n"+t)),t}}class Xe extends e.Plugin{static get pluginName(){return"FullPage"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define("htmlSupport.fullPage",{allowRenderStylesFromHead:!1,sanitizeCss:e=>((0,t.logWarning)("css-full-page-provide-sanitize-function"),{css:e,hasChanged:!1})}),e.data.processor=new Ge(e.data.viewDocument)}init(){const e=this.editor,t=["$fullPageDocument","$fullPageDocType","$fullPageXmlDeclaration","$fullPageHeadStyles"];e.model.schema.extend("$root",{allowAttributes:t}),e.data.on("toModel",((i,[r])=>{const o=e.model.document.getRoot();e.model.change((e=>{for(const i of t){const t=r.getCustomProperty(i);t&&e.setAttribute(i,t,o)}})),Qe(e)&&this._renderStylesFromHead(o)}),{priority:"low"}),e.data.on("toView",((e,[i])=>{if(!i.is("rootElement"))return;const r=i,n=e.return;if(!r.hasAttribute("$fullPageDocument"))return;const l=new o.UpcastWriter(n.document);for(const e of t){const t=r.getAttribute(e);t&&l.setCustomProperty(e,t,n)}}),{priority:"low"}),e.data.on("set",(()=>{const i=e.model.document.getRoot();e.model.change((e=>{for(const r of t)i.hasAttribute(r)&&e.removeAttribute(r,i)}))}),{priority:"high"}),e.data.on("get",((e,t)=>{t[0]||(t[0]={}),t[0].trim=!1}),{priority:"high"})}destroy(){super.destroy(),Qe(this.editor)&&this._removeStyleElementsFromDom()}_removeStyleElementsFromDom(){const e=Array.from(t.global.document.querySelectorAll(`[data-full-page-style-id="${this.editor.id}"]`));for(const t of e)t.remove()}_renderStyleElementsInDom(e){const i=this.editor,r=e.getAttribute("$fullPageHeadStyles");if(!r)return;const o=i.config.get("htmlSupport.fullPage.sanitizeCss");for(const e of r){e.setAttribute("data-full-page-style-id",i.id);const r=o(e.innerText);r.hasChanged&&(e.innerText=r.css),t.global.document.head.append(e)}}_renderStylesFromHead(e){this._removeStyleElementsFromDom(),this._renderStyleElementsInDom(e)}}function Qe(e){return e.config.get("htmlSupport.fullPage.allowRenderStylesFromHead")}const Ye="htmlEmptyBlock";class Je extends e.Plugin{static get pluginName(){return"EmptyBlock"}static get isOfficialPlugin(){return!0}afterInit(){const{model:e,conversion:t,plugins:i,config:r}=this.editor,o=e.schema,n=r.get("htmlSupport.preserveEmptyBlocksInEditingView");o.extend("$block",{allowAttributes:[Ye]}),o.extend("$container",{allowAttributes:[Ye]}),o.isRegistered("tableCell")&&o.extend("tableCell",{allowAttributes:[Ye]}),n?t.for("downcast").add(Ze()):t.for("dataDowncast").add(Ze()),t.for("upcast").add(function(e){return t=>{t.on("element",((t,i,r)=>{const{viewItem:o,modelRange:n}=i;if(!o.is("element")||!o.isEmpty||o.getCustomProperty("$hasBlockFiller"))return;const l=n&&n.start.nodeAfter;if(!l||!e.checkAttribute(l,Ye))return;if(r.writer.setAttribute(Ye,!0,l),1!=l.childCount)return;const s=l.getChild(0);s.is("element","paragraph")&&e.checkAttribute(s,Ye)&&r.writer.setAttribute(Ye,!0,s)}),{priority:"lowest"})}}(o)),i.has("ClipboardPipeline")&&this._registerClipboardPastingHandler()}_registerClipboardPastingHandler(){const e=this.editor.plugins.get("ClipboardPipeline");this.listenTo(e,"contentInsertion",((e,t)=>{t.sourceEditorId!==this.editor.id&&this.editor.model.change((e=>{for(const{item:i}of e.createRangeIn(t.content))i.is("element")&&i.hasAttribute(Ye)&&e.removeAttribute(Ye,i)}))}))}}function Ze(){return e=>{e.on(`attribute:${Ye}`,((e,t,i)=>{const{mapper:r,consumable:o}=i,{item:n}=t;if(!o.consume(n,e.name))return;const l=r.toViewElement(n);l&&t.attributeNewValue&&(l.getFillerOffset=()=>null)}))}}})(),(window.CKEditor5=window.CKEditor5||{}).htmlSupport=r})();
5
+ */(()=>{var e={21:e=>{"use strict";e.exports=function(e,t){Object.keys(t).forEach(function(i){e.setAttribute(i,t[i])})}},51:e=>{"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},128:e=>{"use strict";var t={};e.exports=function(e,i){var r=function(e){if(void 0===t[e]){var i=document.querySelector(e);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(e){i=null}t[e]=i}return t[e]}(e);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(i)}},237:e=>{"use strict";e.exports=CKEditor5.dll},275:(e,t,i)=>{"use strict";i.d(t,{A:()=>s});var r=i(758),o=i.n(r),n=i(935),l=i.n(n)()(o());l.push([e.id,":root{--ck-html-object-embed-unfocused-outline-width:1px}.ck-widget.html-object-embed{background-color:var(--ck-color-base-foreground);font-size:var(--ck-font-size-base);min-width:calc(76px + var(--ck-spacing-standard));padding:var(--ck-spacing-small);padding-top:calc(var(--ck-font-size-tiny) + var(--ck-spacing-large))}.ck-widget.html-object-embed:not(.ck-widget_selected):not(:hover){outline:var(--ck-html-object-embed-unfocused-outline-width) dashed var(--ck-color-widget-blurred-border)}.ck-widget.html-object-embed:before{background:#999;border-radius:0 0 var(--ck-border-radius) var(--ck-border-radius);color:var(--ck-color-base-background);content:attr(data-html-object-embed-label);font-family:var(--ck-font-face);font-size:var(--ck-font-size-tiny);font-style:normal;font-weight:400;left:var(--ck-spacing-standard);padding:calc(var(--ck-spacing-tiny) + var(--ck-html-object-embed-unfocused-outline-width)) var(--ck-spacing-small) var(--ck-spacing-tiny);position:absolute;top:0;transition:background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve)}.ck-widget.html-object-embed .ck-widget__type-around .ck-widget__type-around__button.ck-widget__type-around__button_before{margin-left:50px}.ck-widget.html-object-embed .html-object-embed__content{pointer-events:none}div.ck-widget.html-object-embed{margin:1em auto}span.ck-widget.html-object-embed{display:inline-block}",""]);const s=l},507:(e,t,i)=>{e.exports=i(237)("./src/enter.js")},584:(e,t,i)=>{e.exports=i(237)("./src/utils.js")},591:e=>{"use strict";var t=[];function i(e){for(var i=-1,r=0;r<t.length;r++)if(t[r].identifier===e){i=r;break}return i}function r(e,r){for(var n={},l=[],s=0;s<e.length;s++){var a=e[s],m=r.base?a[0]+r.base:a[0],c=n[m]||0,u="".concat(m," ").concat(c);n[m]=c+1;var d=i(u),h={css:a[1],media:a[2],sourceMap:a[3],supports:a[4],layer:a[5]};if(-1!==d)t[d].references++,t[d].updater(h);else{var f=o(h,r);r.byIndex=s,t.splice(s,0,{identifier:u,updater:f,references:1})}l.push(u)}return l}function o(e,t){var i=t.domAPI(t);i.update(e);return function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;i.update(e=t)}else i.remove()}}e.exports=function(e,o){var n=r(e=e||[],o=o||{});return function(e){e=e||[];for(var l=0;l<n.length;l++){var s=i(n[l]);t[s].references--}for(var a=r(e,o),m=0;m<n.length;m++){var c=i(n[m]);0===t[c].references&&(t[c].updater(),t.splice(c,1))}n=a}}},639:e=>{"use strict";var t,i=(t=[],function(e,i){return t[e]=i,t.filter(Boolean).join("\n")});function r(e,t,r,o){var n;if(r)n="";else{n="",o.supports&&(n+="@supports (".concat(o.supports,") {")),o.media&&(n+="@media ".concat(o.media," {"));var l=void 0!==o.layer;l&&(n+="@layer".concat(o.layer.length>0?" ".concat(o.layer):""," {")),n+=o.css,l&&(n+="}"),o.media&&(n+="}"),o.supports&&(n+="}")}if(e.styleSheet)e.styleSheet.cssText=i(t,n);else{var s=document.createTextNode(n),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(s,a[t]):e.appendChild(s)}}var o={singleton:null,singletonCounter:0};e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=o.singletonCounter++,i=o.singleton||(o.singleton=e.insertStyleElement(e));return{update:function(e){r(i,t,!1,e)},remove:function(e){r(i,t,!0,e)}}}},758:e=>{"use strict";e.exports=function(e){return e[1]}},782:(e,t,i)=>{e.exports=i(237)("./src/core.js")},783:(e,t,i)=>{e.exports=i(237)("./src/engine.js")},901:(e,t,i)=>{e.exports=i(237)("./src/widget.js")},935:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var i="",r=void 0!==t[5];return t[4]&&(i+="@supports (".concat(t[4],") {")),t[2]&&(i+="@media ".concat(t[2]," {")),r&&(i+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),i+=e(t),r&&(i+="}"),t[2]&&(i+="}"),t[4]&&(i+="}"),i}).join("")},t.i=function(e,i,r,o,n){"string"==typeof e&&(e=[[null,e,void 0]]);var l={};if(r)for(var s=0;s<this.length;s++){var a=this[s][0];null!=a&&(l[a]=!0)}for(var m=0;m<e.length;m++){var c=[].concat(e[m]);r&&l[c[0]]||(void 0!==n&&(void 0===c[5]||(c[1]="@layer".concat(c[5].length>0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=n),i&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=i):c[2]=i),o&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=o):c[4]="".concat(o)),t.push(c))}},t}}},t={};function i(r){var o=t[r];if(void 0!==o)return o.exports;var n=t[r]={id:r,exports:{}};return e[r](n,n.exports,i),n.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{"use strict";i.r(r),i.d(r,{DataFilter:()=>we,DataSchema:()=>ne,EmptyBlock:()=>Ze,FullPage:()=>Qe,GeneralHtmlSupport:()=>qe,HtmlComment:()=>Ge,HtmlPageDataProcessor:()=>Xe});var e=i(782),t=i(584),o=i(783),n=i(901);function l(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function s(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const a="[object RegExp]",m="[object String]",c="[object Number]",u="[object Boolean]",d="[object Arguments]",h="[object Symbol]",f="[object Date]",g="[object Map]",b="[object Set]",p="[object Array]",w="[object ArrayBuffer]",A="[object Object]",y="[object DataView]",v="[object Uint8Array]",E="[object Uint8ClampedArray]",S="[object Uint16Array]",k="[object Uint32Array]",O="[object Int8Array]",C="[object Int16Array]",j="[object Int32Array]",P="[object Float32Array]",F="[object Float64Array]";function I(e){return null==e||"object"!=typeof e&&"function"!=typeof e}function $(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function _(e,t,i,r=new Map,o=void 0){const n=o?.(e,t,i,r);if(null!=n)return n;if(I(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){const t=new Array(e.length);r.set(e,t);for(let n=0;n<e.length;n++)t[n]=_(e[n],n,i,r,o);return Object.hasOwn(e,"index")&&(t.index=e.index),Object.hasOwn(e,"input")&&(t.input=e.input),t}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const t=new RegExp(e.source,e.flags);return t.lastIndex=e.lastIndex,t}if(e instanceof Map){const t=new Map;r.set(e,t);for(const[n,l]of e)t.set(n,_(l,n,i,r,o));return t}if(e instanceof Set){const t=new Set;r.set(e,t);for(const n of e)t.add(_(n,void 0,i,r,o));return t}if("undefined"!=typeof Buffer&&Buffer.isBuffer(e))return e.subarray();if($(e)){const t=new(Object.getPrototypeOf(e).constructor)(e.length);r.set(e,t);for(let n=0;n<e.length;n++)t[n]=_(e[n],n,i,r,o);return t}if(e instanceof ArrayBuffer||"undefined"!=typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){const t=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return r.set(e,t),B(t,e,i,r,o),t}if("undefined"!=typeof File&&e instanceof File){const t=new File([e],e.name,{type:e.type});return r.set(e,t),B(t,e,i,r,o),t}if(e instanceof Blob){const t=new Blob([e],{type:e.type});return r.set(e,t),B(t,e,i,r,o),t}if(e instanceof Error){const t=new e.constructor;return r.set(e,t),t.message=e.message,t.name=e.name,t.stack=e.stack,t.cause=e.cause,B(t,e,i,r,o),t}if("object"==typeof e&&function(e){switch(s(e)){case d:case p:case w:case y:case u:case f:case P:case F:case O:case C:case j:case g:case c:case A:case a:case b:case m:case h:case v:case E:case S:case k:return!0;default:return!1}}(e)){const t=Object.create(Object.getPrototypeOf(e));return r.set(e,t),B(t,e,i,r,o),t}return e}function B(e,t,i=e,r,o){const n=[...Object.keys(t),...l(t)];for(let l=0;l<n.length;l++){const s=n[l],a=Object.getOwnPropertyDescriptor(e,s);(null==a||a.writable)&&(e[s]=_(t[s],s,i,r,o))}}function x(e,t){return function(e,t){return _(e,void 0,e,new Map,t)}(e,(i,r,o,n)=>{const l=t?.(i,r,o,n);if(null!=l)return l;if("object"==typeof e)switch(Object.prototype.toString.call(e)){case c:case m:case u:{const t=new e.constructor(e?.valueOf());return B(t,e),t}case d:{const t={};return B(t,e),t.length=e.length,t[Symbol.iterator]=e[Symbol.iterator],t}default:return}})}function T(e){return x(e)}const D=/\p{Lu}?\p{Ll}+|[0-9]+|\p{Lu}+(?!\p{Ll})|\p{Emoji_Presentation}|\p{Extended_Pictographic}|\p{L}+/gu;function R(e){if(null==e)return"";if(Array.isArray(e))return e.map(R).join(",");const t=String(e);return"0"===t&&Object.is(Number(e),-0)?"-0":t}function N(e){const t=function(e){return Array.from(e.match(D)??[])}(function(e){return"string"!=typeof e&&(e=R(e)),e.replace(/['\u2019]/g,"")}(e).trim());let i="";for(let e=0;e<t.length;e++){const r=t[e];i&&(i+=" "),r===r.toUpperCase()?i+=r:i+=r[0].toUpperCase()+r.slice(1).toLowerCase()}return i}function H(e,t,i,r){t&&function(e,t,i){if(t.attributes)for(const[r]of Object.entries(t.attributes))e.removeAttribute(r,i);if(t.styles)for(const r of Object.keys(t.styles))e.removeStyle(r,i);t.classes&&e.removeClass(t.classes,i)}(e,t,r),i&&V(e,i,r)}function V(e,t,i){if(t.attributes)for(const[r,o]of Object.entries(t.attributes))e.setAttribute(r,o,i);t.styles&&e.setStyle(t.styles,i),t.classes&&e.addClass(t.classes,i)}function L(e,t,i,r,o){const n=t.getAttribute(i),l={};for(const e of["attributes","styles","classes"]){if(e!=r){n&&n[e]&&(l[e]=n[e]);continue}if("classes"==r){const t=new Set(n&&n.classes||[]);o(t),t.size&&(l[e]=Array.from(t));continue}const t=new Map(Object.entries(n&&n[e]||{}));o(t),t.size&&(l[e]=Object.fromEntries(t))}Object.keys(l).length?t.is("documentSelection")?e.setSelectionAttribute(i,l):e.setAttribute(i,l,t):n&&(t.is("documentSelection")?e.removeSelectionAttribute(i):e.removeAttribute(i,t))}function M(e){return`html${t=e,N(t).replace(/ /g,"")}Attributes`;var t}function U({model:e}){return(t,i)=>i.writer.createElement(e,{htmlContent:t.getCustomProperty("$rawContent")})}function z(e,{view:t,isInline:i}){const r=e.t;return(e,{writer:o})=>{const l=r("HTML object"),s=W(t,e,o),a=e.getAttribute(M(t));o.addClass("html-object-embed__content",s),a&&V(o,a,s);const m=o.createContainerElement(i?"span":"div",{class:"html-object-embed","data-html-object-embed-label":l},s);return(0,n.toWidget)(m,o,{label:l})}}function W(e,t,i){return i.createRawElement(e,null,(e,i)=>{i.setContentOf(e,t.getAttribute("htmlContent"))})}function q({view:e,model:t,allowEmpty:i},r){return t=>{t.on(`element:${e}`,(e,t,n)=>{let l=r.processViewAttributes(t.viewItem,n);if(l||n.consumable.test(t.viewItem,{name:!0})){if(l=l||{},n.consumable.consume(t.viewItem,{name:!0}),t.modelRange||(t=Object.assign(t,n.convertChildren(t.viewItem,t.modelCursor))),i&&t.modelRange.isCollapsed&&Object.keys(l).length){const e=n.writer.createElement("htmlEmptyElement");if(!n.safeInsert(e,t.modelCursor))return;const i=n.getSplitParts(e);return t.modelRange=n.writer.createRange(t.modelRange.start,n.writer.createPositionAfter(i[i.length-1])),n.updateConversionResult(e,t),void o(e,l,n)}for(const e of t.modelRange.getItems())o(e,l,n)}},{priority:"low"})};function o(e,i,r){if(r.schema.checkAttribute(e,t)){const o=function(e,t){const i=T(e);let r="attributes";for(r in t)i[r]="classes"==r?Array.from(new Set([...e[r]||[],...t[r]])):{...e[r],...t[r]};return i}(i,e.getAttribute(t)||{});r.writer.setAttribute(t,o,e)}}}function K({model:e,view:t},i){return(r,{writer:o,consumable:l})=>{if(!r.hasAttribute(e))return null;const s=o.createContainerElement(t),a=r.getAttribute(e);return l.consume(r,`attribute:${e}`),V(o,a,s),s.getFillerOffset=()=>null,i?(0,n.toWidget)(s,o):s}}function G({priority:e,view:t}){return(i,r)=>{if(!i)return;const{writer:o}=r,n=o.createAttributeElement(t,null,{priority:e});return V(o,i,n),n}}function X({view:e},t){return i=>{i.on(`element:${e}`,(e,i,r)=>{if(!i.modelRange||i.modelRange.isCollapsed)return;const o=t.processViewAttributes(i.viewItem,r);o&&r.writer.setAttribute(M(i.viewItem.name),o,i.modelRange)},{priority:"low"})}}function Q({view:e,model:t}){return i=>{i.on(`attribute:${M(e)}:${t}`,(e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const{attributeOldValue:r,attributeNewValue:o}=t;H(i.writer,r,o,i.mapper.toViewElement(t.item))})}}const Y=[{model:"codeBlock",view:"pre"},{model:"paragraph",view:"p"},{model:"blockQuote",view:"blockquote"},{model:"listItem",view:"li"},{model:"pageBreak",view:"div"},{model:"rawHtml",view:"div"},{model:"table",view:"table"},{model:"tableRow",view:"tr"},{model:"tableCell",view:"td"},{model:"tableCell",view:"th"},{model:"tableColumnGroup",view:"colgroup"},{model:"tableColumn",view:"col"},{model:"caption",view:"caption"},{model:"caption",view:"figcaption"},{model:"imageBlock",view:"img"},{model:"imageInline",view:"img"},{model:"horizontalLine",view:"hr"},{model:"htmlP",view:"p",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlBlockquote",view:"blockquote",modelSchema:{inheritAllFrom:"$container"}},{model:"htmlTable",view:"table",modelSchema:{allowWhere:"$block",isBlock:!0}},{model:"htmlTbody",view:"tbody",modelSchema:{allowIn:"htmlTable",isBlock:!1}},{model:"htmlThead",view:"thead",modelSchema:{allowIn:"htmlTable",isBlock:!1}},{model:"htmlTfoot",view:"tfoot",modelSchema:{allowIn:"htmlTable",isBlock:!1}},{model:"htmlCaption",view:"caption",modelSchema:{allowIn:"htmlTable",allowChildren:"$text",isBlock:!1}},{model:"htmlColgroup",view:"colgroup",modelSchema:{allowIn:"htmlTable",allowChildren:"col",isBlock:!1}},{model:"htmlCol",view:"col",modelSchema:{allowIn:"htmlColgroup",isBlock:!1}},{model:"htmlTr",view:"tr",modelSchema:{allowIn:["htmlTable","htmlThead","htmlTbody"],isLimit:!0}},{model:"htmlTd",view:"td",modelSchema:{allowIn:"htmlTr",allowContentOf:"$container",isLimit:!0,isBlock:!1}},{model:"htmlTh",view:"th",modelSchema:{allowIn:"htmlTr",allowContentOf:"$container",isLimit:!0,isBlock:!1}},{model:"htmlFigure",view:"figure",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlFigcaption",view:"figcaption",modelSchema:{allowIn:"htmlFigure",allowChildren:"$text",isBlock:!1}},{model:"htmlAddress",view:"address",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlAside",view:"aside",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlMain",view:"main",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlDetails",view:"details",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlSummary",view:"summary",modelSchema:{allowChildren:["htmlH1","htmlH2","htmlH3","htmlH4","htmlH5","htmlH6","$text"],allowIn:"htmlDetails",isBlock:!1}},{model:"htmlDiv",view:"div",paragraphLikeModel:"htmlDivParagraph",modelSchema:{inheritAllFrom:"$container"}},{model:"htmlFieldset",view:"fieldset",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlLegend",view:"legend",modelSchema:{allowIn:"htmlFieldset",allowChildren:"$text"}},{model:"htmlHeader",view:"header",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlFooter",view:"footer",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlForm",view:"form",modelSchema:{inheritAllFrom:"$container",isBlock:!0}},{model:"htmlHgroup",view:"hgroup",modelSchema:{allowIn:["$root","$container"],allowChildren:["paragraph","htmlP","htmlH1","htmlH2","htmlH3","htmlH4","htmlH5","htmlH6"],isBlock:!1}},{model:"htmlH1",view:"h1",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH2",view:"h2",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH3",view:"h3",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH4",view:"h4",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH5",view:"h5",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH6",view:"h6",modelSchema:{inheritAllFrom:"$block"}},{model:"$htmlList",modelSchema:{allowWhere:"$container",allowChildren:["$htmlList","htmlLi"],isBlock:!1}},{model:"htmlDir",view:"dir",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlMenu",view:"menu",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlUl",view:"ul",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlOl",view:"ol",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlLi",view:"li",modelSchema:{allowIn:"$htmlList",allowChildren:"$text",isBlock:!1}},{model:"htmlPre",view:"pre",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlArticle",view:"article",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlSection",view:"section",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlNav",view:"nav",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlDivDl",view:"div",modelSchema:{allowChildren:["htmlDt","htmlDd"],allowIn:"htmlDl"}},{model:"htmlDl",view:"dl",modelSchema:{allowWhere:"$container",allowChildren:["htmlDt","htmlDd","htmlDivDl"],isBlock:!1}},{model:"htmlDt",view:"dt",modelSchema:{allowChildren:"$block",isBlock:!1}},{model:"htmlDd",view:"dd",modelSchema:{allowChildren:"$block",isBlock:!1}},{model:"htmlCenter",view:"center",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlHr",view:"hr",isEmpty:!0,modelSchema:{inheritAllFrom:"$blockObject"}}],J=[{model:"htmlLiAttributes",view:"li",appliesToBlock:!0,coupledAttribute:"listItemId"},{model:"htmlOlAttributes",view:"ol",appliesToBlock:!0,coupledAttribute:"listItemId"},{model:"htmlUlAttributes",view:"ul",appliesToBlock:!0,coupledAttribute:"listItemId"},{model:"htmlFigureAttributes",view:"figure",appliesToBlock:"table"},{model:"htmlTheadAttributes",view:"thead",appliesToBlock:"table"},{model:"htmlTbodyAttributes",view:"tbody",appliesToBlock:"table"},{model:"htmlFigureAttributes",view:"figure",appliesToBlock:"imageBlock"},{model:"htmlAcronym",view:"acronym",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlTt",view:"tt",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlFont",view:"font",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlTime",view:"time",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlVar",view:"var",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlBig",view:"big",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSmall",view:"small",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSamp",view:"samp",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlQ",view:"q",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlOutput",view:"output",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlKbd",view:"kbd",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlBdi",view:"bdi",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlBdo",view:"bdo",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlAbbr",view:"abbr",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlA",view:"a",priority:5,coupledAttribute:"linkHref"},{model:"htmlStrong",view:"strong",coupledAttribute:"bold",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlB",view:"b",coupledAttribute:"bold",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlI",view:"i",coupledAttribute:"italic",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlEm",view:"em",coupledAttribute:"italic",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlS",view:"s",coupledAttribute:"strikethrough",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlDel",view:"del",coupledAttribute:"strikethrough",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlIns",view:"ins",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlU",view:"u",coupledAttribute:"underline",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSub",view:"sub",coupledAttribute:"subscript",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSup",view:"sup",coupledAttribute:"superscript",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlCode",view:"code",coupledAttribute:"code",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlMark",view:"mark",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSpan",view:"span",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlCite",view:"cite",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlLabel",view:"label",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlDfn",view:"dfn",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlObject",view:"object",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlIframe",view:"iframe",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlInput",view:"input",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlButton",view:"button",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlTextarea",view:"textarea",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlSelect",view:"select",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlVideo",view:"video",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlEmbed",view:"embed",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlOembed",view:"oembed",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlAudio",view:"audio",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlImg",view:"img",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlCanvas",view:"canvas",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlMeter",view:"meter",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlProgress",view:"progress",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlScript",view:"script",modelSchema:{allowWhere:["$text","$block"],isInline:!0}},{model:"htmlStyle",view:"style",modelSchema:{allowWhere:["$text","$block"],isInline:!0}},{model:"htmlCustomElement",view:"$customElement",modelSchema:{allowWhere:["$text","$block"],allowAttributesOf:"$inlineObject",isInline:!0}}];function Z(e){return null!==e&&"object"==typeof e&&"[object Arguments]"===s(e)}function ee(e){return"object"==typeof e&&null!==e}function te(e){if("object"!=typeof e)return!1;if(null==e)return!1;if(null===Object.getPrototypeOf(e))return!0;if("[object Object]"!==Object.prototype.toString.call(e)){const t=e[Symbol.toStringTag];if(null==t)return!1;return!!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable&&e.toString()===`[object ${t}]`}let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function ie(e){return $(e)}function re(e,...t){const i=t.slice(0,-1),r=t[t.length-1];let o=e;for(let e=0;e<i.length;e++){o=oe(o,i[e],r,new Map)}return o}function oe(e,t,i,r){if(I(e)&&(e=Object(e)),null==t||"object"!=typeof t)return e;if(r.has(t))return function(e){if(I(e))return e;if(Array.isArray(e)||$(e)||e instanceof ArrayBuffer||"undefined"!=typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer)return e.slice(0);const t=Object.getPrototypeOf(e),i=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new i(e);if(e instanceof RegExp){const t=new i(e);return t.lastIndex=e.lastIndex,t}if(e instanceof DataView)return new i(e.buffer.slice(0));if(e instanceof Error){const t=new i(e.message);return t.stack=e.stack,t.name=e.name,t.cause=e.cause,t}if("undefined"!=typeof File&&e instanceof File)return new i([e],e.name,{type:e.type,lastModified:e.lastModified});if("object"==typeof e){const i=Object.create(t);return Object.assign(i,e)}return e}(r.get(t));if(r.set(t,e),Array.isArray(t)){t=t.slice();for(let e=0;e<t.length;e++)t[e]=t[e]??void 0}const o=[...Object.keys(t),...l(t)];for(let n=0;n<o.length;n++){const l=o[n];let s=t[l],a=e[l];if(Z(s)&&(s={...s}),Z(a)&&(a={...a}),"undefined"!=typeof Buffer&&Buffer.isBuffer(s)&&(s=T(s)),Array.isArray(s))if("object"==typeof a&&null!=a){const e=[],t=Reflect.ownKeys(a);for(let i=0;i<t.length;i++){const r=t[i];e[r]=a[r]}a=e}else a=[];const m=i(a,s,l,e,t,r);null!=m?e[l]=m:Array.isArray(s)||ee(a)&&ee(s)?e[l]=oe(a,s,i,r):null==a&&te(s)?e[l]=oe({},s,i,r):null==a&&ie(s)?e[l]=T(s):void 0!==a&&void 0===s||(e[l]=s)}return e}class ne extends e.Plugin{_definitions=[];static get pluginName(){return"DataSchema"}static get isOfficialPlugin(){return!0}init(){for(const e of Y)this.registerBlockElement(e);for(const e of J)this.registerInlineElement(e)}registerBlockElement(e){this._definitions.push({...e,isBlock:!0})}registerInlineElement(e){this._definitions.push({...e,isInline:!0})}extendBlockElement(e){this._extendDefinition({...e,isBlock:!0})}extendInlineElement(e){this._extendDefinition({...e,isInline:!0})}getDefinitionsForView(e,t=!1){const i=new Set;for(const r of this._getMatchingViewDefinitions(e)){if(t)for(const e of this._getReferences(r.model))i.add(e);i.add(r)}return i}getDefinitionsForModel(e){return this._definitions.filter(t=>t.model==e)}_getMatchingViewDefinitions(e){return this._definitions.filter(t=>t.view&&function(e,t){if("string"==typeof e)return e===t;if(e instanceof RegExp)return e.test(t);return!1}(e,t.view))}*_getReferences(e){const i=["inheritAllFrom","inheritTypesFrom","allowWhere","allowContentOf","allowAttributesOf"],r=this._definitions.filter(t=>t.model==e);for(const{modelSchema:o}of r)if(o)for(const r of i)for(const i of(0,t.toArray)(o[r]||[])){const t=this._definitions.filter(e=>e.model==i);for(const r of t)i!==e&&(yield*this._getReferences(r.model),yield r)}}_extendDefinition(e){const t=Array.from(this._definitions.entries()).filter(([,t])=>t.model==e.model);if(0!=t.length)for(const[i,r]of t)this._definitions[i]=re({},r,e,(e,t)=>Array.isArray(e)?e.concat(t):void 0);else this._definitions.push(e)}}var le=i(591),se=i.n(le),ae=i(639),me=i.n(ae),ce=i(128),ue=i.n(ce),de=i(21),he=i.n(de),fe=i(51),ge=i.n(fe),be=i(275),pe={attributes:{"data-cke":!0}};pe.setAttributes=he(),pe.insert=ue().bind(null,"head"),pe.domAPI=me(),pe.insertStyleElement=ge();se()(be.A,pe);be.A&&be.A.locals&&be.A.locals;class we extends e.Plugin{_dataSchema;_allowedAttributes;_disallowedAttributes;_allowedElements;_disallowedElements;_dataInitialized;_coupledAttributes;constructor(e){super(e),this._dataSchema=e.plugins.get("DataSchema"),this._allowedAttributes=new o.Matcher,this._disallowedAttributes=new o.Matcher,this._allowedElements=new Set,this._disallowedElements=new Set,this._dataInitialized=!1,this._coupledAttributes=null,this._registerElementsAfterInit(),this._registerElementHandlers(),this._registerCoupledAttributesPostFixer(),this._registerAssociatedHtmlAttributesPostFixer()}static get pluginName(){return"DataFilter"}static get isOfficialPlugin(){return!0}static get requires(){return[ne,n.Widget]}loadAllowedConfig(e){for(const t of e){const e=t.name||/[\s\S]+/,i=Se(t);this.allowElement(e),i.forEach(e=>this.allowAttributes(e))}}loadDisallowedConfig(e){for(const t of e){const e=t.name||/[\s\S]+/,i=Se(t);0==i.length?this.disallowElement(e):i.forEach(e=>this.disallowAttributes(e))}}loadAllowedEmptyElementsConfig(e){for(const t of e)this.allowEmptyElement(t)}allowElement(e){for(const t of this._dataSchema.getDefinitionsForView(e,!0))this._addAllowedElement(t),this._coupledAttributes=null}disallowElement(e){for(const t of this._dataSchema.getDefinitionsForView(e,!1))this._disallowedElements.add(t.view)}allowEmptyElement(e){for(const t of this._dataSchema.getDefinitionsForView(e,!0))t.isInline&&this._dataSchema.extendInlineElement({...t,allowEmpty:!0})}allowAttributes(e){this._allowedAttributes.add(e)}disallowAttributes(e){this._disallowedAttributes.add(e)}processViewAttributes(e,t){const{consumable:i}=t;return Ae(e,this._disallowedAttributes,i),function(e,{attributes:t,classes:i,styles:r}){if(!t.length&&!i.length&&!r.length)return null;return{...t.length&&{attributes:ye(e,t)},...r.length&&{styles:ve(e,r)},...i.length&&{classes:i}}}(e,Ae(e,this._allowedAttributes,i))}_addAllowedElement(e){if(!this._allowedElements.has(e)){if(this._allowedElements.add(e),"appliesToBlock"in e&&"string"==typeof e.appliesToBlock)for(const t of this._dataSchema.getDefinitionsForModel(e.appliesToBlock))t.isBlock&&this._addAllowedElement(t);this._dataInitialized&&this.editor.data.once("set",()=>{this._fireRegisterEvent(e)},{priority:t.priorities.highest+1})}}_registerElementsAfterInit(){this.editor.data.on("init",()=>{this._dataInitialized=!0;for(const e of this._allowedElements)this._fireRegisterEvent(e)},{priority:t.priorities.highest+1})}_registerElementHandlers(){this.on("register",(e,i)=>{const r=this.editor.model.schema;if(i.isObject&&!r.isRegistered(i.model))this._registerObjectElement(i);else if(i.isBlock)this._registerBlockElement(i);else{if(!i.isInline)throw new t.CKEditorError("data-filter-invalid-definition",null,i);this._registerInlineElement(i)}e.stop()},{priority:"lowest"})}_registerCoupledAttributesPostFixer(){const e=this.editor.model,t=e.document.selection;e.document.registerPostFixer(t=>{const i=e.document.differ.getChanges();let r=!1;const o=this._getCoupledAttributesMap();for(const e of i){if("attribute"!=e.type||null!==e.attributeNewValue)continue;const i=o.get(e.attributeKey);if(i)for(const{item:o}of e.range.getWalker())for(const e of i)o.hasAttribute(e)&&(t.removeAttribute(e,o),r=!0)}return r}),this.listenTo(t,"change:attribute",(i,{attributeKeys:r})=>{const o=new Set,n=this._getCoupledAttributesMap();for(const e of r){if(t.hasAttribute(e))continue;const i=n.get(e);if(i)for(const e of i)t.hasAttribute(e)&&o.add(e)}0!=o.size&&e.change(e=>{for(const t of o)e.removeSelectionAttribute(t)})})}_registerAssociatedHtmlAttributesPostFixer(){const e=this.editor.model;e.document.registerPostFixer(t=>{const i=e.document.differ.getChanges();let r=!1;for(const o of i)if("insert"===o.type&&"$text"!==o.name)for(const i of o.attributes.keys())i.startsWith("html")&&i.endsWith("Attributes")&&(e.schema.checkAttribute(o.name,i)||(t.removeAttribute(i,o.position.nodeAfter),r=!0));return r})}_getCoupledAttributesMap(){if(this._coupledAttributes)return this._coupledAttributes;this._coupledAttributes=new Map;for(const e of this._allowedElements)if(e.coupledAttribute&&e.model){const t=this._coupledAttributes.get(e.coupledAttribute);t?t.push(e.model):this._coupledAttributes.set(e.coupledAttribute,[e.model])}return this._coupledAttributes}_fireRegisterEvent(e){e.view&&this._disallowedElements.has(e.view)||this.fire(e.view?`register:${e.view}`:"register",e)}_registerObjectElement(e){const i=this.editor,r=i.model.schema,o=i.conversion,{view:n,model:l}=e;r.register(l,e.modelSchema),n&&(r.extend(e.model,{allowAttributes:[M(n),"htmlContent"]}),i.data.registerRawContentMatcher({name:n}),o.for("upcast").elementToElement({view:n,model:U(e),converterPriority:t.priorities.low+2}),o.for("upcast").add(X(e,this)),o.for("editingDowncast").elementToStructure({model:{name:l,attributes:[M(n)]},view:z(i,e)}),o.for("dataDowncast").elementToElement({model:l,view:(e,{writer:t})=>W(n,e,t)}),o.for("dataDowncast").add(Q(e)))}_registerBlockElement(e){const i=this.editor,r=i.model.schema,o=i.conversion,{view:n,model:l}=e;if(!r.isRegistered(e.model)){if(!e.modelSchema)return;if(r.register(e.model,e.modelSchema),!n)return;o.for("upcast").elementToElement({model:l,view:n,converterPriority:t.priorities.low+2}),o.for("downcast").elementToElement({model:l,view:(t,{writer:i})=>e.isEmpty?i.createEmptyElement(n):i.createContainerElement(n)})}n&&(r.extend(e.model,{allowAttributes:M(n)}),o.for("upcast").add(X(e,this)),o.for("downcast").add(Q(e)))}_registerInlineElement(e){const t=this.editor,i=t.model.schema,r=t.conversion,o=e.model;if(!e.appliesToBlock&&(i.extend("$text",{allowAttributes:o}),e.attributeProperties&&i.setAttributeProperties(o,e.attributeProperties),r.for("upcast").add(q(e,this)),r.for("downcast").attributeToElement({model:o,view:G(e)}),e.allowEmpty)){if(i.setAttributeProperties(o,{copyFromObject:!1}),!i.isRegistered("htmlEmptyElement")){i.register("htmlEmptyElement",{inheritAllFrom:"$inlineObject"});const e=e=>Array.from(e.getAttributeKeys()).some(e=>e.startsWith("html"));t.model.document.registerPostFixer(i=>{const r=t.model.document.differ.getChanges(),o=new Set;for(const t of r)if("remove"!==t.type){if("attribute"===t.type&&null===t.attributeNewValue)for(const{item:i}of t.range)i.is("element","htmlEmptyElement")&&!e(i)&&o.add(i);if("insert"===t.type&&t.position.nodeAfter){const r=t.position.nodeAfter;for(const{item:t}of i.createRangeOn(r))t.is("element","htmlEmptyElement")&&!e(t)&&o.add(t)}}for(const e of o)i.remove(e);return o.size>0})}t.data.htmlProcessor.domConverter.registerInlineObjectMatcher(t=>t.name==e.view&&t.isEmpty&&Array.from(t.getAttributeKeys()).length?{name:!0}:null),r.for("editingDowncast").elementToElement({model:"htmlEmptyElement",view:K(e,!0)}),r.for("dataDowncast").elementToElement({model:"htmlEmptyElement",view:K(e)})}}}function Ae(e,t,i){const r=t.matchAll(e)||[],o=e.document.stylesProcessor;return r.reduce((t,{match:r})=>{for(const[n,l]of r.attributes||[])if("style"==n){const r=l,n=o.getRelatedStyles(r).filter(e=>e.split("-").length>r.split("-").length).sort((e,t)=>t.split("-").length-e.split("-").length);for(const r of n)i.consume(e,{styles:[r]})&&t.styles.push(r);i.consume(e,{styles:[r]})&&t.styles.push(r)}else if("class"==n){const r=l;i.consume(e,{classes:[r]})&&t.classes.push(r)}else i.consume(e,{attributes:[n]})&&t.attributes.push(n);return t},{attributes:[],classes:[],styles:[]})}function ye(e,i){const r={};for(const o of i){const i=e.getAttribute(o);void 0!==i&&(0,t.isValidAttributeName)(o)&&(r[o]=i)}return r}function ve(e,t){const i=new o.StylesMap(e.document.stylesProcessor);for(const r of t){const t=e.getStyle(r);void 0!==t&&i.set(r,t)}return Object.fromEntries(i.getStylesEntries())}function Ee(e,t){const{name:i}=e,r=e[t];return te(r)?Object.entries(r).map(([e,r])=>({name:i,[t]:{[e]:r}})):Array.isArray(r)?r.map(e=>({name:i,[t]:[e]})):[e]}function Se(e){const{name:t,attributes:i,classes:r,styles:o}=e,n=[];return i&&n.push(...Ee({name:t,attributes:i},"attributes")),r&&n.push(...Ee({name:t,classes:r},"classes")),o&&n.push(...Ee({name:t,styles:o},"styles")),n}class ke extends e.Plugin{static get requires(){return[we]}static get pluginName(){return"CodeBlockElementSupport"}static get isOfficialPlugin(){return!0}init(){if(!this.editor.plugins.has("CodeBlockEditing"))return;const e=this.editor.plugins.get(we);e.on("register:pre",(t,i)=>{if("codeBlock"!==i.model)return;const r=this.editor,o=r.model.schema,n=r.conversion;o.extend("codeBlock",{allowAttributes:["htmlPreAttributes","htmlContentAttributes"]}),n.for("upcast").add(function(e){return t=>{t.on("element:code",(t,i,r)=>{const o=i.viewItem,n=o.parent;function l(t,o){const n=e.processViewAttributes(t,r);n&&r.writer.setAttribute(o,n,i.modelRange)}n&&n.is("element","pre")&&(l(n,"htmlPreAttributes"),l(o,"htmlContentAttributes"))},{priority:"low"})}}(e)),n.for("downcast").add(e=>{e.on("attribute:htmlPreAttributes:codeBlock",(e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const{attributeOldValue:r,attributeNewValue:o}=t,n=i.mapper.toViewElement(t.item).parent;H(i.writer,r,o,n)}),e.on("attribute:htmlContentAttributes:codeBlock",(e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const{attributeOldValue:r,attributeNewValue:o}=t,n=i.mapper.toViewElement(t.item);H(i.writer,r,o,n)})}),t.stop()})}}class Oe extends e.Plugin{static get requires(){return[we]}static get pluginName(){return"DualContentModelElementSupport"}static get isOfficialPlugin(){return!0}init(){this.editor.plugins.get(we).on("register",(e,i)=>{const r=i,o=this.editor,n=o.model.schema,l=o.conversion;if(!r.paragraphLikeModel)return;if(n.isRegistered(r.model)||n.isRegistered(r.paragraphLikeModel))return;const s={model:r.paragraphLikeModel,view:r.view};n.register(r.model,r.modelSchema),n.register(s.model,{inheritAllFrom:"$block"}),l.for("upcast").elementToElement({view:r.view,model:(e,{writer:t})=>this._hasBlockContent(e)?t.createElement(r.model):t.createElement(s.model),converterPriority:t.priorities.low+.5}),l.for("downcast").elementToElement({view:r.view,model:r.model}),this._addAttributeConversion(r),l.for("downcast").elementToElement({view:s.view,model:s.model}),this._addAttributeConversion(s),e.stop()})}_hasBlockContent(e){const t=this.editor.editing.view,i=t.domConverter.blockElements;for(const r of t.createRangeIn(e).getItems())if(r.is("element")&&i.includes(r.name))return!0;return!1}_addAttributeConversion(e){const t=this.editor,i=t.conversion,r=t.plugins.get(we);t.model.schema.extend(e.model,{allowAttributes:M(e.view)}),i.for("upcast").add(X(e,r)),i.for("downcast").add(Q(e))}}var Ce=i(507);class je extends e.Plugin{static get requires(){return[ne,Ce.Enter]}static get pluginName(){return"HeadingElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(!e.plugins.has("HeadingEditing"))return;const t=e.config.get("heading.options");this.registerHeadingElements(e,t)}registerHeadingElements(e,t){const i=e.plugins.get(ne),r=[];for(const e of t)"model"in e&&"view"in e&&(i.registerBlockElement({view:e.view,model:e.model}),r.push(e.model));i.extendBlockElement({model:"htmlHgroup",modelSchema:{allowChildren:r}}),i.extendBlockElement({model:"htmlSummary",modelSchema:{allowChildren:r}})}}function Pe(e,t,i){const r=e.createRangeOn(t);for(const{item:e}of r.getWalker())if(e.is("element",i))return e}class Fe extends e.Plugin{static get requires(){return[we]}static get pluginName(){return"ImageElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(!e.plugins.has("ImageInlineEditing")&&!e.plugins.has("ImageBlockEditing"))return;const t=e.model.schema,i=e.conversion,r=e.plugins.get(we);r.on("register:figure",()=>{i.for("upcast").add(function(e){return t=>{t.on("element:figure",(t,i,r)=>{const o=i.viewItem;if(!i.modelRange||!o.hasClass("image"))return;const n=e.processViewAttributes(o,r);n&&r.writer.setAttribute("htmlFigureAttributes",n,i.modelRange)},{priority:"low"})}}(r))}),r.on("register:img",(o,n)=>{"imageBlock"!==n.model&&"imageInline"!==n.model||(t.isRegistered("imageBlock")&&t.extend("imageBlock",{allowAttributes:["htmlImgAttributes","htmlFigureAttributes","htmlLinkAttributes"]}),t.isRegistered("imageInline")&&t.extend("imageInline",{allowAttributes:["htmlA","htmlImgAttributes"]}),i.for("upcast").add(function(e){return t=>{t.on("element:img",(t,i,r)=>{if(!i.modelRange)return;const o=i.viewItem,n=e.processViewAttributes(o,r);n&&r.writer.setAttribute("htmlImgAttributes",n,i.modelRange)},{priority:"low"})}}(r)),i.for("downcast").add(e=>{function t(t){e.on(`attribute:${t}:imageInline`,(e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const{attributeOldValue:r,attributeNewValue:o}=t,n=i.mapper.toViewElement(t.item);H(i.writer,r,o,n)},{priority:"low"})}function i(t,i){e.on(`attribute:${i}:imageBlock`,(e,i,r)=>{if(!r.consumable.test(i.item,e.name))return;const{attributeOldValue:o,attributeNewValue:n}=i,l=r.mapper.toViewElement(i.item),s=Pe(r.writer,l,t);s&&(H(r.writer,o,n,s),r.consumable.consume(i.item,e.name))},{priority:"low"}),"a"===t&&e.on("attribute:linkHref:imageBlock",(e,t,i)=>{if(!i.consumable.consume(t.item,"attribute:htmlLinkAttributes:imageBlock"))return;const r=i.mapper.toViewElement(t.item),o=Pe(i.writer,r,"a");V(i.writer,t.item.getAttribute("htmlLinkAttributes"),o)},{priority:"low"})}t("htmlImgAttributes"),i("img","htmlImgAttributes"),i("figure","htmlFigureAttributes"),i("a","htmlLinkAttributes")}),e.plugins.has("LinkImage")&&i.for("upcast").add(function(e,t){const i=t.plugins.get("ImageUtils");return t=>{t.on("element:a",(t,r,o)=>{const n=r.viewItem;if(!i.findViewImgElement(n))return;const l=r.modelCursor.parent;if(!l.is("element","imageBlock"))return;const s=e.processViewAttributes(n,o);s&&o.writer.setAttribute("htmlLinkAttributes",s,l)},{priority:"low"})}}(r,e)),o.stop())})}}class Ie extends e.Plugin{static get requires(){return[we]}static get pluginName(){return"MediaEmbedElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(!e.plugins.has("MediaEmbed")||e.config.get("mediaEmbed.previewsInData"))return;const t=e.model.schema,i=e.conversion,r=this.editor.plugins.get(we),o=this.editor.plugins.get(ne),n=e.config.get("mediaEmbed.elementName");o.registerBlockElement({model:"media",view:n}),r.on("register:figure",()=>{i.for("upcast").add(function(e){return t=>{t.on("element:figure",(t,i,r)=>{const o=i.viewItem;if(!i.modelRange||!o.hasClass("media"))return;const n=e.processViewAttributes(o,r);n&&r.writer.setAttribute("htmlFigureAttributes",n,i.modelRange)},{priority:"low"})}}(r))}),r.on(`register:${n}`,(e,o)=>{"media"===o.model&&(t.extend("media",{allowAttributes:[M(n),"htmlFigureAttributes"]}),i.for("upcast").add(function(e,t){const i=(i,r,o)=>{function n(t,i){const n=e.processViewAttributes(t,o);n&&o.writer.setAttribute(i,n,r.modelRange)}n(r.viewItem,M(t))};return e=>{e.on(`element:${t}`,i,{priority:"low"})}}(r,n)),i.for("dataDowncast").add(function(e){return t=>{function i(e,i){t.on(`attribute:${i}:media`,(t,i,r)=>{if(!r.consumable.consume(i.item,t.name))return;const{attributeOldValue:o,attributeNewValue:n}=i,l=r.mapper.toViewElement(i.item),s=Pe(r.writer,l,e);H(r.writer,o,n,s)})}i(e,M(e)),i("figure","htmlFigureAttributes")}}(n)),e.stop())})}}class $e extends e.Plugin{static get requires(){return[we]}static get pluginName(){return"ScriptElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.plugins.get(we);e.on("register:script",(t,i)=>{const r=this.editor,o=r.model.schema,n=r.conversion;o.register("htmlScript",i.modelSchema),o.extend("htmlScript",{allowAttributes:["htmlScriptAttributes","htmlContent"],isContent:!0}),r.data.registerRawContentMatcher({name:"script"}),n.for("upcast").elementToElement({view:"script",model:U(i)}),n.for("upcast").add(X(i,e)),n.for("downcast").elementToElement({model:"htmlScript",view:(e,{writer:t})=>W("script",e,t)}),n.for("downcast").add(Q(i)),t.stop()})}}const _e=["width","max-width","min-width","height","min-height","max-height"];class Be extends e.Plugin{static get requires(){return[we]}static get pluginName(){return"TableElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(!e.plugins.has("TableEditing"))return;const t=e.model.schema,i=e.conversion,r=e.plugins.get(we),o=e.plugins.get("TableUtils");r.on("register:figure",()=>{i.for("upcast").add(function(e){return t=>{t.on("element:figure",(t,i,r)=>{const o=i.viewItem;if(!i.modelRange||!o.hasClass("table"))return;const n=e.processViewAttributes(o,r);n&&r.writer.setAttribute("htmlFigureAttributes",n,i.modelRange)},{priority:"low"})}}(r))}),r.on("register:table",(n,l)=>{"table"===l.model&&(t.extend("table",{allowAttributes:["htmlTableAttributes","htmlFigureAttributes","htmlTheadAttributes","htmlTbodyAttributes"]}),i.for("upcast").add(function(e){return t=>{t.on("element:table",(t,i,r)=>{if(!i.modelRange)return;const o=i.viewItem;n(o,"htmlTableAttributes");for(const e of o.getChildren())e.is("element","thead")&&n(e,"htmlTheadAttributes"),e.is("element","tbody")&&n(e,"htmlTbodyAttributes");function n(t,o){const n=e.processViewAttributes(t,r);n&&r.writer.setAttribute(o,n,i.modelRange)}},{priority:"low"})}}(r)),i.for("downcast").add(e=>{function t(t,i){e.on(`attribute:${i}:table`,(e,r,o)=>{if(!o.consumable.test(r.item,e.name))return;const n=o.mapper.toViewElement(r.item),l=Pe(o.writer,n,t);if(l)if(o.consumable.consume(r.item,e.name),"htmlTableAttributes"===i&&n!==l){const e=xe(r.attributeOldValue),t=xe(r.attributeNewValue);H(o.writer,e.tableAttributes,t.tableAttributes,l),H(o.writer,e.figureAttributes,t.figureAttributes,n)}else H(o.writer,r.attributeOldValue,r.attributeNewValue,l)})}t("table","htmlTableAttributes"),t("figure","htmlFigureAttributes"),t("thead","htmlTheadAttributes"),t("tbody","htmlTbodyAttributes")}),e.model.document.registerPostFixer(function(e,t){return i=>{const r=e.document.differ.getChanges();let o=!1;for(const e of r){if("attribute"!=e.type||"headingRows"!=e.attributeKey)continue;const r=e.range.start.nodeAfter,n=r.getAttribute("htmlTheadAttributes"),l=r.getAttribute("htmlTbodyAttributes");n&&!e.attributeNewValue?(i.removeAttribute("htmlTheadAttributes",r),o=!0):l&&e.attributeNewValue==t.getRows(r)&&(i.removeAttribute("htmlTbodyAttributes",r),o=!0)}return o}}(e.model,o)),n.stop())})}}function xe(e){const t={},i={...e};if(!e||!("styles"in e))return{figureAttributes:t,tableAttributes:i};i.styles={};for(const[r,o]of Object.entries(e.styles))_e.includes(r)?t.styles={...t.styles,[r]:o}:i.styles={...i.styles,[r]:o};return{figureAttributes:t,tableAttributes:i}}class Te extends e.Plugin{static get requires(){return[we]}static get pluginName(){return"StyleElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.plugins.get(we);e.on("register:style",(t,i)=>{const r=this.editor,o=r.model.schema,n=r.conversion;o.register("htmlStyle",i.modelSchema),o.extend("htmlStyle",{allowAttributes:["htmlStyleAttributes","htmlContent"],isContent:!0}),r.data.registerRawContentMatcher({name:"style"}),n.for("upcast").elementToElement({view:"style",model:U(i)}),n.for("upcast").add(X(i,e)),n.for("downcast").elementToElement({model:"htmlStyle",view:(e,{writer:t})=>W("style",e,t)}),n.for("downcast").add(Q(i)),t.stop()})}}function De(e){if(!e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t))&&"[object Object]"===Object.prototype.toString.call(e)}function Re(e,t,i,r,o,n,l){const s=l(e,t,i,r,o,n);if(void 0!==s)return s;if(typeof e==typeof t)switch(typeof e){case"bigint":case"string":case"boolean":case"symbol":case"undefined":case"function":return e===t;case"number":return e===t||Object.is(e,t);case"object":return Ne(e,t,n,l)}return Ne(e,t,n,l)}function Ne(e,t,i,r){if(Object.is(e,t))return!0;let o=s(e),n=s(t);if(o===d&&(o=A),n===d&&(n=A),o!==n)return!1;switch(o){case m:return e.toString()===t.toString();case c:{const i=e.valueOf(),r=t.valueOf();return(I=i)===($=r)||Number.isNaN(I)&&Number.isNaN($)}case u:case f:case h:return Object.is(e.valueOf(),t.valueOf());case a:return e.source===t.source&&e.flags===t.flags;case"[object Function]":return e===t}var I,$;const _=(i=i??new Map).get(e),B=i.get(t);if(null!=_&&null!=B)return _===t;i.set(e,t),i.set(t,e);try{switch(o){case g:if(e.size!==t.size)return!1;for(const[o,n]of e.entries())if(!t.has(o)||!Re(n,t.get(o),o,e,t,i,r))return!1;return!0;case b:{if(e.size!==t.size)return!1;const o=Array.from(e.values()),n=Array.from(t.values());for(let l=0;l<o.length;l++){const s=o[l],a=n.findIndex(o=>Re(s,o,void 0,e,t,i,r));if(-1===a)return!1;n.splice(a,1)}return!0}case p:case v:case E:case S:case k:case"[object BigUint64Array]":case O:case C:case j:case"[object BigInt64Array]":case P:case F:if("undefined"!=typeof Buffer&&Buffer.isBuffer(e)!==Buffer.isBuffer(t))return!1;if(e.length!==t.length)return!1;for(let o=0;o<e.length;o++)if(!Re(e[o],t[o],o,e,t,i,r))return!1;return!0;case w:return e.byteLength===t.byteLength&&Ne(new Uint8Array(e),new Uint8Array(t),i,r);case y:return e.byteLength===t.byteLength&&e.byteOffset===t.byteOffset&&Ne(new Uint8Array(e),new Uint8Array(t),i,r);case"[object Error]":return e.name===t.name&&e.message===t.message;case A:{if(!(Ne(e.constructor,t.constructor,i,r)||De(e)&&De(t)))return!1;const o=[...Object.keys(e),...l(e)],n=[...Object.keys(t),...l(t)];if(o.length!==n.length)return!1;for(let n=0;n<o.length;n++){const l=o[n],s=e[l];if(!Object.hasOwn(t,l))return!1;if(!Re(s,t[l],l,e,t,i,r))return!1}return!0}default:return!1}}finally{i.delete(e),i.delete(t)}}function He(){}function Ve(e,t){return function(e,t,i){return Re(e,t,void 0,void 0,void 0,void 0,i)}(e,t,He)}class Le extends e.Plugin{static get requires(){return[we]}static get pluginName(){return"ListElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(!e.plugins.has("ListEditing"))return;const t=e.model.schema,i=e.conversion,r=e.plugins.get(we),o=e.plugins.get("ListEditing"),n=e.plugins.get("ListUtils"),l=["ul","ol","li"];o.registerDowncastStrategy({scope:"item",attributeName:"htmlLiAttributes",setAttributeOnDowncast:V}),o.registerDowncastStrategy({scope:"list",attributeName:"htmlUlAttributes",setAttributeOnDowncast:V}),o.registerDowncastStrategy({scope:"list",attributeName:"htmlOlAttributes",setAttributeOnDowncast:V}),r.on("register",(e,o)=>{if(!l.includes(o.view))return;if(e.stop(),t.checkAttribute("$block","htmlLiAttributes"))return;const n=l.map(e=>M(e));t.extend("$listItem",{allowAttributes:n}),i.for("upcast").add(e=>{e.on("element:ul",Me("htmlUlAttributes",r),{priority:"low"}),e.on("element:ol",Me("htmlOlAttributes",r),{priority:"low"}),e.on("element:li",Me("htmlLiAttributes",r),{priority:"low"})})}),o.on("postFixer",(e,{listNodes:t,writer:i})=>{for(const{node:r,previousNodeInList:o}of t)if(o){if(o.getAttribute("listType")==r.getAttribute("listType")){const t=Ue(o.getAttribute("listType")),n=o.getAttribute(t);!Ve(r.getAttribute(t),n)&&i.model.schema.checkAttribute(r,t)&&(i.setAttribute(t,n,r),e.return=!0)}if(o.getAttribute("listItemId")==r.getAttribute("listItemId")){const t=o.getAttribute("htmlLiAttributes");!Ve(r.getAttribute("htmlLiAttributes"),t)&&i.model.schema.checkAttribute(r,"htmlLiAttributes")&&(i.setAttribute("htmlLiAttributes",t,r),e.return=!0)}}}),o.on("postFixer",(e,{listNodes:t,writer:i})=>{for(const{node:r}of t){const t=r.getAttribute("listType");!n.isNumberedListType(t)&&r.getAttribute("htmlOlAttributes")&&(i.removeAttribute("htmlOlAttributes",r),e.return=!0),n.isNumberedListType(t)&&r.getAttribute("htmlUlAttributes")&&(i.removeAttribute("htmlUlAttributes",r),e.return=!0)}})}afterInit(){const e=this.editor;if(!e.commands.get("indentList"))return;const t=e.commands.get("indentList");this.listenTo(t,"afterExecute",(t,i)=>{e.model.change(t=>{for(const r of i){const i=Ue(r.getAttribute("listType"));e.model.schema.checkAttribute(r,i)&&t.setAttribute(i,{},r)}})})}}function Me(e,t){return(i,r,o)=>{const n=r.viewItem;r.modelRange||Object.assign(r,o.convertChildren(r.viewItem,r.modelCursor));const l=t.processViewAttributes(n,o);for(const t of r.modelRange.getItems({shallow:!0}))t.hasAttribute("listItemId")&&(t.hasAttribute("htmlUlAttributes")||t.hasAttribute("htmlOlAttributes")||o.writer.model.schema.checkAttribute(t,e)&&o.writer.setAttribute(e,l||{},t))}}function Ue(e){return"numbered"===e||"customNumbered"==e?"htmlOlAttributes":"htmlUlAttributes"}class ze extends e.Plugin{static get requires(){return[we]}static get pluginName(){return"HorizontalLineElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(!e.plugins.has("HorizontalLineEditing"))return;const t=e.model.schema,i=e.conversion,r=e.plugins.get(we);r.on("register:hr",(e,o)=>{"horizontalLine"===o.model&&(t.extend("horizontalLine",{allowAttributes:["htmlHrAttributes"]}),i.for("upcast").add(X(o,r)),i.for("downcast").add(e=>{e.on("attribute:htmlHrAttributes:horizontalLine",(e,t,i)=>{if(!i.consumable.test(t.item,e.name))return;const{attributeOldValue:r,attributeNewValue:o}=t,n=i.mapper.toViewElement(t.item),l=Pe(i.writer,n,"hr");l&&(H(i.writer,r,o,l),i.consumable.consume(t.item,e.name))},{priority:"low"})}),e.stop())})}}class We extends e.Plugin{static get requires(){return[we,ne]}static get pluginName(){return"CustomElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.plugins.get(we),t=this.editor.plugins.get(ne);e.on("register:$customElement",(i,r)=>{i.stop();const n=this.editor,l=n.model.schema,s=n.conversion,a=n.editing.view.domConverter.unsafeElements,m=n.data.htmlProcessor.domConverter.preElements;l.register(r.model,r.modelSchema),l.extend(r.model,{allowAttributes:["htmlElementName","htmlCustomElementAttributes","htmlContent"],isContent:!0}),n.data.htmlProcessor.domConverter.registerRawContentMatcher({name:"template"}),s.for("upcast").elementToElement({view:/.*/,model:(i,l)=>{if("$comment"==i.name)return null;if(!function(e){try{document.createElement(e)}catch{return!1}return!0}(i.name))return null;if(t.getDefinitionsForView(i.name).size)return null;a.includes(i.name)||a.push(i.name),m.includes(i.name)||m.push(i.name);const s=l.writer.createElement(r.model,{htmlElementName:i.name}),c=e.processViewAttributes(i,l);let u;if(c&&l.writer.setAttribute("htmlCustomElementAttributes",c,s),i.is("element","template")&&i.getCustomProperty("$rawContent"))u=i.getCustomProperty("$rawContent");else{const e=new o.UpcastWriter(i.document).createDocumentFragment(i),t=n.data.htmlProcessor.domConverter.viewToDom(e),r=t.firstChild;for(;r.firstChild;)t.appendChild(r.firstChild);r.remove(),u=n.data.htmlProcessor.htmlWriter.getHtml(t)}l.writer.setAttribute("htmlContent",u,s);for(const{item:e}of n.editing.view.createRangeIn(i))l.consumable.consume(e,{name:!0});return s},converterPriority:"low"}),s.for("editingDowncast").elementToElement({model:{name:r.model,attributes:["htmlElementName","htmlCustomElementAttributes","htmlContent"]},view:(e,{writer:t})=>{const i=e.getAttribute("htmlElementName"),r=t.createRawElement(i);return e.hasAttribute("htmlCustomElementAttributes")&&V(t,e.getAttribute("htmlCustomElementAttributes"),r),r}}),s.for("dataDowncast").elementToElement({model:{name:r.model,attributes:["htmlElementName","htmlCustomElementAttributes","htmlContent"]},view:(e,{writer:t})=>{const i=e.getAttribute("htmlElementName"),r=e.getAttribute("htmlContent"),o=t.createRawElement(i,null,(e,t)=>{t.setContentOf(e,r)});return e.hasAttribute("htmlCustomElementAttributes")&&V(t,e.getAttribute("htmlCustomElementAttributes"),o),o}})})}}class qe extends e.Plugin{static get pluginName(){return"GeneralHtmlSupport"}static get isOfficialPlugin(){return!0}static get requires(){return[we,ke,Oe,je,Fe,Ie,$e,Be,Te,Le,ze,We]}init(){const e=this.editor,t=e.plugins.get(we);t.loadAllowedEmptyElementsConfig(e.config.get("htmlSupport.allowEmpty")||[]),t.loadAllowedConfig(e.config.get("htmlSupport.allow")||[]),t.loadDisallowedConfig(e.config.get("htmlSupport.disallow")||[])}getGhsAttributeNameForElement(e){const t=this.editor.plugins.get("DataSchema"),i=Array.from(t.getDefinitionsForView(e,!1)),r=i.find(e=>e.isInline&&!i[0].isObject);return r?r.model:M(e)}addModelHtmlClass(e,i,r){const o=this.editor.model,n=this.getGhsAttributeNameForElement(e);o.change(e=>{for(const l of Ke(o,r,n))L(e,l,n,"classes",e=>{for(const r of(0,t.toArray)(i))e.add(r)})})}removeModelHtmlClass(e,i,r){const o=this.editor.model,n=this.getGhsAttributeNameForElement(e);o.change(e=>{for(const l of Ke(o,r,n))L(e,l,n,"classes",e=>{for(const r of(0,t.toArray)(i))e.delete(r)})})}setModelHtmlAttributes(e,t,i){const r=this.editor.model,o=this.getGhsAttributeNameForElement(e);r.change(e=>{for(const n of Ke(r,i,o))L(e,n,o,"attributes",e=>{for(const[i,r]of Object.entries(t))e.set(i,r)})})}removeModelHtmlAttributes(e,i,r){const o=this.editor.model,n=this.getGhsAttributeNameForElement(e);o.change(e=>{for(const l of Ke(o,r,n))L(e,l,n,"attributes",e=>{for(const r of(0,t.toArray)(i))e.delete(r)})})}setModelHtmlStyles(e,t,i){const r=this.editor.model,o=this.getGhsAttributeNameForElement(e);r.change(e=>{for(const n of Ke(r,i,o))L(e,n,o,"styles",e=>{for(const[i,r]of Object.entries(t))e.set(i,r)})})}removeModelHtmlStyles(e,i,r){const o=this.editor.model,n=this.getGhsAttributeNameForElement(e);o.change(e=>{for(const l of Ke(o,r,n))L(e,l,n,"styles",e=>{for(const r of(0,t.toArray)(i))e.delete(r)})})}}function*Ke(e,t,i){if(t)if(!(Symbol.iterator in t)&&t.is("documentSelection")&&t.isCollapsed)e.schema.checkAttributeInSelection(t,i)&&(yield t);else for(const r of function(e,t,i){return!(Symbol.iterator in t)&&(t.is("node")||t.is("$text")||t.is("$textProxy"))?e.schema.checkAttribute(t,i)?[e.createRangeOn(t)]:[]:e.schema.getValidRanges(e.createSelection(t).getRanges(),i)}(e,t,i))yield*r.getItems({shallow:!0})}class Ge extends e.Plugin{static get pluginName(){return"HtmlComment"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,i=new Map;e.data.processor.skipComments=!1,e.model.schema.addAttributeCheck((e,t)=>{if(e.endsWith("$root")&&t.startsWith("$comment"))return!0}),e.conversion.for("upcast").elementToMarker({view:"$comment",model:e=>{const r=`$comment:${(0,t.uid)()}`,o=e.getCustomProperty("$rawContent");return i.set(r,o),r}}),e.conversion.for("dataDowncast").markerToElement({model:"$comment",view:(e,{writer:t})=>{let i;for(const t of this.editor.model.document.getRootNames())if(i=this.editor.model.document.getRoot(t),i.hasAttribute(e.markerName))break;const r=e.markerName,o=i.getAttribute(r),n=t.createUIElement("$comment");return t.setCustomProperty("$rawContent",o,n),n}}),e.model.document.registerPostFixer(t=>{let r=!1;const o=e.model.document.differ.getChangedMarkers().filter(e=>e.name.startsWith("$comment:"));for(const e of o){const{oldRange:o,newRange:n}=e.data;if(!o||!n||o.root!=n.root){if(o){const i=o.root;i.hasAttribute(e.name)&&(t.removeAttribute(e.name,i),r=!0)}if(n){const o=n.root;"$graveyard"==o.rootName?(t.removeMarker(e.name),r=!0):o.hasAttribute(e.name)||(t.setAttribute(e.name,i.get(e.name)||"",o),r=!0)}}}return r}),e.data.on("set",()=>{for(const t of e.model.markers.getMarkersGroup("$comment"))this.removeHtmlComment(t.name)},{priority:"high"}),e.model.on("deleteContent",(t,[i])=>{for(const t of i.getRanges()){const i=e.model.schema.getLimitElement(t),r=e.model.createPositionAt(i,0),o=e.model.createPositionAt(i,"end");let n;n=r.isTouching(t.start)&&o.isTouching(t.end)?this.getHtmlCommentsInRange(e.model.createRange(r,o)):this.getHtmlCommentsInRange(t,{skipBoundaries:!0});for(const e of n)this.removeHtmlComment(e)}},{priority:"high"})}createHtmlComment(e,i){const r=(0,t.uid)(),o=this.editor.model,n=o.document.getRoot(e.root.rootName),l=`$comment:${r}`;return o.change(t=>{const r=t.createRange(e);return t.addMarker(l,{usingOperation:!0,affectsData:!0,range:r}),t.setAttribute(l,i,n),l})}removeHtmlComment(e){const t=this.editor,i=t.model.markers.get(e);return!!i&&(t.model.change(e=>{e.removeMarker(i)}),!0)}getHtmlCommentData(e){const t=this.editor.model.markers.get(e);if(!t)return null;let i="";for(const t of this.editor.model.document.getRoots())if(t.hasAttribute(e)){i=t.getAttribute(e);break}return{content:i,position:t.getStart()}}getHtmlCommentsInRange(e,{skipBoundaries:t=!1}={}){const i=!t;return Array.from(this.editor.model.markers.getMarkersGroup("$comment")).filter(t=>function(e,t){const r=e.getRange().start;return(r.isAfter(t.start)||i&&r.isEqual(t.start))&&(r.isBefore(t.end)||i&&r.isEqual(t.end))}(t,e)).map(e=>e.name)}}class Xe extends o.HtmlDataProcessor{toView(e){if(!/<(?:html|body|head|meta)(?:\s[^>]*)?>/i.test(e.trim().slice(0,1e4)))return super.toView(e);let t="",i="";e=(e=e.trim().replace(/<\?xml\s[^?]*\?>/i,e=>(i=e,""))).trim().replace(/^<!DOCTYPE\s[^>]*?>/i,e=>(t=e,""));const r=this._toDom(e),n=this.domConverter.domToView(r,{skipComments:this.skipComments}),l=new o.UpcastWriter(n.document);l.setCustomProperty("$fullPageDocument",r.ownerDocument.documentElement.outerHTML,n);const s=Array.from(r.ownerDocument.querySelectorAll("head style"));return l.setCustomProperty("$fullPageHeadStyles",s,n),t&&l.setCustomProperty("$fullPageDocType",t,n),i&&l.setCustomProperty("$fullPageXmlDeclaration",i,n),n}toData(e){let t=super.toData(e);const i=e.getCustomProperty("$fullPageDocument"),r=e.getCustomProperty("$fullPageDocType"),o=e.getCustomProperty("$fullPageXmlDeclaration");return i&&(t=i.replace(/<\/body\s*>/,t+"$&"),r&&(t=r+"\n"+t),o&&(t=o+"\n"+t)),t}}class Qe extends e.Plugin{static get pluginName(){return"FullPage"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define("htmlSupport.fullPage",{allowRenderStylesFromHead:!1,sanitizeCss:e=>((0,t.logWarning)("css-full-page-provide-sanitize-function"),{css:e,hasChanged:!1})}),e.data.processor=new Xe(e.data.viewDocument)}init(){const e=this.editor,t=["$fullPageDocument","$fullPageDocType","$fullPageXmlDeclaration","$fullPageHeadStyles"];e.model.schema.extend("$root",{allowAttributes:t}),e.data.on("toModel",(i,[r])=>{const o=e.model.document.getRoot();e.model.change(e=>{for(const i of t){const t=r.getCustomProperty(i);t&&e.setAttribute(i,t,o)}}),Ye(e)&&this._renderStylesFromHead(o)},{priority:"low"}),e.data.on("toView",(e,[i])=>{if(!i.is("rootElement"))return;const r=i,n=e.return;if(!r.hasAttribute("$fullPageDocument"))return;const l=new o.UpcastWriter(n.document);for(const e of t){const t=r.getAttribute(e);t&&l.setCustomProperty(e,t,n)}},{priority:"low"}),e.data.on("set",()=>{const i=e.model.document.getRoot();e.model.change(e=>{for(const r of t)i.hasAttribute(r)&&e.removeAttribute(r,i)})},{priority:"high"}),e.data.on("get",(e,t)=>{t[0]||(t[0]={}),t[0].trim=!1},{priority:"high"})}destroy(){super.destroy(),Ye(this.editor)&&this._removeStyleElementsFromDom()}_removeStyleElementsFromDom(){const e=Array.from(t.global.document.querySelectorAll(`[data-full-page-style-id="${this.editor.id}"]`));for(const t of e)t.remove()}_renderStyleElementsInDom(e){const i=this.editor,r=e.getAttribute("$fullPageHeadStyles");if(!r)return;const o=i.config.get("htmlSupport.fullPage.sanitizeCss");for(const e of r){e.setAttribute("data-full-page-style-id",i.id);const r=o(e.innerText);r.hasChanged&&(e.innerText=r.css),t.global.document.head.append(e)}}_renderStylesFromHead(e){this._removeStyleElementsFromDom(),this._renderStyleElementsInDom(e)}}function Ye(e){return e.config.get("htmlSupport.fullPage.allowRenderStylesFromHead")}const Je="htmlEmptyBlock";class Ze extends e.Plugin{static get pluginName(){return"EmptyBlock"}static get isOfficialPlugin(){return!0}afterInit(){const{model:e,conversion:t,plugins:i,config:r}=this.editor,o=e.schema,n=r.get("htmlSupport.preserveEmptyBlocksInEditingView");o.extend("$block",{allowAttributes:[Je]}),o.extend("$container",{allowAttributes:[Je]}),o.isRegistered("tableCell")&&o.extend("tableCell",{allowAttributes:[Je]}),n?t.for("downcast").add(et()):t.for("dataDowncast").add(et()),t.for("upcast").add(function(e){return t=>{t.on("element",(t,i,r)=>{const{viewItem:o,modelRange:n}=i;if(!o.is("element")||!o.isEmpty||o.getCustomProperty("$hasBlockFiller"))return;const l=n&&n.start.nodeAfter;if(!l||!e.checkAttribute(l,Je))return;if(r.writer.setAttribute(Je,!0,l),1!=l.childCount)return;const s=l.getChild(0);s.is("element","paragraph")&&e.checkAttribute(s,Je)&&r.writer.setAttribute(Je,!0,s)},{priority:"lowest"})}}(o)),i.has("ClipboardPipeline")&&this._registerClipboardPastingHandler()}_registerClipboardPastingHandler(){const e=this.editor.plugins.get("ClipboardPipeline");this.listenTo(e,"contentInsertion",(e,t)=>{t.sourceEditorId!==this.editor.id&&this.editor.model.change(e=>{for(const{item:i}of e.createRangeIn(t.content))i.is("element")&&i.hasAttribute(Je)&&e.removeAttribute(Je,i)})})}}function et(){return e=>{e.on(`attribute:${Je}`,(e,t,i)=>{const{mapper:r,consumable:o}=i,{item:n}=t;if(!o.consume(n,e.name))return;const l=r.toViewElement(n);l&&t.attributeNewValue&&(l.getFillerOffset=()=>null)})}}})(),(window.CKEditor5=window.CKEditor5||{}).htmlSupport=r})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-html-support",
3
- "version": "45.2.1-alpha.3",
3
+ "version": "45.2.1-alpha.5",
4
4
  "description": "HTML Support feature for CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -17,16 +17,16 @@
17
17
  "type": "module",
18
18
  "main": "src/index.js",
19
19
  "dependencies": {
20
- "@ckeditor/ckeditor5-core": "45.2.1-alpha.3",
21
- "@ckeditor/ckeditor5-engine": "45.2.1-alpha.3",
22
- "@ckeditor/ckeditor5-enter": "45.2.1-alpha.3",
23
- "@ckeditor/ckeditor5-heading": "45.2.1-alpha.3",
24
- "@ckeditor/ckeditor5-image": "45.2.1-alpha.3",
25
- "@ckeditor/ckeditor5-list": "45.2.1-alpha.3",
26
- "@ckeditor/ckeditor5-table": "45.2.1-alpha.3",
27
- "@ckeditor/ckeditor5-utils": "45.2.1-alpha.3",
28
- "@ckeditor/ckeditor5-widget": "45.2.1-alpha.3",
29
- "ckeditor5": "45.2.1-alpha.3",
20
+ "@ckeditor/ckeditor5-core": "45.2.1-alpha.5",
21
+ "@ckeditor/ckeditor5-engine": "45.2.1-alpha.5",
22
+ "@ckeditor/ckeditor5-enter": "45.2.1-alpha.5",
23
+ "@ckeditor/ckeditor5-heading": "45.2.1-alpha.5",
24
+ "@ckeditor/ckeditor5-image": "45.2.1-alpha.5",
25
+ "@ckeditor/ckeditor5-list": "45.2.1-alpha.5",
26
+ "@ckeditor/ckeditor5-table": "45.2.1-alpha.5",
27
+ "@ckeditor/ckeditor5-utils": "45.2.1-alpha.5",
28
+ "@ckeditor/ckeditor5-widget": "45.2.1-alpha.5",
29
+ "ckeditor5": "45.2.1-alpha.5",
30
30
  "es-toolkit": "1.32.0"
31
31
  },
32
32
  "author": "CKSource (http://cksource.com/)",