[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

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

   1  this["wp"] = this["wp"] || {}; this["wp"]["data"] =
   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 = "pfJ3");
  86  /******/ })
  87  /************************************************************************/
  88  /******/ ({
  89  
  90  /***/ "8mpt":
  91  /***/ (function(module, exports) {
  92  
  93  function combineReducers( reducers ) {
  94      var keys = Object.keys( reducers ),
  95          getNextState;
  96  
  97      getNextState = ( function() {
  98          var fn, i, key;
  99  
 100          fn = 'return {';
 101          for ( i = 0; i < keys.length; i++ ) {
 102              // Rely on Quoted escaping of JSON.stringify with guarantee that
 103              // each member of Object.keys is a string.
 104              //
 105              // "If Type(value) is String, then return the result of calling the
 106              // abstract operation Quote with argument value. [...] The abstract
 107              // operation Quote(value) wraps a String value in double quotes and
 108              // escapes characters within it."
 109              //
 110              // https://www.ecma-international.org/ecma-262/5.1/#sec-15.12.3
 111              key = JSON.stringify( keys[ i ] );
 112  
 113              fn += key + ':r[' + key + '](s[' + key + '],a),';
 114          }
 115          fn += '}';
 116  
 117          return new Function( 'r,s,a', fn );
 118      } )();
 119  
 120      return function combinedReducer( state, action ) {
 121          var nextState, i, key;
 122  
 123          // Assumed changed if initial state.
 124          if ( state === undefined ) {
 125              return getNextState( reducers, {}, action );
 126          }
 127  
 128          nextState = getNextState( reducers, state, action );
 129  
 130          // Determine whether state has changed.
 131          i = keys.length;
 132          while ( i-- ) {
 133              key = keys[ i ];
 134              if ( state[ key ] !== nextState[ key ] ) {
 135                  // Return immediately if a changed value is encountered.
 136                  return nextState;
 137              }
 138          }
 139  
 140          return state;
 141      };
 142  }
 143  
 144  module.exports = combineReducers;
 145  
 146  
 147  /***/ }),
 148  
 149  /***/ "FtRg":
 150  /***/ (function(module, exports, __webpack_require__) {
 151  
 152  "use strict";
 153  
 154  
 155  function _typeof(obj) {
 156    if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
 157      _typeof = function (obj) {
 158        return typeof obj;
 159      };
 160    } else {
 161      _typeof = function (obj) {
 162        return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
 163      };
 164    }
 165  
 166    return _typeof(obj);
 167  }
 168  
 169  function _classCallCheck(instance, Constructor) {
 170    if (!(instance instanceof Constructor)) {
 171      throw new TypeError("Cannot call a class as a function");
 172    }
 173  }
 174  
 175  function _defineProperties(target, props) {
 176    for (var i = 0; i < props.length; i++) {
 177      var descriptor = props[i];
 178      descriptor.enumerable = descriptor.enumerable || false;
 179      descriptor.configurable = true;
 180      if ("value" in descriptor) descriptor.writable = true;
 181      Object.defineProperty(target, descriptor.key, descriptor);
 182    }
 183  }
 184  
 185  function _createClass(Constructor, protoProps, staticProps) {
 186    if (protoProps) _defineProperties(Constructor.prototype, protoProps);
 187    if (staticProps) _defineProperties(Constructor, staticProps);
 188    return Constructor;
 189  }
 190  
 191  /**
 192   * Given an instance of EquivalentKeyMap, returns its internal value pair tuple
 193   * for a key, if one exists. The tuple members consist of the last reference
 194   * value for the key (used in efficient subsequent lookups) and the value
 195   * assigned for the key at the leaf node.
 196   *
 197   * @param {EquivalentKeyMap} instance EquivalentKeyMap instance.
 198   * @param {*} key                     The key for which to return value pair.
 199   *
 200   * @return {?Array} Value pair, if exists.
 201   */
 202  function getValuePair(instance, key) {
 203    var _map = instance._map,
 204        _arrayTreeMap = instance._arrayTreeMap,
 205        _objectTreeMap = instance._objectTreeMap; // Map keeps a reference to the last object-like key used to set the
 206    // value, which can be used to shortcut immediately to the value.
 207  
 208    if (_map.has(key)) {
 209      return _map.get(key);
 210    } // Sort keys to ensure stable retrieval from tree.
 211  
 212  
 213    var properties = Object.keys(key).sort(); // Tree by type to avoid conflicts on numeric object keys, empty value.
 214  
 215    var map = Array.isArray(key) ? _arrayTreeMap : _objectTreeMap;
 216  
 217    for (var i = 0; i < properties.length; i++) {
 218      var property = properties[i];
 219      map = map.get(property);
 220  
 221      if (map === undefined) {
 222        return;
 223      }
 224  
 225      var propertyValue = key[property];
 226      map = map.get(propertyValue);
 227  
 228      if (map === undefined) {
 229        return;
 230      }
 231    }
 232  
 233    var valuePair = map.get('_ekm_value');
 234  
 235    if (!valuePair) {
 236      return;
 237    } // If reached, it implies that an object-like key was set with another
 238    // reference, so delete the reference and replace with the current.
 239  
 240  
 241    _map.delete(valuePair[0]);
 242  
 243    valuePair[0] = key;
 244    map.set('_ekm_value', valuePair);
 245  
 246    _map.set(key, valuePair);
 247  
 248    return valuePair;
 249  }
 250  /**
 251   * Variant of a Map object which enables lookup by equivalent (deeply equal)
 252   * object and array keys.
 253   */
 254  
 255  
 256  var EquivalentKeyMap =
 257  /*#__PURE__*/
 258  function () {
 259    /**
 260     * Constructs a new instance of EquivalentKeyMap.
 261     *
 262     * @param {Iterable.<*>} iterable Initial pair of key, value for map.
 263     */
 264    function EquivalentKeyMap(iterable) {
 265      _classCallCheck(this, EquivalentKeyMap);
 266  
 267      this.clear();
 268  
 269      if (iterable instanceof EquivalentKeyMap) {
 270        // Map#forEach is only means of iterating with support for IE11.
 271        var iterablePairs = [];
 272        iterable.forEach(function (value, key) {
 273          iterablePairs.push([key, value]);
 274        });
 275        iterable = iterablePairs;
 276      }
 277  
 278      if (iterable != null) {
 279        for (var i = 0; i < iterable.length; i++) {
 280          this.set(iterable[i][0], iterable[i][1]);
 281        }
 282      }
 283    }
 284    /**
 285     * Accessor property returning the number of elements.
 286     *
 287     * @return {number} Number of elements.
 288     */
 289  
 290  
 291    _createClass(EquivalentKeyMap, [{
 292      key: "set",
 293  
 294      /**
 295       * Add or update an element with a specified key and value.
 296       *
 297       * @param {*} key   The key of the element to add.
 298       * @param {*} value The value of the element to add.
 299       *
 300       * @return {EquivalentKeyMap} Map instance.
 301       */
 302      value: function set(key, value) {
 303        // Shortcut non-object-like to set on internal Map.
 304        if (key === null || _typeof(key) !== 'object') {
 305          this._map.set(key, value);
 306  
 307          return this;
 308        } // Sort keys to ensure stable assignment into tree.
 309  
 310  
 311        var properties = Object.keys(key).sort();
 312        var valuePair = [key, value]; // Tree by type to avoid conflicts on numeric object keys, empty value.
 313  
 314        var map = Array.isArray(key) ? this._arrayTreeMap : this._objectTreeMap;
 315  
 316        for (var i = 0; i < properties.length; i++) {
 317          var property = properties[i];
 318  
 319          if (!map.has(property)) {
 320            map.set(property, new EquivalentKeyMap());
 321          }
 322  
 323          map = map.get(property);
 324          var propertyValue = key[property];
 325  
 326          if (!map.has(propertyValue)) {
 327            map.set(propertyValue, new EquivalentKeyMap());
 328          }
 329  
 330          map = map.get(propertyValue);
 331        } // If an _ekm_value exists, there was already an equivalent key. Before
 332        // overriding, ensure that the old key reference is removed from map to
 333        // avoid memory leak of accumulating equivalent keys. This is, in a
 334        // sense, a poor man's WeakMap, while still enabling iterability.
 335  
 336  
 337        var previousValuePair = map.get('_ekm_value');
 338  
 339        if (previousValuePair) {
 340          this._map.delete(previousValuePair[0]);
 341        }
 342  
 343        map.set('_ekm_value', valuePair);
 344  
 345        this._map.set(key, valuePair);
 346  
 347        return this;
 348      }
 349      /**
 350       * Returns a specified element.
 351       *
 352       * @param {*} key The key of the element to return.
 353       *
 354       * @return {?*} The element associated with the specified key or undefined
 355       *              if the key can't be found.
 356       */
 357  
 358    }, {
 359      key: "get",
 360      value: function get(key) {
 361        // Shortcut non-object-like to get from internal Map.
 362        if (key === null || _typeof(key) !== 'object') {
 363          return this._map.get(key);
 364        }
 365  
 366        var valuePair = getValuePair(this, key);
 367  
 368        if (valuePair) {
 369          return valuePair[1];
 370        }
 371      }
 372      /**
 373       * Returns a boolean indicating whether an element with the specified key
 374       * exists or not.
 375       *
 376       * @param {*} key The key of the element to test for presence.
 377       *
 378       * @return {boolean} Whether an element with the specified key exists.
 379       */
 380  
 381    }, {
 382      key: "has",
 383      value: function has(key) {
 384        if (key === null || _typeof(key) !== 'object') {
 385          return this._map.has(key);
 386        } // Test on the _presence_ of the pair, not its value, as even undefined
 387        // can be a valid member value for a key.
 388  
 389  
 390        return getValuePair(this, key) !== undefined;
 391      }
 392      /**
 393       * Removes the specified element.
 394       *
 395       * @param {*} key The key of the element to remove.
 396       *
 397       * @return {boolean} Returns true if an element existed and has been
 398       *                   removed, or false if the element does not exist.
 399       */
 400  
 401    }, {
 402      key: "delete",
 403      value: function _delete(key) {
 404        if (!this.has(key)) {
 405          return false;
 406        } // This naive implementation will leave orphaned child trees. A better
 407        // implementation should traverse and remove orphans.
 408  
 409  
 410        this.set(key, undefined);
 411        return true;
 412      }
 413      /**
 414       * Executes a provided function once per each key/value pair, in insertion
 415       * order.
 416       *
 417       * @param {Function} callback Function to execute for each element.
 418       * @param {*}        thisArg  Value to use as `this` when executing
 419       *                            `callback`.
 420       */
 421  
 422    }, {
 423      key: "forEach",
 424      value: function forEach(callback) {
 425        var _this = this;
 426  
 427        var thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this;
 428  
 429        this._map.forEach(function (value, key) {
 430          // Unwrap value from object-like value pair.
 431          if (key !== null && _typeof(key) === 'object') {
 432            value = value[1];
 433          }
 434  
 435          callback.call(thisArg, value, key, _this);
 436        });
 437      }
 438      /**
 439       * Removes all elements.
 440       */
 441  
 442    }, {
 443      key: "clear",
 444      value: function clear() {
 445        this._map = new Map();
 446        this._arrayTreeMap = new Map();
 447        this._objectTreeMap = new Map();
 448      }
 449    }, {
 450      key: "size",
 451      get: function get() {
 452        return this._map.size;
 453      }
 454    }]);
 455  
 456    return EquivalentKeyMap;
 457  }();
 458  
 459  module.exports = EquivalentKeyMap;
 460  
 461  
 462  /***/ }),
 463  
 464  /***/ "GRId":
 465  /***/ (function(module, exports) {
 466  
 467  (function() { module.exports = window["wp"]["element"]; }());
 468  
 469  /***/ }),
 470  
 471  /***/ "JlUD":
 472  /***/ (function(module, exports) {
 473  
 474  module.exports = isPromise;
 475  module.exports.default = isPromise;
 476  
 477  function isPromise(obj) {
 478    return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
 479  }
 480  
 481  
 482  /***/ }),
 483  
 484  /***/ "K9lf":
 485  /***/ (function(module, exports) {
 486  
 487  (function() { module.exports = window["wp"]["compose"]; }());
 488  
 489  /***/ }),
 490  
 491  /***/ "NMb1":
 492  /***/ (function(module, exports) {
 493  
 494  (function() { module.exports = window["wp"]["deprecated"]; }());
 495  
 496  /***/ }),
 497  
 498  /***/ "XI5e":
 499  /***/ (function(module, exports) {
 500  
 501  (function() { module.exports = window["wp"]["priorityQueue"]; }());
 502  
 503  /***/ }),
 504  
 505  /***/ "XIDh":
 506  /***/ (function(module, exports) {
 507  
 508  (function() { module.exports = window["wp"]["reduxRoutine"]; }());
 509  
 510  /***/ }),
 511  
 512  /***/ "YLtl":
 513  /***/ (function(module, exports) {
 514  
 515  (function() { module.exports = window["lodash"]; }());
 516  
 517  /***/ }),
 518  
 519  /***/ "cDcd":
 520  /***/ (function(module, exports) {
 521  
 522  (function() { module.exports = window["React"]; }());
 523  
 524  /***/ }),
 525  
 526  /***/ "mHlH":
 527  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 528  
 529  "use strict";
 530  /* unused harmony export useCallback */
 531  /* unused harmony export useCallbackOne */
 532  /* unused harmony export useMemo */
 533  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useMemoOne; });
 534  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("cDcd");
 535  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
 536  
 537  
 538  function areInputsEqual(newInputs, lastInputs) {
 539    if (newInputs.length !== lastInputs.length) {
 540      return false;
 541    }
 542  
 543    for (var i = 0; i < newInputs.length; i++) {
 544      if (newInputs[i] !== lastInputs[i]) {
 545        return false;
 546      }
 547    }
 548  
 549    return true;
 550  }
 551  
 552  function useMemoOne(getResult, inputs) {
 553    var initial = Object(react__WEBPACK_IMPORTED_MODULE_0__["useState"])(function () {
 554      return {
 555        inputs: inputs,
 556        result: getResult()
 557      };
 558    })[0];
 559    var isFirstRun = Object(react__WEBPACK_IMPORTED_MODULE_0__["useRef"])(true);
 560    var committed = Object(react__WEBPACK_IMPORTED_MODULE_0__["useRef"])(initial);
 561    var useCache = isFirstRun.current || Boolean(inputs && committed.current.inputs && areInputsEqual(inputs, committed.current.inputs));
 562    var cache = useCache ? committed.current : {
 563      inputs: inputs,
 564      result: getResult()
 565    };
 566    Object(react__WEBPACK_IMPORTED_MODULE_0__["useEffect"])(function () {
 567      isFirstRun.current = false;
 568      committed.current = cache;
 569    }, [cache]);
 570    return cache.result;
 571  }
 572  function useCallbackOne(callback, inputs) {
 573    return useMemoOne(function () {
 574      return callback;
 575    }, inputs);
 576  }
 577  var useMemo = useMemoOne;
 578  var useCallback = useCallbackOne;
 579  
 580  
 581  
 582  
 583  /***/ }),
 584  
 585  /***/ "pfJ3":
 586  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 587  
 588  "use strict";
 589  // ESM COMPAT FLAG
 590  __webpack_require__.r(__webpack_exports__);
 591  
 592  // EXPORTS
 593  __webpack_require__.d(__webpack_exports__, "withSelect", function() { return /* reexport */ with_select; });
 594  __webpack_require__.d(__webpack_exports__, "withDispatch", function() { return /* reexport */ with_dispatch; });
 595  __webpack_require__.d(__webpack_exports__, "withRegistry", function() { return /* reexport */ with_registry; });
 596  __webpack_require__.d(__webpack_exports__, "RegistryProvider", function() { return /* reexport */ context; });
 597  __webpack_require__.d(__webpack_exports__, "RegistryConsumer", function() { return /* reexport */ RegistryConsumer; });
 598  __webpack_require__.d(__webpack_exports__, "useRegistry", function() { return /* reexport */ useRegistry; });
 599  __webpack_require__.d(__webpack_exports__, "useSelect", function() { return /* reexport */ useSelect; });
 600  __webpack_require__.d(__webpack_exports__, "useDispatch", function() { return /* reexport */ use_dispatch; });
 601  __webpack_require__.d(__webpack_exports__, "AsyncModeProvider", function() { return /* reexport */ async_mode_provider_context; });
 602  __webpack_require__.d(__webpack_exports__, "createRegistry", function() { return /* reexport */ createRegistry; });
 603  __webpack_require__.d(__webpack_exports__, "createRegistrySelector", function() { return /* reexport */ createRegistrySelector; });
 604  __webpack_require__.d(__webpack_exports__, "createRegistryControl", function() { return /* reexport */ createRegistryControl; });
 605  __webpack_require__.d(__webpack_exports__, "controls", function() { return /* reexport */ controls_controls; });
 606  __webpack_require__.d(__webpack_exports__, "createReduxStore", function() { return /* reexport */ createReduxStore; });
 607  __webpack_require__.d(__webpack_exports__, "plugins", function() { return /* reexport */ plugins_namespaceObject; });
 608  __webpack_require__.d(__webpack_exports__, "combineReducers", function() { return /* reexport */ turbo_combine_reducers_default.a; });
 609  __webpack_require__.d(__webpack_exports__, "select", function() { return /* binding */ build_module_select; });
 610  __webpack_require__.d(__webpack_exports__, "resolveSelect", function() { return /* binding */ build_module_resolveSelect; });
 611  __webpack_require__.d(__webpack_exports__, "dispatch", function() { return /* binding */ build_module_dispatch; });
 612  __webpack_require__.d(__webpack_exports__, "subscribe", function() { return /* binding */ build_module_subscribe; });
 613  __webpack_require__.d(__webpack_exports__, "registerGenericStore", function() { return /* binding */ build_module_registerGenericStore; });
 614  __webpack_require__.d(__webpack_exports__, "registerStore", function() { return /* binding */ registerStore; });
 615  __webpack_require__.d(__webpack_exports__, "use", function() { return /* binding */ build_module_use; });
 616  __webpack_require__.d(__webpack_exports__, "register", function() { return /* binding */ build_module_register; });
 617  
 618  // NAMESPACE OBJECT: ./node_modules/@wordpress/data/build-module/redux-store/metadata/selectors.js
 619  var selectors_namespaceObject = {};
 620  __webpack_require__.r(selectors_namespaceObject);
 621  __webpack_require__.d(selectors_namespaceObject, "getIsResolving", function() { return getIsResolving; });
 622  __webpack_require__.d(selectors_namespaceObject, "hasStartedResolution", function() { return hasStartedResolution; });
 623  __webpack_require__.d(selectors_namespaceObject, "hasFinishedResolution", function() { return hasFinishedResolution; });
 624  __webpack_require__.d(selectors_namespaceObject, "isResolving", function() { return isResolving; });
 625  __webpack_require__.d(selectors_namespaceObject, "getCachedResolvers", function() { return getCachedResolvers; });
 626  
 627  // NAMESPACE OBJECT: ./node_modules/@wordpress/data/build-module/redux-store/metadata/actions.js
 628  var actions_namespaceObject = {};
 629  __webpack_require__.r(actions_namespaceObject);
 630  __webpack_require__.d(actions_namespaceObject, "startResolution", function() { return startResolution; });
 631  __webpack_require__.d(actions_namespaceObject, "finishResolution", function() { return finishResolution; });
 632  __webpack_require__.d(actions_namespaceObject, "startResolutions", function() { return startResolutions; });
 633  __webpack_require__.d(actions_namespaceObject, "finishResolutions", function() { return finishResolutions; });
 634  __webpack_require__.d(actions_namespaceObject, "invalidateResolution", function() { return invalidateResolution; });
 635  __webpack_require__.d(actions_namespaceObject, "invalidateResolutionForStore", function() { return invalidateResolutionForStore; });
 636  __webpack_require__.d(actions_namespaceObject, "invalidateResolutionForStoreSelector", function() { return invalidateResolutionForStoreSelector; });
 637  
 638  // NAMESPACE OBJECT: ./node_modules/@wordpress/data/build-module/plugins/index.js
 639  var plugins_namespaceObject = {};
 640  __webpack_require__.r(plugins_namespaceObject);
 641  __webpack_require__.d(plugins_namespaceObject, "controls", function() { return plugins_controls; });
 642  __webpack_require__.d(plugins_namespaceObject, "persistence", function() { return plugins_persistence; });
 643  
 644  // EXTERNAL MODULE: ./node_modules/turbo-combine-reducers/index.js
 645  var turbo_combine_reducers = __webpack_require__("8mpt");
 646  var turbo_combine_reducers_default = /*#__PURE__*/__webpack_require__.n(turbo_combine_reducers);
 647  
 648  // EXTERNAL MODULE: external "lodash"
 649  var external_lodash_ = __webpack_require__("YLtl");
 650  
 651  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
 652  function _defineProperty(obj, key, value) {
 653    if (key in obj) {
 654      Object.defineProperty(obj, key, {
 655        value: value,
 656        enumerable: true,
 657        configurable: true,
 658        writable: true
 659      });
 660    } else {
 661      obj[key] = value;
 662    }
 663  
 664    return obj;
 665  }
 666  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js
 667  
 668  
 669  function ownKeys(object, enumerableOnly) {
 670    var keys = Object.keys(object);
 671  
 672    if (Object.getOwnPropertySymbols) {
 673      var symbols = Object.getOwnPropertySymbols(object);
 674  
 675      if (enumerableOnly) {
 676        symbols = symbols.filter(function (sym) {
 677          return Object.getOwnPropertyDescriptor(object, sym).enumerable;
 678        });
 679      }
 680  
 681      keys.push.apply(keys, symbols);
 682    }
 683  
 684    return keys;
 685  }
 686  
 687  function _objectSpread2(target) {
 688    for (var i = 1; i < arguments.length; i++) {
 689      var source = arguments[i] != null ? arguments[i] : {};
 690  
 691      if (i % 2) {
 692        ownKeys(Object(source), true).forEach(function (key) {
 693          _defineProperty(target, key, source[key]);
 694        });
 695      } else if (Object.getOwnPropertyDescriptors) {
 696        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
 697      } else {
 698        ownKeys(Object(source)).forEach(function (key) {
 699          Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
 700        });
 701      }
 702    }
 703  
 704    return target;
 705  }
 706  // CONCATENATED MODULE: ./node_modules/redux/es/redux.js
 707  
 708  
 709  /**
 710   * Adapted from React: https://github.com/facebook/react/blob/master/packages/shared/formatProdErrorMessage.js
 711   *
 712   * Do not require this module directly! Use normal throw error calls. These messages will be replaced with error codes
 713   * during build.
 714   * @param {number} code
 715   */
 716  function formatProdErrorMessage(code) {
 717    return "Minified Redux error #" + code + "; visit https://redux.js.org/Errors?code=" + code + " for the full message or " + 'use the non-minified dev environment for full errors. ';
 718  }
 719  
 720  // Inlined version of the `symbol-observable` polyfill
 721  var $$observable = (function () {
 722    return typeof Symbol === 'function' && Symbol.observable || '@@observable';
 723  })();
 724  
 725  /**
 726   * These are private action types reserved by Redux.
 727   * For any unknown actions, you must return the current state.
 728   * If the current state is undefined, you must return the initial state.
 729   * Do not reference these action types directly in your code.
 730   */
 731  var randomString = function randomString() {
 732    return Math.random().toString(36).substring(7).split('').join('.');
 733  };
 734  
 735  var ActionTypes = {
 736    INIT: "@@redux/INIT" + randomString(),
 737    REPLACE: "@@redux/REPLACE" + randomString(),
 738    PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {
 739      return "@@redux/PROBE_UNKNOWN_ACTION" + randomString();
 740    }
 741  };
 742  
 743  /**
 744   * @param {any} obj The object to inspect.
 745   * @returns {boolean} True if the argument appears to be a plain object.
 746   */
 747  function isPlainObject(obj) {
 748    if (typeof obj !== 'object' || obj === null) return false;
 749    var proto = obj;
 750  
 751    while (Object.getPrototypeOf(proto) !== null) {
 752      proto = Object.getPrototypeOf(proto);
 753    }
 754  
 755    return Object.getPrototypeOf(obj) === proto;
 756  }
 757  
 758  function kindOf(val) {
 759    var typeOfVal = typeof val;
 760  
 761    if (false) {}
 762  
 763    return typeOfVal;
 764  }
 765  
 766  /**
 767   * Creates a Redux store that holds the state tree.
 768   * The only way to change the data in the store is to call `dispatch()` on it.
 769   *
 770   * There should only be a single store in your app. To specify how different
 771   * parts of the state tree respond to actions, you may combine several reducers
 772   * into a single reducer function by using `combineReducers`.
 773   *
 774   * @param {Function} reducer A function that returns the next state tree, given
 775   * the current state tree and the action to handle.
 776   *
 777   * @param {any} [preloadedState] The initial state. You may optionally specify it
 778   * to hydrate the state from the server in universal apps, or to restore a
 779   * previously serialized user session.
 780   * If you use `combineReducers` to produce the root reducer function, this must be
 781   * an object with the same shape as `combineReducers` keys.
 782   *
 783   * @param {Function} [enhancer] The store enhancer. You may optionally specify it
 784   * to enhance the store with third-party capabilities such as middleware,
 785   * time travel, persistence, etc. The only store enhancer that ships with Redux
 786   * is `applyMiddleware()`.
 787   *
 788   * @returns {Store} A Redux store that lets you read the state, dispatch actions
 789   * and subscribe to changes.
 790   */
 791  
 792  function redux_createStore(reducer, preloadedState, enhancer) {
 793    var _ref2;
 794  
 795    if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') {
 796      throw new Error( true ? formatProdErrorMessage(0) : undefined);
 797    }
 798  
 799    if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {
 800      enhancer = preloadedState;
 801      preloadedState = undefined;
 802    }
 803  
 804    if (typeof enhancer !== 'undefined') {
 805      if (typeof enhancer !== 'function') {
 806        throw new Error( true ? formatProdErrorMessage(1) : undefined);
 807      }
 808  
 809      return enhancer(redux_createStore)(reducer, preloadedState);
 810    }
 811  
 812    if (typeof reducer !== 'function') {
 813      throw new Error( true ? formatProdErrorMessage(2) : undefined);
 814    }
 815  
 816    var currentReducer = reducer;
 817    var currentState = preloadedState;
 818    var currentListeners = [];
 819    var nextListeners = currentListeners;
 820    var isDispatching = false;
 821    /**
 822     * This makes a shallow copy of currentListeners so we can use
 823     * nextListeners as a temporary list while dispatching.
 824     *
 825     * This prevents any bugs around consumers calling
 826     * subscribe/unsubscribe in the middle of a dispatch.
 827     */
 828  
 829    function ensureCanMutateNextListeners() {
 830      if (nextListeners === currentListeners) {
 831        nextListeners = currentListeners.slice();
 832      }
 833    }
 834    /**
 835     * Reads the state tree managed by the store.
 836     *
 837     * @returns {any} The current state tree of your application.
 838     */
 839  
 840  
 841    function getState() {
 842      if (isDispatching) {
 843        throw new Error( true ? formatProdErrorMessage(3) : undefined);
 844      }
 845  
 846      return currentState;
 847    }
 848    /**
 849     * Adds a change listener. It will be called any time an action is dispatched,
 850     * and some part of the state tree may potentially have changed. You may then
 851     * call `getState()` to read the current state tree inside the callback.
 852     *
 853     * You may call `dispatch()` from a change listener, with the following
 854     * caveats:
 855     *
 856     * 1. The subscriptions are snapshotted just before every `dispatch()` call.
 857     * If you subscribe or unsubscribe while the listeners are being invoked, this
 858     * will not have any effect on the `dispatch()` that is currently in progress.
 859     * However, the next `dispatch()` call, whether nested or not, will use a more
 860     * recent snapshot of the subscription list.
 861     *
 862     * 2. The listener should not expect to see all state changes, as the state
 863     * might have been updated multiple times during a nested `dispatch()` before
 864     * the listener is called. It is, however, guaranteed that all subscribers
 865     * registered before the `dispatch()` started will be called with the latest
 866     * state by the time it exits.
 867     *
 868     * @param {Function} listener A callback to be invoked on every dispatch.
 869     * @returns {Function} A function to remove this change listener.
 870     */
 871  
 872  
 873    function subscribe(listener) {
 874      if (typeof listener !== 'function') {
 875        throw new Error( true ? formatProdErrorMessage(4) : undefined);
 876      }
 877  
 878      if (isDispatching) {
 879        throw new Error( true ? formatProdErrorMessage(5) : undefined);
 880      }
 881  
 882      var isSubscribed = true;
 883      ensureCanMutateNextListeners();
 884      nextListeners.push(listener);
 885      return function unsubscribe() {
 886        if (!isSubscribed) {
 887          return;
 888        }
 889  
 890        if (isDispatching) {
 891          throw new Error( true ? formatProdErrorMessage(6) : undefined);
 892        }
 893  
 894        isSubscribed = false;
 895        ensureCanMutateNextListeners();
 896        var index = nextListeners.indexOf(listener);
 897        nextListeners.splice(index, 1);
 898        currentListeners = null;
 899      };
 900    }
 901    /**
 902     * Dispatches an action. It is the only way to trigger a state change.
 903     *
 904     * The `reducer` function, used to create the store, will be called with the
 905     * current state tree and the given `action`. Its return value will
 906     * be considered the **next** state of the tree, and the change listeners
 907     * will be notified.
 908     *
 909     * The base implementation only supports plain object actions. If you want to
 910     * dispatch a Promise, an Observable, a thunk, or something else, you need to
 911     * wrap your store creating function into the corresponding middleware. For
 912     * example, see the documentation for the `redux-thunk` package. Even the
 913     * middleware will eventually dispatch plain object actions using this method.
 914     *
 915     * @param {Object} action A plain object representing “what changed”. It is
 916     * a good idea to keep actions serializable so you can record and replay user
 917     * sessions, or use the time travelling `redux-devtools`. An action must have
 918     * a `type` property which may not be `undefined`. It is a good idea to use
 919     * string constants for action types.
 920     *
 921     * @returns {Object} For convenience, the same action object you dispatched.
 922     *
 923     * Note that, if you use a custom middleware, it may wrap `dispatch()` to
 924     * return something else (for example, a Promise you can await).
 925     */
 926  
 927  
 928    function dispatch(action) {
 929      if (!isPlainObject(action)) {
 930        throw new Error( true ? formatProdErrorMessage(7) : undefined);
 931      }
 932  
 933      if (typeof action.type === 'undefined') {
 934        throw new Error( true ? formatProdErrorMessage(8) : undefined);
 935      }
 936  
 937      if (isDispatching) {
 938        throw new Error( true ? formatProdErrorMessage(9) : undefined);
 939      }
 940  
 941      try {
 942        isDispatching = true;
 943        currentState = currentReducer(currentState, action);
 944      } finally {
 945        isDispatching = false;
 946      }
 947  
 948      var listeners = currentListeners = nextListeners;
 949  
 950      for (var i = 0; i < listeners.length; i++) {
 951        var listener = listeners[i];
 952        listener();
 953      }
 954  
 955      return action;
 956    }
 957    /**
 958     * Replaces the reducer currently used by the store to calculate the state.
 959     *
 960     * You might need this if your app implements code splitting and you want to
 961     * load some of the reducers dynamically. You might also need this if you
 962     * implement a hot reloading mechanism for Redux.
 963     *
 964     * @param {Function} nextReducer The reducer for the store to use instead.
 965     * @returns {void}
 966     */
 967  
 968  
 969    function replaceReducer(nextReducer) {
 970      if (typeof nextReducer !== 'function') {
 971        throw new Error( true ? formatProdErrorMessage(10) : undefined);
 972      }
 973  
 974      currentReducer = nextReducer; // This action has a similiar effect to ActionTypes.INIT.
 975      // Any reducers that existed in both the new and old rootReducer
 976      // will receive the previous state. This effectively populates
 977      // the new state tree with any relevant data from the old one.
 978  
 979      dispatch({
 980        type: ActionTypes.REPLACE
 981      });
 982    }
 983    /**
 984     * Interoperability point for observable/reactive libraries.
 985     * @returns {observable} A minimal observable of state changes.
 986     * For more information, see the observable proposal:
 987     * https://github.com/tc39/proposal-observable
 988     */
 989  
 990  
 991    function observable() {
 992      var _ref;
 993  
 994      var outerSubscribe = subscribe;
 995      return _ref = {
 996        /**
 997         * The minimal observable subscription method.
 998         * @param {Object} observer Any object that can be used as an observer.
 999         * The observer object should have a `next` method.
1000         * @returns {subscription} An object with an `unsubscribe` method that can
1001         * be used to unsubscribe the observable from the store, and prevent further
1002         * emission of values from the observable.
1003         */
1004        subscribe: function subscribe(observer) {
1005          if (typeof observer !== 'object' || observer === null) {
1006            throw new Error( true ? formatProdErrorMessage(11) : undefined);
1007          }
1008  
1009          function observeState() {
1010            if (observer.next) {
1011              observer.next(getState());
1012            }
1013          }
1014  
1015          observeState();
1016          var unsubscribe = outerSubscribe(observeState);
1017          return {
1018            unsubscribe: unsubscribe
1019          };
1020        }
1021      }, _ref[$$observable] = function () {
1022        return this;
1023      }, _ref;
1024    } // When a store is created, an "INIT" action is dispatched so that every
1025    // reducer returns their initial state. This effectively populates
1026    // the initial state tree.
1027  
1028  
1029    dispatch({
1030      type: ActionTypes.INIT
1031    });
1032    return _ref2 = {
1033      dispatch: dispatch,
1034      subscribe: subscribe,
1035      getState: getState,
1036      replaceReducer: replaceReducer
1037    }, _ref2[$$observable] = observable, _ref2;
1038  }
1039  
1040  /**
1041   * Prints a warning in the console if it exists.
1042   *
1043   * @param {String} message The warning message.
1044   * @returns {void}
1045   */
1046  function warning(message) {
1047    /* eslint-disable no-console */
1048    if (typeof console !== 'undefined' && typeof console.error === 'function') {
1049      console.error(message);
1050    }
1051    /* eslint-enable no-console */
1052  
1053  
1054    try {
1055      // This error was thrown as a convenience so that if you enable
1056      // "break on all exceptions" in your console,
1057      // it would pause the execution at this line.
1058      throw new Error(message);
1059    } catch (e) {} // eslint-disable-line no-empty
1060  
1061  }
1062  
1063  function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {
1064    var reducerKeys = Object.keys(reducers);
1065    var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';
1066  
1067    if (reducerKeys.length === 0) {
1068      return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';
1069    }
1070  
1071    if (!isPlainObject(inputState)) {
1072      return "The " + argumentName + " has unexpected type of \"" + kindOf(inputState) + "\". Expected argument to be an object with the following " + ("keys: \"" + reducerKeys.join('", "') + "\"");
1073    }
1074  
1075    var unexpectedKeys = Object.keys(inputState).filter(function (key) {
1076      return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];
1077    });
1078    unexpectedKeys.forEach(function (key) {
1079      unexpectedKeyCache[key] = true;
1080    });
1081    if (action && action.type === ActionTypes.REPLACE) return;
1082  
1083    if (unexpectedKeys.length > 0) {
1084      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.");
1085    }
1086  }
1087  
1088  function assertReducerShape(reducers) {
1089    Object.keys(reducers).forEach(function (key) {
1090      var reducer = reducers[key];
1091      var initialState = reducer(undefined, {
1092        type: ActionTypes.INIT
1093      });
1094  
1095      if (typeof initialState === 'undefined') {
1096        throw new Error( true ? formatProdErrorMessage(12) : undefined);
1097      }
1098  
1099      if (typeof reducer(undefined, {
1100        type: ActionTypes.PROBE_UNKNOWN_ACTION()
1101      }) === 'undefined') {
1102        throw new Error( true ? formatProdErrorMessage(13) : undefined);
1103      }
1104    });
1105  }
1106  /**
1107   * Turns an object whose values are different reducer functions, into a single
1108   * reducer function. It will call every child reducer, and gather their results
1109   * into a single state object, whose keys correspond to the keys of the passed
1110   * reducer functions.
1111   *
1112   * @param {Object} reducers An object whose values correspond to different
1113   * reducer functions that need to be combined into one. One handy way to obtain
1114   * it is to use ES6 `import * as reducers` syntax. The reducers may never return
1115   * undefined for any action. Instead, they should return their initial state
1116   * if the state passed to them was undefined, and the current state for any
1117   * unrecognized action.
1118   *
1119   * @returns {Function} A reducer function that invokes every reducer inside the
1120   * passed object, and builds a state object with the same shape.
1121   */
1122  
1123  
1124  function combineReducers(reducers) {
1125    var reducerKeys = Object.keys(reducers);
1126    var finalReducers = {};
1127  
1128    for (var i = 0; i < reducerKeys.length; i++) {
1129      var key = reducerKeys[i];
1130  
1131      if (false) {}
1132  
1133      if (typeof reducers[key] === 'function') {
1134        finalReducers[key] = reducers[key];
1135      }
1136    }
1137  
1138    var finalReducerKeys = Object.keys(finalReducers); // This is used to make sure we don't warn about the same
1139    // keys multiple times.
1140  
1141    var unexpectedKeyCache;
1142  
1143    if (false) {}
1144  
1145    var shapeAssertionError;
1146  
1147    try {
1148      assertReducerShape(finalReducers);
1149    } catch (e) {
1150      shapeAssertionError = e;
1151    }
1152  
1153    return function combination(state, action) {
1154      if (state === void 0) {
1155        state = {};
1156      }
1157  
1158      if (shapeAssertionError) {
1159        throw shapeAssertionError;
1160      }
1161  
1162      if (false) { var warningMessage; }
1163  
1164      var hasChanged = false;
1165      var nextState = {};
1166  
1167      for (var _i = 0; _i < finalReducerKeys.length; _i++) {
1168        var _key = finalReducerKeys[_i];
1169        var reducer = finalReducers[_key];
1170        var previousStateForKey = state[_key];
1171        var nextStateForKey = reducer(previousStateForKey, action);
1172  
1173        if (typeof nextStateForKey === 'undefined') {
1174          var actionType = action && action.type;
1175          throw new Error( true ? formatProdErrorMessage(14) : undefined);
1176        }
1177  
1178        nextState[_key] = nextStateForKey;
1179        hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
1180      }
1181  
1182      hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;
1183      return hasChanged ? nextState : state;
1184    };
1185  }
1186  
1187  function bindActionCreator(actionCreator, dispatch) {
1188    return function () {
1189      return dispatch(actionCreator.apply(this, arguments));
1190    };
1191  }
1192  /**
1193   * Turns an object whose values are action creators, into an object with the
1194   * same keys, but with every function wrapped into a `dispatch` call so they
1195   * may be invoked directly. This is just a convenience method, as you can call
1196   * `store.dispatch(MyActionCreators.doSomething())` yourself just fine.
1197   *
1198   * For convenience, you can also pass an action creator as the first argument,
1199   * and get a dispatch wrapped function in return.
1200   *
1201   * @param {Function|Object} actionCreators An object whose values are action
1202   * creator functions. One handy way to obtain it is to use ES6 `import * as`
1203   * syntax. You may also pass a single function.
1204   *
1205   * @param {Function} dispatch The `dispatch` function available on your Redux
1206   * store.
1207   *
1208   * @returns {Function|Object} The object mimicking the original object, but with
1209   * every action creator wrapped into the `dispatch` call. If you passed a
1210   * function as `actionCreators`, the return value will also be a single
1211   * function.
1212   */
1213  
1214  
1215  function bindActionCreators(actionCreators, dispatch) {
1216    if (typeof actionCreators === 'function') {
1217      return bindActionCreator(actionCreators, dispatch);
1218    }
1219  
1220    if (typeof actionCreators !== 'object' || actionCreators === null) {
1221      throw new Error( true ? formatProdErrorMessage(16) : undefined);
1222    }
1223  
1224    var boundActionCreators = {};
1225  
1226    for (var key in actionCreators) {
1227      var actionCreator = actionCreators[key];
1228  
1229      if (typeof actionCreator === 'function') {
1230        boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);
1231      }
1232    }
1233  
1234    return boundActionCreators;
1235  }
1236  
1237  /**
1238   * Composes single-argument functions from right to left. The rightmost
1239   * function can take multiple arguments as it provides the signature for
1240   * the resulting composite function.
1241   *
1242   * @param {...Function} funcs The functions to compose.
1243   * @returns {Function} A function obtained by composing the argument functions
1244   * from right to left. For example, compose(f, g, h) is identical to doing
1245   * (...args) => f(g(h(...args))).
1246   */
1247  function compose() {
1248    for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {
1249      funcs[_key] = arguments[_key];
1250    }
1251  
1252    if (funcs.length === 0) {
1253      return function (arg) {
1254        return arg;
1255      };
1256    }
1257  
1258    if (funcs.length === 1) {
1259      return funcs[0];
1260    }
1261  
1262    return funcs.reduce(function (a, b) {
1263      return function () {
1264        return a(b.apply(void 0, arguments));
1265      };
1266    });
1267  }
1268  
1269  /**
1270   * Creates a store enhancer that applies middleware to the dispatch method
1271   * of the Redux store. This is handy for a variety of tasks, such as expressing
1272   * asynchronous actions in a concise manner, or logging every action payload.
1273   *
1274   * See `redux-thunk` package as an example of the Redux middleware.
1275   *
1276   * Because middleware is potentially asynchronous, this should be the first
1277   * store enhancer in the composition chain.
1278   *
1279   * Note that each middleware will be given the `dispatch` and `getState` functions
1280   * as named arguments.
1281   *
1282   * @param {...Function} middlewares The middleware chain to be applied.
1283   * @returns {Function} A store enhancer applying the middleware.
1284   */
1285  
1286  function applyMiddleware() {
1287    for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) {
1288      middlewares[_key] = arguments[_key];
1289    }
1290  
1291    return function (createStore) {
1292      return function () {
1293        var store = createStore.apply(void 0, arguments);
1294  
1295        var _dispatch = function dispatch() {
1296          throw new Error( true ? formatProdErrorMessage(15) : undefined);
1297        };
1298  
1299        var middlewareAPI = {
1300          getState: store.getState,
1301          dispatch: function dispatch() {
1302            return _dispatch.apply(void 0, arguments);
1303          }
1304        };
1305        var chain = middlewares.map(function (middleware) {
1306          return middleware(middlewareAPI);
1307        });
1308        _dispatch = compose.apply(void 0, chain)(store.dispatch);
1309        return _objectSpread2(_objectSpread2({}, store), {}, {
1310          dispatch: _dispatch
1311        });
1312      };
1313    };
1314  }
1315  
1316  /*
1317   * This is a dummy function to check if the function name has been altered by minification.
1318   * If the function has been minified and NODE_ENV !== 'production', warn the user.
1319   */
1320  
1321  function isCrushed() {}
1322  
1323  if (false) {}
1324  
1325  
1326  
1327  // EXTERNAL MODULE: ./node_modules/equivalent-key-map/equivalent-key-map.js
1328  var equivalent_key_map = __webpack_require__("FtRg");
1329  var equivalent_key_map_default = /*#__PURE__*/__webpack_require__.n(equivalent_key_map);
1330  
1331  // EXTERNAL MODULE: external ["wp","reduxRoutine"]
1332  var external_wp_reduxRoutine_ = __webpack_require__("XIDh");
1333  var external_wp_reduxRoutine_default = /*#__PURE__*/__webpack_require__.n(external_wp_reduxRoutine_);
1334  
1335  // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/factory.js
1336  /**
1337   * Creates a selector function that takes additional curried argument with the
1338   * registry `select` function. While a regular selector has signature
1339   * ```js
1340   * ( state, ...selectorArgs ) => ( result )
1341   * ```
1342   * that allows to select data from the store's `state`, a registry selector
1343   * has signature:
1344   * ```js
1345   * ( select ) => ( state, ...selectorArgs ) => ( result )
1346   * ```
1347   * that supports also selecting from other registered stores.
1348   *
1349   * @example
1350   * ```js
1351   * const getCurrentPostId = createRegistrySelector( ( select ) => ( state ) => {
1352   *   return select( 'core/editor' ).getCurrentPostId();
1353   * } );
1354   *
1355   * const getPostEdits = createRegistrySelector( ( select ) => ( state ) => {
1356   *   // calling another registry selector just like any other function
1357   *   const postType = getCurrentPostType( state );
1358   *   const postId = getCurrentPostId( state );
1359   *     return select( 'core' ).getEntityRecordEdits( 'postType', postType, postId );
1360   * } );
1361   * ```
1362   *
1363   * Note how the `getCurrentPostId` selector can be called just like any other function,
1364   * (it works even inside a regular non-registry selector) and we don't need to pass the
1365   * registry as argument. The registry binding happens automatically when registering the selector
1366   * with a store.
1367   *
1368   * @param {Function} registrySelector Function receiving a registry `select`
1369   * function and returning a state selector.
1370   *
1371   * @return {Function} Registry selector that can be registered with a store.
1372   */
1373  function createRegistrySelector(registrySelector) {
1374    // create a selector function that is bound to the registry referenced by `selector.registry`
1375    // and that has the same API as a regular selector. Binding it in such a way makes it
1376    // possible to call the selector directly from another selector.
1377    const selector = (...args) => registrySelector(selector.registry.select)(...args);
1378    /**
1379     * Flag indicating that the selector is a registry selector that needs the correct registry
1380     * reference to be assigned to `selecto.registry` to make it work correctly.
1381     * be mapped as a registry selector.
1382     *
1383     * @type {boolean}
1384     */
1385  
1386  
1387    selector.isRegistrySelector = true;
1388    return selector;
1389  }
1390  /**
1391   * Creates a control function that takes additional curried argument with the `registry` object.
1392   * While a regular control has signature
1393   * ```js
1394   * ( action ) => ( iteratorOrPromise )
1395   * ```
1396   * where the control works with the `action` that it's bound to, a registry control has signature:
1397   * ```js
1398   * ( registry ) => ( action ) => ( iteratorOrPromise )
1399   * ```
1400   * A registry control is typically used to select data or dispatch an action to a registered
1401   * store.
1402   *
1403   * When registering a control created with `createRegistryControl` with a store, the store
1404   * knows which calling convention to use when executing the control.
1405   *
1406   * @param {Function} registryControl Function receiving a registry object and returning a control.
1407   *
1408   * @return {Function} Registry control that can be registered with a store.
1409   */
1410  
1411  function createRegistryControl(registryControl) {
1412    registryControl.isRegistryControl = true;
1413    return registryControl;
1414  }
1415  
1416  // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/controls.js
1417  /**
1418   * Internal dependencies
1419   */
1420  
1421  const SELECT = '@@data/SELECT';
1422  const RESOLVE_SELECT = '@@data/RESOLVE_SELECT';
1423  const DISPATCH = '@@data/DISPATCH';
1424  /**
1425   * Dispatches a control action for triggering a synchronous registry select.
1426   *
1427   * Note: This control synchronously returns the current selector value, triggering the
1428   * resolution, but not waiting for it.
1429   *
1430   * @param {string} storeKey     The key for the store the selector belongs to.
1431   * @param {string} selectorName The name of the selector.
1432   * @param {Array}  args         Arguments for the selector.
1433   *
1434   * @example
1435   * ```js
1436   * import { controls } from '@wordpress/data';
1437   *
1438   * // Action generator using `select`.
1439   * export function* myAction() {
1440   *   const isEditorSideBarOpened = yield controls.select( 'core/edit-post', 'isEditorSideBarOpened' );
1441   *   // Do stuff with the result from the `select`.
1442   * }
1443   * ```
1444   *
1445   * @return {Object} The control descriptor.
1446   */
1447  
1448  function controls_select(storeKey, selectorName, ...args) {
1449    return {
1450      type: SELECT,
1451      storeKey,
1452      selectorName,
1453      args
1454    };
1455  }
1456  /**
1457   * Dispatches a control action for triggering and resolving a registry select.
1458   *
1459   * Note: when this control action is handled, it automatically considers
1460   * selectors that may have a resolver. In such case, it will return a `Promise` that resolves
1461   * after the selector finishes resolving, with the final result value.
1462   *
1463   * @param {string} storeKey      The key for the store the selector belongs to
1464   * @param {string} selectorName  The name of the selector
1465   * @param {Array}  args          Arguments for the selector.
1466   *
1467   * @example
1468   * ```js
1469   * import { controls } from '@wordpress/data';
1470   *
1471   * // Action generator using resolveSelect
1472   * export function* myAction() {
1473   *     const isSidebarOpened = yield controls.resolveSelect( 'core/edit-post', 'isEditorSideBarOpened' );
1474   *     // do stuff with the result from the select.
1475   * }
1476   * ```
1477   *
1478   * @return {Object} The control descriptor.
1479   */
1480  
1481  
1482  function controls_resolveSelect(storeKey, selectorName, ...args) {
1483    return {
1484      type: RESOLVE_SELECT,
1485      storeKey,
1486      selectorName,
1487      args
1488    };
1489  }
1490  /**
1491   * Dispatches a control action for triggering a registry dispatch.
1492   *
1493   * @param {string} storeKey    The key for the store the action belongs to
1494   * @param {string} actionName  The name of the action to dispatch
1495   * @param {Array}  args        Arguments for the dispatch action.
1496   *
1497   * @example
1498   * ```js
1499   * import { controls } from '@wordpress/data-controls';
1500   *
1501   * // Action generator using dispatch
1502   * export function* myAction() {
1503   *   yield controls.dispatch( 'core/edit-post', 'togglePublishSidebar' );
1504   *   // do some other things.
1505   * }
1506   * ```
1507   *
1508   * @return {Object}  The control descriptor.
1509   */
1510  
1511  
1512  function controls_dispatch(storeKey, actionName, ...args) {
1513    return {
1514      type: DISPATCH,
1515      storeKey,
1516      actionName,
1517      args
1518    };
1519  }
1520  
1521  const controls_controls = {
1522    select: controls_select,
1523    resolveSelect: controls_resolveSelect,
1524    dispatch: controls_dispatch
1525  };
1526  const builtinControls = {
1527    [SELECT]: createRegistryControl(registry => ({
1528      storeKey,
1529      selectorName,
1530      args
1531    }) => registry.select(storeKey)[selectorName](...args)),
1532    [RESOLVE_SELECT]: createRegistryControl(registry => ({
1533      storeKey,
1534      selectorName,
1535      args
1536    }) => {
1537      const method = registry.select(storeKey)[selectorName].hasResolver ? 'resolveSelect' : 'select';
1538      return registry[method](storeKey)[selectorName](...args);
1539    }),
1540    [DISPATCH]: createRegistryControl(registry => ({
1541      storeKey,
1542      actionName,
1543      args
1544    }) => registry.dispatch(storeKey)[actionName](...args))
1545  };
1546  
1547  // EXTERNAL MODULE: ./node_modules/is-promise/index.js
1548  var is_promise = __webpack_require__("JlUD");
1549  var is_promise_default = /*#__PURE__*/__webpack_require__.n(is_promise);
1550  
1551  // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/promise-middleware.js
1552  /**
1553   * External dependencies
1554   */
1555  
1556  /**
1557   * Simplest possible promise redux middleware.
1558   *
1559   * @return {Function} middleware.
1560   */
1561  
1562  const promiseMiddleware = () => next => action => {
1563    if (is_promise_default()(action)) {
1564      return action.then(resolvedAction => {
1565        if (resolvedAction) {
1566          return next(resolvedAction);
1567        }
1568      });
1569    }
1570  
1571    return next(action);
1572  };
1573  
1574  /* harmony default export */ var promise_middleware = (promiseMiddleware);
1575  
1576  // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/resolvers-cache-middleware.js
1577  /**
1578   * External dependencies
1579   */
1580  
1581  /** @typedef {import('./registry').WPDataRegistry} WPDataRegistry */
1582  
1583  /**
1584   * Creates a middleware handling resolvers cache invalidation.
1585   *
1586   * @param {WPDataRegistry} registry   The registry reference for which to create
1587   *                                    the middleware.
1588   * @param {string}         reducerKey The namespace for which to create the
1589   *                                    middleware.
1590   *
1591   * @return {Function} Middleware function.
1592   */
1593  
1594  const createResolversCacheMiddleware = (registry, reducerKey) => () => next => action => {
1595    const resolvers = registry.select('core/data').getCachedResolvers(reducerKey);
1596    Object.entries(resolvers).forEach(([selectorName, resolversByArgs]) => {
1597      const resolver = Object(external_lodash_["get"])(registry.stores, [reducerKey, 'resolvers', selectorName]);
1598  
1599      if (!resolver || !resolver.shouldInvalidate) {
1600        return;
1601      }
1602  
1603      resolversByArgs.forEach((value, args) => {
1604        // resolversByArgs is the map Map([ args ] => boolean) storing the cache resolution status for a given selector.
1605        // If the value is false it means this resolver has finished its resolution which means we need to invalidate it,
1606        // if it's true it means it's inflight and the invalidation is not necessary.
1607        if (value !== false || !resolver.shouldInvalidate(action, ...args)) {
1608          return;
1609        } // Trigger cache invalidation
1610  
1611  
1612        registry.dispatch('core/data').invalidateResolution(reducerKey, selectorName, args);
1613      });
1614    });
1615    return next(action);
1616  };
1617  
1618  /* harmony default export */ var resolvers_cache_middleware = (createResolversCacheMiddleware);
1619  
1620  // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/redux-store/thunk-middleware.js
1621  function createThunkMiddleware(args) {
1622    return () => next => action => {
1623      if (typeof action === 'function') {
1624        return action(args);
1625      }
1626  
1627      return next(action);
1628    };
1629  }
1630  
1631  // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/redux-store/metadata/utils.js
1632  /**
1633   * Higher-order reducer creator which creates a combined reducer object, keyed
1634   * by a property on the action object.
1635   *
1636   * @param {string} actionProperty Action property by which to key object.
1637   *
1638   * @return {Function} Higher-order reducer.
1639   */
1640  const onSubKey = actionProperty => reducer => (state = {}, action) => {
1641    // Retrieve subkey from action. Do not track if undefined; useful for cases
1642    // where reducer is scoped by action shape.
1643    const key = action[actionProperty];
1644  
1645    if (key === undefined) {
1646      return state;
1647    } // Avoid updating state if unchanged. Note that this also accounts for a
1648    // reducer which returns undefined on a key which is not yet tracked.
1649  
1650  
1651    const nextKeyState = reducer(state[key], action);
1652  
1653    if (nextKeyState === state[key]) {
1654      return state;
1655    }
1656  
1657    return { ...state,
1658      [key]: nextKeyState
1659    };
1660  };
1661  
1662  // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/redux-store/metadata/reducer.js
1663  /**
1664   * External dependencies
1665   */
1666  
1667  
1668  /**
1669   * Internal dependencies
1670   */
1671  
1672  
1673  /**
1674   * Reducer function returning next state for selector resolution of
1675   * subkeys, object form:
1676   *
1677   *  selectorName -> EquivalentKeyMap<Array,boolean>
1678   *
1679   * @param {Object} state  Current state.
1680   * @param {Object} action Dispatched action.
1681   *
1682   * @return {Object} Next state.
1683   */
1684  
1685  const subKeysIsResolved = onSubKey('selectorName')((state = new equivalent_key_map_default.a(), action) => {
1686    switch (action.type) {
1687      case 'START_RESOLUTION':
1688      case 'FINISH_RESOLUTION':
1689        {
1690          const isStarting = action.type === 'START_RESOLUTION';
1691          const nextState = new equivalent_key_map_default.a(state);
1692          nextState.set(action.args, isStarting);
1693          return nextState;
1694        }
1695  
1696      case 'START_RESOLUTIONS':
1697      case 'FINISH_RESOLUTIONS':
1698        {
1699          const isStarting = action.type === 'START_RESOLUTIONS';
1700          const nextState = new equivalent_key_map_default.a(state);
1701  
1702          for (const resolutionArgs of action.args) {
1703            nextState.set(resolutionArgs, isStarting);
1704          }
1705  
1706          return nextState;
1707        }
1708  
1709      case 'INVALIDATE_RESOLUTION':
1710        {
1711          const nextState = new equivalent_key_map_default.a(state);
1712          nextState.delete(action.args);
1713          return nextState;
1714        }
1715    }
1716  
1717    return state;
1718  });
1719  /**
1720   * Reducer function returning next state for selector resolution, object form:
1721   *
1722   *   selectorName -> EquivalentKeyMap<Array, boolean>
1723   *
1724   * @param {Object} state   Current state.
1725   * @param {Object} action  Dispatched action.
1726   *
1727   * @return {Object} Next state.
1728   */
1729  
1730  const isResolved = (state = {}, action) => {
1731    switch (action.type) {
1732      case 'INVALIDATE_RESOLUTION_FOR_STORE':
1733        return {};
1734  
1735      case 'INVALIDATE_RESOLUTION_FOR_STORE_SELECTOR':
1736        return Object(external_lodash_["has"])(state, [action.selectorName]) ? Object(external_lodash_["omit"])(state, [action.selectorName]) : state;
1737  
1738      case 'START_RESOLUTION':
1739      case 'FINISH_RESOLUTION':
1740      case 'START_RESOLUTIONS':
1741      case 'FINISH_RESOLUTIONS':
1742      case 'INVALIDATE_RESOLUTION':
1743        return subKeysIsResolved(state, action);
1744    }
1745  
1746    return state;
1747  };
1748  
1749  /* harmony default export */ var metadata_reducer = (isResolved);
1750  
1751  // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/redux-store/metadata/selectors.js
1752  /**
1753   * External dependencies
1754   */
1755  
1756  /**
1757   * Returns the raw `isResolving` value for a given selector name,
1758   * and arguments set. May be undefined if the selector has never been resolved
1759   * or not resolved for the given set of arguments, otherwise true or false for
1760   * resolution started and completed respectively.
1761   *
1762   * @param {Object} state        Data state.
1763   * @param {string} selectorName Selector name.
1764   * @param {Array}  args         Arguments passed to selector.
1765   *
1766   * @return {?boolean} isResolving value.
1767   */
1768  
1769  function getIsResolving(state, selectorName, args) {
1770    const map = Object(external_lodash_["get"])(state, [selectorName]);
1771  
1772    if (!map) {
1773      return;
1774    }
1775  
1776    return map.get(args);
1777  }
1778  /**
1779   * Returns true if resolution has already been triggered for a given
1780   * selector name, and arguments set.
1781   *
1782   * @param {Object} state        Data state.
1783   * @param {string} selectorName Selector name.
1784   * @param {?Array} args         Arguments passed to selector (default `[]`).
1785   *
1786   * @return {boolean} Whether resolution has been triggered.
1787   */
1788  
1789  function hasStartedResolution(state, selectorName, args = []) {
1790    return getIsResolving(state, selectorName, args) !== undefined;
1791  }
1792  /**
1793   * Returns true if resolution has completed for a given selector
1794   * name, and arguments set.
1795   *
1796   * @param {Object} state        Data state.
1797   * @param {string} selectorName Selector name.
1798   * @param {?Array} args         Arguments passed to selector.
1799   *
1800   * @return {boolean} Whether resolution has completed.
1801   */
1802  
1803  function hasFinishedResolution(state, selectorName, args = []) {
1804    return getIsResolving(state, selectorName, args) === false;
1805  }
1806  /**
1807   * Returns true if resolution has been triggered but has not yet completed for
1808   * a given selector name, and arguments set.
1809   *
1810   * @param {Object} state        Data state.
1811   * @param {string} selectorName Selector name.
1812   * @param {?Array} args         Arguments passed to selector.
1813   *
1814   * @return {boolean} Whether resolution is in progress.
1815   */
1816  
1817  function isResolving(state, selectorName, args = []) {
1818    return getIsResolving(state, selectorName, args) === true;
1819  }
1820  /**
1821   * Returns the list of the cached resolvers.
1822   *
1823   * @param {Object} state      Data state.
1824   *
1825   * @return {Object} Resolvers mapped by args and selectorName.
1826   */
1827  
1828  function getCachedResolvers(state) {
1829    return state;
1830  }
1831  
1832  // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/redux-store/metadata/actions.js
1833  /**
1834   * Returns an action object used in signalling that selector resolution has
1835   * started.
1836   *
1837   * @param {string} selectorName Name of selector for which resolver triggered.
1838   * @param {...*}   args         Arguments to associate for uniqueness.
1839   *
1840   * @return {Object} Action object.
1841   */
1842  function startResolution(selectorName, args) {
1843    return {
1844      type: 'START_RESOLUTION',
1845      selectorName,
1846      args
1847    };
1848  }
1849  /**
1850   * Returns an action object used in signalling that selector resolution has
1851   * completed.
1852   *
1853   * @param {string} selectorName Name of selector for which resolver triggered.
1854   * @param {...*}   args         Arguments to associate for uniqueness.
1855   *
1856   * @return {Object} Action object.
1857   */
1858  
1859  function finishResolution(selectorName, args) {
1860    return {
1861      type: 'FINISH_RESOLUTION',
1862      selectorName,
1863      args
1864    };
1865  }
1866  /**
1867   * Returns an action object used in signalling that a batch of selector resolutions has
1868   * started.
1869   *
1870   * @param {string} selectorName Name of selector for which resolver triggered.
1871   * @param {...*}   args         Array of arguments to associate for uniqueness, each item
1872   *                                 is associated to a resolution.
1873   *
1874   * @return {Object} Action object.
1875   */
1876  
1877  function startResolutions(selectorName, args) {
1878    return {
1879      type: 'START_RESOLUTIONS',
1880      selectorName,
1881      args
1882    };
1883  }
1884  /**
1885   * Returns an action object used in signalling that a batch of selector resolutions has
1886   * completed.
1887   *
1888   * @param {string} selectorName Name of selector for which resolver triggered.
1889   * @param {...*}   args         Array of arguments to associate for uniqueness, each item
1890   *                                 is associated to a resolution.
1891   *
1892   * @return {Object} Action object.
1893   */
1894  
1895  function finishResolutions(selectorName, args) {
1896    return {
1897      type: 'FINISH_RESOLUTIONS',
1898      selectorName,
1899      args
1900    };
1901  }
1902  /**
1903   * Returns an action object used in signalling that we should invalidate the resolution cache.
1904   *
1905   * @param {string} selectorName Name of selector for which resolver should be invalidated.
1906   * @param {Array}  args         Arguments to associate for uniqueness.
1907   *
1908   * @return {Object} Action object.
1909   */
1910  
1911  function invalidateResolution(selectorName, args) {
1912    return {
1913      type: 'INVALIDATE_RESOLUTION',
1914      selectorName,
1915      args
1916    };
1917  }
1918  /**
1919   * Returns an action object used in signalling that the resolution
1920   * should be invalidated.
1921   *
1922   * @return {Object} Action object.
1923   */
1924  
1925  function invalidateResolutionForStore() {
1926    return {
1927      type: 'INVALIDATE_RESOLUTION_FOR_STORE'
1928    };
1929  }
1930  /**
1931   * Returns an action object used in signalling that the resolution cache for a
1932   * given selectorName should be invalidated.
1933   *
1934   * @param {string} selectorName Name of selector for which all resolvers should
1935   *                              be invalidated.
1936   *
1937   * @return  {Object} Action object.
1938   */
1939  
1940  function invalidateResolutionForStoreSelector(selectorName) {
1941    return {
1942      type: 'INVALIDATE_RESOLUTION_FOR_STORE_SELECTOR',
1943      selectorName
1944    };
1945  }
1946  
1947  // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/redux-store/index.js
1948  /**
1949   * External dependencies
1950   */
1951  
1952  
1953  
1954  
1955  /**
1956   * WordPress dependencies
1957   */
1958  
1959  
1960  /**
1961   * Internal dependencies
1962   */
1963  
1964  
1965  
1966  
1967  
1968  
1969  
1970  
1971  /** @typedef {import('../types').WPDataRegistry} WPDataRegistry */
1972  
1973  /** @typedef {import('../types').WPDataStore} WPDataStore */
1974  
1975  /** @typedef {import('../types').WPDataReduxStoreConfig} WPDataReduxStoreConfig */
1976  
1977  /**
1978   * Create a cache to track whether resolvers started running or not.
1979   *
1980   * @return {Object} Resolvers Cache.
1981   */
1982  
1983  function createResolversCache() {
1984    const cache = {};
1985    return {
1986      isRunning(selectorName, args) {
1987        return cache[selectorName] && cache[selectorName].get(args);
1988      },
1989  
1990      clear(selectorName, args) {
1991        if (cache[selectorName]) {
1992          cache[selectorName].delete(args);
1993        }
1994      },
1995  
1996      markAsRunning(selectorName, args) {
1997        if (!cache[selectorName]) {
1998          cache[selectorName] = new equivalent_key_map_default.a();
1999        }
2000  
2001        cache[selectorName].set(args, true);
2002      }
2003  
2004    };
2005  }
2006  /**
2007   * Creates a data store definition for the provided Redux store options containing
2008   * properties describing reducer, actions, selectors, controls and resolvers.
2009   *
2010   * @example
2011   * ```js
2012   * import { createReduxStore } from '@wordpress/data';
2013   *
2014   * const store = createReduxStore( 'demo', {
2015   *     reducer: ( state = 'OK' ) => state,
2016   *     selectors: {
2017   *         getValue: ( state ) => state,
2018   *     },
2019   * } );
2020   * ```
2021   *
2022   * @param {string}                 key      Unique namespace identifier.
2023   * @param {WPDataReduxStoreConfig} options  Registered store options, with properties
2024   *                                          describing reducer, actions, selectors,
2025   *                                          and resolvers.
2026   *
2027   * @return {WPDataStore} Store Object.
2028   */
2029  
2030  
2031  function createReduxStore(key, options) {
2032    return {
2033      name: key,
2034      instantiate: registry => {
2035        const reducer = options.reducer;
2036        const thunkArgs = {
2037          registry,
2038  
2039          get dispatch() {
2040            return Object.assign(action => store.dispatch(action), getActions());
2041          },
2042  
2043          get select() {
2044            return Object.assign(selector => selector(store.__unstableOriginalGetState()), getSelectors());
2045          },
2046  
2047          get resolveSelect() {
2048            return getResolveSelectors();
2049          }
2050  
2051        };
2052        const store = instantiateReduxStore(key, options, registry, thunkArgs);
2053        const resolversCache = createResolversCache();
2054        let resolvers;
2055        const actions = mapActions({ ...actions_namespaceObject,
2056          ...options.actions
2057        }, store);
2058        let selectors = mapSelectors({ ...Object(external_lodash_["mapValues"])(selectors_namespaceObject, selector => (state, ...args) => selector(state.metadata, ...args)),
2059          ...Object(external_lodash_["mapValues"])(options.selectors, selector => {
2060            if (selector.isRegistrySelector) {
2061              selector.registry = registry;
2062            }
2063  
2064            return (state, ...args) => selector(state.root, ...args);
2065          })
2066        }, store);
2067  
2068        if (options.resolvers) {
2069          const result = mapResolvers(options.resolvers, selectors, store, resolversCache);
2070          resolvers = result.resolvers;
2071          selectors = result.selectors;
2072        }
2073  
2074        const resolveSelectors = mapResolveSelectors(selectors, store);
2075  
2076        const getSelectors = () => selectors;
2077  
2078        const getActions = () => actions;
2079  
2080        const getResolveSelectors = () => resolveSelectors; // We have some modules monkey-patching the store object
2081        // It's wrong to do so but until we refactor all of our effects to controls
2082        // We need to keep the same "store" instance here.
2083  
2084  
2085        store.__unstableOriginalGetState = store.getState;
2086  
2087        store.getState = () => store.__unstableOriginalGetState().root; // Customize subscribe behavior to call listeners only on effective change,
2088        // not on every dispatch.
2089  
2090  
2091        const subscribe = store && (listener => {
2092          let lastState = store.__unstableOriginalGetState();
2093  
2094          return store.subscribe(() => {
2095            const state = store.__unstableOriginalGetState();
2096  
2097            const hasChanged = state !== lastState;
2098            lastState = state;
2099  
2100            if (hasChanged) {
2101              listener();
2102            }
2103          });
2104        }); // This can be simplified to just { subscribe, getSelectors, getActions }
2105        // Once we remove the use function.
2106  
2107  
2108        return {
2109          reducer,
2110          store,
2111          actions,
2112          selectors,
2113          resolvers,
2114          getSelectors,
2115          getResolveSelectors,
2116          getActions,
2117          subscribe
2118        };
2119      }
2120    };
2121  }
2122  /**
2123   * Creates a redux store for a namespace.
2124   *
2125   * @param {string}         key      Unique namespace identifier.
2126   * @param {Object}         options  Registered store options, with properties
2127   *                                  describing reducer, actions, selectors,
2128   *                                  and resolvers.
2129   * @param {WPDataRegistry} registry Registry reference.
2130   * @param {Object} thunkArgs        Argument object for the thunk middleware.
2131   * @return {Object} Newly created redux store.
2132   */
2133  
2134  function instantiateReduxStore(key, options, registry, thunkArgs) {
2135    const controls = { ...options.controls,
2136      ...builtinControls
2137    };
2138    const normalizedControls = Object(external_lodash_["mapValues"])(controls, control => control.isRegistryControl ? control(registry) : control);
2139    const middlewares = [resolvers_cache_middleware(registry, key), promise_middleware, external_wp_reduxRoutine_default()(normalizedControls)];
2140  
2141    if (options.__experimentalUseThunks) {
2142      middlewares.push(createThunkMiddleware(thunkArgs));
2143    }
2144  
2145    const enhancers = [applyMiddleware(...middlewares)];
2146  
2147    if (typeof window !== 'undefined' && window.__REDUX_DEVTOOLS_EXTENSION__) {
2148      enhancers.push(window.__REDUX_DEVTOOLS_EXTENSION__({
2149        name: key,
2150        instanceId: key
2151      }));
2152    }
2153  
2154    const {
2155      reducer,
2156      initialState
2157    } = options;
2158    const enhancedReducer = turbo_combine_reducers_default()({
2159      metadata: metadata_reducer,
2160      root: reducer
2161    });
2162    return redux_createStore(enhancedReducer, {
2163      root: initialState
2164    }, Object(external_lodash_["flowRight"])(enhancers));
2165  }
2166  /**
2167   * Maps selectors to a store.
2168   *
2169   * @param {Object} selectors Selectors to register. Keys will be used as the
2170   *                           public facing API. Selectors will get passed the
2171   *                           state as first argument.
2172   * @param {Object} store     The store to which the selectors should be mapped.
2173   * @return {Object} Selectors mapped to the provided store.
2174   */
2175  
2176  
2177  function mapSelectors(selectors, store) {
2178    const createStateSelector = registrySelector => {
2179      const selector = function runSelector() {
2180        // This function is an optimized implementation of:
2181        //
2182        //   selector( store.getState(), ...arguments )
2183        //
2184        // Where the above would incur an `Array#concat` in its application,
2185        // the logic here instead efficiently constructs an arguments array via
2186        // direct assignment.
2187        const argsLength = arguments.length;
2188        const args = new Array(argsLength + 1);
2189        args[0] = store.__unstableOriginalGetState();
2190  
2191        for (let i = 0; i < argsLength; i++) {
2192          args[i + 1] = arguments[i];
2193        }
2194  
2195        return registrySelector(...args);
2196      };
2197  
2198      selector.hasResolver = false;
2199      return selector;
2200    };
2201  
2202    return Object(external_lodash_["mapValues"])(selectors, createStateSelector);
2203  }
2204  /**
2205   * Maps actions to dispatch from a given store.
2206   *
2207   * @param {Object} actions    Actions to register.
2208   * @param {Object} store      The redux store to which the actions should be mapped.
2209   * @return {Object}           Actions mapped to the redux store provided.
2210   */
2211  
2212  
2213  function mapActions(actions, store) {
2214    const createBoundAction = action => (...args) => {
2215      return Promise.resolve(store.dispatch(action(...args)));
2216    };
2217  
2218    return Object(external_lodash_["mapValues"])(actions, createBoundAction);
2219  }
2220  /**
2221   * Maps selectors to functions that return a resolution promise for them
2222   *
2223   * @param {Object} selectors Selectors to map.
2224   * @param {Object} store     The redux store the selectors select from.
2225   * @return {Object}          Selectors mapped to their resolution functions.
2226   */
2227  
2228  
2229  function mapResolveSelectors(selectors, store) {
2230    return Object(external_lodash_["mapValues"])(Object(external_lodash_["omit"])(selectors, ['getIsResolving', 'hasStartedResolution', 'hasFinishedResolution', 'isResolving', 'getCachedResolvers']), (selector, selectorName) => (...args) => new Promise(resolve => {
2231      const hasFinished = () => selectors.hasFinishedResolution(selectorName, args);
2232  
2233      const getResult = () => selector.apply(null, args); // trigger the selector (to trigger the resolver)
2234  
2235  
2236      const result = getResult();
2237  
2238      if (hasFinished()) {
2239        return resolve(result);
2240      }
2241  
2242      const unsubscribe = store.subscribe(() => {
2243        if (hasFinished()) {
2244          unsubscribe();
2245          resolve(getResult());
2246        }
2247      });
2248    }));
2249  }
2250  /**
2251   * Returns resolvers with matched selectors for a given namespace.
2252   * Resolvers are side effects invoked once per argument set of a given selector call,
2253   * used in ensuring that the data needs for the selector are satisfied.
2254   *
2255   * @param {Object} resolvers      Resolvers to register.
2256   * @param {Object} selectors      The current selectors to be modified.
2257   * @param {Object} store          The redux store to which the resolvers should be mapped.
2258   * @param {Object} resolversCache Resolvers Cache.
2259   */
2260  
2261  
2262  function mapResolvers(resolvers, selectors, store, resolversCache) {
2263    // The `resolver` can be either a function that does the resolution, or, in more advanced
2264    // cases, an object with a `fullfill` method and other optional methods like `isFulfilled`.
2265    // Here we normalize the `resolver` function to an object with `fulfill` method.
2266    const mappedResolvers = Object(external_lodash_["mapValues"])(resolvers, resolver => {
2267      if (resolver.fulfill) {
2268        return resolver;
2269      }
2270  
2271      return { ...resolver,
2272        // copy the enumerable properties of the resolver function
2273        fulfill: resolver // add the fulfill method
2274  
2275      };
2276    });
2277  
2278    const mapSelector = (selector, selectorName) => {
2279      const resolver = resolvers[selectorName];
2280  
2281      if (!resolver) {
2282        selector.hasResolver = false;
2283        return selector;
2284      }
2285  
2286      const selectorResolver = (...args) => {
2287        async function fulfillSelector() {
2288          const state = store.getState();
2289  
2290          if (resolversCache.isRunning(selectorName, args) || typeof resolver.isFulfilled === 'function' && resolver.isFulfilled(state, ...args)) {
2291            return;
2292          }
2293  
2294          const {
2295            metadata
2296          } = store.__unstableOriginalGetState();
2297  
2298          if (hasStartedResolution(metadata, selectorName, args)) {
2299            return;
2300          }
2301  
2302          resolversCache.markAsRunning(selectorName, args);
2303          setTimeout(async () => {
2304            resolversCache.clear(selectorName, args);
2305            store.dispatch(startResolution(selectorName, args));
2306            await fulfillResolver(store, mappedResolvers, selectorName, ...args);
2307            store.dispatch(finishResolution(selectorName, args));
2308          });
2309        }
2310  
2311        fulfillSelector(...args);
2312        return selector(...args);
2313      };
2314  
2315      selectorResolver.hasResolver = true;
2316      return selectorResolver;
2317    };
2318  
2319    return {
2320      resolvers: mappedResolvers,
2321      selectors: Object(external_lodash_["mapValues"])(selectors, mapSelector)
2322    };
2323  }
2324  /**
2325   * Calls a resolver given arguments
2326   *
2327   * @param {Object} store        Store reference, for fulfilling via resolvers
2328   * @param {Object} resolvers    Store Resolvers
2329   * @param {string} selectorName Selector name to fulfill.
2330   * @param {Array} args          Selector Arguments.
2331   */
2332  
2333  
2334  async function fulfillResolver(store, resolvers, selectorName, ...args) {
2335    const resolver = Object(external_lodash_["get"])(resolvers, [selectorName]);
2336  
2337    if (!resolver) {
2338      return;
2339    }
2340  
2341    const action = resolver.fulfill(...args);
2342  
2343    if (action) {
2344      await store.dispatch(action);
2345    }
2346  }
2347  
2348  // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/store/index.js
2349  function createCoreDataStore(registry) {
2350    const getCoreDataSelector = selectorName => (key, ...args) => {
2351      return registry.select(key)[selectorName](...args);
2352    };
2353  
2354    const getCoreDataAction = actionName => (key, ...args) => {
2355      return registry.dispatch(key)[actionName](...args);
2356    };
2357  
2358    return {
2359      getSelectors() {
2360        return ['getIsResolving', 'hasStartedResolution', 'hasFinishedResolution', 'isResolving', 'getCachedResolvers'].reduce((memo, selectorName) => ({ ...memo,
2361          [selectorName]: getCoreDataSelector(selectorName)
2362        }), {});
2363      },
2364  
2365      getActions() {
2366        return ['startResolution', 'finishResolution', 'invalidateResolution', 'invalidateResolutionForStore', 'invalidateResolutionForStoreSelector'].reduce((memo, actionName) => ({ ...memo,
2367          [actionName]: getCoreDataAction(actionName)
2368        }), {});
2369      },
2370  
2371      subscribe() {
2372        // There's no reasons to trigger any listener when we subscribe to this store
2373        // because there's no state stored in this store that need to retrigger selectors
2374        // if a change happens, the corresponding store where the tracking stated live
2375        // would have already triggered a "subscribe" call.
2376        return () => {};
2377      }
2378  
2379    };
2380  }
2381  
2382  /* harmony default export */ var build_module_store = (createCoreDataStore);
2383  
2384  // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/registry.js
2385  /**
2386   * External dependencies
2387   */
2388  
2389  /**
2390   * Internal dependencies
2391   */
2392  
2393  
2394  
2395  /** @typedef {import('./types').WPDataStore} WPDataStore */
2396  
2397  /**
2398   * @typedef {Object} WPDataRegistry An isolated orchestrator of store registrations.
2399   *
2400   * @property {Function} registerGenericStore Given a namespace key and settings
2401   *                                           object, registers a new generic
2402   *                                           store.
2403   * @property {Function} registerStore        Given a namespace key and settings
2404   *                                           object, registers a new namespace
2405   *                                           store.
2406   * @property {Function} subscribe            Given a function callback, invokes
2407   *                                           the callback on any change to state
2408   *                                           within any registered store.
2409   * @property {Function} select               Given a namespace key, returns an
2410   *                                           object of the  store's registered
2411   *                                           selectors.
2412   * @property {Function} dispatch             Given a namespace key, returns an
2413   *                                           object of the store's registered
2414   *                                           action dispatchers.
2415   */
2416  
2417  /**
2418   * @typedef {Object} WPDataPlugin An object of registry function overrides.
2419   *
2420   * @property {Function} registerStore registers store.
2421   */
2422  
2423  /**
2424   * Creates a new store registry, given an optional object of initial store
2425   * configurations.
2426   *
2427   * @param {Object}  storeConfigs Initial store configurations.
2428   * @param {Object?} parent       Parent registry.
2429   *
2430   * @return {WPDataRegistry} Data registry.
2431   */
2432  
2433  function createRegistry(storeConfigs = {}, parent = null) {
2434    const stores = {};
2435    let listeners = [];
2436  
2437    const __experimentalListeningStores = new Set();
2438    /**
2439     * Global listener called for each store's update.
2440     */
2441  
2442  
2443    function globalListener() {
2444      listeners.forEach(listener => listener());
2445    }
2446    /**
2447     * Subscribe to changes to any data.
2448     *
2449     * @param {Function}   listener Listener function.
2450     *
2451     * @return {Function}           Unsubscribe function.
2452     */
2453  
2454  
2455    const subscribe = listener => {
2456      listeners.push(listener);
2457      return () => {
2458        listeners = Object(external_lodash_["without"])(listeners, listener);
2459      };
2460    };
2461    /**
2462     * Calls a selector given the current state and extra arguments.
2463     *
2464     * @param {string|WPDataStore} storeNameOrDefinition Unique namespace identifier for the store
2465     *                                                   or the store definition.
2466     *
2467     * @return {*} The selector's returned value.
2468     */
2469  
2470  
2471    function select(storeNameOrDefinition) {
2472      const storeName = Object(external_lodash_["isObject"])(storeNameOrDefinition) ? storeNameOrDefinition.name : storeNameOrDefinition;
2473  
2474      __experimentalListeningStores.add(storeName);
2475  
2476      const store = stores[storeName];
2477  
2478      if (store) {
2479        return store.getSelectors();
2480      }
2481  
2482      return parent && parent.select(storeName);
2483    }
2484  
2485    function __experimentalMarkListeningStores(callback, ref) {
2486      __experimentalListeningStores.clear();
2487  
2488      const result = callback.call(this);
2489      ref.current = Array.from(__experimentalListeningStores);
2490      return result;
2491    }
2492    /**
2493     * Given the name of a registered store, returns an object containing the store's
2494     * selectors pre-bound to state so that you only need to supply additional arguments,
2495     * and modified so that they return promises that resolve to their eventual values,
2496     * after any resolvers have ran.
2497     *
2498     * @param {string|WPDataStore} storeNameOrDefinition Unique namespace identifier for the store
2499     *                                                   or the store definition.
2500     *
2501     * @return {Object} Each key of the object matches the name of a selector.
2502     */
2503  
2504  
2505    function resolveSelect(storeNameOrDefinition) {
2506      const storeName = Object(external_lodash_["isObject"])(storeNameOrDefinition) ? storeNameOrDefinition.name : storeNameOrDefinition;
2507  
2508      __experimentalListeningStores.add(storeName);
2509  
2510      const store = stores[storeName];
2511  
2512      if (store) {
2513        return store.getResolveSelectors();
2514      }
2515  
2516      return parent && parent.resolveSelect(storeName);
2517    }
2518    /**
2519     * Returns the available actions for a part of the state.
2520     *
2521     * @param {string|WPDataStore} storeNameOrDefinition Unique namespace identifier for the store
2522     *                                                   or the store definition.
2523     *
2524     * @return {*} The action's returned value.
2525     */
2526  
2527  
2528    function dispatch(storeNameOrDefinition) {
2529      const storeName = Object(external_lodash_["isObject"])(storeNameOrDefinition) ? storeNameOrDefinition.name : storeNameOrDefinition;
2530      const store = stores[storeName];
2531  
2532      if (store) {
2533        return store.getActions();
2534      }
2535  
2536      return parent && parent.dispatch(storeName);
2537    } //
2538    // Deprecated
2539    // TODO: Remove this after `use()` is removed.
2540    //
2541  
2542  
2543    function withPlugins(attributes) {
2544      return Object(external_lodash_["mapValues"])(attributes, (attribute, key) => {
2545        if (typeof attribute !== 'function') {
2546          return attribute;
2547        }
2548  
2549        return function () {
2550          return registry[key].apply(null, arguments);
2551        };
2552      });
2553    }
2554    /**
2555     * Registers a generic store.
2556     *
2557     * @param {string} key    Store registry key.
2558     * @param {Object} config Configuration (getSelectors, getActions, subscribe).
2559     */
2560  
2561  
2562    function registerGenericStore(key, config) {
2563      if (typeof config.getSelectors !== 'function') {
2564        throw new TypeError('config.getSelectors must be a function');
2565      }
2566  
2567      if (typeof config.getActions !== 'function') {
2568        throw new TypeError('config.getActions must be a function');
2569      }
2570  
2571      if (typeof config.subscribe !== 'function') {
2572        throw new TypeError('config.subscribe must be a function');
2573      }
2574  
2575      stores[key] = config;
2576      config.subscribe(globalListener);
2577    }
2578    /**
2579     * Registers a new store definition.
2580     *
2581     * @param {WPDataStore} store Store definition.
2582     */
2583  
2584  
2585    function register(store) {
2586      registerGenericStore(store.name, store.instantiate(registry));
2587    }
2588    /**
2589     * Subscribe handler to a store.
2590     *
2591     * @param {string[]} storeName The store name.
2592     * @param {Function} handler   The function subscribed to the store.
2593     * @return {Function} A function to unsubscribe the handler.
2594     */
2595  
2596  
2597    function __experimentalSubscribeStore(storeName, handler) {
2598      if (storeName in stores) {
2599        return stores[storeName].subscribe(handler);
2600      } // Trying to access a store that hasn't been registered,
2601      // this is a pattern rarely used but seen in some places.
2602      // We fallback to regular `subscribe` here for backward-compatibility for now.
2603      // See https://github.com/WordPress/gutenberg/pull/27466 for more info.
2604  
2605  
2606      if (!parent) {
2607        return subscribe(handler);
2608      }
2609  
2610      return parent.__experimentalSubscribeStore(storeName, handler);
2611    }
2612  
2613    let registry = {
2614      registerGenericStore,
2615      stores,
2616      namespaces: stores,
2617      // TODO: Deprecate/remove this.
2618      subscribe,
2619      select,
2620      resolveSelect,
2621      dispatch,
2622      use,
2623      register,
2624      __experimentalMarkListeningStores,
2625      __experimentalSubscribeStore
2626    };
2627    /**
2628     * Registers a standard `@wordpress/data` store.
2629     *
2630     * @param {string} storeName  Unique namespace identifier.
2631     * @param {Object} options    Store description (reducer, actions, selectors, resolvers).
2632     *
2633     * @return {Object} Registered store object.
2634     */
2635  
2636    registry.registerStore = (storeName, options) => {
2637      if (!options.reducer) {
2638        throw new TypeError('Must specify store reducer');
2639      }
2640  
2641      const store = createReduxStore(storeName, options).instantiate(registry);
2642      registerGenericStore(storeName, store);
2643      return store.store;
2644    }; //
2645    // TODO:
2646    // This function will be deprecated as soon as it is no longer internally referenced.
2647    //
2648  
2649  
2650    function use(plugin, options) {
2651      registry = { ...registry,
2652        ...plugin(registry, options)
2653      };
2654      return registry;
2655    }
2656  
2657    registerGenericStore('core/data', build_module_store(registry));
2658    Object.entries(storeConfigs).forEach(([name, config]) => registry.registerStore(name, config));
2659  
2660    if (parent) {
2661      parent.subscribe(globalListener);
2662    }
2663  
2664    return withPlugins(registry);
2665  }
2666  
2667  // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/default-registry.js
2668  /**
2669   * Internal dependencies
2670   */
2671  
2672  /* harmony default export */ var default_registry = (createRegistry());
2673  
2674  // EXTERNAL MODULE: external ["wp","deprecated"]
2675  var external_wp_deprecated_ = __webpack_require__("NMb1");
2676  var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_);
2677  
2678  // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/plugins/controls/index.js
2679  /**
2680   * WordPress dependencies
2681   */
2682  
2683  /* harmony default export */ var plugins_controls = (registry => {
2684    external_wp_deprecated_default()('wp.data.plugins.controls', {
2685      since: '5.4',
2686      hint: 'The controls plugins is now baked-in.'
2687    });
2688    return registry;
2689  });
2690  
2691  // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/plugins/persistence/storage/object.js
2692  let objectStorage;
2693  const storage = {
2694    getItem(key) {
2695      if (!objectStorage || !objectStorage[key]) {
2696        return null;
2697      }
2698  
2699      return objectStorage[key];
2700    },
2701  
2702    setItem(key, value) {
2703      if (!objectStorage) {
2704        storage.clear();
2705      }
2706  
2707      objectStorage[key] = String(value);
2708    },
2709  
2710    clear() {
2711      objectStorage = Object.create(null);
2712    }
2713  
2714  };
2715  /* harmony default export */ var object = (storage);
2716  
2717  // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/plugins/persistence/storage/default.js
2718  /**
2719   * Internal dependencies
2720   */
2721  
2722  let default_storage;
2723  
2724  try {
2725    // Private Browsing in Safari 10 and earlier will throw an error when
2726    // attempting to set into localStorage. The test here is intentional in
2727    // causing a thrown error as condition for using fallback object storage.
2728    default_storage = window.localStorage;
2729    default_storage.setItem('__wpDataTestLocalStorage', '');
2730    default_storage.removeItem('__wpDataTestLocalStorage');
2731  } catch (error) {
2732    default_storage = object;
2733  }
2734  
2735  /* harmony default export */ var storage_default = (default_storage);
2736  
2737  // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/plugins/persistence/index.js
2738  /**
2739   * External dependencies
2740   */
2741  
2742  /**
2743   * Internal dependencies
2744   */
2745  
2746  
2747  
2748  /** @typedef {import('../../registry').WPDataRegistry} WPDataRegistry */
2749  
2750  /** @typedef {import('../../registry').WPDataPlugin} WPDataPlugin */
2751  
2752  /**
2753   * @typedef {Object} WPDataPersistencePluginOptions Persistence plugin options.
2754   *
2755   * @property {Storage} storage    Persistent storage implementation. This must
2756   *                                at least implement `getItem` and `setItem` of
2757   *                                the Web Storage API.
2758   * @property {string}  storageKey Key on which to set in persistent storage.
2759   *
2760   */
2761  
2762  /**
2763   * Default plugin storage.
2764   *
2765   * @type {Storage}
2766   */
2767  
2768  const DEFAULT_STORAGE = storage_default;
2769  /**
2770   * Default plugin storage key.
2771   *
2772   * @type {string}
2773   */
2774  
2775  const DEFAULT_STORAGE_KEY = 'WP_DATA';
2776  /**
2777   * Higher-order reducer which invokes the original reducer only if state is
2778   * inequal from that of the action's `nextState` property, otherwise returning
2779   * the original state reference.
2780   *
2781   * @param {Function} reducer Original reducer.
2782   *
2783   * @return {Function} Enhanced reducer.
2784   */
2785  
2786  const withLazySameState = reducer => (state, action) => {
2787    if (action.nextState === state) {
2788      return state;
2789    }
2790  
2791    return reducer(state, action);
2792  };
2793  /**
2794   * Creates a persistence interface, exposing getter and setter methods (`get`
2795   * and `set` respectively).
2796   *
2797   * @param {WPDataPersistencePluginOptions} options Plugin options.
2798   *
2799   * @return {Object} Persistence interface.
2800   */
2801  
2802  function createPersistenceInterface(options) {
2803    const {
2804      storage = DEFAULT_STORAGE,
2805      storageKey = DEFAULT_STORAGE_KEY
2806    } = options;
2807    let data;
2808    /**
2809     * Returns the persisted data as an object, defaulting to an empty object.
2810     *
2811     * @return {Object} Persisted data.
2812     */
2813  
2814    function getData() {
2815      if (data === undefined) {
2816        // If unset, getItem is expected to return null. Fall back to
2817        // empty object.
2818        const persisted = storage.getItem(storageKey);
2819  
2820        if (persisted === null) {
2821          data = {};
2822        } else {
2823          try {
2824            data = JSON.parse(persisted);
2825          } catch (error) {
2826            // Similarly, should any error be thrown during parse of
2827            // the string (malformed JSON), fall back to empty object.
2828            data = {};
2829          }
2830        }
2831      }
2832  
2833      return data;
2834    }
2835    /**
2836     * Merges an updated reducer state into the persisted data.
2837     *
2838     * @param {string} key   Key to update.
2839     * @param {*}      value Updated value.
2840     */
2841  
2842  
2843    function setData(key, value) {
2844      data = { ...data,
2845        [key]: value
2846      };
2847      storage.setItem(storageKey, JSON.stringify(data));
2848    }
2849  
2850    return {
2851      get: getData,
2852      set: setData
2853    };
2854  }
2855  /**
2856   * Data plugin to persist store state into a single storage key.
2857   *
2858   * @param {WPDataRegistry}                  registry      Data registry.
2859   * @param {?WPDataPersistencePluginOptions} pluginOptions Plugin options.
2860   *
2861   * @return {WPDataPlugin} Data plugin.
2862   */
2863  
2864  function persistencePlugin(registry, pluginOptions) {
2865    const persistence = createPersistenceInterface(pluginOptions);
2866    /**
2867     * Creates an enhanced store dispatch function, triggering the state of the
2868     * given store name to be persisted when changed.
2869     *
2870     * @param {Function}       getState  Function which returns current state.
2871     * @param {string}         storeName Store name.
2872     * @param {?Array<string>} keys      Optional subset of keys to save.
2873     *
2874     * @return {Function} Enhanced dispatch function.
2875     */
2876  
2877    function createPersistOnChange(getState, storeName, keys) {
2878      let getPersistedState;
2879  
2880      if (Array.isArray(keys)) {
2881        // Given keys, the persisted state should by produced as an object
2882        // of the subset of keys. This implementation uses combineReducers
2883        // to leverage its behavior of returning the same object when none
2884        // of the property values changes. This allows a strict reference
2885        // equality to bypass a persistence set on an unchanging state.
2886        const reducers = keys.reduce((accumulator, key) => Object.assign(accumulator, {
2887          [key]: (state, action) => action.nextState[key]
2888        }), {});
2889        getPersistedState = withLazySameState(turbo_combine_reducers_default()(reducers));
2890      } else {
2891        getPersistedState = (state, action) => action.nextState;
2892      }
2893  
2894      let lastState = getPersistedState(undefined, {
2895        nextState: getState()
2896      });
2897      return () => {
2898        const state = getPersistedState(lastState, {
2899          nextState: getState()
2900        });
2901  
2902        if (state !== lastState) {
2903          persistence.set(storeName, state);
2904          lastState = state;
2905        }
2906      };
2907    }
2908  
2909    return {
2910      registerStore(storeName, options) {
2911        if (!options.persist) {
2912          return registry.registerStore(storeName, options);
2913        } // Load from persistence to use as initial state.
2914  
2915  
2916        const persistedState = persistence.get()[storeName];
2917  
2918        if (persistedState !== undefined) {
2919          let initialState = options.reducer(options.initialState, {
2920            type: '@@WP/PERSISTENCE_RESTORE'
2921          });
2922  
2923          if (Object(external_lodash_["isPlainObject"])(initialState) && Object(external_lodash_["isPlainObject"])(persistedState)) {
2924            // If state is an object, ensure that:
2925            // - Other keys are left intact when persisting only a
2926            //   subset of keys.
2927            // - New keys in what would otherwise be used as initial
2928            //   state are deeply merged as base for persisted value.
2929            initialState = Object(external_lodash_["merge"])({}, initialState, persistedState);
2930          } else {
2931            // If there is a mismatch in object-likeness of default
2932            // initial or persisted state, defer to persisted value.
2933            initialState = persistedState;
2934          }
2935  
2936          options = { ...options,
2937            initialState
2938          };
2939        }
2940  
2941        const store = registry.registerStore(storeName, options);
2942        store.subscribe(createPersistOnChange(store.getState, storeName, options.persist));
2943        return store;
2944      }
2945  
2946    };
2947  }
2948  /**
2949   * Deprecated: Remove this function and the code in WordPress Core that calls
2950   * it once WordPress 5.4 is released.
2951   */
2952  
2953  
2954  persistencePlugin.__unstableMigrate = pluginOptions => {
2955    var _state$coreEditor, _state$coreEditor$pre;
2956  
2957    const persistence = createPersistenceInterface(pluginOptions);
2958    const state = persistence.get(); // Migrate 'insertUsage' from 'core/editor' to 'core/block-editor'
2959  
2960    const editorInsertUsage = (_state$coreEditor = state['core/editor']) === null || _state$coreEditor === void 0 ? void 0 : (_state$coreEditor$pre = _state$coreEditor.preferences) === null || _state$coreEditor$pre === void 0 ? void 0 : _state$coreEditor$pre.insertUsage;
2961  
2962    if (editorInsertUsage) {
2963      var _state$coreBlockEdi, _state$coreBlockEdi$p;
2964  
2965      const blockEditorInsertUsage = (_state$coreBlockEdi = state['core/block-editor']) === null || _state$coreBlockEdi === void 0 ? void 0 : (_state$coreBlockEdi$p = _state$coreBlockEdi.preferences) === null || _state$coreBlockEdi$p === void 0 ? void 0 : _state$coreBlockEdi$p.insertUsage;
2966      persistence.set('core/block-editor', {
2967        preferences: {
2968          insertUsage: { ...editorInsertUsage,
2969            ...blockEditorInsertUsage
2970          }
2971        }
2972      });
2973    }
2974  
2975    let editPostState = state['core/edit-post']; // Default `fullscreenMode` to `false` if any persisted state had existed
2976    // and the user hadn't made an explicit choice about fullscreen mode. This
2977    // is needed since `fullscreenMode` previously did not have a default value
2978    // and was implicitly false by its absence. It is now `true` by default, but
2979    // this change is not intended to affect upgrades from earlier versions.
2980  
2981    const hadPersistedState = Object.keys(state).length > 0;
2982    const hadFullscreenModePreference = Object(external_lodash_["has"])(state, ['core/edit-post', 'preferences', 'features', 'fullscreenMode']);
2983  
2984    if (hadPersistedState && !hadFullscreenModePreference) {
2985      editPostState = Object(external_lodash_["merge"])({}, editPostState, {
2986        preferences: {
2987          features: {
2988            fullscreenMode: false
2989          }
2990        }
2991      });
2992    } // Migrate 'areTipsEnabled' from 'core/nux' to 'showWelcomeGuide' in 'core/edit-post'
2993  
2994  
2995    const areTipsEnabled = Object(external_lodash_["get"])(state, ['core/nux', 'preferences', 'areTipsEnabled']);
2996    const hasWelcomeGuide = Object(external_lodash_["has"])(state, ['core/edit-post', 'preferences', 'features', 'welcomeGuide']);
2997  
2998    if (areTipsEnabled !== undefined && !hasWelcomeGuide) {
2999      editPostState = Object(external_lodash_["merge"])({}, editPostState, {
3000        preferences: {
3001          features: {
3002            welcomeGuide: areTipsEnabled
3003          }
3004        }
3005      });
3006    }
3007  
3008    if (editPostState !== state['core/edit-post']) {
3009      persistence.set('core/edit-post', editPostState);
3010    }
3011  };
3012  
3013  /* harmony default export */ var plugins_persistence = (persistencePlugin);
3014  
3015  // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/plugins/index.js
3016  
3017  
3018  
3019  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
3020  var esm_extends = __webpack_require__("wx14");
3021  
3022  // EXTERNAL MODULE: external ["wp","element"]
3023  var external_wp_element_ = __webpack_require__("GRId");
3024  
3025  // EXTERNAL MODULE: external ["wp","compose"]
3026  var external_wp_compose_ = __webpack_require__("K9lf");
3027  
3028  // EXTERNAL MODULE: ./node_modules/use-memo-one/dist/use-memo-one.esm.js
3029  var use_memo_one_esm = __webpack_require__("mHlH");
3030  
3031  // EXTERNAL MODULE: external ["wp","priorityQueue"]
3032  var external_wp_priorityQueue_ = __webpack_require__("XI5e");
3033  
3034  // EXTERNAL MODULE: external ["wp","isShallowEqual"]
3035  var external_wp_isShallowEqual_ = __webpack_require__("rl8x");
3036  var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_wp_isShallowEqual_);
3037  
3038  // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/registry-provider/context.js
3039  /**
3040   * WordPress dependencies
3041   */
3042  
3043  /**
3044   * Internal dependencies
3045   */
3046  
3047  
3048  const Context = Object(external_wp_element_["createContext"])(default_registry);
3049  const {
3050    Consumer,
3051    Provider
3052  } = Context;
3053  /**
3054   * A custom react Context consumer exposing the provided `registry` to
3055   * children components. Used along with the RegistryProvider.
3056   *
3057   * You can read more about the react context api here:
3058   * https://reactjs.org/docs/context.html#contextprovider
3059   *
3060   * @example
3061   * ```js
3062   * import {
3063   *   RegistryProvider,
3064   *   RegistryConsumer,
3065   *   createRegistry
3066   * } from '@wordpress/data';
3067   *
3068   * const registry = createRegistry( {} );
3069   *
3070   * const App = ( { props } ) => {
3071   *   return <RegistryProvider value={ registry }>
3072   *     <div>Hello There</div>
3073   *     <RegistryConsumer>
3074   *       { ( registry ) => (
3075   *         <ComponentUsingRegistry
3076   *                 { ...props }
3077   *               registry={ registry }
3078   *       ) }
3079   *     </RegistryConsumer>
3080   *   </RegistryProvider>
3081   * }
3082   * ```
3083   */
3084  
3085  const RegistryConsumer = Consumer;
3086  /**
3087   * A custom Context provider for exposing the provided `registry` to children
3088   * components via a consumer.
3089   *
3090   * See <a name="#RegistryConsumer">RegistryConsumer</a> documentation for
3091   * example.
3092   */
3093  
3094  /* harmony default export */ var context = (Provider);
3095  
3096  // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/registry-provider/use-registry.js
3097  /**
3098   * WordPress dependencies
3099   */
3100  
3101  /**
3102   * Internal dependencies
3103   */
3104  
3105  
3106  /**
3107   * A custom react hook exposing the registry context for use.
3108   *
3109   * This exposes the `registry` value provided via the
3110   * <a href="#RegistryProvider">Registry Provider</a> to a component implementing
3111   * this hook.
3112   *
3113   * It acts similarly to the `useContext` react hook.
3114   *
3115   * Note: Generally speaking, `useRegistry` is a low level hook that in most cases
3116   * won't be needed for implementation. Most interactions with the `@wordpress/data`
3117   * API can be performed via the `useSelect` hook,  or the `withSelect` and
3118   * `withDispatch` higher order components.
3119   *
3120   * @example
3121   * ```js
3122   * import {
3123   *   RegistryProvider,
3124   *   createRegistry,
3125   *   useRegistry,
3126   * } from '@wordpress/data';
3127   *
3128   * const registry = createRegistry( {} );
3129   *
3130   * const SomeChildUsingRegistry = ( props ) => {
3131   *   const registry = useRegistry( registry );
3132   *   // ...logic implementing the registry in other react hooks.
3133   * };
3134   *
3135   *
3136   * const ParentProvidingRegistry = ( props ) => {
3137   *   return <RegistryProvider value={ registry }>
3138   *     <SomeChildUsingRegistry { ...props } />
3139   *   </RegistryProvider>
3140   * };
3141   * ```
3142   *
3143   * @return {Function}  A custom react hook exposing the registry context value.
3144   */
3145  
3146  function useRegistry() {
3147    return Object(external_wp_element_["useContext"])(Context);
3148  }
3149  
3150  // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/async-mode-provider/context.js
3151  /**
3152   * WordPress dependencies
3153   */
3154  
3155  const context_Context = Object(external_wp_element_["createContext"])(false);
3156  const {
3157    Consumer: context_Consumer,
3158    Provider: context_Provider
3159  } = context_Context;
3160  const AsyncModeConsumer = context_Consumer;
3161  /**
3162   * Context Provider Component used to switch the data module component rerendering
3163   * between Sync and Async modes.
3164   *
3165   * @example
3166   *
3167   * ```js
3168   * import { useSelect, AsyncModeProvider } from '@wordpress/data';
3169   *
3170   * function BlockCount() {
3171   *   const count = useSelect( ( select ) => {
3172   *     return select( 'core/block-editor' ).getBlockCount()
3173   *   }, [] );
3174   *
3175   *   return count;
3176   * }
3177   *
3178   * function App() {
3179   *   return (
3180   *     <AsyncModeProvider value={ true }>
3181   *       <BlockCount />
3182   *     </AsyncModeProvider>
3183   *   );
3184   * }
3185   * ```
3186   *
3187   * In this example, the BlockCount component is rerendered asynchronously.
3188   * It means if a more critical task is being performed (like typing in an input),
3189   * the rerendering is delayed until the browser becomes IDLE.
3190   * It is possible to nest multiple levels of AsyncModeProvider to fine-tune the rendering behavior.
3191   *
3192   * @param {boolean}   props.value  Enable Async Mode.
3193   * @return {WPComponent} The component to be rendered.
3194   */
3195  
3196  /* harmony default export */ var async_mode_provider_context = (context_Provider);
3197  
3198  // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/async-mode-provider/use-async-mode.js
3199  /**
3200   * WordPress dependencies
3201   */
3202  
3203  /**
3204   * Internal dependencies
3205   */
3206  
3207  
3208  function useAsyncMode() {
3209    return Object(external_wp_element_["useContext"])(context_Context);
3210  }
3211  
3212  // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/use-select/index.js
3213  /**
3214   * External dependencies
3215   */
3216  
3217  /**
3218   * WordPress dependencies
3219   */
3220  
3221  
3222  
3223  
3224  
3225  /**
3226   * Internal dependencies
3227   */
3228  
3229  
3230  
3231  const renderQueue = Object(external_wp_priorityQueue_["createQueue"])();
3232  /** @typedef {import('./types').WPDataStore} WPDataStore */
3233  
3234  /**
3235   * Custom react hook for retrieving props from registered selectors.
3236   *
3237   * In general, this custom React hook follows the
3238   * [rules of hooks](https://reactjs.org/docs/hooks-rules.html).
3239   *
3240   * @param {Function|WPDataStore|string} _mapSelect  Function called on every state change. The
3241   *                                                  returned value is exposed to the component
3242   *                                                  implementing this hook. The function receives
3243   *                                                  the `registry.select` method on the first
3244   *                                                  argument and the `registry` on the second
3245   *                                                  argument.
3246   *                                                  When a store key is passed, all selectors for
3247   *                                                  the store will be returned. This is only meant
3248   *                                                  for usage of these selectors in event
3249   *                                                  callbacks, not for data needed to create the
3250   *                                                  element tree.
3251   * @param {Array}                       deps        If provided, this memoizes the mapSelect so the
3252   *                                                  same `mapSelect` is invoked on every state
3253   *                                                  change unless the dependencies change.
3254   *
3255   * @example
3256   * ```js
3257   * import { useSelect } from '@wordpress/data';
3258   *
3259   * function HammerPriceDisplay( { currency } ) {
3260   *   const price = useSelect( ( select ) => {
3261   *     return select( 'my-shop' ).getPrice( 'hammer', currency )
3262   *   }, [ currency ] );
3263   *   return new Intl.NumberFormat( 'en-US', {
3264   *     style: 'currency',
3265   *     currency,
3266   *   } ).format( price );
3267   * }
3268   *
3269   * // Rendered in the application:
3270   * // <HammerPriceDisplay currency="USD" />
3271   * ```
3272   *
3273   * In the above example, when `HammerPriceDisplay` is rendered into an
3274   * application, the price will be retrieved from the store state using the
3275   * `mapSelect` callback on `useSelect`. If the currency prop changes then
3276   * any price in the state for that currency is retrieved. If the currency prop
3277   * doesn't change and other props are passed in that do change, the price will
3278   * not change because the dependency is just the currency.
3279   *
3280   * When data is only used in an event callback, the data should not be retrieved
3281   * on render, so it may be useful to get the selectors function instead.
3282   *
3283   * **Don't use `useSelect` this way when calling the selectors in the render
3284   * function because your component won't re-render on a data change.**
3285   *
3286   * ```js
3287   * import { useSelect } from '@wordpress/data';
3288   *
3289   * function Paste( { children } ) {
3290   *   const { getSettings } = useSelect( 'my-shop' );
3291   *   function onPaste() {
3292   *     // Do something with the settings.
3293   *     const settings = getSettings();
3294   *   }
3295   *   return <div onPaste={ onPaste }>{ children }</div>;
3296   * }
3297   * ```
3298   *
3299   * @return {Function}  A custom react hook.
3300   */
3301  
3302  function useSelect(_mapSelect, deps) {
3303    const isWithoutMapping = typeof _mapSelect !== 'function';
3304  
3305    if (isWithoutMapping) {
3306      deps = [];
3307    }
3308  
3309    const mapSelect = Object(external_wp_element_["useCallback"])(_mapSelect, deps);
3310    const registry = useRegistry();
3311    const isAsync = useAsyncMode(); // React can sometimes clear the `useMemo` cache.
3312    // We use the cache-stable `useMemoOne` to avoid
3313    // losing queues.
3314  
3315    const queueContext = Object(use_memo_one_esm["a" /* useMemoOne */])(() => ({
3316      queue: true
3317    }), [registry]);
3318    const [, forceRender] = Object(external_wp_element_["useReducer"])(s => s + 1, 0);
3319    const latestMapSelect = Object(external_wp_element_["useRef"])();
3320    const latestIsAsync = Object(external_wp_element_["useRef"])(isAsync);
3321    const latestMapOutput = Object(external_wp_element_["useRef"])();
3322    const latestMapOutputError = Object(external_wp_element_["useRef"])();
3323    const isMountedAndNotUnsubscribing = Object(external_wp_element_["useRef"])(); // Keep track of the stores being selected in the mapSelect function,
3324    // and only subscribe to those stores later.
3325  
3326    const listeningStores = Object(external_wp_element_["useRef"])([]);
3327    const trapSelect = Object(external_wp_element_["useCallback"])(callback => registry.__experimentalMarkListeningStores(callback, listeningStores), [registry]); // Generate a "flag" for used in the effect dependency array.
3328    // It's different than just using `mapSelect` since deps could be undefined,
3329    // in that case, we would still want to memoize it.
3330  
3331    const depsChangedFlag = Object(external_wp_element_["useMemo"])(() => ({}), deps || []);
3332    let mapOutput;
3333  
3334    if (!isWithoutMapping) {
3335      try {
3336        if (latestMapSelect.current !== mapSelect || latestMapOutputError.current) {
3337          mapOutput = trapSelect(() => mapSelect(registry.select, registry));
3338        } else {
3339          mapOutput = latestMapOutput.current;
3340        }
3341      } catch (error) {
3342        let errorMessage = `An error occurred while running 'mapSelect': $error.message}`;
3343  
3344        if (latestMapOutputError.current) {
3345          errorMessage += `\nThe error may be correlated with this previous error:\n`;
3346          errorMessage += `$latestMapOutputError.current.stack}\n\n`;
3347          errorMessage += 'Original stack trace:';
3348        } // eslint-disable-next-line no-console
3349  
3350  
3351        console.error(errorMessage);
3352        mapOutput = latestMapOutput.current;
3353      }
3354    }
3355  
3356    Object(external_wp_compose_["useIsomorphicLayoutEffect"])(() => {
3357      if (isWithoutMapping) {
3358        return;
3359      }
3360  
3361      latestMapSelect.current = mapSelect;
3362      latestMapOutput.current = mapOutput;
3363      latestMapOutputError.current = undefined;
3364      isMountedAndNotUnsubscribing.current = true; // This has to run after the other ref updates
3365      // to avoid using stale values in the flushed
3366      // callbacks or potentially overwriting a
3367      // changed `latestMapOutput.current`.
3368  
3369      if (latestIsAsync.current !== isAsync) {
3370        latestIsAsync.current = isAsync;
3371        renderQueue.flush(queueContext);
3372      }
3373    });
3374    Object(external_wp_compose_["useIsomorphicLayoutEffect"])(() => {
3375      if (isWithoutMapping) {
3376        return;
3377      }
3378  
3379      const onStoreChange = () => {
3380        if (isMountedAndNotUnsubscribing.current) {
3381          try {
3382            const newMapOutput = trapSelect(() => latestMapSelect.current(registry.select, registry));
3383  
3384            if (external_wp_isShallowEqual_default()(latestMapOutput.current, newMapOutput)) {
3385              return;
3386            }
3387  
3388            latestMapOutput.current = newMapOutput;
3389          } catch (error) {
3390            latestMapOutputError.current = error;
3391          }
3392  
3393          forceRender();
3394        }
3395      }; // catch any possible state changes during mount before the subscription
3396      // could be set.
3397  
3398  
3399      if (latestIsAsync.current) {
3400        renderQueue.add(queueContext, onStoreChange);
3401      } else {
3402        onStoreChange();
3403      }
3404  
3405      const onChange = () => {
3406        if (latestIsAsync.current) {
3407          renderQueue.add(queueContext, onStoreChange);
3408        } else {
3409          onStoreChange();
3410        }
3411      };
3412  
3413      const unsubscribers = listeningStores.current.map(storeName => registry.__experimentalSubscribeStore(storeName, onChange));
3414      return () => {
3415        isMountedAndNotUnsubscribing.current = false; // The return value of the subscribe function could be undefined if the store is a custom generic store.
3416  
3417        unsubscribers.forEach(unsubscribe => unsubscribe === null || unsubscribe === void 0 ? void 0 : unsubscribe());
3418        renderQueue.flush(queueContext);
3419      };
3420    }, [registry, trapSelect, depsChangedFlag, isWithoutMapping]);
3421    return isWithoutMapping ? registry.select(_mapSelect) : mapOutput;
3422  }
3423  
3424  // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/with-select/index.js
3425  
3426  
3427  
3428  /**
3429   * WordPress dependencies
3430   */
3431  
3432  /**
3433   * Internal dependencies
3434   */
3435  
3436  
3437  /**
3438   * Higher-order component used to inject state-derived props using registered
3439   * selectors.
3440   *
3441   * @param {Function} mapSelectToProps Function called on every state change,
3442   *                                   expected to return object of props to
3443   *                                   merge with the component's own props.
3444   *
3445   * @example
3446   * ```js
3447   * import { withSelect } from '@wordpress/data';
3448   *
3449   * function PriceDisplay( { price, currency } ) {
3450   *     return new Intl.NumberFormat( 'en-US', {
3451   *         style: 'currency',
3452   *         currency,
3453   *     } ).format( price );
3454   * }
3455   *
3456   * const HammerPriceDisplay = withSelect( ( select, ownProps ) => {
3457   *     const { getPrice } = select( 'my-shop' );
3458   *     const { currency } = ownProps;
3459   *
3460   *     return {
3461   *         price: getPrice( 'hammer', currency ),
3462   *     };
3463   * } )( PriceDisplay );
3464   *
3465   * // Rendered in the application:
3466   * //
3467   * //  <HammerPriceDisplay currency="USD" />
3468   * ```
3469   * In the above example, when `HammerPriceDisplay` is rendered into an
3470   * application, it will pass the price into the underlying `PriceDisplay`
3471   * component and update automatically if the price of a hammer ever changes in
3472   * the store.
3473   *
3474   * @return {WPComponent} Enhanced component with merged state data props.
3475   */
3476  
3477  const withSelect = mapSelectToProps => Object(external_wp_compose_["createHigherOrderComponent"])(WrappedComponent => Object(external_wp_compose_["pure"])(ownProps => {
3478    const mapSelect = (select, registry) => mapSelectToProps(select, ownProps, registry);
3479  
3480    const mergeProps = useSelect(mapSelect);
3481    return Object(external_wp_element_["createElement"])(WrappedComponent, Object(esm_extends["a" /* default */])({}, ownProps, mergeProps));
3482  }), 'withSelect');
3483  
3484  /* harmony default export */ var with_select = (withSelect);
3485  
3486  // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/use-dispatch/use-dispatch-with-map.js
3487  /**
3488   * External dependencies
3489   */
3490  
3491  /**
3492   * WordPress dependencies
3493   */
3494  
3495  
3496  
3497  /**
3498   * Internal dependencies
3499   */
3500  
3501  
3502  /**
3503   * Custom react hook for returning aggregate dispatch actions using the provided
3504   * dispatchMap.
3505   *
3506   * Currently this is an internal api only and is implemented by `withDispatch`
3507   *
3508   * @param {Function} dispatchMap  Receives the `registry.dispatch` function as
3509   *                                the first argument and the `registry` object
3510   *                                as the second argument.  Should return an
3511   *                                object mapping props to functions.
3512   * @param {Array}    deps         An array of dependencies for the hook.
3513   * @return {Object}  An object mapping props to functions created by the passed
3514   *                   in dispatchMap.
3515   */
3516  
3517  const useDispatchWithMap = (dispatchMap, deps) => {
3518    const registry = useRegistry();
3519    const currentDispatchMap = Object(external_wp_element_["useRef"])(dispatchMap);
3520    Object(external_wp_compose_["useIsomorphicLayoutEffect"])(() => {
3521      currentDispatchMap.current = dispatchMap;
3522    });
3523    return Object(external_wp_element_["useMemo"])(() => {
3524      const currentDispatchProps = currentDispatchMap.current(registry.dispatch, registry);
3525      return Object(external_lodash_["mapValues"])(currentDispatchProps, (dispatcher, propName) => {
3526        if (typeof dispatcher !== 'function') {
3527          // eslint-disable-next-line no-console
3528          console.warn(`Property $propName} returned from dispatchMap in useDispatchWithMap must be a function.`);
3529        }
3530  
3531        return (...args) => currentDispatchMap.current(registry.dispatch, registry)[propName](...args);
3532      });
3533    }, [registry, ...deps]);
3534  };
3535  
3536  /* harmony default export */ var use_dispatch_with_map = (useDispatchWithMap);
3537  
3538  // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/with-dispatch/index.js
3539  
3540  
3541  
3542  /**
3543   * WordPress dependencies
3544   */
3545  
3546  /**
3547   * Internal dependencies
3548   */
3549  
3550  
3551  /**
3552   * Higher-order component used to add dispatch props using registered action
3553   * creators.
3554   *
3555   * @param {Function} mapDispatchToProps A function of returning an object of
3556   *                                      prop names where value is a
3557   *                                      dispatch-bound action creator, or a
3558   *                                      function to be called with the
3559   *                                      component's props and returning an
3560   *                                      action creator.
3561   *
3562   * @example
3563   * ```jsx
3564   * function Button( { onClick, children } ) {
3565   *     return <button type="button" onClick={ onClick }>{ children }</button>;
3566   * }
3567   *
3568   * import { withDispatch } from '@wordpress/data';
3569   *
3570   * const SaleButton = withDispatch( ( dispatch, ownProps ) => {
3571   *     const { startSale } = dispatch( 'my-shop' );
3572   *     const { discountPercent } = ownProps;
3573   *
3574   *     return {
3575   *         onClick() {
3576   *             startSale( discountPercent );
3577   *         },
3578   *     };
3579   * } )( Button );
3580   *
3581   * // Rendered in the application:
3582   * //
3583   * // <SaleButton discountPercent="20">Start Sale!</SaleButton>
3584   * ```
3585   *
3586   * @example
3587   * In the majority of cases, it will be sufficient to use only two first params
3588   * passed to `mapDispatchToProps` as illustrated in the previous example.
3589   * However, there might be some very advanced use cases where using the
3590   * `registry` object might be used as a tool to optimize the performance of
3591   * your component. Using `select` function from the registry might be useful
3592   * when you need to fetch some dynamic data from the store at the time when the
3593   * event is fired, but at the same time, you never use it to render your
3594   * component. In such scenario, you can avoid using the `withSelect` higher
3595   * order component to compute such prop, which might lead to unnecessary
3596   * re-renders of your component caused by its frequent value change.
3597   * Keep in mind, that `mapDispatchToProps` must return an object with functions
3598   * only.
3599   *
3600   * ```jsx
3601   * function Button( { onClick, children } ) {
3602   *     return <button type="button" onClick={ onClick }>{ children }</button>;
3603   * }
3604   *
3605   * import { withDispatch } from '@wordpress/data';
3606   *
3607   * const SaleButton = withDispatch( ( dispatch, ownProps, { select } ) => {
3608   *    // Stock number changes frequently.
3609   *    const { getStockNumber } = select( 'my-shop' );
3610   *    const { startSale } = dispatch( 'my-shop' );
3611   *    return {
3612   *        onClick() {
3613   *            const discountPercent = getStockNumber() > 50 ? 10 : 20;
3614   *            startSale( discountPercent );
3615   *        },
3616   *    };
3617   * } )( Button );
3618   *
3619   * // Rendered in the application:
3620   * //
3621   * //  <SaleButton>Start Sale!</SaleButton>
3622   * ```
3623   *
3624   * _Note:_ It is important that the `mapDispatchToProps` function always
3625   * returns an object with the same keys. For example, it should not contain
3626   * conditions under which a different value would be returned.
3627   *
3628   * @return {WPComponent} Enhanced component with merged dispatcher props.
3629   */
3630  
3631  const withDispatch = mapDispatchToProps => Object(external_wp_compose_["createHigherOrderComponent"])(WrappedComponent => ownProps => {
3632    const mapDispatch = (dispatch, registry) => mapDispatchToProps(dispatch, ownProps, registry);
3633  
3634    const dispatchProps = use_dispatch_with_map(mapDispatch, []);
3635    return Object(external_wp_element_["createElement"])(WrappedComponent, Object(esm_extends["a" /* default */])({}, ownProps, dispatchProps));
3636  }, 'withDispatch');
3637  
3638  /* harmony default export */ var with_dispatch = (withDispatch);
3639  
3640  // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/with-registry/index.js
3641  
3642  
3643  
3644  /**
3645   * WordPress dependencies
3646   */
3647  
3648  /**
3649   * Internal dependencies
3650   */
3651  
3652  
3653  /**
3654   * Higher-order component which renders the original component with the current
3655   * registry context passed as its `registry` prop.
3656   *
3657   * @param {WPComponent} OriginalComponent Original component.
3658   *
3659   * @return {WPComponent} Enhanced component.
3660   */
3661  
3662  const withRegistry = Object(external_wp_compose_["createHigherOrderComponent"])(OriginalComponent => props => Object(external_wp_element_["createElement"])(RegistryConsumer, null, registry => Object(external_wp_element_["createElement"])(OriginalComponent, Object(esm_extends["a" /* default */])({}, props, {
3663    registry: registry
3664  }))), 'withRegistry');
3665  /* harmony default export */ var with_registry = (withRegistry);
3666  
3667  // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/use-dispatch/use-dispatch.js
3668  /**
3669   * Internal dependencies
3670   */
3671  
3672  /** @typedef {import('./types').WPDataStore} WPDataStore */
3673  
3674  /**
3675   * A custom react hook returning the current registry dispatch actions creators.
3676   *
3677   * Note: The component using this hook must be within the context of a
3678   * RegistryProvider.
3679   *
3680   * @param {string|WPDataStore} [storeNameOrDefinition] Optionally provide the name of the
3681   *                                                     store or its definition from which to
3682   *                                                     retrieve action creators. If not
3683   *                                                     provided, the registry.dispatch
3684   *                                                     function is returned instead.
3685   *
3686   * @example
3687   * This illustrates a pattern where you may need to retrieve dynamic data from
3688   * the server via the `useSelect` hook to use in combination with the dispatch
3689   * action.
3690   *
3691   * ```jsx
3692   * import { useDispatch, useSelect } from '@wordpress/data';
3693   * import { useCallback } from '@wordpress/element';
3694   *
3695   * function Button( { onClick, children } ) {
3696   *   return <button type="button" onClick={ onClick }>{ children }</button>
3697   * }
3698   *
3699   * const SaleButton = ( { children } ) => {
3700   *   const { stockNumber } = useSelect(
3701   *     ( select ) => select( 'my-shop' ).getStockNumber(),
3702   *     []
3703   *   );
3704   *   const { startSale } = useDispatch( 'my-shop' );
3705   *   const onClick = useCallback( () => {
3706   *     const discountPercent = stockNumber > 50 ? 10: 20;
3707   *     startSale( discountPercent );
3708   *   }, [ stockNumber ] );
3709   *   return <Button onClick={ onClick }>{ children }</Button>
3710   * }
3711   *
3712   * // Rendered somewhere in the application:
3713   * //
3714   * // <SaleButton>Start Sale!</SaleButton>
3715   * ```
3716   * @return {Function}  A custom react hook.
3717   */
3718  
3719  const useDispatch = storeNameOrDefinition => {
3720    const {
3721      dispatch
3722    } = useRegistry();
3723    return storeNameOrDefinition === void 0 ? dispatch : dispatch(storeNameOrDefinition);
3724  };
3725  
3726  /* harmony default export */ var use_dispatch = (useDispatch);
3727  
3728  // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/index.js
3729  /**
3730   * External dependencies
3731   */
3732  
3733  /**
3734   * Internal dependencies
3735   */
3736  
3737  
3738  
3739  /** @typedef {import('./types').WPDataStore} WPDataStore */
3740  
3741  
3742  
3743  
3744  
3745  
3746  
3747  
3748  
3749  
3750  
3751  
3752  /**
3753   * Object of available plugins to use with a registry.
3754   *
3755   * @see [use](#use)
3756   *
3757   * @type {Object}
3758   */
3759  
3760  
3761  /**
3762   * The combineReducers helper function turns an object whose values are different
3763   * reducing functions into a single reducing function you can pass to registerReducer.
3764   *
3765   * @param {Object} reducers An object whose values correspond to different reducing
3766   *                          functions that need to be combined into one.
3767   *
3768   * @example
3769   * ```js
3770   * import { combineReducers, createReduxStore, register } from '@wordpress/data';
3771   *
3772   * const prices = ( state = {}, action ) => {
3773   *     return action.type === 'SET_PRICE' ?
3774   *         {
3775   *             ...state,
3776   *             [ action.item ]: action.price,
3777   *         } :
3778   *         state;
3779   * };
3780   *
3781   * const discountPercent = ( state = 0, action ) => {
3782   *     return action.type === 'START_SALE' ?
3783   *         action.discountPercent :
3784   *         state;
3785   * };
3786   *
3787   * const store = createReduxStore( 'my-shop', {
3788   *     reducer: combineReducers( {
3789   *         prices,
3790   *         discountPercent,
3791   *     } ),
3792   * } );
3793   * register( store );
3794   * ```
3795   *
3796   * @return {Function}       A reducer that invokes every reducer inside the reducers
3797   *                          object, and constructs a state object with the same shape.
3798   */
3799  
3800  
3801  /**
3802   * Given the name or definition of a registered store, returns an object of the store's selectors.
3803   * The selector functions are been pre-bound to pass the current state automatically.
3804   * As a consumer, you need only pass arguments of the selector, if applicable.
3805   *
3806   * @param {string|WPDataStore} storeNameOrDefinition Unique namespace identifier for the store
3807   *                                                   or the store definition.
3808   *
3809   * @example
3810   * ```js
3811   * import { select } from '@wordpress/data';
3812   *
3813   * select( 'my-shop' ).getPrice( 'hammer' );
3814   * ```
3815   *
3816   * @return {Object} Object containing the store's selectors.
3817   */
3818  
3819  const build_module_select = default_registry.select;
3820  /**
3821   * Given the name of a registered store, returns an object containing the store's
3822   * selectors pre-bound to state so that you only need to supply additional arguments,
3823   * and modified so that they return promises that resolve to their eventual values,
3824   * after any resolvers have ran.
3825   *
3826   * @param {string|WPDataStore} storeNameOrDefinition Unique namespace identifier for the store
3827   *                                                   or the store definition.
3828   *
3829   * @example
3830   * ```js
3831   * import { resolveSelect } from '@wordpress/data';
3832   *
3833   * resolveSelect( 'my-shop' ).getPrice( 'hammer' ).then(console.log)
3834   * ```
3835   *
3836   * @return {Object} Object containing the store's promise-wrapped selectors.
3837   */
3838  
3839  const build_module_resolveSelect = default_registry.resolveSelect;
3840  /**
3841   * Given the name of a registered store, returns an object of the store's action creators.
3842   * Calling an action creator will cause it to be dispatched, updating the state value accordingly.
3843   *
3844   * Note: Action creators returned by the dispatch will return a promise when
3845   * they are called.
3846   *
3847   * @param {string|WPDataStore} storeNameOrDefinition Unique namespace identifier for the store
3848   *                                                   or the store definition.
3849   *
3850   * @example
3851   * ```js
3852   * import { dispatch } from '@wordpress/data';
3853   *
3854   * dispatch( 'my-shop' ).setPrice( 'hammer', 9.75 );
3855   * ```
3856   * @return {Object} Object containing the action creators.
3857   */
3858  
3859  const build_module_dispatch = default_registry.dispatch;
3860  /**
3861   * Given a listener function, the function will be called any time the state value
3862   * of one of the registered stores has changed. This function returns a `unsubscribe`
3863   * function used to stop the subscription.
3864   *
3865   * @param {Function} listener Callback function.
3866   *
3867   * @example
3868   * ```js
3869   * import { subscribe } from '@wordpress/data';
3870   *
3871   * const unsubscribe = subscribe( () => {
3872   *     // You could use this opportunity to test whether the derived result of a
3873   *     // selector has subsequently changed as the result of a state update.
3874   * } );
3875   *
3876   * // Later, if necessary...
3877   * unsubscribe();
3878   * ```
3879   */
3880  
3881  const build_module_subscribe = default_registry.subscribe;
3882  /**
3883   * Registers a generic store.
3884   *
3885   * @deprecated Use `register` instead.
3886   *
3887   * @param {string} key    Store registry key.
3888   * @param {Object} config Configuration (getSelectors, getActions, subscribe).
3889   */
3890  
3891  const build_module_registerGenericStore = default_registry.registerGenericStore;
3892  /**
3893   * Registers a standard `@wordpress/data` store.
3894   *
3895   * @deprecated Use `register` instead.
3896   *
3897   * @param {string} storeName Unique namespace identifier for the store.
3898   * @param {Object} options   Store description (reducer, actions, selectors, resolvers).
3899   *
3900   * @return {Object} Registered store object.
3901   */
3902  
3903  const registerStore = default_registry.registerStore;
3904  /**
3905   * Extends a registry to inherit functionality provided by a given plugin. A
3906   * plugin is an object with properties aligning to that of a registry, merged
3907   * to extend the default registry behavior.
3908   *
3909   * @param {Object} plugin Plugin object.
3910   */
3911  
3912  const build_module_use = default_registry.use;
3913  /**
3914   * Registers a standard `@wordpress/data` store definition.
3915   *
3916   * @example
3917   * ```js
3918   * import { createReduxStore, register } from '@wordpress/data';
3919   *
3920   * const store = createReduxStore( 'demo', {
3921   *     reducer: ( state = 'OK' ) => state,
3922   *     selectors: {
3923   *         getValue: ( state ) => state,
3924   *     },
3925   * } );
3926   * register( store );
3927   * ```
3928   *
3929   * @param {WPDataStore} store Store definition.
3930   */
3931  
3932  const build_module_register = default_registry.register;
3933  
3934  
3935  /***/ }),
3936  
3937  /***/ "rl8x":
3938  /***/ (function(module, exports) {
3939  
3940  (function() { module.exports = window["wp"]["isShallowEqual"]; }());
3941  
3942  /***/ }),
3943  
3944  /***/ "wx14":
3945  /***/ (function(module, __webpack_exports__, __webpack_require__) {
3946  
3947  "use strict";
3948  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _extends; });
3949  function _extends() {
3950    _extends = Object.assign || function (target) {
3951      for (var i = 1; i < arguments.length; i++) {
3952        var source = arguments[i];
3953  
3954        for (var key in source) {
3955          if (Object.prototype.hasOwnProperty.call(source, key)) {
3956            target[key] = source[key];
3957          }
3958        }
3959      }
3960  
3961      return target;
3962    };
3963  
3964    return _extends.apply(this, arguments);
3965  }
3966  
3967  /***/ })
3968  
3969  /******/ });


Generated: Sun Aug 1 01:00:05 2021 Cross-referenced by PHPXref 0.7.1