: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* Returns the default template part areas.
* @param {Object} state Global application state.
* @return {Array} The template part areas.
const __experimentalGetDefaultTemplatePartAreas = (0,external_wp_data_namespaceObject.createSelector)(state => {
var _getEditorSettings$de;
const areas = (_getEditorSettings$de = getEditorSettings(state)?.defaultTemplatePartAreas) !== null && _getEditorSettings$de !== void 0 ? _getEditorSettings$de : [];
return areas.map(item => {
icon: getTemplatePartIcon(item.icon)
}, state => [getEditorSettings(state)?.defaultTemplatePartAreas]);
* Returns a default template type searched by slug.
* @param {Object} state Global application state.
* @param {string} slug The template type slug.
* @return {Object} The template type.
const __experimentalGetDefaultTemplateType = (0,external_wp_data_namespaceObject.createSelector)((state, slug) => {
const templateTypes = __experimentalGetDefaultTemplateTypes(state);
return (_Object$values$find = Object.values(templateTypes).find(type => type.slug === slug)) !== null && _Object$values$find !== void 0 ? _Object$values$find : EMPTY_OBJECT;
}, state => [__experimentalGetDefaultTemplateTypes(state)]);
* Given a template entity, return information about it which is ready to be
* rendered, such as the title, description, and icon.
* @param {Object} state Global application state.
* @param {Object} template The template for which we need information.
* @return {Object} Information about the template, including title, description, and icon.
const __experimentalGetTemplateInfo = (0,external_wp_data_namespaceObject.createSelector)((state, template) => {
description: defaultDescription
} = __experimentalGetDefaultTemplateType(state, slug);
const templateTitle = typeof title === 'string' ? title : title?.rendered;
const templateDescription = typeof description === 'string' ? description : description?.raw;
const templateIcon = __experimentalGetDefaultTemplatePartAreas(state).find(item => area === item.area)?.icon || library_layout;
title: templateTitle && templateTitle !== slug ? templateTitle : defaultTitle || slug,
description: templateDescription || defaultDescription,
}, state => [__experimentalGetDefaultTemplateTypes(state), __experimentalGetDefaultTemplatePartAreas(state)]);
* Returns a post type label depending on the current post.
* @param {Object} state Global application state.
* @return {string|undefined} The post type label if available, otherwise undefined.
const getPostTypeLabel = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => state => {
const currentPostType = getCurrentPostType(state);
const postType = select(external_wp_coreData_namespaceObject.store).getPostType(currentPostType);
// Disable reason: Post type labels object is shaped like this.
// eslint-disable-next-line camelcase
return postType?.labels?.singular_name;
* Returns true if the publish sidebar is opened.
* @param {Object} state Global application state
* @return {boolean} Whether the publish sidebar is open.
function isPublishSidebarOpened(state) {
return state.publishSidebarActive;
;// CONCATENATED MODULE: external ["wp","a11y"]
const external_wp_a11y_namespaceObject = window["wp"]["a11y"];
;// CONCATENATED MODULE: external ["wp","apiFetch"]
const external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"];
var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject);
;// CONCATENATED MODULE: external ["wp","notices"]
const external_wp_notices_namespaceObject = window["wp"]["notices"];
;// CONCATENATED MODULE: external ["wp","hooks"]
const external_wp_hooks_namespaceObject = window["wp"]["hooks"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/local-autosave.js
* Function returning a sessionStorage key to set or retrieve a given post's
* automatic session backup.
* Keys are crucially prefixed with 'wp-autosave-' so that wp-login.php's
* `loggedout` handler can clear sessionStorage of any user-private content.
* @see https://github.com/WordPress/wordpress-develop/blob/6dad32d2aed47e6c0cf2aee8410645f6d7aba6bd/src/wp-login.php#L103
* @param {string} postId Post ID.
* @param {boolean} isPostNew Whether post new.
* @return {string} sessionStorage key
function postKey(postId, isPostNew) {
return `wp-autosave-block-editor-post-${isPostNew ? 'auto-draft' : postId}`;
function localAutosaveGet(postId, isPostNew) {
return window.sessionStorage.getItem(postKey(postId, isPostNew));
function localAutosaveSet(postId, isPostNew, title, content, excerpt) {
window.sessionStorage.setItem(postKey(postId, isPostNew), JSON.stringify({
function localAutosaveClear(postId, isPostNew) {
window.sessionStorage.removeItem(postKey(postId, isPostNew));
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/utils/notice-builder.js
* Builds the arguments for a success notification dispatch.
* @param {Object} data Incoming data to build the arguments from.
* @return {Array} Arguments for dispatch. An empty array signals no
* notification should be sent.
function getNotificationArgumentsForSaveSuccess(data) {
// Autosaves are neither shown a notice nor redirected.
if (data.options?.isAutosave) {
const publishStatus = ['publish', 'private', 'future'];
const isPublished = publishStatus.includes(previousPost.status);
const willPublish = publishStatus.includes(post.status);
const willTrash = post.status === 'trash' && previousPost.status !== 'trash';
let shouldShowLink = (_postType$viewable = postType?.viewable) !== null && _postType$viewable !== void 0 ? _postType$viewable : false;
// Always should a notice, which will be spoken for accessibility.
noticeMessage = postType.labels.item_trashed;
} else if (!isPublished && !willPublish) {
// If saving a non-published post, don't show notice.
noticeMessage = (0,external_wp_i18n_namespaceObject.__)('Draft saved.');
} else if (isPublished && !willPublish) {
// If undoing publish status, show specific notice.
noticeMessage = postType.labels.item_reverted_to_draft;
} else if (!isPublished && willPublish) {
// If publishing or scheduling a post, show the corresponding
publish: postType.labels.item_published,
private: postType.labels.item_published_privately,
future: postType.labels.item_scheduled
// Generic fallback notice.
noticeMessage = postType.labels.item_updated;
label: isDraft ? (0,external_wp_i18n_namespaceObject.__)('View Preview') : postType.labels.view_item,
* Builds the fail notification arguments for dispatch.
* @param {Object} data Incoming data to build the arguments with.
* @return {Array} Arguments for dispatch. An empty array signals no
* notification should be sent.
function getNotificationArgumentsForSaveFail(data) {
if (error && 'rest_autosave_no_changes' === error.code) {
// Autosave requested a new autosave, but there were no changes. This shouldn't
// result in an error notice for the user.
const publishStatus = ['publish', 'private', 'future'];
const isPublished = publishStatus.indexOf(post.status) !== -1;
// If the post was being published, we show the corresponding publish error message
// Unless we publish an "updating failed" message.
publish: (0,external_wp_i18n_namespaceObject.__)('Publishing failed.'),
private: (0,external_wp_i18n_namespaceObject.__)('Publishing failed.'),
future: (0,external_wp_i18n_namespaceObject.__)('Scheduling failed.')
let noticeMessage = !isPublished && publishStatus.indexOf(edits.status) !== -1 ? messages[edits.status] : (0,external_wp_i18n_namespaceObject.__)('Updating failed.');
// Check if message string contains HTML. Notice text is currently only
// supported as plaintext, and stripping the tags may muddle the meaning.
if (error.message && !/<\/?[^>]*>/.test(error.message)) {
noticeMessage = [noticeMessage, error.message].join(' ');
* Builds the trash fail notification arguments for dispatch.
* @return {Array} Arguments for dispatch.
function getNotificationArgumentsForTrashFail(data) {
return [data.error.message && data.error.code !== 'unknown_error' ? data.error.message : (0,external_wp_i18n_namespaceObject.__)('Trashing failed'), {
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/actions.js
* Returns an action generator used in signalling that editor has initialized with
* the specified post object and editor settings.
* @param {Object} post Post object.
* @param {Object} edits Initial edited attributes object.
* @param {Array?} template Block Template.
const setupEditor = (post, edits, template) => ({
dispatch.setEditedPost(post.type, post.id);
// Apply a template for new posts only, if exists.
const isNewPost = post.status === 'auto-draft';
if (isNewPost && template) {
// In order to ensure maximum of a single parse during setup, edits are
// included as part of editor setup action. Assume edited content as
// canonical if provided, falling back to post.
if ('content' in edits) {
content = post.content.raw;
let blocks = (0,external_wp_blocks_namespaceObject.parse)(content);
blocks = (0,external_wp_blocks_namespaceObject.synchronizeBlocksWithTemplate)(blocks, template);
dispatch.resetEditorBlocks(blocks, {
__unstableShouldCreateUndoLevel: false
if (edits && Object.values(edits).some(([key, edit]) => {
return edit !== ((_post$key$raw = post[key]?.raw) !== null && _post$key$raw !== void 0 ? _post$key$raw : post[key]);
dispatch.editPost(edits);
* Returns an action object signalling that the editor is being destroyed and
* that any necessary state or side-effect cleanup should occur.
* @return {Object} Action object.
function __experimentalTearDownEditor() {
external_wp_deprecated_default()("wp.data.dispatch( 'core/editor' ).__experimentalTearDownEditor", {
* Returns an action object used in signalling that the latest version of the
* post has been received, either by initialization or save.
* @deprecated Since WordPress 6.0.
external_wp_deprecated_default()("wp.data.dispatch( 'core/editor' ).resetPost", {
alternative: 'Initialize the editor with the setupEditorState action'
* Returns an action object used in signalling that a patch of updates for the
* latest version of the post have been received.
* @return {Object} Action object.
* @deprecated since Gutenberg 9.7.0.
external_wp_deprecated_default()("wp.data.dispatch( 'core/editor' ).updatePost", {
alternative: 'Use the core entities store instead'
* Setup the editor state.
* @param {Object} post Post object.
function setupEditorState(post) {
external_wp_deprecated_default()("wp.data.dispatch( 'core/editor' ).setupEditorState", {
alternative: "wp.data.dispatch( 'core/editor' ).setEditedPost"
return setEditedPost(post.type, post.id);
* Returns an action that sets the current post Type and post ID.
* @param {string} postType Post Type.
* @param {string} postId Post ID.
* @return {Object} Action object.
function setEditedPost(postType, postId) {
* Returns an action object used in signalling that attributes of the post have
* @param {Object} edits Post attributes to edit.
* @param {Object} options Options for the edit.
const editPost = (edits, options) => ({
} = select.getCurrentPost();
registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord('postType', type, id, edits, options);
* Action for saving the current post in the editor.
* @param {Object} options
const savePost = (options = {}) => async ({
if (!select.isEditedPostSaveable()) {
const content = select.getEditedPostContent();
if (!options.isAutosave) {
const previousRecord = select.getCurrentPost();
...registry.select(external_wp_coreData_namespaceObject.store).getEntityRecordNonTransientEdits('postType', previousRecord.type, previousRecord.id),
type: 'REQUEST_POST_UPDATE_START',
await registry.dispatch(external_wp_coreData_namespaceObject.store).saveEntityRecord('postType', previousRecord.type, edits, options);
let error = registry.select(external_wp_coreData_namespaceObject.store).getLastEntitySaveError('postType', previousRecord.type, previousRecord.id);
await (0,external_wp_hooks_namespaceObject.applyFilters)('editor.__unstableSavePost', Promise.resolve(), options).catch(err => {
type: 'REQUEST_POST_UPDATE_FINISH',
const args = getNotificationArgumentsForSaveFail({
registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice(...args);
const updatedRecord = select.getCurrentPost();
const args = getNotificationArgumentsForSaveSuccess({
previousPost: previousRecord,
postType: await registry.resolveSelect(external_wp_coreData_namespaceObject.store).getPostType(updatedRecord.type),
registry.dispatch(external_wp_notices_namespaceObject.store).createSuccessNotice(...args);
// Make sure that any edits after saving create an undo level and are
// considered for change detection.
if (!options.isAutosave) {
registry.dispatch(external_wp_blockEditor_namespaceObject.store).__unstableMarkLastChangeAsPersistent();
* Action for refreshing the current post.
* @deprecated Since WordPress 6.0.
external_wp_deprecated_default()("wp.data.dispatch( 'core/editor' ).refreshPost", {