"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = buildNavigationLabel;
var _i18n = require("@wordpress/i18n");
var _htmlEntities = require("@wordpress/html-entities");
/**
 * WordPress dependencies
 */

// Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.js.
function buildNavigationLabel(title, id, status) {
  if (!title?.rendered) {
    /* translators: %s is the index of the menu in the list of menus. */
    return (0, _i18n.sprintf)((0, _i18n.__)('(no title %s)'), id);
  }
  if (status === 'publish') {
    return (0, _htmlEntities.decodeEntities)(title?.rendered);
  }
  return (0, _i18n.sprintf)(
  // translators: %1s: title of the menu; %2s: status of the menu (draft, pending, etc.).
  (0, _i18n.__)('%1$s (%2$s)'), (0, _htmlEntities.decodeEntities)(title?.rendered), status);
}
//# sourceMappingURL=build-navigation-label.js.map