wp/wp-includes/js/dist/data.js
changeset 18 be944660c56a
parent 16 a86126ab1dd4
child 19 3d72ae0968f4
equal deleted inserted replaced
17:34716fd837a4 18:be944660c56a
    80 /******/ 	// __webpack_public_path__
    80 /******/ 	// __webpack_public_path__
    81 /******/ 	__webpack_require__.p = "";
    81 /******/ 	__webpack_require__.p = "";
    82 /******/
    82 /******/
    83 /******/
    83 /******/
    84 /******/ 	// Load entry module and return exports
    84 /******/ 	// Load entry module and return exports
    85 /******/ 	return __webpack_require__(__webpack_require__.s = 442);
    85 /******/ 	return __webpack_require__(__webpack_require__.s = "pfJ3");
    86 /******/ })
    86 /******/ })
    87 /************************************************************************/
    87 /************************************************************************/
    88 /******/ ({
    88 /******/ ({
    89 
    89 
    90 /***/ 0:
    90 /***/ "8mpt":
    91 /***/ (function(module, exports) {
    91 /***/ (function(module, exports) {
    92 
    92 
    93 (function() { module.exports = this["wp"]["element"]; }());
    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 
    94 
   146 
    95 /***/ }),
   147 /***/ }),
    96 
   148 
    97 /***/ 126:
   149 /***/ "FtRg":
    98 /***/ (function(module, exports, __webpack_require__) {
   150 /***/ (function(module, exports, __webpack_require__) {
    99 
   151 
   100 "use strict";
   152 "use strict";
   101 
   153 
   102 
   154 
   407 module.exports = EquivalentKeyMap;
   459 module.exports = EquivalentKeyMap;
   408 
   460 
   409 
   461 
   410 /***/ }),
   462 /***/ }),
   411 
   463 
   412 /***/ 127:
   464 /***/ "GRId":
   413 /***/ (function(module, exports) {
   465 /***/ (function(module, exports) {
   414 
   466 
   415 var g;
   467 (function() { module.exports = window["wp"]["element"]; }());
   416 
       
   417 // This works in non-strict mode
       
   418 g = (function() {
       
   419 	return this;
       
   420 })();
       
   421 
       
   422 try {
       
   423 	// This works if eval is allowed (see CSP)
       
   424 	g = g || new Function("return this")();
       
   425 } catch (e) {
       
   426 	// This works if the window reference is available
       
   427 	if (typeof window === "object") g = window;
       
   428 }
       
   429 
       
   430 // g can still be undefined, but nothing to do about it...
       
   431 // We return undefined, instead of nothing here, so it's
       
   432 // easier to handle this case. if(!global) { ...}
       
   433 
       
   434 module.exports = g;
       
   435 
       
   436 
   468 
   437 /***/ }),
   469 /***/ }),
   438 
   470 
   439 /***/ 13:
   471 /***/ "JlUD":
   440 /***/ (function(module, exports) {
       
   441 
       
   442 (function() { module.exports = this["React"]; }());
       
   443 
       
   444 /***/ }),
       
   445 
       
   446 /***/ 14:
       
   447 /***/ (function(module, __webpack_exports__, __webpack_require__) {
       
   448 
       
   449 "use strict";
       
   450 
       
   451 // EXPORTS
       
   452 __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _slicedToArray; });
       
   453 
       
   454 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
       
   455 var arrayWithHoles = __webpack_require__(38);
       
   456 
       
   457 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
       
   458 function _iterableToArrayLimit(arr, i) {
       
   459   if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
       
   460   var _arr = [];
       
   461   var _n = true;
       
   462   var _d = false;
       
   463   var _e = undefined;
       
   464 
       
   465   try {
       
   466     for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
       
   467       _arr.push(_s.value);
       
   468 
       
   469       if (i && _arr.length === i) break;
       
   470     }
       
   471   } catch (err) {
       
   472     _d = true;
       
   473     _e = err;
       
   474   } finally {
       
   475     try {
       
   476       if (!_n && _i["return"] != null) _i["return"]();
       
   477     } finally {
       
   478       if (_d) throw _e;
       
   479     }
       
   480   }
       
   481 
       
   482   return _arr;
       
   483 }
       
   484 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
       
   485 var unsupportedIterableToArray = __webpack_require__(29);
       
   486 
       
   487 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
       
   488 var nonIterableRest = __webpack_require__(39);
       
   489 
       
   490 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js
       
   491 
       
   492 
       
   493 
       
   494 
       
   495 function _slicedToArray(arr, i) {
       
   496   return Object(arrayWithHoles["a" /* default */])(arr) || _iterableToArrayLimit(arr, i) || Object(unsupportedIterableToArray["a" /* default */])(arr, i) || Object(nonIterableRest["a" /* default */])();
       
   497 }
       
   498 
       
   499 /***/ }),
       
   500 
       
   501 /***/ 150:
       
   502 /***/ (function(module, exports) {
       
   503 
       
   504 (function() { module.exports = this["wp"]["priorityQueue"]; }());
       
   505 
       
   506 /***/ }),
       
   507 
       
   508 /***/ 151:
       
   509 /***/ (function(module, exports) {
   472 /***/ (function(module, exports) {
   510 
   473 
   511 module.exports = isPromise;
   474 module.exports = isPromise;
   512 module.exports.default = isPromise;
   475 module.exports.default = isPromise;
   513 
   476 
   516 }
   479 }
   517 
   480 
   518 
   481 
   519 /***/ }),
   482 /***/ }),
   520 
   483 
   521 /***/ 163:
   484 /***/ "K9lf":
   522 /***/ (function(module, exports) {
   485 /***/ (function(module, exports) {
   523 
   486 
   524 function combineReducers( reducers ) {
   487 (function() { module.exports = window["wp"]["compose"]; }());
   525 	var keys = Object.keys( reducers ),
       
   526 		getNextState;
       
   527 
       
   528 	getNextState = ( function() {
       
   529 		var fn, i, key;
       
   530 
       
   531 		fn = 'return {';
       
   532 		for ( i = 0; i < keys.length; i++ ) {
       
   533 			// Rely on Quoted escaping of JSON.stringify with guarantee that
       
   534 			// each member of Object.keys is a string.
       
   535 			//
       
   536 			// "If Type(value) is String, then return the result of calling the
       
   537 			// abstract operation Quote with argument value. [...] The abstract
       
   538 			// operation Quote(value) wraps a String value in double quotes and
       
   539 			// escapes characters within it."
       
   540 			//
       
   541 			// https://www.ecma-international.org/ecma-262/5.1/#sec-15.12.3
       
   542 			key = JSON.stringify( keys[ i ] );
       
   543 
       
   544 			fn += key + ':r[' + key + '](s[' + key + '],a),';
       
   545 		}
       
   546 		fn += '}';
       
   547 
       
   548 		return new Function( 'r,s,a', fn );
       
   549 	} )();
       
   550 
       
   551 	return function combinedReducer( state, action ) {
       
   552 		var nextState, i, key;
       
   553 
       
   554 		// Assumed changed if initial state.
       
   555 		if ( state === undefined ) {
       
   556 			return getNextState( reducers, {}, action );
       
   557 		}
       
   558 
       
   559 		nextState = getNextState( reducers, state, action );
       
   560 
       
   561 		// Determine whether state has changed.
       
   562 		i = keys.length;
       
   563 		while ( i-- ) {
       
   564 			key = keys[ i ];
       
   565 			if ( state[ key ] !== nextState[ key ] ) {
       
   566 				// Return immediately if a changed value is encountered.
       
   567 				return nextState;
       
   568 			}
       
   569 		}
       
   570 
       
   571 		return state;
       
   572 	};
       
   573 }
       
   574 
       
   575 module.exports = combineReducers;
       
   576 
       
   577 
   488 
   578 /***/ }),
   489 /***/ }),
   579 
   490 
   580 /***/ 18:
   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":
   581 /***/ (function(module, __webpack_exports__, __webpack_require__) {
   527 /***/ (function(module, __webpack_exports__, __webpack_require__) {
   582 
   528 
   583 "use strict";
   529 "use strict";
   584 
   530 /* unused harmony export useCallback */
   585 // EXPORTS
   531 /* unused harmony export useCallbackOne */
   586 __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _toConsumableArray; });
   532 /* unused harmony export useMemo */
   587 
   533 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useMemoOne; });
   588 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
   534 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("cDcd");
   589 var arrayLikeToArray = __webpack_require__(26);
   535 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
   590 
   536 
   591 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
   537 
   592 
   538 function areInputsEqual(newInputs, lastInputs) {
   593 function _arrayWithoutHoles(arr) {
   539   if (newInputs.length !== lastInputs.length) {
   594   if (Array.isArray(arr)) return Object(arrayLikeToArray["a" /* default */])(arr);
   540     return false;
   595 }
   541   }
   596 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
   542 
   597 var iterableToArray = __webpack_require__(35);
   543   for (var i = 0; i < newInputs.length; i++) {
   598 
   544     if (newInputs[i] !== lastInputs[i]) {
   599 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
   545       return false;
   600 var unsupportedIterableToArray = __webpack_require__(29);
   546     }
   601 
   547   }
   602 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
   548 
   603 function _nonIterableSpread() {
   549   return true;
   604   throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
   550 }
   605 }
   551 
   606 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
   552 function useMemoOne(getResult, inputs) {
   607 
   553   var initial = Object(react__WEBPACK_IMPORTED_MODULE_0__["useState"])(function () {
   608 
   554     return {
   609 
   555       inputs: inputs,
   610 
   556       result: getResult()
   611 function _toConsumableArray(arr) {
   557     };
   612   return _arrayWithoutHoles(arr) || Object(iterableToArray["a" /* default */])(arr) || Object(unsupportedIterableToArray["a" /* default */])(arr) || _nonIterableSpread();
   558   })[0];
   613 }
   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 
   614 
   582 
   615 /***/ }),
   583 /***/ }),
   616 
   584 
   617 /***/ 196:
   585 /***/ "pfJ3":
   618 /***/ (function(module, __webpack_exports__, __webpack_require__) {
       
   619 
       
   620 "use strict";
       
   621 /* WEBPACK VAR INJECTION */(function(global, module) {/* harmony import */ var _ponyfill_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(275);
       
   622 /* global window */
       
   623 
       
   624 
       
   625 var root;
       
   626 
       
   627 if (typeof self !== 'undefined') {
       
   628   root = self;
       
   629 } else if (typeof window !== 'undefined') {
       
   630   root = window;
       
   631 } else if (typeof global !== 'undefined') {
       
   632   root = global;
       
   633 } else if (true) {
       
   634   root = module;
       
   635 } else {}
       
   636 
       
   637 var result = Object(_ponyfill_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(root);
       
   638 /* harmony default export */ __webpack_exports__["a"] = (result);
       
   639 
       
   640 /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(127), __webpack_require__(412)(module)))
       
   641 
       
   642 /***/ }),
       
   643 
       
   644 /***/ 2:
       
   645 /***/ (function(module, exports) {
       
   646 
       
   647 (function() { module.exports = this["lodash"]; }());
       
   648 
       
   649 /***/ }),
       
   650 
       
   651 /***/ 24:
       
   652 /***/ (function(module, exports) {
       
   653 
       
   654 (function() { module.exports = this["regeneratorRuntime"]; }());
       
   655 
       
   656 /***/ }),
       
   657 
       
   658 /***/ 26:
       
   659 /***/ (function(module, __webpack_exports__, __webpack_require__) {
       
   660 
       
   661 "use strict";
       
   662 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayLikeToArray; });
       
   663 function _arrayLikeToArray(arr, len) {
       
   664   if (len == null || len > arr.length) len = arr.length;
       
   665 
       
   666   for (var i = 0, arr2 = new Array(len); i < len; i++) {
       
   667     arr2[i] = arr[i];
       
   668   }
       
   669 
       
   670   return arr2;
       
   671 }
       
   672 
       
   673 /***/ }),
       
   674 
       
   675 /***/ 274:
       
   676 /***/ (function(module, exports) {
       
   677 
       
   678 (function() { module.exports = this["wp"]["reduxRoutine"]; }());
       
   679 
       
   680 /***/ }),
       
   681 
       
   682 /***/ 275:
       
   683 /***/ (function(module, __webpack_exports__, __webpack_require__) {
       
   684 
       
   685 "use strict";
       
   686 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return symbolObservablePonyfill; });
       
   687 function symbolObservablePonyfill(root) {
       
   688 	var result;
       
   689 	var Symbol = root.Symbol;
       
   690 
       
   691 	if (typeof Symbol === 'function') {
       
   692 		if (Symbol.observable) {
       
   693 			result = Symbol.observable;
       
   694 		} else {
       
   695 			result = Symbol('observable');
       
   696 			Symbol.observable = result;
       
   697 		}
       
   698 	} else {
       
   699 		result = '@@observable';
       
   700 	}
       
   701 
       
   702 	return result;
       
   703 };
       
   704 
       
   705 
       
   706 /***/ }),
       
   707 
       
   708 /***/ 29:
       
   709 /***/ (function(module, __webpack_exports__, __webpack_require__) {
       
   710 
       
   711 "use strict";
       
   712 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _unsupportedIterableToArray; });
       
   713 /* harmony import */ var _arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26);
       
   714 
       
   715 function _unsupportedIterableToArray(o, minLen) {
       
   716   if (!o) return;
       
   717   if (typeof o === "string") return Object(_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen);
       
   718   var n = Object.prototype.toString.call(o).slice(8, -1);
       
   719   if (n === "Object" && o.constructor) n = o.constructor.name;
       
   720   if (n === "Map" || n === "Set") return Array.from(o);
       
   721   if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Object(_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen);
       
   722 }
       
   723 
       
   724 /***/ }),
       
   725 
       
   726 /***/ 35:
       
   727 /***/ (function(module, __webpack_exports__, __webpack_require__) {
       
   728 
       
   729 "use strict";
       
   730 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _iterableToArray; });
       
   731 function _iterableToArray(iter) {
       
   732   if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
       
   733 }
       
   734 
       
   735 /***/ }),
       
   736 
       
   737 /***/ 37:
       
   738 /***/ (function(module, exports) {
       
   739 
       
   740 (function() { module.exports = this["wp"]["deprecated"]; }());
       
   741 
       
   742 /***/ }),
       
   743 
       
   744 /***/ 38:
       
   745 /***/ (function(module, __webpack_exports__, __webpack_require__) {
       
   746 
       
   747 "use strict";
       
   748 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayWithHoles; });
       
   749 function _arrayWithHoles(arr) {
       
   750   if (Array.isArray(arr)) return arr;
       
   751 }
       
   752 
       
   753 /***/ }),
       
   754 
       
   755 /***/ 39:
       
   756 /***/ (function(module, __webpack_exports__, __webpack_require__) {
       
   757 
       
   758 "use strict";
       
   759 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _nonIterableRest; });
       
   760 function _nonIterableRest() {
       
   761   throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
       
   762 }
       
   763 
       
   764 /***/ }),
       
   765 
       
   766 /***/ 412:
       
   767 /***/ (function(module, exports) {
       
   768 
       
   769 module.exports = function(originalModule) {
       
   770 	if (!originalModule.webpackPolyfill) {
       
   771 		var module = Object.create(originalModule);
       
   772 		// module.parent = undefined by default
       
   773 		if (!module.children) module.children = [];
       
   774 		Object.defineProperty(module, "loaded", {
       
   775 			enumerable: true,
       
   776 			get: function() {
       
   777 				return module.l;
       
   778 			}
       
   779 		});
       
   780 		Object.defineProperty(module, "id", {
       
   781 			enumerable: true,
       
   782 			get: function() {
       
   783 				return module.i;
       
   784 			}
       
   785 		});
       
   786 		Object.defineProperty(module, "exports", {
       
   787 			enumerable: true
       
   788 		});
       
   789 		module.webpackPolyfill = 1;
       
   790 	}
       
   791 	return module;
       
   792 };
       
   793 
       
   794 
       
   795 /***/ }),
       
   796 
       
   797 /***/ 442:
       
   798 /***/ (function(module, __webpack_exports__, __webpack_require__) {
   586 /***/ (function(module, __webpack_exports__, __webpack_require__) {
   799 
   587 
   800 "use strict";
   588 "use strict";
   801 // ESM COMPAT FLAG
   589 // ESM COMPAT FLAG
   802 __webpack_require__.r(__webpack_exports__);
   590 __webpack_require__.r(__webpack_exports__);
   808 __webpack_require__.d(__webpack_exports__, "RegistryProvider", function() { return /* reexport */ context; });
   596 __webpack_require__.d(__webpack_exports__, "RegistryProvider", function() { return /* reexport */ context; });
   809 __webpack_require__.d(__webpack_exports__, "RegistryConsumer", function() { return /* reexport */ RegistryConsumer; });
   597 __webpack_require__.d(__webpack_exports__, "RegistryConsumer", function() { return /* reexport */ RegistryConsumer; });
   810 __webpack_require__.d(__webpack_exports__, "useRegistry", function() { return /* reexport */ useRegistry; });
   598 __webpack_require__.d(__webpack_exports__, "useRegistry", function() { return /* reexport */ useRegistry; });
   811 __webpack_require__.d(__webpack_exports__, "useSelect", function() { return /* reexport */ useSelect; });
   599 __webpack_require__.d(__webpack_exports__, "useSelect", function() { return /* reexport */ useSelect; });
   812 __webpack_require__.d(__webpack_exports__, "useDispatch", function() { return /* reexport */ use_dispatch; });
   600 __webpack_require__.d(__webpack_exports__, "useDispatch", function() { return /* reexport */ use_dispatch; });
   813 __webpack_require__.d(__webpack_exports__, "__unstableUseDispatchWithMap", function() { return /* reexport */ use_dispatch_with_map; });
       
   814 __webpack_require__.d(__webpack_exports__, "AsyncModeProvider", function() { return /* reexport */ async_mode_provider_context; });
   601 __webpack_require__.d(__webpack_exports__, "AsyncModeProvider", function() { return /* reexport */ async_mode_provider_context; });
   815 __webpack_require__.d(__webpack_exports__, "createRegistry", function() { return /* reexport */ createRegistry; });
   602 __webpack_require__.d(__webpack_exports__, "createRegistry", function() { return /* reexport */ createRegistry; });
   816 __webpack_require__.d(__webpack_exports__, "createRegistrySelector", function() { return /* reexport */ createRegistrySelector; });
   603 __webpack_require__.d(__webpack_exports__, "createRegistrySelector", function() { return /* reexport */ createRegistrySelector; });
   817 __webpack_require__.d(__webpack_exports__, "createRegistryControl", function() { return /* reexport */ createRegistryControl; });
   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; });
   818 __webpack_require__.d(__webpack_exports__, "plugins", function() { return /* reexport */ plugins_namespaceObject; });
   607 __webpack_require__.d(__webpack_exports__, "plugins", function() { return /* reexport */ plugins_namespaceObject; });
   819 __webpack_require__.d(__webpack_exports__, "combineReducers", function() { return /* reexport */ turbo_combine_reducers_default.a; });
   608 __webpack_require__.d(__webpack_exports__, "combineReducers", function() { return /* reexport */ turbo_combine_reducers_default.a; });
   820 __webpack_require__.d(__webpack_exports__, "select", function() { return /* binding */ build_module_select; });
   609 __webpack_require__.d(__webpack_exports__, "select", function() { return /* binding */ build_module_select; });
   821 __webpack_require__.d(__webpack_exports__, "__experimentalResolveSelect", function() { return /* binding */ build_module_experimentalResolveSelect; });
   610 __webpack_require__.d(__webpack_exports__, "resolveSelect", function() { return /* binding */ build_module_resolveSelect; });
   822 __webpack_require__.d(__webpack_exports__, "dispatch", function() { return /* binding */ build_module_dispatch; });
   611 __webpack_require__.d(__webpack_exports__, "dispatch", function() { return /* binding */ build_module_dispatch; });
   823 __webpack_require__.d(__webpack_exports__, "subscribe", function() { return /* binding */ build_module_subscribe; });
   612 __webpack_require__.d(__webpack_exports__, "subscribe", function() { return /* binding */ build_module_subscribe; });
   824 __webpack_require__.d(__webpack_exports__, "registerGenericStore", function() { return /* binding */ build_module_registerGenericStore; });
   613 __webpack_require__.d(__webpack_exports__, "registerGenericStore", function() { return /* binding */ build_module_registerGenericStore; });
   825 __webpack_require__.d(__webpack_exports__, "registerStore", function() { return /* binding */ build_module_registerStore; });
   614 __webpack_require__.d(__webpack_exports__, "registerStore", function() { return /* binding */ registerStore; });
   826 __webpack_require__.d(__webpack_exports__, "use", function() { return /* binding */ build_module_use; });
   615 __webpack_require__.d(__webpack_exports__, "use", function() { return /* binding */ build_module_use; });
   827 
   616 __webpack_require__.d(__webpack_exports__, "register", function() { return /* binding */ build_module_register; });
   828 // NAMESPACE OBJECT: ./node_modules/@wordpress/data/build-module/namespace-store/metadata/selectors.js
   617 
       
   618 // NAMESPACE OBJECT: ./node_modules/@wordpress/data/build-module/redux-store/metadata/selectors.js
   829 var selectors_namespaceObject = {};
   619 var selectors_namespaceObject = {};
   830 __webpack_require__.r(selectors_namespaceObject);
   620 __webpack_require__.r(selectors_namespaceObject);
   831 __webpack_require__.d(selectors_namespaceObject, "getIsResolving", function() { return getIsResolving; });
   621 __webpack_require__.d(selectors_namespaceObject, "getIsResolving", function() { return getIsResolving; });
   832 __webpack_require__.d(selectors_namespaceObject, "hasStartedResolution", function() { return hasStartedResolution; });
   622 __webpack_require__.d(selectors_namespaceObject, "hasStartedResolution", function() { return hasStartedResolution; });
   833 __webpack_require__.d(selectors_namespaceObject, "hasFinishedResolution", function() { return hasFinishedResolution; });
   623 __webpack_require__.d(selectors_namespaceObject, "hasFinishedResolution", function() { return hasFinishedResolution; });
   834 __webpack_require__.d(selectors_namespaceObject, "isResolving", function() { return isResolving; });
   624 __webpack_require__.d(selectors_namespaceObject, "isResolving", function() { return isResolving; });
   835 __webpack_require__.d(selectors_namespaceObject, "getCachedResolvers", function() { return getCachedResolvers; });
   625 __webpack_require__.d(selectors_namespaceObject, "getCachedResolvers", function() { return getCachedResolvers; });
   836 
   626 
   837 // NAMESPACE OBJECT: ./node_modules/@wordpress/data/build-module/namespace-store/metadata/actions.js
   627 // NAMESPACE OBJECT: ./node_modules/@wordpress/data/build-module/redux-store/metadata/actions.js
   838 var actions_namespaceObject = {};
   628 var actions_namespaceObject = {};
   839 __webpack_require__.r(actions_namespaceObject);
   629 __webpack_require__.r(actions_namespaceObject);
   840 __webpack_require__.d(actions_namespaceObject, "startResolution", function() { return startResolution; });
   630 __webpack_require__.d(actions_namespaceObject, "startResolution", function() { return startResolution; });
   841 __webpack_require__.d(actions_namespaceObject, "finishResolution", function() { return finishResolution; });
   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; });
   842 __webpack_require__.d(actions_namespaceObject, "invalidateResolution", function() { return invalidateResolution; });
   634 __webpack_require__.d(actions_namespaceObject, "invalidateResolution", function() { return invalidateResolution; });
   843 __webpack_require__.d(actions_namespaceObject, "invalidateResolutionForStore", function() { return invalidateResolutionForStore; });
   635 __webpack_require__.d(actions_namespaceObject, "invalidateResolutionForStore", function() { return invalidateResolutionForStore; });
   844 __webpack_require__.d(actions_namespaceObject, "invalidateResolutionForStoreSelector", function() { return invalidateResolutionForStoreSelector; });
   636 __webpack_require__.d(actions_namespaceObject, "invalidateResolutionForStoreSelector", function() { return invalidateResolutionForStoreSelector; });
   845 
   637 
   846 // NAMESPACE OBJECT: ./node_modules/@wordpress/data/build-module/plugins/index.js
   638 // NAMESPACE OBJECT: ./node_modules/@wordpress/data/build-module/plugins/index.js
   847 var plugins_namespaceObject = {};
   639 var plugins_namespaceObject = {};
   848 __webpack_require__.r(plugins_namespaceObject);
   640 __webpack_require__.r(plugins_namespaceObject);
   849 __webpack_require__.d(plugins_namespaceObject, "controls", function() { return controls; });
   641 __webpack_require__.d(plugins_namespaceObject, "controls", function() { return plugins_controls; });
   850 __webpack_require__.d(plugins_namespaceObject, "persistence", function() { return plugins_persistence; });
   642 __webpack_require__.d(plugins_namespaceObject, "persistence", function() { return plugins_persistence; });
   851 
   643 
   852 // EXTERNAL MODULE: ./node_modules/turbo-combine-reducers/index.js
   644 // EXTERNAL MODULE: ./node_modules/turbo-combine-reducers/index.js
   853 var turbo_combine_reducers = __webpack_require__(163);
   645 var turbo_combine_reducers = __webpack_require__("8mpt");
   854 var turbo_combine_reducers_default = /*#__PURE__*/__webpack_require__.n(turbo_combine_reducers);
   646 var turbo_combine_reducers_default = /*#__PURE__*/__webpack_require__.n(turbo_combine_reducers);
   855 
   647 
   856 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
   648 // EXTERNAL MODULE: external "lodash"
   857 var slicedToArray = __webpack_require__(14);
   649 var external_lodash_ = __webpack_require__("YLtl");
   858 
   650 
   859 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
   651 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
   860 var defineProperty = __webpack_require__(5);
   652 function _defineProperty(obj, key, value) {
   861 
   653   if (key in obj) {
   862 // EXTERNAL MODULE: external {"this":"lodash"}
   654     Object.defineProperty(obj, key, {
   863 var external_this_lodash_ = __webpack_require__(2);
   655       value: value,
   864 
   656       enumerable: true,
   865 // EXTERNAL MODULE: ./node_modules/memize/index.js
   657       configurable: true,
   866 var memize = __webpack_require__(60);
   658       writable: true
   867 var memize_default = /*#__PURE__*/__webpack_require__.n(memize);
   659     });
   868 
   660   } else {
   869 // EXTERNAL MODULE: external {"this":"regeneratorRuntime"}
   661     obj[key] = value;
   870 var external_this_regeneratorRuntime_ = __webpack_require__(24);
   662   }
   871 var external_this_regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(external_this_regeneratorRuntime_);
   663 
   872 
   664   return obj;
   873 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
   665 }
   874 var asyncToGenerator = __webpack_require__(50);
   666 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js
   875 
   667 
   876 // EXTERNAL MODULE: ./node_modules/symbol-observable/es/index.js
   668 
   877 var es = __webpack_require__(196);
   669 function ownKeys(object, enumerableOnly) {
   878 
   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 }
   879 // CONCATENATED MODULE: ./node_modules/redux/es/redux.js
   706 // CONCATENATED MODULE: ./node_modules/redux/es/redux.js
   880 
   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 })();
   881 
   724 
   882 /**
   725 /**
   883  * These are private action types reserved by Redux.
   726  * These are private action types reserved by Redux.
   884  * For any unknown actions, you must return the current state.
   727  * For any unknown actions, you must return the current state.
   885  * If the current state is undefined, you must return the initial state.
   728  * If the current state is undefined, you must return the initial state.
   910   }
   753   }
   911 
   754 
   912   return Object.getPrototypeOf(obj) === proto;
   755   return Object.getPrototypeOf(obj) === proto;
   913 }
   756 }
   914 
   757 
       
   758 // Inlined / shortened version of `kindOf` from https://github.com/jonschlinkert/kind-of
       
   759 function miniKindOf(val) {
       
   760   if (val === void 0) return 'undefined';
       
   761   if (val === null) return 'null';
       
   762   var type = typeof val;
       
   763 
       
   764   switch (type) {
       
   765     case 'boolean':
       
   766     case 'string':
       
   767     case 'number':
       
   768     case 'symbol':
       
   769     case 'function':
       
   770       {
       
   771         return type;
       
   772       }
       
   773   }
       
   774 
       
   775   if (Array.isArray(val)) return 'array';
       
   776   if (isDate(val)) return 'date';
       
   777   if (isError(val)) return 'error';
       
   778   var constructorName = ctorName(val);
       
   779 
       
   780   switch (constructorName) {
       
   781     case 'Symbol':
       
   782     case 'Promise':
       
   783     case 'WeakMap':
       
   784     case 'WeakSet':
       
   785     case 'Map':
       
   786     case 'Set':
       
   787       return constructorName;
       
   788   } // other
       
   789 
       
   790 
       
   791   return type.slice(8, -1).toLowerCase().replace(/\s/g, '');
       
   792 }
       
   793 
       
   794 function ctorName(val) {
       
   795   return typeof val.constructor === 'function' ? val.constructor.name : null;
       
   796 }
       
   797 
       
   798 function isError(val) {
       
   799   return val instanceof Error || typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number';
       
   800 }
       
   801 
       
   802 function isDate(val) {
       
   803   if (val instanceof Date) return true;
       
   804   return typeof val.toDateString === 'function' && typeof val.getDate === 'function' && typeof val.setDate === 'function';
       
   805 }
       
   806 
       
   807 function kindOf(val) {
       
   808   var typeOfVal = typeof val;
       
   809 
       
   810   if (false) {}
       
   811 
       
   812   return typeOfVal;
       
   813 }
       
   814 
   915 /**
   815 /**
   916  * Creates a Redux store that holds the state tree.
   816  * Creates a Redux store that holds the state tree.
   917  * The only way to change the data in the store is to call `dispatch()` on it.
   817  * The only way to change the data in the store is to call `dispatch()` on it.
   918  *
   818  *
   919  * There should only be a single store in your app. To specify how different
   819  * There should only be a single store in your app. To specify how different
   936  *
   836  *
   937  * @returns {Store} A Redux store that lets you read the state, dispatch actions
   837  * @returns {Store} A Redux store that lets you read the state, dispatch actions
   938  * and subscribe to changes.
   838  * and subscribe to changes.
   939  */
   839  */
   940 
   840 
   941 function createStore(reducer, preloadedState, enhancer) {
   841 function redux_createStore(reducer, preloadedState, enhancer) {
   942   var _ref2;
   842   var _ref2;
   943 
   843 
   944   if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') {
   844   if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') {
   945     throw new Error('It looks like you are passing several store enhancers to ' + 'createStore(). This is not supported. Instead, compose them ' + 'together to a single function.');
   845     throw new Error( true ? formatProdErrorMessage(0) : undefined);
   946   }
   846   }
   947 
   847 
   948   if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {
   848   if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {
   949     enhancer = preloadedState;
   849     enhancer = preloadedState;
   950     preloadedState = undefined;
   850     preloadedState = undefined;
   951   }
   851   }
   952 
   852 
   953   if (typeof enhancer !== 'undefined') {
   853   if (typeof enhancer !== 'undefined') {
   954     if (typeof enhancer !== 'function') {
   854     if (typeof enhancer !== 'function') {
   955       throw new Error('Expected the enhancer to be a function.');
   855       throw new Error( true ? formatProdErrorMessage(1) : undefined);
   956     }
   856     }
   957 
   857 
   958     return enhancer(createStore)(reducer, preloadedState);
   858     return enhancer(redux_createStore)(reducer, preloadedState);
   959   }
   859   }
   960 
   860 
   961   if (typeof reducer !== 'function') {
   861   if (typeof reducer !== 'function') {
   962     throw new Error('Expected the reducer to be a function.');
   862     throw new Error( true ? formatProdErrorMessage(2) : undefined);
   963   }
   863   }
   964 
   864 
   965   var currentReducer = reducer;
   865   var currentReducer = reducer;
   966   var currentState = preloadedState;
   866   var currentState = preloadedState;
   967   var currentListeners = [];
   867   var currentListeners = [];
   987    */
   887    */
   988 
   888 
   989 
   889 
   990   function getState() {
   890   function getState() {
   991     if (isDispatching) {
   891     if (isDispatching) {
   992       throw new Error('You may not call store.getState() while the reducer is executing. ' + 'The reducer has already received the state as an argument. ' + 'Pass it down from the top reducer instead of reading it from the store.');
   892       throw new Error( true ? formatProdErrorMessage(3) : undefined);
   993     }
   893     }
   994 
   894 
   995     return currentState;
   895     return currentState;
   996   }
   896   }
   997   /**
   897   /**
  1019    */
   919    */
  1020 
   920 
  1021 
   921 
  1022   function subscribe(listener) {
   922   function subscribe(listener) {
  1023     if (typeof listener !== 'function') {
   923     if (typeof listener !== 'function') {
  1024       throw new Error('Expected the listener to be a function.');
   924       throw new Error( true ? formatProdErrorMessage(4) : undefined);
  1025     }
   925     }
  1026 
   926 
  1027     if (isDispatching) {
   927     if (isDispatching) {
  1028       throw new Error('You may not call store.subscribe() while the reducer is executing. ' + 'If you would like to be notified after the store has been updated, subscribe from a ' + 'component and invoke store.getState() in the callback to access the latest state. ' + 'See https://redux.js.org/api-reference/store#subscribelistener for more details.');
   928       throw new Error( true ? formatProdErrorMessage(5) : undefined);
  1029     }
   929     }
  1030 
   930 
  1031     var isSubscribed = true;
   931     var isSubscribed = true;
  1032     ensureCanMutateNextListeners();
   932     ensureCanMutateNextListeners();
  1033     nextListeners.push(listener);
   933     nextListeners.push(listener);
  1035       if (!isSubscribed) {
   935       if (!isSubscribed) {
  1036         return;
   936         return;
  1037       }
   937       }
  1038 
   938 
  1039       if (isDispatching) {
   939       if (isDispatching) {
  1040         throw new Error('You may not unsubscribe from a store listener while the reducer is executing. ' + 'See https://redux.js.org/api-reference/store#subscribelistener for more details.');
   940         throw new Error( true ? formatProdErrorMessage(6) : undefined);
  1041       }
   941       }
  1042 
   942 
  1043       isSubscribed = false;
   943       isSubscribed = false;
  1044       ensureCanMutateNextListeners();
   944       ensureCanMutateNextListeners();
  1045       var index = nextListeners.indexOf(listener);
   945       var index = nextListeners.indexOf(listener);
  1074    */
   974    */
  1075 
   975 
  1076 
   976 
  1077   function dispatch(action) {
   977   function dispatch(action) {
  1078     if (!isPlainObject(action)) {
   978     if (!isPlainObject(action)) {
  1079       throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.');
   979       throw new Error( true ? formatProdErrorMessage(7) : undefined);
  1080     }
   980     }
  1081 
   981 
  1082     if (typeof action.type === 'undefined') {
   982     if (typeof action.type === 'undefined') {
  1083       throw new Error('Actions may not have an undefined "type" property. ' + 'Have you misspelled a constant?');
   983       throw new Error( true ? formatProdErrorMessage(8) : undefined);
  1084     }
   984     }
  1085 
   985 
  1086     if (isDispatching) {
   986     if (isDispatching) {
  1087       throw new Error('Reducers may not dispatch actions.');
   987       throw new Error( true ? formatProdErrorMessage(9) : undefined);
  1088     }
   988     }
  1089 
   989 
  1090     try {
   990     try {
  1091       isDispatching = true;
   991       isDispatching = true;
  1092       currentState = currentReducer(currentState, action);
   992       currentState = currentReducer(currentState, action);
  1115    */
  1015    */
  1116 
  1016 
  1117 
  1017 
  1118   function replaceReducer(nextReducer) {
  1018   function replaceReducer(nextReducer) {
  1119     if (typeof nextReducer !== 'function') {
  1019     if (typeof nextReducer !== 'function') {
  1120       throw new Error('Expected the nextReducer to be a function.');
  1020       throw new Error( true ? formatProdErrorMessage(10) : undefined);
  1121     }
  1021     }
  1122 
  1022 
  1123     currentReducer = nextReducer; // This action has a similiar effect to ActionTypes.INIT.
  1023     currentReducer = nextReducer; // This action has a similiar effect to ActionTypes.INIT.
  1124     // Any reducers that existed in both the new and old rootReducer
  1024     // Any reducers that existed in both the new and old rootReducer
  1125     // will receive the previous state. This effectively populates
  1025     // will receive the previous state. This effectively populates
  1150        * be used to unsubscribe the observable from the store, and prevent further
  1050        * be used to unsubscribe the observable from the store, and prevent further
  1151        * emission of values from the observable.
  1051        * emission of values from the observable.
  1152        */
  1052        */
  1153       subscribe: function subscribe(observer) {
  1053       subscribe: function subscribe(observer) {
  1154         if (typeof observer !== 'object' || observer === null) {
  1054         if (typeof observer !== 'object' || observer === null) {
  1155           throw new TypeError('Expected the observer to be an object.');
  1055           throw new Error( true ? formatProdErrorMessage(11) : undefined);
  1156         }
  1056         }
  1157 
  1057 
  1158         function observeState() {
  1058         function observeState() {
  1159           if (observer.next) {
  1059           if (observer.next) {
  1160             observer.next(getState());
  1060             observer.next(getState());
  1165         var unsubscribe = outerSubscribe(observeState);
  1065         var unsubscribe = outerSubscribe(observeState);
  1166         return {
  1066         return {
  1167           unsubscribe: unsubscribe
  1067           unsubscribe: unsubscribe
  1168         };
  1068         };
  1169       }
  1069       }
  1170     }, _ref[es["a" /* default */]] = function () {
  1070     }, _ref[$$observable] = function () {
  1171       return this;
  1071       return this;
  1172     }, _ref;
  1072     }, _ref;
  1173   } // When a store is created, an "INIT" action is dispatched so that every
  1073   } // When a store is created, an "INIT" action is dispatched so that every
  1174   // reducer returns their initial state. This effectively populates
  1074   // reducer returns their initial state. This effectively populates
  1175   // the initial state tree.
  1075   // the initial state tree.
  1181   return _ref2 = {
  1081   return _ref2 = {
  1182     dispatch: dispatch,
  1082     dispatch: dispatch,
  1183     subscribe: subscribe,
  1083     subscribe: subscribe,
  1184     getState: getState,
  1084     getState: getState,
  1185     replaceReducer: replaceReducer
  1085     replaceReducer: replaceReducer
  1186   }, _ref2[es["a" /* default */]] = observable, _ref2;
  1086   }, _ref2[$$observable] = observable, _ref2;
  1187 }
  1087 }
  1188 
  1088 
  1189 /**
  1089 /**
  1190  * Prints a warning in the console if it exists.
  1090  * Prints a warning in the console if it exists.
  1191  *
  1091  *
  1207     throw new Error(message);
  1107     throw new Error(message);
  1208   } catch (e) {} // eslint-disable-line no-empty
  1108   } catch (e) {} // eslint-disable-line no-empty
  1209 
  1109 
  1210 }
  1110 }
  1211 
  1111 
  1212 function getUndefinedStateErrorMessage(key, action) {
       
  1213   var actionType = action && action.type;
       
  1214   var actionDescription = actionType && "action \"" + String(actionType) + "\"" || 'an action';
       
  1215   return "Given " + actionDescription + ", reducer \"" + key + "\" returned undefined. " + "To ignore an action, you must explicitly return the previous state. " + "If you want this reducer to hold no value, you can return null instead of undefined.";
       
  1216 }
       
  1217 
       
  1218 function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {
  1112 function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {
  1219   var reducerKeys = Object.keys(reducers);
  1113   var reducerKeys = Object.keys(reducers);
  1220   var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';
  1114   var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';
  1221 
  1115 
  1222   if (reducerKeys.length === 0) {
  1116   if (reducerKeys.length === 0) {
  1223     return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';
  1117     return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';
  1224   }
  1118   }
  1225 
  1119 
  1226   if (!isPlainObject(inputState)) {
  1120   if (!isPlainObject(inputState)) {
  1227     return "The " + argumentName + " has unexpected type of \"" + {}.toString.call(inputState).match(/\s([a-z|A-Z]+)/)[1] + "\". Expected argument to be an object with the following " + ("keys: \"" + reducerKeys.join('", "') + "\"");
  1121     return "The " + argumentName + " has unexpected type of \"" + kindOf(inputState) + "\". Expected argument to be an object with the following " + ("keys: \"" + reducerKeys.join('", "') + "\"");
  1228   }
  1122   }
  1229 
  1123 
  1230   var unexpectedKeys = Object.keys(inputState).filter(function (key) {
  1124   var unexpectedKeys = Object.keys(inputState).filter(function (key) {
  1231     return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];
  1125     return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];
  1232   });
  1126   });
  1246     var initialState = reducer(undefined, {
  1140     var initialState = reducer(undefined, {
  1247       type: ActionTypes.INIT
  1141       type: ActionTypes.INIT
  1248     });
  1142     });
  1249 
  1143 
  1250     if (typeof initialState === 'undefined') {
  1144     if (typeof initialState === 'undefined') {
  1251       throw new Error("Reducer \"" + key + "\" returned undefined during initialization. " + "If the state passed to the reducer is undefined, you must " + "explicitly return the initial state. The initial state may " + "not be undefined. If you don't want to set a value for this reducer, " + "you can use null instead of undefined.");
  1145       throw new Error( true ? formatProdErrorMessage(12) : undefined);
  1252     }
  1146     }
  1253 
  1147 
  1254     if (typeof reducer(undefined, {
  1148     if (typeof reducer(undefined, {
  1255       type: ActionTypes.PROBE_UNKNOWN_ACTION()
  1149       type: ActionTypes.PROBE_UNKNOWN_ACTION()
  1256     }) === 'undefined') {
  1150     }) === 'undefined') {
  1257       throw new Error("Reducer \"" + key + "\" returned undefined when probed with a random type. " + ("Don't try to handle " + ActionTypes.INIT + " or other actions in \"redux/*\" ") + "namespace. They are considered private. Instead, you must return the " + "current state for any unknown actions, unless it is undefined, " + "in which case you must return the initial state, regardless of the " + "action type. The initial state may not be undefined, but can be null.");
  1151       throw new Error( true ? formatProdErrorMessage(13) : undefined);
  1258     }
  1152     }
  1259   });
  1153   });
  1260 }
  1154 }
  1261 /**
  1155 /**
  1262  * Turns an object whose values are different reducer functions, into a single
  1156  * Turns an object whose values are different reducer functions, into a single
  1324       var reducer = finalReducers[_key];
  1218       var reducer = finalReducers[_key];
  1325       var previousStateForKey = state[_key];
  1219       var previousStateForKey = state[_key];
  1326       var nextStateForKey = reducer(previousStateForKey, action);
  1220       var nextStateForKey = reducer(previousStateForKey, action);
  1327 
  1221 
  1328       if (typeof nextStateForKey === 'undefined') {
  1222       if (typeof nextStateForKey === 'undefined') {
  1329         var errorMessage = getUndefinedStateErrorMessage(_key, action);
  1223         var actionType = action && action.type;
  1330         throw new Error(errorMessage);
  1224         throw new Error( true ? formatProdErrorMessage(14) : undefined);
  1331       }
  1225       }
  1332 
  1226 
  1333       nextState[_key] = nextStateForKey;
  1227       nextState[_key] = nextStateForKey;
  1334       hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
  1228       hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
  1335     }
  1229     }
  1371   if (typeof actionCreators === 'function') {
  1265   if (typeof actionCreators === 'function') {
  1372     return bindActionCreator(actionCreators, dispatch);
  1266     return bindActionCreator(actionCreators, dispatch);
  1373   }
  1267   }
  1374 
  1268 
  1375   if (typeof actionCreators !== 'object' || actionCreators === null) {
  1269   if (typeof actionCreators !== 'object' || actionCreators === null) {
  1376     throw new Error("bindActionCreators expected an object or a function, instead received " + (actionCreators === null ? 'null' : typeof actionCreators) + ". " + "Did you write \"import ActionCreators from\" instead of \"import * as ActionCreators from\"?");
  1270     throw new Error( true ? formatProdErrorMessage(16) : undefined);
  1377   }
  1271   }
  1378 
  1272 
  1379   var boundActionCreators = {};
  1273   var boundActionCreators = {};
  1380 
  1274 
  1381   for (var key in actionCreators) {
  1275   for (var key in actionCreators) {
  1385       boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);
  1279       boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);
  1386     }
  1280     }
  1387   }
  1281   }
  1388 
  1282 
  1389   return boundActionCreators;
  1283   return boundActionCreators;
  1390 }
       
  1391 
       
  1392 function _defineProperty(obj, key, value) {
       
  1393   if (key in obj) {
       
  1394     Object.defineProperty(obj, key, {
       
  1395       value: value,
       
  1396       enumerable: true,
       
  1397       configurable: true,
       
  1398       writable: true
       
  1399     });
       
  1400   } else {
       
  1401     obj[key] = value;
       
  1402   }
       
  1403 
       
  1404   return obj;
       
  1405 }
       
  1406 
       
  1407 function ownKeys(object, enumerableOnly) {
       
  1408   var keys = Object.keys(object);
       
  1409 
       
  1410   if (Object.getOwnPropertySymbols) {
       
  1411     keys.push.apply(keys, Object.getOwnPropertySymbols(object));
       
  1412   }
       
  1413 
       
  1414   if (enumerableOnly) keys = keys.filter(function (sym) {
       
  1415     return Object.getOwnPropertyDescriptor(object, sym).enumerable;
       
  1416   });
       
  1417   return keys;
       
  1418 }
       
  1419 
       
  1420 function _objectSpread2(target) {
       
  1421   for (var i = 1; i < arguments.length; i++) {
       
  1422     var source = arguments[i] != null ? arguments[i] : {};
       
  1423 
       
  1424     if (i % 2) {
       
  1425       ownKeys(source, true).forEach(function (key) {
       
  1426         _defineProperty(target, key, source[key]);
       
  1427       });
       
  1428     } else if (Object.getOwnPropertyDescriptors) {
       
  1429       Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
       
  1430     } else {
       
  1431       ownKeys(source).forEach(function (key) {
       
  1432         Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
       
  1433       });
       
  1434     }
       
  1435   }
       
  1436 
       
  1437   return target;
       
  1438 }
  1284 }
  1439 
  1285 
  1440 /**
  1286 /**
  1441  * Composes single-argument functions from right to left. The rightmost
  1287  * Composes single-argument functions from right to left. The rightmost
  1442  * function can take multiple arguments as it provides the signature for
  1288  * function can take multiple arguments as it provides the signature for
  1494   return function (createStore) {
  1340   return function (createStore) {
  1495     return function () {
  1341     return function () {
  1496       var store = createStore.apply(void 0, arguments);
  1342       var store = createStore.apply(void 0, arguments);
  1497 
  1343 
  1498       var _dispatch = function dispatch() {
  1344       var _dispatch = function dispatch() {
  1499         throw new Error('Dispatching while constructing your middleware is not allowed. ' + 'Other middleware would not be applied to this dispatch.');
  1345         throw new Error( true ? formatProdErrorMessage(15) : undefined);
  1500       };
  1346       };
  1501 
  1347 
  1502       var middlewareAPI = {
  1348       var middlewareAPI = {
  1503         getState: store.getState,
  1349         getState: store.getState,
  1504         dispatch: function dispatch() {
  1350         dispatch: function dispatch() {
  1507       };
  1353       };
  1508       var chain = middlewares.map(function (middleware) {
  1354       var chain = middlewares.map(function (middleware) {
  1509         return middleware(middlewareAPI);
  1355         return middleware(middlewareAPI);
  1510       });
  1356       });
  1511       _dispatch = compose.apply(void 0, chain)(store.dispatch);
  1357       _dispatch = compose.apply(void 0, chain)(store.dispatch);
  1512       return _objectSpread2({}, store, {
  1358       return _objectSpread2(_objectSpread2({}, store), {}, {
  1513         dispatch: _dispatch
  1359         dispatch: _dispatch
  1514       });
  1360       });
  1515     };
  1361     };
  1516   };
  1362   };
  1517 }
  1363 }
  1525 
  1371 
  1526 if (false) {}
  1372 if (false) {}
  1527 
  1373 
  1528 
  1374 
  1529 
  1375 
  1530 // EXTERNAL MODULE: external {"this":["wp","reduxRoutine"]}
  1376 // EXTERNAL MODULE: ./node_modules/equivalent-key-map/equivalent-key-map.js
  1531 var external_this_wp_reduxRoutine_ = __webpack_require__(274);
  1377 var equivalent_key_map = __webpack_require__("FtRg");
  1532 var external_this_wp_reduxRoutine_default = /*#__PURE__*/__webpack_require__.n(external_this_wp_reduxRoutine_);
  1378 var equivalent_key_map_default = /*#__PURE__*/__webpack_require__.n(equivalent_key_map);
       
  1379 
       
  1380 // EXTERNAL MODULE: external ["wp","reduxRoutine"]
       
  1381 var external_wp_reduxRoutine_ = __webpack_require__("XIDh");
       
  1382 var external_wp_reduxRoutine_default = /*#__PURE__*/__webpack_require__.n(external_wp_reduxRoutine_);
       
  1383 
       
  1384 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/factory.js
       
  1385 /**
       
  1386  * Creates a selector function that takes additional curried argument with the
       
  1387  * registry `select` function. While a regular selector has signature
       
  1388  * ```js
       
  1389  * ( state, ...selectorArgs ) => ( result )
       
  1390  * ```
       
  1391  * that allows to select data from the store's `state`, a registry selector
       
  1392  * has signature:
       
  1393  * ```js
       
  1394  * ( select ) => ( state, ...selectorArgs ) => ( result )
       
  1395  * ```
       
  1396  * that supports also selecting from other registered stores.
       
  1397  *
       
  1398  * @example
       
  1399  * ```js
       
  1400  * const getCurrentPostId = createRegistrySelector( ( select ) => ( state ) => {
       
  1401  *   return select( 'core/editor' ).getCurrentPostId();
       
  1402  * } );
       
  1403  *
       
  1404  * const getPostEdits = createRegistrySelector( ( select ) => ( state ) => {
       
  1405  *   // calling another registry selector just like any other function
       
  1406  *   const postType = getCurrentPostType( state );
       
  1407  *   const postId = getCurrentPostId( state );
       
  1408  *	 return select( 'core' ).getEntityRecordEdits( 'postType', postType, postId );
       
  1409  * } );
       
  1410  * ```
       
  1411  *
       
  1412  * Note how the `getCurrentPostId` selector can be called just like any other function,
       
  1413  * (it works even inside a regular non-registry selector) and we don't need to pass the
       
  1414  * registry as argument. The registry binding happens automatically when registering the selector
       
  1415  * with a store.
       
  1416  *
       
  1417  * @param {Function} registrySelector Function receiving a registry `select`
       
  1418  * function and returning a state selector.
       
  1419  *
       
  1420  * @return {Function} Registry selector that can be registered with a store.
       
  1421  */
       
  1422 function createRegistrySelector(registrySelector) {
       
  1423   // create a selector function that is bound to the registry referenced by `selector.registry`
       
  1424   // and that has the same API as a regular selector. Binding it in such a way makes it
       
  1425   // possible to call the selector directly from another selector.
       
  1426   const selector = (...args) => registrySelector(selector.registry.select)(...args);
       
  1427   /**
       
  1428    * Flag indicating that the selector is a registry selector that needs the correct registry
       
  1429    * reference to be assigned to `selecto.registry` to make it work correctly.
       
  1430    * be mapped as a registry selector.
       
  1431    *
       
  1432    * @type {boolean}
       
  1433    */
       
  1434 
       
  1435 
       
  1436   selector.isRegistrySelector = true;
       
  1437   return selector;
       
  1438 }
       
  1439 /**
       
  1440  * Creates a control function that takes additional curried argument with the `registry` object.
       
  1441  * While a regular control has signature
       
  1442  * ```js
       
  1443  * ( action ) => ( iteratorOrPromise )
       
  1444  * ```
       
  1445  * where the control works with the `action` that it's bound to, a registry control has signature:
       
  1446  * ```js
       
  1447  * ( registry ) => ( action ) => ( iteratorOrPromise )
       
  1448  * ```
       
  1449  * A registry control is typically used to select data or dispatch an action to a registered
       
  1450  * store.
       
  1451  *
       
  1452  * When registering a control created with `createRegistryControl` with a store, the store
       
  1453  * knows which calling convention to use when executing the control.
       
  1454  *
       
  1455  * @param {Function} registryControl Function receiving a registry object and returning a control.
       
  1456  *
       
  1457  * @return {Function} Registry control that can be registered with a store.
       
  1458  */
       
  1459 
       
  1460 function createRegistryControl(registryControl) {
       
  1461   registryControl.isRegistryControl = true;
       
  1462   return registryControl;
       
  1463 }
       
  1464 
       
  1465 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/controls.js
       
  1466 /**
       
  1467  * Internal dependencies
       
  1468  */
       
  1469 
       
  1470 const SELECT = '@@data/SELECT';
       
  1471 const RESOLVE_SELECT = '@@data/RESOLVE_SELECT';
       
  1472 const DISPATCH = '@@data/DISPATCH';
       
  1473 /**
       
  1474  * Dispatches a control action for triggering a synchronous registry select.
       
  1475  *
       
  1476  * Note: This control synchronously returns the current selector value, triggering the
       
  1477  * resolution, but not waiting for it.
       
  1478  *
       
  1479  * @param {string} storeKey     The key for the store the selector belongs to.
       
  1480  * @param {string} selectorName The name of the selector.
       
  1481  * @param {Array}  args         Arguments for the selector.
       
  1482  *
       
  1483  * @example
       
  1484  * ```js
       
  1485  * import { controls } from '@wordpress/data';
       
  1486  *
       
  1487  * // Action generator using `select`.
       
  1488  * export function* myAction() {
       
  1489  *   const isEditorSideBarOpened = yield controls.select( 'core/edit-post', 'isEditorSideBarOpened' );
       
  1490  *   // Do stuff with the result from the `select`.
       
  1491  * }
       
  1492  * ```
       
  1493  *
       
  1494  * @return {Object} The control descriptor.
       
  1495  */
       
  1496 
       
  1497 function controls_select(storeKey, selectorName, ...args) {
       
  1498   return {
       
  1499     type: SELECT,
       
  1500     storeKey,
       
  1501     selectorName,
       
  1502     args
       
  1503   };
       
  1504 }
       
  1505 /**
       
  1506  * Dispatches a control action for triggering and resolving a registry select.
       
  1507  *
       
  1508  * Note: when this control action is handled, it automatically considers
       
  1509  * selectors that may have a resolver. In such case, it will return a `Promise` that resolves
       
  1510  * after the selector finishes resolving, with the final result value.
       
  1511  *
       
  1512  * @param {string} storeKey      The key for the store the selector belongs to
       
  1513  * @param {string} selectorName  The name of the selector
       
  1514  * @param {Array}  args          Arguments for the selector.
       
  1515  *
       
  1516  * @example
       
  1517  * ```js
       
  1518  * import { controls } from '@wordpress/data';
       
  1519  *
       
  1520  * // Action generator using resolveSelect
       
  1521  * export function* myAction() {
       
  1522  * 	const isSidebarOpened = yield controls.resolveSelect( 'core/edit-post', 'isEditorSideBarOpened' );
       
  1523  * 	// do stuff with the result from the select.
       
  1524  * }
       
  1525  * ```
       
  1526  *
       
  1527  * @return {Object} The control descriptor.
       
  1528  */
       
  1529 
       
  1530 
       
  1531 function controls_resolveSelect(storeKey, selectorName, ...args) {
       
  1532   return {
       
  1533     type: RESOLVE_SELECT,
       
  1534     storeKey,
       
  1535     selectorName,
       
  1536     args
       
  1537   };
       
  1538 }
       
  1539 /**
       
  1540  * Dispatches a control action for triggering a registry dispatch.
       
  1541  *
       
  1542  * @param {string} storeKey    The key for the store the action belongs to
       
  1543  * @param {string} actionName  The name of the action to dispatch
       
  1544  * @param {Array}  args        Arguments for the dispatch action.
       
  1545  *
       
  1546  * @example
       
  1547  * ```js
       
  1548  * import { controls } from '@wordpress/data-controls';
       
  1549  *
       
  1550  * // Action generator using dispatch
       
  1551  * export function* myAction() {
       
  1552  *   yield controls.dispatch( 'core/edit-post', 'togglePublishSidebar' );
       
  1553  *   // do some other things.
       
  1554  * }
       
  1555  * ```
       
  1556  *
       
  1557  * @return {Object}  The control descriptor.
       
  1558  */
       
  1559 
       
  1560 
       
  1561 function controls_dispatch(storeKey, actionName, ...args) {
       
  1562   return {
       
  1563     type: DISPATCH,
       
  1564     storeKey,
       
  1565     actionName,
       
  1566     args
       
  1567   };
       
  1568 }
       
  1569 
       
  1570 const controls_controls = {
       
  1571   select: controls_select,
       
  1572   resolveSelect: controls_resolveSelect,
       
  1573   dispatch: controls_dispatch
       
  1574 };
       
  1575 const builtinControls = {
       
  1576   [SELECT]: createRegistryControl(registry => ({
       
  1577     storeKey,
       
  1578     selectorName,
       
  1579     args
       
  1580   }) => registry.select(storeKey)[selectorName](...args)),
       
  1581   [RESOLVE_SELECT]: createRegistryControl(registry => ({
       
  1582     storeKey,
       
  1583     selectorName,
       
  1584     args
       
  1585   }) => {
       
  1586     const method = registry.select(storeKey)[selectorName].hasResolver ? 'resolveSelect' : 'select';
       
  1587     return registry[method](storeKey)[selectorName](...args);
       
  1588   }),
       
  1589   [DISPATCH]: createRegistryControl(registry => ({
       
  1590     storeKey,
       
  1591     actionName,
       
  1592     args
       
  1593   }) => registry.dispatch(storeKey)[actionName](...args))
       
  1594 };
  1533 
  1595 
  1534 // EXTERNAL MODULE: ./node_modules/is-promise/index.js
  1596 // EXTERNAL MODULE: ./node_modules/is-promise/index.js
  1535 var is_promise = __webpack_require__(151);
  1597 var is_promise = __webpack_require__("JlUD");
  1536 var is_promise_default = /*#__PURE__*/__webpack_require__.n(is_promise);
  1598 var is_promise_default = /*#__PURE__*/__webpack_require__.n(is_promise);
  1537 
  1599 
  1538 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/promise-middleware.js
  1600 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/promise-middleware.js
  1539 /**
  1601 /**
  1540  * External dependencies
  1602  * External dependencies
  1544  * Simplest possible promise redux middleware.
  1606  * Simplest possible promise redux middleware.
  1545  *
  1607  *
  1546  * @return {Function} middleware.
  1608  * @return {Function} middleware.
  1547  */
  1609  */
  1548 
  1610 
  1549 var promise_middleware_promiseMiddleware = function promiseMiddleware() {
  1611 const promiseMiddleware = () => next => action => {
  1550   return function (next) {
  1612   if (is_promise_default()(action)) {
  1551     return function (action) {
  1613     return action.then(resolvedAction => {
  1552       if (is_promise_default()(action)) {
  1614       if (resolvedAction) {
  1553         return action.then(function (resolvedAction) {
  1615         return next(resolvedAction);
  1554           if (resolvedAction) {
       
  1555             return next(resolvedAction);
       
  1556           }
       
  1557         });
       
  1558       }
  1616       }
  1559 
  1617     });
  1560       return next(action);
  1618   }
  1561     };
  1619 
  1562   };
  1620   return next(action);
  1563 };
  1621 };
  1564 
  1622 
  1565 /* harmony default export */ var promise_middleware = (promise_middleware_promiseMiddleware);
  1623 /* harmony default export */ var promise_middleware = (promiseMiddleware);
  1566 
       
  1567 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
       
  1568 var toConsumableArray = __webpack_require__(18);
       
  1569 
  1624 
  1570 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/resolvers-cache-middleware.js
  1625 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/resolvers-cache-middleware.js
  1571 
       
  1572 
       
  1573 
       
  1574 /**
  1626 /**
  1575  * External dependencies
  1627  * External dependencies
  1576  */
  1628  */
  1577 
  1629 
  1578 /** @typedef {import('./registry').WPDataRegistry} WPDataRegistry */
  1630 /** @typedef {import('./registry').WPDataRegistry} WPDataRegistry */
  1586  *                                    middleware.
  1638  *                                    middleware.
  1587  *
  1639  *
  1588  * @return {Function} Middleware function.
  1640  * @return {Function} Middleware function.
  1589  */
  1641  */
  1590 
  1642 
  1591 var resolvers_cache_middleware_createResolversCacheMiddleware = function createResolversCacheMiddleware(registry, reducerKey) {
  1643 const createResolversCacheMiddleware = (registry, reducerKey) => () => next => action => {
  1592   return function () {
  1644   const resolvers = registry.select('core/data').getCachedResolvers(reducerKey);
  1593     return function (next) {
  1645   Object.entries(resolvers).forEach(([selectorName, resolversByArgs]) => {
  1594       return function (action) {
  1646     const resolver = Object(external_lodash_["get"])(registry.stores, [reducerKey, 'resolvers', selectorName]);
  1595         var resolvers = registry.select('core/data').getCachedResolvers(reducerKey);
  1647 
  1596         Object.entries(resolvers).forEach(function (_ref) {
  1648     if (!resolver || !resolver.shouldInvalidate) {
  1597           var _ref2 = Object(slicedToArray["a" /* default */])(_ref, 2),
  1649       return;
  1598               selectorName = _ref2[0],
  1650     }
  1599               resolversByArgs = _ref2[1];
  1651 
  1600 
  1652     resolversByArgs.forEach((value, args) => {
  1601           var resolver = Object(external_this_lodash_["get"])(registry.stores, [reducerKey, 'resolvers', selectorName]);
  1653       // resolversByArgs is the map Map([ args ] => boolean) storing the cache resolution status for a given selector.
  1602 
  1654       // If the value is false it means this resolver has finished its resolution which means we need to invalidate it,
  1603           if (!resolver || !resolver.shouldInvalidate) {
  1655       // if it's true it means it's inflight and the invalidation is not necessary.
  1604             return;
  1656       if (value !== false || !resolver.shouldInvalidate(action, ...args)) {
  1605           }
  1657         return;
  1606 
  1658       } // Trigger cache invalidation
  1607           resolversByArgs.forEach(function (value, args) {
  1659 
  1608             // resolversByArgs is the map Map([ args ] => boolean) storing the cache resolution status for a given selector.
  1660 
  1609             // If the value is false it means this resolver has finished its resolution which means we need to invalidate it,
  1661       registry.dispatch('core/data').invalidateResolution(reducerKey, selectorName, args);
  1610             // if it's true it means it's inflight and the invalidation is not necessary.
  1662     });
  1611             if (value !== false || !resolver.shouldInvalidate.apply(resolver, [action].concat(Object(toConsumableArray["a" /* default */])(args)))) {
  1663   });
  1612               return;
  1664   return next(action);
  1613             } // Trigger cache invalidation
  1665 };
  1614 
  1666 
  1615 
  1667 /* harmony default export */ var resolvers_cache_middleware = (createResolversCacheMiddleware);
  1616             registry.dispatch('core/data').invalidateResolution(reducerKey, selectorName, args);
  1668 
  1617           });
  1669 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/redux-store/thunk-middleware.js
  1618         });
  1670 function createThunkMiddleware(args) {
  1619         return next(action);
  1671   return () => next => action => {
  1620       };
  1672     if (typeof action === 'function') {
  1621     };
  1673       return action(args);
       
  1674     }
       
  1675 
       
  1676     return next(action);
       
  1677   };
       
  1678 }
       
  1679 
       
  1680 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/redux-store/metadata/utils.js
       
  1681 /**
       
  1682  * Higher-order reducer creator which creates a combined reducer object, keyed
       
  1683  * by a property on the action object.
       
  1684  *
       
  1685  * @param {string} actionProperty Action property by which to key object.
       
  1686  *
       
  1687  * @return {Function} Higher-order reducer.
       
  1688  */
       
  1689 const onSubKey = actionProperty => reducer => (state = {}, action) => {
       
  1690   // Retrieve subkey from action. Do not track if undefined; useful for cases
       
  1691   // where reducer is scoped by action shape.
       
  1692   const key = action[actionProperty];
       
  1693 
       
  1694   if (key === undefined) {
       
  1695     return state;
       
  1696   } // Avoid updating state if unchanged. Note that this also accounts for a
       
  1697   // reducer which returns undefined on a key which is not yet tracked.
       
  1698 
       
  1699 
       
  1700   const nextKeyState = reducer(state[key], action);
       
  1701 
       
  1702   if (nextKeyState === state[key]) {
       
  1703     return state;
       
  1704   }
       
  1705 
       
  1706   return { ...state,
       
  1707     [key]: nextKeyState
  1622   };
  1708   };
  1623 };
  1709 };
  1624 
  1710 
  1625 /* harmony default export */ var resolvers_cache_middleware = (resolvers_cache_middleware_createResolversCacheMiddleware);
  1711 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/redux-store/metadata/reducer.js
  1626 
       
  1627 // EXTERNAL MODULE: ./node_modules/equivalent-key-map/equivalent-key-map.js
       
  1628 var equivalent_key_map = __webpack_require__(126);
       
  1629 var equivalent_key_map_default = /*#__PURE__*/__webpack_require__.n(equivalent_key_map);
       
  1630 
       
  1631 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/namespace-store/metadata/utils.js
       
  1632 
       
  1633 
       
  1634 function utils_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
       
  1635 
       
  1636 function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { utils_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { utils_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
       
  1637 
       
  1638 /**
       
  1639  * Higher-order reducer creator which creates a combined reducer object, keyed
       
  1640  * by a property on the action object.
       
  1641  *
       
  1642  * @param {string} actionProperty Action property by which to key object.
       
  1643  *
       
  1644  * @return {Function} Higher-order reducer.
       
  1645  */
       
  1646 var utils_onSubKey = function onSubKey(actionProperty) {
       
  1647   return function (reducer) {
       
  1648     return function () {
       
  1649       var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
       
  1650       var action = arguments.length > 1 ? arguments[1] : undefined;
       
  1651       // Retrieve subkey from action. Do not track if undefined; useful for cases
       
  1652       // where reducer is scoped by action shape.
       
  1653       var key = action[actionProperty];
       
  1654 
       
  1655       if (key === undefined) {
       
  1656         return state;
       
  1657       } // Avoid updating state if unchanged. Note that this also accounts for a
       
  1658       // reducer which returns undefined on a key which is not yet tracked.
       
  1659 
       
  1660 
       
  1661       var nextKeyState = reducer(state[key], action);
       
  1662 
       
  1663       if (nextKeyState === state[key]) {
       
  1664         return state;
       
  1665       }
       
  1666 
       
  1667       return _objectSpread({}, state, Object(defineProperty["a" /* default */])({}, key, nextKeyState));
       
  1668     };
       
  1669   };
       
  1670 };
       
  1671 
       
  1672 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/namespace-store/metadata/reducer.js
       
  1673 /**
  1712 /**
  1674  * External dependencies
  1713  * External dependencies
  1675  */
  1714  */
  1676 
  1715 
  1677 
  1716 
  1690  * @param {Object} action Dispatched action.
  1729  * @param {Object} action Dispatched action.
  1691  *
  1730  *
  1692  * @return {Object} Next state.
  1731  * @return {Object} Next state.
  1693  */
  1732  */
  1694 
  1733 
  1695 var subKeysIsResolved = Object(external_this_lodash_["flowRight"])([utils_onSubKey('selectorName')])(function () {
  1734 const subKeysIsResolved = onSubKey('selectorName')((state = new equivalent_key_map_default.a(), action) => {
  1696   var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new equivalent_key_map_default.a();
       
  1697   var action = arguments.length > 1 ? arguments[1] : undefined;
       
  1698 
       
  1699   switch (action.type) {
  1735   switch (action.type) {
  1700     case 'START_RESOLUTION':
  1736     case 'START_RESOLUTION':
  1701     case 'FINISH_RESOLUTION':
  1737     case 'FINISH_RESOLUTION':
  1702       {
  1738       {
  1703         var isStarting = action.type === 'START_RESOLUTION';
  1739         const isStarting = action.type === 'START_RESOLUTION';
  1704         var nextState = new equivalent_key_map_default.a(state);
  1740         const nextState = new equivalent_key_map_default.a(state);
  1705         nextState.set(action.args, isStarting);
  1741         nextState.set(action.args, isStarting);
  1706         return nextState;
  1742         return nextState;
  1707       }
  1743       }
  1708 
  1744 
       
  1745     case 'START_RESOLUTIONS':
       
  1746     case 'FINISH_RESOLUTIONS':
       
  1747       {
       
  1748         const isStarting = action.type === 'START_RESOLUTIONS';
       
  1749         const nextState = new equivalent_key_map_default.a(state);
       
  1750 
       
  1751         for (const resolutionArgs of action.args) {
       
  1752           nextState.set(resolutionArgs, isStarting);
       
  1753         }
       
  1754 
       
  1755         return nextState;
       
  1756       }
       
  1757 
  1709     case 'INVALIDATE_RESOLUTION':
  1758     case 'INVALIDATE_RESOLUTION':
  1710       {
  1759       {
  1711         var _nextState = new equivalent_key_map_default.a(state);
  1760         const nextState = new equivalent_key_map_default.a(state);
  1712 
  1761         nextState.delete(action.args);
  1713         _nextState.delete(action.args);
  1762         return nextState;
  1714 
       
  1715         return _nextState;
       
  1716       }
  1763       }
  1717   }
  1764   }
  1718 
  1765 
  1719   return state;
  1766   return state;
  1720 });
  1767 });
  1727  * @param {Object} action  Dispatched action.
  1774  * @param {Object} action  Dispatched action.
  1728  *
  1775  *
  1729  * @return {Object} Next state.
  1776  * @return {Object} Next state.
  1730  */
  1777  */
  1731 
  1778 
  1732 var reducer_isResolved = function isResolved() {
  1779 const isResolved = (state = {}, action) => {
  1733   var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
       
  1734   var action = arguments.length > 1 ? arguments[1] : undefined;
       
  1735 
       
  1736   switch (action.type) {
  1780   switch (action.type) {
  1737     case 'INVALIDATE_RESOLUTION_FOR_STORE':
  1781     case 'INVALIDATE_RESOLUTION_FOR_STORE':
  1738       return {};
  1782       return {};
  1739 
  1783 
  1740     case 'INVALIDATE_RESOLUTION_FOR_STORE_SELECTOR':
  1784     case 'INVALIDATE_RESOLUTION_FOR_STORE_SELECTOR':
  1741       return Object(external_this_lodash_["has"])(state, [action.selectorName]) ? Object(external_this_lodash_["omit"])(state, [action.selectorName]) : state;
  1785       return Object(external_lodash_["has"])(state, [action.selectorName]) ? Object(external_lodash_["omit"])(state, [action.selectorName]) : state;
  1742 
  1786 
  1743     case 'START_RESOLUTION':
  1787     case 'START_RESOLUTION':
  1744     case 'FINISH_RESOLUTION':
  1788     case 'FINISH_RESOLUTION':
       
  1789     case 'START_RESOLUTIONS':
       
  1790     case 'FINISH_RESOLUTIONS':
  1745     case 'INVALIDATE_RESOLUTION':
  1791     case 'INVALIDATE_RESOLUTION':
  1746       return subKeysIsResolved(state, action);
  1792       return subKeysIsResolved(state, action);
  1747   }
  1793   }
  1748 
  1794 
  1749   return state;
  1795   return state;
  1750 };
  1796 };
  1751 
  1797 
  1752 /* harmony default export */ var metadata_reducer = (reducer_isResolved);
  1798 /* harmony default export */ var metadata_reducer = (isResolved);
  1753 
  1799 
  1754 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/namespace-store/metadata/selectors.js
  1800 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/redux-store/metadata/selectors.js
  1755 /**
  1801 /**
  1756  * External dependencies
  1802  * External dependencies
  1757  */
  1803  */
  1758 
  1804 
  1759 /**
  1805 /**
  1768  *
  1814  *
  1769  * @return {?boolean} isResolving value.
  1815  * @return {?boolean} isResolving value.
  1770  */
  1816  */
  1771 
  1817 
  1772 function getIsResolving(state, selectorName, args) {
  1818 function getIsResolving(state, selectorName, args) {
  1773   var map = Object(external_this_lodash_["get"])(state, [selectorName]);
  1819   const map = Object(external_lodash_["get"])(state, [selectorName]);
  1774 
  1820 
  1775   if (!map) {
  1821   if (!map) {
  1776     return;
  1822     return;
  1777   }
  1823   }
  1778 
  1824 
  1787  * @param {?Array} args         Arguments passed to selector (default `[]`).
  1833  * @param {?Array} args         Arguments passed to selector (default `[]`).
  1788  *
  1834  *
  1789  * @return {boolean} Whether resolution has been triggered.
  1835  * @return {boolean} Whether resolution has been triggered.
  1790  */
  1836  */
  1791 
  1837 
  1792 function hasStartedResolution(state, selectorName) {
  1838 function hasStartedResolution(state, selectorName, args = []) {
  1793   var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
       
  1794   return getIsResolving(state, selectorName, args) !== undefined;
  1839   return getIsResolving(state, selectorName, args) !== undefined;
  1795 }
  1840 }
  1796 /**
  1841 /**
  1797  * Returns true if resolution has completed for a given selector
  1842  * Returns true if resolution has completed for a given selector
  1798  * name, and arguments set.
  1843  * name, and arguments set.
  1802  * @param {?Array} args         Arguments passed to selector.
  1847  * @param {?Array} args         Arguments passed to selector.
  1803  *
  1848  *
  1804  * @return {boolean} Whether resolution has completed.
  1849  * @return {boolean} Whether resolution has completed.
  1805  */
  1850  */
  1806 
  1851 
  1807 function hasFinishedResolution(state, selectorName) {
  1852 function hasFinishedResolution(state, selectorName, args = []) {
  1808   var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
       
  1809   return getIsResolving(state, selectorName, args) === false;
  1853   return getIsResolving(state, selectorName, args) === false;
  1810 }
  1854 }
  1811 /**
  1855 /**
  1812  * Returns true if resolution has been triggered but has not yet completed for
  1856  * Returns true if resolution has been triggered but has not yet completed for
  1813  * a given selector name, and arguments set.
  1857  * a given selector name, and arguments set.
  1817  * @param {?Array} args         Arguments passed to selector.
  1861  * @param {?Array} args         Arguments passed to selector.
  1818  *
  1862  *
  1819  * @return {boolean} Whether resolution is in progress.
  1863  * @return {boolean} Whether resolution is in progress.
  1820  */
  1864  */
  1821 
  1865 
  1822 function isResolving(state, selectorName) {
  1866 function isResolving(state, selectorName, args = []) {
  1823   var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
       
  1824   return getIsResolving(state, selectorName, args) === true;
  1867   return getIsResolving(state, selectorName, args) === true;
  1825 }
  1868 }
  1826 /**
  1869 /**
  1827  * Returns the list of the cached resolvers.
  1870  * Returns the list of the cached resolvers.
  1828  *
  1871  *
  1833 
  1876 
  1834 function getCachedResolvers(state) {
  1877 function getCachedResolvers(state) {
  1835   return state;
  1878   return state;
  1836 }
  1879 }
  1837 
  1880 
  1838 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/namespace-store/metadata/actions.js
  1881 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/redux-store/metadata/actions.js
  1839 /**
  1882 /**
  1840  * Returns an action object used in signalling that selector resolution has
  1883  * Returns an action object used in signalling that selector resolution has
  1841  * started.
  1884  * started.
  1842  *
  1885  *
  1843  * @param {string} selectorName Name of selector for which resolver triggered.
  1886  * @param {string} selectorName Name of selector for which resolver triggered.
  1846  * @return {Object} Action object.
  1889  * @return {Object} Action object.
  1847  */
  1890  */
  1848 function startResolution(selectorName, args) {
  1891 function startResolution(selectorName, args) {
  1849   return {
  1892   return {
  1850     type: 'START_RESOLUTION',
  1893     type: 'START_RESOLUTION',
  1851     selectorName: selectorName,
  1894     selectorName,
  1852     args: args
  1895     args
  1853   };
  1896   };
  1854 }
  1897 }
  1855 /**
  1898 /**
  1856  * Returns an action object used in signalling that selector resolution has
  1899  * Returns an action object used in signalling that selector resolution has
  1857  * completed.
  1900  * completed.
  1863  */
  1906  */
  1864 
  1907 
  1865 function finishResolution(selectorName, args) {
  1908 function finishResolution(selectorName, args) {
  1866   return {
  1909   return {
  1867     type: 'FINISH_RESOLUTION',
  1910     type: 'FINISH_RESOLUTION',
  1868     selectorName: selectorName,
  1911     selectorName,
  1869     args: args
  1912     args
       
  1913   };
       
  1914 }
       
  1915 /**
       
  1916  * Returns an action object used in signalling that a batch of selector resolutions has
       
  1917  * started.
       
  1918  *
       
  1919  * @param {string} selectorName Name of selector for which resolver triggered.
       
  1920  * @param {...*}   args         Array of arguments to associate for uniqueness, each item
       
  1921  * 								is associated to a resolution.
       
  1922  *
       
  1923  * @return {Object} Action object.
       
  1924  */
       
  1925 
       
  1926 function startResolutions(selectorName, args) {
       
  1927   return {
       
  1928     type: 'START_RESOLUTIONS',
       
  1929     selectorName,
       
  1930     args
       
  1931   };
       
  1932 }
       
  1933 /**
       
  1934  * Returns an action object used in signalling that a batch of selector resolutions has
       
  1935  * completed.
       
  1936  *
       
  1937  * @param {string} selectorName Name of selector for which resolver triggered.
       
  1938  * @param {...*}   args         Array of arguments to associate for uniqueness, each item
       
  1939  * 								is associated to a resolution.
       
  1940  *
       
  1941  * @return {Object} Action object.
       
  1942  */
       
  1943 
       
  1944 function finishResolutions(selectorName, args) {
       
  1945   return {
       
  1946     type: 'FINISH_RESOLUTIONS',
       
  1947     selectorName,
       
  1948     args
  1870   };
  1949   };
  1871 }
  1950 }
  1872 /**
  1951 /**
  1873  * Returns an action object used in signalling that we should invalidate the resolution cache.
  1952  * Returns an action object used in signalling that we should invalidate the resolution cache.
  1874  *
  1953  *
  1879  */
  1958  */
  1880 
  1959 
  1881 function invalidateResolution(selectorName, args) {
  1960 function invalidateResolution(selectorName, args) {
  1882   return {
  1961   return {
  1883     type: 'INVALIDATE_RESOLUTION',
  1962     type: 'INVALIDATE_RESOLUTION',
  1884     selectorName: selectorName,
  1963     selectorName,
  1885     args: args
  1964     args
  1886   };
  1965   };
  1887 }
  1966 }
  1888 /**
  1967 /**
  1889  * Returns an action object used in signalling that the resolution
  1968  * Returns an action object used in signalling that the resolution
  1890  * should be invalidated.
  1969  * should be invalidated.
  1908  */
  1987  */
  1909 
  1988 
  1910 function invalidateResolutionForStoreSelector(selectorName) {
  1989 function invalidateResolutionForStoreSelector(selectorName) {
  1911   return {
  1990   return {
  1912     type: 'INVALIDATE_RESOLUTION_FOR_STORE_SELECTOR',
  1991     type: 'INVALIDATE_RESOLUTION_FOR_STORE_SELECTOR',
  1913     selectorName: selectorName
  1992     selectorName
  1914   };
  1993   };
  1915 }
  1994 }
  1916 
  1995 
  1917 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/namespace-store/index.js
  1996 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/redux-store/index.js
  1918 
       
  1919 
       
  1920 
       
  1921 
       
  1922 function namespace_store_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
       
  1923 
       
  1924 function namespace_store_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { namespace_store_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { namespace_store_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
       
  1925 
       
  1926 /**
  1997 /**
  1927  * External dependencies
  1998  * External dependencies
  1928  */
  1999  */
  1929 
  2000 
  1930 
  2001 
  1931 
  2002 
       
  2003 
  1932 /**
  2004 /**
  1933  * WordPress dependencies
  2005  * WordPress dependencies
  1934  */
  2006  */
  1935 
  2007 
  1936 
  2008 
  1941 
  2013 
  1942 
  2014 
  1943 
  2015 
  1944 
  2016 
  1945 
  2017 
  1946 /**
  2018 
  1947  * @typedef {WPDataRegistry} WPDataRegistry
  2019 
  1948  */
  2020 /** @typedef {import('../types').WPDataRegistry} WPDataRegistry */
  1949 
  2021 
  1950 /**
  2022 /** @typedef {import('../types').WPDataStore} WPDataStore */
  1951  * Creates a namespace object with a store derived from the reducer given.
  2023 
       
  2024 /** @typedef {import('../types').WPDataReduxStoreConfig} WPDataReduxStoreConfig */
       
  2025 
       
  2026 /**
       
  2027  * Create a cache to track whether resolvers started running or not.
       
  2028  *
       
  2029  * @return {Object} Resolvers Cache.
       
  2030  */
       
  2031 
       
  2032 function createResolversCache() {
       
  2033   const cache = {};
       
  2034   return {
       
  2035     isRunning(selectorName, args) {
       
  2036       return cache[selectorName] && cache[selectorName].get(args);
       
  2037     },
       
  2038 
       
  2039     clear(selectorName, args) {
       
  2040       if (cache[selectorName]) {
       
  2041         cache[selectorName].delete(args);
       
  2042       }
       
  2043     },
       
  2044 
       
  2045     markAsRunning(selectorName, args) {
       
  2046       if (!cache[selectorName]) {
       
  2047         cache[selectorName] = new equivalent_key_map_default.a();
       
  2048       }
       
  2049 
       
  2050       cache[selectorName].set(args, true);
       
  2051     }
       
  2052 
       
  2053   };
       
  2054 }
       
  2055 /**
       
  2056  * Creates a data store definition for the provided Redux store options containing
       
  2057  * properties describing reducer, actions, selectors, controls and resolvers.
       
  2058  *
       
  2059  * @example
       
  2060  * ```js
       
  2061  * import { createReduxStore } from '@wordpress/data';
       
  2062  *
       
  2063  * const store = createReduxStore( 'demo', {
       
  2064  *     reducer: ( state = 'OK' ) => state,
       
  2065  *     selectors: {
       
  2066  *         getValue: ( state ) => state,
       
  2067  *     },
       
  2068  * } );
       
  2069  * ```
       
  2070  *
       
  2071  * @param {string}                 key      Unique namespace identifier.
       
  2072  * @param {WPDataReduxStoreConfig} options  Registered store options, with properties
       
  2073  *                                          describing reducer, actions, selectors,
       
  2074  *                                          and resolvers.
       
  2075  *
       
  2076  * @return {WPDataStore} Store Object.
       
  2077  */
       
  2078 
       
  2079 
       
  2080 function createReduxStore(key, options) {
       
  2081   return {
       
  2082     name: key,
       
  2083     instantiate: registry => {
       
  2084       const reducer = options.reducer;
       
  2085       const thunkArgs = {
       
  2086         registry,
       
  2087 
       
  2088         get dispatch() {
       
  2089           return Object.assign(action => store.dispatch(action), getActions());
       
  2090         },
       
  2091 
       
  2092         get select() {
       
  2093           return Object.assign(selector => selector(store.__unstableOriginalGetState()), getSelectors());
       
  2094         },
       
  2095 
       
  2096         get resolveSelect() {
       
  2097           return getResolveSelectors();
       
  2098         }
       
  2099 
       
  2100       };
       
  2101       const store = instantiateReduxStore(key, options, registry, thunkArgs);
       
  2102       const resolversCache = createResolversCache();
       
  2103       let resolvers;
       
  2104       const actions = mapActions({ ...actions_namespaceObject,
       
  2105         ...options.actions
       
  2106       }, store);
       
  2107       let selectors = mapSelectors({ ...Object(external_lodash_["mapValues"])(selectors_namespaceObject, selector => (state, ...args) => selector(state.metadata, ...args)),
       
  2108         ...Object(external_lodash_["mapValues"])(options.selectors, selector => {
       
  2109           if (selector.isRegistrySelector) {
       
  2110             selector.registry = registry;
       
  2111           }
       
  2112 
       
  2113           return (state, ...args) => selector(state.root, ...args);
       
  2114         })
       
  2115       }, store);
       
  2116 
       
  2117       if (options.resolvers) {
       
  2118         const result = mapResolvers(options.resolvers, selectors, store, resolversCache);
       
  2119         resolvers = result.resolvers;
       
  2120         selectors = result.selectors;
       
  2121       }
       
  2122 
       
  2123       const resolveSelectors = mapResolveSelectors(selectors, store);
       
  2124 
       
  2125       const getSelectors = () => selectors;
       
  2126 
       
  2127       const getActions = () => actions;
       
  2128 
       
  2129       const getResolveSelectors = () => resolveSelectors; // We have some modules monkey-patching the store object
       
  2130       // It's wrong to do so but until we refactor all of our effects to controls
       
  2131       // We need to keep the same "store" instance here.
       
  2132 
       
  2133 
       
  2134       store.__unstableOriginalGetState = store.getState;
       
  2135 
       
  2136       store.getState = () => store.__unstableOriginalGetState().root; // Customize subscribe behavior to call listeners only on effective change,
       
  2137       // not on every dispatch.
       
  2138 
       
  2139 
       
  2140       const subscribe = store && (listener => {
       
  2141         let lastState = store.__unstableOriginalGetState();
       
  2142 
       
  2143         return store.subscribe(() => {
       
  2144           const state = store.__unstableOriginalGetState();
       
  2145 
       
  2146           const hasChanged = state !== lastState;
       
  2147           lastState = state;
       
  2148 
       
  2149           if (hasChanged) {
       
  2150             listener();
       
  2151           }
       
  2152         });
       
  2153       }); // This can be simplified to just { subscribe, getSelectors, getActions }
       
  2154       // Once we remove the use function.
       
  2155 
       
  2156 
       
  2157       return {
       
  2158         reducer,
       
  2159         store,
       
  2160         actions,
       
  2161         selectors,
       
  2162         resolvers,
       
  2163         getSelectors,
       
  2164         getResolveSelectors,
       
  2165         getActions,
       
  2166         subscribe
       
  2167       };
       
  2168     }
       
  2169   };
       
  2170 }
       
  2171 /**
       
  2172  * Creates a redux store for a namespace.
  1952  *
  2173  *
  1953  * @param {string}         key      Unique namespace identifier.
  2174  * @param {string}         key      Unique namespace identifier.
  1954  * @param {Object}         options  Registered store options, with properties
  2175  * @param {Object}         options  Registered store options, with properties
  1955  *                                  describing reducer, actions, selectors, and
  2176  *                                  describing reducer, actions, selectors,
  1956  *                                  resolvers.
  2177  *                                  and resolvers.
  1957  * @param {WPDataRegistry} registry Registry reference.
  2178  * @param {WPDataRegistry} registry Registry reference.
  1958  *
  2179  * @param {Object} thunkArgs        Argument object for the thunk middleware.
  1959  * @return {Object} Store Object.
  2180  * @return {Object} Newly created redux store.
  1960  */
  2181  */
  1961 
  2182 
  1962 function createNamespace(key, options, registry) {
  2183 function instantiateReduxStore(key, options, registry, thunkArgs) {
  1963   var reducer = options.reducer;
  2184   const controls = { ...options.controls,
  1964   var store = createReduxStore(key, options, registry);
  2185     ...builtinControls
  1965   var resolvers;
       
  1966   var actions = mapActions(namespace_store_objectSpread({}, actions_namespaceObject, {}, options.actions), store);
       
  1967   var selectors = mapSelectors(namespace_store_objectSpread({}, Object(external_this_lodash_["mapValues"])(selectors_namespaceObject, function (selector) {
       
  1968     return function (state) {
       
  1969       for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
       
  1970         args[_key - 1] = arguments[_key];
       
  1971       }
       
  1972 
       
  1973       return selector.apply(void 0, [state.metadata].concat(args));
       
  1974     };
       
  1975   }), {}, Object(external_this_lodash_["mapValues"])(options.selectors, function (selector) {
       
  1976     if (selector.isRegistrySelector) {
       
  1977       selector.registry = registry;
       
  1978     }
       
  1979 
       
  1980     return function (state) {
       
  1981       for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
       
  1982         args[_key2 - 1] = arguments[_key2];
       
  1983       }
       
  1984 
       
  1985       return selector.apply(void 0, [state.root].concat(args));
       
  1986     };
       
  1987   })), store);
       
  1988 
       
  1989   if (options.resolvers) {
       
  1990     var result = mapResolvers(options.resolvers, selectors, store);
       
  1991     resolvers = result.resolvers;
       
  1992     selectors = result.selectors;
       
  1993   }
       
  1994 
       
  1995   var getSelectors = function getSelectors() {
       
  1996     return selectors;
       
  1997   };
  2186   };
  1998 
  2187   const normalizedControls = Object(external_lodash_["mapValues"])(controls, control => control.isRegistryControl ? control(registry) : control);
  1999   var getActions = function getActions() {
  2188   const middlewares = [resolvers_cache_middleware(registry, key), promise_middleware, external_wp_reduxRoutine_default()(normalizedControls)];
  2000     return actions;
  2189 
  2001   }; // We have some modules monkey-patching the store object
  2190   if (options.__experimentalUseThunks) {
  2002   // It's wrong to do so but until we refactor all of our effects to controls
  2191     middlewares.push(createThunkMiddleware(thunkArgs));
  2003   // We need to keep the same "store" instance here.
  2192   }
  2004 
  2193 
  2005 
  2194   const enhancers = [applyMiddleware(...middlewares)];
  2006   store.__unstableOriginalGetState = store.getState;
       
  2007 
       
  2008   store.getState = function () {
       
  2009     return store.__unstableOriginalGetState().root;
       
  2010   }; // Customize subscribe behavior to call listeners only on effective change,
       
  2011   // not on every dispatch.
       
  2012 
       
  2013 
       
  2014   var subscribe = store && function (listener) {
       
  2015     var lastState = store.__unstableOriginalGetState();
       
  2016 
       
  2017     store.subscribe(function () {
       
  2018       var state = store.__unstableOriginalGetState();
       
  2019 
       
  2020       var hasChanged = state !== lastState;
       
  2021       lastState = state;
       
  2022 
       
  2023       if (hasChanged) {
       
  2024         listener();
       
  2025       }
       
  2026     });
       
  2027   }; // This can be simplified to just { subscribe, getSelectors, getActions }
       
  2028   // Once we remove the use function.
       
  2029 
       
  2030 
       
  2031   return {
       
  2032     reducer: reducer,
       
  2033     store: store,
       
  2034     actions: actions,
       
  2035     selectors: selectors,
       
  2036     resolvers: resolvers,
       
  2037     getSelectors: getSelectors,
       
  2038     getActions: getActions,
       
  2039     subscribe: subscribe
       
  2040   };
       
  2041 }
       
  2042 /**
       
  2043  * Creates a redux store for a namespace.
       
  2044  *
       
  2045  * @param {string}         key      Unique namespace identifier.
       
  2046  * @param {Object}         options  Registered store options, with properties
       
  2047  *                                  describing reducer, actions, selectors, and
       
  2048  *                                  resolvers.
       
  2049  * @param {WPDataRegistry} registry Registry reference.
       
  2050  *
       
  2051  * @return {Object} Newly created redux store.
       
  2052  */
       
  2053 
       
  2054 function createReduxStore(key, options, registry) {
       
  2055   var middlewares = [resolvers_cache_middleware(registry, key), promise_middleware];
       
  2056 
       
  2057   if (options.controls) {
       
  2058     var normalizedControls = Object(external_this_lodash_["mapValues"])(options.controls, function (control) {
       
  2059       return control.isRegistryControl ? control(registry) : control;
       
  2060     });
       
  2061     middlewares.push(external_this_wp_reduxRoutine_default()(normalizedControls));
       
  2062   }
       
  2063 
       
  2064   var enhancers = [applyMiddleware.apply(void 0, middlewares)];
       
  2065 
  2195 
  2066   if (typeof window !== 'undefined' && window.__REDUX_DEVTOOLS_EXTENSION__) {
  2196   if (typeof window !== 'undefined' && window.__REDUX_DEVTOOLS_EXTENSION__) {
  2067     enhancers.push(window.__REDUX_DEVTOOLS_EXTENSION__({
  2197     enhancers.push(window.__REDUX_DEVTOOLS_EXTENSION__({
  2068       name: key,
  2198       name: key,
  2069       instanceId: key
  2199       instanceId: key
  2070     }));
  2200     }));
  2071   }
  2201   }
  2072 
  2202 
  2073   var reducer = options.reducer,
  2203   const {
  2074       initialState = options.initialState;
  2204     reducer,
  2075   var enhancedReducer = turbo_combine_reducers_default()({
  2205     initialState
       
  2206   } = options;
       
  2207   const enhancedReducer = turbo_combine_reducers_default()({
  2076     metadata: metadata_reducer,
  2208     metadata: metadata_reducer,
  2077     root: reducer
  2209     root: reducer
  2078   });
  2210   });
  2079   return createStore(enhancedReducer, {
  2211   return redux_createStore(enhancedReducer, {
  2080     root: initialState
  2212     root: initialState
  2081   }, Object(external_this_lodash_["flowRight"])(enhancers));
  2213   }, Object(external_lodash_["flowRight"])(enhancers));
  2082 }
  2214 }
  2083 /**
  2215 /**
  2084  * Maps selectors to a store.
  2216  * Maps selectors to a store.
  2085  *
  2217  *
  2086  * @param {Object} selectors Selectors to register. Keys will be used as the
  2218  * @param {Object} selectors Selectors to register. Keys will be used as the
  2087  *                           public facing API. Selectors will get passed the
  2219  *                           public facing API. Selectors will get passed the
  2088  *                           state as first argument.
  2220  *                           state as first argument.
  2089  * @param {Object} store     The store to which the selectors should be mapped.
  2221  * @param {Object} store     The store to which the selectors should be mapped.
  2090  *
       
  2091  * @return {Object} Selectors mapped to the provided store.
  2222  * @return {Object} Selectors mapped to the provided store.
  2092  */
  2223  */
  2093 
  2224 
  2094 
  2225 
  2095 function mapSelectors(selectors, store) {
  2226 function mapSelectors(selectors, store) {
  2096   var createStateSelector = function createStateSelector(registrySelector) {
  2227   const createStateSelector = registrySelector => {
  2097     var selector = function runSelector() {
  2228     const selector = function runSelector() {
  2098       // This function is an optimized implementation of:
  2229       // This function is an optimized implementation of:
  2099       //
  2230       //
  2100       //   selector( store.getState(), ...arguments )
  2231       //   selector( store.getState(), ...arguments )
  2101       //
  2232       //
  2102       // Where the above would incur an `Array#concat` in its application,
  2233       // Where the above would incur an `Array#concat` in its application,
  2103       // the logic here instead efficiently constructs an arguments array via
  2234       // the logic here instead efficiently constructs an arguments array via
  2104       // direct assignment.
  2235       // direct assignment.
  2105       var argsLength = arguments.length;
  2236       const argsLength = arguments.length;
  2106       var args = new Array(argsLength + 1);
  2237       const args = new Array(argsLength + 1);
  2107       args[0] = store.__unstableOriginalGetState();
  2238       args[0] = store.__unstableOriginalGetState();
  2108 
  2239 
  2109       for (var i = 0; i < argsLength; i++) {
  2240       for (let i = 0; i < argsLength; i++) {
  2110         args[i + 1] = arguments[i];
  2241         args[i + 1] = arguments[i];
  2111       }
  2242       }
  2112 
  2243 
  2113       return registrySelector.apply(void 0, args);
  2244       return registrySelector(...args);
  2114     };
  2245     };
  2115 
  2246 
  2116     selector.hasResolver = false;
  2247     selector.hasResolver = false;
  2117     return selector;
  2248     return selector;
  2118   };
  2249   };
  2119 
  2250 
  2120   return Object(external_this_lodash_["mapValues"])(selectors, createStateSelector);
  2251   return Object(external_lodash_["mapValues"])(selectors, createStateSelector);
  2121 }
  2252 }
  2122 /**
  2253 /**
  2123  * Maps actions to dispatch from a given store.
  2254  * Maps actions to dispatch from a given store.
  2124  *
  2255  *
  2125  * @param {Object} actions    Actions to register.
  2256  * @param {Object} actions    Actions to register.
  2127  * @return {Object}           Actions mapped to the redux store provided.
  2258  * @return {Object}           Actions mapped to the redux store provided.
  2128  */
  2259  */
  2129 
  2260 
  2130 
  2261 
  2131 function mapActions(actions, store) {
  2262 function mapActions(actions, store) {
  2132   var createBoundAction = function createBoundAction(action) {
  2263   const createBoundAction = action => (...args) => {
  2133     return function () {
  2264     return Promise.resolve(store.dispatch(action(...args)));
  2134       return Promise.resolve(store.dispatch(action.apply(void 0, arguments)));
       
  2135     };
       
  2136   };
  2265   };
  2137 
  2266 
  2138   return Object(external_this_lodash_["mapValues"])(actions, createBoundAction);
  2267   return Object(external_lodash_["mapValues"])(actions, createBoundAction);
       
  2268 }
       
  2269 /**
       
  2270  * Maps selectors to functions that return a resolution promise for them
       
  2271  *
       
  2272  * @param {Object} selectors Selectors to map.
       
  2273  * @param {Object} store     The redux store the selectors select from.
       
  2274  * @return {Object}          Selectors mapped to their resolution functions.
       
  2275  */
       
  2276 
       
  2277 
       
  2278 function mapResolveSelectors(selectors, store) {
       
  2279   return Object(external_lodash_["mapValues"])(Object(external_lodash_["omit"])(selectors, ['getIsResolving', 'hasStartedResolution', 'hasFinishedResolution', 'isResolving', 'getCachedResolvers']), (selector, selectorName) => (...args) => new Promise(resolve => {
       
  2280     const hasFinished = () => selectors.hasFinishedResolution(selectorName, args);
       
  2281 
       
  2282     const getResult = () => selector.apply(null, args); // trigger the selector (to trigger the resolver)
       
  2283 
       
  2284 
       
  2285     const result = getResult();
       
  2286 
       
  2287     if (hasFinished()) {
       
  2288       return resolve(result);
       
  2289     }
       
  2290 
       
  2291     const unsubscribe = store.subscribe(() => {
       
  2292       if (hasFinished()) {
       
  2293         unsubscribe();
       
  2294         resolve(getResult());
       
  2295       }
       
  2296     });
       
  2297   }));
  2139 }
  2298 }
  2140 /**
  2299 /**
  2141  * Returns resolvers with matched selectors for a given namespace.
  2300  * Returns resolvers with matched selectors for a given namespace.
  2142  * Resolvers are side effects invoked once per argument set of a given selector call,
  2301  * Resolvers are side effects invoked once per argument set of a given selector call,
  2143  * used in ensuring that the data needs for the selector are satisfied.
  2302  * used in ensuring that the data needs for the selector are satisfied.
  2144  *
  2303  *
  2145  * @param {Object} resolvers   Resolvers to register.
  2304  * @param {Object} resolvers      Resolvers to register.
  2146  * @param {Object} selectors   The current selectors to be modified.
  2305  * @param {Object} selectors      The current selectors to be modified.
  2147  * @param {Object} store       The redux store to which the resolvers should be mapped.
  2306  * @param {Object} store          The redux store to which the resolvers should be mapped.
  2148  * @return {Object}            An object containing updated selectors and resolvers.
  2307  * @param {Object} resolversCache Resolvers Cache.
  2149  */
  2308  */
  2150 
  2309 
  2151 
  2310 
  2152 function mapResolvers(resolvers, selectors, store) {
  2311 function mapResolvers(resolvers, selectors, store, resolversCache) {
  2153   var mappedResolvers = Object(external_this_lodash_["mapValues"])(resolvers, function (resolver) {
  2312   // The `resolver` can be either a function that does the resolution, or, in more advanced
  2154     var _resolver$fulfill = resolver.fulfill,
  2313   // cases, an object with a `fullfill` method and other optional methods like `isFulfilled`.
  2155         resolverFulfill = _resolver$fulfill === void 0 ? resolver : _resolver$fulfill;
  2314   // Here we normalize the `resolver` function to an object with `fulfill` method.
  2156     return namespace_store_objectSpread({}, resolver, {
  2315   const mappedResolvers = Object(external_lodash_["mapValues"])(resolvers, resolver => {
  2157       fulfill: resolverFulfill
  2316     if (resolver.fulfill) {
  2158     });
  2317       return resolver;
       
  2318     }
       
  2319 
       
  2320     return { ...resolver,
       
  2321       // copy the enumerable properties of the resolver function
       
  2322       fulfill: resolver // add the fulfill method
       
  2323 
       
  2324     };
  2159   });
  2325   });
  2160 
  2326 
  2161   var mapSelector = function mapSelector(selector, selectorName) {
  2327   const mapSelector = (selector, selectorName) => {
  2162     var resolver = resolvers[selectorName];
  2328     const resolver = resolvers[selectorName];
  2163 
  2329 
  2164     if (!resolver) {
  2330     if (!resolver) {
  2165       selector.hasResolver = false;
  2331       selector.hasResolver = false;
  2166       return selector;
  2332       return selector;
  2167     }
  2333     }
  2168 
  2334 
  2169     var selectorResolver = function selectorResolver() {
  2335     const selectorResolver = (...args) => {
  2170       for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  2336       async function fulfillSelector() {
  2171         args[_key3] = arguments[_key3];
  2337         const state = store.getState();
       
  2338 
       
  2339         if (resolversCache.isRunning(selectorName, args) || typeof resolver.isFulfilled === 'function' && resolver.isFulfilled(state, ...args)) {
       
  2340           return;
       
  2341         }
       
  2342 
       
  2343         const {
       
  2344           metadata
       
  2345         } = store.__unstableOriginalGetState();
       
  2346 
       
  2347         if (hasStartedResolution(metadata, selectorName, args)) {
       
  2348           return;
       
  2349         }
       
  2350 
       
  2351         resolversCache.markAsRunning(selectorName, args);
       
  2352         setTimeout(async () => {
       
  2353           resolversCache.clear(selectorName, args);
       
  2354           store.dispatch(startResolution(selectorName, args));
       
  2355           await fulfillResolver(store, mappedResolvers, selectorName, ...args);
       
  2356           store.dispatch(finishResolution(selectorName, args));
       
  2357         });
  2172       }
  2358       }
  2173 
  2359 
  2174       function fulfillSelector() {
  2360       fulfillSelector(...args);
  2175         return _fulfillSelector.apply(this, arguments);
  2361       return selector(...args);
  2176       }
       
  2177 
       
  2178       function _fulfillSelector() {
       
  2179         _fulfillSelector = Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/external_this_regeneratorRuntime_default.a.mark(function _callee() {
       
  2180           var state, _store$__unstableOrig, metadata;
       
  2181 
       
  2182           return external_this_regeneratorRuntime_default.a.wrap(function _callee$(_context) {
       
  2183             while (1) {
       
  2184               switch (_context.prev = _context.next) {
       
  2185                 case 0:
       
  2186                   state = store.getState();
       
  2187 
       
  2188                   if (!(typeof resolver.isFulfilled === 'function' && resolver.isFulfilled.apply(resolver, [state].concat(args)))) {
       
  2189                     _context.next = 3;
       
  2190                     break;
       
  2191                   }
       
  2192 
       
  2193                   return _context.abrupt("return");
       
  2194 
       
  2195                 case 3:
       
  2196                   _store$__unstableOrig = store.__unstableOriginalGetState(), metadata = _store$__unstableOrig.metadata;
       
  2197 
       
  2198                   if (!hasStartedResolution(metadata, selectorName, args)) {
       
  2199                     _context.next = 6;
       
  2200                     break;
       
  2201                   }
       
  2202 
       
  2203                   return _context.abrupt("return");
       
  2204 
       
  2205                 case 6:
       
  2206                   store.dispatch(startResolution(selectorName, args));
       
  2207                   _context.next = 9;
       
  2208                   return fulfillResolver.apply(void 0, [store, mappedResolvers, selectorName].concat(args));
       
  2209 
       
  2210                 case 9:
       
  2211                   store.dispatch(finishResolution(selectorName, args));
       
  2212 
       
  2213                 case 10:
       
  2214                 case "end":
       
  2215                   return _context.stop();
       
  2216               }
       
  2217             }
       
  2218           }, _callee);
       
  2219         }));
       
  2220         return _fulfillSelector.apply(this, arguments);
       
  2221       }
       
  2222 
       
  2223       fulfillSelector.apply(void 0, args);
       
  2224       return selector.apply(void 0, args);
       
  2225     };
  2362     };
  2226 
  2363 
  2227     selectorResolver.hasResolver = true;
  2364     selectorResolver.hasResolver = true;
  2228     return selectorResolver;
  2365     return selectorResolver;
  2229   };
  2366   };
  2230 
  2367 
  2231   return {
  2368   return {
  2232     resolvers: mappedResolvers,
  2369     resolvers: mappedResolvers,
  2233     selectors: Object(external_this_lodash_["mapValues"])(selectors, mapSelector)
  2370     selectors: Object(external_lodash_["mapValues"])(selectors, mapSelector)
  2234   };
  2371   };
  2235 }
  2372 }
  2236 /**
  2373 /**
  2237  * Calls a resolver given arguments
  2374  * Calls a resolver given arguments
  2238  *
  2375  *
  2241  * @param {string} selectorName Selector name to fulfill.
  2378  * @param {string} selectorName Selector name to fulfill.
  2242  * @param {Array} args          Selector Arguments.
  2379  * @param {Array} args          Selector Arguments.
  2243  */
  2380  */
  2244 
  2381 
  2245 
  2382 
  2246 function fulfillResolver(_x, _x2, _x3) {
  2383 async function fulfillResolver(store, resolvers, selectorName, ...args) {
  2247   return _fulfillResolver.apply(this, arguments);
  2384   const resolver = Object(external_lodash_["get"])(resolvers, [selectorName]);
  2248 }
  2385 
  2249 
  2386   if (!resolver) {
  2250 function _fulfillResolver() {
  2387     return;
  2251   _fulfillResolver = Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/external_this_regeneratorRuntime_default.a.mark(function _callee2(store, resolvers, selectorName) {
  2388   }
  2252     var resolver,
  2389 
  2253         _len4,
  2390   const action = resolver.fulfill(...args);
  2254         args,
  2391 
  2255         _key4,
  2392   if (action) {
  2256         action,
  2393     await store.dispatch(action);
  2257         _args2 = arguments;
  2394   }
  2258 
       
  2259     return external_this_regeneratorRuntime_default.a.wrap(function _callee2$(_context2) {
       
  2260       while (1) {
       
  2261         switch (_context2.prev = _context2.next) {
       
  2262           case 0:
       
  2263             resolver = Object(external_this_lodash_["get"])(resolvers, [selectorName]);
       
  2264 
       
  2265             if (resolver) {
       
  2266               _context2.next = 3;
       
  2267               break;
       
  2268             }
       
  2269 
       
  2270             return _context2.abrupt("return");
       
  2271 
       
  2272           case 3:
       
  2273             for (_len4 = _args2.length, args = new Array(_len4 > 3 ? _len4 - 3 : 0), _key4 = 3; _key4 < _len4; _key4++) {
       
  2274               args[_key4 - 3] = _args2[_key4];
       
  2275             }
       
  2276 
       
  2277             action = resolver.fulfill.apply(resolver, args);
       
  2278 
       
  2279             if (!action) {
       
  2280               _context2.next = 8;
       
  2281               break;
       
  2282             }
       
  2283 
       
  2284             _context2.next = 8;
       
  2285             return store.dispatch(action);
       
  2286 
       
  2287           case 8:
       
  2288           case "end":
       
  2289             return _context2.stop();
       
  2290         }
       
  2291       }
       
  2292     }, _callee2);
       
  2293   }));
       
  2294   return _fulfillResolver.apply(this, arguments);
       
  2295 }
  2395 }
  2296 
  2396 
  2297 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/store/index.js
  2397 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/store/index.js
  2298 
       
  2299 
       
  2300 function store_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
       
  2301 
       
  2302 function store_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { store_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { store_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
       
  2303 
       
  2304 function createCoreDataStore(registry) {
  2398 function createCoreDataStore(registry) {
  2305   var getCoreDataSelector = function getCoreDataSelector(selectorName) {
  2399   const getCoreDataSelector = selectorName => (key, ...args) => {
  2306     return function (reducerKey) {
  2400     return registry.select(key)[selectorName](...args);
  2307       var _registry$select;
       
  2308 
       
  2309       for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
       
  2310         args[_key - 1] = arguments[_key];
       
  2311       }
       
  2312 
       
  2313       return (_registry$select = registry.select(reducerKey))[selectorName].apply(_registry$select, args);
       
  2314     };
       
  2315   };
  2401   };
  2316 
  2402 
  2317   var getCoreDataAction = function getCoreDataAction(actionName) {
  2403   const getCoreDataAction = actionName => (key, ...args) => {
  2318     return function (reducerKey) {
  2404     return registry.dispatch(key)[actionName](...args);
  2319       var _registry$dispatch;
       
  2320 
       
  2321       for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
       
  2322         args[_key2 - 1] = arguments[_key2];
       
  2323       }
       
  2324 
       
  2325       return (_registry$dispatch = registry.dispatch(reducerKey))[actionName].apply(_registry$dispatch, args);
       
  2326     };
       
  2327   };
  2405   };
  2328 
  2406 
  2329   return {
  2407   return {
  2330     getSelectors: function getSelectors() {
  2408     getSelectors() {
  2331       return ['getIsResolving', 'hasStartedResolution', 'hasFinishedResolution', 'isResolving', 'getCachedResolvers'].reduce(function (memo, selectorName) {
  2409       return ['getIsResolving', 'hasStartedResolution', 'hasFinishedResolution', 'isResolving', 'getCachedResolvers'].reduce((memo, selectorName) => ({ ...memo,
  2332         return store_objectSpread({}, memo, Object(defineProperty["a" /* default */])({}, selectorName, getCoreDataSelector(selectorName)));
  2410         [selectorName]: getCoreDataSelector(selectorName)
  2333       }, {});
  2411       }), {});
  2334     },
  2412     },
  2335     getActions: function getActions() {
  2413 
  2336       return ['startResolution', 'finishResolution', 'invalidateResolution', 'invalidateResolutionForStore', 'invalidateResolutionForStoreSelector'].reduce(function (memo, actionName) {
  2414     getActions() {
  2337         return store_objectSpread({}, memo, Object(defineProperty["a" /* default */])({}, actionName, getCoreDataAction(actionName)));
  2415       return ['startResolution', 'finishResolution', 'invalidateResolution', 'invalidateResolutionForStore', 'invalidateResolutionForStoreSelector'].reduce((memo, actionName) => ({ ...memo,
  2338       }, {});
  2416         [actionName]: getCoreDataAction(actionName)
       
  2417       }), {});
  2339     },
  2418     },
  2340     subscribe: function subscribe() {
  2419 
       
  2420     subscribe() {
  2341       // There's no reasons to trigger any listener when we subscribe to this store
  2421       // There's no reasons to trigger any listener when we subscribe to this store
  2342       // because there's no state stored in this store that need to retrigger selectors
  2422       // because there's no state stored in this store that need to retrigger selectors
  2343       // if a change happens, the corresponding store where the tracking stated live
  2423       // if a change happens, the corresponding store where the tracking stated live
  2344       // would have already triggered a "subscribe" call.
  2424       // would have already triggered a "subscribe" call.
  2345       return function () {};
  2425       return () => {};
  2346     }
  2426     }
       
  2427 
  2347   };
  2428   };
  2348 }
  2429 }
  2349 
  2430 
  2350 /* harmony default export */ var build_module_store = (createCoreDataStore);
  2431 /* harmony default export */ var build_module_store = (createCoreDataStore);
  2351 
  2432 
  2352 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/registry.js
  2433 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/registry.js
  2353 
       
  2354 
       
  2355 
       
  2356 function registry_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
       
  2357 
       
  2358 function registry_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { registry_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { registry_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
       
  2359 
       
  2360 /**
  2434 /**
  2361  * External dependencies
  2435  * External dependencies
  2362  */
  2436  */
  2363 
  2437 
  2364 
       
  2365 /**
  2438 /**
  2366  * Internal dependencies
  2439  * Internal dependencies
  2367  */
  2440  */
  2368 
  2441 
  2369 
  2442 
       
  2443 
       
  2444 /** @typedef {import('./types').WPDataStore} WPDataStore */
  2370 
  2445 
  2371 /**
  2446 /**
  2372  * @typedef {Object} WPDataRegistry An isolated orchestrator of store registrations.
  2447  * @typedef {Object} WPDataRegistry An isolated orchestrator of store registrations.
  2373  *
  2448  *
  2374  * @property {Function} registerGenericStore Given a namespace key and settings
  2449  * @property {Function} registerGenericStore Given a namespace key and settings
  2402  * @param {Object?} parent       Parent registry.
  2477  * @param {Object?} parent       Parent registry.
  2403  *
  2478  *
  2404  * @return {WPDataRegistry} Data registry.
  2479  * @return {WPDataRegistry} Data registry.
  2405  */
  2480  */
  2406 
  2481 
  2407 function createRegistry() {
  2482 function createRegistry(storeConfigs = {}, parent = null) {
  2408   var storeConfigs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  2483   const stores = {};
  2409   var parent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
  2484   let listeners = [];
  2410   var stores = {};
  2485 
  2411   var listeners = [];
  2486   const __experimentalListeningStores = new Set();
  2412   /**
  2487   /**
  2413    * Global listener called for each store's update.
  2488    * Global listener called for each store's update.
  2414    */
  2489    */
  2415 
  2490 
       
  2491 
  2416   function globalListener() {
  2492   function globalListener() {
  2417     listeners.forEach(function (listener) {
  2493     listeners.forEach(listener => listener());
  2418       return listener();
       
  2419     });
       
  2420   }
  2494   }
  2421   /**
  2495   /**
  2422    * Subscribe to changes to any data.
  2496    * Subscribe to changes to any data.
  2423    *
  2497    *
  2424    * @param {Function}   listener Listener function.
  2498    * @param {Function}   listener Listener function.
  2425    *
  2499    *
  2426    * @return {Function}           Unsubscribe function.
  2500    * @return {Function}           Unsubscribe function.
  2427    */
  2501    */
  2428 
  2502 
  2429 
  2503 
  2430   var subscribe = function subscribe(listener) {
  2504   const subscribe = listener => {
  2431     listeners.push(listener);
  2505     listeners.push(listener);
  2432     return function () {
  2506     return () => {
  2433       listeners = Object(external_this_lodash_["without"])(listeners, listener);
  2507       listeners = Object(external_lodash_["without"])(listeners, listener);
  2434     };
  2508     };
  2435   };
  2509   };
  2436   /**
  2510   /**
  2437    * Calls a selector given the current state and extra arguments.
  2511    * Calls a selector given the current state and extra arguments.
  2438    *
  2512    *
  2439    * @param {string} reducerKey Part of the state shape to register the
  2513    * @param {string|WPDataStore} storeNameOrDefinition Unique namespace identifier for the store
  2440    *                            selectors for.
  2514    *                                                   or the store definition.
  2441    *
  2515    *
  2442    * @return {*} The selector's returned value.
  2516    * @return {*} The selector's returned value.
  2443    */
  2517    */
  2444 
  2518 
  2445 
  2519 
  2446   function select(reducerKey) {
  2520   function select(storeNameOrDefinition) {
  2447     var store = stores[reducerKey];
  2521     const storeName = Object(external_lodash_["isObject"])(storeNameOrDefinition) ? storeNameOrDefinition.name : storeNameOrDefinition;
       
  2522 
       
  2523     __experimentalListeningStores.add(storeName);
       
  2524 
       
  2525     const store = stores[storeName];
  2448 
  2526 
  2449     if (store) {
  2527     if (store) {
  2450       return store.getSelectors();
  2528       return store.getSelectors();
  2451     }
  2529     }
  2452 
  2530 
  2453     return parent && parent.select(reducerKey);
  2531     return parent && parent.select(storeName);
  2454   }
  2532   }
  2455 
  2533 
  2456   var getResolveSelectors = memize_default()(function (selectors) {
  2534   function __experimentalMarkListeningStores(callback, ref) {
  2457     return Object(external_this_lodash_["mapValues"])(Object(external_this_lodash_["omit"])(selectors, ['getIsResolving', 'hasStartedResolution', 'hasFinishedResolution', 'isResolving', 'getCachedResolvers']), function (selector, selectorName) {
  2535     __experimentalListeningStores.clear();
  2458       return function () {
  2536 
  2459         for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  2537     const result = callback.call(this);
  2460           args[_key] = arguments[_key];
  2538     ref.current = Array.from(__experimentalListeningStores);
  2461         }
  2539     return result;
  2462 
  2540   }
  2463         return new Promise(function (resolve) {
       
  2464           var hasFinished = function hasFinished() {
       
  2465             return selectors.hasFinishedResolution(selectorName, args);
       
  2466           };
       
  2467 
       
  2468           var getResult = function getResult() {
       
  2469             return selector.apply(null, args);
       
  2470           }; // trigger the selector (to trigger the resolver)
       
  2471 
       
  2472 
       
  2473           var result = getResult();
       
  2474 
       
  2475           if (hasFinished()) {
       
  2476             return resolve(result);
       
  2477           }
       
  2478 
       
  2479           var unsubscribe = subscribe(function () {
       
  2480             if (hasFinished()) {
       
  2481               unsubscribe();
       
  2482               resolve(getResult());
       
  2483             }
       
  2484           });
       
  2485         });
       
  2486       };
       
  2487     });
       
  2488   }, {
       
  2489     maxSize: 1
       
  2490   });
       
  2491   /**
  2541   /**
  2492    * Given the name of a registered store, returns an object containing the store's
  2542    * Given the name of a registered store, returns an object containing the store's
  2493    * selectors pre-bound to state so that you only need to supply additional arguments,
  2543    * selectors pre-bound to state so that you only need to supply additional arguments,
  2494    * and modified so that they return promises that resolve to their eventual values,
  2544    * and modified so that they return promises that resolve to their eventual values,
  2495    * after any resolvers have ran.
  2545    * after any resolvers have ran.
  2496    *
  2546    *
  2497    * @param {string} reducerKey Part of the state shape to register the
  2547    * @param {string|WPDataStore} storeNameOrDefinition Unique namespace identifier for the store
  2498    *                            selectors for.
  2548    *                                                   or the store definition.
  2499    *
  2549    *
  2500    * @return {Object} Each key of the object matches the name of a selector.
  2550    * @return {Object} Each key of the object matches the name of a selector.
  2501    */
  2551    */
  2502 
  2552 
  2503   function __experimentalResolveSelect(reducerKey) {
  2553 
  2504     return getResolveSelectors(select(reducerKey));
  2554   function resolveSelect(storeNameOrDefinition) {
       
  2555     const storeName = Object(external_lodash_["isObject"])(storeNameOrDefinition) ? storeNameOrDefinition.name : storeNameOrDefinition;
       
  2556 
       
  2557     __experimentalListeningStores.add(storeName);
       
  2558 
       
  2559     const store = stores[storeName];
       
  2560 
       
  2561     if (store) {
       
  2562       return store.getResolveSelectors();
       
  2563     }
       
  2564 
       
  2565     return parent && parent.resolveSelect(storeName);
  2505   }
  2566   }
  2506   /**
  2567   /**
  2507    * Returns the available actions for a part of the state.
  2568    * Returns the available actions for a part of the state.
  2508    *
  2569    *
  2509    * @param {string} reducerKey Part of the state shape to dispatch the
  2570    * @param {string|WPDataStore} storeNameOrDefinition Unique namespace identifier for the store
  2510    *                            action for.
  2571    *                                                   or the store definition.
  2511    *
  2572    *
  2512    * @return {*} The action's returned value.
  2573    * @return {*} The action's returned value.
  2513    */
  2574    */
  2514 
  2575 
  2515 
  2576 
  2516   function dispatch(reducerKey) {
  2577   function dispatch(storeNameOrDefinition) {
  2517     var store = stores[reducerKey];
  2578     const storeName = Object(external_lodash_["isObject"])(storeNameOrDefinition) ? storeNameOrDefinition.name : storeNameOrDefinition;
       
  2579     const store = stores[storeName];
  2518 
  2580 
  2519     if (store) {
  2581     if (store) {
  2520       return store.getActions();
  2582       return store.getActions();
  2521     }
  2583     }
  2522 
  2584 
  2523     return parent && parent.dispatch(reducerKey);
  2585     return parent && parent.dispatch(storeName);
  2524   } //
  2586   } //
  2525   // Deprecated
  2587   // Deprecated
  2526   // TODO: Remove this after `use()` is removed.
  2588   // TODO: Remove this after `use()` is removed.
  2527   //
  2589   //
  2528 
  2590 
  2529 
  2591 
  2530   function withPlugins(attributes) {
  2592   function withPlugins(attributes) {
  2531     return Object(external_this_lodash_["mapValues"])(attributes, function (attribute, key) {
  2593     return Object(external_lodash_["mapValues"])(attributes, (attribute, key) => {
  2532       if (typeof attribute !== 'function') {
  2594       if (typeof attribute !== 'function') {
  2533         return attribute;
  2595         return attribute;
  2534       }
  2596       }
  2535 
  2597 
  2536       return function () {
  2598       return function () {
  2560     }
  2622     }
  2561 
  2623 
  2562     stores[key] = config;
  2624     stores[key] = config;
  2563     config.subscribe(globalListener);
  2625     config.subscribe(globalListener);
  2564   }
  2626   }
  2565 
  2627   /**
  2566   var registry = {
  2628    * Registers a new store definition.
  2567     registerGenericStore: registerGenericStore,
  2629    *
  2568     stores: stores,
  2630    * @param {WPDataStore} store Store definition.
       
  2631    */
       
  2632 
       
  2633 
       
  2634   function register(store) {
       
  2635     registerGenericStore(store.name, store.instantiate(registry));
       
  2636   }
       
  2637   /**
       
  2638    * Subscribe handler to a store.
       
  2639    *
       
  2640    * @param {string[]} storeName The store name.
       
  2641    * @param {Function} handler   The function subscribed to the store.
       
  2642    * @return {Function} A function to unsubscribe the handler.
       
  2643    */
       
  2644 
       
  2645 
       
  2646   function __experimentalSubscribeStore(storeName, handler) {
       
  2647     if (storeName in stores) {
       
  2648       return stores[storeName].subscribe(handler);
       
  2649     } // Trying to access a store that hasn't been registered,
       
  2650     // this is a pattern rarely used but seen in some places.
       
  2651     // We fallback to regular `subscribe` here for backward-compatibility for now.
       
  2652     // See https://github.com/WordPress/gutenberg/pull/27466 for more info.
       
  2653 
       
  2654 
       
  2655     if (!parent) {
       
  2656       return subscribe(handler);
       
  2657     }
       
  2658 
       
  2659     return parent.__experimentalSubscribeStore(storeName, handler);
       
  2660   }
       
  2661 
       
  2662   let registry = {
       
  2663     registerGenericStore,
       
  2664     stores,
  2569     namespaces: stores,
  2665     namespaces: stores,
  2570     // TODO: Deprecate/remove this.
  2666     // TODO: Deprecate/remove this.
  2571     subscribe: subscribe,
  2667     subscribe,
  2572     select: select,
  2668     select,
  2573     __experimentalResolveSelect: __experimentalResolveSelect,
  2669     resolveSelect,
  2574     dispatch: dispatch,
  2670     dispatch,
  2575     use: use
  2671     use,
       
  2672     register,
       
  2673     __experimentalMarkListeningStores,
       
  2674     __experimentalSubscribeStore
  2576   };
  2675   };
  2577   /**
  2676   /**
  2578    * Registers a standard `@wordpress/data` store.
  2677    * Registers a standard `@wordpress/data` store.
  2579    *
  2678    *
  2580    * @param {string} reducerKey Reducer key.
  2679    * @param {string} storeName  Unique namespace identifier.
  2581    * @param {Object} options    Store description (reducer, actions, selectors, resolvers).
  2680    * @param {Object} options    Store description (reducer, actions, selectors, resolvers).
  2582    *
  2681    *
  2583    * @return {Object} Registered store object.
  2682    * @return {Object} Registered store object.
  2584    */
  2683    */
  2585 
  2684 
  2586   registry.registerStore = function (reducerKey, options) {
  2685   registry.registerStore = (storeName, options) => {
  2587     if (!options.reducer) {
  2686     if (!options.reducer) {
  2588       throw new TypeError('Must specify store reducer');
  2687       throw new TypeError('Must specify store reducer');
  2589     }
  2688     }
  2590 
  2689 
  2591     var namespace = createNamespace(reducerKey, options, registry);
  2690     const store = createReduxStore(storeName, options).instantiate(registry);
  2592     registerGenericStore(reducerKey, namespace);
  2691     registerGenericStore(storeName, store);
  2593     return namespace.store;
  2692     return store.store;
  2594   }; //
  2693   }; //
  2595   // TODO:
  2694   // TODO:
  2596   // This function will be deprecated as soon as it is no longer internally referenced.
  2695   // This function will be deprecated as soon as it is no longer internally referenced.
  2597   //
  2696   //
  2598 
  2697 
  2599 
  2698 
  2600   function use(plugin, options) {
  2699   function use(plugin, options) {
  2601     registry = registry_objectSpread({}, registry, {}, plugin(registry, options));
  2700     registry = { ...registry,
       
  2701       ...plugin(registry, options)
       
  2702     };
  2602     return registry;
  2703     return registry;
  2603   }
  2704   }
  2604 
  2705 
  2605   registerGenericStore('core/data', build_module_store(registry));
  2706   registerGenericStore('core/data', build_module_store(registry));
  2606   Object.entries(storeConfigs).forEach(function (_ref) {
  2707   Object.entries(storeConfigs).forEach(([name, config]) => registry.registerStore(name, config));
  2607     var _ref2 = Object(slicedToArray["a" /* default */])(_ref, 2),
       
  2608         name = _ref2[0],
       
  2609         config = _ref2[1];
       
  2610 
       
  2611     return registry.registerStore(name, config);
       
  2612   });
       
  2613 
  2708 
  2614   if (parent) {
  2709   if (parent) {
  2615     parent.subscribe(globalListener);
  2710     parent.subscribe(globalListener);
  2616   }
  2711   }
  2617 
  2712 
  2623  * Internal dependencies
  2718  * Internal dependencies
  2624  */
  2719  */
  2625 
  2720 
  2626 /* harmony default export */ var default_registry = (createRegistry());
  2721 /* harmony default export */ var default_registry = (createRegistry());
  2627 
  2722 
  2628 // EXTERNAL MODULE: external {"this":["wp","deprecated"]}
  2723 // EXTERNAL MODULE: external ["wp","deprecated"]
  2629 var external_this_wp_deprecated_ = __webpack_require__(37);
  2724 var external_wp_deprecated_ = __webpack_require__("NMb1");
  2630 var external_this_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_this_wp_deprecated_);
  2725 var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_);
  2631 
  2726 
  2632 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/plugins/controls/index.js
  2727 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/plugins/controls/index.js
  2633 /**
  2728 /**
  2634  * WordPress dependencies
  2729  * WordPress dependencies
  2635  */
  2730  */
  2636 
  2731 
  2637 /* harmony default export */ var controls = (function (registry) {
  2732 /* harmony default export */ var plugins_controls = (registry => {
  2638   external_this_wp_deprecated_default()('wp.data.plugins.controls', {
  2733   external_wp_deprecated_default()('wp.data.plugins.controls', {
       
  2734     since: '5.4',
  2639     hint: 'The controls plugins is now baked-in.'
  2735     hint: 'The controls plugins is now baked-in.'
  2640   });
  2736   });
  2641   return registry;
  2737   return registry;
  2642 });
  2738 });
  2643 
  2739 
  2644 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/plugins/persistence/storage/object.js
  2740 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/plugins/persistence/storage/object.js
  2645 var objectStorage;
  2741 let objectStorage;
  2646 var object_storage = {
  2742 const storage = {
  2647   getItem: function getItem(key) {
  2743   getItem(key) {
  2648     if (!objectStorage || !objectStorage[key]) {
  2744     if (!objectStorage || !objectStorage[key]) {
  2649       return null;
  2745       return null;
  2650     }
  2746     }
  2651 
  2747 
  2652     return objectStorage[key];
  2748     return objectStorage[key];
  2653   },
  2749   },
  2654   setItem: function setItem(key, value) {
  2750 
       
  2751   setItem(key, value) {
  2655     if (!objectStorage) {
  2752     if (!objectStorage) {
  2656       object_storage.clear();
  2753       storage.clear();
  2657     }
  2754     }
  2658 
  2755 
  2659     objectStorage[key] = String(value);
  2756     objectStorage[key] = String(value);
  2660   },
  2757   },
  2661   clear: function clear() {
  2758 
       
  2759   clear() {
  2662     objectStorage = Object.create(null);
  2760     objectStorage = Object.create(null);
  2663   }
  2761   }
       
  2762 
  2664 };
  2763 };
  2665 /* harmony default export */ var object = (object_storage);
  2764 /* harmony default export */ var object = (storage);
  2666 
  2765 
  2667 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/plugins/persistence/storage/default.js
  2766 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/plugins/persistence/storage/default.js
  2668 /**
  2767 /**
  2669  * Internal dependencies
  2768  * Internal dependencies
  2670  */
  2769  */
  2671 
  2770 
  2672 var default_storage;
  2771 let default_storage;
  2673 
  2772 
  2674 try {
  2773 try {
  2675   // Private Browsing in Safari 10 and earlier will throw an error when
  2774   // Private Browsing in Safari 10 and earlier will throw an error when
  2676   // attempting to set into localStorage. The test here is intentional in
  2775   // attempting to set into localStorage. The test here is intentional in
  2677   // causing a thrown error as condition for using fallback object storage.
  2776   // causing a thrown error as condition for using fallback object storage.
  2683 }
  2782 }
  2684 
  2783 
  2685 /* harmony default export */ var storage_default = (default_storage);
  2784 /* harmony default export */ var storage_default = (default_storage);
  2686 
  2785 
  2687 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/plugins/persistence/index.js
  2786 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/plugins/persistence/index.js
  2688 
       
  2689 
       
  2690 function persistence_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
       
  2691 
       
  2692 function persistence_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { persistence_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { persistence_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
       
  2693 
       
  2694 /**
  2787 /**
  2695  * External dependencies
  2788  * External dependencies
  2696  */
  2789  */
  2697 
  2790 
  2698 /**
  2791 /**
  2719  * Default plugin storage.
  2812  * Default plugin storage.
  2720  *
  2813  *
  2721  * @type {Storage}
  2814  * @type {Storage}
  2722  */
  2815  */
  2723 
  2816 
  2724 var DEFAULT_STORAGE = storage_default;
  2817 const DEFAULT_STORAGE = storage_default;
  2725 /**
  2818 /**
  2726  * Default plugin storage key.
  2819  * Default plugin storage key.
  2727  *
  2820  *
  2728  * @type {string}
  2821  * @type {string}
  2729  */
  2822  */
  2730 
  2823 
  2731 var DEFAULT_STORAGE_KEY = 'WP_DATA';
  2824 const DEFAULT_STORAGE_KEY = 'WP_DATA';
  2732 /**
  2825 /**
  2733  * Higher-order reducer which invokes the original reducer only if state is
  2826  * Higher-order reducer which invokes the original reducer only if state is
  2734  * inequal from that of the action's `nextState` property, otherwise returning
  2827  * inequal from that of the action's `nextState` property, otherwise returning
  2735  * the original state reference.
  2828  * the original state reference.
  2736  *
  2829  *
  2737  * @param {Function} reducer Original reducer.
  2830  * @param {Function} reducer Original reducer.
  2738  *
  2831  *
  2739  * @return {Function} Enhanced reducer.
  2832  * @return {Function} Enhanced reducer.
  2740  */
  2833  */
  2741 
  2834 
  2742 var withLazySameState = function withLazySameState(reducer) {
  2835 const withLazySameState = reducer => (state, action) => {
  2743   return function (state, action) {
  2836   if (action.nextState === state) {
  2744     if (action.nextState === state) {
  2837     return state;
  2745       return state;
  2838   }
  2746     }
  2839 
  2747 
  2840   return reducer(state, action);
  2748     return reducer(state, action);
       
  2749   };
       
  2750 };
  2841 };
  2751 /**
  2842 /**
  2752  * Creates a persistence interface, exposing getter and setter methods (`get`
  2843  * Creates a persistence interface, exposing getter and setter methods (`get`
  2753  * and `set` respectively).
  2844  * and `set` respectively).
  2754  *
  2845  *
  2756  *
  2847  *
  2757  * @return {Object} Persistence interface.
  2848  * @return {Object} Persistence interface.
  2758  */
  2849  */
  2759 
  2850 
  2760 function createPersistenceInterface(options) {
  2851 function createPersistenceInterface(options) {
  2761   var _options$storage = options.storage,
  2852   const {
  2762       storage = _options$storage === void 0 ? DEFAULT_STORAGE : _options$storage,
  2853     storage = DEFAULT_STORAGE,
  2763       _options$storageKey = options.storageKey,
  2854     storageKey = DEFAULT_STORAGE_KEY
  2764       storageKey = _options$storageKey === void 0 ? DEFAULT_STORAGE_KEY : _options$storageKey;
  2855   } = options;
  2765   var data;
  2856   let data;
  2766   /**
  2857   /**
  2767    * Returns the persisted data as an object, defaulting to an empty object.
  2858    * Returns the persisted data as an object, defaulting to an empty object.
  2768    *
  2859    *
  2769    * @return {Object} Persisted data.
  2860    * @return {Object} Persisted data.
  2770    */
  2861    */
  2771 
  2862 
  2772   function getData() {
  2863   function getData() {
  2773     if (data === undefined) {
  2864     if (data === undefined) {
  2774       // If unset, getItem is expected to return null. Fall back to
  2865       // If unset, getItem is expected to return null. Fall back to
  2775       // empty object.
  2866       // empty object.
  2776       var persisted = storage.getItem(storageKey);
  2867       const persisted = storage.getItem(storageKey);
  2777 
  2868 
  2778       if (persisted === null) {
  2869       if (persisted === null) {
  2779         data = {};
  2870         data = {};
  2780       } else {
  2871       } else {
  2781         try {
  2872         try {
  2797    * @param {*}      value Updated value.
  2888    * @param {*}      value Updated value.
  2798    */
  2889    */
  2799 
  2890 
  2800 
  2891 
  2801   function setData(key, value) {
  2892   function setData(key, value) {
  2802     data = persistence_objectSpread({}, data, Object(defineProperty["a" /* default */])({}, key, value));
  2893     data = { ...data,
       
  2894       [key]: value
       
  2895     };
  2803     storage.setItem(storageKey, JSON.stringify(data));
  2896     storage.setItem(storageKey, JSON.stringify(data));
  2804   }
  2897   }
  2805 
  2898 
  2806   return {
  2899   return {
  2807     get: getData,
  2900     get: getData,
  2816  *
  2909  *
  2817  * @return {WPDataPlugin} Data plugin.
  2910  * @return {WPDataPlugin} Data plugin.
  2818  */
  2911  */
  2819 
  2912 
  2820 function persistencePlugin(registry, pluginOptions) {
  2913 function persistencePlugin(registry, pluginOptions) {
  2821   var persistence = createPersistenceInterface(pluginOptions);
  2914   const persistence = createPersistenceInterface(pluginOptions);
  2822   /**
  2915   /**
  2823    * Creates an enhanced store dispatch function, triggering the state of the
  2916    * Creates an enhanced store dispatch function, triggering the state of the
  2824    * given reducer key to be persisted when changed.
  2917    * given store name to be persisted when changed.
  2825    *
  2918    *
  2826    * @param {Function}       getState   Function which returns current state.
  2919    * @param {Function}       getState  Function which returns current state.
  2827    * @param {string}         reducerKey Reducer key.
  2920    * @param {string}         storeName Store name.
  2828    * @param {?Array<string>} keys       Optional subset of keys to save.
  2921    * @param {?Array<string>} keys      Optional subset of keys to save.
  2829    *
  2922    *
  2830    * @return {Function} Enhanced dispatch function.
  2923    * @return {Function} Enhanced dispatch function.
  2831    */
  2924    */
  2832 
  2925 
  2833   function createPersistOnChange(getState, reducerKey, keys) {
  2926   function createPersistOnChange(getState, storeName, keys) {
  2834     var getPersistedState;
  2927     let getPersistedState;
  2835 
  2928 
  2836     if (Array.isArray(keys)) {
  2929     if (Array.isArray(keys)) {
  2837       // Given keys, the persisted state should by produced as an object
  2930       // Given keys, the persisted state should by produced as an object
  2838       // of the subset of keys. This implementation uses combineReducers
  2931       // of the subset of keys. This implementation uses combineReducers
  2839       // to leverage its behavior of returning the same object when none
  2932       // to leverage its behavior of returning the same object when none
  2840       // of the property values changes. This allows a strict reference
  2933       // of the property values changes. This allows a strict reference
  2841       // equality to bypass a persistence set on an unchanging state.
  2934       // equality to bypass a persistence set on an unchanging state.
  2842       var reducers = keys.reduce(function (accumulator, key) {
  2935       const reducers = keys.reduce((accumulator, key) => Object.assign(accumulator, {
  2843         return Object.assign(accumulator, Object(defineProperty["a" /* default */])({}, key, function (state, action) {
  2936         [key]: (state, action) => action.nextState[key]
  2844           return action.nextState[key];
  2937       }), {});
  2845         }));
       
  2846       }, {});
       
  2847       getPersistedState = withLazySameState(turbo_combine_reducers_default()(reducers));
  2938       getPersistedState = withLazySameState(turbo_combine_reducers_default()(reducers));
  2848     } else {
  2939     } else {
  2849       getPersistedState = function getPersistedState(state, action) {
  2940       getPersistedState = (state, action) => action.nextState;
  2850         return action.nextState;
  2941     }
  2851       };
  2942 
  2852     }
  2943     let lastState = getPersistedState(undefined, {
  2853 
       
  2854     var lastState = getPersistedState(undefined, {
       
  2855       nextState: getState()
  2944       nextState: getState()
  2856     });
  2945     });
  2857     return function () {
  2946     return () => {
  2858       var state = getPersistedState(lastState, {
  2947       const state = getPersistedState(lastState, {
  2859         nextState: getState()
  2948         nextState: getState()
  2860       });
  2949       });
  2861 
  2950 
  2862       if (state !== lastState) {
  2951       if (state !== lastState) {
  2863         persistence.set(reducerKey, state);
  2952         persistence.set(storeName, state);
  2864         lastState = state;
  2953         lastState = state;
  2865       }
  2954       }
  2866     };
  2955     };
  2867   }
  2956   }
  2868 
  2957 
  2869   return {
  2958   return {
  2870     registerStore: function registerStore(reducerKey, options) {
  2959     registerStore(storeName, options) {
  2871       if (!options.persist) {
  2960       if (!options.persist) {
  2872         return registry.registerStore(reducerKey, options);
  2961         return registry.registerStore(storeName, options);
  2873       } // Load from persistence to use as initial state.
  2962       } // Load from persistence to use as initial state.
  2874 
  2963 
  2875 
  2964 
  2876       var persistedState = persistence.get()[reducerKey];
  2965       const persistedState = persistence.get()[storeName];
  2877 
  2966 
  2878       if (persistedState !== undefined) {
  2967       if (persistedState !== undefined) {
  2879         var initialState = options.reducer(options.initialState, {
  2968         let initialState = options.reducer(options.initialState, {
  2880           type: '@@WP/PERSISTENCE_RESTORE'
  2969           type: '@@WP/PERSISTENCE_RESTORE'
  2881         });
  2970         });
  2882 
  2971 
  2883         if (Object(external_this_lodash_["isPlainObject"])(initialState) && Object(external_this_lodash_["isPlainObject"])(persistedState)) {
  2972         if (Object(external_lodash_["isPlainObject"])(initialState) && Object(external_lodash_["isPlainObject"])(persistedState)) {
  2884           // If state is an object, ensure that:
  2973           // If state is an object, ensure that:
  2885           // - Other keys are left intact when persisting only a
  2974           // - Other keys are left intact when persisting only a
  2886           //   subset of keys.
  2975           //   subset of keys.
  2887           // - New keys in what would otherwise be used as initial
  2976           // - New keys in what would otherwise be used as initial
  2888           //   state are deeply merged as base for persisted value.
  2977           //   state are deeply merged as base for persisted value.
  2889           initialState = Object(external_this_lodash_["merge"])({}, initialState, persistedState);
  2978           initialState = Object(external_lodash_["merge"])({}, initialState, persistedState);
  2890         } else {
  2979         } else {
  2891           // If there is a mismatch in object-likeness of default
  2980           // If there is a mismatch in object-likeness of default
  2892           // initial or persisted state, defer to persisted value.
  2981           // initial or persisted state, defer to persisted value.
  2893           initialState = persistedState;
  2982           initialState = persistedState;
  2894         }
  2983         }
  2895 
  2984 
  2896         options = persistence_objectSpread({}, options, {
  2985         options = { ...options,
  2897           initialState: initialState
  2986           initialState
  2898         });
  2987         };
  2899       }
  2988       }
  2900 
  2989 
  2901       var store = registry.registerStore(reducerKey, options);
  2990       const store = registry.registerStore(storeName, options);
  2902       store.subscribe(createPersistOnChange(store.getState, reducerKey, options.persist));
  2991       store.subscribe(createPersistOnChange(store.getState, storeName, options.persist));
  2903       return store;
  2992       return store;
  2904     }
  2993     }
       
  2994 
  2905   };
  2995   };
  2906 }
  2996 }
  2907 /**
  2997 /**
  2908  * Deprecated: Remove this function and the code in WordPress Core that calls
  2998  * Deprecated: Remove this function and the code in WordPress Core that calls
  2909  * it once WordPress 5.4 is released.
  2999  * it once WordPress 5.4 is released.
  2910  */
  3000  */
  2911 
  3001 
  2912 
  3002 
  2913 persistencePlugin.__unstableMigrate = function (pluginOptions) {
  3003 persistencePlugin.__unstableMigrate = pluginOptions => {
  2914   var persistence = createPersistenceInterface(pluginOptions);
  3004   var _state$coreEditor, _state$coreEditor$pre;
  2915   var state = persistence.get(); // Migrate 'insertUsage' from 'core/editor' to 'core/block-editor'
  3005 
  2916 
  3006   const persistence = createPersistenceInterface(pluginOptions);
  2917   var insertUsage = Object(external_this_lodash_["get"])(state, ['core/editor', 'preferences', 'insertUsage']);
  3007   const state = persistence.get(); // Migrate 'insertUsage' from 'core/editor' to 'core/block-editor'
  2918 
  3008 
  2919   if (insertUsage) {
  3009   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;
       
  3010 
       
  3011   if (editorInsertUsage) {
       
  3012     var _state$coreBlockEdi, _state$coreBlockEdi$p;
       
  3013 
       
  3014     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;
  2920     persistence.set('core/block-editor', {
  3015     persistence.set('core/block-editor', {
  2921       preferences: {
  3016       preferences: {
  2922         insertUsage: insertUsage
  3017         insertUsage: { ...editorInsertUsage,
       
  3018           ...blockEditorInsertUsage
       
  3019         }
  2923       }
  3020       }
  2924     });
  3021     });
  2925   }
  3022   }
  2926 
  3023 
  2927   var editPostState = state['core/edit-post']; // Default `fullscreenMode` to `false` if any persisted state had existed
  3024   let editPostState = state['core/edit-post']; // Default `fullscreenMode` to `false` if any persisted state had existed
  2928   // and the user hadn't made an explicit choice about fullscreen mode. This
  3025   // and the user hadn't made an explicit choice about fullscreen mode. This
  2929   // is needed since `fullscreenMode` previously did not have a default value
  3026   // is needed since `fullscreenMode` previously did not have a default value
  2930   // and was implicitly false by its absence. It is now `true` by default, but
  3027   // and was implicitly false by its absence. It is now `true` by default, but
  2931   // this change is not intended to affect upgrades from earlier versions.
  3028   // this change is not intended to affect upgrades from earlier versions.
  2932 
  3029 
  2933   var hadPersistedState = Object.keys(state).length > 0;
  3030   const hadPersistedState = Object.keys(state).length > 0;
  2934   var hadFullscreenModePreference = Object(external_this_lodash_["has"])(state, ['core/edit-post', 'preferences', 'features', 'fullscreenMode']);
  3031   const hadFullscreenModePreference = Object(external_lodash_["has"])(state, ['core/edit-post', 'preferences', 'features', 'fullscreenMode']);
  2935 
  3032 
  2936   if (hadPersistedState && !hadFullscreenModePreference) {
  3033   if (hadPersistedState && !hadFullscreenModePreference) {
  2937     editPostState = Object(external_this_lodash_["merge"])({}, editPostState, {
  3034     editPostState = Object(external_lodash_["merge"])({}, editPostState, {
  2938       preferences: {
  3035       preferences: {
  2939         features: {
  3036         features: {
  2940           fullscreenMode: false
  3037           fullscreenMode: false
  2941         }
  3038         }
  2942       }
  3039       }
  2943     });
  3040     });
  2944   } // Migrate 'areTipsEnabled' from 'core/nux' to 'showWelcomeGuide' in 'core/edit-post'
  3041   } // Migrate 'areTipsEnabled' from 'core/nux' to 'showWelcomeGuide' in 'core/edit-post'
  2945 
  3042 
  2946 
  3043 
  2947   var areTipsEnabled = Object(external_this_lodash_["get"])(state, ['core/nux', 'preferences', 'areTipsEnabled']);
  3044   const areTipsEnabled = Object(external_lodash_["get"])(state, ['core/nux', 'preferences', 'areTipsEnabled']);
  2948   var hasWelcomeGuide = Object(external_this_lodash_["has"])(state, ['core/edit-post', 'preferences', 'features', 'welcomeGuide']);
  3045   const hasWelcomeGuide = Object(external_lodash_["has"])(state, ['core/edit-post', 'preferences', 'features', 'welcomeGuide']);
  2949 
  3046 
  2950   if (areTipsEnabled !== undefined && !hasWelcomeGuide) {
  3047   if (areTipsEnabled !== undefined && !hasWelcomeGuide) {
  2951     editPostState = Object(external_this_lodash_["merge"])({}, editPostState, {
  3048     editPostState = Object(external_lodash_["merge"])({}, editPostState, {
  2952       preferences: {
  3049       preferences: {
  2953         features: {
  3050         features: {
  2954           welcomeGuide: areTipsEnabled
  3051           welcomeGuide: areTipsEnabled
  2955         }
  3052         }
  2956       }
  3053       }
  2967 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/plugins/index.js
  3064 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/plugins/index.js
  2968 
  3065 
  2969 
  3066 
  2970 
  3067 
  2971 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
  3068 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
  2972 var esm_extends = __webpack_require__(8);
  3069 var esm_extends = __webpack_require__("wx14");
  2973 
  3070 
  2974 // EXTERNAL MODULE: external {"this":["wp","element"]}
  3071 // EXTERNAL MODULE: external ["wp","element"]
  2975 var external_this_wp_element_ = __webpack_require__(0);
  3072 var external_wp_element_ = __webpack_require__("GRId");
  2976 
  3073 
  2977 // EXTERNAL MODULE: external {"this":["wp","compose"]}
  3074 // EXTERNAL MODULE: external ["wp","compose"]
  2978 var external_this_wp_compose_ = __webpack_require__(9);
  3075 var external_wp_compose_ = __webpack_require__("K9lf");
  2979 
  3076 
  2980 // EXTERNAL MODULE: external {"this":"React"}
  3077 // EXTERNAL MODULE: ./node_modules/use-memo-one/dist/use-memo-one.esm.js
  2981 var external_this_React_ = __webpack_require__(13);
  3078 var use_memo_one_esm = __webpack_require__("mHlH");
  2982 
  3079 
  2983 // CONCATENATED MODULE: ./node_modules/use-memo-one/dist/use-memo-one.esm.js
  3080 // EXTERNAL MODULE: external ["wp","priorityQueue"]
  2984 
  3081 var external_wp_priorityQueue_ = __webpack_require__("XI5e");
  2985 
  3082 
  2986 function areInputsEqual(newInputs, lastInputs) {
  3083 // EXTERNAL MODULE: external ["wp","isShallowEqual"]
  2987   if (newInputs.length !== lastInputs.length) {
  3084 var external_wp_isShallowEqual_ = __webpack_require__("rl8x");
  2988     return false;
  3085 var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_wp_isShallowEqual_);
  2989   }
       
  2990 
       
  2991   for (var i = 0; i < newInputs.length; i++) {
       
  2992     if (newInputs[i] !== lastInputs[i]) {
       
  2993       return false;
       
  2994     }
       
  2995   }
       
  2996 
       
  2997   return true;
       
  2998 }
       
  2999 
       
  3000 function useMemoOne(getResult, inputs) {
       
  3001   var initial = Object(external_this_React_["useState"])(function () {
       
  3002     return {
       
  3003       inputs: inputs,
       
  3004       result: getResult()
       
  3005     };
       
  3006   })[0];
       
  3007   var committed = Object(external_this_React_["useRef"])(initial);
       
  3008   var isInputMatch = Boolean(inputs && committed.current.inputs && areInputsEqual(inputs, committed.current.inputs));
       
  3009   var cache = isInputMatch ? committed.current : {
       
  3010     inputs: inputs,
       
  3011     result: getResult()
       
  3012   };
       
  3013   Object(external_this_React_["useEffect"])(function () {
       
  3014     committed.current = cache;
       
  3015   }, [cache]);
       
  3016   return cache.result;
       
  3017 }
       
  3018 function useCallbackOne(callback, inputs) {
       
  3019   return useMemoOne(function () {
       
  3020     return callback;
       
  3021   }, inputs);
       
  3022 }
       
  3023 var useMemo = useMemoOne;
       
  3024 var useCallback = useCallbackOne;
       
  3025 
       
  3026 
       
  3027 
       
  3028 // EXTERNAL MODULE: external {"this":["wp","priorityQueue"]}
       
  3029 var external_this_wp_priorityQueue_ = __webpack_require__(150);
       
  3030 
       
  3031 // EXTERNAL MODULE: external {"this":["wp","isShallowEqual"]}
       
  3032 var external_this_wp_isShallowEqual_ = __webpack_require__(64);
       
  3033 var external_this_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_this_wp_isShallowEqual_);
       
  3034 
  3086 
  3035 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/registry-provider/context.js
  3087 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/registry-provider/context.js
  3036 /**
  3088 /**
  3037  * WordPress dependencies
  3089  * WordPress dependencies
  3038  */
  3090  */
  3040 /**
  3092 /**
  3041  * Internal dependencies
  3093  * Internal dependencies
  3042  */
  3094  */
  3043 
  3095 
  3044 
  3096 
  3045 var Context = Object(external_this_wp_element_["createContext"])(default_registry);
  3097 const Context = Object(external_wp_element_["createContext"])(default_registry);
  3046 var Consumer = Context.Consumer,
  3098 const {
  3047     Provider = Context.Provider;
  3099   Consumer,
       
  3100   Provider
       
  3101 } = Context;
  3048 /**
  3102 /**
  3049  * A custom react Context consumer exposing the provided `registry` to
  3103  * A custom react Context consumer exposing the provided `registry` to
  3050  * children components. Used along with the RegistryProvider.
  3104  * children components. Used along with the RegistryProvider.
  3051  *
  3105  *
  3052  * You can read more about the react context api here:
  3106  * You can read more about the react context api here:
  3053  * https://reactjs.org/docs/context.html#contextprovider
  3107  * https://reactjs.org/docs/context.html#contextprovider
  3054  *
  3108  *
  3055  * @example
  3109  * @example
  3056  * ```js
  3110  * ```js
  3057  * const {
  3111  * import {
  3058  *   RegistryProvider,
  3112  *   RegistryProvider,
  3059  *   RegistryConsumer,
  3113  *   RegistryConsumer,
  3060  *   createRegistry
  3114  *   createRegistry
  3061  * } = wp.data;
  3115  * } from '@wordpress/data';
  3062  *
  3116  *
  3063  * const registry = createRegistry( {} );
  3117  * const registry = createRegistry( {} );
  3064  *
  3118  *
  3065  * const App = ( { props } ) => {
  3119  * const App = ( { props } ) => {
  3066  *   return <RegistryProvider value={ registry }>
  3120  *   return <RegistryProvider value={ registry }>
  3075  *   </RegistryProvider>
  3129  *   </RegistryProvider>
  3076  * }
  3130  * }
  3077  * ```
  3131  * ```
  3078  */
  3132  */
  3079 
  3133 
  3080 var RegistryConsumer = Consumer;
  3134 const RegistryConsumer = Consumer;
  3081 /**
  3135 /**
  3082  * A custom Context provider for exposing the provided `registry` to children
  3136  * A custom Context provider for exposing the provided `registry` to children
  3083  * components via a consumer.
  3137  * components via a consumer.
  3084  *
  3138  *
  3085  * See <a name="#RegistryConsumer">RegistryConsumer</a> documentation for
  3139  * See <a name="#RegistryConsumer">RegistryConsumer</a> documentation for
  3106  * this hook.
  3160  * this hook.
  3107  *
  3161  *
  3108  * It acts similarly to the `useContext` react hook.
  3162  * It acts similarly to the `useContext` react hook.
  3109  *
  3163  *
  3110  * Note: Generally speaking, `useRegistry` is a low level hook that in most cases
  3164  * Note: Generally speaking, `useRegistry` is a low level hook that in most cases
  3111  * won't be needed for implementation. Most interactions with the wp.data api
  3165  * won't be needed for implementation. Most interactions with the `@wordpress/data`
  3112  * can be performed via the `useSelect` hook,  or the `withSelect` and
  3166  * API can be performed via the `useSelect` hook,  or the `withSelect` and
  3113  * `withDispatch` higher order components.
  3167  * `withDispatch` higher order components.
  3114  *
  3168  *
  3115  * @example
  3169  * @example
  3116  * ```js
  3170  * ```js
  3117  * const {
  3171  * import {
  3118  *   RegistryProvider,
  3172  *   RegistryProvider,
  3119  *   createRegistry,
  3173  *   createRegistry,
  3120  *   useRegistry,
  3174  *   useRegistry,
  3121  * } = wp.data
  3175  * } from '@wordpress/data';
  3122  *
  3176  *
  3123  * const registry = createRegistry( {} );
  3177  * const registry = createRegistry( {} );
  3124  *
  3178  *
  3125  * const SomeChildUsingRegistry = ( props ) => {
  3179  * const SomeChildUsingRegistry = ( props ) => {
  3126  *   const registry = useRegistry( registry );
  3180  *   const registry = useRegistry( registry );
  3137  *
  3191  *
  3138  * @return {Function}  A custom react hook exposing the registry context value.
  3192  * @return {Function}  A custom react hook exposing the registry context value.
  3139  */
  3193  */
  3140 
  3194 
  3141 function useRegistry() {
  3195 function useRegistry() {
  3142   return Object(external_this_wp_element_["useContext"])(Context);
  3196   return Object(external_wp_element_["useContext"])(Context);
  3143 }
  3197 }
  3144 
  3198 
  3145 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/async-mode-provider/context.js
  3199 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/async-mode-provider/context.js
  3146 /**
  3200 /**
  3147  * WordPress dependencies
  3201  * WordPress dependencies
  3148  */
  3202  */
  3149 
  3203 
  3150 var context_Context = Object(external_this_wp_element_["createContext"])(false);
  3204 const context_Context = Object(external_wp_element_["createContext"])(false);
  3151 var context_Consumer = context_Context.Consumer,
  3205 const {
  3152     context_Provider = context_Context.Provider;
  3206   Consumer: context_Consumer,
  3153 var AsyncModeConsumer = context_Consumer;
  3207   Provider: context_Provider
       
  3208 } = context_Context;
       
  3209 const AsyncModeConsumer = context_Consumer;
  3154 /**
  3210 /**
  3155  * Context Provider Component used to switch the data module component rerendering
  3211  * Context Provider Component used to switch the data module component rerendering
  3156  * between Sync and Async modes.
  3212  * between Sync and Async modes.
  3157  *
  3213  *
  3158  * @example
  3214  * @example
  3197  * Internal dependencies
  3253  * Internal dependencies
  3198  */
  3254  */
  3199 
  3255 
  3200 
  3256 
  3201 function useAsyncMode() {
  3257 function useAsyncMode() {
  3202   return Object(external_this_wp_element_["useContext"])(context_Context);
  3258   return Object(external_wp_element_["useContext"])(context_Context);
  3203 }
  3259 }
  3204 
  3260 
  3205 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/use-select/index.js
  3261 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/use-select/index.js
  3206 
       
  3207 
       
  3208 /**
  3262 /**
  3209  * External dependencies
  3263  * External dependencies
  3210  */
  3264  */
  3211 
  3265 
  3212 /**
  3266 /**
  3214  */
  3268  */
  3215 
  3269 
  3216 
  3270 
  3217 
  3271 
  3218 
  3272 
       
  3273 
  3219 /**
  3274 /**
  3220  * Internal dependencies
  3275  * Internal dependencies
  3221  */
  3276  */
  3222 
  3277 
  3223 
  3278 
  3224 
  3279 
  3225 /**
  3280 const renderQueue = Object(external_wp_priorityQueue_["createQueue"])();
  3226  * Favor useLayoutEffect to ensure the store subscription callback always has
  3281 /** @typedef {import('./types').WPDataStore} WPDataStore */
  3227  * the selector from the latest render. If a store update happens between render
  3282 
  3228  * and the effect, this could cause missed/stale updates or inconsistent state.
       
  3229  *
       
  3230  * Fallback to useEffect for server rendered components because currently React
       
  3231  * throws a warning when using useLayoutEffect in that environment.
       
  3232  */
       
  3233 
       
  3234 var useIsomorphicLayoutEffect = typeof window !== 'undefined' ? external_this_wp_element_["useLayoutEffect"] : external_this_wp_element_["useEffect"];
       
  3235 var renderQueue = Object(external_this_wp_priorityQueue_["createQueue"])();
       
  3236 /**
  3283 /**
  3237  * Custom react hook for retrieving props from registered selectors.
  3284  * Custom react hook for retrieving props from registered selectors.
  3238  *
  3285  *
  3239  * In general, this custom React hook follows the
  3286  * In general, this custom React hook follows the
  3240  * [rules of hooks](https://reactjs.org/docs/hooks-rules.html).
  3287  * [rules of hooks](https://reactjs.org/docs/hooks-rules.html).
  3241  *
  3288  *
  3242  * @param {Function} _mapSelect  Function called on every state change. The
  3289  * @param {Function|WPDataStore|string} _mapSelect  Function called on every state change. The
  3243  *                               returned value is exposed to the component
  3290  *                                                  returned value is exposed to the component
  3244  *                               implementing this hook. The function receives
  3291  *                                                  implementing this hook. The function receives
  3245  *                               the `registry.select` method on the first
  3292  *                                                  the `registry.select` method on the first
  3246  *                               argument and the `registry` on the second
  3293  *                                                  argument and the `registry` on the second
  3247  *                               argument.
  3294  *                                                  argument.
  3248  * @param {Array}    deps        If provided, this memoizes the mapSelect so the
  3295  *                                                  When a store key is passed, all selectors for
  3249  *                               same `mapSelect` is invoked on every state
  3296  *                                                  the store will be returned. This is only meant
  3250  *                               change unless the dependencies change.
  3297  *                                                  for usage of these selectors in event
       
  3298  *                                                  callbacks, not for data needed to create the
       
  3299  *                                                  element tree.
       
  3300  * @param {Array}                       deps        If provided, this memoizes the mapSelect so the
       
  3301  *                                                  same `mapSelect` is invoked on every state
       
  3302  *                                                  change unless the dependencies change.
  3251  *
  3303  *
  3252  * @example
  3304  * @example
  3253  * ```js
  3305  * ```js
  3254  * const { useSelect } = wp.data;
  3306  * import { useSelect } from '@wordpress/data';
  3255  *
  3307  *
  3256  * function HammerPriceDisplay( { currency } ) {
  3308  * function HammerPriceDisplay( { currency } ) {
  3257  *   const price = useSelect( ( select ) => {
  3309  *   const price = useSelect( ( select ) => {
  3258  *     return select( 'my-shop' ).getPrice( 'hammer', currency )
  3310  *     return select( 'my-shop' ).getPrice( 'hammer', currency )
  3259  *   }, [ currency ] );
  3311  *   }, [ currency ] );
  3272  * `mapSelect` callback on `useSelect`. If the currency prop changes then
  3324  * `mapSelect` callback on `useSelect`. If the currency prop changes then
  3273  * any price in the state for that currency is retrieved. If the currency prop
  3325  * any price in the state for that currency is retrieved. If the currency prop
  3274  * doesn't change and other props are passed in that do change, the price will
  3326  * doesn't change and other props are passed in that do change, the price will
  3275  * not change because the dependency is just the currency.
  3327  * not change because the dependency is just the currency.
  3276  *
  3328  *
       
  3329  * When data is only used in an event callback, the data should not be retrieved
       
  3330  * on render, so it may be useful to get the selectors function instead.
       
  3331  *
       
  3332  * **Don't use `useSelect` this way when calling the selectors in the render
       
  3333  * function because your component won't re-render on a data change.**
       
  3334  *
       
  3335  * ```js
       
  3336  * import { useSelect } from '@wordpress/data';
       
  3337  *
       
  3338  * function Paste( { children } ) {
       
  3339  *   const { getSettings } = useSelect( 'my-shop' );
       
  3340  *   function onPaste() {
       
  3341  *     // Do something with the settings.
       
  3342  *     const settings = getSettings();
       
  3343  *   }
       
  3344  *   return <div onPaste={ onPaste }>{ children }</div>;
       
  3345  * }
       
  3346  * ```
       
  3347  *
  3277  * @return {Function}  A custom react hook.
  3348  * @return {Function}  A custom react hook.
  3278  */
  3349  */
  3279 
  3350 
  3280 function useSelect(_mapSelect, deps) {
  3351 function useSelect(_mapSelect, deps) {
  3281   var mapSelect = Object(external_this_wp_element_["useCallback"])(_mapSelect, deps);
  3352   const isWithoutMapping = typeof _mapSelect !== 'function';
  3282   var registry = useRegistry();
  3353 
  3283   var isAsync = useAsyncMode(); // React can sometimes clear the `useMemo` cache.
  3354   if (isWithoutMapping) {
       
  3355     deps = [];
       
  3356   }
       
  3357 
       
  3358   const mapSelect = Object(external_wp_element_["useCallback"])(_mapSelect, deps);
       
  3359   const registry = useRegistry();
       
  3360   const isAsync = useAsyncMode(); // React can sometimes clear the `useMemo` cache.
  3284   // We use the cache-stable `useMemoOne` to avoid
  3361   // We use the cache-stable `useMemoOne` to avoid
  3285   // losing queues.
  3362   // losing queues.
  3286 
  3363 
  3287   var queueContext = useMemoOne(function () {
  3364   const queueContext = Object(use_memo_one_esm["a" /* useMemoOne */])(() => ({
  3288     return {
  3365     queue: true
  3289       queue: true
  3366   }), [registry]);
  3290     };
  3367   const [, forceRender] = Object(external_wp_element_["useReducer"])(s => s + 1, 0);
  3291   }, [registry]);
  3368   const latestMapSelect = Object(external_wp_element_["useRef"])();
  3292 
  3369   const latestIsAsync = Object(external_wp_element_["useRef"])(isAsync);
  3293   var _useReducer = Object(external_this_wp_element_["useReducer"])(function (s) {
  3370   const latestMapOutput = Object(external_wp_element_["useRef"])();
  3294     return s + 1;
  3371   const latestMapOutputError = Object(external_wp_element_["useRef"])();
  3295   }, 0),
  3372   const isMountedAndNotUnsubscribing = Object(external_wp_element_["useRef"])(); // Keep track of the stores being selected in the mapSelect function,
  3296       _useReducer2 = Object(slicedToArray["a" /* default */])(_useReducer, 2),
  3373   // and only subscribe to those stores later.
  3297       forceRender = _useReducer2[1];
  3374 
  3298 
  3375   const listeningStores = Object(external_wp_element_["useRef"])([]);
  3299   var latestMapSelect = Object(external_this_wp_element_["useRef"])();
  3376   const trapSelect = Object(external_wp_element_["useCallback"])(callback => registry.__experimentalMarkListeningStores(callback, listeningStores), [registry]); // Generate a "flag" for used in the effect dependency array.
  3300   var latestIsAsync = Object(external_this_wp_element_["useRef"])(isAsync);
  3377   // It's different than just using `mapSelect` since deps could be undefined,
  3301   var latestMapOutput = Object(external_this_wp_element_["useRef"])();
  3378   // in that case, we would still want to memoize it.
  3302   var latestMapOutputError = Object(external_this_wp_element_["useRef"])();
  3379 
  3303   var isMountedAndNotUnsubscribing = Object(external_this_wp_element_["useRef"])();
  3380   const depsChangedFlag = Object(external_wp_element_["useMemo"])(() => ({}), deps || []);
  3304   var mapOutput;
  3381   let mapOutput;
  3305 
  3382 
  3306   try {
  3383   if (!isWithoutMapping) {
  3307     if (latestMapSelect.current !== mapSelect || latestMapOutputError.current) {
  3384     try {
  3308       mapOutput = mapSelect(registry.select, registry);
  3385       if (latestMapSelect.current !== mapSelect || latestMapOutputError.current) {
  3309     } else {
  3386         mapOutput = trapSelect(() => mapSelect(registry.select, registry));
       
  3387       } else {
       
  3388         mapOutput = latestMapOutput.current;
       
  3389       }
       
  3390     } catch (error) {
       
  3391       let errorMessage = `An error occurred while running 'mapSelect': ${error.message}`;
       
  3392 
       
  3393       if (latestMapOutputError.current) {
       
  3394         errorMessage += `\nThe error may be correlated with this previous error:\n`;
       
  3395         errorMessage += `${latestMapOutputError.current.stack}\n\n`;
       
  3396         errorMessage += 'Original stack trace:';
       
  3397       } // eslint-disable-next-line no-console
       
  3398 
       
  3399 
       
  3400       console.error(errorMessage);
  3310       mapOutput = latestMapOutput.current;
  3401       mapOutput = latestMapOutput.current;
  3311     }
  3402     }
  3312   } catch (error) {
  3403   }
  3313     var errorMessage = "An error occurred while running 'mapSelect': ".concat(error.message);
  3404 
  3314 
  3405   Object(external_wp_compose_["useIsomorphicLayoutEffect"])(() => {
  3315     if (latestMapOutputError.current) {
  3406     if (isWithoutMapping) {
  3316       errorMessage += "\nThe error may be correlated with this previous error:\n";
  3407       return;
  3317       errorMessage += "".concat(latestMapOutputError.current.stack, "\n\n");
  3408     }
  3318       errorMessage += 'Original stack trace:';
  3409 
  3319       throw new Error(errorMessage);
       
  3320     } else {
       
  3321       // eslint-disable-next-line no-console
       
  3322       console.error(errorMessage);
       
  3323     }
       
  3324   }
       
  3325 
       
  3326   useIsomorphicLayoutEffect(function () {
       
  3327     latestMapSelect.current = mapSelect;
  3410     latestMapSelect.current = mapSelect;
  3328     latestMapOutput.current = mapOutput;
  3411     latestMapOutput.current = mapOutput;
  3329     latestMapOutputError.current = undefined;
  3412     latestMapOutputError.current = undefined;
  3330     isMountedAndNotUnsubscribing.current = true; // This has to run after the other ref updates
  3413     isMountedAndNotUnsubscribing.current = true; // This has to run after the other ref updates
  3331     // to avoid using stale values in the flushed
  3414     // to avoid using stale values in the flushed
  3335     if (latestIsAsync.current !== isAsync) {
  3418     if (latestIsAsync.current !== isAsync) {
  3336       latestIsAsync.current = isAsync;
  3419       latestIsAsync.current = isAsync;
  3337       renderQueue.flush(queueContext);
  3420       renderQueue.flush(queueContext);
  3338     }
  3421     }
  3339   });
  3422   });
  3340   useIsomorphicLayoutEffect(function () {
  3423   Object(external_wp_compose_["useIsomorphicLayoutEffect"])(() => {
  3341     var onStoreChange = function onStoreChange() {
  3424     if (isWithoutMapping) {
       
  3425       return;
       
  3426     }
       
  3427 
       
  3428     const onStoreChange = () => {
  3342       if (isMountedAndNotUnsubscribing.current) {
  3429       if (isMountedAndNotUnsubscribing.current) {
  3343         try {
  3430         try {
  3344           var newMapOutput = latestMapSelect.current(registry.select, registry);
  3431           const newMapOutput = trapSelect(() => latestMapSelect.current(registry.select, registry));
  3345 
  3432 
  3346           if (external_this_wp_isShallowEqual_default()(latestMapOutput.current, newMapOutput)) {
  3433           if (external_wp_isShallowEqual_default()(latestMapOutput.current, newMapOutput)) {
  3347             return;
  3434             return;
  3348           }
  3435           }
  3349 
  3436 
  3350           latestMapOutput.current = newMapOutput;
  3437           latestMapOutput.current = newMapOutput;
  3351         } catch (error) {
  3438         } catch (error) {
  3362       renderQueue.add(queueContext, onStoreChange);
  3449       renderQueue.add(queueContext, onStoreChange);
  3363     } else {
  3450     } else {
  3364       onStoreChange();
  3451       onStoreChange();
  3365     }
  3452     }
  3366 
  3453 
  3367     var unsubscribe = registry.subscribe(function () {
  3454     const onChange = () => {
  3368       if (latestIsAsync.current) {
  3455       if (latestIsAsync.current) {
  3369         renderQueue.add(queueContext, onStoreChange);
  3456         renderQueue.add(queueContext, onStoreChange);
  3370       } else {
  3457       } else {
  3371         onStoreChange();
  3458         onStoreChange();
  3372       }
  3459       }
  3373     });
  3460     };
  3374     return function () {
  3461 
  3375       isMountedAndNotUnsubscribing.current = false;
  3462     const unsubscribers = listeningStores.current.map(storeName => registry.__experimentalSubscribeStore(storeName, onChange));
  3376       unsubscribe();
  3463     return () => {
       
  3464       isMountedAndNotUnsubscribing.current = false; // The return value of the subscribe function could be undefined if the store is a custom generic store.
       
  3465 
       
  3466       unsubscribers.forEach(unsubscribe => unsubscribe === null || unsubscribe === void 0 ? void 0 : unsubscribe());
  3377       renderQueue.flush(queueContext);
  3467       renderQueue.flush(queueContext);
  3378     };
  3468     };
  3379   }, [registry]);
  3469   }, [registry, trapSelect, depsChangedFlag, isWithoutMapping]);
  3380   return mapOutput;
  3470   return isWithoutMapping ? registry.select(_mapSelect) : mapOutput;
  3381 }
  3471 }
  3382 
  3472 
  3383 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/with-select/index.js
  3473 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/with-select/index.js
  3384 
  3474 
  3385 
  3475 
  3401  *                                   expected to return object of props to
  3491  *                                   expected to return object of props to
  3402  *                                   merge with the component's own props.
  3492  *                                   merge with the component's own props.
  3403  *
  3493  *
  3404  * @example
  3494  * @example
  3405  * ```js
  3495  * ```js
       
  3496  * import { withSelect } from '@wordpress/data';
       
  3497  *
  3406  * function PriceDisplay( { price, currency } ) {
  3498  * function PriceDisplay( { price, currency } ) {
  3407  * 	return new Intl.NumberFormat( 'en-US', {
  3499  * 	return new Intl.NumberFormat( 'en-US', {
  3408  * 		style: 'currency',
  3500  * 		style: 'currency',
  3409  * 		currency,
  3501  * 		currency,
  3410  * 	} ).format( price );
  3502  * 	} ).format( price );
  3411  * }
  3503  * }
  3412  *
       
  3413  * const { withSelect } = wp.data;
       
  3414  *
  3504  *
  3415  * const HammerPriceDisplay = withSelect( ( select, ownProps ) => {
  3505  * const HammerPriceDisplay = withSelect( ( select, ownProps ) => {
  3416  * 	const { getPrice } = select( 'my-shop' );
  3506  * 	const { getPrice } = select( 'my-shop' );
  3417  * 	const { currency } = ownProps;
  3507  * 	const { currency } = ownProps;
  3418  *
  3508  *
  3431  * the store.
  3521  * the store.
  3432  *
  3522  *
  3433  * @return {WPComponent} Enhanced component with merged state data props.
  3523  * @return {WPComponent} Enhanced component with merged state data props.
  3434  */
  3524  */
  3435 
  3525 
  3436 var with_select_withSelect = function withSelect(mapSelectToProps) {
  3526 const withSelect = mapSelectToProps => Object(external_wp_compose_["createHigherOrderComponent"])(WrappedComponent => Object(external_wp_compose_["pure"])(ownProps => {
  3437   return Object(external_this_wp_compose_["createHigherOrderComponent"])(function (WrappedComponent) {
  3527   const mapSelect = (select, registry) => mapSelectToProps(select, ownProps, registry);
  3438     return Object(external_this_wp_compose_["pure"])(function (ownProps) {
  3528 
  3439       var mapSelect = function mapSelect(select, registry) {
  3529   const mergeProps = useSelect(mapSelect);
  3440         return mapSelectToProps(select, ownProps, registry);
  3530   return Object(external_wp_element_["createElement"])(WrappedComponent, Object(esm_extends["a" /* default */])({}, ownProps, mergeProps));
  3441       };
  3531 }), 'withSelect');
  3442 
  3532 
  3443       var mergeProps = useSelect(mapSelect);
  3533 /* harmony default export */ var with_select = (withSelect);
  3444       return Object(external_this_wp_element_["createElement"])(WrappedComponent, Object(esm_extends["a" /* default */])({}, ownProps, mergeProps));
       
  3445     });
       
  3446   }, 'withSelect');
       
  3447 };
       
  3448 
       
  3449 /* harmony default export */ var with_select = (with_select_withSelect);
       
  3450 
  3534 
  3451 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/use-dispatch/use-dispatch-with-map.js
  3535 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/use-dispatch/use-dispatch-with-map.js
  3452 
       
  3453 
       
  3454 /**
  3536 /**
  3455  * External dependencies
  3537  * External dependencies
  3456  */
  3538  */
  3457 
  3539 
  3458 /**
  3540 /**
  3459  * WordPress dependencies
  3541  * WordPress dependencies
  3460  */
  3542  */
  3461 
  3543 
  3462 
  3544 
       
  3545 
  3463 /**
  3546 /**
  3464  * Internal dependencies
  3547  * Internal dependencies
  3465  */
  3548  */
  3466 
  3549 
  3467 
  3550 
  3468 /**
       
  3469  * Favor useLayoutEffect to ensure the store subscription callback always has
       
  3470  * the dispatchMap from the latest render. If a store update happens between
       
  3471  * render and the effect, this could cause missed/stale updates or
       
  3472  * inconsistent state.
       
  3473  *
       
  3474  * Fallback to useEffect for server rendered components because currently React
       
  3475  * throws a warning when using useLayoutEffect in that environment.
       
  3476  */
       
  3477 
       
  3478 var use_dispatch_with_map_useIsomorphicLayoutEffect = typeof window !== 'undefined' ? external_this_wp_element_["useLayoutEffect"] : external_this_wp_element_["useEffect"];
       
  3479 /**
  3551 /**
  3480  * Custom react hook for returning aggregate dispatch actions using the provided
  3552  * Custom react hook for returning aggregate dispatch actions using the provided
  3481  * dispatchMap.
  3553  * dispatchMap.
  3482  *
  3554  *
  3483  * Currently this is an internal api only and is implemented by `withDispatch`
  3555  * Currently this is an internal api only and is implemented by `withDispatch`
  3489  * @param {Array}    deps         An array of dependencies for the hook.
  3561  * @param {Array}    deps         An array of dependencies for the hook.
  3490  * @return {Object}  An object mapping props to functions created by the passed
  3562  * @return {Object}  An object mapping props to functions created by the passed
  3491  *                   in dispatchMap.
  3563  *                   in dispatchMap.
  3492  */
  3564  */
  3493 
  3565 
  3494 var use_dispatch_with_map_useDispatchWithMap = function useDispatchWithMap(dispatchMap, deps) {
  3566 const useDispatchWithMap = (dispatchMap, deps) => {
  3495   var registry = useRegistry();
  3567   const registry = useRegistry();
  3496   var currentDispatchMap = Object(external_this_wp_element_["useRef"])(dispatchMap);
  3568   const currentDispatchMap = Object(external_wp_element_["useRef"])(dispatchMap);
  3497   use_dispatch_with_map_useIsomorphicLayoutEffect(function () {
  3569   Object(external_wp_compose_["useIsomorphicLayoutEffect"])(() => {
  3498     currentDispatchMap.current = dispatchMap;
  3570     currentDispatchMap.current = dispatchMap;
  3499   });
  3571   });
  3500   return Object(external_this_wp_element_["useMemo"])(function () {
  3572   return Object(external_wp_element_["useMemo"])(() => {
  3501     var currentDispatchProps = currentDispatchMap.current(registry.dispatch, registry);
  3573     const currentDispatchProps = currentDispatchMap.current(registry.dispatch, registry);
  3502     return Object(external_this_lodash_["mapValues"])(currentDispatchProps, function (dispatcher, propName) {
  3574     return Object(external_lodash_["mapValues"])(currentDispatchProps, (dispatcher, propName) => {
  3503       if (typeof dispatcher !== 'function') {
  3575       if (typeof dispatcher !== 'function') {
  3504         // eslint-disable-next-line no-console
  3576         // eslint-disable-next-line no-console
  3505         console.warn("Property ".concat(propName, " returned from dispatchMap in useDispatchWithMap must be a function."));
  3577         console.warn(`Property ${propName} returned from dispatchMap in useDispatchWithMap must be a function.`);
  3506       }
  3578       }
  3507 
  3579 
  3508       return function () {
  3580       return (...args) => currentDispatchMap.current(registry.dispatch, registry)[propName](...args);
  3509         var _currentDispatchMap$c;
       
  3510 
       
  3511         return (_currentDispatchMap$c = currentDispatchMap.current(registry.dispatch, registry))[propName].apply(_currentDispatchMap$c, arguments);
       
  3512       };
       
  3513     });
  3581     });
  3514   }, [registry].concat(Object(toConsumableArray["a" /* default */])(deps)));
  3582   }, [registry, ...deps]);
  3515 };
  3583 };
  3516 
  3584 
  3517 /* harmony default export */ var use_dispatch_with_map = (use_dispatch_with_map_useDispatchWithMap);
  3585 /* harmony default export */ var use_dispatch_with_map = (useDispatchWithMap);
  3518 
  3586 
  3519 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/with-dispatch/index.js
  3587 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/with-dispatch/index.js
  3520 
  3588 
  3521 
  3589 
  3522 
  3590 
  3544  * ```jsx
  3612  * ```jsx
  3545  * function Button( { onClick, children } ) {
  3613  * function Button( { onClick, children } ) {
  3546  *     return <button type="button" onClick={ onClick }>{ children }</button>;
  3614  *     return <button type="button" onClick={ onClick }>{ children }</button>;
  3547  * }
  3615  * }
  3548  *
  3616  *
  3549  * const { withDispatch } = wp.data;
  3617  * import { withDispatch } from '@wordpress/data';
  3550  *
  3618  *
  3551  * const SaleButton = withDispatch( ( dispatch, ownProps ) => {
  3619  * const SaleButton = withDispatch( ( dispatch, ownProps ) => {
  3552  *     const { startSale } = dispatch( 'my-shop' );
  3620  *     const { startSale } = dispatch( 'my-shop' );
  3553  *     const { discountPercent } = ownProps;
  3621  *     const { discountPercent } = ownProps;
  3554  *
  3622  *
  3581  * ```jsx
  3649  * ```jsx
  3582  * function Button( { onClick, children } ) {
  3650  * function Button( { onClick, children } ) {
  3583  *     return <button type="button" onClick={ onClick }>{ children }</button>;
  3651  *     return <button type="button" onClick={ onClick }>{ children }</button>;
  3584  * }
  3652  * }
  3585  *
  3653  *
  3586  * const { withDispatch } = wp.data;
  3654  * import { withDispatch } from '@wordpress/data';
  3587  *
  3655  *
  3588  * const SaleButton = withDispatch( ( dispatch, ownProps, { select } ) => {
  3656  * const SaleButton = withDispatch( ( dispatch, ownProps, { select } ) => {
  3589  *    // Stock number changes frequently.
  3657  *    // Stock number changes frequently.
  3590  *    const { getStockNumber } = select( 'my-shop' );
  3658  *    const { getStockNumber } = select( 'my-shop' );
  3591  *    const { startSale } = dispatch( 'my-shop' );
  3659  *    const { startSale } = dispatch( 'my-shop' );
  3607  * conditions under which a different value would be returned.
  3675  * conditions under which a different value would be returned.
  3608  *
  3676  *
  3609  * @return {WPComponent} Enhanced component with merged dispatcher props.
  3677  * @return {WPComponent} Enhanced component with merged dispatcher props.
  3610  */
  3678  */
  3611 
  3679 
  3612 var with_dispatch_withDispatch = function withDispatch(mapDispatchToProps) {
  3680 const withDispatch = mapDispatchToProps => Object(external_wp_compose_["createHigherOrderComponent"])(WrappedComponent => ownProps => {
  3613   return Object(external_this_wp_compose_["createHigherOrderComponent"])(function (WrappedComponent) {
  3681   const mapDispatch = (dispatch, registry) => mapDispatchToProps(dispatch, ownProps, registry);
  3614     return function (ownProps) {
  3682 
  3615       var mapDispatch = function mapDispatch(dispatch, registry) {
  3683   const dispatchProps = use_dispatch_with_map(mapDispatch, []);
  3616         return mapDispatchToProps(dispatch, ownProps, registry);
  3684   return Object(external_wp_element_["createElement"])(WrappedComponent, Object(esm_extends["a" /* default */])({}, ownProps, dispatchProps));
  3617       };
  3685 }, 'withDispatch');
  3618 
  3686 
  3619       var dispatchProps = use_dispatch_with_map(mapDispatch, []);
  3687 /* harmony default export */ var with_dispatch = (withDispatch);
  3620       return Object(external_this_wp_element_["createElement"])(WrappedComponent, Object(esm_extends["a" /* default */])({}, ownProps, dispatchProps));
       
  3621     };
       
  3622   }, 'withDispatch');
       
  3623 };
       
  3624 
       
  3625 /* harmony default export */ var with_dispatch = (with_dispatch_withDispatch);
       
  3626 
  3688 
  3627 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/with-registry/index.js
  3689 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/with-registry/index.js
  3628 
  3690 
  3629 
  3691 
  3630 
  3692 
  3644  * @param {WPComponent} OriginalComponent Original component.
  3706  * @param {WPComponent} OriginalComponent Original component.
  3645  *
  3707  *
  3646  * @return {WPComponent} Enhanced component.
  3708  * @return {WPComponent} Enhanced component.
  3647  */
  3709  */
  3648 
  3710 
  3649 var withRegistry = Object(external_this_wp_compose_["createHigherOrderComponent"])(function (OriginalComponent) {
  3711 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, {
  3650   return function (props) {
  3712   registry: registry
  3651     return Object(external_this_wp_element_["createElement"])(RegistryConsumer, null, function (registry) {
  3713 }))), 'withRegistry');
  3652       return Object(external_this_wp_element_["createElement"])(OriginalComponent, Object(esm_extends["a" /* default */])({}, props, {
       
  3653         registry: registry
       
  3654       }));
       
  3655     });
       
  3656   };
       
  3657 }, 'withRegistry');
       
  3658 /* harmony default export */ var with_registry = (withRegistry);
  3714 /* harmony default export */ var with_registry = (withRegistry);
  3659 
  3715 
  3660 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/use-dispatch/use-dispatch.js
  3716 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/use-dispatch/use-dispatch.js
  3661 /**
  3717 /**
  3662  * Internal dependencies
  3718  * Internal dependencies
  3663  */
  3719  */
       
  3720 
       
  3721 /** @typedef {import('./types').WPDataStore} WPDataStore */
  3664 
  3722 
  3665 /**
  3723 /**
  3666  * A custom react hook returning the current registry dispatch actions creators.
  3724  * A custom react hook returning the current registry dispatch actions creators.
  3667  *
  3725  *
  3668  * Note: The component using this hook must be within the context of a
  3726  * Note: The component using this hook must be within the context of a
  3669  * RegistryProvider.
  3727  * RegistryProvider.
  3670  *
  3728  *
  3671  * @param {string} [storeName]  Optionally provide the name of the store from
  3729  * @param {string|WPDataStore} [storeNameOrDefinition] Optionally provide the name of the
  3672  *                             which to retrieve action creators. If not
  3730  *                                                     store or its definition from which to
  3673  *                             provided, the registry.dispatch function is
  3731  *                                                     retrieve action creators. If not
  3674  *                             returned instead.
  3732  *                                                     provided, the registry.dispatch
       
  3733  *                                                     function is returned instead.
  3675  *
  3734  *
  3676  * @example
  3735  * @example
  3677  * This illustrates a pattern where you may need to retrieve dynamic data from
  3736  * This illustrates a pattern where you may need to retrieve dynamic data from
  3678  * the server via the `useSelect` hook to use in combination with the dispatch
  3737  * the server via the `useSelect` hook to use in combination with the dispatch
  3679  * action.
  3738  * action.
  3680  *
  3739  *
  3681  * ```jsx
  3740  * ```jsx
  3682  * const { useDispatch, useSelect } = wp.data;
  3741  * import { useDispatch, useSelect } from '@wordpress/data';
  3683  * const { useCallback } = wp.element;
  3742  * import { useCallback } from '@wordpress/element';
  3684  *
  3743  *
  3685  * function Button( { onClick, children } ) {
  3744  * function Button( { onClick, children } ) {
  3686  *   return <button type="button" onClick={ onClick }>{ children }</button>
  3745  *   return <button type="button" onClick={ onClick }>{ children }</button>
  3687  * }
  3746  * }
  3688  *
  3747  *
  3704  * // <SaleButton>Start Sale!</SaleButton>
  3763  * // <SaleButton>Start Sale!</SaleButton>
  3705  * ```
  3764  * ```
  3706  * @return {Function}  A custom react hook.
  3765  * @return {Function}  A custom react hook.
  3707  */
  3766  */
  3708 
  3767 
  3709 var use_dispatch_useDispatch = function useDispatch(storeName) {
  3768 const useDispatch = storeNameOrDefinition => {
  3710   var _useRegistry = useRegistry(),
  3769   const {
  3711       dispatch = _useRegistry.dispatch;
  3770     dispatch
  3712 
  3771   } = useRegistry();
  3713   return storeName === void 0 ? dispatch : dispatch(storeName);
  3772   return storeNameOrDefinition === void 0 ? dispatch : dispatch(storeNameOrDefinition);
  3714 };
  3773 };
  3715 
  3774 
  3716 /* harmony default export */ var use_dispatch = (use_dispatch_useDispatch);
  3775 /* harmony default export */ var use_dispatch = (useDispatch);
  3717 
  3776 
  3718 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/factory.js
  3777 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/index.js
       
  3778 /**
       
  3779  * External dependencies
       
  3780  */
       
  3781 
  3719 /**
  3782 /**
  3720  * Internal dependencies
  3783  * Internal dependencies
  3721  */
  3784  */
  3722 
  3785 
  3723 /** @typedef {import('./registry').WPDataRegistry} WPDataRegistry */
  3786 
  3724 
  3787 
  3725 /**
  3788 /** @typedef {import('./types').WPDataStore} WPDataStore */
  3726  * Mark a selector as a registry selector.
       
  3727  *
       
  3728  * @param {Function} registrySelector Function receiving a registry object and returning a state selector.
       
  3729  *
       
  3730  * @return {Function} marked registry selector.
       
  3731  */
       
  3732 
       
  3733 function createRegistrySelector(registrySelector) {
       
  3734   var selector = function selector() {
       
  3735     return registrySelector(selector.registry.select).apply(void 0, arguments);
       
  3736   };
       
  3737   /**
       
  3738    * Flag indicating to selector registration mapping that the selector should
       
  3739    * be mapped as a registry selector.
       
  3740    *
       
  3741    * @type {boolean}
       
  3742    */
       
  3743 
       
  3744 
       
  3745   selector.isRegistrySelector = true;
       
  3746   /**
       
  3747    * Registry on which to call `select`, stubbed for non-standard usage to
       
  3748    * use the default registry.
       
  3749    *
       
  3750    * @type {WPDataRegistry}
       
  3751    */
       
  3752 
       
  3753   selector.registry = default_registry;
       
  3754   return selector;
       
  3755 }
       
  3756 /**
       
  3757  * Mark a control as a registry control.
       
  3758  *
       
  3759  * @param {Function} registryControl Function receiving a registry object and returning a control.
       
  3760  *
       
  3761  * @return {Function} marked registry control.
       
  3762  */
       
  3763 
       
  3764 function createRegistryControl(registryControl) {
       
  3765   registryControl.isRegistryControl = true;
       
  3766   return registryControl;
       
  3767 }
       
  3768 
       
  3769 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/index.js
       
  3770 /**
       
  3771  * External dependencies
       
  3772  */
       
  3773 
       
  3774 /**
       
  3775  * Internal dependencies
       
  3776  */
       
  3777 
  3789 
  3778 
  3790 
  3779 
  3791 
  3780 
  3792 
  3781 
  3793 
  3802  * @param {Object} reducers An object whose values correspond to different reducing
  3814  * @param {Object} reducers An object whose values correspond to different reducing
  3803  *                          functions that need to be combined into one.
  3815  *                          functions that need to be combined into one.
  3804  *
  3816  *
  3805  * @example
  3817  * @example
  3806  * ```js
  3818  * ```js
  3807  * const { combineReducers, registerStore } = wp.data;
  3819  * import { combineReducers, createReduxStore, register } from '@wordpress/data';
  3808  *
  3820  *
  3809  * const prices = ( state = {}, action ) => {
  3821  * const prices = ( state = {}, action ) => {
  3810  * 	return action.type === 'SET_PRICE' ?
  3822  * 	return action.type === 'SET_PRICE' ?
  3811  * 		{
  3823  * 		{
  3812  * 			...state,
  3824  * 			...state,
  3819  * 	return action.type === 'START_SALE' ?
  3831  * 	return action.type === 'START_SALE' ?
  3820  * 		action.discountPercent :
  3832  * 		action.discountPercent :
  3821  * 		state;
  3833  * 		state;
  3822  * };
  3834  * };
  3823  *
  3835  *
  3824  * registerStore( 'my-shop', {
  3836  * const store = createReduxStore( 'my-shop', {
  3825  * 	reducer: combineReducers( {
  3837  * 	reducer: combineReducers( {
  3826  * 		prices,
  3838  * 		prices,
  3827  * 		discountPercent,
  3839  * 		discountPercent,
  3828  * 	} ),
  3840  * 	} ),
  3829  * } );
  3841  * } );
       
  3842  * register( store );
  3830  * ```
  3843  * ```
  3831  *
  3844  *
  3832  * @return {Function}       A reducer that invokes every reducer inside the reducers
  3845  * @return {Function}       A reducer that invokes every reducer inside the reducers
  3833  *                          object, and constructs a state object with the same shape.
  3846  *                          object, and constructs a state object with the same shape.
  3834  */
  3847  */
  3835 
  3848 
  3836 
  3849 
  3837 /**
  3850 /**
  3838  * Given the name of a registered store, returns an object of the store's selectors.
  3851  * Given the name or definition of a registered store, returns an object of the store's selectors.
  3839  * The selector functions are been pre-bound to pass the current state automatically.
  3852  * The selector functions are been pre-bound to pass the current state automatically.
  3840  * As a consumer, you need only pass arguments of the selector, if applicable.
  3853  * As a consumer, you need only pass arguments of the selector, if applicable.
  3841  *
  3854  *
  3842  * @param {string} name Store name.
  3855  * @param {string|WPDataStore} storeNameOrDefinition Unique namespace identifier for the store
       
  3856  *                                                   or the store definition.
  3843  *
  3857  *
  3844  * @example
  3858  * @example
  3845  * ```js
  3859  * ```js
  3846  * const { select } = wp.data;
  3860  * import { select } from '@wordpress/data';
  3847  *
  3861  *
  3848  * select( 'my-shop' ).getPrice( 'hammer' );
  3862  * select( 'my-shop' ).getPrice( 'hammer' );
  3849  * ```
  3863  * ```
  3850  *
  3864  *
  3851  * @return {Object} Object containing the store's selectors.
  3865  * @return {Object} Object containing the store's selectors.
  3852  */
  3866  */
  3853 
  3867 
  3854 var build_module_select = default_registry.select;
  3868 const build_module_select = default_registry.select;
  3855 /**
  3869 /**
  3856  * Given the name of a registered store, returns an object containing the store's
  3870  * Given the name of a registered store, returns an object containing the store's
  3857  * selectors pre-bound to state so that you only need to supply additional arguments,
  3871  * selectors pre-bound to state so that you only need to supply additional arguments,
  3858  * and modified so that they return promises that resolve to their eventual values,
  3872  * and modified so that they return promises that resolve to their eventual values,
  3859  * after any resolvers have ran.
  3873  * after any resolvers have ran.
  3860  *
  3874  *
  3861  * @param {string} name Store name.
  3875  * @param {string|WPDataStore} storeNameOrDefinition Unique namespace identifier for the store
       
  3876  *                                                   or the store definition.
  3862  *
  3877  *
  3863  * @example
  3878  * @example
  3864  * ```js
  3879  * ```js
  3865  * const { __experimentalResolveSelect } = wp.data;
  3880  * import { resolveSelect } from '@wordpress/data';
  3866  *
  3881  *
  3867  * __experimentalResolveSelect( 'my-shop' ).getPrice( 'hammer' ).then(console.log)
  3882  * resolveSelect( 'my-shop' ).getPrice( 'hammer' ).then(console.log)
  3868  * ```
  3883  * ```
  3869  *
  3884  *
  3870  * @return {Object} Object containing the store's promise-wrapped selectors.
  3885  * @return {Object} Object containing the store's promise-wrapped selectors.
  3871  */
  3886  */
  3872 
  3887 
  3873 var build_module_experimentalResolveSelect = default_registry.__experimentalResolveSelect;
  3888 const build_module_resolveSelect = default_registry.resolveSelect;
  3874 /**
  3889 /**
  3875  * Given the name of a registered store, returns an object of the store's action creators.
  3890  * Given the name of a registered store, returns an object of the store's action creators.
  3876  * Calling an action creator will cause it to be dispatched, updating the state value accordingly.
  3891  * Calling an action creator will cause it to be dispatched, updating the state value accordingly.
  3877  *
  3892  *
  3878  * Note: Action creators returned by the dispatch will return a promise when
  3893  * Note: Action creators returned by the dispatch will return a promise when
  3879  * they are called.
  3894  * they are called.
  3880  *
  3895  *
  3881  * @param {string} name Store name.
  3896  * @param {string|WPDataStore} storeNameOrDefinition Unique namespace identifier for the store
       
  3897  *                                                   or the store definition.
  3882  *
  3898  *
  3883  * @example
  3899  * @example
  3884  * ```js
  3900  * ```js
  3885  * const { dispatch } = wp.data;
  3901  * import { dispatch } from '@wordpress/data';
  3886  *
  3902  *
  3887  * dispatch( 'my-shop' ).setPrice( 'hammer', 9.75 );
  3903  * dispatch( 'my-shop' ).setPrice( 'hammer', 9.75 );
  3888  * ```
  3904  * ```
  3889  * @return {Object} Object containing the action creators.
  3905  * @return {Object} Object containing the action creators.
  3890  */
  3906  */
  3891 
  3907 
  3892 var build_module_dispatch = default_registry.dispatch;
  3908 const build_module_dispatch = default_registry.dispatch;
  3893 /**
  3909 /**
  3894  * Given a listener function, the function will be called any time the state value
  3910  * Given a listener function, the function will be called any time the state value
  3895  * of one of the registered stores has changed. This function returns a `unsubscribe`
  3911  * of one of the registered stores has changed. This function returns a `unsubscribe`
  3896  * function used to stop the subscription.
  3912  * function used to stop the subscription.
  3897  *
  3913  *
  3898  * @param {Function} listener Callback function.
  3914  * @param {Function} listener Callback function.
  3899  *
  3915  *
  3900  * @example
  3916  * @example
  3901  * ```js
  3917  * ```js
  3902  * const { subscribe } = wp.data;
  3918  * import { subscribe } from '@wordpress/data';
  3903  *
  3919  *
  3904  * const unsubscribe = subscribe( () => {
  3920  * const unsubscribe = subscribe( () => {
  3905  * 	// You could use this opportunity to test whether the derived result of a
  3921  * 	// You could use this opportunity to test whether the derived result of a
  3906  * 	// selector has subsequently changed as the result of a state update.
  3922  * 	// selector has subsequently changed as the result of a state update.
  3907  * } );
  3923  * } );
  3909  * // Later, if necessary...
  3925  * // Later, if necessary...
  3910  * unsubscribe();
  3926  * unsubscribe();
  3911  * ```
  3927  * ```
  3912  */
  3928  */
  3913 
  3929 
  3914 var build_module_subscribe = default_registry.subscribe;
  3930 const build_module_subscribe = default_registry.subscribe;
  3915 /**
  3931 /**
  3916  * Registers a generic store.
  3932  * Registers a generic store.
       
  3933  *
       
  3934  * @deprecated Use `register` instead.
  3917  *
  3935  *
  3918  * @param {string} key    Store registry key.
  3936  * @param {string} key    Store registry key.
  3919  * @param {Object} config Configuration (getSelectors, getActions, subscribe).
  3937  * @param {Object} config Configuration (getSelectors, getActions, subscribe).
  3920  */
  3938  */
  3921 
  3939 
  3922 var build_module_registerGenericStore = default_registry.registerGenericStore;
  3940 const build_module_registerGenericStore = default_registry.registerGenericStore;
  3923 /**
  3941 /**
  3924  * Registers a standard `@wordpress/data` store.
  3942  * Registers a standard `@wordpress/data` store.
  3925  *
  3943  *
  3926  * @param {string} reducerKey Reducer key.
  3944  * @deprecated Use `register` instead.
  3927  * @param {Object} options    Store description (reducer, actions, selectors, resolvers).
  3945  *
       
  3946  * @param {string} storeName Unique namespace identifier for the store.
       
  3947  * @param {Object} options   Store description (reducer, actions, selectors, resolvers).
  3928  *
  3948  *
  3929  * @return {Object} Registered store object.
  3949  * @return {Object} Registered store object.
  3930  */
  3950  */
  3931 
  3951 
  3932 var build_module_registerStore = default_registry.registerStore;
  3952 const registerStore = default_registry.registerStore;
  3933 /**
  3953 /**
  3934  * Extends a registry to inherit functionality provided by a given plugin. A
  3954  * Extends a registry to inherit functionality provided by a given plugin. A
  3935  * plugin is an object with properties aligning to that of a registry, merged
  3955  * plugin is an object with properties aligning to that of a registry, merged
  3936  * to extend the default registry behavior.
  3956  * to extend the default registry behavior.
  3937  *
  3957  *
  3938  * @param {Object} plugin Plugin object.
  3958  * @param {Object} plugin Plugin object.
  3939  */
  3959  */
  3940 
  3960 
  3941 var build_module_use = default_registry.use;
  3961 const build_module_use = default_registry.use;
       
  3962 /**
       
  3963  * Registers a standard `@wordpress/data` store definition.
       
  3964  *
       
  3965  * @example
       
  3966  * ```js
       
  3967  * import { createReduxStore, register } from '@wordpress/data';
       
  3968  *
       
  3969  * const store = createReduxStore( 'demo', {
       
  3970  *     reducer: ( state = 'OK' ) => state,
       
  3971  *     selectors: {
       
  3972  *         getValue: ( state ) => state,
       
  3973  *     },
       
  3974  * } );
       
  3975  * register( store );
       
  3976  * ```
       
  3977  *
       
  3978  * @param {WPDataStore} store Store definition.
       
  3979  */
       
  3980 
       
  3981 const build_module_register = default_registry.register;
  3942 
  3982 
  3943 
  3983 
  3944 /***/ }),
  3984 /***/ }),
  3945 
  3985 
  3946 /***/ 5:
  3986 /***/ "rl8x":
  3947 /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3987 /***/ (function(module, exports) {
  3948 
  3988 
  3949 "use strict";
  3989 (function() { module.exports = window["wp"]["isShallowEqual"]; }());
  3950 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _defineProperty; });
       
  3951 function _defineProperty(obj, key, value) {
       
  3952   if (key in obj) {
       
  3953     Object.defineProperty(obj, key, {
       
  3954       value: value,
       
  3955       enumerable: true,
       
  3956       configurable: true,
       
  3957       writable: true
       
  3958     });
       
  3959   } else {
       
  3960     obj[key] = value;
       
  3961   }
       
  3962 
       
  3963   return obj;
       
  3964 }
       
  3965 
  3990 
  3966 /***/ }),
  3991 /***/ }),
  3967 
  3992 
  3968 /***/ 50:
  3993 /***/ "wx14":
  3969 /***/ (function(module, __webpack_exports__, __webpack_require__) {
       
  3970 
       
  3971 "use strict";
       
  3972 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _asyncToGenerator; });
       
  3973 function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
       
  3974   try {
       
  3975     var info = gen[key](arg);
       
  3976     var value = info.value;
       
  3977   } catch (error) {
       
  3978     reject(error);
       
  3979     return;
       
  3980   }
       
  3981 
       
  3982   if (info.done) {
       
  3983     resolve(value);
       
  3984   } else {
       
  3985     Promise.resolve(value).then(_next, _throw);
       
  3986   }
       
  3987 }
       
  3988 
       
  3989 function _asyncToGenerator(fn) {
       
  3990   return function () {
       
  3991     var self = this,
       
  3992         args = arguments;
       
  3993     return new Promise(function (resolve, reject) {
       
  3994       var gen = fn.apply(self, args);
       
  3995 
       
  3996       function _next(value) {
       
  3997         asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
       
  3998       }
       
  3999 
       
  4000       function _throw(err) {
       
  4001         asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
       
  4002       }
       
  4003 
       
  4004       _next(undefined);
       
  4005     });
       
  4006   };
       
  4007 }
       
  4008 
       
  4009 /***/ }),
       
  4010 
       
  4011 /***/ 60:
       
  4012 /***/ (function(module, exports, __webpack_require__) {
       
  4013 
       
  4014 /**
       
  4015  * Memize options object.
       
  4016  *
       
  4017  * @typedef MemizeOptions
       
  4018  *
       
  4019  * @property {number} [maxSize] Maximum size of the cache.
       
  4020  */
       
  4021 
       
  4022 /**
       
  4023  * Internal cache entry.
       
  4024  *
       
  4025  * @typedef MemizeCacheNode
       
  4026  *
       
  4027  * @property {?MemizeCacheNode|undefined} [prev] Previous node.
       
  4028  * @property {?MemizeCacheNode|undefined} [next] Next node.
       
  4029  * @property {Array<*>}                   args   Function arguments for cache
       
  4030  *                                               entry.
       
  4031  * @property {*}                          val    Function result.
       
  4032  */
       
  4033 
       
  4034 /**
       
  4035  * Properties of the enhanced function for controlling cache.
       
  4036  *
       
  4037  * @typedef MemizeMemoizedFunction
       
  4038  *
       
  4039  * @property {()=>void} clear Clear the cache.
       
  4040  */
       
  4041 
       
  4042 /**
       
  4043  * Accepts a function to be memoized, and returns a new memoized function, with
       
  4044  * optional options.
       
  4045  *
       
  4046  * @template {Function} F
       
  4047  *
       
  4048  * @param {F}             fn        Function to memoize.
       
  4049  * @param {MemizeOptions} [options] Options object.
       
  4050  *
       
  4051  * @return {F & MemizeMemoizedFunction} Memoized function.
       
  4052  */
       
  4053 function memize( fn, options ) {
       
  4054 	var size = 0;
       
  4055 
       
  4056 	/** @type {?MemizeCacheNode|undefined} */
       
  4057 	var head;
       
  4058 
       
  4059 	/** @type {?MemizeCacheNode|undefined} */
       
  4060 	var tail;
       
  4061 
       
  4062 	options = options || {};
       
  4063 
       
  4064 	function memoized( /* ...args */ ) {
       
  4065 		var node = head,
       
  4066 			len = arguments.length,
       
  4067 			args, i;
       
  4068 
       
  4069 		searchCache: while ( node ) {
       
  4070 			// Perform a shallow equality test to confirm that whether the node
       
  4071 			// under test is a candidate for the arguments passed. Two arrays
       
  4072 			// are shallowly equal if their length matches and each entry is
       
  4073 			// strictly equal between the two sets. Avoid abstracting to a
       
  4074 			// function which could incur an arguments leaking deoptimization.
       
  4075 
       
  4076 			// Check whether node arguments match arguments length
       
  4077 			if ( node.args.length !== arguments.length ) {
       
  4078 				node = node.next;
       
  4079 				continue;
       
  4080 			}
       
  4081 
       
  4082 			// Check whether node arguments match arguments values
       
  4083 			for ( i = 0; i < len; i++ ) {
       
  4084 				if ( node.args[ i ] !== arguments[ i ] ) {
       
  4085 					node = node.next;
       
  4086 					continue searchCache;
       
  4087 				}
       
  4088 			}
       
  4089 
       
  4090 			// At this point we can assume we've found a match
       
  4091 
       
  4092 			// Surface matched node to head if not already
       
  4093 			if ( node !== head ) {
       
  4094 				// As tail, shift to previous. Must only shift if not also
       
  4095 				// head, since if both head and tail, there is no previous.
       
  4096 				if ( node === tail ) {
       
  4097 					tail = node.prev;
       
  4098 				}
       
  4099 
       
  4100 				// Adjust siblings to point to each other. If node was tail,
       
  4101 				// this also handles new tail's empty `next` assignment.
       
  4102 				/** @type {MemizeCacheNode} */ ( node.prev ).next = node.next;
       
  4103 				if ( node.next ) {
       
  4104 					node.next.prev = node.prev;
       
  4105 				}
       
  4106 
       
  4107 				node.next = head;
       
  4108 				node.prev = null;
       
  4109 				/** @type {MemizeCacheNode} */ ( head ).prev = node;
       
  4110 				head = node;
       
  4111 			}
       
  4112 
       
  4113 			// Return immediately
       
  4114 			return node.val;
       
  4115 		}
       
  4116 
       
  4117 		// No cached value found. Continue to insertion phase:
       
  4118 
       
  4119 		// Create a copy of arguments (avoid leaking deoptimization)
       
  4120 		args = new Array( len );
       
  4121 		for ( i = 0; i < len; i++ ) {
       
  4122 			args[ i ] = arguments[ i ];
       
  4123 		}
       
  4124 
       
  4125 		node = {
       
  4126 			args: args,
       
  4127 
       
  4128 			// Generate the result from original function
       
  4129 			val: fn.apply( null, args ),
       
  4130 		};
       
  4131 
       
  4132 		// Don't need to check whether node is already head, since it would
       
  4133 		// have been returned above already if it was
       
  4134 
       
  4135 		// Shift existing head down list
       
  4136 		if ( head ) {
       
  4137 			head.prev = node;
       
  4138 			node.next = head;
       
  4139 		} else {
       
  4140 			// If no head, follows that there's no tail (at initial or reset)
       
  4141 			tail = node;
       
  4142 		}
       
  4143 
       
  4144 		// Trim tail if we're reached max size and are pending cache insertion
       
  4145 		if ( size === /** @type {MemizeOptions} */ ( options ).maxSize ) {
       
  4146 			tail = /** @type {MemizeCacheNode} */ ( tail ).prev;
       
  4147 			/** @type {MemizeCacheNode} */ ( tail ).next = null;
       
  4148 		} else {
       
  4149 			size++;
       
  4150 		}
       
  4151 
       
  4152 		head = node;
       
  4153 
       
  4154 		return node.val;
       
  4155 	}
       
  4156 
       
  4157 	memoized.clear = function() {
       
  4158 		head = null;
       
  4159 		tail = null;
       
  4160 		size = 0;
       
  4161 	};
       
  4162 
       
  4163 	if ( false ) {}
       
  4164 
       
  4165 	// Ignore reason: There's not a clear solution to create an intersection of
       
  4166 	// the function with additional properties, where the goal is to retain the
       
  4167 	// function signature of the incoming argument and add control properties
       
  4168 	// on the return value.
       
  4169 
       
  4170 	// @ts-ignore
       
  4171 	return memoized;
       
  4172 }
       
  4173 
       
  4174 module.exports = memize;
       
  4175 
       
  4176 
       
  4177 /***/ }),
       
  4178 
       
  4179 /***/ 64:
       
  4180 /***/ (function(module, exports) {
       
  4181 
       
  4182 (function() { module.exports = this["wp"]["isShallowEqual"]; }());
       
  4183 
       
  4184 /***/ }),
       
  4185 
       
  4186 /***/ 8:
       
  4187 /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3994 /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4188 
  3995 
  4189 "use strict";
  3996 "use strict";
  4190 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _extends; });
  3997 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _extends; });
  4191 function _extends() {
  3998 function _extends() {
  4204   };
  4011   };
  4205 
  4012 
  4206   return _extends.apply(this, arguments);
  4013   return _extends.apply(this, arguments);
  4207 }
  4014 }
  4208 
  4015 
  4209 /***/ }),
       
  4210 
       
  4211 /***/ 9:
       
  4212 /***/ (function(module, exports) {
       
  4213 
       
  4214 (function() { module.exports = this["wp"]["compose"]; }());
       
  4215 
       
  4216 /***/ })
  4016 /***/ })
  4217 
  4017 
  4218 /******/ });
  4018 /******/ });