[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/js/dist/ -> editor.js (source)

   1  this["wp"] = this["wp"] || {}; this["wp"]["editor"] =
   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 = 422);
  86  /******/ })
  87  /************************************************************************/
  88  /******/ ({
  89  
  90  /***/ 0:
  91  /***/ (function(module, exports) {
  92  
  93  (function() { module.exports = this["wp"]["element"]; }());
  94  
  95  /***/ }),
  96  
  97  /***/ 1:
  98  /***/ (function(module, exports) {
  99  
 100  (function() { module.exports = this["wp"]["i18n"]; }());
 101  
 102  /***/ }),
 103  
 104  /***/ 10:
 105  /***/ (function(module, exports) {
 106  
 107  (function() { module.exports = this["wp"]["blocks"]; }());
 108  
 109  /***/ }),
 110  
 111  /***/ 11:
 112  /***/ (function(module, exports, __webpack_require__) {
 113  
 114  var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
 115    Copyright (c) 2017 Jed Watson.
 116    Licensed under the MIT License (MIT), see
 117    http://jedwatson.github.io/classnames
 118  */
 119  /* global define */
 120  
 121  (function () {
 122      'use strict';
 123  
 124      var hasOwn = {}.hasOwnProperty;
 125  
 126  	function classNames () {
 127          var classes = [];
 128  
 129          for (var i = 0; i < arguments.length; i++) {
 130              var arg = arguments[i];
 131              if (!arg) continue;
 132  
 133              var argType = typeof arg;
 134  
 135              if (argType === 'string' || argType === 'number') {
 136                  classes.push(arg);
 137              } else if (Array.isArray(arg) && arg.length) {
 138                  var inner = classNames.apply(null, arg);
 139                  if (inner) {
 140                      classes.push(inner);
 141                  }
 142              } else if (argType === 'object') {
 143                  for (var key in arg) {
 144                      if (hasOwn.call(arg, key) && arg[key]) {
 145                          classes.push(key);
 146                      }
 147                  }
 148              }
 149          }
 150  
 151          return classes.join(' ');
 152      }
 153  
 154      if ( true && module.exports) {
 155          classNames.default = classNames;
 156          module.exports = classNames;
 157      } else if (true) {
 158          // register as 'classnames', consistent with npm package name
 159          !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
 160              return classNames;
 161          }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
 162                  __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
 163      } else {}
 164  }());
 165  
 166  
 167  /***/ }),
 168  
 169  /***/ 115:
 170  /***/ (function(module, exports, __webpack_require__) {
 171  
 172  module.exports = __webpack_require__(405);
 173  
 174  
 175  /***/ }),
 176  
 177  /***/ 118:
 178  /***/ (function(module, exports, __webpack_require__) {
 179  
 180  "use strict";
 181  /**
 182   * Copyright (c) 2013-present, Facebook, Inc.
 183   *
 184   * This source code is licensed under the MIT license found in the
 185   * LICENSE file in the root directory of this source tree.
 186   */
 187  
 188  
 189  
 190  var ReactPropTypesSecret = __webpack_require__(119);
 191  
 192  function emptyFunction() {}
 193  function emptyFunctionWithReset() {}
 194  emptyFunctionWithReset.resetWarningCache = emptyFunction;
 195  
 196  module.exports = function() {
 197    function shim(props, propName, componentName, location, propFullName, secret) {
 198      if (secret === ReactPropTypesSecret) {
 199        // It is still safe when called from React.
 200        return;
 201      }
 202      var err = new Error(
 203        'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
 204        'Use PropTypes.checkPropTypes() to call them. ' +
 205        'Read more at http://fb.me/use-check-prop-types'
 206      );
 207      err.name = 'Invariant Violation';
 208      throw err;
 209    };
 210    shim.isRequired = shim;
 211    function getShim() {
 212      return shim;
 213    };
 214    // Important!
 215    // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
 216    var ReactPropTypes = {
 217      array: shim,
 218      bool: shim,
 219      func: shim,
 220      number: shim,
 221      object: shim,
 222      string: shim,
 223      symbol: shim,
 224  
 225      any: shim,
 226      arrayOf: getShim,
 227      element: shim,
 228      elementType: shim,
 229      instanceOf: getShim,
 230      node: shim,
 231      objectOf: getShim,
 232      oneOf: getShim,
 233      oneOfType: getShim,
 234      shape: getShim,
 235      exact: getShim,
 236  
 237      checkPropTypes: emptyFunctionWithReset,
 238      resetWarningCache: emptyFunction
 239    };
 240  
 241    ReactPropTypes.PropTypes = ReactPropTypes;
 242  
 243    return ReactPropTypes;
 244  };
 245  
 246  
 247  /***/ }),
 248  
 249  /***/ 119:
 250  /***/ (function(module, exports, __webpack_require__) {
 251  
 252  "use strict";
 253  /**
 254   * Copyright (c) 2013-present, Facebook, Inc.
 255   *
 256   * This source code is licensed under the MIT license found in the
 257   * LICENSE file in the root directory of this source tree.
 258   */
 259  
 260  
 261  
 262  var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
 263  
 264  module.exports = ReactPropTypesSecret;
 265  
 266  
 267  /***/ }),
 268  
 269  /***/ 12:
 270  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 271  
 272  "use strict";
 273  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _extends; });
 274  function _extends() {
 275    _extends = Object.assign || function (target) {
 276      for (var i = 1; i < arguments.length; i++) {
 277        var source = arguments[i];
 278  
 279        for (var key in source) {
 280          if (Object.prototype.hasOwnProperty.call(source, key)) {
 281            target[key] = source[key];
 282          }
 283        }
 284      }
 285  
 286      return target;
 287    };
 288  
 289    return _extends.apply(this, arguments);
 290  }
 291  
 292  /***/ }),
 293  
 294  /***/ 120:
 295  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 296  
 297  "use strict";
 298  /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
 299  /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
 300  /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9);
 301  /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
 302  
 303  
 304  /**
 305   * WordPress dependencies
 306   */
 307  
 308  var close = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
 309    xmlns: "http://www.w3.org/2000/svg",
 310    viewBox: "-2 -2 24 24"
 311  }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], {
 312    d: "M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"
 313  }));
 314  /* harmony default export */ __webpack_exports__["a"] = (close);
 315  
 316  
 317  /***/ }),
 318  
 319  /***/ 128:
 320  /***/ (function(module, exports) {
 321  
 322  (function() { module.exports = this["wp"]["wordcount"]; }());
 323  
 324  /***/ }),
 325  
 326  /***/ 13:
 327  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 328  
 329  "use strict";
 330  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _createClass; });
 331  function _defineProperties(target, props) {
 332    for (var i = 0; i < props.length; i++) {
 333      var descriptor = props[i];
 334      descriptor.enumerable = descriptor.enumerable || false;
 335      descriptor.configurable = true;
 336      if ("value" in descriptor) descriptor.writable = true;
 337      Object.defineProperty(target, descriptor.key, descriptor);
 338    }
 339  }
 340  
 341  function _createClass(Constructor, protoProps, staticProps) {
 342    if (protoProps) _defineProperties(Constructor.prototype, protoProps);
 343    if (staticProps) _defineProperties(Constructor, staticProps);
 344    return Constructor;
 345  }
 346  
 347  /***/ }),
 348  
 349  /***/ 130:
 350  /***/ (function(module, exports) {
 351  
 352  (function() { module.exports = this["wp"]["mediaUtils"]; }());
 353  
 354  /***/ }),
 355  
 356  /***/ 14:
 357  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 358  
 359  "use strict";
 360  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _classCallCheck; });
 361  function _classCallCheck(instance, Constructor) {
 362    if (!(instance instanceof Constructor)) {
 363      throw new TypeError("Cannot call a class as a function");
 364    }
 365  }
 366  
 367  /***/ }),
 368  
 369  /***/ 15:
 370  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 371  
 372  "use strict";
 373  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _possibleConstructorReturn; });
 374  /* harmony import */ var _helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(34);
 375  /* harmony import */ var _assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7);
 376  
 377  
 378  function _possibleConstructorReturn(self, call) {
 379    if (call && (Object(_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(call) === "object" || typeof call === "function")) {
 380      return call;
 381    }
 382  
 383    return Object(_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(self);
 384  }
 385  
 386  /***/ }),
 387  
 388  /***/ 152:
 389  /***/ (function(module, exports, __webpack_require__) {
 390  
 391  "use strict";
 392  
 393  var __extends = (this && this.__extends) || (function () {
 394      var extendStatics = Object.setPrototypeOf ||
 395          ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
 396          function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
 397      return function (d, b) {
 398          extendStatics(d, b);
 399          function __() { this.constructor = d; }
 400          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
 401      };
 402  })();
 403  var __assign = (this && this.__assign) || Object.assign || function(t) {
 404      for (var s, i = 1, n = arguments.length; i < n; i++) {
 405          s = arguments[i];
 406          for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
 407              t[p] = s[p];
 408      }
 409      return t;
 410  };
 411  var __rest = (this && this.__rest) || function (s, e) {
 412      var t = {};
 413      for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
 414          t[p] = s[p];
 415      if (s != null && typeof Object.getOwnPropertySymbols === "function")
 416          for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
 417              t[p[i]] = s[p[i]];
 418      return t;
 419  };
 420  exports.__esModule = true;
 421  var React = __webpack_require__(21);
 422  var PropTypes = __webpack_require__(26);
 423  var autosize = __webpack_require__(153);
 424  var _getLineHeight = __webpack_require__(154);
 425  var getLineHeight = _getLineHeight;
 426  var UPDATE = 'autosize:update';
 427  var DESTROY = 'autosize:destroy';
 428  var RESIZED = 'autosize:resized';
 429  /**
 430   * A light replacement for built-in textarea component
 431   * which automaticaly adjusts its height to match the content
 432   */
 433  var TextareaAutosize = /** @class */ (function (_super) {
 434      __extends(TextareaAutosize, _super);
 435      function TextareaAutosize() {
 436          var _this = _super !== null && _super.apply(this, arguments) || this;
 437          _this.state = {
 438              lineHeight: null
 439          };
 440          _this.dispatchEvent = function (EVENT_TYPE) {
 441              var event = document.createEvent('Event');
 442              event.initEvent(EVENT_TYPE, true, false);
 443              _this.textarea.dispatchEvent(event);
 444          };
 445          _this.updateLineHeight = function () {
 446              _this.setState({
 447                  lineHeight: getLineHeight(_this.textarea)
 448              });
 449          };
 450          _this.onChange = function (e) {
 451              var onChange = _this.props.onChange;
 452              _this.currentValue = e.currentTarget.value;
 453              onChange && onChange(e);
 454          };
 455          _this.saveDOMNodeRef = function (ref) {
 456              var innerRef = _this.props.innerRef;
 457              if (innerRef) {
 458                  innerRef(ref);
 459              }
 460              _this.textarea = ref;
 461          };
 462          _this.getLocals = function () {
 463              var _a = _this, _b = _a.props, onResize = _b.onResize, maxRows = _b.maxRows, onChange = _b.onChange, style = _b.style, innerRef = _b.innerRef, props = __rest(_b, ["onResize", "maxRows", "onChange", "style", "innerRef"]), lineHeight = _a.state.lineHeight, saveDOMNodeRef = _a.saveDOMNodeRef;
 464              var maxHeight = maxRows && lineHeight ? lineHeight * maxRows : null;
 465              return __assign({}, props, { saveDOMNodeRef: saveDOMNodeRef, style: maxHeight ? __assign({}, style, { maxHeight: maxHeight }) : style, onChange: _this.onChange });
 466          };
 467          return _this;
 468      }
 469      TextareaAutosize.prototype.componentDidMount = function () {
 470          var _this = this;
 471          var _a = this.props, onResize = _a.onResize, maxRows = _a.maxRows;
 472          if (typeof maxRows === 'number') {
 473              this.updateLineHeight();
 474          }
 475          /*
 476            the defer is needed to:
 477              - force "autosize" to activate the scrollbar when this.props.maxRows is passed
 478              - support StyledComponents (see #71)
 479          */
 480          setTimeout(function () { return autosize(_this.textarea); });
 481          if (onResize) {
 482              this.textarea.addEventListener(RESIZED, onResize);
 483          }
 484      };
 485      TextareaAutosize.prototype.componentWillUnmount = function () {
 486          var onResize = this.props.onResize;
 487          if (onResize) {
 488              this.textarea.removeEventListener(RESIZED, onResize);
 489          }
 490          this.dispatchEvent(DESTROY);
 491      };
 492      TextareaAutosize.prototype.render = function () {
 493          var _a = this.getLocals(), children = _a.children, saveDOMNodeRef = _a.saveDOMNodeRef, locals = __rest(_a, ["children", "saveDOMNodeRef"]);
 494          return (React.createElement("textarea", __assign({}, locals, { ref: saveDOMNodeRef }), children));
 495      };
 496      TextareaAutosize.prototype.componentDidUpdate = function (prevProps) {
 497          if (this.props.value !== this.currentValue || this.props.rows !== prevProps.rows) {
 498              this.dispatchEvent(UPDATE);
 499          }
 500      };
 501      TextareaAutosize.defaultProps = {
 502          rows: 1
 503      };
 504      TextareaAutosize.propTypes = {
 505          rows: PropTypes.number,
 506          maxRows: PropTypes.number,
 507          onResize: PropTypes.func,
 508          innerRef: PropTypes.func
 509      };
 510      return TextareaAutosize;
 511  }(React.Component));
 512  exports["default"] = TextareaAutosize;
 513  
 514  
 515  /***/ }),
 516  
 517  /***/ 153:
 518  /***/ (function(module, exports, __webpack_require__) {
 519  
 520  var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
 521      autosize 4.0.2
 522      license: MIT
 523      http://www.jacklmoore.com/autosize
 524  */
 525  (function (global, factory) {
 526      if (true) {
 527          !(__WEBPACK_AMD_DEFINE_ARRAY__ = [module, exports], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
 528                  __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
 529                  (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
 530                  __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
 531      } else { var mod; }
 532  })(this, function (module, exports) {
 533      'use strict';
 534  
 535      var map = typeof Map === "function" ? new Map() : function () {
 536          var keys = [];
 537          var values = [];
 538  
 539          return {
 540              has: function has(key) {
 541                  return keys.indexOf(key) > -1;
 542              },
 543              get: function get(key) {
 544                  return values[keys.indexOf(key)];
 545              },
 546              set: function set(key, value) {
 547                  if (keys.indexOf(key) === -1) {
 548                      keys.push(key);
 549                      values.push(value);
 550                  }
 551              },
 552              delete: function _delete(key) {
 553                  var index = keys.indexOf(key);
 554                  if (index > -1) {
 555                      keys.splice(index, 1);
 556                      values.splice(index, 1);
 557                  }
 558              }
 559          };
 560      }();
 561  
 562      var createEvent = function createEvent(name) {
 563          return new Event(name, { bubbles: true });
 564      };
 565      try {
 566          new Event('test');
 567      } catch (e) {
 568          // IE does not support `new Event()`
 569          createEvent = function createEvent(name) {
 570              var evt = document.createEvent('Event');
 571              evt.initEvent(name, true, false);
 572              return evt;
 573          };
 574      }
 575  
 576  	function assign(ta) {
 577          if (!ta || !ta.nodeName || ta.nodeName !== 'TEXTAREA' || map.has(ta)) return;
 578  
 579          var heightOffset = null;
 580          var clientWidth = null;
 581          var cachedHeight = null;
 582  
 583  		function init() {
 584              var style = window.getComputedStyle(ta, null);
 585  
 586              if (style.resize === 'vertical') {
 587                  ta.style.resize = 'none';
 588              } else if (style.resize === 'both') {
 589                  ta.style.resize = 'horizontal';
 590              }
 591  
 592              if (style.boxSizing === 'content-box') {
 593                  heightOffset = -(parseFloat(style.paddingTop) + parseFloat(style.paddingBottom));
 594              } else {
 595                  heightOffset = parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth);
 596              }
 597              // Fix when a textarea is not on document body and heightOffset is Not a Number
 598              if (isNaN(heightOffset)) {
 599                  heightOffset = 0;
 600              }
 601  
 602              update();
 603          }
 604  
 605  		function changeOverflow(value) {
 606              {
 607                  // Chrome/Safari-specific fix:
 608                  // When the textarea y-overflow is hidden, Chrome/Safari do not reflow the text to account for the space
 609                  // made available by removing the scrollbar. The following forces the necessary text reflow.
 610                  var width = ta.style.width;
 611                  ta.style.width = '0px';
 612                  // Force reflow:
 613                  /* jshint ignore:start */
 614                  ta.offsetWidth;
 615                  /* jshint ignore:end */
 616                  ta.style.width = width;
 617              }
 618  
 619              ta.style.overflowY = value;
 620          }
 621  
 622  		function getParentOverflows(el) {
 623              var arr = [];
 624  
 625              while (el && el.parentNode && el.parentNode instanceof Element) {
 626                  if (el.parentNode.scrollTop) {
 627                      arr.push({
 628                          node: el.parentNode,
 629                          scrollTop: el.parentNode.scrollTop
 630                      });
 631                  }
 632                  el = el.parentNode;
 633              }
 634  
 635              return arr;
 636          }
 637  
 638  		function resize() {
 639              if (ta.scrollHeight === 0) {
 640                  // If the scrollHeight is 0, then the element probably has display:none or is detached from the DOM.
 641                  return;
 642              }
 643  
 644              var overflows = getParentOverflows(ta);
 645              var docTop = document.documentElement && document.documentElement.scrollTop; // Needed for Mobile IE (ticket #240)
 646  
 647              ta.style.height = '';
 648              ta.style.height = ta.scrollHeight + heightOffset + 'px';
 649  
 650              // used to check if an update is actually necessary on window.resize
 651              clientWidth = ta.clientWidth;
 652  
 653              // prevents scroll-position jumping
 654              overflows.forEach(function (el) {
 655                  el.node.scrollTop = el.scrollTop;
 656              });
 657  
 658              if (docTop) {
 659                  document.documentElement.scrollTop = docTop;
 660              }
 661          }
 662  
 663  		function update() {
 664              resize();
 665  
 666              var styleHeight = Math.round(parseFloat(ta.style.height));
 667              var computed = window.getComputedStyle(ta, null);
 668  
 669              // Using offsetHeight as a replacement for computed.height in IE, because IE does not account use of border-box
 670              var actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(computed.height)) : ta.offsetHeight;
 671  
 672              // The actual height not matching the style height (set via the resize method) indicates that 
 673              // the max-height has been exceeded, in which case the overflow should be allowed.
 674              if (actualHeight < styleHeight) {
 675                  if (computed.overflowY === 'hidden') {
 676                      changeOverflow('scroll');
 677                      resize();
 678                      actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(window.getComputedStyle(ta, null).height)) : ta.offsetHeight;
 679                  }
 680              } else {
 681                  // Normally keep overflow set to hidden, to avoid flash of scrollbar as the textarea expands.
 682                  if (computed.overflowY !== 'hidden') {
 683                      changeOverflow('hidden');
 684                      resize();
 685                      actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(window.getComputedStyle(ta, null).height)) : ta.offsetHeight;
 686                  }
 687              }
 688  
 689              if (cachedHeight !== actualHeight) {
 690                  cachedHeight = actualHeight;
 691                  var evt = createEvent('autosize:resized');
 692                  try {
 693                      ta.dispatchEvent(evt);
 694                  } catch (err) {
 695                      // Firefox will throw an error on dispatchEvent for a detached element
 696                      // https://bugzilla.mozilla.org/show_bug.cgi?id=889376
 697                  }
 698              }
 699          }
 700  
 701          var pageResize = function pageResize() {
 702              if (ta.clientWidth !== clientWidth) {
 703                  update();
 704              }
 705          };
 706  
 707          var destroy = function (style) {
 708              window.removeEventListener('resize', pageResize, false);
 709              ta.removeEventListener('input', update, false);
 710              ta.removeEventListener('keyup', update, false);
 711              ta.removeEventListener('autosize:destroy', destroy, false);
 712              ta.removeEventListener('autosize:update', update, false);
 713  
 714              Object.keys(style).forEach(function (key) {
 715                  ta.style[key] = style[key];
 716              });
 717  
 718              map.delete(ta);
 719          }.bind(ta, {
 720              height: ta.style.height,
 721              resize: ta.style.resize,
 722              overflowY: ta.style.overflowY,
 723              overflowX: ta.style.overflowX,
 724              wordWrap: ta.style.wordWrap
 725          });
 726  
 727          ta.addEventListener('autosize:destroy', destroy, false);
 728  
 729          // IE9 does not fire onpropertychange or oninput for deletions,
 730          // so binding to onkeyup to catch most of those events.
 731          // There is no way that I know of to detect something like 'cut' in IE9.
 732          if ('onpropertychange' in ta && 'oninput' in ta) {
 733              ta.addEventListener('keyup', update, false);
 734          }
 735  
 736          window.addEventListener('resize', pageResize, false);
 737          ta.addEventListener('input', update, false);
 738          ta.addEventListener('autosize:update', update, false);
 739          ta.style.overflowX = 'hidden';
 740          ta.style.wordWrap = 'break-word';
 741  
 742          map.set(ta, {
 743              destroy: destroy,
 744              update: update
 745          });
 746  
 747          init();
 748      }
 749  
 750  	function destroy(ta) {
 751          var methods = map.get(ta);
 752          if (methods) {
 753              methods.destroy();
 754          }
 755      }
 756  
 757  	function update(ta) {
 758          var methods = map.get(ta);
 759          if (methods) {
 760              methods.update();
 761          }
 762      }
 763  
 764      var autosize = null;
 765  
 766      // Do nothing in Node.js environment and IE8 (or lower)
 767      if (typeof window === 'undefined' || typeof window.getComputedStyle !== 'function') {
 768          autosize = function autosize(el) {
 769              return el;
 770          };
 771          autosize.destroy = function (el) {
 772              return el;
 773          };
 774          autosize.update = function (el) {
 775              return el;
 776          };
 777      } else {
 778          autosize = function autosize(el, options) {
 779              if (el) {
 780                  Array.prototype.forEach.call(el.length ? el : [el], function (x) {
 781                      return assign(x, options);
 782                  });
 783              }
 784              return el;
 785          };
 786          autosize.destroy = function (el) {
 787              if (el) {
 788                  Array.prototype.forEach.call(el.length ? el : [el], destroy);
 789              }
 790              return el;
 791          };
 792          autosize.update = function (el) {
 793              if (el) {
 794                  Array.prototype.forEach.call(el.length ? el : [el], update);
 795              }
 796              return el;
 797          };
 798      }
 799  
 800      exports.default = autosize;
 801      module.exports = exports['default'];
 802  });
 803  
 804  /***/ }),
 805  
 806  /***/ 154:
 807  /***/ (function(module, exports, __webpack_require__) {
 808  
 809  // Load in dependencies
 810  var computedStyle = __webpack_require__(155);
 811  
 812  /**
 813   * Calculate the `line-height` of a given node
 814   * @param {HTMLElement} node Element to calculate line height of. Must be in the DOM.
 815   * @returns {Number} `line-height` of the element in pixels
 816   */
 817  function lineHeight(node) {
 818    // Grab the line-height via style
 819    var lnHeightStr = computedStyle(node, 'line-height');
 820    var lnHeight = parseFloat(lnHeightStr, 10);
 821  
 822    // If the lineHeight did not contain a unit (i.e. it was numeric), convert it to ems (e.g. '2.3' === '2.3em')
 823    if (lnHeightStr === lnHeight + '') {
 824      // Save the old lineHeight style and update the em unit to the element
 825      var _lnHeightStyle = node.style.lineHeight;
 826      node.style.lineHeight = lnHeightStr + 'em';
 827  
 828      // Calculate the em based height
 829      lnHeightStr = computedStyle(node, 'line-height');
 830      lnHeight = parseFloat(lnHeightStr, 10);
 831  
 832      // Revert the lineHeight style
 833      if (_lnHeightStyle) {
 834        node.style.lineHeight = _lnHeightStyle;
 835      } else {
 836        delete node.style.lineHeight;
 837      }
 838    }
 839  
 840    // If the lineHeight is in `pt`, convert it to pixels (4px for 3pt)
 841    // DEV: `em` units are converted to `pt` in IE6
 842    // Conversion ratio from https://developer.mozilla.org/en-US/docs/Web/CSS/length
 843    if (lnHeightStr.indexOf('pt') !== -1) {
 844      lnHeight *= 4;
 845      lnHeight /= 3;
 846    // Otherwise, if the lineHeight is in `mm`, convert it to pixels (96px for 25.4mm)
 847    } else if (lnHeightStr.indexOf('mm') !== -1) {
 848      lnHeight *= 96;
 849      lnHeight /= 25.4;
 850    // Otherwise, if the lineHeight is in `cm`, convert it to pixels (96px for 2.54cm)
 851    } else if (lnHeightStr.indexOf('cm') !== -1) {
 852      lnHeight *= 96;
 853      lnHeight /= 2.54;
 854    // Otherwise, if the lineHeight is in `in`, convert it to pixels (96px for 1in)
 855    } else if (lnHeightStr.indexOf('in') !== -1) {
 856      lnHeight *= 96;
 857    // Otherwise, if the lineHeight is in `pc`, convert it to pixels (12pt for 1pc)
 858    } else if (lnHeightStr.indexOf('pc') !== -1) {
 859      lnHeight *= 16;
 860    }
 861  
 862    // Continue our computation
 863    lnHeight = Math.round(lnHeight);
 864  
 865    // If the line-height is "normal", calculate by font-size
 866    if (lnHeightStr === 'normal') {
 867      // Create a temporary node
 868      var nodeName = node.nodeName;
 869      var _node = document.createElement(nodeName);
 870      _node.innerHTML = '&nbsp;';
 871  
 872      // If we have a text area, reset it to only 1 row
 873      // https://github.com/twolfson/line-height/issues/4
 874      if (nodeName.toUpperCase() === 'TEXTAREA') {
 875        _node.setAttribute('rows', '1');
 876      }
 877  
 878      // Set the font-size of the element
 879      var fontSizeStr = computedStyle(node, 'font-size');
 880      _node.style.fontSize = fontSizeStr;
 881  
 882      // Remove default padding/border which can affect offset height
 883      // https://github.com/twolfson/line-height/issues/4
 884      // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetHeight
 885      _node.style.padding = '0px';
 886      _node.style.border = '0px';
 887  
 888      // Append it to the body
 889      var body = document.body;
 890      body.appendChild(_node);
 891  
 892      // Assume the line height of the element is the height
 893      var height = _node.offsetHeight;
 894      lnHeight = height;
 895  
 896      // Remove our child from the DOM
 897      body.removeChild(_node);
 898    }
 899  
 900    // Return the calculated height
 901    return lnHeight;
 902  }
 903  
 904  // Export lineHeight
 905  module.exports = lineHeight;
 906  
 907  
 908  /***/ }),
 909  
 910  /***/ 155:
 911  /***/ (function(module, exports) {
 912  
 913  // This code has been refactored for 140 bytes
 914  // You can see the original here: https://github.com/twolfson/computedStyle/blob/04cd1da2e30fa45844f95f5cb1ac898e9b9ef050/lib/computedStyle.js
 915  var computedStyle = function (el, prop, getComputedStyle) {
 916    getComputedStyle = window.getComputedStyle;
 917  
 918    // In one fell swoop
 919    return (
 920      // If we have getComputedStyle
 921      getComputedStyle ?
 922        // Query it
 923        // TODO: From CSS-Query notes, we might need (node, null) for FF
 924        getComputedStyle(el) :
 925  
 926      // Otherwise, we are in IE and use currentStyle
 927        el.currentStyle
 928    )[
 929      // Switch to camelCase for CSSOM
 930      // DEV: Grabbed from jQuery
 931      // https://github.com/jquery/jquery/blob/1.9-stable/src/css.js#L191-L194
 932      // https://github.com/jquery/jquery/blob/1.9-stable/src/core.js#L593-L597
 933      prop.replace(/-(\w)/gi, function (word, letter) {
 934        return letter.toUpperCase();
 935      })
 936    ];
 937  };
 938  
 939  module.exports = computedStyle;
 940  
 941  
 942  /***/ }),
 943  
 944  /***/ 159:
 945  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 946  
 947  "use strict";
 948  /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
 949  /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
 950  /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9);
 951  /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
 952  
 953  
 954  /**
 955   * WordPress dependencies
 956   */
 957  
 958  var link = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
 959    xmlns: "http://www.w3.org/2000/svg",
 960    viewBox: "-2 -2 24 24"
 961  }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], {
 962    d: "M17.74 2.76c1.68 1.69 1.68 4.41 0 6.1l-1.53 1.52c-1.12 1.12-2.7 1.47-4.14 1.09l2.62-2.61.76-.77.76-.76c.84-.84.84-2.2 0-3.04-.84-.85-2.2-.85-3.04 0l-.77.76-3.38 3.38c-.37-1.44-.02-3.02 1.1-4.14l1.52-1.53c1.69-1.68 4.42-1.68 6.1 0zM8.59 13.43l5.34-5.34c.42-.42.42-1.1 0-1.52-.44-.43-1.13-.39-1.53 0l-5.33 5.34c-.42.42-.42 1.1 0 1.52.44.43 1.13.39 1.52 0zm-.76 2.29l4.14-4.15c.38 1.44.03 3.02-1.09 4.14l-1.52 1.53c-1.69 1.68-4.41 1.68-6.1 0-1.68-1.68-1.68-4.42 0-6.1l1.53-1.52c1.12-1.12 2.7-1.47 4.14-1.1l-4.14 4.15c-.85.84-.85 2.2 0 3.05.84.84 2.2.84 3.04 0z"
 963  }));
 964  /* harmony default export */ __webpack_exports__["a"] = (link);
 965  
 966  
 967  /***/ }),
 968  
 969  /***/ 16:
 970  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 971  
 972  "use strict";
 973  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _getPrototypeOf; });
 974  function _getPrototypeOf(o) {
 975    _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
 976      return o.__proto__ || Object.getPrototypeOf(o);
 977    };
 978    return _getPrototypeOf(o);
 979  }
 980  
 981  /***/ }),
 982  
 983  /***/ 17:
 984  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 985  
 986  "use strict";
 987  
 988  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
 989  function _setPrototypeOf(o, p) {
 990    _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
 991      o.__proto__ = p;
 992      return o;
 993    };
 994  
 995    return _setPrototypeOf(o, p);
 996  }
 997  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js
 998  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _inherits; });
 999  
1000  function _inherits(subClass, superClass) {
1001    if (typeof superClass !== "function" && superClass !== null) {
1002      throw new TypeError("Super expression must either be null or a function");
1003    }
1004  
1005    subClass.prototype = Object.create(superClass && superClass.prototype, {
1006      constructor: {
1007        value: subClass,
1008        writable: true,
1009        configurable: true
1010      }
1011    });
1012    if (superClass) _setPrototypeOf(subClass, superClass);
1013  }
1014  
1015  /***/ }),
1016  
1017  /***/ 18:
1018  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1019  
1020  "use strict";
1021  
1022  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
1023  var arrayLikeToArray = __webpack_require__(25);
1024  
1025  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
1026  
1027  function _arrayWithoutHoles(arr) {
1028    if (Array.isArray(arr)) return Object(arrayLikeToArray["a" /* default */])(arr);
1029  }
1030  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
1031  var iterableToArray = __webpack_require__(35);
1032  
1033  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
1034  var unsupportedIterableToArray = __webpack_require__(27);
1035  
1036  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
1037  function _nonIterableSpread() {
1038    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1039  }
1040  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
1041  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _toConsumableArray; });
1042  
1043  
1044  
1045  
1046  function _toConsumableArray(arr) {
1047    return _arrayWithoutHoles(arr) || Object(iterableToArray["a" /* default */])(arr) || Object(unsupportedIterableToArray["a" /* default */])(arr) || _nonIterableSpread();
1048  }
1049  
1050  /***/ }),
1051  
1052  /***/ 182:
1053  /***/ (function(module, exports) {
1054  
1055  (function() { module.exports = this["wp"]["notices"]; }());
1056  
1057  /***/ }),
1058  
1059  /***/ 19:
1060  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1061  
1062  "use strict";
1063  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectWithoutProperties; });
1064  /* harmony import */ var _objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(43);
1065  
1066  function _objectWithoutProperties(source, excluded) {
1067    if (source == null) return {};
1068    var target = Object(_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(source, excluded);
1069    var key, i;
1070  
1071    if (Object.getOwnPropertySymbols) {
1072      var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
1073  
1074      for (i = 0; i < sourceSymbolKeys.length; i++) {
1075        key = sourceSymbolKeys[i];
1076        if (excluded.indexOf(key) >= 0) continue;
1077        if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
1078        target[key] = source[key];
1079      }
1080    }
1081  
1082    return target;
1083  }
1084  
1085  /***/ }),
1086  
1087  /***/ 191:
1088  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1089  
1090  "use strict";
1091  /* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5);
1092  /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(19);
1093  /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(0);
1094  /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
1095  
1096  
1097  
1098  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; }
1099  
1100  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(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(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; }
1101  
1102  /**
1103   * WordPress dependencies
1104   */
1105  
1106  
1107  function Icon(_ref) {
1108    var icon = _ref.icon,
1109        _ref$size = _ref.size,
1110        size = _ref$size === void 0 ? 24 : _ref$size,
1111        props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(_ref, ["icon", "size"]);
1112  
1113    return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["cloneElement"])(icon, _objectSpread({
1114      width: size,
1115      height: size
1116    }, props));
1117  }
1118  
1119  /* harmony default export */ __webpack_exports__["a"] = (Icon);
1120  
1121  
1122  /***/ }),
1123  
1124  /***/ 193:
1125  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1126  
1127  "use strict";
1128  /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
1129  /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
1130  /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9);
1131  /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
1132  
1133  
1134  /**
1135   * WordPress dependencies
1136   */
1137  
1138  var check = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
1139    xmlns: "http://www.w3.org/2000/svg",
1140    viewBox: "-2 -2 24 24"
1141  }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], {
1142    d: "M15.3 5.3l-6.8 6.8-2.8-2.8-1.4 1.4 4.2 4.2 8.2-8.2"
1143  }));
1144  /* harmony default export */ __webpack_exports__["a"] = (check);
1145  
1146  
1147  /***/ }),
1148  
1149  /***/ 2:
1150  /***/ (function(module, exports) {
1151  
1152  (function() { module.exports = this["lodash"]; }());
1153  
1154  /***/ }),
1155  
1156  /***/ 20:
1157  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1158  
1159  "use strict";
1160  
1161  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
1162  var arrayWithHoles = __webpack_require__(38);
1163  
1164  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
1165  function _iterableToArrayLimit(arr, i) {
1166    if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
1167    var _arr = [];
1168    var _n = true;
1169    var _d = false;
1170    var _e = undefined;
1171  
1172    try {
1173      for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
1174        _arr.push(_s.value);
1175  
1176        if (i && _arr.length === i) break;
1177      }
1178    } catch (err) {
1179      _d = true;
1180      _e = err;
1181    } finally {
1182      try {
1183        if (!_n && _i["return"] != null) _i["return"]();
1184      } finally {
1185        if (_d) throw _e;
1186      }
1187    }
1188  
1189    return _arr;
1190  }
1191  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
1192  var unsupportedIterableToArray = __webpack_require__(27);
1193  
1194  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
1195  var nonIterableRest = __webpack_require__(39);
1196  
1197  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js
1198  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _slicedToArray; });
1199  
1200  
1201  
1202  
1203  function _slicedToArray(arr, i) {
1204    return Object(arrayWithHoles["a" /* default */])(arr) || _iterableToArrayLimit(arr, i) || Object(unsupportedIterableToArray["a" /* default */])(arr, i) || Object(nonIterableRest["a" /* default */])();
1205  }
1206  
1207  /***/ }),
1208  
1209  /***/ 21:
1210  /***/ (function(module, exports) {
1211  
1212  (function() { module.exports = this["React"]; }());
1213  
1214  /***/ }),
1215  
1216  /***/ 22:
1217  /***/ (function(module, exports) {
1218  
1219  (function() { module.exports = this["wp"]["keycodes"]; }());
1220  
1221  /***/ }),
1222  
1223  /***/ 23:
1224  /***/ (function(module, exports) {
1225  
1226  (function() { module.exports = this["regeneratorRuntime"]; }());
1227  
1228  /***/ }),
1229  
1230  /***/ 24:
1231  /***/ (function(module, exports) {
1232  
1233  (function() { module.exports = this["wp"]["richText"]; }());
1234  
1235  /***/ }),
1236  
1237  /***/ 25:
1238  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1239  
1240  "use strict";
1241  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayLikeToArray; });
1242  function _arrayLikeToArray(arr, len) {
1243    if (len == null || len > arr.length) len = arr.length;
1244  
1245    for (var i = 0, arr2 = new Array(len); i < len; i++) {
1246      arr2[i] = arr[i];
1247    }
1248  
1249    return arr2;
1250  }
1251  
1252  /***/ }),
1253  
1254  /***/ 26:
1255  /***/ (function(module, exports, __webpack_require__) {
1256  
1257  /**
1258   * Copyright (c) 2013-present, Facebook, Inc.
1259   *
1260   * This source code is licensed under the MIT license found in the
1261   * LICENSE file in the root directory of this source tree.
1262   */
1263  
1264  if (false) { var throwOnDirectAccess, ReactIs; } else {
1265    // By explicitly using `prop-types` you are opting into new production behavior.
1266    // http://fb.me/prop-types-in-prod
1267    module.exports = __webpack_require__(118)();
1268  }
1269  
1270  
1271  /***/ }),
1272  
1273  /***/ 27:
1274  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1275  
1276  "use strict";
1277  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _unsupportedIterableToArray; });
1278  /* harmony import */ var _arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25);
1279  
1280  function _unsupportedIterableToArray(o, minLen) {
1281    if (!o) return;
1282    if (typeof o === "string") return Object(_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen);
1283    var n = Object.prototype.toString.call(o).slice(8, -1);
1284    if (n === "Object" && o.constructor) n = o.constructor.name;
1285    if (n === "Map" || n === "Set") return Array.from(n);
1286    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Object(_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen);
1287  }
1288  
1289  /***/ }),
1290  
1291  /***/ 3:
1292  /***/ (function(module, exports) {
1293  
1294  (function() { module.exports = this["wp"]["components"]; }());
1295  
1296  /***/ }),
1297  
1298  /***/ 30:
1299  /***/ (function(module, exports) {
1300  
1301  (function() { module.exports = this["wp"]["url"]; }());
1302  
1303  /***/ }),
1304  
1305  /***/ 32:
1306  /***/ (function(module, exports) {
1307  
1308  (function() { module.exports = this["wp"]["hooks"]; }());
1309  
1310  /***/ }),
1311  
1312  /***/ 34:
1313  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1314  
1315  "use strict";
1316  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _typeof; });
1317  function _typeof(obj) {
1318    "@babel/helpers - typeof";
1319  
1320    if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
1321      _typeof = function _typeof(obj) {
1322        return typeof obj;
1323      };
1324    } else {
1325      _typeof = function _typeof(obj) {
1326        return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
1327      };
1328    }
1329  
1330    return _typeof(obj);
1331  }
1332  
1333  /***/ }),
1334  
1335  /***/ 35:
1336  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1337  
1338  "use strict";
1339  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _iterableToArray; });
1340  function _iterableToArray(iter) {
1341    if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
1342  }
1343  
1344  /***/ }),
1345  
1346  /***/ 37:
1347  /***/ (function(module, exports) {
1348  
1349  (function() { module.exports = this["wp"]["deprecated"]; }());
1350  
1351  /***/ }),
1352  
1353  /***/ 38:
1354  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1355  
1356  "use strict";
1357  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayWithHoles; });
1358  function _arrayWithHoles(arr) {
1359    if (Array.isArray(arr)) return arr;
1360  }
1361  
1362  /***/ }),
1363  
1364  /***/ 39:
1365  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1366  
1367  "use strict";
1368  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _nonIterableRest; });
1369  function _nonIterableRest() {
1370    throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1371  }
1372  
1373  /***/ }),
1374  
1375  /***/ 4:
1376  /***/ (function(module, exports) {
1377  
1378  (function() { module.exports = this["wp"]["data"]; }());
1379  
1380  /***/ }),
1381  
1382  /***/ 40:
1383  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1384  
1385  "use strict";
1386  
1387  
1388  var LEAF_KEY, hasWeakMap;
1389  
1390  /**
1391   * Arbitrary value used as key for referencing cache object in WeakMap tree.
1392   *
1393   * @type {Object}
1394   */
1395  LEAF_KEY = {};
1396  
1397  /**
1398   * Whether environment supports WeakMap.
1399   *
1400   * @type {boolean}
1401   */
1402  hasWeakMap = typeof WeakMap !== 'undefined';
1403  
1404  /**
1405   * Returns the first argument as the sole entry in an array.
1406   *
1407   * @param {*} value Value to return.
1408   *
1409   * @return {Array} Value returned as entry in array.
1410   */
1411  function arrayOf( value ) {
1412      return [ value ];
1413  }
1414  
1415  /**
1416   * Returns true if the value passed is object-like, or false otherwise. A value
1417   * is object-like if it can support property assignment, e.g. object or array.
1418   *
1419   * @param {*} value Value to test.
1420   *
1421   * @return {boolean} Whether value is object-like.
1422   */
1423  function isObjectLike( value ) {
1424      return !! value && 'object' === typeof value;
1425  }
1426  
1427  /**
1428   * Creates and returns a new cache object.
1429   *
1430   * @return {Object} Cache object.
1431   */
1432  function createCache() {
1433      var cache = {
1434          clear: function() {
1435              cache.head = null;
1436          },
1437      };
1438  
1439      return cache;
1440  }
1441  
1442  /**
1443   * Returns true if entries within the two arrays are strictly equal by
1444   * reference from a starting index.
1445   *
1446   * @param {Array}  a         First array.
1447   * @param {Array}  b         Second array.
1448   * @param {number} fromIndex Index from which to start comparison.
1449   *
1450   * @return {boolean} Whether arrays are shallowly equal.
1451   */
1452  function isShallowEqual( a, b, fromIndex ) {
1453      var i;
1454  
1455      if ( a.length !== b.length ) {
1456          return false;
1457      }
1458  
1459      for ( i = fromIndex; i < a.length; i++ ) {
1460          if ( a[ i ] !== b[ i ] ) {
1461              return false;
1462          }
1463      }
1464  
1465      return true;
1466  }
1467  
1468  /**
1469   * Returns a memoized selector function. The getDependants function argument is
1470   * called before the memoized selector and is expected to return an immutable
1471   * reference or array of references on which the selector depends for computing
1472   * its own return value. The memoize cache is preserved only as long as those
1473   * dependant references remain the same. If getDependants returns a different
1474   * reference(s), the cache is cleared and the selector value regenerated.
1475   *
1476   * @param {Function} selector      Selector function.
1477   * @param {Function} getDependants Dependant getter returning an immutable
1478   *                                 reference or array of reference used in
1479   *                                 cache bust consideration.
1480   *
1481   * @return {Function} Memoized selector.
1482   */
1483  /* harmony default export */ __webpack_exports__["a"] = (function( selector, getDependants ) {
1484      var rootCache, getCache;
1485  
1486      // Use object source as dependant if getter not provided
1487      if ( ! getDependants ) {
1488          getDependants = arrayOf;
1489      }
1490  
1491      /**
1492       * Returns the root cache. If WeakMap is supported, this is assigned to the
1493       * root WeakMap cache set, otherwise it is a shared instance of the default
1494       * cache object.
1495       *
1496       * @return {(WeakMap|Object)} Root cache object.
1497       */
1498  	function getRootCache() {
1499          return rootCache;
1500      }
1501  
1502      /**
1503       * Returns the cache for a given dependants array. When possible, a WeakMap
1504       * will be used to create a unique cache for each set of dependants. This
1505       * is feasible due to the nature of WeakMap in allowing garbage collection
1506       * to occur on entries where the key object is no longer referenced. Since
1507       * WeakMap requires the key to be an object, this is only possible when the
1508       * dependant is object-like. The root cache is created as a hierarchy where
1509       * each top-level key is the first entry in a dependants set, the value a
1510       * WeakMap where each key is the next dependant, and so on. This continues
1511       * so long as the dependants are object-like. If no dependants are object-
1512       * like, then the cache is shared across all invocations.
1513       *
1514       * @see isObjectLike
1515       *
1516       * @param {Array} dependants Selector dependants.
1517       *
1518       * @return {Object} Cache object.
1519       */
1520  	function getWeakMapCache( dependants ) {
1521          var caches = rootCache,
1522              isUniqueByDependants = true,
1523              i, dependant, map, cache;
1524  
1525          for ( i = 0; i < dependants.length; i++ ) {
1526              dependant = dependants[ i ];
1527  
1528              // Can only compose WeakMap from object-like key.
1529              if ( ! isObjectLike( dependant ) ) {
1530                  isUniqueByDependants = false;
1531                  break;
1532              }
1533  
1534              // Does current segment of cache already have a WeakMap?
1535              if ( caches.has( dependant ) ) {
1536                  // Traverse into nested WeakMap.
1537                  caches = caches.get( dependant );
1538              } else {
1539                  // Create, set, and traverse into a new one.
1540                  map = new WeakMap();
1541                  caches.set( dependant, map );
1542                  caches = map;
1543              }
1544          }
1545  
1546          // We use an arbitrary (but consistent) object as key for the last item
1547          // in the WeakMap to serve as our running cache.
1548          if ( ! caches.has( LEAF_KEY ) ) {
1549              cache = createCache();
1550              cache.isUniqueByDependants = isUniqueByDependants;
1551              caches.set( LEAF_KEY, cache );
1552          }
1553  
1554          return caches.get( LEAF_KEY );
1555      }
1556  
1557      // Assign cache handler by availability of WeakMap
1558      getCache = hasWeakMap ? getWeakMapCache : getRootCache;
1559  
1560      /**
1561       * Resets root memoization cache.
1562       */
1563  	function clear() {
1564          rootCache = hasWeakMap ? new WeakMap() : createCache();
1565      }
1566  
1567      // eslint-disable-next-line jsdoc/check-param-names
1568      /**
1569       * The augmented selector call, considering first whether dependants have
1570       * changed before passing it to underlying memoize function.
1571       *
1572       * @param {Object} source    Source object for derivation.
1573       * @param {...*}   extraArgs Additional arguments to pass to selector.
1574       *
1575       * @return {*} Selector result.
1576       */
1577  	function callSelector( /* source, ...extraArgs */ ) {
1578          var len = arguments.length,
1579              cache, node, i, args, dependants;
1580  
1581          // Create copy of arguments (avoid leaking deoptimization).
1582          args = new Array( len );
1583          for ( i = 0; i < len; i++ ) {
1584              args[ i ] = arguments[ i ];
1585          }
1586  
1587          dependants = getDependants.apply( null, args );
1588          cache = getCache( dependants );
1589  
1590          // If not guaranteed uniqueness by dependants (primitive type or lack
1591          // of WeakMap support), shallow compare against last dependants and, if
1592          // references have changed, destroy cache to recalculate result.
1593          if ( ! cache.isUniqueByDependants ) {
1594              if ( cache.lastDependants && ! isShallowEqual( dependants, cache.lastDependants, 0 ) ) {
1595                  cache.clear();
1596              }
1597  
1598              cache.lastDependants = dependants;
1599          }
1600  
1601          node = cache.head;
1602          while ( node ) {
1603              // Check whether node arguments match arguments
1604              if ( ! isShallowEqual( node.args, args, 1 ) ) {
1605                  node = node.next;
1606                  continue;
1607              }
1608  
1609              // At this point we can assume we've found a match
1610  
1611              // Surface matched node to head if not already
1612              if ( node !== cache.head ) {
1613                  // Adjust siblings to point to each other.
1614                  node.prev.next = node.next;
1615                  if ( node.next ) {
1616                      node.next.prev = node.prev;
1617                  }
1618  
1619                  node.next = cache.head;
1620                  node.prev = null;
1621                  cache.head.prev = node;
1622                  cache.head = node;
1623              }
1624  
1625              // Return immediately
1626              return node.val;
1627          }
1628  
1629          // No cached value found. Continue to insertion phase:
1630  
1631          node = {
1632              // Generate the result from original function
1633              val: selector.apply( null, args ),
1634          };
1635  
1636          // Avoid including the source object in the cache.
1637          args[ 0 ] = null;
1638          node.args = args;
1639  
1640          // Don't need to check whether node is already head, since it would
1641          // have been returned above already if it was
1642  
1643          // Shift existing head down list
1644          if ( cache.head ) {
1645              cache.head.prev = node;
1646              node.next = cache.head;
1647          }
1648  
1649          cache.head = node;
1650  
1651          return node.val;
1652      }
1653  
1654      callSelector.getDependants = getDependants;
1655      callSelector.clear = clear;
1656      clear();
1657  
1658      return callSelector;
1659  });
1660  
1661  
1662  /***/ }),
1663  
1664  /***/ 405:
1665  /***/ (function(module, exports, __webpack_require__) {
1666  
1667  "use strict";
1668  
1669  
1670  var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
1671  
1672  function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
1673  
1674  var BEGIN = 'BEGIN';
1675  var COMMIT = 'COMMIT';
1676  var REVERT = 'REVERT';
1677  // Array({transactionID: string or null, beforeState: {object}, action: {object}}
1678  var INITIAL_OPTIMIST = [];
1679  
1680  module.exports = optimist;
1681  module.exports.BEGIN = BEGIN;
1682  module.exports.COMMIT = COMMIT;
1683  module.exports.REVERT = REVERT;
1684  function optimist(fn) {
1685    function beginReducer(state, action) {
1686      var _separateState = separateState(state);
1687  
1688      var optimist = _separateState.optimist;
1689      var innerState = _separateState.innerState;
1690  
1691      optimist = optimist.concat([{ beforeState: innerState, action: action }]);
1692      innerState = fn(innerState, action);
1693      validateState(innerState, action);
1694      return _extends({ optimist: optimist }, innerState);
1695    }
1696    function commitReducer(state, action) {
1697      var _separateState2 = separateState(state);
1698  
1699      var optimist = _separateState2.optimist;
1700      var innerState = _separateState2.innerState;
1701  
1702      var newOptimist = [],
1703          started = false,
1704          committed = false;
1705      optimist.forEach(function (entry) {
1706        if (started) {
1707          if (entry.beforeState && matchesTransaction(entry.action, action.optimist.id)) {
1708            committed = true;
1709            newOptimist.push({ action: entry.action });
1710          } else {
1711            newOptimist.push(entry);
1712          }
1713        } else if (entry.beforeState && !matchesTransaction(entry.action, action.optimist.id)) {
1714          started = true;
1715          newOptimist.push(entry);
1716        } else if (entry.beforeState && matchesTransaction(entry.action, action.optimist.id)) {
1717          committed = true;
1718        }
1719      });
1720      if (!committed) {
1721        console.error('Cannot commit transaction with id "' + action.optimist.id + '" because it does not exist');
1722      }
1723      optimist = newOptimist;
1724      return baseReducer(optimist, innerState, action);
1725    }
1726    function revertReducer(state, action) {
1727      var _separateState3 = separateState(state);
1728  
1729      var optimist = _separateState3.optimist;
1730      var innerState = _separateState3.innerState;
1731  
1732      var newOptimist = [],
1733          started = false,
1734          gotInitialState = false,
1735          currentState = innerState;
1736      optimist.forEach(function (entry) {
1737        if (entry.beforeState && matchesTransaction(entry.action, action.optimist.id)) {
1738          currentState = entry.beforeState;
1739          gotInitialState = true;
1740        }
1741        if (!matchesTransaction(entry.action, action.optimist.id)) {
1742          if (entry.beforeState) {
1743            started = true;
1744          }
1745          if (started) {
1746            if (gotInitialState && entry.beforeState) {
1747              newOptimist.push({
1748                beforeState: currentState,
1749                action: entry.action
1750              });
1751            } else {
1752              newOptimist.push(entry);
1753            }
1754          }
1755          if (gotInitialState) {
1756            currentState = fn(currentState, entry.action);
1757            validateState(innerState, action);
1758          }
1759        }
1760      });
1761      if (!gotInitialState) {
1762        console.error('Cannot revert transaction with id "' + action.optimist.id + '" because it does not exist');
1763      }
1764      optimist = newOptimist;
1765      return baseReducer(optimist, currentState, action);
1766    }
1767    function baseReducer(optimist, innerState, action) {
1768      if (optimist.length) {
1769        optimist = optimist.concat([{ action: action }]);
1770      }
1771      innerState = fn(innerState, action);
1772      validateState(innerState, action);
1773      return _extends({ optimist: optimist }, innerState);
1774    }
1775    return function (state, action) {
1776      if (action.optimist) {
1777        switch (action.optimist.type) {
1778          case BEGIN:
1779            return beginReducer(state, action);
1780          case COMMIT:
1781            return commitReducer(state, action);
1782          case REVERT:
1783            return revertReducer(state, action);
1784        }
1785      }
1786  
1787      var _separateState4 = separateState(state);
1788  
1789      var optimist = _separateState4.optimist;
1790      var innerState = _separateState4.innerState;
1791  
1792      if (state && !optimist.length) {
1793        var nextState = fn(innerState, action);
1794        if (nextState === innerState) {
1795          return state;
1796        }
1797        validateState(nextState, action);
1798        return _extends({ optimist: optimist }, nextState);
1799      }
1800      return baseReducer(optimist, innerState, action);
1801    };
1802  }
1803  
1804  function matchesTransaction(action, id) {
1805    return action.optimist && action.optimist.id === id;
1806  }
1807  
1808  function validateState(newState, action) {
1809    if (!newState || typeof newState !== 'object' || Array.isArray(newState)) {
1810      throw new TypeError('Error while handling "' + action.type + '": Optimist requires that state is always a plain object.');
1811    }
1812  }
1813  
1814  function separateState(state) {
1815    if (!state) {
1816      return { optimist: INITIAL_OPTIMIST, innerState: state };
1817    } else {
1818      var _state$optimist = state.optimist;
1819  
1820      var _optimist = _state$optimist === undefined ? INITIAL_OPTIMIST : _state$optimist;
1821  
1822      var innerState = _objectWithoutProperties(state, ['optimist']);
1823  
1824      return { optimist: _optimist, innerState: innerState };
1825    }
1826  }
1827  
1828  /***/ }),
1829  
1830  /***/ 42:
1831  /***/ (function(module, exports) {
1832  
1833  (function() { module.exports = this["wp"]["apiFetch"]; }());
1834  
1835  /***/ }),
1836  
1837  /***/ 422:
1838  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1839  
1840  "use strict";
1841  __webpack_require__.r(__webpack_exports__);
1842  var actions_namespaceObject = {};
1843  __webpack_require__.r(actions_namespaceObject);
1844  __webpack_require__.d(actions_namespaceObject, "setupEditor", function() { return setupEditor; });
1845  __webpack_require__.d(actions_namespaceObject, "__experimentalTearDownEditor", function() { return __experimentalTearDownEditor; });
1846  __webpack_require__.d(actions_namespaceObject, "resetPost", function() { return resetPost; });
1847  __webpack_require__.d(actions_namespaceObject, "resetAutosave", function() { return resetAutosave; });
1848  __webpack_require__.d(actions_namespaceObject, "__experimentalRequestPostUpdateStart", function() { return __experimentalRequestPostUpdateStart; });
1849  __webpack_require__.d(actions_namespaceObject, "__experimentalRequestPostUpdateFinish", function() { return __experimentalRequestPostUpdateFinish; });
1850  __webpack_require__.d(actions_namespaceObject, "updatePost", function() { return updatePost; });
1851  __webpack_require__.d(actions_namespaceObject, "setupEditorState", function() { return setupEditorState; });
1852  __webpack_require__.d(actions_namespaceObject, "editPost", function() { return actions_editPost; });
1853  __webpack_require__.d(actions_namespaceObject, "__experimentalOptimisticUpdatePost", function() { return __experimentalOptimisticUpdatePost; });
1854  __webpack_require__.d(actions_namespaceObject, "savePost", function() { return actions_savePost; });
1855  __webpack_require__.d(actions_namespaceObject, "refreshPost", function() { return refreshPost; });
1856  __webpack_require__.d(actions_namespaceObject, "trashPost", function() { return trashPost; });
1857  __webpack_require__.d(actions_namespaceObject, "autosave", function() { return actions_autosave; });
1858  __webpack_require__.d(actions_namespaceObject, "__experimentalLocalAutosave", function() { return actions_experimentalLocalAutosave; });
1859  __webpack_require__.d(actions_namespaceObject, "redo", function() { return actions_redo; });
1860  __webpack_require__.d(actions_namespaceObject, "undo", function() { return actions_undo; });
1861  __webpack_require__.d(actions_namespaceObject, "createUndoLevel", function() { return createUndoLevel; });
1862  __webpack_require__.d(actions_namespaceObject, "updatePostLock", function() { return updatePostLock; });
1863  __webpack_require__.d(actions_namespaceObject, "__experimentalFetchReusableBlocks", function() { return actions_experimentalFetchReusableBlocks; });
1864  __webpack_require__.d(actions_namespaceObject, "__experimentalReceiveReusableBlocks", function() { return __experimentalReceiveReusableBlocks; });
1865  __webpack_require__.d(actions_namespaceObject, "__experimentalSaveReusableBlock", function() { return __experimentalSaveReusableBlock; });
1866  __webpack_require__.d(actions_namespaceObject, "__experimentalDeleteReusableBlock", function() { return __experimentalDeleteReusableBlock; });
1867  __webpack_require__.d(actions_namespaceObject, "__experimentalUpdateReusableBlock", function() { return __experimentalUpdateReusableBlock; });
1868  __webpack_require__.d(actions_namespaceObject, "__experimentalConvertBlockToStatic", function() { return __experimentalConvertBlockToStatic; });
1869  __webpack_require__.d(actions_namespaceObject, "__experimentalConvertBlockToReusable", function() { return __experimentalConvertBlockToReusable; });
1870  __webpack_require__.d(actions_namespaceObject, "enablePublishSidebar", function() { return enablePublishSidebar; });
1871  __webpack_require__.d(actions_namespaceObject, "disablePublishSidebar", function() { return disablePublishSidebar; });
1872  __webpack_require__.d(actions_namespaceObject, "lockPostSaving", function() { return lockPostSaving; });
1873  __webpack_require__.d(actions_namespaceObject, "unlockPostSaving", function() { return unlockPostSaving; });
1874  __webpack_require__.d(actions_namespaceObject, "lockPostAutosaving", function() { return lockPostAutosaving; });
1875  __webpack_require__.d(actions_namespaceObject, "unlockPostAutosaving", function() { return unlockPostAutosaving; });
1876  __webpack_require__.d(actions_namespaceObject, "resetEditorBlocks", function() { return actions_resetEditorBlocks; });
1877  __webpack_require__.d(actions_namespaceObject, "updateEditorSettings", function() { return updateEditorSettings; });
1878  __webpack_require__.d(actions_namespaceObject, "resetBlocks", function() { return resetBlocks; });
1879  __webpack_require__.d(actions_namespaceObject, "receiveBlocks", function() { return receiveBlocks; });
1880  __webpack_require__.d(actions_namespaceObject, "updateBlock", function() { return updateBlock; });
1881  __webpack_require__.d(actions_namespaceObject, "updateBlockAttributes", function() { return updateBlockAttributes; });
1882  __webpack_require__.d(actions_namespaceObject, "selectBlock", function() { return selectBlock; });
1883  __webpack_require__.d(actions_namespaceObject, "startMultiSelect", function() { return startMultiSelect; });
1884  __webpack_require__.d(actions_namespaceObject, "stopMultiSelect", function() { return stopMultiSelect; });
1885  __webpack_require__.d(actions_namespaceObject, "multiSelect", function() { return multiSelect; });
1886  __webpack_require__.d(actions_namespaceObject, "clearSelectedBlock", function() { return clearSelectedBlock; });
1887  __webpack_require__.d(actions_namespaceObject, "toggleSelection", function() { return toggleSelection; });
1888  __webpack_require__.d(actions_namespaceObject, "replaceBlocks", function() { return actions_replaceBlocks; });
1889  __webpack_require__.d(actions_namespaceObject, "replaceBlock", function() { return replaceBlock; });
1890  __webpack_require__.d(actions_namespaceObject, "moveBlocksDown", function() { return moveBlocksDown; });
1891  __webpack_require__.d(actions_namespaceObject, "moveBlocksUp", function() { return moveBlocksUp; });
1892  __webpack_require__.d(actions_namespaceObject, "moveBlockToPosition", function() { return moveBlockToPosition; });
1893  __webpack_require__.d(actions_namespaceObject, "insertBlock", function() { return insertBlock; });
1894  __webpack_require__.d(actions_namespaceObject, "insertBlocks", function() { return insertBlocks; });
1895  __webpack_require__.d(actions_namespaceObject, "showInsertionPoint", function() { return showInsertionPoint; });
1896  __webpack_require__.d(actions_namespaceObject, "hideInsertionPoint", function() { return hideInsertionPoint; });
1897  __webpack_require__.d(actions_namespaceObject, "setTemplateValidity", function() { return setTemplateValidity; });
1898  __webpack_require__.d(actions_namespaceObject, "synchronizeTemplate", function() { return synchronizeTemplate; });
1899  __webpack_require__.d(actions_namespaceObject, "mergeBlocks", function() { return mergeBlocks; });
1900  __webpack_require__.d(actions_namespaceObject, "removeBlocks", function() { return removeBlocks; });
1901  __webpack_require__.d(actions_namespaceObject, "removeBlock", function() { return removeBlock; });
1902  __webpack_require__.d(actions_namespaceObject, "toggleBlockMode", function() { return toggleBlockMode; });
1903  __webpack_require__.d(actions_namespaceObject, "startTyping", function() { return startTyping; });
1904  __webpack_require__.d(actions_namespaceObject, "stopTyping", function() { return stopTyping; });
1905  __webpack_require__.d(actions_namespaceObject, "enterFormattedText", function() { return enterFormattedText; });
1906  __webpack_require__.d(actions_namespaceObject, "exitFormattedText", function() { return exitFormattedText; });
1907  __webpack_require__.d(actions_namespaceObject, "insertDefaultBlock", function() { return insertDefaultBlock; });
1908  __webpack_require__.d(actions_namespaceObject, "updateBlockListSettings", function() { return updateBlockListSettings; });
1909  var selectors_namespaceObject = {};
1910  __webpack_require__.r(selectors_namespaceObject);
1911  __webpack_require__.d(selectors_namespaceObject, "hasEditorUndo", function() { return hasEditorUndo; });
1912  __webpack_require__.d(selectors_namespaceObject, "hasEditorRedo", function() { return hasEditorRedo; });
1913  __webpack_require__.d(selectors_namespaceObject, "isEditedPostNew", function() { return selectors_isEditedPostNew; });
1914  __webpack_require__.d(selectors_namespaceObject, "hasChangedContent", function() { return hasChangedContent; });
1915  __webpack_require__.d(selectors_namespaceObject, "isEditedPostDirty", function() { return selectors_isEditedPostDirty; });
1916  __webpack_require__.d(selectors_namespaceObject, "hasNonPostEntityChanges", function() { return selectors_hasNonPostEntityChanges; });
1917  __webpack_require__.d(selectors_namespaceObject, "isCleanNewPost", function() { return selectors_isCleanNewPost; });
1918  __webpack_require__.d(selectors_namespaceObject, "getCurrentPost", function() { return selectors_getCurrentPost; });
1919  __webpack_require__.d(selectors_namespaceObject, "getCurrentPostType", function() { return selectors_getCurrentPostType; });
1920  __webpack_require__.d(selectors_namespaceObject, "getCurrentPostId", function() { return selectors_getCurrentPostId; });
1921  __webpack_require__.d(selectors_namespaceObject, "getCurrentPostRevisionsCount", function() { return getCurrentPostRevisionsCount; });
1922  __webpack_require__.d(selectors_namespaceObject, "getCurrentPostLastRevisionId", function() { return getCurrentPostLastRevisionId; });
1923  __webpack_require__.d(selectors_namespaceObject, "getPostEdits", function() { return getPostEdits; });
1924  __webpack_require__.d(selectors_namespaceObject, "getReferenceByDistinctEdits", function() { return getReferenceByDistinctEdits; });
1925  __webpack_require__.d(selectors_namespaceObject, "getCurrentPostAttribute", function() { return selectors_getCurrentPostAttribute; });
1926  __webpack_require__.d(selectors_namespaceObject, "getEditedPostAttribute", function() { return selectors_getEditedPostAttribute; });
1927  __webpack_require__.d(selectors_namespaceObject, "getAutosaveAttribute", function() { return getAutosaveAttribute; });
1928  __webpack_require__.d(selectors_namespaceObject, "getEditedPostVisibility", function() { return selectors_getEditedPostVisibility; });
1929  __webpack_require__.d(selectors_namespaceObject, "isCurrentPostPending", function() { return isCurrentPostPending; });
1930  __webpack_require__.d(selectors_namespaceObject, "isCurrentPostPublished", function() { return selectors_isCurrentPostPublished; });
1931  __webpack_require__.d(selectors_namespaceObject, "isCurrentPostScheduled", function() { return selectors_isCurrentPostScheduled; });
1932  __webpack_require__.d(selectors_namespaceObject, "isEditedPostPublishable", function() { return selectors_isEditedPostPublishable; });
1933  __webpack_require__.d(selectors_namespaceObject, "isEditedPostSaveable", function() { return selectors_isEditedPostSaveable; });
1934  __webpack_require__.d(selectors_namespaceObject, "isEditedPostEmpty", function() { return isEditedPostEmpty; });
1935  __webpack_require__.d(selectors_namespaceObject, "isEditedPostAutosaveable", function() { return selectors_isEditedPostAutosaveable; });
1936  __webpack_require__.d(selectors_namespaceObject, "getAutosave", function() { return getAutosave; });
1937  __webpack_require__.d(selectors_namespaceObject, "hasAutosave", function() { return hasAutosave; });
1938  __webpack_require__.d(selectors_namespaceObject, "isEditedPostBeingScheduled", function() { return selectors_isEditedPostBeingScheduled; });
1939  __webpack_require__.d(selectors_namespaceObject, "isEditedPostDateFloating", function() { return isEditedPostDateFloating; });
1940  __webpack_require__.d(selectors_namespaceObject, "isSavingPost", function() { return selectors_isSavingPost; });
1941  __webpack_require__.d(selectors_namespaceObject, "didPostSaveRequestSucceed", function() { return didPostSaveRequestSucceed; });
1942  __webpack_require__.d(selectors_namespaceObject, "didPostSaveRequestFail", function() { return didPostSaveRequestFail; });
1943  __webpack_require__.d(selectors_namespaceObject, "isAutosavingPost", function() { return selectors_isAutosavingPost; });
1944  __webpack_require__.d(selectors_namespaceObject, "isPreviewingPost", function() { return isPreviewingPost; });
1945  __webpack_require__.d(selectors_namespaceObject, "getEditedPostPreviewLink", function() { return selectors_getEditedPostPreviewLink; });
1946  __webpack_require__.d(selectors_namespaceObject, "getSuggestedPostFormat", function() { return selectors_getSuggestedPostFormat; });
1947  __webpack_require__.d(selectors_namespaceObject, "getBlocksForSerialization", function() { return getBlocksForSerialization; });
1948  __webpack_require__.d(selectors_namespaceObject, "getEditedPostContent", function() { return getEditedPostContent; });
1949  __webpack_require__.d(selectors_namespaceObject, "__experimentalGetReusableBlock", function() { return __experimentalGetReusableBlock; });
1950  __webpack_require__.d(selectors_namespaceObject, "__experimentalIsSavingReusableBlock", function() { return __experimentalIsSavingReusableBlock; });
1951  __webpack_require__.d(selectors_namespaceObject, "__experimentalIsFetchingReusableBlock", function() { return __experimentalIsFetchingReusableBlock; });
1952  __webpack_require__.d(selectors_namespaceObject, "__experimentalGetReusableBlocks", function() { return selectors_experimentalGetReusableBlocks; });
1953  __webpack_require__.d(selectors_namespaceObject, "getStateBeforeOptimisticTransaction", function() { return getStateBeforeOptimisticTransaction; });
1954  __webpack_require__.d(selectors_namespaceObject, "isPublishingPost", function() { return selectors_isPublishingPost; });
1955  __webpack_require__.d(selectors_namespaceObject, "isPermalinkEditable", function() { return selectors_isPermalinkEditable; });
1956  __webpack_require__.d(selectors_namespaceObject, "getPermalink", function() { return getPermalink; });
1957  __webpack_require__.d(selectors_namespaceObject, "getPermalinkParts", function() { return selectors_getPermalinkParts; });
1958  __webpack_require__.d(selectors_namespaceObject, "inSomeHistory", function() { return inSomeHistory; });
1959  __webpack_require__.d(selectors_namespaceObject, "isPostLocked", function() { return isPostLocked; });
1960  __webpack_require__.d(selectors_namespaceObject, "isPostSavingLocked", function() { return selectors_isPostSavingLocked; });
1961  __webpack_require__.d(selectors_namespaceObject, "isPostAutosavingLocked", function() { return isPostAutosavingLocked; });
1962  __webpack_require__.d(selectors_namespaceObject, "isPostLockTakeover", function() { return isPostLockTakeover; });
1963  __webpack_require__.d(selectors_namespaceObject, "getPostLockUser", function() { return getPostLockUser; });
1964  __webpack_require__.d(selectors_namespaceObject, "getActivePostLock", function() { return getActivePostLock; });
1965  __webpack_require__.d(selectors_namespaceObject, "canUserUseUnfilteredHTML", function() { return selectors_canUserUseUnfilteredHTML; });
1966  __webpack_require__.d(selectors_namespaceObject, "isPublishSidebarEnabled", function() { return selectors_isPublishSidebarEnabled; });
1967  __webpack_require__.d(selectors_namespaceObject, "getEditorBlocks", function() { return selectors_getEditorBlocks; });
1968  __webpack_require__.d(selectors_namespaceObject, "getEditorSelectionStart", function() { return selectors_getEditorSelectionStart; });
1969  __webpack_require__.d(selectors_namespaceObject, "getEditorSelectionEnd", function() { return selectors_getEditorSelectionEnd; });
1970  __webpack_require__.d(selectors_namespaceObject, "__unstableIsEditorReady", function() { return __unstableIsEditorReady; });
1971  __webpack_require__.d(selectors_namespaceObject, "getEditorSettings", function() { return selectors_getEditorSettings; });
1972  __webpack_require__.d(selectors_namespaceObject, "getBlockName", function() { return selectors_getBlockName; });
1973  __webpack_require__.d(selectors_namespaceObject, "isBlockValid", function() { return isBlockValid; });
1974  __webpack_require__.d(selectors_namespaceObject, "getBlockAttributes", function() { return getBlockAttributes; });
1975  __webpack_require__.d(selectors_namespaceObject, "getBlock", function() { return selectors_getBlock; });
1976  __webpack_require__.d(selectors_namespaceObject, "getBlocks", function() { return selectors_getBlocks; });
1977  __webpack_require__.d(selectors_namespaceObject, "__unstableGetBlockWithoutInnerBlocks", function() { return __unstableGetBlockWithoutInnerBlocks; });
1978  __webpack_require__.d(selectors_namespaceObject, "getClientIdsOfDescendants", function() { return getClientIdsOfDescendants; });
1979  __webpack_require__.d(selectors_namespaceObject, "getClientIdsWithDescendants", function() { return getClientIdsWithDescendants; });
1980  __webpack_require__.d(selectors_namespaceObject, "getGlobalBlockCount", function() { return getGlobalBlockCount; });
1981  __webpack_require__.d(selectors_namespaceObject, "getBlocksByClientId", function() { return selectors_getBlocksByClientId; });
1982  __webpack_require__.d(selectors_namespaceObject, "getBlockCount", function() { return getBlockCount; });
1983  __webpack_require__.d(selectors_namespaceObject, "getBlockSelectionStart", function() { return getBlockSelectionStart; });
1984  __webpack_require__.d(selectors_namespaceObject, "getBlockSelectionEnd", function() { return getBlockSelectionEnd; });
1985  __webpack_require__.d(selectors_namespaceObject, "getSelectedBlockCount", function() { return getSelectedBlockCount; });
1986  __webpack_require__.d(selectors_namespaceObject, "hasSelectedBlock", function() { return hasSelectedBlock; });
1987  __webpack_require__.d(selectors_namespaceObject, "getSelectedBlockClientId", function() { return selectors_getSelectedBlockClientId; });
1988  __webpack_require__.d(selectors_namespaceObject, "getSelectedBlock", function() { return getSelectedBlock; });
1989  __webpack_require__.d(selectors_namespaceObject, "getBlockRootClientId", function() { return getBlockRootClientId; });
1990  __webpack_require__.d(selectors_namespaceObject, "getBlockHierarchyRootClientId", function() { return getBlockHierarchyRootClientId; });
1991  __webpack_require__.d(selectors_namespaceObject, "getAdjacentBlockClientId", function() { return getAdjacentBlockClientId; });
1992  __webpack_require__.d(selectors_namespaceObject, "getPreviousBlockClientId", function() { return getPreviousBlockClientId; });
1993  __webpack_require__.d(selectors_namespaceObject, "getNextBlockClientId", function() { return getNextBlockClientId; });
1994  __webpack_require__.d(selectors_namespaceObject, "getSelectedBlocksInitialCaretPosition", function() { return getSelectedBlocksInitialCaretPosition; });
1995  __webpack_require__.d(selectors_namespaceObject, "getMultiSelectedBlockClientIds", function() { return getMultiSelectedBlockClientIds; });
1996  __webpack_require__.d(selectors_namespaceObject, "getMultiSelectedBlocks", function() { return getMultiSelectedBlocks; });
1997  __webpack_require__.d(selectors_namespaceObject, "getFirstMultiSelectedBlockClientId", function() { return getFirstMultiSelectedBlockClientId; });
1998  __webpack_require__.d(selectors_namespaceObject, "getLastMultiSelectedBlockClientId", function() { return getLastMultiSelectedBlockClientId; });
1999  __webpack_require__.d(selectors_namespaceObject, "isFirstMultiSelectedBlock", function() { return isFirstMultiSelectedBlock; });
2000  __webpack_require__.d(selectors_namespaceObject, "isBlockMultiSelected", function() { return isBlockMultiSelected; });
2001  __webpack_require__.d(selectors_namespaceObject, "isAncestorMultiSelected", function() { return isAncestorMultiSelected; });
2002  __webpack_require__.d(selectors_namespaceObject, "getMultiSelectedBlocksStartClientId", function() { return getMultiSelectedBlocksStartClientId; });
2003  __webpack_require__.d(selectors_namespaceObject, "getMultiSelectedBlocksEndClientId", function() { return getMultiSelectedBlocksEndClientId; });
2004  __webpack_require__.d(selectors_namespaceObject, "getBlockOrder", function() { return getBlockOrder; });
2005  __webpack_require__.d(selectors_namespaceObject, "getBlockIndex", function() { return getBlockIndex; });
2006  __webpack_require__.d(selectors_namespaceObject, "isBlockSelected", function() { return isBlockSelected; });
2007  __webpack_require__.d(selectors_namespaceObject, "hasSelectedInnerBlock", function() { return hasSelectedInnerBlock; });
2008  __webpack_require__.d(selectors_namespaceObject, "isBlockWithinSelection", function() { return isBlockWithinSelection; });
2009  __webpack_require__.d(selectors_namespaceObject, "hasMultiSelection", function() { return hasMultiSelection; });
2010  __webpack_require__.d(selectors_namespaceObject, "isMultiSelecting", function() { return isMultiSelecting; });
2011  __webpack_require__.d(selectors_namespaceObject, "isSelectionEnabled", function() { return isSelectionEnabled; });
2012  __webpack_require__.d(selectors_namespaceObject, "getBlockMode", function() { return getBlockMode; });
2013  __webpack_require__.d(selectors_namespaceObject, "isTyping", function() { return isTyping; });
2014  __webpack_require__.d(selectors_namespaceObject, "isCaretWithinFormattedText", function() { return isCaretWithinFormattedText; });
2015  __webpack_require__.d(selectors_namespaceObject, "getBlockInsertionPoint", function() { return getBlockInsertionPoint; });
2016  __webpack_require__.d(selectors_namespaceObject, "isBlockInsertionPointVisible", function() { return isBlockInsertionPointVisible; });
2017  __webpack_require__.d(selectors_namespaceObject, "isValidTemplate", function() { return isValidTemplate; });
2018  __webpack_require__.d(selectors_namespaceObject, "getTemplate", function() { return getTemplate; });
2019  __webpack_require__.d(selectors_namespaceObject, "getTemplateLock", function() { return getTemplateLock; });
2020  __webpack_require__.d(selectors_namespaceObject, "canInsertBlockType", function() { return selectors_canInsertBlockType; });
2021  __webpack_require__.d(selectors_namespaceObject, "getInserterItems", function() { return selectors_getInserterItems; });
2022  __webpack_require__.d(selectors_namespaceObject, "hasInserterItems", function() { return hasInserterItems; });
2023  __webpack_require__.d(selectors_namespaceObject, "getBlockListSettings", function() { return getBlockListSettings; });
2024  
2025  // EXTERNAL MODULE: external {"this":["wp","blockEditor"]}
2026  var external_this_wp_blockEditor_ = __webpack_require__(6);
2027  
2028  // EXTERNAL MODULE: external {"this":["wp","blocks"]}
2029  var external_this_wp_blocks_ = __webpack_require__(10);
2030  
2031  // EXTERNAL MODULE: external {"this":["wp","coreData"]}
2032  var external_this_wp_coreData_ = __webpack_require__(75);
2033  
2034  // EXTERNAL MODULE: external {"this":["wp","keyboardShortcuts"]}
2035  var external_this_wp_keyboardShortcuts_ = __webpack_require__(48);
2036  
2037  // EXTERNAL MODULE: external {"this":["wp","notices"]}
2038  var external_this_wp_notices_ = __webpack_require__(182);
2039  
2040  // EXTERNAL MODULE: external {"this":["wp","richText"]}
2041  var external_this_wp_richText_ = __webpack_require__(24);
2042  
2043  // EXTERNAL MODULE: external {"this":["wp","viewport"]}
2044  var external_this_wp_viewport_ = __webpack_require__(56);
2045  
2046  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
2047  var defineProperty = __webpack_require__(5);
2048  
2049  // EXTERNAL MODULE: external {"this":["wp","data"]}
2050  var external_this_wp_data_ = __webpack_require__(4);
2051  
2052  // EXTERNAL MODULE: external {"this":["wp","dataControls"]}
2053  var external_this_wp_dataControls_ = __webpack_require__(44);
2054  
2055  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
2056  var esm_typeof = __webpack_require__(34);
2057  
2058  // EXTERNAL MODULE: ./node_modules/redux-optimist/index.js
2059  var redux_optimist = __webpack_require__(115);
2060  var redux_optimist_default = /*#__PURE__*/__webpack_require__.n(redux_optimist);
2061  
2062  // EXTERNAL MODULE: external {"this":"lodash"}
2063  var external_this_lodash_ = __webpack_require__(2);
2064  
2065  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/defaults.js
2066  
2067  
2068  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; }
2069  
2070  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; }
2071  
2072  /**
2073   * WordPress dependencies
2074   */
2075  
2076  var PREFERENCES_DEFAULTS = {
2077    insertUsage: {},
2078    // Should be kept for backward compatibility, see: https://github.com/WordPress/gutenberg/issues/14580.
2079    isPublishSidebarEnabled: true
2080  };
2081  /**
2082   * The default post editor settings
2083   *
2084   *  allowedBlockTypes  boolean|Array Allowed block types
2085   *  richEditingEnabled boolean       Whether rich editing is enabled or not
2086   *  codeEditingEnabled boolean       Whether code editing is enabled or not
2087   *  enableCustomFields boolean       Whether the WordPress custom fields are enabled or not
2088   *  autosaveInterval   number        Autosave Interval
2089   *  availableTemplates array?        The available post templates
2090   *  disablePostFormats boolean       Whether or not the post formats are disabled
2091   *  allowedMimeTypes   array?        List of allowed mime types and file extensions
2092   *  maxUploadFileSize  number        Maximum upload file size
2093   */
2094  
2095  var EDITOR_SETTINGS_DEFAULTS = _objectSpread({}, external_this_wp_blockEditor_["SETTINGS_DEFAULTS"], {
2096    richEditingEnabled: true,
2097    codeEditingEnabled: true,
2098    enableCustomFields: false
2099  });
2100  
2101  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/reducer.js
2102  
2103  
2104  
2105  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; }
2106  
2107  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; }
2108  
2109  /**
2110   * External dependencies
2111   */
2112  
2113  
2114  /**
2115   * WordPress dependencies
2116   */
2117  
2118  
2119  /**
2120   * Internal dependencies
2121   */
2122  
2123  
2124  /**
2125   * Returns a post attribute value, flattening nested rendered content using its
2126   * raw value in place of its original object form.
2127   *
2128   * @param {*} value Original value.
2129   *
2130   * @return {*} Raw value.
2131   */
2132  
2133  function getPostRawValue(value) {
2134    if (value && 'object' === Object(esm_typeof["a" /* default */])(value) && 'raw' in value) {
2135      return value.raw;
2136    }
2137  
2138    return value;
2139  }
2140  /**
2141   * Returns true if the two object arguments have the same keys, or false
2142   * otherwise.
2143   *
2144   * @param {Object} a First object.
2145   * @param {Object} b Second object.
2146   *
2147   * @return {boolean} Whether the two objects have the same keys.
2148   */
2149  
2150  function hasSameKeys(a, b) {
2151    return Object(external_this_lodash_["isEqual"])(Object(external_this_lodash_["keys"])(a), Object(external_this_lodash_["keys"])(b));
2152  }
2153  /**
2154   * Returns true if, given the currently dispatching action and the previously
2155   * dispatched action, the two actions are editing the same post property, or
2156   * false otherwise.
2157   *
2158   * @param {Object} action         Currently dispatching action.
2159   * @param {Object} previousAction Previously dispatched action.
2160   *
2161   * @return {boolean} Whether actions are updating the same post property.
2162   */
2163  
2164  function isUpdatingSamePostProperty(action, previousAction) {
2165    return action.type === 'EDIT_POST' && hasSameKeys(action.edits, previousAction.edits);
2166  }
2167  /**
2168   * Returns true if, given the currently dispatching action and the previously
2169   * dispatched action, the two actions are modifying the same property such that
2170   * undo history should be batched.
2171   *
2172   * @param {Object} action         Currently dispatching action.
2173   * @param {Object} previousAction Previously dispatched action.
2174   *
2175   * @return {boolean} Whether to overwrite present state.
2176   */
2177  
2178  function shouldOverwriteState(action, previousAction) {
2179    if (action.type === 'RESET_EDITOR_BLOCKS') {
2180      return !action.shouldCreateUndoLevel;
2181    }
2182  
2183    if (!previousAction || action.type !== previousAction.type) {
2184      return false;
2185    }
2186  
2187    return isUpdatingSamePostProperty(action, previousAction);
2188  }
2189  function reducer_postId() {
2190    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
2191    var action = arguments.length > 1 ? arguments[1] : undefined;
2192  
2193    switch (action.type) {
2194      case 'SETUP_EDITOR_STATE':
2195      case 'RESET_POST':
2196      case 'UPDATE_POST':
2197        return action.post.id;
2198    }
2199  
2200    return state;
2201  }
2202  function reducer_postType() {
2203    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
2204    var action = arguments.length > 1 ? arguments[1] : undefined;
2205  
2206    switch (action.type) {
2207      case 'SETUP_EDITOR_STATE':
2208      case 'RESET_POST':
2209      case 'UPDATE_POST':
2210        return action.post.type;
2211    }
2212  
2213    return state;
2214  }
2215  /**
2216   * Reducer returning whether the post blocks match the defined template or not.
2217   *
2218   * @param {Object} state  Current state.
2219   * @param {Object} action Dispatched action.
2220   *
2221   * @return {boolean} Updated state.
2222   */
2223  
2224  function reducer_template() {
2225    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
2226      isValid: true
2227    };
2228    var action = arguments.length > 1 ? arguments[1] : undefined;
2229  
2230    switch (action.type) {
2231      case 'SET_TEMPLATE_VALIDITY':
2232        return reducer_objectSpread({}, state, {
2233          isValid: action.isValid
2234        });
2235    }
2236  
2237    return state;
2238  }
2239  /**
2240   * Reducer returning the user preferences.
2241   *
2242   * @param {Object}  state                 Current state.
2243   * @param {Object}  action                Dispatched action.
2244   *
2245   * @return {string} Updated state.
2246   */
2247  
2248  function preferences() {
2249    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : PREFERENCES_DEFAULTS;
2250    var action = arguments.length > 1 ? arguments[1] : undefined;
2251  
2252    switch (action.type) {
2253      case 'ENABLE_PUBLISH_SIDEBAR':
2254        return reducer_objectSpread({}, state, {
2255          isPublishSidebarEnabled: true
2256        });
2257  
2258      case 'DISABLE_PUBLISH_SIDEBAR':
2259        return reducer_objectSpread({}, state, {
2260          isPublishSidebarEnabled: false
2261        });
2262    }
2263  
2264    return state;
2265  }
2266  /**
2267   * Reducer returning current network request state (whether a request to
2268   * the WP REST API is in progress, successful, or failed).
2269   *
2270   * @param {Object} state  Current state.
2271   * @param {Object} action Dispatched action.
2272   *
2273   * @return {Object} Updated state.
2274   */
2275  
2276  function saving() {
2277    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2278    var action = arguments.length > 1 ? arguments[1] : undefined;
2279  
2280    switch (action.type) {
2281      case 'REQUEST_POST_UPDATE_START':
2282      case 'REQUEST_POST_UPDATE_FINISH':
2283        return {
2284          pending: action.type === 'REQUEST_POST_UPDATE_START',
2285          options: action.options || {}
2286        };
2287    }
2288  
2289    return state;
2290  }
2291  /**
2292   * Post Lock State.
2293   *
2294   * @typedef {Object} PostLockState
2295   *
2296   * @property {boolean} isLocked       Whether the post is locked.
2297   * @property {?boolean} isTakeover     Whether the post editing has been taken over.
2298   * @property {?boolean} activePostLock Active post lock value.
2299   * @property {?Object}  user           User that took over the post.
2300   */
2301  
2302  /**
2303   * Reducer returning the post lock status.
2304   *
2305   * @param {PostLockState} state  Current state.
2306   * @param {Object} action Dispatched action.
2307   *
2308   * @return {PostLockState} Updated state.
2309   */
2310  
2311  function postLock() {
2312    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
2313      isLocked: false
2314    };
2315    var action = arguments.length > 1 ? arguments[1] : undefined;
2316  
2317    switch (action.type) {
2318      case 'UPDATE_POST_LOCK':
2319        return action.lock;
2320    }
2321  
2322    return state;
2323  }
2324  /**
2325   * Post saving lock.
2326   *
2327   * When post saving is locked, the post cannot be published or updated.
2328   *
2329   * @param {PostLockState} state  Current state.
2330   * @param {Object}        action Dispatched action.
2331   *
2332   * @return {PostLockState} Updated state.
2333   */
2334  
2335  function postSavingLock() {
2336    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2337    var action = arguments.length > 1 ? arguments[1] : undefined;
2338  
2339    switch (action.type) {
2340      case 'LOCK_POST_SAVING':
2341        return reducer_objectSpread({}, state, Object(defineProperty["a" /* default */])({}, action.lockName, true));
2342  
2343      case 'UNLOCK_POST_SAVING':
2344        return Object(external_this_lodash_["omit"])(state, action.lockName);
2345    }
2346  
2347    return state;
2348  }
2349  /**
2350   * Post autosaving lock.
2351   *
2352   * When post autosaving is locked, the post will not autosave.
2353   *
2354   * @param {PostLockState} state  Current state.
2355   * @param {Object}        action Dispatched action.
2356   *
2357   * @return {PostLockState} Updated state.
2358   */
2359  
2360  function postAutosavingLock() {
2361    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2362    var action = arguments.length > 1 ? arguments[1] : undefined;
2363  
2364    switch (action.type) {
2365      case 'LOCK_POST_AUTOSAVING':
2366        return reducer_objectSpread({}, state, Object(defineProperty["a" /* default */])({}, action.lockName, true));
2367  
2368      case 'UNLOCK_POST_AUTOSAVING':
2369        return Object(external_this_lodash_["omit"])(state, action.lockName);
2370    }
2371  
2372    return state;
2373  }
2374  var reducer_reusableBlocks = Object(external_this_wp_data_["combineReducers"])({
2375    data: function data() {
2376      var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2377      var action = arguments.length > 1 ? arguments[1] : undefined;
2378  
2379      switch (action.type) {
2380        case 'RECEIVE_REUSABLE_BLOCKS':
2381          {
2382            return reducer_objectSpread({}, state, {}, Object(external_this_lodash_["keyBy"])(action.results, 'id'));
2383          }
2384  
2385        case 'UPDATE_REUSABLE_BLOCK':
2386          {
2387            var id = action.id,
2388                changes = action.changes;
2389            return reducer_objectSpread({}, state, Object(defineProperty["a" /* default */])({}, id, reducer_objectSpread({}, state[id], {}, changes)));
2390          }
2391  
2392        case 'SAVE_REUSABLE_BLOCK_SUCCESS':
2393          {
2394            var _id = action.id,
2395                updatedId = action.updatedId; // If a temporary reusable block is saved, we swap the temporary id with the final one
2396  
2397            if (_id === updatedId) {
2398              return state;
2399            }
2400  
2401            var value = state[_id];
2402            return reducer_objectSpread({}, Object(external_this_lodash_["omit"])(state, _id), Object(defineProperty["a" /* default */])({}, updatedId, reducer_objectSpread({}, value, {
2403              id: updatedId
2404            })));
2405          }
2406  
2407        case 'REMOVE_REUSABLE_BLOCK':
2408          {
2409            var _id2 = action.id;
2410            return Object(external_this_lodash_["omit"])(state, _id2);
2411          }
2412      }
2413  
2414      return state;
2415    },
2416    isFetching: function isFetching() {
2417      var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2418      var action = arguments.length > 1 ? arguments[1] : undefined;
2419  
2420      switch (action.type) {
2421        case 'FETCH_REUSABLE_BLOCKS':
2422          {
2423            var id = action.id;
2424  
2425            if (!id) {
2426              return state;
2427            }
2428  
2429            return reducer_objectSpread({}, state, Object(defineProperty["a" /* default */])({}, id, true));
2430          }
2431  
2432        case 'FETCH_REUSABLE_BLOCKS_SUCCESS':
2433        case 'FETCH_REUSABLE_BLOCKS_FAILURE':
2434          {
2435            var _id3 = action.id;
2436            return Object(external_this_lodash_["omit"])(state, _id3);
2437          }
2438      }
2439  
2440      return state;
2441    },
2442    isSaving: function isSaving() {
2443      var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2444      var action = arguments.length > 1 ? arguments[1] : undefined;
2445  
2446      switch (action.type) {
2447        case 'SAVE_REUSABLE_BLOCK':
2448          return reducer_objectSpread({}, state, Object(defineProperty["a" /* default */])({}, action.id, true));
2449  
2450        case 'SAVE_REUSABLE_BLOCK_SUCCESS':
2451        case 'SAVE_REUSABLE_BLOCK_FAILURE':
2452          {
2453            var id = action.id;
2454            return Object(external_this_lodash_["omit"])(state, id);
2455          }
2456      }
2457  
2458      return state;
2459    }
2460  });
2461  /**
2462   * Reducer returning whether the editor is ready to be rendered.
2463   * The editor is considered ready to be rendered once
2464   * the post object is loaded properly and the initial blocks parsed.
2465   *
2466   * @param {boolean} state
2467   * @param {Object} action
2468   *
2469   * @return {boolean} Updated state.
2470   */
2471  
2472  function reducer_isReady() {
2473    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
2474    var action = arguments.length > 1 ? arguments[1] : undefined;
2475  
2476    switch (action.type) {
2477      case 'SETUP_EDITOR_STATE':
2478        return true;
2479  
2480      case 'TEAR_DOWN_EDITOR':
2481        return false;
2482    }
2483  
2484    return state;
2485  }
2486  /**
2487   * Reducer returning the post editor setting.
2488   *
2489   * @param {Object} state  Current state.
2490   * @param {Object} action Dispatched action.
2491   *
2492   * @return {Object} Updated state.
2493   */
2494  
2495  function reducer_editorSettings() {
2496    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : EDITOR_SETTINGS_DEFAULTS;
2497    var action = arguments.length > 1 ? arguments[1] : undefined;
2498  
2499    switch (action.type) {
2500      case 'UPDATE_EDITOR_SETTINGS':
2501        return reducer_objectSpread({}, state, {}, action.settings);
2502    }
2503  
2504    return state;
2505  }
2506  /* harmony default export */ var reducer = (redux_optimist_default()(Object(external_this_wp_data_["combineReducers"])({
2507    postId: reducer_postId,
2508    postType: reducer_postType,
2509    preferences: preferences,
2510    saving: saving,
2511    postLock: postLock,
2512    reusableBlocks: reducer_reusableBlocks,
2513    template: reducer_template,
2514    postSavingLock: postSavingLock,
2515    isReady: reducer_isReady,
2516    editorSettings: reducer_editorSettings,
2517    postAutosavingLock: postAutosavingLock
2518  })));
2519  
2520  // EXTERNAL MODULE: ./node_modules/refx/refx.js
2521  var refx = __webpack_require__(89);
2522  var refx_default = /*#__PURE__*/__webpack_require__.n(refx);
2523  
2524  // EXTERNAL MODULE: external {"this":"regeneratorRuntime"}
2525  var external_this_regeneratorRuntime_ = __webpack_require__(23);
2526  var external_this_regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(external_this_regeneratorRuntime_);
2527  
2528  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
2529  var asyncToGenerator = __webpack_require__(49);
2530  
2531  // EXTERNAL MODULE: external {"this":["wp","apiFetch"]}
2532  var external_this_wp_apiFetch_ = __webpack_require__(42);
2533  var external_this_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_this_wp_apiFetch_);
2534  
2535  // EXTERNAL MODULE: external {"this":["wp","i18n"]}
2536  var external_this_wp_i18n_ = __webpack_require__(1);
2537  
2538  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
2539  var toConsumableArray = __webpack_require__(18);
2540  
2541  // EXTERNAL MODULE: external {"this":["wp","deprecated"]}
2542  var external_this_wp_deprecated_ = __webpack_require__(37);
2543  var external_this_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_this_wp_deprecated_);
2544  
2545  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/constants.js
2546  /**
2547   * Set of post properties for which edits should assume a merging behavior,
2548   * assuming an object value.
2549   *
2550   * @type {Set}
2551   */
2552  var EDIT_MERGE_PROPERTIES = new Set(['meta']);
2553  /**
2554   * Constant for the store module (or reducer) key.
2555   *
2556   * @type {string}
2557   */
2558  
2559  var STORE_KEY = 'core/editor';
2560  var POST_UPDATE_TRANSACTION_ID = 'post-update';
2561  var SAVE_POST_NOTICE_ID = 'SAVE_POST_NOTICE_ID';
2562  var TRASH_POST_NOTICE_ID = 'TRASH_POST_NOTICE_ID';
2563  var PERMALINK_POSTNAME_REGEX = /%(?:postname|pagename)%/;
2564  var ONE_MINUTE_IN_MS = 60 * 1000;
2565  var AUTOSAVE_PROPERTIES = ['title', 'excerpt', 'content'];
2566  
2567  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/utils/notice-builder.js
2568  /**
2569   * WordPress dependencies
2570   */
2571  
2572  /**
2573   * Internal dependencies
2574   */
2575  
2576  
2577  /**
2578   * External dependencies
2579   */
2580  
2581  
2582  /**
2583   * Builds the arguments for a success notification dispatch.
2584   *
2585   * @param {Object} data Incoming data to build the arguments from.
2586   *
2587   * @return {Array} Arguments for dispatch. An empty array signals no
2588   *                 notification should be sent.
2589   */
2590  
2591  function getNotificationArgumentsForSaveSuccess(data) {
2592    var previousPost = data.previousPost,
2593        post = data.post,
2594        postType = data.postType; // Autosaves are neither shown a notice nor redirected.
2595  
2596    if (Object(external_this_lodash_["get"])(data.options, ['isAutosave'])) {
2597      return [];
2598    }
2599  
2600    var publishStatus = ['publish', 'private', 'future'];
2601    var isPublished = Object(external_this_lodash_["includes"])(publishStatus, previousPost.status);
2602    var willPublish = Object(external_this_lodash_["includes"])(publishStatus, post.status);
2603    var noticeMessage;
2604    var shouldShowLink = Object(external_this_lodash_["get"])(postType, ['viewable'], false);
2605  
2606    if (!isPublished && !willPublish) {
2607      // If saving a non-published post, don't show notice.
2608      noticeMessage = null;
2609    } else if (isPublished && !willPublish) {
2610      // If undoing publish status, show specific notice
2611      noticeMessage = postType.labels.item_reverted_to_draft;
2612      shouldShowLink = false;
2613    } else if (!isPublished && willPublish) {
2614      // If publishing or scheduling a post, show the corresponding
2615      // publish message
2616      noticeMessage = {
2617        publish: postType.labels.item_published,
2618        private: postType.labels.item_published_privately,
2619        future: postType.labels.item_scheduled
2620      }[post.status];
2621    } else {
2622      // Generic fallback notice
2623      noticeMessage = postType.labels.item_updated;
2624    }
2625  
2626    if (noticeMessage) {
2627      var actions = [];
2628  
2629      if (shouldShowLink) {
2630        actions.push({
2631          label: postType.labels.view_item,
2632          url: post.link
2633        });
2634      }
2635  
2636      return [noticeMessage, {
2637        id: SAVE_POST_NOTICE_ID,
2638        type: 'snackbar',
2639        actions: actions
2640      }];
2641    }
2642  
2643    return [];
2644  }
2645  /**
2646   * Builds the fail notification arguments for dispatch.
2647   *
2648   * @param {Object} data Incoming data to build the arguments with.
2649   *
2650   * @return {Array} Arguments for dispatch. An empty array signals no
2651   *                 notification should be sent.
2652   */
2653  
2654  function getNotificationArgumentsForSaveFail(data) {
2655    var post = data.post,
2656        edits = data.edits,
2657        error = data.error;
2658  
2659    if (error && 'rest_autosave_no_changes' === error.code) {
2660      // Autosave requested a new autosave, but there were no changes. This shouldn't
2661      // result in an error notice for the user.
2662      return [];
2663    }
2664  
2665    var publishStatus = ['publish', 'private', 'future'];
2666    var isPublished = publishStatus.indexOf(post.status) !== -1; // If the post was being published, we show the corresponding publish error message
2667    // Unless we publish an "updating failed" message
2668  
2669    var messages = {
2670      publish: Object(external_this_wp_i18n_["__"])('Publishing failed.'),
2671      private: Object(external_this_wp_i18n_["__"])('Publishing failed.'),
2672      future: Object(external_this_wp_i18n_["__"])('Scheduling failed.')
2673    };
2674    var noticeMessage = !isPublished && publishStatus.indexOf(edits.status) !== -1 ? messages[edits.status] : Object(external_this_wp_i18n_["__"])('Updating failed.'); // Check if message string contains HTML. Notice text is currently only
2675    // supported as plaintext, and stripping the tags may muddle the meaning.
2676  
2677    if (error.message && !/<\/?[^>]*>/.test(error.message)) {
2678      noticeMessage = [noticeMessage, error.message].join(' ');
2679    }
2680  
2681    return [noticeMessage, {
2682      id: SAVE_POST_NOTICE_ID
2683    }];
2684  }
2685  /**
2686   * Builds the trash fail notification arguments for dispatch.
2687   *
2688   * @param {Object} data
2689   *
2690   * @return {Array} Arguments for dispatch.
2691   */
2692  
2693  function getNotificationArgumentsForTrashFail(data) {
2694    return [data.error.message && data.error.code !== 'unknown_error' ? data.error.message : Object(external_this_wp_i18n_["__"])('Trashing failed'), {
2695      id: TRASH_POST_NOTICE_ID
2696    }];
2697  }
2698  
2699  // EXTERNAL MODULE: ./node_modules/memize/index.js
2700  var memize = __webpack_require__(46);
2701  var memize_default = /*#__PURE__*/__webpack_require__.n(memize);
2702  
2703  // EXTERNAL MODULE: external {"this":["wp","autop"]}
2704  var external_this_wp_autop_ = __webpack_require__(85);
2705  
2706  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/utils/serialize-blocks.js
2707  /**
2708   * External dependencies
2709   */
2710  
2711  /**
2712   * WordPress dependencies
2713   */
2714  
2715  
2716  
2717  /**
2718   * Serializes blocks following backwards compatibility conventions.
2719   *
2720   * @param {Array} blocksForSerialization The blocks to serialize.
2721   *
2722   * @return {string} The blocks serialization.
2723   */
2724  
2725  var serializeBlocks = memize_default()(function (blocksForSerialization) {
2726    // A single unmodified default block is assumed to
2727    // be equivalent to an empty post.
2728    if (blocksForSerialization.length === 1 && Object(external_this_wp_blocks_["isUnmodifiedDefaultBlock"])(blocksForSerialization[0])) {
2729      blocksForSerialization = [];
2730    }
2731  
2732    var content = Object(external_this_wp_blocks_["serialize"])(blocksForSerialization); // For compatibility, treat a post consisting of a
2733    // single freeform block as legacy content and apply
2734    // pre-block-editor removep'd content formatting.
2735  
2736    if (blocksForSerialization.length === 1 && blocksForSerialization[0].name === Object(external_this_wp_blocks_["getFreeformContentHandlerName"])()) {
2737      content = Object(external_this_wp_autop_["removep"])(content);
2738    }
2739  
2740    return content;
2741  }, {
2742    maxSize: 1
2743  });
2744  /* harmony default export */ var serialize_blocks = (serializeBlocks);
2745  
2746  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/actions.js
2747  
2748  
2749  
2750  
2751  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; }
2752  
2753  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; }
2754  
2755  var _marked =
2756  /*#__PURE__*/
2757  external_this_regeneratorRuntime_default.a.mark(setupEditor),
2758      _marked2 =
2759  /*#__PURE__*/
2760  external_this_regeneratorRuntime_default.a.mark(resetAutosave),
2761      _marked3 =
2762  /*#__PURE__*/
2763  external_this_regeneratorRuntime_default.a.mark(actions_editPost),
2764      _marked4 =
2765  /*#__PURE__*/
2766  external_this_regeneratorRuntime_default.a.mark(actions_savePost),
2767      _marked5 =
2768  /*#__PURE__*/
2769  external_this_regeneratorRuntime_default.a.mark(refreshPost),
2770      _marked6 =
2771  /*#__PURE__*/
2772  external_this_regeneratorRuntime_default.a.mark(trashPost),
2773      _marked7 =
2774  /*#__PURE__*/
2775  external_this_regeneratorRuntime_default.a.mark(actions_autosave),
2776      _marked8 =
2777  /*#__PURE__*/
2778  external_this_regeneratorRuntime_default.a.mark(actions_experimentalLocalAutosave),
2779      _marked9 =
2780  /*#__PURE__*/
2781  external_this_regeneratorRuntime_default.a.mark(actions_redo),
2782      _marked10 =
2783  /*#__PURE__*/
2784  external_this_regeneratorRuntime_default.a.mark(actions_undo),
2785      _marked11 =
2786  /*#__PURE__*/
2787  external_this_regeneratorRuntime_default.a.mark(actions_resetEditorBlocks);
2788  
2789  /**
2790   * External dependencies
2791   */
2792  
2793  /**
2794   * WordPress dependencies
2795   */
2796  
2797  
2798  
2799  
2800  /**
2801   * Internal dependencies
2802   */
2803  
2804  
2805  
2806  
2807  /**
2808   * Returns an action generator used in signalling that editor has initialized with
2809   * the specified post object and editor settings.
2810   *
2811   * @param {Object} post      Post object.
2812   * @param {Object} edits     Initial edited attributes object.
2813   * @param {Array?} template  Block Template.
2814   */
2815  
2816  function setupEditor(post, edits, template) {
2817    var content, blocks, isNewPost;
2818    return external_this_regeneratorRuntime_default.a.wrap(function setupEditor$(_context) {
2819      while (1) {
2820        switch (_context.prev = _context.next) {
2821          case 0:
2822            // In order to ensure maximum of a single parse during setup, edits are
2823            // included as part of editor setup action. Assume edited content as
2824            // canonical if provided, falling back to post.
2825            if (Object(external_this_lodash_["has"])(edits, ['content'])) {
2826              content = edits.content;
2827            } else {
2828              content = post.content.raw;
2829            }
2830  
2831            blocks = Object(external_this_wp_blocks_["parse"])(content); // Apply a template for new posts only, if exists.
2832  
2833            isNewPost = post.status === 'auto-draft';
2834  
2835            if (isNewPost && template) {
2836              blocks = Object(external_this_wp_blocks_["synchronizeBlocksWithTemplate"])(blocks, template);
2837            }
2838  
2839            _context.next = 6;
2840            return resetPost(post);
2841  
2842          case 6:
2843            _context.next = 8;
2844            return {
2845              type: 'SETUP_EDITOR',
2846              post: post,
2847              edits: edits,
2848              template: template
2849            };
2850  
2851          case 8:
2852            _context.next = 10;
2853            return actions_resetEditorBlocks(blocks, {
2854              __unstableShouldCreateUndoLevel: false
2855            });
2856  
2857          case 10:
2858            _context.next = 12;
2859            return setupEditorState(post);
2860  
2861          case 12:
2862            if (!(edits && Object.keys(edits).some(function (key) {
2863              return edits[key] !== (Object(external_this_lodash_["has"])(post, [key, 'raw']) ? post[key].raw : post[key]);
2864            }))) {
2865              _context.next = 15;
2866              break;
2867            }
2868  
2869            _context.next = 15;
2870            return actions_editPost(edits);
2871  
2872          case 15:
2873          case "end":
2874            return _context.stop();
2875        }
2876      }
2877    }, _marked);
2878  }
2879  /**
2880   * Returns an action object signalling that the editor is being destroyed and
2881   * that any necessary state or side-effect cleanup should occur.
2882   *
2883   * @return {Object} Action object.
2884   */
2885  
2886  function __experimentalTearDownEditor() {
2887    return {
2888      type: 'TEAR_DOWN_EDITOR'
2889    };
2890  }
2891  /**
2892   * Returns an action object used in signalling that the latest version of the
2893   * post has been received, either by initialization or save.
2894   *
2895   * @param {Object} post Post object.
2896   *
2897   * @return {Object} Action object.
2898   */
2899  
2900  function resetPost(post) {
2901    return {
2902      type: 'RESET_POST',
2903      post: post
2904    };
2905  }
2906  /**
2907   * Returns an action object used in signalling that the latest autosave of the
2908   * post has been received, by initialization or autosave.
2909   *
2910   * @deprecated since 5.6. Callers should use the `receiveAutosaves( postId, autosave )`
2911   *                selector from the '@wordpress/core-data' package.
2912   *
2913   * @param {Object} newAutosave Autosave post object.
2914   *
2915   * @return {Object} Action object.
2916   */
2917  
2918  function resetAutosave(newAutosave) {
2919    var postId;
2920    return external_this_regeneratorRuntime_default.a.wrap(function resetAutosave$(_context2) {
2921      while (1) {
2922        switch (_context2.prev = _context2.next) {
2923          case 0:
2924            external_this_wp_deprecated_default()('resetAutosave action (`core/editor` store)', {
2925              alternative: 'receiveAutosaves action (`core` store)',
2926              plugin: 'Gutenberg'
2927            });
2928            _context2.next = 3;
2929            return Object(external_this_wp_dataControls_["select"])(STORE_KEY, 'getCurrentPostId');
2930  
2931          case 3:
2932            postId = _context2.sent;
2933            _context2.next = 6;
2934            return Object(external_this_wp_dataControls_["dispatch"])('core', 'receiveAutosaves', postId, newAutosave);
2935  
2936          case 6:
2937            return _context2.abrupt("return", {
2938              type: '__INERT__'
2939            });
2940  
2941          case 7:
2942          case "end":
2943            return _context2.stop();
2944        }
2945      }
2946    }, _marked2);
2947  }
2948  /**
2949   * Action for dispatching that a post update request has started.
2950   *
2951   * @param {Object} options
2952   *
2953   * @return {Object} An action object
2954   */
2955  
2956  function __experimentalRequestPostUpdateStart() {
2957    var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2958    return {
2959      type: 'REQUEST_POST_UPDATE_START',
2960      options: options
2961    };
2962  }
2963  /**
2964   * Action for dispatching that a post update request has finished.
2965   *
2966   * @param {Object} options
2967   *
2968   * @return {Object} An action object
2969   */
2970  
2971  function __experimentalRequestPostUpdateFinish() {
2972    var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2973    return {
2974      type: 'REQUEST_POST_UPDATE_FINISH',
2975      options: options
2976    };
2977  }
2978  /**
2979   * Returns an action object used in signalling that a patch of updates for the
2980   * latest version of the post have been received.
2981   *
2982   * @param {Object} edits Updated post fields.
2983   *
2984   * @return {Object} Action object.
2985   */
2986  
2987  function updatePost(edits) {
2988    return {
2989      type: 'UPDATE_POST',
2990      edits: edits
2991    };
2992  }
2993  /**
2994   * Returns an action object used to setup the editor state when first opening
2995   * an editor.
2996   *
2997   * @param {Object} post   Post object.
2998   *
2999   * @return {Object} Action object.
3000   */
3001  
3002  function setupEditorState(post) {
3003    return {
3004      type: 'SETUP_EDITOR_STATE',
3005      post: post
3006    };
3007  }
3008  /**
3009   * Returns an action object used in signalling that attributes of the post have
3010   * been edited.
3011   *
3012   * @param {Object} edits   Post attributes to edit.
3013   * @param {Object} options Options for the edit.
3014   *
3015   * @yield {Object} Action object or control.
3016   */
3017  
3018  function actions_editPost(edits, options) {
3019    var _ref, id, type;
3020  
3021    return external_this_regeneratorRuntime_default.a.wrap(function editPost$(_context3) {
3022      while (1) {
3023        switch (_context3.prev = _context3.next) {
3024          case 0:
3025            _context3.next = 2;
3026            return Object(external_this_wp_dataControls_["select"])(STORE_KEY, 'getCurrentPost');
3027  
3028          case 2:
3029            _ref = _context3.sent;
3030            id = _ref.id;
3031            type = _ref.type;
3032            _context3.next = 7;
3033            return Object(external_this_wp_dataControls_["dispatch"])('core', 'editEntityRecord', 'postType', type, id, edits, options);
3034  
3035          case 7:
3036          case "end":
3037            return _context3.stop();
3038        }
3039      }
3040    }, _marked3);
3041  }
3042  /**
3043   * Returns action object produced by the updatePost creator augmented by
3044   * an optimist option that signals optimistically applying updates.
3045   *
3046   * @param {Object} edits  Updated post fields.
3047   *
3048   * @return {Object} Action object.
3049   */
3050  
3051  function __experimentalOptimisticUpdatePost(edits) {
3052    return actions_objectSpread({}, updatePost(edits), {
3053      optimist: {
3054        id: POST_UPDATE_TRANSACTION_ID
3055      }
3056    });
3057  }
3058  /**
3059   * Action generator for saving the current post in the editor.
3060   *
3061   * @param {Object} options
3062   */
3063  
3064  function actions_savePost() {
3065    var options,
3066        edits,
3067        previousRecord,
3068        error,
3069        args,
3070        updatedRecord,
3071        _args4,
3072        _args5 = arguments;
3073  
3074    return external_this_regeneratorRuntime_default.a.wrap(function savePost$(_context4) {
3075      while (1) {
3076        switch (_context4.prev = _context4.next) {
3077          case 0:
3078            options = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {};
3079            _context4.next = 3;
3080            return Object(external_this_wp_dataControls_["select"])(STORE_KEY, 'isEditedPostSaveable');
3081  
3082          case 3:
3083            if (_context4.sent) {
3084              _context4.next = 5;
3085              break;
3086            }
3087  
3088            return _context4.abrupt("return");
3089  
3090          case 5:
3091            _context4.next = 7;
3092            return Object(external_this_wp_dataControls_["select"])(STORE_KEY, 'getEditedPostContent');
3093  
3094          case 7:
3095            _context4.t0 = _context4.sent;
3096            edits = {
3097              content: _context4.t0
3098            };
3099  
3100            if (options.isAutosave) {
3101              _context4.next = 12;
3102              break;
3103            }
3104  
3105            _context4.next = 12;
3106            return Object(external_this_wp_dataControls_["dispatch"])(STORE_KEY, 'editPost', edits, {
3107              undoIgnore: true
3108            });
3109  
3110          case 12:
3111            _context4.next = 14;
3112            return __experimentalRequestPostUpdateStart(options);
3113  
3114          case 14:
3115            _context4.next = 16;
3116            return Object(external_this_wp_dataControls_["select"])(STORE_KEY, 'getCurrentPost');
3117  
3118          case 16:
3119            previousRecord = _context4.sent;
3120            _context4.t1 = actions_objectSpread;
3121            _context4.t2 = {
3122              id: previousRecord.id
3123            };
3124            _context4.next = 21;
3125            return Object(external_this_wp_dataControls_["select"])('core', 'getEntityRecordNonTransientEdits', 'postType', previousRecord.type, previousRecord.id);
3126  
3127          case 21:
3128            _context4.t3 = _context4.sent;
3129            _context4.t4 = {};
3130            _context4.t5 = edits;
3131            edits = (0, _context4.t1)(_context4.t2, _context4.t3, _context4.t4, _context4.t5);
3132            _context4.next = 27;
3133            return Object(external_this_wp_dataControls_["dispatch"])('core', 'saveEntityRecord', 'postType', previousRecord.type, edits, options);
3134  
3135          case 27:
3136            _context4.next = 29;
3137            return __experimentalRequestPostUpdateFinish(options);
3138  
3139          case 29:
3140            _context4.next = 31;
3141            return Object(external_this_wp_dataControls_["select"])('core', 'getLastEntitySaveError', 'postType', previousRecord.type, previousRecord.id);
3142  
3143          case 31:
3144            error = _context4.sent;
3145  
3146            if (!error) {
3147              _context4.next = 39;
3148              break;
3149            }
3150  
3151            args = getNotificationArgumentsForSaveFail({
3152              post: previousRecord,
3153              edits: edits,
3154              error: error
3155            });
3156  
3157            if (!args.length) {
3158              _context4.next = 37;
3159              break;
3160            }
3161  
3162            _context4.next = 37;
3163            return external_this_wp_dataControls_["dispatch"].apply(void 0, ['core/notices', 'createErrorNotice'].concat(Object(toConsumableArray["a" /* default */])(args)));
3164  
3165          case 37:
3166            _context4.next = 57;
3167            break;
3168  
3169          case 39:
3170            _context4.next = 41;
3171            return Object(external_this_wp_dataControls_["select"])(STORE_KEY, 'getCurrentPost');
3172  
3173          case 41:
3174            updatedRecord = _context4.sent;
3175            _context4.t6 = getNotificationArgumentsForSaveSuccess;
3176            _context4.t7 = previousRecord;
3177            _context4.t8 = updatedRecord;
3178            _context4.next = 47;
3179            return Object(external_this_wp_dataControls_["select"])('core', 'getPostType', updatedRecord.type);
3180  
3181          case 47:
3182            _context4.t9 = _context4.sent;
3183            _context4.t10 = options;
3184            _context4.t11 = {
3185              previousPost: _context4.t7,
3186              post: _context4.t8,
3187              postType: _context4.t9,
3188              options: _context4.t10
3189            };
3190            _args4 = (0, _context4.t6)(_context4.t11);
3191  
3192            if (!_args4.length) {
3193              _context4.next = 54;
3194              break;
3195            }
3196  
3197            _context4.next = 54;
3198            return external_this_wp_dataControls_["dispatch"].apply(void 0, ['core/notices', 'createSuccessNotice'].concat(Object(toConsumableArray["a" /* default */])(_args4)));
3199  
3200          case 54:
3201            if (options.isAutosave) {
3202              _context4.next = 57;
3203              break;
3204            }
3205  
3206            _context4.next = 57;
3207            return Object(external_this_wp_dataControls_["dispatch"])('core/block-editor', '__unstableMarkLastChangeAsPersistent');
3208  
3209          case 57:
3210          case "end":
3211            return _context4.stop();
3212        }
3213      }
3214    }, _marked4);
3215  }
3216  /**
3217   * Action generator for handling refreshing the current post.
3218   */
3219  
3220  function refreshPost() {
3221    var post, postTypeSlug, postType, newPost;
3222    return external_this_regeneratorRuntime_default.a.wrap(function refreshPost$(_context5) {
3223      while (1) {
3224        switch (_context5.prev = _context5.next) {
3225          case 0:
3226            _context5.next = 2;
3227            return Object(external_this_wp_dataControls_["select"])(STORE_KEY, 'getCurrentPost');
3228  
3229          case 2:
3230            post = _context5.sent;
3231            _context5.next = 5;
3232            return Object(external_this_wp_dataControls_["select"])(STORE_KEY, 'getCurrentPostType');
3233  
3234          case 5:
3235            postTypeSlug = _context5.sent;
3236            _context5.next = 8;
3237            return Object(external_this_wp_dataControls_["select"])('core', 'getPostType', postTypeSlug);
3238  
3239          case 8:
3240            postType = _context5.sent;
3241            _context5.next = 11;
3242            return Object(external_this_wp_dataControls_["apiFetch"])({
3243              // Timestamp arg allows caller to bypass browser caching, which is
3244              // expected for this specific function.
3245              path: "/wp/v2/".concat(postType.rest_base, "/").concat(post.id) + "?context=edit&_timestamp=".concat(Date.now())
3246            });
3247  
3248          case 11:
3249            newPost = _context5.sent;
3250            _context5.next = 14;
3251            return Object(external_this_wp_dataControls_["dispatch"])(STORE_KEY, 'resetPost', newPost);
3252  
3253          case 14:
3254          case "end":
3255            return _context5.stop();
3256        }
3257      }
3258    }, _marked5);
3259  }
3260  /**
3261   * Action generator for trashing the current post in the editor.
3262   */
3263  
3264  function trashPost() {
3265    var postTypeSlug, postType, post;
3266    return external_this_regeneratorRuntime_default.a.wrap(function trashPost$(_context6) {
3267      while (1) {
3268        switch (_context6.prev = _context6.next) {
3269          case 0:
3270            _context6.next = 2;
3271            return Object(external_this_wp_dataControls_["select"])(STORE_KEY, 'getCurrentPostType');
3272  
3273          case 2:
3274            postTypeSlug = _context6.sent;
3275            _context6.next = 5;
3276            return Object(external_this_wp_dataControls_["select"])('core', 'getPostType', postTypeSlug);
3277  
3278          case 5:
3279            postType = _context6.sent;
3280            _context6.next = 8;
3281            return Object(external_this_wp_dataControls_["dispatch"])('core/notices', 'removeNotice', TRASH_POST_NOTICE_ID);
3282  
3283          case 8:
3284            _context6.prev = 8;
3285            _context6.next = 11;
3286            return Object(external_this_wp_dataControls_["select"])(STORE_KEY, 'getCurrentPost');
3287  
3288          case 11:
3289            post = _context6.sent;
3290            _context6.next = 14;
3291            return Object(external_this_wp_dataControls_["apiFetch"])({
3292              path: "/wp/v2/".concat(postType.rest_base, "/").concat(post.id),
3293              method: 'DELETE'
3294            });
3295  
3296          case 14:
3297            _context6.next = 16;
3298            return Object(external_this_wp_dataControls_["dispatch"])(STORE_KEY, 'savePost');
3299  
3300          case 16:
3301            _context6.next = 22;
3302            break;
3303  
3304          case 18:
3305            _context6.prev = 18;
3306            _context6.t0 = _context6["catch"](8);
3307            _context6.next = 22;
3308            return external_this_wp_dataControls_["dispatch"].apply(void 0, ['core/notices', 'createErrorNotice'].concat(Object(toConsumableArray["a" /* default */])(getNotificationArgumentsForTrashFail({
3309              error: _context6.t0
3310            }))));
3311  
3312          case 22:
3313          case "end":
3314            return _context6.stop();
3315        }
3316      }
3317    }, _marked6, null, [[8, 18]]);
3318  }
3319  /**
3320   * Action generator used in signalling that the post should autosave.
3321   *
3322   * @param {Object?} options Extra flags to identify the autosave.
3323   */
3324  
3325  function actions_autosave(options) {
3326    return external_this_regeneratorRuntime_default.a.wrap(function autosave$(_context7) {
3327      while (1) {
3328        switch (_context7.prev = _context7.next) {
3329          case 0:
3330            _context7.next = 2;
3331            return Object(external_this_wp_dataControls_["dispatch"])(STORE_KEY, 'savePost', actions_objectSpread({
3332              isAutosave: true
3333            }, options));
3334  
3335          case 2:
3336          case "end":
3337            return _context7.stop();
3338        }
3339      }
3340    }, _marked7);
3341  }
3342  function actions_experimentalLocalAutosave() {
3343    var post, title, content, excerpt;
3344    return external_this_regeneratorRuntime_default.a.wrap(function __experimentalLocalAutosave$(_context8) {
3345      while (1) {
3346        switch (_context8.prev = _context8.next) {
3347          case 0:
3348            _context8.next = 2;
3349            return Object(external_this_wp_dataControls_["select"])(STORE_KEY, 'getCurrentPost');
3350  
3351          case 2:
3352            post = _context8.sent;
3353            _context8.next = 5;
3354            return Object(external_this_wp_dataControls_["select"])(STORE_KEY, 'getEditedPostAttribute', 'title');
3355  
3356          case 5:
3357            title = _context8.sent;
3358            _context8.next = 8;
3359            return Object(external_this_wp_dataControls_["select"])(STORE_KEY, 'getEditedPostAttribute', 'content');
3360  
3361          case 8:
3362            content = _context8.sent;
3363            _context8.next = 11;
3364            return Object(external_this_wp_dataControls_["select"])(STORE_KEY, 'getEditedPostAttribute', 'excerpt');
3365  
3366          case 11:
3367            excerpt = _context8.sent;
3368            _context8.next = 14;
3369            return {
3370              type: 'LOCAL_AUTOSAVE_SET',
3371              postId: post.id,
3372              title: title,
3373              content: content,
3374              excerpt: excerpt
3375            };
3376  
3377          case 14:
3378          case "end":
3379            return _context8.stop();
3380        }
3381      }
3382    }, _marked8);
3383  }
3384  /**
3385   * Returns an action object used in signalling that undo history should
3386   * restore last popped state.
3387   *
3388   * @yield {Object} Action object.
3389   */
3390  
3391  function actions_redo() {
3392    return external_this_regeneratorRuntime_default.a.wrap(function redo$(_context9) {
3393      while (1) {
3394        switch (_context9.prev = _context9.next) {
3395          case 0:
3396            _context9.next = 2;
3397            return Object(external_this_wp_dataControls_["dispatch"])('core', 'redo');
3398  
3399          case 2:
3400          case "end":
3401            return _context9.stop();
3402        }
3403      }
3404    }, _marked9);
3405  }
3406  /**
3407   * Returns an action object used in signalling that undo history should pop.
3408   *
3409   * @yield {Object} Action object.
3410   */
3411  
3412  function actions_undo() {
3413    return external_this_regeneratorRuntime_default.a.wrap(function undo$(_context10) {
3414      while (1) {
3415        switch (_context10.prev = _context10.next) {
3416          case 0:
3417            _context10.next = 2;
3418            return Object(external_this_wp_dataControls_["dispatch"])('core', 'undo');
3419  
3420          case 2:
3421          case "end":
3422            return _context10.stop();
3423        }
3424      }
3425    }, _marked10);
3426  }
3427  /**
3428   * Returns an action object used in signalling that undo history record should
3429   * be created.
3430   *
3431   * @return {Object} Action object.
3432   */
3433  
3434  function createUndoLevel() {
3435    return {
3436      type: 'CREATE_UNDO_LEVEL'
3437    };
3438  }
3439  /**
3440   * Returns an action object used to lock the editor.
3441   *
3442   * @param {Object}  lock Details about the post lock status, user, and nonce.
3443   *
3444   * @return {Object} Action object.
3445   */
3446  
3447  function updatePostLock(lock) {
3448    return {
3449      type: 'UPDATE_POST_LOCK',
3450      lock: lock
3451    };
3452  }
3453  /**
3454   * Returns an action object used to fetch a single reusable block or all
3455   * reusable blocks from the REST API into the store.
3456   *
3457   * @param {?string} id If given, only a single reusable block with this ID will
3458   *                     be fetched.
3459   *
3460   * @return {Object} Action object.
3461   */
3462  
3463  function actions_experimentalFetchReusableBlocks(id) {
3464    return {
3465      type: 'FETCH_REUSABLE_BLOCKS',
3466      id: id
3467    };
3468  }
3469  /**
3470   * Returns an action object used in signalling that reusable blocks have been
3471   * received. `results` is an array of objects containing:
3472   *  - `reusableBlock` - Details about how the reusable block is persisted.
3473   *  - `parsedBlock` - The original block.
3474   *
3475   * @param {Object[]} results Reusable blocks received.
3476   *
3477   * @return {Object} Action object.
3478   */
3479  
3480  function __experimentalReceiveReusableBlocks(results) {
3481    return {
3482      type: 'RECEIVE_REUSABLE_BLOCKS',
3483      results: results
3484    };
3485  }
3486  /**
3487   * Returns an action object used to save a reusable block that's in the store to
3488   * the REST API.
3489   *
3490   * @param {Object} id The ID of the reusable block to save.
3491   *
3492   * @return {Object} Action object.
3493   */
3494  
3495  function __experimentalSaveReusableBlock(id) {
3496    return {
3497      type: 'SAVE_REUSABLE_BLOCK',
3498      id: id
3499    };
3500  }
3501  /**
3502   * Returns an action object used to delete a reusable block via the REST API.
3503   *
3504   * @param {number} id The ID of the reusable block to delete.
3505   *
3506   * @return {Object} Action object.
3507   */
3508  
3509  function __experimentalDeleteReusableBlock(id) {
3510    return {
3511      type: 'DELETE_REUSABLE_BLOCK',
3512      id: id
3513    };
3514  }
3515  /**
3516   * Returns an action object used in signalling that a reusable block is
3517   * to be updated.
3518   *
3519   * @param {number} id      The ID of the reusable block to update.
3520   * @param {Object} changes The changes to apply.
3521   *
3522   * @return {Object} Action object.
3523   */
3524  
3525  function __experimentalUpdateReusableBlock(id, changes) {
3526    return {
3527      type: 'UPDATE_REUSABLE_BLOCK',
3528      id: id,
3529      changes: changes
3530    };
3531  }
3532  /**
3533   * Returns an action object used to convert a reusable block into a static
3534   * block.
3535   *
3536   * @param {string} clientId The client ID of the block to attach.
3537   *
3538   * @return {Object} Action object.
3539   */
3540  
3541  function __experimentalConvertBlockToStatic(clientId) {
3542    return {
3543      type: 'CONVERT_BLOCK_TO_STATIC',
3544      clientId: clientId
3545    };
3546  }
3547  /**
3548   * Returns an action object used to convert a static block into a reusable
3549   * block.
3550   *
3551   * @param {string} clientIds The client IDs of the block to detach.
3552   *
3553   * @return {Object} Action object.
3554   */
3555  
3556  function __experimentalConvertBlockToReusable(clientIds) {
3557    return {
3558      type: 'CONVERT_BLOCK_TO_REUSABLE',
3559      clientIds: Object(external_this_lodash_["castArray"])(clientIds)
3560    };
3561  }
3562  /**
3563   * Returns an action object used in signalling that the user has enabled the
3564   * publish sidebar.
3565   *
3566   * @return {Object} Action object
3567   */
3568  
3569  function enablePublishSidebar() {
3570    return {
3571      type: 'ENABLE_PUBLISH_SIDEBAR'
3572    };
3573  }
3574  /**
3575   * Returns an action object used in signalling that the user has disabled the
3576   * publish sidebar.
3577   *
3578   * @return {Object} Action object
3579   */
3580  
3581  function disablePublishSidebar() {
3582    return {
3583      type: 'DISABLE_PUBLISH_SIDEBAR'
3584    };
3585  }
3586  /**
3587   * Returns an action object used to signal that post saving is locked.
3588   *
3589   * @param  {string} lockName The lock name.
3590   *
3591   * @example
3592   * ```
3593   * const { subscribe } = wp.data;
3594   *
3595   * const initialPostStatus = wp.data.select( 'core/editor' ).getEditedPostAttribute( 'status' );
3596   *
3597   * // Only allow publishing posts that are set to a future date.
3598   * if ( 'publish' !== initialPostStatus ) {
3599   *
3600   *     // Track locking.
3601   *     let locked = false;
3602   *
3603   *     // Watch for the publish event.
3604   *     let unssubscribe = subscribe( () => {
3605   *         const currentPostStatus = wp.data.select( 'core/editor' ).getEditedPostAttribute( 'status' );
3606   *         if ( 'publish' !== currentPostStatus ) {
3607   *
3608   *             // Compare the post date to the current date, lock the post if the date isn't in the future.
3609   *             const postDate = new Date( wp.data.select( 'core/editor' ).getEditedPostAttribute( 'date' ) );
3610   *             const currentDate = new Date();
3611   *             if ( postDate.getTime() <= currentDate.getTime() ) {
3612   *                 if ( ! locked ) {
3613   *                     locked = true;
3614   *                     wp.data.dispatch( 'core/editor' ).lockPostSaving( 'futurelock' );
3615   *                 }
3616   *             } else {
3617   *                 if ( locked ) {
3618   *                     locked = false;
3619   *                     wp.data.dispatch( 'core/editor' ).unlockPostSaving( 'futurelock' );
3620   *                 }
3621   *             }
3622   *         }
3623   *     } );
3624   * }
3625   * ```
3626   *
3627   * @return {Object} Action object
3628   */
3629  
3630  function lockPostSaving(lockName) {
3631    return {
3632      type: 'LOCK_POST_SAVING',
3633      lockName: lockName
3634    };
3635  }
3636  /**
3637   * Returns an action object used to signal that post saving is unlocked.
3638   *
3639   * @param  {string} lockName The lock name.
3640   *
3641   * @example
3642   * ```
3643   * // Unlock post saving with the lock key `mylock`:
3644   * wp.data.dispatch( 'core/editor' ).unlockPostSaving( 'mylock' );
3645   * ```
3646   *
3647   * @return {Object} Action object
3648   */
3649  
3650  function unlockPostSaving(lockName) {
3651    return {
3652      type: 'UNLOCK_POST_SAVING',
3653      lockName: lockName
3654    };
3655  }
3656  /**
3657   * Returns an action object used to signal that post autosaving is locked.
3658   *
3659   * @param  {string} lockName The lock name.
3660   *
3661   * @example
3662   * ```
3663   * // Lock post autosaving with the lock key `mylock`:
3664   * wp.data.dispatch( 'core/editor' ).lockPostAutosaving( 'mylock' );
3665   * ```
3666   *
3667   * @return {Object} Action object
3668   */
3669  
3670  function lockPostAutosaving(lockName) {
3671    return {
3672      type: 'LOCK_POST_AUTOSAVING',
3673      lockName: lockName
3674    };
3675  }
3676  /**
3677   * Returns an action object used to signal that post autosaving is unlocked.
3678   *
3679   * @param  {string} lockName The lock name.
3680   *
3681   * @example
3682   * ```
3683   * // Unlock post saving with the lock key `mylock`:
3684   * wp.data.dispatch( 'core/editor' ).unlockPostAutosaving( 'mylock' );
3685   * ```
3686   *
3687   * @return {Object} Action object
3688   */
3689  
3690  function unlockPostAutosaving(lockName) {
3691    return {
3692      type: 'UNLOCK_POST_AUTOSAVING',
3693      lockName: lockName
3694    };
3695  }
3696  /**
3697   * Returns an action object used to signal that the blocks have been updated.
3698   *
3699   * @param {Array}   blocks  Block Array.
3700   * @param {?Object} options Optional options.
3701   *
3702   * @yield {Object} Action object
3703   */
3704  
3705  function actions_resetEditorBlocks(blocks) {
3706    var options,
3707        __unstableShouldCreateUndoLevel,
3708        selectionStart,
3709        selectionEnd,
3710        edits,
3711        _ref2,
3712        id,
3713        type,
3714        noChange,
3715        _args12 = arguments;
3716  
3717    return external_this_regeneratorRuntime_default.a.wrap(function resetEditorBlocks$(_context11) {
3718      while (1) {
3719        switch (_context11.prev = _context11.next) {
3720          case 0:
3721            options = _args12.length > 1 && _args12[1] !== undefined ? _args12[1] : {};
3722            __unstableShouldCreateUndoLevel = options.__unstableShouldCreateUndoLevel, selectionStart = options.selectionStart, selectionEnd = options.selectionEnd;
3723            edits = {
3724              blocks: blocks,
3725              selectionStart: selectionStart,
3726              selectionEnd: selectionEnd
3727            };
3728  
3729            if (!(__unstableShouldCreateUndoLevel !== false)) {
3730              _context11.next = 19;
3731              break;
3732            }
3733  
3734            _context11.next = 6;
3735            return Object(external_this_wp_dataControls_["select"])(STORE_KEY, 'getCurrentPost');
3736  
3737          case 6:
3738            _ref2 = _context11.sent;
3739            id = _ref2.id;
3740            type = _ref2.type;
3741            _context11.next = 11;
3742            return Object(external_this_wp_dataControls_["select"])('core', 'getEditedEntityRecord', 'postType', type, id);
3743  
3744          case 11:
3745            _context11.t0 = _context11.sent.blocks;
3746            _context11.t1 = edits.blocks;
3747            noChange = _context11.t0 === _context11.t1;
3748  
3749            if (!noChange) {
3750              _context11.next = 18;
3751              break;
3752            }
3753  
3754            _context11.next = 17;
3755            return Object(external_this_wp_dataControls_["dispatch"])('core', '__unstableCreateUndoLevel', 'postType', type, id);
3756  
3757          case 17:
3758            return _context11.abrupt("return", _context11.sent);
3759  
3760          case 18:
3761            // We create a new function here on every persistent edit
3762            // to make sure the edit makes the post dirty and creates
3763            // a new undo level.
3764            edits.content = function (_ref3) {
3765              var _ref3$blocks = _ref3.blocks,
3766                  blocksForSerialization = _ref3$blocks === void 0 ? [] : _ref3$blocks;
3767              return serialize_blocks(blocksForSerialization);
3768            };
3769  
3770          case 19:
3771            return _context11.delegateYield(actions_editPost(edits), "t2", 20);
3772  
3773          case 20:
3774          case "end":
3775            return _context11.stop();
3776        }
3777      }
3778    }, _marked11);
3779  }
3780  /*
3781   * Returns an action object used in signalling that the post editor settings have been updated.
3782   *
3783   * @param {Object} settings Updated settings
3784   *
3785   * @return {Object} Action object
3786   */
3787  
3788  function updateEditorSettings(settings) {
3789    return {
3790      type: 'UPDATE_EDITOR_SETTINGS',
3791      settings: settings
3792    };
3793  }
3794  /**
3795   * Backward compatibility
3796   */
3797  
3798  var actions_getBlockEditorAction = function getBlockEditorAction(name) {
3799    return (
3800      /*#__PURE__*/
3801      external_this_regeneratorRuntime_default.a.mark(function _callee() {
3802        var _len,
3803            args,
3804            _key,
3805            _args13 = arguments;
3806  
3807        return external_this_regeneratorRuntime_default.a.wrap(function _callee$(_context12) {
3808          while (1) {
3809            switch (_context12.prev = _context12.next) {
3810              case 0:
3811                external_this_wp_deprecated_default()("`wp.data.dispatch( 'core/editor' )." + name + '`', {
3812                  alternative: "`wp.data.dispatch( 'core/block-editor' )." + name + '`'
3813                });
3814  
3815                for (_len = _args13.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3816                  args[_key] = _args13[_key];
3817                }
3818  
3819                _context12.next = 4;
3820                return external_this_wp_dataControls_["dispatch"].apply(void 0, ['core/block-editor', name].concat(args));
3821  
3822              case 4:
3823              case "end":
3824                return _context12.stop();
3825            }
3826          }
3827        }, _callee);
3828      })
3829    );
3830  };
3831  /**
3832   * @see resetBlocks in core/block-editor store.
3833   */
3834  
3835  
3836  var resetBlocks = actions_getBlockEditorAction('resetBlocks');
3837  /**
3838   * @see receiveBlocks in core/block-editor store.
3839   */
3840  
3841  var receiveBlocks = actions_getBlockEditorAction('receiveBlocks');
3842  /**
3843   * @see updateBlock in core/block-editor store.
3844   */
3845  
3846  var updateBlock = actions_getBlockEditorAction('updateBlock');
3847  /**
3848   * @see updateBlockAttributes in core/block-editor store.
3849   */
3850  
3851  var updateBlockAttributes = actions_getBlockEditorAction('updateBlockAttributes');
3852  /**
3853   * @see selectBlock in core/block-editor store.
3854   */
3855  
3856  var selectBlock = actions_getBlockEditorAction('selectBlock');
3857  /**
3858   * @see startMultiSelect in core/block-editor store.
3859   */
3860  
3861  var startMultiSelect = actions_getBlockEditorAction('startMultiSelect');
3862  /**
3863   * @see stopMultiSelect in core/block-editor store.
3864   */
3865  
3866  var stopMultiSelect = actions_getBlockEditorAction('stopMultiSelect');
3867  /**
3868   * @see multiSelect in core/block-editor store.
3869   */
3870  
3871  var multiSelect = actions_getBlockEditorAction('multiSelect');
3872  /**
3873   * @see clearSelectedBlock in core/block-editor store.
3874   */
3875  
3876  var clearSelectedBlock = actions_getBlockEditorAction('clearSelectedBlock');
3877  /**
3878   * @see toggleSelection in core/block-editor store.
3879   */
3880  
3881  var toggleSelection = actions_getBlockEditorAction('toggleSelection');
3882  /**
3883   * @see replaceBlocks in core/block-editor store.
3884   */
3885  
3886  var actions_replaceBlocks = actions_getBlockEditorAction('replaceBlocks');
3887  /**
3888   * @see replaceBlock in core/block-editor store.
3889   */
3890  
3891  var replaceBlock = actions_getBlockEditorAction('replaceBlock');
3892  /**
3893   * @see moveBlocksDown in core/block-editor store.
3894   */
3895  
3896  var moveBlocksDown = actions_getBlockEditorAction('moveBlocksDown');
3897  /**
3898   * @see moveBlocksUp in core/block-editor store.
3899   */
3900  
3901  var moveBlocksUp = actions_getBlockEditorAction('moveBlocksUp');
3902  /**
3903   * @see moveBlockToPosition in core/block-editor store.
3904   */
3905  
3906  var moveBlockToPosition = actions_getBlockEditorAction('moveBlockToPosition');
3907  /**
3908   * @see insertBlock in core/block-editor store.
3909   */
3910  
3911  var insertBlock = actions_getBlockEditorAction('insertBlock');
3912  /**
3913   * @see insertBlocks in core/block-editor store.
3914   */
3915  
3916  var insertBlocks = actions_getBlockEditorAction('insertBlocks');
3917  /**
3918   * @see showInsertionPoint in core/block-editor store.
3919   */
3920  
3921  var showInsertionPoint = actions_getBlockEditorAction('showInsertionPoint');
3922  /**
3923   * @see hideInsertionPoint in core/block-editor store.
3924   */
3925  
3926  var hideInsertionPoint = actions_getBlockEditorAction('hideInsertionPoint');
3927  /**
3928   * @see setTemplateValidity in core/block-editor store.
3929   */
3930  
3931  var setTemplateValidity = actions_getBlockEditorAction('setTemplateValidity');
3932  /**
3933   * @see synchronizeTemplate in core/block-editor store.
3934   */
3935  
3936  var synchronizeTemplate = actions_getBlockEditorAction('synchronizeTemplate');
3937  /**
3938   * @see mergeBlocks in core/block-editor store.
3939   */
3940  
3941  var mergeBlocks = actions_getBlockEditorAction('mergeBlocks');
3942  /**
3943   * @see removeBlocks in core/block-editor store.
3944   */
3945  
3946  var removeBlocks = actions_getBlockEditorAction('removeBlocks');
3947  /**
3948   * @see removeBlock in core/block-editor store.
3949   */
3950  
3951  var removeBlock = actions_getBlockEditorAction('removeBlock');
3952  /**
3953   * @see toggleBlockMode in core/block-editor store.
3954   */
3955  
3956  var toggleBlockMode = actions_getBlockEditorAction('toggleBlockMode');
3957  /**
3958   * @see startTyping in core/block-editor store.
3959   */
3960  
3961  var startTyping = actions_getBlockEditorAction('startTyping');
3962  /**
3963   * @see stopTyping in core/block-editor store.
3964   */
3965  
3966  var stopTyping = actions_getBlockEditorAction('stopTyping');
3967  /**
3968   * @see enterFormattedText in core/block-editor store.
3969   */
3970  
3971  var enterFormattedText = actions_getBlockEditorAction('enterFormattedText');
3972  /**
3973   * @see exitFormattedText in core/block-editor store.
3974   */
3975  
3976  var exitFormattedText = actions_getBlockEditorAction('exitFormattedText');
3977  /**
3978   * @see insertDefaultBlock in core/block-editor store.
3979   */
3980  
3981  var insertDefaultBlock = actions_getBlockEditorAction('insertDefaultBlock');
3982  /**
3983   * @see updateBlockListSettings in core/block-editor store.
3984   */
3985  
3986  var updateBlockListSettings = actions_getBlockEditorAction('updateBlockListSettings');
3987  
3988  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
3989  var slicedToArray = __webpack_require__(20);
3990  
3991  // EXTERNAL MODULE: ./node_modules/rememo/es/rememo.js
3992  var rememo = __webpack_require__(40);
3993  
3994  // EXTERNAL MODULE: external {"this":["wp","date"]}
3995  var external_this_wp_date_ = __webpack_require__(60);
3996  
3997  // EXTERNAL MODULE: external {"this":["wp","url"]}
3998  var external_this_wp_url_ = __webpack_require__(30);
3999  
4000  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/selectors.js
4001  
4002  
4003  
4004  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; }
4005  
4006  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; }
4007  
4008  /**
4009   * External dependencies
4010   */
4011  
4012  
4013  /**
4014   * WordPress dependencies
4015   */
4016  
4017  
4018  
4019  
4020  
4021  
4022  /**
4023   * Internal dependencies
4024   */
4025  
4026  
4027  
4028  
4029  
4030  /**
4031   * Shared reference to an empty object for cases where it is important to avoid
4032   * returning a new object reference on every invocation, as in a connected or
4033   * other pure component which performs `shouldComponentUpdate` check on props.
4034   * This should be used as a last resort, since the normalized data should be
4035   * maintained by the reducer result in state.
4036   */
4037  
4038  var EMPTY_OBJECT = {};
4039  /**
4040   * Shared reference to an empty array for cases where it is important to avoid
4041   * returning a new array reference on every invocation, as in a connected or
4042   * other pure component which performs `shouldComponentUpdate` check on props.
4043   * This should be used as a last resort, since the normalized data should be
4044   * maintained by the reducer result in state.
4045   */
4046  
4047  var EMPTY_ARRAY = [];
4048  /**
4049   * Returns true if any past editor history snapshots exist, or false otherwise.
4050   *
4051   * @param {Object} state Global application state.
4052   *
4053   * @return {boolean} Whether undo history exists.
4054   */
4055  
4056  var hasEditorUndo = Object(external_this_wp_data_["createRegistrySelector"])(function (select) {
4057    return function () {
4058      return select('core').hasUndo();
4059    };
4060  });
4061  /**
4062   * Returns true if any future editor history snapshots exist, or false
4063   * otherwise.
4064   *
4065   * @param {Object} state Global application state.
4066   *
4067   * @return {boolean} Whether redo history exists.
4068   */
4069  
4070  var hasEditorRedo = Object(external_this_wp_data_["createRegistrySelector"])(function (select) {
4071    return function () {
4072      return select('core').hasRedo();
4073    };
4074  });
4075  /**
4076   * Returns true if the currently edited post is yet to be saved, or false if
4077   * the post has been saved.
4078   *
4079   * @param {Object} state Global application state.
4080   *
4081   * @return {boolean} Whether the post is new.
4082   */
4083  
4084  function selectors_isEditedPostNew(state) {
4085    return selectors_getCurrentPost(state).status === 'auto-draft';
4086  }
4087  /**
4088   * Returns true if content includes unsaved changes, or false otherwise.
4089   *
4090   * @param {Object} state Editor state.
4091   *
4092   * @return {boolean} Whether content includes unsaved changes.
4093   */
4094  
4095  function hasChangedContent(state) {
4096    var edits = getPostEdits(state);
4097    return 'blocks' in edits || // `edits` is intended to contain only values which are different from
4098    // the saved post, so the mere presence of a property is an indicator
4099    // that the value is different than what is known to be saved. While
4100    // content in Visual mode is represented by the blocks state, in Text
4101    // mode it is tracked by `edits.content`.
4102    'content' in edits;
4103  }
4104  /**
4105   * Returns true if there are unsaved values for the current edit session, or
4106   * false if the editing state matches the saved or new post.
4107   *
4108   * @param {Object} state Global application state.
4109   *
4110   * @return {boolean} Whether unsaved values exist.
4111   */
4112  
4113  var selectors_isEditedPostDirty = Object(external_this_wp_data_["createRegistrySelector"])(function (select) {
4114    return function (state) {
4115      // Edits should contain only fields which differ from the saved post (reset
4116      // at initial load and save complete). Thus, a non-empty edits state can be
4117      // inferred to contain unsaved values.
4118      var postType = selectors_getCurrentPostType(state);
4119      var postId = selectors_getCurrentPostId(state);
4120  
4121      if (select('core').hasEditsForEntityRecord('postType', postType, postId)) {
4122        return true;
4123      }
4124  
4125      return false;
4126    };
4127  });
4128  /**
4129   * Returns true if there are unsaved edits for entities other than
4130   * the editor's post, and false otherwise.
4131   *
4132   * @param {Object} state Global application state.
4133   *
4134   * @return {boolean} Whether there are edits or not.
4135   */
4136  
4137  var selectors_hasNonPostEntityChanges = Object(external_this_wp_data_["createRegistrySelector"])(function (select) {
4138    return function (state) {
4139      var enableFullSiteEditing = selectors_getEditorSettings(state).__experimentalEnableFullSiteEditing;
4140  
4141      if (!enableFullSiteEditing) {
4142        return false;
4143      }
4144  
4145      var entityRecordChangesByRecord = select('core').getEntityRecordChangesByRecord();
4146      var changedKinds = Object.keys(entityRecordChangesByRecord);
4147  
4148      if (changedKinds.length > 1 || changedKinds.length === 1 && !entityRecordChangesByRecord.postType) {
4149        // Return true if there is more than one edited entity kind
4150        // or the edited entity kind is not the editor's post's kind.
4151        return true;
4152      } else if (!entityRecordChangesByRecord.postType) {
4153        // Don't continue if there are no edited entity kinds.
4154        return false;
4155      }
4156  
4157      var _getCurrentPost = selectors_getCurrentPost(state),
4158          type = _getCurrentPost.type,
4159          id = _getCurrentPost.id;
4160  
4161      var changedPostTypes = Object.keys(entityRecordChangesByRecord.postType);
4162  
4163      if (changedPostTypes.length > 1 || changedPostTypes.length === 1 && !entityRecordChangesByRecord.postType[type]) {
4164        // Return true if there is more than one edited post type
4165        // or the edited entity's post type is not the editor's post's post type.
4166        return true;
4167      }
4168  
4169      var changedPosts = Object.keys(entityRecordChangesByRecord.postType[type]);
4170  
4171      if (changedPosts.length > 1 || changedPosts.length === 1 && !entityRecordChangesByRecord.postType[type][id]) {
4172        // Return true if there is more than one edited post
4173        // or the edited post is not the editor's post.
4174        return true;
4175      }
4176  
4177      return false;
4178    };
4179  });
4180  /**
4181   * Returns true if there are no unsaved values for the current edit session and
4182   * if the currently edited post is new (has never been saved before).
4183   *
4184   * @param {Object} state Global application state.
4185   *
4186   * @return {boolean} Whether new post and unsaved values exist.
4187   */
4188  
4189  function selectors_isCleanNewPost(state) {
4190    return !selectors_isEditedPostDirty(state) && selectors_isEditedPostNew(state);
4191  }
4192  /**
4193   * Returns the post currently being edited in its last known saved state, not
4194   * including unsaved edits. Returns an object containing relevant default post
4195   * values if the post has not yet been saved.
4196   *
4197   * @param {Object} state Global application state.
4198   *
4199   * @return {Object} Post object.
4200   */
4201  
4202  var selectors_getCurrentPost = Object(external_this_wp_data_["createRegistrySelector"])(function (select) {
4203    return function (state) {
4204      var postId = selectors_getCurrentPostId(state);
4205      var postType = selectors_getCurrentPostType(state);
4206      var post = select('core').getRawEntityRecord('postType', postType, postId);
4207  
4208      if (post) {
4209        return post;
4210      } // This exists for compatibility with the previous selector behavior
4211      // which would guarantee an object return based on the editor reducer's
4212      // default empty object state.
4213  
4214  
4215      return EMPTY_OBJECT;
4216    };
4217  });
4218  /**
4219   * Returns the post type of the post currently being edited.
4220   *
4221   * @param {Object} state Global application state.
4222   *
4223   * @return {string} Post type.
4224   */
4225  
4226  function selectors_getCurrentPostType(state) {
4227    return state.postType;
4228  }
4229  /**
4230   * Returns the ID of the post currently being edited, or null if the post has
4231   * not yet been saved.
4232   *
4233   * @param {Object} state Global application state.
4234   *
4235   * @return {?number} ID of current post.
4236   */
4237  
4238  function selectors_getCurrentPostId(state) {
4239    return state.postId;
4240  }
4241  /**
4242   * Returns the number of revisions of the post currently being edited.
4243   *
4244   * @param {Object} state Global application state.
4245   *
4246   * @return {number} Number of revisions.
4247   */
4248  
4249  function getCurrentPostRevisionsCount(state) {
4250    return Object(external_this_lodash_["get"])(selectors_getCurrentPost(state), ['_links', 'version-history', 0, 'count'], 0);
4251  }
4252  /**
4253   * Returns the last revision ID of the post currently being edited,
4254   * or null if the post has no revisions.
4255   *
4256   * @param {Object} state Global application state.
4257   *
4258   * @return {?number} ID of the last revision.
4259   */
4260  
4261  function getCurrentPostLastRevisionId(state) {
4262    return Object(external_this_lodash_["get"])(selectors_getCurrentPost(state), ['_links', 'predecessor-version', 0, 'id'], null);
4263  }
4264  /**
4265   * Returns any post values which have been changed in the editor but not yet
4266   * been saved.
4267   *
4268   * @param {Object} state Global application state.
4269   *
4270   * @return {Object} Object of key value pairs comprising unsaved edits.
4271   */
4272  
4273  var getPostEdits = Object(external_this_wp_data_["createRegistrySelector"])(function (select) {
4274    return function (state) {
4275      var postType = selectors_getCurrentPostType(state);
4276      var postId = selectors_getCurrentPostId(state);
4277      return select('core').getEntityRecordEdits('postType', postType, postId) || EMPTY_OBJECT;
4278    };
4279  });
4280  /**
4281   * Returns a new reference when edited values have changed. This is useful in
4282   * inferring where an edit has been made between states by comparison of the
4283   * return values using strict equality.
4284   *
4285   * @deprecated since Gutenberg 6.5.0.
4286   *
4287   * @example
4288   *
4289   * ```
4290   * const hasEditOccurred = (
4291   *    getReferenceByDistinctEdits( beforeState ) !==
4292   *    getReferenceByDistinctEdits( afterState )
4293   * );
4294   * ```
4295   *
4296   * @param {Object} state Editor state.
4297   *
4298   * @return {*} A value whose reference will change only when an edit occurs.
4299   */
4300  
4301  var getReferenceByDistinctEdits = Object(external_this_wp_data_["createRegistrySelector"])(function (select) {
4302    return function ()
4303    /* state */
4304    {
4305      external_this_wp_deprecated_default()("`wp.data.select( 'core/editor' ).getReferenceByDistinctEdits`", {
4306        alternative: "`wp.data.select( 'core' ).getReferenceByDistinctEdits`"
4307      });
4308      return select('core').getReferenceByDistinctEdits();
4309    };
4310  });
4311  /**
4312   * Returns an attribute value of the saved post.
4313   *
4314   * @param {Object} state         Global application state.
4315   * @param {string} attributeName Post attribute name.
4316   *
4317   * @return {*} Post attribute value.
4318   */
4319  
4320  function selectors_getCurrentPostAttribute(state, attributeName) {
4321    switch (attributeName) {
4322      case 'type':
4323        return selectors_getCurrentPostType(state);
4324  
4325      case 'id':
4326        return selectors_getCurrentPostId(state);
4327  
4328      default:
4329        var post = selectors_getCurrentPost(state);
4330  
4331        if (!post.hasOwnProperty(attributeName)) {
4332          break;
4333        }
4334  
4335        return getPostRawValue(post[attributeName]);
4336    }
4337  }
4338  /**
4339   * Returns a single attribute of the post being edited, preferring the unsaved
4340   * edit if one exists, but merging with the attribute value for the last known
4341   * saved state of the post (this is needed for some nested attributes like meta).
4342   *
4343   * @param {Object} state         Global application state.
4344   * @param {string} attributeName Post attribute name.
4345   *
4346   * @return {*} Post attribute value.
4347   */
4348  
4349  var getNestedEditedPostProperty = function getNestedEditedPostProperty(state, attributeName) {
4350    var edits = getPostEdits(state);
4351  
4352    if (!edits.hasOwnProperty(attributeName)) {
4353      return selectors_getCurrentPostAttribute(state, attributeName);
4354    }
4355  
4356    return selectors_objectSpread({}, selectors_getCurrentPostAttribute(state, attributeName), {}, edits[attributeName]);
4357  };
4358  /**
4359   * Returns a single attribute of the post being edited, preferring the unsaved
4360   * edit if one exists, but falling back to the attribute for the last known
4361   * saved state of the post.
4362   *
4363   * @param {Object} state         Global application state.
4364   * @param {string} attributeName Post attribute name.
4365   *
4366   * @return {*} Post attribute value.
4367   */
4368  
4369  
4370  function selectors_getEditedPostAttribute(state, attributeName) {
4371    // Special cases
4372    switch (attributeName) {
4373      case 'content':
4374        return getEditedPostContent(state);
4375    } // Fall back to saved post value if not edited.
4376  
4377  
4378    var edits = getPostEdits(state);
4379  
4380    if (!edits.hasOwnProperty(attributeName)) {
4381      return selectors_getCurrentPostAttribute(state, attributeName);
4382    } // Merge properties are objects which contain only the patch edit in state,
4383    // and thus must be merged with the current post attribute.
4384  
4385  
4386    if (EDIT_MERGE_PROPERTIES.has(attributeName)) {
4387      return getNestedEditedPostProperty(state, attributeName);
4388    }
4389  
4390    return edits[attributeName];
4391  }
4392  /**
4393   * Returns an attribute value of the current autosave revision for a post, or
4394   * null if there is no autosave for the post.
4395   *
4396   * @deprecated since 5.6. Callers should use the `getAutosave( postType, postId, userId )` selector
4397   *                from the '@wordpress/core-data' package and access properties on the returned
4398   *                autosave object using getPostRawValue.
4399   *
4400   * @param {Object} state         Global application state.
4401   * @param {string} attributeName Autosave attribute name.
4402   *
4403   * @return {*} Autosave attribute value.
4404   */
4405  
4406  var getAutosaveAttribute = Object(external_this_wp_data_["createRegistrySelector"])(function (select) {
4407    return function (state, attributeName) {
4408      if (!Object(external_this_lodash_["includes"])(AUTOSAVE_PROPERTIES, attributeName) && attributeName !== 'preview_link') {
4409        return;
4410      }
4411  
4412      var postType = selectors_getCurrentPostType(state);
4413      var postId = selectors_getCurrentPostId(state);
4414      var currentUserId = Object(external_this_lodash_["get"])(select('core').getCurrentUser(), ['id']);
4415      var autosave = select('core').getAutosave(postType, postId, currentUserId);
4416  
4417      if (autosave) {
4418        return getPostRawValue(autosave[attributeName]);
4419      }
4420    };
4421  });
4422  /**
4423   * Returns the current visibility of the post being edited, preferring the
4424   * unsaved value if different than the saved post. The return value is one of
4425   * "private", "password", or "public".
4426   *
4427   * @param {Object} state Global application state.
4428   *
4429   * @return {string} Post visibility.
4430   */
4431  
4432  function selectors_getEditedPostVisibility(state) {
4433    var status = selectors_getEditedPostAttribute(state, 'status');
4434  
4435    if (status === 'private') {
4436      return 'private';
4437    }
4438  
4439    var password = selectors_getEditedPostAttribute(state, 'password');
4440  
4441    if (password) {
4442      return 'password';
4443    }
4444  
4445    return 'public';
4446  }
4447  /**
4448   * Returns true if post is pending review.
4449   *
4450   * @param {Object} state Global application state.
4451   *
4452   * @return {boolean} Whether current post is pending review.
4453   */
4454  
4455  function isCurrentPostPending(state) {
4456    return selectors_getCurrentPost(state).status === 'pending';
4457  }
4458  /**
4459   * Return true if the current post has already been published.
4460   *
4461   * @param {Object}  state       Global application state.
4462   * @param {Object?} currentPost Explicit current post for bypassing registry selector.
4463   *
4464   * @return {boolean} Whether the post has been published.
4465   */
4466  
4467  function selectors_isCurrentPostPublished(state, currentPost) {
4468    var post = currentPost || selectors_getCurrentPost(state);
4469    return ['publish', 'private'].indexOf(post.status) !== -1 || post.status === 'future' && !Object(external_this_wp_date_["isInTheFuture"])(new Date(Number(Object(external_this_wp_date_["getDate"])(post.date)) - ONE_MINUTE_IN_MS));
4470  }
4471  /**
4472   * Returns true if post is already scheduled.
4473   *
4474   * @param {Object} state Global application state.
4475   *
4476   * @return {boolean} Whether current post is scheduled to be posted.
4477   */
4478  
4479  function selectors_isCurrentPostScheduled(state) {
4480    return selectors_getCurrentPost(state).status === 'future' && !selectors_isCurrentPostPublished(state);
4481  }
4482  /**
4483   * Return true if the post being edited can be published.
4484   *
4485   * @param {Object} state Global application state.
4486   *
4487   * @return {boolean} Whether the post can been published.
4488   */
4489  
4490  function selectors_isEditedPostPublishable(state) {
4491    var post = selectors_getCurrentPost(state); // TODO: Post being publishable should be superset of condition of post
4492    // being saveable. Currently this restriction is imposed at UI.
4493    //
4494    //  See: <PostPublishButton /> (`isButtonEnabled` assigned by `isSaveable`)
4495  
4496    return selectors_isEditedPostDirty(state) || ['publish', 'private', 'future'].indexOf(post.status) === -1;
4497  }
4498  /**
4499   * Returns true if the post can be saved, or false otherwise. A post must
4500   * contain a title, an excerpt, or non-empty content to be valid for save.
4501   *
4502   * @param {Object} state Global application state.
4503   *
4504   * @return {boolean} Whether the post can be saved.
4505   */
4506  
4507  function selectors_isEditedPostSaveable(state) {
4508    if (selectors_isSavingPost(state)) {
4509      return false;
4510    } // TODO: Post should not be saveable if not dirty. Cannot be added here at
4511    // this time since posts where meta boxes are present can be saved even if
4512    // the post is not dirty. Currently this restriction is imposed at UI, but
4513    // should be moved here.
4514    //
4515    //  See: `isEditedPostPublishable` (includes `isEditedPostDirty` condition)
4516    //  See: <PostSavedState /> (`forceIsDirty` prop)
4517    //  See: <PostPublishButton /> (`forceIsDirty` prop)
4518    //  See: https://github.com/WordPress/gutenberg/pull/4184
4519  
4520  
4521    return !!selectors_getEditedPostAttribute(state, 'title') || !!selectors_getEditedPostAttribute(state, 'excerpt') || !isEditedPostEmpty(state);
4522  }
4523  /**
4524   * Returns true if the edited post has content. A post has content if it has at
4525   * least one saveable block or otherwise has a non-empty content property
4526   * assigned.
4527   *
4528   * @param {Object} state Global application state.
4529   *
4530   * @return {boolean} Whether post has content.
4531   */
4532  
4533  function isEditedPostEmpty(state) {
4534    // While the condition of truthy content string is sufficient to determine
4535    // emptiness, testing saveable blocks length is a trivial operation. Since
4536    // this function can be called frequently, optimize for the fast case as a
4537    // condition of the mere existence of blocks. Note that the value of edited
4538    // content takes precedent over block content, and must fall through to the
4539    // default logic.
4540    var blocks = selectors_getEditorBlocks(state);
4541  
4542    if (blocks.length) {
4543      // Pierce the abstraction of the serializer in knowing that blocks are
4544      // joined with with newlines such that even if every individual block
4545      // produces an empty save result, the serialized content is non-empty.
4546      if (blocks.length > 1) {
4547        return false;
4548      } // There are two conditions under which the optimization cannot be
4549      // assumed, and a fallthrough to getEditedPostContent must occur:
4550      //
4551      // 1. getBlocksForSerialization has special treatment in omitting a
4552      //    single unmodified default block.
4553      // 2. Comment delimiters are omitted for a freeform or unregistered
4554      //    block in its serialization. The freeform block specifically may
4555      //    produce an empty string in its saved output.
4556      //
4557      // For all other content, the single block is assumed to make a post
4558      // non-empty, if only by virtue of its own comment delimiters.
4559  
4560  
4561      var blockName = blocks[0].name;
4562  
4563      if (blockName !== Object(external_this_wp_blocks_["getDefaultBlockName"])() && blockName !== Object(external_this_wp_blocks_["getFreeformContentHandlerName"])()) {
4564        return false;
4565      }
4566    }
4567  
4568    return !getEditedPostContent(state);
4569  }
4570  /**
4571   * Returns true if the post can be autosaved, or false otherwise.
4572   *
4573   * @param {Object} state    Global application state.
4574   * @param {Object} autosave A raw autosave object from the REST API.
4575   *
4576   * @return {boolean} Whether the post can be autosaved.
4577   */
4578  
4579  var selectors_isEditedPostAutosaveable = Object(external_this_wp_data_["createRegistrySelector"])(function (select) {
4580    return function (state) {
4581      // A post must contain a title, an excerpt, or non-empty content to be valid for autosaving.
4582      if (!selectors_isEditedPostSaveable(state)) {
4583        return false;
4584      } // A post is not autosavable when there is a post autosave lock.
4585  
4586  
4587      if (isPostAutosavingLocked(state)) {
4588        return false;
4589      }
4590  
4591      var postType = selectors_getCurrentPostType(state);
4592      var postId = selectors_getCurrentPostId(state);
4593      var hasFetchedAutosave = select('core').hasFetchedAutosaves(postType, postId);
4594      var currentUserId = Object(external_this_lodash_["get"])(select('core').getCurrentUser(), ['id']); // Disable reason - this line causes the side-effect of fetching the autosave
4595      // via a resolver, moving below the return would result in the autosave never
4596      // being fetched.
4597      // eslint-disable-next-line @wordpress/no-unused-vars-before-return
4598  
4599      var autosave = select('core').getAutosave(postType, postId, currentUserId); // If any existing autosaves have not yet been fetched, this function is
4600      // unable to determine if the post is autosaveable, so return false.
4601  
4602      if (!hasFetchedAutosave) {
4603        return false;
4604      } // If we don't already have an autosave, the post is autosaveable.
4605  
4606  
4607      if (!autosave) {
4608        return true;
4609      } // To avoid an expensive content serialization, use the content dirtiness
4610      // flag in place of content field comparison against the known autosave.
4611      // This is not strictly accurate, and relies on a tolerance toward autosave
4612      // request failures for unnecessary saves.
4613  
4614  
4615      if (hasChangedContent(state)) {
4616        return true;
4617      } // If the title or excerpt has changed, the post is autosaveable.
4618  
4619  
4620      return ['title', 'excerpt'].some(function (field) {
4621        return getPostRawValue(autosave[field]) !== selectors_getEditedPostAttribute(state, field);
4622      });
4623    };
4624  });
4625  /**
4626   * Returns the current autosave, or null if one is not set (i.e. if the post
4627   * has yet to be autosaved, or has been saved or published since the last
4628   * autosave).
4629   *
4630   * @deprecated since 5.6. Callers should use the `getAutosave( postType, postId, userId )`
4631   *                selector from the '@wordpress/core-data' package.
4632   *
4633   * @param {Object} state Editor state.
4634   *
4635   * @return {?Object} Current autosave, if exists.
4636   */
4637  
4638  var getAutosave = Object(external_this_wp_data_["createRegistrySelector"])(function (select) {
4639    return function (state) {
4640      external_this_wp_deprecated_default()("`wp.data.select( 'core/editor' ).getAutosave()`", {
4641        alternative: "`wp.data.select( 'core' ).getAutosave( postType, postId, userId )`",
4642        plugin: 'Gutenberg'
4643      });
4644      var postType = selectors_getCurrentPostType(state);
4645      var postId = selectors_getCurrentPostId(state);
4646      var currentUserId = Object(external_this_lodash_["get"])(select('core').getCurrentUser(), ['id']);
4647      var autosave = select('core').getAutosave(postType, postId, currentUserId);
4648      return Object(external_this_lodash_["mapValues"])(Object(external_this_lodash_["pick"])(autosave, AUTOSAVE_PROPERTIES), getPostRawValue);
4649    };
4650  });
4651  /**
4652   * Returns the true if there is an existing autosave, otherwise false.
4653   *
4654   * @deprecated since 5.6. Callers should use the `getAutosave( postType, postId, userId )` selector
4655   *             from the '@wordpress/core-data' package and check for a truthy value.
4656   *
4657   * @param {Object} state Global application state.
4658   *
4659   * @return {boolean} Whether there is an existing autosave.
4660   */
4661  
4662  var hasAutosave = Object(external_this_wp_data_["createRegistrySelector"])(function (select) {
4663    return function (state) {
4664      external_this_wp_deprecated_default()("`wp.data.select( 'core/editor' ).hasAutosave()`", {
4665        alternative: "`!! wp.data.select( 'core' ).getAutosave( postType, postId, userId )`",
4666        plugin: 'Gutenberg'
4667      });
4668      var postType = selectors_getCurrentPostType(state);
4669      var postId = selectors_getCurrentPostId(state);
4670      var currentUserId = Object(external_this_lodash_["get"])(select('core').getCurrentUser(), ['id']);
4671      return !!select('core').getAutosave(postType, postId, currentUserId);
4672    };
4673  });
4674  /**
4675   * Return true if the post being edited is being scheduled. Preferring the
4676   * unsaved status values.
4677   *
4678   * @param {Object} state Global application state.
4679   *
4680   * @return {boolean} Whether the post has been published.
4681   */
4682  
4683  function selectors_isEditedPostBeingScheduled(state) {
4684    var date = selectors_getEditedPostAttribute(state, 'date'); // Offset the date by one minute (network latency)
4685  
4686    var checkedDate = new Date(Number(Object(external_this_wp_date_["getDate"])(date)) - ONE_MINUTE_IN_MS);
4687    return Object(external_this_wp_date_["isInTheFuture"])(checkedDate);
4688  }
4689  /**
4690   * Returns whether the current post should be considered to have a "floating"
4691   * date (i.e. that it would publish "Immediately" rather than at a set time).
4692   *
4693   * Unlike in the PHP backend, the REST API returns a full date string for posts
4694   * where the 0000-00-00T00:00:00 placeholder is present in the database. To
4695   * infer that a post is set to publish "Immediately" we check whether the date
4696   * and modified date are the same.
4697   *
4698   * @param {Object} state Editor state.
4699   *
4700   * @return {boolean} Whether the edited post has a floating date value.
4701   */
4702  
4703  function isEditedPostDateFloating(state) {
4704    var date = selectors_getEditedPostAttribute(state, 'date');
4705    var modified = selectors_getEditedPostAttribute(state, 'modified');
4706    var status = selectors_getEditedPostAttribute(state, 'status');
4707  
4708    if (status === 'draft' || status === 'auto-draft' || status === 'pending') {
4709      return date === modified;
4710    }
4711  
4712    return false;
4713  }
4714  /**
4715   * Returns true if the post is currently being saved, or false otherwise.
4716   *
4717   * @param {Object} state Global application state.
4718   *
4719   * @return {boolean} Whether post is being saved.
4720   */
4721  
4722  var selectors_isSavingPost = Object(external_this_wp_data_["createRegistrySelector"])(function (select) {
4723    return function (state) {
4724      var postType = selectors_getCurrentPostType(state);
4725      var postId = selectors_getCurrentPostId(state);
4726      return select('core').isSavingEntityRecord('postType', postType, postId);
4727    };
4728  });
4729  /**
4730   * Returns true if a previous post save was attempted successfully, or false
4731   * otherwise.
4732   *
4733   * @param {Object} state Global application state.
4734   *
4735   * @return {boolean} Whether the post was saved successfully.
4736   */
4737  
4738  var didPostSaveRequestSucceed = Object(external_this_wp_data_["createRegistrySelector"])(function (select) {
4739    return function (state) {
4740      var postType = selectors_getCurrentPostType(state);
4741      var postId = selectors_getCurrentPostId(state);
4742      return !select('core').getLastEntitySaveError('postType', postType, postId);
4743    };
4744  });
4745  /**
4746   * Returns true if a previous post save was attempted but failed, or false
4747   * otherwise.
4748   *
4749   * @param {Object} state Global application state.
4750   *
4751   * @return {boolean} Whether the post save failed.
4752   */
4753  
4754  var didPostSaveRequestFail = Object(external_this_wp_data_["createRegistrySelector"])(function (select) {
4755    return function (state) {
4756      var postType = selectors_getCurrentPostType(state);
4757      var postId = selectors_getCurrentPostId(state);
4758      return !!select('core').getLastEntitySaveError('postType', postType, postId);
4759    };
4760  });
4761  /**
4762   * Returns true if the post is autosaving, or false otherwise.
4763   *
4764   * @param {Object} state Global application state.
4765   *
4766   * @return {boolean} Whether the post is autosaving.
4767   */
4768  
4769  function selectors_isAutosavingPost(state) {
4770    if (!selectors_isSavingPost(state)) {
4771      return false;
4772    }
4773  
4774    return !!Object(external_this_lodash_["get"])(state.saving, ['options', 'isAutosave']);
4775  }
4776  /**
4777   * Returns true if the post is being previewed, or false otherwise.
4778   *
4779   * @param {Object} state Global application state.
4780   *
4781   * @return {boolean} Whether the post is being previewed.
4782   */
4783  
4784  function isPreviewingPost(state) {
4785    if (!selectors_isSavingPost(state)) {
4786      return false;
4787    }
4788  
4789    return !!state.saving.options.isPreview;
4790  }
4791  /**
4792   * Returns the post preview link
4793   *
4794   * @param {Object} state Global application state.
4795   *
4796   * @return {string?} Preview Link.
4797   */
4798  
4799  function selectors_getEditedPostPreviewLink(state) {
4800    if (state.saving.pending || selectors_isSavingPost(state)) {
4801      return;
4802    }
4803  
4804    var previewLink = getAutosaveAttribute(state, 'preview_link');
4805  
4806    if (!previewLink) {
4807      previewLink = selectors_getEditedPostAttribute(state, 'link');
4808  
4809      if (previewLink) {
4810        previewLink = Object(external_this_wp_url_["addQueryArgs"])(previewLink, {
4811          preview: true
4812        });
4813      }
4814    }
4815  
4816    var featuredImageId = selectors_getEditedPostAttribute(state, 'featured_media');
4817  
4818    if (previewLink && featuredImageId) {
4819      return Object(external_this_wp_url_["addQueryArgs"])(previewLink, {
4820        _thumbnail_id: featuredImageId
4821      });
4822    }
4823  
4824    return previewLink;
4825  }
4826  /**
4827   * Returns a suggested post format for the current post, inferred only if there
4828   * is a single block within the post and it is of a type known to match a
4829   * default post format. Returns null if the format cannot be determined.
4830   *
4831   * @param {Object} state Global application state.
4832   *
4833   * @return {?string} Suggested post format.
4834   */
4835  
4836  function selectors_getSuggestedPostFormat(state) {
4837    var blocks = selectors_getEditorBlocks(state);
4838    var name; // If there is only one block in the content of the post grab its name
4839    // so we can derive a suitable post format from it.
4840  
4841    if (blocks.length === 1) {
4842      name = blocks[0].name;
4843    } // If there are two blocks in the content and the last one is a text blocks
4844    // grab the name of the first one to also suggest a post format from it.
4845  
4846  
4847    if (blocks.length === 2) {
4848      if (blocks[1].name === 'core/paragraph') {
4849        name = blocks[0].name;
4850      }
4851    } // We only convert to default post formats in core.
4852  
4853  
4854    switch (name) {
4855      case 'core/image':
4856        return 'image';
4857  
4858      case 'core/quote':
4859      case 'core/pullquote':
4860        return 'quote';
4861  
4862      case 'core/gallery':
4863        return 'gallery';
4864  
4865      case 'core/video':
4866      case 'core-embed/youtube':
4867      case 'core-embed/vimeo':
4868        return 'video';
4869  
4870      case 'core/audio':
4871      case 'core-embed/spotify':
4872      case 'core-embed/soundcloud':
4873        return 'audio';
4874    }
4875  
4876    return null;
4877  }
4878  /**
4879   * Returns a set of blocks which are to be used in consideration of the post's
4880   * generated save content.
4881   *
4882   * @deprecated since Gutenberg 6.2.0.
4883   *
4884   * @param {Object} state Editor state.
4885   *
4886   * @return {WPBlock[]} Filtered set of blocks for save.
4887   */
4888  
4889  function getBlocksForSerialization(state) {
4890    external_this_wp_deprecated_default()('`core/editor` getBlocksForSerialization selector', {
4891      plugin: 'Gutenberg',
4892      alternative: 'getEditorBlocks',
4893      hint: 'Blocks serialization pre-processing occurs at save time'
4894    });
4895    var blocks = state.editor.present.blocks.value; // WARNING: Any changes to the logic of this function should be verified
4896    // against the implementation of isEditedPostEmpty, which bypasses this
4897    // function for performance' sake, in an assumption of this current logic
4898    // being irrelevant to the optimized condition of emptiness.
4899    // A single unmodified default block is assumed to be equivalent to an
4900    // empty post.
4901  
4902    var isSingleUnmodifiedDefaultBlock = blocks.length === 1 && Object(external_this_wp_blocks_["isUnmodifiedDefaultBlock"])(blocks[0]);
4903  
4904    if (isSingleUnmodifiedDefaultBlock) {
4905      return [];
4906    }
4907  
4908    return blocks;
4909  }
4910  /**
4911   * Returns the content of the post being edited.
4912   *
4913   * @param {Object} state Global application state.
4914   *
4915   * @return {string} Post content.
4916   */
4917  
4918  var getEditedPostContent = Object(external_this_wp_data_["createRegistrySelector"])(function (select) {
4919    return function (state) {
4920      var postId = selectors_getCurrentPostId(state);
4921      var postType = selectors_getCurrentPostType(state);
4922      var record = select('core').getEditedEntityRecord('postType', postType, postId);
4923  
4924      if (record) {
4925        if (typeof record.content === 'function') {
4926          return record.content(record);
4927        } else if (record.blocks) {
4928          return serialize_blocks(record.blocks);
4929        } else if (record.content) {
4930          return record.content;
4931        }
4932      }
4933  
4934      return '';
4935    };
4936  });
4937  /**
4938   * Returns the reusable block with the given ID.
4939   *
4940   * @param {Object}        state Global application state.
4941   * @param {number|string} ref   The reusable block's ID.
4942   *
4943   * @return {Object} The reusable block, or null if none exists.
4944   */
4945  
4946  var __experimentalGetReusableBlock = Object(rememo["a" /* default */])(function (state, ref) {
4947    var block = state.reusableBlocks.data[ref];
4948  
4949    if (!block) {
4950      return null;
4951    }
4952  
4953    var isTemporary = isNaN(parseInt(ref));
4954    return selectors_objectSpread({}, block, {
4955      id: isTemporary ? ref : +ref,
4956      isTemporary: isTemporary
4957    });
4958  }, function (state, ref) {
4959    return [state.reusableBlocks.data[ref]];
4960  });
4961  /**
4962   * Returns whether or not the reusable block with the given ID is being saved.
4963   *
4964   * @param {Object} state Global application state.
4965   * @param {string} ref   The reusable block's ID.
4966   *
4967   * @return {boolean} Whether or not the reusable block is being saved.
4968   */
4969  
4970  function __experimentalIsSavingReusableBlock(state, ref) {
4971    return state.reusableBlocks.isSaving[ref] || false;
4972  }
4973  /**
4974   * Returns true if the reusable block with the given ID is being fetched, or
4975   * false otherwise.
4976   *
4977   * @param {Object} state Global application state.
4978   * @param {string} ref   The reusable block's ID.
4979   *
4980   * @return {boolean} Whether the reusable block is being fetched.
4981   */
4982  
4983  function __experimentalIsFetchingReusableBlock(state, ref) {
4984    return !!state.reusableBlocks.isFetching[ref];
4985  }
4986  /**
4987   * Returns an array of all reusable blocks.
4988   *
4989   * @param {Object} state Global application state.
4990   *
4991   * @return {Array} An array of all reusable blocks.
4992   */
4993  
4994  var selectors_experimentalGetReusableBlocks = Object(rememo["a" /* default */])(function (state) {
4995    return Object(external_this_lodash_["map"])(state.reusableBlocks.data, function (value, ref) {
4996      return __experimentalGetReusableBlock(state, ref);
4997    });
4998  }, function (state) {
4999    return [state.reusableBlocks.data];
5000  });
5001  /**
5002   * Returns state object prior to a specified optimist transaction ID, or `null`
5003   * if the transaction corresponding to the given ID cannot be found.
5004   *
5005   * @param {Object} state         Current global application state.
5006   * @param {Object} transactionId Optimist transaction ID.
5007   *
5008   * @return {Object} Global application state prior to transaction.
5009   */
5010  
5011  function getStateBeforeOptimisticTransaction(state, transactionId) {
5012    var transaction = Object(external_this_lodash_["find"])(state.optimist, function (entry) {
5013      return entry.beforeState && Object(external_this_lodash_["get"])(entry.action, ['optimist', 'id']) === transactionId;
5014    });
5015    return transaction ? transaction.beforeState : null;
5016  }
5017  /**
5018   * Returns true if the post is being published, or false otherwise.
5019   *
5020   * @param {Object} state Global application state.
5021   *
5022   * @return {boolean} Whether post is being published.
5023   */
5024  
5025  function selectors_isPublishingPost(state) {
5026    if (!selectors_isSavingPost(state)) {
5027      return false;
5028    } // Saving is optimistic, so assume that current post would be marked as
5029    // published if publishing
5030  
5031  
5032    if (!selectors_isCurrentPostPublished(state)) {
5033      return false;
5034    } // Use post update transaction ID to retrieve the state prior to the
5035    // optimistic transaction
5036  
5037  
5038    var stateBeforeRequest = getStateBeforeOptimisticTransaction(state, POST_UPDATE_TRANSACTION_ID); // Consider as publishing when current post prior to request was not
5039    // considered published
5040  
5041    return !!stateBeforeRequest && !selectors_isCurrentPostPublished(null, stateBeforeRequest.currentPost);
5042  }
5043  /**
5044   * Returns whether the permalink is editable or not.
5045   *
5046   * @param {Object} state Editor state.
5047   *
5048   * @return {boolean} Whether or not the permalink is editable.
5049   */
5050  
5051  function selectors_isPermalinkEditable(state) {
5052    var permalinkTemplate = selectors_getEditedPostAttribute(state, 'permalink_template');
5053    return PERMALINK_POSTNAME_REGEX.test(permalinkTemplate);
5054  }
5055  /**
5056   * Returns the permalink for the post.
5057   *
5058   * @param {Object} state Editor state.
5059   *
5060   * @return {?string} The permalink, or null if the post is not viewable.
5061   */
5062  
5063  function getPermalink(state) {
5064    var permalinkParts = selectors_getPermalinkParts(state);
5065  
5066    if (!permalinkParts) {
5067      return null;
5068    }
5069  
5070    var prefix = permalinkParts.prefix,
5071        postName = permalinkParts.postName,
5072        suffix = permalinkParts.suffix;
5073  
5074    if (selectors_isPermalinkEditable(state)) {
5075      return prefix + postName + suffix;
5076    }
5077  
5078    return prefix;
5079  }
5080  /**
5081   * Returns the permalink for a post, split into it's three parts: the prefix,
5082   * the postName, and the suffix.
5083   *
5084   * @param {Object} state Editor state.
5085   *
5086   * @return {Object} An object containing the prefix, postName, and suffix for
5087   *                  the permalink, or null if the post is not viewable.
5088   */
5089  
5090  function selectors_getPermalinkParts(state) {
5091    var permalinkTemplate = selectors_getEditedPostAttribute(state, 'permalink_template');
5092  
5093    if (!permalinkTemplate) {
5094      return null;
5095    }
5096  
5097    var postName = selectors_getEditedPostAttribute(state, 'slug') || selectors_getEditedPostAttribute(state, 'generated_slug');
5098  
5099    var _permalinkTemplate$sp = permalinkTemplate.split(PERMALINK_POSTNAME_REGEX),
5100        _permalinkTemplate$sp2 = Object(slicedToArray["a" /* default */])(_permalinkTemplate$sp, 2),
5101        prefix = _permalinkTemplate$sp2[0],
5102        suffix = _permalinkTemplate$sp2[1];
5103  
5104    return {
5105      prefix: prefix,
5106      postName: postName,
5107      suffix: suffix
5108    };
5109  }
5110  /**
5111   * Returns true if an optimistic transaction is pending commit, for which the
5112   * before state satisfies the given predicate function.
5113   *
5114   * @param {Object}   state     Editor state.
5115   * @param {Function} predicate Function given state, returning true if match.
5116   *
5117   * @return {boolean} Whether predicate matches for some history.
5118   */
5119  
5120  function inSomeHistory(state, predicate) {
5121    var optimist = state.optimist; // In recursion, optimist state won't exist. Assume exhausted options.
5122  
5123    if (!optimist) {
5124      return false;
5125    }
5126  
5127    return optimist.some(function (_ref) {
5128      var beforeState = _ref.beforeState;
5129      return beforeState && predicate(beforeState);
5130    });
5131  }
5132  /**
5133   * Returns whether the post is locked.
5134   *
5135   * @param {Object} state Global application state.
5136   *
5137   * @return {boolean} Is locked.
5138   */
5139  
5140  function isPostLocked(state) {
5141    return state.postLock.isLocked;
5142  }
5143  /**
5144   * Returns whether post saving is locked.
5145   *
5146   * @param {Object} state Global application state.
5147   *
5148   * @return {boolean} Is locked.
5149   */
5150  
5151  function selectors_isPostSavingLocked(state) {
5152    return Object.keys(state.postSavingLock).length > 0;
5153  }
5154  /**
5155   * Returns whether post autosaving is locked.
5156   *
5157   * @param {Object} state Global application state.
5158   *
5159   * @return {boolean} Is locked.
5160   */
5161  
5162  function isPostAutosavingLocked(state) {
5163    return Object.keys(state.postAutosavingLock).length > 0;
5164  }
5165  /**
5166   * Returns whether the edition of the post has been taken over.
5167   *
5168   * @param {Object} state Global application state.
5169   *
5170   * @return {boolean} Is post lock takeover.
5171   */
5172  
5173  function isPostLockTakeover(state) {
5174    return state.postLock.isTakeover;
5175  }
5176  /**
5177   * Returns details about the post lock user.
5178   *
5179   * @param {Object} state Global application state.
5180   *
5181   * @return {Object} A user object.
5182   */
5183  
5184  function getPostLockUser(state) {
5185    return state.postLock.user;
5186  }
5187  /**
5188   * Returns the active post lock.
5189   *
5190   * @param {Object} state Global application state.
5191   *
5192   * @return {Object} The lock object.
5193   */
5194  
5195  function getActivePostLock(state) {
5196    return state.postLock.activePostLock;
5197  }
5198  /**
5199   * Returns whether or not the user has the unfiltered_html capability.
5200   *
5201   * @param {Object} state Editor state.
5202   *
5203   * @return {boolean} Whether the user can or can't post unfiltered HTML.
5204   */
5205  
5206  function selectors_canUserUseUnfilteredHTML(state) {
5207    return Object(external_this_lodash_["has"])(selectors_getCurrentPost(state), ['_links', 'wp:action-unfiltered-html']);
5208  }
5209  /**
5210   * Returns whether the pre-publish panel should be shown
5211   * or skipped when the user clicks the "publish" button.
5212   *
5213   * @param {Object} state Global application state.
5214   *
5215   * @return {boolean} Whether the pre-publish panel should be shown or not.
5216   */
5217  
5218  function selectors_isPublishSidebarEnabled(state) {
5219    if (state.preferences.hasOwnProperty('isPublishSidebarEnabled')) {
5220      return state.preferences.isPublishSidebarEnabled;
5221    }
5222  
5223    return PREFERENCES_DEFAULTS.isPublishSidebarEnabled;
5224  }
5225  /**
5226   * Return the current block list.
5227   *
5228   * @param {Object} state
5229   * @return {Array} Block list.
5230   */
5231  
5232  function selectors_getEditorBlocks(state) {
5233    return selectors_getEditedPostAttribute(state, 'blocks') || EMPTY_ARRAY;
5234  }
5235  /**
5236   * A block selection object.
5237   *
5238   * @typedef {Object} WPBlockSelection
5239   *
5240   * @property {string} clientId     A block client ID.
5241   * @property {string} attributeKey A block attribute key.
5242   * @property {number} offset       An attribute value offset, based on the rich
5243   *                                 text value. See `wp.richText.create`.
5244   */
5245  
5246  /**
5247   * Returns the current selection start.
5248   *
5249   * @param {Object} state
5250   * @return {WPBlockSelection} The selection start.
5251   */
5252  
5253  function selectors_getEditorSelectionStart(state) {
5254    return selectors_getEditedPostAttribute(state, 'selectionStart');
5255  }
5256  /**
5257   * Returns the current selection end.
5258   *
5259   * @param {Object} state
5260   * @return {WPBlockSelection} The selection end.
5261   */
5262  
5263  function selectors_getEditorSelectionEnd(state) {
5264    return selectors_getEditedPostAttribute(state, 'selectionEnd');
5265  }
5266  /**
5267   * Is the editor ready
5268   *
5269   * @param {Object} state
5270   * @return {boolean} is Ready.
5271   */
5272  
5273  function __unstableIsEditorReady(state) {
5274    return state.isReady;
5275  }
5276  /**
5277   * Returns the post editor settings.
5278   *
5279   * @param {Object} state Editor state.
5280   *
5281   * @return {Object} The editor settings object.
5282   */
5283  
5284  function selectors_getEditorSettings(state) {
5285    return state.editorSettings;
5286  }
5287  /*
5288   * Backward compatibility
5289   */
5290  
5291  function getBlockEditorSelector(name) {
5292    return Object(external_this_wp_data_["createRegistrySelector"])(function (select) {
5293      return function (state) {
5294        var _select;
5295  
5296        external_this_wp_deprecated_default()("`wp.data.select( 'core/editor' )." + name + '`', {
5297          alternative: "`wp.data.select( 'core/block-editor' )." + name + '`'
5298        });
5299  
5300        for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
5301          args[_key - 1] = arguments[_key];
5302        }
5303  
5304        return (_select = select('core/block-editor'))[name].apply(_select, args);
5305      };
5306    });
5307  }
5308  /**
5309   * @see getBlockName in core/block-editor store.
5310   */
5311  
5312  
5313  var selectors_getBlockName = getBlockEditorSelector('getBlockName');
5314  /**
5315   * @see isBlockValid in core/block-editor store.
5316   */
5317  
5318  var isBlockValid = getBlockEditorSelector('isBlockValid');
5319  /**
5320   * @see getBlockAttributes in core/block-editor store.
5321   */
5322  
5323  var getBlockAttributes = getBlockEditorSelector('getBlockAttributes');
5324  /**
5325   * @see getBlock in core/block-editor store.
5326   */
5327  
5328  var selectors_getBlock = getBlockEditorSelector('getBlock');
5329  /**
5330   * @see getBlocks in core/block-editor store.
5331   */
5332  
5333  var selectors_getBlocks = getBlockEditorSelector('getBlocks');
5334  /**
5335   * @see __unstableGetBlockWithoutInnerBlocks in core/block-editor store.
5336   */
5337  
5338  var __unstableGetBlockWithoutInnerBlocks = getBlockEditorSelector('__unstableGetBlockWithoutInnerBlocks');
5339  /**
5340   * @see getClientIdsOfDescendants in core/block-editor store.
5341   */
5342  
5343  var getClientIdsOfDescendants = getBlockEditorSelector('getClientIdsOfDescendants');
5344  /**
5345   * @see getClientIdsWithDescendants in core/block-editor store.
5346   */
5347  
5348  var getClientIdsWithDescendants = getBlockEditorSelector('getClientIdsWithDescendants');
5349  /**
5350   * @see getGlobalBlockCount in core/block-editor store.
5351   */
5352  
5353  var getGlobalBlockCount = getBlockEditorSelector('getGlobalBlockCount');
5354  /**
5355   * @see getBlocksByClientId in core/block-editor store.
5356   */
5357  
5358  var selectors_getBlocksByClientId = getBlockEditorSelector('getBlocksByClientId');
5359  /**
5360   * @see getBlockCount in core/block-editor store.
5361   */
5362  
5363  var getBlockCount = getBlockEditorSelector('getBlockCount');
5364  /**
5365   * @see getBlockSelectionStart in core/block-editor store.
5366   */
5367  
5368  var getBlockSelectionStart = getBlockEditorSelector('getBlockSelectionStart');
5369  /**
5370   * @see getBlockSelectionEnd in core/block-editor store.
5371   */
5372  
5373  var getBlockSelectionEnd = getBlockEditorSelector('getBlockSelectionEnd');
5374  /**
5375   * @see getSelectedBlockCount in core/block-editor store.
5376   */
5377  
5378  var getSelectedBlockCount = getBlockEditorSelector('getSelectedBlockCount');
5379  /**
5380   * @see hasSelectedBlock in core/block-editor store.
5381   */
5382  
5383  var hasSelectedBlock = getBlockEditorSelector('hasSelectedBlock');
5384  /**
5385   * @see getSelectedBlockClientId in core/block-editor store.
5386   */
5387  
5388  var selectors_getSelectedBlockClientId = getBlockEditorSelector('getSelectedBlockClientId');
5389  /**
5390   * @see getSelectedBlock in core/block-editor store.
5391   */
5392  
5393  var getSelectedBlock = getBlockEditorSelector('getSelectedBlock');
5394  /**
5395   * @see getBlockRootClientId in core/block-editor store.
5396   */
5397  
5398  var getBlockRootClientId = getBlockEditorSelector('getBlockRootClientId');
5399  /**
5400   * @see getBlockHierarchyRootClientId in core/block-editor store.
5401   */
5402  
5403  var getBlockHierarchyRootClientId = getBlockEditorSelector('getBlockHierarchyRootClientId');
5404  /**
5405   * @see getAdjacentBlockClientId in core/block-editor store.
5406   */
5407  
5408  var getAdjacentBlockClientId = getBlockEditorSelector('getAdjacentBlockClientId');
5409  /**
5410   * @see getPreviousBlockClientId in core/block-editor store.
5411   */
5412  
5413  var getPreviousBlockClientId = getBlockEditorSelector('getPreviousBlockClientId');
5414  /**
5415   * @see getNextBlockClientId in core/block-editor store.
5416   */
5417  
5418  var getNextBlockClientId = getBlockEditorSelector('getNextBlockClientId');
5419  /**
5420   * @see getSelectedBlocksInitialCaretPosition in core/block-editor store.
5421   */
5422  
5423  var getSelectedBlocksInitialCaretPosition = getBlockEditorSelector('getSelectedBlocksInitialCaretPosition');
5424  /**
5425   * @see getMultiSelectedBlockClientIds in core/block-editor store.
5426   */
5427  
5428  var getMultiSelectedBlockClientIds = getBlockEditorSelector('getMultiSelectedBlockClientIds');
5429  /**
5430   * @see getMultiSelectedBlocks in core/block-editor store.
5431   */
5432  
5433  var getMultiSelectedBlocks = getBlockEditorSelector('getMultiSelectedBlocks');
5434  /**
5435   * @see getFirstMultiSelectedBlockClientId in core/block-editor store.
5436   */
5437  
5438  var getFirstMultiSelectedBlockClientId = getBlockEditorSelector('getFirstMultiSelectedBlockClientId');
5439  /**
5440   * @see getLastMultiSelectedBlockClientId in core/block-editor store.
5441   */
5442  
5443  var getLastMultiSelectedBlockClientId = getBlockEditorSelector('getLastMultiSelectedBlockClientId');
5444  /**
5445   * @see isFirstMultiSelectedBlock in core/block-editor store.
5446   */
5447  
5448  var isFirstMultiSelectedBlock = getBlockEditorSelector('isFirstMultiSelectedBlock');
5449  /**
5450   * @see isBlockMultiSelected in core/block-editor store.
5451   */
5452  
5453  var isBlockMultiSelected = getBlockEditorSelector('isBlockMultiSelected');
5454  /**
5455   * @see isAncestorMultiSelected in core/block-editor store.
5456   */
5457  
5458  var isAncestorMultiSelected = getBlockEditorSelector('isAncestorMultiSelected');
5459  /**
5460   * @see getMultiSelectedBlocksStartClientId in core/block-editor store.
5461   */
5462  
5463  var getMultiSelectedBlocksStartClientId = getBlockEditorSelector('getMultiSelectedBlocksStartClientId');
5464  /**
5465   * @see getMultiSelectedBlocksEndClientId in core/block-editor store.
5466   */
5467  
5468  var getMultiSelectedBlocksEndClientId = getBlockEditorSelector('getMultiSelectedBlocksEndClientId');
5469  /**
5470   * @see getBlockOrder in core/block-editor store.
5471   */
5472  
5473  var getBlockOrder = getBlockEditorSelector('getBlockOrder');
5474  /**
5475   * @see getBlockIndex in core/block-editor store.
5476   */
5477  
5478  var getBlockIndex = getBlockEditorSelector('getBlockIndex');
5479  /**
5480   * @see isBlockSelected in core/block-editor store.
5481   */
5482  
5483  var isBlockSelected = getBlockEditorSelector('isBlockSelected');
5484  /**
5485   * @see hasSelectedInnerBlock in core/block-editor store.
5486   */
5487  
5488  var hasSelectedInnerBlock = getBlockEditorSelector('hasSelectedInnerBlock');
5489  /**
5490   * @see isBlockWithinSelection in core/block-editor store.
5491   */
5492  
5493  var isBlockWithinSelection = getBlockEditorSelector('isBlockWithinSelection');
5494  /**
5495   * @see hasMultiSelection in core/block-editor store.
5496   */
5497  
5498  var hasMultiSelection = getBlockEditorSelector('hasMultiSelection');
5499  /**
5500   * @see isMultiSelecting in core/block-editor store.
5501   */
5502  
5503  var isMultiSelecting = getBlockEditorSelector('isMultiSelecting');
5504  /**
5505   * @see isSelectionEnabled in core/block-editor store.
5506   */
5507  
5508  var isSelectionEnabled = getBlockEditorSelector('isSelectionEnabled');
5509  /**
5510   * @see getBlockMode in core/block-editor store.
5511   */
5512  
5513  var getBlockMode = getBlockEditorSelector('getBlockMode');
5514  /**
5515   * @see isTyping in core/block-editor store.
5516   */
5517  
5518  var isTyping = getBlockEditorSelector('isTyping');
5519  /**
5520   * @see isCaretWithinFormattedText in core/block-editor store.
5521   */
5522  
5523  var isCaretWithinFormattedText = getBlockEditorSelector('isCaretWithinFormattedText');
5524  /**
5525   * @see getBlockInsertionPoint in core/block-editor store.
5526   */
5527  
5528  var getBlockInsertionPoint = getBlockEditorSelector('getBlockInsertionPoint');
5529  /**
5530   * @see isBlockInsertionPointVisible in core/block-editor store.
5531   */
5532  
5533  var isBlockInsertionPointVisible = getBlockEditorSelector('isBlockInsertionPointVisible');
5534  /**
5535   * @see isValidTemplate in core/block-editor store.
5536   */
5537  
5538  var isValidTemplate = getBlockEditorSelector('isValidTemplate');
5539  /**
5540   * @see getTemplate in core/block-editor store.
5541   */
5542  
5543  var getTemplate = getBlockEditorSelector('getTemplate');
5544  /**
5545   * @see getTemplateLock in core/block-editor store.
5546   */
5547  
5548  var getTemplateLock = getBlockEditorSelector('getTemplateLock');
5549  /**
5550   * @see canInsertBlockType in core/block-editor store.
5551   */
5552  
5553  var selectors_canInsertBlockType = getBlockEditorSelector('canInsertBlockType');
5554  /**
5555   * @see getInserterItems in core/block-editor store.
5556   */
5557  
5558  var selectors_getInserterItems = getBlockEditorSelector('getInserterItems');
5559  /**
5560   * @see hasInserterItems in core/block-editor store.
5561   */
5562  
5563  var hasInserterItems = getBlockEditorSelector('hasInserterItems');
5564  /**
5565   * @see getBlockListSettings in core/block-editor store.
5566   */
5567  
5568  var getBlockListSettings = getBlockEditorSelector('getBlockListSettings');
5569  
5570  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/effects/reusable-blocks.js
5571  
5572  
5573  
5574  
5575  function reusable_blocks_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; }
5576  
5577  function reusable_blocks_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { reusable_blocks_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 { reusable_blocks_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
5578  
5579  /**
5580   * External dependencies
5581   */
5582  
5583  
5584  /**
5585   * WordPress dependencies
5586   */
5587  
5588  
5589  
5590   // TODO: Ideally this would be the only dispatch in scope. This requires either
5591  // refactoring editor actions to yielded controls, or replacing direct dispatch
5592  // on the editor store with action creators (e.g. `REMOVE_REUSABLE_BLOCK`).
5593  
5594  
5595  /**
5596   * Internal dependencies
5597   */
5598  
5599  
5600  
5601  /**
5602   * Module Constants
5603   */
5604  
5605  var REUSABLE_BLOCK_NOTICE_ID = 'REUSABLE_BLOCK_NOTICE_ID';
5606  /**
5607   * Fetch Reusable blocks Effect Handler.
5608   *
5609   * @param {Object} action  action object.
5610   * @param {Object} store   Redux Store.
5611   */
5612  
5613  var fetchReusableBlocks =
5614  /*#__PURE__*/
5615  function () {
5616    var _ref = Object(asyncToGenerator["a" /* default */])(
5617    /*#__PURE__*/
5618    external_this_regeneratorRuntime_default.a.mark(function _callee(action, store) {
5619      var id, dispatch, postType, posts, results;
5620      return external_this_regeneratorRuntime_default.a.wrap(function _callee$(_context) {
5621        while (1) {
5622          switch (_context.prev = _context.next) {
5623            case 0:
5624              id = action.id;
5625              dispatch = store.dispatch; // TODO: these are potentially undefined, this fix is in place
5626              // until there is a filter to not use reusable blocks if undefined
5627  
5628              _context.next = 4;
5629              return external_this_wp_apiFetch_default()({
5630                path: '/wp/v2/types/wp_block'
5631              });
5632  
5633            case 4:
5634              postType = _context.sent;
5635  
5636              if (postType) {
5637                _context.next = 7;
5638                break;
5639              }
5640  
5641              return _context.abrupt("return");
5642  
5643            case 7:
5644              _context.prev = 7;
5645  
5646              if (!id) {
5647                _context.next = 15;
5648                break;
5649              }
5650  
5651              _context.next = 11;
5652              return external_this_wp_apiFetch_default()({
5653                path: "/wp/v2/".concat(postType.rest_base, "/").concat(id)
5654              });
5655  
5656            case 11:
5657              _context.t0 = _context.sent;
5658              posts = [_context.t0];
5659              _context.next = 18;
5660              break;
5661  
5662            case 15:
5663              _context.next = 17;
5664              return external_this_wp_apiFetch_default()({
5665                path: "/wp/v2/".concat(postType.rest_base, "?per_page=-1")
5666              });
5667  
5668            case 17:
5669              posts = _context.sent;
5670  
5671            case 18:
5672              results = Object(external_this_lodash_["compact"])(Object(external_this_lodash_["map"])(posts, function (post) {
5673                if (post.status !== 'publish' || post.content.protected) {
5674                  return null;
5675                }
5676  
5677                return reusable_blocks_objectSpread({}, post, {
5678                  content: post.content.raw,
5679                  title: post.title.raw
5680                });
5681              }));
5682  
5683              if (results.length) {
5684                dispatch(__experimentalReceiveReusableBlocks(results));
5685              }
5686  
5687              dispatch({
5688                type: 'FETCH_REUSABLE_BLOCKS_SUCCESS',
5689                id: id
5690              });
5691              _context.next = 26;
5692              break;
5693  
5694            case 23:
5695              _context.prev = 23;
5696              _context.t1 = _context["catch"](7);
5697              dispatch({
5698                type: 'FETCH_REUSABLE_BLOCKS_FAILURE',
5699                id: id,
5700                error: _context.t1
5701              });
5702  
5703            case 26:
5704            case "end":
5705              return _context.stop();
5706          }
5707        }
5708      }, _callee, null, [[7, 23]]);
5709    }));
5710  
5711    return function fetchReusableBlocks(_x, _x2) {
5712      return _ref.apply(this, arguments);
5713    };
5714  }();
5715  /**
5716   * Save Reusable blocks Effect Handler.
5717   *
5718   * @param {Object} action  action object.
5719   * @param {Object} store   Redux Store.
5720   */
5721  
5722  var saveReusableBlocks =
5723  /*#__PURE__*/
5724  function () {
5725    var _ref2 = Object(asyncToGenerator["a" /* default */])(
5726    /*#__PURE__*/
5727    external_this_regeneratorRuntime_default.a.mark(function _callee2(action, store) {
5728      var postType, id, dispatch, state, _getReusableBlock, title, content, isTemporary, data, path, method, updatedReusableBlock, message;
5729  
5730      return external_this_regeneratorRuntime_default.a.wrap(function _callee2$(_context2) {
5731        while (1) {
5732          switch (_context2.prev = _context2.next) {
5733            case 0:
5734              _context2.next = 2;
5735              return external_this_wp_apiFetch_default()({
5736                path: '/wp/v2/types/wp_block'
5737              });
5738  
5739            case 2:
5740              postType = _context2.sent;
5741  
5742              if (postType) {
5743                _context2.next = 5;
5744                break;
5745              }
5746  
5747              return _context2.abrupt("return");
5748  
5749            case 5:
5750              id = action.id;
5751              dispatch = store.dispatch;
5752              state = store.getState();
5753              _getReusableBlock = __experimentalGetReusableBlock(state, id), title = _getReusableBlock.title, content = _getReusableBlock.content, isTemporary = _getReusableBlock.isTemporary;
5754              data = isTemporary ? {
5755                title: title,
5756                content: content,
5757                status: 'publish'
5758              } : {
5759                id: id,
5760                title: title,
5761                content: content,
5762                status: 'publish'
5763              };
5764              path = isTemporary ? "/wp/v2/".concat(postType.rest_base) : "/wp/v2/".concat(postType.rest_base, "/").concat(id);
5765              method = isTemporary ? 'POST' : 'PUT';
5766              _context2.prev = 12;
5767              _context2.next = 15;
5768              return external_this_wp_apiFetch_default()({
5769                path: path,
5770                data: data,
5771                method: method
5772              });
5773  
5774            case 15:
5775              updatedReusableBlock = _context2.sent;
5776              dispatch({
5777                type: 'SAVE_REUSABLE_BLOCK_SUCCESS',
5778                updatedId: updatedReusableBlock.id,
5779                id: id
5780              });
5781              message = isTemporary ? Object(external_this_wp_i18n_["__"])('Block created.') : Object(external_this_wp_i18n_["__"])('Block updated.');
5782              Object(external_this_wp_data_["dispatch"])('core/notices').createSuccessNotice(message, {
5783                id: REUSABLE_BLOCK_NOTICE_ID,
5784                type: 'snackbar'
5785              });
5786  
5787              Object(external_this_wp_data_["dispatch"])('core/block-editor').__unstableSaveReusableBlock(id, updatedReusableBlock.id);
5788  
5789              _context2.next = 26;
5790              break;
5791  
5792            case 22:
5793              _context2.prev = 22;
5794              _context2.t0 = _context2["catch"](12);
5795              dispatch({
5796                type: 'SAVE_REUSABLE_BLOCK_FAILURE',
5797                id: id
5798              });
5799              Object(external_this_wp_data_["dispatch"])('core/notices').createErrorNotice(_context2.t0.message, {
5800                id: REUSABLE_BLOCK_NOTICE_ID
5801              });
5802  
5803            case 26:
5804            case "end":
5805              return _context2.stop();
5806          }
5807        }
5808      }, _callee2, null, [[12, 22]]);
5809    }));
5810  
5811    return function saveReusableBlocks(_x3, _x4) {
5812      return _ref2.apply(this, arguments);
5813    };
5814  }();
5815  /**
5816   * Delete Reusable blocks Effect Handler.
5817   *
5818   * @param {Object} action  action object.
5819   * @param {Object} store   Redux Store.
5820   */
5821  
5822  var deleteReusableBlocks =
5823  /*#__PURE__*/
5824  function () {
5825    var _ref3 = Object(asyncToGenerator["a" /* default */])(
5826    /*#__PURE__*/
5827    external_this_regeneratorRuntime_default.a.mark(function _callee3(action, store) {
5828      var postType, id, getState, dispatch, reusableBlock, allBlocks, associatedBlocks, associatedBlockClientIds, transactionId, message;
5829      return external_this_regeneratorRuntime_default.a.wrap(function _callee3$(_context3) {
5830        while (1) {
5831          switch (_context3.prev = _context3.next) {
5832            case 0:
5833              _context3.next = 2;
5834              return external_this_wp_apiFetch_default()({
5835                path: '/wp/v2/types/wp_block'
5836              });
5837  
5838            case 2:
5839              postType = _context3.sent;
5840  
5841              if (postType) {
5842                _context3.next = 5;
5843                break;
5844              }
5845  
5846              return _context3.abrupt("return");
5847  
5848            case 5:
5849              id = action.id;
5850              getState = store.getState, dispatch = store.dispatch; // Don't allow a reusable block with a temporary ID to be deleted
5851  
5852              reusableBlock = __experimentalGetReusableBlock(getState(), id);
5853  
5854              if (!(!reusableBlock || reusableBlock.isTemporary)) {
5855                _context3.next = 10;
5856                break;
5857              }
5858  
5859              return _context3.abrupt("return");
5860  
5861            case 10:
5862              // Remove any other blocks that reference this reusable block
5863              allBlocks = Object(external_this_wp_data_["select"])('core/block-editor').getBlocks();
5864              associatedBlocks = allBlocks.filter(function (block) {
5865                return Object(external_this_wp_blocks_["isReusableBlock"])(block) && block.attributes.ref === id;
5866              });
5867              associatedBlockClientIds = associatedBlocks.map(function (block) {
5868                return block.clientId;
5869              });
5870              transactionId = Object(external_this_lodash_["uniqueId"])();
5871              dispatch({
5872                type: 'REMOVE_REUSABLE_BLOCK',
5873                id: id,
5874                optimist: {
5875                  type: redux_optimist["BEGIN"],
5876                  id: transactionId
5877                }
5878              }); // Remove the parsed block.
5879  
5880              if (associatedBlockClientIds.length) {
5881                Object(external_this_wp_data_["dispatch"])('core/block-editor').removeBlocks(associatedBlockClientIds);
5882              }
5883  
5884              _context3.prev = 16;
5885              _context3.next = 19;
5886              return external_this_wp_apiFetch_default()({
5887                path: "/wp/v2/".concat(postType.rest_base, "/").concat(id),
5888                method: 'DELETE'
5889              });
5890  
5891            case 19:
5892              dispatch({
5893                type: 'DELETE_REUSABLE_BLOCK_SUCCESS',
5894                id: id,
5895                optimist: {
5896                  type: redux_optimist["COMMIT"],
5897                  id: transactionId
5898                }
5899              });
5900              message = Object(external_this_wp_i18n_["__"])('Block deleted.');
5901              Object(external_this_wp_data_["dispatch"])('core/notices').createSuccessNotice(message, {
5902                id: REUSABLE_BLOCK_NOTICE_ID,
5903                type: 'snackbar'
5904              });
5905              _context3.next = 28;
5906              break;
5907  
5908            case 24:
5909              _context3.prev = 24;
5910              _context3.t0 = _context3["catch"](16);
5911              dispatch({
5912                type: 'DELETE_REUSABLE_BLOCK_FAILURE',
5913                id: id,
5914                optimist: {
5915                  type: redux_optimist["REVERT"],
5916                  id: transactionId
5917                }
5918              });
5919              Object(external_this_wp_data_["dispatch"])('core/notices').createErrorNotice(_context3.t0.message, {
5920                id: REUSABLE_BLOCK_NOTICE_ID
5921              });
5922  
5923            case 28:
5924            case "end":
5925              return _context3.stop();
5926          }
5927        }
5928      }, _callee3, null, [[16, 24]]);
5929    }));
5930  
5931    return function deleteReusableBlocks(_x5, _x6) {
5932      return _ref3.apply(this, arguments);
5933    };
5934  }();
5935  /**
5936   * Convert a reusable block to a static block effect handler
5937   *
5938   * @param {Object} action  action object.
5939   * @param {Object} store   Redux Store.
5940   */
5941  
5942  var reusable_blocks_convertBlockToStatic = function convertBlockToStatic(action, store) {
5943    var state = store.getState();
5944    var oldBlock = Object(external_this_wp_data_["select"])('core/block-editor').getBlock(action.clientId);
5945    var reusableBlock = __experimentalGetReusableBlock(state, oldBlock.attributes.ref);
5946    var newBlocks = Object(external_this_wp_blocks_["parse"])(reusableBlock.content);
5947    Object(external_this_wp_data_["dispatch"])('core/block-editor').replaceBlocks(oldBlock.clientId, newBlocks);
5948  };
5949  /**
5950   * Convert a static block to a reusable block effect handler
5951   *
5952   * @param {Object} action  action object.
5953   * @param {Object} store   Redux Store.
5954   */
5955  
5956  var reusable_blocks_convertBlockToReusable = function convertBlockToReusable(action, store) {
5957    var dispatch = store.dispatch;
5958    var reusableBlock = {
5959      id: Object(external_this_lodash_["uniqueId"])('reusable'),
5960      title: Object(external_this_wp_i18n_["__"])('Untitled Reusable Block'),
5961      content: Object(external_this_wp_blocks_["serialize"])(Object(external_this_wp_data_["select"])('core/block-editor').getBlocksByClientId(action.clientIds))
5962    };
5963    dispatch(__experimentalReceiveReusableBlocks([reusableBlock]));
5964    dispatch(__experimentalSaveReusableBlock(reusableBlock.id));
5965    Object(external_this_wp_data_["dispatch"])('core/block-editor').replaceBlocks(action.clientIds, Object(external_this_wp_blocks_["createBlock"])('core/block', {
5966      ref: reusableBlock.id
5967    }));
5968  };
5969  
5970  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/effects.js
5971  /**
5972   * Internal dependencies
5973   */
5974  
5975  /* harmony default export */ var effects = ({
5976    FETCH_REUSABLE_BLOCKS: function FETCH_REUSABLE_BLOCKS(action, store) {
5977      fetchReusableBlocks(action, store);
5978    },
5979    SAVE_REUSABLE_BLOCK: function SAVE_REUSABLE_BLOCK(action, store) {
5980      saveReusableBlocks(action, store);
5981    },
5982    DELETE_REUSABLE_BLOCK: function DELETE_REUSABLE_BLOCK(action, store) {
5983      deleteReusableBlocks(action, store);
5984    },
5985    CONVERT_BLOCK_TO_STATIC: reusable_blocks_convertBlockToStatic,
5986    CONVERT_BLOCK_TO_REUSABLE: reusable_blocks_convertBlockToReusable
5987  });
5988  
5989  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/middlewares.js
5990  /**
5991   * External dependencies
5992   */
5993  
5994  /**
5995   * Internal dependencies
5996   */
5997  
5998  
5999  /**
6000   * Applies the custom middlewares used specifically in the editor module.
6001   *
6002   * @param {Object} store Store Object.
6003   *
6004   * @return {Object} Update Store Object.
6005   */
6006  
6007  function applyMiddlewares(store) {
6008    var enhancedDispatch = function enhancedDispatch() {
6009      throw new Error('Dispatching while constructing your middleware is not allowed. ' + 'Other middleware would not be applied to this dispatch.');
6010    };
6011  
6012    var middlewareAPI = {
6013      getState: store.getState,
6014      dispatch: function dispatch() {
6015        return enhancedDispatch.apply(void 0, arguments);
6016      }
6017    };
6018    enhancedDispatch = refx_default()(effects)(middlewareAPI)(store.dispatch);
6019    store.dispatch = enhancedDispatch;
6020    return store;
6021  }
6022  
6023  /* harmony default export */ var middlewares = (applyMiddlewares);
6024  
6025  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/controls.js
6026  /**
6027   * WordPress dependencies
6028   */
6029  
6030  /**
6031   * Returns a control descriptor signalling to subscribe to the registry and
6032   * resolve the control promise only when the next state change occurs.
6033   *
6034   * @return {Object} Control descriptor.
6035   */
6036  
6037  function awaitNextStateChange() {
6038    return {
6039      type: 'AWAIT_NEXT_STATE_CHANGE'
6040    };
6041  }
6042  /**
6043   * Returns a control descriptor signalling to resolve with the current data
6044   * registry.
6045   *
6046   * @return {Object} Control descriptor.
6047   */
6048  
6049  function getRegistry() {
6050    return {
6051      type: 'GET_REGISTRY'
6052    };
6053  }
6054  /**
6055   * Function returning a sessionStorage key to set or retrieve a given post's
6056   * automatic session backup.
6057   *
6058   * Keys are crucially prefixed with 'wp-autosave-' so that wp-login.php's
6059   * `loggedout` handler can clear sessionStorage of any user-private content.
6060   *
6061   * @see https://github.com/WordPress/wordpress-develop/blob/6dad32d2aed47e6c0cf2aee8410645f6d7aba6bd/src/wp-login.php#L103
6062   *
6063   * @param {string} postId  Post ID.
6064   * @return {string}        sessionStorage key
6065   */
6066  
6067  function postKey(postId) {
6068    return "wp-autosave-block-editor-post-".concat(postId);
6069  }
6070  
6071  function localAutosaveGet(postId) {
6072    return window.sessionStorage.getItem(postKey(postId));
6073  }
6074  function localAutosaveSet(postId, title, content, excerpt) {
6075    window.sessionStorage.setItem(postKey(postId), JSON.stringify({
6076      post_title: title,
6077      content: content,
6078      excerpt: excerpt
6079    }));
6080  }
6081  function localAutosaveClear(postId) {
6082    window.sessionStorage.removeItem(postKey(postId));
6083  }
6084  var controls = {
6085    AWAIT_NEXT_STATE_CHANGE: Object(external_this_wp_data_["createRegistryControl"])(function (registry) {
6086      return function () {
6087        return new Promise(function (resolve) {
6088          var unsubscribe = registry.subscribe(function () {
6089            unsubscribe();
6090            resolve();
6091          });
6092        });
6093      };
6094    }),
6095    GET_REGISTRY: Object(external_this_wp_data_["createRegistryControl"])(function (registry) {
6096      return function () {
6097        return registry;
6098      };
6099    }),
6100    LOCAL_AUTOSAVE_SET: function LOCAL_AUTOSAVE_SET(_ref) {
6101      var postId = _ref.postId,
6102          title = _ref.title,
6103          content = _ref.content,
6104          excerpt = _ref.excerpt;
6105      localAutosaveSet(postId, title, content, excerpt);
6106    }
6107  };
6108  /* harmony default export */ var store_controls = (controls);
6109  
6110  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/index.js
6111  
6112  
6113  function store_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; }
6114  
6115  function store_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { store_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 { store_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
6116  
6117  /**
6118   * WordPress dependencies
6119   */
6120  
6121  
6122  /**
6123   * Internal dependencies
6124   */
6125  
6126  
6127  
6128  
6129  
6130  
6131  
6132  /**
6133   * Post editor data store configuration.
6134   *
6135   * @see https://github.com/WordPress/gutenberg/blob/master/packages/data/README.md#registerStore
6136   *
6137   * @type {Object}
6138   */
6139  
6140  var storeConfig = {
6141    reducer: reducer,
6142    selectors: selectors_namespaceObject,
6143    actions: actions_namespaceObject,
6144    controls: store_objectSpread({}, external_this_wp_dataControls_["controls"], {}, store_controls)
6145  };
6146  var store_store = Object(external_this_wp_data_["registerStore"])(STORE_KEY, store_objectSpread({}, storeConfig, {
6147    persist: ['preferences']
6148  }));
6149  middlewares(store_store);
6150  /* harmony default export */ var build_module_store = (store_store);
6151  
6152  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
6153  var esm_extends = __webpack_require__(12);
6154  
6155  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
6156  var objectWithoutProperties = __webpack_require__(19);
6157  
6158  // EXTERNAL MODULE: external {"this":["wp","element"]}
6159  var external_this_wp_element_ = __webpack_require__(0);
6160  
6161  // EXTERNAL MODULE: external {"this":["wp","compose"]}
6162  var external_this_wp_compose_ = __webpack_require__(8);
6163  
6164  // EXTERNAL MODULE: external {"this":["wp","hooks"]}
6165  var external_this_wp_hooks_ = __webpack_require__(32);
6166  
6167  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/hooks/custom-sources-backwards-compatibility.js
6168  
6169  
6170  
6171  
6172  
6173  
6174  function custom_sources_backwards_compatibility_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; }
6175  
6176  function custom_sources_backwards_compatibility_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { custom_sources_backwards_compatibility_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 { custom_sources_backwards_compatibility_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
6177  
6178  /**
6179   * External dependencies
6180   */
6181  
6182  /**
6183   * WordPress dependencies
6184   */
6185  
6186  
6187  
6188  
6189  
6190  
6191  /** @typedef {import('@wordpress/compose').WPHigherOrderComponent} WPHigherOrderComponent */
6192  
6193  /** @typedef {import('@wordpress/blocks').WPBlockSettings} WPBlockSettings */
6194  
6195  /**
6196   * Object whose keys are the names of block attributes, where each value
6197   * represents the meta key to which the block attribute is intended to save.
6198   *
6199   * @see https://developer.wordpress.org/reference/functions/register_meta/
6200   *
6201   * @typedef {Object<string,string>} WPMetaAttributeMapping
6202   */
6203  
6204  /**
6205   * Given a mapping of attribute names (meta source attributes) to their
6206   * associated meta key, returns a higher order component that overrides its
6207   * `attributes` and `setAttributes` props to sync any changes with the edited
6208   * post's meta keys.
6209   *
6210   * @param {WPMetaAttributeMapping} metaAttributes Meta attribute mapping.
6211   *
6212   * @return {WPHigherOrderComponent} Higher-order component.
6213   */
6214  
6215  var custom_sources_backwards_compatibility_createWithMetaAttributeSource = function createWithMetaAttributeSource(metaAttributes) {
6216    return Object(external_this_wp_compose_["createHigherOrderComponent"])(function (BlockEdit) {
6217      return function (_ref) {
6218        var attributes = _ref.attributes,
6219            _setAttributes = _ref.setAttributes,
6220            props = Object(objectWithoutProperties["a" /* default */])(_ref, ["attributes", "setAttributes"]);
6221  
6222        var postType = Object(external_this_wp_data_["useSelect"])(function (select) {
6223          return select('core/editor').getCurrentPostType();
6224        }, []);
6225  
6226        var _useEntityProp = Object(external_this_wp_coreData_["useEntityProp"])('postType', postType, 'meta'),
6227            _useEntityProp2 = Object(slicedToArray["a" /* default */])(_useEntityProp, 2),
6228            meta = _useEntityProp2[0],
6229            setMeta = _useEntityProp2[1];
6230  
6231        var mergedAttributes = Object(external_this_wp_element_["useMemo"])(function () {
6232          return custom_sources_backwards_compatibility_objectSpread({}, attributes, {}, Object(external_this_lodash_["mapValues"])(metaAttributes, function (metaKey) {
6233            return meta[metaKey];
6234          }));
6235        }, [attributes, meta]);
6236        return Object(external_this_wp_element_["createElement"])(BlockEdit, Object(esm_extends["a" /* default */])({
6237          attributes: mergedAttributes,
6238          setAttributes: function setAttributes(nextAttributes) {
6239            var nextMeta = Object(external_this_lodash_["mapKeys"])( // Filter to intersection of keys between the updated
6240            // attributes and those with an associated meta key.
6241            Object(external_this_lodash_["pickBy"])(nextAttributes, function (value, key) {
6242              return metaAttributes[key];
6243            }), // Rename the keys to the expected meta key name.
6244            function (value, attributeKey) {
6245              return metaAttributes[attributeKey];
6246            });
6247  
6248            if (!Object(external_this_lodash_["isEmpty"])(nextMeta)) {
6249              setMeta(nextMeta);
6250            }
6251  
6252            _setAttributes(nextAttributes);
6253          }
6254        }, props));
6255      };
6256    }, 'withMetaAttributeSource');
6257  };
6258  /**
6259   * Filters a registered block's settings to enhance a block's `edit` component
6260   * to upgrade meta-sourced attributes to use the post's meta entity property.
6261   *
6262   * @param {WPBlockSettings} settings Registered block settings.
6263   *
6264   * @return {WPBlockSettings} Filtered block settings.
6265   */
6266  
6267  
6268  function shimAttributeSource(settings) {
6269    /** @type {WPMetaAttributeMapping} */
6270    var metaAttributes = Object(external_this_lodash_["mapValues"])(Object(external_this_lodash_["pickBy"])(settings.attributes, {
6271      source: 'meta'
6272    }), 'meta');
6273  
6274    if (!Object(external_this_lodash_["isEmpty"])(metaAttributes)) {
6275      settings.edit = custom_sources_backwards_compatibility_createWithMetaAttributeSource(metaAttributes)(settings.edit);
6276    }
6277  
6278    return settings;
6279  }
6280  
6281  Object(external_this_wp_hooks_["addFilter"])('blocks.registerBlockType', 'core/editor/custom-sources-backwards-compatibility/shim-attribute-source', shimAttributeSource); // The above filter will only capture blocks registered after the filter was
6282  // added. There may already be blocks registered by this point, and those must
6283  // be updated to apply the shim.
6284  //
6285  // The following implementation achieves this, albeit with a couple caveats:
6286  // - Only blocks registered on the global store will be modified.
6287  // - The block settings are directly mutated, since there is currently no
6288  //   mechanism to update an existing block registration. This is the reason for
6289  //   `getBlockType` separate from `getBlockTypes`, since the latter returns a
6290  //   _copy_ of the block registration (i.e. the mutation would not affect the
6291  //   actual registered block settings).
6292  //
6293  // `getBlockTypes` or `getBlockType` implementation could change in the future
6294  // in regards to creating settings clones, but the corresponding end-to-end
6295  // tests for meta blocks should cover against any potential regressions.
6296  //
6297  // In the future, we could support updating block settings, at which point this
6298  // implementation could use that mechanism instead.
6299  
6300  Object(external_this_wp_data_["select"])('core/blocks').getBlockTypes().map(function (_ref2) {
6301    var name = _ref2.name;
6302    return Object(external_this_wp_data_["select"])('core/blocks').getBlockType(name);
6303  }).forEach(shimAttributeSource);
6304  
6305  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/autocompleters/block.js
6306  
6307  
6308  
6309  /**
6310   * External dependencies
6311   */
6312  
6313  /**
6314   * WordPress dependencies
6315   */
6316  
6317  
6318  
6319  
6320  /** @typedef {import('@wordpress/block-editor').WPEditorInserterItem} WPEditorInserterItem */
6321  
6322  /** @typedef {import('@wordpress/components').WPCompleter} WPCompleter */
6323  
6324  /**
6325   * Returns the client ID of the parent where a newly inserted block would be
6326   * placed.
6327   *
6328   * @return {string} Client ID of the parent where a newly inserted block would
6329   *                  be placed.
6330   */
6331  
6332  function defaultGetBlockInsertionParentClientId() {
6333    return Object(external_this_wp_data_["select"])('core/block-editor').getBlockInsertionPoint().rootClientId;
6334  }
6335  /**
6336   * Returns the inserter items for the specified parent block.
6337   *
6338   * @param {string} rootClientId Client ID of the block for which to retrieve
6339   *                              inserter items.
6340   *
6341   * @return {Array<WPEditorInserterItem>} The inserter items for the specified
6342   *                                      parent.
6343   */
6344  
6345  
6346  function defaultGetInserterItems(rootClientId) {
6347    return Object(external_this_wp_data_["select"])('core/block-editor').getInserterItems(rootClientId);
6348  }
6349  /**
6350   * Returns the name of the currently selected block.
6351   *
6352   * @return {string?} The name of the currently selected block or `null` if no
6353   *                   block is selected.
6354   */
6355  
6356  
6357  function defaultGetSelectedBlockName() {
6358    var _select = Object(external_this_wp_data_["select"])('core/block-editor'),
6359        getSelectedBlockClientId = _select.getSelectedBlockClientId,
6360        getBlockName = _select.getBlockName;
6361  
6362    var selectedBlockClientId = getSelectedBlockClientId();
6363    return selectedBlockClientId ? getBlockName(selectedBlockClientId) : null;
6364  }
6365  /**
6366   * Triggers a fetch of reusable blocks, once.
6367   *
6368   * TODO: Reusable blocks fetching should be reimplemented as a core-data entity
6369   * resolver, not relying on `core/editor` (see #7119). The implementation here
6370   * is imperfect in that the options result will not await the completion of the
6371   * fetch request and thus will not include any reusable blocks. This has always
6372   * been true, but relied upon the fact the user would be delayed in typing an
6373   * autocompleter search query. Once implemented using resolvers, the status of
6374   * this request could be subscribed to as part of a promised return value using
6375   * the result of `hasFinishedResolution`. There is currently reliable way to
6376   * determine that a reusable blocks fetch request has completed.
6377   *
6378   * @return {Promise} Promise resolving once reusable blocks fetched.
6379   */
6380  
6381  
6382  var block_fetchReusableBlocks = Object(external_this_lodash_["once"])(function () {
6383    Object(external_this_wp_data_["dispatch"])('core/editor').__experimentalFetchReusableBlocks();
6384  });
6385  /**
6386   * Creates a blocks repeater for replacing the current block with a selected block type.
6387   *
6388   * @return {WPCompleter} A blocks completer.
6389   */
6390  
6391  function createBlockCompleter() {
6392    var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
6393        _ref$getBlockInsertio = _ref.getBlockInsertionParentClientId,
6394        getBlockInsertionParentClientId = _ref$getBlockInsertio === void 0 ? defaultGetBlockInsertionParentClientId : _ref$getBlockInsertio,
6395        _ref$getInserterItems = _ref.getInserterItems,
6396        getInserterItems = _ref$getInserterItems === void 0 ? defaultGetInserterItems : _ref$getInserterItems,
6397        _ref$getSelectedBlock = _ref.getSelectedBlockName,
6398        getSelectedBlockName = _ref$getSelectedBlock === void 0 ? defaultGetSelectedBlockName : _ref$getSelectedBlock;
6399  
6400    return {
6401      name: 'blocks',
6402      className: 'editor-autocompleters__block',
6403      triggerPrefix: '/',
6404      options: function options() {
6405        block_fetchReusableBlocks();
6406        var selectedBlockName = getSelectedBlockName();
6407        return getInserterItems(getBlockInsertionParentClientId()).filter( // Avoid offering to replace the current block with a block of the same type.
6408        function (inserterItem) {
6409          return selectedBlockName !== inserterItem.name;
6410        });
6411      },
6412      getOptionKeywords: function getOptionKeywords(inserterItem) {
6413        var title = inserterItem.title,
6414            _inserterItem$keyword = inserterItem.keywords,
6415            keywords = _inserterItem$keyword === void 0 ? [] : _inserterItem$keyword,
6416            category = inserterItem.category;
6417        return [category].concat(Object(toConsumableArray["a" /* default */])(keywords), [title]);
6418      },
6419      getOptionLabel: function getOptionLabel(inserterItem) {
6420        var icon = inserterItem.icon,
6421            title = inserterItem.title;
6422        return [Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["BlockIcon"], {
6423          key: "icon",
6424          icon: icon,
6425          showColors: true
6426        }), title];
6427      },
6428      allowContext: function allowContext(before, after) {
6429        return !(/\S/.test(before) || /\S/.test(after));
6430      },
6431      getOptionCompletion: function getOptionCompletion(inserterItem) {
6432        var name = inserterItem.name,
6433            initialAttributes = inserterItem.initialAttributes;
6434        return {
6435          action: 'replace',
6436          value: Object(external_this_wp_blocks_["createBlock"])(name, initialAttributes)
6437        };
6438      },
6439      isOptionDisabled: function isOptionDisabled(inserterItem) {
6440        return inserterItem.isDisabled;
6441      }
6442    };
6443  }
6444  /**
6445   * Creates a blocks repeater for replacing the current block with a selected block type.
6446   *
6447   * @return {WPCompleter} A blocks completer.
6448   */
6449  
6450  /* harmony default export */ var autocompleters_block = (createBlockCompleter());
6451  
6452  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/autocompleters/user.js
6453  
6454  
6455  /**
6456   * WordPress dependencies
6457   */
6458  
6459  /** @typedef {import('@wordpress/components').WPCompleter} WPCompleter */
6460  
6461  /**
6462   * A user mentions completer.
6463   *
6464   * @type {WPCompleter}
6465   */
6466  
6467  /* harmony default export */ var autocompleters_user = ({
6468    name: 'users',
6469    className: 'editor-autocompleters__user',
6470    triggerPrefix: '@',
6471    options: function options(search) {
6472      var payload = '';
6473  
6474      if (search) {
6475        payload = '?search=' + encodeURIComponent(search);
6476      }
6477  
6478      return external_this_wp_apiFetch_default()({
6479        path: '/wp/v2/users' + payload
6480      });
6481    },
6482    isDebounced: true,
6483    getOptionKeywords: function getOptionKeywords(user) {
6484      return [user.slug, user.name];
6485    },
6486    getOptionLabel: function getOptionLabel(user) {
6487      var avatar = user.avatar_urls && user.avatar_urls[24] ? Object(external_this_wp_element_["createElement"])("img", {
6488        key: "avatar",
6489        className: "editor-autocompleters__user-avatar",
6490        alt: "",
6491        src: user.avatar_urls[24]
6492      }) : Object(external_this_wp_element_["createElement"])("span", {
6493        className: "editor-autocompleters__no-avatar"
6494      });
6495      return [avatar, Object(external_this_wp_element_["createElement"])("span", {
6496        key: "name",
6497        className: "editor-autocompleters__user-name"
6498      }, user.name), Object(external_this_wp_element_["createElement"])("span", {
6499        key: "slug",
6500        className: "editor-autocompleters__user-slug"
6501      }, user.slug)];
6502    },
6503    getOptionCompletion: function getOptionCompletion(user) {
6504      return "@".concat(user.slug);
6505    }
6506  });
6507  
6508  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/autocompleters/index.js
6509  
6510  
6511  
6512  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
6513  var classCallCheck = __webpack_require__(14);
6514  
6515  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
6516  var createClass = __webpack_require__(13);
6517  
6518  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js
6519  var possibleConstructorReturn = __webpack_require__(15);
6520  
6521  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
6522  var getPrototypeOf = __webpack_require__(16);
6523  
6524  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js + 1 modules
6525  var inherits = __webpack_require__(17);
6526  
6527  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/autosave-monitor/index.js
6528  
6529  
6530  
6531  
6532  
6533  
6534  /**
6535   * WordPress dependencies
6536   */
6537  
6538  
6539  
6540  var autosave_monitor_AutosaveMonitor =
6541  /*#__PURE__*/
6542  function (_Component) {
6543    Object(inherits["a" /* default */])(AutosaveMonitor, _Component);
6544  
6545    function AutosaveMonitor() {
6546      Object(classCallCheck["a" /* default */])(this, AutosaveMonitor);
6547  
6548      return Object(possibleConstructorReturn["a" /* default */])(this, Object(getPrototypeOf["a" /* default */])(AutosaveMonitor).apply(this, arguments));
6549    }
6550  
6551    Object(createClass["a" /* default */])(AutosaveMonitor, [{
6552      key: "componentDidUpdate",
6553      value: function componentDidUpdate(prevProps) {
6554        var _this$props = this.props,
6555            isDirty = _this$props.isDirty,
6556            editsReference = _this$props.editsReference,
6557            isAutosaveable = _this$props.isAutosaveable,
6558            isAutosaving = _this$props.isAutosaving; // The edits reference is held for comparison to avoid scheduling an
6559        // autosave if an edit has not been made since the last autosave
6560        // completion. This is assigned when the autosave completes, and reset
6561        // when an edit occurs.
6562        //
6563        // See: https://github.com/WordPress/gutenberg/issues/12318
6564  
6565        if (editsReference !== prevProps.editsReference) {
6566          this.didAutosaveForEditsReference = false;
6567        }
6568  
6569        if (!isAutosaving && prevProps.isAutosaving) {
6570          this.didAutosaveForEditsReference = true;
6571        }
6572  
6573        if (prevProps.isDirty !== isDirty || prevProps.isAutosaveable !== isAutosaveable || prevProps.editsReference !== editsReference) {
6574          this.toggleTimer(isDirty && isAutosaveable && !this.didAutosaveForEditsReference);
6575        }
6576      }
6577    }, {
6578      key: "componentWillUnmount",
6579      value: function componentWillUnmount() {
6580        this.toggleTimer(false);
6581      }
6582    }, {
6583      key: "toggleTimer",
6584      value: function toggleTimer(isPendingSave) {
6585        var _this = this;
6586  
6587        var _this$props2 = this.props,
6588            interval = _this$props2.interval,
6589            _this$props2$shouldTh = _this$props2.shouldThrottle,
6590            shouldThrottle = _this$props2$shouldTh === void 0 ? false : _this$props2$shouldTh; // By default, AutosaveMonitor will wait for a pause in editing before
6591        // autosaving. In other words, its action is "debounced".
6592        //
6593        // The `shouldThrottle` props allows overriding this behaviour, thus
6594        // making the autosave action "throttled".
6595  
6596        if (!shouldThrottle && this.pendingSave) {
6597          clearTimeout(this.pendingSave);
6598          delete this.pendingSave;
6599        }
6600  
6601        if (isPendingSave && !(shouldThrottle && this.pendingSave)) {
6602          this.pendingSave = setTimeout(function () {
6603            _this.props.autosave();
6604  
6605            delete _this.pendingSave;
6606          }, interval * 1000);
6607        }
6608      }
6609    }, {
6610      key: "render",
6611      value: function render() {
6612        return null;
6613      }
6614    }]);
6615  
6616    return AutosaveMonitor;
6617  }(external_this_wp_element_["Component"]);
6618  /* harmony default export */ var autosave_monitor = (Object(external_this_wp_compose_["compose"])([Object(external_this_wp_data_["withSelect"])(function (select, ownProps) {
6619    var _select = select('core'),
6620        getReferenceByDistinctEdits = _select.getReferenceByDistinctEdits;
6621  
6622    var _select2 = select('core/editor'),
6623        isEditedPostDirty = _select2.isEditedPostDirty,
6624        isEditedPostAutosaveable = _select2.isEditedPostAutosaveable,
6625        isAutosavingPost = _select2.isAutosavingPost,
6626        getEditorSettings = _select2.getEditorSettings;
6627  
6628    var _ownProps$interval = ownProps.interval,
6629        interval = _ownProps$interval === void 0 ? getEditorSettings().autosaveInterval : _ownProps$interval;
6630    return {
6631      isDirty: isEditedPostDirty(),
6632      isAutosaveable: isEditedPostAutosaveable(),
6633      editsReference: getReferenceByDistinctEdits(),
6634      isAutosaving: isAutosavingPost(),
6635      interval: interval
6636    };
6637  }), Object(external_this_wp_data_["withDispatch"])(function (dispatch, ownProps) {
6638    return {
6639      autosave: function autosave() {
6640        var _ownProps$autosave = ownProps.autosave,
6641            autosave = _ownProps$autosave === void 0 ? dispatch('core/editor').autosave : _ownProps$autosave;
6642        autosave();
6643      }
6644    };
6645  })])(autosave_monitor_AutosaveMonitor));
6646  
6647  // EXTERNAL MODULE: ./node_modules/classnames/index.js
6648  var classnames = __webpack_require__(11);
6649  var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
6650  
6651  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/document-outline/item.js
6652  
6653  
6654  /**
6655   * External dependencies
6656   */
6657  
6658  /**
6659   * WordPress dependencies
6660   */
6661  
6662  
6663  
6664  var item_TableOfContentsItem = function TableOfContentsItem(_ref) {
6665    var children = _ref.children,
6666        isValid = _ref.isValid,
6667        level = _ref.level,
6668        _ref$path = _ref.path,
6669        path = _ref$path === void 0 ? [] : _ref$path,
6670        href = _ref.href,
6671        onSelect = _ref.onSelect;
6672    return Object(external_this_wp_element_["createElement"])("li", {
6673      className: classnames_default()('document-outline__item', "is-".concat(level.toLowerCase()), {
6674        'is-invalid': !isValid
6675      })
6676    }, Object(external_this_wp_element_["createElement"])("a", {
6677      href: href,
6678      className: "document-outline__button",
6679      onClick: onSelect
6680    }, Object(external_this_wp_element_["createElement"])("span", {
6681      className: "document-outline__emdash",
6682      "aria-hidden": "true"
6683    }), // path is an array of nodes that are ancestors of the heading starting in the top level node.
6684    // This mapping renders each ancestor to make it easier for the user to know where the headings are nested.
6685    path.map(function (_ref2, index) {
6686      var clientId = _ref2.clientId;
6687      return Object(external_this_wp_element_["createElement"])("strong", {
6688        key: index,
6689        className: "document-outline__level"
6690      }, Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["BlockTitle"], {
6691        clientId: clientId
6692      }));
6693    }), Object(external_this_wp_element_["createElement"])("strong", {
6694      className: "document-outline__level"
6695    }, level), Object(external_this_wp_element_["createElement"])("span", {
6696      className: "document-outline__item-content"
6697    }, children)));
6698  };
6699  
6700  /* harmony default export */ var document_outline_item = (item_TableOfContentsItem);
6701  
6702  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/document-outline/index.js
6703  
6704  
6705  
6706  
6707  function document_outline_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; }
6708  
6709  function document_outline_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { document_outline_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 { document_outline_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
6710  
6711  /**
6712   * External dependencies
6713   */
6714  
6715  /**
6716   * WordPress dependencies
6717   */
6718  
6719  
6720  
6721  
6722  
6723  /**
6724   * Internal dependencies
6725   */
6726  
6727  
6728  /**
6729   * Module constants
6730   */
6731  
6732  var emptyHeadingContent = Object(external_this_wp_element_["createElement"])("em", null, Object(external_this_wp_i18n_["__"])('(Empty heading)'));
6733  var incorrectLevelContent = [Object(external_this_wp_element_["createElement"])("br", {
6734    key: "incorrect-break"
6735  }), Object(external_this_wp_element_["createElement"])("em", {
6736    key: "incorrect-message"
6737  }, Object(external_this_wp_i18n_["__"])('(Incorrect heading level)'))];
6738  var singleH1Headings = [Object(external_this_wp_element_["createElement"])("br", {
6739    key: "incorrect-break-h1"
6740  }), Object(external_this_wp_element_["createElement"])("em", {
6741    key: "incorrect-message-h1"
6742  }, Object(external_this_wp_i18n_["__"])('(Your theme may already use a H1 for the post title)'))];
6743  var multipleH1Headings = [Object(external_this_wp_element_["createElement"])("br", {
6744    key: "incorrect-break-multiple-h1"
6745  }), Object(external_this_wp_element_["createElement"])("em", {
6746    key: "incorrect-message-multiple-h1"
6747  }, Object(external_this_wp_i18n_["__"])('(Multiple H1 headings are not recommended)'))];
6748  /**
6749   * Returns an array of heading blocks enhanced with the following properties:
6750   * path    - An array of blocks that are ancestors of the heading starting from a top-level node.
6751   *           Can be an empty array if the heading is a top-level node (is not nested inside another block).
6752   * level   - An integer with the heading level.
6753   * isEmpty - Flag indicating if the heading has no content.
6754   *
6755   * @param {?Array} blocks An array of blocks.
6756   * @param {?Array} path   An array of blocks that are ancestors of the blocks passed as blocks.
6757   *
6758   * @return {Array} An array of heading blocks enhanced with the properties described above.
6759   */
6760  
6761  var document_outline_computeOutlineHeadings = function computeOutlineHeadings() {
6762    var blocks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
6763    var path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
6764    return Object(external_this_lodash_["flatMap"])(blocks, function () {
6765      var block = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
6766  
6767      if (block.name === 'core/heading') {
6768        return document_outline_objectSpread({}, block, {
6769          path: path,
6770          level: block.attributes.level,
6771          isEmpty: isEmptyHeading(block)
6772        });
6773      }
6774  
6775      return computeOutlineHeadings(block.innerBlocks, [].concat(Object(toConsumableArray["a" /* default */])(path), [block]));
6776    });
6777  };
6778  
6779  var isEmptyHeading = function isEmptyHeading(heading) {
6780    return !heading.attributes.content || heading.attributes.content.length === 0;
6781  };
6782  
6783  var document_outline_DocumentOutline = function DocumentOutline(_ref) {
6784    var _ref$blocks = _ref.blocks,
6785        blocks = _ref$blocks === void 0 ? [] : _ref$blocks,
6786        title = _ref.title,
6787        onSelect = _ref.onSelect,
6788        isTitleSupported = _ref.isTitleSupported,
6789        hasOutlineItemsDisabled = _ref.hasOutlineItemsDisabled;
6790    var headings = document_outline_computeOutlineHeadings(blocks);
6791  
6792    if (headings.length < 1) {
6793      return null;
6794    }
6795  
6796    var prevHeadingLevel = 1; // Not great but it's the simplest way to locate the title right now.
6797  
6798    var titleNode = document.querySelector('.editor-post-title__input');
6799    var hasTitle = isTitleSupported && title && titleNode;
6800    var countByLevel = Object(external_this_lodash_["countBy"])(headings, 'level');
6801    var hasMultipleH1 = countByLevel[1] > 1;
6802    return Object(external_this_wp_element_["createElement"])("div", {
6803      className: "document-outline"
6804    }, Object(external_this_wp_element_["createElement"])("ul", null, hasTitle && Object(external_this_wp_element_["createElement"])(document_outline_item, {
6805      level: Object(external_this_wp_i18n_["__"])('Title'),
6806      isValid: true,
6807      onSelect: onSelect,
6808      href: "#".concat(titleNode.id),
6809      isDisabled: hasOutlineItemsDisabled
6810    }, title), headings.map(function (item, index) {
6811      // Headings remain the same, go up by one, or down by any amount.
6812      // Otherwise there are missing levels.
6813      var isIncorrectLevel = item.level > prevHeadingLevel + 1;
6814      var isValid = !item.isEmpty && !isIncorrectLevel && !!item.level && (item.level !== 1 || !hasMultipleH1 && !hasTitle);
6815      prevHeadingLevel = item.level;
6816      return Object(external_this_wp_element_["createElement"])(document_outline_item, {
6817        key: index,
6818        level: "H".concat(item.level),
6819        isValid: isValid,
6820        path: item.path,
6821        isDisabled: hasOutlineItemsDisabled,
6822        href: "#block-".concat(item.clientId),
6823        onSelect: onSelect
6824      }, item.isEmpty ? emptyHeadingContent : Object(external_this_wp_richText_["getTextContent"])(Object(external_this_wp_richText_["create"])({
6825        html: item.attributes.content
6826      })), isIncorrectLevel && incorrectLevelContent, item.level === 1 && hasMultipleH1 && multipleH1Headings, hasTitle && item.level === 1 && !hasMultipleH1 && singleH1Headings);
6827    })));
6828  };
6829  /* harmony default export */ var document_outline = (Object(external_this_wp_compose_["compose"])(Object(external_this_wp_data_["withSelect"])(function (select) {
6830    var _select = select('core/block-editor'),
6831        getBlocks = _select.getBlocks;
6832  
6833    var _select2 = select('core/editor'),
6834        getEditedPostAttribute = _select2.getEditedPostAttribute;
6835  
6836    var _select3 = select('core'),
6837        getPostType = _select3.getPostType;
6838  
6839    var postType = getPostType(getEditedPostAttribute('type'));
6840    return {
6841      title: getEditedPostAttribute('title'),
6842      blocks: getBlocks(),
6843      isTitleSupported: Object(external_this_lodash_["get"])(postType, ['supports', 'title'], false)
6844    };
6845  }))(document_outline_DocumentOutline));
6846  
6847  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/document-outline/check.js
6848  /**
6849   * External dependencies
6850   */
6851  
6852  /**
6853   * WordPress dependencies
6854   */
6855  
6856  
6857  
6858  function DocumentOutlineCheck(_ref) {
6859    var blocks = _ref.blocks,
6860        children = _ref.children;
6861    var headings = Object(external_this_lodash_["filter"])(blocks, function (block) {
6862      return block.name === 'core/heading';
6863    });
6864  
6865    if (headings.length < 1) {
6866      return null;
6867    }
6868  
6869    return children;
6870  }
6871  
6872  /* harmony default export */ var check = (Object(external_this_wp_data_["withSelect"])(function (select) {
6873    return {
6874      blocks: select('core/block-editor').getBlocks()
6875    };
6876  })(DocumentOutlineCheck));
6877  
6878  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/global-keyboard-shortcuts/save-shortcut.js
6879  /**
6880   * WordPress dependencies
6881   */
6882  
6883  
6884  
6885  function SaveShortcut() {
6886    var _useDispatch = Object(external_this_wp_data_["useDispatch"])('core/editor'),
6887        savePost = _useDispatch.savePost;
6888  
6889    var isEditedPostDirty = Object(external_this_wp_data_["useSelect"])(function (select) {
6890      return select('core/editor').isEditedPostDirty;
6891    }, []);
6892    Object(external_this_wp_keyboardShortcuts_["useShortcut"])('core/editor/save', function (event) {
6893      event.preventDefault(); // TODO: This should be handled in the `savePost` effect in
6894      // considering `isSaveable`. See note on `isEditedPostSaveable`
6895      // selector about dirtiness and meta-boxes.
6896      //
6897      // See: `isEditedPostSaveable`
6898  
6899      if (!isEditedPostDirty()) {
6900        return;
6901      }
6902  
6903      savePost();
6904    }, {
6905      bindGlobal: true
6906    });
6907    return null;
6908  }
6909  
6910  /* harmony default export */ var save_shortcut = (SaveShortcut);
6911  
6912  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/global-keyboard-shortcuts/visual-editor-shortcuts.js
6913  
6914  
6915  /**
6916   * WordPress dependencies
6917   */
6918  
6919  
6920  
6921  
6922  /**
6923   * Internal dependencies
6924   */
6925  
6926  
6927  
6928  function VisualEditorGlobalKeyboardShortcuts() {
6929    var _useDispatch = Object(external_this_wp_data_["useDispatch"])('core/editor'),
6930        redo = _useDispatch.redo,
6931        undo = _useDispatch.undo,
6932        savePost = _useDispatch.savePost;
6933  
6934    var isEditedPostDirty = Object(external_this_wp_data_["useSelect"])(function (select) {
6935      return select('core/editor').isEditedPostDirty;
6936    }, []);
6937    Object(external_this_wp_keyboardShortcuts_["useShortcut"])('core/editor/undo', function (event) {
6938      undo();
6939      event.preventDefault();
6940    }, {
6941      bindGlobal: true
6942    });
6943    Object(external_this_wp_keyboardShortcuts_["useShortcut"])('core/editor/redo', function (event) {
6944      redo();
6945      event.preventDefault();
6946    }, {
6947      bindGlobal: true
6948    });
6949    Object(external_this_wp_keyboardShortcuts_["useShortcut"])('core/editor/save', function (event) {
6950      event.preventDefault(); // TODO: This should be handled in the `savePost` effect in
6951      // considering `isSaveable`. See note on `isEditedPostSaveable`
6952      // selector about dirtiness and meta-boxes.
6953      //
6954      // See: `isEditedPostSaveable`
6955  
6956      if (!isEditedPostDirty()) {
6957        return;
6958      }
6959  
6960      savePost();
6961    }, {
6962      bindGlobal: true
6963    });
6964    return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["BlockEditorKeyboardShortcuts"], null), Object(external_this_wp_element_["createElement"])(save_shortcut, null));
6965  }
6966  
6967  /* harmony default export */ var visual_editor_shortcuts = (VisualEditorGlobalKeyboardShortcuts);
6968  function EditorGlobalKeyboardShortcuts() {
6969    external_this_wp_deprecated_default()('EditorGlobalKeyboardShortcuts', {
6970      alternative: 'VisualEditorGlobalKeyboardShortcuts',
6971      plugin: 'Gutenberg'
6972    });
6973    return Object(external_this_wp_element_["createElement"])(VisualEditorGlobalKeyboardShortcuts, null);
6974  }
6975  
6976  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/global-keyboard-shortcuts/text-editor-shortcuts.js
6977  
6978  
6979  /**
6980   * Internal dependencies
6981   */
6982  
6983  function TextEditorGlobalKeyboardShortcuts() {
6984    return Object(external_this_wp_element_["createElement"])(save_shortcut, null);
6985  }
6986  
6987  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/global-keyboard-shortcuts/register-shortcuts.js
6988  
6989  
6990  /**
6991   * WordPress dependencies
6992   */
6993  
6994  
6995  
6996  
6997  
6998  function EditorKeyboardShortcutsRegister() {
6999    // Registering the shortcuts
7000    var _useDispatch = Object(external_this_wp_data_["useDispatch"])('core/keyboard-shortcuts'),
7001        registerShortcut = _useDispatch.registerShortcut;
7002  
7003    Object(external_this_wp_element_["useEffect"])(function () {
7004      registerShortcut({
7005        name: 'core/editor/save',
7006        category: 'global',
7007        description: Object(external_this_wp_i18n_["__"])('Save your changes.'),
7008        keyCombination: {
7009          modifier: 'primary',
7010          character: 's'
7011        }
7012      });
7013      registerShortcut({
7014        name: 'core/editor/undo',
7015        category: 'global',
7016        description: Object(external_this_wp_i18n_["__"])('Undo your last changes.'),
7017        keyCombination: {
7018          modifier: 'primary',
7019          character: 'z'
7020        }
7021      });
7022      registerShortcut({
7023        name: 'core/editor/redo',
7024        category: 'global',
7025        description: Object(external_this_wp_i18n_["__"])('Redo your last undo.'),
7026        keyCombination: {
7027          modifier: 'primaryShift',
7028          character: 'z'
7029        }
7030      });
7031    }, [registerShortcut]);
7032    return Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["BlockEditorKeyboardShortcuts"].Register, null);
7033  }
7034  
7035  /* harmony default export */ var register_shortcuts = (EditorKeyboardShortcutsRegister);
7036  
7037  // EXTERNAL MODULE: external {"this":["wp","components"]}
7038  var external_this_wp_components_ = __webpack_require__(3);
7039  
7040  // EXTERNAL MODULE: external {"this":["wp","keycodes"]}
7041  var external_this_wp_keycodes_ = __webpack_require__(22);
7042  
7043  // EXTERNAL MODULE: external {"this":["wp","primitives"]}
7044  var external_this_wp_primitives_ = __webpack_require__(9);
7045  
7046  // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/redo.js
7047  
7048  
7049  /**
7050   * WordPress dependencies
7051   */
7052  
7053  var redo_redo = Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["SVG"], {
7054    xmlns: "http://www.w3.org/2000/svg",
7055    viewBox: "-2 -2 24 24"
7056  }, Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["Path"], {
7057    d: "M8 5h5V2l6 4-6 4V7H8c-2.2 0-4 1.8-4 4s1.8 4 4 4h5v2H8c-3.3 0-6-2.7-6-6s2.7-6 6-6z"
7058  }));
7059  /* harmony default export */ var library_redo = (redo_redo);
7060  
7061  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/editor-history/redo.js
7062  
7063  
7064  /**
7065   * WordPress dependencies
7066   */
7067  
7068  
7069  
7070  
7071  
7072  
7073  
7074  function EditorHistoryRedo(_ref) {
7075    var hasRedo = _ref.hasRedo,
7076        redo = _ref.redo;
7077    return Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Button"], {
7078      icon: library_redo,
7079      label: Object(external_this_wp_i18n_["__"])('Redo'),
7080      shortcut: external_this_wp_keycodes_["displayShortcut"].primaryShift('z') // If there are no redo levels we don't want to actually disable this
7081      // button, because it will remove focus for keyboard users.
7082      // See: https://github.com/WordPress/gutenberg/issues/3486
7083      ,
7084      "aria-disabled": !hasRedo,
7085      onClick: hasRedo ? redo : undefined,
7086      className: "editor-history__redo"
7087    });
7088  }
7089  
7090  /* harmony default export */ var editor_history_redo = (Object(external_this_wp_compose_["compose"])([Object(external_this_wp_data_["withSelect"])(function (select) {
7091    return {
7092      hasRedo: select('core/editor').hasEditorRedo()
7093    };
7094  }), Object(external_this_wp_data_["withDispatch"])(function (dispatch) {
7095    return {
7096      redo: dispatch('core/editor').redo
7097    };
7098  })])(EditorHistoryRedo));
7099  
7100  // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/undo.js
7101  
7102  
7103  /**
7104   * WordPress dependencies
7105   */
7106  
7107  var undo_undo = Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["SVG"], {
7108    xmlns: "http://www.w3.org/2000/svg",
7109    viewBox: "-2 -2 24 24"
7110  }, Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["Path"], {
7111    d: "M12 5H7V2L1 6l6 4V7h5c2.2 0 4 1.8 4 4s-1.8 4-4 4H7v2h5c3.3 0 6-2.7 6-6s-2.7-6-6-6z"
7112  }));
7113  /* harmony default export */ var library_undo = (undo_undo);
7114  
7115  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/editor-history/undo.js
7116  
7117  
7118  /**
7119   * WordPress dependencies
7120   */
7121  
7122  
7123  
7124  
7125  
7126  
7127  
7128  function EditorHistoryUndo(_ref) {
7129    var hasUndo = _ref.hasUndo,
7130        undo = _ref.undo;
7131    return Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Button"], {
7132      icon: library_undo,
7133      label: Object(external_this_wp_i18n_["__"])('Undo'),
7134      shortcut: external_this_wp_keycodes_["displayShortcut"].primary('z') // If there are no undo levels we don't want to actually disable this
7135      // button, because it will remove focus for keyboard users.
7136      // See: https://github.com/WordPress/gutenberg/issues/3486
7137      ,
7138      "aria-disabled": !hasUndo,
7139      onClick: hasUndo ? undo : undefined,
7140      className: "editor-history__undo"
7141    });
7142  }
7143  
7144  /* harmony default export */ var editor_history_undo = (Object(external_this_wp_compose_["compose"])([Object(external_this_wp_data_["withSelect"])(function (select) {
7145    return {
7146      hasUndo: select('core/editor').hasEditorUndo()
7147    };
7148  }), Object(external_this_wp_data_["withDispatch"])(function (dispatch) {
7149    return {
7150      undo: dispatch('core/editor').undo
7151    };
7152  })])(EditorHistoryUndo));
7153  
7154  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/template-validation-notice/index.js
7155  
7156  
7157  
7158  /**
7159   * WordPress dependencies
7160   */
7161  
7162  
7163  
7164  
7165  
7166  function TemplateValidationNotice(_ref) {
7167    var isValid = _ref.isValid,
7168        props = Object(objectWithoutProperties["a" /* default */])(_ref, ["isValid"]);
7169  
7170    if (isValid) {
7171      return null;
7172    }
7173  
7174    var confirmSynchronization = function confirmSynchronization() {
7175      if ( // eslint-disable-next-line no-alert
7176      window.confirm(Object(external_this_wp_i18n_["__"])('Resetting the template may result in loss of content, do you want to continue?'))) {
7177        props.synchronizeTemplate();
7178      }
7179    };
7180  
7181    return Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Notice"], {
7182      className: "editor-template-validation-notice",
7183      isDismissible: false,
7184      status: "warning",
7185      actions: [{
7186        label: Object(external_this_wp_i18n_["__"])('Keep it as is'),
7187        onClick: props.resetTemplateValidity
7188      }, {
7189        label: Object(external_this_wp_i18n_["__"])('Reset the template'),
7190        onClick: confirmSynchronization,
7191        isPrimary: true
7192      }]
7193    }, Object(external_this_wp_i18n_["__"])('The content of your post doesn’t match the template assigned to your post type.'));
7194  }
7195  
7196  /* harmony default export */ var template_validation_notice = (Object(external_this_wp_compose_["compose"])([Object(external_this_wp_data_["withSelect"])(function (select) {
7197    return {
7198      isValid: select('core/block-editor').isValidTemplate()
7199    };
7200  }), Object(external_this_wp_data_["withDispatch"])(function (dispatch) {
7201    var _dispatch = dispatch('core/block-editor'),
7202        setTemplateValidity = _dispatch.setTemplateValidity,
7203        synchronizeTemplate = _dispatch.synchronizeTemplate;
7204  
7205    return {
7206      resetTemplateValidity: function resetTemplateValidity() {
7207        return setTemplateValidity(true);
7208      },
7209      synchronizeTemplate: synchronizeTemplate
7210    };
7211  })])(TemplateValidationNotice));
7212  
7213  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/editor-notices/index.js
7214  
7215  
7216  /**
7217   * External dependencies
7218   */
7219  
7220  /**
7221   * WordPress dependencies
7222   */
7223  
7224  
7225  
7226  
7227  /**
7228   * Internal dependencies
7229   */
7230  
7231  
7232  function EditorNotices(_ref) {
7233    var notices = _ref.notices,
7234        onRemove = _ref.onRemove;
7235    var dismissibleNotices = Object(external_this_lodash_["filter"])(notices, {
7236      isDismissible: true,
7237      type: 'default'
7238    });
7239    var nonDismissibleNotices = Object(external_this_lodash_["filter"])(notices, {
7240      isDismissible: false,
7241      type: 'default'
7242    });
7243    var snackbarNotices = Object(external_this_lodash_["filter"])(notices, {
7244      type: 'snackbar'
7245    });
7246    return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(external_this_wp_components_["NoticeList"], {
7247      notices: nonDismissibleNotices,
7248      className: "components-editor-notices__pinned"
7249    }), Object(external_this_wp_element_["createElement"])(external_this_wp_components_["NoticeList"], {
7250      notices: dismissibleNotices,
7251      className: "components-editor-notices__dismissible",
7252      onRemove: onRemove
7253    }, Object(external_this_wp_element_["createElement"])(template_validation_notice, null)), Object(external_this_wp_element_["createElement"])(external_this_wp_components_["SnackbarList"], {
7254      notices: snackbarNotices,
7255      className: "components-editor-notices__snackbar",
7256      onRemove: onRemove
7257    }));
7258  }
7259  /* harmony default export */ var editor_notices = (Object(external_this_wp_compose_["compose"])([Object(external_this_wp_data_["withSelect"])(function (select) {
7260    return {
7261      notices: select('core/notices').getNotices()
7262    };
7263  }), Object(external_this_wp_data_["withDispatch"])(function (dispatch) {
7264    return {
7265      onRemove: dispatch('core/notices').removeNotice
7266    };
7267  })])(EditorNotices));
7268  
7269  // EXTERNAL MODULE: ./node_modules/equivalent-key-map/equivalent-key-map.js
7270  var equivalent_key_map = __webpack_require__(64);
7271  var equivalent_key_map_default = /*#__PURE__*/__webpack_require__.n(equivalent_key_map);
7272  
7273  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/entities-saved-states/index.js
7274  
7275  
7276  
7277  
7278  /**
7279   * External dependencies
7280   */
7281  
7282  /**
7283   * WordPress dependencies
7284   */
7285  
7286  
7287  
7288  
7289  
7290  
7291  var entities_saved_states_EntitiesSavedStatesCheckbox = function EntitiesSavedStatesCheckbox(_ref) {
7292    var id = _ref.id,
7293        name = _ref.name,
7294        rawRecord = _ref.changes.rawRecord,
7295        checked = _ref.checked,
7296        setCheckedById = _ref.setCheckedById;
7297    return Object(external_this_wp_element_["createElement"])(external_this_wp_components_["CheckboxControl"], {
7298      label: "".concat(name, ": \"").concat(rawRecord.name || rawRecord.slug || rawRecord.title || Object(external_this_wp_i18n_["__"])('Untitled'), "\""),
7299      checked: checked,
7300      onChange: function onChange(nextChecked) {
7301        return setCheckedById(id, nextChecked);
7302      }
7303    });
7304  };
7305  
7306  function EntitiesSavedStates(_ref2) {
7307    var isOpen = _ref2.isOpen,
7308        _onRequestClose = _ref2.onRequestClose,
7309        _ref2$ignoredForSave = _ref2.ignoredForSave,
7310        ignoredForSave = _ref2$ignoredForSave === void 0 ? new equivalent_key_map_default.a() : _ref2$ignoredForSave;
7311    var entityRecordChangesByRecord = Object(external_this_wp_data_["useSelect"])(function (select) {
7312      return select('core').getEntityRecordChangesByRecord();
7313    });
7314  
7315    var _useDispatch = Object(external_this_wp_data_["useDispatch"])('core'),
7316        saveEditedEntityRecord = _useDispatch.saveEditedEntityRecord;
7317  
7318    var _useState = Object(external_this_wp_element_["useState"])(function () {
7319      return new equivalent_key_map_default.a();
7320    }),
7321        _useState2 = Object(slicedToArray["a" /* default */])(_useState, 2),
7322        checkedById = _useState2[0],
7323        _setCheckedById = _useState2[1];
7324  
7325    var setCheckedById = function setCheckedById(id, checked) {
7326      return _setCheckedById(function (prevCheckedById) {
7327        var nextCheckedById = new equivalent_key_map_default.a(prevCheckedById);
7328  
7329        if (checked) {
7330          nextCheckedById.set(id, true);
7331        } else {
7332          nextCheckedById.delete(id);
7333        }
7334  
7335        return nextCheckedById;
7336      });
7337    };
7338  
7339    var saveCheckedEntities = function saveCheckedEntities() {
7340      checkedById.forEach(function (_checked, id) {
7341        if (!ignoredForSave.has(id)) {
7342          saveEditedEntityRecord.apply(void 0, Object(toConsumableArray["a" /* default */])(id.filter(function (s, i) {
7343            return i !== id.length - 1 || s !== 'undefined';
7344          })));
7345        }
7346      });
7347  
7348      _onRequestClose(checkedById);
7349    };
7350  
7351    return isOpen && Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Modal"], {
7352      title: Object(external_this_wp_i18n_["__"])('What do you want to save?'),
7353      onRequestClose: function onRequestClose() {
7354        return _onRequestClose();
7355      },
7356      contentLabel: Object(external_this_wp_i18n_["__"])('Select items to save.')
7357    }, Object.keys(entityRecordChangesByRecord).map(function (changedKind) {
7358      return Object.keys(entityRecordChangesByRecord[changedKind]).map(function (changedName) {
7359        return Object.keys(entityRecordChangesByRecord[changedKind][changedName]).map(function (changedKey) {
7360          var id = [changedKind, changedName, changedKey];
7361          return Object(external_this_wp_element_["createElement"])(entities_saved_states_EntitiesSavedStatesCheckbox, {
7362            key: id.join(' | '),
7363            id: id,
7364            name: changedName,
7365            changes: entityRecordChangesByRecord[changedKind][changedName][changedKey],
7366            checked: checkedById.get(id),
7367            setCheckedById: setCheckedById
7368          });
7369        });
7370      });
7371    }), Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Button"], {
7372      isPrimary: true,
7373      disabled: checkedById.size === 0,
7374      onClick: saveCheckedEntities,
7375      className: "editor-entities-saved-states__save-button"
7376    }, Object(external_this_wp_i18n_["__"])('Save')));
7377  }
7378  
7379  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
7380  var assertThisInitialized = __webpack_require__(7);
7381  
7382  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/error-boundary/index.js
7383  
7384  
7385  
7386  
7387  
7388  
7389  
7390  
7391  /**
7392   * WordPress dependencies
7393   */
7394  
7395  
7396  
7397  
7398  
7399  
7400  var error_boundary_ErrorBoundary =
7401  /*#__PURE__*/
7402  function (_Component) {
7403    Object(inherits["a" /* default */])(ErrorBoundary, _Component);
7404  
7405    function ErrorBoundary() {
7406      var _this;
7407  
7408      Object(classCallCheck["a" /* default */])(this, ErrorBoundary);
7409  
7410      _this = Object(possibleConstructorReturn["a" /* default */])(this, Object(getPrototypeOf["a" /* default */])(ErrorBoundary).apply(this, arguments));
7411      _this.reboot = _this.reboot.bind(Object(assertThisInitialized["a" /* default */])(_this));
7412      _this.getContent = _this.getContent.bind(Object(assertThisInitialized["a" /* default */])(_this));
7413      _this.state = {
7414        error: null
7415      };
7416      return _this;
7417    }
7418  
7419    Object(createClass["a" /* default */])(ErrorBoundary, [{
7420      key: "componentDidCatch",
7421      value: function componentDidCatch(error) {
7422        this.setState({
7423          error: error
7424        });
7425      }
7426    }, {
7427      key: "reboot",
7428      value: function reboot() {
7429        this.props.onError();
7430      }
7431    }, {
7432      key: "getContent",
7433      value: function getContent() {
7434        try {
7435          // While `select` in a component is generally discouraged, it is
7436          // used here because it (a) reduces the chance of data loss in the
7437          // case of additional errors by performing a direct retrieval and
7438          // (b) avoids the performance cost associated with unnecessary
7439          // content serialization throughout the lifetime of a non-erroring
7440          // application.
7441          return Object(external_this_wp_data_["select"])('core/editor').getEditedPostContent();
7442        } catch (error) {}
7443      }
7444    }, {
7445      key: "render",
7446      value: function render() {
7447        var error = this.state.error;
7448  
7449        if (!error) {
7450          return this.props.children;
7451        }
7452  
7453        return Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["Warning"], {
7454          className: "editor-error-boundary",
7455          actions: [Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Button"], {
7456            key: "recovery",
7457            onClick: this.reboot,
7458            isSecondary: true
7459          }, Object(external_this_wp_i18n_["__"])('Attempt Recovery')), Object(external_this_wp_element_["createElement"])(external_this_wp_components_["ClipboardButton"], {
7460            key: "copy-post",
7461            text: this.getContent,
7462            isSecondary: true
7463          }, Object(external_this_wp_i18n_["__"])('Copy Post Text')), Object(external_this_wp_element_["createElement"])(external_this_wp_components_["ClipboardButton"], {
7464            key: "copy-error",
7465            text: error.stack,
7466            isSecondary: true
7467          }, Object(external_this_wp_i18n_["__"])('Copy Error'))]
7468        }, Object(external_this_wp_i18n_["__"])('The editor has encountered an unexpected error.'));
7469      }
7470    }]);
7471  
7472    return ErrorBoundary;
7473  }(external_this_wp_element_["Component"]);
7474  
7475  /* harmony default export */ var error_boundary = (error_boundary_ErrorBoundary);
7476  
7477  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/local-autosave-monitor/index.js
7478  
7479  
7480  /**
7481   * External dependencies
7482   */
7483  
7484  /**
7485   * WordPress dependencies
7486   */
7487  
7488  
7489  
7490  
7491  
7492  
7493  /**
7494   * Internal dependencies
7495   */
7496  
7497  
7498  
7499  var requestIdleCallback = window.requestIdleCallback ? window.requestIdleCallback : window.requestAnimationFrame;
7500  /**
7501   * Function which returns true if the current environment supports browser
7502   * sessionStorage, or false otherwise. The result of this function is cached and
7503   * reused in subsequent invocations.
7504   */
7505  
7506  var hasSessionStorageSupport = Object(external_this_lodash_["once"])(function () {
7507    try {
7508      // Private Browsing in Safari 10 and earlier will throw an error when
7509      // attempting to set into sessionStorage. The test here is intentional in
7510      // causing a thrown error as condition bailing from local autosave.
7511      window.sessionStorage.setItem('__wpEditorTestSessionStorage', '');
7512      window.sessionStorage.removeItem('__wpEditorTestSessionStorage');
7513      return true;
7514    } catch (error) {
7515      return false;
7516    }
7517  });
7518  /**
7519   * Custom hook which manages the creation of a notice prompting the user to
7520   * restore a local autosave, if one exists.
7521   */
7522  
7523  function useAutosaveNotice() {
7524    var _useSelect = Object(external_this_wp_data_["useSelect"])(function (select) {
7525      return {
7526        postId: select('core/editor').getCurrentPostId(),
7527        getEditedPostAttribute: select('core/editor').getEditedPostAttribute,
7528        hasRemoteAutosave: !!select('core/editor').getEditorSettings().autosave
7529      };
7530    }, []),
7531        postId = _useSelect.postId,
7532        getEditedPostAttribute = _useSelect.getEditedPostAttribute,
7533        hasRemoteAutosave = _useSelect.hasRemoteAutosave;
7534  
7535    var _useDispatch = Object(external_this_wp_data_["useDispatch"])('core/notices'),
7536        createWarningNotice = _useDispatch.createWarningNotice,
7537        removeNotice = _useDispatch.removeNotice;
7538  
7539    var _useDispatch2 = Object(external_this_wp_data_["useDispatch"])('core/editor'),
7540        editPost = _useDispatch2.editPost,
7541        resetEditorBlocks = _useDispatch2.resetEditorBlocks;
7542  
7543    Object(external_this_wp_element_["useEffect"])(function () {
7544      var localAutosave = localAutosaveGet(postId);
7545  
7546      if (!localAutosave) {
7547        return;
7548      }
7549  
7550      try {
7551        localAutosave = JSON.parse(localAutosave);
7552      } catch (error) {
7553        // Not usable if it can't be parsed.
7554        return;
7555      }
7556  
7557      var _localAutosave = localAutosave,
7558          title = _localAutosave.post_title,
7559          content = _localAutosave.content,
7560          excerpt = _localAutosave.excerpt;
7561      var edits = {
7562        title: title,
7563        content: content,
7564        excerpt: excerpt
7565      };
7566      {
7567        // Only display a notice if there is a difference between what has been
7568        // saved and that which is stored in sessionStorage.
7569        var hasDifference = Object.keys(edits).some(function (key) {
7570          return edits[key] !== getEditedPostAttribute(key);
7571        });
7572  
7573        if (!hasDifference) {
7574          // If there is no difference, it can be safely ejected from storage.
7575          localAutosaveClear(postId);
7576          return;
7577        }
7578      }
7579  
7580      if (hasRemoteAutosave) {
7581        return;
7582      }
7583  
7584      var noticeId = Object(external_this_lodash_["uniqueId"])('wpEditorAutosaveRestore');
7585      createWarningNotice(Object(external_this_wp_i18n_["__"])('The backup of this post in your browser is different from the version below.'), {
7586        id: noticeId,
7587        actions: [{
7588          label: Object(external_this_wp_i18n_["__"])('Restore the backup'),
7589          onClick: function onClick() {
7590            editPost(Object(external_this_lodash_["omit"])(edits, ['content']));
7591            resetEditorBlocks(Object(external_this_wp_blocks_["parse"])(edits.content));
7592            removeNotice(noticeId);
7593          }
7594        }]
7595      });
7596    }, [postId]);
7597  }
7598  /**
7599   * Custom hook which ejects a local autosave after a successful save occurs.
7600   */
7601  
7602  
7603  function useAutosavePurge() {
7604    var _useSelect2 = Object(external_this_wp_data_["useSelect"])(function (select) {
7605      return {
7606        postId: select('core/editor').getCurrentPostId(),
7607        isDirty: select('core/editor').isEditedPostDirty(),
7608        isAutosaving: select('core/editor').isAutosavingPost(),
7609        didError: select('core/editor').didPostSaveRequestFail()
7610      };
7611    }, []),
7612        postId = _useSelect2.postId,
7613        isDirty = _useSelect2.isDirty,
7614        isAutosaving = _useSelect2.isAutosaving,
7615        didError = _useSelect2.didError;
7616  
7617    var lastIsDirty = Object(external_this_wp_element_["useRef"])(isDirty);
7618    var lastIsAutosaving = Object(external_this_wp_element_["useRef"])(isAutosaving);
7619    Object(external_this_wp_element_["useEffect"])(function () {
7620      if (!didError && (lastIsAutosaving.current && !isAutosaving || lastIsDirty.current && !isDirty)) {
7621        localAutosaveClear(postId);
7622      }
7623  
7624      lastIsDirty.current = isDirty;
7625      lastIsAutosaving.current = isAutosaving;
7626    }, [isDirty, isAutosaving, didError]);
7627  }
7628  
7629  function LocalAutosaveMonitor() {
7630    var _useDispatch3 = Object(external_this_wp_data_["useDispatch"])('core/editor'),
7631        __experimentalLocalAutosave = _useDispatch3.__experimentalLocalAutosave;
7632  
7633    var autosave = Object(external_this_wp_element_["useCallback"])(function () {
7634      requestIdleCallback(__experimentalLocalAutosave);
7635    }, []);
7636    useAutosaveNotice();
7637    useAutosavePurge();
7638  
7639    var _useSelect3 = Object(external_this_wp_data_["useSelect"])(function (select) {
7640      return {
7641        localAutosaveInterval: select('core/editor').getEditorSettings().__experimentalLocalAutosaveInterval
7642      };
7643    }, []),
7644        localAutosaveInterval = _useSelect3.localAutosaveInterval;
7645  
7646    return Object(external_this_wp_element_["createElement"])(autosave_monitor, {
7647      interval: localAutosaveInterval,
7648      autosave: autosave,
7649      shouldThrottle: true
7650    });
7651  }
7652  
7653  /* harmony default export */ var local_autosave_monitor = (Object(external_this_wp_compose_["ifCondition"])(hasSessionStorageSupport)(LocalAutosaveMonitor));
7654  
7655  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/page-attributes/check.js
7656  /**
7657   * External dependencies
7658   */
7659  
7660  /**
7661   * WordPress dependencies
7662   */
7663  
7664  
7665  function PageAttributesCheck(_ref) {
7666    var availableTemplates = _ref.availableTemplates,
7667        postType = _ref.postType,
7668        children = _ref.children;
7669    var supportsPageAttributes = Object(external_this_lodash_["get"])(postType, ['supports', 'page-attributes'], false); // Only render fields if post type supports page attributes or available templates exist.
7670  
7671    if (!supportsPageAttributes && Object(external_this_lodash_["isEmpty"])(availableTemplates)) {
7672      return null;
7673    }
7674  
7675    return children;
7676  }
7677  /* harmony default export */ var page_attributes_check = (Object(external_this_wp_data_["withSelect"])(function (select) {
7678    var _select = select('core/editor'),
7679        getEditedPostAttribute = _select.getEditedPostAttribute,
7680        getEditorSettings = _select.getEditorSettings;
7681  
7682    var _select2 = select('core'),
7683        getPostType = _select2.getPostType;
7684  
7685    var _getEditorSettings = getEditorSettings(),
7686        availableTemplates = _getEditorSettings.availableTemplates;
7687  
7688    return {
7689      postType: getPostType(getEditedPostAttribute('type')),
7690      availableTemplates: availableTemplates
7691    };
7692  })(PageAttributesCheck));
7693  
7694  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-type-support-check/index.js
7695  /**
7696   * External dependencies
7697   */
7698  
7699  /**
7700   * WordPress dependencies
7701   */
7702  
7703  
7704  /**
7705   * A component which renders its own children only if the current editor post
7706   * type supports one of the given `supportKeys` prop.
7707   *
7708   * @param {Object}    props             Props.
7709   * @param {string}    [props.postType]  Current post type.
7710   * @param {WPElement} props.children    Children to be rendered if post
7711   *                                                                   type supports.
7712   * @param {(string|string[])}                      props.supportKeys String or string array of keys
7713   *                                                                   to test.
7714   *
7715   * @return {WPComponent} The component to be rendered.
7716   */
7717  
7718  function PostTypeSupportCheck(_ref) {
7719    var postType = _ref.postType,
7720        children = _ref.children,
7721        supportKeys = _ref.supportKeys;
7722    var isSupported = true;
7723  
7724    if (postType) {
7725      isSupported = Object(external_this_lodash_["some"])(Object(external_this_lodash_["castArray"])(supportKeys), function (key) {
7726        return !!postType.supports[key];
7727      });
7728    }
7729  
7730    if (!isSupported) {
7731      return null;
7732    }
7733  
7734    return children;
7735  }
7736  /* harmony default export */ var post_type_support_check = (Object(external_this_wp_data_["withSelect"])(function (select) {
7737    var _select = select('core/editor'),
7738        getEditedPostAttribute = _select.getEditedPostAttribute;
7739  
7740    var _select2 = select('core'),
7741        getPostType = _select2.getPostType;
7742  
7743    return {
7744      postType: getPostType(getEditedPostAttribute('type'))
7745    };
7746  })(PostTypeSupportCheck));
7747  
7748  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/page-attributes/order.js
7749  
7750  
7751  /**
7752   * External dependencies
7753   */
7754  
7755  /**
7756   * WordPress dependencies
7757   */
7758  
7759  
7760  
7761  
7762  
7763  /**
7764   * Internal dependencies
7765   */
7766  
7767  
7768  var PageAttributesOrder = Object(external_this_wp_compose_["withState"])({
7769    orderInput: null
7770  })(function (_ref) {
7771    var onUpdateOrder = _ref.onUpdateOrder,
7772        _ref$order = _ref.order,
7773        order = _ref$order === void 0 ? 0 : _ref$order,
7774        orderInput = _ref.orderInput,
7775        setState = _ref.setState;
7776  
7777    var setUpdatedOrder = function setUpdatedOrder(value) {
7778      setState({
7779        orderInput: value
7780      });
7781      var newOrder = Number(value);
7782  
7783      if (Number.isInteger(newOrder) && Object(external_this_lodash_["invoke"])(value, ['trim']) !== '') {
7784        onUpdateOrder(Number(value));
7785      }
7786    };
7787  
7788    var value = orderInput === null ? order : orderInput;
7789    return Object(external_this_wp_element_["createElement"])(external_this_wp_components_["TextControl"], {
7790      className: "editor-page-attributes__order",
7791      type: "number",
7792      label: Object(external_this_wp_i18n_["__"])('Order'),
7793      value: value,
7794      onChange: setUpdatedOrder,
7795      size: 6,
7796      onBlur: function onBlur() {
7797        setState({
7798          orderInput: null
7799        });
7800      }
7801    });
7802  });
7803  
7804  function PageAttributesOrderWithChecks(props) {
7805    return Object(external_this_wp_element_["createElement"])(post_type_support_check, {
7806      supportKeys: "page-attributes"
7807    }, Object(external_this_wp_element_["createElement"])(PageAttributesOrder, props));
7808  }
7809  
7810  /* harmony default export */ var page_attributes_order = (Object(external_this_wp_compose_["compose"])([Object(external_this_wp_data_["withSelect"])(function (select) {
7811    return {
7812      order: select('core/editor').getEditedPostAttribute('menu_order')
7813    };
7814  }), Object(external_this_wp_data_["withDispatch"])(function (dispatch) {
7815    return {
7816      onUpdateOrder: function onUpdateOrder(order) {
7817        dispatch('core/editor').editPost({
7818          menu_order: order
7819        });
7820      }
7821    };
7822  })])(PageAttributesOrderWithChecks));
7823  
7824  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/utils/terms.js
7825  
7826  
7827  function terms_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; }
7828  
7829  function terms_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { terms_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 { terms_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
7830  
7831  /**
7832   * External dependencies
7833   */
7834  
7835  /**
7836   * Returns terms in a tree form.
7837   *
7838   * @param {Array} flatTerms  Array of terms in flat format.
7839   *
7840   * @return {Array} Array of terms in tree format.
7841   */
7842  
7843  function buildTermsTree(flatTerms) {
7844    var flatTermsWithParentAndChildren = flatTerms.map(function (term) {
7845      return terms_objectSpread({
7846        children: [],
7847        parent: null
7848      }, term);
7849    });
7850    var termsByParent = Object(external_this_lodash_["groupBy"])(flatTermsWithParentAndChildren, 'parent');
7851  
7852    if (termsByParent.null && termsByParent.null.length) {
7853      return flatTermsWithParentAndChildren;
7854    }
7855  
7856    var fillWithChildren = function fillWithChildren(terms) {
7857      return terms.map(function (term) {
7858        var children = termsByParent[term.id];
7859        return terms_objectSpread({}, term, {
7860          children: children && children.length ? fillWithChildren(children) : []
7861        });
7862      });
7863    };
7864  
7865    return fillWithChildren(termsByParent['0'] || []);
7866  }
7867  
7868  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/page-attributes/parent.js
7869  
7870  
7871  /**
7872   * External dependencies
7873   */
7874  
7875  /**
7876   * WordPress dependencies
7877   */
7878  
7879  
7880  
7881  
7882  
7883  /**
7884   * Internal dependencies
7885   */
7886  
7887  
7888  function PageAttributesParent(_ref) {
7889    var parent = _ref.parent,
7890        postType = _ref.postType,
7891        items = _ref.items,
7892        onUpdateParent = _ref.onUpdateParent;
7893    var isHierarchical = Object(external_this_lodash_["get"])(postType, ['hierarchical'], false);
7894    var parentPageLabel = Object(external_this_lodash_["get"])(postType, ['labels', 'parent_item_colon']);
7895    var pageItems = items || [];
7896  
7897    if (!isHierarchical || !parentPageLabel || !pageItems.length) {
7898      return null;
7899    }
7900  
7901    var pagesTree = buildTermsTree(pageItems.map(function (item) {
7902      return {
7903        id: item.id,
7904        parent: item.parent,
7905        name: item.title && item.title.raw ? item.title.raw : "#".concat(item.id, " (").concat(Object(external_this_wp_i18n_["__"])('no title'), ")")
7906      };
7907    }));
7908    return Object(external_this_wp_element_["createElement"])(external_this_wp_components_["TreeSelect"], {
7909      className: "editor-page-attributes__parent",
7910      label: parentPageLabel,
7911      noOptionLabel: "(".concat(Object(external_this_wp_i18n_["__"])('no parent'), ")"),
7912      tree: pagesTree,
7913      selectedId: parent,
7914      onChange: onUpdateParent
7915    });
7916  }
7917  var applyWithSelect = Object(external_this_wp_data_["withSelect"])(function (select) {
7918    var _select = select('core'),
7919        getPostType = _select.getPostType,
7920        getEntityRecords = _select.getEntityRecords;
7921  
7922    var _select2 = select('core/editor'),
7923        getCurrentPostId = _select2.getCurrentPostId,
7924        getEditedPostAttribute = _select2.getEditedPostAttribute;
7925  
7926    var postTypeSlug = getEditedPostAttribute('type');
7927    var postType = getPostType(postTypeSlug);
7928    var postId = getCurrentPostId();
7929    var isHierarchical = Object(external_this_lodash_["get"])(postType, ['hierarchical'], false);
7930    var query = {
7931      per_page: -1,
7932      exclude: postId,
7933      parent_exclude: postId,
7934      orderby: 'menu_order',
7935      order: 'asc'
7936    };
7937    return {
7938      parent: getEditedPostAttribute('parent'),
7939      items: isHierarchical ? getEntityRecords('postType', postTypeSlug, query) : [],
7940      postType: postType
7941    };
7942  });
7943  var applyWithDispatch = Object(external_this_wp_data_["withDispatch"])(function (dispatch) {
7944    var _dispatch = dispatch('core/editor'),
7945        editPost = _dispatch.editPost;
7946  
7947    return {
7948      onUpdateParent: function onUpdateParent(parent) {
7949        editPost({
7950          parent: parent || 0
7951        });
7952      }
7953    };
7954  });
7955  /* harmony default export */ var page_attributes_parent = (Object(external_this_wp_compose_["compose"])([applyWithSelect, applyWithDispatch])(PageAttributesParent));
7956  
7957  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/page-attributes/template.js
7958  
7959  
7960  /**
7961   * External dependencies
7962   */
7963  
7964  /**
7965   * WordPress dependencies
7966   */
7967  
7968  
7969  
7970  
7971  
7972  function PageTemplate(_ref) {
7973    var availableTemplates = _ref.availableTemplates,
7974        selectedTemplate = _ref.selectedTemplate,
7975        onUpdate = _ref.onUpdate;
7976  
7977    if (Object(external_this_lodash_["isEmpty"])(availableTemplates)) {
7978      return null;
7979    }
7980  
7981    return Object(external_this_wp_element_["createElement"])(external_this_wp_components_["SelectControl"], {
7982      label: Object(external_this_wp_i18n_["__"])('Template:'),
7983      value: selectedTemplate,
7984      onChange: onUpdate,
7985      className: "editor-page-attributes__template",
7986      options: Object(external_this_lodash_["map"])(availableTemplates, function (templateName, templateSlug) {
7987        return {
7988          value: templateSlug,
7989          label: templateName
7990        };
7991      })
7992    });
7993  }
7994  /* harmony default export */ var page_attributes_template = (Object(external_this_wp_compose_["compose"])(Object(external_this_wp_data_["withSelect"])(function (select) {
7995    var _select = select('core/editor'),
7996        getEditedPostAttribute = _select.getEditedPostAttribute,
7997        getEditorSettings = _select.getEditorSettings;
7998  
7999    var _getEditorSettings = getEditorSettings(),
8000        availableTemplates = _getEditorSettings.availableTemplates;
8001  
8002    return {
8003      selectedTemplate: getEditedPostAttribute('template'),
8004      availableTemplates: availableTemplates
8005    };
8006  }), Object(external_this_wp_data_["withDispatch"])(function (dispatch) {
8007    return {
8008      onUpdate: function onUpdate(templateSlug) {
8009        dispatch('core/editor').editPost({
8010          template: templateSlug || ''
8011        });
8012      }
8013    };
8014  }))(PageTemplate));
8015  
8016  // EXTERNAL MODULE: external {"this":["wp","htmlEntities"]}
8017  var external_this_wp_htmlEntities_ = __webpack_require__(58);
8018  
8019  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-author/check.js
8020  
8021  
8022  /**
8023   * External dependencies
8024   */
8025  
8026  /**
8027   * WordPress dependencies
8028   */
8029  
8030  
8031  
8032  /**
8033   * Internal dependencies
8034   */
8035  
8036  
8037  function PostAuthorCheck(_ref) {
8038    var hasAssignAuthorAction = _ref.hasAssignAuthorAction,
8039        authors = _ref.authors,
8040        children = _ref.children;
8041  
8042    if (!hasAssignAuthorAction || authors.length < 2) {
8043      return null;
8044    }
8045  
8046    return Object(external_this_wp_element_["createElement"])(post_type_support_check, {
8047      supportKeys: "author"
8048    }, children);
8049  }
8050  /* harmony default export */ var post_author_check = (Object(external_this_wp_compose_["compose"])([Object(external_this_wp_data_["withSelect"])(function (select) {
8051    var post = select('core/editor').getCurrentPost();
8052    return {
8053      hasAssignAuthorAction: Object(external_this_lodash_["get"])(post, ['_links', 'wp:action-assign-author'], false),
8054      postType: select('core/editor').getCurrentPostType(),
8055      authors: select('core').getAuthors()
8056    };
8057  }), external_this_wp_compose_["withInstanceId"]])(PostAuthorCheck));
8058  
8059  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-author/index.js
8060  
8061  
8062  
8063  
8064  
8065  
8066  
8067  
8068  /**
8069   * WordPress dependencies
8070   */
8071  
8072  
8073  
8074  
8075  
8076  /**
8077   * Internal dependencies
8078   */
8079  
8080  
8081  var post_author_PostAuthor =
8082  /*#__PURE__*/
8083  function (_Component) {
8084    Object(inherits["a" /* default */])(PostAuthor, _Component);
8085  
8086    function PostAuthor() {
8087      var _this;
8088  
8089      Object(classCallCheck["a" /* default */])(this, PostAuthor);
8090  
8091      _this = Object(possibleConstructorReturn["a" /* default */])(this, Object(getPrototypeOf["a" /* default */])(PostAuthor).apply(this, arguments));
8092      _this.setAuthorId = _this.setAuthorId.bind(Object(assertThisInitialized["a" /* default */])(_this));
8093      return _this;
8094    }
8095  
8096    Object(createClass["a" /* default */])(PostAuthor, [{
8097      key: "setAuthorId",
8098      value: function setAuthorId(event) {
8099        var onUpdateAuthor = this.props.onUpdateAuthor;
8100        var value = event.target.value;
8101        onUpdateAuthor(Number(value));
8102      }
8103    }, {
8104      key: "render",
8105      value: function render() {
8106        var _this$props = this.props,
8107            postAuthor = _this$props.postAuthor,
8108            instanceId = _this$props.instanceId,
8109            authors = _this$props.authors;
8110        var selectId = 'post-author-selector-' + instanceId; // Disable reason: A select with an onchange throws a warning
8111  
8112        /* eslint-disable jsx-a11y/no-onchange */
8113  
8114        return Object(external_this_wp_element_["createElement"])(post_author_check, null, Object(external_this_wp_element_["createElement"])("label", {
8115          htmlFor: selectId
8116        }, Object(external_this_wp_i18n_["__"])('Author')), Object(external_this_wp_element_["createElement"])("select", {
8117          id: selectId,
8118          value: postAuthor,
8119          onChange: this.setAuthorId,
8120          className: "editor-post-author__select"
8121        }, authors.map(function (author) {
8122          return Object(external_this_wp_element_["createElement"])("option", {
8123            key: author.id,
8124            value: author.id
8125          }, Object(external_this_wp_htmlEntities_["decodeEntities"])(author.name));
8126        })));
8127        /* eslint-enable jsx-a11y/no-onchange */
8128      }
8129    }]);
8130  
8131    return PostAuthor;
8132  }(external_this_wp_element_["Component"]);
8133  /* harmony default export */ var post_author = (Object(external_this_wp_compose_["compose"])([Object(external_this_wp_data_["withSelect"])(function (select) {
8134    return {
8135      postAuthor: select('core/editor').getEditedPostAttribute('author'),
8136      authors: select('core').getAuthors()
8137    };
8138  }), Object(external_this_wp_data_["withDispatch"])(function (dispatch) {
8139    return {
8140      onUpdateAuthor: function onUpdateAuthor(author) {
8141        dispatch('core/editor').editPost({
8142          author: author
8143        });
8144      }
8145    };
8146  }), external_this_wp_compose_["withInstanceId"]])(post_author_PostAuthor));
8147  
8148  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-comments/index.js
8149  
8150  
8151  
8152  /**
8153   * WordPress dependencies
8154   */
8155  
8156  
8157  
8158  
8159  
8160  function PostComments(_ref) {
8161    var _ref$commentStatus = _ref.commentStatus,
8162        commentStatus = _ref$commentStatus === void 0 ? 'open' : _ref$commentStatus,
8163        props = Object(objectWithoutProperties["a" /* default */])(_ref, ["commentStatus"]);
8164  
8165    var onToggleComments = function onToggleComments() {
8166      return props.editPost({
8167        comment_status: commentStatus === 'open' ? 'closed' : 'open'
8168      });
8169    };
8170  
8171    return Object(external_this_wp_element_["createElement"])(external_this_wp_components_["CheckboxControl"], {
8172      label: Object(external_this_wp_i18n_["__"])('Allow comments'),
8173      checked: commentStatus === 'open',
8174      onChange: onToggleComments
8175    });
8176  }
8177  
8178  /* harmony default export */ var post_comments = (Object(external_this_wp_compose_["compose"])([Object(external_this_wp_data_["withSelect"])(function (select) {
8179    return {
8180      commentStatus: select('core/editor').getEditedPostAttribute('comment_status')
8181    };
8182  }), Object(external_this_wp_data_["withDispatch"])(function (dispatch) {
8183    return {
8184      editPost: dispatch('core/editor').editPost
8185    };
8186  })])(PostComments));
8187