From 5bf66662a9bdd62c5bccab15e607cd95cfb8fcab Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Mon, 27 Jul 2020 10:05:23 +0200 Subject: Removed wordpress and phpmyadmin, my server doesn't handle it well and it brings shame on my familly --- srcs/wordpress/wp-includes/js/dist/data.js | 4529 ---------------------------- 1 file changed, 4529 deletions(-) delete mode 100644 srcs/wordpress/wp-includes/js/dist/data.js (limited to 'srcs/wordpress/wp-includes/js/dist/data.js') diff --git a/srcs/wordpress/wp-includes/js/dist/data.js b/srcs/wordpress/wp-includes/js/dist/data.js deleted file mode 100644 index c2706b3..0000000 --- a/srcs/wordpress/wp-includes/js/dist/data.js +++ /dev/null @@ -1,4529 +0,0 @@ -this["wp"] = this["wp"] || {}; this["wp"]["data"] = -/******/ (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 = 348); -/******/ }) -/************************************************************************/ -/******/ ({ - -/***/ 0: -/***/ (function(module, exports) { - -(function() { module.exports = this["wp"]["element"]; }()); - -/***/ }), - -/***/ 10: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _defineProperty; }); -function _defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - - return obj; -} - -/***/ }), - -/***/ 111: -/***/ (function(module, exports) { - -function combineReducers( reducers ) { - var keys = Object.keys( reducers ), - getNextState; - - getNextState = ( function() { - var fn, i, key; - - fn = 'return {'; - for ( i = 0; i < keys.length; i++ ) { - // Rely on Quoted escaping of JSON.stringify with guarantee that - // each member of Object.keys is a string. - // - // "If Type(value) is String, then return the result of calling the - // abstract operation Quote with argument value. [...] The abstract - // operation Quote(value) wraps a String value in double quotes and - // escapes characters within it." - // - // https://www.ecma-international.org/ecma-262/5.1/#sec-15.12.3 - key = JSON.stringify( keys[ i ] ); - - fn += key + ':r[' + key + '](s[' + key + '],a),'; - } - fn += '}'; - - return new Function( 'r,s,a', fn ); - } )(); - - return function combinedReducer( state, action ) { - var nextState, i, key; - - // Assumed changed if initial state. - if ( state === undefined ) { - return getNextState( reducers, {}, action ); - } - - nextState = getNextState( reducers, state, action ); - - // Determine whether state has changed. - i = keys.length; - while ( i-- ) { - key = keys[ i ]; - if ( state[ key ] !== nextState[ key ] ) { - // Return immediately if a changed value is encountered. - return nextState; - } - } - - return state; - }; -} - -module.exports = combineReducers; - - -/***/ }), - -/***/ 145: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(global, module) {/* harmony import */ var _ponyfill_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(229); -/* global window */ - - -var root; - -if (typeof self !== 'undefined') { - root = self; -} else if (typeof window !== 'undefined') { - root = window; -} else if (typeof global !== 'undefined') { - root = global; -} else if (true) { - root = module; -} else {} - -var result = Object(_ponyfill_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(root); -/* harmony default export */ __webpack_exports__["a"] = (result); - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(65), __webpack_require__(318)(module))) - -/***/ }), - -/***/ 17: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - -// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js -function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) { - for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { - arr2[i] = arr[i]; - } - - return arr2; - } -} -// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js -var iterableToArray = __webpack_require__(30); - -// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js -function _nonIterableSpread() { - throw new TypeError("Invalid attempt to spread non-iterable instance"); -} -// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _toConsumableArray; }); - - - -function _toConsumableArray(arr) { - return _arrayWithoutHoles(arr) || Object(iterableToArray["a" /* default */])(arr) || _nonIterableSpread(); -} - -/***/ }), - -/***/ 18: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _extends; }); -function _extends() { - _extends = Object.assign || function (target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } - } - } - - return target; - }; - - return _extends.apply(this, arguments); -} - -/***/ }), - -/***/ 2: -/***/ (function(module, exports) { - -(function() { module.exports = this["lodash"]; }()); - -/***/ }), - -/***/ 20: -/***/ (function(module, exports, __webpack_require__) { - -module.exports = __webpack_require__(47); - - -/***/ }), - -/***/ 228: -/***/ (function(module, exports) { - -(function() { module.exports = this["wp"]["reduxRoutine"]; }()); - -/***/ }), - -/***/ 229: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return symbolObservablePonyfill; }); -function symbolObservablePonyfill(root) { - var result; - var Symbol = root.Symbol; - - if (typeof Symbol === 'function') { - if (Symbol.observable) { - result = Symbol.observable; - } else { - result = Symbol('observable'); - Symbol.observable = result; - } - } else { - result = '@@observable'; - } - - return result; -}; - - -/***/ }), - -/***/ 23: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - -// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js -var arrayWithHoles = __webpack_require__(38); - -// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js -function _iterableToArrayLimit(arr, i) { - var _arr = []; - var _n = true; - var _d = false; - var _e = undefined; - - try { - for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { - _arr.push(_s.value); - - if (i && _arr.length === i) break; - } - } catch (err) { - _d = true; - _e = err; - } finally { - try { - if (!_n && _i["return"] != null) _i["return"](); - } finally { - if (_d) throw _e; - } - } - - return _arr; -} -// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js -var nonIterableRest = __webpack_require__(39); - -// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _slicedToArray; }); - - - -function _slicedToArray(arr, i) { - return Object(arrayWithHoles["a" /* default */])(arr) || _iterableToArrayLimit(arr, i) || Object(nonIterableRest["a" /* default */])(); -} - -/***/ }), - -/***/ 230: -/***/ (function(module, exports) { - -(function() { module.exports = this["wp"]["priorityQueue"]; }()); - -/***/ }), - -/***/ 30: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _iterableToArray; }); -function _iterableToArray(iter) { - if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); -} - -/***/ }), - -/***/ 318: -/***/ (function(module, exports) { - -module.exports = function(originalModule) { - if (!originalModule.webpackPolyfill) { - var module = Object.create(originalModule); - // module.parent = undefined by default - if (!module.children) module.children = []; - Object.defineProperty(module, "loaded", { - enumerable: true, - get: function() { - return module.l; - } - }); - Object.defineProperty(module, "id", { - enumerable: true, - get: function() { - return module.i; - } - }); - Object.defineProperty(module, "exports", { - enumerable: true - }); - module.webpackPolyfill = 1; - } - return module; -}; - - -/***/ }), - -/***/ 348: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -var selectors_namespaceObject = {}; -__webpack_require__.r(selectors_namespaceObject); -__webpack_require__.d(selectors_namespaceObject, "getIsResolving", function() { return getIsResolving; }); -__webpack_require__.d(selectors_namespaceObject, "hasStartedResolution", function() { return hasStartedResolution; }); -__webpack_require__.d(selectors_namespaceObject, "hasFinishedResolution", function() { return hasFinishedResolution; }); -__webpack_require__.d(selectors_namespaceObject, "isResolving", function() { return isResolving; }); -__webpack_require__.d(selectors_namespaceObject, "getCachedResolvers", function() { return getCachedResolvers; }); -var actions_namespaceObject = {}; -__webpack_require__.r(actions_namespaceObject); -__webpack_require__.d(actions_namespaceObject, "startResolution", function() { return startResolution; }); -__webpack_require__.d(actions_namespaceObject, "finishResolution", function() { return finishResolution; }); -__webpack_require__.d(actions_namespaceObject, "invalidateResolution", function() { return invalidateResolution; }); -__webpack_require__.d(actions_namespaceObject, "invalidateResolutionForStore", function() { return invalidateResolutionForStore; }); -__webpack_require__.d(actions_namespaceObject, "invalidateResolutionForStoreSelector", function() { return invalidateResolutionForStoreSelector; }); -var plugins_namespaceObject = {}; -__webpack_require__.r(plugins_namespaceObject); -__webpack_require__.d(plugins_namespaceObject, "controls", function() { return controls; }); -__webpack_require__.d(plugins_namespaceObject, "persistence", function() { return plugins_persistence; }); - -// EXTERNAL MODULE: ./node_modules/turbo-combine-reducers/index.js -var turbo_combine_reducers = __webpack_require__(111); -var turbo_combine_reducers_default = /*#__PURE__*/__webpack_require__.n(turbo_combine_reducers); - -// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules -var slicedToArray = __webpack_require__(23); - -// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread.js -var objectSpread = __webpack_require__(7); - -// EXTERNAL MODULE: external "lodash" -var external_lodash_ = __webpack_require__(2); - -// EXTERNAL MODULE: ./node_modules/@babel/runtime/regenerator/index.js -var regenerator = __webpack_require__(20); -var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator); - -// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js -var asyncToGenerator = __webpack_require__(43); - -// EXTERNAL MODULE: ./node_modules/symbol-observable/es/index.js -var es = __webpack_require__(145); - -// CONCATENATED MODULE: ./node_modules/redux/es/redux.js - - -/** - * These are private action types reserved by Redux. - * For any unknown actions, you must return the current state. - * If the current state is undefined, you must return the initial state. - * Do not reference these action types directly in your code. - */ -var randomString = function randomString() { - return Math.random().toString(36).substring(7).split('').join('.'); -}; - -var ActionTypes = { - INIT: "@@redux/INIT" + randomString(), - REPLACE: "@@redux/REPLACE" + randomString(), - PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() { - return "@@redux/PROBE_UNKNOWN_ACTION" + randomString(); - } -}; - -/** - * @param {any} obj The object to inspect. - * @returns {boolean} True if the argument appears to be a plain object. - */ -function isPlainObject(obj) { - if (typeof obj !== 'object' || obj === null) return false; - var proto = obj; - - while (Object.getPrototypeOf(proto) !== null) { - proto = Object.getPrototypeOf(proto); - } - - return Object.getPrototypeOf(obj) === proto; -} - -/** - * Creates a Redux store that holds the state tree. - * The only way to change the data in the store is to call `dispatch()` on it. - * - * There should only be a single store in your app. To specify how different - * parts of the state tree respond to actions, you may combine several reducers - * into a single reducer function by using `combineReducers`. - * - * @param {Function} reducer A function that returns the next state tree, given - * the current state tree and the action to handle. - * - * @param {any} [preloadedState] The initial state. You may optionally specify it - * to hydrate the state from the server in universal apps, or to restore a - * previously serialized user session. - * If you use `combineReducers` to produce the root reducer function, this must be - * an object with the same shape as `combineReducers` keys. - * - * @param {Function} [enhancer] The store enhancer. You may optionally specify it - * to enhance the store with third-party capabilities such as middleware, - * time travel, persistence, etc. The only store enhancer that ships with Redux - * is `applyMiddleware()`. - * - * @returns {Store} A Redux store that lets you read the state, dispatch actions - * and subscribe to changes. - */ - -function createStore(reducer, preloadedState, enhancer) { - var _ref2; - - if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') { - throw new Error('It looks like you are passing several store enhancers to ' + 'createStore(). This is not supported. Instead, compose them ' + 'together to a single function.'); - } - - if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') { - enhancer = preloadedState; - preloadedState = undefined; - } - - if (typeof enhancer !== 'undefined') { - if (typeof enhancer !== 'function') { - throw new Error('Expected the enhancer to be a function.'); - } - - return enhancer(createStore)(reducer, preloadedState); - } - - if (typeof reducer !== 'function') { - throw new Error('Expected the reducer to be a function.'); - } - - var currentReducer = reducer; - var currentState = preloadedState; - var currentListeners = []; - var nextListeners = currentListeners; - var isDispatching = false; - /** - * This makes a shallow copy of currentListeners so we can use - * nextListeners as a temporary list while dispatching. - * - * This prevents any bugs around consumers calling - * subscribe/unsubscribe in the middle of a dispatch. - */ - - function ensureCanMutateNextListeners() { - if (nextListeners === currentListeners) { - nextListeners = currentListeners.slice(); - } - } - /** - * Reads the state tree managed by the store. - * - * @returns {any} The current state tree of your application. - */ - - - function getState() { - if (isDispatching) { - throw new Error('You may not call store.getState() while the reducer is executing. ' + 'The reducer has already received the state as an argument. ' + 'Pass it down from the top reducer instead of reading it from the store.'); - } - - return currentState; - } - /** - * Adds a change listener. It will be called any time an action is dispatched, - * and some part of the state tree may potentially have changed. You may then - * call `getState()` to read the current state tree inside the callback. - * - * You may call `dispatch()` from a change listener, with the following - * caveats: - * - * 1. The subscriptions are snapshotted just before every `dispatch()` call. - * If you subscribe or unsubscribe while the listeners are being invoked, this - * will not have any effect on the `dispatch()` that is currently in progress. - * However, the next `dispatch()` call, whether nested or not, will use a more - * recent snapshot of the subscription list. - * - * 2. The listener should not expect to see all state changes, as the state - * might have been updated multiple times during a nested `dispatch()` before - * the listener is called. It is, however, guaranteed that all subscribers - * registered before the `dispatch()` started will be called with the latest - * state by the time it exits. - * - * @param {Function} listener A callback to be invoked on every dispatch. - * @returns {Function} A function to remove this change listener. - */ - - - function subscribe(listener) { - if (typeof listener !== 'function') { - throw new Error('Expected the listener to be a function.'); - } - - if (isDispatching) { - throw new Error('You may not call store.subscribe() while the reducer is executing. ' + 'If you would like to be notified after the store has been updated, subscribe from a ' + 'component and invoke store.getState() in the callback to access the latest state. ' + 'See https://redux.js.org/api-reference/store#subscribe(listener) for more details.'); - } - - var isSubscribed = true; - ensureCanMutateNextListeners(); - nextListeners.push(listener); - return function unsubscribe() { - if (!isSubscribed) { - return; - } - - if (isDispatching) { - throw new Error('You may not unsubscribe from a store listener while the reducer is executing. ' + 'See https://redux.js.org/api-reference/store#subscribe(listener) for more details.'); - } - - isSubscribed = false; - ensureCanMutateNextListeners(); - var index = nextListeners.indexOf(listener); - nextListeners.splice(index, 1); - }; - } - /** - * Dispatches an action. It is the only way to trigger a state change. - * - * The `reducer` function, used to create the store, will be called with the - * current state tree and the given `action`. Its return value will - * be considered the **next** state of the tree, and the change listeners - * will be notified. - * - * The base implementation only supports plain object actions. If you want to - * dispatch a Promise, an Observable, a thunk, or something else, you need to - * wrap your store creating function into the corresponding middleware. For - * example, see the documentation for the `redux-thunk` package. Even the - * middleware will eventually dispatch plain object actions using this method. - * - * @param {Object} action A plain object representing “what changed”. It is - * a good idea to keep actions serializable so you can record and replay user - * sessions, or use the time travelling `redux-devtools`. An action must have - * a `type` property which may not be `undefined`. It is a good idea to use - * string constants for action types. - * - * @returns {Object} For convenience, the same action object you dispatched. - * - * Note that, if you use a custom middleware, it may wrap `dispatch()` to - * return something else (for example, a Promise you can await). - */ - - - function dispatch(action) { - if (!isPlainObject(action)) { - throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.'); - } - - if (typeof action.type === 'undefined') { - throw new Error('Actions may not have an undefined "type" property. ' + 'Have you misspelled a constant?'); - } - - if (isDispatching) { - throw new Error('Reducers may not dispatch actions.'); - } - - try { - isDispatching = true; - currentState = currentReducer(currentState, action); - } finally { - isDispatching = false; - } - - var listeners = currentListeners = nextListeners; - - for (var i = 0; i < listeners.length; i++) { - var listener = listeners[i]; - listener(); - } - - return action; - } - /** - * Replaces the reducer currently used by the store to calculate the state. - * - * You might need this if your app implements code splitting and you want to - * load some of the reducers dynamically. You might also need this if you - * implement a hot reloading mechanism for Redux. - * - * @param {Function} nextReducer The reducer for the store to use instead. - * @returns {void} - */ - - - function replaceReducer(nextReducer) { - if (typeof nextReducer !== 'function') { - throw new Error('Expected the nextReducer to be a function.'); - } - - currentReducer = nextReducer; // This action has a similiar effect to ActionTypes.INIT. - // Any reducers that existed in both the new and old rootReducer - // will receive the previous state. This effectively populates - // the new state tree with any relevant data from the old one. - - dispatch({ - type: ActionTypes.REPLACE - }); - } - /** - * Interoperability point for observable/reactive libraries. - * @returns {observable} A minimal observable of state changes. - * For more information, see the observable proposal: - * https://github.com/tc39/proposal-observable - */ - - - function observable() { - var _ref; - - var outerSubscribe = subscribe; - return _ref = { - /** - * The minimal observable subscription method. - * @param {Object} observer Any object that can be used as an observer. - * The observer object should have a `next` method. - * @returns {subscription} An object with an `unsubscribe` method that can - * be used to unsubscribe the observable from the store, and prevent further - * emission of values from the observable. - */ - subscribe: function subscribe(observer) { - if (typeof observer !== 'object' || observer === null) { - throw new TypeError('Expected the observer to be an object.'); - } - - function observeState() { - if (observer.next) { - observer.next(getState()); - } - } - - observeState(); - var unsubscribe = outerSubscribe(observeState); - return { - unsubscribe: unsubscribe - }; - } - }, _ref[es["a" /* default */]] = function () { - return this; - }, _ref; - } // When a store is created, an "INIT" action is dispatched so that every - // reducer returns their initial state. This effectively populates - // the initial state tree. - - - dispatch({ - type: ActionTypes.INIT - }); - return _ref2 = { - dispatch: dispatch, - subscribe: subscribe, - getState: getState, - replaceReducer: replaceReducer - }, _ref2[es["a" /* default */]] = observable, _ref2; -} - -/** - * Prints a warning in the console if it exists. - * - * @param {String} message The warning message. - * @returns {void} - */ -function warning(message) { - /* eslint-disable no-console */ - if (typeof console !== 'undefined' && typeof console.error === 'function') { - console.error(message); - } - /* eslint-enable no-console */ - - - try { - // This error was thrown as a convenience so that if you enable - // "break on all exceptions" in your console, - // it would pause the execution at this line. - throw new Error(message); - } catch (e) {} // eslint-disable-line no-empty - -} - -function getUndefinedStateErrorMessage(key, action) { - var actionType = action && action.type; - var actionDescription = actionType && "action \"" + String(actionType) + "\"" || 'an action'; - return "Given " + actionDescription + ", reducer \"" + key + "\" returned undefined. " + "To ignore an action, you must explicitly return the previous state. " + "If you want this reducer to hold no value, you can return null instead of undefined."; -} - -function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) { - var reducerKeys = Object.keys(reducers); - var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer'; - - if (reducerKeys.length === 0) { - return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.'; - } - - if (!isPlainObject(inputState)) { - return "The " + argumentName + " has unexpected type of \"" + {}.toString.call(inputState).match(/\s([a-z|A-Z]+)/)[1] + "\". Expected argument to be an object with the following " + ("keys: \"" + reducerKeys.join('", "') + "\""); - } - - var unexpectedKeys = Object.keys(inputState).filter(function (key) { - return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key]; - }); - unexpectedKeys.forEach(function (key) { - unexpectedKeyCache[key] = true; - }); - if (action && action.type === ActionTypes.REPLACE) return; - - if (unexpectedKeys.length > 0) { - return "Unexpected " + (unexpectedKeys.length > 1 ? 'keys' : 'key') + " " + ("\"" + unexpectedKeys.join('", "') + "\" found in " + argumentName + ". ") + "Expected to find one of the known reducer keys instead: " + ("\"" + reducerKeys.join('", "') + "\". Unexpected keys will be ignored."); - } -} - -function assertReducerShape(reducers) { - Object.keys(reducers).forEach(function (key) { - var reducer = reducers[key]; - var initialState = reducer(undefined, { - type: ActionTypes.INIT - }); - - if (typeof initialState === 'undefined') { - throw new Error("Reducer \"" + key + "\" returned undefined during initialization. " + "If the state passed to the reducer is undefined, you must " + "explicitly return the initial state. The initial state may " + "not be undefined. If you don't want to set a value for this reducer, " + "you can use null instead of undefined."); - } - - if (typeof reducer(undefined, { - type: ActionTypes.PROBE_UNKNOWN_ACTION() - }) === 'undefined') { - throw new Error("Reducer \"" + key + "\" returned undefined when probed with a random type. " + ("Don't try to handle " + ActionTypes.INIT + " or other actions in \"redux/*\" ") + "namespace. They are considered private. Instead, you must return the " + "current state for any unknown actions, unless it is undefined, " + "in which case you must return the initial state, regardless of the " + "action type. The initial state may not be undefined, but can be null."); - } - }); -} -/** - * Turns an object whose values are different reducer functions, into a single - * reducer function. It will call every child reducer, and gather their results - * into a single state object, whose keys correspond to the keys of the passed - * reducer functions. - * - * @param {Object} reducers An object whose values correspond to different - * reducer functions that need to be combined into one. One handy way to obtain - * it is to use ES6 `import * as reducers` syntax. The reducers may never return - * undefined for any action. Instead, they should return their initial state - * if the state passed to them was undefined, and the current state for any - * unrecognized action. - * - * @returns {Function} A reducer function that invokes every reducer inside the - * passed object, and builds a state object with the same shape. - */ - - -function combineReducers(reducers) { - var reducerKeys = Object.keys(reducers); - var finalReducers = {}; - - for (var i = 0; i < reducerKeys.length; i++) { - var key = reducerKeys[i]; - - if (false) {} - - if (typeof reducers[key] === 'function') { - finalReducers[key] = reducers[key]; - } - } - - var finalReducerKeys = Object.keys(finalReducers); // This is used to make sure we don't warn about the same - // keys multiple times. - - var unexpectedKeyCache; - - if (false) {} - - var shapeAssertionError; - - try { - assertReducerShape(finalReducers); - } catch (e) { - shapeAssertionError = e; - } - - return function combination(state, action) { - if (state === void 0) { - state = {}; - } - - if (shapeAssertionError) { - throw shapeAssertionError; - } - - if (false) { var warningMessage; } - - var hasChanged = false; - var nextState = {}; - - for (var _i = 0; _i < finalReducerKeys.length; _i++) { - var _key = finalReducerKeys[_i]; - var reducer = finalReducers[_key]; - var previousStateForKey = state[_key]; - var nextStateForKey = reducer(previousStateForKey, action); - - if (typeof nextStateForKey === 'undefined') { - var errorMessage = getUndefinedStateErrorMessage(_key, action); - throw new Error(errorMessage); - } - - nextState[_key] = nextStateForKey; - hasChanged = hasChanged || nextStateForKey !== previousStateForKey; - } - - return hasChanged ? nextState : state; - }; -} - -function bindActionCreator(actionCreator, dispatch) { - return function () { - return dispatch(actionCreator.apply(this, arguments)); - }; -} -/** - * Turns an object whose values are action creators, into an object with the - * same keys, but with every function wrapped into a `dispatch` call so they - * may be invoked directly. This is just a convenience method, as you can call - * `store.dispatch(MyActionCreators.doSomething())` yourself just fine. - * - * For convenience, you can also pass an action creator as the first argument, - * and get a dispatch wrapped function in return. - * - * @param {Function|Object} actionCreators An object whose values are action - * creator functions. One handy way to obtain it is to use ES6 `import * as` - * syntax. You may also pass a single function. - * - * @param {Function} dispatch The `dispatch` function available on your Redux - * store. - * - * @returns {Function|Object} The object mimicking the original object, but with - * every action creator wrapped into the `dispatch` call. If you passed a - * function as `actionCreators`, the return value will also be a single - * function. - */ - - -function bindActionCreators(actionCreators, dispatch) { - if (typeof actionCreators === 'function') { - return bindActionCreator(actionCreators, dispatch); - } - - if (typeof actionCreators !== 'object' || actionCreators === null) { - throw new Error("bindActionCreators expected an object or a function, instead received " + (actionCreators === null ? 'null' : typeof actionCreators) + ". " + "Did you write \"import ActionCreators from\" instead of \"import * as ActionCreators from\"?"); - } - - var boundActionCreators = {}; - - for (var key in actionCreators) { - var actionCreator = actionCreators[key]; - - if (typeof actionCreator === 'function') { - boundActionCreators[key] = bindActionCreator(actionCreator, dispatch); - } - } - - return boundActionCreators; -} - -function _defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - - return obj; -} - -function ownKeys(object, enumerableOnly) { - var keys = Object.keys(object); - - if (Object.getOwnPropertySymbols) { - keys.push.apply(keys, Object.getOwnPropertySymbols(object)); - } - - if (enumerableOnly) keys = keys.filter(function (sym) { - return Object.getOwnPropertyDescriptor(object, sym).enumerable; - }); - return keys; -} - -function _objectSpread2(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] != null ? arguments[i] : {}; - - if (i % 2) { - ownKeys(source, true).forEach(function (key) { - _defineProperty(target, key, source[key]); - }); - } else if (Object.getOwnPropertyDescriptors) { - Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); - } else { - ownKeys(source).forEach(function (key) { - Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); - }); - } - } - - return target; -} - -/** - * Composes single-argument functions from right to left. The rightmost - * function can take multiple arguments as it provides the signature for - * the resulting composite function. - * - * @param {...Function} funcs The functions to compose. - * @returns {Function} A function obtained by composing the argument functions - * from right to left. For example, compose(f, g, h) is identical to doing - * (...args) => f(g(h(...args))). - */ -function compose() { - for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) { - funcs[_key] = arguments[_key]; - } - - if (funcs.length === 0) { - return function (arg) { - return arg; - }; - } - - if (funcs.length === 1) { - return funcs[0]; - } - - return funcs.reduce(function (a, b) { - return function () { - return a(b.apply(void 0, arguments)); - }; - }); -} - -/** - * Creates a store enhancer that applies middleware to the dispatch method - * of the Redux store. This is handy for a variety of tasks, such as expressing - * asynchronous actions in a concise manner, or logging every action payload. - * - * See `redux-thunk` package as an example of the Redux middleware. - * - * Because middleware is potentially asynchronous, this should be the first - * store enhancer in the composition chain. - * - * Note that each middleware will be given the `dispatch` and `getState` functions - * as named arguments. - * - * @param {...Function} middlewares The middleware chain to be applied. - * @returns {Function} A store enhancer applying the middleware. - */ - -function applyMiddleware() { - for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) { - middlewares[_key] = arguments[_key]; - } - - return function (createStore) { - return function () { - var store = createStore.apply(void 0, arguments); - - var _dispatch = function dispatch() { - throw new Error('Dispatching while constructing your middleware is not allowed. ' + 'Other middleware would not be applied to this dispatch.'); - }; - - var middlewareAPI = { - getState: store.getState, - dispatch: function dispatch() { - return _dispatch.apply(void 0, arguments); - } - }; - var chain = middlewares.map(function (middleware) { - return middleware(middlewareAPI); - }); - _dispatch = compose.apply(void 0, chain)(store.dispatch); - return _objectSpread2({}, store, { - dispatch: _dispatch - }); - }; - }; -} - -/* - * This is a dummy function to check if the function name has been altered by minification. - * If the function has been minified and NODE_ENV !== 'production', warn the user. - */ - -function isCrushed() {} - -if (false) {} - - - -// EXTERNAL MODULE: external {"this":["wp","reduxRoutine"]} -var external_this_wp_reduxRoutine_ = __webpack_require__(228); -var external_this_wp_reduxRoutine_default = /*#__PURE__*/__webpack_require__.n(external_this_wp_reduxRoutine_); - -// EXTERNAL MODULE: ./node_modules/is-promise/index.js -var is_promise = __webpack_require__(98); -var is_promise_default = /*#__PURE__*/__webpack_require__.n(is_promise); - -// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/promise-middleware.js -/** - * External dependencies - */ - -/** - * Simplest possible promise redux middleware. - * - * @return {Function} middleware. - */ - -var promise_middleware_promiseMiddleware = function promiseMiddleware() { - return function (next) { - return function (action) { - if (is_promise_default()(action)) { - return action.then(function (resolvedAction) { - if (resolvedAction) { - return next(resolvedAction); - } - }); - } - - return next(action); - }; - }; -}; - -/* harmony default export */ var promise_middleware = (promise_middleware_promiseMiddleware); - -// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules -var toConsumableArray = __webpack_require__(17); - -// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/resolvers-cache-middleware.js - - - -/** - * External dependencies - */ - -/** - * Creates a middleware handling resolvers cache invalidation. - * - * @param {WPDataRegistry} registry The registry reference for which to create - * the middleware. - * @param {string} reducerKey The namespace for which to create the - * middleware. - * - * @return {Function} Middleware function. - */ - -var resolvers_cache_middleware_createResolversCacheMiddleware = function createResolversCacheMiddleware(registry, reducerKey) { - return function () { - return function (next) { - return function (action) { - var resolvers = registry.select('core/data').getCachedResolvers(reducerKey); - Object.entries(resolvers).forEach(function (_ref) { - var _ref2 = Object(slicedToArray["a" /* default */])(_ref, 2), - selectorName = _ref2[0], - resolversByArgs = _ref2[1]; - - var resolver = Object(external_lodash_["get"])(registry.stores, [reducerKey, 'resolvers', selectorName]); - - if (!resolver || !resolver.shouldInvalidate) { - return; - } - - resolversByArgs.forEach(function (value, args) { - // resolversByArgs is the map Map([ args ] => boolean) storing the cache resolution status for a given selector. - // If the value is false it means this resolver has finished its resolution which means we need to invalidate it, - // if it's true it means it's inflight and the invalidation is not necessary. - if (value !== false || !resolver.shouldInvalidate.apply(resolver, [action].concat(Object(toConsumableArray["a" /* default */])(args)))) { - return; - } // Trigger cache invalidation - - - registry.dispatch('core/data').invalidateResolution(reducerKey, selectorName, args); - }); - }); - return next(action); - }; - }; - }; -}; - -/* harmony default export */ var resolvers_cache_middleware = (resolvers_cache_middleware_createResolversCacheMiddleware); - -// EXTERNAL MODULE: ./node_modules/equivalent-key-map/equivalent-key-map.js -var equivalent_key_map = __webpack_require__(74); -var equivalent_key_map_default = /*#__PURE__*/__webpack_require__.n(equivalent_key_map); - -// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js -var defineProperty = __webpack_require__(10); - -// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/namespace-store/metadata/utils.js - - - -/** - * Higher-order reducer creator which creates a combined reducer object, keyed - * by a property on the action object. - * - * @param {string} actionProperty Action property by which to key object. - * - * @return {Function} Higher-order reducer. - */ -var utils_onSubKey = function onSubKey(actionProperty) { - return function (reducer) { - return function () { - var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - var action = arguments.length > 1 ? arguments[1] : undefined; - // Retrieve subkey from action. Do not track if undefined; useful for cases - // where reducer is scoped by action shape. - var key = action[actionProperty]; - - if (key === undefined) { - return state; - } // Avoid updating state if unchanged. Note that this also accounts for a - // reducer which returns undefined on a key which is not yet tracked. - - - var nextKeyState = reducer(state[key], action); - - if (nextKeyState === state[key]) { - return state; - } - - return Object(objectSpread["a" /* default */])({}, state, Object(defineProperty["a" /* default */])({}, key, nextKeyState)); - }; - }; -}; - -// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/namespace-store/metadata/reducer.js -/** - * External dependencies - */ - - -/** - * Internal dependencies - */ - - -/** - * Reducer function returning next state for selector resolution of - * subkeys, object form: - * - * selectorName -> EquivalentKeyMap - * - * @param {Object} state Current state. - * @param {Object} action Dispatched action. - * - * @return {Object} Next state. - */ - -var subKeysIsResolved = Object(external_lodash_["flowRight"])([utils_onSubKey('selectorName')])(function () { - var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new equivalent_key_map_default.a(); - var action = arguments.length > 1 ? arguments[1] : undefined; - - switch (action.type) { - case 'START_RESOLUTION': - case 'FINISH_RESOLUTION': - { - var isStarting = action.type === 'START_RESOLUTION'; - var nextState = new equivalent_key_map_default.a(state); - nextState.set(action.args, isStarting); - return nextState; - } - - case 'INVALIDATE_RESOLUTION': - { - var _nextState = new equivalent_key_map_default.a(state); - - _nextState.delete(action.args); - - return _nextState; - } - } - - return state; -}); -/** - * Reducer function returning next state for selector resolution, object form: - * - * selectorName -> EquivalentKeyMap - * - * @param {Object} state Current state. - * @param {Object} action Dispatched action. - * - * @return {Object} Next state. - */ - -var reducer_isResolved = function isResolved() { - var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - var action = arguments.length > 1 ? arguments[1] : undefined; - - switch (action.type) { - case 'INVALIDATE_RESOLUTION_FOR_STORE': - return {}; - - case 'INVALIDATE_RESOLUTION_FOR_STORE_SELECTOR': - return Object(external_lodash_["has"])(state, [action.selectorName]) ? Object(external_lodash_["omit"])(state, [action.selectorName]) : state; - - case 'START_RESOLUTION': - case 'FINISH_RESOLUTION': - case 'INVALIDATE_RESOLUTION': - return subKeysIsResolved(state, action); - } - - return state; -}; - -/* harmony default export */ var metadata_reducer = (reducer_isResolved); - -// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/namespace-store/metadata/selectors.js -/** - * External dependencies - */ - -/** - * Returns the raw `isResolving` value for a given selector name, - * and arguments set. May be undefined if the selector has never been resolved - * or not resolved for the given set of arguments, otherwise true or false for - * resolution started and completed respectively. - * - * @param {Object} state Data state. - * @param {string} selectorName Selector name. - * @param {Array} args Arguments passed to selector. - * - * @return {?boolean} isResolving value. - */ - -function getIsResolving(state, selectorName, args) { - var map = Object(external_lodash_["get"])(state, [selectorName]); - - if (!map) { - return; - } - - return map.get(args); -} -/** - * Returns true if resolution has already been triggered for a given - * selector name, and arguments set. - * - * @param {Object} state Data state. - * @param {string} selectorName Selector name. - * @param {?Array} args Arguments passed to selector (default `[]`). - * - * @return {boolean} Whether resolution has been triggered. - */ - -function hasStartedResolution(state, selectorName) { - var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; - return getIsResolving(state, selectorName, args) !== undefined; -} -/** - * Returns true if resolution has completed for a given selector - * name, and arguments set. - * - * @param {Object} state Data state. - * @param {string} selectorName Selector name. - * @param {?Array} args Arguments passed to selector. - * - * @return {boolean} Whether resolution has completed. - */ - -function hasFinishedResolution(state, selectorName) { - var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; - return getIsResolving(state, selectorName, args) === false; -} -/** - * Returns true if resolution has been triggered but has not yet completed for - * a given selector name, and arguments set. - * - * @param {Object} state Data state. - * @param {string} selectorName Selector name. - * @param {?Array} args Arguments passed to selector. - * - * @return {boolean} Whether resolution is in progress. - */ - -function isResolving(state, selectorName) { - var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; - return getIsResolving(state, selectorName, args) === true; -} -/** - * Returns the list of the cached resolvers. - * - * @param {Object} state Data state. - * - * @return {Object} Resolvers mapped by args and selectorName. - */ - -function getCachedResolvers(state) { - return state; -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/namespace-store/metadata/actions.js -/** - * Returns an action object used in signalling that selector resolution has - * started. - * - * @param {string} selectorName Name of selector for which resolver triggered. - * @param {...*} args Arguments to associate for uniqueness. - * - * @return {Object} Action object. - */ -function startResolution(selectorName, args) { - return { - type: 'START_RESOLUTION', - selectorName: selectorName, - args: args - }; -} -/** - * Returns an action object used in signalling that selector resolution has - * completed. - * - * @param {string} selectorName Name of selector for which resolver triggered. - * @param {...*} args Arguments to associate for uniqueness. - * - * @return {Object} Action object. - */ - -function finishResolution(selectorName, args) { - return { - type: 'FINISH_RESOLUTION', - selectorName: selectorName, - args: args - }; -} -/** - * Returns an action object used in signalling that we should invalidate the resolution cache. - * - * @param {string} selectorName Name of selector for which resolver should be invalidated. - * @param {Array} args Arguments to associate for uniqueness. - * - * @return {Object} Action object. - */ - -function invalidateResolution(selectorName, args) { - return { - type: 'INVALIDATE_RESOLUTION', - selectorName: selectorName, - args: args - }; -} -/** - * Returns an action object used in signalling that the resolution - * should be invalidated. - * - * @return {Object} Action object. - */ - -function invalidateResolutionForStore() { - return { - type: 'INVALIDATE_RESOLUTION_FOR_STORE' - }; -} -/** - * Returns an action object used in signalling that the resolution cache for a - * given selectorName should be invalidated. - * - * @param {string} selectorName Name of selector for which all resolvers should - * be invalidated. - * - * @return {Object} Action object. - */ - -function invalidateResolutionForStoreSelector(selectorName) { - return { - type: 'INVALIDATE_RESOLUTION_FOR_STORE_SELECTOR', - selectorName: selectorName - }; -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/namespace-store/index.js - - - - -/** - * External dependencies - */ - - - -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - - - - - -/** - * @typedef {import('../registry').WPDataRegistry} WPDataRegistry - */ - -/** - * Creates a namespace object with a store derived from the reducer given. - * - * @param {string} key Unique namespace identifier. - * @param {Object} options Registered store options, with properties - * describing reducer, actions, selectors, and - * resolvers. - * @param {WPDataRegistry} registry Registry reference. - * - * @return {Object} Store Object. - */ - -function createNamespace(key, options, registry) { - var reducer = options.reducer; - var store = createReduxStore(key, options, registry); - var resolvers; - var actions = mapActions(Object(objectSpread["a" /* default */])({}, actions_namespaceObject, options.actions), store); - var selectors = mapSelectors(Object(objectSpread["a" /* default */])({}, Object(external_lodash_["mapValues"])(selectors_namespaceObject, function (selector) { - return function (state) { - for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - return selector.apply(void 0, [state.metadata].concat(args)); - }; - }), Object(external_lodash_["mapValues"])(options.selectors, function (selector) { - if (selector.isRegistrySelector) { - selector.registry = registry; - } - - return function (state) { - for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - args[_key2 - 1] = arguments[_key2]; - } - - return selector.apply(void 0, [state.root].concat(args)); - }; - })), store); - - if (options.resolvers) { - var result = mapResolvers(options.resolvers, selectors, store); - resolvers = result.resolvers; - selectors = result.selectors; - } - - var getSelectors = function getSelectors() { - return selectors; - }; - - var getActions = function getActions() { - return actions; - }; // We have some modules monkey-patching the store object - // It's wrong to do so but until we refactor all of our effects to controls - // We need to keep the same "store" instance here. - - - store.__unstableOriginalGetState = store.getState; - - store.getState = function () { - return store.__unstableOriginalGetState().root; - }; // Customize subscribe behavior to call listeners only on effective change, - // not on every dispatch. - - - var subscribe = store && function (listener) { - var lastState = store.__unstableOriginalGetState(); - - store.subscribe(function () { - var state = store.__unstableOriginalGetState(); - - var hasChanged = state !== lastState; - lastState = state; - - if (hasChanged) { - listener(); - } - }); - }; // This can be simplified to just { subscribe, getSelectors, getActions } - // Once we remove the use function. - - - return { - reducer: reducer, - store: store, - actions: actions, - selectors: selectors, - resolvers: resolvers, - getSelectors: getSelectors, - getActions: getActions, - subscribe: subscribe - }; -} -/** - * Creates a redux store for a namespace. - * - * @param {string} key Unique namespace identifier. - * @param {Object} options Registered store options, with properties - * describing reducer, actions, selectors, and - * resolvers. - * @param {WPDataRegistry} registry Registry reference. - * - * @return {Object} Newly created redux store. - */ - -function createReduxStore(key, options, registry) { - var middlewares = [resolvers_cache_middleware(registry, key), promise_middleware]; - - if (options.controls) { - var normalizedControls = Object(external_lodash_["mapValues"])(options.controls, function (control) { - return control.isRegistryControl ? control(registry) : control; - }); - middlewares.push(external_this_wp_reduxRoutine_default()(normalizedControls)); - } - - var enhancers = [applyMiddleware.apply(void 0, middlewares)]; - - if (typeof window !== 'undefined' && window.__REDUX_DEVTOOLS_EXTENSION__) { - enhancers.push(window.__REDUX_DEVTOOLS_EXTENSION__({ - name: key, - instanceId: key - })); - } - - var reducer = options.reducer, - initialState = options.initialState; - var enhancedReducer = turbo_combine_reducers_default()({ - metadata: metadata_reducer, - root: reducer - }); - return createStore(enhancedReducer, { - root: initialState - }, Object(external_lodash_["flowRight"])(enhancers)); -} -/** - * Maps selectors to a store. - * - * @param {Object} selectors Selectors to register. Keys will be used as the - * public facing API. Selectors will get passed the - * state as first argument. - * @param {Object} store The store to which the selectors should be mapped. - * - * @return {Object} Selectors mapped to the provided store. - */ - - -function mapSelectors(selectors, store) { - var createStateSelector = function createStateSelector(registrySelector) { - var selector = function runSelector() { - // This function is an optimized implementation of: - // - // selector( store.getState(), ...arguments ) - // - // Where the above would incur an `Array#concat` in its application, - // the logic here instead efficiently constructs an arguments array via - // direct assignment. - var argsLength = arguments.length; - var args = new Array(argsLength + 1); - args[0] = store.__unstableOriginalGetState(); - - for (var i = 0; i < argsLength; i++) { - args[i + 1] = arguments[i]; - } - - return registrySelector.apply(void 0, args); - }; - - selector.hasResolver = false; - return selector; - }; - - return Object(external_lodash_["mapValues"])(selectors, createStateSelector); -} -/** - * Maps actions to dispatch from a given store. - * - * @param {Object} actions Actions to register. - * @param {Object} store The redux store to which the actions should be mapped. - * @return {Object} Actions mapped to the redux store provided. - */ - - -function mapActions(actions, store) { - var createBoundAction = function createBoundAction(action) { - return function () { - return Promise.resolve(store.dispatch(action.apply(void 0, arguments))); - }; - }; - - return Object(external_lodash_["mapValues"])(actions, createBoundAction); -} -/** - * Returns resolvers with matched selectors for a given namespace. - * Resolvers are side effects invoked once per argument set of a given selector call, - * used in ensuring that the data needs for the selector are satisfied. - * - * @param {Object} resolvers Resolvers to register. - * @param {Object} selectors The current selectors to be modified. - * @param {Object} store The redux store to which the resolvers should be mapped. - * @return {Object} An object containing updated selectors and resolvers. - */ - - -function mapResolvers(resolvers, selectors, store) { - var mappedResolvers = Object(external_lodash_["mapValues"])(resolvers, function (resolver) { - var _resolver$fulfill = resolver.fulfill, - resolverFulfill = _resolver$fulfill === void 0 ? resolver : _resolver$fulfill; - return Object(objectSpread["a" /* default */])({}, resolver, { - fulfill: resolverFulfill - }); - }); - - var mapSelector = function mapSelector(selector, selectorName) { - var resolver = resolvers[selectorName]; - - if (!resolver) { - selector.hasResolver = false; - return selector; - } - - var selectorResolver = function selectorResolver() { - for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { - args[_key3] = arguments[_key3]; - } - - function fulfillSelector() { - return _fulfillSelector.apply(this, arguments); - } - - function _fulfillSelector() { - _fulfillSelector = Object(asyncToGenerator["a" /* default */])( - /*#__PURE__*/ - regenerator_default.a.mark(function _callee() { - var state, _store$__unstableOrig, metadata; - - return regenerator_default.a.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - state = store.getState(); - - if (!(typeof resolver.isFulfilled === 'function' && resolver.isFulfilled.apply(resolver, [state].concat(args)))) { - _context.next = 3; - break; - } - - return _context.abrupt("return"); - - case 3: - _store$__unstableOrig = store.__unstableOriginalGetState(), metadata = _store$__unstableOrig.metadata; - - if (!hasStartedResolution(metadata, selectorName, args)) { - _context.next = 6; - break; - } - - return _context.abrupt("return"); - - case 6: - store.dispatch(startResolution(selectorName, args)); - _context.next = 9; - return fulfillResolver.apply(void 0, [store, mappedResolvers, selectorName].concat(args)); - - case 9: - store.dispatch(finishResolution(selectorName, args)); - - case 10: - case "end": - return _context.stop(); - } - } - }, _callee); - })); - return _fulfillSelector.apply(this, arguments); - } - - fulfillSelector.apply(void 0, args); - return selector.apply(void 0, args); - }; - - selectorResolver.hasResolver = true; - return selectorResolver; - }; - - return { - resolvers: mappedResolvers, - selectors: Object(external_lodash_["mapValues"])(selectors, mapSelector) - }; -} -/** - * Calls a resolver given arguments - * - * @param {Object} store Store reference, for fulfilling via resolvers - * @param {Object} resolvers Store Resolvers - * @param {string} selectorName Selector name to fulfill. - * @param {Array} args Selector Arguments. - */ - - -function fulfillResolver(_x, _x2, _x3) { - return _fulfillResolver.apply(this, arguments); -} - -function _fulfillResolver() { - _fulfillResolver = Object(asyncToGenerator["a" /* default */])( - /*#__PURE__*/ - regenerator_default.a.mark(function _callee2(store, resolvers, selectorName) { - var resolver, - _len4, - args, - _key4, - action, - _args2 = arguments; - - return regenerator_default.a.wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - resolver = Object(external_lodash_["get"])(resolvers, [selectorName]); - - if (resolver) { - _context2.next = 3; - break; - } - - return _context2.abrupt("return"); - - case 3: - for (_len4 = _args2.length, args = new Array(_len4 > 3 ? _len4 - 3 : 0), _key4 = 3; _key4 < _len4; _key4++) { - args[_key4 - 3] = _args2[_key4]; - } - - action = resolver.fulfill.apply(resolver, args); - - if (!action) { - _context2.next = 8; - break; - } - - _context2.next = 8; - return store.dispatch(action); - - case 8: - case "end": - return _context2.stop(); - } - } - }, _callee2); - })); - return _fulfillResolver.apply(this, arguments); -} - -// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/store/index.js - - - -function createCoreDataStore(registry) { - var getCoreDataSelector = function getCoreDataSelector(selectorName) { - return function (reducerKey) { - var _registry$select; - - for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - return (_registry$select = registry.select(reducerKey))[selectorName].apply(_registry$select, args); - }; - }; - - var getCoreDataAction = function getCoreDataAction(actionName) { - return function (reducerKey) { - var _registry$dispatch; - - for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - args[_key2 - 1] = arguments[_key2]; - } - - return (_registry$dispatch = registry.dispatch(reducerKey))[actionName].apply(_registry$dispatch, args); - }; - }; - - return { - getSelectors: function getSelectors() { - return ['getIsResolving', 'hasStartedResolution', 'hasFinishedResolution', 'isResolving', 'getCachedResolvers'].reduce(function (memo, selectorName) { - return Object(objectSpread["a" /* default */])({}, memo, Object(defineProperty["a" /* default */])({}, selectorName, getCoreDataSelector(selectorName))); - }, {}); - }, - getActions: function getActions() { - return ['startResolution', 'finishResolution', 'invalidateResolution', 'invalidateResolutionForStore', 'invalidateResolutionForStoreSelec