PageSourceSearch

https://givewp.bayarcash-demo.com/wp-includes/js/dist/data.js?ver=2797f012cdb7d180a746

js bayarcash-demo.com collected 2026-09-25 22:08:45 UTC 144,947 bytes, 4,470 lines download raw bytes

vendor: 5,323 bytes, lines 1-185
1/******/ (() => { // webpackBootstrap
2/******/ 	"use strict";
3/******/ 	var __webpack_modules__ = ({
4
5/***/ 66:
6/***/ ((module) => {
7
8
9
10var isMergeableObject = function isMergeableObject(value) {
11	return isNonNullObject(value)
12		&& !isSpecial(value)
13};
14
15function isNonNullObject(value) {
16	return !!value && typeof value === 'object'
17}
18
19function isSpecial(value) {
20	var stringValue = Object.prototype.toString.call(value);
21
22	return stringValue === '[object RegExp]'
23		|| stringValue === '[object Date]'
24		|| isReactElement(value)
25}
26
27// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25
28var canUseSymbol = typeof Symbol === 'function' && Symbol.for;
29var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;
30
31function isReactElement(value) {
32	return value.$$typeof === REACT_ELEMENT_TYPE
33}
34
35function emptyTarget(val) {
36	return Array.isArray(val) ? [] : {}
37}
38
39function cloneUnlessOtherwiseSpecified(value, options) {
40	return (options.clone !== false && options.isMergeableObject(value))
41		? deepmerge(emptyTarget(value), value, options)
42		: value
43}
44
45function defaultArrayMerge(target, source, options) {
46	return target.concat(source).map(function(element) {
47		return cloneUnlessOtherwiseSpecified(element, options)
48	})
49}
50
51function getMergeFunction(key, options) {
52	if (!options.customMerge) {
53		return deepmerge
54	}
55	var customMerge = options.customMerge(key);
56	return typeof customMerge === 'function' ? customMerge : deepmerge
57}
58
59function getEnumerableOwnPropertySymbols(target) {
60	return Object.getOwnPropertySymbols
61		? Object.getOwnPropertySymbols(target).filter(function(symbol) {
62			return Object.propertyIsEnumerable.call(target, symbol)
63		})
64		: []
65}
66
67function getKeys(target) {
68	return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))
69}
70
71function propertyIsOnObject(object, property) {
72	try {
73		return property in object
74	} catch(_) {
75		return false
76	}
77}
78
79// Protects from prototype poisoning and unexpected merging up the prototype chain.
80function propertyIsUnsafe(target, key) {
81	return propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,
82		&& !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,
83			&& Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable.
84}
85
86function mergeObject(target, source, options) {
87	var destination = {};
88	if (options.isMergeableObject(target)) {
89		getKeys(target).forEach(function(key) {
90			destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
91		});
92	}
93	getKeys(source).forEach(function(key) {
94		if (propertyIsUnsafe(target, key)) {
95			return
96		}
97
98		if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
99			destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
100		} else {
101			destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
102		}
103	});
104	return destination
105}
106
107function deepmerge(target, source, options) {
108	options = options || {};
109	options.arrayMerge = options.arrayMerge || defaultArrayMerge;
110	options.isMergeableObject = options.isMergeableObject || isMergeableObject;
111	// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()
112	// implementations can use it. The caller may not replace it.
113	options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
114
115	var sourceIsArray = Array.isArray(source);
116	var targetIsArray = Array.isArray(target);
117	var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
118
119	if (!sourceAndTargetTypesMatch) {
120		return cloneUnlessOtherwiseSpecified(source, options)
121	} else if (sourceIsArray) {
122		return options.arrayMerge(target, source, options)
123	} else {
124		return mergeObject(target, source, options)
125	}
126}
127
128deepmerge.all = function deepmergeAll(array, options) {
129	if (!Array.isArray(array)) {
130		throw new Error('first argument should be an array')
131	}
132
133	return array.reduce(function(prev, next) {
134		return deepmerge(prev, next, options)
135	}, {})
136};
137
138var deepmerge_1 = deepmerge;
139
140module.exports = deepmerge_1;
141
142
143/***/ }),
144
145/***/ 3249:
146/***/ ((module) => {
147
148
149
150function _typeof(obj) {
151  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
152    _typeof = function (obj) {
153      return typeof obj;
154    };
155  } else {
156    _typeof = function (obj) {
157      return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
158    };
159  }
160
161  return _typeof(obj);
162}
163
164function _classCallCheck(instance, Constructor) {
165  if (!(instance instanceof Constructor)) {
166    throw new TypeError("Cannot call a class as a function");
167  }
168}
169
170function _defineProperties(target, props) {
171  for (var i = 0; i < props.length; i++) {
172    var descriptor = props[i];
173    descriptor.enumerable = descriptor.enumerable || false;
174    descriptor.configurable = true;
175    if ("value" in descriptor) descriptor.writable = true;
176    Object.defineProperty(target, descriptor.key, descriptor);
177  }
178}
179
180function _createClass(Constructor, protoProps, staticProps) {
181  if (protoProps) _defineProperties(Constructor.prototype, protoProps);
182  if (staticProps) _defineProperties(Constructor, staticProps);
183  return Constructor;
184}
185
186/**
187 * Given an instance of EquivalentKeyMap, returns its internal value pair tuple
188 * for a key, if one exists. The tuple members consist of the last reference
189 * value for the key (used in efficient subsequent lookups) and the value
190 * assigned for the key at the leaf node.
191 *
192 * @param {EquivalentKeyMap} instance EquivalentKeyMap instance.
193 * @param {*} key                     The key for which to return value pair.
194 *
195 * @return {?Array} Value pair, if exists.
196 */
197function getValuePair(instance, key) {
198  var _map = instance._map,
199      _arrayTreeMap = instance._arrayTreeMap,
200      _objectTreeMap = instance._objectTreeMap; // Map keeps a reference to the last object-like key used to set the
201  // value, which can be used to shortcut immediately to the value.
202
203  if (_map.has(key)) {
204    return _map.get(key);
205  } // Sort keys to ensure stable retrieval from tree.
206
207
208  var properties = Object.keys(key).sort(); // Tree by type to avoid conflicts on numeric object keys, empty value.
209
210  var map = Array.isArray(key) ? _arrayTreeMap : _objectTreeMap;
211
212  for (var i = 0; i < properties.length; i++) {
213    var property = properties[i];
214    map = map.get(property);
215
216    if (map === undefined) {
217      return;
218    }
219
220    var propertyValue = key[property];
221    map = map.get(propertyValue);
222
223    if (map === undefined) {
224      return;
225    }
226  }
227
228  var valuePair = map.get('_ekm_value');
229
230  if (!valuePair) {
231    return;
232  } // If reached, it implies that an object-like key was set with another
233  // reference, so delete the reference and replace with the current.
234
235
236  _map.delete(valuePair[0]);
237
238  valuePair[0] = key;
239  map.set('_ekm_value', valuePair);
240
241  _map.set(key, valuePair);
242
243  return valuePair;
244}
245/**
246 * Variant of a Map object which enables lookup by equivalent (deeply equal)
247 * object and array keys.
248 */
249
250
251var EquivalentKeyMap =
252/*#__PURE__*/
253function () {
254  /**
255   * Constructs a new instance of EquivalentKeyMap.
256   *
257   * @param {Iterable.<*>} iterable Initial pair of key, value for map.
258   */
259  function EquivalentKeyMap(iterable) {
260    _classCallCheck(this, EquivalentKeyMap);
261
262    this.clear();
263
264    if (iterable instanceof EquivalentKeyMap) {
265      // Map#forEach is only means of iterating with support for IE11.
266      var iterablePairs = [];
267      iterable.forEach(function (value, key) {
268        iterablePairs.push([key, value]);
269      });
270      iterable = iterablePairs;
271    }
272
273    if (iterable != null) {
274      for (var i = 0; i < iterable.length; i++) {
275        this.set(iterable[i][0], iterable[i][1]);
276      }
277    }
278  }
279  /**
280   * Accessor property returning the number of elements.
281   *
282   * @return {number} Number of elements.
283   */
284
285
286  _createClass(EquivalentKeyMap, [{
287    key: "set",
288
289    /**
290     * Add or update an element with a specified key and value.
291     *
292     * @param {*} key   The key of the element to add.
293     * @param {*} value The value of the element to add.
294     *
295     * @return {EquivalentKeyMap} Map instance.
296     */
297    value: function set(key, value) {
298      // Shortcut non-object-like to set on internal Map.
299      if (key === null || _typeof(key) !== 'object') {
300        this._map.set(key, value);
301
302        return this;
303      } // Sort keys to ensure stable assignment into tree.
304
305
306      var properties = Object.keys(key).sort();
307      var valuePair = [key, value]; // Tree by type to avoid conflicts on numeric object keys, empty value.
308
309      var map = Array.isArray(key) ? this._arrayTreeMap : this._objectTreeMap;
310
311      for (var i = 0; i < properties.length; i++) {
312        var property = properties[i];
313
314        if (!map.has(property)) {
315          map.set(property, new EquivalentKeyMap());
316        }
317
318        map = map.get(property);
319        var propertyValue = key[property];
320
321        if (!map.has(propertyValue)) {
322          map.set(propertyValue, new EquivalentKeyMap());
323        }
324
325        map = map.get(propertyValue);
326      } // If an _ekm_value exists, there was already an equivalent key. Before
327      // overriding, ensure that the old key reference is removed from map to
328      // avoid memory leak of accumulating equivalent keys. This is, in a
329      // sense, a poor man's WeakMap, while still enabling iterability.
330
331
332      var previousValuePair = map.get('_ekm_value');
333
334      if (previousValuePair) {
335        this._map.delete(previousValuePair[0]);
336      }
337
338      map.set('_ekm_value', valuePair);
339
340      this._map.set(key, valuePair);
341
342      return this;
343    }
344    /**
345     * Returns a specified element.
346     *
347     * @param {*} key The key of the element to return.
348     *
349     * @return {?*} The element associated with the specified key or undefined
350     *              if the key can't be found.
351     */
352
353  }, {
354    key: "get",
355    value: function get(key) {
356      // Shortcut non-object-like to get from internal Map.
357      if (key === null || _typeof(key) !== 'object') {
358        return this._map.get(key);
359      }
360
361      var valuePair = getValuePair(this, key);
362
363      if (valuePair) {
364        return valuePair[1];
365      }
366    }
367    /**
368     * Returns a boolean indicating whether an element with the specified key
369     * exists or not.
370     *
371     * @param {*} key The key of the element to test for presence.
372     *
373     * @return {boolean} Whether an element with the specified key exists.
374     */
375
376  }, {
377    key: "has",
378    value: function has(key) {
379      if (key === null || _typeof(key) !== 'object') {
380        return this._map.has(key);
381      } // Test on the _presence_ of the pair, not its value, as even undefined
382      // can be a valid member value for a key.
383
384
385      return getValuePair(this, key) !== undefined;
386    }
387    /**
388     * Removes the specified element.
389     *
390     * @param {*} key The key of the element to remove.
391     *
392     * @return {boolean} Returns true if an element existed and has been
393     *                   removed, or false if the element does not exist.
394     */
395
396  }, {
397    key: "delete",
398    value: function _delete(key) {
399      if (!this.has(key)) {
400        return false;
401      } // This naive implementation will leave orphaned child trees. A better
402      // implementation should traverse and remove orphans.
403
404
405      this.set(key, undefined);
406      return true;
407    }
408    /**
409     * Executes a provided function once per each key/value pair, in insertion
410     * order.
411     *
412     * @param {Function} callback Function to execute for each element.
413     * @param {*}        thisArg  Value to use as `this` when executing
414     *                            `callback`.
415     */
416
417  }, {
418    key: "forEach",
419    value: function forEach(callback) {
420      var _this = this;
421
422      var thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this;
423
424      this._map.forEach(function (value, key) {
425        // Unwrap value from object-like value pair.
426        if (key !== null && _typeof(key) === 'object') {
427          value = value[1];
428        }
429
430        callback.call(thisArg, value, key, _this);
431      });
432    }
433    /**
434     * Removes all elements.
435     */
436
437  }, {
438    key: "clear",
439    value: function clear() {
440      this._map = new Map();
441      this._arrayTreeMap = new Map();
442      this._objectTreeMap = new Map();
443    }
444  }, {
445    key: "size",
446    get: function get() {
447      return this._map.size;
448    }
449  }]);
450
451  return EquivalentKeyMap;
452}();
453
454module.exports = EquivalentKeyMap;
455
456
457/***/ })
458
459/******/ 	});
460/************************************************************************/
461/******/ 	// The module cache
462/******/ 	var __webpack_module_cache__ = {};
463/******/ 	
464/******/ 	// The require function
465/******/ 	function __webpack_require__(moduleId) {
466/******/ 		// Check if module is in cache
467/******/ 		var cachedModule = __webpack_module_cache__[moduleId];
468/******/ 		if (cachedModule !== undefined) {
469/******/ 			return cachedModule.exports;
470/******/ 		}
471/******/ 		// Create a new module (and put it into the cache)
472/******/ 		var module = __webpack_module_cache__[moduleId] = {
473/******/ 			// no module.id needed
474/******/ 			// no module.loaded needed
475/******/ 			exports: {}
476/******/ 		};
477/******/ 	
478/******/ 		// Execute the module function
479/******/ 		__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
480/******/ 	
481/******/ 		// Return the exports of the module
482/******/ 		return module.exports;
483/******/ 	}
484/******/ 	
485/************************************************************************/
486/******/ 	/* webpack/runtime/compat get default export */
487/******/ 	(() => {
488/******/ 		// getDefaultExport function for compatibility with non-harmony modules
489/******/ 		__webpack_require__.n = (module) => {
vendor: 4,856 bytes, lines 490-600
490/******/ 			var getter = module && module.__esModule ?
491/******/ 				() => (module['default']) :
492/******/ 				() => (module);
493/******/ 			__webpack_require__.d(getter, { a: getter });
494/******/ 			return getter;
495/******/ 		};
496/******/ 	})();
497/******/ 	
498/******/ 	/* webpack/runtime/define property getters */
499/******/ 	(() => {
500/******/ 		// define getter functions for harmony exports
501/******/ 		__webpack_require__.d = (exports, definition) => {
502/******/ 			for(var key in definition) {
503/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
504/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
505/******/ 				}
506/******/ 			}
507/******/ 		};
508/******/ 	})();
509/******/ 	
510/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
511/******/ 	(() => {
512/******/ 		__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
513/******/ 	})();
514/******/ 	
515/******/ 	/* webpack/runtime/make namespace object */
516/******/ 	(() => {
517/******/ 		// define __esModule on exports
518/******/ 		__webpack_require__.r = (exports) => {
519/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
520/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
521/******/ 			}
522/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
523/******/ 		};
524/******/ 	})();
525/******/ 	
526/************************************************************************/
527var __webpack_exports__ = {};
528// ESM COMPAT FLAG
529__webpack_require__.r(__webpack_exports__);
530
531// EXPORTS
532__webpack_require__.d(__webpack_exports__, {
533  AsyncModeProvider: () => (/* reexport */ async_mode_provider_context),
534  RegistryConsumer: () => (/* reexport */ RegistryConsumer),
535  RegistryProvider: () => (/* reexport */ context),
536  combineReducers: () => (/* binding */ build_module_combineReducers),
537  controls: () => (/* reexport */ controls),
538  createReduxStore: () => (/* reexport */ createReduxStore),
539  createRegistry: () => (/* reexport */ createRegistry),
540  createRegistryControl: () => (/* reexport */ createRegistryControl),
541  createRegistrySelector: () => (/* reexport */ createRegistrySelector),
542  createSelector: () => (/* reexport */ rememo),
543  dispatch: () => (/* reexport */ dispatch_dispatch),
544  plugins: () => (/* reexport */ plugins_namespaceObject),
545  register: () => (/* binding */ register),
546  registerGenericStore: () => (/* binding */ registerGenericStore),
547  registerStore: () => (/* binding */ registerStore),
548  resolveSelect: () => (/* binding */ build_module_resolveSelect),
549  select: () => (/* reexport */ select_select),
550  subscribe: () => (/* binding */ subscribe),
551  suspendSelect: () => (/* binding */ suspendSelect),
552  use: () => (/* binding */ use),
553  useDispatch: () => (/* reexport */ use_dispatch),
554  useRegistry: () => (/* reexport */ useRegistry),
555  useSelect: () => (/* reexport */ useSelect),
556  useSuspenseSelect: () => (/* reexport */ useSuspenseSelect),
557  withDispatch: () => (/* reexport */ with_dispatch),
558  withRegistry: () => (/* reexport */ with_registry),
559  withSelect: () => (/* reexport */ with_select)
560});
561
562// NAMESPACE OBJECT: ./node_modules/@wordpress/data/build-module/redux-store/metadata/selectors.js
563var selectors_namespaceObject = {};
564__webpack_require__.r(selectors_namespaceObject);
565__webpack_require__.d(selectors_namespaceObject, {
566  countSelectorsByStatus: () => (countSelectorsByStatus),
567  getCachedResolvers: () => (getCachedResolvers),
568  getIsResolving: () => (getIsResolving),
569  getResolutionError: () => (getResolutionError),
570  getResolutionState: () => (getResolutionState),
571  hasFinishedResolution: () => (hasFinishedResolution),
572  hasResolutionFailed: () => (hasResolutionFailed),
573  hasResolvingSelectors: () => (hasResolvingSelectors),
574  hasStartedResolution: () => (hasStartedResolution),
575  isResolving: () => (isResolving)
576});
577
578// NAMESPACE OBJECT: ./node_modules/@wordpress/data/build-module/redux-store/metadata/actions.js
579var actions_namespaceObject = {};
580__webpack_require__.r(actions_namespaceObject);
581__webpack_require__.d(actions_namespaceObject, {
582  failResolution: () => (failResolution),
583  failResolutions: () => (failResolutions),
584  finishResolution: () => (finishResolution),
585  finishResolutions: () => (finishResolutions),
586  invalidateResolution: () => (invalidateResolution),
587  invalidateResolutionForStore: () => (invalidateResolutionForStore),
588  invalidateResolutionForStoreSelector: () => (invalidateResolutionForStoreSelector),
589  startResolution: () => (startResolution),
590  startResolutions: () => (startResolutions)
591});
592
593// NAMESPACE OBJECT: ./node_modules/@wordpress/data/build-module/plugins/index.js
594var plugins_namespaceObject = {};
595__webpack_require__.r(plugins_namespaceObject);
596__webpack_require__.d(plugins_namespaceObject, {
597  persistence: () => (persistence)
598});
599
600;
600// external ["wp","deprecated"]
601const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"];
602var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject);
603;// ./node_modules/redux/dist/redux.mjs
vendor: 251 bytes, lines 604-608
604// src/utils/formatProdErrorMessage.ts
605function formatProdErrorMessage(code) {
606  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. `;
607}
608
vendor: 570 bytes, lines 609-621
609// src/utils/symbol-observable.ts
610var $$observable = /* @__PURE__ */ (() => typeof Symbol === "function" && Symbol.observable || "@@observable")();
611var symbol_observable_default = $$observable;
612
613// src/utils/actionTypes.ts
614var randomString = () => Math.random().toString(36).substring(7).split("").join(".");
615var ActionTypes = {
616  INIT: `@@redux/INIT${/* @__PURE__ */ randomString()}`,
617  REPLACE: `@@redux/REPLACE${/* @__PURE__ */ randomString()}`,
618  PROBE_UNKNOWN_ACTION: () => `@@redux/PROBE_UNKNOWN_ACTION${randomString()}`
619};
620var actionTypes_default = ActionTypes;
621
vendor: 1,593 bytes, lines 622-680
622// src/utils/isPlainObject.ts
623function isPlainObject(obj) {
624  if (typeof obj !== "object" || obj === null)
625    return false;
626  let proto = obj;
627  while (Object.getPrototypeOf(proto) !== null) {
628    proto = Object.getPrototypeOf(proto);
629  }
630  return Object.getPrototypeOf(obj) === proto || Object.getPrototypeOf(obj) === null;
631}
632
633// src/utils/kindOf.ts
634function miniKindOf(val) {
635  if (val === void 0)
636    return "undefined";
637  if (val === null)
638    return "null";
639  const type = typeof val;
640  switch (type) {
641    case "boolean":
642    case "string":
643    case "number":
644    case "symbol":
645    case "function": {
646      return type;
647    }
648  }
649  if (Array.isArray(val))
650    return "array";
651  if (isDate(val))
652    return "date";
653  if (isError(val))
654    return "error";
655  const constructorName = ctorName(val);
656  switch (constructorName) {
657    case "Symbol":
658    case "Promise":
659    case "WeakMap":
660    case "WeakSet":
661    case "Map":
662    case "Set":
663      return constructorName;
664  }
665  return Object.prototype.toString.call(val).slice(8, -1).toLowerCase().replace(/\s/g, "");
666}
667function ctorName(val) {
668  return typeof val.constructor === "function" ? val.constructor.name : null;
669}
670function isError(val) {
671  return val instanceof Error || typeof val.message === "string" && val.constructor && typeof val.constructor.stackTraceLimit === "number";
672}
673function isDate(val) {
674  if (val instanceof Date)
675    return true;
676  return typeof val.toDateString === "function" && typeof val.getDate === "function" && typeof val.setDate === "function";
677}
678function kindOf(val) {
679  let typeOfVal = typeof val;
680  if (
680false) {}
681  return typeOfVal;
682}
683
vendor: 3,730 bytes, lines 684-793
684// src/createStore.ts
685function createStore(reducer, preloadedState, enhancer) {
686  if (typeof reducer !== "function") {
687    throw new Error( true ? formatProdErrorMessage(2) : 0);
688  }
689  if (typeof preloadedState === "function" && typeof enhancer === "function" || typeof enhancer === "function" && typeof arguments[3] === "function") {
690    throw new Error( true ? formatProdErrorMessage(0) : 0);
691  }
692  if (typeof preloadedState === "function" && typeof enhancer === "undefined") {
693    enhancer = preloadedState;
694    preloadedState = void 0;
695  }
696  if (typeof enhancer !== "undefined") {
697    if (typeof enhancer !== "function") {
698      throw new Error( true ? formatProdErrorMessage(1) : 0);
699    }
700    return enhancer(createStore)(reducer, preloadedState);
701  }
702  let currentReducer = reducer;
703  let currentState = preloadedState;
704  let currentListeners = /* @__PURE__ */ new Map();
705  let nextListeners = currentListeners;
706  let listenerIdCounter = 0;
707  let isDispatching = false;
708  function ensureCanMutateNextListeners() {
709    if (nextListeners === currentListeners) {
710      nextListeners = /* @__PURE__ */ new Map();
711      currentListeners.forEach((listener, key) => {
712        nextListeners.set(key, listener);
713      });
714    }
715  }
716  function getState() {
717    if (isDispatching) {
718      throw new Error( true ? formatProdErrorMessage(3) : 0);
719    }
720    return currentState;
721  }
722  function subscribe(listener) {
723    if (typeof listener !== "function") {
724      throw new Error( true ? formatProdErrorMessage(4) : 0);
725    }
726    if (isDispatching) {
727      throw new Error( true ? formatProdErrorMessage(5) : 0);
728    }
729    let isSubscribed = true;
730    ensureCanMutateNextListeners();
731    const listenerId = listenerIdCounter++;
732    nextListeners.set(listenerId, listener);
733    return function unsubscribe() {
734      if (!isSubscribed) {
735        return;
736      }
737      if (isDispatching) {
738        throw new Error( true ? formatProdErrorMessage(6) : 0);
739      }
740      isSubscribed = false;
741      ensureCanMutateNextListeners();
742      nextListeners.delete(listenerId);
743      currentListeners = null;
744    };
745  }
746  function dispatch(action) {
747    if (!isPlainObject(action)) {
748      throw new Error( true ? formatProdErrorMessage(7) : 0);
749    }
750    if (typeof action.type === "undefined") {
751      throw new Error( true ? formatProdErrorMessage(8) : 0);
752    }
753    if (typeof action.type !== "string") {
754      throw new Error( true ? formatProdErrorMessage(17) : 0);
755    }
756    if (isDispatching) {
757      throw new Error( true ? formatProdErrorMessage(9) : 0);
758    }
759    try {
760      isDispatching = true;
761      currentState = currentReducer(currentState, action);
762    } finally {
763      isDispatching = false;
764    }
765    const listeners = currentListeners = nextListeners;
766    listeners.forEach((listener) => {
767      listener();
768    });
769    return action;
770  }
771  function replaceReducer(nextReducer) {
772    if (typeof nextReducer !== "function") {
773      throw new Error( true ? formatProdErrorMessage(10) : 0);
774    }
775    currentReducer = nextReducer;
776    dispatch({
777      type: actionTypes_default.REPLACE
778    });
779  }
780  function observable() {
781    const outerSubscribe = subscribe;
782    return {
783      /**
784       * The minimal observable subscription method.
785       * @param observer Any object that can be used as an observer.
786       * The observer object should have a `next` method.
787       * @returns An object with an `unsubscribe` method that can
788       * be used to unsubscribe the observable from the store, and prevent further
789       * emission of values from the observable.
790       */
791      subscribe(observer) {
792        if (typeof observer !== "object" || observer === null) {
793          throw new Error( true ? formatProdErrorMessage(11) : 0
vendor: 2,545 bytes, lines 793-866
793);
794        }
795        function observeState() {
796          const observerAsObserver = observer;
797          if (observerAsObserver.next) {
798            observerAsObserver.next(getState());
799          }
800        }
801        observeState();
802        const unsubscribe = outerSubscribe(observeState);
803        return {
804          unsubscribe
805        };
806      },
807      [symbol_observable_default]() {
808        return this;
809      }
810    };
811  }
812  dispatch({
813    type: actionTypes_default.INIT
814  });
815  const store = {
816    dispatch,
817    subscribe,
818    getState,
819    replaceReducer,
820    [symbol_observable_default]: observable
821  };
822  return store;
823}
824function legacy_createStore(reducer, preloadedState, enhancer) {
825  return createStore(reducer, preloadedState, enhancer);
826}
827
828// src/utils/warning.ts
829function warning(message) {
830  if (typeof console !== "undefined" && typeof console.error === "function") {
831    console.error(message);
832  }
833  try {
834    throw new Error(message);
835  } catch (e) {
836  }
837}
838
839// src/combineReducers.ts
840function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {
841  const reducerKeys = Object.keys(reducers);
842  const argumentName = action && action.type === actionTypes_default.INIT ? "preloadedState argument passed to createStore" : "previous state received by the reducer";
843  if (reducerKeys.length === 0) {
844    return "Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";
845  }
846  if (!isPlainObject(inputState)) {
847    return `The ${argumentName} has unexpected type of "${kindOf(inputState)}". Expected argument to be an object with the following keys: "${reducerKeys.join('", "')}"`;
848  }
849  const unexpectedKeys = Object.keys(inputState).filter((key) => !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key]);
850  unexpectedKeys.forEach((key) => {
851    unexpectedKeyCache[key] = true;
852  });
853  if (action && action.type === actionTypes_default.REPLACE)
854    return;
855  if (unexpectedKeys.length > 0) {
856    return `Unexpected ${unexpectedKeys.length > 1 ? "keys" : "key"} "${unexpectedKeys.join('", "')}" found in ${argumentName}. Expected to find one of the known reducer keys instead: "${reducerKeys.join('", "')}". Unexpected keys will be ignored.`;
857  }
858}
859function assertReducerShape(reducers) {
860  Object.keys(reducers).forEach((key) => {
861    const reducer = reducers[key];
862    const initialState = reducer(void 0, {
863      type: actionTypes_default.INIT
864    });
865    if (typeof initialState === "undefined") {
866      throw new Error(
866 true ? formatProdErrorMessage(12) : 0);
867    }
868    if (typeof reducer(void 0, {
869      type: actionTypes_default.PROBE_UNKNOWN_ACTION()
870    }) === "undefined") {
871      throw new Error( true ? formatProdErrorMessage(13) : 0);
872    }
873  });
874}
875function combineReducers(reducers) {
876  const reducerKeys = Object.keys(reducers);
877  const finalReducers = {};
878  for (let i = 0; i < reducerKeys.length; i++) {
879    const key = reducerKeys[i];
880    if (false) {}
881    if (typeof reducers[key] === "function") {
882      finalReducers[key] = reducers[key];
883    }
884  }
885  const finalReducerKeys = Object.keys(finalReducers);
886  let unexpectedKeyCache;
887  if (false) {}
888  let shapeAssertionError;
889  try {
890    assertReducerShape(finalReducers);
891  } catch (e) {
892    shapeAssertionError = e;
893  }
894  return function combination(state = {}, action) {
895    if (shapeAssertionError) {
896      throw shapeAssertionError;
897    }
898    if (false) {}
899    let hasChanged = false;
900    const nextState = {};
901    for (let i = 0; i < finalReducerKeys.length; i++) {
902      const key = finalReducerKeys[i];
903      const reducer = finalReducers[key];
904      const previousStateForKey = state[key];
905      const nextStateForKey = reducer(previousStateForKey, action);
906      if (typeof nextStateForKey === "undefined") {
907        const actionType = action && action.type;
908        throw new Error( true ? formatProdErrorMessage(14) : 0);
909      }
910      nextState[key] = nextStateForKey;
911      hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
912    }
913    hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;
914    return hasChanged ? nextState : state;
915  };
916}
917
918// src/bindActionCreators.ts
919function bindActionCreator(actionCreator, dispatch) {
920  return function(...args) {
921    return dispatch(actionCreator.apply(this, args));
922  };
923}
924function bindActionCreators(actionCreators, dispatch) {
925  if (typeof actionCreators === "function") {
926    return bindActionCreator(actionCreators, dispatch);
927  }
928  if (typeof actionCreators !== "object" || actionCreators === null) {
929    throw new Error( true ? formatProdErrorMessage(16) : 0);
930  }
931  const boundActionCreators = {};
932  for (const key in actionCreators) {
933    const actionCreator = actionCreators[key];
934    if (typeof actionCreator === "function") {
935      boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);
936    }
937  }
938  return boundActionCreators
vendor: 459 bytes, lines 938-957
938;
939}
940
941// src/compose.ts
942function compose(...funcs) {
943  if (funcs.length === 0) {
944    return (arg) => arg;
945  }
946  if (funcs.length === 1) {
947    return funcs[0];
948  }
949  return funcs.reduce((a, b) => (...args) => a(b(...args)));
950}
951
952// src/applyMiddleware.ts
953function applyMiddleware(...middlewares) {
954  return (createStore2) => (reducer, preloadedState) => {
955    const store = createStore2(reducer, preloadedState);
956    let dispatch = () => {
957      throw new Error(
957 true ? formatProdErrorMessage(15) : 0);
958    };
959    const middlewareAPI = {
960      getState: store.getState,
961      dispatch: (action, ...args) => dispatch(action, ...args)
962    };
963    const chain = middlewares.map((middleware) => middleware(middlewareAPI));
964    dispatch = compose(...chain)(store.dispatch);
965    return {
966      ...store,
967      dispatch
968    };
969  };
970}
971
972// src/utils/isAction.ts
973function isAction(action) {
974  return isPlainObject(action) && "type" in action && typeof action.type === "string";
975}
976
977//# sourceMappingURL=redux.mjs.map
978// EXTERNAL MODULE: ./node_modules/equivalent-key-map/equivalent-key-map.js
979var equivalent_key_map = __webpack_require__(3249);
980var equivalent_key_map_default = /*#__PURE__*/__webpack_require__.n(equivalent_key_map);
981;// external ["wp","reduxRoutine"]
982const external_wp_reduxRoutine_namespaceObject = window["wp"]["reduxRoutine"];
983var external_wp_reduxRoutine_default = /*#__PURE__*/__webpack_require__.n(external_wp_reduxRoutine_namespaceObject);
984;// external ["wp","compose"]
985const external_wp_compose_namespaceObject = window["wp"]["compose"];
986;// ./node_modules/@wordpress/data/build-module/redux-store/combine-reducers.js
987function combine_reducers_combineReducers(reducers) {
988  const keys = Object.keys(reducers);
989  return function combinedReducer(state = {}, action) {
990    const nextState = {};
991    let hasChanged = false;
992    for (const key of keys) {
993      const reducer = reducers[key];
994      const prevStateForKey = state[key];
995      const nextStateForKey = reducer(prevStateForKey, action);
996      nextState[key] = nextStateForKey;
997      hasChanged = hasChanged || nextStateForKey !== prevStateForKey;
998    }
999    return hasChanged ? nextState : state;
1000  };
1001}
1002
1003;// ./node_modules/@wordpress/data/build-module/factory.js
1004/**
1005 * Internal dependencies
1006 */
1007
1008/**
1009 * Creates a selector function that takes additional curried argument with the
1010 * registry `select` function. While a regular selector has signature
1011 * ```js
1012 * ( state, ...selectorArgs ) => ( result )
1013 * ```
1014 * that allows to select data from the store's `state`, a registry selector
1015 * has signature:
1016 * ```js
1017 * ( select ) => ( state, ...selectorArgs ) => ( result )
1018 * ```
1019 * that supports also selecting from other registered stores.
1020 *
1021 * @example
1022 * ```js
1023 * import { store as coreStore } from '@wordpress/core-data';
1024 * import { store as editorStore } from '@wordpress/editor';
1025 *
1026 * const getCurrentPostId = createRegistrySelector( ( select ) => ( state ) => {
1027 *   return select( editorStore ).getCurrentPostId();
1028 * } );
1029 *
1030 * const getPostEdits = createRegistrySelector( ( select ) => ( state ) => {
1031 *   // calling another registry selector just like any other function
1032 *   const postType = getCurrentPostType( state );
1033 *   const postId = getCurrentPostId( state );
1034 *	 return select( coreStore ).getEntityRecordEdits( 'postType', postType, postId );
1035 * } );
1036 * ```
1037 *
1038 * Note how the `getCurrentPostId` selector can be called just like any other function,
1039 * (it works even inside a regular non-registry selector) and we don't need to pass the
1040 * registry as argument. The registry binding happens automatically when registering the selector
1041 * with a store.
1042 *
1043 * @param registrySelector Function receiving a registry `select`
1044 *                         function and returning a state selector.
1045 *
1046 * @return Registry selector that can be registered with a store.
1047 */
1048function createRegistrySelector(registrySelector) {
1049  const selectorsByRegistry = new WeakMap();
1050  // Create a selector function that is bound to the registry referenced by `selector.registry`
1051  // and that has the same API as a regular selector. Binding it in such a way makes it
1052  // possible to call the selector directly from another selector.
1053  const wrappedSelector = (...args) => {
1054    let selector = selectorsByRegistry.get(wrappedSelector.registry);
1055    // We want to make sure the cache persists even when new registry
1056    // instances are created. For example patterns create their own editors
1057    // with their own core/block-editor stores, so we should keep track of
1058    // the cache for each registry instance.
1059    if (!selector) {
1060      selector = registrySelector(wrappedSelector.registry.select);
1061      selectorsByRegistry.set(wrappedSelector.registry, selector);
1062    }
1063    return selector(...args);
1064  };
1065
1066  /**
1067   * Flag indicating that the selector is a registry selector that needs the correct registry
1068   * reference to be assigned to `selector.registry` to make it work correctly.
1069   * be mapped as a registry selector.
1070   */
1071  wrappedSelector.isRegistrySelector = true;
1072  return wrappedSelector;
1073}
1074
1075/**
1076 * Creates a control function that takes additional curried argument with the `registry` object.
1077 * While a regular control has signature
1078 * ```js
1079 * ( action ) => ( iteratorOrPromise )
1080 * ```
1081 * where the control works with the `action` that it's bound to, a registry control has signature:
1082 * ```js
1083 * ( registry ) => ( action ) => ( iteratorOrPromise )
1084 * ```
1085 * A registry control is typically used to select data or dispatch an action to a registered
1086 * store.
1087 *
1088 * When registering a control created with `createRegistryControl` with a store, the store
1089 * knows which calling convention to use when executing the control.
1090 *
1091 * @param registryControl Function receiving a registry object and returning a control.
1092 *
1093 * @return Registry control that can be registered with a store.
1094 */
1095function createRegistryControl(registryControl) {
1096  registryControl.isRegistryControl = true;
1097  return registryControl;
1098}
1099
1100;// ./node_modules/@wordpress/data/build-module/controls.js
1101/**
1102 * Internal dependencies
1103 */
1104
1105
1106/** @typedef {import('./types').StoreDescriptor} StoreDescriptor */
1107
1108const SELECT = '@@data/SELECT';
1109const RESOLVE_SELECT = '@@data/RESOLVE_SELECT';
1110const DISPATCH = '@@data/DISPATCH';
1111function isObject(object) {
1112  return object !== null && typeof object === 'object';
1113}
1114
1115/**
1116 * Dispatches a control action for triggering a synchronous registry select.
1117 *
1118 * Note: This control synchronously returns the current selector value, triggering the
1119 * resolution, but not waiting for it.
1120 *
1121 * @param {string|StoreDescriptor} storeNameOrDescriptor Unique namespace identifier for the store
1122 * @param {string}                 selectorName          The name of the selector.
1123 * @param {Array}                  args                  Arguments for the selector.
1124 *
1125 * @example
1126 * ```js
1127 * import { controls } from '@wordpress/data';
1128 *
1129 * // Action generator using `select`.
1130 * export function* myAction() {
1131 *   const isEditorSideBarOpened = yield controls.select( 'core/edit-post', 'isEditorSideBarOpened' );
1132 *   // Do stuff with the result from the `select`.
1133 * }
1134 * ```
1135 *
1136 * @return {Object} The control descriptor.
1137 */
1138function controls_select(storeNameOrDescriptor, selectorName, ...args) {
1139  return {
1140    type: SELECT,
1141    storeKey: isObject(storeNameOrDescriptor) ? storeNameOrDescriptor.name : storeNameOrDescriptor,
1142    selectorName,
1143    args
1144  };
1145}
1146
1147/**
1148 * Dispatches a control action for triggering and resolving a registry select.
1149 *
1150 * Note: when this control action is handled, it automatically considers
1151 * selectors that may have a resolver. In such case, it will return a `Promise` that resolves
1152 * after the selector finishes resolving, with the final result value.
1153 *
1154 * @param {string|StoreDescriptor} storeNameOrDescriptor Unique namespace identifier for the store
1155 * @param {string}                 selectorName          The name of the selector
1156 * @param {Array}                  args                  Arguments for the selector.
1157 *
1158 * @example
1159 * ```js
1160 * import { controls } from '@wordpress/data';
1161 *
1162 * // Action generator using resolveSelect
1163 * export function* myAction() {
1164 * 	const isSidebarOpened = yield controls.resolveSelect( 'core/edit-post', 'isEditorSideBarOpened' );
1165 * 	// do stuff with the result from the select.
1166 * }
1167 * ```
1168 *
1169 * @return {Object} The control descriptor.
1170 */
1171function resolveSelect(storeNameOrDescriptor, selectorName, ...args) {
1172  return {
1173    type: RESOLVE_SELECT,
1174    storeKey: isObject(storeNameOrDescriptor) ? storeNameOrDescriptor.name : storeNameOrDescriptor,
1175    selectorName,
1176    args
1177  };
1178}
1179
1180/**
1181 * Dispatches a control action for triggering a registry dispatch.
1182 *
1183 * @param {string|StoreDescriptor} storeNameOrDescriptor Unique namespace identifier for the store
1184 * @param {string}                 actionName            The name of the action to dispatch
1185 * @param {Array}                  args                  Arguments for the dispatch action.
1186 *
1187 * @example
1188 * ```js
1189 * import { controls } from '@wordpress/data-controls';
1190 *
1191 * // Action generator using dispatch
1192 * export function* myAction() {
1193 *   yield controls.dispatch( 'core/editor', 'togglePublishSidebar' );
1194 *   // do some other things.
1195 * }
1196 * ```
1197 *
1198 * @return {Object}  The control descriptor.
1199 */
1200function dispatch(storeNameOrDescriptor, actionName, ...args) {
1201  return {
1202    type: DISPATCH,
1203    storeKey: isObject(storeNameOrDescriptor) ? storeNameOrDescriptor.name : storeNameOrDescriptor,
1204    actionName,
1205    args
1206  };
1207}
1208const controls = {
1209  select: controls_select,
1210  resolveSelect,
1211  dispatch
1212};
1213const builtinControls = {
1214  [SELECT]: createRegistryControl(registry => ({
1215    storeKey,
1216    selectorName,
1217    args
1218  }) => registry.select(storeKey)[selectorName](...args)),
1219  [RESOLVE_SELECT]: createRegistryControl(registry => ({
1220    storeKey,
1221    selectorName,
1222    args
1223  }) => {
1224    const method = registry.select(storeKey)[selectorName].hasResolver ? 'resolveSelect' : 'select';
1225    return registry[method](storeKey)[selectorName](...args);
1226  }),
1227  [DISPATCH]: createRegistryControl(registry => ({
1228    storeKey,
1229    actionName,
1230    args
1231  }) => registry.dispatch(storeKey)[actionName](...args))
1232};
1233
1234;// external ["wp","privateApis"]
1235const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"];
1236;// ./node_modules/@wordpress/data/build-module/lock-unlock.js
1237/**
1238 * WordPress dependencies
1239 */
1240
1241const {
1242  lock,
1243  unlock
1244} = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/data');
1245
1246;// ./node_modules/is-promise/index.mjs
1247function isPromise(obj) {
1248  return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
1249}
1250
1251;// ./node_modules/@wordpress/data/build-module/promise-middleware.js
1252/**
1253 * External dependencies
1254 */
1255
1256
1257/**
1258 * Simplest possible promise redux middleware.
1259 *
1260 * @type {import('redux').Middleware}
1261 */
1262const promiseMiddleware = () => next => action => {
1263  if (isPromise(action)) {
1264    return action.then(resolvedAction => {
1265      if (resolvedAction) {
1266        return next(resolvedAction);
1267      }
1268    });
1269  }
1270  return next(action);
1271};
1272/* harmony default export */ const promise_middleware = (promiseMiddleware);
1273
1274;// ./node_modules/@wordpress/data/build-module/resolvers-cache-middleware.js
1275/** @typedef {import('./registry').WPDataRegistry} WPDataRegistry */
1276
1277/**
1278 * Creates a middleware handling resolvers cache invalidation.
1279 *
1280 * @param {WPDataRegistry} registry  Registry for which to create the middleware.
1281 * @param {string}         storeName Name of the store for which to create the middleware.
1282 *
1283 * @return {Function} Middleware function.
1284 */
1285const createResolversCacheMiddleware = (registry, storeName) => () => next => action => {
1286  const resolvers = registry.select(storeName).getCachedResolvers();
1287  const resolverEntries = Object.entries(resolvers);
1288  resolverEntries.forEach(([selectorName, resolversByArgs]) => {
1289    const resolver = registry.stores[storeName]?.resolvers?.[selectorName];
1290    if (!resolver || !resolver.shouldInvalidate) {
1291      return;
1292    }
1293    resolversByArgs.forEach((value, args) => {
1294      // Works around a bug in `EquivalentKeyMap` where `map.delete` merely sets an entry value
1295      // to `undefined` and `map.forEach` then iterates also over these orphaned entries.
1296      if (value === undefined) {
1297        return;
1298      }
1299
1300      // resolversByArgs is the map Map([ args ] => boolean) storing the cache resolution status for a given selector.
1301      // If the value is "finished" or "error" it means this resolver has finished its resolution which means we need
1302      // to invalidate it, if it's true it means it's inflight and the invalidation is not necessary.
1303      if (value.status !== 'finished' && value.status !== 'error') {
1304        return;
1305      }
1306      if (!resolver.shouldInvalidate(action, ...args)) {
1307        return;
1308      }
1309
1310      // Trigger cache invalidation
1311      registry.dispatch(storeName).invalidateResolution(selectorName, args);
1312    });
1313  });
1314  return next(action);
1315};
1316/* harmony default export */ const resolvers_cache_middleware = (createResolversCacheMiddleware);
1317
1318;// ./node_modules/@wordpress/data/build-module/redux-store/thunk-middleware.js
1319function createThunkMiddleware(args) {
1320  return () => next => action => {
1321    if (typeof action === 'function') {
1322      return action(args);
1323    }
1324    return next(action);
1325  };
1326}
1327
1328;// ./node_modules/@wordpress/data/build-module/redux-store/metadata/utils.js
1329/**
1330 * External dependencies
1331 */
1332
1333/**
1334 * Higher-order reducer creator which creates a combined reducer object, keyed
1335 * by a property on the action object.
1336 *
1337 * @param actionProperty Action property by which to key object.
1338 * @return Higher-order reducer.
1339 */
1340const onSubKey = actionProperty => reducer => (state = {}, action) => {
1341  // Retrieve subkey from action. Do not track if undefined; useful for cases
1342  // where reducer is scoped by action shape.
1343  const key = action[actionProperty];
1344  if (key === undefined) {
1345    return state;
1346  }
1347
1348  // Avoid updating state if unchanged. Note that this also accounts for a
1349  // reducer which returns undefined on a key which is not yet tracked.
1350  const nextKeyState = reducer(state[key], action);
1351  if (nextKeyState === state[key]) {
1352    return state;
1353  }
1354  return {
1355    ...state,
1356    [key]: nextKeyState
1357  };
1358};
1359
1360/**
1361 * Normalize selector argument array by defaulting `undefined` value to an empty array
1362 * and removing trailing `undefined` values.
1363 *
1364 * @param args Selector argument array
1365 * @return Normalized state key array
1366 */
1367function selectorArgsToStateKey(args) {
1368  if (args === undefined || args === null) {
1369    return [];
1370  }
1371  const len = args.length;
1372  let idx = len;
1373  while (idx > 0 && args[idx - 1] === undefined) {
1374    idx--;
1375  }
1376  return idx === len ? args : args.slice(0, idx);
1377}
1378
1379;// ./node_modules/@wordpress/data/build-module/redux-store/metadata/reducer.js
1380/**
1381 * External dependencies
1382 */
1383
1384/**
1385 * Internal dependencies
1386 */
1387
1388/**
1389 * Reducer function returning next state for selector resolution of
1390 * subkeys, object form:
1391 *
1392 *  selectorName -> EquivalentKeyMap<Array,boolean>
1393 */
1394const subKeysIsResolved = onSubKey('selectorName')((state = new (equivalent_key_map_default())(), action) => {
1395  switch (action.type) {
1396    case 'START_RESOLUTION':
1397      {
1398        const nextState = new (equivalent_key_map_default())(state);
1399        nextState.set(selectorArgsToStateKey(action.args), {
1400          status: 'resolving'
1401        });
1402        return nextState;
1403      }
1404    case 'FINISH_RESOLUTION':
1405      {
1406        const nextState = new (equivalent_key_map_default())(state);
1407        nextState.set(selectorArgsToStateKey(action.args), {
1408          status: 'finished'
1409        });
1410        return nextState;
1411      }
1412    case 'FAIL_RESOLUTION':
1413      {
1414        const nextState = new (equivalent_key_map_default())(state);
1415        nextState.set(selectorArgsToStateKey(action.args), {
1416          status: 'error',
1417          error: action.error
1418        });
1419        return nextState;
1420      }
1421    case 'START_RESOLUTIONS':
1422      {
1423        const nextState = new (equivalent_key_map_default())(state);
1424        for (const resolutionArgs of action.args) {
1425          nextState.set(selectorArgsToStateKey(resolutionArgs), {
1426            status: 'resolving'
1427          });
1428        }
1429        return nextState;
1430      }
1431    case 'FINISH_RESOLUTIONS':
1432      {
1433        const nextState = new (equivalent_key_map_default())(state);
1434        for (const resolutionArgs of action.args) {
1435          nextState.set(selectorArgsToStateKey(resolutionArgs), {
1436            status: 'finished'
1437          });
1438        }
1439        return nextState;
1440      }
1441    case 'FAIL_RESOLUTIONS':
1442      {
1443        const nextState = new (equivalent_key_map_default())(state);
1444        action.args.forEach((resolutionArgs, idx) => {
1445          const resolutionState = {
1446            status: 'error',
1447            error: undefined
1448          };
1449          const error = action.errors[idx];
1450          if (error) {
1451            resolutionState.error = error;
1452          }
1453          nextState.set(selectorArgsToStateKey(resolutionArgs), resolutionState);
1454        });
1455        return nextState;
1456      }
1457    case 'INVALIDATE_RESOLUTION':
1458      {
1459        const nextState = new (equivalent_key_map_default())(state);
1460        nextState.delete(selectorArgsToStateKey(action.args));
1461        return nextState;
1462      }
1463  }
1464  return state;
1465});
1466
1467/**
1468 * Reducer function returning next state for selector resolution, object form:
1469 *
1470 *   selectorName -> EquivalentKeyMap<Array, boolean>
1471 *
1472 * @param state  Current state.
1473 * @param action Dispatched action.
1474 *
1475 * @return Next state.
1476 */
1477const isResolved = (state = {}, action) => {
1478  switch (action.type) {
1479    case 'INVALIDATE_RESOLUTION_FOR_STORE':
1480      return {};
1481    case 'INVALIDATE_RESOLUTION_FOR_STORE_SELECTOR':
1482      {
1483        if (action.selectorName in state) {
1484          const {
1485            [action.selectorName]: removedSelector,
1486            ...restState
1487          } = state;
1488          return restState;
1489        }
1490        return state;
1491      }
1492    case 'START_RESOLUTION':
1493    case 'FINISH_RESOLUTION':
1494    case 'FAIL_RESOLUTION':
1495    case 'START_RESOLUTIONS':
1496    case 'FINISH_RESOLUTIONS':
1497    case 'FAIL_RESOLUTIONS':
1498    case 'INVALIDATE_RESOLUTION':
1499      return subKeysIsResolved(state, action);
1500  }
1501  return state;
1502};
1503/* harmony default export */ const metadata_reducer = (isResolved);
1504
1505;// ./node_modules/rememo/rememo.js
1506
1507
1508/** @typedef {(...args: any[]) => *[]} GetDependants */
1509
1510/** @typedef {() => void} Clear */
1511
1512/**
1513 * @typedef {{
1514 *   getDependants: GetDependants,
1515 *   clear: Clear
1516 * }} EnhancedSelector
1517 */
1518
1519/**
1520 * Internal cache entry.
1521 *
1522 * @typedef CacheNode
1523 *
1524 * @property {?CacheNode|undefined} [prev] Previous node.
1525 * @property {?CacheNode|undefined} [next] Next node.
1526 * @property {*[]} args Function arguments for cache entry.
1527 * @property {*} val Function result.
1528 */
1529
1530/**
1531 * @typedef Cache
1532 *
1533 * @property {Clear} clear Function to clear cache.
1534 * @property {boolean} [isUniqueByDependants] Whether dependants are valid in
1535 * considering cache uniqueness. A cache is unique if dependents are all arrays
1536 * or objects.
1537 * @property {CacheNode?} [head] Cache head.
1538 * @property {*[]} [lastDependants] Dependants from previous invocation.
1539 */
1540
1541/**
1542 * Arbitrary value used as key for referencing cache object in WeakMap tree.
1543 *
1544 * @type {{}}
1545 */
1546var LEAF_KEY = {};
1547
1548/**
1549 * Returns the first argument as the sole entry in an array.
1550 *
1551 * @template T
1552 *
1553 * @param {T} value Value to return.
1554 *
1555 * @return {[T]} Value returned as entry in array.
1556 */
1557function arrayOf(value) {
1558	return [value];
1559}
1560
1561/**
1562 * Returns true if the value passed is object-like, or false otherwise. A value
1563 * is object-like if it can support property assignment, e.g. object or array.
1564 *
1565 * @param {*} value Value to test.
1566 *
1567 * @return {boolean} Whether value is object-like.
1568 */
1569function isObjectLike(value) {
1570	return !!value && 'object' === typeof value;
1571}
1572
1573/**
1574 * Creates and returns a new cache object.
1575 *
1576 * @return {Cache} Cache object.
1577 */
1578function createCache() {
1579	/** @type {Cache} */
1580	var cache = {
1581		clear: function () {
1582			cache.head = null;
1583		},
1584	};
1585
1586	return cache;
1587}
1588
1589/**
1590 * Returns true if entries within the two arrays are strictly equal by
1591 * reference from a starting index.
1592 *
1593 * @param {*[]} a First array.
1594 * @param {*[]} b Second array.
1595 * @param {number} fromIndex Index from which to start comparison.
1596 *
1597 * @return {boolean} Whether arrays are shallowly equal.
1598 */
1599function isShallowEqual(a, b, fromIndex) {
1600	var i;
1601
1602	if (a.length !== b.length) {
1603		return false;
1604	}
1605
1606	for (i = fromIndex; i < a.length; i++) {
1607		if (a[i] !== b[i]) {
1608			return false;
1609		}
1610	}
1611
1612	return true;
1613}
1614
1615/**
1616 * Returns a memoized selector function. The getDependants function argument is
1617 * called before the memoized selector and is expected to return an immutable
1618 * reference or array of references on which the selector depends for computing
1619 * its own return value. The memoize cache is preserved only as long as those
1620 * dependant references remain the same. If getDependants returns a different
1621 * reference(s), the cache is cleared and the selector value regenerated.
1622 *
1623 * @template {(...args: *[]) => *} S
1624 *
1625 * @param {S} selector Selector function.
1626 * @param {GetDependants=} getDependants Dependant getter returning an array of
1627 * references used in cache bust consideration.
1628 */
1629/* harmony default export */ function rememo(selector, getDependants) {
1630	/** @type {WeakMap<*,*>} */
1631	var rootCache;
1632
1633	/** @type {GetDependants} */
1634	var normalizedGetDependants = getDependants ? getDependants : arrayOf;
1635
1636	/**
1637	 * Returns the cache for a given dependants array. When possible, a WeakMap
1638	 * will be used to create a unique cache for each set of dependants. This
1639	 * is feasible due to the nature of WeakMap in allowing garbage collection
1640	 * to occur on entries where the key object is no longer referenced. Since
1641	 * WeakMap requires the key to be an object, this is only possible when the
1642	 * dependant is object-like. The root cache is created as a hierarchy where
1643	 * each top-level key is the first entry in a dependants set, the value a
1644	 * WeakMap where each key is the next dependant, and so on. This continues
1645	 * so long as the dependants are object-like. If no dependants are object-
1646	 * like, then the cache is shared across all invocations.
1647	 *
1648	 * @see isObjectLike
1649	 *
1650	 * @param {*[]}
1650 dependants Selector dependants.
1651	 *
1652	 * @return {Cache} Cache object.
1653	 */
1654	function getCache(dependants) {
1655		var caches = rootCache,
1656			isUniqueByDependants = true,
1657			i,
1658			dependant,
1659			map,
1660			cache;
1661
1662		for (i = 0; i < dependants.length; i++) {
1663			dependant = dependants[i];
1664
1665			// Can only compose WeakMap from object-like key.
1666			if (!isObjectLike(dependant)) {
1667				isUniqueByDependants = false;
1668				break;
1669			}
1670
1671			// Does current segment of cache already have a WeakMap?
1672			if (caches.has(dependant)) {
1673				// Traverse into nested WeakMap.
1674				caches = caches.get(dependant);
1675			} else {
1676				// Create, set, and traverse into a new one.
1677				map = new WeakMap();
1678				caches.set(dependant, map);
1679				caches = map;
1680			}
1681		}
1682
1683		// We use an arbitrary (but consistent) object as key for the last item
1684		// in the WeakMap to serve as our running cache.
1685		if (!caches.has(LEAF_KEY)) {
1686			cache = createCache();
1687			cache.isUniqueByDependants = isUniqueByDependants;
1688			caches.set(LEAF_KEY, cache);
1689		}
1690
1691		return caches.get(LEAF_KEY);
1692	}
1693
1694	/**
1695	 * Resets root memoization cache.
1696	 */
1697	function clear() {
1698		rootCache = new WeakMap();
1699	}
1700
1701	/* eslint-disable jsdoc/check-param-names */
1702	/**
1703	 * The augmented selector call, considering first whether dependants have
1704	 * changed before passing it to underlying memoize function.
1705	 *
1706	 * @param {*}    source    Source object for derivation.
1707	 * @param {...*} extraArgs Additional arguments to pass to selector.
1708	 *
1709	 * @return {*} Selector result.
1710	 */
1711	/* eslint-enable jsdoc/check-param-names */
1712	function callSelector(/* source, ...extraArgs */) {
1713		var len = arguments.length,
1714			cache,
1715			node,
1716			i,
1717			args,
1718			dependants;
1719
1720		// Create copy of arguments (avoid leaking deoptimization).
1721		args = new Array(len);
1722		for (i = 0; i < len; i++) {
1723			args[i] = arguments[i];
1724		}
1725
1726		dependants = normalizedGetDependants.apply(null, args);
1727		cache = getCache(dependants);
1728
1729		// If not guaranteed uniqueness by dependants (primitive type), shallow
1730		// compare against last dependants and, if references have changed,
1731		// destroy cache to recalculate result.
1732		if (!cache.isUniqueByDependants) {
1733			if (
1734				cache.lastDependants &&
1735				!isShallowEqual(dependants, cache.lastDependants, 0)
1736			) {
1737				cache.clear();
1738			}
1739
1740			cache.lastDependants = dependants;
1741		}
1742
1743		node = cache.head;
1744		while (node) {
1745			// Check whether node arguments match arguments
1746			if (!isShallowEqual(node.args, args, 1)) {
1747				node = node.next;
1748				continue;
1749			}
1750
1751			// At this point we can assume we've found a match
1752
1753			// Surface matched node to head if not already
1754			if (node !== cache.head) {
1755				// Adjust siblings to point to each other.
1756				/** @type {CacheNode} */ (node.prev).next = node.next;
1757				if (node.next) {
1758					node.next.prev = node.prev;
1759				}
1760
1761				node.next = cache.head;
1762				node.prev = null;
1763				/** @type {CacheNode} */ (cache.head).prev = node;
1764				cache.head = node;
1765			}
1766
1767			// Return immediately
1768			return node.val;
1769		}
1770
1771		// No cached value found. Continue to insertion phase:
1772
1773		node = /** @type {CacheNode} */ ({
1774			// Generate the result from original function
1775			val: selector.apply(null, args),
1776		});
1777
1778		// Avoid including the source object in the cache.
1779		args[0] = null;
1780		node.args = args;
1781
1782		// Don't need to check whether node is already head, since it would
1783		// have been returned above already if it was
1784
1785		// Shift existing head down list
1786		if (cache.head) {
1787			cache.head.prev = node;
1788			node.next = cache.head;
1789		}
1790
1791		cache.head = node;
1792
1793		return node.val;
1794	}
1795
1796	callSelector.getDependants = normalizedGetDependants;
1797	callSelector.clear = clear;
1798	clear();
1799
1800	return /** @type {S & EnhancedSelector} */ (callSelector);
1801}
1802
1803;// ./node_modules/@wordpress/data/build-module/redux-store/metadata/selectors.js
1804/**
1805 * WordPress dependencies
1806 */
1807
1808
1809/**
1810 * Internal dependencies
1811 */
1812
1813
1814
1815/** @typedef {Record<string, import('./reducer').State>} State */
1816/** @typedef {import('./reducer').StateValue} StateValue */
1817/** @typedef {import('./reducer').Status} Status */
1818
1819/**
1820 * Returns the raw resolution state value for a given selector name,
1821 * and arguments set. May be undefined if the selector has never been resolved
1822 * or not resolved for the given set of arguments, otherwise true or false for
1823 * resolution started and completed respectively.
1824 *
1825 * @param {State}      state        Data state.
1826 * @param {string}     selectorName Selector name.
1827 * @param {unknown[]?} args         Arguments passed to selector.
1828 *
1829 * @return {StateValue|undefined} isResolving value.
1830 */
1831function getResolutionState(state, selectorName, args) {
1832  const map = state[selectorName];
1833  if (!map) {
1834    return;
1835  }
1836  return map.get(selectorArgsToStateKey(args));
1837}
1838
1839/**
1840 * Returns an `isResolving`-like value for a given selector name and arguments set.
1841 * Its value is either `undefined` if the selector has never been resolved or has been
1842 * invalidated, or a `true`/`false` boolean value if the resolution is in progress or
1843 * has finished, respectively.
1844 *
1845 * This is a legacy selector that was implemented when the "raw" internal data had
1846 * this `undefined | boolean` format. Nowadays the internal value is an object that
1847 * can be retrieved with `getResolutionState`.
1848 *
1849 * @deprecated
1850 *
1851 * @param {State}      state        Data state.
1852 * @param {string}     selectorName Selector name.
1853 * @param {unknown[]?} args         Arguments passed to selector.
1854 *
1855 * @return {boolean | undefined} isResolving value.
1856 */
1857function getIsResolving(state, selectorName, args) {
1858  external_wp_deprecated_default()('wp.data.select( store ).getIsResolving', {
1859    since: '6.6',
1860    version: '6.8',
1861    alternative: 'wp.data.select( store ).getResolutionState'
1862  });
1863  const resolutionState = getResolutionState(state, selectorName, args);
1864  return resolutionState && resolutionState.status === 'resolving';
1865}
1866
1867/**
1868 * Returns true if resolution has already been triggered for a given
1869 * selector name, and arguments set.
1870 *
1871 * @param {State}      state        Data state.
1872 * @param {string}     selectorName Selector name.
1873 * @param {unknown[]?} args         Arguments passed to selector.
1874 *
1875 * @return {boolean} Whether resolution has been triggered.
1876 */
1877function hasStartedResolution(state, selectorName, args) {
1878  return getResolutionState(state, selectorName, args) !== undefined;
1879}
1880
1881/**
1882 * Returns true if resolution has completed for a given selector
1883 * name, and arguments set.
1884 *
1885 * @param {State}      state        Data state.
1886 * @param {string}     selectorName Selector name.
1887 * @param {unknown[]?} args         Arguments passed to selector.
1888 *
1889 * @return {boolean} Whether resolution has completed.
1890 */
1891function hasFinishedResolution(state, selectorName, args) {
1892  const status = getResolutionState(state, selectorName, args)?.status;
1893  return status === 'finished' || status === 'error';
1894}
1895
1896/**
1897 * Returns true if resolution has failed for a given selector
1898 * name, and arguments set.
1899 *
1900 * @param {State}      state        Data state.
1901 * @param {string}     selectorName Selector name.
1902 * @param {unknown[]?} args         Arguments passed to selector.
1903 *
1904 * @return {boolean} Has resolution failed
1905 */
1906function hasResolutionFailed(state, selectorName, args) {
1907  return getResolutionState(state, selectorName, args)?.status === 'error';
1908}
1909
1910/**
1911 * Returns the resolution error for a given selector name, and arguments set.
1912 * Note it may be of an Error type, but may also be null, undefined, or anything else
1913 * that can be `throw`-n.
1914 *
1915 * @param {State}      state        Data state.
1916 * @param {string}     selectorName Selector name.
1917 * @param {unknown[]?} args         Arguments passed to selector.
1918 *
1919 * @return {Error|unknown} Last resolution error
1920 */
1921function getResolutionError(state, selectorName, args) {
1922  const resolutionState = getResolutionState(state, selectorName, args);
1923  return resolutionState?.status === 'error' ? resolutionState.error : null;
1924}
1925
1926/**
1927 * Returns true if resolution has been triggered but has not yet completed for
1928 * a given selector name, and arguments set.
1929 *
1930 * @param {State}      state        Data state.
1931 * @param {string}     selectorName Selector name.
1932 * @param {unknown[]?} args         Arguments passed to selector.
1933 *
1934 * @return {boolean} Whether resolution is in progress.
1935 */
1936function isResolving(state, selectorName, args) {
1937  return getResolutionState(state, selectorName, args)?.status === 'resolving';
1938}
1939
1940/**
1941 * Returns the list of the cached resolvers.
1942 *
1943 * @param {State} state Data state.
1944 *
1945 * @return {State} Resolvers mapped by args and selectorName.
1946 */
1947function getCachedResolvers(state) {
1948  return state;
1949}
1950
1951/**
1952 * Whether the store has any currently resolving selectors.
1953 *
1954 * @param {State} state Data state.
1955 *
1956 * @return {boolean} True if one or more selectors are resolving, false otherwise.
1957 */
1958function hasResolvingSelectors(state) {
1959  return Object.values(state).some(selectorState =>
1960  /**
1961   * This uses the internal `_map` property of `EquivalentKeyMap` for
1962   * optimization purposes, since the `EquivalentKeyMap` implementation
1963   * does not support a `.values()` implementation.
1964   *
1965   * @see https://github.com/aduth/equivalent-key-map
1966   */
1967  Array.from(selectorState._map.values()).some(resolution => resolution[1]?.status === 'resolving'));
1968}
1969
1970/**
1971 * Retrieves the total number of selectors, grouped per status.
1972 *
1973 * @param {State} state Data state.
1974 *
1975 * @return {Object} Object, containing selector totals by status.
1976 */
1977const countSelectorsByStatus = rememo(state => {
1978  const selectorsByStatus = {};
1979  Object.values(state).forEach(selectorState =>
1980  /**
1981   * This uses the internal `_map` property of `EquivalentKeyMap` for
1982   * optimization purposes, since the `EquivalentKeyMap` implementation
1983   * does not support a `.values()` implementation.
1984   *
1985   * @see https://github.com/aduth/equivalent-key-map
1986   */
1987  Array.from(selectorState._map.values()).forEach(resolution => {
1988    var _resolution$1$status;
1989    const currentStatus = (_resolution$1$status = resolution[1]?.status) !== null && _resolution$1$status !== void 0 ? _resolution$1$status : 'error';
1990    if (!selectorsByStatus[currentStatus]) {
1991      selectorsByStatus[currentStatus] = 0;
1992    }
1993    selectorsByStatus[currentStatus]++;
1994  }));
1995  return selectorsByStatus;
1996}, state => [state]);
1997
1998;// ./node_modules/@wordpress/data/build-module/redux-store/metadata/actions.js
1999/**
2000 * Returns an action object used in signalling that selector resolution has
2001 * started.
2002 *
2003 * @param {string}    selectorName Name of selector for which resolver triggered.
2004 * @param {unknown[]} args         Arguments to associate for uniqueness.
2005 *
2006 * @return {{ type: 'START_RESOLUTION', selectorName: string, args: unknown[] }} Action object.
2007 */
2008function startResolution(selectorName, args) {
2009  return {
2010    type: 'START_RESOLUTION',
2011    selectorName,
2012    args
2013  };
2014}
2015
2016/**
2017 * Returns an action object used in signalling that selector resolution has
2018 * completed.
2019 *
2020 * @param {string}    selectorName Name of selector for which resolver triggered.
2021 * @param {unknown[]} args         Arguments to associate for uniqueness.
2022 *
2023 * @return {{ type: 'FINISH_RESOLUTION', selectorName: string, args: unknown[] }} Action object.
2024 */
2025function finishResolution(selectorName, args) {
2026  return {
2027    type: 'FINISH_RESOLUTION',
2028    selectorName,
2029    args
2030  };
2031}
2032
2033/**
2034 * Returns an action object used in signalling that selector resolution has
2035 * failed.
2036 *
2037 * @param {string}        selectorName Name of selector for which resolver triggered.
2038 * @param {unknown[]}     args         Arguments to associate for uniqueness.
2039 * @param {Error|unknown} error        The error that caused the failure.
2040 *
2041 * @return {{ type: 'FAIL_RESOLUTION', selectorName: string, args: unknown[], error: Error|unknown }} Action object.
2042 */
2043function failResolution(selectorName, args, error) {
2044  return {
2045    type: 'FAIL_RESOLUTION',
2046    selectorName,
2047    args,
2048    error
2049  };
2050}
2051
2052/**
2053 * Returns an action object used in signalling that a batch of selector resolutions has
2054 * started.
2055 *
2056 * @param {string}      selectorName Name of selector for which resolver triggered.
2057 * @param {unknown[][]} args         Array of arguments to associate for uniqueness, each item
2058 *                                   is associated to a resolution.
2059 *
2060 * @return {{ type: 'START_RESOLUTIONS', selectorName: string, args: unknown[][] }} Action object.
2061 */
2062function startResolutions(selectorName, args) {
2063  return {
2064    type: 'START_RESOLUTIONS',
2065    selectorName,
2066    args
2067  };
2068}
2069
2070/**
2071 * Returns an action object used in signalling that a batch of selector resolutions has
2072 * completed.
2073 *
2074 * @param {string}      selectorName Name of selector for which resolver triggered.
2075 * @param {unknown[][]} args         Array of arguments to associate for uniqueness, each item
2076 *                                   is associated to a resolution.
2077 *
2078 * @return {{ type: 'FINISH_RESOLUTIONS', selectorName: string, args: unknown[][] }} Action object.
2079 */
2080function finishResolutions(selectorName, args) {
2081  return {
2082    type: 'FINISH_RESOLUTIONS',
2083    selectorName,
2084    args
2085  };
2086}
2087
2088/**
2089 * Returns an action object used in signalling that a batch of selector resolutions has
2090 * completed and at least one of them has failed.
2091 *
2092 * @param {string}            selectorName Name of selector for which resolver triggered.
2093 * @param {unknown[]}         args         Array of arguments to associate for uniqueness, each item
2094 *                                         is associated to a resolution.
2095 * @param {(Error|unknown)[]} errors       Array of errors to associate for uniqueness, each item
2096 *                                         is associated to a resolution.
2097 * @return {{ type: 'FAIL_RESOLUTIONS', selectorName: string, args: unknown[], errors: Array<Error|unknown> }} Action object.
2098 */
2099function failResolutions(selectorName, args, errors) {
2100  return {
2101    type: 'FAIL_RESOLUTIONS',
2102    selectorName,
2103    args,
2104    errors
2105  };
2106}
2107
2108/**
2109 * Returns an action object used in signalling that we should invali
2109date the resolution cache.
2110 *
2111 * @param {string}    selectorName Name of selector for which resolver should be invalidated.
2112 * @param {unknown[]} args         Arguments to associate for uniqueness.
2113 *
2114 * @return {{ type: 'INVALIDATE_RESOLUTION', selectorName: string, args: any[] }} Action object.
2115 */
2116function invalidateResolution(selectorName, args) {
2117  return {
2118    type: 'INVALIDATE_RESOLUTION',
2119    selectorName,
2120    args
2121  };
2122}
2123
2124/**
2125 * Returns an action object used in signalling that the resolution
2126 * should be invalidated.
2127 *
2128 * @return {{ type: 'INVALIDATE_RESOLUTION_FOR_STORE' }} Action object.
2129 */
2130function invalidateResolutionForStore() {
2131  return {
2132    type: 'INVALIDATE_RESOLUTION_FOR_STORE'
2133  };
2134}
2135
2136/**
2137 * Returns an action object used in signalling that the resolution cache for a
2138 * given selectorName should be invalidated.
2139 *
2140 * @param {string} selectorName Name of selector for which all resolvers should
2141 *                              be invalidated.
2142 *
2143 * @return  {{ type: 'INVALIDATE_RESOLUTION_FOR_STORE_SELECTOR', selectorName: string }} Action object.
2144 */
2145function invalidateResolutionForStoreSelector(selectorName) {
2146  return {
2147    type: 'INVALIDATE_RESOLUTION_FOR_STORE_SELECTOR',
2148    selectorName
2149  };
2150}
2151
2152;// ./node_modules/@wordpress/data/build-module/redux-store/index.js
2153/**
2154 * External dependencies
2155 */
2156
2157
2158
2159/**
2160 * WordPress dependencies
2161 */
2162
2163
2164
2165/**
2166 * Internal dependencies
2167 */
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179/** @typedef {import('../types').DataRegistry} DataRegistry */
2180/** @typedef {import('../types').ListenerFunction} ListenerFunction */
2181/**
2182 * @typedef {import('../types').StoreDescriptor<C>} StoreDescriptor
2183 * @template {import('../types').AnyConfig} C
2184 */
2185/**
2186 * @typedef {import('../types').ReduxStoreConfig<State,Actions,Selectors>} ReduxStoreConfig
2187 * @template State
2188 * @template {Record<string,import('../types').ActionCreator>} Actions
2189 * @template Selectors
2190 */
2191
2192const trimUndefinedValues = array => {
2193  const result = [...array];
2194  for (let i = result.length - 1; i >= 0; i--) {
2195    if (result[i] === undefined) {
2196      result.splice(i, 1);
2197    }
2198  }
2199  return result;
2200};
2201
2202/**
2203 * Creates a new object with the same keys, but with `callback()` called as
2204 * a transformer function on each of the values.
2205 *
2206 * @param {Object}   obj      The object to transform.
2207 * @param {Function} callback The function to transform each object value.
2208 * @return {Array} Transformed object.
2209 */
2210const mapValues = (obj, callback) => Object.fromEntries(Object.entries(obj !== null && obj !== void 0 ? obj : {}).map(([key, value]) => [key, callback(value, key)]));
2211
2212// Convert  non serializable types to plain objects
2213const devToolsReplacer = (key, state) => {
2214  if (state instanceof Map) {
2215    return Object.fromEntries(state);
2216  }
2217  if (state instanceof window.HTMLElement) {
2218    return null;
2219  }
2220  return state;
2221};
2222
2223/**
2224 * Create a cache to track whether resolvers started running or not.
2225 *
2226 * @return {Object} Resolvers Cache.
2227 */
2228function createResolversCache() {
2229  const cache = {};
2230  return {
2231    isRunning(selectorName, args) {
2232      return cache[selectorName] && cache[selectorName].get(trimUndefinedValues(args));
2233    },
2234    clear(selectorName, args) {
2235      if (cache[selectorName]) {
2236        cache[selectorName].delete(trimUndefinedValues(args));
2237      }
2238    },
2239    markAsRunning(selectorName, args) {
2240      if (!cache[selectorName]) {
2241        cache[selectorName] = new (equivalent_key_map_default())();
2242      }
2243      cache[selectorName].set(trimUndefinedValues(args), true);
2244    }
2245  };
2246}
2247function createBindingCache(bind) {
2248  const cache = new WeakMap();
2249  return {
2250    get(item, itemName) {
2251      let boundItem = cache.get(item);
2252      if (!boundItem) {
2253        boundItem = bind(item, itemName);
2254        cache.set(item, boundItem);
2255      }
2256      return boundItem;
2257    }
2258  };
2259}
2260
2261/**
2262 * Creates a data store descriptor for the provided Redux store configuration containing
2263 * properties describing reducer, actions, selectors, controls and resolvers.
2264 *
2265 * @example
2266 * ```js
2267 * import { createReduxStore } from '@wordpress/data';
2268 *
2269 * const store = createReduxStore( 'demo', {
2270 *     reducer: ( state = 'OK' ) => state,
2271 *     selectors: {
2272 *         getValue: ( state ) => state,
2273 *     },
2274 * } );
2275 * ```
2276 *
2277 * @template State
2278 * @template {Record<string,import('../types').ActionCreator>} Actions
2279 * @template Selectors
2280 * @param {string}                                    key     Unique namespace identifier.
2281 * @param {ReduxStoreConfig<State,Actions,Selectors>} options Registered store options, with properties
2282 *                                                            describing reducer, actions, selectors,
2283 *                                                            and resolvers.
2284 *
2285 * @return   {StoreDescriptor<ReduxStoreConfig<State,Actions,Selectors>>} Store Object.
2286 */
2287function createReduxStore(key, options) {
2288  const privateActions = {};
2289  const privateSelectors = {};
2290  const privateRegistrationFunctions = {
2291    privateActions,
2292    registerPrivateActions: actions => {
2293      Object.assign(privateActions, actions);
2294    },
2295    privateSelectors,
2296    registerPrivateSelectors: selectors => {
2297      Object.assign(privateSelectors, selectors);
2298    }
2299  };
2300  const storeDescriptor = {
2301    name: key,
2302    instantiate: registry => {
2303      /**
2304       * Stores listener functions registered with `subscribe()`.
2305       *
2306       * When functions register to listen to store changes with
2307       * `subscribe()` they get added here. Although Redux offers
2308       * its own `subscribe()` function directly, by wrapping the
2309       * subscription in this store instance it's possible to
2310       * optimize checking if the state has changed before calling
2311       * each listener.
2312       *
2313       * @type {Set<ListenerFunction>}
2314       */
2315      const listeners = new Set();
2316      const reducer = options.reducer;
2317      const thunkArgs = {
2318        registry,
2319        get dispatch() {
2320          return thunkActions;
2321        },
2322        get select() {
2323          return thunkSelectors;
2324        },
2325        get resolveSelect() {
2326          return getResolveSelectors();
2327        }
2328      };
2329      const store = instantiateReduxStore(key, options, registry, thunkArgs);
2330      // Expose the private registration functions on the store
2331      // so they can be copied to a sub registry in registry.js.
2332      lock(store, privateRegistrationFunctions);
2333      const resolversCache = createResolversCache();
2334      function bindAction(action) {
2335        return (...args) => Promise.resolve(store.dispatch(action(...args)));
2336      }
2337      const actions = {
2338        ...mapValues(actions_namespaceObject, bindAction),
2339        ...mapValues(options.actions, bindAction)
2340      };
2341      const boundPrivateActions = createBindingCache(bindAction);
2342      const allActions = new Proxy(() => {}, {
2343        get: (target, prop) => {
2344          const privateAction = privateActions[prop];
2345          return privateAction ? boundPrivateActions.get(privateAction, prop
2345) : actions[prop];
2346        }
2347      });
2348      const thunkActions = new Proxy(allActions, {
2349        apply: (target, thisArg, [action]) => store.dispatch(action)
2350      });
2351      lock(actions, allActions);
2352      const resolvers = options.resolvers ? mapResolvers(options.resolvers) : {};
2353      function bindSelector(selector, selectorName) {
2354        if (selector.isRegistrySelector) {
2355          selector.registry = registry;
2356        }
2357        const boundSelector = (...args) => {
2358          args = normalize(selector, args);
2359          const state = store.__unstableOriginalGetState();
2360          // Before calling the selector, switch to the correct
2361          // registry.
2362          if (selector.isRegistrySelector) {
2363            selector.registry = registry;
2364          }
2365          return selector(state.root, ...args);
2366        };
2367
2368        // Expose normalization method on the bound selector
2369        // in order that it can be called when fulfilling
2370        // the resolver.
2371        boundSelector.__unstableNormalizeArgs = selector.__unstableNormalizeArgs;
2372        const resolver = resolvers[selectorName];
2373        if (!resolver) {
2374          boundSelector.hasResolver = false;
2375          return boundSelector;
2376        }
2377        return mapSelectorWithResolver(boundSelector, selectorName, resolver, store, resolversCache);
2378      }
2379      function bindMetadataSelector(metaDataSelector) {
2380        const boundSelector = (...args) => {
2381          const state = store.__unstableOriginalGetState();
2382          const originalSelectorName = args && args[0];
2383          const originalSelectorArgs = args && args[1];
2384          const targetSelector = options?.selectors?.[originalSelectorName];
2385
2386          // Normalize the arguments passed to the target selector.
2387          if (originalSelectorName && targetSelector) {
2388            args[1] = normalize(targetSelector, originalSelectorArgs);
2389          }
2390          return metaDataSelector(state.metadata, ...args);
2391        };
2392        boundSelector.hasResolver = false;
2393        return boundSelector;
2394      }
2395      const selectors = {
2396        ...mapValues(selectors_namespaceObject, bindMetadataSelector),
2397        ...mapValues(options.selectors, bindSelector)
2398      };
2399      const boundPrivateSelectors = createBindingCache(bindSelector);
2400
2401      // Pre-bind the private selectors that have been registered by the time of
2402      // instantiation, so that registry selectors are bound to the registry.
2403      for (const [selectorName, selector] of Object.entries(privateSelectors)) {
2404        boundPrivateSelectors.get(selector, selectorName);
2405      }
2406      const allSelectors = new Proxy(() => {}, {
2407        get: (target, prop) => {
2408          const privateSelector = privateSelectors[prop];
2409          return privateSelector ? boundPrivateSelectors.get(privateSelector, prop) : selectors[prop];
2410        }
2411      });
2412      const thunkSelectors = new Proxy(allSelectors, {
2413        apply: (target, thisArg, [selector]) => selector(store.__unstableOriginalGetState())
2414      });
2415      lock(selectors, allSelectors);
2416      const resolveSelectors = mapResolveSelectors(selectors, store);
2417      const suspendSelectors = mapSuspendSelectors(selectors, store);
2418      const getSelectors = () => selectors;
2419      const getActions = () => actions;
2420      const getResolveSelectors = () => resolveSelectors;
2421      const getSuspendSelectors = () => suspendSelectors;
2422
2423      // We have some modules monkey-patching the store object
2424      // It's wrong to do so but until we refactor all of our effects to controls
2425      // We need to keep the same "store" instance here.
2426      store.__unstableOriginalGetState = store.getState;
2427      store.getState = () => store.__unstableOriginalGetState().root;
2428
2429      // Customize subscribe behavior to call listeners only on effective change,
2430      // not on every dispatch.
2431      const subscribe = store && (listener => {
2432        listeners.add(listener);
2433        return () => listeners.delete(listener);
2434      });
2435      let lastState = store.__unstableOriginalGetState();
2436      store.subscribe(() => {
2437        const state = store.__unstableOriginalGetState();
2438        const hasChanged = state !== lastState;
2439        lastState = state;
2440        if (hasChanged) {
2441          for (const listener of listeners) {
2442            listener();
2443          }
2444        }
2445      });
2446
2447      // This can be simplified to just { subscribe, getSelectors, getActions }
2448      // Once we remove the use function.
2449      return {
2450        reducer,
2451        store,
2452        actions,
2453        selectors,
2454        resolvers,
2455        getSelectors,
2456        getResolveSelectors,
2457        getSuspendSelectors,
2458        getActions,
2459        subscribe
2460      };
2461    }
2462  };
2463
2464  // Expose the private registration functions on the store
2465  // descriptor. That's a natural choice since that's where the
2466  // public actions and selectors are stored .
2467  lock(storeDescriptor, privateRegistrationFunctions);
2468  return storeDescriptor;
2469}
2470
2471/**
2472 * Creates a redux store for a namespace.
2473 *
2474 * @param {string}       key       Unique namespace identifier.
2475 * @param {Object}       options   Registered store options, with properties
2476 *                                 describing reducer, actions, selectors,
2477 *                                 and resolvers.
2478 * @param {DataRegistry} registry  Registry reference.
2479 * @param {Object}       thunkArgs Argument object for the thunk middleware.
2480 * @return {Object} Newly created redux store.
2481 */
2482function instantiateReduxStore(key, options, registry, thunkArgs) {
2483  const controls = {
2484    ...options.controls,
2485    ...builtinControls
2486  };
2487  const normalizedControls = mapValues(controls, control => control.isRegistryControl ? control(registry) : control);
2488  const middlewares = [resolvers_cache_middleware(registry, key), promise_middleware, external_wp_reduxRoutine_default()(normalizedControls), createThunkMiddleware(thunkArgs)];
2489  const enhancers = [applyMiddleware(...middlewares)];
2490  if (typeof window !== 'undefined' && window.__REDUX_DEVTOOLS_EXTENSION__) {
2491    enhancers.push(window.__REDUX_DEVTOOLS_EXTENSION__({
2492      name: key,
2493      instanceId: key,
2494      serialize: {
2495        replacer: devToolsReplacer
2496      }
2497    }));
2498  }
2499  const {
2500    reducer,
2501    initialState
2502  } = options;
2503  const enhancedReducer = combine_reducers_combineReducers({
2504    metadata: metadata_reducer,
2505    root: reducer
2506  });
2507  return createStore(enhancedReducer, {
2508    root: initialState
2509  }, (0,external_wp_compose_namespaceObject.compose)(enhancers));
2510}
2511
2512/**
2513 * Maps selectors to functions that return a resolution promise for them
2514 *
2515 * @param {Object} selectors Selectors to map.
2516 * @param {Object} store     The redux store the selectors select from.
2517 *
2518 * @return {Object} Selectors mapped to their resolution functions.
2519 */
2520function mapResolveSelectors(selectors, store) {
2521  const {
2522    getIsResolving,
2523    hasStartedResolution,
2524    hasFinishedResolution,
2525    hasResolutionFailed,
2526    isResolving,
2527    getCachedResolvers,
2528    getResolutionState,
2529    getResolutionError,
2530    hasResolvingSelectors,
2531    countSelectorsByStatus,
2532    ...storeSelectors
2533  } = selectors;
2534  return mapValues(storeSelectors, (selector, selectorName) => {
2535    // If the selector doesn't have a resolver, just convert the return value
2536    // (including exceptions) to a Promise, no additional extra behavior is needed.
2537    if (!selector.hasResolver) {
2538      return async (...args) => selector.apply(null, args);
2539    }
2540    return (...args) => {
2541      return new Promise((resolve, reject) => {
2542        const hasFinished = () => selectors.hasFinishedResolution(selectorName, args);
2543        const finalize = result => {
2544          const hasFailed = selectors.hasResolutionFailed(selectorName, args);
2545          if (hasFailed) {
2546            const error = selectors.getResolutionError(selectorName, args);
2547            reject(error);
2548          } else {
2549            resolve(result);
2550          }
2551        };
2552        const getResult = () => selector.apply(null, args);
2553        // Trigger the selector (to trigger the resolver)
2554        const result = getResult();
2555        if (hasFinished()) {
2556          return finalize(result);
2557        }
2558        const unsubscribe = store.subscribe(() => {
2559          if (hasFinished()) {
2560            unsubscribe();
2561            finalize(getResult());
2562          }
2563        });
2564      });
2565    };
2566  });
2567}
2568
2569/**
2570 * Maps selectors to functions that throw a suspense promise if not yet resolved.
2571 *
2572 * @param {Object} selectors Selectors to map.
2573 * @param {Object} store     The redux store the selectors select from.
2574 *
2575 * @return {Object} Selectors mapped to their suspense functions.
2576 */
2577function mapSuspendSelectors(selectors, store) {
2578  return mapValues(selectors, (selector, selectorName) => {
2579    // Selector without a resolver doesn't have any extra suspense behavior.
2580    if (!selector.hasResolver) {
2581      return selector;
2582    }
2583    return (...args) => {
2584      const result = selector.apply(null, args);
2585      if (selectors.hasFinishedResolution(selectorName, args)) {
2586        if (selectors.hasResolutionFailed(selectorName, args)) {
2587          throw selectors.getResolutionError(selectorName, args);
2588        }
2589        return result;
2590      }
2591      throw new Promise(resolve => {
2592        const unsubscribe = store.subscribe(() => {
2593          if (selectors.hasFinishedResolution(selectorName, args)) {
2594            resolve();
2595            unsubscribe();
2596          }
2597        });
2598      });
2599    };
2600  });
2601}
2602
2603/**
2604 * Convert resolvers to a normalized form, an object with `fulfill` method and
2605 * optional methods like `isFulfilled`.
2606 *
2607 * @param {Object} resolvers Resolver to convert
2608 */
2609function mapResolvers(resolvers) {
2610  return mapValues(resolvers, resolver => {
2611    if (resolver.fulfill) {
2612      return resolver;
2613    }
2614    return {
2615      ...resolver,
2616      // Copy the enumerable properties of the resolver function.
2617      fulfill: resolver // Add the fulfill method.
2618    };
2619  });
2620}
2621
2622/**
2623 * Returns a selector with a matched resolver.
2624 * Resolvers are side effects invoked once per argument set of a given selector call,
2625 * used in ensuring that the data needs for the selector are satisfied.
2626 *
2627 * @param {Object} selector       The selector function to be bound.
2628 * @param {string} selectorName   The selector name.
2629 * @param {Object} resolver       Resolver to call.
2630 * @param {Object} store          The redux store to which the resolvers should be mapped.
2631 * @param {Object} resolversCache Resolvers Cache.
2632 */
2633function mapSelectorWithResolver(selector, selectorName, resolver, store, resolversCache) {
2634  function fulfillSelector(args) {
2635    const state = store.getState();
2636    if (resolversCache.isRunning(selectorName, args) || typeof resolver.isFulfilled === 'function' && resolver.isFulfilled(state, ...args)) {
2637      return;
2638    }
2639    const {
2640      metadata
2641    } = store.__unstableOriginalGetState();
2642    if (hasStartedResolution(metadata, selectorName, args)) {
2643      return;
2644    }
2645    resolversCache.markAsRunning(selectorName, args);
2646    setTimeout(async () => {
2647      resolversCache.clear(selectorName, args);
2648      store.dispatch(startResolution(selectorName, args));
2649      try {
2650        const action = resolver.fulfill(...args);
2651        if (action) {
2652          await store.dispatch(action);
2653        }
2654        store.dispatch(finishResolution(selectorName, args));
2655      } catch (error) {
2656        store.dispatch(failResolution(selectorName, args, error));
2657      }
2658    }, 0);
2659  }
2660  const selectorResolver = (...args) => {
2661    args = normalize(selector, args);
2662    fulfillSelector(args);
2663    return selector(...args);
2664  };
2665  selectorResolver.hasResolver = true;
2666  return selectorResolver;
2667}
2668
2669/**
2670 * Applies selector's normalization function to the given arguments
2671 * if it exists.
2672 *
2673 * @param {Object} selector The selector potentially with a normalization method property.
2674 * @param {Array}  args     selector arguments to normalize.
2675 * @return {Array} Potentially normalized arguments.
2676 */
2677function normalize(selector, args) {
2678  if (selector.__unstableNormalizeArgs && typeof selector.__unstableNormalizeArgs === 'function' && args?.length) {
2679    return selector.__unstableNormalizeArgs(args);
2680  }
2681  return args;
2682}
2683
2684;// ./node_modules/@wordpress/data/build-module/store/index.js
2685const coreDataStore = {
2686  name: 'core/data',
2687  instantiate(registry) {
2688    const getCoreDataSelector = selectorName => (key, ...args) => {
2689      return registry.select(key)[selectorName](...args);
2690    };
2691    const getCoreDataAction = actionName => (key, ...args) => {
2692      return registry.dispatch(key)[actionName](...args);
2693    };
2694    return {
2695      getSelectors() {
2696        return Object.fromEntries(['getIsResolving', 'hasStartedResolution', 'hasFinishedResolution', 'isResolving', 'getCachedResolvers'].map(selectorName => [selectorName, getCoreDataSelector(selectorName)]));
2697      },
2698      getActions() {
2699        return Object.fromEntries(['startResolution', 'finishResolution', 'invalidateResolution', 'invalidateResolutionForStore', 'invalidateResolutionForStoreSelector'].map(actionName => [actionName, getCoreDataAction(actionName)]));
2700      },
2701      subscribe() {
2702        // There's no reasons to trigger any listener when we subscribe to this store
2703        // because there's no state stored in this store that need to retrigger selectors
2704        // if a change happens, the corresponding store where the tracking stated live
2705        // would have already triggered a "subscribe" call.
2706        return () => () => {};
2707      }
2708    };
2709  }
2710};
2711/* harmony default export */ const store = (coreDataStore);
2712
2713;// ./node_modules/@wordpress/data/build-module/utils/emitter.js
2714/**
2715 * Create an event emitter.
2716 *
2717 * @return The event emitter.
2718 */
2719function createEmitter() {
2720  let isPaused = false;
2721  let isPending = false;
2722  const listeners = new Set();
2723  const notifyListeners = () =>
2724  // We use Array.from to clone the listeners Set
2725  // This ensures that we don't run a listener
2726  // that was added as a response to another listener.
2727  Array.from(listeners).forEach(listener => listener());
2728  return {
2729    get isPaused() {
2730      return isPaused;
2731    },
2732    subscribe(listener) {
2733      listeners.add(listener);
2734      return () => listeners.delete(listener);
2735    },
2736    pause() {
2737      isPaused = true;
2738    },
2739    resume() {
2740      isPaused = false;
2741      if (isPending) {
2742        isPending = false;
2743        notifyListeners();
2744      }
2745    },
2746    emit() {
2747      if (isPaused) {
2748        isPending = true;
2749        return;
2750      }
2751      notifyListeners();
2752    }
2753  };
2754}
2755
2756;// ./node_modules/@wordpress/data/build-module/registry.js
2757/**
2758 * WordPress dependencies
2759 */
2760
2761
2762/**
2763 * Internal dependencies
2764 */
2765
2766
2767
2768
2769
2770/** @typedef {import('./types').StoreDescriptor} StoreDescriptor */
2771
2772/**
2773 * @typedef {Object} WPDataRegistry An isolated orchestrator of store registrations.
2774 *
2775 * @property {Function} registerGenericStore Given a namespace key and settings
2776 *                                           object, registers a new generic
2777 *                                           store.
2778 * @property {Function} registerStore        Given a namespace key and settings
2779 *                                           object, registers a new namespace
2780 *                                           store.
2781 * @property {Function} subscribe            Given a function callback, invokes
2782 *                                           the callback on any change to state
2783 *                                           within any registered store.
2784 * @property {Function} select               Given a namespace key, returns an
2785 *                                           object of the  store's registered
2786 *                                           selectors.
2787 * @property {Function} dispatch             Given a namespace key, returns an
2788 *                                           object of the store's registered
2789 *                                           action dispatchers.
2790 */
2791
2792/**
2793 * @typedef {Object} WPDataPlugin An object of registry function overrides.
2794 *
2795 * @property {Function} registerStore registers store.
2796 */
2797
2798function getStoreName(storeNameOrDescriptor) {
2799  return typeof storeNameOrDescriptor === 'string' ? storeNameOrDescriptor : storeNameOrDescriptor.name;
2800}
2801/**
2802 * Creates a new store registry, given an optional object of initial store
2803 * configurations.
2804 *
2805 * @param {Object}  storeConfigs Initial store configurations.
2806 * @param {?Object} parent       Parent registry.
2807 *
2808 * @return {WPDataRegistry} Data registry.
2809 */
2810function createRegistry(storeConfigs = {}, parent = null) {
2811  const stores = {};
2812  const emitter = createEmitter();
2813  let listeningStores = null;
2814
2815  /**
2816   * Global listener called for each store's update.
2817   */
2818  function globalListener() {
2819    emitter.emit();
2820  }
2821
2822  /**
2823   * Subscribe to changes to any data, either in all stores in registry, or
2824   * in one specific store.
2825   *
2826   * @param {Function}                listener              Listener function.
2827   * @param {string|StoreDescriptor?} storeNameOrDescriptor Optional store name.
2828   *
2829   * @return {Function} Unsubscribe function.
2830   */
2831  const subscribe = (listener, storeNameOrDescriptor) => {
2832    // subscribe to all stores
2833    if (!storeNameOrDescriptor) {
2834      return emitter.subscribe(listener);
2835    }
2836
2837    // subscribe to one store
2838    const storeName = getStoreName(storeNameOrDescriptor);
2839    const store = stores[storeName];
2840    if (store) {
2841      return store.subscribe(listener);
2842    }
2843
2844    // Trying to access a store that hasn't been registered,
2845    // this is a pattern rarely used but seen in some places.
2846    // We fallback to global `subscribe` here for backward-compatibility for now.
2847    // See https://github.com/WordPress/gutenberg/pull/27466 for more info.
2848    if (!parent) {
2849      return emitter.subscribe(listener);
2850    }
2851    return parent.subscribe(listener, storeNameOrDescriptor);
2852  };
2853
2854  /**
2855   * Calls a selector given the current state and extra arguments.
2856   *
2857   * @param {string|StoreDescriptor} storeNameOrDescriptor Unique namespace identifier for the store
2858   *                                                       or the store descriptor.
2859   *
2860   * @return {*} The selector's returned value.
2861   */
2862  function select(storeNameOrDescriptor) {
2863    const storeName = getStoreName(storeNameOrDescriptor);
2864    listeningStores?.add(storeName);
2865    const store = stores[storeName];
2866    if (store) {
2867      return store.getSelectors();
2868    }
2869    return parent?.select(storeName);
2870  }
2871  function __unstableMarkListeningStores(callback, ref) {
2872    listeningStores = new Set();
2873    try {
2874      return callback.call(this);
2875    } finally {
2876      ref.current = Array.from(listeningStores);
2877      listeningStores = null;
2878    }
2879  }
2880
2881  /**
2882   * Given a store descriptor, returns an object containing the store's selectors pre-bound to
2883   * state so that you only need to supply additional arguments, and modified so that they return
2884   * promises that resolve to their eventual values, after any resolvers have ran.
2885   *
2886   * @param {StoreDescriptor|string} storeNameOrDescriptor The store descriptor. The legacy calling
2887   *                                                       convention of passing the store name is
2888   *                                                       also supported.
2889   *
2890   * @return {Object} Each key of the object matches the name of a selector.
2891   */
2892  function resolveSelect(storeNameOrDescriptor) {
2893    const storeName = getStoreName(storeNameOrDescriptor);
2894    listeningStores?.add(storeName);
2895    const store = stores[storeName];
2896    if (store) {
2897      return store.getResolveSelectors();
2898    }
2899    return parent && parent.resolveSelect(storeName);
2900  }
2901
2902  /**
2903   * Given a store descriptor, returns an object containing the store's selectors pre-bound to
2904   * state so that you only need to supply additional arguments, and modified so that they throw
2905   * promises in case the selector is not resolved yet.
2906   *
2907   * @param {StoreDescriptor|string} storeNameOrDescriptor The store descriptor. The legacy calling
2908   *                                                       convention of passing the store name is
2909   *                                                       also supported.
2910   *
2911   * @return {Object} Object containing the store's suspense-wrapped selectors.
2912   */
2913  function suspendSelect(storeNameOrDescriptor) {
2914    const storeName = getStoreName(storeNameOrDescriptor);
2915    listeningStores?.add(storeName);
2916    const store = stores[storeName];
2917    if (store) {
2918      return store.getSuspendSelectors();
2919    }
2920    return parent && parent.suspendSelect(storeName);
2921  }
2922
2923  /**
2924   * Returns the available actions for a part of the state.
2925   *
2926   * @param {string|StoreDescriptor} storeNameOrDescriptor Unique namespace identifier for the store
2927   *                                                       or the store descriptor.
2928   *
2929   * @return {*} The action's returned value.
2930   */
2931  function dispatch(storeNameOrDescriptor) {
2932    const storeName = getStoreName(storeNameOrDescriptor);
2933    const store = stores[storeName];
2934    if (store) {
2935      return store.getActions();
2936    }
2937    return parent && parent.dispatch(storeName);
2938  }
2939
2940  //
2941  // Deprecated
2942  // TODO: Remove this after `use()` is removed.
2943  function withPlugins(attributes) {
2944    return Object.fromEntries(Object.entries(attributes).map(([key, attribute]) => {
2945      if (typeof attribute !== 'function') {
2946        return [key, attribute];
2947      }
2948      return [key, function () {
2949        return registry[key].apply(null, arguments);
2950      }];
2951    }));
2952  }
2953
2954  /**
2955   * Registers a store instance.
2956   *
2957   * @param {string}   name        Store registry name.
2958   * @param {Function} createStore Function that creates a store object (getSelectors, getActions, subscribe).
2959   */
2960  function registerStoreInstance(name, createStore) {
2961    if (stores[name]) {
2962      // eslint-disable-next-line no-console
2963      console.error('Store "' + name + '" is already registered.');
2964      return stores[name];
2965    }
2966    const store = createStore();
2967    if (typeof store.getSelectors !== 'function') {
2968      throw new TypeError('store.getSelectors must be a function');
2969    }
2970    if (typeof store.getActions !== 'function') {
2971      throw new TypeError('store.getActions must be a function');
2972    }
2973    if (typeof store.subscribe !== 'function') {
2974      throw new TypeError('store.subscribe must be a function');
2975    }
2976    // The emitter is used to keep track of active listeners when the registry
2977    // get paused, that way, when resumed we should be able to call all these
2978    // pending listeners.
2979    store.emitter = createEmitter();
2980    const currentSubscribe = store.subscribe;
2981    store.subscribe = listener => {
2982      const unsubscribeFromEmitter = store.emitter.subscribe(listener);
2983      const unsubscribeFromStore = currentSubscribe(() => {
2984        if (store.emitter.isPaused) {
2985          store.emitter.emit();
2986          return;
2987        }
2988        listener();
2989      });
2990      return () => {
2991        unsubscribeFromStore?.();
2992        unsubscribeFromEmitter?.();
2993      };
2994    };
2995    stores[name] = store;
2996    store.subscribe(globalListener);
2997
2998    // Copy private actions and selectors from the parent store.
2999    if (parent) {
3000      try {
3001        unlock(store.store).registerPrivateActions(unlock(parent).privateActionsOf(name));
3002        unlock(store.store).registerPrivateSelectors(unlock(parent).privateSelectorsOf(name));
3003      } catch (e) {
3004        // unlock() throws if store.store was not locked.
3005        // The error indicates there's nothing to do here so let's
3006        // ignore it.
3007      }
3008    }
3009    return store;
3010  }
3011
3012  /**
3013   * Registers a new store given a store descriptor.
3014   *
3015   * @param {StoreDescriptor} store Store descriptor.
3016   */
3017  function register(store) {
3018    registerStoreInstance(store.name, () => store.instantiate(registry));
3019  }
3020  function registerGenericStore(name, store) {
3021    external_wp_deprecated_default()('wp.data.registerGenericStore', {
3022      since: '5.9',
3023      alternative: 'wp.data.register( storeDescriptor )'
3024    });
3025    registerStoreInstance(name, () => store);
3026  }
3027
3028  /**
3029   * Registers a standard `@wordpress/data` store.
3030   *
3031   * @param {string} storeName Unique namespace identifier.
3032   * @param {Object} options   Store description (reducer, actions, selectors, resolvers).
3033   *
3034   * @return {Object} Registered store object.
3035   */
3036  function registerStore(storeName, options) {
3037    if (!options.reducer) {
3038      throw new TypeError('Must specify store reducer');
3039    }
3040    const store = registerStoreInstance(storeName, () => createReduxStore(storeName, options).instantiate(registry));
3041    return store.store;
3042  }
3043  function batch(callback) {
3044    // If we're already batching, just call the callback.
3045    if (emitter.isPaused) {
3046      callback();
3047      return;
3048    }
3049    emitter.pause();
3050    Object.values(stores).forEach(store => store.emitter.pause());
3051    try {
3052      callback();
3053    } finally {
3054      emitter.resume();
3055      Object.values(stores).forEach(store => store.emitter.resume());
3056    }
3057  }
3058  let registry = {
3059    batch,
3060    stores,
3061    namespaces: stores,
3062    // TODO: Deprecate/remove this.
3063    subscribe,
3064    select,
3065    resolveSelect,
3066    suspendSelect,
3067    dispatch,
3068    use,
3069    register,
3070    registerGenericStore,
3071    registerStore,
3072    __unstableMarkListeningStores
3073  };
3074
3075  //
3076  // TODO:
3077  // This function will be deprecated as soon as it is no longer internally referenced.
3078  function use(plugin, options) {
3079    if (!plugin) {
3080      return;
3081    }
3082    registry = {
3083      ...registry,
3084      ...plugin(registry, options)
3085    };
3086    return registry;
3087  }
3088  registry.register(store);
3089  for (const [name, config] of Object.entries(storeConfigs)) {
3090    registry.register(createReduxStore(name, config));
3091  }
3092  if (parent) {
3093    parent.subscribe(globalListener);
3094  }
3095  const registryWithPlugins = withPlugins(registry);
3096  lock(registryWithPlugins, {
3097    privateActionsOf: name => {
3098      try {
3099        return unlock(stores[name].store).privateActions;
3100      } catch (e) {
3101        // unlock() throws an error the store was not locked – this means
3102        // there no private actions are available
3103        return {};
3104      }
3105    },
3106    privateSelectorsOf: name => {
3107      try {
3108        return unlock(stores[name].store).privateSelectors;
3109      } catch (e) {
3110        return {};
3111      }
3112    }
3113  });
3114  return registryWithPlugins;
3115}
3116
3117;// ./node_modules/@wordpress/data/build-module/default-registry.js
3118/**
3119 * Internal dependencies
3120 */
3121
3122/* harmony default export */ const default_registry = (createRegistry());
3123
3124;// ./node_modules/is-plain-object/dist/is-plain-object.mjs
3125/*!
3126 * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
3127 *
3128 * Copyright (c) 2014-2017, Jon Schlinkert.
3129 * Released under the MIT License.
3130 */
3131
3132function is_plain_object_isObject(o) {
3133  return Object.prototype.toString.call(o) === '[object Object]';
3134}
3135
3136function is_plain_object_isPlainObject(o) {
3137  var ctor,prot;
3138
3139  if (is_plain_object_isObject(o) === false) return false;
3140
3141  // If has modified constructor
3142  ctor = o.constructor;
3143  if (ctor === undefined) return true;
3144
3145  // If has modified prototype
3146  prot = ctor.prototype;
3147  if (is_plain_object_isObject(prot) === false) return false;
3148
3149  // If constructor does not have an Object-specific method
3150  if (prot.hasOwnProperty('isPrototypeOf') === false) {
3151    return false;
3152  }
3153
3154  // Most likely a plain Object
3155  return true;
3156}
3157
3158
3159
3160// EXTERNAL MODULE: ./node_modules/deepmerge/dist/cjs.js
3161var cjs = __webpack_require__(66);
3162var cjs_default = /*#__PURE__*/__webpack_require__.n(cjs);
3163;// ./node_modules/@wordpress/data/build-module/plugins/persistence/storage/object.js
3164let objectStorage;
3165const storage = {
3166  getItem(key) {
3167    if (!objectStorage || !objectStorage[key]) {
3168      return null;
3169    }
3170    return objectStorage[key];
3171  },
3172  setItem(key, value) {
3173    if (!objectStorage) {
3174      storage.clear();
3175    }
3176    objectStorage[key] = String(value);
3177  },
3178  clear() {
3179    objectStorage = Object.create(null);
3180  }
3181};
3182/* harmony default export */ const object = (storage);
3183
3184;// ./node_modules/@wordpress/data/build-module/plugins/persistence/storage/default.js
3185/**
3186 * Internal dependencies
3187 */
3188
3189let default_storage;
3190try {
3191  // Private Browsing in Safari 10 and earlier will throw an error when
3192  // attempting to set into localStorage. The test here is intentional in
3193  // causing a thrown error as condition for using fallback object storage.
3194  default_storage = window.localStorage;
3195  default_storage.setItem('__wpDataTestLocalStorage', '');
3196  default_storage.removeItem('__wpDataTestLocalStorage');
3197} catch (error) {
3198  default_storage = object;
3199}
3200/* harmony default export */ const storage_default = (default_storage);
3201
3202;// ./node_modules/@wordpress/data/build-module/plugins/persistence/index.js
3203/**
3204 * External dependencies
3205 */
3206
3207
3208
3209/**
3210 * Internal dependencies
3211 */
3212
3213
3214
3215/** @typedef {import('../../registry').WPDataRegistry} WPDataRegistry */
3216
3217/** @typedef {import('../../registry').WPDataPlugin} WPDataPlugin */
3218
3219/**
3220 * @typedef {Object} WPDataPersistencePluginOptions Persistence plugin options.
3221 *
3222 * @property {Storage} storage    Persistent storage implementation. This must
3223 *                                at least implement `getItem` and `setItem` of
3224 *                                the Web Storage API.
3225 * @property {string}  storageKey Key on which to set in persistent storage.
3226 */
3227
3228/**
3229 * Default plugin storage.
3230 *
3231 * @type {Storage}
3232 */
3233const DEFAULT_STORAGE = storage_default;
3234
3235/**
3236 * Default plugin storage key.
3237 *
3238 * @type {string}
3239 */
3240const DEFAULT_STORAGE_KEY = 'WP_DATA';
3241
3242/**
3243 * Higher-order reducer which invokes the original reducer only if state is
3244 * inequal from that of the action's `nextState` property, otherwise returning
3245 * the original state reference.
3246 *
3247 * @param {Function} reducer Original reducer.
3248 *
3249 * @return {Function} Enhanced reducer.
3250 */
3251const withLazySameState = reducer => (state, action) => {
3252  if (action.nextState === state) {
3253    return state;
3254  }
3255  return reducer(state, action);
3256};
3257
3258/**
3259 * Creates a persistence interface, exposing getter and setter methods (`get`
3260 * and `set` respectively).
3261 *
3262 * @param {WPDataPersistencePluginOptions} options Plugin options.
3263 *
3264 * @return {Object} Persistence interface.
3265 */
3266function createPersistenceInterface(options) {
3267  const {
3268    storage = DEFAULT_STORAGE,
3269    storageKey = DEFAULT_STORAGE_KEY
3270  } = options;
3271  let data;
3272
3273  /**
3274   * Returns the persisted data as an object, defaulting to an empty object.
3275   *
3276   * @return {Object} Persisted data.
3277   */
3278  function getData() {
3279    if (data === undefined) {
3280      // If unset, getItem is expected to return null. Fall back to
3281      // empty object.
3282      const persisted = storage.getItem(storageKey);
3283      if (persisted === null) {
3284        data = {};
3285      } else {
3286        try {
3287          data = JSON.parse(persisted);
3288        } catch (error) {
3289          // Similarly, should any error be thrown during parse of
3290          // the string (malformed JSON), fall back to empty object.
3291          data = {};
3292        }
3293      }
3294    }
3295    return data;
3296  }
3297
3298  /**
3299   * Merges an updated reducer state into the persisted data.
3300   *
3301   * @param {string} key   Key to update.
3302   * @param {*}      value Updated value.
3303   */
3304  function setData(key, value) {
3305    data = {
3306      ...data,
3307      [key]: value
3308    };
3309    storage.setItem(storageKey, JSON.stringify(data));
3310  }
3311  return {
3312    get: getData,
3313    set: setData
3314  };
3315}
3316
3317/**
3318 * Data plugin to persist store state into a single storage key.
3319 *
3320 * @param {WPDataRegistry}                  registry      Data registry.
3321 * @param {?WPDataPersistencePluginOptions} pluginOptions Plugin options.
3322 *
3323 * @return {WPDataPlugin} Data plugin.
3324 */
3325function persistencePlugin(registry, pluginOptions) {
3326  const persistence = createPersistenceInterface(pluginOptions);
3327
3328  /**
3329   * Creates an enhanced store dispatch function, triggering the state of the
3330   * given store name to be persisted when changed.
3331   *
3332   * @param {Function}       getState  Function which returns current state.
3333   * @param {string}         storeName Store name.
3334   * @param {?Array<string>} keys      Optional subset of keys to save.
3335   *
3336   * @return {Function} Enhanced dispatch function.
3337   */
3338  function createPersistOnChange(getState, storeName, keys) {
3339    let getPersistedState;
3340    if (Array.isArray(keys)) {
3341      // Given keys, the persisted state should by produced as an object
3342      // of the subset of keys. This implementation uses combineReducers
3343      // to leverage its behavior of returning the same object when none
3344      // of the property values changes. This allows a strict reference
3345      // equality to bypass a persistence set on an unchanging state.
3346      const reducers = keys.reduce((accumulator, key) => Object.assign(accumulator, {
3347        [key]: (state, action) => action.nextState[key]
3348      }), {});
3349      getPersistedState = withLazySameState(build_module_combineReducers(reducers));
3350    } else {
3351      getPersistedState = (state, action) => action.nextState;
3352    }
3353    let lastState = getPersistedState(undefined, {
3354      nextState: getState()
3355    });
3356    return () => {
3357      const state = getPersistedState(lastState, {
3358        nextState: getState()
3359      });
3360      if (state !== lastState) {
3361        persistence.set(storeName, state);
3362        lastState = state;
3363      }
3364    };
3365  }
3366  return {
3367    registerStore(storeName, options) {
3368      if (!options.persist) {
3369        return registry.registerStore(storeName, options);
3370      }
3371
3372      // Load from persistence to use as initial state.
3373      const persistedState = persistence.get()[storeName];
3374      if (persistedState !== undefined) {
3375        let initialState = options.reducer(options.initialState, {
3376          type: '@@WP/PERSISTENCE_RESTORE'
3377        });
3378        if (is_plain_object_isPlainObject(initialState) && is_plain_object_isPlainObject(persistedState)) {
3379          // If state is an object, ensure that:
3380          // - Other keys are left intact when persisting only a
3381          //   subset of keys.
3382          // - New keys in what would otherwise be used as initial
3383          //   state are deeply merged as base for persisted value.
3384          initialState = cjs_default()(initialState, persistedState, {
3385            isMergeableObject: is_plain_object_isPlainObject
3386          });
3387        } else {
3388          // If there is a mismatch in object-likeness of default
3389          // initial or persisted state, defer to persisted value.
3390          initialState = persistedState;
3391        }
3392        options = {
3393          ...options,
3394          initialState
3395        };
3396      }
3397      const store = registry.registerStore(storeName, options);
3398      store.subscribe(createPersistOnChange(store.getState, storeName, options.persist));
3399      return store;
3400    }
3401  };
3402}
3403persistencePlugin.__unstableMigrate = () => {};
3404/* harmony default export */ const persistence = (persistencePlugin);
3405
3406;// ./node_modules/@wordpress/data/build-module/plugins/index.js
3407
3408
3409;// external ["wp","priorityQueue"]
3410const external_wp_priorityQueue_namespaceObject = window["wp"]["priorityQueue"];
3411;// external ["wp","element"]
3412const external_wp_element_namespaceObject = window["wp"]["element"];
3413;// external ["wp","isShallowEqual"]
3414const external_wp_isShallowEqual_namespaceObject = window["wp"]["isShallowEqual"];
3415var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_wp_isShallowEqual_namespaceObject);
3416;// ./node_modules/@wordpress/data/build-module/components/registry-provider/context.js
3417/**
3418 * WordPress dependencies
3419 */
3420
3421
3422/**
3423 * Internal dependencies
3424 */
3425
3426const Context = (0,external_wp_element_namespaceObject.createContext)(default_registry);
3427const {
3428  Consumer,
3429  Provider
3430} = Context;
3431
3432/**
3433 * A custom react Context consumer exposing the provided `registry` to
3434 * children components. Used along with the RegistryProvider.
3435 *
3436 * You can read more about the react context api here:
3437 * https://react.dev/learn/passing-data-deeply-with-context#step-3-provide-the-context
3438 *
3439 * @example
3440 * ```js
3441 * import {
3442 *   RegistryProvider,
3443 *   RegistryConsumer,
3444 *   createRegistry
3445 * } from '@wordpress/data';
3446 *
3447 * const registry = createRegistry( {} );
3448 *
3449 * const App = ( { props } ) => {
3450 *   return <RegistryProvider value={ registry }>
3451 *     <div>Hello There</div>
3452 *     <RegistryConsumer>
3453 *       { ( registry ) => (
3454 *         <ComponentUsingRegistry
3455 *         		{ ...props }
3456 *         	  registry={ registry }
3457 *       ) }
3458 *     </RegistryConsumer>
3459 *   </RegistryProvider>
3460 * }
3461 * ```
3462 */
3463const RegistryConsumer = Consumer;
3464
3465/**
3466 * A custom Context provider for exposing the provided `registry` to children
3467 * components via a consumer.
3468 *
3469 * See <a name="#RegistryConsumer">RegistryConsumer</a> documentation for
3470 * example.
3471 */
3472/* harmony default export */ const context = (Provider);
3473
3474;// ./node_modules/@wordpress/data/build-module/components/registry-provider/use-registry.js
3475/**
3476 * WordPress dependencies
3477 */
3478
3479
3480/**
3481 * Internal dependencies
3482 */
3483
3484
3485/**
3486 * A custom react hook exposing the registry context for use.
3487 *
3488 * This exposes the `registry` value provided via the
3489 * <a href="#RegistryProvider">Registry Provider</a> to a component implementing
3490 * this hook.
3491 *
3492 * It acts similarly to the `useContext` react hook.
3493 *
3494 * Note: Generally speaking, `useRegistry` is a low level hook that in most cases
3495 * won't be needed for implementation. Most interactions with the `@wordpress/data`
3496 * API can be performed via the `useSelect` hook,  or the `withSelect` and
3497 * `withDispatch` higher order components.
3498 *
3499 * @example
3500 * ```js
3501 * import {
3502 *   RegistryProvider,
3503 *   createRegistry,
3504 *   useRegistry,
3505 * } from '@wordpress/data';
3506 *
3507 * const registry = createRegistry( {} );
3508 *
3509 * const SomeChildUsingRegistry = ( props ) => {
3510 *   const registry = useRegistry();
3511 *   // ...logic implementing the registry in other react hooks.
3512 * };
3513 *
3514 *
3515 * const ParentProvidingRegistry = ( props ) => {
3516 *   return <RegistryProvider value={ registry }>
3517 *     <SomeChildUsingRegistry { ...props } />
3518 *   </RegistryProvider>
3519 * };
3520 * ```
3521 *
3522 * @return {Function}  A custom react hook exposing the registry context value.
3523 */
3524function useRegistry() {
3525  return (0,external_wp_element_namespaceObject.useContext)(Context);
3526}
3527
3528;// ./node_modules/@wordpress/data/build-module/components/async-mode-provider/context.js
3529/**
3530 * WordPress dependencies
3531 */
3532
3533const context_Context = (0,external_wp_element_namespaceObject.createContext)(false);
3534const {
3535  Consumer: context_Consumer,
3536  Provider: context_Provider
3537} = context_Context;
3538const AsyncModeConsumer = (/* unused pure expression or super */ null && (context_Consumer));
3539
3540/**
3541 * Context Provider Component used to switch the data module component rerendering
3542 * between Sync and Async modes.
3543 *
3544 * @example
3545 *
3546 * ```js
3547 * import { useSelect, AsyncModeProvider } from '@wordpress/data';
3548 * import { store as blockEditorStore } from '@wordpress/block-editor';
3549 *
3550 * function BlockCount() {
3551 *   const count = useSelect( ( select ) => {
3552 *     return select( blockEditorStore ).getBlockCount()
3553 *   }, [] );
3554 *
3555 *   return count;
3556 * }
3557 *
3558 * function App() {
3559 *   return (
3560 *     <AsyncModeProvider value={ true }>
3561 *       <BlockCount />
3562 *     </AsyncModeProvider>
3563 *   );
3564 * }
3565 * ```
3566 *
3567 * In this example, the BlockCount component is rerendered asynchronously.
3568 * It means if a more critical task is being performed (like typing in an input),
3569 * the rerendering is delayed until the browser becomes IDLE.
3570 * It is possible to nest multiple levels of AsyncModeProvider to fine-tune the rendering behavior.
3571 *
3572 * @param {boolean} props.value Enable Async Mode.
3573 * @return {Component} The component to be rendered.
3574 */
3575/* harmony default export */ const async_mode_provider_context = (context_Provider);
3576
3577;// ./node_modules/@wordpress/data/build-module/components/async-mode-provider/use-async-mode.js
3578/**
3579 * WordPress dependencies
3580 */
3581
3582
3583/**
3584 * Internal dependencies
3585 */
3586
3587function useAsyncMode() {
3588  return (0,external_wp_element_namespaceObject.useContext)(context_Context);
3589}
3590
3591;// ./node_modules/@wordpress/data/build-module/components/use-select/index.js
3592/**
3593 * WordPress dependencies
3594 */
3595
3596
3597
3598
3599/**
3600 * Internal dependencies
3601 */
3602
3603
3604const renderQueue = (0,external_wp_priorityQueue_namespaceObject.createQueue)();
3605function warnOnUnstableReference(a, b) {
3606  if (!a || !b) {
3607    return;
3608  }
3609  const keys = typeof a === 'object' && typeof b === 'object' ? Object.keys(a).filter(k => a[k] !== b[k]) : [];
3610
3611  // eslint-disable-next-line no-console
3612  console.warn('The `useSelect` hook returns different values when called with the same state and parameters.\n' + 'This can lead to unnecessary re-renders and performance issues if not fixed.\n\n' + 'Non-equal value keys: %s\n\n', keys.join(', '));
3613}
3614
3615/**
3616 * @typedef {import('../../types').StoreDescriptor<C>} StoreDescriptor
3617 * @template {import('../../types').AnyConfig} C
3618 */
3619/**
3620 * @typedef {import('../../types').ReduxStoreConfig<State,Actions,Selectors>} ReduxStoreConfig
3621 * @template State
3622 * @template {Record<string,import('../../types').ActionCreator>} Actions
3623 * @template Selectors
3624 */
3625/** @typedef {import('../../types').MapSelect} MapSelect */
3626/**
3627 * @typedef {import('../../types').UseSelectReturn<T>} UseSelectReturn
3628 * @template {MapSelect|StoreDescriptor<any>} T
3629 */
3630
3631function Store(registry, suspense) {
3632  const select = suspense ? registry.suspendSelect : registry.select;
3633  const queueContext = {};
3634  let lastMapSelect;
3635  let lastMapResult;
3636  let lastMapResultValid = false;
3637  let lastIsAsync;
3638  let subscriber;
3639  let didWarnUnstableReference;
3640  const storeStatesOnMount = new Map();
3641  function getStoreState(name) {
3642    var _registry$stores$name;
3643    // If there's no store property (custom generic store), return an empty
3644    // object. When comparing the state, the empty objects will cause the
3645    // equality check to fail, setting `lastMapResultValid` to false.
3646    return (_registry$stores$name = registry.stores[name]?.store?.getState?.()) !== null && _registry$stores$name !== void 0 ? _registry$stores$name : {};
3647  }
3648  const createSubscriber = stores => {
3649    // The set of stores the `subscribe` function is supposed to subscribe to. Here it is
3650    // initialized, and then the `updateStores` function can add new stores to it.
3651    const activeStores = [...stores];
3652
3653    // The `subscribe` function, which is passed to the `useSyncExternalStore` hook, could
3654    // be called multiple times to establish multiple subscriptions. That's why we need to
3655    // keep a set of active subscriptions;
3656    const activeSubscriptions = new Set();
3657    function subscribe(listener) {
3658      // Maybe invalidate the value right after subscription was created.
3659      // React will call `getValue` after subscribing, to detect store
3660      // updates that happened in the interval between the `getValue` call
3661      // during render and creating the subscription, which is slightly
3662      // delayed. We need to ensure that this second `getValue` call will
3663      // compute a fresh value only if any of the store states have
3664      // changed in the meantime.
3665      if (lastMapResultValid) {
3666        for (const name of activeStores) {
3667          if (storeStatesOnMount.get(name) !== getStoreState(name)) {
3668            lastMapResultValid = false;
3669          }
3670        }
3671      }
3672      storeStatesOnMount.clear();
3673      const onStoreChange = () => {
3674        // Invalidate the value on store update, so that a fresh value is computed.
3675        lastMapResultValid = false;
3676        listener();
3677      };
3678      const onChange = () => {
3679        if (lastIsAsync) {
3680          renderQueue.add(queueContext, onStoreChange);
3681        } else {
3682          onStoreChange();
3683        }
3684      };
3685      const unsubs = [];
3686      function subscribeStore(storeName) {
3687        unsubs.push(registry.subscribe(onChange, storeName));
3688      }
3689      for (const storeName of activeStores) {
3690        subscribeStore(storeName);
3691      }
3692      activeSubscriptions.add(subscribeStore);
3693      return () => {
3694        activeSubscriptions.delete(subscribeStore);
3695        for (const unsub of unsubs.values()) {
3696          // The return value of the subscribe function could be undefined if the store is a custom generic store.
3697          unsub?.();
3698        }
3699        // Cancel existing store updates that were already scheduled.
3700        renderQueue.cancel(queueContext);
3701      };
3702    }
3703
3704    // Check if `newStores` contains some stores we're not subscribed to yet, and add them.
3705    function updateStores(newStores) {
3706      for (const newStore of newStores) {
3707        if (activeStores.includes(newStore)) {
3708          continue;
3709        }
3710
3711        // New `subscribe` calls will subscribe to `newStore`, too.
3712        activeStores.push(newStore);
3713
3714        // Add `newStore` to existing subscriptions.
3715        for (const subscription of activeSubscriptions) {
3716          subscription(newStore);
3717        }
3718      }
3719    }
3720    return {
3721      subscribe,
3722      updateStores
3723    };
3724  };
3725  return (mapSelect, isAsync) => {
3726    function updateValue() {
3727      // If the last value is valid, and the `mapSelect` callback hasn't changed,
3728      // then we can safely return the cached value. The value can change only on
3729      // store update, and in that case value will be invalidated by the listener.
3730      if (lastMapResultValid && mapSelect === lastMapSelect) {
3731        return lastMapResult;
3732      }
3733      const listeningStores = {
3734        current: null
3735      };
3736      const mapResult = registry.__unstableMarkListeningStores(() => mapSelect(select, registry), listeningStores);
3737      if (true) {
3738        if (!didWarnUnstableReference) {
3739          const secondMapResult = mapSelect(select, registry);
3740          if (!external_wp_isShallowEqual_default()(mapResult, secondMapResult)) {
3741            warnOnUnstableReference(mapResult, secondMapResult);
3742            didWarnUnstableReference = true;
3743          }
3744        }
3745      }
3746      if (!subscriber) {
3747        for (const name of listeningStores.current) {
3748          storeStatesOnMount.set(name, getStoreState(name));
3749        }
3750        subscriber = createSubscriber(listeningStores.current);
3751      } else {
3752        subscriber.updateStores(listeningStores.current);
3753      }
3754
3755      // If the new value is shallow-equal to the old one, keep the old one so
3756      // that we don't trigger unwanted updates that do a `===` check.
3757      if (!external_wp_isShallowEqual_default()(lastMapResult, mapResult)) {
3758        lastMapResult = mapResult;
3759      }
3760      lastMapSelect = mapSelect;
3761      lastMapResultValid = true;
3762    }
3763    function getValue() {
3764      // Update the value in case it's been invalidated or `mapSelect` has changed.
3765      updateValue();
3766      return lastMapResult;
3767    }
3768
3769    // When transitioning from async to sync mode, cancel existing store updates
3770    // that have been scheduled, and invalidate the value so that it's freshly
3771    // computed. It might have been changed by the update we just cancelled.
3772    if (lastIsAsync && !isAsync) {
3773      lastMapResultValid = false;
3774      renderQueue.cancel(queueContext);
3775    }
3776    updateValue();
3777    lastIsAsync = isAsync;
3778
3779    // Return a pair of functions that can be passed to `useSyncExternalStore`.
3780    return {
3781      subscribe: subscriber.subscribe,
3782      getValue
3783    };
3784  };
3785}
3786function _useStaticSelect(storeName) {
3787  return useRegistry().select(storeName);
3788}
3789function _useMappingSelect(suspense, mapSelect, deps) {
3790  const registry = useRegistry();
3791  const isAsync = useAsyncMode();
3792  const store = (0,external_wp_element_namespaceObject.useMemo)(() => Store(registry, suspense), [registry, suspense]);
3793
3794  // These are "pass-through" dependencies from the parent hook,
3795  // and the parent should catch any hook rule violations.
3796  const selector = (0,external_wp_element_namespaceObject.useCallback)(mapSelect, deps);
3797  const {
3798    subscribe,
3799    getValue
3800  } = store(selector, isAsync);
3801  const result = (0,external_wp_element_namespaceObject.useSyncExternalStore)(subscribe, getValue, getValue);
3802  (0,external_wp_element_namespaceObject.useDebugValue)(result);
3803  return result;
3804}
3805
3806/**
3807 * Custom react hook for retrieving props from registered selectors.
3808 *
3809 * In general, this custom React hook follows the
3810 * [rules of hooks](https://react.dev/reference/rules/rules-of-hooks).
3811 *
3812 * @template {MapSelect | StoreDescriptor<any>} T
3813 * @param {T}         mapSelect Function called on every state change. The returned value is
3814 *                              exposed to the component implementing this hook. The function
3815 *                              receives the `registry.select` method on the first argument
3816 *                              and the `registry` on the second argument.
3817 *                              When a store key is passed, all selectors for the store will be
3818 *                              returned. This is only meant for usage of these selectors in event
3819 *                              callbacks, not for data needed to create the element tree.
3820 * @param {unknown[]} deps      If provided, this memoizes the mapSelect so the same `mapSelect` is
3821 *                              invoked on every state change unless the dependencies change.
3822 *
3823 * @example
3824 * ```js
3825 * import { useSelect } from '@wordpress/data';
3826 * import { store as myCustomStore } from 'my-custom-store';
3827 *
3828 * function HammerPriceDisplay( { currency } ) {
3829 *   const price = useSelect( ( select ) => {
3830 *     return select( myCustomStore ).getPrice( 'hammer', currency );
3831 *   }
3831, [ currency ] );
3832 *   return new Intl.NumberFormat( 'en-US', {
3833 *     style: 'currency',
3834 *     currency,
3835 *   } ).format( price );
3836 * }
3837 *
3838 * // Rendered in the application:
3839 * // <HammerPriceDisplay currency="USD" />
3840 * ```
3841 *
3842 * In the above example, when `HammerPriceDisplay` is rendered into an
3843 * application, the price will be retrieved from the store state using the
3844 * `mapSelect` callback on `useSelect`. If the currency prop changes then
3845 * any price in the state for that currency is retrieved. If the currency prop
3846 * doesn't change and other props are passed in that do change, the price will
3847 * not change because the dependency is just the currency.
3848 *
3849 * When data is only used in an event callback, the data should not be retrieved
3850 * on render, so it may be useful to get the selectors function instead.
3851 *
3852 * **Don't use `useSelect` this way when calling the selectors in the render
3853 * function because your component won't re-render on a data change.**
3854 *
3855 * ```js
3856 * import { useSelect } from '@wordpress/data';
3857 * import { store as myCustomStore } from 'my-custom-store';
3858 *
3859 * function Paste( { children } ) {
3860 *   const { getSettings } = useSelect( myCustomStore );
3861 *   function onPaste() {
3862 *     // Do something with the settings.
3863 *     const settings = getSettings();
3864 *   }
3865 *   return <div onPaste={ onPaste }>{ children }</div>;
3866 * }
3867 * ```
3868 * @return {UseSelectReturn<T>} A custom react hook.
3869 */
3870function useSelect(mapSelect, deps) {
3871  // On initial call, on mount, determine the mode of this `useSelect` call
3872  // and then never allow it to change on subsequent updates.
3873  const staticSelectMode = typeof mapSelect !== 'function';
3874  const staticSelectModeRef = (0,external_wp_element_namespaceObject.useRef)(staticSelectMode);
3875  if (staticSelectMode !== staticSelectModeRef.current) {
3876    const prevMode = staticSelectModeRef.current ? 'static' : 'mapping';
3877    const nextMode = staticSelectMode ? 'static' : 'mapping';
3878    throw new Error(`Switching useSelect from ${prevMode} to ${nextMode} is not allowed`);
3879  }
3880
3881  // `staticSelectMode` is not allowed to change during the hook instance's,
3882  // lifetime, so the rules of hooks are not really violated.
3883  return staticSelectMode ? _useStaticSelect(mapSelect) : _useMappingSelect(false, mapSelect, deps);
3884}
3885
3886/**
3887 * A variant of the `useSelect` hook that has the same API, but is a compatible
3888 * Suspense-enabled data source.
3889 *
3890 * @template {MapSelect} T
3891 * @param {T}     mapSelect Function called on every state change. The
3892 *                          returned value is exposed to the component
3893 *                          using this hook. The function receives the
3894 *                          `registry.suspendSelect` method as the first
3895 *                          argument and the `registry` as the second one.
3896 * @param {Array} deps      A dependency array used to memoize the `mapSelect`
3897 *                          so that the same `mapSelect` is invoked on every
3898 *                          state change unless the dependencies change.
3899 *
3900 * @throws {Promise} A suspense Promise that is thrown if any of the called
3901 * selectors is in an unresolved state.
3902 *
3903 * @return {ReturnType<T>} Data object returned by the `mapSelect` function.
3904 */
3905function useSuspenseSelect(mapSelect, deps) {
3906  return _useMappingSelect(true, mapSelect, deps);
3907}
3908
3909;// external "ReactJSXRuntime"
3910const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
3911;// ./node_modules/@wordpress/data/build-module/components/with-select/index.js
3912/**
3913 * WordPress dependencies
3914 */
3915
3916
3917/**
3918 * Internal dependencies
3919 */
3920
3921
3922/** @typedef {import('react').ComponentType} ComponentType */
3923
3924/**
3925 * Higher-order component used to inject state-derived props using registered
3926 * selectors.
3927 *
3928 * @param {Function} mapSelectToProps Function called on every state change,
3929 *                                    expected to return object of props to
3930 *                                    merge with the component's own props.
3931 *
3932 * @example
3933 * ```js
3934 * import { withSelect } from '@wordpress/data';
3935 * import { store as myCustomStore } from 'my-custom-store';
3936 *
3937 * function PriceDisplay( { price, currency } ) {
3938 * 	return new Intl.NumberFormat( 'en-US', {
3939 * 		style: 'currency',
3940 * 		currency,
3941 * 	} ).format( price );
3942 * }
3943 *
3944 * const HammerPriceDisplay = withSelect( ( select, ownProps ) => {
3945 * 	const { getPrice } = select( myCustomStore );
3946 * 	const { currency } = ownProps;
3947 *
3948 * 	return {
3949 * 		price: getPrice( 'hammer', currency ),
3950 * 	};
3951 * } )( PriceDisplay );
3952 *
3953 * // Rendered in the application:
3954 * //
3955 * //  <HammerPriceDisplay currency="USD" />
3956 * ```
3957 * In the above example, when `HammerPriceDisplay` is rendered into an
3958 * application, it will pass the price into the underlying `PriceDisplay`
3959 * component and update automatically if the price of a hammer ever changes in
3960 * the store.
3961 *
3962 * @return {ComponentType} Enhanced component with merged state data props.
3963 */
3964
3965const withSelect = mapSelectToProps => (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(WrappedComponent => (0,external_wp_compose_namespaceObject.pure)(ownProps => {
3966  const mapSelect = (select, registry) => mapSelectToProps(select, ownProps, registry);
3967  const mergeProps = useSelect(mapSelect);
3968  return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, {
3969    ...ownProps,
3970    ...mergeProps
3971  });
3972}), 'withSelect');
3973/* harmony default export */ const with_select = (withSelect);
3974
3975;// ./node_modules/@wordpress/data/build-module/components/use-dispatch/use-dispatch-with-map.js
3976/**
3977 * WordPress dependencies
3978 */
3979
3980
3981
3982/**
3983 * Internal dependencies
3984 */
3985
3986
3987/**
3988 * Custom react hook for returning aggregate dispatch actions using the provided
3989 * dispatchMap.
3990 *
3991 * Currently this is an internal api only and is implemented by `withDispatch`
3992 *
3993 * @param {Function} dispatchMap Receives the `registry.dispatch` function as
3994 *                               the first argument and the `registry` object
3995 *                               as the second argument.  Should return an
3996 *                               object mapping props to functions.
3997 * @param {Array}    deps        An array of dependencies for the hook.
3998 * @return {Object}  An object mapping props to functions created by the passed
3999 *                   in dispatchMap.
4000 */
4001const useDispatchWithMap = (dispatchMap, deps) => {
4002  const registry = useRegistry();
4003  const currentDispatchMapRef = (0,external_wp_element_namespaceObject.useRef)(dispatchMap);
4004  (0,external_wp_compose_namespaceObject.useIsomorphicLayoutEffect)(() => {
4005    currentDispatchMapRef.current = dispatchMap;
4006  });
4007  return (0,external_wp_element_namespaceObject.useMemo)(() => {
4008    const currentDispatchProps = currentDispatchMapRef.current(registry.dispatch, registry);
4009    return Object.fromEntries(Object.entries(currentDispatchProps).map(([propName, dispatcher]) => {
4010      if (typeof dispatcher !== 'function') {
4011        // eslint-disable-next-line no-console
4012        console.warn(`Property ${propName} returned from dispatchMap in useDispatchWithMap must be a function.`);
4013      }
4014      return [propName, (...args) => currentDispatchMapRef.current(registry.dispatch, registry)[propName](...args)];
4015    }));
4016  }, [registry, ...deps]);
4017};
4018/* harmony default export */ const use_dispatch_with_map = (useDispatchWithMap);
4019
4020;// ./node_modules/@wordpress/data/build-module/components/with-dispatch/index.js
4021/**
4022 * WordPress dependencies
4023 */
4024
4025
4026/**
4027 * Internal dependencies
4028 */
4029
4030
4031/** @typedef {import('react').ComponentType} ComponentType */
4032
4033/**
4034 * Higher-order component used to add dispatch props using registered action
4035 * creators.
4036 *
4037 * @param {Function} mapDispatchToProps A function of returning an object of
4038 *                                      prop names where value is a
4039 *                                      dispatch-bound action creator, or a
4040 *                                      function to be called with the
4041 *                                      component's props and returning an
4042 *                                      action creator.
4043 *
4044 * @example
4045 * ```jsx
4046 * function Button( { onClick, children } ) {
4047 *     return <button type="button" onClick={ onClick }>{ children }</button>;
4048 * }
4049 *
4050 * import { withDispatch } from '@wordpress/data';
4051 * import { store as myCustomStore } from 'my-custom-store';
4052 *
4053 * const SaleButton = withDispatch( ( dispatch, ownProps ) => {
4054 *     const { startSale } = dispatch( myCustomStore );
4055 *     const { discountPercent } = ownProps;
4056 *
4057 *     return {
4058 *         onClick() {
4059 *             startSale( discountPercent );
4060 *         },
4061 *     };
4062 * } )( Button );
4063 *
4064 * // Rendered in the application:
4065 * //
4066 * // <SaleButton discountPercent="20">Start Sale!</SaleButton>
4067 * ```
4068 *
4069 * @example
4070 * In the majority of cases, it will be sufficient to use only two first params
4071 * passed to `mapDispatchToProps` as illustrated in the previous example.
4072 * However, there might be some very advanced use cases where using the
4073 * `registry` object might be used as a tool to optimize the performance of
4074 * your component. Using `select` function from the registry might be useful
4075 * when you need to fetch some dynamic data from the store at the time when the
4076 * event is fired, but at the same time, you never use it to render your
4077 * component. In such scenario, you can avoid using the `withSelect` higher
4078 * order component to compute such prop, which might lead to unnecessary
4079 * re-renders of your component caused by its frequent value change.
4080 * Keep in mind, that `mapDispatchToProps` must return an object with functions
4081 * only.
4082 *
4083 * ```jsx
4084 * function Button( { onClick, children } ) {
4085 *     return <button type="button" onClick={ onClick }>{ children }</button>;
4086 * }
4087 *
4088 * import { withDispatch } from '@wordpress/data';
4089 * import { store as myCustomStore } from 'my-custom-store';
4090 *
4091 * const SaleButton = withDispatch( ( dispatch, ownProps, { select } ) => {
4092 *    // Stock number changes frequently.
4093 *    const { getStockNumber } = select( myCustomStore );
4094 *    const { startSale } = dispatch( myCustomStore );
4095 *    return {
4096 *        onClick() {
4097 *            const discountPercent = getStockNumber() > 50 ? 10 : 20;
4098 *            startSale( discountPercent );
4099 *        },
4100 *    };
4101 * } )( Button );
4102 *
4103 * // Rendered in the application:
4104 * //
4105 * //  <SaleButton>Start Sale!</SaleButton>
4106 * ```
4107 *
4108 * _Note:_ It is important that the `mapDispatchToProps` function always
4109 * returns an object with the same keys. For example, it should not contain
4110 * conditions under which a different value would be returned.
4111 *
4112 * @return {ComponentType} Enhanced component with merged dispatcher props.
4113 */
4114
4115const withDispatch = mapDispatchToProps => (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(WrappedComponent => ownProps => {
4116  const mapDispatch = (dispatch, registry) => mapDispatchToProps(dispatch, ownProps, registry);
4117  const dispatchProps = use_dispatch_with_map(mapDispatch, []);
4118  return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, {
4119    ...ownProps,
4120    ...dispatchProps
4121  });
4122}, 'withDispatch');
4123/* harmony default export */ const with_dispatch = (withDispatch);
4124
4125;// ./node_modules/@wordpress/data/build-module/components/with-registry/index.js
4126/**
4127 * WordPress dependencies
4128 */
4129
4130
4131/**
4132 * Internal dependencies
4133 */
4134
4135
4136/**
4137 * Higher-order component which renders the original component with the current
4138 * registry context passed as its `registry` prop.
4139 *
4140 * @param {Component} OriginalComponent Original component.
4141 *
4142 * @return {Component} Enhanced component.
4143 */
4144
4145const withRegistry = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(OriginalComponent => props => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RegistryConsumer, {
4146  children: registry => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(OriginalComponent, {
4147    ...props,
4148    registry: registry
4149  })
4150}), 'withRegistry');
4151/* harmony default export */ const with_registry = (withRegistry);
4152
4153;// ./node_modules/@wordpress/data/build-module/components/use-dispatch/use-dispatch.js
4154/**
4155 * Internal dependencies
4156 */
4157
4158
4159/**
4160 * @typedef {import('../../types').StoreDescriptor<StoreConfig>} StoreDescriptor
4161 * @template {import('../../types').AnyConfig} StoreConfig
4162 */
4163/**
4164 * @typedef {import('../../types').UseDispatchReturn<StoreNameOrDescriptor>} UseDispatchReturn
4165 * @template StoreNameOrDescriptor
4166 */
4167
4168/**
4169 * A custom react hook returning the current registry dispatch actions creators.
4170 *
4171 * Note: The component using this hook must be within the context of a
4172 * RegistryProvider.
4173 *
4174 * @template {undefined | string | StoreDescriptor<any>} StoreNameOrDescriptor
4175 * @param {StoreNameOrDescriptor} [storeNameOrDescriptor] Optionally provide the name of the
4176 *                                                        store or its descriptor from which to
4177 *                                                        retrieve action creators. If not
4178 *                                                        provided, the registry.dispatch
4179 *                                                        function is returned instead.
4180 *
4181 * @example
4182 * This illustrates a pattern where you may need to retrieve dynamic data from
4183 * the server via the `useSelect` hook to use in combination with the dispatch
4184 * action.
4185 *
4186 * ```jsx
4187 * import { useCallback } from 'react';
4188 * import { useDispatch, useSelect } from '@wordpress/data';
4189 * import { store as myCustomStore } from 'my-custom-store';
4190 *
4191 * function Button( { onClick, children } ) {
4192 *   return <button type="button" onClick={ onClick }>{ children }</button>
4193 * }
4194 *
4195 * const SaleButton = ( { children } ) => {
4196 *   const { stockNumber } = useSelect(
4197 *     ( select ) => select( myCustomStore ).getStockNumber(),
4198 *     []
4199 *   );
4200 *   const { startSale } = useDispatch( myCustomStore );
4201 *   const onClick = useCallback( () => {
4202 *     const discountPercent = stockNumber > 50 ? 10: 20;
4203 *     startSale( discountPercent );
4204 *   }, [ stockNumber ] );
4205 *   return <Button onClick={ onClick }>{ children }</Button>
4206 * }
4207 *
4208 * // Rendered somewhere in the application:
4209 * //
4210 * // <SaleButton>Start Sale!</SaleButton>
4211 * ```
4212 * @return {UseDispatchReturn<StoreNameOrDescriptor>} A custom react hook.
4213 */
4214const useDispatch = storeNameOrDescriptor => {
4215  const {
4216    dispatch
4217  } = useRegistry();
4218  return storeNameOrDescriptor === void 0 ? dispatch : dispatch(storeNameOrDescriptor);
4219};
4220/* harmony default export */ const use_dispatch = (useDispatch);
4221
4222;// ./node_modules/@wordpress/data/build-module/dispatch.js
4223/**
4224 * Internal dependencies
4225 */
4226
4227
4228
4229/**
4230 * Given a store descriptor, returns an object of the store's action creators.
4231 * Calling an action creator will cause it to be dispatched, updating the state value accordingly.
4232 *
4233 * Note: Action creators returned by the dispatch will return a promise when
4234 * they are called.
4235 *
4236 * @param storeNameOrDescriptor The store descriptor. The legacy calling convention of passing
4237 *                              the store name is also supported.
4238 *
4239 * @example
4240 * ```js
4241 * import { dispatch } from '@wordpress/data';
4242 * import { store as myCustomStore } from 'my-custom-store';
4243 *
4244 * dispatch( myCustomStore ).setPrice( 'hammer', 9.75 );
4245 * ```
4246 * @return Object containing the action creators.
4247 */
4248function dispatch_dispatch(storeNameOrDescriptor) {
4249  return default_registry.dispatch(storeNameOrDescriptor);
4250}
4251
4252;// ./node_modules/@wordpress/data/build-module/select.js
4253/**
4254 * Internal dependencies
4255 */
4256
4257
4258
4259/**
4260 * Given a store descriptor, returns an object of the store's selectors.
4261 * The selector functions are been pre-bound to pass the current state automatically.
4262 * As a consumer, you need only pass arguments of the selector, if applicable.
4263 *
4264 *
4265 * @param storeNameOrDescriptor The store descriptor. The legacy calling convention
4266 *                              of passing the store name is also supported.
4267 *
4268 * @example
4269 * ```js
4270 * import { select } from '@wordpress/data';
4271 * import { store as myCustomStore } from 'my-custom-store';
4272 *
4273 * select( myCustomStore ).getPrice( 'hammer' );
4274 * ```
4275 *
4276 * @return Object containing the store's selectors.
4277 */
4278function select_select(storeNameOrDescriptor) {
4279  return default_registry.select(storeNameOrDescriptor);
4280}
4281
4282;// ./node_modules/@wordpress/data/build-module/index.js
4283/**
4284 * Internal dependencies
4285 */
4286
4287
4288
4289
4290/** @typedef {import('./types').StoreDescriptor} StoreDescriptor */
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307/**
4308 * Object of available plugins to use with a registry.
4309 *
4310 * @see [use](#use)
4311 *
4312 * @type {Object}
4313 */
4314
4315
4316/**
4317 * The combineReducers helper function turns an object whose values are different
4318 * reducing functions into a single reducing function you can pass to registerReducer.
4319 *
4320 * @type  {import('./types').combineReducers}
4321 * @param {Object} reducers An object whose values correspond to different reducing
4322 *                          functions that need to be combined into one.
4323 *
4324 * @example
4325 * ```js
4326 * import { combineReducers, createReduxStore, register } from '@wordpress/data';
4327 *
4328 * const prices = ( state = {}, action ) => {
4329 * 	return action.type === 'SET_PRICE' ?
4330 * 		{
4331 * 			...state,
4332 * 			[ action.item ]: action.price,
4333 * 		} :
4334 * 		state;
4335 * };
4336 *
4337 * const discountPercent = ( state = 0, action ) => {
4338 * 	return action.type === 'START_SALE' ?
4339 * 		action.discountPercent :
4340 * 		state;
4341 * };
4342 *
4343 * const store = createReduxStore( 'my-shop', {
4344 * 	reducer: combineReducers( {
4345 * 		prices,
4346 * 		discountPercent,
4347 * 	} ),
4348 * } );
4349 * register( store );
4350 * ```
4351 *
4352 * @return {Function} A reducer that invokes every reducer inside the reducers
4353 *                    object, and constructs a state object with the same shape.
4354 */
4355const build_module_combineReducers = combine_reducers_combineReducers;
4356
4357/**
4358 * Given a store descriptor, returns an object containing the store's selectors pre-bound to state
4359 * so that you only need to supply additional arguments, and modified so that they return promises
4360 * that resolve to their eventual values, after any resolvers have ran.
4361 *
4362 * @param {StoreDescriptor|string} storeNameOrDescriptor The store descriptor. The legacy calling
4363 *                                                       convention of passing the store name is
4364 *                                                       also supported.
4365 *
4366 * @example
4367 * ```js
4368 * import { resolveSelect } from '@wordpress/data';
4369 * import { store as myCustomStore } from 'my-custom-store';
4370 *
4371 * resolveSelect( myCustomStore ).getPrice( 'hammer' ).then(console.log)
4372 * ```
4373 *
4374 * @return {Object} Object containing the store's promise-wrapped selectors.
4375 */
4376const build_module_resolveSelect = default_registry.resolveSelect;
4377
4378/**
4379 * Given a store descriptor, returns an object containing the store's selectors pre-bound to state
4380 * so that you only need to supply additional arguments, and modified so that they throw promises
4381 * in case the selector is not resolved yet.
4382 *
4383 * @param {StoreDescriptor|string} storeNameOrDescriptor The store descriptor. The legacy calling
4384 *                                                       convention of passing the store name is
4385 *                                                       also supported.
4386 *
4387 * @return {Object} Object containing the store's suspense-wrapped selectors.
4388 */
4389const suspendSelect = default_registry.suspendSelect;
4390
4391/**
4392 * Given a listener function, the function will be called any time the state value
4393 * of one of the registered stores has changed. If you specify the optional
4394 * `storeNameOrDescriptor` parameter, the listener function will be called only
4395 * on updates on that one specific registered store.
4396 *
4397 * This function returns an `unsubscribe` function used to stop the subscription.
4398 *
4399 * @param {Function}                listener              Callback function.
4400 * @param {string|StoreDescriptor?} storeNameOrDescriptor Optional store name.
4401 *
4402 * @example
4403 * ```js
4404 * import { subscribe } from '@wordpress/data';
4405 *
4406 * const unsubscribe = subscribe( () => {
4407 * 	// You could use this opportunity to test whether the derived result of a
4408 * 	// selector has subsequently changed as the result of a state update.
4409 * } );
4410 *
4411 * // Later, if necessary...
4412 * unsubscribe();
4413 * ```
4414 */
4415const subscribe = default_registry.subscribe;
4416
4417/**
4418 * Registers a generic store instance.
4419 *
4420 * @deprecated Use `register( storeDescriptor )` instead.
4421 *
4422 * @param {string} name  Store registry name.
4423 * @param {Object} store Store instance (`{ getSelectors, getActions, subscribe }`).
4424 */
4425const registerGenericStore = default_registry.registerGenericStore;
4426
4427/**
4428 * Registers a standard `@wordpress/data` store.
4429 *
4430 * @deprecated Use `register` instead.
4431 *
4432 * @param {string} storeName Unique namespace identifier for the store.
4433 * @param {Object} options   Store description (reducer, actions, selectors, resolvers).
4434 *
4435 * @return {Object} Registered store object.
4436 */
4437const registerStore = default_registry.registerStore;
4438
4439/**
4440 * Extends a registry to inherit functionality provided by a given plugin. A
4441 * plugin is an object with properties aligning to that of a registry, merged
4442 * to extend the default registry behavior.
4443 *
4444 * @param {Object} plugin Plugin object.
4445 */
4446const use = default_registry.use;
4447
4448/**
4449 * Registers a standard `@wordpress/data` store descriptor.
4450 *
4451 * @example
4452 * ```js
4453 * import { createReduxStore, register } from '@wordpress/data';
4454 *
4455 * const store = createReduxStore( 'demo', {
4456 *     reducer: ( state = 'OK' ) => state,
4457 *     selectors: {
4458 *         getValue: ( state ) => state,
4459 *     },
4460 * } );
4461 * register( store );
4462 * ```
4463 *
4464 * @param {StoreDescriptor} store Store descriptor.
4465 */
4466const register = default_registry.register;
4467
4468(window.wp = window.wp || {}).data = __webpack_exports__;
4469/******/ })()
4470;

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.