[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/js/dist/ -> core-data.js (source)

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


Generated: Mon Apr 19 01:00:04 2021 Cross-referenced by PHPXref 0.7.1