|
|
!function(t){t.en=Object.assign(t.en||{},{a:"Cannot upload file:",b:"Upload in progress",c:"Rich Text Editor",d:"Insert table",e:"Header column",f:"Insert column before",g:"Insert column after",h:"Delete column",i:"Column",j:"Header row",k:"Insert row below",l:"Insert row above",m:"Delete row",n:"Row",o:"Merge cell up",p:"Merge cell right",q:"Merge cell down",r:"Merge cell left",s:"Split cell vertically",t:"Split cell horizontally",u:"Merge cells",v:"Link",w:"Numbered List",x:"Bulleted List",y:"Full size image",z:"Side image",aa:"Left aligned image",ab:"Centered image",ac:"Right aligned image",ad:"Choose heading",ae:"Heading",af:"Enter image caption",ag:"image widget",ah:"Block quote",ai:"Italic",aj:"Strikethrough",ak:"Code",al:"Rich Text Editor, %0",am:"Upload failed",an:"Change image text alternative",ao:"Save",ap:"Cancel",aq:"Text alternative",ar:"Paragraph",as:"Heading 1",at:"Heading 2",au:"Heading 3",av:"Unlink",aw:"Edit link",ax:"Open link in new tab",ay:"This link has no URL",az:"Link URL",ba:"Insert image",bb:"Bold",bc:"Undo",bd:"Redo"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})),function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.OPEditor=e():t.OPEditor=e()}(window,function(){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(o,r,function(e){return t[e]}.bind(null,r));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=187)}([function(t,e,n){"use strict";n.d(e,"b",function(){return r}),n.d(e,"a",function(){return i});const o="https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html";class r extends Error{constructor(t,e){t=i(t),e&&(t+=" "+JSON.stringify(e)),super(t),this.name="CKEditorError",this.data=e}static isCKEditorError(t){return t instanceof r}}function i(t){const e=t.match(/^([^:]+):/);return e?t+` Read more: ${o}#error-${e[1]}\n`:t}},function(t,e,n){var o={},r=function(t){var e;return function(){return void 0===e&&(e=t.apply(this,arguments)),e}}(function(){return window&&document&&document.all&&!window.atob}),i=function(t){var e={};return function(t,n){if("function"==typeof t)return t();if(void 0===e[t]){var o=function(t,e){return e?e.querySelector(t):document.querySelector(t)}.call(this,t,n);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement)try{o=o.contentDocument.head}catch(t){o=null}e[t]=o}return e[t]}}(),s=null,a=0,c=[],l=n(63);function u(t,e){for(var n=0;n<t.length;n++){var r=t[n],i=o[r.id];if(i){i.refs++;for(var s=0;s<i.parts.length;s++)i.parts[s](r.parts[s]);for(;s<r.parts.length;s++)i.parts.push(g(r.parts[s],e))}else{var a=[];for(s=0;s<r.parts.length;s++)a.push(g(r.parts[s],e));o[r.id]={id:r.id,refs:1,parts:a}}}}function d(t,e){for(var n=[],o={},r=0;r<t.length;r++){var i=t[r],s=e.base?i[0]+e.base:i[0],a={css:i[1],media:i[2],sourceMap:i[3]};o[s]?o[s].parts.push(a):n.push(o[s]={id:s,parts:[a]})}return n}function h(t,e){var n=i(t.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var o=c[c.length-1];if("top"===t.insertAt)o?o.nextSibling?n.insertBefore(e,o.nextSibling):n.appendChild(e):n.insertBefore(e,n.firstChild),c.push(e);else if("bottom"===t.insertAt)n.appendChild(e);else{if("object"!=typeof t.insertAt||!t.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var r=i(t.insertAt.before,n);n.insertBefore(e,r)}}function f(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t);var e=c.indexOf(t);e>=0&&c.splice(e,1)}function p(t){var e=document.createElement("style");if(void 0===t.attrs.type&&(t.attrs.type="text/css"),void 0===t.attrs.nonce){var o=function(){0;return n.nc}();o&&(t.attrs.nonce=o)}return m(e,t.attrs),h(t,e),e}function m(t,e){Object.keys(e).forEach(function(n){t.setAttribute(n,e[n])})}function g(t,e){var n,o,r,i;if(e.transform&&t.css){if(!(i="function"==typeof e.transform?e.transform(t.css):e.transform.default(t.css)))return function(){};t.css=i}if(e.singleton){var c=a++;n=s||(s=p(e)),o=w.bind(null,n,c,!1),r=w.bind(null,n,c,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(t){var e=document.createElement("link");return void 0===t.attrs.type&&(t.attrs.type="text/css"),t.attrs.rel="stylesheet",m(e,t.attrs),h(t,e),e}(e),o=function(t,e,n){var o=n.css,r=n.sourceMap,i=void 0===e.convertToAbsoluteUrls&&r;(e.convertToAbsoluteUrls||i)&&(o=l(o));r&&(o+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var s=new Blob([o],{type:"text/css"}),a=t.href;t.href=URL.createObjectURL(s),a&&URL.revokeObjectURL(a)}.bind(null,n,e),r=function(){f(n),n.href&&URL.revokeObjectURL(n.href)}):(n=p(e),o=function(t,e){var n=e.css,o=e.media;o&&t.setAttribute("media",o);if(t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}.bind(null,n),r=function(){f(n)});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 r()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=r()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=d(t,e);return u(n,e),function(t){for(var r=[],i=0;i<n.length;i++){var s=n[i];(a=o[s.id]).refs--,r.push(a)}t&&u(d(t,e),e);for(i=0;i<r.length;i++){var a;if(0===(a=r[i]).refs){for(var c=0;c<a.parts.length;c++)a.parts[c]();delete o[a.id]}}}};var b=function(){var t=[];return function(e,n){return t[e]=n,t.filter(Boolean).join("\n")}}();function w(t,e,n,o){var r=n?"":o.css;if(t.styleSheet)t.styleSheet.cssText=b(e,r);else{var i=document.createTextNode(r),s=t.childNodes;s[e]&&t.removeChild(s[e]),s.length?t.insertBefore(i,s[e]):t.appendChild(i)}}},function(t,e,n){"use strict";var o=n(0);const r={error(t,e){console.error(Object(o.a)(t),e)},warn(t,e){console.warn(Object(o.a)(t),e)}};e.a=r},function(t,e,n){"use strict";var o=Object.prototype.hasOwnProperty;function r(t,e){return o.call(t,e)}function i(t){return!(t>=55296&&t<=57343)&&(!(t>=64976&&t<=65007)&&(65535!=(65535&t)&&65534!=(65535&t)&&(!(t>=0&&t<=8)&&(11!==t&&(!(t>=14&&t<=31)&&(!(t>=127&&t<=159)&&!(t>1114111)))))))}function s(t){if(t>65535){var e=55296+((t-=65536)>>10),n=56320+(1023&t);return String.fromCharCode(e,n)}return String.fromCharCode(t)}var a=/\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g,c=new RegExp(a.source+"|"+/&([a-z#][a-z0-9]{1,31});/gi.source,"gi"),l=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,u=n(24);var d=/[&<>"]/,h=/[&<>"]/g,f={"&":"&","<":"<",">":">",'"':"""};function p(t){return f[t]}var m=/[.?*+^$[\]\\(){}|-]/g;var g=n(14);e.lib={},e.lib.mdurl=n(25),e.lib.ucmicro=n(138),e.assign=function(t){return Array.prototype.slice.call(arguments,1).forEach(function(e){if(e){if("object"!=typeof e)throw new TypeError(e+"must be object");Object.keys(e).forEach(function(n){t[n]=e[n]})}}),t},e.isString=function(t){return"[object String]"===function(t){return Object.prototype.toString.call(t)}(t)},e.has=r,e.unescapeMd=function(t){return t.indexOf("\\")<0?t:t.replace(a,"$1")},e.unescapeAll=function(t){return t.indexOf("\\")<0&&t.indexOf("&")<0?t:t.replace(c,function(t,e,n){return e||function(t,e){var n=0;return r(u,e)?u[e]:35===e.charCodeAt(0)&&l.test(e)&&i(n="x"===e[1].toLowerCase()?parseInt(e.slice(2),16):parseInt(e.slice(1),10))?s(n):t}(t,n)})},e.isValidEntityCode=i,e.fromCodePoint=s,e.escapeHtml=function(t){return d.test(t)?t.replace(h,p):t},e.arrayReplaceAt=function(t,e,n){return[].concat(t.slice(0,e),n,t.slice(e+1))},e.isSpace=function(t){switch(t){case 9:case 32:return!0}return!1},e.isWhiteSpace=function(t){if(t>=8192&&t<=8202)return!0;switch(t){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1},e.isMdAsciiPunct=function(t){switch(t){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}},e.isPunctChar=function(t){return g.test(t)},e.escapeRE=function(t){return t.replace(m,"\\$&")},e.normalizeReference=function(t){return t.trim().replace(/\s+/g," ").toUpperCase()}},,function(t,e,n){"use strict";var o=n(8),r="object"==typeof self&&self&&self.Object===Object&&self,i=o.a||r||Function("return this")();e.a=i},function(t,e,n){"use strict";(function(t){var o=n(8),r="object"==typeof exports&&exports&&!exports.nodeType&&exports,i=r&&"object"==typeof t&&t&&!t.nodeType&&t,s=i&&i.exports===r&&o.a.process,a=function(){try{var t=i&&i.require&&i.require("util").types;return t||s&&s.binding&&s.binding("util")}catch(t){}}();e.a=a}).call(this,n(13)(t))},function(t,e,n){"use strict";(function(t){var o=n(5),r=n(32),i="object"==typeof exports&&exports&&!exports.nodeType&&exports,s=i&&"object"==typeof t&&t&&!t.nodeType&&t,a=s&&s.exports===i?o.a.Buffer:void 0,c=(a?a.isBuffer:void 0)||r.a;e.a=c}).call(this,n(13)(t))},function(t,e,n){"use strict";(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.a=n}).call(this,n(12))},function(t,e){t.exports='<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M6.972 16.615a.997.997 0 0 1-.744-.292l-4.596-4.596a1 1 0 1 1 1.414-1.414l3.926 3.926 9.937-9.937a1 1 0 0 1 1.414 1.415L7.717 16.323a.997.997 0 0 1-.745.292z" fill="#000" fill-rule="evenodd"/></svg>'},function(t,e){t.exports='<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11.591 10.177l4.243 4.242a1 1 0 0 1-1.415 1.415l-4.242-4.243-4.243 4.243a1 1 0 0 1-1.414-1.415l4.243-4.242L4.52 5.934A1 1 0 0 1 5.934 4.52l4.243 4.243 4.242-4.243a1 1 0 1 1 1.415 1.414l-4.243 4.243z" fill="#000" fill-rule="evenodd"/></svg>'},function(t,e){t.exports='<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><g fill="#000" fill-rule="nonzero"><path d="M2 4.5V3h16v1.5zM2 7.5V6h5.674v1.5zM2 10.5V9h5.674v1.5zM2 13.5V12h5.674v1.5zM10.5 7.5V12h6V7.5h-6zM9.682 6h7.636c.377 0 .682.407.682.91v5.68c0 .503-.305.91-.682.91H9.682c-.377 0-.682-.407-.682-.91V6.91c0-.503.305-.91.682-.91zM2 16.5V15h16v1.5z"/></g></svg>\n'},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e){t.exports=function(t){if(!t.webpackPolyfill){var e=Object.create(t);e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),Object.defineProperty(e,"exports",{enumerable:!0}),e.webpackPolyfill=1}return e}},function(t,e){t.exports=/[!-#%-\*,-/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E49\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/},function(t,e,n){"use strict";function o(){this.__rules__=[],this.__cache__=null}o.prototype.__find__=function(t){for(var e=0;e<this.__rules__.length;e++)if(this.__rules__[e].name===t)return e;return-1},o.prototype.__compile__=function(){var t=this,e=[""];t.__rules__.forEach(function(t){t.enabled&&t.alt.forEach(function(t){e.indexOf(t)<0&&e.push(t)})}),t.__cache__={},e.forEach(function(e){t.__cache__[e]=[],t.__rules__.forEach(function(n){n.enabled&&(e&&n.alt.indexOf(e)<0||t.__cache__[e].push(n.fn))})})},o.prototype.at=function(t,e,n){var o=this.__find__(t),r=n||{};if(-1===o)throw new Error("Parser rule not found: "+t);this.__rules__[o].fn=e,this.__rules__[o].alt=r.alt||[],this.__cache__=null},o.prototype.before=function(t,e,n,o){var r=this.__find__(t),i=o||{};if(-1===r)throw new Error("Parser rule not found: "+t);this.__rules__.splice(r,0,{name:e,enabled:!0,fn:n,alt:i.alt||[]}),this.__cache__=null},o.prototype.after=function(t,e,n,o){var r=this.__find__(t),i=o||{};if(-1===r)throw new Error("Parser rule not found: "+t);this.__rules__.splice(r+1,0,{name:e,enabled:!0,fn:n,alt:i.alt||[]}),this.__cache__=null},o.prototype.push=function(t,e,n){var o=n||{};this.__rules__.push({name:t,enabled:!0,fn:e,alt:o.alt||[]}),this.__cache__=null},o.prototype.enable=function(t,e){Array.isArray(t)||(t=[t]);var n=[];return t.forEach(function(t){var o=this.__find__(t);if(o<0){if(e)return;throw new Error("Rules manager: invalid rule name "+t)}this.__rules__[o].enabled=!0,n.push(t)},this),this.__cache__=null,n},o.prototype.enableOnly=function(t,e){Array.isArray(t)||(t=[t]),this.__rules__.forEach(function(t){t.enabled=!1}),this.enable(t,e)},o.prototype.disable=function(t,e){Array.isArray(t)||(t=[t]);var n=[];return t.forEach(function(t){var o=this.__find__(t);if(o<0){if(e)return;throw new Error("Rules manager: invalid rule name "+t)}this.__rules__[o].enabled=!1,n.push(t)},this),this.__cache__=null,n},o.prototype.getRules=function(t){return null===this.__cache__&&this.__compile__(),this.__cache__[t]||[]},t.exports=o},function(t,e,n){"use strict";function o(t,e,n){this.type=t,this.tag=e,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}o.prototype.attrIndex=function(t){var e,n,o;if(!this.attrs)return-1;for(n=0,o=(e=this.attrs).length;n<o;n++)if(e[n][0]===t)return n;return-1},o.prototype.attrPush=function(t){this.attrs?this.attrs.push(t):this.attrs=[t]},o.prototype.attrSet=function(t,e){var n=this.attrIndex(t),o=[t,e];n<0?this.attrPush(o):this.attrs[n]=o},o.prototype.attrGet=function(t){var e=this.attrIndex(t),n=null;return e>=0&&(n=this.attrs[e][1]),n},o.prototype.attrJoin=function(t,e){var n=this.attrIndex(t);n<0?this.attrPush([t,e]):this.attrs[n][1]=this.attrs[n][1]+" "+e},t.exports=o},function(t){t.exports={a:"11.1.1"}},function(t,e){t.exports='<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><g fill="#000" fill-rule="nonzero"><path d="M2 4.5V3h16v1.5zM4.5 7.5V12h11V7.5h-11zM4.061 6H15.94c.586 0 1.061.407 1.061.91v5.68c0 .503-.475.91-1.061.91H4.06C3.475 13.5 3 13.093 3 12.59V6.91C3 6.406 3.475 6 4.061 6zM2 16.5V15h16v1.5z"/></g></svg>\n'},function(t,e){t.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path d="M18 4.5V3H2v1.5h16zm0 3V6h-5.674v1.5H18zm0 3V9h-5.674v1.5H18zm0 3V12h-5.674v1.5H18zm-8.5-6V12h-6V7.5h6zm.818-1.5H2.682C2.305 6 2 6.407 2 6.91v5.68c0 .503.305.91.682.91h7.636c.377 0 .682-.407.682-.91V6.91c0-.503-.305-.91-.682-.91zM18 16.5V15H2v1.5h16z" fill-rule="nonzero"/></svg>'},function(t,e){t.exports='<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><g fill="#000" fill-rule="nonzero"><path d="M2 4.5V3h16v1.5zM6.5 7.5V12h7V7.5h-7zM5.758 6h8.484c.419 0 .758.407.758.91v5.681c0 .502-.34.909-.758.909H5.758c-.419 0-.758-.407-.758-.91V6.91c0-.503.34-.91.758-.91zM2 16.5V15h16v1.5z"/></g></svg>\n'},function(t,e){t.exports='<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<svg\n xmlns:dc="http://purl.org/dc/elements/1.1/"\n xmlns:cc="http://creativecommons.org/ns#"\n xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"\n xmlns:svg="http://www.w3.org/2000/svg"\n xmlns="http://www.w3.org/2000/svg"\n xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"\n xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"\n class="ck ck-icon ck-button__icon"\n viewBox="0 0 20 20"\n version="1.1"\n id="svg10"\n sodipodi:docname="source.svg"\n inkscape:version="0.92.3 (2405546, 2018-03-11)">\n <defs\n id="defs14" />\n <sodipodi:namedview\n pagecolor="#ffffff"\n bordercolor="#666666"\n borderopacity="1"\n objecttolerance="10"\n gridtolerance="10"\n guidetolerance="10"\n inkscape:pageopacity="0"\n inkscape:pageshadow="2"\n inkscape:window-width="640"\n inkscape:window-height="480"\n id="namedview12"\n showgrid="false"\n inkscape:zoom="33.37544"\n inkscape:cx="10.656564"\n inkscape:cy="13.670445"\n inkscape:current-layer="svg10" />\n <g\n id="g8"\n style="fill:#000000;fill-rule:evenodd"\n transform="matrix(0.8751128,0,0,0.8751128,4.2423992,5.525391)">\n <g\n id="g6"\n style="fill:#000000">\n <g\n transform="translate(2,5.6)"\n id="g4"\n style="fill:#000000">\n <path\n d="M 10.5,0.1 15.7,4 v 1.3 l -5.6,4 C 10,9.5 9.8,9.5 9.6,9.5 9.3,9.4 9,8.8 9,8.5 L 9.3,8.1 14,4.6 9.5,1.4 9.3,1.2 C 9.2,0.9 9.2,0.6 9.3,0.4 9.5,0.2 9.8,0 10.1,0 a 0.8,0.8 0 0 1 0.4,0.1 z M 5.3,0.1 0,4 v 1.3 l 5.6,4 C 5.7,9.5 5.9,9.5 6.1,9.5 6.4,9.4 6.8,8.8 6.7,8.5 6.7,8.4 6.7,8.2 6.5,8.1 L 1.5,4.6 6.2,1.4 6.4,1.2 C 6.5,0.9 6.5,0.6 6.4,0.4 6.2,0.2 5.9,0 5.6,0 A 0.8,0.8 0 0 0 5.3,0.1 Z"\n id="path2"\n inkscape:connector-curvature="0"\n style="fill:#000000" />\n </g>\n </g>\n </g>\n <metadata\n id="metadata4596">\n <rdf:RDF>\n <cc:Work\n rdf:about="">\n <dc:title></dc:title>\n <dc:format>image/svg+xml</dc:format>\n <dc:type\n rdf:resource="http://purl.org/dc/dcmitype/StillImage" />\n </cc:Work>\n </rdf:RDF>\n </metadata>\n <path\n style="stroke-width:0.0390625"\n d="M 1.2772336,0.02277222 V 20.022772 H 6.2381712 V 18.225897 H 3.0741087 V 1.8196472 h 8.2031253 l 3.554687,3.59375 v 3.5546875 h 1.796875 V 4.6712097 L 12.019421,0.02277222 Z"\n id="path2-3"\n inkscape:connector-curvature="0" />\n</svg>\n'},function(t,e,n){var o=n(90);"string"==typeof o&&(o=[[t.i,o,""]]);var r={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,r);o.locals&&(t.exports=o.locals)},function(t,e,n){var o=n(103);"string"==typeof o&&(o=[[t.i,o,""]]);var r={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,r);o.locals&&(t.exports=o.locals)},function(t,e,n){"use strict";t.exports=n(133)},function(t,e,n){"use strict";t.exports.encode=n(134),t.exports.decode=n(135),t.exports.format=n(136),t.exports.parse=n(137)},function(t,e){t.exports=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/},function(t,e){t.exports=/[\0-\x1F\x7F-\x9F]/},function(t,e){t.exports=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/},function(t,e,n){"use strict";var o="<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*\\/?>",r="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",i=new RegExp("^(?:"+o+"|"+r+"|\x3c!----\x3e|\x3c!--(?:-?[^>-])(?:-?[^-])*--\x3e|<[?].*?[?]>|<![A-Z]+\\s+[^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)"),s=new RegExp("^(?:"+o+"|"+r+")");t.exports.HTML_TAG_RE=i,t.exports.HTML_OPEN_CLOSE_TAG_RE=s},function(t,e,n){"use strict";t.exports.tokenize=function(t,e){var n,o,r,i,s=t.pos,a=t.src.charCodeAt(s);if(e)return!1;if(126!==a)return!1;if(r=(o=t.scanDelims(t.pos,!0)).length,i=String.fromCharCode(a),r<2)return!1;for(r%2&&(t.push("text","",0).content=i,r--),n=0;n<r;n+=2)t.push("text","",0).content=i+i,t.delimiters.push({marker:a,jump:n,token:t.tokens.length-1,level:t.level,end:-1,open:o.can_open,close:o.can_close});return t.pos+=o.length,!0},t.exports.postProcess=function(t){var e,n,o,r,i,s=[],a=t.delimiters,c=t.delimiters.length;for(e=0;e<c;e++)126===(o=a[e]).marker&&-1!==o.end&&(r=a[o.end],(i=t.tokens[o.token]).type="s_open",i.tag="s",i.nesting=1,i.markup="~~",i.content="",(i=t.tokens[r.token]).type="s_close",i.tag="s",i.nesting=-1,i.markup="~~",i.content="","text"===t.tokens[r.token-1].type&&"~"===t.tokens[r.token-1].content&&s.push(r.token-1));for(;s.length;){for(n=(e=s.pop())+1;n<t.tokens.length&&"s_close"===t.tokens[n].type;)n++;e!==--n&&(i=t.tokens[n],t.tokens[n]=t.tokens[e],t.tokens[e]=i)}}},function(t,e,n){"use strict";t.exports.tokenize=function(t,e){var n,o,r=t.pos,i=t.src.charCodeAt(r);if(e)return!1;if(95!==i&&42!==i)return!1;for(o=t.scanDelims(t.pos,42===i),n=0;n<o.length;n++)t.push("text","",0).content=String.fromCharCode(i),t.delimiters.push({marker:i,length:o.length,jump:n,token:t.tokens.length-1,level:t.level,end:-1,open:o.can_open,close:o.can_close});return t.pos+=o.length,!0},t.exports.postProcess=function(t){var e,n,o,r,i,s,a=t.delimiters;for(e=t.delimiters.length-1;e>=0;e--)95!==(n=a[e]).marker&&42!==n.marker||-1!==n.end&&(o=a[n.end],s=e>0&&a[e-1].end===n.end+1&&a[e-1].token===n.token-1&&a[n.end+1].token===o.token+1&&a[e-1].marker===n.marker,i=String.fromCharCode(n.marker),(r=t.tokens[n.token]).type=s?"strong_open":"em_open",r.tag=s?"strong":"em",r.nesting=1,r.markup=s?i+i:i,r.content="",(r=t.tokens[o.token]).type=s?"strong_close":"em_close",r.tag=s?"strong":"em",r.nesting=-1,r.markup=s?i+i:i,r.content="",s&&(t.tokens[a[e-1].token].content="",t.tokens[a[n.end+1].token].content="",e--))}},function(t,e,n){"use strict";e.a=function(){return!1}},function(t,e,n){"use strict";(function(t){var o=n(5),r="object"==typeof exports&&exports&&!exports.nodeType&&exports,i=r&&"object"==typeof t&&t&&!t.nodeType&&t,s=i&&i.exports===r?o.a.Buffer:void 0,a=s?s.allocUnsafe:void 0;e.a=function(t,e){if(e)return t.slice();var n=t.length,o=a?a(n):new t.constructor(n);return t.copy(o),o}}).call(this,n(13)(t))},function(t,e){t.exports='<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><g><path d="M4 0v1H1v3H0V.5A.5.5 0 0 1 .5 0H4zm8 0h3.5a.5.5 0 0 1 .5.5V4h-1V1h-3V0zM4 16H.5a.5.5 0 0 1-.5-.5V12h1v3h3v1zm8 0v-1h3v-3h1v3.5a.5.5 0 0 1-.5.5H12z"/><path fill-opacity=".256" d="M1 1h14v14H1z"/><g class="ck-icon__selected-indicator"><path d="M7 0h2v1H7V0zM0 7h1v2H0V7zm15 0h1v2h-1V7zm-8 8h2v1H7v-1z"/><path fill-opacity=".254" d="M1 1h14v14H1z"/></g></g></svg>\n'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" width="20" height="20"><path d="M1.586 18.227l.398-2.753.398-2.753 2.355 2.388 2.355 2.355-2.753.365zM14.954 8.01l-7.099 7.065-.763-.796 7.065-7.066-1.592-1.559L5.5 12.721l-.763-.796 7.065-7.066-.796-.796-7.861 7.862 4.71 4.71 7.861-7.828zm3.25-1.56c.398-.397.398-1.094-.033-1.525L15.02 1.775c-.431-.432-1.128-.465-1.526-.034l-.1.1-1.525 1.493 4.71 4.71 1.526-1.493-.033-.033c.033-.033.099-.033.132-.066z"/></svg>\n'},function(t,e){t.exports='<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><path d="M6.91 10.54c.26-.23.64-.21.88.03l3.36 3.14 2.23-2.06a.64.64 0 0 1 .87 0l2.52 2.97V4.5H3.2v10.12l3.71-4.08zm10.27-7.51c.6 0 1.09.47 1.09 1.05v11.84c0 .59-.49 1.06-1.09 1.06H2.79c-.6 0-1.09-.47-1.09-1.06V4.08c0-.58.49-1.05 1.1-1.05h14.38zm-5.22 5.56a1.96 1.96 0 1 1 3.4-1.96 1.96 1.96 0 0 1-3.4 1.96z" fill="#000" fill-rule="nonzero"/></svg>\n'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 250"><g fill="#FAFAFA" fill-rule="evenodd"><rect width="700" height="250" rx="4"/></g></svg>\n'},function(t,e){t.exports='<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M5.042 9.367l2.189 1.837a.75.75 0 0 1-.965 1.149l-3.788-3.18a.747.747 0 0 1-.21-.284.75.75 0 0 1 .17-.945L6.23 4.762a.75.75 0 1 1 .964 1.15L4.863 7.866h8.917A.75.75 0 0 1 14 7.9a4 4 0 1 1-1.477 7.718l.344-1.489a2.5 2.5 0 1 0 1.094-4.73l.008-.032H5.042z" fill="#000" fill-rule="nonzero"/></svg>'},function(t,e){t.exports='<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M14.958 9.367l-2.189 1.837a.75.75 0 0 0 .965 1.149l3.788-3.18a.747.747 0 0 0 .21-.284.75.75 0 0 0-.17-.945L13.77 4.762a.75.75 0 1 0-.964 1.15l2.331 1.955H6.22A.75.75 0 0 0 6 7.9a4 4 0 1 0 1.477 7.718l-.344-1.489A2.5 2.5 0 1 1 6.039 9.4l-.008-.032h8.927z" fill="#000" fill-rule="nonzero"/></svg>'},function(t,e){t.exports='<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><path d="M10.187 17H5.773c-.637 0-1.092-.138-1.364-.415-.273-.277-.409-.718-.409-1.323V4.738c0-.617.14-1.062.419-1.332.279-.27.73-.406 1.354-.406h4.68c.69 0 1.288.041 1.793.124.506.083.96.242 1.36.478.341.197.644.447.906.75a3.262 3.262 0 0 1 .808 2.162c0 1.401-.722 2.426-2.167 3.075C15.05 10.175 16 11.315 16 13.01a3.756 3.756 0 0 1-2.296 3.504 6.1 6.1 0 0 1-1.517.377c-.571.073-1.238.11-2 .11zm-.217-6.217H7v4.087h3.069c1.977 0 2.965-.69 2.965-2.072 0-.707-.256-1.22-.768-1.537-.512-.319-1.277-.478-2.296-.478zM7 5.13v3.619h2.606c.729 0 1.292-.067 1.69-.2a1.6 1.6 0 0 0 .91-.765c.165-.267.247-.566.247-.897 0-.707-.26-1.176-.778-1.409-.519-.232-1.31-.348-2.375-.348H7z" fill="#000" fill-rule="evenodd"/></svg>\n'},function(t,e){t.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="#353535"><g transform="translate(2 5.6)"><path d="M10.5.1L15.7 4v1.3l-5.6 4c-.1.2-.3.2-.5.2-.3-.1-.6-.7-.6-1l.3-.4L14 4.6 9.5 1.4l-.2-.2c-.1-.3-.1-.6 0-.8.2-.2.5-.4.8-.4a.8.8 0 0 1 .4.1zM5.3.1L0 4v1.3l5.6 4c.1.2.3.2.5.2.3-.1.7-.7.6-1 0-.1 0-.3-.2-.4l-5-3.5 4.7-3.2.2-.2c.1-.3.1-.6 0-.8-.2-.2-.5-.4-.8-.4a.8.8 0 0 0-.3.1z"/></g></g></g></svg>'},function(t,e){t.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><g fill="#333" fill-rule="evenodd"><path d="M7 16.4c-.8-.4-1.5-.9-2.2-1.5a.6.6 0 0 1-.2-.5l.3-.6h1c1 1.2 2.1 1.7 3.7 1.7 1 0 1.8-.3 2.3-.6.6-.4.6-1.2.6-1.3.2-1.2-.9-2.1-.9-2.1h2.1c.3.7.4 1.2.4 1.7v.8l-.6 1.2c-.6.8-1.1 1-1.6 1.2a6 6 0 0 1-2.4.6c-1 0-1.8-.3-2.5-.6zM6.8 9L6 8.3c-.4-.5-.5-.8-.5-1.6 0-.7.1-1.3.5-1.8.4-.6 1-1 1.6-1.3a6.3 6.3 0 0 1 4.7 0 4 4 0 0 1 1.7 1l.3.7c0 .1.2.4-.2.7-.4.2-.9.1-1 0a3 3 0 0 0-1.2-1c-.4-.2-1-.3-2-.4-.7 0-1.4.2-2 .6-.8.6-1 .8-1 1.5 0 .8.5 1 1.2 1.5.6.4 1.1.7 1.9 1H6.8z"/><path fill-rule="nonzero" d="M3 10.5V9h14v1.5z"/></g></svg>'},function(t,e){t.exports='<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M9.586 14.633l.021.004c-.036.335.095.655.393.962.082.083.173.15.274.201h1.474a.6.6 0 1 1 0 1.2H5.304a.6.6 0 0 1 0-1.2h1.15c.474-.07.809-.182 1.005-.334.157-.122.291-.32.404-.597l2.416-9.55a1.053 1.053 0 0 0-.281-.823 1.12 1.12 0 0 0-.442-.296H8.15a.6.6 0 0 1 0-1.2h6.443a.6.6 0 1 1 0 1.2h-1.195c-.376.056-.65.155-.823.296-.215.175-.423.439-.623.79l-2.366 9.347z" fill="#333" fill-rule="evenodd"/></svg>'},function(t,e){t.exports='<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><g fill="#000" fill-rule="evenodd"><path d="M3 10.423a6.5 6.5 0 0 1 6.056-6.408l.038.67C6.448 5.423 5.354 7.663 5.22 10H9c.552 0 .5.432.5.986v4.511c0 .554-.448.503-1 .503h-5c-.552 0-.5-.449-.5-1.003v-4.011-.563zM11 10.423a6.5 6.5 0 0 1 6.056-6.408l.038.67c-2.646.739-3.74 2.979-3.873 5.315H17c.552 0 .5.432.5.986v4.511c0 .554-.448.503-1 .503h-5c-.552 0-.5-.449-.5-1.003v-4.011-.563z"/></g></svg>\n'},function(t,e){t.exports='<svg width="10" height="10" viewBox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"><path d="M.941 4.523a.75.75 0 1 1 1.06-1.06l3.006 3.005 3.005-3.005a.75.75 0 1 1 1.06 1.06l-3.549 3.55a.75.75 0 0 1-1.168-.136L.941 4.523z" fill="#000" fill-rule="evenodd"/></svg>'},function(t,e){t.exports='<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M5.085 6.22L2.943 4.078a.75.75 0 1 1 1.06-1.06l2.592 2.59A11.094 11.094 0 0 1 10 5.068c4.738 0 8.578 3.101 8.578 5.083 0 1.197-1.401 2.803-3.555 3.887l1.714 1.713a.75.75 0 0 1-.09 1.138.488.488 0 0 1-.15.084.75.75 0 0 1-.821-.16L6.17 7.304c-.258.11-.51.233-.757.365l6.239 6.24-.006.005.78.78c-.388.094-.78.166-1.174.215l-1.11-1.11h.011L4.55 8.197a7.2 7.2 0 0 0-.665.514l-.112.098 4.897 4.897-.005.006 1.276 1.276a10.164 10.164 0 0 1-1.477-.117l-.479-.479-.009.009-4.863-4.863-.022.031a2.563 2.563 0 0 0-.124.2c-.043.077-.08.158-.108.241a.534.534 0 0 0-.028.133.29.29 0 0 0 .008.072.927.927 0 0 0 .082.226c.067.133.145.26.234.379l3.242 3.365.025.01.59.623c-3.265-.918-5.59-3.155-5.59-4.668 0-1.194 1.448-2.838 3.663-3.93zm7.07.531a4.632 4.632 0 0 1 1.108 5.992l.345.344.046-.018a9.313 9.313 0 0 0 2-1.112c.256-.187.5-.392.727-.613.137-.134.27-.277.392-.431.072-.091.141-.185.203-.286.057-.093.107-.19.148-.292a.72.72 0 0 0 .036-.12.29.29 0 0 0 .008-.072.492.492 0 0 0-.028-.133.999.999 0 0 0-.036-.096 2.165 2.165 0 0 0-.071-.145 2.917 2.917 0 0 0-.125-.2 3.592 3.592 0 0 0-.263-.335 5.444 5.444 0 0 0-.53-.523 7.955 7.955 0 0 0-1.054-.768 9.766 9.766 0 0 0-1.879-.891c-.337-.118-.68-.219-1.027-.301zm-2.85.21l-.069.002a.508.508 0 0 0-.254.097.496.496 0 0 0-.104.679.498.498 0 0 0 .326.199l.045.005c.091.003.181.003.272.012.9.093 1.676.675 2.017 1.513.024.061.043.125.069.185a.494.494 0 0 0 .45.287h.008a.496.496 0 0 0 .35-.158.482.482 0 0 0 .13-.335.638.638 0 0 0-.048-.219 3.379 3.379 0 0 0-.36-.723 3.438 3.438 0 0 0-2.791-1.543l-.028-.001h-.013z" fill="#000" fill-rule="evenodd"/></svg>'},function(t,e){t.exports='<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><g fill="#000" fill-rule="evenodd"><path d="M11.077 15l.991-1.416a.75.75 0 1 1 1.229.86l-1.148 1.64a.748.748 0 0 1-.217.206 5.251 5.251 0 0 1-8.503-5.955c.02-.095.06-.189.12-.274l1.147-1.639a.75.75 0 1 1 1.228.86L4.933 10.7l.006.003a3.75 3.75 0 0 0 6.132 4.294l.006.004zm5.494-5.335a.748.748 0 0 1-.12.274l-1.147 1.639a.75.75 0 1 1-1.228-.86l.86-1.23a3.75 3.75 0 0 0-6.144-4.301l-.86 1.229a.75.75 0 0 1-1.229-.86l1.148-1.64a.748.748 0 0 1 .217-.206 5.251 5.251 0 0 1 8.503 5.955zm-4.563-2.532a.75.75 0 0 1 .184 1.045l-3.155 4.505a.75.75 0 1 1-1.229-.86l3.155-4.506a.75.75 0 0 1 1.045-.184zM16.927 17.695l-1.414 1.414a.75.75 0 1 1-1.06-1.06l1.414-1.415-1.415-1.414a.75.75 0 0 1 1.061-1.06l1.414 1.414 1.414-1.415a.75.75 0 0 1 1.061 1.061l-1.414 1.414 1.414 1.415a.75.75 0 0 1-1.06 1.06l-1.415-1.414z"/></g></svg>'},function(t,e){t.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M7.3 17.37l-.061.088a1.518 1.518 0 0 1-.934.535l-4.178.663-.806-4.153a1.495 1.495 0 0 1 .187-1.058l.056-.086L8.77 2.639c.958-1.351 2.803-1.076 4.296-.03 1.497 1.047 2.387 2.693 1.433 4.055L7.3 17.37zM9.14 4.728l-5.545 8.346 3.277 2.294 5.544-8.346L9.14 4.728zM6.07 16.512l-3.276-2.295.53 2.73 2.746-.435zM9.994 3.506L13.271 5.8c.316-.452-.16-1.333-1.065-1.966-.905-.634-1.895-.78-2.212-.328zM8 18.5L9.375 17H19v1.5H8z" fill="#000" fill-rule="nonzero"/></svg>\n'},function(t,e){t.exports='<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11.077 15l.991-1.416a.75.75 0 1 1 1.229.86l-1.148 1.64a.748.748 0 0 1-.217.206 5.251 5.251 0 0 1-8.503-5.955c.02-.095.06-.189.12-.274l1.147-1.639a.75.75 0 1 1 1.228.86L4.933 10.7l.006.003a3.75 3.75 0 0 0 6.132 4.294l.006.004zm5.494-5.335a.748.748 0 0 1-.12.274l-1.147 1.639a.75.75 0 1 1-1.228-.86l.86-1.23a3.75 3.75 0 0 0-6.144-4.301l-.86 1.229a.75.75 0 0 1-1.229-.86l1.148-1.64a.748.748 0 0 1 .217-.206 5.251 5.251 0 0 1 8.503 5.955zm-4.563-2.532a.75.75 0 0 1 .184 1.045l-3.155 4.505a.75.75 0 1 1-1.229-.86l3.155-4.506a.75.75 0 0 1 1.045-.184z" fill="#000" fill-rule="evenodd"/></svg>'},function(t,e){t.exports='<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M7 5.75c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zM3.5 3v5H2V3.7H1v-1h2.5V3zM.343 17.857l2.59-3.257H2.92a.6.6 0 1 0-1.04 0H.302a2 2 0 1 1 3.995 0h-.001c-.048.405-.16.734-.333.988-.175.254-.59.692-1.244 1.312H4.3v1h-4l.043-.043zM7 14.75a.75.75 0 0 1 .75-.75h9.5a.75.75 0 1 1 0 1.5h-9.5a.75.75 0 0 1-.75-.75z" fill="#454545" fill-rule="evenodd"/></svg>'},function(t,e){t.exports='<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M7 5.75c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zm-6 0C1 4.784 1.777 4 2.75 4c.966 0 1.75.777 1.75 1.75 0 .966-.777 1.75-1.75 1.75C1.784 7.5 1 6.723 1 5.75zm6 9c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zm-6 0c0-.966.777-1.75 1.75-1.75.966 0 1.75.777 1.75 1.75 0 .966-.777 1.75-1.75 1.75-.966 0-1.75-.777-1.75-1.75z" fill="#454545" fill-rule="evenodd"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M415.462 96.978c-88.1-88.1-230.824-88.1-318.924 0-87.22 87.22-87.22 229.943 0 318.044 88.1 88.1 230.824 88.1 318.924 0 87.22-88.1 87.22-230.824 0-318.044zM246.31 437.047c-24.668 0-44.05-20.263-44.05-44.05 0-24.669 19.382-44.05 44.05-44.05 24.668 0 44.05 19.381 44.05 44.05 0 23.787-20.263 44.05-44.05 44.05zm30.835-154.176v23.787c0 12.334-4.405 16.74-15.858 16.74h-32.597c-11.453 0-15.858-4.406-15.858-16.74v-53.742c0-14.096 14.096-18.5 26.43-22.025 2.643-.88 6.167-1.762 8.81-2.643 16.74-6.167 26.43-13.215 26.43-30.835 0-6.167 0-23.787-29.073-23.787-17.62 0-33.478 7.048-43.17 10.572-5.285 2.643-7.929 3.524-11.453 3.524-5.286 0-10.572-4.405-11.453-9.691L167.9 148.958c-.88-2.643-.88-5.286-.88-7.048 0-21.145 66.075-33.479 88.1-33.479 55.503 0 93.387 36.122 93.387 88.982 0 58.146-44.05 75.767-71.362 85.458z"/></svg>'},function(t,e){t.exports='<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<svg\n xmlns:dc="http://purl.org/dc/elements/1.1/"\n xmlns:cc="http://creativecommons.org/ns#"\n xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"\n xmlns:svg="http://www.w3.org/2000/svg"\n xmlns="http://www.w3.org/2000/svg"\n xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"\n xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"\n class="ck ck-icon ck-button__icon"\n viewBox="0 0 20 20"\n version="1.1"\n id="svg10"\n sodipodi:docname="code-block.svg"\n inkscape:version="0.92.3 (2405546, 2018-03-11)">\n <defs\n id="defs14" />\n <sodipodi:namedview\n pagecolor="#ffffff"\n bordercolor="#666666"\n borderopacity="1"\n objecttolerance="10"\n gridtolerance="10"\n guidetolerance="10"\n inkscape:pageopacity="0"\n inkscape:pageshadow="2"\n inkscape:window-width="640"\n inkscape:window-height="480"\n id="namedview12"\n showgrid="false"\n inkscape:zoom="33.37544"\n inkscape:cx="10.656564"\n inkscape:cy="13.670445"\n inkscape:current-layer="svg10" />\n <g\n id="g8"\n style="fill:none;fill-rule:evenodd"\n transform="matrix(0.8751128,0,0,0.8751128,1.3360704,0.91121972)">\n <g\n id="g6"\n style="fill:#353535">\n <g\n transform="translate(2,5.6)"\n id="g4">\n <path\n d="M 10.5,0.1 15.7,4 v 1.3 l -5.6,4 C 10,9.5 9.8,9.5 9.6,9.5 9.3,9.4 9,8.8 9,8.5 L 9.3,8.1 14,4.6 9.5,1.4 9.3,1.2 C 9.2,0.9 9.2,0.6 9.3,0.4 9.5,0.2 9.8,0 10.1,0 a 0.8,0.8 0 0 1 0.4,0.1 z M 5.3,0.1 0,4 v 1.3 l 5.6,4 C 5.7,9.5 5.9,9.5 6.1,9.5 6.4,9.4 6.8,8.8 6.7,8.5 6.7,8.4 6.7,8.2 6.5,8.1 L 1.5,4.6 6.2,1.4 6.4,1.2 C 6.5,0.9 6.5,0.6 6.4,0.4 6.2,0.2 5.9,0 5.6,0 A 0.8,0.8 0 0 0 5.3,0.1 Z"\n id="path2"\n inkscape:connector-curvature="0" />\n </g>\n </g>\n </g>\n <path\n style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#353535;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.09228408;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"\n d="M 0.22004104,0.22004104 V 0.76600468 19.779959 H 19.779959 V 0.22004104 Z M 1.3119682,1.3119682 H 18.688032 V 18.688032 H 1.3119682 Z"\n id="rect3722"\n inkscape:connector-curvature="0" />\n <metadata\n id="metadata4596">\n <rdf:RDF>\n <cc:Work\n rdf:about="">\n <dc:title></dc:title>\n <dc:format>image/svg+xml</dc:format>\n <dc:type\n rdf:resource="http://purl.org/dc/dcmitype/StillImage" />\n </cc:Work>\n </rdf:RDF>\n </metadata>\n</svg>\n'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="20"><path d="M124 334v14c84 139 279 139 362 0v-14c-83-139-278-139-362 0zm181 91c-46 0-83-38-83-84s37-83 83-83c47 0 84 37 84 83s-37 84-84 84zm42-84c0 23-19 42-42 42s-41-19-41-42 18-42 41-42 42 19 42 42zm83-254L312-32H37v512h127v-46H83V14h210l91 92v91h46V87z"/></svg>\n'},function(t,e){t.exports='<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><path d="M3 6v3h4V6H3zm0 4v3h4v-3H3zm0 4v3h4v-3H3zm5 3h4v-3H8v3zm5 0h4v-3h-4v3zm4-4v-3h-4v3h4zm0-4V6h-4v3h4zm1.5 8a1.5 1.5 0 0 1-1.5 1.5H3A1.5 1.5 0 0 1 1.5 17V4c.222-.863 1.068-1.5 2-1.5h13c.932 0 1.778.637 2 1.5v13zM12 13v-3H8v3h4zm0-4V6H8v3h4z" fill="#333" fill-rule="evenodd"/></svg>'},function(t,e){t.exports='<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><g fill="#333" fill-rule="evenodd"><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z" opacity=".6"/><path d="M18 7v1H2V7h16zm0 5v1H2v-1h16z" fill-rule="nonzero" opacity=".6"/><path d="M14 1v18a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V1a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1zm-2 1H8v4h4V2zm0 6H8v4h4V8zm0 6H8v4h4v-4z"/></g></svg>'},function(t,e){t.exports='<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><g fill="#333" fill-rule="evenodd"><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z" opacity=".6"/><path d="M7 2h1v16H7V2zm5 0h1v16h-1V2z" fill-rule="nonzero" opacity=".6"/><path d="M1 6h18a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm1 2v4h4V8H2zm6 0v4h4V8H8zm6 0v4h4V8h-4z"/></g></svg>'},function(t,e){t.exports='<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><g fill="#333" fill-rule="evenodd"><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z" opacity=".6"/><path d="M7 2h1v16H7V2zm5 0h1v7h-1V2zm6 5v1H2V7h16zM8 12v1H2v-1h6z" fill-rule="nonzero" opacity=".6"/><path d="M7 7h12a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1zm1 2v9h10V9H8z"/></g></svg>'},function(t,e){t.exports='<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<svg\n xmlns:dc="http://purl.org/dc/elements/1.1/"\n xmlns:cc="http://creativecommons.org/ns#"\n xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"\n xmlns:svg="http://www.w3.org/2000/svg"\n xmlns="http://www.w3.org/2000/svg"\n xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"\n xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"\n viewBox="0 0 512 512"\n version="1.1"\n id="svg4"\n sodipodi:docname="wysiwyg.svg"\n inkscape:version="0.92.3 (2405546, 2018-03-11)">\n <metadata\n id="metadata10">\n <rdf:RDF>\n <cc:Work\n rdf:about="">\n <dc:format>image/svg+xml</dc:format>\n <dc:type\n rdf:resource="http://purl.org/dc/dcmitype/StillImage" />\n </cc:Work>\n </rdf:RDF>\n </metadata>\n <defs\n id="defs8" />\n <sodipodi:namedview\n pagecolor="#ffffff"\n bordercolor="#666666"\n borderopacity="1"\n objecttolerance="10"\n gridtolerance="10"\n guidetolerance="10"\n inkscape:pageopacity="0"\n inkscape:pageshadow="2"\n inkscape:window-width="640"\n inkscape:window-height="480"\n id="namedview6"\n showgrid="false"\n inkscape:zoom="1.3037281"\n inkscape:cx="252.52639"\n inkscape:cy="155.86537"\n inkscape:current-layer="svg4" />\n <path\n d="m 166.9714,230.61312 h 185 v 31 h -185 z m 1,-61 h 185 v 32 h -185 z m 0,-61 h 185 v 32 h -185 z m 289,5 -118,-118.0000009 H 63.971404 V 507.61312 H 457.9714 v -394 z m -347,348 V 41.613119 h 210 l 92,92.000001 v 328 z"\n id="path2"\n inkscape:connector-curvature="0"\n sodipodi:nodetypes="cccccccccccccccccccccccccccc" />\n <rect\n style="fill:#000000;fill-opacity:1;stroke:#353535;stroke-opacity:1"\n id="rect832"\n width="184.08746"\n height="112.75357"\n x="169.51387"\n y="313.33896" />\n</svg>\n'},function(t,e,n){"use strict";(function(t){var e=n(2),o=n(17);const r="object"==typeof window?window:t;r.CKEDITOR_VERSION?e.a.error("ckeditor-version-collision: The global CKEDITOR_VERSION constant has already been set.",{collidingVersion:r.CKEDITOR_VERSION,version:o.a}):r.CKEDITOR_VERSION=o.a}).call(this,n(12))},function(t,e,n){var o=n(62);"string"==typeof o&&(o=[[t.i,o,""]]);var r={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,r);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=".ck-hidden{display:none!important}.ck.ck-reset,.ck.ck-reset_all,.ck.ck-reset_all *{box-sizing:border-box;width:auto;height:auto;position:static}:root{--ck-z-default:1;--ck-z-modal:calc(var(--ck-z-default) + 999);--ck-color-base-foreground:#fafafa;--ck-color-base-background:#fff;--ck-color-base-border:#c4c4c4;--ck-color-base-action:#61b045;--ck-color-base-focus:#6cb5f9;--ck-color-base-text:#333;--ck-color-base-active:#198cf0;--ck-color-base-active-focus:#0e7fe1;--ck-color-base-error:#db3700;--ck-color-focus-border:#47a4f5;--ck-color-focus-shadow:rgba(119,186,248,0.5);--ck-color-focus-disabled-shadow:rgba(119,186,248,0.3);--ck-color-focus-error-shadow:rgba(255,64,31,0.3);--ck-color-text:var(--ck-color-base-text);--ck-color-shadow-drop:rgba(0,0,0,0.15);--ck-color-shadow-inner:rgba(0,0,0,0.1);--ck-color-button-default-background:transparent;--ck-color-button-default-hover-background:#e6e6e6;--ck-color-button-default-active-background:#d9d9d9;--ck-color-button-default-active-shadow:#bfbfbf;--ck-color-button-default-disabled-background:transparent;--ck-color-button-on-background:#dedede;--ck-color-button-on-hover-background:#c4c4c4;--ck-color-button-on-active-background:#bababa;--ck-color-button-on-active-shadow:#a1a1a1;--ck-color-button-on-disabled-background:#dedede;--ck-color-button-action-background:var(--ck-color-base-action);--ck-color-button-action-hover-background:#579e3d;--ck-color-button-action-active-background:#53973b;--ck-color-button-action-active-shadow:#498433;--ck-color-button-action-disabled-background:#7ec365;--ck-color-button-action-text:var(--ck-color-base-background);--ck-color-button-save:#008a00;--ck-color-button-cancel:#db3700;--ck-color-switch-button-off-background:#b0b0b0;--ck-color-switch-button-on-background:var(--ck-color-button-action-background);--ck-color-switch-button-inner-background:var(--ck-color-base-background);--ck-color-dropdown-panel-background:var(--ck-color-base-background);--ck-color-dropdown-panel-border:var(--ck-color-base-border);--ck-color-input-background:var(--ck-color-base-background);--ck-color-input-border:#c7c7c7;--ck-color-input-error-border:var(--ck-color-base-error);--ck-color-input-text:var(--ck-color-base-text);--ck-color-input-disabled-background:#f2f2f2;--ck-color-input-disabled-border:#c7c7c7;--ck-color-input-disabled-text:#5c5c5c;--ck-color-list-background:var(--ck-color-base-background);--ck-color-list-button-hover-background:var(--ck-color-base-foreground);--ck-color-list-button-on-background:var(--ck-color-base-active);--ck-color-list-button-on-background-focus:var(--ck-color-base-active-focus);--ck-color-list-button-on-text:var(--ck-color-base-background);--ck-color-panel-background:var(--ck-color-base-background);--ck-color-panel-border:var(--ck-color-base-border);--ck-color-toolbar-background:var(--ck-color-base-foreground);--ck-color-toolbar-border:var(--ck-color-base-border);--ck-color-tooltip-background:var(--ck-color-base-text);--ck-color-tooltip-text:var(--ck-color-base-background);--ck-color-engine-placeholder-text:#c2c2c2;--ck-color-upload-bar-background:#6cb5f9;--ck-color-upload-infinite-background:rgba(0,0,0,0.1);--ck-color-link-default:#0000f0;--ck-color-link-selected-background:#ebf8ff;--ck-disabled-opacity:.5;--ck-focus-outer-shadow-geometry:0 0 0 3px;--ck-focus-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-shadow);--ck-focus-disabled-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-disabled-shadow);--ck-focus-error-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-error-shadow);--ck-focus-ring:1px solid var(--ck-color-focus-border);--ck-font-size-base:13px;--ck-line-height-base:1.84615;--ck-font-face:Helvetica,Arial,Tahoma,Verdana,Sans-Serif;--ck-font-size-tiny:0.7em;--ck-font-size-small:0.75em;--ck-font-size-normal:1em;--ck-font-size-big:1.4em;--ck-font-size-large:1.8em;--ck-ui-component-min-height:2.3em}.ck.ck-reset,.ck.ck-reset_all,.ck.ck-reset_all *{margin:0;padding:0;border:0;background:transparent;text-decoration:none;vertical-align:middle;transition:none;word-wrap:break-word}.ck.ck-reset_all,.ck.ck-reset_all *{border-collapse:collapse;font:normal normal normal var(--ck-font-size-base)/var(--ck-line-height-base) var(--ck-font-face);color:var(--ck-color-text);text-align:left;white-space:nowrap;cursor:auto;float:none}.ck.ck-reset_all .ck-rtl *{text-align:right}.ck.ck-reset_all iframe{vertical-align:inherit}.ck.ck-reset_all textarea{white-space:pre-wrap}.ck.ck-reset_all input[type=password],.ck.ck-reset_all input[type=text],.ck.ck-reset_all textarea{cursor:text}.ck.ck-reset_all input[type=password][disabled],.ck.ck-reset_all input[type=text][disabled],.ck.ck-reset_all textarea[disabled]{cursor:default}.ck.ck-reset_all fieldset{padding:10px;border:2px groove #dfdee3}.ck.ck-reset_all button::-moz-focus-inner{padding:0;border:0}:root{--ck-border-radius:2px;--ck-inner-shadow:2px 2px 3px var(--ck-color-shadow-inner) inset;--ck-drop-shadow:0 1px 2px 1px var(--ck-color-shadow-drop);--ck-spacing-unit:0.6em;--ck-spacing-large:calc(var(--ck-spacing-unit) * 1.5);--ck-spacing-standard:var(--ck-spacing-unit);--ck-spacing-medium:calc(var(--ck-spacing-unit) * 0.8);--ck-spacing-small:calc(var(--ck-spacing-unit) * 0.5);--ck-spacing-tiny:calc(var(--ck-spacing-unit) * 0.3);--ck-spacing-extra-tiny:calc(var(--ck-spacing-unit) * 0.16)}"},function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var n=e.protocol+"//"+e.host,o=n+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(t,e){var r,i=e.trim().replace(/^"(.*)"$/,function(t,e){return e}).replace(/^'(.*)'$/,function(t,e){return e});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(i)?t:(r=0===i.indexOf("//")?i:0===i.indexOf("/")?n+i:o+i.replace(/^\.\//,""),"url("+JSON.stringify(r)+")")})}},function(t,e,n){var o=n(65);"string"==typeof o&&(o=[[t.i,o,""]]);var r={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,r);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=".ck.ck-editor__editable:not(.ck-editor__nested-editable){border-radius:0}.ck-rounded-corners .ck.ck-editor__editable:not(.ck-editor__nested-editable),.ck.ck-editor__editable:not(.ck-editor__nested-editable).ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-editor__editable:not(.ck-editor__nested-editable).ck-focused{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0}.ck.ck-editor__editable_inline{overflow:auto;padding:0 var(--ck-spacing-standard);border:1px solid transparent}.ck.ck-editor__editable_inline>:first-child{margin-top:var(--ck-spacing-large)}.ck.ck-editor__editable_inline>:last-child{margin-bottom:var(--ck-spacing-large)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_n]:after{border-bottom-color:var(--ck-color-base-foreground)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_s]:after{border-top-color:var(--ck-color-base-foreground)}"},function(t,e,n){var o=n(67);"string"==typeof o&&(o=[[t.i,o,""]]);var r={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,r);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=".ck.ck-label{display:block}.ck.ck-voice-label{display:none}.ck.ck-label{font-weight:700}"},function(t,e,n){var o=n(69);"string"==typeof o&&(o=[[t.i,o,""]]);var r={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,r);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=".ck.ck-sticky-panel .ck-sticky-panel__content_sticky{z-index:var(--ck-z-modal);position:fixed;top:0}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky_bottom-limit{top:auto;position:absolute}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky{box-shadow:var(--ck-drop-shadow),0 0;border-width:0 1px 1px;border-top-left-radius:0;border-top-right-radius:0}"},function(t,e,n){var o=n(71);"string"==typeof o&&(o=[[t.i,o,""]]);var r={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,r);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=".ck.ck-toolbar{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-flow:row wrap;align-items:center}.ck.ck-toolbar.ck-toolbar_vertical{flex-direction:column}.ck.ck-toolbar.ck-toolbar_floating{flex-wrap:nowrap}.ck.ck-toolbar__separator{display:inline-block}.ck.ck-toolbar__newline{display:block;width:100%}.ck.ck-toolbar{border-radius:0}.ck-rounded-corners .ck.ck-toolbar,.ck.ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-toolbar{background:var(--ck-color-toolbar-background);padding:0 var(--ck-spacing-small);border:1px solid var(--ck-color-toolbar-border)}.ck.ck-toolbar>*{margin-right:var(--ck-spacing-small);margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small)}.ck.ck-toolbar.ck-toolbar_vertical{padding:0}.ck.ck-toolbar.ck-toolbar_vertical>*{width:100%;margin:0;border-radius:0;border:0}.ck.ck-toolbar>:last-child{margin-right:0}.ck-toolbar-container .ck.ck-toolbar{border:0}.ck.ck-toolbar__separator{align-self:stretch;width:1px;margin-top:0;margin-bottom:0;background:var(--ck-color-toolbar-border)}.ck.ck-toolbar__newline{margin:0}"},function(t,e,n){var o=n(73);"string"==typeof o&&(o=[[t.i,o,""]]);var r={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,r);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=".ck.ck-editor{position:relative}.ck.ck-editor .ck-editor__top .ck-sticky-panel .ck-toolbar{z-index:var(--ck-z-modal)}.ck.ck-editor__top .ck-sticky-panel .ck-toolbar{border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-editor__top .ck-sticky-panel .ck-toolbar{border-bottom-width:0}.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar{border-bottom-width:1px;border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-radius:0}.ck.ck-editor__main>.ck-editor__editable{background:var(--ck-color-base-background);border-radius:0}.ck-rounded-corners .ck.ck-editor__main>.ck-editor__editable,.ck.ck-editor__main>.ck-editor__editable.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}.ck.ck-editor__main>.ck-editor__editable:not(.ck-focused){border-color:var(--ck-color-base-border)}"},function(t,e,n){var o=n(75);"string"==typeof o&&(o=[[t.i,o,""]]);var r={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,r);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=".ck.ck-icon{vertical-align:middle}:root{--ck-icon-size:calc(var(--ck-line-height-base) * var(--ck-font-size-normal))}.ck.ck-icon{width:var(--ck-icon-size);height:var(--ck-icon-size);font-size:.8333350694em;will-change:transform}.ck.ck-icon,.ck.ck-icon *{color:inherit;cursor:inherit}.ck.ck-icon *{fill:currentColor}"},function(t,e,n){var o=n(77);"string"==typeof o&&(o=[[t.i,o,""]]);var r={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,r);o.locals&&(t.exports=o.locals)},function(t,e){t.exports='.ck.ck-tooltip,.ck.ck-tooltip .ck-tooltip__text:after{position:absolute;pointer-events:none;-webkit-backface-visibility:hidden}.ck-tooltip{visibility:hidden;opacity:0;display:none;z-index:var(--ck-z-modal)}.ck-tooltip .ck-tooltip__text{display:inline-block}.ck-tooltip .ck-tooltip__text:after{content:"";width:0;height:0}:root{--ck-tooltip-arrow-size:5px}.ck.ck-tooltip{left:50%}.ck.ck-tooltip.ck-tooltip_s{bottom:calc(-1 * var(--ck-tooltip-arrow-size));transform:translateY(100%)}.ck.ck-tooltip.ck-tooltip_s .ck-tooltip__text:after{top:calc(-1 * var(--ck-tooltip-arrow-size));transform:translateX(-50%);border-left-color:transparent;border-bottom-color:var(--ck-color-tooltip-background);border-right-color:transparent;border-top-color:transparent;border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:var(--ck-tooltip-arrow-size);border-right-width:var(--ck-tooltip-arrow-size);border-top-width:0}.ck.ck-tooltip.ck-tooltip_n{top:calc(-1 * var(--ck-tooltip-arrow-size));transform:translateY(-100%)}.ck.ck-tooltip.ck-tooltip_n .ck-tooltip__text:after{bottom:calc(-1 * var(--ck-tooltip-arrow-size));transform:translateX(-50%);border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent;border-top-color:var(--ck-color-tooltip-background);border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:0;border-right-width:var(--ck-tooltip-arrow-size);border-top-width:var(--ck-tooltip-arrow-size)}.ck.ck-tooltip .ck-tooltip__text{border-radius:0}.ck-rounded-corners .ck.ck-tooltip .ck-tooltip__text,.ck.ck-tooltip .ck-tooltip__text.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-tooltip .ck-tooltip__text{font-size:.9em;line-height:1.5;color:var(--ck-color-tooltip-text);padding:var(--ck-spacing-small) var(--ck-spacing-medium);background:var(--ck-color-tooltip-background);position:relative;left:-50%}.ck.ck-tooltip .ck-tooltip__text:after{border-style:solid;left:50%}.ck.ck-tooltip,.ck.ck-tooltip .ck-tooltip__text:after{transition:opacity .2s ease-in-out .2s}'},function(t,e,n){var o=n(79);"string"==typeof o&&(o=[[t.i,o,""]]);var r={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,r);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=".ck.ck-button,a.ck.ck-button{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ck.ck-button .ck-tooltip,a.ck.ck-button .ck-tooltip{display:block}@media (hover:none){.ck.ck-button .ck-tooltip,a.ck.ck-button .ck-tooltip{display:none}}.ck.ck-button,a.ck.ck-button{position:relative;display:inline-flex;align-items:center;justify-content:left}.ck.ck-button.ck-button_with-text .ck-button__label,a.ck.ck-button.ck-button_with-text .ck-button__label{display:inline-block}.ck.ck-button:not(.ck-button_with-text),a.ck.ck-button:not(.ck-button_with-text){justify-content:center}.ck.ck-button:hover .ck-tooltip,a.ck.ck-button:hover .ck-tooltip{visibility:visible;opacity:1}.ck.ck-button .ck-button__label,.ck.ck-button:focus:not(:hover) .ck-tooltip,a.ck.ck-button .ck-button__label,a.ck.ck-button:focus:not(:hover) .ck-tooltip{display:none}.ck.ck-button,a.ck.ck-button{background:var(--ck-color-button-default-background)}.ck.ck-button:not(.ck-disabled):hover,a.ck.ck-button:not(.ck-disabled):hover{background:var(--ck-color-button-default-hover-background)}.ck.ck-button:not(.ck-disabled):active,a.ck.ck-button:not(.ck-disabled):active{background:var(--ck-color-button-default-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-default-active-shadow)}.ck.ck-button.ck-disabled,a.ck.ck-button.ck-disabled{background:var(--ck-color-button-default-disabled-background)}.ck.ck-button,a.ck.ck-button{border-radius:0}.ck-rounded-corners .ck.ck-button,.ck-rounded-corners a.ck.ck-button,.ck.ck-button.ck-rounded-corners,a.ck.ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-button,a.ck.ck-button{white-space:nowrap;cursor:default;vertical-align:middle;padding:var(--ck-spacing-tiny);text-align:center;min-width:var(--ck-ui-component-min-height);min-height:var(--ck-ui-component-min-height);line-height:1;font-size:inherit;border:1px solid transparent;transition:box-shadow .2s ease-in-out;-webkit-appearance:none}.ck.ck-button:active,.ck.ck-button:focus,a.ck.ck-button:active,a.ck.ck-button:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0;border-color:transparent}.ck.ck-button.ck-disabled:active,.ck.ck-button.ck-disabled:focus,a.ck.ck-button.ck-disabled:active,a.ck.ck-button.ck-disabled:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),0 0}.ck.ck-button.ck-disabled .ck-button__icon,a.ck.ck-button.ck-disabled .ck-button__icon{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-disabled .ck-button__label,a.ck.ck-button.ck-disabled .ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-button_with-text,a.ck.ck-button.ck-button_with-text{padding:var(--ck-spacing-tiny) var(--ck-spacing-standard)}.ck.ck-button.ck-button_with-text .ck-button__icon,a.ck.ck-button.ck-button_with-text .ck-button__icon{margin-left:calc(-1 * var(--ck-spacing-small));margin-right:var(--ck-spacing-small)}.ck.ck-button.ck-on,a.ck.ck-button.ck-on{background:var(--ck-color-button-on-background)}.ck.ck-button.ck-on:not(.ck-disabled):hover,a.ck.ck-button.ck-on:not(.ck-disabled):hover{background:var(--ck-color-button-on-hover-background)}.ck.ck-button.ck-on:not(.ck-disabled):active,a.ck.ck-button.ck-on:not(.ck-disabled):active{background:var(--ck-color-button-on-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-on-active-shadow)}.ck.ck-button.ck-on.ck-disabled,a.ck.ck-button.ck-on.ck-disabled{background:var(--ck-color-button-on-disabled-background)}.ck.ck-button.ck-button-save,a.ck.ck-button.ck-button-save{color:var(--ck-color-button-save)}.ck.ck-button.ck-button-cancel,a.ck.ck-button.ck-button-cancel{color:var(--ck-color-button-cancel)}.ck.ck-button .ck-button__icon use,.ck.ck-button .ck-button__icon use *,a.ck.ck-button .ck-button__icon use,a.ck.ck-button .ck-button__icon use *{color:inherit}.ck.ck-button .ck-button__label,a.ck.ck-button .ck-button__label{font-size:inherit;font-weight:inherit;color:inherit;cursor:inherit;vertical-align:middle}.ck.ck-button-action,a.ck.ck-button-action{background:var(--ck-color-button-action-background)}.ck.ck-button-action:not(.ck-disabled):hover,a.ck.ck-button-action:not(.ck-disabled):hover{background:var(--ck-color-button-action-hover-background)}.ck.ck-button-action:not(.ck-disabled):active,a.ck.ck-button-action:not(.ck-disabled):active{background:var(--ck-color-button-action-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-action-active-shadow)}.ck.ck-button-action.ck-disabled,a.ck.ck-button-action.ck-disabled{background:var(--ck-color-button-action-disabled-background)}.ck.ck-button-action,a.ck.ck-button-action{color:var(--ck-color-button-action-text)}.ck.ck-button-bold,a.ck.ck-button-bold{font-weight:700}"},function(t,e,n){var o=n(81);"string"==typeof o&&(o=[[t.i,o,""]]);var r={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,r);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=".ck .ck-widget.ck-widget_selectable{position:relative}.ck .ck-widget.ck-widget_selectable .ck-widget__selection-handler{visibility:hidden;position:absolute}.ck .ck-widget.ck-widget_selectable .ck-widget__selection-handler .ck-icon{display:block}.ck .ck-widget.ck-widget_selectable.ck-widget_selected .ck-widget__selection-handler,.ck .ck-widget.ck-widget_selectable:hover .ck-widget__selection-handler{visibility:visible}:root{--ck-widget-outline-thickness:3px;--ck-widget-handler-icon-size:16px;--ck-widget-handler-animation-duration:200ms;--ck-widget-handler-animation-curve:ease;--ck-color-widget-blurred-border:#dedede;--ck-color-widget-hover-border:#ffc83d;--ck-color-widget-editable-focus-background:var(--ck-color-base-background);--ck-color-widget-drag-handler-icon-color:var(--ck-color-base-background)}.ck .ck-widget{margin:var(--ck-spacing-standard) 0;padding:0;outline-width:var(--ck-widget-outline-thickness);outline-style:solid;outline-color:transparent;transition:outline-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve)}.ck .ck-widget.ck-widget_selected,.ck .ck-widget.ck-widget_selected:hover{outline:var(--ck-widget-outline-thickness) solid var(--ck-color-focus-border)}.ck .ck-widget:hover{outline-color:var(--ck-color-widget-hover-border)}.ck .ck-editor__nested-editable{border:1px solid transparent}.ck .ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck .ck-editor__nested-editable:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0;background-color:var(--ck-color-widget-editable-focus-background)}.ck .ck-widget.ck-widget_selectable .ck-widget__selection-handler{padding:4px;box-sizing:border-box;background-color:transparent;opacity:0;transition:background-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),visibility var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),opacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);border-radius:var(--ck-border-radius) var(--ck-border-radius) 0 0;transform:translateY(-100%);left:calc(0px - var(--ck-widget-outline-thickness))}.ck .ck-widget.ck-widget_selectable .ck-widget__selection-handler:hover .ck-icon .ck-icon__selected-indicator{opacity:1}.ck .ck-widget.ck-widget_selectable .ck-widget__selection-handler .ck-icon{width:var(--ck-widget-handler-icon-size);height:var(--ck-widget-handler-icon-size);color:var(--ck-color-widget-drag-handler-icon-color)}.ck .ck-widget.ck-widget_selectable .ck-widget__selection-handler .ck-icon .ck-icon__selected-indicator{opacity:0;transition:opacity .3s var(--ck-widget-handler-animation-curve)}.ck .ck-widget.ck-widget_selectable.ck-widget_selected .ck-widget__selection-handler,.ck .ck-widget.ck-widget_selectable.ck-widget_selected:hover .ck-widget__selection-handler{opacity:1;background-color:var(--ck-color-focus-border)}.ck .ck-widget.ck-widget_selectable.ck-widget_selected .ck-widget__selection-handler .ck-icon .ck-icon__selected-indicator,.ck .ck-widget.ck-widget_selectable.ck-widget_selected:hover .ck-widget__selection-handler .ck-icon .ck-icon__selected-indicator{opacity:1}.ck .ck-widget.ck-widget_selectable:hover .ck-widget__selection-handler{opacity:1;background-color:var(--ck-color-widget-hover-border)}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected,.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover{outline-color:var(--ck-color-widget-blurred-border)}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected .ck-widget__selection-handler,.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected .ck-widget__selection-handler:hover,.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover .ck-widget__selection-handler,.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover .ck-widget__selection-handler:hover{background:var(--ck-color-widget-blurred-border)}"},function(t,e,n){var o=n(83);"string"==typeof o&&(o=[[t.i,o,""]]);var r={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,r);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=':root{--ck-balloon-panel-arrow-z-index:calc(var(--ck-z-default) - 3)}.ck.ck-balloon-panel{display:none;position:absolute;z-index:var(--ck-z-modal)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{content:"";position:absolute}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_n]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_n]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_s]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_s]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel.ck-balloon-panel_visible{display:block}:root{--ck-balloon-arrow-offset:2px;--ck-balloon-arrow-height:10px;--ck-balloon-arrow-half-width:8px}.ck.ck-balloon-panel{border-radius:0}.ck-rounded-corners .ck.ck-balloon-panel,.ck.ck-balloon-panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-balloon-panel{box-shadow:var(--ck-drop-shadow),0 0;min-height:15px;background:var(--ck-color-panel-background);border:1px solid var(--ck-color-panel-border)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{width:0;height:0;border-style:solid}.ck.ck-balloon-panel[class*=arrow_n]:after,.ck.ck-balloon-panel[class*=arrow_n]:before{border-left-width:var(--ck-balloon-arrow-half-width);border-bottom-width:var(--ck-balloon-arrow-height);border-right-width:var(--ck-balloon-arrow-half-width);border-top-width:0}.ck.ck-balloon-panel[class*=arrow_n]:before{border-bottom-color:var(--ck-color-panel-border)}.ck.ck-balloon-panel[class*=arrow_n]:after,.ck.ck-balloon-panel[class*=arrow_n]:before{border-left-color:transparent;border-right-color:transparent;border-top-color:transparent}.ck.ck-balloon-panel[class*=arrow_n]:after{border-bottom-color:var(--ck-color-panel-background);margin-top:var(--ck-balloon-arrow-offset)}.ck.ck-balloon-panel[class*=arrow_s]:after,.ck.ck-balloon-panel[class*=arrow_s]:before{border-left-width:var(--ck-balloon-arrow-half-width);border-bottom-width:0;border-right-width:var(--ck-balloon-arrow-half-width);border-top-width:var(--ck-balloon-arrow-height)}.ck.ck-balloon-panel[class*=arrow_s]:before{border-top-color:var(--ck-color-panel-border)}.ck.ck-balloon-panel[class*=arrow_s]:after,.ck.ck-balloon-panel[class*=arrow_s]:before{border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent}.ck.ck-balloon-panel[class*=arrow_s]:after{border-top-color:var(--ck-color-panel-background);margin-bottom:var(--ck-balloon-arrow-offset)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:before{left:50%;margin-left:calc(-1 * var(--ck-balloon-arrow-half-width));top:calc(-1 * var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:before{left:calc(2 * var(--ck-balloon-arrow-half-width));top:calc(-1 * var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:before{right:calc(2 * var(--ck-balloon-arrow-half-width));top:calc(-1 * var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:before{left:50%;margin-left:calc(-1 * var(--ck-balloon-arrow-half-width));bottom:calc(-1 * var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:before{left:calc(2 * var(--ck-balloon-arrow-half-width));bottom:calc(-1 * var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:before{right:calc(2 * var(--ck-balloon-arrow-half-width));bottom:calc(-1 * var(--ck-balloon-arrow-height))}'},function(t,e,n){var o=n(85);"string"==typeof o&&(o=[[t.i,o,""]]);var r={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,r);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=".ck-content .image{position:relative;overflow:hidden}.ck-content .image .ck-progress-bar{position:absolute;top:0;left:0}:root{--ck-image-upload-progress-line-width:30px}.ck-content .image.ck-appear{animation:fadeIn .7s}.ck-content .image .ck-progress-bar{height:2px;width:0;background:var(--ck-color-upload-bar-background);transition:width .1s}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}"},function(t,e,n){var o=n(87);"string"==typeof o&&(o=[[t.i,o,""]]);var r={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,r);o.locals&&(t.exports=o.locals)},function(t,e){t.exports='.ck-image-upload-complete-icon{display:block;position:absolute;top:10px;right:10px;border-radius:50%}.ck-image-upload-complete-icon:after{content:"";position:absolute}:root{--ck-color-image-upload-icon:#fff;--ck-color-image-upload-icon-background:#008a00;--ck-image-upload-icon-size:20px;--ck-image-upload-icon-width:2px}.ck-image-upload-complete-icon{width:var(--ck-image-upload-icon-size);height:var(--ck-image-upload-icon-size);opacity:0;background:var(--ck-color-image-upload-icon-background);animation-name:ck-upload-complete-icon-show,ck-upload-complete-icon-hide;animation-fill-mode:forwards,forwards;animation-duration:.5s,.5s;font-size:var(--ck-image-upload-icon-size);animation-delay:0ms,3s}.ck-image-upload-complete-icon:after{left:25%;top:50%;opacity:0;height:0;width:0;transform:scaleX(-1) rotate(135deg);transform-origin:left top;border-top:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);border-right:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);animation-name:ck-upload-complete-icon-check;animation-duration:.5s;animation-delay:.5s;animation-fill-mode:forwards;box-sizing:border-box}@keyframes ck-upload-complete-icon-show{0%{opacity:0}to{opacity:1}}@keyframes ck-upload-complete-icon-hide{0%{opacity:1}to{opacity:0}}@keyframes ck-upload-complete-icon-check{0%{opacity:1;width:0;height:0}33%{width:.3em;height:0}to{opacity:1;width:.3em;height:.45em}}'},function(t,e,n){var o=n(89);"string"==typeof o&&(o=[[t.i,o,""]]);var r={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,r);o.locals&&(t.exports=o.locals)},function(t,e){t.exports='.ck .ck-upload-placeholder-loader{position:absolute;display:flex;align-items:center;justify-content:center;top:0;left:0}.ck .ck-upload-placeholder-loader:before{content:"";position:relative}:root{--ck-color-upload-placeholder-loader:#b3b3b3;--ck-upload-placeholder-loader-size:32px}.ck .ck-image-upload-placeholder{width:100%;margin:0}.ck .ck-upload-placeholder-loader{width:100%;height:100%}.ck .ck-upload-placeholder-loader:before{width:var(--ck-upload-placeholder-loader-size);height:var(--ck-upload-placeholder-loader-size);border-radius:50%;border-top:3px solid var(--ck-color-upload-placeholder-loader);border-right:2px solid transparent;animation:ck-upload-placeholder-loader 1s linear infinite}@keyframes ck-upload-placeholder-loader{to{transform:rotate(1turn)}}'},function(t,e){t.exports=".ck-content code{background-color:hsla(0,0%,78%,.3);padding:.15em;border-radius:2px}"},function(t,e,n){var o=n(92);"string"==typeof o&&(o=[[t.i,o,""]]);var r={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,r);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=".ck-content blockquote{overflow:hidden;padding-right:1.5em;padding-left:1.5em;margin-left:0;font-style:italic;border-left:5px solid #ccc}"},function(t,e,n){var o=n(94);"string"==typeof o&&(o=[[t.i,o,""]]);var r={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,r);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=".ck.ck-dropdown{display:inline-block;position:relative}.ck.ck-dropdown .ck-dropdown__arrow{pointer-events:none;z-index:var(--ck-z-default)}.ck.ck-dropdown .ck-button.ck-dropdown__button{width:100%}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on .ck-tooltip{display:none}.ck.ck-dropdown .ck-dropdown__panel{-webkit-backface-visibility:hidden;display:none;z-index:var(--ck-z-modal);position:absolute;left:0;transform:translate3d(0,100%,0)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel-visible{display:inline-block;will-change:transform}:root{--ck-dropdown-arrow-size:calc(0.5 * var(--ck-icon-size))}.ck.ck-dropdown{font-size:inherit}.ck.ck-dropdown .ck-dropdown__arrow{right:var(--ck-spacing-standard);width:var(--ck-dropdown-arrow-size);margin-left:var(--ck-spacing-small)}.ck.ck-dropdown.ck-disabled .ck-dropdown__arrow{opacity:var(--ck-disabled-opacity)}.ck.ck-dropdown .ck-button.ck-dropdown__button:not(.ck-button_with-text){padding-left:var(--ck-spacing-small)}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-disabled .ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on{border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-dropdown .ck-button.ck-dropdown__button .ck-button__label{width:7em;overflow:hidden;text-overflow:ellipsis}.ck.ck-dropdown__panel{box-shadow:var(--ck-drop-shadow),0 0;border-radius:0}.ck-rounded-corners .ck.ck-dropdown__panel,.ck.ck-dropdown__panel.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0}.ck.ck-dropdown__panel{background:var(--ck-color-dropdown-panel-background);border:1px solid var(--ck-color-dropdown-panel-border);bottom:0;min-width:100%}"},function(t,e,n){var o=n(96);"string"==typeof o&&(o=[[t.i,o,""]]);var r={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,r);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=".ck.ck-list{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-direction:column}.ck.ck-list .ck-list__item,.ck.ck-list .ck-list__separator{display:block}.ck.ck-list .ck-list__item>:focus{position:relative;z-index:var(--ck-z-default)}.ck.ck-list{border-radius:0}.ck-rounded-corners .ck.ck-list,.ck.ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-list{list-style-type:none;background:var(--ck-color-list-background)}.ck.ck-list__item{cursor:default;min-width:12em}.ck.ck-list__item .ck-button{min-height:unset;width:100%;text-align:left;border-radius:0;border:0;padding:calc(.2 * var(--ck-line-height-base) * var(--ck-font-size-base)) calc(.4 * var(--ck-line-height-base) * var(--ck-font-size-base))}.ck.ck-list__item .ck-button .ck-button__label{line-height:calc(1.2 * var(--ck-line-height-base) * var(--ck-font-size-base))}.ck.ck-list__item .ck-button:active{box-shadow:none}.ck.ck-list__item .ck-button.ck-on{background:var(--ck-color-list-button-on-background);color:var(--ck-color-list-button-on-text)}.ck.ck-list__item .ck-button.ck-on:hover:not(ck-disabled){background:var(--ck-color-list-button-on-background-focus)}.ck.ck-list__item .ck-button.ck-on:active{box-shadow:none}.ck.ck-list__item .ck-button:hover:not(.ck-disabled){background:var(--ck-color-list-button-hover-background)}.ck.ck-list__item .ck-switchbutton.ck-on{background:var(--ck-color-list-background);color:inherit}.ck.ck-list__item .ck-switchbutton.ck-on:hover:not(ck-disabled){background:var(--ck-color-list-button-hover-background);color:inherit}.ck.ck-list__separator{height:1px;width:100%;background:var(--ck-color-base-border)}"},function(t,e,n){var o=n(98);"string"==typeof o&&(o=[[t.i,o,""]]);var r={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,r);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=".ck.ck-button.ck-switchbutton .ck-button__toggle,.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{display:block}:root{--ck-switch-button-toggle-width:2.6153846154em;--ck-switch-button-toggle-inner-size:1.0769230769em;--ck-switch-button-toggle-spacing:1px}.ck.ck-button.ck-switchbutton .ck-button__label{margin-right:calc(2 * var(--ck-spacing-large))}.ck.ck-button.ck-switchbutton.ck-disabled .ck-button__toggle{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-switchbutton .ck-button__toggle{border-radius:0}.ck-rounded-corners .ck.ck-button.ck-switchbutton .ck-button__toggle,.ck.ck-button.ck-switchbutton .ck-button__toggle.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-button.ck-switchbutton .ck-button__toggle{margin-left:auto;transition:background .4s ease;width:var(--ck-switch-button-toggle-width);background:var(--ck-color-switch-button-off-background)}.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{border-radius:0}.ck-rounded-corners .ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner,.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner.ck-rounded-corners{border-radius:var(--ck-border-radius);border-radius:calc(.5 * var(--ck-border-radius))}.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{margin:var(--ck-switch-button-toggle-spacing);width:var(--ck-switch-button-toggle-inner-size);height:var(--ck-switch-button-toggle-inner-size);background:var(--ck-color-switch-button-inner-background);transition:transform .3s ease}.ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle{background:var(--ck-color-switch-button-on-background)}.ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle .ck-button__toggle__inner{transform:translateX(1.3846153847em)}"},function(t,e,n){var o=n(100);"string"==typeof o&&(o=[[t.i,o,""]]);var r={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,r);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=".ck.ck-toolbar-dropdown .ck-toolbar{flex-wrap:nowrap}.ck.ck-toolbar-dropdown .ck-dropdown__panel .ck-button:focus{z-index:calc(var(--ck-z-default) + 1)}.ck.ck-toolbar-dropdown .ck-toolbar{border:0}"},function(t,e,n){var o=n(102);"string"==typeof o&&(o=[[t.i,o,""]]);var r={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,r);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=".ck.ck-dropdown .ck-dropdown__panel .ck-list{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list,.ck.ck-dropdown .ck-dropdown__panel .ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0}.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button,.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button,.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}"},function(t,e){t.exports=".ck.ck-heading_heading1{font-size:20px}.ck.ck-heading_heading2{font-size:17px}.ck.ck-heading_heading3{font-size:14px}.ck[class*=ck-heading_heading]{font-weight:700}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__button .ck-button__label{width:8em}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__panel .ck-list__item{min-width:18em}"},function(t,e,n){var o=n(105);"string"==typeof o&&(o=[[t.i,o,""]]);var r={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,r);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=".ck.ck-labeled-input .ck-labeled-input__error{font-size:var(--ck-font-size-small);color:var(--ck-color-base-error);margin-top:var(--ck-spacing-small)}"},function(t,e,n){var o=n(107);"string"==typeof o&&(o=[[t.i,o,""]]);var r={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,r);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=":root{--ck-input-text-width:18em}.ck.ck-input-text{border-radius:0}.ck-rounded-corners .ck.ck-input-text,.ck.ck-input-text.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-input-text{box-shadow:var(--ck-inner-shadow),0 0;background:var(--ck-color-input-background);border:1px solid var(--ck-color-input-border);padding:var(--ck-spacing-extra-tiny) var(--ck-spacing-medium);min-width:var(--ck-input-text-width);min-height:var(--ck-ui-component-min-height);transition-property:box-shadow,border;transition:.2s ease-in-out}.ck.ck-input-text:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),var(--ck-inner-shadow)}.ck.ck-input-text[readonly]{border:1px solid var(--ck-color-input-disabled-border);background:var(--ck-color-input-disabled-background);color:var(--ck-color-input-disabled-text)}.ck.ck-input-text[readonly]:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),var(--ck-inner-shadow)}.ck.ck-input-text.ck-error{border-color:var(--ck-color-input-error-border);animation:ck-text-input-shake .3s ease both}.ck.ck-input-text.ck-error:focus{box-shadow:var(--ck-focus-error-outer-shadow),var(--ck-inner-shadow)}@keyframes ck-text-input-shake{20%{transform:translateX(-2px)}40%{transform:translateX(2px)}60%{transform:translateX(-1px)}80%{transform:translateX(1px)}}"},function(t,e,n){var o=n(109);"string"==typeof o&&(o=[[t.i,o,""]]);var r={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,r);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=".ck.ck-text-alternative-form .ck-labeled-input{display:inline-block}.ck.ck-text-alternative-form .ck-label{display:none}.ck.ck-text-alternative-form{padding:var(--ck-spacing-standard)}.ck.ck-text-alternative-form:focus{outline:none}.ck.ck-text-alternative-form>:not(:first-child){margin-left:var(--ck-spacing-standard)}"},function(t,e,n){var o=n(111);"string"==typeof o&&(o=[[t.i,o,""]]);var r={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,r);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=".ck-content .image{clear:both;text-align:center}.ck-content .image>img{display:block;margin:0 auto;max-width:100%}"},function(t,e,n){var o=n(113);"string"==typeof o&&(o=[[t.i,o,""]]);var r={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,r);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=".ck.ck-placeholder:before,.ck .ck-placeholder:before{content:attr(data-placeholder);pointer-events:none;cursor:text;color:var(--ck-color-engine-placeholder-text)}"},function(t,e,n){var o=n(115);"string"==typeof o&&(o=[[t.i,o,""]]);var r={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,r);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=".ck-content .image>figcaption{color:#333;background-color:#f7f7f7;padding:.6em;font-size:.75em;outline-offset:-1px}"},function(t,e,n){var o=n(117);"string"==typeof o&&(o=[[t.i,o,""]]);var r={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,r);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=":root{--ck-image-style-spacing:1.5em}.ck-content .image-style-align-center,.ck-content .image-style-align-left,.ck-content .image-style-align-right,.ck-content .image-style-side{max-width:50%}.ck-content .image-style-side{float:right;margin-left:var(--ck-image-style-spacing)}.ck-content .image-style-align-left{float:left;margin-right:var(--ck-image-style-spacing)}.ck-content .image-style-align-center{margin-left:auto;margin-right:auto}.ck-content .image-style-align-right{float:right;margin-left:var(--ck-image-style-spacing)}"},function(t,e,n){var o=n(119);"string"==typeof o&&(o=[[t.i,o,""]]);var r={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,r);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=".ck .ck-link_selected{background:var(--ck-color-link-selected-background)}"},function(t,e,n){var o=n(121);"string"==typeof o&&(o=[[t.i,o,""]]);var r={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,r);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=".ck.ck-link-form .ck-labeled-input{display:inline-block}.ck.ck-link-form .ck-label{display:none}.ck.ck-link-form{padding:var(--ck-spacing-standard)}.ck.ck-link-form:focus{outline:none}.ck.ck-link-form>:not(:first-child){margin-left:var(--ck-spacing-standard)}"},function(t,e,n){var o=n(123);"string"==typeof o&&(o=[[t.i,o,""]]);var r={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,r);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=".ck.ck-link-actions .ck-link-actions__preview{display:inline-block}.ck.ck-link-actions .ck-link-actions__preview .ck-button__label{overflow:hidden}.ck.ck-link-actions{padding:var(--ck-spacing-standard)}.ck.ck-link-actions .ck-button.ck-link-actions__preview{padding-left:0;padding-right:0}.ck.ck-link-actions .ck-button.ck-link-actions__preview,.ck.ck-link-actions .ck-button.ck-link-actions__preview:active,.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus,.ck.ck-link-actions .ck-button.ck-link-actions__preview:hover{background:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:active{box-shadow:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus .ck-button__label{text-decoration:underline}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{padding:0 var(--ck-spacing-medium);color:var(--ck-color-link-default);text-overflow:ellipsis;cursor:pointer;max-width:var(--ck-input-text-width);min-width:3em;text-align:center}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label:hover{text-decoration:underline}.ck.ck-link-actions:focus{outline:none}.ck.ck-link-actions>:not(:first-child){margin-left:var(--ck-spacing-standard)}"},function(t,e,n){var o=n(125);"string"==typeof o&&(o=[[t.i,o,""]]);var r={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,r);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=":root{--ck-color-table-focused-cell-background:#f5fafe}.ck-widget.table td.ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck-widget.table th.ck-editor__nested-editable.ck-editor__nested-editable_focused{background:var(--ck-color-table-focused-cell-background);border-style:none;outline:1px solid var(--ck-color-focus-border);outline-offset:-1px}"},function(t,e,n){var o=n(127);"string"==typeof o&&(o=[[t.i,o,""]]);var r={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,r);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=":root{--ck-insert-table-dropdown-padding:10px;--ck-insert-table-dropdown-box-height:11px;--ck-insert-table-dropdown-box-width:12px;--ck-insert-table-dropdown-box-margin:1px;--ck-insert-table-dropdown-box-border-color:#bfbfbf;--ck-insert-table-dropdown-box-border-active-color:#53a0e4;--ck-insert-table-dropdown-box-active-background:#c7e5ff}.ck .ck-insert-table-dropdown__grid{display:flex;flex-direction:row;flex-wrap:wrap;width:calc(var(--ck-insert-table-dropdown-box-width) * 10 + var(--ck-insert-table-dropdown-box-margin) * 20 + var(--ck-insert-table-dropdown-padding) * 2);padding:var(--ck-insert-table-dropdown-padding) var(--ck-insert-table-dropdown-padding) 0}.ck .ck-insert-table-dropdown__label{text-align:center}.ck .ck-insert-table-dropdown-grid-box{width:var(--ck-insert-table-dropdown-box-width);height:var(--ck-insert-table-dropdown-box-height);margin:var(--ck-insert-table-dropdown-box-margin);border:1px solid var(--ck-insert-table-dropdown-box-border-color);border-radius:1px}.ck .ck-insert-table-dropdown-grid-box.ck-on{border-color:var(--ck-insert-table-dropdown-box-border-active-color);background:var(--ck-insert-table-dropdown-box-active-background)}"},function(t,e,n){var o=n(129);"string"==typeof o&&(o=[[t.i,o,""]]);var r={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(1)(o,r);o.locals&&(t.exports=o.locals)},function(t,e){t.exports=".ck-content .table{margin:1em auto;display:table}.ck-content .table table{border-collapse:collapse;border-spacing:0;border:1px double #b3b3b3}.ck-content .table table td,.ck-content .table table th{min-width:2em;padding:.4em;border-color:#d9d9d9}.ck-content .table table th{font-weight:700;background:#fafafa}"},function(t,e){},function(t,e,n){"use strict";t.exports=n(132)},function(t,e,n){"use strict";var o=n(3),r=n(140),i=n(144),s=n(145),a=n(153),c=n(167),l=n(180),u=n(25),d=n(182),h={default:n(184),zero:n(185),commonmark:n(186)},f=/^(vbscript|javascript|file|data):/,p=/^data:image\/(gif|png|jpeg|webp);/;function m(t){var e=t.trim().toLowerCase();return!f.test(e)||!!p.test(e)}var g=["http:","https:","mailto:"];function b(t){var e=u.parse(t,!0);if(e.hostname&&(!e.protocol||g.indexOf(e.protocol)>=0))try{e.hostname=d.toASCII(e.hostname)}catch(t){}return u.encode(u.format(e))}function w(t){var e=u.parse(t,!0);if(e.hostname&&(!e.protocol||g.indexOf(e.protocol)>=0))try{e.hostname=d.toUnicode(e.hostname)}catch(t){}return u.decode(u.format(e))}function _(t,e){if(!(this instanceof _))return new _(t,e);e||o.isString(t)||(e=t||{},t="default"),this.inline=new c,this.block=new a,this.core=new s,this.renderer=new i,this.linkify=new l,this.validateLink=m,this.normalizeLink=b,this.normalizeLinkText=w,this.utils=o,this.helpers=o.assign({},r),this.options={},this.configure(t),e&&this.set(e)}_.prototype.set=function(t){return o.assign(this.options,t),this},_.prototype.configure=function(t){var e,n=this;if(o.isString(t)&&!(t=h[e=t]))throw new Error('Wrong `markdown-it` preset "'+e+'", check name');if(!t)throw new Error("Wrong `markdown-it` preset, can't be empty");return t.options&&n.set(t.options),t.components&&Object.keys(t.components).forEach(function(e){t.components[e].rules&&n[e].ruler.enableOnly(t.components[e].rules),t.components[e].rules2&&n[e].ruler2.enableOnly(t.components[e].rules2)}),this},_.prototype.enable=function(t,e){var n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(e){n=n.concat(this[e].ruler.enable(t,!0))},this),n=n.concat(this.inline.ruler2.enable(t,!0));var o=t.filter(function(t){return n.indexOf(t)<0});if(o.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+o);return this},_.prototype.disable=function(t,e){var n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(e){n=n.concat(this[e].ruler.disable(t,!0))},this),n=n.concat(this.inline.ruler2.disable(t,!0));var o=t.filter(function(t){return n.indexOf(t)<0});if(o.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+o);return this},_.prototype.use=function(t){var e=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,e),this},_.prototype.parse=function(t,e){if("string"!=typeof t)throw new Error("Input data should be a String");var n=new this.core.State(t,this,e);return this.core.process(n),n.tokens},_.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)},_.prototype.parseInline=function(t,e){var n=new this.core.State(t,this,e);return n.inlineMode=!0,this.core.process(n),n.tokens},_.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)},t.exports=_},function(t){t.exports={Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",amp:"&",AMP:"&",andand:"⩕",And:"⩓",and:"∧",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angmsd:"∡",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",apacir:"⩯",ap:"≈",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",barwed:"⌅",Barwed:"⌆",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",Because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxdl:"┐",boxdL:"╕",boxDl:"╖",boxDL:"╗",boxdr:"┌",boxdR:"╒",boxDr:"╓",boxDR:"╔",boxh:"─",boxH:"═",boxhd:"┬",boxHd:"╤",boxhD:"╥",boxHD:"╦",boxhu:"┴",boxHu:"╧",boxhU:"╨",boxHU:"╩",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxul:"┘",boxuL:"╛",boxUl:"╜",boxUL:"╝",boxur:"└",boxuR:"╘",boxUr:"╙",boxUR:"╚",boxv:"│",boxV:"║",boxvh:"┼",boxvH:"╪",boxVh:"╫",boxVH:"╬",boxvl:"┤",boxvL:"╡",boxVl:"╢",boxVL:"╣",boxvr:"├",boxvR:"╞",boxVr:"╟",boxVR:"╠",bprime:"‵",breve:"˘",Breve:"˘",brvbar:"¦",bscr:"𝒷",Bscr:"ℬ",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsolb:"⧅",bsol:"\\",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",capand:"⩄",capbrcup:"⩉",capcap:"⩋",cap:"∩",Cap:"⋒",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",CenterDot:"·",cfr:"𝔠",Cfr:"ℭ",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cir:"○",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",colon:":",Colon:"∷",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",conint:"∮",Conint:"∯",ContourIntegral:"∮",copf:"𝕔",Copf:"ℂ",coprod:"∐",Coproduct:"∐",copy:"©",COPY:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",cross:"✗",Cross:"⨯",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cupbrcap:"⩈",cupcap:"⩆",CupCap:"≍",cup:"∪",Cup:"⋓",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dagger:"†",Dagger:"‡",daleth:"ℸ",darr:"↓",Darr:"↡",dArr:"⇓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",ddagger:"‡",ddarr:"⇊",DD:"ⅅ",dd:"ⅆ",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",diamond:"⋄",Diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrowBar:"⤓",downarrow:"↓",DownArrow:"↓",Downarrow:"⇓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVectorBar:"⥖",DownLeftVector:"↽",DownRightTeeVector:"⥟",DownRightVectorBar:"⥗",DownRightVector:"⇁",DownTeeArrow:"↧",DownTee:"⊤",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",Ecirc:"Ê",ecirc:"ê",ecir:"≖",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",edot:"ė",eDot:"≑",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp13:" ",emsp14:" ",emsp:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",escr:"ℯ",Escr:"ℰ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",exponentiale:"ⅇ",ExponentialE:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",forall:"∀",ForAll:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",Fscr:"ℱ",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",ge:"≥",gE:"≧",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",gescc:"⪩",ges:"⩾",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",gg:"≫",Gg:"⋙",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gla:"⪥",gl:"≷",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gnE:"≩",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",gtcc:"⪧",gtcir:"⩺",gt:">",GT:">",Gt:"≫",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",harrcir:"⥈",harr:"↔",hArr:"⇔",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",Hfr:"ℌ",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",Hopf:"ℍ",horbar:"―",HorizontalLine:"─",hscr:"𝒽",Hscr:"ℋ",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",ifr:"𝔦",Ifr:"ℑ",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",Im:"ℑ",imof:"⊷",imped:"Ƶ",Implies:"⇒",incare:"℅",in:"∈",infin:"∞",infintie:"⧝",inodot:"ı",intcal:"⊺",int:"∫",Int:"∬",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"",InvisibleTimes:"",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",Iscr:"ℐ",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",lang:"⟨",Lang:"⟪",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",larrb:"⇤",larrbfs:"⤟",larr:"←",Larr:"↞",lArr:"⇐",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",latail:"⤙",lAtail:"⤛",lat:"⪫",late:"⪭",lates:"⪭︀",lbarr:"⤌",lBarr:"⤎",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",lE:"≦",LeftAngleBracket:"⟨",LeftArrowBar:"⇤",leftarrow:"←",LeftArrow:"←",Leftarrow:"⇐",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVectorBar:"⥙",LeftDownVector:"⇃",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTeeArrow:"↤",LeftTee:"⊣",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangleBar:"⧏",LeftTriangle:"⊲",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVectorBar:"⥘",LeftUpVector:"↿",LeftVectorBar:"⥒",LeftVector:"↼",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",lescc:"⪨",les:"⩽",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",llarr:"⇇",ll:"≪",Ll:"⋘",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoustache:"⎰",lmoust:"⎰",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lnE:"≨",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftrightarrow:"⟷",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longmapsto:"⟼",longrightarrow:"⟶",LongRightArrow:"⟶",Longrightarrow:"⟹",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",Lscr:"ℒ",lsh:"↰",Lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",ltcc:"⪦",ltcir:"⩹",lt:"<",LT:"<",Lt:"≪",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",midast:"*",midcir:"⫰",mid:"∣",middot:"·",minusb:"⊟",minus:"−",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",mscr:"𝓂",Mscr:"ℳ",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natural:"♮",naturals:"ℕ",natur:"♮",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",nearhk:"⤤",nearr:"↗",neArr:"⇗",nearrow:"↗",ne:"≠",nedot:"≐̸",NegativeMediumSpace:"",NegativeThickSpace:"",NegativeThinSpace:"",NegativeVeryThinSpace:"",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nharr:"↮",nhArr:"⇎",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlarr:"↚",nlArr:"⇍",nldr:"‥",nlE:"≦̸",nle:"≰",nleftarrow:"↚",nLeftarrow:"⇍",nleftrightarrow:"↮",nLeftrightarrow:"⇎",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"",NonBreakingSpace:" ",nopf:"𝕟",Nopf:"ℕ",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangleBar:"⧏̸",NotLeftTriangle:"⋪",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangleBar:"⧐̸",NotRightTriangle:"⋫",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",nparallel:"∦",npar:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",nprec:"⊀",npreceq:"⪯̸",npre:"⪯̸",nrarrc:"⤳̸",nrarr:"↛",nrArr:"⇏",nrarrw:"↝̸",nrightarrow:"↛",nRightarrow:"⇏",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nvdash:"⊬",nvDash:"⊭",nVdash:"⊮",nVDash:"⊯",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwarr:"↖",nwArr:"⇖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",Ocirc:"Ô",ocirc:"ô",ocir:"⊚",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",orarr:"↻",Or:"⩔",or:"∨",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",otimesas:"⨶",Otimes:"⨷",otimes:"⊗",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",para:"¶",parallel:"∥",par:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plus:"+",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",popf:"𝕡",Popf:"ℙ",pound:"£",prap:"⪷",Pr:"⪻",pr:"≺",prcue:"≼",precapprox:"⪷",prec:"≺",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",pre:"⪯",prE:"⪳",precsim:"≾",prime:"′",Prime:"″",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportional:"∝",Proportion:"∷",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",qopf:"𝕢",Qopf:"ℚ",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',QUOT:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",Rang:"⟫",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarr:"→",Rarr:"↠",rArr:"⇒",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",ratail:"⤚",rAtail:"⤜",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rBarr:"⤏",RBarr:"⤐",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",Re:"ℜ",rect:"▭",reg:"®",REG:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",Rfr:"ℜ",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrowBar:"⇥",rightarrow:"→",RightArrow:"→",Rightarrow:"⇒",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVectorBar:"⥕",RightDownVector:"⇂",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTeeArrow:"↦",RightTee:"⊢",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangleBar:"⧐",RightTriangle:"⊳",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVectorBar:"⥔",RightUpVector:"↾",RightVectorBar:"⥓",RightVector:"⇀",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"",rmoustache:"⎱",rmoust:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",Ropf:"ℝ",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",rscr:"𝓇",Rscr:"ℛ",rsh:"↱",Rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",scap:"⪸",Scaron:"Š",scaron:"š",Sc:"⪼",sc:"≻",sccue:"≽",sce:"⪰",scE:"⪴",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdotb:"⊡",sdot:"⋅",sdote:"⩦",searhk:"⤥",searr:"↘",seArr:"⇘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",solbar:"⌿",solb:"⧄",sol:"/",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",square:"□",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squ:"□",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",Sub:"⋐",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",subset:"⊂",Subset:"⋐",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succapprox:"⪸",succ:"≻",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",sum:"∑",Sum:"∑",sung:"♪",sup1:"¹",sup2:"²",sup3:"³",sup:"⊃",Sup:"⋑",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",supset:"⊃",Supset:"⋑",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swarr:"↙",swArr:"⇙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",therefore:"∴",Therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:" ",ThinSpace:" ",thinsp:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",tilde:"˜",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",timesbar:"⨱",timesb:"⊠",times:"×",timesd:"⨰",tint:"∭",toea:"⤨",topbot:"⌶",topcir:"⫱",top:"⊤",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",TRADE:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",uarr:"↑",Uarr:"↟",uArr:"⇑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrowBar:"⤒",uparrow:"↑",UpArrow:"↑",Uparrow:"⇑",UpArrowDownArrow:"⇅",updownarrow:"↕",UpDownArrow:"↕",Updownarrow:"⇕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",upsi:"υ",Upsi:"ϒ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTeeArrow:"↥",UpTee:"⊥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",vArr:"⇕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vBar:"⫨",Vbar:"⫫",vBarv:"⫩",Vcy:"В",vcy:"в",vdash:"⊢",vDash:"⊨",Vdash:"⊩",VDash:"⊫",Vdashl:"⫦",veebar:"⊻",vee:"∨",Vee:"⋁",veeeq:"≚",vellip:"⋮",verbar:"|",Verbar:"‖",vert:"|",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",wedge:"∧",Wedge:"⋀",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xharr:"⟷",xhArr:"⟺",Xi:"Ξ",xi:"ξ",xlarr:"⟵",xlArr:"⟸",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrarr:"⟶",xrArr:"⟹",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",yuml:"ÿ",Yuml:"Ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"",Zeta:"Ζ",zeta:"ζ",zfr:"𝔷",Zfr:"ℨ",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",zopf:"𝕫",Zopf:"ℤ",Zscr:"𝒵",zscr:"𝓏",zwj:"",zwnj:""}},function(t,e,n){"use strict";var o={};function r(t,e,n){var i,s,a,c,l,u="";for("string"!=typeof e&&(n=e,e=r.defaultChars),void 0===n&&(n=!0),l=function(t){var e,n,r=o[t];if(r)return r;for(r=o[t]=[],e=0;e<128;e++)n=String.fromCharCode(e),/^[0-9a-z]$/i.test(n)?r.push(n):r.push("%"+("0"+e.toString(16).toUpperCase()).slice(-2));for(e=0;e<t.length;e++)r[t.charCodeAt(e)]=t[e];return r}(e),i=0,s=t.length;i<s;i++)if(a=t.charCodeAt(i),n&&37===a&&i+2<s&&/^[0-9a-f]{2}$/i.test(t.slice(i+1,i+3)))u+=t.slice(i,i+3),i+=2;else if(a<128)u+=l[a];else if(a>=55296&&a<=57343){if(a>=55296&&a<=56319&&i+1<s&&(c=t.charCodeAt(i+1))>=56320&&c<=57343){u+=encodeURIComponent(t[i]+t[i+1]),i++;continue}u+="%EF%BF%BD"}else u+=encodeURIComponent(t[i]);return u}r.defaultChars=";/?:@&=+$,-_.!~*'()#",r.componentChars="-_.!~*'()",t.exports=r},function(t,e,n){"use strict";var o={};function r(t,e){var n;return"string"!=typeof e&&(e=r.defaultChars),n=function(t){var e,n,r=o[t];if(r)return r;for(r=o[t]=[],e=0;e<128;e++)n=String.fromCharCode(e),r.push(n);for(e=0;e<t.length;e++)r[n=t.charCodeAt(e)]="%"+("0"+n.toString(16).toUpperCase()).slice(-2);return r}(e),t.replace(/(%[a-f0-9]{2})+/gi,function(t){var e,o,r,i,s,a,c,l="";for(e=0,o=t.length;e<o;e+=3)(r=parseInt(t.slice(e+1,e+3),16))<128?l+=n[r]:192==(224&r)&&e+3<o&&128==(192&(i=parseInt(t.slice(e+4,e+6),16)))?(l+=(c=r<<6&1984|63&i)<128?"<EFBFBD><EFBFBD>":String.fromCharCode(c),e+=3):224==(240&r)&&e+6<o&&(i=parseInt(t.slice(e+4,e+6),16),s=parseInt(t.slice(e+7,e+9),16),128==(192&i)&&128==(192&s))?(l+=(c=r<<12&61440|i<<6&4032|63&s)<2048||c>=55296&&c<=57343?"<EFBFBD><EFBFBD><EFBFBD>":String.fromCharCode(c),e+=6):240==(248&r)&&e+9<o&&(i=parseInt(t.slice(e+4,e+6),16),s=parseInt(t.slice(e+7,e+9),16),a=parseInt(t.slice(e+10,e+12),16),128==(192&i)&&128==(192&s)&&128==(192&a))?((c=r<<18&1835008|i<<12&258048|s<<6&4032|63&a)<65536||c>1114111?l+="<EFBFBD><EFBFBD><EFBFBD><EFBFBD>":(c-=65536,l+=String.fromCharCode(55296+(c>>10),56320+(1023&c))),e+=9):l+="<EFBFBD>";return l})}r.defaultChars=";/?:@&=+$,#",r.componentChars="",t.exports=r},function(t,e,n){"use strict";t.exports=function(t){var e="";return e+=t.protocol||"",e+=t.slashes?"//":"",e+=t.auth?t.auth+"@":"",t.hostname&&-1!==t.hostname.indexOf(":")?e+="["+t.hostname+"]":e+=t.hostname||"",e+=t.port?":"+t.port:"",e+=t.pathname||"",e+=t.search||"",e+=t.hash||""}},function(t,e,n){"use strict";function o(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var r=/^([a-z0-9.+-]+:)/i,i=/:[0-9]*$/,s=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,a=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),c=["'"].concat(a),l=["%","/","?",";","#"].concat(c),u=["/","?","#"],d=/^[+a-z0-9A-Z_-]{0,63}$/,h=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,f={javascript:!0,"javascript:":!0},p={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};o.prototype.parse=function(t,e){var n,o,i,a,c,m=t;if(m=m.trim(),!e&&1===t.split("#").length){var g=s.exec(m);if(g)return this.pathname=g[1],g[2]&&(this.search=g[2]),this}var b=r.exec(m);if(b&&(i=(b=b[0]).toLowerCase(),this.protocol=b,m=m.substr(b.length)),(e||b||m.match(/^\/\/[^@\/]+@[^@\/]+/))&&(!(c="//"===m.substr(0,2))||b&&f[b]||(m=m.substr(2),this.slashes=!0)),!f[b]&&(c||b&&!p[b])){var w,_,k=-1;for(n=0;n<u.length;n++)-1!==(a=m.indexOf(u[n]))&&(-1===k||a<k)&&(k=a);for(-1!==(_=-1===k?m.lastIndexOf("@"):m.lastIndexOf("@",k))&&(w=m.slice(0,_),m=m.slice(_+1),this.auth=w),k=-1,n=0;n<l.length;n++)-1!==(a=m.indexOf(l[n]))&&(-1===k||a<k)&&(k=a);-1===k&&(k=m.length),":"===m[k-1]&&k--;var v=m.slice(0,k);m=m.slice(k),this.parseHost(v),this.hostname=this.hostname||"";var y="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!y){var x=this.hostname.split(/\./);for(n=0,o=x.length;n<o;n++){var C=x[n];if(C&&!C.match(d)){for(var A="",P=0,T=C.length;P<T;P++)C.charCodeAt(P)>127?A+="x":A+=C[P];if(!A.match(d)){var E=x.slice(0,n),S=x.slice(n+1),O=C.match(h);O&&(E.push(O[1]),S.unshift(O[2])),S.length&&(m=S.join(".")+m),this.hostname=E.join(".");break}}}}this.hostname.length>255&&(this.hostname=""),y&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}var R=m.indexOf("#");-1!==R&&(this.hash=m.substr(R),m=m.slice(0,R));var I=m.indexOf("?");return-1!==I&&(this.search=m.substr(I),m=m.slice(0,I)),m&&(this.pathname=m),p[i]&&this.hostname&&!this.pathname&&(this.pathname=""),this},o.prototype.parseHost=function(t){var e=i.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)},t.exports=function(t,e){if(t&&t instanceof o)return t;var n=new o;return n.parse(t,e),n}},function(t,e,n){"use strict";e.Any=n(26),e.Cc=n(27),e.Cf=n(139),e.P=n(14),e.Z=n(28)},function(t,e){t.exports=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804\uDCBD|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/},function(t,e,n){"use strict";e.parseLinkLabel=n(141),e.parseLinkDestination=n(142),e.parseLinkTitle=n(143)},function(t,e,n){"use strict";t.exports=function(t,e,n){var o,r,i,s,a=-1,c=t.posMax,l=t.pos;for(t.pos=e+1,o=1;t.pos<c;){if(93===(i=t.src.charCodeAt(t.pos))&&0===--o){r=!0;break}if(s=t.pos,t.md.inline.skipToken(t),91===i)if(s===t.pos-1)o++;else if(n)return t.pos=l,-1}return r&&(a=t.pos),t.pos=l,a}},function(t,e,n){"use strict";var o=n(3).isSpace,r=n(3).unescapeAll;t.exports=function(t,e,n){var i,s,a=e,c={ok:!1,pos:0,lines:0,str:""};if(60===t.charCodeAt(e)){for(e++;e<n;){if(10===(i=t.charCodeAt(e))||o(i))return c;if(62===i)return c.pos=e+1,c.str=r(t.slice(a+1,e)),c.ok=!0,c;92===i&&e+1<n?e+=2:e++}return c}for(s=0;e<n&&32!==(i=t.charCodeAt(e))&&!(i<32||127===i);)if(92===i&&e+1<n)e+=2;else{if(40===i&&s++,41===i){if(0===s)break;s--}e++}return a===e?c:0!==s?c:(c.str=r(t.slice(a,e)),c.lines=0,c.pos=e,c.ok=!0,c)}},function(t,e,n){"use strict";var o=n(3).unescapeAll;t.exports=function(t,e,n){var r,i,s=0,a=e,c={ok:!1,pos:0,lines:0,str:""};if(e>=n)return c;if(34!==(i=t.charCodeAt(e))&&39!==i&&40!==i)return c;for(e++,40===i&&(i=41);e<n;){if((r=t.charCodeAt(e))===i)return c.pos=e+1,c.lines=s,c.str=o(t.slice(a+1,e)),c.ok=!0,c;10===r?s++:92===r&&e+1<n&&(e++,10===t.charCodeAt(e)&&s++),e++}return c}},function(t,e,n){"use strict";var o=n(3).assign,r=n(3).unescapeAll,i=n(3).escapeHtml,s={};function a(){this.rules=o({},s)}s.code_inline=function(t,e,n,o,r){var s=t[e];return"<code"+r.renderAttrs(s)+">"+i(t[e].content)+"</code>"},s.code_block=function(t,e,n,o,r){var s=t[e];return"<pre"+r.renderAttrs(s)+"><code>"+i(t[e].content)+"</code></pre>\n"},s.fence=function(t,e,n,o,s){var a,c,l,u,d=t[e],h=d.info?r(d.info).trim():"",f="";return h&&(f=h.split(/\s+/g)[0]),0===(a=n.highlight&&n.highlight(d.content,f)||i(d.content)).indexOf("<pre")?a+"\n":h?(c=d.attrIndex("class"),l=d.attrs?d.attrs.slice():[],c<0?l.push(["class",n.langPrefix+f]):l[c][1]+=" "+n.langPrefix+f,u={attrs:l},"<pre><code"+s.renderAttrs(u)+">"+a+"</code></pre>\n"):"<pre><code"+s.renderAttrs(d)+">"+a+"</code></pre>\n"},s.image=function(t,e,n,o,r){var i=t[e];return i.attrs[i.attrIndex("alt")][1]=r.renderInlineAsText(i.children,n,o),r.renderToken(t,e,n)},s.hardbreak=function(t,e,n){return n.xhtmlOut?"<br />\n":"<br>\n"},s.softbreak=function(t,e,n){return n.breaks?n.xhtmlOut?"<br />\n":"<br>\n":"\n"},s.text=function(t,e){return i(t[e].content)},s.html_block=function(t,e){return t[e].content},s.html_inline=function(t,e){return t[e].content},a.prototype.renderAttrs=function(t){var e,n,o;if(!t.attrs)return"";for(o="",e=0,n=t.attrs.length;e<n;e++)o+=" "+i(t.attrs[e][0])+'="'+i(t.attrs[e][1])+'"';return o},a.prototype.renderToken=function(t,e,n){var o,r="",i=!1,s=t[e];return s.hidden?"":(s.block&&-1!==s.nesting&&e&&t[e-1].hidden&&(r+="\n"),r+=(-1===s.nesting?"</":"<")+s.tag,r+=this.renderAttrs(s),0===s.nesting&&n.xhtmlOut&&(r+=" /"),s.block&&(i=!0,1===s.nesting&&e+1<t.length&&("inline"===(o=t[e+1]).type||o.hidden?i=!1:-1===o.nesting&&o.tag===s.tag&&(i=!1))),r+=i?">\n":">")},a.prototype.renderInline=function(t,e,n){for(var o,r="",i=this.rules,s=0,a=t.length;s<a;s++)void 0!==i[o=t[s].type]?r+=i[o](t,s,e,n,this):r+=this.renderToken(t,s,e);return r},a.prototype.renderInlineAsText=function(t,e,n){for(var o="",r=0,i=t.length;r<i;r++)"text"===t[r].type?o+=t[r].content:"image"===t[r].type&&(o+=this.renderInlineAsText(t[r].children,e,n));return o},a.prototype.render=function(t,e,n){var o,r,i,s="",a=this.rules;for(o=0,r=t.length;o<r;o++)"inline"===(i=t[o].type)?s+=this.renderInline(t[o].children,e,n):void 0!==a[i]?s+=a[t[o].type](t,o,e,n,this):s+=this.renderToken(t,o,e,n);return s},t.exports=a},function(t,e,n){"use strict";var o=n(15),r=[["normalize",n(146)],["block",n(147)],["inline",n(148)],["linkify",n(149)],["replacements",n(150)],["smartquotes",n(151)]];function i(){this.ruler=new o;for(var t=0;t<r.length;t++)this.ruler.push(r[t][0],r[t][1])}i.prototype.process=function(t){var e,n,o;for(e=0,n=(o=this.ruler.getRules("")).length;e<n;e++)o[e](t)},i.prototype.State=n(152),t.exports=i},function(t,e,n){"use strict";var o=/\r[\n\u0085]?|[\u2424\u2028\u0085]/g,r=/\u0000/g;t.exports=function(t){var e;e=(e=t.src.replace(o,"\n")).replace(r,"<EFBFBD>"),t.src=e}},function(t,e,n){"use strict";t.exports=function(t){var e;t.inlineMode?((e=new t.Token("inline","",0)).content=t.src,e.map=[0,1],e.children=[],t.tokens.push(e)):t.md.block.parse(t.src,t.md,t.env,t.tokens)}},function(t,e,n){"use strict";t.exports=function(t){var e,n,o,r=t.tokens;for(n=0,o=r.length;n<o;n++)"inline"===(e=r[n]).type&&t.md.inline.parse(e.content,t.md,t.env,e.children)}},function(t,e,n){"use strict";var o=n(3).arrayReplaceAt;function r(t){return/^<a[>\s]/i.test(t)}function i(t){return/^<\/a\s*>/i.test(t)}t.exports=function(t){var e,n,s,a,c,l,u,d,h,f,p,m,g,b,w,_,k,v=t.tokens;if(t.md.options.linkify)for(n=0,s=v.length;n<s;n++)if("inline"===v[n].type&&t.md.linkify.pretest(v[n].content))for(g=0,e=(a=v[n].children).length-1;e>=0;e--)if("link_close"!==(l=a[e]).type){if("html_inline"===l.type&&(r(l.content)&&g>0&&g--,i(l.content)&&g++),!(g>0)&&"text"===l.type&&t.md.linkify.test(l.content)){for(h=l.content,k=t.md.linkify.match(h),u=[],m=l.level,p=0,d=0;d<k.length;d++)b=k[d].url,w=t.md.normalizeLink(b),t.md.validateLink(w)&&(_=k[d].text,_=k[d].schema?"mailto:"!==k[d].schema||/^mailto:/i.test(_)?t.md.normalizeLinkText(_):t.md.normalizeLinkText("mailto:"+_).replace(/^mailto:/,""):t.md.normalizeLinkText("http://"+_).replace(/^http:\/\//,""),(f=k[d].index)>p&&((c=new t.Token("text","",0)).content=h.slice(p,f),c.level=m,u.push(c)),(c=new t.Token("link_open","a",1)).attrs=[["href",w]],c.level=m++,c.markup="linkify",c.info="auto",u.push(c),(c=new t.Token("text","",0)).content=_,c.level=m,u.push(c),(c=new t.Token("link_close","a",-1)).level=--m,c.markup="linkify",c.info="auto",u.push(c),p=k[d].lastIndex);p<h.length&&((c=new t.Token("text","",0)).content=h.slice(p),c.level=m,u.push(c)),v[n].children=a=o(a,e,u)}}else for(e--;a[e].level!==l.level&&"link_open"!==a[e].type;)e--}},function(t,e,n){"use strict";var o=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,r=/\((c|tm|r|p)\)/i,i=/\((c|tm|r|p)\)/gi,s={c:"©",r:"®",p:"§",tm:"™"};function a(t,e){return s[e.toLowerCase()]}function c(t){var e,n,o=0;for(e=t.length-1;e>=0;e--)"text"!==(n=t[e]).type||o||(n.content=n.content.replace(i,a)),"link_open"===n.type&&"auto"===n.info&&o--,"link_close"===n.type&&"auto"===n.info&&o++}function l(t){var e,n,r=0;for(e=t.length-1;e>=0;e--)"text"!==(n=t[e]).type||r||o.test(n.content)&&(n.content=n.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---([^-]|$)/gm,"$1—$2").replace(/(^|\s)--(\s|$)/gm,"$1–$2").replace(/(^|[^-\s])--([^-\s]|$)/gm,"$1–$2")),"link_open"===n.type&&"auto"===n.info&&r--,"link_close"===n.type&&"auto"===n.info&&r++}t.exports=function(t){var e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)"inline"===t.tokens[e].type&&(r.test(t.tokens[e].content)&&c(t.tokens[e].children),o.test(t.tokens[e].content)&&l(t.tokens[e].children))}},function(t,e,n){"use strict";var o=n(3).isWhiteSpace,r=n(3).isPunctChar,i=n(3).isMdAsciiPunct,s=/['"]/,a=/['"]/g,c="’";function l(t,e,n){return t.substr(0,e)+n+t.substr(e+1)}function u(t,e){var n,s,u,d,h,f,p,m,g,b,w,_,k,v,y,x,C,A,P,T,E;for(P=[],n=0;n<t.length;n++){for(s=t[n],p=t[n].level,C=P.length-1;C>=0&&!(P[C].level<=p);C--);if(P.length=C+1,"text"===s.type){h=0,f=(u=s.content).length;t:for(;h<f&&(a.lastIndex=h,d=a.exec(u));){if(y=x=!0,h=d.index+1,A="'"===d[0],g=32,d.index-1>=0)g=u.charCodeAt(d.index-1);else for(C=n-1;C>=0&&("softbreak"!==t[C].type&&"hardbreak"!==t[C].type);C--)if("text"===t[C].type){g=t[C].content.charCodeAt(t[C].content.length-1);break}if(b=32,h<f)b=u.charCodeAt(h);else for(C=n+1;C<t.length&&("softbreak"!==t[C].type&&"hardbreak"!==t[C].type);C++)if("text"===t[C].type){b=t[C].content.charCodeAt(0);break}if(w=i(g)||r(String.fromCharCode(g)),_=i(b)||r(String.fromCharCode(b)),k=o(g),(v=o(b))?y=!1:_&&(k||w||(y=!1)),k?x=!1:w&&(v||_||(x=!1)),34===b&&'"'===d[0]&&g>=48&&g<=57&&(x=y=!1),y&&x&&(y=!1,x=_),y||x){if(x)for(C=P.length-1;C>=0&&(m=P[C],!(P[C].level<p));C--)if(m.single===A&&P[C].level===p){m=P[C],A?(T=e.md.options.quotes[2],E=e.md.options.quotes[3]):(T=e.md.options.quotes[0],E=e.md.options.quotes[1]),s.content=l(s.content,d.index,E),t[m.token].content=l(t[m.token].content,m.pos,T),h+=E.length-1,m.token===n&&(h+=T.length-1),f=(u=s.content).length,P.length=C;continue t}y?P.push({token:n,pos:d.index,single:A,level:p}):x&&A&&(s.content=l(s.content,d.index,c))}else A&&(s.content=l(s.content,d.index,c))}}}}t.exports=function(t){var e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)"inline"===t.tokens[e].type&&s.test(t.tokens[e].content)&&u(t.tokens[e].children,t)}},function(t,e,n){"use strict";var o=n(16);function r(t,e,n){this.src=t,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=e}r.prototype.Token=o,t.exports=r},function(t,e,n){"use strict";var o=n(15),r=[["table",n(154),["paragraph","reference"]],["code",n(155)],["fence",n(156),["paragraph","reference","blockquote","list"]],["blockquote",n(157),["paragraph","reference","blockquote","list"]],["hr",n(158),["paragraph","reference","blockquote","list"]],["list",n(159),["paragraph","reference","blockquote"]],["reference",n(160)],["heading",n(161),["paragraph","reference","blockquote"]],["lheading",n(162)],["html_block",n(163),["paragraph","reference","blockquote"]],["paragraph",n(165)]];function i(){this.ruler=new o;for(var t=0;t<r.length;t++)this.ruler.push(r[t][0],r[t][1],{alt:(r[t][2]||[]).slice()})}i.prototype.tokenize=function(t,e,n){for(var o,r=this.ruler.getRules(""),i=r.length,s=e,a=!1,c=t.md.options.maxNesting;s<n&&(t.line=s=t.skipEmptyLines(s),!(s>=n))&&!(t.sCount[s]<t.blkIndent);){if(t.level>=c){t.line=n;break}for(o=0;o<i&&!r[o](t,s,n,!1);o++);t.tight=!a,t.isEmpty(t.line-1)&&(a=!0),(s=t.line)<n&&t.isEmpty(s)&&(a=!0,s++,t.line=s)}},i.prototype.parse=function(t,e,n,o){var r;t&&(r=new this.State(t,e,n,o),this.tokenize(r,r.line,r.lineMax))},i.prototype.State=n(166),t.exports=i},function(t,e,n){"use strict";var o=n(3).isSpace;function r(t,e){var n=t.bMarks[e]+t.blkIndent,o=t.eMarks[e];return t.src.substr(n,o-n)}function i(t){var e,n=[],o=0,r=t.length,i=0,s=0,a=!1,c=0;for(e=t.charCodeAt(o);o<r;)96===e?a?(a=!1,c=o):i%2==0&&(a=!0,c=o):124!==e||i%2!=0||a||(n.push(t.substring(s,o)),s=o+1),92===e?i++:i=0,++o===r&&a&&(a=!1,o=c+1),e=t.charCodeAt(o);return n.push(t.substring(s)),n}t.exports=function(t,e,n,s){var a,c,l,u,d,h,f,p,m,g,b,w;if(e+2>n)return!1;if(d=e+1,t.sCount[d]<t.blkIndent)return!1;if(t.sCount[d]-t.blkIndent>=4)return!1;if((l=t.bMarks[d]+t.tShift[d])>=t.eMarks[d])return!1;if(124!==(a=t.src.charCodeAt(l++))&&45!==a&&58!==a)return!1;for(;l<t.eMarks[d];){if(124!==(a=t.src.charCodeAt(l))&&45!==a&&58!==a&&!o(a))return!1;l++}for(h=(c=r(t,e+1)).split("|"),m=[],u=0;u<h.length;u++){if(!(g=h[u].trim())){if(0===u||u===h.length-1)continue;return!1}if(!/^:?-+:?$/.test(g))return!1;58===g.charCodeAt(g.length-1)?m.push(58===g.charCodeAt(0)?"center":"right"):58===g.charCodeAt(0)?m.push("left"):m.push("")}if(-1===(c=r(t,e).trim()).indexOf("|"))return!1;if(t.sCount[e]-t.blkIndent>=4)return!1;if((f=(h=i(c.replace(/^\||\|$/g,""))).length)>m.length)return!1;if(s)return!0;for((p=t.push("table_open","table",1)).map=b=[e,0],(p=t.push("thead_open","thead",1)).map=[e,e+1],(p=t.push("tr_open","tr",1)).map=[e,e+1],u=0;u<h.length;u++)(p=t.push("th_open","th",1)).map=[e,e+1],m[u]&&(p.attrs=[["style","text-align:"+m[u]]]),(p=t.push("inline","",0)).content=h[u].trim(),p.map=[e,e+1],p.children=[],p=t.push("th_close","th",-1);for(p=t.push("tr_close","tr",-1),p=t.push("thead_close","thead",-1),(p=t.push("tbody_open","tbody",1)).map=w=[e+2,0],d=e+2;d<n&&!(t.sCount[d]<t.blkIndent)&&-1!==(c=r(t,d).trim()).indexOf("|")&&!(t.sCount[d]-t.blkIndent>=4);d++){for(h=i(c.replace(/^\||\|$/g,"")),p=t.push("tr_open","tr",1),u=0;u<f;u++)p=t.push("td_open","td",1),m[u]&&(p.attrs=[["style","text-align:"+m[u]]]),(p=t.push("inline","",0)).content=h[u]?h[u].trim():"",p.children=[],p=t.push("td_close","td",-1);p=t.push("tr_close","tr",-1)}return p=t.push("tbody_close","tbody",-1),p=t.push("table_close","table",-1),b[1]=w[1]=d,t.line=d,!0}},function(t,e,n){"use strict";t.exports=function(t,e,n){var o,r,i;if(t.sCount[e]-t.blkIndent<4)return!1;for(r=o=e+1;o<n;)if(t.isEmpty(o))o++;else{if(!(t.sCount[o]-t.blkIndent>=4))break;r=++o}return t.line=r,(i=t.push("code_block","code",0)).content=t.getLines(e,r,4+t.blkIndent,!0),i.map=[e,t.line],!0}},function(t,e,n){"use strict";t.exports=function(t,e,n,o){var r,i,s,a,c,l,u,d=!1,h=t.bMarks[e]+t.tShift[e],f=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;if(h+3>f)return!1;if(126!==(r=t.src.charCodeAt(h))&&96!==r)return!1;if(c=h,(i=(h=t.skipChars(h,r))-c)<3)return!1;if(u=t.src.slice(c,h),(s=t.src.slice(h,f)).indexOf(String.fromCharCode(r))>=0)return!1;if(o)return!0;for(a=e;!(++a>=n)&&!((h=c=t.bMarks[a]+t.tShift[a])<(f=t.eMarks[a])&&t.sCount[a]<t.blkIndent);)if(t.src.charCodeAt(h)===r&&!(t.sCount[a]-t.blkIndent>=4||(h=t.skipChars(h,r))-c<i||(h=t.skipSpaces(h))<f)){d=!0;break}return i=t.sCount[e],t.line=a+(d?1:0),(l=t.push("fence","code",0)).info=s,l.content=t.getLines(e+1,a,i,!0),l.markup=u,l.map=[e,t.line],!0}},function(t,e,n){"use strict";var o=n(3).isSpace;t.exports=function(t,e,n,r){var i,s,a,c,l,u,d,h,f,p,m,g,b,w,_,k,v,y,x,C,A=t.lineMax,P=t.bMarks[e]+t.tShift[e],T=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;if(62!==t.src.charCodeAt(P++))return!1;if(r)return!0;for(c=f=t.sCount[e]+P-(t.bMarks[e]+t.tShift[e]),32===t.src.charCodeAt(P)?(P++,c++,f++,i=!1,k=!0):9===t.src.charCodeAt(P)?(k=!0,(t.bsCount[e]+f)%4==3?(P++,c++,f++,i=!1):i=!0):k=!1,p=[t.bMarks[e]],t.bMarks[e]=P;P<T&&(s=t.src.charCodeAt(P),o(s));)9===s?f+=4-(f+t.bsCount[e]+(i?1:0))%4:f++,P++;for(m=[t.bsCount[e]],t.bsCount[e]=t.sCount[e]+1+(k?1:0),u=P>=T,w=[t.sCount[e]],t.sCount[e]=f-c,_=[t.tShift[e]],t.tShift[e]=P-t.bMarks[e],y=t.md.block.ruler.getRules("blockquote"),b=t.parentType,t.parentType="blockquote",C=!1,h=e+1;h<n&&(t.sCount[h]<t.blkIndent&&(C=!0),!((P=t.bMarks[h]+t.tShift[h])>=(T=t.eMarks[h])));h++)if(62!==t.src.charCodeAt(P++)||C){if(u)break;for(v=!1,a=0,l=y.length;a<l;a++)if(y[a](t,h,n,!0)){v=!0;break}if(v){t.lineMax=h,0!==t.blkIndent&&(p.push(t.bMarks[h]),m.push(t.bsCount[h]),_.push(t.tShift[h]),w.push(t.sCount[h]),t.sCount[h]-=t.blkIndent);break}p.push(t.bMarks[h]),m.push(t.bsCount[h]),_.push(t.tShift[h]),w.push(t.sCount[h]),t.sCount[h]=-1}else{for(c=f=t.sCount[h]+P-(t.bMarks[h]+t.tShift[h]),32===t.src.charCodeAt(P)?(P++,c++,f++,i=!1,k=!0):9===t.src.charCodeAt(P)?(k=!0,(t.bsCount[h]+f)%4==3?(P++,c++,f++,i=!1):i=!0):k=!1,p.push(t.bMarks[h]),t.bMarks[h]=P;P<T&&(s=t.src.charCodeAt(P),o(s));)9===s?f+=4-(f+t.bsCount[h]+(i?1:0))%4:f++,P++;u=P>=T,m.push(t.bsCount[h]),t.bsCount[h]=t.sCount[h]+1+(k?1:0),w.push(t.sCount[h]),t.sCount[h]=f-c,_.push(t.tShift[h]),t.tShift[h]=P-t.bMarks[h]}for(g=t.blkIndent,t.blkIndent=0,(x=t.push("blockquote_open","blockquote",1)).markup=">",x.map=d=[e,0],t.md.block.tokenize(t,e,h),(x=t.push("blockquote_close","blockquote",-1)).markup=">",t.lineMax=A,t.parentType=b,d[1]=t.line,a=0;a<_.length;a++)t.bMarks[a+e]=p[a],t.tShift[a+e]=_[a],t.sCount[a+e]=w[a],t.bsCount[a+e]=m[a];return t.blkIndent=g,!0}},function(t,e,n){"use strict";var o=n(3).isSpace;t.exports=function(t,e,n,r){var i,s,a,c,l=t.bMarks[e]+t.tShift[e],u=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;if(42!==(i=t.src.charCodeAt(l++))&&45!==i&&95!==i)return!1;for(s=1;l<u;){if((a=t.src.charCodeAt(l++))!==i&&!o(a))return!1;a===i&&s++}return!(s<3)&&(!!r||(t.line=e+1,(c=t.push("hr","hr",0)).map=[e,t.line],c.markup=Array(s+1).join(String.fromCharCode(i)),!0))}},function(t,e,n){"use strict";var o=n(3).isSpace;function r(t,e){var n,r,i,s;return r=t.bMarks[e]+t.tShift[e],i=t.eMarks[e],42!==(n=t.src.charCodeAt(r++))&&45!==n&&43!==n?-1:r<i&&(s=t.src.charCodeAt(r),!o(s))?-1:r}function i(t,e){var n,r=t.bMarks[e]+t.tShift[e],i=r,s=t.eMarks[e];if(i+1>=s)return-1;if((n=t.src.charCodeAt(i++))<48||n>57)return-1;for(;;){if(i>=s)return-1;if(!((n=t.src.charCodeAt(i++))>=48&&n<=57)){if(41===n||46===n)break;return-1}if(i-r>=10)return-1}return i<s&&(n=t.src.charCodeAt(i),!o(n))?-1:i}t.exports=function(t,e,n,o){var s,a,c,l,u,d,h,f,p,m,g,b,w,_,k,v,y,x,C,A,P,T,E,S,O,R,I,F,D=!1,N=!0;if(t.sCount[e]-t.blkIndent>=4)return!1;if(o&&"paragraph"===t.parentType&&t.tShift[e]>=t.blkIndent&&(D=!0),(E=i(t,e))>=0){if(h=!0,O=t.bMarks[e]+t.tShift[e],w=Number(t.src.substr(O,E-O-1)),D&&1!==w)return!1}else{if(!((E=r(t,e))>=0))return!1;h=!1}if(D&&t.skipSpaces(E)>=t.eMarks[e])return!1;if(b=t.src.charCodeAt(E-1),o)return!0;for(g=t.tokens.length,h?(F=t.push("ordered_list_open","ol",1),1!==w&&(F.attrs=[["start",w]])):F=t.push("bullet_list_open","ul",1),F.map=m=[e,0],F.markup=String.fromCharCode(b),k=e,S=!1,I=t.md.block.ruler.getRules("list"),C=t.parentType,t.parentType="list";k<n;){for(T=E,_=t.eMarks[k],d=v=t.sCount[k]+E-(t.bMarks[e]+t.tShift[e]);T<_;){if(9===(s=t.src.charCodeAt(T)))v+=4-(v+t.bsCount[k])%4;else{if(32!==s)break;v++}T++}if((u=(a=T)>=_?1:v-d)>4&&(u=1),l=d+u,(F=t.push("list_item_open","li",1)).markup=String.fromCharCode(b),F.map=f=[e,0],y=t.blkIndent,P=t.tight,A=t.tShift[e],x=t.sCount[e],t.blkIndent=l,t.tight=!0,t.tShift[e]=a-t.bMarks[e],t.sCount[e]=v,a>=_&&t.isEmpty(e+1)?t.line=Math.min(t.line+2,n):t.md.block.tokenize(t,e,n,!0),t.tight&&!S||(N=!1),S=t.line-e>1&&t.isEmpty(t.line-1),t.blkIndent=y,t.tShift[e]=A,t.sCount[e]=x,t.tight=P,(F=t.push("list_item_close","li",-1)).markup=String.fromCharCode(b),k=e=t.line,f[1]=k,a=t.bMarks[e],k>=n)break;if(t.sCount[k]<t.blkIndent)break;for(R=!1,c=0,p=I.length;c<p;c++)if(I[c](t,k,n,!0)){R=!0;break}if(R)break;if(h){if((E=i(t,k))<0)break}else if((E=r(t,k))<0)break;if(b!==t.src.charCodeAt(E-1))break}return(F=h?t.push("ordered_list_close","ol",-1):t.push("bullet_list_close","ul",-1)).markup=String.fromCharCode(b),m[1]=k,t.line=k,t.parentType=C,N&&function(t,e){var n,o,r=t.level+2;for(n=e+2,o=t.tokens.length-2;n<o;n++)t.tokens[n].level===r&&"paragraph_open"===t.tokens[n].type&&(t.tokens[n+2].hidden=!0,t.tokens[n].hidden=!0,n+=2)}(t,g),!0}},function(t,e,n){"use strict";var o=n(3).normalizeReference,r=n(3).isSpace;t.exports=function(t,e,n,i){var s,a,c,l,u,d,h,f,p,m,g,b,w,_,k,v,y=0,x=t.bMarks[e]+t.tShift[e],C=t.eMarks[e],A=e+1;if(t.sCount[e]-t.blkIndent>=4)return!1;if(91!==t.src.charCodeAt(x))return!1;for(;++x<C;)if(93===t.src.charCodeAt(x)&&92!==t.src.charCodeAt(x-1)){if(x+1===C)return!1;if(58!==t.src.charCodeAt(x+1))return!1;break}for(l=t.lineMax,k=t.md.block.ruler.getRules("reference"),m=t.parentType,t.parentType="reference";A<l&&!t.isEmpty(A);A++)if(!(t.sCount[A]-t.blkIndent>3||t.sCount[A]<0)){for(_=!1,d=0,h=k.length;d<h;d++)if(k[d](t,A,l,!0)){_=!0;break}if(_)break}for(C=(w=t.getLines(e,A,t.blkIndent,!1).trim()).length,x=1;x<C;x++){if(91===(s=w.charCodeAt(x)))return!1;if(93===s){p=x;break}10===s?y++:92===s&&++x<C&&10===w.charCodeAt(x)&&y++}if(p<0||58!==w.charCodeAt(p+1))return!1;for(x=p+2;x<C;x++)if(10===(s=w.charCodeAt(x)))y++;else if(!r(s))break;if(!(g=t.md.helpers.parseLinkDestination(w,x,C)).ok)return!1;if(u=t.md.normalizeLink(g.str),!t.md.validateLink(u))return!1;for(a=x=g.pos,c=y+=g.lines,b=x;x<C;x++)if(10===(s=w.charCodeAt(x)))y++;else if(!r(s))break;for(g=t.md.helpers.parseLinkTitle(w,x,C),x<C&&b!==x&&g.ok?(v=g.str,x=g.pos,y+=g.lines):(v="",x=a,y=c);x<C&&(s=w.charCodeAt(x),r(s));)x++;if(x<C&&10!==w.charCodeAt(x)&&v)for(v="",x=a,y=c;x<C&&(s=w.charCodeAt(x),r(s));)x++;return!(x<C&&10!==w.charCodeAt(x))&&(!!(f=o(w.slice(1,p)))&&(!!i||(void 0===t.env.references&&(t.env.references={}),void 0===t.env.references[f]&&(t.env.references[f]={title:v,href:u}),t.parentType=m,t.line=e+y+1,!0)))}},function(t,e,n){"use strict";var o=n(3).isSpace;t.exports=function(t,e,n,r){var i,s,a,c,l=t.bMarks[e]+t.tShift[e],u=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;if(35!==(i=t.src.charCodeAt(l))||l>=u)return!1;for(s=1,i=t.src.charCodeAt(++l);35===i&&l<u&&s<=6;)s++,i=t.src.charCodeAt(++l);return!(s>6||l<u&&!o(i))&&(!!r||(u=t.skipSpacesBack(u,l),(a=t.skipCharsBack(u,35,l))>l&&o(t.src.charCodeAt(a-1))&&(u=a),t.line=e+1,(c=t.push("heading_open","h"+String(s),1)).markup="########".slice(0,s),c.map=[e,t.line],(c=t.push("inline","",0)).content=t.src.slice(l,u).trim(),c.map=[e,t.line],c.children=[],(c=t.push("heading_close","h"+String(s),-1)).markup="########".slice(0,s),!0))}},function(t,e,n){"use strict";t.exports=function(t,e,n){var o,r,i,s,a,c,l,u,d,h,f=e+1,p=t.md.block.ruler.getRules("paragraph");if(t.sCount[e]-t.blkIndent>=4)return!1;for(h=t.parentType,t.parentType="paragraph";f<n&&!t.isEmpty(f);f++)if(!(t.sCount[f]-t.blkIndent>3)){if(t.sCount[f]>=t.blkIndent&&(c=t.bMarks[f]+t.tShift[f])<(l=t.eMarks[f])&&(45===(d=t.src.charCodeAt(c))||61===d)&&(c=t.skipChars(c,d),(c=t.skipSpaces(c))>=l)){u=61===d?1:2;break}if(!(t.sCount[f]<0)){for(r=!1,i=0,s=p.length;i<s;i++)if(p[i](t,f,n,!0)){r=!0;break}if(r)break}}return!!u&&(o=t.getLines(e,f,t.blkIndent,!1).trim(),t.line=f+1,(a=t.push("heading_open","h"+String(u),1)).markup=String.fromCharCode(d),a.map=[e,t.line],(a=t.push("inline","",0)).content=o,a.map=[e,t.line-1],a.children=[],(a=t.push("heading_close","h"+String(u),-1)).markup=String.fromCharCode(d),t.parentType=h,!0)}},function(t,e,n){"use strict";var o=n(164),r=n(29).HTML_OPEN_CLOSE_TAG_RE,i=[[/^<(script|pre|style)(?=(\s|>|$))/i,/<\/(script|pre|style)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+o.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(r.source+"\\s*$"),/^$/,!1]];t.exports=function(t,e,n,o){var r,s,a,c,l=t.bMarks[e]+t.tShift[e],u=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;if(!t.md.options.html)return!1;if(60!==t.src.charCodeAt(l))return!1;for(c=t.src.slice(l,u),r=0;r<i.length&&!i[r][0].test(c);r++);if(r===i.length)return!1;if(o)return i[r][2];if(s=e+1,!i[r][1].test(c))for(;s<n&&!(t.sCount[s]<t.blkIndent);s++)if(l=t.bMarks[s]+t.tShift[s],u=t.eMarks[s],c=t.src.slice(l,u),i[r][1].test(c)){0!==c.length&&s++;break}return t.line=s,(a=t.push("html_block","",0)).map=[e,s],a.content=t.getLines(e,s,t.blkIndent,!0),!0}},function(t,e,n){"use strict";t.exports=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","meta","nav","noframes","ol","optgroup","option","p","param","section","source","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"]},function(t,e,n){"use strict";t.exports=function(t,e){var n,o,r,i,s,a,c=e+1,l=t.md.block.ruler.getRules("paragraph"),u=t.lineMax;for(a=t.parentType,t.parentType="paragraph";c<u&&!t.isEmpty(c);c++)if(!(t.sCount[c]-t.blkIndent>3||t.sCount[c]<0)){for(o=!1,r=0,i=l.length;r<i;r++)if(l[r](t,c,u,!0)){o=!0;break}if(o)break}return n=t.getLines(e,c,t.blkIndent,!1).trim(),t.line=c,(s=t.push("paragraph_open","p",1)).map=[e,t.line],(s=t.push("inline","",0)).content=n,s.map=[e,t.line],s.children=[],s=t.push("paragraph_close","p",-1),t.parentType=a,!0}},function(t,e,n){"use strict";var o=n(16),r=n(3).isSpace;function i(t,e,n,o){var i,s,a,c,l,u,d,h;for(this.src=t,this.md=e,this.env=n,this.tokens=o,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.parentType="root",this.level=0,this.result="",h=!1,a=c=u=d=0,l=(s=this.src).length;c<l;c++){if(i=s.charCodeAt(c),!h){if(r(i)){u++,9===i?d+=4-d%4:d++;continue}h=!0}10!==i&&c!==l-1||(10!==i&&c++,this.bMarks.push(a),this.eMarks.push(c),this.tShift.push(u),this.sCount.push(d),this.bsCount.push(0),h=!1,u=0,d=0,a=c+1)}this.bMarks.push(s.length),this.eMarks.push(s.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}i.prototype.push=function(t,e,n){var r=new o(t,e,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r},i.prototype.isEmpty=function(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]},i.prototype.skipEmptyLines=function(t){for(var e=this.lineMax;t<e&&!(this.bMarks[t]+this.tShift[t]<this.eMarks[t]);t++);return t},i.prototype.skipSpaces=function(t){for(var e,n=this.src.length;t<n&&(e=this.src.charCodeAt(t),r(e));t++);return t},i.prototype.skipSpacesBack=function(t,e){if(t<=e)return t;for(;t>e;)if(!r(this.src.charCodeAt(--t)))return t+1;return t},i.prototype.skipChars=function(t,e){for(var n=this.src.length;t<n&&this.src.charCodeAt(t)===e;t++);return t},i.prototype.skipCharsBack=function(t,e,n){if(t<=n)return t;for(;t>n;)if(e!==this.src.charCodeAt(--t))return t+1;return t},i.prototype.getLines=function(t,e,n,o){var i,s,a,c,l,u,d,h=t;if(t>=e)return"";for(u=new Array(e-t),i=0;h<e;h++,i++){for(s=0,d=c=this.bMarks[h],l=h+1<e||o?this.eMarks[h]+1:this.eMarks[h];c<l&&s<n;){if(a=this.src.charCodeAt(c),r(a))9===a?s+=4-(s+this.bsCount[h])%4:s++;else{if(!(c-d<this.tShift[h]))break;s++}c++}u[i]=s>n?new Array(s-n+1).join(" ")+this.src.slice(c,l):this.src.slice(c,l)}return u.join("")},i.prototype.Token=o,t.exports=i},function(t,e,n){"use strict";var o=n(15),r=[["text",n(168)],["newline",n(169)],["escape",n(170)],["backticks",n(171)],["strikethrough",n(30).tokenize],["emphasis",n(31).tokenize],["link",n(172)],["image",n(173)],["autolink",n(174)],["html_inline",n(175)],["entity",n(176)]],i=[["balance_pairs",n(177)],["strikethrough",n(30).postProcess],["emphasis",n(31).postProcess],["text_collapse",n(178)]];function s(){var t;for(this.ruler=new o,t=0;t<r.length;t++)this.ruler.push(r[t][0],r[t][1]);for(this.ruler2=new o,t=0;t<i.length;t++)this.ruler2.push(i[t][0],i[t][1])}s.prototype.skipToken=function(t){var e,n,o=t.pos,r=this.ruler.getRules(""),i=r.length,s=t.md.options.maxNesting,a=t.cache;if(void 0===a[o]){if(t.level<s)for(n=0;n<i&&(t.level++,e=r[n](t,!0),t.level--,!e);n++);else t.pos=t.posMax;e||t.pos++,a[o]=t.pos}else t.pos=a[o]},s.prototype.tokenize=function(t){for(var e,n,o=this.ruler.getRules(""),r=o.length,i=t.posMax,s=t.md.options.maxNesting;t.pos<i;){if(t.level<s)for(n=0;n<r&&!(e=o[n](t,!1));n++);if(e){if(t.pos>=i)break}else t.pending+=t.src[t.pos++]}t.pending&&t.pushPending()},s.prototype.parse=function(t,e,n,o){var r,i,s,a=new this.State(t,e,n,o);for(this.tokenize(a),s=(i=this.ruler2.getRules("")).length,r=0;r<s;r++)i[r](a)},s.prototype.State=n(179),t.exports=s},function(t,e,n){"use strict";function o(t){switch(t){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}t.exports=function(t,e){for(var n=t.pos;n<t.posMax&&!o(t.src.charCodeAt(n));)n++;return n!==t.pos&&(e||(t.pending+=t.src.slice(t.pos,n)),t.pos=n,!0)}},function(t,e,n){"use strict";var o=n(3).isSpace;t.exports=function(t,e){var n,r,i=t.pos;if(10!==t.src.charCodeAt(i))return!1;for(n=t.pending.length-1,r=t.posMax,e||(n>=0&&32===t.pending.charCodeAt(n)?n>=1&&32===t.pending.charCodeAt(n-1)?(t.pending=t.pending.replace(/ +$/,""),t.push("hardbreak","br",0)):(t.pending=t.pending.slice(0,-1),t.push("softbreak","br",0)):t.push("softbreak","br",0)),i++;i<r&&o(t.src.charCodeAt(i));)i++;return t.pos=i,!0}},function(t,e,n){"use strict";for(var o=n(3).isSpace,r=[],i=0;i<256;i++)r.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(t){r[t.charCodeAt(0)]=1}),t.exports=function(t,e){var n,i=t.pos,s=t.posMax;if(92!==t.src.charCodeAt(i))return!1;if(++i<s){if((n=t.src.charCodeAt(i))<256&&0!==r[n])return e||(t.pending+=t.src[i]),t.pos+=2,!0;if(10===n){for(e||t.push("hardbreak","br",0),i++;i<s&&(n=t.src.charCodeAt(i),o(n));)i++;return t.pos=i,!0}}return e||(t.pending+="\\"),t.pos++,!0}},function(t,e,n){"use strict";t.exports=function(t,e){var n,o,r,i,s,a,c=t.pos;if(96!==t.src.charCodeAt(c))return!1;for(n=c,c++,o=t.posMax;c<o&&96===t.src.charCodeAt(c);)c++;for(r=t.src.slice(n,c),i=s=c;-1!==(i=t.src.indexOf("`",s));){for(s=i+1;s<o&&96===t.src.charCodeAt(s);)s++;if(s-i===r.length)return e||((a=t.push("code_inline","code",0)).markup=r,a.content=t.src.slice(c,i).replace(/[ \n]+/g," ").trim()),t.pos=s,!0}return e||(t.pending+=r),t.pos+=r.length,!0}},function(t,e,n){"use strict";var o=n(3).normalizeReference,r=n(3).isSpace;t.exports=function(t,e){var n,i,s,a,c,l,u,d,h,f="",p=t.pos,m=t.posMax,g=t.pos,b=!0;if(91!==t.src.charCodeAt(t.pos))return!1;if(c=t.pos+1,(a=t.md.helpers.parseLinkLabel(t,t.pos,!0))<0)return!1;if((l=a+1)<m&&40===t.src.charCodeAt(l)){for(b=!1,l++;l<m&&(i=t.src.charCodeAt(l),r(i)||10===i);l++);if(l>=m)return!1;for(g=l,(u=t.md.helpers.parseLinkDestination(t.src,l,t.posMax)).ok&&(f=t.md.normalizeLink(u.str),t.md.validateLink(f)?l=u.pos:f=""),g=l;l<m&&(i=t.src.charCodeAt(l),r(i)||10===i);l++);if(u=t.md.helpers.parseLinkTitle(t.src,l,t.posMax),l<m&&g!==l&&u.ok)for(h=u.str,l=u.pos;l<m&&(i=t.src.charCodeAt(l),r(i)||10===i);l++);else h="";(l>=m||41!==t.src.charCodeAt(l))&&(b=!0),l++}if(b){if(void 0===t.env.references)return!1;if(l<m&&91===t.src.charCodeAt(l)?(g=l+1,(l=t.md.helpers.parseLinkLabel(t,l))>=0?s=t.src.slice(g,l++):l=a+1):l=a+1,s||(s=t.src.slice(c,a)),!(d=t.env.references[o(s)]))return t.pos=p,!1;f=d.href,h=d.title}return e||(t.pos=c,t.posMax=a,t.push("link_open","a",1).attrs=n=[["href",f]],h&&n.push(["title",h]),t.md.inline.tokenize(t),t.push("link_close","a",-1)),t.pos=l,t.posMax=m,!0}},function(t,e,n){"use strict";var o=n(3).normalizeReference,r=n(3).isSpace;t.exports=function(t,e){var n,i,s,a,c,l,u,d,h,f,p,m,g,b="",w=t.pos,_=t.posMax;if(33!==t.src.charCodeAt(t.pos))return!1;if(91!==t.src.charCodeAt(t.pos+1))return!1;if(l=t.pos+2,(c=t.md.helpers.parseLinkLabel(t,t.pos+1,!1))<0)return!1;if((u=c+1)<_&&40===t.src.charCodeAt(u)){for(u++;u<_&&(i=t.src.charCodeAt(u),r(i)||10===i);u++);if(u>=_)return!1;for(g=u,(h=t.md.helpers.parseLinkDestination(t.src,u,t.posMax)).ok&&(b=t.md.normalizeLink(h.str),t.md.validateLink(b)?u=h.pos:b=""),g=u;u<_&&(i=t.src.charCodeAt(u),r(i)||10===i);u++);if(h=t.md.helpers.parseLinkTitle(t.src,u,t.posMax),u<_&&g!==u&&h.ok)for(f=h.str,u=h.pos;u<_&&(i=t.src.charCodeAt(u),r(i)||10===i);u++);else f="";if(u>=_||41!==t.src.charCodeAt(u))return t.pos=w,!1;u++}else{if(void 0===t.env.references)return!1;if(u<_&&91===t.src.charCodeAt(u)?(g=u+1,(u=t.md.helpers.parseLinkLabel(t,u))>=0?a=t.src.slice(g,u++):u=c+1):u=c+1,a||(a=t.src.slice(l,c)),!(d=t.env.references[o(a)]))return t.pos=w,!1;b=d.href,f=d.title}return e||(s=t.src.slice(l,c),t.md.inline.parse(s,t.md,t.env,m=[]),(p=t.push("image","img",0)).attrs=n=[["src",b],["alt",""]],p.children=m,p.content=s,f&&n.push(["title",f])),t.pos=u,t.posMax=_,!0}},function(t,e,n){"use strict";var o=/^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/,r=/^<([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)>/;t.exports=function(t,e){var n,i,s,a,c,l,u=t.pos;return 60===t.src.charCodeAt(u)&&(!((n=t.src.slice(u)).indexOf(">")<0)&&(r.test(n)?(a=(i=n.match(r))[0].slice(1,-1),c=t.md.normalizeLink(a),!!t.md.validateLink(c)&&(e||((l=t.push("link_open","a",1)).attrs=[["href",c]],l.markup="autolink",l.info="auto",(l=t.push("text","",0)).content=t.md.normalizeLinkText(a),(l=t.push("link_close","a",-1)).markup="autolink",l.info="auto"),t.pos+=i[0].length,!0)):!!o.test(n)&&(a=(s=n.match(o))[0].slice(1,-1),c=t.md.normalizeLink("mailto:"+a),!!t.md.validateLink(c)&&(e||((l=t.push("link_open","a",1)).attrs=[["href",c]],l.markup="autolink",l.info="auto",(l=t.push("text","",0)).content=t.md.normalizeLinkText(a),(l=t.push("link_close","a",-1)).markup="autolink",l.info="auto"),t.pos+=s[0].length,!0))))}},function(t,e,n){"use strict";var o=n(29).HTML_TAG_RE;t.exports=function(t,e){var n,r,i,s=t.pos;return!!t.md.options.html&&(i=t.posMax,!(60!==t.src.charCodeAt(s)||s+2>=i)&&(!(33!==(n=t.src.charCodeAt(s+1))&&63!==n&&47!==n&&!function(t){var e=32|t;return e>=97&&e<=122}(n))&&(!!(r=t.src.slice(s).match(o))&&(e||(t.push("html_inline","",0).content=t.src.slice(s,s+r[0].length)),t.pos+=r[0].length,!0))))}},function(t,e,n){"use strict";var o=n(24),r=n(3).has,i=n(3).isValidEntityCode,s=n(3).fromCodePoint,a=/^&#((?:x[a-f0-9]{1,8}|[0-9]{1,8}));/i,c=/^&([a-z][a-z0-9]{1,31});/i;t.exports=function(t,e){var n,l,u=t.pos,d=t.posMax;if(38!==t.src.charCodeAt(u))return!1;if(u+1<d)if(35===t.src.charCodeAt(u+1)){if(l=t.src.slice(u).match(a))return e||(n="x"===l[1][0].toLowerCase()?parseInt(l[1].slice(1),16):parseInt(l[1],10),t.pending+=i(n)?s(n):s(65533)),t.pos+=l[0].length,!0}else if((l=t.src.slice(u).match(c))&&r(o,l[1]))return e||(t.pending+=o[l[1]]),t.pos+=l[0].length,!0;return e||(t.pending+="&"),t.pos++,!0}},function(t,e,n){"use strict";t.exports=function(t){var e,n,o,r,i=t.delimiters,s=t.delimiters.length;for(e=0;e<s;e++)if((o=i[e]).close)for(n=e-o.jump-1;n>=0;){if((r=i[n]).open&&r.marker===o.marker&&r.end<0&&r.level===o.level)if(!((r.close||o.open)&&void 0!==r.length&&void 0!==o.length&&(r.length+o.length)%3==0)){o.jump=e-n,o.open=!1,r.end=e,r.jump=0;break}n-=r.jump+1}}},function(t,e,n){"use strict";t.exports=function(t){var e,n,o=0,r=t.tokens,i=t.tokens.length;for(e=n=0;e<i;e++)o+=r[e].nesting,r[e].level=o,"text"===r[e].type&&e+1<i&&"text"===r[e+1].type?r[e+1].content=r[e].content+r[e+1].content:(e!==n&&(r[n]=r[e]),n++);e!==n&&(r.length=n)}},function(t,e,n){"use strict";var o=n(16),r=n(3).isWhiteSpace,i=n(3).isPunctChar,s=n(3).isMdAsciiPunct;function a(t,e,n,o){this.src=t,this.env=n,this.md=e,this.tokens=o,this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[]}a.prototype.pushPending=function(){var t=new o("text","",0);return t.content=this.pending,t.level=this.pendingLevel,this.tokens.push(t),this.pending="",t},a.prototype.push=function(t,e,n){this.pending&&this.pushPending();var r=new o(t,e,n);return n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.pendingLevel=this.level,this.tokens.push(r),r},a.prototype.scanDelims=function(t,e){var n,o,a,c,l,u,d,h,f,p=t,m=!0,g=!0,b=this.posMax,w=this.src.charCodeAt(t);for(n=t>0?this.src.charCodeAt(t-1):32;p<b&&this.src.charCodeAt(p)===w;)p++;return a=p-t,o=p<b?this.src.charCodeAt(p):32,d=s(n)||i(String.fromCharCode(n)),f=s(o)||i(String.fromCharCode(o)),u=r(n),(h=r(o))?m=!1:f&&(u||d||(m=!1)),u?g=!1:d&&(h||f||(g=!1)),e?(c=m,l=g):(c=m&&(!g||d),l=g&&(!m||f)),{can_open:c,can_close:l,length:a}},a.prototype.Token=o,t.exports=a},function(t,e,n){"use strict";function o(t){return Array.prototype.slice.call(arguments,1).forEach(function(e){e&&Object.keys(e).forEach(function(n){t[n]=e[n]})}),t}function r(t){return Object.prototype.toString.call(t)}function i(t){return"[object Function]"===r(t)}function s(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var a={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};var c={"http:":{validate:function(t,e,n){var o=t.slice(e);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(o)?o.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(t,e,n){var o=t.slice(e);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(o)?e>=3&&":"===t[e-3]?0:e>=3&&"/"===t[e-3]?0:o.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(t,e,n){var o=t.slice(e);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(o)?o.match(n.re.mailto)[0].length:0}}},l="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",u="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function d(t){var e=t.re=n(181)(t.__opts__),o=t.__tlds__.slice();function a(t){return t.replace("%TLDS%",e.src_tlds)}t.onCompile(),t.__tlds_replaced__||o.push(l),o.push(e.src_xn),e.src_tlds=o.join("|"),e.email_fuzzy=RegExp(a(e.tpl_email_fuzzy),"i"),e.link_fuzzy=RegExp(a(e.tpl_link_fuzzy),"i"),e.link_no_ip_fuzzy=RegExp(a(e.tpl_link_no_ip_fuzzy),"i"),e.host_fuzzy_test=RegExp(a(e.tpl_host_fuzzy_test),"i");var c=[];function u(t,e){throw new Error('(LinkifyIt) Invalid schema "'+t+'": '+e)}t.__compiled__={},Object.keys(t.__schemas__).forEach(function(e){var n=t.__schemas__[e];if(null!==n){var o={validate:null,link:null};if(t.__compiled__[e]=o,function(t){return"[object Object]"===r(t)}(n))return!function(t){return"[object RegExp]"===r(t)}(n.validate)?i(n.validate)?o.validate=n.validate:u(e,n):o.validate=function(t){return function(e,n){var o=e.slice(n);return t.test(o)?o.match(t)[0].length:0}}(n.validate),void(i(n.normalize)?o.normalize=n.normalize:n.normalize?u(e,n):o.normalize=function(t,e){e.normalize(t)});!function(t){return"[object String]"===r(t)}(n)?u(e,n):c.push(e)}}),c.forEach(function(e){t.__compiled__[t.__schemas__[e]]&&(t.__compiled__[e].validate=t.__compiled__[t.__schemas__[e]].validate,t.__compiled__[e].normalize=t.__compiled__[t.__schemas__[e]].normalize)}),t.__compiled__[""]={validate:null,normalize:function(t,e){e.normalize(t)}};var d=Object.keys(t.__compiled__).filter(function(e){return e.length>0&&t.__compiled__[e]}).map(s).join("|");t.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+d+")","i"),t.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+d+")","ig"),t.re.pretest=RegExp("("+t.re.schema_test.source+")|("+t.re.host_fuzzy_test.source+")|@","i"),function(t){t.__index__=-1,t.__text_cache__=""}(t)}function h(t,e){var n=new function(t,e){var n=t.__index__,o=t.__last_index__,r=t.__text_cache__.slice(n,o);this.schema=t.__schema__.toLowerCase(),this.index=n+e,this.lastIndex=o+e,this.raw=r,this.text=r,this.url=r}(t,e);return t.__compiled__[n.schema].normalize(n,t),n}function f(t,e){if(!(this instanceof f))return new f(t,e);e||function(t){return Object.keys(t||{}).reduce(function(t,e){return t||a.hasOwnProperty(e)},!1)}(t)&&(e=t,t={}),this.__opts__=o({},a,e),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=o({},c,t),this.__compiled__={},this.__tlds__=u,this.__tlds_replaced__=!1,this.re={},d(this)}f.prototype.add=function(t,e){return this.__schemas__[t]=e,d(this),this},f.prototype.set=function(t){return this.__opts__=o(this.__opts__,t),this},f.prototype.test=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return!1;var e,n,o,r,i,s,a,c;if(this.re.schema_test.test(t))for((a=this.re.schema_search).lastIndex=0;null!==(e=a.exec(t));)if(r=this.testSchemaAt(t,e[2],a.lastIndex)){this.__schema__=e[2],this.__index__=e.index+e[1].length,this.__last_index__=e.index+e[0].length+r;break}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(c=t.search(this.re.host_fuzzy_test))>=0&&(this.__index__<0||c<this.__index__)&&null!==(n=t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))&&(i=n.index+n[1].length,(this.__index__<0||i<this.__index__)&&(this.__schema__="",this.__index__=i,this.__last_index__=n.index+n[0].length)),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&t.indexOf("@")>=0&&null!==(o=t.match(this.re.email_fuzzy))&&(i=o.index+o[1].length,s=o.index+o[0].length,(this.__index__<0||i<this.__index__||i===this.__index__&&s>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=i,this.__last_index__=s)),this.__index__>=0},f.prototype.pretest=function(t){return this.re.pretest.test(t)},f.prototype.testSchemaAt=function(t,e,n){return this.__compiled__[e.toLowerCase()]?this.__compiled__[e.toLowerCase()].validate(t,n,this):0},f.prototype.match=function(t){var e=0,n=[];this.__index__>=0&&this.__text_cache__===t&&(n.push(h(this,e)),e=this.__last_index__);for(var o=e?t.slice(e):t;this.test(o);)n.push(h(this,e)),o=o.slice(this.__last_index__),e+=this.__last_index__;return n.length?n:null},f.prototype.tlds=function(t,e){return t=Array.isArray(t)?t:[t],e?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(t,e,n){return t!==n[e-1]}).reverse(),d(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,d(this),this)},f.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),"mailto:"!==t.schema||/^mailto:/i.test(t.url)||(t.url="mailto:"+t.url)},f.prototype.onCompile=function(){},t.exports=f},function(t,e,n){"use strict";t.exports=function(t){var e={};e.src_Any=n(26).source,e.src_Cc=n(27).source,e.src_Z=n(28).source,e.src_P=n(14).source,e.src_ZPCc=[e.src_Z,e.src_P,e.src_Cc].join("|"),e.src_ZCc=[e.src_Z,e.src_Cc].join("|");return e.src_pseudo_letter="(?:(?![><|]|"+e.src_ZPCc+")"+e.src_Any+")",e.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",e.src_auth="(?:(?:(?!"+e.src_ZCc+"|[@/\\[\\]()]).)+@)?",e.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",e.src_host_terminator="(?=$|[><|]|"+e.src_ZPCc+")(?!-|_|:\\d|\\.-|\\.(?!$|"+e.src_ZPCc+"))",e.src_path="(?:[/?#](?:(?!"+e.src_ZCc+"|[><|]|[()[\\]{}.,\"'?!\\-]).|\\[(?:(?!"+e.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+e.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+e.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+e.src_ZCc+'|["]).)+\\"|\\\'(?:(?!'+e.src_ZCc+"|[']).)+\\'|\\'(?="+e.src_pseudo_letter+"|[-]).|\\.{2,3}[a-zA-Z0-9%/]|\\.(?!"+e.src_ZCc+"|[.]).|"+(t&&t["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+"\\,(?!"+e.src_ZCc+").|\\!(?!"+e.src_ZCc+"|[!]).|\\?(?!"+e.src_ZCc+"|[?]).)+|\\/)?",e.src_email_name='[\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]+',e.src_xn="xn--[a-z0-9\\-]{1,59}",e.src_domain_root="(?:"+e.src_xn+"|"+e.src_pseudo_letter+"{1,63})",e.src_domain="(?:"+e.src_xn+"|(?:"+e.src_pseudo_letter+")|(?:"+e.src_pseudo_letter+"(?:-(?!-)|"+e.src_pseudo_letter+"){0,61}"+e.src_pseudo_letter+"))",e.src_host="(?:(?:(?:(?:"+e.src_domain+")\\.)*"+e.src_domain+"))",e.tpl_host_fuzzy="(?:"+e.src_ip4+"|(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%)))",e.tpl_host_no_ip_fuzzy="(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%))",e.src_host_strict=e.src_host+e.src_host_terminator,e.tpl_host_fuzzy_strict=e.tpl_host_fuzzy+e.src_host_terminator,e.src_host_port_strict=e.src_host+e.src_port+e.src_host_terminator,e.tpl_host_port_fuzzy_strict=e.tpl_host_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_port_no_ip_fuzzy_strict=e.tpl_host_no_ip_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+e.src_ZPCc+"|>|$))",e.tpl_email_fuzzy="(^|[><|]|\\(|"+e.src_ZCc+")("+e.src_email_name+"@"+e.tpl_host_fuzzy_strict+")",e.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_fuzzy_strict+e.src_path+")",e.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_no_ip_fuzzy_strict+e.src_path+")",e}},function(t,e,n){(function(t,o){var r;/*! https://mths.be/punycode v1.4.1 by @mathias */!function(i){"object"==typeof e&&e&&e.nodeType,"object"==typeof t&&t&&t.nodeType;var s="object"==typeof o&&o;s.global!==s&&s.window!==s&&s.self;var a,c=2147483647,l=36,u=1,d=26,h=38,f=700,p=72,m=128,g="-",b=/^xn--/,w=/[^\x20-\x7E]/,_=/[\x2E\u3002\uFF0E\uFF61]/g,k={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},v=l-u,y=Math.floor,x=String.fromCharCode;function C(t){throw new RangeError(k[t])}function A(t,e){for(var n=t.length,o=[];n--;)o[n]=e(t[n]);return o}function P(t,e){var n=t.split("@"),o="";return n.length>1&&(o=n[0]+"@",t=n[1]),o+A((t=t.replace(_,".")).split("."),e).join(".")}function T(t){for(var e,n,o=[],r=0,i=t.length;r<i;)(e=t.charCodeAt(r++))>=55296&&e<=56319&&r<i?56320==(64512&(n=t.charCodeAt(r++)))?o.push(((1023&e)<<10)+(1023&n)+65536):(o.push(e),r--):o.push(e);return o}function E(t){return A(t,function(t){var e="";return t>65535&&(e+=x((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=x(t)}).join("")}function S(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:l}function O(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function R(t,e,n){var o=0;for(t=n?y(t/f):t>>1,t+=y(t/e);t>v*d>>1;o+=l)t=y(t/v);return y(o+(v+1)*t/(t+h))}function I(t){var e,n,o,r,i,s,a,h,f,b,w=[],_=t.length,k=0,v=m,x=p;for((n=t.lastIndexOf(g))<0&&(n=0),o=0;o<n;++o)t.charCodeAt(o)>=128&&C("not-basic"),w.push(t.charCodeAt(o));for(r=n>0?n+1:0;r<_;){for(i=k,s=1,a=l;r>=_&&C("invalid-input"),((h=S(t.charCodeAt(r++)))>=l||h>y((c-k)/s))&&C("overflow"),k+=h*s,!(h<(f=a<=x?u:a>=x+d?d:a-x));a+=l)s>y(c/(b=l-f))&&C("overflow"),s*=b;x=R(k-i,e=w.length+1,0==i),y(k/e)>c-v&&C("overflow"),v+=y(k/e),k%=e,w.splice(k++,0,v)}return E(w)}function F(t){var e,n,o,r,i,s,a,h,f,b,w,_,k,v,A,P=[];for(_=(t=T(t)).length,e=m,n=0,i=p,s=0;s<_;++s)(w=t[s])<128&&P.push(x(w));for(o=r=P.length,r&&P.push(g);o<_;){for(a=c,s=0;s<_;++s)(w=t[s])>=e&&w<a&&(a=w);for(a-e>y((c-n)/(k=o+1))&&C("overflow"),n+=(a-e)*k,e=a,s=0;s<_;++s)if((w=t[s])<e&&++n>c&&C("overflow"),w==e){for(h=n,f=l;!(h<(b=f<=i?u:f>=i+d?d:f-i));f+=l)A=h-b,v=l-b,P.push(x(O(b+A%v,0))),h=y(A/v);P.push(x(O(h,0))),i=R(n,k,o==r),n=0,++o}++n,++e}return P.join("")}a={version:"1.4.1",ucs2:{decode:T,encode:E},decode:I,encode:F,toASCII:function(t){return P(t,function(t){return w.test(t)?"xn--"+F(t):t})},toUnicode:function(t){return P(t,function(t){return b.test(t)?I(t.slice(4).toLowerCase()):t})}},void 0===(r=function(){return a}.call(e,n,e,t))||(t.exports=r)}()}).call(this,n(183)(t),n(12))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){"use strict";t.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}}},function(t,e,n){"use strict";t.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","text_collapse"]}}}},function(t,e,n){"use strict";t.exports={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","text_collapse"]}}}},function(t,e,n){"use strict";n.r(e);var o=n(5),r=o.a.Symbol,i=Object.prototype,s=i.hasOwnProperty,a=i.toString,c=r?r.toStringTag:void 0;var l=function(t){var e=s.call(t,c),n=t[c];try{t[c]=void 0;var o=!0}catch(t){}var r=a.call(t);return o&&(e?t[c]=n:delete t[c]),r},u=Object.prototype.toString;var d=function(t){return u.call(t)},h="[object Null]",f="[object Undefined]",p=r?r.toStringTag:void 0;var m=function(t){return null==t?void 0===t?f:h:p&&p in Object(t)?l(t):d(t)};var g=function(t,e){return function(n){return t(e(n))}},b=g(Object.getPrototypeOf,Object);var w=function(t){return null!=t&&"object"==typeof t},k="[object Object]",v=Function.prototype,y=Object.prototype,x=v.toString,C=y.hasOwnProperty,A=x.call(Object);var P=function(t){if(!w(t)||m(t)!=k)return!1;var e=b(t);if(null===e)return!0;var n=C.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&x.call(n)==A};class T{constructor(t,e){this._config={},e&&this.define(e),t&&this._setObjectToTarget(this._config,t)}set(t,e){this._setToTarget(this._config,t,e)}define(t,e){this._setToTarget(this._config,t,e,!0)}get(t){return this._getFromSource(this._config,t)}_setToTarget(t,e,n,o=!1){if(P(e))return void this._setObjectToTarget(t,e,o);const r=e.split(".");e=r.pop();for(const e of r)P(t[e])||(t[e]={}),t=t[e];if(P(n))return P(t[e])||(t[e]={}),t=t[e],void this._setObjectToTarget(t,n,o);o&&void 0!==t[e]||(t[e]=n)}_getFromSource(t,e){const n=e.split(".");e=n.pop();for(const e of n){if(!P(t[e])){t=null;break}t=t[e]}return t?t[e]:void 0}_setObjectToTarget(t,e,n){Object.keys(e).forEach(o=>{this._setToTarget(t,o,e[o],n)})}}var E=n(0);var S=function(){return function t(){t.called=!0}};class O{constructor(t,e){this.source=t,this.name=e,this.path=[],this.stop=S(),this.off=S()}}function R(){let t="e";for(let e=0;e<8;e++)t+=Math.floor(65536*(1+Math.random())).toString(16).substring(1);return t}var I={get(t){return"number"!=typeof t?this[t]||this.normal:t},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5};const F=Symbol("listeningTo"),D=Symbol("emitterId");var N={on(t,e,n={}){this.listenTo(this,t,e,n)},once(t,e,n){this.listenTo(this,t,function(t,...n){t.off(),e.call(this,t,...n)},n)},off(t,e){this.stopListening(this,t,e)},listenTo(t,e,n,o={}){let r,i;this[F]||(this[F]={});const s=this[F];V(t)||M(t);const a=V(t);(r=s[a])||(r=s[a]={emitter:t,callbacks:{}}),(i=r.callbacks[e])||(i=r.callbacks[e]=[]),i.push(n),function(t,e){const n=B(t);if(n[e])return;let o=e,r=null;const i=[];for(;""!==o&&!n[o];)n[o]={callbacks:[],childEvents:[]},i.push(n[o]),r&&n[o].childEvents.push(r),r=o,o=o.substr(0,o.lastIndexOf(":"));if(""!==o){for(const t of i)t.callbacks=n[o].callbacks.slice();n[o].childEvents.push(r)}}(t,e);const c=L(t,e),l=I.get(o.priority),u={callback:n,priority:l};for(const t of c){let e=!1;for(let n=0;n<t.length;n++)if(t[n].priority<l){t.splice(n,0,u),e=!0;break}e||t.push(u)}},stopListening(t,e,n){const o=this[F];let r=t&&V(t);const i=o&&r&&o[r],s=i&&e&&i.callbacks[e];if(!(!o||t&&!i||e&&!s))if(n)q(t,e,n);else if(s){for(;n=s.pop();)q(t,e,n);delete i.callbacks[e]}else if(i){for(e in i.callbacks)this.stopListening(t,e);delete o[r]}else{for(r in o)this.stopListening(o[r].emitter);delete this[F]}},fire(t,...e){const n=t instanceof O?t:new O(this,t),o=n.name;let r=function t(e,n){let o;if(!e._events||!(o=e._events[n])||!o.callbacks.length)return n.indexOf(":")>-1?t(e,n.substr(0,n.lastIndexOf(":"))):null;return o.callbacks}(this,o);if(n.path.push(this),r){const t=[n,...e];r=Array.from(r);for(let e=0;e<r.length&&(r[e].callback.apply(this,t),n.off.called&&(delete n.off.called,q(this,o,r[e].callback)),!n.stop.called);e++);}if(this._delegations){const t=this._delegations.get(o),r=this._delegations.get("*");t&&z(t,n,e),r&&z(r,n,e)}return n.return},delegate(...t){return{to:(e,n)=>{this._delegations||(this._delegations=new Map);for(const o of t){const t=this._delegations.get(o);t?t.set(e,n):this._delegations.set(o,new Map([[e,n]]))}}}},stopDelegating(t,e){if(this._delegations)if(t)if(e){const n=this._delegations.get(t);n&&n.delete(e)}else this._delegations.delete(t);else this._delegations.clear()}};function M(t,e){t[D]||(t[D]=e||R())}function V(t){return t[D]}function B(t){return t._events||Object.defineProperty(t,"_events",{value:{}}),t._events}function L(t,e){const n=B(t)[e];if(!n)return[];let o=[n.callbacks];for(let e=0;e<n.childEvents.length;e++){const r=L(t,n.childEvents[e]);o=o.concat(r)}return o}function z(t,e,n){for(let[o,r]of t){r?"function"==typeof r&&(r=r(e.name)):r=e.name;const t=new O(e.source,r);t.path=[...e.path],o.fire(t,...n)}}function q(t,e,n){const o=L(t,e);for(const t of o)for(let e=0;e<t.length;e++)t[e].callback==n&&(t.splice(e,1),e--)}function j(t,...e){e.forEach(e=>{Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e)).forEach(n=>{if(n in t.prototype)return;const o=Object.getOwnPropertyDescriptor(e,n);o.enumerable=!1,Object.defineProperty(t.prototype,n,o)})})}function H(t,e){const n=Math.min(t.length,e.length);for(let o=0;o<n;o++)if(t[o]!=e[o])return o;return t.length==e.length?"same":t.length<e.length?"prefix":"extension"}var U=function(){this.__data__=[],this.size=0};var $=function(t,e){return t===e||t!=t&&e!=e};var W=function(t,e){for(var n=t.length;n--;)if($(t[n][0],e))return n;return-1},G=Array.prototype.splice;var K=function(t){var e=this.__data__,n=W(e,t);return!(n<0||(n==e.length-1?e.pop():G.call(e,n,1),--this.size,0))};var J=function(t){var e=this.__data__,n=W(e,t);return n<0?void 0:e[n][1]};var Z=function(t){return W(this.__data__,t)>-1};var Q=function(t,e){var n=this.__data__,o=W(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this};function Y(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}Y.prototype.clear=U,Y.prototype.delete=K,Y.prototype.get=J,Y.prototype.has=Z,Y.prototype.set=Q;var X=Y;var tt=function(){this.__data__=new X,this.size=0};var et=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n};var nt=function(t){return this.__data__.get(t)};var ot=function(t){return this.__data__.has(t)};var rt=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},it="[object AsyncFunction]",st="[object Function]",at="[object GeneratorFunction]",ct="[object Proxy]";var lt=function(t){if(!rt(t))return!1;var e=m(t);return e==st||e==at||e==it||e==ct},ut=o.a["__core-js_shared__"],dt=function(){var t=/[^.]+$/.exec(ut&&ut.keys&&ut.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();var ht=function(t){return!!dt&&dt in t},ft=Function.prototype.toString;var pt=function(t){if(null!=t){try{return ft.call(t)}catch(t){}try{return t+""}catch(t){}}return""},mt=/^\[object .+?Constructor\]$/,gt=Function.prototype,bt=Object.prototype,wt=gt.toString,_t=bt.hasOwnProperty,kt=RegExp("^"+wt.call(_t).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var vt=function(t){return!(!rt(t)||ht(t))&&(lt(t)?kt:mt).test(pt(t))};var yt=function(t,e){return null==t?void 0:t[e]};var xt=function(t,e){var n=yt(t,e);return vt(n)?n:void 0},Ct=xt(o.a,"Map"),At=xt(Object,"create");var Pt=function(){this.__data__=At?At(null):{},this.size=0};var Tt=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Et="__lodash_hash_undefined__",St=Object.prototype.hasOwnProperty;var Ot=function(t){var e=this.__data__;if(At){var n=e[t];return n===Et?void 0:n}return St.call(e,t)?e[t]:void 0},Rt=Object.prototype.hasOwnProperty;var It=function(t){var e=this.__data__;return At?void 0!==e[t]:Rt.call(e,t)},Ft="__lodash_hash_undefined__";var Dt=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=At&&void 0===e?Ft:e,this};function Nt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}Nt.prototype.clear=Pt,Nt.prototype.delete=Tt,Nt.prototype.get=Ot,Nt.prototype.has=It,Nt.prototype.set=Dt;var Mt=Nt;var Vt=function(){this.size=0,this.__data__={hash:new Mt,map:new(Ct||X),string:new Mt}};var Bt=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var Lt=function(t,e){var n=t.__data__;return Bt(e)?n["string"==typeof e?"string":"hash"]:n.map};var zt=function(t){var e=Lt(this,t).delete(t);return this.size-=e?1:0,e};var qt=function(t){return Lt(this,t).get(t)};var jt=function(t){return Lt(this,t).has(t)};var Ht=function(t,e){var n=Lt(this,t),o=n.size;return n.set(t,e),this.size+=n.size==o?0:1,this};function Ut(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}Ut.prototype.clear=Vt,Ut.prototype.delete=zt,Ut.prototype.get=qt,Ut.prototype.has=jt,Ut.prototype.set=Ht;var $t=Ut,Wt=200;var Gt=function(t,e){var n=this.__data__;if(n instanceof X){var o=n.__data__;if(!Ct||o.length<Wt-1)return o.push([t,e]),this.size=++n.size,this;n=this.__data__=new $t(o)}return n.set(t,e),this.size=n.size,this};function Kt(t){var e=this.__data__=new X(t);this.size=e.size}Kt.prototype.clear=tt,Kt.prototype.delete=et,Kt.prototype.get=nt,Kt.prototype.has=ot,Kt.prototype.set=Gt;var Jt=Kt;var Zt=function(t,e){for(var n=-1,o=null==t?0:t.length;++n<o&&!1!==e(t[n],n,t););return t},Qt=function(){try{var t=xt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();var Yt=function(t,e,n){"__proto__"==e&&Qt?Qt(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n},Xt=Object.prototype.hasOwnProperty;var te=function(t,e,n){var o=t[e];Xt.call(t,e)&&$(o,n)&&(void 0!==n||e in t)||Yt(t,e,n)};var ee=function(t,e,n,o){var r=!n;n||(n={});for(var i=-1,s=e.length;++i<s;){var a=e[i],c=o?o(n[a],t[a],a,n,t):void 0;void 0===c&&(c=t[a]),r?Yt(n,a,c):te(n,a,c)}return n};var ne=function(t,e){for(var n=-1,o=Array(t);++n<t;)o[n]=e(n);return o},oe="[object Arguments]";var re=function(t){return w(t)&&m(t)==oe},ie=Object.prototype,se=ie.hasOwnProperty,ae=ie.propertyIsEnumerable,ce=re(function(){return arguments}())?re:function(t){return w(t)&&se.call(t,"callee")&&!ae.call(t,"callee")},le=Array.isArray,ue=n(7),de=9007199254740991,he=/^(?:0|[1-9]\d*)$/;var fe=function(t,e){var n=typeof t;return!!(e=null==e?de:e)&&("number"==n||"symbol"!=n&&he.test(t))&&t>-1&&t%1==0&&t<e},pe=9007199254740991;var me=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=pe},ge={};ge["[object Float32Array]"]=ge["[object Float64Array]"]=ge["[object Int8Array]"]=ge["[object Int16Array]"]=ge["[object Int32Array]"]=ge["[object Uint8Array]"]=ge["[object Uint8ClampedArray]"]=ge["[object Uint16Array]"]=ge["[object Uint32Array]"]=!0,ge["[object Arguments]"]=ge["[object Array]"]=ge["[object ArrayBuffer]"]=ge["[object Boolean]"]=ge["[object DataView]"]=ge["[object Date]"]=ge["[object Error]"]=ge["[object Function]"]=ge["[object Map]"]=ge["[object Number]"]=ge["[object Object]"]=ge["[object RegExp]"]=ge["[object Set]"]=ge["[object String]"]=ge["[object WeakMap]"]=!1;var be=function(t){return w(t)&&me(t.length)&&!!ge[m(t)]};var we=function(t){return function(e){return t(e)}},_e=n(6),ke=_e.a&&_e.a.isTypedArray,ve=ke?we(ke):be,ye=Object.prototype.hasOwnProperty;var xe=function(t,e){var n=le(t),o=!n&&ce(t),r=!n&&!o&&Object(ue.a)(t),i=!n&&!o&&!r&&ve(t),s=n||o||r||i,a=s?ne(t.length,String):[],c=a.length;for(var l in t)!e&&!ye.call(t,l)||s&&("length"==l||r&&("offset"==l||"parent"==l)||i&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||fe(l,c))||a.push(l);return a},Ce=Object.prototype;var Ae=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Ce)},Pe=g(Object.keys,Object),Te=Object.prototype.hasOwnProperty;var Ee=function(t){if(!Ae(t))return Pe(t);var e=[];for(var n in Object(t))Te.call(t,n)&&"constructor"!=n&&e.push(n);return e};var Se=function(t){return null!=t&&me(t.length)&&!lt(t)};var Oe=function(t){return Se(t)?xe(t):Ee(t)};var Re=function(t,e){return t&&ee(e,Oe(e),t)};var Ie=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e},Fe=Object.prototype.hasOwnProperty;var De=function(t){if(!rt(t))return Ie(t);var e=Ae(t),n=[];for(var o in t)("constructor"!=o||!e&&Fe.call(t,o))&&n.push(o);return n};var Ne=function(t){return Se(t)?xe(t,!0):De(t)};var Me=function(t,e){return t&&ee(e,Ne(e),t)},Ve=n(33);var Be=function(t,e){var n=-1,o=t.length;for(e||(e=Array(o));++n<o;)e[n]=t[n];return e};var Le=function(t,e){for(var n=-1,o=null==t?0:t.length,r=0,i=[];++n<o;){var s=t[n];e(s,n,t)&&(i[r++]=s)}return i};var ze=function(){return[]},qe=Object.prototype.propertyIsEnumerable,je=Object.getOwnPropertySymbols,He=je?function(t){return null==t?[]:(t=Object(t),Le(je(t),function(e){return qe.call(t,e)}))}:ze;var Ue=function(t,e){return ee(t,He(t),e)};var $e=function(t,e){for(var n=-1,o=e.length,r=t.length;++n<o;)t[r+n]=e[n];return t},We=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)$e(e,He(t)),t=b(t);return e}:ze;var Ge=function(t,e){return ee(t,We(t),e)};var Ke=function(t,e,n){var o=e(t);return le(t)?o:$e(o,n(t))};var Je=function(t){return Ke(t,Oe,He)};var Ze=function(t){return Ke(t,Ne,We)},Qe=xt(o.a,"DataView"),Ye=xt(o.a,"Promise"),Xe=xt(o.a,"Set"),tn=xt(o.a,"WeakMap"),en=pt(Qe),nn=pt(Ct),on=pt(Ye),rn=pt(Xe),sn=pt(tn),an=m;(Qe&&"[object DataView]"!=an(new Qe(new ArrayBuffer(1)))||Ct&&"[object Map]"!=an(new Ct)||Ye&&"[object Promise]"!=an(Ye.resolve())||Xe&&"[object Set]"!=an(new Xe)||tn&&"[object WeakMap]"!=an(new tn))&&(an=function(t){var e=m(t),n="[object Object]"==e?t.constructor:void 0,o=n?pt(n):"";if(o)switch(o){case en:return"[object DataView]";case nn:return"[object Map]";case on:return"[object Promise]";case rn:return"[object Set]";case sn:return"[object WeakMap]"}return e});var cn=an,ln=Object.prototype.hasOwnProperty;var un=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&ln.call(t,"index")&&(n.index=t.index,n.input=t.input),n},dn=o.a.Uint8Array;var hn=function(t){var e=new t.constructor(t.byteLength);return new dn(e).set(new dn(t)),e};var fn=function(t,e){var n=e?hn(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)},pn=/\w*$/;var mn=function(t){var e=new t.constructor(t.source,pn.exec(t));return e.lastIndex=t.lastIndex,e},gn=r?r.prototype:void 0,bn=gn?gn.valueOf:void 0;var wn=function(t){return bn?Object(bn.call(t)):{}};var _n=function(t,e){var n=e?hn(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)},kn="[object Boolean]",vn="[object Date]",yn="[object Map]",xn="[object Number]",Cn="[object RegExp]",An="[object Set]",Pn="[object String]",Tn="[object Symbol]",En="[object ArrayBuffer]",Sn="[object DataView]",On="[object Float32Array]",Rn="[object Float64Array]",In="[object Int8Array]",Fn="[object Int16Array]",Dn="[object Int32Array]",Nn="[object Uint8Array]",Mn="[object Uint8ClampedArray]",Vn="[object Uint16Array]",Bn="[object Uint32Array]";var Ln=function(t,e,n){var o=t.constructor;switch(e){case En:return hn(t);case kn:case vn:return new o(+t);case Sn:return fn(t,n);case On:case Rn:case In:case Fn:case Dn:case Nn:case Mn:case Vn:case Bn:return _n(t,n);case yn:return new o;case xn:case Pn:return new o(t);case Cn:return mn(t);case An:return new o;case Tn:return wn(t)}},zn=Object.create,qn=function(){function t(){}return function(e){if(!rt(e))return{};if(zn)return zn(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();var jn=function(t){return"function"!=typeof t.constructor||Ae(t)?{}:qn(b(t))},Hn="[object Map]";var Un=function(t){return w(t)&&cn(t)==Hn},$n=_e.a&&_e.a.isMap,Wn=$n?we($n):Un,Gn="[object Set]";var Kn=function(t){return w(t)&&cn(t)==Gn},Jn=_e.a&&_e.a.isSet,Zn=Jn?we(Jn):Kn,Qn=1,Yn=2,Xn=4,to="[object Arguments]",eo="[object Function]",no="[object GeneratorFunction]",oo="[object Object]",ro={};ro[to]=ro["[object Array]"]=ro["[object ArrayBuffer]"]=ro["[object DataView]"]=ro["[object Boolean]"]=ro["[object Date]"]=ro["[object Float32Array]"]=ro["[object Float64Array]"]=ro["[object Int8Array]"]=ro["[object Int16Array]"]=ro["[object Int32Array]"]=ro["[object Map]"]=ro["[object Number]"]=ro[oo]=ro["[object RegExp]"]=ro["[object Set]"]=ro["[object String]"]=ro["[object Symbol]"]=ro["[object Uint8Array]"]=ro["[object Uint8ClampedArray]"]=ro["[object Uint16Array]"]=ro["[object Uint32Array]"]=!0,ro["[object Error]"]=ro[eo]=ro["[object WeakMap]"]=!1;var io=function t(e,n,o,r,i,s){var a,c=n&Qn,l=n&Yn,u=n&Xn;if(o&&(a=i?o(e,r,i,s):o(e)),void 0!==a)return a;if(!rt(e))return e;var d=le(e);if(d){if(a=un(e),!c)return Be(e,a)}else{var h=cn(e),f=h==eo||h==no;if(Object(ue.a)(e))return Object(Ve.a)(e,c);if(h==oo||h==to||f&&!i){if(a=l||f?{}:jn(e),!c)return l?Ge(e,Me(a,e)):Ue(e,Re(a,e))}else{if(!ro[h])return i?e:{};a=Ln(e,h,c)}}s||(s=new Jt);var p=s.get(e);if(p)return p;if(s.set(e,a),Zn(e))return e.forEach(function(r){a.add(t(r,n,o,r,e,s))}),a;if(Wn(e))return e.forEach(function(r,i){a.set(i,t(r,n,o,i,e,s))}),a;var m=u?l?Ze:Je:l?keysIn:Oe,g=d?void 0:m(e);return Zt(g||e,function(r,i){g&&(r=e[i=r]),te(a,i,t(r,n,o,i,e,s))}),a},so=4;var ao=function(t){return io(t,so)};class co{constructor(){this.parent=null}get index(){let t;if(!this.parent)return null;if(-1==(t=this.parent.getChildIndex(this)))throw new E.b("view-node-not-found-in-parent: The node's parent does not contain this node.");return t}get nextSibling(){const t=this.index;return null!==t&&this.parent.getChild(t+1)||null}get previousSibling(){const t=this.index;return null!==t&&this.parent.getChild(t-1)||null}get root(){let t=this;for(;t.parent;)t=t.parent;return t}get document(){return this.parent instanceof co?this.parent.document:null}getPath(){const t=[];let e=this;for(;e.parent;)t.unshift(e.index),e=e.parent;return t}getAncestors(t={includeSelf:!1,parentFirst:!1}){const e=[];let n=t.includeSelf?this:this.parent;for(;n;)e[t.parentFirst?"push":"unshift"](n),n=n.parent;return e}getCommonAncestor(t,e={}){const n=this.getAncestors(e),o=t.getAncestors(e);let r=0;for(;n[r]==o[r]&&n[r];)r++;return 0===r?null:n[r-1]}isBefore(t){if(this==t)return!1;if(this.root!==t.root)return!1;const e=this.getPath(),n=t.getPath(),o=H(e,n);switch(o){case"prefix":return!0;case"extension":return!1;default:return e[o]<n[o]}}isAfter(t){return this!=t&&(this.root===t.root&&!this.isBefore(t))}_remove(){this.parent._removeChildren(this.index)}_fireChange(t,e){this.fire("change:"+t,e),this.parent&&this.parent._fireChange(t,e)}toJSON(){const t=ao(this);return delete t.parent,t}is(t){return"node"==t}}j(co,N);class lo extends co{constructor(t){super(),this._textData=t}is(t){return"text"==t||super.is(t)}get data(){return this._textData}get _data(){return this.data}set _data(t){this._fireChange("text",this),this._textData=t}isSimilar(t){return t instanceof lo&&(this===t||this.data===t.data)}_clone(){return new lo(this.data)}}class uo{constructor(t,e,n){if(this.textNode=t,e<0||e>t.data.length)throw new E.b("view-textproxy-wrong-offsetintext: Given offsetInText value is incorrect.");if(n<0||e+n>t.data.length)throw new E.b("view-textproxy-wrong-length: Given length value is incorrect.");this.data=t.data.substring(e,e+n),this.offsetInText=e}get offsetSize(){return this.data.length}get isPartial(){return this.data.length!==this.textNode.data.length}get parent(){return this.textNode.parent}get root(){return this.textNode.root}get document(){return this.textNode.document}is(t){return"textProxy"==t}getAncestors(t={includeSelf:!1,parentFirst:!1}){const e=[];let n=t.includeSelf?this.textNode:this.parent;for(;null!==n;)e[t.parentFirst?"push":"unshift"](n),n=n.parent;return e}}function ho(t){const e=new Map;for(const n in t)e.set(n,t[n]);return e}function fo(t){return!(!t||!t[Symbol.iterator])}class po{constructor(...t){this._patterns=[],this.add(...t)}add(...t){for(let e of t)("string"==typeof e||e instanceof RegExp)&&(e={name:e}),e.classes&&("string"==typeof e.classes||e.classes instanceof RegExp)&&(e.classes=[e.classes]),this._patterns.push(e)}match(...t){for(const e of t)for(const t of this._patterns){const n=mo(e,t);if(n)return{element:e,pattern:t,match:n}}return null}matchAll(...t){const e=[];for(const n of t)for(const t of this._patterns){const o=mo(n,t);o&&e.push({element:n,pattern:t,match:o})}return e.length>0?e:null}getElementName(){if(1!==this._patterns.length)return null;const t=this._patterns[0],e=t.name;return"function"==typeof t||!e||e instanceof RegExp?null:e}}function mo(t,e){if("function"==typeof e)return e(t);const n={};return e.name&&(n.name=function(t,e){if(t instanceof RegExp)return t.test(e);return t===e}(e.name,t.name),!n.name)?null:e.attributes&&(n.attributes=function(t,e){const n=[];for(const o in t){const r=t[o];if(!e.hasAttribute(o))return null;{const t=e.getAttribute(o);if(!0===r)n.push(o);else if(r instanceof RegExp){if(!r.test(t))return null;n.push(o)}else{if(t!==r)return null;n.push(o)}}}return n}(e.attributes,t),!n.attributes)?null:!(e.classes&&(n.classes=function(t,e){const n=[];for(const o of t)if(o instanceof RegExp){const t=e.getClassNames();for(const e of t)o.test(e)&&n.push(e);if(0===n.length)return null}else{if(!e.hasClass(o))return null;n.push(o)}return n}(e.classes,t),!n.classes))&&(!(e.styles&&(n.styles=function(t,e){const n=[];for(const o in t){const r=t[o];if(!e.hasStyle(o))return null;{const t=e.getStyle(o);if(r instanceof RegExp){if(!r.test(t))return null;n.push(o)}else{if(t!==r)return null;n.push(o)}}}return n}(e.styles,t),!n.styles))&&n)}class go extends co{constructor(t,e,n){if(super(),this.name=t,this._attrs=function(t){t=P(t)?ho(t):new Map(t);for(const[e,n]of t)null===n?t.delete(e):"string"!=typeof n&&t.set(e,String(n));return t}(e),this._children=[],n&&this._insertChild(0,n),this._classes=new Set,this._attrs.has("class")){const t=this._attrs.get("class");wo(this._classes,t),this._attrs.delete("class")}this._styles=new Map,this._attrs.has("style")&&(bo(this._styles,this._attrs.get("style")),this._attrs.delete("style")),this._customProperties=new Map}get childCount(){return this._children.length}get isEmpty(){return 0===this._children.length}is(t,e=null){return e?"element"==t&&e==this.name:"element"==t||t==this.name||super.is(t)}getChild(t){return this._children[t]}getChildIndex(t){return this._children.indexOf(t)}getChildren(){return this._children[Symbol.iterator]()}*getAttributeKeys(){this._classes.size>0&&(yield"class"),this._styles.size>0&&(yield"style");for(const t of this._attrs.keys())yield t}*getAttributes(){yield*this._attrs.entries(),this._classes.size>0&&(yield["class",this.getAttribute("class")]),this._styles.size>0&&(yield["style",this.getAttribute("style")])}getAttribute(t){if("class"==t)return this._classes.size>0?[...this._classes].join(" "):void 0;if("style"!=t)return this._attrs.get(t);if(this._styles.size>0){let t="";for(const[e,n]of this._styles)t+=`${e}:${n};`;return t}}hasAttribute(t){return"class"==t?this._classes.size>0:"style"==t?this._styles.size>0:this._attrs.has(t)}isSimilar(t){if(!(t instanceof go))return!1;if(this===t)return!0;if(this.name!=t.name)return!1;if(this._attrs.size!==t._attrs.size||this._classes.size!==t._classes.size||this._styles.size!==t._styles.size)return!1;for(const[e,n]of this._attrs)if(!t._attrs.has(e)||t._attrs.get(e)!==n)return!1;for(const e of this._classes)if(!t._classes.has(e))return!1;for(const[e,n]of this._styles)if(!t._styles.has(e)||t._styles.get(e)!==n)return!1;return!0}hasClass(...t){for(const e of t)if(!this._classes.has(e))return!1;return!0}getClassNames(){return this._classes.keys()}getStyle(t){return this._styles.get(t)}getStyleNames(){return this._styles.keys()}hasStyle(...t){for(const e of t)if(!this._styles.has(e))return!1;return!0}findAncestor(...t){const e=new po(...t);let n=this.parent;for(;n;){if(e.match(n))return n;n=n.parent}return null}getCustomProperty(t){return this._customProperties.get(t)}*getCustomProperties(){yield*this._customProperties.entries()}getIdentity(){const t=Array.from(this._classes).sort().join(","),e=Array.from(this._styles).map(t=>`${t[0]}:${t[1]}`).sort().join(";"),n=Array.from(this._attrs).map(t=>`${t[0]}="${t[1]}"`).sort().join(" ");return this.name+(""==t?"":` class="${t}"`)+(""==e?"":` style="${e}"`)+(""==n?"":` ${n}`)}_clone(t=!1){const e=[];if(t)for(const n of this.getChildren())e.push(n._clone(t));const n=new this.constructor(this.name,this._attrs,e);return n._classes=new Set(this._classes),n._styles=new Map(this._styles),n._customProperties=new Map(this._customProperties),n.getFillerOffset=this.getFillerOffset,n}_appendChild(t){return this._insertChild(this.childCount,t)}_insertChild(t,e){this._fireChange("children",this);let n=0;const o=function(t){if("string"==typeof t)return[new lo(t)];fo(t)||(t=[t]);return Array.from(t).map(t=>"string"==typeof t?new lo(t):t instanceof uo?new lo(t.data):t)}(e);for(const e of o)null!==e.parent&&e._remove(),e.parent=this,this._children.splice(t,0,e),t++,n++;return n}_removeChildren(t,e=1){this._fireChange("children",this);for(let n=t;n<t+e;n++)this._children[n].parent=null;return this._children.splice(t,e)}_setAttribute(t,e){e=String(e),this._fireChange("attributes",this),"class"==t?wo(this._classes,e):"style"==t?bo(this._styles,e):this._attrs.set(t,e)}_removeAttribute(t){return this._fireChange("attributes",this),"class"==t?this._classes.size>0&&(this._classes.clear(),!0):"style"==t?this._styles.size>0&&(this._styles.clear(),!0):this._attrs.delete(t)}_addClass(t){this._fireChange("attributes",this),(t=Array.isArray(t)?t:[t]).forEach(t=>this._classes.add(t))}_removeClass(t){this._fireChange("attributes",this),(t=Array.isArray(t)?t:[t]).forEach(t=>this._classes.delete(t))}_setStyle(t,e){if(this._fireChange("attributes",this),P(t)){const e=Object.keys(t);for(const n of e)this._styles.set(n,t[n])}else this._styles.set(t,e)}_removeStyle(t){this._fireChange("attributes",this),(t=Array.isArray(t)?t:[t]).forEach(t=>this._styles.delete(t))}_setCustomProperty(t,e){this._customProperties.set(t,e)}_removeCustomProperty(t){return this._customProperties.delete(t)}}function bo(t,e){let n=null,o=0,r=0,i=null;if(t.clear(),""!==e){";"!=e.charAt(e.length-1)&&(e+=";");for(let s=0;s<e.length;s++){const a=e.charAt(s);if(null===n)switch(a){case":":i||(i=e.substr(o,s-o),r=s+1);break;case'"':case"'":n=a;break;case";":{const n=e.substr(r,s-r);i&&t.set(i.trim(),n.trim()),i=null,o=s+1;break}}else a===n&&(n=null)}}}function wo(t,e){const n=e.split(/\s+/);t.clear(),n.forEach(e=>t.add(e))}class _o extends go{constructor(t,e,n){super(t,e,n),this.getFillerOffset=ko}is(t,e=null){return e?"containerElement"==t&&e==this.name||super.is(t,e):"containerElement"==t||super.is(t)}}function ko(){const t=[...this.getChildren()],e=t[this.childCount-1];if(e&&e.is("element","br"))return this.childCount;for(const e of t)if(!e.is("uiElement"))return null;return this.childCount}var vo=function(t){return t};var yo=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)},xo=Math.max;var Co=function(t,e,n){return e=xo(void 0===e?t.length-1:e,0),function(){for(var o=arguments,r=-1,i=xo(o.length-e,0),s=Array(i);++r<i;)s[r]=o[e+r];r=-1;for(var a=Array(e+1);++r<e;)a[r]=o[r];return a[e]=n(s),yo(t,this,a)}};var Ao=function(t){return function(){return t}},Po=Qt?function(t,e){return Qt(t,"toString",{configurable:!0,enumerable:!1,value:Ao(e),writable:!0})}:vo,To=800,Eo=16,So=Date.now;var Oo=function(t){var e=0,n=0;return function(){var o=So(),r=Eo-(o-n);if(n=o,r>0){if(++e>=To)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(Po);var Ro=function(t,e){return Oo(Co(t,e,vo),t+"")};var Io=function(t,e,n){if(!rt(n))return!1;var o=typeof e;return!!("number"==o?Se(n)&&fe(e,n.length):"string"==o&&e in n)&&$(n[e],t)};var Fo=function(t){return Ro(function(e,n){var o=-1,r=n.length,i=r>1?n[r-1]:void 0,s=r>2?n[2]:void 0;for(i=t.length>3&&"function"==typeof i?(r--,i):void 0,s&&Io(n[0],n[1],s)&&(i=r<3?void 0:i,r=1),e=Object(e);++o<r;){var a=n[o];a&&t(e,a,o,i)}return e})}(function(t,e){ee(e,Ne(e),t)});const Do=Symbol("observableProperties"),No=Symbol("boundObservables"),Mo=Symbol("boundProperties"),Vo={set(t,e){if(rt(t))return void Object.keys(t).forEach(e=>{this.set(e,t[e])},this);Lo(this);const n=this[Do];if(t in this&&!n.has(t))throw new E.b("observable-set-cannot-override: Cannot override an existing property.");Object.defineProperty(this,t,{enumerable:!0,configurable:!0,get:()=>n.get(t),set(e){const o=n.get(t);let r=this.fire("set:"+t,t,e,o);void 0===r&&(r=e),o===r&&n.has(t)||(n.set(t,r),this.fire("change:"+t,t,r,o))}}),this[t]=e},bind(...t){if(!t.length||!jo(t))throw new E.b("observable-bind-wrong-properties: All properties must be strings.");if(new Set(t).size!==t.length)throw new E.b("observable-bind-duplicate-properties: Properties must be unique.");Lo(this);const e=this[Mo];t.forEach(t=>{if(e.has(t))throw new E.b("observable-bind-rebind: Cannot bind the same property more that once.")});const n=new Map;return t.forEach(t=>{const o={property:t,to:[]};e.set(t,o),n.set(t,o)}),{to:zo,toMany:qo,_observable:this,_bindProperties:t,_to:[],_bindings:n}},unbind(...t){if(!(Do in this))return;const e=this[Mo],n=this[No];if(t.length){if(!jo(t))throw new E.b("observable-unbind-wrong-properties: Properties must be strings.");t.forEach(t=>{const o=e.get(t);if(!o)return;let r,i,s,a;o.to.forEach(t=>{r=t[0],i=t[1],s=n.get(r),(a=s[i]).delete(o),a.size||delete s[i],Object.keys(s).length||(n.delete(r),this.stopListening(r,"change"))}),e.delete(t)})}else n.forEach((t,e)=>{this.stopListening(e,"change")}),n.clear(),e.clear()},decorate(t){const e=this[t];if(!e)throw new E.b("observablemixin-cannot-decorate-undefined: Cannot decorate an undefined method.",{object:this,methodName:t});this.on(t,(t,n)=>{t.return=e.apply(this,n)}),this[t]=function(...e){return this.fire(t,e)}}};Fo(Vo,N);var Bo=Vo;function Lo(t){Do in t||(Object.defineProperty(t,Do,{value:new Map}),Object.defineProperty(t,No,{value:new Map}),Object.defineProperty(t,Mo,{value:new Map}))}function zo(...t){const e=function(...t){if(!t.length)throw new E.b("observable-bind-to-parse-error: Invalid argument syntax in `to()`.");const e={to:[]};let n;"function"==typeof t[t.length-1]&&(e.callback=t.pop());return t.forEach(t=>{if("string"==typeof t)n.properties.push(t);else{if("object"!=typeof t)throw new E.b("observable-bind-to-parse-error: Invalid argument syntax in `to()`.");n={observable:t,properties:[]},e.to.push(n)}}),e}(...t),n=Array.from(this._bindings.keys()),o=n.length;if(!e.callback&&e.to.length>1)throw new E.b("observable-bind-to-no-callback: Binding multiple observables only possible with callback.");if(o>1&&e.callback)throw new E.b("observable-bind-to-extra-callback: Cannot bind multiple properties and use a callback in one binding.");e.to.forEach(t=>{if(t.properties.length&&t.properties.length!==o)throw new E.b("observable-bind-to-properties-length: The number of properties must match.");t.properties.length||(t.properties=this._bindProperties)}),this._to=e.to,e.callback&&(this._bindings.get(n[0]).callback=e.callback),function(t,e){e.forEach(e=>{const n=t[No];let o;n.get(e.observable)||t.listenTo(e.observable,"change",(r,i)=>{(o=n.get(e.observable)[i])&&o.forEach(e=>{Ho(t,e.property)})})})}(this._observable,this._to),function(t){let e;t._bindings.forEach((n,o)=>{t._to.forEach(r=>{e=r.properties[n.callback?0:t._bindProperties.indexOf(o)],n.to.push([r.observable,e]),function(t,e,n,o){const r=t[No],i=r.get(n),s=i||{};s[o]||(s[o]=new Set);s[o].add(e),i||r.set(n,s)}(t._observable,n,r.observable,e)})})}(this),this._bindProperties.forEach(t=>{Ho(this._observable,t)})}function qo(t,e,n){if(this._bindings.size>1)throw new E.b("observable-bind-to-many-not-one-binding: Cannot bind multiple properties with toMany().");this.to(...function(t,e){const n=t.map(t=>[t,e]);return Array.prototype.concat.apply([],n)}(t,e),n)}function jo(t){return t.every(t=>"string"==typeof t)}function Ho(t,e){const n=t[Mo].get(e);let o;o=n.callback?n.callback.apply(t,n.to.map(t=>t[0][t[1]])):(o=n.to[0])[0][o[1]],t.hasOwnProperty(e)?t[e]=o:t.set(e,o)}const Uo=Symbol("document");class $o extends _o{constructor(t,e,n){super(t,e,n),this.set("isReadOnly",!1),this.set("isFocused",!1)}get document(){return this.getCustomProperty(Uo)}set _document(t){if(this.getCustomProperty(Uo))throw new E.b("view-editableelement-document-already-set: View document is already set.");this._setCustomProperty(Uo,t),this.bind("isReadOnly").to(t),this.bind("isFocused").to(t,"isFocused",e=>e&&t.selection.editableElement==this),this.listenTo(t.selection,"change",()=>{this.isFocused=t.isFocused&&t.selection.editableElement==this})}}j($o,Bo);const Wo=Symbol("rootName");class Go extends $o{constructor(t){super(t),this.rootName="main"}is(t,e=null){return e?"rootElement"==t&&e==this.name||super.is(t,e):"rootElement"==t||super.is(t)}get rootName(){return this.getCustomProperty(Wo)}set rootName(t){this._setCustomProperty(Wo,t)}set _name(t){this.name=t}}class Ko{constructor(t={}){if(!t.boundaries&&!t.startPosition)throw new E.b("view-tree-walker-no-start-position: Neither boundaries nor starting position have been defined.");if(t.direction&&"forward"!=t.direction&&"backward"!=t.direction)throw new E.b("view-tree-walker-unknown-direction: Only `backward` and `forward` direction allowed.",{direction:t.direction});this.boundaries=t.boundaries||null,t.startPosition?this.position=Jo.createFromPosition(t.startPosition):this.position=Jo.createFromPosition(t.boundaries["backward"==t.direction?"end":"start"]),this.direction=t.direction||"forward",this.singleCharacters=!!t.singleCharacters,this.shallow=!!t.shallow,this.ignoreElementEnd=!!t.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null}[Symbol.iterator](){return this}skip(t){let e,n,o;do{o=this.position,({done:e,value:n}=this.next())}while(!e&&t(n));e||(this.position=o)}next(){return"forward"==this.direction?this._next():this._previous()}_next(){let t=Jo.createFromPosition(this.position);const e=this.position,n=t.parent;if(null===n.parent&&t.offset===n.childCount)return{done:!0};if(n===this._boundaryEndParent&&t.offset==this.boundaries.end.offset)return{done:!0};let o;if(n instanceof lo){if(t.isAtEnd)return this.position=Jo.createAfter(n),this._next();o=n.data[t.offset]}else o=n.getChild(t.offset);if(o instanceof go)return this.shallow?t.offset++:t=new Jo(o,0),this.position=t,this._formatReturnValue("elementStart",o,e,t,1);if(o instanceof lo){if(this.singleCharacters)return t=new Jo(o,0),this.position=t,this._next();{let n,r=o.data.length;return o==this._boundaryEndParent?(r=this.boundaries.end.offset,n=new uo(o,0,r),t=Jo.createAfter(n)):(n=new uo(o,0,o.data.length),t.offset++),this.position=t,this._formatReturnValue("text",n,e,t,r)}}if("string"==typeof o){let o;if(this.singleCharacters)o=1;else{o=(n===this._boundaryEndParent?this.boundaries.end.offset:n.data.length)-t.offset}const r=new uo(n,t.offset,o);return t.offset+=o,this.position=t,this._formatReturnValue("text",r,e,t,o)}return t=Jo.createAfter(n),this.position=t,this.ignoreElementEnd?this._next():this._formatReturnValue("elementEnd",n,e,t)}_previous(){let t=Jo.createFromPosition(this.position);const e=this.position,n=t.parent;if(null===n.parent&&0===t.offset)return{done:!0};if(n==this._boundaryStartParent&&t.offset==this.boundaries.start.offset)return{done:!0};let o;if(n instanceof lo){if(t.isAtStart)return this.position=Jo.createBefore(n),this._previous();o=n.data[t.offset-1]}else o=n.getChild(t.offset-1);if(o instanceof go)return this.shallow?(t.offset--,this.position=t,this._formatReturnValue("elementStart",o,e,t,1)):(t=new Jo(o,o.childCount),this.position=t,this.ignoreElementEnd?this._previous():this._formatReturnValue("elementEnd",o,e,t));if(o instanceof lo){if(this.singleCharacters)return t=new Jo(o,o.data.length),this.position=t,this._previous();{let n,r=o.data.length;if(o==this._boundaryStartParent){const e=this.boundaries.start.offset;r=(n=new uo(o,e,o.data.length-e)).data.length,t=Jo.createBefore(n)}else n=new uo(o,0,o.data.length),t.offset--;return this.position=t,this._formatReturnValue("text",n,e,t,r)}}if("string"==typeof o){let o;if(this.singleCharacters)o=1;else{const e=n===this._boundaryStartParent?this.boundaries.start.offset:0;o=t.offset-e}t.offset-=o;const r=new uo(n,t.offset,o);return this.position=t,this._formatReturnValue("text",r,e,t,o)}return t=Jo.createBefore(n),this.position=t,this._formatReturnValue("elementStart",n,e,t,1)}_formatReturnValue(t,e,n,o,r){return e instanceof uo&&(e.offsetInText+e.data.length==e.textNode.data.length&&("forward"!=this.direction||this.boundaries&&this.boundaries.end.isEqual(this.position)?n=Jo.createAfter(e.textNode):(o=Jo.createAfter(e.textNode),this.position=o)),0===e.offsetInText&&("backward"!=this.direction||this.boundaries&&this.boundaries.start.isEqual(this.position)?n=Jo.createBefore(e.textNode):(o=Jo.createBefore(e.textNode),this.position=o))),{done:!1,value:{type:t,item:e,previousPosition:n,nextPosition:o,length:r}}}}class Jo{constructor(t,e){this.parent=t,this.offset=e}get nodeAfter(){return this.parent.is("text")?null:this.parent.getChild(this.offset)||null}get nodeBefore(){return this.parent.is("text")?null:this.parent.getChild(this.offset-1)||null}get isAtStart(){return 0===this.offset}get isAtEnd(){const t=this.parent.is("text")?this.parent.data.length:this.parent.childCount;return this.offset===t}get root(){return this.parent.root}get editableElement(){let t=this.parent;for(;!(t instanceof $o);){if(!t.parent)return null;t=t.parent}return t}getShiftedBy(t){const e=Jo.createFromPosition(this),n=e.offset+t;return e.offset=n<0?0:n,e}getLastMatchingPosition(t,e={}){e.startPosition=this;const n=new Ko(e);return n.skip(t),n.position}getAncestors(){return this.parent.is("documentFragment")?[this.parent]:this.parent.getAncestors({includeSelf:!0})}getCommonAncestor(t){const e=this.getAncestors(),n=t.getAncestors();let o=0;for(;e[o]==n[o]&&e[o];)o++;return 0===o?null:e[o-1]}isEqual(t){return this.parent==t.parent&&this.offset==t.offset}isBefore(t){return"before"==this.compareWith(t)}isAfter(t){return"after"==this.compareWith(t)}compareWith(t){if(this.root!==t.root)return"different";if(this.isEqual(t))return"same";const e=this.parent.is("node")?this.parent.getPath():[],n=t.parent.is("node")?t.parent.getPath():[];e.push(this.offset),n.push(t.offset);const o=H(e,n);switch(o){case"prefix":return"before";case"extension":return"after";default:return e[o]<n[o]?"before":"after"}}static createAt(t,e){if(t instanceof Jo)return this.createFromPosition(t);{const n=t;if("end"==e)e=n.is("text")?n.data.length:n.childCount;else{if("before"==e)return this.createBefore(n);if("after"==e)return this.createAfter(n);e||(e=0)}return new Jo(n,e)}}static createAfter(t){if(t.is("textProxy"))return new Jo(t.textNode,t.offsetInText+t.data.length);if(!t.parent)throw new E.b("view-position-after-root: You can not make position after root.",{root:t});return new Jo(t.parent,t.index+1)}static createBefore(t){if(t.is("textProxy"))return new Jo(t.textNode,t.offsetInText);if(!t.parent)throw new E.b("view-position-before-root: You can not make position before root.",{root:t});return new Jo(t.parent,t.index)}static createFromPosition(t){return new this(t.parent,t.offset)}}class Zo{constructor(t,e=null){this.start=Jo.createFromPosition(t),this.end=e?Jo.createFromPosition(e):Jo.createFromPosition(t)}*[Symbol.iterator](){yield*new Ko({boundaries:this,ignoreElementEnd:!0})}get isCollapsed(){return this.start.isEqual(this.end)}get isFlat(){return this.start.parent===this.end.parent}get root(){return this.start.root}getEnlarged(){let t=this.start.getLastMatchingPosition(Qo,{direction:"backward"}),e=this.end.getLastMatchingPosition(Qo);return t.parent.is("text")&&t.isAtStart&&(t=Jo.createBefore(t.parent)),e.parent.is("text")&&e.isAtEnd&&(e=Jo.createAfter(e.parent)),new Zo(t,e)}getTrimmed(){let t=this.start.getLastMatchingPosition(Qo);if(t.isAfter(this.end)||t.isEqual(this.end))return new Zo(t,t);let e=this.end.getLastMatchingPosition(Qo,{direction:"backward"});const n=t.nodeAfter,o=e.nodeBefore;return n&&n.is("text")&&(t=new Jo(n,0)),o&&o.is("text")&&(e=new Jo(o,o.data.length)),new Zo(t,e)}isEqual(t){return this==t||this.start.isEqual(t.start)&&this.end.isEqual(t.end)}containsPosition(t){return t.isAfter(this.start)&&t.isBefore(this.end)}containsRange(t,e=!1){t.isCollapsed&&(e=!1);const n=this.containsPosition(t.start)||e&&this.start.isEqual(t.start),o=this.containsPosition(t.end)||e&&this.end.isEqual(t.end);return n&&o}getDifference(t){const e=[];return this.isIntersecting(t)?(this.containsPosition(t.start)&&e.push(new Zo(this.start,t.start)),this.containsPosition(t.end)&&e.push(new Zo(t.end,this.end))):e.push(Zo.createFromRange(this)),e}getIntersection(t){if(this.isIntersecting(t)){let e=this.start,n=this.end;return this.containsPosition(t.start)&&(e=t.start),this.containsPosition(t.end)&&(n=t.end),new Zo(e,n)}return null}getWalker(t={}){return t.boundaries=this,new Ko(t)}getCommonAncestor(){return this.start.getCommonAncestor(this.end)}*getItems(t={}){t.boundaries=this,t.ignoreElementEnd=!0;const e=new Ko(t);for(const t of e)yield t.item}*getPositions(t={}){t.boundaries=this;const e=new Ko(t);yield e.position;for(const t of e)yield t.nextPosition}isIntersecting(t){return this.start.isBefore(t.end)&&this.end.isAfter(t.start)}static createFromParentsAndOffsets(t,e,n,o){return new this(new Jo(t,e),new Jo(n,o))}static createFromRange(t){return new this(t.start,t.end)}static createFromPositionAndShift(t,e){const n=t,o=t.getShiftedBy(e);return e>0?new this(n,o):new this(o,n)}static createIn(t){return this.createFromParentsAndOffsets(t,0,t,t.childCount)}static createOn(t){const e=t.is("textProxy")?t.offsetSize:1;return this.createFromPositionAndShift(Jo.createBefore(t),e)}static createCollapsedAt(t,e){const n=Jo.createAt(t,e),o=Jo.createFromPosition(n);return new Zo(n,o)}}function Qo(t){return!(!t.item.is("attributeElement")&&!t.item.is("uiElement"))}function Yo(t){let e=0;for(const n of t)e++;return e}class Xo{constructor(t=null,e,n){this._ranges=[],this._lastRangeBackward=!1,this._isFake=!1,this._fakeSelectionLabel="",this.setTo(t,e,n)}get isFake(){return this._isFake}get fakeSelectionLabel(){return this._fakeSelectionLabel}get anchor(){if(!this._ranges.length)return null;const t=this._ranges[this._ranges.length-1],e=this._lastRangeBackward?t.end:t.start;return Jo.createFromPosition(e)}get focus(){if(!this._ranges.length)return null;const t=this._ranges[this._ranges.length-1],e=this._lastRangeBackward?t.start:t.end;return Jo.createFromPosition(e)}get isCollapsed(){return 1===this.rangeCount&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}get editableElement(){return this.anchor?this.anchor.editableElement:null}*getRanges(){for(const t of this._ranges)yield Zo.createFromRange(t)}getFirstRange(){let t=null;for(const e of this._ranges)t&&!e.start.isBefore(t.start)||(t=e);return t?Zo.createFromRange(t):null}getLastRange(){let t=null;for(const e of this._ranges)t&&!e.end.isAfter(t.end)||(t=e);return t?Zo.createFromRange(t):null}getFirstPosition(){const t=this.getFirstRange();return t?Jo.createFromPosition(t.start):null}getLastPosition(){const t=this.getLastRange();return t?Jo.createFromPosition(t.end):null}isEqual(t){if(this.isFake!=t.isFake)return!1;if(this.isFake&&this.fakeSelectionLabel!=t.fakeSelectionLabel)return!1;if(this.rangeCount!=t.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(t.anchor)||!this.focus.isEqual(t.focus))return!1;for(const e of this._ranges){let n=!1;for(const o of t._ranges)if(e.isEqual(o)){n=!0;break}if(!n)return!1}return!0}isSimilar(t){if(this.isBackward!=t.isBackward)return!1;const e=Yo(this.getRanges());if(e!=Yo(t.getRanges()))return!1;if(0==e)return!0;for(let e of this.getRanges()){e=e.getTrimmed();let n=!1;for(let o of t.getRanges())if(o=o.getTrimmed(),e.start.isEqual(o.start)&&e.end.isEqual(o.end)){n=!0;break}if(!n)return!1}return!0}getSelectedElement(){if(1!==this.rangeCount)return null;const t=this.getFirstRange(),e=t.start.nodeAfter,n=t.end.nodeBefore;return e instanceof go&&e==n?e:null}setTo(t,e,n){if(null===t)this._setRanges([]),this._setFakeOptions(e);else if(t instanceof Xo||t instanceof tr)this._setRanges(t.getRanges(),t.isBackward),this._setFakeOptions({fake:t.isFake,label:t.fakeSelectionLabel});else if(t instanceof Zo)this._setRanges([t],e&&e.backward),this._setFakeOptions(e);else if(t instanceof Jo)this._setRanges([new Zo(t)]),this._setFakeOptions(e);else if(t instanceof co){const o=!!n&&!!n.backward;let r;if(void 0===e)throw new E.b("view-selection-setTo-required-second-parameter: selection.setTo requires the second parameter when the first parameter is a node.");r="in"==e?Zo.createIn(t):"on"==e?Zo.createOn(t):Zo.createCollapsedAt(t,e),this._setRanges([r],o),this._setFakeOptions(n)}else{if(!fo(t))throw new E.b("view-selection-setTo-not-selectable: Cannot set selection to given place.");this._setRanges(t,e&&e.backward),this._setFakeOptions(e)}this.fire("change")}setFocus(t,e){if(null===this.anchor)throw new E.b("view-selection-setFocus-no-ranges: Cannot set selection focus if there are no ranges in selection.");const n=Jo.createAt(t,e);if("same"==n.compareWith(this.focus))return;const o=this.anchor;this._ranges.pop(),"before"==n.compareWith(o)?this._addRange(new Zo(n,o),!0):this._addRange(new Zo(o,n)),this.fire("change")}_setRanges(t,e=!1){t=Array.from(t),this._ranges=[];for(const e of t)this._addRange(e);this._lastRangeBackward=!!e}_setFakeOptions(t={}){this._isFake=!!t.fake,this._fakeSelectionLabel=t.fake&&t.label||""}_addRange(t,e=!1){if(!(t instanceof Zo))throw new E.b("view-selection-add-range-not-range: Selection range set to an object that is not an instance of view.Range");this._pushRange(t),this._lastRangeBackward=!!e}_pushRange(t){for(const e of this._ranges)if(t.isIntersecting(e))throw new E.b("view-selection-range-intersects: Trying to add a range that intersects with another range from selection.",{addedRange:t,intersectingRange:e});this._ranges.push(Zo.createFromRange(t))}}j(Xo,N);class tr{constructor(t=null,e,n){this._selection=new Xo,this._selection.delegate("change").to(this),this._selection.setTo(t,e,n)}get isFake(){return this._selection.isFake}get fakeSelectionLabel(){return this._selection.fakeSelectionLabel}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get isCollapsed(){return this._selection.isCollapsed}get rangeCount(){return this._selection.rangeCount}get isBackward(){return this._selection.isBackward}get editableElement(){return this._selection.editableElement}get _ranges(){return this._selection._ranges}*getRanges(){yield*this._selection.getRanges()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getSelectedElement(){return this._selection.getSelectedElement()}isEqual(t){return this._selection.isEqual(t)}isSimilar(t){return this._selection.isSimilar(t)}_setTo(t,e,n){this._selection.setTo(t,e,n)}_setFocus(t,e){this._selection.setFocus(t,e)}}j(tr,N);class er{constructor(t={}){this._items=[],this._itemMap=new Map,this._idProperty=t.idProperty||"id",this._bindToExternalToInternalMap=new WeakMap,this._bindToInternalToExternalMap=new WeakMap,this._skippedIndexesFromExternal=[]}get length(){return this._items.length}get first(){return this._items[0]||null}get last(){return this._items[this.length-1]||null}add(t,e){let n;const o=this._idProperty;if(o in t){if("string"!=typeof(n=t[o]))throw new E.b("collection-add-invalid-id");if(this.get(n))throw new E.b("collection-add-item-already-exists")}else t[o]=n=R();if(void 0===e)e=this._items.length;else if(e>this._items.length||e<0)throw new E.b("collection-add-item-invalid-index");return this._items.splice(e,0,t),this._itemMap.set(n,t),this.fire("add",t,e),this}get(t){let e;if("string"==typeof t)e=this._itemMap.get(t);else{if("number"!=typeof t)throw new E.b("collection-get-invalid-arg: Index or id must be given.");e=this._items[t]}return e||null}getIndex(t){let e;return e="string"==typeof t?this._itemMap.get(t):t,this._items.indexOf(e)}remove(t){let e,n,o,r=!1;const i=this._idProperty;if("string"==typeof t?(n=t,r=!(o=this._itemMap.get(n)),o&&(e=this._items.indexOf(o))):"number"==typeof t?(e=t,r=!(o=this._items[e]),o&&(n=o[i])):(n=(o=t)[i],r=-1==(e=this._items.indexOf(o))||!this._itemMap.get(n)),r)throw new E.b("collection-remove-404: Item not found.");this._items.splice(e,1),this._itemMap.delete(n);const s=this._bindToInternalToExternalMap.get(o);return this._bindToInternalToExternalMap.delete(o),this._bindToExternalToInternalMap.delete(s),this.fire("remove",o,e),o}map(t,e){return this._items.map(t,e)}find(t,e){return this._items.find(t,e)}filter(t,e){return this._items.filter(t,e)}clear(){for(this._bindToCollection&&(this.stopListening(this._bindToCollection),this._bindToCollection=null);this.length;)this.remove(0)}bindTo(t){if(this._bindToCollection)throw new E.b("collection-bind-to-rebind: The collection cannot be bound more than once.");return this._bindToCollection=t,{as:t=>{this._setUpBindToBinding(e=>new t(e))},using:t=>{"function"==typeof t?this._setUpBindToBinding(e=>t(e)):this._setUpBindToBinding(e=>e[t])}}}_setUpBindToBinding(t){const e=this._bindToCollection,n=(n,o,r)=>{const i=e._bindToCollection==this,s=e._bindToInternalToExternalMap.get(o);if(i&&s)this._bindToExternalToInternalMap.set(o,s),this._bindToInternalToExternalMap.set(s,o);else{const n=t(o);if(!n)return void this._skippedIndexesFromExternal.push(r);let i=r;for(const t of this._skippedIndexesFromExternal)r>t&&i--;for(const t of e._skippedIndexesFromExternal)i>=t&&i++;this._bindToExternalToInternalMap.set(o,n),this._bindToInternalToExternalMap.set(n,o),this.add(n,i);for(let t=0;t<e._skippedIndexesFromExternal.length;t++)i<=e._skippedIndexesFromExternal[t]&&e._skippedIndexesFromExternal[t]++}};for(const t of e)n(0,t,e.getIndex(t));this.listenTo(e,"add",n),this.listenTo(e,"remove",(t,e,n)=>{const o=this._bindToExternalToInternalMap.get(e);o&&this.remove(o),this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce((t,e)=>(n<e&&t.push(e-1),n>e&&t.push(e),t),[])})}[Symbol.iterator](){return this._items[Symbol.iterator]()}}j(er,N);class nr{constructor(){this.selection=new tr,this.roots=new er({idProperty:"rootName"}),this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("isComposing",!1),this._postFixers=new Set}getRoot(t="main"){return this.roots.get(t)}registerPostFixer(t){this._postFixers.add(t)}_callPostFixers(t){let e=!1;do{for(const n of this._postFixers)if(e=n(t))break}while(e)}}j(nr,Bo);const or=10;class rr extends go{constructor(t,e,n){super(t,e,n),this.getFillerOffset=ir,this._priority=or,this._id=null,this._clonesGroup=null}get priority(){return this._priority}get id(){return this._id}getElementsWithSameId(){if(null===this.id)throw new E.b("attribute-element-get-elements-with-same-id-no-id: Cannot get elements with the same id for an attribute element without id.");return new Set(this._clonesGroup)}is(t,e=null){return e?"attributeElement"==t&&e==this.name||super.is(t,e):"attributeElement"==t||super.is(t)}isSimilar(t){return null!==this.id||null!==t.id?this.id===t.id:super.isSimilar(t)&&this.priority==t.priority}_clone(t){const e=super._clone(t);return e._priority=this._priority,e._id=this._id,e}}function ir(){if(sr(this))return null;let t=this.parent;for(;t&&t.is("attributeElement");){if(sr(t)>1)return null;t=t.parent}return!t||sr(t)>1?null:this.childCount}function sr(t){return Array.from(t.getChildren()).filter(t=>!t.is("uiElement")).length}rr.DEFAULT_PRIORITY=or;class ar extends go{constructor(t,e,n){super(t,e,n),this.getFillerOffset=cr}is(t,e=null){return e?"emptyElement"==t&&e==this.name||super.is(t,e):"emptyElement"==t||super.is(t)}_insertChild(t,e){if(e&&(e instanceof co||Array.from(e).length>0))throw new E.b("view-emptyelement-cannot-add: Cannot add child nodes to EmptyElement instance.")}}function cr(){return null}const lr=navigator.userAgent.toLowerCase();var ur={isMac:function(t){return t.indexOf("macintosh")>-1}(lr),isEdge:function(t){return!!t.match(/edge\/(\d+.?\d*)/)}(lr)};const dr={"⌘":"ctrl","⇧":"shift","⌥":"alt"},hr={ctrl:"⌘",shift:"⇧",alt:"⌥"},fr=function(){const t={arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,backspace:8,delete:46,enter:13,space:32,esc:27,tab:9,ctrl:1114112,cmd:1114112,shift:2228224,alt:4456448};for(let e=65;e<=90;e++){const n=String.fromCharCode(e);t[n.toLowerCase()]=e}for(let e=48;e<=57;e++)t[e-48]=e;for(let e=112;e<=123;e++)t["f"+(e-111)]=e;return t}();function pr(t){let e;if("string"==typeof t){if(!(e=fr[t.toLowerCase()]))throw new E.b("keyboard-unknown-key: Unknown key name.",{key:t})}else e=t.keyCode+(t.altKey?fr.alt:0)+(t.ctrlKey?fr.ctrl:0)+(t.shiftKey?fr.shift:0);return e}function mr(t){return"string"==typeof t&&(t=gr(t)),t.map(t=>"string"==typeof t?pr(t):t).reduce((t,e)=>e+t,0)}function gr(t){return t.split(/\s*\+\s*/)}class br extends go{constructor(t,e,n){super(t,e,n),this.getFillerOffset=_r}is(t,e=null){return e?"uiElement"==t&&e==this.name||super.is(t,e):"uiElement"==t||super.is(t)}_insertChild(t,e){if(e&&(e instanceof co||Array.from(e).length>0))throw new E.b("view-uielement-cannot-add: Cannot add child nodes to UIElement instance.")}render(t){return this.toDomElement(t)}toDomElement(t){const e=t.createElement(this.name);for(const t of this.getAttributeKeys())e.setAttribute(t,this.getAttribute(t));return e}}function wr(t){t.document.on("keydown",(e,n)=>(function(t,e,n){if(e.keyCode==fr.arrowright){const t=e.domTarget.ownerDocument.defaultView.getSelection(),o=1==t.rangeCount&&t.getRangeAt(0).collapsed;if(o||e.shiftKey){const e=t.focusNode,r=t.focusOffset,i=n.domPositionToView(e,r);if(null===i)return;let s=!1;const a=i.getLastMatchingPosition(t=>(t.item.is("uiElement")&&(s=!0),!(!t.item.is("uiElement")&&!t.item.is("attributeElement"))));if(s){const e=n.viewPositionToDom(a);o?t.collapse(e.parent,e.offset):t.extend(e.parent,e.offset)}}}})(0,n,t.domConverter))}function _r(){return null}class kr{constructor(t){this._children=[],t&&this._insertChild(0,t)}[Symbol.iterator](){return this._children[Symbol.iterator]()}get childCount(){return this._children.length}get isEmpty(){return 0===this.childCount}get root(){return this}get parent(){return null}is(t){return"documentFragment"==t}_appendChild(t){return this._insertChild(this.childCount,t)}getChild(t){return this._children[t]}getChildIndex(t){return this._children.indexOf(t)}getChildren(){return this._children[Symbol.iterator]()}_insertChild(t,e){this._fireChange("children",this);let n=0;const o=function(t){if("string"==typeof t)return[new lo(t)];fo(t)||(t=[t]);return Array.from(t).map(t=>"string"==typeof t?new lo(t):t instanceof uo?new lo(t.data):t)}(e);for(const e of o)null!==e.parent&&e._remove(),e.parent=this,this._children.splice(t,0,e),t++,n++;return n}_removeChildren(t,e=1){this._fireChange("children",this);for(let n=t;n<t+e;n++)this._children[n].parent=null;return this._children.splice(t,e)}_fireChange(t,e){this.fire("change:"+t,e)}}j(kr,N);class vr{constructor(t){this.document=t,this._cloneGroups=new Map}setSelection(t,e,n){this.document.selection._setTo(t,e,n)}setSelectionFocus(t,e){this.document.selection._setFocus(t,e)}createText(t){return new lo(t)}createAttributeElement(t,e,n={}){const o=new rr(t,e);return n.priority&&(o._priority=n.priority),n.id&&(o._id=n.id),o}createContainerElement(t,e){return new _o(t,e)}createEditableElement(t,e){const n=new $o(t,e);return n._document=this.document,n}createEmptyElement(t,e){return new ar(t,e)}createUIElement(t,e,n){const o=new br(t,e);return n&&(o.render=n),o}setAttribute(t,e,n){n._setAttribute(t,e)}removeAttribute(t,e){e._removeAttribute(t)}addClass(t,e){e._addClass(t)}removeClass(t,e){e._removeClass(t)}setStyle(t,e,n){P(t)&&void 0===n&&(n=e),n._setStyle(t,e)}removeStyle(t,e){e._removeStyle(t)}setCustomProperty(t,e,n){n._setCustomProperty(t,e)}removeCustomProperty(t,e){return e._removeCustomProperty(t)}breakAttributes(t){return t instanceof Jo?this._breakAttributes(t):this._breakAttributesRange(t)}breakContainer(t){const e=t.parent;if(!e.is("containerElement"))throw new E.b("view-writer-break-non-container-element: Trying to break an element which is not a container element.");if(!e.parent)throw new E.b("view-writer-break-root: Trying to break root element.");if(t.isAtStart)return Jo.createBefore(e);if(!t.isAtEnd){const n=e._clone(!1);this.insert(Jo.createAfter(e),n);const o=new Zo(t,Jo.createAt(e,"end")),r=new Jo(n,0);this.move(o,r)}return Jo.createAfter(e)}mergeAttributes(t){const e=t.offset,n=t.parent;if(n.is("text"))return t;if(n.is("attributeElement")&&0===n.childCount){const t=n.parent,e=n.index;return n._remove(),this._removeFromClonedElementsGroup(n),this.mergeAttributes(new Jo(t,e))}const o=n.getChild(e-1),r=n.getChild(e);if(!o||!r)return t;if(o.is("text")&&r.is("text"))return Pr(o,r);if(o.is("attributeElement")&&r.is("attributeElement")&&o.isSimilar(r)){const t=o.childCount;return o._appendChild(r.getChildren()),r._remove(),this._removeFromClonedElementsGroup(r),this.mergeAttributes(new Jo(o,t))}return t}mergeContainers(t){const e=t.nodeBefore,n=t.nodeAfter;if(!(e&&n&&e.is("containerElement")&&n.is("containerElement")))throw new E.b("view-writer-merge-containers-invalid-position: Element before and after given position cannot be merged.");const o=e.getChild(e.childCount-1),r=o instanceof lo?Jo.createAt(o,"end"):Jo.createAt(e,"end");return this.move(Zo.createIn(n),Jo.createAt(e,"end")),this.remove(Zo.createOn(n)),r}insert(t,e){(function t(e){for(const n of e){if(!Tr.some(t=>n instanceof t))throw new E.b("view-writer-insert-invalid-node");n.is("text")||t(n.getChildren())}})(e=fo(e)?[...e]:[e]);const n=yr(t);if(!n)throw new E.b("view-writer-invalid-position-container");const o=this._breakAttributes(t,!0),r=n._insertChild(o.offset,e);for(const t of e)this._addToClonedElementsGroup(t);const i=o.getShiftedBy(r),s=this.mergeAttributes(o);if(0===r)return new Zo(s,s);{s.isEqual(o)||i.offset--;const t=this.mergeAttributes(i);return new Zo(s,t)}}remove(t){const e=t instanceof Zo?t:Zo.createOn(t);if(Sr(e),e.isCollapsed)return new kr;const{start:n,end:o}=this._breakAttributesRange(e,!0),r=n.parent,i=o.offset-n.offset,s=r._removeChildren(n.offset,i);for(const t of s)this._removeFromClonedElementsGroup(t);const a=this.mergeAttributes(n);return e.start=a,e.end=Jo.createFromPosition(a),new kr(s)}clear(t,e){Sr(t);const n=t.getWalker({direction:"backward",ignoreElementEnd:!0});for(const o of n){const n=o.item;let r;if(n.is("element")&&e.isSimilar(n))r=Zo.createOn(n);else if(!o.nextPosition.isAfter(t.start)&&n.is("textProxy")){const t=n.getAncestors().find(t=>t.is("element")&&e.isSimilar(t));t&&(r=Zo.createIn(t))}r&&(r.end.isAfter(t.end)&&(r.end=t.end),r.start.isBefore(t.start)&&(r.start=t.start),this.remove(r))}}move(t,e){let n;if(e.isAfter(t.end)){const o=(e=this._breakAttributes(e,!0)).parent,r=o.childCount;t=this._breakAttributesRange(t,!0),n=this.remove(t),e.offset+=o.childCount-r}else n=this.remove(t);return this.insert(e,n)}wrap(t,e){if(!(e instanceof rr))throw new E.b("view-writer-wrap-invalid-attribute");if(Sr(t),t.isCollapsed){let n=t.start;n.parent.is("element")&&!function(t){return Array.from(t.getChildren()).some(t=>!t.is("uiElement"))}(n.parent)&&(n=n.getLastMatchingPosition(t=>t.item.is("uiElement"))),n=this._wrapPosition(n,e);const o=this.document.selection;return o.isCollapsed&&o.getFirstPosition().isEqual(t.start)&&this.setSelection(n),new Zo(n)}return this._wrapRange(t,e)}unwrap(t,e){if(!(e instanceof rr))throw new E.b("view-writer-unwrap-invalid-attribute");if(Sr(t),t.isCollapsed)return t;const{start:n,end:o}=this._breakAttributesRange(t,!0);if(o.isEqual(n.getShiftedBy(1))){const t=n.nodeAfter;if(!e.isSimilar(t)&&t instanceof rr&&this._unwrapAttributeElement(e,t)){const t=this.mergeAttributes(n);t.isEqual(n)||o.offset--;const e=this.mergeAttributes(o);return new Zo(t,e)}}const r=n.parent,i=this._unwrapChildren(r,n.offset,o.offset,e),s=this.mergeAttributes(i.start);s.isEqual(i.start)||i.end.offset--;const a=this.mergeAttributes(i.end);return new Zo(s,a)}rename(t,e){const n=new _o(t,e.getAttributes());return this.insert(Jo.createAfter(e),n),this.move(Zo.createIn(e),Jo.createAt(n)),this.remove(Zo.createOn(e)),n}clearClonedElementsGroup(t){this._cloneGroups.delete(t)}_wrapChildren(t,e,n,o){let r=e;const i=[];for(;r<n;){const e=t.getChild(r),n=e.is("text"),s=e.is("attributeElement"),a=e.is("emptyElement"),c=e.is("uiElement");if(n||a||c||s&&xr(o,e)){const n=o._clone();e._remove(),n._appendChild(e),t._insertChild(r,n),this._addToClonedElementsGroup(n),i.push(new Jo(t,r))}else s&&this._wrapChildren(e,0,e.childCount,o);r++}let s=0;for(const t of i){if(t.offset-=s,t.offset==e)continue;this.mergeAttributes(t).isEqual(t)||(s++,n--)}return Zo.createFromParentsAndOffsets(t,e,t,n)}_unwrapChildren(t,e,n,o){let r=e;const i=[];for(;r<n;){const e=t.getChild(r);if(e.isSimilar(o)){const o=e.getChildren(),s=e.childCount;e._remove(),t._insertChild(r,o),this._removeFromClonedElementsGroup(e),i.push(new Jo(t,r),new Jo(t,r+s)),r+=s,n+=s-1}else e.is("attributeElement")&&this._unwrapChildren(e,0,e.childCount,o),r++}let s=0;for(const t of i){if(t.offset-=s,t.offset==e||t.offset==n)continue;this.mergeAttributes(t).isEqual(t)||(s++,n--)}return Zo.createFromParentsAndOffsets(t,e,t,n)}_wrapRange(t,e){if(function(t){return t.start.parent==t.end.parent&&t.start.parent.is("attributeElement")&&0===t.start.offset&&t.end.offset===t.start.parent.childCount}(t)&&this._wrapAttributeElement(e,t.start.parent)){const e=t.start.parent,n=this.mergeAttributes(Jo.createAfter(e)),o=this.mergeAttributes(Jo.createBefore(e));return new Zo(o,n)}const{start:n,end:o}=this._breakAttributesRange(t,!0);if(o.isEqual(n.getShiftedBy(1))){const t=n.nodeAfter;if(t instanceof rr&&this._wrapAttributeElement(e,t)){const t=this.mergeAttributes(n);t.isEqual(n)||o.offset--;const e=this.mergeAttributes(o);return new Zo(t,e)}}const r=n.parent,i=this._unwrapChildren(r,n.offset,o.offset,e),s=this._wrapChildren(r,i.start.offset,i.end.offset,e),a=this.mergeAttributes(s.start);a.isEqual(s.start)||s.end.offset--;const c=this.mergeAttributes(s.end);return new Zo(a,c)}_wrapPosition(t,e){if(e.isSimilar(t.parent))return Cr(Jo.createFromPosition(t));t.parent.is("text")&&(t=Ar(t));const n=this.createAttributeElement();n._priority=Number.POSITIVE_INFINITY,n.isSimilar=(()=>!1),t.parent._insertChild(t.offset,n);const o=new Zo(t,t.getShiftedBy(1));this.wrap(o,e);const r=new Jo(n.parent,n.index);n._remove();const i=r.nodeBefore,s=r.nodeAfter;return i instanceof lo&&s instanceof lo?Pr(i,s):Cr(r)}_wrapAttributeElement(t,e){if(!Or(t,e))return!1;if(t.name!==e.name||t.priority!==e.priority)return!1;for(const n of t.getAttributeKeys())if("class"!==n&&"style"!==n&&e.hasAttribute(n)&&e.getAttribute(n)!==t.getAttribute(n))return!1;for(const n of t.getStyleNames())if(e.hasStyle(n)&&e.getStyle(n)!==t.getStyle(n))return!1;for(const n of t.getAttributeKeys())"class"!==n&&"style"!==n&&(e.hasAttribute(n)||this.setAttribute(n,t.getAttribute(n),e));for(const n of t.getStyleNames())e.hasStyle(n)||this.setStyle(n,t.getStyle(n),e);for(const n of t.getClassNames())e.hasClass(n)||this.addClass(n,e);return!0}_unwrapAttributeElement(t,e){if(!Or(t,e))return!1;if(t.name!==e.name||t.priority!==e.priority)return!1;for(const n of t.getAttributeKeys())if("class"!==n&&"style"!==n&&(!e.hasAttribute(n)||e.getAttribute(n)!==t.getAttribute(n)))return!1;if(!e.hasClass(...t.getClassNames()))return!1;for(const n of t.getStyleNames())if(!e.hasStyle(n)||e.getStyle(n)!==t.getStyle(n))return!1;for(const n of t.getAttributeKeys())"class"!==n&&"style"!==n&&this.removeAttribute(n,e);return this.removeClass(Array.from(t.getClassNames()),e),this.removeStyle(Array.from(t.getStyleNames()),e),!0}_breakAttributesRange(t,e=!1){const n=t.start,o=t.end;if(Sr(t),t.isCollapsed){const n=this._breakAttributes(t.start,e);return new Zo(n,n)}const r=this._breakAttributes(o,e),i=r.parent.childCount,s=this._breakAttributes(n,e);return r.offset+=r.parent.childCount-i,new Zo(s,r)}_breakAttributes(t,e=!1){const n=t.offset,o=t.parent;if(t.parent.is("emptyElement"))throw new E.b("view-writer-cannot-break-empty-element");if(t.parent.is("uiElement"))throw new E.b("view-writer-cannot-break-ui-element");if(!e&&o.is("text")&&Er(o.parent))return Jo.createFromPosition(t);if(Er(o))return Jo.createFromPosition(t);if(o.is("text"))return this._breakAttributes(Ar(t),e);if(n==o.childCount){const t=new Jo(o.parent,o.index+1);return this._breakAttributes(t,e)}if(0===n){const t=new Jo(o.parent,o.index);return this._breakAttributes(t,e)}{const t=o.index+1,r=o._clone();o.parent._insertChild(t,r),this._addToClonedElementsGroup(r);const i=o.childCount-n,s=o._removeChildren(n,i);r._appendChild(s);const a=new Jo(o.parent,t);return this._breakAttributes(a,e)}}_addToClonedElementsGroup(t){if(!t.root.is("rootElement"))return;if(t.is("element"))for(const e of t.getChildren())this._addToClonedElementsGroup(e);const e=t.id;if(!e)return;let n=this._cloneGroups.get(e);n||(n=new Set,this._cloneGroups.set(e,n)),n.add(t),t._clonesGroup=n}_removeFromClonedElementsGroup(t){if(t.is("element"))for(const e of t.getChildren())this._removeFromClonedElementsGroup(e);const e=t.id;if(!e)return;const n=this._cloneGroups.get(e);n&&n.delete(t)}}function yr(t){let e=t.parent;for(;!Er(e);){if(!e)return;e=e.parent}return e}function xr(t,e){return t.priority<e.priority||!(t.priority>e.priority)&&t.getIdentity()<e.getIdentity()}function Cr(t){const e=t.nodeBefore;if(e&&e.is("text"))return new Jo(e,e.data.length);const n=t.nodeAfter;return n&&n.is("text")?new Jo(n,0):t}function Ar(t){if(t.offset==t.parent.data.length)return new Jo(t.parent.parent,t.parent.index+1);if(0===t.offset)return new Jo(t.parent.parent,t.parent.index);const e=t.parent.data.slice(t.offset);return t.parent._data=t.parent.data.slice(0,t.offset),t.parent.parent._insertChild(t.parent.index+1,new lo(e)),new Jo(t.parent.parent,t.parent.index+1)}function Pr(t,e){const n=t.data.length;return t._data+=e.data,e._remove(),new Jo(t,n)}const Tr=[lo,rr,_o,ar,br];function Er(t){return t&&(t.is("containerElement")||t.is("documentFragment"))}function Sr(t){const e=yr(t.start),n=yr(t.end);if(!e||!n||e!==n)throw new E.b("view-writer-invalid-range-container")}function Or(t,e){return null===t.id&&null===e.id}function Rr(t){return"[object Text]"==Object.prototype.toString.call(t)}const Ir=t=>{const e=t.createElement("br");return e.dataset.ckeFiller=!0,e},Fr=t=>t.createTextNode(" "),Dr=7;let Nr="";for(let t=0;t<Dr;t++)Nr+="";function Mr(t){return Rr(t)&&t.data.substr(0,Dr)===Nr}function Vr(t){return t.data.length==Dr&&Mr(t)}function Br(t){return Mr(t)?t.data.slice(Dr):t.data}const Lr=new WeakMap;function zr(t,e){let n=Lr.get(e);return n||(n=e(window.document),Lr.set(e,n)),t.isEqualNode(n)}function qr(t,e){if(e.keyCode==fr.arrowleft){const t=e.domTarget.ownerDocument.defaultView.getSelection();if(1==t.rangeCount&&t.getRangeAt(0).collapsed){const e=t.getRangeAt(0).startContainer,n=t.getRangeAt(0).startOffset;Mr(e)&&n<=Dr&&t.collapse(e,0)}}}function jr(t,e,n){let o,r;if(n=n||function(t,e){return t===e},e.length<t.length){const n=t;t=e,e=n,o="delete",r="insert"}else o="insert",r="delete";const i=t.length,s=e.length,a=s-i,c={},l={};function u(a){const u=(void 0!==l[a-1]?l[a-1]:-1)+1,d=void 0!==l[a+1]?l[a+1]:-1,h=u>d?-1:1;c[a+h]&&(c[a]=c[a+h].slice(0)),c[a]||(c[a]=[]),c[a].push(u>d?o:r);let f=Math.max(u,d),p=f-a;for(;p<i&&f<s&&n(t[p],e[f]);)p++,f++,c[a].push("equal");return f}let d,h=0;do{for(d=-h;d<a;d++)l[d]=u(d);for(d=a+h;d>a;d--)l[d]=u(d);l[a]=u(a),h++}while(l[a]!==s);return c[a].slice(1)}function Hr(t,e,n){t.insertBefore(n,t.childNodes[e]||null)}function Ur(t){const e=t.parentNode;e&&e.removeChild(t)}function $r(t){if(t){if(t.defaultView)return t instanceof t.defaultView.Document;if(t.ownerDocument&&t.ownerDocument.defaultView)return t instanceof t.ownerDocument.defaultView.Node}return!1}function Wr(t,e){if(t===e)return[];return function(t,e){const n=[],{firstIndex:o,lastIndexOld:r,lastIndexNew:i}=e;i-o>0&&n.push({index:o,type:"insert",values:t.substring(o,i).split("")});r-o>0&&n.push({index:o+(i-o),type:"delete",howMany:r-o});return n}(e,function(t,e){const n=Gr(t,e),o=Kr(t,n),r=Kr(e,n),i=Gr(o,r),s=t.length-i,a=e.length-i;return{firstIndex:n,lastIndexOld:s,lastIndexNew:a}}(t,e))}function Gr(t,e){for(let n=0;n<Math.max(t.length,e.length);n++)if(t[n]!==e[n])return n}function Kr(t,e){return t.substring(e).split("").reverse().join("")}class Jr{constructor(t,e){this.domDocuments=new Set,this.domConverter=t,this.markedAttributes=new Set,this.markedChildren=new Set,this.markedTexts=new Set,this.selection=e,this.isFocused=!1,this._inlineFiller=null,this._fakeSelectionContainer=null}markToSync(t,e){if("text"===t)this.domConverter.mapViewToDom(e.parent)&&this.markedTexts.add(e);else{if(!this.domConverter.mapViewToDom(e))return;if("attributes"===t)this.markedAttributes.add(e);else{if("children"!==t)throw new E.b("view-renderer-unknown-type: Unknown type passed to Renderer.markToSync.");this.markedChildren.add(e)}}}render(){let t;for(const t of this.markedChildren)this._updateChildrenMappings(t);this._inlineFiller&&!this._isSelectionInInlineFiller()&&this._removeInlineFiller(),this._inlineFiller?t=this._getInlineFillerPosition():this._needsInlineFillerAtSelection()&&(t=this.selection.getFirstPosition(),this.markedChildren.add(t.parent));for(const t of this.markedAttributes)this._updateAttrs(t);for(const e of this.markedChildren)this._updateChildren(e,{inlineFillerPosition:t});for(const e of this.markedTexts)!this.markedChildren.has(e.parent)&&this.domConverter.mapViewToDom(e.parent)&&this._updateText(e,{inlineFillerPosition:t});if(t){const e=this.domConverter.viewPositionToDom(t),n=e.parent.ownerDocument;Mr(e.parent)?this._inlineFiller=e.parent:this._inlineFiller=Zr(n,e.parent,e.offset)}else this._inlineFiller=null;this._updateSelection(),this._updateFocus(),this.markedTexts.clear(),this.markedAttributes.clear(),this.markedChildren.clear()}_updateChildrenMappings(t){const e=this.domConverter.mapViewToDom(t);if(!e)return;const n=this.domConverter.mapViewToDom(t).childNodes,o=Array.from(this.domConverter.viewChildrenToDom(t,e.ownerDocument,{withChildren:!1})),r=this._diffNodeLists(n,o),i=this._findReplaceActions(r,n,o);if(-1!==i.indexOf("replace")){const e={equal:0,insert:0,delete:0};for(const r of i)if("replace"===r){const r=e.equal+e.insert,i=e.equal+e.delete,s=t.getChild(r);s&&!s.is("uiElement")&&this._updateElementMappings(s,n[i]),Ur(o[r]),e.equal++}else e[r]++}}_updateElementMappings(t,e){this.domConverter.unbindDomElement(e),this.domConverter.bindElements(e,t),this.markedChildren.add(t),this.markedAttributes.add(t)}_getInlineFillerPosition(){const t=this.selection.getFirstPosition();return t.parent.is("text")?Jo.createBefore(this.selection.getFirstPosition().parent):t}_isSelectionInInlineFiller(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const t=this.selection.getFirstPosition(),e=this.domConverter.viewPositionToDom(t);return!!(e&&Rr(e.parent)&&Mr(e.parent))}_removeInlineFiller(){const t=this._inlineFiller;if(!Mr(t))throw new E.b("view-renderer-filler-was-lost: The inline filler node was lost.");Vr(t)?t.parentNode.removeChild(t):t.data=t.data.substr(Dr),this._inlineFiller=null}_needsInlineFillerAtSelection(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const t=this.selection.getFirstPosition(),e=t.parent,n=t.offset;if(!this.domConverter.mapViewToDom(e.root))return!1;if(!e.is("element"))return!1;if(!function(t){if("false"==t.getAttribute("contenteditable"))return!1;const e=t.findAncestor(t=>t.hasAttribute("contenteditable"));return!e||"true"==e.getAttribute("contenteditable")}(e))return!1;if(n===e.getFillerOffset())return!1;const o=t.nodeBefore,r=t.nodeAfter;return!(o instanceof lo||r instanceof lo)}_updateText(t,e){const n=this.domConverter.findCorrespondingDomText(t),o=this.domConverter.viewToDom(t,n.ownerDocument),r=n.data;let i=o.data;const s=e.inlineFillerPosition;if(s&&s.parent==t.parent&&s.offset==t.index&&(i=Nr+i),r!=i){const t=Wr(r,i);for(const e of t)"insert"===e.type?n.insertData(e.index,e.values.join("")):n.deleteData(e.index,e.howMany)}}_updateAttrs(t){const e=this.domConverter.mapViewToDom(t);if(!e)return;const n=Array.from(e.attributes).map(t=>t.name),o=t.getAttributeKeys();for(const n of o)e.setAttribute(n,t.getAttribute(n));for(const o of n)t.hasAttribute(o)||e.removeAttribute(o)}_updateChildren(t,e){const n=this.domConverter.mapViewToDom(t);if(!n)return;const o=e.inlineFillerPosition,r=this.domConverter.mapViewToDom(t).childNodes,i=Array.from(this.domConverter.viewChildrenToDom(t,n.ownerDocument,{bind:!0,inlineFillerPosition:o}));o&&o.parent===t&&Zr(n.ownerDocument,i,o.offset);const s=this._diffNodeLists(r,i);let a=0;const c=new Set;for(const t of s)"insert"===t?(Hr(n,a,i[a]),a++):"delete"===t?(c.add(r[a]),Ur(r[a])):(this._markDescendantTextToSync(this.domConverter.domToView(i[a])),a++);for(const t of c)t.parentNode||this.domConverter.unbindDomElement(t)}_diffNodeLists(t,e){return jr(t,e,function(t,e,n){if(e===n)return!0;if(Rr(e)&&Rr(n))return e.data===n.data;if(zr(e,t)&&zr(n,t))return!0;return!1}.bind(null,this.domConverter.blockFiller))}_findReplaceActions(t,e,n){if(-1===t.indexOf("insert")||-1===t.indexOf("delete"))return t;let o=[],r=[],i=[];const s={equal:0,insert:0,delete:0};for(const a of t)"insert"===a?i.push(n[s.equal+s.insert]):"delete"===a?r.push(e[s.equal+s.delete]):((o=o.concat(jr(r,i,Qr).map(t=>"equal"===t?"replace":t))).push("equal"),r=[],i=[]),s[a]++;return o.concat(jr(r,i,Qr).map(t=>"equal"===t?"replace":t))}_markDescendantTextToSync(t){if(t)if(t.is("text"))this.markedTexts.add(t);else if(t.is("element"))for(const e of t.getChildren())this._markDescendantTextToSync(e)}_updateSelection(){if(0===this.selection.rangeCount)return this._removeDomSelection(),void this._removeFakeSelection();const t=this.domConverter.mapViewToDom(this.selection.editableElement);this.isFocused&&t&&(this.selection.isFake?this._updateFakeSelection(t):(this._removeFakeSelection(),this._updateDomSelection(t)))}_updateFakeSelection(t){const e=t.ownerDocument;let n=this._fakeSelectionContainer;n||(this._fakeSelectionContainer=n=e.createElement("div"),Object.assign(n.style,{position:"fixed",top:0,left:"-9999px",width:"42px"}),n.appendChild(e.createTextNode(" "))),n.parentElement||t.appendChild(n),n.firstChild.data=this.selection.fakeSelectionLabel||" ";const o=e.getSelection(),r=e.createRange();o.removeAllRanges(),r.selectNodeContents(n),o.addRange(r),this.domConverter.bindFakeSelection(n,this.selection)}_updateDomSelection(t){const e=t.ownerDocument.defaultView.getSelection();if(!this._domSelectionNeedsUpdate(e))return;const n=this.domConverter.viewPositionToDom(this.selection.anchor),o=this.domConverter.viewPositionToDom(this.selection.focus);t.focus(),e.collapse(n.parent,n.offset),e.extend(o.parent,o.offset)}_domSelectionNeedsUpdate(t){if(!this.domConverter.isDomSelectionCorrect(t))return!0;const e=t&&this.domConverter.domSelectionToView(t);return(!e||!this.selection.isEqual(e))&&!(!this.selection.isCollapsed&&this.selection.isSimilar(e))}_removeDomSelection(){for(const t of this.domDocuments){if(t.getSelection().rangeCount){const e=t.activeElement,n=this.domConverter.mapDomToView(e);e&&n&&t.getSelection().removeAllRanges()}}}_removeFakeSelection(){const t=this._fakeSelectionContainer;t&&t.remove()}_updateFocus(){if(this.isFocused){const t=this.selection.editableElement;t&&this.domConverter.focus(t)}}}function Zr(t,e,n){const o=e instanceof Array?e:e.childNodes,r=o[n];if(Rr(r))return r.data=Nr+r.data,r;{const r=t.createTextNode(Nr);return Array.isArray(e)?o.splice(n,0,r):Hr(e,n,r),r}}function Qr(t,e){return $r(t)&&$r(e)&&!Rr(t)&&!Rr(e)&&t.tagName.toLowerCase()===e.tagName.toLowerCase()}j(Jr,Bo);var Yr={window:window,document:document};function Xr(t){let e=0;for(;t.previousSibling;)t=t.previousSibling,e++;return e}function ti(t){const e=[];for(;t&&t.nodeType!=Node.DOCUMENT_NODE;)e.unshift(t),t=t.parentNode;return e}var ei=function(t){return w(t)&&1===t.nodeType&&!P(t)};class ni{constructor(t={}){this.blockFiller=t.blockFiller||Ir,this.preElements=["pre"],this.blockElements=["p","div","h1","h2","h3","h4","h5","h6"],this._domToViewMapping=new WeakMap,this._viewToDomMapping=new WeakMap,this._fakeSelectionMapping=new WeakMap}bindFakeSelection(t,e){this._fakeSelectionMapping.set(t,new Xo(e))}fakeSelectionToView(t){return this._fakeSelectionMapping.get(t)}bindElements(t,e){this._domToViewMapping.set(t,e),this._viewToDomMapping.set(e,t)}unbindDomElement(t){const e=this._domToViewMapping.get(t);if(e){this._domToViewMapping.delete(t),this._viewToDomMapping.delete(e);for(const e of Array.from(t.childNodes))this.unbindDomElement(e)}}bindDocumentFragments(t,e){this._domToViewMapping.set(t,e),this._viewToDomMapping.set(e,t)}viewToDom(t,e,n={}){if(t.is("text")){const n=this._processDataFromViewText(t);return e.createTextNode(n)}{if(this.mapViewToDom(t))return this.mapViewToDom(t);let o;if(t.is("documentFragment"))o=e.createDocumentFragment(),n.bind&&this.bindDocumentFragments(o,t);else{if(t.is("uiElement"))return o=t.render(e),n.bind&&this.bindElements(o,t),o;o=e.createElement(t.name),n.bind&&this.bindElements(o,t);for(const e of t.getAttributeKeys())o.setAttribute(e,t.getAttribute(e))}if(n.withChildren||void 0===n.withChildren)for(const r of this.viewChildrenToDom(t,e,n))o.appendChild(r);return o}}*viewChildrenToDom(t,e,n={}){const o=t.getFillerOffset&&t.getFillerOffset();let r=0;for(const i of t.getChildren())o===r&&(yield this.blockFiller(e)),yield this.viewToDom(i,e,n),r++;o===r&&(yield this.blockFiller(e))}viewRangeToDom(t){const e=this.viewPositionToDom(t.start),n=this.viewPositionToDom(t.end),o=document.createRange();return o.setStart(e.parent,e.offset),o.setEnd(n.parent,n.offset),o}viewPositionToDom(t){const e=t.parent;if(e.is("text")){const n=this.findCorrespondingDomText(e);if(!n)return null;let o=t.offset;return Mr(n)&&(o+=Dr),{parent:n,offset:o}}{let n,o,r;if(0===t.offset){if(!(n=this.mapViewToDom(e)))return null;r=n.childNodes[0]}else{const e=t.nodeBefore;if(!(o=e.is("text")?this.findCorrespondingDomText(e):this.mapViewToDom(t.nodeBefore)))return null;n=o.parentNode,r=o.nextSibling}if(Rr(r)&&Mr(r))return{parent:r,offset:Dr};return{parent:n,offset:o?Xr(o)+1:0}}}domToView(t,e={}){if(zr(t,this.blockFiller))return null;const n=this.getParentUIElement(t,this._domToViewMapping);if(n)return n;if(Rr(t)){if(Vr(t))return null;{const e=this._processDataFromDomText(t);return""===e?null:new lo(e)}}if(this.isComment(t))return null;{if(this.mapDomToView(t))return this.mapDomToView(t);let n;if(this.isDocumentFragment(t))n=new kr,e.bind&&this.bindDocumentFragments(t,n);else{const o=e.keepOriginalCase?t.tagName:t.tagName.toLowerCase();n=new go(o),e.bind&&this.bindElements(t,n);const r=t.attributes;for(let t=r.length-1;t>=0;t--)n._setAttribute(r[t].name,r[t].value)}if(e.withChildren||void 0===e.withChildren)for(const o of this.domChildrenToView(t,e))n._appendChild(o);return n}}*domChildrenToView(t,e={}){for(let n=0;n<t.childNodes.length;n++){const o=t.childNodes[n],r=this.domToView(o,e);null!==r&&(yield r)}}domSelectionToView(t){if(1===t.rangeCount){let e=t.getRangeAt(0).startContainer;Rr(e)&&(e=e.parentNode);const n=this.fakeSelectionToView(e);if(n)return n}const e=this.isDomSelectionBackward(t),n=[];for(let e=0;e<t.rangeCount;e++){const o=t.getRangeAt(e),r=this.domRangeToView(o);r&&n.push(r)}return new Xo(n,{backward:e})}domRangeToView(t){const e=this.domPositionToView(t.startContainer,t.startOffset),n=this.domPositionToView(t.endContainer,t.endOffset);return e&&n?new Zo(e,n):null}domPositionToView(t,e){if(zr(t,this.blockFiller))return this.domPositionToView(t.parentNode,Xr(t));const n=this.mapDomToView(t);if(n&&n.is("uiElement"))return Jo.createBefore(n);if(Rr(t)){if(Vr(t))return this.domPositionToView(t.parentNode,Xr(t));const n=this.findCorrespondingViewText(t);let o=e;return n?(Mr(t)&&(o=(o-=Dr)<0?0:o),new Jo(n,o)):null}if(0===e){const e=this.mapDomToView(t);if(e)return new Jo(e,0)}else{const n=t.childNodes[e-1],o=Rr(n)?this.findCorrespondingViewText(n):this.mapDomToView(n);if(o&&o.parent)return new Jo(o.parent,o.index+1)}return null}mapDomToView(t){return this.getParentUIElement(t)||this._domToViewMapping.get(t)}findCorrespondingViewText(t){if(Vr(t))return null;const e=this.getParentUIElement(t);if(e)return e;const n=t.previousSibling;if(n){if(!this.isElement(n))return null;const t=this.mapDomToView(n);if(t){return t.nextSibling instanceof lo?t.nextSibling:null}}else{const e=this.mapDomToView(t.parentNode);if(e){const t=e.getChild(0);return t instanceof lo?t:null}}return null}mapViewToDom(t){return this._viewToDomMapping.get(t)}findCorrespondingDomText(t){const e=t.previousSibling;return e&&this.mapViewToDom(e)?this.mapViewToDom(e).nextSibling:!e&&t.parent&&this.mapViewToDom(t.parent)?this.mapViewToDom(t.parent).childNodes[0]:null}focus(t){const e=this.mapViewToDom(t);if(e&&e.ownerDocument.activeElement!==e){const{scrollX:t,scrollY:n}=Yr.window,o=[];ri(e,t=>{const{scrollLeft:e,scrollTop:n}=t;o.push([e,n])}),e.focus(),ri(e,t=>{const[e,n]=o.shift();t.scrollLeft=e,t.scrollTop=n}),Yr.window.scrollTo(t,n)}}isElement(t){return t&&t.nodeType==Node.ELEMENT_NODE}isDocumentFragment(t){return t&&t.nodeType==Node.DOCUMENT_FRAGMENT_NODE}isComment(t){return t&&t.nodeType==Node.COMMENT_NODE}isDomSelectionBackward(t){if(t.isCollapsed)return!1;const e=document.createRange();e.setStart(t.anchorNode,t.anchorOffset),e.setEnd(t.focusNode,t.focusOffset);const n=e.collapsed;return e.detach(),n}getParentUIElement(t){const e=ti(t);for(e.pop();e.length;){const t=e.pop(),n=this._domToViewMapping.get(t);if(n&&n.is("uiElement"))return n}return null}isDomSelectionCorrect(t){return this._isDomSelectionPositionCorrect(t.anchorNode,t.anchorOffset)&&this._isDomSelectionPositionCorrect(t.focusNode,t.focusOffset)}_isDomSelectionPositionCorrect(t,e){if(Rr(t)&&Mr(t)&&e<Dr)return!1;if(this.isElement(t)&&Mr(t.childNodes[e]))return!1;const n=this.mapDomToView(t);return!n||!n.is("uiElement")}_processDataFromViewText(t){let e=t.data;if(t.getAncestors().some(t=>this.preElements.includes(t.name)))return e;if(" "==e.charAt(0)){const n=this._getTouchingViewTextNode(t,!1);!(n&&this._nodeEndsWithSpace(n))&&n||(e=" "+e.substr(1))}if(" "==e.charAt(e.length-1)){this._getTouchingViewTextNode(t,!0)||(e=e.substr(0,e.length-1)+" ")}return e.replace(/ {2}/g," ")}_nodeEndsWithSpace(t){if(t.getAncestors().some(t=>this.preElements.includes(t.name)))return!1;const e=this._processDataFromViewText(t);return" "==e.charAt(e.length-1)}_processDataFromDomText(t){let e=t.data;if(oi(t,this.preElements))return Br(t);e=e.replace(/[ \n\t\r]{1,}/g," ");const n=this._getTouchingInlineDomNode(t,!1),o=this._getTouchingInlineDomNode(t,!0),r=this._checkShouldLeftTrimDomText(n),i=this._checkShouldRightTrimDomText(t,o);return r&&(e=e.replace(/^ /,"")),i&&(e=e.replace(/ $/,"")),e=(e=Br(new Text(e))).replace(/ \u00A0/g," "),r&&(e=e.replace(/^\u00A0/," ")),Rr(o)&&" "!=o.data.charAt(0)||(e=e.replace(/\u00A0( *)$/," $1")),e}_checkShouldLeftTrimDomText(t){return!t||(!!ei(t)||/[^\S\u00A0]/.test(t.data.charAt(t.data.length-1)))}_checkShouldRightTrimDomText(t,e){return!e&&!Mr(t)}_getTouchingViewTextNode(t,e){const n=new Ko({startPosition:e?Jo.createAfter(t):Jo.createBefore(t),direction:e?"forward":"backward"});for(const t of n){if(t.item.is("containerElement"))return null;if(t.item.is("br"))return null;if(t.item.is("textProxy"))return t.item}return null}_getTouchingInlineDomNode(t,e){if(!t.parentNode)return null;const n=e?"nextNode":"previousNode",o=t.ownerDocument,r=ti(t)[0],i=o.createTreeWalker(r,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,{acceptNode:t=>Rr(t)?NodeFilter.FILTER_ACCEPT:"BR"==t.tagName?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});i.currentNode=t;const s=i[n]();if(null!==s){const e=function(t,e){const n=ti(t),o=ti(e);let r=0;for(;n[r]==o[r]&&n[r];)r++;return 0===r?null:n[r-1]}(t,s);if(e&&!oi(t,this.blockElements,e)&&!oi(s,this.blockElements,e))return s}return null}}function oi(t,e,n){let o=ti(t);return n&&(o=o.slice(o.indexOf(n)+1)),o.some(t=>t.tagName&&e.includes(t.tagName.toLowerCase()))}function ri(t,e){for(;t&&t!=Yr.document;)e(t),t=t.parentNode}function ii(t){const e=Object.prototype.toString.apply(t);return"[object Window]"==e||"[object global]"==e}var si=Fo({},N,{listenTo(t,...e){if($r(t)||ii(t)){const n=this._getProxyEmitter(t)||new ai(t);n.attach(...e),t=n}N.listenTo.call(this,t,...e)},stopListening(t,e,n){if($r(t)||ii(t)){const e=this._getProxyEmitter(t);if(!e)return;t=e}N.stopListening.call(this,t,e,n),t instanceof ai&&t.detach(e)},_getProxyEmitter(t){return function(t,e){return t[F]&&t[F][e]?t[F][e].emitter:null}(this,ci(t))}});class ai{constructor(t){M(this,ci(t)),this._domNode=t}}function ci(t){return t["data-ck-expando"]||(t["data-ck-expando"]=R())}Fo(ai.prototype,N,{attach(t,e,n={}){if(this._domListeners&&this._domListeners[t])return;const o=this._createDomListener(t,!!n.useCapture);this._domNode.addEventListener(t,o,!!n.useCapture),this._domListeners||(this._domListeners={}),this._domListeners[t]=o},detach(t){let e;!this._domListeners[t]||(e=this._events[t])&&e.callbacks.length||this._domListeners[t].removeListener()},_createDomListener(t,e){const n=e=>{this.fire(t,e)};return n.removeListener=(()=>{this._domNode.removeEventListener(t,n,e),delete this._domListeners[t]}),n}});class li{constructor(t){this.view=t,this.document=t.document,this.isEnabled=!1}enable(){this.isEnabled=!0}disable(){this.isEnabled=!1}destroy(){this.disable(),this.stopListening()}}j(li,si);var ui="__lodash_hash_undefined__";var di=function(t){return this.__data__.set(t,ui),this};var hi=function(t){return this.__data__.has(t)};function fi(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new $t;++e<n;)this.add(t[e])}fi.prototype.add=fi.prototype.push=di,fi.prototype.has=hi;var pi=fi;var mi=function(t,e){for(var n=-1,o=null==t?0:t.length;++n<o;)if(e(t[n],n,t))return!0;return!1};var gi=function(t,e){return t.has(e)},bi=1,wi=2;var _i=function(t,e,n,o,r,i){var s=n&bi,a=t.length,c=e.length;if(a!=c&&!(s&&c>a))return!1;var l=i.get(t);if(l&&i.get(e))return l==e;var u=-1,d=!0,h=n&wi?new pi:void 0;for(i.set(t,e),i.set(e,t);++u<a;){var f=t[u],p=e[u];if(o)var m=s?o(p,f,u,e,t,i):o(f,p,u,t,e,i);if(void 0!==m){if(m)continue;d=!1;break}if(h){if(!mi(e,function(t,e){if(!gi(h,e)&&(f===t||r(f,t,n,o,i)))return h.push(e)})){d=!1;break}}else if(f!==p&&!r(f,p,n,o,i)){d=!1;break}}return i.delete(t),i.delete(e),d};var ki=function(t){var e=-1,n=Array(t.size);return t.forEach(function(t,o){n[++e]=[o,t]}),n};var vi=function(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n},yi=1,xi=2,Ci="[object Boolean]",Ai="[object Date]",Pi="[object Error]",Ti="[object Map]",Ei="[object Number]",Si="[object RegExp]",Oi="[object Set]",Ri="[object String]",Ii="[object Symbol]",Fi="[object ArrayBuffer]",Di="[object DataView]",Ni=r?r.prototype:void 0,Mi=Ni?Ni.valueOf:void 0;var Vi=function(t,e,n,o,r,i,s){switch(n){case Di:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Fi:return!(t.byteLength!=e.byteLength||!i(new dn(t),new dn(e)));case Ci:case Ai:case Ei:return $(+t,+e);case Pi:return t.name==e.name&&t.message==e.message;case Si:case Ri:return t==e+"";case Ti:var a=ki;case Oi:var c=o&yi;if(a||(a=vi),t.size!=e.size&&!c)return!1;var l=s.get(t);if(l)return l==e;o|=xi,s.set(t,e);var u=_i(a(t),a(e),o,r,i,s);return s.delete(t),u;case Ii:if(Mi)return Mi.call(t)==Mi.call(e)}return!1},Bi=1,Li=Object.prototype.hasOwnProperty;var zi=function(t,e,n,o,r,i){var s=n&Bi,a=Je(t),c=a.length;if(c!=Je(e).length&&!s)return!1;for(var l=c;l--;){var u=a[l];if(!(s?u in e:Li.call(e,u)))return!1}var d=i.get(t);if(d&&i.get(e))return d==e;var h=!0;i.set(t,e),i.set(e,t);for(var f=s;++l<c;){var p=t[u=a[l]],m=e[u];if(o)var g=s?o(m,p,u,e,t,i):o(p,m,u,t,e,i);if(!(void 0===g?p===m||r(p,m,n,o,i):g)){h=!1;break}f||(f="constructor"==u)}if(h&&!f){var b=t.constructor,w=e.constructor;b!=w&&"constructor"in t&&"constructor"in e&&!("function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w)&&(h=!1)}return i.delete(t),i.delete(e),h},qi=1,ji="[object Arguments]",Hi="[object Array]",Ui="[object Object]",$i=Object.prototype.hasOwnProperty;var Wi=function(t,e,n,o,r,i){var s=le(t),a=le(e),c=s?Hi:cn(t),l=a?Hi:cn(e),u=(c=c==ji?Ui:c)==Ui,d=(l=l==ji?Ui:l)==Ui,h=c==l;if(h&&Object(ue.a)(t)){if(!Object(ue.a)(e))return!1;s=!0,u=!1}if(h&&!u)return i||(i=new Jt),s||ve(t)?_i(t,e,n,o,r,i):Vi(t,e,c,n,o,r,i);if(!(n&qi)){var f=u&&$i.call(t,"__wrapped__"),p=d&&$i.call(e,"__wrapped__");if(f||p){var m=f?t.value():t,g=p?e.value():e;return i||(i=new Jt),r(m,g,n,o,i)}}return!!h&&(i||(i=new Jt),zi(t,e,n,o,r,i))};var Gi=function t(e,n,o,r,i){return e===n||(null==e||null==n||!w(e)&&!w(n)?e!=e&&n!=n:Wi(e,n,o,r,t,i))};var Ki=function(t,e,n){var o=(n="function"==typeof n?n:void 0)?n(t,e):void 0;return void 0===o?Gi(t,e,void 0,n):!!o};class Ji extends li{constructor(t){super(t),this._config={childList:!0,characterData:!0,characterDataOldValue:!0,subtree:!0},this.domConverter=t.domConverter,this.renderer=t._renderer,this._domElements=[],this._mutationObserver=new window.MutationObserver(this._onMutations.bind(this))}flush(){this._onMutations(this._mutationObserver.takeRecords())}observe(t){this._domElements.push(t),this.isEnabled&&this._mutationObserver.observe(t,this._config)}enable(){super.enable();for(const t of this._domElements)this._mutationObserver.observe(t,this._config)}disable(){super.disable(),this._mutationObserver.disconnect()}destroy(){super.destroy(),this._mutationObserver.disconnect()}_onMutations(t){if(0===t.length)return;const e=this.domConverter,n=new Map,o=new Set;for(const n of t)if("childList"===n.type){const t=e.mapDomToView(n.target);if(t&&t.is("uiElement"))continue;t&&!this._isBogusBrMutation(n)&&o.add(t)}for(const r of t){const t=e.mapDomToView(r.target);if((!t||!t.is("uiElement"))&&"characterData"===r.type){const t=e.findCorrespondingViewText(r.target);t&&!o.has(t.parent)?n.set(t,{type:"text",oldText:t.data,newText:Br(r.target),node:t}):!t&&Mr(r.target)&&o.add(e.mapDomToView(r.target.parentNode))}}const r=[];for(const t of n.values())this.renderer.markToSync("text",t.node),r.push(t);for(const t of o){const n=e.mapViewToDom(t),o=Array.from(t.getChildren()),i=Array.from(e.domChildrenToView(n,{withChildren:!1}));Ki(o,i,a)||(this.renderer.markToSync("children",t),r.push({type:"children",oldChildren:o,newChildren:i,node:t}))}const i=t[0].target.ownerDocument.getSelection();let s=null;if(i&&i.anchorNode){const t=e.domPositionToView(i.anchorNode,i.anchorOffset),n=e.domPositionToView(i.focusNode,i.focusOffset);t&&n&&(s=new Xo(t)).setFocus(n)}function a(t,e){if(!Array.isArray(t))return t===e||!(!t.is("text")||!e.is("text"))&&t.data===e.data}this.document.fire("mutations",r,s),this.view.render()}_isBogusBrMutation(t){let e=null;return null===t.nextSibling&&0===t.removedNodes.length&&1==t.addedNodes.length&&(e=this.domConverter.domToView(t.addedNodes[0],{withChildren:!1})),e&&e.is("element","br")}}class Zi{constructor(t,e,n){this.view=t,this.document=t.document,this.domEvent=e,this.domTarget=e.target,Fo(this,n)}get target(){return this.view.domConverter.mapDomToView(this.domTarget)}preventDefault(){this.domEvent.preventDefault()}stopPropagation(){this.domEvent.stopPropagation()}}class Qi extends li{constructor(t){super(t),this.useCapture=!1}observe(t){("string"==typeof this.domEventType?[this.domEventType]:this.domEventType).forEach(e=>{this.listenTo(t,e,(t,e)=>{this.isEnabled&&this.onDomEvent(e)},{useCapture:this.useCapture})})}fire(t,e,n){this.isEnabled&&this.document.fire(t,new Zi(this.view,e,n))}}class Yi extends Qi{constructor(t){super(t),this.domEventType=["keydown","keyup"]}onDomEvent(t){this.fire(t.type,t,{keyCode:t.keyCode,altKey:t.altKey,ctrlKey:t.ctrlKey||t.metaKey,shiftKey:t.shiftKey,get keystroke(){return pr(this)}})}}var Xi=function(){return o.a.Date.now()},ts="[object Symbol]";var es=function(t){return"symbol"==typeof t||w(t)&&m(t)==ts},ns=NaN,os=/^\s+|\s+$/g,rs=/^[-+]0x[0-9a-f]+$/i,is=/^0b[01]+$/i,ss=/^0o[0-7]+$/i,as=parseInt;var cs=function(t){if("number"==typeof t)return t;if(es(t))return ns;if(rt(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=rt(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(os,"");var n=is.test(t);return n||ss.test(t)?as(t.slice(2),n?2:8):rs.test(t)?ns:+t},ls="Expected a function",us=Math.max,ds=Math.min;var hs=function(t,e,n){var o,r,i,s,a,c,l=0,u=!1,d=!1,h=!0;if("function"!=typeof t)throw new TypeError(ls);function f(e){var n=o,i=r;return o=r=void 0,l=e,s=t.apply(i,n)}function p(t){var n=t-c;return void 0===c||n>=e||n<0||d&&t-l>=i}function m(){var t=Xi();if(p(t))return g(t);a=setTimeout(m,function(t){var n=e-(t-c);return d?ds(n,i-(t-l)):n}(t))}function g(t){return a=void 0,h&&o?f(t):(o=r=void 0,s)}function b(){var t=Xi(),n=p(t);if(o=arguments,r=this,c=t,n){if(void 0===a)return function(t){return l=t,a=setTimeout(m,e),u?f(t):s}(c);if(d)return a=setTimeout(m,e),f(c)}return void 0===a&&(a=setTimeout(m,e)),s}return e=cs(e)||0,rt(n)&&(u=!!n.leading,i=(d="maxWait"in n)?us(cs(n.maxWait)||0,e):i,h="trailing"in n?!!n.trailing:h),b.cancel=function(){void 0!==a&&clearTimeout(a),l=0,o=c=r=a=void 0},b.flush=function(){return void 0===a?s:g(Xi())},b};class fs extends li{constructor(t){super(t),this._fireSelectionChangeDoneDebounced=hs(t=>this.document.fire("selectionChangeDone",t),200)}observe(){const t=this.document;t.on("keydown",(e,n)=>{t.selection.isFake&&function(t){return t==fr.arrowright||t==fr.arrowleft||t==fr.arrowup||t==fr.arrowdown}(n.keyCode)&&this.isEnabled&&(n.preventDefault(),this._handleSelectionMove(n.keyCode))},{priority:"lowest"})}destroy(){super.destroy(),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionMove(t){const e=this.document.selection,n=new Xo(e.getRanges(),{backward:e.isBackward,fake:!1});t!=fr.arrowleft&&t!=fr.arrowup||n.setTo(n.getFirstPosition()),t!=fr.arrowright&&t!=fr.arrowdown||n.setTo(n.getLastPosition());const o={oldSelection:e,newSelection:n,domSelection:null};this.document.fire("selectionChange",o),this._fireSelectionChangeDoneDebounced(o)}}var ps=n(2);class ms extends li{constructor(t){super(t),this.mutationObserver=t.getObserver(Ji),this.selection=this.document.selection,this.domConverter=t.domConverter,this._documents=new WeakSet,this._fireSelectionChangeDoneDebounced=hs(t=>this.document.fire("selectionChangeDone",t),200),this._clearInfiniteLoopInterval=setInterval(()=>this._clearInfiniteLoop(),1e3),this._loopbackCounter=0}observe(t){const e=t.ownerDocument;this._documents.has(e)||(this.listenTo(e,"selectionchange",()=>{this._handleSelectionChange(e)}),this._documents.add(e))}destroy(){super.destroy(),clearInterval(this._clearInfiniteLoopInterval),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionChange(t){if(!this.isEnabled||!this.document.isFocused&&!this.document.isReadOnly)return;this.mutationObserver.flush();const e=t.defaultView.getSelection(),n=this.domConverter.domSelectionToView(e);if(!this.selection.isEqual(n)||!this.domConverter.isDomSelectionCorrect(e))if(++this._loopbackCounter>60)ps.a.warn("selectionchange-infinite-loop: Selection change observer detected an infinite rendering loop.");else if(this.selection.isSimilar(n))this.view.render();else{const t={oldSelection:this.selection,newSelection:n,domSelection:e};this.document.fire("selectionChange",t),this._fireSelectionChangeDoneDebounced(t)}}_clearInfiniteLoop(){this._loopbackCounter=0}}class gs extends Qi{constructor(t){super(t),this.domEventType=["focus","blur"],this.useCapture=!0;const e=this.document;e.on("focus",()=>{e.isFocused=!0,this._renderTimeoutId=setTimeout(()=>t.render(),50)}),e.on("blur",(n,o)=>{const r=e.selection.editableElement;null!==r&&r!==o.target||(e.isFocused=!1,t.render())})}onDomEvent(t){this.fire(t.type,t)}destroy(){this._renderTimeoutId&&clearTimeout(this._renderTimeoutId),super.destroy()}}class bs extends Qi{constructor(t){super(t),this.domEventType=["compositionstart","compositionupdate","compositionend"];const e=this.document;e.on("compositionstart",()=>{e.isComposing=!0}),e.on("compositionend",()=>{e.isComposing=!1})}onDomEvent(t){this.fire(t.type,t)}}function ws(t){return"[object Range]"==Object.prototype.toString.apply(t)}function _s(t){const e=t.ownerDocument.defaultView.getComputedStyle(t);return{top:parseInt(e.borderTopWidth,10),right:parseInt(e.borderRightWidth,10),bottom:parseInt(e.borderBottomWidth,10),left:parseInt(e.borderLeftWidth,10)}}const ks=["top","right","bottom","left","width","height"];class vs{constructor(t){const e=ws(t);if(Object.defineProperty(this,"_source",{value:t._source||t,writable:!0,enumerable:!1}),ei(t)||e){const n=e?t.startContainer:t;n.ownerDocument&&n.ownerDocument.body.contains(n)||ps.a.warn("rect-source-not-in-dom: The source of this rect does not belong to any rendered DOM tree.",{source:t}),ys(this,e?vs.getDomRangeRects(t)[0]:t.getBoundingClientRect())}else if(ii(t)){const{innerWidth:e,innerHeight:n}=t;ys(this,{top:0,right:e,bottom:n,left:0,width:e,height:n})}else ys(this,t)}clone(){return new vs(this)}moveTo(t,e){return this.top=e,this.right=t+this.width,this.bottom=e+this.height,this.left=t,this}moveBy(t,e){return this.top+=e,this.right+=t,this.left+=t,this.bottom+=e,this}getIntersection(t){const e={top:Math.max(this.top,t.top),right:Math.min(this.right,t.right),bottom:Math.min(this.bottom,t.bottom),left:Math.max(this.left,t.left)};return e.width=e.right-e.left,e.height=e.bottom-e.top,e.width<0||e.height<0?null:new vs(e)}getIntersectionArea(t){const e=this.getIntersection(t);return e?e.getArea():0}getArea(){return this.width*this.height}getVisible(){const t=this._source;let e=this.clone();if(!xs(t)){let n=t.parentNode||t.commonAncestorContainer;for(;n&&!xs(n);){const t=new vs(n),o=e.getIntersection(t);if(!o)return null;o.getArea()<e.getArea()&&(e=o),n=n.parentNode}}return e}isEqual(t){for(const e of ks)if(this[e]!==t[e])return!1;return!0}contains(t){const e=this.getIntersection(t);return!(!e||!e.isEqual(t))}excludeScrollbarsAndBorders(){const t=this._source;let e,n;if(ii(t))e=t.innerWidth-t.document.documentElement.clientWidth,n=t.innerHeight-t.document.documentElement.clientHeight;else{const o=_s(this._source);e=t.offsetWidth-t.clientWidth,n=t.offsetHeight-t.clientHeight,this.moveBy(o.left,o.top)}return this.width-=e,this.right-=e,this.height-=n,this.bottom-=n,this}static getDomRangeRects(t){const e=[],n=Array.from(t.getClientRects());if(n.length)for(const t of n)e.push(new vs(t));else{let n=t.startContainer;Rr(n)&&(n=n.parentNode);const o=new vs(n.getBoundingClientRect());o.right=o.left,o.width=0,e.push(o)}return e}}function ys(t,e){for(const n of ks)t[n]=e[n]}function xs(t){return!!ei(t)&&t===t.ownerDocument.body}function Cs({target:t,viewportOffset:e=0}){const n=Rs(t);let o=n,r=null;for(;o;){let i;Ps(i=Is(o==n?t:r),()=>Fs(t,o));const s=Fs(t,o);if(As(o,s,e),o.parent!=o){if(r=o.frameElement,o=o.parent,!r)return}else o=null}}function As(t,e,n){const o=e.clone().moveBy(0,n),r=e.clone().moveBy(0,-n),i=new vs(t).excludeScrollbarsAndBorders();if(![r,o].every(t=>i.contains(t))){let{scrollX:s,scrollY:a}=t;Es(r,i)?a-=i.top-e.top+n:Ts(o,i)&&(a+=e.bottom-i.bottom+n),Ss(e,i)?s-=i.left-e.left+n:Os(e,i)&&(s+=e.right-i.right+n),t.scrollTo(s,a)}}function Ps(t,e){const n=Rs(t);let o,r;for(;t!=n.document.body;)r=e(),(o=new vs(t).excludeScrollbarsAndBorders()).contains(r)||(Es(r,o)?t.scrollTop-=o.top-r.top:Ts(r,o)&&(t.scrollTop+=r.bottom-o.bottom),Ss(r,o)?t.scrollLeft-=o.left-r.left:Os(r,o)&&(t.scrollLeft+=r.right-o.right)),t=t.parentNode}function Ts(t,e){return t.bottom>e.bottom}function Es(t,e){return t.top<e.top}function Ss(t,e){return t.left<e.left}function Os(t,e){return t.right>e.right}function Rs(t){return ws(t)?t.startContainer.ownerDocument.defaultView:t.ownerDocument.defaultView}function Is(t){if(ws(t)){let e=t.commonAncestorContainer;return Rr(e)&&(e=e.parentNode),e}return t.parentNode}function Fs(t,e){const n=Rs(t),o=new vs(t);if(n===e)return o;{let t=n;for(;t!=e;){const e=t.frameElement,n=new vs(e).excludeScrollbarsAndBorders();o.moveBy(n.left,n.top),t=t.parent}}return o}Object.assign({},{scrollViewportToShowTarget:Cs,scrollAncestorsToShowTarget:function(t){Ps(Is(t),()=>new vs(t))}});class Ds{constructor(){this.document=new nr,this.domConverter=new ni,this._renderer=new Jr(this.domConverter,this.document.selection),this._renderer.bind("isFocused").to(this.document),this.domRoots=new Map,this._observers=new Map,this._ongoingChange=!1,this._renderingInProgress=!1,this._postFixersInProgress=!1,this._renderingDisabled=!1,this._writer=new vr(this.document),this.addObserver(Ji),this.addObserver(ms),this.addObserver(gs),this.addObserver(Yi),this.addObserver(fs),this.addObserver(bs),function(t){t.document.on("keydown",qr)}(this),wr(this),this.on("render",()=>{this._render(),this.document.fire("layoutChanged")})}attachDomRoot(t,e="main"){const n=this.document.getRoot(e);n._name=t.tagName.toLowerCase(),this.domRoots.set(e,t),this.domConverter.bindElements(t,n),this._renderer.markToSync("children",n),this._renderer.domDocuments.add(t.ownerDocument),n.on("change:children",(t,e)=>this._renderer.markToSync("children",e)),n.on("change:attributes",(t,e)=>this._renderer.markToSync("attributes",e)),n.on("change:text",(t,e)=>this._renderer.markToSync("text",e));for(const n of this._observers.values())n.observe(t,e)}getDomRoot(t="main"){return this.domRoots.get(t)}addObserver(t){let e=this._observers.get(t);if(e)return e;e=new t(this),this._observers.set(t,e);for(const[t,n]of this.domRoots)e.observe(n,t);return e.enable(),e}getObserver(t){return this._observers.get(t)}disableObservers(){for(const t of this._observers.values())t.disable()}enableObservers(){for(const t of this._observers.values())t.enable()}scrollToTheSelection(){const t=this.document.selection.getFirstRange();t&&Cs({target:this.domConverter.viewRangeToDom(t),viewportOffset:20})}focus(){if(!this.document.isFocused){const t=this.document.selection.editableElement;t?(this.domConverter.focus(t),this.render()):ps.a.warn("view-focus-no-selection: There is no selection in any editable to focus.")}}change(t){if(this._renderingInProgress||this._postFixersInProgress)throw new E.b("cannot-change-view-tree: Attempting to make changes to the view when it is in incorrect state: rendering or post-fixers are in progress. This may cause some unexpected behaviour and inconsistency between the DOM and the view.");this._ongoingChange?t(this._writer):(this._ongoingChange=!0,t(this._writer),this._ongoingChange=!1,this._renderingDisabled||(this._postFixersInProgress=!0,this.document._callPostFixers(this._writer),this._postFixersInProgress=!1,this.fire("render")))}render(){this.change(()=>{})}destroy(){for(const t of this._observers.values())t.destroy();this.stopListening()}_render(){this._renderingInProgress=!0,this.disableObservers(),this._renderer.render(),this.enableObservers(),this._renderingInProgress=!1}}function Ns(t){return P(t)?ho(t):new Map(t)}j(Ds,Bo);class Ms{constructor(t){this.parent=null,this._attrs=Ns(t)}get index(){let t;if(!this.parent)return null;if(null===(t=this.parent.getChildIndex(this)))throw new E.b("model-node-not-found-in-parent: The node's parent does not contain this node.");return t}get startOffset(){let t;if(!this.parent)return null;if(null===(t=this.parent.getChildStartOffset(this)))throw new E.b("model-node-not-found-in-parent: The node's parent does not contain this node.");return t}get offsetSize(){return 1}get endOffset(){return this.parent?this.startOffset+this.offsetSize:null}get nextSibling(){const t=this.index;return null!==t&&this.parent.getChild(t+1)||null}get previousSibling(){const t=this.index;return null!==t&&this.parent.getChild(t-1)||null}get root(){let t=this;for(;t.parent;)t=t.parent;return t}get document(){return this.root==this?null:this.root.document||null}getPath(){const t=[];let e=this;for(;e.parent;)t.unshift(e.startOffset),e=e.parent;return t}getAncestors(t={includeSelf:!1,parentFirst:!1}){const e=[];let n=t.includeSelf?this:this.parent;for(;n;)e[t.parentFirst?"push":"unshift"](n),n=n.parent;return e}getCommonAncestor(t,e={}){const n=this.getAncestors(e),o=t.getAncestors(e);let r=0;for(;n[r]==o[r]&&n[r];)r++;return 0===r?null:n[r-1]}isBefore(t){if(this==t)return!1;if(this.root!==t.root)return!1;const e=this.getPath(),n=t.getPath(),o=H(e,n);switch(o){case"prefix":return!0;case"extension":return!1;default:return e[o]<n[o]}}isAfter(t){return this!=t&&(this.root===t.root&&!this.isBefore(t))}hasAttribute(t){return this._attrs.has(t)}getAttribute(t){return this._attrs.get(t)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}toJSON(){const t={};return this._attrs.size&&(t.attributes=Array.from(this._attrs).reduce((t,e)=>(t[e[0]]=e[1],t),{})),t}_clone(){return new Ms(this._attrs)}_remove(){this.parent._removeChildren(this.index)}_setAttribute(t,e){this._attrs.set(t,e)}_setAttributesTo(t){this._attrs=Ns(t)}_removeAttribute(t){return this._attrs.delete(t)}_clearAttributes(){this._attrs.clear()}is(t){return"node"==t}}class Vs extends Ms{constructor(t,e){super(e),this._data=t||""}get offsetSize(){return this.data.length}get data(){return this._data}is(t){return"text"==t||super.is(t)}toJSON(){const t=super.toJSON();return t.data=this.data,t}_clone(){return new Vs(this.data,this.getAttributes())}static fromJSON(t){return new Vs(t.data,t.attributes)}}class Bs{constructor(t,e,n){if(this.textNode=t,e<0||e>t.offsetSize)throw new E.b("model-textproxy-wrong-offsetintext: Given offsetInText value is incorrect.");if(n<0||e+n>t.offsetSize)throw new E.b("model-textproxy-wrong-length: Given length value is incorrect.");this.data=t.data.substring(e,e+n),this.offsetInText=e}get startOffset(){return null!==this.textNode.startOffset?this.textNode.startOffset+this.offsetInText:null}get offsetSize(){return this.data.length}get endOffset(){return null!==this.startOffset?this.startOffset+this.offsetSize:null}get isPartial(){return this.offsetSize!==this.textNode.offsetSize}get parent(){return this.textNode.parent}get root(){return this.textNode.root}get document(){return this.textNode.document}is(t){return"textProxy"==t}getPath(){const t=this.textNode.getPath();return t.length>0&&(t[t.length-1]+=this.offsetInText),t}getAncestors(t={includeSelf:!1,parentFirst:!1}){const e=[];let n=t.includeSelf?this:this.parent;for(;n;)e[t.parentFirst?"push":"unshift"](n),n=n.parent;return e}hasAttribute(t){return this.textNode.hasAttribute(t)}getAttribute(t){return this.textNode.getAttribute(t)}getAttributes(){return this.textNode.getAttributes()}getAttributeKeys(){return this.textNode.getAttributeKeys()}}class Ls{constructor(t){this._nodes=[],t&&this._insertNodes(0,t)}[Symbol.iterator](){return this._nodes[Symbol.iterator]()}get length(){return this._nodes.length}get maxOffset(){return this._nodes.reduce((t,e)=>t+e.offsetSize,0)}getNode(t){return this._nodes[t]||null}getNodeIndex(t){const e=this._nodes.indexOf(t);return-1==e?null:e}getNodeStartOffset(t){const e=this.getNodeIndex(t);return null===e?null:this._nodes.slice(0,e).reduce((t,e)=>t+e.offsetSize,0)}indexToOffset(t){if(t==this._nodes.length)return this.maxOffset;const e=this._nodes[t];if(!e)throw new E.b("model-nodelist-index-out-of-bounds: Given index cannot be found in the node list.");return this.getNodeStartOffset(e)}offsetToIndex(t){let e=0;for(const n of this._nodes){if(t>=e&&t<e+n.offsetSize)return this.getNodeIndex(n);e+=n.offsetSize}if(e!=t)throw new E.b("model-nodelist-offset-out-of-bounds: Given offset cannot be found in the node list.",{offset:t,nodeList:this});return this.length}_insertNodes(t,e){for(const t of e)if(!(t instanceof Ms))throw new E.b("model-nodelist-insertNodes-not-node: Trying to insert an object which is not a Node instance.");this._nodes.splice(t,0,...e)}_removeNodes(t,e=1){return this._nodes.splice(t,e)}toJSON(){return this._nodes.map(t=>t.toJSON())}}class zs extends Ms{constructor(t,e,n){super(e),this.name=t,this._children=new Ls,n&&this._insertChild(0,n)}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}is(t,e=null){return e?"element"==t&&e==this.name:"element"==t||t==this.name||super.is(t)}getChild(t){return this._children.getNode(t)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(t){return this._children.getNodeIndex(t)}getChildStartOffset(t){return this._children.getNodeStartOffset(t)}offsetToIndex(t){return this._children.offsetToIndex(t)}getNodeByPath(t){let e=this;for(const n of t)e=e.getChild(e.offsetToIndex(n));return e}toJSON(){const t=super.toJSON();if(t.name=this.name,this._children.length>0){t.children=[];for(const e of this._children)t.children.push(e.toJSON())}return t}_clone(t=!1){const e=t?Array.from(this._children).map(t=>t._clone(!0)):null;return new zs(this.name,this.getAttributes(),e)}_appendChild(t){this._insertChild(this.childCount,t)}_insertChild(t,e){const n=function(t){if("string"==typeof t)return[new Vs(t)];fo(t)||(t=[t]);return Array.from(t).map(t=>"string"==typeof t?new Vs(t):t instanceof Bs?new Vs(t.data,t.getAttributes()):t)}(e);for(const t of n)null!==t.parent&&t._remove(),t.parent=this;this._children._insertNodes(t,n)}_removeChildren(t,e=1){const n=this._children._removeNodes(t,e);for(const t of n)t.parent=null;return n}static fromJSON(t){let e=null;if(t.children){e=[];for(const n of t.children)n.name?e.push(zs.fromJSON(n)):e.push(Vs.fromJSON(n))}return new zs(t.name,t.attributes,e)}}class qs{constructor(t={}){if(!t.boundaries&&!t.startPosition)throw new E.b("model-tree-walker-no-start-position: Neither boundaries nor starting position have been defined.");const e=t.direction||"forward";if("forward"!=e&&"backward"!=e)throw new E.b("model-tree-walker-unknown-direction: Only `backward` and `forward` direction allowed.",{direction:e});this.direction=e,this.boundaries=t.boundaries||null,t.startPosition?this.position=Us.createFromPosition(t.startPosition):this.position=Us.createFromPosition(this.boundaries["backward"==this.direction?"end":"start"]),this.position.stickiness="toNone",this.singleCharacters=!!t.singleCharacters,this.shallow=!!t.shallow,this.ignoreElementEnd=!!t.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null,this._visitedParent=this.position.parent}[Symbol.iterator](){return this}skip(t){let e,n,o,r;do{o=this.position,r=this._visitedParent,({done:e,value:n}=this.next())}while(!e&&t(n));e||(this.position=o,this._visitedParent=r)}next(){return"forward"==this.direction?this._next():this._previous()}_next(){const t=this.position,e=Us.createFromPosition(this.position),n=this._visitedParent;if(null===n.parent&&e.offset===n.maxOffset)return{done:!0};if(n===this._boundaryEndParent&&e.offset==this.boundaries.end.offset)return{done:!0};const o=e.textNode?e.textNode:e.nodeAfter;if(o instanceof zs)return this.shallow?e.offset++:(e.path.push(0),this._visitedParent=o),this.position=e,js("elementStart",o,t,e,1);if(o instanceof Vs){let r;if(this.singleCharacters)r=1;else{let t=o.endOffset;this._boundaryEndParent==n&&this.boundaries.end.offset<t&&(t=this.boundaries.end.offset),r=t-e.offset}const i=e.offset-o.startOffset,s=new Bs(o,i,r);return e.offset+=r,this.position=e,js("text",s,t,e,r)}return e.path.pop(),e.offset++,this.position=e,this._visitedParent=n.parent,this.ignoreElementEnd?this._next():js("elementEnd",n,t,e)}_previous(){const t=this.position,e=Us.createFromPosition(this.position),n=this._visitedParent;if(null===n.parent&&0===e.offset)return{done:!0};if(n==this._boundaryStartParent&&e.offset==this.boundaries.start.offset)return{done:!0};const o=e.textNode?e.textNode:e.nodeBefore;if(o instanceof zs)return e.offset--,this.shallow?(this.position=e,js("elementStart",o,t,e,1)):(e.path.push(o.maxOffset),this.position=e,this._visitedParent=o,this.ignoreElementEnd?this._previous():js("elementEnd",o,t,e));if(o instanceof Vs){let r;if(this.singleCharacters)r=1;else{let t=o.startOffset;this._boundaryStartParent==n&&this.boundaries.start.offset>t&&(t=this.boundaries.start.offset),r=e.offset-t}const i=e.offset-o.startOffset,s=new Bs(o,i-r,r);return e.offset-=r,this.position=e,js("text",s,t,e,r)}return e.path.pop(),this.position=e,this._visitedParent=n.parent,js("elementStart",n,t,e,1)}}function js(t,e,n,o,r){return{done:!1,value:{type:t,item:e,previousPosition:n,nextPosition:o,length:r}}}var Hs=function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0};class Us{constructor(t,e,n="toNone"){if(!t.is("element")&&!t.is("documentFragment"))throw new E.b("model-position-root-invalid: Position root invalid.");if(!(e instanceof Array)||0===e.length)throw new E.b("model-position-path-incorrect: Position path must be an array with at least one item.",{path:e});e=t.getPath().concat(e),t=t.root,this.root=t,this.path=e,this.stickiness=n}get offset(){return Hs(this.path)}set offset(t){this.path[this.path.length-1]=t}get parent(){let t=this.root;for(let e=0;e<this.path.length-1;e++)t=t.getChild(t.offsetToIndex(this.path[e]));return t}get index(){return this.parent.offsetToIndex(this.offset)}get textNode(){const t=this.parent.getChild(this.index);return t instanceof Vs&&t.startOffset<this.offset?t:null}get nodeAfter(){return null===this.textNode?this.parent.getChild(this.index):null}get nodeBefore(){return null===this.textNode?this.parent.getChild(this.index-1):null}get isAtStart(){return 0===this.offset}get isAtEnd(){return this.offset==this.parent.maxOffset}compareWith(t){if(this.root!=t.root)return"different";const e=H(this.path,t.path);switch(e){case"same":return"same";case"prefix":return"before";case"extension":return"after";default:return this.path[e]<t.path[e]?"before":"after"}}getLastMatchingPosition(t,e={}){e.startPosition=this;const n=new qs(e);return n.skip(t),n.position}getParentPath(){return this.path.slice(0,-1)}getAncestors(){return this.parent.is("documentFragment")?[this.parent]:this.parent.getAncestors({includeSelf:!0})}getCommonPath(t){if(this.root!=t.root)return[];const e=H(this.path,t.path),n="string"==typeof e?Math.min(this.path.length,t.path.length):e;return this.path.slice(0,n)}getCommonAncestor(t){const e=this.getAncestors(),n=t.getAncestors();let o=0;for(;e[o]==n[o]&&e[o];)o++;return 0===o?null:e[o-1]}getShiftedBy(t){const e=Us.createFromPosition(this),n=e.offset+t;return e.offset=n<0?0:n,e}isAfter(t){return"after"==this.compareWith(t)}isBefore(t){return"before"==this.compareWith(t)}isEqual(t){return"same"==this.compareWith(t)}isTouching(t){let e=null,n=null;switch(this.compareWith(t)){case"same":return!0;case"before":e=Us.createFromPosition(this),n=Us.createFromPosition(t);break;case"after":e=Us.createFromPosition(t),n=Us.createFromPosition(this);break;default:return!1}let o=e.parent;for(;e.path.length+n.path.length;){if(e.isEqual(n))return!0;if(e.path.length>n.path.length){if(e.offset!==o.maxOffset)return!1;e.path=e.path.slice(0,-1),o=o.parent,e.offset++}else{if(0!==n.offset)return!1;n.path=n.path.slice(0,-1)}}}hasSameParentAs(t){if(this.root!==t.root)return!1;return"same"==H(this.getParentPath(),t.getParentPath())}getTransformedByOperation(t){let e;switch(t.type){case"insert":e=this._getTransformedByInsertOperation(t);break;case"move":case"remove":case"reinsert":e=this._getTransformedByMoveOperation(t);break;case"split":e=this._getTransformedBySplitOperation(t);break;case"merge":e=this._getTransformedByMergeOperation(t);break;default:e=Us.createFromPosition(this)}return e}_getTransformedByInsertOperation(t){return this._getTransformedByInsertion(t.position,t.howMany)}_getTransformedByMoveOperation(t){return this._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany)}_getTransformedBySplitOperation(t){const e=t.movedRange;return e.containsPosition(this)||e.start.isEqual(this)&&"toNext"==this.stickiness?this._getCombined(t.splitPosition,t.moveTargetPosition):t.graveyardPosition?this._getTransformedByMove(t.graveyardPosition,t.insertionPosition,1):this._getTransformedByInsertion(t.insertionPosition,1)}_getTransformedByMergeOperation(t){const e=t.movedRange;let n;return e.containsPosition(this)||e.start.isEqual(this)?(n=this._getCombined(t.sourcePosition,t.targetPosition),t.sourcePosition.isBefore(t.targetPosition)&&(n=n._getTransformedByDeletion(t.deletionPosition,1))):n=this.isEqual(t.deletionPosition)?Us.createFromPosition(t.deletionPosition):this._getTransformedByMove(t.deletionPosition,t.graveyardPosition,1),n}_getTransformedByDeletion(t,e){const n=Us.createFromPosition(this);if(this.root!=t.root)return n;if("same"==H(t.getParentPath(),this.getParentPath())){if(t.offset<this.offset){if(t.offset+e>this.offset)return null;n.offset-=e}}else if("prefix"==H(t.getParentPath(),this.getParentPath())){const o=t.path.length-1;if(t.offset<=this.path[o]){if(t.offset+e>this.path[o])return null;n.path[o]-=e}}return n}_getTransformedByInsertion(t,e){const n=Us.createFromPosition(this);if(this.root!=t.root)return n;if("same"==H(t.getParentPath(),this.getParentPath()))(t.offset<this.offset||t.offset==this.offset&&"toPrevious"!=this.stickiness)&&(n.offset+=e);else if("prefix"==H(t.getParentPath(),this.getParentPath())){const o=t.path.length-1;t.offset<=this.path[o]&&(n.path[o]+=e)}return n}_getTransformedByMove(t,e,n){if(e=e._getTransformedByDeletion(t,n),t.isEqual(e))return Us.createFromPosition(this);const o=this._getTransformedByDeletion(t,n);return null===o||t.isEqual(this)&&"toNext"==this.stickiness||t.getShiftedBy(n).isEqual(this)&&"toPrevious"==this.stickiness?this._getCombined(t,e):o._getTransformedByInsertion(e,n)}_getCombined(t,e){const n=t.path.length-1,o=Us.createFromPosition(e);return o.stickiness=this.stickiness,o.offset=o.offset+this.path[n]-t.offset,o.path=o.path.concat(this.path.slice(n+1)),o}toJSON(){return{root:this.root.toJSON(),path:Array.from(this.path),stickiness:this.stickiness}}static createAt(t,e){if(t instanceof Us)return this.createFromPosition(t);{const n=t;if("end"==e)e=n.maxOffset;else{if("before"==e)return this.createBefore(n);if("after"==e)return this.createAfter(n);e||(e=0)}return this.createFromParentAndOffset(n,e)}}static createAfter(t){if(!t.parent)throw new E.b("model-position-after-root: You cannot make a position after root.",{root:t});return this.createFromParentAndOffset(t.parent,t.endOffset)}static createBefore(t){if(!t.parent)throw new E.b("model-position-before-root: You cannot make a position before root.",{root:t});return this.createFromParentAndOffset(t.parent,t.startOffset)}static createFromParentAndOffset(t,e){if(!t.is("element")&&!t.is("documentFragment"))throw new E.b("model-position-parent-incorrect: Position parent have to be a element or document fragment.");const n=t.getPath();return n.push(e),new this(t.root,n)}static createFromPosition(t){const e=new this(t.root,t.path.slice());return e.stickiness=t.stickiness,e}static fromJSON(t,e){if("$graveyard"===t.root){const n=new Us(e.graveyard,t.path);return n.stickiness=t.stickiness,n}if(!e.getRoot(t.root))throw new E.b("model-position-fromjson-no-root: Cannot create position for document. Root with specified name does not exist.",{rootName:t.root});const n=new Us(e.getRoot(t.root),t.path);return n.stickiness=t.stickiness,n}}class $s{constructor(t,e=null){this.start=Us.createFromPosition(t),this.end=e?Us.createFromPosition(e):Us.createFromPosition(t),this.start.stickiness=this.isCollapsed?"toNone":"toNext",this.end.stickiness=this.isCollapsed?"toNone":"toPrevious"}*[Symbol.iterator](){yield*new qs({boundaries:this,ignoreElementEnd:!0})}get isCollapsed(){return this.start.isEqual(this.end)}get isFlat(){return"same"==H(this.start.getParentPath(),this.end.getParentPath())}get root(){return this.start.root}containsPosition(t){return t.isAfter(this.start)&&t.isBefore(this.end)}containsRange(t,e=!1){t.isCollapsed&&(e=!1);const n=this.containsPosition(t.start)||e&&this.start.isEqual(t.start),o=this.containsPosition(t.end)||e&&this.end.isEqual(t.end);return n&&o}containsItem(t){const e=Us.createBefore(t);return this.containsPosition(e)||this.start.isEqual(e)}isEqual(t){return this.start.isEqual(t.start)&&this.end.isEqual(t.end)}isIntersecting(t){return this.start.isBefore(t.end)&&this.end.isAfter(t.start)}getDifference(t){const e=[];return this.isIntersecting(t)?(this.containsPosition(t.start)&&e.push(new $s(this.start,t.start)),this.containsPosition(t.end)&&e.push(new $s(t.end,this.end))):e.push($s.createFromRange(this)),e}getIntersection(t){if(this.isIntersecting(t)){let e=this.start,n=this.end;return this.containsPosition(t.start)&&(e=t.start),this.containsPosition(t.end)&&(n=t.end),new $s(e,n)}return null}getMinimalFlatRanges(){const t=[],e=this.start.getCommonPath(this.end).length,n=Us.createFromPosition(this.start);let o=n.parent;for(;n.path.length>e+1;){const e=o.maxOffset-n.offset;0!==e&&t.push(new $s(n,n.getShiftedBy(e))),n.path=n.path.slice(0,-1),n.offset++,o=o.parent}for(;n.path.length<=this.end.path.length;){const e=this.end.path[n.path.length-1],o=e-n.offset;0!==o&&t.push(new $s(n,n.getShiftedBy(o))),n.offset=e,n.path.push(0)}return t}getWalker(t={}){return t.boundaries=this,new qs(t)}*getItems(t={}){t.boundaries=this,t.ignoreElementEnd=!0;const e=new qs(t);for(const t of e)yield t.item}*getPositions(t={}){t.boundaries=this;const e=new qs(t);yield e.position;for(const t of e)yield t.nextPosition}getTransformedByOperation(t){switch(t.type){case"insert":return this._getTransformedByInsertOperation(t);case"move":case"remove":case"reinsert":return this._getTransformedByMoveOperation(t);case"split":return[this._getTransformedBySplitOperation(t)];case"merge":return[this._getTransformedByMergeOperation(t)]}return[$s.createFromRange(this)]}getTransformedByOperations(t){const e=[$s.createFromRange(this)];for(const n of t)for(let t=0;t<e.length;t++){const o=e[t].getTransformedByOperation(n);e.splice(t,1,...o),t+=o.length-1}for(let t=0;t<e.length;t++){const n=e[t];for(let o=t+1;o<e.length;o++){const t=e[o];(n.containsRange(t)||t.containsRange(n)||n.isEqual(t))&&e.splice(o,1)}}return e}getCommonAncestor(){return this.start.getCommonAncestor(this.end)}toJSON(){return{start:this.start.toJSON(),end:this.end.toJSON()}}_getTransformedByInsertOperation(t,e=!1){return this._getTransformedByInsertion(t.position,t.howMany,e)}_getTransformedByMoveOperation(t,e=!1){const n=t.sourcePosition,o=t.howMany,r=t.targetPosition;return this._getTransformedByMove(n,r,o,e)}_getTransformedBySplitOperation(t){const e=this.start._getTransformedBySplitOperation(t);let n;return n=this.end.isEqual(t.insertionPosition)?this.end.getShiftedBy(1):this.end._getTransformedBySplitOperation(t),new $s(e,n)}_getTransformedByMergeOperation(t){let e=this.start._getTransformedByMergeOperation(t),n=this.end._getTransformedByMergeOperation(t);return e.root!=n.root&&(n=this.end.getShiftedBy(-1)),e.isAfter(n)?(t.sourcePosition.isBefore(t.targetPosition)?(e=Us.createFromPosition(n)).offset=0:(t.deletionPosition.isEqual(e)||(n=t.deletionPosition),e=t.targetPosition),new $s(e,n)):new $s(e,n)}_getTransformedByInsertion(t,e,n=!1){if(n&&this.containsPosition(t))return[new $s(this.start,t),new $s(t.getShiftedBy(e),this.end._getTransformedByInsertion(t,e))];{const n=$s.createFromRange(this);return n.start=n.start._getTransformedByInsertion(t,e),n.end=n.end._getTransformedByInsertion(t,e),[n]}}_getTransformedByMove(t,e,n,o=!1){if(this.isCollapsed){const o=this.start._getTransformedByMove(t,e,n);return[new $s(o)]}const r=$s.createFromPositionAndShift(t,n),i=e._getTransformedByDeletion(t,n);if(this.containsPosition(e)&&!o&&(r.containsPosition(this.start)||r.containsPosition(this.end))){const o=this.start._getTransformedByMove(t,e,n),r=this.end._getTransformedByMove(t,e,n);return[new $s(o,r)]}let s;const a=this.getDifference(r);let c=null;const l=this.getIntersection(r);if(1==a.length?c=new $s(a[0].start._getTransformedByDeletion(t,n),a[0].end._getTransformedByDeletion(t,n)):2==a.length&&(c=new $s(this.start,this.end._getTransformedByDeletion(t,n))),s=c?c._getTransformedByInsertion(i,n,null!==l||o):[],l){const t=new $s(l.start._getCombined(r.start,i),l.end._getCombined(r.start,i));2==s.length?s.splice(1,0,t):s.push(t)}return s}_getTransformedByDeletion(t,e){let n=this.start._getTransformedByDeletion(t,e),o=this.end._getTransformedByDeletion(t,e);return null==n&&null==o?null:(null==n&&(n=t),null==o&&(o=t),new $s(n,o))}static createFromPositionAndShift(t,e){const n=t,o=t.getShiftedBy(e);return e>0?new this(n,o):new this(o,n)}static createFromParentsAndOffsets(t,e,n,o){return new this(Us.createFromParentAndOffset(t,e),Us.createFromParentAndOffset(n,o))}static createFromRange(t){return new this(t.start,t.end)}static createIn(t){return this.createFromParentsAndOffsets(t,0,t,t.maxOffset)}static createOn(t){return this.createFromPositionAndShift(Us.createBefore(t),t.offsetSize)}static createCollapsedAt(t,e){const n=Us.createAt(t,e),o=Us.createFromPosition(n);return new $s(n,o)}static createFromRanges(t){if(0===t.length)throw new E.b("range-create-from-ranges-empty-array: At least one range has to be passed.");if(1==t.length)return this.createFromRange(t[0]);const e=t[0];t.sort((t,e)=>t.start.isAfter(e.start)?1:-1);const n=t.indexOf(e),o=new this(e.start,e.end);if(n>0)for(let e=n-1;t[e].end.isEqual(o.start);e++)o.start=Us.createFromPosition(t[e].start);for(let e=n+1;e<t.length&&t[e].start.isEqual(o.end);e++)o.end=Us.createFromPosition(t[e].end);return o}static fromJSON(t,e){return new this(Us.fromJSON(t.start,e),Us.fromJSON(t.end,e))}}class Ws{constructor(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._viewToModelLengthCallbacks=new Map,this._markerNameToElements=new Map,this.on("modelToViewPosition",(t,e)=>{if(e.viewPosition)return;const n=this._modelToViewMapping.get(e.modelPosition.parent);e.viewPosition=this._findPositionIn(n,e.modelPosition.offset)},{priority:"low"}),this.on("viewToModelPosition",(t,e)=>{if(e.modelPosition)return;let n=e.viewPosition.parent,o=this._viewToModelMapping.get(n);for(;!o;)n=n.parent,o=this._viewToModelMapping.get(n);const r=this._toModelOffset(e.viewPosition.parent,e.viewPosition.offset,n);e.modelPosition=Us.createFromParentAndOffset(o,r)},{priority:"low"})}bindElements(t,e){this._modelToViewMapping.set(t,e),this._viewToModelMapping.set(e,t)}unbindViewElement(t){const e=this.toModelElement(t);this._viewToModelMapping.delete(t),this._modelToViewMapping.get(e)==t&&this._modelToViewMapping.delete(e)}unbindModelElement(t){const e=this.toViewElement(t);this._modelToViewMapping.delete(t),this._viewToModelMapping.get(e)==t&&this._viewToModelMapping.delete(e)}bindElementToMarker(t,e){const n=this._markerNameToElements.get(e)||new Set;n.add(t),this._markerNameToElements.set(e,n)}unbindElementsFromMarkerName(t){this._markerNameToElements.delete(t)}clearBindings(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._markerNameToElements=new Map}toModelElement(t){return this._viewToModelMapping.get(t)}toViewElement(t){return this._modelToViewMapping.get(t)}toModelRange(t){return new $s(this.toModelPosition(t.start),this.toModelPosition(t.end))}toViewRange(t){return new Zo(this.toViewPosition(t.start),this.toViewPosition(t.end))}toModelPosition(t){const e={viewPosition:t,mapper:this};return this.fire("viewToModelPosition",e),e.modelPosition}toViewPosition(t,e={isPhantom:!1}){const n={modelPosition:t,mapper:this,isPhantom:e.isPhantom};return this.fire("modelToViewPosition",n),n.viewPosition}markerNameToElements(t){const e=this._markerNameToElements.get(t);if(!e)return null;const n=new Set;for(const t of e)if(t.is("attributeElement"))for(const e of t.getElementsWithSameId())n.add(e);else n.add(t);return n}registerViewToModelLength(t,e){this._viewToModelLengthCallbacks.set(t,e)}_toModelOffset(t,e,n){if(n!=t){return this._toModelOffset(t.parent,t.index,n)+this._toModelOffset(t,e,t)}if(t.is("text"))return e;let o=0;for(let n=0;n<e;n++)o+=this.getModelLength(t.getChild(n));return o}getModelLength(t){if(this._viewToModelLengthCallbacks.get(t.name)){return this._viewToModelLengthCallbacks.get(t.name)(t)}if(this._viewToModelMapping.has(t))return 1;if(t.is("text"))return t.data.length;if(t.is("uiElement"))return 0;{let e=0;for(const n of t.getChildren())e+=this.getModelLength(n);return e}}_findPositionIn(t,e){let n,o=0,r=0,i=0;if(t.is("text"))return new Jo(t,e);for(;r<e;)n=t.getChild(i),r+=o=this.getModelLength(n),i++;return r==e?this._moveViewPositionToTextNode(new Jo(t,i)):this._findPositionIn(n,e-(r-o))}_moveViewPositionToTextNode(t){const e=t.nodeBefore,n=t.nodeAfter;return e instanceof lo?new Jo(e,e.data.length):n instanceof lo?new Jo(n,0):t}}j(Ws,N);class Gs{constructor(){this._consumable=new Map,this._textProxyRegistry=new Map}add(t,e){e=Ks(e),t instanceof Bs&&(t=this._getSymbolForTextProxy(t)),this._consumable.has(t)||this._consumable.set(t,new Map),this._consumable.get(t).set(e,!0)}consume(t,e){return e=Ks(e),t instanceof Bs&&(t=this._getSymbolForTextProxy(t)),!!this.test(t,e)&&(this._consumable.get(t).set(e,!1),!0)}test(t,e){e=Ks(e),t instanceof Bs&&(t=this._getSymbolForTextProxy(t));const n=this._consumable.get(t);if(void 0===n)return null;const o=n.get(e);return void 0===o?null:o}revert(t,e){e=Ks(e),t instanceof Bs&&(t=this._getSymbolForTextProxy(t));const n=this.test(t,e);return!1===n?(this._consumable.get(t).set(e,!0),!0):!0!==n&&null}_getSymbolForTextProxy(t){let e=null;const n=this._textProxyRegistry.get(t.startOffset);if(n){const o=n.get(t.endOffset);o&&(e=o.get(t.parent))}return e||(e=this._addSymbolForTextProxy(t.startOffset,t.endOffset,t.parent)),e}_addSymbolForTextProxy(t,e,n){const o=Symbol("textProxySymbol");let r,i;return(r=this._textProxyRegistry.get(t))||(r=new Map,this._textProxyRegistry.set(t,r)),(i=r.get(e))||(i=new Map,r.set(e,i)),i.set(n,o),o}}function Ks(t){const e=t.split(":");return e.length>1?e[0]+":"+e[1]:e[0]}class Js{constructor(t={}){this.conversionApi=Fo({dispatcher:this},t)}convertChanges(t,e){for(const n of t.getMarkersToRemove())this.convertMarkerRemove(n.name,n.range,e);for(const n of t.getChanges())"insert"==n.type?this.convertInsert($s.createFromPositionAndShift(n.position,n.length),e):"remove"==n.type?this.convertRemove(n.position,n.length,n.name,e):this.convertAttribute(n.range,n.attributeKey,n.attributeOldValue,n.attributeNewValue,e);for(const n of t.getMarkersToAdd())this.convertMarkerAdd(n.name,n.range,e)}convertInsert(t,e){this.conversionApi.writer=e,this.conversionApi.consumable=this._createInsertConsumable(t);for(const e of t){const t=e.item,n={item:t,range:$s.createFromPositionAndShift(e.previousPosition,e.length)};this._testAndFire("insert",n);for(const e of t.getAttributeKeys())n.attributeKey=e,n.attributeOldValue=null,n.attributeNewValue=t.getAttribute(e),this._testAndFire(`attribute:${e}`,n)}this._clearConversionApi()}convertRemove(t,e,n,o){this.conversionApi.writer=o,this.fire("remove:"+n,{position:t,length:e},this.conversionApi),this._clearConversionApi()}convertAttribute(t,e,n,o,r){this.conversionApi.writer=r,this.conversionApi.consumable=this._createConsumableForRange(t,`attribute:${e}`);for(const r of t){const t={item:r.item,range:$s.createFromPositionAndShift(r.previousPosition,r.length),attributeKey:e,attributeOldValue:n,attributeNewValue:o};this._testAndFire(`attribute:${e}`,t)}this._clearConversionApi()}convertSelection(t,e,n){const o=Array.from(e.getMarkersAtPosition(t.getFirstPosition()));if(this.conversionApi.writer=n,this.conversionApi.consumable=this._createSelectionConsumable(t,o),this.fire("selection",{selection:t},this.conversionApi),t.isCollapsed){for(const e of o){const n=e.getRange();if(!Zs(t.getFirstPosition(),e,this.conversionApi.mapper))continue;const o={item:t,markerName:e.name,markerRange:n};this.conversionApi.consumable.test(t,"addMarker:"+e.name)&&this.fire("addMarker:"+e.name,o,this.conversionApi)}for(const e of t.getAttributeKeys()){const n={item:t,range:t.getFirstRange(),attributeKey:e,attributeOldValue:null,attributeNewValue:t.getAttribute(e)};this.conversionApi.consumable.test(t,"attribute:"+n.attributeKey)&&this.fire("attribute:"+n.attributeKey,n,this.conversionApi)}this._clearConversionApi()}}convertMarkerAdd(t,e,n){if(!e.root.document||"$graveyard"==e.root.rootName)return;this.conversionApi.writer=n;const o="addMarker:"+t;if(e.isCollapsed){const n=new Gs;return n.add(e,o),this.conversionApi.consumable=n,void this.fire(o,{markerName:t,markerRange:e},this.conversionApi)}this.conversionApi.consumable=this._createConsumableForRange(e,o);for(const n of e.getItems()){if(!this.conversionApi.consumable.test(n,o))continue;const r={item:n,range:$s.createOn(n),markerName:t,markerRange:e};this.fire(o,r,this.conversionApi)}this._clearConversionApi()}convertMarkerRemove(t,e,n){e.root.document&&"$graveyard"!=e.root.rootName&&(this.conversionApi.writer=n,this.fire("removeMarker:"+t,{markerName:t,markerRange:e},this.conversionApi),this._clearConversionApi())}_createInsertConsumable(t){const e=new Gs;for(const n of t){const t=n.item;e.add(t,"insert");for(const n of t.getAttributeKeys())e.add(t,"attribute:"+n)}return e}_createConsumableForRange(t,e){const n=new Gs;for(const o of t.getItems())n.add(o,e);return n}_createSelectionConsumable(t,e){const n=new Gs;n.add(t,"selection");for(const o of e)n.add(t,"addMarker:"+o.name);for(const e of t.getAttributeKeys())n.add(t,"attribute:"+e);return n}_testAndFire(t,e){if(!this.conversionApi.consumable.test(e.item,t))return;const n=e.item.name||"$text";this.fire(t+":"+n,e,this.conversionApi)}_clearConversionApi(){delete this.conversionApi.writer,delete this.conversionApi.consumable}}function Zs(t,e,n){const o=e.getRange(),r=Array.from(t.getAncestors());return r.shift(),r.reverse(),!r.some(t=>{if(o.containsItem(t)){return!!n.toViewElement(t).getCustomProperty("addHighlight")}})}j(Js,N);class Qs{constructor(t,e,n){this._lastRangeBackward=!1,this._ranges=[],this._attrs=new Map,t&&this.setTo(t,e,n)}get anchor(){if(this._ranges.length>0){const t=this._ranges[this._ranges.length-1];return this._lastRangeBackward?t.end:t.start}return null}get focus(){if(this._ranges.length>0){const t=this._ranges[this._ranges.length-1];return this._lastRangeBackward?t.start:t.end}return null}get isCollapsed(){return 1===this._ranges.length&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}isEqual(t){if(this.rangeCount!=t.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(t.anchor)||!this.focus.isEqual(t.focus))return!1;for(const e of this._ranges){let n=!1;for(const o of t._ranges)if(e.isEqual(o)){n=!0;break}if(!n)return!1}return!0}*getRanges(){for(const t of this._ranges)yield $s.createFromRange(t)}getFirstRange(){let t=null;for(const e of this._ranges)t&&!e.start.isBefore(t.start)||(t=e);return t?$s.createFromRange(t):null}getLastRange(){let t=null;for(const e of this._ranges)t&&!e.end.isAfter(t.end)||(t=e);return t?$s.createFromRange(t):null}getFirstPosition(){const t=this.getFirstRange();return t?Us.createFromPosition(t.start):null}getLastPosition(){const t=this.getLastRange();return t?Us.createFromPosition(t.end):null}setTo(t,e,n){if(null===t)this._setRanges([]);else if(t instanceof Qs)this._setRanges(t.getRanges(),t.isBackward);else if(t&&"function"==typeof t.getRanges)this._setRanges(t.getRanges(),t.isBackward);else if(t instanceof $s)this._setRanges([t],!!e&&!!e.backward);else if(t instanceof Us)this._setRanges([new $s(t)]);else if(t instanceof Ms){const o=!!n&&!!n.backward;let r;if("in"==e)r=$s.createIn(t);else if("on"==e)r=$s.createOn(t);else{if(void 0===e)throw new E.b("model-selection-setTo-required-second-parameter: selection.setTo requires the second parameter when the first parameter is a node.");r=$s.createCollapsedAt(t,e)}this._setRanges([r],o)}else{if(!fo(t))throw new E.b("model-selection-setTo-not-selectable: Cannot set selection to given place.");this._setRanges(t,e&&!!e.backward)}}_setRanges(t,e=!1){const n=(t=Array.from(t)).some(t=>{if(!(t instanceof $s))throw new E.b("model-selection-set-ranges-not-range: Selection range set to an object that is not an instance of model.Range.");return this._ranges.every(e=>!e.isEqual(t))});if(t.length!==this._ranges.length||n){this._removeAllRanges();for(const e of t)this._pushRange(e);this._lastRangeBackward=!!e,this.fire("change:range",{directChange:!0})}}setFocus(t,e){if(null===this.anchor)throw new E.b("model-selection-setFocus-no-ranges: Cannot set selection focus if there are no ranges in selection.");const n=Us.createAt(t,e);if("same"==n.compareWith(this.focus))return;const o=this.anchor;this._ranges.length&&this._popRange(),"before"==n.compareWith(o)?(this._pushRange(new $s(n,o)),this._lastRangeBackward=!0):(this._pushRange(new $s(o,n)),this._lastRangeBackward=!1),this.fire("change:range",{directChange:!0})}getAttribute(t){return this._attrs.get(t)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}hasAttribute(t){return this._attrs.has(t)}removeAttribute(t){this.hasAttribute(t)&&(this._attrs.delete(t),this.fire("change:attribute",{attributeKeys:[t],directChange:!0}))}setAttribute(t,e){this.getAttribute(t)!==e&&(this._attrs.set(t,e),this.fire("change:attribute",{attributeKeys:[t],directChange:!0}))}getSelectedElement(){if(1!==this.rangeCount)return null;const t=this.getFirstRange(),e=t.start.nodeAfter,n=t.end.nodeBefore;return e instanceof zs&&e==n?e:null}*getSelectedBlocks(){const t=new WeakSet;for(const e of this.getRanges()){const n=Xs(e.start,t);n&&(yield n);for(const n of e.getWalker())"elementEnd"==n.type&&Ys(n.item,t)&&(yield n.item);const o=Xs(e.end,t);o&&!e.end.isTouching(Us.createAt(o))&&(yield o)}}containsEntireContent(t=this.anchor.root){const e=Us.createAt(t),n=Us.createAt(t,"end");return e.isTouching(this.getFirstPosition())&&n.isTouching(this.getLastPosition())}_pushRange(t){this._checkRange(t),this._ranges.push($s.createFromRange(t))}_checkRange(t){for(let e=0;e<this._ranges.length;e++)if(t.isIntersecting(this._ranges[e]))throw new E.b("model-selection-range-intersects: Trying to add a range that intersects with another range in the selection.",{addedRange:t,intersectingRange:this._ranges[e]})}_removeAllRanges(){for(;this._ranges.length>0;)this._popRange()}_popRange(){this._ranges.pop()}}function Ys(t,e){return!e.has(t)&&(e.add(t),t.document.model.schema.isBlock(t)&&t.parent)}function Xs(t,e){const n=t.parent.getAncestors({parentFirst:!0,includeSelf:!0}),o=n.find(t=>Ys(t,e));return n.forEach(t=>e.add(t)),o}j(Qs,N);class ta extends $s{constructor(t,e){super(t,e),function(){this.listenTo(this.root.document.model,"applyOperation",(t,e)=>{const n=e[0];n.isDocumentOperation&&function(t){const e=this.getTransformedByOperation(t),n=$s.createFromRanges(e),o=!n.isEqual(this),r=function(t,e){switch(e.type){case"insert":return t.containsPosition(e.position);case"move":case"remove":case"reinsert":case"merge":return t.containsPosition(e.sourcePosition)||t.start.isEqual(e.sourcePosition)||t.containsPosition(e.targetPosition);case"split":return t.containsPosition(e.splitPosition)||t.containsPosition(e.insertionPosition)}return!1}(this,t);let i=null;if(o){"$graveyard"==n.root.rootName&&(i="remove"==t.type?t.sourcePosition:t.deletionPosition);const e=$s.createFromRange(this);this.start=n.start,this.end=n.end,this.fire("change:range",e,{deletionPosition:i})}else r&&this.fire("change:content",$s.createFromRange(this),{deletionPosition:i})}.call(this,n)},{priority:"low"})}.call(this)}detach(){this.stopListening()}}j(ta,N);const ea="selection:";class na{constructor(t){this._selection=new oa(t),this._selection.delegate("change:range").to(this),this._selection.delegate("change:attribute").to(this)}get isCollapsed(){return this._selection.isCollapsed}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get rangeCount(){return this._selection.rangeCount}get hasOwnRange(){return this._selection.hasOwnRange}get isBackward(){return this._selection.isBackward}get isGravityOverridden(){return this._selection.isGravityOverridden}get _ranges(){return this._selection._ranges}getRanges(){return this._selection.getRanges()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getSelectedBlocks(){return this._selection.getSelectedBlocks()}getSelectedElement(){return this._selection.getSelectedElement()}containsEntireContent(t){return this._selection.containsEntireContent(t)}destroy(){this._selection.destroy()}getAttributeKeys(){return this._selection.getAttributeKeys()}getAttributes(){return this._selection.getAttributes()}getAttribute(t){return this._selection.getAttribute(t)}hasAttribute(t){return this._selection.hasAttribute(t)}_setFocus(t,e){this._selection.setFocus(t,e)}_setTo(t,e,n){this._selection.setTo(t,e,n)}_setAttribute(t,e){this._selection.setAttribute(t,e)}_removeAttribute(t){this._selection.removeAttribute(t)}_getStoredAttributes(){return this._selection._getStoredAttributes()}_overrideGravity(){return this._selection.overrideGravity()}_restoreGravity(t){this._selection.restoreGravity(t)}static _getStoreAttributeKey(t){return ea+t}static _isStoreAttributeKey(t){return t.startsWith(ea)}}j(na,N);class oa extends Qs{constructor(t){super(),this._model=t.model,this._document=t,this._attributePriority=new Map,this._fixGraveyardRangesData=[],this._hasChangedRange=!1,this._overriddenGravityRegister=new Set,this.on("change:range",()=>{for(const t of this.getRanges())if(!this._document._validateSelectionRange(t))throw new E.b("document-selection-wrong-position: Range from document selection starts or ends at incorrect position.",{range:t})}),this.listenTo(this._document,"change",(t,e)=>{this._updateAttributes(!1),function(t,e){const n=t.document.differ;for(const o of n.getChanges()){if("insert"!=o.type)continue;const n=o.position.parent,r=o.length===n.maxOffset;r&&t.enqueueChange(e,t=>{const e=Array.from(n.getAttributeKeys()).filter(t=>t.startsWith(ea));for(const o of e)t.removeAttribute(o,n)})}}(this._model,e)}),this.listenTo(this._model,"applyOperation",()=>{for(;this._fixGraveyardRangesData.length;){const{liveRange:t,sourcePosition:e}=this._fixGraveyardRangesData.shift();this._fixGraveyardSelection(t,e)}this._hasChangedRange&&(this._hasChangedRange=!1,this.fire("change:range",{directChange:!1}))},{priority:"lowest"})}get isCollapsed(){return 0===this._ranges.length?this._document._getDefaultRange().isCollapsed:super.isCollapsed}get anchor(){return super.anchor||this._document._getDefaultRange().start}get focus(){return super.focus||this._document._getDefaultRange().end}get rangeCount(){return this._ranges.length?this._ranges.length:1}get hasOwnRange(){return this._ranges.length>0}get isGravityOverridden(){return!!this._overriddenGravityRegister.size}destroy(){for(let t=0;t<this._ranges.length;t++)this._ranges[t].detach();this.stopListening()}*getRanges(){this._ranges.length?yield*super.getRanges():yield this._document._getDefaultRange()}getFirstRange(){return super.getFirstRange()||this._document._getDefaultRange()}getLastRange(){return super.getLastRange()||this._document._getDefaultRange()}setTo(t,e,n){super.setTo(t,e,n),this._refreshAttributes()}setFocus(t,e){super.setFocus(t,e),this._refreshAttributes()}setAttribute(t,e){if(this._setAttribute(t,e)){const e=[t];this.fire("change:attribute",{attributeKeys:e,directChange:!0})}}removeAttribute(t){if(this._removeAttribute(t)){const e=[t];this.fire("change:attribute",{attributeKeys:e,directChange:!0})}}overrideGravity(){const t=R();return this._overriddenGravityRegister.add(t),1===this._overriddenGravityRegister.size&&this._refreshAttributes(),t}restoreGravity(t){if(!this._overriddenGravityRegister.has(t))throw new E.b("document-selection-gravity-wrong-restore: Attempting to restore the selection gravity for an unknown UID.",{uid:t});this._overriddenGravityRegister.delete(t),this.isGravityOverridden||this._refreshAttributes()}_refreshAttributes(){this._updateAttributes(!0)}_popRange(){this._ranges.pop().detach()}_pushRange(t){const e=this._prepareRange(t);e&&this._ranges.push(e)}_prepareRange(t){if(this._checkRange(t),t.root==this._document.graveyard)return void ps.a.warn("model-selection-range-in-graveyard: Trying to add a Range that is in the graveyard root. Range rejected.");const e=ta.createFromRange(t);return e.on("change:range",(t,n,o)=>{this._hasChangedRange=!0,e.root==this._document.graveyard&&this._fixGraveyardRangesData.push({liveRange:e,sourcePosition:o.deletionPosition})}),e}_updateAttributes(t){const e=Ns(this._getSurroundingAttributes()),n=Ns(this.getAttributes());if(t)this._attributePriority=new Map,this._attrs=new Map;else for(const[t,e]of this._attributePriority)"low"==e&&(this._attrs.delete(t),this._attributePriority.delete(t));this._setAttributesTo(e);const o=[];for(const[t,e]of this.getAttributes())n.has(t)&&n.get(t)===e||o.push(t);for(const[t]of n)this.hasAttribute(t)||o.push(t);o.length>0&&this.fire("change:attribute",{attributeKeys:o,directChange:!1})}_setAttribute(t,e,n=!0){const o=n?"normal":"low";return("low"!=o||"normal"!=this._attributePriority.get(t))&&(super.getAttribute(t)!==e&&(this._attrs.set(t,e),this._attributePriority.set(t,o),!0))}_removeAttribute(t,e=!0){const n=e?"normal":"low";return("low"!=n||"normal"!=this._attributePriority.get(t))&&(this._attributePriority.set(t,n),!!super.hasAttribute(t)&&(this._attrs.delete(t),!0))}_setAttributesTo(t){const e=new Set;for(const[e,n]of this.getAttributes())t.get(e)!==n&&this._removeAttribute(e,!1);for(const[n,o]of t){this._setAttribute(n,o,!1)&&e.add(n)}return e}*_getStoredAttributes(){const t=this.getFirstPosition().parent;if(this.isCollapsed&&t.isEmpty)for(const e of t.getAttributeKeys())if(e.startsWith(ea)){yield[e.substr(ea.length),t.getAttribute(e)]}}_getSurroundingAttributes(){const t=this.getFirstPosition(),e=this._model.schema;let n=null;if(this.isCollapsed){const e=t.textNode?t.textNode:t.nodeBefore,o=t.textNode?t.textNode:t.nodeAfter;if(this.isGravityOverridden||(n=ra(e)),n||(n=ra(o)),!this.isGravityOverridden&&!n){let t=e;for(;t&&!n;)n=ra(t=t.previousSibling)}if(!n){let t=o;for(;t&&!n;)n=ra(t=t.nextSibling)}n||(n=this._getStoredAttributes())}else{const t=this.getFirstRange();for(const o of t){if(o.item.is("element")&&e.isObject(o.item))break;"text"==o.type&&null===n&&(n=o.item.getAttributes())}}return n}_fixGraveyardSelection(t,e){const n=Us.createFromPosition(e),o=this._model.schema.getNearestSelectionRange(n),r=this._ranges.indexOf(t);if(this._ranges.splice(r,1),t.detach(),o){const t=this._prepareRange(o);this._ranges.splice(r,0,t)}}}function ra(t){return t instanceof Bs||t instanceof Vs?t.getAttributes():null}var ia=1,sa=4;var aa=function(t){return io(t,ia|sa)};function ca(t){return(t=aa(t)).view=da(t.view,"container"),e=>{e.on("insert:"+t.model,function(t){return(e,n,o)=>{const r=t(n.item,o.writer);if(!r)return;if(!o.consumable.consume(n.item,"insert"))return;const i=o.mapper.toViewPosition(n.range.start);o.mapper.bindElements(n.item,r),o.writer.insert(i,r)}}(t.view),{priority:t.converterPriority||"normal"})}}function la(t){let e="attribute:"+((t=aa(t)).model.key?t.model.key:t.model);if(t.model.name&&(e+=":"+t.model.name),t.model.values)for(const e of t.model.values)t.view[e]=da(t.view[e],"attribute");else t.view=da(t.view,"attribute");const n=ha(t);return o=>{o.on(e,function(t){return(e,n,o)=>{const r=t(n.attributeOldValue,o.writer),i=t(n.attributeNewValue,o.writer);if(!r&&!i)return;if(!o.consumable.consume(n.item,e.name))return;const s=o.writer,a=s.document.selection;if(n.item instanceof Qs||n.item instanceof na)s.wrap(a.getFirstRange(),i);else{let t=o.mapper.toViewRange(n.range);null!==n.attributeOldValue&&r&&(t=s.unwrap(t,r)),null!==n.attributeNewValue&&i&&s.wrap(t,i)}}}(n),{priority:t.converterPriority||"normal"})}}function ua(t){let e="attribute:"+((t=aa(t)).model.key?t.model.key:t.model);if(t.model.name&&(e+=":"+t.model.name),t.model.values)for(const e of t.model.values)t.view[e]=fa(t.view[e]);else t.view=fa(t.view);const n=ha(t);return o=>{o.on(e,function(t){return t=t||((t,e)=>({value:t,key:e.attributeKey})),(e,n,o)=>{const r=t(n.attributeOldValue,n),i=t(n.attributeNewValue,n);if(!r&&!i)return;if(!o.consumable.consume(n.item,e.name))return;const s=o.mapper.toViewElement(n.item),a=o.writer;if(null!==n.attributeOldValue&&r)if("class"==r.key){const t=Array.isArray(r.value)?r.value:[r.value];for(const e of t)a.removeClass(e,s)}else if("style"==r.key){const t=Object.keys(r.value);for(const e of t)a.removeStyle(e,s)}else a.removeAttribute(r.key,s);if(null!==n.attributeNewValue&&i)if("class"==i.key){const t=Array.isArray(i.value)?i.value:[i.value];for(const e of t)a.addClass(e,s)}else if("style"==i.key){const t=Object.keys(i.value);for(const e of t)a.setStyle(e,i.value[e],s)}else a.setAttribute(i.key,i.value,s)}}(n),{priority:t.converterPriority||"normal"})}}function da(t,e){return"function"==typeof t?t:(n,o)=>(function(t,e,n){"string"==typeof t&&(t={name:t});let o;const r=Object.assign({},t.attributes);if("container"==n)o=e.createContainerElement(t.name,r);else if("attribute"==n){const n={priority:t.priority||rr.DEFAULT_PRIORITY};o=e.createAttributeElement(t.name,r,n)}else o=e.createUIElement(t.name,r);if(t.styles){const n=Object.keys(t.styles);for(const r of n)e.setStyle(r,t.styles[r],o)}if(t.classes){const n=t.classes;if("string"==typeof n)e.addClass(n,o);else for(const t of n)e.addClass(t,o)}return o})(t,o,e)}function ha(t){return t.model.values?(e,n)=>{const o=t.view[e];return o?o(e,n):null}:t.view}function fa(t){return"string"==typeof t?e=>({key:t,value:e}):"object"==typeof t?t.value?()=>t:e=>({key:t.key,value:e}):t}class pa{constructor(t){this.model=t,this.view=new Ds,this.mapper=new Ws,this.downcastDispatcher=new Js({mapper:this.mapper});const e=this.model.document,n=e.selection,o=this.model.markers;this.listenTo(this.model,"_beforeChanges",()=>{this.view._renderingDisabled=!0},{priority:"highest"}),this.listenTo(this.model,"_afterChanges",()=>{this.view._renderingDisabled=!1,this.view.render()},{priority:"lowest"}),this.listenTo(e,"change",()=>{this.view.change(t=>{this.downcastDispatcher.convertChanges(e.differ,t),this.downcastDispatcher.convertSelection(n,o,t)})},{priority:"low"}),this.listenTo(this.view.document,"selectionChange",function(t,e){return(n,o)=>{const r=o.newSelection,i=new Qs,s=[];for(const t of r.getRanges())s.push(e.toModelRange(t));i.setTo(s,{backward:r.isBackward}),i.isEqual(t.document.selection)||t.change(t=>{t.setSelection(i)})}}(this.model,this.mapper)),this.downcastDispatcher.on("insert:$text",(t,e,n)=>{if(!n.consumable.consume(e.item,"insert"))return;const o=n.writer,r=n.mapper.toViewPosition(e.range.start),i=o.createText(e.item.data);o.insert(r,i)},{priority:"lowest"}),this.downcastDispatcher.on("remove",(t,e,n)=>{const o=n.mapper.toViewPosition(e.position),r=e.position.getShiftedBy(e.length),i=n.mapper.toViewPosition(r,{isPhantom:!0}),s=new Zo(o,i),a=n.writer.remove(s.getTrimmed());for(const t of Zo.createIn(a).getItems())n.mapper.unbindViewElement(t)},{priority:"low"}),this.downcastDispatcher.on("selection",(t,e,n)=>{const o=n.writer,r=o.document.selection;for(const t of r.getRanges())t.isCollapsed&&t.end.parent.document&&n.writer.mergeAttributes(t.start);o.setSelection(null)},{priority:"low"}),this.downcastDispatcher.on("selection",(t,e,n)=>{const o=e.selection;if(o.isCollapsed)return;if(!n.consumable.consume(o,"selection"))return;const r=[];for(const t of o.getRanges()){const e=n.mapper.toViewRange(t);r.push(e)}n.writer.setSelection(r,{backward:o.isBackward})},{priority:"low"}),this.downcastDispatcher.on("selection",(t,e,n)=>{const o=e.selection;if(!o.isCollapsed)return;if(!n.consumable.consume(o,"selection"))return;const r=n.writer,i=o.getFirstPosition(),s=n.mapper.toViewPosition(i),a=r.breakAttributes(s);r.setSelection(a)},{priority:"low"}),this.view.document.roots.bindTo(this.model.document.roots).using(t=>{if("$graveyard"==t.rootName)return null;const e=new Go(t.name);return e.rootName=t.rootName,e._document=this.view.document,this.mapper.bindElements(t,e),e})}destroy(){this.view.destroy(),this.stopListening()}}j(pa,Bo);class ma{constructor(t,e=[]){this._editor=t,this._availablePlugins=new Map,this._plugins=new Map;for(const t of e)this._availablePlugins.set(t,t),t.pluginName&&this._availablePlugins.set(t.pluginName,t)}*[Symbol.iterator](){for(const t of this._plugins)"function"==typeof t[0]&&(yield t)}get(t){return this._plugins.get(t)}load(t,e=[]){const n=this,o=this._editor,r=new Set,i=[],s=d(t),a=d(e),c=function(t){const e=[];for(const n of t)u(n)||e.push(n);return e.length?e:null}(t);if(c){const t="plugincollection-plugin-not-found: Some plugins are not available and could not be loaded.";return ps.a.error(t,{plugins:c}),Promise.reject(new E.b(t,{plugins:c}))}return Promise.all(s.map(l)).then(()=>i);function l(t){if(!a.includes(t)&&!n.get(t)&&!r.has(t))return function(t){return new Promise(s=>{r.add(t),t.requires&&t.requires.forEach(n=>{const o=u(n);if(e.includes(o))throw new E.b("plugincollection-required: Cannot load a plugin because one of its dependencies is listed inthe `removePlugins` option.",{plugin:o,requiredBy:t});l(o)});const a=new t(o);n._add(t,a),i.push(a),s()})}(t).catch(e=>{throw ps.a.error("plugincollection-load: It was not possible to load the plugin.",{plugin:t}),e})}function u(t){return"function"==typeof t?t:n._availablePlugins.get(t)}function d(t){return t.map(t=>u(t)).filter(t=>!!t)}}destroy(){const t=Array.from(this).map(([,t])=>t).filter(t=>"function"==typeof t.destroy).map(t=>t.destroy());return Promise.all(t)}_add(t,e){this._plugins.set(t,e);const n=t.pluginName;n&&(this._plugins.has(n)?ps.a.warn("plugincollection-plugin-name-conflict: Two plugins with the same name were loaded.",{pluginName:n,plugin1:this._plugins.get(n).constructor,plugin2:t}):this._plugins.set(n,e))}}class ga{constructor(){this._commands=new Map}add(t,e){this._commands.set(t,e)}get(t){return this._commands.get(t)}execute(t,...e){const n=this.get(t);if(!n)throw new E.b("commandcollection-command-not-found: Command does not exist.",{commandName:t});n.execute(...e)}*names(){yield*this._commands.keys()}*commands(){yield*this._commands.values()}[Symbol.iterator](){return this._commands[Symbol.iterator]()}destroy(){for(const t of this.commands())t.destroy()}}function ba(t,e){const n=Object.keys(window.CKEDITOR_TRANSLATIONS).length;return 1===n&&(t=Object.keys(window.CKEDITOR_TRANSLATIONS)[0]),0!==n&&function(t,e){return t in window.CKEDITOR_TRANSLATIONS&&e in window.CKEDITOR_TRANSLATIONS[t]}(t,e)?window.CKEDITOR_TRANSLATIONS[t][e].replace(/ \[context: [^\]]+\]$/,""):e.replace(/ \[context: [^\]]+\]$/,"")}window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={});class wa{constructor(t){this.language=t||"en",this.t=((...t)=>this._t(...t))}_t(t,e){let n=ba(this.language,t);return e&&(n=n.replace(/%(\d+)/g,(t,n)=>n<e.length?e[n]:t)),n}}class _a{constructor(){this._consumables=new Map}add(t,e){let n;t.is("text")||t.is("documentFragment")?this._consumables.set(t,!0):(this._consumables.has(t)?n=this._consumables.get(t):(n=new ka,this._consumables.set(t,n)),n.add(e))}test(t,e){const n=this._consumables.get(t);return void 0===n?null:t.is("text")||t.is("documentFragment")?n:n.test(e)}consume(t,e){return!!this.test(t,e)&&(t.is("text")||t.is("documentFragment")?this._consumables.set(t,!1):this._consumables.get(t).consume(e),!0)}revert(t,e){const n=this._consumables.get(t);void 0!==n&&(t.is("text")||t.is("documentFragment")?this._consumables.set(t,!0):n.revert(e))}static consumablesFromElement(t){const e={name:!0,attributes:[],classes:[],styles:[]},n=t.getAttributeKeys();for(const t of n)"style"!=t&&"class"!=t&&e.attributes.push(t);const o=t.getClassNames();for(const t of o)e.classes.push(t);const r=t.getStyleNames();for(const t of r)e.styles.push(t);return e}static createFrom(t,e){if(e||(e=new _a),t.is("text"))return e.add(t),e;t.is("element")&&e.add(t,_a.consumablesFromElement(t)),t.is("documentFragment")&&e.add(t);for(const n of t.getChildren())e=_a.createFrom(n,e);return e}}class ka{constructor(){this._canConsumeName=null,this._consumables={attributes:new Map,styles:new Map,classes:new Map}}add(t){t.name&&(this._canConsumeName=!0);for(const e in this._consumables)e in t&&this._add(e,t[e])}test(t){if(t.name&&!this._canConsumeName)return this._canConsumeName;for(const e in this._consumables)if(e in t){const n=this._test(e,t[e]);if(!0!==n)return n}return!0}consume(t){t.name&&(this._canConsumeName=!1);for(const e in this._consumables)e in t&&this._consume(e,t[e])}revert(t){t.name&&(this._canConsumeName=!0);for(const e in this._consumables)e in t&&this._revert(e,t[e])}_add(t,e){const n=le(e)?e:[e],o=this._consumables[t];for(const e of n){if("attributes"===t&&("class"===e||"style"===e))throw new E.b("viewconsumable-invalid-attribute: Classes and styles should be handled separately.");o.set(e,!0)}}_test(t,e){const n=le(e)?e:[e],o=this._consumables[t];for(const e of n)if("attributes"!==t||"class"!==e&&"style"!==e){const t=o.get(e);if(void 0===t)return null;if(!t)return!1}else{const t="class"==e?"classes":"styles",n=this._test(t,[...this._consumables[t].keys()]);if(!0!==n)return n}return!0}_consume(t,e){const n=le(e)?e:[e],o=this._consumables[t];for(const e of n)if("attributes"!==t||"class"!==e&&"style"!==e)o.set(e,!1);else{const t="class"==e?"classes":"styles";this._consume(t,[...this._consumables[t].keys()])}}_revert(t,e){const n=le(e)?e:[e],o=this._consumables[t];for(const e of n)if("attributes"!==t||"class"!==e&&"style"!==e){!1===o.get(e)&&o.set(e,!0)}else{const t="class"==e?"classes":"styles";this._revert(t,[...this._consumables[t].keys()])}}}class va{constructor(){this._sourceDefinitions={},this.decorate("checkChild"),this.decorate("checkAttribute"),this.on("checkAttribute",(t,e)=>{e[0]=new ya(e[0])},{priority:"highest"}),this.on("checkChild",(t,e)=>{e[0]=new ya(e[0]),e[1]=this.getDefinition(e[1])},{priority:"highest"})}register(t,e){if(this._sourceDefinitions[t])throw new E.b("schema-cannot-register-item-twice: A single item cannot be registered twice in the schema.",{itemName:t});this._sourceDefinitions[t]=[Object.assign({},e)],this._clearCache()}extend(t,e){if(!this._sourceDefinitions[t])throw new E.b("schema-cannot-extend-missing-item: Cannot extend an item which was not registered yet.",{itemName:t});this._sourceDefinitions[t].push(Object.assign({},e)),this._clearCache()}getDefinitions(){return this._compiledDefinitions||this._compile(),this._compiledDefinitions}getDefinition(t){let e;return e="string"==typeof t?t:t.is&&(t.is("text")||t.is("textProxy"))?"$text":t.name,this.getDefinitions()[e]}isRegistered(t){return!!this.getDefinition(t)}isBlock(t){const e=this.getDefinition(t);return!(!e||!e.isBlock)}isLimit(t){const e=this.getDefinition(t);return!!e&&!(!e.isLimit&&!e.isObject)}isObject(t){const e=this.getDefinition(t);return!(!e||!e.isObject)}checkChild(t,e){return!!e&&this._checkContextMatch(e,t)}checkAttribute(t,e){const n=this.getDefinition(t.last);return!!n&&n.allowAttributes.includes(e)}checkMerge(t,e=null){if(t instanceof Us){const e=t.nodeBefore,n=t.nodeAfter;if(!(e instanceof zs))throw new E.b("schema-check-merge-no-element-before: The node before the merge position must be an element.");if(!(n instanceof zs))throw new E.b("schema-check-merge-no-element-after: The node after the merge position must be an element.");return this.checkMerge(e,n)}for(const n of e.getChildren())if(!this.checkChild(t,n))return!1;return!0}addChildCheck(t){this.on("checkChild",(e,[n,o])=>{if(!o)return;const r=t(n,o);"boolean"==typeof r&&(e.stop(),e.return=r)},{priority:"high"})}addAttributeCheck(t){this.on("checkAttribute",(e,[n,o])=>{const r=t(n,o);"boolean"==typeof r&&(e.stop(),e.return=r)},{priority:"high"})}getLimitElement(t){let e;if(t instanceof Us)e=t.parent;else{e=(t instanceof $s?[t]:Array.from(t.getRanges())).reduce((t,e)=>{const n=e.getCommonAncestor();return t?t.getCommonAncestor(n,{includeSelf:!0}):n},null)}for(;!this.isLimit(e)&&e.parent;)e=e.parent;return e}checkAttributeInSelection(t,e){if(t.isCollapsed){const n=[...t.getFirstPosition().getAncestors(),new Vs("",t.getAttributes())];return this.checkAttribute(n,e)}{const n=t.getRanges();for(const t of n)for(const n of t)if(this.checkAttribute(n.item,e))return!0}return!1}*getValidRanges(t,e){t=function*(t){for(const e of t)yield*e.getMinimalFlatRanges()}(t);for(const n of t)yield*this._getValidRangesForRange(n,e)}*_getValidRangesForRange(t,e){let n=t.start,o=t.start;for(const r of t.getItems({shallow:!0}))r.is("element")&&(yield*this._getValidRangesForRange($s.createIn(r),e)),this.checkAttribute(r,e)||(n.isEqual(o)||(yield new $s(n,o)),n=Us.createAfter(r)),o=Us.createAfter(r);n.isEqual(o)||(yield new $s(n,o))}getNearestSelectionRange(t,e="both"){if(this.checkChild(t,"$text"))return new $s(t);let n,o;"both"!=e&&"backward"!=e||(n=new qs({startPosition:t,direction:"backward"})),"both"!=e&&"forward"!=e||(o=new qs({startPosition:t}));for(const t of function*(t,e){let n=!1;for(;!n;){if(n=!0,t){const e=t.next();e.done||(n=!1,yield{walker:t,value:e.value})}if(e){const t=e.next();t.done||(n=!1,yield{walker:e,value:t.value})}}}(n,o)){const e=t.walker==n?"elementEnd":"elementStart",o=t.value;if(o.type==e&&this.isObject(o.item))return $s.createOn(o.item);if(this.checkChild(o.nextPosition,"$text"))return new $s(o.nextPosition)}return null}findAllowedParent(t,e){let n=e.parent;for(;n;){if(this.checkChild(n,t))return n;if(this.isLimit(n))return null;n=n.parent}return null}removeDisallowedAttributes(t,e){for(const n of t){for(const t of n.getAttributeKeys())this.checkAttribute(n,t)||e.removeAttribute(t,n);n.is("element")&&this.removeDisallowedAttributes(n.getChildren(),e)}}_clearCache(){this._compiledDefinitions=null}_compile(){const t={},e=this._sourceDefinitions,n=Object.keys(e);for(const o of n)t[o]=xa(e[o],o);for(const e of n)Ca(t,e);for(const e of n)Aa(t,e);for(const e of n)Pa(t,e),Ta(t,e);for(const e of n)Ea(t,e),Sa(t,e);this._compiledDefinitions=t}_checkContextMatch(t,e,n=e.length-1){const o=e.getItem(n);if(t.allowIn.includes(o.name)){if(0==n)return!0;{const t=this.getDefinition(o);return this._checkContextMatch(t,e,n-1)}}return!1}}j(va,Bo);class ya{constructor(t){if(t instanceof ya)return t;"string"==typeof t?t=[t]:Array.isArray(t)||(t=t.getAncestors({includeSelf:!0})),t[0]&&"string"!=typeof t[0]&&t[0].is("documentFragment")&&t.shift(),this._items=t.map(Ia)}get length(){return this._items.length}get last(){return this._items[this._items.length-1]}[Symbol.iterator](){return this._items[Symbol.iterator]()}push(t){const e=new ya([t]);return e._items=[...this._items,...e._items],e}getItem(t){return this._items[t]}*getNames(){yield*this._items.map(t=>t.name)}endsWith(t){return Array.from(this.getNames()).join(" ").endsWith(t)}}function xa(t,e){const n={name:e,allowIn:[],allowContentOf:[],allowWhere:[],allowAttributes:[],allowAttributesOf:[],inheritTypesFrom:[]};return function(t,e){for(const n of t){const t=Object.keys(n).filter(t=>t.startsWith("is"));for(const o of t)e[o]=n[o]}}(t,n),Oa(t,n,"allowIn"),Oa(t,n,"allowContentOf"),Oa(t,n,"allowWhere"),Oa(t,n,"allowAttributes"),Oa(t,n,"allowAttributesOf"),Oa(t,n,"inheritTypesFrom"),function(t,e){for(const n of t){const t=n.inheritAllFrom;t&&(e.allowContentOf.push(t),e.allowWhere.push(t),e.allowAttributesOf.push(t),e.inheritTypesFrom.push(t))}}(t,n),n}function Ca(t,e){for(const n of t[e].allowContentOf)if(t[n]){Ra(t,n).forEach(t=>{t.allowIn.push(e)})}delete t[e].allowContentOf}function Aa(t,e){for(const n of t[e].allowWhere){const o=t[n];if(o){const n=o.allowIn;t[e].allowIn.push(...n)}}delete t[e].allowWhere}function Pa(t,e){for(const n of t[e].allowAttributesOf){const o=t[n];if(o){const n=o.allowAttributes;t[e].allowAttributes.push(...n)}}delete t[e].allowAttributesOf}function Ta(t,e){const n=t[e];for(const e of n.inheritTypesFrom){const o=t[e];if(o){const t=Object.keys(o).filter(t=>t.startsWith("is"));for(const e of t)e in n||(n[e]=o[e])}}delete n.inheritTypesFrom}function Ea(t,e){const n=t[e],o=n.allowIn.filter(e=>t[e]);n.allowIn=Array.from(new Set(o))}function Sa(t,e){const n=t[e];n.allowAttributes=Array.from(new Set(n.allowAttributes))}function Oa(t,e,n){for(const o of t)"string"==typeof o[n]?e[n].push(o[n]):Array.isArray(o[n])&&e[n].push(...o[n])}function Ra(t,e){const n=t[e];return function(t){return Object.keys(t).map(e=>t[e])}(t).filter(t=>t.allowIn.includes(n.name))}function Ia(t){return"string"==typeof t?{name:t,*getAttributeKeys(){},getAttribute(){}}:{name:t.is("element")?t.name:"$text",*getAttributeKeys(){yield*t.getAttributeKeys()},getAttribute:e=>t.getAttribute(e)}}class Fa{constructor(t={}){this._removeIfEmpty=new Set,this._modelCursor=null,this.conversionApi=Object.assign({},t),this.conversionApi.convertItem=this._convertItem.bind(this),this.conversionApi.convertChildren=this._convertChildren.bind(this),this.conversionApi.splitToAllowedParent=this._splitToAllowedParent.bind(this)}convert(t,e,n=["$root"]){this.fire("viewCleanup",t),this._modelCursor=function(t,e){let n;for(const o of new ya(t)){const t={};for(const e of o.getAttributeKeys())t[e]=o.getAttribute(e);const r=e.createElement(o.name,t);n&&e.append(r,n),n=Us.createAt(r)}return n}(n,e),this.conversionApi.writer=e,this.conversionApi.consumable=_a.createFrom(t),this.conversionApi.store={};const{modelRange:o}=this._convertItem(t,this._modelCursor),r=e.createDocumentFragment();if(o){this._removeEmptyElements();for(const t of Array.from(this._modelCursor.parent.getChildren()))e.append(t,r);r.markers=function(t,e){const n=new Set,o=new Map,r=$s.createIn(t).getItems();for(const t of r)"$marker"==t.name&&n.add(t);for(const t of n){const n=t.getAttribute("data-name"),r=Us.createBefore(t);o.has(n)?o.get(n).end=Us.createFromPosition(r):o.set(n,new $s(Us.createFromPosition(r))),e.remove(t)}return o}(r,e)}return this._modelCursor=null,this._removeIfEmpty.clear(),this.conversionApi.writer=null,this.conversionApi.store=null,r}_convertItem(t,e){const n=Object.assign({viewItem:t,modelCursor:e,modelRange:null});if(t.is("element")?this.fire("element:"+t.name,n,this.conversionApi):t.is("text")?this.fire("text",n,this.conversionApi):this.fire("documentFragment",n,this.conversionApi),n.modelRange&&!(n.modelRange instanceof $s))throw new E.b("view-conversion-dispatcher-incorrect-result: Incorrect conversion result was dropped.");return{modelRange:n.modelRange,modelCursor:n.modelCursor}}_convertChildren(t,e){const n=new $s(e);let o=e;for(const e of Array.from(t.getChildren())){const t=this._convertItem(e,o);t.modelRange instanceof $s&&(n.end=t.modelRange.end,o=t.modelCursor)}return{modelRange:n,modelCursor:o}}_splitToAllowedParent(t,e){const n=this.conversionApi.schema.findAllowedParent(t,e);if(!n)return null;if(n===e.parent)return{position:e};if(this._modelCursor.parent.getAncestors().includes(n))return null;const o=this.conversionApi.writer.split(e,n);for(const t of o.range.getPositions())t.isEqual(o.position)||this._removeIfEmpty.add(t.parent);return{position:o.position,cursorParent:o.range.end.parent}}_removeEmptyElements(){let t=!1;for(const e of this._removeIfEmpty)e.isEmpty&&(this.conversionApi.writer.remove(e),this._removeIfEmpty.delete(e),t=!0);t&&this._removeEmptyElements()}}function Da(t){const e=function(t){const e=new po(t.view);return(n,o,r)=>{const i=e.match(o.viewItem);if(!i)return;i.match.name=!0;const s=function(t,e,n){return t instanceof Function?t(e,n):n.createElement(t)}(t.model,o.viewItem,r.writer);if(!s)return;if(!r.consumable.test(o.viewItem,i.match))return;const a=r.splitToAllowedParent(s,o.modelCursor);if(!a)return;r.writer.insert(s,a.position);const c=r.convertChildren(o.viewItem,Us.createAt(s));r.consumable.consume(o.viewItem,i.match),o.modelRange=new $s(Us.createBefore(s),Us.createAfter(c.modelCursor.parent)),a.cursorParent?o.modelCursor=Us.createAt(a.cursorParent):o.modelCursor=o.modelRange.end}}(t=aa(t)),n=Va(t),o=n?"element:"+n:"element";return n=>{n.on(o,e,{priority:t.converterPriority||"normal"})}}function Na(t){Ba(t=aa(t));const e=La(t,!1),n=Va(t),o=n?"element:"+n:"element";return n=>{n.on(o,e,{priority:t.converterPriority||"normal"})}}function Ma(t){let e=null;("string"==typeof(t=aa(t)).view||t.view.key)&&(e=function(t){"string"==typeof t.view&&(t.view={key:t.view});const e=t.view.key;let n;if("class"==e||"style"==e){const o="class"==e?"classes":"styles";n={[o]:t.view.value}}else{const o=void 0===t.view.value?/[\s\S]*/:t.view.value;n={attributes:{[e]:o}}}t.view.name&&(n.name=t.view.name);return t.view=n,e}(t)),Ba(t,e);const n=La(t,!0);return e=>{e.on("element",n,{priority:t.converterPriority||"low"})}}function Va(t){return"string"==typeof t.view?t.view:"object"==typeof t.view&&"string"==typeof t.view.name?t.view.name:null}function Ba(t,e=null){const n=null===e||(t=>t.getAttribute(e)),o="object"!=typeof t.model?t.model:t.model.key,r="object"!=typeof t.model||void 0===t.model.value?n:t.model.value;t.model={key:o,value:r}}function La(t,e){const n=new po(t.view);return(o,r,i)=>{const s=n.match(r.viewItem);if(!s)return;const a=t.model.key,c="function"==typeof t.model.value?t.model.value(r.viewItem):t.model.value;null!==c&&(!function(t){if("object"==typeof t.view&&!Va(t))return!1;return!t.view.classes&&!t.view.attributes&&!t.view.styles}(t)?delete s.match.name:s.match.name=!0,i.consumable.test(r.viewItem,s.match)&&(r.modelRange||(r=Object.assign(r,i.convertChildren(r.viewItem,r.modelCursor))),function(t,e,n,o){let r=!1;for(const i of Array.from(t.getItems({shallow:n})))o.schema.checkAttribute(i,e.key)&&(o.writer.setAttribute(e.key,e.value,i),r=!0);return r}(r.modelRange,{key:a,value:c},e,i)&&i.consumable.consume(r.viewItem,s.match)))}}j(Fa,N);class za{constructor(t,e){this.model=t,this.processor=e,this.mapper=new Ws,this.downcastDispatcher=new Js({mapper:this.mapper}),this.downcastDispatcher.on("insert:$text",(t,e,n)=>{if(!n.consumable.consume(e.item,"insert"))return;const o=n.writer,r=n.mapper.toViewPosition(e.range.start),i=o.createText(e.item.data);o.insert(r,i)},{priority:"lowest"}),this.upcastDispatcher=new Fa({schema:t.schema}),this.upcastDispatcher.on("text",(t,e,n)=>{if(n.schema.checkChild(e.modelCursor,"$text")&&n.consumable.consume(e.viewItem)){const t=n.writer.createText(e.viewItem.data);n.writer.insert(t,e.modelCursor),e.modelRange=$s.createFromPositionAndShift(e.modelCursor,t.offsetSize),e.modelCursor=e.modelRange.end}},{priority:"lowest"}),this.upcastDispatcher.on("element",(t,e,n)=>{if(!e.modelRange&&n.consumable.consume(e.viewItem,{name:!0})){const{modelRange:t,modelCursor:o}=n.convertChildren(e.viewItem,e.modelCursor);e.modelRange=t,e.modelCursor=o}},{priority:"lowest"}),this.upcastDispatcher.on("documentFragment",(t,e,n)=>{if(!e.modelRange&&n.consumable.consume(e.viewItem,{name:!0})){const{modelRange:t,modelCursor:o}=n.convertChildren(e.viewItem,e.modelCursor);e.modelRange=t,e.modelCursor=o}},{priority:"lowest"}),this.decorate("init")}get(t="main"){return this.stringify(this.model.document.getRoot(t))}stringify(t){const e=this.toView(t);return this.processor.toData(e)}toView(t){this.mapper.clearBindings();const e=$s.createIn(t),n=new kr,o=new vr(new nr);if(this.mapper.bindElements(t,n),this.downcastDispatcher.convertInsert(e,o),!t.is("documentFragment")){const e=function(t){const e=[],n=t.root.document;if(!n)return[];const o=$s.createIn(t);for(const t of n.model.markers){const n=o.getIntersection(t.getRange());n&&e.push([t.name,n])}return e}(t);for(const[t,n]of e)this.downcastDispatcher.convertMarkerAdd(t,n,o)}return n}init(t,e="main"){if(this.model.document.version)throw new E.b("datacontroller-init-document-not-empty: Trying to set initial data to not empty document.");const n=this.model.document.getRoot(e);return this.model.enqueueChange("transparent",e=>{e.insert(this.parse(t,n),n)}),Promise.resolve()}set(t,e="main"){const n=this.model.document.getRoot(e);this.model.enqueueChange("transparent",e=>{e.setSelection(null),e.removeSelectionAttribute(this.model.document.selection.getAttributeKeys()),e.remove($s.createIn(n)),e.insert(this.parse(t,n),n)})}parse(t,e="$root"){const n=this.processor.toView(t);return this.toModel(n,e)}toModel(t,e="$root"){return this.model.change(n=>this.upcastDispatcher.convert(t,n,e))}destroy(){}}j(za,Bo);class qa{constructor(){this._dispatchersGroups=new Map}register(t,e){if(this._dispatchersGroups.has(t))throw new E.b("conversion-register-group-exists: Trying to register a group name that was already registered.");this._dispatchersGroups.set(t,e)}for(t){const e=this._getDispatchers(t);return{add(t){return function(t,e){for(const n of t)e(n)}(e,t),this}}}elementToElement(t){this.for("downcast").add(ca(t));for(const{model:e,view:n}of ja(t))this.for("upcast").add(Da({model:e,view:n,converterPriority:t.converterPriority}))}attributeToElement(t){this.for("downcast").add(la(t));for(const{model:e,view:n}of ja(t))this.for("upcast").add(Na({view:n,model:e,priority:t.priority}))}attributeToAttribute(t){this.for("downcast").add(ua(t));for(const{model:e,view:n}of ja(t))this.for("upcast").add(Ma({view:n,model:e}))}_getDispatchers(t){const e=this._dispatchersGroups.get(t);if(!e)throw new E.b("conversion-for-unknown-group: Trying to add a converter to an unknown dispatchers group.");return e}}function*ja(t){if(t.model.values)for(const e of t.model.values){yield*Ha({key:t.model.key,value:e},t.view[e],t.upcastAlso?t.upcastAlso[e]:void 0)}else yield*Ha(t.model,t.view,t.upcastAlso)}function*Ha(t,e,n){if(yield{model:t,view:e},n){n=Array.isArray(n)?n:[n];for(const e of n)yield{model:t,view:e}}}class Ua{constructor(t="default"){this.operations=[],this.type=t}get baseVersion(){for(const t of this.operations)if(null!==t.baseVersion)return t.baseVersion;return null}addOperation(t){return t.batch=this,this.operations.push(t),t}}class $a{constructor(t){this.baseVersion=t,this.isDocumentOperation=null!==this.baseVersion,this.batch=null}_validate(){}toJSON(){const t=Object.assign({},this);return t.__className=this.constructor.className,delete t.batch,delete t.isDocumentOperation,t}static get className(){return"Operation"}static fromJSON(t){return new this(t.baseVersion)}}class Wa{constructor(t){this.markers=new Map,this._children=new Ls,t&&this._insertChild(0,t)}[Symbol.iterator](){return this.getChildren()}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}get root(){return this}get parent(){return null}is(t){return"documentFragment"==t}getChild(t){return this._children.getNode(t)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(t){return this._children.getNodeIndex(t)}getChildStartOffset(t){return this._children.getNodeStartOffset(t)}getPath(){return[]}getNodeByPath(t){let e=this;for(const n of t)e=e.getChild(e.offsetToIndex(n));return e}offsetToIndex(t){return this._children.offsetToIndex(t)}toJSON(){const t=[];for(const e of this._children)t.push(e.toJSON());return t}static fromJSON(t){const e=[];for(const n of t)n.name?e.push(zs.fromJSON(n)):e.push(Vs.fromJSON(n));return new Wa(e)}_appendChild(t){this._insertChild(this.childCount,t)}_insertChild(t,e){const n=function(t){if("string"==typeof t)return[new Vs(t)];fo(t)||(t=[t]);return Array.from(t).map(t=>"string"==typeof t?new Vs(t):t instanceof Bs?new Vs(t.data,t.getAttributes()):t)}(e);for(const t of n)null!==t.parent&&t._remove(),t.parent=this;this._children._insertNodes(t,n)}_removeChildren(t,e=1){const n=this._children._removeNodes(t,e);for(const t of n)t.parent=null;return n}}function Ga(t,e){const n=(e=Za(e)).reduce((t,e)=>t+e.offsetSize,0),o=t.parent;Ya(t);const r=t.index;return o._insertChild(r,e),Qa(o,r+e.length),Qa(o,r),new $s(t,t.getShiftedBy(n))}function Ka(t){if(!t.isFlat)throw new E.b("operation-utils-remove-range-not-flat: Trying to remove a range which starts and ends in different element.");const e=t.start.parent;Ya(t.start),Ya(t.end);const n=e._removeChildren(t.start.index,t.end.index-t.start.index);return Qa(e,t.start.index),n}function Ja(t,e){if(!t.isFlat)throw new E.b("operation-utils-move-range-not-flat: Trying to move a range which starts and ends in different element.");const n=Ka(t);return Ga(e=e._getTransformedByDeletion(t.start,t.end.offset-t.start.offset),n)}function Za(t){const e=[];t instanceof Array||(t=[t]);for(let n=0;n<t.length;n++)if("string"==typeof t[n])e.push(new Vs(t[n]));else if(t[n]instanceof Bs)e.push(new Vs(t[n].data,t[n].getAttributes()));else if(t[n]instanceof Wa||t[n]instanceof Ls)for(const o of t[n])e.push(o);else t[n]instanceof Ms&&e.push(t[n]);for(let t=1;t<e.length;t++){const n=e[t],o=e[t-1];n instanceof Vs&&o instanceof Vs&&Xa(n,o)&&(e.splice(t-1,2,new Vs(o.data+n.data,o.getAttributes())),t--)}return e}function Qa(t,e){const n=t.getChild(e-1),o=t.getChild(e);if(n&&o&&n.is("text")&&o.is("text")&&Xa(n,o)){const r=new Vs(n.data+o.data,n.getAttributes());t._removeChildren(e-1,2),t._insertChild(e-1,r)}}function Ya(t){const e=t.textNode,n=t.parent;if(e){const o=t.offset-e.startOffset,r=e.index;n._removeChildren(r,1);const i=new Vs(e.data.substr(0,o),e.getAttributes()),s=new Vs(e.data.substr(o),e.getAttributes());n._insertChild(r,[i,s])}}function Xa(t,e){const n=t.getAttributes(),o=e.getAttributes();for(const t of n){if(t[1]!==e.getAttribute(t[0]))return!1;o.next()}return o.next().done}var tc=function(t,e){return Gi(t,e)};class ec extends $a{constructor(t,e,n,o,r){super(r),this.range=$s.createFromRange(t),this.key=e,this.oldValue=void 0===n?null:n,this.newValue=void 0===o?null:o}get type(){return null===this.oldValue?"addAttribute":null===this.newValue?"removeAttribute":"changeAttribute"}clone(){return new ec(this.range,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new ec(this.range,this.key,this.newValue,this.oldValue,this.baseVersion+1)}toJSON(){const t=super.toJSON();return t.range=this.range.toJSON(),t}_validate(){if(!this.range.isFlat)throw new E.b("attribute-operation-range-not-flat: The range to change is not flat.");for(const t of this.range.getItems({shallow:!0})){if(null!==this.oldValue&&!tc(t.getAttribute(this.key),this.oldValue))throw new E.b("attribute-operation-wrong-old-value: Changed node has different attribute value than operation's old attribute value.",{item:t,key:this.key,value:this.oldValue});if(null===this.oldValue&&null!==this.newValue&&t.hasAttribute(this.key))throw new E.b("attribute-operation-attribute-exists: The attribute with given key already exists.",{node:t,key:this.key})}}_execute(){tc(this.oldValue,this.newValue)||function(t,e,n){Ya(t.start),Ya(t.end);for(const o of t.getItems({shallow:!0})){const t=o.is("textProxy")?o.textNode:o;null!==n?t._setAttribute(e,n):t._removeAttribute(e),Qa(t.parent,t.index)}Qa(t.end.parent,t.end.index)}(this.range,this.key,this.newValue)}static get className(){return"AttributeOperation"}static fromJSON(t,e){return new ec($s.fromJSON(t.range,e),t.key,t.oldValue,t.newValue,t.baseVersion)}}class nc extends $a{constructor(t,e){super(null),this.sourcePosition=Us.createFromPosition(t),this.howMany=e}get type(){return"detach"}toJSON(){const t=super.toJSON();return t.sourcePosition=this.sourcePosition.toJSON(),t}_validate(){if(this.sourcePosition.root.document)throw new E.b("detach-operation-on-document-node: Cannot detach document node.")}_execute(){Ka($s.createFromPositionAndShift(this.sourcePosition,this.howMany))}static get className(){return"DetachOperation"}}class oc extends $a{constructor(t,e,n,o){super(o),this.sourcePosition=Us.createFromPosition(t),this.sourcePosition.stickiness="toNext",this.howMany=e,this.targetPosition=Us.createFromPosition(n),this.targetPosition.stickiness="toNone"}get type(){return"$graveyard"==this.targetPosition.root.rootName?"remove":"$graveyard"==this.sourcePosition.root.rootName?"reinsert":"move"}clone(){return new this.constructor(this.sourcePosition,this.howMany,this.targetPosition,this.baseVersion)}getMovedRangeStart(){return this.targetPosition._getTransformedByDeletion(this.sourcePosition,this.howMany)}getReversed(){const t=this.sourcePosition._getTransformedByInsertion(this.targetPosition,this.howMany);return new this.constructor(this.getMovedRangeStart(),this.howMany,t,this.baseVersion+1)}_validate(){const t=this.sourcePosition.parent,e=this.targetPosition.parent,n=this.sourcePosition.offset,o=this.targetPosition.offset;if(!t||!e)throw new E.b("move-operation-position-invalid: Source position or target position is invalid.");if(n+this.howMany>t.maxOffset)throw new E.b("move-operation-nodes-do-not-exist: The nodes which should be moved do not exist.");if(t===e&&n<o&&o<n+this.howMany)throw new E.b("move-operation-range-into-itself: Trying to move a range of nodes to the inside of that range.");if(this.sourcePosition.root==this.targetPosition.root&&"prefix"==H(this.sourcePosition.getParentPath(),this.targetPosition.getParentPath())){const t=this.sourcePosition.path.length-1;if(this.targetPosition.path[t]>=n&&this.targetPosition.path[t]<n+this.howMany)throw new E.b("move-operation-node-into-itself: Trying to move a range of nodes into one of nodes from that range.")}}_execute(){Ja($s.createFromPositionAndShift(this.sourcePosition,this.howMany),this.targetPosition)}toJSON(){const t=super.toJSON();return t.sourcePosition=this.sourcePosition.toJSON(),t.targetPosition=this.targetPosition.toJSON(),t}static get className(){return"MoveOperation"}static fromJSON(t,e){const n=Us.fromJSON(t.sourcePosition,e),o=Us.fromJSON(t.targetPosition,e);return new this(n,t.howMany,o,t.baseVersion)}}class rc extends $a{constructor(t,e,n){super(n),this.position=Us.createFromPosition(t),this.position.stickiness="toNone",this.nodes=new Ls(Za(e)),this.shouldReceiveAttributes=!1}get type(){return"insert"}get howMany(){return this.nodes.maxOffset}clone(){const t=new Ls([...this.nodes].map(t=>t._clone(!0))),e=new rc(this.position,t,this.baseVersion);return e.shouldReceiveAttributes=this.shouldReceiveAttributes,e}getReversed(){const t=this.position.root.document.graveyard,e=new Us(t,[0]);return new oc(this.position,this.nodes.maxOffset,e,this.baseVersion+1)}_validate(){const t=this.position.parent;if(!t||t.maxOffset<this.position.offset)throw new E.b("insert-operation-position-invalid: Insertion position is invalid.")}_execute(){const t=this.nodes;this.nodes=new Ls([...t].map(t=>t._clone(!0))),Ga(this.position,t)}toJSON(){const t=super.toJSON();return t.position=this.position.toJSON(),t.nodes=this.nodes.toJSON(),t}static get className(){return"InsertOperation"}static fromJSON(t,e){const n=[];for(const e of t.nodes)e.name?n.push(zs.fromJSON(e)):n.push(Vs.fromJSON(e));const o=new rc(Us.fromJSON(t.position,e),n,t.baseVersion);return o.shouldReceiveAttributes=t.shouldReceiveAttributes,o}}class ic extends $a{constructor(t,e,n,o,r,i){super(i),this.name=t,this.oldRange=e?$s.createFromRange(e):null,this.newRange=n?$s.createFromRange(n):null,this.affectsData=r,this._markers=o}get type(){return"marker"}clone(){return new ic(this.name,this.oldRange,this.newRange,this._markers,this.affectsData,this.baseVersion)}getReversed(){return new ic(this.name,this.newRange,this.oldRange,this._markers,this.affectsData,this.baseVersion+1)}_execute(){const t=this.newRange?"_set":"_remove";this._markers[t](this.name,this.newRange,!0,this.affectsData)}toJSON(){const t=super.toJSON();return this.oldRange&&(t.oldRange=this.oldRange.toJSON()),this.newRange&&(t.newRange=this.newRange.toJSON()),delete t._markers,t}static get className(){return"MarkerOperation"}static fromJSON(t,e){return new ic(t.name,t.oldRange?$s.fromJSON(t.oldRange,e):null,t.newRange?$s.fromJSON(t.newRange,e):null,e.model.markers,t.affectsData,t.baseVersion)}}class sc extends $a{constructor(t,e,n,o){super(o),this.position=t,this.position.stickiness="toNext",this.oldName=e,this.newName=n}get type(){return"rename"}clone(){return new sc(Us.createFromPosition(this.position),this.oldName,this.newName,this.baseVersion)}getReversed(){return new sc(Us.createFromPosition(this.position),this.newName,this.oldName,this.baseVersion+1)}_validate(){const t=this.position.nodeAfter;if(!(t instanceof zs))throw new E.b("rename-operation-wrong-position: Given position is invalid or node after it is not an instance of Element.");if(t.name!==this.oldName)throw new E.b("rename-operation-wrong-name: Element to change has different name than operation's old name.")}_execute(){this.position.nodeAfter.name=this.newName}toJSON(){const t=super.toJSON();return t.position=this.position.toJSON(),t}static get className(){return"RenameOperation"}static fromJSON(t,e){return new sc(Us.fromJSON(t.position,e),t.oldName,t.newName,t.baseVersion)}}class ac extends $a{constructor(t,e,n,o,r){super(r),this.root=t,this.key=e,this.oldValue=n,this.newValue=o}get type(){return null===this.oldValue?"addRootAttribute":null===this.newValue?"removeRootAttribute":"changeRootAttribute"}clone(){return new ac(this.root,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new ac(this.root,this.key,this.newValue,this.oldValue,this.baseVersion+1)}_validate(){if(this.root!=this.root.root||this.root.is("documentFragment"))throw new E.b("rootattribute-operation-not-a-root: The element to change is not a root element.",{root:this.root,key:this.key});if(null!==this.oldValue&&this.root.getAttribute(this.key)!==this.oldValue)throw new E.b("rootattribute-operation-wrong-old-value: Changed node has different attribute value than operation's old attribute value.",{root:this.root,key:this.key});if(null===this.oldValue&&null!==this.newValue&&this.root.hasAttribute(this.key))throw new E.b("rootattribute-operation-attribute-exists: The attribute with given key already exists.",{root:this.root,key:this.key})}_execute(){null!==this.newValue?this.root._setAttribute(this.key,this.newValue):this.root._removeAttribute(this.key)}toJSON(){const t=super.toJSON();return t.root=this.root.toJSON(),t}static get className(){return"RootAttributeOperation"}static fromJSON(t,e){if(!e.getRoot(t.root))throw new E.b("rootattribute-operation-fromjson-no-root: Cannot create RootAttributeOperation. Root with specified name does not exist.",{rootName:t.root});return new ac(e.getRoot(t.root),t.key,t.oldValue,t.newValue,t.baseVersion)}}class cc extends $a{constructor(t,e,n,o,r){super(r),this.sourcePosition=Us.createFromPosition(t),this.sourcePosition.stickiness="toPrevious",this.howMany=e,this.targetPosition=Us.createFromPosition(n),this.targetPosition.stickiness="toNext",this.graveyardPosition=Us.createFromPosition(o)}get type(){return"merge"}get deletionPosition(){return new Us(this.sourcePosition.root,this.sourcePosition.path.slice(0,-1))}get movedRange(){const t=this.sourcePosition.getShiftedBy(Number.POSITIVE_INFINITY);return new $s(this.sourcePosition,t)}clone(){return new this.constructor(this.sourcePosition,this.howMany,this.targetPosition,this.graveyardPosition,this.baseVersion)}getReversed(){const t=this.targetPosition._getTransformedByMergeOperation(this),e=this.sourcePosition.path.slice(0,-1),n=new Us(this.sourcePosition.root,e)._getTransformedByMergeOperation(this),o=new lc(t,this.howMany,this.graveyardPosition,this.baseVersion+1);return o.insertionPosition=n,o}_validate(){const t=this.sourcePosition.parent,e=this.targetPosition.parent;if(!(t&&t.is("element")&&t.parent))throw new E.b("merge-operation-source-position-invalid: Merge source position is invalid.");if(!(e&&e.is("element")&&e.parent))throw new E.b("merge-operation-target-position-invalid: Merge target position is invalid.");if(this.howMany!=t.maxOffset)throw new E.b("merge-operation-how-many-invalid: Merge operation specifies wrong number of nodes to move.")}_execute(){const t=this.sourcePosition.parent;Ja($s.createIn(t),this.targetPosition),Ja($s.createOn(t),this.graveyardPosition)}toJSON(){const t=super.toJSON();return t.sourcePosition=t.sourcePosition.toJSON(),t.targetPosition=t.targetPosition.toJSON(),t.graveyardPosition=t.graveyardPosition.toJSON(),t}static get className(){return"MergeOperation"}static fromJSON(t,e){const n=Us.fromJSON(t.sourcePosition,e),o=Us.fromJSON(t.targetPosition,e),r=Us.fromJSON(t.graveyardPosition,e);return new this(n,t.howMany,o,r,t.baseVersion)}}class lc extends $a{constructor(t,e,n,o){super(o),this.splitPosition=Us.createFromPosition(t),this.splitPosition.stickiness="toNext",this.howMany=e,this.insertionPosition=lc.getInsertionPosition(t),this.insertionPosition.stickiness="toNone",this.graveyardPosition=n?Us.createFromPosition(n):null,this.graveyardPosition&&(this.graveyardPosition.stickiness="toNext")}get type(){return"split"}get moveTargetPosition(){const t=this.insertionPosition.path.slice();return t.push(0),new Us(this.insertionPosition.root,t)}get movedRange(){const t=this.splitPosition.getShiftedBy(Number.POSITIVE_INFINITY);return new $s(this.splitPosition,t)}clone(){const t=new this.constructor(this.splitPosition,this.howMany,this.graveyardPosition,this.baseVersion);return t.insertionPosition=this.insertionPosition,t}getReversed(){const t=this.splitPosition.root.document.graveyard,e=new Us(t,[0]);return new cc(this.moveTargetPosition,this.howMany,this.splitPosition,e,this.baseVersion+1)}_validate(){const t=this.splitPosition.parent,e=this.splitPosition.offset;if(!t||t.maxOffset<e)throw new E.b("split-operation-position-invalid: Split position is invalid.");if(!t.parent)throw new E.b("split-operation-split-in-root: Cannot split root element.");if(this.howMany!=t.maxOffset-this.splitPosition.offset)throw new E.b("split-operation-how-many-invalid: Split operation specifies wrong number of nodes to move.");if(this.graveyardPosition&&!this.graveyardPosition.nodeAfter)throw new E.b("split-operation-graveyard-position-invalid: Graveyard position invalid.")}_execute(){const t=this.splitPosition.parent;if(this.graveyardPosition)Ja($s.createFromPositionAndShift(this.graveyardPosition,1),this.insertionPosition);else{const e=t._clone();Ga(this.insertionPosition,e)}Ja($s.createFromParentsAndOffsets(t,this.splitPosition.offset,t,t.maxOffset),this.moveTargetPosition)}toJSON(){const t=super.toJSON();return t.splitPosition=this.splitPosition.toJSON(),t.insertionPosition=this.insertionPosition.toJSON(),this.graveyardPosition&&(t.graveyardPosition=this.graveyardPosition.toJSON()),t}static get className(){return"SplitOperation"}static getInsertionPosition(t){const e=t.path.slice(0,-1);return e[e.length-1]++,new Us(t.root,e)}static fromJSON(t,e){const n=Us.fromJSON(t.splitPosition,e),o=Us.fromJSON(t.insertionPosition,e),r=t.graveyardPosition?Us.fromJSON(t.graveyardPosition,e):null,i=new this(n,t.howMany,r,t.baseVersion);return i.insertionPosition=o,i}}class uc extends zs{constructor(t,e,n="main"){super(e),this._doc=t,this.rootName=n}get document(){return this._doc}is(t,e){return e?"rootElement"==t&&e==this.name||super.is(t,e):"rootElement"==t||super.is(t)}toJSON(){return this.rootName}}class dc{constructor(t,e){this.model=t,this.batch=e}createText(t,e){return new Vs(t,e)}createElement(t,e){return new zs(t,e)}createDocumentFragment(){return new Wa}insert(t,e,n){this._assertWriterUsedCorrectly();const o=Us.createAt(e,n);if(t.parent){if(gc(t.root,o.root))return void this.move($s.createOn(t),o);if(t.root.document)throw new Error("model-writer-insert-forbidden-move: Cannot move a node from a document to a different tree.");this.remove(t)}const r=o.root.document?o.root.document.version:null,i=new rc(o,t,r);if(t instanceof Vs&&(i.shouldReceiveAttributes=!0),this.batch.addOperation(i),this.model.applyOperation(i),t instanceof Wa)for(const[e,n]of t.markers){const t=Us.createAt(n.root),r=new $s(n.start._getCombined(t,o),n.end._getCombined(t,o));this.addMarker(e,{range:r,usingOperation:!0})}}insertText(t,e,n,o){e instanceof Wa||e instanceof zs||e instanceof Us?this.insert(this.createText(t),e,n):this.insert(this.createText(t,e),n,o)}insertElement(t,e,n,o){e instanceof Wa||e instanceof zs||e instanceof Us?this.insert(this.createElement(t),e,n):this.insert(this.createElement(t,e),n,o)}append(t,e){this.insert(t,e,"end")}appendText(t,e,n){e instanceof Wa||e instanceof zs?this.insert(this.createText(t),e,"end"):this.insert(this.createText(t,e),n,"end")}appendElement(t,e,n){e instanceof Wa||e instanceof zs?this.insert(this.createElement(t),e,"end"):this.insert(this.createElement(t,e),n,"end")}setAttribute(t,e,n){if(this._assertWriterUsedCorrectly(),n instanceof $s){const o=n.getMinimalFlatRanges();for(const n of o)hc(this,t,e,n)}else fc(this,t,e,n)}setAttributes(t,e){for(const[n,o]of Ns(t))this.setAttribute(n,o,e)}removeAttribute(t,e){if(this._assertWriterUsedCorrectly(),e instanceof $s){const n=e.getMinimalFlatRanges();for(const e of n)hc(this,t,null,e)}else fc(this,t,null,e)}clearAttributes(t){this._assertWriterUsedCorrectly();const e=t=>{for(const e of t.getAttributeKeys())this.removeAttribute(e,t)};if(t instanceof $s)for(const n of t.getItems())e(n);else e(t)}move(t,e,n){if(this._assertWriterUsedCorrectly(),!(t instanceof $s))throw new E.b("writer-move-invalid-range: Invalid range to move.");if(!t.isFlat)throw new E.b("writer-move-range-not-flat: Range to move is not flat.");const o=Us.createAt(e,n);if(!gc(t.root,o.root))throw new E.b("writer-move-different-document: Range is going to be moved between different documents.");const r=t.root.document?t.root.document.version:null,i=new oc(t.start,t.end.offset-t.start.offset,o,r);this.batch.addOperation(i),this.model.applyOperation(i)}remove(t){if(this._assertWriterUsedCorrectly(),t instanceof $s){const e=t.getMinimalFlatRanges().reverse();for(const t of e)mc(t.start,t.end.offset-t.start.offset,this.batch,this.model)}else{const e=t.is("text")?t.offsetSize:1;mc(Us.createBefore(t),e,this.batch,this.model)}}merge(t){this._assertWriterUsedCorrectly();const e=t.nodeBefore,n=t.nodeAfter;if(!(e instanceof zs))throw new E.b("writer-merge-no-element-before: Node before merge position must be an element.");if(!(n instanceof zs))throw new E.b("writer-merge-no-element-after: Node after merge position must be an element.");t.root.document?this._merge(t):this._mergeDetached(t)}_mergeDetached(t){const e=t.nodeBefore,n=t.nodeAfter;this.move($s.createIn(n),Us.createAt(e,"end")),this.remove(n)}_merge(t){const e=Us.createAt(t.nodeBefore,"end"),n=Us.createAt(t.nodeAfter,0),o=t.root.document.graveyard,r=new Us(o,[0]),i=t.root.document.version,s=new cc(n,t.nodeAfter.maxOffset,e,r,i);this.batch.addOperation(s),this.model.applyOperation(s)}rename(t,e){if(this._assertWriterUsedCorrectly(),!(t instanceof zs))throw new E.b("writer-rename-not-element-instance: Trying to rename an object which is not an instance of Element.");const n=t.root.document?t.root.document.version:null,o=new sc(Us.createBefore(t),t.name,e,n);this.batch.addOperation(o),this.model.applyOperation(o)}split(t,e){this._assertWriterUsedCorrectly();let n,o,r=t.parent;if(!r.parent)throw new E.b("writer-split-element-no-parent: Element with no parent can not be split.");if(e||(e=r.parent),!t.parent.getAncestors({includeSelf:!0}).includes(e))throw new E.b("writer-split-invalid-limit-element: Limit element is not a position ancestor.");do{const e=r.root.document?r.root.document.version:null,i=r.maxOffset-t.offset,s=new lc(t,i,null,e);this.batch.addOperation(s),this.model.applyOperation(s),n||o||(n=r,o=t.parent.nextSibling),r=(t=Us.createAfter(t.parent)).parent}while(r!==e);return{position:t,range:new $s(Us.createAt(n,"end"),Us.createAt(o))}}wrap(t,e){if(this._assertWriterUsedCorrectly(),!t.isFlat)throw new E.b("writer-wrap-range-not-flat: Range to wrap is not flat.");const n=e instanceof zs?e:new zs(e);if(n.childCount>0)throw new E.b("writer-wrap-element-not-empty: Element to wrap with is not empty.");if(null!==n.parent)throw new E.b("writer-wrap-element-attached: Element to wrap with is already attached to tree model.");const o=t.root.document?t.root.document.version:null,r=new rc(t.start,n,o);this.batch.addOperation(r),this.model.applyOperation(r);const i=new oc(t.start.getShiftedBy(1),t.end.offset-t.start.offset,Us.createAt(n,0),null===o?null:o+1);this.batch.addOperation(i),this.model.applyOperation(i)}unwrap(t){if(this._assertWriterUsedCorrectly(),null===t.parent)throw new E.b("writer-unwrap-element-no-parent: Trying to unwrap an element which has no parent.");this.move($s.createIn(t),Us.createAfter(t)),this.remove(t)}addMarker(t,e){if(this._assertWriterUsedCorrectly(),!e||"boolean"!=typeof e.usingOperation)throw new E.b("writer-addMarker-no-usingOperations: The options.usingOperations parameter is required when adding a new marker.");const n=e.usingOperation,o=e.range,r=void 0!==e.affectsData&&e.affectsData;if(this.model.markers.has(t))throw new E.b("writer-addMarker-marker-exists: Marker with provided name already exists.");if(!o)throw new E.b("writer-addMarker-no-range: Range parameter is required when adding a new marker.");return n?(pc(this,t,null,o,r),this.model.markers.get(t)):this.model.markers._set(t,o,n,r)}updateMarker(t,e={}){this._assertWriterUsedCorrectly();const n="string"==typeof t?t:t.name,o=this.model.markers.get(n);if(!o)throw new E.b("writer-updateMarker-marker-not-exists: Marker with provided name does not exists.");const r="boolean"==typeof e.usingOperation,i="boolean"==typeof e.affectsData,s=i?e.affectsData:o.affectsData;if(!r&&!e.range&&!i)throw new E.b("writer-updateMarker-wrong-options: One of the options is required - provide range, usingOperations or affectsData.");const a=o.getRange(),c=e.range?e.range:a;r&&e.usingOperation!==o.managedUsingOperations?e.usingOperation?pc(this,n,null,c,s):(pc(this,n,a,null,s),this.model.markers._set(n,c,void 0,s)):o.managedUsingOperations?pc(this,n,a,c,s):this.model.markers._set(n,c,void 0,s)}removeMarker(t){this._assertWriterUsedCorrectly();const e="string"==typeof t?t:t.name;if(!this.model.markers.has(e))throw new E.b("writer-removeMarker-no-marker: Trying to remove marker which does not exist.");const n=this.model.markers.get(e);n.managedUsingOperations?pc(this,e,n.getRange(),null,n.affectsData):this.model.markers._remove(e)}setSelection(t,e,n){this._assertWriterUsedCorrectly(),this.model.document.selection._setTo(t,e,n)}setSelectionFocus(t,e){this._assertWriterUsedCorrectly(),this.model.document.selection._setFocus(t,e)}setSelectionAttribute(t,e){if(this._assertWriterUsedCorrectly(),"string"==typeof t)this._setSelectionAttribute(t,e);else for(const[e,n]of Ns(t))this._setSelectionAttribute(e,n)}removeSelectionAttribute(t){if(this._assertWriterUsedCorrectly(),"string"==typeof t)this._removeSelectionAttribute(t);else for(const e of t)this._removeSelectionAttribute(e)}overrideSelectionGravity(){return this.model.document.selection._overrideGravity()}restoreSelectionGravity(t){this.model.document.selection._restoreGravity(t)}_setSelectionAttribute(t,e){const n=this.model.document.selection;if(n.isCollapsed&&n.anchor.parent.isEmpty){const o=na._getStoreAttributeKey(t);this.setAttribute(o,e,n.anchor.parent)}n._setAttribute(t,e)}_removeSelectionAttribute(t){const e=this.model.document.selection;if(e.isCollapsed&&e.anchor.parent.isEmpty){const n=na._getStoreAttributeKey(t);this.removeAttribute(n,e.anchor.parent)}e._removeAttribute(t)}_assertWriterUsedCorrectly(){if(this.model._currentWriter!==this)throw new E.b("writer-incorrect-use: Trying to use a writer outside the change() block.")}}function hc(t,e,n,o){const r=t.model,i=r.document;let s,a,c,l=o.start;for(const t of o.getWalker({shallow:!0}))c=t.item.getAttribute(e),s&&a!=c&&(a!=n&&u(),l=s),s=t.nextPosition,a=c;function u(){const o=new $s(l,s),c=o.root.document?i.version:null,u=new ec(o,e,a,n,c);t.batch.addOperation(u),r.applyOperation(u)}s instanceof Us&&s!=l&&a!=n&&u()}function fc(t,e,n,o){const r=t.model,i=r.document,s=o.getAttribute(e);let a,c;if(s!=n){if(o.root===o){const t=o.document?i.version:null;c=new ac(o,e,s,n,t)}else{const t=(a=new $s(Us.createBefore(o),Us.createAfter(o))).root.document?i.version:null;c=new ec(a,e,s,n,t)}t.batch.addOperation(c),r.applyOperation(c)}}function pc(t,e,n,o,r){const i=t.model,s=i.document,a=new ic(e,n,o,i.markers,r,s.version);t.batch.addOperation(a),i.applyOperation(a)}function mc(t,e,n,o){let r;if(t.root.document){const n=o.document,i=new Us(n.graveyard,[0]);r=new oc(t,e,i,n.version)}else r=new nc(t,e);n.addOperation(r),o.applyOperation(r)}function gc(t,e){return t===e||t instanceof uc&&e instanceof uc}class bc{constructor(t){this._markerCollection=t,this._changesInElement=new Map,this._elementSnapshots=new Map,this._changedMarkers=new Map,this._changeCount=0,this._cachedChanges=null,this._cachedChangesWithGraveyard=null}get isEmpty(){return 0==this._changesInElement.size&&0==this._changedMarkers.size}bufferOperation(t){switch(t.type){case"insert":if(this._isInInsertedElement(t.position.parent))return;this._markInsert(t.position.parent,t.position.offset,t.nodes.maxOffset);break;case"addAttribute":case"removeAttribute":case"changeAttribute":for(const e of t.range.getItems())this._isInInsertedElement(e.parent)||this._markAttribute(e);break;case"remove":case"move":case"reinsert":{const e=this._isInInsertedElement(t.sourcePosition.parent),n=this._isInInsertedElement(t.targetPosition.parent);e||this._markRemove(t.sourcePosition.parent,t.sourcePosition.offset,t.howMany),n||this._markInsert(t.targetPosition.parent,t.getMovedRangeStart().offset,t.howMany);break}case"rename":{if(this._isInInsertedElement(t.position.parent))return;this._markRemove(t.position.parent,t.position.offset,1),this._markInsert(t.position.parent,t.position.offset,1);const e=$s.createFromPositionAndShift(t.position,1);for(const t of this._markerCollection.getMarkersIntersectingRange(e)){const e=t.getRange();this.bufferMarkerChange(t.name,e,e,t.affectsData)}break}case"split":{const e=t.splitPosition.parent;this._isInInsertedElement(e)||this._markRemove(e,t.splitPosition.offset,t.howMany),this._isInInsertedElement(t.insertionPosition.parent)||this._markInsert(t.insertionPosition.parent,t.insertionPosition.offset,1),t.graveyardPosition&&this._markRemove(t.graveyardPosition.parent,t.graveyardPosition.offset,1);break}case"merge":{const e=t.sourcePosition.parent;this._isInInsertedElement(e.parent)||this._markRemove(e.parent,e.startOffset,1);const n=t.graveyardPosition.parent;this._markInsert(n,t.graveyardPosition.offset,1);const o=t.targetPosition.parent;this._isInInsertedElement(o)||this._markInsert(o,t.targetPosition.offset,e.maxOffset);break}}this._cachedChanges=null}bufferMarkerChange(t,e,n,o){const r=this._changedMarkers.get(t);r?(r.newRange=n,r.affectsData=o,null==r.oldRange&&null==r.newRange&&this._changedMarkers.delete(t)):this._changedMarkers.set(t,{oldRange:e,newRange:n,affectsData:o})}getMarkersToRemove(){const t=[];for(const[e,n]of this._changedMarkers)null!=n.oldRange&&t.push({name:e,range:n.oldRange});return t}getMarkersToAdd(){const t=[];for(const[e,n]of this._changedMarkers)null!=n.newRange&&t.push({name:e,range:n.newRange});return t}hasDataChanges(){for(const[,t]of this._changedMarkers)if(t.affectsData)return!0;return this._changesInElement.size>0}getChanges(t={includeChangesInGraveyard:!1}){if(this._cachedChanges)return t.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice();const e=[];for(const t of this._changesInElement.keys()){const n=this._changesInElement.get(t).sort((t,e)=>t.offset===e.offset?t.type!=e.type?"remove"==t.type?-1:1:0:t.offset<e.offset?-1:1),o=this._elementSnapshots.get(t),r=wc(t.getChildren()),i=_c(o.length,n);let s=0,a=0;for(const n of i)if("i"===n)e.push(this._getInsertDiff(t,s,r[s].name)),s++;else if("r"===n)e.push(this._getRemoveDiff(t,s,o[a].name)),a++;else if("a"===n){const n=r[s].attributes,i=o[a].attributes;let c;if("$text"==r[s].name)c=$s.createFromParentsAndOffsets(t,s,t,s+1);else{const e=t.offsetToIndex(s);c=$s.createFromParentsAndOffsets(t,s,t.getChild(e),0)}e.push(...this._getAttributesDiff(c,i,n)),s++,a++}else s++,a++}e.sort((t,e)=>t.position.root!=e.position.root?t.position.root.rootName<e.position.root.rootName?-1:1:t.position.isEqual(e.position)?t.changeCount<e.changeCount?-1:1:t.position.isBefore(e.position)?-1:1);for(let t=1;t<e.length;t++){const n=e[t-1],o=e[t],r="remove"==n.type&&"remove"==o.type&&"$text"==n.name&&"$text"==o.name&&n.position.isEqual(o.position),i="insert"==n.type&&"insert"==o.type&&"$text"==n.name&&"$text"==o.name&&n.position.parent==o.position.parent&&n.position.offset+n.length==o.position.offset,s="attribute"==n.type&&"attribute"==o.type&&n.position.parent==o.position.parent&&n.range.isFlat&&o.range.isFlat&&n.position.offset+n.length==o.position.offset&&n.attributeKey==o.attributeKey&&n.attributeOldValue==o.attributeOldValue&&n.attributeNewValue==o.attributeNewValue;(r||i||s)&&(e[t-1].length++,s&&(e[t-1].range.end=e[t-1].range.end.getShiftedBy(1)),e.splice(t,1),t--)}for(const t of e)delete t.changeCount,"attribute"==t.type&&(delete t.position,delete t.length);return this._changeCount=0,this._cachedChangesWithGraveyard=e.slice(),this._cachedChanges=e.slice().filter(kc),t.includeChangesInGraveyard?this._cachedChangesWithGraveyard:this._cachedChanges}reset(){this._changesInElement.clear(),this._elementSnapshots.clear(),this._changedMarkers.clear(),this._cachedChanges=null}_markInsert(t,e,n){const o={type:"insert",offset:e,howMany:n,count:this._changeCount++};this._markChange(t,o)}_markRemove(t,e,n){const o={type:"remove",offset:e,howMany:n,count:this._changeCount++};this._markChange(t,o),this._removeAllNestedChanges(t,e,n)}_markAttribute(t){const e={type:"attribute",offset:t.startOffset,howMany:t.offsetSize,count:this._changeCount++};this._markChange(t.parent,e)}_markChange(t,e){this._makeSnapshot(t);const n=this._getChangesForElement(t);this._handleChange(e,n),n.push(e);for(let t=0;t<n.length;t++)n[t].howMany<1&&(n.splice(t,1),t--)}_getChangesForElement(t){let e;return this._changesInElement.has(t)?e=this._changesInElement.get(t):(e=[],this._changesInElement.set(t,e)),e}_makeSnapshot(t){this._elementSnapshots.has(t)||this._elementSnapshots.set(t,wc(t.getChildren()))}_handleChange(t,e){t.nodesToHandle=t.howMany;for(const n of e){const o=t.offset+t.howMany,r=n.offset+n.howMany;if("insert"==t.type&&("insert"==n.type&&(t.offset<=n.offset?n.offset+=t.howMany:t.offset<r&&(n.howMany+=t.nodesToHandle,t.nodesToHandle=0)),"remove"==n.type&&t.offset<n.offset&&(n.offset+=t.howMany),"attribute"==n.type))if(t.offset<=n.offset)n.offset+=t.howMany;else if(t.offset<r){const r=n.howMany;n.howMany=t.offset-n.offset,e.unshift({type:"attribute",offset:o,howMany:r-n.howMany,count:this._changeCount++})}if("remove"==t.type){if("insert"==n.type)if(o<=n.offset)n.offset-=t.howMany;else if(o<=r)if(t.offset<n.offset){const e=o-n.offset;n.offset=t.offset,n.howMany-=e,t.nodesToHandle-=e}else n.howMany-=t.nodesToHandle,t.nodesToHandle=0;else if(t.offset<=n.offset)t.nodesToHandle-=n.howMany,n.howMany=0;else if(t.offset<r){const e=r-t.offset;n.howMany-=e,t.nodesToHandle-=e}if("remove"==n.type&&(o<=n.offset?n.offset-=t.howMany:t.offset<n.offset&&(t.nodesToHandle+=n.howMany,n.howMany=0)),"attribute"==n.type)if(o<=n.offset)n.offset-=t.howMany;else if(t.offset<n.offset){const e=o-n.offset;n.offset=t.offset,n.howMany-=e}else if(t.offset<r)if(o<=r){const o=n.howMany;n.howMany=t.offset-n.offset;const r=o-n.howMany-t.nodesToHandle;e.unshift({type:"attribute",offset:t.offset,howMany:r,count:this._changeCount++})}else n.howMany-=r-t.offset}if("attribute"==t.type){if("insert"==n.type)if(t.offset<n.offset&&o>n.offset){if(o>r){const t={type:"attribute",offset:r,howMany:o-r,count:this._changeCount++};this._handleChange(t,e),e.push(t)}t.nodesToHandle=n.offset-t.offset,t.howMany=t.nodesToHandle}else t.offset>=n.offset&&t.offset<r&&(o>r?(t.nodesToHandle=o-r,t.offset=r):t.nodesToHandle=0);"attribute"==n.type&&(t.offset>=n.offset&&o<=r?(t.nodesToHandle=0,t.howMany=0,t.offset=0):t.offset<=n.offset&&o>=r&&(n.howMany=0))}}t.howMany=t.nodesToHandle,delete t.nodesToHandle}_getInsertDiff(t,e,n){return{type:"insert",position:Us.createFromParentAndOffset(t,e),name:n,length:1,changeCount:this._changeCount++}}_getRemoveDiff(t,e,n){return{type:"remove",position:Us.createFromParentAndOffset(t,e),name:n,length:1,changeCount:this._changeCount++}}_getAttributesDiff(t,e,n){const o=[];n=new Map(n);for(const[r,i]of e){const e=n.has(r)?n.get(r):null;e!==i&&o.push({type:"attribute",position:t.start,range:$s.createFromRange(t),length:1,attributeKey:r,attributeOldValue:i,attributeNewValue:e,changeCount:this._changeCount++}),n.delete(r)}for(const[e,r]of n)o.push({type:"attribute",position:t.start,range:$s.createFromRange(t),length:1,attributeKey:e,attributeOldValue:null,attributeNewValue:r,changeCount:this._changeCount++});return o}_isInInsertedElement(t){const e=t.parent;if(!e)return!1;const n=this._changesInElement.get(e),o=t.startOffset;if(n)for(const t of n)if("insert"==t.type&&o>=t.offset&&o<t.offset+t.howMany)return!0;return this._isInInsertedElement(e)}_removeAllNestedChanges(t,e,n){const o=$s.createFromParentsAndOffsets(t,e,t,e+n);for(const t of o.getItems({shallow:!0}))t.is("element")&&(this._elementSnapshots.delete(t),this._changesInElement.delete(t),this._removeAllNestedChanges(t,0,t.maxOffset))}}function wc(t){const e=[];for(const n of t)if(n.is("text"))for(let t=0;t<n.data.length;t++)e.push({name:"$text",attributes:new Map(n.getAttributes())});else e.push({name:n.name,attributes:new Map(n.getAttributes())});return e}function _c(t,e){const n=[];let o=0,r=0;for(const t of e)t.offset>o&&(n.push(..."e".repeat(t.offset-o).split("")),r+=t.offset-o),"insert"==t.type?(n.push(..."i".repeat(t.howMany).split("")),o=t.offset+t.howMany):"remove"==t.type?(n.push(..."r".repeat(t.howMany).split("")),o=t.offset,r+=t.howMany):(n.push(..."a".repeat(t.howMany).split("")),o=t.offset+t.howMany,r+=t.howMany);return r<t&&n.push(..."e".repeat(t-r).split("")),n}function kc(t){const e=t.position&&"$graveyard"==t.position.root.rootName,n=t.range&&"$graveyard"==t.range.root.rootName;return!e&&!n}class vc{constructor(){this._operations=[],this._undoPairs=new Map,this._undoneOperations=new Set}addOperation(t){this._operations.includes(t)||this._operations.push(t)}getOperations(t=0,e=Number.POSITIVE_INFINITY){return t<0?[]:this._operations.slice(t,e)}getOperation(t){return this._operations[t]}setOperationAsUndone(t,e){this._undoPairs.set(e,t),this._undoneOperations.add(t)}isUndoingOperation(t){return this._undoPairs.has(t)}isUndoneOperation(t){return this._undoneOperations.has(t)}getUndoneOperation(t){return this._undoPairs.get(t)}}function yc(t,e){return function(t){return!!t&&1==t.length&&/[\ud800-\udbff]/.test(t)}(t.charAt(e-1))&&function(t){return!!t&&1==t.length&&/[\udc00-\udfff]/.test(t)}(t.charAt(e))}function xc(t,e){return function(t){return!!t&&1==t.length&&/[\u0300-\u036f\u1ab0-\u1aff\u1dc0-\u1dff\u20d0-\u20ff\ufe20-\ufe2f]/.test(t)}(t.charAt(e))}const Cc="$graveyard";class Ac{constructor(t){this.model=t,this.version=0,this.history=new vc(this),this.selection=new na(this),this.roots=new er({idProperty:"rootName"}),this.differ=new bc(t.markers),this._postFixers=new Set,this.createRoot("$root",Cc),this.listenTo(t,"applyOperation",(t,e)=>{const n=e[0];if(n.isDocumentOperation&&n.baseVersion!==this.version)throw new E.b("model-document-applyOperation-wrong-version: Only operations with matching versions can be applied.",{operation:n})},{priority:"highest"}),this.listenTo(t,"applyOperation",(t,e)=>{const n=e[0];n.isDocumentOperation&&this.differ.bufferOperation(n)},{priority:"high"}),this.listenTo(t,"applyOperation",(t,e)=>{const n=e[0];n.isDocumentOperation&&(this.version++,this.history.addOperation(n))},{priority:"low"});let e=!1;this.listenTo(this.selection,"change",()=>{e=!0}),this.listenTo(t,"_change",(t,n)=>{this.differ.isEmpty&&!e||(this._callPostFixers(n),this.differ.hasDataChanges()?this.fire("change:data",n.batch):this.fire("change",n.batch),this.differ.reset(),e=!1)}),this.listenTo(t.markers,"update",(t,e,n,o)=>{this.differ.bufferMarkerChange(e.name,n,o,e.affectsData),null===n&&e.on("change",(t,n)=>{this.differ.bufferMarkerChange(e.name,n,e.getRange(),e.affectsData)})})}get graveyard(){return this.getRoot(Cc)}createRoot(t="$root",e="main"){if(this.roots.get(e))throw new E.b("model-document-createRoot-name-exists: Root with specified name already exists.",{name:e});const n=new uc(this,t,e);return this.roots.add(n),n}destroy(){this.selection.destroy(),this.stopListening()}getRoot(t="main"){return this.roots.get(t)}getRootNames(){return Array.from(this.roots,t=>t.rootName).filter(t=>t!=Cc)}registerPostFixer(t){this._postFixers.add(t)}toJSON(){const t=ao(this);return t.selection="[engine.model.DocumentSelection]",t.model="[engine.model.Model]",t}_getDefaultRoot(){for(const t of this.roots)if(t!==this.graveyard)return t;return this.graveyard}_getDefaultRange(){const t=this._getDefaultRoot(),e=this.model.schema,n=new Us(t,[0]);return e.getNearestSelectionRange(n)||new $s(n)}_validateSelectionRange(t){return Pc(t.start)&&Pc(t.end)}_callPostFixers(t){let e=!1;do{for(const n of this._postFixers)if(e=n(t))break}while(e)}}function Pc(t){const e=t.textNode;if(e){const n=e.data,o=t.offset-e.startOffset;return!yc(n,o)&&!xc(n,o)}return!0}j(Ac,N);class Tc{constructor(){this._markers=new Map}[Symbol.iterator](){return this._markers.values()}has(t){return this._markers.has(t)}get(t){return this._markers.get(t)||null}_set(t,e,n=!1,o=!1){const r=t instanceof Ec?t.name:t,i=this._markers.get(r);if(i){const t=i.getRange();let s=!1;return t.isEqual(e)||(i._attachLiveRange(ta.createFromRange(e)),s=!0),n!=i.managedUsingOperations&&(i._managedUsingOperations=n,s=!0),"boolean"==typeof o&&o!=i.affectsData&&(i._affectsData=o,s=!0),s&&this.fire("update:"+r,i,t,e),i}const s=ta.createFromRange(e),a=new Ec(r,s,n,o);return this._markers.set(r,a),this.fire("update:"+r,a,null,e),a}_remove(t){const e=t instanceof Ec?t.name:t,n=this._markers.get(e);return!!n&&(this._markers.delete(e),this.fire("update:"+e,n,n.getRange(),null),this._destroyMarker(n),!0)}*getMarkersAtPosition(t){for(const e of this)e.getRange().containsPosition(t)&&(yield e)}*getMarkersIntersectingRange(t){for(const e of this)null!==e.getRange().getIntersection(t)&&(yield e)}destroy(){for(const t of this._markers.values())this._destroyMarker(t);this._markers=null,this.stopListening()}*getMarkersGroup(t){for(const e of this._markers.values())e.name.startsWith(t+":")&&(yield e)}_destroyMarker(t){t.stopListening(),t._detachLiveRange()}}j(Tc,N);class Ec{constructor(t,e,n,o){this.name=t,this._liveRange=this._attachLiveRange(e),this._managedUsingOperations=n,this._affectsData=o}get managedUsingOperations(){if(!this._liveRange)throw new E.b("marker-destroyed: Cannot use a destroyed marker instance.");return this._managedUsingOperations}get affectsData(){if(!this._liveRange)throw new E.b("marker-destroyed: Cannot use a destroyed marker instance.");return this._affectsData}getStart(){if(!this._liveRange)throw new E.b("marker-destroyed: Cannot use a destroyed marker instance.");return Us.createFromPosition(this._liveRange.start)}getEnd(){if(!this._liveRange)throw new E.b("marker-destroyed: Cannot use a destroyed marker instance.");return Us.createFromPosition(this._liveRange.end)}getRange(){if(!this._liveRange)throw new E.b("marker-destroyed: Cannot use a destroyed marker instance.");return $s.createFromRange(this._liveRange)}_attachLiveRange(t){return this._liveRange&&this._detachLiveRange(),t.delegate("change:range").to(this),t.delegate("change:content").to(this),this._liveRange=t,t}_detachLiveRange(){this._liveRange.stopDelegating("change:range",this),this._liveRange.stopDelegating("change:content",this),this._liveRange.detach(),this._liveRange=null}}j(Ec,N);class Sc extends Us{constructor(t,e,n="toNone"){if(super(t,e,n),!this.root.is("rootElement"))throw new E.b("model-liveposition-root-not-rootelement: LivePosition's root has to be an instance of RootElement.");(function(){this.listenTo(this.root.document.model,"applyOperation",(t,e)=>{const n=e[0];n.isDocumentOperation&&function(t){const e=this.getTransformedByOperation(t);if(!this.isEqual(e)){const t=Us.createFromPosition(this);this.path=e.path,this.root=e.root,this.fire("change",t)}}.call(this,n)},{priority:"low"})}).call(this)}detach(){this.stopListening()}}j(Sc,N);class Oc{constructor(t,e,n){this.model=t,this.writer=e,this.position=n,this.canMergeWith=new Set([this.position.parent]),this.schema=t.schema,this._filterAttributesOf=[]}handleNodes(t,e){t=Array.from(t);for(let n=0;n<t.length;n++){const o=t[n];this._handleNode(o,{isFirst:0===n&&e.isFirst,isLast:n===t.length-1&&e.isLast})}this.schema.removeDisallowedAttributes(this._filterAttributesOf,this.writer),this._filterAttributesOf=[]}getSelectionRange(){return this.nodeToSelect?$s.createOn(this.nodeToSelect):this.model.schema.getNearestSelectionRange(this.position)}_handleNode(t,e){if(this.schema.isObject(t))return void this._handleObject(t,e);this._checkAndSplitToAllowedPosition(t,e)?(this._insert(t),this._mergeSiblingsOf(t,e)):this._handleDisallowedNode(t,e)}_handleObject(t,e){this._checkAndSplitToAllowedPosition(t)?this._insert(t):this._tryAutoparagraphing(t,e)}_handleDisallowedNode(t,e){t.is("element")?this.handleNodes(t.getChildren(),e):this._tryAutoparagraphing(t,e)}_insert(t){if(!this.schema.checkChild(this.position,t))return void ps.a.error("insertcontent-wrong-position: The node cannot be inserted on the given position.",{node:t,position:this.position});const e=Sc.createFromPosition(this.position);e.stickiness="toNext",this.writer.insert(t,this.position),this.position=Us.createFromPosition(e),e.detach(),this.schema.isObject(t)&&!this.schema.checkChild(this.position,"$text")?this.nodeToSelect=t:this.nodeToSelect=null,this._filterAttributesOf.push(t)}_mergeSiblingsOf(t,e){if(!(t instanceof zs))return;const n=this._canMergeLeft(t,e),o=this._canMergeRight(t,e),r=Sc.createBefore(t);r.stickiness="toNext";const i=Sc.createAfter(t);if(i.stickiness="toNext",n){const t=Sc.createFromPosition(this.position);t.stickiness="toNext",this.writer.merge(r),this.position=Us.createFromPosition(t),t.detach()}if(o){this.position.isEqual(i)||ps.a.error("insertcontent-wrong-position-on-merge: The insertion position should equal the merge position"),this.position=Us.createAt(i.nodeBefore,"end");const t=new Sc(this.position.root,this.position.path,"toPrevious");this.writer.merge(i),this.position=Us.createFromPosition(t),t.detach()}(n||o)&&this._filterAttributesOf.push(this.position.parent),r.detach(),i.detach()}_canMergeLeft(t,e){const n=t.previousSibling;return e.isFirst&&n instanceof zs&&this.canMergeWith.has(n)&&this.model.schema.checkMerge(n,t)}_canMergeRight(t,e){const n=t.nextSibling;return e.isLast&&n instanceof zs&&this.canMergeWith.has(n)&&this.model.schema.checkMerge(t,n)}_tryAutoparagraphing(t,e){const n=this.writer.createElement("paragraph");this._getAllowedIn(n,this.position.parent)&&this.schema.checkChild(n,t)&&(n._appendChild(t),this._handleNode(n,e))}_checkAndSplitToAllowedPosition(t){const e=this._getAllowedIn(t,this.position.parent);if(!e)return!1;for(;e!=this.position.parent;){if(this.schema.isLimit(this.position.parent))return!1;if(this.position.isAtStart){const t=this.position.parent;this.position=Us.createBefore(t),t.isEmpty&&this.writer.remove(t)}else if(this.position.isAtEnd)this.position=Us.createAfter(this.position.parent);else{const t=Us.createAfter(this.position.parent);this.writer.split(this.position),this.position=t,this.canMergeWith.add(this.position.nodeAfter)}}return!0}_getAllowedIn(t,e){return this.schema.checkChild(e,t)?e:e.parent?this._getAllowedIn(t,e.parent):null}}function Rc(t,e,n={}){if(e.isCollapsed)return;const o=t.schema;t.change(t=>{if(!n.doNotResetEntireContent&&function(t,e){const n=t.getLimitElement(e);if(!e.containsEntireContent(n))return!1;const o=e.getFirstRange();if(o.start.parent==o.end.parent)return!1;return t.checkChild(n,"paragraph")}(o,e))return void function(t,e){const n=t.model.schema.getLimitElement(e);t.remove($s.createIn(n)),Ic(t,Us.createAt(n),e)}(t,e);const r=e.getFirstRange(),i=r.start,s=Sc.createFromPosition(r.end);s.stickiness="toNext",r.start.isTouching(r.end)||t.remove(r),n.leaveUnmerged||(!function t(e,n,o){const r=n.parent;const i=o.parent;if(r==i)return;if(!r.parent||!i.parent)return;if(!function(t,e,n){const o=new $s(t,e);for(const t of o.getWalker())if(n.isLimit(t.item))return!1;return!0}(n,o,e.model.schema))return;n=Us.createAfter(r);o=Us.createBefore(i);o.isEqual(n)||e.insert(i,n);e.merge(n);for(;o.parent.isEmpty;){const t=o.parent;o=Us.createBefore(t),e.remove(t)}t(e,n,o)}(t,i,s),o.removeDisallowedAttributes(i.parent.getChildren(),t)),e instanceof na?t.setSelection(i):e.setTo(i),function(t,e){const n=t.checkChild(e,"$text"),o=t.checkChild(e,"paragraph");return!n&&o}(o,i)&&Ic(t,i,e),s.detach()})}function Ic(t,e,n){const o=t.createElement("paragraph");t.insert(o,e),n instanceof na?t.setSelection(o,0):n.setTo(o,0)}const Fc=' ,.?!:;"-()';function Dc(t,e,n={}){const o=t.schema,r="backward"!=n.direction,i=n.unit?n.unit:"character",s=e.focus,a=new qs({boundaries:function(t,e){const n=t.root,o=Us.createAt(n,e?"end":0);return e?new $s(t,o):new $s(o,t)}(s,r),singleCharacters:!0,direction:r?"forward":"backward"}),c={walker:a,schema:o,isForward:r,unit:i};let l;for(;l=a.next();){if(l.done)return;const n=Nc(c,l.value);if(n)return void(e instanceof na?t.change(t=>{t.setSelectionFocus(n)}):e.setFocus(n))}}function Nc(t,e){if("text"==e.type)return"word"===t.unit?function(t,e){let n=t.position.textNode;if(n){let o=t.position.offset-n.startOffset;for(;!Mc(n.data,o,e)&&!Vc(n,o,e);){t.next();const r=e?t.position.nodeAfter:t.position.nodeBefore;if(r&&r.is("text")){const o=r.data.charAt(e?0:r.data.length-1);Fc.includes(o)||(t.next(),n=t.position.textNode)}o=t.position.offset-n.startOffset}}return t.position}(t.walker,t.isForward):function(t,e){const n=t.position.textNode;if(n){const o=n.data;let r=t.position.offset-n.startOffset;for(;yc(o,r)||"character"==e&&xc(o,r);)t.next(),r=t.position.offset-n.startOffset}return t.position}(t.walker,t.unit,t.isForward);if(e.type==(t.isForward?"elementStart":"elementEnd")){if(t.schema.isObject(e.item))return Us.createAt(e.item,t.isForward?"after":"before");if(t.schema.checkChild(e.nextPosition,"$text"))return e.nextPosition}else{if(t.schema.isLimit(e.item))return void t.walker.skip(()=>!0);if(t.schema.checkChild(e.nextPosition,"$text"))return e.nextPosition}}function Mc(t,e,n){const o=e+(n?0:-1);return Fc.includes(t.charAt(o))}function Vc(t,e,n){return e===(n?t.endOffset:0)}function Bc(t,e){const n=[];Array.from(t.getItems({direction:"backward"})).map(t=>$s.createOn(t)).filter(e=>{return(e.start.isAfter(t.start)||e.start.isEqual(t.start))&&(e.end.isBefore(t.end)||e.end.isEqual(t.end))}).forEach(t=>{n.push(t.start.parent),e.remove(t)}),n.forEach(t=>{let n=t;for(;n.parent&&n.isEmpty;){const t=$s.createOn(n);n=n.parent,e.remove(t)}})}function Lc(t){t.document.registerPostFixer(e=>(function(t,e){const n=e.document.selection,o=e.schema,r=[];let i=!1;for(const t of n.getRanges()){const e=zc(t,o);e?(r.push(e),i=!0):r.push(t)}if(i){let e=r;if(r.length>1){const t=r[0].start,n=r[r.length-1].end;e=[new $s(t,n)]}t.setSelection(e,{backward:n.isBackward})}})(e,t))}function zc(t,e){return t.isCollapsed?function(t,e){const n=t.start,o=e.getNearestSelectionRange(n);if(!o)return null;const r=o.start;if(n.isEqual(r))return null;if(r.nodeAfter&&e.isLimit(r.nodeAfter))return new $s(r,Us.createAfter(r.nodeAfter));return new $s(r)}(t,e):function(t,e){const n=t.start,o=t.end,r=e.checkChild(n,"$text"),i=e.checkChild(o,"$text"),s=e.getLimitElement(n),a=e.getLimitElement(o);if(s===a){if(r&&i)return null;if(function(t,e,n){const o=t.nodeAfter&&!n.isLimit(t.nodeAfter)||n.checkChild(t,"$text"),r=e.nodeBefore&&!n.isLimit(e.nodeBefore)||n.checkChild(e,"$text");return o&&r}(n,o,e)){const t=e.getNearestSelectionRange(n,"forward"),r=e.getNearestSelectionRange(o,"backward");return new $s(t?t.start:n,r?r.start:o)}}const c=s&&!s.is("rootElement"),l=a&&!a.is("rootElement");if(c||l){const t=c?qc(Us.createAt(s),e,"start"):n,r=l?qc(Us.createAt(a),e,"end"):o;return new $s(t,r)}return null}(t,e)}function qc(t,e,n){let o=t.parent,r=o;for(;e.isLimit(r)&&r.parent;)o=r,r=r.parent;return"start"===n?Us.createBefore(o):Us.createAfter(o)}class jc{constructor(){this.markers=new Tc,this.document=new Ac(this),this.schema=new va,this._pendingChanges=[],this._currentWriter=null,["insertContent","deleteContent","modifySelection","getSelectedContent","applyOperation"].forEach(t=>this.decorate(t)),this.on("applyOperation",(t,e)=>{e[0]._validate()},{priority:"highest"}),this.schema.register("$root",{isLimit:!0}),this.schema.register("$block",{allowIn:"$root",isBlock:!0}),this.schema.register("$text",{allowIn:"$block"}),this.schema.register("$clipboardHolder",{allowContentOf:"$root",isLimit:!0}),this.schema.extend("$text",{allowIn:"$clipboardHolder"}),this.schema.register("$marker",{allowIn:["$root","$block"]}),Lc(this)}change(t){return 0===this._pendingChanges.length?(this._pendingChanges.push({batch:new Ua,callback:t}),this._runPendingChanges()[0]):t(this._currentWriter)}enqueueChange(t,e){"string"==typeof t?t=new Ua(t):"function"==typeof t&&(e=t,t=new Ua),this._pendingChanges.push({batch:t,callback:e}),1==this._pendingChanges.length&&this._runPendingChanges()}applyOperation(t){t._execute()}insertContent(t,e){!function(t,e,n){t.change(o=>{let r;(r=n?n instanceof Qs||n instanceof na?n:new Qs(n):t.document.selection).isCollapsed||t.deleteContent(r);const i=new Oc(t,o,r.anchor);let s;s=e.is("documentFragment")?e.getChildren():[e],i.handleNodes(s,{isFirst:!0,isLast:!0});const a=i.getSelectionRange();a?r instanceof na?o.setSelection(a):r.setTo(a):ps.a.warn("insertcontent-no-range: Cannot determine a proper selection range after insertion.")})}(this,t,e)}deleteContent(t,e){Rc(this,t,e)}modifySelection(t,e){Dc(this,t,e)}getSelectedContent(t){return function(t,e){return t.change(t=>{const n=t.createDocumentFragment(),o=e.getFirstRange();if(!o||o.isCollapsed)return n;const r=o.start.root,i=o.start.getCommonPath(o.end),s=r.getNodeByPath(i);let a;const c=(a=o.start.parent==o.end.parent?o:$s.createFromParentsAndOffsets(s,o.start.path[i.length],s,o.end.path[i.length]+1)).end.offset-a.start.offset;for(const e of a.getItems({shallow:!0}))e.is("textProxy")?t.appendText(e.data,e.getAttributes(),n):t.append(e._clone(!0),n);if(a!=o){const e=o._getTransformedByMove(a.start,Us.createAt(n,0),c)[0],r=new $s(Us.createAt(n),e.start);Bc(new $s(e.end,Us.createAt(n,"end")),t),Bc(r,t)}return n})}(this,t)}hasContent(t){if(t instanceof zs&&(t=$s.createIn(t)),t.isCollapsed)return!1;for(const e of t.getItems())if(e.is("textProxy")||this.schema.isObject(e))return!0;return!1}destroy(){this.document.destroy(),this.stopListening()}_runPendingChanges(){const t=[];for(this.fire("_beforeChanges");this._pendingChanges.length;){const e=this._pendingChanges[0].batch;this._currentWriter=new dc(this,e);const n=this._pendingChanges[0].callback(this._currentWriter);t.push(n),this.fire("_change",this._currentWriter),this._pendingChanges.shift(),this._currentWriter=null}return this.fire("_afterChanges"),t}}j(jc,Bo);class Hc{constructor(){this._listener=Object.create(si)}listenTo(t){this._listener.listenTo(t,"keydown",(t,e)=>{this._listener.fire("_keydown:"+pr(e),e)})}set(t,e,n={}){const o=mr(t),r=n.priority;this._listener.listenTo(this._listener,"_keydown:"+o,(t,n)=>{e(n,()=>{n.preventDefault(),n.stopPropagation(),t.stop()}),t.return=!0},{priority:r})}press(t){return!!this._listener.fire("_keydown:"+pr(t),t)}destroy(){this._listener.stopListening()}}class Uc extends Hc{constructor(t){super(),this.editor=t}set(t,e,n={}){if("string"==typeof e){const t=e;e=((e,n)=>{this.editor.execute(t),n()})}super.set(t,e,n)}}n(60);class $c{constructor(t){const e=this.constructor.builtinPlugins;this.config=new T(t,this.constructor.defaultConfig),this.config.define("plugins",e),this.plugins=new ma(this,e),this.commands=new ga,this.locale=new wa(this.config.get("language")),this.t=this.locale.t,this.set("state","initializing"),this.once("ready",()=>this.state="ready",{priority:"high"}),this.once("destroy",()=>this.state="destroyed",{priority:"high"}),this.set("isReadOnly",!1),this.model=new jc,this.data=new za(this.model),this.editing=new pa(this.model),this.editing.view.document.bind("isReadOnly").to(this),this.conversion=new qa,this.conversion.register("downcast",[this.editing.downcastDispatcher,this.data.downcastDispatcher]),this.conversion.register("editingDowncast",[this.editing.downcastDispatcher]),this.conversion.register("dataDowncast",[this.data.downcastDispatcher]),this.conversion.register("upcast",[this.data.upcastDispatcher]),this.keystrokes=new Uc(this),this.keystrokes.listenTo(this.editing.view.document)}initPlugins(){const t=this,e=this.config;return function(){const n=e.get("plugins")||[],o=e.get("removePlugins")||[];return t.plugins.load(n,o)}().then(t=>n(t,"init").then(()=>n(t,"afterInit"))).then(()=>this.fire("pluginsReady"));function n(t,e){return t.reduce((t,n)=>n[e]?t.then(n[e].bind(n)):t,Promise.resolve())}}destroy(){let t=Promise.resolve();return"initializing"==this.state&&(t=new Promise(t=>this.once("ready",t))),t.then(()=>{this.fire("destroy"),this.stopListening(),this.commands.destroy()}).then(()=>this.plugins.destroy()).then(()=>{this.model.destroy(),this.data.destroy(),this.editing.destroy(),this.keystrokes.destroy()})}execute(...t){this.commands.execute(...t)}static create(t){return new Promise(e=>{const n=new this(t);e(n.initPlugins().then(()=>{n.fire("dataReady"),n.fire("ready")}).then(()=>n))})}}j($c,Bo);var Wc={setData(t){this.data.set(t)},getData(){return this.data.get()}};var Gc={updateSourceElement(){if(!this.sourceElement)throw new E.b("editor-missing-sourceelement: Cannot update the source element of a detached editor.");!function(t,e){t instanceof HTMLTextAreaElement&&(t.value=e),t.innerHTML=e}(this.sourceElement,this.data.get())}};class Kc{getHtml(t){const e=document.implementation.createHTMLDocument("").createElement("div");return e.appendChild(t),e.innerHTML}}class Jc{constructor(){this._domParser=new DOMParser,this._domConverter=new ni({blockFiller:Fr}),this._htmlWriter=new Kc}toData(t){const e=this._domConverter.viewToDom(t,document);return this._htmlWriter.getHtml(e)}toView(t){const e=this._toDom(t);return this._domConverter.domToView(e)}_toDom(t){const e=this._domParser.parseFromString(t,"text/html"),n=e.createDocumentFragment(),o=e.body.childNodes;for(;o.length>0;)n.appendChild(o[0]);return n}}class Zc{constructor(t){this.editor=t,this._components=new Map}*names(){for(const t of this._components.values())yield t.originalName}add(t,e){if(this.has(t))throw new E.b("componentfactory-item-exists: The item already exists in the component factory.",{name:t});this._components.set(Qc(t),{callback:e,originalName:t})}create(t){if(!this.has(t))throw new E.b("componentfactory-item-missing: The required component is not registered in the factory.",{name:t});return this._components.get(Qc(t)).callback(this.editor.locale)}has(t){return this._components.has(Qc(t))}}function Qc(t){return String(t).toLowerCase()}class Yc{constructor(){this.set("isFocused",!1),this.focusedElement=null,this._elements=new Set,this._nextEventLoopTimeout=null}add(t){if(this._elements.has(t))throw new E.b("focusTracker-add-element-already-exist");this.listenTo(t,"focus",()=>this._focus(t),{useCapture:!0}),this.listenTo(t,"blur",()=>this._blur(),{useCapture:!0}),this._elements.add(t)}remove(t){t===this.focusedElement&&this._blur(t),this._elements.has(t)&&(this.stopListening(t),this._elements.delete(t))}_focus(t){clearTimeout(this._nextEventLoopTimeout),this.focusedElement=t,this.isFocused=!0}_blur(){clearTimeout(this._nextEventLoopTimeout),this._nextEventLoopTimeout=setTimeout(()=>{this.focusedElement=null,this.isFocused=!1},0)}}j(Yc,si),j(Yc,Bo);class Xc{constructor(t,e){this.editor=t,this.view=e,this.componentFactory=new Zc(t),this.focusTracker=new Yc,this.listenTo(t.editing.view.document,"layoutChanged",()=>this.update())}update(){this.fire("update")}destroy(){this.stopListening(),this.view.destroy()}}j(Xc,N);class tl extends Xc{constructor(t,e){super(t,e),this._toolbarConfig=function(t){return Array.isArray(t)?{items:t}:t?Object.assign({items:[]},t):{items:[]}}(t.config.get("toolbar"))}init(){const t=this.editor,e=this.view;e.render(),e.stickyPanel.bind("isActive").to(this.focusTracker,"isFocused"),e.stickyPanel.limiterElement=e.element,this._toolbarConfig.viewportTopOffset&&(e.stickyPanel.viewportTopOffset=this._toolbarConfig.viewportTopOffset);const n=t.editing.view.document.getRoot();e.editable.bind("isReadOnly").to(n),e.editable.bind("isFocused").to(t.editing.view.document),e.editable.name=n.rootName,this.focusTracker.add(this.view.editableElement),this.view.toolbar.fillFromConfig(this._toolbarConfig.items,this.componentFactory),function({origin:t,originKeystrokeHandler:e,originFocusTracker:n,toolbar:o,beforeFocus:r,afterBlur:i}){n.add(o.element),e.set("Alt+F10",(t,e)=>{n.isFocused&&!o.focusTracker.isFocused&&(r&&r(),o.focus(),e())}),o.keystrokes.set("Esc",(e,n)=>{o.focusTracker.isFocused&&(t.focus(),i&&i(),n())})}({origin:t.editing.view,originFocusTracker:this.focusTracker,originKeystrokeHandler:t.keystrokes,toolbar:this.view.toolbar})}}class el extends er{constructor(t){super({idProperty:"viewUid"}),this.on("add",(t,e,n)=>{e.isRendered||e.render(),e.element&&this._parentElement&&this._parentElement.insertBefore(e.element,this._parentElement.children[n])}),this.on("remove",(t,e)=>{e.element&&this._parentElement&&e.element.remove()}),this.locale=t,this._parentElement=null}destroy(){this.map(t=>t.destroy())}setParent(t){this._parentElement=t}delegate(...t){if(!t.length||!function(t){return t.every(t=>"string"==typeof t)}(t))throw new E.b("ui-viewcollection-delegate-wrong-events: All event names must be strings.");return{to:e=>{for(const n of this)for(const o of t)n.delegate(o).to(e);this.on("add",(n,o)=>{for(const n of t)o.delegate(n).to(e)}),this.on("remove",(n,o)=>{for(const n of t)o.stopDelegating(n,e)})}}}}j(er,Bo);var nl=1,ol=4;var rl=function(t,e){return io(t,nl|ol,e="function"==typeof e?e:void 0)};const il="http://www.w3.org/1999/xhtml";class sl{constructor(t){Object.assign(this,ml(pl(t))),this._isRendered=!1,this._revertData=null}render(){const t=this._renderNode({intoFragment:!0});return this._isRendered=!0,t}apply(t){return this._revertData={children:[],bindings:[],attributes:{}},this._renderNode({node:t,isApplying:!0,revertData:this._revertData}),t}revert(t){if(!this._revertData)throw new E.b("ui-template-revert-not-applied: Attempting to revert a template which has not been applied yet.");this._revertTemplateFromNode(t,this._revertData)}*getViews(){yield*function*t(e){if(e.children)for(const n of e.children)kl(n)?yield n:vl(n)&&(yield*t(n))}(this)}static bind(t,e){return{to:(n,o)=>new cl({eventNameOrFunction:n,attribute:n,observable:t,emitter:e,callback:o}),if:(n,o,r)=>new ll({observable:t,emitter:e,attribute:n,valueIfTrue:o,callback:r})}}static extend(t,e){t._isRendered&&ps.a.warn("template-extend-render: Attempting to extend a template which has already been rendered."),function t(e,n){n.attributes&&(e.attributes||(e.attributes={}),wl(e.attributes,n.attributes));n.eventListeners&&(e.eventListeners||(e.eventListeners={}),wl(e.eventListeners,n.eventListeners));n.text&&e.text.push(...n.text);if(n.children&&n.children.length){if(e.children.length!=n.children.length)throw new E.b("ui-template-extend-children-mismatch: The number of children in extended definition does not match.");let o=0;for(const r of n.children)t(e.children[o++],r)}}(t,ml(pl(e)))}_renderNode(t){let e;if(e=t.node?this.tag&&this.text:this.tag?this.text:!this.text)throw new E.b('ui-template-wrong-syntax: Node definition must have either "tag" or "text" when rendering a new Node.');return this.text?this._renderText(t):this._renderElement(t)}_renderElement(t){let e=t.node;return e||(e=t.node=document.createElementNS(this.ns||il,this.tag)),this._renderAttributes(t),this._renderElementChildren(t),this._setUpListeners(t),e}_renderText(t){let e=t.node;return e?t.revertData.text=e.textContent:e=t.node=document.createTextNode(""),ul(this.text)?this._bindToObservable({schema:this.text,updater:function(t){return{set(e){t.textContent=e},remove(){t.textContent=""}}}(e),data:t}):e.textContent=this.text.join(""),e}_renderAttributes(t){let e,n,o,r;if(!this.attributes)return;const i=t.node,s=t.revertData;for(e in this.attributes)if(o=i.getAttribute(e),n=this.attributes[e],s&&(s.attributes[e]=o),r=rt(n[0])&&n[0].ns?n[0].ns:null,ul(n)){const a=r?n[0].value:n;s&&xl(e)&&a.unshift(o),this._bindToObservable({schema:a,updater:hl(i,e,r),data:t})}else"style"==e&&"string"!=typeof n[0]?this._renderStyleAttribute(n[0],t):(s&&o&&xl(e)&&n.unshift(o),_l(n=n.map(t=>t&&t.value||t).reduce((t,e)=>t.concat(e),[]).reduce(bl,""))||i.setAttributeNS(r,e,n))}_renderStyleAttribute(t,e){const n=e.node;for(const o in t){const r=t[o];ul(r)?this._bindToObservable({schema:[r],updater:fl(n,o),data:e}):n.style[o]=r}}_renderElementChildren(t){const e=t.node,n=t.intoFragment?document.createDocumentFragment():e,o=t.isApplying;let r=0;for(const i of this.children)if(yl(i)){if(!o){i.setParent(e);for(const t of i)n.appendChild(t.element)}}else if(kl(i))o||(i.isRendered||i.render(),n.appendChild(i.element));else if($r(i))n.appendChild(i);else if(o){const e={children:[],bindings:[],attributes:{}};t.revertData.children.push(e),i._renderNode({node:n.childNodes[r++],isApplying:!0,revertData:e})}else n.appendChild(i.render());t.intoFragment&&e.appendChild(n)}_setUpListeners(t){if(this.eventListeners)for(const e in this.eventListeners){const n=this.eventListeners[e].map(n=>{const[o,r]=e.split("@");return n.activateDomEventListener(o,r,t)});t.revertData&&t.revertData.bindings.push(n)}}_bindToObservable({schema:t,updater:e,data:n}){const o=n.revertData;dl(t,e,n);const r=t.filter(t=>!_l(t)).filter(t=>t.observable).map(o=>o.activateAttributeListener(t,e,n));o&&o.bindings.push(r)}_revertTemplateFromNode(t,e){for(const t of e.bindings)for(const e of t)e();if(e.text)t.textContent=e.text;else{for(const n in e.attributes){const o=e.attributes[n];null===o?t.removeAttribute(n):t.setAttribute(n,o)}for(let n=0;n<e.children.length;++n)this._revertTemplateFromNode(t.childNodes[n],e.children[n])}}}j(sl,N);class al{constructor(t){Object.assign(this,t)}getValue(t){const e=this.observable[this.attribute];return this.callback?this.callback(e,t):e}activateAttributeListener(t,e,n){const o=()=>dl(t,e,n);return this.emitter.listenTo(this.observable,"change:"+this.attribute,o),()=>{this.emitter.stopListening(this.observable,"change:"+this.attribute,o)}}}class cl extends al{activateDomEventListener(t,e,n){const o=(t,n)=>{e&&!n.target.matches(e)||("function"==typeof this.eventNameOrFunction?this.eventNameOrFunction(n):this.observable.fire(this.eventNameOrFunction,n))};return this.emitter.listenTo(n.node,t,o),()=>{this.emitter.stopListening(n.node,t,o)}}}class ll extends al{getValue(t){return!_l(super.getValue(t))&&(this.valueIfTrue||!0)}}function ul(t){return!!t&&(t.value&&(t=t.value),Array.isArray(t)?t.some(ul):t instanceof al)}function dl(t,e,{node:n}){let o=function(t,e){return t.map(t=>t instanceof al?t.getValue(e):t)}(t,n);_l(o=1==t.length&&t[0]instanceof ll?o[0]:o.reduce(bl,""))?e.remove():e.set(o)}function hl(t,e,n){return{set(o){t.setAttributeNS(n,e,o)},remove(){t.removeAttributeNS(n,e)}}}function fl(t,e){return{set(n){t.style[e]=n},remove(){t.style[e]=null}}}function pl(t){return rl(t,t=>{if(t&&(t instanceof al||vl(t)||kl(t)||yl(t)))return t})}function ml(t){if("string"==typeof t?t=function(t){return{text:[t]}}(t):t.text&&function(t){Array.isArray(t.text)||(t.text=[t.text])}(t),t.on&&(t.eventListeners=function(t){for(const e in t)gl(t,e);return t}(t.on),delete t.on),!t.text){t.attributes&&function(t){for(const e in t)t[e].value&&(t[e].value=[].concat(t[e].value)),gl(t,e)}(t.attributes);const e=[];if(t.children)if(yl(t.children))e.push(t.children);else for(const n of t.children)vl(n)||kl(n)||$r(n)?e.push(n):e.push(new sl(n));t.children=e}return t}function gl(t,e){Array.isArray(t[e])||(t[e]=[t[e]])}function bl(t,e){return _l(e)?t:_l(t)?e:`${t} ${e}`}function wl(t,e){for(const n in e)t[n]?t[n].push(...e[n]):t[n]=e[n]}function _l(t){return!t&&0!==t}function kl(t){return t instanceof Cl}function vl(t){return t instanceof sl}function yl(t){return t instanceof el}function xl(t){return"class"==t||"style"==t}n(61);class Cl{constructor(t){this.element=null,this.isRendered=!1,this.locale=t,this.t=t&&t.t,this._viewCollections=new er,this._unboundChildren=this.createCollection(),this._viewCollections.on("add",(e,n)=>{n.locale=t}),this.decorate("render")}get bindTemplate(){return this._bindTemplate?this._bindTemplate:this._bindTemplate=sl.bind(this,this)}createCollection(){const t=new el;return this._viewCollections.add(t),t}registerChild(t){fo(t)||(t=[t]);for(const e of t)this._unboundChildren.add(e)}deregisterChild(t){fo(t)||(t=[t]);for(const e of t)this._unboundChildren.remove(e)}setTemplate(t){this.template=new sl(t)}extendTemplate(t){sl.extend(this.template,t)}render(){if(this.isRendered)throw new E.b("ui-view-render-already-rendered: This View has already been rendered.");this.template&&(this.element=this.template.render(),this.registerChild(this.template.getViews())),this.isRendered=!0}destroy(){this.stopListening(),this._viewCollections.map(t=>t.destroy())}}j(Cl,si),j(Cl,Bo);n(64);class Al extends Cl{constructor(t){super(t),this.body=this.createCollection()}render(){super.render(),this._renderBodyCollection()}destroy(){return this._bodyCollectionContainer.remove(),super.destroy()}_renderBodyCollection(){const t=this._bodyCollectionContainer=new sl({tag:"div",attributes:{class:["ck","ck-reset_all","ck-body","ck-rounded-corners"]},children:this.body}).render();document.body.appendChild(t)}}n(66);class Pl extends Cl{constructor(t){super(t),this.set("text"),this.set("for");const e=this.bindTemplate;this.setTemplate({tag:"label",attributes:{class:["ck","ck-label"],for:e.to("for")},children:[{text:e.to("text")}]})}}class Tl extends Al{constructor(t){super(t);const e=R();this.top=this.createCollection(),this.main=this.createCollection(),this._voiceLabelView=this._createVoiceLabel(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-editor","ck-rounded-corners"],role:"application",dir:"ltr",lang:t.language,"aria-labelledby":`ck-editor__aria-label_${e}`},children:[this._voiceLabelView,{tag:"div",attributes:{class:["ck","ck-editor__top","ck-reset_all"],role:"presentation"},children:this.top},{tag:"div",attributes:{class:["ck","ck-editor__main"],role:"presentation"},children:this.main}]})}_createVoiceLabel(t){const e=this.t,n=new Pl;return n.text=e("c"),n.extendTemplate({attributes:{id:`ck-editor__aria-label_${t}`,class:"ck-voice-label"}}),n}}class El extends Cl{constructor(t,e){super(t);const n=this.bindTemplate;e&&(this.element=this.editableElement=e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-content","ck-editor__editable","ck-rounded-corners",n.to("isFocused",t=>t?"ck-focused":"ck-blurred")],contenteditable:n.to("isReadOnly",t=>!t)}}),this.set("isReadOnly",!1),this.set("isFocused",!1),this.externalElement=e}render(){super.render(),this.externalElement?this.template.apply(this.element=this.externalElement):this.editableElement=this.element}destroy(){this.externalElement&&this.template.revert(this.externalElement),super.destroy()}}class Sl extends El{constructor(t,e){super(t,e);const n=this.bindTemplate,o=this.t;this.set("name",null);this.extendTemplate({attributes:{role:"textbox","aria-label":n.to("name",t=>o("al",[t])),class:"ck-editor__editable_inline"}})}}function Ol(t){return e=>e+t}n(68);const Rl=Ol("px");class Il extends Cl{constructor(t){super(t);const e=this.bindTemplate;this.set("isActive",!1),this.set("isSticky",!1),this.set("limiterElement",null),this.set("limiterBottomOffset",50),this.set("viewportTopOffset",0),this.set("_marginLeft",null),this.set("_isStickyToTheLimiter",!1),this.set("_hasViewportTopOffset",!1),this.content=this.createCollection(),this._contentPanelPlaceholder=new sl({tag:"div",attributes:{class:["ck","ck-sticky-panel__placeholder"],style:{display:e.to("isSticky",t=>t?"block":"none"),height:e.to("isSticky",t=>t?Rl(this._panelRect.height):null)}}}).render(),this._contentPanel=new sl({tag:"div",attributes:{class:["ck","ck-sticky-panel__content",e.if("isSticky","ck-sticky-panel__content_sticky"),e.if("_isStickyToTheLimiter","ck-sticky-panel__content_sticky_bottom-limit")],style:{width:e.to("isSticky",t=>t?Rl(this._contentPanelPlaceholder.getBoundingClientRect().width):null),top:e.to("_hasViewportTopOffset",t=>t?Rl(this.viewportTopOffset):null),bottom:e.to("_isStickyToTheLimiter",t=>t?Rl(this.limiterBottomOffset):null),marginLeft:e.to("_marginLeft")}},children:this.content}).render(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-sticky-panel"]},children:[this._contentPanelPlaceholder,this._contentPanel]})}render(){super.render(),this._checkIfShouldBeSticky(),this.listenTo(Yr.window,"scroll",()=>{this._checkIfShouldBeSticky()}),this.listenTo(this,"change:isActive",()=>{this._checkIfShouldBeSticky()})}_checkIfShouldBeSticky(){const t=this._panelRect=this._contentPanel.getBoundingClientRect();let e;this.limiterElement?(e=this._limiterRect=this.limiterElement.getBoundingClientRect(),this.isSticky=this.isActive&&e.top<this.viewportTopOffset&&this._panelRect.height+this.limiterBottomOffset<e.height):this.isSticky=!1,this.isSticky?(this._isStickyToTheLimiter=e.bottom<t.height+this.limiterBottomOffset+this.viewportTopOffset,this._hasViewportTopOffset=!this._isStickyToTheLimiter&&!!this.viewportTopOffset,this._marginLeft=this._isStickyToTheLimiter?null:Rl(-Yr.window.scrollX)):(this._isStickyToTheLimiter=!1,this._hasViewportTopOffset=!1,this._marginLeft=null)}}class Fl{constructor(t){if(Object.assign(this,t),t.actions&&t.keystrokeHandler)for(const e in t.actions){let n=t.actions[e];"string"==typeof n&&(n=[n]);for(const o of n)t.keystrokeHandler.set(o,(t,n)=>{this[e](),n()})}}get first(){return this.focusables.find(Dl)||null}get last(){return this.focusables.filter(Dl).slice(-1)[0]||null}get next(){return this._getFocusableItem(1)}get previous(){return this._getFocusableItem(-1)}get current(){let t=null;return null===this.focusTracker.focusedElement?null:(this.focusables.find((e,n)=>{const o=e.element===this.focusTracker.focusedElement;return o&&(t=n),o}),t)}focusFirst(){this._focus(this.first)}focusLast(){this._focus(this.last)}focusNext(){this._focus(this.next)}focusPrevious(){this._focus(this.previous)}_focus(t){t&&t.focus()}_getFocusableItem(t){const e=this.current,n=this.focusables.length;if(!n)return null;if(null===e)return this[1===t?"first":"last"];let o=(e+n+t)%n;do{const e=this.focusables.get(o);if(Dl(e))return e;o=(o+n+t)%n}while(o!==e);return null}}function Dl(t){return!(!t.focus||"none"==Yr.window.getComputedStyle(t.element).display)}class Nl extends Cl{constructor(t){super(t),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__separator"]}})}}n(70);class Ml extends Cl{constructor(t){super(t);const e=this.bindTemplate;this.items=this.createCollection(),this.focusTracker=new Yc,this.keystrokes=new Hc,this.set("isVertical",!1),this.set("className"),this._focusCycler=new Fl({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:["arrowleft","arrowup"],focusNext:["arrowright","arrowdown"]}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar",e.if("isVertical","ck-toolbar_vertical"),e.to("className")]},children:this.items,on:{mousedown:function(t){return t.bindTemplate.to(e=>{e.target===t.element&&e.preventDefault()})}(this)}})}render(){super.render();for(const t of this.items)this.focusTracker.add(t.element);this.items.on("add",(t,e)=>{this.focusTracker.add(e.element)}),this.items.on("remove",(t,e)=>{this.focusTracker.remove(e.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}fillFromConfig(t,e){t.map(t=>{"|"==t?this.items.add(new Nl):e.has(t)?this.items.add(e.create(t)):ps.a.warn("toolbarview-item-unavailable: The requested toolbar item is unavailable.",{name:t})})}}n(72);class Vl extends Tl{constructor(t){super(t),this.stickyPanel=new Il(t),this.toolbar=new Ml(t),this.editable=new Sl(t)}render(){super.render(),this.stickyPanel.content.add(this.toolbar),this.top.add(this.stickyPanel),this.main.add(this.editable)}get editableElement(){return this.editable.element}}class Bl{constructor(){this._replacedElements=[]}replace(t,e){this._replacedElements.push({element:t,newElement:e}),t.style.display="none",e&&t.parentNode.insertBefore(e,t.nextSibling)}restore(){this._replacedElements.forEach(({element:t,newElement:e})=>{t.style.display="",e&&e.remove()}),this._replacedElements=[]}}class Ll extends $c{constructor(t,e){super(e),ei(t)&&(this.sourceElement=t),this._elementReplacer=new Bl,this.data.processor=new Jc,this.model.document.createRoot(),this.ui=new tl(this,new Vl(this.locale)),function(t){if(!lt(t.updateSourceElement))throw new E.b("attachtoform-missing-elementapi-interface: Editor passed to attachToForm() must implement ElementApi.");const e=t.sourceElement;if(e&&"textarea"===e.tagName.toLowerCase()&&e.form){let n;const o=e.form,r=()=>t.updateSourceElement();lt(o.submit)&&(n=o.submit,o.submit=(()=>{r(),n.apply(o)})),o.addEventListener("submit",r),t.on("destroy",()=>{o.removeEventListener("submit",r),n&&(o.submit=n)})}}(this)}get element(){return this.ui.view.element}destroy(){return this.sourceElement&&this.updateSourceElement(),this._elementReplacer.restore(),this.ui.destroy(),super.destroy()}static create(t,e){return new Promise(n=>{const o=new this(t,e);n(o.initPlugins().then(()=>o.ui.init()).then(()=>{ei(t)&&o._elementReplacer.replace(t,o.element),o.fire("uiReady")}).then(()=>o.editing.view.attachDomRoot(o.ui.view.editableElement)).then(()=>{const e=ei(t)?function(t){return t instanceof HTMLTextAreaElement?t.value:t.innerHTML}(t):t;return o.data.init(e)}).then(()=>{o.fire("dataReady"),o.fire("ready")}).then(()=>o))})}}j(Ll,Wc),j(Ll,Gc);n(74);class zl extends Cl{constructor(){super();const t=this.bindTemplate;this.set("content",""),this.set("viewBox","0 0 20 20"),this.set("fillColor",""),this.setTemplate({tag:"svg",ns:"http://www.w3.org/2000/svg",attributes:{class:["ck","ck-icon"],viewBox:t.to("viewBox")}})}render(){super.render(),this._updateXMLContent(),this._colorFillPaths(),this.on("change:content",()=>{this._updateXMLContent(),this._colorFillPaths()}),this.on("change:fillColor",()=>{this._colorFillPaths()})}_updateXMLContent(){if(this.content){const t=(new DOMParser).parseFromString(this.content.trim(),"image/svg+xml").querySelector("svg"),e=t.getAttribute("viewBox");for(e&&(this.viewBox=e),this.element.innerHTML="";t.childNodes.length>0;)this.element.appendChild(t.childNodes[0])}}_colorFillPaths(){this.fillColor&&this.element.querySelectorAll(".ck-icon__fill").forEach(t=>{t.style.fill=this.fillColor})}}n(76);class ql extends Cl{constructor(t){super(t),this.set("text",""),this.set("position","s");const e=this.bindTemplate;this.setTemplate({tag:"span",attributes:{class:["ck","ck-tooltip",e.to("position",t=>"ck-tooltip_"+t),e.if("text","ck-hidden",t=>!t.trim())]},children:[{tag:"span",attributes:{class:["ck","ck-tooltip__text"]},children:[{text:e.to("text")}]}]})}}n(78);class jl extends Cl{constructor(t){super(t);const e=this.bindTemplate,n=R();this.set("class"),this.set("labelStyle"),this.set("icon"),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isVisible",!0),this.set("keystroke"),this.set("label"),this.set("tabindex",-1),this.set("tooltip"),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.children=this.createCollection(),this.tooltipView=this._createTooltipView(),this.labelView=this._createLabelView(n),this.iconView=new zl,this.iconView.extendTemplate({attributes:{class:"ck-button__icon"}}),this.bind("_tooltipString").to(this,"tooltip",this,"label",this,"keystroke",this._getTooltipString.bind(this)),this.setTemplate({tag:"button",attributes:{class:["ck","ck-button",e.to("class"),e.if("isEnabled","ck-disabled",t=>!t),e.if("isVisible","ck-hidden",t=>!t),e.to("isOn",t=>t?"ck-on":"ck-off"),e.if("withText","ck-button_with-text")],type:e.to("type",t=>t||"button"),tabindex:e.to("tabindex"),"aria-labelledby":`ck-editor__aria-label_${n}`,"aria-disabled":e.if("isEnabled",!0,t=>!t),"aria-pressed":e.if("isOn",!0)},children:this.children,on:{mousedown:e.to(t=>{t.preventDefault()}),click:e.to(t=>{this.isEnabled?this.fire("execute"):t.preventDefault()})}})}render(){super.render(),this.icon&&(this.iconView.bind("content").to(this,"icon"),this.children.add(this.iconView)),this.children.add(this.tooltipView),this.children.add(this.labelView)}focus(){this.element.focus()}_createTooltipView(){const t=new ql;return t.bind("text").to(this,"_tooltipString"),t.bind("position").to(this,"tooltipPosition"),t}_createLabelView(t){const e=new Cl,n=this.bindTemplate;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__label"],style:n.to("labelStyle"),id:`ck-editor__aria-label_${t}`},children:[{text:this.bindTemplate.to("label")}]}),e}_getTooltipString(t,e,n){return t?"string"==typeof t?t:(n&&(n=function(t){return ur.isMac?gr(t).map(t=>hr[t.toLowerCase()]||t).reduce((t,e)=>t.slice(-1)in dr?t+e:t+"+"+e):t}(n)),t instanceof Function?t(e,n):`${e}${n?` (${n})`:""}`):""}}class Hl{constructor(t){this.editor=t}destroy(){this.stopListening()}}j(Hl,Bo);class Ul{constructor(){this._stack=[]}add(t,e){const n=this._stack,o=n[0];this._insertDescriptor(t);const r=n[0];o===r||$l(o,r)||this.fire("change:top",{oldDescriptor:o,newDescriptor:r,writer:e})}remove(t,e){const n=this._stack,o=n[0];this._removeDescriptor(t);const r=n[0];o===r||$l(o,r)||this.fire("change:top",{oldDescriptor:o,newDescriptor:r,writer:e})}_insertDescriptor(t){const e=this._stack,n=e.findIndex(e=>e.id===t.id);if($l(t,e[n]))return;n>-1&&e.splice(n,1);let o=0;for(;e[o]&&Wl(e[o],t);)o++;e.splice(o,0,t)}_removeDescriptor(t){const e=this._stack,n=e.findIndex(e=>e.id===t);n>-1&&e.splice(n,1)}}function $l(t,e){return t&&e&&t.priority==e.priority&&Gl(t.classes)==Gl(e.classes)}function Wl(t,e){return t.priority>e.priority||!(t.priority<e.priority)&&Gl(t.classes)>Gl(e.classes)}function Gl(t){return Array.isArray(t)?t.sort().join(","):t}j(Ul,N);var Kl=n(34),Jl=n.n(Kl);const Zl=Symbol("isWidget"),Ql=Symbol("label"),Yl="ck-widget",Xl="ck-widget_selected";function tu(t){return!!t.getCustomProperty(Zl)}function eu(t,e,n={}){return ur.isEdge||e.setAttribute("contenteditable","false",t),e.addClass(Yl,t),e.setCustomProperty(Zl,!0,t),t.getFillerOffset=iu,n.label&&function(t,e,n){n.setCustomProperty(Ql,e,t)}(t,n.label,e),n.hasSelectionHandler&&function(t,e){const n=e.createUIElement("div",{class:"ck ck-widget__selection-handler"},function(t){const e=this.toDomElement(t),n=new zl;return n.set("content",Jl.a),n.render(),e.appendChild(n.element),e});e.insert(Jo.createAt(t),n),e.addClass(["ck-widget_selectable"],t)}(t,e),function(t,e,n,o){const r=new Ul;r.on("change:top",(e,r)=>{r.oldDescriptor&&o(t,r.oldDescriptor,r.writer),r.newDescriptor&&n(t,r.newDescriptor,r.writer)}),e.setCustomProperty("addHighlight",(t,e,n)=>r.add(e,n),t),e.setCustomProperty("removeHighlight",(t,e,n)=>r.remove(e,n),t)}(t,e,(t,e,n)=>n.addClass(o(e.classes),t),(t,e,n)=>n.removeClass(o(e.classes),t)),t;function o(t){return Array.isArray(t)?t:[t]}}function nu(t){const e=t.getCustomProperty(Ql);return e?"function"==typeof e?e():e:""}function ou(t,e){return e.addClass(["ck-editor__editable","ck-editor__nested-editable"],t),ur.isEdge||(e.setAttribute("contenteditable",t.isReadOnly?"false":"true",t),t.on("change:isReadOnly",(n,o,r)=>{e.setAttribute("contenteditable",r?"false":"true",t)})),t.on("change:isFocused",(n,o,r)=>{r?e.addClass("ck-editor__nested-editable_focused",t):e.removeClass("ck-editor__nested-editable_focused",t)}),t}function ru(t){const e=t.getSelectedElement();if(e)return Us.createAfter(e);const n=t.getSelectedBlocks().next().value;if(n){if(n.isEmpty)return Us.createAt(n);const e=Us.createAfter(n);return t.focus.isTouching(e)?e:Us.createBefore(n)}return t.focus}function iu(){return null}class su extends Hl{static get pluginName(){return"OPMacroToc"}static get buttonName(){return"insertToc"}init(){const t=this.editor,e=t.model,n=t.conversion;e.schema.register("op-macro-toc",{allowWhere:"$block",isBlock:!0,isLimit:!0}),n.for("upcast").add(Da({view:{name:"macro",classes:"toc"},model:"op-macro-toc"})),n.for("editingDowncast").add(ca({model:"op-macro-toc",view:(t,e)=>eu(this.createTocViewElement(e),e,{label:this.label})})),n.for("dataDowncast").add(ca({model:"op-macro-toc",view:(t,e)=>this.createTocDataElement(e)})),t.ui.componentFactory.add(su.buttonName,e=>{const n=new jl(e);return n.set({label:this.label,withText:!0}),n.on("execute",()=>{t.model.change(e=>{const n=e.createElement("op-macro-toc",{});t.model.insertContent(n,t.model.document.selection)})}),n})}get label(){return window.I18n.t("js.editor.macro.toc")}createTocViewElement(t){const e=t.createText(this.label),n=t.createContainerElement("div",{class:"macro -toc"});return t.insert(Jo.createAt(n),e),n}createTocDataElement(t){return t.createContainerElement("macro",{class:"toc"})}}const au=Symbol("isOPEmbeddedTable");function cu(t){const e=t.getSelectedElement();return!(!e||!function(t){return!!t.getCustomProperty(au)&&tu(t)}(e))}class lu extends Hl{static get pluginName(){return"EmbeddedTableEditing"}static get buttonName(){return"insertEmbeddedTable"}init(){const t=this.editor,e=t.model,n=t.conversion,o=t.config.get("openProject.pluginContext");this.text={button:window.I18n.t("js.editor.macro.embedded_table.button"),macro_text:window.I18n.t("js.editor.macro.embedded_table.text")},e.schema.register("op-macro-embedded-table",{allowWhere:"$block",allowAttributes:["opEmbeddedTableQuery"],isBlock:!0,isObject:!0}),n.for("upcast").add(Da({view:{name:"macro",classes:"embedded-table"},model:(t,e)=>{const n=t.getAttribute("data-query-props");return e.createElement("op-macro-embedded-table",{opEmbeddedTableQuery:n?JSON.parse(n):{}})}})),n.for("editingDowncast").add(ca({model:"op-macro-embedded-table",view:(t,e)=>(function(t,e,n){return e.setCustomProperty(au,!0,t),eu(t,e,{label:"your label here"})})(this.createEmbeddedTableView(e),e,this.label)})),n.for("dataDowncast").add(ca({model:"op-macro-embedded-table",view:(t,e)=>this.createEmbeddedTableDataElement(t,e)})),t.ui.componentFactory.add(lu.buttonName,e=>{const n=new jl(e);return n.set({label:this.text.button,withText:!0}),n.on("execute",()=>{o.services.externalQueryConfiguration.show({},e=>t.model.change(n=>{const o=n.createElement("op-macro-embedded-table",{opEmbeddedTableQuery:e});t.model.insertContent(o,t.model.document.selection)}))}),n})}createEmbeddedTableView(t){const e=t.createText(this.text.macro_text),n=t.createContainerElement("div",{class:"macro -embedded-table"});return t.insert(Jo.createAt(n),e),n}createEmbeddedTableDataElement(t,e){const n=t.getAttribute("opEmbeddedTableQuery")||{};return e.createContainerElement("macro",{class:"embedded-table","data-query-props":JSON.stringify(n)})}}class uu extends Qi{constructor(t){super(t),this.domEventType="mousedown"}onDomEvent(t){this.fire(t.type,t)}}n(80);const du=mr("Ctrl+A");class hu extends Hl{static get pluginName(){return"Widget"}init(){const t=this.editor.editing.view,e=t.document;this._previouslySelected=new Set,this.editor.editing.downcastDispatcher.on("selection",(t,e,n)=>{this._clearPreviouslySelectedWidgets(n.writer);const o=n.writer,r=o.document.selection,i=r.getSelectedElement();for(const t of r.getRanges())for(const e of t){const t=e.item;t.is("element")&&tu(t)&&(o.addClass(Xl,t),this._previouslySelected.add(t),t==i&&o.setSelection(r.getRanges(),{fake:!0,label:nu(i)}))}},{priority:"low"}),t.addObserver(uu),this.listenTo(e,"mousedown",(...t)=>this._onMousedown(...t)),this.listenTo(e,"keydown",(...t)=>this._onKeydown(...t),{priority:"high"}),this.listenTo(e,"delete",(t,e)=>{this._handleDelete("forward"==e.direction)&&(e.preventDefault(),t.stop())},{priority:"high"})}_onMousedown(t,e){const n=this.editor,o=n.editing.view,r=o.document;let i=e.target;if(function(t){for(;t;){if(t instanceof $o&&!(t instanceof Go))return!0;t=t.parent}return!1}(i))return;if(!tu(i)&&!(i=i.findAncestor(tu)))return;e.preventDefault(),r.isFocused||o.focus();const s=n.editing.mapper.toModelElement(i);this._setSelectionOverElement(s)}_onKeydown(t,e){const n=e.keyCode,o=n==fr.delete||n==fr.arrowdown||n==fr.arrowright;let r=!1;!function(t){return t==fr.arrowright||t==fr.arrowleft||t==fr.arrowup||t==fr.arrowdown}(n)?!function(t){return pr(t)==du}(e)?n===fr.enter&&(r=this._handleEnterKey(e.shiftKey)):r=this._selectAllNestedEditableContent()||this._selectAllContent():r=this._handleArrowKeys(o),r&&(e.preventDefault(),t.stop())}_handleDelete(t){if(this.editor.isReadOnly)return;const e=this.editor.model.document.selection;if(!e.isCollapsed)return;const n=this._getObjectElementNextToSelection(t);return n?(this.editor.model.change(t=>{let o=e.anchor.parent;for(;o.isEmpty;){const e=o;o=e.parent,t.remove(e)}this._setSelectionOverElement(n)}),!0):void 0}_handleArrowKeys(t){const e=this.editor.model,n=e.schema,o=e.document.selection,r=o.getSelectedElement();if(r&&n.isObject(r)){const r=t?o.getLastPosition():o.getFirstPosition(),i=n.getNearestSelectionRange(r,t?"forward":"backward");return i&&e.change(t=>{t.setSelection(i)}),!0}if(!o.isCollapsed)return;const i=this._getObjectElementNextToSelection(t);return i instanceof zs&&n.isObject(i)?(this._setSelectionOverElement(i),!0):void 0}_handleEnterKey(t){const e=this.editor.model,n=e.document.selection.getSelectedElement();if(n&&e.schema.isObject(n))return e.change(e=>{const o=e.createElement("paragraph");e.insert(o,n,t?"before":"after"),e.setSelection(o,"in")}),!0}_selectAllNestedEditableContent(){const t=this.editor.model,e=t.document.selection,n=t.schema.getLimitElement(e);return e.getFirstRange().root!=n&&(t.change(t=>{t.setSelection($s.createIn(n))}),!0)}_selectAllContent(){const t=this.editor.model,e=this.editor.editing,n=e.view.document.selection.getSelectedElement();if(n&&tu(n)){const o=e.mapper.toModelElement(n.parent);return t.change(t=>{t.setSelection($s.createIn(o))}),!0}return!1}_setSelectionOverElement(t){this.editor.model.change(e=>{e.setSelection($s.createOn(t))})}_getObjectElementNextToSelection(t){const e=this.editor.model,n=e.schema,o=e.document.selection,r=new Qs(o);e.modifySelection(r,{direction:t?"forward":"backward"});const i=t?r.focus.nodeBefore:r.focus.nodeAfter;return i instanceof zs&&n.isObject(i)?i:null}_clearPreviouslySelectedWidgets(t){for(const e of this._previouslySelected)t.removeClass(Xl,e);this._previouslySelected.clear()}}function fu(t,e,n){const{left:o,top:r,name:i}=t(e,n);return[i,n.clone().moveTo(o,r)]}function pu({left:t,top:e}){const{scrollX:n,scrollY:o}=Yr.window;return{left:t+n,top:e+o}}n(82);const mu=Ol("px"),gu=Yr.document.body;class bu extends Cl{constructor(t){super(t);const e=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("position","arrow_nw"),this.set("isVisible",!1),this.set("withArrow",!0),this.set("className"),this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-panel",e.to("position",t=>`ck-balloon-panel_${t}`),e.if("isVisible","ck-balloon-panel_visible"),e.if("withArrow","ck-balloon-panel_with-arrow"),e.to("className")],style:{top:e.to("top",mu),left:e.to("left",mu)}},children:this.content})}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(t){this.show();const e=bu.defaultPositions,n=Object.assign({},{element:this.element,positions:[e.southArrowNorth,e.southArrowNorthWest,e.southArrowNorthEast,e.northArrowSouth,e.northArrowSouthWest,e.northArrowSouthEast],limiter:gu,fitInViewport:!0},t),{top:o,left:r,name:i}=bu._getOptimalPosition(n);Object.assign(this,{top:o,left:r,position:i})}pin(t){this.unpin(),this._pinWhenIsVisibleCallback=(()=>{this.isVisible?this._startPinning(t):this._stopPinning()}),this._startPinning(t),this.listenTo(this,"change:isVisible",this._pinWhenIsVisibleCallback)}unpin(){this._pinWhenIsVisibleCallback&&(this._stopPinning(),this.stopListening(this,"change:isVisible",this._pinWhenIsVisibleCallback),this._pinWhenIsVisibleCallback=null,this.hide())}_startPinning(t){this.attachTo(t);const e=wu(t.target),n=t.limiter?wu(t.limiter):gu;this.listenTo(Yr.document,"scroll",(o,r)=>{const i=r.target,s=e&&i.contains(e),a=n&&i.contains(n);!s&&!a&&e&&n||this.attachTo(t)},{useCapture:!0}),this.listenTo(Yr.window,"resize",()=>{this.attachTo(t)})}_stopPinning(){this.stopListening(Yr.document,"scroll"),this.stopListening(Yr.window,"resize")}}function wu(t){return ei(t)?t:ws(t)?t.commonAncestorContainer:"function"==typeof t?wu(t()):null}function _u(t,e){return t.top-e.height-bu.arrowVerticalOffset}function ku(t){return t.bottom+bu.arrowVerticalOffset}bu.arrowHorizontalOffset=25,bu.arrowVerticalOffset=10,bu._getOptimalPosition=function({element:t,target:e,positions:n,limiter:o,fitInViewport:r}){lt(e)&&(e=e()),lt(o)&&(o=o());const i=function(t){for(;t&&"html"!=t.tagName.toLowerCase();){if("static"!=Yr.window.getComputedStyle(t).position)return t;t=t.parentElement}return null}(t.parentElement),s=new vs(t),a=new vs(e);let c,l;if(o||r){const t=o&&new vs(o).getVisible(),e=r&&new vs(Yr.window);[l,c]=function(t,e,n,o,r){let i,s,a=0,c=0;const l=n.getArea();return t.some(t=>{const[u,d]=fu(t,e,n);let h,f;if(o)if(r){const t=o.getIntersection(r);h=t?t.getIntersectionArea(d):0}else h=o.getIntersectionArea(d);function p(){c=f,a=h,i=d,s=u}return r&&(f=r.getIntersectionArea(d)),r&&!o?f>c&&p():!r&&o?h>a&&p():f>c&&h>=a?p():f>=c&&h>a&&p(),h===l}),i?[s,i]:null}(n,a,s,t,e)||fu(n[0],a,s)}else[l,c]=fu(n[0],a,s);let{left:u,top:d}=pu(c);if(i){const t=pu(new vs(i)),e=_s(i);u-=t.left,d-=t.top,u+=i.scrollLeft,d+=i.scrollTop,u-=e.left,d-=e.top}return{left:u,top:d,name:l}},bu.defaultPositions={northArrowSouth:(t,e)=>({top:_u(t,e),left:t.left+t.width/2-e.width/2,name:"arrow_s"}),northArrowSouthEast:(t,e)=>({top:_u(t,e),left:t.left+t.width/2-e.width+bu.arrowHorizontalOffset,name:"arrow_se"}),northArrowSouthWest:(t,e)=>({top:_u(t,e),left:t.left+t.width/2-bu.arrowHorizontalOffset,name:"arrow_sw"}),northWestArrowSouth:(t,e)=>({top:_u(t,e),left:t.left-e.width/2,name:"arrow_s"}),northWestArrowSouthWest:(t,e)=>({top:_u(t,e),left:t.left-bu.arrowHorizontalOffset,name:"arrow_sw"}),northWestArrowSouthEast:(t,e)=>({top:_u(t,e),left:t.left-e.width+bu.arrowHorizontalOffset,name:"arrow_se"}),northEastArrowSouth:(t,e)=>({top:_u(t,e),left:t.right-e.width/2,name:"arrow_s"}),northEastArrowSouthEast:(t,e)=>({top:_u(t,e),left:t.right-e.width+bu.arrowHorizontalOffset,name:"arrow_se"}),northEastArrowSouthWest:(t,e)=>({top:_u(t,e),left:t.right-bu.arrowHorizontalOffset,name:"arrow_sw"}),southArrowNorth:(t,e)=>({top:ku(t),left:t.left+t.width/2-e.width/2,name:"arrow_n"}),southArrowNorthEast:(t,e)=>({top:ku(t),left:t.left+t.width/2-e.width+bu.arrowHorizontalOffset,name:"arrow_ne"}),southArrowNorthWest:(t,e)=>({top:ku(t),left:t.left+t.width/2-bu.arrowHorizontalOffset,name:"arrow_nw"}),southWestArrowNorth:(t,e)=>({top:ku(t),left:t.left-e.width/2,name:"arrow_n"}),southWestArrowNorthWest:(t,e)=>({top:ku(t),left:t.left-bu.arrowHorizontalOffset,name:"arrow_nw"}),southWestArrowNorthEast:(t,e)=>({top:ku(t),left:t.left-e.width+bu.arrowHorizontalOffset,name:"arrow_ne"}),southEastArrowNorth:(t,e)=>({top:ku(t),left:t.right-e.width/2,name:"arrow_n"}),southEastArrowNorthEast:(t,e)=>({top:ku(t),left:t.right-e.width+bu.arrowHorizontalOffset,name:"arrow_ne"}),southEastArrowNorthWest:(t,e)=>({top:ku(t),left:t.right-bu.arrowHorizontalOffset,name:"arrow_nw"})};class vu extends Hl{static get pluginName(){return"ContextualBalloon"}init(){this.view=new bu,this.positionLimiter=(()=>{const t=this.editor.editing.view,e=t.document.selection.editableElement;return e?t.domConverter.mapViewToDom(e.root):null}),this._stack=new Map,this.editor.ui.view.body.add(this.view),this.editor.ui.focusTracker.add(this.view.element)}get visibleView(){const t=this._stack.get(this.view.content.get(0));return t?t.view:null}hasView(t){return this._stack.has(t)}add(t){if(this.hasView(t.view))throw new E.b("contextualballoon-add-view-exist: Cannot add configuration of the same view twice.");this.visibleView&&this.view.content.remove(this.visibleView),this._stack.set(t.view,t),this._show(t)}remove(t){if(!this.hasView(t))throw new E.b("contextualballoon-remove-view-not-exist: Cannot remove configuration of not existing view.");if(this.visibleView===t){this.view.content.remove(t),this._stack.delete(t);const e=Array.from(this._stack.values()).pop();e?this._show(e):this.view.hide()}else this._stack.delete(t)}updatePosition(t){t&&(this._stack.get(this.visibleView).position=t),this.view.pin(this._getBalloonPosition())}_show({view:t,balloonClassName:e=""}){this.view.className=e,this.view.content.add(t),this.view.pin(this._getBalloonPosition())}_getBalloonPosition(){let t=Array.from(this._stack.values()).pop().position;return t&&!t.limiter&&(t=Object.assign({},t,{limiter:this.positionLimiter})),t}}var yu=n(35),xu=n.n(yu);function Cu(t,e,n){t.ui.componentFactory.add(e,e=>{const o=new jl(e);return o.set({label:I18n.t("js.button_edit"),icon:xu.a,tooltip:!0}),o.on("execute",()=>{const e=t.model.document.selection.getSelectedElement();e&&n(e)}),o})}const Au="ck-toolbar-container";function Pu(t,e,n,o){const r=e.config.get(n+".toolbar");if(!r||!r.length)return;const i=e.plugins.get("ContextualBalloon"),s=new Ml;function a(){e.ui.focusTracker.isFocused&&o(e.editing.view.document.selection)?l()?function(t,e){const n=t.plugins.get("ContextualBalloon");if(e(t.editing.view.document.selection)){const e=Tu(t);n.updatePosition(e)}}(e,o):i.hasView(s)||i.add({view:s,position:Tu(e),balloonClassName:Au}):c()}function c(){l()&&i.remove(s)}function l(){return i.visibleView==s}s.fillFromConfig(r,e.ui.componentFactory),t.listenTo(e.editing.view,"render",a),t.listenTo(e.ui.focusTracker,"change:isFocused",a,{priority:"low"})}function Tu(t){const e=t.editing.view,n=bu.defaultPositions;return{target:e.domConverter.viewToDom(e.document.selection.getSelectedElement()),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast]}}class Eu extends Hl{static get requires(){return[vu]}static get pluginName(){return"EmbeddedTableToolbar"}init(){const t=this.editor,e=this.editor.model,n=t.config.get("openProject.pluginContext");Cu(t,"opEditEmbeddedTableQuery",t=>{const o=n.services.externalQueryConfiguration,r=t.getAttribute("opEmbeddedTableQuery")||{};o.show(r,n=>e.change(e=>{e.setAttribute("opEmbeddedTableQuery",n,t)}))})}afterInit(){Pu(this,this.editor,"OPMacroEmbeddedTable",cu)}}const Su=Symbol("isWpButtonMacroSymbol");function Ou(t){const e=t.getSelectedElement();return!(!e||!function(t){return!!t.getCustomProperty(Su)&&tu(t)}(e))}class Ru extends Hl{static get pluginName(){return"OPMacroWpButtonEditing"}static get buttonName(){return"insertWorkPackageButton"}init(){const t=this.editor,e=t.model,n=t.conversion,o=t.config.get("openProject.pluginContext");e.schema.register("op-macro-wp-button",{allowWhere:["$block"],allowAttributes:["type","classes"],isBlock:!0,isLimit:!0}),n.for("upcast").add(Da({view:{name:"macro",classes:"create_work_package_link"},model:(t,e)=>{const n=t.getAttribute("data-type")||"",o=t.getAttribute("data-classes")||"";return e.createElement("op-macro-wp-button",{type:n,classes:o})}})),n.for("editingDowncast").add(ca({model:"op-macro-wp-button",view:(t,e)=>this.createMacroViewElement(t,e)})),n.for("dataDowncast").add(ca({model:"op-macro-wp-button",view:(t,e)=>{return e.createContainerElement("macro",{class:"create_work_package_link","data-type":t.getAttribute("type")||"","data-classes":t.getAttribute("classes")||""})}})),t.ui.componentFactory.add(Ru.buttonName,e=>{const n=new jl(e);return n.set({label:window.I18n.t("js.editor.macro.work_package_button.button"),withText:!0}),n.on("execute",()=>{o.services.macros.configureWorkPackageButton().then(e=>t.model.change(n=>{const o=n.createElement("op-macro-wp-button",{});n.setAttribute("type",e.type,o),n.setAttribute("classes",e.classes,o),t.model.insertContent(o,t.model.document.selection)}))}),n})}macroLabel(t){return t?window.I18n.t("js.editor.macro.work_package_button.with_type",{typename:t}):window.I18n.t("js.editor.macro.work_package_button.without_type")}createMacroViewElement(t,e){t.getAttribute("type");const n=t.getAttribute("classes")||"",o=this.macroLabel(),r=e.createText(o),i=e.createContainerElement("span",{class:"macro -create_work_package_link "+n});return e.insert(Jo.createAt(i),r),function(t,e,n){return e.setCustomProperty(Su,!0,t),eu(t,e,{label:n})}(i,e,{label:o})}}class Iu extends Hl{static get requires(){return[vu]}static get pluginName(){return"OPMacroWpButtonToolbar"}init(){const t=this.editor,e=(this.editor.model,t.config.get("openProject.pluginContext"));Cu(t,"opEditWpMacroButton",n=>{const o=e.services.macros,r=n.getAttribute("type"),i=n.getAttribute("classes");o.configureWorkPackageButton(r,i).then(e=>t.model.change(t=>{t.setAttribute("classes",e.classes,n),t.setAttribute("type",e.type,n)}))})}afterInit(){Pu(this,this.editor,"OPMacroWpButton",Ou)}}const Fu=Symbol("isWpButtonMacroSymbol");function Du(t){const e=t.getSelectedElement();return!(!e||!function(t){return!!t.getCustomProperty(Fu)&&tu(t)}(e))}class Nu extends Hl{static get pluginName(){return"OPWikiIncludePageEditing"}static get buttonName(){return"insertWikiPageInclude"}init(){const t=this.editor,e=t.model,n=t.conversion,o=t.config.get("openProject.pluginContext");e.schema.register("op-macro-wiki-page-include",{allowWhere:["$block"],allowAttributes:["page"],isBlock:!0,isLimit:!0}),n.for("upcast").add(Da({view:{name:"macro",classes:"include_wiki_page"},model:(t,e)=>{const n=t.getAttribute("data-page")||"";return e.createElement("op-macro-wiki-page-include",{page:n})}})),n.for("editingDowncast").add(ca({model:"op-macro-wiki-page-include",view:(t,e)=>this.createMacroViewElement(t,e)})).add(t=>t.on("attribute:page",this.modelAttributeToView.bind(this))),n.for("dataDowncast").add(ca({model:"op-macro-wiki-page-include",view:(t,e)=>{return e.createContainerElement("macro",{class:"include_wiki_page","data-page":t.getAttribute("page")||""})}})),t.ui.componentFactory.add(Nu.buttonName,e=>{const n=new jl(e);return n.set({label:window.I18n.t("js.editor.macro.wiki_page_include.button"),withText:!0}),n.on("execute",()=>{o.services.macros.configureWikiPageInclude().then(e=>t.model.change(n=>{const o=n.createElement("op-macro-wiki-page-include",{});n.setAttribute("page",e,o),t.model.insertContent(o,t.model.document.selection)}))}),n})}modelAttributeToView(t,e,n){const o=e.item;if(!o.is("op-macro-wiki-page-include"))return;n.consumable.consume(e.item,t.name);const r=n.mapper.toViewElement(o);n.writer.remove(Zo.createIn(r)),this.setPlaceholderContent(n.writer,o,r)}macroLabel(){return window.I18n.t("js.editor.macro.wiki_page_include.text")}pageLabel(t){return t&&t.length>0?t:window.I18n.t("js.editor.macro.wiki_page_include.not_set")}createMacroViewElement(t,e){const n=e.createContainerElement("div",{class:"macro -wiki_page_include"});return this.setPlaceholderContent(e,t,n),function(t,e,n){return e.setCustomProperty(Fu,!0,t),eu(t,e,{label:n})}(n,e,{label:this.macroLabel()})}setPlaceholderContent(t,e,n){const o=e.getAttribute("page"),r=this.macroLabel(),i=this.pageLabel(o),s=t.createContainerElement("span",{class:"macro-value"});let a=[t.createText(`${r} `)];t.insert(Jo.createAt(s),t.createText(`${i}`)),a.push(s),t.insert(Jo.createAt(n),a)}}class Mu extends Hl{static get requires(){return[vu]}static get pluginName(){return"OPWikiIncludePageToolbar"}init(){const t=this.editor,e=(this.editor.model,t.config.get("openProject.pluginContext"));Cu(t,"opEditWikiIncludeMacroButton",n=>{const o=e.services.macros,r=n.getAttribute("page");o.configureWikiPageInclude(r).then(e=>t.model.change(t=>{t.setAttribute("page",e,n)}))})}afterInit(){Pu(this,this.editor,"OPWikiIncludePage",Du)}}class Vu{constructor(t){this.editor=t,this.set("value",void 0),this.set("isEnabled",!1),this.decorate("execute"),this.listenTo(this.editor.model.document,"change",()=>{this.refresh()}),this.on("execute",t=>{this.isEnabled||t.stop()},{priority:"high"}),this.listenTo(t,"change:isReadOnly",(t,e,n)=>{n?(this.on("set:isEnabled",Bu,{priority:"highest"}),this.isEnabled=!1):(this.off("set:isEnabled",Bu),this.refresh())})}refresh(){this.isEnabled=!0}execute(){}destroy(){this.stopListening()}}function Bu(t){t.return=!1,t.stop()}j(Vu,Bo);class Lu extends Vu{execute(){const t=this.editor.model,e=t.document;t.change(n=>{!function(t,e,n,o){const r=n.isCollapsed,i=n.getFirstRange(),s=i.start.parent,a=i.end.parent;if(o.isLimit(s)||o.isLimit(a))return void(r||s!=a||t.deleteContent(n));if(r)zu(e,n,i.start);else{const o=!(i.start.isAtStart&&i.end.isAtEnd),r=s==a;t.deleteContent(n,{leaveUnmerged:o}),o&&(r?zu(e,n,n.focus):e.setSelection(a,0))}}(this.editor.model,n,e.selection,t.schema),this.fire("afterExecute",{writer:n})})}}function zu(t,e,n){const o=n.parent,r=new o.constructor(o.name,o.getAttributes());n.isAtEnd?t.insert(r,n.parent,"after"):n.isAtStart?t.insert(r,n.parent,"before"):t.split(n),t.setSelection(n.parent.nextSibling,0)}class qu extends Lu{execute(){this.atJsOpen||super.execute()}get isAtJsOpen(){return this.atJsOpen}set isAtJsOpen(t){this.atJsOpen=t}}function ju(t,e){let n,o=function(t){return jQuery("<span/>",t).addClass("atwho-query")},r=jQuery.extend({},{at:"#",startWithSpace:!1,searchKey:"id_subject",displayTpl:'<li data-value="${atwho-at}${id}">${to_s}</li>',insertTpl:"${atwho-at}${id}",limit:10,callbacks:{matcher:function(t,n,o,r){if(e.ignorePrefix&&n.match(e.ignorePrefix))return null;return jQuery.fn.atwho.default.callbacks.matcher.call(this,t,n,o,r)},remoteFilter:function(t,e){let r=this;this.getOpt("remoteUrl")(t,function(i){i&&(i=r.getOpt("remoteDataPreparation").call(r,i),r.query.el=function(t){let e=o(this.app.document),n=this._getRange(),r=n.startOffset-this.at.length-t.length;return n.setStart(n.startContainer,r),this.currentRangeProperties={current:n,start:r,end:n.endOffset},n.surroundContents(e.get(0)),e}.call(r,t),jQuery(n).is(":visible")?e(i):e([]))})},sorter:function(t,e,n){return e},beforeInsert:function(t,e,n){return this.query.el=function(){let t=o(this.app.document),e=this.currentRangeProperties.current,n=e.cloneRange(),r=e.startContainer.childNodes[0],i=e.endContainer.childNodes[0];return n.setStart(r,this.currentRangeProperties.start),n.setEnd(i,this.currentRangeProperties.end),n.surroundContents(t.get(0)),t}.call(this),t}},functionOverrides:{insert:function(t,e){let n,o,r,i;return r=""===(r=this.getOpt("suffix"))?r:r||" ",n=e.data("item-data"),this.query.el.removeClass("atwho-query").addClass("atwho-inserted").html(t).attr("data-atwho-at-query",""+n["atwho-at"]+this.query.text).attr("contenteditable","false"),(o=this._getRange())&&(this.query.el.length&&o.setEndAfter(this.query.el[0]),o.collapse(!1),o.insertNode(i=this.app.document.createTextNode(""+r)),this._setRange("after",i,o)),this.$inputor.change()}}},e);t.model.document.once("change",()=>{e.isSupportedContext&&!e.isSupportedContext()||((n=jQuery(t.element)).is(".ck-editor__editable")||(n=n.closest(".op-ckeditor--wrapper").find(".ck-editor__editable")),n.atwho(r),jQuery(n).on("shown.atwho",()=>{t.commands.get("enter").isAtJsOpen=!0}).on("hidden.atwho",()=>{t.commands.get("enter").isAtJsOpen=!1}))})}function Hu(t,e){return t.config.get("openProject.pluginContext").services[e]}function Uu(t){return t.config.get("openProject.context.resource")}function $u(t,e){return Hu(t,"pathHelperService")}class Wu extends Hl{static get pluginName(){return"PendingActions"}init(){this.set("hasAny",!1),this._actions=new er({idProperty:"_id"}),this._actions.delegate("add","remove").to(this)}add(t){if("string"!=typeof t)throw new E.b("pendingactions-add-invalid-message: The message must be a string.");const e=Object.create(Bo);return e.set("message",t),this._actions.add(e),this.hasAny=!0,e}remove(t){this._actions.remove(t),this.hasAny=!!this._actions.length}get first(){return this._actions.get(0)}[Symbol.iterator](){return this._actions[Symbol.iterator]()}}class Gu{constructor(){const t=new window.FileReader;this._reader=t,this.set("loaded",0),t.onprogress=(t=>{this.loaded=t.loaded})}get error(){return this._reader.error}read(t){const e=this._reader;return this.total=t.size,new Promise((n,o)=>{e.onload=(()=>{n(e.result)}),e.onerror=(()=>{o("error")}),e.onabort=(()=>{o("aborted")}),this._reader.readAsDataURL(t)})}abort(){this._reader.abort()}}j(Gu,Bo);class Ku extends Hl{static get pluginName(){return"FileRepository"}static get requires(){return[Wu]}init(){this.loaders=new er,this.loaders.on("add",()=>this._updatePendingAction()),this.loaders.on("remove",()=>this._updatePendingAction()),this._pendingAction=null,this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(t,e)=>e?t/e*100:0)}getLoader(t){for(const e of this.loaders)if(e.file==t)return e;return null}createLoader(t){if(!this.createUploadAdapter)return ps.a.error("filerepository-no-upload-adapter: Upload adapter is not defined."),null;const e=new Ju(t);return e._adapter=this.createUploadAdapter(e),this.loaders.add(e),e.on("change:uploaded",()=>{let t=0;for(const e of this.loaders)t+=e.uploaded;this.uploaded=t}),e.on("change:uploadTotal",()=>{let t=0;for(const e of this.loaders)e.uploadTotal&&(t+=e.uploadTotal);this.uploadTotal=t}),e}destroyLoader(t){const e=t instanceof Ju?t:this.getLoader(t);e._destroy(),this.loaders.remove(e)}_updatePendingAction(){const t=this.editor.plugins.get(Wu);if(this.loaders.length){if(!this._pendingAction){const e=this.editor.t,n=t=>`${e("b")} ${parseInt(t)}%.`;this._pendingAction=t.add(n(this.uploadedPercent)),this._pendingAction.bind("message").to(this,"uploadedPercent",n)}}else t.remove(this._pendingAction),this._pendingAction=null}}j(Ku,Bo);class Ju{constructor(t,e){this.id=R(),this.file=t,this._adapter=e,this._reader=new Gu,this.set("status","idle"),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(t,e)=>e?t/e*100:0),this.set("uploadResponse",null)}read(){if("idle"!=this.status)throw new E.b("filerepository-read-wrong-status: You cannot call read if the status is different than idle.");return this.status="reading",this._reader.read(this.file).then(t=>(this.status="idle",t)).catch(t=>{if("aborted"===t)throw this.status="aborted","aborted";throw this.status="error",this._reader.error})}upload(){if("idle"!=this.status)throw new E.b("filerepository-upload-wrong-status: You cannot call upload if the status is different than idle.");return this.status="uploading",this._adapter.upload().then(t=>(this.uploadResponse=t,this.status="idle",t)).catch(t=>{if("aborted"===this.status)throw"aborted";throw this.status="error",t})}abort(){const t=this.status;this.status="aborted","reading"==t&&this._reader.abort(),"uploading"==t&&this._adapter.abort&&this._adapter.abort(),this._destroy()}_destroy(){this._reader=void 0,this._adapter=void 0,this.data=void 0,this.uploadResponse=void 0,this.file=void 0}}j(Ju,Bo);class Zu{constructor(t,e,n){this.loader=t,this.resource=e,this.editor=n}upload(){const t=this.resource;if(!t||!t.uploadAttachments){const e=t?t.name:"Missing context";return console.warn(`uploadAttachments not present on context: ${e}`),Promise.reject("You're not allowed to upload attachments on this resource.")}return t.uploadAttachments([this.loader.file]).then(t=>(this.editor.model.fire("op:attachment-added",t),this.buildResponse(t[0]))).catch(t=>{console.error("Failed upload %O",t)})}buildResponse(t){return{default:t.uploadUrl}}abort(){return!1}}class Qu extends Cl{constructor(t){super(t),this.buttonView=new jl(t),this._fileInputView=new Yu(t),this._fileInputView.bind("acceptedType").to(this),this._fileInputView.bind("allowMultipleFiles").to(this),this._fileInputView.delegate("done").to(this),this.setTemplate({tag:"span",attributes:{class:"ck-file-dialog-button"},children:[this.buttonView,this._fileInputView]}),this.buttonView.on("execute",()=>{this._fileInputView.open()})}focus(){this.buttonView.focus()}}class Yu extends Cl{constructor(t){super(t),this.set("acceptedType"),this.set("allowMultipleFiles",!1);const e=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck-hidden"],type:"file",tabindex:"-1",accept:e.to("acceptedType"),multiple:e.to("allowMultipleFiles")},on:{change:e.to(()=>{this.element&&this.element.files&&this.element.files.length&&this.fire("done",this.element.files),this.element.value=""})}})}open(){this.element.click()}}var Xu=n(36),td=n.n(Xu);function ed(t){return/^image\/(jpeg|png|gif|bmp)$/.test(t.type)}class nd extends Hl{init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("imageUpload",n=>{const o=new Qu(n),r=t.commands.get("imageUpload");return o.set({acceptedType:"image/*",allowMultipleFiles:!0}),o.buttonView.set({label:e("ba"),icon:td.a,tooltip:!0}),o.buttonView.bind("isEnabled").to(r),o.on("done",(e,n)=>{const o=Array.from(n).filter(ed);o.length&&t.execute("imageUpload",{files:o})}),o})}}var od=n(37),rd=n.n(od);n(84),n(86),n(88);class id extends Hl{constructor(t){super(t),this.placeholder="data:image/svg+xml;utf8,"+encodeURIComponent(rd.a)}init(){this.editor.editing.downcastDispatcher.on("attribute:uploadStatus:image",(...t)=>this.uploadStatusChange(...t))}uploadStatusChange(t,e,n){const o=this.editor,r=e.item,i=r.getAttribute("uploadId");if(!n.consumable.consume(e.item,t.name))return;const s=o.plugins.get(Ku),a=i?e.attributeNewValue:null,c=this.placeholder,l=o.editing.mapper.toViewElement(r),u=n.writer;if("reading"==a)return cd(l,u),void ld(c,l,u);if("uploading"==a){const t=s.loaders.get(i);return cd(l,u),void(t?(ud(l,u),function(t,e,n,o){const r=function(t){const e=t.createUIElement("div",{class:"ck-progress-bar"});return t.setCustomProperty(sd,!0,e),e}(e);e.insert(Jo.createAt(t,"end"),r),n.on("change:uploadedPercent",(t,e,n)=>{o.change(t=>{t.setStyle("width",n+"%",r)})})}(l,u,t,o.editing.view)):ld(c,l,u))}"complete"==a&&s.loaders.get(i)&&!ur.isEdge&&function(t,e,n){const o=new br("div",{class:"ck-image-upload-complete-icon"});e.insert(Jo.createAt(t,"end"),o),setTimeout(()=>{n.change(t=>t.remove(Zo.createOn(o)))},3e3)}(l,u,o.editing.view),function(t,e){hd(t,e,sd)}(l,u),ud(l,u),function(t,e){e.removeClass("ck-appear",t)}(l,u)}}const sd=Symbol("progress-bar"),ad=Symbol("placeholder");function cd(t,e){t.hasClass("ck-appear")||e.addClass("ck-appear",t)}function ld(t,e,n){e.hasClass("ck-image-upload-placeholder")||n.addClass("ck-image-upload-placeholder",e);const o=e.getChild(0);o.getAttribute("src")!==t&&n.setAttribute("src",t,o),dd(e,ad)||n.insert(Jo.createAfter(o),function(t){const e=t.createUIElement("div",{class:"ck-upload-placeholder-loader"});return t.setCustomProperty(ad,!0,e),e}(n))}function ud(t,e){t.hasClass("ck-image-upload-placeholder")&&e.removeClass("ck-image-upload-placeholder",t),hd(t,e,ad)}function dd(t,e){for(const n of t.getChildren())if(n.getCustomProperty(e))return n}function hd(t,e,n){const o=dd(t,n);o&&e.remove(Zo.createOn(o))}class fd extends Vu{refresh(){const t=this.editor.model,e=t.document.selection,n=t.schema;this.isEnabled=function(t,e){const n=function(t){let e=ru(t).parent;e.is("$root")||(e=e.parent);return e}(t);return e.checkChild(n,"image")}(e,n)&&function(t,e){const n=t.getSelectedElement(),o=!!n&&e.isObject(n),r=!![...t.focus.getAncestors()].find(t=>e.isObject(t));return!o&&!r}(e,n)}execute(t){const e=this.editor;e.model.change(n=>{const o=Array.isArray(t.files)?t.files:[t.files];for(const t of o)pd(n,e,t)})}}function pd(t,e,n){const o=e.model.document,r=e.plugins.get(Ku).createLoader(n);if(!r)return;const i=t.createElement("image",{uploadId:r.id}),s=ru(o.selection);e.model.insertContent(i,s),i.parent&&t.setSelection(i,"on")}class md extends Hl{static get pluginName(){return"Notification"}init(){this.on("show:warning",(t,e)=>{window.alert(e.message)},{priority:"lowest"})}showSuccess(t,e={}){this._showNotification({message:t,type:"success",namespace:e.namespace,title:e.title})}showInfo(t,e={}){this._showNotification({message:t,type:"info",namespace:e.namespace,title:e.title})}showWarning(t,e={}){this._showNotification({message:t,type:"warning",namespace:e.namespace,title:e.title})}_showNotification(t){const e=`show:${t.type}`+(t.namespace?`:${t.namespace}`:"");this.fire(e,{message:t.message,type:t.type,title:t.title||""})}}class gd extends Hl{static get requires(){return[Ku,md]}init(){const t=this.editor,e=t.model.document,n=t.model.schema,o=t.plugins.get(Ku);n.extend("image",{allowAttributes:["uploadId","uploadStatus"]}),t.commands.add("imageUpload",new fd(t)),this.listenTo(t.editing.view.document,"clipboardInput",(e,n)=>{if(function(t){return Array.from(t.types).includes("text/html")&&""!==t.getData("text/html")}(n.dataTransfer))return;const o=Array.from(n.dataTransfer.files).filter(ed),r=new Qs(n.targetRanges.map(e=>t.editing.mapper.toModelRange(e)));t.model.change(n=>{n.setSelection(r),o.length&&(e.stop(),t.model.enqueueChange("default",()=>{t.execute("imageUpload",{files:o})}))})}),t.editing.view.document.on("dragover",(t,e)=>{e.preventDefault()}),e.on("change",()=>{const t=e.differ.getChanges({includeChangesInGraveyard:!0});for(const e of t)if("insert"==e.type&&"image"==e.name){const t=e.position.nodeAfter,n="$graveyard"==e.position.root.rootName,r=t.getAttribute("uploadId");if(!r)continue;const i=o.loaders.get(r);if(!i)continue;n?i.abort():"idle"==i.status&&this._readAndUpload(i,t)}})}_readAndUpload(t,e){const n=this.editor,o=n.model,r=n.locale.t,i=n.plugins.get(Ku),s=n.plugins.get(md);return o.enqueueChange("transparent",t=>{t.setAttribute("uploadStatus","reading",e)}),t.read().then(r=>{const i=n.editing.mapper.toViewElement(e).getChild(0),s=t.upload();return n.editing.view.change(t=>{t.setAttribute("src",r,i)}),o.enqueueChange("transparent",t=>{t.setAttribute("uploadStatus","uploading",e)}),s}).then(t=>{o.enqueueChange("transparent",n=>{n.setAttributes({uploadStatus:"complete",src:t.default},e);let o=0;const r=Object.keys(t).filter(t=>{const e=parseInt(t,10);if(!isNaN(e))return o=Math.max(o,e),!0}).map(e=>`${t[e]} ${e}w`).join(", ");""!=r&&n.setAttribute("srcset",{data:r,width:o},e)}),a()}).catch(n=>{if("error"!==t.status&&"aborted"!==t.status)throw n;"error"==t.status&&s.showWarning(n,{title:r("am"),namespace:"upload"}),a(),o.enqueueChange("transparent",t=>{t.remove(e)})});function a(){o.enqueueChange("transparent",t=>{t.removeAttribute("uploadId",e),t.removeAttribute("uploadStatus",e)}),i.destroyLoader(t)}}}class bd extends Hl{static get pluginName(){return"ImageUpload"}static get requires(){return[gd,nd,id]}}const wd=Symbol("isWpButtonMacroSymbol");function _d(t){const e=t.getSelectedElement();return!(!e||!function(t){return!!t.getCustomProperty(wd)&&tu(t)}(e))}class kd extends Hl{static get pluginName(){return"OPChildPagesEditing"}static get buttonName(){return"insertChildPages"}init(){const t=this.editor,e=t.model,n=t.conversion;e.schema.register("op-macro-child-pages",{allowWhere:["$block"],allowAttributes:["page"],isBlock:!0,isLimit:!0}),n.for("upcast").add(Da({view:{name:"macro",classes:"child_pages"},model:(t,e)=>{const n=t.getAttribute("data-page")||"",o="true"==t.getAttribute("data-include-parent");return e.createElement("op-macro-child-pages",{page:n,includeParent:o})}})),n.for("editingDowncast").add(ca({model:"op-macro-child-pages",view:(t,e)=>this.createMacroViewElement(t,e)})).add(t=>t.on("attribute:page",this.modelAttributeToView.bind(this))).add(t=>t.on("attribute:includeParent",this.modelAttributeToView.bind(this))),n.for("dataDowncast").add(ca({model:"op-macro-child-pages",view:(t,e)=>{return e.createContainerElement("macro",{class:"child_pages","data-page":t.getAttribute("page")||"","data-include-parent":t.getAttribute("includeParent")||""})}})),t.ui.componentFactory.add(kd.buttonName,e=>{const n=new jl(e);return n.set({label:window.I18n.t("js.editor.macro.child_pages.button"),withText:!0}),n.on("execute",()=>{t.model.change(e=>{const n=e.createElement("op-macro-child-pages",{});t.model.insertContent(n,t.model.document.selection)})}),n})}modelAttributeToView(t,e,n){const o=e.item;if(!o.is("op-macro-child-pages"))return;n.consumable.consume(e.item,t.name);const r=n.mapper.toViewElement(o);n.writer.remove(Zo.createIn(r)),this.setPlaceholderContent(n.writer,o,r)}macroLabel(){return window.I18n.t("js.editor.macro.child_pages.text")}pageLabel(t){return t&&t.length>0?t:window.I18n.t("js.editor.macro.child_pages.this_page")}includeParentText(t){return t?` (${window.I18n.t("js.editor.macro.child_pages.include_parent")})`:""}createMacroViewElement(t,e){const n=e.createContainerElement("div",{class:"macro -child_pages"});return this.setPlaceholderContent(e,t,n),function(t,e,n){return e.setCustomProperty(wd,!0,t),eu(t,e,{label:n})}(n,e,{label:this.macroLabel()})}setPlaceholderContent(t,e,n){const o=e.getAttribute("page"),r=e.getAttribute("includeParent"),i=this.macroLabel(),s=this.pageLabel(o),a=t.createContainerElement("span",{class:"macro-value"});let c=[t.createText(`${i} `)];t.insert(Jo.createAt(a),t.createText(`${s}`)),c.push(a),c.push(t.createText(this.includeParentText(r))),t.insert(Jo.createAt(n),c)}}class vd extends Hl{static get requires(){return[vu]}static get pluginName(){return"OPChildPagesToolbar"}init(){const t=this.editor,e=this.editor.model,n=t.config.get("openProject.pluginContext");Cu(t,"opEditChildPagesMacroButton",t=>{const o=n.services.macros,r=t.getAttribute("page"),i=t.getAttribute("includeParent"),s=r&&r.length>0?r:"";o.configureChildPages(s,i).then(n=>e.change(e=>{e.setAttribute("page",n.page,t),e.setAttribute("includeParent",n.includeParent,t)}))})}afterInit(){Pu(this,this.editor,"OPChildPages",_d)}}class yd{constructor(t){this.files=function(t){const e=t.files?Array.from(t.files):[],n=t.items?Array.from(t.items):[];if(e.length)return e;return n.filter(t=>"file"===t.kind).map(t=>t.getAsFile())}(t),this._native=t}get types(){return this._native.types}getData(t){return this._native.getData(t)}setData(t,e){this._native.setData(t,e)}}class xd extends Qi{constructor(t){super(t);const e=this.document;function n(t,n){n.preventDefault();const o=n.dropRange?[n.dropRange]:Array.from(e.selection.getRanges());e.fire("clipboardInput",{dataTransfer:n.dataTransfer,targetRanges:o})}this.domEventType=["paste","copy","cut","drop","dragover"],this.listenTo(e,"paste",n,{priority:"low"}),this.listenTo(e,"drop",n,{priority:"low"})}onDomEvent(t){const e={dataTransfer:new yd(t.clipboardData?t.clipboardData:t.dataTransfer)};"drop"==t.type&&(e.dropRange=function(t,e){const n=e.target.ownerDocument,o=e.clientX,r=e.clientY;let i;n.caretRangeFromPoint&&n.caretRangeFromPoint(o,r)?i=n.caretRangeFromPoint(o,r):e.rangeParent&&((i=n.createRange()).setStart(e.rangeParent,e.rangeOffset),i.collapse(!0));return i?t.domConverter.domRangeToView(i):t.document.selection.getFirstRange()}(this.view,t)),this.fire(t.type,t,e)}}const Cd=["figcaption","li"];class Ad extends Hl{static get pluginName(){return"Clipboard"}init(){const t=this.editor,e=t.model.document,n=t.editing.view,o=n.document;function r(n,r){const i=r.dataTransfer;r.preventDefault();const s=t.data.toView(t.model.getSelectedContent(e.selection));o.fire("clipboardOutput",{dataTransfer:i,content:s,method:n.name})}this._htmlDataProcessor=new Jc,n.addObserver(xd),this.listenTo(o,"clipboardInput",e=>{t.isReadOnly&&e.stop()},{priority:"highest"}),this.listenTo(o,"clipboardInput",(t,e)=>{const o=e.dataTransfer;let r="";o.getData("text/html")?r=function(t){return t.replace(/<span(?: class="Apple-converted-space"|)>(\s+)<\/span>/g,(t,e)=>1==e.length?" ":e)}(o.getData("text/html")):o.getData("text/plain")&&(r=function(t){return(t=t.replace(/</g,"<").replace(/>/g,">").replace(/\n\n/g,"</p><p>").replace(/\n/g,"<br>").replace(/^\s/," ").replace(/\s$/," ").replace(/\s\s/g," ")).indexOf("</p><p>")>-1&&(t=`<p>${t}</p>`),t}(o.getData("text/plain"))),r=this._htmlDataProcessor.toView(r),this.fire("inputTransformation",{content:r,dataTransfer:o}),n.scrollToTheSelection()},{priority:"low"}),this.listenTo(this,"inputTransformation",(t,e)=>{if(!e.content.isEmpty){const t=this.editor.data,n=this.editor.model,o=t.toModel(e.content,"$clipboardHolder");if(0==o.childCount)return;n.insertContent(o)}},{priority:"low"}),this.listenTo(o,"copy",r,{priority:"low"}),this.listenTo(o,"cut",(e,n)=>{t.isReadOnly?n.preventDefault():r(e,n)},{priority:"low"}),this.listenTo(o,"clipboardOutput",(n,o)=>{o.content.isEmpty||(o.dataTransfer.setData("text/html",this._htmlDataProcessor.toData(o.content)),o.dataTransfer.setData("text/plain",function t(e){let n="";if(e.is("text")||e.is("textProxy"))n=e.data;else if(e.is("img")&&e.hasAttribute("alt"))n=e.getAttribute("alt");else{let o=null;for(const r of e.getChildren()){const e=t(r);o&&(o.is("containerElement")||r.is("containerElement"))&&(Cd.includes(o.name)||Cd.includes(r.name)?n+="\n":n+="\n\n"),n+=e,o=r}}return n}(o.content))),"cut"==o.method&&t.model.deleteContent(e.selection)},{priority:"low"})}}class Pd extends li{constructor(t){super(t);const e=this.document;e.on("keydown",(t,n)=>{if(this.isEnabled&&n.keyCode==fr.enter){let o;e.once("enter",t=>o=t,{priority:"highest"}),e.fire("enter",new Zi(e,n.domEvent,{isSoft:n.shiftKey})),o&&o.stop.called&&t.stop()}})}observe(){}}class Td extends Hl{static get pluginName(){return"Enter"}init(){const t=this.editor,e=t.editing.view,n=e.document;e.addObserver(Pd),t.commands.add("enter",new Lu(t)),this.listenTo(n,"enter",(n,o)=>{o.preventDefault(),o.isSoft||(t.execute("enter"),e.scrollToTheSelection())},{priority:"low"})}}class Ed extends Vu{execute(){const t=this.editor.model,e=t.document;t.change(n=>{!function(t,e,n){const o=n.isCollapsed,r=n.getFirstRange(),i=r.start.parent,s=r.end.parent,a=i==s;if(o)Sd(e,r.end);else{const o=!(r.start.isAtStart&&r.end.isAtEnd);t.deleteContent(n,{leaveUnmerged:o}),a?Sd(e,n.focus):o&&e.setSelection(s,0)}}(t,n,e.selection),this.fire("afterExecute",{writer:n})})}refresh(){const t=this.editor.model,e=t.document;this.isEnabled=function(t,e){if(e.rangeCount>1)return!1;const n=e.anchor;if(!n||!t.checkChild(n,"softBreak"))return!1;const o=e.getFirstRange(),r=o.start.parent,i=o.end.parent;if((Od(r,t)||Od(i,t))&&r!==i)return!1;return!0}(t.schema,e.selection)}}function Sd(t,e){const n=t.createElement("softBreak");t.insert(n,e),t.setSelection(n,"after")}function Od(t,e){return!t.is("rootElement")&&(e.isLimit(t)||Od(t.parent,e))}class Rd extends Hl{static get pluginName(){return"ShiftEnter"}init(){const t=this.editor,e=t.model.schema,n=t.conversion,o=t.editing.view,r=o.document;e.register("softBreak",{allowWhere:"$text"}),n.for("upcast").add(Da({model:"softBreak",view:"br"})),n.for("downcast").add(ca({model:"softBreak",view:(t,e)=>e.createEmptyElement("br")})),o.addObserver(Pd),t.commands.add("shiftEnter",new Ed(t)),this.listenTo(r,"enter",(e,n)=>{n.preventDefault(),n.isSoft&&(t.execute("shiftEnter"),o.scrollToTheSelection())},{priority:"low"})}}class Id{constructor(t,e=20){this.model=t,this.size=0,this.limit=e,this.isLocked=!1,this._changeCallback=((t,e)=>{"transparent"!=e.type&&e!==this._batch&&this._reset(!0)}),this._selectionChangeCallback=(()=>{this._reset()}),this.model.document.on("change",this._changeCallback),this.model.document.selection.on("change:range",this._selectionChangeCallback),this.model.document.selection.on("change:attribute",this._selectionChangeCallback)}get batch(){return this._batch||(this._batch=new Ua),this._batch}input(t){this.size+=t,this.size>=this.limit&&this._reset(!0)}lock(){this.isLocked=!0}unlock(){this.isLocked=!1}destroy(){this.model.document.off("change",this._changeCallback),this.model.document.selection.off("change:range",this._selectionChangeCallback),this.model.document.selection.off("change:attribute",this._selectionChangeCallback)}_reset(t){this.isLocked&&!t||(this._batch=null,this.size=0)}}class Fd extends Vu{constructor(t,e){super(t),this._buffer=new Id(t.model,e)}get buffer(){return this._buffer}destroy(){super.destroy(),this._buffer.destroy()}execute(t={}){const e=this.editor.model,n=e.document,o=t.text||"",r=o.length,i=t.range||n.selection.getFirstRange(),s=t.resultRange;e.enqueueChange(this._buffer.batch,t=>{const e=i.isCollapsed;this._buffer.lock(),e||t.remove(i),o&&t.insertText(o,n.selection.getAttributes(),i.start),s?t.setSelection(s):e&&t.setSelection(i.start.getShiftedBy(r)),this._buffer.unlock(),this._buffer.input(r)})}}function Dd(t){let e=null;const n=t.model,o=t.editing.view,r=t.commands.get("input");function i(){const t=r.buffer;t.lock(),n.enqueueChange(t.batch,()=>{n.deleteContent(n.document.selection)}),t.unlock()}o.document.on("keydown",(t,s)=>(function(t){const s=n.document,a=o.document.isComposing,c=e&&e.isEqual(s.selection);if(e=null,!r.isEnabled)return;if(function(t){if(t.ctrlKey)return!0;return Nd.includes(t.keyCode)}(t)||s.selection.isCollapsed)return;if(a&&229===t.keyCode)return;if(!a&&229===t.keyCode&&c)return;i()})(s),{priority:"lowest"}),o.document.on("compositionstart",function(){const t=n.document,e=1!==t.selection.rangeCount||t.selection.getFirstRange().isFlat;if(t.selection.isCollapsed||e)return;i()},{priority:"lowest"}),o.document.on("compositionend",()=>{e=new Qs(n.document.selection)},{priority:"lowest"})}const Nd=[pr("arrowUp"),pr("arrowRight"),pr("arrowDown"),pr("arrowLeft"),9,16,17,18,20,27,33,34,35,36];for(let t=112;t<=135;t++)Nd.push(t);function Md(t){if(0==t.length)return!1;for(const e of t)if("children"===e.type&&!Vd(e))return!0;return!1}function Vd(t){if(t.newChildren.length-t.oldChildren.length!=1)return;const e=function(t,e){const n=[];let o,r=0;return t.forEach(t=>{"equal"==t?(i(),r++):"insert"==t?(s("insert")?o.values.push(e[r]):(i(),o={type:"insert",index:r,values:[e[r]]}),r++):s("delete")?o.howMany++:(i(),o={type:"delete",index:r,howMany:1})}),i(),n;function i(){o&&(n.push(o),o=null)}function s(t){return o&&o.type==t}}(jr(t.oldChildren,t.newChildren,Bd),t.newChildren);if(e.length>1)return;const n=e[0];return n.values[0]instanceof lo?n:void 0}function Bd(t,e){return t instanceof lo&&e instanceof lo?t.data===e.data:t===e}class Ld{constructor(t){this.editor=t,this.editing=this.editor.editing}handle(t,e){if(Md(t))this._handleContainerChildrenMutations(t,e);else for(const n of t)this._handleTextMutation(n,e),this._handleTextNodeInsertion(n)}_handleContainerChildrenMutations(t,e){const n=function(t){const e=t.map(t=>t.node).reduce((t,e)=>t.getCommonAncestor(e,{includeSelf:!0}));if(!e)return;return e.getAncestors({includeSelf:!0,parentFirst:!0}).find(t=>t.is("containerElement")||t.is("rootElement"))}(t);if(!n)return;const o=this.editor.editing.view.domConverter.mapViewToDom(n),r=new ni,i=this.editor.data.toModel(r.domToView(o)).getChild(0),s=this.editor.editing.mapper.toModelElement(n);if(!s)return;const a=Array.from(i.getChildren()),c=Array.from(s.getChildren()),l=a[a.length-1],u=c[c.length-1];if(l&&l.is("softBreak")&&u&&!u.is("softBreak")&&a.pop(),!zd(a)||!zd(c))return;const d=a.map(t=>t.is("text")?t.data:"@").join("").replace(/\u00A0/g," "),h=c.map(t=>t.is("text")?t.data:"@").join("").replace(/\u00A0/g," ");if(h===d)return;const f=jr(h,d),{firstChangeAt:p,insertions:m,deletions:g}=qd(f);let b=null;e&&(b=this.editing.mapper.toModelRange(e.getFirstRange()));const w=d.substr(p,m),_=$s.createFromParentsAndOffsets(s,p,s,p+g);this.editor.execute("input",{text:w,range:_,resultRange:b})}_handleTextMutation(t,e){if("text"!=t.type)return;const n=t.newText.replace(/\u00A0/g," "),o=jr(t.oldText.replace(/\u00A0/g," "),n),{firstChangeAt:r,insertions:i,deletions:s}=qd(o);let a=null;e&&(a=this.editing.mapper.toModelRange(e.getFirstRange()));const c=new Jo(t.node,r),l=this.editing.mapper.toModelPosition(c),u=$s.createFromPositionAndShift(l,s),d=n.substr(r,i);this.editor.execute("input",{text:d,range:u,resultRange:a})}_handleTextNodeInsertion(t){if("children"!=t.type)return;const e=Vd(t),n=new Jo(t.node,e.index),o=this.editing.mapper.toModelPosition(n),r=e.values[0].data;this.editor.execute("input",{text:r.replace(/\u00A0/g," "),range:new $s(o)})}}function zd(t){return t.every(t=>t.is("text")||t.is("softBreak"))}function qd(t){let e=null,n=null;for(let o=0;o<t.length;o++){"equal"!=t[o]&&(e=null===e?o:e,n=o)}let o=0,r=0;for(let i=e;i<=n;i++)"insert"!=t[i]&&o++,"delete"!=t[i]&&r++;return{insertions:r,deletions:o,firstChangeAt:e}}class jd extends Hl{static get pluginName(){return"Input"}init(){const t=this.editor,e=new Fd(t,t.config.get("typing.undoStep")||20);t.commands.add("input",e),Dd(t),function(t){t.editing.view.document.on("mutations",(e,n,o)=>{new Ld(t).handle(n,o)})}(t)}}class Hd extends Vu{constructor(t,e){super(t),this.direction=e,this._buffer=new Id(t.model,t.config.get("typing.undoStep"))}execute(t={}){const e=this.editor.model,n=e.document;e.enqueueChange(this._buffer.batch,o=>{this._buffer.lock();const r=new Qs(n.selection),i=r.isCollapsed;if(r.isCollapsed&&e.modifySelection(r,{direction:this.direction,unit:t.unit}),this._shouldEntireContentBeReplacedWithParagraph(t.sequence||1))return void this._replaceEntireContentWithParagraph(o);if(r.isCollapsed)return;let s=0;r.getFirstRange().getMinimalFlatRanges().forEach(t=>{s+=Yo(t.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))}),e.deleteContent(r,{doNotResetEntireContent:i}),this._buffer.input(s),o.setSelection(r),this._buffer.unlock()})}_shouldEntireContentBeReplacedWithParagraph(t){if(t>1)return!1;const e=this.editor.model,n=e.document.selection,o=e.schema.getLimitElement(n);if(!(n.isCollapsed&&n.containsEntireContent(o)))return!1;if(!e.schema.checkChild(o,"paragraph"))return!1;const r=o.getChild(0);return!r||"paragraph"!==r.name}_replaceEntireContentWithParagraph(t){const e=this.editor.model,n=e.document.selection,o=e.schema.getLimitElement(n),r=new zs("paragraph");t.remove($s.createIn(o)),t.insert(r,o),t.setSelection(r,0)}}class Ud extends li{constructor(t){super(t);const e=t.document;let n=0;e.on("keyup",(t,e)=>{e.keyCode!=fr.delete&&e.keyCode!=fr.backspace||(n=0)}),e.on("keydown",(t,o)=>{const r={};if(o.keyCode==fr.delete)r.direction="forward",r.unit="character";else{if(o.keyCode!=fr.backspace)return;r.direction="backward",r.unit="codePoint"}const i=ur.isMac?o.altKey:o.ctrlKey;let s;r.unit=i?"word":r.unit,r.sequence=++n,e.once("delete",t=>s=t,{priority:"highest"}),e.fire("delete",new Zi(e,o.domEvent,r)),s&&s.stop.called&&t.stop()})}observe(){}}function $d(t){const e=t.model,n=t.editing.view,o=200;let r=null,i=new Qs(e.document.selection),s=Date.now();e.document.selection.on("change",function(t){const e=new Qs(t.source);i.isEqual(e)||(r=i,i=e,s=Date.now())}),n.document.on("mutations",function(n,a){Md(a)&&function(t){for(const e of t){if("children"!==e.type)continue;const t=e.oldChildren,n=e.newChildren;if(!Wd(t))continue;const o=jr(t,n),r=o.some(t=>"delete"===t),i=o.some(t=>"insert"===t);if(r&&!i)return!0}return!1}(a)&&(!function(){Date.now()-s<o&&r&&!r.isCollapsed&&i.isCollapsed&&i.getLastPosition().isEqual(r.getLastPosition())&&e.enqueueChange(t=>{t.setSelection(r)});t.execute("delete")}(),n.stop())},{priority:"highest"})}function Wd(t){return t.every(t=>t.is("containerElement"))}class Gd extends Hl{static get pluginName(){return"Delete"}init(){const t=this.editor,e=t.editing.view,n=e.document;e.addObserver(Ud),t.commands.add("forwardDelete",new Hd(t,"forward")),t.commands.add("delete",new Hd(t,"backward")),this.listenTo(n,"delete",(n,o)=>{t.execute("forward"==o.direction?"forwardDelete":"delete",{unit:o.unit,sequence:o.sequence}),o.preventDefault(),e.scrollToTheSelection()}),$d(t)}}class Kd extends Hl{static get requires(){return[jd,Gd]}static get pluginName(){return"Typing"}}class Jd extends $a{get type(){return"noop"}clone(){return new Jd(this.baseVersion)}getReversed(){return new Jd(this.baseVersion+1)}_execute(){}static get className(){return"NoOperation"}}const Zd=new Map;function Qd(t,e,n){let o=Zd.get(t);o||(o=new Map,Zd.set(t,o)),o.set(e,n)}function Yd(t){return[t]}function Xd(t,e,n={}){const o=function(t,e){const n=Zd.get(t);return n&&n.has(e)?n.get(e):Yd}(t.constructor,e.constructor);try{return o(t=t.clone(),e,n)}catch(o){throw ps.a.error("Error during operation transformation!",o.message),ps.a.error("Transformed operation",t),ps.a.error("Operation transformed by",e),ps.a.error("context.aIsStrong",n.aIsStrong),ps.a.error("context.aWasUndone",n.aWasUndone),ps.a.error("context.bWasUndone",n.bWasUndone),ps.a.error("context.abRelation",n.abRelation),ps.a.error("context.baRelation",n.baRelation),o}}function th(t,e,n){if(t=t.slice(),e=e.slice(),0==t.length||0==e.length)return{operationsA:t,operationsB:e};const o=new WeakMap;for(const e of t)o.set(e,0);const r={nextBaseVersionA:t[t.length-1].baseVersion+1,nextBaseVersionB:e[e.length-1].baseVersion+1,originalOperationsACount:t.length,originalOperationsBCount:e.length},i=new eh(n.document,n.useRelations);i.setOriginalOperations(t),i.setOriginalOperations(e);let s=0;for(;s<t.length;){const n=t[s],r=o.get(n);if(r==e.length){s++;continue}const a=e[r],c=Xd(n,a,i.getContext(n,a,!0)),l=Xd(a,n,i.getContext(a,n,!1));i.updateRelation(n,a),i.setOriginalOperations(c,n),i.setOriginalOperations(l,a);for(const t of c)o.set(t,r+l.length);t.splice(s,1,...c),e.splice(r,1,...l)}if(n.padWithNoOps){const n=t.length-r.originalOperationsACount,o=e.length-r.originalOperationsBCount;oh(t,o-n),oh(e,n-o)}return nh(t,r.nextBaseVersionB),nh(e,r.nextBaseVersionA),{operationsA:t,operationsB:e}}class eh{constructor(t,e){this._history=t.history,this._useRelations=e,this._originalOperations=new Map,this._relations=new Map}setOriginalOperations(t,e=null){const n=e?this._originalOperations.get(e):null;for(const e of t)this._originalOperations.set(e,n||e)}updateRelation(t,e){switch(t.constructor){case oc:switch(e.constructor){case cc:t.targetPosition.isEqual(e.sourcePosition)||e.movedRange.containsPosition(t.targetPosition)?this._setRelation(t,e,"insertAtSource"):t.targetPosition.isEqual(e.deletionPosition)&&this._setRelation(t,e,"insertBetween");break;case oc:t.targetPosition.isEqual(e.sourcePosition)||t.targetPosition.isBefore(e.sourcePosition)?this._setRelation(t,e,"insertBefore"):this._setRelation(t,e,"insertAfter")}break;case lc:switch(e.constructor){case cc:t.splitPosition.isBefore(e.sourcePosition)&&this._setRelation(t,e,"splitBefore");break;case oc:(t.splitPosition.isEqual(e.sourcePosition)||t.splitPosition.isBefore(e.sourcePosition))&&this._setRelation(t,e,"splitBefore")}break;case cc:switch(e.constructor){case cc:t.targetPosition.isEqual(e.sourcePosition)||this._setRelation(t,e,"mergeTargetNotMoved"),t.sourcePosition.isEqual(e.sourcePosition)&&this._setRelation(t,e,"mergeSameElement")}}}getContext(t,e,n){return{aIsStrong:n,aWasUndone:this._wasUndone(t),bWasUndone:this._wasUndone(e),abRelation:this._useRelations?this._getRelation(t,e):null,baRelation:this._useRelations?this._getRelation(e,t):null}}_wasUndone(t){const e=this._originalOperations.get(t);return e.wasUndone||this._history.isUndoneOperation(e)}_getRelation(t,e){const n=this._originalOperations.get(e),o=this._history.getUndoneOperation(n);if(!o)return null;const r=this._originalOperations.get(t),i=this._relations.get(r);return i&&i.get(o)||null}_setRelation(t,e,n){const o=this._originalOperations.get(t),r=this._originalOperations.get(e);let i=this._relations.get(o);i||(i=new Map,this._relations.set(o,i)),i.set(r,n)}}function nh(t,e){for(const n of t)n.baseVersion=e++}function oh(t,e){for(let n=0;n<e;n++)t.push(new Jd(0))}function rh(t,e,n){const o=t.nodes.getNode(0).getAttribute(e);if(o==n)return null;const r=new $s(t.position,t.position.getShiftedBy(t.howMany));return new ec(r,e,o,n,0)}function ih(t,e){return null===t.targetPosition._getTransformedByDeletion(e.sourcePosition,e.howMany)}function sh(t,e){const n=[];for(let o=0;o<t.length;o++){const r=t[o],i=new oc(r.start,r.end.offset-r.start.offset,e,0);n.push(i);for(let e=o+1;e<t.length;e++)t[e]=t[e]._getTransformedByMove(i.sourcePosition,i.targetPosition,i.howMany)[0];e=e._getTransformedByMove(i.sourcePosition,i.targetPosition,i.howMany)}return n}Qd(ec,ec,(t,e,n)=>{if(t.key===e.key){const o=t.range.getDifference(e.range).map(e=>new ec(e,t.key,t.oldValue,t.newValue,0)),r=t.range.getIntersection(e.range);return r&&n.aIsStrong&&o.push(new ec(r,e.key,e.newValue,t.newValue,0)),0==o.length?[new Jd(0)]:o}return[t]}),Qd(ec,rc,(t,e)=>{if(t.range.start.hasSameParentAs(e.position)&&t.range.containsPosition(e.position)){const n=t.range._getTransformedByInsertion(e.position,e.howMany,!e.shouldReceiveAttributes).map(e=>new ec(e,t.key,t.oldValue,t.newValue,t.baseVersion));if(e.shouldReceiveAttributes){const o=rh(e,t.key,t.oldValue);o&&n.unshift(o)}return n}return t.range=t.range._getTransformedByInsertion(e.position,e.howMany,!1)[0],[t]}),Qd(ec,cc,(t,e)=>{const n=[];t.range.start.hasSameParentAs(e.deletionPosition)&&(t.range.containsPosition(e.deletionPosition)||t.range.start.isEqual(e.deletionPosition))&&n.push($s.createFromPositionAndShift(e.graveyardPosition,1));const o=t.range._getTransformedByMergeOperation(e);return o.isCollapsed||n.push(o),n.map(e=>new ec(e,t.key,t.oldValue,t.newValue,t.baseVersion))}),Qd(ec,oc,(t,e)=>{return function(t,e){const n=$s.createFromPositionAndShift(e.sourcePosition,e.howMany);let o=null,r=[];n.containsRange(t,!0)?o=t:t.start.hasSameParentAs(n.start)?(r=t.getDifference(n),o=t.getIntersection(n)):r=[t];const i=[];for(let t of r){t=t._getTransformedByDeletion(e.sourcePosition,e.howMany);const n=e.getMovedRangeStart(),o=t.start.hasSameParentAs(n);t=t._getTransformedByInsertion(n,e.howMany,o),i.push(...t)}o&&i.push(o._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany,!1)[0]);return i}(t.range,e).map(e=>new ec(e,t.key,t.oldValue,t.newValue,t.baseVersion))}),Qd(ec,lc,(t,e)=>{if(t.range.end.isEqual(e.insertionPosition))return e.graveyardPosition||t.range.end.offset++,[t];if(t.range.start.hasSameParentAs(e.splitPosition)&&t.range.containsPosition(e.splitPosition)){const n=t.clone();return n.range=new $s(Us.createFromPosition(e.moveTargetPosition),t.range.end._getCombined(e.splitPosition,e.moveTargetPosition)),t.range.end=Us.createFromPosition(e.splitPosition),t.range.end.stickiness="toPrevious",[t,n]}return t.range=t.range._getTransformedBySplitOperation(e),[t]}),Qd(rc,ec,(t,e)=>{const n=[t];if(t.shouldReceiveAttributes&&t.position.hasSameParentAs(e.range.start)&&e.range.containsPosition(t.position)){const o=rh(t,e.key,e.newValue);o&&n.push(o)}return n}),Qd(rc,rc,(t,e,n)=>t.position.isEqual(e.position)&&n.aIsStrong?[t]:(t.position=t.position._getTransformedByInsertOperation(e),[t])),Qd(rc,oc,(t,e)=>(t.position=t.position._getTransformedByMoveOperation(e),[t])),Qd(rc,lc,(t,e)=>(t.position=t.position._getTransformedBySplitOperation(e),[t])),Qd(rc,cc,(t,e)=>(t.position=t.position._getTransformedByMergeOperation(e),[t])),Qd(ic,rc,(t,e)=>(t.oldRange&&(t.oldRange=t.oldRange._getTransformedByInsertOperation(e)[0]),t.newRange&&(t.newRange=t.newRange._getTransformedByInsertOperation(e)[0]),[t])),Qd(ic,ic,(t,e,n)=>{if(t.name==e.name){if(!n.aIsStrong)return[new Jd(0)];t.oldRange=e.newRange?$s.createFromRange(e.newRange):null}return[t]}),Qd(ic,cc,(t,e)=>(t.oldRange&&(t.oldRange=t.oldRange._getTransformedByMergeOperation(e)),t.newRange&&(t.newRange=t.newRange._getTransformedByMergeOperation(e)),[t])),Qd(ic,oc,(t,e)=>(t.oldRange&&(t.oldRange=$s.createFromRanges(t.oldRange._getTransformedByMoveOperation(e))),t.newRange&&(t.newRange=$s.createFromRanges(t.newRange._getTransformedByMoveOperation(e))),[t])),Qd(ic,lc,(t,e)=>(t.oldRange&&(t.oldRange=t.oldRange._getTransformedBySplitOperation(e)),t.newRange&&(t.newRange=t.newRange._getTransformedBySplitOperation(e)),[t])),Qd(cc,rc,(t,e)=>(t.sourcePosition.hasSameParentAs(e.position)&&(t.howMany+=e.howMany),t.sourcePosition=t.sourcePosition._getTransformedByInsertOperation(e),t.targetPosition=t.targetPosition._getTransformedByInsertOperation(e),[t])),Qd(cc,cc,(t,e,n)=>{if(t.sourcePosition.isEqual(e.sourcePosition)&&t.targetPosition.isEqual(e.targetPosition)){if(n.bWasUndone){const n=e.graveyardPosition.path.slice();return n.push(0),t.sourcePosition=new Us(e.graveyardPosition.root,n),t.howMany=0,[t]}return[new Jd(0)]}if(t.sourcePosition.isEqual(e.sourcePosition)&&!t.targetPosition.isEqual(e.targetPosition)&&!n.bWasUndone){const o="$graveyard"==t.targetPosition.root.rootName,r="$graveyard"==e.targetPosition.root.rootName;if(r&&!o||!(o&&!r)&&n.aIsStrong){const n=e.targetPosition._getTransformedByMergeOperation(e),o=t.targetPosition._getTransformedByMergeOperation(e);return[new oc(n,t.howMany,o,0)]}return[new Jd(0)]}return t.sourcePosition.hasSameParentAs(e.targetPosition)&&(t.howMany+=e.howMany),t.sourcePosition=t.sourcePosition._getTransformedByMergeOperation(e),t.targetPosition=t.targetPosition._getTransformedByMergeOperation(e),t.graveyardPosition.isEqual(e.graveyardPosition)&&n.aIsStrong||(t.graveyardPosition=t.graveyardPosition._getTransformedByMergeOperation(e)),[t]}),Qd(cc,oc,(t,e,n)=>{const o=$s.createFromPositionAndShift(e.sourcePosition,e.howMany);return"remove"==e.type&&!n.bWasUndone&&t.deletionPosition.hasSameParentAs(e.sourcePosition)&&o.containsPosition(t.sourcePosition)?[new Jd(0)]:(t.sourcePosition.hasSameParentAs(e.targetPosition)&&(t.howMany+=e.howMany),t.sourcePosition.hasSameParentAs(e.sourcePosition)&&(t.howMany-=e.howMany),t.sourcePosition=t.sourcePosition._getTransformedByMoveOperation(e),t.targetPosition=t.targetPosition._getTransformedByMoveOperation(e),t.graveyardPosition.isEqual(e.targetPosition)||(t.graveyardPosition=t.graveyardPosition._getTransformedByMoveOperation(e)),[t])}),Qd(cc,lc,(t,e,n)=>{if(e.graveyardPosition&&(t.graveyardPosition=t.graveyardPosition._getTransformedByDeletion(e.graveyardPosition,1),t.deletionPosition.isEqual(e.graveyardPosition)&&(t.howMany=e.howMany)),t.targetPosition.isEqual(e.splitPosition)){const o=0!=e.howMany,r=e.graveyardPosition&&t.deletionPosition.isEqual(e.graveyardPosition);if(o||r||"mergeTargetNotMoved"==n.abRelation)return t.sourcePosition=t.sourcePosition._getTransformedBySplitOperation(e),[t]}return t.sourcePosition.isEqual(e.splitPosition)&&"mergeSameElement"==n.abRelation?(t.sourcePosition=Us.createFromPosition(e.moveTargetPosition),t.targetPosition=t.targetPosition._getTransformedBySplitOperation(e),[t]):(t.sourcePosition.hasSameParentAs(e.splitPosition)&&(t.howMany=e.splitPosition.offset),t.sourcePosition=t.sourcePosition._getTransformedBySplitOperation(e),t.targetPosition=t.targetPosition._getTransformedBySplitOperation(e),[t])}),Qd(oc,rc,(t,e)=>{const n=$s.createFromPositionAndShift(t.sourcePosition,t.howMany)._getTransformedByInsertOperation(e,!1)[0];return t.sourcePosition=n.start,t.howMany=n.end.offset-n.start.offset,t.targetPosition.isEqual(e.position)||(t.targetPosition=t.targetPosition._getTransformedByInsertOperation(e)),[t]}),Qd(oc,oc,(t,e,n)=>{const o=$s.createFromPositionAndShift(t.sourcePosition,t.howMany),r=$s.createFromPositionAndShift(e.sourcePosition,e.howMany);let i,s=n.aIsStrong,a=!n.aIsStrong;if("insertBefore"==n.abRelation?a=!0:"insertAfter"==n.abRelation&&(a=!1),i=t.targetPosition.isEqual(e.targetPosition)&&a?t.targetPosition._getTransformedByDeletion(e.sourcePosition,e.howMany):t.targetPosition._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),ih(t,e)&&ih(e,t))return[e.getReversed()];if(o.containsPosition(e.targetPosition)&&o.containsRange(r,!0))return o.start=o.start._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),o.end=o.end._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),sh([o],i);if(r.containsPosition(t.targetPosition)&&r.containsRange(o,!0))return o.start=o.start._getCombined(e.sourcePosition,e.getMovedRangeStart()),o.end=o.end._getCombined(e.sourcePosition,e.getMovedRangeStart()),sh([o],i);const c=H(t.sourcePosition.getParentPath(),e.sourcePosition.getParentPath());if("prefix"==c||"extension"==c)return o.start=o.start._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),o.end=o.end._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),sh([o],i);"remove"!=t.type||"remove"==e.type||n.aWasUndone?"remove"==t.type||"remove"!=e.type||n.bWasUndone||(s=!1):s=!0;const l=[],u=o.getDifference(r);for(const t of u){t.start=t.start._getTransformedByDeletion(e.sourcePosition,e.howMany),t.end=t.end._getTransformedByDeletion(e.sourcePosition,e.howMany);const n="same"==H(t.start.getParentPath(),e.getMovedRangeStart().getParentPath()),o=t._getTransformedByInsertion(e.getMovedRangeStart(),e.howMany,n);l.push(...o)}const d=o.getIntersection(r);return null!==d&&s&&(d.start=d.start._getCombined(e.sourcePosition,e.getMovedRangeStart()),d.end=d.end._getCombined(e.sourcePosition,e.getMovedRangeStart()),0===l.length?l.push(d):1==l.length?r.start.isBefore(o.start)||r.start.isEqual(o.start)?l.unshift(d):l.push(d):l.splice(1,0,d)),0===l.length?[new Jd(t.baseVersion)]:sh(l,i)}),Qd(oc,lc,(t,e,n)=>{let o=Us.createFromPosition(t.targetPosition);t.targetPosition.isEqual(e.insertionPosition)&&e.graveyardPosition||(o=t.targetPosition._getTransformedBySplitOperation(e));const r=$s.createFromPositionAndShift(t.sourcePosition,t.howMany);if(r.end.isEqual(e.insertionPosition))return e.graveyardPosition||t.howMany++,t.targetPosition=o,[t];if(r.start.hasSameParentAs(e.splitPosition)&&r.containsPosition(e.splitPosition)){let t=new $s(e.splitPosition,r.end);return t=t._getTransformedBySplitOperation(e),sh([new $s(r.start,e.splitPosition),t],o)}t.targetPosition.isEqual(e.splitPosition)&&"insertAtSource"==n.abRelation&&(o=e.moveTargetPosition),t.targetPosition.isEqual(e.insertionPosition)&&"insertBetween"==n.abRelation&&(o=t.targetPosition);const i=r._getTransformedBySplitOperation(e);return t.sourcePosition=i.start,t.howMany=i.end.offset-i.start.offset,t.targetPosition=o,[t]}),Qd(oc,cc,(t,e,n)=>{const o=$s.createFromPositionAndShift(t.sourcePosition,t.howMany);if(e.deletionPosition.hasSameParentAs(t.sourcePosition)&&o.containsPosition(e.sourcePosition))if("remove"==t.type){if(!n.aWasUndone)return[e.getReversed(),t]}else if(1==t.howMany)return n.bWasUndone?(t.sourcePosition=Us.createFromPosition(e.graveyardPosition),t.targetPosition=t.targetPosition._getTransformedByMergeOperation(e),[t]):[new Jd(0)];const r=$s.createFromPositionAndShift(t.sourcePosition,t.howMany)._getTransformedByMergeOperation(e);return t.sourcePosition=r.start,t.howMany=r.end.offset-r.start.offset,t.targetPosition=t.targetPosition._getTransformedByMergeOperation(e),[t]}),Qd(sc,rc,(t,e)=>(t.position=t.position._getTransformedByInsertOperation(e),[t])),Qd(sc,cc,(t,e)=>t.position.isEqual(e.deletionPosition)?(t.position=Us.createFromPosition(e.graveyardPosition),t.position.stickiness="toNext",[t]):(t.position=t.position._getTransformedByMergeOperation(e),[t])),Qd(sc,oc,(t,e)=>(t.position=t.position._getTransformedByMoveOperation(e),[t])),Qd(sc,sc,(t,e,n)=>{if(t.position.isEqual(e.position)){if(!n.aIsStrong)return[new Jd(0)];t.oldName=e.newName}return[t]}),Qd(sc,lc,(t,e)=>{if("same"==H(t.position.path,e.splitPosition.getParentPath())&&!e.graveyardPosition){return[t,new sc(t.position.getShiftedBy(1),t.oldName,t.newName,0)]}return t.position=t.position._getTransformedBySplitOperation(e),[t]}),Qd(ac,ac,(t,e,n)=>{if(t.root===e.root&&t.key===e.key){if(!n.aIsStrong||t.newValue===e.newValue)return[new Jd(0)];t.oldValue=e.newValue}return[t]}),Qd(lc,rc,(t,e)=>(t.splitPosition.hasSameParentAs(e.position)&&t.splitPosition.offset<e.position.offset&&(t.howMany+=e.howMany),t.splitPosition=t.splitPosition._getTransformedByInsertOperation(e),t.insertionPosition=lc.getInsertionPosition(t.splitPosition),[t])),Qd(lc,cc,(t,e,n)=>{if(!t.graveyardPosition&&!n.bWasUndone&&t.splitPosition.hasSameParentAs(e.sourcePosition)){const n=e.graveyardPosition.path.slice();n.push(0);const o=new Us(e.graveyardPosition.root,n),r=lc.getInsertionPosition(new Us(e.graveyardPosition.root,n)),i=new lc(o,0,null,0);return i.insertionPosition=r,t.splitPosition=t.splitPosition._getTransformedByMergeOperation(e),t.insertionPosition=lc.getInsertionPosition(t.splitPosition),t.graveyardPosition=Us.createFromPosition(i.insertionPosition),t.graveyardPosition.stickiness="toNext",[i,t]}return t.splitPosition.hasSameParentAs(e.deletionPosition)&&!t.splitPosition.isAfter(e.deletionPosition)&&t.howMany--,t.splitPosition.hasSameParentAs(e.targetPosition)&&(t.howMany+=e.howMany),t.splitPosition=t.splitPosition._getTransformedByMergeOperation(e),t.insertionPosition=lc.getInsertionPosition(t.splitPosition),t.graveyardPosition&&(t.graveyardPosition=t.graveyardPosition._getTransformedByMergeOperation(e)),[t]}),Qd(lc,oc,(t,e,n)=>{t.graveyardPosition&&(t.graveyardPosition=t.graveyardPosition._getTransformedByMoveOperation(e));const o=$s.createFromPositionAndShift(e.sourcePosition,e.howMany);if(t.splitPosition.hasSameParentAs(e.sourcePosition)&&o.containsPosition(t.splitPosition)){const n=e.howMany-(t.splitPosition.offset-e.sourcePosition.offset);return t.howMany-=n,t.splitPosition.hasSameParentAs(e.targetPosition)&&t.splitPosition.offset<e.targetPosition.offset&&(t.howMany+=e.howMany),t.splitPosition=Us.createFromPosition(e.sourcePosition),t.insertionPosition=lc.getInsertionPosition(t.splitPosition),[t]}return!t.splitPosition.isEqual(e.targetPosition)||"insertAtSource"!=n.baRelation&&"splitBefore"!=n.abRelation?(t.splitPosition.hasSameParentAs(e.sourcePosition)&&t.splitPosition.offset<=e.sourcePosition.offset&&(t.howMany-=e.howMany),t.splitPosition.hasSameParentAs(e.targetPosition)&&t.splitPosition.offset<e.targetPosition.offset&&(t.howMany+=e.howMany),t.splitPosition.stickiness="toNone",t.splitPosition=t.splitPosition._getTransformedByMoveOperation(e),t.splitPosition.stickiness="toNext",t.graveyardPosition?t.insertionPosition=t.insertionPosition._getTransformedByMoveOperation(e):t.insertionPosition=lc.getInsertionPosition(t.splitPosition),[t]):(t.howMany+=e.howMany,t.splitPosition=t.splitPosition._getTransformedByDeletion(e.sourcePosition,e.howMany),t.insertionPosition=lc.getInsertionPosition(t.splitPosition),[t])}),Qd(lc,lc,(t,e,n)=>{if(t.splitPosition.isEqual(e.splitPosition)){if(!t.graveyardPosition&&!e.graveyardPosition)return[new Jd(0)];if(t.graveyardPosition&&e.graveyardPosition&&t.graveyardPosition.isEqual(e.graveyardPosition))return[new Jd(0)]}if(t.graveyardPosition&&e.graveyardPosition&&t.graveyardPosition.isEqual(e.graveyardPosition)){const o="$graveyard"==t.splitPosition.root.rootName,r="$graveyard"==e.splitPosition.root.rootName;if(r&&!o||!(o&&!r)&&n.aIsStrong){const n=[];return e.howMany&&n.push(new oc(e.moveTargetPosition,e.howMany,e.splitPosition,0)),t.howMany&&n.push(new oc(t.splitPosition,t.howMany,t.moveTargetPosition,0)),n}return[new Jd(0)]}if(t.graveyardPosition&&(t.graveyardPosition=t.graveyardPosition._getTransformedBySplitOperation(e)),t.splitPosition.isEqual(e.insertionPosition)&&"splitBefore"==n.abRelation)return t.howMany++,[t];if(e.splitPosition.isEqual(t.insertionPosition)&&"splitBefore"==n.baRelation){const n=e.insertionPosition.path.slice();n.push(0);const o=new Us(e.insertionPosition.root,n);return[t,new oc(t.insertionPosition,1,o,0)]}return t.splitPosition.hasSameParentAs(e.splitPosition)&&t.splitPosition.offset<e.splitPosition.offset&&(t.howMany-=e.howMany),t.splitPosition=t.splitPosition._getTransformedBySplitOperation(e),t.insertionPosition=lc.getInsertionPosition(t.splitPosition),[t]});class ah extends Vu{constructor(t){super(t),this._stack=[],this._createdBatches=new WeakSet,this.refresh()}refresh(){this.isEnabled=this._stack.length>0}addBatch(t){const e=this.editor.model.document.selection,n={ranges:e.hasOwnRange?Array.from(e.getRanges()):[],isBackward:e.isBackward};this._stack.push({batch:t,selection:n}),this.refresh()}clearStack(){this._stack=[],this.refresh()}_restoreSelection(t,e,n){const o=this.editor.model,r=o.document,i=[];for(const e of t){const t=ch(e,n).find(t=>t.start.root!=r.graveyard);t&&i.push(t)}i.length&&o.change(t=>{t.setSelection(i,{backward:e})})}_undo(t,e){const n=this.editor.model,o=n.document;this._createdBatches.add(e);const r=t.operations.slice().filter(t=>t.isDocumentOperation);r.reverse();for(const t of r){const r=t.baseVersion+1,i=Array.from(o.history.getOperations(r)),s=th([t.getReversed()],i,{useRelations:!0,document:this.editor.model.document,padWithNoOps:!1}).operationsA;for(const r of s)e.addOperation(r),n.applyOperation(r),o.history.setOperationAsUndone(t,r)}}}function ch(t,e){const n=t.getTransformedByOperations(e);n.sort((t,e)=>t.start.isBefore(e.start)?-1:1);for(let t=1;t<n.length;t++){const e=n[t-1],o=n[t];e.end.isTouching(o.start)&&(e.end=o.end,n.splice(t,1),t--)}return n}class lh extends ah{execute(t=null){const e=t?this._stack.findIndex(e=>e.batch==t):this._stack.length-1,n=this._stack.splice(e,1)[0],o=new Ua;this.editor.model.enqueueChange(o,()=>{this._undo(n.batch,o);const t=this.editor.model.document.history.getOperations(n.batch.baseVersion);this._restoreSelection(n.selection.ranges,n.selection.isBackward,t),this.fire("revert",n.batch,o)}),this.refresh()}}class uh extends ah{execute(){const t=this._stack.pop(),e=new Ua;this.editor.model.enqueueChange(e,()=>{const n=t.batch.operations[t.batch.operations.length-1].baseVersion+1,o=this.editor.model.document.history.getOperations(n);this._restoreSelection(t.selection.ranges,t.selection.isBackward,o),this._undo(t.batch,e)}),this.refresh()}}class dh extends Hl{constructor(t){super(t),this._batchRegistry=new WeakSet}init(){const t=this.editor;this._undoCommand=new lh(t),this._redoCommand=new uh(t),t.commands.add("undo",this._undoCommand),t.commands.add("redo",this._redoCommand),this.listenTo(t.model,"applyOperation",(t,e)=>{const n=e[0];if(!n.isDocumentOperation)return;const o=n.batch;this._batchRegistry.has(o)||"transparent"==o.type||(this._redoCommand._createdBatches.has(o)?this._undoCommand.addBatch(o):this._undoCommand._createdBatches.has(o)||(this._undoCommand.addBatch(o),this._redoCommand.clearStack()),this._batchRegistry.add(o))},{priority:"highest"}),this.listenTo(this._undoCommand,"revert",(t,e,n)=>{this._redoCommand.addBatch(n)}),t.keystrokes.set("CTRL+Z","undo"),t.keystrokes.set("CTRL+Y","redo"),t.keystrokes.set("CTRL+SHIFT+Z","redo")}}var hh=n(38),fh=n.n(hh),ph=n(39),mh=n.n(ph);class gh extends Hl{init(){const t=this.editor.t;this._addButton("undo",t("bc"),"CTRL+Z",fh.a),this._addButton("redo",t("bd"),"CTRL+Y",mh.a)}_addButton(t,e,n,o){const r=this.editor;r.ui.componentFactory.add(t,i=>{const s=r.commands.get(t),a=new jl(i);return a.set({label:e,icon:o,keystroke:n,tooltip:!0}),a.bind("isEnabled").to(s,"isEnabled"),this.listenTo(a,"execute",()=>r.execute(t)),a})}}class bh extends Hl{static get requires(){return[dh,gh]}static get pluginName(){return"Undo"}}const wh="ckCsrfToken",_h=40,kh="abcdefghijklmnopqrstuvwxyz0123456789";function vh(){let t=function(t){t=t.toLowerCase();const e=document.cookie.split(";");for(const n of e){const e=n.split("="),o=decodeURIComponent(e[0].trim().toLowerCase());if(o===t)return decodeURIComponent(e[1])}return null}(wh);return t&&t.length==_h||(t=function(t){let e="";const n=new Uint8Array(t);window.crypto.getRandomValues(n);for(let t=0;t<n.length;t++){const o=kh.charAt(n[t]%kh.length);e+=Math.random()>.5?o.toUpperCase():o}return e}(_h),function(t,e){document.cookie=encodeURIComponent(t)+"="+encodeURIComponent(e)+";path=/"}(wh,t)),t}class yh{constructor(t,e,n){this.loader=t,this.url=e,this.t=n}upload(){return new Promise((t,e)=>{this._initRequest(),this._initListeners(t,e),this._sendRequest()})}abort(){this.xhr&&this.xhr.abort()}_initRequest(){const t=this.xhr=new XMLHttpRequest;t.open("POST",this.url,!0),t.responseType="json"}_initListeners(t,e){const n=this.xhr,o=this.loader,r=(0,this.t)("a")+` ${o.file.name}.`;n.addEventListener("error",()=>e(r)),n.addEventListener("abort",()=>e()),n.addEventListener("load",()=>{const o=n.response;if(!o||!o.uploaded)return e(o&&o.error&&o.error.message?o.error.message:r);t({default:o.url})}),n.upload&&n.upload.addEventListener("progress",t=>{t.lengthComputable&&(o.uploadTotal=t.total,o.uploaded=t.loaded)})}_sendRequest(){const t=new FormData;t.append("upload",this.loader.file),t.append("ckCsrfToken",vh()),this.xhr.send(t)}}class xh{constructor(t,e,n){let o;if("function"==typeof n)o=n;else{const e=n;o=(()=>{t.execute(e)})}t.model.document.on("change",(n,r)=>{if("transparent"==r.type)return;const i=Array.from(t.model.document.differ.getChanges()),s=i[0];if(1!=i.length||"insert"!==s.type||"$text"!=s.name||1!=s.length)return;const a=s.position.textNode||s.position.nodeAfter;if(!a.parent.is("paragraph"))return;const c=e.exec(a.data);c&&t.model.enqueueChange(t=>{const e=$s.createFromParentsAndOffsets(a.parent,0,a.parent,c[0].length);t.remove(e),o({match:c})})})}}class Ch{constructor(t,e,n){let o,r,i,s;e instanceof RegExp?o=e:i=e,"string"==typeof n?r=n:s=n,i=i||(t=>{let e;const n=[],r=[];for(;null!==(e=o.exec(t))&&!(e&&e.length<4);){let{index:t,1:o,2:i,3:s}=e;const a=o+i+s,c=[t+=e[0].length-a.length,t+o.length],l=[t+o.length+i.length,t+o.length+i.length+s.length];n.push(c),n.push(l),r.push([t+o.length,t+o.length+i.length])}return{remove:n,format:r}}),s=s||((t,e)=>{for(const n of e)t.setAttribute(r,!0,n);t.removeSelectionAttribute(r)}),t.model.document.on("change",(e,n)=>{if("transparent"==n.type)return;const o=t.model.document.selection;if(!o.isCollapsed)return;const a=Array.from(t.model.document.differ.getChanges()),c=a[0];if(1!=a.length||"insert"!==c.type||"$text"!=c.name||1!=c.length)return;const l=o.focus.parent,u=function(t){return Array.from(t.getChildren()).reduce((t,e)=>t+e.data,"")}(l).slice(0,o.focus.offset),d=i(u),h=Ah(l,d.format),f=Ah(l,d.remove);h.length&&f.length&&t.model.enqueueChange(e=>{const n=t.model.schema.getValidRanges(h,r);s(e,n);for(const t of f.reverse())e.remove(t)})})}}function Ah(t,e){return e.filter(t=>void 0!==t[0]&&void 0!==t[1]).map(e=>$s.createFromParentsAndOffsets(t,e[0],t,e[1]))}class Ph extends Vu{constructor(t,e){super(t),this.attributeKey=e}refresh(){const t=this.editor.model,e=t.document;this.value=this._getValueFromFirstAllowedNode(),this.isEnabled=t.schema.checkAttributeInSelection(e.selection,this.attributeKey)}execute(t={}){const e=this.editor.model,n=e.document.selection,o=void 0===t.forceValue?!this.value:t.forceValue;e.change(t=>{if(n.isCollapsed)o?t.setSelectionAttribute(this.attributeKey,!0):t.removeSelectionAttribute(this.attributeKey);else{const r=e.schema.getValidRanges(n.getRanges(),this.attributeKey);for(const e of r)o?t.setAttribute(this.attributeKey,o,e):t.removeAttribute(this.attributeKey,e)}})}_getValueFromFirstAllowedNode(){const t=this.editor.model,e=t.schema,n=t.document.selection;if(n.isCollapsed)return n.hasAttribute(this.attributeKey);for(const t of n.getRanges())for(const n of t.getItems())if(e.checkAttribute(n,this.attributeKey))return n.hasAttribute(this.attributeKey);return!1}}const Th="bold";class Eh extends Hl{init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:Th}),t.conversion.attributeToElement({model:Th,view:"strong",upcastAlso:["b",{styles:{"font-weight":"bold"}}]}),t.commands.add(Th,new Ph(t,Th)),t.keystrokes.set("CTRL+B",Th)}}var Sh=n(40),Oh=n.n(Sh);const Rh="bold";class Ih extends Hl{init(){const t=this.editor,e=t.t;t.ui.componentFactory.add(Rh,n=>{const o=t.commands.get(Rh),r=new jl(n);return r.set({label:e("bb"),icon:Oh.a,keystroke:"CTRL+B",tooltip:!0}),r.bind("isOn","isEnabled").to(o,"value","isEnabled"),this.listenTo(r,"execute",()=>t.execute(Rh)),r})}}const Fh="code";class Dh extends Hl{init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:Fh}),t.conversion.attributeToElement({model:Fh,view:"code",upcastAlso:{styles:{"word-wrap":"break-word"}}}),t.commands.add(Fh,new Ph(t,Fh))}}var Nh=n(41),Mh=n.n(Nh);n(22);const Vh="code";class Bh extends Hl{init(){const t=this.editor,e=t.t;t.ui.componentFactory.add(Vh,n=>{const o=t.commands.get(Vh),r=new jl(n);return r.set({label:e("ak"),icon:Mh.a,tooltip:!0}),r.bind("isOn","isEnabled").to(o,"value","isEnabled"),this.listenTo(r,"execute",()=>t.execute(Vh)),r})}}const Lh="strikethrough";class zh extends Hl{init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:Lh}),t.conversion.attributeToElement({model:Lh,view:"s",upcastAlso:["del","strike",{styles:{"text-decoration":"line-through"}}]}),t.commands.add(Lh,new Ph(t,Lh)),t.keystrokes.set("CTRL+SHIFT+X","strikethrough")}}var qh=n(42),jh=n.n(qh);const Hh="strikethrough";class Uh extends Hl{init(){const t=this.editor,e=t.t;t.ui.componentFactory.add(Hh,n=>{const o=t.commands.get(Hh),r=new jl(n);return r.set({label:e("aj"),icon:jh.a,keystroke:"CTRL+SHIFT+X",tooltip:!0}),r.bind("isOn","isEnabled").to(o,"value","isEnabled"),this.listenTo(r,"execute",()=>t.execute(Hh)),r})}}const $h="italic";class Wh extends Hl{init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:$h}),t.conversion.attributeToElement({model:$h,view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]}),t.commands.add($h,new Ph(t,$h)),t.keystrokes.set("CTRL+I",$h)}}var Gh=n(43),Kh=n.n(Gh);const Jh="italic";class Zh extends Hl{init(){const t=this.editor,e=t.t;t.ui.componentFactory.add(Jh,n=>{const o=t.commands.get(Jh),r=new jl(n);return r.set({label:e("ai"),icon:Kh.a,keystroke:"CTRL+I",tooltip:!0}),r.bind("isOn","isEnabled").to(o,"value","isEnabled"),this.listenTo(r,"execute",()=>t.execute(Jh)),r})}}function Qh(t){const e=t.next();return e.done?null:e.value}class Yh extends Vu{refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(){const t=this.editor.model,e=t.document,n=t.schema,o=Array.from(e.selection.getSelectedBlocks());t.change(t=>{if(this.value)this._removeQuote(t,o.filter(Xh));else{const e=o.filter(t=>Xh(t)||ef(n,t));this._applyQuote(t,e)}})}_getValue(){const t=Qh(this.editor.model.document.selection.getSelectedBlocks());return!(!t||!Xh(t))}_checkEnabled(){if(this.value)return!0;const t=this.editor.model.document.selection,e=this.editor.model.schema,n=Qh(t.getSelectedBlocks());return!!n&&ef(e,n)}_removeQuote(t,e){tf(e).reverse().forEach(e=>{if(e.start.isAtStart&&e.end.isAtEnd)return void t.unwrap(e.start.parent);if(e.start.isAtStart){const n=Us.createBefore(e.start.parent);return void t.move(e,n)}e.end.isAtEnd||t.split(e.end);const n=Us.createAfter(e.end.parent);t.move(e,n)})}_applyQuote(t,e){const n=[];tf(e).reverse().forEach(e=>{let o=Xh(e.start);o||(o=new zs("blockQuote"),t.wrap(e,o)),n.push(o)}),n.reverse().reduce((e,n)=>e.nextSibling==n?(t.merge(Us.createAfter(e)),e):n)}}function Xh(t){return"blockQuote"==t.parent.name?t.parent:null}function tf(t){let e,n=0;const o=[];for(;n<t.length;){const r=t[n],i=t[n+1];e||(e=Us.createBefore(r)),i&&r.nextSibling==i||(o.push(new $s(e,Us.createAfter(r))),e=null),n++}return o}function ef(t,e){const n=t.checkChild(e.parent,"blockQuote"),o=t.checkChild(["$root","blockQuote"],e);return n&&o}class nf extends Hl{init(){const t=this.editor,e=t.model.schema;t.commands.add("blockQuote",new Yh(t)),e.register("blockQuote",{allowWhere:"$block",allowContentOf:"$root"}),e.addChildCheck((t,e)=>{if(t.endsWith("blockQuote")&&"blockQuote"==e.name)return!1}),t.conversion.elementToElement({model:"blockQuote",view:"blockquote"}),t.model.document.registerPostFixer(n=>{const o=t.model.document.differ.getChanges();for(const t of o)if("insert"==t.type){const o=t.position.nodeAfter;if(!o)continue;if(o.is("blockQuote")&&o.isEmpty)return n.remove(o),!0;if(o.is("blockQuote")&&!e.checkChild(t.position,o))return n.unwrap(o),!0;if(o.is("element")){const t=$s.createIn(o);for(const o of t.getItems())if(o.is("blockQuote")&&!e.checkChild(Us.createBefore(o),o))return n.unwrap(o),!0}}else if("remove"==t.type){const e=t.position.parent;if(e.is("blockQuote")&&e.isEmpty)return n.remove(e),!0}return!1})}afterInit(){const t=this.editor.commands.get("blockQuote");this.listenTo(this.editor.editing.view.document,"enter",(e,n)=>{const o=this.editor.model.document,r=o.selection.getLastPosition().parent;o.selection.isCollapsed&&r.isEmpty&&t.value&&(this.editor.execute("blockQuote"),this.editor.editing.view.scrollToTheSelection(),n.preventDefault(),e.stop())})}}var of=n(44),rf=n.n(of);n(91);class sf extends Hl{init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("blockQuote",n=>{const o=t.commands.get("blockQuote"),r=new jl(n);return r.set({label:e("ah"),icon:rf.a,tooltip:!0}),r.bind("isOn","isEnabled").to(o,"value","isEnabled"),this.listenTo(r,"execute",()=>t.execute("blockQuote")),r})}}class af extends Vu{refresh(){const t=this.editor.model,e=Qh(t.document.selection.getSelectedBlocks());this.value=!!e&&e.is("paragraph"),this.isEnabled=!!e&&cf(e,t.schema)}execute(t={}){const e=this.editor.model,n=e.document;e.change(o=>{const r=(t.selection||n.selection).getSelectedBlocks();for(const t of r)!t.is("paragraph")&&cf(t,e.schema)&&o.rename(t,"paragraph")})}}function cf(t,e){return e.checkChild(t.parent,"paragraph")&&!e.isObject(t)}class lf extends Hl{static get pluginName(){return"Paragraph"}init(){const t=this.editor,e=t.model,n=t.data;t.commands.add("paragraph",new af(t)),e.schema.register("paragraph",{inheritAllFrom:"$block"}),t.conversion.elementToElement({model:"paragraph",view:"p"}),n.upcastDispatcher.on("element",(t,e,n)=>{if(n.consumable.test(e.viewItem,{name:e.viewItem.name}))if(lf.paragraphLikeElements.has(e.viewItem.name)){if(e.viewItem.isEmpty)return;const t=n.writer.createElement("paragraph"),o=n.splitToAllowedParent(t,e.modelCursor);if(!o)return;n.writer.insert(t,o.position);const{modelRange:r}=n.convertChildren(e.viewItem,Us.createAt(t));e.modelRange=new $s(Us.createBefore(t),r.end),e.modelCursor=e.modelRange.end}else df(e.viewItem,e.modelCursor,n.schema)&&(e=Object.assign(e,uf(e.viewItem,e.modelCursor,n)))},{priority:"low"}),n.upcastDispatcher.on("text",(t,e,n)=>{e.modelRange||df(e.viewItem,e.modelCursor,n.schema)&&(e=Object.assign(e,uf(e.viewItem,e.modelCursor,n)))},{priority:"lowest"}),e.document.registerPostFixer(t=>this._autoparagraphEmptyRoots(t)),t.on("dataReady",()=>{e.enqueueChange("transparent",t=>this._autoparagraphEmptyRoots(t))},{priority:"lowest"})}_autoparagraphEmptyRoots(t){const e=this.editor.model;for(const n of e.document.getRootNames()){const o=e.document.getRoot(n);if(o.isEmpty&&"$graveyard"!=o.rootName&&e.schema.checkChild(o,"paragraph"))return t.insertElement("paragraph",o),!0}}}function uf(t,e,n){const o=n.writer.createElement("paragraph");return n.writer.insert(o,e),n.convertItem(t,Us.createAt(o))}function df(t,e,n){const o=new ya(e);return!!n.checkChild(o,"paragraph")&&!!n.checkChild(o.push("paragraph"),t)}lf.paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td"]);class hf extends Vu{constructor(t,e){super(t),this.modelElements=e}refresh(){const t=Qh(this.editor.model.document.selection.getSelectedBlocks());this.value=!!t&&this.modelElements.includes(t.name)&&t.name,this.isEnabled=!!t&&this.modelElements.some(e=>ff(t,e,this.editor.model.schema))}execute(t){const e=this.editor.model,n=e.document,o=t.value;e.change(t=>{const r=Array.from(n.selection.getSelectedBlocks()).filter(t=>ff(t,o,e.schema));for(const e of r)e.is(o)||t.rename(e,o)})}}function ff(t,e,n){return n.checkChild(t.parent,e)&&!n.isObject(t)}const pf="paragraph";class mf extends Hl{constructor(t){super(t),t.config.define("heading",{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h2",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h3",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h4",title:"Heading 3",class:"ck-heading_heading3"}]})}static get requires(){return[lf]}init(){const t=this.editor,e=t.config.get("heading.options"),n=[];for(const o of e)o.model!==pf&&(t.model.schema.register(o.model,{inheritAllFrom:"$block"}),t.conversion.elementToElement(o),n.push(o.model));t.commands.add("heading",new hf(t,n))}afterInit(){const t=this.editor,e=t.commands.get("enter"),n=t.config.get("heading.options");e&&this.listenTo(e,"afterExecute",(e,o)=>{const r=t.model.document.selection.getFirstPosition().parent;n.some(t=>r.is(t.model))&&!r.is(pf)&&0===r.childCount&&o.writer.rename(r,pf)})}}class gf{constructor(t,e){e&&Fo(this,e),t&&this.set(t)}}j(gf,Bo);class bf extends Cl{constructor(t){super(t);const e=this.bindTemplate;this.set("isVisible",!1),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-dropdown__panel",e.if("isVisible","ck-dropdown__panel-visible")]},children:this.children,on:{selectstart:e.to(t=>t.preventDefault())}})}focus(){this.children.length&&this.children.first.focus()}focusLast(){if(this.children.length){const t=this.children.last;"function"==typeof t.focusLast?t.focusLast():t.focus()}}}n(93);class wf extends Cl{constructor(t,e,n){super(t);const o=this.bindTemplate;this.buttonView=e,this.panelView=n,this.set("isOpen",!1),this.set("isEnabled",!0),this.focusTracker=new Yc,this.keystrokes=new Hc,this.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown",o.if("isEnabled","ck-disabled",t=>!t)]},children:[e,n]}),e.extendTemplate({attributes:{class:["ck-dropdown__button"]}})}render(){super.render(),this.listenTo(this.buttonView,"open",()=>{this.isOpen=!this.isOpen}),this.panelView.bind("isVisible").to(this,"isOpen"),this.keystrokes.listenTo(this.element),this.focusTracker.add(this.element);const t=(t,e)=>{this.isOpen&&(this.buttonView.focus(),this.isOpen=!1,e())};this.keystrokes.set("arrowdown",(t,e)=>{this.buttonView.isEnabled&&!this.isOpen&&(this.isOpen=!0,e())}),this.keystrokes.set("arrowright",(t,e)=>{this.isOpen&&e()}),this.keystrokes.set("arrowleft",t),this.keystrokes.set("esc",t)}focus(){this.buttonView.focus()}}var _f=n(45),kf=n.n(_f);class vf extends jl{constructor(t){super(t),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{"aria-haspopup":!0}}),this.delegate("execute").to(this,"open")}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){const t=new zl;return t.content=kf.a,t.extendTemplate({attributes:{class:"ck-dropdown__arrow"}}),t}}n(95);class yf extends Cl{constructor(){super(),this.items=this.createCollection(),this.focusTracker=new Yc,this.keystrokes=new Hc,this._focusCycler=new Fl({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowup",focusNext:"arrowdown"}}),this.setTemplate({tag:"ul",attributes:{class:["ck","ck-reset","ck-list"]},children:this.items})}render(){super.render();for(const t of this.items)this.focusTracker.add(t.element);this.items.on("add",(t,e)=>{this.focusTracker.add(e.element)}),this.items.on("remove",(t,e)=>{this.focusTracker.remove(e.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}}class xf extends Cl{constructor(t){super(t),this.children=this.createCollection(),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__item"]},children:this.children})}focus(){this.children.first.focus()}}class Cf extends Cl{constructor(t){super(t),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__separator"]}})}}n(97);class Af extends jl{constructor(t){super(t),this.toggleSwitchView=this._createToggleView(),this.extendTemplate({attributes:{class:"ck-switchbutton"}})}render(){super.render(),this.children.add(this.toggleSwitchView)}_createToggleView(){const t=new Cl;return t.setTemplate({tag:"span",attributes:{class:["ck","ck-button__toggle"]},children:[{tag:"span",attributes:{class:["ck","ck-button__toggle__inner"]}}]}),t}}function Pf({emitter:t,activator:e,callback:n,contextElements:o}){t.listenTo(document,"mousedown",(t,{target:r})=>{if(e()){for(const t of o)if(t.contains(r))return;n()}})}n(99),n(101);function Tf(t,e=vf){const n=new e(t),o=new bf(t),r=new wf(t,n,o);return n.bind("isEnabled").to(r),n instanceof vf?n.bind("isOn").to(r,"isOpen"):n.arrowView.bind("isOn").to(r,"isOpen"),function(t){(function(t){t.on("render",()=>{Pf({emitter:t,activator:()=>t.isOpen,callback:()=>{t.isOpen=!1},contextElements:[t.element]})})})(t),function(t){t.on("execute",e=>{e.source instanceof Af||(t.isOpen=!1)})}(t),function(t){t.keystrokes.set("arrowdown",(e,n)=>{t.isOpen&&(t.panelView.focus(),n())}),t.keystrokes.set("arrowup",(e,n)=>{t.isOpen&&(t.panelView.focusLast(),n())})}(t)}(r),r}function Ef(t,e){const n=t.locale,o=t.listView=new yf(n);o.items.bindTo(e).using(({type:t,model:e})=>{if("separator"===t)return new Cf(n);if("button"===t||"switchbutton"===t){const o=new xf(n);let r;return(r="button"===t?new jl(n):new Af(n)).bind(...Object.keys(e)).to(e),r.delegate("execute").to(o),o.children.add(r),o}}),t.panelView.children.add(o),o.items.delegate("execute").to(t)}n(23);class Sf extends Hl{init(){const t=this.editor,e=t.t,n=function(t){const e=t.t,n={Paragraph:e("ar"),"Heading 1":e("as"),"Heading 2":e("at"),"Heading 3":e("au")};return t.config.get("heading.options").map(t=>{const e=n[t.title];return e&&e!=t.title&&(t=Object.assign({},t,{title:e})),t})}(t),o=e("ad"),r=e("ae");t.ui.componentFactory.add("heading",e=>{const i={},s=new er,a=t.commands.get("heading"),c=t.commands.get("paragraph"),l=[a];for(const t of n){const e={type:"button",model:new gf({label:t.title,class:t.class,withText:!0})};"paragraph"===t.model?(e.model.bind("isOn").to(c,"value"),e.model.set("commandName","paragraph"),l.push(c)):(e.model.bind("isOn").to(a,"value",e=>e===t.model),e.model.set({commandName:"heading",commandValue:t.model})),s.add(e),i[t.model]=t.title}const u=Tf(e);return Ef(u,s),u.buttonView.set({isOn:!1,withText:!0,tooltip:r}),u.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),u.bind("isEnabled").toMany(l,"isEnabled",(...t)=>t.some(t=>t)),u.buttonView.bind("label").to(a,"value",c,"value",(t,e)=>{const n=t||e&&"paragraph";return i[n]?i[n]:o}),this.listenTo(u,"execute",e=>{t.execute(e.source.commandName,e.source.commandValue?{value:e.source.commandValue}:void 0),t.editing.view.focus()}),u})}}class Of extends li{constructor(t){super(t),this._observedElements=new Set}observe(t,e){this.document.getRoot(e).on("change:children",(e,n)=>{this.view.once("render",()=>this._updateObservedElements(t,n))})}_updateObservedElements(t,e){if(!e.is("element")||e.is("attributeElement"))return;const n=this.view.domConverter.mapViewToDom(e);if(n){for(const t of n.querySelectorAll("img"))this._observedElements.has(t)||(this.listenTo(t,"load",(t,e)=>this._fireEvents(e)),this._observedElements.add(t));for(const e of this._observedElements)t.contains(e)||(this.stopListening(e),this._observedElements.delete(e))}}_fireEvents(t){this.isEnabled&&(this.document.fire("layoutChanged"),this.document.fire("imageLoaded",t))}destroy(){this._observedElements.clear(),super.destroy()}}function Rf(t){return n=>{n.on(`attribute:${t}:image`,e)};function e(t,e,n){if(!n.consumable.consume(e.item,t.name))return;const o=n.writer,r=n.mapper.toViewElement(e.item).getChild(0);null!==e.attributeNewValue?o.setAttribute(e.attributeKey,e.attributeNewValue,r):o.removeAttribute(e.attributeKey,r)}}const If=Symbol("isImage");function Ff(t){const e=t.getSelectedElement();return!(!e||!function(t){return!!t.getCustomProperty(If)&&tu(t)}(e))}function Df(t){return t instanceof zs&&"image"==t.name}class Nf extends Hl{init(){const t=this.editor,e=t.model.schema,n=t.t,o=t.conversion;t.editing.view.addObserver(Of),e.register("image",{isObject:!0,isBlock:!0,allowWhere:"$block",allowAttributes:["alt","src","srcset"]}),o.for("dataDowncast").add(ca({model:"image",view:(t,e)=>Mf(e)})),o.for("editingDowncast").add(ca({model:"image",view:(t,e)=>(function(t,e,n){return e.setCustomProperty(If,!0,t),eu(t,e,{label:function(){const e=t.getChild(0).getAttribute("alt");return e?`${e} ${n}`:n}})})(Mf(e),e,n("ag"))})),o.for("downcast").add(Rf("src")).add(Rf("alt")).add(function(){return e=>{e.on("attribute:srcset:image",t)};function t(t,e,n){if(!n.consumable.consume(e.item,t.name))return;const o=n.writer,r=n.mapper.toViewElement(e.item).getChild(0);if(null===e.attributeNewValue){const t=e.attributeOldValue;t.data&&(o.removeAttribute("srcset",r),o.removeAttribute("sizes",r),t.width&&o.removeAttribute("width",r))}else{const t=e.attributeNewValue;t.data&&(o.setAttribute("srcset",t.data,r),o.setAttribute("sizes","100vw",r),t.width&&o.setAttribute("width",t.width,r))}}}()),o.for("upcast").add(Da({view:{name:"img",attributes:{src:!0}},model:(t,e)=>e.createElement("image",{src:t.getAttribute("src")})})).add(Ma({view:{name:"img",key:"alt"},model:"alt"})).add(Ma({view:{name:"img",key:"srcset"},model:{key:"srcset",value:t=>{const e={data:t.getAttribute("srcset")};return t.hasAttribute("width")&&(e.width=t.getAttribute("width")),e}}})).add(function(){return e=>{e.on("element:figure",t)};function t(t,e,n){if(!n.consumable.test(e.viewItem,{name:!0,classes:"image"}))return;const o=Array.from(e.viewItem.getChildren()).find(t=>t.is("img"));if(!o||!o.hasAttribute("src")||!n.consumable.test(o,{name:!0}))return;const r=n.convertItem(o,e.modelCursor),i=Qh(r.modelRange.getItems());i&&(n.convertChildren(e.viewItem,Us.createAt(i)),e.modelRange=r.modelRange,e.modelCursor=r.modelCursor)}}())}}function Mf(t){const e=t.createEmptyElement("img"),n=t.createContainerElement("figure",{class:"image"});return t.insert(Jo.createAt(n),e),n}class Vf extends Vu{refresh(){const t=this.editor.model.document.selection.getSelectedElement();this.isEnabled=Df(t),Df(t)&&t.hasAttribute("alt")?this.value=t.getAttribute("alt"):this.value=!1}execute(t){const e=this.editor.model,n=e.document.selection.getSelectedElement();e.change(e=>{e.setAttribute("alt",t.newValue,n)})}}class Bf extends Hl{init(){this.editor.commands.add("imageTextAlternative",new Vf(this.editor))}}n(104);class Lf extends Cl{constructor(t,e){super(t);const n=`ck-input-${R()}`,o=`ck-error-${R()}`;this.set("label"),this.set("value"),this.set("isReadOnly",!1),this.set("errorText",null),this.labelView=this._createLabelView(n),this.inputView=this._createInputView(e,n,o),this.errorView=this._createErrorView(o);const r=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-input",r.if("isReadOnly","ck-disabled")]},children:[this.labelView,this.inputView,this.errorView]})}_createLabelView(t){const e=new Pl(this.locale);return e.for=t,e.bind("text").to(this,"label"),e}_createInputView(t,e,n){const o=new t(this.locale,n);return o.id=e,o.ariaDesribedById=n,o.bind("value").to(this),o.bind("isReadOnly").to(this),o.bind("hasError").to(this,"errorText",t=>!!t),o.on("input",()=>{this.errorText=null}),o}_createErrorView(t){const e=new Cl(this.locale),n=this.bindTemplate;return e.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-input__error",n.if("errorText","ck-hidden",t=>!t)],id:t},children:[{text:n.to("errorText")}]}),e}select(){this.inputView.select()}focus(){this.inputView.focus()}}n(106);class zf extends Cl{constructor(t){super(t),this.set("value"),this.set("id"),this.set("placeholder"),this.set("isReadOnly",!1),this.set("hasError",!1),this.set("ariaDesribedById");const e=this.bindTemplate;this.setTemplate({tag:"input",attributes:{type:"text",class:["ck","ck-input","ck-input-text",e.if("hasError","ck-error")],id:e.to("id"),placeholder:e.to("placeholder"),readonly:e.to("isReadOnly"),"aria-invalid":e.if("hasError",!0),"aria-describedby":e.to("ariaDesribedById")},on:{input:e.to("input")}})}render(){super.render();const t=t=>{this.element.value=t||0===t?t:""};t(this.value),this.on("change:value",(e,n,o)=>{t(o)})}select(){this.element.select()}focus(){this.element.focus()}}function qf({view:t}){t.listenTo(t.element,"submit",(e,n)=>{n.preventDefault(),t.fire("submit")},{useCapture:!0})}var jf=n(9),Hf=n.n(jf),Uf=n(10),$f=n.n(Uf);n(108);class Wf extends Cl{constructor(t){super(t);const e=this.locale.t;this.focusTracker=new Yc,this.keystrokes=new Hc,this.labeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(e("ao"),Hf.a,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(e("ap"),$f.a,"ck-button-cancel","cancel"),this._focusables=new el,this._focusCycler=new Fl({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-text-alternative-form"],tabindex:"-1"},children:[this.labeledInput,this.saveButtonView,this.cancelButtonView]})}render(){super.render(),this.keystrokes.listenTo(this.element),qf({view:this}),[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element)})}_createButton(t,e,n,o){const r=new jl(this.locale);return r.set({label:t,icon:e,tooltip:!0}),r.extendTemplate({attributes:{class:n}}),o&&r.delegate("execute").to(this,o),r}_createLabeledInputView(){const t=this.locale.t,e=new Lf(this.locale,zf);return e.label=t("aq"),e.inputView.placeholder=t("aq"),e}}var Gf=n(46),Kf=n.n(Gf);function Jf(t){const e=t.editing.view,n=bu.defaultPositions;return{target:e.domConverter.viewToDom(e.document.selection.getSelectedElement()),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast]}}class Zf extends Hl{static get requires(){return[vu]}init(){this._createButton(),this._createForm()}_createButton(){const t=this.editor,e=t.t;t.ui.componentFactory.add("imageTextAlternative",n=>{const o=t.commands.get("imageTextAlternative"),r=new jl(n);return r.set({label:e("an"),icon:Kf.a,tooltip:!0}),r.bind("isEnabled").to(o,"isEnabled"),this.listenTo(r,"execute",()=>this._showForm()),r})}_createForm(){const t=this.editor,e=t.editing.view.document;this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new Wf(t.locale),this._form.render(),this.listenTo(this._form,"submit",()=>{t.execute("imageTextAlternative",{newValue:this._form.labeledInput.inputView.element.value}),this._hideForm(!0)}),this.listenTo(this._form,"cancel",()=>{this._hideForm(!0)}),this._form.keystrokes.set("Esc",(t,e)=>{this._hideForm(!0),e()}),this.listenTo(t.ui,"update",()=>{Ff(e.selection)?this._isVisible&&function(t){const e=t.plugins.get("ContextualBalloon");if(Ff(t.editing.view.document.selection)){const n=Jf(t);e.updatePosition(n)}}(t):this._hideForm(!0)}),Pf({emitter:this._form,activator:()=>this._isVisible,contextElements:[this._form.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible)return;const t=this.editor,e=t.commands.get("imageTextAlternative"),n=this._form.labeledInput;this._balloon.hasView(this._form)||this._balloon.add({view:this._form,position:Jf(t)}),n.value=n.inputView.element.value=e.value||"",this._form.labeledInput.select()}_hideForm(t){this._isVisible&&(this._balloon.remove(this._form),t&&this.editor.editing.view.focus())}get _isVisible(){return this._balloon.visibleView==this._form}}class Qf extends Hl{static get requires(){return[Bf,Zf]}static get pluginName(){return"ImageTextAlternative"}}n(110);n(112);const Yf=new WeakMap;function Xf(t,e,n,o){const r=t.document;Yf.has(r)||(Yf.set(r,new Map),r.registerPostFixer(t=>(function(t,e){const n=Yf.get(t);let o=!1;for(const[t,r]of n)tp(e,t,r)&&(o=!0);return o})(r,t))),Yf.get(r).set(e,{placeholderText:n,checkFunction:o}),t.render()}function tp(t,e,n){const o=e.document,r=n.placeholderText;let i=!1;if(!o)return!1;e.getAttribute("data-placeholder")!==r&&(t.setAttribute("data-placeholder",r,e),i=!0);const s=o.selection.anchor,a=n.checkFunction;if(a&&!a())return e.hasClass("ck-placeholder")&&(t.removeClass("ck-placeholder",e),i=!0),i;const c=!Array.from(e.getChildren()).some(t=>!t.is("uiElement"));return!o.isFocused&&c?(e.hasClass("ck-placeholder")||(t.addClass("ck-placeholder",e),i=!0),i):(c&&s&&s.parent!==e?e.hasClass("ck-placeholder")||(t.addClass("ck-placeholder",e),i=!0):e.hasClass("ck-placeholder")&&(t.removeClass("ck-placeholder",e),i=!0),i)}const ep=Symbol("imageCaption");function np(t){for(const e of t.getChildren())if(e instanceof zs&&"caption"==e.name)return e;return null}function op(t){const e=t.parent;return"figcaption"==t.name&&e&&"figure"==e.name&&e.hasClass("image")?{name:!0}:null}class rp extends Hl{init(){const t=this.editor,e=t.editing.view,n=t.model.schema,o=t.data,r=t.editing,i=t.t;n.register("caption",{allowIn:"image",allowContentOf:"$block",isLimit:!0}),t.model.document.registerPostFixer(t=>this._insertMissingModelCaptionElement(t)),t.conversion.for("upcast").add(Da({view:op,model:"caption"}));o.downcastDispatcher.on("insert:caption",ip(t=>t.createContainerElement("figcaption"),!1));const s=function(t,e){return n=>{const o=n.createEditableElement("figcaption");return n.setCustomProperty(ep,!0,o),Xf(t,o,e),ou(o,n)}}(e,i("af"));r.downcastDispatcher.on("insert:caption",ip(s)),r.downcastDispatcher.on("insert",this._fixCaptionVisibility(t=>t.item),{priority:"high"}),r.downcastDispatcher.on("remove",this._fixCaptionVisibility(t=>t.position.parent),{priority:"high"}),e.document.registerPostFixer(t=>this._updateCaptionVisibility(t))}_updateCaptionVisibility(t){const e=this.editor.editing.mapper,n=this._lastSelectedCaption;let o;const r=this.editor.model.document.selection,i=r.getSelectedElement();if(i&&i.is("image")){const t=np(i);o=e.toViewElement(t)}const s=sp(r.getFirstPosition().parent);if(s&&(o=e.toViewElement(s)),o)return n?n===o?cp(o,t):(ap(n,t),this._lastSelectedCaption=o,cp(o,t)):(this._lastSelectedCaption=o,cp(o,t));if(n){const e=ap(n,t);return this._lastSelectedCaption=null,e}return!1}_fixCaptionVisibility(t){return(e,n,o)=>{const r=sp(t(n)),i=this.editor.editing.mapper,s=o.writer;if(r){const t=i.toViewElement(r);t&&(r.childCount?s.removeClass("ck-hidden",t):s.addClass("ck-hidden",t))}}}_insertMissingModelCaptionElement(t){const e=this.editor.model.document.differ.getChanges();for(const n of e)if("insert"==n.type&&"image"==n.name){const e=n.position.nodeAfter;if(!np(e))return t.appendElement("caption",e),!0}}}function ip(t,e=!0){return(n,o,r)=>{const i=o.item;if((i.childCount||e)&&Df(i.parent)){if(!r.consumable.consume(o.item,"insert"))return;const e=r.mapper.toViewElement(o.range.start.parent),n=t(r.writer),s=r.writer;i.childCount||s.addClass("ck-hidden",n),function(t,e,n,o){const r=Jo.createAt(n,"end");o.writer.insert(r,t),o.mapper.bindElements(e,t)}(n,o.item,e,r)}}}function sp(t){const e=t.getAncestors({includeSelf:!0}).find(t=>"caption"==t.name);return e&&e.parent&&"image"==e.parent.name?e:null}function ap(t,e){return!t.childCount&&!t.hasClass("ck-hidden")&&(e.addClass("ck-hidden",t),!0)}function cp(t,e){return!!t.hasClass("ck-hidden")&&(e.removeClass("ck-hidden",t),!0)}n(114);class lp extends Vu{constructor(t,e){super(t),this._defaultStyle=!1,this.styles=e.reduce((t,e)=>(t[e.name]=e,e.isDefault&&(this._defaultStyle=e.name),t),{})}refresh(){const t=this.editor.model.document.selection.getSelectedElement();if(this.isEnabled=Df(t),t)if(t.hasAttribute("imageStyle")){const e=t.getAttribute("imageStyle");this.value=!!this.styles[e]&&e}else this.value=this._defaultStyle;else this.value=!1}execute(t){const e=t.value,n=this.editor.model,o=n.document.selection.getSelectedElement();n.change(t=>{this.styles[e].isDefault?t.removeAttribute("imageStyle",o):t.setAttribute("imageStyle",e,o)})}}function up(t,e){for(const n of e)if(n.name===t)return n}var dp=n(18),hp=n.n(dp),fp=n(19),pp=n.n(fp),mp=n(20),gp=n.n(mp),bp=n(11),wp=n.n(bp);const _p={full:{name:"full",title:"Full size image",icon:hp.a,isDefault:!0},side:{name:"side",title:"Side image",icon:wp.a,className:"image-style-side"},alignLeft:{name:"alignLeft",title:"Left aligned image",icon:pp.a,className:"image-style-align-left"},alignCenter:{name:"alignCenter",title:"Centered image",icon:gp.a,className:"image-style-align-center"},alignRight:{name:"alignRight",title:"Right aligned image",icon:wp.a,className:"image-style-align-right"}},kp={full:hp.a,left:pp.a,right:wp.a,center:gp.a};function vp(t=[]){return t.map(yp).map(t=>Object.assign({},t))}function yp(t){if("string"==typeof t){const e=t;_p[e]?t=Object.assign({},_p[e]):(ps.a.warn("image-style-not-found: There is no such image style of given name.",{name:e}),t={name:e})}else if(_p[t.name]){const e=_p[t.name],n=Object.assign({},t);for(const o in e)t.hasOwnProperty(o)||(n[o]=e[o]);t=n}return"string"==typeof t.icon&&kp[t.icon]&&(t.icon=kp[t.icon]),t}class xp extends Hl{static get requires(){return[Nf]}static get pluginName(){return"ImageStyleEditing"}init(){const t=this.editor,e=t.model.schema,n=t.data,o=t.editing;t.config.define("image.styles",["full","side"]);const r=vp(t.config.get("image.styles"));e.extend("image",{allowAttributes:"imageStyle"});const i=function(t){return(e,n,o)=>{if(!o.consumable.consume(n.item,e.name))return;const r=up(n.attributeNewValue,t),i=up(n.attributeOldValue,t),s=o.mapper.toViewElement(n.item),a=o.writer;i&&a.removeClass(i.className,s),r&&a.addClass(r.className,s)}}(r);o.downcastDispatcher.on("attribute:imageStyle:image",i),n.downcastDispatcher.on("attribute:imageStyle:image",i),n.upcastDispatcher.on("element:figure",function(t){const e=t.filter(t=>!t.isDefault);return(t,n,o)=>{if(!n.modelRange)return;const r=n.viewItem,i=Qh(n.modelRange.getItems());if(o.schema.checkAttribute(i,"imageStyle"))for(const t of e)o.consumable.consume(r,{classes:t.className})&&o.writer.setAttribute("imageStyle",t.name,i)}}(r),{priority:"low"}),t.commands.add("imageStyle",new lp(t,r))}}n(116);class Cp extends Hl{get localizedDefaultStylesTitles(){const t=this.editor.t;return{"Full size image":t("y"),"Side image":t("z"),"Left aligned image":t("aa"),"Centered image":t("ab"),"Right aligned image":t("ac")}}init(){const t=function(t,e){for(const n of t)e[n.title]&&(n.title=e[n.title]);return t}(vp(this.editor.config.get("image.styles")),this.localizedDefaultStylesTitles);for(const e of t)this._createButton(e)}_createButton(t){const e=this.editor,n=`imageStyle:${t.name}`;e.ui.componentFactory.add(n,n=>{const o=e.commands.get("imageStyle"),r=new jl(n);return r.set({label:t.title,icon:t.icon,tooltip:!0}),r.bind("isEnabled").to(o,"isEnabled"),r.bind("isOn").to(o,"value",e=>e===t.name),this.listenTo(r,"execute",()=>e.execute("imageStyle",{value:t.name})),r})}}class Ap extends Hl{static get requires(){return[vu]}static get pluginName(){return"WidgetToolbarRepository"}init(){const t=this.editor,e=t.plugins.get("BalloonToolbar");e&&this.listenTo(e,"show",e=>{(function(t){const e=t.getSelectedElement();return!(!e||!tu(e))})(t.editing.view.document.selection)&&e.stop()},{priority:"high"}),this._toolbars=new Map,this._balloon=this.editor.plugins.get("ContextualBalloon"),this.listenTo(t.ui,"update",()=>{this._updateToolbarsVisibility()}),this.listenTo(t.ui.focusTracker,"change:isFocused",()=>{this._updateToolbarsVisibility()},{priority:"low"})}register(t,{items:e,visibleWhen:n,balloonClassName:o="ck-toolbar-container"}){const r=this.editor,i=new Ml;if(this._toolbars.has(t))throw new E.b("widget-toolbar-duplicated: Toolbar with the given id was already added.",{toolbarId:t});i.fillFromConfig(e,r.ui.componentFactory),this._toolbars.set(t,{view:i,visibleWhen:n,balloonClassName:o})}_updateToolbarsVisibility(){for(const t of this._toolbars.values())this.editor.ui.focusTracker.isFocused&&t.visibleWhen(this.editor.editing.view.document.selection)?this._showToolbar(t):this._hideToolbar(t)}_hideToolbar(t){this._isToolbarVisible(t)&&this._balloon.remove(t.view)}_showToolbar(t){this._isToolbarVisible(t)?function(t){const e=t.plugins.get("ContextualBalloon"),n=Pp(t);e.updatePosition(n)}(this.editor):this._balloon.hasView(t.view)||this._balloon.add({view:t.view,position:Pp(this.editor),balloonClassName:t.balloonClassName})}_isToolbarVisible(t){return this._balloon.visibleView==t.view}}function Pp(t){const e=t.editing.view,n=bu.defaultPositions,o=function(t){const e=t.getSelectedElement();if(e&&tu(e))return e;let n=t.getFirstPosition().parent;for(;n;){if(n.is("element")&&tu(n))return n;n=n.parent}}(e.document.selection);return{target:e.domConverter.viewToDom(o),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast]}}function Tp(t,e){return new $s(Ep(t,e,!0),Ep(t,e,!1))}function Ep(t,e,n){let o=t.textNode||(n?t.nodeBefore:t.nodeAfter),r=null;for(;o&&o.getAttribute("linkHref")==e;)r=o,o=n?o.previousSibling:o.nextSibling;return r?Us.createAt(r,n?"before":"after"):t}class Sp extends Vu{refresh(){const t=this.editor.model,e=t.document;this.value=e.selection.getAttribute("linkHref"),this.isEnabled=t.schema.checkAttributeInSelection(e.selection,"linkHref")}execute(t){const e=this.editor.model,n=e.document.selection;e.change(o=>{if(n.isCollapsed){const e=n.getFirstPosition();if(n.hasAttribute("linkHref")){const e=Tp(n.getFirstPosition(),n.getAttribute("linkHref"));o.setAttribute("linkHref",t,e),o.setSelection(e)}else if(""!==t){const r=Ns(n.getAttributes());r.set("linkHref",t);const i=o.createText(t,r);o.insert(i,e),o.setSelection($s.createOn(i))}}else{const r=e.schema.getValidRanges(n.getRanges(),"linkHref");for(const e of r)o.setAttribute("linkHref",t,e)}})}}class Op extends Vu{refresh(){this.isEnabled=this.editor.model.document.selection.hasAttribute("linkHref")}execute(){const t=this.editor.model,e=t.document.selection;t.change(t=>{const n=e.isCollapsed?[Tp(e.getFirstPosition(),e.getAttribute("linkHref"))]:e.getRanges();for(const e of n)t.removeAttribute("linkHref",e)})}}const Rp=Symbol("linkElement"),Ip=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,Fp=/^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i;function Dp(t,e){const n=e.createAttributeElement("a",{href:t},{priority:5});return e.setCustomProperty(Rp,!0,n),n}function Np(t){return function(t){return t.replace(Ip,"").match(Fp)}(t=String(t))?t:"#"}class Mp{constructor(t,e,n){this.model=t,this.attribute=n,this._modelSelection=t.document.selection,this._overrideUid=null,this._isNextGravityRestorationSkipped=!1,e.listenTo(this._modelSelection,"change:range",(t,e)=>{this._isNextGravityRestorationSkipped?this._isNextGravityRestorationSkipped=!1:this._isGravityOverridden&&(!e.directChange&&Vp(this._modelSelection.getFirstPosition(),n)||this._restoreGravity())})}handleForwardMovement(t,e){const n=this.attribute;if(!(this._isGravityOverridden||t.isAtStart&&this._hasSelectionAttribute))return zp(t,n)&&this._hasSelectionAttribute?(this._preventCaretMovement(e),this._removeSelectionAttribute(),!0):Bp(t,n)?(this._preventCaretMovement(e),this._overrideGravity(),!0):Lp(t,n)&&this._hasSelectionAttribute?(this._preventCaretMovement(e),this._overrideGravity(),!0):void 0}handleBackwardMovement(t,e){const n=this.attribute;return this._isGravityOverridden?zp(t,n)&&this._hasSelectionAttribute?(this._preventCaretMovement(e),this._restoreGravity(),this._removeSelectionAttribute(),!0):(this._preventCaretMovement(e),this._restoreGravity(),t.isAtStart&&this._removeSelectionAttribute(),!0):zp(t,n)&&!this._hasSelectionAttribute?(this._preventCaretMovement(e),this._setSelectionAttributeFromTheNodeBefore(t),!0):t.isAtEnd&&Lp(t,n)?this._hasSelectionAttribute?void(qp(t,n)&&(this._skipNextAutomaticGravityRestoration(),this._overrideGravity())):(this._preventCaretMovement(e),this._setSelectionAttributeFromTheNodeBefore(t),!0):t.isAtStart?this._hasSelectionAttribute?(this._removeSelectionAttribute(),this._preventCaretMovement(e),!0):void 0:void(qp(t,n)&&(this._skipNextAutomaticGravityRestoration(),this._overrideGravity()))}get _isGravityOverridden(){return!!this._overrideUid}get _hasSelectionAttribute(){return this._modelSelection.hasAttribute(this.attribute)}_overrideGravity(){this._overrideUid=this.model.change(t=>t.overrideSelectionGravity())}_restoreGravity(){this.model.change(t=>{t.restoreSelectionGravity(this._overrideUid),this._overrideUid=null})}_preventCaretMovement(t){t.preventDefault()}_removeSelectionAttribute(){this.model.change(t=>{t.removeSelectionAttribute(this.attribute)})}_setSelectionAttributeFromTheNodeBefore(t){const e=this.attribute;this.model.change(n=>{n.setSelectionAttribute(this.attribute,t.nodeBefore.getAttribute(e))})}_skipNextAutomaticGravityRestoration(){this._isNextGravityRestorationSkipped=!0}}function Vp(t,e){return Bp(t,e)||Lp(t,e)}function Bp(t,e){const{nodeBefore:n,nodeAfter:o}=t,r=!!n&&n.hasAttribute(e);return!!o&&o.hasAttribute(e)&&(!r||n.getAttribute(e)!==o.getAttribute(e))}function Lp(t,e){const{nodeBefore:n,nodeAfter:o}=t,r=!!n&&n.hasAttribute(e),i=!!o&&o.hasAttribute(e);return r&&(!i||n.getAttribute(e)!==o.getAttribute(e))}function zp(t,e){const{nodeBefore:n,nodeAfter:o}=t,r=!!n&&n.hasAttribute(e);if(!!o&&o.hasAttribute(e)&&r)return o.getAttribute(e)!==n.getAttribute(e)}function qp(t,e){return Vp(t.getShiftedBy(-1),e)}n(118);const jp="ck-link_selected";class Hp extends Hl{init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"linkHref"}),t.conversion.for("dataDowncast").add(la({model:"linkHref",view:Dp})),t.conversion.for("editingDowncast").add(la({model:"linkHref",view:(t,e)=>Dp(Np(t),e)})),t.conversion.for("upcast").add(Na({view:{name:"a",attributes:{href:!0}},model:{key:"linkHref",value:t=>t.getAttribute("href")}})),t.commands.add("link",new Sp(t)),t.commands.add("unlink",new Op(t)),function(t,e,n,o){const r=new Mp(e,n,o),i=e.document.selection;n.listenTo(t.document,"keydown",(t,e)=>{if(!i.isCollapsed)return;if(e.shiftKey||e.altKey||e.ctrlKey)return;const n=e.keyCode==fr.arrowright,o=e.keyCode==fr.arrowleft;if(!n&&!o)return;const s=i.getFirstPosition();let a;(a=n?r.handleForwardMovement(s,e):r.handleBackwardMovement(s,e))&&t.stop()},{priority:I.get("high")+1})}(t.editing.view,t.model,this,"linkHref"),this._setupLinkHighlight()}_setupLinkHighlight(){const t=this.editor,e=t.editing.view,n=new Set;e.document.registerPostFixer(e=>{const o=t.model.document.selection;if(o.hasAttribute("linkHref")){const r=Tp(o.getFirstPosition(),o.getAttribute("linkHref")),i=t.editing.mapper.toViewRange(r);for(const t of i.getItems())t.is("a")&&(e.addClass(jp,t),n.add(t))}}),t.conversion.for("editingDowncast").add(t=>{function o(){e.change(t=>{for(const e of n.values())t.removeClass(jp,e),n.delete(e)})}t.on("insert",o,{priority:"highest"}),t.on("remove",o,{priority:"highest"}),t.on("attribute",o,{priority:"highest"}),t.on("selection",o,{priority:"highest"})})}}class Up extends Qi{constructor(t){super(t),this.domEventType="click"}onDomEvent(t){this.fire(t.type,t)}}n(120);class $p extends Cl{constructor(t){super(t);const e=t.t;this.focusTracker=new Yc,this.keystrokes=new Hc,this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(e("ao"),Hf.a,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(e("ap"),$f.a,"ck-button-cancel","cancel"),this._focusables=new el,this._focusCycler=new Fl({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-link-form"],tabindex:"-1"},children:[this.urlInputView,this.saveButtonView,this.cancelButtonView]})}render(){super.render(),qf({view:this}),[this.urlInputView,this.saveButtonView,this.cancelButtonView].forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}_createUrlInput(){const t=this.locale.t,e=new Lf(this.locale,zf);return e.label=t("az"),e.inputView.placeholder="https://example.com",e}_createButton(t,e,n,o){const r=new jl(this.locale);return r.set({label:t,icon:e,tooltip:!0}),r.extendTemplate({attributes:{class:n}}),o&&r.delegate("execute").to(this,o),r}}var Wp=n(47),Gp=n.n(Wp),Kp=n(48),Jp=n.n(Kp);n(122);class Zp extends Cl{constructor(t){super(t);const e=t.t;this.focusTracker=new Yc,this.keystrokes=new Hc,this.previewButtonView=this._createPreviewButton(),this.unlinkButtonView=this._createButton(e("av"),Gp.a,"unlink"),this.editButtonView=this._createButton(e("aw"),Jp.a,"edit"),this.set("href"),this._focusables=new el,this._focusCycler=new Fl({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-link-actions"],tabindex:"-1"},children:[this.previewButtonView,this.editButtonView,this.unlinkButtonView]})}render(){super.render(),[this.previewButtonView,this.editButtonView,this.unlinkButtonView].forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}_createButton(t,e,n){const o=new jl(this.locale);return o.set({label:t,icon:e,tooltip:!0}),o.delegate("execute").to(this,n),o}_createPreviewButton(){const t=new jl(this.locale),e=this.bindTemplate,n=this.t;return t.set({withText:!0,tooltip:n("ax")}),t.extendTemplate({attributes:{class:["ck","ck-link-actions__preview"],href:e.to("href",t=>t&&Np(t)),target:"_blank"}}),t.bind("label").to(this,"href",t=>t||n("ay")),t.bind("isEnabled").to(this,"href",t=>!!t),t.template.tag="a",t.template.eventListeners={},t}}var Qp=n(49),Yp=n.n(Qp);const Xp="Ctrl+K";class tm extends Hl{static get requires(){return[vu]}init(){const t=this.editor;t.editing.view.addObserver(Up),this.actionsView=this._createActionsView(),this.formView=this._createFormView(),this._balloon=t.plugins.get(vu),this._createToolbarLinkButton(),this._enableUserBalloonInteractions()}_createActionsView(){const t=this.editor,e=new Zp(t.locale),n=t.commands.get("link"),o=t.commands.get("unlink");return e.bind("href").to(n,"value"),e.editButtonView.bind("isEnabled").to(n),e.unlinkButtonView.bind("isEnabled").to(o),this.listenTo(e,"edit",()=>{this._addFormView()}),this.listenTo(e,"unlink",()=>{t.execute("unlink"),this._hideUI()}),e.keystrokes.set("Esc",(t,e)=>{this._hideUI(),e()}),e.keystrokes.set(Xp,(t,e)=>{this._addFormView(),e()}),e}_createFormView(){const t=this.editor,e=new $p(t.locale),n=t.commands.get("link");return e.urlInputView.bind("value").to(n,"value"),e.urlInputView.bind("isReadOnly").to(n,"isEnabled",t=>!t),e.saveButtonView.bind("isEnabled").to(n),this.listenTo(e,"submit",()=>{t.execute("link",e.urlInputView.inputView.element.value),this._removeFormView()}),this.listenTo(e,"cancel",()=>{this._removeFormView()}),e.keystrokes.set("Esc",(t,e)=>{this._removeFormView(),e()}),e}_createToolbarLinkButton(){const t=this.editor,e=t.commands.get("link"),n=t.t;t.keystrokes.set(Xp,(t,n)=>{n(),e.isEnabled&&this._showUI()}),t.ui.componentFactory.add("link",t=>{const o=new jl(t);return o.isEnabled=!0,o.label=n("v"),o.icon=Yp.a,o.keystroke=Xp,o.tooltip=!0,o.bind("isOn","isEnabled").to(e,"value","isEnabled"),this.listenTo(o,"execute",()=>this._showUI()),o})}_enableUserBalloonInteractions(){const t=this.editor.editing.view.document;this.listenTo(t,"click",()=>{this._getSelectedLinkElement()&&this._showUI()}),this.editor.keystrokes.set("Tab",(t,e)=>{this._areActionsVisible&&!this.actionsView.focusTracker.isFocused&&(this.actionsView.focus(),e())},{priority:"high"}),this.editor.keystrokes.set("Esc",(t,e)=>{this._isUIVisible&&(this._hideUI(),e())}),Pf({emitter:this.formView,activator:()=>this._isUIVisible,contextElements:[this._balloon.view.element],callback:()=>this._hideUI()})}_addActionsView(){this._areActionsInPanel||this._balloon.add({view:this.actionsView,position:this._getBalloonPositionData()})}_addFormView(){if(this._isFormInPanel)return;const t=this.editor.commands.get("link");this._balloon.add({view:this.formView,position:this._getBalloonPositionData()}),this.formView.urlInputView.select(),this.formView.urlInputView.inputView.element.value=t.value||""}_removeFormView(){this._isFormInPanel&&(this._balloon.remove(this.formView),this.editor.editing.view.focus())}_showUI(){this.editor.commands.get("link").isEnabled&&(this._getSelectedLinkElement()?this._areActionsVisible?this._addFormView():this._addActionsView():(this._addActionsView(),this._addFormView()),this._startUpdatingUI())}_hideUI(){if(!this._isUIInPanel)return;const t=this.editor;this.stopListening(t.ui,"update"),this._removeFormView(),this._balloon.remove(this.actionsView),t.editing.view.focus()}_startUpdatingUI(){const t=this.editor,e=t.editing.view.document;let n=this._getSelectedLinkElement(),o=r();function r(){return e.selection.focus.getAncestors().reverse().find(t=>t.is("element"))}this.listenTo(t.ui,"update",()=>{const t=this._getSelectedLinkElement(),e=r();n&&!t||!n&&e!==o?this._hideUI():this._balloon.updatePosition(this._getBalloonPositionData()),n=t,o=e})}get _isFormInPanel(){return this._balloon.hasView(this.formView)}get _areActionsInPanel(){return this._balloon.hasView(this.actionsView)}get _areActionsVisible(){return this._balloon.visibleView===this.actionsView}get _isUIInPanel(){return this._isFormInPanel||this._areActionsInPanel}get _isUIVisible(){return this._balloon.visibleView==this.formView||this._areActionsVisible}_getBalloonPositionData(){const t=this.editor.editing.view,e=t.document,n=this._getSelectedLinkElement();return{target:n?t.domConverter.mapViewToDom(n):t.domConverter.viewRangeToDom(e.selection.getFirstRange())}}_getSelectedLinkElement(){const t=this.editor.editing.view.document.selection;if(t.isCollapsed)return em(t.getFirstPosition());{const e=t.getFirstRange().getTrimmed(),n=em(e.start),o=em(e.end);return n&&n==o&&Zo.createIn(n).getTrimmed().isEqual(e)?n:null}}}function em(t){return t.getAncestors().find(t=>(function(t){return t.is("attributeElement")&&!!t.getCustomProperty(Rp)})(t))}class nm extends Vu{constructor(t,e){super(t),this.type="bulleted"==e?"bulleted":"numbered"}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(){const t=this.editor.model,e=t.document,n=Array.from(e.selection.getSelectedBlocks()).filter(e=>rm(e,t.schema)),o=!0===this.value;t.change(t=>{if(o){let e=n[n.length-1].nextSibling,o=Number.POSITIVE_INFINITY,r=[];for(;e&&"listItem"==e.name&&0!==e.getAttribute("listIndent");){const t=e.getAttribute("listIndent");t<o&&(o=t);const n=t-o;r.push({element:e,listIndent:n}),e=e.nextSibling}r=r.reverse();for(const e of r)t.setAttribute("listIndent",e.listIndent,e.element)}if(!o){let t=Number.POSITIVE_INFINITY;for(const e of n)e.is("listItem")&&e.getAttribute("listIndent")<t&&(t=e.getAttribute("listIndent"));om(n,!0,t=0===t?1:t),om(n,!1,t)}for(const e of n.reverse())o&&"listItem"==e.name?t.rename(e,"paragraph"):o||"listItem"==e.name?o||"listItem"!=e.name||e.getAttribute("listType")==this.type||t.setAttribute("listType",this.type,e):(t.setAttributes({listType:this.type,listIndent:0},e),t.rename(e,"listItem"))})}_getValue(){const t=Qh(this.editor.model.document.selection.getSelectedBlocks());return!!t&&t.is("listItem")&&t.getAttribute("listType")==this.type}_checkEnabled(){if(this.value)return!0;const t=this.editor.model.document.selection,e=this.editor.model.schema,n=Qh(t.getSelectedBlocks());return!!n&&rm(n,e)}}function om(t,e,n){const o=e?t[0]:t[t.length-1];if(o.is("listItem")){let r=o[e?"previousSibling":"nextSibling"],i=o.getAttribute("listIndent");for(;r&&r.is("listItem")&&r.getAttribute("listIndent")>=n;)i>r.getAttribute("listIndent")&&(i=r.getAttribute("listIndent")),r.getAttribute("listIndent")==i&&t[e?"unshift":"push"](r),r=r[e?"previousSibling":"nextSibling"]}}function rm(t,e){return e.checkChild(t.parent,"listItem")&&!e.isObject(t)}class im extends Vu{constructor(t,e){super(t),this._indentBy="forward"==e?1:-1}refresh(){this.isEnabled=this._checkEnabled()}execute(){const t=this.editor.model,e=t.document;let n=Array.from(e.selection.getSelectedBlocks());t.change(t=>{const e=n[n.length-1];let o=e.nextSibling;for(;o&&"listItem"==o.name&&o.getAttribute("listIndent")>e.getAttribute("listIndent");)n.push(o),o=o.nextSibling;this._indentBy<0&&(n=n.reverse());for(const e of n){const n=e.getAttribute("listIndent")+this._indentBy;n<0?t.rename(e,"paragraph"):t.setAttribute("listIndent",n,e)}})}_checkEnabled(){const t=Qh(this.editor.model.document.selection.getSelectedBlocks());if(!t||!t.is("listItem"))return!1;if(this._indentBy>0){const e=t.getAttribute("listIndent"),n=t.getAttribute("listType");let o=t.previousSibling;for(;o&&o.is("listItem")&&o.getAttribute("listIndent")>=e;){if(o.getAttribute("listIndent")==e)return o.getAttribute("listType")==n;o=o.previousSibling}return!1}return!0}}function sm(){const t=!this.isEmpty&&("ul"==this.getChild(0).name||"ol"==this.getChild(0).name);return this.isEmpty||t?0:null}function am(t,e,n){const o=n.consumable;if(!o.test(e.item,"insert")||!o.test(e.item,"attribute:listType")||!o.test(e.item,"attribute:listIndent"))return;o.consume(e.item,"insert"),o.consume(e.item,"attribute:listType"),o.consume(e.item,"attribute:listIndent");const r=e.item;vm(r,function(t,e){const n=e.mapper,o=e.writer,r="numbered"==t.getAttribute("listType")?"ol":"ul",i=function(t){const e=t.createContainerElement("li");return e.getFillerOffset=sm,e}(o),s=o.createContainerElement(r,null);return o.insert(Jo.createAt(s),i),n.bindElements(t,i),i}(r,n),n)}function cm(t,e,n){const o=n.mapper.toViewPosition(e.position).getLastMatchingPosition(t=>!t.item.is("li")).nodeAfter,r=n.writer;r.breakContainer(Jo.createBefore(o)),r.breakContainer(Jo.createAfter(o));const i=o.parent,s=i.previousSibling,a=Zo.createOn(i),c=r.remove(a);s&&s.nextSibling&&km(r,s,s.nextSibling),ym(n.mapper.toModelElement(o).getAttribute("listIndent")+1,e.position,a.start,o,n);for(const t of Zo.createIn(c).getItems())n.mapper.unbindViewElement(t);t.stop()}function lm(t,e,n){if(!n.consumable.consume(e.item,"attribute:listType"))return;const o=n.mapper.toViewElement(e.item),r=n.writer;r.breakContainer(Jo.createBefore(o)),r.breakContainer(Jo.createAfter(o));let i=o.parent;const s="numbered"==e.attributeNewValue?"ol":"ul";km(r,i=r.rename(s,i),i.nextSibling),km(r,i.previousSibling,i);for(const t of e.item.getChildren())n.consumable.consume(t,"insert")}function um(t,e,n){if(!n.consumable.consume(e.item,"attribute:listIndent"))return;const o=n.mapper.toViewElement(e.item),r=n.writer;r.breakContainer(Jo.createBefore(o)),r.breakContainer(Jo.createAfter(o));const i=o.parent,s=i.previousSibling,a=Zo.createOn(i);r.remove(a),s&&s.nextSibling&&km(r,s,s.nextSibling),ym(e.attributeOldValue+1,e.range.start,a.start,o,n),vm(e.item,o,n);for(const t of e.item.getChildren())n.consumable.consume(t,"insert")}function dm(t,e,n){if("listItem"!=e.item.name){let t=n.mapper.toViewPosition(e.range.start);const o=n.writer,r=[];for(;("ul"==t.parent.name||"ol"==t.parent.name)&&"li"==(t=o.breakContainer(t)).parent.name;){const e=t,n=Jo.createAt(t.parent,"end");if(!e.isEqual(n)){const t=o.remove(new Zo(e,n));r.push(t)}t=Jo.createAfter(t.parent)}if(r.length>0){for(let e=0;e<r.length;e++){const n=t.nodeBefore;if(t=o.insert(t,r[e]).end,e>0){const e=km(o,n,n.nextSibling);e&&e.parent==n&&t.offset--}}km(o,t.nodeBefore,t.nodeAfter)}}}function hm(t,e,n){const o=n.mapper.toViewPosition(e.position),r=o.nodeBefore,i=o.nodeAfter;km(n.writer,r,i)}function fm(t,e,n){if(n.consumable.consume(e.viewItem,{name:!0})){const t=n.writer,o=this.conversionApi.store,r=t.createElement("listItem");o.indent=o.indent||0,t.setAttribute("listIndent",o.indent,r);const i=e.viewItem.parent&&"ol"==e.viewItem.parent.name?"numbered":"bulleted";t.setAttribute("listType",i,r),o.indent++;const s=n.splitToAllowedParent(r,e.modelCursor);if(!s)return;t.insert(r,s.position);let a=Us.createAfter(r);for(const t of e.viewItem.getChildren())"ul"==t.name||"ol"==t.name?a=n.convertItem(t,a).modelCursor:n.convertItem(t,Us.createAt(r,"end"));o.indent--,e.modelRange=new $s(e.modelCursor,a),s.cursorParent?e.modelCursor=Us.createAt(s.cursorParent):e.modelCursor=e.modelRange.end}}function pm(t,e,n){if(n.consumable.test(e.viewItem,{name:!0})){const t=Array.from(e.viewItem.getChildren());for(const e of t)e.is("li")||e._remove()}}function mm(t,e,n){if(n.consumable.test(e.viewItem,{name:!0})){if(0===e.viewItem.childCount)return;const t=[...e.viewItem.getChildren()];let n=!1,o=!0;for(const e of t)!n||e.is("ul")||e.is("ol")||e._remove(),e.is("text")?(o&&(e._data=e.data.replace(/^\s+/,"")),(!e.nextSibling||e.nextSibling.is("ul")||e.nextSibling.is("ol"))&&(e._data=e.data.replace(/\s+$/,""))):(e.is("ul")||e.is("ol"))&&(n=!0),o=!1}}function gm(t,e){if(e.isPhantom)return;const n=e.modelPosition.nodeBefore;if(n&&n.is("listItem")){const t=e.mapper.toViewElement(n),o=t.getAncestors().find(t=>t.is("ul")||t.is("ol")),r=new Ko({startPosition:Jo.createAt(t,0)});for(const t of r){if("elementStart"==t.type&&t.item.is("li")){e.viewPosition=t.previousPosition;break}if("elementEnd"==t.type&&t.item==o){e.viewPosition=t.nextPosition;break}}}}function bm(t,e){const n=e.viewPosition,o=n.parent,r=e.mapper;if("ul"==o.name||"ol"==o.name){if(n.isAtEnd){const t=r.toModelElement(n.nodeBefore),o=r.getModelLength(n.nodeBefore);e.modelPosition=Us.createBefore(t).getShiftedBy(o)}else{const t=r.toModelElement(n.nodeAfter);e.modelPosition=Us.createBefore(t)}t.stop()}else if("li"==o.name&&n.nodeBefore&&("ul"==n.nodeBefore.name||"ol"==n.nodeBefore.name)){const i=r.toModelElement(o);let s=1,a=n.nodeBefore;for(;a&&(a.is("ul")||a.is("ol"));)s+=r.getModelLength(a),a=a.previousSibling;e.modelPosition=Us.createBefore(i).getShiftedBy(s),t.stop()}}function wm(t,[e,n]){let o,r=e.is("documentFragment")?e.getChild(0):e;if(o=n?new Qs(n):this.document.selection,r&&r.is("listItem")){const t=o.getFirstPosition();let e=null;if(t.parent.is("listItem")?e=t.parent:t.nodeBefore&&t.nodeBefore.is("listItem")&&(e=t.nodeBefore),e){const t=e.getAttribute("listIndent");if(t>0)for(;r&&r.is("listItem");)r._setAttribute("listIndent",r.getAttribute("listIndent")+t),r=r.nextSibling}}}function _m(t,e){const n=!!e.sameIndent,o=!!e.smallerIndent,r=t instanceof zs?t.getAttribute("listIndent"):e.listIndent;let i=t instanceof zs?t.previousSibling:t.nodeBefore;for(;i&&"listItem"==i.name;){const t=i.getAttribute("listIndent");if(n&&r==t||o&&r>t)return i;i=i.previousSibling}return null}function km(t,e,n){return e&&n&&("ul"==e.name||"ol"==e.name)&&e.name==n.name?t.mergeContainers(Jo.createAfter(e)):null}function vm(t,e,n){const o=e.parent,r=n.mapper,i=n.writer;let s=r.toViewPosition(Us.createBefore(t));const a=_m(t,{sameIndent:!0,smallerIndent:!0}),c=t.previousSibling;if(a&&a.getAttribute("listIndent")==t.getAttribute("listIndent")){const t=r.toViewElement(a);s=i.breakContainer(Jo.createAfter(t))}else s=c&&"listItem"==c.name?r.toViewPosition(Us.createAt(c,"end")):r.toViewPosition(Us.createBefore(t));if(s=xm(s),i.insert(s,o),c&&"listItem"==c.name){const t=r.toViewElement(c),n=new Ko({boundaries:new Zo(Jo.createAt(t,0),s),ignoreElementEnd:!0});for(const t of n)if(t.item.is("li")){const o=i.breakContainer(Jo.createBefore(t.item)),r=t.item.parent,s=Jo.createAt(e,"end");km(i,s.nodeBefore,s.nodeAfter),i.move(Zo.createOn(r),s),n.position=o}}else{const n=o.nextSibling;if(n&&(n.is("ul")||n.is("ol"))){let o=null;for(const e of n.getChildren()){const n=r.toModelElement(e);if(!(n&&n.getAttribute("listIndent")>t.getAttribute("listIndent")))break;o=e}o&&(i.breakContainer(Jo.createAfter(o)),i.move(Zo.createOn(o.parent),Jo.createAt(e,"end")))}}km(i,o,o.nextSibling),km(i,o.previousSibling,o)}function ym(t,e,n,o,r){const i=_m(e,{sameIndent:!0,smallerIndent:!0,listIndent:t}),s=r.mapper,a=r.writer,c=i?i.getAttribute("listIndent"):null;let l;if(i)if(c==t){const t=s.toViewElement(i).parent;l=Jo.createAfter(t)}else{const t=Us.createAt(i,"end");l=s.toViewPosition(t)}else l=n;l=xm(l);for(const t of[...o.getChildren()])(t.is("ul")||t.is("ol"))&&(l=a.move(Zo.createOn(t),l).end,km(a,t,t.nextSibling),km(a,t.previousSibling,t))}function xm(t){return t.getLastMatchingPosition(t=>t.item.is("uiElement"))}class Cm extends Hl{static get requires(){return[lf]}init(){const t=this.editor;t.model.schema.register("listItem",{inheritAllFrom:"$block",allowAttributes:["listType","listIndent"]});const e=t.data,n=t.editing;t.model.document.registerPostFixer(e=>(function(t,e){const n=t.document.differ.getChanges(),o=new Map;let r=!1;for(const t of n)if("insert"==t.type&&"listItem"==t.name)i(t.position);else if("insert"==t.type&&"listItem"!=t.name){if("$text"!=t.name){const n=t.position.nodeAfter;n.hasAttribute("listIndent")&&(e.removeAttribute("listIndent",n),r=!0),n.hasAttribute("listType")&&(e.removeAttribute("listType",n),r=!0)}i(t.position.getShiftedBy(t.length))}else"remove"==t.type&&"listItem"==t.name?i(t.position):"attribute"==t.type&&"listIndent"==t.attributeKey?i(t.range.start):"attribute"==t.type&&"listType"==t.attributeKey&&i(t.range.start);for(const t of o.values())s(t),a(t);return r;function i(t){const e=t.nodeBefore;if(e&&e.is("listItem")){let n=e;if(o.has(n))return;for(;n.previousSibling&&n.previousSibling.is("listItem");)if(n=n.previousSibling,o.has(n))return;o.set(t.nodeBefore,n)}else{const e=t.nodeAfter;e&&e.is("listItem")&&o.set(e,e)}}function s(t){let n=0,o=null;for(;t&&t.is("listItem");){const i=t.getAttribute("listIndent");if(i>n){let s;null===o?(o=i-n,s=n):(o>i&&(o=i),s=i-o),e.setAttribute("listIndent",s,t),r=!0}else o=null,n=t.getAttribute("listIndent")+1;t=t.nextSibling}}function a(t){let n=[],o=null;for(;t&&t.is("listItem");){const i=t.getAttribute("listIndent");if(o&&o.getAttribute("listIndent")>i&&(n=n.slice(0,i+1)),0!=i)if(n[i]){const o=n[i];t.getAttribute("listType")!=o&&(e.setAttribute("listType",o,t),r=!0)}else n[i]=t.getAttribute("listType");o=t,t=t.nextSibling}}})(t.model,e)),n.mapper.registerViewToModelLength("li",Am),e.mapper.registerViewToModelLength("li",Am),n.mapper.on("modelToViewPosition",gm),n.mapper.on("viewToModelPosition",bm),e.mapper.on("modelToViewPosition",gm),n.downcastDispatcher.on("insert",dm,{priority:"high"}),n.downcastDispatcher.on("insert:listItem",am),e.downcastDispatcher.on("insert",dm,{priority:"high"}),e.downcastDispatcher.on("insert:listItem",am),n.downcastDispatcher.on("attribute:listType:listItem",lm),e.downcastDispatcher.on("attribute:listType:listItem",lm),n.downcastDispatcher.on("attribute:listIndent:listItem",um),e.downcastDispatcher.on("attribute:listIndent:listItem",um),n.downcastDispatcher.on("remove:listItem",cm),n.downcastDispatcher.on("remove",hm,{priority:"low"}),e.downcastDispatcher.on("remove:listItem",cm),e.downcastDispatcher.on("remove",hm,{priority:"low"}),e.upcastDispatcher.on("element:ul",pm,{priority:"high"}),e.upcastDispatcher.on("element:ol",pm,{priority:"high"}),e.upcastDispatcher.on("element:li",mm,{priority:"high"}),e.upcastDispatcher.on("element:li",fm),t.model.on("insertContent",wm,{priority:"high"}),t.commands.add("numberedList",new nm(t,"numbered")),t.commands.add("bulletedList",new nm(t,"bulleted")),t.commands.add("indentList",new im(t,"forward")),t.commands.add("outdentList",new im(t,"backward"));const o=this.editor.editing.view.document;this.listenTo(o,"enter",(t,e)=>{const n=this.editor.model.document,o=n.selection.getLastPosition().parent;n.selection.isCollapsed&&"listItem"==o.name&&o.isEmpty&&(this.editor.execute("outdentList"),e.preventDefault(),t.stop())}),this.listenTo(o,"delete",(t,e)=>{if("backward"!==e.direction)return;const n=this.editor.model.document.selection;if(!n.isCollapsed)return;const o=n.getFirstPosition();if(!o.isAtStart)return;const r=o.parent;"listItem"===r.name&&(r.previousSibling&&"listItem"===r.previousSibling.name||(this.editor.execute("outdentList"),e.preventDefault(),t.stop()))},{priority:"high"});const r=t=>(e,n)=>{this.editor.commands.get(t).isEnabled&&(this.editor.execute(t),n())};this.editor.keystrokes.set("Tab",r("indentList")),this.editor.keystrokes.set("Shift+Tab",r("outdentList"))}}function Am(t){let e=1;for(const n of t.getChildren())if("ul"==n.name||"ol"==n.name)for(const t of n.getChildren())e+=Am(t);return e}var Pm=n(50),Tm=n.n(Pm),Em=n(51),Sm=n.n(Em);class Om extends Hl{init(){const t=this.editor.t;this._addButton("numberedList",t("w"),Tm.a),this._addButton("bulletedList",t("x"),Sm.a)}_addButton(t,e,n){const o=this.editor;o.ui.componentFactory.add(t,r=>{const i=o.commands.get(t),s=new jl(r);return s.set({label:e,icon:n,tooltip:!0}),s.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(s,"execute",()=>o.execute(t)),s})}}var Rm=n(52),Im=n.n(Rm);var Fm=n(53),Dm=n.n(Fm);const Nm=Symbol("isOPCodeBlock");function Mm(t){return!!t.getCustomProperty(Nm)&&tu(t)}function Vm(t){const e=t.getSelectedElement();return!(!e||!Mm(e))}function Bm(t,e,n){const o=e.createContainerElement("div",{class:"op-ckeditor--code-block",title:window.I18n.t("js.editor.macro.toolbar_help")});return Lm(e,t,o),function(t,e,n){return e.setCustomProperty(Nm,!0,t),eu(t,e,{label:n})}(o,e,n)}function Lm(t,e,n){const o=(e.getAttribute("opCodeblockLanguage")||"language-text").replace(/^language-/,""),r=t.createContainerElement("div",{class:"op-ckeditor--code-block-language"});zm(t,o,r,"text"),t.insert(Jo.createAt(n),r),zm(t,e.getAttribute("opCodeblockContent"),n,"(empty)")}function zm(t,e,n,o){const r=t.createText(e||o);t.insert(Jo.createAt(n),r)}class qm extends Qi{constructor(t){super(t),this.domEventType="dblclick"}onDomEvent(t){this.fire(t.type,t)}}class jm extends Hl{static get pluginName(){return"CodeBlockEditing"}init(){const t=this.editor,e=t.model.schema,n=t.conversion,o=t.editing.view,r=o.document,i=t.config.get("openProject.pluginContext");e.register("codeblock",{isObject:!0,isBlock:!0,allowContentOf:"$block",allowWhere:["$root","$block"],allowIn:["$root"],allowAttributes:["opCodeblockLanguage","opCodeblockContent"]}),n.for("upcast").add(function(){return e=>{e.on("element:pre",t,{priority:"high"})};function t(t,e,n){if(!n.consumable.test(e.viewItem,{name:!0}))return;const o=Array.from(e.viewItem.getChildren()).find(t=>t.is("code"));if(!o||!n.consumable.consume(o,{name:!0}))return;const r=n.writer.createElement("codeblock");n.writer.setAttribute("opCodeblockLanguage",o.getAttribute("class"),r);const i=n.splitToAllowedParent(r,e.modelCursor);if(i){n.writer.insert(r,i.position);const t=o.getChild(0);n.consumable.consume(t,{name:!0});const s=t.data.replace(/\n$/,"");n.writer.setAttribute("opCodeblockContent",s,r),e.modelRange=new $s(Us.createBefore(r),Us.createAfter(r)),e.modelCursor=e.modelRange.end}}}()),n.for("editingDowncast").add(ca({model:"codeblock",view:(t,e)=>Bm(t,e,"Code block")})).add(function(){return e=>{e.on("attribute:opCodeblockContent",t),e.on("attribute:opCodeblockLanguage",t)};function t(t,e,n){const o=e.item;n.consumable.consume(e.item,t.name);const r=n.mapper.toViewElement(o);n.writer.remove(Zo.createOn(r.getChild(1))),n.writer.remove(Zo.createOn(r.getChild(0))),Lm(n.writer,o,r)}}()),n.for("dataDowncast").add(function(){return e=>{e.on("insert:codeblock",t,{priority:"high"})};function t(t,e,n){const o=e.item,r=o.getAttribute("opCodeblockLanguage")||"language-text",i=o.getAttribute("opCodeblockContent");n.consumable.consume(o,"insert");const s=n.writer,a=s.createContainerElement("pre"),c=s.createContainerElement("div",{class:"op-ckeditor--code-block-language"}),l=s.createContainerElement("code",{class:r}),u=s.createText(r),d=s.createText(i);s.insert(Jo.createAt(l),d),s.insert(Jo.createAt(c),u),s.insert(Jo.createAt(a),c),s.insert(Jo.createAt(a),l),n.mapper.bindElements(o,l),n.mapper.bindElements(o,a);const h=n.mapper.toViewPosition(e.range.start);s.insert(h,a),t.stop()}}()),o.addObserver(qm),this.listenTo(r,"dblclick",(e,n)=>{let o=n.target,r=n.domEvent;if(r.shiftKey||r.altKey||r.metaKey)return;if(!Mm(o)&&!(o=o.findAncestor(Mm)))return;n.preventDefault(),n.stopPropagation();const s=t.editing.mapper.toModelElement(o),a=i.services.macros,c=s.getAttribute("opCodeblockLanguage"),l=s.getAttribute("opCodeblockContent");a.editCodeBlock(l,c).then(e=>t.model.change(t=>{t.setAttribute("opCodeblockLanguage",e.languageClass,s),t.setAttribute("opCodeblockContent",e.content,s)}))}),t.ui.componentFactory.add("insertCodeBlock",e=>{const n=new jl(e);return n.set({label:window.I18n.t("js.editor.macro.code_block.button"),icon:Dm.a,tooltip:!0}),n.on("execute",()=>{i.services.macros.editCodeBlock().then(e=>t.model.change(n=>{const o=n.createElement("codeblock");n.setAttribute("opCodeblockLanguage",e.languageClass,o),n.setAttribute("opCodeblockContent",e.content,o),t.model.insertContent(o,t.model.document.selection)}))}),n})}}class Hm extends Hl{static get requires(){return[vu]}static get pluginName(){return"CodeBlockToolbar"}init(){const t=this.editor,e=this.editor.model,n=t.config.get("openProject.pluginContext");Cu(t,"opEditCodeBlock",t=>{const o=n.services.macros,r=t.getAttribute("opCodeblockLanguage"),i=t.getAttribute("opCodeblockContent");o.editCodeBlock(i,r).then(n=>e.change(e=>{e.setAttribute("opCodeblockLanguage",n.languageClass,t),e.setAttribute("opCodeblockContent",n.content,t)}))})}afterInit(){Pu(this,this.editor,"OPCodeBlock",Vm)}}var Um=n(54),$m=n.n(Um);function Wm(t){return t.__currentlyDisabled=t.__currentlyDisabled||[],t.ui.view.toolbar?t.ui.view.toolbar.items._items:[]}function Gm(t,e){jQuery.each(Wm(t),function(n,o){let r=o;o instanceof Qu?r=o.buttonView:o!==e&&o.hasOwnProperty("isEnabled")||(r=null),r&&(r.isEnabled?r.isEnabled=!1:t.__currentlyDisabled.push(r))})}function Km(t){jQuery.each(Wm(t),function(e,n){let o=n;n instanceof Qu&&(o=n.buttonView),t.__currentlyDisabled.indexOf(o)<0&&(o.isEnabled=!0)}),t.__currentlyDisabled=[]}function Jm(t,e){let n=e.parent;for(;n;){if(n.name===t)return n;n=n.parent}}function Zm(t,e,n,o,r=1){e>r?o.setAttribute(t,e,n):o.removeAttribute(t,n)}function Qm(t,e,n={}){const o=t.createElement("tableCell",n);t.insertElement("paragraph",o),t.insert(o,e)}function Ym(){return t=>{t.on("element:table",(t,e,n)=>{const o=e.viewItem;if(!n.consumable.test(o,{name:!0}))return;const{rows:r,headingRows:i,headingColumns:s}=function(t){const e={headingRows:0,headingColumns:0},n=[],o=[];let r;for(const i of Array.from(t.getChildren()))if("tbody"===i.name||"thead"===i.name||"tfoot"===i.name){"thead"!==i.name||r||(r=i);for(const t of Array.from(i.getChildren()))if("thead"===t.parent.name&&t.parent===r)e.headingRows++,n.push(t);else{o.push(t);const n=tg(t);n>e.headingColumns&&(e.headingColumns=n)}}return e.rows=[...n,...o],e}(o),a={};s&&(a.headingColumns=s),i&&(a.headingRows=i);const c=n.writer.createElement("table",a),l=n.splitToAllowedParent(c,e.modelCursor);if(l){if(n.writer.insert(c,l.position),n.consumable.consume(o,{name:!0}),r.length)r.forEach(t=>n.convertItem(t,Us.createAt(c,"end")));else{const t=n.writer.createElement("tableRow");n.writer.insert(t,Us.createAt(c,"end")),Qm(n.writer,Us.createAt(t,"end"))}e.modelRange=new $s(Us.createBefore(c),Us.createAfter(c)),l.cursorParent?e.modelCursor=Us.createAt(l.cursorParent):e.modelCursor=e.modelRange.end}})}}function Xm(t){return e=>{e.on(`element:${t}`,(t,e,n)=>{const o=e.viewItem;if(!n.consumable.test(o,{name:!0}))return;const r=n.writer.createElement("tableCell"),i=n.splitToAllowedParent(r,e.modelCursor);if(!i)return;n.writer.insert(r,i.position),n.consumable.consume(o,{name:!0});const s=Us.createAt(r);n.convertChildren(o,s),r.childCount||n.writer.insertElement("paragraph",s),e.modelRange=new $s(Us.createBefore(r),Us.createAfter(r)),e.modelCursor=e.modelRange.end})}}function tg(t){let e=0,n=0;const o=Array.from(t.getChildren()).filter(t=>"th"===t.name||"td"===t.name);for(;n<o.length&&"th"===o[n].name;){const t=o[n];e+=parseInt(t.getAttribute("colspan")||1),n++}return e}class eg{constructor(t,e={}){this.table=t,this.startRow=e.startRow||0,this.endRow="number"==typeof e.endRow?e.endRow:void 0,this.includeSpanned=!!e.includeSpanned,this.column="number"==typeof e.column?e.column:void 0,this._skipRows=new Set,this._row=0,this._column=0,this._cell=0,this._spannedCells=new Map}[Symbol.iterator](){return this}next(){const t=this.table.getChild(this._row);if(!t||this._isOverEndRow())return{done:!0};if(this._isSpanned(this._row,this._column)){const t=this._column,e=this._formatOutValue(void 0,t);return this._column++,!this.includeSpanned||this._shouldSkipRow()||this._shouldSkipColumn(t,1)?this.next():e}const e=t.getChild(this._cell);if(!e)return this._row++,this._column=0,this._cell=0,this.next();const n=parseInt(e.getAttribute("colspan")||1),o=parseInt(e.getAttribute("rowspan")||1);(n>1||o>1)&&this._recordSpans(this._row,this._column,o,n);const r=this._column,i=this._formatOutValue(e,r,o,n);return this._column++,this._cell++,this._shouldSkipRow()||this._shouldSkipColumn(r,n)?this.next():i}skipRow(t){this._skipRows.add(t)}_isOverEndRow(){return void 0!==this.endRow&&this._row>this.endRow}_formatOutValue(t,e,n=1,o=1){return{done:!1,value:{cell:t,row:this._row,column:e,rowspan:n,colspan:o,cellIndex:this._cell}}}_shouldSkipRow(){const t=this._row<this.startRow,e=this._skipRows.has(this._row);return t||e}_shouldSkipColumn(t,e){if(void 0===this.column)return!1;const n=t===this.column,o=t<this.column&&t+e>this.column;return!n&&!o}_isSpanned(t,e){if(!this._spannedCells.has(t))return!1;return this._spannedCells.get(t).has(e)}_recordSpans(t,e,n,o){for(let n=e+1;n<=e+o-1;n++)this._markSpannedCell(t,n);for(let r=t+1;r<t+n;r++)for(let t=e;t<=e+o-1;t++)this._markSpannedCell(r,t)}_markSpannedCell(t,e){this._spannedCells.has(t)||this._spannedCells.set(t,new Map),this._spannedCells.get(t).set(e,!0)}}const ng=Symbol("isTable");function og(t){return!!t.getCustomProperty(ng)&&tu(t)}function rg(t){const e=t.getSelectedElement();return!(!e||!og(e))}function ig(t){const e=Jm("table",t.getFirstPosition());return!(!e||!og(e.parent))}function sg(t={}){return e=>e.on("insert:table",(e,n,o)=>{const r=n.item;if(!o.consumable.consume(r,"insert"))return;o.consumable.consume(r,"attribute:headingRows:table"),o.consumable.consume(r,"attribute:headingColumns:table");const i=t&&t.asWidget,s=o.writer.createContainerElement("figure",{class:"table"}),a=o.writer.createContainerElement("table");let c;o.writer.insert(Jo.createAt(s),a),i&&(c=function(t,e){return e.setCustomProperty(ng,!0,t),eu(t,e,{hasSelectionHandler:!0})}(s,o.writer));const l=new eg(r),u={headingRows:r.getAttribute("headingRows")||0,headingColumns:r.getAttribute("headingColumns")||0};for(const e of l){const{row:n,cell:i}=e,s=bg(gg(n,u),a,o),c=pg(r.getChild(n),n,s,o);o.consumable.consume(i,"insert"),fg(e,u,Jo.createAt(c,"end"),o,t)}const d=o.mapper.toViewPosition(n.range.start);o.mapper.bindElements(r,i?c:s),o.writer.insert(d,i?c:s)})}function ag(t={}){return e=>e.on("insert:tableRow",(e,n,o)=>{const r=n.item;if(!o.consumable.consume(r,"insert"))return;const i=r.parent,s=vg(o.mapper.toViewElement(i)),a=i.getChildIndex(r),c=new eg(i,{startRow:a,endRow:a}),l={headingRows:i.getAttribute("headingRows")||0,headingColumns:i.getAttribute("headingColumns")||0};for(const e of c){const n=pg(r,a,bg(gg(a,l),s,o),o);o.consumable.consume(e.cell,"insert"),fg(e,l,Jo.createAt(n,"end"),o,t)}})}function cg(t={}){return e=>e.on("insert:tableCell",(e,n,o)=>{const r=n.item;if(!o.consumable.consume(r,"insert"))return;const i=r.parent,s=i.parent,a=s.getChildIndex(i),c=new eg(s,{startRow:a,endRow:a}),l={headingRows:s.getAttribute("headingRows")||0,headingColumns:s.getAttribute("headingColumns")||0};for(const e of c)if(e.cell===r){const n=o.mapper.toViewElement(i);return void fg(e,l,Jo.createAt(n,i.getChildIndex(r)),o,t)}})}function lg(t={}){const e=!!t.asWidget;return t=>t.on("attribute:headingRows:table",(t,n,o)=>{const r=n.item;if(!o.consumable.consume(n.item,t.name))return;const i=vg(o.mapper.toViewElement(r)),s=n.attributeOldValue,a=n.attributeNewValue;if(a>s){const t=Array.from(r.getChildren()).filter(({index:t})=>c(t,s-1,a));kg(t,bg("thead",i,o),o,"end");for(const n of t)for(const t of n.getChildren())dg(t,"th",o,e);_g("tbody",i,o)}else{kg(Array.from(r.getChildren()).filter(({index:t})=>c(t,a-1,s)).reverse(),bg("tbody",i,o),o);const t=new eg(r,{startRow:a?a-1:a,endRow:s-1}),n={headingRows:r.getAttribute("headingRows")||0,headingColumns:r.getAttribute("headingColumns")||0};for(const r of t)hg(r,n,o,e);_g("thead",i,o)}function c(t,e,n){return t>e&&t<n}})}function ug(t={}){const e=!!t.asWidget;return t=>t.on("attribute:headingColumns:table",(t,n,o)=>{const r=n.item;if(!o.consumable.consume(n.item,t.name))return;const i={headingRows:r.getAttribute("headingRows")||0,headingColumns:r.getAttribute("headingColumns")||0},s=n.attributeOldValue,a=n.attributeNewValue,c=(s>a?s:a)-1;for(const t of new eg(r))t.column>c||hg(t,i,o,e)})}function dg(t,e,n,o){const r=n.mapper.toViewElement(t);if(!r)return;let i;if(o){i=ou(n.writer.createEditableElement(e,r.getAttributes()),n.writer),n.writer.insert(Jo.createAfter(r),i),n.writer.move(Zo.createIn(r),Jo.createAt(i)),n.writer.remove(Zo.createOn(r))}else i=n.writer.rename(e,r);n.mapper.bindElements(t,i)}function hg(t,e,n,o){const{cell:r}=t,i=mg(t,e),s=n.mapper.toViewElement(r);s&&s.name!==i&&dg(r,i,n,o)}function fg(t,e,n,o,r){const i=r&&r.asWidget,s=mg(t,e),a=i?ou(o.writer.createEditableElement(s),o.writer):o.writer.createContainerElement(s),c=t.cell,l=1===c.childCount&&"paragraph"===c.getChild(0).name;if(o.writer.insert(n,a),l){const t=c.getChild(0),e=Jo.createAt(a,"end");if(o.consumable.consume(t,"insert"),r.asWidget){const n=[...t.getAttributeKeys()].length?"p":"span",r=o.writer.createContainerElement(n);o.mapper.bindElements(t,r),o.writer.insert(e,r),o.mapper.bindElements(c,a)}else o.mapper.bindElements(c,a),o.mapper.bindElements(t,a)}else o.mapper.bindElements(c,a)}function pg(t,e,n,o){let r=o.mapper.toViewElement(t);if(!r){o.consumable.consume(t,"insert"),r=o.writer.createContainerElement("tr"),o.mapper.bindElements(t,r);const i=t.parent.getAttribute("headingRows")||0,s=i>0&&e>=i?e-i:e,a=Jo.createAt(n,s);o.writer.insert(a,r)}return r}function mg(t,e){const{row:n,column:o}=t,{headingColumns:r,headingRows:i}=e;return i&&i>n?"th":r&&r>o?"th":"td"}function gg(t,e){return t<e.headingRows?"thead":"tbody"}function bg(t,e,n){const o=wg(t,e);return o||function(t,e,n){const o=n.writer.createContainerElement(t);return n.writer.insert(Jo.createAt(e,"tbody"==t?"end":"start"),o),o}(t,e,n)}function wg(t,e){for(const n of e.getChildren())if(n.name==t)return n}function _g(t,e,n){const o=wg(t,e);o&&0===o.childCount&&n.writer.remove(Zo.createOn(o))}function kg(t,e,n,o){for(const r of t){const t=n.mapper.toViewElement(r);t&&n.writer.move(Zo.createOn(t),Jo.createAt(e,o))}}function vg(t){for(const e of t.getChildren())if("table"===e.name)return e}class yg extends Hl{static get pluginName(){return"TableUtils"}getCellLocation(t){const e=t.parent,n=e.parent,o=n.getChildIndex(e),r=new eg(n,{startRow:o,endRow:o});for(const{cell:e,row:n,column:o}of r)if(e===t)return{row:n,column:o}}createTable(t,e,n){const o=t.createElement("table");return xg(t,o,0,e,n),o}insertRows(t,e={}){const n=this.editor.model,o=e.at||0,r=e.rows||1;n.change(e=>{const n=t.getAttribute("headingRows")||0;if(n>o&&e.setAttribute("headingRows",n+r,t),0===o||o===t.childCount)return void xg(e,t,o,r,this.getColumns(t));const i=new eg(t,{endRow:o});let s=0;for(const{row:t,rowspan:n,colspan:a,cell:c}of i){t<o&&t+n>o&&e.setAttribute("rowspan",n+r,c),t===o&&(s+=a)}xg(e,t,o,r,s)})}insertColumns(t,e={}){const n=this.editor.model,o=e.at||0,r=e.columns||1;n.change(e=>{const n=t.getAttribute("headingColumns");o<n&&e.setAttribute("headingColumns",n+r,t);const i=this.getColumns(t);if(0===o||i===o){for(const n of t.getChildren())Cg(r,e,Us.createAt(n,o?"end":0));return}const s=new eg(t,{column:o,includeSpanned:!0});for(const{row:n,column:i,cell:a,colspan:c,rowspan:l,cellIndex:u}of s)if(i!==o){if(e.setAttribute("colspan",c+r,a),s.skipRow(n),l>1)for(let t=n+1;t<n+l;t++)s.skipRow(t)}else{const o=Us.createFromParentAndOffset(t.getChild(n),u);Cg(r,e,o)}})}splitCellVertically(t,e=2){const n=this.editor.model,o=t.parent.parent,r=parseInt(t.getAttribute("rowspan")||1),i=parseInt(t.getAttribute("colspan")||1);n.change(n=>{if(i>1){const{newCellsSpan:o,updatedSpan:s}=Ag(i,e);Zm("colspan",s,t,n);const a={};o>1&&(a.colspan=o),r>1&&(a.rowspan=r),Cg(i>e?e-1:i-1,n,Us.createAfter(t),a)}if(i<e){const s=e-i,a=[...new eg(o)],{column:c}=a.find(({cell:e})=>e===t),l=a.filter(({cell:e,colspan:n,column:o})=>{return e!==t&&o===c||o<c&&o+n>c});for(const{cell:t,colspan:e}of l)n.setAttribute("colspan",e+s,t);const u={};r>1&&(u.rowspan=r),Cg(s,n,Us.createAfter(t),u);const d=o.getAttribute("headingColumns")||0;d>c&&Zm("headingColumns",d+s,o,n)}})}splitCellHorizontally(t,e=2){const n=this.editor.model,o=t.parent,r=o.parent,i=r.getChildIndex(o),s=parseInt(t.getAttribute("rowspan")||1),a=parseInt(t.getAttribute("colspan")||1);n.change(n=>{if(s>1){const o=[...new eg(r,{startRow:i,endRow:i+s-1,includeSpanned:!0})],{newCellsSpan:c,updatedSpan:l}=Ag(s,e);Zm("rowspan",l,t,n);const{column:u}=o.find(({cell:e})=>e===t),d={};c>1&&(d.rowspan=c),a>1&&(d.colspan=a);for(const{column:t,row:e,cellIndex:s}of o){if(e>=i+l&&t===u&&(e+i+l)%c==0){Cg(1,n,Us.createFromParentAndOffset(r.getChild(e),s),d)}}}if(s<e){const o=e-s,c=[...new eg(r,{startRow:0,endRow:i})];for(const{cell:e,rowspan:r,row:s}of c)if(e!==t&&s+r>i){const t=r+o;n.setAttribute("rowspan",t,e)}const l={};a>1&&(l.colspan=a),xg(n,r,i+1,o,1,l);const u=r.getAttribute("headingRows")||0;u>i&&Zm("headingRows",u+o,r,n)}})}getColumns(t){return[...t.getChild(0).getChildren()].reduce((t,e)=>{return t+parseInt(e.getAttribute("colspan")||1)},0)}}function xg(t,e,n,o,r,i={}){for(let s=0;s<o;s++){const o=t.createElement("tableRow");t.insert(o,e,n),Cg(r,t,Us.createAt(o,"end"),i)}}function Cg(t,e,n,o={}){for(let r=0;r<t;r++)Qm(e,n,o)}function Ag(t,e){if(t<e)return{newCellsSpan:1,updatedSpan:1};const n=Math.floor(t/e);return{newCellsSpan:n,updatedSpan:t-n*e+n}}class Pg extends Vu{refresh(){const t=this.editor.model,e=t.document.selection,n=t.schema,o=function(t){const e=t.parent;return e===e.root?e:e.parent}(e.getFirstPosition());this.isEnabled=n.checkChild(o,"table")}execute(t={}){const e=this.editor.model,n=e.document.selection,o=this.editor.plugins.get(yg),r=parseInt(t.rows)||2,i=parseInt(t.columns)||2,s=ru(n);e.change(t=>{const n=o.createTable(t,r,i);e.insertContent(n,s),t.setSelection(Us.createAt(n.getChild(0).getChild(0).getChild(0)))})}}class Tg extends Vu{constructor(t,e={}){super(t),this.order=e.order||"below"}refresh(){const t=Jm("table",this.editor.model.document.selection.getFirstPosition());this.isEnabled=!!t}execute(){const t=this.editor,e=t.model.document.selection,n=t.plugins.get(yg),o=Jm("tableCell",e.getFirstPosition()).parent,r=o.parent,i=r.getChildIndex(o),s="below"===this.order?i+1:i;n.insertRows(r,{rows:1,at:s})}}class Eg extends Vu{constructor(t,e={}){super(t),this.order=e.order||"after"}refresh(){const t=Jm("table",this.editor.model.document.selection.getFirstPosition());this.isEnabled=!!t}execute(){const t=this.editor,e=t.model.document.selection,n=t.plugins.get(yg),o=Jm("tableCell",e.getFirstPosition()),r=o.parent.parent,{column:i}=n.getCellLocation(o),s="after"===this.order?i+1:i;n.insertColumns(r,{columns:1,at:s})}}class Sg extends Vu{constructor(t,e={}){super(t),this.direction=e.direction||"horizontally"}refresh(){const t=Jm("tableCell",this.editor.model.document.selection.getFirstPosition());this.isEnabled=!!t}execute(){const t=Jm("tableCell",this.editor.model.document.selection.getFirstPosition()),e="horizontally"===this.direction,n=this.editor.plugins.get(yg);e?n.splitCellHorizontally(t,2):n.splitCellVertically(t,2)}}class Og extends Vu{constructor(t,e){super(t),this.direction=e.direction,this.isHorizontal="right"==this.direction||"left"==this.direction}refresh(){const t=this._getMergeableCell();this.isEnabled=!!t,this.value=t}execute(){const t=this.editor.model,e=Jm("tableCell",t.document.selection.getFirstPosition()),n=this.value,o=this.direction;t.change(t=>{const r="right"==o||"down"==o,i=r?e:n,s=r?n:e,a=s.parent;!function(t,e,n){Rg(t)||(Rg(e)&&n.remove($s.createIn(e)),n.move($s.createIn(t),Us.createAt(e,"end")));n.remove(t)}(s,i,t);const c=this.isHorizontal?"colspan":"rowspan",l=parseInt(e.getAttribute(c)||1),u=parseInt(n.getAttribute(c)||1);t.setAttribute(c,l+u,i),t.setSelection($s.createIn(i)),a.childCount||function(t,e){const n=t.parent,o=n.getChildIndex(t);for(const{cell:t,row:r,rowspan:i}of new eg(n,{endRow:o})){const n=r+i-1>=o;n&&Zm("rowspan",i-1,t,e)}e.remove(t)}(a,t)})}_getMergeableCell(){const t=Jm("tableCell",this.editor.model.document.selection.getFirstPosition());if(!t)return;const e=this.editor.plugins.get(yg),n=this.isHorizontal?function(t,e,n){const o="right"==e?t.nextSibling:t.previousSibling;if(!o)return;const r="right"==e?t:o,i="right"==e?o:t,{column:s}=n.getCellLocation(r),{column:a}=n.getCellLocation(i),c=parseInt(r.getAttribute("colspan")||1);return s+c===a?o:void 0}(t,this.direction,e):function(t,e){const n=t.parent,o=n.parent,r=o.getChildIndex(n);if("down"==e&&r===o.childCount-1||"up"==e&&0===r)return;const i=parseInt(t.getAttribute("rowspan")||1),s=o.getAttribute("headingRows")||0;if(s&&("down"==e&&r+i===s||"up"==e&&r===s))return;const a=parseInt(t.getAttribute("rowspan")||1),c="down"==e?r+a:r,l=[...new eg(o,{endRow:c})],u=l.find(e=>e.cell===t).column,d=l.find(({row:t,rowspan:n,column:o})=>o===u&&("down"==e?t===c:c===t+n));return d&&d.cell}(t,this.direction);if(!n)return;const o=this.isHorizontal?"rowspan":"colspan",r=parseInt(t.getAttribute(o)||1);return parseInt(n.getAttribute(o)||1)===r?n:void 0}}function Rg(t){return 1==t.childCount&&t.getChild(0).is("paragraph")&&t.getChild(0).isEmpty}class Ig extends Vu{refresh(){const t=Jm("tableCell",this.editor.model.document.selection.getFirstPosition());this.isEnabled=!!t&&t.parent.parent.childCount>1}execute(){const t=this.editor.model,e=Jm("tableCell",t.document.selection.getFirstPosition()).parent,n=e.parent,o=n.getChildIndex(e),r=n.getAttribute("headingRows")||0;t.change(t=>{r&&o<=r&&Zm("headingRows",r-1,n,t,0);const i=[...new eg(n,{endRow:o})],s=new Map;i.filter(({row:t,rowspan:e})=>t===o&&e>1).forEach(({column:t,cell:e,rowspan:n})=>s.set(t,{cell:e,rowspanToSet:n-1})),i.filter(({row:t,rowspan:e})=>t<=o-1&&t+e>o).forEach(({cell:e,rowspan:n})=>Zm("rowspan",n-1,e,t));const a=o+1,c=new eg(n,{includeSpanned:!0,startRow:a,endRow:a});let l;for(const{row:e,column:o,cell:r}of[...c])if(s.has(o)){const{cell:r,rowspanToSet:i}=s.get(o),a=l?Us.createAfter(l):Us.createAt(n.getChild(e));t.move($s.createOn(r),a),Zm("rowspan",i,r,t),l=r}else l=r;t.remove(e)})}}class Fg extends Vu{refresh(){const t=this.editor,e=t.model.document.selection,n=t.plugins.get(yg),o=Jm("tableCell",e.getFirstPosition());this.isEnabled=!!o&&n.getColumns(o.parent.parent)>1}execute(){const t=this.editor.model,e=Jm("tableCell",t.document.selection.getFirstPosition()),n=e.parent,o=n.parent,r=o.getAttribute("headingColumns")||0,i=o.getChildIndex(n),s=[...new eg(o)],a=s.find(t=>t.cell===e).column;t.change(t=>{r&&i<=r&&t.setAttribute("headingColumns",r-1,o);for(const{cell:e,column:n,colspan:o}of s)n<=a&&o>1&&n+o>a?Zm("colspan",o-1,e,t):n===a&&t.remove(e)})}}class Dg extends Vu{refresh(){const t=Jm("tableCell",this.editor.model.document.selection.getFirstPosition()),e=!!t;this.isEnabled=e,this.value=e&&this._isInHeading(t,t.parent.parent)}execute(){const t=this.editor.model,e=Jm("tableCell",t.document.selection.getFirstPosition()).parent,n=e.parent,o=n.getAttribute("headingRows")||0,r=e.index,i=o>r?r:r+1;t.change(t=>{if(i){const e=function(t,e,n){const o=[],r=new eg(t,{startRow:e>n?n:0,endRow:e-1});for(const{row:t,rowspan:n,cell:i}of r)n>1&&t+n>e&&o.push(i);return o}(n,i,o);for(const n of e)Ng(n,i,t)}Zm("headingRows",i,n,t,0)})}_isInHeading(t,e){const n=parseInt(e.getAttribute("headingRows")||0);return!!n&&t.parent.index<n}}function Ng(t,e,n){const o=t.parent,r=o.parent,i=e-o.index,s={},a=parseInt(t.getAttribute("rowspan"))-i;a>1&&(s.rowspan=a);const c=r.getChildIndex(o),l=c+i,u=[...new eg(r,{startRow:c,endRow:l,includeSpanned:!0})];let d;for(const{row:e,column:o,cell:i,colspan:a,cellIndex:c}of u)if(i===t&&(d=o,a>1&&(s.colspan=a)),void 0!==d&&d===o&&e===l){const t=r.getChild(e);Qm(n,Us.createFromParentAndOffset(t,c),s)}Zm("rowspan",i,t,n)}class Mg extends Vu{refresh(){const t=Jm("tableCell",this.editor.model.document.selection.getFirstPosition()),e=!!t;this.isEnabled=e,this.value=e&&this._isInHeading(t,t.parent.parent)}execute(){const t=this.editor.model,e=t.document.selection,n=this.editor.plugins.get("TableUtils"),o=Jm("tableCell",e.getFirstPosition().parent),r=o.parent.parent,i=parseInt(r.getAttribute("headingColumns")||0),{column:s}=n.getCellLocation(o),a=i>s?s:s+1;t.change(t=>{Zm("headingColumns",a,r,t,0)})}_isInHeading(t,e){const n=parseInt(e.getAttribute("headingColumns")||0),o=this.editor.plugins.get("TableUtils"),{column:r}=o.getCellLocation(t);return!!n&&r<n}}function Vg(t){t.document.registerPostFixer(e=>(function(t,e){const n=e.document.differ.getChanges();let o=!1;const r=new Set;for(const e of n){let n;"table"==e.name&&"insert"==e.type&&(n=e.position.nodeAfter),"tableRow"!=e.name&&"tableCell"!=e.name||(n=Jm("table",e.position)),zg(e)&&(n=Jm("table",e.range.start)),n&&!r.has(n)&&(o=Bg(n,t)||o,o=Lg(n,t)||o,r.add(n))}return o})(e,t))}function Bg(t,e){let n=!1;const o=function(t){const e=parseInt(t.getAttribute("headingRows")||0),n=t.childCount,o=[];for(const{row:r,rowspan:i,cell:s}of new eg(t)){if(i<2)continue;const t=r<e,a=t?e:n;if(r+i>a){const t=a-r;o.push({cell:s,rowspan:t})}}return o}(t);if(o.length){n=!0;for(const t of o)Zm("rowspan",t.rowspan,t.cell,e,1)}return n}function Lg(t,e){let n=!1;const o=function(t){const e={};for(const{row:n}of new eg(t,{includeSpanned:!0}))e[n]||(e[n]=0),e[n]+=1;return e}(t),r=o[0];if(!Object.values(o).every(t=>t===r)){const r=Object.values(o).reduce((t,e)=>e>t?e:t,0);for(const[i,s]of Object.entries(o)){const o=r-s;if(o){for(let n=0;n<o;n++)Qm(e,Us.createAt(t.getChild(i),"end"));n=!0}}}return n}function zg(t){const e="attribute"===t.type,n=t.attributeKey;return e&&("headingRows"===n||"colspan"===n||"rowspan"===n)}function qg(t){t.document.registerPostFixer(e=>(function(t,e){const n=e.document.differ.getChanges();let o=!1;for(const e of n)"remove"==e.type&&e.position.parent.is("tableCell")&&(o=Ug(e.position.parent,t)||o),"insert"==e.type&&("table"==e.name&&(o=jg(e.position.nodeAfter,t)||o),"tableRow"==e.name&&(o=Hg(e.position.nodeAfter,t)||o),"tableCell"==e.name&&(o=Ug(e.position.nodeAfter,t)||o));return o})(e,t))}function jg(t,e){let n=!1;for(const o of t.getChildren())n=Hg(o,e)||n;return n}function Hg(t,e){let n=!1;for(const o of t.getChildren())n=Ug(o,e)||n;return n}function Ug(t,e){return 0==t.childCount&&(e.insertElement("paragraph",t),!0)}function $g(t,e){e.view.document.registerPostFixer(n=>(function(t,e,n,o){let r=!1;const i=function(t){const e=Array.from(t._renderer.markedAttributes).filter(t=>!!t.parent).filter(Gg).filter(t=>Kg(t.parent)),n=Array.from(t._renderer.markedChildren).filter(t=>!!t.parent).filter(Kg).reduce((t,e)=>{const n=Array.from(e.getChildren()).filter(Gg);return[...t,...n]},[]);return[...e,...n]}(o);for(const e of i)r=Wg(e,n,t)||r;r&&function(t,e,n){const o=Array.from(t.getRanges()).map(t=>e.toViewRange(t));n.setSelection(o,{backward:t.isBackward})}(e.document.selection,n,t);return r})(n,t,e.mapper,e.view))}function Wg(t,e,n){const o=e.toModelElement(t),r=function(t,e){const n=t.childCount>1,o=!![...e.getAttributes()].length;return n||o?"p":"span"}(o.parent,o);if(t.name!==r){e.unbindViewElement(t);const i=n.rename(r,t);return e.bindElements(o,i),!0}return!1}function Gg(t){return t.is("p")||t.is("span")}function Kg(t){return t.is("td")||t.is("th")}n(124);class Jg extends Hl{init(){const t=this.editor,e=t.model,n=e.schema,o=t.conversion;n.register("table",{allowWhere:"$block",allowAttributes:["headingRows","headingColumns"],isLimit:!0,isObject:!0}),n.register("tableRow",{allowIn:"table",isLimit:!0}),n.register("tableCell",{allowIn:"tableRow",allowAttributes:["colspan","rowspan"],isLimit:!0}),n.extend("$block",{allowIn:"tableCell"}),n.addChildCheck((t,e)=>{if("table"==e.name&&Array.from(t.getNames()).includes("table"))return!1}),n.addChildCheck((t,e)=>{if(Array.from(t.getNames()).includes("table"))return"image"!=e.name&&"media"!=e.name&&void 0}),o.for("upcast").add(Ym()),o.for("editingDowncast").add(sg({asWidget:!0})),o.for("dataDowncast").add(sg()),o.for("upcast").add(Da({model:"tableRow",view:"tr"})),o.for("editingDowncast").add(ag({asWidget:!0})),o.for("dataDowncast").add(ag()),o.for("downcast").add(t=>t.on("remove:tableRow",(t,e,n)=>{t.stop();const o=n.mapper.toViewPosition(e.position).getLastMatchingPosition(t=>!t.item.is("tr")).nodeAfter,r=o.parent,i=Zo.createOn(o),s=n.writer.remove(i);for(const t of Zo.createIn(s).getItems())n.mapper.unbindViewElement(t);r.childCount||n.writer.remove(Zo.createOn(r))},{priority:"higher"})),o.for("upcast").add(Xm("td")),o.for("upcast").add(Xm("th")),o.for("editingDowncast").add(cg({asWidget:!0})),o.for("dataDowncast").add(cg()),o.attributeToAttribute({model:"colspan",view:"colspan"}),o.attributeToAttribute({model:"rowspan",view:"rowspan"}),o.for("editingDowncast").add(ug({asWidget:!0})),o.for("dataDowncast").add(ug()),o.for("editingDowncast").add(lg({asWidget:!0})),o.for("dataDowncast").add(lg()),$g(t.model,t.editing),t.commands.add("insertTable",new Pg(t)),t.commands.add("insertTableRowAbove",new Tg(t,{order:"above"})),t.commands.add("insertTableRowBelow",new Tg(t,{order:"below"})),t.commands.add("insertTableColumnBefore",new Eg(t,{order:"before"})),t.commands.add("insertTableColumnAfter",new Eg(t,{order:"after"})),t.commands.add("removeTableRow",new Ig(t)),t.commands.add("removeTableColumn",new Fg(t)),t.commands.add("splitTableCellVertically",new Sg(t,{direction:"vertically"})),t.commands.add("splitTableCellHorizontally",new Sg(t,{direction:"horizontally"})),t.commands.add("mergeTableCellRight",new Og(t,{direction:"right"})),t.commands.add("mergeTableCellLeft",new Og(t,{direction:"left"})),t.commands.add("mergeTableCellDown",new Og(t,{direction:"down"})),t.commands.add("mergeTableCellUp",new Og(t,{direction:"up"})),t.commands.add("setTableColumnHeader",new Mg(t)),t.commands.add("setTableRowHeader",new Dg(t)),Vg(e),qg(e),this.editor.keystrokes.set("Tab",(...t)=>this._handleTabOnSelectedTable(...t),{priority:"low"}),this.editor.keystrokes.set("Tab",this._getTabHandler(!0),{priority:"low"}),this.editor.keystrokes.set("Shift+Tab",this._getTabHandler(!1),{priority:"low"})}static get requires(){return[yg]}_handleTabOnSelectedTable(t,e){const n=this.editor,o=n.model.document.selection;if(!o.isCollapsed&&1===o.rangeCount&&o.getFirstRange().isFlat){const t=o.getSelectedElement();if(!t||!t.is("table"))return;e(),n.model.change(e=>{e.setSelection($s.createIn(t.getChild(0).getChild(0)))})}}_getTabHandler(t){const e=this.editor;return(n,o)=>{const r=Jm("tableCell",e.model.document.selection.getFirstPosition());if(!r)return;o();const i=r.parent,s=i.parent,a=s.getChildIndex(i),c=i.getChildIndex(r),l=0===c;if(!t&&l&&0===a)return;const u=c===i.childCount-1,d=a===s.childCount-1;let h;if(t&&d&&u&&e.plugins.get(yg).insertRows(s,{at:s.childCount}),t&&u){const t=s.getChild(a+1);h=t.getChild(0)}else if(!t&&l){const t=s.getChild(a-1);h=t.getChild(t.childCount-1)}else h=i.getChild(c+(t?1:-1));e.model.change(t=>{t.setSelection($s.createIn(h))})}}}n(126);class Zg extends Cl{constructor(t){super(t);const e=this.bindTemplate;this.items=this.createCollection(),this.set("rows",0),this.set("columns",0),this.bind("label").to(this,"columns",this,"rows",(t,e)=>`${e} x ${t}`),this.setTemplate({tag:"div",attributes:{class:["ck"]},children:[{tag:"div",attributes:{class:["ck-insert-table-dropdown__grid"]},children:this.items},{tag:"div",attributes:{class:["ck-insert-table-dropdown__label"]},children:[{text:e.to("label")}]}],on:{mousedown:e.to(t=>{t.preventDefault()}),click:e.to(()=>{this.fire("execute")})}});for(let t=0;t<100;t++){const e=new Qg;e.on("over",()=>{const e=Math.floor(t/10),n=t%10;this.set("rows",e+1),this.set("columns",n+1)}),this.items.add(e)}this.on("change:columns",()=>{this._highlightGridBoxes()}),this.on("change:rows",()=>{this._highlightGridBoxes()})}focus(){}focusLast(){}_highlightGridBoxes(){const t=this.rows,e=this.columns;this.items.map((n,o)=>{const r=Math.floor(o/10)<t&&o%10<e;n.set("isOn",r)})}}class Qg extends Cl{constructor(t){super(t);const e=this.bindTemplate;this.set("isOn",!1),this.setTemplate({tag:"div",attributes:{class:["ck-insert-table-dropdown-grid-box",e.if("isOn","ck-on")]},on:{mouseover:e.to("over")}})}}var Yg=n(55),Xg=n.n(Yg),tb=n(56),eb=n.n(tb),nb=n(57),ob=n.n(nb),rb=n(58),ib=n.n(rb);class sb extends Hl{init(){const t=this.editor,e=this.editor.t;t.ui.componentFactory.add("insertTable",n=>{const o=t.commands.get("insertTable"),r=Tf(n);r.bind("isEnabled").to(o),r.buttonView.set({icon:Xg.a,label:e("d"),tooltip:!0});const i=new Zg(n);return r.panelView.children.add(i),i.delegate("execute").to(r),r.buttonView.on("open",()=>{i.rows=0,i.columns=0}),r.on("execute",()=>{t.execute("insertTable",{rows:i.rows,columns:i.columns}),t.editing.view.focus()}),r}),t.ui.componentFactory.add("tableColumn",t=>{const n=[{type:"switchbutton",model:{commandName:"setTableColumnHeader",label:e("e"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:"insertTableColumnBefore",label:e("f")}},{type:"button",model:{commandName:"insertTableColumnAfter",label:e("g")}},{type:"button",model:{commandName:"removeTableColumn",label:e("h")}}];return this._prepareDropdown(e("i"),eb.a,n,t)}),t.ui.componentFactory.add("tableRow",t=>{const n=[{type:"switchbutton",model:{commandName:"setTableRowHeader",label:e("j"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:"insertTableRowBelow",label:e("k")}},{type:"button",model:{commandName:"insertTableRowAbove",label:e("l")}},{type:"button",model:{commandName:"removeTableRow",label:e("m")}}];return this._prepareDropdown(e("n"),ob.a,n,t)}),t.ui.componentFactory.add("mergeTableCells",t=>{const n=[{type:"button",model:{commandName:"mergeTableCellUp",label:e("o")}},{type:"button",model:{commandName:"mergeTableCellRight",label:e("p")}},{type:"button",model:{commandName:"mergeTableCellDown",label:e("q")}},{type:"button",model:{commandName:"mergeTableCellLeft",label:e("r")}},{type:"separator"},{type:"button",model:{commandName:"splitTableCellVertically",label:e("s")}},{type:"button",model:{commandName:"splitTableCellHorizontally",label:e("t")}}];return this._prepareDropdown(e("u"),ib.a,n,t)})}_prepareDropdown(t,e,n,o){const r=this.editor,i=Tf(o),s=[],a=new er;for(const t of n)ab(t,r,s,a);return Ef(i,a),i.buttonView.set({label:t,icon:e,tooltip:!0}),i.bind("isEnabled").toMany(s,"isEnabled",(...t)=>t.some(t=>t)),this.listenTo(i,"execute",t=>{r.execute(t.source.commandName),r.editing.view.focus()}),i}}function ab(t,e,n,o){const r=t.model=new gf(t.model),{commandName:i,bindIsOn:s}=t.model;if("separator"!==t.type){const t=e.commands.get(i);n.push(t),r.set({commandName:i}),r.bind("isEnabled").to(t),s&&r.bind("isOn").to(t,"value")}r.set({withText:!0}),o.add(t)}n(128);var cb=/highlight-(?:text|source)-([a-z0-9]+)/;function lb(t){t.addRule("highlightedCodeBlock",{filter:function(t){var e=t.firstChild;return"DIV"===t.nodeName&&cb.test(t.className)&&e&&"PRE"===e.nodeName},replacement:function(t,e,n){var o=((e.className||"").match(cb)||[null,""])[1];return"\n\n"+n.fence+o+"\n"+e.firstChild.textContent+"\n"+n.fence+"\n\n"}})}var ub=Array.prototype.indexOf,db=Array.prototype.every,hb={};function fb(t){var e=t.parentNode;return"THEAD"===e.nodeName||e.firstChild===t&&("TABLE"===e.nodeName||function(t){var e=t.previousSibling;return"TBODY"===t.nodeName&&(!e||"THEAD"===e.nodeName&&/^\s*$/i.test(e.textContent))}(e))&&db.call(t.childNodes,function(t){return"TH"===t.nodeName})}function pb(t,e){var n=" ";return 0===ub.call(e.parentNode.childNodes,e)&&(n="| "),n+t+" |"}function mb(t){t.addRule("taskListItems",{filter:function(t){return"checkbox"===t.type&&"LI"===t.parentNode.nodeName},replacement:function(t,e){return(e.checked?"[x]":"[ ]")+" "}})}function gb(t,e){return Array(e+1).join(t)}hb.tableCell={filter:["th","td"],replacement:function(t,e){return pb(t,e)}},hb.tableRow={filter:"tr",replacement:function(t,e){var n="",o={left:":--",right:"--:",center:":-:"};if(fb(e))for(var r=0;r<e.childNodes.length;r++){var i="---",s=(e.childNodes[r].getAttribute("align")||"").toLowerCase();s&&(i=o[s]||i),n+=pb(i,e.childNodes[r])}return"\n"+t+(n?"\n"+n:"")}},hb.table={filter:function(t){return"TABLE"===t.nodeName&&fb(t.rows[0])},replacement:function(t){return"\n\n"+(t=t.replace("\n\n","\n"))+"\n\n"}},hb.tableSection={filter:["thead","tbody","tfoot"],replacement:function(t){return t}};var bb=["address","article","aside","audio","blockquote","body","canvas","center","dd","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frameset","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","isindex","li","main","menu","nav","noframes","noscript","ol","output","p","pre","section","table","tbody","td","tfoot","th","thead","tr","ul"];function wb(t){return-1!==bb.indexOf(t.nodeName.toLowerCase())}var _b=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"];function kb(t){return-1!==_b.indexOf(t.nodeName.toLowerCase())}var vb=_b.join();var yb={};function xb(t){for(var e in this.options=t,this._keep=[],this._remove=[],this.blankRule={replacement:t.blankReplacement},this.keepReplacement=t.keepReplacement,this.defaultRule={replacement:t.defaultReplacement},this.array=[],t.rules)this.array.push(t.rules[e])}function Cb(t,e,n){for(var o=0;o<t.length;o++){var r=t[o];if(Ab(r,e,n))return r}}function Ab(t,e,n){var o=t.filter;if("string"==typeof o){if(o===e.nodeName.toLowerCase())return!0}else if(Array.isArray(o)){if(o.indexOf(e.nodeName.toLowerCase())>-1)return!0}else{if("function"!=typeof o)throw new TypeError("`filter` needs to be a string, array, or function");if(o.call(t,e,n))return!0}}function Pb(t){var e=t.nextSibling||t.parentNode;return t.parentNode.removeChild(t),e}function Tb(t,e,n){return t&&t.parentNode===e||n(e)?e.nextSibling||e.parentNode:e.firstChild||e.nextSibling||e.parentNode}yb.paragraph={filter:"p",replacement:function(t){return"\n\n"+t+"\n\n"}},yb.lineBreak={filter:"br",replacement:function(t,e,n){return n.br+"\n"}},yb.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(t,e,n){var o=Number(e.nodeName.charAt(1));return"setext"===n.headingStyle&&o<3?"\n\n"+t+"\n"+gb(1===o?"=":"-",t.length)+"\n\n":"\n\n"+gb("#",o)+" "+t+"\n\n"}},yb.blockquote={filter:"blockquote",replacement:function(t){return"\n\n"+(t=(t=t.replace(/^\n+|\n+$/g,"")).replace(/^/gm,"> "))+"\n\n"}},yb.list={filter:["ul","ol"],replacement:function(t,e){var n=e.parentNode;return"LI"===n.nodeName&&n.lastElementChild===e?"\n"+t:"\n\n"+t+"\n\n"}},yb.listItem={filter:"li",replacement:function(t,e,n){t=t.replace(/^\n+/,"").replace(/\n+$/,"\n").replace(/\n/gm,"\n ");var o=n.bulletListMarker+" ",r=e.parentNode;if("OL"===r.nodeName){var i=r.getAttribute("start"),s=Array.prototype.indexOf.call(r.children,e);o=(i?Number(i)+s:s+1)+". "}return o+t+(e.nextSibling&&!/\n$/.test(t)?"\n":"")}},yb.indentedCodeBlock={filter:function(t,e){return"indented"===e.codeBlockStyle&&"PRE"===t.nodeName&&t.firstChild&&"CODE"===t.firstChild.nodeName},replacement:function(t,e,n){return"\n\n "+e.firstChild.textContent.replace(/\n/g,"\n ")+"\n\n"}},yb.fencedCodeBlock={filter:function(t,e){return"fenced"===e.codeBlockStyle&&"PRE"===t.nodeName&&t.firstChild&&"CODE"===t.firstChild.nodeName},replacement:function(t,e,n){var o=((e.firstChild.className||"").match(/language-(\S+)/)||[null,""])[1];return"\n\n"+n.fence+o+"\n"+e.firstChild.textContent+"\n"+n.fence+"\n\n"}},yb.horizontalRule={filter:"hr",replacement:function(t,e,n){return"\n\n"+n.hr+"\n\n"}},yb.inlineLink={filter:function(t,e){return"inlined"===e.linkStyle&&"A"===t.nodeName&&t.getAttribute("href")},replacement:function(t,e){return"["+t+"]("+e.getAttribute("href")+(e.title?' "'+e.title+'"':"")+")"}},yb.referenceLink={filter:function(t,e){return"referenced"===e.linkStyle&&"A"===t.nodeName&&t.getAttribute("href")},replacement:function(t,e,n){var o,r,i=e.getAttribute("href"),s=e.title?' "'+e.title+'"':"";switch(n.linkReferenceStyle){case"collapsed":o="["+t+"][]",r="["+t+"]: "+i+s;break;case"shortcut":o="["+t+"]",r="["+t+"]: "+i+s;break;default:var a=this.references.length+1;o="["+t+"]["+a+"]",r="["+a+"]: "+i+s}return this.references.push(r),o},references:[],append:function(t){var e="";return this.references.length&&(e="\n\n"+this.references.join("\n")+"\n\n",this.references=[]),e}},yb.emphasis={filter:["em","i"],replacement:function(t,e,n){return t.trim()?n.emDelimiter+t+n.emDelimiter:""}},yb.strong={filter:["strong","b"],replacement:function(t,e,n){return t.trim()?n.strongDelimiter+t+n.strongDelimiter:""}},yb.code={filter:function(t){var e=t.previousSibling||t.nextSibling,n="PRE"===t.parentNode.nodeName&&!e;return"CODE"===t.nodeName&&!n},replacement:function(t){if(!t.trim())return"";var e="`",n="",o="",r=t.match(/`+/gm);if(r)for(/^`/.test(t)&&(n=" "),/`$/.test(t)&&(o=" ");-1!==r.indexOf(e);)e+="`";return e+n+t+o+e}},yb.image={filter:"img",replacement:function(t,e){var n=e.alt||"",o=e.getAttribute("src")||"",r=e.title||"";return o?"!["+n+"]("+o+(r?' "'+r+'"':"")+")":""}},xb.prototype={add:function(t,e){this.array.unshift(e)},keep:function(t){this._keep.unshift({filter:t,replacement:this.keepReplacement})},remove:function(t){this._remove.unshift({filter:t,replacement:function(){return""}})},forNode:function(t){return t.isBlank?this.blankRule:(e=Cb(this.array,t,this.options))?e:(e=Cb(this._keep,t,this.options))?e:(e=Cb(this._remove,t,this.options))?e:this.defaultRule;var e},forEach:function(t){for(var e=0;e<this.array.length;e++)t(this.array[e],e)}};var Eb="undefined"!=typeof window?window:{};var Sb,Ob=function(){var t=Eb.DOMParser,e=!1;try{(new t).parseFromString("","text/html")&&(e=!0)}catch(t){}return e}()?Eb.DOMParser:function(){var t=function(){},e=n(130).JSDOM;return t.prototype.parseFromString=function(t){return new e(t).window.document},t}();function Rb(t){var e;"string"==typeof t?e=(Sb=Sb||new Ob).parseFromString('<x-turndown id="turndown-root">'+t+"</x-turndown>","text/html").getElementById("turndown-root"):e=t.cloneNode(!0);return function(t){var e=t.element,n=t.isBlock,o=t.isVoid,r=t.isPre||function(t){return"PRE"===t.nodeName};if(e.firstChild&&!r(e)){for(var i=null,s=!1,a=null,c=Tb(a,e,r);c!==e;){if(3===c.nodeType||4===c.nodeType){var l=c.data.replace(/[ \r\n\t]+/g," ");if(i&&!/ $/.test(i.data)||s||" "!==l[0]||(l=l.substr(1)),!l){c=Pb(c);continue}c.data=l,i=c}else{if(1!==c.nodeType){c=Pb(c);continue}n(c)||"BR"===c.nodeName?(i&&(i.data=i.data.replace(/ $/,"")),i=null,s=!1):o(c)&&(i=null,s=!0)}var u=Tb(a,c,r);a=c,c=u}i&&(i.data=i.data.replace(/ $/,""),i.data||Pb(i))}}({element:e,isBlock:wb,isVoid:kb}),e}function Ib(t){return t.isBlock=wb(t),t.isCode="code"===t.nodeName.toLowerCase()||t.parentNode.isCode,t.isBlank=function(t){return-1===["A","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"].indexOf(t.nodeName)&&/^\s*$/i.test(t.textContent)&&!kb(t)&&!function(t){return t.querySelector&&t.querySelector(vb)}(t)}(t),t.flankingWhitespace=function(t){var e="",n="";if(!t.isBlock){var o=/^[ \r\n\t]/.test(t.textContent),r=/[ \r\n\t]$/.test(t.textContent);o&&!Fb("left",t)&&(e=" "),r&&!Fb("right",t)&&(n=" ")}return{leading:e,trailing:n}}(t),t}function Fb(t,e){var n,o,r;return"left"===t?(n=e.previousSibling,o=/ $/):(n=e.nextSibling,o=/^ /),n&&(3===n.nodeType?r=o.test(n.nodeValue):1!==n.nodeType||wb(n)||(r=o.test(n.textContent))),r}var Db=Array.prototype.reduce,Nb=/^\n*/,Mb=/\n*$/,Vb=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function Bb(t){if(!(this instanceof Bb))return new Bb(t);var e={rules:yb,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",blankReplacement:function(t,e){return e.isBlock?"\n\n":""},keepReplacement:function(t,e){return e.isBlock?"\n\n"+e.outerHTML+"\n\n":e.outerHTML},defaultReplacement:function(t,e){return e.isBlock?"\n\n"+t+"\n\n":t}};this.options=function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)n.hasOwnProperty(o)&&(t[o]=n[o])}return t}({},e,t),this.rules=new xb(this.options)}function Lb(t){var e=this;return Db.call(t.childNodes,function(t,n){var o="";return 3===(n=new Ib(n)).nodeType?o=n.isCode?n.nodeValue:e.escape(n.nodeValue):1===n.nodeType&&(o=function(t){var e=this.rules.forNode(t),n=Lb.call(this,t),o=t.flankingWhitespace;(o.leading||o.trailing)&&(n=n.trim());return o.leading+e.replacement(n,t,this.options)+o.trailing}.call(e,n)),zb(t,o)},"")}function zb(t,e){var n=function(t,e){var n=[t.match(Mb)[0],e.match(Nb)[0]].sort(),o=n[n.length-1];return o.length<2?o:"\n\n"}(t,e);return(t=t.replace(Mb,""))+n+(e=e.replace(Nb,""))}Bb.prototype={turndown:function(t){if(!function(t){return null!=t&&("string"==typeof t||t.nodeType&&(1===t.nodeType||9===t.nodeType||11===t.nodeType))}(t))throw new TypeError(t+" is not a string, or an element/document/fragment node.");if(""===t)return"";var e=Lb.call(this,new Rb(t));return function(t){var e=this;return this.rules.forEach(function(n){"function"==typeof n.append&&(t=zb(t,n.append(e.options)))}),t.replace(/^[\t\r\n]+/,"").replace(/[\t\r\n\s]+$/,"")}.call(this,e)},use:function(t){if(Array.isArray(t))for(var e=0;e<t.length;e++)this.use(t[e]);else{if("function"!=typeof t)throw new TypeError("plugin must be a Function or an Array of Functions");t(this)}return this},addRule:function(t,e){return this.rules.add(t,e),this},keep:function(t){return this.rules.keep(t),this},remove:function(t){return this.rules.remove(t),this},escape:function(t){return Vb.reduce(function(t,e){return t.replace(e[0],e[1])},t)}};var qb=Bb;function jb(t,e){let n=t.parentElement;for(;n;){if(console.log(n.tagName),e.indexOf(n.tagName)>=0)return!0;n=n.parentElement}return!1}const Hb="data-original-src";class Ub{constructor(){this._htmlDP=new Jc,this._domConverter=new ni}toView(t){const e=n(131)({html:!0,langPrefix:"language-"}).render(t),o=this._htmlDP._toDom(e);return function(t){let e,n=document.createNodeIterator(t,NodeFilter.SHOW_ELEMENT,{acceptNode:function(t){if("P"===t.tagName&&t.parentElement&&"LI"===t.parentElement.tagName)return NodeFilter.FILTER_ACCEPT}},!1);for(;e=n.nextNode();)e.outerHTML=e.innerHTML}(o),this._domConverter.domToView(o)}toData(t){const e=this._domConverter.viewToDom(t,document);!function(t,e,n){e=e.map(t=>t.toUpperCase()),n=n.map(t=>t.toUpperCase());let o,r=document.createNodeIterator(t,NodeFilter.SHOW_TEXT);for(;o=r.nextNode();)o.parentElement&&e.indexOf(o.parentElement.nodeName)>=0&&(o.nodeValue=o.nodeValue.replace(/^[\u00a0]+/g," ").replace(/[\u00a0]+$/g," ")),jb(o,n)||(o.nodeValue=_.escape(o.nodeValue))}(e,["strong","em"],["pre","code"]);const n=new qb({headingStyle:"atx",codeBlockStyle:"fenced"});return n.use([lb,mb]),n.addRule("img",{filter:"img",replacement:function(t,e){var n=e.alt||"",o=e.getAttribute(Hb)||e.getAttribute("src")||"",r=e.title||"";return o?"!["+n+"]("+o+(r?' "'+r+'"':"")+")":""}}),n.addRule("htmlTables",{filter:["table"],replacement:function(t,e){return e.querySelectorAll("td br[data-cke-filler]").forEach(t=>t.remove()),e.outerHTML}}),n.addRule("strikethrough",{filter:["del","s","strike"],replacement:function(t){return"~~"+t+"~~"}}),n.addRule("openProjectMacros",{filter:["macro"],replacement:(t,e)=>{return e.innerHTML="",e.outerHTML.replace("</macro>","\n</macro>")}}),n.turndown(e)}}var $b=n(21),Wb=n.n($b),Gb=n(59),Kb=n.n(Gb);const Jb=[su,class extends Hl{static get requires(){return[lu,hu,Eu]}static get pluginName(){return"OPMacroEmbeddedTable"}static get buttonName(){return lu.buttonName}},class extends Hl{static get requires(){return[Ru,hu,Iu]}static get pluginName(){return"OPMacroWpButton"}static get buttonName(){return Ru.buttonName}},class extends Hl{static get requires(){return[Nu,hu,Mu]}static get pluginName(){return"OPWikiIncludePage"}static get buttonName(){return Nu.buttonName}},class extends Hl{static get requires(){return[kd,hu,vd]}static get pluginName(){return"OPChildPages"}static get buttonName(){return kd.buttonName}}],Zb=[class extends Hl{static get requires(){return[Ku,bd]}static get pluginName(){return"OpUploadPlugin"}init(){this.editor.plugins.get("FileRepository").createUploadAdapter=(t=>{const e=Uu(this.editor);return new Zu(t,e,this.editor)})}},class extends Hl{static get pluginName(){return"OPAttachmentListener"}init(){this.editor.model.on("op:attachment-removed",(t,e)=>{this.removeDeletedImage(e)})}removeDeletedImage(t){let e=this.editor.model.document.getRoot();for(const n of Array.from(e.getChildren()))if("image"===n.name&&t.indexOf(n.getAttribute("src"))>-1){const t=new Qs(n,"on");this.editor.model.deleteContent(t)}}}],Qb=[class extends Hl{static get requires(){return[Ad,Td,Rd,Kd,bh]}static get pluginName(){return"Essentials"}},class extends Hl{static get requires(){return[Ku]}static get pluginName(){return"CKFinderUploadAdapter"}init(){const t=this.editor.config.get("ckfinder.uploadUrl");t&&(this.editor.plugins.get(Ku).createUploadAdapter=(e=>new yh(e,t,this.editor.t)))}},class extends Hl{static get pluginName(){return"Autoformat"}afterInit(){this._addListAutoformats(),this._addBasicStylesAutoformats(),this._addHeadingAutoformats(),this._addBlockQuoteAutoformats()}_addListAutoformats(){const t=this.editor.commands;t.get("bulletedList")&&new xh(this.editor,/^[*-]\s$/,"bulletedList"),t.get("numberedList")&&new xh(this.editor,/^\d+[.|)]\s$/,"numberedList")}_addBasicStylesAutoformats(){const t=this.editor.commands;t.get("bold")&&(new Ch(this.editor,/(\*\*)([^*]+)(\*\*)$/g,"bold"),new Ch(this.editor,/(__)([^_]+)(__)$/g,"bold")),t.get("italic")&&(new Ch(this.editor,/(?:^|[^*])(\*)([^*_]+)(\*)$/g,"italic"),new Ch(this.editor,/(?:^|[^_])(_)([^_]+)(_)$/g,"italic")),t.get("code")&&new Ch(this.editor,/(`)([^`]+)(`)$/g,"code")}_addHeadingAutoformats(){const t=this.editor.commands.get("heading");t&&t.modelElements.filter(t=>t.match(/^heading[1-6]$/)).forEach(t=>{const e=t[7],n=new RegExp(`^(#{${e}})\\s$`);new xh(this.editor,n,()=>{this.editor.execute("heading",{value:t})})})}_addBlockQuoteAutoformats(){this.editor.commands.get("blockQuote")&&new xh(this.editor,/^>\s$/,"blockQuote")}},class extends Hl{static get requires(){return[Eh,Ih]}static get pluginName(){return"Bold"}},class extends Hl{static get requires(){return[Dh,Bh]}static get pluginName(){return"Code"}},class extends Hl{static get requires(){return[Wh,Zh]}static get pluginName(){return"Italic"}},class extends Hl{static get requires(){return[zh,Uh]}static get pluginName(){return"Strikethrough"}},class extends Hl{static get requires(){return[nf,sf]}static get pluginName(){return"BlockQuote"}},class extends Hl{static get requires(){return[mf,Sf]}static get pluginName(){return"Heading"}},class extends Hl{static get requires(){return[Nf,hu,Qf]}static get pluginName(){return"Image"}},class extends Hl{static get requires(){return[rp]}static get pluginName(){return"ImageCaption"}},class extends Hl{static get requires(){return[xp,Cp]}static get pluginName(){return"ImageStyle"}},class extends Hl{static get requires(){return[Ap]}static get pluginName(){return"ImageToolbar"}afterInit(){const t=this.editor;t.plugins.get(Ap).register("image",{items:t.config.get("image.toolbar")||[],visibleWhen:Ff})}},class extends Hl{static get pluginName(){return"OpImageAttachmentLookup"}init(){const t=this.editor,e=t.conversion,n=Uu(t);e.for("editingDowncast").add(function(t){return t=>{t.on("attribute:src:image",e,{priority:"highest"})};function e(e,n,o){let r=n.attributeNewValue;if(!r||!t.lookupDownloadLocationByName)return;const i=t.lookupDownloadLocationByName(r);n.attributeNewValue=i||r}}(n)),e.for("dataDowncast").add(function(t){return t=>{t.on("attribute:src:image",e,{priority:"highest"})};function e(e,n,o){let r=n.attributeNewValue;if(!r||!t.lookupDownloadLocationByName)return;const i=t.lookupDownloadLocationByName(r);n.attributeNewValue=i||r;const s=o.writer,a=o.mapper.toViewElement(n.item).getChild(0);i&&s.setAttribute(Hb,r,a)}}(n))}},class extends Hl{static get requires(){return[Hp,tm]}static get pluginName(){return"Link"}},class extends Hl{static get requires(){return[Cm,Om]}static get pluginName(){return"List"}},lf,Kd,class extends Hl{static get pluginName(){return"OPHelpLinkPlugin"}init(){const t=this.editor,e=(t.model,t.config.get("openProject.helpURL"));t.ui.componentFactory.add("openProjectShowFormattingHelp",t=>{const n=new jl(t);return n.set({label:window.I18n.t("js.inplace.link_formatting_help"),icon:Im.a,tooltip:!0}),n.on("execute",()=>{window.open(e,"_blank")}),n})}},class extends Hl{static get pluginName(){return"CodeBlock"}static get requires(){return[jm,Hm]}},class extends Hl{static get pluginName(){return"OPPreview"}init(){const t=this.editor;let e=!1,n=null;t.ui.componentFactory.add("preview",o=>{const r=new jl(o);r.set({label:this.label,icon:$m.a,tooltip:!0});let i=function(e){let o,i=jQuery(t.element),s=i.find(".ck-editor__main");o=s.length?s:i;let a=jQuery('<div class="ck-editor__preview"></div>');o.siblings(".ck-editor__preview").remove();const c=Hu(t,"ckEditorPreview");n=c.render(a[0],e),o.hide(),o.after(a),Gm(t,r)};return r.on("execute",()=>{e?(e=!1,function(){let e=jQuery(t.element).find(".ck-editor__main");n(),e.siblings(".ck-editor__preview").remove(),e.show(),Km(t)}()):(e=!0,function(){let e=function(t){return t.config.get("openProject.context.previewContext")}(t),n=$u(t).api.v3.previewMarkup(e);jQuery.ajax({data:t.getData(),url:n,response_type:"text",contentType:"text/plain; charset=UTF-8",method:"POST"}).done(i)}())}),r})}get label(){return window.I18n.t("js.editor.preview")}},class extends Hl{static get pluginName(){return"OPSourceCode"}init(){const t=this.editor;let e=!1,n={source:window.I18n.t("js.editor.mode.manual"),wysiwyg:window.I18n.t("js.editor.mode.wysiwyg")};t.ui.componentFactory.add("opShowSource",o=>{const r=new jl(o);return r.set({label:n.source,class:"",icon:Wb.a,tooltip:!0}),r.on("execute",()=>{e?(e=!1,function(){let e=jQuery(t.element).find(".ck-editor__main");t.fire("op:source-code-disabled"),e.siblings(".ck-editor__source").remove(),e.show(),Km(t),r.set({label:n.source,class:"",icon:Wb.a,tooltip:!0})}()):(e=!0,function(e){let o,i=jQuery(t.element),s=i.find(".ck-editor__main");o=s.length?s:i;let a=jQuery('<div class="ck-editor__source"></div>');o.siblings(".ck-editor__source").remove(),o.hide(),o.after(a),Gm(t,r),t.fire("op:source-code-enabled"),r.set({label:n.wysiwyg,class:"-source-enabled",icon:Kb.a,tooltip:!0})}())}),r})}},function(t){t.data.processor=new Ub},class extends Hl{static get requires(){return[Jg,sb,hu]}static get pluginName(){return"Table"}},class extends Hl{static get requires(){return[Ap]}static get pluginName(){return"TableToolbar"}afterInit(){const t=this.editor,e=t.plugins.get(Ap),n=t.config.get("table.contentToolbar"),o=t.config.get("table.toolbar"),r=t.config.get("table.tableToolbar");o&&console.warn("`config.table.toolbar` is deprecated and will be removed in the next major release. Use `config.table.contentToolbar` instead."),(n||o)&&e.register("tableContent",{items:n||o,visibleWhen:ig}),r&&e.register("table",{items:r,visibleWhen:rg})}},class extends Hl{init(){const t=this.editor,e=(t.config.get("removePlugins")||[]).map(t=>t.pluginName),n=window.I18n.t("js.editor.macro.dropdown.chose_macro");!0!==t.config.get("openProject.disableAllMacros")&&t.ui.componentFactory.add("macroList",o=>{const r=[];for(const n of Jb){if(-1!==e.indexOf(n.pluginName))continue;const o=t.ui.componentFactory.create(n.buttonName);r.push(o)}const i=Tf(o);return function(t,e){const n=t.toolbarView=new Ml;t.extendTemplate({attributes:{class:["ck-toolbar-dropdown"]}}),e.map(t=>n.items.add(t)),t.panelView.children.add(n),n.items.delegate("execute").to(t)}(i,r),i.buttonView.set({isOn:!1,withText:!0,tooltip:n,label:window.I18n.t("js.editor.macro.dropdown.macros")}),i.toolbarView.isVertical=!0,i.toolbarView.className="op-macro-list-button",i})}}].concat(Jb,[class extends Hl{static get pluginName(){return"atjs"}static get requires(){return[qu]}init(){const t=this.editor;t.commands.get("enter").destroy(),t.commands.add("enter",new qu(t))}},class extends Hl{static get pluginName(){return"OPLinkingWp"}init(){ju(this.editor,{ignorePrefix:/user\#/,remoteUrl:function(t,e){let n=window.OpenProject.urlRoot+"/work_packages/auto_complete.json";jQuery.getJSON(n,{q:t,scope:"all"},e)},remoteDataPreparation:function(t){for(let e=t.length-1;e>=0;e--)t[e].id_subject=t[e].id.toString()+" "+t[e].subject;return t}})}},class extends Hl{static get pluginName(){return"OPMentioning"}init(){const t=this.editor;ju(t,{searchKey:"id_principal",displayTpl:'<li data-value="#{_type}#${id}">${name}</li>',insertTpl:"${typePrefix}#${id}",startWithSpace:!0,suffix:"",acceptSpaceBar:!0,highlightFirst:!0,at:"@",remoteDataPreparation:function(e){const n=e._embedded.elements,o=Hu(t,"htmlSanitizeService");for(let t=n.length-1;t>=0;t--)n[t].id_principal=o.sanitize(n[t].id.toString()+" "+n[t].name),n[t].typePrefix=n[t]._type.toLowerCase();return n},isSupportedContext:function(){let e=Uu(t);return e&&"WorkPackage"===e._type},remoteUrl:function(e,n){const o=Uu(t).project.idFromLink,r=$u(t).api.v3.principals(o,e);jQuery.getJSON(r,n)}})}}],Zb);function Yb(t){return(e,n)=>{const o=n.openProject.context;n.removePlugins=n.removePlugins||[];const r=o.resource;if(r&&r.canAddAttachments||n.removePlugins.push(...Zb.map(t=>t.pluginName)),!1===o.macros&&(n.openProject.disableAllMacros=!0,n.removePlugins.push(...Jb.map(t=>t.pluginName))),Array.isArray(o.macros)){const t=Jb.filter(t=>-1===o.macros.indexOf(t.pluginName));n.removePlugins.push(...t)}return t.create(e,n)}}const Xb={heading:{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h1",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h2",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h3",title:"Heading 3",class:"ck-heading_heading3"},{model:"heading4",view:"h4",title:"Heading 4",class:"ck-heading_heading4"},{model:"heading5",view:"h5",title:"Heading 5",class:"ck-heading_heading5"}]},toolbar:{},OPMacroEmbeddedTable:{toolbar:["opEditEmbeddedTableQuery"]},OPMacroWpButton:{toolbar:["opEditWpMacroButton"]},OPWikiIncludePage:{toolbar:["opEditWikiIncludeMacroButton"]},OPCodeBlock:{toolbar:["opEditCodeBlock"]},OPChildPages:{toolbar:["opEditChildPagesMacroButton"]},image:{toolbar:["imageStyle:full","|","imageTextAlternative"]},table:{toolbar:["tableColumn","tableRow"]},language:"en"};n.d(e,"ConstrainedEditor",function(){return tw}),n.d(e,"FullEditor",function(){return ew});class tw extends Ll{}class ew extends Ll{}window.OPConstrainedEditor=tw,window.OPClassicEditor=ew,ew.createCustomized=Yb(ew),ew.builtinPlugins=Qb,ew.defaultConfig=Object.assign({},Xb),ew.defaultConfig.toolbar={items:["heading","|","bold","italic","strikethrough","code","insertCodeBlock","link","bulletedList","numberedList","imageUpload","blockQuote","|","insertTable","macroList","|","undo","redo","openProjectShowFormattingHelp","|","preview","opShowSource"]},tw.createCustomized=Yb(tw),tw.builtinPlugins=Qb,tw.defaultConfig=Object.assign({},Xb),tw.defaultConfig.toolbar={items:["bold","italic","strikethrough","code","insertCodeBlock","link","bulletedList","numberedList","imageUpload","blockQuote","|","openProjectShowFormattingHelp","preview","opShowSource"]}}]).default});
|