Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ckeditor/ckeditor5-html-support

Package Overview
Dependencies
Maintainers
1
Versions
667
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ckeditor/ckeditor5-html-support - npm Package Compare versions

Comparing version 33.0.0 to 34.0.0

build/translations/en-au.js

2

build/html-support.js

@@ -5,2 +5,2 @@ !function(t){const e=t.en=t.en||{};e.dictionary=Object.assign(e.dictionary||{},{"HTML object":"HTML object"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})),

* For licensing, see LICENSE.md.
*/(()=>{var t={142:(t,e,o)=>{"use strict";o.d(e,{Z:()=>i});var r=o(609),n=o.n(r)()((function(t){return t[1]}));n.push([t.id,":root{--ck-html-object-embed-unfocused-outline-width:1px}.ck-widget.html-object-embed{font-size:var(--ck-font-size-base);background-color:var(--ck-color-base-foreground);padding:var(--ck-spacing-small);padding-top:calc(var(--ck-font-size-tiny) + var(--ck-spacing-large));min-width:calc(76px + var(--ck-spacing-standard))}.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{font-weight:400;font-style:normal;position:absolute;content:attr(data-html-object-embed-label);top:0;left:var(--ck-spacing-standard);background:#999;transition:background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);padding:calc(var(--ck-spacing-tiny) + var(--ck-html-object-embed-unfocused-outline-width)) var(--ck-spacing-small) var(--ck-spacing-tiny);border-radius:0 0 var(--ck-border-radius) var(--ck-border-radius);color:var(--ck-color-base-background);font-size:var(--ck-font-size-tiny);font-family:var(--ck-font-face)}.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 i=n},609:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var o=t(e);return e[2]?"@media ".concat(e[2]," {").concat(o,"}"):o})).join("")},e.i=function(t,o,r){"string"==typeof t&&(t=[[null,t,""]]);var n={};if(r)for(var i=0;i<this.length;i++){var l=this[i][0];null!=l&&(n[l]=!0)}for(var c=0;c<t.length;c++){var s=[].concat(t[c]);r&&n[s[0]]||(o&&(s[2]?s[2]="".concat(o," and ").concat(s[2]):s[2]=o),e.push(s))}},e}},62:(t,e,o)=>{"use strict";var r,n=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},i=function(){var t={};return function(e){if(void 0===t[e]){var o=document.querySelector(e);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement)try{o=o.contentDocument.head}catch(t){o=null}t[e]=o}return t[e]}}(),l=[];function c(t){for(var e=-1,o=0;o<l.length;o++)if(l[o].identifier===t){e=o;break}return e}function s(t,e){for(var o={},r=[],n=0;n<t.length;n++){var i=t[n],s=e.base?i[0]+e.base:i[0],a=o[s]||0,m="".concat(s," ").concat(a);o[s]=a+1;var u=c(m),d={css:i[1],media:i[2],sourceMap:i[3]};-1!==u?(l[u].references++,l[u].updater(d)):l.push({identifier:m,updater:p(d,e),references:1}),r.push(m)}return r}function a(t){var e=document.createElement("style"),r=t.attributes||{};if(void 0===r.nonce){var n=o.nc;n&&(r.nonce=n)}if(Object.keys(r).forEach((function(t){e.setAttribute(t,r[t])})),"function"==typeof t.insert)t.insert(e);else{var l=i(t.insert||"head");if(!l)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");l.appendChild(e)}return e}var m,u=(m=[],function(t,e){return m[t]=e,m.filter(Boolean).join("\n")});function d(t,e,o,r){var n=o?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(t.styleSheet)t.styleSheet.cssText=u(e,n);else{var i=document.createTextNode(n),l=t.childNodes;l[e]&&t.removeChild(l[e]),l.length?t.insertBefore(i,l[e]):t.appendChild(i)}}function h(t,e,o){var r=o.css,n=o.media,i=o.sourceMap;if(n?t.setAttribute("media",n):t.removeAttribute("media"),i&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),t.styleSheet)t.styleSheet.cssText=r;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(r))}}var f=null,b=0;function p(t,e){var o,r,n;if(e.singleton){var i=b++;o=f||(f=a(e)),r=d.bind(null,o,i,!1),n=d.bind(null,o,i,!0)}else o=a(e),r=h.bind(null,o,e),n=function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(o)};return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else n()}}t.exports=function(t,e){(e=e||{}).singleton||"boolean"==typeof e.singleton||(e.singleton=n());var o=s(t=t||[],e);return function(t){if(t=t||[],"[object Array]"===Object.prototype.toString.call(t)){for(var r=0;r<o.length;r++){var n=c(o[r]);l[n].references--}for(var i=s(t,e),a=0;a<o.length;a++){var m=c(o[a]);0===l[m].references&&(l[m].updater(),l.splice(m,1))}o=i}}}},704:(t,e,o)=>{t.exports=o(79)("./src/core.js")},492:(t,e,o)=>{t.exports=o(79)("./src/engine.js")},209:(t,e,o)=>{t.exports=o(79)("./src/utils.js")},995:(t,e,o)=>{t.exports=o(79)("./src/widget.js")},79:t=>{"use strict";t.exports=CKEditor5.dll}},e={};function o(r){var n=e[r];if(void 0!==n)return n.exports;var i=e[r]={id:r,exports:{}};return t[r](i,i.exports,o),i.exports}o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{for(var r in e)o.o(e,r)&&!o.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};(()=>{"use strict";o.r(r),o.d(r,{DataFilter:()=>br,DataSchema:()=>Ne,GeneralHtmlSupport:()=>Ir,HtmlComment:()=>xr});var t=o(704),e=o(209);const n=[{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:"caption",view:"caption"},{model:"caption",view:"figcaption"},{model:"imageBlock",view:"img"},{model:"imageInline",view:"img"},{model:"$htmlSection",modelSchema:{allowChildren:"$block",allowIn:["$root","$htmlSection"],isBlock:!0}},{model:"htmlP",view:"p",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlBlockquote",view:"blockquote",modelSchema:{inheritAllFrom:"$htmlSection"}},{model:"htmlTable",view:"table",modelSchema:{allowIn:["$htmlSection","$root"],isBlock:!0}},{model:"htmlTbody",view:"tbody",modelSchema:{allowIn:"htmlTable",isBlock:!0}},{model:"htmlThead",view:"thead",modelSchema:{allowIn:"htmlTable",isBlock:!0}},{model:"htmlTfoot",view:"tfoot",modelSchema:{allowIn:"htmlTable",isBlock:!0}},{model:"htmlCaption",view:"caption",modelSchema:{allowIn:"htmlTable",allowChildren:"$text",isBlock:!0}},{model:"htmlTr",view:"tr",modelSchema:{allowIn:["htmlTable","htmlThead","htmlTbody"],isBlock:!0}},{model:"htmlTd",view:"td",modelSchema:{allowIn:"htmlTr",allowChildren:["$block","$htmlSection"],isBlock:!0}},{model:"htmlTh",view:"th",modelSchema:{allowIn:"htmlTr",allowChildren:["$block","$htmlSection"],isBlock:!0}},{model:"htmlFigure",view:"figure",modelSchema:{inheritAllFrom:"$htmlSection",isBlock:!0}},{model:"htmlFigcaption",view:"figcaption",modelSchema:{allowIn:"htmlFigure",allowChildren:"$text",isBlock:!0}},{model:"htmlAddress",view:"address",modelSchema:{inheritAllFrom:"$htmlSection"}},{model:"htmlAside",view:"aside",modelSchema:{inheritAllFrom:"$htmlSection"}},{model:"htmlMain",view:"main",modelSchema:{inheritAllFrom:"$htmlSection"}},{model:"htmlDetails",view:"details",modelSchema:{inheritAllFrom:"$htmlSection"}},{model:"htmlSummary",view:"summary",modelSchema:{allowChildren:"$text",allowIn:"htmlDetails",isBlock:!0}},{model:"htmlDiv",view:"div",paragraphLikeModel:"htmlDivParagraph",modelSchema:{inheritAllFrom:"$htmlSection"}},{model:"htmlFieldset",view:"fieldset",modelSchema:{inheritAllFrom:"$htmlSection"}},{model:"htmlLegend",view:"legend",modelSchema:{allowIn:"htmlFieldset",allowChildren:"$text"}},{model:"htmlHeader",view:"header",modelSchema:{inheritAllFrom:"$htmlSection"}},{model:"htmlFooter",view:"footer",modelSchema:{inheritAllFrom:"$htmlSection"}},{model:"htmlForm",view:"form",modelSchema:{inheritAllFrom:"$htmlSection"}},{model:"htmlHgroup",view:"hgroup",modelSchema:{allowChildren:["htmlH1","htmlH2","htmlH3","htmlH4","htmlH5","htmlH6"],isBlock:!0}},{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:"$htmlSection",allowChildren:["$htmlList","htmlLi"],isBlock:!0}},{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:!0}},{model:"htmlPre",view:"pre",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlArticle",view:"article",modelSchema:{inheritAllFrom:"$htmlSection"}},{model:"htmlSection",view:"section",modelSchema:{inheritAllFrom:"$htmlSection"}},{model:"htmlNav",view:"nav",modelSchema:{inheritAllFrom:"$htmlSection"}},{model:"htmlDl",view:"dl",modelSchema:{allowIn:["$htmlSection","$root"],allowChildren:["htmlDt","htmlDd"],isBlock:!0}},{model:"htmlDt",view:"dt",modelSchema:{allowChildren:"$block",isBlock:!0}},{model:"htmlDd",view:"dd",modelSchema:{allowChildren:"$block",isBlock:!0}},{model:"htmlCenter",view:"center",modelSchema:{inheritAllFrom:"$htmlSection"}},{model:"$htmlObjectBlock",isObject:!0,modelSchema:{isObject:!0,isBlock:!0,allowWhere:"$block"}}],i=[{model:"htmlAcronym",view:"acronym",attributeProperties:{copyOnEnter:!0}},{model:"htmlTt",view:"tt",attributeProperties:{copyOnEnter:!0}},{model:"htmlFont",view:"font",attributeProperties:{copyOnEnter:!0}},{model:"htmlTime",view:"time",attributeProperties:{copyOnEnter:!0}},{model:"htmlVar",view:"var",attributeProperties:{copyOnEnter:!0}},{model:"htmlBig",view:"big",attributeProperties:{copyOnEnter:!0}},{model:"htmlSmall",view:"small",attributeProperties:{copyOnEnter:!0}},{model:"htmlSamp",view:"samp",attributeProperties:{copyOnEnter:!0}},{model:"htmlQ",view:"q",attributeProperties:{copyOnEnter:!0}},{model:"htmlOutput",view:"output",attributeProperties:{copyOnEnter:!0}},{model:"htmlKbd",view:"kbd",attributeProperties:{copyOnEnter:!0}},{model:"htmlBdi",view:"bdi",attributeProperties:{copyOnEnter:!0}},{model:"htmlBdo",view:"bdo",attributeProperties:{copyOnEnter:!0}},{model:"htmlAbbr",view:"abbr",attributeProperties:{copyOnEnter:!0}},{model:"htmlA",view:"a",priority:5,attributeProperties:{copyOnEnter:!0}},{model:"htmlStrong",view:"strong",attributeProperties:{copyOnEnter:!0}},{model:"htmlB",view:"b",attributeProperties:{copyOnEnter:!0}},{model:"htmlI",view:"i",attributeProperties:{copyOnEnter:!0}},{model:"htmlEm",view:"em",attributeProperties:{copyOnEnter:!0}},{model:"htmlS",view:"s",attributeProperties:{copyOnEnter:!0}},{model:"htmlDel",view:"del",attributeProperties:{copyOnEnter:!0}},{model:"htmlIns",view:"ins",attributeProperties:{copyOnEnter:!0}},{model:"htmlU",view:"u",attributeProperties:{copyOnEnter:!0}},{model:"htmlSub",view:"sub",attributeProperties:{copyOnEnter:!0}},{model:"htmlSup",view:"sup",attributeProperties:{copyOnEnter:!0}},{model:"htmlCode",view:"code",attributeProperties:{copyOnEnter:!0}},{model:"htmlMark",view:"mark",attributeProperties:{copyOnEnter:!0}},{model:"htmlSpan",view:"span",attributeProperties:{copyOnEnter:!0}},{model:"htmlCite",view:"cite",attributeProperties:{copyOnEnter:!0}},{model:"htmlLabel",view:"label",attributeProperties:{copyOnEnter:!0}},{model:"htmlDfn",view:"dfn",attributeProperties:{copyOnEnter:!0}},{model:"$htmlObjectInline",isObject:!0,modelSchema:{isObject:!0,isInline:!0,allowWhere:"$text",allowAttributesOf:"$text"}},{model:"htmlObject",view:"object",isObject:!0,modelSchema:{inheritAllFrom:"$htmlObjectInline"}},{model:"htmlIframe",view:"iframe",isObject:!0,modelSchema:{inheritAllFrom:"$htmlObjectInline"}},{model:"htmlInput",view:"input",isObject:!0,modelSchema:{inheritAllFrom:"$htmlObjectInline"}},{model:"htmlButton",view:"button",isObject:!0,modelSchema:{inheritAllFrom:"$htmlObjectInline"}},{model:"htmlTextarea",view:"textarea",isObject:!0,modelSchema:{inheritAllFrom:"$htmlObjectInline"}},{model:"htmlSelect",view:"select",isObject:!0,modelSchema:{inheritAllFrom:"$htmlObjectInline"}},{model:"htmlVideo",view:"video",isObject:!0,modelSchema:{inheritAllFrom:"$htmlObjectInline"}},{model:"htmlEmbed",view:"embed",isObject:!0,modelSchema:{inheritAllFrom:"$htmlObjectInline"}},{model:"htmlOembed",view:"oembed",isObject:!0,modelSchema:{inheritAllFrom:"$htmlObjectInline"}},{model:"htmlAudio",view:"audio",isObject:!0,modelSchema:{inheritAllFrom:"$htmlObjectInline"}},{model:"htmlImg",view:"img",isObject:!0,modelSchema:{inheritAllFrom:"$htmlObjectInline"}},{model:"htmlCanvas",view:"canvas",isObject:!0,modelSchema:{inheritAllFrom:"$htmlObjectInline"}},{model:"htmlMeter",view:"meter",isObject:!0,modelSchema:{inheritAllFrom:"$htmlObjectInline"}},{model:"htmlProgress",view:"progress",isObject:!0,modelSchema:{inheritAllFrom:"$htmlObjectInline"}},{model:"htmlScript",view:"script",modelSchema:{allowWhere:["$text","$block"],isInline:!0}},{model:"htmlStyle",view:"style",modelSchema:{allowWhere:["$text","$block"],isInline:!0}}];const l=function(){this.__data__=[],this.size=0};const c=function(t,e){return t===e||t!=t&&e!=e};const s=function(t,e){for(var o=t.length;o--;)if(c(t[o][0],e))return o;return-1};var a=Array.prototype.splice;const m=function(t){var e=this.__data__,o=s(e,t);return!(o<0)&&(o==e.length-1?e.pop():a.call(e,o,1),--this.size,!0)};const u=function(t){var e=this.__data__,o=s(e,t);return o<0?void 0:e[o][1]};const d=function(t){return s(this.__data__,t)>-1};const h=function(t,e){var o=this.__data__,r=s(o,t);return r<0?(++this.size,o.push([t,e])):o[r][1]=e,this};function f(t){var e=-1,o=null==t?0:t.length;for(this.clear();++e<o;){var r=t[e];this.set(r[0],r[1])}}f.prototype.clear=l,f.prototype.delete=m,f.prototype.get=u,f.prototype.has=d,f.prototype.set=h;const b=f;const p=function(){this.__data__=new b,this.size=0};const v=function(t){var e=this.__data__,o=e.delete(t);return this.size=e.size,o};const g=function(t){return this.__data__.get(t)};const w=function(t){return this.__data__.has(t)};const y="object"==typeof global&&global&&global.Object===Object&&global;var A="object"==typeof self&&self&&self.Object===Object&&self;const j=y||A||Function("return this")();const _=j.Symbol;var S=Object.prototype,O=S.hasOwnProperty,k=S.toString,E=_?_.toStringTag:void 0;const $=function(t){var e=O.call(t,E),o=t[E];try{t[E]=void 0;var r=!0}catch(t){}var n=k.call(t);return r&&(e?t[E]=o:delete t[E]),n};var C=Object.prototype.toString;const I=function(t){return C.call(t)};var x=_?_.toStringTag:void 0;const F=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":x&&x in Object(t)?$(t):I(t)};const P=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)};const T=function(t){if(!P(t))return!1;var e=F(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e};const B=j["__core-js_shared__"];var R,M=(R=/[^.]+$/.exec(B&&B.keys&&B.keys.IE_PROTO||""))?"Symbol(src)_1."+R:"";const D=function(t){return!!M&&M in t};var H=Function.prototype.toString;const L=function(t){if(null!=t){try{return H.call(t)}catch(t){}try{return t+""}catch(t){}}return""};var z=/^\[object .+?Constructor\]$/,N=Function.prototype,V=Object.prototype,U=N.toString,q=V.hasOwnProperty,W=RegExp("^"+U.call(q).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const K=function(t){return!(!P(t)||D(t))&&(T(t)?W:z).test(L(t))};const G=function(t,e){return null==t?void 0:t[e]};const Z=function(t,e){var o=G(t,e);return K(o)?o:void 0};const Q=Z(j,"Map");const J=Z(Object,"create");const X=function(){this.__data__=J?J(null):{},this.size=0};const Y=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e};var tt=Object.prototype.hasOwnProperty;const et=function(t){var e=this.__data__;if(J){var o=e[t];return"__lodash_hash_undefined__"===o?void 0:o}return tt.call(e,t)?e[t]:void 0};var ot=Object.prototype.hasOwnProperty;const rt=function(t){var e=this.__data__;return J?void 0!==e[t]:ot.call(e,t)};const nt=function(t,e){var o=this.__data__;return this.size+=this.has(t)?0:1,o[t]=J&&void 0===e?"__lodash_hash_undefined__":e,this};function it(t){var e=-1,o=null==t?0:t.length;for(this.clear();++e<o;){var r=t[e];this.set(r[0],r[1])}}it.prototype.clear=X,it.prototype.delete=Y,it.prototype.get=et,it.prototype.has=rt,it.prototype.set=nt;const lt=it;const ct=function(){this.size=0,this.__data__={hash:new lt,map:new(Q||b),string:new lt}};const st=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};const at=function(t,e){var o=t.__data__;return st(e)?o["string"==typeof e?"string":"hash"]:o.map};const mt=function(t){var e=at(this,t).delete(t);return this.size-=e?1:0,e};const ut=function(t){return at(this,t).get(t)};const dt=function(t){return at(this,t).has(t)};const ht=function(t,e){var o=at(this,t),r=o.size;return o.set(t,e),this.size+=o.size==r?0:1,this};function ft(t){var e=-1,o=null==t?0:t.length;for(this.clear();++e<o;){var r=t[e];this.set(r[0],r[1])}}ft.prototype.clear=ct,ft.prototype.delete=mt,ft.prototype.get=ut,ft.prototype.has=dt,ft.prototype.set=ht;const bt=ft;const pt=function(t,e){var o=this.__data__;if(o instanceof b){var r=o.__data__;if(!Q||r.length<199)return r.push([t,e]),this.size=++o.size,this;o=this.__data__=new bt(r)}return o.set(t,e),this.size=o.size,this};function vt(t){var e=this.__data__=new b(t);this.size=e.size}vt.prototype.clear=p,vt.prototype.delete=v,vt.prototype.get=g,vt.prototype.has=w,vt.prototype.set=pt;const gt=vt;const wt=function(){try{var t=Z(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();const yt=function(t,e,o){"__proto__"==e&&wt?wt(t,e,{configurable:!0,enumerable:!0,value:o,writable:!0}):t[e]=o};const At=function(t,e,o){(void 0!==o&&!c(t[e],o)||void 0===o&&!(e in t))&&yt(t,e,o)};const jt=function(t){return function(e,o,r){for(var n=-1,i=Object(e),l=r(e),c=l.length;c--;){var s=l[t?c:++n];if(!1===o(i[s],s,i))break}return e}}();var _t="object"==typeof exports&&exports&&!exports.nodeType&&exports,St=_t&&"object"==typeof module&&module&&!module.nodeType&&module,Ot=St&&St.exports===_t?j.Buffer:void 0,kt=Ot?Ot.allocUnsafe:void 0;const Et=function(t,e){if(e)return t.slice();var o=t.length,r=kt?kt(o):new t.constructor(o);return t.copy(r),r};const $t=j.Uint8Array;const Ct=function(t){var e=new t.constructor(t.byteLength);return new $t(e).set(new $t(t)),e};const It=function(t,e){var o=e?Ct(t.buffer):t.buffer;return new t.constructor(o,t.byteOffset,t.length)};const xt=function(t,e){var o=-1,r=t.length;for(e||(e=Array(r));++o<r;)e[o]=t[o];return e};var Ft=Object.create;const Pt=function(){function t(){}return function(e){if(!P(e))return{};if(Ft)return Ft(e);t.prototype=e;var o=new t;return t.prototype=void 0,o}}();const Tt=function(t,e){return function(o){return t(e(o))}};const Bt=Tt(Object.getPrototypeOf,Object);var Rt=Object.prototype;const Mt=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Rt)};const Dt=function(t){return"function"!=typeof t.constructor||Mt(t)?{}:Pt(Bt(t))};const Ht=function(t){return null!=t&&"object"==typeof t};const Lt=function(t){return Ht(t)&&"[object Arguments]"==F(t)};var zt=Object.prototype,Nt=zt.hasOwnProperty,Vt=zt.propertyIsEnumerable;const Ut=Lt(function(){return arguments}())?Lt:function(t){return Ht(t)&&Nt.call(t,"callee")&&!Vt.call(t,"callee")};const qt=Array.isArray;const Wt=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991};const Kt=function(t){return null!=t&&Wt(t.length)&&!T(t)};const Gt=function(t){return Ht(t)&&Kt(t)};const Zt=function(){return!1};var Qt="object"==typeof exports&&exports&&!exports.nodeType&&exports,Jt=Qt&&"object"==typeof module&&module&&!module.nodeType&&module,Xt=Jt&&Jt.exports===Qt?j.Buffer:void 0;const Yt=(Xt?Xt.isBuffer:void 0)||Zt;var te=Function.prototype,ee=Object.prototype,oe=te.toString,re=ee.hasOwnProperty,ne=oe.call(Object);const ie=function(t){if(!Ht(t)||"[object Object]"!=F(t))return!1;var e=Bt(t);if(null===e)return!0;var o=re.call(e,"constructor")&&e.constructor;return"function"==typeof o&&o instanceof o&&oe.call(o)==ne};var le={};le["[object Float32Array]"]=le["[object Float64Array]"]=le["[object Int8Array]"]=le["[object Int16Array]"]=le["[object Int32Array]"]=le["[object Uint8Array]"]=le["[object Uint8ClampedArray]"]=le["[object Uint16Array]"]=le["[object Uint32Array]"]=!0,le["[object Arguments]"]=le["[object Array]"]=le["[object ArrayBuffer]"]=le["[object Boolean]"]=le["[object DataView]"]=le["[object Date]"]=le["[object Error]"]=le["[object Function]"]=le["[object Map]"]=le["[object Number]"]=le["[object Object]"]=le["[object RegExp]"]=le["[object Set]"]=le["[object String]"]=le["[object WeakMap]"]=!1;const ce=function(t){return Ht(t)&&Wt(t.length)&&!!le[F(t)]};const se=function(t){return function(e){return t(e)}};var ae="object"==typeof exports&&exports&&!exports.nodeType&&exports,me=ae&&"object"==typeof module&&module&&!module.nodeType&&module,ue=me&&me.exports===ae&&y.process;const de=function(){try{var t=me&&me.require&&me.require("util").types;return t||ue&&ue.binding&&ue.binding("util")}catch(t){}}();var he=de&&de.isTypedArray;const fe=he?se(he):ce;const be=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]};var pe=Object.prototype.hasOwnProperty;const ve=function(t,e,o){var r=t[e];pe.call(t,e)&&c(r,o)&&(void 0!==o||e in t)||yt(t,e,o)};const ge=function(t,e,o,r){var n=!o;o||(o={});for(var i=-1,l=e.length;++i<l;){var c=e[i],s=r?r(o[c],t[c],c,o,t):void 0;void 0===s&&(s=t[c]),n?yt(o,c,s):ve(o,c,s)}return o};const we=function(t,e){for(var o=-1,r=Array(t);++o<t;)r[o]=e(o);return r};var ye=/^(?:0|[1-9]\d*)$/;const Ae=function(t,e){var o=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==o||"symbol"!=o&&ye.test(t))&&t>-1&&t%1==0&&t<e};var je=Object.prototype.hasOwnProperty;const _e=function(t,e){var o=qt(t),r=!o&&Ut(t),n=!o&&!r&&Yt(t),i=!o&&!r&&!n&&fe(t),l=o||r||n||i,c=l?we(t.length,String):[],s=c.length;for(var a in t)!e&&!je.call(t,a)||l&&("length"==a||n&&("offset"==a||"parent"==a)||i&&("buffer"==a||"byteLength"==a||"byteOffset"==a)||Ae(a,s))||c.push(a);return c};const Se=function(t){var e=[];if(null!=t)for(var o in Object(t))e.push(o);return e};var Oe=Object.prototype.hasOwnProperty;const ke=function(t){if(!P(t))return Se(t);var e=Mt(t),o=[];for(var r in t)("constructor"!=r||!e&&Oe.call(t,r))&&o.push(r);return o};const Ee=function(t){return Kt(t)?_e(t,!0):ke(t)};const $e=function(t){return ge(t,Ee(t))};const Ce=function(t,e,o,r,n,i,l){var c=be(t,o),s=be(e,o),a=l.get(s);if(a)At(t,o,a);else{var m=i?i(c,s,o+"",t,e,l):void 0,u=void 0===m;if(u){var d=qt(s),h=!d&&Yt(s),f=!d&&!h&&fe(s);m=s,d||h||f?qt(c)?m=c:Gt(c)?m=xt(c):h?(u=!1,m=Et(s,!0)):f?(u=!1,m=It(s,!0)):m=[]:ie(s)||Ut(s)?(m=c,Ut(c)?m=$e(c):P(c)&&!T(c)||(m=Dt(s))):u=!1}u&&(l.set(s,m),n(m,s,r,i,l),l.delete(s)),At(t,o,m)}};const Ie=function t(e,o,r,n,i){e!==o&&jt(o,(function(l,c){if(i||(i=new gt),P(l))Ce(e,o,c,r,t,n,i);else{var s=n?n(be(e,c),l,c+"",e,o,i):void 0;void 0===s&&(s=l),At(e,c,s)}}),Ee)};const xe=function(t){return t};const Fe=function(t,e,o){switch(o.length){case 0:return t.call(e);case 1:return t.call(e,o[0]);case 2:return t.call(e,o[0],o[1]);case 3:return t.call(e,o[0],o[1],o[2])}return t.apply(e,o)};var Pe=Math.max;const Te=function(t,e,o){return e=Pe(void 0===e?t.length-1:e,0),function(){for(var r=arguments,n=-1,i=Pe(r.length-e,0),l=Array(i);++n<i;)l[n]=r[e+n];n=-1;for(var c=Array(e+1);++n<e;)c[n]=r[n];return c[e]=o(l),Fe(t,this,c)}};const Be=function(t){return function(){return t}};const Re=wt?function(t,e){return wt(t,"toString",{configurable:!0,enumerable:!1,value:Be(e),writable:!0})}:xe;var Me=Date.now;const De=function(t){var e=0,o=0;return function(){var r=Me(),n=16-(r-o);if(o=r,n>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(Re);const He=function(t,e){return De(Te(t,e,xe),t+"")};const Le=function(t,e,o){if(!P(o))return!1;var r=typeof e;return!!("number"==r?Kt(o)&&Ae(e,o.length):"string"==r&&e in o)&&c(o[e],t)};const ze=function(t){return He((function(e,o){var r=-1,n=o.length,i=n>1?o[n-1]:void 0,l=n>2?o[2]:void 0;for(i=t.length>3&&"function"==typeof i?(n--,i):void 0,l&&Le(o[0],o[1],l)&&(i=n<3?void 0:i,n=1),e=Object(e);++r<n;){var c=o[r];c&&t(e,c,r,i)}return e}))}((function(t,e,o,r){Ie(t,e,o,r)}));class Ne extends t.Plugin{constructor(t){super(t),this._definitions=new Map}static get pluginName(){return"DataSchema"}init(){for(const t of n)this.registerBlockElement(t);for(const t of i)this.registerInlineElement(t)}registerBlockElement(t){this._definitions.set(t.model,{...t,isBlock:!0})}registerInlineElement(t){this._definitions.set(t.model,{...t,isInline:!0})}extendBlockElement(t){this._extendDefinition({...t,isBlock:!0})}extendInlineElement(t){this._extendDefinition({...t,isInline:!0})}getDefinitionsForView(t,e){const o=new Set;for(const r of this._getMatchingViewDefinitions(t)){if(e)for(const t of this._getReferences(r.model))o.add(t);o.add(r)}return o}_getMatchingViewDefinitions(t){return Array.from(this._definitions.values()).filter((e=>e.view&&function(t,e){if("string"==typeof t)return t===e;if(t instanceof RegExp)return t.test(e);return!1}(t,e.view)))}*_getReferences(t){const{modelSchema:o}=this._definitions.get(t);if(!o)return;const r=["inheritAllFrom","inheritTypesFrom","allowWhere","allowContentOf","allowAttributesOf"];for(const n of r)for(const r of(0,e.toArray)(o[n]||[])){const e=this._definitions.get(r);r!==t&&e&&(yield*this._getReferences(e.model),yield e)}}_extendDefinition(t){const e=this._definitions.get(t.model),o=ze({},e,t,((t,e)=>Array.isArray(t)?t.concat(e):void 0));this._definitions.set(t.model,o)}}var Ve=o(492),Ue=o(995);const qe=function(t,e){for(var o=-1,r=null==t?0:t.length;++o<r&&!1!==e(t[o],o,t););return t};const We=Tt(Object.keys,Object);var Ke=Object.prototype.hasOwnProperty;const Ge=function(t){if(!Mt(t))return We(t);var e=[];for(var o in Object(t))Ke.call(t,o)&&"constructor"!=o&&e.push(o);return e};const Ze=function(t){return Kt(t)?_e(t):Ge(t)};const Qe=function(t,e){return t&&ge(e,Ze(e),t)};const Je=function(t,e){return t&&ge(e,Ee(e),t)};const Xe=function(t,e){for(var o=-1,r=null==t?0:t.length,n=0,i=[];++o<r;){var l=t[o];e(l,o,t)&&(i[n++]=l)}return i};const Ye=function(){return[]};var to=Object.prototype.propertyIsEnumerable,eo=Object.getOwnPropertySymbols;const oo=eo?function(t){return null==t?[]:(t=Object(t),Xe(eo(t),(function(e){return to.call(t,e)})))}:Ye;const ro=function(t,e){return ge(t,oo(t),e)};const no=function(t,e){for(var o=-1,r=e.length,n=t.length;++o<r;)t[n+o]=e[o];return t};const io=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)no(e,oo(t)),t=Bt(t);return e}:Ye;const lo=function(t,e){return ge(t,io(t),e)};const co=function(t,e,o){var r=e(t);return qt(t)?r:no(r,o(t))};const so=function(t){return co(t,Ze,oo)};const ao=function(t){return co(t,Ee,io)};const mo=Z(j,"DataView");const uo=Z(j,"Promise");const ho=Z(j,"Set");const fo=Z(j,"WeakMap");var bo="[object Map]",po="[object Promise]",vo="[object Set]",go="[object WeakMap]",wo="[object DataView]",yo=L(mo),Ao=L(Q),jo=L(uo),_o=L(ho),So=L(fo),Oo=F;(mo&&Oo(new mo(new ArrayBuffer(1)))!=wo||Q&&Oo(new Q)!=bo||uo&&Oo(uo.resolve())!=po||ho&&Oo(new ho)!=vo||fo&&Oo(new fo)!=go)&&(Oo=function(t){var e=F(t),o="[object Object]"==e?t.constructor:void 0,r=o?L(o):"";if(r)switch(r){case yo:return wo;case Ao:return bo;case jo:return po;case _o:return vo;case So:return go}return e});const ko=Oo;var Eo=Object.prototype.hasOwnProperty;const $o=function(t){var e=t.length,o=new t.constructor(e);return e&&"string"==typeof t[0]&&Eo.call(t,"index")&&(o.index=t.index,o.input=t.input),o};const Co=function(t,e){var o=e?Ct(t.buffer):t.buffer;return new t.constructor(o,t.byteOffset,t.byteLength)};var Io=/\w*$/;const xo=function(t){var e=new t.constructor(t.source,Io.exec(t));return e.lastIndex=t.lastIndex,e};var Fo=_?_.prototype:void 0,Po=Fo?Fo.valueOf:void 0;const To=function(t){return Po?Object(Po.call(t)):{}};const Bo=function(t,e,o){var r=t.constructor;switch(e){case"[object ArrayBuffer]":return Ct(t);case"[object Boolean]":case"[object Date]":return new r(+t);case"[object DataView]":return Co(t,o);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return It(t,o);case"[object Map]":case"[object Set]":return new r;case"[object Number]":case"[object String]":return new r(t);case"[object RegExp]":return xo(t);case"[object Symbol]":return To(t)}};const Ro=function(t){return Ht(t)&&"[object Map]"==ko(t)};var Mo=de&&de.isMap;const Do=Mo?se(Mo):Ro;const Ho=function(t){return Ht(t)&&"[object Set]"==ko(t)};var Lo=de&&de.isSet;const zo=Lo?se(Lo):Ho;var No="[object Arguments]",Vo="[object Function]",Uo="[object Object]",qo={};qo[No]=qo["[object Array]"]=qo["[object ArrayBuffer]"]=qo["[object DataView]"]=qo["[object Boolean]"]=qo["[object Date]"]=qo["[object Float32Array]"]=qo["[object Float64Array]"]=qo["[object Int8Array]"]=qo["[object Int16Array]"]=qo["[object Int32Array]"]=qo["[object Map]"]=qo["[object Number]"]=qo["[object Object]"]=qo["[object RegExp]"]=qo["[object Set]"]=qo["[object String]"]=qo["[object Symbol]"]=qo["[object Uint8Array]"]=qo["[object Uint8ClampedArray]"]=qo["[object Uint16Array]"]=qo["[object Uint32Array]"]=!0,qo["[object Error]"]=qo[Vo]=qo["[object WeakMap]"]=!1;const Wo=function t(e,o,r,n,i,l){var c,s=1&o,a=2&o,m=4&o;if(r&&(c=i?r(e,n,i,l):r(e)),void 0!==c)return c;if(!P(e))return e;var u=qt(e);if(u){if(c=$o(e),!s)return xt(e,c)}else{var d=ko(e),h=d==Vo||"[object GeneratorFunction]"==d;if(Yt(e))return Et(e,s);if(d==Uo||d==No||h&&!i){if(c=a||h?{}:Dt(e),!s)return a?lo(e,Je(c,e)):ro(e,Qe(c,e))}else{if(!qo[d])return i?e:{};c=Bo(e,d,s)}}l||(l=new gt);var f=l.get(e);if(f)return f;l.set(e,c),zo(e)?e.forEach((function(n){c.add(t(n,o,r,n,e,l))})):Do(e)&&e.forEach((function(n,i){c.set(i,t(n,o,r,i,e,l))}));var b=u?void 0:(m?a?ao:so:a?Ee:Ze)(e);return qe(b||e,(function(n,i){b&&(n=e[i=n]),ve(c,i,t(n,o,r,i,e,l))})),c};const Ko=function(t){return Wo(t,5)};function Go(t,e,o){if(e.attributes)for(const[r,n]of Object.entries(e.attributes))t.setAttribute(r,n,o);e.styles&&t.setStyle(e.styles,o),e.classes&&t.addClass(e.classes,o)}function Zo(t,e){const o=Ko(t);for(const r in e)Array.isArray(e[r])?o[r]=Array.from(new Set([...t[r],...e[r]])):o[r]={...t[r],...e[r]};return o}function Qo({model:t}){return(e,o)=>o.writer.createElement(t,{htmlContent:e.getCustomProperty("$rawContent")})}function Jo(t,{view:e,isInline:o}){const r=t.t;return(t,{writer:n,consumable:i})=>{const l=r("HTML object"),c=Xo(e,t,n);n.addClass("html-object-embed__content",c);const s=t.getAttribute("htmlAttributes");s&&i.consume(t,`attribute:htmlAttributes:${t.name}`)&&Go(n,s,c);const a=n.createContainerElement(o?"span":"div",{class:"html-object-embed","data-html-object-embed-label":l},c,{isAllowedInsideAttributeElement:o});return(0,Ue.toWidget)(a,n,{widgetLabel:l})}}function Xo(t,e,o){return o.createRawElement(t,null,((t,o)=>{o.setContentOf(t,e.getAttribute("htmlContent"))}))}function Yo({priority:t,view:e}){return(o,r)=>{if(!o)return;const{writer:n}=r,i=n.createAttributeElement(e,null,{priority:t});return Go(n,o,i),i}}function tr({view:t},e){return o=>{o.on(`element:${t}`,((t,o,r)=>{if(!o.modelRange)return;const n=e._consumeAllowedAttributes(o.viewItem,r);n&&r.writer.setAttribute("htmlAttributes",n,o.modelRange)}),{priority:"low"})}}function er({model:t}){return e=>{e.on(`attribute:htmlAttributes:${t}`,((t,e,o)=>{const r=e.attributeNewValue;if(!o.consumable.consume(e.item,t.name))return;Go(o.writer,r,o.mapper.toViewElement(e.item))}))}}const or=function(t,e){for(var o=-1,r=null==t?0:t.length,n=Array(r);++o<r;)n[o]=e(t[o],o,t);return n};const rr=function(t,e,o,r){for(var n=t.length,i=o+(r?1:-1);r?i--:++i<n;)if(e(t[i],i,t))return i;return-1};const nr=function(t){return t!=t};const ir=function(t,e,o){for(var r=o-1,n=t.length;++r<n;)if(t[r]===e)return r;return-1};const lr=function(t,e,o){return e==e?ir(t,e,o):rr(t,nr,o)};const cr=function(t,e,o,r){for(var n=o-1,i=t.length;++n<i;)if(r(t[n],e))return n;return-1};var sr=Array.prototype.splice;const ar=function(t,e,o,r){var n=r?cr:lr,i=-1,l=e.length,c=t;for(t===e&&(e=xt(e)),o&&(c=or(t,se(o)));++i<l;)for(var s=0,a=e[i],m=o?o(a):a;(s=n(c,m,s,r))>-1;)c!==t&&sr.call(c,s,1),sr.call(t,s,1);return t};const mr=He((function(t,e){return t&&t.length&&e&&e.length?ar(t,e):t}));var ur=o(62),dr=o.n(ur),hr=o(142),fr={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};dr()(hr.Z,fr);hr.Z.locals;class br extends t.Plugin{constructor(t){super(t),this._dataSchema=t.plugins.get("DataSchema"),this._allowedAttributes=new Ve.Matcher,this._disallowedAttributes=new Ve.Matcher,this._allowedElements=new Set,this._dataInitialized=!1,this._registerElementsAfterInit(),this._registerElementHandlers()}static get pluginName(){return"DataFilter"}static get requires(){return[Ne,Ue.Widget]}loadAllowedConfig(t){this._loadConfig(t,(t=>this.allowAttributes(t)))}loadDisallowedConfig(t){this._loadConfig(t,(t=>this.disallowAttributes(t)))}allowElement(t){for(const e of this._dataSchema.getDefinitionsForView(t,!0))this._allowedElements.has(e)||(this._allowedElements.add(e),this._dataInitialized&&this._fireRegisterEvent(e))}allowAttributes(t){this._allowedAttributes.add(t)}disallowAttributes(t){this._disallowedAttributes.add(t)}_loadConfig(t,e){for(const o of t){const t=o.name||/[\s\S]+/;this.allowElement(t),yr(o).forEach(e)}}_consumeAllowedAttributes(t,e){return pr(t,e,this._disallowedAttributes),pr(t,e,this._allowedAttributes)}_registerElementsAfterInit(){this.editor.data.on("init",(()=>{this._dataInitialized=!0;for(const t of this._allowedElements)this._fireRegisterEvent(t)}),{priority:e.priorities.get("highest")+1})}_registerElementHandlers(){this.on("register",((t,o)=>{const r=this.editor.model.schema;if(o.isObject&&!r.isRegistered(o.model))this._registerObjectElement(o);else if(o.isBlock)this._registerBlockElement(o);else{if(!o.isInline)throw new e.CKEditorError("data-filter-invalid-definition",null,o);this._registerInlineElement(o)}t.stop()}),{priority:"lowest"})}_fireRegisterEvent(t){this.fire(t.view?`register:${t.view}`:"register",t)}_registerObjectElement(t){const o=this.editor,r=o.model.schema,n=o.conversion,{view:i,model:l}=t;r.register(l,t.modelSchema),i&&(r.extend(t.model,{allowAttributes:["htmlAttributes","htmlContent"]}),o.data.registerRawContentMatcher({name:i}),n.for("upcast").elementToElement({view:i,model:Qo(t),converterPriority:e.priorities.get("low")+1}),n.for("upcast").add(tr(t,this)),n.for("editingDowncast").elementToStructure({model:l,view:Jo(o,t)}),n.for("dataDowncast").elementToElement({model:l,view:(t,{writer:e})=>Xo(i,t,e)}),n.for("dataDowncast").add(er(t)))}_registerBlockElement(t){const o=this.editor,r=o.model.schema,n=o.conversion,{view:i,model:l}=t;if(!r.isRegistered(t.model)){if(r.register(t.model,t.modelSchema),!i)return;n.for("upcast").elementToElement({model:l,view:i,converterPriority:e.priorities.get("low")+1}),n.for("downcast").elementToElement({model:l,view:i})}i&&(r.extend(t.model,{allowAttributes:"htmlAttributes"}),n.for("upcast").add(tr(t,this)),n.for("downcast").add(er(t)))}_registerInlineElement(t){const e=this.editor,o=e.model.schema,r=e.conversion,n=t.model;o.extend("$text",{allowAttributes:n}),t.attributeProperties&&o.setAttributeProperties(n,t.attributeProperties),r.for("upcast").add(function({view:t,model:e},o){return r=>{r.on(`element:${t}`,((t,r,n)=>{const i=o._consumeAllowedAttributes(r.viewItem,n);r.modelRange||(r=Object.assign(r,n.convertChildren(r.viewItem,r.modelCursor)));for(const t of r.modelRange.getItems())if(n.schema.checkAttribute(t,e)){const o=Zo(i||{},t.getAttribute(e)||{});n.writer.setAttribute(e,o,t)}}),{priority:"low"})}}(t,this)),r.for("downcast").attributeToElement({model:n,view:Yo(t)})}}function pr(t,e,o){const r=function(t,{consumable:e},o){const r=o.matchAll(t)||[],n=[];for(const o of r)vr(e,t,o),delete o.match.name,e.consume(t,o.match)&&n.push(o);return n}(t,e,o),{attributes:n,styles:i,classes:l}=function(t){const e={attributes:new Set,classes:new Set,styles:new Set};for(const o of t)for(const t in e){(o.match[t]||[]).forEach((o=>e[t].add(o)))}return e}(r),c={};return n.size&&(c.attributes=gr(n,(e=>t.getAttribute(e)))),i.size&&(c.styles=gr(i,(e=>t.getStyle(e)))),l.size&&(c.classes=Array.from(l)),Object.keys(c).length?c:null}function vr(t,e,o){for(const r of["attributes","classes","styles"]){const n=o.match[r];if(n)for(const o of n)t.test(e,{[r]:[o]})||mr(n,o)}}function gr(t,e){const o={};for(const r of t){void 0!==e(r)&&(o[r]=e(r))}return o}function wr(t,e){const{name:o}=t;return ie(t[e])?Object.entries(t[e]).map((([t,r])=>({name:o,[e]:{[t]:r}}))):Array.isArray(t[e])?t[e].map((t=>({name:o,[e]:[t]}))):[t]}function yr(t){const{name:e,attributes:o,classes:r,styles:n}=t,i=[];return o&&i.push(...wr({name:e,attributes:o},"attributes")),r&&i.push(...wr({name:e,classes:r},"classes")),n&&i.push(...wr({name:e,styles:n},"styles")),i}class Ar extends t.Plugin{static get requires(){return[br]}init(){if(!this.editor.plugins.has("CodeBlockEditing"))return;const t=this.editor.plugins.get(br);t.on("register:pre",((e,o)=>{if("codeBlock"!==o.model)return;const r=this.editor,n=r.model.schema,i=r.conversion;n.extend("codeBlock",{allowAttributes:["htmlAttributes","htmlContentAttributes"]}),i.for("upcast").add(function(t){return e=>{e.on("element:code",((e,o,r)=>{const n=o.viewItem,i=n.parent;function l(e,n){const i=t._consumeAllowedAttributes(e,r);i&&r.writer.setAttribute(n,i,o.modelRange)}i&&i.is("element","pre")&&(l(i,"htmlAttributes"),l(n,"htmlContentAttributes"))}),{priority:"low"})}}(t)),i.for("downcast").add((t=>{t.on("attribute:htmlAttributes:codeBlock",((t,e,o)=>{if(!o.consumable.consume(e.item,t.name))return;const r=o.mapper.toViewElement(e.item).parent;Go(o.writer,e.attributeNewValue,r)})),t.on("attribute:htmlContentAttributes:codeBlock",((t,e,o)=>{if(!o.consumable.consume(e.item,t.name))return;const r=o.mapper.toViewElement(e.item);Go(o.writer,e.attributeNewValue,r)}))})),e.stop()}))}}class jr extends t.Plugin{static get requires(){return[br]}init(){this.editor.plugins.get(br).on("register",((t,o)=>{const r=this.editor,n=r.model.schema,i=r.conversion;if(!o.paragraphLikeModel)return;if(n.isRegistered(o.model)||n.isRegistered(o.paragraphLikeModel))return;const l={model:o.paragraphLikeModel,view:o.view};n.register(o.model,o.modelSchema),n.register(l.model,{inheritAllFrom:"$block"}),i.for("upcast").elementToElement({view:o.view,model:(t,{writer:e})=>this._hasBlockContent(t)?e.createElement(o.model):e.createElement(l.model),converterPriority:e.priorities.get("low")+1}),i.for("downcast").elementToElement({view:o.view,model:o.model}),this._addAttributeConversion(o),i.for("downcast").elementToElement({view:l.view,model:l.model}),this._addAttributeConversion(l),t.stop()}))}_hasBlockContent(t){const e=this.editor.editing.view.domConverter.blockElements;return Array.from(t.getChildren()).some((t=>e.includes(t.name)))}_addAttributeConversion(t){const e=this.editor,o=e.conversion,r=e.plugins.get(br);e.model.schema.extend(t.model,{allowAttributes:"htmlAttributes"}),o.for("upcast").add(tr(t,r)),o.for("downcast").add(er(t))}}class _r extends t.Plugin{static get requires(){return[Ne]}init(){const t=this.editor;if(!t.plugins.has("HeadingEditing"))return;const e=t.plugins.get(Ne),o=t.config.get("heading.options"),r=[];for(const t of o)"model"in t&&"view"in t&&(e.registerBlockElement({view:t.view,model:t.model}),r.push(t.model));e.extendBlockElement({model:"htmlHgroup",modelSchema:{allowChildren:r}})}}class Sr extends t.Plugin{static get requires(){return[br]}init(){const t=this.editor;if(!t.plugins.has("ImageInlineEditing")&&!t.plugins.has("ImageBlockEditing"))return;const e=t.model.schema,o=t.conversion,r=t.plugins.get(br);r.on("register:img",((t,n)=>{"imageBlock"!==n.model&&"imageInline"!==n.model||(e.isRegistered("imageBlock")&&e.extend("imageBlock",{allowAttributes:["htmlAttributes","htmlFigureAttributes","htmlLinkAttributes"]}),e.isRegistered("imageInline")&&e.extend("imageInline",{allowAttributes:["htmlA","htmlAttributes"]}),o.for("upcast").add(function(t){return e=>{e.on("element:img",((e,o,r)=>{const n=o.viewItem,i=n.parent;function l(e,n){const i=t._consumeAllowedAttributes(e,r);i&&r.writer.setAttribute(n,i,o.modelRange)}function c(t){o.modelRange&&o.modelRange.getContainedElement().is("element","imageBlock")&&l(t,"htmlLinkAttributes"),t.parent.is("element","figure")&&l(t.parent,"htmlFigureAttributes")}l(n,"htmlAttributes"),i.is("element","figure")?l(i,"htmlFigureAttributes"):i.is("element","a")&&c(i)}),{priority:"low"})}}(r)),o.for("downcast").add((t=>{function e(e){t.on(`attribute:${e}:imageInline`,((t,e,o)=>{if(!o.consumable.consume(e.item,t.name))return;const r=o.mapper.toViewElement(e.item);Go(o.writer,e.attributeNewValue,r)}),{priority:"low"})}function o(e,o){t.on(`attribute:${o}:imageBlock`,((t,o,r)=>{if(!r.consumable.consume(o.item,t.name))return;const n=r.mapper.toViewElement(o.item),i=Or(r.writer,n,e);Go(r.writer,o.attributeNewValue,i)}),{priority:"low"})}function r(){t.on("attribute:linkHref:imageBlock",((t,e,o)=>{if(!o.consumable.consume(e.item,"attribute:htmlLinkAttributes:imageBlock"))return;const r=o.mapper.toViewElement(e.item),n=Or(o.writer,r,"a");Go(o.writer,e.item.getAttribute("htmlLinkAttributes"),n)}),{priority:"low"})}e("htmlAttributes"),o("img","htmlAttributes"),o("figure","htmlFigureAttributes"),r()})),t.stop())}))}}function Or(t,e,o){const r=t.createRangeOn(e);for(const{item:t}of r.getWalker())if(t.is("element",o))return t}class kr extends t.Plugin{static get requires(){return[br]}init(){const t=this.editor;if(!t.plugins.has("MediaEmbed")||t.config.get("mediaEmbed.previewsInData"))return;const e=t.model.schema,o=t.conversion,r=this.editor.plugins.get(br),n=this.editor.plugins.get(Ne),i=t.config.get("mediaEmbed.elementName");n.registerBlockElement({model:"media",view:i}),r.on(`register:${i}`,((t,n)=>{"media"===n.model&&(e.extend("media",{allowAttributes:["htmlAttributes","htmlFigureAttributes"]}),o.for("upcast").add(function(t,e){return t=>{t.on(`element:${e}`,o)};function o(e,o,r){const n=o.viewItem,i=n.parent;function l(e,n){const i=t._consumeAllowedAttributes(e,r);i&&r.writer.setAttribute(n,i,o.modelRange)}l(n,"htmlAttributes"),i.is("element","figure")&&i.hasClass("media")&&l(i,"htmlFigureAttributes")}}(r,i)),o.for("dataDowncast").add(function(t){return e=>{function o(t,o){e.on(`attribute:${o}:media`,((e,o,r)=>{if(!r.consumable.consume(o.item,e.name))return;const n=r.mapper.toViewElement(o.item),i=function(t,e,o){const r=t.createRangeOn(e);for(const{item:t}of r.getWalker())if(t.is("element",o))return t}(r.writer,n,t);Go(r.writer,o.attributeNewValue,i)}))}o(t,"htmlAttributes"),o("figure","htmlFigureAttributes")}}(i)),t.stop())}))}}class Er extends t.Plugin{static get requires(){return[br]}init(){const t=this.editor.plugins.get(br);t.on("register:script",((e,o)=>{const r=this.editor,n=r.model.schema,i=r.conversion;n.register("htmlScript",o.modelSchema),n.extend("htmlScript",{allowAttributes:["htmlAttributes","htmlContent"],isContent:!0}),r.data.registerRawContentMatcher({name:"script"}),i.for("upcast").elementToElement({view:"script",model:Qo(o)}),i.for("upcast").add(tr(o,t)),i.for("downcast").elementToElement({model:"htmlScript",view:(t,{writer:e})=>Xo("script",t,e)}),i.for("downcast").add(er(o)),e.stop()}))}}class $r extends t.Plugin{static get requires(){return[br]}init(){const t=this.editor;if(!t.plugins.has("TableEditing"))return;const e=t.model.schema,o=t.conversion,r=t.plugins.get(br);r.on("register:table",((t,n)=>{"table"===n.model&&(e.extend("table",{allowAttributes:["htmlAttributes","htmlFigureAttributes","htmlTheadAttributes","htmlTbodyAttributes"]}),o.for("upcast").add(function(t){return e=>{e.on("element:table",((e,o,r)=>{const n=o.viewItem;l(n,"htmlAttributes");const i=n.parent;i.is("element","figure")&&l(i,"htmlFigureAttributes");for(const t of n.getChildren())t.is("element","thead")&&l(t,"htmlTheadAttributes"),t.is("element","tbody")&&l(t,"htmlTbodyAttributes");function l(e,n){const i=t._consumeAllowedAttributes(e,r);i&&r.writer.setAttribute(n,i,o.modelRange)}}),{priority:"low"})}}(r)),o.for("downcast").add((t=>{function e(e,o){t.on(`attribute:${o}:table`,((t,o,r)=>{if(!r.consumable.consume(o.item,t.name))return;const n=r.mapper.toViewElement(o.item),i=function(t,e,o){const r=t.createRangeOn(e);for(const{item:t}of r.getWalker())if(t.is("element",o))return t}(r.writer,n,e);Go(r.writer,o.attributeNewValue,i)}))}e("table","htmlAttributes"),e("figure","htmlFigureAttributes"),e("thead","htmlTheadAttributes"),e("tbody","htmlTbodyAttributes")})),t.stop())}))}}class Cr extends t.Plugin{static get requires(){return[br]}init(){const t=this.editor.plugins.get(br);t.on("register:style",((e,o)=>{const r=this.editor,n=r.model.schema,i=r.conversion;n.register("htmlStyle",o.modelSchema),n.extend("htmlStyle",{allowAttributes:["htmlAttributes","htmlContent"],isContent:!0}),r.data.registerRawContentMatcher({name:"style"}),i.for("upcast").elementToElement({view:"style",model:Qo(o)}),i.for("upcast").add(tr(o,t)),i.for("downcast").elementToElement({model:"htmlStyle",view:(t,{writer:e})=>Xo("style",t,e)}),i.for("downcast").add(er(o)),e.stop()}))}}class Ir extends t.Plugin{static get pluginName(){return"GeneralHtmlSupport"}static get requires(){return[br,Ar,jr,_r,Sr,kr,Er,$r,Cr]}init(){const t=this.editor,e=t.plugins.get(br);e.loadAllowedConfig(t.config.get("htmlSupport.allow")||[]),e.loadDisallowedConfig(t.config.get("htmlSupport.disallow")||[])}}class xr extends t.Plugin{static get pluginName(){return"HtmlComment"}init(){const t=this.editor;t.model.schema.addAttributeCheck(((t,e)=>{if(t.endsWith("$root")&&e.startsWith("$comment"))return!0})),t.conversion.for("upcast").elementToMarker({view:"$comment",model:(t,{writer:o})=>{const r=this.editor.model.document.getRoot(),n=t.getCustomProperty("$rawContent"),i=`$comment:${(0,e.uid)()}`;return o.setAttribute(i,n,r),i}}),t.conversion.for("dataDowncast").markerToElement({model:"$comment",view:(t,{writer:e})=>{const o=this.editor.model.document.getRoot(),r=t.markerName,n=o.getAttribute(r),i=e.createUIElement("$comment");return e.setCustomProperty("$rawContent",n,i),i}}),t.model.document.registerPostFixer((e=>{const o=t.model.document.getRoot(),r=t.model.document.differ.getChangedMarkers().filter((t=>t.name.startsWith("$comment"))).filter((t=>{const e=t.data.newRange;return e&&"$graveyard"===e.root.rootName}));if(0===r.length)return!1;for(const t of r)e.removeMarker(t.name),e.removeAttribute(t.name,o);return!0})),t.data.on("set",(()=>{for(const e of t.model.markers.getMarkersGroup("$comment"))this.removeHtmlComment(e.name)}),{priority:"high"}),t.model.on("deleteContent",((e,[o])=>{for(const e of o.getRanges()){const o=t.model.schema.getLimitElement(e),r=t.model.createPositionAt(o,0),n=t.model.createPositionAt(o,"end");let i;i=r.isTouching(e.start)&&n.isTouching(e.end)?this.getHtmlCommentsInRange(t.model.createRange(r,n)):this.getHtmlCommentsInRange(e,{skipBoundaries:!0});for(const t of i)this.removeHtmlComment(t)}}),{priority:"high"})}createHtmlComment(t,o){const r=(0,e.uid)(),n=this.editor.model,i=n.document.getRoot(),l=`$comment:${r}`;return n.change((e=>{const r=e.createRange(t);return e.addMarker(l,{usingOperation:!0,affectsData:!0,range:r}),e.setAttribute(l,o,i),l}))}removeHtmlComment(t){const e=this.editor,o=e.model.document.getRoot(),r=e.model.markers.get(t);return!!r&&(e.model.change((e=>{e.removeMarker(r),e.removeAttribute(t,o)})),!0)}getHtmlCommentData(t){const e=this.editor,o=e.model.markers.get(t),r=e.model.document.getRoot();return o?{content:r.getAttribute(t),position:o.getStart()}:null}getHtmlCommentsInRange(t,{skipBoundaries:e=!1}={}){const o=!e;return Array.from(this.editor.model.markers.getMarkersGroup("$comment")).filter((e=>function(t,e){const r=t.getRange().start;return(r.isAfter(e.start)||o&&r.isEqual(e.start))&&(r.isBefore(e.end)||o&&r.isEqual(e.end))}(e,t))).map((t=>t.name))}}})(),(window.CKEditor5=window.CKEditor5||{}).htmlSupport=r})();
*/(()=>{var t={142:(t,e,r)=>{"use strict";r.d(e,{Z:()=>i});var o=r(609),n=r.n(o)()((function(t){return t[1]}));n.push([t.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 i=n},609:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var r=t(e);return e[2]?"@media ".concat(e[2]," {").concat(r,"}"):r})).join("")},e.i=function(t,r,o){"string"==typeof t&&(t=[[null,t,""]]);var n={};if(o)for(var i=0;i<this.length;i++){var l=this[i][0];null!=l&&(n[l]=!0)}for(var s=0;s<t.length;s++){var c=[].concat(t[s]);o&&n[c[0]]||(r&&(c[2]?c[2]="".concat(r," and ").concat(c[2]):c[2]=r),e.push(c))}},e}},62:(t,e,r)=>{"use strict";var o,n=function(){return void 0===o&&(o=Boolean(window&&document&&document.all&&!window.atob)),o},i=function(){var t={};return function(e){if(void 0===t[e]){var r=document.querySelector(e);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(t){r=null}t[e]=r}return t[e]}}(),l=[];function s(t){for(var e=-1,r=0;r<l.length;r++)if(l[r].identifier===t){e=r;break}return e}function c(t,e){for(var r={},o=[],n=0;n<t.length;n++){var i=t[n],c=e.base?i[0]+e.base:i[0],a=r[c]||0,u="".concat(c," ").concat(a);r[c]=a+1;var m=s(u),d={css:i[1],media:i[2],sourceMap:i[3]};-1!==m?(l[m].references++,l[m].updater(d)):l.push({identifier:u,updater:p(d,e),references:1}),o.push(u)}return o}function a(t){var e=document.createElement("style"),o=t.attributes||{};if(void 0===o.nonce){var n=r.nc;n&&(o.nonce=n)}if(Object.keys(o).forEach((function(t){e.setAttribute(t,o[t])})),"function"==typeof t.insert)t.insert(e);else{var l=i(t.insert||"head");if(!l)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");l.appendChild(e)}return e}var u,m=(u=[],function(t,e){return u[t]=e,u.filter(Boolean).join("\n")});function d(t,e,r,o){var n=r?"":o.media?"@media ".concat(o.media," {").concat(o.css,"}"):o.css;if(t.styleSheet)t.styleSheet.cssText=m(e,n);else{var i=document.createTextNode(n),l=t.childNodes;l[e]&&t.removeChild(l[e]),l.length?t.insertBefore(i,l[e]):t.appendChild(i)}}function h(t,e,r){var o=r.css,n=r.media,i=r.sourceMap;if(n?t.setAttribute("media",n):t.removeAttribute("media"),i&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),t.styleSheet)t.styleSheet.cssText=o;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(o))}}var f=null,b=0;function p(t,e){var r,o,n;if(e.singleton){var i=b++;r=f||(f=a(e)),o=d.bind(null,r,i,!1),n=d.bind(null,r,i,!0)}else r=a(e),o=h.bind(null,r,e),n=function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(r)};return o(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;o(t=e)}else n()}}t.exports=function(t,e){(e=e||{}).singleton||"boolean"==typeof e.singleton||(e.singleton=n());var r=c(t=t||[],e);return function(t){if(t=t||[],"[object Array]"===Object.prototype.toString.call(t)){for(var o=0;o<r.length;o++){var n=s(r[o]);l[n].references--}for(var i=c(t,e),a=0;a<r.length;a++){var u=s(r[a]);0===l[u].references&&(l[u].updater(),l.splice(u,1))}r=i}}}},704:(t,e,r)=>{t.exports=r(79)("./src/core.js")},492:(t,e,r)=>{t.exports=r(79)("./src/engine.js")},209:(t,e,r)=>{t.exports=r(79)("./src/utils.js")},995:(t,e,r)=>{t.exports=r(79)("./src/widget.js")},79:t=>{"use strict";t.exports=CKEditor5.dll}},e={};function r(o){var n=e[o];if(void 0!==n)return n.exports;var i=e[o]={id:o,exports:{}};return t[o](i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var o in e)r.o(e,o)&&!r.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};(()=>{"use strict";r.r(o),r.d(o,{DataFilter:()=>po,DataSchema:()=>ze,GeneralHtmlSupport:()=>tn,HtmlComment:()=>on});var t=r(704),e=r(209);const n=[{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:"caption",view:"caption"},{model:"caption",view:"figcaption"},{model:"imageBlock",view:"img"},{model:"imageInline",view:"img"},{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:!0}},{model:"htmlThead",view:"thead",modelSchema:{allowIn:"htmlTable",isBlock:!0}},{model:"htmlTfoot",view:"tfoot",modelSchema:{allowIn:"htmlTable",isBlock:!0}},{model:"htmlCaption",view:"caption",modelSchema:{allowIn:"htmlTable",allowChildren:"$text",isBlock:!0}},{model:"htmlTr",view:"tr",modelSchema:{allowIn:["htmlTable","htmlThead","htmlTbody"]}},{model:"htmlTd",view:"td",modelSchema:{allowIn:"htmlTr",allowContentOf:"$container"}},{model:"htmlTh",view:"th",modelSchema:{allowIn:"htmlTr",allowContentOf:"$container"}},{model:"htmlFigure",view:"figure",modelSchema:{inheritAllFrom:"$container",isBlock:!0}},{model:"htmlFigcaption",view:"figcaption",modelSchema:{allowIn:"htmlFigure",allowChildren:"$text",isBlock:!0}},{model:"htmlAddress",view:"address",modelSchema:{inheritAllFrom:"$container",isBlock:!0}},{model:"htmlAside",view:"aside",modelSchema:{inheritAllFrom:"$container",isBlock:!0}},{model:"htmlMain",view:"main",modelSchema:{inheritAllFrom:"$container",isBlock:!0}},{model:"htmlDetails",view:"details",modelSchema:{inheritAllFrom:"$container",isBlock:!0}},{model:"htmlSummary",view:"summary",modelSchema:{allowChildren:"$text",allowIn:"htmlDetails",isBlock:!0}},{model:"htmlDiv",view:"div",paragraphLikeModel:"htmlDivParagraph",modelSchema:{inheritAllFrom:"$container"}},{model:"htmlFieldset",view:"fieldset",modelSchema:{inheritAllFrom:"$container",isBlock:!0}},{model:"htmlLegend",view:"legend",modelSchema:{allowIn:"htmlFieldset",allowChildren:"$text"}},{model:"htmlHeader",view:"header",modelSchema:{inheritAllFrom:"$container",isBlock:!0}},{model:"htmlFooter",view:"footer",modelSchema:{inheritAllFrom:"$container",isBlock:!0}},{model:"htmlForm",view:"form",modelSchema:{inheritAllFrom:"$container",isBlock:!0}},{model:"htmlHgroup",view:"hgroup",modelSchema:{allowChildren:["htmlH1","htmlH2","htmlH3","htmlH4","htmlH5","htmlH6"],isBlock:!0}},{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:!0}},{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:!0}},{model:"htmlPre",view:"pre",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlArticle",view:"article",modelSchema:{inheritAllFrom:"$container",isBlock:!0}},{model:"htmlSection",view:"section",modelSchema:{inheritAllFrom:"$container",isBlock:!0}},{model:"htmlNav",view:"nav",modelSchema:{inheritAllFrom:"$container",isBlock:!0}},{model:"htmlDl",view:"dl",modelSchema:{allowWhere:"$container",allowChildren:["htmlDt","htmlDd"],isBlock:!0}},{model:"htmlDt",view:"dt",modelSchema:{allowChildren:"$block",isBlock:!0}},{model:"htmlDd",view:"dd",modelSchema:{allowChildren:"$block",isBlock:!0}},{model:"htmlCenter",view:"center",modelSchema:{inheritAllFrom:"$container",isBlock:!0}}],i=[{model:"htmlAcronym",view:"acronym",attributeProperties:{copyOnEnter:!0}},{model:"htmlTt",view:"tt",attributeProperties:{copyOnEnter:!0}},{model:"htmlFont",view:"font",attributeProperties:{copyOnEnter:!0}},{model:"htmlTime",view:"time",attributeProperties:{copyOnEnter:!0}},{model:"htmlVar",view:"var",attributeProperties:{copyOnEnter:!0}},{model:"htmlBig",view:"big",attributeProperties:{copyOnEnter:!0}},{model:"htmlSmall",view:"small",attributeProperties:{copyOnEnter:!0}},{model:"htmlSamp",view:"samp",attributeProperties:{copyOnEnter:!0}},{model:"htmlQ",view:"q",attributeProperties:{copyOnEnter:!0}},{model:"htmlOutput",view:"output",attributeProperties:{copyOnEnter:!0}},{model:"htmlKbd",view:"kbd",attributeProperties:{copyOnEnter:!0}},{model:"htmlBdi",view:"bdi",attributeProperties:{copyOnEnter:!0}},{model:"htmlBdo",view:"bdo",attributeProperties:{copyOnEnter:!0}},{model:"htmlAbbr",view:"abbr",attributeProperties:{copyOnEnter:!0}},{model:"htmlA",view:"a",priority:5,attributeProperties:{copyOnEnter:!0}},{model:"htmlStrong",view:"strong",attributeProperties:{copyOnEnter:!0}},{model:"htmlB",view:"b",attributeProperties:{copyOnEnter:!0}},{model:"htmlI",view:"i",attributeProperties:{copyOnEnter:!0}},{model:"htmlEm",view:"em",attributeProperties:{copyOnEnter:!0}},{model:"htmlS",view:"s",attributeProperties:{copyOnEnter:!0}},{model:"htmlDel",view:"del",attributeProperties:{copyOnEnter:!0}},{model:"htmlIns",view:"ins",attributeProperties:{copyOnEnter:!0}},{model:"htmlU",view:"u",attributeProperties:{copyOnEnter:!0}},{model:"htmlSub",view:"sub",attributeProperties:{copyOnEnter:!0}},{model:"htmlSup",view:"sup",attributeProperties:{copyOnEnter:!0}},{model:"htmlCode",view:"code",attributeProperties:{copyOnEnter:!0}},{model:"htmlMark",view:"mark",attributeProperties:{copyOnEnter:!0}},{model:"htmlSpan",view:"span",attributeProperties:{copyOnEnter:!0}},{model:"htmlCite",view:"cite",attributeProperties:{copyOnEnter:!0}},{model:"htmlLabel",view:"label",attributeProperties:{copyOnEnter:!0}},{model:"htmlDfn",view:"dfn",attributeProperties:{copyOnEnter:!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}}];const l=function(){this.__data__=[],this.size=0};const s=function(t,e){return t===e||t!=t&&e!=e};const c=function(t,e){for(var r=t.length;r--;)if(s(t[r][0],e))return r;return-1};var a=Array.prototype.splice;const u=function(t){var e=this.__data__,r=c(e,t);return!(r<0)&&(r==e.length-1?e.pop():a.call(e,r,1),--this.size,!0)};const m=function(t){var e=this.__data__,r=c(e,t);return r<0?void 0:e[r][1]};const d=function(t){return c(this.__data__,t)>-1};const h=function(t,e){var r=this.__data__,o=c(r,t);return o<0?(++this.size,r.push([t,e])):r[o][1]=e,this};function f(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}f.prototype.clear=l,f.prototype.delete=u,f.prototype.get=m,f.prototype.has=d,f.prototype.set=h;const b=f;const p=function(){this.__data__=new b,this.size=0};const g=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r};const v=function(t){return this.__data__.get(t)};const w=function(t){return this.__data__.has(t)};const y="object"==typeof global&&global&&global.Object===Object&&global;var A="object"==typeof self&&self&&self.Object===Object&&self;const j=y||A||Function("return this")();const _=j.Symbol;var O=Object.prototype,k=O.hasOwnProperty,S=O.toString,E=_?_.toStringTag:void 0;const C=function(t){var e=k.call(t,E),r=t[E];try{t[E]=void 0;var o=!0}catch(t){}var n=S.call(t);return o&&(e?t[E]=r:delete t[E]),n};var $=Object.prototype.toString;const x=function(t){return $.call(t)};var F=_?_.toStringTag:void 0;const I=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":F&&F in Object(t)?C(t):x(t)};const P=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)};const B=function(t){if(!P(t))return!1;var e=I(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e};const T=j["__core-js_shared__"];var R,L=(R=/[^.]+$/.exec(T&&T.keys&&T.keys.IE_PROTO||""))?"Symbol(src)_1."+R:"";const M=function(t){return!!L&&L in t};var D=Function.prototype.toString;const H=function(t){if(null!=t){try{return D.call(t)}catch(t){}try{return t+""}catch(t){}}return""};var N=/^\[object .+?Constructor\]$/,z=Function.prototype,V=Object.prototype,q=z.toString,U=V.hasOwnProperty,W=RegExp("^"+q.call(U).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const G=function(t){return!(!P(t)||M(t))&&(B(t)?W:N).test(H(t))};const K=function(t,e){return null==t?void 0:t[e]};const Z=function(t,e){var r=K(t,e);return G(r)?r:void 0};const Q=Z(j,"Map");const J=Z(Object,"create");const X=function(){this.__data__=J?J(null):{},this.size=0};const Y=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e};var tt=Object.prototype.hasOwnProperty;const et=function(t){var e=this.__data__;if(J){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return tt.call(e,t)?e[t]:void 0};var rt=Object.prototype.hasOwnProperty;const ot=function(t){var e=this.__data__;return J?void 0!==e[t]:rt.call(e,t)};const nt=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=J&&void 0===e?"__lodash_hash_undefined__":e,this};function it(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}it.prototype.clear=X,it.prototype.delete=Y,it.prototype.get=et,it.prototype.has=ot,it.prototype.set=nt;const lt=it;const st=function(){this.size=0,this.__data__={hash:new lt,map:new(Q||b),string:new lt}};const ct=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};const at=function(t,e){var r=t.__data__;return ct(e)?r["string"==typeof e?"string":"hash"]:r.map};const ut=function(t){var e=at(this,t).delete(t);return this.size-=e?1:0,e};const mt=function(t){return at(this,t).get(t)};const dt=function(t){return at(this,t).has(t)};const ht=function(t,e){var r=at(this,t),o=r.size;return r.set(t,e),this.size+=r.size==o?0:1,this};function ft(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}ft.prototype.clear=st,ft.prototype.delete=ut,ft.prototype.get=mt,ft.prototype.has=dt,ft.prototype.set=ht;const bt=ft;const pt=function(t,e){var r=this.__data__;if(r instanceof b){var o=r.__data__;if(!Q||o.length<199)return o.push([t,e]),this.size=++r.size,this;r=this.__data__=new bt(o)}return r.set(t,e),this.size=r.size,this};function gt(t){var e=this.__data__=new b(t);this.size=e.size}gt.prototype.clear=p,gt.prototype.delete=g,gt.prototype.get=v,gt.prototype.has=w,gt.prototype.set=pt;const vt=gt;const wt=function(){try{var t=Z(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();const yt=function(t,e,r){"__proto__"==e&&wt?wt(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r};const At=function(t,e,r){(void 0!==r&&!s(t[e],r)||void 0===r&&!(e in t))&&yt(t,e,r)};const jt=function(t){return function(e,r,o){for(var n=-1,i=Object(e),l=o(e),s=l.length;s--;){var c=l[t?s:++n];if(!1===r(i[c],c,i))break}return e}}();var _t="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ot=_t&&"object"==typeof module&&module&&!module.nodeType&&module,kt=Ot&&Ot.exports===_t?j.Buffer:void 0,St=kt?kt.allocUnsafe:void 0;const Et=function(t,e){if(e)return t.slice();var r=t.length,o=St?St(r):new t.constructor(r);return t.copy(o),o};const Ct=j.Uint8Array;const $t=function(t){var e=new t.constructor(t.byteLength);return new Ct(e).set(new Ct(t)),e};const xt=function(t,e){var r=e?$t(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)};const Ft=function(t,e){var r=-1,o=t.length;for(e||(e=Array(o));++r<o;)e[r]=t[r];return e};var It=Object.create;const Pt=function(){function t(){}return function(e){if(!P(e))return{};if(It)return It(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();const Bt=function(t,e){return function(r){return t(e(r))}};const Tt=Bt(Object.getPrototypeOf,Object);var Rt=Object.prototype;const Lt=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Rt)};const Mt=function(t){return"function"!=typeof t.constructor||Lt(t)?{}:Pt(Tt(t))};const Dt=function(t){return null!=t&&"object"==typeof t};const Ht=function(t){return Dt(t)&&"[object Arguments]"==I(t)};var Nt=Object.prototype,zt=Nt.hasOwnProperty,Vt=Nt.propertyIsEnumerable;const qt=Ht(function(){return arguments}())?Ht:function(t){return Dt(t)&&zt.call(t,"callee")&&!Vt.call(t,"callee")};const Ut=Array.isArray;const Wt=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991};const Gt=function(t){return null!=t&&Wt(t.length)&&!B(t)};const Kt=function(t){return Dt(t)&&Gt(t)};const Zt=function(){return!1};var Qt="object"==typeof exports&&exports&&!exports.nodeType&&exports,Jt=Qt&&"object"==typeof module&&module&&!module.nodeType&&module,Xt=Jt&&Jt.exports===Qt?j.Buffer:void 0;const Yt=(Xt?Xt.isBuffer:void 0)||Zt;var te=Function.prototype,ee=Object.prototype,re=te.toString,oe=ee.hasOwnProperty,ne=re.call(Object);const ie=function(t){if(!Dt(t)||"[object Object]"!=I(t))return!1;var e=Tt(t);if(null===e)return!0;var r=oe.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&re.call(r)==ne};var le={};le["[object Float32Array]"]=le["[object Float64Array]"]=le["[object Int8Array]"]=le["[object Int16Array]"]=le["[object Int32Array]"]=le["[object Uint8Array]"]=le["[object Uint8ClampedArray]"]=le["[object Uint16Array]"]=le["[object Uint32Array]"]=!0,le["[object Arguments]"]=le["[object Array]"]=le["[object ArrayBuffer]"]=le["[object Boolean]"]=le["[object DataView]"]=le["[object Date]"]=le["[object Error]"]=le["[object Function]"]=le["[object Map]"]=le["[object Number]"]=le["[object Object]"]=le["[object RegExp]"]=le["[object Set]"]=le["[object String]"]=le["[object WeakMap]"]=!1;const se=function(t){return Dt(t)&&Wt(t.length)&&!!le[I(t)]};const ce=function(t){return function(e){return t(e)}};var ae="object"==typeof exports&&exports&&!exports.nodeType&&exports,ue=ae&&"object"==typeof module&&module&&!module.nodeType&&module,me=ue&&ue.exports===ae&&y.process;const de=function(){try{var t=ue&&ue.require&&ue.require("util").types;return t||me&&me.binding&&me.binding("util")}catch(t){}}();var he=de&&de.isTypedArray;const fe=he?ce(he):se;const be=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]};var pe=Object.prototype.hasOwnProperty;const ge=function(t,e,r){var o=t[e];pe.call(t,e)&&s(o,r)&&(void 0!==r||e in t)||yt(t,e,r)};const ve=function(t,e,r,o){var n=!r;r||(r={});for(var i=-1,l=e.length;++i<l;){var s=e[i],c=o?o(r[s],t[s],s,r,t):void 0;void 0===c&&(c=t[s]),n?yt(r,s,c):ge(r,s,c)}return r};const we=function(t,e){for(var r=-1,o=Array(t);++r<t;)o[r]=e(r);return o};var ye=/^(?:0|[1-9]\d*)$/;const Ae=function(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&ye.test(t))&&t>-1&&t%1==0&&t<e};var je=Object.prototype.hasOwnProperty;const _e=function(t,e){var r=Ut(t),o=!r&&qt(t),n=!r&&!o&&Yt(t),i=!r&&!o&&!n&&fe(t),l=r||o||n||i,s=l?we(t.length,String):[],c=s.length;for(var a in t)!e&&!je.call(t,a)||l&&("length"==a||n&&("offset"==a||"parent"==a)||i&&("buffer"==a||"byteLength"==a||"byteOffset"==a)||Ae(a,c))||s.push(a);return s};const Oe=function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e};var ke=Object.prototype.hasOwnProperty;const Se=function(t){if(!P(t))return Oe(t);var e=Lt(t),r=[];for(var o in t)("constructor"!=o||!e&&ke.call(t,o))&&r.push(o);return r};const Ee=function(t){return Gt(t)?_e(t,!0):Se(t)};const Ce=function(t){return ve(t,Ee(t))};const $e=function(t,e,r,o,n,i,l){var s=be(t,r),c=be(e,r),a=l.get(c);if(a)At(t,r,a);else{var u=i?i(s,c,r+"",t,e,l):void 0,m=void 0===u;if(m){var d=Ut(c),h=!d&&Yt(c),f=!d&&!h&&fe(c);u=c,d||h||f?Ut(s)?u=s:Kt(s)?u=Ft(s):h?(m=!1,u=Et(c,!0)):f?(m=!1,u=xt(c,!0)):u=[]:ie(c)||qt(c)?(u=s,qt(s)?u=Ce(s):P(s)&&!B(s)||(u=Mt(c))):m=!1}m&&(l.set(c,u),n(u,c,o,i,l),l.delete(c)),At(t,r,u)}};const xe=function t(e,r,o,n,i){e!==r&&jt(r,(function(l,s){if(i||(i=new vt),P(l))$e(e,r,s,o,t,n,i);else{var c=n?n(be(e,s),l,s+"",e,r,i):void 0;void 0===c&&(c=l),At(e,s,c)}}),Ee)};const Fe=function(t){return t};const Ie=function(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)};var Pe=Math.max;const Be=function(t,e,r){return e=Pe(void 0===e?t.length-1:e,0),function(){for(var o=arguments,n=-1,i=Pe(o.length-e,0),l=Array(i);++n<i;)l[n]=o[e+n];n=-1;for(var s=Array(e+1);++n<e;)s[n]=o[n];return s[e]=r(l),Ie(t,this,s)}};const Te=function(t){return function(){return t}};const Re=wt?function(t,e){return wt(t,"toString",{configurable:!0,enumerable:!1,value:Te(e),writable:!0})}:Fe;var Le=Date.now;const Me=function(t){var e=0,r=0;return function(){var o=Le(),n=16-(o-r);if(r=o,n>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(Re);const De=function(t,e){return Me(Be(t,e,Fe),t+"")};const He=function(t,e,r){if(!P(r))return!1;var o=typeof e;return!!("number"==o?Gt(r)&&Ae(e,r.length):"string"==o&&e in r)&&s(r[e],t)};const Ne=function(t){return De((function(e,r){var o=-1,n=r.length,i=n>1?r[n-1]:void 0,l=n>2?r[2]:void 0;for(i=t.length>3&&"function"==typeof i?(n--,i):void 0,l&&He(r[0],r[1],l)&&(i=n<3?void 0:i,n=1),e=Object(e);++o<n;){var s=r[o];s&&t(e,s,o,i)}return e}))}((function(t,e,r,o){xe(t,e,r,o)}));class ze extends t.Plugin{constructor(t){super(t),this._definitions=new Map}static get pluginName(){return"DataSchema"}init(){for(const t of n)this.registerBlockElement(t);for(const t of i)this.registerInlineElement(t)}registerBlockElement(t){this._definitions.set(t.model,{...t,isBlock:!0})}registerInlineElement(t){this._definitions.set(t.model,{...t,isInline:!0})}extendBlockElement(t){this._extendDefinition({...t,isBlock:!0})}extendInlineElement(t){this._extendDefinition({...t,isInline:!0})}getDefinitionsForView(t,e){const r=new Set;for(const o of this._getMatchingViewDefinitions(t)){if(e)for(const t of this._getReferences(o.model))r.add(t);r.add(o)}return r}_getMatchingViewDefinitions(t){return Array.from(this._definitions.values()).filter((e=>e.view&&function(t,e){if("string"==typeof t)return t===e;if(t instanceof RegExp)return t.test(e);return!1}(t,e.view)))}*_getReferences(t){const{modelSchema:r}=this._definitions.get(t);if(!r)return;const o=["inheritAllFrom","inheritTypesFrom","allowWhere","allowContentOf","allowAttributesOf"];for(const n of o)for(const o of(0,e.toArray)(r[n]||[])){const e=this._definitions.get(o);o!==t&&e&&(yield*this._getReferences(e.model),yield e)}}_extendDefinition(t){const e=this._definitions.get(t.model),r=Ne({},e,t,((t,e)=>Array.isArray(t)?t.concat(e):void 0));this._definitions.set(t.model,r)}}var Ve=r(492),qe=r(995);const Ue=function(t,e){for(var r=-1,o=null==t?0:t.length;++r<o&&!1!==e(t[r],r,t););return t};const We=Bt(Object.keys,Object);var Ge=Object.prototype.hasOwnProperty;const Ke=function(t){if(!Lt(t))return We(t);var e=[];for(var r in Object(t))Ge.call(t,r)&&"constructor"!=r&&e.push(r);return e};const Ze=function(t){return Gt(t)?_e(t):Ke(t)};const Qe=function(t,e){return t&&ve(e,Ze(e),t)};const Je=function(t,e){return t&&ve(e,Ee(e),t)};const Xe=function(t,e){for(var r=-1,o=null==t?0:t.length,n=0,i=[];++r<o;){var l=t[r];e(l,r,t)&&(i[n++]=l)}return i};const Ye=function(){return[]};var tr=Object.prototype.propertyIsEnumerable,er=Object.getOwnPropertySymbols;const rr=er?function(t){return null==t?[]:(t=Object(t),Xe(er(t),(function(e){return tr.call(t,e)})))}:Ye;const or=function(t,e){return ve(t,rr(t),e)};const nr=function(t,e){for(var r=-1,o=e.length,n=t.length;++r<o;)t[n+r]=e[r];return t};const ir=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)nr(e,rr(t)),t=Tt(t);return e}:Ye;const lr=function(t,e){return ve(t,ir(t),e)};const sr=function(t,e,r){var o=e(t);return Ut(t)?o:nr(o,r(t))};const cr=function(t){return sr(t,Ze,rr)};const ar=function(t){return sr(t,Ee,ir)};const ur=Z(j,"DataView");const mr=Z(j,"Promise");const dr=Z(j,"Set");const hr=Z(j,"WeakMap");var fr="[object Map]",br="[object Promise]",pr="[object Set]",gr="[object WeakMap]",vr="[object DataView]",wr=H(ur),yr=H(Q),Ar=H(mr),jr=H(dr),_r=H(hr),Or=I;(ur&&Or(new ur(new ArrayBuffer(1)))!=vr||Q&&Or(new Q)!=fr||mr&&Or(mr.resolve())!=br||dr&&Or(new dr)!=pr||hr&&Or(new hr)!=gr)&&(Or=function(t){var e=I(t),r="[object Object]"==e?t.constructor:void 0,o=r?H(r):"";if(o)switch(o){case wr:return vr;case yr:return fr;case Ar:return br;case jr:return pr;case _r:return gr}return e});const kr=Or;var Sr=Object.prototype.hasOwnProperty;const Er=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&Sr.call(t,"index")&&(r.index=t.index,r.input=t.input),r};const Cr=function(t,e){var r=e?$t(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)};var $r=/\w*$/;const xr=function(t){var e=new t.constructor(t.source,$r.exec(t));return e.lastIndex=t.lastIndex,e};var Fr=_?_.prototype:void 0,Ir=Fr?Fr.valueOf:void 0;const Pr=function(t){return Ir?Object(Ir.call(t)):{}};const Br=function(t,e,r){var o=t.constructor;switch(e){case"[object ArrayBuffer]":return $t(t);case"[object Boolean]":case"[object Date]":return new o(+t);case"[object DataView]":return Cr(t,r);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return xt(t,r);case"[object Map]":case"[object Set]":return new o;case"[object Number]":case"[object String]":return new o(t);case"[object RegExp]":return xr(t);case"[object Symbol]":return Pr(t)}};const Tr=function(t){return Dt(t)&&"[object Map]"==kr(t)};var Rr=de&&de.isMap;const Lr=Rr?ce(Rr):Tr;const Mr=function(t){return Dt(t)&&"[object Set]"==kr(t)};var Dr=de&&de.isSet;const Hr=Dr?ce(Dr):Mr;var Nr="[object Arguments]",zr="[object Function]",Vr="[object Object]",qr={};qr[Nr]=qr["[object Array]"]=qr["[object ArrayBuffer]"]=qr["[object DataView]"]=qr["[object Boolean]"]=qr["[object Date]"]=qr["[object Float32Array]"]=qr["[object Float64Array]"]=qr["[object Int8Array]"]=qr["[object Int16Array]"]=qr["[object Int32Array]"]=qr["[object Map]"]=qr["[object Number]"]=qr["[object Object]"]=qr["[object RegExp]"]=qr["[object Set]"]=qr["[object String]"]=qr["[object Symbol]"]=qr["[object Uint8Array]"]=qr["[object Uint8ClampedArray]"]=qr["[object Uint16Array]"]=qr["[object Uint32Array]"]=!0,qr["[object Error]"]=qr[zr]=qr["[object WeakMap]"]=!1;const Ur=function t(e,r,o,n,i,l){var s,c=1&r,a=2&r,u=4&r;if(o&&(s=i?o(e,n,i,l):o(e)),void 0!==s)return s;if(!P(e))return e;var m=Ut(e);if(m){if(s=Er(e),!c)return Ft(e,s)}else{var d=kr(e),h=d==zr||"[object GeneratorFunction]"==d;if(Yt(e))return Et(e,c);if(d==Vr||d==Nr||h&&!i){if(s=a||h?{}:Mt(e),!c)return a?lr(e,Je(s,e)):or(e,Qe(s,e))}else{if(!qr[d])return i?e:{};s=Br(e,d,c)}}l||(l=new vt);var f=l.get(e);if(f)return f;l.set(e,s),Hr(e)?e.forEach((function(n){s.add(t(n,r,o,n,e,l))})):Lr(e)&&e.forEach((function(n,i){s.set(i,t(n,r,o,i,e,l))}));var b=m?void 0:(u?a?ar:cr:a?Ee:Ze)(e);return Ue(b||e,(function(n,i){b&&(n=e[i=n]),ge(s,i,t(n,r,o,i,e,l))})),s};const Wr=function(t){return Ur(t,5)};function Gr(t,e,r,o){e&&function(t,e,r){if(e.attributes)for(const[o]of Object.entries(e.attributes))t.removeAttribute(o,r);if(e.styles)for(const o of Object.keys(e.styles))t.removeStyle(o,r);e.classes&&t.removeClass(e.classes,r)}(t,e,o),r&&Kr(t,r,o)}function Kr(t,e,r){if(e.attributes)for(const[o,n]of Object.entries(e.attributes))t.setAttribute(o,n,r);e.styles&&t.setStyle(e.styles,r),e.classes&&t.addClass(e.classes,r)}function Zr(t,e){const r=Wr(t);for(const o in e)Array.isArray(e[o])?r[o]=Array.from(new Set([...t[o]||[],...e[o]])):r[o]={...t[o],...e[o]};return r}function Qr({model:t}){return(e,r)=>r.writer.createElement(t,{htmlContent:e.getCustomProperty("$rawContent")})}function Jr(t,{view:e,isInline:r}){const o=t.t;return(t,{writer:n})=>{const i=o("HTML object"),l=Xr(e,t,n),s=t.getAttribute("htmlAttributes");n.addClass("html-object-embed__content",l),s&&Kr(n,s,l);const c=n.createContainerElement(r?"span":"div",{class:"html-object-embed","data-html-object-embed-label":i},l);return(0,qe.toWidget)(c,n,{widgetLabel:i})}}function Xr(t,e,r){return r.createRawElement(t,null,((t,r)=>{r.setContentOf(t,e.getAttribute("htmlContent"))}))}function Yr({priority:t,view:e}){return(r,o)=>{if(!r)return;const{writer:n}=o,i=n.createAttributeElement(e,null,{priority:t});return Kr(n,r,i),i}}function to({view:t},e){return r=>{r.on(`element:${t}`,((t,r,o)=>{if(!r.modelRange)return;const n=e._consumeAllowedAttributes(r.viewItem,o);n&&o.writer.setAttribute("htmlAttributes",n,r.modelRange)}),{priority:"low"})}}function eo({model:t}){return e=>{e.on(`attribute:htmlAttributes:${t}`,((t,e,r)=>{if(!r.consumable.consume(e.item,t.name))return;const{attributeOldValue:o,attributeNewValue:n}=e;Gr(r.writer,o,n,r.mapper.toViewElement(e.item))}))}}const ro=function(t,e){for(var r=-1,o=null==t?0:t.length,n=Array(o);++r<o;)n[r]=e(t[r],r,t);return n};const oo=function(t,e,r,o){for(var n=t.length,i=r+(o?1:-1);o?i--:++i<n;)if(e(t[i],i,t))return i;return-1};const no=function(t){return t!=t};const io=function(t,e,r){for(var o=r-1,n=t.length;++o<n;)if(t[o]===e)return o;return-1};const lo=function(t,e,r){return e==e?io(t,e,r):oo(t,no,r)};const so=function(t,e,r,o){for(var n=r-1,i=t.length;++n<i;)if(o(t[n],e))return n;return-1};var co=Array.prototype.splice;const ao=function(t,e,r,o){var n=o?so:lo,i=-1,l=e.length,s=t;for(t===e&&(e=Ft(e)),r&&(s=ro(t,ce(r)));++i<l;)for(var c=0,a=e[i],u=r?r(a):a;(c=n(s,u,c,o))>-1;)s!==t&&co.call(s,c,1),co.call(t,c,1);return t};const uo=De((function(t,e){return t&&t.length&&e&&e.length?ao(t,e):t}));var mo=r(62),ho=r.n(mo),fo=r(142),bo={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};ho()(fo.Z,bo);fo.Z.locals;class po extends t.Plugin{constructor(t){super(t),this._dataSchema=t.plugins.get("DataSchema"),this._allowedAttributes=new Ve.Matcher,this._disallowedAttributes=new Ve.Matcher,this._allowedElements=new Set,this._dataInitialized=!1,this._registerElementsAfterInit(),this._registerElementHandlers()}static get pluginName(){return"DataFilter"}static get requires(){return[ze,qe.Widget]}loadAllowedConfig(t){this._loadConfig(t,(t=>this.allowAttributes(t)))}loadDisallowedConfig(t){this._loadConfig(t,(t=>this.disallowAttributes(t)))}allowElement(t){for(const e of this._dataSchema.getDefinitionsForView(t,!0))this._allowedElements.has(e)||(this._allowedElements.add(e),this._dataInitialized&&this._fireRegisterEvent(e))}allowAttributes(t){this._allowedAttributes.add(t)}disallowAttributes(t){this._disallowedAttributes.add(t)}_loadConfig(t,e){for(const r of t){const t=r.name||/[\s\S]+/;this.allowElement(t),Ao(r).forEach(e)}}_consumeAllowedAttributes(t,e){return go(t,e,this._disallowedAttributes),go(t,e,this._allowedAttributes)}_registerElementsAfterInit(){this.editor.data.on("init",(()=>{this._dataInitialized=!0;for(const t of this._allowedElements)this._fireRegisterEvent(t)}),{priority:e.priorities.get("highest")+1})}_registerElementHandlers(){this.on("register",((t,r)=>{const o=this.editor.model.schema;if(r.isObject&&!o.isRegistered(r.model))this._registerObjectElement(r);else if(r.isBlock)this._registerBlockElement(r);else{if(!r.isInline)throw new e.CKEditorError("data-filter-invalid-definition",null,r);this._registerInlineElement(r)}t.stop()}),{priority:"lowest"})}_fireRegisterEvent(t){this.fire(t.view?`register:${t.view}`:"register",t)}_registerObjectElement(t){const r=this.editor,o=r.model.schema,n=r.conversion,{view:i,model:l}=t;o.register(l,t.modelSchema),i&&(o.extend(t.model,{allowAttributes:["htmlAttributes","htmlContent"]}),r.data.registerRawContentMatcher({name:i}),n.for("upcast").elementToElement({view:i,model:Qr(t),converterPriority:e.priorities.get("low")+1}),n.for("upcast").add(to(t,this)),n.for("editingDowncast").elementToStructure({model:{name:l,attributes:["htmlAttributes"]},view:Jr(r,t)}),n.for("dataDowncast").elementToElement({model:l,view:(t,{writer:e})=>Xr(i,t,e)}),n.for("dataDowncast").add(eo(t)))}_registerBlockElement(t){const r=this.editor,o=r.model.schema,n=r.conversion,{view:i,model:l}=t;if(!o.isRegistered(t.model)){if(o.register(t.model,t.modelSchema),!i)return;n.for("upcast").elementToElement({model:l,view:i,converterPriority:e.priorities.get("low")+1}),n.for("downcast").elementToElement({model:l,view:i})}i&&(o.extend(t.model,{allowAttributes:"htmlAttributes"}),n.for("upcast").add(to(t,this)),n.for("downcast").add(eo(t)))}_registerInlineElement(t){const e=this.editor,r=e.model.schema,o=e.conversion,n=t.model;r.extend("$text",{allowAttributes:n}),t.attributeProperties&&r.setAttributeProperties(n,t.attributeProperties),o.for("upcast").add(function({view:t,model:e},r){return o=>{o.on(`element:${t}`,((t,o,n)=>{const i=r._consumeAllowedAttributes(o.viewItem,n);if(i||n.consumable.test(o.viewItem,{name:!0})){o.modelRange||(o=Object.assign(o,n.convertChildren(o.viewItem,o.modelCursor)));for(const t of o.modelRange.getItems())if(n.schema.checkAttribute(t,e)){const r=Zr(i||{},t.getAttribute(e)||{});n.writer.setAttribute(e,r,t)}}}),{priority:"low"})}}(t,this)),o.for("downcast").attributeToElement({model:n,view:Yr(t)})}}function go(t,e,r){const o=function(t,{consumable:e},r){const o=r.matchAll(t)||[],n=[];for(const r of o)vo(e,t,r),delete r.match.name,e.consume(t,r.match)&&n.push(r);return n}(t,e,r),{attributes:n,styles:i,classes:l}=function(t){const e={attributes:new Set,classes:new Set,styles:new Set};for(const r of t)for(const t in e){(r.match[t]||[]).forEach((r=>e[t].add(r)))}return e}(o),s={};return n.size&&(s.attributes=wo(n,(e=>t.getAttribute(e)))),i.size&&(s.styles=wo(i,(e=>t.getStyle(e)))),l.size&&(s.classes=Array.from(l)),Object.keys(s).length?s:null}function vo(t,e,r){for(const o of["attributes","classes","styles"]){const n=r.match[o];if(n)for(const r of n)t.test(e,{[o]:[r]})||uo(n,r)}}function wo(t,e){const r={};for(const o of t){void 0!==e(o)&&(r[o]=e(o))}return r}function yo(t,e){const{name:r}=t;return ie(t[e])?Object.entries(t[e]).map((([t,o])=>({name:r,[e]:{[t]:o}}))):Array.isArray(t[e])?t[e].map((t=>({name:r,[e]:[t]}))):[t]}function Ao(t){const{name:e,attributes:r,classes:o,styles:n}=t,i=[];return r&&i.push(...yo({name:e,attributes:r},"attributes")),o&&i.push(...yo({name:e,classes:o},"classes")),n&&i.push(...yo({name:e,styles:n},"styles")),i}class jo extends t.Plugin{static get requires(){return[po]}init(){if(!this.editor.plugins.has("CodeBlockEditing"))return;const t=this.editor.plugins.get(po);t.on("register:pre",((e,r)=>{if("codeBlock"!==r.model)return;const o=this.editor,n=o.model.schema,i=o.conversion;n.extend("codeBlock",{allowAttributes:["htmlAttributes","htmlContentAttributes"]}),i.for("upcast").add(function(t){return e=>{e.on("element:code",((e,r,o)=>{const n=r.viewItem,i=n.parent;function l(e,n){const i=t._consumeAllowedAttributes(e,o);i&&o.writer.setAttribute(n,i,r.modelRange)}i&&i.is("element","pre")&&(l(i,"htmlAttributes"),l(n,"htmlContentAttributes"))}),{priority:"low"})}}(t)),i.for("downcast").add((t=>{t.on("attribute:htmlAttributes:codeBlock",((t,e,r)=>{if(!r.consumable.consume(e.item,t.name))return;const{attributeOldValue:o,attributeNewValue:n}=e,i=r.mapper.toViewElement(e.item).parent;Gr(r.writer,o,n,i)})),t.on("attribute:htmlContentAttributes:codeBlock",((t,e,r)=>{if(!r.consumable.consume(e.item,t.name))return;const{attributeOldValue:o,attributeNewValue:n}=e,i=r.mapper.toViewElement(e.item);Gr(r.writer,o,n,i)}))})),e.stop()}))}}class _o extends t.Plugin{static get requires(){return[po]}init(){this.editor.plugins.get(po).on("register",((t,r)=>{const o=this.editor,n=o.model.schema,i=o.conversion;if(!r.paragraphLikeModel)return;if(n.isRegistered(r.model)||n.isRegistered(r.paragraphLikeModel))return;const l={model:r.paragraphLikeModel,view:r.view};n.register(r.model,r.modelSchema),n.register(l.model,{inheritAllFrom:"$block"}),i.for("upcast").elementToElement({view:r.view,model:(t,{writer:e})=>this._hasBlockContent(t)?e.createElement(r.model):e.createElement(l.model),converterPriority:e.priorities.get("low")+1}),i.for("downcast").elementToElement({view:r.view,model:r.model}),this._addAttributeConversion(r),i.for("downcast").elementToElement({view:l.view,model:l.model}),this._addAttributeConversion(l),t.stop()}))}_hasBlockContent(t){const e=this.editor.editing.view.domConverter.blockElements;return Array.from(t.getChildren()).some((t=>e.includes(t.name)))}_addAttributeConversion(t){const e=this.editor,r=e.conversion,o=e.plugins.get(po);e.model.schema.extend(t.model,{allowAttributes:"htmlAttributes"}),r.for("upcast").add(to(t,o)),r.for("downcast").add(eo(t))}}class Oo extends t.Plugin{static get requires(){return[ze]}init(){const t=this.editor;if(!t.plugins.has("HeadingEditing"))return;const e=t.plugins.get(ze),r=t.config.get("heading.options"),o=[];for(const t of r)"model"in t&&"view"in t&&(e.registerBlockElement({view:t.view,model:t.model}),o.push(t.model));e.extendBlockElement({model:"htmlHgroup",modelSchema:{allowChildren:o}})}}class ko extends t.Plugin{static get requires(){return[po]}init(){const t=this.editor;if(!t.plugins.has("ImageInlineEditing")&&!t.plugins.has("ImageBlockEditing"))return;const e=t.model.schema,r=t.conversion,o=t.plugins.get(po);o.on("register:img",((t,n)=>{"imageBlock"!==n.model&&"imageInline"!==n.model||(e.isRegistered("imageBlock")&&e.extend("imageBlock",{allowAttributes:["htmlAttributes","htmlFigureAttributes","htmlLinkAttributes"]}),e.isRegistered("imageInline")&&e.extend("imageInline",{allowAttributes:["htmlA","htmlAttributes"]}),r.for("upcast").add(function(t){return e=>{e.on("element:img",((e,r,o)=>{if(!r.modelRange)return;const n=r.viewItem,i=n.parent;function l(e,n){const i=t._consumeAllowedAttributes(e,o);i&&o.writer.setAttribute(n,i,r.modelRange)}function s(t){r.modelRange&&r.modelRange.getContainedElement().is("element","imageBlock")&&l(t,"htmlLinkAttributes"),t.parent.is("element","figure")&&l(t.parent,"htmlFigureAttributes")}l(n,"htmlAttributes"),i.is("element","figure")?l(i,"htmlFigureAttributes"):i.is("element","a")&&s(i)}),{priority:"low"})}}(o)),r.for("downcast").add((t=>{function e(e){t.on(`attribute:${e}:imageInline`,((t,e,r)=>{if(!r.consumable.consume(e.item,t.name))return;const{attributeOldValue:o,attributeNewValue:n}=e,i=r.mapper.toViewElement(e.item);Gr(r.writer,o,n,i)}),{priority:"low"})}function r(e,r){t.on(`attribute:${r}:imageBlock`,((t,r,o)=>{if(!o.consumable.test(r.item,t.name))return;const{attributeOldValue:n,attributeNewValue:i}=r,l=o.mapper.toViewElement(r.item),s=So(o.writer,l,e);s&&(Gr(o.writer,n,i,s),o.consumable.consume(r.item,t.name))}),{priority:"low"}),"a"===e&&t.on("attribute:linkHref:imageBlock",((t,e,r)=>{if(!r.consumable.consume(e.item,"attribute:htmlLinkAttributes:imageBlock"))return;const o=r.mapper.toViewElement(e.item),n=So(r.writer,o,"a");Kr(r.writer,e.item.getAttribute("htmlLinkAttributes"),n)}),{priority:"low"})}e("htmlAttributes"),r("img","htmlAttributes"),r("figure","htmlFigureAttributes"),r("a","htmlLinkAttributes")})),t.stop())}))}}function So(t,e,r){const o=t.createRangeOn(e);for(const{item:t}of o.getWalker())if(t.is("element",r))return t}class Eo extends t.Plugin{static get requires(){return[po]}init(){const t=this.editor;if(!t.plugins.has("MediaEmbed")||t.config.get("mediaEmbed.previewsInData"))return;const e=t.model.schema,r=t.conversion,o=this.editor.plugins.get(po),n=this.editor.plugins.get(ze),i=t.config.get("mediaEmbed.elementName");n.registerBlockElement({model:"media",view:i}),o.on(`register:${i}`,((t,n)=>{"media"===n.model&&(e.extend("media",{allowAttributes:["htmlAttributes","htmlFigureAttributes"]}),r.for("upcast").add(function(t,e){return t=>{t.on(`element:${e}`,r)};function r(e,r,o){const n=r.viewItem,i=n.parent;function l(e,n){const i=t._consumeAllowedAttributes(e,o);i&&o.writer.setAttribute(n,i,r.modelRange)}l(n,"htmlAttributes"),i.is("element","figure")&&i.hasClass("media")&&l(i,"htmlFigureAttributes")}}(o,i)),r.for("dataDowncast").add(function(t){return e=>{function r(t,r){e.on(`attribute:${r}:media`,((e,r,o)=>{if(!o.consumable.consume(r.item,e.name))return;const{attributeOldValue:n,attributeNewValue:i}=r,l=o.mapper.toViewElement(r.item),s=function(t,e,r){const o=t.createRangeOn(e);for(const{item:t}of o.getWalker())if(t.is("element",r))return t}(o.writer,l,t);Gr(o.writer,n,i,s)}))}r(t,"htmlAttributes"),r("figure","htmlFigureAttributes")}}(i)),t.stop())}))}}class Co extends t.Plugin{static get requires(){return[po]}init(){const t=this.editor.plugins.get(po);t.on("register:script",((e,r)=>{const o=this.editor,n=o.model.schema,i=o.conversion;n.register("htmlScript",r.modelSchema),n.extend("htmlScript",{allowAttributes:["htmlAttributes","htmlContent"],isContent:!0}),o.data.registerRawContentMatcher({name:"script"}),i.for("upcast").elementToElement({view:"script",model:Qr(r)}),i.for("upcast").add(to(r,t)),i.for("downcast").elementToElement({model:"htmlScript",view:(t,{writer:e})=>Xr("script",t,e)}),i.for("downcast").add(eo(r)),e.stop()}))}}class $o extends t.Plugin{static get requires(){return[po]}init(){const t=this.editor;if(!t.plugins.has("TableEditing"))return;const e=t.model.schema,r=t.conversion,o=t.plugins.get(po);o.on("register:table",((t,n)=>{"table"===n.model&&(e.extend("table",{allowAttributes:["htmlAttributes","htmlFigureAttributes","htmlTheadAttributes","htmlTbodyAttributes"]}),r.for("upcast").add(function(t){return e=>{e.on("element:table",((e,r,o)=>{const n=r.viewItem;l(n,"htmlAttributes");const i=n.parent;i.is("element","figure")&&l(i,"htmlFigureAttributes");for(const t of n.getChildren())t.is("element","thead")&&l(t,"htmlTheadAttributes"),t.is("element","tbody")&&l(t,"htmlTbodyAttributes");function l(e,n){const i=t._consumeAllowedAttributes(e,o);i&&o.writer.setAttribute(n,i,r.modelRange)}}),{priority:"low"})}}(o)),r.for("downcast").add((t=>{function e(e,r){t.on(`attribute:${r}:table`,((t,r,o)=>{if(!o.consumable.consume(r.item,t.name))return;const n=o.mapper.toViewElement(r.item),i=function(t,e,r){const o=t.createRangeOn(e);for(const{item:t}of o.getWalker())if(t.is("element",r))return t}(o.writer,n,e);Kr(o.writer,r.attributeNewValue,i)}))}e("table","htmlAttributes"),e("figure","htmlFigureAttributes"),e("thead","htmlTheadAttributes"),e("tbody","htmlTbodyAttributes")})),t.stop())}))}}class xo extends t.Plugin{static get requires(){return[po]}init(){const t=this.editor.plugins.get(po);t.on("register:style",((e,r)=>{const o=this.editor,n=o.model.schema,i=o.conversion;n.register("htmlStyle",r.modelSchema),n.extend("htmlStyle",{allowAttributes:["htmlAttributes","htmlContent"],isContent:!0}),o.data.registerRawContentMatcher({name:"style"}),i.for("upcast").elementToElement({view:"style",model:Qr(r)}),i.for("upcast").add(to(r,t)),i.for("downcast").elementToElement({model:"htmlStyle",view:(t,{writer:e})=>Xr("style",t,e)}),i.for("downcast").add(eo(r)),e.stop()}))}}const Fo=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this};const Io=function(t){return this.__data__.has(t)};function Po(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new bt;++e<r;)this.add(t[e])}Po.prototype.add=Po.prototype.push=Fo,Po.prototype.has=Io;const Bo=Po;const To=function(t,e){for(var r=-1,o=null==t?0:t.length;++r<o;)if(e(t[r],r,t))return!0;return!1};const Ro=function(t,e){return t.has(e)};const Lo=function(t,e,r,o,n,i){var l=1&r,s=t.length,c=e.length;if(s!=c&&!(l&&c>s))return!1;var a=i.get(t),u=i.get(e);if(a&&u)return a==e&&u==t;var m=-1,d=!0,h=2&r?new Bo:void 0;for(i.set(t,e),i.set(e,t);++m<s;){var f=t[m],b=e[m];if(o)var p=l?o(b,f,m,e,t,i):o(f,b,m,t,e,i);if(void 0!==p){if(p)continue;d=!1;break}if(h){if(!To(e,(function(t,e){if(!Ro(h,e)&&(f===t||n(f,t,r,o,i)))return h.push(e)}))){d=!1;break}}else if(f!==b&&!n(f,b,r,o,i)){d=!1;break}}return i.delete(t),i.delete(e),d};const Mo=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t,o){r[++e]=[o,t]})),r};const Do=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r};var Ho=_?_.prototype:void 0,No=Ho?Ho.valueOf:void 0;const zo=function(t,e,r,o,n,i,l){switch(r){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!i(new Ct(t),new Ct(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return s(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var c=Mo;case"[object Set]":var a=1&o;if(c||(c=Do),t.size!=e.size&&!a)return!1;var u=l.get(t);if(u)return u==e;o|=2,l.set(t,e);var m=Lo(c(t),c(e),o,n,i,l);return l.delete(t),m;case"[object Symbol]":if(No)return No.call(t)==No.call(e)}return!1};var Vo=Object.prototype.hasOwnProperty;const qo=function(t,e,r,o,n,i){var l=1&r,s=cr(t),c=s.length;if(c!=cr(e).length&&!l)return!1;for(var a=c;a--;){var u=s[a];if(!(l?u in e:Vo.call(e,u)))return!1}var m=i.get(t),d=i.get(e);if(m&&d)return m==e&&d==t;var h=!0;i.set(t,e),i.set(e,t);for(var f=l;++a<c;){var b=t[u=s[a]],p=e[u];if(o)var g=l?o(p,b,u,e,t,i):o(b,p,u,t,e,i);if(!(void 0===g?b===p||n(b,p,r,o,i):g)){h=!1;break}f||(f="constructor"==u)}if(h&&!f){var v=t.constructor,w=e.constructor;v==w||!("constructor"in t)||!("constructor"in e)||"function"==typeof v&&v instanceof v&&"function"==typeof w&&w instanceof w||(h=!1)}return i.delete(t),i.delete(e),h};var Uo="[object Arguments]",Wo="[object Array]",Go="[object Object]",Ko=Object.prototype.hasOwnProperty;const Zo=function(t,e,r,o,n,i){var l=Ut(t),s=Ut(e),c=l?Wo:kr(t),a=s?Wo:kr(e),u=(c=c==Uo?Go:c)==Go,m=(a=a==Uo?Go:a)==Go,d=c==a;if(d&&Yt(t)){if(!Yt(e))return!1;l=!0,u=!1}if(d&&!u)return i||(i=new vt),l||fe(t)?Lo(t,e,r,o,n,i):zo(t,e,c,r,o,n,i);if(!(1&r)){var h=u&&Ko.call(t,"__wrapped__"),f=m&&Ko.call(e,"__wrapped__");if(h||f){var b=h?t.value():t,p=f?e.value():e;return i||(i=new vt),n(b,p,r,o,i)}}return!!d&&(i||(i=new vt),qo(t,e,r,o,n,i))};const Qo=function t(e,r,o,n,i){return e===r||(null==e||null==r||!Dt(e)&&!Dt(r)?e!=e&&r!=r:Zo(e,r,o,n,t,i))};const Jo=function(t,e){return Qo(t,e)};class Xo extends t.Plugin{static get requires(){return[po]}init(){const t=this.editor;if(!t.plugins.has("DocumentListEditing"))return;const e=t.model.schema,r=t.conversion,o=t.plugins.get(po),n=t.plugins.get("DocumentListEditing");n.registerDowncastStrategy({scope:"item",attributeName:"htmlLiAttributes",setAttributeOnDowncast(t,e,r){Kr(t,e,r)}}),n.registerDowncastStrategy({scope:"list",attributeName:"htmlListAttributes",setAttributeOnDowncast(t,e,r){Kr(t,e,r)}}),o.on("register",((t,n)=>{["ul","ol","li"].includes(n.view)&&(t.stop(),e.checkAttribute("$block","htmlListAttributes")||(e.extend("$block",{allowAttributes:["htmlListAttributes","htmlLiAttributes"]}),e.extend("$blockObject",{allowAttributes:["htmlListAttributes","htmlLiAttributes"]}),e.extend("$container",{allowAttributes:["htmlListAttributes","htmlLiAttributes"]}),r.for("upcast").add((t=>{t.on("element:ul",Yo("htmlListAttributes",o),{priority:"low"}),t.on("element:ol",Yo("htmlListAttributes",o),{priority:"low"}),t.on("element:li",Yo("htmlLiAttributes",o),{priority:"low"})}))))})),n.on("postFixer",((t,{listNodes:e,writer:r})=>{const o=[];for(const{node:n,previous:i}of e){if(!i)continue;const e=n.getAttribute("listIndent"),l=i.getAttribute("listIndent");let s=null;if(e>l?o[l]=i:e<l?(s=o[e],o.length=e):s=i,s){if(s.getAttribute("listType")==n.getAttribute("listType")){const e=s.getAttribute("htmlListAttributes");Jo(n.getAttribute("htmlListAttributes"),e)||(r.setAttribute("htmlListAttributes",e,n),t.return=!0)}if(s.getAttribute("listItemId")==n.getAttribute("listItemId")){const e=s.getAttribute("htmlLiAttributes");Jo(n.getAttribute("htmlLiAttributes"),e)||(r.setAttribute("htmlLiAttributes",e,n),t.return=!0)}}}}))}afterInit(){const t=this.editor;t.commands.get("indentList")&&this.listenTo(t.commands.get("indentList"),"afterExecute",((e,r)=>{t.model.change((t=>{for(const e of r)t.setAttribute("htmlListAttributes",{},e)}))}))}}function Yo(t,e){return(r,o,n)=>{const i=o.viewItem;o.modelRange||Object.assign(o,n.convertChildren(o.viewItem,o.modelCursor));const l=e._consumeAllowedAttributes(i,n);for(const e of o.modelRange.getItems({shallow:!0}))e.hasAttribute("listItemId")&&(e.hasAttribute(t)||n.writer.setAttribute(t,l||{},e))}}class tn extends t.Plugin{static get pluginName(){return"GeneralHtmlSupport"}static get requires(){return[po,jo,_o,Oo,ko,Eo,Co,$o,xo,Xo]}init(){const t=this.editor,e=t.plugins.get(po);e.loadAllowedConfig(t.config.get("htmlSupport.allow")||[]),e.loadDisallowedConfig(t.config.get("htmlSupport.disallow")||[])}getGhsAttributeNameForElement(t){const e=this.editor.plugins.get("DataSchema"),r=Array.from(e.getDefinitionsForView(t,!1));return r&&r.length&&r[0].isInline&&!r[0].isObject?r[0].model:"htmlAttributes"}addModelHtmlClass(t,r,o){const n=this.editor.model,i=this.getGhsAttributeNameForElement(t);n.change((t=>{for(const l of en(n,o,i))rn(t,l,i,"classes",(t=>{for(const o of(0,e.toArray)(r))t.add(o)}))}))}removeModelHtmlClass(t,r,o){const n=this.editor.model,i=this.getGhsAttributeNameForElement(t);n.change((t=>{for(const l of en(n,o,i))rn(t,l,i,"classes",(t=>{for(const o of(0,e.toArray)(r))t.delete(o)}))}))}setModelHtmlAttributes(t,e,r){const o=this.editor.model,n=this.getGhsAttributeNameForElement(t);o.change((t=>{for(const i of en(o,r,n))rn(t,i,n,"attributes",(t=>{for(const[r,o]of Object.entries(e))t.set(r,o)}))}))}removeModelHtmlAttributes(t,r,o){const n=this.editor.model,i=this.getGhsAttributeNameForElement(t);n.change((t=>{for(const l of en(n,o,i))rn(t,l,i,"attributes",(t=>{for(const o of(0,e.toArray)(r))t.delete(o)}))}))}setModelHtmlStyles(t,e,r){const o=this.editor.model,n=this.getGhsAttributeNameForElement(t);o.change((t=>{for(const i of en(o,r,n))rn(t,i,n,"styles",(t=>{for(const[r,o]of Object.entries(e))t.set(r,o)}))}))}removeModelHtmlStyles(t,r,o){const n=this.editor.model,i=this.getGhsAttributeNameForElement(t);n.change((t=>{for(const l of en(n,o,i))rn(t,l,i,"styles",(t=>{for(const o of(0,e.toArray)(r))t.delete(o)}))}))}}function*en(t,e,r){if(e.is("documentSelection")&&e.isCollapsed)t.schema.checkAttributeInSelection(e,r)&&(yield e);else for(const o of function(t,e,r){return e.is("node")||e.is("$text")||e.is("$textProxy")?t.schema.checkAttribute(e,r)?[t.createRangeOn(e)]:[]:t.schema.getValidRanges(t.createSelection(e).getRanges(),r)}(t,e,r))yield*o.getItems({shallow:!0})}function rn(t,e,r,o,n){const i=e.getAttribute(r),l={};for(const t of["attributes","styles","classes"])if(t!=o)i&&i[t]&&(l[t]=i[t]);else{const e="classes"==t?new Set(i&&i[t]||[]):new Map(Object.entries(i&&i[t]||{}));n(e),e.size&&(l[t]="classes"==t?Array.from(e):Object.fromEntries(e))}Object.keys(l).length?e.is("documentSelection")?t.setSelectionAttribute(r,l):t.setAttribute(r,l,e):i&&(e.is("documentSelection")?t.removeSelectionAttribute(r):t.removeAttribute(r,e))}class on extends t.Plugin{static get pluginName(){return"HtmlComment"}init(){const t=this.editor;t.model.schema.addAttributeCheck(((t,e)=>{if(t.endsWith("$root")&&e.startsWith("$comment"))return!0})),t.conversion.for("upcast").elementToMarker({view:"$comment",model:(t,{writer:r})=>{const o=this.editor.model.document.getRoot(),n=t.getCustomProperty("$rawContent"),i=`$comment:${(0,e.uid)()}`;return r.setAttribute(i,n,o),i}}),t.conversion.for("dataDowncast").markerToElement({model:"$comment",view:(t,{writer:e})=>{const r=this.editor.model.document.getRoot(),o=t.markerName,n=r.getAttribute(o),i=e.createUIElement("$comment");return e.setCustomProperty("$rawContent",n,i),i}}),t.model.document.registerPostFixer((e=>{const r=t.model.document.getRoot(),o=t.model.document.differ.getChangedMarkers().filter((t=>t.name.startsWith("$comment"))).filter((t=>{const e=t.data.newRange;return e&&"$graveyard"===e.root.rootName}));if(0===o.length)return!1;for(const t of o)e.removeMarker(t.name),e.removeAttribute(t.name,r);return!0})),t.data.on("set",(()=>{for(const e of t.model.markers.getMarkersGroup("$comment"))this.removeHtmlComment(e.name)}),{priority:"high"}),t.model.on("deleteContent",((e,[r])=>{for(const e of r.getRanges()){const r=t.model.schema.getLimitElement(e),o=t.model.createPositionAt(r,0),n=t.model.createPositionAt(r,"end");let i;i=o.isTouching(e.start)&&n.isTouching(e.end)?this.getHtmlCommentsInRange(t.model.createRange(o,n)):this.getHtmlCommentsInRange(e,{skipBoundaries:!0});for(const t of i)this.removeHtmlComment(t)}}),{priority:"high"})}createHtmlComment(t,r){const o=(0,e.uid)(),n=this.editor.model,i=n.document.getRoot(),l=`$comment:${o}`;return n.change((e=>{const o=e.createRange(t);return e.addMarker(l,{usingOperation:!0,affectsData:!0,range:o}),e.setAttribute(l,r,i),l}))}removeHtmlComment(t){const e=this.editor,r=e.model.document.getRoot(),o=e.model.markers.get(t);return!!o&&(e.model.change((e=>{e.removeMarker(o),e.removeAttribute(t,r)})),!0)}getHtmlCommentData(t){const e=this.editor,r=e.model.markers.get(t),o=e.model.document.getRoot();return r?{content:o.getAttribute(t),position:r.getStart()}:null}getHtmlCommentsInRange(t,{skipBoundaries:e=!1}={}){const r=!e;return Array.from(this.editor.model.markers.getMarkersGroup("$comment")).filter((e=>function(t,e){const o=t.getRange().start;return(o.isAfter(e.start)||r&&o.isEqual(e.start))&&(o.isBefore(e.end)||r&&o.isEqual(e.end))}(e,t))).map((t=>t.name))}}})(),(window.CKEditor5=window.CKEditor5||{}).htmlSupport=o})();
{
"name": "@ckeditor/ckeditor5-html-support",
"version": "33.0.0",
"version": "34.0.0",
"description": "HTML Support feature for CKEditor 5.",

@@ -19,35 +19,35 @@ "keywords": [

"dependencies": {
"ckeditor5": "^33.0.0",
"ckeditor5": "^34.0.0",
"lodash-es": "^4.17.15"
},
"devDependencies": {
"@ckeditor/ckeditor5-alignment": "^33.0.0",
"@ckeditor/ckeditor5-basic-styles": "^33.0.0",
"@ckeditor/ckeditor5-block-quote": "^33.0.0",
"@ckeditor/ckeditor5-cloud-services": "^33.0.0",
"@ckeditor/ckeditor5-code-block": "^33.0.0",
"@ckeditor/ckeditor5-core": "^33.0.0",
"@ckeditor/ckeditor5-dev-utils": "^28.0.1",
"@ckeditor/ckeditor5-easy-image": "^33.0.0",
"@ckeditor/ckeditor5-editor-classic": "^33.0.0",
"@ckeditor/ckeditor5-engine": "^33.0.0",
"@ckeditor/ckeditor5-enter": "^33.0.0",
"@ckeditor/ckeditor5-essentials": "^33.0.0",
"@ckeditor/ckeditor5-font": "^33.0.0",
"@ckeditor/ckeditor5-heading": "^33.0.0",
"@ckeditor/ckeditor5-highlight": "^33.0.0",
"@ckeditor/ckeditor5-horizontal-line": "^33.0.0",
"@ckeditor/ckeditor5-html-embed": "^33.0.0",
"@ckeditor/ckeditor5-image": "^33.0.0",
"@ckeditor/ckeditor5-indent": "^33.0.0",
"@ckeditor/ckeditor5-link": "^33.0.0",
"@ckeditor/ckeditor5-list": "^33.0.0",
"@ckeditor/ckeditor5-media-embed": "^33.0.0",
"@ckeditor/ckeditor5-page-break": "^33.0.0",
"@ckeditor/ckeditor5-paragraph": "^33.0.0",
"@ckeditor/ckeditor5-paste-from-office": "^33.0.0",
"@ckeditor/ckeditor5-source-editing": "^33.0.0",
"@ckeditor/ckeditor5-table": "^33.0.0",
"@ckeditor/ckeditor5-theme-lark": "^33.0.0",
"@ckeditor/ckeditor5-utils": "^33.0.0",
"@ckeditor/ckeditor5-alignment": "^34.0.0",
"@ckeditor/ckeditor5-basic-styles": "^34.0.0",
"@ckeditor/ckeditor5-block-quote": "^34.0.0",
"@ckeditor/ckeditor5-cloud-services": "^34.0.0",
"@ckeditor/ckeditor5-code-block": "^34.0.0",
"@ckeditor/ckeditor5-core": "^34.0.0",
"@ckeditor/ckeditor5-dev-utils": "^30.0.0",
"@ckeditor/ckeditor5-easy-image": "^34.0.0",
"@ckeditor/ckeditor5-editor-classic": "^34.0.0",
"@ckeditor/ckeditor5-engine": "^34.0.0",
"@ckeditor/ckeditor5-enter": "^34.0.0",
"@ckeditor/ckeditor5-essentials": "^34.0.0",
"@ckeditor/ckeditor5-font": "^34.0.0",
"@ckeditor/ckeditor5-heading": "^34.0.0",
"@ckeditor/ckeditor5-highlight": "^34.0.0",
"@ckeditor/ckeditor5-horizontal-line": "^34.0.0",
"@ckeditor/ckeditor5-html-embed": "^34.0.0",
"@ckeditor/ckeditor5-image": "^34.0.0",
"@ckeditor/ckeditor5-indent": "^34.0.0",
"@ckeditor/ckeditor5-link": "^34.0.0",
"@ckeditor/ckeditor5-list": "^34.0.0",
"@ckeditor/ckeditor5-media-embed": "^34.0.0",
"@ckeditor/ckeditor5-page-break": "^34.0.0",
"@ckeditor/ckeditor5-paragraph": "^34.0.0",
"@ckeditor/ckeditor5-paste-from-office": "^34.0.0",
"@ckeditor/ckeditor5-source-editing": "^34.0.0",
"@ckeditor/ckeditor5-table": "^34.0.0",
"@ckeditor/ckeditor5-theme-lark": "^34.0.0",
"@ckeditor/ckeditor5-utils": "^34.0.0",
"webpack": "^5.58.1",

@@ -54,0 +54,0 @@ "webpack-cli": "^4.9.0"

@@ -6,3 +6,4 @@ CKEditor 5 HTML Support feature

[![Coverage Status](https://coveralls.io/repos/github/ckeditor/ckeditor5/badge.svg?branch=master)](https://coveralls.io/github/ckeditor/ckeditor5?branch=master)
[![Build Status](https://travis-ci.com/ckeditor/ckeditor5.svg?branch=master)](https://travis-ci.com/ckeditor/ckeditor5)
[![Build Status](https://travis-ci.com/ckeditor/ckeditor5.svg?branch=master)](https://app.travis-ci.com/github/ckeditor/ckeditor5)
![Dependency Status](https://img.shields.io/librariesio/release/npm/@ckeditor/ckeditor5-html-support)

@@ -9,0 +10,0 @@ This package implements the General HTML Support feature for CKEditor 5. It allows enabling unsupported HTML features in the rich-text editor at low cost.

@@ -13,8 +13,26 @@ /**

/**
* Helper function for downcast converter. Sets attributes on the given view element.
* Helper function for the downcast converter. Updates attributes on the given view element.
*
* @param {module:engine/view/downcastwriter~DowncastWriter} writer
* @param {Object} viewAttributes
* @param {module:engine/view/element~Element} viewElement
* @param {module:engine/view/downcastwriter~DowncastWriter} writer The view writer.
* @param {Object} oldViewAttributes The previous GHS attribute value.
* @param {Object} newViewAttributes The current GHS attribute value.
* @param {module:engine/view/element~Element} viewElement The view element to update.
*/
export function updateViewAttributes( writer, oldViewAttributes, newViewAttributes, viewElement ) {
if ( oldViewAttributes ) {
removeViewAttributes( writer, oldViewAttributes, viewElement );
}
if ( newViewAttributes ) {
setViewAttributes( writer, newViewAttributes, viewElement );
}
}
/**
* Helper function for the downcast converter. Sets attributes on the given view element.
*
* @param {module:engine/view/downcastwriter~DowncastWriter} writer The view writer.
* @param {Object} viewAttributes The GHS attribute value.
* @param {module:engine/view/element~Element} viewElement The view element to update.
*/
export function setViewAttributes( writer, viewAttributes, viewElement ) {

@@ -37,2 +55,27 @@ if ( viewAttributes.attributes ) {

/**
* Helper function for the downcast converter. Removes attributes on the given view element.
*
* @param {module:engine/view/downcastwriter~DowncastWriter} writer The view writer.
* @param {Object} viewAttributes The GHS attribute value.
* @param {module:engine/view/element~Element} viewElement The view element to update.
*/
export function removeViewAttributes( writer, viewAttributes, viewElement ) {
if ( viewAttributes.attributes ) {
for ( const [ key ] of Object.entries( viewAttributes.attributes ) ) {
writer.removeAttribute( key, viewElement );
}
}
if ( viewAttributes.styles ) {
for ( const style of Object.keys( viewAttributes.styles ) ) {
writer.removeStyle( style, viewElement );
}
}
if ( viewAttributes.classes ) {
writer.removeClass( viewAttributes.classes, viewElement );
}
}
/**
* Merges view element attribute objects.

@@ -50,3 +93,3 @@ *

if ( Array.isArray( source[ key ] ) ) {
result[ key ] = Array.from( new Set( [ ...target[ key ], ...source[ key ] ] ) );
result[ key ] = Array.from( new Set( [ ...( target[ key ] || [] ), ...source[ key ] ] ) );
}

@@ -53,0 +96,0 @@

@@ -11,3 +11,7 @@ /**

import { toWidget } from 'ckeditor5/src/widget';
import { setViewAttributes, mergeViewElementAttributes } from './conversionutils';
import {
setViewAttributes,
mergeViewElementAttributes,
updateViewAttributes
} from './conversionutils';

@@ -32,3 +36,3 @@ /**

/**
* Conversion helper converting object element to HTML object widget.
* Conversion helper converting an object element to an HTML object widget.
*

@@ -42,10 +46,11 @@ * @param {module:core/editor/editor~Editor} editor

return ( modelElement, { writer, consumable } ) => {
return ( modelElement, { writer } ) => {
const widgetLabel = t( 'HTML object' );
const viewElement = createObjectView( viewName, modelElement, writer );
const viewAttributes = modelElement.getAttribute( 'htmlAttributes' );
writer.addClass( 'html-object-embed__content', viewElement );
const viewAttributes = modelElement.getAttribute( 'htmlAttributes' );
if ( viewAttributes && consumable.consume( modelElement, `attribute:htmlAttributes:${ modelElement.name }` ) ) {
if ( viewAttributes ) {
setViewAttributes( writer, viewAttributes, viewElement );

@@ -61,6 +66,3 @@ }

},
viewElement,
{
isAllowedInsideAttributeElement: isInline
}
viewElement
);

@@ -98,2 +100,7 @@

// Do not apply the attribute if the element itself is already consumed and there is no view attributes to store.
if ( !viewAttributes && !conversionApi.consumable.test( data.viewItem, { name: true } ) ) {
return;
}
// Since we are converting to attribute we need a range on which we will set the attribute.

@@ -176,4 +183,2 @@ // If the range is not created yet, we will create it.

dispatcher.on( `attribute:htmlAttributes:${ modelName }`, ( evt, data, conversionApi ) => {
const viewAttributes = data.attributeNewValue;
if ( !conversionApi.consumable.consume( data.item, evt.name ) ) {

@@ -183,8 +188,9 @@ return;

const { attributeOldValue, attributeNewValue } = data;
const viewWriter = conversionApi.writer;
const viewElement = conversionApi.mapper.toViewElement( data.item );
setViewAttributes( viewWriter, viewAttributes, viewElement );
updateViewAttributes( viewWriter, attributeOldValue, attributeNewValue, viewElement );
} );
};
}

@@ -315,2 +315,3 @@ /**

/* istanbul ignore next: paranoid check */
if ( !viewName ) {

@@ -340,3 +341,8 @@ return;

conversion.for( 'editingDowncast' ).elementToStructure( {
model: modelName,
model: {
name: modelName,
attributes: [
'htmlAttributes'
]
},
view: toObjectWidgetConverter( editor, definition )

@@ -343,0 +349,0 @@ } );

@@ -11,2 +11,3 @@ /**

import { Plugin } from 'ckeditor5/src/core';
import { toArray } from 'ckeditor5/src/utils';

@@ -22,2 +23,3 @@ import DataFilter from './datafilter';

import StyleElementSupport from './integrations/style';
import DocumentListElementSupport from './integrations/documentlist';

@@ -53,3 +55,4 @@ /**

TableElementSupport,
StyleElementSupport
StyleElementSupport,
DocumentListElementSupport
];

@@ -69,4 +72,229 @@ }

}
/**
* Returns a GHS model attribute name related to a given view element name.
*
* @protected
* @param {String} viewElementName A view element name.
* @returns {String}
*/
getGhsAttributeNameForElement( viewElementName ) {
const dataSchema = this.editor.plugins.get( 'DataSchema' );
const definitions = Array.from( dataSchema.getDefinitionsForView( viewElementName, false ) );
if ( definitions && definitions.length && definitions[ 0 ].isInline && !definitions[ 0 ].isObject ) {
return definitions[ 0 ].model;
}
return 'htmlAttributes';
}
/**
* Updates GHS model attribute for a specified view element name, so it includes a given class name.
*
* @protected
* @param {String} viewElementName A view element name.
* @param {String|Array.<String>} className The css class to add.
* @param {module:engine/model/selection~Selectable} selectable The selection or element to update.
*/
addModelHtmlClass( viewElementName, className, selectable ) {
const model = this.editor.model;
const ghsAttributeName = this.getGhsAttributeNameForElement( viewElementName );
model.change( writer => {
for ( const item of getItemsToUpdateGhsAttribute( model, selectable, ghsAttributeName ) ) {
modifyGhsAttribute( writer, item, ghsAttributeName, 'classes', classes => {
for ( const value of toArray( className ) ) {
classes.add( value );
}
} );
}
} );
}
/**
* Updates GHS model attribute for a specified view element name, so it does not include a given class name.
*
* @protected
* @param {String} viewElementName A view element name.
* @param {String|Array.<String>} className The css class to remove.
* @param {module:engine/model/selection~Selectable} selectable The selection or element to update.
*/
removeModelHtmlClass( viewElementName, className, selectable ) {
const model = this.editor.model;
const ghsAttributeName = this.getGhsAttributeNameForElement( viewElementName );
model.change( writer => {
for ( const item of getItemsToUpdateGhsAttribute( model, selectable, ghsAttributeName ) ) {
modifyGhsAttribute( writer, item, ghsAttributeName, 'classes', classes => {
for ( const value of toArray( className ) ) {
classes.delete( value );
}
} );
}
} );
}
/**
* Updates GHS model attribute for a specified view element name, so it includes a given attribute.
*
* @protected
* @param {String} viewElementName A view element name.
* @param {Object} attributes The object with attributes to set.
* @param {module:engine/model/selection~Selectable} selectable The selection or element to update.
*/
setModelHtmlAttributes( viewElementName, attributes, selectable ) {
const model = this.editor.model;
const ghsAttributeName = this.getGhsAttributeNameForElement( viewElementName );
model.change( writer => {
for ( const item of getItemsToUpdateGhsAttribute( model, selectable, ghsAttributeName ) ) {
modifyGhsAttribute( writer, item, ghsAttributeName, 'attributes', attributesMap => {
for ( const [ key, value ] of Object.entries( attributes ) ) {
attributesMap.set( key, value );
}
} );
}
} );
}
/**
* Updates GHS model attribute for a specified view element name, so it does not include a given attribute.
*
* @protected
* @param {String} viewElementName A view element name.
* @param {String|Array.<String>} attributeName The attribute name (or names) to remove.
* @param {module:engine/model/selection~Selectable} selectable The selection or element to update.
*/
removeModelHtmlAttributes( viewElementName, attributeName, selectable ) {
const model = this.editor.model;
const ghsAttributeName = this.getGhsAttributeNameForElement( viewElementName );
model.change( writer => {
for ( const item of getItemsToUpdateGhsAttribute( model, selectable, ghsAttributeName ) ) {
modifyGhsAttribute( writer, item, ghsAttributeName, 'attributes', attributesMap => {
for ( const key of toArray( attributeName ) ) {
attributesMap.delete( key );
}
} );
}
} );
}
/**
* Updates GHS model attribute for a specified view element name, so it includes a given style.
*
* @protected
* @param {String} viewElementName A view element name.
* @param {Object} styles The object with styles to set.
* @param {module:engine/model/selection~Selectable} selectable The selection or element to update.
*/
setModelHtmlStyles( viewElementName, styles, selectable ) {
const model = this.editor.model;
const ghsAttributeName = this.getGhsAttributeNameForElement( viewElementName );
model.change( writer => {
for ( const item of getItemsToUpdateGhsAttribute( model, selectable, ghsAttributeName ) ) {
modifyGhsAttribute( writer, item, ghsAttributeName, 'styles', stylesMap => {
for ( const [ key, value ] of Object.entries( styles ) ) {
stylesMap.set( key, value );
}
} );
}
} );
}
/**
* Updates GHS model attribute for a specified view element name, so it does not include a given style.
*
* @protected
* @param {String} viewElementName A view element name.
* @param {String|Array.<String>} properties The style (or styles list) to remove.
* @param {module:engine/model/selection~Selectable} selectable The selection or element to update.
*/
removeModelHtmlStyles( viewElementName, properties, selectable ) {
const model = this.editor.model;
const ghsAttributeName = this.getGhsAttributeNameForElement( viewElementName );
model.change( writer => {
for ( const item of getItemsToUpdateGhsAttribute( model, selectable, ghsAttributeName ) ) {
modifyGhsAttribute( writer, item, ghsAttributeName, 'styles', stylesMap => {
for ( const key of toArray( properties ) ) {
stylesMap.delete( key );
}
} );
}
} );
}
}
// Returns an iterator over an items in the selectable that accept given GHS attribute.
function* getItemsToUpdateGhsAttribute( model, selectable, ghsAttributeName ) {
if ( selectable.is( 'documentSelection' ) && selectable.isCollapsed ) {
if ( model.schema.checkAttributeInSelection( selectable, ghsAttributeName ) ) {
yield selectable;
}
} else {
for ( const range of getValidRangesForSelectable( model, selectable, ghsAttributeName ) ) {
yield* range.getItems( { shallow: true } );
}
}
}
// Translates a given selectable to an iterable of ranges.
function getValidRangesForSelectable( model, selectable, ghsAttributeName ) {
if ( selectable.is( 'node' ) || selectable.is( '$text' ) || selectable.is( '$textProxy' ) ) {
if ( model.schema.checkAttribute( selectable, ghsAttributeName ) ) {
return [ model.createRangeOn( selectable ) ];
} else {
return [];
}
} else {
return model.schema.getValidRanges( model.createSelection( selectable ).getRanges(), ghsAttributeName );
}
}
// Updates a GHS attribute on a specified item.
// @param {module:engine/model/writer~Writer} writer
// @param {module:engine/model/item~Item|module:engine/model/documentselection~DocumentSelection} item
// @param {String} ghsAttributeName
// @param {'classes'|'attributes'|'styles'} subject
// @param {Function} callback That receives a map or set as an argument and should modify it (add or remove entries).
function modifyGhsAttribute( writer, item, ghsAttributeName, subject, callback ) {
const oldValue = item.getAttribute( ghsAttributeName );
const newValue = {};
for ( const kind of [ 'attributes', 'styles', 'classes' ] ) {
if ( kind != subject ) {
if ( oldValue && oldValue[ kind ] ) {
newValue[ kind ] = oldValue[ kind ];
}
} else {
const values = kind == 'classes' ?
new Set( oldValue && oldValue[ kind ] || [] ) :
new Map( Object.entries( oldValue && oldValue[ kind ] || {} ) );
callback( values );
if ( values.size ) {
newValue[ kind ] = kind == 'classes' ? Array.from( values ) : Object.fromEntries( values );
}
}
}
if ( Object.keys( newValue ).length ) {
if ( item.is( 'documentSelection' ) ) {
writer.setSelectionAttribute( ghsAttributeName, newValue );
} else {
writer.setAttribute( ghsAttributeName, newValue, item );
}
} else if ( oldValue ) {
if ( item.is( 'documentSelection' ) ) {
writer.removeSelectionAttribute( ghsAttributeName );
} else {
writer.removeAttribute( ghsAttributeName, item );
}
}
}
/**

@@ -73,0 +301,0 @@ * The configuration of the General HTML Support feature.

@@ -11,3 +11,3 @@ /**

import { Plugin } from 'ckeditor5/src/core';
import { setViewAttributes } from '../conversionutils.js';
import { updateViewAttributes } from '../conversionutils.js';

@@ -105,6 +105,7 @@ import DataFilter from '../datafilter';

const { attributeOldValue, attributeNewValue } = data;
const viewCodeElement = conversionApi.mapper.toViewElement( data.item );
const viewPreElement = viewCodeElement.parent;
setViewAttributes( conversionApi.writer, data.attributeNewValue, viewPreElement );
updateViewAttributes( conversionApi.writer, attributeOldValue, attributeNewValue, viewPreElement );
} );

@@ -117,7 +118,8 @@

const { attributeOldValue, attributeNewValue } = data;
const viewCodeElement = conversionApi.mapper.toViewElement( data.item );
setViewAttributes( conversionApi.writer, data.attributeNewValue, viewCodeElement );
updateViewAttributes( conversionApi.writer, attributeOldValue, attributeNewValue, viewCodeElement );
} );
};
}

@@ -13,3 +13,6 @@ /**

import DataFilter from '../datafilter';
import { setViewAttributes } from '../conversionutils.js';
import {
setViewAttributes,
updateViewAttributes
} from '../conversionutils.js';

@@ -88,2 +91,6 @@ /**

dispatcher.on( 'element:img', ( evt, data, conversionApi ) => {
if ( !data.modelRange ) {
return;
}
const viewImageElement = data.viewItem;

@@ -135,3 +142,3 @@ const viewContainerElement = viewImageElement.parent;

addBlockAttributeConversion( 'figure', 'htmlFigureAttributes' );
addBlockImageLinkAttributeConversion();
addBlockAttributeConversion( 'a', 'htmlLinkAttributes' );

@@ -144,5 +151,6 @@ function addInlineAttributeConversion( attributeName ) {

const { attributeOldValue, attributeNewValue } = data;
const viewElement = conversionApi.mapper.toViewElement( data.item );
setViewAttributes( conversionApi.writer, data.attributeNewValue, viewElement );
updateViewAttributes( conversionApi.writer, attributeOldValue, attributeNewValue, viewElement );
}, { priority: 'low' } );

@@ -153,26 +161,29 @@ }

dispatcher.on( `attribute:${ attributeName }:imageBlock`, ( evt, data, conversionApi ) => {
if ( !conversionApi.consumable.consume( data.item, evt.name ) ) {
if ( !conversionApi.consumable.test( data.item, evt.name ) ) {
return;
}
const { attributeOldValue, attributeNewValue } = data;
const containerElement = conversionApi.mapper.toViewElement( data.item );
const viewElement = getDescendantElement( conversionApi.writer, containerElement, elementName );
setViewAttributes( conversionApi.writer, data.attributeNewValue, viewElement );
if ( viewElement ) {
updateViewAttributes( conversionApi.writer, attributeOldValue, attributeNewValue, viewElement );
conversionApi.consumable.consume( data.item, evt.name );
}
}, { priority: 'low' } );
}
// To have a link element in the view, we need to attach a converter to the `linkHref` attribute.
// Doing this directly on `htmlLinkAttributes` will fail, as the link wrapper is not yet called at that moment.
function addBlockImageLinkAttributeConversion( ) {
dispatcher.on( 'attribute:linkHref:imageBlock', ( evt, data, conversionApi ) => {
if ( !conversionApi.consumable.consume( data.item, 'attribute:htmlLinkAttributes:imageBlock' ) ) {
return;
}
if ( elementName === 'a' ) {
// To have a link element in the view, we need to attach a converter to the `linkHref` attribute as well.
dispatcher.on( 'attribute:linkHref:imageBlock', ( evt, data, conversionApi ) => {
if ( !conversionApi.consumable.consume( data.item, 'attribute:htmlLinkAttributes:imageBlock' ) ) {
return;
}
const containerElement = conversionApi.mapper.toViewElement( data.item );
const viewElement = getDescendantElement( conversionApi.writer, containerElement, 'a' );
const containerElement = conversionApi.mapper.toViewElement( data.item );
const viewElement = getDescendantElement( conversionApi.writer, containerElement, 'a' );
setViewAttributes( conversionApi.writer, data.item.getAttribute( 'htmlLinkAttributes' ), viewElement );
}, { priority: 'low' } );
setViewAttributes( conversionApi.writer, data.item.getAttribute( 'htmlLinkAttributes' ), viewElement );
}, { priority: 'low' } );
}
}

@@ -179,0 +190,0 @@ };

@@ -12,5 +12,5 @@ /**

import { setViewAttributes } from '../conversionutils.js';
import DataFilter from '../datafilter';
import DataSchema from '../dataschema';
import { updateViewAttributes } from '../conversionutils.js';

@@ -104,6 +104,7 @@ /**

const { attributeOldValue, attributeNewValue } = data;
const containerElement = conversionApi.mapper.toViewElement( data.item );
const viewElement = getDescendantElement( conversionApi.writer, containerElement, elementName );
setViewAttributes( conversionApi.writer, data.attributeNewValue, viewElement );
updateViewAttributes( conversionApi.writer, attributeOldValue, attributeNewValue, viewElement );
} );

@@ -110,0 +111,0 @@ }

@@ -112,10 +112,2 @@ /**

{
model: '$htmlSection',
modelSchema: {
allowChildren: '$block',
allowIn: [ '$root', '$htmlSection' ],
isBlock: true
}
},
{
model: 'htmlP',

@@ -131,3 +123,3 @@ view: 'p',

modelSchema: {
inheritAllFrom: '$htmlSection'
inheritAllFrom: '$container'
}

@@ -139,3 +131,3 @@ },

modelSchema: {
allowIn: [ '$htmlSection', '$root' ],
allowWhere: '$block',
isBlock: true

@@ -181,4 +173,3 @@ }

modelSchema: {
allowIn: [ 'htmlTable', 'htmlThead', 'htmlTbody' ],
isBlock: true
allowIn: [ 'htmlTable', 'htmlThead', 'htmlTbody' ]
}

@@ -192,4 +183,3 @@ },

allowIn: 'htmlTr',
allowChildren: [ '$block', '$htmlSection' ],
isBlock: true
allowContentOf: '$container'
}

@@ -203,4 +193,3 @@ },

allowIn: 'htmlTr',
allowChildren: [ '$block', '$htmlSection' ],
isBlock: true
allowContentOf: '$container'
}

@@ -213,3 +202,3 @@ },

modelSchema: {
inheritAllFrom: '$htmlSection',
inheritAllFrom: '$container',
isBlock: true

@@ -233,3 +222,4 @@ }

modelSchema: {
inheritAllFrom: '$htmlSection'
inheritAllFrom: '$container',
isBlock: true
}

@@ -242,3 +232,4 @@ },

modelSchema: {
inheritAllFrom: '$htmlSection'
inheritAllFrom: '$container',
isBlock: true
}

@@ -251,3 +242,4 @@ },

modelSchema: {
inheritAllFrom: '$htmlSection'
inheritAllFrom: '$container',
isBlock: true
}

@@ -260,3 +252,4 @@ },

modelSchema: {
inheritAllFrom: '$htmlSection'
inheritAllFrom: '$container',
isBlock: true
}

@@ -278,3 +271,3 @@ },

modelSchema: {
inheritAllFrom: '$htmlSection'
inheritAllFrom: '$container'
}

@@ -287,3 +280,4 @@ },

modelSchema: {
inheritAllFrom: '$htmlSection'
inheritAllFrom: '$container',
isBlock: true
}

@@ -305,3 +299,4 @@ },

modelSchema: {
inheritAllFrom: '$htmlSection'
inheritAllFrom: '$container',
isBlock: true
}

@@ -314,3 +309,4 @@ },

modelSchema: {
inheritAllFrom: '$htmlSection'
inheritAllFrom: '$container',
isBlock: true
}

@@ -323,3 +319,4 @@ },

modelSchema: {
inheritAllFrom: '$htmlSection'
inheritAllFrom: '$container',
isBlock: true
}

@@ -387,3 +384,3 @@ },

modelSchema: {
allowWhere: '$htmlSection',
allowWhere: '$container',
allowChildren: [ '$htmlList', 'htmlLi' ],

@@ -442,3 +439,4 @@ isBlock: true

modelSchema: {
inheritAllFrom: '$htmlSection'
inheritAllFrom: '$container',
isBlock: true
}

@@ -450,3 +448,4 @@ },

modelSchema: {
inheritAllFrom: '$htmlSection'
inheritAllFrom: '$container',
isBlock: true
}

@@ -459,3 +458,4 @@ },

modelSchema: {
inheritAllFrom: '$htmlSection'
inheritAllFrom: '$container',
isBlock: true
}

@@ -467,3 +467,3 @@ },

modelSchema: {
allowIn: [ '$htmlSection', '$root' ],
allowWhere: '$container',
allowChildren: [ 'htmlDt', 'htmlDd' ],

@@ -493,14 +493,5 @@ isBlock: true

modelSchema: {
inheritAllFrom: '$htmlSection'
inheritAllFrom: '$container',
isBlock: true
}
},
// Objects
{
model: '$htmlObjectBlock',
isObject: true,
modelSchema: {
isObject: true,
isBlock: true,
allowWhere: '$block'
}
}

@@ -732,12 +723,2 @@ ],

{
model: '$htmlObjectInline',
isObject: true,
modelSchema: {
isObject: true,
isInline: true,
allowWhere: '$text',
allowAttributesOf: '$text'
}
},
{
model: 'htmlObject',

@@ -747,3 +728,3 @@ view: 'object',

modelSchema: {
inheritAllFrom: '$htmlObjectInline'
inheritAllFrom: '$inlineObject'
}

@@ -756,3 +737,3 @@ },

modelSchema: {
inheritAllFrom: '$htmlObjectInline'
inheritAllFrom: '$inlineObject'
}

@@ -765,3 +746,3 @@ },

modelSchema: {
inheritAllFrom: '$htmlObjectInline'
inheritAllFrom: '$inlineObject'
}

@@ -774,3 +755,3 @@ },

modelSchema: {
inheritAllFrom: '$htmlObjectInline'
inheritAllFrom: '$inlineObject'
}

@@ -783,3 +764,3 @@ },

modelSchema: {
inheritAllFrom: '$htmlObjectInline'
inheritAllFrom: '$inlineObject'
}

@@ -792,3 +773,3 @@ },

modelSchema: {
inheritAllFrom: '$htmlObjectInline'
inheritAllFrom: '$inlineObject'
}

@@ -801,3 +782,3 @@ },

modelSchema: {
inheritAllFrom: '$htmlObjectInline'
inheritAllFrom: '$inlineObject'
}

@@ -810,3 +791,3 @@ },

modelSchema: {
inheritAllFrom: '$htmlObjectInline'
inheritAllFrom: '$inlineObject'
}

@@ -819,3 +800,3 @@ },

modelSchema: {
inheritAllFrom: '$htmlObjectInline'
inheritAllFrom: '$inlineObject'
}

@@ -828,3 +809,3 @@ },

modelSchema: {
inheritAllFrom: '$htmlObjectInline'
inheritAllFrom: '$inlineObject'
}

@@ -837,3 +818,3 @@ },

modelSchema: {
inheritAllFrom: '$htmlObjectInline'
inheritAllFrom: '$inlineObject'
}

@@ -846,3 +827,3 @@ },

modelSchema: {
inheritAllFrom: '$htmlObjectInline'
inheritAllFrom: '$inlineObject'
}

@@ -857,3 +838,3 @@ },

modelSchema: {
inheritAllFrom: '$htmlObjectInline'
inheritAllFrom: '$inlineObject'
}

@@ -868,3 +849,3 @@ },

modelSchema: {
inheritAllFrom: '$htmlObjectInline'
inheritAllFrom: '$inlineObject'
}

@@ -871,0 +852,0 @@ },

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc