: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
/******/ (() => { // webpackBootstrap
/******/ // The require scope
/******/ var __webpack_require__ = {};
/************************************************************************/
/******/ /* webpack/runtime/compat get default export */
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = (module) => {
/******/ var getter = module && module.__esModule ?
/******/ () => (module['default']) :
/******/ __webpack_require__.d(getter, { a: getter });
/******/ /* webpack/runtime/define property getters */
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ /* webpack/runtime/make namespace object */
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/************************************************************************/
var __webpack_exports__ = {};
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
RichTextData: () => (/* reexport */ RichTextData),
__experimentalRichText: () => (/* reexport */ __experimentalRichText),
__unstableCreateElement: () => (/* reexport */ createElement),
__unstableToDom: () => (/* reexport */ toDom),
__unstableUseRichText: () => (/* reexport */ useRichText),
applyFormat: () => (/* reexport */ applyFormat),
concat: () => (/* reexport */ concat),
create: () => (/* reexport */ create),
getActiveFormat: () => (/* reexport */ getActiveFormat),
getActiveFormats: () => (/* reexport */ getActiveFormats),
getActiveObject: () => (/* reexport */ getActiveObject),
getTextContent: () => (/* reexport */ getTextContent),
insert: () => (/* reexport */ insert),
insertObject: () => (/* reexport */ insertObject),
isCollapsed: () => (/* reexport */ isCollapsed),
isEmpty: () => (/* reexport */ isEmpty),
join: () => (/* reexport */ join),
registerFormatType: () => (/* reexport */ registerFormatType),
remove: () => (/* reexport */ remove_remove),
removeFormat: () => (/* reexport */ removeFormat),
replace: () => (/* reexport */ replace_replace),
slice: () => (/* reexport */ slice),
split: () => (/* reexport */ split),
store: () => (/* reexport */ store),
toHTMLString: () => (/* reexport */ toHTMLString),
toggleFormat: () => (/* reexport */ toggleFormat),
unregisterFormatType: () => (/* reexport */ unregisterFormatType),
useAnchor: () => (/* reexport */ useAnchor),
useAnchorRef: () => (/* reexport */ useAnchorRef)
// NAMESPACE OBJECT: ./node_modules/@wordpress/rich-text/build-module/store/selectors.js
var selectors_namespaceObject = {};
__webpack_require__.r(selectors_namespaceObject);
__webpack_require__.d(selectors_namespaceObject, {
getFormatType: () => (getFormatType),
getFormatTypeForBareElement: () => (getFormatTypeForBareElement),
getFormatTypeForClassName: () => (getFormatTypeForClassName),
getFormatTypes: () => (getFormatTypes)
// NAMESPACE OBJECT: ./node_modules/@wordpress/rich-text/build-module/store/actions.js
var actions_namespaceObject = {};
__webpack_require__.r(actions_namespaceObject);
__webpack_require__.d(actions_namespaceObject, {
addFormatTypes: () => (addFormatTypes),
removeFormatTypes: () => (removeFormatTypes)
;// CONCATENATED MODULE: external ["wp","data"]
const external_wp_data_namespaceObject = window["wp"]["data"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/store/reducer.js
* Reducer managing the format types
* @param {Object} state Current state.
* @param {Object} action Dispatched action.
* @return {Object} Updated state.
function formatTypes(state = {}, action) {
// Key format types by their name.
...action.formatTypes.reduce((newFormatTypes, type) => ({
case 'REMOVE_FORMAT_TYPES':
return Object.fromEntries(Object.entries(state).filter(([key]) => !action.names.includes(key)));
/* harmony default export */ const reducer = ((0,external_wp_data_namespaceObject.combineReducers)({
;// CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/store/selectors.js
* Returns all the available format types.
* @param {Object} state Data state.
* import { __, sprintf } from '@wordpress/i18n';
* import { store as richTextStore } from '@wordpress/rich-text';
* import { useSelect } from '@wordpress/data';
* const ExampleComponent = () => {
* const { getFormatTypes } = useSelect(
* ( select ) => select( richTextStore ),
* const availableFormats = getFormatTypes();
* return availableFormats ? (
* { availableFormats?.map( ( format ) => (
* <li>{ format.name }</li>
* __( 'No Formats available' )
* @return {Array} Format types.
const getFormatTypes = (0,external_wp_data_namespaceObject.createSelector)(state => Object.values(state.formatTypes), state => [state.formatTypes]);
* Returns a format type by name.
* @param {Object} state Data state.
* @param {string} name Format type name.
* import { __, sprintf } from '@wordpress/i18n';
* import { store as richTextStore } from '@wordpress/rich-text';
* import { useSelect } from '@wordpress/data';
* const ExampleComponent = () => {
* const { getFormatType } = useSelect(
* ( select ) => select( richTextStore ),
* const boldFormat = getFormatType( 'core/bold' );
* { Object.entries( boldFormat )?.map( ( [ key, value ] ) => (
* @return {Object?} Format type.
function getFormatType(state, name) {
return state.formatTypes[name];
* Gets the format type, if any, that can handle a bare element (without a
* data-format-type attribute), given the tag name of this element.
* @param {Object} state Data state.
* @param {string} bareElementTagName The tag name of the element to find a
* import { __, sprintf } from '@wordpress/i18n';
* import { store as richTextStore } from '@wordpress/rich-text';
* import { useSelect } from '@wordpress/data';
* const ExampleComponent = () => {
* const { getFormatTypeForBareElement } = useSelect(
* ( select ) => select( richTextStore ),
* const format = getFormatTypeForBareElement( 'strong' );
* return format && <p>{ sprintf( __( 'Format name: %s' ), format.name ) }</p>;
* @return {?Object} Format type.
function getFormatTypeForBareElement(state, bareElementTagName) {
const formatTypes = getFormatTypes(state);
return formatTypes.find(({
return className === null && bareElementTagName === tagName;
}) || formatTypes.find(({
return className === null && '*' === tagName;
* Gets the format type, if any, that can handle an element, given its classes.
* @param {Object} state Data state.
* @param {string} elementClassName The classes of the element to find a format
* import { __, sprintf } from '@wordpress/i18n';
* import { store as richTextStore } from '@wordpress/rich-text';
* import { useSelect } from '@wordpress/data';
* const ExampleComponent = () => {
* const { getFormatTypeForClassName } = useSelect(
* ( select ) => select( richTextStore ),
* const format = getFormatTypeForClassName( 'has-inline-color' );
* return format && <p>{ sprintf( __( 'Format name: %s' ), format.name ) }</p>;
* @return {?Object} Format type.
function getFormatTypeForClassName(state, elementClassName) {
return getFormatTypes(state).find(({
if (className === null) {
return ` ${elementClassName} `.indexOf(` ${className} `) >= 0;
;// CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/store/actions.js
* Returns an action object used in signalling that format types have been
* Ignored from documentation as registerFormatType should be used instead from @wordpress/rich-text
* @param {Array|Object} formatTypes Format types received.
* @return {Object} Action object.
function addFormatTypes(formatTypes) {
type: 'ADD_FORMAT_TYPES',
formatTypes: Array.isArray(formatTypes) ? formatTypes : [formatTypes]
* Returns an action object used to remove a registered format type.
* Ignored from documentation as unregisterFormatType should be used instead from @wordpress/rich-text
* @param {string|Array} names Format name.
* @return {Object} Action object.
function removeFormatTypes(names) {
type: 'REMOVE_FORMAT_TYPES',
names: Array.isArray(names) ? names : [names]
;// CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/store/index.js
const STORE_NAME = 'core/rich-text';
* Store definition for the rich-text namespace.
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, {
selectors: selectors_namespaceObject,
actions: actions_namespaceObject
(0,external_wp_data_namespaceObject.register)(store);
;// CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/is-format-equal.js
/** @typedef {import('./types').RichTextFormat} RichTextFormat */
* Optimised equality check for format objects.
* @param {?RichTextFormat} format1 Format to compare.
* @param {?RichTextFormat} format2 Format to compare.
* @return {boolean} True if formats are equal, false if not.
function isFormatEqual(format1, format2) {
if (format1 === format2) {
if (!format1 || !format2) {
if (format1.type !== format2.type) {
const attributes1 = format1.attributes;
const attributes2 = format2.attributes;
if (attributes1 === attributes2) {
if (!attributes1 || !attributes2) {
const keys1 = Object.keys(attributes1);
const keys2 = Object.keys(attributes2);
if (keys1.length !== keys2.length) {
const length = keys1.length;
for (let i = 0; i < length; i++) {
if (attributes1[name] !== attributes2[name]) {
;// CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/normalise-formats.js
/** @typedef {import('./types').RichTextValue} RichTextValue */
* Normalises formats: ensures subsequent adjacent equal formats have the same
* @param {RichTextValue} value Value to normalise formats of.
* @return {RichTextValue} New value with normalised formats.
function normaliseFormats(value) {
const newFormats = value.formats.slice();
newFormats.forEach((formatsAtIndex, index) => {
const formatsAtPreviousIndex = newFormats[index - 1];
if (formatsAtPreviousIndex) {
const newFormatsAtIndex = formatsAtIndex.slice();
newFormatsAtIndex.forEach((format, formatIndex) => {
const previousFormat = formatsAtPreviousIndex[formatIndex];
if (isFormatEqual(format, previousFormat)) {
newFormatsAtIndex[formatIndex] = previousFormat;
newFormats[index] = newFormatsAtIndex;
;// CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/apply-format.js
/** @typedef {import('./types').RichTextValue} RichTextValue */
/** @typedef {import('./types').RichTextFormat} RichTextFormat */
function replace(array, index, value) {
* Apply a format object to a Rich Text value from the given `startIndex` to the
* given `endIndex`. Indices are retrieved from the selection if none are
* @param {RichTextValue} value Value to modify.
* @param {RichTextFormat} format Format to apply.
* @param {number} [startIndex] Start index.
* @param {number} [endIndex] End index.
* @return {RichTextValue} A new value with the format applied.
function applyFormat(value, format, startIndex = value.start, endIndex = value.end) {
const newFormats = formats.slice();
// The selection is collapsed.
if (startIndex === endIndex) {
const startFormat = newFormats[startIndex]?.find(({
}) => type === format.type);
// If the caret is at a format of the same type, expand start and end to
// the edges of the format. This is useful to apply new attributes.