"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name5 in all)
    __defProp(target, name5, { get: all[name5], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// packages/block-library/src/index.js
var index_exports = {};
__export(index_exports, {
  __experimentalGetCoreBlocks: () => __experimentalGetCoreBlocks,
  __experimentalRegisterExperimentalCoreBlocks: () => __experimentalRegisterExperimentalCoreBlocks,
  privateApis: () => import_private_apis.privateApis,
  registerCoreBlocks: () => registerCoreBlocks
});
module.exports = __toCommonJS(index_exports);
var import_blocks = require("@wordpress/blocks");
var import_data = require("@wordpress/data");
var import_block_editor = require("@wordpress/block-editor");
var import_server_side_render = require("@wordpress/server-side-render");
var import_i18n = require("@wordpress/i18n");
var accordion = __toESM(require("./accordion"));
var accordionItem = __toESM(require("./accordion-item"));
var accordionHeading = __toESM(require("./accordion-heading"));
var accordionPanel = __toESM(require("./accordion-panel"));
var archives = __toESM(require("./archives"));
var avatar = __toESM(require("./avatar"));
var audio = __toESM(require("./audio"));
var breadcrumbs = __toESM(require("./breadcrumbs"));
var button = __toESM(require("./button"));
var buttons = __toESM(require("./buttons"));
var calendar = __toESM(require("./calendar"));
var categories = __toESM(require("./categories"));
var classic = __toESM(require("./freeform"));
var code = __toESM(require("./code"));
var column = __toESM(require("./column"));
var columns = __toESM(require("./columns"));
var comments = __toESM(require("./comments"));
var commentAuthorAvatar = __toESM(require("./comment-author-avatar"));
var commentAuthorName = __toESM(require("./comment-author-name"));
var commentContent = __toESM(require("./comment-content"));
var commentDate = __toESM(require("./comment-date"));
var commentEditLink = __toESM(require("./comment-edit-link"));
var commentReplyLink = __toESM(require("./comment-reply-link"));
var commentTemplate = __toESM(require("./comment-template"));
var commentsPaginationPrevious = __toESM(require("./comments-pagination-previous"));
var commentsPagination = __toESM(require("./comments-pagination"));
var commentsPaginationNext = __toESM(require("./comments-pagination-next"));
var commentsPaginationNumbers = __toESM(require("./comments-pagination-numbers"));
var commentsTitle = __toESM(require("./comments-title"));
var cover = __toESM(require("./cover"));
var details = __toESM(require("./details"));
var embed = __toESM(require("./embed"));
var file = __toESM(require("./file"));
var form = __toESM(require("./form"));
var formInput = __toESM(require("./form-input"));
var formSubmitButton = __toESM(require("./form-submit-button"));
var formSubmissionNotification = __toESM(require("./form-submission-notification"));
var gallery = __toESM(require("./gallery"));
var group = __toESM(require("./group"));
var heading = __toESM(require("./heading"));
var homeLink = __toESM(require("./home-link"));
var html = __toESM(require("./html"));
var image = __toESM(require("./image"));
var latestComments = __toESM(require("./latest-comments"));
var latestPosts = __toESM(require("./latest-posts"));
var list = __toESM(require("./list"));
var math = __toESM(require("./math"));
var listItem = __toESM(require("./list-item"));
var logInOut = __toESM(require("./loginout"));
var mediaText = __toESM(require("./media-text"));
var missing = __toESM(require("./missing"));
var more = __toESM(require("./more"));
var navigation = __toESM(require("./navigation"));
var navigationLink = __toESM(require("./navigation-link"));
var navigationSubmenu = __toESM(require("./navigation-submenu"));
var nextpage = __toESM(require("./nextpage"));
var pattern = __toESM(require("./pattern"));
var pageList = __toESM(require("./page-list"));
var pageListItem = __toESM(require("./page-list-item"));
var paragraph = __toESM(require("./paragraph"));
var postAuthor = __toESM(require("./post-author"));
var postAuthorName = __toESM(require("./post-author-name"));
var postAuthorBiography = __toESM(require("./post-author-biography"));
var postComment = __toESM(require("./post-comment"));
var postCommentsCount = __toESM(require("./post-comments-count"));
var postCommentsForm = __toESM(require("./post-comments-form"));
var postCommentsLink = __toESM(require("./post-comments-link"));
var postContent = __toESM(require("./post-content"));
var postDate = __toESM(require("./post-date"));
var postExcerpt = __toESM(require("./post-excerpt"));
var postFeaturedImage = __toESM(require("./post-featured-image"));
var postNavigationLink = __toESM(require("./post-navigation-link"));
var postTemplate = __toESM(require("./post-template"));
var postTerms = __toESM(require("./post-terms"));
var postTimeToRead = __toESM(require("./post-time-to-read"));
var postTitle = __toESM(require("./post-title"));
var preformatted = __toESM(require("./preformatted"));
var pullquote = __toESM(require("./pullquote"));
var query = __toESM(require("./query"));
var queryNoResults = __toESM(require("./query-no-results"));
var queryPagination = __toESM(require("./query-pagination"));
var queryPaginationNext = __toESM(require("./query-pagination-next"));
var queryPaginationNumbers = __toESM(require("./query-pagination-numbers"));
var queryPaginationPrevious = __toESM(require("./query-pagination-previous"));
var queryTitle = __toESM(require("./query-title"));
var queryTotal = __toESM(require("./query-total"));
var quote = __toESM(require("./quote"));
var reusableBlock = __toESM(require("./block"));
var readMore = __toESM(require("./read-more"));
var rss = __toESM(require("./rss"));
var search = __toESM(require("./search"));
var separator = __toESM(require("./separator"));
var shortcode = __toESM(require("./shortcode"));
var siteLogo = __toESM(require("./site-logo"));
var siteTagline = __toESM(require("./site-tagline"));
var siteTitle = __toESM(require("./site-title"));
var socialLink = __toESM(require("./social-link"));
var socialLinks = __toESM(require("./social-links"));
var spacer = __toESM(require("./spacer"));
var tab = __toESM(require("./tab"));
var table = __toESM(require("./table"));
var tableOfContents = __toESM(require("./table-of-contents"));
var tabs = __toESM(require("./tabs"));
var tagCloud = __toESM(require("./tag-cloud"));
var templatePart = __toESM(require("./template-part"));
var termCount = __toESM(require("./term-count"));
var termDescription = __toESM(require("./term-description"));
var termName = __toESM(require("./term-name"));
var termsQuery = __toESM(require("./terms-query"));
var termTemplate = __toESM(require("./term-template"));
var textColumns = __toESM(require("./text-columns"));
var verse = __toESM(require("./verse"));
var video = __toESM(require("./video"));
var footnotes = __toESM(require("./footnotes"));
var import_is_block_metadata_experimental = __toESM(require("./utils/is-block-metadata-experimental"));
var import_lock_unlock = require("./lock-unlock");
var import_private_apis = require("./private-apis");
var import_jsx_runtime = require("react/jsx-runtime");
var getAllBlocks = () => {
  const blocks = [
    // Common blocks are grouped at the top to prioritize their display
    // in various contexts — like the inserter and auto-complete components.
    paragraph,
    image,
    heading,
    gallery,
    list,
    listItem,
    quote,
    // Register all remaining core blocks.
    accordion,
    accordionItem,
    accordionHeading,
    accordionPanel,
    archives,
    audio,
    button,
    buttons,
    calendar,
    categories,
    code,
    column,
    columns,
    commentAuthorAvatar,
    cover,
    details,
    embed,
    file,
    group,
    html,
    math,
    latestComments,
    latestPosts,
    mediaText,
    missing,
    more,
    nextpage,
    pageList,
    pageListItem,
    pattern,
    preformatted,
    pullquote,
    reusableBlock,
    rss,
    search,
    separator,
    shortcode,
    socialLink,
    socialLinks,
    spacer,
    table,
    tagCloud,
    textColumns,
    verse,
    video,
    footnotes,
    // theme blocks
    navigation,
    navigationLink,
    navigationSubmenu,
    siteLogo,
    siteTitle,
    siteTagline,
    query,
    templatePart,
    avatar,
    postTitle,
    postExcerpt,
    postFeaturedImage,
    postContent,
    postAuthor,
    postAuthorName,
    postComment,
    postCommentsCount,
    postCommentsLink,
    postDate,
    postTerms,
    postNavigationLink,
    postTemplate,
    postTimeToRead,
    queryPagination,
    queryPaginationNext,
    queryPaginationNumbers,
    queryPaginationPrevious,
    queryNoResults,
    queryTotal,
    readMore,
    comments,
    commentAuthorName,
    commentContent,
    commentDate,
    commentEditLink,
    commentReplyLink,
    commentTemplate,
    commentsTitle,
    commentsPagination,
    commentsPaginationNext,
    commentsPaginationNumbers,
    commentsPaginationPrevious,
    postCommentsForm,
    tableOfContents,
    homeLink,
    logInOut,
    termCount,
    termDescription,
    termName,
    termsQuery,
    termTemplate,
    queryTitle,
    postAuthorBiography
  ];
  if (window?.__experimentalEnableBlockExperiments) {
    blocks.push(breadcrumbs);
    blocks.push(tab);
    blocks.push(tabs);
  }
  if (window?.__experimentalEnableFormBlocks) {
    blocks.push(form);
    blocks.push(formInput);
    blocks.push(formSubmitButton);
    blocks.push(formSubmissionNotification);
  }
  if (window?.wp?.oldEditor && (window?.wp?.needsClassicBlock || !window?.__experimentalDisableTinymce || !!new URLSearchParams(window?.location?.search).get(
    "requiresTinymce"
  ))) {
    blocks.push(classic);
  }
  return blocks.filter(Boolean);
};
var __experimentalGetCoreBlocks = () => getAllBlocks().filter(
  ({ metadata }) => !(0, import_is_block_metadata_experimental.default)(metadata)
);
var registerCoreBlocks = (blocks = __experimentalGetCoreBlocks()) => {
  blocks.forEach(({ init }) => init());
  if (window.__unstableAutoRegisterBlocks) {
    window.__unstableAutoRegisterBlocks.forEach((blockName) => {
      const bootstrappedBlockType = (0, import_lock_unlock.unlock)(
        (0, import_data.select)(import_blocks.store)
      ).getBootstrappedBlockType(blockName);
      const bootstrappedApiVersion = bootstrappedBlockType.apiVersion;
      (0, import_blocks.registerBlockType)(blockName, {
        title: blockName,
        ...bootstrappedApiVersion < 3 && { apiVersion: 3 },
        edit: function Edit({ attributes }) {
          const blockProps = (0, import_block_editor.useBlockProps)();
          const { content, status, error } = (0, import_server_side_render.useServerSideRender)({
            block: blockName,
            attributes
          });
          if (status === "loading") {
            return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ...blockProps, children: (0, import_i18n.__)("Loading\u2026") });
          }
          if (status === "error") {
            return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ...blockProps, children: (0, import_i18n.sprintf)(
              /* translators: %s: error message describing the problem */
              (0, import_i18n.__)("Error loading block: %s"),
              error
            ) });
          }
          return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
            "div",
            {
              ...blockProps,
              dangerouslySetInnerHTML: {
                __html: content || ""
              }
            }
          );
        },
        save: () => null
      });
    });
  }
  (0, import_blocks.setDefaultBlockName)(paragraph.name);
  if (window.wp && window.wp.oldEditor && blocks.some(({ name: name5 }) => name5 === classic.name)) {
    (0, import_blocks.setFreeformContentHandlerName)(classic.name);
  }
  (0, import_blocks.setUnregisteredTypeHandlerName)(missing.name);
  (0, import_blocks.setGroupingBlockName)(group.name);
};
var __experimentalRegisterExperimentalCoreBlocks = globalThis.IS_GUTENBERG_PLUGIN ? ({ enableFSEBlocks } = {}) => {
  const enabledExperiments = [enableFSEBlocks ? "fse" : null];
  getAllBlocks().filter(
    ({ metadata }) => (0, import_is_block_metadata_experimental.default)(metadata)
  ).filter(
    ({ metadata: { __experimental } }) => __experimental === true || enabledExperiments.includes(__experimental)
  ).forEach(({ init }) => init());
} : void 0;
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  __experimentalGetCoreBlocks,
  __experimentalRegisterExperimentalCoreBlocks,
  privateApis,
  registerCoreBlocks
});
//# sourceMappingURL=index.js.map
