2024-04-17 11:32:24 +02:00
/******/ ( ( ) => { // webpackBootstrap
/******/ "use strict" ;
2022-06-16 14:03:35 +02:00
/******/ var _ _webpack _modules _ _ = ( {
2021-07-23 11:58:50 +02:00
2024-04-17 11:32:24 +02:00
/***/ 66 :
/***/ ( ( module ) => {
2023-09-26 10:33:34 +02:00
var isMergeableObject = function isMergeableObject ( value ) {
return isNonNullObject ( value )
&& ! isSpecial ( value )
} ;
function isNonNullObject ( value ) {
return ! ! value && typeof value === 'object'
}
function isSpecial ( value ) {
var stringValue = Object . prototype . toString . call ( value ) ;
return stringValue === '[object RegExp]'
|| stringValue === '[object Date]'
|| isReactElement ( value )
}
// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25
var canUseSymbol = typeof Symbol === 'function' && Symbol . for ;
var REACT _ELEMENT _TYPE = canUseSymbol ? Symbol . for ( 'react.element' ) : 0xeac7 ;
function isReactElement ( value ) {
return value . $$typeof === REACT _ELEMENT _TYPE
}
function emptyTarget ( val ) {
return Array . isArray ( val ) ? [ ] : { }
}
function cloneUnlessOtherwiseSpecified ( value , options ) {
return ( options . clone !== false && options . isMergeableObject ( value ) )
? deepmerge ( emptyTarget ( value ) , value , options )
: value
}
function defaultArrayMerge ( target , source , options ) {
return target . concat ( source ) . map ( function ( element ) {
return cloneUnlessOtherwiseSpecified ( element , options )
} )
}
function getMergeFunction ( key , options ) {
if ( ! options . customMerge ) {
return deepmerge
}
var customMerge = options . customMerge ( key ) ;
return typeof customMerge === 'function' ? customMerge : deepmerge
}
function getEnumerableOwnPropertySymbols ( target ) {
return Object . getOwnPropertySymbols
? Object . getOwnPropertySymbols ( target ) . filter ( function ( symbol ) {
return Object . propertyIsEnumerable . call ( target , symbol )
} )
: [ ]
}
function getKeys ( target ) {
return Object . keys ( target ) . concat ( getEnumerableOwnPropertySymbols ( target ) )
}
function propertyIsOnObject ( object , property ) {
try {
return property in object
} catch ( _ ) {
return false
}
}
// Protects from prototype poisoning and unexpected merging up the prototype chain.
function propertyIsUnsafe ( target , key ) {
return propertyIsOnObject ( target , key ) // Properties are safe to merge if they don't exist in the target yet,
&& ! ( Object . hasOwnProperty . call ( target , key ) // unsafe if they exist up the prototype chain,
&& Object . propertyIsEnumerable . call ( target , key ) ) // and also unsafe if they're nonenumerable.
}
function mergeObject ( target , source , options ) {
var destination = { } ;
if ( options . isMergeableObject ( target ) ) {
getKeys ( target ) . forEach ( function ( key ) {
destination [ key ] = cloneUnlessOtherwiseSpecified ( target [ key ] , options ) ;
} ) ;
}
getKeys ( source ) . forEach ( function ( key ) {
if ( propertyIsUnsafe ( target , key ) ) {
return
}
if ( propertyIsOnObject ( target , key ) && options . isMergeableObject ( source [ key ] ) ) {
destination [ key ] = getMergeFunction ( key , options ) ( target [ key ] , source [ key ] , options ) ;
} else {
destination [ key ] = cloneUnlessOtherwiseSpecified ( source [ key ] , options ) ;
}
} ) ;
return destination
}
function deepmerge ( target , source , options ) {
options = options || { } ;
options . arrayMerge = options . arrayMerge || defaultArrayMerge ;
options . isMergeableObject = options . isMergeableObject || isMergeableObject ;
// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()
// implementations can use it. The caller may not replace it.
options . cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified ;
var sourceIsArray = Array . isArray ( source ) ;
var targetIsArray = Array . isArray ( target ) ;
var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray ;
if ( ! sourceAndTargetTypesMatch ) {
return cloneUnlessOtherwiseSpecified ( source , options )
} else if ( sourceIsArray ) {
return options . arrayMerge ( target , source , options )
} else {
return mergeObject ( target , source , options )
}
}
deepmerge . all = function deepmergeAll ( array , options ) {
if ( ! Array . isArray ( array ) ) {
throw new Error ( 'first argument should be an array' )
}
return array . reduce ( function ( prev , next ) {
return deepmerge ( prev , next , options )
} , { } )
} ;
var deepmerge _1 = deepmerge ;
module . exports = deepmerge _1 ;
/***/ } ) ,
2024-04-17 11:32:24 +02:00
/***/ 3249 :
/***/ ( ( module ) => {
2019-11-02 10:38:58 +01:00
2019-11-15 22:59:44 +01:00
2020-05-06 17:23:38 +02:00
2020-09-15 14:29:22 +02:00
function _typeof ( obj ) {
if ( typeof Symbol === "function" && typeof Symbol . iterator === "symbol" ) {
_typeof = function ( obj ) {
return typeof obj ;
} ;
} else {
_typeof = function ( obj ) {
return obj && typeof Symbol === "function" && obj . constructor === Symbol && obj !== Symbol . prototype ? "symbol" : typeof obj ;
} ;
}
2020-05-06 17:23:38 +02:00
2020-09-15 14:29:22 +02:00
return _typeof ( obj ) ;
2020-05-06 17:23:38 +02:00
}
2020-09-15 14:29:22 +02:00
function _classCallCheck ( instance , Constructor ) {
if ( ! ( instance instanceof Constructor ) ) {
throw new TypeError ( "Cannot call a class as a function" ) ;
}
}
2020-05-06 17:23:38 +02:00
2020-09-15 14:29:22 +02:00
function _defineProperties ( target , props ) {
for ( var i = 0 ; i < props . length ; i ++ ) {
var descriptor = props [ i ] ;
descriptor . enumerable = descriptor . enumerable || false ;
descriptor . configurable = true ;
if ( "value" in descriptor ) descriptor . writable = true ;
Object . defineProperty ( target , descriptor . key , descriptor ) ;
}
2019-11-02 10:38:58 +01:00
}
2020-09-15 14:29:22 +02:00
function _createClass ( Constructor , protoProps , staticProps ) {
if ( protoProps ) _defineProperties ( Constructor . prototype , protoProps ) ;
if ( staticProps ) _defineProperties ( Constructor , staticProps ) ;
return Constructor ;
}
2020-05-06 17:23:38 +02:00
2020-09-15 14:29:22 +02:00
/ * *
* Given an instance of EquivalentKeyMap , returns its internal value pair tuple
* for a key , if one exists . The tuple members consist of the last reference
* value for the key ( used in efficient subsequent lookups ) and the value
* assigned for the key at the leaf node .
*
* @ param { EquivalentKeyMap } instance EquivalentKeyMap instance .
* @ param { * } key The key for which to return value pair .
*
* @ return { ? Array } Value pair , if exists .
* /
function getValuePair ( instance , key ) {
var _map = instance . _map ,
_arrayTreeMap = instance . _arrayTreeMap ,
_objectTreeMap = instance . _objectTreeMap ; // Map keeps a reference to the last object-like key used to set the
// value, which can be used to shortcut immediately to the value.
2019-11-02 10:38:58 +01:00
2020-09-15 14:29:22 +02:00
if ( _map . has ( key ) ) {
return _map . get ( key ) ;
} // Sort keys to ensure stable retrieval from tree.
2019-11-02 10:38:58 +01:00
2020-09-15 14:29:22 +02:00
var properties = Object . keys ( key ) . sort ( ) ; // Tree by type to avoid conflicts on numeric object keys, empty value.
2019-11-02 10:38:58 +01:00
2020-09-15 14:29:22 +02:00
var map = Array . isArray ( key ) ? _arrayTreeMap : _objectTreeMap ;
2019-11-02 10:38:58 +01:00
2020-09-15 14:29:22 +02:00
for ( var i = 0 ; i < properties . length ; i ++ ) {
var property = properties [ i ] ;
map = map . get ( property ) ;
2019-11-02 10:38:58 +01:00
2020-09-15 14:29:22 +02:00
if ( map === undefined ) {
return ;
}
2019-11-02 10:38:58 +01:00
2020-09-15 14:29:22 +02:00
var propertyValue = key [ property ] ;
map = map . get ( propertyValue ) ;
2019-11-02 10:38:58 +01:00
2020-09-15 14:29:22 +02:00
if ( map === undefined ) {
return ;
}
}
2019-11-02 10:38:58 +01:00
2020-09-15 14:29:22 +02:00
var valuePair = map . get ( '_ekm_value' ) ;
2019-11-02 10:38:58 +01:00
2020-09-15 14:29:22 +02:00
if ( ! valuePair ) {
return ;
} // If reached, it implies that an object-like key was set with another
// reference, so delete the reference and replace with the current.
2019-11-02 10:38:58 +01:00
2020-09-15 14:29:22 +02:00
_map . delete ( valuePair [ 0 ] ) ;
2019-11-02 10:38:58 +01:00
2020-09-15 14:29:22 +02:00
valuePair [ 0 ] = key ;
map . set ( '_ekm_value' , valuePair ) ;
2019-11-02 10:38:58 +01:00
2020-09-15 14:29:22 +02:00
_map . set ( key , valuePair ) ;
2019-11-02 10:38:58 +01:00
2020-09-15 14:29:22 +02:00
return valuePair ;
}
/ * *
* Variant of a Map object which enables lookup by equivalent ( deeply equal )
* object and array keys .
* /
2020-05-06 17:23:38 +02:00
2020-09-15 14:29:22 +02:00
var EquivalentKeyMap =
/*#__PURE__*/
function ( ) {
/ * *
* Constructs a new instance of EquivalentKeyMap .
*
* @ param { Iterable . < * > } iterable Initial pair of key , value for map .
* /
function EquivalentKeyMap ( iterable ) {
_classCallCheck ( this , EquivalentKeyMap ) ;
2020-05-06 17:23:38 +02:00
2020-09-15 14:29:22 +02:00
this . clear ( ) ;
2020-05-06 17:23:38 +02:00
2020-09-15 14:29:22 +02:00
if ( iterable instanceof EquivalentKeyMap ) {
// Map#forEach is only means of iterating with support for IE11.
var iterablePairs = [ ] ;
iterable . forEach ( function ( value , key ) {
iterablePairs . push ( [ key , value ] ) ;
} ) ;
iterable = iterablePairs ;
}
2020-05-06 17:23:38 +02:00
2020-09-15 14:29:22 +02:00
if ( iterable != null ) {
for ( var i = 0 ; i < iterable . length ; i ++ ) {
this . set ( iterable [ i ] [ 0 ] , iterable [ i ] [ 1 ] ) ;
}
}
}
/ * *
* Accessor property returning the number of elements .
*
* @ return { number } Number of elements .
* /
2020-05-06 17:23:38 +02:00
2020-09-15 14:29:22 +02:00
_createClass ( EquivalentKeyMap , [ {
key : "set" ,
2020-05-06 17:23:38 +02:00
2020-09-15 14:29:22 +02:00
/ * *
* Add or update an element with a specified key and value .
*
* @ param { * } key The key of the element to add .
* @ param { * } value The value of the element to add .
*
* @ return { EquivalentKeyMap } Map instance .
* /
value : function set ( key , value ) {
// Shortcut non-object-like to set on internal Map.
if ( key === null || _typeof ( key ) !== 'object' ) {
this . _map . set ( key , value ) ;
2020-05-06 17:23:38 +02:00
2020-09-15 14:29:22 +02:00
return this ;
} // Sort keys to ensure stable assignment into tree.
2020-05-06 17:23:38 +02:00
2020-09-15 14:29:22 +02:00
var properties = Object . keys ( key ) . sort ( ) ;
var valuePair = [ key , value ] ; // Tree by type to avoid conflicts on numeric object keys, empty value.
2020-05-06 17:23:38 +02:00
2020-09-15 14:29:22 +02:00
var map = Array . isArray ( key ) ? this . _arrayTreeMap : this . _objectTreeMap ;
2019-11-02 10:38:58 +01:00
2020-09-15 14:29:22 +02:00
for ( var i = 0 ; i < properties . length ; i ++ ) {
var property = properties [ i ] ;
2019-11-02 10:38:58 +01:00
2020-09-15 14:29:22 +02:00
if ( ! map . has ( property ) ) {
map . set ( property , new EquivalentKeyMap ( ) ) ;
}
2019-11-02 10:38:58 +01:00
2020-09-15 14:29:22 +02:00
map = map . get ( property ) ;
var propertyValue = key [ property ] ;
2019-11-02 10:38:58 +01:00
2020-09-15 14:29:22 +02:00
if ( ! map . has ( propertyValue ) ) {
map . set ( propertyValue , new EquivalentKeyMap ( ) ) ;
}
2019-11-02 10:38:58 +01:00
2020-09-15 14:29:22 +02:00
map = map . get ( propertyValue ) ;
} // If an _ekm_value exists, there was already an equivalent key. Before
// overriding, ensure that the old key reference is removed from map to
// avoid memory leak of accumulating equivalent keys. This is, in a
// sense, a poor man's WeakMap, while still enabling iterability.
2019-11-02 10:38:58 +01:00
2020-05-06 17:23:38 +02:00
2020-09-15 14:29:22 +02:00
var previousValuePair = map . get ( '_ekm_value' ) ;
2020-05-06 17:23:38 +02:00
2020-09-15 14:29:22 +02:00
if ( previousValuePair ) {
this . _map . delete ( previousValuePair [ 0 ] ) ;
}
2020-05-06 17:23:38 +02:00
2020-09-15 14:29:22 +02:00
map . set ( '_ekm_value' , valuePair ) ;
2019-11-02 10:38:58 +01:00
2020-09-15 14:29:22 +02:00
this . _map . set ( key , valuePair ) ;
2019-11-02 10:38:58 +01:00
2020-09-15 14:29:22 +02:00
return this ;
}
/ * *
* Returns a specified element .
*
* @ param { * } key The key of the element to return .
*
* @ return { ? * } The element associated with the specified key or undefined
* if the key can ' t be found .
* /
} , {
key : "get" ,
value : function get ( key ) {
// Shortcut non-object-like to get from internal Map.
if ( key === null || _typeof ( key ) !== 'object' ) {
return this . _map . get ( key ) ;
}
var valuePair = getValuePair ( this , key ) ;
if ( valuePair ) {
return valuePair [ 1 ] ;
}
}
/ * *
* Returns a boolean indicating whether an element with the specified key
* exists or not .
*
* @ param { * } key The key of the element to test for presence .
*
* @ return { boolean } Whether an element with the specified key exists .
* /
} , {
key : "has" ,
value : function has ( key ) {
if ( key === null || _typeof ( key ) !== 'object' ) {
return this . _map . has ( key ) ;
} // Test on the _presence_ of the pair, not its value, as even undefined
// can be a valid member value for a key.
return getValuePair ( this , key ) !== undefined ;
}
/ * *
* Removes the specified element .
*
* @ param { * } key The key of the element to remove .
*
* @ return { boolean } Returns true if an element existed and has been
* removed , or false if the element does not exist .
* /
} , {
key : "delete" ,
value : function _delete ( key ) {
if ( ! this . has ( key ) ) {
return false ;
} // This naive implementation will leave orphaned child trees. A better
// implementation should traverse and remove orphans.
this . set ( key , undefined ) ;
return true ;
}
/ * *
* Executes a provided function once per each key / value pair , in insertion
* order .
*
* @ param { Function } callback Function to execute for each element .
* @ param { * } thisArg Value to use as ` this ` when executing
* ` callback ` .
* /
} , {
key : "forEach" ,
value : function forEach ( callback ) {
var _this = this ;
var thisArg = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : this ;
this . _map . forEach ( function ( value , key ) {
// Unwrap value from object-like value pair.
if ( key !== null && _typeof ( key ) === 'object' ) {
value = value [ 1 ] ;
}
callback . call ( thisArg , value , key , _this ) ;
} ) ;
}
/ * *
* Removes all elements .
* /
} , {
key : "clear" ,
value : function clear ( ) {
this . _map = new Map ( ) ;
this . _arrayTreeMap = new Map ( ) ;
this . _objectTreeMap = new Map ( ) ;
}
} , {
key : "size" ,
get : function get ( ) {
return this . _map . size ;
}
} ] ) ;
return EquivalentKeyMap ;
} ( ) ;
module . exports = EquivalentKeyMap ;
2022-06-16 14:03:35 +02:00
/***/ } )
2019-11-15 22:59:44 +01:00
2022-06-16 14:03:35 +02:00
/******/ } ) ;
/************************************************************************/
/******/ // The module cache
/******/ var _ _webpack _module _cache _ _ = { } ;
/******/
/******/ // The require function
/******/ function _ _webpack _require _ _ ( moduleId ) {
/******/ // Check if module is in cache
/******/ var cachedModule = _ _webpack _module _cache _ _ [ moduleId ] ;
/******/ if ( cachedModule !== undefined ) {
/******/ return cachedModule . exports ;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = _ _webpack _module _cache _ _ [ moduleId ] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports : { }
/******/ } ;
/******/
/******/ // Execute the module function
/******/ _ _webpack _modules _ _ [ moduleId ] ( module , module . exports , _ _webpack _require _ _ ) ;
/******/
/******/ // Return the exports of the module
/******/ return module . exports ;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/compat get default export */
2024-04-17 11:32:24 +02:00
/******/ ( ( ) => {
2022-06-16 14:03:35 +02:00
/******/ // getDefaultExport function for compatibility with non-harmony modules
2024-04-17 11:32:24 +02:00
/******/ _ _webpack _require _ _ . n = ( module ) => {
2022-06-16 14:03:35 +02:00
/******/ var getter = module && module . _ _esModule ?
2024-04-17 11:32:24 +02:00
/******/ ( ) => ( module [ 'default' ] ) :
/******/ ( ) => ( module ) ;
2022-06-16 14:03:35 +02:00
/******/ _ _webpack _require _ _ . d ( getter , { a : getter } ) ;
/******/ return getter ;
/******/ } ;
2024-04-17 11:32:24 +02:00
/******/ } ) ( ) ;
2022-06-16 14:03:35 +02:00
/******/
/******/ /* webpack/runtime/define property getters */
2024-04-17 11:32:24 +02:00
/******/ ( ( ) => {
2022-06-16 14:03:35 +02:00
/******/ // define getter functions for harmony exports
2024-04-17 11:32:24 +02:00
/******/ _ _webpack _require _ _ . d = ( exports , definition ) => {
2022-06-16 14:03:35 +02:00
/******/ for ( var key in definition ) {
/******/ if ( _ _webpack _require _ _ . o ( definition , key ) && ! _ _webpack _require _ _ . o ( exports , key ) ) {
/******/ Object . defineProperty ( exports , key , { enumerable : true , get : definition [ key ] } ) ;
/******/ }
/******/ }
/******/ } ;
2024-04-17 11:32:24 +02:00
/******/ } ) ( ) ;
2022-06-16 14:03:35 +02:00
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
2024-04-17 11:32:24 +02:00
/******/ ( ( ) => {
/******/ _ _webpack _require _ _ . o = ( obj , prop ) => ( Object . prototype . hasOwnProperty . call ( obj , prop ) )
/******/ } ) ( ) ;
2022-06-16 14:03:35 +02:00
/******/
/******/ /* webpack/runtime/make namespace object */
2024-04-17 11:32:24 +02:00
/******/ ( ( ) => {
2022-06-16 14:03:35 +02:00
/******/ // define __esModule on exports
2024-04-17 11:32:24 +02:00
/******/ _ _webpack _require _ _ . r = ( exports ) => {
2022-06-16 14:03:35 +02:00
/******/ if ( typeof Symbol !== 'undefined' && Symbol . toStringTag ) {
/******/ Object . defineProperty ( exports , Symbol . toStringTag , { value : 'Module' } ) ;
/******/ }
/******/ Object . defineProperty ( exports , '__esModule' , { value : true } ) ;
/******/ } ;
2024-04-17 11:32:24 +02:00
/******/ } ) ( ) ;
2022-06-16 14:03:35 +02:00
/******/
/************************************************************************/
var _ _webpack _exports _ _ = { } ;
2020-09-15 14:29:22 +02:00
// ESM COMPAT FLAG
2019-11-15 22:59:44 +01:00
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
2020-09-15 14:29:22 +02:00
// EXPORTS
2022-06-16 14:03:35 +02:00
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , {
2025-12-12 13:15:55 +01:00
AsyncModeProvider : ( ) => ( /* reexport */ context _context _default ) ,
2024-04-17 11:32:24 +02:00
RegistryConsumer : ( ) => ( /* reexport */ RegistryConsumer ) ,
2025-12-12 13:15:55 +01:00
RegistryProvider : ( ) => ( /* reexport */ context _default ) ,
2024-04-17 11:32:24 +02:00
combineReducers : ( ) => ( /* binding */ build _module _combineReducers ) ,
controls : ( ) => ( /* reexport */ controls ) ,
createReduxStore : ( ) => ( /* reexport */ createReduxStore ) ,
createRegistry : ( ) => ( /* reexport */ createRegistry ) ,
createRegistryControl : ( ) => ( /* reexport */ createRegistryControl ) ,
createRegistrySelector : ( ) => ( /* reexport */ createRegistrySelector ) ,
2025-02-28 08:42:11 +01:00
createSelector : ( ) => ( /* reexport */ rememo ) ,
2024-04-17 11:32:24 +02:00
dispatch : ( ) => ( /* reexport */ dispatch _dispatch ) ,
plugins : ( ) => ( /* reexport */ plugins _namespaceObject ) ,
register : ( ) => ( /* binding */ register ) ,
registerGenericStore : ( ) => ( /* binding */ registerGenericStore ) ,
registerStore : ( ) => ( /* binding */ registerStore ) ,
resolveSelect : ( ) => ( /* binding */ build _module _resolveSelect ) ,
select : ( ) => ( /* reexport */ select _select ) ,
subscribe : ( ) => ( /* binding */ subscribe ) ,
suspendSelect : ( ) => ( /* binding */ suspendSelect ) ,
use : ( ) => ( /* binding */ use ) ,
2025-12-12 13:15:55 +01:00
useDispatch : ( ) => ( /* reexport */ use _dispatch _default ) ,
2024-04-17 11:32:24 +02:00
useRegistry : ( ) => ( /* reexport */ useRegistry ) ,
useSelect : ( ) => ( /* reexport */ useSelect ) ,
useSuspenseSelect : ( ) => ( /* reexport */ useSuspenseSelect ) ,
2025-12-12 13:15:55 +01:00
withDispatch : ( ) => ( /* reexport */ with _dispatch _default ) ,
withRegistry : ( ) => ( /* reexport */ with _registry _default ) ,
withSelect : ( ) => ( /* reexport */ with _select _default )
2022-06-16 14:03:35 +02:00
} ) ;
2020-09-15 14:29:22 +02:00
2021-04-27 08:32:47 +02:00
// NAMESPACE OBJECT: ./node_modules/@wordpress/data/build-module/redux-store/metadata/selectors.js
2019-11-15 22:59:44 +01:00
var selectors _namespaceObject = { } ;
_ _webpack _require _ _ . r ( selectors _namespaceObject ) ;
2022-06-16 14:03:35 +02:00
_ _webpack _require _ _ . d ( selectors _namespaceObject , {
2024-04-17 11:32:24 +02:00
countSelectorsByStatus : ( ) => ( countSelectorsByStatus ) ,
getCachedResolvers : ( ) => ( getCachedResolvers ) ,
getIsResolving : ( ) => ( getIsResolving ) ,
getResolutionError : ( ) => ( getResolutionError ) ,
getResolutionState : ( ) => ( getResolutionState ) ,
hasFinishedResolution : ( ) => ( hasFinishedResolution ) ,
hasResolutionFailed : ( ) => ( hasResolutionFailed ) ,
hasResolvingSelectors : ( ) => ( hasResolvingSelectors ) ,
hasStartedResolution : ( ) => ( hasStartedResolution ) ,
isResolving : ( ) => ( isResolving )
2022-06-16 14:03:35 +02:00
} ) ;
2020-09-15 14:29:22 +02:00
2021-04-27 08:32:47 +02:00
// NAMESPACE OBJECT: ./node_modules/@wordpress/data/build-module/redux-store/metadata/actions.js
2019-11-02 10:38:58 +01:00
var actions _namespaceObject = { } ;
_ _webpack _require _ _ . r ( actions _namespaceObject ) ;
2022-06-16 14:03:35 +02:00
_ _webpack _require _ _ . d ( actions _namespaceObject , {
2024-04-17 11:32:24 +02:00
failResolution : ( ) => ( failResolution ) ,
failResolutions : ( ) => ( failResolutions ) ,
finishResolution : ( ) => ( finishResolution ) ,
finishResolutions : ( ) => ( finishResolutions ) ,
invalidateResolution : ( ) => ( invalidateResolution ) ,
invalidateResolutionForStore : ( ) => ( invalidateResolutionForStore ) ,
invalidateResolutionForStoreSelector : ( ) => ( invalidateResolutionForStoreSelector ) ,
startResolution : ( ) => ( startResolution ) ,
startResolutions : ( ) => ( startResolutions )
2022-06-16 14:03:35 +02:00
} ) ;
2020-09-15 14:29:22 +02:00
// NAMESPACE OBJECT: ./node_modules/@wordpress/data/build-module/plugins/index.js
2019-11-02 10:38:58 +01:00
var plugins _namespaceObject = { } ;
_ _webpack _require _ _ . r ( plugins _namespaceObject ) ;
2022-06-16 14:03:35 +02:00
_ _webpack _require _ _ . d ( plugins _namespaceObject , {
2025-12-12 13:15:55 +01:00
persistence : ( ) => ( persistence _default )
2022-06-16 14:03:35 +02:00
} ) ;
2019-11-02 10:38:58 +01:00
2025-04-25 12:30:07 +02:00
; // external ["wp","deprecated"]
2024-04-17 11:32:24 +02:00
const external _wp _deprecated _namespaceObject = window [ "wp" ] [ "deprecated" ] ;
2022-06-16 14:03:35 +02:00
var external _wp _deprecated _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( external _wp _deprecated _namespaceObject ) ;
2025-04-25 12:30:07 +02:00
; // ./node_modules/redux/dist/redux.mjs
// src/utils/formatProdErrorMessage.ts
2021-07-23 11:58:50 +02:00
function formatProdErrorMessage ( code ) {
2025-04-25 12:30:07 +02:00
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. ` ;
2021-07-23 11:58:50 +02:00
}
2025-04-25 12:30:07 +02:00
// src/utils/symbol-observable.ts
var $$observable = /* @__PURE__ */ ( ( ) => typeof Symbol === "function" && Symbol . observable || "@@observable" ) ( ) ;
var symbol _observable _default = $$observable ;
2019-11-02 10:38:58 +01:00
2025-04-25 12:30:07 +02:00
// src/utils/actionTypes.ts
var randomString = ( ) => Math . random ( ) . toString ( 36 ) . substring ( 7 ) . split ( "" ) . join ( "." ) ;
2019-11-15 22:59:44 +01:00
var ActionTypes = {
2025-04-25 12:30:07 +02:00
INIT : ` @@redux/INIT ${ /* @__PURE__ */ randomString ( ) } ` ,
REPLACE : ` @@redux/REPLACE ${ /* @__PURE__ */ randomString ( ) } ` ,
PROBE _UNKNOWN _ACTION : ( ) => ` @@redux/PROBE_UNKNOWN_ACTION ${ randomString ( ) } `
2019-11-15 22:59:44 +01:00
} ;
2025-04-25 12:30:07 +02:00
var actionTypes _default = ActionTypes ;
2019-11-02 10:38:58 +01:00
2025-04-25 12:30:07 +02:00
// src/utils/isPlainObject.ts
2019-11-15 22:59:44 +01:00
function isPlainObject ( obj ) {
2025-04-25 12:30:07 +02:00
if ( typeof obj !== "object" || obj === null )
return false ;
let proto = obj ;
2019-11-15 22:59:44 +01:00
while ( Object . getPrototypeOf ( proto ) !== null ) {
proto = Object . getPrototypeOf ( proto ) ;
}
2025-04-25 12:30:07 +02:00
return Object . getPrototypeOf ( obj ) === proto || Object . getPrototypeOf ( obj ) === null ;
2019-11-15 22:59:44 +01:00
}
2019-11-02 10:38:58 +01:00
2025-04-25 12:30:07 +02:00
// src/utils/kindOf.ts
2022-04-02 10:26:41 +02:00
function miniKindOf ( val ) {
2025-04-25 12:30:07 +02:00
if ( val === void 0 )
return "undefined" ;
if ( val === null )
return "null" ;
const type = typeof val ;
2022-04-02 10:26:41 +02:00
switch ( type ) {
2025-04-25 12:30:07 +02:00
case "boolean" :
case "string" :
case "number" :
case "symbol" :
case "function" : {
return type ;
}
2022-04-02 10:26:41 +02:00
}
2025-04-25 12:30:07 +02:00
if ( Array . isArray ( val ) )
return "array" ;
if ( isDate ( val ) )
return "date" ;
if ( isError ( val ) )
return "error" ;
const constructorName = ctorName ( val ) ;
2022-04-02 10:26:41 +02:00
switch ( constructorName ) {
2025-04-25 12:30:07 +02:00
case "Symbol" :
case "Promise" :
case "WeakMap" :
case "WeakSet" :
case "Map" :
case "Set" :
2022-04-02 10:26:41 +02:00
return constructorName ;
2025-04-25 12:30:07 +02:00
}
return Object . prototype . toString . call ( val ) . slice ( 8 , - 1 ) . toLowerCase ( ) . replace ( /\s/g , "" ) ;
2022-04-02 10:26:41 +02:00
}
function ctorName ( val ) {
2025-04-25 12:30:07 +02:00
return typeof val . constructor === "function" ? val . constructor . name : null ;
2022-04-02 10:26:41 +02:00
}
function isError ( val ) {
2025-04-25 12:30:07 +02:00
return val instanceof Error || typeof val . message === "string" && val . constructor && typeof val . constructor . stackTraceLimit === "number" ;
2022-04-02 10:26:41 +02:00
}
function isDate ( val ) {
2025-04-25 12:30:07 +02:00
if ( val instanceof Date )
return true ;
return typeof val . toDateString === "function" && typeof val . getDate === "function" && typeof val . setDate === "function" ;
2022-04-02 10:26:41 +02:00
}
2021-07-23 11:58:50 +02:00
function kindOf ( val ) {
2025-04-25 12:30:07 +02:00
let typeOfVal = typeof val ;
2021-07-23 11:58:50 +02:00
if ( false ) { }
return typeOfVal ;
}
2025-04-25 12:30:07 +02:00
// src/createStore.ts
2022-06-16 14:03:35 +02:00
function createStore ( reducer , preloadedState , enhancer ) {
2025-04-25 12:30:07 +02:00
if ( typeof reducer !== "function" ) {
throw new Error ( true ? formatProdErrorMessage ( 2 ) : 0 ) ;
}
if ( typeof preloadedState === "function" && typeof enhancer === "function" || typeof enhancer === "function" && typeof arguments [ 3 ] === "function" ) {
2022-06-16 14:03:35 +02:00
throw new Error ( true ? formatProdErrorMessage ( 0 ) : 0 ) ;
2019-11-15 22:59:44 +01:00
}
2025-04-25 12:30:07 +02:00
if ( typeof preloadedState === "function" && typeof enhancer === "undefined" ) {
2019-11-15 22:59:44 +01:00
enhancer = preloadedState ;
2025-04-25 12:30:07 +02:00
preloadedState = void 0 ;
2019-11-15 22:59:44 +01:00
}
2025-04-25 12:30:07 +02:00
if ( typeof enhancer !== "undefined" ) {
if ( typeof enhancer !== "function" ) {
2022-06-16 14:03:35 +02:00
throw new Error ( true ? formatProdErrorMessage ( 1 ) : 0 ) ;
2019-11-15 22:59:44 +01:00
}
2022-06-16 14:03:35 +02:00
return enhancer ( createStore ) ( reducer , preloadedState ) ;
2019-11-15 22:59:44 +01:00
}
2025-04-25 12:30:07 +02:00
let currentReducer = reducer ;
let currentState = preloadedState ;
let currentListeners = /* @__PURE__ */ new Map ( ) ;
let nextListeners = currentListeners ;
let listenerIdCounter = 0 ;
let isDispatching = false ;
2019-11-15 22:59:44 +01:00
function ensureCanMutateNextListeners ( ) {
if ( nextListeners === currentListeners ) {
2025-04-25 12:30:07 +02:00
nextListeners = /* @__PURE__ */ new Map ( ) ;
currentListeners . forEach ( ( listener , key ) => {
nextListeners . set ( key , listener ) ;
} ) ;
2019-11-15 22:59:44 +01:00
}
}
function getState ( ) {
if ( isDispatching ) {
2022-06-16 14:03:35 +02:00
throw new Error ( true ? formatProdErrorMessage ( 3 ) : 0 ) ;
2019-11-15 22:59:44 +01:00
}
return currentState ;
2019-11-02 10:38:58 +01:00
}
2019-11-15 22:59:44 +01:00
function subscribe ( listener ) {
2025-04-25 12:30:07 +02:00
if ( typeof listener !== "function" ) {
2022-06-16 14:03:35 +02:00
throw new Error ( true ? formatProdErrorMessage ( 4 ) : 0 ) ;
2019-11-15 22:59:44 +01:00
}
if ( isDispatching ) {
2022-06-16 14:03:35 +02:00
throw new Error ( true ? formatProdErrorMessage ( 5 ) : 0 ) ;
2019-11-15 22:59:44 +01:00
}
2025-04-25 12:30:07 +02:00
let isSubscribed = true ;
2019-11-15 22:59:44 +01:00
ensureCanMutateNextListeners ( ) ;
2025-04-25 12:30:07 +02:00
const listenerId = listenerIdCounter ++ ;
nextListeners . set ( listenerId , listener ) ;
2019-11-15 22:59:44 +01:00
return function unsubscribe ( ) {
if ( ! isSubscribed ) {
return ;
}
if ( isDispatching ) {
2022-06-16 14:03:35 +02:00
throw new Error ( true ? formatProdErrorMessage ( 6 ) : 0 ) ;
2019-11-15 22:59:44 +01:00
}
isSubscribed = false ;
ensureCanMutateNextListeners ( ) ;
2025-04-25 12:30:07 +02:00
nextListeners . delete ( listenerId ) ;
2020-05-06 17:23:38 +02:00
currentListeners = null ;
2019-11-15 22:59:44 +01:00
} ;
}
function dispatch ( action ) {
if ( ! isPlainObject ( action ) ) {
2022-06-16 14:03:35 +02:00
throw new Error ( true ? formatProdErrorMessage ( 7 ) : 0 ) ;
2019-11-15 22:59:44 +01:00
}
2025-04-25 12:30:07 +02:00
if ( typeof action . type === "undefined" ) {
2022-06-16 14:03:35 +02:00
throw new Error ( true ? formatProdErrorMessage ( 8 ) : 0 ) ;
2019-11-15 22:59:44 +01:00
}
2025-04-25 12:30:07 +02:00
if ( typeof action . type !== "string" ) {
throw new Error ( true ? formatProdErrorMessage ( 17 ) : 0 ) ;
}
2019-11-15 22:59:44 +01:00
if ( isDispatching ) {
2022-06-16 14:03:35 +02:00
throw new Error ( true ? formatProdErrorMessage ( 9 ) : 0 ) ;
2019-11-15 22:59:44 +01:00
}
try {
isDispatching = true ;
currentState = currentReducer ( currentState , action ) ;
} finally {
isDispatching = false ;
}
2025-04-25 12:30:07 +02:00
const listeners = currentListeners = nextListeners ;
listeners . forEach ( ( listener ) => {
2019-11-15 22:59:44 +01:00
listener ( ) ;
2025-04-25 12:30:07 +02:00
} ) ;
2019-11-15 22:59:44 +01:00
return action ;
}
function replaceReducer ( nextReducer ) {
2025-04-25 12:30:07 +02:00
if ( typeof nextReducer !== "function" ) {
2022-06-16 14:03:35 +02:00
throw new Error ( true ? formatProdErrorMessage ( 10 ) : 0 ) ;
2019-11-15 22:59:44 +01:00
}
2025-04-25 12:30:07 +02:00
currentReducer = nextReducer ;
2019-11-15 22:59:44 +01:00
dispatch ( {
2025-04-25 12:30:07 +02:00
type : actionTypes _default . REPLACE
2019-11-15 22:59:44 +01:00
} ) ;
}
function observable ( ) {
2025-04-25 12:30:07 +02:00
const outerSubscribe = subscribe ;
return {
2019-11-15 22:59:44 +01:00
/ * *
* The minimal observable subscription method .
2025-04-25 12:30:07 +02:00
* @ param observer Any object that can be used as an observer .
2019-11-15 22:59:44 +01:00
* The observer object should have a ` next ` method .
2025-04-25 12:30:07 +02:00
* @ returns An object with an ` unsubscribe ` method that can
2019-11-15 22:59:44 +01:00
* be used to unsubscribe the observable from the store , and prevent further
* emission of values from the observable .
* /
2025-04-25 12:30:07 +02:00
subscribe ( observer ) {
if ( typeof observer !== "object" || observer === null ) {
2022-06-16 14:03:35 +02:00
throw new Error ( true ? formatProdErrorMessage ( 11 ) : 0 ) ;
2019-11-15 22:59:44 +01:00
}
function observeState ( ) {
2025-04-25 12:30:07 +02:00
const observerAsObserver = observer ;
if ( observerAsObserver . next ) {
observerAsObserver . next ( getState ( ) ) ;
2019-11-15 22:59:44 +01:00
}
}
observeState ( ) ;
2025-04-25 12:30:07 +02:00
const unsubscribe = outerSubscribe ( observeState ) ;
2019-11-15 22:59:44 +01:00
return {
2025-04-25 12:30:07 +02:00
unsubscribe
2019-11-15 22:59:44 +01:00
} ;
2025-04-25 12:30:07 +02:00
} ,
[ symbol _observable _default ] ( ) {
return this ;
2019-11-02 10:38:58 +01:00
}
2025-04-25 12:30:07 +02:00
} ;
}
2019-11-15 22:59:44 +01:00
dispatch ( {
2025-04-25 12:30:07 +02:00
type : actionTypes _default . INIT
2019-11-15 22:59:44 +01:00
} ) ;
2025-04-25 12:30:07 +02:00
const store = {
dispatch ,
subscribe ,
getState ,
replaceReducer ,
[ symbol _observable _default ] : observable
} ;
return store ;
}
function legacy _createStore ( reducer , preloadedState , enhancer ) {
return createStore ( reducer , preloadedState , enhancer ) ;
2019-11-15 22:59:44 +01:00
}
2019-11-02 10:38:58 +01:00
2025-04-25 12:30:07 +02:00
// src/utils/warning.ts
2019-11-15 22:59:44 +01:00
function warning ( message ) {
2025-04-25 12:30:07 +02:00
if ( typeof console !== "undefined" && typeof console . error === "function" ) {
2019-11-15 22:59:44 +01:00
console . error ( message ) ;
}
try {
throw new Error ( message ) ;
2025-04-25 12:30:07 +02:00
} catch ( e ) {
}
2019-11-15 22:59:44 +01:00
}
2019-11-02 10:38:58 +01:00
2025-04-25 12:30:07 +02:00
// src/combineReducers.ts
2019-11-15 22:59:44 +01:00
function getUnexpectedStateShapeWarningMessage ( inputState , reducers , action , unexpectedKeyCache ) {
2025-04-25 12:30:07 +02:00
const reducerKeys = Object . keys ( reducers ) ;
const argumentName = action && action . type === actionTypes _default . INIT ? "preloadedState argument passed to createStore" : "previous state received by the reducer" ;
2019-11-15 22:59:44 +01:00
if ( reducerKeys . length === 0 ) {
2025-04-25 12:30:07 +02:00
return "Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers." ;
2019-11-15 22:59:44 +01:00
}
if ( ! isPlainObject ( inputState ) ) {
2025-04-25 12:30:07 +02:00
return ` The ${ argumentName } has unexpected type of " ${ kindOf ( inputState ) } ". Expected argument to be an object with the following keys: " ${ reducerKeys . join ( '", "' ) } " ` ;
2019-11-15 22:59:44 +01:00
}
2025-04-25 12:30:07 +02:00
const unexpectedKeys = Object . keys ( inputState ) . filter ( ( key ) => ! reducers . hasOwnProperty ( key ) && ! unexpectedKeyCache [ key ] ) ;
unexpectedKeys . forEach ( ( key ) => {
2019-11-15 22:59:44 +01:00
unexpectedKeyCache [ key ] = true ;
} ) ;
2025-04-25 12:30:07 +02:00
if ( action && action . type === actionTypes _default . REPLACE )
return ;
2019-11-15 22:59:44 +01:00
if ( unexpectedKeys . length > 0 ) {
2025-04-25 12:30:07 +02:00
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. ` ;
2019-11-15 22:59:44 +01:00
}
}
function assertReducerShape ( reducers ) {
2025-04-25 12:30:07 +02:00
Object . keys ( reducers ) . forEach ( ( key ) => {
const reducer = reducers [ key ] ;
const initialState = reducer ( void 0 , {
type : actionTypes _default . INIT
2019-11-15 22:59:44 +01:00
} ) ;
2025-04-25 12:30:07 +02:00
if ( typeof initialState === "undefined" ) {
2022-06-16 14:03:35 +02:00
throw new Error ( true ? formatProdErrorMessage ( 12 ) : 0 ) ;
2019-11-15 22:59:44 +01:00
}
2025-04-25 12:30:07 +02:00
if ( typeof reducer ( void 0 , {
type : actionTypes _default . PROBE _UNKNOWN _ACTION ( )
} ) === "undefined" ) {
2022-06-16 14:03:35 +02:00
throw new Error ( true ? formatProdErrorMessage ( 13 ) : 0 ) ;
2019-11-02 10:38:58 +01:00
}
2019-11-15 22:59:44 +01:00
} ) ;
2019-11-02 10:38:58 +01:00
}
2019-11-15 22:59:44 +01:00
function combineReducers ( reducers ) {
2025-04-25 12:30:07 +02:00
const reducerKeys = Object . keys ( reducers ) ;
const finalReducers = { } ;
for ( let i = 0 ; i < reducerKeys . length ; i ++ ) {
const key = reducerKeys [ i ] ;
2019-11-15 22:59:44 +01:00
if ( false ) { }
2025-04-25 12:30:07 +02:00
if ( typeof reducers [ key ] === "function" ) {
2019-11-15 22:59:44 +01:00
finalReducers [ key ] = reducers [ key ] ;
}
}
2025-04-25 12:30:07 +02:00
const finalReducerKeys = Object . keys ( finalReducers ) ;
let unexpectedKeyCache ;
2019-11-15 22:59:44 +01:00
if ( false ) { }
2025-04-25 12:30:07 +02:00
let shapeAssertionError ;
2019-11-15 22:59:44 +01:00
try {
assertReducerShape ( finalReducers ) ;
} catch ( e ) {
shapeAssertionError = e ;
}
2025-04-25 12:30:07 +02:00
return function combination ( state = { } , action ) {
2019-11-15 22:59:44 +01:00
if ( shapeAssertionError ) {
throw shapeAssertionError ;
}
2025-04-25 12:30:07 +02:00
if ( false ) { }
let hasChanged = false ;
const nextState = { } ;
for ( let i = 0 ; i < finalReducerKeys . length ; i ++ ) {
const key = finalReducerKeys [ i ] ;
const reducer = finalReducers [ key ] ;
const previousStateForKey = state [ key ] ;
const nextStateForKey = reducer ( previousStateForKey , action ) ;
if ( typeof nextStateForKey === "undefined" ) {
const actionType = action && action . type ;
2022-06-16 14:03:35 +02:00
throw new Error ( true ? formatProdErrorMessage ( 14 ) : 0 ) ;
2019-11-15 22:59:44 +01:00
}
2025-04-25 12:30:07 +02:00
nextState [ key ] = nextStateForKey ;
2019-11-15 22:59:44 +01:00
hasChanged = hasChanged || nextStateForKey !== previousStateForKey ;
}
2020-05-06 17:23:38 +02:00
hasChanged = hasChanged || finalReducerKeys . length !== Object . keys ( state ) . length ;
2019-11-15 22:59:44 +01:00
return hasChanged ? nextState : state ;
} ;
}
2019-11-02 10:38:58 +01:00
2025-04-25 12:30:07 +02:00
// src/bindActionCreators.ts
2019-11-15 22:59:44 +01:00
function bindActionCreator ( actionCreator , dispatch ) {
2025-04-25 12:30:07 +02:00
return function ( ... args ) {
return dispatch ( actionCreator . apply ( this , args ) ) ;
2019-11-15 22:59:44 +01:00
} ;
}
function bindActionCreators ( actionCreators , dispatch ) {
2025-04-25 12:30:07 +02:00
if ( typeof actionCreators === "function" ) {
2019-11-15 22:59:44 +01:00
return bindActionCreator ( actionCreators , dispatch ) ;
}
2025-04-25 12:30:07 +02:00
if ( typeof actionCreators !== "object" || actionCreators === null ) {
2022-06-16 14:03:35 +02:00
throw new Error ( true ? formatProdErrorMessage ( 16 ) : 0 ) ;
2019-11-15 22:59:44 +01:00
}
2025-04-25 12:30:07 +02:00
const boundActionCreators = { } ;
for ( const key in actionCreators ) {
const actionCreator = actionCreators [ key ] ;
if ( typeof actionCreator === "function" ) {
2019-11-15 22:59:44 +01:00
boundActionCreators [ key ] = bindActionCreator ( actionCreator , dispatch ) ;
}
}
return boundActionCreators ;
}
2019-11-02 10:38:58 +01:00
2025-04-25 12:30:07 +02:00
// src/compose.ts
function compose ( ... funcs ) {
2019-11-15 22:59:44 +01:00
if ( funcs . length === 0 ) {
2025-04-25 12:30:07 +02:00
return ( arg ) => arg ;
2019-11-15 22:59:44 +01:00
}
if ( funcs . length === 1 ) {
return funcs [ 0 ] ;
}
2025-04-25 12:30:07 +02:00
return funcs . reduce ( ( a , b ) => ( ... args ) => a ( b ( ... args ) ) ) ;
2019-11-15 22:59:44 +01:00
}
2025-04-25 12:30:07 +02:00
// src/applyMiddleware.ts
function applyMiddleware ( ... middlewares ) {
return ( createStore2 ) => ( reducer , preloadedState ) => {
const store = createStore2 ( reducer , preloadedState ) ;
let dispatch = ( ) => {
throw new Error ( true ? formatProdErrorMessage ( 15 ) : 0 ) ;
} ;
const middlewareAPI = {
getState : store . getState ,
dispatch : ( action , ... args ) => dispatch ( action , ... args )
} ;
const chain = middlewares . map ( ( middleware ) => middleware ( middlewareAPI ) ) ;
dispatch = compose ( ... chain ) ( store . dispatch ) ;
return {
... store ,
dispatch
2019-11-15 22:59:44 +01:00
} ;
} ;
}
2025-04-25 12:30:07 +02:00
// src/utils/isAction.ts
function isAction ( action ) {
return isPlainObject ( action ) && "type" in action && typeof action . type === "string" ;
}
2019-11-15 22:59:44 +01:00
2025-04-25 12:30:07 +02:00
//# sourceMappingURL=redux.mjs.map
2020-12-10 14:06:04 +01:00
// EXTERNAL MODULE: ./node_modules/equivalent-key-map/equivalent-key-map.js
2024-04-17 11:32:24 +02:00
var equivalent _key _map = _ _webpack _require _ _ ( 3249 ) ;
2020-12-10 14:06:04 +01:00
var equivalent _key _map _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( equivalent _key _map ) ;
2025-04-25 12:30:07 +02:00
; // external ["wp","reduxRoutine"]
2024-04-17 11:32:24 +02:00
const external _wp _reduxRoutine _namespaceObject = window [ "wp" ] [ "reduxRoutine" ] ;
2022-06-16 14:03:35 +02:00
var external _wp _reduxRoutine _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( external _wp _reduxRoutine _namespaceObject ) ;
2025-04-25 12:30:07 +02:00
; // external ["wp","compose"]
2024-04-17 11:32:24 +02:00
const external _wp _compose _namespaceObject = window [ "wp" ] [ "compose" ] ;
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/data/build-module/redux-store/combine-reducers.js
2024-04-17 11:32:24 +02:00
function combine _reducers _combineReducers ( reducers ) {
const keys = Object . keys ( reducers ) ;
return function combinedReducer ( state = { } , action ) {
const nextState = { } ;
let hasChanged = false ;
for ( const key of keys ) {
const reducer = reducers [ key ] ;
const prevStateForKey = state [ key ] ;
const nextStateForKey = reducer ( prevStateForKey , action ) ;
nextState [ key ] = nextStateForKey ;
hasChanged = hasChanged || nextStateForKey !== prevStateForKey ;
}
return hasChanged ? nextState : state ;
} ;
}
2025-04-25 12:30:07 +02:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/data/build-module/factory.js
2020-12-10 14:06:04 +01:00
function createRegistrySelector ( registrySelector ) {
2025-12-12 13:15:55 +01:00
const selectorsByRegistry = /* @__PURE__ */ new WeakMap ( ) ;
2024-04-17 11:32:24 +02:00
const wrappedSelector = ( ... args ) => {
let selector = selectorsByRegistry . get ( wrappedSelector . registry ) ;
if ( ! selector ) {
selector = registrySelector ( wrappedSelector . registry . select ) ;
selectorsByRegistry . set ( wrappedSelector . registry , selector ) ;
}
return selector ( ... args ) ;
} ;
wrappedSelector . isRegistrySelector = true ;
return wrappedSelector ;
2020-12-10 14:06:04 +01:00
}
function createRegistryControl ( registryControl ) {
registryControl . isRegistryControl = true ;
return registryControl ;
}
2023-12-07 09:44:11 +01:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/data/build-module/controls.js
2022-04-02 10:26:41 +02:00
2025-12-12 13:15:55 +01:00
const SELECT = "@@data/SELECT" ;
const RESOLVE _SELECT = "@@data/RESOLVE_SELECT" ;
const DISPATCH = "@@data/DISPATCH" ;
2022-12-15 17:47:31 +01:00
function isObject ( object ) {
2025-12-12 13:15:55 +01:00
return object !== null && typeof object === "object" ;
2022-12-15 17:47:31 +01:00
}
2023-09-26 10:33:34 +02:00
function controls _select ( storeNameOrDescriptor , selectorName , ... args ) {
2020-12-10 14:06:04 +01:00
return {
type : SELECT ,
2022-12-15 17:47:31 +01:00
storeKey : isObject ( storeNameOrDescriptor ) ? storeNameOrDescriptor . name : storeNameOrDescriptor ,
2021-07-23 11:58:50 +02:00
selectorName ,
args
2020-12-10 14:06:04 +01:00
} ;
}
2023-09-26 10:33:34 +02:00
function resolveSelect ( storeNameOrDescriptor , selectorName , ... args ) {
2020-12-10 14:06:04 +01:00
return {
type : RESOLVE _SELECT ,
2022-12-15 17:47:31 +01:00
storeKey : isObject ( storeNameOrDescriptor ) ? storeNameOrDescriptor . name : storeNameOrDescriptor ,
2021-07-23 11:58:50 +02:00
selectorName ,
args
2020-12-10 14:06:04 +01:00
} ;
}
2023-09-26 10:33:34 +02:00
function dispatch ( storeNameOrDescriptor , actionName , ... args ) {
2020-12-10 14:06:04 +01:00
return {
type : DISPATCH ,
2022-12-15 17:47:31 +01:00
storeKey : isObject ( storeNameOrDescriptor ) ? storeNameOrDescriptor . name : storeNameOrDescriptor ,
2021-07-23 11:58:50 +02:00
actionName ,
args
2020-12-10 14:06:04 +01:00
} ;
}
2025-12-12 13:15:55 +01:00
const controls = { select : controls _select , resolveSelect , dispatch } ;
2021-07-23 11:58:50 +02:00
const builtinControls = {
2025-12-12 13:15:55 +01:00
[ SELECT ] : createRegistryControl (
( registry ) => ( { storeKey , selectorName , args } ) => registry . select ( storeKey ) [ selectorName ] ( ... args )
) ,
[ RESOLVE _SELECT ] : createRegistryControl (
( registry ) => ( { storeKey , selectorName , args } ) => {
const method = registry . select ( storeKey ) [ selectorName ] . hasResolver ? "resolveSelect" : "select" ;
return registry [ method ] ( storeKey ) [ selectorName ] (
... args
) ;
}
) ,
[ DISPATCH ] : createRegistryControl (
( registry ) => ( { storeKey , actionName , args } ) => registry . dispatch ( storeKey ) [ actionName ] ( ... args )
)
2021-07-23 11:58:50 +02:00
} ;
2020-12-10 14:06:04 +01:00
2025-12-12 13:15:55 +01:00
2025-04-25 12:30:07 +02:00
; // external ["wp","privateApis"]
2024-04-17 11:32:24 +02:00
const external _wp _privateApis _namespaceObject = window [ "wp" ] [ "privateApis" ] ;
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/data/build-module/lock-unlock.js
2023-04-26 17:39:43 +02:00
2025-12-12 13:15:55 +01:00
const { lock , unlock } = ( 0 , external _wp _privateApis _namespaceObject . _ _dangerousOptInToUnstableAPIsOnlyForCoreModules ) (
"I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress." ,
"@wordpress/data"
) ;
2023-04-26 17:39:43 +02:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/is-promise/index.mjs
2022-06-16 14:03:35 +02:00
function isPromise ( obj ) {
return ! ! obj && ( typeof obj === 'object' || typeof obj === 'function' ) && typeof obj . then === 'function' ;
}
2019-11-15 22:59:44 +01:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/data/build-module/promise-middleware.js
2023-12-07 09:44:11 +01:00
2025-12-12 13:15:55 +01:00
const promiseMiddleware = ( ) => ( next ) => ( action ) => {
2022-06-16 14:03:35 +02:00
if ( isPromise ( action ) ) {
2025-12-12 13:15:55 +01:00
return action . then ( ( resolvedAction ) => {
2021-07-23 11:58:50 +02:00
if ( resolvedAction ) {
return next ( resolvedAction ) ;
2019-11-15 22:59:44 +01:00
}
2021-07-23 11:58:50 +02:00
} ) ;
}
return next ( action ) ;
2019-11-15 22:59:44 +01:00
} ;
2025-12-12 13:15:55 +01:00
var promise _middleware _default = promiseMiddleware ;
2022-06-16 14:03:35 +02:00
2020-05-06 17:23:38 +02:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/data/build-module/resolvers-cache-middleware.js
const createResolversCacheMiddleware = ( registry , storeName ) => ( ) => ( next ) => ( action ) => {
2024-04-17 11:32:24 +02:00
const resolvers = registry . select ( storeName ) . getCachedResolvers ( ) ;
const resolverEntries = Object . entries ( resolvers ) ;
resolverEntries . forEach ( ( [ selectorName , resolversByArgs ] ) => {
const resolver = registry . stores [ storeName ] ? . resolvers ? . [ selectorName ] ;
2021-07-23 11:58:50 +02:00
if ( ! resolver || ! resolver . shouldInvalidate ) {
return ;
}
resolversByArgs . forEach ( ( value , args ) => {
2025-12-12 13:15:55 +01:00
if ( value === void 0 ) {
2024-04-17 11:32:24 +02:00
return ;
}
2025-12-12 13:15:55 +01:00
if ( value . status !== "finished" && value . status !== "error" ) {
2024-04-17 11:32:24 +02:00
return ;
}
if ( ! resolver . shouldInvalidate ( action , ... args ) ) {
2021-07-23 11:58:50 +02:00
return ;
2023-12-07 09:44:11 +01:00
}
2024-04-17 11:32:24 +02:00
registry . dispatch ( storeName ) . invalidateResolution ( selectorName , args ) ;
2021-07-23 11:58:50 +02:00
} ) ;
} ) ;
return next ( action ) ;
2019-11-15 22:59:44 +01:00
} ;
2025-12-12 13:15:55 +01:00
var resolvers _cache _middleware _default = createResolversCacheMiddleware ;
2019-11-15 22:59:44 +01:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/data/build-module/redux-store/thunk-middleware.js
2021-04-27 08:32:47 +02:00
function createThunkMiddleware ( args ) {
2025-12-12 13:15:55 +01:00
return ( ) => ( next ) => ( action ) => {
if ( typeof action === "function" ) {
2021-07-23 11:58:50 +02:00
return action ( args ) ;
}
return next ( action ) ;
2021-04-27 08:32:47 +02:00
} ;
}
2022-06-16 14:03:35 +02:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/data/build-module/redux-store/metadata/utils.js
const onSubKey = ( actionProperty ) => ( reducer ) => ( state = { } , action ) => {
2021-07-23 11:58:50 +02:00
const key = action [ actionProperty ] ;
2025-12-12 13:15:55 +01:00
if ( key === void 0 ) {
2021-07-23 11:58:50 +02:00
return state ;
2023-12-07 09:44:11 +01:00
}
2021-07-23 11:58:50 +02:00
const nextKeyState = reducer ( state [ key ] , action ) ;
if ( nextKeyState === state [ key ] ) {
return state ;
}
2023-12-07 09:44:11 +01:00
return {
... state ,
2021-07-23 11:58:50 +02:00
[ key ] : nextKeyState
2019-11-15 22:59:44 +01:00
} ;
} ;
2022-06-16 14:03:35 +02:00
function selectorArgsToStateKey ( args ) {
2025-12-12 13:15:55 +01:00
if ( args === void 0 || args === null ) {
2022-06-16 14:03:35 +02:00
return [ ] ;
}
const len = args . length ;
let idx = len ;
2025-12-12 13:15:55 +01:00
while ( idx > 0 && args [ idx - 1 ] === void 0 ) {
2022-06-16 14:03:35 +02:00
idx -- ;
}
return idx === len ? args : args . slice ( 0 , idx ) ;
}
2025-12-12 13:15:55 +01:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/data/build-module/redux-store/metadata/reducer.js
2019-11-15 22:59:44 +01:00
2025-12-12 13:15:55 +01:00
const subKeysIsResolved = onSubKey ( "selectorName" ) ( ( state = new ( equivalent _key _map _default ( ) ) ( ) , action ) => {
2019-11-15 22:59:44 +01:00
switch ( action . type ) {
2025-12-12 13:15:55 +01:00
case "START_RESOLUTION" : {
const nextState = new ( equivalent _key _map _default ( ) ) ( state ) ;
nextState . set ( selectorArgsToStateKey ( action . args ) , {
status : "resolving"
} ) ;
return nextState ;
}
case "FINISH_RESOLUTION" : {
const nextState = new ( equivalent _key _map _default ( ) ) ( state ) ;
nextState . set ( selectorArgsToStateKey ( action . args ) , {
status : "finished"
} ) ;
return nextState ;
}
case "FAIL_RESOLUTION" : {
const nextState = new ( equivalent _key _map _default ( ) ) ( state ) ;
nextState . set ( selectorArgsToStateKey ( action . args ) , {
status : "error" ,
error : action . error
} ) ;
return nextState ;
}
case "START_RESOLUTIONS" : {
const nextState = new ( equivalent _key _map _default ( ) ) ( state ) ;
for ( const resolutionArgs of action . args ) {
nextState . set ( selectorArgsToStateKey ( resolutionArgs ) , {
status : "resolving"
2022-06-16 14:03:35 +02:00
} ) ;
}
2025-12-12 13:15:55 +01:00
return nextState ;
}
case "FINISH_RESOLUTIONS" : {
const nextState = new ( equivalent _key _map _default ( ) ) ( state ) ;
for ( const resolutionArgs of action . args ) {
nextState . set ( selectorArgsToStateKey ( resolutionArgs ) , {
status : "finished"
2022-06-16 14:03:35 +02:00
} ) ;
}
2025-12-12 13:15:55 +01:00
return nextState ;
}
case "FAIL_RESOLUTIONS" : {
const nextState = new ( equivalent _key _map _default ( ) ) ( state ) ;
action . args . forEach ( ( resolutionArgs , idx ) => {
const resolutionState = {
status : "error" ,
error : void 0
} ;
const error = action . errors [ idx ] ;
if ( error ) {
resolutionState . error = error ;
2021-07-23 11:58:50 +02:00
}
2025-12-12 13:15:55 +01:00
nextState . set (
selectorArgsToStateKey ( resolutionArgs ) ,
resolutionState
) ;
} ) ;
return nextState ;
}
case "INVALIDATE_RESOLUTION" : {
const nextState = new ( equivalent _key _map _default ( ) ) ( state ) ;
nextState . delete ( selectorArgsToStateKey ( action . args ) ) ;
return nextState ;
}
2019-11-02 10:38:58 +01:00
}
return state ;
} ) ;
2023-09-26 10:33:34 +02:00
const isResolved = ( state = { } , action ) => {
2019-11-02 10:38:58 +01:00
switch ( action . type ) {
2025-12-12 13:15:55 +01:00
case "INVALIDATE_RESOLUTION_FOR_STORE" :
2019-11-15 22:59:44 +01:00
return { } ;
2025-12-12 13:15:55 +01:00
case "INVALIDATE_RESOLUTION_FOR_STORE_SELECTOR" : {
if ( action . selectorName in state ) {
const {
[ action . selectorName ] : removedSelector ,
... restState
} = state ;
return restState ;
2022-12-15 17:47:31 +01:00
}
2025-12-12 13:15:55 +01:00
return state ;
}
case "START_RESOLUTION" :
case "FINISH_RESOLUTION" :
case "FAIL_RESOLUTION" :
case "START_RESOLUTIONS" :
case "FINISH_RESOLUTIONS" :
case "FAIL_RESOLUTIONS" :
case "INVALIDATE_RESOLUTION" :
2019-11-02 10:38:58 +01:00
return subKeysIsResolved ( state , action ) ;
}
return state ;
} ;
2025-12-12 13:15:55 +01:00
var reducer _default = isResolved ;
2019-11-02 10:38:58 +01:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/rememo/rememo.js
2023-12-07 09:44:11 +01:00
/** @typedef {(...args: any[]) => *[]} GetDependants */
/** @typedef {() => void} Clear */
/ * *
* @ typedef { {
* getDependants : GetDependants ,
* clear : Clear
* } } EnhancedSelector
* /
/ * *
* Internal cache entry .
*
* @ typedef CacheNode
*
* @ property { ? CacheNode | undefined } [ prev ] Previous node .
* @ property { ? CacheNode | undefined } [ next ] Next node .
* @ property { * [ ] } args Function arguments for cache entry .
* @ property { * } val Function result .
* /
/ * *
* @ typedef Cache
*
* @ property { Clear } clear Function to clear cache .
* @ property { boolean } [ isUniqueByDependants ] Whether dependants are valid in
* considering cache uniqueness . A cache is unique if dependents are all arrays
* or objects .
* @ property { CacheNode ? } [ head ] Cache head .
* @ property { * [ ] } [ lastDependants ] Dependants from previous invocation .
* /
/ * *
* Arbitrary value used as key for referencing cache object in WeakMap tree .
*
* @ type { { } }
* /
var LEAF _KEY = { } ;
/ * *
* Returns the first argument as the sole entry in an array .
*
* @ template T
*
* @ param { T } value Value to return .
*
* @ return { [ T ] } Value returned as entry in array .
* /
function arrayOf ( value ) {
return [ value ] ;
}
/ * *
* Returns true if the value passed is object - like , or false otherwise . A value
* is object - like if it can support property assignment , e . g . object or array .
*
* @ param { * } value Value to test .
*
* @ return { boolean } Whether value is object - like .
* /
function isObjectLike ( value ) {
return ! ! value && 'object' === typeof value ;
}
/ * *
* Creates and returns a new cache object .
*
* @ return { Cache } Cache object .
* /
function createCache ( ) {
/** @type {Cache} */
var cache = {
clear : function ( ) {
cache . head = null ;
} ,
} ;
return cache ;
}
/ * *
* Returns true if entries within the two arrays are strictly equal by
* reference from a starting index .
*
* @ param { * [ ] } a First array .
* @ param { * [ ] } b Second array .
* @ param { number } fromIndex Index from which to start comparison .
*
* @ return { boolean } Whether arrays are shallowly equal .
* /
function isShallowEqual ( a , b , fromIndex ) {
var i ;
if ( a . length !== b . length ) {
return false ;
}
for ( i = fromIndex ; i < a . length ; i ++ ) {
if ( a [ i ] !== b [ i ] ) {
return false ;
}
}
return true ;
}
/ * *
* Returns a memoized selector function . The getDependants function argument is
* called before the memoized selector and is expected to return an immutable
* reference or array of references on which the selector depends for computing
* its own return value . The memoize cache is preserved only as long as those
* dependant references remain the same . If getDependants returns a different
* reference ( s ) , the cache is cleared and the selector value regenerated .
*
* @ template { ( ... args : * [ ] ) => * } S
*
* @ param { S } selector Selector function .
* @ param { GetDependants = } getDependants Dependant getter returning an array of
* references used in cache bust consideration .
* /
/* harmony default export */ function rememo ( selector , getDependants ) {
/** @type {WeakMap<*,*>} */
var rootCache ;
/** @type {GetDependants} */
var normalizedGetDependants = getDependants ? getDependants : arrayOf ;
/ * *
* Returns the cache for a given dependants array . When possible , a WeakMap
* will be used to create a unique cache for each set of dependants . This
* is feasible due to the nature of WeakMap in allowing garbage collection
* to occur on entries where the key object is no longer referenced . Since
* WeakMap requires the key to be an object , this is only possible when the
* dependant is object - like . The root cache is created as a hierarchy where
* each top - level key is the first entry in a dependants set , the value a
* WeakMap where each key is the next dependant , and so on . This continues
* so long as the dependants are object - like . If no dependants are object -
* like , then the cache is shared across all invocations .
*
* @ see isObjectLike
*
* @ param { * [ ] } dependants Selector dependants .
*
* @ return { Cache } Cache object .
* /
function getCache ( dependants ) {
var caches = rootCache ,
isUniqueByDependants = true ,
i ,
dependant ,
map ,
cache ;
for ( i = 0 ; i < dependants . length ; i ++ ) {
dependant = dependants [ i ] ;
// Can only compose WeakMap from object-like key.
if ( ! isObjectLike ( dependant ) ) {
isUniqueByDependants = false ;
break ;
}
// Does current segment of cache already have a WeakMap?
if ( caches . has ( dependant ) ) {
// Traverse into nested WeakMap.
caches = caches . get ( dependant ) ;
} else {
// Create, set, and traverse into a new one.
map = new WeakMap ( ) ;
caches . set ( dependant , map ) ;
caches = map ;
}
}
// We use an arbitrary (but consistent) object as key for the last item
// in the WeakMap to serve as our running cache.
if ( ! caches . has ( LEAF _KEY ) ) {
cache = createCache ( ) ;
cache . isUniqueByDependants = isUniqueByDependants ;
caches . set ( LEAF _KEY , cache ) ;
}
return caches . get ( LEAF _KEY ) ;
}
/ * *
* Resets root memoization cache .
* /
function clear ( ) {
rootCache = new WeakMap ( ) ;
}
/* eslint-disable jsdoc/check-param-names */
/ * *
* The augmented selector call , considering first whether dependants have
* changed before passing it to underlying memoize function .
*
* @ param { * } source Source object for derivation .
* @ param { ... * } extraArgs Additional arguments to pass to selector .
*
* @ return { * } Selector result .
* /
/* eslint-enable jsdoc/check-param-names */
function callSelector ( /* source, ...extraArgs */ ) {
var len = arguments . length ,
cache ,
node ,
i ,
args ,
dependants ;
// Create copy of arguments (avoid leaking deoptimization).
args = new Array ( len ) ;
for ( i = 0 ; i < len ; i ++ ) {
args [ i ] = arguments [ i ] ;
}
dependants = normalizedGetDependants . apply ( null , args ) ;
cache = getCache ( dependants ) ;
// If not guaranteed uniqueness by dependants (primitive type), shallow
// compare against last dependants and, if references have changed,
// destroy cache to recalculate result.
if ( ! cache . isUniqueByDependants ) {
if (
cache . lastDependants &&
! isShallowEqual ( dependants , cache . lastDependants , 0 )
) {
cache . clear ( ) ;
}
cache . lastDependants = dependants ;
}
node = cache . head ;
while ( node ) {
// Check whether node arguments match arguments
if ( ! isShallowEqual ( node . args , args , 1 ) ) {
node = node . next ;
continue ;
}
// At this point we can assume we've found a match
// Surface matched node to head if not already
if ( node !== cache . head ) {
// Adjust siblings to point to each other.
/** @type {CacheNode} */ ( node . prev ) . next = node . next ;
if ( node . next ) {
node . next . prev = node . prev ;
}
node . next = cache . head ;
node . prev = null ;
/** @type {CacheNode} */ ( cache . head ) . prev = node ;
cache . head = node ;
}
// Return immediately
return node . val ;
}
// No cached value found. Continue to insertion phase:
node = /** @type {CacheNode} */ ( {
// Generate the result from original function
val : selector . apply ( null , args ) ,
} ) ;
// Avoid including the source object in the cache.
args [ 0 ] = null ;
node . args = args ;
// Don't need to check whether node is already head, since it would
// have been returned above already if it was
// Shift existing head down list
if ( cache . head ) {
cache . head . prev = node ;
node . next = cache . head ;
}
cache . head = node ;
return node . val ;
}
callSelector . getDependants = normalizedGetDependants ;
callSelector . clear = clear ;
clear ( ) ;
return /** @type {S & EnhancedSelector} */ ( callSelector ) ;
}
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/data/build-module/redux-store/metadata/selectors.js
2022-06-16 14:03:35 +02:00
2022-04-02 10:26:41 +02:00
2025-02-28 08:42:11 +01:00
2022-06-16 14:03:35 +02:00
function getResolutionState ( state , selectorName , args ) {
2023-09-26 10:33:34 +02:00
const map = state [ selectorName ] ;
2019-11-02 10:38:58 +01:00
if ( ! map ) {
2022-06-16 14:03:35 +02:00
return ;
2019-11-02 10:38:58 +01:00
}
2022-06-16 14:03:35 +02:00
return map . get ( selectorArgsToStateKey ( args ) ) ;
}
function getIsResolving ( state , selectorName , args ) {
2025-12-12 13:15:55 +01:00
external _wp _deprecated _default ( ) ( "wp.data.select( store ).getIsResolving" , {
since : "6.6" ,
version : "6.8" ,
alternative : "wp.data.select( store ).getResolutionState"
2025-02-28 08:42:11 +01:00
} ) ;
2022-06-16 14:03:35 +02:00
const resolutionState = getResolutionState ( state , selectorName , args ) ;
2025-12-12 13:15:55 +01:00
return resolutionState && resolutionState . status === "resolving" ;
2019-11-02 10:38:58 +01:00
}
2022-06-16 14:03:35 +02:00
function hasStartedResolution ( state , selectorName , args ) {
2025-12-12 13:15:55 +01:00
return getResolutionState ( state , selectorName , args ) !== void 0 ;
2019-11-02 10:38:58 +01:00
}
2022-06-16 14:03:35 +02:00
function hasFinishedResolution ( state , selectorName , args ) {
2023-09-26 10:33:34 +02:00
const status = getResolutionState ( state , selectorName , args ) ? . status ;
2025-12-12 13:15:55 +01:00
return status === "finished" || status === "error" ;
2022-06-16 14:03:35 +02:00
}
function hasResolutionFailed ( state , selectorName , args ) {
2025-12-12 13:15:55 +01:00
return getResolutionState ( state , selectorName , args ) ? . status === "error" ;
2022-06-16 14:03:35 +02:00
}
function getResolutionError ( state , selectorName , args ) {
const resolutionState = getResolutionState ( state , selectorName , args ) ;
2025-12-12 13:15:55 +01:00
return resolutionState ? . status === "error" ? resolutionState . error : null ;
2019-11-02 10:38:58 +01:00
}
2022-06-16 14:03:35 +02:00
function isResolving ( state , selectorName , args ) {
2025-12-12 13:15:55 +01:00
return getResolutionState ( state , selectorName , args ) ? . status === "resolving" ;
2019-11-02 10:38:58 +01:00
}
2019-11-15 22:59:44 +01:00
function getCachedResolvers ( state ) {
return state ;
2019-11-02 10:38:58 +01:00
}
2023-09-26 10:33:34 +02:00
function hasResolvingSelectors ( state ) {
2025-12-12 13:15:55 +01:00
return Object . values ( state ) . some (
( selectorState ) => (
/ * *
* This uses the internal ` _map ` property of ` EquivalentKeyMap ` for
* optimization purposes , since the ` EquivalentKeyMap ` implementation
* does not support a ` .values() ` implementation .
*
* @ see https : //github.com/aduth/equivalent-key-map
* /
Array . from ( selectorState . _map . values ( ) ) . some (
( resolution ) => resolution [ 1 ] ? . status === "resolving"
)
)
) ;
}
const countSelectorsByStatus = rememo (
( state ) => {
const selectorsByStatus = { } ;
Object . values ( state ) . forEach (
( selectorState ) => (
/ * *
* This uses the internal ` _map ` property of ` EquivalentKeyMap ` for
* optimization purposes , since the ` EquivalentKeyMap ` implementation
* does not support a ` .values() ` implementation .
*
* @ see https : //github.com/aduth/equivalent-key-map
* /
Array . from ( selectorState . _map . values ( ) ) . forEach (
( resolution ) => {
const currentStatus = resolution [ 1 ] ? . status ? ? "error" ;
if ( ! selectorsByStatus [ currentStatus ] ) {
selectorsByStatus [ currentStatus ] = 0 ;
}
selectorsByStatus [ currentStatus ] ++ ;
}
)
)
) ;
return selectorsByStatus ;
} ,
( state ) => [ state ]
) ;
2019-11-02 10:38:58 +01:00
2023-12-07 09:44:11 +01:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/data/build-module/redux-store/metadata/actions.js
2019-11-15 22:59:44 +01:00
function startResolution ( selectorName , args ) {
2019-11-02 10:38:58 +01:00
return {
2025-12-12 13:15:55 +01:00
type : "START_RESOLUTION" ,
2021-07-23 11:58:50 +02:00
selectorName ,
args
2019-11-02 10:38:58 +01:00
} ;
}
2019-11-15 22:59:44 +01:00
function finishResolution ( selectorName , args ) {
2019-11-02 10:38:58 +01:00
return {
2025-12-12 13:15:55 +01:00
type : "FINISH_RESOLUTION" ,
2021-07-23 11:58:50 +02:00
selectorName ,
args
} ;
}
2022-06-16 14:03:35 +02:00
function failResolution ( selectorName , args , error ) {
return {
2025-12-12 13:15:55 +01:00
type : "FAIL_RESOLUTION" ,
2022-06-16 14:03:35 +02:00
selectorName ,
args ,
error
} ;
}
2021-07-23 11:58:50 +02:00
function startResolutions ( selectorName , args ) {
return {
2025-12-12 13:15:55 +01:00
type : "START_RESOLUTIONS" ,
2021-07-23 11:58:50 +02:00
selectorName ,
args
} ;
}
function finishResolutions ( selectorName , args ) {
return {
2025-12-12 13:15:55 +01:00
type : "FINISH_RESOLUTIONS" ,
2021-07-23 11:58:50 +02:00
selectorName ,
args
2019-11-02 10:38:58 +01:00
} ;
}
2022-06-16 14:03:35 +02:00
function failResolutions ( selectorName , args , errors ) {
return {
2025-12-12 13:15:55 +01:00
type : "FAIL_RESOLUTIONS" ,
2022-06-16 14:03:35 +02:00
selectorName ,
args ,
errors
} ;
}
2019-11-15 22:59:44 +01:00
function invalidateResolution ( selectorName , args ) {
2019-11-02 10:38:58 +01:00
return {
2025-12-12 13:15:55 +01:00
type : "INVALIDATE_RESOLUTION" ,
2021-07-23 11:58:50 +02:00
selectorName ,
args
2019-11-02 10:38:58 +01:00
} ;
}
2019-11-15 22:59:44 +01:00
function invalidateResolutionForStore ( ) {
2019-11-02 10:38:58 +01:00
return {
2025-12-12 13:15:55 +01:00
type : "INVALIDATE_RESOLUTION_FOR_STORE"
2019-11-02 10:38:58 +01:00
} ;
}
2019-11-15 22:59:44 +01:00
function invalidateResolutionForStoreSelector ( selectorName ) {
2019-11-02 10:38:58 +01:00
return {
2025-12-12 13:15:55 +01:00
type : "INVALIDATE_RESOLUTION_FOR_STORE_SELECTOR" ,
2021-07-23 11:58:50 +02:00
selectorName
2019-11-02 10:38:58 +01:00
} ;
}
2019-11-15 22:59:44 +01:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/data/build-module/redux-store/index.js
2023-04-26 17:39:43 +02:00
2019-11-02 10:38:58 +01:00
2019-11-15 22:59:44 +01:00
2019-11-02 10:38:58 +01:00
2020-12-10 14:06:04 +01:00
2021-04-27 08:32:47 +02:00
2023-04-26 17:39:43 +02:00
2024-04-17 11:32:24 +02:00
2021-04-27 08:32:47 +02:00
2025-12-12 13:15:55 +01:00
const trimUndefinedValues = ( array ) => {
2022-04-02 10:26:41 +02:00
const result = [ ... array ] ;
for ( let i = result . length - 1 ; i >= 0 ; i -- ) {
2025-12-12 13:15:55 +01:00
if ( result [ i ] === void 0 ) {
2022-04-02 10:26:41 +02:00
result . splice ( i , 1 ) ;
}
}
return result ;
2023-09-26 10:33:34 +02:00
} ;
2025-12-12 13:15:55 +01:00
const mapValues = ( obj , callback ) => Object . fromEntries (
Object . entries ( obj ? ? { } ) . map ( ( [ key , value ] ) => [
key ,
callback ( value , key )
] )
) ;
2025-02-28 08:42:11 +01:00
const devToolsReplacer = ( key , state ) => {
2023-04-26 17:39:43 +02:00
if ( state instanceof Map ) {
return Object . fromEntries ( state ) ;
}
2025-02-28 08:42:11 +01:00
if ( state instanceof window . HTMLElement ) {
return null ;
}
2023-04-26 17:39:43 +02:00
return state ;
2022-04-02 10:26:41 +02:00
} ;
2020-12-10 14:06:04 +01:00
function createResolversCache ( ) {
2021-07-23 11:58:50 +02:00
const cache = { } ;
2020-12-10 14:06:04 +01:00
return {
2021-07-23 11:58:50 +02:00
isRunning ( selectorName , args ) {
2022-04-02 10:26:41 +02:00
return cache [ selectorName ] && cache [ selectorName ] . get ( trimUndefinedValues ( args ) ) ;
2020-12-10 14:06:04 +01:00
} ,
2021-07-23 11:58:50 +02:00
clear ( selectorName , args ) {
2020-12-10 14:06:04 +01:00
if ( cache [ selectorName ] ) {
2022-04-02 10:26:41 +02:00
cache [ selectorName ] . delete ( trimUndefinedValues ( args ) ) ;
2020-12-10 14:06:04 +01:00
}
} ,
2021-07-23 11:58:50 +02:00
markAsRunning ( selectorName , args ) {
2020-12-10 14:06:04 +01:00
if ( ! cache [ selectorName ] ) {
2022-06-16 14:03:35 +02:00
cache [ selectorName ] = new ( equivalent _key _map _default ( ) ) ( ) ;
2020-12-10 14:06:04 +01:00
}
2022-04-02 10:26:41 +02:00
cache [ selectorName ] . set ( trimUndefinedValues ( args ) , true ) ;
2020-12-10 14:06:04 +01:00
}
} ;
}
2025-12-12 13:15:55 +01:00
function createBindingCache ( getItem , bindItem ) {
const cache = /* @__PURE__ */ new WeakMap ( ) ;
2023-09-26 10:33:34 +02:00
return {
2025-12-12 13:15:55 +01:00
get ( itemName ) {
const item = getItem ( itemName ) ;
if ( ! item ) {
return null ;
}
2023-09-26 10:33:34 +02:00
let boundItem = cache . get ( item ) ;
if ( ! boundItem ) {
2025-12-12 13:15:55 +01:00
boundItem = bindItem ( item , itemName ) ;
2023-09-26 10:33:34 +02:00
cache . set ( item , boundItem ) ;
}
return boundItem ;
}
} ;
}
2025-12-12 13:15:55 +01:00
function createPrivateProxy ( publicItems , privateItems ) {
return new Proxy ( publicItems , {
get : ( target , itemName ) => privateItems . get ( itemName ) || Reflect . get ( target , itemName )
} ) ;
}
2021-04-27 08:32:47 +02:00
function createReduxStore ( key , options ) {
2023-04-26 17:39:43 +02:00
const privateActions = { } ;
const privateSelectors = { } ;
const privateRegistrationFunctions = {
privateActions ,
2025-12-12 13:15:55 +01:00
registerPrivateActions : ( actions ) => {
2023-04-26 17:39:43 +02:00
Object . assign ( privateActions , actions ) ;
} ,
privateSelectors ,
2025-12-12 13:15:55 +01:00
registerPrivateSelectors : ( selectors ) => {
2023-04-26 17:39:43 +02:00
Object . assign ( privateSelectors , selectors ) ;
}
} ;
const storeDescriptor = {
2021-04-27 08:32:47 +02:00
name : key ,
2025-12-12 13:15:55 +01:00
instantiate : ( registry ) => {
const listeners = /* @__PURE__ */ new Set ( ) ;
2021-07-23 11:58:50 +02:00
const reducer = options . reducer ;
const thunkArgs = {
registry ,
2021-04-27 08:32:47 +02:00
get dispatch ( ) {
2025-12-12 13:15:55 +01:00
return thunkDispatch ;
2021-04-27 08:32:47 +02:00
} ,
get select ( ) {
2025-12-12 13:15:55 +01:00
return thunkSelect ;
2021-04-27 08:32:47 +02:00
} ,
get resolveSelect ( ) {
2025-12-12 13:15:55 +01:00
return resolveSelectors ;
2021-04-27 08:32:47 +02:00
}
} ;
2025-12-12 13:15:55 +01:00
const store = instantiateReduxStore (
key ,
options ,
registry ,
thunkArgs
) ;
2023-04-26 17:39:43 +02:00
lock ( store , privateRegistrationFunctions ) ;
2021-07-23 11:58:50 +02:00
const resolversCache = createResolversCache ( ) ;
2023-09-26 10:33:34 +02:00
function bindAction ( action ) {
return ( ... args ) => Promise . resolve ( store . dispatch ( action ( ... args ) ) ) ;
}
2023-12-07 09:44:11 +01:00
const actions = {
... mapValues ( actions _namespaceObject , bindAction ) ,
2023-09-26 10:33:34 +02:00
... mapValues ( options . actions , bindAction )
} ;
2025-12-12 13:15:55 +01:00
const allActions = createPrivateProxy (
actions ,
createBindingCache (
( name ) => privateActions [ name ] ,
bindAction
)
) ;
const thunkDispatch = new Proxy (
( action ) => store . dispatch ( action ) ,
{ get : ( target , name ) => allActions [ name ] }
) ;
2023-09-26 10:33:34 +02:00
lock ( actions , allActions ) ;
2025-12-12 13:15:55 +01:00
const resolvers = options . resolvers ? mapValues ( options . resolvers , mapResolver ) : { } ;
2023-09-26 10:33:34 +02:00
function bindSelector ( selector , selectorName ) {
if ( selector . isRegistrySelector ) {
selector . registry = registry ;
}
const boundSelector = ( ... args ) => {
2024-04-17 11:32:24 +02:00
args = normalize ( selector , args ) ;
2023-09-26 10:33:34 +02:00
const state = store . _ _unstableOriginalGetState ( ) ;
2024-04-17 11:32:24 +02:00
if ( selector . isRegistrySelector ) {
selector . registry = registry ;
}
2023-09-26 10:33:34 +02:00
return selector ( state . root , ... args ) ;
} ;
2024-04-17 11:32:24 +02:00
boundSelector . _ _unstableNormalizeArgs = selector . _ _unstableNormalizeArgs ;
2023-09-26 10:33:34 +02:00
const resolver = resolvers [ selectorName ] ;
if ( ! resolver ) {
boundSelector . hasResolver = false ;
return boundSelector ;
2023-04-26 17:39:43 +02:00
}
2025-12-12 13:15:55 +01:00
return mapSelectorWithResolver (
boundSelector ,
selectorName ,
resolver ,
store ,
resolversCache ,
boundMetadataSelectors
) ;
2023-09-26 10:33:34 +02:00
}
2024-04-17 11:32:24 +02:00
function bindMetadataSelector ( metaDataSelector ) {
2025-12-12 13:15:55 +01:00
const boundSelector = ( selectorName , selectorArgs , ... args ) => {
if ( selectorName ) {
const targetSelector = options . selectors ? . [ selectorName ] ;
if ( targetSelector ) {
selectorArgs = normalize (
targetSelector ,
selectorArgs
) ;
}
2024-04-17 11:32:24 +02:00
}
2025-12-12 13:15:55 +01:00
const state = store . _ _unstableOriginalGetState ( ) ;
return metaDataSelector (
state . metadata ,
selectorName ,
selectorArgs ,
... args
) ;
2023-09-26 10:33:34 +02:00
} ;
boundSelector . hasResolver = false ;
return boundSelector ;
2021-04-27 08:32:47 +02:00
}
2025-12-12 13:15:55 +01:00
const boundMetadataSelectors = mapValues (
selectors _namespaceObject ,
bindMetadataSelector
) ;
const boundSelectors = mapValues ( options . selectors , bindSelector ) ;
2023-12-07 09:44:11 +01:00
const selectors = {
2025-12-12 13:15:55 +01:00
... boundMetadataSelectors ,
... boundSelectors
2023-09-26 10:33:34 +02:00
} ;
2025-12-12 13:15:55 +01:00
const boundPrivateSelectors = createBindingCache (
( name ) => privateSelectors [ name ] ,
bindSelector
) ;
const allSelectors = createPrivateProxy (
selectors ,
boundPrivateSelectors
) ;
for ( const selectorName of Object . keys ( privateSelectors ) ) {
boundPrivateSelectors . get ( selectorName ) ;
2023-09-26 10:33:34 +02:00
}
2025-12-12 13:15:55 +01:00
const thunkSelect = new Proxy (
( selector ) => selector ( store . _ _unstableOriginalGetState ( ) ) ,
{ get : ( target , name ) => allSelectors [ name ] }
) ;
2023-09-26 10:33:34 +02:00
lock ( selectors , allSelectors ) ;
2025-12-12 13:15:55 +01:00
const bindResolveSelector = mapResolveSelector (
store ,
boundMetadataSelectors
) ;
const resolveSelectors = mapValues (
boundSelectors ,
bindResolveSelector
) ;
const allResolveSelectors = createPrivateProxy (
resolveSelectors ,
createBindingCache (
( name ) => boundPrivateSelectors . get ( name ) ,
bindResolveSelector
)
) ;
lock ( resolveSelectors , allResolveSelectors ) ;
const bindSuspendSelector = mapSuspendSelector (
store ,
boundMetadataSelectors
) ;
const suspendSelectors = {
... boundMetadataSelectors ,
// no special suspense behavior
... mapValues ( boundSelectors , bindSuspendSelector )
} ;
const allSuspendSelectors = createPrivateProxy (
suspendSelectors ,
createBindingCache (
( name ) => boundPrivateSelectors . get ( name ) ,
bindSuspendSelector
)
) ;
lock ( suspendSelectors , allSuspendSelectors ) ;
2021-07-23 11:58:50 +02:00
const getSelectors = ( ) => selectors ;
const getActions = ( ) => actions ;
2022-12-15 17:47:31 +01:00
const getResolveSelectors = ( ) => resolveSelectors ;
2023-12-07 09:44:11 +01:00
const getSuspendSelectors = ( ) => suspendSelectors ;
2021-04-27 08:32:47 +02:00
store . _ _unstableOriginalGetState = store . getState ;
2023-12-07 09:44:11 +01:00
store . getState = ( ) => store . _ _unstableOriginalGetState ( ) . root ;
2025-12-12 13:15:55 +01:00
const subscribe = store && ( ( listener ) => {
2023-12-07 09:44:11 +01:00
listeners . add ( listener ) ;
return ( ) => listeners . delete ( listener ) ;
} ) ;
let lastState = store . _ _unstableOriginalGetState ( ) ;
store . subscribe ( ( ) => {
const state = store . _ _unstableOriginalGetState ( ) ;
const hasChanged = state !== lastState ;
lastState = state ;
if ( hasChanged ) {
for ( const listener of listeners ) {
2021-04-27 08:32:47 +02:00
listener ( ) ;
}
2023-12-07 09:44:11 +01:00
}
} ) ;
2021-04-27 08:32:47 +02:00
return {
2021-07-23 11:58:50 +02:00
reducer ,
store ,
actions ,
selectors ,
resolvers ,
getSelectors ,
getResolveSelectors ,
2022-12-15 17:47:31 +01:00
getSuspendSelectors ,
2021-07-23 11:58:50 +02:00
getActions ,
subscribe
2021-04-27 08:32:47 +02:00
} ;
}
2023-12-07 09:44:11 +01:00
} ;
2023-04-26 17:39:43 +02:00
lock ( storeDescriptor , privateRegistrationFunctions ) ;
return storeDescriptor ;
2019-11-15 22:59:44 +01:00
}
2021-04-27 08:32:47 +02:00
function instantiateReduxStore ( key , options , registry , thunkArgs ) {
2023-12-07 09:44:11 +01:00
const controls = {
... options . controls ,
2021-07-23 11:58:50 +02:00
... builtinControls
} ;
2025-12-12 13:15:55 +01:00
const normalizedControls = mapValues (
controls ,
( control ) => control . isRegistryControl ? control ( registry ) : control
) ;
const middlewares = [
resolvers _cache _middleware _default ( registry , key ) ,
promise _middleware _default ,
external _wp _reduxRoutine _default ( ) ( normalizedControls ) ,
createThunkMiddleware ( thunkArgs )
] ;
2021-07-23 11:58:50 +02:00
const enhancers = [ applyMiddleware ( ... middlewares ) ] ;
2025-12-12 13:15:55 +01:00
if ( typeof window !== "undefined" && window . _ _REDUX _DEVTOOLS _EXTENSION _ _ ) {
enhancers . push (
window . _ _REDUX _DEVTOOLS _EXTENSION _ _ ( {
name : key ,
instanceId : key ,
serialize : {
replacer : devToolsReplacer
}
} )
) ;
2019-11-02 10:38:58 +01:00
}
2025-12-12 13:15:55 +01:00
const { reducer , initialState } = options ;
2024-04-17 11:32:24 +02:00
const enhancedReducer = combine _reducers _combineReducers ( {
2025-12-12 13:15:55 +01:00
metadata : reducer _default ,
2019-11-15 22:59:44 +01:00
root : reducer
2019-11-02 10:38:58 +01:00
} ) ;
2025-12-12 13:15:55 +01:00
return createStore (
enhancedReducer ,
{ root : initialState } ,
( 0 , external _wp _compose _namespaceObject . compose ) ( enhancers )
) ;
}
function mapResolveSelector ( store , boundMetadataSelectors ) {
return ( selector , selectorName ) => {
2022-06-16 14:03:35 +02:00
if ( ! selector . hasResolver ) {
2023-09-26 10:33:34 +02:00
return async ( ... args ) => selector . apply ( null , args ) ;
2022-04-02 10:26:41 +02:00
}
2025-12-12 13:15:55 +01:00
return ( ... args ) => new Promise ( ( resolve , reject ) => {
const hasFinished = ( ) => {
return boundMetadataSelectors . hasFinishedResolution (
selectorName ,
args
) ;
} ;
const finalize = ( result2 ) => {
const hasFailed = boundMetadataSelectors . hasResolutionFailed (
selectorName ,
args
) ;
if ( hasFailed ) {
const error = boundMetadataSelectors . getResolutionError (
selectorName ,
args
) ;
reject ( error ) ;
} else {
resolve ( result2 ) ;
}
} ;
const getResult = ( ) => selector . apply ( null , args ) ;
const result = getResult ( ) ;
if ( hasFinished ( ) ) {
return finalize ( result ) ;
}
const unsubscribe = store . subscribe ( ( ) => {
2022-04-02 10:26:41 +02:00
if ( hasFinished ( ) ) {
2025-12-12 13:15:55 +01:00
unsubscribe ( ) ;
finalize ( getResult ( ) ) ;
2022-04-02 10:26:41 +02:00
}
} ) ;
2025-12-12 13:15:55 +01:00
} ) ;
} ;
2019-11-15 22:59:44 +01:00
}
2025-12-12 13:15:55 +01:00
function mapSuspendSelector ( store , boundMetadataSelectors ) {
return ( selector , selectorName ) => {
2022-12-15 17:47:31 +01:00
if ( ! selector . hasResolver ) {
return selector ;
}
2023-09-26 10:33:34 +02:00
return ( ... args ) => {
2022-12-15 17:47:31 +01:00
const result = selector . apply ( null , args ) ;
2025-12-12 13:15:55 +01:00
if ( boundMetadataSelectors . hasFinishedResolution (
selectorName ,
args
) ) {
if ( boundMetadataSelectors . hasResolutionFailed (
selectorName ,
args
) ) {
throw boundMetadataSelectors . getResolutionError (
selectorName ,
args
) ;
2022-12-15 17:47:31 +01:00
}
return result ;
}
2025-12-12 13:15:55 +01:00
throw new Promise ( ( resolve ) => {
2022-12-15 17:47:31 +01:00
const unsubscribe = store . subscribe ( ( ) => {
2025-12-12 13:15:55 +01:00
if ( boundMetadataSelectors . hasFinishedResolution (
selectorName ,
args
) ) {
2022-12-15 17:47:31 +01:00
resolve ( ) ;
unsubscribe ( ) ;
}
} ) ;
} ) ;
} ;
2025-12-12 13:15:55 +01:00
} ;
2022-12-15 17:47:31 +01:00
}
2025-12-12 13:15:55 +01:00
function mapResolver ( resolver ) {
if ( resolver . fulfill ) {
return resolver ;
}
return {
... resolver ,
// Copy the enumerable properties of the resolver function.
fulfill : resolver
// Add the fulfill method.
} ;
2023-09-26 10:33:34 +02:00
}
2025-12-12 13:15:55 +01:00
function mapSelectorWithResolver ( selector , selectorName , resolver , store , resolversCache , boundMetadataSelectors ) {
2023-09-26 10:33:34 +02:00
function fulfillSelector ( args ) {
const state = store . getState ( ) ;
2025-12-12 13:15:55 +01:00
if ( resolversCache . isRunning ( selectorName , args ) || typeof resolver . isFulfilled === "function" && resolver . isFulfilled ( state , ... args ) ) {
2023-09-26 10:33:34 +02:00
return ;
2019-11-15 22:59:44 +01:00
}
2025-12-12 13:15:55 +01:00
if ( boundMetadataSelectors . hasStartedResolution ( selectorName , args ) ) {
2023-09-26 10:33:34 +02:00
return ;
}
resolversCache . markAsRunning ( selectorName , args ) ;
setTimeout ( async ( ) => {
resolversCache . clear ( selectorName , args ) ;
2025-12-12 13:15:55 +01:00
store . dispatch (
startResolution ( selectorName , args )
) ;
2023-09-26 10:33:34 +02:00
try {
const action = resolver . fulfill ( ... args ) ;
if ( action ) {
await store . dispatch ( action ) ;
2021-07-23 11:58:50 +02:00
}
2025-12-12 13:15:55 +01:00
store . dispatch (
finishResolution ( selectorName , args )
) ;
2023-09-26 10:33:34 +02:00
} catch ( error ) {
2025-12-12 13:15:55 +01:00
store . dispatch (
failResolution ( selectorName , args , error )
) ;
2019-11-15 22:59:44 +01:00
}
2023-09-26 10:33:34 +02:00
} , 0 ) ;
2021-07-23 11:58:50 +02:00
}
2023-09-26 10:33:34 +02:00
const selectorResolver = ( ... args ) => {
2024-04-17 11:32:24 +02:00
args = normalize ( selector , args ) ;
2023-09-26 10:33:34 +02:00
fulfillSelector ( args ) ;
return selector ( ... args ) ;
} ;
selectorResolver . hasResolver = true ;
return selectorResolver ;
2021-07-23 11:58:50 +02:00
}
2024-04-17 11:32:24 +02:00
function normalize ( selector , args ) {
2025-12-12 13:15:55 +01:00
if ( selector . _ _unstableNormalizeArgs && typeof selector . _ _unstableNormalizeArgs === "function" && args ? . length ) {
2024-04-17 11:32:24 +02:00
return selector . _ _unstableNormalizeArgs ( args ) ;
}
return args ;
}
2025-12-12 13:15:55 +01:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/data/build-module/store/index.js
2024-04-17 11:32:24 +02:00
const coreDataStore = {
2025-12-12 13:15:55 +01:00
name : "core/data" ,
2024-04-17 11:32:24 +02:00
instantiate ( registry ) {
2025-12-12 13:15:55 +01:00
const getCoreDataSelector = ( selectorName ) => ( key , ... args ) => {
2024-04-17 11:32:24 +02:00
return registry . select ( key ) [ selectorName ] ( ... args ) ;
} ;
2025-12-12 13:15:55 +01:00
const getCoreDataAction = ( actionName ) => ( key , ... args ) => {
2024-04-17 11:32:24 +02:00
return registry . dispatch ( key ) [ actionName ] ( ... args ) ;
} ;
return {
getSelectors ( ) {
2025-12-12 13:15:55 +01:00
return Object . fromEntries (
[
"getIsResolving" ,
"hasStartedResolution" ,
"hasFinishedResolution" ,
"isResolving" ,
"getCachedResolvers"
] . map ( ( selectorName ) => [
selectorName ,
getCoreDataSelector ( selectorName )
] )
) ;
2024-04-17 11:32:24 +02:00
} ,
getActions ( ) {
2025-12-12 13:15:55 +01:00
return Object . fromEntries (
[
"startResolution" ,
"finishResolution" ,
"invalidateResolution" ,
"invalidateResolutionForStore" ,
"invalidateResolutionForStoreSelector"
] . map ( ( actionName ) => [
actionName ,
getCoreDataAction ( actionName )
] )
) ;
2024-04-17 11:32:24 +02:00
} ,
subscribe ( ) {
2025-12-12 13:15:55 +01:00
return ( ) => ( ) => {
} ;
2024-04-17 11:32:24 +02:00
}
} ;
}
} ;
2025-12-12 13:15:55 +01:00
var store _default = coreDataStore ;
2024-04-17 11:32:24 +02:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/data/build-module/utils/emitter.js
2022-04-02 10:26:41 +02:00
function createEmitter ( ) {
let isPaused = false ;
let isPending = false ;
2025-12-12 13:15:55 +01:00
const listeners = /* @__PURE__ */ new Set ( ) ;
const notifyListeners = ( ) => (
// We use Array.from to clone the listeners Set
// This ensures that we don't run a listener
// that was added as a response to another listener.
Array . from ( listeners ) . forEach ( ( listener ) => listener ( ) )
) ;
2022-04-02 10:26:41 +02:00
return {
get isPaused ( ) {
return isPaused ;
} ,
subscribe ( listener ) {
listeners . add ( listener ) ;
return ( ) => listeners . delete ( listener ) ;
} ,
pause ( ) {
isPaused = true ;
} ,
resume ( ) {
isPaused = false ;
if ( isPending ) {
isPending = false ;
notifyListeners ( ) ;
}
} ,
emit ( ) {
if ( isPaused ) {
isPending = true ;
return ;
}
notifyListeners ( ) ;
}
} ;
}
2019-11-02 10:38:58 +01:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/data/build-module/registry.js
2022-04-02 10:26:41 +02:00
2023-04-26 17:39:43 +02:00
2021-04-27 08:32:47 +02:00
2019-11-02 10:38:58 +01:00
2023-04-26 17:39:43 +02:00
function getStoreName ( storeNameOrDescriptor ) {
2025-12-12 13:15:55 +01:00
return typeof storeNameOrDescriptor === "string" ? storeNameOrDescriptor : storeNameOrDescriptor . name ;
2022-12-15 17:47:31 +01:00
}
2023-09-26 10:33:34 +02:00
function createRegistry ( storeConfigs = { } , parent = null ) {
2021-07-23 11:58:50 +02:00
const stores = { } ;
2022-04-02 10:26:41 +02:00
const emitter = createEmitter ( ) ;
2023-04-26 17:39:43 +02:00
let listeningStores = null ;
2019-11-15 22:59:44 +01:00
function globalListener ( ) {
2022-04-02 10:26:41 +02:00
emitter . emit ( ) ;
2019-11-15 22:59:44 +01:00
}
2023-04-26 17:39:43 +02:00
const subscribe = ( listener , storeNameOrDescriptor ) => {
if ( ! storeNameOrDescriptor ) {
return emitter . subscribe ( listener ) ;
2023-12-07 09:44:11 +01:00
}
2023-04-26 17:39:43 +02:00
const storeName = getStoreName ( storeNameOrDescriptor ) ;
const store = stores [ storeName ] ;
if ( store ) {
return store . subscribe ( listener ) ;
2023-12-07 09:44:11 +01:00
}
2023-04-26 17:39:43 +02:00
if ( ! parent ) {
return emitter . subscribe ( listener ) ;
}
return parent . subscribe ( listener , storeNameOrDescriptor ) ;
2019-11-15 22:59:44 +01:00
} ;
2022-06-16 14:03:35 +02:00
function select ( storeNameOrDescriptor ) {
2023-04-26 17:39:43 +02:00
const storeName = getStoreName ( storeNameOrDescriptor ) ;
2023-09-26 10:33:34 +02:00
listeningStores ? . add ( storeName ) ;
2021-07-23 11:58:50 +02:00
const store = stores [ storeName ] ;
2019-11-15 22:59:44 +01:00
if ( store ) {
return store . getSelectors ( ) ;
2019-11-02 10:38:58 +01:00
}
2023-09-26 10:33:34 +02:00
return parent ? . select ( storeName ) ;
2019-11-02 10:38:58 +01:00
}
2022-06-16 14:03:35 +02:00
function _ _unstableMarkListeningStores ( callback , ref ) {
2025-12-12 13:15:55 +01:00
listeningStores = /* @__PURE__ */ new Set ( ) ;
2022-12-15 17:47:31 +01:00
try {
return callback . call ( this ) ;
} finally {
ref . current = Array . from ( listeningStores ) ;
2023-04-26 17:39:43 +02:00
listeningStores = null ;
2022-12-15 17:47:31 +01:00
}
2021-04-27 08:32:47 +02:00
}
2022-06-16 14:03:35 +02:00
function resolveSelect ( storeNameOrDescriptor ) {
2023-04-26 17:39:43 +02:00
const storeName = getStoreName ( storeNameOrDescriptor ) ;
2023-09-26 10:33:34 +02:00
listeningStores ? . add ( storeName ) ;
2021-07-23 11:58:50 +02:00
const store = stores [ storeName ] ;
2021-04-27 08:32:47 +02:00
if ( store ) {
2021-07-23 11:58:50 +02:00
return store . getResolveSelectors ( ) ;
2021-04-27 08:32:47 +02:00
}
2021-07-23 11:58:50 +02:00
return parent && parent . resolveSelect ( storeName ) ;
2020-05-06 17:23:38 +02:00
}
2022-12-15 17:47:31 +01:00
function suspendSelect ( storeNameOrDescriptor ) {
2023-04-26 17:39:43 +02:00
const storeName = getStoreName ( storeNameOrDescriptor ) ;
2023-09-26 10:33:34 +02:00
listeningStores ? . add ( storeName ) ;
2022-12-15 17:47:31 +01:00
const store = stores [ storeName ] ;
if ( store ) {
return store . getSuspendSelectors ( ) ;
}
return parent && parent . suspendSelect ( storeName ) ;
}
2022-06-16 14:03:35 +02:00
function dispatch ( storeNameOrDescriptor ) {
2023-04-26 17:39:43 +02:00
const storeName = getStoreName ( storeNameOrDescriptor ) ;
2021-07-23 11:58:50 +02:00
const store = stores [ storeName ] ;
2019-11-15 22:59:44 +01:00
if ( store ) {
return store . getActions ( ) ;
2019-11-02 10:38:58 +01:00
}
2021-04-27 08:32:47 +02:00
return parent && parent . dispatch ( storeName ) ;
2023-12-07 09:44:11 +01:00
}
2019-11-15 22:59:44 +01:00
function withPlugins ( attributes ) {
2025-12-12 13:15:55 +01:00
return Object . fromEntries (
Object . entries ( attributes ) . map ( ( [ key , attribute ] ) => {
if ( typeof attribute !== "function" ) {
return [ key , attribute ] ;
}
return [
key ,
function ( ) {
return registry [ key ] . apply ( null , arguments ) ;
}
] ;
} )
) ;
2019-11-02 10:38:58 +01:00
}
2023-09-26 10:33:34 +02:00
function registerStoreInstance ( name , createStore ) {
if ( stores [ name ] ) {
console . error ( 'Store "' + name + '" is already registered.' ) ;
return stores [ name ] ;
}
const store = createStore ( ) ;
2025-12-12 13:15:55 +01:00
if ( typeof store . getSelectors !== "function" ) {
throw new TypeError ( "store.getSelectors must be a function" ) ;
2019-11-02 10:38:58 +01:00
}
2025-12-12 13:15:55 +01:00
if ( typeof store . getActions !== "function" ) {
throw new TypeError ( "store.getActions must be a function" ) ;
2019-11-15 22:59:44 +01:00
}
2025-12-12 13:15:55 +01:00
if ( typeof store . subscribe !== "function" ) {
throw new TypeError ( "store.subscribe must be a function" ) ;
2023-12-07 09:44:11 +01:00
}
2022-06-16 14:03:35 +02:00
store . emitter = createEmitter ( ) ;
const currentSubscribe = store . subscribe ;
2025-12-12 13:15:55 +01:00
store . subscribe = ( listener ) => {
2022-06-16 14:03:35 +02:00
const unsubscribeFromEmitter = store . emitter . subscribe ( listener ) ;
const unsubscribeFromStore = currentSubscribe ( ( ) => {
if ( store . emitter . isPaused ) {
store . emitter . emit ( ) ;
2022-04-02 10:26:41 +02:00
return ;
}
listener ( ) ;
} ) ;
return ( ) => {
2023-09-26 10:33:34 +02:00
unsubscribeFromStore ? . ( ) ;
unsubscribeFromEmitter ? . ( ) ;
2022-04-02 10:26:41 +02:00
} ;
} ;
2022-06-16 14:03:35 +02:00
stores [ name ] = store ;
2023-12-07 09:44:11 +01:00
store . subscribe ( globalListener ) ;
2023-04-26 17:39:43 +02:00
if ( parent ) {
try {
2025-12-12 13:15:55 +01:00
unlock ( store . store ) . registerPrivateActions (
unlock ( parent ) . privateActionsOf ( name )
) ;
unlock ( store . store ) . registerPrivateSelectors (
unlock ( parent ) . privateSelectorsOf ( name )
) ;
2023-12-07 09:44:11 +01:00
} catch ( e ) {
2023-04-26 17:39:43 +02:00
}
}
2023-09-26 10:33:34 +02:00
return store ;
2022-06-16 14:03:35 +02:00
}
function register ( store ) {
2025-12-12 13:15:55 +01:00
registerStoreInstance (
store . name ,
( ) => store . instantiate ( registry )
) ;
2022-06-16 14:03:35 +02:00
}
function registerGenericStore ( name , store ) {
2025-12-12 13:15:55 +01:00
external _wp _deprecated _default ( ) ( "wp.data.registerGenericStore" , {
since : "5.9" ,
alternative : "wp.data.register( storeDescriptor )"
2022-06-16 14:03:35 +02:00
} ) ;
2023-09-26 10:33:34 +02:00
registerStoreInstance ( name , ( ) => store ) ;
2019-11-02 10:38:58 +01:00
}
2022-06-16 14:03:35 +02:00
function registerStore ( storeName , options ) {
if ( ! options . reducer ) {
2025-12-12 13:15:55 +01:00
throw new TypeError ( "Must specify store reducer" ) ;
2022-06-16 14:03:35 +02:00
}
2025-12-12 13:15:55 +01:00
const store = registerStoreInstance (
storeName ,
( ) => createReduxStore ( storeName , options ) . instantiate ( registry )
) ;
2022-06-16 14:03:35 +02:00
return store . store ;
2021-04-27 08:32:47 +02:00
}
2022-04-02 10:26:41 +02:00
function batch ( callback ) {
2023-09-26 10:33:34 +02:00
if ( emitter . isPaused ) {
callback ( ) ;
return ;
}
2022-04-02 10:26:41 +02:00
emitter . pause ( ) ;
2025-12-12 13:15:55 +01:00
Object . values ( stores ) . forEach ( ( store ) => store . emitter . pause ( ) ) ;
2025-02-28 08:42:11 +01:00
try {
callback ( ) ;
} finally {
emitter . resume ( ) ;
2025-12-12 13:15:55 +01:00
Object . values ( stores ) . forEach (
( store ) => store . emitter . resume ( )
) ;
2025-02-28 08:42:11 +01:00
}
2022-04-02 10:26:41 +02:00
}
2021-07-23 11:58:50 +02:00
let registry = {
2022-04-02 10:26:41 +02:00
batch ,
2021-07-23 11:58:50 +02:00
stores ,
2019-11-15 22:59:44 +01:00
namespaces : stores ,
// TODO: Deprecate/remove this.
2021-07-23 11:58:50 +02:00
subscribe ,
select ,
resolveSelect ,
2022-12-15 17:47:31 +01:00
suspendSelect ,
2021-07-23 11:58:50 +02:00
dispatch ,
use ,
register ,
2022-06-16 14:03:35 +02:00
registerGenericStore ,
registerStore ,
2023-04-26 17:39:43 +02:00
_ _unstableMarkListeningStores
2023-12-07 09:44:11 +01:00
} ;
2019-11-15 22:59:44 +01:00
function use ( plugin , options ) {
2022-06-16 14:03:35 +02:00
if ( ! plugin ) {
return ;
}
2023-12-07 09:44:11 +01:00
registry = {
... registry ,
2021-07-23 11:58:50 +02:00
... plugin ( registry , options )
} ;
2019-11-15 22:59:44 +01:00
return registry ;
}
2025-12-12 13:15:55 +01:00
registry . register ( store _default ) ;
2022-06-16 14:03:35 +02:00
for ( const [ name , config ] of Object . entries ( storeConfigs ) ) {
registry . register ( createReduxStore ( name , config ) ) ;
}
2019-11-15 22:59:44 +01:00
if ( parent ) {
parent . subscribe ( globalListener ) ;
}
2023-04-26 17:39:43 +02:00
const registryWithPlugins = withPlugins ( registry ) ;
lock ( registryWithPlugins , {
2025-12-12 13:15:55 +01:00
privateActionsOf : ( name ) => {
2023-04-26 17:39:43 +02:00
try {
return unlock ( stores [ name ] . store ) . privateActions ;
} catch ( e ) {
return { } ;
}
} ,
2025-12-12 13:15:55 +01:00
privateSelectorsOf : ( name ) => {
2023-04-26 17:39:43 +02:00
try {
return unlock ( stores [ name ] . store ) . privateSelectors ;
} catch ( e ) {
return { } ;
}
}
} ) ;
return registryWithPlugins ;
2019-11-15 22:59:44 +01:00
}
2019-11-02 10:38:58 +01:00
2025-12-12 13:15:55 +01:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/data/build-module/default-registry.js
2019-11-02 10:38:58 +01:00
2025-12-12 13:15:55 +01:00
var default _registry _default = createRegistry ( ) ;
2019-11-02 10:38:58 +01:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/is-plain-object/dist/is-plain-object.mjs
2022-12-15 17:47:31 +01:00
/ * !
* is - plain - object < https : //github.com/jonschlinkert/is-plain-object>
*
* Copyright ( c ) 2014 - 2017 , Jon Schlinkert .
* Released under the MIT License .
* /
function is _plain _object _isObject ( o ) {
return Object . prototype . toString . call ( o ) === '[object Object]' ;
}
function is _plain _object _isPlainObject ( o ) {
var ctor , prot ;
if ( is _plain _object _isObject ( o ) === false ) return false ;
// If has modified constructor
ctor = o . constructor ;
if ( ctor === undefined ) return true ;
// If has modified prototype
prot = ctor . prototype ;
if ( is _plain _object _isObject ( prot ) === false ) return false ;
// If constructor does not have an Object-specific method
if ( prot . hasOwnProperty ( 'isPrototypeOf' ) === false ) {
return false ;
}
// Most likely a plain Object
return true ;
}
2023-09-26 10:33:34 +02:00
// EXTERNAL MODULE: ./node_modules/deepmerge/dist/cjs.js
2024-04-17 11:32:24 +02:00
var cjs = _ _webpack _require _ _ ( 66 ) ;
2023-09-26 10:33:34 +02:00
var cjs _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( cjs ) ;
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/data/build-module/plugins/persistence/storage/object.js
2021-07-23 11:58:50 +02:00
let objectStorage ;
const storage = {
getItem ( key ) {
2019-11-15 22:59:44 +01:00
if ( ! objectStorage || ! objectStorage [ key ] ) {
return null ;
}
return objectStorage [ key ] ;
} ,
2021-07-23 11:58:50 +02:00
setItem ( key , value ) {
2019-11-15 22:59:44 +01:00
if ( ! objectStorage ) {
2021-07-23 11:58:50 +02:00
storage . clear ( ) ;
2019-11-15 22:59:44 +01:00
}
objectStorage [ key ] = String ( value ) ;
} ,
2021-07-23 11:58:50 +02:00
clear ( ) {
2025-12-12 13:15:55 +01:00
objectStorage = /* @__PURE__ */ Object . create ( null ) ;
2019-11-15 22:59:44 +01:00
}
} ;
2025-12-12 13:15:55 +01:00
var object _default = storage ;
2019-11-02 10:38:58 +01:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/data/build-module/plugins/persistence/storage/default.js
2019-11-02 10:38:58 +01:00
2021-07-23 11:58:50 +02:00
let default _storage ;
2019-11-15 22:59:44 +01:00
try {
default _storage = window . localStorage ;
2025-12-12 13:15:55 +01:00
default _storage . setItem ( "__wpDataTestLocalStorage" , "" ) ;
default _storage . removeItem ( "__wpDataTestLocalStorage" ) ;
2019-11-15 22:59:44 +01:00
} catch ( error ) {
2025-12-12 13:15:55 +01:00
default _storage = object _default ;
2019-11-15 22:59:44 +01:00
}
2025-12-12 13:15:55 +01:00
var default _default = default _storage ;
2019-11-02 10:38:58 +01:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/data/build-module/plugins/persistence/index.js
2020-05-06 17:23:38 +02:00
2019-11-02 10:38:58 +01:00
2023-12-07 09:44:11 +01:00
2025-12-12 13:15:55 +01:00
const DEFAULT _STORAGE = default _default ;
const DEFAULT _STORAGE _KEY = "WP_DATA" ;
const withLazySameState = ( reducer ) => ( state , action ) => {
2021-07-23 11:58:50 +02:00
if ( action . nextState === state ) {
return state ;
}
return reducer ( state , action ) ;
2019-11-15 22:59:44 +01:00
} ;
function createPersistenceInterface ( options ) {
2025-12-12 13:15:55 +01:00
const { storage = DEFAULT _STORAGE , storageKey = DEFAULT _STORAGE _KEY } = options ;
2021-07-23 11:58:50 +02:00
let data ;
2019-11-15 22:59:44 +01:00
function getData ( ) {
2025-12-12 13:15:55 +01:00
if ( data === void 0 ) {
2021-07-23 11:58:50 +02:00
const persisted = storage . getItem ( storageKey ) ;
2019-11-15 22:59:44 +01:00
if ( persisted === null ) {
data = { } ;
} else {
try {
data = JSON . parse ( persisted ) ;
} catch ( error ) {
data = { } ;
}
2019-11-02 10:38:58 +01:00
}
2019-11-15 22:59:44 +01:00
}
return data ;
}
function setData ( key , value ) {
2025-12-12 13:15:55 +01:00
data = { ... data , [ key ] : value } ;
2019-11-15 22:59:44 +01:00
storage . setItem ( storageKey , JSON . stringify ( data ) ) ;
}
return {
get : getData ,
set : setData
} ;
}
2020-09-15 14:29:22 +02:00
function persistencePlugin ( registry , pluginOptions ) {
2021-07-23 11:58:50 +02:00
const persistence = createPersistenceInterface ( pluginOptions ) ;
2021-04-27 08:32:47 +02:00
function createPersistOnChange ( getState , storeName , keys ) {
2021-07-23 11:58:50 +02:00
let getPersistedState ;
2019-11-15 22:59:44 +01:00
if ( Array . isArray ( keys ) ) {
2025-12-12 13:15:55 +01:00
const reducers = keys . reduce (
( accumulator , key ) => Object . assign ( accumulator , {
[ key ] : ( state , action ) => action . nextState [ key ]
} ) ,
{ }
) ;
getPersistedState = withLazySameState (
build _module _combineReducers ( reducers )
) ;
2019-11-15 22:59:44 +01:00
} else {
2021-07-23 11:58:50 +02:00
getPersistedState = ( state , action ) => action . nextState ;
2019-11-15 22:59:44 +01:00
}
2025-12-12 13:15:55 +01:00
let lastState = getPersistedState ( void 0 , {
2019-11-15 22:59:44 +01:00
nextState : getState ( )
} ) ;
2021-07-23 11:58:50 +02:00
return ( ) => {
const state = getPersistedState ( lastState , {
2019-11-15 22:59:44 +01:00
nextState : getState ( )
} ) ;
if ( state !== lastState ) {
2021-04-27 08:32:47 +02:00
persistence . set ( storeName , state ) ;
2019-11-15 22:59:44 +01:00
lastState = state ;
}
} ;
}
return {
2021-07-23 11:58:50 +02:00
registerStore ( storeName , options ) {
2019-11-15 22:59:44 +01:00
if ( ! options . persist ) {
2021-04-27 08:32:47 +02:00
return registry . registerStore ( storeName , options ) ;
2023-12-07 09:44:11 +01:00
}
2021-07-23 11:58:50 +02:00
const persistedState = persistence . get ( ) [ storeName ] ;
2025-12-12 13:15:55 +01:00
if ( persistedState !== void 0 ) {
2021-07-23 11:58:50 +02:00
let initialState = options . reducer ( options . initialState , {
2025-12-12 13:15:55 +01:00
type : "@@WP/PERSISTENCE_RESTORE"
2019-11-15 22:59:44 +01:00
} ) ;
2022-12-15 17:47:31 +01:00
if ( is _plain _object _isPlainObject ( initialState ) && is _plain _object _isPlainObject ( persistedState ) ) {
2023-09-26 10:33:34 +02:00
initialState = cjs _default ( ) ( initialState , persistedState , {
isMergeableObject : is _plain _object _isPlainObject
} ) ;
2019-11-15 22:59:44 +01:00
} else {
initialState = persistedState ;
2019-11-02 10:38:58 +01:00
}
2023-12-07 09:44:11 +01:00
options = {
... options ,
2021-07-23 11:58:50 +02:00
initialState
} ;
2019-11-15 22:59:44 +01:00
}
2021-07-23 11:58:50 +02:00
const store = registry . registerStore ( storeName , options ) ;
2025-12-12 13:15:55 +01:00
store . subscribe (
createPersistOnChange (
store . getState ,
storeName ,
options . persist
)
) ;
2019-11-15 22:59:44 +01:00
return store ;
}
} ;
2020-09-15 14:29:22 +02:00
}
2025-12-12 13:15:55 +01:00
persistencePlugin . _ _unstableMigrate = ( ) => {
} ;
var persistence _default = persistencePlugin ;
2022-06-16 14:03:35 +02:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/data/build-module/plugins/index.js
2022-06-16 14:03:35 +02:00
2025-12-12 13:15:55 +01:00
; // external "ReactJSXRuntime"
const external _ReactJSXRuntime _namespaceObject = window [ "ReactJSXRuntime" ] ;
2025-04-25 12:30:07 +02:00
; // external ["wp","priorityQueue"]
2024-04-17 11:32:24 +02:00
const external _wp _priorityQueue _namespaceObject = window [ "wp" ] [ "priorityQueue" ] ;
2025-04-25 12:30:07 +02:00
; // external ["wp","element"]
2024-04-17 11:32:24 +02:00
const external _wp _element _namespaceObject = window [ "wp" ] [ "element" ] ;
2025-04-25 12:30:07 +02:00
; // external ["wp","isShallowEqual"]
2024-04-17 11:32:24 +02:00
const external _wp _isShallowEqual _namespaceObject = window [ "wp" ] [ "isShallowEqual" ] ;
2022-06-16 14:03:35 +02:00
var external _wp _isShallowEqual _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( external _wp _isShallowEqual _namespaceObject ) ;
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/data/build-module/components/registry-provider/context.js
2019-11-02 10:38:58 +01:00
2023-12-07 09:44:11 +01:00
2025-12-12 13:15:55 +01:00
const Context = ( 0 , external _wp _element _namespaceObject . createContext ) ( default _registry _default ) ;
Context . displayName = "RegistryProviderContext" ;
const { Consumer , Provider } = Context ;
2021-07-23 11:58:50 +02:00
const RegistryConsumer = Consumer ;
2025-12-12 13:15:55 +01:00
var context _default = Provider ;
2023-12-07 09:44:11 +01:00
2019-11-02 10:38:58 +01:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/data/build-module/components/registry-provider/use-registry.js
2019-11-02 10:38:58 +01:00
2019-11-15 22:59:44 +01:00
function useRegistry ( ) {
2022-06-16 14:03:35 +02:00
return ( 0 , external _wp _element _namespaceObject . useContext ) ( Context ) ;
2019-11-02 10:38:58 +01:00
}
2025-12-12 13:15:55 +01:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/data/build-module/components/async-mode-provider/context.js
2019-11-15 22:59:44 +01:00
2022-06-16 14:03:35 +02:00
const context _Context = ( 0 , external _wp _element _namespaceObject . createContext ) ( false ) ;
2025-12-12 13:15:55 +01:00
context _Context . displayName = "AsyncModeContext" ;
const { Consumer : context _Consumer , Provider : context _Provider } = context _Context ;
2022-06-16 14:03:35 +02:00
const AsyncModeConsumer = ( /* unused pure expression or super */ null && ( context _Consumer ) ) ;
2025-12-12 13:15:55 +01:00
var context _context _default = context _Provider ;
2023-12-07 09:44:11 +01:00
2019-11-15 22:59:44 +01:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/data/build-module/components/async-mode-provider/use-async-mode.js
2019-11-02 10:38:58 +01:00
2023-12-07 09:44:11 +01:00
2019-11-15 22:59:44 +01:00
function useAsyncMode ( ) {
2022-06-16 14:03:35 +02:00
return ( 0 , external _wp _element _namespaceObject . useContext ) ( context _Context ) ;
2019-11-15 22:59:44 +01:00
}
2019-11-02 10:38:58 +01:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/data/build-module/components/use-select/index.js
2019-11-02 10:38:58 +01:00
2023-12-07 09:44:11 +01:00
2019-11-02 10:38:58 +01:00
2022-06-16 14:03:35 +02:00
const renderQueue = ( 0 , external _wp _priorityQueue _namespaceObject . createQueue ) ( ) ;
2025-04-25 12:30:07 +02:00
function warnOnUnstableReference ( a , b ) {
if ( ! a || ! b ) {
return ;
}
2025-12-12 13:15:55 +01:00
const keys = typeof a === "object" && typeof b === "object" ? Object . keys ( a ) . filter ( ( k ) => a [ k ] !== b [ k ] ) : [ ] ;
console . warn (
"The `useSelect` hook returns different values when called with the same state and parameters.\nThis can lead to unnecessary re-renders and performance issues if not fixed.\n\nNon-equal value keys: %s\n\n" ,
keys . join ( ", " )
) ;
2025-04-25 12:30:07 +02:00
}
2023-04-26 17:39:43 +02:00
function Store ( registry , suspense ) {
const select = suspense ? registry . suspendSelect : registry . select ;
const queueContext = { } ;
let lastMapSelect ;
let lastMapResult ;
let lastMapResultValid = false ;
let lastIsAsync ;
2023-09-26 10:33:34 +02:00
let subscriber ;
2023-12-07 09:44:11 +01:00
let didWarnUnstableReference ;
2025-12-12 13:15:55 +01:00
const storeStatesOnMount = /* @__PURE__ */ new Map ( ) ;
2024-04-17 11:32:24 +02:00
function getStoreState ( name ) {
2025-12-12 13:15:55 +01:00
return registry . stores [ name ] ? . store ? . getState ? . ( ) ? ? { } ;
2024-04-17 11:32:24 +02:00
}
2025-12-12 13:15:55 +01:00
const createSubscriber = ( stores ) => {
2023-12-07 09:44:11 +01:00
const activeStores = [ ... stores ] ;
2025-12-12 13:15:55 +01:00
const activeSubscriptions = /* @__PURE__ */ new Set ( ) ;
2023-09-26 10:33:34 +02:00
function subscribe ( listener ) {
2024-04-17 11:32:24 +02:00
if ( lastMapResultValid ) {
for ( const name of activeStores ) {
if ( storeStatesOnMount . get ( name ) !== getStoreState ( name ) ) {
lastMapResultValid = false ;
}
}
}
storeStatesOnMount . clear ( ) ;
2023-09-26 10:33:34 +02:00
const onStoreChange = ( ) => {
lastMapResultValid = false ;
listener ( ) ;
} ;
const onChange = ( ) => {
if ( lastIsAsync ) {
renderQueue . add ( queueContext , onStoreChange ) ;
} else {
onStoreChange ( ) ;
}
} ;
const unsubs = [ ] ;
function subscribeStore ( storeName ) {
unsubs . push ( registry . subscribe ( onChange , storeName ) ) ;
2023-04-26 17:39:43 +02:00
}
2023-09-26 10:33:34 +02:00
for ( const storeName of activeStores ) {
subscribeStore ( storeName ) ;
}
activeSubscriptions . add ( subscribeStore ) ;
return ( ) => {
activeSubscriptions . delete ( subscribeStore ) ;
for ( const unsub of unsubs . values ( ) ) {
unsub ? . ( ) ;
2023-12-07 09:44:11 +01:00
}
2023-09-26 10:33:34 +02:00
renderQueue . cancel ( queueContext ) ;
} ;
2023-12-07 09:44:11 +01:00
}
2023-09-26 10:33:34 +02:00
function updateStores ( newStores ) {
for ( const newStore of newStores ) {
if ( activeStores . includes ( newStore ) ) {
continue ;
2023-12-07 09:44:11 +01:00
}
activeStores . push ( newStore ) ;
2023-09-26 10:33:34 +02:00
for ( const subscription of activeSubscriptions ) {
subscription ( newStore ) ;
}
}
}
2025-12-12 13:15:55 +01:00
return { subscribe , updateStores } ;
2023-04-26 17:39:43 +02:00
} ;
2023-09-26 10:33:34 +02:00
return ( mapSelect , isAsync ) => {
function updateValue ( ) {
2023-04-26 17:39:43 +02:00
if ( lastMapResultValid && mapSelect === lastMapSelect ) {
return lastMapResult ;
}
2025-12-12 13:15:55 +01:00
const listeningStores = { current : null } ;
const mapResult = registry . _ _unstableMarkListeningStores (
( ) => mapSelect ( select , registry ) ,
listeningStores
) ;
2025-04-25 12:30:07 +02:00
if ( true ) {
if ( ! didWarnUnstableReference ) {
const secondMapResult = mapSelect ( select , registry ) ;
if ( ! external _wp _isShallowEqual _default ( ) ( mapResult , secondMapResult ) ) {
warnOnUnstableReference ( mapResult , secondMapResult ) ;
didWarnUnstableReference = true ;
}
}
}
2023-09-26 10:33:34 +02:00
if ( ! subscriber ) {
2024-04-17 11:32:24 +02:00
for ( const name of listeningStores . current ) {
storeStatesOnMount . set ( name , getStoreState ( name ) ) ;
}
2023-09-26 10:33:34 +02:00
subscriber = createSubscriber ( listeningStores . current ) ;
} else {
subscriber . updateStores ( listeningStores . current ) ;
2023-12-07 09:44:11 +01:00
}
2023-04-26 17:39:43 +02:00
if ( ! external _wp _isShallowEqual _default ( ) ( lastMapResult , mapResult ) ) {
lastMapResult = mapResult ;
}
2023-09-26 10:33:34 +02:00
lastMapSelect = mapSelect ;
2023-04-26 17:39:43 +02:00
lastMapResultValid = true ;
}
function getValue ( ) {
2023-09-26 10:33:34 +02:00
updateValue ( ) ;
2023-04-26 17:39:43 +02:00
return lastMapResult ;
2023-12-07 09:44:11 +01:00
}
2023-04-26 17:39:43 +02:00
if ( lastIsAsync && ! isAsync ) {
lastMapResultValid = false ;
renderQueue . cancel ( queueContext ) ;
}
2023-09-26 10:33:34 +02:00
updateValue ( ) ;
2023-12-07 09:44:11 +01:00
lastIsAsync = isAsync ;
2025-12-12 13:15:55 +01:00
return { subscribe : subscriber . subscribe , getValue } ;
2023-04-26 17:39:43 +02:00
} ;
}
2025-04-25 12:30:07 +02:00
function _useStaticSelect ( storeName ) {
2023-04-26 17:39:43 +02:00
return useRegistry ( ) . select ( storeName ) ;
}
2025-04-25 12:30:07 +02:00
function _useMappingSelect ( suspense , mapSelect , deps ) {
2023-04-26 17:39:43 +02:00
const registry = useRegistry ( ) ;
const isAsync = useAsyncMode ( ) ;
2025-12-12 13:15:55 +01:00
const store = ( 0 , external _wp _element _namespaceObject . useMemo ) (
( ) => Store ( registry , suspense ) ,
[ registry , suspense ]
) ;
2023-04-26 17:39:43 +02:00
const selector = ( 0 , external _wp _element _namespaceObject . useCallback ) ( mapSelect , deps ) ;
2025-12-12 13:15:55 +01:00
const { subscribe , getValue } = store ( selector , isAsync ) ;
2023-04-26 17:39:43 +02:00
const result = ( 0 , external _wp _element _namespaceObject . useSyncExternalStore ) ( subscribe , getValue , getValue ) ;
( 0 , external _wp _element _namespaceObject . useDebugValue ) ( result ) ;
return result ;
}
function useSelect ( mapSelect , deps ) {
2025-12-12 13:15:55 +01:00
const staticSelectMode = typeof mapSelect !== "function" ;
2023-04-26 17:39:43 +02:00
const staticSelectModeRef = ( 0 , external _wp _element _namespaceObject . useRef ) ( staticSelectMode ) ;
if ( staticSelectMode !== staticSelectModeRef . current ) {
2025-12-12 13:15:55 +01:00
const prevMode = staticSelectModeRef . current ? "static" : "mapping" ;
const nextMode = staticSelectMode ? "static" : "mapping" ;
throw new Error (
` Switching useSelect from ${ prevMode } to ${ nextMode } is not allowed `
) ;
2019-11-15 22:59:44 +01:00
}
2025-04-25 12:30:07 +02:00
return staticSelectMode ? _useStaticSelect ( mapSelect ) : _useMappingSelect ( false , mapSelect , deps ) ;
2019-11-15 22:59:44 +01:00
}
2022-12-15 17:47:31 +01:00
function useSuspenseSelect ( mapSelect , deps ) {
2025-04-25 12:30:07 +02:00
return _useMappingSelect ( true , mapSelect , deps ) ;
2022-12-15 17:47:31 +01:00
}
2019-11-02 10:38:58 +01:00
2023-12-07 09:44:11 +01:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/data/build-module/components/with-select/index.js
2019-11-02 10:38:58 +01:00
2019-11-15 22:59:44 +01:00
2023-09-26 10:33:34 +02:00
2025-12-12 13:15:55 +01:00
const withSelect = ( mapSelectToProps ) => ( 0 , external _wp _compose _namespaceObject . createHigherOrderComponent ) (
( WrappedComponent ) => ( 0 , external _wp _compose _namespaceObject . pure ) ( ( ownProps ) => {
const mapSelect = ( select , registry ) => mapSelectToProps ( select , ownProps , registry ) ;
const mergeProps = useSelect ( mapSelect ) ;
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( WrappedComponent , { ... ownProps , ... mergeProps } ) ;
} ) ,
"withSelect"
) ;
var with _select _default = withSelect ;
2025-02-28 08:42:11 +01:00
2019-11-02 10:38:58 +01:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/data/build-module/components/use-dispatch/use-dispatch-with-map.js
2019-11-02 10:38:58 +01:00
2023-12-07 09:44:11 +01:00
2019-11-15 22:59:44 +01:00
2021-07-23 11:58:50 +02:00
const useDispatchWithMap = ( dispatchMap , deps ) => {
const registry = useRegistry ( ) ;
2025-02-28 08:42:11 +01:00
const currentDispatchMapRef = ( 0 , external _wp _element _namespaceObject . useRef ) ( dispatchMap ) ;
2022-06-16 14:03:35 +02:00
( 0 , external _wp _compose _namespaceObject . useIsomorphicLayoutEffect ) ( ( ) => {
2025-02-28 08:42:11 +01:00
currentDispatchMapRef . current = dispatchMap ;
2019-11-15 22:59:44 +01:00
} ) ;
2022-06-16 14:03:35 +02:00
return ( 0 , external _wp _element _namespaceObject . useMemo ) ( ( ) => {
2025-12-12 13:15:55 +01:00
const currentDispatchProps = currentDispatchMapRef . current (
registry . dispatch ,
registry
) ;
return Object . fromEntries (
Object . entries ( currentDispatchProps ) . map (
( [ propName , dispatcher ] ) => {
if ( typeof dispatcher !== "function" ) {
console . warn (
` Property ${ propName } returned from dispatchMap in useDispatchWithMap must be a function. `
) ;
}
return [
propName ,
( ... args ) => currentDispatchMapRef . current ( registry . dispatch , registry ) [ propName ] ( ... args )
] ;
}
)
) ;
2021-07-23 11:58:50 +02:00
} , [ registry , ... deps ] ) ;
2019-11-15 22:59:44 +01:00
} ;
2025-12-12 13:15:55 +01:00
var use _dispatch _with _map _default = useDispatchWithMap ;
2019-11-02 10:38:58 +01:00
2023-12-07 09:44:11 +01:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/data/build-module/components/with-dispatch/index.js
2019-11-02 10:38:58 +01:00
2023-09-26 10:33:34 +02:00
2025-12-12 13:15:55 +01:00
const withDispatch = ( mapDispatchToProps ) => ( 0 , external _wp _compose _namespaceObject . createHigherOrderComponent ) (
( WrappedComponent ) => ( ownProps ) => {
const mapDispatch = ( dispatch , registry ) => mapDispatchToProps ( dispatch , ownProps , registry ) ;
const dispatchProps = use _dispatch _with _map _default ( mapDispatch , [ ] ) ;
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( WrappedComponent , { ... ownProps , ... dispatchProps } ) ;
} ,
"withDispatch"
) ;
var with _dispatch _default = withDispatch ;
2025-02-28 08:42:11 +01:00
2019-11-02 10:38:58 +01:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/data/build-module/components/with-registry/index.js
2023-12-07 09:44:11 +01:00
2019-11-02 10:38:58 +01:00
2025-12-12 13:15:55 +01:00
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 , { ... props , registry } ) } ) ,
"withRegistry"
) ;
var with _registry _default = withRegistry ;
2025-02-28 08:42:11 +01:00
2019-11-02 10:38:58 +01:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/data/build-module/components/use-dispatch/use-dispatch.js
2021-04-27 08:32:47 +02:00
2025-12-12 13:15:55 +01:00
const useDispatch = ( storeNameOrDescriptor ) => {
const { dispatch } = useRegistry ( ) ;
2022-06-16 14:03:35 +02:00
return storeNameOrDescriptor === void 0 ? dispatch : dispatch ( storeNameOrDescriptor ) ;
2020-09-15 14:29:22 +02:00
} ;
2025-12-12 13:15:55 +01:00
var use _dispatch _default = useDispatch ;
2023-09-26 10:33:34 +02:00
2023-12-07 09:44:11 +01:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/data/build-module/dispatch.js
2023-12-07 09:44:11 +01:00
2023-09-26 10:33:34 +02:00
function dispatch _dispatch ( storeNameOrDescriptor ) {
2025-12-12 13:15:55 +01:00
return default _registry _default . dispatch ( storeNameOrDescriptor ) ;
2023-09-26 10:33:34 +02:00
}
2023-12-07 09:44:11 +01:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/data/build-module/select.js
2023-12-07 09:44:11 +01:00
2023-09-26 10:33:34 +02:00
function select _select ( storeNameOrDescriptor ) {
2025-12-12 13:15:55 +01:00
return default _registry _default . select ( storeNameOrDescriptor ) ;
2023-09-26 10:33:34 +02:00
}
2021-04-27 08:32:47 +02:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/data/build-module/index.js
2021-04-27 08:32:47 +02:00
2019-11-02 10:38:58 +01:00
2020-12-10 14:06:04 +01:00
2023-09-26 10:33:34 +02:00
2023-12-07 09:44:11 +01:00
2025-02-28 08:42:11 +01:00
2019-11-02 10:38:58 +01:00
2024-04-17 11:32:24 +02:00
const build _module _combineReducers = combine _reducers _combineReducers ;
2025-12-12 13:15:55 +01:00
const build _module _resolveSelect = default _registry _default . resolveSelect ;
const suspendSelect = default _registry _default . suspendSelect ;
const subscribe = default _registry _default . subscribe ;
const registerGenericStore = default _registry _default . registerGenericStore ;
const registerStore = default _registry _default . registerStore ;
const use = default _registry _default . use ;
const register = default _registry _default . register ;
2023-12-07 09:44:11 +01:00
2019-11-02 10:38:58 +01:00
2022-06-16 14:03:35 +02:00
( window . wp = window . wp || { } ) . data = _ _webpack _exports _ _ ;
/******/ } ) ( )
;