this.wp=this.wp||{},this.wp.richText=function(t){var e={};function r(n){if(e[n])return e[n].exports;var a=e[n]={i:n,l:!1,exports:{}};return t[n].call(a.exports,a,a.exports,r),a.l=!0,a.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 a in t)r.d(n,a,function(e){return t[e]}.bind(null,a));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=308)}({0:function(t,e){!function(){t.exports=this.wp.element}()},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})},18:function(t,e,r){"use strict";var n=r(33);function a(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(i.a)({},t,Object(c.keyBy)(e.formatTypes,"name"));case"REMOVE_FORMAT_TYPES":return Object(c.omit)(t,e.names)}return t}}),l=r(28),s=Object(l.a)(function(t){return Object.values(t.formatTypes)},function(t){return[t.formatTypes]});function f(t,e){return t.formatTypes[e]}function d(t,e){return Object(c.find)(s(t),function(t){var r=t.tagName;return e===r})}function p(t,e){return Object(c.find)(s(t),function(t){var r=t.className;return null!==r&&" ".concat(e," ").indexOf(" ".concat(r," "))>=0})}function m(t){return{type:"ADD_FORMAT_TYPES",formatTypes:Object(c.castArray)(t)}}function v(t){return{type:"REMOVE_FORMAT_TYPES",names:Object(c.castArray)(t)}}function g(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 a=Object.keys(r),o=Object.keys(n);if(a.length!==o.length)return!1;for(var i=a.length,c=0;c2&&void 0!==arguments[2]?arguments[2]:a,u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:o,l=r.slice(0);if(i===u){var s=Object(c.find)(l[i],{type:e.type});if(!s){var f=l[i-1]||[];return{formats:r,text:n,start:a,end:o,formatPlaceholder:Object(c.find)(f,{type:e.type})?void 0:e}}for(;Object(c.find)(l[i],s);)y(l,i,e),i--;for(u++;Object(c.find)(l[u],s);)y(l,u,e),u++}else for(var d=i;d0&&void 0!==arguments[0]?arguments[0]:{},e=t.element,r=t.text,n=t.html,a=t.range,o=t.multilineTag,i=t.multilineWrapperTags;return"string"==typeof r&&r.length>0?{formats:Array(r.length),text:r}:("string"==typeof n&&n.length>0&&(e=N(document,n)),"object"!==Object(j.a)(e)?{formats:[],text:""}:o?V({element:e,range:a,multilineTag:o,multilineWrapperTags:i}):M({element:e,range:a}))}function I(t,e,r,n){if(r){var a=e.parentNode,o=r.startContainer,i=r.startOffset,c=r.endContainer,u=r.endOffset,l=t.text.length;void 0!==n.start?t.start=l+n.start:e===o&&e.nodeType===A?t.start=l+i:a===o&&e===o.childNodes[i]?t.start=l:a===o&&e===o.childNodes[i-1]?t.start=l+n.text.length:e===o&&(t.start=l),void 0!==n.end?t.end=l+n.end:e===c&&e.nodeType===A?t.end=l+u:a===c&&e===c.childNodes[u-1]?t.end=l+n.text.length:a===c&&e===c.childNodes[u]?t.end=l:e===c&&(t.end=l+u)}}function k(t,e,r){if(e){var n=e.startContainer,a=e.endContainer,o=e.startOffset,i=e.endOffset;return t===n&&(o=r(t.nodeValue.slice(0,o)).length),t===a&&(i=r(t.nodeValue.slice(0,i)).length),{startContainer:n,startOffset:o,endContainer:a,endOffset:i}}}function L(t){return t.replace(/[\n\r\t]+/g," ")}function M(t){var e=t.element,r=t.range,n=t.multilineTag,a=t.multilineWrapperTags,o=t.currentWrapperTags,i=void 0===o?[]:o,c={formats:[],text:""};if(!e)return c;if(!e.hasChildNodes())return I(c,e,r,{formats:[],text:""}),c;for(var u=e.childNodes.length,l=0;l0){var m=i.length>0?[i]:[,];c.formats=c.formats.concat(m),c.text+=w}I(c,s,r,f),c.formats=c.formats.concat(f.formats),c.text+=f.text}}return c}function R(t){var e=t.element;if(e.hasAttributes()){for(var r,n=e.attributes.length,a=0;ao.length&&(i=a),i.slice(0,n)}function B(t,e){return Object(c.find)(z(t),{type:e})}function H(t){return t.end}function G(t){return t.start}function Y(t){return t.text}function q(t){var e=t.start,r=t.end;if(void 0!==e&&void 0!==r)return e===r}function $(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return"string"==typeof e&&(e=D({text:e})),h(t.reduce(function(t,r){var n=r.formats,a=r.text;return{text:t.text+e.text+a,formats:t.formats.concat(e.formats,n)}}))}var U=r(15),X=r(19),Z=r(0),K=r(38),J=r.n(K),Q=r(23),tt=r(7),et=[];function rt(t,e){if("string"==typeof(e=Object(i.a)({name:t},e)).name)if(/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(e.name))if(Object(o.select)("core/rich-text").getFormatType(e.name))window.console.error('Format "'+e.name+'" is already registered.');else if("string"==typeof e.tagName&&""!==e.tagName)if("string"==typeof e.className&&""!==e.className||null===e.className)if(/^[_a-zA-Z]+[a-zA-Z0-9-]*$/.test(e.className)){if(null===e.className){var r=Object(o.select)("core/rich-text").getFormatTypeForBareElement(e.tagName);if(r)return void window.console.error('Format "'.concat(r.name,'" is already registered to handle bare tag name "').concat(e.tagName,'".'))}else{var n=Object(o.select)("core/rich-text").getFormatTypeForClassName(e.className);if(n)return void window.console.error('Format "'.concat(n.name,'" is already registered to handle class name "').concat(e.className,'".'))}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){Object(o.dispatch)("core/rich-text").addFormatTypes(e);var a=J()(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:et,e=arguments.length>1?arguments[1]:void 0;return[].concat(Object(O.a)(t),[e])});return e.__experimentalGetPropsForEditableTreePreparation&&Object(Q.addFilter)("experimentalRichText",t,function(r){var n=r;(e.__experimentalCreatePrepareEditableTree||e.__experimentalCreateFormatToValue||e.__experimentalCreateValueToFormat)&&(n=function(n){var o={};if(e.__experimentalCreatePrepareEditableTree&&(o.prepareEditableTree=a(n.prepareEditableTree,e.__experimentalCreatePrepareEditableTree(n["format_".concat(t)],{richTextIdentifier:n.identifier,blockClientId:n.clientId}))),e.__experimentalCreateOnChangeEditableValue){var c=Object.keys(n).reduce(function(e,r){var a=n[r],o="format_".concat(t,"_dispatch_");r.startsWith(o)&&(e[r.replace(o,"")]=a);return e},{});o.onChangeEditableValue=a(n.onChangeEditableValue,e.__experimentalCreateOnChangeEditableValue(Object(i.a)({},n["format_".concat(t)],c),{richTextIdentifier:n.identifier,blockClientId:n.clientId}))}return Object(Z.createElement)(r,Object(X.a)({},n,o))});var u=[Object(o.withSelect)(function(r,n){var a=n.clientId,o=n.identifier;return Object(U.a)({},"format_".concat(t),e.__experimentalGetPropsForEditableTreePreparation(r,{richTextIdentifier:o,blockClientId:a}))})];return e.__experimentalGetPropsForEditableTreeChangeHandler&&u.push(Object(o.withDispatch)(function(r,n){var a=n.clientId,o=n.identifier,i=e.__experimentalGetPropsForEditableTreeChangeHandler(r,{richTextIdentifier:o,blockClientId:a});return Object(c.mapKeys)(i,function(e,r){return"format_".concat(t,"_dispatch_").concat(r)})})),Object(tt.compose)(u)(n)}),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("A class name must begin with a letter, followed by any number of hyphens, letters, or numbers.");else window.console.error("Format class names must be a string, or null to handle bare elements.");else window.console.error("Format tag names must be a string.");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 nt(t,e){var r=t.formats,n=t.text,a=t.start,o=t.end,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a,u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:o,l=r.slice(0);if(i===u){for(var s=Object(c.find)(l[i],{type:e});Object(c.find)(l[i],s);)at(l,i,e),i--;for(u++;Object(c.find)(l[u],s);)at(l,u,e),u++}else for(var f=i;f2&&void 0!==arguments[2]?arguments[2]:a,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:o;"string"==typeof e&&(e=D({text:e}));var u=i+e.text.length;return h({formats:r.slice(0,i).concat(e.formats,r.slice(c)),text:n.slice(0,i)+e.text+n.slice(c),start:u,end:u})}function it(t,e,r){return ot(t,D(),e,r)}function ct(t,e,r){var n=t.formats,a=t.text,o=t.start,i=t.end;return a=a.replace(e,function(t){for(var e=arguments.length,a=new Array(e>1?e-1:0),c=1;c1&&void 0!==arguments[1]?arguments[1]:t.start,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.end,n=Y(t).slice(0,e).lastIndexOf(w),a=t.formats[n],o=[,];return a&&(o=[a]),ot(t,{formats:o,text:w},e,r)}var st="";function ft(t,e,r,n){return ot(t,{text:st,formats:[[Object(i.a)({},e,{object:!0})]]},r,n)}function dt(t){var e=t.formats,r=t.text,n=t.start,a=t.end,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a;return void 0===o||void 0===i?{formats:e,text:r}:{formats:e.slice(o,i),text:r.slice(o,i)}}function pt(t,e){var r=t.formats,n=t.text,a=t.start,o=t.end;if("string"!=typeof e)return function(t){var e=t.formats,r=t.text,n=t.start,a=t.end,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a,c={formats:e.slice(0,o),text:r.slice(0,o)},u={formats:e.slice(i),text:r.slice(i),start:0,end:0};return[ct(c,/\u2028+$/,""),ct(u,/^\u2028+/,"")]}.apply(void 0,arguments);var i=0;return n.split(e).map(function(t){var n=i,c={formats:r.slice(n,n+t.length),text:t};return i+=e.length+t.length,void 0!==a&&void 0!==o&&(a>=n&&an&&(c.start=0),o>=n&&oi&&(c.end=t.length)),c})}function mt(t){var e=t.type,r=t.attributes,n=t.unregisteredAttributes,a=t.object,c=t.boundaryClass,u=function(t){return Object(o.select)("core/rich-text").getFormatType(t)}(e),l={};if(c&&(l["data-rich-text-format-boundary"]="true"),!u)return r&&(l=Object(i.a)({},r,l)),{type:e,attributes:l,object:a};for(var s in l=Object(i.a)({},n,l),r){var f=!!u.attributes&&u.attributes[s];f?l[f]=r[s]:l[s]=r[s]}return u.className&&(l.class?l.class="".concat(u.className," ").concat(l.class):l.class=u.className),{type:u.tagName,object:u.object,attributes:l}}function vt(t){var e,r,n,a=t.value,o=t.multilineTag,i=t.multilineWrapperTags,c=void 0===i?[]:i,u=t.createEmpty,l=t.append,s=t.getLastChild,f=t.getParent,d=t.isText,p=t.getText,m=t.remove,v=t.appendText,g=t.onStartIndex,h=t.onEndIndex,b=t.isEditableTree,y=a.formats,x=a.text,T=a.start,j=a.end,_=y.length+1,C=u(),N={type:o},F=function(t){var e=z(t),r=t.selectedFormat;return void 0===r?e[e.length-1]:e[r-1]}(a);o?(l(l(C,{type:o}),""),r=e=[N]):l(C,"");for(var A=function(t){var a=x.charAt(t),i=y[t];o&&(i=a===w?e=(i||[]).reduce(function(t,e){return a===w&&-1!==c.indexOf(e.type)&&(t.push(e),t.push(N)),t},[N]):[].concat(Object(O.a)(e),Object(O.a)(i||[])));var u=s(C);if(n===w){for(var _=u;!d(_);)_=s(_);g&&T===t&&g(C,_),h&&j===t&&h(C,_)}if(i&&i.forEach(function(t,e){if(!u||!r||t!==r[e]||a===w&&i.length-1===e){var n=t.type,o=t.attributes,c=t.unregisteredAttributes,v=t.object,g=b&&!v&&a!==w&&t===F,h=f(u),y=l(h,mt({type:n,attributes:o,unregisteredAttributes:c,object:v,boundaryClass:g}));d(u)&&0===p(u).length&&m(u),u=l(t.object?h:y,"")}else u=s(u)}),a===w)return r=i,n=a,"continue";0===t&&(g&&0===T&&g(C,u),h&&0===j&&h(C,u)),a!==E&&("\n"===a?(u=l(f(u),{type:"br",object:!0}),u=l(f(u),"")):d(u)?v(u,a):u=l(f(u),a)),g&&T===t+1&&g(C,u),h&&j===t+1&&h(C,u),r=i,n=a},S=0;S<_;S++)A(S);return C}var gt=window.Node.TEXT_NODE;function ht(t,e,r){for(var n=t.parentNode,a=0;t=t.previousSibling;)a++;return r=[a].concat(Object(O.a)(r)),n!==e&&(r=ht(n,e,r)),r}function bt(t,e){for(e=Object(O.a)(e);t&&e.length>1;)t=t.childNodes[e.shift()];return{node:t,offset:e[0]}}var yt=function(){return N(document,"")};function xt(t,e){"string"==typeof e&&(e=t.ownerDocument.createTextNode(e));var r=e,n=r.type,a=r.attributes;if(n)for(var o in e=t.ownerDocument.createElement(n),a)e.setAttribute(o,a[o]);return t.appendChild(e)}function Tt(t,e){t.appendData(e)}function Ot(t){return t.lastChild}function jt(t){return t.parentNode}function wt(t){return t.nodeType===gt}function Et(t){return t.nodeValue}function _t(t){return t.parentNode.removeChild(t)}function Ct(t){var e=t.createElement("br");return e.setAttribute("data-rich-text-padding","true"),e}function Nt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1?arguments[1]:void 0;return t.reduce(function(t,r){return r(t,e.text)},e.formats)}function Ft(t){var e=t.value,r=t.multilineTag,n=t.multilineWrapperTags,a=t.prepareEditableTree,o=t.isEditableTree,c=void 0===o||o,u=[],l=[],s=vt({value:Object(i.a)({},e,{formats:Nt(a,e)}),multilineTag:r,multilineWrapperTags:n,createEmpty:yt,append:xt,getLastChild:Ot,getParent:jt,isText:wt,getText:Et,remove:_t,appendText:Tt,onStartIndex:function(t,e){u=ht(e,t,[e.nodeValue.length])},onEndIndex:function(t,e){l=ht(e,t,[e.nodeValue.length])},isEditableTree:c});return c&&function t(e){for(var r=e.element,n=e.multilineWrapperTags,a=r.childNodes.length,o=r.ownerDocument,i=0;i0){if(p=d,m=s.getRangeAt(0),p.startContainer===m.startContainer&&p.startOffset===m.startOffset&&p.endContainer===m.endContainer&&p.endOffset===m.endOffset)return void(f.activeElement!==e&&e.focus());s.removeAllRanges()}var p,m;s.addRange(d)}(l,r)}var St=r(63);function Pt(t){return zt(vt({value:t.value,multilineTag:t.multilineTag,multilineWrapperTags:t.multilineWrapperTags,createEmpty:Wt,append:It,getLastChild:Dt,getParent:Lt,isText:Mt,getText:Vt,remove:Rt,appendText:kt}).children)}function Wt(){return{}}function Dt(t){var e=t.children;return e&&e[e.length-1]}function It(t,e){return"string"==typeof e&&(e={text:e}),e.parent=t,t.children=t.children||[],t.children.push(e),e}function kt(t,e){t.text+=e}function Lt(t){return t.parent}function Mt(t){return"string"==typeof t.text}function Vt(t){return t.text}function Rt(t){var e=t.parent.children.indexOf(t);return-1!==e&&t.parent.children.splice(e,1),t}function zt(){return(arguments.length>0&&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,a=t.children,o="";for(var i in r)Object(St.isValidAttributeName)(i)&&(o+=" ".concat(i,'="').concat(Object(St.escapeAttribute)(r[i]),'"'));return n?"<".concat(e).concat(o,">"):"<".concat(e).concat(o,">").concat(zt(a),"")}(t):Object(St.escapeHTML)(t.text)}).join("")}function Bt(t,e){return B(t,e.type)?nt(t,e.type):b(t,e)}function Ht(t){var e=Object(o.select)("core/rich-text").getFormatType(t);if(e)return e.__experimentalCreatePrepareEditableTree&&e.__experimentalGetPropsForEditableTreePreparation&&Object(Q.removeFilter)("experimentalRichText",t),Object(o.dispatch)("core/rich-text").removeFormatTypes(t),e;window.console.error("Format ".concat(t," is not registered."))}function Gt(t){for(var e=t.start,r=t.text,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;n--;)if(r[n]===w)return n}function Yt(t,e){var r=Gt(t);if(void 0===r)return t;var n=t.text,a=t.formats,o=t.start,i=t.end,c=Gt(t,r),u=a[r]||[],l=a[c]||[];if(u.length>l.length)return t;for(var s=a.slice(),f=function(t,e){for(var r=t.text,n=t.formats,a=n[e]||[],o=e;o-- >=0;)if(r[o]===w){var i=n[o]||[];if(i.length===a.length+1)return o;if(i.length<=a.length)return}}(t,r),d=r;d=0;){if(r[o]===w)if((n[o]||[]).length===a.length-1)return o}}function $t(t){var e=t.text,r=t.formats,n=t.start,a=t.end,o=Gt(t,n);if(void 0===r[o])return t;for(var i=r.slice(0),c=r[qt(t,o)]||[],u=function(t,e){for(var r=t.text,n=t.formats,a=n[e]||[],o=e,i=e||0;i=a.length))return o;o=i}return o}(t,Gt(t,a)),l=o;l<=u;l++)if(e[l]===w){var s=i[l]||[];i[l]=c.concat(s.slice(c.length+1)),0===i[l].length&&delete i[l]}return h({text:e,formats:i,start:n,end:a})}function Ut(t,e){for(var r,n=t.text,a=t.formats,o=t.start,i=t.end,c=Gt(t,o),u=a[c]||[],l=a[Gt(t,i)]||[],s=qt(t,c),f=a.slice(0),d=u.length-1,p=l.length-1,m=s+1||0;mp?t:e}))}return r?h({text:n,formats:f,start:o,end:i}):t}r.d(e,"applyFormat",function(){return b}),r.d(e,"charAt",function(){return x}),r.d(e,"concat",function(){return T}),r.d(e,"create",function(){return D}),r.d(e,"getActiveFormat",function(){return B}),r.d(e,"getSelectionEnd",function(){return H}),r.d(e,"getSelectionStart",function(){return G}),r.d(e,"getTextContent",function(){return Y}),r.d(e,"isCollapsed",function(){return q}),r.d(e,"isEmpty",function(){return _}),r.d(e,"isEmptyLine",function(){return C}),r.d(e,"join",function(){return $}),r.d(e,"registerFormatType",function(){return rt}),r.d(e,"removeFormat",function(){return nt}),r.d(e,"remove",function(){return it}),r.d(e,"replace",function(){return ct}),r.d(e,"insert",function(){return ot}),r.d(e,"insertLineBreak",function(){return ut}),r.d(e,"insertLineSeparator",function(){return lt}),r.d(e,"insertObject",function(){return ft}),r.d(e,"slice",function(){return dt}),r.d(e,"split",function(){return pt}),r.d(e,"apply",function(){return At}),r.d(e,"unstableToDom",function(){return Ft}),r.d(e,"toHTMLString",function(){return Pt}),r.d(e,"toggleFormat",function(){return Bt}),r.d(e,"LINE_SEPARATOR",function(){return w}),r.d(e,"unregisterFormatType",function(){return Ht}),r.d(e,"indentListItems",function(){return Yt}),r.d(e,"outdentListItems",function(){return $t}),r.d(e,"changeListType",function(){return Ut})},33: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})},38:function(t,e,r){t.exports=function(t,e){var r,n,a,o=0;function i(){var e,i,c=n,u=arguments.length;t:for(;c;){if(c.args.length===arguments.length){for(i=0;i