[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/js/dist/ -> block-directory.js (source)

   1  this["wp"] = this["wp"] || {}; this["wp"]["blockDirectory"] =
   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 = 441);
  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  /***/ 12:
 105  /***/ (function(module, exports) {
 106  
 107  (function() { module.exports = this["wp"]["blocks"]; }());
 108  
 109  /***/ }),
 110  
 111  /***/ 130:
 112  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 113  
 114  "use strict";
 115  /* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5);
 116  /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14);
 117  /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(0);
 118  /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
 119  
 120  
 121  
 122  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; }
 123  
 124  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; }
 125  
 126  /**
 127   * WordPress dependencies
 128   */
 129   // Disable reason: JSDoc linter doesn't seem to parse the union (`&`) correctly.
 130  
 131  /* eslint-disable jsdoc/valid-types */
 132  
 133  /** @typedef {{icon: JSX.Element, size?: number} & import('react').ComponentPropsWithoutRef<'SVG'>} IconProps */
 134  
 135  /* eslint-enable jsdoc/valid-types */
 136  
 137  /**
 138   * Return an SVG icon.
 139   *
 140   * @param {IconProps} props icon is the SVG component to render
 141   *                          size is a number specifiying the icon size in pixels
 142   *                          Other props will be passed to wrapped SVG component
 143   *
 144   * @return {JSX.Element}  Icon component
 145   */
 146  
 147  function Icon(_ref) {
 148    var icon = _ref.icon,
 149        _ref$size = _ref.size,
 150        size = _ref$size === void 0 ? 24 : _ref$size,
 151        props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(_ref, ["icon", "size"]);
 152  
 153    return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["cloneElement"])(icon, _objectSpread({
 154      width: size,
 155      height: size
 156    }, props));
 157  }
 158  
 159  /* harmony default export */ __webpack_exports__["a"] = (Icon);
 160  
 161  
 162  /***/ }),
 163  
 164  /***/ 14:
 165  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 166  
 167  "use strict";
 168  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectWithoutProperties; });
 169  /* harmony import */ var _objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(42);
 170  
 171  function _objectWithoutProperties(source, excluded) {
 172    if (source == null) return {};
 173    var target = Object(_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(source, excluded);
 174    var key, i;
 175  
 176    if (Object.getOwnPropertySymbols) {
 177      var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
 178  
 179      for (i = 0; i < sourceSymbolKeys.length; i++) {
 180        key = sourceSymbolKeys[i];
 181        if (excluded.indexOf(key) >= 0) continue;
 182        if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
 183        target[key] = source[key];
 184      }
 185    }
 186  
 187    return target;
 188  }
 189  
 190  /***/ }),
 191  
 192  /***/ 15:
 193  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 194  
 195  "use strict";
 196  
 197  // EXPORTS
 198  __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _slicedToArray; });
 199  
 200  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
 201  var arrayWithHoles = __webpack_require__(38);
 202  
 203  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
 204  function _iterableToArrayLimit(arr, i) {
 205    if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
 206    var _arr = [];
 207    var _n = true;
 208    var _d = false;
 209    var _e = undefined;
 210  
 211    try {
 212      for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
 213        _arr.push(_s.value);
 214  
 215        if (i && _arr.length === i) break;
 216      }
 217    } catch (err) {
 218      _d = true;
 219      _e = err;
 220    } finally {
 221      try {
 222        if (!_n && _i["return"] != null) _i["return"]();
 223      } finally {
 224        if (_d) throw _e;
 225      }
 226    }
 227  
 228    return _arr;
 229  }
 230  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
 231  var unsupportedIterableToArray = __webpack_require__(28);
 232  
 233  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
 234  var nonIterableRest = __webpack_require__(39);
 235  
 236  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js
 237  
 238  
 239  
 240  
 241  function _slicedToArray(arr, i) {
 242    return Object(arrayWithHoles["a" /* default */])(arr) || _iterableToArrayLimit(arr, i) || Object(unsupportedIterableToArray["a" /* default */])(arr, i) || Object(nonIterableRest["a" /* default */])();
 243  }
 244  
 245  /***/ }),
 246  
 247  /***/ 16:
 248  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 249  
 250  "use strict";
 251  
 252  // EXPORTS
 253  __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _toConsumableArray; });
 254  
 255  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
 256  var arrayLikeToArray = __webpack_require__(26);
 257  
 258  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
 259  
 260  function _arrayWithoutHoles(arr) {
 261    if (Array.isArray(arr)) return Object(arrayLikeToArray["a" /* default */])(arr);
 262  }
 263  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
 264  var iterableToArray = __webpack_require__(35);
 265  
 266  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
 267  var unsupportedIterableToArray = __webpack_require__(28);
 268  
 269  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
 270  function _nonIterableSpread() {
 271    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
 272  }
 273  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
 274  
 275  
 276  
 277  
 278  function _toConsumableArray(arr) {
 279    return _arrayWithoutHoles(arr) || Object(iterableToArray["a" /* default */])(arr) || Object(unsupportedIterableToArray["a" /* default */])(arr) || _nonIterableSpread();
 280  }
 281  
 282  /***/ }),
 283  
 284  /***/ 2:
 285  /***/ (function(module, exports) {
 286  
 287  (function() { module.exports = this["lodash"]; }());
 288  
 289  /***/ }),
 290  
 291  /***/ 23:
 292  /***/ (function(module, exports) {
 293  
 294  (function() { module.exports = this["regeneratorRuntime"]; }());
 295  
 296  /***/ }),
 297  
 298  /***/ 255:
 299  /***/ (function(module, exports) {
 300  
 301  (function() { module.exports = this["wp"]["editPost"]; }());
 302  
 303  /***/ }),
 304  
 305  /***/ 26:
 306  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 307  
 308  "use strict";
 309  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayLikeToArray; });
 310  function _arrayLikeToArray(arr, len) {
 311    if (len == null || len > arr.length) len = arr.length;
 312  
 313    for (var i = 0, arr2 = new Array(len); i < len; i++) {
 314      arr2[i] = arr[i];
 315    }
 316  
 317    return arr2;
 318  }
 319  
 320  /***/ }),
 321  
 322  /***/ 28:
 323  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 324  
 325  "use strict";
 326  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _unsupportedIterableToArray; });
 327  /* harmony import */ var _arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26);
 328  
 329  function _unsupportedIterableToArray(o, minLen) {
 330    if (!o) return;
 331    if (typeof o === "string") return Object(_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen);
 332    var n = Object.prototype.toString.call(o).slice(8, -1);
 333    if (n === "Object" && o.constructor) n = o.constructor.name;
 334    if (n === "Map" || n === "Set") return Array.from(o);
 335    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Object(_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen);
 336  }
 337  
 338  /***/ }),
 339  
 340  /***/ 281:
 341  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 342  
 343  "use strict";
 344  /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
 345  /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
 346  /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6);
 347  /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
 348  
 349  
 350  /**
 351   * WordPress dependencies
 352   */
 353  
 354  var starFilled = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
 355    xmlns: "http://www.w3.org/2000/svg",
 356    viewBox: "0 0 24 24"
 357  }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], {
 358    d: "M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z"
 359  }));
 360  /* harmony default export */ __webpack_exports__["a"] = (starFilled);
 361  
 362  
 363  /***/ }),
 364  
 365  /***/ 282:
 366  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 367  
 368  "use strict";
 369  /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
 370  /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
 371  /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6);
 372  /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
 373  
 374  
 375  /**
 376   * WordPress dependencies
 377   */
 378  
 379  var starEmpty = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
 380    xmlns: "http://www.w3.org/2000/svg",
 381    viewBox: "0 0 24 24"
 382  }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], {
 383    fillRule: "evenodd",
 384    d: "M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z",
 385    clipRule: "evenodd"
 386  }));
 387  /* harmony default export */ __webpack_exports__["a"] = (starEmpty);
 388  
 389  
 390  /***/ }),
 391  
 392  /***/ 3:
 393  /***/ (function(module, exports) {
 394  
 395  (function() { module.exports = this["wp"]["components"]; }());
 396  
 397  /***/ }),
 398  
 399  /***/ 35:
 400  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 401  
 402  "use strict";
 403  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _iterableToArray; });
 404  function _iterableToArray(iter) {
 405    if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
 406  }
 407  
 408  /***/ }),
 409  
 410  /***/ 36:
 411  /***/ (function(module, exports) {
 412  
 413  (function() { module.exports = this["wp"]["dataControls"]; }());
 414  
 415  /***/ }),
 416  
 417  /***/ 38:
 418  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 419  
 420  "use strict";
 421  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayWithHoles; });
 422  function _arrayWithHoles(arr) {
 423    if (Array.isArray(arr)) return arr;
 424  }
 425  
 426  /***/ }),
 427  
 428  /***/ 39:
 429  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 430  
 431  "use strict";
 432  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _nonIterableRest; });
 433  function _nonIterableRest() {
 434    throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
 435  }
 436  
 437  /***/ }),
 438  
 439  /***/ 4:
 440  /***/ (function(module, exports) {
 441  
 442  (function() { module.exports = this["wp"]["data"]; }());
 443  
 444  /***/ }),
 445  
 446  /***/ 42:
 447  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 448  
 449  "use strict";
 450  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectWithoutPropertiesLoose; });
 451  function _objectWithoutPropertiesLoose(source, excluded) {
 452    if (source == null) return {};
 453    var target = {};
 454    var sourceKeys = Object.keys(source);
 455    var key, i;
 456  
 457    for (i = 0; i < sourceKeys.length; i++) {
 458      key = sourceKeys[i];
 459      if (excluded.indexOf(key) >= 0) continue;
 460      target[key] = source[key];
 461    }
 462  
 463    return target;
 464  }
 465  
 466  /***/ }),
 467  
 468  /***/ 441:
 469  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 470  
 471  "use strict";
 472  // ESM COMPAT FLAG
 473  __webpack_require__.r(__webpack_exports__);
 474  
 475  // NAMESPACE OBJECT: ./node_modules/@wordpress/block-directory/build-module/store/selectors.js
 476  var selectors_namespaceObject = {};
 477  __webpack_require__.r(selectors_namespaceObject);
 478  __webpack_require__.d(selectors_namespaceObject, "isRequestingDownloadableBlocks", function() { return isRequestingDownloadableBlocks; });
 479  __webpack_require__.d(selectors_namespaceObject, "getDownloadableBlocks", function() { return selectors_getDownloadableBlocks; });
 480  __webpack_require__.d(selectors_namespaceObject, "hasInstallBlocksPermission", function() { return selectors_hasInstallBlocksPermission; });
 481  __webpack_require__.d(selectors_namespaceObject, "getInstalledBlockTypes", function() { return getInstalledBlockTypes; });
 482  __webpack_require__.d(selectors_namespaceObject, "getNewBlockTypes", function() { return getNewBlockTypes; });
 483  __webpack_require__.d(selectors_namespaceObject, "getUnusedBlockTypes", function() { return getUnusedBlockTypes; });
 484  __webpack_require__.d(selectors_namespaceObject, "isInstalling", function() { return isInstalling; });
 485  __webpack_require__.d(selectors_namespaceObject, "getErrorNotices", function() { return getErrorNotices; });
 486  __webpack_require__.d(selectors_namespaceObject, "getErrorNoticeForBlock", function() { return getErrorNoticeForBlock; });
 487  
 488  // NAMESPACE OBJECT: ./node_modules/@wordpress/block-directory/build-module/store/actions.js
 489  var actions_namespaceObject = {};
 490  __webpack_require__.r(actions_namespaceObject);
 491  __webpack_require__.d(actions_namespaceObject, "fetchDownloadableBlocks", function() { return fetchDownloadableBlocks; });
 492  __webpack_require__.d(actions_namespaceObject, "receiveDownloadableBlocks", function() { return receiveDownloadableBlocks; });
 493  __webpack_require__.d(actions_namespaceObject, "setInstallBlocksPermission", function() { return setInstallBlocksPermission; });
 494  __webpack_require__.d(actions_namespaceObject, "installBlockType", function() { return actions_installBlockType; });
 495  __webpack_require__.d(actions_namespaceObject, "uninstallBlockType", function() { return actions_uninstallBlockType; });
 496  __webpack_require__.d(actions_namespaceObject, "addInstalledBlockType", function() { return addInstalledBlockType; });
 497  __webpack_require__.d(actions_namespaceObject, "removeInstalledBlockType", function() { return removeInstalledBlockType; });
 498  __webpack_require__.d(actions_namespaceObject, "setIsInstalling", function() { return setIsInstalling; });
 499  __webpack_require__.d(actions_namespaceObject, "setErrorNotice", function() { return setErrorNotice; });
 500  __webpack_require__.d(actions_namespaceObject, "clearErrorNotice", function() { return clearErrorNotice; });
 501  
 502  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
 503  var defineProperty = __webpack_require__(5);
 504  
 505  // EXTERNAL MODULE: external {"this":["wp","data"]}
 506  var external_this_wp_data_ = __webpack_require__(4);
 507  
 508  // EXTERNAL MODULE: external {"this":["wp","dataControls"]}
 509  var external_this_wp_dataControls_ = __webpack_require__(36);
 510  
 511  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
 512  var toConsumableArray = __webpack_require__(16);
 513  
 514  // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/reducer.js
 515  
 516  
 517  
 518  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; }
 519  
 520  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; }
 521  
 522  /**
 523   * WordPress dependencies
 524   */
 525  
 526  /**
 527   * Reducer returning an array of downloadable blocks.
 528   *
 529   * @param {Object} state  Current state.
 530   * @param {Object} action Dispatched action.
 531   *
 532   * @return {Object} Updated state.
 533   */
 534  
 535  var reducer_downloadableBlocks = function downloadableBlocks() {
 536    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
 537    var action = arguments.length > 1 ? arguments[1] : undefined;
 538  
 539    switch (action.type) {
 540      case 'FETCH_DOWNLOADABLE_BLOCKS':
 541        return _objectSpread({}, state, Object(defineProperty["a" /* default */])({}, action.filterValue, {
 542          isRequesting: true
 543        }));
 544  
 545      case 'RECEIVE_DOWNLOADABLE_BLOCKS':
 546        return _objectSpread({}, state, Object(defineProperty["a" /* default */])({}, action.filterValue, {
 547          results: action.downloadableBlocks,
 548          isRequesting: false
 549        }));
 550    }
 551  
 552    return state;
 553  };
 554  /**
 555   * Reducer managing the installation and deletion of blocks.
 556   *
 557   * @param {Object} state  Current state.
 558   * @param {Object} action Dispatched action.
 559   *
 560   * @return {Object} Updated state.
 561   */
 562  
 563  var reducer_blockManagement = function blockManagement() {
 564    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
 565      installedBlockTypes: [],
 566      isInstalling: {}
 567    };
 568    var action = arguments.length > 1 ? arguments[1] : undefined;
 569  
 570    switch (action.type) {
 571      case 'ADD_INSTALLED_BLOCK_TYPE':
 572        return _objectSpread({}, state, {
 573          installedBlockTypes: [].concat(Object(toConsumableArray["a" /* default */])(state.installedBlockTypes), [action.item])
 574        });
 575  
 576      case 'REMOVE_INSTALLED_BLOCK_TYPE':
 577        return _objectSpread({}, state, {
 578          installedBlockTypes: state.installedBlockTypes.filter(function (blockType) {
 579            return blockType.name !== action.item.name;
 580          })
 581        });
 582  
 583      case 'SET_INSTALLING_BLOCK':
 584        return _objectSpread({}, state, {
 585          isInstalling: _objectSpread({}, state.isInstalling, Object(defineProperty["a" /* default */])({}, action.blockId, action.isInstalling))
 586        });
 587    }
 588  
 589    return state;
 590  };
 591  /**
 592   * Reducer returning an array of downloadable blocks.
 593   *
 594   * @param {Object} state  Current state.
 595   * @param {Object} action Dispatched action.
 596   *
 597   * @return {Object} Updated state.
 598   */
 599  
 600  function reducer_hasPermission() {
 601    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
 602    var action = arguments.length > 1 ? arguments[1] : undefined;
 603  
 604    if (action.type === 'SET_INSTALL_BLOCKS_PERMISSION') {
 605      return action.hasPermission;
 606    }
 607  
 608    return state;
 609  }
 610  /**
 611   * Reducer returning an object of error notices.
 612   *
 613   * @param {Object} state  Current state.
 614   * @param {Object} action Dispatched action.
 615   *
 616   * @return {Object} Updated state.
 617   */
 618  
 619  var reducer_errorNotices = function errorNotices() {
 620    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
 621    var action = arguments.length > 1 ? arguments[1] : undefined;
 622  
 623    switch (action.type) {
 624      case 'SET_ERROR_NOTICE':
 625        return _objectSpread({}, state, Object(defineProperty["a" /* default */])({}, action.blockId, action.notice));
 626    }
 627  
 628    return state;
 629  };
 630  /* harmony default export */ var reducer = (Object(external_this_wp_data_["combineReducers"])({
 631    downloadableBlocks: reducer_downloadableBlocks,
 632    blockManagement: reducer_blockManagement,
 633    hasPermission: reducer_hasPermission,
 634    errorNotices: reducer_errorNotices
 635  }));
 636  
 637  // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/utils/has-block-type.js
 638  /**
 639   * Check if a block list contains a specific block type. Recursively searches
 640   * through `innerBlocks` if they exist.
 641   *
 642   * @param {Object} blockType A block object to search for.
 643   * @param {Object[]} blocks  The list of blocks to look through.
 644   *
 645   * @return {boolean} Whether the blockType is found.
 646   */
 647  function hasBlockType(blockType) {
 648    var blocks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
 649  
 650    if (!blocks.length) {
 651      return false;
 652    }
 653  
 654    if (blocks.some(function (_ref) {
 655      var name = _ref.name;
 656      return name === blockType.name;
 657    })) {
 658      return true;
 659    }
 660  
 661    for (var i = 0; i < blocks.length; i++) {
 662      if (hasBlockType(blockType, blocks[i].innerBlocks)) {
 663        return true;
 664      }
 665    }
 666  
 667    return false;
 668  }
 669  
 670  // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/selectors.js
 671  /**
 672   * WordPress dependencies
 673   */
 674  
 675  /**
 676   * Internal dependencies
 677   */
 678  
 679  
 680  /**
 681   * Returns true if application is requesting for downloadable blocks.
 682   *
 683   * @param {Object} state Global application state.
 684   * @param {string} filterValue Search string.
 685   *
 686   *
 687   * @return {Array} Downloadable blocks
 688   */
 689  
 690  function isRequestingDownloadableBlocks(state, filterValue) {
 691    if (!state.downloadableBlocks[filterValue] || !state.downloadableBlocks[filterValue].isRequesting) {
 692      return false;
 693    }
 694  
 695    return state.downloadableBlocks[filterValue].isRequesting;
 696  }
 697  /**
 698   * Returns the available uninstalled blocks
 699   *
 700   * @param {Object} state       Global application state.
 701   * @param {string} filterValue Search string.
 702   *
 703   * @return {Array} Downloadable blocks
 704   */
 705  
 706  function selectors_getDownloadableBlocks(state, filterValue) {
 707    if (!state.downloadableBlocks[filterValue] || !state.downloadableBlocks[filterValue].results) {
 708      return [];
 709    }
 710  
 711    return state.downloadableBlocks[filterValue].results;
 712  }
 713  /**
 714   * Returns true if user has permission to install blocks.
 715   *
 716   * @param {Object} state Global application state.
 717   *
 718   * @return {boolean} User has permission to install blocks.
 719   */
 720  
 721  function selectors_hasInstallBlocksPermission(state) {
 722    return state.hasPermission;
 723  }
 724  /**
 725   * Returns the block types that have been installed on the server.
 726   *
 727   * @param {Object} state Global application state.
 728   *
 729   * @return {Array} Block type items.
 730   */
 731  
 732  function getInstalledBlockTypes(state) {
 733    return state.blockManagement.installedBlockTypes;
 734  }
 735  /**
 736   * Returns block types that have been installed on the server and used in the
 737   * current post.
 738   *
 739   * @param {Object} state Global application state.
 740   *
 741   * @return {Array} Block type items.
 742   */
 743  
 744  var getNewBlockTypes = Object(external_this_wp_data_["createRegistrySelector"])(function (select) {
 745    return function (state) {
 746      var usedBlockTree = select('core/block-editor').getBlocks();
 747      var installedBlockTypes = getInstalledBlockTypes(state);
 748      var newBlockTypes = [];
 749      installedBlockTypes.forEach(function (blockType) {
 750        if (hasBlockType(blockType, usedBlockTree)) {
 751          newBlockTypes.push(blockType);
 752        }
 753      });
 754      return newBlockTypes;
 755    };
 756  });
 757  /**
 758   * Returns the block types that have been installed on the server but are not
 759   * used in the current post.
 760   *
 761   * @param {Object} state Global application state.
 762   *
 763   * @return {Array} Block type items.
 764   */
 765  
 766  var getUnusedBlockTypes = Object(external_this_wp_data_["createRegistrySelector"])(function (select) {
 767    return function (state) {
 768      var usedBlockTree = select('core/block-editor').getBlocks();
 769      var installedBlockTypes = getInstalledBlockTypes(state);
 770      var newBlockTypes = [];
 771      installedBlockTypes.forEach(function (blockType) {
 772        if (!hasBlockType(blockType, usedBlockTree)) {
 773          newBlockTypes.push(blockType);
 774        }
 775      });
 776      return newBlockTypes;
 777    };
 778  });
 779  /**
 780   * Returns true if application is calling install endpoint.
 781   *
 782   * @param {Object} state Global application state.
 783   * @param {string} blockId Id of the block.
 784   *
 785   * @return {boolean} Whether its currently installing
 786   */
 787  
 788  function isInstalling(state, blockId) {
 789    return state.blockManagement.isInstalling[blockId] || false;
 790  }
 791  /**
 792   * Returns the error notices
 793   *
 794   * @param {Object} state Global application state.
 795   *
 796   * @return {Object} Object with error notices.
 797   */
 798  
 799  function getErrorNotices(state) {
 800    return state.errorNotices;
 801  }
 802  /**
 803   * Returns the error notice for a given block.
 804   *
 805   * @param {Object} state   Global application state.
 806   * @param {string} blockId The ID of the block plugin. eg: my-block
 807   *
 808   * @return {string|boolean} The error text, or false if no error.
 809   */
 810  
 811  function getErrorNoticeForBlock(state, blockId) {
 812    return state.errorNotices[blockId] || false;
 813  }
 814  
 815  // EXTERNAL MODULE: external {"this":"regeneratorRuntime"}
 816  var external_this_regeneratorRuntime_ = __webpack_require__(23);
 817  var external_this_regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(external_this_regeneratorRuntime_);
 818  
 819  // EXTERNAL MODULE: external {"this":["wp","i18n"]}
 820  var external_this_wp_i18n_ = __webpack_require__(1);
 821  
 822  // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/controls.js
 823  /**
 824   * Loads a JavaScript file.
 825   *
 826   * @param {string} asset The url for this file.
 827   *
 828   * @return {Promise} Promise which will resolve when the asset is loaded.
 829   */
 830  var loadScript = function loadScript(asset) {
 831    if (!asset || !/\.js$/.test(asset)) {
 832      return Promise.reject(new Error('No script found.'));
 833    }
 834  
 835    return new Promise(function (resolve, reject) {
 836      var existing = document.querySelector("script[src=\"".concat(asset, "\"]"));
 837  
 838      if (existing) {
 839        existing.parentNode.removeChild(existing);
 840      }
 841  
 842      var script = document.createElement('script');
 843      script.src = asset;
 844  
 845      script.onload = function () {
 846        return resolve(true);
 847      };
 848  
 849      script.onerror = function () {
 850        return reject(new Error('Error loading script.'));
 851      };
 852  
 853      document.body.appendChild(script);
 854    });
 855  };
 856  /**
 857   * Loads a CSS file.
 858   *
 859   * @param {string} asset The url for this file.
 860   *
 861   * @return {Promise} Promise which will resolve when the asset is added.
 862   */
 863  
 864  var loadStyle = function loadStyle(asset) {
 865    if (!asset || !/\.css$/.test(asset)) {
 866      return Promise.reject(new Error('No style found.'));
 867    }
 868  
 869    return new Promise(function (resolve, reject) {
 870      var link = document.createElement('link');
 871      link.rel = 'stylesheet';
 872      link.href = asset;
 873  
 874      link.onload = function () {
 875        return resolve(true);
 876      };
 877  
 878      link.onerror = function () {
 879        return reject(new Error('Error loading style.'));
 880      };
 881  
 882      document.body.appendChild(link);
 883    });
 884  };
 885  /**
 886   * Load the asset files for a block
 887   *
 888   * @param {Array} assets A collection of URLs for the assets.
 889   *
 890   * @return {Object} Control descriptor.
 891   */
 892  
 893  function loadAssets(assets) {
 894    return {
 895      type: 'LOAD_ASSETS',
 896      assets: assets
 897    };
 898  }
 899  var controls = {
 900    LOAD_ASSETS: function LOAD_ASSETS(_ref) {
 901      var assets = _ref.assets;
 902      var scripts = assets.map(function (asset) {
 903        return asset.match(/\.js$/) !== null ? loadScript(asset) : loadStyle(asset);
 904      });
 905      return Promise.all(scripts);
 906    }
 907  };
 908  /* harmony default export */ var store_controls = (controls);
 909  
 910  // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/actions.js
 911  
 912  
 913  
 914  var _marked = /*#__PURE__*/external_this_regeneratorRuntime_default.a.mark(actions_installBlockType),
 915      _marked2 = /*#__PURE__*/external_this_regeneratorRuntime_default.a.mark(actions_uninstallBlockType);
 916  
 917  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; }
 918  
 919  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; }
 920  
 921  /**
 922   * WordPress dependencies
 923   */
 924  
 925  
 926  /**
 927   * Internal dependencies
 928   */
 929  
 930  
 931  /**
 932   * Returns an action object used in signalling that the downloadable blocks
 933   * have been requested and is loading.
 934   *
 935   * @param {string} filterValue Search string.
 936   *
 937   * @return {Object} Action object.
 938   */
 939  
 940  function fetchDownloadableBlocks(filterValue) {
 941    return {
 942      type: 'FETCH_DOWNLOADABLE_BLOCKS',
 943      filterValue: filterValue
 944    };
 945  }
 946  /**
 947   * Returns an action object used in signalling that the downloadable blocks
 948   * have been updated.
 949   *
 950   * @param {Array}  downloadableBlocks Downloadable blocks.
 951   * @param {string} filterValue        Search string.
 952   *
 953   * @return {Object} Action object.
 954   */
 955  
 956  function receiveDownloadableBlocks(downloadableBlocks, filterValue) {
 957    return {
 958      type: 'RECEIVE_DOWNLOADABLE_BLOCKS',
 959      downloadableBlocks: downloadableBlocks,
 960      filterValue: filterValue
 961    };
 962  }
 963  /**
 964   * Returns an action object used in signalling that the user does not have
 965   * permission to install blocks.
 966   *
 967   * @param {boolean} hasPermission User has permission to install blocks.
 968   *
 969   * @return {Object} Action object.
 970   */
 971  
 972  function setInstallBlocksPermission(hasPermission) {
 973    return {
 974      type: 'SET_INSTALL_BLOCKS_PERMISSION',
 975      hasPermission: hasPermission
 976    };
 977  }
 978  /**
 979   * Action triggered to install a block plugin.
 980   *
 981   * @param {Object} block The block item returned by search.
 982   *
 983   * @return {boolean} Whether the block was successfully installed & loaded.
 984   */
 985  
 986  function actions_installBlockType(block) {
 987    var id, assets, success, _response$_links, _response$_links$self, response, endpoint, registeredBlocks;
 988  
 989    return external_this_regeneratorRuntime_default.a.wrap(function installBlockType$(_context) {
 990      while (1) {
 991        switch (_context.prev = _context.next) {
 992          case 0:
 993            id = block.id, assets = block.assets;
 994            success = false;
 995            _context.next = 4;
 996            return clearErrorNotice(id);
 997  
 998          case 4:
 999            _context.prev = 4;
1000  
1001            if (!(!Array.isArray(assets) || !assets.length)) {
1002              _context.next = 7;
1003              break;
1004            }
1005  
1006            throw new Error(Object(external_this_wp_i18n_["__"])('Block has no assets.'));
1007  
1008          case 7:
1009            _context.next = 9;
1010            return setIsInstalling(block.id, true);
1011  
1012          case 9:
1013            _context.next = 11;
1014            return Object(external_this_wp_dataControls_["apiFetch"])({
1015              path: '__experimental/plugins',
1016              data: {
1017                slug: block.id,
1018                status: 'active'
1019              },
1020              method: 'POST'
1021            });
1022  
1023          case 11:
1024            response = _context.sent;
1025            endpoint = response === null || response === void 0 ? void 0 : (_response$_links = response._links) === null || _response$_links === void 0 ? void 0 : (_response$_links$self = _response$_links.self[0]) === null || _response$_links$self === void 0 ? void 0 : _response$_links$self.href;
1026            _context.next = 15;
1027            return addInstalledBlockType(actions_objectSpread({}, block, {
1028              endpoint: endpoint
1029            }));
1030  
1031          case 15:
1032            _context.next = 17;
1033            return loadAssets(assets);
1034  
1035          case 17:
1036            _context.next = 19;
1037            return Object(external_this_wp_dataControls_["select"])('core/blocks', 'getBlockTypes');
1038  
1039          case 19:
1040            registeredBlocks = _context.sent;
1041  
1042            if (registeredBlocks.length) {
1043              _context.next = 22;
1044              break;
1045            }
1046  
1047            throw new Error(Object(external_this_wp_i18n_["__"])('Unable to get block types.'));
1048  
1049          case 22:
1050            success = true;
1051            _context.next = 29;
1052            break;
1053  
1054          case 25:
1055            _context.prev = 25;
1056            _context.t0 = _context["catch"](4);
1057            _context.next = 29;
1058            return setErrorNotice(id, _context.t0.message || Object(external_this_wp_i18n_["__"])('An error occurred.'));
1059  
1060          case 29:
1061            _context.next = 31;
1062            return setIsInstalling(block.id, false);
1063  
1064          case 31:
1065            return _context.abrupt("return", success);
1066  
1067          case 32:
1068          case "end":
1069            return _context.stop();
1070        }
1071      }
1072    }, _marked, null, [[4, 25]]);
1073  }
1074  /**
1075   * Action triggered to uninstall a block plugin.
1076   *
1077   * @param {Object} block The blockType object.
1078   */
1079  
1080  function actions_uninstallBlockType(block) {
1081    return external_this_regeneratorRuntime_default.a.wrap(function uninstallBlockType$(_context2) {
1082      while (1) {
1083        switch (_context2.prev = _context2.next) {
1084          case 0:
1085            _context2.prev = 0;
1086            _context2.next = 3;
1087            return Object(external_this_wp_dataControls_["apiFetch"])({
1088              url: block.endpoint,
1089              data: {
1090                status: 'inactive'
1091              },
1092              method: 'PUT'
1093            });
1094  
1095          case 3:
1096            _context2.next = 5;
1097            return Object(external_this_wp_dataControls_["apiFetch"])({
1098              url: block.endpoint,
1099              method: 'DELETE'
1100            });
1101  
1102          case 5:
1103            _context2.next = 7;
1104            return removeInstalledBlockType(block);
1105  
1106          case 7:
1107            _context2.next = 13;
1108            break;
1109  
1110          case 9:
1111            _context2.prev = 9;
1112            _context2.t0 = _context2["catch"](0);
1113            _context2.next = 13;
1114            return Object(external_this_wp_dataControls_["dispatch"])('core/notices', 'createErrorNotice', _context2.t0.message || Object(external_this_wp_i18n_["__"])('An error occurred.'));
1115  
1116          case 13:
1117          case "end":
1118            return _context2.stop();
1119        }
1120      }
1121    }, _marked2, null, [[0, 9]]);
1122  }
1123  /**
1124   * Returns an action object used to add a newly installed block type.
1125   *
1126   * @param {Object} item The block item with the block id and name.
1127   *
1128   * @return {Object} Action object.
1129   */
1130  
1131  function addInstalledBlockType(item) {
1132    return {
1133      type: 'ADD_INSTALLED_BLOCK_TYPE',
1134      item: item
1135    };
1136  }
1137  /**
1138   * Returns an action object used to remove a newly installed block type.
1139   *
1140   * @param {string} item The block item with the block id and name.
1141   *
1142   * @return {Object} Action object.
1143   */
1144  
1145  function removeInstalledBlockType(item) {
1146    return {
1147      type: 'REMOVE_INSTALLED_BLOCK_TYPE',
1148      item: item
1149    };
1150  }
1151  /**
1152   * Returns an action object used to indicate install in progress
1153   *
1154   * @param {string} blockId
1155   * @param {boolean} isInstalling
1156   *
1157   * @return {Object} Action object.
1158   */
1159  
1160  function setIsInstalling(blockId, isInstalling) {
1161    return {
1162      type: 'SET_INSTALLING_BLOCK',
1163      blockId: blockId,
1164      isInstalling: isInstalling
1165    };
1166  }
1167  /**
1168   * Sets an error notice string to be displayed to the user
1169   *
1170   * @param {string} blockId The ID of the block plugin. eg: my-block
1171   * @param {string} notice  The message shown in the notice.
1172   *
1173   * @return {Object} Action object.
1174   */
1175  
1176  function setErrorNotice(blockId, notice) {
1177    return {
1178      type: 'SET_ERROR_NOTICE',
1179      blockId: blockId,
1180      notice: notice
1181    };
1182  }
1183  /**
1184   * Sets the error notice to empty for specific block
1185   *
1186   * @param {string} blockId The ID of the block plugin. eg: my-block
1187   *
1188   * @return {Object} Action object.
1189   */
1190  
1191  function clearErrorNotice(blockId) {
1192    return {
1193      type: 'SET_ERROR_NOTICE',
1194      blockId: blockId,
1195      notice: false
1196    };
1197  }
1198  
1199  // EXTERNAL MODULE: external {"this":"lodash"}
1200  var external_this_lodash_ = __webpack_require__(2);
1201  
1202  // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/resolvers.js
1203  
1204  
1205  /**
1206   * External dependencies
1207   */
1208  
1209  /**
1210   * WordPress dependencies
1211   */
1212  
1213  
1214  /**
1215   * Internal dependencies
1216   */
1217  
1218  
1219  /* harmony default export */ var resolvers = ({
1220    getDownloadableBlocks: /*#__PURE__*/external_this_regeneratorRuntime_default.a.mark(function getDownloadableBlocks(filterValue) {
1221      var results, blocks;
1222      return external_this_regeneratorRuntime_default.a.wrap(function getDownloadableBlocks$(_context) {
1223        while (1) {
1224          switch (_context.prev = _context.next) {
1225            case 0:
1226              if (filterValue) {
1227                _context.next = 2;
1228                break;
1229              }
1230  
1231              return _context.abrupt("return");
1232  
1233            case 2:
1234              _context.prev = 2;
1235              _context.next = 5;
1236              return fetchDownloadableBlocks(filterValue);
1237  
1238            case 5:
1239              _context.next = 7;
1240              return Object(external_this_wp_dataControls_["apiFetch"])({
1241                path: "__experimental/block-directory/search?term=".concat(filterValue)
1242              });
1243  
1244            case 7:
1245              results = _context.sent;
1246              blocks = results.map(function (result) {
1247                return Object(external_this_lodash_["mapKeys"])(result, function (value, key) {
1248                  return Object(external_this_lodash_["camelCase"])(key);
1249                });
1250              });
1251              _context.next = 11;
1252              return receiveDownloadableBlocks(blocks, filterValue);
1253  
1254            case 11:
1255              _context.next = 18;
1256              break;
1257  
1258            case 13:
1259              _context.prev = 13;
1260              _context.t0 = _context["catch"](2);
1261  
1262              if (!(_context.t0.code === 'rest_block_directory_cannot_view')) {
1263                _context.next = 18;
1264                break;
1265              }
1266  
1267              _context.next = 18;
1268              return setInstallBlocksPermission(false);
1269  
1270            case 18:
1271            case "end":
1272              return _context.stop();
1273          }
1274        }
1275      }, getDownloadableBlocks, null, [[2, 13]]);
1276    }),
1277    hasInstallBlocksPermission: /*#__PURE__*/external_this_regeneratorRuntime_default.a.mark(function hasInstallBlocksPermission() {
1278      var response, allowHeader, isAllowed;
1279      return external_this_regeneratorRuntime_default.a.wrap(function hasInstallBlocksPermission$(_context2) {
1280        while (1) {
1281          switch (_context2.prev = _context2.next) {
1282            case 0:
1283              _context2.prev = 0;
1284              _context2.next = 3;
1285              return Object(external_this_wp_dataControls_["apiFetch"])({
1286                method: 'OPTIONS',
1287                path: "__experimental/block-directory/search",
1288                parse: false
1289              });
1290  
1291            case 3:
1292              response = _context2.sent;
1293  
1294              if (Object(external_this_lodash_["hasIn"])(response, ['headers', 'get'])) {
1295                // If the request is fetched using the fetch api, the header can be
1296                // retrieved using the 'get' method.
1297                allowHeader = response.headers.get('allow');
1298              } else {
1299                // If the request was preloaded server-side and is returned by the
1300                // preloading middleware, the header will be a simple property.
1301                allowHeader = Object(external_this_lodash_["get"])(response, ['headers', 'Allow'], '');
1302              }
1303  
1304              isAllowed = Object(external_this_lodash_["includes"])(allowHeader, 'GET');
1305              _context2.next = 8;
1306              return setInstallBlocksPermission(isAllowed);
1307  
1308            case 8:
1309              _context2.next = 14;
1310              break;
1311  
1312            case 10:
1313              _context2.prev = 10;
1314              _context2.t0 = _context2["catch"](0);
1315              _context2.next = 14;
1316              return setInstallBlocksPermission(false);
1317  
1318            case 14:
1319            case "end":
1320              return _context2.stop();
1321          }
1322        }
1323      }, hasInstallBlocksPermission, null, [[0, 10]]);
1324    })
1325  });
1326  
1327  // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/index.js
1328  
1329  
1330  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; }
1331  
1332  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; }
1333  
1334  /**
1335   * WordPress dependencies
1336   */
1337  
1338  
1339  /**
1340   * Internal dependencies
1341   */
1342  
1343  
1344  
1345  
1346  
1347  
1348  /**
1349   * Module Constants
1350   */
1351  
1352  var MODULE_KEY = 'core/block-directory';
1353  /**
1354   * Block editor data store configuration.
1355   *
1356   * @see https://github.com/WordPress/gutenberg/blob/master/packages/data/README.md#registerStore
1357   *
1358   * @type {Object}
1359   */
1360  
1361  var storeConfig = {
1362    reducer: reducer,
1363    selectors: selectors_namespaceObject,
1364    actions: actions_namespaceObject,
1365    controls: store_objectSpread({}, external_this_wp_dataControls_["controls"], {}, store_controls),
1366    resolvers: resolvers
1367  };
1368  var store = Object(external_this_wp_data_["registerStore"])(MODULE_KEY, storeConfig);
1369  /* harmony default export */ var build_module_store = (store);
1370  
1371  // EXTERNAL MODULE: external {"this":["wp","element"]}
1372  var external_this_wp_element_ = __webpack_require__(0);
1373  
1374  // EXTERNAL MODULE: external {"this":["wp","plugins"]}
1375  var external_this_wp_plugins_ = __webpack_require__(63);
1376  
1377  // EXTERNAL MODULE: external {"this":["wp","blocks"]}
1378  var external_this_wp_blocks_ = __webpack_require__(12);
1379  
1380  // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/auto-block-uninstaller/index.js
1381  /**
1382   * WordPress dependencies
1383   */
1384  
1385  
1386  
1387  function AutoBlockUninstaller() {
1388    var _useDispatch = Object(external_this_wp_data_["useDispatch"])('core/block-directory'),
1389        uninstallBlockType = _useDispatch.uninstallBlockType;
1390  
1391    var shouldRemoveBlockTypes = Object(external_this_wp_data_["useSelect"])(function (select) {
1392      var _select = select('core/editor'),
1393          isAutosavingPost = _select.isAutosavingPost,
1394          isSavingPost = _select.isSavingPost;
1395  
1396      return isSavingPost() && !isAutosavingPost();
1397    });
1398    var unusedBlockTypes = Object(external_this_wp_data_["useSelect"])(function (select) {
1399      return select('core/block-directory').getUnusedBlockTypes();
1400    });
1401    Object(external_this_wp_element_["useEffect"])(function () {
1402      if (shouldRemoveBlockTypes && unusedBlockTypes.length) {
1403        unusedBlockTypes.forEach(function (blockType) {
1404          uninstallBlockType(blockType);
1405          Object(external_this_wp_blocks_["unregisterBlockType"])(blockType.name);
1406        });
1407      }
1408    }, [shouldRemoveBlockTypes]);
1409    return null;
1410  }
1411  
1412  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
1413  var slicedToArray = __webpack_require__(15);
1414  
1415  // EXTERNAL MODULE: external {"this":["wp","blockEditor"]}
1416  var external_this_wp_blockEditor_ = __webpack_require__(7);
1417  
1418  // EXTERNAL MODULE: external {"this":["wp","compose"]}
1419  var external_this_wp_compose_ = __webpack_require__(9);
1420  
1421  // EXTERNAL MODULE: external {"this":["wp","components"]}
1422  var external_this_wp_components_ = __webpack_require__(3);
1423  
1424  // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-block-author-info/index.js
1425  
1426  
1427  /**
1428   * WordPress dependencies
1429   */
1430  
1431  
1432  
1433  function DownloadableBlockAuthorInfo(_ref) {
1434    var author = _ref.author,
1435        authorBlockCount = _ref.authorBlockCount,
1436        authorBlockRating = _ref.authorBlockRating;
1437    return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])("span", {
1438      className: "block-directory-downloadable-block-author-info__content-author"
1439    }, Object(external_this_wp_i18n_["sprintf"])(
1440    /* translators: %s: author name. */
1441    Object(external_this_wp_i18n_["__"])('Authored by %s'), author)), Object(external_this_wp_element_["createElement"])("span", {
1442      className: "block-directory-downloadable-block-author-info__content"
1443    }, authorBlockRating > 0 ? Object(external_this_wp_i18n_["sprintf"])(
1444    /* translators: 1: number of blocks. 2: average rating. */
1445    Object(external_this_wp_i18n_["_n"])('This author has %1$d block, with an average rating of %2$d.', 'This author has %1$d blocks, with an average rating of %2$d.', authorBlockCount), authorBlockCount, authorBlockRating) : Object(external_this_wp_i18n_["sprintf"])(
1446    /* translators: 1: number of blocks. */
1447    Object(external_this_wp_i18n_["_n"])('This author has %1$d block.', 'This author has %1$d blocks.', authorBlockCount), authorBlockCount)));
1448  }
1449  
1450  /* harmony default export */ var downloadable_block_author_info = (DownloadableBlockAuthorInfo);
1451  
1452  // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/icon/index.js
1453  var build_module_icon = __webpack_require__(130);
1454  
1455  // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/star-filled.js
1456  var star_filled = __webpack_require__(281);
1457  
1458  // EXTERNAL MODULE: external {"this":["wp","primitives"]}
1459  var external_this_wp_primitives_ = __webpack_require__(6);
1460  
1461  // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/star-half.js
1462  
1463  
1464  /**
1465   * WordPress dependencies
1466   */
1467  
1468  var starHalf = Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["SVG"], {
1469    xmlns: "http://www.w3.org/2000/svg",
1470    viewBox: "0 0 24 24"
1471  }, Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["Path"], {
1472    d: "M9.518 8.783a.25.25 0 00.188-.137l2.069-4.192a.25.25 0 01.448 0l2.07 4.192a.25.25 0 00.187.137l4.626.672a.25.25 0 01.139.427l-3.347 3.262a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.363.264l-4.137-2.176a.25.25 0 00-.233 0l-4.138 2.175a.25.25 0 01-.362-.263l.79-4.607a.25.25 0 00-.072-.222L4.753 9.882a.25.25 0 01.14-.427l4.625-.672zM12 14.533c.28 0 .559.067.814.2l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39v7.143z"
1473  }));
1474  /* harmony default export */ var star_half = (starHalf);
1475  
1476  // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/star-empty.js
1477  var star_empty = __webpack_require__(282);
1478  
1479  // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/block-ratings/stars.js
1480  
1481  
1482  /**
1483   * External dependencies
1484   */
1485  
1486  /**
1487   * WordPress dependencies
1488   */
1489  
1490  
1491  
1492  
1493  function Stars(_ref) {
1494    var rating = _ref.rating;
1495    var stars = Math.round(rating / 0.5) * 0.5;
1496    var fullStarCount = Math.floor(rating);
1497    var halfStarCount = Math.ceil(rating - fullStarCount);
1498    var emptyStarCount = 5 - (fullStarCount + halfStarCount);
1499    return Object(external_this_wp_element_["createElement"])("div", {
1500      "aria-label": Object(external_this_wp_i18n_["sprintf"])(
1501      /* translators: %s: number of stars. */
1502      Object(external_this_wp_i18n_["__"])('%s out of 5 stars'), stars)
1503    }, Object(external_this_lodash_["times"])(fullStarCount, function (i) {
1504      return Object(external_this_wp_element_["createElement"])(build_module_icon["a" /* default */], {
1505        key: "full_stars_".concat(i),
1506        icon: star_filled["a" /* default */],
1507        size: 16
1508      });
1509    }), Object(external_this_lodash_["times"])(halfStarCount, function (i) {
1510      return Object(external_this_wp_element_["createElement"])(build_module_icon["a" /* default */], {
1511        key: "half_stars_".concat(i),
1512        icon: star_half,
1513        size: 16
1514      });
1515    }), Object(external_this_lodash_["times"])(emptyStarCount, function (i) {
1516      return Object(external_this_wp_element_["createElement"])(build_module_icon["a" /* default */], {
1517        key: "empty_stars_".concat(i),
1518        icon: star_empty["a" /* default */],
1519        size: 16
1520      });
1521    }));
1522  }
1523  
1524  /* harmony default export */ var block_ratings_stars = (Stars);
1525  
1526  // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/block-ratings/index.js
1527  
1528  
1529  /**
1530   * WordPress dependencies
1531   */
1532  
1533  /**
1534   * Internal dependencies
1535   */
1536  
1537  
1538  var block_ratings_BlockRatings = function BlockRatings(_ref) {
1539    var rating = _ref.rating,
1540        ratingCount = _ref.ratingCount;
1541    return Object(external_this_wp_element_["createElement"])("div", {
1542      className: "block-directory-block-ratings"
1543    }, Object(external_this_wp_element_["createElement"])(block_ratings_stars, {
1544      rating: rating
1545    }), Object(external_this_wp_element_["createElement"])("span", {
1546      className: "block-directory-block-ratings__rating-count",
1547      "aria-label": Object(external_this_wp_i18n_["sprintf"])( // translators: %d: number of ratings (number).
1548      Object(external_this_wp_i18n_["_n"])('%d total rating', '%d total ratings', ratingCount), ratingCount)
1549    }, "(", ratingCount, ")"));
1550  };
1551  /* harmony default export */ var block_ratings = (block_ratings_BlockRatings);
1552  
1553  // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-block-icon/index.js
1554  
1555  
1556  /**
1557   * WordPress dependencies
1558   */
1559  
1560  
1561  
1562  function DownloadableBlockIcon(_ref) {
1563    var icon = _ref.icon,
1564        title = _ref.title;
1565    return Object(external_this_wp_element_["createElement"])("div", {
1566      className: "block-directory-downloadable-block-icon"
1567    }, icon.match(/\.(jpeg|jpg|gif|png)(?:\?.*)?$/) !== null ? Object(external_this_wp_element_["createElement"])("img", {
1568      src: icon,
1569      alt: Object(external_this_wp_i18n_["sprintf"])( // translators: %s: Name of the plugin e.g: "Akismet".
1570      Object(external_this_wp_i18n_["__"])('%s block icon'), title)
1571    }) : Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["BlockIcon"], {
1572      icon: icon,
1573      showColors: true
1574    }));
1575  }
1576  
1577  /* harmony default export */ var downloadable_block_icon = (DownloadableBlockIcon);
1578  
1579  // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-block-header/index.js
1580  
1581  
1582  /**
1583   * WordPress dependencies
1584   */
1585  
1586  
1587  /**
1588   * Internal dependencies
1589   */
1590  
1591  
1592  
1593  
1594  function DownloadableBlockHeader(_ref) {
1595    var icon = _ref.icon,
1596        title = _ref.title,
1597        rating = _ref.rating,
1598        ratingCount = _ref.ratingCount,
1599        isLoading = _ref.isLoading,
1600        _onClick = _ref.onClick;
1601    return Object(external_this_wp_element_["createElement"])("div", {
1602      className: "block-directory-downloadable-block-header__row"
1603    }, Object(external_this_wp_element_["createElement"])(downloadable_block_icon, {
1604      icon: icon,
1605      title: title
1606    }), Object(external_this_wp_element_["createElement"])("div", {
1607      className: "block-directory-downloadable-block-header__column"
1608    }, Object(external_this_wp_element_["createElement"])("h2", {
1609      className: "block-directory-downloadable-block-header__title"
1610    }, title), Object(external_this_wp_element_["createElement"])(block_ratings, {
1611      rating: rating,
1612      ratingCount: ratingCount
1613    })), Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Button"], {
1614      isSecondary: true,
1615      isBusy: isLoading,
1616      disabled: isLoading,
1617      onClick: function onClick(event) {
1618        event.preventDefault();
1619  
1620        if (!isLoading) {
1621          _onClick();
1622        }
1623      }
1624    }, isLoading ? Object(external_this_wp_i18n_["__"])('Adding…') : Object(external_this_wp_i18n_["__"])('Add block')));
1625  }
1626  
1627  /* harmony default export */ var downloadable_block_header = (DownloadableBlockHeader);
1628  
1629  // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chart-line.js
1630  
1631  
1632  /**
1633   * WordPress dependencies
1634   */
1635  
1636  var chartLine = Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["SVG"], {
1637    xmlns: "http://www.w3.org/2000/svg",
1638    viewBox: "-2 -2 24 24"
1639  }, Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["Path"], {
1640    d: "M18 3.5c0 .62-.38 1.16-.92 1.38v13.11H1.99l4.22-6.73c-.13-.23-.21-.48-.21-.76C6 9.67 6.67 9 7.5 9S9 9.67 9 10.5c0 .13-.02.25-.05.37l1.44.63c.27-.3.67-.5 1.11-.5.18 0 .35.04.51.09l3.58-6.41c-.36-.27-.59-.7-.59-1.18 0-.83.67-1.5 1.5-1.5.19 0 .36.04.53.1l.05-.09v.11c.54.22.92.76.92 1.38zm-1.92 13.49V5.85l-3.29 5.89c.13.23.21.48.21.76 0 .83-.67 1.5-1.5 1.5s-1.5-.67-1.5-1.5l.01-.07-1.63-.72c-.25.18-.55.29-.88.29-.18 0-.35-.04-.51-.1l-3.2 5.09h12.29z"
1641  }));
1642  /* harmony default export */ var chart_line = (chartLine);
1643  
1644  // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/update.js
1645  
1646  
1647  /**
1648   * WordPress dependencies
1649   */
1650  
1651  var update = Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["SVG"], {
1652    xmlns: "http://www.w3.org/2000/svg",
1653    viewBox: "-2 -2 24 24"
1654  }, Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["Path"], {
1655    d: "M10.2 3.28c3.53 0 6.43 2.61 6.92 6h2.08l-3.5 4-3.5-4h2.32c-.45-1.97-2.21-3.45-4.32-3.45-1.45 0-2.73.71-3.54 1.78L4.95 5.66C6.23 4.2 8.11 3.28 10.2 3.28zm-.4 13.44c-3.52 0-6.43-2.61-6.92-6H.8l3.5-4c1.17 1.33 2.33 2.67 3.5 4H5.48c.45 1.97 2.21 3.45 4.32 3.45 1.45 0 2.73-.71 3.54-1.78l1.71 1.95c-1.28 1.46-3.15 2.38-5.25 2.38z"
1656  }));
1657  /* harmony default export */ var library_update = (update);
1658  
1659  // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-block-info/index.js
1660  
1661  
1662  /**
1663   * WordPress dependencies
1664   */
1665  
1666  
1667  
1668  
1669  function DownloadableBlockInfo(_ref) {
1670    var description = _ref.description,
1671        activeInstalls = _ref.activeInstalls,
1672        humanizedUpdated = _ref.humanizedUpdated;
1673    return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])("p", {
1674      className: "block-directory-downloadable-block-info__content"
1675    }, description), Object(external_this_wp_element_["createElement"])("div", {
1676      className: "block-directory-downloadable-block-info__meta"
1677    }, Object(external_this_wp_element_["createElement"])(build_module_icon["a" /* default */], {
1678      className: "block-directory-downloadable-block-info__icon",
1679      icon: chart_line
1680    }), Object(external_this_wp_i18n_["sprintf"])(
1681    /* translators: %s: number of active installations. */
1682    Object(external_this_wp_i18n_["_n"])('%d active installation', '%d active installations', activeInstalls), activeInstalls)), Object(external_this_wp_element_["createElement"])("div", {
1683      className: "block-directory-downloadable-block-info__meta"
1684    }, Object(external_this_wp_element_["createElement"])(build_module_icon["a" /* default */], {
1685      className: "block-directory-downloadable-block-info__icon",
1686      icon: library_update
1687    }), // translators: %s: Humanized date of last update e.g: "2 months ago".
1688    Object(external_this_wp_i18n_["sprintf"])(Object(external_this_wp_i18n_["__"])('Updated %s'), humanizedUpdated)));
1689  }
1690  
1691  /* harmony default export */ var downloadable_block_info = (DownloadableBlockInfo);
1692  
1693  // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-block-notice/index.js
1694  
1695  
1696  /**
1697   * WordPress dependencies
1698   */
1699  
1700  
1701  
1702  var downloadable_block_notice_DownloadableBlockNotice = function DownloadableBlockNotice(_ref) {
1703    var block = _ref.block,
1704        _onClick = _ref.onClick;
1705    var errorNotice = Object(external_this_wp_data_["useSelect"])(function (select) {
1706      return select('core/block-directory').getErrorNoticeForBlock(block.id);
1707    }, [block]);
1708  
1709    if (!errorNotice) {
1710      return null;
1711    }
1712  
1713    return Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Notice"], {
1714      status: "error",
1715      isDismissible: false,
1716      className: "block-directory-downloadable-block-notice"
1717    }, Object(external_this_wp_element_["createElement"])("div", {
1718      className: "block-directory-downloadable-block-notice__content"
1719    }, errorNotice), Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Button"], {
1720      isSmall: true,
1721      isPrimary: true,
1722      onClick: function onClick() {
1723        _onClick(block);
1724      }
1725    }, Object(external_this_wp_i18n_["__"])('Retry')));
1726  };
1727  /* harmony default export */ var downloadable_block_notice = (downloadable_block_notice_DownloadableBlockNotice);
1728  
1729  // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-block-list-item/index.js
1730  
1731  
1732  /**
1733   * WordPress dependencies
1734   */
1735  
1736  /**
1737   * Internal dependencies
1738   */
1739  
1740  
1741  
1742  
1743  
1744  function DownloadableBlockListItem(_ref) {
1745    var item = _ref.item,
1746        onClick = _ref.onClick;
1747    var isLoading = Object(external_this_wp_data_["useSelect"])(function (select) {
1748      return select('core/block-directory').isInstalling(item.id);
1749    }, [item]);
1750    var icon = item.icon,
1751        title = item.title,
1752        description = item.description,
1753        rating = item.rating,
1754        activeInstalls = item.activeInstalls,
1755        ratingCount = item.ratingCount,
1756        author = item.author,
1757        humanizedUpdated = item.humanizedUpdated,
1758        authorBlockCount = item.authorBlockCount,
1759        authorBlockRating = item.authorBlockRating;
1760    return Object(external_this_wp_element_["createElement"])("li", {
1761      className: "block-directory-downloadable-block-list-item"
1762    }, Object(external_this_wp_element_["createElement"])("article", {
1763      className: "block-directory-downloadable-block-list-item__panel"
1764    }, Object(external_this_wp_element_["createElement"])("header", {
1765      className: "block-directory-downloadable-block-list-item__header"
1766    }, Object(external_this_wp_element_["createElement"])(downloadable_block_header, {
1767      icon: icon,
1768      onClick: onClick,
1769      title: title,
1770      rating: rating,
1771      ratingCount: ratingCount,
1772      isLoading: isLoading
1773    })), Object(external_this_wp_element_["createElement"])("section", {
1774      className: "block-directory-downloadable-block-list-item__body"
1775    }, Object(external_this_wp_element_["createElement"])(downloadable_block_notice, {
1776      onClick: onClick,
1777      block: item
1778    }), Object(external_this_wp_element_["createElement"])(downloadable_block_info, {
1779      activeInstalls: activeInstalls,
1780      description: description,
1781      humanizedUpdated: humanizedUpdated
1782    })), Object(external_this_wp_element_["createElement"])("footer", {
1783      className: "block-directory-downloadable-block-list-item__footer"
1784    }, Object(external_this_wp_element_["createElement"])(downloadable_block_author_info, {
1785      author: author,
1786      authorBlockCount: authorBlockCount,
1787      authorBlockRating: authorBlockRating
1788    }))));
1789  }
1790  
1791  // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-blocks-list/index.js
1792  
1793  
1794  /**
1795   * External dependencies
1796   */
1797  
1798  /**
1799   * WordPress dependencies
1800   */
1801  
1802  
1803  /**
1804   * Internal dependencies
1805   */
1806  
1807  
1808  
1809  function DownloadableBlocksList(_ref) {
1810    var items = _ref.items,
1811        _ref$onHover = _ref.onHover,
1812        onHover = _ref$onHover === void 0 ? external_this_lodash_["noop"] : _ref$onHover,
1813        onSelect = _ref.onSelect;
1814  
1815    var _useDispatch = Object(external_this_wp_data_["useDispatch"])('core/block-directory'),
1816        installBlockType = _useDispatch.installBlockType;
1817  
1818    if (!items.length) {
1819      return null;
1820    }
1821  
1822    return (
1823      /*
1824       * Disable reason: The `list` ARIA role is redundant but
1825       * Safari+VoiceOver won't announce the list otherwise.
1826       */
1827  
1828      /* eslint-disable jsx-a11y/no-redundant-roles */
1829      Object(external_this_wp_element_["createElement"])("ul", {
1830        role: "list",
1831        className: "block-directory-downloadable-blocks-list"
1832      }, items.map(function (item) {
1833        return Object(external_this_wp_element_["createElement"])(DownloadableBlockListItem, {
1834          key: item.id,
1835          onClick: function onClick() {
1836            installBlockType(item).then(function (success) {
1837              if (success) {
1838                onSelect(item);
1839              }
1840            });
1841            onHover(null);
1842          },
1843          item: item
1844        });
1845      }))
1846      /* eslint-enable jsx-a11y/no-redundant-roles */
1847  
1848    );
1849  }
1850  
1851  /* harmony default export */ var downloadable_blocks_list = (DownloadableBlocksList);
1852  
1853  // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-blocks-panel/index.js
1854  
1855  
1856  /**
1857   * WordPress dependencies
1858   */
1859  
1860  
1861  
1862  
1863  
1864  /**
1865   * Internal dependencies
1866   */
1867  
1868  
1869  
1870  function DownloadableBlocksPanel(_ref) {
1871    var downloadableItems = _ref.downloadableItems,
1872        onSelect = _ref.onSelect,
1873        onHover = _ref.onHover,
1874        hasPermission = _ref.hasPermission,
1875        isLoading = _ref.isLoading,
1876        isWaiting = _ref.isWaiting,
1877        debouncedSpeak = _ref.debouncedSpeak;
1878  
1879    if (!hasPermission) {
1880      debouncedSpeak(Object(external_this_wp_i18n_["__"])('No blocks found in your library. Please contact your site administrator to install new blocks.'));
1881      return Object(external_this_wp_element_["createElement"])("p", {
1882        className: "block-directory-downloadable-blocks-panel__description has-no-results"
1883      }, Object(external_this_wp_i18n_["__"])('No blocks found in your library.'), Object(external_this_wp_element_["createElement"])("br", null), Object(external_this_wp_i18n_["__"])('Please contact your site administrator to install new blocks.'));
1884    }
1885  
1886    if (isLoading || isWaiting) {
1887      return Object(external_this_wp_element_["createElement"])("p", {
1888        className: "block-directory-downloadable-blocks-panel__description has-no-results"
1889      }, Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Spinner"], null));
1890    }
1891  
1892    if (!downloadableItems.length) {
1893      return Object(external_this_wp_element_["createElement"])("p", {
1894        className: "block-directory-downloadable-blocks-panel__description has-no-results"
1895      }, Object(external_this_wp_i18n_["__"])('No blocks found in your library.'));
1896    }
1897  
1898    var resultsFoundMessage = Object(external_this_wp_i18n_["sprintf"])(
1899    /* translators: %s: number of available blocks. */
1900    Object(external_this_wp_i18n_["_n"])('No blocks found in your library. We did find %d block available for download.', 'No blocks found in your library. We did find %d blocks available for download.', downloadableItems.length), downloadableItems.length);
1901    debouncedSpeak(resultsFoundMessage);
1902    return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])("p", {
1903      className: "block-directory-downloadable-blocks-panel__description"
1904    }, Object(external_this_wp_i18n_["__"])('No blocks found in your library. These blocks can be downloaded and installed:')), Object(external_this_wp_element_["createElement"])(downloadable_blocks_list, {
1905      items: downloadableItems,
1906      onSelect: onSelect,
1907      onHover: onHover
1908    }));
1909  }
1910  
1911  /* harmony default export */ var downloadable_blocks_panel = (Object(external_this_wp_compose_["compose"])([external_this_wp_components_["withSpokenMessages"], Object(external_this_wp_data_["withSelect"])(function (select, _ref2) {
1912    var filterValue = _ref2.filterValue;
1913  
1914    var _select = select('core/block-directory'),
1915        getDownloadableBlocks = _select.getDownloadableBlocks,
1916        hasInstallBlocksPermission = _select.hasInstallBlocksPermission,
1917        isRequestingDownloadableBlocks = _select.isRequestingDownloadableBlocks;
1918  
1919    var hasPermission = hasInstallBlocksPermission();
1920    var downloadableItems = hasPermission ? getDownloadableBlocks(filterValue) : [];
1921    var isLoading = isRequestingDownloadableBlocks(filterValue);
1922    return {
1923      downloadableItems: downloadableItems,
1924      hasPermission: hasPermission,
1925      isLoading: isLoading
1926    };
1927  })])(DownloadableBlocksPanel));
1928  
1929  // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/plugins/inserter-menu-downloadable-blocks-panel/index.js
1930  
1931  
1932  
1933  /**
1934   * External dependencies
1935   */
1936  
1937  /**
1938   * WordPress dependencies
1939   */
1940  
1941  
1942  
1943  /**
1944   * Internal dependencies
1945   */
1946  
1947  
1948  
1949  function InserterMenuDownloadableBlocksPanel() {
1950    var _useState = Object(external_this_wp_element_["useState"])(''),
1951        _useState2 = Object(slicedToArray["a" /* default */])(_useState, 2),
1952        debouncedFilterValue = _useState2[0],
1953        setFilterValue = _useState2[1];
1954  
1955    var debouncedSetFilterValue = Object(external_this_lodash_["debounce"])(setFilterValue, 400);
1956    return Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["__experimentalInserterMenuExtension"], null, function (_ref) {
1957      var onSelect = _ref.onSelect,
1958          onHover = _ref.onHover,
1959          filterValue = _ref.filterValue,
1960          hasItems = _ref.hasItems;
1961  
1962      if (hasItems || !filterValue) {
1963        return null;
1964      }
1965  
1966      if (debouncedFilterValue !== filterValue) {
1967        debouncedSetFilterValue(filterValue);
1968      }
1969  
1970      return Object(external_this_wp_element_["createElement"])(downloadable_blocks_panel, {
1971        onSelect: onSelect,
1972        onHover: onHover,
1973        filterValue: debouncedFilterValue,
1974        isWaiting: filterValue !== debouncedFilterValue
1975      });
1976    });
1977  }
1978  
1979  /* harmony default export */ var inserter_menu_downloadable_blocks_panel = (InserterMenuDownloadableBlocksPanel);
1980  
1981  // EXTERNAL MODULE: external {"this":["wp","editPost"]}
1982  var external_this_wp_editPost_ = __webpack_require__(255);
1983  
1984  // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/compact-list/index.js
1985  
1986  
1987  /**
1988   * WordPress dependencies
1989   */
1990  
1991  /**
1992   * Internal dependencies
1993   */
1994  
1995  
1996  function CompactList(_ref) {
1997    var items = _ref.items;
1998  
1999    if (!items.length) {
2000      return null;
2001    }
2002  
2003    return Object(external_this_wp_element_["createElement"])("ul", {
2004      className: "block-directory-compact-list"
2005    }, items.map(function (_ref2) {
2006      var icon = _ref2.icon,
2007          id = _ref2.id,
2008          title = _ref2.title,
2009          author = _ref2.author;
2010      return Object(external_this_wp_element_["createElement"])("li", {
2011        key: id,
2012        className: "block-directory-compact-list__item"
2013      }, Object(external_this_wp_element_["createElement"])(downloadable_block_icon, {
2014        icon: icon,
2015        title: title
2016      }), Object(external_this_wp_element_["createElement"])("div", {
2017        className: "block-directory-compact-list__item-details"
2018      }, Object(external_this_wp_element_["createElement"])("div", {
2019        className: "block-directory-compact-list__item-title"
2020      }, title), Object(external_this_wp_element_["createElement"])("div", {
2021        className: "block-directory-compact-list__item-author"
2022      }, Object(external_this_wp_i18n_["sprintf"])(
2023      /* translators: %s: Name of the block author. */
2024      Object(external_this_wp_i18n_["__"])('By %s'), author))));
2025    }));
2026  }
2027  
2028  // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/plugins/installed-blocks-pre-publish-panel/index.js
2029  
2030  
2031  /**
2032   * WordPress dependencies
2033   */
2034  
2035  
2036  
2037  /**
2038   * Internal dependencies
2039   */
2040  
2041  
2042  function InstalledBlocksPrePublishPanel() {
2043    var newBlockTypes = Object(external_this_wp_data_["useSelect"])(function (select) {
2044      return select('core/block-directory').getNewBlockTypes();
2045    });
2046  
2047    if (!newBlockTypes.length) {
2048      return null;
2049    }
2050  
2051    return Object(external_this_wp_element_["createElement"])(external_this_wp_editPost_["PluginPrePublishPanel"], {
2052      icon: "block-default",
2053      title: Object(external_this_wp_i18n_["sprintf"])( // translators: %d: number of blocks (number).
2054      Object(external_this_wp_i18n_["_n"])('Added: %d block', 'Added: %d blocks', newBlockTypes.length), newBlockTypes.length),
2055      initialOpen: true
2056    }, Object(external_this_wp_element_["createElement"])("p", {
2057      className: "installed-blocks-pre-publish-panel__copy"
2058    }, Object(external_this_wp_i18n_["_n"])('The following block has been added to your site.', 'The following blocks have been added to your site.', newBlockTypes.length)), Object(external_this_wp_element_["createElement"])(CompactList, {
2059      items: newBlockTypes
2060    }));
2061  }
2062  
2063  // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/plugins/index.js
2064  
2065  
2066  /**
2067   * WordPress dependencies
2068   */
2069  
2070  /**
2071   * Internal dependencies
2072   */
2073  
2074  
2075  
2076  
2077  Object(external_this_wp_plugins_["registerPlugin"])('block-directory', {
2078    render: function render() {
2079      return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(AutoBlockUninstaller, null), Object(external_this_wp_element_["createElement"])(inserter_menu_downloadable_blocks_panel, null), Object(external_this_wp_element_["createElement"])(InstalledBlocksPrePublishPanel, null));
2080    }
2081  });
2082  
2083  // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/index.js
2084  /**
2085   * Internal dependencies
2086   */
2087  
2088  
2089  
2090  
2091  /***/ }),
2092  
2093  /***/ 5:
2094  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2095  
2096  "use strict";
2097  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _defineProperty; });
2098  function _defineProperty(obj, key, value) {
2099    if (key in obj) {
2100      Object.defineProperty(obj, key, {
2101        value: value,
2102        enumerable: true,
2103        configurable: true,
2104        writable: true
2105      });
2106    } else {
2107      obj[key] = value;
2108    }
2109  
2110    return obj;
2111  }
2112  
2113  /***/ }),
2114  
2115  /***/ 6:
2116  /***/ (function(module, exports) {
2117  
2118  (function() { module.exports = this["wp"]["primitives"]; }());
2119  
2120  /***/ }),
2121  
2122  /***/ 63:
2123  /***/ (function(module, exports) {
2124  
2125  (function() { module.exports = this["wp"]["plugins"]; }());
2126  
2127  /***/ }),
2128  
2129  /***/ 7:
2130  /***/ (function(module, exports) {
2131  
2132  (function() { module.exports = this["wp"]["blockEditor"]; }());
2133  
2134  /***/ }),
2135  
2136  /***/ 9:
2137  /***/ (function(module, exports) {
2138  
2139  (function() { module.exports = this["wp"]["compose"]; }());
2140  
2141  /***/ })
2142  
2143  /******/ });


Generated: Fri Jul 3 01:00:03 2020 Cross-referenced by PHPXref 0.7.1