: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* Higher-order component which renders the original component with the current
* registry context passed as its `registry` prop.
* @param {Component} OriginalComponent Original component.
* @return {Component} Enhanced component.
const withRegistry = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(OriginalComponent => props => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RegistryConsumer, {
children: registry => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(OriginalComponent, {
/* harmony default export */ const with_registry = (withRegistry);
;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/use-dispatch/use-dispatch.js
* @typedef {import('../../types').StoreDescriptor<StoreConfig>} StoreDescriptor
* @template {import('../../types').AnyConfig} StoreConfig
* @typedef {import('../../types').UseDispatchReturn<StoreNameOrDescriptor>} UseDispatchReturn
* @template StoreNameOrDescriptor
* A custom react hook returning the current registry dispatch actions creators.
* Note: The component using this hook must be within the context of a
* @template {undefined | string | StoreDescriptor<any>} StoreNameOrDescriptor
* @param {StoreNameOrDescriptor} [storeNameOrDescriptor] Optionally provide the name of the
* store or its descriptor from which to
* retrieve action creators. If not
* provided, the registry.dispatch
* function is returned instead.
* This illustrates a pattern where you may need to retrieve dynamic data from
* the server via the `useSelect` hook to use in combination with the dispatch
* import { useCallback } from 'react';
* import { useDispatch, useSelect } from '@wordpress/data';
* import { store as myCustomStore } from 'my-custom-store';
* function Button( { onClick, children } ) {
* return <button type="button" onClick={ onClick }>{ children }</button>
* const SaleButton = ( { children } ) => {
* const { stockNumber } = useSelect(
* ( select ) => select( myCustomStore ).getStockNumber(),
* const { startSale } = useDispatch( myCustomStore );
* const onClick = useCallback( () => {
* const discountPercent = stockNumber > 50 ? 10: 20;
* startSale( discountPercent );
* return <Button onClick={ onClick }>{ children }</Button>
* // Rendered somewhere in the application:
* // <SaleButton>Start Sale!</SaleButton>
* @return {UseDispatchReturn<StoreNameOrDescriptor>} A custom react hook.
const useDispatch = storeNameOrDescriptor => {
return storeNameOrDescriptor === void 0 ? dispatch : dispatch(storeNameOrDescriptor);
/* harmony default export */ const use_dispatch = (useDispatch);
;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/dispatch.js
* Given a store descriptor, returns an object of the store's action creators.
* Calling an action creator will cause it to be dispatched, updating the state value accordingly.
* Note: Action creators returned by the dispatch will return a promise when
* @param storeNameOrDescriptor The store descriptor. The legacy calling convention of passing
* the store name is also supported.
* import { dispatch } from '@wordpress/data';
* import { store as myCustomStore } from 'my-custom-store';
* dispatch( myCustomStore ).setPrice( 'hammer', 9.75 );
* @return Object containing the action creators.
function dispatch_dispatch(storeNameOrDescriptor) {
return default_registry.dispatch(storeNameOrDescriptor);
;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/select.js
* Given a store descriptor, returns an object of the store's selectors.
* The selector functions are been pre-bound to pass the current state automatically.
* As a consumer, you need only pass arguments of the selector, if applicable.
* @param storeNameOrDescriptor The store descriptor. The legacy calling convention
* of passing the store name is also supported.
* import { select } from '@wordpress/data';
* import { store as myCustomStore } from 'my-custom-store';
* select( myCustomStore ).getPrice( 'hammer' );
* @return Object containing the store's selectors.
function select_select(storeNameOrDescriptor) {
return default_registry.select(storeNameOrDescriptor);
;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/index.js
/** @typedef {import('./types').StoreDescriptor} StoreDescriptor */
* Object of available plugins to use with a registry.
* The combineReducers helper function turns an object whose values are different
* reducing functions into a single reducing function you can pass to registerReducer.
* @type {import('./types').combineReducers}
* @param {Object} reducers An object whose values correspond to different reducing
* functions that need to be combined into one.
* import { combineReducers, createReduxStore, register } from '@wordpress/data';
* const prices = ( state = {}, action ) => {
* return action.type === 'SET_PRICE' ?
* [ action.item ]: action.price,
* const discountPercent = ( state = 0, action ) => {
* return action.type === 'START_SALE' ?
* action.discountPercent :
* const store = createReduxStore( 'my-shop', {
* reducer: combineReducers( {
* @return {Function} A reducer that invokes every reducer inside the reducers
* object, and constructs a state object with the same shape.
const build_module_combineReducers = combine_reducers_combineReducers;
* Given a store descriptor, returns an object containing the store's selectors pre-bound to state
* so that you only need to supply additional arguments, and modified so that they return promises
* that resolve to their eventual values, after any resolvers have ran.
* @param {StoreDescriptor|string} storeNameOrDescriptor The store descriptor. The legacy calling
* convention of passing the store name is
* import { resolveSelect } from '@wordpress/data';
* import { store as myCustomStore } from 'my-custom-store';
* resolveSelect( myCustomStore ).getPrice( 'hammer' ).then(console.log)
* @return {Object} Object containing the store's promise-wrapped selectors.
const build_module_resolveSelect = default_registry.resolveSelect;
* Given a store descriptor, returns an object containing the store's selectors pre-bound to state
* so that you only need to supply additional arguments, and modified so that they throw promises
* in case the selector is not resolved yet.
* @param {StoreDescriptor|string} storeNameOrDescriptor The store descriptor. The legacy calling
* convention of passing the store name is
* @return {Object} Object containing the store's suspense-wrapped selectors.
const suspendSelect = default_registry.suspendSelect;
* Given a listener function, the function will be called any time the state value
* of one of the registered stores has changed. If you specify the optional
* `storeNameOrDescriptor` parameter, the listener function will be called only
* on updates on that one specific registered store.
* This function returns an `unsubscribe` function used to stop the subscription.
* @param {Function} listener Callback function.
* @param {string|StoreDescriptor?} storeNameOrDescriptor Optional store name.
* import { subscribe } from '@wordpress/data';
* const unsubscribe = subscribe( () => {
* // You could use this opportunity to test whether the derived result of a
* // selector has subsequently changed as the result of a state update.
* // Later, if necessary...
const subscribe = default_registry.subscribe;
* Registers a generic store instance.
* @deprecated Use `register( storeDescriptor )` instead.
* @param {string} name Store registry name.
* @param {Object} store Store instance (`{ getSelectors, getActions, subscribe }`).
const registerGenericStore = default_registry.registerGenericStore;
* Registers a standard `@wordpress/data` store.
* @deprecated Use `register` instead.
* @param {string} storeName Unique namespace identifier for the store.
* @param {Object} options Store description (reducer, actions, selectors, resolvers).
* @return {Object} Registered store object.
const registerStore = default_registry.registerStore;
* Extends a registry to inherit functionality provided by a given plugin. A
* plugin is an object with properties aligning to that of a registry, merged
* to extend the default registry behavior.
* @param {Object} plugin Plugin object.
const use = default_registry.use;
* Registers a standard `@wordpress/data` store descriptor.
* import { createReduxStore, register } from '@wordpress/data';
* const store = createReduxStore( 'demo', {
* reducer: ( state = 'OK' ) => state,
* getValue: ( state ) => state,
* @param {StoreDescriptor} store Store descriptor.
const register = default_registry.register;
(window.wp = window.wp || {}).data = __webpack_exports__;