this["wp"] = this["wp"] || {}; this["wp"]["blockDirectory"] = /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = "7f3f"); /******/ }) /************************************************************************/ /******/ ({ /***/ "//Lo": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId"); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9"); /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); /** * WordPress dependencies */ const blockDefault = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { d: "M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z" })); /* harmony default export */ __webpack_exports__["a"] = (blockDefault); /***/ }), /***/ "1ZqX": /***/ (function(module, exports) { (function() { module.exports = window["wp"]["data"]; }()); /***/ }), /***/ "7f3f": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, "store", function() { return /* reexport */ store; }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-directory/build-module/store/selectors.js var selectors_namespaceObject = {}; __webpack_require__.r(selectors_namespaceObject); __webpack_require__.d(selectors_namespaceObject, "isRequestingDownloadableBlocks", function() { return selectors_isRequestingDownloadableBlocks; }); __webpack_require__.d(selectors_namespaceObject, "getDownloadableBlocks", function() { return selectors_getDownloadableBlocks; }); __webpack_require__.d(selectors_namespaceObject, "getInstalledBlockTypes", function() { return getInstalledBlockTypes; }); __webpack_require__.d(selectors_namespaceObject, "getNewBlockTypes", function() { return getNewBlockTypes; }); __webpack_require__.d(selectors_namespaceObject, "getUnusedBlockTypes", function() { return getUnusedBlockTypes; }); __webpack_require__.d(selectors_namespaceObject, "isInstalling", function() { return selectors_isInstalling; }); __webpack_require__.d(selectors_namespaceObject, "getErrorNotices", function() { return getErrorNotices; }); __webpack_require__.d(selectors_namespaceObject, "getErrorNoticeForBlock", function() { return selectors_getErrorNoticeForBlock; }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-directory/build-module/store/actions.js var actions_namespaceObject = {}; __webpack_require__.r(actions_namespaceObject); __webpack_require__.d(actions_namespaceObject, "fetchDownloadableBlocks", function() { return fetchDownloadableBlocks; }); __webpack_require__.d(actions_namespaceObject, "receiveDownloadableBlocks", function() { return receiveDownloadableBlocks; }); __webpack_require__.d(actions_namespaceObject, "installBlockType", function() { return actions_installBlockType; }); __webpack_require__.d(actions_namespaceObject, "uninstallBlockType", function() { return actions_uninstallBlockType; }); __webpack_require__.d(actions_namespaceObject, "addInstalledBlockType", function() { return addInstalledBlockType; }); __webpack_require__.d(actions_namespaceObject, "removeInstalledBlockType", function() { return removeInstalledBlockType; }); __webpack_require__.d(actions_namespaceObject, "setIsInstalling", function() { return setIsInstalling; }); __webpack_require__.d(actions_namespaceObject, "setErrorNotice", function() { return setErrorNotice; }); __webpack_require__.d(actions_namespaceObject, "clearErrorNotice", function() { return clearErrorNotice; }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-directory/build-module/store/resolvers.js var resolvers_namespaceObject = {}; __webpack_require__.r(resolvers_namespaceObject); __webpack_require__.d(resolvers_namespaceObject, "getDownloadableBlocks", function() { return resolvers_getDownloadableBlocks; }); // EXTERNAL MODULE: external ["wp","element"] var external_wp_element_ = __webpack_require__("GRId"); // EXTERNAL MODULE: external ["wp","plugins"] var external_wp_plugins_ = __webpack_require__("TvNi"); // EXTERNAL MODULE: external ["wp","hooks"] var external_wp_hooks_ = __webpack_require__("g56x"); // EXTERNAL MODULE: external ["wp","blocks"] var external_wp_blocks_ = __webpack_require__("HSyU"); // EXTERNAL MODULE: external ["wp","data"] var external_wp_data_ = __webpack_require__("1ZqX"); // EXTERNAL MODULE: external ["wp","editor"] var external_wp_editor_ = __webpack_require__("jSdM"); // EXTERNAL MODULE: external "lodash" var external_lodash_ = __webpack_require__("YLtl"); // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/reducer.js /** * External dependencies */ /** * WordPress dependencies */ /** * Reducer returning an array of downloadable blocks. * * @param {Object} state Current state. * @param {Object} action Dispatched action. * * @return {Object} Updated state. */ const downloadableBlocks = (state = {}, action) => { switch (action.type) { case 'FETCH_DOWNLOADABLE_BLOCKS': return { ...state, [action.filterValue]: { isRequesting: true } }; case 'RECEIVE_DOWNLOADABLE_BLOCKS': return { ...state, [action.filterValue]: { results: action.downloadableBlocks, isRequesting: false } }; } return state; }; /** * Reducer managing the installation and deletion of blocks. * * @param {Object} state Current state. * @param {Object} action Dispatched action. * * @return {Object} Updated state. */ const blockManagement = (state = { installedBlockTypes: [], isInstalling: {} }, action) => { switch (action.type) { case 'ADD_INSTALLED_BLOCK_TYPE': return { ...state, installedBlockTypes: [...state.installedBlockTypes, action.item] }; case 'REMOVE_INSTALLED_BLOCK_TYPE': return { ...state, installedBlockTypes: state.installedBlockTypes.filter(blockType => blockType.name !== action.item.name) }; case 'SET_INSTALLING_BLOCK': return { ...state, isInstalling: { ...state.isInstalling, [action.blockId]: action.isInstalling } }; } return state; }; /** * Reducer returning an object of error notices. * * @param {Object} state Current state. * @param {Object} action Dispatched action. * * @return {Object} Updated state. */ const errorNotices = (state = {}, action) => { switch (action.type) { case 'SET_ERROR_NOTICE': return { ...state, [action.blockId]: { message: action.message, isFatal: action.isFatal } }; case 'CLEAR_ERROR_NOTICE': return Object(external_lodash_["omit"])(state, action.blockId); } return state; }; /* harmony default export */ var reducer = (Object(external_wp_data_["combineReducers"])({ downloadableBlocks, blockManagement, errorNotices })); // EXTERNAL MODULE: external ["wp","blockEditor"] var external_wp_blockEditor_ = __webpack_require__("axFQ"); // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/utils/has-block-type.js /** * Check if a block list contains a specific block type. Recursively searches * through `innerBlocks` if they exist. * * @param {Object} blockType A block object to search for. * @param {Object[]} blocks The list of blocks to look through. * * @return {boolean} Whether the blockType is found. */ function hasBlockType(blockType, blocks = []) { if (!blocks.length) { return false; } if (blocks.some(({ name }) => name === blockType.name)) { return true; } for (let i = 0; i < blocks.length; i++) { if (hasBlockType(blockType, blocks[i].innerBlocks)) { return true; } } return false; } // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/selectors.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Returns true if application is requesting for downloadable blocks. * * @param {Object} state Global application state. * @param {string} filterValue Search string. * * @return {boolean} Whether a request is in progress for the blocks list. */ function selectors_isRequestingDownloadableBlocks(state, filterValue) { var _state$downloadableBl, _state$downloadableBl2; return (_state$downloadableBl = (_state$downloadableBl2 = state.downloadableBlocks[filterValue]) === null || _state$downloadableBl2 === void 0 ? void 0 : _state$downloadableBl2.isRequesting) !== null && _state$downloadableBl !== void 0 ? _state$downloadableBl : false; } /** * Returns the available uninstalled blocks. * * @param {Object} state Global application state. * @param {string} filterValue Search string. * * @return {Array} Downloadable blocks. */ function selectors_getDownloadableBlocks(state, filterValue) { var _state$downloadableBl3, _state$downloadableBl4; return (_state$downloadableBl3 = (_state$downloadableBl4 = state.downloadableBlocks[filterValue]) === null || _state$downloadableBl4 === void 0 ? void 0 : _state$downloadableBl4.results) !== null && _state$downloadableBl3 !== void 0 ? _state$downloadableBl3 : []; } /** * Returns the block types that have been installed on the server in this * session. * * @param {Object} state Global application state. * * @return {Array} Block type items */ function getInstalledBlockTypes(state) { return state.blockManagement.installedBlockTypes; } /** * Returns block types that have been installed on the server and used in the * current post. * * @param {Object} state Global application state. * * @return {Array} Block type items. */ const getNewBlockTypes = Object(external_wp_data_["createRegistrySelector"])(select => state => { const usedBlockTree = select(external_wp_blockEditor_["store"]).getBlocks(); const installedBlockTypes = getInstalledBlockTypes(state); return installedBlockTypes.filter(blockType => hasBlockType(blockType, usedBlockTree)); }); /** * Returns the block types that have been installed on the server but are not * used in the current post. * * @param {Object} state Global application state. * * @return {Array} Block type items. */ const getUnusedBlockTypes = Object(external_wp_data_["createRegistrySelector"])(select => state => { const usedBlockTree = select(external_wp_blockEditor_["store"]).getBlocks(); const installedBlockTypes = getInstalledBlockTypes(state); return installedBlockTypes.filter(blockType => !hasBlockType(blockType, usedBlockTree)); }); /** * Returns true if a block plugin install is in progress. * * @param {Object} state Global application state. * @param {string} blockId Id of the block. * * @return {boolean} Whether this block is currently being installed. */ function selectors_isInstalling(state, blockId) { return state.blockManagement.isInstalling[blockId] || false; } /** * Returns all block error notices. * * @param {Object} state Global application state. * * @return {Object} Object with error notices. */ function getErrorNotices(state) { return state.errorNotices; } /** * Returns the error notice for a given block. * * @param {Object} state Global application state. * @param {string} blockId The ID of the block plugin. eg: my-block * * @return {string|boolean} The error text, or false if no error. */ function selectors_getErrorNoticeForBlock(state, blockId) { return state.errorNotices[blockId]; } // EXTERNAL MODULE: external ["wp","i18n"] var external_wp_i18n_ = __webpack_require__("l3Sj"); // EXTERNAL MODULE: external ["wp","apiFetch"] var external_wp_apiFetch_ = __webpack_require__("ywyh"); var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_); // EXTERNAL MODULE: external ["wp","notices"] var external_wp_notices_ = __webpack_require__("onLe"); // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/load-assets.js /** * WordPress dependencies */ /** * Load an asset for a block. * * This function returns a Promise that will resolve once the asset is loaded, * or in the case of Stylesheets and Inline JavaScript, will resolve immediately. * * @param {HTMLElement} el A HTML Element asset to inject. * * @return {Promise} Promise which will resolve when the asset is loaded. */ const loadAsset = el => { return new Promise((resolve, reject) => { /* * Reconstruct the passed element, this is required as inserting the Node directly * won't always fire the required onload events, even if the asset wasn't already loaded. */ const newNode = document.createElement(el.nodeName); ['id', 'rel', 'src', 'href', 'type'].forEach(attr => { if (el[attr]) { newNode[attr] = el[attr]; } }); // Append inline