: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
transition: defaultTransition,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
width: isMobileViewport ? '100vw' : 'fit-content',
children: [secondarySidebarResizeListener, secondarySidebar]
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigableRegion, {
className: "interface-interface-skeleton__content",
ariaLabel: mergedLabels.body,
}), !!sidebar && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigableRegion, {
className: "interface-interface-skeleton__sidebar",
ariaLabel: mergedLabels.sidebar,
}), !!actions && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigableRegion, {
className: "interface-interface-skeleton__actions",
ariaLabel: mergedLabels.actions,
}), !!footer && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigableRegion, {
className: "interface-interface-skeleton__footer",
ariaLabel: mergedLabels.footer,
/* harmony default export */ const interface_skeleton = ((0,external_wp_element_namespaceObject.forwardRef)(InterfaceSkeleton));
;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/index.js
;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/index.js
;// CONCATENATED MODULE: external ["wp","blockEditor"]
const external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/store/transformers.js
* Converts a widget entity record into a block.
* @param {Object} widget The widget entity record.
* @return {Object} a block (converted from the entity record).
function transformWidgetToBlock(widget) {
if (widget.id_base === 'block') {
const parsedBlocks = (0,external_wp_blocks_namespaceObject.parse)(widget.instance.raw.content, {
__unstableSkipAutop: true
if (!parsedBlocks.length) {
return (0,external_wp_widgets_namespaceObject.addWidgetIdToBlock)((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {}, []), widget.id);
return (0,external_wp_widgets_namespaceObject.addWidgetIdToBlock)(parsedBlocks[0], widget.id);
if (widget._embedded.about[0].is_multi) {
instance: widget.instance
return (0,external_wp_widgets_namespaceObject.addWidgetIdToBlock)((0,external_wp_blocks_namespaceObject.createBlock)('core/legacy-widget', attributes, []), widget.id);
* Converts a block to a widget entity record.
* @param {Object} block The block.
* @param {Object?} relatedWidget A related widget entity record from the API (optional).
* @return {Object} the widget object (converted from block).
function transformBlockToWidget(block, relatedWidget = {}) {
const isValidLegacyWidgetBlock = block.name === 'core/legacy-widget' && (block.attributes.id || block.attributes.instance);
if (isValidLegacyWidgetBlock) {
var _block$attributes$id, _block$attributes$idB, _block$attributes$ins;
id: (_block$attributes$id = block.attributes.id) !== null && _block$attributes$id !== void 0 ? _block$attributes$id : relatedWidget.id,
id_base: (_block$attributes$idB = block.attributes.idBase) !== null && _block$attributes$idB !== void 0 ? _block$attributes$idB : relatedWidget.id_base,
instance: (_block$attributes$ins = block.attributes.instance) !== null && _block$attributes$ins !== void 0 ? _block$attributes$ins : relatedWidget.instance
content: (0,external_wp_blocks_namespaceObject.serialize)(block)
// Delete read-only properties.
delete widget.rendered_form;
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/store/utils.js
* "Kind" of the navigation post.
* "post type" of the navigation post.
const WIDGET_AREA_ENTITY_TYPE = 'sidebar';
* "post type" of the widget area post.
const POST_TYPE = 'postType';
* Builds an ID for a new widget area post.
* @param {number} widgetAreaId Widget area id.
* @return {string} An ID.
const buildWidgetAreaPostId = widgetAreaId => `widget-area-${widgetAreaId}`;
* Builds an ID for a global widget areas post.
* @return {string} An ID.
const buildWidgetAreasPostId = () => `widget-areas`;
* Builds a query to resolve sidebars.
* @return {Object} Query.
function buildWidgetAreasQuery() {
* Builds a query to resolve widgets.
* @return {Object} Query.
function buildWidgetsQuery() {
* Creates a stub post with given id and set of blocks. Used as a governing entity records
* @param {string} id Post ID.
* @param {Array} blocks The list of blocks.
* @return {Object} A stub post object formatted in compliance with the data layer.
const createStubPost = (id, blocks) => ({
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/store/constants.js
const constants_STORE_NAME = 'core/edit-widgets';
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/store/actions.js
* Persists a stub post with given ID to core data store. The post is meant to be in-memory only and
* shouldn't be saved via the API.
* @param {string} id Post ID.
* @param {Array} blocks Blocks the post should consist of.
* @return {Object} The post object.
const persistStubPost = (id, blocks) => ({
const stubPost = createStubPost(id, blocks);
registry.dispatch(external_wp_coreData_namespaceObject.store).receiveEntityRecords(KIND, POST_TYPE, stubPost, {
* Converts all the blocks from edited widget areas into widgets,
* and submits a batch request to save everything at once.
* Creates a snackbar notice on either success or error.
* @return {Function} An action creator.
const saveEditedWidgetAreas = () => async ({
const editedWidgetAreas = select.getEditedWidgetAreas();
if (!editedWidgetAreas?.length) {
await dispatch.saveWidgetAreas(editedWidgetAreas);
registry.dispatch(external_wp_notices_namespaceObject.store).createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Widgets saved.'), {
registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice( /* translators: %s: The error message. */
(0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('There was an error. %s'), e.message), {
* Converts all the blocks from specified widget areas into widgets,
* and submits a batch request to save everything at once.
* @param {Object[]} widgetAreas Widget areas to save.
* @return {Function} An action creator.
const saveWidgetAreas = widgetAreas => async ({
for (const widgetArea of widgetAreas) {
await dispatch.saveWidgetArea(widgetArea.id);
// saveEditedEntityRecord resets the resolution status, let's fix it manually.
await registry.dispatch(external_wp_coreData_namespaceObject.store).finishResolution('getEntityRecord', KIND, WIDGET_AREA_ENTITY_TYPE, buildWidgetAreasQuery());
* Converts all the blocks from a widget area specified by ID into widgets,
* and submits a batch request to save everything at once.
* @param {string} widgetAreaId ID of the widget area to process.
* @return {Function} An action creator.
const saveWidgetArea = widgetAreaId => async ({
const widgets = select.getWidgets();
const post = registry.select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord(KIND, POST_TYPE, buildWidgetAreaPostId(widgetAreaId));
// Get all widgets from this area
const areaWidgets = Object.values(widgets).filter(({
}) => sidebar === widgetAreaId);
// Remove all duplicate reference widget instances for legacy widgets.
// Why? We filter out the widgets with duplicate IDs to prevent adding more than one instance of a widget
// implemented using a function. WordPress doesn't support having more than one instance of these, if you try to
// save multiple instances of these in different sidebars you will run into undefined behaviors.
const usedReferenceWidgets = [];
const widgetsBlocks = post.blocks.filter(block => {
if (block.name === 'core/legacy-widget' && id) {
if (usedReferenceWidgets.includes(id)) {
usedReferenceWidgets.push(id);
// Determine which widgets have been deleted. We can tell if a widget is
// deleted and not just moved to a different area by looking to see if
// getWidgetAreaForWidgetId() finds something.
const deletedWidgets = [];
for (const widget of areaWidgets) {
const widgetsNewArea = select.getWidgetAreaForWidgetId(widget.id);
deletedWidgets.push(widget);
const sidebarWidgetsIds = [];
for (let i = 0; i < widgetsBlocks.length; i++) {
const block = widgetsBlocks[i];
const widgetId = (0,external_wp_widgets_namespaceObject.getWidgetIdFromBlock)(block);
const oldWidget = widgets[widgetId];
const widget = transformBlockToWidget(block, oldWidget);
// We'll replace the null widgetId after save, but we track it here
// since order is important.
sidebarWidgetsIds.push(widgetId);
// Check oldWidget as widgetId might refer to an ID which has been
// deleted, e.g. if a deleted block is restored via undo after saving.
// Update an existing widget.
registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord('root', 'widget', widgetId, {
const hasEdits = registry.select(external_wp_coreData_namespaceObject.store).hasEditsForEntityRecord('root', 'widget', widgetId);
}) => saveEditedEntityRecord('root', 'widget', widgetId));
}) => saveEntityRecord('root', 'widget', {
for (const widget of deletedWidgets) {
}) => deleteEntityRecord('root', 'widget', widget.id, {
const records = await registry.dispatch(external_wp_coreData_namespaceObject.store).__experimentalBatch(batchTasks);
const preservedRecords = records.filter(record => !record.hasOwnProperty('deleted'));
const failedWidgetNames = [];
for (let i = 0; i < preservedRecords.length; i++) {
const widget = preservedRecords[i];
// Set __internalWidgetId on the block. This will be persisted to the
// store when we dispatch receiveEntityRecords( post ) below.
post.blocks[position].attributes.__internalWidgetId = widget.id;
const error = registry.select(external_wp_coreData_namespaceObject.store).getLastEntitySaveError('root', 'widget', widget.id);
failedWidgetNames.push(block.attributes?.name || block?.name);
if (!sidebarWidgetsIds[position]) {
sidebarWidgetsIds[position] = widget.id;
if (failedWidgetNames.length) {
throw new Error((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: List of widget names */
(0,external_wp_i18n_namespaceObject.__)('Could not save the following widgets: %s.'), failedWidgetNames.join(', ')));
registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord(KIND, WIDGET_AREA_ENTITY_TYPE, widgetAreaId, {
widgets: sidebarWidgetsIds
dispatch(trySaveWidgetArea(widgetAreaId));
registry.dispatch(external_wp_coreData_namespaceObject.store).receiveEntityRecords(KIND, POST_TYPE, post, undefined);
const trySaveWidgetArea = widgetAreaId => ({
registry.dispatch(external_wp_coreData_namespaceObject.store).saveEditedEntityRecord(KIND, WIDGET_AREA_ENTITY_TYPE, widgetAreaId, {
* Sets the clientId stored for a particular widgetId.
* @param {number} clientId Client id.
* @param {number} widgetId Widget id.
* @return {Object} Action.
function setWidgetIdForClientId(clientId, widgetId) {
type: 'SET_WIDGET_ID_FOR_CLIENT_ID',
* Sets the open state of all the widget areas.
* @param {Object} widgetAreasOpenState The open states of all the widget areas.
* @return {Object} Action.
function setWidgetAreasOpenState(widgetAreasOpenState) {
type: 'SET_WIDGET_AREAS_OPEN_STATE',
* Sets the open state of the widget area.
* @param {string} clientId The clientId of the widget area.
* @param {boolean} isOpen Whether the widget area should be opened.
* @return {Object} Action.
function setIsWidgetAreaOpen(clientId, isOpen) {
type: 'SET_IS_WIDGET_AREA_OPEN',
* Returns an action object used to open/close the inserter.
* @param {boolean|Object} value Whether the inserter should be
* opened (true) or closed (false).
* To specify an insertion point,
* @param {string} value.rootClientId The root client ID to insert at.
* @param {number} value.insertionIndex The index to insert at.
* @return {Object} Action object.
function setIsInserterOpened(value) {
type: 'SET_IS_INSERTER_OPENED',