wp/wp-includes/js/dist/core-data.js
changeset 19 3d72ae0968f4
parent 18 be944660c56a
child 21 48c4eec2b7e6
equal deleted inserted replaced
18:be944660c56a 19:3d72ae0968f4
     1 this["wp"] = this["wp"] || {}; this["wp"]["coreData"] =
     1 /******/ (function() { // webpackBootstrap
     2 /******/ (function(modules) { // webpackBootstrap
     2 /******/ 	var __webpack_modules__ = ({
     3 /******/ 	// The module cache
     3 
     4 /******/ 	var installedModules = {};
     4 /***/ 2167:
     5 /******/
     5 /***/ (function(module) {
     6 /******/ 	// The require function
       
     7 /******/ 	function __webpack_require__(moduleId) {
       
     8 /******/
       
     9 /******/ 		// Check if module is in cache
       
    10 /******/ 		if(installedModules[moduleId]) {
       
    11 /******/ 			return installedModules[moduleId].exports;
       
    12 /******/ 		}
       
    13 /******/ 		// Create a new module (and put it into the cache)
       
    14 /******/ 		var module = installedModules[moduleId] = {
       
    15 /******/ 			i: moduleId,
       
    16 /******/ 			l: false,
       
    17 /******/ 			exports: {}
       
    18 /******/ 		};
       
    19 /******/
       
    20 /******/ 		// Execute the module function
       
    21 /******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
       
    22 /******/
       
    23 /******/ 		// Flag the module as loaded
       
    24 /******/ 		module.l = true;
       
    25 /******/
       
    26 /******/ 		// Return the exports of the module
       
    27 /******/ 		return module.exports;
       
    28 /******/ 	}
       
    29 /******/
       
    30 /******/
       
    31 /******/ 	// expose the modules object (__webpack_modules__)
       
    32 /******/ 	__webpack_require__.m = modules;
       
    33 /******/
       
    34 /******/ 	// expose the module cache
       
    35 /******/ 	__webpack_require__.c = installedModules;
       
    36 /******/
       
    37 /******/ 	// define getter function for harmony exports
       
    38 /******/ 	__webpack_require__.d = function(exports, name, getter) {
       
    39 /******/ 		if(!__webpack_require__.o(exports, name)) {
       
    40 /******/ 			Object.defineProperty(exports, name, { enumerable: true, get: getter });
       
    41 /******/ 		}
       
    42 /******/ 	};
       
    43 /******/
       
    44 /******/ 	// define __esModule on exports
       
    45 /******/ 	__webpack_require__.r = function(exports) {
       
    46 /******/ 		if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
       
    47 /******/ 			Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
       
    48 /******/ 		}
       
    49 /******/ 		Object.defineProperty(exports, '__esModule', { value: true });
       
    50 /******/ 	};
       
    51 /******/
       
    52 /******/ 	// create a fake namespace object
       
    53 /******/ 	// mode & 1: value is a module id, require it
       
    54 /******/ 	// mode & 2: merge all properties of value into the ns
       
    55 /******/ 	// mode & 4: return value when already ns object
       
    56 /******/ 	// mode & 8|1: behave like require
       
    57 /******/ 	__webpack_require__.t = function(value, mode) {
       
    58 /******/ 		if(mode & 1) value = __webpack_require__(value);
       
    59 /******/ 		if(mode & 8) return value;
       
    60 /******/ 		if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
       
    61 /******/ 		var ns = Object.create(null);
       
    62 /******/ 		__webpack_require__.r(ns);
       
    63 /******/ 		Object.defineProperty(ns, 'default', { enumerable: true, value: value });
       
    64 /******/ 		if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
       
    65 /******/ 		return ns;
       
    66 /******/ 	};
       
    67 /******/
       
    68 /******/ 	// getDefaultExport function for compatibility with non-harmony modules
       
    69 /******/ 	__webpack_require__.n = function(module) {
       
    70 /******/ 		var getter = module && module.__esModule ?
       
    71 /******/ 			function getDefault() { return module['default']; } :
       
    72 /******/ 			function getModuleExports() { return module; };
       
    73 /******/ 		__webpack_require__.d(getter, 'a', getter);
       
    74 /******/ 		return getter;
       
    75 /******/ 	};
       
    76 /******/
       
    77 /******/ 	// Object.prototype.hasOwnProperty.call
       
    78 /******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
       
    79 /******/
       
    80 /******/ 	// __webpack_public_path__
       
    81 /******/ 	__webpack_require__.p = "";
       
    82 /******/
       
    83 /******/
       
    84 /******/ 	// Load entry module and return exports
       
    85 /******/ 	return __webpack_require__(__webpack_require__.s = "dsJ0");
       
    86 /******/ })
       
    87 /************************************************************************/
       
    88 /******/ ({
       
    89 
       
    90 /***/ "1ZqX":
       
    91 /***/ (function(module, exports) {
       
    92 
       
    93 (function() { module.exports = window["wp"]["data"]; }());
       
    94 
       
    95 /***/ }),
       
    96 
       
    97 /***/ "51Zz":
       
    98 /***/ (function(module, exports) {
       
    99 
       
   100 (function() { module.exports = window["wp"]["dataControls"]; }());
       
   101 
       
   102 /***/ }),
       
   103 
       
   104 /***/ "7Cbv":
       
   105 /***/ (function(module, __webpack_exports__, __webpack_require__) {
       
   106 
       
   107 "use strict";
       
   108 
       
   109 // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/rng.js
       
   110 // Unique ID creation requires a high quality random # generator. In the browser we therefore
       
   111 // require the crypto API and do not support built-in fallback to lower quality random number
       
   112 // generators (like Math.random()).
       
   113 var getRandomValues;
       
   114 var rnds8 = new Uint8Array(16);
       
   115 function rng() {
       
   116   // lazy load so that environments that need to polyfill have a chance to do so
       
   117   if (!getRandomValues) {
       
   118     // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also,
       
   119     // find the complete implementation of crypto (msCrypto) on IE11.
       
   120     getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);
       
   121 
       
   122     if (!getRandomValues) {
       
   123       throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
       
   124     }
       
   125   }
       
   126 
       
   127   return getRandomValues(rnds8);
       
   128 }
       
   129 // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/regex.js
       
   130 /* harmony default export */ var regex = (/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i);
       
   131 // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/validate.js
       
   132 
       
   133 
       
   134 function validate(uuid) {
       
   135   return typeof uuid === 'string' && regex.test(uuid);
       
   136 }
       
   137 
       
   138 /* harmony default export */ var esm_browser_validate = (validate);
       
   139 // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/stringify.js
       
   140 
       
   141 /**
       
   142  * Convert array of 16 byte values to UUID string format of the form:
       
   143  * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
       
   144  */
       
   145 
       
   146 var byteToHex = [];
       
   147 
       
   148 for (var stringify_i = 0; stringify_i < 256; ++stringify_i) {
       
   149   byteToHex.push((stringify_i + 0x100).toString(16).substr(1));
       
   150 }
       
   151 
       
   152 function stringify(arr) {
       
   153   var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
       
   154   // Note: Be careful editing this code!  It's been tuned for performance
       
   155   // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
       
   156   var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID.  If this throws, it's likely due to one
       
   157   // of the following:
       
   158   // - One or more input array values don't map to a hex octet (leading to
       
   159   // "undefined" in the uuid)
       
   160   // - Invalid input values for the RFC `version` or `variant` fields
       
   161 
       
   162   if (!esm_browser_validate(uuid)) {
       
   163     throw TypeError('Stringified UUID is invalid');
       
   164   }
       
   165 
       
   166   return uuid;
       
   167 }
       
   168 
       
   169 /* harmony default export */ var esm_browser_stringify = (stringify);
       
   170 // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/v4.js
       
   171 
       
   172 
       
   173 
       
   174 function v4(options, buf, offset) {
       
   175   options = options || {};
       
   176   var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
       
   177 
       
   178   rnds[6] = rnds[6] & 0x0f | 0x40;
       
   179   rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
       
   180 
       
   181   if (buf) {
       
   182     offset = offset || 0;
       
   183 
       
   184     for (var i = 0; i < 16; ++i) {
       
   185       buf[offset + i] = rnds[i];
       
   186     }
       
   187 
       
   188     return buf;
       
   189   }
       
   190 
       
   191   return esm_browser_stringify(rnds);
       
   192 }
       
   193 
       
   194 /* harmony default export */ var esm_browser_v4 = __webpack_exports__["a"] = (v4);
       
   195 
       
   196 /***/ }),
       
   197 
       
   198 /***/ "FtRg":
       
   199 /***/ (function(module, exports, __webpack_require__) {
       
   200 
     6 
   201 "use strict";
     7 "use strict";
   202 
     8 
   203 
     9 
   204 function _typeof(obj) {
    10 function _typeof(obj) {
   508 module.exports = EquivalentKeyMap;
   314 module.exports = EquivalentKeyMap;
   509 
   315 
   510 
   316 
   511 /***/ }),
   317 /***/ }),
   512 
   318 
   513 /***/ "GRId":
   319 /***/ 9756:
   514 /***/ (function(module, exports) {
   320 /***/ (function(module) {
   515 
   321 
   516 (function() { module.exports = window["wp"]["element"]; }());
   322 /**
   517 
   323  * Memize options object.
   518 /***/ }),
   324  *
   519 
   325  * @typedef MemizeOptions
   520 /***/ "HSyU":
   326  *
   521 /***/ (function(module, exports) {
   327  * @property {number} [maxSize] Maximum size of the cache.
   522 
   328  */
   523 (function() { module.exports = window["wp"]["blocks"]; }());
   329 
   524 
   330 /**
   525 /***/ }),
   331  * Internal cache entry.
   526 
   332  *
   527 /***/ "Mmq9":
   333  * @typedef MemizeCacheNode
   528 /***/ (function(module, exports) {
   334  *
   529 
   335  * @property {?MemizeCacheNode|undefined} [prev] Previous node.
   530 (function() { module.exports = window["wp"]["url"]; }());
   336  * @property {?MemizeCacheNode|undefined} [next] Next node.
   531 
   337  * @property {Array<*>}                   args   Function arguments for cache
   532 /***/ }),
   338  *                                               entry.
   533 
   339  * @property {*}                          val    Function result.
   534 /***/ "YLtl":
   340  */
   535 /***/ (function(module, exports) {
   341 
   536 
   342 /**
   537 (function() { module.exports = window["lodash"]; }());
   343  * Properties of the enhanced function for controlling cache.
   538 
   344  *
   539 /***/ }),
   345  * @typedef MemizeMemoizedFunction
   540 
   346  *
   541 /***/ "dsJ0":
   347  * @property {()=>void} clear Clear the cache.
   542 /***/ (function(module, __webpack_exports__, __webpack_require__) {
   348  */
   543 
   349 
       
   350 /**
       
   351  * Accepts a function to be memoized, and returns a new memoized function, with
       
   352  * optional options.
       
   353  *
       
   354  * @template {Function} F
       
   355  *
       
   356  * @param {F}             fn        Function to memoize.
       
   357  * @param {MemizeOptions} [options] Options object.
       
   358  *
       
   359  * @return {F & MemizeMemoizedFunction} Memoized function.
       
   360  */
       
   361 function memize( fn, options ) {
       
   362 	var size = 0;
       
   363 
       
   364 	/** @type {?MemizeCacheNode|undefined} */
       
   365 	var head;
       
   366 
       
   367 	/** @type {?MemizeCacheNode|undefined} */
       
   368 	var tail;
       
   369 
       
   370 	options = options || {};
       
   371 
       
   372 	function memoized( /* ...args */ ) {
       
   373 		var node = head,
       
   374 			len = arguments.length,
       
   375 			args, i;
       
   376 
       
   377 		searchCache: while ( node ) {
       
   378 			// Perform a shallow equality test to confirm that whether the node
       
   379 			// under test is a candidate for the arguments passed. Two arrays
       
   380 			// are shallowly equal if their length matches and each entry is
       
   381 			// strictly equal between the two sets. Avoid abstracting to a
       
   382 			// function which could incur an arguments leaking deoptimization.
       
   383 
       
   384 			// Check whether node arguments match arguments length
       
   385 			if ( node.args.length !== arguments.length ) {
       
   386 				node = node.next;
       
   387 				continue;
       
   388 			}
       
   389 
       
   390 			// Check whether node arguments match arguments values
       
   391 			for ( i = 0; i < len; i++ ) {
       
   392 				if ( node.args[ i ] !== arguments[ i ] ) {
       
   393 					node = node.next;
       
   394 					continue searchCache;
       
   395 				}
       
   396 			}
       
   397 
       
   398 			// At this point we can assume we've found a match
       
   399 
       
   400 			// Surface matched node to head if not already
       
   401 			if ( node !== head ) {
       
   402 				// As tail, shift to previous. Must only shift if not also
       
   403 				// head, since if both head and tail, there is no previous.
       
   404 				if ( node === tail ) {
       
   405 					tail = node.prev;
       
   406 				}
       
   407 
       
   408 				// Adjust siblings to point to each other. If node was tail,
       
   409 				// this also handles new tail's empty `next` assignment.
       
   410 				/** @type {MemizeCacheNode} */ ( node.prev ).next = node.next;
       
   411 				if ( node.next ) {
       
   412 					node.next.prev = node.prev;
       
   413 				}
       
   414 
       
   415 				node.next = head;
       
   416 				node.prev = null;
       
   417 				/** @type {MemizeCacheNode} */ ( head ).prev = node;
       
   418 				head = node;
       
   419 			}
       
   420 
       
   421 			// Return immediately
       
   422 			return node.val;
       
   423 		}
       
   424 
       
   425 		// No cached value found. Continue to insertion phase:
       
   426 
       
   427 		// Create a copy of arguments (avoid leaking deoptimization)
       
   428 		args = new Array( len );
       
   429 		for ( i = 0; i < len; i++ ) {
       
   430 			args[ i ] = arguments[ i ];
       
   431 		}
       
   432 
       
   433 		node = {
       
   434 			args: args,
       
   435 
       
   436 			// Generate the result from original function
       
   437 			val: fn.apply( null, args ),
       
   438 		};
       
   439 
       
   440 		// Don't need to check whether node is already head, since it would
       
   441 		// have been returned above already if it was
       
   442 
       
   443 		// Shift existing head down list
       
   444 		if ( head ) {
       
   445 			head.prev = node;
       
   446 			node.next = head;
       
   447 		} else {
       
   448 			// If no head, follows that there's no tail (at initial or reset)
       
   449 			tail = node;
       
   450 		}
       
   451 
       
   452 		// Trim tail if we're reached max size and are pending cache insertion
       
   453 		if ( size === /** @type {MemizeOptions} */ ( options ).maxSize ) {
       
   454 			tail = /** @type {MemizeCacheNode} */ ( tail ).prev;
       
   455 			/** @type {MemizeCacheNode} */ ( tail ).next = null;
       
   456 		} else {
       
   457 			size++;
       
   458 		}
       
   459 
       
   460 		head = node;
       
   461 
       
   462 		return node.val;
       
   463 	}
       
   464 
       
   465 	memoized.clear = function() {
       
   466 		head = null;
       
   467 		tail = null;
       
   468 		size = 0;
       
   469 	};
       
   470 
       
   471 	if ( false ) {}
       
   472 
       
   473 	// Ignore reason: There's not a clear solution to create an intersection of
       
   474 	// the function with additional properties, where the goal is to retain the
       
   475 	// function signature of the incoming argument and add control properties
       
   476 	// on the return value.
       
   477 
       
   478 	// @ts-ignore
       
   479 	return memoized;
       
   480 }
       
   481 
       
   482 module.exports = memize;
       
   483 
       
   484 
       
   485 /***/ })
       
   486 
       
   487 /******/ 	});
       
   488 /************************************************************************/
       
   489 /******/ 	// The module cache
       
   490 /******/ 	var __webpack_module_cache__ = {};
       
   491 /******/ 	
       
   492 /******/ 	// The require function
       
   493 /******/ 	function __webpack_require__(moduleId) {
       
   494 /******/ 		// Check if module is in cache
       
   495 /******/ 		var cachedModule = __webpack_module_cache__[moduleId];
       
   496 /******/ 		if (cachedModule !== undefined) {
       
   497 /******/ 			return cachedModule.exports;
       
   498 /******/ 		}
       
   499 /******/ 		// Create a new module (and put it into the cache)
       
   500 /******/ 		var module = __webpack_module_cache__[moduleId] = {
       
   501 /******/ 			// no module.id needed
       
   502 /******/ 			// no module.loaded needed
       
   503 /******/ 			exports: {}
       
   504 /******/ 		};
       
   505 /******/ 	
       
   506 /******/ 		// Execute the module function
       
   507 /******/ 		__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
       
   508 /******/ 	
       
   509 /******/ 		// Return the exports of the module
       
   510 /******/ 		return module.exports;
       
   511 /******/ 	}
       
   512 /******/ 	
       
   513 /************************************************************************/
       
   514 /******/ 	/* webpack/runtime/compat get default export */
       
   515 /******/ 	!function() {
       
   516 /******/ 		// getDefaultExport function for compatibility with non-harmony modules
       
   517 /******/ 		__webpack_require__.n = function(module) {
       
   518 /******/ 			var getter = module && module.__esModule ?
       
   519 /******/ 				function() { return module['default']; } :
       
   520 /******/ 				function() { return module; };
       
   521 /******/ 			__webpack_require__.d(getter, { a: getter });
       
   522 /******/ 			return getter;
       
   523 /******/ 		};
       
   524 /******/ 	}();
       
   525 /******/ 	
       
   526 /******/ 	/* webpack/runtime/define property getters */
       
   527 /******/ 	!function() {
       
   528 /******/ 		// define getter functions for harmony exports
       
   529 /******/ 		__webpack_require__.d = function(exports, definition) {
       
   530 /******/ 			for(var key in definition) {
       
   531 /******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
       
   532 /******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
       
   533 /******/ 				}
       
   534 /******/ 			}
       
   535 /******/ 		};
       
   536 /******/ 	}();
       
   537 /******/ 	
       
   538 /******/ 	/* webpack/runtime/hasOwnProperty shorthand */
       
   539 /******/ 	!function() {
       
   540 /******/ 		__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
       
   541 /******/ 	}();
       
   542 /******/ 	
       
   543 /******/ 	/* webpack/runtime/make namespace object */
       
   544 /******/ 	!function() {
       
   545 /******/ 		// define __esModule on exports
       
   546 /******/ 		__webpack_require__.r = function(exports) {
       
   547 /******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
       
   548 /******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
       
   549 /******/ 			}
       
   550 /******/ 			Object.defineProperty(exports, '__esModule', { value: true });
       
   551 /******/ 		};
       
   552 /******/ 	}();
       
   553 /******/ 	
       
   554 /************************************************************************/
       
   555 var __webpack_exports__ = {};
       
   556 // This entry need to be wrapped in an IIFE because it need to be in strict mode.
       
   557 !function() {
   544 "use strict";
   558 "use strict";
   545 // ESM COMPAT FLAG
   559 // ESM COMPAT FLAG
   546 __webpack_require__.r(__webpack_exports__);
   560 __webpack_require__.r(__webpack_exports__);
   547 
   561 
   548 // EXPORTS
   562 // EXPORTS
   549 __webpack_require__.d(__webpack_exports__, "store", function() { return /* binding */ build_module_store; });
   563 __webpack_require__.d(__webpack_exports__, {
   550 __webpack_require__.d(__webpack_exports__, "EntityProvider", function() { return /* reexport */ EntityProvider; });
   564   "EntityProvider": function() { return /* reexport */ EntityProvider; },
   551 __webpack_require__.d(__webpack_exports__, "useEntityId", function() { return /* reexport */ useEntityId; });
   565   "__experimentalFetchLinkSuggestions": function() { return /* reexport */ _experimental_fetch_link_suggestions; },
   552 __webpack_require__.d(__webpack_exports__, "useEntityProp", function() { return /* reexport */ useEntityProp; });
   566   "__experimentalFetchUrlData": function() { return /* reexport */ _experimental_fetch_url_data; },
   553 __webpack_require__.d(__webpack_exports__, "useEntityBlockEditor", function() { return /* reexport */ useEntityBlockEditor; });
   567   "__experimentalUseEntityRecord": function() { return /* reexport */ __experimentalUseEntityRecord; },
   554 __webpack_require__.d(__webpack_exports__, "__experimentalFetchLinkSuggestions", function() { return /* reexport */ _experimental_fetch_link_suggestions; });
   568   "__experimentalUseEntityRecords": function() { return /* reexport */ __experimentalUseEntityRecords; },
   555 __webpack_require__.d(__webpack_exports__, "__experimentalFetchRemoteUrlData", function() { return /* reexport */ _experimental_fetch_remote_url_data; });
   569   "store": function() { return /* binding */ store; },
   556 
   570   "useEntityBlockEditor": function() { return /* reexport */ useEntityBlockEditor; },
   557 // NAMESPACE OBJECT: ./node_modules/@wordpress/core-data/build-module/locks/actions.js
   571   "useEntityId": function() { return /* reexport */ useEntityId; },
   558 var locks_actions_namespaceObject = {};
   572   "useEntityProp": function() { return /* reexport */ useEntityProp; }
   559 __webpack_require__.r(locks_actions_namespaceObject);
   573 });
   560 __webpack_require__.d(locks_actions_namespaceObject, "__unstableAcquireStoreLock", function() { return __unstableAcquireStoreLock; });
       
   561 __webpack_require__.d(locks_actions_namespaceObject, "__unstableEnqueueLockRequest", function() { return __unstableEnqueueLockRequest; });
       
   562 __webpack_require__.d(locks_actions_namespaceObject, "__unstableReleaseStoreLock", function() { return __unstableReleaseStoreLock; });
       
   563 __webpack_require__.d(locks_actions_namespaceObject, "__unstableProcessPendingLockRequests", function() { return __unstableProcessPendingLockRequests; });
       
   564 
   574 
   565 // NAMESPACE OBJECT: ./node_modules/@wordpress/core-data/build-module/actions.js
   575 // NAMESPACE OBJECT: ./node_modules/@wordpress/core-data/build-module/actions.js
   566 var build_module_actions_namespaceObject = {};
   576 var build_module_actions_namespaceObject = {};
   567 __webpack_require__.r(build_module_actions_namespaceObject);
   577 __webpack_require__.r(build_module_actions_namespaceObject);
   568 __webpack_require__.d(build_module_actions_namespaceObject, "receiveUserQuery", function() { return receiveUserQuery; });
   578 __webpack_require__.d(build_module_actions_namespaceObject, {
   569 __webpack_require__.d(build_module_actions_namespaceObject, "receiveCurrentUser", function() { return receiveCurrentUser; });
   579   "__experimentalBatch": function() { return __experimentalBatch; },
   570 __webpack_require__.d(build_module_actions_namespaceObject, "addEntities", function() { return addEntities; });
   580   "__experimentalReceiveCurrentGlobalStylesId": function() { return __experimentalReceiveCurrentGlobalStylesId; },
   571 __webpack_require__.d(build_module_actions_namespaceObject, "receiveEntityRecords", function() { return receiveEntityRecords; });
   581   "__experimentalReceiveThemeBaseGlobalStyles": function() { return __experimentalReceiveThemeBaseGlobalStyles; },
   572 __webpack_require__.d(build_module_actions_namespaceObject, "receiveCurrentTheme", function() { return receiveCurrentTheme; });
   582   "__experimentalReceiveThemeGlobalStyleVariations": function() { return __experimentalReceiveThemeGlobalStyleVariations; },
   573 __webpack_require__.d(build_module_actions_namespaceObject, "receiveThemeSupports", function() { return receiveThemeSupports; });
   583   "__experimentalSaveSpecifiedEntityEdits": function() { return __experimentalSaveSpecifiedEntityEdits; },
   574 __webpack_require__.d(build_module_actions_namespaceObject, "receiveEmbedPreview", function() { return receiveEmbedPreview; });
   584   "__unstableCreateUndoLevel": function() { return __unstableCreateUndoLevel; },
   575 __webpack_require__.d(build_module_actions_namespaceObject, "deleteEntityRecord", function() { return deleteEntityRecord; });
   585   "addEntities": function() { return addEntities; },
   576 __webpack_require__.d(build_module_actions_namespaceObject, "editEntityRecord", function() { return actions_editEntityRecord; });
   586   "deleteEntityRecord": function() { return deleteEntityRecord; },
   577 __webpack_require__.d(build_module_actions_namespaceObject, "undo", function() { return undo; });
   587   "editEntityRecord": function() { return editEntityRecord; },
   578 __webpack_require__.d(build_module_actions_namespaceObject, "redo", function() { return redo; });
   588   "receiveAutosaves": function() { return receiveAutosaves; },
   579 __webpack_require__.d(build_module_actions_namespaceObject, "__unstableCreateUndoLevel", function() { return actions_unstableCreateUndoLevel; });
   589   "receiveCurrentTheme": function() { return receiveCurrentTheme; },
   580 __webpack_require__.d(build_module_actions_namespaceObject, "saveEntityRecord", function() { return saveEntityRecord; });
   590   "receiveCurrentUser": function() { return receiveCurrentUser; },
   581 __webpack_require__.d(build_module_actions_namespaceObject, "__experimentalBatch", function() { return __experimentalBatch; });
   591   "receiveEmbedPreview": function() { return receiveEmbedPreview; },
   582 __webpack_require__.d(build_module_actions_namespaceObject, "saveEditedEntityRecord", function() { return saveEditedEntityRecord; });
   592   "receiveEntityRecords": function() { return receiveEntityRecords; },
   583 __webpack_require__.d(build_module_actions_namespaceObject, "__experimentalSaveSpecifiedEntityEdits", function() { return __experimentalSaveSpecifiedEntityEdits; });
   593   "receiveThemeSupports": function() { return receiveThemeSupports; },
   584 __webpack_require__.d(build_module_actions_namespaceObject, "receiveUploadPermissions", function() { return receiveUploadPermissions; });
   594   "receiveUploadPermissions": function() { return receiveUploadPermissions; },
   585 __webpack_require__.d(build_module_actions_namespaceObject, "receiveUserPermission", function() { return receiveUserPermission; });
   595   "receiveUserPermission": function() { return receiveUserPermission; },
   586 __webpack_require__.d(build_module_actions_namespaceObject, "receiveAutosaves", function() { return receiveAutosaves; });
   596   "receiveUserQuery": function() { return receiveUserQuery; },
       
   597   "redo": function() { return redo; },
       
   598   "saveEditedEntityRecord": function() { return saveEditedEntityRecord; },
       
   599   "saveEntityRecord": function() { return saveEntityRecord; },
       
   600   "undo": function() { return undo; }
       
   601 });
   587 
   602 
   588 // NAMESPACE OBJECT: ./node_modules/@wordpress/core-data/build-module/selectors.js
   603 // NAMESPACE OBJECT: ./node_modules/@wordpress/core-data/build-module/selectors.js
   589 var build_module_selectors_namespaceObject = {};
   604 var build_module_selectors_namespaceObject = {};
   590 __webpack_require__.r(build_module_selectors_namespaceObject);
   605 __webpack_require__.r(build_module_selectors_namespaceObject);
   591 __webpack_require__.d(build_module_selectors_namespaceObject, "isRequestingEmbedPreview", function() { return isRequestingEmbedPreview; });
   606 __webpack_require__.d(build_module_selectors_namespaceObject, {
   592 __webpack_require__.d(build_module_selectors_namespaceObject, "getAuthors", function() { return getAuthors; });
   607   "__experimentalGetCurrentGlobalStylesId": function() { return __experimentalGetCurrentGlobalStylesId; },
   593 __webpack_require__.d(build_module_selectors_namespaceObject, "__unstableGetAuthor", function() { return __unstableGetAuthor; });
   608   "__experimentalGetCurrentThemeBaseGlobalStyles": function() { return __experimentalGetCurrentThemeBaseGlobalStyles; },
   594 __webpack_require__.d(build_module_selectors_namespaceObject, "getCurrentUser", function() { return getCurrentUser; });
   609   "__experimentalGetCurrentThemeGlobalStylesVariations": function() { return __experimentalGetCurrentThemeGlobalStylesVariations; },
   595 __webpack_require__.d(build_module_selectors_namespaceObject, "getUserQueryResults", function() { return getUserQueryResults; });
   610   "__experimentalGetDirtyEntityRecords": function() { return __experimentalGetDirtyEntityRecords; },
   596 __webpack_require__.d(build_module_selectors_namespaceObject, "getEntitiesByKind", function() { return getEntitiesByKind; });
   611   "__experimentalGetEntitiesBeingSaved": function() { return __experimentalGetEntitiesBeingSaved; },
   597 __webpack_require__.d(build_module_selectors_namespaceObject, "getEntity", function() { return getEntity; });
   612   "__experimentalGetEntityRecordNoResolver": function() { return __experimentalGetEntityRecordNoResolver; },
   598 __webpack_require__.d(build_module_selectors_namespaceObject, "getEntityRecord", function() { return getEntityRecord; });
   613   "__experimentalGetTemplateForLink": function() { return __experimentalGetTemplateForLink; },
   599 __webpack_require__.d(build_module_selectors_namespaceObject, "__experimentalGetEntityRecordNoResolver", function() { return __experimentalGetEntityRecordNoResolver; });
   614   "canUser": function() { return canUser; },
   600 __webpack_require__.d(build_module_selectors_namespaceObject, "getRawEntityRecord", function() { return getRawEntityRecord; });
   615   "canUserEditEntityRecord": function() { return canUserEditEntityRecord; },
   601 __webpack_require__.d(build_module_selectors_namespaceObject, "hasEntityRecords", function() { return hasEntityRecords; });
   616   "getAuthors": function() { return getAuthors; },
   602 __webpack_require__.d(build_module_selectors_namespaceObject, "getEntityRecords", function() { return getEntityRecords; });
   617   "getAutosave": function() { return getAutosave; },
   603 __webpack_require__.d(build_module_selectors_namespaceObject, "__experimentalGetDirtyEntityRecords", function() { return __experimentalGetDirtyEntityRecords; });
   618   "getAutosaves": function() { return getAutosaves; },
   604 __webpack_require__.d(build_module_selectors_namespaceObject, "getEntityRecordEdits", function() { return getEntityRecordEdits; });
   619   "getBlockPatternCategories": function() { return getBlockPatternCategories; },
   605 __webpack_require__.d(build_module_selectors_namespaceObject, "getEntityRecordNonTransientEdits", function() { return getEntityRecordNonTransientEdits; });
   620   "getBlockPatterns": function() { return getBlockPatterns; },
   606 __webpack_require__.d(build_module_selectors_namespaceObject, "hasEditsForEntityRecord", function() { return hasEditsForEntityRecord; });
   621   "getCurrentTheme": function() { return getCurrentTheme; },
   607 __webpack_require__.d(build_module_selectors_namespaceObject, "getEditedEntityRecord", function() { return getEditedEntityRecord; });
   622   "getCurrentUser": function() { return getCurrentUser; },
   608 __webpack_require__.d(build_module_selectors_namespaceObject, "isAutosavingEntityRecord", function() { return isAutosavingEntityRecord; });
   623   "getEditedEntityRecord": function() { return getEditedEntityRecord; },
   609 __webpack_require__.d(build_module_selectors_namespaceObject, "isSavingEntityRecord", function() { return isSavingEntityRecord; });
   624   "getEmbedPreview": function() { return getEmbedPreview; },
   610 __webpack_require__.d(build_module_selectors_namespaceObject, "isDeletingEntityRecord", function() { return isDeletingEntityRecord; });
   625   "getEntitiesByKind": function() { return getEntitiesByKind; },
   611 __webpack_require__.d(build_module_selectors_namespaceObject, "getLastEntitySaveError", function() { return getLastEntitySaveError; });
   626   "getEntitiesConfig": function() { return getEntitiesConfig; },
   612 __webpack_require__.d(build_module_selectors_namespaceObject, "getLastEntityDeleteError", function() { return getLastEntityDeleteError; });
   627   "getEntity": function() { return getEntity; },
   613 __webpack_require__.d(build_module_selectors_namespaceObject, "getUndoEdit", function() { return getUndoEdit; });
   628   "getEntityConfig": function() { return getEntityConfig; },
   614 __webpack_require__.d(build_module_selectors_namespaceObject, "getRedoEdit", function() { return getRedoEdit; });
   629   "getEntityRecord": function() { return getEntityRecord; },
   615 __webpack_require__.d(build_module_selectors_namespaceObject, "hasUndo", function() { return hasUndo; });
   630   "getEntityRecordEdits": function() { return getEntityRecordEdits; },
   616 __webpack_require__.d(build_module_selectors_namespaceObject, "hasRedo", function() { return hasRedo; });
   631   "getEntityRecordNonTransientEdits": function() { return getEntityRecordNonTransientEdits; },
   617 __webpack_require__.d(build_module_selectors_namespaceObject, "getCurrentTheme", function() { return getCurrentTheme; });
   632   "getEntityRecords": function() { return getEntityRecords; },
   618 __webpack_require__.d(build_module_selectors_namespaceObject, "getThemeSupports", function() { return getThemeSupports; });
   633   "getLastEntityDeleteError": function() { return getLastEntityDeleteError; },
   619 __webpack_require__.d(build_module_selectors_namespaceObject, "getEmbedPreview", function() { return getEmbedPreview; });
   634   "getLastEntitySaveError": function() { return getLastEntitySaveError; },
   620 __webpack_require__.d(build_module_selectors_namespaceObject, "isPreviewEmbedFallback", function() { return isPreviewEmbedFallback; });
   635   "getRawEntityRecord": function() { return getRawEntityRecord; },
   621 __webpack_require__.d(build_module_selectors_namespaceObject, "canUser", function() { return canUser; });
   636   "getRedoEdit": function() { return getRedoEdit; },
   622 __webpack_require__.d(build_module_selectors_namespaceObject, "canUserEditEntityRecord", function() { return canUserEditEntityRecord; });
   637   "getReferenceByDistinctEdits": function() { return getReferenceByDistinctEdits; },
   623 __webpack_require__.d(build_module_selectors_namespaceObject, "getAutosaves", function() { return getAutosaves; });
   638   "getThemeSupports": function() { return getThemeSupports; },
   624 __webpack_require__.d(build_module_selectors_namespaceObject, "getAutosave", function() { return getAutosave; });
   639   "getUndoEdit": function() { return getUndoEdit; },
   625 __webpack_require__.d(build_module_selectors_namespaceObject, "hasFetchedAutosaves", function() { return hasFetchedAutosaves; });
   640   "getUserQueryResults": function() { return getUserQueryResults; },
   626 __webpack_require__.d(build_module_selectors_namespaceObject, "getReferenceByDistinctEdits", function() { return getReferenceByDistinctEdits; });
   641   "hasEditsForEntityRecord": function() { return hasEditsForEntityRecord; },
   627 __webpack_require__.d(build_module_selectors_namespaceObject, "__experimentalGetTemplateForLink", function() { return __experimentalGetTemplateForLink; });
   642   "hasEntityRecords": function() { return hasEntityRecords; },
       
   643   "hasFetchedAutosaves": function() { return hasFetchedAutosaves; },
       
   644   "hasRedo": function() { return hasRedo; },
       
   645   "hasUndo": function() { return hasUndo; },
       
   646   "isAutosavingEntityRecord": function() { return isAutosavingEntityRecord; },
       
   647   "isDeletingEntityRecord": function() { return isDeletingEntityRecord; },
       
   648   "isPreviewEmbedFallback": function() { return isPreviewEmbedFallback; },
       
   649   "isRequestingEmbedPreview": function() { return isRequestingEmbedPreview; },
       
   650   "isSavingEntityRecord": function() { return isSavingEntityRecord; }
       
   651 });
   628 
   652 
   629 // NAMESPACE OBJECT: ./node_modules/@wordpress/core-data/build-module/resolvers.js
   653 // NAMESPACE OBJECT: ./node_modules/@wordpress/core-data/build-module/resolvers.js
   630 var resolvers_namespaceObject = {};
   654 var resolvers_namespaceObject = {};
   631 __webpack_require__.r(resolvers_namespaceObject);
   655 __webpack_require__.r(resolvers_namespaceObject);
   632 __webpack_require__.d(resolvers_namespaceObject, "getAuthors", function() { return resolvers_getAuthors; });
   656 __webpack_require__.d(resolvers_namespaceObject, {
   633 __webpack_require__.d(resolvers_namespaceObject, "__unstableGetAuthor", function() { return resolvers_unstableGetAuthor; });
   657   "__experimentalGetCurrentGlobalStylesId": function() { return resolvers_experimentalGetCurrentGlobalStylesId; },
   634 __webpack_require__.d(resolvers_namespaceObject, "getCurrentUser", function() { return resolvers_getCurrentUser; });
   658   "__experimentalGetCurrentThemeBaseGlobalStyles": function() { return resolvers_experimentalGetCurrentThemeBaseGlobalStyles; },
   635 __webpack_require__.d(resolvers_namespaceObject, "getEntityRecord", function() { return resolvers_getEntityRecord; });
   659   "__experimentalGetCurrentThemeGlobalStylesVariations": function() { return resolvers_experimentalGetCurrentThemeGlobalStylesVariations; },
   636 __webpack_require__.d(resolvers_namespaceObject, "getRawEntityRecord", function() { return resolvers_getRawEntityRecord; });
   660   "__experimentalGetTemplateForLink": function() { return resolvers_experimentalGetTemplateForLink; },
   637 __webpack_require__.d(resolvers_namespaceObject, "getEditedEntityRecord", function() { return resolvers_getEditedEntityRecord; });
   661   "canUser": function() { return resolvers_canUser; },
   638 __webpack_require__.d(resolvers_namespaceObject, "getEntityRecords", function() { return resolvers_getEntityRecords; });
   662   "canUserEditEntityRecord": function() { return resolvers_canUserEditEntityRecord; },
   639 __webpack_require__.d(resolvers_namespaceObject, "getCurrentTheme", function() { return resolvers_getCurrentTheme; });
   663   "getAuthors": function() { return resolvers_getAuthors; },
   640 __webpack_require__.d(resolvers_namespaceObject, "getThemeSupports", function() { return resolvers_getThemeSupports; });
   664   "getAutosave": function() { return resolvers_getAutosave; },
   641 __webpack_require__.d(resolvers_namespaceObject, "getEmbedPreview", function() { return resolvers_getEmbedPreview; });
   665   "getAutosaves": function() { return resolvers_getAutosaves; },
   642 __webpack_require__.d(resolvers_namespaceObject, "canUser", function() { return resolvers_canUser; });
   666   "getBlockPatternCategories": function() { return resolvers_getBlockPatternCategories; },
   643 __webpack_require__.d(resolvers_namespaceObject, "canUserEditEntityRecord", function() { return resolvers_canUserEditEntityRecord; });
   667   "getBlockPatterns": function() { return resolvers_getBlockPatterns; },
   644 __webpack_require__.d(resolvers_namespaceObject, "getAutosaves", function() { return resolvers_getAutosaves; });
   668   "getCurrentTheme": function() { return resolvers_getCurrentTheme; },
   645 __webpack_require__.d(resolvers_namespaceObject, "getAutosave", function() { return resolvers_getAutosave; });
   669   "getCurrentUser": function() { return resolvers_getCurrentUser; },
   646 __webpack_require__.d(resolvers_namespaceObject, "__experimentalGetTemplateForLink", function() { return resolvers_experimentalGetTemplateForLink; });
   670   "getEditedEntityRecord": function() { return resolvers_getEditedEntityRecord; },
   647 
   671   "getEmbedPreview": function() { return resolvers_getEmbedPreview; },
   648 // NAMESPACE OBJECT: ./node_modules/@wordpress/core-data/build-module/locks/selectors.js
   672   "getEntityRecord": function() { return resolvers_getEntityRecord; },
   649 var locks_selectors_namespaceObject = {};
   673   "getEntityRecords": function() { return resolvers_getEntityRecords; },
   650 __webpack_require__.r(locks_selectors_namespaceObject);
   674   "getRawEntityRecord": function() { return resolvers_getRawEntityRecord; },
   651 __webpack_require__.d(locks_selectors_namespaceObject, "__unstableGetPendingLockRequests", function() { return __unstableGetPendingLockRequests; });
   675   "getThemeSupports": function() { return resolvers_getThemeSupports; }
   652 __webpack_require__.d(locks_selectors_namespaceObject, "__unstableIsLockAvailable", function() { return __unstableIsLockAvailable; });
   676 });
   653 
   677 
   654 // EXTERNAL MODULE: external ["wp","data"]
   678 ;// CONCATENATED MODULE: external ["wp","data"]
   655 var external_wp_data_ = __webpack_require__("1ZqX");
   679 var external_wp_data_namespaceObject = window["wp"]["data"];
   656 
   680 ;// CONCATENATED MODULE: external "lodash"
   657 // EXTERNAL MODULE: external ["wp","dataControls"]
   681 var external_lodash_namespaceObject = window["lodash"];
   658 var external_wp_dataControls_ = __webpack_require__("51Zz");
   682 ;// CONCATENATED MODULE: external ["wp","isShallowEqual"]
   659 
   683 var external_wp_isShallowEqual_namespaceObject = window["wp"]["isShallowEqual"];
   660 // EXTERNAL MODULE: external "lodash"
   684 var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_wp_isShallowEqual_namespaceObject);
   661 var external_lodash_ = __webpack_require__("YLtl");
   685 ;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/utils/if-matching-action.js
   662 
   686 /** @typedef {import('../types').AnyFunction} AnyFunction */
   663 // EXTERNAL MODULE: external ["wp","isShallowEqual"]
   687 
   664 var external_wp_isShallowEqual_ = __webpack_require__("rl8x");
       
   665 var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_wp_isShallowEqual_);
       
   666 
       
   667 // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/utils/if-matching-action.js
       
   668 /**
   688 /**
   669  * A higher-order reducer creator which invokes the original reducer only if
   689  * A higher-order reducer creator which invokes the original reducer only if
   670  * the dispatching action matches the given predicate, **OR** if state is
   690  * the dispatching action matches the given predicate, **OR** if state is
   671  * initializing (undefined).
   691  * initializing (undefined).
   672  *
   692  *
   673  * @param {Function} isMatch Function predicate for allowing reducer call.
   693  * @param {AnyFunction} isMatch Function predicate for allowing reducer call.
   674  *
   694  *
   675  * @return {Function} Higher-order reducer.
   695  * @return {AnyFunction} Higher-order reducer.
   676  */
   696  */
   677 const ifMatchingAction = isMatch => reducer => (state, action) => {
   697 const ifMatchingAction = isMatch => reducer => (state, action) => {
   678   if (state === undefined || isMatch(action)) {
   698   if (state === undefined || isMatch(action)) {
   679     return reducer(state, action);
   699     return reducer(state, action);
   680   }
   700   }
   682   return state;
   702   return state;
   683 };
   703 };
   684 
   704 
   685 /* harmony default export */ var if_matching_action = (ifMatchingAction);
   705 /* harmony default export */ var if_matching_action = (ifMatchingAction);
   686 
   706 
   687 // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/utils/replace-action.js
   707 ;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/utils/replace-action.js
       
   708 /** @typedef {import('../types').AnyFunction} AnyFunction */
       
   709 
   688 /**
   710 /**
   689  * Higher-order reducer creator which substitutes the action object before
   711  * Higher-order reducer creator which substitutes the action object before
   690  * passing to the original reducer.
   712  * passing to the original reducer.
   691  *
   713  *
   692  * @param {Function} replacer Function mapping original action to replacement.
   714  * @param {AnyFunction} replacer Function mapping original action to replacement.
   693  *
   715  *
   694  * @return {Function} Higher-order reducer.
   716  * @return {AnyFunction} Higher-order reducer.
   695  */
   717  */
   696 const replaceAction = replacer => reducer => (state, action) => {
   718 const replaceAction = replacer => reducer => (state, action) => {
   697   return reducer(state, replacer(action));
   719   return reducer(state, replacer(action));
   698 };
   720 };
   699 
   721 
   700 /* harmony default export */ var replace_action = (replaceAction);
   722 /* harmony default export */ var replace_action = (replaceAction);
   701 
   723 
   702 // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/utils/conservative-map-item.js
   724 ;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/utils/conservative-map-item.js
   703 /**
   725 /**
   704  * External dependencies
   726  * External dependencies
   705  */
   727  */
   706 
   728 
   707 /**
   729 /**
   708  * Given the current and next item entity, returns the minimally "modified"
   730  * Given the current and next item entity record, returns the minimally "modified"
   709  * result of the next item, preferring value references from the original item
   731  * result of the next item, preferring value references from the original item
   710  * if equal. If all values match, the original item is returned.
   732  * if equal. If all values match, the original item is returned.
   711  *
   733  *
   712  * @param {Object} item     Original item.
   734  * @param {Object} item     Original item.
   713  * @param {Object} nextItem Next item.
   735  * @param {Object} nextItem Next item.
   723 
   745 
   724   let hasChanges = false;
   746   let hasChanges = false;
   725   const result = {};
   747   const result = {};
   726 
   748 
   727   for (const key in nextItem) {
   749   for (const key in nextItem) {
   728     if (Object(external_lodash_["isEqual"])(item[key], nextItem[key])) {
   750     if ((0,external_lodash_namespaceObject.isEqual)(item[key], nextItem[key])) {
   729       result[key] = item[key];
   751       result[key] = item[key];
   730     } else {
   752     } else {
   731       hasChanges = true;
   753       hasChanges = true;
   732       result[key] = nextItem[key];
   754       result[key] = nextItem[key];
   733     }
   755     }
   747   }
   769   }
   748 
   770 
   749   return result;
   771   return result;
   750 }
   772 }
   751 
   773 
   752 // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/utils/on-sub-key.js
   774 ;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/utils/on-sub-key.js
       
   775 /** @typedef {import('../types').AnyFunction} AnyFunction */
       
   776 
   753 /**
   777 /**
   754  * Higher-order reducer creator which creates a combined reducer object, keyed
   778  * Higher-order reducer creator which creates a combined reducer object, keyed
   755  * by a property on the action object.
   779  * by a property on the action object.
   756  *
   780  *
   757  * @param {string} actionProperty Action property by which to key object.
   781  * @param {string} actionProperty Action property by which to key object.
   758  *
   782  *
   759  * @return {Function} Higher-order reducer.
   783  * @return {AnyFunction} Higher-order reducer.
   760  */
   784  */
   761 const onSubKey = actionProperty => reducer => (state = {}, action) => {
   785 const onSubKey = actionProperty => reducer => function () {
       
   786   let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
       
   787   let action = arguments.length > 1 ? arguments[1] : undefined;
   762   // Retrieve subkey from action. Do not track if undefined; useful for cases
   788   // Retrieve subkey from action. Do not track if undefined; useful for cases
   763   // where reducer is scoped by action shape.
   789   // where reducer is scoped by action shape.
   764   const key = action[actionProperty];
   790   const key = action[actionProperty];
   765 
   791 
   766   if (key === undefined) {
   792   if (key === undefined) {
   779     [key]: nextKeyState
   805     [key]: nextKeyState
   780   };
   806   };
   781 };
   807 };
   782 /* harmony default export */ var on_sub_key = (onSubKey);
   808 /* harmony default export */ var on_sub_key = (onSubKey);
   783 
   809 
   784 // EXTERNAL MODULE: external ["wp","i18n"]
   810 ;// CONCATENATED MODULE: external ["wp","apiFetch"]
   785 var external_wp_i18n_ = __webpack_require__("l3Sj");
   811 var external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"];
   786 
   812 var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject);
   787 // EXTERNAL MODULE: ./node_modules/uuid/dist/esm-browser/v4.js + 4 modules
   813 ;// CONCATENATED MODULE: external ["wp","i18n"]
   788 var v4 = __webpack_require__("7Cbv");
   814 var external_wp_i18n_namespaceObject = window["wp"]["i18n"];
   789 
   815 ;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/rng.js
   790 // EXTERNAL MODULE: external ["wp","url"]
   816 // Unique ID creation requires a high quality random # generator. In the browser we therefore
   791 var external_wp_url_ = __webpack_require__("Mmq9");
   817 // require the crypto API and do not support built-in fallback to lower quality random number
   792 
   818 // generators (like Math.random()).
   793 // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/queried-data/actions.js
   819 var getRandomValues;
       
   820 var rnds8 = new Uint8Array(16);
       
   821 function rng() {
       
   822   // lazy load so that environments that need to polyfill have a chance to do so
       
   823   if (!getRandomValues) {
       
   824     // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also,
       
   825     // find the complete implementation of crypto (msCrypto) on IE11.
       
   826     getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);
       
   827 
       
   828     if (!getRandomValues) {
       
   829       throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
       
   830     }
       
   831   }
       
   832 
       
   833   return getRandomValues(rnds8);
       
   834 }
       
   835 ;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/regex.js
       
   836 /* harmony default export */ var regex = (/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i);
       
   837 ;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/validate.js
       
   838 
       
   839 
       
   840 function validate(uuid) {
       
   841   return typeof uuid === 'string' && regex.test(uuid);
       
   842 }
       
   843 
       
   844 /* harmony default export */ var esm_browser_validate = (validate);
       
   845 ;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/stringify.js
       
   846 
       
   847 /**
       
   848  * Convert array of 16 byte values to UUID string format of the form:
       
   849  * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
       
   850  */
       
   851 
       
   852 var byteToHex = [];
       
   853 
       
   854 for (var i = 0; i < 256; ++i) {
       
   855   byteToHex.push((i + 0x100).toString(16).substr(1));
       
   856 }
       
   857 
       
   858 function stringify(arr) {
       
   859   var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
       
   860   // Note: Be careful editing this code!  It's been tuned for performance
       
   861   // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
       
   862   var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID.  If this throws, it's likely due to one
       
   863   // of the following:
       
   864   // - One or more input array values don't map to a hex octet (leading to
       
   865   // "undefined" in the uuid)
       
   866   // - Invalid input values for the RFC `version` or `variant` fields
       
   867 
       
   868   if (!esm_browser_validate(uuid)) {
       
   869     throw TypeError('Stringified UUID is invalid');
       
   870   }
       
   871 
       
   872   return uuid;
       
   873 }
       
   874 
       
   875 /* harmony default export */ var esm_browser_stringify = (stringify);
       
   876 ;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/v4.js
       
   877 
       
   878 
       
   879 
       
   880 function v4(options, buf, offset) {
       
   881   options = options || {};
       
   882   var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
       
   883 
       
   884   rnds[6] = rnds[6] & 0x0f | 0x40;
       
   885   rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
       
   886 
       
   887   if (buf) {
       
   888     offset = offset || 0;
       
   889 
       
   890     for (var i = 0; i < 16; ++i) {
       
   891       buf[offset + i] = rnds[i];
       
   892     }
       
   893 
       
   894     return buf;
       
   895   }
       
   896 
       
   897   return esm_browser_stringify(rnds);
       
   898 }
       
   899 
       
   900 /* harmony default export */ var esm_browser_v4 = (v4);
       
   901 ;// CONCATENATED MODULE: external ["wp","url"]
       
   902 var external_wp_url_namespaceObject = window["wp"]["url"];
       
   903 ;// CONCATENATED MODULE: external ["wp","deprecated"]
       
   904 var external_wp_deprecated_namespaceObject = window["wp"]["deprecated"];
       
   905 var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject);
       
   906 ;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/queried-data/actions.js
   794 /**
   907 /**
   795  * External dependencies
   908  * External dependencies
   796  */
   909  */
   797 
   910 
   798 /**
   911 /**
   805  */
   918  */
   806 
   919 
   807 function receiveItems(items, edits) {
   920 function receiveItems(items, edits) {
   808   return {
   921   return {
   809     type: 'RECEIVE_ITEMS',
   922     type: 'RECEIVE_ITEMS',
   810     items: Object(external_lodash_["castArray"])(items),
   923     items: (0,external_lodash_namespaceObject.castArray)(items),
   811     persistedEdits: edits
   924     persistedEdits: edits
   812   };
   925   };
   813 }
   926 }
   814 /**
   927 /**
   815  * Returns an action object used in signalling that entity records have been
   928  * Returns an action object used in signalling that entity records have been
   816  * deleted and they need to be removed from entities state.
   929  * deleted and they need to be removed from entities state.
   817  *
   930  *
   818  * @param {string}       kind             Kind of the removed entities.
   931  * @param {string}              kind            Kind of the removed entities.
   819  * @param {string}       name             Name of the removed entities.
   932  * @param {string}              name            Name of the removed entities.
   820  * @param {Array|number} records          Record IDs of the removed entities.
   933  * @param {Array|number|string} records         Record IDs of the removed entities.
   821  * @param {boolean}      invalidateCache  Controls whether we want to invalidate the cache.
   934  * @param {boolean}             invalidateCache Controls whether we want to invalidate the cache.
   822  * @return {Object} Action object.
   935  * @return {Object} Action object.
   823  */
   936  */
   824 
   937 
   825 function removeItems(kind, name, records, invalidateCache = false) {
   938 function removeItems(kind, name, records) {
       
   939   let invalidateCache = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
   826   return {
   940   return {
   827     type: 'REMOVE_ITEMS',
   941     type: 'REMOVE_ITEMS',
   828     itemIds: Object(external_lodash_["castArray"])(records),
   942     itemIds: (0,external_lodash_namespaceObject.castArray)(records),
   829     kind,
   943     kind,
   830     name,
   944     name,
   831     invalidateCache
   945     invalidateCache
   832   };
   946   };
   833 }
   947 }
   840  * @param {?Object} edits Optional edits to reset.
   954  * @param {?Object} edits Optional edits to reset.
   841  *
   955  *
   842  * @return {Object} Action object.
   956  * @return {Object} Action object.
   843  */
   957  */
   844 
   958 
   845 function receiveQueriedItems(items, query = {}, edits) {
   959 function receiveQueriedItems(items) {
       
   960   let query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
       
   961   let edits = arguments.length > 2 ? arguments[2] : undefined;
   846   return { ...receiveItems(items, edits),
   962   return { ...receiveItems(items, edits),
   847     query
   963     query
   848   };
   964   };
   849 }
   965 }
   850 
   966 
   851 // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/locks/actions.js
   967 ;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/batch/default-processor.js
   852 /**
       
   853  * WordPress dependencies
       
   854  */
       
   855 
       
   856 
       
   857 function* __unstableAcquireStoreLock(store, path, {
       
   858   exclusive
       
   859 }) {
       
   860   const promise = yield* __unstableEnqueueLockRequest(store, path, {
       
   861     exclusive
       
   862   });
       
   863   yield* __unstableProcessPendingLockRequests();
       
   864   return yield Object(external_wp_dataControls_["__unstableAwaitPromise"])(promise);
       
   865 }
       
   866 function* __unstableEnqueueLockRequest(store, path, {
       
   867   exclusive
       
   868 }) {
       
   869   let notifyAcquired;
       
   870   const promise = new Promise(resolve => {
       
   871     notifyAcquired = resolve;
       
   872   });
       
   873   yield {
       
   874     type: 'ENQUEUE_LOCK_REQUEST',
       
   875     request: {
       
   876       store,
       
   877       path,
       
   878       exclusive,
       
   879       notifyAcquired
       
   880     }
       
   881   };
       
   882   return promise;
       
   883 }
       
   884 function* __unstableReleaseStoreLock(lock) {
       
   885   yield {
       
   886     type: 'RELEASE_LOCK',
       
   887     lock
       
   888   };
       
   889   yield* __unstableProcessPendingLockRequests();
       
   890 }
       
   891 function* __unstableProcessPendingLockRequests() {
       
   892   yield {
       
   893     type: 'PROCESS_PENDING_LOCK_REQUESTS'
       
   894   };
       
   895   const lockRequests = yield external_wp_data_["controls"].select('core', '__unstableGetPendingLockRequests');
       
   896 
       
   897   for (const request of lockRequests) {
       
   898     const {
       
   899       store,
       
   900       path,
       
   901       exclusive,
       
   902       notifyAcquired
       
   903     } = request;
       
   904     const isAvailable = yield external_wp_data_["controls"].select('core', '__unstableIsLockAvailable', store, path, {
       
   905       exclusive
       
   906     });
       
   907 
       
   908     if (isAvailable) {
       
   909       const lock = {
       
   910         store,
       
   911         path,
       
   912         exclusive
       
   913       };
       
   914       yield {
       
   915         type: 'GRANT_LOCK_REQUEST',
       
   916         lock,
       
   917         request
       
   918       };
       
   919       notifyAcquired(lock);
       
   920     }
       
   921   }
       
   922 }
       
   923 
       
   924 // EXTERNAL MODULE: external ["wp","apiFetch"]
       
   925 var external_wp_apiFetch_ = __webpack_require__("ywyh");
       
   926 var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_);
       
   927 
       
   928 // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/batch/default-processor.js
       
   929 /**
   968 /**
   930  * External dependencies
   969  * External dependencies
   931  */
   970  */
   932 
   971 
   933 /**
   972 /**
   960       method: 'OPTIONS'
   999       method: 'OPTIONS'
   961     });
  1000     });
   962     maxItems = preflightResponse.endpoints[0].args.requests.maxItems;
  1001     maxItems = preflightResponse.endpoints[0].args.requests.maxItems;
   963   }
  1002   }
   964 
  1003 
   965   const results = [];
  1004   const results = []; // @ts-ignore We would have crashed or never gotten to this point if we hadn't received the maxItems count.
   966 
  1005 
   967   for (const batchRequests of Object(external_lodash_["chunk"])(requests, maxItems)) {
  1006   for (const batchRequests of (0,external_lodash_namespaceObject.chunk)(requests, maxItems)) {
   968     const batchResponse = await external_wp_apiFetch_default()({
  1007     const batchResponse = await external_wp_apiFetch_default()({
   969       path: '/batch/v1',
  1008       path: '/batch/v1',
   970       method: 'POST',
  1009       method: 'POST',
   971       data: {
  1010       data: {
   972         validation: 'require-all-validate',
  1011         validation: 'require-all-validate',
  1003   }
  1042   }
  1004 
  1043 
  1005   return results;
  1044   return results;
  1006 }
  1045 }
  1007 
  1046 
  1008 // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/batch/create-batch.js
  1047 ;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/batch/create-batch.js
  1009 /**
  1048 /**
  1010  * External dependencies
  1049  * External dependencies
  1011  */
  1050  */
  1012 
  1051 
  1013 /**
  1052 /**
  1047  *                               inputs and must return a promise that
  1086  *                               inputs and must return a promise that
  1048  *                               resolves to an array of objects containing
  1087  *                               resolves to an array of objects containing
  1049  *                               either `output` or `error`.
  1088  *                               either `output` or `error`.
  1050  */
  1089  */
  1051 
  1090 
  1052 function createBatch(processor = defaultProcessor) {
  1091 function createBatch() {
       
  1092   let processor = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultProcessor;
  1053   let lastId = 0;
  1093   let lastId = 0;
       
  1094   /** @type {Array<{ input: any; resolve: ( value: any ) => void; reject: ( error: any ) => void }>} */
       
  1095 
  1054   let queue = [];
  1096   let queue = [];
  1055   const pending = new ObservableSet();
  1097   const pending = new ObservableSet();
  1056   return {
  1098   return {
  1057     /**
  1099     /**
  1058      * Adds an input to the batch and returns a promise that is resolved or
  1100      * Adds an input to the batch and returns a promise that is resolved or
  1072      * - The thunk calls its `add` argument, or;
  1114      * - The thunk calls its `add` argument, or;
  1073      * - The thunk returns a promise and that promise resolves, or;
  1115      * - The thunk returns a promise and that promise resolves, or;
  1074      * - The thunk returns a non-promise.
  1116      * - The thunk returns a non-promise.
  1075      *
  1117      *
  1076      * @param {any|Function} inputOrThunk Input to add or thunk to execute.
  1118      * @param {any|Function} inputOrThunk Input to add or thunk to execute.
  1077      
  1119      *
  1078      * @return {Promise|any} If given an input, returns a promise that
  1120      * @return {Promise|any} If given an input, returns a promise that
  1079      *                       is resolved or rejected when the batch is
  1121      *                       is resolved or rejected when the batch is
  1080      *                       processed. If given a thunk, returns the return
  1122      *                       processed. If given a thunk, returns the return
  1081      *                       value of that thunk.
  1123      *                       value of that thunk.
  1082      */
  1124      */
  1091           reject
  1133           reject
  1092         });
  1134         });
  1093         pending.delete(id);
  1135         pending.delete(id);
  1094       });
  1136       });
  1095 
  1137 
  1096       if (Object(external_lodash_["isFunction"])(inputOrThunk)) {
  1138       if ((0,external_lodash_namespaceObject.isFunction)(inputOrThunk)) {
  1097         return Promise.resolve(inputOrThunk(add)).finally(() => {
  1139         return Promise.resolve(inputOrThunk(add)).finally(() => {
  1098           pending.delete(id);
  1140           pending.delete(id);
  1099         });
  1141         });
  1100       }
  1142       }
  1101 
  1143 
  1104 
  1146 
  1105     /**
  1147     /**
  1106      * Runs the batch. This calls `batchProcessor` and resolves or rejects
  1148      * Runs the batch. This calls `batchProcessor` and resolves or rejects
  1107      * all promises returned by `add()`.
  1149      * all promises returned by `add()`.
  1108      *
  1150      *
  1109      * @return {Promise} A promise that resolves to a boolean that is true
  1151      * @return {Promise<boolean>} A promise that resolves to a boolean that is true
  1110      *                   if the processor returned no errors.
  1152      *                   if the processor returned no errors.
  1111      */
  1153      */
  1112     async run() {
  1154     async run() {
  1113       if (pending.size) {
  1155       if (pending.size) {
  1114         await new Promise(resolve => {
  1156         await new Promise(resolve => {
  1115           const unsubscribe = pending.subscribe(() => {
  1157           const unsubscribe = pending.subscribe(() => {
  1116             if (!pending.size) {
  1158             if (!pending.size) {
  1117               unsubscribe();
  1159               unsubscribe();
  1118               resolve();
  1160               resolve(undefined);
  1119             }
  1161             }
  1120           });
  1162           });
  1121         });
  1163         });
  1122       }
  1164       }
  1123 
  1165 
  1124       let results;
  1166       let results;
  1125 
  1167 
  1126       try {
  1168       try {
  1127         results = await processor(queue.map(({
  1169         results = await processor(queue.map(_ref => {
  1128           input
  1170           let {
  1129         }) => input));
  1171             input
       
  1172           } = _ref;
       
  1173           return input;
       
  1174         }));
  1130 
  1175 
  1131         if (results.length !== queue.length) {
  1176         if (results.length !== queue.length) {
  1132           throw new Error('run: Array returned by processor must be same size as input array.');
  1177           throw new Error('run: Array returned by processor must be same size as input array.');
  1133         }
  1178         }
  1134       } catch (error) {
  1179       } catch (error) {
  1141         throw error;
  1186         throw error;
  1142       }
  1187       }
  1143 
  1188 
  1144       let isSuccess = true;
  1189       let isSuccess = true;
  1145 
  1190 
  1146       for (const [result, {
  1191       for (const pair of (0,external_lodash_namespaceObject.zip)(results, queue)) {
  1147         resolve,
  1192         /** @type {{error?: unknown, output?: unknown}} */
  1148         reject
  1193         const result = pair[0];
  1149       }] of Object(external_lodash_["zip"])(results, queue)) {
  1194         /** @type {{resolve: (value: any) => void; reject: (error: any) => void} | undefined} */
       
  1195 
       
  1196         const queueItem = pair[1];
       
  1197 
  1150         if (result !== null && result !== void 0 && result.error) {
  1198         if (result !== null && result !== void 0 && result.error) {
  1151           reject(result.error);
  1199           queueItem === null || queueItem === void 0 ? void 0 : queueItem.reject(result.error);
  1152           isSuccess = false;
  1200           isSuccess = false;
  1153         } else {
  1201         } else {
  1154           var _result$output;
  1202           var _result$output;
  1155 
  1203 
  1156           resolve((_result$output = result === null || result === void 0 ? void 0 : result.output) !== null && _result$output !== void 0 ? _result$output : result);
  1204           queueItem === null || queueItem === void 0 ? void 0 : queueItem.resolve((_result$output = result === null || result === void 0 ? void 0 : result.output) !== null && _result$output !== void 0 ? _result$output : result);
  1157         }
  1205         }
  1158       }
  1206       }
  1159 
  1207 
  1160       queue = [];
  1208       queue = [];
  1161       return isSuccess;
  1209       return isSuccess;
  1163 
  1211 
  1164   };
  1212   };
  1165 }
  1213 }
  1166 
  1214 
  1167 class ObservableSet {
  1215 class ObservableSet {
  1168   constructor(...args) {
  1216   constructor() {
       
  1217     for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
       
  1218       args[_key] = arguments[_key];
       
  1219     }
       
  1220 
  1169     this.set = new Set(...args);
  1221     this.set = new Set(...args);
  1170     this.subscribers = new Set();
  1222     this.subscribers = new Set();
  1171   }
  1223   }
  1172 
  1224 
  1173   get size() {
  1225   get size() {
  1174     return this.set.size;
  1226     return this.set.size;
  1175   }
  1227   }
  1176 
  1228 
  1177   add(...args) {
  1229   add(value) {
  1178     this.set.add(...args);
  1230     this.set.add(value);
  1179     this.subscribers.forEach(subscriber => subscriber());
  1231     this.subscribers.forEach(subscriber => subscriber());
  1180     return this;
  1232     return this;
  1181   }
  1233   }
  1182 
  1234 
  1183   delete(...args) {
  1235   delete(value) {
  1184     const isSuccess = this.set.delete(...args);
  1236     const isSuccess = this.set.delete(value);
  1185     this.subscribers.forEach(subscriber => subscriber());
  1237     this.subscribers.forEach(subscriber => subscriber());
  1186     return isSuccess;
  1238     return isSuccess;
  1187   }
  1239   }
  1188 
  1240 
  1189   subscribe(subscriber) {
  1241   subscribe(subscriber) {
  1193     };
  1245     };
  1194   }
  1246   }
  1195 
  1247 
  1196 }
  1248 }
  1197 
  1249 
  1198 // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/controls.js
  1250 ;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/name.js
       
  1251 /**
       
  1252  * The reducer key used by core data in store registration.
       
  1253  * This is defined in a separate file to avoid cycle-dependency
       
  1254  *
       
  1255  * @type {string}
       
  1256  */
       
  1257 const STORE_NAME = 'core';
       
  1258 
       
  1259 ;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/actions.js
       
  1260 /**
       
  1261  * External dependencies
       
  1262  */
       
  1263 
       
  1264 
  1199 /**
  1265 /**
  1200  * WordPress dependencies
  1266  * WordPress dependencies
  1201  */
  1267  */
  1202 
  1268 
  1203 function regularFetch(url) {
       
  1204   return {
       
  1205     type: 'REGULAR_FETCH',
       
  1206     url
       
  1207   };
       
  1208 }
       
  1209 function getDispatch() {
       
  1210   return {
       
  1211     type: 'GET_DISPATCH'
       
  1212   };
       
  1213 }
       
  1214 const controls = {
       
  1215   async REGULAR_FETCH({
       
  1216     url
       
  1217   }) {
       
  1218     const {
       
  1219       data
       
  1220     } = await window.fetch(url).then(res => res.json());
       
  1221     return data;
       
  1222   },
       
  1223 
       
  1224   GET_DISPATCH: Object(external_wp_data_["createRegistryControl"])(({
       
  1225     dispatch
       
  1226   }) => () => dispatch)
       
  1227 };
       
  1228 /* harmony default export */ var build_module_controls = (controls);
       
  1229 
       
  1230 // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/actions.js
       
  1231 /**
       
  1232  * External dependencies
       
  1233  */
       
  1234 
       
  1235 
       
  1236 /**
       
  1237  * WordPress dependencies
       
  1238  */
       
  1239 
       
  1240 
  1269 
  1241 
  1270 
  1242 
  1271 
  1243 /**
  1272 /**
  1244  * Internal dependencies
  1273  * Internal dependencies
  1245  */
  1274  */
  1246 
       
  1247 
  1275 
  1248 
  1276 
  1249 
  1277 
  1250 
  1278 
  1251 
  1279 
  1259  */
  1287  */
  1260 
  1288 
  1261 function receiveUserQuery(queryID, users) {
  1289 function receiveUserQuery(queryID, users) {
  1262   return {
  1290   return {
  1263     type: 'RECEIVE_USER_QUERY',
  1291     type: 'RECEIVE_USER_QUERY',
  1264     users: Object(external_lodash_["castArray"])(users),
  1292     users: (0,external_lodash_namespaceObject.castArray)(users),
  1265     queryID
  1293     queryID
  1266   };
  1294   };
  1267 }
  1295 }
  1268 /**
  1296 /**
  1269  * Returns an action used in signalling that the current user has been received.
  1297  * Returns an action used in signalling that the current user has been received.
  1280   };
  1308   };
  1281 }
  1309 }
  1282 /**
  1310 /**
  1283  * Returns an action object used in adding new entities.
  1311  * Returns an action object used in adding new entities.
  1284  *
  1312  *
  1285  * @param {Array} entities  Entities received.
  1313  * @param {Array} entities Entities received.
  1286  *
  1314  *
  1287  * @return {Object} Action object.
  1315  * @return {Object} Action object.
  1288  */
  1316  */
  1289 
  1317 
  1290 function addEntities(entities) {
  1318 function addEntities(entities) {
  1294   };
  1322   };
  1295 }
  1323 }
  1296 /**
  1324 /**
  1297  * Returns an action object used in signalling that entity records have been received.
  1325  * Returns an action object used in signalling that entity records have been received.
  1298  *
  1326  *
  1299  * @param {string}       kind            Kind of the received entity.
  1327  * @param {string}       kind            Kind of the received entity record.
  1300  * @param {string}       name            Name of the received entity.
  1328  * @param {string}       name            Name of the received entity record.
  1301  * @param {Array|Object} records         Records received.
  1329  * @param {Array|Object} records         Records received.
  1302  * @param {?Object}      query           Query Object.
  1330  * @param {?Object}      query           Query Object.
  1303  * @param {?boolean}     invalidateCache Should invalidate query caches.
  1331  * @param {?boolean}     invalidateCache Should invalidate query caches.
  1304  * @param {?Object}      edits           Edits to reset.
  1332  * @param {?Object}      edits           Edits to reset.
  1305  * @return {Object} Action object.
  1333  * @return {Object} Action object.
  1306  */
  1334  */
  1307 
  1335 
  1308 function receiveEntityRecords(kind, name, records, query, invalidateCache = false, edits) {
  1336 function receiveEntityRecords(kind, name, records, query) {
       
  1337   let invalidateCache = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
       
  1338   let edits = arguments.length > 5 ? arguments[5] : undefined;
       
  1339 
  1309   // Auto drafts should not have titles, but some plugins rely on them so we can't filter this
  1340   // Auto drafts should not have titles, but some plugins rely on them so we can't filter this
  1310   // on the server.
  1341   // on the server.
  1311   if (kind === 'postType') {
  1342   if (kind === 'postType') {
  1312     records = Object(external_lodash_["castArray"])(records).map(record => record.status === 'auto-draft' ? { ...record,
  1343     records = (0,external_lodash_namespaceObject.castArray)(records).map(record => record.status === 'auto-draft' ? { ...record,
  1313       title: ''
  1344       title: ''
  1314     } : record);
  1345     } : record);
  1315   }
  1346   }
  1316 
  1347 
  1317   let action;
  1348   let action;
  1341     type: 'RECEIVE_CURRENT_THEME',
  1372     type: 'RECEIVE_CURRENT_THEME',
  1342     currentTheme
  1373     currentTheme
  1343   };
  1374   };
  1344 }
  1375 }
  1345 /**
  1376 /**
       
  1377  * Returns an action object used in signalling that the current global styles id has been received.
       
  1378  *
       
  1379  * @param {string} currentGlobalStylesId The current global styles id.
       
  1380  *
       
  1381  * @return {Object} Action object.
       
  1382  */
       
  1383 
       
  1384 function __experimentalReceiveCurrentGlobalStylesId(currentGlobalStylesId) {
       
  1385   return {
       
  1386     type: 'RECEIVE_CURRENT_GLOBAL_STYLES_ID',
       
  1387     id: currentGlobalStylesId
       
  1388   };
       
  1389 }
       
  1390 /**
       
  1391  * Returns an action object used in signalling that the theme base global styles have been received
       
  1392  *
       
  1393  * @param {string} stylesheet   The theme's identifier
       
  1394  * @param {Object} globalStyles The global styles object.
       
  1395  *
       
  1396  * @return {Object} Action object.
       
  1397  */
       
  1398 
       
  1399 function __experimentalReceiveThemeBaseGlobalStyles(stylesheet, globalStyles) {
       
  1400   return {
       
  1401     type: 'RECEIVE_THEME_GLOBAL_STYLES',
       
  1402     stylesheet,
       
  1403     globalStyles
       
  1404   };
       
  1405 }
       
  1406 /**
       
  1407  * Returns an action object used in signalling that the theme global styles variations have been received.
       
  1408  *
       
  1409  * @param {string} stylesheet The theme's identifier
       
  1410  * @param {Array}  variations The global styles variations.
       
  1411  *
       
  1412  * @return {Object} Action object.
       
  1413  */
       
  1414 
       
  1415 function __experimentalReceiveThemeGlobalStyleVariations(stylesheet, variations) {
       
  1416   return {
       
  1417     type: 'RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS',
       
  1418     stylesheet,
       
  1419     variations
       
  1420   };
       
  1421 }
       
  1422 /**
  1346  * Returns an action object used in signalling that the index has been received.
  1423  * Returns an action object used in signalling that the index has been received.
  1347  *
  1424  *
  1348  * @param {Object} themeSupports Theme support for the current theme.
  1425  * @deprecated since WP 5.9, this is not useful anymore, use the selector direclty.
  1349  *
  1426  *
  1350  * @return {Object} Action object.
  1427  * @return {Object} Action object.
  1351  */
  1428  */
  1352 
  1429 
  1353 function receiveThemeSupports(themeSupports) {
  1430 function receiveThemeSupports() {
       
  1431   external_wp_deprecated_default()("wp.data.dispatch( 'core' ).receiveThemeSupports", {
       
  1432     since: '5.9'
       
  1433   });
  1354   return {
  1434   return {
  1355     type: 'RECEIVE_THEME_SUPPORTS',
  1435     type: 'DO_NOTHING'
  1356     themeSupports
       
  1357   };
  1436   };
  1358 }
  1437 }
  1359 /**
  1438 /**
  1360  * Returns an action object used in signalling that the preview data for
  1439  * Returns an action object used in signalling that the preview data for
  1361  * a given URl has been received.
  1440  * a given URl has been received.
  1362  *
  1441  *
  1363  * @param {string}  url     URL to preview the embed for.
  1442  * @param {string} url     URL to preview the embed for.
  1364  * @param {*}       preview Preview data.
  1443  * @param {*}      preview Preview data.
  1365  *
  1444  *
  1366  * @return {Object} Action object.
  1445  * @return {Object} Action object.
  1367  */
  1446  */
  1368 
  1447 
  1369 function receiveEmbedPreview(url, preview) {
  1448 function receiveEmbedPreview(url, preview) {
  1374   };
  1453   };
  1375 }
  1454 }
  1376 /**
  1455 /**
  1377  * Action triggered to delete an entity record.
  1456  * Action triggered to delete an entity record.
  1378  *
  1457  *
  1379  * @param {string}   kind                      Kind of the deleted entity.
  1458  * @param {string}   kind                         Kind of the deleted entity.
  1380  * @param {string}   name                      Name of the deleted entity.
  1459  * @param {string}   name                         Name of the deleted entity.
  1381  * @param {string}   recordId                  Record ID of the deleted entity.
  1460  * @param {string}   recordId                     Record ID of the deleted entity.
  1382  * @param {?Object}  query                     Special query parameters for the
  1461  * @param {?Object}  query                        Special query parameters for the
  1383  *                                             DELETE API call.
  1462  *                                                DELETE API call.
  1384  * @param {Object}   [options]                 Delete options.
  1463  * @param {Object}   [options]                    Delete options.
  1385  * @param {Function} [options.__unstableFetch] Internal use only. Function to
  1464  * @param {Function} [options.__unstableFetch]    Internal use only. Function to
  1386  *                                             call instead of `apiFetch()`.
  1465  *                                                call instead of `apiFetch()`.
  1387  *                                             Must return a control descriptor.
  1466  *                                                Must return a promise.
  1388  */
  1467  * @param {boolean}  [options.throwOnError=false] If false, this action suppresses all
  1389 
  1468  *                                                the exceptions. Defaults to false.
  1390 function* deleteEntityRecord(kind, name, recordId, query, {
  1469  */
  1391   __unstableFetch = null
  1470 
  1392 } = {}) {
  1471 const deleteEntityRecord = function (kind, name, recordId, query) {
  1393   const entities = yield getKindEntities(kind);
  1472   let {
  1394   const entity = Object(external_lodash_["find"])(entities, {
  1473     __unstableFetch = (external_wp_apiFetch_default()),
  1395     kind,
  1474     throwOnError = false
  1396     name
  1475   } = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
  1397   });
  1476   return async _ref => {
  1398   let error;
  1477     let {
  1399   let deletedRecord = false;
  1478       dispatch
  1400 
  1479     } = _ref;
  1401   if (!entity) {
  1480     const configs = await dispatch(getOrLoadEntitiesConfig(kind));
  1402     return;
  1481     const entityConfig = (0,external_lodash_namespaceObject.find)(configs, {
  1403   }
       
  1404 
       
  1405   const lock = yield* __unstableAcquireStoreLock('core', ['entities', 'data', kind, name, recordId], {
       
  1406     exclusive: true
       
  1407   });
       
  1408 
       
  1409   try {
       
  1410     yield {
       
  1411       type: 'DELETE_ENTITY_RECORD_START',
       
  1412       kind,
  1482       kind,
  1413       name,
  1483       name
  1414       recordId
  1484     });
  1415     };
  1485     let error;
       
  1486     let deletedRecord = false;
       
  1487 
       
  1488     if (!entityConfig || entityConfig !== null && entityConfig !== void 0 && entityConfig.__experimentalNoFetch) {
       
  1489       return;
       
  1490     }
       
  1491 
       
  1492     const lock = await dispatch.__unstableAcquireStoreLock(STORE_NAME, ['entities', 'records', kind, name, recordId], {
       
  1493       exclusive: true
       
  1494     });
  1416 
  1495 
  1417     try {
  1496     try {
  1418       let path = `${entity.baseURL}/${recordId}`;
  1497       dispatch({
  1419 
  1498         type: 'DELETE_ENTITY_RECORD_START',
  1420       if (query) {
  1499         kind,
  1421         path = Object(external_wp_url_["addQueryArgs"])(path, query);
  1500         name,
       
  1501         recordId
       
  1502       });
       
  1503       let hasError = false;
       
  1504 
       
  1505       try {
       
  1506         let path = `${entityConfig.baseURL}/${recordId}`;
       
  1507 
       
  1508         if (query) {
       
  1509           path = (0,external_wp_url_namespaceObject.addQueryArgs)(path, query);
       
  1510         }
       
  1511 
       
  1512         deletedRecord = await __unstableFetch({
       
  1513           path,
       
  1514           method: 'DELETE'
       
  1515         });
       
  1516         await dispatch(removeItems(kind, name, recordId, true));
       
  1517       } catch (_error) {
       
  1518         hasError = true;
       
  1519         error = _error;
  1422       }
  1520       }
  1423 
  1521 
  1424       const options = {
  1522       dispatch({
  1425         path,
  1523         type: 'DELETE_ENTITY_RECORD_FINISH',
  1426         method: 'DELETE'
  1524         kind,
  1427       };
  1525         name,
  1428 
  1526         recordId,
  1429       if (__unstableFetch) {
  1527         error
  1430         deletedRecord = yield Object(external_wp_dataControls_["__unstableAwaitPromise"])(__unstableFetch(options));
  1528       });
  1431       } else {
  1529 
  1432         deletedRecord = yield Object(external_wp_dataControls_["apiFetch"])(options);
  1530       if (hasError && throwOnError) {
       
  1531         throw error;
  1433       }
  1532       }
  1434 
  1533 
  1435       yield removeItems(kind, name, recordId, true);
  1534       return deletedRecord;
  1436     } catch (_error) {
  1535     } finally {
  1437       error = _error;
  1536       dispatch.__unstableReleaseStoreLock(lock);
  1438     }
  1537     }
  1439 
  1538   };
  1440     yield {
  1539 };
  1441       type: 'DELETE_ENTITY_RECORD_FINISH',
  1540 /**
       
  1541  * Returns an action object that triggers an
       
  1542  * edit to an entity record.
       
  1543  *
       
  1544  * @param {string}  kind                 Kind of the edited entity record.
       
  1545  * @param {string}  name                 Name of the edited entity record.
       
  1546  * @param {number}  recordId             Record ID of the edited entity record.
       
  1547  * @param {Object}  edits                The edits.
       
  1548  * @param {Object}  options              Options for the edit.
       
  1549  * @param {boolean} [options.undoIgnore] Whether to ignore the edit in undo history or not.
       
  1550  *
       
  1551  * @return {Object} Action object.
       
  1552  */
       
  1553 
       
  1554 const editEntityRecord = function (kind, name, recordId, edits) {
       
  1555   let options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
       
  1556   return _ref2 => {
       
  1557     let {
       
  1558       select,
       
  1559       dispatch
       
  1560     } = _ref2;
       
  1561     const entityConfig = select.getEntityConfig(kind, name);
       
  1562 
       
  1563     if (!entityConfig) {
       
  1564       throw new Error(`The entity being edited (${kind}, ${name}) does not have a loaded config.`);
       
  1565     }
       
  1566 
       
  1567     const {
       
  1568       transientEdits = {},
       
  1569       mergedEdits = {}
       
  1570     } = entityConfig;
       
  1571     const record = select.getRawEntityRecord(kind, name, recordId);
       
  1572     const editedRecord = select.getEditedEntityRecord(kind, name, recordId);
       
  1573     const edit = {
  1442       kind,
  1574       kind,
  1443       name,
  1575       name,
  1444       recordId,
  1576       recordId,
  1445       error
  1577       // Clear edits when they are equal to their persisted counterparts
       
  1578       // so that the property is not considered dirty.
       
  1579       edits: Object.keys(edits).reduce((acc, key) => {
       
  1580         const recordValue = record[key];
       
  1581         const editedRecordValue = editedRecord[key];
       
  1582         const value = mergedEdits[key] ? { ...editedRecordValue,
       
  1583           ...edits[key]
       
  1584         } : edits[key];
       
  1585         acc[key] = (0,external_lodash_namespaceObject.isEqual)(recordValue, value) ? undefined : value;
       
  1586         return acc;
       
  1587       }, {}),
       
  1588       transientEdits
  1446     };
  1589     };
  1447     return deletedRecord;
  1590     dispatch({
  1448   } finally {
  1591       type: 'EDIT_ENTITY_RECORD',
  1449     yield* __unstableReleaseStoreLock(lock);
  1592       ...edit,
  1450   }
  1593       meta: {
  1451 }
  1594         undo: !options.undoIgnore && { ...edit,
  1452 /**
  1595           // Send the current values for things like the first undo stack entry.
  1453  * Returns an action object that triggers an
  1596           edits: Object.keys(edits).reduce((acc, key) => {
  1454  * edit to an entity record.
  1597             acc[key] = editedRecord[key];
  1455  *
  1598             return acc;
  1456  * @param {string} kind     Kind of the edited entity record.
  1599           }, {})
  1457  * @param {string} name     Name of the edited entity record.
  1600         }
  1458  * @param {number} recordId Record ID of the edited entity record.
  1601       }
  1459  * @param {Object} edits    The edits.
  1602     });
  1460  * @param {Object} options  Options for the edit.
       
  1461  * @param {boolean} options.undoIgnore Whether to ignore the edit in undo history or not.
       
  1462  *
       
  1463  * @return {Object} Action object.
       
  1464  */
       
  1465 
       
  1466 function* actions_editEntityRecord(kind, name, recordId, edits, options = {}) {
       
  1467   const entity = yield external_wp_data_["controls"].select('core', 'getEntity', kind, name);
       
  1468 
       
  1469   if (!entity) {
       
  1470     throw new Error(`The entity being edited (${kind}, ${name}) does not have a loaded config.`);
       
  1471   }
       
  1472 
       
  1473   const {
       
  1474     transientEdits = {},
       
  1475     mergedEdits = {}
       
  1476   } = entity;
       
  1477   const record = yield external_wp_data_["controls"].select('core', 'getRawEntityRecord', kind, name, recordId);
       
  1478   const editedRecord = yield external_wp_data_["controls"].select('core', 'getEditedEntityRecord', kind, name, recordId);
       
  1479   const edit = {
       
  1480     kind,
       
  1481     name,
       
  1482     recordId,
       
  1483     // Clear edits when they are equal to their persisted counterparts
       
  1484     // so that the property is not considered dirty.
       
  1485     edits: Object.keys(edits).reduce((acc, key) => {
       
  1486       const recordValue = record[key];
       
  1487       const editedRecordValue = editedRecord[key];
       
  1488       const value = mergedEdits[key] ? { ...editedRecordValue,
       
  1489         ...edits[key]
       
  1490       } : edits[key];
       
  1491       acc[key] = Object(external_lodash_["isEqual"])(recordValue, value) ? undefined : value;
       
  1492       return acc;
       
  1493     }, {}),
       
  1494     transientEdits
       
  1495   };
  1603   };
  1496   return {
  1604 };
  1497     type: 'EDIT_ENTITY_RECORD',
       
  1498     ...edit,
       
  1499     meta: {
       
  1500       undo: !options.undoIgnore && { ...edit,
       
  1501         // Send the current values for things like the first undo stack entry.
       
  1502         edits: Object.keys(edits).reduce((acc, key) => {
       
  1503           acc[key] = editedRecord[key];
       
  1504           return acc;
       
  1505         }, {})
       
  1506       }
       
  1507     }
       
  1508   };
       
  1509 }
       
  1510 /**
  1605 /**
  1511  * Action triggered to undo the last edit to
  1606  * Action triggered to undo the last edit to
  1512  * an entity record, if any.
  1607  * an entity record, if any.
  1513  */
  1608  */
  1514 
  1609 
  1515 function* undo() {
  1610 const undo = () => _ref3 => {
  1516   const undoEdit = yield external_wp_data_["controls"].select('core', 'getUndoEdit');
  1611   let {
       
  1612     select,
       
  1613     dispatch
       
  1614   } = _ref3;
       
  1615   const undoEdit = select.getUndoEdit();
  1517 
  1616 
  1518   if (!undoEdit) {
  1617   if (!undoEdit) {
  1519     return;
  1618     return;
  1520   }
  1619   }
  1521 
  1620 
  1522   yield {
  1621   dispatch({
  1523     type: 'EDIT_ENTITY_RECORD',
  1622     type: 'EDIT_ENTITY_RECORD',
  1524     ...undoEdit,
  1623     ...undoEdit,
  1525     meta: {
  1624     meta: {
  1526       isUndo: true
  1625       isUndo: true
  1527     }
  1626     }
  1528   };
  1627   });
  1529 }
  1628 };
  1530 /**
  1629 /**
  1531  * Action triggered to redo the last undoed
  1630  * Action triggered to redo the last undoed
  1532  * edit to an entity record, if any.
  1631  * edit to an entity record, if any.
  1533  */
  1632  */
  1534 
  1633 
  1535 function* redo() {
  1634 const redo = () => _ref4 => {
  1536   const redoEdit = yield external_wp_data_["controls"].select('core', 'getRedoEdit');
  1635   let {
       
  1636     select,
       
  1637     dispatch
       
  1638   } = _ref4;
       
  1639   const redoEdit = select.getRedoEdit();
  1537 
  1640 
  1538   if (!redoEdit) {
  1641   if (!redoEdit) {
  1539     return;
  1642     return;
  1540   }
  1643   }
  1541 
  1644 
  1542   yield {
  1645   dispatch({
  1543     type: 'EDIT_ENTITY_RECORD',
  1646     type: 'EDIT_ENTITY_RECORD',
  1544     ...redoEdit,
  1647     ...redoEdit,
  1545     meta: {
  1648     meta: {
  1546       isRedo: true
  1649       isRedo: true
  1547     }
  1650     }
  1548   };
  1651   });
  1549 }
  1652 };
  1550 /**
  1653 /**
  1551  * Forces the creation of a new undo level.
  1654  * Forces the creation of a new undo level.
  1552  *
  1655  *
  1553  * @return {Object} Action object.
  1656  * @return {Object} Action object.
  1554  */
  1657  */
  1555 
  1658 
  1556 function actions_unstableCreateUndoLevel() {
  1659 function __unstableCreateUndoLevel() {
  1557   return {
  1660   return {
  1558     type: 'CREATE_UNDO_LEVEL'
  1661     type: 'CREATE_UNDO_LEVEL'
  1559   };
  1662   };
  1560 }
  1663 }
  1561 /**
  1664 /**
  1562  * Action triggered to save an entity record.
  1665  * Action triggered to save an entity record.
  1563  *
  1666  *
  1564  * @param {string}   kind                       Kind of the received entity.
  1667  * @param {string}   kind                         Kind of the received entity.
  1565  * @param {string}   name                       Name of the received entity.
  1668  * @param {string}   name                         Name of the received entity.
  1566  * @param {Object}   record                     Record to be saved.
  1669  * @param {Object}   record                       Record to be saved.
  1567  * @param {Object}   options                    Saving options.
  1670  * @param {Object}   options                      Saving options.
  1568  * @param {boolean}  [options.isAutosave=false] Whether this is an autosave.
  1671  * @param {boolean}  [options.isAutosave=false]   Whether this is an autosave.
  1569  * @param {Function} [options.__unstableFetch]  Internal use only. Function to
  1672  * @param {Function} [options.__unstableFetch]    Internal use only. Function to
  1570  *                                              call instead of `apiFetch()`.
  1673  *                                                call instead of `apiFetch()`.
  1571  *                                              Must return a control
  1674  *                                                Must return a promise.
  1572  *                                              descriptor.
  1675  * @param {boolean}  [options.throwOnError=false] If false, this action suppresses all
  1573  */
  1676  *                                                the exceptions. Defaults to false.
  1574 
  1677  */
  1575 function* saveEntityRecord(kind, name, record, {
  1678 
  1576   isAutosave = false,
  1679 const saveEntityRecord = function (kind, name, record) {
  1577   __unstableFetch = null
  1680   let {
  1578 } = {}) {
  1681     isAutosave = false,
  1579   const entities = yield getKindEntities(kind);
  1682     __unstableFetch = (external_wp_apiFetch_default()),
  1580   const entity = Object(external_lodash_["find"])(entities, {
  1683     throwOnError = false
  1581     kind,
  1684   } = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  1582     name
  1685   return async _ref5 => {
  1583   });
  1686     let {
  1584 
  1687       select,
  1585   if (!entity) {
  1688       resolveSelect,
  1586     return;
  1689       dispatch
  1587   }
  1690     } = _ref5;
  1588 
  1691     const configs = await dispatch(getOrLoadEntitiesConfig(kind));
  1589   const entityIdKey = entity.key || DEFAULT_ENTITY_KEY;
  1692     const entityConfig = (0,external_lodash_namespaceObject.find)(configs, {
  1590   const recordId = record[entityIdKey];
  1693       kind,
  1591   const lock = yield* __unstableAcquireStoreLock('core', ['entities', 'data', kind, name, recordId || Object(v4["a" /* default */])()], {
  1694       name
  1592     exclusive: true
  1695     });
  1593   });
  1696 
  1594 
  1697     if (!entityConfig || entityConfig !== null && entityConfig !== void 0 && entityConfig.__experimentalNoFetch) {
  1595   try {
  1698       return;
  1596     // Evaluate optimized edits.
  1699     }
  1597     // (Function edits that should be evaluated on save to avoid expensive computations on every edit.)
  1700 
  1598     for (const [key, value] of Object.entries(record)) {
  1701     const entityIdKey = entityConfig.key || DEFAULT_ENTITY_KEY;
  1599       if (typeof value === 'function') {
  1702     const recordId = record[entityIdKey];
  1600         const evaluatedValue = value(yield external_wp_data_["controls"].select('core', 'getEditedEntityRecord', kind, name, recordId));
  1703     const lock = await dispatch.__unstableAcquireStoreLock(STORE_NAME, ['entities', 'records', kind, name, recordId || esm_browser_v4()], {
  1601         yield actions_editEntityRecord(kind, name, recordId, {
  1704       exclusive: true
  1602           [key]: evaluatedValue
  1705     });
  1603         }, {
  1706 
  1604           undoIgnore: true
  1707     try {
  1605         });
  1708       // Evaluate optimized edits.
  1606         record[key] = evaluatedValue;
  1709       // (Function edits that should be evaluated on save to avoid expensive computations on every edit.)
       
  1710       for (const [key, value] of Object.entries(record)) {
       
  1711         if (typeof value === 'function') {
       
  1712           const evaluatedValue = value(select.getEditedEntityRecord(kind, name, recordId));
       
  1713           dispatch.editEntityRecord(kind, name, recordId, {
       
  1714             [key]: evaluatedValue
       
  1715           }, {
       
  1716             undoIgnore: true
       
  1717           });
       
  1718           record[key] = evaluatedValue;
       
  1719         }
  1607       }
  1720       }
       
  1721 
       
  1722       dispatch({
       
  1723         type: 'SAVE_ENTITY_RECORD_START',
       
  1724         kind,
       
  1725         name,
       
  1726         recordId,
       
  1727         isAutosave
       
  1728       });
       
  1729       let updatedRecord;
       
  1730       let error;
       
  1731       let hasError = false;
       
  1732 
       
  1733       try {
       
  1734         const path = `${entityConfig.baseURL}${recordId ? '/' + recordId : ''}`;
       
  1735         const persistedRecord = select.getRawEntityRecord(kind, name, recordId);
       
  1736 
       
  1737         if (isAutosave) {
       
  1738           // Most of this autosave logic is very specific to posts.
       
  1739           // This is fine for now as it is the only supported autosave,
       
  1740           // but ideally this should all be handled in the back end,
       
  1741           // so the client just sends and receives objects.
       
  1742           const currentUser = select.getCurrentUser();
       
  1743           const currentUserId = currentUser ? currentUser.id : undefined;
       
  1744           const autosavePost = await resolveSelect.getAutosave(persistedRecord.type, persistedRecord.id, currentUserId); // Autosaves need all expected fields to be present.
       
  1745           // So we fallback to the previous autosave and then
       
  1746           // to the actual persisted entity if the edits don't
       
  1747           // have a value.
       
  1748 
       
  1749           let data = { ...persistedRecord,
       
  1750             ...autosavePost,
       
  1751             ...record
       
  1752           };
       
  1753           data = Object.keys(data).reduce((acc, key) => {
       
  1754             if (['title', 'excerpt', 'content'].includes(key)) {
       
  1755               acc[key] = data[key];
       
  1756             }
       
  1757 
       
  1758             return acc;
       
  1759           }, {
       
  1760             status: data.status === 'auto-draft' ? 'draft' : data.status
       
  1761           });
       
  1762           updatedRecord = await __unstableFetch({
       
  1763             path: `${path}/autosaves`,
       
  1764             method: 'POST',
       
  1765             data
       
  1766           }); // An autosave may be processed by the server as a regular save
       
  1767           // when its update is requested by the author and the post had
       
  1768           // draft or auto-draft status.
       
  1769 
       
  1770           if (persistedRecord.id === updatedRecord.id) {
       
  1771             let newRecord = { ...persistedRecord,
       
  1772               ...data,
       
  1773               ...updatedRecord
       
  1774             };
       
  1775             newRecord = Object.keys(newRecord).reduce((acc, key) => {
       
  1776               // These properties are persisted in autosaves.
       
  1777               if (['title', 'excerpt', 'content'].includes(key)) {
       
  1778                 acc[key] = newRecord[key];
       
  1779               } else if (key === 'status') {
       
  1780                 // Status is only persisted in autosaves when going from
       
  1781                 // "auto-draft" to "draft".
       
  1782                 acc[key] = persistedRecord.status === 'auto-draft' && newRecord.status === 'draft' ? newRecord.status : persistedRecord.status;
       
  1783               } else {
       
  1784                 // These properties are not persisted in autosaves.
       
  1785                 acc[key] = persistedRecord[key];
       
  1786               }
       
  1787 
       
  1788               return acc;
       
  1789             }, {});
       
  1790             dispatch.receiveEntityRecords(kind, name, newRecord, undefined, true);
       
  1791           } else {
       
  1792             dispatch.receiveAutosaves(persistedRecord.id, updatedRecord);
       
  1793           }
       
  1794         } else {
       
  1795           let edits = record;
       
  1796 
       
  1797           if (entityConfig.__unstablePrePersist) {
       
  1798             edits = { ...edits,
       
  1799               ...entityConfig.__unstablePrePersist(persistedRecord, edits)
       
  1800             };
       
  1801           }
       
  1802 
       
  1803           updatedRecord = await __unstableFetch({
       
  1804             path,
       
  1805             method: recordId ? 'PUT' : 'POST',
       
  1806             data: edits
       
  1807           });
       
  1808           dispatch.receiveEntityRecords(kind, name, updatedRecord, undefined, true, edits);
       
  1809         }
       
  1810       } catch (_error) {
       
  1811         hasError = true;
       
  1812         error = _error;
       
  1813       }
       
  1814 
       
  1815       dispatch({
       
  1816         type: 'SAVE_ENTITY_RECORD_FINISH',
       
  1817         kind,
       
  1818         name,
       
  1819         recordId,
       
  1820         error,
       
  1821         isAutosave
       
  1822       });
       
  1823 
       
  1824       if (hasError && throwOnError) {
       
  1825         throw error;
       
  1826       }
       
  1827 
       
  1828       return updatedRecord;
       
  1829     } finally {
       
  1830       dispatch.__unstableReleaseStoreLock(lock);
  1608     }
  1831     }
  1609 
  1832   };
  1610     yield {
  1833 };
  1611       type: 'SAVE_ENTITY_RECORD_START',
       
  1612       kind,
       
  1613       name,
       
  1614       recordId,
       
  1615       isAutosave
       
  1616     };
       
  1617     let updatedRecord;
       
  1618     let error;
       
  1619 
       
  1620     try {
       
  1621       const path = `${entity.baseURL}${recordId ? '/' + recordId : ''}`;
       
  1622       const persistedRecord = yield external_wp_data_["controls"].select('core', 'getRawEntityRecord', kind, name, recordId);
       
  1623 
       
  1624       if (isAutosave) {
       
  1625         // Most of this autosave logic is very specific to posts.
       
  1626         // This is fine for now as it is the only supported autosave,
       
  1627         // but ideally this should all be handled in the back end,
       
  1628         // so the client just sends and receives objects.
       
  1629         const currentUser = yield external_wp_data_["controls"].select('core', 'getCurrentUser');
       
  1630         const currentUserId = currentUser ? currentUser.id : undefined;
       
  1631         const autosavePost = yield external_wp_data_["controls"].select('core', 'getAutosave', persistedRecord.type, persistedRecord.id, currentUserId); // Autosaves need all expected fields to be present.
       
  1632         // So we fallback to the previous autosave and then
       
  1633         // to the actual persisted entity if the edits don't
       
  1634         // have a value.
       
  1635 
       
  1636         let data = { ...persistedRecord,
       
  1637           ...autosavePost,
       
  1638           ...record
       
  1639         };
       
  1640         data = Object.keys(data).reduce((acc, key) => {
       
  1641           if (['title', 'excerpt', 'content'].includes(key)) {
       
  1642             // Edits should be the "raw" attribute values.
       
  1643             acc[key] = Object(external_lodash_["get"])(data[key], 'raw', data[key]);
       
  1644           }
       
  1645 
       
  1646           return acc;
       
  1647         }, {
       
  1648           status: data.status === 'auto-draft' ? 'draft' : data.status
       
  1649         });
       
  1650         const options = {
       
  1651           path: `${path}/autosaves`,
       
  1652           method: 'POST',
       
  1653           data
       
  1654         };
       
  1655 
       
  1656         if (__unstableFetch) {
       
  1657           updatedRecord = yield Object(external_wp_dataControls_["__unstableAwaitPromise"])(__unstableFetch(options));
       
  1658         } else {
       
  1659           updatedRecord = yield Object(external_wp_dataControls_["apiFetch"])(options);
       
  1660         } // An autosave may be processed by the server as a regular save
       
  1661         // when its update is requested by the author and the post had
       
  1662         // draft or auto-draft status.
       
  1663 
       
  1664 
       
  1665         if (persistedRecord.id === updatedRecord.id) {
       
  1666           let newRecord = { ...persistedRecord,
       
  1667             ...data,
       
  1668             ...updatedRecord
       
  1669           };
       
  1670           newRecord = Object.keys(newRecord).reduce((acc, key) => {
       
  1671             // These properties are persisted in autosaves.
       
  1672             if (['title', 'excerpt', 'content'].includes(key)) {
       
  1673               // Edits should be the "raw" attribute values.
       
  1674               acc[key] = Object(external_lodash_["get"])(newRecord[key], 'raw', newRecord[key]);
       
  1675             } else if (key === 'status') {
       
  1676               // Status is only persisted in autosaves when going from
       
  1677               // "auto-draft" to "draft".
       
  1678               acc[key] = persistedRecord.status === 'auto-draft' && newRecord.status === 'draft' ? newRecord.status : persistedRecord.status;
       
  1679             } else {
       
  1680               // These properties are not persisted in autosaves.
       
  1681               acc[key] = Object(external_lodash_["get"])(persistedRecord[key], 'raw', persistedRecord[key]);
       
  1682             }
       
  1683 
       
  1684             return acc;
       
  1685           }, {});
       
  1686           yield receiveEntityRecords(kind, name, newRecord, undefined, true);
       
  1687         } else {
       
  1688           yield receiveAutosaves(persistedRecord.id, updatedRecord);
       
  1689         }
       
  1690       } else {
       
  1691         let edits = record;
       
  1692 
       
  1693         if (entity.__unstablePrePersist) {
       
  1694           edits = { ...edits,
       
  1695             ...entity.__unstablePrePersist(persistedRecord, edits)
       
  1696           };
       
  1697         }
       
  1698 
       
  1699         const options = {
       
  1700           path,
       
  1701           method: recordId ? 'PUT' : 'POST',
       
  1702           data: edits
       
  1703         };
       
  1704 
       
  1705         if (__unstableFetch) {
       
  1706           updatedRecord = yield Object(external_wp_dataControls_["__unstableAwaitPromise"])(__unstableFetch(options));
       
  1707         } else {
       
  1708           updatedRecord = yield Object(external_wp_dataControls_["apiFetch"])(options);
       
  1709         }
       
  1710 
       
  1711         yield receiveEntityRecords(kind, name, updatedRecord, undefined, true, edits);
       
  1712       }
       
  1713     } catch (_error) {
       
  1714       error = _error;
       
  1715     }
       
  1716 
       
  1717     yield {
       
  1718       type: 'SAVE_ENTITY_RECORD_FINISH',
       
  1719       kind,
       
  1720       name,
       
  1721       recordId,
       
  1722       error,
       
  1723       isAutosave
       
  1724     };
       
  1725     return updatedRecord;
       
  1726   } finally {
       
  1727     yield* __unstableReleaseStoreLock(lock);
       
  1728   }
       
  1729 }
       
  1730 /**
  1834 /**
  1731  * Runs multiple core-data actions at the same time using one API request.
  1835  * Runs multiple core-data actions at the same time using one API request.
  1732  *
  1836  *
  1733  * Example:
  1837  * Example:
  1734  *
  1838  *
  1744  * @param {Array} requests Array of functions which are invoked simultaneously.
  1848  * @param {Array} requests Array of functions which are invoked simultaneously.
  1745  *                         Each function is passed an object containing
  1849  *                         Each function is passed an object containing
  1746  *                         `saveEntityRecord`, `saveEditedEntityRecord`, and
  1850  *                         `saveEntityRecord`, `saveEditedEntityRecord`, and
  1747  *                         `deleteEntityRecord`.
  1851  *                         `deleteEntityRecord`.
  1748  *
  1852  *
  1749  * @return {Promise} A promise that resolves to an array containing the return
  1853  * @return {(thunkArgs: Object) => Promise} A promise that resolves to an array containing the return
  1750  *                   values of each function given in `requests`.
  1854  *                                          values of each function given in `requests`.
  1751  */
  1855  */
  1752 
  1856 
  1753 function* __experimentalBatch(requests) {
  1857 const __experimentalBatch = requests => async _ref6 => {
       
  1858   let {
       
  1859     dispatch
       
  1860   } = _ref6;
  1754   const batch = createBatch();
  1861   const batch = createBatch();
  1755   const dispatch = yield getDispatch();
       
  1756   const api = {
  1862   const api = {
  1757     saveEntityRecord(kind, name, record, options) {
  1863     saveEntityRecord(kind, name, record, options) {
  1758       return batch.add(add => dispatch('core').saveEntityRecord(kind, name, record, { ...options,
  1864       return batch.add(add => dispatch.saveEntityRecord(kind, name, record, { ...options,
  1759         __unstableFetch: add
  1865         __unstableFetch: add
  1760       }));
  1866       }));
  1761     },
  1867     },
  1762 
  1868 
  1763     saveEditedEntityRecord(kind, name, recordId, options) {
  1869     saveEditedEntityRecord(kind, name, recordId, options) {
  1764       return batch.add(add => dispatch('core').saveEditedEntityRecord(kind, name, recordId, { ...options,
  1870       return batch.add(add => dispatch.saveEditedEntityRecord(kind, name, recordId, { ...options,
  1765         __unstableFetch: add
  1871         __unstableFetch: add
  1766       }));
  1872       }));
  1767     },
  1873     },
  1768 
  1874 
  1769     deleteEntityRecord(kind, name, recordId, query, options) {
  1875     deleteEntityRecord(kind, name, recordId, query, options) {
  1770       return batch.add(add => dispatch('core').deleteEntityRecord(kind, name, recordId, query, { ...options,
  1876       return batch.add(add => dispatch.deleteEntityRecord(kind, name, recordId, query, { ...options,
  1771         __unstableFetch: add
  1877         __unstableFetch: add
  1772       }));
  1878       }));
  1773     }
  1879     }
  1774 
  1880 
  1775   };
  1881   };
  1776   const resultPromises = requests.map(request => request(api));
  1882   const resultPromises = requests.map(request => request(api));
  1777   const [, ...results] = yield Object(external_wp_dataControls_["__unstableAwaitPromise"])(Promise.all([batch.run(), ...resultPromises]));
  1883   const [, ...results] = await Promise.all([batch.run(), ...resultPromises]);
  1778   return results;
  1884   return results;
  1779 }
  1885 };
  1780 /**
  1886 /**
  1781  * Action triggered to save an entity record's edits.
  1887  * Action triggered to save an entity record's edits.
  1782  *
  1888  *
  1783  * @param {string} kind     Kind of the entity.
  1889  * @param {string} kind     Kind of the entity.
  1784  * @param {string} name     Name of the entity.
  1890  * @param {string} name     Name of the entity.
  1785  * @param {Object} recordId ID of the record.
  1891  * @param {Object} recordId ID of the record.
  1786  * @param {Object} options  Saving options.
  1892  * @param {Object} options  Saving options.
  1787  */
  1893  */
  1788 
  1894 
  1789 function* saveEditedEntityRecord(kind, name, recordId, options) {
  1895 const saveEditedEntityRecord = (kind, name, recordId, options) => async _ref7 => {
  1790   if (!(yield external_wp_data_["controls"].select('core', 'hasEditsForEntityRecord', kind, name, recordId))) {
  1896   let {
       
  1897     select,
       
  1898     dispatch
       
  1899   } = _ref7;
       
  1900 
       
  1901   if (!select.hasEditsForEntityRecord(kind, name, recordId)) {
  1791     return;
  1902     return;
  1792   }
  1903   }
  1793 
  1904 
  1794   const edits = yield external_wp_data_["controls"].select('core', 'getEntityRecordNonTransientEdits', kind, name, recordId);
  1905   const configs = await dispatch(getOrLoadEntitiesConfig(kind));
       
  1906   const entityConfig = (0,external_lodash_namespaceObject.find)(configs, {
       
  1907     kind,
       
  1908     name
       
  1909   });
       
  1910 
       
  1911   if (!entityConfig) {
       
  1912     return;
       
  1913   }
       
  1914 
       
  1915   const entityIdKey = entityConfig.key || DEFAULT_ENTITY_KEY;
       
  1916   const edits = select.getEntityRecordNonTransientEdits(kind, name, recordId);
  1795   const record = {
  1917   const record = {
  1796     id: recordId,
  1918     [entityIdKey]: recordId,
  1797     ...edits
  1919     ...edits
  1798   };
  1920   };
  1799   return yield* saveEntityRecord(kind, name, record, options);
  1921   return await dispatch.saveEntityRecord(kind, name, record, options);
  1800 }
  1922 };
  1801 /**
  1923 /**
  1802  * Action triggered to save only specified properties for the entity.
  1924  * Action triggered to save only specified properties for the entity.
  1803  *
  1925  *
  1804  * @param {string} kind     Kind of the entity.
  1926  * @param {string} kind        Kind of the entity.
  1805  * @param {string} name     Name of the entity.
  1927  * @param {string} name        Name of the entity.
  1806  * @param {Object} recordId ID of the record.
  1928  * @param {Object} recordId    ID of the record.
  1807  * @param {Array} itemsToSave List of entity properties to save.
  1929  * @param {Array}  itemsToSave List of entity properties to save.
  1808  * @param {Object} options  Saving options.
  1930  * @param {Object} options     Saving options.
  1809  */
  1931  */
  1810 
  1932 
  1811 function* __experimentalSaveSpecifiedEntityEdits(kind, name, recordId, itemsToSave, options) {
  1933 const __experimentalSaveSpecifiedEntityEdits = (kind, name, recordId, itemsToSave, options) => async _ref8 => {
  1812   if (!(yield external_wp_data_["controls"].select('core', 'hasEditsForEntityRecord', kind, name, recordId))) {
  1934   let {
       
  1935     select,
       
  1936     dispatch
       
  1937   } = _ref8;
       
  1938 
       
  1939   if (!select.hasEditsForEntityRecord(kind, name, recordId)) {
  1813     return;
  1940     return;
  1814   }
  1941   }
  1815 
  1942 
  1816   const edits = yield external_wp_data_["controls"].select('core', 'getEntityRecordNonTransientEdits', kind, name, recordId);
  1943   const edits = select.getEntityRecordNonTransientEdits(kind, name, recordId);
  1817   const editsToSave = {};
  1944   const editsToSave = {};
  1818 
  1945 
  1819   for (const edit in edits) {
  1946   for (const edit in edits) {
  1820     if (itemsToSave.some(item => item === edit)) {
  1947     if (itemsToSave.some(item => item === edit)) {
  1821       editsToSave[edit] = edits[edit];
  1948       editsToSave[edit] = edits[edit];
  1822     }
  1949     }
  1823   }
  1950   }
  1824 
  1951 
  1825   return yield* saveEntityRecord(kind, name, editsToSave, options);
  1952   return await dispatch.saveEntityRecord(kind, name, editsToSave, options);
  1826 }
  1953 };
  1827 /**
  1954 /**
  1828  * Returns an action object used in signalling that Upload permissions have been received.
  1955  * Returns an action object used in signalling that Upload permissions have been received.
  1829  *
  1956  *
       
  1957  * @deprecated since WP 5.9, use receiveUserPermission instead.
       
  1958  *
  1830  * @param {boolean} hasUploadPermissions Does the user have permission to upload files?
  1959  * @param {boolean} hasUploadPermissions Does the user have permission to upload files?
  1831  *
  1960  *
  1832  * @return {Object} Action object.
  1961  * @return {Object} Action object.
  1833  */
  1962  */
  1834 
  1963 
  1835 function receiveUploadPermissions(hasUploadPermissions) {
  1964 function receiveUploadPermissions(hasUploadPermissions) {
  1836   return {
  1965   external_wp_deprecated_default()("wp.data.dispatch( 'core' ).receiveUploadPermissions", {
  1837     type: 'RECEIVE_USER_PERMISSION',
  1966     since: '5.9',
  1838     key: 'create/media',
  1967     alternative: 'receiveUserPermission'
  1839     isAllowed: hasUploadPermissions
  1968   });
  1840   };
  1969   return receiveUserPermission('create/media', hasUploadPermissions);
  1841 }
  1970 }
  1842 /**
  1971 /**
  1843  * Returns an action object used in signalling that the current user has
  1972  * Returns an action object used in signalling that the current user has
  1844  * permission to perform an action on a REST resource.
  1973  * permission to perform an action on a REST resource.
  1845  *
  1974  *
  1868 
  1997 
  1869 function receiveAutosaves(postId, autosaves) {
  1998 function receiveAutosaves(postId, autosaves) {
  1870   return {
  1999   return {
  1871     type: 'RECEIVE_AUTOSAVES',
  2000     type: 'RECEIVE_AUTOSAVES',
  1872     postId,
  2001     postId,
  1873     autosaves: Object(external_lodash_["castArray"])(autosaves)
  2002     autosaves: (0,external_lodash_namespaceObject.castArray)(autosaves)
  1874   };
  2003   };
  1875 }
  2004 }
  1876 
  2005 
  1877 // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/entities.js
  2006 ;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/entities.js
  1878 /**
  2007 /**
  1879  * External dependencies
  2008  * External dependencies
  1880  */
  2009  */
  1881 
  2010 
  1882 /**
  2011 /**
  1883  * WordPress dependencies
  2012  * WordPress dependencies
  1884  */
  2013  */
  1885 
  2014 
  1886 
  2015 
  1887 
  2016 
  1888 
       
  1889 /**
  2017 /**
  1890  * Internal dependencies
  2018  * Internal dependencies
  1891  */
  2019  */
  1892 
  2020 
  1893 
  2021 
  1894 const DEFAULT_ENTITY_KEY = 'id';
  2022 const DEFAULT_ENTITY_KEY = 'id';
  1895 const defaultEntities = [{
  2023 const POST_RAW_ATTRIBUTES = ['title', 'excerpt', 'content'];
  1896   label: Object(external_wp_i18n_["__"])('Base'),
  2024 const rootEntitiesConfig = [{
       
  2025   label: (0,external_wp_i18n_namespaceObject.__)('Base'),
  1897   name: '__unstableBase',
  2026   name: '__unstableBase',
  1898   kind: 'root',
  2027   kind: 'root',
  1899   baseURL: ''
  2028   baseURL: '/',
       
  2029   baseURLParams: {
       
  2030     _fields: ['description', 'gmt_offset', 'home', 'name', 'site_icon', 'site_icon_url', 'site_logo', 'timezone_string', 'url'].join(',')
       
  2031   }
  1900 }, {
  2032 }, {
  1901   label: Object(external_wp_i18n_["__"])('Site'),
  2033   label: (0,external_wp_i18n_namespaceObject.__)('Site'),
  1902   name: 'site',
  2034   name: 'site',
  1903   kind: 'root',
  2035   kind: 'root',
  1904   baseURL: '/wp/v2/settings',
  2036   baseURL: '/wp/v2/settings',
  1905   getTitle: record => {
  2037   getTitle: record => {
  1906     return Object(external_lodash_["get"])(record, ['title'], Object(external_wp_i18n_["__"])('Site Title'));
  2038     return (0,external_lodash_namespaceObject.get)(record, ['title'], (0,external_wp_i18n_namespaceObject.__)('Site Title'));
  1907   }
  2039   }
  1908 }, {
  2040 }, {
  1909   label: Object(external_wp_i18n_["__"])('Post Type'),
  2041   label: (0,external_wp_i18n_namespaceObject.__)('Post Type'),
  1910   name: 'postType',
  2042   name: 'postType',
  1911   kind: 'root',
  2043   kind: 'root',
  1912   key: 'slug',
  2044   key: 'slug',
  1913   baseURL: '/wp/v2/types',
  2045   baseURL: '/wp/v2/types',
  1914   baseURLParams: {
  2046   baseURLParams: {
  1915     context: 'edit'
  2047     context: 'edit'
  1916   }
  2048   },
       
  2049   rawAttributes: POST_RAW_ATTRIBUTES
  1917 }, {
  2050 }, {
  1918   name: 'media',
  2051   name: 'media',
  1919   kind: 'root',
  2052   kind: 'root',
  1920   baseURL: '/wp/v2/media',
  2053   baseURL: '/wp/v2/media',
  1921   baseURLParams: {
  2054   baseURLParams: {
  1922     context: 'edit'
  2055     context: 'edit'
  1923   },
  2056   },
  1924   plural: 'mediaItems',
  2057   plural: 'mediaItems',
  1925   label: Object(external_wp_i18n_["__"])('Media')
  2058   label: (0,external_wp_i18n_namespaceObject.__)('Media'),
       
  2059   rawAttributes: ['caption', 'title', 'description']
  1926 }, {
  2060 }, {
  1927   name: 'taxonomy',
  2061   name: 'taxonomy',
  1928   kind: 'root',
  2062   kind: 'root',
  1929   key: 'slug',
  2063   key: 'slug',
  1930   baseURL: '/wp/v2/taxonomies',
  2064   baseURL: '/wp/v2/taxonomies',
  1931   baseURLParams: {
  2065   baseURLParams: {
  1932     context: 'edit'
  2066     context: 'edit'
  1933   },
  2067   },
  1934   plural: 'taxonomies',
  2068   plural: 'taxonomies',
  1935   label: Object(external_wp_i18n_["__"])('Taxonomy')
  2069   label: (0,external_wp_i18n_namespaceObject.__)('Taxonomy')
  1936 }, {
  2070 }, {
  1937   name: 'sidebar',
  2071   name: 'sidebar',
  1938   kind: 'root',
  2072   kind: 'root',
  1939   baseURL: '/wp/v2/sidebars',
  2073   baseURL: '/wp/v2/sidebars',
  1940   plural: 'sidebars',
  2074   plural: 'sidebars',
  1941   transientEdits: {
  2075   transientEdits: {
  1942     blocks: true
  2076     blocks: true
  1943   },
  2077   },
  1944   label: Object(external_wp_i18n_["__"])('Widget areas')
  2078   label: (0,external_wp_i18n_namespaceObject.__)('Widget areas')
  1945 }, {
  2079 }, {
  1946   name: 'widget',
  2080   name: 'widget',
  1947   kind: 'root',
  2081   kind: 'root',
  1948   baseURL: '/wp/v2/widgets',
  2082   baseURL: '/wp/v2/widgets',
  1949   baseURLParams: {
  2083   baseURLParams: {
  1951   },
  2085   },
  1952   plural: 'widgets',
  2086   plural: 'widgets',
  1953   transientEdits: {
  2087   transientEdits: {
  1954     blocks: true
  2088     blocks: true
  1955   },
  2089   },
  1956   label: Object(external_wp_i18n_["__"])('Widgets')
  2090   label: (0,external_wp_i18n_namespaceObject.__)('Widgets')
  1957 }, {
  2091 }, {
  1958   name: 'widgetType',
  2092   name: 'widgetType',
  1959   kind: 'root',
  2093   kind: 'root',
  1960   baseURL: '/wp/v2/widget-types',
  2094   baseURL: '/wp/v2/widget-types',
  1961   baseURLParams: {
  2095   baseURLParams: {
  1962     context: 'edit'
  2096     context: 'edit'
  1963   },
  2097   },
  1964   plural: 'widgetTypes',
  2098   plural: 'widgetTypes',
  1965   label: Object(external_wp_i18n_["__"])('Widget types')
  2099   label: (0,external_wp_i18n_namespaceObject.__)('Widget types')
  1966 }, {
  2100 }, {
  1967   label: Object(external_wp_i18n_["__"])('User'),
  2101   label: (0,external_wp_i18n_namespaceObject.__)('User'),
  1968   name: 'user',
  2102   name: 'user',
  1969   kind: 'root',
  2103   kind: 'root',
  1970   baseURL: '/wp/v2/users',
  2104   baseURL: '/wp/v2/users',
  1971   baseURLParams: {
  2105   baseURLParams: {
  1972     context: 'edit'
  2106     context: 'edit'
  1978   baseURL: '/wp/v2/comments',
  2112   baseURL: '/wp/v2/comments',
  1979   baseURLParams: {
  2113   baseURLParams: {
  1980     context: 'edit'
  2114     context: 'edit'
  1981   },
  2115   },
  1982   plural: 'comments',
  2116   plural: 'comments',
  1983   label: Object(external_wp_i18n_["__"])('Comment')
  2117   label: (0,external_wp_i18n_namespaceObject.__)('Comment')
  1984 }, {
  2118 }, {
  1985   name: 'menu',
  2119   name: 'menu',
  1986   kind: 'root',
  2120   kind: 'root',
  1987   baseURL: '/__experimental/menus',
  2121   baseURL: '/wp/v2/menus',
  1988   baseURLParams: {
  2122   baseURLParams: {
  1989     context: 'edit'
  2123     context: 'edit'
  1990   },
  2124   },
  1991   plural: 'menus',
  2125   plural: 'menus',
  1992   label: Object(external_wp_i18n_["__"])('Menu')
  2126   label: (0,external_wp_i18n_namespaceObject.__)('Menu')
  1993 }, {
  2127 }, {
  1994   name: 'menuItem',
  2128   name: 'menuItem',
  1995   kind: 'root',
  2129   kind: 'root',
  1996   baseURL: '/__experimental/menu-items',
  2130   baseURL: '/wp/v2/menu-items',
  1997   baseURLParams: {
  2131   baseURLParams: {
  1998     context: 'edit'
  2132     context: 'edit'
  1999   },
  2133   },
  2000   plural: 'menuItems',
  2134   plural: 'menuItems',
  2001   label: Object(external_wp_i18n_["__"])('Menu Item')
  2135   label: (0,external_wp_i18n_namespaceObject.__)('Menu Item'),
       
  2136   rawAttributes: ['title', 'content']
  2002 }, {
  2137 }, {
  2003   name: 'menuLocation',
  2138   name: 'menuLocation',
  2004   kind: 'root',
  2139   kind: 'root',
  2005   baseURL: '/__experimental/menu-locations',
  2140   baseURL: '/wp/v2/menu-locations',
  2006   baseURLParams: {
  2141   baseURLParams: {
  2007     context: 'edit'
  2142     context: 'edit'
  2008   },
  2143   },
  2009   plural: 'menuLocations',
  2144   plural: 'menuLocations',
  2010   label: Object(external_wp_i18n_["__"])('Menu Location'),
  2145   label: (0,external_wp_i18n_namespaceObject.__)('Menu Location'),
  2011   key: 'name'
  2146   key: 'name'
       
  2147 }, {
       
  2148   label: (0,external_wp_i18n_namespaceObject.__)('Global Styles'),
       
  2149   name: 'globalStyles',
       
  2150   kind: 'root',
       
  2151   baseURL: '/wp/v2/global-styles',
       
  2152   baseURLParams: {
       
  2153     context: 'edit'
       
  2154   },
       
  2155   plural: 'globalStylesVariations',
       
  2156   // Should be different than name.
       
  2157   getTitle: record => {
       
  2158     var _record$title;
       
  2159 
       
  2160     return (record === null || record === void 0 ? void 0 : (_record$title = record.title) === null || _record$title === void 0 ? void 0 : _record$title.rendered) || (record === null || record === void 0 ? void 0 : record.title);
       
  2161   }
       
  2162 }, {
       
  2163   label: (0,external_wp_i18n_namespaceObject.__)('Themes'),
       
  2164   name: 'theme',
       
  2165   kind: 'root',
       
  2166   baseURL: '/wp/v2/themes',
       
  2167   baseURLParams: {
       
  2168     context: 'edit'
       
  2169   },
       
  2170   key: 'stylesheet'
       
  2171 }, {
       
  2172   label: (0,external_wp_i18n_namespaceObject.__)('Plugins'),
       
  2173   name: 'plugin',
       
  2174   kind: 'root',
       
  2175   baseURL: '/wp/v2/plugins',
       
  2176   baseURLParams: {
       
  2177     context: 'edit'
       
  2178   },
       
  2179   key: 'plugin'
  2012 }];
  2180 }];
  2013 const kinds = [{
  2181 const additionalEntityConfigLoaders = [{
  2014   name: 'postType',
  2182   kind: 'postType',
  2015   loadEntities: loadPostTypeEntities
  2183   loadEntities: loadPostTypeEntities
  2016 }, {
  2184 }, {
  2017   name: 'taxonomy',
  2185   kind: 'taxonomy',
  2018   loadEntities: loadTaxonomyEntities
  2186   loadEntities: loadTaxonomyEntities
  2019 }];
  2187 }];
  2020 /**
  2188 /**
  2021  * Returns a function to be used to retrieve extra edits to apply before persisting a post type.
  2189  * Returns a function to be used to retrieve extra edits to apply before persisting a post type.
  2022  *
  2190  *
  2023  * @param {Object} persistedRecord Already persisted Post
  2191  * @param {Object} persistedRecord Already persisted Post
  2024  * @param {Object} edits Edits.
  2192  * @param {Object} edits           Edits.
  2025  * @return {Object} Updated edits.
  2193  * @return {Object} Updated edits.
  2026  */
  2194  */
  2027 
  2195 
  2028 const prePersistPostType = (persistedRecord, edits) => {
  2196 const prePersistPostType = (persistedRecord, edits) => {
  2029   const newEdits = {};
  2197   const newEdits = {};
  2046  * Returns the list of post type entities.
  2214  * Returns the list of post type entities.
  2047  *
  2215  *
  2048  * @return {Promise} Entities promise
  2216  * @return {Promise} Entities promise
  2049  */
  2217  */
  2050 
  2218 
  2051 function* loadPostTypeEntities() {
  2219 async function loadPostTypeEntities() {
  2052   const postTypes = yield Object(external_wp_dataControls_["apiFetch"])({
  2220   const postTypes = await external_wp_apiFetch_default()({
  2053     path: '/wp/v2/types?context=edit'
  2221     path: '/wp/v2/types?context=view'
  2054   });
  2222   });
  2055   return Object(external_lodash_["map"])(postTypes, (postType, name) => {
  2223   return (0,external_lodash_namespaceObject.map)(postTypes, (postType, name) => {
       
  2224     var _postType$rest_namesp;
       
  2225 
  2056     const isTemplate = ['wp_template', 'wp_template_part'].includes(name);
  2226     const isTemplate = ['wp_template', 'wp_template_part'].includes(name);
       
  2227     const namespace = (_postType$rest_namesp = postType === null || postType === void 0 ? void 0 : postType.rest_namespace) !== null && _postType$rest_namesp !== void 0 ? _postType$rest_namesp : 'wp/v2';
  2057     return {
  2228     return {
  2058       kind: 'postType',
  2229       kind: 'postType',
  2059       baseURL: '/wp/v2/' + postType.rest_base,
  2230       baseURL: `/${namespace}/${postType.rest_base}`,
  2060       baseURLParams: {
  2231       baseURLParams: {
  2061         context: 'edit'
  2232         context: 'edit'
  2062       },
  2233       },
  2063       name,
  2234       name,
  2064       label: postType.labels.singular_name,
  2235       label: postType.name,
  2065       transientEdits: {
  2236       transientEdits: {
  2066         blocks: true,
  2237         blocks: true,
  2067         selection: true
  2238         selection: true
  2068       },
  2239       },
  2069       mergedEdits: {
  2240       mergedEdits: {
  2070         meta: true
  2241         meta: true
  2071       },
  2242       },
       
  2243       rawAttributes: POST_RAW_ATTRIBUTES,
  2072       getTitle: record => {
  2244       getTitle: record => {
  2073         var _record$title;
  2245         var _record$title2;
  2074 
  2246 
  2075         return (record === null || record === void 0 ? void 0 : (_record$title = record.title) === null || _record$title === void 0 ? void 0 : _record$title.rendered) || (record === null || record === void 0 ? void 0 : record.title) || (isTemplate ? Object(external_lodash_["startCase"])(record.slug) : String(record.id));
  2247         return (record === null || record === void 0 ? void 0 : (_record$title2 = record.title) === null || _record$title2 === void 0 ? void 0 : _record$title2.rendered) || (record === null || record === void 0 ? void 0 : record.title) || (isTemplate ? (0,external_lodash_namespaceObject.startCase)(record.slug) : String(record.id));
  2076       },
  2248       },
  2077       __unstablePrePersist: isTemplate ? undefined : prePersistPostType,
  2249       __unstablePrePersist: isTemplate ? undefined : prePersistPostType,
  2078       __unstable_rest_base: postType.rest_base
  2250       __unstable_rest_base: postType.rest_base
  2079     };
  2251     };
  2080   });
  2252   });
  2084  *
  2256  *
  2085  * @return {Promise} Entities promise
  2257  * @return {Promise} Entities promise
  2086  */
  2258  */
  2087 
  2259 
  2088 
  2260 
  2089 function* loadTaxonomyEntities() {
  2261 async function loadTaxonomyEntities() {
  2090   const taxonomies = yield Object(external_wp_dataControls_["apiFetch"])({
  2262   const taxonomies = await external_wp_apiFetch_default()({
  2091     path: '/wp/v2/taxonomies?context=edit'
  2263     path: '/wp/v2/taxonomies?context=view'
  2092   });
  2264   });
  2093   return Object(external_lodash_["map"])(taxonomies, (taxonomy, name) => {
  2265   return (0,external_lodash_namespaceObject.map)(taxonomies, (taxonomy, name) => {
       
  2266     var _taxonomy$rest_namesp;
       
  2267 
       
  2268     const namespace = (_taxonomy$rest_namesp = taxonomy === null || taxonomy === void 0 ? void 0 : taxonomy.rest_namespace) !== null && _taxonomy$rest_namesp !== void 0 ? _taxonomy$rest_namesp : 'wp/v2';
  2094     return {
  2269     return {
  2095       kind: 'taxonomy',
  2270       kind: 'taxonomy',
  2096       baseURL: '/wp/v2/' + taxonomy.rest_base,
  2271       baseURL: `/${namespace}/${taxonomy.rest_base}`,
  2097       baseURLParams: {
  2272       baseURLParams: {
  2098         context: 'edit'
  2273         context: 'edit'
  2099       },
  2274       },
  2100       name,
  2275       name,
  2101       label: taxonomy.labels.singular_name
  2276       label: taxonomy.name
  2102     };
  2277     };
  2103   });
  2278   });
  2104 }
  2279 }
  2105 /**
  2280 /**
  2106  * Returns the entity's getter method name given its kind and name.
  2281  * Returns the entity's getter method name given its kind and name.
       
  2282  *
       
  2283  * @example
       
  2284  * ```js
       
  2285  * const nameSingular = getMethodName( 'root', 'theme', 'get' );
       
  2286  * // nameSingular is getRootTheme
       
  2287  *
       
  2288  * const namePlural = getMethodName( 'root', 'theme', 'set' );
       
  2289  * // namePlural is setRootThemes
       
  2290  * ```
  2107  *
  2291  *
  2108  * @param {string}  kind      Entity kind.
  2292  * @param {string}  kind      Entity kind.
  2109  * @param {string}  name      Entity name.
  2293  * @param {string}  name      Entity name.
  2110  * @param {string}  prefix    Function prefix.
  2294  * @param {string}  prefix    Function prefix.
  2111  * @param {boolean} usePlural Whether to use the plural form or not.
  2295  * @param {boolean} usePlural Whether to use the plural form or not.
  2112  *
  2296  *
  2113  * @return {string} Method name
  2297  * @return {string} Method name
  2114  */
  2298  */
  2115 
  2299 
  2116 
  2300 
  2117 const getMethodName = (kind, name, prefix = 'get', usePlural = false) => {
  2301 const getMethodName = function (kind, name) {
  2118   const entity = Object(external_lodash_["find"])(defaultEntities, {
  2302   let prefix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'get';
       
  2303   let usePlural = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
       
  2304   const entityConfig = (0,external_lodash_namespaceObject.find)(rootEntitiesConfig, {
  2119     kind,
  2305     kind,
  2120     name
  2306     name
  2121   });
  2307   });
  2122   const kindPrefix = kind === 'root' ? '' : Object(external_lodash_["upperFirst"])(Object(external_lodash_["camelCase"])(kind));
  2308   const kindPrefix = kind === 'root' ? '' : (0,external_lodash_namespaceObject.upperFirst)((0,external_lodash_namespaceObject.camelCase)(kind));
  2123   const nameSuffix = Object(external_lodash_["upperFirst"])(Object(external_lodash_["camelCase"])(name)) + (usePlural ? 's' : '');
  2309   const nameSuffix = (0,external_lodash_namespaceObject.upperFirst)((0,external_lodash_namespaceObject.camelCase)(name)) + (usePlural ? 's' : '');
  2124   const suffix = usePlural && entity.plural ? Object(external_lodash_["upperFirst"])(Object(external_lodash_["camelCase"])(entity.plural)) : nameSuffix;
  2310   const suffix = usePlural && entityConfig !== null && entityConfig !== void 0 && entityConfig.plural ? (0,external_lodash_namespaceObject.upperFirst)((0,external_lodash_namespaceObject.camelCase)(entityConfig.plural)) : nameSuffix;
  2125   return `${prefix}${kindPrefix}${suffix}`;
  2311   return `${prefix}${kindPrefix}${suffix}`;
  2126 };
  2312 };
  2127 /**
  2313 /**
  2128  * Loads the kind entities into the store.
  2314  * Loads the kind entities into the store.
  2129  *
  2315  *
  2130  * @param {string} kind  Kind
  2316  * @param {string} kind Kind
  2131  *
  2317  *
  2132  * @return {Array} Entities
  2318  * @return {(thunkArgs: object) => Promise<Array>} Entities
  2133  */
  2319  */
  2134 
  2320 
  2135 function* getKindEntities(kind) {
  2321 const getOrLoadEntitiesConfig = kind => async _ref => {
  2136   let entities = yield external_wp_data_["controls"].select('core', 'getEntitiesByKind', kind);
  2322   let {
  2137 
  2323     select,
  2138   if (entities && entities.length !== 0) {
  2324     dispatch
  2139     return entities;
  2325   } = _ref;
  2140   }
  2326   let configs = select.getEntitiesConfig(kind);
  2141 
  2327 
  2142   const kindConfig = Object(external_lodash_["find"])(kinds, {
  2328   if (configs && configs.length !== 0) {
  2143     name: kind
  2329     return configs;
       
  2330   }
       
  2331 
       
  2332   const loader = (0,external_lodash_namespaceObject.find)(additionalEntityConfigLoaders, {
       
  2333     kind
  2144   });
  2334   });
  2145 
  2335 
  2146   if (!kindConfig) {
  2336   if (!loader) {
  2147     return [];
  2337     return [];
  2148   }
  2338   }
  2149 
  2339 
  2150   entities = yield kindConfig.loadEntities();
  2340   configs = await loader.loadEntities();
  2151   yield addEntities(entities);
  2341   dispatch(addEntities(configs));
  2152   return entities;
  2342   return configs;
  2153 }
  2343 };
  2154 
  2344 
  2155 // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/utils/get-normalized-comma-separable.js
  2345 ;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/utils/get-normalized-comma-separable.js
  2156 /**
  2346 /**
  2157  * Given a value which can be specified as one or the other of a comma-separated
  2347  * Given a value which can be specified as one or the other of a comma-separated
  2158  * string or an array, returns a value normalized to an array of strings, or
  2348  * string or an array, returns a value normalized to an array of strings, or
  2159  * null if the value cannot be interpreted as either.
  2349  * null if the value cannot be interpreted as either.
  2160  *
  2350  *
  2172   return null;
  2362   return null;
  2173 }
  2363 }
  2174 
  2364 
  2175 /* harmony default export */ var get_normalized_comma_separable = (getNormalizedCommaSeparable);
  2365 /* harmony default export */ var get_normalized_comma_separable = (getNormalizedCommaSeparable);
  2176 
  2366 
  2177 // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/utils/with-weak-map-cache.js
  2367 ;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/utils/with-weak-map-cache.js
  2178 /**
  2368 /**
  2179  * External dependencies
  2369  * External dependencies
  2180  */
  2370  */
  2181 
  2371 
  2182 /**
  2372 /**
  2199     } else {
  2389     } else {
  2200       value = fn(key); // Can reach here if key is not valid for WeakMap, since `has`
  2390       value = fn(key); // Can reach here if key is not valid for WeakMap, since `has`
  2201       // will return false for invalid key. Since `set` will throw,
  2391       // will return false for invalid key. Since `set` will throw,
  2202       // ensure that key is valid before setting into cache.
  2392       // ensure that key is valid before setting into cache.
  2203 
  2393 
  2204       if (Object(external_lodash_["isObjectLike"])(key)) {
  2394       if ((0,external_lodash_namespaceObject.isObjectLike)(key)) {
  2205         cache.set(key, value);
  2395         cache.set(key, value);
  2206       }
  2396       }
  2207     }
  2397     }
  2208 
  2398 
  2209     return value;
  2399     return value;
  2210   };
  2400   };
  2211 }
  2401 }
  2212 
  2402 
  2213 /* harmony default export */ var with_weak_map_cache = (withWeakMapCache);
  2403 /* harmony default export */ var with_weak_map_cache = (withWeakMapCache);
  2214 
  2404 
  2215 // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/queried-data/get-query-parts.js
  2405 ;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/queried-data/get-query-parts.js
  2216 /**
  2406 /**
  2217  * WordPress dependencies
  2407  * WordPress dependencies
  2218  */
  2408  */
  2219 
  2409 
  2220 /**
  2410 /**
  2232  * @property {string}      stableKey An encoded stable string of all non-
  2422  * @property {string}      stableKey An encoded stable string of all non-
  2233  *                                   pagination, non-fields query parameters.
  2423  *                                   pagination, non-fields query parameters.
  2234  * @property {?(string[])} fields    Target subset of fields to derive from
  2424  * @property {?(string[])} fields    Target subset of fields to derive from
  2235  *                                   item objects.
  2425  *                                   item objects.
  2236  * @property {?(number[])} include   Specific item IDs to include.
  2426  * @property {?(number[])} include   Specific item IDs to include.
       
  2427  * @property {string}      context   Scope under which the request is made;
       
  2428  *                                   determines returned fields in response.
  2237  */
  2429  */
  2238 
  2430 
  2239 /**
  2431 /**
  2240  * Given a query object, returns an object of parts, including pagination
  2432  * Given a query object, returns an object of parts, including pagination
  2241  * details (`page` and `perPage`, or default values). All other properties are
  2433  * details (`page` and `perPage`, or default values). All other properties are
  2272 
  2464 
  2273       case 'per_page':
  2465       case 'per_page':
  2274         parts.perPage = Number(value);
  2466         parts.perPage = Number(value);
  2275         break;
  2467         break;
  2276 
  2468 
  2277       case 'include':
       
  2278         parts.include = get_normalized_comma_separable(value).map(Number);
       
  2279         break;
       
  2280 
       
  2281       case 'context':
  2469       case 'context':
  2282         parts.context = value;
  2470         parts.context = value;
  2283         break;
  2471         break;
  2284 
  2472 
  2285       default:
  2473       default:
  2286         // While in theory, we could exclude "_fields" from the stableKey
  2474         // While in theory, we could exclude "_fields" from the stableKey
  2287         // because two request with different fields have the same results
  2475         // because two request with different fields have the same results
  2288         // We're not able to ensure that because the server can decide to omit
  2476         // We're not able to ensure that because the server can decide to omit
  2289         // fields from the response even if we explicitely asked for it.
  2477         // fields from the response even if we explicitly asked for it.
  2290         // Example: Asking for titles in posts without title support.
  2478         // Example: Asking for titles in posts without title support.
  2291         if (key === '_fields') {
  2479         if (key === '_fields') {
  2292           parts.fields = get_normalized_comma_separable(value); // Make sure to normalize value for `stableKey`
  2480           var _getNormalizedCommaSe;
       
  2481 
       
  2482           parts.fields = (_getNormalizedCommaSe = get_normalized_comma_separable(value)) !== null && _getNormalizedCommaSe !== void 0 ? _getNormalizedCommaSe : []; // Make sure to normalize value for `stableKey`
  2293 
  2483 
  2294           value = parts.fields.join();
  2484           value = parts.fields.join();
       
  2485         } // Two requests with different include values cannot have same results.
       
  2486 
       
  2487 
       
  2488         if (key === 'include') {
       
  2489           var _getNormalizedCommaSe2;
       
  2490 
       
  2491           if (typeof value === 'number') {
       
  2492             value = value.toString();
       
  2493           }
       
  2494 
       
  2495           parts.include = ((_getNormalizedCommaSe2 = get_normalized_comma_separable(value)) !== null && _getNormalizedCommaSe2 !== void 0 ? _getNormalizedCommaSe2 : []).map(Number); // Normalize value for `stableKey`.
       
  2496 
       
  2497           value = parts.include.join();
  2295         } // While it could be any deterministic string, for simplicity's
  2498         } // While it could be any deterministic string, for simplicity's
  2296         // sake mimic querystring encoding for stable key.
  2499         // sake mimic querystring encoding for stable key.
  2297         //
  2500         //
  2298         // TODO: For consistency with PHP implementation, addQueryArgs
  2501         // TODO: For consistency with PHP implementation, addQueryArgs
  2299         // should accept a key value pair, which may optimize its
  2502         // should accept a key value pair, which may optimize its
  2300         // implementation for our use here, vs. iterating an object
  2503         // implementation for our use here, vs. iterating an object
  2301         // with only a single key.
  2504         // with only a single key.
  2302 
  2505 
  2303 
  2506 
  2304         parts.stableKey += (parts.stableKey ? '&' : '') + Object(external_wp_url_["addQueryArgs"])('', {
  2507         parts.stableKey += (parts.stableKey ? '&' : '') + (0,external_wp_url_namespaceObject.addQueryArgs)('', {
  2305           [key]: value
  2508           [key]: value
  2306         }).slice(1);
  2509         }).slice(1);
  2307     }
  2510     }
  2308   }
  2511   }
  2309 
  2512 
  2310   return parts;
  2513   return parts;
  2311 }
  2514 }
  2312 /* harmony default export */ var get_query_parts = (with_weak_map_cache(getQueryParts));
  2515 /* harmony default export */ var get_query_parts = (with_weak_map_cache(getQueryParts));
  2313 
  2516 
  2314 // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/queried-data/reducer.js
  2517 ;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/queried-data/reducer.js
  2315 /**
  2518 /**
  2316  * External dependencies
  2519  * External dependencies
  2317  */
  2520  */
  2318 
  2521 
  2319 /**
  2522 /**
  2353  * @return {number[]} Merged array of item IDs.
  2556  * @return {number[]} Merged array of item IDs.
  2354  */
  2557  */
  2355 
  2558 
  2356 
  2559 
  2357 function getMergedItemIds(itemIds, nextItemIds, page, perPage) {
  2560 function getMergedItemIds(itemIds, nextItemIds, page, perPage) {
       
  2561   var _itemIds$length;
       
  2562 
  2358   const receivedAllIds = page === 1 && perPage === -1;
  2563   const receivedAllIds = page === 1 && perPage === -1;
  2359 
  2564 
  2360   if (receivedAllIds) {
  2565   if (receivedAllIds) {
  2361     return nextItemIds;
  2566     return nextItemIds;
  2362   }
  2567   }
  2363 
  2568 
  2364   const nextItemIdsStartIndex = (page - 1) * perPage; // If later page has already been received, default to the larger known
  2569   const nextItemIdsStartIndex = (page - 1) * perPage; // If later page has already been received, default to the larger known
  2365   // size of the existing array, else calculate as extending the existing.
  2570   // size of the existing array, else calculate as extending the existing.
  2366 
  2571 
  2367   const size = Math.max(itemIds.length, nextItemIdsStartIndex + nextItemIds.length); // Preallocate array since size is known.
  2572   const size = Math.max((_itemIds$length = itemIds === null || itemIds === void 0 ? void 0 : itemIds.length) !== null && _itemIds$length !== void 0 ? _itemIds$length : 0, nextItemIdsStartIndex + nextItemIds.length); // Preallocate array since size is known.
  2368 
  2573 
  2369   const mergedItemIds = new Array(size);
  2574   const mergedItemIds = new Array(size);
  2370 
  2575 
  2371   for (let i = 0; i < size; i++) {
  2576   for (let i = 0; i < size; i++) {
  2372     // Preserve existing item ID except for subset of range of next items.
  2577     // Preserve existing item ID except for subset of range of next items.
  2373     const isInNextItemsRange = i >= nextItemIdsStartIndex && i < nextItemIdsStartIndex + nextItemIds.length;
  2578     const isInNextItemsRange = i >= nextItemIdsStartIndex && i < nextItemIdsStartIndex + nextItemIds.length;
  2374     mergedItemIds[i] = isInNextItemsRange ? nextItemIds[i - nextItemIdsStartIndex] : itemIds[i];
  2579     mergedItemIds[i] = isInNextItemsRange ? nextItemIds[i - nextItemIdsStartIndex] : itemIds === null || itemIds === void 0 ? void 0 : itemIds[i];
  2375   }
  2580   }
  2376 
  2581 
  2377   return mergedItemIds;
  2582   return mergedItemIds;
  2378 }
  2583 }
  2379 /**
  2584 /**
  2384  * @param {Object} action Dispatched action.
  2589  * @param {Object} action Dispatched action.
  2385  *
  2590  *
  2386  * @return {Object} Next state.
  2591  * @return {Object} Next state.
  2387  */
  2592  */
  2388 
  2593 
  2389 function reducer_items(state = {}, action) {
  2594 function items() {
       
  2595   let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
       
  2596   let action = arguments.length > 1 ? arguments[1] : undefined;
       
  2597 
  2390   switch (action.type) {
  2598   switch (action.type) {
  2391     case 'RECEIVE_ITEMS':
  2599     case 'RECEIVE_ITEMS':
  2392       {
  2600       {
  2393         const context = getContextFromAction(action);
  2601         const context = getContextFromAction(action);
  2394         const key = action.key || DEFAULT_ENTITY_KEY;
  2602         const key = action.key || DEFAULT_ENTITY_KEY;
  2404           }
  2612           }
  2405         };
  2613         };
  2406       }
  2614       }
  2407 
  2615 
  2408     case 'REMOVE_ITEMS':
  2616     case 'REMOVE_ITEMS':
  2409       return Object(external_lodash_["mapValues"])(state, contextState => Object(external_lodash_["omit"])(contextState, action.itemIds));
  2617       return (0,external_lodash_namespaceObject.mapValues)(state, contextState => (0,external_lodash_namespaceObject.omit)(contextState, action.itemIds));
  2410   }
  2618   }
  2411 
  2619 
  2412   return state;
  2620   return state;
  2413 }
  2621 }
  2414 /**
  2622 /**
  2416  * which all fields are known. This is used in supporting `_fields` queries,
  2624  * which all fields are known. This is used in supporting `_fields` queries,
  2417  * where not all properties associated with an entity are necessarily returned.
  2625  * where not all properties associated with an entity are necessarily returned.
  2418  * In such cases, completeness is used as an indication of whether it would be
  2626  * In such cases, completeness is used as an indication of whether it would be
  2419  * safe to use queried data for a non-`_fields`-limited request.
  2627  * safe to use queried data for a non-`_fields`-limited request.
  2420  *
  2628  *
  2421  * @param {Object<string,boolean>} state  Current state.
  2629  * @param {Object<string,Object<string,boolean>>} state  Current state.
  2422  * @param {Object} action Dispatched action.
  2630  * @param {Object}                                action Dispatched action.
  2423  *
  2631  *
  2424  * @return {Object<string,boolean>} Next state.
  2632  * @return {Object<string,Object<string,boolean>>} Next state.
  2425  */
  2633  */
  2426 
  2634 
  2427 function itemIsComplete(state = {}, action) {
  2635 function itemIsComplete() {
       
  2636   let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
       
  2637   let action = arguments.length > 1 ? arguments[1] : undefined;
       
  2638 
  2428   switch (action.type) {
  2639   switch (action.type) {
  2429     case 'RECEIVE_ITEMS':
  2640     case 'RECEIVE_ITEMS':
  2430       {
  2641       {
  2431         const context = getContextFromAction(action);
  2642         const context = getContextFromAction(action);
  2432         const {
  2643         const {
  2433           query,
  2644           query,
  2434           key = DEFAULT_ENTITY_KEY
  2645           key = DEFAULT_ENTITY_KEY
  2435         } = action; // An item is considered complete if it is received without an associated
  2646         } = action; // An item is considered complete if it is received without an associated
  2436         // fields query. Ideally, this would be implemented in such a way where the
  2647         // fields query. Ideally, this would be implemented in such a way where the
  2437         // complete aggregate of all fields would satisfy completeness. Since the
  2648         // complete aggregate of all fields would satisfy completeness. Since the
  2438         // fields are not consistent across all entity types, this would require
  2649         // fields are not consistent across all entities, this would require
  2439         // introspection on the REST schema for each entity to know which fields
  2650         // introspection on the REST schema for each entity to know which fields
  2440         // compose a complete item for that entity.
  2651         // compose a complete item for that entity.
  2441 
  2652 
  2442         const queryParts = query ? get_query_parts(query) : {};
  2653         const queryParts = query ? get_query_parts(query) : {};
  2443         const isCompleteQuery = !query || !Array.isArray(queryParts.fields);
  2654         const isCompleteQuery = !query || !Array.isArray(queryParts.fields);
  2455           }
  2666           }
  2456         };
  2667         };
  2457       }
  2668       }
  2458 
  2669 
  2459     case 'REMOVE_ITEMS':
  2670     case 'REMOVE_ITEMS':
  2460       return Object(external_lodash_["mapValues"])(state, contextState => Object(external_lodash_["omit"])(contextState, action.itemIds));
  2671       return (0,external_lodash_namespaceObject.mapValues)(state, contextState => (0,external_lodash_namespaceObject.omit)(contextState, action.itemIds));
  2461   }
  2672   }
  2462 
  2673 
  2463   return state;
  2674   return state;
  2464 }
  2675 }
  2465 /**
  2676 /**
  2470  * @param {Object} action Dispatched action.
  2681  * @param {Object} action Dispatched action.
  2471  *
  2682  *
  2472  * @return {Object} Next state.
  2683  * @return {Object} Next state.
  2473  */
  2684  */
  2474 
  2685 
  2475 const receiveQueries = Object(external_lodash_["flowRight"])([// Limit to matching action type so we don't attempt to replace action on
  2686 const receiveQueries = (0,external_lodash_namespaceObject.flowRight)([// Limit to matching action type so we don't attempt to replace action on
  2476 // an unhandled action.
  2687 // an unhandled action.
  2477 if_matching_action(action => 'query' in action), // Inject query parts into action for use both in `onSubKey` and reducer.
  2688 if_matching_action(action => 'query' in action), // Inject query parts into action for use both in `onSubKey` and reducer.
  2478 replace_action(action => {
  2689 replace_action(action => {
  2479   // `ifMatchingAction` still passes on initialization, where state is
  2690   // `ifMatchingAction` still passes on initialization, where state is
  2480   // undefined and a query is not assigned. Avoid attempting to parse
  2691   // undefined and a query is not assigned. Avoid attempting to parse
  2486   }
  2697   }
  2487 
  2698 
  2488   return action;
  2699   return action;
  2489 }), on_sub_key('context'), // Queries shape is shared, but keyed by query `stableKey` part. Original
  2700 }), on_sub_key('context'), // Queries shape is shared, but keyed by query `stableKey` part. Original
  2490 // reducer tracks only a single query object.
  2701 // reducer tracks only a single query object.
  2491 on_sub_key('stableKey')])((state = null, action) => {
  2702 on_sub_key('stableKey')])(function () {
       
  2703   let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
       
  2704   let action = arguments.length > 1 ? arguments[1] : undefined;
  2492   const {
  2705   const {
  2493     type,
  2706     type,
  2494     page,
  2707     page,
  2495     perPage,
  2708     perPage,
  2496     key = DEFAULT_ENTITY_KEY
  2709     key = DEFAULT_ENTITY_KEY
  2498 
  2711 
  2499   if (type !== 'RECEIVE_ITEMS') {
  2712   if (type !== 'RECEIVE_ITEMS') {
  2500     return state;
  2713     return state;
  2501   }
  2714   }
  2502 
  2715 
  2503   return getMergedItemIds(state || [], Object(external_lodash_["map"])(action.items, key), page, perPage);
  2716   return getMergedItemIds(state || [], (0,external_lodash_namespaceObject.map)(action.items, key), page, perPage);
  2504 });
  2717 });
  2505 /**
  2718 /**
  2506  * Reducer tracking queries state.
  2719  * Reducer tracking queries state.
  2507  *
  2720  *
  2508  * @param {Object} state  Current state.
  2721  * @param {Object} state  Current state.
  2509  * @param {Object} action Dispatched action.
  2722  * @param {Object} action Dispatched action.
  2510  *
  2723  *
  2511  * @return {Object} Next state.
  2724  * @return {Object} Next state.
  2512  */
  2725  */
  2513 
  2726 
  2514 const reducer_queries = (state = {}, action) => {
  2727 const queries = function () {
       
  2728   let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
       
  2729   let action = arguments.length > 1 ? arguments[1] : undefined;
       
  2730 
  2515   switch (action.type) {
  2731   switch (action.type) {
  2516     case 'RECEIVE_ITEMS':
  2732     case 'RECEIVE_ITEMS':
  2517       return receiveQueries(state, action);
  2733       return receiveQueries(state, action);
  2518 
  2734 
  2519     case 'REMOVE_ITEMS':
  2735     case 'REMOVE_ITEMS':
  2520       const removedItems = action.itemIds.reduce((result, itemId) => {
  2736       const removedItems = action.itemIds.reduce((result, itemId) => {
  2521         result[itemId] = true;
  2737         result[itemId] = true;
  2522         return result;
  2738         return result;
  2523       }, {});
  2739       }, {});
  2524       return Object(external_lodash_["mapValues"])(state, contextQueries => {
  2740       return (0,external_lodash_namespaceObject.mapValues)(state, contextQueries => {
  2525         return Object(external_lodash_["mapValues"])(contextQueries, queryItems => {
  2741         return (0,external_lodash_namespaceObject.mapValues)(contextQueries, queryItems => {
  2526           return Object(external_lodash_["filter"])(queryItems, queryId => {
  2742           return (0,external_lodash_namespaceObject.filter)(queryItems, queryId => {
  2527             return !removedItems[queryId];
  2743             return !removedItems[queryId];
  2528           });
  2744           });
  2529         });
  2745         });
  2530       });
  2746       });
  2531 
  2747 
  2532     default:
  2748     default:
  2533       return state;
  2749       return state;
  2534   }
  2750   }
  2535 };
  2751 };
  2536 
  2752 
  2537 /* harmony default export */ var reducer = (Object(external_wp_data_["combineReducers"])({
  2753 /* harmony default export */ var reducer = ((0,external_wp_data_namespaceObject.combineReducers)({
  2538   items: reducer_items,
  2754   items,
  2539   itemIsComplete,
  2755   itemIsComplete,
  2540   queries: reducer_queries
  2756   queries
  2541 }));
  2757 }));
  2542 
  2758 
  2543 // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/locks/utils.js
  2759 ;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/reducer.js
  2544 function deepCopyLocksTreePath(tree, path) {
  2760 /**
  2545   const newTree = { ...tree
  2761  * External dependencies
  2546   };
  2762  */
  2547   let currentNode = newTree;
  2763 
  2548 
  2764 /**
  2549   for (const branchName of path) {
  2765  * WordPress dependencies
  2550     currentNode.children = { ...currentNode.children,
  2766  */
  2551       [branchName]: {
  2767 
  2552         locks: [],
  2768 
  2553         children: {},
  2769 
  2554         ...currentNode.children[branchName]
       
  2555       }
       
  2556     };
       
  2557     currentNode = currentNode.children[branchName];
       
  2558   }
       
  2559 
       
  2560   return newTree;
       
  2561 }
       
  2562 function getNode(tree, path) {
       
  2563   let currentNode = tree;
       
  2564 
       
  2565   for (const branchName of path) {
       
  2566     const nextNode = currentNode.children[branchName];
       
  2567 
       
  2568     if (!nextNode) {
       
  2569       return null;
       
  2570     }
       
  2571 
       
  2572     currentNode = nextNode;
       
  2573   }
       
  2574 
       
  2575   return currentNode;
       
  2576 }
       
  2577 function* iteratePath(tree, path) {
       
  2578   let currentNode = tree;
       
  2579   yield currentNode;
       
  2580 
       
  2581   for (const branchName of path) {
       
  2582     const nextNode = currentNode.children[branchName];
       
  2583 
       
  2584     if (!nextNode) {
       
  2585       break;
       
  2586     }
       
  2587 
       
  2588     yield nextNode;
       
  2589     currentNode = nextNode;
       
  2590   }
       
  2591 }
       
  2592 function* iterateDescendants(node) {
       
  2593   const stack = Object.values(node.children);
       
  2594 
       
  2595   while (stack.length) {
       
  2596     const childNode = stack.pop();
       
  2597     yield childNode;
       
  2598     stack.push(...Object.values(childNode.children));
       
  2599   }
       
  2600 }
       
  2601 function hasConflictingLock({
       
  2602   exclusive
       
  2603 }, locks) {
       
  2604   if (exclusive && locks.length) {
       
  2605     return true;
       
  2606   }
       
  2607 
       
  2608   if (!exclusive && locks.filter(lock => lock.exclusive).length) {
       
  2609     return true;
       
  2610   }
       
  2611 
       
  2612   return false;
       
  2613 }
       
  2614 
       
  2615 // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/locks/reducer.js
       
  2616 /**
  2770 /**
  2617  * Internal dependencies
  2771  * Internal dependencies
  2618  */
  2772  */
  2619 
  2773 
  2620 const DEFAULT_STATE = {
  2774 
  2621   requests: [],
  2775 
  2622   tree: {
  2776 
  2623     locks: [],
  2777 /** @typedef {import('./types').AnyFunction} AnyFunction */
  2624     children: {}
       
  2625   }
       
  2626 };
       
  2627 /**
       
  2628  * Reducer returning locks.
       
  2629  *
       
  2630  * @param  {Object} state  Current state.
       
  2631  * @param  {Object} action Dispatched action.
       
  2632  *
       
  2633  * @return {Object} Updated state.
       
  2634  */
       
  2635 
       
  2636 function reducer_locks(state = DEFAULT_STATE, action) {
       
  2637   switch (action.type) {
       
  2638     case 'ENQUEUE_LOCK_REQUEST':
       
  2639       {
       
  2640         const {
       
  2641           request
       
  2642         } = action;
       
  2643         return { ...state,
       
  2644           requests: [request, ...state.requests]
       
  2645         };
       
  2646       }
       
  2647 
       
  2648     case 'GRANT_LOCK_REQUEST':
       
  2649       {
       
  2650         const {
       
  2651           lock,
       
  2652           request
       
  2653         } = action;
       
  2654         const {
       
  2655           store,
       
  2656           path
       
  2657         } = request;
       
  2658         const storePath = [store, ...path];
       
  2659         const newTree = deepCopyLocksTreePath(state.tree, storePath);
       
  2660         const node = getNode(newTree, storePath);
       
  2661         node.locks = [...node.locks, lock];
       
  2662         return { ...state,
       
  2663           requests: state.requests.filter(r => r !== request),
       
  2664           tree: newTree
       
  2665         };
       
  2666       }
       
  2667 
       
  2668     case 'RELEASE_LOCK':
       
  2669       {
       
  2670         const {
       
  2671           lock
       
  2672         } = action;
       
  2673         const storePath = [lock.store, ...lock.path];
       
  2674         const newTree = deepCopyLocksTreePath(state.tree, storePath);
       
  2675         const node = getNode(newTree, storePath);
       
  2676         node.locks = node.locks.filter(l => l !== lock);
       
  2677         return { ...state,
       
  2678           tree: newTree
       
  2679         };
       
  2680       }
       
  2681   }
       
  2682 
       
  2683   return state;
       
  2684 }
       
  2685 /* harmony default export */ var locks_reducer = (reducer_locks);
       
  2686 
       
  2687 // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/reducer.js
       
  2688 /**
       
  2689  * External dependencies
       
  2690  */
       
  2691 
       
  2692 /**
       
  2693  * WordPress dependencies
       
  2694  */
       
  2695 
       
  2696 
       
  2697 
       
  2698 /**
       
  2699  * Internal dependencies
       
  2700  */
       
  2701 
       
  2702 
       
  2703 
       
  2704 
       
  2705 
  2778 
  2706 /**
  2779 /**
  2707  * Reducer managing terms state. Keyed by taxonomy slug, the value is either
  2780  * Reducer managing terms state. Keyed by taxonomy slug, the value is either
  2708  * undefined (if no request has been made for given taxonomy), null (if a
  2781  * undefined (if no request has been made for given taxonomy), null (if a
  2709  * request is in-flight for given taxonomy), or the array of terms for the
  2782  * request is in-flight for given taxonomy), or the array of terms for the
  2713  * @param {Object} action Dispatched action.
  2786  * @param {Object} action Dispatched action.
  2714  *
  2787  *
  2715  * @return {Object} Updated state.
  2788  * @return {Object} Updated state.
  2716  */
  2789  */
  2717 
  2790 
  2718 function terms(state = {}, action) {
  2791 function terms() {
       
  2792   let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
       
  2793   let action = arguments.length > 1 ? arguments[1] : undefined;
       
  2794 
  2719   switch (action.type) {
  2795   switch (action.type) {
  2720     case 'RECEIVE_TERMS':
  2796     case 'RECEIVE_TERMS':
  2721       return { ...state,
  2797       return { ...state,
  2722         [action.taxonomy]: action.terms
  2798         [action.taxonomy]: action.terms
  2723       };
  2799       };
  2732  * @param {Object} action Dispatched action.
  2808  * @param {Object} action Dispatched action.
  2733  *
  2809  *
  2734  * @return {Object} Updated state.
  2810  * @return {Object} Updated state.
  2735  */
  2811  */
  2736 
  2812 
  2737 function reducer_users(state = {
  2813 function users() {
  2738   byId: {},
  2814   let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
  2739   queries: {}
  2815     byId: {},
  2740 }, action) {
  2816     queries: {}
       
  2817   };
       
  2818   let action = arguments.length > 1 ? arguments[1] : undefined;
       
  2819 
  2741   switch (action.type) {
  2820   switch (action.type) {
  2742     case 'RECEIVE_USER_QUERY':
  2821     case 'RECEIVE_USER_QUERY':
  2743       return {
  2822       return {
  2744         byId: { ...state.byId,
  2823         byId: { ...state.byId,
  2745           ...Object(external_lodash_["keyBy"])(action.users, 'id')
  2824           ...(0,external_lodash_namespaceObject.keyBy)(action.users, 'id')
  2746         },
  2825         },
  2747         queries: { ...state.queries,
  2826         queries: { ...state.queries,
  2748           [action.queryID]: Object(external_lodash_["map"])(action.users, user => user.id)
  2827           [action.queryID]: (0,external_lodash_namespaceObject.map)(action.users, user => user.id)
  2749         }
  2828         }
  2750       };
  2829       };
  2751   }
  2830   }
  2752 
  2831 
  2753   return state;
  2832   return state;
  2759  * @param {Object} action Dispatched action.
  2838  * @param {Object} action Dispatched action.
  2760  *
  2839  *
  2761  * @return {Object} Updated state.
  2840  * @return {Object} Updated state.
  2762  */
  2841  */
  2763 
  2842 
  2764 function reducer_currentUser(state = {}, action) {
  2843 function currentUser() {
       
  2844   let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
       
  2845   let action = arguments.length > 1 ? arguments[1] : undefined;
       
  2846 
  2765   switch (action.type) {
  2847   switch (action.type) {
  2766     case 'RECEIVE_CURRENT_USER':
  2848     case 'RECEIVE_CURRENT_USER':
  2767       return action.currentUser;
  2849       return action.currentUser;
  2768   }
  2850   }
  2769 
  2851 
  2776  * @param {Object} action Dispatched action.
  2858  * @param {Object} action Dispatched action.
  2777  *
  2859  *
  2778  * @return {Object} Updated state.
  2860  * @return {Object} Updated state.
  2779  */
  2861  */
  2780 
  2862 
  2781 function reducer_taxonomies(state = [], action) {
  2863 function taxonomies() {
       
  2864   let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
       
  2865   let action = arguments.length > 1 ? arguments[1] : undefined;
       
  2866 
  2782   switch (action.type) {
  2867   switch (action.type) {
  2783     case 'RECEIVE_TAXONOMIES':
  2868     case 'RECEIVE_TAXONOMIES':
  2784       return action.taxonomies;
  2869       return action.taxonomies;
  2785   }
  2870   }
  2786 
  2871 
  2787   return state;
  2872   return state;
  2788 }
  2873 }
  2789 /**
  2874 /**
  2790  * Reducer managing the current theme.
  2875  * Reducer managing the current theme.
  2791  *
  2876  *
  2792  * @param {string} state  Current state.
  2877  * @param {string|undefined} state  Current state.
  2793  * @param {Object} action Dispatched action.
  2878  * @param {Object}           action Dispatched action.
  2794  *
  2879  *
  2795  * @return {string} Updated state.
  2880  * @return {string|undefined} Updated state.
  2796  */
  2881  */
  2797 
  2882 
  2798 function currentTheme(state = undefined, action) {
  2883 function currentTheme() {
       
  2884   let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
       
  2885   let action = arguments.length > 1 ? arguments[1] : undefined;
       
  2886 
  2799   switch (action.type) {
  2887   switch (action.type) {
  2800     case 'RECEIVE_CURRENT_THEME':
  2888     case 'RECEIVE_CURRENT_THEME':
  2801       return action.currentTheme.stylesheet;
  2889       return action.currentTheme.stylesheet;
  2802   }
  2890   }
  2803 
  2891 
  2804   return state;
  2892   return state;
  2805 }
  2893 }
  2806 /**
  2894 /**
  2807  * Reducer managing installed themes.
  2895  * Reducer managing the current global styles id.
  2808  *
  2896  *
  2809  * @param {Object} state  Current state.
  2897  * @param {string|undefined} state  Current state.
  2810  * @param {Object} action Dispatched action.
  2898  * @param {Object}           action Dispatched action.
  2811  *
  2899  *
  2812  * @return {Object} Updated state.
  2900  * @return {string|undefined} Updated state.
  2813  */
  2901  */
  2814 
  2902 
  2815 function themes(state = {}, action) {
  2903 function currentGlobalStylesId() {
       
  2904   let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
       
  2905   let action = arguments.length > 1 ? arguments[1] : undefined;
       
  2906 
  2816   switch (action.type) {
  2907   switch (action.type) {
  2817     case 'RECEIVE_CURRENT_THEME':
  2908     case 'RECEIVE_CURRENT_GLOBAL_STYLES_ID':
       
  2909       return action.id;
       
  2910   }
       
  2911 
       
  2912   return state;
       
  2913 }
       
  2914 /**
       
  2915  * Reducer managing the theme base global styles.
       
  2916  *
       
  2917  * @param {Record<string, object>} state  Current state.
       
  2918  * @param {Object}                 action Dispatched action.
       
  2919  *
       
  2920  * @return {Record<string, object>} Updated state.
       
  2921  */
       
  2922 
       
  2923 function themeBaseGlobalStyles() {
       
  2924   let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
       
  2925   let action = arguments.length > 1 ? arguments[1] : undefined;
       
  2926 
       
  2927   switch (action.type) {
       
  2928     case 'RECEIVE_THEME_GLOBAL_STYLES':
  2818       return { ...state,
  2929       return { ...state,
  2819         [action.currentTheme.stylesheet]: action.currentTheme
  2930         [action.stylesheet]: action.globalStyles
  2820       };
  2931       };
  2821   }
  2932   }
  2822 
  2933 
  2823   return state;
  2934   return state;
  2824 }
  2935 }
  2825 /**
  2936 /**
  2826  * Reducer managing theme supports data.
  2937  * Reducer managing the theme global styles variations.
  2827  *
  2938  *
  2828  * @param {Object} state  Current state.
  2939  * @param {Record<string, object>} state  Current state.
  2829  * @param {Object} action Dispatched action.
  2940  * @param {Object}                 action Dispatched action.
  2830  *
  2941  *
  2831  * @return {Object} Updated state.
  2942  * @return {Record<string, object>} Updated state.
  2832  */
  2943  */
  2833 
  2944 
  2834 function themeSupports(state = {}, action) {
  2945 function themeGlobalStyleVariations() {
       
  2946   let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
       
  2947   let action = arguments.length > 1 ? arguments[1] : undefined;
       
  2948 
  2835   switch (action.type) {
  2949   switch (action.type) {
  2836     case 'RECEIVE_THEME_SUPPORTS':
  2950     case 'RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS':
  2837       return { ...state,
  2951       return { ...state,
  2838         ...action.themeSupports
  2952         [action.stylesheet]: action.variations
  2839       };
  2953       };
  2840   }
  2954   }
  2841 
  2955 
  2842   return state;
  2956   return state;
  2843 }
  2957 }
  2846  *
  2960  *
  2847  *  - Fetching
  2961  *  - Fetching
  2848  *  - Editing
  2962  *  - Editing
  2849  *  - Saving
  2963  *  - Saving
  2850  *
  2964  *
  2851  * @param {Object} entityConfig  Entity config.
  2965  * @param {Object} entityConfig Entity config.
  2852  *
  2966  *
  2853  * @return {Function} Reducer.
  2967  * @return {AnyFunction} Reducer.
  2854  */
  2968  */
  2855 
  2969 
  2856 function reducer_entity(entityConfig) {
  2970 function entity(entityConfig) {
  2857   return Object(external_lodash_["flowRight"])([// Limit to matching action type so we don't attempt to replace action on
  2971   return (0,external_lodash_namespaceObject.flowRight)([// Limit to matching action type so we don't attempt to replace action on
  2858   // an unhandled action.
  2972   // an unhandled action.
  2859   if_matching_action(action => action.name && action.kind && action.name === entityConfig.name && action.kind === entityConfig.kind), // Inject the entity config into the action.
  2973   if_matching_action(action => action.name && action.kind && action.name === entityConfig.name && action.kind === entityConfig.kind), // Inject the entity config into the action.
  2860   replace_action(action => {
  2974   replace_action(action => {
  2861     return { ...action,
  2975     return { ...action,
  2862       key: entityConfig.key || DEFAULT_ENTITY_KEY
  2976       key: entityConfig.key || DEFAULT_ENTITY_KEY
  2863     };
  2977     };
  2864   })])(Object(external_wp_data_["combineReducers"])({
  2978   })])((0,external_wp_data_namespaceObject.combineReducers)({
  2865     queriedData: reducer,
  2979     queriedData: reducer,
  2866     edits: (state = {}, action) => {
  2980     edits: function () {
  2867       var _action$query$context, _action$query;
  2981       var _action$query$context, _action$query;
       
  2982 
       
  2983       let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
       
  2984       let action = arguments.length > 1 ? arguments[1] : undefined;
  2868 
  2985 
  2869       switch (action.type) {
  2986       switch (action.type) {
  2870         case 'RECEIVE_ITEMS':
  2987         case 'RECEIVE_ITEMS':
  2871           const context = (_action$query$context = action === null || action === void 0 ? void 0 : (_action$query = action.query) === null || _action$query === void 0 ? void 0 : _action$query.context) !== null && _action$query$context !== void 0 ? _action$query$context : 'default';
  2988           const context = (_action$query$context = action === null || action === void 0 ? void 0 : (_action$query = action.query) === null || _action$query === void 0 ? void 0 : _action$query.context) !== null && _action$query$context !== void 0 ? _action$query$context : 'default';
  2872 
  2989 
  2889               // If the edited value is still different to the persisted value,
  3006               // If the edited value is still different to the persisted value,
  2890               // keep the edited value in edits.
  3007               // keep the edited value in edits.
  2891               if ( // Edits are the "raw" attribute values, but records may have
  3008               if ( // Edits are the "raw" attribute values, but records may have
  2892               // objects with more properties, so we use `get` here for the
  3009               // objects with more properties, so we use `get` here for the
  2893               // comparison.
  3010               // comparison.
  2894               !Object(external_lodash_["isEqual"])(edits[key], Object(external_lodash_["get"])(record[key], 'raw', record[key])) && ( // Sometimes the server alters the sent value which means
  3011               !(0,external_lodash_namespaceObject.isEqual)(edits[key], (0,external_lodash_namespaceObject.get)(record[key], 'raw', record[key])) && ( // Sometimes the server alters the sent value which means
  2895               // we need to also remove the edits before the api request.
  3012               // we need to also remove the edits before the api request.
  2896               !action.persistedEdits || !Object(external_lodash_["isEqual"])(edits[key], action.persistedEdits[key]))) {
  3013               !action.persistedEdits || !(0,external_lodash_namespaceObject.isEqual)(edits[key], action.persistedEdits[key]))) {
  2897                 acc[key] = edits[key];
  3014                 acc[key] = edits[key];
  2898               }
  3015               }
  2899 
  3016 
  2900               return acc;
  3017               return acc;
  2901             }, {});
  3018             }, {});
  2925           };
  3042           };
  2926       }
  3043       }
  2927 
  3044 
  2928       return state;
  3045       return state;
  2929     },
  3046     },
  2930     saving: (state = {}, action) => {
  3047     saving: function () {
       
  3048       let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
       
  3049       let action = arguments.length > 1 ? arguments[1] : undefined;
       
  3050 
  2931       switch (action.type) {
  3051       switch (action.type) {
  2932         case 'SAVE_ENTITY_RECORD_START':
  3052         case 'SAVE_ENTITY_RECORD_START':
  2933         case 'SAVE_ENTITY_RECORD_FINISH':
  3053         case 'SAVE_ENTITY_RECORD_FINISH':
  2934           return { ...state,
  3054           return { ...state,
  2935             [action.recordId]: {
  3055             [action.recordId]: {
  2940           };
  3060           };
  2941       }
  3061       }
  2942 
  3062 
  2943       return state;
  3063       return state;
  2944     },
  3064     },
  2945     deleting: (state = {}, action) => {
  3065     deleting: function () {
       
  3066       let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
       
  3067       let action = arguments.length > 1 ? arguments[1] : undefined;
       
  3068 
  2946       switch (action.type) {
  3069       switch (action.type) {
  2947         case 'DELETE_ENTITY_RECORD_START':
  3070         case 'DELETE_ENTITY_RECORD_START':
  2948         case 'DELETE_ENTITY_RECORD_FINISH':
  3071         case 'DELETE_ENTITY_RECORD_FINISH':
  2949           return { ...state,
  3072           return { ...state,
  2950             [action.recordId]: {
  3073             [action.recordId]: {
  2966  *
  3089  *
  2967  * @return {Object} Updated state.
  3090  * @return {Object} Updated state.
  2968  */
  3091  */
  2969 
  3092 
  2970 
  3093 
  2971 function entitiesConfig(state = defaultEntities, action) {
  3094 function entitiesConfig() {
       
  3095   let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : rootEntitiesConfig;
       
  3096   let action = arguments.length > 1 ? arguments[1] : undefined;
       
  3097 
  2972   switch (action.type) {
  3098   switch (action.type) {
  2973     case 'ADD_ENTITIES':
  3099     case 'ADD_ENTITIES':
  2974       return [...state, ...action.entities];
  3100       return [...state, ...action.entities];
  2975   }
  3101   }
  2976 
  3102 
  2983  * @param {Object} action Dispatched action.
  3109  * @param {Object} action Dispatched action.
  2984  *
  3110  *
  2985  * @return {Object} Updated state.
  3111  * @return {Object} Updated state.
  2986  */
  3112  */
  2987 
  3113 
  2988 const reducer_entities = (state = {}, action) => {
  3114 const entities = function () {
  2989   const newConfig = entitiesConfig(state.config, action); // Generates a dynamic reducer for the entities
  3115   let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
       
  3116   let action = arguments.length > 1 ? arguments[1] : undefined;
       
  3117   const newConfig = entitiesConfig(state.config, action); // Generates a dynamic reducer for the entities.
  2990 
  3118 
  2991   let entitiesDataReducer = state.reducer;
  3119   let entitiesDataReducer = state.reducer;
  2992 
  3120 
  2993   if (!entitiesDataReducer || newConfig !== state.config) {
  3121   if (!entitiesDataReducer || newConfig !== state.config) {
  2994     const entitiesByKind = Object(external_lodash_["groupBy"])(newConfig, 'kind');
  3122     const entitiesByKind = (0,external_lodash_namespaceObject.groupBy)(newConfig, 'kind');
  2995     entitiesDataReducer = Object(external_wp_data_["combineReducers"])(Object.entries(entitiesByKind).reduce((memo, [kind, subEntities]) => {
  3123     entitiesDataReducer = (0,external_wp_data_namespaceObject.combineReducers)(Object.entries(entitiesByKind).reduce((memo, _ref) => {
  2996       const kindReducer = Object(external_wp_data_["combineReducers"])(subEntities.reduce((kindMemo, entityConfig) => ({ ...kindMemo,
  3124       let [kind, subEntities] = _ref;
  2997         [entityConfig.name]: reducer_entity(entityConfig)
  3125       const kindReducer = (0,external_wp_data_namespaceObject.combineReducers)(subEntities.reduce((kindMemo, entityConfig) => ({ ...kindMemo,
       
  3126         [entityConfig.name]: entity(entityConfig)
  2998       }), {}));
  3127       }), {}));
  2999       memo[kind] = kindReducer;
  3128       memo[kind] = kindReducer;
  3000       return memo;
  3129       return memo;
  3001     }, {}));
  3130     }, {}));
  3002   }
  3131   }
  3003 
  3132 
  3004   const newData = entitiesDataReducer(state.data, action);
  3133   const newData = entitiesDataReducer(state.records, action);
  3005 
  3134 
  3006   if (newData === state.data && newConfig === state.config && entitiesDataReducer === state.reducer) {
  3135   if (newData === state.records && newConfig === state.config && entitiesDataReducer === state.reducer) {
  3007     return state;
  3136     return state;
  3008   }
  3137   }
  3009 
  3138 
  3010   return {
  3139   return {
  3011     reducer: entitiesDataReducer,
  3140     reducer: entitiesDataReducer,
  3012     data: newData,
  3141     records: newData,
  3013     config: newConfig
  3142     config: newConfig
  3014   };
  3143   };
  3015 };
  3144 };
  3016 /**
  3145 /**
       
  3146  * @typedef {Object} UndoStateMeta
       
  3147  *
       
  3148  * @property {number} offset          Where in the undo stack we are.
       
  3149  * @property {Object} [flattenedUndo] Flattened form of undo stack.
       
  3150  */
       
  3151 
       
  3152 /** @typedef {Array<Object> & UndoStateMeta} UndoState */
       
  3153 
       
  3154 /**
       
  3155  * @type {UndoState}
       
  3156  *
       
  3157  * @todo Given how we use this we might want to make a custom class for it.
       
  3158  */
       
  3159 
       
  3160 const UNDO_INITIAL_STATE = Object.assign([], {
       
  3161   offset: 0
       
  3162 });
       
  3163 /** @type {Object} */
       
  3164 
       
  3165 let lastEditAction;
       
  3166 /**
  3017  * Reducer keeping track of entity edit undo history.
  3167  * Reducer keeping track of entity edit undo history.
  3018  *
  3168  *
  3019  * @param {Object} state  Current state.
  3169  * @param {UndoState} state  Current state.
  3020  * @param {Object} action Dispatched action.
  3170  * @param {Object}    action Dispatched action.
  3021  *
  3171  *
  3022  * @return {Object} Updated state.
  3172  * @return {UndoState} Updated state.
  3023  */
  3173  */
  3024 
  3174 
  3025 const UNDO_INITIAL_STATE = [];
  3175 function reducer_undo() {
  3026 UNDO_INITIAL_STATE.offset = 0;
  3176   let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : UNDO_INITIAL_STATE;
  3027 let lastEditAction;
  3177   let action = arguments.length > 1 ? arguments[1] : undefined;
  3028 function reducer_undo(state = UNDO_INITIAL_STATE, action) {
  3178 
  3029   switch (action.type) {
  3179   switch (action.type) {
  3030     case 'EDIT_ENTITY_RECORD':
  3180     case 'EDIT_ENTITY_RECORD':
  3031     case 'CREATE_UNDO_LEVEL':
  3181     case 'CREATE_UNDO_LEVEL':
  3032       let isCreateUndoLevel = action.type === 'CREATE_UNDO_LEVEL';
  3182       let isCreateUndoLevel = action.type === 'CREATE_UNDO_LEVEL';
  3033       const isUndoOrRedo = !isCreateUndoLevel && (action.meta.isUndo || action.meta.isRedo);
  3183       const isUndoOrRedo = !isCreateUndoLevel && (action.meta.isUndo || action.meta.isRedo);
  3046               ...action.edits
  3196               ...action.edits
  3047             }
  3197             }
  3048           };
  3198           };
  3049         }
  3199         }
  3050       }
  3200       }
       
  3201       /** @type {UndoState} */
       
  3202 
  3051 
  3203 
  3052       let nextState;
  3204       let nextState;
  3053 
  3205 
  3054       if (isUndoOrRedo) {
  3206       if (isUndoOrRedo) {
       
  3207         // @ts-ignore we might consider using Object.assign({}, state)
  3055         nextState = [...state];
  3208         nextState = [...state];
  3056         nextState.offset = state.offset + (action.meta.isUndo ? -1 : 1);
  3209         nextState.offset = state.offset + (action.meta.isUndo ? -1 : 1);
  3057 
  3210 
  3058         if (state.flattenedUndo) {
  3211         if (state.flattenedUndo) {
  3059           // The first undo in a sequence of undos might happen while we have
  3212           // The first undo in a sequence of undos might happen while we have
  3060           // flattened undos in state. If this is the case, we want execution
  3213           // flattened undos in state. If this is the case, we want execution
  3061           // to continue as if we were creating an explicit undo level. This
  3214           // to continue as if we were creating an explicit undo level. This
  3062           // will result in an extra undo level being appended with the flattened
  3215           // will result in an extra undo level being appended with the flattened
  3063           // undo values.
  3216           // undo values.
       
  3217           // We also have to take into account if the `lastEditAction` had opted out
       
  3218           // of being tracked in undo history, like the action that persists the latest
       
  3219           // content right before saving. In that case we have to update the `lastEditAction`
       
  3220           // to avoid returning early before applying the existing flattened undos.
  3064           isCreateUndoLevel = true;
  3221           isCreateUndoLevel = true;
       
  3222 
       
  3223           if (!lastEditAction.meta.undo) {
       
  3224             lastEditAction.meta.undo = {
       
  3225               edits: {}
       
  3226             };
       
  3227           }
       
  3228 
  3065           action = lastEditAction;
  3229           action = lastEditAction;
  3066         } else {
  3230         } else {
  3067           return nextState;
  3231           return nextState;
  3068         }
  3232         }
  3069       }
  3233       }
  3074       // reachable in the next meaningful edit to which they
  3238       // reachable in the next meaningful edit to which they
  3075       // are merged. They are defined in the entity's config.
  3239       // are merged. They are defined in the entity's config.
  3076 
  3240 
  3077 
  3241 
  3078       if (!isCreateUndoLevel && !Object.keys(action.edits).some(key => !action.transientEdits[key])) {
  3242       if (!isCreateUndoLevel && !Object.keys(action.edits).some(key => !action.transientEdits[key])) {
       
  3243         // @ts-ignore we might consider using Object.assign({}, state)
  3079         nextState = [...state];
  3244         nextState = [...state];
  3080         nextState.flattenedUndo = { ...state.flattenedUndo,
  3245         nextState.flattenedUndo = { ...state.flattenedUndo,
  3081           ...action.edits
  3246           ...action.edits
  3082         };
  3247         };
  3083         nextState.offset = state.offset;
  3248         nextState.offset = state.offset;
  3084         return nextState;
  3249         return nextState;
  3085       } // Clear potential redos, because this only supports linear history.
  3250       } // Clear potential redos, because this only supports linear history.
  3086 
  3251 
  3087 
  3252 
  3088       nextState = nextState || state.slice(0, state.offset || undefined);
  3253       nextState = // @ts-ignore this needs additional cleanup, probably involving code-level changes
       
  3254       nextState || state.slice(0, state.offset || undefined);
  3089       nextState.offset = nextState.offset || 0;
  3255       nextState.offset = nextState.offset || 0;
  3090       nextState.pop();
  3256       nextState.pop();
  3091 
  3257 
  3092       if (!isCreateUndoLevel) {
  3258       if (!isCreateUndoLevel) {
  3093         nextState.push({
  3259         nextState.push({
  3128  * @param {Object} action Dispatched action.
  3294  * @param {Object} action Dispatched action.
  3129  *
  3295  *
  3130  * @return {Object} Updated state.
  3296  * @return {Object} Updated state.
  3131  */
  3297  */
  3132 
  3298 
  3133 function embedPreviews(state = {}, action) {
  3299 function embedPreviews() {
       
  3300   let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
       
  3301   let action = arguments.length > 1 ? arguments[1] : undefined;
       
  3302 
  3134   switch (action.type) {
  3303   switch (action.type) {
  3135     case 'RECEIVE_EMBED_PREVIEW':
  3304     case 'RECEIVE_EMBED_PREVIEW':
  3136       const {
  3305       const {
  3137         url,
  3306         url,
  3138         preview
  3307         preview
  3146 }
  3315 }
  3147 /**
  3316 /**
  3148  * State which tracks whether the user can perform an action on a REST
  3317  * State which tracks whether the user can perform an action on a REST
  3149  * resource.
  3318  * resource.
  3150  *
  3319  *
  3151  * @param  {Object} state  Current state.
  3320  * @param {Object} state  Current state.
  3152  * @param  {Object} action Dispatched action.
  3321  * @param {Object} action Dispatched action.
  3153  *
  3322  *
  3154  * @return {Object} Updated state.
  3323  * @return {Object} Updated state.
  3155  */
  3324  */
  3156 
  3325 
  3157 function userPermissions(state = {}, action) {
  3326 function userPermissions() {
       
  3327   let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
       
  3328   let action = arguments.length > 1 ? arguments[1] : undefined;
       
  3329 
  3158   switch (action.type) {
  3330   switch (action.type) {
  3159     case 'RECEIVE_USER_PERMISSION':
  3331     case 'RECEIVE_USER_PERMISSION':
  3160       return { ...state,
  3332       return { ...state,
  3161         [action.key]: action.isAllowed
  3333         [action.key]: action.isAllowed
  3162       };
  3334       };
  3165   return state;
  3337   return state;
  3166 }
  3338 }
  3167 /**
  3339 /**
  3168  * Reducer returning autosaves keyed by their parent's post id.
  3340  * Reducer returning autosaves keyed by their parent's post id.
  3169  *
  3341  *
  3170  * @param  {Object} state  Current state.
  3342  * @param {Object} state  Current state.
  3171  * @param  {Object} action Dispatched action.
  3343  * @param {Object} action Dispatched action.
  3172  *
  3344  *
  3173  * @return {Object} Updated state.
  3345  * @return {Object} Updated state.
  3174  */
  3346  */
  3175 
  3347 
  3176 function reducer_autosaves(state = {}, action) {
  3348 function autosaves() {
       
  3349   let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
       
  3350   let action = arguments.length > 1 ? arguments[1] : undefined;
       
  3351 
  3177   switch (action.type) {
  3352   switch (action.type) {
  3178     case 'RECEIVE_AUTOSAVES':
  3353     case 'RECEIVE_AUTOSAVES':
  3179       const {
  3354       const {
  3180         postId,
  3355         postId,
  3181         autosaves: autosavesData
  3356         autosaves: autosavesData
  3185       };
  3360       };
  3186   }
  3361   }
  3187 
  3362 
  3188   return state;
  3363   return state;
  3189 }
  3364 }
  3190 /* harmony default export */ var build_module_reducer = (Object(external_wp_data_["combineReducers"])({
  3365 function blockPatterns() {
       
  3366   let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
       
  3367   let action = arguments.length > 1 ? arguments[1] : undefined;
       
  3368 
       
  3369   switch (action.type) {
       
  3370     case 'RECEIVE_BLOCK_PATTERNS':
       
  3371       return action.patterns;
       
  3372   }
       
  3373 
       
  3374   return state;
       
  3375 }
       
  3376 function blockPatternCategories() {
       
  3377   let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
       
  3378   let action = arguments.length > 1 ? arguments[1] : undefined;
       
  3379 
       
  3380   switch (action.type) {
       
  3381     case 'RECEIVE_BLOCK_PATTERN_CATEGORIES':
       
  3382       return action.categories;
       
  3383   }
       
  3384 
       
  3385   return state;
       
  3386 }
       
  3387 /* harmony default export */ var build_module_reducer = ((0,external_wp_data_namespaceObject.combineReducers)({
  3191   terms,
  3388   terms,
  3192   users: reducer_users,
  3389   users,
  3193   currentTheme,
  3390   currentTheme,
  3194   currentUser: reducer_currentUser,
  3391   currentGlobalStylesId,
  3195   taxonomies: reducer_taxonomies,
  3392   currentUser,
  3196   themes,
  3393   themeGlobalStyleVariations,
  3197   themeSupports,
  3394   themeBaseGlobalStyles,
  3198   entities: reducer_entities,
  3395   taxonomies,
       
  3396   entities,
  3199   undo: reducer_undo,
  3397   undo: reducer_undo,
  3200   embedPreviews,
  3398   embedPreviews,
  3201   userPermissions,
  3399   userPermissions,
  3202   autosaves: reducer_autosaves,
  3400   autosaves,
  3203   locks: locks_reducer
  3401   blockPatterns,
       
  3402   blockPatternCategories
  3204 }));
  3403 }));
  3205 
  3404 
  3206 // EXTERNAL MODULE: ./node_modules/rememo/es/rememo.js
  3405 ;// CONCATENATED MODULE: ./node_modules/rememo/es/rememo.js
  3207 var rememo = __webpack_require__("pPDe");
       
  3208 
       
  3209 // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/name.js
       
  3210 /**
       
  3211  * The reducer key used by core data in store registration.
       
  3212  * This is defined in a separate file to avoid cycle-dependency
       
  3213  *
       
  3214  * @type {string}
       
  3215  */
       
  3216 const STORE_NAME = 'core';
       
  3217 
       
  3218 // EXTERNAL MODULE: ./node_modules/equivalent-key-map/equivalent-key-map.js
       
  3219 var equivalent_key_map = __webpack_require__("FtRg");
       
  3220 var equivalent_key_map_default = /*#__PURE__*/__webpack_require__.n(equivalent_key_map);
       
  3221 
       
  3222 // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/queried-data/selectors.js
       
  3223 /**
       
  3224  * External dependencies
       
  3225  */
       
  3226 
       
  3227 
       
  3228 
       
  3229 /**
       
  3230  * Internal dependencies
       
  3231  */
       
  3232 
       
  3233 
       
  3234 /**
       
  3235  * Cache of state keys to EquivalentKeyMap where the inner map tracks queries
       
  3236  * to their resulting items set. WeakMap allows garbage collection on expired
       
  3237  * state references.
       
  3238  *
       
  3239  * @type {WeakMap<Object,EquivalentKeyMap>}
       
  3240  */
       
  3241 
       
  3242 const queriedItemsCacheByState = new WeakMap();
       
  3243 /**
       
  3244  * Returns items for a given query, or null if the items are not known.
       
  3245  *
       
  3246  * @param {Object}  state State object.
       
  3247  * @param {?Object} query Optional query.
       
  3248  *
       
  3249  * @return {?Array} Query items.
       
  3250  */
       
  3251 
       
  3252 function getQueriedItemsUncached(state, query) {
       
  3253   var _state$queries, _state$queries$contex;
       
  3254 
       
  3255   const {
       
  3256     stableKey,
       
  3257     page,
       
  3258     perPage,
       
  3259     include,
       
  3260     fields,
       
  3261     context
       
  3262   } = get_query_parts(query);
       
  3263   let itemIds;
       
  3264 
       
  3265   if (Array.isArray(include) && !stableKey) {
       
  3266     // If the parsed query yields a set of IDs, but otherwise no filtering,
       
  3267     // it's safe to consider targeted item IDs as the include set. This
       
  3268     // doesn't guarantee that those objects have been queried, which is
       
  3269     // accounted for below in the loop `null` return.
       
  3270     itemIds = include; // TODO: Avoid storing the empty stable string in reducer, since it
       
  3271     // can be computed dynamically here always.
       
  3272   } else if ((_state$queries = state.queries) !== null && _state$queries !== void 0 && (_state$queries$contex = _state$queries[context]) !== null && _state$queries$contex !== void 0 && _state$queries$contex[stableKey]) {
       
  3273     itemIds = state.queries[context][stableKey];
       
  3274   }
       
  3275 
       
  3276   if (!itemIds) {
       
  3277     return null;
       
  3278   }
       
  3279 
       
  3280   const startOffset = perPage === -1 ? 0 : (page - 1) * perPage;
       
  3281   const endOffset = perPage === -1 ? itemIds.length : Math.min(startOffset + perPage, itemIds.length);
       
  3282   const items = [];
       
  3283 
       
  3284   for (let i = startOffset; i < endOffset; i++) {
       
  3285     var _state$items$context;
       
  3286 
       
  3287     const itemId = itemIds[i];
       
  3288 
       
  3289     if (Array.isArray(include) && !include.includes(itemId)) {
       
  3290       continue;
       
  3291     }
       
  3292 
       
  3293     if (!((_state$items$context = state.items[context]) !== null && _state$items$context !== void 0 && _state$items$context.hasOwnProperty(itemId))) {
       
  3294       return null;
       
  3295     }
       
  3296 
       
  3297     const item = state.items[context][itemId];
       
  3298     let filteredItem;
       
  3299 
       
  3300     if (Array.isArray(fields)) {
       
  3301       filteredItem = {};
       
  3302 
       
  3303       for (let f = 0; f < fields.length; f++) {
       
  3304         const field = fields[f].split('.');
       
  3305         const value = Object(external_lodash_["get"])(item, field);
       
  3306         Object(external_lodash_["set"])(filteredItem, field, value);
       
  3307       }
       
  3308     } else {
       
  3309       var _state$itemIsComplete;
       
  3310 
       
  3311       // If expecting a complete item, validate that completeness, or
       
  3312       // otherwise abort.
       
  3313       if (!((_state$itemIsComplete = state.itemIsComplete[context]) !== null && _state$itemIsComplete !== void 0 && _state$itemIsComplete[itemId])) {
       
  3314         return null;
       
  3315       }
       
  3316 
       
  3317       filteredItem = item;
       
  3318     }
       
  3319 
       
  3320     items.push(filteredItem);
       
  3321   }
       
  3322 
       
  3323   return items;
       
  3324 }
       
  3325 /**
       
  3326  * Returns items for a given query, or null if the items are not known. Caches
       
  3327  * result both per state (by reference) and per query (by deep equality).
       
  3328  * The caching approach is intended to be durable to query objects which are
       
  3329  * deeply but not referentially equal, since otherwise:
       
  3330  *
       
  3331  * `getQueriedItems( state, {} ) !== getQueriedItems( state, {} )`
       
  3332  *
       
  3333  * @param {Object}  state State object.
       
  3334  * @param {?Object} query Optional query.
       
  3335  *
       
  3336  * @return {?Array} Query items.
       
  3337  */
       
  3338 
       
  3339 
       
  3340 const getQueriedItems = Object(rememo["a" /* default */])((state, query = {}) => {
       
  3341   let queriedItemsCache = queriedItemsCacheByState.get(state);
       
  3342 
       
  3343   if (queriedItemsCache) {
       
  3344     const queriedItems = queriedItemsCache.get(query);
       
  3345 
       
  3346     if (queriedItems !== undefined) {
       
  3347       return queriedItems;
       
  3348     }
       
  3349   } else {
       
  3350     queriedItemsCache = new equivalent_key_map_default.a();
       
  3351     queriedItemsCacheByState.set(state, queriedItemsCache);
       
  3352   }
       
  3353 
       
  3354   const items = getQueriedItemsUncached(state, query);
       
  3355   queriedItemsCache.set(query, items);
       
  3356   return items;
       
  3357 });
       
  3358 
       
  3359 // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/selectors.js
       
  3360 /**
       
  3361  * External dependencies
       
  3362  */
       
  3363 
       
  3364 
       
  3365 /**
       
  3366  * WordPress dependencies
       
  3367  */
       
  3368 
       
  3369 
       
  3370 
       
  3371 /**
       
  3372  * Internal dependencies
       
  3373  */
       
  3374 
       
  3375 
       
  3376 
       
  3377 
       
  3378 
       
  3379 /**
       
  3380  * Shared reference to an empty array for cases where it is important to avoid
       
  3381  * returning a new array reference on every invocation, as in a connected or
       
  3382  * other pure component which performs `shouldComponentUpdate` check on props.
       
  3383  * This should be used as a last resort, since the normalized data should be
       
  3384  * maintained by the reducer result in state.
       
  3385  *
       
  3386  * @type {Array}
       
  3387  */
       
  3388 
       
  3389 const EMPTY_ARRAY = [];
       
  3390 /**
       
  3391  * Returns true if a request is in progress for embed preview data, or false
       
  3392  * otherwise.
       
  3393  *
       
  3394  * @param {Object} state Data state.
       
  3395  * @param {string} url   URL the preview would be for.
       
  3396  *
       
  3397  * @return {boolean} Whether a request is in progress for an embed preview.
       
  3398  */
       
  3399 
       
  3400 const isRequestingEmbedPreview = Object(external_wp_data_["createRegistrySelector"])(select => (state, url) => {
       
  3401   return select('core/data').isResolving(STORE_NAME, 'getEmbedPreview', [url]);
       
  3402 });
       
  3403 /**
       
  3404  * Returns all available authors.
       
  3405  *
       
  3406  * @param {Object}           state Data state.
       
  3407  * @param {Object|undefined} query Optional object of query parameters to
       
  3408  *                                 include with request.
       
  3409  * @return {Array} Authors list.
       
  3410  */
       
  3411 
       
  3412 function getAuthors(state, query) {
       
  3413   const path = Object(external_wp_url_["addQueryArgs"])('/wp/v2/users/?who=authors&per_page=100', query);
       
  3414   return getUserQueryResults(state, path);
       
  3415 }
       
  3416 /**
       
  3417  * Returns all available authors.
       
  3418  *
       
  3419  * @param {Object} state Data state.
       
  3420  * @param {number} id The author id.
       
  3421  *
       
  3422  * @return {Array} Authors list.
       
  3423  */
       
  3424 
       
  3425 function __unstableGetAuthor(state, id) {
       
  3426   return Object(external_lodash_["get"])(state, ['users', 'byId', id], null);
       
  3427 }
       
  3428 /**
       
  3429  * Returns the current user.
       
  3430  *
       
  3431  * @param {Object} state Data state.
       
  3432  *
       
  3433  * @return {Object} Current user object.
       
  3434  */
       
  3435 
       
  3436 function getCurrentUser(state) {
       
  3437   return state.currentUser;
       
  3438 }
       
  3439 /**
       
  3440  * Returns all the users returned by a query ID.
       
  3441  *
       
  3442  * @param {Object} state   Data state.
       
  3443  * @param {string} queryID Query ID.
       
  3444  *
       
  3445  * @return {Array} Users list.
       
  3446  */
       
  3447 
       
  3448 const getUserQueryResults = Object(rememo["a" /* default */])((state, queryID) => {
       
  3449   const queryResults = state.users.queries[queryID];
       
  3450   return Object(external_lodash_["map"])(queryResults, id => state.users.byId[id]);
       
  3451 }, (state, queryID) => [state.users.queries[queryID], state.users.byId]);
       
  3452 /**
       
  3453  * Returns whether the entities for the give kind are loaded.
       
  3454  *
       
  3455  * @param {Object} state   Data state.
       
  3456  * @param {string} kind  Entity kind.
       
  3457  *
       
  3458  * @return {Array<Object>} Array of entities with config matching kind.
       
  3459  */
       
  3460 
       
  3461 function getEntitiesByKind(state, kind) {
       
  3462   return Object(external_lodash_["filter"])(state.entities.config, {
       
  3463     kind
       
  3464   });
       
  3465 }
       
  3466 /**
       
  3467  * Returns the entity object given its kind and name.
       
  3468  *
       
  3469  * @param {Object} state   Data state.
       
  3470  * @param {string} kind  Entity kind.
       
  3471  * @param {string} name  Entity name.
       
  3472  *
       
  3473  * @return {Object} Entity
       
  3474  */
       
  3475 
       
  3476 function getEntity(state, kind, name) {
       
  3477   return Object(external_lodash_["find"])(state.entities.config, {
       
  3478     kind,
       
  3479     name
       
  3480   });
       
  3481 }
       
  3482 /**
       
  3483  * Returns the Entity's record object by key. Returns `null` if the value is not
       
  3484  * yet received, undefined if the value entity is known to not exist, or the
       
  3485  * entity object if it exists and is received.
       
  3486  *
       
  3487  * @param {Object}  state State tree
       
  3488  * @param {string}  kind  Entity kind.
       
  3489  * @param {string}  name  Entity name.
       
  3490  * @param {number}  key   Record's key
       
  3491  * @param {?Object} query Optional query.
       
  3492  *
       
  3493  * @return {Object?} Record.
       
  3494  */
       
  3495 
       
  3496 function getEntityRecord(state, kind, name, key, query) {
       
  3497   var _query$context, _queriedState$items$c;
       
  3498 
       
  3499   const queriedState = Object(external_lodash_["get"])(state.entities.data, [kind, name, 'queriedData']);
       
  3500 
       
  3501   if (!queriedState) {
       
  3502     return undefined;
       
  3503   }
       
  3504 
       
  3505   const context = (_query$context = query === null || query === void 0 ? void 0 : query.context) !== null && _query$context !== void 0 ? _query$context : 'default';
       
  3506 
       
  3507   if (query === undefined) {
       
  3508     var _queriedState$itemIsC;
       
  3509 
       
  3510     // If expecting a complete item, validate that completeness.
       
  3511     if (!((_queriedState$itemIsC = queriedState.itemIsComplete[context]) !== null && _queriedState$itemIsC !== void 0 && _queriedState$itemIsC[key])) {
       
  3512       return undefined;
       
  3513     }
       
  3514 
       
  3515     return queriedState.items[context][key];
       
  3516   }
       
  3517 
       
  3518   const item = (_queriedState$items$c = queriedState.items[context]) === null || _queriedState$items$c === void 0 ? void 0 : _queriedState$items$c[key];
       
  3519 
       
  3520   if (item && query._fields) {
       
  3521     const filteredItem = {};
       
  3522     const fields = get_normalized_comma_separable(query._fields);
       
  3523 
       
  3524     for (let f = 0; f < fields.length; f++) {
       
  3525       const field = fields[f].split('.');
       
  3526       const value = Object(external_lodash_["get"])(item, field);
       
  3527       Object(external_lodash_["set"])(filteredItem, field, value);
       
  3528     }
       
  3529 
       
  3530     return filteredItem;
       
  3531   }
       
  3532 
       
  3533   return item;
       
  3534 }
       
  3535 /**
       
  3536  * Returns the Entity's record object by key. Doesn't trigger a resolver nor requests the entity from the API if the entity record isn't available in the local state.
       
  3537  *
       
  3538  * @param {Object} state  State tree
       
  3539  * @param {string} kind   Entity kind.
       
  3540  * @param {string} name   Entity name.
       
  3541  * @param {number} key    Record's key
       
  3542  *
       
  3543  * @return {Object|null} Record.
       
  3544  */
       
  3545 
       
  3546 function __experimentalGetEntityRecordNoResolver(state, kind, name, key) {
       
  3547   return getEntityRecord(state, kind, name, key);
       
  3548 }
       
  3549 /**
       
  3550  * Returns the entity's record object by key,
       
  3551  * with its attributes mapped to their raw values.
       
  3552  *
       
  3553  * @param {Object} state  State tree.
       
  3554  * @param {string} kind   Entity kind.
       
  3555  * @param {string} name   Entity name.
       
  3556  * @param {number} key    Record's key.
       
  3557  *
       
  3558  * @return {Object?} Object with the entity's raw attributes.
       
  3559  */
       
  3560 
       
  3561 const getRawEntityRecord = Object(rememo["a" /* default */])((state, kind, name, key) => {
       
  3562   const record = getEntityRecord(state, kind, name, key);
       
  3563   return record && Object.keys(record).reduce((accumulator, _key) => {
       
  3564     // Because edits are the "raw" attribute values,
       
  3565     // we return those from record selectors to make rendering,
       
  3566     // comparisons, and joins with edits easier.
       
  3567     accumulator[_key] = Object(external_lodash_["get"])(record[_key], 'raw', record[_key]);
       
  3568     return accumulator;
       
  3569   }, {});
       
  3570 }, state => [state.entities.data]);
       
  3571 /**
       
  3572  * Returns true if records have been received for the given set of parameters,
       
  3573  * or false otherwise.
       
  3574  *
       
  3575  * @param {Object}  state State tree
       
  3576  * @param {string}  kind  Entity kind.
       
  3577  * @param {string}  name  Entity name.
       
  3578  * @param {?Object} query Optional terms query.
       
  3579  *
       
  3580  * @return {boolean} Whether entity records have been received.
       
  3581  */
       
  3582 
       
  3583 function hasEntityRecords(state, kind, name, query) {
       
  3584   return Array.isArray(getEntityRecords(state, kind, name, query));
       
  3585 }
       
  3586 /**
       
  3587  * Returns the Entity's records.
       
  3588  *
       
  3589  * @param {Object}  state State tree
       
  3590  * @param {string}  kind  Entity kind.
       
  3591  * @param {string}  name  Entity name.
       
  3592  * @param {?Object} query Optional terms query.
       
  3593  *
       
  3594  * @return {?Array} Records.
       
  3595  */
       
  3596 
       
  3597 function getEntityRecords(state, kind, name, query) {
       
  3598   // Queried data state is prepopulated for all known entities. If this is not
       
  3599   // assigned for the given parameters, then it is known to not exist. Thus, a
       
  3600   // return value of an empty array is used instead of `null` (where `null` is
       
  3601   // otherwise used to represent an unknown state).
       
  3602   const queriedState = Object(external_lodash_["get"])(state.entities.data, [kind, name, 'queriedData']);
       
  3603 
       
  3604   if (!queriedState) {
       
  3605     return EMPTY_ARRAY;
       
  3606   }
       
  3607 
       
  3608   return getQueriedItems(queriedState, query);
       
  3609 }
       
  3610 /**
       
  3611  * Returns the  list of dirty entity records.
       
  3612  *
       
  3613  * @param {Object} state State tree.
       
  3614  *
       
  3615  * @return {[{ title: string, key: string, name: string, kind: string }]} The list of updated records
       
  3616  */
       
  3617 
       
  3618 const __experimentalGetDirtyEntityRecords = Object(rememo["a" /* default */])(state => {
       
  3619   const {
       
  3620     entities: {
       
  3621       data
       
  3622     }
       
  3623   } = state;
       
  3624   const dirtyRecords = [];
       
  3625   Object.keys(data).forEach(kind => {
       
  3626     Object.keys(data[kind]).forEach(name => {
       
  3627       const primaryKeys = Object.keys(data[kind][name].edits).filter(primaryKey => hasEditsForEntityRecord(state, kind, name, primaryKey));
       
  3628 
       
  3629       if (primaryKeys.length) {
       
  3630         const entity = getEntity(state, kind, name);
       
  3631         primaryKeys.forEach(primaryKey => {
       
  3632           var _entity$getTitle;
       
  3633 
       
  3634           const entityRecord = getEditedEntityRecord(state, kind, name, primaryKey);
       
  3635           dirtyRecords.push({
       
  3636             // We avoid using primaryKey because it's transformed into a string
       
  3637             // when it's used as an object key.
       
  3638             key: entityRecord[entity.key || DEFAULT_ENTITY_KEY],
       
  3639             title: (entity === null || entity === void 0 ? void 0 : (_entity$getTitle = entity.getTitle) === null || _entity$getTitle === void 0 ? void 0 : _entity$getTitle.call(entity, entityRecord)) || '',
       
  3640             name,
       
  3641             kind
       
  3642           });
       
  3643         });
       
  3644       }
       
  3645     });
       
  3646   });
       
  3647   return dirtyRecords;
       
  3648 }, state => [state.entities.data]);
       
  3649 /**
       
  3650  * Returns the specified entity record's edits.
       
  3651  *
       
  3652  * @param {Object} state    State tree.
       
  3653  * @param {string} kind     Entity kind.
       
  3654  * @param {string} name     Entity name.
       
  3655  * @param {number} recordId Record ID.
       
  3656  *
       
  3657  * @return {Object?} The entity record's edits.
       
  3658  */
       
  3659 
       
  3660 function getEntityRecordEdits(state, kind, name, recordId) {
       
  3661   return Object(external_lodash_["get"])(state.entities.data, [kind, name, 'edits', recordId]);
       
  3662 }
       
  3663 /**
       
  3664  * Returns the specified entity record's non transient edits.
       
  3665  *
       
  3666  * Transient edits don't create an undo level, and
       
  3667  * are not considered for change detection.
       
  3668  * They are defined in the entity's config.
       
  3669  *
       
  3670  * @param {Object} state    State tree.
       
  3671  * @param {string} kind     Entity kind.
       
  3672  * @param {string} name     Entity name.
       
  3673  * @param {number} recordId Record ID.
       
  3674  *
       
  3675  * @return {Object?} The entity record's non transient edits.
       
  3676  */
       
  3677 
       
  3678 const getEntityRecordNonTransientEdits = Object(rememo["a" /* default */])((state, kind, name, recordId) => {
       
  3679   const {
       
  3680     transientEdits
       
  3681   } = getEntity(state, kind, name) || {};
       
  3682   const edits = getEntityRecordEdits(state, kind, name, recordId) || {};
       
  3683 
       
  3684   if (!transientEdits) {
       
  3685     return edits;
       
  3686   }
       
  3687 
       
  3688   return Object.keys(edits).reduce((acc, key) => {
       
  3689     if (!transientEdits[key]) {
       
  3690       acc[key] = edits[key];
       
  3691     }
       
  3692 
       
  3693     return acc;
       
  3694   }, {});
       
  3695 }, state => [state.entities.config, state.entities.data]);
       
  3696 /**
       
  3697  * Returns true if the specified entity record has edits,
       
  3698  * and false otherwise.
       
  3699  *
       
  3700  * @param {Object} state    State tree.
       
  3701  * @param {string} kind     Entity kind.
       
  3702  * @param {string} name     Entity name.
       
  3703  * @param {number} recordId Record ID.
       
  3704  *
       
  3705  * @return {boolean} Whether the entity record has edits or not.
       
  3706  */
       
  3707 
       
  3708 function hasEditsForEntityRecord(state, kind, name, recordId) {
       
  3709   return isSavingEntityRecord(state, kind, name, recordId) || Object.keys(getEntityRecordNonTransientEdits(state, kind, name, recordId)).length > 0;
       
  3710 }
       
  3711 /**
       
  3712  * Returns the specified entity record, merged with its edits.
       
  3713  *
       
  3714  * @param {Object} state    State tree.
       
  3715  * @param {string} kind     Entity kind.
       
  3716  * @param {string} name     Entity name.
       
  3717  * @param {number} recordId Record ID.
       
  3718  *
       
  3719  * @return {Object?} The entity record, merged with its edits.
       
  3720  */
       
  3721 
       
  3722 const getEditedEntityRecord = Object(rememo["a" /* default */])((state, kind, name, recordId) => ({ ...getRawEntityRecord(state, kind, name, recordId),
       
  3723   ...getEntityRecordEdits(state, kind, name, recordId)
       
  3724 }), state => [state.entities.data]);
       
  3725 /**
       
  3726  * Returns true if the specified entity record is autosaving, and false otherwise.
       
  3727  *
       
  3728  * @param {Object} state    State tree.
       
  3729  * @param {string} kind     Entity kind.
       
  3730  * @param {string} name     Entity name.
       
  3731  * @param {number} recordId Record ID.
       
  3732  *
       
  3733  * @return {boolean} Whether the entity record is autosaving or not.
       
  3734  */
       
  3735 
       
  3736 function isAutosavingEntityRecord(state, kind, name, recordId) {
       
  3737   const {
       
  3738     pending,
       
  3739     isAutosave
       
  3740   } = Object(external_lodash_["get"])(state.entities.data, [kind, name, 'saving', recordId], {});
       
  3741   return Boolean(pending && isAutosave);
       
  3742 }
       
  3743 /**
       
  3744  * Returns true if the specified entity record is saving, and false otherwise.
       
  3745  *
       
  3746  * @param {Object} state    State tree.
       
  3747  * @param {string} kind     Entity kind.
       
  3748  * @param {string} name     Entity name.
       
  3749  * @param {number} recordId Record ID.
       
  3750  *
       
  3751  * @return {boolean} Whether the entity record is saving or not.
       
  3752  */
       
  3753 
       
  3754 function isSavingEntityRecord(state, kind, name, recordId) {
       
  3755   return Object(external_lodash_["get"])(state.entities.data, [kind, name, 'saving', recordId, 'pending'], false);
       
  3756 }
       
  3757 /**
       
  3758  * Returns true if the specified entity record is deleting, and false otherwise.
       
  3759  *
       
  3760  * @param {Object} state    State tree.
       
  3761  * @param {string} kind     Entity kind.
       
  3762  * @param {string} name     Entity name.
       
  3763  * @param {number} recordId Record ID.
       
  3764  *
       
  3765  * @return {boolean} Whether the entity record is deleting or not.
       
  3766  */
       
  3767 
       
  3768 function isDeletingEntityRecord(state, kind, name, recordId) {
       
  3769   return Object(external_lodash_["get"])(state.entities.data, [kind, name, 'deleting', recordId, 'pending'], false);
       
  3770 }
       
  3771 /**
       
  3772  * Returns the specified entity record's last save error.
       
  3773  *
       
  3774  * @param {Object} state    State tree.
       
  3775  * @param {string} kind     Entity kind.
       
  3776  * @param {string} name     Entity name.
       
  3777  * @param {number} recordId Record ID.
       
  3778  *
       
  3779  * @return {Object?} The entity record's save error.
       
  3780  */
       
  3781 
       
  3782 function getLastEntitySaveError(state, kind, name, recordId) {
       
  3783   return Object(external_lodash_["get"])(state.entities.data, [kind, name, 'saving', recordId, 'error']);
       
  3784 }
       
  3785 /**
       
  3786  * Returns the specified entity record's last delete error.
       
  3787  *
       
  3788  * @param {Object} state    State tree.
       
  3789  * @param {string} kind     Entity kind.
       
  3790  * @param {string} name     Entity name.
       
  3791  * @param {number} recordId Record ID.
       
  3792  *
       
  3793  * @return {Object?} The entity record's save error.
       
  3794  */
       
  3795 
       
  3796 function getLastEntityDeleteError(state, kind, name, recordId) {
       
  3797   return Object(external_lodash_["get"])(state.entities.data, [kind, name, 'deleting', recordId, 'error']);
       
  3798 }
       
  3799 /**
       
  3800  * Returns the current undo offset for the
       
  3801  * entity records edits history. The offset
       
  3802  * represents how many items from the end
       
  3803  * of the history stack we are at. 0 is the
       
  3804  * last edit, -1 is the second last, and so on.
       
  3805  *
       
  3806  * @param {Object} state State tree.
       
  3807  *
       
  3808  * @return {number} The current undo offset.
       
  3809  */
       
  3810 
       
  3811 function getCurrentUndoOffset(state) {
       
  3812   return state.undo.offset;
       
  3813 }
       
  3814 /**
       
  3815  * Returns the previous edit from the current undo offset
       
  3816  * for the entity records edits history, if any.
       
  3817  *
       
  3818  * @param {Object} state State tree.
       
  3819  *
       
  3820  * @return {Object?} The edit.
       
  3821  */
       
  3822 
       
  3823 
       
  3824 function getUndoEdit(state) {
       
  3825   return state.undo[state.undo.length - 2 + getCurrentUndoOffset(state)];
       
  3826 }
       
  3827 /**
       
  3828  * Returns the next edit from the current undo offset
       
  3829  * for the entity records edits history, if any.
       
  3830  *
       
  3831  * @param {Object} state State tree.
       
  3832  *
       
  3833  * @return {Object?} The edit.
       
  3834  */
       
  3835 
       
  3836 function getRedoEdit(state) {
       
  3837   return state.undo[state.undo.length + getCurrentUndoOffset(state)];
       
  3838 }
       
  3839 /**
       
  3840  * Returns true if there is a previous edit from the current undo offset
       
  3841  * for the entity records edits history, and false otherwise.
       
  3842  *
       
  3843  * @param {Object} state State tree.
       
  3844  *
       
  3845  * @return {boolean} Whether there is a previous edit or not.
       
  3846  */
       
  3847 
       
  3848 function hasUndo(state) {
       
  3849   return Boolean(getUndoEdit(state));
       
  3850 }
       
  3851 /**
       
  3852  * Returns true if there is a next edit from the current undo offset
       
  3853  * for the entity records edits history, and false otherwise.
       
  3854  *
       
  3855  * @param {Object} state State tree.
       
  3856  *
       
  3857  * @return {boolean} Whether there is a next edit or not.
       
  3858  */
       
  3859 
       
  3860 function hasRedo(state) {
       
  3861   return Boolean(getRedoEdit(state));
       
  3862 }
       
  3863 /**
       
  3864  * Return the current theme.
       
  3865  *
       
  3866  * @param {Object} state Data state.
       
  3867  *
       
  3868  * @return {Object}      The current theme.
       
  3869  */
       
  3870 
       
  3871 function getCurrentTheme(state) {
       
  3872   return state.themes[state.currentTheme];
       
  3873 }
       
  3874 /**
       
  3875  * Return theme supports data in the index.
       
  3876  *
       
  3877  * @param {Object} state Data state.
       
  3878  *
       
  3879  * @return {*}           Index data.
       
  3880  */
       
  3881 
       
  3882 function getThemeSupports(state) {
       
  3883   return state.themeSupports;
       
  3884 }
       
  3885 /**
       
  3886  * Returns the embed preview for the given URL.
       
  3887  *
       
  3888  * @param {Object} state    Data state.
       
  3889  * @param {string} url      Embedded URL.
       
  3890  *
       
  3891  * @return {*} Undefined if the preview has not been fetched, otherwise, the preview fetched from the embed preview API.
       
  3892  */
       
  3893 
       
  3894 function getEmbedPreview(state, url) {
       
  3895   return state.embedPreviews[url];
       
  3896 }
       
  3897 /**
       
  3898  * Determines if the returned preview is an oEmbed link fallback.
       
  3899  *
       
  3900  * WordPress can be configured to return a simple link to a URL if it is not embeddable.
       
  3901  * We need to be able to determine if a URL is embeddable or not, based on what we
       
  3902  * get back from the oEmbed preview API.
       
  3903  *
       
  3904  * @param {Object} state    Data state.
       
  3905  * @param {string} url      Embedded URL.
       
  3906  *
       
  3907  * @return {boolean} Is the preview for the URL an oEmbed link fallback.
       
  3908  */
       
  3909 
       
  3910 function isPreviewEmbedFallback(state, url) {
       
  3911   const preview = state.embedPreviews[url];
       
  3912   const oEmbedLinkCheck = '<a href="' + url + '">' + url + '</a>';
       
  3913 
       
  3914   if (!preview) {
       
  3915     return false;
       
  3916   }
       
  3917 
       
  3918   return preview.html === oEmbedLinkCheck;
       
  3919 }
       
  3920 /**
       
  3921  * Returns whether the current user can perform the given action on the given
       
  3922  * REST resource.
       
  3923  *
       
  3924  * Calling this may trigger an OPTIONS request to the REST API via the
       
  3925  * `canUser()` resolver.
       
  3926  *
       
  3927  * https://developer.wordpress.org/rest-api/reference/
       
  3928  *
       
  3929  * @param {Object}   state            Data state.
       
  3930  * @param {string}   action           Action to check. One of: 'create', 'read', 'update', 'delete'.
       
  3931  * @param {string}   resource         REST resource to check, e.g. 'media' or 'posts'.
       
  3932  * @param {string=}  id               Optional ID of the rest resource to check.
       
  3933  *
       
  3934  * @return {boolean|undefined} Whether or not the user can perform the action,
       
  3935  *                             or `undefined` if the OPTIONS request is still being made.
       
  3936  */
       
  3937 
       
  3938 function canUser(state, action, resource, id) {
       
  3939   const key = Object(external_lodash_["compact"])([action, resource, id]).join('/');
       
  3940   return Object(external_lodash_["get"])(state, ['userPermissions', key]);
       
  3941 }
       
  3942 /**
       
  3943  * Returns whether the current user can edit the given entity.
       
  3944  *
       
  3945  * Calling this may trigger an OPTIONS request to the REST API via the
       
  3946  * `canUser()` resolver.
       
  3947  *
       
  3948  * https://developer.wordpress.org/rest-api/reference/
       
  3949  *
       
  3950  * @param {Object} state    Data state.
       
  3951  * @param {string} kind     Entity kind.
       
  3952  * @param {string} name     Entity name.
       
  3953  * @param {string} recordId Record's id.
       
  3954  * @return {boolean|undefined} Whether or not the user can edit,
       
  3955  * or `undefined` if the OPTIONS request is still being made.
       
  3956  */
       
  3957 
       
  3958 function canUserEditEntityRecord(state, kind, name, recordId) {
       
  3959   const entity = getEntity(state, kind, name);
       
  3960 
       
  3961   if (!entity) {
       
  3962     return false;
       
  3963   }
       
  3964 
       
  3965   const resource = entity.__unstable_rest_base;
       
  3966   return canUser(state, 'update', resource, recordId);
       
  3967 }
       
  3968 /**
       
  3969  * Returns the latest autosaves for the post.
       
  3970  *
       
  3971  * May return multiple autosaves since the backend stores one autosave per
       
  3972  * author for each post.
       
  3973  *
       
  3974  * @param {Object} state    State tree.
       
  3975  * @param {string} postType The type of the parent post.
       
  3976  * @param {number} postId   The id of the parent post.
       
  3977  *
       
  3978  * @return {?Array} An array of autosaves for the post, or undefined if there is none.
       
  3979  */
       
  3980 
       
  3981 function getAutosaves(state, postType, postId) {
       
  3982   return state.autosaves[postId];
       
  3983 }
       
  3984 /**
       
  3985  * Returns the autosave for the post and author.
       
  3986  *
       
  3987  * @param {Object} state    State tree.
       
  3988  * @param {string} postType The type of the parent post.
       
  3989  * @param {number} postId   The id of the parent post.
       
  3990  * @param {number} authorId The id of the author.
       
  3991  *
       
  3992  * @return {?Object} The autosave for the post and author.
       
  3993  */
       
  3994 
       
  3995 function getAutosave(state, postType, postId, authorId) {
       
  3996   if (authorId === undefined) {
       
  3997     return;
       
  3998   }
       
  3999 
       
  4000   const autosaves = state.autosaves[postId];
       
  4001   return Object(external_lodash_["find"])(autosaves, {
       
  4002     author: authorId
       
  4003   });
       
  4004 }
       
  4005 /**
       
  4006  * Returns true if the REST request for autosaves has completed.
       
  4007  *
       
  4008  * @param {Object} state State tree.
       
  4009  * @param {string} postType The type of the parent post.
       
  4010  * @param {number} postId   The id of the parent post.
       
  4011  *
       
  4012  * @return {boolean} True if the REST request was completed. False otherwise.
       
  4013  */
       
  4014 
       
  4015 const hasFetchedAutosaves = Object(external_wp_data_["createRegistrySelector"])(select => (state, postType, postId) => {
       
  4016   return select(STORE_NAME).hasFinishedResolution('getAutosaves', [postType, postId]);
       
  4017 });
       
  4018 /**
       
  4019  * Returns a new reference when edited values have changed. This is useful in
       
  4020  * inferring where an edit has been made between states by comparison of the
       
  4021  * return values using strict equality.
       
  4022  *
       
  4023  * @example
       
  4024  *
       
  4025  * ```
       
  4026  * const hasEditOccurred = (
       
  4027  *    getReferenceByDistinctEdits( beforeState ) !==
       
  4028  *    getReferenceByDistinctEdits( afterState )
       
  4029  * );
       
  4030  * ```
       
  4031  *
       
  4032  * @param {Object} state Editor state.
       
  4033  *
       
  4034  * @return {*} A value whose reference will change only when an edit occurs.
       
  4035  */
       
  4036 
       
  4037 const getReferenceByDistinctEdits = Object(rememo["a" /* default */])(() => [], state => [state.undo.length, state.undo.offset, state.undo.flattenedUndo]);
       
  4038 /**
       
  4039  * Retrieve the frontend template used for a given link.
       
  4040  *
       
  4041  * @param {Object} state Editor state.
       
  4042  * @param {string} link  Link.
       
  4043  *
       
  4044  * @return {Object?} The template record.
       
  4045  */
       
  4046 
       
  4047 function __experimentalGetTemplateForLink(state, link) {
       
  4048   const records = getEntityRecords(state, 'postType', 'wp_template', {
       
  4049     'find-template': link
       
  4050   });
       
  4051   const template = records !== null && records !== void 0 && records.length ? records[0] : null;
       
  4052 
       
  4053   if (template) {
       
  4054     return getEditedEntityRecord(state, 'postType', 'wp_template', template.id);
       
  4055   }
       
  4056 
       
  4057   return template;
       
  4058 }
       
  4059 
       
  4060 // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/utils/if-not-resolved.js
       
  4061 /**
       
  4062  * WordPress dependencies
       
  4063  */
       
  4064 
       
  4065 /**
       
  4066  * Higher-order function which invokes the given resolver only if it has not
       
  4067  * already been resolved with the arguments passed to the enhanced function.
       
  4068  *
       
  4069  * This only considers resolution state, and notably does not support resolver
       
  4070  * custom `isFulfilled` behavior.
       
  4071  *
       
  4072  * @param {Function} resolver     Original resolver.
       
  4073  * @param {string}   selectorName Selector name associated with resolver.
       
  4074  *
       
  4075  * @return {Function} Enhanced resolver.
       
  4076  */
       
  4077 
       
  4078 const ifNotResolved = (resolver, selectorName) =>
       
  4079 /**
       
  4080  * @param {...any} args Original resolver arguments.
       
  4081  */
       
  4082 function* resolveIfNotResolved(...args) {
       
  4083   const hasStartedResolution = yield external_wp_data_["controls"].select('core', 'hasStartedResolution', selectorName, args);
       
  4084 
       
  4085   if (!hasStartedResolution) {
       
  4086     yield* resolver(...args);
       
  4087   }
       
  4088 };
       
  4089 
       
  4090 /* harmony default export */ var if_not_resolved = (ifNotResolved);
       
  4091 
       
  4092 // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/resolvers.js
       
  4093 /**
       
  4094  * External dependencies
       
  4095  */
       
  4096 
       
  4097 /**
       
  4098  * WordPress dependencies
       
  4099  */
       
  4100 
       
  4101 
       
  4102 
       
  4103 
       
  4104 /**
       
  4105  * Internal dependencies
       
  4106  */
       
  4107 
       
  4108 
       
  4109 /**
       
  4110  * Internal dependencies
       
  4111  */
       
  4112 
       
  4113 
       
  4114 
       
  4115 
       
  4116 
       
  4117 /**
       
  4118  * Requests authors from the REST API.
       
  4119  *
       
  4120  * @param {Object|undefined} query Optional object of query parameters to
       
  4121  *                                 include with request.
       
  4122  */
       
  4123 
       
  4124 function* resolvers_getAuthors(query) {
       
  4125   const path = Object(external_wp_url_["addQueryArgs"])('/wp/v2/users/?who=authors&per_page=100', query);
       
  4126   const users = yield Object(external_wp_dataControls_["apiFetch"])({
       
  4127     path
       
  4128   });
       
  4129   yield receiveUserQuery(path, users);
       
  4130 }
       
  4131 /**
       
  4132  * Temporary approach to resolving editor access to author queries.
       
  4133  *
       
  4134  * @param {number} id The author id.
       
  4135  */
       
  4136 
       
  4137 function* resolvers_unstableGetAuthor(id) {
       
  4138   const path = `/wp/v2/users?who=authors&include=${id}`;
       
  4139   const users = yield Object(external_wp_dataControls_["apiFetch"])({
       
  4140     path
       
  4141   });
       
  4142   yield receiveUserQuery('author', users);
       
  4143 }
       
  4144 /**
       
  4145  * Requests the current user from the REST API.
       
  4146  */
       
  4147 
       
  4148 function* resolvers_getCurrentUser() {
       
  4149   const currentUser = yield Object(external_wp_dataControls_["apiFetch"])({
       
  4150     path: '/wp/v2/users/me'
       
  4151   });
       
  4152   yield receiveCurrentUser(currentUser);
       
  4153 }
       
  4154 /**
       
  4155  * Requests an entity's record from the REST API.
       
  4156  *
       
  4157  * @param {string}           kind  Entity kind.
       
  4158  * @param {string}           name  Entity name.
       
  4159  * @param {number|string}    key   Record's key
       
  4160  * @param {Object|undefined} query Optional object of query parameters to
       
  4161  *                                 include with request.
       
  4162  */
       
  4163 
       
  4164 function* resolvers_getEntityRecord(kind, name, key = '', query) {
       
  4165   const entities = yield getKindEntities(kind);
       
  4166   const entity = Object(external_lodash_["find"])(entities, {
       
  4167     kind,
       
  4168     name
       
  4169   });
       
  4170 
       
  4171   if (!entity) {
       
  4172     return;
       
  4173   }
       
  4174 
       
  4175   const lock = yield* __unstableAcquireStoreLock('core', ['entities', 'data', kind, name, key], {
       
  4176     exclusive: false
       
  4177   });
       
  4178 
       
  4179   try {
       
  4180     if (query !== undefined && query._fields) {
       
  4181       // If requesting specific fields, items and query assocation to said
       
  4182       // records are stored by ID reference. Thus, fields must always include
       
  4183       // the ID.
       
  4184       query = { ...query,
       
  4185         _fields: Object(external_lodash_["uniq"])([...(get_normalized_comma_separable(query._fields) || []), entity.key || DEFAULT_ENTITY_KEY]).join()
       
  4186       };
       
  4187     } // Disable reason: While true that an early return could leave `path`
       
  4188     // unused, it's important that path is derived using the query prior to
       
  4189     // additional query modifications in the condition below, since those
       
  4190     // modifications are relevant to how the data is tracked in state, and not
       
  4191     // for how the request is made to the REST API.
       
  4192     // eslint-disable-next-line @wordpress/no-unused-vars-before-return
       
  4193 
       
  4194 
       
  4195     const path = Object(external_wp_url_["addQueryArgs"])(entity.baseURL + '/' + key, { ...entity.baseURLParams,
       
  4196       ...query
       
  4197     });
       
  4198 
       
  4199     if (query !== undefined) {
       
  4200       query = { ...query,
       
  4201         include: [key]
       
  4202       }; // The resolution cache won't consider query as reusable based on the
       
  4203       // fields, so it's tested here, prior to initiating the REST request,
       
  4204       // and without causing `getEntityRecords` resolution to occur.
       
  4205 
       
  4206       const hasRecords = yield external_wp_data_["controls"].select('core', 'hasEntityRecords', kind, name, query);
       
  4207 
       
  4208       if (hasRecords) {
       
  4209         return;
       
  4210       }
       
  4211     }
       
  4212 
       
  4213     const record = yield Object(external_wp_dataControls_["apiFetch"])({
       
  4214       path
       
  4215     });
       
  4216     yield receiveEntityRecords(kind, name, record, query);
       
  4217   } catch (error) {// We need a way to handle and access REST API errors in state
       
  4218     // Until then, catching the error ensures the resolver is marked as resolved.
       
  4219   } finally {
       
  4220     yield* __unstableReleaseStoreLock(lock);
       
  4221   }
       
  4222 }
       
  4223 /**
       
  4224  * Requests an entity's record from the REST API.
       
  4225  */
       
  4226 
       
  4227 const resolvers_getRawEntityRecord = if_not_resolved(resolvers_getEntityRecord, 'getEntityRecord');
       
  4228 /**
       
  4229  * Requests an entity's record from the REST API.
       
  4230  */
       
  4231 
       
  4232 const resolvers_getEditedEntityRecord = if_not_resolved(resolvers_getRawEntityRecord, 'getRawEntityRecord');
       
  4233 /**
       
  4234  * Requests the entity's records from the REST API.
       
  4235  *
       
  4236  * @param {string}  kind   Entity kind.
       
  4237  * @param {string}  name   Entity name.
       
  4238  * @param {Object?} query  Query Object.
       
  4239  */
       
  4240 
       
  4241 function* resolvers_getEntityRecords(kind, name, query = {}) {
       
  4242   const entities = yield getKindEntities(kind);
       
  4243   const entity = Object(external_lodash_["find"])(entities, {
       
  4244     kind,
       
  4245     name
       
  4246   });
       
  4247 
       
  4248   if (!entity) {
       
  4249     return;
       
  4250   }
       
  4251 
       
  4252   const lock = yield* __unstableAcquireStoreLock('core', ['entities', 'data', kind, name], {
       
  4253     exclusive: false
       
  4254   });
       
  4255 
       
  4256   try {
       
  4257     var _query;
       
  4258 
       
  4259     if (query._fields) {
       
  4260       // If requesting specific fields, items and query assocation to said
       
  4261       // records are stored by ID reference. Thus, fields must always include
       
  4262       // the ID.
       
  4263       query = { ...query,
       
  4264         _fields: Object(external_lodash_["uniq"])([...(get_normalized_comma_separable(query._fields) || []), entity.key || DEFAULT_ENTITY_KEY]).join()
       
  4265       };
       
  4266     }
       
  4267 
       
  4268     const path = Object(external_wp_url_["addQueryArgs"])(entity.baseURL, { ...entity.baseURLParams,
       
  4269       ...query
       
  4270     });
       
  4271     let records = Object.values(yield Object(external_wp_dataControls_["apiFetch"])({
       
  4272       path
       
  4273     })); // If we request fields but the result doesn't contain the fields,
       
  4274     // explicitely set these fields as "undefined"
       
  4275     // that way we consider the query "fullfilled".
       
  4276 
       
  4277     if (query._fields) {
       
  4278       records = records.map(record => {
       
  4279         query._fields.split(',').forEach(field => {
       
  4280           if (!record.hasOwnProperty(field)) {
       
  4281             record[field] = undefined;
       
  4282           }
       
  4283         });
       
  4284 
       
  4285         return record;
       
  4286       });
       
  4287     }
       
  4288 
       
  4289     yield receiveEntityRecords(kind, name, records, query); // When requesting all fields, the list of results can be used to
       
  4290     // resolve the `getEntityRecord` selector in addition to `getEntityRecords`.
       
  4291     // See https://github.com/WordPress/gutenberg/pull/26575
       
  4292 
       
  4293     if (!((_query = query) !== null && _query !== void 0 && _query._fields) && !query.context) {
       
  4294       const key = entity.key || DEFAULT_ENTITY_KEY;
       
  4295       const resolutionsArgs = records.filter(record => record[key]).map(record => [kind, name, record[key]]);
       
  4296       yield {
       
  4297         type: 'START_RESOLUTIONS',
       
  4298         selectorName: 'getEntityRecord',
       
  4299         args: resolutionsArgs
       
  4300       };
       
  4301       yield {
       
  4302         type: 'FINISH_RESOLUTIONS',
       
  4303         selectorName: 'getEntityRecord',
       
  4304         args: resolutionsArgs
       
  4305       };
       
  4306     }
       
  4307   } finally {
       
  4308     yield* __unstableReleaseStoreLock(lock);
       
  4309   }
       
  4310 }
       
  4311 
       
  4312 resolvers_getEntityRecords.shouldInvalidate = (action, kind, name) => {
       
  4313   return (action.type === 'RECEIVE_ITEMS' || action.type === 'REMOVE_ITEMS') && action.invalidateCache && kind === action.kind && name === action.name;
       
  4314 };
       
  4315 /**
       
  4316  * Requests the current theme.
       
  4317  */
       
  4318 
       
  4319 
       
  4320 function* resolvers_getCurrentTheme() {
       
  4321   const activeThemes = yield Object(external_wp_dataControls_["apiFetch"])({
       
  4322     path: '/wp/v2/themes?status=active'
       
  4323   });
       
  4324   yield receiveCurrentTheme(activeThemes[0]);
       
  4325 }
       
  4326 /**
       
  4327  * Requests theme supports data from the index.
       
  4328  */
       
  4329 
       
  4330 function* resolvers_getThemeSupports() {
       
  4331   const activeThemes = yield Object(external_wp_dataControls_["apiFetch"])({
       
  4332     path: '/wp/v2/themes?status=active'
       
  4333   });
       
  4334   yield receiveThemeSupports(activeThemes[0].theme_supports);
       
  4335 }
       
  4336 /**
       
  4337  * Requests a preview from the from the Embed API.
       
  4338  *
       
  4339  * @param {string} url   URL to get the preview for.
       
  4340  */
       
  4341 
       
  4342 function* resolvers_getEmbedPreview(url) {
       
  4343   try {
       
  4344     const embedProxyResponse = yield Object(external_wp_dataControls_["apiFetch"])({
       
  4345       path: Object(external_wp_url_["addQueryArgs"])('/oembed/1.0/proxy', {
       
  4346         url
       
  4347       })
       
  4348     });
       
  4349     yield receiveEmbedPreview(url, embedProxyResponse);
       
  4350   } catch (error) {
       
  4351     // Embed API 404s if the URL cannot be embedded, so we have to catch the error from the apiRequest here.
       
  4352     yield receiveEmbedPreview(url, false);
       
  4353   }
       
  4354 }
       
  4355 /**
       
  4356  * Checks whether the current user can perform the given action on the given
       
  4357  * REST resource.
       
  4358  *
       
  4359  * @param {string}  action   Action to check. One of: 'create', 'read', 'update',
       
  4360  *                           'delete'.
       
  4361  * @param {string}  resource REST resource to check, e.g. 'media' or 'posts'.
       
  4362  * @param {?string} id       ID of the rest resource to check.
       
  4363  */
       
  4364 
       
  4365 function* resolvers_canUser(action, resource, id) {
       
  4366   const methods = {
       
  4367     create: 'POST',
       
  4368     read: 'GET',
       
  4369     update: 'PUT',
       
  4370     delete: 'DELETE'
       
  4371   };
       
  4372   const method = methods[action];
       
  4373 
       
  4374   if (!method) {
       
  4375     throw new Error(`'${action}' is not a valid action.`);
       
  4376   }
       
  4377 
       
  4378   const path = id ? `/wp/v2/${resource}/${id}` : `/wp/v2/${resource}`;
       
  4379   let response;
       
  4380 
       
  4381   try {
       
  4382     response = yield Object(external_wp_dataControls_["apiFetch"])({
       
  4383       path,
       
  4384       // Ideally this would always be an OPTIONS request, but unfortunately there's
       
  4385       // a bug in the REST API which causes the Allow header to not be sent on
       
  4386       // OPTIONS requests to /posts/:id routes.
       
  4387       // https://core.trac.wordpress.org/ticket/45753
       
  4388       method: id ? 'GET' : 'OPTIONS',
       
  4389       parse: false
       
  4390     });
       
  4391   } catch (error) {
       
  4392     // Do nothing if our OPTIONS request comes back with an API error (4xx or
       
  4393     // 5xx). The previously determined isAllowed value will remain in the store.
       
  4394     return;
       
  4395   }
       
  4396 
       
  4397   let allowHeader;
       
  4398 
       
  4399   if (Object(external_lodash_["hasIn"])(response, ['headers', 'get'])) {
       
  4400     // If the request is fetched using the fetch api, the header can be
       
  4401     // retrieved using the 'get' method.
       
  4402     allowHeader = response.headers.get('allow');
       
  4403   } else {
       
  4404     // If the request was preloaded server-side and is returned by the
       
  4405     // preloading middleware, the header will be a simple property.
       
  4406     allowHeader = Object(external_lodash_["get"])(response, ['headers', 'Allow'], '');
       
  4407   }
       
  4408 
       
  4409   const key = Object(external_lodash_["compact"])([action, resource, id]).join('/');
       
  4410   const isAllowed = Object(external_lodash_["includes"])(allowHeader, method);
       
  4411   yield receiveUserPermission(key, isAllowed);
       
  4412 }
       
  4413 /**
       
  4414  * Checks whether the current user can perform the given action on the given
       
  4415  * REST resource.
       
  4416  *
       
  4417  * @param {string} kind     Entity kind.
       
  4418  * @param {string} name     Entity name.
       
  4419  * @param {string} recordId Record's id.
       
  4420  */
       
  4421 
       
  4422 function* resolvers_canUserEditEntityRecord(kind, name, recordId) {
       
  4423   const entities = yield getKindEntities(kind);
       
  4424   const entity = Object(external_lodash_["find"])(entities, {
       
  4425     kind,
       
  4426     name
       
  4427   });
       
  4428 
       
  4429   if (!entity) {
       
  4430     return;
       
  4431   }
       
  4432 
       
  4433   const resource = entity.__unstable_rest_base;
       
  4434   yield resolvers_canUser('update', resource, recordId);
       
  4435 }
       
  4436 /**
       
  4437  * Request autosave data from the REST API.
       
  4438  *
       
  4439  * @param {string} postType The type of the parent post.
       
  4440  * @param {number} postId   The id of the parent post.
       
  4441  */
       
  4442 
       
  4443 function* resolvers_getAutosaves(postType, postId) {
       
  4444   const {
       
  4445     rest_base: restBase
       
  4446   } = yield external_wp_data_["controls"].resolveSelect('core', 'getPostType', postType);
       
  4447   const autosaves = yield Object(external_wp_dataControls_["apiFetch"])({
       
  4448     path: `/wp/v2/${restBase}/${postId}/autosaves?context=edit`
       
  4449   });
       
  4450 
       
  4451   if (autosaves && autosaves.length) {
       
  4452     yield receiveAutosaves(postId, autosaves);
       
  4453   }
       
  4454 }
       
  4455 /**
       
  4456  * Request autosave data from the REST API.
       
  4457  *
       
  4458  * This resolver exists to ensure the underlying autosaves are fetched via
       
  4459  * `getAutosaves` when a call to the `getAutosave` selector is made.
       
  4460  *
       
  4461  * @param {string} postType The type of the parent post.
       
  4462  * @param {number} postId   The id of the parent post.
       
  4463  */
       
  4464 
       
  4465 function* resolvers_getAutosave(postType, postId) {
       
  4466   yield external_wp_data_["controls"].resolveSelect('core', 'getAutosaves', postType, postId);
       
  4467 }
       
  4468 /**
       
  4469  * Retrieve the frontend template used for a given link.
       
  4470  *
       
  4471  * @param {string} link  Link.
       
  4472  */
       
  4473 
       
  4474 function* resolvers_experimentalGetTemplateForLink(link) {
       
  4475   // Ideally this should be using an apiFetch call
       
  4476   // We could potentially do so by adding a "filter" to the `wp_template` end point.
       
  4477   // Also it seems the returned object is not a regular REST API post type.
       
  4478   let template;
       
  4479 
       
  4480   try {
       
  4481     template = yield regularFetch(Object(external_wp_url_["addQueryArgs"])(link, {
       
  4482       '_wp-find-template': true
       
  4483     }));
       
  4484   } catch (e) {// For non-FSE themes, it is possible that this request returns an error.
       
  4485   }
       
  4486 
       
  4487   if (!template) {
       
  4488     return;
       
  4489   }
       
  4490 
       
  4491   yield resolvers_getEntityRecord('postType', 'wp_template', template.id);
       
  4492   const record = yield external_wp_data_["controls"].select('core', 'getEntityRecord', 'postType', 'wp_template', template.id);
       
  4493 
       
  4494   if (record) {
       
  4495     yield receiveEntityRecords('postType', 'wp_template', [record], {
       
  4496       'find-template': link
       
  4497     });
       
  4498   }
       
  4499 }
       
  4500 
       
  4501 resolvers_experimentalGetTemplateForLink.shouldInvalidate = action => {
       
  4502   return (action.type === 'RECEIVE_ITEMS' || action.type === 'REMOVE_ITEMS') && action.invalidateCache && action.kind === 'postType' && action.name === 'wp_template';
       
  4503 };
       
  4504 
       
  4505 // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/locks/selectors.js
       
  4506 /**
       
  4507  * Internal dependencies
       
  4508  */
       
  4509 
       
  4510 function __unstableGetPendingLockRequests(state) {
       
  4511   return state.locks.requests;
       
  4512 }
       
  4513 function __unstableIsLockAvailable(state, store, path, {
       
  4514   exclusive
       
  4515 }) {
       
  4516   const storePath = [store, ...path];
       
  4517   const locks = state.locks.tree; // Validate all parents and the node itself
       
  4518 
       
  4519   for (const node of iteratePath(locks, storePath)) {
       
  4520     if (hasConflictingLock({
       
  4521       exclusive
       
  4522     }, node.locks)) {
       
  4523       return false;
       
  4524     }
       
  4525   } // iteratePath terminates early if path is unreachable, let's
       
  4526   // re-fetch the node and check it exists in the tree.
       
  4527 
       
  4528 
       
  4529   const node = getNode(locks, storePath);
       
  4530 
       
  4531   if (!node) {
       
  4532     return true;
       
  4533   } // Validate all nested nodes
       
  4534 
       
  4535 
       
  4536   for (const descendant of iterateDescendants(node)) {
       
  4537     if (hasConflictingLock({
       
  4538       exclusive
       
  4539     }, descendant.locks)) {
       
  4540       return false;
       
  4541     }
       
  4542   }
       
  4543 
       
  4544   return true;
       
  4545 }
       
  4546 
       
  4547 // EXTERNAL MODULE: external ["wp","element"]
       
  4548 var external_wp_element_ = __webpack_require__("GRId");
       
  4549 
       
  4550 // EXTERNAL MODULE: external ["wp","blocks"]
       
  4551 var external_wp_blocks_ = __webpack_require__("HSyU");
       
  4552 
       
  4553 // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/entity-provider.js
       
  4554 
       
  4555 
       
  4556 /**
       
  4557  * WordPress dependencies
       
  4558  */
       
  4559 
       
  4560 
       
  4561 
       
  4562 const entity_provider_EMPTY_ARRAY = [];
       
  4563 /**
       
  4564  * Internal dependencies
       
  4565  */
       
  4566 
       
  4567 
       
  4568 const entity_provider_entities = { ...defaultEntities.reduce((acc, entity) => {
       
  4569     if (!acc[entity.kind]) {
       
  4570       acc[entity.kind] = {};
       
  4571     }
       
  4572 
       
  4573     acc[entity.kind][entity.name] = {
       
  4574       context: Object(external_wp_element_["createContext"])()
       
  4575     };
       
  4576     return acc;
       
  4577   }, {}),
       
  4578   ...kinds.reduce((acc, kind) => {
       
  4579     acc[kind.name] = {};
       
  4580     return acc;
       
  4581   }, {})
       
  4582 };
       
  4583 
       
  4584 const entity_provider_getEntity = (kind, type) => {
       
  4585   if (!entity_provider_entities[kind]) {
       
  4586     throw new Error(`Missing entity config for kind: ${kind}.`);
       
  4587   }
       
  4588 
       
  4589   if (!entity_provider_entities[kind][type]) {
       
  4590     entity_provider_entities[kind][type] = {
       
  4591       context: Object(external_wp_element_["createContext"])()
       
  4592     };
       
  4593   }
       
  4594 
       
  4595   return entity_provider_entities[kind][type];
       
  4596 };
       
  4597 /**
       
  4598  * Context provider component for providing
       
  4599  * an entity for a specific entity type.
       
  4600  *
       
  4601  * @param {Object} props          The component's props.
       
  4602  * @param {string} props.kind     The entity kind.
       
  4603  * @param {string} props.type     The entity type.
       
  4604  * @param {number} props.id       The entity ID.
       
  4605  * @param {*}      props.children The children to wrap.
       
  4606  *
       
  4607  * @return {Object} The provided children, wrapped with
       
  4608  *                   the entity's context provider.
       
  4609  */
       
  4610 
       
  4611 
       
  4612 function EntityProvider({
       
  4613   kind,
       
  4614   type,
       
  4615   id,
       
  4616   children
       
  4617 }) {
       
  4618   const Provider = entity_provider_getEntity(kind, type).context.Provider;
       
  4619   return Object(external_wp_element_["createElement"])(Provider, {
       
  4620     value: id
       
  4621   }, children);
       
  4622 }
       
  4623 /**
       
  4624  * Hook that returns the ID for the nearest
       
  4625  * provided entity of the specified type.
       
  4626  *
       
  4627  * @param {string} kind The entity kind.
       
  4628  * @param {string} type The entity type.
       
  4629  */
       
  4630 
       
  4631 function useEntityId(kind, type) {
       
  4632   return Object(external_wp_element_["useContext"])(entity_provider_getEntity(kind, type).context);
       
  4633 }
       
  4634 /**
       
  4635  * Hook that returns the value and a setter for the
       
  4636  * specified property of the nearest provided
       
  4637  * entity of the specified type.
       
  4638  *
       
  4639  * @param {string} kind  The entity kind.
       
  4640  * @param {string} type  The entity type.
       
  4641  * @param {string} prop  The property name.
       
  4642  * @param {string} [_id] An entity ID to use instead of the context-provided one.
       
  4643  *
       
  4644  * @return {[*, Function, *]} An array where the first item is the
       
  4645  *                            property value, the second is the
       
  4646  *                            setter and the third is the full value
       
  4647  * 							  object from REST API containing more
       
  4648  * 							  information like `raw`, `rendered` and
       
  4649  * 							  `protected` props.
       
  4650  */
       
  4651 
       
  4652 function useEntityProp(kind, type, prop, _id) {
       
  4653   const providerId = useEntityId(kind, type);
       
  4654   const id = _id !== null && _id !== void 0 ? _id : providerId;
       
  4655   const {
       
  4656     value,
       
  4657     fullValue
       
  4658   } = Object(external_wp_data_["useSelect"])(select => {
       
  4659     const {
       
  4660       getEntityRecord,
       
  4661       getEditedEntityRecord
       
  4662     } = select('core');
       
  4663     const entity = getEntityRecord(kind, type, id); // Trigger resolver.
       
  4664 
       
  4665     const editedEntity = getEditedEntityRecord(kind, type, id);
       
  4666     return entity && editedEntity ? {
       
  4667       value: editedEntity[prop],
       
  4668       fullValue: entity[prop]
       
  4669     } : {};
       
  4670   }, [kind, type, id, prop]);
       
  4671   const {
       
  4672     editEntityRecord
       
  4673   } = Object(external_wp_data_["useDispatch"])('core');
       
  4674   const setValue = Object(external_wp_element_["useCallback"])(newValue => {
       
  4675     editEntityRecord(kind, type, id, {
       
  4676       [prop]: newValue
       
  4677     });
       
  4678   }, [kind, type, id, prop]);
       
  4679   return [value, setValue, fullValue];
       
  4680 }
       
  4681 /**
       
  4682  * Hook that returns block content getters and setters for
       
  4683  * the nearest provided entity of the specified type.
       
  4684  *
       
  4685  * The return value has the shape `[ blocks, onInput, onChange ]`.
       
  4686  * `onInput` is for block changes that don't create undo levels
       
  4687  * or dirty the post, non-persistent changes, and `onChange` is for
       
  4688  * peristent changes. They map directly to the props of a
       
  4689  * `BlockEditorProvider` and are intended to be used with it,
       
  4690  * or similar components or hooks.
       
  4691  *
       
  4692  * @param {string} kind                            The entity kind.
       
  4693  * @param {string} type                            The entity type.
       
  4694  * @param {Object} options
       
  4695  * @param {string} [options.id]                    An entity ID to use instead of the context-provided one.
       
  4696  *
       
  4697  * @return {[WPBlock[], Function, Function]} The block array and setters.
       
  4698  */
       
  4699 
       
  4700 function useEntityBlockEditor(kind, type, {
       
  4701   id: _id
       
  4702 } = {}) {
       
  4703   const providerId = useEntityId(kind, type);
       
  4704   const id = _id !== null && _id !== void 0 ? _id : providerId;
       
  4705   const {
       
  4706     content,
       
  4707     blocks
       
  4708   } = Object(external_wp_data_["useSelect"])(select => {
       
  4709     const {
       
  4710       getEditedEntityRecord
       
  4711     } = select('core');
       
  4712     const editedEntity = getEditedEntityRecord(kind, type, id);
       
  4713     return {
       
  4714       blocks: editedEntity.blocks,
       
  4715       content: editedEntity.content
       
  4716     };
       
  4717   }, [kind, type, id]);
       
  4718   const {
       
  4719     __unstableCreateUndoLevel,
       
  4720     editEntityRecord
       
  4721   } = Object(external_wp_data_["useDispatch"])('core');
       
  4722   Object(external_wp_element_["useEffect"])(() => {
       
  4723     // Load the blocks from the content if not already in state
       
  4724     // Guard against other instances that might have
       
  4725     // set content to a function already or the blocks are already in state.
       
  4726     if (content && typeof content !== 'function' && !blocks) {
       
  4727       const parsedContent = Object(external_wp_blocks_["parse"])(content);
       
  4728       editEntityRecord(kind, type, id, {
       
  4729         blocks: parsedContent
       
  4730       }, {
       
  4731         undoIgnore: true
       
  4732       });
       
  4733     }
       
  4734   }, [content]);
       
  4735   const onChange = Object(external_wp_element_["useCallback"])((newBlocks, options) => {
       
  4736     const {
       
  4737       selection
       
  4738     } = options;
       
  4739     const edits = {
       
  4740       blocks: newBlocks,
       
  4741       selection
       
  4742     };
       
  4743     const noChange = blocks === edits.blocks;
       
  4744 
       
  4745     if (noChange) {
       
  4746       return __unstableCreateUndoLevel(kind, type, id);
       
  4747     } // We create a new function here on every persistent edit
       
  4748     // to make sure the edit makes the post dirty and creates
       
  4749     // a new undo level.
       
  4750 
       
  4751 
       
  4752     edits.content = ({
       
  4753       blocks: blocksForSerialization = []
       
  4754     }) => Object(external_wp_blocks_["__unstableSerializeAndClean"])(blocksForSerialization);
       
  4755 
       
  4756     editEntityRecord(kind, type, id, edits);
       
  4757   }, [kind, type, id, blocks]);
       
  4758   const onInput = Object(external_wp_element_["useCallback"])((newBlocks, options) => {
       
  4759     const {
       
  4760       selection
       
  4761     } = options;
       
  4762     const edits = {
       
  4763       blocks: newBlocks,
       
  4764       selection
       
  4765     };
       
  4766     editEntityRecord(kind, type, id, edits);
       
  4767   }, [kind, type, id]);
       
  4768   return [blocks !== null && blocks !== void 0 ? blocks : entity_provider_EMPTY_ARRAY, onInput, onChange];
       
  4769 }
       
  4770 
       
  4771 // EXTERNAL MODULE: external ["wp","htmlEntities"]
       
  4772 var external_wp_htmlEntities_ = __webpack_require__("rmEH");
       
  4773 
       
  4774 // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/fetch/__experimental-fetch-link-suggestions.js
       
  4775 /**
       
  4776  * WordPress dependencies
       
  4777  */
       
  4778 
       
  4779 
       
  4780 
       
  4781 
       
  4782 /**
       
  4783  * Filters the search by type
       
  4784  *
       
  4785  * @typedef { 'post' | 'term' | 'post-format' } WPLinkSearchType
       
  4786  */
       
  4787 
       
  4788 /**
       
  4789  * A link with an id may be of kind post-type or taxonomy
       
  4790  *
       
  4791  * @typedef { 'post-type' | 'taxonomy' } WPKind
       
  4792  */
       
  4793 
       
  4794 /**
       
  4795  * @typedef WPLinkSearchOptions
       
  4796  *
       
  4797  * @property {boolean}             [isInitialSuggestions] Displays initial search suggestions, when true.
       
  4798  * @property {WPLinkSearchType}    [type]                 Filters by search type.
       
  4799  * @property {string}              [subtype]              Slug of the post-type or taxonomy.
       
  4800  * @property {number}              [page]                 Which page of results to return.
       
  4801  * @property {number}              [perPage]              Search results per page.
       
  4802  */
       
  4803 
       
  4804 /**
       
  4805  * @typedef WPLinkSearchResult
       
  4806  *
       
  4807  * @property {number} id     Post or term id.
       
  4808  * @property {string} url    Link url.
       
  4809  * @property {string} title  Title of the link.
       
  4810  * @property {string} type   The taxonomy or post type slug or type URL.
       
  4811  * @property {WPKind} [kind] Link kind of post-type or taxonomy
       
  4812  */
       
  4813 
       
  4814 /**
       
  4815  * @typedef WPEditorSettings
       
  4816  *
       
  4817  * @property {boolean} [ disablePostFormats ] Disables post formats, when true.
       
  4818  */
       
  4819 
       
  4820 /**
       
  4821  * Fetches link suggestions from the API.
       
  4822  *
       
  4823  * @async
       
  4824  * @param {string}              search
       
  4825  * @param {WPLinkSearchOptions} [searchOptions]
       
  4826  * @param {WPEditorSettings}    [settings]
       
  4827  *
       
  4828  * @example
       
  4829  * ```js
       
  4830  * import { __experimentalFetchLinkSuggestions as fetchLinkSuggestions } from '@wordpress/core-data';
       
  4831  *
       
  4832  * //...
       
  4833  *
       
  4834  * export function initialize( id, settings ) {
       
  4835  *
       
  4836  * settings.__experimentalFetchLinkSuggestions = (
       
  4837  *     search,
       
  4838  *     searchOptions
       
  4839  * ) => fetchLinkSuggestions( search, searchOptions, settings );
       
  4840  * ```
       
  4841  * @return {Promise< WPLinkSearchResult[] >} List of search suggestions
       
  4842  */
       
  4843 
       
  4844 const fetchLinkSuggestions = async (search, searchOptions = {}, settings = {}) => {
       
  4845   const {
       
  4846     isInitialSuggestions = false,
       
  4847     type = undefined,
       
  4848     subtype = undefined,
       
  4849     page = undefined,
       
  4850     perPage = isInitialSuggestions ? 3 : 20
       
  4851   } = searchOptions;
       
  4852   const {
       
  4853     disablePostFormats = false
       
  4854   } = settings;
       
  4855   const queries = [];
       
  4856 
       
  4857   if (!type || type === 'post') {
       
  4858     queries.push(external_wp_apiFetch_default()({
       
  4859       path: Object(external_wp_url_["addQueryArgs"])('/wp/v2/search', {
       
  4860         search,
       
  4861         page,
       
  4862         per_page: perPage,
       
  4863         type: 'post',
       
  4864         subtype
       
  4865       })
       
  4866     }).then(results => {
       
  4867       return results.map(result => {
       
  4868         return { ...result,
       
  4869           meta: {
       
  4870             kind: 'post-type',
       
  4871             subtype
       
  4872           }
       
  4873         };
       
  4874       });
       
  4875     }).catch(() => []) // fail by returning no results
       
  4876     );
       
  4877   }
       
  4878 
       
  4879   if (!type || type === 'term') {
       
  4880     queries.push(external_wp_apiFetch_default()({
       
  4881       path: Object(external_wp_url_["addQueryArgs"])('/wp/v2/search', {
       
  4882         search,
       
  4883         page,
       
  4884         per_page: perPage,
       
  4885         type: 'term',
       
  4886         subtype
       
  4887       })
       
  4888     }).then(results => {
       
  4889       return results.map(result => {
       
  4890         return { ...result,
       
  4891           meta: {
       
  4892             kind: 'taxonomy',
       
  4893             subtype
       
  4894           }
       
  4895         };
       
  4896       });
       
  4897     }).catch(() => []));
       
  4898   }
       
  4899 
       
  4900   if (!disablePostFormats && (!type || type === 'post-format')) {
       
  4901     queries.push(external_wp_apiFetch_default()({
       
  4902       path: Object(external_wp_url_["addQueryArgs"])('/wp/v2/search', {
       
  4903         search,
       
  4904         page,
       
  4905         per_page: perPage,
       
  4906         type: 'post-format',
       
  4907         subtype
       
  4908       })
       
  4909     }).then(results => {
       
  4910       return results.map(result => {
       
  4911         return { ...result,
       
  4912           meta: {
       
  4913             kind: 'taxonomy',
       
  4914             subtype
       
  4915           }
       
  4916         };
       
  4917       });
       
  4918     }).catch(() => []));
       
  4919   }
       
  4920 
       
  4921   return Promise.all(queries).then(results => {
       
  4922     return results.reduce((accumulator, current) => accumulator.concat(current), //flatten list
       
  4923     []).filter(
       
  4924     /**
       
  4925      * @param {{ id: number }} result
       
  4926      */
       
  4927     result => {
       
  4928       return !!result.id;
       
  4929     }).slice(0, perPage).map(
       
  4930     /**
       
  4931      * @param {{ id: number, url:string, title?:string, subtype?: string, type?: string }} result
       
  4932      */
       
  4933     result => {
       
  4934       var _result$meta;
       
  4935 
       
  4936       return {
       
  4937         id: result.id,
       
  4938         url: result.url,
       
  4939         title: Object(external_wp_htmlEntities_["decodeEntities"])(result.title || '') || Object(external_wp_i18n_["__"])('(no title)'),
       
  4940         type: result.subtype || result.type,
       
  4941         kind: result === null || result === void 0 ? void 0 : (_result$meta = result.meta) === null || _result$meta === void 0 ? void 0 : _result$meta.kind
       
  4942       };
       
  4943     });
       
  4944   });
       
  4945 };
       
  4946 
       
  4947 /* harmony default export */ var _experimental_fetch_link_suggestions = (fetchLinkSuggestions);
       
  4948 
       
  4949 // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/fetch/__experimental-fetch-remote-url-data.js
       
  4950 /**
       
  4951  * WordPress dependencies
       
  4952  */
       
  4953 
       
  4954 
       
  4955 /**
       
  4956  * @typedef WPRemoteUrlData
       
  4957  *
       
  4958  * @property {string} title     contents of the remote URL's `<title>` tag.
       
  4959  */
       
  4960 
       
  4961 /**
       
  4962  * Fetches data about a remote URL.
       
  4963  * eg: <title> tag, favicon...etc.
       
  4964  *
       
  4965  * @async
       
  4966  * @param {string}              url
       
  4967  *
       
  4968  * @example
       
  4969  * ```js
       
  4970  * import { __experimentalFetchRemoteUrlData as fetchRemoteUrlData } from '@wordpress/core-data';
       
  4971  *
       
  4972  * //...
       
  4973  *
       
  4974  * export function initialize( id, settings ) {
       
  4975  *
       
  4976  * settings.__experimentalFetchRemoteUrlData = (
       
  4977  *     url
       
  4978  * ) => fetchRemoteUrlData( url );
       
  4979  * ```
       
  4980  * @return {Promise< WPRemoteUrlData[] >} Remote URL data.
       
  4981  */
       
  4982 
       
  4983 const fetchRemoteUrlData = async url => {
       
  4984   const endpoint = '/__experimental/url-details';
       
  4985   const args = {
       
  4986     url: Object(external_wp_url_["prependHTTP"])(url)
       
  4987   };
       
  4988   return external_wp_apiFetch_default()({
       
  4989     path: Object(external_wp_url_["addQueryArgs"])(endpoint, args)
       
  4990   });
       
  4991 };
       
  4992 
       
  4993 /* harmony default export */ var _experimental_fetch_remote_url_data = (fetchRemoteUrlData);
       
  4994 
       
  4995 // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/fetch/index.js
       
  4996 
       
  4997 
       
  4998 
       
  4999 // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/index.js
       
  5000 /**
       
  5001  * WordPress dependencies
       
  5002  */
       
  5003 
       
  5004 
       
  5005 /**
       
  5006  * Internal dependencies
       
  5007  */
       
  5008 
       
  5009 
       
  5010 
       
  5011 
       
  5012 
       
  5013 
       
  5014 
       
  5015 
       
  5016 
       
  5017  // The entity selectors/resolvers and actions are shortcuts to their generic equivalents
       
  5018 // (getEntityRecord, getEntityRecords, updateEntityRecord, updateEntityRecordss)
       
  5019 // Instead of getEntityRecord, the consumer could use more user-frieldly named selector: getPostType, getTaxonomy...
       
  5020 // The "kind" and the "name" of the entity are combined to generate these shortcuts.
       
  5021 
       
  5022 const entitySelectors = defaultEntities.reduce((result, entity) => {
       
  5023   const {
       
  5024     kind,
       
  5025     name
       
  5026   } = entity;
       
  5027 
       
  5028   result[getMethodName(kind, name)] = (state, key) => getEntityRecord(state, kind, name, key);
       
  5029 
       
  5030   result[getMethodName(kind, name, 'get', true)] = (state, ...args) => getEntityRecords(state, kind, name, ...args);
       
  5031 
       
  5032   return result;
       
  5033 }, {});
       
  5034 const entityResolvers = defaultEntities.reduce((result, entity) => {
       
  5035   const {
       
  5036     kind,
       
  5037     name
       
  5038   } = entity;
       
  5039 
       
  5040   result[getMethodName(kind, name)] = key => resolvers_getEntityRecord(kind, name, key);
       
  5041 
       
  5042   const pluralMethodName = getMethodName(kind, name, 'get', true);
       
  5043 
       
  5044   result[pluralMethodName] = (...args) => resolvers_getEntityRecords(kind, name, ...args);
       
  5045 
       
  5046   result[pluralMethodName].shouldInvalidate = (action, ...args) => resolvers_getEntityRecords.shouldInvalidate(action, kind, name, ...args);
       
  5047 
       
  5048   return result;
       
  5049 }, {});
       
  5050 const entityActions = defaultEntities.reduce((result, entity) => {
       
  5051   const {
       
  5052     kind,
       
  5053     name
       
  5054   } = entity;
       
  5055 
       
  5056   result[getMethodName(kind, name, 'save')] = key => saveEntityRecord(kind, name, key);
       
  5057 
       
  5058   result[getMethodName(kind, name, 'delete')] = (key, query) => deleteEntityRecord(kind, name, key, query);
       
  5059 
       
  5060   return result;
       
  5061 }, {});
       
  5062 const storeConfig = {
       
  5063   reducer: build_module_reducer,
       
  5064   controls: { ...build_module_controls,
       
  5065     ...external_wp_dataControls_["controls"]
       
  5066   },
       
  5067   actions: { ...build_module_actions_namespaceObject,
       
  5068     ...entityActions,
       
  5069     ...locks_actions_namespaceObject
       
  5070   },
       
  5071   selectors: { ...build_module_selectors_namespaceObject,
       
  5072     ...entitySelectors,
       
  5073     ...locks_selectors_namespaceObject
       
  5074   },
       
  5075   resolvers: { ...resolvers_namespaceObject,
       
  5076     ...entityResolvers
       
  5077   }
       
  5078 };
       
  5079 /**
       
  5080  * Store definition for the code data namespace.
       
  5081  *
       
  5082  * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
       
  5083  *
       
  5084  * @type {Object}
       
  5085  */
       
  5086 
       
  5087 const build_module_store = Object(external_wp_data_["createReduxStore"])(STORE_NAME, storeConfig);
       
  5088 Object(external_wp_data_["register"])(build_module_store);
       
  5089 
       
  5090 
       
  5091 
       
  5092 
       
  5093 
       
  5094 /***/ }),
       
  5095 
       
  5096 /***/ "l3Sj":
       
  5097 /***/ (function(module, exports) {
       
  5098 
       
  5099 (function() { module.exports = window["wp"]["i18n"]; }());
       
  5100 
       
  5101 /***/ }),
       
  5102 
       
  5103 /***/ "pPDe":
       
  5104 /***/ (function(module, __webpack_exports__, __webpack_require__) {
       
  5105 
       
  5106 "use strict";
       
  5107 
  3406 
  5108 
  3407 
  5109 var LEAF_KEY, hasWeakMap;
  3408 var LEAF_KEY, hasWeakMap;
  5110 
  3409 
  5111 /**
  3410 /**
  5199  *                                 reference or array of reference used in
  3498  *                                 reference or array of reference used in
  5200  *                                 cache bust consideration.
  3499  *                                 cache bust consideration.
  5201  *
  3500  *
  5202  * @return {Function} Memoized selector.
  3501  * @return {Function} Memoized selector.
  5203  */
  3502  */
  5204 /* harmony default export */ __webpack_exports__["a"] = (function( selector, getDependants ) {
  3503 /* harmony default export */ function rememo(selector, getDependants ) {
  5205 	var rootCache, getCache;
  3504 	var rootCache, getCache;
  5206 
  3505 
  5207 	// Use object source as dependant if getter not provided
  3506 	// Use object source as dependant if getter not provided
  5208 	if ( ! getDependants ) {
  3507 	if ( ! getDependants ) {
  5209 		getDependants = arrayOf;
  3508 		getDependants = arrayOf;
  5375 	callSelector.getDependants = getDependants;
  3674 	callSelector.getDependants = getDependants;
  5376 	callSelector.clear = clear;
  3675 	callSelector.clear = clear;
  5377 	clear();
  3676 	clear();
  5378 
  3677 
  5379 	return callSelector;
  3678 	return callSelector;
       
  3679 }
       
  3680 
       
  3681 // EXTERNAL MODULE: ./node_modules/equivalent-key-map/equivalent-key-map.js
       
  3682 var equivalent_key_map = __webpack_require__(2167);
       
  3683 var equivalent_key_map_default = /*#__PURE__*/__webpack_require__.n(equivalent_key_map);
       
  3684 ;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/queried-data/selectors.js
       
  3685 /**
       
  3686  * External dependencies
       
  3687  */
       
  3688 
       
  3689 
       
  3690 
       
  3691 /**
       
  3692  * Internal dependencies
       
  3693  */
       
  3694 
       
  3695 
       
  3696 /**
       
  3697  * Cache of state keys to EquivalentKeyMap where the inner map tracks queries
       
  3698  * to their resulting items set. WeakMap allows garbage collection on expired
       
  3699  * state references.
       
  3700  *
       
  3701  * @type {WeakMap<Object,EquivalentKeyMap>}
       
  3702  */
       
  3703 
       
  3704 const queriedItemsCacheByState = new WeakMap();
       
  3705 /**
       
  3706  * Returns items for a given query, or null if the items are not known.
       
  3707  *
       
  3708  * @param {Object}  state State object.
       
  3709  * @param {?Object} query Optional query.
       
  3710  *
       
  3711  * @return {?Array} Query items.
       
  3712  */
       
  3713 
       
  3714 function getQueriedItemsUncached(state, query) {
       
  3715   var _state$queries, _state$queries$contex;
       
  3716 
       
  3717   const {
       
  3718     stableKey,
       
  3719     page,
       
  3720     perPage,
       
  3721     include,
       
  3722     fields,
       
  3723     context
       
  3724   } = get_query_parts(query);
       
  3725   let itemIds;
       
  3726 
       
  3727   if ((_state$queries = state.queries) !== null && _state$queries !== void 0 && (_state$queries$contex = _state$queries[context]) !== null && _state$queries$contex !== void 0 && _state$queries$contex[stableKey]) {
       
  3728     itemIds = state.queries[context][stableKey];
       
  3729   }
       
  3730 
       
  3731   if (!itemIds) {
       
  3732     return null;
       
  3733   }
       
  3734 
       
  3735   const startOffset = perPage === -1 ? 0 : (page - 1) * perPage;
       
  3736   const endOffset = perPage === -1 ? itemIds.length : Math.min(startOffset + perPage, itemIds.length);
       
  3737   const items = [];
       
  3738 
       
  3739   for (let i = startOffset; i < endOffset; i++) {
       
  3740     var _state$items$context;
       
  3741 
       
  3742     const itemId = itemIds[i];
       
  3743 
       
  3744     if (Array.isArray(include) && !include.includes(itemId)) {
       
  3745       continue;
       
  3746     } // Having a target item ID doesn't guarantee that this object has been queried.
       
  3747 
       
  3748 
       
  3749     if (!((_state$items$context = state.items[context]) !== null && _state$items$context !== void 0 && _state$items$context.hasOwnProperty(itemId))) {
       
  3750       return null;
       
  3751     }
       
  3752 
       
  3753     const item = state.items[context][itemId];
       
  3754     let filteredItem;
       
  3755 
       
  3756     if (Array.isArray(fields)) {
       
  3757       filteredItem = {};
       
  3758 
       
  3759       for (let f = 0; f < fields.length; f++) {
       
  3760         const field = fields[f].split('.');
       
  3761         const value = (0,external_lodash_namespaceObject.get)(item, field);
       
  3762         (0,external_lodash_namespaceObject.set)(filteredItem, field, value);
       
  3763       }
       
  3764     } else {
       
  3765       var _state$itemIsComplete;
       
  3766 
       
  3767       // If expecting a complete item, validate that completeness, or
       
  3768       // otherwise abort.
       
  3769       if (!((_state$itemIsComplete = state.itemIsComplete[context]) !== null && _state$itemIsComplete !== void 0 && _state$itemIsComplete[itemId])) {
       
  3770         return null;
       
  3771       }
       
  3772 
       
  3773       filteredItem = item;
       
  3774     }
       
  3775 
       
  3776     items.push(filteredItem);
       
  3777   }
       
  3778 
       
  3779   return items;
       
  3780 }
       
  3781 /**
       
  3782  * Returns items for a given query, or null if the items are not known. Caches
       
  3783  * result both per state (by reference) and per query (by deep equality).
       
  3784  * The caching approach is intended to be durable to query objects which are
       
  3785  * deeply but not referentially equal, since otherwise:
       
  3786  *
       
  3787  * `getQueriedItems( state, {} ) !== getQueriedItems( state, {} )`
       
  3788  *
       
  3789  * @param {Object}  state State object.
       
  3790  * @param {?Object} query Optional query.
       
  3791  *
       
  3792  * @return {?Array} Query items.
       
  3793  */
       
  3794 
       
  3795 
       
  3796 const getQueriedItems = rememo(function (state) {
       
  3797   let query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
       
  3798   let queriedItemsCache = queriedItemsCacheByState.get(state);
       
  3799 
       
  3800   if (queriedItemsCache) {
       
  3801     const queriedItems = queriedItemsCache.get(query);
       
  3802 
       
  3803     if (queriedItems !== undefined) {
       
  3804       return queriedItems;
       
  3805     }
       
  3806   } else {
       
  3807     queriedItemsCache = new (equivalent_key_map_default())();
       
  3808     queriedItemsCacheByState.set(state, queriedItemsCache);
       
  3809   }
       
  3810 
       
  3811   const items = getQueriedItemsUncached(state, query);
       
  3812   queriedItemsCache.set(query, items);
       
  3813   return items;
  5380 });
  3814 });
  5381 
  3815 
  5382 
  3816 ;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/utils/is-raw-attribute.js
  5383 /***/ }),
  3817 /**
  5384 
  3818  * Checks whether the attribute is a "raw" attribute or not.
  5385 /***/ "rl8x":
  3819  *
  5386 /***/ (function(module, exports) {
  3820  * @param {Object} entity    Entity record.
  5387 
  3821  * @param {string} attribute Attribute name.
  5388 (function() { module.exports = window["wp"]["isShallowEqual"]; }());
  3822  *
  5389 
  3823  * @return {boolean} Is the attribute raw
  5390 /***/ }),
  3824  */
  5391 
  3825 function isRawAttribute(entity, attribute) {
  5392 /***/ "rmEH":
  3826   return (entity.rawAttributes || []).includes(attribute);
  5393 /***/ (function(module, exports) {
  3827 }
  5394 
  3828 
  5395 (function() { module.exports = window["wp"]["htmlEntities"]; }());
  3829 ;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/selectors.js
  5396 
  3830 /**
  5397 /***/ }),
  3831  * External dependencies
  5398 
  3832  */
  5399 /***/ "ywyh":
  3833 
  5400 /***/ (function(module, exports) {
  3834 
  5401 
  3835 /**
  5402 (function() { module.exports = window["wp"]["apiFetch"]; }());
  3836  * WordPress dependencies
  5403 
  3837  */
  5404 /***/ })
  3838 
  5405 
  3839 
  5406 /******/ });
  3840 
       
  3841 
       
  3842 /**
       
  3843  * Internal dependencies
       
  3844  */
       
  3845 
       
  3846 
       
  3847 
       
  3848 
       
  3849 
       
  3850 /**
       
  3851  * Shared reference to an empty object for cases where it is important to avoid
       
  3852  * returning a new object reference on every invocation, as in a connected or
       
  3853  * other pure component which performs `shouldComponentUpdate` check on props.
       
  3854  * This should be used as a last resort, since the normalized data should be
       
  3855  * maintained by the reducer result in state.
       
  3856  */
       
  3857 
       
  3858 const EMPTY_OBJECT = {};
       
  3859 /**
       
  3860  * Returns true if a request is in progress for embed preview data, or false
       
  3861  * otherwise.
       
  3862  *
       
  3863  * @param {Object} state Data state.
       
  3864  * @param {string} url   URL the preview would be for.
       
  3865  *
       
  3866  * @return {boolean} Whether a request is in progress for an embed preview.
       
  3867  */
       
  3868 
       
  3869 const isRequestingEmbedPreview = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, url) => {
       
  3870   return select(STORE_NAME).isResolving('getEmbedPreview', [url]);
       
  3871 });
       
  3872 /**
       
  3873  * Returns all available authors.
       
  3874  *
       
  3875  * @deprecated since 11.3. Callers should use `select( 'core' ).getUsers({ who: 'authors' })` instead.
       
  3876  *
       
  3877  * @param {Object}           state Data state.
       
  3878  * @param {Object|undefined} query Optional object of query parameters to
       
  3879  *                                 include with request.
       
  3880  * @return {Array} Authors list.
       
  3881  */
       
  3882 
       
  3883 function getAuthors(state, query) {
       
  3884   external_wp_deprecated_default()("select( 'core' ).getAuthors()", {
       
  3885     since: '5.9',
       
  3886     alternative: "select( 'core' ).getUsers({ who: 'authors' })"
       
  3887   });
       
  3888   const path = (0,external_wp_url_namespaceObject.addQueryArgs)('/wp/v2/users/?who=authors&per_page=100', query);
       
  3889   return getUserQueryResults(state, path);
       
  3890 }
       
  3891 /**
       
  3892  * Returns the current user.
       
  3893  *
       
  3894  * @param {Object} state Data state.
       
  3895  *
       
  3896  * @return {Object} Current user object.
       
  3897  */
       
  3898 
       
  3899 function getCurrentUser(state) {
       
  3900   return state.currentUser;
       
  3901 }
       
  3902 /**
       
  3903  * Returns all the users returned by a query ID.
       
  3904  *
       
  3905  * @param {Object} state   Data state.
       
  3906  * @param {string} queryID Query ID.
       
  3907  *
       
  3908  * @return {Array} Users list.
       
  3909  */
       
  3910 
       
  3911 const getUserQueryResults = rememo((state, queryID) => {
       
  3912   const queryResults = state.users.queries[queryID];
       
  3913   return (0,external_lodash_namespaceObject.map)(queryResults, id => state.users.byId[id]);
       
  3914 }, (state, queryID) => [state.users.queries[queryID], state.users.byId]);
       
  3915 /**
       
  3916  * Returns the loaded entities for the given kind.
       
  3917  *
       
  3918  * @deprecated since WordPress 6.0. Use getEntitiesConfig instead
       
  3919  * @param {Object} state Data state.
       
  3920  * @param {string} kind  Entity kind.
       
  3921  *
       
  3922  * @return {Array<Object>} Array of entities with config matching kind.
       
  3923  */
       
  3924 
       
  3925 function getEntitiesByKind(state, kind) {
       
  3926   external_wp_deprecated_default()("wp.data.select( 'core' ).getEntitiesByKind()", {
       
  3927     since: '6.0',
       
  3928     alternative: "wp.data.select( 'core' ).getEntitiesConfig()"
       
  3929   });
       
  3930   return getEntitiesConfig(state, kind);
       
  3931 }
       
  3932 /**
       
  3933  * Returns the loaded entities for the given kind.
       
  3934  *
       
  3935  * @param {Object} state Data state.
       
  3936  * @param {string} kind  Entity kind.
       
  3937  *
       
  3938  * @return {Array<Object>} Array of entities with config matching kind.
       
  3939  */
       
  3940 
       
  3941 function getEntitiesConfig(state, kind) {
       
  3942   return (0,external_lodash_namespaceObject.filter)(state.entities.config, {
       
  3943     kind
       
  3944   });
       
  3945 }
       
  3946 /**
       
  3947  * Returns the entity config given its kind and name.
       
  3948  *
       
  3949  * @deprecated since WordPress 6.0. Use getEntityConfig instead
       
  3950  * @param {Object} state Data state.
       
  3951  * @param {string} kind  Entity kind.
       
  3952  * @param {string} name  Entity name.
       
  3953  *
       
  3954  * @return {Object} Entity config
       
  3955  */
       
  3956 
       
  3957 function getEntity(state, kind, name) {
       
  3958   external_wp_deprecated_default()("wp.data.select( 'core' ).getEntity()", {
       
  3959     since: '6.0',
       
  3960     alternative: "wp.data.select( 'core' ).getEntityConfig()"
       
  3961   });
       
  3962   return getEntityConfig(state, kind, name);
       
  3963 }
       
  3964 /**
       
  3965  * Returns the entity config given its kind and name.
       
  3966  *
       
  3967  * @param {Object} state Data state.
       
  3968  * @param {string} kind  Entity kind.
       
  3969  * @param {string} name  Entity name.
       
  3970  *
       
  3971  * @return {Object} Entity config
       
  3972  */
       
  3973 
       
  3974 function getEntityConfig(state, kind, name) {
       
  3975   return (0,external_lodash_namespaceObject.find)(state.entities.config, {
       
  3976     kind,
       
  3977     name
       
  3978   });
       
  3979 }
       
  3980 /**
       
  3981  * Returns the Entity's record object by key. Returns `null` if the value is not
       
  3982  * yet received, undefined if the value entity is known to not exist, or the
       
  3983  * entity object if it exists and is received.
       
  3984  *
       
  3985  * @param {Object}  state State tree
       
  3986  * @param {string}  kind  Entity kind.
       
  3987  * @param {string}  name  Entity name.
       
  3988  * @param {number}  key   Record's key
       
  3989  * @param {?Object} query Optional query.
       
  3990  *
       
  3991  * @return {Object|undefined} Record.
       
  3992  */
       
  3993 
       
  3994 const getEntityRecord = rememo((state, kind, name, key, query) => {
       
  3995   var _query$context, _queriedState$items$c;
       
  3996 
       
  3997   const queriedState = (0,external_lodash_namespaceObject.get)(state.entities.records, [kind, name, 'queriedData']);
       
  3998 
       
  3999   if (!queriedState) {
       
  4000     return undefined;
       
  4001   }
       
  4002 
       
  4003   const context = (_query$context = query === null || query === void 0 ? void 0 : query.context) !== null && _query$context !== void 0 ? _query$context : 'default';
       
  4004 
       
  4005   if (query === undefined) {
       
  4006     var _queriedState$itemIsC;
       
  4007 
       
  4008     // If expecting a complete item, validate that completeness.
       
  4009     if (!((_queriedState$itemIsC = queriedState.itemIsComplete[context]) !== null && _queriedState$itemIsC !== void 0 && _queriedState$itemIsC[key])) {
       
  4010       return undefined;
       
  4011     }
       
  4012 
       
  4013     return queriedState.items[context][key];
       
  4014   }
       
  4015 
       
  4016   const item = (_queriedState$items$c = queriedState.items[context]) === null || _queriedState$items$c === void 0 ? void 0 : _queriedState$items$c[key];
       
  4017 
       
  4018   if (item && query._fields) {
       
  4019     var _getNormalizedCommaSe;
       
  4020 
       
  4021     const filteredItem = {};
       
  4022     const fields = (_getNormalizedCommaSe = get_normalized_comma_separable(query._fields)) !== null && _getNormalizedCommaSe !== void 0 ? _getNormalizedCommaSe : [];
       
  4023 
       
  4024     for (let f = 0; f < fields.length; f++) {
       
  4025       const field = fields[f].split('.');
       
  4026       const value = (0,external_lodash_namespaceObject.get)(item, field);
       
  4027       (0,external_lodash_namespaceObject.set)(filteredItem, field, value);
       
  4028     }
       
  4029 
       
  4030     return filteredItem;
       
  4031   }
       
  4032 
       
  4033   return item;
       
  4034 }, (state, kind, name, recordId, query) => {
       
  4035   var _query$context2;
       
  4036 
       
  4037   const context = (_query$context2 = query === null || query === void 0 ? void 0 : query.context) !== null && _query$context2 !== void 0 ? _query$context2 : 'default';
       
  4038   return [(0,external_lodash_namespaceObject.get)(state.entities.records, [kind, name, 'queriedData', 'items', context, recordId]), (0,external_lodash_namespaceObject.get)(state.entities.records, [kind, name, 'queriedData', 'itemIsComplete', context, recordId])];
       
  4039 });
       
  4040 /**
       
  4041  * Returns the Entity's record object by key. Doesn't trigger a resolver nor requests the entity records from the API if the entity record isn't available in the local state.
       
  4042  *
       
  4043  * @param {Object} state State tree
       
  4044  * @param {string} kind  Entity kind.
       
  4045  * @param {string} name  Entity name.
       
  4046  * @param {number} key   Record's key
       
  4047  *
       
  4048  * @return {Object|null} Record.
       
  4049  */
       
  4050 
       
  4051 function __experimentalGetEntityRecordNoResolver(state, kind, name, key) {
       
  4052   return getEntityRecord(state, kind, name, key);
       
  4053 }
       
  4054 /**
       
  4055  * Returns the entity's record object by key,
       
  4056  * with its attributes mapped to their raw values.
       
  4057  *
       
  4058  * @param {Object} state State tree.
       
  4059  * @param {string} kind  Entity kind.
       
  4060  * @param {string} name  Entity name.
       
  4061  * @param {number} key   Record's key.
       
  4062  *
       
  4063  * @return {Object?} Object with the entity's raw attributes.
       
  4064  */
       
  4065 
       
  4066 const getRawEntityRecord = rememo((state, kind, name, key) => {
       
  4067   const record = getEntityRecord(state, kind, name, key);
       
  4068   return record && Object.keys(record).reduce((accumulator, _key) => {
       
  4069     if (isRawAttribute(getEntityConfig(state, kind, name), _key)) {
       
  4070       // Because edits are the "raw" attribute values,
       
  4071       // we return those from record selectors to make rendering,
       
  4072       // comparisons, and joins with edits easier.
       
  4073       accumulator[_key] = (0,external_lodash_namespaceObject.get)(record[_key], 'raw', record[_key]);
       
  4074     } else {
       
  4075       accumulator[_key] = record[_key];
       
  4076     }
       
  4077 
       
  4078     return accumulator;
       
  4079   }, {});
       
  4080 }, (state, kind, name, recordId, query) => {
       
  4081   var _query$context3;
       
  4082 
       
  4083   const context = (_query$context3 = query === null || query === void 0 ? void 0 : query.context) !== null && _query$context3 !== void 0 ? _query$context3 : 'default';
       
  4084   return [state.entities.config, (0,external_lodash_namespaceObject.get)(state.entities.records, [kind, name, 'queriedData', 'items', context, recordId]), (0,external_lodash_namespaceObject.get)(state.entities.records, [kind, name, 'queriedData', 'itemIsComplete', context, recordId])];
       
  4085 });
       
  4086 /**
       
  4087  * Returns true if records have been received for the given set of parameters,
       
  4088  * or false otherwise.
       
  4089  *
       
  4090  * @param {Object}  state State tree
       
  4091  * @param {string}  kind  Entity kind.
       
  4092  * @param {string}  name  Entity name.
       
  4093  * @param {?Object} query Optional terms query.
       
  4094  *
       
  4095  * @return {boolean} Whether entity records have been received.
       
  4096  */
       
  4097 
       
  4098 function hasEntityRecords(state, kind, name, query) {
       
  4099   return Array.isArray(getEntityRecords(state, kind, name, query));
       
  4100 }
       
  4101 /**
       
  4102  * Returns the Entity's records.
       
  4103  *
       
  4104  * @param {Object}  state State tree
       
  4105  * @param {string}  kind  Entity kind.
       
  4106  * @param {string}  name  Entity name.
       
  4107  * @param {?Object} query Optional terms query.
       
  4108  *
       
  4109  * @return {?Array} Records.
       
  4110  */
       
  4111 
       
  4112 function getEntityRecords(state, kind, name, query) {
       
  4113   // Queried data state is prepopulated for all known entities. If this is not
       
  4114   // assigned for the given parameters, then it is known to not exist.
       
  4115   const queriedState = (0,external_lodash_namespaceObject.get)(state.entities.records, [kind, name, 'queriedData']);
       
  4116 
       
  4117   if (!queriedState) {
       
  4118     return null;
       
  4119   }
       
  4120 
       
  4121   return getQueriedItems(queriedState, query);
       
  4122 }
       
  4123 /**
       
  4124  * Returns the  list of dirty entity records.
       
  4125  *
       
  4126  * @param {Object} state State tree.
       
  4127  *
       
  4128  * @return {[{ title: string, key: string, name: string, kind: string }]} The list of updated records
       
  4129  */
       
  4130 
       
  4131 const __experimentalGetDirtyEntityRecords = rememo(state => {
       
  4132   const {
       
  4133     entities: {
       
  4134       records
       
  4135     }
       
  4136   } = state;
       
  4137   const dirtyRecords = [];
       
  4138   Object.keys(records).forEach(kind => {
       
  4139     Object.keys(records[kind]).forEach(name => {
       
  4140       const primaryKeys = Object.keys(records[kind][name].edits).filter(primaryKey => // The entity record must exist (not be deleted),
       
  4141       // and it must have edits.
       
  4142       getEntityRecord(state, kind, name, primaryKey) && hasEditsForEntityRecord(state, kind, name, primaryKey));
       
  4143 
       
  4144       if (primaryKeys.length) {
       
  4145         const entityConfig = getEntityConfig(state, kind, name);
       
  4146         primaryKeys.forEach(primaryKey => {
       
  4147           var _entityConfig$getTitl;
       
  4148 
       
  4149           const entityRecord = getEditedEntityRecord(state, kind, name, primaryKey);
       
  4150           dirtyRecords.push({
       
  4151             // We avoid using primaryKey because it's transformed into a string
       
  4152             // when it's used as an object key.
       
  4153             key: entityRecord[entityConfig.key || DEFAULT_ENTITY_KEY],
       
  4154             title: (entityConfig === null || entityConfig === void 0 ? void 0 : (_entityConfig$getTitl = entityConfig.getTitle) === null || _entityConfig$getTitl === void 0 ? void 0 : _entityConfig$getTitl.call(entityConfig, entityRecord)) || '',
       
  4155             name,
       
  4156             kind
       
  4157           });
       
  4158         });
       
  4159       }
       
  4160     });
       
  4161   });
       
  4162   return dirtyRecords;
       
  4163 }, state => [state.entities.records]);
       
  4164 /**
       
  4165  * Returns the list of entities currently being saved.
       
  4166  *
       
  4167  * @param {Object} state State tree.
       
  4168  *
       
  4169  * @return {[{ title: string, key: string, name: string, kind: string }]} The list of records being saved.
       
  4170  */
       
  4171 
       
  4172 const __experimentalGetEntitiesBeingSaved = rememo(state => {
       
  4173   const {
       
  4174     entities: {
       
  4175       records
       
  4176     }
       
  4177   } = state;
       
  4178   const recordsBeingSaved = [];
       
  4179   Object.keys(records).forEach(kind => {
       
  4180     Object.keys(records[kind]).forEach(name => {
       
  4181       const primaryKeys = Object.keys(records[kind][name].saving).filter(primaryKey => isSavingEntityRecord(state, kind, name, primaryKey));
       
  4182 
       
  4183       if (primaryKeys.length) {
       
  4184         const entityConfig = getEntityConfig(state, kind, name);
       
  4185         primaryKeys.forEach(primaryKey => {
       
  4186           var _entityConfig$getTitl2;
       
  4187 
       
  4188           const entityRecord = getEditedEntityRecord(state, kind, name, primaryKey);
       
  4189           recordsBeingSaved.push({
       
  4190             // We avoid using primaryKey because it's transformed into a string
       
  4191             // when it's used as an object key.
       
  4192             key: entityRecord[entityConfig.key || DEFAULT_ENTITY_KEY],
       
  4193             title: (entityConfig === null || entityConfig === void 0 ? void 0 : (_entityConfig$getTitl2 = entityConfig.getTitle) === null || _entityConfig$getTitl2 === void 0 ? void 0 : _entityConfig$getTitl2.call(entityConfig, entityRecord)) || '',
       
  4194             name,
       
  4195             kind
       
  4196           });
       
  4197         });
       
  4198       }
       
  4199     });
       
  4200   });
       
  4201   return recordsBeingSaved;
       
  4202 }, state => [state.entities.records]);
       
  4203 /**
       
  4204  * Returns the specified entity record's edits.
       
  4205  *
       
  4206  * @param {Object} state    State tree.
       
  4207  * @param {string} kind     Entity kind.
       
  4208  * @param {string} name     Entity name.
       
  4209  * @param {number} recordId Record ID.
       
  4210  *
       
  4211  * @return {Object?} The entity record's edits.
       
  4212  */
       
  4213 
       
  4214 function getEntityRecordEdits(state, kind, name, recordId) {
       
  4215   return (0,external_lodash_namespaceObject.get)(state.entities.records, [kind, name, 'edits', recordId]);
       
  4216 }
       
  4217 /**
       
  4218  * Returns the specified entity record's non transient edits.
       
  4219  *
       
  4220  * Transient edits don't create an undo level, and
       
  4221  * are not considered for change detection.
       
  4222  * They are defined in the entity's config.
       
  4223  *
       
  4224  * @param {Object} state    State tree.
       
  4225  * @param {string} kind     Entity kind.
       
  4226  * @param {string} name     Entity name.
       
  4227  * @param {number} recordId Record ID.
       
  4228  *
       
  4229  * @return {Object?} The entity record's non transient edits.
       
  4230  */
       
  4231 
       
  4232 const getEntityRecordNonTransientEdits = rememo((state, kind, name, recordId) => {
       
  4233   const {
       
  4234     transientEdits
       
  4235   } = getEntityConfig(state, kind, name) || {};
       
  4236   const edits = getEntityRecordEdits(state, kind, name, recordId) || {};
       
  4237 
       
  4238   if (!transientEdits) {
       
  4239     return edits;
       
  4240   }
       
  4241 
       
  4242   return Object.keys(edits).reduce((acc, key) => {
       
  4243     if (!transientEdits[key]) {
       
  4244       acc[key] = edits[key];
       
  4245     }
       
  4246 
       
  4247     return acc;
       
  4248   }, {});
       
  4249 }, (state, kind, name, recordId) => [state.entities.config, (0,external_lodash_namespaceObject.get)(state.entities.records, [kind, name, 'edits', recordId])]);
       
  4250 /**
       
  4251  * Returns true if the specified entity record has edits,
       
  4252  * and false otherwise.
       
  4253  *
       
  4254  * @param {Object}        state    State tree.
       
  4255  * @param {string}        kind     Entity kind.
       
  4256  * @param {string}        name     Entity name.
       
  4257  * @param {number|string} recordId Record ID.
       
  4258  *
       
  4259  * @return {boolean} Whether the entity record has edits or not.
       
  4260  */
       
  4261 
       
  4262 function hasEditsForEntityRecord(state, kind, name, recordId) {
       
  4263   return isSavingEntityRecord(state, kind, name, recordId) || Object.keys(getEntityRecordNonTransientEdits(state, kind, name, recordId)).length > 0;
       
  4264 }
       
  4265 /**
       
  4266  * Returns the specified entity record, merged with its edits.
       
  4267  *
       
  4268  * @param {Object}        state    State tree.
       
  4269  * @param {string}        kind     Entity kind.
       
  4270  * @param {string}        name     Entity name.
       
  4271  * @param {number|string} recordId Record ID.
       
  4272  *
       
  4273  * @return {Object?} The entity record, merged with its edits.
       
  4274  */
       
  4275 
       
  4276 const getEditedEntityRecord = rememo((state, kind, name, recordId) => ({ ...getRawEntityRecord(state, kind, name, recordId),
       
  4277   ...getEntityRecordEdits(state, kind, name, recordId)
       
  4278 }), (state, kind, name, recordId, query) => {
       
  4279   var _query$context4;
       
  4280 
       
  4281   const context = (_query$context4 = query === null || query === void 0 ? void 0 : query.context) !== null && _query$context4 !== void 0 ? _query$context4 : 'default';
       
  4282   return [state.entities.config, (0,external_lodash_namespaceObject.get)(state.entities.records, [kind, name, 'queriedData', 'items', context, recordId]), (0,external_lodash_namespaceObject.get)(state.entities.records, [kind, name, 'queriedData', 'itemIsComplete', context, recordId]), (0,external_lodash_namespaceObject.get)(state.entities.records, [kind, name, 'edits', recordId])];
       
  4283 });
       
  4284 /**
       
  4285  * Returns true if the specified entity record is autosaving, and false otherwise.
       
  4286  *
       
  4287  * @param {Object} state    State tree.
       
  4288  * @param {string} kind     Entity kind.
       
  4289  * @param {string} name     Entity name.
       
  4290  * @param {number} recordId Record ID.
       
  4291  *
       
  4292  * @return {boolean} Whether the entity record is autosaving or not.
       
  4293  */
       
  4294 
       
  4295 function isAutosavingEntityRecord(state, kind, name, recordId) {
       
  4296   const {
       
  4297     pending,
       
  4298     isAutosave
       
  4299   } = (0,external_lodash_namespaceObject.get)(state.entities.records, [kind, name, 'saving', recordId], {});
       
  4300   return Boolean(pending && isAutosave);
       
  4301 }
       
  4302 /**
       
  4303  * Returns true if the specified entity record is saving, and false otherwise.
       
  4304  *
       
  4305  * @param {Object}        state    State tree.
       
  4306  * @param {string}        kind     Entity kind.
       
  4307  * @param {string}        name     Entity name.
       
  4308  * @param {number|string} recordId Record ID.
       
  4309  *
       
  4310  * @return {boolean} Whether the entity record is saving or not.
       
  4311  */
       
  4312 
       
  4313 function isSavingEntityRecord(state, kind, name, recordId) {
       
  4314   return (0,external_lodash_namespaceObject.get)(state.entities.records, [kind, name, 'saving', recordId, 'pending'], false);
       
  4315 }
       
  4316 /**
       
  4317  * Returns true if the specified entity record is deleting, and false otherwise.
       
  4318  *
       
  4319  * @param {Object} state    State tree.
       
  4320  * @param {string} kind     Entity kind.
       
  4321  * @param {string} name     Entity name.
       
  4322  * @param {number} recordId Record ID.
       
  4323  *
       
  4324  * @return {boolean} Whether the entity record is deleting or not.
       
  4325  */
       
  4326 
       
  4327 function isDeletingEntityRecord(state, kind, name, recordId) {
       
  4328   return (0,external_lodash_namespaceObject.get)(state.entities.records, [kind, name, 'deleting', recordId, 'pending'], false);
       
  4329 }
       
  4330 /**
       
  4331  * Returns the specified entity record's last save error.
       
  4332  *
       
  4333  * @param {Object} state    State tree.
       
  4334  * @param {string} kind     Entity kind.
       
  4335  * @param {string} name     Entity name.
       
  4336  * @param {number} recordId Record ID.
       
  4337  *
       
  4338  * @return {Object?} The entity record's save error.
       
  4339  */
       
  4340 
       
  4341 function getLastEntitySaveError(state, kind, name, recordId) {
       
  4342   return (0,external_lodash_namespaceObject.get)(state.entities.records, [kind, name, 'saving', recordId, 'error']);
       
  4343 }
       
  4344 /**
       
  4345  * Returns the specified entity record's last delete error.
       
  4346  *
       
  4347  * @param {Object} state    State tree.
       
  4348  * @param {string} kind     Entity kind.
       
  4349  * @param {string} name     Entity name.
       
  4350  * @param {number} recordId Record ID.
       
  4351  *
       
  4352  * @return {Object?} The entity record's save error.
       
  4353  */
       
  4354 
       
  4355 function getLastEntityDeleteError(state, kind, name, recordId) {
       
  4356   return (0,external_lodash_namespaceObject.get)(state.entities.records, [kind, name, 'deleting', recordId, 'error']);
       
  4357 }
       
  4358 /**
       
  4359  * Returns the current undo offset for the
       
  4360  * entity records edits history. The offset
       
  4361  * represents how many items from the end
       
  4362  * of the history stack we are at. 0 is the
       
  4363  * last edit, -1 is the second last, and so on.
       
  4364  *
       
  4365  * @param {Object} state State tree.
       
  4366  *
       
  4367  * @return {number} The current undo offset.
       
  4368  */
       
  4369 
       
  4370 function getCurrentUndoOffset(state) {
       
  4371   return state.undo.offset;
       
  4372 }
       
  4373 /**
       
  4374  * Returns the previous edit from the current undo offset
       
  4375  * for the entity records edits history, if any.
       
  4376  *
       
  4377  * @param {Object} state State tree.
       
  4378  *
       
  4379  * @return {Object?} The edit.
       
  4380  */
       
  4381 
       
  4382 
       
  4383 function getUndoEdit(state) {
       
  4384   return state.undo[state.undo.length - 2 + getCurrentUndoOffset(state)];
       
  4385 }
       
  4386 /**
       
  4387  * Returns the next edit from the current undo offset
       
  4388  * for the entity records edits history, if any.
       
  4389  *
       
  4390  * @param {Object} state State tree.
       
  4391  *
       
  4392  * @return {Object?} The edit.
       
  4393  */
       
  4394 
       
  4395 function getRedoEdit(state) {
       
  4396   return state.undo[state.undo.length + getCurrentUndoOffset(state)];
       
  4397 }
       
  4398 /**
       
  4399  * Returns true if there is a previous edit from the current undo offset
       
  4400  * for the entity records edits history, and false otherwise.
       
  4401  *
       
  4402  * @param {Object} state State tree.
       
  4403  *
       
  4404  * @return {boolean} Whether there is a previous edit or not.
       
  4405  */
       
  4406 
       
  4407 function hasUndo(state) {
       
  4408   return Boolean(getUndoEdit(state));
       
  4409 }
       
  4410 /**
       
  4411  * Returns true if there is a next edit from the current undo offset
       
  4412  * for the entity records edits history, and false otherwise.
       
  4413  *
       
  4414  * @param {Object} state State tree.
       
  4415  *
       
  4416  * @return {boolean} Whether there is a next edit or not.
       
  4417  */
       
  4418 
       
  4419 function hasRedo(state) {
       
  4420   return Boolean(getRedoEdit(state));
       
  4421 }
       
  4422 /**
       
  4423  * Return the current theme.
       
  4424  *
       
  4425  * @param {Object} state Data state.
       
  4426  *
       
  4427  * @return {Object} The current theme.
       
  4428  */
       
  4429 
       
  4430 function getCurrentTheme(state) {
       
  4431   return getEntityRecord(state, 'root', 'theme', state.currentTheme);
       
  4432 }
       
  4433 /**
       
  4434  * Return the ID of the current global styles object.
       
  4435  *
       
  4436  * @param {Object} state Data state.
       
  4437  *
       
  4438  * @return {string} The current global styles ID.
       
  4439  */
       
  4440 
       
  4441 function __experimentalGetCurrentGlobalStylesId(state) {
       
  4442   return state.currentGlobalStylesId;
       
  4443 }
       
  4444 /**
       
  4445  * Return theme supports data in the index.
       
  4446  *
       
  4447  * @param {Object} state Data state.
       
  4448  *
       
  4449  * @return {*} Index data.
       
  4450  */
       
  4451 
       
  4452 function getThemeSupports(state) {
       
  4453   var _getCurrentTheme$them, _getCurrentTheme;
       
  4454 
       
  4455   return (_getCurrentTheme$them = (_getCurrentTheme = getCurrentTheme(state)) === null || _getCurrentTheme === void 0 ? void 0 : _getCurrentTheme.theme_supports) !== null && _getCurrentTheme$them !== void 0 ? _getCurrentTheme$them : EMPTY_OBJECT;
       
  4456 }
       
  4457 /**
       
  4458  * Returns the embed preview for the given URL.
       
  4459  *
       
  4460  * @param {Object} state Data state.
       
  4461  * @param {string} url   Embedded URL.
       
  4462  *
       
  4463  * @return {*} Undefined if the preview has not been fetched, otherwise, the preview fetched from the embed preview API.
       
  4464  */
       
  4465 
       
  4466 function getEmbedPreview(state, url) {
       
  4467   return state.embedPreviews[url];
       
  4468 }
       
  4469 /**
       
  4470  * Determines if the returned preview is an oEmbed link fallback.
       
  4471  *
       
  4472  * WordPress can be configured to return a simple link to a URL if it is not embeddable.
       
  4473  * We need to be able to determine if a URL is embeddable or not, based on what we
       
  4474  * get back from the oEmbed preview API.
       
  4475  *
       
  4476  * @param {Object} state Data state.
       
  4477  * @param {string} url   Embedded URL.
       
  4478  *
       
  4479  * @return {boolean} Is the preview for the URL an oEmbed link fallback.
       
  4480  */
       
  4481 
       
  4482 function isPreviewEmbedFallback(state, url) {
       
  4483   const preview = state.embedPreviews[url];
       
  4484   const oEmbedLinkCheck = '<a href="' + url + '">' + url + '</a>';
       
  4485 
       
  4486   if (!preview) {
       
  4487     return false;
       
  4488   }
       
  4489 
       
  4490   return preview.html === oEmbedLinkCheck;
       
  4491 }
       
  4492 /**
       
  4493  * Returns whether the current user can perform the given action on the given
       
  4494  * REST resource.
       
  4495  *
       
  4496  * Calling this may trigger an OPTIONS request to the REST API via the
       
  4497  * `canUser()` resolver.
       
  4498  *
       
  4499  * https://developer.wordpress.org/rest-api/reference/
       
  4500  *
       
  4501  * @param {Object}  state    Data state.
       
  4502  * @param {string}  action   Action to check. One of: 'create', 'read', 'update', 'delete'.
       
  4503  * @param {string}  resource REST resource to check, e.g. 'media' or 'posts'.
       
  4504  * @param {string=} id       Optional ID of the rest resource to check.
       
  4505  *
       
  4506  * @return {boolean|undefined} Whether or not the user can perform the action,
       
  4507  *                             or `undefined` if the OPTIONS request is still being made.
       
  4508  */
       
  4509 
       
  4510 function canUser(state, action, resource, id) {
       
  4511   const key = (0,external_lodash_namespaceObject.compact)([action, resource, id]).join('/');
       
  4512   return (0,external_lodash_namespaceObject.get)(state, ['userPermissions', key]);
       
  4513 }
       
  4514 /**
       
  4515  * Returns whether the current user can edit the given entity.
       
  4516  *
       
  4517  * Calling this may trigger an OPTIONS request to the REST API via the
       
  4518  * `canUser()` resolver.
       
  4519  *
       
  4520  * https://developer.wordpress.org/rest-api/reference/
       
  4521  *
       
  4522  * @param {Object} state    Data state.
       
  4523  * @param {string} kind     Entity kind.
       
  4524  * @param {string} name     Entity name.
       
  4525  * @param {string} recordId Record's id.
       
  4526  * @return {boolean|undefined} Whether or not the user can edit,
       
  4527  * or `undefined` if the OPTIONS request is still being made.
       
  4528  */
       
  4529 
       
  4530 function canUserEditEntityRecord(state, kind, name, recordId) {
       
  4531   const entityConfig = getEntityConfig(state, kind, name);
       
  4532 
       
  4533   if (!entityConfig) {
       
  4534     return false;
       
  4535   }
       
  4536 
       
  4537   const resource = entityConfig.__unstable_rest_base;
       
  4538   return canUser(state, 'update', resource, recordId);
       
  4539 }
       
  4540 /**
       
  4541  * Returns the latest autosaves for the post.
       
  4542  *
       
  4543  * May return multiple autosaves since the backend stores one autosave per
       
  4544  * author for each post.
       
  4545  *
       
  4546  * @param {Object} state    State tree.
       
  4547  * @param {string} postType The type of the parent post.
       
  4548  * @param {number} postId   The id of the parent post.
       
  4549  *
       
  4550  * @return {?Array} An array of autosaves for the post, or undefined if there is none.
       
  4551  */
       
  4552 
       
  4553 function getAutosaves(state, postType, postId) {
       
  4554   return state.autosaves[postId];
       
  4555 }
       
  4556 /**
       
  4557  * Returns the autosave for the post and author.
       
  4558  *
       
  4559  * @param {Object} state    State tree.
       
  4560  * @param {string} postType The type of the parent post.
       
  4561  * @param {number} postId   The id of the parent post.
       
  4562  * @param {number} authorId The id of the author.
       
  4563  *
       
  4564  * @return {?Object} The autosave for the post and author.
       
  4565  */
       
  4566 
       
  4567 function getAutosave(state, postType, postId, authorId) {
       
  4568   if (authorId === undefined) {
       
  4569     return;
       
  4570   }
       
  4571 
       
  4572   const autosaves = state.autosaves[postId];
       
  4573   return (0,external_lodash_namespaceObject.find)(autosaves, {
       
  4574     author: authorId
       
  4575   });
       
  4576 }
       
  4577 /**
       
  4578  * Returns true if the REST request for autosaves has completed.
       
  4579  *
       
  4580  * @param {Object} state    State tree.
       
  4581  * @param {string} postType The type of the parent post.
       
  4582  * @param {number} postId   The id of the parent post.
       
  4583  *
       
  4584  * @return {boolean} True if the REST request was completed. False otherwise.
       
  4585  */
       
  4586 
       
  4587 const hasFetchedAutosaves = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, postType, postId) => {
       
  4588   return select(STORE_NAME).hasFinishedResolution('getAutosaves', [postType, postId]);
       
  4589 });
       
  4590 /**
       
  4591  * Returns a new reference when edited values have changed. This is useful in
       
  4592  * inferring where an edit has been made between states by comparison of the
       
  4593  * return values using strict equality.
       
  4594  *
       
  4595  * @example
       
  4596  *
       
  4597  * ```
       
  4598  * const hasEditOccurred = (
       
  4599  *    getReferenceByDistinctEdits( beforeState ) !==
       
  4600  *    getReferenceByDistinctEdits( afterState )
       
  4601  * );
       
  4602  * ```
       
  4603  *
       
  4604  * @param {Object} state Editor state.
       
  4605  *
       
  4606  * @return {*} A value whose reference will change only when an edit occurs.
       
  4607  */
       
  4608 
       
  4609 const getReferenceByDistinctEdits = rememo(() => [], state => [state.undo.length, state.undo.offset, state.undo.flattenedUndo]);
       
  4610 /**
       
  4611  * Retrieve the frontend template used for a given link.
       
  4612  *
       
  4613  * @param {Object} state Editor state.
       
  4614  * @param {string} link  Link.
       
  4615  *
       
  4616  * @return {Object?} The template record.
       
  4617  */
       
  4618 
       
  4619 function __experimentalGetTemplateForLink(state, link) {
       
  4620   const records = getEntityRecords(state, 'postType', 'wp_template', {
       
  4621     'find-template': link
       
  4622   });
       
  4623   const template = records !== null && records !== void 0 && records.length ? records[0] : null;
       
  4624 
       
  4625   if (template) {
       
  4626     return getEditedEntityRecord(state, 'postType', 'wp_template', template.id);
       
  4627   }
       
  4628 
       
  4629   return template;
       
  4630 }
       
  4631 /**
       
  4632  * Retrieve the current theme's base global styles
       
  4633  *
       
  4634  * @param {Object} state Editor state.
       
  4635  *
       
  4636  * @return {Object|null} The Global Styles object.
       
  4637  */
       
  4638 
       
  4639 function __experimentalGetCurrentThemeBaseGlobalStyles(state) {
       
  4640   const currentTheme = getCurrentTheme(state);
       
  4641 
       
  4642   if (!currentTheme) {
       
  4643     return null;
       
  4644   }
       
  4645 
       
  4646   return state.themeBaseGlobalStyles[currentTheme.stylesheet];
       
  4647 }
       
  4648 /**
       
  4649  * Return the ID of the current global styles object.
       
  4650  *
       
  4651  * @param {Object} state Data state.
       
  4652  *
       
  4653  * @return {string|null} The current global styles ID.
       
  4654  */
       
  4655 
       
  4656 function __experimentalGetCurrentThemeGlobalStylesVariations(state) {
       
  4657   const currentTheme = getCurrentTheme(state);
       
  4658 
       
  4659   if (!currentTheme) {
       
  4660     return null;
       
  4661   }
       
  4662 
       
  4663   return state.themeGlobalStyleVariations[currentTheme.stylesheet];
       
  4664 }
       
  4665 /**
       
  4666  * Retrieve the list of registered block patterns.
       
  4667  *
       
  4668  * @param {Object} state Data state.
       
  4669  *
       
  4670  * @return {Array} Block pattern list.
       
  4671  */
       
  4672 
       
  4673 function getBlockPatterns(state) {
       
  4674   return state.blockPatterns;
       
  4675 }
       
  4676 /**
       
  4677  * Retrieve the list of registered block pattern categories.
       
  4678  *
       
  4679  * @param {Object} state Data state.
       
  4680  *
       
  4681  * @return {Array} Block pattern category list.
       
  4682  */
       
  4683 
       
  4684 function getBlockPatternCategories(state) {
       
  4685   return state.blockPatternCategories;
       
  4686 }
       
  4687 
       
  4688 ;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/utils/forward-resolver.js
       
  4689 /**
       
  4690  * Higher-order function which forward the resolution to another resolver with the same arguments.
       
  4691  *
       
  4692  * @param {string} resolverName forwarded resolver.
       
  4693  *
       
  4694  * @return {Function} Enhanced resolver.
       
  4695  */
       
  4696 const forwardResolver = resolverName => function () {
       
  4697   for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
       
  4698     args[_key] = arguments[_key];
       
  4699   }
       
  4700 
       
  4701   return async _ref => {
       
  4702     let {
       
  4703       resolveSelect
       
  4704     } = _ref;
       
  4705     await resolveSelect[resolverName](...args);
       
  4706   };
       
  4707 };
       
  4708 
       
  4709 /* harmony default export */ var forward_resolver = (forwardResolver);
       
  4710 
       
  4711 ;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/resolvers.js
       
  4712 /**
       
  4713  * External dependencies
       
  4714  */
       
  4715 
       
  4716 /**
       
  4717  * WordPress dependencies
       
  4718  */
       
  4719 
       
  4720 
       
  4721 
       
  4722 /**
       
  4723  * Internal dependencies
       
  4724  */
       
  4725 
       
  4726 
       
  4727 
       
  4728 
       
  4729 /**
       
  4730  * Requests authors from the REST API.
       
  4731  *
       
  4732  * @param {Object|undefined} query Optional object of query parameters to
       
  4733  *                                 include with request.
       
  4734  */
       
  4735 
       
  4736 const resolvers_getAuthors = query => async _ref => {
       
  4737   let {
       
  4738     dispatch
       
  4739   } = _ref;
       
  4740   const path = (0,external_wp_url_namespaceObject.addQueryArgs)('/wp/v2/users/?who=authors&per_page=100', query);
       
  4741   const users = await external_wp_apiFetch_default()({
       
  4742     path
       
  4743   });
       
  4744   dispatch.receiveUserQuery(path, users);
       
  4745 };
       
  4746 /**
       
  4747  * Requests the current user from the REST API.
       
  4748  */
       
  4749 
       
  4750 const resolvers_getCurrentUser = () => async _ref2 => {
       
  4751   let {
       
  4752     dispatch
       
  4753   } = _ref2;
       
  4754   const currentUser = await external_wp_apiFetch_default()({
       
  4755     path: '/wp/v2/users/me'
       
  4756   });
       
  4757   dispatch.receiveCurrentUser(currentUser);
       
  4758 };
       
  4759 /**
       
  4760  * Requests an entity's record from the REST API.
       
  4761  *
       
  4762  * @param {string}           kind  Entity kind.
       
  4763  * @param {string}           name  Entity name.
       
  4764  * @param {number|string}    key   Record's key
       
  4765  * @param {Object|undefined} query Optional object of query parameters to
       
  4766  *                                 include with request.
       
  4767  */
       
  4768 
       
  4769 const resolvers_getEntityRecord = function (kind, name) {
       
  4770   let key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
       
  4771   let query = arguments.length > 3 ? arguments[3] : undefined;
       
  4772   return async _ref3 => {
       
  4773     let {
       
  4774       select,
       
  4775       dispatch
       
  4776     } = _ref3;
       
  4777     const configs = await dispatch(getOrLoadEntitiesConfig(kind));
       
  4778     const entityConfig = (0,external_lodash_namespaceObject.find)(configs, {
       
  4779       kind,
       
  4780       name
       
  4781     });
       
  4782 
       
  4783     if (!entityConfig || entityConfig !== null && entityConfig !== void 0 && entityConfig.__experimentalNoFetch) {
       
  4784       return;
       
  4785     }
       
  4786 
       
  4787     const lock = await dispatch.__unstableAcquireStoreLock(STORE_NAME, ['entities', 'records', kind, name, key], {
       
  4788       exclusive: false
       
  4789     });
       
  4790 
       
  4791     try {
       
  4792       if (query !== undefined && query._fields) {
       
  4793         // If requesting specific fields, items and query association to said
       
  4794         // records are stored by ID reference. Thus, fields must always include
       
  4795         // the ID.
       
  4796         query = { ...query,
       
  4797           _fields: (0,external_lodash_namespaceObject.uniq)([...(get_normalized_comma_separable(query._fields) || []), entityConfig.key || DEFAULT_ENTITY_KEY]).join()
       
  4798         };
       
  4799       } // Disable reason: While true that an early return could leave `path`
       
  4800       // unused, it's important that path is derived using the query prior to
       
  4801       // additional query modifications in the condition below, since those
       
  4802       // modifications are relevant to how the data is tracked in state, and not
       
  4803       // for how the request is made to the REST API.
       
  4804       // eslint-disable-next-line @wordpress/no-unused-vars-before-return
       
  4805 
       
  4806 
       
  4807       const path = (0,external_wp_url_namespaceObject.addQueryArgs)(entityConfig.baseURL + (key ? '/' + key : ''), { ...entityConfig.baseURLParams,
       
  4808         ...query
       
  4809       });
       
  4810 
       
  4811       if (query !== undefined) {
       
  4812         query = { ...query,
       
  4813           include: [key]
       
  4814         }; // The resolution cache won't consider query as reusable based on the
       
  4815         // fields, so it's tested here, prior to initiating the REST request,
       
  4816         // and without causing `getEntityRecords` resolution to occur.
       
  4817 
       
  4818         const hasRecords = select.hasEntityRecords(kind, name, query);
       
  4819 
       
  4820         if (hasRecords) {
       
  4821           return;
       
  4822         }
       
  4823       }
       
  4824 
       
  4825       const record = await external_wp_apiFetch_default()({
       
  4826         path
       
  4827       });
       
  4828       dispatch.receiveEntityRecords(kind, name, record, query);
       
  4829     } finally {
       
  4830       dispatch.__unstableReleaseStoreLock(lock);
       
  4831     }
       
  4832   };
       
  4833 };
       
  4834 /**
       
  4835  * Requests an entity's record from the REST API.
       
  4836  */
       
  4837 
       
  4838 const resolvers_getRawEntityRecord = forward_resolver('getEntityRecord');
       
  4839 /**
       
  4840  * Requests an entity's record from the REST API.
       
  4841  */
       
  4842 
       
  4843 const resolvers_getEditedEntityRecord = forward_resolver('getEntityRecord');
       
  4844 /**
       
  4845  * Requests the entity's records from the REST API.
       
  4846  *
       
  4847  * @param {string}  kind  Entity kind.
       
  4848  * @param {string}  name  Entity name.
       
  4849  * @param {Object?} query Query Object.
       
  4850  */
       
  4851 
       
  4852 const resolvers_getEntityRecords = function (kind, name) {
       
  4853   let query = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
       
  4854   return async _ref4 => {
       
  4855     let {
       
  4856       dispatch
       
  4857     } = _ref4;
       
  4858     const configs = await dispatch(getOrLoadEntitiesConfig(kind));
       
  4859     const entityConfig = (0,external_lodash_namespaceObject.find)(configs, {
       
  4860       kind,
       
  4861       name
       
  4862     });
       
  4863 
       
  4864     if (!entityConfig || entityConfig !== null && entityConfig !== void 0 && entityConfig.__experimentalNoFetch) {
       
  4865       return;
       
  4866     }
       
  4867 
       
  4868     const lock = await dispatch.__unstableAcquireStoreLock(STORE_NAME, ['entities', 'records', kind, name], {
       
  4869       exclusive: false
       
  4870     });
       
  4871 
       
  4872     try {
       
  4873       var _query;
       
  4874 
       
  4875       if (query._fields) {
       
  4876         // If requesting specific fields, items and query association to said
       
  4877         // records are stored by ID reference. Thus, fields must always include
       
  4878         // the ID.
       
  4879         query = { ...query,
       
  4880           _fields: (0,external_lodash_namespaceObject.uniq)([...(get_normalized_comma_separable(query._fields) || []), entityConfig.key || DEFAULT_ENTITY_KEY]).join()
       
  4881         };
       
  4882       }
       
  4883 
       
  4884       const path = (0,external_wp_url_namespaceObject.addQueryArgs)(entityConfig.baseURL, { ...entityConfig.baseURLParams,
       
  4885         ...query
       
  4886       });
       
  4887       let records = Object.values(await external_wp_apiFetch_default()({
       
  4888         path
       
  4889       })); // If we request fields but the result doesn't contain the fields,
       
  4890       // explicitely set these fields as "undefined"
       
  4891       // that way we consider the query "fullfilled".
       
  4892 
       
  4893       if (query._fields) {
       
  4894         records = records.map(record => {
       
  4895           query._fields.split(',').forEach(field => {
       
  4896             if (!record.hasOwnProperty(field)) {
       
  4897               record[field] = undefined;
       
  4898             }
       
  4899           });
       
  4900 
       
  4901           return record;
       
  4902         });
       
  4903       }
       
  4904 
       
  4905       dispatch.receiveEntityRecords(kind, name, records, query); // When requesting all fields, the list of results can be used to
       
  4906       // resolve the `getEntityRecord` selector in addition to `getEntityRecords`.
       
  4907       // See https://github.com/WordPress/gutenberg/pull/26575
       
  4908 
       
  4909       if (!((_query = query) !== null && _query !== void 0 && _query._fields) && !query.context) {
       
  4910         const key = entityConfig.key || DEFAULT_ENTITY_KEY;
       
  4911         const resolutionsArgs = records.filter(record => record[key]).map(record => [kind, name, record[key]]);
       
  4912         dispatch({
       
  4913           type: 'START_RESOLUTIONS',
       
  4914           selectorName: 'getEntityRecord',
       
  4915           args: resolutionsArgs
       
  4916         });
       
  4917         dispatch({
       
  4918           type: 'FINISH_RESOLUTIONS',
       
  4919           selectorName: 'getEntityRecord',
       
  4920           args: resolutionsArgs
       
  4921         });
       
  4922       }
       
  4923     } finally {
       
  4924       dispatch.__unstableReleaseStoreLock(lock);
       
  4925     }
       
  4926   };
       
  4927 };
       
  4928 
       
  4929 resolvers_getEntityRecords.shouldInvalidate = (action, kind, name) => {
       
  4930   return (action.type === 'RECEIVE_ITEMS' || action.type === 'REMOVE_ITEMS') && action.invalidateCache && kind === action.kind && name === action.name;
       
  4931 };
       
  4932 /**
       
  4933  * Requests the current theme.
       
  4934  */
       
  4935 
       
  4936 
       
  4937 const resolvers_getCurrentTheme = () => async _ref5 => {
       
  4938   let {
       
  4939     dispatch,
       
  4940     resolveSelect
       
  4941   } = _ref5;
       
  4942   const activeThemes = await resolveSelect.getEntityRecords('root', 'theme', {
       
  4943     status: 'active'
       
  4944   });
       
  4945   dispatch.receiveCurrentTheme(activeThemes[0]);
       
  4946 };
       
  4947 /**
       
  4948  * Requests theme supports data from the index.
       
  4949  */
       
  4950 
       
  4951 const resolvers_getThemeSupports = forward_resolver('getCurrentTheme');
       
  4952 /**
       
  4953  * Requests a preview from the from the Embed API.
       
  4954  *
       
  4955  * @param {string} url URL to get the preview for.
       
  4956  */
       
  4957 
       
  4958 const resolvers_getEmbedPreview = url => async _ref6 => {
       
  4959   let {
       
  4960     dispatch
       
  4961   } = _ref6;
       
  4962 
       
  4963   try {
       
  4964     const embedProxyResponse = await external_wp_apiFetch_default()({
       
  4965       path: (0,external_wp_url_namespaceObject.addQueryArgs)('/oembed/1.0/proxy', {
       
  4966         url
       
  4967       })
       
  4968     });
       
  4969     dispatch.receiveEmbedPreview(url, embedProxyResponse);
       
  4970   } catch (error) {
       
  4971     // Embed API 404s if the URL cannot be embedded, so we have to catch the error from the apiRequest here.
       
  4972     dispatch.receiveEmbedPreview(url, false);
       
  4973   }
       
  4974 };
       
  4975 /**
       
  4976  * Checks whether the current user can perform the given action on the given
       
  4977  * REST resource.
       
  4978  *
       
  4979  * @param {string}  action   Action to check. One of: 'create', 'read', 'update',
       
  4980  *                           'delete'.
       
  4981  * @param {string}  resource REST resource to check, e.g. 'media' or 'posts'.
       
  4982  * @param {?string} id       ID of the rest resource to check.
       
  4983  */
       
  4984 
       
  4985 const resolvers_canUser = (action, resource, id) => async _ref7 => {
       
  4986   var _response$headers;
       
  4987 
       
  4988   let {
       
  4989     dispatch
       
  4990   } = _ref7;
       
  4991   const methods = {
       
  4992     create: 'POST',
       
  4993     read: 'GET',
       
  4994     update: 'PUT',
       
  4995     delete: 'DELETE'
       
  4996   };
       
  4997   const method = methods[action];
       
  4998 
       
  4999   if (!method) {
       
  5000     throw new Error(`'${action}' is not a valid action.`);
       
  5001   }
       
  5002 
       
  5003   const path = id ? `/wp/v2/${resource}/${id}` : `/wp/v2/${resource}`;
       
  5004   let response;
       
  5005 
       
  5006   try {
       
  5007     response = await external_wp_apiFetch_default()({
       
  5008       path,
       
  5009       method: 'OPTIONS',
       
  5010       parse: false
       
  5011     });
       
  5012   } catch (error) {
       
  5013     // Do nothing if our OPTIONS request comes back with an API error (4xx or
       
  5014     // 5xx). The previously determined isAllowed value will remain in the store.
       
  5015     return;
       
  5016   } // Optional chaining operator is used here because the API requests don't
       
  5017   // return the expected result in the native version. Instead, API requests
       
  5018   // only return the result, without including response properties like the headers.
       
  5019 
       
  5020 
       
  5021   const allowHeader = (_response$headers = response.headers) === null || _response$headers === void 0 ? void 0 : _response$headers.get('allow');
       
  5022   const key = (0,external_lodash_namespaceObject.compact)([action, resource, id]).join('/');
       
  5023   const isAllowed = (0,external_lodash_namespaceObject.includes)(allowHeader, method);
       
  5024   dispatch.receiveUserPermission(key, isAllowed);
       
  5025 };
       
  5026 /**
       
  5027  * Checks whether the current user can perform the given action on the given
       
  5028  * REST resource.
       
  5029  *
       
  5030  * @param {string} kind     Entity kind.
       
  5031  * @param {string} name     Entity name.
       
  5032  * @param {string} recordId Record's id.
       
  5033  */
       
  5034 
       
  5035 const resolvers_canUserEditEntityRecord = (kind, name, recordId) => async _ref8 => {
       
  5036   let {
       
  5037     dispatch
       
  5038   } = _ref8;
       
  5039   const configs = await dispatch(getOrLoadEntitiesConfig(kind));
       
  5040   const entityConfig = (0,external_lodash_namespaceObject.find)(configs, {
       
  5041     kind,
       
  5042     name
       
  5043   });
       
  5044 
       
  5045   if (!entityConfig) {
       
  5046     return;
       
  5047   }
       
  5048 
       
  5049   const resource = entityConfig.__unstable_rest_base;
       
  5050   await dispatch(resolvers_canUser('update', resource, recordId));
       
  5051 };
       
  5052 /**
       
  5053  * Request autosave data from the REST API.
       
  5054  *
       
  5055  * @param {string} postType The type of the parent post.
       
  5056  * @param {number} postId   The id of the parent post.
       
  5057  */
       
  5058 
       
  5059 const resolvers_getAutosaves = (postType, postId) => async _ref9 => {
       
  5060   let {
       
  5061     dispatch,
       
  5062     resolveSelect
       
  5063   } = _ref9;
       
  5064   const {
       
  5065     rest_base: restBase
       
  5066   } = await resolveSelect.getPostType(postType);
       
  5067   const autosaves = await external_wp_apiFetch_default()({
       
  5068     path: `/wp/v2/${restBase}/${postId}/autosaves?context=edit`
       
  5069   });
       
  5070 
       
  5071   if (autosaves && autosaves.length) {
       
  5072     dispatch.receiveAutosaves(postId, autosaves);
       
  5073   }
       
  5074 };
       
  5075 /**
       
  5076  * Request autosave data from the REST API.
       
  5077  *
       
  5078  * This resolver exists to ensure the underlying autosaves are fetched via
       
  5079  * `getAutosaves` when a call to the `getAutosave` selector is made.
       
  5080  *
       
  5081  * @param {string} postType The type of the parent post.
       
  5082  * @param {number} postId   The id of the parent post.
       
  5083  */
       
  5084 
       
  5085 const resolvers_getAutosave = (postType, postId) => async _ref10 => {
       
  5086   let {
       
  5087     resolveSelect
       
  5088   } = _ref10;
       
  5089   await resolveSelect.getAutosaves(postType, postId);
       
  5090 };
       
  5091 /**
       
  5092  * Retrieve the frontend template used for a given link.
       
  5093  *
       
  5094  * @param {string} link Link.
       
  5095  */
       
  5096 
       
  5097 const resolvers_experimentalGetTemplateForLink = link => async _ref11 => {
       
  5098   let {
       
  5099     dispatch,
       
  5100     resolveSelect
       
  5101   } = _ref11;
       
  5102   // Ideally this should be using an apiFetch call
       
  5103   // We could potentially do so by adding a "filter" to the `wp_template` end point.
       
  5104   // Also it seems the returned object is not a regular REST API post type.
       
  5105   let template;
       
  5106 
       
  5107   try {
       
  5108     template = await window.fetch((0,external_wp_url_namespaceObject.addQueryArgs)(link, {
       
  5109       '_wp-find-template': true
       
  5110     })).then(res => res.json()).then(_ref12 => {
       
  5111       let {
       
  5112         data
       
  5113       } = _ref12;
       
  5114       return data;
       
  5115     });
       
  5116   } catch (e) {// For non-FSE themes, it is possible that this request returns an error.
       
  5117   }
       
  5118 
       
  5119   if (!template) {
       
  5120     return;
       
  5121   }
       
  5122 
       
  5123   const record = await resolveSelect.getEntityRecord('postType', 'wp_template', template.id);
       
  5124 
       
  5125   if (record) {
       
  5126     dispatch.receiveEntityRecords('postType', 'wp_template', [record], {
       
  5127       'find-template': link
       
  5128     });
       
  5129   }
       
  5130 };
       
  5131 
       
  5132 resolvers_experimentalGetTemplateForLink.shouldInvalidate = action => {
       
  5133   return (action.type === 'RECEIVE_ITEMS' || action.type === 'REMOVE_ITEMS') && action.invalidateCache && action.kind === 'postType' && action.name === 'wp_template';
       
  5134 };
       
  5135 
       
  5136 const resolvers_experimentalGetCurrentGlobalStylesId = () => async _ref13 => {
       
  5137   let {
       
  5138     dispatch,
       
  5139     resolveSelect
       
  5140   } = _ref13;
       
  5141   const activeThemes = await resolveSelect.getEntityRecords('root', 'theme', {
       
  5142     status: 'active'
       
  5143   });
       
  5144   const globalStylesURL = (0,external_lodash_namespaceObject.get)(activeThemes, [0, '_links', 'wp:user-global-styles', 0, 'href']);
       
  5145 
       
  5146   if (globalStylesURL) {
       
  5147     const globalStylesObject = await external_wp_apiFetch_default()({
       
  5148       url: globalStylesURL
       
  5149     });
       
  5150 
       
  5151     dispatch.__experimentalReceiveCurrentGlobalStylesId(globalStylesObject.id);
       
  5152   }
       
  5153 };
       
  5154 const resolvers_experimentalGetCurrentThemeBaseGlobalStyles = () => async _ref14 => {
       
  5155   let {
       
  5156     resolveSelect,
       
  5157     dispatch
       
  5158   } = _ref14;
       
  5159   const currentTheme = await resolveSelect.getCurrentTheme();
       
  5160   const themeGlobalStyles = await external_wp_apiFetch_default()({
       
  5161     path: `/wp/v2/global-styles/themes/${currentTheme.stylesheet}`
       
  5162   });
       
  5163 
       
  5164   dispatch.__experimentalReceiveThemeBaseGlobalStyles(currentTheme.stylesheet, themeGlobalStyles);
       
  5165 };
       
  5166 const resolvers_experimentalGetCurrentThemeGlobalStylesVariations = () => async _ref15 => {
       
  5167   let {
       
  5168     resolveSelect,
       
  5169     dispatch
       
  5170   } = _ref15;
       
  5171   const currentTheme = await resolveSelect.getCurrentTheme();
       
  5172   const variations = await external_wp_apiFetch_default()({
       
  5173     path: `/wp/v2/global-styles/themes/${currentTheme.stylesheet}/variations`
       
  5174   });
       
  5175 
       
  5176   dispatch.__experimentalReceiveThemeGlobalStyleVariations(currentTheme.stylesheet, variations);
       
  5177 };
       
  5178 const resolvers_getBlockPatterns = () => async _ref16 => {
       
  5179   let {
       
  5180     dispatch
       
  5181   } = _ref16;
       
  5182   const restPatterns = await external_wp_apiFetch_default()({
       
  5183     path: '/wp/v2/block-patterns/patterns'
       
  5184   });
       
  5185   const patterns = (0,external_lodash_namespaceObject.map)(restPatterns, pattern => (0,external_lodash_namespaceObject.mapKeys)(pattern, (value, key) => {
       
  5186     switch (key) {
       
  5187       case 'block_types':
       
  5188         return 'blockTypes';
       
  5189 
       
  5190       case 'viewport_width':
       
  5191         return 'viewportWidth';
       
  5192 
       
  5193       default:
       
  5194         return key;
       
  5195     }
       
  5196   }));
       
  5197   dispatch({
       
  5198     type: 'RECEIVE_BLOCK_PATTERNS',
       
  5199     patterns
       
  5200   });
       
  5201 };
       
  5202 const resolvers_getBlockPatternCategories = () => async _ref17 => {
       
  5203   let {
       
  5204     dispatch
       
  5205   } = _ref17;
       
  5206   const categories = await external_wp_apiFetch_default()({
       
  5207     path: '/wp/v2/block-patterns/categories'
       
  5208   });
       
  5209   dispatch({
       
  5210     type: 'RECEIVE_BLOCK_PATTERN_CATEGORIES',
       
  5211     categories
       
  5212   });
       
  5213 };
       
  5214 
       
  5215 ;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/locks/utils.js
       
  5216 function deepCopyLocksTreePath(tree, path) {
       
  5217   const newTree = { ...tree
       
  5218   };
       
  5219   let currentNode = newTree;
       
  5220 
       
  5221   for (const branchName of path) {
       
  5222     currentNode.children = { ...currentNode.children,
       
  5223       [branchName]: {
       
  5224         locks: [],
       
  5225         children: {},
       
  5226         ...currentNode.children[branchName]
       
  5227       }
       
  5228     };
       
  5229     currentNode = currentNode.children[branchName];
       
  5230   }
       
  5231 
       
  5232   return newTree;
       
  5233 }
       
  5234 function getNode(tree, path) {
       
  5235   let currentNode = tree;
       
  5236 
       
  5237   for (const branchName of path) {
       
  5238     const nextNode = currentNode.children[branchName];
       
  5239 
       
  5240     if (!nextNode) {
       
  5241       return null;
       
  5242     }
       
  5243 
       
  5244     currentNode = nextNode;
       
  5245   }
       
  5246 
       
  5247   return currentNode;
       
  5248 }
       
  5249 function* iteratePath(tree, path) {
       
  5250   let currentNode = tree;
       
  5251   yield currentNode;
       
  5252 
       
  5253   for (const branchName of path) {
       
  5254     const nextNode = currentNode.children[branchName];
       
  5255 
       
  5256     if (!nextNode) {
       
  5257       break;
       
  5258     }
       
  5259 
       
  5260     yield nextNode;
       
  5261     currentNode = nextNode;
       
  5262   }
       
  5263 }
       
  5264 function* iterateDescendants(node) {
       
  5265   const stack = Object.values(node.children);
       
  5266 
       
  5267   while (stack.length) {
       
  5268     const childNode = stack.pop();
       
  5269     yield childNode;
       
  5270     stack.push(...Object.values(childNode.children));
       
  5271   }
       
  5272 }
       
  5273 function hasConflictingLock(_ref, locks) {
       
  5274   let {
       
  5275     exclusive
       
  5276   } = _ref;
       
  5277 
       
  5278   if (exclusive && locks.length) {
       
  5279     return true;
       
  5280   }
       
  5281 
       
  5282   if (!exclusive && locks.filter(lock => lock.exclusive).length) {
       
  5283     return true;
       
  5284   }
       
  5285 
       
  5286   return false;
       
  5287 }
       
  5288 
       
  5289 ;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/locks/reducer.js
       
  5290 /**
       
  5291  * Internal dependencies
       
  5292  */
       
  5293 
       
  5294 const DEFAULT_STATE = {
       
  5295   requests: [],
       
  5296   tree: {
       
  5297     locks: [],
       
  5298     children: {}
       
  5299   }
       
  5300 };
       
  5301 /**
       
  5302  * Reducer returning locks.
       
  5303  *
       
  5304  * @param {Object} state  Current state.
       
  5305  * @param {Object} action Dispatched action.
       
  5306  *
       
  5307  * @return {Object} Updated state.
       
  5308  */
       
  5309 
       
  5310 function locks() {
       
  5311   let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DEFAULT_STATE;
       
  5312   let action = arguments.length > 1 ? arguments[1] : undefined;
       
  5313 
       
  5314   switch (action.type) {
       
  5315     case 'ENQUEUE_LOCK_REQUEST':
       
  5316       {
       
  5317         const {
       
  5318           request
       
  5319         } = action;
       
  5320         return { ...state,
       
  5321           requests: [request, ...state.requests]
       
  5322         };
       
  5323       }
       
  5324 
       
  5325     case 'GRANT_LOCK_REQUEST':
       
  5326       {
       
  5327         const {
       
  5328           lock,
       
  5329           request
       
  5330         } = action;
       
  5331         const {
       
  5332           store,
       
  5333           path
       
  5334         } = request;
       
  5335         const storePath = [store, ...path];
       
  5336         const newTree = deepCopyLocksTreePath(state.tree, storePath);
       
  5337         const node = getNode(newTree, storePath);
       
  5338         node.locks = [...node.locks, lock];
       
  5339         return { ...state,
       
  5340           requests: state.requests.filter(r => r !== request),
       
  5341           tree: newTree
       
  5342         };
       
  5343       }
       
  5344 
       
  5345     case 'RELEASE_LOCK':
       
  5346       {
       
  5347         const {
       
  5348           lock
       
  5349         } = action;
       
  5350         const storePath = [lock.store, ...lock.path];
       
  5351         const newTree = deepCopyLocksTreePath(state.tree, storePath);
       
  5352         const node = getNode(newTree, storePath);
       
  5353         node.locks = node.locks.filter(l => l !== lock);
       
  5354         return { ...state,
       
  5355           tree: newTree
       
  5356         };
       
  5357       }
       
  5358   }
       
  5359 
       
  5360   return state;
       
  5361 }
       
  5362 
       
  5363 ;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/locks/selectors.js
       
  5364 /**
       
  5365  * Internal dependencies
       
  5366  */
       
  5367 
       
  5368 function getPendingLockRequests(state) {
       
  5369   return state.requests;
       
  5370 }
       
  5371 function isLockAvailable(state, store, path, _ref) {
       
  5372   let {
       
  5373     exclusive
       
  5374   } = _ref;
       
  5375   const storePath = [store, ...path];
       
  5376   const locks = state.tree; // Validate all parents and the node itself
       
  5377 
       
  5378   for (const node of iteratePath(locks, storePath)) {
       
  5379     if (hasConflictingLock({
       
  5380       exclusive
       
  5381     }, node.locks)) {
       
  5382       return false;
       
  5383     }
       
  5384   } // iteratePath terminates early if path is unreachable, let's
       
  5385   // re-fetch the node and check it exists in the tree.
       
  5386 
       
  5387 
       
  5388   const node = getNode(locks, storePath);
       
  5389 
       
  5390   if (!node) {
       
  5391     return true;
       
  5392   } // Validate all nested nodes
       
  5393 
       
  5394 
       
  5395   for (const descendant of iterateDescendants(node)) {
       
  5396     if (hasConflictingLock({
       
  5397       exclusive
       
  5398     }, descendant.locks)) {
       
  5399       return false;
       
  5400     }
       
  5401   }
       
  5402 
       
  5403   return true;
       
  5404 }
       
  5405 
       
  5406 ;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/locks/engine.js
       
  5407 /**
       
  5408  * Internal dependencies
       
  5409  */
       
  5410 
       
  5411 
       
  5412 function createLocks() {
       
  5413   let state = locks(undefined, {
       
  5414     type: '@@INIT'
       
  5415   });
       
  5416 
       
  5417   function processPendingLockRequests() {
       
  5418     for (const request of getPendingLockRequests(state)) {
       
  5419       const {
       
  5420         store,
       
  5421         path,
       
  5422         exclusive,
       
  5423         notifyAcquired
       
  5424       } = request;
       
  5425 
       
  5426       if (isLockAvailable(state, store, path, {
       
  5427         exclusive
       
  5428       })) {
       
  5429         const lock = {
       
  5430           store,
       
  5431           path,
       
  5432           exclusive
       
  5433         };
       
  5434         state = locks(state, {
       
  5435           type: 'GRANT_LOCK_REQUEST',
       
  5436           lock,
       
  5437           request
       
  5438         });
       
  5439         notifyAcquired(lock);
       
  5440       }
       
  5441     }
       
  5442   }
       
  5443 
       
  5444   function acquire(store, path, exclusive) {
       
  5445     return new Promise(resolve => {
       
  5446       state = locks(state, {
       
  5447         type: 'ENQUEUE_LOCK_REQUEST',
       
  5448         request: {
       
  5449           store,
       
  5450           path,
       
  5451           exclusive,
       
  5452           notifyAcquired: resolve
       
  5453         }
       
  5454       });
       
  5455       processPendingLockRequests();
       
  5456     });
       
  5457   }
       
  5458 
       
  5459   function release(lock) {
       
  5460     state = locks(state, {
       
  5461       type: 'RELEASE_LOCK',
       
  5462       lock
       
  5463     });
       
  5464     processPendingLockRequests();
       
  5465   }
       
  5466 
       
  5467   return {
       
  5468     acquire,
       
  5469     release
       
  5470   };
       
  5471 }
       
  5472 
       
  5473 ;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/locks/actions.js
       
  5474 /**
       
  5475  * Internal dependencies
       
  5476  */
       
  5477 
       
  5478 function createLocksActions() {
       
  5479   const locks = createLocks();
       
  5480 
       
  5481   function __unstableAcquireStoreLock(store, path, _ref) {
       
  5482     let {
       
  5483       exclusive
       
  5484     } = _ref;
       
  5485     return () => locks.acquire(store, path, exclusive);
       
  5486   }
       
  5487 
       
  5488   function __unstableReleaseStoreLock(lock) {
       
  5489     return () => locks.release(lock);
       
  5490   }
       
  5491 
       
  5492   return {
       
  5493     __unstableAcquireStoreLock,
       
  5494     __unstableReleaseStoreLock
       
  5495   };
       
  5496 }
       
  5497 
       
  5498 ;// CONCATENATED MODULE: external ["wp","element"]
       
  5499 var external_wp_element_namespaceObject = window["wp"]["element"];
       
  5500 ;// CONCATENATED MODULE: external ["wp","blocks"]
       
  5501 var external_wp_blocks_namespaceObject = window["wp"]["blocks"];
       
  5502 ;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/entity-provider.js
       
  5503 
       
  5504 
       
  5505 /**
       
  5506  * WordPress dependencies
       
  5507  */
       
  5508 
       
  5509 
       
  5510 
       
  5511 /**
       
  5512  * Internal dependencies
       
  5513  */
       
  5514 
       
  5515 
       
  5516 /** @typedef {import('@wordpress/blocks').WPBlock} WPBlock */
       
  5517 
       
  5518 const EMPTY_ARRAY = [];
       
  5519 /**
       
  5520  * Internal dependencies
       
  5521  */
       
  5522 
       
  5523 
       
  5524 const entityContexts = { ...rootEntitiesConfig.reduce((acc, loader) => {
       
  5525     if (!acc[loader.kind]) {
       
  5526       acc[loader.kind] = {};
       
  5527     }
       
  5528 
       
  5529     acc[loader.kind][loader.name] = {
       
  5530       context: (0,external_wp_element_namespaceObject.createContext)(undefined)
       
  5531     };
       
  5532     return acc;
       
  5533   }, {}),
       
  5534   ...additionalEntityConfigLoaders.reduce((acc, loader) => {
       
  5535     acc[loader.kind] = {};
       
  5536     return acc;
       
  5537   }, {})
       
  5538 };
       
  5539 
       
  5540 const getEntityContext = (kind, name) => {
       
  5541   if (!entityContexts[kind]) {
       
  5542     throw new Error(`Missing entity config for kind: ${kind}.`);
       
  5543   }
       
  5544 
       
  5545   if (!entityContexts[kind][name]) {
       
  5546     entityContexts[kind][name] = {
       
  5547       context: (0,external_wp_element_namespaceObject.createContext)(undefined)
       
  5548     };
       
  5549   }
       
  5550 
       
  5551   return entityContexts[kind][name].context;
       
  5552 };
       
  5553 /**
       
  5554  * Context provider component for providing
       
  5555  * an entity for a specific entity.
       
  5556  *
       
  5557  * @param {Object} props          The component's props.
       
  5558  * @param {string} props.kind     The entity kind.
       
  5559  * @param {string} props.type     The entity name.
       
  5560  * @param {number} props.id       The entity ID.
       
  5561  * @param {*}      props.children The children to wrap.
       
  5562  *
       
  5563  * @return {Object} The provided children, wrapped with
       
  5564  *                   the entity's context provider.
       
  5565  */
       
  5566 
       
  5567 
       
  5568 function EntityProvider(_ref) {
       
  5569   let {
       
  5570     kind,
       
  5571     type: name,
       
  5572     id,
       
  5573     children
       
  5574   } = _ref;
       
  5575   const Provider = getEntityContext(kind, name).Provider;
       
  5576   return (0,external_wp_element_namespaceObject.createElement)(Provider, {
       
  5577     value: id
       
  5578   }, children);
       
  5579 }
       
  5580 /**
       
  5581  * Hook that returns the ID for the nearest
       
  5582  * provided entity of the specified type.
       
  5583  *
       
  5584  * @param {string} kind The entity kind.
       
  5585  * @param {string} name The entity name.
       
  5586  */
       
  5587 
       
  5588 function useEntityId(kind, name) {
       
  5589   return (0,external_wp_element_namespaceObject.useContext)(getEntityContext(kind, name));
       
  5590 }
       
  5591 /**
       
  5592  * Hook that returns the value and a setter for the
       
  5593  * specified property of the nearest provided
       
  5594  * entity of the specified type.
       
  5595  *
       
  5596  * @param {string} kind  The entity kind.
       
  5597  * @param {string} name  The entity name.
       
  5598  * @param {string} prop  The property name.
       
  5599  * @param {string} [_id] An entity ID to use instead of the context-provided one.
       
  5600  *
       
  5601  * @return {[*, Function, *]} An array where the first item is the
       
  5602  *                            property value, the second is the
       
  5603  *                            setter and the third is the full value
       
  5604  * 							  object from REST API containing more
       
  5605  * 							  information like `raw`, `rendered` and
       
  5606  * 							  `protected` props.
       
  5607  */
       
  5608 
       
  5609 function useEntityProp(kind, name, prop, _id) {
       
  5610   const providerId = useEntityId(kind, name);
       
  5611   const id = _id !== null && _id !== void 0 ? _id : providerId;
       
  5612   const {
       
  5613     value,
       
  5614     fullValue
       
  5615   } = (0,external_wp_data_namespaceObject.useSelect)(select => {
       
  5616     const {
       
  5617       getEntityRecord,
       
  5618       getEditedEntityRecord
       
  5619     } = select(STORE_NAME);
       
  5620     const record = getEntityRecord(kind, name, id); // Trigger resolver.
       
  5621 
       
  5622     const editedRecord = getEditedEntityRecord(kind, name, id);
       
  5623     return record && editedRecord ? {
       
  5624       value: editedRecord[prop],
       
  5625       fullValue: record[prop]
       
  5626     } : {};
       
  5627   }, [kind, name, id, prop]);
       
  5628   const {
       
  5629     editEntityRecord
       
  5630   } = (0,external_wp_data_namespaceObject.useDispatch)(STORE_NAME);
       
  5631   const setValue = (0,external_wp_element_namespaceObject.useCallback)(newValue => {
       
  5632     editEntityRecord(kind, name, id, {
       
  5633       [prop]: newValue
       
  5634     });
       
  5635   }, [kind, name, id, prop]);
       
  5636   return [value, setValue, fullValue];
       
  5637 }
       
  5638 /**
       
  5639  * Hook that returns block content getters and setters for
       
  5640  * the nearest provided entity of the specified type.
       
  5641  *
       
  5642  * The return value has the shape `[ blocks, onInput, onChange ]`.
       
  5643  * `onInput` is for block changes that don't create undo levels
       
  5644  * or dirty the post, non-persistent changes, and `onChange` is for
       
  5645  * peristent changes. They map directly to the props of a
       
  5646  * `BlockEditorProvider` and are intended to be used with it,
       
  5647  * or similar components or hooks.
       
  5648  *
       
  5649  * @param {string} kind         The entity kind.
       
  5650  * @param {string} name         The entity name.
       
  5651  * @param {Object} options
       
  5652  * @param {string} [options.id] An entity ID to use instead of the context-provided one.
       
  5653  *
       
  5654  * @return {[WPBlock[], Function, Function]} The block array and setters.
       
  5655  */
       
  5656 
       
  5657 function useEntityBlockEditor(kind, name) {
       
  5658   let {
       
  5659     id: _id
       
  5660   } = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
       
  5661   const providerId = useEntityId(kind, name);
       
  5662   const id = _id !== null && _id !== void 0 ? _id : providerId;
       
  5663   const {
       
  5664     content,
       
  5665     blocks
       
  5666   } = (0,external_wp_data_namespaceObject.useSelect)(select => {
       
  5667     const {
       
  5668       getEditedEntityRecord
       
  5669     } = select(STORE_NAME);
       
  5670     const editedRecord = getEditedEntityRecord(kind, name, id);
       
  5671     return {
       
  5672       blocks: editedRecord.blocks,
       
  5673       content: editedRecord.content
       
  5674     };
       
  5675   }, [kind, name, id]);
       
  5676   const {
       
  5677     __unstableCreateUndoLevel,
       
  5678     editEntityRecord
       
  5679   } = (0,external_wp_data_namespaceObject.useDispatch)(STORE_NAME);
       
  5680   (0,external_wp_element_namespaceObject.useEffect)(() => {
       
  5681     // Load the blocks from the content if not already in state
       
  5682     // Guard against other instances that might have
       
  5683     // set content to a function already or the blocks are already in state.
       
  5684     if (content && typeof content !== 'function' && !blocks) {
       
  5685       const parsedContent = (0,external_wp_blocks_namespaceObject.parse)(content);
       
  5686       editEntityRecord(kind, name, id, {
       
  5687         blocks: parsedContent
       
  5688       }, {
       
  5689         undoIgnore: true
       
  5690       });
       
  5691     }
       
  5692   }, [content]);
       
  5693   const onChange = (0,external_wp_element_namespaceObject.useCallback)((newBlocks, options) => {
       
  5694     const {
       
  5695       selection
       
  5696     } = options;
       
  5697     const edits = {
       
  5698       blocks: newBlocks,
       
  5699       selection
       
  5700     };
       
  5701     const noChange = blocks === edits.blocks;
       
  5702 
       
  5703     if (noChange) {
       
  5704       return __unstableCreateUndoLevel(kind, name, id);
       
  5705     } // We create a new function here on every persistent edit
       
  5706     // to make sure the edit makes the post dirty and creates
       
  5707     // a new undo level.
       
  5708 
       
  5709 
       
  5710     edits.content = _ref2 => {
       
  5711       let {
       
  5712         blocks: blocksForSerialization = []
       
  5713       } = _ref2;
       
  5714       return (0,external_wp_blocks_namespaceObject.__unstableSerializeAndClean)(blocksForSerialization);
       
  5715     };
       
  5716 
       
  5717     editEntityRecord(kind, name, id, edits);
       
  5718   }, [kind, name, id, blocks]);
       
  5719   const onInput = (0,external_wp_element_namespaceObject.useCallback)((newBlocks, options) => {
       
  5720     const {
       
  5721       selection
       
  5722     } = options;
       
  5723     const edits = {
       
  5724       blocks: newBlocks,
       
  5725       selection
       
  5726     };
       
  5727     editEntityRecord(kind, name, id, edits);
       
  5728   }, [kind, name, id]);
       
  5729   return [blocks !== null && blocks !== void 0 ? blocks : EMPTY_ARRAY, onInput, onChange];
       
  5730 }
       
  5731 
       
  5732 // EXTERNAL MODULE: ./node_modules/memize/index.js
       
  5733 var memize = __webpack_require__(9756);
       
  5734 var memize_default = /*#__PURE__*/__webpack_require__.n(memize);
       
  5735 ;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/hooks/memoize.js
       
  5736 /**
       
  5737  * External dependencies
       
  5738  */
       
  5739  // re-export due to restrictive esModuleInterop setting
       
  5740 
       
  5741 /* harmony default export */ var memoize = ((memize_default()));
       
  5742 
       
  5743 ;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/hooks/constants.js
       
  5744 /* eslint-disable-next-line no-shadow */
       
  5745 let Status;
       
  5746 
       
  5747 (function (Status) {
       
  5748   Status["Idle"] = "IDLE";
       
  5749   Status["Resolving"] = "RESOLVING";
       
  5750   Status["Error"] = "ERROR";
       
  5751   Status["Success"] = "SUCCESS";
       
  5752 })(Status || (Status = {}));
       
  5753 
       
  5754 ;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/hooks/use-query-select.js
       
  5755 /**
       
  5756  * WordPress dependencies
       
  5757  */
       
  5758 
       
  5759 /**
       
  5760  * Internal dependencies
       
  5761  */
       
  5762 
       
  5763 
       
  5764 
       
  5765 const META_SELECTORS = ['getIsResolving', 'hasStartedResolution', 'hasFinishedResolution', 'isResolving', 'getCachedResolvers'];
       
  5766 
       
  5767 /**
       
  5768  * Like useSelect, but the selectors return objects containing
       
  5769  * both the original data AND the resolution info.
       
  5770  *
       
  5771  * @param {Function} mapQuerySelect see useSelect
       
  5772  * @param {Array}    deps           see useSelect
       
  5773  *
       
  5774  * @example
       
  5775  * ```js
       
  5776  * import { useQuerySelect } from '@wordpress/data';
       
  5777  * import { store as coreDataStore } from '@wordpress/core-data';
       
  5778  *
       
  5779  * function PageTitleDisplay( { id } ) {
       
  5780  *   const { data: page, isResolving } = useQuerySelect( ( query ) => {
       
  5781  *     return query( coreDataStore ).getEntityRecord( 'postType', 'page', id )
       
  5782  *   }, [ id ] );
       
  5783  *
       
  5784  *   if ( isResolving ) {
       
  5785  *     return 'Loading...';
       
  5786  *   }
       
  5787  *
       
  5788  *   return page.title;
       
  5789  * }
       
  5790  *
       
  5791  * // Rendered in the application:
       
  5792  * // <PageTitleDisplay id={ 10 } />
       
  5793  * ```
       
  5794  *
       
  5795  * In the above example, when `PageTitleDisplay` is rendered into an
       
  5796  * application, the page and the resolution details will be retrieved from
       
  5797  * the store state using the `mapSelect` callback on `useQuerySelect`.
       
  5798  *
       
  5799  * If the id prop changes then any page in the state for that id is
       
  5800  * retrieved. If the id prop doesn't change and other props are passed in
       
  5801  * that do change, the title will not change because the dependency is just
       
  5802  * the id.
       
  5803  * @see useSelect
       
  5804  *
       
  5805  * @return {QuerySelectResponse} Queried data.
       
  5806  */
       
  5807 function __experimentalUseQuerySelect(mapQuerySelect, deps) {
       
  5808   return (0,external_wp_data_namespaceObject.useSelect)((select, registry) => {
       
  5809     const resolve = store => enrichSelectors(select(store));
       
  5810 
       
  5811     return mapQuerySelect(resolve, registry);
       
  5812   }, deps);
       
  5813 }
       
  5814 
       
  5815 /**
       
  5816  * Transform simple selectors into ones that return an object with the
       
  5817  * original return value AND the resolution info.
       
  5818  *
       
  5819  * @param {Object} selectors Selectors to enrich
       
  5820  * @return {EnrichedSelectors} Enriched selectors
       
  5821  */
       
  5822 const enrichSelectors = memoize(selectors => {
       
  5823   const resolvers = {};
       
  5824 
       
  5825   for (const selectorName in selectors) {
       
  5826     if (META_SELECTORS.includes(selectorName)) {
       
  5827       continue;
       
  5828     }
       
  5829 
       
  5830     Object.defineProperty(resolvers, selectorName, {
       
  5831       get: () => function () {
       
  5832         const {
       
  5833           getIsResolving,
       
  5834           hasFinishedResolution
       
  5835         } = selectors;
       
  5836 
       
  5837         for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
       
  5838           args[_key] = arguments[_key];
       
  5839         }
       
  5840 
       
  5841         const isResolving = !!getIsResolving(selectorName, args);
       
  5842         const hasResolved = !isResolving && hasFinishedResolution(selectorName, args);
       
  5843         const data = selectors[selectorName](...args);
       
  5844         let status;
       
  5845 
       
  5846         if (isResolving) {
       
  5847           status = Status.Resolving;
       
  5848         } else if (hasResolved) {
       
  5849           if (data) {
       
  5850             status = Status.Success;
       
  5851           } else {
       
  5852             status = Status.Error;
       
  5853           }
       
  5854         } else {
       
  5855           status = Status.Idle;
       
  5856         }
       
  5857 
       
  5858         return {
       
  5859           data,
       
  5860           status,
       
  5861           isResolving,
       
  5862           hasResolved
       
  5863         };
       
  5864       }
       
  5865     });
       
  5866   }
       
  5867 
       
  5868   return resolvers;
       
  5869 });
       
  5870 
       
  5871 ;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/hooks/use-entity-record.js
       
  5872 /**
       
  5873  * Internal dependencies
       
  5874  */
       
  5875 
       
  5876 
       
  5877 
       
  5878 /**
       
  5879  * Resolves the specified entity record.
       
  5880  *
       
  5881  * @param  kind                   Kind of the requested entity.
       
  5882  * @param  name                   Name of the requested  entity.
       
  5883  * @param  recordId               Record ID of the requested entity.
       
  5884  * @param  options                Hook options.
       
  5885  * @param  [options.enabled=true] Whether to run the query or short-circuit and return null. Defaults to true.
       
  5886  * @example
       
  5887  * ```js
       
  5888  * import { useEntityRecord } from '@wordpress/core-data';
       
  5889  *
       
  5890  * function PageTitleDisplay( { id } ) {
       
  5891  *   const { record, isResolving } = useEntityRecord( 'postType', 'page', id );
       
  5892  *
       
  5893  *   if ( isResolving ) {
       
  5894  *     return 'Loading...';
       
  5895  *   }
       
  5896  *
       
  5897  *   return record.title;
       
  5898  * }
       
  5899  *
       
  5900  * // Rendered in the application:
       
  5901  * // <PageTitleDisplay id={ 1 } />
       
  5902  * ```
       
  5903  *
       
  5904  * In the above example, when `PageTitleDisplay` is rendered into an
       
  5905  * application, the page and the resolution details will be retrieved from
       
  5906  * the store state using `getEntityRecord()`, or resolved if missing.
       
  5907  *
       
  5908  * @return {EntityRecordResolution<RecordType>} Entity record data.
       
  5909  * @template RecordType
       
  5910  */
       
  5911 function __experimentalUseEntityRecord(kind, name, recordId) {
       
  5912   let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {
       
  5913     enabled: true
       
  5914   };
       
  5915   const {
       
  5916     data: record,
       
  5917     ...rest
       
  5918   } = __experimentalUseQuerySelect(query => {
       
  5919     if (!options.enabled) {
       
  5920       return null;
       
  5921     }
       
  5922 
       
  5923     return query(store).getEntityRecord(kind, name, recordId);
       
  5924   }, [kind, name, recordId, options.enabled]);
       
  5925   return {
       
  5926     record,
       
  5927     ...rest
       
  5928   };
       
  5929 }
       
  5930 
       
  5931 ;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/hooks/use-entity-records.js
       
  5932 /**
       
  5933  * WordPress dependencies
       
  5934  */
       
  5935 
       
  5936 /**
       
  5937  * Internal dependencies
       
  5938  */
       
  5939 
       
  5940 
       
  5941 
       
  5942 
       
  5943 /**
       
  5944  * Resolves the specified entity records.
       
  5945  *
       
  5946  * @param  kind      Kind of the requested entities.
       
  5947  * @param  name      Name of the requested entities.
       
  5948  * @param  queryArgs HTTP query for the requested entities.
       
  5949  * @param  options   Hook options.
       
  5950  * @example
       
  5951  * ```js
       
  5952  * import { useEntityRecord } from '@wordpress/core-data';
       
  5953  *
       
  5954  * function PageTitlesList() {
       
  5955  *   const { records, isResolving } = useEntityRecords( 'postType', 'page' );
       
  5956  *
       
  5957  *   if ( isResolving ) {
       
  5958  *     return 'Loading...';
       
  5959  *   }
       
  5960  *
       
  5961  *   return (
       
  5962  *     <ul>
       
  5963  *       {records.map(( page ) => (
       
  5964  *         <li>{ page.title }</li>
       
  5965  *       ))}
       
  5966  *     </ul>
       
  5967  *   );
       
  5968  * }
       
  5969  *
       
  5970  * // Rendered in the application:
       
  5971  * // <PageTitlesList />
       
  5972  * ```
       
  5973  *
       
  5974  * In the above example, when `PageTitlesList` is rendered into an
       
  5975  * application, the list of records and the resolution details will be retrieved from
       
  5976  * the store state using `getEntityRecords()`, or resolved if missing.
       
  5977  *
       
  5978  * @return Entity records data.
       
  5979  * @template RecordType
       
  5980  */
       
  5981 function __experimentalUseEntityRecords(kind, name) {
       
  5982   let queryArgs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
       
  5983   let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {
       
  5984     enabled: true
       
  5985   };
       
  5986   // Serialize queryArgs to a string that can be safely used as a React dep.
       
  5987   // We can't just pass queryArgs as one of the deps, because if it is passed
       
  5988   // as an object literal, then it will be a different object on each call even
       
  5989   // if the values remain the same.
       
  5990   const queryAsString = (0,external_wp_url_namespaceObject.addQueryArgs)('', queryArgs);
       
  5991   const {
       
  5992     data: records,
       
  5993     ...rest
       
  5994   } = __experimentalUseQuerySelect(query => {
       
  5995     if (!options.enabled) {
       
  5996       return {
       
  5997         data: []
       
  5998       };
       
  5999     }
       
  6000 
       
  6001     return query(store).getEntityRecords(kind, name, queryArgs);
       
  6002   }, [kind, name, queryAsString, options.enabled]);
       
  6003   return {
       
  6004     records,
       
  6005     ...rest
       
  6006   };
       
  6007 }
       
  6008 
       
  6009 ;// CONCATENATED MODULE: external ["wp","htmlEntities"]
       
  6010 var external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"];
       
  6011 ;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/fetch/__experimental-fetch-link-suggestions.js
       
  6012 /**
       
  6013  * WordPress dependencies
       
  6014  */
       
  6015 
       
  6016 
       
  6017 
       
  6018 
       
  6019 /**
       
  6020  * Filters the search by type
       
  6021  *
       
  6022  * @typedef { 'attachment' | 'post' | 'term' | 'post-format' } WPLinkSearchType
       
  6023  */
       
  6024 
       
  6025 /**
       
  6026  * A link with an id may be of kind post-type or taxonomy
       
  6027  *
       
  6028  * @typedef { 'post-type' | 'taxonomy' } WPKind
       
  6029  */
       
  6030 
       
  6031 /**
       
  6032  * @typedef WPLinkSearchOptions
       
  6033  *
       
  6034  * @property {boolean}          [isInitialSuggestions] Displays initial search suggestions, when true.
       
  6035  * @property {WPLinkSearchType} [type]                 Filters by search type.
       
  6036  * @property {string}           [subtype]              Slug of the post-type or taxonomy.
       
  6037  * @property {number}           [page]                 Which page of results to return.
       
  6038  * @property {number}           [perPage]              Search results per page.
       
  6039  */
       
  6040 
       
  6041 /**
       
  6042  * @typedef WPLinkSearchResult
       
  6043  *
       
  6044  * @property {number} id     Post or term id.
       
  6045  * @property {string} url    Link url.
       
  6046  * @property {string} title  Title of the link.
       
  6047  * @property {string} type   The taxonomy or post type slug or type URL.
       
  6048  * @property {WPKind} [kind] Link kind of post-type or taxonomy
       
  6049  */
       
  6050 
       
  6051 /**
       
  6052  * @typedef WPLinkSearchResultAugments
       
  6053  *
       
  6054  * @property {{kind: WPKind}} [meta]    Contains kind information.
       
  6055  * @property {WPKind}         [subtype] Optional subtype if it exists.
       
  6056  */
       
  6057 
       
  6058 /**
       
  6059  * @typedef {WPLinkSearchResult & WPLinkSearchResultAugments} WPLinkSearchResultAugmented
       
  6060  */
       
  6061 
       
  6062 /**
       
  6063  * @typedef WPEditorSettings
       
  6064  *
       
  6065  * @property {boolean} [ disablePostFormats ] Disables post formats, when true.
       
  6066  */
       
  6067 
       
  6068 /**
       
  6069  * Fetches link suggestions from the API.
       
  6070  *
       
  6071  * @async
       
  6072  * @param {string}              search
       
  6073  * @param {WPLinkSearchOptions} [searchOptions]
       
  6074  * @param {WPEditorSettings}    [settings]
       
  6075  *
       
  6076  * @example
       
  6077  * ```js
       
  6078  * import { __experimentalFetchLinkSuggestions as fetchLinkSuggestions } from '@wordpress/core-data';
       
  6079  *
       
  6080  * //...
       
  6081  *
       
  6082  * export function initialize( id, settings ) {
       
  6083  *
       
  6084  * settings.__experimentalFetchLinkSuggestions = (
       
  6085  *     search,
       
  6086  *     searchOptions
       
  6087  * ) => fetchLinkSuggestions( search, searchOptions, settings );
       
  6088  * ```
       
  6089  * @return {Promise< WPLinkSearchResult[] >} List of search suggestions
       
  6090  */
       
  6091 
       
  6092 const fetchLinkSuggestions = async function (search) {
       
  6093   let searchOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
       
  6094   let settings = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
       
  6095   const {
       
  6096     isInitialSuggestions = false,
       
  6097     type = undefined,
       
  6098     subtype = undefined,
       
  6099     page = undefined,
       
  6100     perPage = isInitialSuggestions ? 3 : 20
       
  6101   } = searchOptions;
       
  6102   const {
       
  6103     disablePostFormats = false
       
  6104   } = settings;
       
  6105   /** @type {Promise<WPLinkSearchResult>[]} */
       
  6106 
       
  6107   const queries = [];
       
  6108 
       
  6109   if (!type || type === 'post') {
       
  6110     queries.push(external_wp_apiFetch_default()({
       
  6111       path: (0,external_wp_url_namespaceObject.addQueryArgs)('/wp/v2/search', {
       
  6112         search,
       
  6113         page,
       
  6114         per_page: perPage,
       
  6115         type: 'post',
       
  6116         subtype
       
  6117       })
       
  6118     }).then(results => {
       
  6119       return results.map(result => {
       
  6120         return { ...result,
       
  6121           meta: {
       
  6122             kind: 'post-type',
       
  6123             subtype
       
  6124           }
       
  6125         };
       
  6126       });
       
  6127     }).catch(() => []) // Fail by returning no results.
       
  6128     );
       
  6129   }
       
  6130 
       
  6131   if (!type || type === 'term') {
       
  6132     queries.push(external_wp_apiFetch_default()({
       
  6133       path: (0,external_wp_url_namespaceObject.addQueryArgs)('/wp/v2/search', {
       
  6134         search,
       
  6135         page,
       
  6136         per_page: perPage,
       
  6137         type: 'term',
       
  6138         subtype
       
  6139       })
       
  6140     }).then(results => {
       
  6141       return results.map(result => {
       
  6142         return { ...result,
       
  6143           meta: {
       
  6144             kind: 'taxonomy',
       
  6145             subtype
       
  6146           }
       
  6147         };
       
  6148       });
       
  6149     }).catch(() => []) // Fail by returning no results.
       
  6150     );
       
  6151   }
       
  6152 
       
  6153   if (!disablePostFormats && (!type || type === 'post-format')) {
       
  6154     queries.push(external_wp_apiFetch_default()({
       
  6155       path: (0,external_wp_url_namespaceObject.addQueryArgs)('/wp/v2/search', {
       
  6156         search,
       
  6157         page,
       
  6158         per_page: perPage,
       
  6159         type: 'post-format',
       
  6160         subtype
       
  6161       })
       
  6162     }).then(results => {
       
  6163       return results.map(result => {
       
  6164         return { ...result,
       
  6165           meta: {
       
  6166             kind: 'taxonomy',
       
  6167             subtype
       
  6168           }
       
  6169         };
       
  6170       });
       
  6171     }).catch(() => []) // Fail by returning no results.
       
  6172     );
       
  6173   }
       
  6174 
       
  6175   if (!type || type === 'attachment') {
       
  6176     queries.push(external_wp_apiFetch_default()({
       
  6177       path: (0,external_wp_url_namespaceObject.addQueryArgs)('/wp/v2/media', {
       
  6178         search,
       
  6179         page,
       
  6180         per_page: perPage
       
  6181       })
       
  6182     }).then(results => {
       
  6183       return results.map(result => {
       
  6184         return { ...result,
       
  6185           meta: {
       
  6186             kind: 'media'
       
  6187           }
       
  6188         };
       
  6189       });
       
  6190     }).catch(() => []) // Fail by returning no results.
       
  6191     );
       
  6192   }
       
  6193 
       
  6194   return Promise.all(queries).then(results => {
       
  6195     return results.reduce((
       
  6196     /** @type {WPLinkSearchResult[]} */
       
  6197     accumulator, current) => accumulator.concat(current), // Flatten list.
       
  6198     []).filter(
       
  6199     /**
       
  6200      * @param {{ id: number }} result
       
  6201      */
       
  6202     result => {
       
  6203       return !!result.id;
       
  6204     }).slice(0, perPage).map((
       
  6205     /** @type {WPLinkSearchResultAugmented} */
       
  6206     result) => {
       
  6207       var _result$meta;
       
  6208 
       
  6209       const isMedia = result.type === 'attachment';
       
  6210       return {
       
  6211         id: result.id,
       
  6212         // @ts-ignore fix when we make this a TS file
       
  6213         url: isMedia ? result.source_url : result.url,
       
  6214         title: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(isMedia ? // @ts-ignore fix when we make this a TS file
       
  6215         result.title.rendered : result.title || '') || (0,external_wp_i18n_namespaceObject.__)('(no title)'),
       
  6216         type: result.subtype || result.type,
       
  6217         kind: result === null || result === void 0 ? void 0 : (_result$meta = result.meta) === null || _result$meta === void 0 ? void 0 : _result$meta.kind
       
  6218       };
       
  6219     });
       
  6220   });
       
  6221 };
       
  6222 
       
  6223 /* harmony default export */ var _experimental_fetch_link_suggestions = (fetchLinkSuggestions);
       
  6224 
       
  6225 ;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/fetch/__experimental-fetch-url-data.js
       
  6226 /**
       
  6227  * WordPress dependencies
       
  6228  */
       
  6229 
       
  6230 
       
  6231 /**
       
  6232  * A simple in-memory cache for requests.
       
  6233  * This avoids repeat HTTP requests which may be beneficial
       
  6234  * for those wishing to preserve low-bandwidth.
       
  6235  */
       
  6236 
       
  6237 const CACHE = new Map();
       
  6238 /**
       
  6239  * @typedef WPRemoteUrlData
       
  6240  *
       
  6241  * @property {string} title contents of the remote URL's `<title>` tag.
       
  6242  */
       
  6243 
       
  6244 /**
       
  6245  * Fetches data about a remote URL.
       
  6246  * eg: <title> tag, favicon...etc.
       
  6247  *
       
  6248  * @async
       
  6249  * @param {string}  url     the URL to request details from.
       
  6250  * @param {Object?} options any options to pass to the underlying fetch.
       
  6251  * @example
       
  6252  * ```js
       
  6253  * import { __experimentalFetchUrlData as fetchUrlData } from '@wordpress/core-data';
       
  6254  *
       
  6255  * //...
       
  6256  *
       
  6257  * export function initialize( id, settings ) {
       
  6258  *
       
  6259  * settings.__experimentalFetchUrlData = (
       
  6260  * url
       
  6261  * ) => fetchUrlData( url );
       
  6262  * ```
       
  6263  * @return {Promise< WPRemoteUrlData[] >} Remote URL data.
       
  6264  */
       
  6265 
       
  6266 const fetchUrlData = async function (url) {
       
  6267   let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
       
  6268   const endpoint = '/wp-block-editor/v1/url-details';
       
  6269   const args = {
       
  6270     url: (0,external_wp_url_namespaceObject.prependHTTP)(url)
       
  6271   };
       
  6272 
       
  6273   if (!(0,external_wp_url_namespaceObject.isURL)(url)) {
       
  6274     return Promise.reject(`${url} is not a valid URL.`);
       
  6275   } // Test for "http" based URL as it is possible for valid
       
  6276   // yet unusable URLs such as `tel:123456` to be passed.
       
  6277 
       
  6278 
       
  6279   const protocol = (0,external_wp_url_namespaceObject.getProtocol)(url);
       
  6280 
       
  6281   if (!protocol || !(0,external_wp_url_namespaceObject.isValidProtocol)(protocol) || !protocol.startsWith('http') || !/^https?:\/\/[^\/\s]/i.test(url)) {
       
  6282     return Promise.reject(`${url} does not have a valid protocol. URLs must be "http" based`);
       
  6283   }
       
  6284 
       
  6285   if (CACHE.has(url)) {
       
  6286     return CACHE.get(url);
       
  6287   }
       
  6288 
       
  6289   return external_wp_apiFetch_default()({
       
  6290     path: (0,external_wp_url_namespaceObject.addQueryArgs)(endpoint, args),
       
  6291     ...options
       
  6292   }).then(res => {
       
  6293     CACHE.set(url, res);
       
  6294     return res;
       
  6295   });
       
  6296 };
       
  6297 
       
  6298 /* harmony default export */ var _experimental_fetch_url_data = (fetchUrlData);
       
  6299 
       
  6300 ;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/fetch/index.js
       
  6301 
       
  6302 
       
  6303 
       
  6304 ;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/index.js
       
  6305 /**
       
  6306  * WordPress dependencies
       
  6307  */
       
  6308 
       
  6309 /**
       
  6310  * Internal dependencies
       
  6311  */
       
  6312 
       
  6313 
       
  6314 
       
  6315 
       
  6316 
       
  6317 
       
  6318 
       
  6319  // The entity selectors/resolvers and actions are shortcuts to their generic equivalents
       
  6320 // (getEntityRecord, getEntityRecords, updateEntityRecord, updateEntityRecords)
       
  6321 // Instead of getEntityRecord, the consumer could use more user-friendly named selector: getPostType, getTaxonomy...
       
  6322 // The "kind" and the "name" of the entity are combined to generate these shortcuts.
       
  6323 
       
  6324 const entitySelectors = rootEntitiesConfig.reduce((result, entity) => {
       
  6325   const {
       
  6326     kind,
       
  6327     name
       
  6328   } = entity;
       
  6329 
       
  6330   result[getMethodName(kind, name)] = (state, key, query) => getEntityRecord(state, kind, name, key, query);
       
  6331 
       
  6332   result[getMethodName(kind, name, 'get', true)] = (state, query) => getEntityRecords(state, kind, name, query);
       
  6333 
       
  6334   return result;
       
  6335 }, {});
       
  6336 const entityResolvers = rootEntitiesConfig.reduce((result, entity) => {
       
  6337   const {
       
  6338     kind,
       
  6339     name
       
  6340   } = entity;
       
  6341 
       
  6342   result[getMethodName(kind, name)] = (key, query) => resolvers_getEntityRecord(kind, name, key, query);
       
  6343 
       
  6344   const pluralMethodName = getMethodName(kind, name, 'get', true);
       
  6345 
       
  6346   result[pluralMethodName] = function () {
       
  6347     for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
       
  6348       args[_key] = arguments[_key];
       
  6349     }
       
  6350 
       
  6351     return resolvers_getEntityRecords(kind, name, ...args);
       
  6352   };
       
  6353 
       
  6354   result[pluralMethodName].shouldInvalidate = action => resolvers_getEntityRecords.shouldInvalidate(action, kind, name);
       
  6355 
       
  6356   return result;
       
  6357 }, {});
       
  6358 const entityActions = rootEntitiesConfig.reduce((result, entity) => {
       
  6359   const {
       
  6360     kind,
       
  6361     name
       
  6362   } = entity;
       
  6363 
       
  6364   result[getMethodName(kind, name, 'save')] = key => saveEntityRecord(kind, name, key);
       
  6365 
       
  6366   result[getMethodName(kind, name, 'delete')] = (key, query) => deleteEntityRecord(kind, name, key, query);
       
  6367 
       
  6368   return result;
       
  6369 }, {});
       
  6370 
       
  6371 const storeConfig = () => ({
       
  6372   reducer: build_module_reducer,
       
  6373   actions: { ...build_module_actions_namespaceObject,
       
  6374     ...entityActions,
       
  6375     ...createLocksActions()
       
  6376   },
       
  6377   selectors: { ...build_module_selectors_namespaceObject,
       
  6378     ...entitySelectors
       
  6379   },
       
  6380   resolvers: { ...resolvers_namespaceObject,
       
  6381     ...entityResolvers
       
  6382   }
       
  6383 });
       
  6384 /**
       
  6385  * Store definition for the code data namespace.
       
  6386  *
       
  6387  * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
       
  6388  *
       
  6389  * @type {Object}
       
  6390  */
       
  6391 
       
  6392 
       
  6393 const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, storeConfig());
       
  6394 (0,external_wp_data_namespaceObject.register)(store);
       
  6395 
       
  6396 
       
  6397 
       
  6398 
       
  6399 
       
  6400 
       
  6401 
       
  6402 }();
       
  6403 (window.wp = window.wp || {}).coreData = __webpack_exports__;
       
  6404 /******/ })()
       
  6405 ;