File: /www/wwwroot/www.waciwang.com/wp-content/plugins/gutenberg/build/scripts/data/index.js.map
{
"version": 3,
"sources": ["package-external:@wordpress/deprecated", "../../../node_modules/equivalent-key-map/equivalent-key-map.js", "package-external:@wordpress/redux-routine", "package-external:@wordpress/compose", "package-external:@wordpress/private-apis", "../../../node_modules/deepmerge/dist/cjs.js", "package-external:@wordpress/priority-queue", "package-external:@wordpress/element", "package-external:@wordpress/is-shallow-equal", "vendor-external:react/jsx-runtime", "../../../packages/data/src/registry.js", "../../../node_modules/redux/src/utils/formatProdErrorMessage.ts", "../../../node_modules/redux/src/utils/symbol-observable.ts", "../../../node_modules/redux/src/utils/actionTypes.ts", "../../../node_modules/redux/src/utils/isPlainObject.ts", "../../../node_modules/redux/src/utils/kindOf.ts", "../../../node_modules/redux/src/createStore.ts", "../../../node_modules/redux/src/utils/warning.ts", "../../../node_modules/redux/src/combineReducers.ts", "../../../node_modules/redux/src/bindActionCreators.ts", "../../../node_modules/redux/src/compose.ts", "../../../node_modules/redux/src/applyMiddleware.ts", "../../../node_modules/redux/src/utils/isAction.ts", "../../../packages/data/src/redux-store/index.js", "../../../packages/data/src/redux-store/combine-reducers.ts", "../../../packages/data/src/factory.ts", "../../../packages/data/src/controls.js", "../../../packages/data/src/lock-unlock.ts", "../../../node_modules/is-promise/index.mjs", "../../../packages/data/src/promise-middleware.js", "../../../packages/data/src/resolvers-cache-middleware.js", "../../../packages/data/src/redux-store/thunk-middleware.ts", "../../../packages/data/src/redux-store/metadata/reducer.ts", "../../../packages/data/src/redux-store/metadata/utils.ts", "../../../packages/data/src/redux-store/metadata/selectors.js", "../../../node_modules/rememo/rememo.js", "../../../packages/data/src/redux-store/metadata/actions.ts", "../../../packages/data/src/store/index.js", "../../../packages/data/src/utils/emitter.ts", "../../../packages/data/src/default-registry.js", "../../../node_modules/is-plain-object/dist/is-plain-object.mjs", "../../../packages/data/src/plugins/persistence/index.js", "../../../packages/data/src/plugins/persistence/storage/object.js", "../../../packages/data/src/plugins/persistence/storage/default.js", "../../../packages/data/src/components/with-select/index.js", "../../../packages/data/src/components/use-select/index.js", "../../../packages/data/src/components/registry-provider/use-registry.js", "../../../packages/data/src/components/registry-provider/context.js", "../../../packages/data/src/components/async-mode-provider/use-async-mode.js", "../../../packages/data/src/components/async-mode-provider/context.js", "../../../packages/data/src/components/with-dispatch/index.js", "../../../packages/data/src/components/use-dispatch/use-dispatch.js", "../../../packages/data/src/components/use-dispatch/use-dispatch-with-map.js", "../../../packages/data/src/components/with-registry/index.js", "../../../packages/data/src/dispatch.ts", "../../../packages/data/src/select.ts", "../../../packages/data/src/index.ts"],
"sourcesContent": ["module.exports = window.wp.deprecated;", "'use strict';\n\nfunction _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\n/**\n * Given an instance of EquivalentKeyMap, returns its internal value pair tuple\n * for a key, if one exists. The tuple members consist of the last reference\n * value for the key (used in efficient subsequent lookups) and the value\n * assigned for the key at the leaf node.\n *\n * @param {EquivalentKeyMap} instance EquivalentKeyMap instance.\n * @param {*} key The key for which to return value pair.\n *\n * @return {?Array} Value pair, if exists.\n */\nfunction getValuePair(instance, key) {\n var _map = instance._map,\n _arrayTreeMap = instance._arrayTreeMap,\n _objectTreeMap = instance._objectTreeMap; // Map keeps a reference to the last object-like key used to set the\n // value, which can be used to shortcut immediately to the value.\n\n if (_map.has(key)) {\n return _map.get(key);\n } // Sort keys to ensure stable retrieval from tree.\n\n\n var properties = Object.keys(key).sort(); // Tree by type to avoid conflicts on numeric object keys, empty value.\n\n var map = Array.isArray(key) ? _arrayTreeMap : _objectTreeMap;\n\n for (var i = 0; i < properties.length; i++) {\n var property = properties[i];\n map = map.get(property);\n\n if (map === undefined) {\n return;\n }\n\n var propertyValue = key[property];\n map = map.get(propertyValue);\n\n if (map === undefined) {\n return;\n }\n }\n\n var valuePair = map.get('_ekm_value');\n\n if (!valuePair) {\n return;\n } // If reached, it implies that an object-like key was set with another\n // reference, so delete the reference and replace with the current.\n\n\n _map.delete(valuePair[0]);\n\n valuePair[0] = key;\n map.set('_ekm_value', valuePair);\n\n _map.set(key, valuePair);\n\n return valuePair;\n}\n/**\n * Variant of a Map object which enables lookup by equivalent (deeply equal)\n * object and array keys.\n */\n\n\nvar EquivalentKeyMap =\n/*#__PURE__*/\nfunction () {\n /**\n * Constructs a new instance of EquivalentKeyMap.\n *\n * @param {Iterable.<*>} iterable Initial pair of key, value for map.\n */\n function EquivalentKeyMap(iterable) {\n _classCallCheck(this, EquivalentKeyMap);\n\n this.clear();\n\n if (iterable instanceof EquivalentKeyMap) {\n // Map#forEach is only means of iterating with support for IE11.\n var iterablePairs = [];\n iterable.forEach(function (value, key) {\n iterablePairs.push([key, value]);\n });\n iterable = iterablePairs;\n }\n\n if (iterable != null) {\n for (var i = 0; i < iterable.length; i++) {\n this.set(iterable[i][0], iterable[i][1]);\n }\n }\n }\n /**\n * Accessor property returning the number of elements.\n *\n * @return {number} Number of elements.\n */\n\n\n _createClass(EquivalentKeyMap, [{\n key: \"set\",\n\n /**\n * Add or update an element with a specified key and value.\n *\n * @param {*} key The key of the element to add.\n * @param {*} value The value of the element to add.\n *\n * @return {EquivalentKeyMap} Map instance.\n */\n value: function set(key, value) {\n // Shortcut non-object-like to set on internal Map.\n if (key === null || _typeof(key) !== 'object') {\n this._map.set(key, value);\n\n return this;\n } // Sort keys to ensure stable assignment into tree.\n\n\n var properties = Object.keys(key).sort();\n var valuePair = [key, value]; // Tree by type to avoid conflicts on numeric object keys, empty value.\n\n var map = Array.isArray(key) ? this._arrayTreeMap : this._objectTreeMap;\n\n for (var i = 0; i < properties.length; i++) {\n var property = properties[i];\n\n if (!map.has(property)) {\n map.set(property, new EquivalentKeyMap());\n }\n\n map = map.get(property);\n var propertyValue = key[property];\n\n if (!map.has(propertyValue)) {\n map.set(propertyValue, new EquivalentKeyMap());\n }\n\n map = map.get(propertyValue);\n } // If an _ekm_value exists, there was already an equivalent key. Before\n // overriding, ensure that the old key reference is removed from map to\n // avoid memory leak of accumulating equivalent keys. This is, in a\n // sense, a poor man's WeakMap, while still enabling iterability.\n\n\n var previousValuePair = map.get('_ekm_value');\n\n if (previousValuePair) {\n this._map.delete(previousValuePair[0]);\n }\n\n map.set('_ekm_value', valuePair);\n\n this._map.set(key, valuePair);\n\n return this;\n }\n /**\n * Returns a specified element.\n *\n * @param {*} key The key of the element to return.\n *\n * @return {?*} The element associated with the specified key or undefined\n * if the key can't be found.\n */\n\n }, {\n key: \"get\",\n value: function get(key) {\n // Shortcut non-object-like to get from internal Map.\n if (key === null || _typeof(key) !== 'object') {\n return this._map.get(key);\n }\n\n var valuePair = getValuePair(this, key);\n\n if (valuePair) {\n return valuePair[1];\n }\n }\n /**\n * Returns a boolean indicating whether an element with the specified key\n * exists or not.\n *\n * @param {*} key The key of the element to test for presence.\n *\n * @return {boolean} Whether an element with the specified key exists.\n */\n\n }, {\n key: \"has\",\n value: function has(key) {\n if (key === null || _typeof(key) !== 'object') {\n return this._map.has(key);\n } // Test on the _presence_ of the pair, not its value, as even undefined\n // can be a valid member value for a key.\n\n\n return getValuePair(this, key) !== undefined;\n }\n /**\n * Removes the specified element.\n *\n * @param {*} key The key of the element to remove.\n *\n * @return {boolean} Returns true if an element existed and has been\n * removed, or false if the element does not exist.\n */\n\n }, {\n key: \"delete\",\n value: function _delete(key) {\n if (!this.has(key)) {\n return false;\n } // This naive implementation will leave orphaned child trees. A better\n // implementation should traverse and remove orphans.\n\n\n this.set(key, undefined);\n return true;\n }\n /**\n * Executes a provided function once per each key/value pair, in insertion\n * order.\n *\n * @param {Function} callback Function to execute for each element.\n * @param {*} thisArg Value to use as `this` when executing\n * `callback`.\n */\n\n }, {\n key: \"forEach\",\n value: function forEach(callback) {\n var _this = this;\n\n var thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this;\n\n this._map.forEach(function (value, key) {\n // Unwrap value from object-like value pair.\n if (key !== null && _typeof(key) === 'object') {\n value = value[1];\n }\n\n callback.call(thisArg, value, key, _this);\n });\n }\n /**\n * Removes all elements.\n */\n\n }, {\n key: \"clear\",\n value: function clear() {\n this._map = new Map();\n this._arrayTreeMap = new Map();\n this._objectTreeMap = new Map();\n }\n }, {\n key: \"size\",\n get: function get() {\n return this._map.size;\n }\n }]);\n\n return EquivalentKeyMap;\n}();\n\nmodule.exports = EquivalentKeyMap;\n", "module.exports = window.wp.reduxRoutine;", "module.exports = window.wp.compose;", "module.exports = window.wp.privateApis;", "'use strict';\n\nvar isMergeableObject = function isMergeableObject(value) {\n\treturn isNonNullObject(value)\n\t\t&& !isSpecial(value)\n};\n\nfunction isNonNullObject(value) {\n\treturn !!value && typeof value === 'object'\n}\n\nfunction isSpecial(value) {\n\tvar stringValue = Object.prototype.toString.call(value);\n\n\treturn stringValue === '[object RegExp]'\n\t\t|| stringValue === '[object Date]'\n\t\t|| isReactElement(value)\n}\n\n// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25\nvar canUseSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;\n\nfunction isReactElement(value) {\n\treturn value.$$typeof === REACT_ELEMENT_TYPE\n}\n\nfunction emptyTarget(val) {\n\treturn Array.isArray(val) ? [] : {}\n}\n\nfunction cloneUnlessOtherwiseSpecified(value, options) {\n\treturn (options.clone !== false && options.isMergeableObject(value))\n\t\t? deepmerge(emptyTarget(value), value, options)\n\t\t: value\n}\n\nfunction defaultArrayMerge(target, source, options) {\n\treturn target.concat(source).map(function(element) {\n\t\treturn cloneUnlessOtherwiseSpecified(element, options)\n\t})\n}\n\nfunction getMergeFunction(key, options) {\n\tif (!options.customMerge) {\n\t\treturn deepmerge\n\t}\n\tvar customMerge = options.customMerge(key);\n\treturn typeof customMerge === 'function' ? customMerge : deepmerge\n}\n\nfunction getEnumerableOwnPropertySymbols(target) {\n\treturn Object.getOwnPropertySymbols\n\t\t? Object.getOwnPropertySymbols(target).filter(function(symbol) {\n\t\t\treturn Object.propertyIsEnumerable.call(target, symbol)\n\t\t})\n\t\t: []\n}\n\nfunction getKeys(target) {\n\treturn Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))\n}\n\nfunction propertyIsOnObject(object, property) {\n\ttry {\n\t\treturn property in object\n\t} catch(_) {\n\t\treturn false\n\t}\n}\n\n// Protects from prototype poisoning and unexpected merging up the prototype chain.\nfunction propertyIsUnsafe(target, key) {\n\treturn propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,\n\t\t&& !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,\n\t\t\t&& Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable.\n}\n\nfunction mergeObject(target, source, options) {\n\tvar destination = {};\n\tif (options.isMergeableObject(target)) {\n\t\tgetKeys(target).forEach(function(key) {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(target[key], options);\n\t\t});\n\t}\n\tgetKeys(source).forEach(function(key) {\n\t\tif (propertyIsUnsafe(target, key)) {\n\t\t\treturn\n\t\t}\n\n\t\tif (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {\n\t\t\tdestination[key] = getMergeFunction(key, options)(target[key], source[key], options);\n\t\t} else {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(source[key], options);\n\t\t}\n\t});\n\treturn destination\n}\n\nfunction deepmerge(target, source, options) {\n\toptions = options || {};\n\toptions.arrayMerge = options.arrayMerge || defaultArrayMerge;\n\toptions.isMergeableObject = options.isMergeableObject || isMergeableObject;\n\t// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()\n\t// implementations can use it. The caller may not replace it.\n\toptions.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;\n\n\tvar sourceIsArray = Array.isArray(source);\n\tvar targetIsArray = Array.isArray(target);\n\tvar sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;\n\n\tif (!sourceAndTargetTypesMatch) {\n\t\treturn cloneUnlessOtherwiseSpecified(source, options)\n\t} else if (sourceIsArray) {\n\t\treturn options.arrayMerge(target, source, options)\n\t} else {\n\t\treturn mergeObject(target, source, options)\n\t}\n}\n\ndeepmerge.all = function deepmergeAll(array, options) {\n\tif (!Array.isArray(array)) {\n\t\tthrow new Error('first argument should be an array')\n\t}\n\n\treturn array.reduce(function(prev, next) {\n\t\treturn deepmerge(prev, next, options)\n\t}, {})\n};\n\nvar deepmerge_1 = deepmerge;\n\nmodule.exports = deepmerge_1;\n", "module.exports = window.wp.priorityQueue;", "module.exports = window.wp.element;", "module.exports = window.wp.isShallowEqual;", "module.exports = window.ReactJSXRuntime;", "/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport createReduxStore from './redux-store';\nimport coreDataStore from './store';\nimport { createEmitter } from './utils/emitter';\nimport { lock, unlock } from './lock-unlock';\n\n/** @typedef {import('./types').StoreDescriptor} StoreDescriptor */\n\n/**\n * @typedef {Object} WPDataRegistry An isolated orchestrator of store registrations.\n *\n * @property {Function} registerGenericStore Given a namespace key and settings\n * object, registers a new generic\n * store.\n * @property {Function} registerStore Given a namespace key and settings\n * object, registers a new namespace\n * store.\n * @property {Function} subscribe Given a function callback, invokes\n * the callback on any change to state\n * within any registered store.\n * @property {Function} select Given a namespace key, returns an\n * object of the store's registered\n * selectors.\n * @property {Function} dispatch Given a namespace key, returns an\n * object of the store's registered\n * action dispatchers.\n */\n\n/**\n * @typedef {Object} WPDataPlugin An object of registry function overrides.\n *\n * @property {Function} registerStore registers store.\n */\n\nfunction getStoreName( storeNameOrDescriptor ) {\n\treturn typeof storeNameOrDescriptor === 'string'\n\t\t? storeNameOrDescriptor\n\t\t: storeNameOrDescriptor.name;\n}\n/**\n * Creates a new store registry, given an optional object of initial store\n * configurations.\n *\n * @param {Object} storeConfigs Initial store configurations.\n * @param {?Object} parent Parent registry.\n *\n * @return {WPDataRegistry} Data registry.\n */\nexport function createRegistry( storeConfigs = {}, parent = null ) {\n\tconst stores = {};\n\tconst emitter = createEmitter();\n\tlet listeningStores = null;\n\n\t/**\n\t * Global listener called for each store's update.\n\t */\n\tfunction globalListener() {\n\t\temitter.emit();\n\t}\n\n\t/**\n\t * Subscribe to changes to any data, either in all stores in registry, or\n\t * in one specific store.\n\t *\n\t * @param {Function} listener Listener function.\n\t * @param {string|StoreDescriptor?} storeNameOrDescriptor Optional store name.\n\t *\n\t * @return {Function} Unsubscribe function.\n\t */\n\tconst subscribe = ( listener, storeNameOrDescriptor ) => {\n\t\t// subscribe to all stores\n\t\tif ( ! storeNameOrDescriptor ) {\n\t\t\treturn emitter.subscribe( listener );\n\t\t}\n\n\t\t// subscribe to one store\n\t\tconst storeName = getStoreName( storeNameOrDescriptor );\n\t\tconst store = stores[ storeName ];\n\t\tif ( store ) {\n\t\t\treturn store.subscribe( listener );\n\t\t}\n\n\t\t// Trying to access a store that hasn't been registered,\n\t\t// this is a pattern rarely used but seen in some places.\n\t\t// We fallback to global `subscribe` here for backward-compatibility for now.\n\t\t// See https://github.com/WordPress/gutenberg/pull/27466 for more info.\n\t\tif ( ! parent ) {\n\t\t\treturn emitter.subscribe( listener );\n\t\t}\n\n\t\treturn parent.subscribe( listener, storeNameOrDescriptor );\n\t};\n\n\t/**\n\t * Calls a selector given the current state and extra arguments.\n\t *\n\t * @param {string|StoreDescriptor} storeNameOrDescriptor Unique namespace identifier for the store\n\t * or the store descriptor.\n\t *\n\t * @return {*} The selector's returned value.\n\t */\n\tfunction select( storeNameOrDescriptor ) {\n\t\tconst storeName = getStoreName( storeNameOrDescriptor );\n\t\tlisteningStores?.add( storeName );\n\t\tconst store = stores[ storeName ];\n\t\tif ( store ) {\n\t\t\treturn store.getSelectors();\n\t\t}\n\n\t\treturn parent?.select( storeName );\n\t}\n\n\tfunction __unstableMarkListeningStores( callback, ref ) {\n\t\tlisteningStores = new Set();\n\t\ttry {\n\t\t\treturn callback.call( this );\n\t\t} finally {\n\t\t\tref.current = Array.from( listeningStores );\n\t\t\tlisteningStores = null;\n\t\t}\n\t}\n\n\t/**\n\t * Given a store descriptor, returns an object containing the store's selectors pre-bound to\n\t * state so that you only need to supply additional arguments, and modified so that they return\n\t * promises that resolve to their eventual values, after any resolvers have ran.\n\t *\n\t * @param {StoreDescriptor|string} storeNameOrDescriptor The store descriptor. The legacy calling\n\t * convention of passing the store name is\n\t * also supported.\n\t *\n\t * @return {Object} Each key of the object matches the name of a selector.\n\t */\n\tfunction resolveSelect( storeNameOrDescriptor ) {\n\t\tconst storeName = getStoreName( storeNameOrDescriptor );\n\t\tlisteningStores?.add( storeName );\n\t\tconst store = stores[ storeName ];\n\t\tif ( store ) {\n\t\t\treturn store.getResolveSelectors();\n\t\t}\n\n\t\treturn parent && parent.resolveSelect( storeName );\n\t}\n\n\t/**\n\t * Given a store descriptor, returns an object containing the store's selectors pre-bound to\n\t * state so that you only need to supply additional arguments, and modified so that they throw\n\t * promises in case the selector is not resolved yet.\n\t *\n\t * @param {StoreDescriptor|string} storeNameOrDescriptor The store descriptor. The legacy calling\n\t * convention of passing the store name is\n\t * also supported.\n\t *\n\t * @return {Object} Object containing the store's suspense-wrapped selectors.\n\t */\n\tfunction suspendSelect( storeNameOrDescriptor ) {\n\t\tconst storeName = getStoreName( storeNameOrDescriptor );\n\t\tlisteningStores?.add( storeName );\n\t\tconst store = stores[ storeName ];\n\t\tif ( store ) {\n\t\t\treturn store.getSuspendSelectors();\n\t\t}\n\n\t\treturn parent && parent.suspendSelect( storeName );\n\t}\n\n\t/**\n\t * Returns the available actions for a part of the state.\n\t *\n\t * @param {string|StoreDescriptor} storeNameOrDescriptor Unique namespace identifier for the store\n\t * or the store descriptor.\n\t *\n\t * @return {*} The action's returned value.\n\t */\n\tfunction dispatch( storeNameOrDescriptor ) {\n\t\tconst storeName = getStoreName( storeNameOrDescriptor );\n\t\tconst store = stores[ storeName ];\n\t\tif ( store ) {\n\t\t\treturn store.getActions();\n\t\t}\n\n\t\treturn parent && parent.dispatch( storeName );\n\t}\n\n\t//\n\t// Deprecated\n\t// TODO: Remove this after `use()` is removed.\n\tfunction withPlugins( attributes ) {\n\t\treturn Object.fromEntries(\n\t\t\tObject.entries( attributes ).map( ( [ key, attribute ] ) => {\n\t\t\t\tif ( typeof attribute !== 'function' ) {\n\t\t\t\t\treturn [ key, attribute ];\n\t\t\t\t}\n\t\t\t\treturn [\n\t\t\t\t\tkey,\n\t\t\t\t\tfunction () {\n\t\t\t\t\t\treturn registry[ key ].apply( null, arguments );\n\t\t\t\t\t},\n\t\t\t\t];\n\t\t\t} )\n\t\t);\n\t}\n\n\t/**\n\t * Registers a store instance.\n\t *\n\t * @param {string} name Store registry name.\n\t * @param {Function} createStore Function that creates a store object (getSelectors, getActions, subscribe).\n\t */\n\tfunction registerStoreInstance( name, createStore ) {\n\t\tif ( stores[ name ] ) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.error( 'Store \"' + name + '\" is already registered.' );\n\t\t\treturn stores[ name ];\n\t\t}\n\n\t\tconst store = createStore();\n\n\t\tif ( typeof store.getSelectors !== 'function' ) {\n\t\t\tthrow new TypeError( 'store.getSelectors must be a function' );\n\t\t}\n\t\tif ( typeof store.getActions !== 'function' ) {\n\t\t\tthrow new TypeError( 'store.getActions must be a function' );\n\t\t}\n\t\tif ( typeof store.subscribe !== 'function' ) {\n\t\t\tthrow new TypeError( 'store.subscribe must be a function' );\n\t\t}\n\t\t// The emitter is used to keep track of active listeners when the registry\n\t\t// get paused, that way, when resumed we should be able to call all these\n\t\t// pending listeners.\n\t\tstore.emitter = createEmitter();\n\t\tconst currentSubscribe = store.subscribe;\n\t\tstore.subscribe = ( listener ) => {\n\t\t\tconst unsubscribeFromEmitter = store.emitter.subscribe( listener );\n\t\t\tconst unsubscribeFromStore = currentSubscribe( () => {\n\t\t\t\tif ( store.emitter.isPaused ) {\n\t\t\t\t\tstore.emitter.emit();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tlistener();\n\t\t\t} );\n\n\t\t\treturn () => {\n\t\t\t\tunsubscribeFromStore?.();\n\t\t\t\tunsubscribeFromEmitter?.();\n\t\t\t};\n\t\t};\n\t\tstores[ name ] = store;\n\t\tstore.subscribe( globalListener );\n\n\t\t// Copy private actions and selectors from the parent store.\n\t\tif ( parent ) {\n\t\t\ttry {\n\t\t\t\tunlock( store.store ).registerPrivateActions(\n\t\t\t\t\tunlock( parent ).privateActionsOf( name )\n\t\t\t\t);\n\t\t\t\tunlock( store.store ).registerPrivateSelectors(\n\t\t\t\t\tunlock( parent ).privateSelectorsOf( name )\n\t\t\t\t);\n\t\t\t} catch ( e ) {\n\t\t\t\t// unlock() throws if store.store was not locked.\n\t\t\t\t// The error indicates there's nothing to do here so let's\n\t\t\t\t// ignore it.\n\t\t\t}\n\t\t}\n\n\t\treturn store;\n\t}\n\n\t/**\n\t * Registers a new store given a store descriptor.\n\t *\n\t * @param {StoreDescriptor} store Store descriptor.\n\t */\n\tfunction register( store ) {\n\t\tregisterStoreInstance( store.name, () =>\n\t\t\tstore.instantiate( registry )\n\t\t);\n\t}\n\n\tfunction registerGenericStore( name, store ) {\n\t\tdeprecated( 'wp.data.registerGenericStore', {\n\t\t\tsince: '5.9',\n\t\t\talternative: 'wp.data.register( storeDescriptor )',\n\t\t} );\n\t\tregisterStoreInstance( name, () => store );\n\t}\n\n\t/**\n\t * Registers a standard `@wordpress/data` store.\n\t *\n\t * @param {string} storeName Unique namespace identifier.\n\t * @param {Object} options Store description (reducer, actions, selectors, resolvers).\n\t *\n\t * @return {Object} Registered store object.\n\t */\n\tfunction registerStore( storeName, options ) {\n\t\tif ( ! options.reducer ) {\n\t\t\tthrow new TypeError( 'Must specify store reducer' );\n\t\t}\n\n\t\tconst store = registerStoreInstance( storeName, () =>\n\t\t\tcreateReduxStore( storeName, options ).instantiate( registry )\n\t\t);\n\n\t\treturn store.store;\n\t}\n\n\tfunction batch( callback ) {\n\t\t// If we're already batching, just call the callback.\n\t\tif ( emitter.isPaused ) {\n\t\t\tcallback();\n\t\t\treturn;\n\t\t}\n\n\t\temitter.pause();\n\t\tObject.values( stores ).forEach( ( store ) => store.emitter.pause() );\n\t\ttry {\n\t\t\tcallback();\n\t\t} finally {\n\t\t\temitter.resume();\n\t\t\tObject.values( stores ).forEach( ( store ) =>\n\t\t\t\tstore.emitter.resume()\n\t\t\t);\n\t\t}\n\t}\n\n\tlet registry = {\n\t\tbatch,\n\t\tstores,\n\t\tnamespaces: stores, // TODO: Deprecate/remove this.\n\t\tsubscribe,\n\t\tselect,\n\t\tresolveSelect,\n\t\tsuspendSelect,\n\t\tdispatch,\n\t\tuse,\n\t\tregister,\n\t\tregisterGenericStore,\n\t\tregisterStore,\n\t\t__unstableMarkListeningStores,\n\t};\n\n\t//\n\t// TODO:\n\t// This function will be deprecated as soon as it is no longer internally referenced.\n\tfunction use( plugin, options ) {\n\t\tif ( ! plugin ) {\n\t\t\treturn;\n\t\t}\n\n\t\tregistry = {\n\t\t\t...registry,\n\t\t\t...plugin( registry, options ),\n\t\t};\n\n\t\treturn registry;\n\t}\n\n\tregistry.register( coreDataStore );\n\n\tfor ( const [ name, config ] of Object.entries( storeConfigs ) ) {\n\t\tregistry.register( createReduxStore( name, config ) );\n\t}\n\n\tif ( parent ) {\n\t\tparent.subscribe( globalListener );\n\t}\n\n\tconst registryWithPlugins = withPlugins( registry );\n\tlock( registryWithPlugins, {\n\t\tprivateActionsOf: ( name ) => {\n\t\t\ttry {\n\t\t\t\treturn unlock( stores[ name ].store ).privateActions;\n\t\t\t} catch ( e ) {\n\t\t\t\t// unlock() throws an error the store was not locked \u2013 this means\n\t\t\t\t// there no private actions are available\n\t\t\t\treturn {};\n\t\t\t}\n\t\t},\n\t\tprivateSelectorsOf: ( name ) => {\n\t\t\ttry {\n\t\t\t\treturn unlock( stores[ name ].store ).privateSelectors;\n\t\t\t} catch ( e ) {\n\t\t\t\treturn {};\n\t\t\t}\n\t\t},\n\t} );\n\treturn registryWithPlugins;\n}\n", "/**\n * Adapted from React: https://github.com/facebook/react/blob/master/packages/shared/formatProdErrorMessage.js\n *\n * Do not require this module directly! Use normal throw error calls. These messages will be replaced with error codes\n * during build.\n * @param {number} code\n */\nexport function formatProdErrorMessage(code: number) {\n 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. ';\n}", "declare global {\n interface SymbolConstructor {\n readonly observable: symbol;\n }\n}\nconst $$observable = /* #__PURE__ */(() => typeof Symbol === 'function' && Symbol.observable || '@@observable')();\nexport default $$observable;", "/**\n * These are private action types reserved by Redux.\n * For any unknown actions, you must return the current state.\n * If the current state is undefined, you must return the initial state.\n * Do not reference these action types directly in your code.\n */\n\nconst randomString = () => Math.random().toString(36).substring(7).split('').join('.');\nconst ActionTypes = {\n INIT: `@@redux/INIT${/* #__PURE__ */randomString()}`,\n REPLACE: `@@redux/REPLACE${/* #__PURE__ */randomString()}`,\n PROBE_UNKNOWN_ACTION: () => `@@redux/PROBE_UNKNOWN_ACTION${randomString()}`\n};\nexport default ActionTypes;", "/**\n * @param obj The object to inspect.\n * @returns True if the argument appears to be a plain object.\n */\nexport default function isPlainObject(obj: any): obj is object {\n if (typeof obj !== 'object' || obj === null) return false;\n let proto = obj;\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n return Object.getPrototypeOf(obj) === proto || Object.getPrototypeOf(obj) === null;\n}", "// Inlined / shortened version of `kindOf` from https://github.com/jonschlinkert/kind-of\nexport function miniKindOf(val: any): string {\n if (val === void 0) return 'undefined';\n if (val === null) return 'null';\n const type = typeof val;\n switch (type) {\n case 'boolean':\n case 'string':\n case 'number':\n case 'symbol':\n case 'function':\n {\n return type;\n }\n }\n if (Array.isArray(val)) return 'array';\n if (isDate(val)) return 'date';\n if (isError(val)) return 'error';\n const constructorName = ctorName(val);\n switch (constructorName) {\n case 'Symbol':\n case 'Promise':\n case 'WeakMap':\n case 'WeakSet':\n case 'Map':\n case 'Set':\n return constructorName;\n }\n\n // other\n return Object.prototype.toString.call(val).slice(8, -1).toLowerCase().replace(/\\s/g, '');\n}\nfunction ctorName(val: any): string | null {\n return typeof val.constructor === 'function' ? val.constructor.name : null;\n}\nfunction isError(val: any) {\n return val instanceof Error || typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number';\n}\nfunction isDate(val: any) {\n if (val instanceof Date) return true;\n return typeof val.toDateString === 'function' && typeof val.getDate === 'function' && typeof val.setDate === 'function';\n}\nexport function kindOf(val: any) {\n let typeOfVal: string = typeof val;\n if (process.env.NODE_ENV !== 'production') {\n typeOfVal = miniKindOf(val);\n }\n return typeOfVal;\n}", "import { formatProdErrorMessage as _formatProdErrorMessage13 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage12 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage11 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage10 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage9 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage8 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage7 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage6 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage5 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage4 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage3 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage2 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage } from \"src/utils/formatProdErrorMessage\";\nimport $$observable from './utils/symbol-observable';\nimport { Store, StoreEnhancer, Dispatch, Observer, ListenerCallback, UnknownIfNonSpecific } from './types/store';\nimport { Action } from './types/actions';\nimport { Reducer } from './types/reducers';\nimport ActionTypes from './utils/actionTypes';\nimport isPlainObject from './utils/isPlainObject';\nimport { kindOf } from './utils/kindOf';\n\n/**\n * @deprecated\n *\n * **We recommend using the `configureStore` method\n * of the `@reduxjs/toolkit` package**, which replaces `createStore`.\n *\n * Redux Toolkit is our recommended approach for writing Redux logic today,\n * including store setup, reducers, data fetching, and more.\n *\n * **For more details, please read this Redux docs page:**\n * **https://redux.js.org/introduction/why-rtk-is-redux-today**\n *\n * `configureStore` from Redux Toolkit is an improved version of `createStore` that\n * simplifies setup and helps avoid common bugs.\n *\n * You should not be using the `redux` core package by itself today, except for learning purposes.\n * The `createStore` method from the core `redux` package will not be removed, but we encourage\n * all users to migrate to using Redux Toolkit for all Redux code.\n *\n * If you want to use `createStore` without this visual deprecation warning, use\n * the `legacy_createStore` import instead:\n *\n * `import { legacy_createStore as createStore} from 'redux'`\n *\n */\nexport function createStore<S, A extends Action, Ext extends {} = {}, StateExt extends {} = {}>(reducer: Reducer<S, A>, enhancer?: StoreEnhancer<Ext, StateExt>): Store<S, A, UnknownIfNonSpecific<StateExt>> & Ext;\n/**\n * @deprecated\n *\n * **We recommend using the `configureStore` method\n * of the `@reduxjs/toolkit` package**, which replaces `createStore`.\n *\n * Redux Toolkit is our recommended approach for writing Redux logic today,\n * including store setup, reducers, data fetching, and more.\n *\n * **For more details, please read this Redux docs page:**\n * **https://redux.js.org/introduction/why-rtk-is-redux-today**\n *\n * `configureStore` from Redux Toolkit is an improved version of `createStore` that\n * simplifies setup and helps avoid common bugs.\n *\n * You should not be using the `redux` core package by itself today, except for learning purposes.\n * The `createStore` method from the core `redux` package will not be removed, but we encourage\n * all users to migrate to using Redux Toolkit for all Redux code.\n *\n * If you want to use `createStore` without this visual deprecation warning, use\n * the `legacy_createStore` import instead:\n *\n * `import { legacy_createStore as createStore} from 'redux'`\n *\n */\nexport function createStore<S, A extends Action, Ext extends {} = {}, StateExt extends {} = {}, PreloadedState = S>(reducer: Reducer<S, A, PreloadedState>, preloadedState?: PreloadedState | undefined, enhancer?: StoreEnhancer<Ext, StateExt>): Store<S, A, UnknownIfNonSpecific<StateExt>> & Ext;\nexport function createStore<S, A extends Action, Ext extends {} = {}, StateExt extends {} = {}, PreloadedState = S>(reducer: Reducer<S, A, PreloadedState>, preloadedState?: PreloadedState | StoreEnhancer<Ext, StateExt> | undefined, enhancer?: StoreEnhancer<Ext, StateExt>): Store<S, A, UnknownIfNonSpecific<StateExt>> & Ext {\n if (typeof reducer !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage(2) : `Expected the root reducer to be a function. Instead, received: '${kindOf(reducer)}'`);\n }\n if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage2(0) : 'It looks like you are passing several store enhancers to ' + 'createStore(). This is not supported. Instead, compose them ' + 'together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.');\n }\n if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {\n enhancer = (preloadedState as StoreEnhancer<Ext, StateExt>);\n preloadedState = undefined;\n }\n if (typeof enhancer !== 'undefined') {\n if (typeof enhancer !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage3(1) : `Expected the enhancer to be a function. Instead, received: '${kindOf(enhancer)}'`);\n }\n return enhancer(createStore)(reducer, (preloadedState as PreloadedState | undefined));\n }\n let currentReducer = reducer;\n let currentState: S | PreloadedState | undefined = (preloadedState as PreloadedState | undefined);\n let currentListeners: Map<number, ListenerCallback> | null = new Map();\n let nextListeners = currentListeners;\n let listenerIdCounter = 0;\n let isDispatching = false;\n\n /**\n * This makes a shallow copy of currentListeners so we can use\n * nextListeners as a temporary list while dispatching.\n *\n * This prevents any bugs around consumers calling\n * subscribe/unsubscribe in the middle of a dispatch.\n */\n function ensureCanMutateNextListeners() {\n if (nextListeners === currentListeners) {\n nextListeners = new Map();\n currentListeners.forEach((listener, key) => {\n nextListeners.set(key, listener);\n });\n }\n }\n\n /**\n * Reads the state tree managed by the store.\n *\n * @returns The current state tree of your application.\n */\n function getState(): S {\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage4(3) : 'You may not call store.getState() while the reducer is executing. ' + 'The reducer has already received the state as an argument. ' + 'Pass it down from the top reducer instead of reading it from the store.');\n }\n return (currentState as S);\n }\n\n /**\n * Adds a change listener. It will be called any time an action is dispatched,\n * and some part of the state tree may potentially have changed. You may then\n * call `getState()` to read the current state tree inside the callback.\n *\n * You may call `dispatch()` from a change listener, with the following\n * caveats:\n *\n * 1. The subscriptions are snapshotted just before every `dispatch()` call.\n * If you subscribe or unsubscribe while the listeners are being invoked, this\n * will not have any effect on the `dispatch()` that is currently in progress.\n * However, the next `dispatch()` call, whether nested or not, will use a more\n * recent snapshot of the subscription list.\n *\n * 2. The listener should not expect to see all state changes, as the state\n * might have been updated multiple times during a nested `dispatch()` before\n * the listener is called. It is, however, guaranteed that all subscribers\n * registered before the `dispatch()` started will be called with the latest\n * state by the time it exits.\n *\n * @param listener A callback to be invoked on every dispatch.\n * @returns A function to remove this change listener.\n */\n function subscribe(listener: () => void) {\n if (typeof listener !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage5(4) : `Expected the listener to be a function. Instead, received: '${kindOf(listener)}'`);\n }\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage6(5) : 'You may not call store.subscribe() while the reducer is executing. ' + 'If you would like to be notified after the store has been updated, subscribe from a ' + 'component and invoke store.getState() in the callback to access the latest state. ' + 'See https://redux.js.org/api/store#subscribelistener for more details.');\n }\n let isSubscribed = true;\n ensureCanMutateNextListeners();\n const listenerId = listenerIdCounter++;\n nextListeners.set(listenerId, listener);\n return function unsubscribe() {\n if (!isSubscribed) {\n return;\n }\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage7(6) : 'You may not unsubscribe from a store listener while the reducer is executing. ' + 'See https://redux.js.org/api/store#subscribelistener for more details.');\n }\n isSubscribed = false;\n ensureCanMutateNextListeners();\n nextListeners.delete(listenerId);\n currentListeners = null;\n };\n }\n\n /**\n * Dispatches an action. It is the only way to trigger a state change.\n *\n * The `reducer` function, used to create the store, will be called with the\n * current state tree and the given `action`. Its return value will\n * be considered the **next** state of the tree, and the change listeners\n * will be notified.\n *\n * The base implementation only supports plain object actions. If you want to\n * dispatch a Promise, an Observable, a thunk, or something else, you need to\n * wrap your store creating function into the corresponding middleware. For\n * example, see the documentation for the `redux-thunk` package. Even the\n * middleware will eventually dispatch plain object actions using this method.\n *\n * @param action A plain object representing “what changed”. It is\n * a good idea to keep actions serializable so you can record and replay user\n * sessions, or use the time travelling `redux-devtools`. An action must have\n * a `type` property which may not be `undefined`. It is a good idea to use\n * string constants for action types.\n *\n * @returns For convenience, the same action object you dispatched.\n *\n * Note that, if you use a custom middleware, it may wrap `dispatch()` to\n * return something else (for example, a Promise you can await).\n */\n function dispatch(action: A) {\n if (!isPlainObject(action)) {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage8(7) : `Actions must be plain objects. Instead, the actual type was: '${kindOf(action)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);\n }\n if (typeof action.type === 'undefined') {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage9(8) : 'Actions may not have an undefined \"type\" property. You may have misspelled an action type string constant.');\n }\n if (typeof action.type !== 'string') {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage10(17) : `Action \"type\" property must be a string. Instead, the actual type was: '${kindOf(action.type)}'. Value was: '${action.type}' (stringified)`);\n }\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage11(9) : 'Reducers may not dispatch actions.');\n }\n try {\n isDispatching = true;\n currentState = currentReducer(currentState, action);\n } finally {\n isDispatching = false;\n }\n const listeners = currentListeners = nextListeners;\n listeners.forEach(listener => {\n listener();\n });\n return action;\n }\n\n /**\n * Replaces the reducer currently used by the store to calculate the state.\n *\n * You might need this if your app implements code splitting and you want to\n * load some of the reducers dynamically. You might also need this if you\n * implement a hot reloading mechanism for Redux.\n *\n * @param nextReducer The reducer for the store to use instead.\n */\n function replaceReducer(nextReducer: Reducer<S, A>): void {\n if (typeof nextReducer !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage12(10) : `Expected the nextReducer to be a function. Instead, received: '${kindOf(nextReducer)}`);\n }\n currentReducer = ((nextReducer as unknown) as Reducer<S, A, PreloadedState>);\n\n // This action has a similar effect to ActionTypes.INIT.\n // Any reducers that existed in both the new and old rootReducer\n // will receive the previous state. This effectively populates\n // the new state tree with any relevant data from the old one.\n dispatch(({\n type: ActionTypes.REPLACE\n } as A));\n }\n\n /**\n * Interoperability point for observable/reactive libraries.\n * @returns A minimal observable of state changes.\n * For more information, see the observable proposal:\n * https://github.com/tc39/proposal-observable\n */\n function observable() {\n const outerSubscribe = subscribe;\n return {\n /**\n * The minimal observable subscription method.\n * @param observer Any object that can be used as an observer.\n * The observer object should have a `next` method.\n * @returns An object with an `unsubscribe` method that can\n * be used to unsubscribe the observable from the store, and prevent further\n * emission of values from the observable.\n */\n subscribe(observer: unknown) {\n if (typeof observer !== 'object' || observer === null) {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage13(11) : `Expected the observer to be an object. Instead, received: '${kindOf(observer)}'`);\n }\n function observeState() {\n const observerAsObserver = (observer as Observer<S>);\n if (observerAsObserver.next) {\n observerAsObserver.next(getState());\n }\n }\n observeState();\n const unsubscribe = outerSubscribe(observeState);\n return {\n unsubscribe\n };\n },\n [$$observable]() {\n return this;\n }\n };\n }\n\n // When a store is created, an \"INIT\" action is dispatched so that every\n // reducer returns their initial state. This effectively populates\n // the initial state tree.\n dispatch(({\n type: ActionTypes.INIT\n } as A));\n const store = (({\n dispatch: (dispatch as Dispatch<A>),\n subscribe,\n getState,\n replaceReducer,\n [$$observable]: observable\n } as unknown) as Store<S, A, StateExt> & Ext);\n return store;\n}\n\n/**\n * Creates a Redux store that holds the state tree.\n *\n * **We recommend using `configureStore` from the\n * `@reduxjs/toolkit` package**, which replaces `createStore`:\n * **https://redux.js.org/introduction/why-rtk-is-redux-today**\n *\n * The only way to change the data in the store is to call `dispatch()` on it.\n *\n * There should only be a single store in your app. To specify how different\n * parts of the state tree respond to actions, you may combine several reducers\n * into a single reducer function by using `combineReducers`.\n *\n * @param {Function} reducer A function that returns the next state tree, given\n * the current state tree and the action to handle.\n *\n * @param {any} [preloadedState] The initial state. You may optionally specify it\n * to hydrate the state from the server in universal apps, or to restore a\n * previously serialized user session.\n * If you use `combineReducers` to produce the root reducer function, this must be\n * an object with the same shape as `combineReducers` keys.\n *\n * @param {Function} [enhancer] The store enhancer. You may optionally specify it\n * to enhance the store with third-party capabilities such as middleware,\n * time travel, persistence, etc. The only store enhancer that ships with Redux\n * is `applyMiddleware()`.\n *\n * @returns {Store} A Redux store that lets you read the state, dispatch actions\n * and subscribe to changes.\n */\nexport function legacy_createStore<S, A extends Action, Ext extends {} = {}, StateExt extends {} = {}>(reducer: Reducer<S, A>, enhancer?: StoreEnhancer<Ext, StateExt>): Store<S, A, UnknownIfNonSpecific<StateExt>> & Ext;\n/**\n * Creates a Redux store that holds the state tree.\n *\n * **We recommend using `configureStore` from the\n * `@reduxjs/toolkit` package**, which replaces `createStore`:\n * **https://redux.js.org/introduction/why-rtk-is-redux-today**\n *\n * The only way to change the data in the store is to call `dispatch()` on it.\n *\n * There should only be a single store in your app. To specify how different\n * parts of the state tree respond to actions, you may combine several reducers\n * into a single reducer function by using `combineReducers`.\n *\n * @param {Function} reducer A function that returns the next state tree, given\n * the current state tree and the action to handle.\n *\n * @param {any} [preloadedState] The initial state. You may optionally specify it\n * to hydrate the state from the server in universal apps, or to restore a\n * previously serialized user session.\n * If you use `combineReducers` to produce the root reducer function, this must be\n * an object with the same shape as `combineReducers` keys.\n *\n * @param {Function} [enhancer] The store enhancer. You may optionally specify it\n * to enhance the store with third-party capabilities such as middleware,\n * time travel, persistence, etc. The only store enhancer that ships with Redux\n * is `applyMiddleware()`.\n *\n * @returns {Store} A Redux store that lets you read the state, dispatch actions\n * and subscribe to changes.\n */\nexport function legacy_createStore<S, A extends Action, Ext extends {} = {}, StateExt extends {} = {}, PreloadedState = S>(reducer: Reducer<S, A, PreloadedState>, preloadedState?: PreloadedState | undefined, enhancer?: StoreEnhancer<Ext, StateExt>): Store<S, A, UnknownIfNonSpecific<StateExt>> & Ext;\nexport function legacy_createStore<S, A extends Action, Ext extends {} = {}, StateExt extends {} = {}, PreloadedState = S>(reducer: Reducer<S, A>, preloadedState?: PreloadedState | StoreEnhancer<Ext, StateExt> | undefined, enhancer?: StoreEnhancer<Ext, StateExt>): Store<S, A, UnknownIfNonSpecific<StateExt>> & Ext {\n return createStore(reducer, (preloadedState as any), enhancer);\n}", "/**\n * Prints a warning in the console if it exists.\n *\n * @param message The warning message.\n */\nexport default function warning(message: string): void {\n /* eslint-disable no-console */\n if (typeof console !== 'undefined' && typeof console.error === 'function') {\n console.error(message);\n }\n /* eslint-enable no-console */\n try {\n // This error was thrown as a convenience so that if you enable\n // \"break on all exceptions\" in your console,\n // it would pause the execution at this line.\n throw new Error(message);\n } catch (e) {} // eslint-disable-line no-empty\n}", "import { formatProdErrorMessage as _formatProdErrorMessage3 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage2 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage } from \"src/utils/formatProdErrorMessage\";\nimport { Action } from './types/actions';\nimport { ActionFromReducersMapObject, PreloadedStateShapeFromReducersMapObject, Reducer, StateFromReducersMapObject } from './types/reducers';\nimport ActionTypes from './utils/actionTypes';\nimport isPlainObject from './utils/isPlainObject';\nimport warning from './utils/warning';\nimport { kindOf } from './utils/kindOf';\nfunction getUnexpectedStateShapeWarningMessage(inputState: object, reducers: {\n [key: string]: Reducer<any, any, any>;\n}, action: Action, unexpectedKeyCache: {\n [key: string]: true;\n}) {\n const reducerKeys = Object.keys(reducers);\n const argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';\n if (reducerKeys.length === 0) {\n return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';\n }\n if (!isPlainObject(inputState)) {\n return `The ${argumentName} has unexpected type of \"${kindOf(inputState)}\". Expected argument to be an object with the following ` + `keys: \"${reducerKeys.join('\", \"')}\"`;\n }\n const unexpectedKeys = Object.keys(inputState).filter(key => !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key]);\n unexpectedKeys.forEach(key => {\n unexpectedKeyCache[key] = true;\n });\n if (action && action.type === ActionTypes.REPLACE) return;\n if (unexpectedKeys.length > 0) {\n 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.`;\n }\n}\nfunction assertReducerShape(reducers: {\n [key: string]: Reducer<any, any, any>;\n}) {\n Object.keys(reducers).forEach(key => {\n const reducer = reducers[key];\n const initialState = reducer(undefined, {\n type: ActionTypes.INIT\n });\n if (typeof initialState === 'undefined') {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage(12) : `The slice reducer for key \"${key}\" returned undefined during initialization. ` + `If the state passed to the reducer is undefined, you must ` + `explicitly return the initial state. The initial state may ` + `not be undefined. If you don't want to set a value for this reducer, ` + `you can use null instead of undefined.`);\n }\n if (typeof reducer(undefined, {\n type: ActionTypes.PROBE_UNKNOWN_ACTION()\n }) === 'undefined') {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage2(13) : `The slice reducer for key \"${key}\" returned undefined when probed with a random type. ` + `Don't try to handle '${ActionTypes.INIT}' or other actions in \"redux/*\" ` + `namespace. They are considered private. Instead, you must return the ` + `current state for any unknown actions, unless it is undefined, ` + `in which case you must return the initial state, regardless of the ` + `action type. The initial state may not be undefined, but can be null.`);\n }\n });\n}\n\n/**\n * Turns an object whose values are different reducer functions, into a single\n * reducer function. It will call every child reducer, and gather their results\n * into a single state object, whose keys correspond to the keys of the passed\n * reducer functions.\n *\n * @template S Combined state object type.\n *\n * @param reducers An object whose values correspond to different reducer\n * functions that need to be combined into one. One handy way to obtain it\n * is to use `import * as reducers` syntax. The reducers may never\n * return undefined for any action. Instead, they should return their\n * initial state if the state passed to them was undefined, and the current\n * state for any unrecognized action.\n *\n * @returns A reducer function that invokes every reducer inside the passed\n * object, and builds a state object with the same shape.\n */\nexport default function combineReducers<M>(reducers: M): M[keyof M] extends Reducer<any, any, any> | undefined ? Reducer<StateFromReducersMapObject<M>, ActionFromReducersMapObject<M>, Partial<PreloadedStateShapeFromReducersMapObject<M>>> : never;\nexport default function combineReducers(reducers: {\n [key: string]: Reducer<any, any, any>;\n}) {\n const reducerKeys = Object.keys(reducers);\n const finalReducers: {\n [key: string]: Reducer<any, any, any>;\n } = {};\n for (let i = 0; i < reducerKeys.length; i++) {\n const key = reducerKeys[i];\n if (process.env.NODE_ENV !== 'production') {\n if (typeof reducers[key] === 'undefined') {\n warning(`No reducer provided for key \"${key}\"`);\n }\n }\n if (typeof reducers[key] === 'function') {\n finalReducers[key] = reducers[key];\n }\n }\n const finalReducerKeys = Object.keys(finalReducers);\n\n // This is used to make sure we don't warn about the same\n // keys multiple times.\n let unexpectedKeyCache: {\n [key: string]: true;\n };\n if (process.env.NODE_ENV !== 'production') {\n unexpectedKeyCache = {};\n }\n let shapeAssertionError: unknown;\n try {\n assertReducerShape(finalReducers);\n } catch (e) {\n shapeAssertionError = e;\n }\n return function combination(state: StateFromReducersMapObject<typeof reducers> = {}, action: Action) {\n if (shapeAssertionError) {\n throw shapeAssertionError;\n }\n if (process.env.NODE_ENV !== 'production') {\n const warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);\n if (warningMessage) {\n warning(warningMessage);\n }\n }\n let hasChanged = false;\n const nextState: StateFromReducersMapObject<typeof reducers> = {};\n for (let i = 0; i < finalReducerKeys.length; i++) {\n const key = finalReducerKeys[i];\n const reducer = finalReducers[key];\n const previousStateForKey = state[key];\n const nextStateForKey = reducer(previousStateForKey, action);\n if (typeof nextStateForKey === 'undefined') {\n const actionType = action && action.type;\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage3(14) : `When called with an action of type ${actionType ? `\"${String(actionType)}\"` : '(unknown type)'}, the slice reducer for key \"${key}\" returned undefined. ` + `To ignore an action, you must explicitly return the previous state. ` + `If you want this reducer to hold no value, you can return null instead of undefined.`);\n }\n nextState[key] = nextStateForKey;\n hasChanged = hasChanged || nextStateForKey !== previousStateForKey;\n }\n hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;\n return hasChanged ? nextState : state;\n };\n}", "import { formatProdErrorMessage as _formatProdErrorMessage } from \"src/utils/formatProdErrorMessage\";\nimport { Dispatch } from './types/store';\nimport { ActionCreator, ActionCreatorsMapObject, Action } from './types/actions';\nimport { kindOf } from './utils/kindOf';\nfunction bindActionCreator<A extends Action>(actionCreator: ActionCreator<A>, dispatch: Dispatch<A>) {\n return function (this: any, ...args: any[]) {\n return dispatch(actionCreator.apply(this, args));\n };\n}\n\n/**\n * Turns an object whose values are action creators, into an object with the\n * same keys, but with every function wrapped into a `dispatch` call so they\n * may be invoked directly. This is just a convenience method, as you can call\n * `store.dispatch(MyActionCreators.doSomething())` yourself just fine.\n *\n * For convenience, you can also pass an action creator as the first argument,\n * and get a dispatch wrapped function in return.\n *\n * @param actionCreators An object whose values are action\n * creator functions. One handy way to obtain it is to use `import * as`\n * syntax. You may also pass a single function.\n *\n * @param dispatch The `dispatch` function available on your Redux\n * store.\n *\n * @returns The object mimicking the original object, but with\n * every action creator wrapped into the `dispatch` call. If you passed a\n * function as `actionCreators`, the return value will also be a single\n * function.\n */\nexport default function bindActionCreators<A, C extends ActionCreator<A>>(actionCreator: C, dispatch: Dispatch): C;\nexport default function bindActionCreators<A extends ActionCreator<any>, B extends ActionCreator<any>>(actionCreator: A, dispatch: Dispatch): B;\nexport default function bindActionCreators<A, M extends ActionCreatorsMapObject<A>>(actionCreators: M, dispatch: Dispatch): M;\nexport default function bindActionCreators<M extends ActionCreatorsMapObject, N extends ActionCreatorsMapObject>(actionCreators: M, dispatch: Dispatch): N;\nexport default function bindActionCreators(actionCreators: ActionCreator<any> | ActionCreatorsMapObject, dispatch: Dispatch) {\n if (typeof actionCreators === 'function') {\n return bindActionCreator(actionCreators, dispatch);\n }\n if (typeof actionCreators !== 'object' || actionCreators === null) {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage(16) : `bindActionCreators expected an object or a function, but instead received: '${kindOf(actionCreators)}'. ` + `Did you write \"import ActionCreators from\" instead of \"import * as ActionCreators from\"?`);\n }\n const boundActionCreators: ActionCreatorsMapObject = {};\n for (const key in actionCreators) {\n const actionCreator = actionCreators[key];\n if (typeof actionCreator === 'function') {\n boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);\n }\n }\n return boundActionCreators;\n}", "type Func<T extends any[], R> = (...a: T) => R;\n\n/**\n * Composes single-argument functions from right to left. The rightmost\n * function can take multiple arguments as it provides the signature for the\n * resulting composite function.\n *\n * @param funcs The functions to compose.\n * @returns A function obtained by composing the argument functions from right\n * to left. For example, `compose(f, g, h)` is identical to doing\n * `(...args) => f(g(h(...args)))`.\n */\nexport default function compose(): <R>(a: R) => R;\nexport default function compose<F extends Function>(f: F): F;\n\n/* two functions */\nexport default function compose<A, T extends any[], R>(f1: (a: A) => R, f2: Func<T, A>): Func<T, R>;\n\n/* three functions */\nexport default function compose<A, B, T extends any[], R>(f1: (b: B) => R, f2: (a: A) => B, f3: Func<T, A>): Func<T, R>;\n\n/* four functions */\nexport default function compose<A, B, C, T extends any[], R>(f1: (c: C) => R, f2: (b: B) => C, f3: (a: A) => B, f4: Func<T, A>): Func<T, R>;\n\n/* rest */\nexport default function compose<R>(f1: (a: any) => R, ...funcs: Function[]): (...args: any[]) => R;\nexport default function compose<R>(...funcs: Function[]): (...args: any[]) => R;\nexport default function compose(...funcs: Function[]) {\n if (funcs.length === 0) {\n // infer the argument type so it is usable in inference down the line\n return <T,>(arg: T) => arg;\n }\n if (funcs.length === 1) {\n return funcs[0];\n }\n return funcs.reduce((a, b) => (...args: any) => a(b(...args)));\n}", "import { formatProdErrorMessage as _formatProdErrorMessage } from \"src/utils/formatProdErrorMessage\";\nimport compose from './compose';\nimport { Middleware, MiddlewareAPI } from './types/middleware';\nimport { StoreEnhancer, Dispatch } from './types/store';\n\n/**\n * Creates a store enhancer that applies middleware to the dispatch method\n * of the Redux store. This is handy for a variety of tasks, such as expressing\n * asynchronous actions in a concise manner, or logging every action payload.\n *\n * See `redux-thunk` package as an example of the Redux middleware.\n *\n * Because middleware is potentially asynchronous, this should be the first\n * store enhancer in the composition chain.\n *\n * Note that each middleware will be given the `dispatch` and `getState` functions\n * as named arguments.\n *\n * @param middlewares The middleware chain to be applied.\n * @returns A store enhancer applying the middleware.\n *\n * @template Ext Dispatch signature added by a middleware.\n * @template S The type of the state supported by a middleware.\n */\nexport default function applyMiddleware(): StoreEnhancer;\nexport default function applyMiddleware<Ext1, S>(middleware1: Middleware<Ext1, S, any>): StoreEnhancer<{\n dispatch: Ext1;\n}>;\nexport default function applyMiddleware<Ext1, Ext2, S>(middleware1: Middleware<Ext1, S, any>, middleware2: Middleware<Ext2, S, any>): StoreEnhancer<{\n dispatch: Ext1 & Ext2;\n}>;\nexport default function applyMiddleware<Ext1, Ext2, Ext3, S>(middleware1: Middleware<Ext1, S, any>, middleware2: Middleware<Ext2, S, any>, middleware3: Middleware<Ext3, S, any>): StoreEnhancer<{\n dispatch: Ext1 & Ext2 & Ext3;\n}>;\nexport default function applyMiddleware<Ext1, Ext2, Ext3, Ext4, S>(middleware1: Middleware<Ext1, S, any>, middleware2: Middleware<Ext2, S, any>, middleware3: Middleware<Ext3, S, any>, middleware4: Middleware<Ext4, S, any>): StoreEnhancer<{\n dispatch: Ext1 & Ext2 & Ext3 & Ext4;\n}>;\nexport default function applyMiddleware<Ext1, Ext2, Ext3, Ext4, Ext5, S>(middleware1: Middleware<Ext1, S, any>, middleware2: Middleware<Ext2, S, any>, middleware3: Middleware<Ext3, S, any>, middleware4: Middleware<Ext4, S, any>, middleware5: Middleware<Ext5, S, any>): StoreEnhancer<{\n dispatch: Ext1 & Ext2 & Ext3 & Ext4 & Ext5;\n}>;\nexport default function applyMiddleware<Ext, S = any>(...middlewares: Middleware<any, S, any>[]): StoreEnhancer<{\n dispatch: Ext;\n}>;\nexport default function applyMiddleware(...middlewares: Middleware[]): StoreEnhancer<any> {\n return createStore => (reducer, preloadedState) => {\n const store = createStore(reducer, preloadedState);\n let dispatch: Dispatch = () => {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage(15) : 'Dispatching while constructing your middleware is not allowed. ' + 'Other middleware would not be applied to this dispatch.');\n };\n const middlewareAPI: MiddlewareAPI = {\n getState: store.getState,\n dispatch: (action, ...args) => dispatch(action, ...args)\n };\n const chain = middlewares.map(middleware => middleware(middlewareAPI));\n dispatch = compose<typeof dispatch>(...chain)(store.dispatch);\n return {\n ...store,\n dispatch\n };\n };\n}", "import { Action } from '../types/actions';\nimport isPlainObject from './isPlainObject';\nexport default function isAction(action: unknown): action is Action<string> {\n return isPlainObject(action) && 'type' in action && typeof (action as Record<'type', unknown>).type === 'string';\n}", "/**\n * External dependencies\n */\nimport { createStore, applyMiddleware } from 'redux';\nimport EquivalentKeyMap from 'equivalent-key-map';\n\n/**\n * WordPress dependencies\n */\nimport createReduxRoutineMiddleware from '@wordpress/redux-routine';\nimport { compose } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { combineReducers } from './combine-reducers';\nimport { builtinControls } from '../controls';\nimport { lock } from '../lock-unlock';\nimport promise from '../promise-middleware';\nimport createResolversCacheMiddleware from '../resolvers-cache-middleware';\nimport createThunkMiddleware from './thunk-middleware';\nimport metadataReducer from './metadata/reducer';\nimport * as metadataSelectors from './metadata/selectors';\nimport * as metadataActions from './metadata/actions';\n\nexport { combineReducers };\n\n/** @typedef {import('../types').DataRegistry} DataRegistry */\n/** @typedef {import('../types').ListenerFunction} ListenerFunction */\n/**\n * @typedef {import('../types').StoreDescriptor<C>} StoreDescriptor\n * @template {import('../types').AnyConfig} C\n */\n/**\n * @typedef {import('../types').ReduxStoreConfig<State,Actions,Selectors>} ReduxStoreConfig\n * @template State\n * @template {Record<string,import('../types').ActionCreator>} Actions\n * @template Selectors\n */\n\nconst trimUndefinedValues = ( array ) => {\n\tconst result = [ ...array ];\n\tfor ( let i = result.length - 1; i >= 0; i-- ) {\n\t\tif ( result[ i ] === undefined ) {\n\t\t\tresult.splice( i, 1 );\n\t\t}\n\t}\n\treturn result;\n};\n\n/**\n * Creates a new object with the same keys, but with `callback()` called as\n * a transformer function on each of the values.\n *\n * @param {Object} obj The object to transform.\n * @param {Function} callback The function to transform each object value.\n * @return {Array} Transformed object.\n */\nconst mapValues = ( obj, callback ) =>\n\tObject.fromEntries(\n\t\tObject.entries( obj ?? {} ).map( ( [ key, value ] ) => [\n\t\t\tkey,\n\t\t\tcallback( value, key ),\n\t\t] )\n\t);\n\n// Convert non serializable types to plain objects\nconst devToolsReplacer = ( key, state ) => {\n\tif ( state instanceof Map ) {\n\t\treturn Object.fromEntries( state );\n\t}\n\n\tif ( state instanceof window.HTMLElement ) {\n\t\treturn null;\n\t}\n\n\treturn state;\n};\n\n/**\n * Create a cache to track whether resolvers started running or not.\n *\n * @return {Object} Resolvers Cache.\n */\nfunction createResolversCache() {\n\tconst cache = {};\n\treturn {\n\t\tisRunning( selectorName, args ) {\n\t\t\treturn (\n\t\t\t\tcache[ selectorName ] &&\n\t\t\t\tcache[ selectorName ].get( trimUndefinedValues( args ) )\n\t\t\t);\n\t\t},\n\n\t\tclear( selectorName, args ) {\n\t\t\tif ( cache[ selectorName ] ) {\n\t\t\t\tcache[ selectorName ].delete( trimUndefinedValues( args ) );\n\t\t\t}\n\t\t},\n\n\t\tmarkAsRunning( selectorName, args ) {\n\t\t\tif ( ! cache[ selectorName ] ) {\n\t\t\t\tcache[ selectorName ] = new EquivalentKeyMap();\n\t\t\t}\n\n\t\t\tcache[ selectorName ].set( trimUndefinedValues( args ), true );\n\t\t},\n\t};\n}\n\nfunction createBindingCache( getItem, bindItem ) {\n\tconst cache = new WeakMap();\n\n\treturn {\n\t\tget( itemName ) {\n\t\t\tconst item = getItem( itemName );\n\t\t\tif ( ! item ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tlet boundItem = cache.get( item );\n\t\t\tif ( ! boundItem ) {\n\t\t\t\tboundItem = bindItem( item, itemName );\n\t\t\t\tcache.set( item, boundItem );\n\t\t\t}\n\t\t\treturn boundItem;\n\t\t},\n\t};\n}\n\nfunction createPrivateProxy( publicItems, privateItems ) {\n\treturn new Proxy( publicItems, {\n\t\tget: ( target, itemName ) =>\n\t\t\tprivateItems.get( itemName ) || Reflect.get( target, itemName ),\n\t} );\n}\n\n/**\n * Creates a data store descriptor for the provided Redux store configuration containing\n * properties describing reducer, actions, selectors, controls and resolvers.\n *\n * @example\n * ```js\n * import { createReduxStore } from '@wordpress/data';\n *\n * const store = createReduxStore( 'demo', {\n * reducer: ( state = 'OK' ) => state,\n * selectors: {\n * getValue: ( state ) => state,\n * },\n * } );\n * ```\n *\n * @template State\n * @template {Record<string,import('../types').ActionCreator>} Actions\n * @template Selectors\n * @param {string} key Unique namespace identifier.\n * @param {ReduxStoreConfig<State,Actions,Selectors>} options Registered store options, with properties\n * describing reducer, actions, selectors,\n * and resolvers.\n *\n * @return {StoreDescriptor<ReduxStoreConfig<State,Actions,Selectors>>} Store Object.\n */\nexport default function createReduxStore( key, options ) {\n\tconst privateActions = {};\n\tconst privateSelectors = {};\n\tconst privateRegistrationFunctions = {\n\t\tprivateActions,\n\t\tregisterPrivateActions: ( actions ) => {\n\t\t\tObject.assign( privateActions, actions );\n\t\t},\n\t\tprivateSelectors,\n\t\tregisterPrivateSelectors: ( selectors ) => {\n\t\t\tObject.assign( privateSelectors, selectors );\n\t\t},\n\t};\n\tconst storeDescriptor = {\n\t\tname: key,\n\t\tinstantiate: ( registry ) => {\n\t\t\t/**\n\t\t\t * Stores listener functions registered with `subscribe()`.\n\t\t\t *\n\t\t\t * When functions register to listen to store changes with\n\t\t\t * `subscribe()` they get added here. Although Redux offers\n\t\t\t * its own `subscribe()` function directly, by wrapping the\n\t\t\t * subscription in this store instance it's possible to\n\t\t\t * optimize checking if the state has changed before calling\n\t\t\t * each listener.\n\t\t\t *\n\t\t\t * @type {Set<ListenerFunction>}\n\t\t\t */\n\t\t\tconst listeners = new Set();\n\t\t\tconst reducer = options.reducer;\n\n\t\t\t// Object that every thunk function receives as the first argument. It contains the\n\t\t\t// `registry`, `dispatch`, `select` and `resolveSelect` fields. Some of them are\n\t\t\t// constructed as getters to avoid circular dependencies.\n\t\t\tconst thunkArgs = {\n\t\t\t\tregistry,\n\t\t\t\tget dispatch() {\n\t\t\t\t\treturn thunkDispatch;\n\t\t\t\t},\n\t\t\t\tget select() {\n\t\t\t\t\treturn thunkSelect;\n\t\t\t\t},\n\t\t\t\tget resolveSelect() {\n\t\t\t\t\treturn resolveSelectors;\n\t\t\t\t},\n\t\t\t};\n\n\t\t\tconst store = instantiateReduxStore(\n\t\t\t\tkey,\n\t\t\t\toptions,\n\t\t\t\tregistry,\n\t\t\t\tthunkArgs\n\t\t\t);\n\n\t\t\t// Expose the private registration functions on the store\n\t\t\t// so they can be copied to a sub registry in registry.js.\n\t\t\tlock( store, privateRegistrationFunctions );\n\t\t\tconst resolversCache = createResolversCache();\n\n\t\t\t// Binds an action creator (`action`) to the `store`, making it a callable function.\n\t\t\t// These are the functions that are returned by `useDispatch`, for example.\n\t\t\t// It always returns a `Promise`, although actions are not always async. That's an\n\t\t\t// unfortunate backward compatibility measure.\n\t\t\tfunction bindAction( action ) {\n\t\t\t\treturn ( ...args ) =>\n\t\t\t\t\tPromise.resolve( store.dispatch( action( ...args ) ) );\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Object with all public actions, both metadata and store actions.\n\t\t\t */\n\t\t\tconst actions = {\n\t\t\t\t...mapValues( metadataActions, bindAction ),\n\t\t\t\t...mapValues( options.actions, bindAction ),\n\t\t\t};\n\n\t\t\t// Object with both public and private actions. Private actions are accessed through a proxy,\n\t\t\t// which looks them up in real time on the `privateActions` object. That's because private\n\t\t\t// actions can be registered at any time with `registerPrivateActions`. Also once a private\n\t\t\t// action creator is bound to the store, it is cached to give it a stable identity.\n\t\t\tconst allActions = createPrivateProxy(\n\t\t\t\tactions,\n\t\t\t\tcreateBindingCache(\n\t\t\t\t\t( name ) => privateActions[ name ],\n\t\t\t\t\tbindAction\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t// An object that implements the `dispatch` object that is passed to thunk functions.\n\t\t\t// It is callable (`dispatch( action )`) and also has methods (`dispatch.foo()`) that\n\t\t\t// correspond to bound registered actions, both public and private. Implemented with the proxy\n\t\t\t// `get` method, delegating to `allActions`.\n\t\t\tconst thunkDispatch = new Proxy(\n\t\t\t\t( action ) => store.dispatch( action ),\n\t\t\t\t{ get: ( target, name ) => allActions[ name ] }\n\t\t\t);\n\n\t\t\t// To the public `actions` object, add the \"locked\" `allActions` object. When used,\n\t\t\t// `unlock( actions )` will return `allActions`, implementing a way how to get at the private actions.\n\t\t\tlock( actions, allActions );\n\n\t\t\t// If we have selector resolvers, convert them to a normalized form.\n\t\t\tconst resolvers = options.resolvers\n\t\t\t\t? mapValues( options.resolvers, mapResolver )\n\t\t\t\t: {};\n\n\t\t\t// Bind a selector to the store. Call the selector with the current state, correct registry,\n\t\t\t// and if there is a resolver, attach the resolver logic to the selector.\n\t\t\tfunction bindSelector( selector, selectorName ) {\n\t\t\t\tif ( selector.isRegistrySelector ) {\n\t\t\t\t\tselector.registry = registry;\n\t\t\t\t}\n\t\t\t\tconst boundSelector = ( ...args ) => {\n\t\t\t\t\targs = normalize( selector, args );\n\t\t\t\t\tconst state = store.__unstableOriginalGetState();\n\t\t\t\t\t// Before calling the selector, switch to the correct registry.\n\t\t\t\t\tif ( selector.isRegistrySelector ) {\n\t\t\t\t\t\tselector.registry = registry;\n\t\t\t\t\t}\n\t\t\t\t\treturn selector( state.root, ...args );\n\t\t\t\t};\n\n\t\t\t\t// Expose normalization method on the bound selector\n\t\t\t\t// in order that it can be called when fulfilling\n\t\t\t\t// the resolver.\n\t\t\t\tboundSelector.__unstableNormalizeArgs =\n\t\t\t\t\tselector.__unstableNormalizeArgs;\n\n\t\t\t\tconst resolver = resolvers[ selectorName ];\n\n\t\t\t\tif ( ! resolver ) {\n\t\t\t\t\tboundSelector.hasResolver = false;\n\t\t\t\t\treturn boundSelector;\n\t\t\t\t}\n\n\t\t\t\treturn mapSelectorWithResolver(\n\t\t\t\t\tboundSelector,\n\t\t\t\t\tselectorName,\n\t\t\t\t\tresolver,\n\t\t\t\t\tstore,\n\t\t\t\t\tresolversCache,\n\t\t\t\t\tboundMetadataSelectors\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Metadata selectors are bound differently: different state (`state.metadata`), no resolvers,\n\t\t\t// normalization depending on the target selector.\n\t\t\tfunction bindMetadataSelector( metaDataSelector ) {\n\t\t\t\tconst boundSelector = (\n\t\t\t\t\tselectorName,\n\t\t\t\t\tselectorArgs,\n\t\t\t\t\t...args\n\t\t\t\t) => {\n\t\t\t\t\t// Normalize the arguments passed to the target selector.\n\t\t\t\t\tif ( selectorName ) {\n\t\t\t\t\t\tconst targetSelector =\n\t\t\t\t\t\t\toptions.selectors?.[ selectorName ];\n\t\t\t\t\t\tif ( targetSelector ) {\n\t\t\t\t\t\t\tselectorArgs = normalize(\n\t\t\t\t\t\t\t\ttargetSelector,\n\t\t\t\t\t\t\t\tselectorArgs\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tconst state = store.__unstableOriginalGetState();\n\n\t\t\t\t\treturn metaDataSelector(\n\t\t\t\t\t\tstate.metadata,\n\t\t\t\t\t\tselectorName,\n\t\t\t\t\t\tselectorArgs,\n\t\t\t\t\t\t...args\n\t\t\t\t\t);\n\t\t\t\t};\n\t\t\t\tboundSelector.hasResolver = false;\n\t\t\t\treturn boundSelector;\n\t\t\t}\n\n\t\t\t// Perform binding of both metadata and store selectors and combine them in one\n\t\t\t// `selectors` object. These are all public selectors of the store.\n\t\t\tconst boundMetadataSelectors = mapValues(\n\t\t\t\tmetadataSelectors,\n\t\t\t\tbindMetadataSelector\n\t\t\t);\n\n\t\t\tconst boundSelectors = mapValues( options.selectors, bindSelector );\n\n\t\t\tconst selectors = {\n\t\t\t\t...boundMetadataSelectors,\n\t\t\t\t...boundSelectors,\n\t\t\t};\n\n\t\t\t// Cache of bould private selectors. They are bound only when first accessed, because\n\t\t\t// new private selectors can be registered at any time (with `registerPrivateSelectors`).\n\t\t\t// Once bound, they are cached to give them a stable identity.\n\t\t\tconst boundPrivateSelectors = createBindingCache(\n\t\t\t\t( name ) => privateSelectors[ name ],\n\t\t\t\tbindSelector\n\t\t\t);\n\n\t\t\tconst allSelectors = createPrivateProxy(\n\t\t\t\tselectors,\n\t\t\t\tboundPrivateSelectors\n\t\t\t);\n\n\t\t\t// Pre-bind the private selectors that have been registered by the time of\n\t\t\t// instantiation, so that registry selectors are bound to the registry.\n\t\t\tfor ( const selectorName of Object.keys( privateSelectors ) ) {\n\t\t\t\tboundPrivateSelectors.get( selectorName );\n\t\t\t}\n\n\t\t\t// An object that implements the `select` object that is passed to thunk functions.\n\t\t\t// It is callable (`select( selector )`) and also has methods (`select.foo()`) that\n\t\t\t// correspond to bound registered selectors, both public and private. Implemented with the proxy\n\t\t\t// `get` method, delegating to `allSelectors`.\n\t\t\tconst thunkSelect = new Proxy(\n\t\t\t\t( selector ) => selector( store.__unstableOriginalGetState() ),\n\t\t\t\t{ get: ( target, name ) => allSelectors[ name ] }\n\t\t\t);\n\n\t\t\t// To the public `selectors` object, add the \"locked\" `allSelectors` object. When used,\n\t\t\t// `unlock( selectors )` will return `allSelectors`, implementing a way how to get at the private selectors.\n\t\t\tlock( selectors, allSelectors );\n\n\t\t\t// For each selector, create a function that calls the selector, waits for resolution and returns\n\t\t\t// a promise that resolves when the resolution is finished.\n\t\t\tconst bindResolveSelector = mapResolveSelector(\n\t\t\t\tstore,\n\t\t\t\tboundMetadataSelectors\n\t\t\t);\n\n\t\t\t// Now apply this function to all bound selectors, public and private. We are excluding\n\t\t\t// metadata selectors because they don't have resolvers.\n\t\t\tconst resolveSelectors = mapValues(\n\t\t\t\tboundSelectors,\n\t\t\t\tbindResolveSelector\n\t\t\t);\n\n\t\t\tconst allResolveSelectors = createPrivateProxy(\n\t\t\t\tresolveSelectors,\n\t\t\t\tcreateBindingCache(\n\t\t\t\t\t( name ) => boundPrivateSelectors.get( name ),\n\t\t\t\t\tbindResolveSelector\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t// Lock the selectors so that `unlock( resolveSelectors )` returns `allResolveSelectors`.\n\t\t\tlock( resolveSelectors, allResolveSelectors );\n\n\t\t\t// Now, in a way very similar to `bindResolveSelector`, we create a function that maps\n\t\t\t// selectors to functions that throw a suspense promise if not yet resolved.\n\t\t\tconst bindSuspendSelector = mapSuspendSelector(\n\t\t\t\tstore,\n\t\t\t\tboundMetadataSelectors\n\t\t\t);\n\n\t\t\tconst suspendSelectors = {\n\t\t\t\t...boundMetadataSelectors, // no special suspense behavior\n\t\t\t\t...mapValues( boundSelectors, bindSuspendSelector ),\n\t\t\t};\n\n\t\t\tconst allSuspendSelectors = createPrivateProxy(\n\t\t\t\tsuspendSelectors,\n\t\t\t\tcreateBindingCache(\n\t\t\t\t\t( name ) => boundPrivateSelectors.get( name ),\n\t\t\t\t\tbindSuspendSelector\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t// Lock the selectors so that `unlock( suspendSelectors )` returns 'allSuspendSelectors`.\n\t\t\tlock( suspendSelectors, allSuspendSelectors );\n\n\t\t\tconst getSelectors = () => selectors;\n\t\t\tconst getActions = () => actions;\n\t\t\tconst getResolveSelectors = () => resolveSelectors;\n\t\t\tconst getSuspendSelectors = () => suspendSelectors;\n\n\t\t\t// We have some modules monkey-patching the store object\n\t\t\t// It's wrong to do so but until we refactor all of our effects to controls\n\t\t\t// We need to keep the same \"store\" instance here.\n\t\t\tstore.__unstableOriginalGetState = store.getState;\n\t\t\tstore.getState = () => store.__unstableOriginalGetState().root;\n\n\t\t\t// Customize subscribe behavior to call listeners only on effective change,\n\t\t\t// not on every dispatch.\n\t\t\tconst subscribe =\n\t\t\t\tstore &&\n\t\t\t\t( ( listener ) => {\n\t\t\t\t\tlisteners.add( listener );\n\n\t\t\t\t\treturn () => listeners.delete( listener );\n\t\t\t\t} );\n\n\t\t\tlet lastState = store.__unstableOriginalGetState();\n\t\t\tstore.subscribe( () => {\n\t\t\t\tconst state = store.__unstableOriginalGetState();\n\t\t\t\tconst hasChanged = state !== lastState;\n\t\t\t\tlastState = state;\n\n\t\t\t\tif ( hasChanged ) {\n\t\t\t\t\tfor ( const listener of listeners ) {\n\t\t\t\t\t\tlistener();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\t// This can be simplified to just { subscribe, getSelectors, getActions }\n\t\t\t// Once we remove the use function.\n\t\t\treturn {\n\t\t\t\treducer,\n\t\t\t\tstore,\n\t\t\t\tactions,\n\t\t\t\tselectors,\n\t\t\t\tresolvers,\n\t\t\t\tgetSelectors,\n\t\t\t\tgetResolveSelectors,\n\t\t\t\tgetSuspendSelectors,\n\t\t\t\tgetActions,\n\t\t\t\tsubscribe,\n\t\t\t};\n\t\t},\n\t};\n\n\t// Expose the private registration functions on the store\n\t// descriptor. That's a natural choice since that's where the\n\t// public actions and selectors are stored.\n\tlock( storeDescriptor, privateRegistrationFunctions );\n\n\treturn storeDescriptor;\n}\n\n/**\n * Creates a redux store for a namespace.\n *\n * @param {string} key Unique namespace identifier.\n * @param {Object} options Registered store options, with properties\n * describing reducer, actions, selectors,\n * and resolvers.\n * @param {DataRegistry} registry Registry reference.\n * @param {Object} thunkArgs Argument object for the thunk middleware.\n * @return {Object} Newly created redux store.\n */\nfunction instantiateReduxStore( key, options, registry, thunkArgs ) {\n\tconst controls = {\n\t\t...options.controls,\n\t\t...builtinControls,\n\t};\n\n\tconst normalizedControls = mapValues( controls, ( control ) =>\n\t\tcontrol.isRegistryControl ? control( registry ) : control\n\t);\n\n\tconst middlewares = [\n\t\tcreateResolversCacheMiddleware( registry, key ),\n\t\tpromise,\n\t\tcreateReduxRoutineMiddleware( normalizedControls ),\n\t\tcreateThunkMiddleware( thunkArgs ),\n\t];\n\n\tconst enhancers = [ applyMiddleware( ...middlewares ) ];\n\tif (\n\t\ttypeof window !== 'undefined' &&\n\t\twindow.__REDUX_DEVTOOLS_EXTENSION__\n\t) {\n\t\tenhancers.push(\n\t\t\twindow.__REDUX_DEVTOOLS_EXTENSION__( {\n\t\t\t\tname: key,\n\t\t\t\tinstanceId: key,\n\t\t\t\tserialize: {\n\t\t\t\t\treplacer: devToolsReplacer,\n\t\t\t\t},\n\t\t\t} )\n\t\t);\n\t}\n\n\tconst { reducer, initialState } = options;\n\tconst enhancedReducer = combineReducers( {\n\t\tmetadata: metadataReducer,\n\t\troot: reducer,\n\t} );\n\n\treturn createStore(\n\t\tenhancedReducer,\n\t\t{ root: initialState },\n\t\tcompose( enhancers )\n\t);\n}\n\n/**\n * Maps selectors to functions that return a resolution promise for them.\n *\n * @param {Object} store The redux store the selectors are bound to.\n * @param {Object} boundMetadataSelectors The bound metadata selectors.\n *\n * @return {Function} Function that maps selectors to resolvers.\n */\nfunction mapResolveSelector( store, boundMetadataSelectors ) {\n\treturn ( selector, selectorName ) => {\n\t\t// If the selector doesn't have a resolver, just convert the return value\n\t\t// (including exceptions) to a Promise, no additional extra behavior is needed.\n\t\tif ( ! selector.hasResolver ) {\n\t\t\treturn async ( ...args ) => selector.apply( null, args );\n\t\t}\n\n\t\treturn ( ...args ) =>\n\t\t\tnew Promise( ( resolve, reject ) => {\n\t\t\t\tconst hasFinished = () => {\n\t\t\t\t\treturn boundMetadataSelectors.hasFinishedResolution(\n\t\t\t\t\t\tselectorName,\n\t\t\t\t\t\targs\n\t\t\t\t\t);\n\t\t\t\t};\n\t\t\t\tconst finalize = ( result ) => {\n\t\t\t\t\tconst hasFailed =\n\t\t\t\t\t\tboundMetadataSelectors.hasResolutionFailed(\n\t\t\t\t\t\t\tselectorName,\n\t\t\t\t\t\t\targs\n\t\t\t\t\t\t);\n\t\t\t\t\tif ( hasFailed ) {\n\t\t\t\t\t\tconst error = boundMetadataSelectors.getResolutionError(\n\t\t\t\t\t\t\tselectorName,\n\t\t\t\t\t\t\targs\n\t\t\t\t\t\t);\n\t\t\t\t\t\treject( error );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresolve( result );\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tconst getResult = () => selector.apply( null, args );\n\n\t\t\t\t// Trigger the selector (to trigger the resolver)\n\t\t\t\tconst result = getResult();\n\t\t\t\tif ( hasFinished() ) {\n\t\t\t\t\treturn finalize( result );\n\t\t\t\t}\n\n\t\t\t\tconst unsubscribe = store.subscribe( () => {\n\t\t\t\t\tif ( hasFinished() ) {\n\t\t\t\t\t\tunsubscribe();\n\t\t\t\t\t\tfinalize( getResult() );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t} );\n\t};\n}\n\n/**\n * Maps selectors to functions that throw a suspense promise if not yet resolved.\n *\n * @param {Object} store The redux store the selectors select from.\n * @param {Object} boundMetadataSelectors The bound metadata selectors.\n *\n * @return {Function} Function that maps selectors to their suspending versions.\n */\nfunction mapSuspendSelector( store, boundMetadataSelectors ) {\n\treturn ( selector, selectorName ) => {\n\t\t// Selector without a resolver doesn't have any extra suspense behavior.\n\t\tif ( ! selector.hasResolver ) {\n\t\t\treturn selector;\n\t\t}\n\n\t\treturn ( ...args ) => {\n\t\t\tconst result = selector.apply( null, args );\n\n\t\t\tif (\n\t\t\t\tboundMetadataSelectors.hasFinishedResolution(\n\t\t\t\t\tselectorName,\n\t\t\t\t\targs\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tif (\n\t\t\t\t\tboundMetadataSelectors.hasResolutionFailed(\n\t\t\t\t\t\tselectorName,\n\t\t\t\t\t\targs\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\tthrow boundMetadataSelectors.getResolutionError(\n\t\t\t\t\t\tselectorName,\n\t\t\t\t\t\targs\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tthrow new Promise( ( resolve ) => {\n\t\t\t\tconst unsubscribe = store.subscribe( () => {\n\t\t\t\t\tif (\n\t\t\t\t\t\tboundMetadataSelectors.hasFinishedResolution(\n\t\t\t\t\t\t\tselectorName,\n\t\t\t\t\t\t\targs\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\tresolve();\n\t\t\t\t\t\tunsubscribe();\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t} );\n\t\t};\n\t};\n}\n\n/**\n * Convert a resolver to a normalized form, an object with `fulfill` method and\n * optional methods like `isFulfilled`.\n *\n * @param {Function} resolver Resolver to convert\n */\nfunction mapResolver( resolver ) {\n\tif ( resolver.fulfill ) {\n\t\treturn resolver;\n\t}\n\n\treturn {\n\t\t...resolver, // Copy the enumerable properties of the resolver function.\n\t\tfulfill: resolver, // Add the fulfill method.\n\t};\n}\n\n/**\n * Returns a selector with a matched resolver.\n * Resolvers are side effects invoked once per argument set of a given selector call,\n * used in ensuring that the data needs for the selector are satisfied.\n *\n * @param {Object} selector The selector function to be bound.\n * @param {string} selectorName The selector name.\n * @param {Object} resolver Resolver to call.\n * @param {Object} store The redux store to which the resolvers should be mapped.\n * @param {Object} resolversCache Resolvers Cache.\n * @param {Object} boundMetadataSelectors The bound metadata selectors.\n */\nfunction mapSelectorWithResolver(\n\tselector,\n\tselectorName,\n\tresolver,\n\tstore,\n\tresolversCache,\n\tboundMetadataSelectors\n) {\n\tfunction fulfillSelector( args ) {\n\t\tif (\n\t\t\tresolversCache.isRunning( selectorName, args ) ||\n\t\t\tboundMetadataSelectors.hasStartedResolution( selectorName, args )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tresolversCache.markAsRunning( selectorName, args );\n\n\t\tsetTimeout( async () => {\n\t\t\tresolversCache.clear( selectorName, args );\n\t\t\tstore.dispatch(\n\t\t\t\tmetadataActions.startResolution( selectorName, args )\n\t\t\t);\n\t\t\ttry {\n\t\t\t\tconst isFulfilled =\n\t\t\t\t\ttypeof resolver.isFulfilled === 'function' &&\n\t\t\t\t\tresolver.isFulfilled( store.getState(), ...args );\n\t\t\t\tif ( ! isFulfilled ) {\n\t\t\t\t\tconst action = resolver.fulfill( ...args );\n\t\t\t\t\tif ( action ) {\n\t\t\t\t\t\tawait store.dispatch( action );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tstore.dispatch(\n\t\t\t\t\tmetadataActions.finishResolution( selectorName, args )\n\t\t\t\t);\n\t\t\t} catch ( error ) {\n\t\t\t\tstore.dispatch(\n\t\t\t\t\tmetadataActions.failResolution( selectorName, args, error )\n\t\t\t\t);\n\t\t\t}\n\t\t}, 0 );\n\t}\n\n\tconst selectorResolver = ( ...args ) => {\n\t\targs = normalize( selector, args );\n\t\tfulfillSelector( args );\n\t\treturn selector( ...args );\n\t};\n\tselectorResolver.hasResolver = true;\n\treturn selectorResolver;\n}\n\n/**\n * Applies selector's normalization function to the given arguments\n * if it exists.\n *\n * @param {Object} selector The selector potentially with a normalization method property.\n * @param {Array} args selector arguments to normalize.\n * @return {Array} Potentially normalized arguments.\n */\nfunction normalize( selector, args ) {\n\tif (\n\t\tselector.__unstableNormalizeArgs &&\n\t\ttypeof selector.__unstableNormalizeArgs === 'function' &&\n\t\targs?.length\n\t) {\n\t\treturn selector.__unstableNormalizeArgs( args );\n\t}\n\treturn args;\n}\n", "import type {\n\tReducer,\n\tAction,\n\tStateFromReducersMapObject,\n\tActionFromReducersMapObject,\n} from 'redux';\n\nexport function combineReducers< M >(\n\treducers: M\n): M[ keyof M ] extends Reducer< any, any > | undefined\n\t? Reducer<\n\t\t\tStateFromReducersMapObject< M >,\n\t\t\tActionFromReducersMapObject< M >\n\t >\n\t: never;\n\nexport function combineReducers( reducers: {\n\t[ key: string ]: Reducer< any, any >;\n} ) {\n\tconst keys = Object.keys( reducers );\n\n\treturn function combinedReducer(\n\t\tstate: StateFromReducersMapObject< typeof reducers > = {},\n\t\taction: Action\n\t) {\n\t\tconst nextState: StateFromReducersMapObject< typeof reducers > = {};\n\t\tlet hasChanged = false;\n\t\tfor ( const key of keys ) {\n\t\t\tconst reducer = reducers[ key ];\n\t\t\tconst prevStateForKey = state[ key ];\n\t\t\tconst nextStateForKey = reducer( prevStateForKey, action );\n\t\t\tnextState[ key ] = nextStateForKey;\n\t\t\thasChanged = hasChanged || nextStateForKey !== prevStateForKey;\n\t\t}\n\n\t\treturn hasChanged ? nextState : state;\n\t};\n}\n", "/**\n * Internal dependencies\n */\nimport type { select as globalSelect } from './select';\n\ntype RegistrySelector< Selector extends ( ...args: any[] ) => any > = {\n\t( ...args: Parameters< Selector > ): ReturnType< Selector >;\n\tisRegistrySelector?: boolean;\n\tregistry?: any;\n};\n\n/**\n * Creates a selector function that takes additional curried argument with the\n * registry `select` function. While a regular selector has signature\n * ```js\n * ( state, ...selectorArgs ) => ( result )\n * ```\n * that allows to select data from the store's `state`, a registry selector\n * has signature:\n * ```js\n * ( select ) => ( state, ...selectorArgs ) => ( result )\n * ```\n * that supports also selecting from other registered stores.\n *\n * @example\n * ```js\n * import { store as coreStore } from '@wordpress/core-data';\n * import { store as editorStore } from '@wordpress/editor';\n *\n * const getCurrentPostId = createRegistrySelector( ( select ) => ( state ) => {\n * return select( editorStore ).getCurrentPostId();\n * } );\n *\n * const getPostEdits = createRegistrySelector( ( select ) => ( state ) => {\n * // calling another registry selector just like any other function\n * const postType = getCurrentPostType( state );\n * const postId = getCurrentPostId( state );\n *\t return select( coreStore ).getEntityRecordEdits( 'postType', postType, postId );\n * } );\n * ```\n *\n * Note how the `getCurrentPostId` selector can be called just like any other function,\n * (it works even inside a regular non-registry selector) and we don't need to pass the\n * registry as argument. The registry binding happens automatically when registering the selector\n * with a store.\n *\n * @param registrySelector Function receiving a registry `select`\n * function and returning a state selector.\n *\n * @return Registry selector that can be registered with a store.\n */\nexport function createRegistrySelector<\n\tSelector extends ( ...args: any[] ) => any,\n>(\n\tregistrySelector: ( select: typeof globalSelect ) => Selector\n): RegistrySelector< Selector > {\n\tconst selectorsByRegistry = new WeakMap();\n\t// Create a selector function that is bound to the registry referenced by `selector.registry`\n\t// and that has the same API as a regular selector. Binding it in such a way makes it\n\t// possible to call the selector directly from another selector.\n\tconst wrappedSelector: RegistrySelector< Selector > = ( ...args ) => {\n\t\tlet selector = selectorsByRegistry.get( wrappedSelector.registry );\n\t\t// We want to make sure the cache persists even when new registry\n\t\t// instances are created. For example patterns create their own editors\n\t\t// with their own core/block-editor stores, so we should keep track of\n\t\t// the cache for each registry instance.\n\t\tif ( ! selector ) {\n\t\t\tselector = registrySelector( wrappedSelector.registry.select );\n\t\t\tselectorsByRegistry.set( wrappedSelector.registry, selector );\n\t\t}\n\t\treturn selector( ...args );\n\t};\n\n\t/**\n\t * Flag indicating that the selector is a registry selector that needs the correct registry\n\t * reference to be assigned to `selector.registry` to make it work correctly.\n\t * be mapped as a registry selector.\n\t */\n\twrappedSelector.isRegistrySelector = true;\n\n\treturn wrappedSelector;\n}\n\n/**\n * Creates a control function that takes additional curried argument with the `registry` object.\n * While a regular control has signature\n * ```js\n * ( action ) => ( iteratorOrPromise )\n * ```\n * where the control works with the `action` that it's bound to, a registry control has signature:\n * ```js\n * ( registry ) => ( action ) => ( iteratorOrPromise )\n * ```\n * A registry control is typically used to select data or dispatch an action to a registered\n * store.\n *\n * When registering a control created with `createRegistryControl` with a store, the store\n * knows which calling convention to use when executing the control.\n *\n * @param registryControl Function receiving a registry object and returning a control.\n *\n * @return Registry control that can be registered with a store.\n */\nexport function createRegistryControl< T extends ( ...args: any ) => any >(\n\tregistryControl: T & { isRegistryControl?: boolean }\n) {\n\tregistryControl.isRegistryControl = true;\n\n\treturn registryControl;\n}\n", "/**\n * Internal dependencies\n */\nimport { createRegistryControl } from './factory';\n\n/** @typedef {import('./types').StoreDescriptor} StoreDescriptor */\n\nconst SELECT = '@@data/SELECT';\nconst RESOLVE_SELECT = '@@data/RESOLVE_SELECT';\nconst DISPATCH = '@@data/DISPATCH';\n\nfunction isObject( object ) {\n\treturn object !== null && typeof object === 'object';\n}\n\n/**\n * Dispatches a control action for triggering a synchronous registry select.\n *\n * Note: This control synchronously returns the current selector value, triggering the\n * resolution, but not waiting for it.\n *\n * @param {string|StoreDescriptor} storeNameOrDescriptor Unique namespace identifier for the store\n * @param {string} selectorName The name of the selector.\n * @param {Array} args Arguments for the selector.\n *\n * @example\n * ```js\n * import { controls } from '@wordpress/data';\n *\n * // Action generator using `select`.\n * export function* myAction() {\n * const isEditorSideBarOpened = yield controls.select( 'core/edit-post', 'isEditorSideBarOpened' );\n * // Do stuff with the result from the `select`.\n * }\n * ```\n *\n * @return {Object} The control descriptor.\n */\nfunction select( storeNameOrDescriptor, selectorName, ...args ) {\n\treturn {\n\t\ttype: SELECT,\n\t\tstoreKey: isObject( storeNameOrDescriptor )\n\t\t\t? storeNameOrDescriptor.name\n\t\t\t: storeNameOrDescriptor,\n\t\tselectorName,\n\t\targs,\n\t};\n}\n\n/**\n * Dispatches a control action for triggering and resolving a registry select.\n *\n * Note: when this control action is handled, it automatically considers\n * selectors that may have a resolver. In such case, it will return a `Promise` that resolves\n * after the selector finishes resolving, with the final result value.\n *\n * @param {string|StoreDescriptor} storeNameOrDescriptor Unique namespace identifier for the store\n * @param {string} selectorName The name of the selector\n * @param {Array} args Arguments for the selector.\n *\n * @example\n * ```js\n * import { controls } from '@wordpress/data';\n *\n * // Action generator using resolveSelect\n * export function* myAction() {\n * \tconst isSidebarOpened = yield controls.resolveSelect( 'core/edit-post', 'isEditorSideBarOpened' );\n * \t// do stuff with the result from the select.\n * }\n * ```\n *\n * @return {Object} The control descriptor.\n */\nfunction resolveSelect( storeNameOrDescriptor, selectorName, ...args ) {\n\treturn {\n\t\ttype: RESOLVE_SELECT,\n\t\tstoreKey: isObject( storeNameOrDescriptor )\n\t\t\t? storeNameOrDescriptor.name\n\t\t\t: storeNameOrDescriptor,\n\t\tselectorName,\n\t\targs,\n\t};\n}\n\n/**\n * Dispatches a control action for triggering a registry dispatch.\n *\n * @param {string|StoreDescriptor} storeNameOrDescriptor Unique namespace identifier for the store\n * @param {string} actionName The name of the action to dispatch\n * @param {Array} args Arguments for the dispatch action.\n *\n * @example\n * ```js\n * import { controls } from '@wordpress/data-controls';\n *\n * // Action generator using dispatch\n * export function* myAction() {\n * yield controls.dispatch( 'core/editor', 'togglePublishSidebar' );\n * // do some other things.\n * }\n * ```\n *\n * @return {Object} The control descriptor.\n */\nfunction dispatch( storeNameOrDescriptor, actionName, ...args ) {\n\treturn {\n\t\ttype: DISPATCH,\n\t\tstoreKey: isObject( storeNameOrDescriptor )\n\t\t\t? storeNameOrDescriptor.name\n\t\t\t: storeNameOrDescriptor,\n\t\tactionName,\n\t\targs,\n\t};\n}\n\nexport const controls = { select, resolveSelect, dispatch };\n\nexport const builtinControls = {\n\t[ SELECT ]: createRegistryControl(\n\t\t( registry ) =>\n\t\t\t( { storeKey, selectorName, args } ) =>\n\t\t\t\tregistry.select( storeKey )[ selectorName ]( ...args )\n\t),\n\t[ RESOLVE_SELECT ]: createRegistryControl(\n\t\t( registry ) =>\n\t\t\t( { storeKey, selectorName, args } ) => {\n\t\t\t\tconst method = registry.select( storeKey )[ selectorName ]\n\t\t\t\t\t.hasResolver\n\t\t\t\t\t? 'resolveSelect'\n\t\t\t\t\t: 'select';\n\t\t\t\treturn registry[ method ]( storeKey )[ selectorName ](\n\t\t\t\t\t...args\n\t\t\t\t);\n\t\t\t}\n\t),\n\t[ DISPATCH ]: createRegistryControl(\n\t\t( registry ) =>\n\t\t\t( { storeKey, actionName, args } ) =>\n\t\t\t\tregistry.dispatch( storeKey )[ actionName ]( ...args )\n\t),\n};\n", "/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.',\n\t\t'@wordpress/data'\n\t);\n", "export default function isPromise(obj) {\n return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';\n}\n", "/**\n * External dependencies\n */\nimport isPromise from 'is-promise';\n\n/**\n * Simplest possible promise redux middleware.\n *\n * @type {import('redux').Middleware}\n */\nconst promiseMiddleware = () => ( next ) => ( action ) => {\n\tif ( isPromise( action ) ) {\n\t\treturn action.then( ( resolvedAction ) => {\n\t\t\tif ( resolvedAction ) {\n\t\t\t\treturn next( resolvedAction );\n\t\t\t}\n\t\t} );\n\t}\n\n\treturn next( action );\n};\n\nexport default promiseMiddleware;\n", "/** @typedef {import('./registry').WPDataRegistry} WPDataRegistry */\n\n/**\n * Creates a middleware handling resolvers cache invalidation.\n *\n * @param {WPDataRegistry} registry Registry for which to create the middleware.\n * @param {string} storeName Name of the store for which to create the middleware.\n *\n * @return {Function} Middleware function.\n */\nconst createResolversCacheMiddleware =\n\t( registry, storeName ) => () => ( next ) => ( action ) => {\n\t\tconst resolvers = registry.select( storeName ).getCachedResolvers();\n\t\tconst resolverEntries = Object.entries( resolvers );\n\t\tresolverEntries.forEach( ( [ selectorName, resolversByArgs ] ) => {\n\t\t\tconst resolver =\n\t\t\t\tregistry.stores[ storeName ]?.resolvers?.[ selectorName ];\n\t\t\tif ( ! resolver || ! resolver.shouldInvalidate ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tresolversByArgs.forEach( ( value, args ) => {\n\t\t\t\t// Works around a bug in `EquivalentKeyMap` where `map.delete` merely sets an entry value\n\t\t\t\t// to `undefined` and `map.forEach` then iterates also over these orphaned entries.\n\t\t\t\tif ( value === undefined ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// resolversByArgs is the map Map([ args ] => boolean) storing the cache resolution status for a given selector.\n\t\t\t\t// If the value is \"finished\" or \"error\" it means this resolver has finished its resolution which means we need\n\t\t\t\t// to invalidate it, if it's true it means it's inflight and the invalidation is not necessary.\n\t\t\t\tif ( value.status !== 'finished' && value.status !== 'error' ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( ! resolver.shouldInvalidate( action, ...args ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Trigger cache invalidation\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( storeName )\n\t\t\t\t\t.invalidateResolution( selectorName, args );\n\t\t\t} );\n\t\t} );\n\t\treturn next( action );\n\t};\n\nexport default createResolversCacheMiddleware;\n", "import type { Middleware } from 'redux';\n\nexport default function createThunkMiddleware( args: unknown ): Middleware {\n\treturn () => ( next ) => ( action ) => {\n\t\tif ( typeof action === 'function' ) {\n\t\t\treturn action( args );\n\t\t}\n\n\t\treturn next( action );\n\t};\n}\n", "/**\n * External dependencies\n */\nimport EquivalentKeyMap from 'equivalent-key-map';\nimport type { Reducer } from 'redux';\n\nimport type {\n\tstartResolution,\n\tfinishResolution,\n\tfailResolution,\n\tstartResolutions,\n\tfinishResolutions,\n\tfailResolutions,\n\tinvalidateResolution,\n\tinvalidateResolutionForStore,\n\tinvalidateResolutionForStoreSelector,\n} from './actions';\n\n/**\n * Internal dependencies\n */\nimport { selectorArgsToStateKey, onSubKey } from './utils';\n\ntype Action =\n\t| ReturnType< typeof startResolution >\n\t| ReturnType< typeof finishResolution >\n\t| ReturnType< typeof failResolution >\n\t| ReturnType< typeof startResolutions >\n\t| ReturnType< typeof finishResolutions >\n\t| ReturnType< typeof failResolutions >\n\t| ReturnType< typeof invalidateResolution >\n\t| ReturnType< typeof invalidateResolutionForStore >\n\t| ReturnType< typeof invalidateResolutionForStoreSelector >;\n\ntype StateKey = unknown[] | unknown;\nexport type StateValue =\n\t| { status: 'resolving' | 'finished' }\n\t| { status: 'error'; error: Error | unknown };\n\nexport type Status = StateValue[ 'status' ];\nexport type State = EquivalentKeyMap< StateKey, StateValue >;\n\n/**\n * Reducer function returning next state for selector resolution of\n * subkeys, object form:\n *\n * selectorName -> EquivalentKeyMap<Array,boolean>\n */\nconst subKeysIsResolved: Reducer< Record< string, State >, Action > = onSubKey<\n\tState,\n\tAction\n>( 'selectorName' )( ( state = new EquivalentKeyMap(), action: Action ) => {\n\tswitch ( action.type ) {\n\t\tcase 'START_RESOLUTION': {\n\t\t\tconst nextState = new EquivalentKeyMap( state );\n\t\t\tnextState.set( selectorArgsToStateKey( action.args ), {\n\t\t\t\tstatus: 'resolving',\n\t\t\t} );\n\t\t\treturn nextState;\n\t\t}\n\t\tcase 'FINISH_RESOLUTION': {\n\t\t\tconst nextState = new EquivalentKeyMap( state );\n\t\t\tnextState.set( selectorArgsToStateKey( action.args ), {\n\t\t\t\tstatus: 'finished',\n\t\t\t} );\n\t\t\treturn nextState;\n\t\t}\n\t\tcase 'FAIL_RESOLUTION': {\n\t\t\tconst nextState = new EquivalentKeyMap( state );\n\t\t\tnextState.set( selectorArgsToStateKey( action.args ), {\n\t\t\t\tstatus: 'error',\n\t\t\t\terror: action.error,\n\t\t\t} );\n\t\t\treturn nextState;\n\t\t}\n\t\tcase 'START_RESOLUTIONS': {\n\t\t\tconst nextState = new EquivalentKeyMap( state );\n\t\t\tfor ( const resolutionArgs of action.args ) {\n\t\t\t\tnextState.set( selectorArgsToStateKey( resolutionArgs ), {\n\t\t\t\t\tstatus: 'resolving',\n\t\t\t\t} );\n\t\t\t}\n\t\t\treturn nextState;\n\t\t}\n\t\tcase 'FINISH_RESOLUTIONS': {\n\t\t\tconst nextState = new EquivalentKeyMap( state );\n\t\t\tfor ( const resolutionArgs of action.args ) {\n\t\t\t\tnextState.set( selectorArgsToStateKey( resolutionArgs ), {\n\t\t\t\t\tstatus: 'finished',\n\t\t\t\t} );\n\t\t\t}\n\t\t\treturn nextState;\n\t\t}\n\t\tcase 'FAIL_RESOLUTIONS': {\n\t\t\tconst nextState = new EquivalentKeyMap( state );\n\t\t\taction.args.forEach( ( resolutionArgs, idx ) => {\n\t\t\t\tconst resolutionState: StateValue = {\n\t\t\t\t\tstatus: 'error',\n\t\t\t\t\terror: undefined,\n\t\t\t\t};\n\n\t\t\t\tconst error = action.errors[ idx ];\n\t\t\t\tif ( error ) {\n\t\t\t\t\tresolutionState.error = error;\n\t\t\t\t}\n\n\t\t\t\tnextState.set(\n\t\t\t\t\tselectorArgsToStateKey( resolutionArgs as unknown[] ),\n\t\t\t\t\tresolutionState\n\t\t\t\t);\n\t\t\t} );\n\t\t\treturn nextState;\n\t\t}\n\t\tcase 'INVALIDATE_RESOLUTION': {\n\t\t\tconst nextState = new EquivalentKeyMap( state );\n\t\t\tnextState.delete( selectorArgsToStateKey( action.args ) );\n\t\t\treturn nextState;\n\t\t}\n\t}\n\treturn state;\n} );\n\n/**\n * Reducer function returning next state for selector resolution, object form:\n *\n * selectorName -> EquivalentKeyMap<Array, boolean>\n *\n * @param state Current state.\n * @param action Dispatched action.\n *\n * @return Next state.\n */\nconst isResolved = ( state: Record< string, State > = {}, action: Action ) => {\n\tswitch ( action.type ) {\n\t\tcase 'INVALIDATE_RESOLUTION_FOR_STORE':\n\t\t\treturn {};\n\t\tcase 'INVALIDATE_RESOLUTION_FOR_STORE_SELECTOR': {\n\t\t\tif ( action.selectorName in state ) {\n\t\t\t\tconst {\n\t\t\t\t\t[ action.selectorName ]: removedSelector,\n\t\t\t\t\t...restState\n\t\t\t\t} = state;\n\t\t\t\treturn restState;\n\t\t\t}\n\t\t\treturn state;\n\t\t}\n\t\tcase 'START_RESOLUTION':\n\t\tcase 'FINISH_RESOLUTION':\n\t\tcase 'FAIL_RESOLUTION':\n\t\tcase 'START_RESOLUTIONS':\n\t\tcase 'FINISH_RESOLUTIONS':\n\t\tcase 'FAIL_RESOLUTIONS':\n\t\tcase 'INVALIDATE_RESOLUTION':\n\t\t\treturn subKeysIsResolved( state, action );\n\t\tdefault:\n\t\t\treturn state;\n\t}\n};\n\nexport default isResolved;\n", "/**\n * External dependencies\n */\nimport type { AnyAction, Reducer } from 'redux';\n\n/**\n * Higher-order reducer creator which creates a combined reducer object, keyed\n * by a property on the action object.\n *\n * @param actionProperty Action property by which to key object.\n * @return Higher-order reducer.\n */\nexport const onSubKey =\n\t< TState extends unknown, TAction extends AnyAction >(\n\t\tactionProperty: string\n\t) =>\n\t(\n\t\treducer: Reducer< TState, TAction >\n\t): Reducer< Record< string, TState >, TAction > =>\n\t( state: Record< string, TState > = {}, action ) => {\n\t\t// Retrieve subkey from action. Do not track if undefined; useful for cases\n\t\t// where reducer is scoped by action shape.\n\t\tconst key = action[ actionProperty ];\n\t\tif ( key === undefined ) {\n\t\t\treturn state;\n\t\t}\n\n\t\t// Avoid updating state if unchanged. Note that this also accounts for a\n\t\t// reducer which returns undefined on a key which is not yet tracked.\n\t\tconst nextKeyState = reducer( state[ key ], action );\n\t\tif ( nextKeyState === state[ key ] ) {\n\t\t\treturn state;\n\t\t}\n\n\t\treturn {\n\t\t\t...state,\n\t\t\t[ key ]: nextKeyState,\n\t\t};\n\t};\n\n/**\n * Normalize selector argument array by defaulting `undefined` value to an empty array\n * and removing trailing `undefined` values.\n *\n * @param args Selector argument array\n * @return Normalized state key array\n */\nexport function selectorArgsToStateKey( args: unknown[] | null | undefined ) {\n\tif ( args === undefined || args === null ) {\n\t\treturn [];\n\t}\n\n\tconst len = args.length;\n\tlet idx = len;\n\twhile ( idx > 0 && args[ idx - 1 ] === undefined ) {\n\t\tidx--;\n\t}\n\treturn idx === len ? args : args.slice( 0, idx );\n}\n", "/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { createSelector } from '../../create-selector';\nimport { selectorArgsToStateKey } from './utils';\n\n/** @typedef {Record<string, import('./reducer').State>} State */\n/** @typedef {import('./reducer').StateValue} StateValue */\n/** @typedef {import('./reducer').Status} Status */\n\n/**\n * Returns the raw resolution state value for a given selector name,\n * and arguments set. May be undefined if the selector has never been resolved\n * or not resolved for the given set of arguments, otherwise true or false for\n * resolution started and completed respectively.\n *\n * @param {State} state Data state.\n * @param {string} selectorName Selector name.\n * @param {unknown[]?} args Arguments passed to selector.\n *\n * @return {StateValue|undefined} isResolving value.\n */\nexport function getResolutionState( state, selectorName, args ) {\n\tconst map = state[ selectorName ];\n\tif ( ! map ) {\n\t\treturn;\n\t}\n\n\treturn map.get( selectorArgsToStateKey( args ) );\n}\n\n/**\n * Returns an `isResolving`-like value for a given selector name and arguments set.\n * Its value is either `undefined` if the selector has never been resolved or has been\n * invalidated, or a `true`/`false` boolean value if the resolution is in progress or\n * has finished, respectively.\n *\n * This is a legacy selector that was implemented when the \"raw\" internal data had\n * this `undefined | boolean` format. Nowadays the internal value is an object that\n * can be retrieved with `getResolutionState`.\n *\n * @deprecated\n *\n * @param {State} state Data state.\n * @param {string} selectorName Selector name.\n * @param {unknown[]?} args Arguments passed to selector.\n *\n * @return {boolean | undefined} isResolving value.\n */\nexport function getIsResolving( state, selectorName, args ) {\n\tdeprecated( 'wp.data.select( store ).getIsResolving', {\n\t\tsince: '6.6',\n\t\tversion: '6.8',\n\t\talternative: 'wp.data.select( store ).getResolutionState',\n\t} );\n\n\tconst resolutionState = getResolutionState( state, selectorName, args );\n\treturn resolutionState && resolutionState.status === 'resolving';\n}\n\n/**\n * Returns true if resolution has already been triggered for a given\n * selector name, and arguments set.\n *\n * @param {State} state Data state.\n * @param {string} selectorName Selector name.\n * @param {unknown[]?} args Arguments passed to selector.\n *\n * @return {boolean} Whether resolution has been triggered.\n */\nexport function hasStartedResolution( state, selectorName, args ) {\n\treturn getResolutionState( state, selectorName, args ) !== undefined;\n}\n\n/**\n * Returns true if resolution has completed for a given selector\n * name, and arguments set.\n *\n * @param {State} state Data state.\n * @param {string} selectorName Selector name.\n * @param {unknown[]?} args Arguments passed to selector.\n *\n * @return {boolean} Whether resolution has completed.\n */\nexport function hasFinishedResolution( state, selectorName, args ) {\n\tconst status = getResolutionState( state, selectorName, args )?.status;\n\treturn status === 'finished' || status === 'error';\n}\n\n/**\n * Returns true if resolution has failed for a given selector\n * name, and arguments set.\n *\n * @param {State} state Data state.\n * @param {string} selectorName Selector name.\n * @param {unknown[]?} args Arguments passed to selector.\n *\n * @return {boolean} Has resolution failed\n */\nexport function hasResolutionFailed( state, selectorName, args ) {\n\treturn getResolutionState( state, selectorName, args )?.status === 'error';\n}\n\n/**\n * Returns the resolution error for a given selector name, and arguments set.\n * Note it may be of an Error type, but may also be null, undefined, or anything else\n * that can be `throw`-n.\n *\n * @param {State} state Data state.\n * @param {string} selectorName Selector name.\n * @param {unknown[]?} args Arguments passed to selector.\n *\n * @return {Error|unknown} Last resolution error\n */\nexport function getResolutionError( state, selectorName, args ) {\n\tconst resolutionState = getResolutionState( state, selectorName, args );\n\treturn resolutionState?.status === 'error' ? resolutionState.error : null;\n}\n\n/**\n * Returns true if resolution has been triggered but has not yet completed for\n * a given selector name, and arguments set.\n *\n * @param {State} state Data state.\n * @param {string} selectorName Selector name.\n * @param {unknown[]?} args Arguments passed to selector.\n *\n * @return {boolean} Whether resolution is in progress.\n */\nexport function isResolving( state, selectorName, args ) {\n\treturn (\n\t\tgetResolutionState( state, selectorName, args )?.status === 'resolving'\n\t);\n}\n\n/**\n * Returns the list of the cached resolvers.\n *\n * @param {State} state Data state.\n *\n * @return {State} Resolvers mapped by args and selectorName.\n */\nexport function getCachedResolvers( state ) {\n\treturn state;\n}\n\n/**\n * Whether the store has any currently resolving selectors.\n *\n * @param {State} state Data state.\n *\n * @return {boolean} True if one or more selectors are resolving, false otherwise.\n */\nexport function hasResolvingSelectors( state ) {\n\treturn Object.values( state ).some( ( selectorState ) =>\n\t\t/**\n\t\t * This uses the internal `_map` property of `EquivalentKeyMap` for\n\t\t * optimization purposes, since the `EquivalentKeyMap` implementation\n\t\t * does not support a `.values()` implementation.\n\t\t *\n\t\t * @see https://github.com/aduth/equivalent-key-map\n\t\t */\n\t\tArray.from( selectorState._map.values() ).some(\n\t\t\t( resolution ) => resolution[ 1 ]?.status === 'resolving'\n\t\t)\n\t);\n}\n\n/**\n * Retrieves the total number of selectors, grouped per status.\n *\n * @param {State} state Data state.\n *\n * @return {Object} Object, containing selector totals by status.\n */\nexport const countSelectorsByStatus = createSelector(\n\t( state ) => {\n\t\tconst selectorsByStatus = {};\n\n\t\tObject.values( state ).forEach( ( selectorState ) =>\n\t\t\t/**\n\t\t\t * This uses the internal `_map` property of `EquivalentKeyMap` for\n\t\t\t * optimization purposes, since the `EquivalentKeyMap` implementation\n\t\t\t * does not support a `.values()` implementation.\n\t\t\t *\n\t\t\t * @see https://github.com/aduth/equivalent-key-map\n\t\t\t */\n\t\t\tArray.from( selectorState._map.values() ).forEach(\n\t\t\t\t( resolution ) => {\n\t\t\t\t\tconst currentStatus = resolution[ 1 ]?.status ?? 'error';\n\t\t\t\t\tif ( ! selectorsByStatus[ currentStatus ] ) {\n\t\t\t\t\t\tselectorsByStatus[ currentStatus ] = 0;\n\t\t\t\t\t}\n\t\t\t\t\tselectorsByStatus[ currentStatus ]++;\n\t\t\t\t}\n\t\t\t)\n\t\t);\n\n\t\treturn selectorsByStatus;\n\t},\n\t( state ) => [ state ]\n);\n", "'use strict';\n\n/** @typedef {(...args: any[]) => *[]} GetDependants */\n\n/** @typedef {() => void} Clear */\n\n/**\n * @typedef {{\n * getDependants: GetDependants,\n * clear: Clear\n * }} EnhancedSelector\n */\n\n/**\n * Internal cache entry.\n *\n * @typedef CacheNode\n *\n * @property {?CacheNode|undefined} [prev] Previous node.\n * @property {?CacheNode|undefined} [next] Next node.\n * @property {*[]} args Function arguments for cache entry.\n * @property {*} val Function result.\n */\n\n/**\n * @typedef Cache\n *\n * @property {Clear} clear Function to clear cache.\n * @property {boolean} [isUniqueByDependants] Whether dependants are valid in\n * considering cache uniqueness. A cache is unique if dependents are all arrays\n * or objects.\n * @property {CacheNode?} [head] Cache head.\n * @property {*[]} [lastDependants] Dependants from previous invocation.\n */\n\n/**\n * Arbitrary value used as key for referencing cache object in WeakMap tree.\n *\n * @type {{}}\n */\nvar LEAF_KEY = {};\n\n/**\n * Returns the first argument as the sole entry in an array.\n *\n * @template T\n *\n * @param {T} value Value to return.\n *\n * @return {[T]} Value returned as entry in array.\n */\nfunction arrayOf(value) {\n\treturn [value];\n}\n\n/**\n * Returns true if the value passed is object-like, or false otherwise. A value\n * is object-like if it can support property assignment, e.g. object or array.\n *\n * @param {*} value Value to test.\n *\n * @return {boolean} Whether value is object-like.\n */\nfunction isObjectLike(value) {\n\treturn !!value && 'object' === typeof value;\n}\n\n/**\n * Creates and returns a new cache object.\n *\n * @return {Cache} Cache object.\n */\nfunction createCache() {\n\t/** @type {Cache} */\n\tvar cache = {\n\t\tclear: function () {\n\t\t\tcache.head = null;\n\t\t},\n\t};\n\n\treturn cache;\n}\n\n/**\n * Returns true if entries within the two arrays are strictly equal by\n * reference from a starting index.\n *\n * @param {*[]} a First array.\n * @param {*[]} b Second array.\n * @param {number} fromIndex Index from which to start comparison.\n *\n * @return {boolean} Whether arrays are shallowly equal.\n */\nfunction isShallowEqual(a, b, fromIndex) {\n\tvar i;\n\n\tif (a.length !== b.length) {\n\t\treturn false;\n\t}\n\n\tfor (i = fromIndex; i < a.length; i++) {\n\t\tif (a[i] !== b[i]) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}\n\n/**\n * Returns a memoized selector function. The getDependants function argument is\n * called before the memoized selector and is expected to return an immutable\n * reference or array of references on which the selector depends for computing\n * its own return value. The memoize cache is preserved only as long as those\n * dependant references remain the same. If getDependants returns a different\n * reference(s), the cache is cleared and the selector value regenerated.\n *\n * @template {(...args: *[]) => *} S\n *\n * @param {S} selector Selector function.\n * @param {GetDependants=} getDependants Dependant getter returning an array of\n * references used in cache bust consideration.\n */\nexport default function (selector, getDependants) {\n\t/** @type {WeakMap<*,*>} */\n\tvar rootCache;\n\n\t/** @type {GetDependants} */\n\tvar normalizedGetDependants = getDependants ? getDependants : arrayOf;\n\n\t/**\n\t * Returns the cache for a given dependants array. When possible, a WeakMap\n\t * will be used to create a unique cache for each set of dependants. This\n\t * is feasible due to the nature of WeakMap in allowing garbage collection\n\t * to occur on entries where the key object is no longer referenced. Since\n\t * WeakMap requires the key to be an object, this is only possible when the\n\t * dependant is object-like. The root cache is created as a hierarchy where\n\t * each top-level key is the first entry in a dependants set, the value a\n\t * WeakMap where each key is the next dependant, and so on. This continues\n\t * so long as the dependants are object-like. If no dependants are object-\n\t * like, then the cache is shared across all invocations.\n\t *\n\t * @see isObjectLike\n\t *\n\t * @param {*[]} dependants Selector dependants.\n\t *\n\t * @return {Cache} Cache object.\n\t */\n\tfunction getCache(dependants) {\n\t\tvar caches = rootCache,\n\t\t\tisUniqueByDependants = true,\n\t\t\ti,\n\t\t\tdependant,\n\t\t\tmap,\n\t\t\tcache;\n\n\t\tfor (i = 0; i < dependants.length; i++) {\n\t\t\tdependant = dependants[i];\n\n\t\t\t// Can only compose WeakMap from object-like key.\n\t\t\tif (!isObjectLike(dependant)) {\n\t\t\t\tisUniqueByDependants = false;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Does current segment of cache already have a WeakMap?\n\t\t\tif (caches.has(dependant)) {\n\t\t\t\t// Traverse into nested WeakMap.\n\t\t\t\tcaches = caches.get(dependant);\n\t\t\t} else {\n\t\t\t\t// Create, set, and traverse into a new one.\n\t\t\t\tmap = new WeakMap();\n\t\t\t\tcaches.set(dependant, map);\n\t\t\t\tcaches = map;\n\t\t\t}\n\t\t}\n\n\t\t// We use an arbitrary (but consistent) object as key for the last item\n\t\t// in the WeakMap to serve as our running cache.\n\t\tif (!caches.has(LEAF_KEY)) {\n\t\t\tcache = createCache();\n\t\t\tcache.isUniqueByDependants = isUniqueByDependants;\n\t\t\tcaches.set(LEAF_KEY, cache);\n\t\t}\n\n\t\treturn caches.get(LEAF_KEY);\n\t}\n\n\t/**\n\t * Resets root memoization cache.\n\t */\n\tfunction clear() {\n\t\trootCache = new WeakMap();\n\t}\n\n\t/* eslint-disable jsdoc/check-param-names */\n\t/**\n\t * The augmented selector call, considering first whether dependants have\n\t * changed before passing it to underlying memoize function.\n\t *\n\t * @param {*} source Source object for derivation.\n\t * @param {...*} extraArgs Additional arguments to pass to selector.\n\t *\n\t * @return {*} Selector result.\n\t */\n\t/* eslint-enable jsdoc/check-param-names */\n\tfunction callSelector(/* source, ...extraArgs */) {\n\t\tvar len = arguments.length,\n\t\t\tcache,\n\t\t\tnode,\n\t\t\ti,\n\t\t\targs,\n\t\t\tdependants;\n\n\t\t// Create copy of arguments (avoid leaking deoptimization).\n\t\targs = new Array(len);\n\t\tfor (i = 0; i < len; i++) {\n\t\t\targs[i] = arguments[i];\n\t\t}\n\n\t\tdependants = normalizedGetDependants.apply(null, args);\n\t\tcache = getCache(dependants);\n\n\t\t// If not guaranteed uniqueness by dependants (primitive type), shallow\n\t\t// compare against last dependants and, if references have changed,\n\t\t// destroy cache to recalculate result.\n\t\tif (!cache.isUniqueByDependants) {\n\t\t\tif (\n\t\t\t\tcache.lastDependants &&\n\t\t\t\t!isShallowEqual(dependants, cache.lastDependants, 0)\n\t\t\t) {\n\t\t\t\tcache.clear();\n\t\t\t}\n\n\t\t\tcache.lastDependants = dependants;\n\t\t}\n\n\t\tnode = cache.head;\n\t\twhile (node) {\n\t\t\t// Check whether node arguments match arguments\n\t\t\tif (!isShallowEqual(node.args, args, 1)) {\n\t\t\t\tnode = node.next;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// At this point we can assume we've found a match\n\n\t\t\t// Surface matched node to head if not already\n\t\t\tif (node !== cache.head) {\n\t\t\t\t// Adjust siblings to point to each other.\n\t\t\t\t/** @type {CacheNode} */ (node.prev).next = node.next;\n\t\t\t\tif (node.next) {\n\t\t\t\t\tnode.next.prev = node.prev;\n\t\t\t\t}\n\n\t\t\t\tnode.next = cache.head;\n\t\t\t\tnode.prev = null;\n\t\t\t\t/** @type {CacheNode} */ (cache.head).prev = node;\n\t\t\t\tcache.head = node;\n\t\t\t}\n\n\t\t\t// Return immediately\n\t\t\treturn node.val;\n\t\t}\n\n\t\t// No cached value found. Continue to insertion phase:\n\n\t\tnode = /** @type {CacheNode} */ ({\n\t\t\t// Generate the result from original function\n\t\t\tval: selector.apply(null, args),\n\t\t});\n\n\t\t// Avoid including the source object in the cache.\n\t\targs[0] = null;\n\t\tnode.args = args;\n\n\t\t// Don't need to check whether node is already head, since it would\n\t\t// have been returned above already if it was\n\n\t\t// Shift existing head down list\n\t\tif (cache.head) {\n\t\t\tcache.head.prev = node;\n\t\t\tnode.next = cache.head;\n\t\t}\n\n\t\tcache.head = node;\n\n\t\treturn node.val;\n\t}\n\n\tcallSelector.getDependants = normalizedGetDependants;\n\tcallSelector.clear = clear;\n\tclear();\n\n\treturn /** @type {S & EnhancedSelector} */ (callSelector);\n}\n", "/**\n * Returns an action object used in signalling that selector resolution has\n * started.\n *\n * @param selectorName Name of selector for which resolver triggered.\n * @param args Arguments to associate for uniqueness.\n *\n * @return Action object.\n */\nexport function startResolution( selectorName: string, args: unknown[] ) {\n\treturn {\n\t\ttype: 'START_RESOLUTION',\n\t\tselectorName,\n\t\targs,\n\t} as const;\n}\n\n/**\n * Returns an action object used in signalling that selector resolution has\n * completed.\n *\n * @param selectorName Name of selector for which resolver triggered.\n * @param args Arguments to associate for uniqueness.\n *\n * @return Action object.\n */\nexport function finishResolution( selectorName: string, args: unknown[] ) {\n\treturn {\n\t\ttype: 'FINISH_RESOLUTION',\n\t\tselectorName,\n\t\targs,\n\t} as const;\n}\n\n/**\n * Returns an action object used in signalling that selector resolution has\n * failed.\n *\n * @param selectorName Name of selector for which resolver triggered.\n * @param args Arguments to associate for uniqueness.\n * @param error The error that caused the failure.\n *\n * @return Action object.\n */\nexport function failResolution(\n\tselectorName: string,\n\targs: unknown[],\n\terror: Error | unknown\n) {\n\treturn {\n\t\ttype: 'FAIL_RESOLUTION',\n\t\tselectorName,\n\t\targs,\n\t\terror,\n\t} as const;\n}\n\n/**\n * Returns an action object used in signalling that a batch of selector resolutions has\n * started.\n *\n * @param selectorName Name of selector for which resolver triggered.\n * @param args Array of arguments to associate for uniqueness, each item\n * is associated to a resolution.\n *\n * @return Action object.\n */\nexport function startResolutions( selectorName: string, args: unknown[][] ) {\n\treturn {\n\t\ttype: 'START_RESOLUTIONS',\n\t\tselectorName,\n\t\targs,\n\t} as const;\n}\n\n/**\n * Returns an action object used in signalling that a batch of selector resolutions has\n * completed.\n *\n * @param selectorName Name of selector for which resolver triggered.\n * @param args Array of arguments to associate for uniqueness, each item\n * is associated to a resolution.\n *\n * @return Action object.\n */\nexport function finishResolutions( selectorName: string, args: unknown[][] ) {\n\treturn {\n\t\ttype: 'FINISH_RESOLUTIONS',\n\t\tselectorName,\n\t\targs,\n\t} as const;\n}\n\n/**\n * Returns an action object used in signalling that a batch of selector resolutions has\n * completed and at least one of them has failed.\n *\n * @param selectorName Name of selector for which resolver triggered.\n * @param args Array of arguments to associate for uniqueness, each item\n * is associated to a resolution.\n * @param errors Array of errors to associate for uniqueness, each item\n * is associated to a resolution.\n * @return Action object.\n */\nexport function failResolutions(\n\tselectorName: string,\n\targs: unknown[],\n\terrors: ( Error | unknown )[]\n) {\n\treturn {\n\t\ttype: 'FAIL_RESOLUTIONS',\n\t\tselectorName,\n\t\targs,\n\t\terrors,\n\t} as const;\n}\n\n/**\n * Returns an action object used in signalling that we should invalidate the resolution cache.\n *\n * @param selectorName Name of selector for which resolver should be invalidated.\n * @param args Arguments to associate for uniqueness.\n *\n * @return Action object.\n */\nexport function invalidateResolution( selectorName: string, args: unknown[] ) {\n\treturn {\n\t\ttype: 'INVALIDATE_RESOLUTION',\n\t\tselectorName,\n\t\targs,\n\t} as const;\n}\n\n/**\n * Returns an action object used in signalling that the resolution\n * should be invalidated.\n *\n * @return Action object.\n */\nexport function invalidateResolutionForStore() {\n\treturn {\n\t\ttype: 'INVALIDATE_RESOLUTION_FOR_STORE',\n\t} as const;\n}\n\n/**\n * Returns an action object used in signalling that the resolution cache for a\n * given selectorName should be invalidated.\n *\n * @param selectorName Name of selector for which all resolvers should\n * be invalidated.\n *\n * @return Action object.\n */\nexport function invalidateResolutionForStoreSelector( selectorName: string ) {\n\treturn {\n\t\ttype: 'INVALIDATE_RESOLUTION_FOR_STORE_SELECTOR',\n\t\tselectorName,\n\t} as const;\n}\n", "const coreDataStore = {\n\tname: 'core/data',\n\tinstantiate( registry ) {\n\t\tconst getCoreDataSelector =\n\t\t\t( selectorName ) =>\n\t\t\t( key, ...args ) => {\n\t\t\t\treturn registry.select( key )[ selectorName ]( ...args );\n\t\t\t};\n\n\t\tconst getCoreDataAction =\n\t\t\t( actionName ) =>\n\t\t\t( key, ...args ) => {\n\t\t\t\treturn registry.dispatch( key )[ actionName ]( ...args );\n\t\t\t};\n\n\t\treturn {\n\t\t\tgetSelectors() {\n\t\t\t\treturn Object.fromEntries(\n\t\t\t\t\t[\n\t\t\t\t\t\t'getIsResolving',\n\t\t\t\t\t\t'hasStartedResolution',\n\t\t\t\t\t\t'hasFinishedResolution',\n\t\t\t\t\t\t'isResolving',\n\t\t\t\t\t\t'getCachedResolvers',\n\t\t\t\t\t].map( ( selectorName ) => [\n\t\t\t\t\t\tselectorName,\n\t\t\t\t\t\tgetCoreDataSelector( selectorName ),\n\t\t\t\t\t] )\n\t\t\t\t);\n\t\t\t},\n\n\t\t\tgetActions() {\n\t\t\t\treturn Object.fromEntries(\n\t\t\t\t\t[\n\t\t\t\t\t\t'startResolution',\n\t\t\t\t\t\t'finishResolution',\n\t\t\t\t\t\t'invalidateResolution',\n\t\t\t\t\t\t'invalidateResolutionForStore',\n\t\t\t\t\t\t'invalidateResolutionForStoreSelector',\n\t\t\t\t\t].map( ( actionName ) => [\n\t\t\t\t\t\tactionName,\n\t\t\t\t\t\tgetCoreDataAction( actionName ),\n\t\t\t\t\t] )\n\t\t\t\t);\n\t\t\t},\n\n\t\t\tsubscribe() {\n\t\t\t\t// There's no reasons to trigger any listener when we subscribe to this store\n\t\t\t\t// because there's no state stored in this store that need to retrigger selectors\n\t\t\t\t// if a change happens, the corresponding store where the tracking stated live\n\t\t\t\t// would have already triggered a \"subscribe\" call.\n\t\t\t\treturn () => () => {};\n\t\t\t},\n\t\t};\n\t},\n};\n\nexport default coreDataStore;\n", "export interface DataEmitter {\n\temit: VoidFunction;\n\tsubscribe: ( listener: VoidFunction ) => VoidFunction;\n\tpause: VoidFunction;\n\tresume: VoidFunction;\n\tisPaused: boolean;\n}\n\n/**\n * Create an event emitter.\n *\n * @return The event emitter.\n */\nexport function createEmitter(): DataEmitter {\n\tlet isPaused = false;\n\tlet isPending = false;\n\tconst listeners = new Set< VoidFunction >();\n\tconst notifyListeners = () =>\n\t\t// We use Array.from to clone the listeners Set\n\t\t// This ensures that we don't run a listener\n\t\t// that was added as a response to another listener.\n\t\tArray.from( listeners ).forEach( ( listener ) => listener() );\n\n\treturn {\n\t\tget isPaused() {\n\t\t\treturn isPaused;\n\t\t},\n\n\t\tsubscribe( listener ) {\n\t\t\tlisteners.add( listener );\n\t\t\treturn () => listeners.delete( listener );\n\t\t},\n\n\t\tpause() {\n\t\t\tisPaused = true;\n\t\t},\n\n\t\tresume() {\n\t\t\tisPaused = false;\n\t\t\tif ( isPending ) {\n\t\t\t\tisPending = false;\n\t\t\t\tnotifyListeners();\n\t\t\t}\n\t\t},\n\n\t\temit() {\n\t\t\tif ( isPaused ) {\n\t\t\t\tisPending = true;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tnotifyListeners();\n\t\t},\n\t};\n}\n", "/**\n * Internal dependencies\n */\nimport { createRegistry } from './registry';\n\nexport default createRegistry();\n", "/*!\n * is-plain-object <https://github.com/jonschlinkert/is-plain-object>\n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\n\nfunction isObject(o) {\n return Object.prototype.toString.call(o) === '[object Object]';\n}\n\nfunction isPlainObject(o) {\n var ctor,prot;\n\n if (isObject(o) === false) return false;\n\n // If has modified constructor\n ctor = o.constructor;\n if (ctor === undefined) return true;\n\n // If has modified prototype\n prot = ctor.prototype;\n if (isObject(prot) === false) return false;\n\n // If constructor does not have an Object-specific method\n if (prot.hasOwnProperty('isPrototypeOf') === false) {\n return false;\n }\n\n // Most likely a plain Object\n return true;\n}\n\nexport { isPlainObject };\n", "/**\n * External dependencies\n */\nimport { isPlainObject } from 'is-plain-object';\nimport deepmerge from 'deepmerge';\n\n/**\n * Internal dependencies\n */\nimport defaultStorage from './storage/default';\nimport { combineReducers } from '../../';\n\n/** @typedef {import('../../registry').WPDataRegistry} WPDataRegistry */\n\n/** @typedef {import('../../registry').WPDataPlugin} WPDataPlugin */\n\n/**\n * @typedef {Object} WPDataPersistencePluginOptions Persistence plugin options.\n *\n * @property {Storage} storage Persistent storage implementation. This must\n * at least implement `getItem` and `setItem` of\n * the Web Storage API.\n * @property {string} storageKey Key on which to set in persistent storage.\n */\n\n/**\n * Default plugin storage.\n *\n * @type {Storage}\n */\nconst DEFAULT_STORAGE = defaultStorage;\n\n/**\n * Default plugin storage key.\n *\n * @type {string}\n */\nconst DEFAULT_STORAGE_KEY = 'WP_DATA';\n\n/**\n * Higher-order reducer which invokes the original reducer only if state is\n * inequal from that of the action's `nextState` property, otherwise returning\n * the original state reference.\n *\n * @param {Function} reducer Original reducer.\n *\n * @return {Function} Enhanced reducer.\n */\nexport const withLazySameState = ( reducer ) => ( state, action ) => {\n\tif ( action.nextState === state ) {\n\t\treturn state;\n\t}\n\n\treturn reducer( state, action );\n};\n\n/**\n * Creates a persistence interface, exposing getter and setter methods (`get`\n * and `set` respectively).\n *\n * @param {WPDataPersistencePluginOptions} options Plugin options.\n *\n * @return {Object} Persistence interface.\n */\nexport function createPersistenceInterface( options ) {\n\tconst { storage = DEFAULT_STORAGE, storageKey = DEFAULT_STORAGE_KEY } =\n\t\toptions;\n\n\tlet data;\n\n\t/**\n\t * Returns the persisted data as an object, defaulting to an empty object.\n\t *\n\t * @return {Object} Persisted data.\n\t */\n\tfunction getData() {\n\t\tif ( data === undefined ) {\n\t\t\t// If unset, getItem is expected to return null. Fall back to\n\t\t\t// empty object.\n\t\t\tconst persisted = storage.getItem( storageKey );\n\t\t\tif ( persisted === null ) {\n\t\t\t\tdata = {};\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\tdata = JSON.parse( persisted );\n\t\t\t\t} catch ( error ) {\n\t\t\t\t\t// Similarly, should any error be thrown during parse of\n\t\t\t\t\t// the string (malformed JSON), fall back to empty object.\n\t\t\t\t\tdata = {};\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn data;\n\t}\n\n\t/**\n\t * Merges an updated reducer state into the persisted data.\n\t *\n\t * @param {string} key Key to update.\n\t * @param {*} value Updated value.\n\t */\n\tfunction setData( key, value ) {\n\t\tdata = { ...data, [ key ]: value };\n\t\tstorage.setItem( storageKey, JSON.stringify( data ) );\n\t}\n\n\treturn {\n\t\tget: getData,\n\t\tset: setData,\n\t};\n}\n\n/**\n * Data plugin to persist store state into a single storage key.\n *\n * @param {WPDataRegistry} registry Data registry.\n * @param {?WPDataPersistencePluginOptions} pluginOptions Plugin options.\n *\n * @return {WPDataPlugin} Data plugin.\n */\nfunction persistencePlugin( registry, pluginOptions ) {\n\tconst persistence = createPersistenceInterface( pluginOptions );\n\n\t/**\n\t * Creates an enhanced store dispatch function, triggering the state of the\n\t * given store name to be persisted when changed.\n\t *\n\t * @param {Function} getState Function which returns current state.\n\t * @param {string} storeName Store name.\n\t * @param {?Array<string>} keys Optional subset of keys to save.\n\t *\n\t * @return {Function} Enhanced dispatch function.\n\t */\n\tfunction createPersistOnChange( getState, storeName, keys ) {\n\t\tlet getPersistedState;\n\t\tif ( Array.isArray( keys ) ) {\n\t\t\t// Given keys, the persisted state should by produced as an object\n\t\t\t// of the subset of keys. This implementation uses combineReducers\n\t\t\t// to leverage its behavior of returning the same object when none\n\t\t\t// of the property values changes. This allows a strict reference\n\t\t\t// equality to bypass a persistence set on an unchanging state.\n\t\t\tconst reducers = keys.reduce(\n\t\t\t\t( accumulator, key ) =>\n\t\t\t\t\tObject.assign( accumulator, {\n\t\t\t\t\t\t[ key ]: ( state, action ) => action.nextState[ key ],\n\t\t\t\t\t} ),\n\t\t\t\t{}\n\t\t\t);\n\n\t\t\tgetPersistedState = withLazySameState(\n\t\t\t\tcombineReducers( reducers )\n\t\t\t);\n\t\t} else {\n\t\t\tgetPersistedState = ( state, action ) => action.nextState;\n\t\t}\n\n\t\tlet lastState = getPersistedState( undefined, {\n\t\t\tnextState: getState(),\n\t\t} );\n\n\t\treturn () => {\n\t\t\tconst state = getPersistedState( lastState, {\n\t\t\t\tnextState: getState(),\n\t\t\t} );\n\t\t\tif ( state !== lastState ) {\n\t\t\t\tpersistence.set( storeName, state );\n\t\t\t\tlastState = state;\n\t\t\t}\n\t\t};\n\t}\n\n\treturn {\n\t\tregisterStore( storeName, options ) {\n\t\t\tif ( ! options.persist ) {\n\t\t\t\treturn registry.registerStore( storeName, options );\n\t\t\t}\n\n\t\t\t// Load from persistence to use as initial state.\n\t\t\tconst persistedState = persistence.get()[ storeName ];\n\t\t\tif ( persistedState !== undefined ) {\n\t\t\t\tlet initialState = options.reducer( options.initialState, {\n\t\t\t\t\ttype: '@@WP/PERSISTENCE_RESTORE',\n\t\t\t\t} );\n\n\t\t\t\tif (\n\t\t\t\t\tisPlainObject( initialState ) &&\n\t\t\t\t\tisPlainObject( persistedState )\n\t\t\t\t) {\n\t\t\t\t\t// If state is an object, ensure that:\n\t\t\t\t\t// - Other keys are left intact when persisting only a\n\t\t\t\t\t// subset of keys.\n\t\t\t\t\t// - New keys in what would otherwise be used as initial\n\t\t\t\t\t// state are deeply merged as base for persisted value.\n\t\t\t\t\tinitialState = deepmerge( initialState, persistedState, {\n\t\t\t\t\t\tisMergeableObject: isPlainObject,\n\t\t\t\t\t} );\n\t\t\t\t} else {\n\t\t\t\t\t// If there is a mismatch in object-likeness of default\n\t\t\t\t\t// initial or persisted state, defer to persisted value.\n\t\t\t\t\tinitialState = persistedState;\n\t\t\t\t}\n\n\t\t\t\toptions = {\n\t\t\t\t\t...options,\n\t\t\t\t\tinitialState,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst store = registry.registerStore( storeName, options );\n\n\t\t\tstore.subscribe(\n\t\t\t\tcreatePersistOnChange(\n\t\t\t\t\tstore.getState,\n\t\t\t\t\tstoreName,\n\t\t\t\t\toptions.persist\n\t\t\t\t)\n\t\t\t);\n\n\t\t\treturn store;\n\t\t},\n\t};\n}\n\npersistencePlugin.__unstableMigrate = () => {};\n\nexport default persistencePlugin;\n", "let objectStorage;\n\nconst storage = {\n\tgetItem( key ) {\n\t\tif ( ! objectStorage || ! objectStorage[ key ] ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn objectStorage[ key ];\n\t},\n\tsetItem( key, value ) {\n\t\tif ( ! objectStorage ) {\n\t\t\tstorage.clear();\n\t\t}\n\n\t\tobjectStorage[ key ] = String( value );\n\t},\n\tclear() {\n\t\tobjectStorage = Object.create( null );\n\t},\n};\n\nexport default storage;\n", "/**\n * Internal dependencies\n */\nimport objectStorage from './object';\n\nlet storage;\n\ntry {\n\t// Private Browsing in Safari 10 and earlier will throw an error when\n\t// attempting to set into localStorage. The test here is intentional in\n\t// causing a thrown error as condition for using fallback object storage.\n\tstorage = window.localStorage;\n\tstorage.setItem( '__wpDataTestLocalStorage', '' );\n\tstorage.removeItem( '__wpDataTestLocalStorage' );\n} catch ( error ) {\n\tstorage = objectStorage;\n}\n\nexport default storage;\n", "/**\n * WordPress dependencies\n */\nimport { createHigherOrderComponent, pure } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport useSelect from '../use-select';\n\n/** @typedef {import('react').ComponentType} ComponentType */\n\n/**\n * Higher-order component used to inject state-derived props using registered\n * selectors.\n *\n * @param {Function} mapSelectToProps Function called on every state change,\n * expected to return object of props to\n * merge with the component's own props.\n *\n * @example\n * ```js\n * import { withSelect } from '@wordpress/data';\n * import { store as myCustomStore } from 'my-custom-store';\n *\n * function PriceDisplay( { price, currency } ) {\n * \treturn new Intl.NumberFormat( 'en-US', {\n * \t\tstyle: 'currency',\n * \t\tcurrency,\n * \t} ).format( price );\n * }\n *\n * const HammerPriceDisplay = withSelect( ( select, ownProps ) => {\n * \tconst { getPrice } = select( myCustomStore );\n * \tconst { currency } = ownProps;\n *\n * \treturn {\n * \t\tprice: getPrice( 'hammer', currency ),\n * \t};\n * } )( PriceDisplay );\n *\n * // Rendered in the application:\n * //\n * // <HammerPriceDisplay currency=\"USD\" />\n * ```\n * In the above example, when `HammerPriceDisplay` is rendered into an\n * application, it will pass the price into the underlying `PriceDisplay`\n * component and update automatically if the price of a hammer ever changes in\n * the store.\n *\n * @return {ComponentType} Enhanced component with merged state data props.\n */\nconst withSelect = ( mapSelectToProps ) =>\n\tcreateHigherOrderComponent(\n\t\t( WrappedComponent ) =>\n\t\t\tpure( ( ownProps ) => {\n\t\t\t\tconst mapSelect = ( select, registry ) =>\n\t\t\t\t\tmapSelectToProps( select, ownProps, registry );\n\t\t\t\tconst mergeProps = useSelect( mapSelect );\n\t\t\t\treturn <WrappedComponent { ...ownProps } { ...mergeProps } />;\n\t\t\t} ),\n\t\t'withSelect'\n\t);\n\nexport default withSelect;\n", "/**\n * WordPress dependencies\n */\nimport { createQueue } from '@wordpress/priority-queue';\nimport {\n\tuseRef,\n\tuseCallback,\n\tuseMemo,\n\tuseSyncExternalStore,\n\tuseDebugValue,\n} from '@wordpress/element';\nimport { isShallowEqual } from '@wordpress/is-shallow-equal';\n\n/**\n * Internal dependencies\n */\nimport useRegistry from '../registry-provider/use-registry';\nimport useAsyncMode from '../async-mode-provider/use-async-mode';\n\nconst renderQueue = createQueue();\n\nfunction warnOnUnstableReference( a, b ) {\n\tif ( ! a || ! b ) {\n\t\treturn;\n\t}\n\n\tconst keys =\n\t\ttypeof a === 'object' && typeof b === 'object'\n\t\t\t? Object.keys( a ).filter( ( k ) => a[ k ] !== b[ k ] )\n\t\t\t: [];\n\n\t// eslint-disable-next-line no-console\n\tconsole.warn(\n\t\t'The `useSelect` hook returns different values when called with the same state and parameters.\\n' +\n\t\t\t'This can lead to unnecessary re-renders and performance issues if not fixed.\\n\\n' +\n\t\t\t'Non-equal value keys: %s\\n\\n',\n\t\tkeys.join( ', ' )\n\t);\n}\n\n/**\n * @typedef {import('../../types').StoreDescriptor<C>} StoreDescriptor\n * @template {import('../../types').AnyConfig} C\n */\n/**\n * @typedef {import('../../types').ReduxStoreConfig<State,Actions,Selectors>} ReduxStoreConfig\n * @template State\n * @template {Record<string,import('../../types').ActionCreator>} Actions\n * @template Selectors\n */\n/** @typedef {import('../../types').MapSelect} MapSelect */\n/**\n * @typedef {import('../../types').UseSelectReturn<T>} UseSelectReturn\n * @template {MapSelect|StoreDescriptor<any>} T\n */\n\nfunction Store( registry, suspense ) {\n\tconst select = suspense ? registry.suspendSelect : registry.select;\n\tconst queueContext = {};\n\tlet lastMapSelect;\n\tlet lastMapResult;\n\tlet lastMapResultValid = false;\n\tlet lastIsAsync;\n\tlet subscriber;\n\tlet didWarnUnstableReference;\n\tconst storeStatesOnMount = new Map();\n\n\tfunction getStoreState( name ) {\n\t\t// If there's no store property (custom generic store), return an empty\n\t\t// object. When comparing the state, the empty objects will cause the\n\t\t// equality check to fail, setting `lastMapResultValid` to false.\n\t\treturn registry.stores[ name ]?.store?.getState?.() ?? {};\n\t}\n\n\tconst createSubscriber = ( stores ) => {\n\t\t// The set of stores the `subscribe` function is supposed to subscribe to. Here it is\n\t\t// initialized, and then the `updateStores` function can add new stores to it.\n\t\tconst activeStores = [ ...stores ];\n\n\t\t// The `subscribe` function, which is passed to the `useSyncExternalStore` hook, could\n\t\t// be called multiple times to establish multiple subscriptions. That's why we need to\n\t\t// keep a set of active subscriptions;\n\t\tconst activeSubscriptions = new Set();\n\n\t\tfunction subscribe( listener ) {\n\t\t\t// Maybe invalidate the value right after subscription was created.\n\t\t\t// React will call `getValue` after subscribing, to detect store\n\t\t\t// updates that happened in the interval between the `getValue` call\n\t\t\t// during render and creating the subscription, which is slightly\n\t\t\t// delayed. We need to ensure that this second `getValue` call will\n\t\t\t// compute a fresh value only if any of the store states have\n\t\t\t// changed in the meantime.\n\t\t\tif ( lastMapResultValid ) {\n\t\t\t\tfor ( const name of activeStores ) {\n\t\t\t\t\tif (\n\t\t\t\t\t\tstoreStatesOnMount.get( name ) !== getStoreState( name )\n\t\t\t\t\t) {\n\t\t\t\t\t\tlastMapResultValid = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tstoreStatesOnMount.clear();\n\n\t\t\tconst onStoreChange = () => {\n\t\t\t\t// Invalidate the value on store update, so that a fresh value is computed.\n\t\t\t\tlastMapResultValid = false;\n\t\t\t\tlistener();\n\t\t\t};\n\n\t\t\tconst onChange = () => {\n\t\t\t\tif ( lastIsAsync ) {\n\t\t\t\t\trenderQueue.add( queueContext, onStoreChange );\n\t\t\t\t} else {\n\t\t\t\t\tonStoreChange();\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tconst unsubs = [];\n\t\t\tfunction subscribeStore( storeName ) {\n\t\t\t\tunsubs.push( registry.subscribe( onChange, storeName ) );\n\t\t\t}\n\n\t\t\tfor ( const storeName of activeStores ) {\n\t\t\t\tsubscribeStore( storeName );\n\t\t\t}\n\n\t\t\tactiveSubscriptions.add( subscribeStore );\n\n\t\t\treturn () => {\n\t\t\t\tactiveSubscriptions.delete( subscribeStore );\n\n\t\t\t\tfor ( const unsub of unsubs.values() ) {\n\t\t\t\t\t// The return value of the subscribe function could be undefined if the store is a custom generic store.\n\t\t\t\t\tunsub?.();\n\t\t\t\t}\n\t\t\t\t// Cancel existing store updates that were already scheduled.\n\t\t\t\trenderQueue.cancel( queueContext );\n\t\t\t};\n\t\t}\n\n\t\t// Check if `newStores` contains some stores we're not subscribed to yet, and add them.\n\t\tfunction updateStores( newStores ) {\n\t\t\tfor ( const newStore of newStores ) {\n\t\t\t\tif ( activeStores.includes( newStore ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// New `subscribe` calls will subscribe to `newStore`, too.\n\t\t\t\tactiveStores.push( newStore );\n\n\t\t\t\t// Add `newStore` to existing subscriptions.\n\t\t\t\tfor ( const subscription of activeSubscriptions ) {\n\t\t\t\t\tsubscription( newStore );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn { subscribe, updateStores };\n\t};\n\n\treturn ( mapSelect, isAsync ) => {\n\t\tfunction updateValue() {\n\t\t\t// If the last value is valid, and the `mapSelect` callback hasn't changed,\n\t\t\t// then we can safely return the cached value. The value can change only on\n\t\t\t// store update, and in that case value will be invalidated by the listener.\n\t\t\tif ( lastMapResultValid && mapSelect === lastMapSelect ) {\n\t\t\t\treturn lastMapResult;\n\t\t\t}\n\n\t\t\tconst listeningStores = { current: null };\n\t\t\tconst mapResult = registry.__unstableMarkListeningStores(\n\t\t\t\t() => mapSelect( select, registry ),\n\t\t\t\tlisteningStores\n\t\t\t);\n\n\t\t\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\t\t\tif ( ! didWarnUnstableReference ) {\n\t\t\t\t\tconst secondMapResult = mapSelect( select, registry );\n\t\t\t\t\tif ( ! isShallowEqual( mapResult, secondMapResult ) ) {\n\t\t\t\t\t\twarnOnUnstableReference( mapResult, secondMapResult );\n\t\t\t\t\t\tdidWarnUnstableReference = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! subscriber ) {\n\t\t\t\tfor ( const name of listeningStores.current ) {\n\t\t\t\t\tstoreStatesOnMount.set( name, getStoreState( name ) );\n\t\t\t\t}\n\t\t\t\tsubscriber = createSubscriber( listeningStores.current );\n\t\t\t} else {\n\t\t\t\tsubscriber.updateStores( listeningStores.current );\n\t\t\t}\n\n\t\t\t// If the new value is shallow-equal to the old one, keep the old one so\n\t\t\t// that we don't trigger unwanted updates that do a `===` check.\n\t\t\tif ( ! isShallowEqual( lastMapResult, mapResult ) ) {\n\t\t\t\tlastMapResult = mapResult;\n\t\t\t}\n\t\t\tlastMapSelect = mapSelect;\n\t\t\tlastMapResultValid = true;\n\t\t}\n\n\t\tfunction getValue() {\n\t\t\t// Update the value in case it's been invalidated or `mapSelect` has changed.\n\t\t\tupdateValue();\n\t\t\treturn lastMapResult;\n\t\t}\n\n\t\t// When transitioning from async to sync mode, cancel existing store updates\n\t\t// that have been scheduled, and invalidate the value so that it's freshly\n\t\t// computed. It might have been changed by the update we just cancelled.\n\t\tif ( lastIsAsync && ! isAsync ) {\n\t\t\tlastMapResultValid = false;\n\t\t\trenderQueue.cancel( queueContext );\n\t\t}\n\n\t\tupdateValue();\n\n\t\tlastIsAsync = isAsync;\n\n\t\t// Return a pair of functions that can be passed to `useSyncExternalStore`.\n\t\treturn { subscribe: subscriber.subscribe, getValue };\n\t};\n}\n\nfunction _useStaticSelect( storeName ) {\n\treturn useRegistry().select( storeName );\n}\n\nfunction _useMappingSelect( suspense, mapSelect, deps ) {\n\tconst registry = useRegistry();\n\tconst isAsync = useAsyncMode();\n\tconst store = useMemo(\n\t\t() => Store( registry, suspense ),\n\t\t[ registry, suspense ]\n\t);\n\n\t// These are \"pass-through\" dependencies from the parent hook,\n\t// and the parent should catch any hook rule violations.\n\tconst selector = useCallback( mapSelect, deps );\n\tconst { subscribe, getValue } = store( selector, isAsync );\n\tconst result = useSyncExternalStore( subscribe, getValue, getValue );\n\tuseDebugValue( result );\n\treturn result;\n}\n\n/**\n * Custom react hook for retrieving props from registered selectors.\n *\n * In general, this custom React hook follows the\n * [rules of hooks](https://react.dev/reference/rules/rules-of-hooks).\n *\n * @template {MapSelect | StoreDescriptor<any>} T\n * @param {T} mapSelect Function called on every state change. The returned value is\n * exposed to the component implementing this hook. The function\n * receives the `registry.select` method on the first argument\n * and the `registry` on the second argument.\n * When a store key is passed, all selectors for the store will be\n * returned. This is only meant for usage of these selectors in event\n * callbacks, not for data needed to create the element tree.\n * @param {unknown[]=} deps If provided, this memoizes the mapSelect so the same `mapSelect` is\n * invoked on every state change unless the dependencies change.\n *\n * @example\n * ```js\n * import { useSelect } from '@wordpress/data';\n * import { store as myCustomStore } from 'my-custom-store';\n *\n * function HammerPriceDisplay( { currency } ) {\n * const price = useSelect( ( select ) => {\n * return select( myCustomStore ).getPrice( 'hammer', currency );\n * }, [ currency ] );\n * return new Intl.NumberFormat( 'en-US', {\n * style: 'currency',\n * currency,\n * } ).format( price );\n * }\n *\n * // Rendered in the application:\n * // <HammerPriceDisplay currency=\"USD\" />\n * ```\n *\n * In the above example, when `HammerPriceDisplay` is rendered into an\n * application, the price will be retrieved from the store state using the\n * `mapSelect` callback on `useSelect`. If the currency prop changes then\n * any price in the state for that currency is retrieved. If the currency prop\n * doesn't change and other props are passed in that do change, the price will\n * not change because the dependency is just the currency.\n *\n * When data is only used in an event callback, the data should not be retrieved\n * on render, so it may be useful to get the selectors function instead.\n *\n * **Don't use `useSelect` this way when calling the selectors in the render\n * function because your component won't re-render on a data change.**\n *\n * ```js\n * import { useSelect } from '@wordpress/data';\n * import { store as myCustomStore } from 'my-custom-store';\n *\n * function Paste( { children } ) {\n * const { getSettings } = useSelect( myCustomStore );\n * function onPaste() {\n * // Do something with the settings.\n * const settings = getSettings();\n * }\n * return <div onPaste={ onPaste }>{ children }</div>;\n * }\n * ```\n * @return {UseSelectReturn<T>} A custom react hook.\n */\nexport default function useSelect( mapSelect, deps ) {\n\t// On initial call, on mount, determine the mode of this `useSelect` call\n\t// and then never allow it to change on subsequent updates.\n\tconst staticSelectMode = typeof mapSelect !== 'function';\n\tconst staticSelectModeRef = useRef( staticSelectMode );\n\n\tif ( staticSelectMode !== staticSelectModeRef.current ) {\n\t\tconst prevMode = staticSelectModeRef.current ? 'static' : 'mapping';\n\t\tconst nextMode = staticSelectMode ? 'static' : 'mapping';\n\t\tthrow new Error(\n\t\t\t`Switching useSelect from ${ prevMode } to ${ nextMode } is not allowed`\n\t\t);\n\t}\n\n\t// `staticSelectMode` is not allowed to change during the hook instance's,\n\t// lifetime, so the rules of hooks are not really violated.\n\treturn staticSelectMode\n\t\t? _useStaticSelect( mapSelect )\n\t\t: _useMappingSelect( false, mapSelect, deps );\n}\n\n/**\n * A variant of the `useSelect` hook that has the same API, but is a compatible\n * Suspense-enabled data source.\n *\n * @template {MapSelect} T\n * @param {T} mapSelect Function called on every state change. The\n * returned value is exposed to the component\n * using this hook. The function receives the\n * `registry.suspendSelect` method as the first\n * argument and the `registry` as the second one.\n * @param {Array} deps A dependency array used to memoize the `mapSelect`\n * so that the same `mapSelect` is invoked on every\n * state change unless the dependencies change.\n *\n * @throws {Promise} A suspense Promise that is thrown if any of the called\n * selectors is in an unresolved state.\n *\n * @return {ReturnType<T>} Data object returned by the `mapSelect` function.\n */\nexport function useSuspenseSelect( mapSelect, deps ) {\n\treturn _useMappingSelect( true, mapSelect, deps );\n}\n", "/**\n * WordPress dependencies\n */\nimport { useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { Context } from './context';\n\n/**\n * A custom react hook exposing the registry context for use.\n *\n * This exposes the `registry` value provided via the\n * <a href=\"#RegistryProvider\">Registry Provider</a> to a component implementing\n * this hook.\n *\n * It acts similarly to the `useContext` react hook.\n *\n * Note: Generally speaking, `useRegistry` is a low level hook that in most cases\n * won't be needed for implementation. Most interactions with the `@wordpress/data`\n * API can be performed via the `useSelect` hook, or the `withSelect` and\n * `withDispatch` higher order components.\n *\n * @example\n * ```js\n * import {\n * RegistryProvider,\n * createRegistry,\n * useRegistry,\n * } from '@wordpress/data';\n *\n * const registry = createRegistry( {} );\n *\n * const SomeChildUsingRegistry = ( props ) => {\n * const registry = useRegistry();\n * // ...logic implementing the registry in other react hooks.\n * };\n *\n *\n * const ParentProvidingRegistry = ( props ) => {\n * return <RegistryProvider value={ registry }>\n * <SomeChildUsingRegistry { ...props } />\n * </RegistryProvider>\n * };\n * ```\n *\n * @return {import('../../types').DataRegistry} A custom react hook exposing the registry context value.\n */\nexport default function useRegistry() {\n\treturn useContext( Context );\n}\n", "/**\n * WordPress dependencies\n */\nimport { createContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport defaultRegistry from '../../default-registry';\n\nexport const Context = createContext( defaultRegistry );\nContext.displayName = 'RegistryProviderContext';\n\nconst { Consumer, Provider } = Context;\n\n/**\n * A custom react Context consumer exposing the provided `registry` to\n * children components. Used along with the RegistryProvider.\n *\n * You can read more about the react context api here:\n * https://react.dev/learn/passing-data-deeply-with-context#step-3-provide-the-context\n *\n * @example\n * ```js\n * import {\n * RegistryProvider,\n * RegistryConsumer,\n * createRegistry\n * } from '@wordpress/data';\n *\n * const registry = createRegistry( {} );\n *\n * const App = ( { props } ) => {\n * return <RegistryProvider value={ registry }>\n * <div>Hello There</div>\n * <RegistryConsumer>\n * { ( registry ) => (\n * <ComponentUsingRegistry\n * \t\t{ ...props }\n * \t registry={ registry }\n * ) }\n * </RegistryConsumer>\n * </RegistryProvider>\n * }\n * ```\n */\nexport const RegistryConsumer = Consumer;\n\n/**\n * A custom Context provider for exposing the provided `registry` to children\n * components via a consumer.\n *\n * See <a name=\"#RegistryConsumer\">RegistryConsumer</a> documentation for\n * example.\n */\nexport default Provider;\n", "/**\n * WordPress dependencies\n */\nimport { useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { Context } from './context';\n\nexport default function useAsyncMode() {\n\treturn useContext( Context );\n}\n", "/**\n * WordPress dependencies\n */\nimport { createContext } from '@wordpress/element';\n\nexport const Context = createContext( false );\nContext.displayName = 'AsyncModeContext';\n\nconst { Consumer, Provider } = Context;\n\nexport const AsyncModeConsumer = Consumer;\n\n/**\n * Context Provider Component used to switch the data module component rerendering\n * between Sync and Async modes.\n *\n * @example\n *\n * ```js\n * import { useSelect, AsyncModeProvider } from '@wordpress/data';\n * import { store as blockEditorStore } from '@wordpress/block-editor';\n *\n * function BlockCount() {\n * const count = useSelect( ( select ) => {\n * return select( blockEditorStore ).getBlockCount()\n * }, [] );\n *\n * return count;\n * }\n *\n * function App() {\n * return (\n * <AsyncModeProvider value={ true }>\n * <BlockCount />\n * </AsyncModeProvider>\n * );\n * }\n * ```\n *\n * In this example, the BlockCount component is rerendered asynchronously.\n * It means if a more critical task is being performed (like typing in an input),\n * the rerendering is delayed until the browser becomes IDLE.\n * It is possible to nest multiple levels of AsyncModeProvider to fine-tune the rendering behavior.\n *\n * @param {boolean} props.value Enable Async Mode.\n * @return {Component} The component to be rendered.\n */\nexport default Provider;\n", "/**\n * WordPress dependencies\n */\nimport { createHigherOrderComponent } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { useDispatchWithMap } from '../use-dispatch';\n\n/** @typedef {import('react').ComponentType} ComponentType */\n\n/**\n * Higher-order component used to add dispatch props using registered action\n * creators.\n *\n * @param {Function} mapDispatchToProps A function of returning an object of\n * prop names where value is a\n * dispatch-bound action creator, or a\n * function to be called with the\n * component's props and returning an\n * action creator.\n *\n * @example\n * ```jsx\n * function Button( { onClick, children } ) {\n * return <button type=\"button\" onClick={ onClick }>{ children }</button>;\n * }\n *\n * import { withDispatch } from '@wordpress/data';\n * import { store as myCustomStore } from 'my-custom-store';\n *\n * const SaleButton = withDispatch( ( dispatch, ownProps ) => {\n * const { startSale } = dispatch( myCustomStore );\n * const { discountPercent } = ownProps;\n *\n * return {\n * onClick() {\n * startSale( discountPercent );\n * },\n * };\n * } )( Button );\n *\n * // Rendered in the application:\n * //\n * // <SaleButton discountPercent=\"20\">Start Sale!</SaleButton>\n * ```\n *\n * @example\n * In the majority of cases, it will be sufficient to use only two first params\n * passed to `mapDispatchToProps` as illustrated in the previous example.\n * However, there might be some very advanced use cases where using the\n * `registry` object might be used as a tool to optimize the performance of\n * your component. Using `select` function from the registry might be useful\n * when you need to fetch some dynamic data from the store at the time when the\n * event is fired, but at the same time, you never use it to render your\n * component. In such scenario, you can avoid using the `withSelect` higher\n * order component to compute such prop, which might lead to unnecessary\n * re-renders of your component caused by its frequent value change.\n * Keep in mind, that `mapDispatchToProps` must return an object with functions\n * only.\n *\n * ```jsx\n * function Button( { onClick, children } ) {\n * return <button type=\"button\" onClick={ onClick }>{ children }</button>;\n * }\n *\n * import { withDispatch } from '@wordpress/data';\n * import { store as myCustomStore } from 'my-custom-store';\n *\n * const SaleButton = withDispatch( ( dispatch, ownProps, { select } ) => {\n * // Stock number changes frequently.\n * const { getStockNumber } = select( myCustomStore );\n * const { startSale } = dispatch( myCustomStore );\n * return {\n * onClick() {\n * const discountPercent = getStockNumber() > 50 ? 10 : 20;\n * startSale( discountPercent );\n * },\n * };\n * } )( Button );\n *\n * // Rendered in the application:\n * //\n * // <SaleButton>Start Sale!</SaleButton>\n * ```\n *\n * _Note:_ It is important that the `mapDispatchToProps` function always\n * returns an object with the same keys. For example, it should not contain\n * conditions under which a different value would be returned.\n *\n * @return {ComponentType} Enhanced component with merged dispatcher props.\n */\nconst withDispatch = ( mapDispatchToProps ) =>\n\tcreateHigherOrderComponent(\n\t\t( WrappedComponent ) => ( ownProps ) => {\n\t\t\tconst mapDispatch = ( dispatch, registry ) =>\n\t\t\t\tmapDispatchToProps( dispatch, ownProps, registry );\n\t\t\tconst dispatchProps = useDispatchWithMap( mapDispatch, [] );\n\t\t\treturn <WrappedComponent { ...ownProps } { ...dispatchProps } />;\n\t\t},\n\t\t'withDispatch'\n\t);\n\nexport default withDispatch;\n", "/**\n * Internal dependencies\n */\nimport useRegistry from '../registry-provider/use-registry';\n\n/**\n * @typedef {import('../../types').StoreDescriptor<StoreConfig>} StoreDescriptor\n * @template {import('../../types').AnyConfig} StoreConfig\n */\n/**\n * @typedef {import('../../types').UseDispatchReturn<StoreNameOrDescriptor>} UseDispatchReturn\n * @template StoreNameOrDescriptor\n */\n\n/**\n * A custom react hook returning the current registry dispatch actions creators.\n *\n * Note: The component using this hook must be within the context of a\n * RegistryProvider.\n *\n * @template {undefined | string | StoreDescriptor<any>} StoreNameOrDescriptor\n * @param {StoreNameOrDescriptor} [storeNameOrDescriptor] Optionally provide the name of the\n * store or its descriptor from which to\n * retrieve action creators. If not\n * provided, the registry.dispatch\n * function is returned instead.\n *\n * @example\n * This illustrates a pattern where you may need to retrieve dynamic data from\n * the server via the `useSelect` hook to use in combination with the dispatch\n * action.\n *\n * ```jsx\n * import { useCallback } from 'react';\n * import { useDispatch, useSelect } from '@wordpress/data';\n * import { store as myCustomStore } from 'my-custom-store';\n *\n * function Button( { onClick, children } ) {\n * return <button type=\"button\" onClick={ onClick }>{ children }</button>\n * }\n *\n * const SaleButton = ( { children } ) => {\n * const { stockNumber } = useSelect(\n * ( select ) => select( myCustomStore ).getStockNumber(),\n * []\n * );\n * const { startSale } = useDispatch( myCustomStore );\n * const onClick = useCallback( () => {\n * const discountPercent = stockNumber > 50 ? 10: 20;\n * startSale( discountPercent );\n * }, [ stockNumber ] );\n * return <Button onClick={ onClick }>{ children }</Button>\n * }\n *\n * // Rendered somewhere in the application:\n * //\n * // <SaleButton>Start Sale!</SaleButton>\n * ```\n * @return {UseDispatchReturn<StoreNameOrDescriptor>} A custom react hook.\n */\nconst useDispatch = ( storeNameOrDescriptor ) => {\n\tconst { dispatch } = useRegistry();\n\treturn storeNameOrDescriptor === void 0\n\t\t? dispatch\n\t\t: dispatch( storeNameOrDescriptor );\n};\n\nexport default useDispatch;\n", "/**\n * WordPress dependencies\n */\nimport { useMemo, useRef } from '@wordpress/element';\nimport { useIsomorphicLayoutEffect } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport useRegistry from '../registry-provider/use-registry';\n\n/**\n * Custom react hook for returning aggregate dispatch actions using the provided\n * dispatchMap.\n *\n * Currently this is an internal api only and is implemented by `withDispatch`\n *\n * @param {Function} dispatchMap Receives the `registry.dispatch` function as\n * the first argument and the `registry` object\n * as the second argument. Should return an\n * object mapping props to functions.\n * @param {Array} deps An array of dependencies for the hook.\n * @return {Object} An object mapping props to functions created by the passed\n * in dispatchMap.\n */\nconst useDispatchWithMap = ( dispatchMap, deps ) => {\n\tconst registry = useRegistry();\n\tconst currentDispatchMapRef = useRef( dispatchMap );\n\n\tuseIsomorphicLayoutEffect( () => {\n\t\tcurrentDispatchMapRef.current = dispatchMap;\n\t} );\n\n\treturn useMemo( () => {\n\t\tconst currentDispatchProps = currentDispatchMapRef.current(\n\t\t\tregistry.dispatch,\n\t\t\tregistry\n\t\t);\n\t\treturn Object.fromEntries(\n\t\t\tObject.entries( currentDispatchProps ).map(\n\t\t\t\t( [ propName, dispatcher ] ) => {\n\t\t\t\t\tif ( typeof dispatcher !== 'function' ) {\n\t\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t\t`Property ${ propName } returned from dispatchMap in useDispatchWithMap must be a function.`\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\treturn [\n\t\t\t\t\t\tpropName,\n\t\t\t\t\t\t( ...args ) =>\n\t\t\t\t\t\t\tcurrentDispatchMapRef\n\t\t\t\t\t\t\t\t.current( registry.dispatch, registry )\n\t\t\t\t\t\t\t\t[ propName ]( ...args ),\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t)\n\t\t);\n\t}, [ registry, ...deps ] );\n};\n\nexport default useDispatchWithMap;\n", "/**\n * WordPress dependencies\n */\nimport { createHigherOrderComponent } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { RegistryConsumer } from '../registry-provider';\n\n/**\n * Higher-order component which renders the original component with the current\n * registry context passed as its `registry` prop.\n *\n * @param {Component} OriginalComponent Original component.\n *\n * @return {Component} Enhanced component.\n */\nconst withRegistry = createHigherOrderComponent(\n\t( OriginalComponent ) => ( props ) => (\n\t\t<RegistryConsumer>\n\t\t\t{ ( registry ) => (\n\t\t\t\t<OriginalComponent { ...props } registry={ registry } />\n\t\t\t) }\n\t\t</RegistryConsumer>\n\t),\n\t'withRegistry'\n);\n\nexport default withRegistry;\n", "/**\n * Internal dependencies\n */\nimport type { AnyConfig, StoreDescriptor, DispatchReturn } from './types';\nimport defaultRegistry from './default-registry';\n\n/**\n * Given a store descriptor, returns an object of the store's action creators.\n * Calling an action creator will cause it to be dispatched, updating the state value accordingly.\n *\n * Note: Action creators returned by the dispatch will return a promise when\n * they are called.\n *\n * @param storeNameOrDescriptor The store descriptor. The legacy calling convention of passing\n * the store name is also supported.\n *\n * @example\n * ```js\n * import { dispatch } from '@wordpress/data';\n * import { store as myCustomStore } from 'my-custom-store';\n *\n * dispatch( myCustomStore ).setPrice( 'hammer', 9.75 );\n * ```\n * @return Object containing the action creators.\n */\nexport function dispatch<\n\tStoreNameOrDescriptor extends StoreDescriptor< AnyConfig > | string,\n>(\n\tstoreNameOrDescriptor: StoreNameOrDescriptor\n): DispatchReturn< StoreNameOrDescriptor > {\n\treturn defaultRegistry.dispatch( storeNameOrDescriptor );\n}\n", "/**\n * Internal dependencies\n */\nimport type { AnyConfig, CurriedSelectorsOf, StoreDescriptor } from './types';\nimport defaultRegistry from './default-registry';\n\n/**\n * Given a store descriptor, returns an object of the store's selectors.\n * The selector functions are been pre-bound to pass the current state automatically.\n * As a consumer, you need only pass arguments of the selector, if applicable.\n *\n *\n * @param storeNameOrDescriptor The store descriptor. The legacy calling convention\n * of passing the store name is also supported.\n *\n * @example\n * ```js\n * import { select } from '@wordpress/data';\n * import { store as myCustomStore } from 'my-custom-store';\n *\n * select( myCustomStore ).getPrice( 'hammer' );\n * ```\n *\n * @return Object containing the store's selectors.\n */\nexport function select< T extends StoreDescriptor< AnyConfig > >(\n\tstoreNameOrDescriptor: string | T\n): CurriedSelectorsOf< T > {\n\treturn defaultRegistry.select( storeNameOrDescriptor );\n}\n", "/**\n * Internal dependencies\n */\nimport defaultRegistryUntyped from './default-registry';\nimport * as plugins from './plugins';\nimport { combineReducers as combineReducersModule } from './redux-store';\n\nimport type {\n\tStoreDescriptor,\n\tReduxStoreConfig,\n\tcombineReducers as CombineReducers,\n\tAnyConfig,\n\tCurriedSelectorsResolveOf,\n} from './types';\n\n// The runtime registry is created from the JavaScript implementation in `registry.js`.\n// Its JSDoc type (`WPDataRegistry`) doesn't include some newer methods like\n// `resolveSelect` or `suspendSelect`, so we widen the type here for the typed\n// exports in this module.\nconst defaultRegistry: any = defaultRegistryUntyped;\n\nexport { default as withSelect } from './components/with-select';\nexport { default as withDispatch } from './components/with-dispatch';\nexport { default as withRegistry } from './components/with-registry';\nexport {\n\tRegistryProvider,\n\tRegistryConsumer,\n\tuseRegistry,\n} from './components/registry-provider';\nexport {\n\tdefault as useSelect,\n\tuseSuspenseSelect,\n} from './components/use-select';\nexport { useDispatch } from './components/use-dispatch';\nexport { AsyncModeProvider } from './components/async-mode-provider';\nexport { createRegistry } from './registry';\nexport { createRegistrySelector, createRegistryControl } from './factory';\nexport { createSelector } from './create-selector';\nexport { controls } from './controls';\nexport { default as createReduxStore } from './redux-store';\nexport { dispatch } from './dispatch';\nexport { select } from './select';\n\nexport type * from './types';\n\n/**\n * Object of available plugins to use with a registry.\n *\n * @see [use](#use)\n */\nexport { plugins };\n\n/**\n * The combineReducers helper function turns an object whose values are different\n * reducing functions into a single reducing function you can pass to registerReducer.\n *\n * @type {import('./types').combineReducers}\n * @param {Object} reducers An object whose values correspond to different reducing\n * functions that need to be combined into one.\n *\n * @example\n * ```js\n * import { combineReducers, createReduxStore, register } from '@wordpress/data';\n *\n * const prices = ( state = {}, action ) => {\n * \treturn action.type === 'SET_PRICE' ?\n * \t\t{\n * \t\t\t...state,\n * \t\t\t[ action.item ]: action.price,\n * \t\t} :\n * \t\tstate;\n * };\n *\n * const discountPercent = ( state = 0, action ) => {\n * \treturn action.type === 'START_SALE' ?\n * \t\taction.discountPercent :\n * \t\tstate;\n * };\n *\n * const store = createReduxStore( 'my-shop', {\n * \treducer: combineReducers( {\n * \t\tprices,\n * \t\tdiscountPercent,\n * \t} ),\n * } );\n * register( store );\n * ```\n *\n * @return {Function} A reducer that invokes every reducer inside the reducers\n * object, and constructs a state object with the same shape.\n */\nexport const combineReducers =\n\tcombineReducersModule as unknown as CombineReducers;\n\n/**\n * Given a store descriptor, returns an object containing the store's selectors\n * pre-bound to state so that you only need to supply additional arguments, and\n * modified so that they return promises that resolve to their eventual values,\n * after any resolvers have ran.\n *\n * @param {StoreDescriptor|string} storeNameOrDescriptor The store descriptor. The legacy calling\n * convention of passing the store name is\n * also supported.\n *\n * @example\n * ```js\n * import { resolveSelect } from '@wordpress/data';\n * import { store as myCustomStore } from 'my-custom-store';\n *\n * resolveSelect( myCustomStore ).getPrice( 'hammer' ).then(console.log)\n * ```\n *\n * @return Object containing the store's promise-wrapped selectors.\n */\nexport function resolveSelect< T extends StoreDescriptor< AnyConfig > >(\n\tstoreNameOrDescriptor: T | string\n): CurriedSelectorsResolveOf< T > {\n\treturn defaultRegistry.resolveSelect( storeNameOrDescriptor );\n}\n\n/**\n * Given a store descriptor, returns an object containing the store's selectors pre-bound to state\n * so that you only need to supply additional arguments, and modified so that they throw promises\n * in case the selector is not resolved yet.\n *\n * @param {StoreDescriptor|string} storeNameOrDescriptor The store descriptor. The legacy calling\n * convention of passing the store name is\n * also supported.\n *\n * @return {Object} Object containing the store's suspense-wrapped selectors.\n */\nexport const suspendSelect = (\n\tstoreNameOrDescriptor:\n\t\t| string\n\t\t| StoreDescriptor< ReduxStoreConfig< any, any, any > >\n): any => defaultRegistry.suspendSelect( storeNameOrDescriptor );\n\n/**\n * Given a listener function, the function will be called any time the state value\n * of one of the registered stores has changed. If you specify the optional\n * `storeNameOrDescriptor` parameter, the listener function will be called only\n * on updates on that one specific registered store.\n *\n * This function returns an `unsubscribe` function used to stop the subscription.\n *\n * @param {Function} listener Callback function.\n * @param {string|StoreDescriptor?} storeNameOrDescriptor Optional store name.\n *\n * @example\n * ```js\n * import { subscribe } from '@wordpress/data';\n *\n * const unsubscribe = subscribe( () => {\n * \t// You could use this opportunity to test whether the derived result of a\n * \t// selector has subsequently changed as the result of a state update.\n * } );\n *\n * // Later, if necessary...\n * unsubscribe();\n * ```\n */\nexport const subscribe = (\n\tlistener: () => void,\n\tstoreNameOrDescriptor?:\n\t\t| string\n\t\t| StoreDescriptor< ReduxStoreConfig< any, any, any > >\n): ( () => void ) =>\n\tdefaultRegistry.subscribe( listener, storeNameOrDescriptor );\n\n/**\n * Registers a generic store instance.\n *\n * @deprecated Use `register( storeDescriptor )` instead.\n *\n * @param {string} name Store registry name.\n * @param {Object} store Store instance (`{ getSelectors, getActions, subscribe }`).\n */\nexport const registerGenericStore: Function =\n\tdefaultRegistry.registerGenericStore;\n\n/**\n * Registers a standard `@wordpress/data` store.\n *\n * @deprecated Use `register` instead.\n *\n * @param {string} storeName Unique namespace identifier for the store.\n * @param {Object} options Store description (reducer, actions, selectors, resolvers).\n *\n * @return {Object} Registered store object.\n */\nexport const registerStore: Function = defaultRegistry.registerStore;\n\n/**\n * Extends a registry to inherit functionality provided by a given plugin. A\n * plugin is an object with properties aligning to that of a registry, merged\n * to extend the default registry behavior.\n *\n * @param {Object} plugin Plugin object.\n */\nexport const use: any = defaultRegistry.use;\n\n/**\n * Registers a standard `@wordpress/data` store descriptor.\n *\n * @example\n * ```js\n * import { createReduxStore, register } from '@wordpress/data';\n *\n * const store = createReduxStore( 'demo', {\n * reducer: ( state = 'OK' ) => state,\n * selectors: {\n * getValue: ( state ) => state,\n * },\n * } );\n * register( store );\n * ```\n *\n * @param {StoreDescriptor} store Store descriptor.\n */\nexport const register = (\n\tstore: StoreDescriptor< ReduxStoreConfig< any, any, any > >\n): void => defaultRegistry.register( store );\n"],
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,aAAO,UAAU,OAAO,GAAG;AAAA;AAAA;;;ACA3B;AAAA;AAAA;AAEA,eAAS,QAAQ,KAAK;AACpB,YAAI,OAAO,WAAW,cAAc,OAAO,OAAO,aAAa,UAAU;AACvE,oBAAU,SAAUA,MAAK;AACvB,mBAAO,OAAOA;AAAA,UAChB;AAAA,QACF,OAAO;AACL,oBAAU,SAAUA,MAAK;AACvB,mBAAOA,QAAO,OAAO,WAAW,cAAcA,KAAI,gBAAgB,UAAUA,SAAQ,OAAO,YAAY,WAAW,OAAOA;AAAA,UAC3H;AAAA,QACF;AAEA,eAAO,QAAQ,GAAG;AAAA,MACpB;AAEA,eAAS,gBAAgB,UAAU,aAAa;AAC9C,YAAI,EAAE,oBAAoB,cAAc;AACtC,gBAAM,IAAI,UAAU,mCAAmC;AAAA,QACzD;AAAA,MACF;AAEA,eAAS,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,MAAO,wBAAQ;;;ACJR,WAASC,UAGf,uBAC0C;AAC1C,WAAO,yBAAgB,SAAU,qBAAsB;EACxD;;;ACNO,WAASC,QACf,uBAC0B;AAC1B,WAAO,yBAAgB,OAAQ,qBAAsB;EACtD;;;ACVA,MAAM,kBAAuB;AAwEtB,MAAMC,mBACZ;AAsBM,WAASC,eACf,uBACiC;AACjC,WAAO,gBAAgB,cAAe,qBAAsB;EAC7D;AAaO,MAAM,gBAAgB,CAC5B,0BAGS,gBAAgB,cAAe,qBAAsB;AA0BxD,MAAM,YAAY,CACxB,UACA,0BAIA,gBAAgB,UAAW,UAAU,qBAAsB;AAUrD,MAAM,uBACZ,gBAAgB;AAYV,MAAM,gBAA0B,gBAAgB;AAShD,MAAM,MAAW,gBAAgB;AAoBjC,MAAM,WAAW,CACvB,UACU,gBAAgB,SAAU,KAAM;",
"names": ["obj", "EquivalentKeyMap", "isMergeableObject", "deepmerge", "import_deprecated", "subscribe", "dispatch", "createStore", "dispatch", "import_equivalent_key_map", "EquivalentKeyMap", "deprecated", "EquivalentKeyMap", "subscribe", "controls", "createReduxRoutineMiddleware", "result", "subscribe", "select", "resolveSelect", "suspendSelect", "dispatch", "createStore", "register", "registerGenericStore", "deprecated", "registerStore", "use", "isObject", "isPlainObject", "storage", "storage", "combineReducers", "isPlainObject", "deepmerge", "import_compose", "import_element", "import_element", "import_element", "import_element", "Context", "Consumer", "Provider", "context_default", "Provider", "Context", "select", "subscribe", "select", "import_compose", "dispatch", "import_element", "import_compose", "import_jsx_runtime", "dispatch", "import_compose", "import_jsx_runtime", "dispatch", "select", "combineReducers", "resolveSelect"]
}