import {
  getFreeformContentHandlerName,
  getDefaultBlockName,
  __unstableSerializeAndClean,
  parse
} from "@wordpress/blocks";
import { isInTheFuture, getDate } from "@wordpress/date";
import { addQueryArgs, cleanForSlug } from "@wordpress/url";
import { createSelector, createRegistrySelector } from "@wordpress/data";
import deprecated from "@wordpress/deprecated";
import { Platform } from "@wordpress/element";
import { store as blockEditorStore } from "@wordpress/block-editor";
import { store as coreStore } from "@wordpress/core-data";
import { store as preferencesStore } from "@wordpress/preferences";
import {
  EDIT_MERGE_PROPERTIES,
  PERMALINK_POSTNAME_REGEX,
  ONE_MINUTE_IN_MS,
  AUTOSAVE_PROPERTIES
} from "./constants";
import { getPostRawValue } from "./reducer";
import { getTemplatePartIcon } from "../utils/get-template-part-icon";
import { unlock } from "../lock-unlock";
import { getTemplateInfo } from "../utils/get-template-info";
const EMPTY_OBJECT = {};
const hasEditorUndo = createRegistrySelector((select) => () => {
  return select(coreStore).hasUndo();
});
const hasEditorRedo = createRegistrySelector((select) => () => {
  return select(coreStore).hasRedo();
});
function isEditedPostNew(state) {
  return getCurrentPost(state).status === "auto-draft";
}
function hasChangedContent(state) {
  const edits = getPostEdits(state);
  return "content" in edits;
}
const isEditedPostDirty = createRegistrySelector(
  (select) => (state) => {
    const postType = getCurrentPostType(state);
    const postId = getCurrentPostId(state);
    return select(coreStore).hasEditsForEntityRecord(
      "postType",
      postType,
      postId
    );
  }
);
const hasNonPostEntityChanges = createRegistrySelector(
  (select) => (state) => {
    const dirtyEntityRecords = select(coreStore).__experimentalGetDirtyEntityRecords();
    const { type, id } = getCurrentPost(state);
    return dirtyEntityRecords.some(
      (entityRecord) => entityRecord.kind !== "postType" || entityRecord.name !== type || entityRecord.key !== id
    );
  }
);
function isCleanNewPost(state) {
  return !isEditedPostDirty(state) && isEditedPostNew(state);
}
const getCurrentPost = createRegistrySelector(
  (select) => (state) => {
    const postId = getCurrentPostId(state);
    const postType = getCurrentPostType(state);
    const post = select(coreStore).getRawEntityRecord(
      "postType",
      postType,
      postId
    );
    if (post) {
      return post;
    }
    return EMPTY_OBJECT;
  }
);
function getCurrentPostType(state) {
  return state.postType;
}
function getCurrentPostId(state) {
  return state.postId;
}
function getCurrentTemplateId(state) {
  return state.templateId;
}
function getCurrentPostRevisionsCount(state) {
  return getCurrentPost(state)._links?.["version-history"]?.[0]?.count ?? 0;
}
function getCurrentPostLastRevisionId(state) {
  return getCurrentPost(state)._links?.["predecessor-version"]?.[0]?.id ?? null;
}
const getPostEdits = createRegistrySelector((select) => (state) => {
  const postType = getCurrentPostType(state);
  const postId = getCurrentPostId(state);
  return select(coreStore).getEntityRecordEdits(
    "postType",
    postType,
    postId
  ) || EMPTY_OBJECT;
});
function getCurrentPostAttribute(state, attributeName) {
  switch (attributeName) {
    case "type":
      return getCurrentPostType(state);
    case "id":
      return getCurrentPostId(state);
    default:
      const post = getCurrentPost(state);
      if (!post.hasOwnProperty(attributeName)) {
        break;
      }
      return getPostRawValue(post[attributeName]);
  }
}
const getNestedEditedPostProperty = createSelector(
  (state, attributeName) => {
    const edits = getPostEdits(state);
    if (!edits.hasOwnProperty(attributeName)) {
      return getCurrentPostAttribute(state, attributeName);
    }
    return {
      ...getCurrentPostAttribute(state, attributeName),
      ...edits[attributeName]
    };
  },
  (state, attributeName) => [
    getCurrentPostAttribute(state, attributeName),
    getPostEdits(state)[attributeName]
  ]
);
function getEditedPostAttribute(state, attributeName) {
  switch (attributeName) {
    case "content":
      return getEditedPostContent(state);
  }
  const edits = getPostEdits(state);
  if (!edits.hasOwnProperty(attributeName)) {
    return getCurrentPostAttribute(state, attributeName);
  }
  if (EDIT_MERGE_PROPERTIES.has(attributeName)) {
    return getNestedEditedPostProperty(state, attributeName);
  }
  return edits[attributeName];
}
const getAutosaveAttribute = createRegistrySelector(
  (select) => (state, attributeName) => {
    if (!AUTOSAVE_PROPERTIES.includes(attributeName) && attributeName !== "preview_link") {
      return;
    }
    const postType = getCurrentPostType(state);
    if (postType === "wp_template") {
      return false;
    }
    const postId = getCurrentPostId(state);
    const currentUserId = select(coreStore).getCurrentUser()?.id;
    const autosave = select(coreStore).getAutosave(
      postType,
      postId,
      currentUserId
    );
    if (autosave) {
      return getPostRawValue(autosave[attributeName]);
    }
  }
);
function getEditedPostVisibility(state) {
  const status = getEditedPostAttribute(state, "status");
  if (status === "private") {
    return "private";
  }
  const password = getEditedPostAttribute(state, "password");
  if (password) {
    return "password";
  }
  return "public";
}
function isCurrentPostPending(state) {
  return getCurrentPost(state).status === "pending";
}
function isCurrentPostPublished(state, currentPost) {
  const post = currentPost || getCurrentPost(state);
  return ["publish", "private"].indexOf(post.status) !== -1 || post.status === "future" && !isInTheFuture(
    new Date(Number(getDate(post.date)) - ONE_MINUTE_IN_MS)
  );
}
function isCurrentPostScheduled(state) {
  return getCurrentPost(state).status === "future" && !isCurrentPostPublished(state);
}
function isEditedPostPublishable(state) {
  const post = getCurrentPost(state);
  return isEditedPostDirty(state) || ["publish", "private", "future"].indexOf(post.status) === -1;
}
function isEditedPostSaveable(state) {
  if (isSavingPost(state)) {
    return false;
  }
  return !!getEditedPostAttribute(state, "title") || !!getEditedPostAttribute(state, "excerpt") || !isEditedPostEmpty(state) || Platform.OS === "native";
}
const isEditedPostEmpty = createRegistrySelector(
  (select) => (state) => {
    const postId = getCurrentPostId(state);
    const postType = getCurrentPostType(state);
    const record = select(coreStore).getEditedEntityRecord(
      "postType",
      postType,
      postId
    );
    if (typeof record.content !== "function") {
      return !record.content;
    }
    const blocks = getEditedPostAttribute(state, "blocks");
    if (blocks.length === 0) {
      return true;
    }
    if (blocks.length > 1) {
      return false;
    }
    const blockName = blocks[0].name;
    if (blockName !== getDefaultBlockName() && blockName !== getFreeformContentHandlerName()) {
      return false;
    }
    return !getEditedPostContent(state);
  }
);
const isEditedPostAutosaveable = createRegistrySelector(
  (select) => (state) => {
    if (!isEditedPostSaveable(state)) {
      return false;
    }
    if (isPostAutosavingLocked(state)) {
      return false;
    }
    const postType = getCurrentPostType(state);
    const postTypeObject = select(coreStore).getPostType(postType);
    if (postType === "wp_template" || !postTypeObject?.supports?.autosave) {
      return false;
    }
    const postId = getCurrentPostId(state);
    const hasFetchedAutosave = select(coreStore).hasFetchedAutosaves(
      postType,
      postId
    );
    const currentUserId = select(coreStore).getCurrentUser()?.id;
    const autosave = select(coreStore).getAutosave(
      postType,
      postId,
      currentUserId
    );
    if (!hasFetchedAutosave) {
      return false;
    }
    if (!autosave) {
      return true;
    }
    if (hasChangedContent(state)) {
      return true;
    }
    return ["title", "excerpt", "meta"].some(
      (field) => getPostRawValue(autosave[field]) !== getEditedPostAttribute(state, field)
    );
  }
);
function isEditedPostBeingScheduled(state) {
  const date = getEditedPostAttribute(state, "date");
  const checkedDate = new Date(
    Number(getDate(date)) - ONE_MINUTE_IN_MS
  );
  return isInTheFuture(checkedDate);
}
function isEditedPostDateFloating(state) {
  const date = getEditedPostAttribute(state, "date");
  const modified = getEditedPostAttribute(state, "modified");
  const status = getCurrentPost(state).status;
  if (status === "draft" || status === "auto-draft" || status === "pending") {
    return date === modified || date === null;
  }
  return false;
}
function isDeletingPost(state) {
  return !!state.deleting.pending;
}
function isSavingPost(state) {
  return !!state.saving.pending;
}
const isSavingNonPostEntityChanges = createRegistrySelector(
  (select) => (state) => {
    const entitiesBeingSaved = select(coreStore).__experimentalGetEntitiesBeingSaved();
    const { type, id } = getCurrentPost(state);
    return entitiesBeingSaved.some(
      (entityRecord) => entityRecord.kind !== "postType" || entityRecord.name !== type || entityRecord.key !== id
    );
  }
);
const didPostSaveRequestSucceed = createRegistrySelector(
  (select) => (state) => {
    const postType = getCurrentPostType(state);
    const postId = getCurrentPostId(state);
    return !select(coreStore).getLastEntitySaveError(
      "postType",
      postType,
      postId
    );
  }
);
const didPostSaveRequestFail = createRegistrySelector(
  (select) => (state) => {
    const postType = getCurrentPostType(state);
    const postId = getCurrentPostId(state);
    return !!select(coreStore).getLastEntitySaveError(
      "postType",
      postType,
      postId
    );
  }
);
function isAutosavingPost(state) {
  return isSavingPost(state) && Boolean(state.saving.options?.isAutosave);
}
function isPreviewingPost(state) {
  return isSavingPost(state) && Boolean(state.saving.options?.isPreview);
}
function getEditedPostPreviewLink(state) {
  if (state.saving.pending || isSavingPost(state)) {
    return;
  }
  let previewLink = getAutosaveAttribute(state, "preview_link");
  if (!previewLink || "draft" === getCurrentPost(state).status) {
    previewLink = getEditedPostAttribute(state, "link");
    if (previewLink) {
      previewLink = addQueryArgs(previewLink, { preview: true });
    }
  }
  const featuredImageId = getEditedPostAttribute(state, "featured_media");
  if (previewLink && featuredImageId) {
    return addQueryArgs(previewLink, { _thumbnail_id: featuredImageId });
  }
  return previewLink;
}
const getSuggestedPostFormat = createRegistrySelector(
  (select) => () => {
    const blocks = select(blockEditorStore).getBlocks();
    if (blocks.length > 2) {
      return null;
    }
    let name;
    if (blocks.length === 1) {
      name = blocks[0].name;
      if (name === "core/embed") {
        const provider = blocks[0].attributes?.providerNameSlug;
        if (["youtube", "vimeo"].includes(provider)) {
          name = "core/video";
        } else if (["spotify", "soundcloud"].includes(provider)) {
          name = "core/audio";
        }
      }
    }
    if (blocks.length === 2 && blocks[1].name === "core/paragraph") {
      name = blocks[0].name;
    }
    switch (name) {
      case "core/image":
        return "image";
      case "core/quote":
      case "core/pullquote":
        return "quote";
      case "core/gallery":
        return "gallery";
      case "core/video":
        return "video";
      case "core/audio":
        return "audio";
      default:
        return null;
    }
  }
);
const getEditedPostContent = createRegistrySelector(
  (select) => (state) => {
    const postId = getCurrentPostId(state);
    const postType = getCurrentPostType(state);
    const record = select(coreStore).getEditedEntityRecord(
      "postType",
      postType,
      postId
    );
    if (record) {
      if (typeof record.content === "function") {
        return record.content(record);
      } else if (record.blocks) {
        return __unstableSerializeAndClean(record.blocks);
      } else if (record.content) {
        return record.content;
      }
    }
    return "";
  }
);
function isPublishingPost(state) {
  return isSavingPost(state) && !isCurrentPostPublished(state) && getEditedPostAttribute(state, "status") === "publish";
}
function isPermalinkEditable(state) {
  const permalinkTemplate = getEditedPostAttribute(
    state,
    "permalink_template"
  );
  return PERMALINK_POSTNAME_REGEX.test(permalinkTemplate);
}
function getPermalink(state) {
  const permalinkParts = getPermalinkParts(state);
  if (!permalinkParts) {
    return null;
  }
  const { prefix, postName, suffix } = permalinkParts;
  if (isPermalinkEditable(state)) {
    return prefix + postName + suffix;
  }
  return prefix;
}
function getEditedPostSlug(state) {
  return getEditedPostAttribute(state, "slug") || cleanForSlug(getEditedPostAttribute(state, "title")) || getCurrentPostId(state);
}
function getPermalinkParts(state) {
  const permalinkTemplate = getEditedPostAttribute(
    state,
    "permalink_template"
  );
  if (!permalinkTemplate) {
    return null;
  }
  const postName = getEditedPostAttribute(state, "slug") || getEditedPostAttribute(state, "generated_slug");
  const [prefix, suffix] = permalinkTemplate.split(
    PERMALINK_POSTNAME_REGEX
  );
  return {
    prefix,
    postName,
    suffix
  };
}
function isPostLocked(state) {
  return state.postLock.isLocked;
}
function isPostSavingLocked(state) {
  return Object.keys(state.postSavingLock).length > 0;
}
function isPostAutosavingLocked(state) {
  return Object.keys(state.postAutosavingLock).length > 0;
}
function isPostLockTakeover(state) {
  return state.postLock.isTakeover;
}
function getPostLockUser(state) {
  return state.postLock.user;
}
function getActivePostLock(state) {
  return state.postLock.activePostLock;
}
function canUserUseUnfilteredHTML(state) {
  return Boolean(
    getCurrentPost(state)._links?.hasOwnProperty(
      "wp:action-unfiltered-html"
    )
  );
}
const isPublishSidebarEnabled = createRegistrySelector(
  (select) => () => !!select(preferencesStore).get("core", "isPublishSidebarEnabled")
);
const getEditorBlocks = createSelector(
  (state) => {
    return getEditedPostAttribute(state, "blocks") || parse(getEditedPostContent(state));
  },
  (state) => [
    getEditedPostAttribute(state, "blocks"),
    getEditedPostContent(state)
  ]
);
function isEditorPanelRemoved(state, panelName) {
  return state.removedPanels.includes(panelName);
}
const isEditorPanelEnabled = createRegistrySelector(
  (select) => (state, panelName) => {
    const inactivePanels = select(preferencesStore).get(
      "core",
      "inactivePanels"
    );
    return !isEditorPanelRemoved(state, panelName) && !inactivePanels?.includes(panelName);
  }
);
const isEditorPanelOpened = createRegistrySelector(
  (select) => (state, panelName) => {
    const openPanels = select(preferencesStore).get(
      "core",
      "openPanels"
    );
    return !!openPanels?.includes(panelName);
  }
);
function getEditorSelectionStart(state) {
  deprecated("select('core/editor').getEditorSelectionStart", {
    since: "5.8",
    alternative: "select('core/editor').getEditorSelection"
  });
  return getEditedPostAttribute(state, "selection")?.selectionStart;
}
function getEditorSelectionEnd(state) {
  deprecated("select('core/editor').getEditorSelectionStart", {
    since: "5.8",
    alternative: "select('core/editor').getEditorSelection"
  });
  return getEditedPostAttribute(state, "selection")?.selectionEnd;
}
function getEditorSelection(state) {
  return getEditedPostAttribute(state, "selection");
}
function __unstableIsEditorReady(state) {
  return !!state.postId;
}
function getEditorSettings(state) {
  return state.editorSettings;
}
function getRenderingMode(state) {
  return state.renderingMode;
}
const getDeviceType = createRegistrySelector(
  (select) => (state) => {
    const isZoomOut = unlock(select(blockEditorStore)).isZoomOut();
    if (isZoomOut) {
      return "Desktop";
    }
    return state.deviceType;
  }
);
function isListViewOpened(state) {
  return state.listViewPanel;
}
function isInserterOpened(state) {
  return !!state.blockInserterPanel;
}
const getEditorMode = createRegistrySelector(
  (select) => () => select(preferencesStore).get("core", "editorMode") ?? "visual"
);
function getStateBeforeOptimisticTransaction() {
  deprecated("select('core/editor').getStateBeforeOptimisticTransaction", {
    since: "5.7",
    hint: "No state history is kept on this store anymore"
  });
  return null;
}
function inSomeHistory() {
  deprecated("select('core/editor').inSomeHistory", {
    since: "5.7",
    hint: "No state history is kept on this store anymore"
  });
  return false;
}
function getBlockEditorSelector(name) {
  return createRegistrySelector((select) => (state, ...args) => {
    deprecated("`wp.data.select( 'core/editor' )." + name + "`", {
      since: "5.3",
      alternative: "`wp.data.select( 'core/block-editor' )." + name + "`",
      version: "6.2"
    });
    return select(blockEditorStore)[name](...args);
  });
}
const getBlockName = getBlockEditorSelector("getBlockName");
const isBlockValid = getBlockEditorSelector("isBlockValid");
const getBlockAttributes = getBlockEditorSelector("getBlockAttributes");
const getBlock = getBlockEditorSelector("getBlock");
const getBlocks = getBlockEditorSelector("getBlocks");
const getClientIdsOfDescendants = getBlockEditorSelector(
  "getClientIdsOfDescendants"
);
const getClientIdsWithDescendants = getBlockEditorSelector(
  "getClientIdsWithDescendants"
);
const getGlobalBlockCount = getBlockEditorSelector(
  "getGlobalBlockCount"
);
const getBlocksByClientId = getBlockEditorSelector(
  "getBlocksByClientId"
);
const getBlockCount = getBlockEditorSelector("getBlockCount");
const getBlockSelectionStart = getBlockEditorSelector(
  "getBlockSelectionStart"
);
const getBlockSelectionEnd = getBlockEditorSelector(
  "getBlockSelectionEnd"
);
const getSelectedBlockCount = getBlockEditorSelector(
  "getSelectedBlockCount"
);
const hasSelectedBlock = getBlockEditorSelector("hasSelectedBlock");
const getSelectedBlockClientId = getBlockEditorSelector(
  "getSelectedBlockClientId"
);
const getSelectedBlock = getBlockEditorSelector("getSelectedBlock");
const getBlockRootClientId = getBlockEditorSelector(
  "getBlockRootClientId"
);
const getBlockHierarchyRootClientId = getBlockEditorSelector(
  "getBlockHierarchyRootClientId"
);
const getAdjacentBlockClientId = getBlockEditorSelector(
  "getAdjacentBlockClientId"
);
const getPreviousBlockClientId = getBlockEditorSelector(
  "getPreviousBlockClientId"
);
const getNextBlockClientId = getBlockEditorSelector(
  "getNextBlockClientId"
);
const getSelectedBlocksInitialCaretPosition = getBlockEditorSelector(
  "getSelectedBlocksInitialCaretPosition"
);
const getMultiSelectedBlockClientIds = getBlockEditorSelector(
  "getMultiSelectedBlockClientIds"
);
const getMultiSelectedBlocks = getBlockEditorSelector(
  "getMultiSelectedBlocks"
);
const getFirstMultiSelectedBlockClientId = getBlockEditorSelector(
  "getFirstMultiSelectedBlockClientId"
);
const getLastMultiSelectedBlockClientId = getBlockEditorSelector(
  "getLastMultiSelectedBlockClientId"
);
const isFirstMultiSelectedBlock = getBlockEditorSelector(
  "isFirstMultiSelectedBlock"
);
const isBlockMultiSelected = getBlockEditorSelector(
  "isBlockMultiSelected"
);
const isAncestorMultiSelected = getBlockEditorSelector(
  "isAncestorMultiSelected"
);
const getMultiSelectedBlocksStartClientId = getBlockEditorSelector(
  "getMultiSelectedBlocksStartClientId"
);
const getMultiSelectedBlocksEndClientId = getBlockEditorSelector(
  "getMultiSelectedBlocksEndClientId"
);
const getBlockOrder = getBlockEditorSelector("getBlockOrder");
const getBlockIndex = getBlockEditorSelector("getBlockIndex");
const isBlockSelected = getBlockEditorSelector("isBlockSelected");
const hasSelectedInnerBlock = getBlockEditorSelector(
  "hasSelectedInnerBlock"
);
const isBlockWithinSelection = getBlockEditorSelector(
  "isBlockWithinSelection"
);
const hasMultiSelection = getBlockEditorSelector("hasMultiSelection");
const isMultiSelecting = getBlockEditorSelector("isMultiSelecting");
const isSelectionEnabled = getBlockEditorSelector("isSelectionEnabled");
const getBlockMode = getBlockEditorSelector("getBlockMode");
const isTyping = getBlockEditorSelector("isTyping");
const isCaretWithinFormattedText = getBlockEditorSelector(
  "isCaretWithinFormattedText"
);
const getBlockInsertionPoint = getBlockEditorSelector(
  "getBlockInsertionPoint"
);
const isBlockInsertionPointVisible = getBlockEditorSelector(
  "isBlockInsertionPointVisible"
);
const isValidTemplate = getBlockEditorSelector("isValidTemplate");
const getTemplate = getBlockEditorSelector("getTemplate");
const getTemplateLock = getBlockEditorSelector("getTemplateLock");
const canInsertBlockType = getBlockEditorSelector("canInsertBlockType");
const getInserterItems = getBlockEditorSelector("getInserterItems");
const hasInserterItems = getBlockEditorSelector("hasInserterItems");
const getBlockListSettings = getBlockEditorSelector(
  "getBlockListSettings"
);
const __experimentalGetDefaultTemplateTypes = createRegistrySelector(
  (select) => () => {
    deprecated(
      "select('core/editor').__experimentalGetDefaultTemplateTypes",
      {
        since: "6.8",
        alternative: "select('core/core-data').getCurrentTheme()?.default_template_types"
      }
    );
    return select(coreStore).getCurrentTheme()?.default_template_types;
  }
);
const __experimentalGetDefaultTemplatePartAreas = createRegistrySelector(
  (select) => createSelector(() => {
    deprecated(
      "select('core/editor').__experimentalGetDefaultTemplatePartAreas",
      {
        since: "6.8",
        alternative: "select('core/core-data').getCurrentTheme()?.default_template_part_areas"
      }
    );
    const areas = select(coreStore).getCurrentTheme()?.default_template_part_areas || [];
    return areas.map((item) => {
      return { ...item, icon: getTemplatePartIcon(item.icon) };
    });
  })
);
const __experimentalGetDefaultTemplateType = createRegistrySelector(
  (select) => createSelector((state, slug) => {
    deprecated(
      "select('core/editor').__experimentalGetDefaultTemplateType",
      {
        since: "6.8"
      }
    );
    const templateTypes = select(coreStore).getCurrentTheme()?.default_template_types;
    if (!templateTypes) {
      return EMPTY_OBJECT;
    }
    return Object.values(templateTypes).find(
      (type) => type.slug === slug
    ) ?? EMPTY_OBJECT;
  })
);
const __experimentalGetTemplateInfo = createRegistrySelector(
  (select) => createSelector((state, template) => {
    deprecated("select('core/editor').__experimentalGetTemplateInfo", {
      since: "6.8"
    });
    if (!template) {
      return EMPTY_OBJECT;
    }
    const currentTheme = select(coreStore).getCurrentTheme();
    const templateTypes = currentTheme?.default_template_types || [];
    const templateAreas = currentTheme?.default_template_part_areas || [];
    return getTemplateInfo({
      template,
      templateAreas,
      templateTypes
    });
  })
);
const getPostTypeLabel = createRegistrySelector(
  (select) => (state) => {
    const currentPostType = getCurrentPostType(state);
    const postType = select(coreStore).getPostType(currentPostType);
    return postType?.labels?.singular_name;
  }
);
function isPublishSidebarOpened(state) {
  return state.publishSidebarActive;
}
export {
  __experimentalGetDefaultTemplatePartAreas,
  __experimentalGetDefaultTemplateType,
  __experimentalGetDefaultTemplateTypes,
  __experimentalGetTemplateInfo,
  __unstableIsEditorReady,
  canInsertBlockType,
  canUserUseUnfilteredHTML,
  didPostSaveRequestFail,
  didPostSaveRequestSucceed,
  getActivePostLock,
  getAdjacentBlockClientId,
  getAutosaveAttribute,
  getBlock,
  getBlockAttributes,
  getBlockCount,
  getBlockHierarchyRootClientId,
  getBlockIndex,
  getBlockInsertionPoint,
  getBlockListSettings,
  getBlockMode,
  getBlockName,
  getBlockOrder,
  getBlockRootClientId,
  getBlockSelectionEnd,
  getBlockSelectionStart,
  getBlocks,
  getBlocksByClientId,
  getClientIdsOfDescendants,
  getClientIdsWithDescendants,
  getCurrentPost,
  getCurrentPostAttribute,
  getCurrentPostId,
  getCurrentPostLastRevisionId,
  getCurrentPostRevisionsCount,
  getCurrentPostType,
  getCurrentTemplateId,
  getDeviceType,
  getEditedPostAttribute,
  getEditedPostContent,
  getEditedPostPreviewLink,
  getEditedPostSlug,
  getEditedPostVisibility,
  getEditorBlocks,
  getEditorMode,
  getEditorSelection,
  getEditorSelectionEnd,
  getEditorSelectionStart,
  getEditorSettings,
  getFirstMultiSelectedBlockClientId,
  getGlobalBlockCount,
  getInserterItems,
  getLastMultiSelectedBlockClientId,
  getMultiSelectedBlockClientIds,
  getMultiSelectedBlocks,
  getMultiSelectedBlocksEndClientId,
  getMultiSelectedBlocksStartClientId,
  getNextBlockClientId,
  getPermalink,
  getPermalinkParts,
  getPostEdits,
  getPostLockUser,
  getPostTypeLabel,
  getPreviousBlockClientId,
  getRenderingMode,
  getSelectedBlock,
  getSelectedBlockClientId,
  getSelectedBlockCount,
  getSelectedBlocksInitialCaretPosition,
  getStateBeforeOptimisticTransaction,
  getSuggestedPostFormat,
  getTemplate,
  getTemplateLock,
  hasChangedContent,
  hasEditorRedo,
  hasEditorUndo,
  hasInserterItems,
  hasMultiSelection,
  hasNonPostEntityChanges,
  hasSelectedBlock,
  hasSelectedInnerBlock,
  inSomeHistory,
  isAncestorMultiSelected,
  isAutosavingPost,
  isBlockInsertionPointVisible,
  isBlockMultiSelected,
  isBlockSelected,
  isBlockValid,
  isBlockWithinSelection,
  isCaretWithinFormattedText,
  isCleanNewPost,
  isCurrentPostPending,
  isCurrentPostPublished,
  isCurrentPostScheduled,
  isDeletingPost,
  isEditedPostAutosaveable,
  isEditedPostBeingScheduled,
  isEditedPostDateFloating,
  isEditedPostDirty,
  isEditedPostEmpty,
  isEditedPostNew,
  isEditedPostPublishable,
  isEditedPostSaveable,
  isEditorPanelEnabled,
  isEditorPanelOpened,
  isEditorPanelRemoved,
  isFirstMultiSelectedBlock,
  isInserterOpened,
  isListViewOpened,
  isMultiSelecting,
  isPermalinkEditable,
  isPostAutosavingLocked,
  isPostLockTakeover,
  isPostLocked,
  isPostSavingLocked,
  isPreviewingPost,
  isPublishSidebarEnabled,
  isPublishSidebarOpened,
  isPublishingPost,
  isSavingNonPostEntityChanges,
  isSavingPost,
  isSelectionEnabled,
  isTyping,
  isValidTemplate
};
//# sourceMappingURL=selectors.js.map
