}; // In test environments, pre-process the sprintf message to improve
// readability of error messages. We'd prefer to avoid pulling in this
// dependency in runtime environments, and it can be dropped by a combo
// of Webpack env substitution + UglifyJS dead code elimination.
// eslint-disable-next-line no-console
error: createLogHandler(console.error),
// eslint-disable-next-line no-console
warning: createLogHandler(console.warn),
getItems: function getItems() {
function createQueuedLogger() {
* The list of enqueued log actions to print.
var logger = createLogger();
error: function error() {
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
warning: function warning() {
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
args[_key3] = arguments[_key3];
getItems: function getItems() {
// EXTERNAL MODULE: external ["wp","isShallowEqual"]
var external_wp_isShallowEqual_ = __webpack_require__("rl8x");
var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_wp_isShallowEqual_);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
var esm_extends = __webpack_require__("wx14");
// EXTERNAL MODULE: external ["wp","compose"]
var external_wp_compose_ = __webpack_require__("K9lf");
// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/block-content-provider/index.js
var _createContext = Object(external_wp_element_["createContext"])(function () {}),
Consumer = _createContext.Consumer,
Provider = _createContext.Provider;
* An internal block component used in block content serialization to inject
* nested block content within the `save` implementation of the ancestor
* component in which it is nested. The component provides a pre-bound
* `BlockContent` component via context, which is used by the developer-facing
* `InnerBlocks.Content` component to render block content.
* <BlockContentProvider innerBlocks={ innerBlocks }>
* </BlockContentProvider>
* @param {Object} props Component props.
* @param {WPElement} props.children Block save result.
* @param {Array} props.innerBlocks Block(s) to serialize.
* @return {WPComponent} Element with BlockContent injected via context.
var block_content_provider_BlockContentProvider = function BlockContentProvider(_ref) {
var children = _ref.children,
innerBlocks = _ref.innerBlocks;
var BlockContent = function BlockContent() {
// Value is an array of blocks, so defer to block serializer
var html = serialize(innerBlocks, {
}); // Use special-cased raw HTML tag to avoid default escaping
return Object(external_wp_element_["createElement"])(external_wp_element_["RawHTML"], null, html);
return Object(external_wp_element_["createElement"])(Provider, {
* A Higher Order Component used to inject BlockContent using context to the
* @return {WPComponent} Enhanced component with injected BlockContent as prop.
var withBlockContentContext = Object(external_wp_compose_["createHigherOrderComponent"])(function (OriginalComponent) {
return function (props) {
return Object(external_wp_element_["createElement"])(Consumer, null, function (context) {
return Object(external_wp_element_["createElement"])(OriginalComponent, Object(esm_extends["a" /* default */])({}, props, {
}, 'withBlockContentContext');
/* harmony default export */ var block_content_provider = (block_content_provider_BlockContentProvider);
// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/serializer.js
function serializer_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function serializer_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { serializer_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { serializer_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
* @typedef {Object} WPBlockSerializationOptions Serialization Options.
* @property {boolean} isInnerBlocks Whether we are serializing inner blocks.
* Returns the block's default classname from its name.
* @param {string} blockName The block name.
* @return {string} The block's default class.
function getBlockDefaultClassName(blockName) {
// Generated HTML classes for blocks follow the `wp-block-{name}` nomenclature.
// Blocks provided by WordPress drop the prefixes 'core/' or 'core-' (historically used in 'core-embed/').
var className = 'wp-block-' + blockName.replace(/\//, '-').replace(/^core-/, '');
return Object(external_wp_hooks_["applyFilters"])('blocks.getBlockDefaultClassName', className, blockName);
* Returns the block's default menu item classname from its name.
* @param {string} blockName The block name.
* @return {string} The block's default menu item class.
function getBlockMenuDefaultClassName(blockName) {
// Generated HTML classes for blocks follow the `editor-block-list-item-{name}` nomenclature.
// Blocks provided by WordPress drop the prefixes 'core/' or 'core-' (historically used in 'core-embed/').
var className = 'editor-block-list-item-' + blockName.replace(/\//, '-').replace(/^core-/, '');
return Object(external_wp_hooks_["applyFilters"])('blocks.getBlockMenuDefaultClassName', className, blockName);
var blockPropsProvider = {};
* Call within a save function to get the props for the block wrapper.
* @param {Object} props Optional. Props to pass to the element.
function getBlockProps() {
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var blockType = blockPropsProvider.blockType,
attributes = blockPropsProvider.attributes;
return Object(external_wp_hooks_["applyFilters"])('blocks.getSaveContent.extraProps', serializer_objectSpread({}, props), blockType, attributes);
* Given a block type containing a save render implementation and attributes, returns the
* enhanced element to be saved or string when raw HTML expected.
* @param {string|Object} blockTypeOrName Block type or name.
* @param {Object} attributes Block attributes.
* @param {?Array} innerBlocks Nested blocks.
* @return {Object|string} Save element or raw HTML string.
function getSaveElement(blockTypeOrName, attributes) {
var innerBlocks = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
var blockType = normalizeBlockType(blockTypeOrName);
var save = blockType.save; // Component classes are unsupported for save since serialization must
// occur synchronously. For improved interoperability with higher-order
// components which often return component class, emulate basic support.
if (save.prototype instanceof external_wp_element_["Component"]) {
var instance = new save({
save = instance.render.bind(instance);
blockPropsProvider.blockType = blockType;
blockPropsProvider.attributes = attributes;
var hasLightBlockWrapper = blockType.apiVersion > 1 || registration_hasBlockSupport(blockType, 'lightBlockWrapper', false);
if (Object(external_lodash_["isObject"])(element) && Object(external_wp_hooks_["hasFilter"])('blocks.getSaveContent.extraProps') && !hasLightBlockWrapper) {
* Filters the props applied to the block save result element.
* @param {Object} props Props applied to save element.
* @param {WPBlock} blockType Block type definition.
* @param {Object} attributes Block attributes.
var props = Object(external_wp_hooks_["applyFilters"])('blocks.getSaveContent.extraProps', serializer_objectSpread({}, element.props), blockType, attributes);
if (!external_wp_isShallowEqual_default()(props, element.props)) {
element = Object(external_wp_element_["cloneElement"])(element, props);
* Filters the save result of a block during serialization.
* @param {WPElement} element Block save result.
* @param {WPBlock} blockType Block type definition.
* @param {Object} attributes Block attributes.
element = Object(external_wp_hooks_["applyFilters"])('blocks.getSaveElement', element, blockType, attributes);
return Object(external_wp_element_["createElement"])(block_content_provider, {
* Given a block type containing a save render implementation and attributes, returns the
* static markup to be saved.
* @param {string|Object} blockTypeOrName Block type or name.
* @param {Object} attributes Block attributes.
* @param {?Array} innerBlocks Nested blocks.
* @return {string} Save content.
function getSaveContent(blockTypeOrName, attributes, innerBlocks) {
var blockType = normalizeBlockType(blockTypeOrName);
return Object(external_wp_element_["renderToString"])(getSaveElement(blockType, attributes, innerBlocks));
* Returns attributes which are to be saved and serialized into the block
* When a block exists in memory it contains as its attributes both those
* parsed the block comment delimiter _and_ those which matched from the
* This function returns only those attributes which are needed to persist and
* which cannot be matched from the block content.
* @param {Object<string,*>} blockType Block type.
* @param {Object<string,*>} attributes Attributes from in-memory block data.
* @return {Object<string,*>} Subset of attributes for comment serialization.
function getCommentAttributes(blockType, attributes) {
return Object(external_lodash_["reduce"])(blockType.attributes, function (accumulator, attributeSchema, key) {
var value = attributes[key]; // Ignore undefined values.
if (undefined === value) {
} // Ignore all attributes but the ones with an "undefined" source
// "undefined" source refers to attributes saved in the block comment.
if (attributeSchema.source !== undefined) {
} // Ignore default value.
if ('default' in attributeSchema && attributeSchema.default === value) {
} // Otherwise, include in comment set.
accumulator[key] = value;
* Given an attributes object, returns a string in the serialized attributes
* format prepared for post content.
* @param {Object} attributes Attributes object.
* @return {string} Serialized attributes.
function serializeAttributes(attributes) {
return JSON.stringify(attributes) // Don't break HTML comments.
.replace(/--/g, "\\u002d\\u002d") // Don't break non-standard-compliant tools.
.replace(/</g, "\\u003c").replace(/>/g, "\\u003e").replace(/&/g, "\\u0026") // Bypass server stripslashes behavior which would unescape stringify's
// escaping of quotation mark.
// See: https://developer.wordpress.org/reference/functions/wp_kses_stripslashes/
.replace(/\\"/g, "\\u0022");
* Given a block object, returns the Block's Inner HTML markup.
* @param {Object} block Block instance.
function getBlockContent(block) {
// @todo why not getBlockInnerHtml?
// If block was parsed as invalid or encounters an error while generating
// save content, use original content instead to avoid content loss. If a
// block contains nested content, exempt it from this condition because we
// otherwise have no access to its original content and content loss would
var saveContent = block.originalContent;
if (block.isValid || block.innerBlocks.length) {
saveContent = getSaveContent(block.name, block.attributes, block.innerBlocks);
* Returns the content of a block, including comment delimiters.
* @param {string} rawBlockName Block name.
* @param {Object} attributes Block attributes.
* @param {string} content Block save content.
* @return {string} Comment-delimited block content.
function getCommentDelimitedContent(rawBlockName, attributes, content) {
var serializedAttributes = !Object(external_lodash_["isEmpty"])(attributes) ? serializeAttributes(attributes) + ' ' : ''; // Strip core blocks of their namespace prefix.
var blockName = Object(external_lodash_["startsWith"])(rawBlockName, 'core/') ? rawBlockName.slice(5) : rawBlockName; // @todo make the `wp:` prefix potentially configurable.
return "<!-- wp:".concat(blockName, " ").concat(serializedAttributes, "/-->");
return "<!-- wp:".concat(blockName, " ").concat(serializedAttributes, "-->\n") + content + "\n<!-- /wp:".concat(blockName, " -->");
* Returns the content of a block, including comment delimiters, determining
* serialized attributes and content form from the current state of the block.
* @param {Object} block Block instance.
* @param {WPBlockSerializationOptions} options Serialization options.
* @return {string} Serialized block.
function serializeBlock(block) {
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
_ref$isInnerBlocks = _ref.isInnerBlocks,
isInnerBlocks = _ref$isInnerBlocks === void 0 ? false : _ref$isInnerBlocks;
var blockName = block.name;
var saveContent = getBlockContent(block);
if (blockName === getUnregisteredTypeHandlerName() || !isInnerBlocks && blockName === getFreeformContentHandlerName()) {
var blockType = registration_getBlockType(blockName);
var saveAttributes = getCommentAttributes(blockType, block.attributes);
return getCommentDelimitedContent(blockName, saveAttributes, saveContent);
function __unstableSerializeAndClean(blocks) {
// A single unmodified default block is assumed to
// be equivalent to an empty post.
if (blocks.length === 1 && isUnmodifiedDefaultBlock(blocks[0])) {
var content = serialize(blocks); // For compatibility, treat a post consisting of a
// single freeform block as legacy content and apply
// pre-block-editor removep'd content formatting.
if (blocks.length === 1 && blocks[0].name === getFreeformContentHandlerName()) {
content = Object(external_wp_autop_["removep"])(content);
* Takes a block or set of blocks and returns the serialized post content.
* @param {Array} blocks Block(s) to serialize.
* @param {WPBlockSerializationOptions} options Serialization options.
* @return {string} The post content.
function serialize(blocks, options) {
return Object(external_lodash_["castArray"])(blocks).map(function (block) {
return serializeBlock(block, options);
// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/validation/index.js
function validation_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function validation_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { validation_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { validation_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
* Globally matches any consecutive whitespace
var REGEXP_WHITESPACE = /[\t\n\r\v\f ]+/g;
* Matches a string containing only whitespace
var REGEXP_ONLY_WHITESPACE = /^[\t\n\r\v\f ]*$/;