this.wp=this.wp||{},this.wp.richText=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=309)}({15:function(t,e,r){"use strict";function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}r.d(e,"a",function(){return n})},19:function(t,e,r){"use strict";var n=r(32);function o(t){return function(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;switch(e.type){case"ADD_FORMAT_TYPES":return Object(a.a)({},t,Object(u.keyBy)(e.formatTypes,"name"));case"REMOVE_FORMAT_TYPES":return Object(u.omit)(t,e.names)}return t}}),f=r(34),s=Object(f.a)(function(t){return Object.values(t.formatTypes)},function(t){return[t.formatTypes]});function l(t,e){return t.formatTypes[e]}function d(t){return{type:"ADD_FORMAT_TYPES",formatTypes:Object(u.castArray)(t)}}function p(t){return{type:"REMOVE_FORMAT_TYPES",names:Object(u.castArray)(t)}}function m(t,e){if(t===e)return!0;if(!t||!e)return!1;if(t.type!==e.type)return!1;var r=t.attributes,n=e.attributes;if(r===n)return!0;if(!r||!n)return!1;var o=Object.keys(r),i=Object.keys(n);if(o.length!==i.length)return!1;for(var a=o.length,u=0;u2&&void 0!==arguments[2]?arguments[2]:o,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:i,f=r.slice(0);if(a===c){var s=Object(u.find)(f[a],{type:e.type});if(!s){var l=f[a-1]||[];return{formats:r,text:n,start:o,end:i,formatPlaceholder:{index:a,format:Object(u.find)(l,{type:e.type})?void 0:e}}}for(;Object(u.find)(f[a],s);)h(f,a,e),a--;for(c++;Object(u.find)(f[c],s);)h(f,c,e),c++}else for(var d=a;d0&&void 0!==arguments[0]?arguments[0]:{},e=t.element,r=t.text,n=t.html,o=t.range,i=t.multilineTag,a=t.multilineWrapperTags,u=t.removeNode,c=t.unwrapNode,f=t.filterString,s=t.removeAttribute;return"string"==typeof r&&r.length>0?{formats:Array(r.length),text:r}:("string"==typeof n&&n.length>0&&(e=function(t,e){var r=t.implementation.createHTMLDocument("").body;return r.innerHTML=e,r}(document,n)),"object"!==Object(T.a)(e)?{formats:[],text:""}:i?R({element:e,range:o,multilineTag:i,multilineWrapperTags:a,removeNode:u,unwrapNode:c,filterString:f,removeAttribute:s}):_({element:e,range:o,removeNode:u,unwrapNode:c,filterString:f,removeAttribute:s}))}function L(t,e,r,n){if(r){var o=e.parentNode,i=r.startContainer,a=r.startOffset,u=r.endContainer,c=r.endOffset,f=t.text.length;void 0!==n.start?t.start=f+n.start:e===i&&e.nodeType===C?t.start=f+a:o===i&&e===i.childNodes[a]?t.start=f:o===i&&e===i.childNodes[a-1]?t.start=f+n.text.length:e===i&&(t.start=f),void 0!==n.end?t.end=f+n.end:e===u&&e.nodeType===C?t.end=f+c:o===u&&e===u.childNodes[c-1]?t.end=f+n.text.length:o===u&&e===u.childNodes[c]?t.end=f:e===u&&(t.end=f+c)}}function M(t,e,r){if(e){var n=e.startContainer,o=e.endContainer,i=e.startOffset,a=e.endOffset;return t===n&&(i=r(t.nodeValue.slice(0,i)).length),t===o&&(a=r(t.nodeValue.slice(0,a)).length),{startContainer:n,startOffset:i,endContainer:o,endOffset:a}}}function _(t){var e=t.element,r=t.range,n=t.multilineTag,o=t.multilineWrapperTags,i=t.currentWrapperTags,a=void 0===i?[]:i,u=t.removeNode,c=t.unwrapNode,f=t.filterString,s=t.removeAttribute,l={formats:[],text:""};if(!e)return l;if(!e.hasChildNodes())return L(l,e,r,{formats:[],text:""}),l;for(var d=e.childNodes.length,p=function(t){return t=t.replace(/[\r\n]/g,""),f&&(t=f(t)),t},v=0;v0){var y=s.length>0?[s]:[,];l.formats=l.formats.concat(y),l.text+=O}L(l,m,r,v),l.formats=l.formats.concat(v.formats),l.text+=v.text}}return l}function V(t){var e=t.element,r=t.removeAttribute;if(e.hasAttributes()){for(var n,o=e.attributes.length,i=0;i1&&void 0!==arguments[1]?arguments[1]:"";return"string"==typeof e&&(e=W({text:e})),v(t.reduce(function(t,r){var n=r.formats,o=r.text;return{text:t.text+e.text+o,formats:t.formats.concat(e.formats,n)}}))}function U(t,e){if("string"==typeof(e=Object(a.a)({name:t},e)).name)if(/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(e.name))if(Object(i.select)("core/rich-text").getFormatType(e.name))window.console.error('Format "'+e.name+'" is already registered.');else if(e&&Object(u.isFunction)(e.edit))if("title"in e&&""!==e.title)if("keywords"in e&&e.keywords.length>3)window.console.error('The format "'+e.name+'" can have a maximum of 3 keywords.');else{if("string"==typeof e.title)return Object(i.dispatch)("core/rich-text").addFormatTypes(e),e;window.console.error("Format titles must be strings.")}else window.console.error('The format "'+e.name+'" must have a title.');else window.console.error('The "edit" property must be specified and must be a valid function.');else window.console.error("Format names must contain a namespace prefix, include only lowercase alphanumeric characters or dashes, and start with a letter. Example: my-plugin/my-custom-format");else window.console.error("Format names must be strings.")}function X(t,e){var r=t.formats,n=t.text,o=t.start,i=t.end,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:i,f=r.slice(0);if(a===c){for(var s=Object(u.find)(f[a],{type:e});Object(u.find)(f[a],s);)$(f,a,e),a--;for(c++;Object(u.find)(f[c],s);)$(f,c,e),c++}else for(var l=a;l2&&void 0!==arguments[2]?arguments[2]:o,u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:i;"string"==typeof e&&(e=W({text:e}));var c=a+e.text.length;return v({formats:r.slice(0,a).concat(e.formats,r.slice(u)),text:n.slice(0,a)+e.text+n.slice(u),start:c,end:c})}function J(t,e,r){return G(t,W(),e,r)}function K(t,e,r){var n=t.formats,o=t.text,i=t.start,a=t.end;return o=o.replace(e,function(t){for(var e=arguments.length,o=new Array(e>1?e-1:0),u=1;u1&&void 0!==arguments[1]?arguments[1]:t.start,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.end,n=z(t).slice(0,e).lastIndexOf(O),o=[,];return-1!==n&&(o=[t.formats[n]]),G(t,{formats:o,text:O},e,r)}var Z="";function tt(t,e,r,n){return G(t,{text:Z,formats:[[Object(a.a)({},e,{object:!0})]]},r,n)}function et(t){var e=t.formats,r=t.text,n=t.start,o=t.end,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o;return void 0===i||void 0===a?{formats:e,text:r}:{formats:e.slice(i,a),text:r.slice(i,a)}}function rt(t,e){var r=t.formats,n=t.text,o=t.start,i=t.end;if("string"!=typeof e)return function(t){var e=t.formats,r=t.text,n=t.start,o=t.end,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,u={formats:e.slice(0,i),text:r.slice(0,i)},c={formats:e.slice(a),text:r.slice(a),start:0,end:0};return[K(u,/\u2028+$/,""),K(c,/^\u2028+/,"")]}.apply(void 0,arguments);var a=0;return n.split(e).map(function(t){var n=a,u={formats:r.slice(n,n+t.length),text:t};return a+=e.length+t.length,void 0!==o&&void 0!==i&&(o>=n&&on&&(u.start=0),i>=n&&ia&&(u.end=t.length)),u})}function nt(t){var e=t.type,r=t.attributes,n=t.object,o=H(e);if(!o)return{type:e,attributes:r,object:n};if(!r)return{type:o.match.tagName,object:o.object};var i={};for(var a in r){var u=o.attributes[a];u?i[u]=r[a]:i[a]=r[a]}return{type:o.match.tagName,object:o.object,attributes:i}}function ot(t){var e,r,n,o=t.value,i=t.multilineTag,a=t.multilineWrapperTags,u=t.createEmpty,c=t.append,f=t.getLastChild,s=t.getParent,l=t.isText,d=t.getText,p=t.remove,m=t.appendText,v=t.onStartIndex,g=t.onEndIndex,h=t.isEditableTree,y=o.formats,b=o.text,T=o.start,N=o.end,S=o.formatPlaceholder,E=y.length+1,A=u(),C={type:i};function P(t,e){if(h&&S&&S.index===e){var r=s(t);t=void 0===S.format?s(r):c(r,nt(S.format)),t=c(t,w)}return t}i?(c(c(A,{type:i}),""),r=e=[C]):c(A,"");for(var F=function(t){var o=b.charAt(t),u=y[t];i&&(u=o===O?e=(u||[]).reduce(function(t,e){return o===O&&-1!==a.indexOf(e.type)&&(t.push(e),t.push(C)),t},[C]):Object(x.a)(e).concat(Object(x.a)(u||[])));var h=f(A);if(n===O){for(var w=h;!l(w);)w=f(w);v&&T===t&&v(A,w),g&&N===t&&g(A,w)}if(u&&u.forEach(function(t,e){if(!h||!r||t!==r[e]||o===O&&u.length-1===e){var n=t.type,i=t.attributes,a=t.object,m=s(h),v=c(m,nt({type:n,attributes:i,object:a}));l(h)&&0===d(h).length&&p(h),h=c(a?m:v,"")}else h=f(h)}),o===O)return r=u,n=o,"continue";h=P(h,0),0===t&&(v&&0===T&&v(A,h),g&&0===N&&g(A,h)),o!==j&&("\n"===o?(h=c(s(h),{type:"br",object:!0}),h=c(s(h),"")):l(h)?m(h,o):h=c(s(h),o)),h=P(h,t+1),v&&T===t+1&&v(A,h),g&&N===t+1&&g(A,h),r=u,n=o},D=0;D1;)t=t.childNodes[e.shift()];return{node:t,offset:e[0]}}function st(){return document.implementation.createHTMLDocument("").body}function lt(t,e){"string"==typeof e&&(e=t.ownerDocument.createTextNode(e));var r=e,n=r.type,o=r.attributes;if(n)for(var i in e=t.ownerDocument.createElement(n),o)e.setAttribute(i,o[i]);return t.appendChild(e)}function dt(t,e){t.appendData(e)}function pt(t){return t.lastChild}function mt(t){return t.parentNode}function vt(t){return t.nodeType===at}function gt(t){return t.nodeValue}function ht(t){return t.parentNode.removeChild(t)}function yt(t){var e=t.value,r=t.multilineTag,n=t.multilineWrapperTags,o=t.createLinePadding,i=[],a=[],u=ot({value:e,multilineTag:r,multilineWrapperTags:n,createEmpty:st,append:lt,getLastChild:pt,getParent:mt,isText:vt,getText:gt,remove:ht,appendText:dt,onStartIndex:function(t,e){i=ct(e,t,[e.nodeValue.length])},onEndIndex:function(t,e){a=ct(e,t,[e.nodeValue.length])},isEditableTree:!0});return o&&function t(e){for(var r=e.element,n=e.createLinePadding,o=e.multilineWrapperTags,i=r.childNodes.length,a=r.ownerDocument,u=0;u0&&void 0!==arguments[0]?arguments[0]:[]).map(function(t){return void 0===t.text?function(t){var e=t.type,r=t.attributes,n=t.object,o=t.children,i="";for(var a in r)Object(xt.isValidAttributeName)(a)&&(i+=" ".concat(a,'="').concat(Object(xt.escapeAttribute)(r[a]),'"'));return n?"<".concat(e).concat(i,">"):"<".concat(e).concat(i,">").concat(Dt(o),"")}(t):Object(xt.escapeHTML)(t.text)}).join("")}function Wt(t,e){return k(t,e.type)?X(t,e.type):g(t,e)}function Lt(t){var e=Object(i.select)("core/rich-text").getFormatType(t);if(e)return Object(i.dispatch)("core/rich-text").removeFormatTypes(t),e;window.console.error("Format ".concat(t," is not registered."))}r.d(e,"applyFormat",function(){return g}),r.d(e,"charAt",function(){return y}),r.d(e,"concat",function(){return b}),r.d(e,"create",function(){return W}),r.d(e,"getActiveFormat",function(){return k}),r.d(e,"getFormatType",function(){return H}),r.d(e,"getFormatTypes",function(){return E}),r.d(e,"getSelectionEnd",function(){return I}),r.d(e,"getSelectionStart",function(){return B}),r.d(e,"getTextContent",function(){return z}),r.d(e,"isCollapsed",function(){return Y}),r.d(e,"isEmpty",function(){return N}),r.d(e,"isEmptyLine",function(){return S}),r.d(e,"join",function(){return q}),r.d(e,"registerFormatType",function(){return U}),r.d(e,"removeFormat",function(){return X}),r.d(e,"remove",function(){return J}),r.d(e,"replace",function(){return K}),r.d(e,"insert",function(){return G}),r.d(e,"insertLineSeparator",function(){return Q}),r.d(e,"insertObject",function(){return tt}),r.d(e,"slice",function(){return et}),r.d(e,"split",function(){return rt}),r.d(e,"apply",function(){return bt}),r.d(e,"unstableToDom",function(){return yt}),r.d(e,"toHTMLString",function(){return jt}),r.d(e,"toggleFormat",function(){return Wt}),r.d(e,"LINE_SEPARATOR",function(){return O}),r.d(e,"unregisterFormatType",function(){return Lt})},32:function(t,e,r){"use strict";function n(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}r.d(e,"a",function(){return n})},34:function(t,e,r){"use strict";var n,o;function i(t){return[t]}function a(){var t={clear:function(){t.head=null}};return t}function u(t,e,r){var n;if(t.length!==e.length)return!1;for(n=r;n