: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
/******/ (() => { // webpackBootstrap
/******/ // The require scope
/******/ var __webpack_require__ = {};
/************************************************************************/
/******/ /* webpack/runtime/compat get default export */
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = (module) => {
/******/ var getter = module && module.__esModule ?
/******/ () => (module['default']) :
/******/ __webpack_require__.d(getter, { a: getter });
/******/ /* webpack/runtime/define property getters */
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ 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] });
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ /* webpack/runtime/make namespace object */
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/************************************************************************/
var __webpack_exports__ = {};
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
__unstableCreatePersistenceLayer: () => (/* binding */ __unstableCreatePersistenceLayer),
create: () => (/* reexport */ create)
;// CONCATENATED MODULE: external ["wp","apiFetch"]
const external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"];
var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject);
;// CONCATENATED MODULE: ./node_modules/@wordpress/preferences-persistence/build-module/create/debounce-async.js
* Performs a leading edge debounce of async functions.
* If three functions are throttled at the same time:
* - The first happens immediately.
* - The second is never called.
* - The third happens `delayMS` milliseconds after the first has resolved.
* This is distinct from `{ debounce } from @wordpress/compose` in that it
* waits for promise resolution.
* @param {Function} func A function that returns a promise.
* @param {number} delayMS A delay in milliseconds.
* @return {Function} A function that debounce whatever function is passed
function debounceAsync(func, delayMS) {
return async function debounced(...args) {
// This is a leading edge debounce. If there's no promise or timeout
// in progress, call the debounced function immediately.
if (!activePromise && !timeoutId) {
return new Promise((resolve, reject) => {
// Keep a reference to the promise.
activePromise = func(...args).then((...thenArgs) => {
// As soon this promise is complete, clear the way for the
// next one to happen immediately.
// Let any active promises finish before queuing the next request.
// Clear any active timeouts, abandoning any requests that have
// been queued but not been made.
// Trigger any trailing edge calls to the function.
return new Promise((resolve, reject) => {
// Schedule the next request but with a delay.
timeoutId = setTimeout(() => {
activePromise = func(...args).then((...thenArgs) => {
// As soon this promise is complete, clear the way for the
// next one to happen immediately.
;// CONCATENATED MODULE: ./node_modules/@wordpress/preferences-persistence/build-module/create/index.js
const localStorage = window.localStorage;
* Creates a persistence layer that stores data in WordPress user meta via the
* @param {Object} options
* @param {?Object} options.preloadedData Any persisted preferences data that should be preloaded.
* When set, the persistence layer will avoid fetching data
* @param {?string} options.localStorageRestoreKey The key to use for restoring the localStorage backup, used
* when the persistence layer calls `localStorage.getItem` or
* `localStorage.setItem`.
* @param {?number} options.requestDebounceMS Debounce requests to the API so that they only occur at
* minimum every `requestDebounceMS` milliseconds, and don't
* swamp the server. Defaults to 2500ms.
* @return {Object} A persistence layer for WordPress user meta.
localStorageRestoreKey = 'WP_PREFERENCES_RESTORE_DATA',
let cache = preloadedData;
const debouncedApiFetch = debounceAsync((external_wp_apiFetch_default()), requestDebounceMS);
const user = await external_wp_apiFetch_default()({
path: '/wp/v2/users/me?context=edit'
const serverData = user?.meta?.persisted_preferences;
const localData = JSON.parse(localStorage.getItem(localStorageRestoreKey));
// Date parse returns NaN for invalid input. Coerce anything invalid
// into a conveniently comparable zero.
const serverTimestamp = Date.parse(serverData?._modified) || 0;
const localTimestamp = Date.parse(localData?._modified) || 0;
// Prefer server data if it exists and is more recent.
// Otherwise fallback to localStorage data.
if (serverData && serverTimestamp >= localTimestamp) {
const dataWithTimestamp = {
_modified: new Date().toISOString()
cache = dataWithTimestamp;
// Store data in local storage as a fallback. If for some reason the
// api request does not complete or becomes unavailable, this data
// can be used to restore preferences.
localStorage.setItem(localStorageRestoreKey, JSON.stringify(dataWithTimestamp));
// The user meta endpoint seems susceptible to errors when consecutive
// requests are made in quick succession. Ensure there's a gap between
// any consecutive requests.
// Catch and do nothing with errors from the REST API.
// `keepalive` will still send the request in the background,
// even when a browser unload event might interrupt it.
// This should hopefully make things more resilient.
// This does have a size limit of 64kb, but the data is usually
persisted_preferences: dataWithTimestamp
;// CONCATENATED MODULE: ./node_modules/@wordpress/preferences-persistence/build-module/migrations/legacy-local-storage-data/move-feature-preferences.js
* Move the 'features' object in local storage from the sourceStoreName to the
* preferences store data structure.
* Previously, editors used a data structure like this for feature preferences:
* // ... other boolean 'feature' preferences
* And for a while these feature preferences lived in the interface package:
* In the preferences store, 'features' aren't considered special, they're
* merged to the root level of the scope along with other preferences:
* // ... any other preferences.
* This function handles moving from either the source store or the interface
* store to the preferences data structure.
* @param {Object} state The state before migration.
* @param {string} sourceStoreName The name of the store that has persisted
* preferences to migrate to the preferences
* @return {Object} The migrated state
function moveFeaturePreferences(state, sourceStoreName) {
const preferencesStoreName = 'core/preferences';
const interfaceStoreName = 'core/interface';
// Features most recently (and briefly) lived in the interface package.
// If data exists there, prioritize using that for the migration. If not
// also check the original package as the user may have updated from an
// older block editor version.
const interfaceFeatures = state?.[interfaceStoreName]?.preferences?.features?.[sourceStoreName];
const sourceFeatures = state?.[sourceStoreName]?.preferences?.features;
const featuresToMigrate = interfaceFeatures ? interfaceFeatures : sourceFeatures;
if (!featuresToMigrate) {
const existingPreferences = state?.[preferencesStoreName]?.preferences;
// Avoid migrating features again if they've previously been migrated.
if (existingPreferences?.[sourceStoreName]) {
let updatedInterfaceState;
const otherInterfaceState = state?.[interfaceStoreName];
const otherInterfaceScopes = state?.[interfaceStoreName]?.preferences?.features;
updatedInterfaceState = {
[sourceStoreName]: undefined
const otherSourceState = state?.[sourceStoreName];
const sourcePreferences = state?.[sourceStoreName]?.preferences;
// Set the feature values in the interface store, the features
// object is keyed by 'scope', which matches the store name for
[preferencesStoreName]: {
[sourceStoreName]: featuresToMigrate
...updatedInterfaceState,
;// CONCATENATED MODULE: ./node_modules/@wordpress/preferences-persistence/build-module/migrations/legacy-local-storage-data/move-third-party-feature-preferences.js
* The interface package previously had a public API that could be used by
* plugins to set persisted boolean 'feature' preferences.
* While usage was likely non-existent or very small, this function ensures
* those are migrated to the preferences data structure. The interface
* package's APIs have now been deprecated and use the preferences store.
* This will convert data that looks like this:
* @param {Object} state The local storage state
* @return {Object} The state with third party preferences moved to the
* preferences data structure.
function moveThirdPartyFeaturePreferencesToPreferences(state) {
const interfaceStoreName = 'core/interface';
const preferencesStoreName = 'core/preferences';
const interfaceScopes = state?.[interfaceStoreName]?.preferences?.features;
const interfaceScopeKeys = interfaceScopes ? Object.keys(interfaceScopes) : [];
if (!interfaceScopeKeys?.length) {
return interfaceScopeKeys.reduce(function (convertedState, scope) {
if (scope.startsWith('core')) {
const featuresToMigrate = interfaceScopes?.[scope];
if (!featuresToMigrate) {
const existingMigratedData = convertedState?.[preferencesStoreName]?.preferences?.[scope];
if (existingMigratedData) {
const otherPreferencesScopes = convertedState?.[preferencesStoreName]?.preferences;
const otherInterfaceState = convertedState?.[interfaceStoreName];
const otherInterfaceScopes = convertedState?.[interfaceStoreName]?.preferences?.features;
[preferencesStoreName]: {
...otherPreferencesScopes,
[scope]: featuresToMigrate
;// CONCATENATED MODULE: ./node_modules/@wordpress/preferences-persistence/build-module/migrations/legacy-local-storage-data/move-individual-preference.js
const identity = arg => arg;
* Migrates an individual item inside the `preferences` object for a package's store.
* Previously, some packages had individual 'preferences' of any data type, and many used
* complex nested data structures. For example:
* // ...other preferences.
* This function supports moving an individual preference like 'panels' above into the
* preferences package data structure.
* It supports moving a preference to a particular scope in the preferences store and
* optionally converting the data using a `convert` function.
* @param {Object} state The original state.
* @param {Object} migrate An options object that contains details of the migration.
* @param {string} migrate.from The name of the store to migrate from.
* @param {string} migrate.to The scope in the preferences store to migrate to.
* @param {string} key The key in the preferences object to migrate.
* @param {?Function} convert A function that converts preferences from one format to another.
function moveIndividualPreferenceToPreferences(state, {
}, key, convert = identity) {
const preferencesStoreName = 'core/preferences';
const sourcePreference = state?.[sourceStoreName]?.preferences?.[key];
// There's nothing to migrate, exit early.
if (sourcePreference === undefined) {
const targetPreference = state?.[preferencesStoreName]?.preferences?.[scope]?.[key];
// There's existing data at the target, so don't overwrite it, exit early.
const otherScopes = state?.[preferencesStoreName]?.preferences;
const otherPreferences = state?.[preferencesStoreName]?.preferences?.[scope];
const otherSourceState = state?.[sourceStoreName];