: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
const useLastSelectedWidgetArea = () => (0,external_wp_data_namespaceObject.useSelect)(select => {
} = select(external_wp_blockEditor_namespaceObject.store);
const selectionEndClientId = getBlockSelectionEnd();
// If the selected block is a widget area, return its clientId.
if (getBlockName(selectionEndClientId) === 'core/widget-area') {
return selectionEndClientId;
const widgetAreaBlock = getParentWidgetAreaBlock(selectionEndClientId);
const widgetAreaBlockClientId = widgetAreaBlock?.clientId;
if (widgetAreaBlockClientId) {
return widgetAreaBlockClientId;
// If no widget area has been selected, return the clientId of the first
} = select(external_wp_coreData_namespaceObject.store);
const widgetAreasPost = getEntityRecord(KIND, POST_TYPE, buildWidgetAreasPostId());
return widgetAreasPost?.blocks[0]?.clientId;
/* harmony default export */ const use_last_selected_widget_area = (useLastSelectedWidgetArea);
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/constants.js
const ALLOW_REUSABLE_BLOCKS = false;
const ENABLE_EXPERIMENTAL_FSE_BLOCKS = false;
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/widget-areas-block-editor-provider/index.js
ExperimentalBlockEditorProvider
} = unlock(external_wp_blockEditor_namespaceObject.privateApis);
} = unlock(external_wp_patterns_namespaceObject.privateApis);
} = unlock(external_wp_blockLibrary_namespaceObject.privateApis);
function WidgetAreasBlockEditorProvider({
const mediaPermissions = (0,external_wp_coreData_namespaceObject.useResourcePermissions)('media');
const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium');
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
} = select(external_wp_coreData_namespaceObject.store);
const siteSettings = canUser('read', 'settings') ? getEntityRecord('root', 'site') : undefined;
widgetAreas: select(store_store).getWidgetAreas(),
widgets: select(store_store).getWidgets(),
reusableBlocks: ALLOW_REUSABLE_BLOCKS ? getEntityRecords('postType', 'wp_block') : [],
isFixedToolbarActive: !!select(external_wp_preferences_namespaceObject.store).get('core/edit-widgets', 'fixedToolbar'),
keepCaretInsideBlock: !!select(external_wp_preferences_namespaceObject.store).get('core/edit-widgets', 'keepCaretInsideBlock'),
pageOnFront: siteSettings?.page_on_front,
pageForPosts: siteSettings?.page_for_posts
} = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
const settings = (0,external_wp_element_namespaceObject.useMemo)(() => {
let mediaUploadBlockEditor;
if (mediaPermissions.canCreate) {
mediaUploadBlockEditor = ({
(0,external_wp_mediaUtils_namespaceObject.uploadMedia)({
wpAllowedMimeTypes: blockEditorSettings.allowedMimeTypes,
__experimentalReusableBlocks: reusableBlocks,
hasFixedToolbar: isFixedToolbarActive || !isLargeViewport,
mediaUpload: mediaUploadBlockEditor,
__experimentalSetIsInserterOpened: setIsInserterOpened,
}, [blockEditorSettings, isFixedToolbarActive, isLargeViewport, keepCaretInsideBlock, mediaPermissions.canCreate, reusableBlocks, setIsInserterOpened, pageOnFront, pageForPosts]);
const widgetAreaId = use_last_selected_widget_area();
const [blocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)(KIND, POST_TYPE, {
id: buildWidgetAreasPostId()
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.SlotFillProvider, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(keyboard_shortcuts.Register, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockKeyboardShortcuts, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(ExperimentalBlockEditorProvider, {
children: [children, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternsMenuItems, {
rootClientId: widgetAreaId
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/drawer-left.js
const drawerLeft = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM8.5 18.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h2.5v13zm10-.5c0 .3-.2.5-.5.5h-8v-13h8c.3 0 .5.2.5.5v12z"
/* harmony default export */ const drawer_left = (drawerLeft);
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/drawer-right.js
const drawerRight = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4 14.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h8v13zm4.5-.5c0 .3-.2.5-.5.5h-2.5v-13H18c.3 0 .5.2.5.5v12z"
/* harmony default export */ const drawer_right = (drawerRight);
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/block-default.js
const blockDefault = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"
/* harmony default export */ const block_default = (blockDefault);
;// CONCATENATED MODULE: external ["wp","url"]
const external_wp_url_namespaceObject = window["wp"]["url"];
;// CONCATENATED MODULE: external ["wp","dom"]
const external_wp_dom_namespaceObject = window["wp"]["dom"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/sidebar/widget-areas.js
const widgetAreas = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).getWidgetAreas(), []);
const selectedWidgetArea = (0,external_wp_element_namespaceObject.useMemo)(() => selectedWidgetAreaId && widgetAreas?.find(widgetArea => widgetArea.id === selectedWidgetAreaId), [selectedWidgetAreaId, widgetAreas]);
if (!selectedWidgetArea) {
description = (0,external_wp_i18n_namespaceObject.__)('Widget Areas are global parts in your site’s layout that can accept blocks. These vary by theme, but are typically parts like your Sidebar or Footer.');
} else if (selectedWidgetAreaId === 'wp_inactive_widgets') {
description = (0,external_wp_i18n_namespaceObject.__)('Blocks in this Widget Area will not be displayed in your site.');
description = selectedWidgetArea.description;
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "edit-widgets-widget-areas",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "edit-widgets-widget-areas__top-container",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, {
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
// Use `dangerouslySetInnerHTML` to keep backwards
// compatibility. Basic markup in the description is an
// established feature of WordPress.
// @see https://github.com/WordPress/gutenberg/issues/33106
dangerouslySetInnerHTML: {
__html: (0,external_wp_dom_namespaceObject.safeHTML)(description)
}), widgetAreas?.length === 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
children: (0,external_wp_i18n_namespaceObject.__)('Your theme does not contain any Widget Areas.')
}), !selectedWidgetArea && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
href: (0,external_wp_url_namespaceObject.addQueryArgs)('customize.php', {
'autofocus[panel]': 'widgets',
return: window.location.pathname
children: (0,external_wp_i18n_namespaceObject.__)('Manage with live preview')
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/sidebar/index.js
const SIDEBAR_ACTIVE_BY_DEFAULT = external_wp_element_namespaceObject.Platform.select({
const BLOCK_INSPECTOR_IDENTIFIER = 'edit-widgets/block-inspector';
// Widget areas were one called block areas, so use 'edit-widgets/block-areas'
// for backwards compatibility.
const WIDGET_AREAS_IDENTIFIER = 'edit-widgets/block-areas';
} = unlock(external_wp_components_namespaceObject.privateApis);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Tabs.TabList, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs.Tab, {
tabId: WIDGET_AREAS_IDENTIFIER,
children: selectedWidgetAreaBlock ? selectedWidgetAreaBlock.attributes.name : (0,external_wp_i18n_namespaceObject.__)('Widget Areas')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs.Tab, {
tabId: BLOCK_INSPECTOR_IDENTIFIER,
children: (0,external_wp_i18n_namespaceObject.__)('Block')
function SidebarContent({
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (hasSelectedNonAreaBlock && currentArea === WIDGET_AREAS_IDENTIFIER && isGeneralSidebarOpen) {
enableComplementaryArea('core/edit-widgets', BLOCK_INSPECTOR_IDENTIFIER);
if (!hasSelectedNonAreaBlock && currentArea === BLOCK_INSPECTOR_IDENTIFIER && isGeneralSidebarOpen) {
enableComplementaryArea('core/edit-widgets', WIDGET_AREAS_IDENTIFIER);
// We're intentionally leaving `currentArea` and `isGeneralSidebarOpen`
// out of the dep array because we want this effect to run based on
// block selection changes, not sidebar state changes.
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [hasSelectedNonAreaBlock, enableComplementaryArea]);
const tabsContextValue = (0,external_wp_element_namespaceObject.useContext)(Tabs.Context);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(complementary_area, {
className: "edit-widgets-sidebar",
header: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs.Context.Provider, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarHeader, {
selectedWidgetAreaBlock: selectedWidgetAreaBlock
headerClassName: "edit-widgets-sidebar__panel-tabs"
/* translators: button label text should, if possible, be under 16 characters. */,
title: (0,external_wp_i18n_namespaceObject.__)('Settings'),
closeLabel: (0,external_wp_i18n_namespaceObject.__)('Close Settings'),
scope: "core/edit-widgets",
icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? drawer_left : drawer_right,
isActiveByDefault: SIDEBAR_ACTIVE_BY_DEFAULT,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Tabs.Context.Provider, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs.TabPanel, {
tabId: WIDGET_AREAS_IDENTIFIER,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WidgetAreas, {
selectedWidgetAreaId: selectedWidgetAreaBlock?.attributes.id
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs.TabPanel, {
tabId: BLOCK_INSPECTOR_IDENTIFIER,
children: hasSelectedNonAreaBlock ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockInspector, {}) :
// Pretend that Widget Areas are part of the UI by not
// showing the Block Inspector when one is selected.
(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
className: "block-editor-block-inspector__no-blocks",
children: (0,external_wp_i18n_namespaceObject.__)('No block selected.')
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
getBlockParentsByBlockName
} = select(external_wp_blockEditor_namespaceObject.store);
getActiveComplementaryArea
const selectedBlock = getSelectedBlock();
const activeArea = getActiveComplementaryArea(store_store.name);
let currentSelection = activeArea;
currentSelection = BLOCK_INSPECTOR_IDENTIFIER;
currentSelection = WIDGET_AREAS_IDENTIFIER;
if (selectedBlock.name === 'core/widget-area') {
widgetAreaBlock = selectedBlock;
widgetAreaBlock = getBlock(getBlockParentsByBlockName(selectedBlock.clientId, 'core/widget-area')[0]);
currentArea: currentSelection,
hasSelectedNonAreaBlock: !!(selectedBlock && selectedBlock.name !== 'core/widget-area'),
isGeneralSidebarOpen: !!activeArea,
selectedWidgetAreaBlock: widgetAreaBlock
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
// `newSelectedTabId` could technically be falsey if no tab is selected (i.e.
// the initial render) or when we don't want a tab displayed (i.e. the
// sidebar is closed). These cases should both be covered by the `!!` check
// below, so we shouldn't need any additional falsey handling.
const onTabSelect = (0,external_wp_element_namespaceObject.useCallback)(newSelectedTabId => {
if (!!newSelectedTabId) {
enableComplementaryArea(store_store.name, newSelectedTabId);
}, [enableComplementaryArea]);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs
// Due to how this component is controlled (via a value from the
// `interfaceStore`), when the sidebar closes the currently selected
// tab can't be found. This causes the component to continuously reset
// the selection to `null` in an infinite loop. Proactively setting
// the selected tab to `null` avoids that.
selectedTabId: isGeneralSidebarOpen ? currentArea : null,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarContent, {
hasSelectedNonAreaBlock: hasSelectedNonAreaBlock,
currentArea: currentArea,
isGeneralSidebarOpen: isGeneralSidebarOpen,
selectedWidgetAreaBlock: selectedWidgetAreaBlock
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/plus.js
const plus = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"
/* harmony default export */ const library_plus = (plus);
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/list-view.js
const listView = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z"
/* harmony default export */ const list_view = (listView);
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/undo.js
const undo = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z"
/* harmony default export */ const library_undo = (undo);
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/redo.js
const redo = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",